Merge remote-tracking branch 'aosp/master' into 'aosp/temp-consolidate-gfxstream-projects'

... to pull the Gfxstream parts of device/generic/goldfish-opengl
into hardware/google/gfxstream.

Bug: b/271464937
Test: presubmit
Change-Id: I35f9a5d0255774c3512a947809b8efa5166a0e77
diff --git a/system/GLESv1/Android.mk b/system/GLESv1/Android.mk
new file mode 100644
index 0000000..1090603
--- /dev/null
+++ b/system/GLESv1/Android.mk
@@ -0,0 +1,16 @@
+LOCAL_PATH := $(call my-dir)
+
+### GLESv1 implementation ###########################################
+$(call emugl-begin-shared-library,libGLESv1_CM_emulation)
+$(call emugl-import,libOpenglSystemCommon libGLESv1_enc lib_renderControl_enc)
+
+LOCAL_CFLAGS += -DLOG_TAG=\"GLES_emulation\" -DGL_GLEXT_PROTOTYPES
+
+LOCAL_SRC_FILES := gl.cpp
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 21 && echo PreLollipop),PreLollipop)
+    LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/egl
+else
+    LOCAL_MODULE_RELATIVE_PATH := egl
+endif
+
+$(call emugl-end-module)
diff --git a/system/GLESv1/CMakeLists.txt b/system/GLESv1/CMakeLists.txt
new file mode 100644
index 0000000..8cde20b
--- /dev/null
+++ b/system/GLESv1/CMakeLists.txt
@@ -0,0 +1,10 @@
+# This is an autogenerated file! Do not edit!
+# instead run make from .../device/generic/goldfish-opengl
+# which will re-generate this file.
+android_validate_sha256("${GOLDFISH_DEVICE_ROOT}/system/GLESv1/Android.mk" "e095cb082e3791719749cfc80b90560afd7348eb0d7895449d2509aa129bea75")
+set(GLESv1_CM_emulation_src gl.cpp)
+android_add_library(TARGET GLESv1_CM_emulation SHARED LICENSE Apache-2.0 SRC gl.cpp)
+target_include_directories(GLESv1_CM_emulation PRIVATE ${GOLDFISH_DEVICE_ROOT}/system/OpenglSystemCommon/bionic-include ${GOLDFISH_DEVICE_ROOT}/system/OpenglSystemCommon ${GOLDFISH_DEVICE_ROOT}/bionic/libc/private ${GOLDFISH_DEVICE_ROOT}/bionic/libc/platform ${GOLDFISH_DEVICE_ROOT}/system/vulkan_enc ${GOLDFISH_DEVICE_ROOT}/shared/gralloc_cb/include ${GOLDFISH_DEVICE_ROOT}/shared/GoldfishAddressSpace/include ${GOLDFISH_DEVICE_ROOT}/platform/include ${GOLDFISH_DEVICE_ROOT}/system/renderControl_enc ${GOLDFISH_DEVICE_ROOT}/system/GLESv2_enc ${GOLDFISH_DEVICE_ROOT}/system/GLESv1_enc ${GOLDFISH_DEVICE_ROOT}/shared/OpenglCodecCommon ${GOLDFISH_DEVICE_ROOT}/android-emu ${GOLDFISH_DEVICE_ROOT}/shared/qemupipe/include-types ${GOLDFISH_DEVICE_ROOT}/shared/qemupipe/include ${GOLDFISH_DEVICE_ROOT}/./host/include/libOpenglRender ${GOLDFISH_DEVICE_ROOT}/./system/include ${GOLDFISH_DEVICE_ROOT}/./../../../external/qemu/android/android-emugl/guest)
+target_compile_definitions(GLESv1_CM_emulation PRIVATE "-DPLATFORM_SDK_VERSION=29" "-DGOLDFISH_HIDL_GRALLOC" "-DHOST_BUILD" "-DANDROID" "-DGL_GLEXT_PROTOTYPES" "-DPAGE_SIZE=4096" "-DGFXSTREAM" "-DENABLE_ANDROID_HEALTH_MONITOR" "-DLOG_TAG=\"GLES_emulation\"")
+target_compile_options(GLESv1_CM_emulation PRIVATE "-fvisibility=default" "-Wno-unused-parameter")
+target_link_libraries(GLESv1_CM_emulation PRIVATE OpenglSystemCommon android-emu-shared vulkan_enc gui log _renderControl_enc GLESv2_enc GLESv1_enc OpenglCodecCommon_host cutils utils androidemu PRIVATE gralloc_cb_host GoldfishAddressSpace_host platform_host qemupipe_host)
\ No newline at end of file
diff --git a/system/GLESv1/gl.cpp b/system/GLESv1/gl.cpp
new file mode 100644
index 0000000..56e1630
--- /dev/null
+++ b/system/GLESv1/gl.cpp
@@ -0,0 +1,194 @@
+/*
+* Copyright 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include "EGLClientIface.h"
+#include "HostConnection.h"
+#include "GLEncoder.h"
+#include "GLES/gl.h"
+#include "GLES/glext.h"
+#include "ErrorLog.h"
+#include "ThreadInfo.h"
+#include "EGLImage.h"
+
+
+//XXX: fix this macro to get the context from fast tls path
+#define GET_CONTEXT GLEncoder * ctx = getEGLThreadInfo()->hostConn->glEncoder();
+
+#include "gl_entry.cpp"
+
+//The functions table
+#include "gl_ftable.h"
+
+static EGLClient_eglInterface * s_egl = NULL;
+static EGLClient_glesInterface * s_gl = NULL;
+
+#define DEFINE_AND_VALIDATE_HOST_CONNECTION(ret) \
+    HostConnection *hostCon = HostConnection::get(); \
+    if (!hostCon) { \
+        ALOGE("egl: Failed to get host connection\n"); \
+        return ret; \
+    } \
+    renderControl_encoder_context_t *rcEnc = hostCon->rcEncoder(); \
+    if (!rcEnc) { \
+        ALOGE("egl: Failed to get renderControl encoder context\n"); \
+        return ret; \
+    } \
+    Gralloc *grallocHelper = hostCon->grallocHelper(); \
+    if (!grallocHelper) { \
+        ALOGE("egl: Failed to get grallocHelper\n"); \
+        return ret; \
+    }
+
+//GL extensions
+void glEGLImageTargetTexture2DOES(void * self, GLenum target, GLeglImageOES img)
+{
+    (void)self;
+
+    DBG("glEGLImageTargetTexture2DOES v1 target=%#x img=%p", target, img);
+    
+    EGLImage_t *image = (EGLImage_t*)img;
+
+    if (image->target == EGL_NATIVE_BUFFER_ANDROID) {
+        //TODO: check error - we don't have a way to set gl error
+        android_native_buffer_t* native_buffer = image->native_buffer;
+
+        if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC) {
+            return;
+        }
+
+        if (native_buffer->common.version != sizeof(android_native_buffer_t)) {
+            return;
+        }
+
+        GET_CONTEXT;
+        DEFINE_AND_VALIDATE_HOST_CONNECTION();
+
+        ctx->override2DTextureTarget(target);
+        rcEnc->rcBindTexture(rcEnc,
+                grallocHelper->getHostHandle(native_buffer->handle));
+        ctx->restore2DTextureTarget();
+    }
+    else if (image->target == EGL_GL_TEXTURE_2D_KHR) {
+        GET_CONTEXT;
+        ctx->override2DTextureTarget(target);
+        GLeglImageOES hostImage = reinterpret_cast<GLeglImageOES>((intptr_t)image->host_egl_image);
+        ctx->m_glEGLImageTargetTexture2DOES_enc(self, target, hostImage);
+        ctx->restore2DTextureTarget();
+    }
+}
+
+void glEGLImageTargetRenderbufferStorageOES(void *self, GLenum target, GLeglImageOES img)
+{
+    (void)self;
+    (void)target;
+
+    DBG("glEGLImageTargetRenderbufferStorageOES v1 image=%p\n", img);
+    //TODO: check error - we don't have a way to set gl error
+    EGLImage_t *image = (EGLImage_t*)img;
+
+    if (image->target == EGL_NATIVE_BUFFER_ANDROID) {
+        android_native_buffer_t* native_buffer = ((EGLImage_t*)image)->native_buffer;
+
+        if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC) {
+            return;
+        }
+
+        if (native_buffer->common.version != sizeof(android_native_buffer_t)) {
+            return;
+        }
+
+        DEFINE_AND_VALIDATE_HOST_CONNECTION();
+        rcEnc->rcBindRenderbuffer(rcEnc,
+                grallocHelper->getHostHandle(native_buffer->handle));
+    } else {
+        //TODO
+    }
+
+    return;
+}
+
+void * getProcAddress(const char * procname)
+{
+    // search in GL function table
+    for (int i=0; i<gl_num_funcs; i++) {
+        if (!strcmp(gl_funcs_by_name[i].name, procname)) {
+            return gl_funcs_by_name[i].proc;
+        }
+    }
+    return NULL;
+}
+
+void finish()
+{
+    glFinish();
+}
+
+void getIntegerv(unsigned int pname, int* param)
+{
+    glGetIntegerv((GLenum)pname, (GLint*)param);
+}
+
+const GLubyte *my_glGetString (void *self, GLenum name)
+{
+    (void)self;
+
+    //see ref in https://www.khronos.org/opengles/sdk/docs/man
+    //name in glGetString can be one of the following five values
+    switch (name) {
+        case GL_VERSION:
+        case GL_VENDOR:
+        case GL_RENDERER:
+        case GL_SHADING_LANGUAGE_VERSION:
+        case GL_EXTENSIONS:
+            if (s_egl) {
+                return (const GLubyte*)s_egl->getGLString(name);
+            }
+            break;
+        default:
+            GET_CONTEXT;
+            ctx->setError(GL_INVALID_ENUM);
+            break;
+    }
+    return NULL;
+}
+
+void init()
+{
+    GET_CONTEXT;
+    ctx->m_glEGLImageTargetTexture2DOES_enc = ctx->glEGLImageTargetTexture2DOES;
+    ctx->glEGLImageTargetTexture2DOES = &glEGLImageTargetTexture2DOES;
+    ctx->glEGLImageTargetRenderbufferStorageOES = &glEGLImageTargetRenderbufferStorageOES;
+    ctx->glGetString = &my_glGetString;
+}
+
+extern "C" {
+EGLClient_glesInterface * init_emul_gles(EGLClient_eglInterface *eglIface)
+{
+    s_egl = eglIface;
+
+    if (!s_gl) {
+        s_gl = new EGLClient_glesInterface();
+        s_gl->getProcAddress = getProcAddress;
+        s_gl->finish = finish;
+        s_gl->init = init;
+        s_gl->getIntegerv = getIntegerv;
+    }
+
+    return s_gl;
+}
+} //extern
+
+
diff --git a/system/GLESv1_enc/Android.mk b/system/GLESv1_enc/Android.mk
new file mode 100644
index 0000000..48ee51f
--- /dev/null
+++ b/system/GLESv1_enc/Android.mk
@@ -0,0 +1,19 @@
+LOCAL_PATH := $(call my-dir)
+
+### GLESv1_enc Encoder ###########################################
+$(call emugl-begin-shared-library,libGLESv1_enc)
+
+LOCAL_CFLAGS += -DLOG_TAG=\"emuglGLESv1_enc\"
+
+LOCAL_SRC_FILES := \
+        GLEncoder.cpp \
+        GLEncoderUtils.cpp \
+        gl_client_context.cpp \
+        gl_enc.cpp \
+        gl_entry.cpp
+
+$(call emugl-import,libOpenglCodecCommon$(GOLDFISH_OPENGL_LIB_SUFFIX))
+$(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
+$(call emugl-export,C_INCLUDES,$(intermediates))
+
+$(call emugl-end-module)
diff --git a/system/GLESv1_enc/CMakeLists.txt b/system/GLESv1_enc/CMakeLists.txt
new file mode 100644
index 0000000..c26aea1
--- /dev/null
+++ b/system/GLESv1_enc/CMakeLists.txt
@@ -0,0 +1,10 @@
+# This is an autogenerated file! Do not edit!
+# instead run make from .../device/generic/goldfish-opengl
+# which will re-generate this file.
+android_validate_sha256("${GOLDFISH_DEVICE_ROOT}/system/GLESv1_enc/Android.mk" "953e6b7371d10eed63a4be555f8f1fb6f347338484a78102fa8f55dff96f5d3b")
+set(GLESv1_enc_src GLEncoder.cpp GLEncoderUtils.cpp gl_client_context.cpp gl_enc.cpp gl_entry.cpp)
+android_add_library(TARGET GLESv1_enc SHARED LICENSE Apache-2.0 SRC GLEncoder.cpp GLEncoderUtils.cpp gl_client_context.cpp gl_enc.cpp gl_entry.cpp)
+target_include_directories(GLESv1_enc PRIVATE ${GOLDFISH_DEVICE_ROOT}/system/GLESv1_enc ${GOLDFISH_DEVICE_ROOT}/shared/OpenglCodecCommon ${GOLDFISH_DEVICE_ROOT}/android-emu ${GOLDFISH_DEVICE_ROOT}/shared/qemupipe/include-types ${GOLDFISH_DEVICE_ROOT}/shared/qemupipe/include ${GOLDFISH_DEVICE_ROOT}/./host/include/libOpenglRender ${GOLDFISH_DEVICE_ROOT}/./system/include ${GOLDFISH_DEVICE_ROOT}/./../../../external/qemu/android/android-emugl/guest)
+target_compile_definitions(GLESv1_enc PRIVATE "-DPLATFORM_SDK_VERSION=29" "-DGOLDFISH_HIDL_GRALLOC" "-DHOST_BUILD" "-DANDROID" "-DGL_GLEXT_PROTOTYPES" "-DPAGE_SIZE=4096" "-DGFXSTREAM" "-DENABLE_ANDROID_HEALTH_MONITOR" "-DLOG_TAG=\"emuglGLESv1_enc\"")
+target_compile_options(GLESv1_enc PRIVATE "-fvisibility=default" "-Wno-unused-parameter")
+target_link_libraries(GLESv1_enc PRIVATE OpenglCodecCommon_host cutils utils log androidemu android-emu-shared PRIVATE qemupipe_host)
\ No newline at end of file
diff --git a/system/GLESv1_enc/GLEncoder.cpp b/system/GLESv1_enc/GLEncoder.cpp
new file mode 100644
index 0000000..6a6b361
--- /dev/null
+++ b/system/GLESv1_enc/GLEncoder.cpp
@@ -0,0 +1,1119 @@
+/*
+* Copyright (C) 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#include "GLEncoder.h"
+#include "glUtils.h"
+#include <log/log.h>
+#include <assert.h>
+#include <vector>
+
+using gfxstream::IOStream;
+
+#ifndef MIN
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+#endif
+
+static GLubyte *gVendorString= (GLubyte *) "Android";
+static GLubyte *gRendererString= (GLubyte *) "Android HW-GLES 1.0";
+static GLubyte *gVersionString= (GLubyte *) "OpenGL ES-CM 1.0";
+static GLubyte *gExtensionsString= (GLubyte *) "GL_OES_EGL_image_external ";
+
+#define SET_ERROR_IF(condition,err) if((condition)) {                            \
+        ALOGE("%s:%s:%d GL error 0x%x\n", __FILE__, __FUNCTION__, __LINE__, err); \
+        ctx->setError(err);                                    \
+        return;                                                  \
+    }
+
+
+#define RET_AND_SET_ERROR_IF(condition,err,ret) if((condition)) {                \
+        ALOGE("%s:%s:%d GL error 0x%x\n", __FILE__, __FUNCTION__, __LINE__, err); \
+        ctx->setError(err);                                    \
+        return ret;                                              \
+    }
+
+GLenum GLEncoder::s_glGetError(void * self)
+{
+    GLEncoder *ctx = (GLEncoder *)self;
+    GLenum err = ctx->getError();
+    if(err != GL_NO_ERROR) {
+        ctx->setError(GL_NO_ERROR);
+        return err;
+    }
+
+    return ctx->m_glGetError_enc(self);
+
+}
+
+GLint * GLEncoder::getCompressedTextureFormats()
+{
+    if (m_compressedTextureFormats == NULL) {
+        this->glGetIntegerv(this, GL_NUM_COMPRESSED_TEXTURE_FORMATS,
+                            &m_num_compressedTextureFormats);
+        if (m_num_compressedTextureFormats > 0) {
+            // get number of texture formats;
+            m_compressedTextureFormats = new GLint[m_num_compressedTextureFormats];
+            this->glGetCompressedTextureFormats(this, m_num_compressedTextureFormats, m_compressedTextureFormats);
+        }
+    }
+    return m_compressedTextureFormats;
+}
+
+void GLEncoder::s_glGetIntegerv(void *self, GLenum param, GLint *ptr)
+{
+    GLEncoder *ctx = (GLEncoder *)self;
+    assert(ctx->m_state != NULL);
+    GLClientState* state = ctx->m_state;
+
+    switch (param) {
+    case GL_COMPRESSED_TEXTURE_FORMATS: {
+        GLint * compressedTextureFormats = ctx->getCompressedTextureFormats();
+        if (ctx->m_num_compressedTextureFormats > 0 &&
+                compressedTextureFormats != NULL) {
+            memcpy(ptr, compressedTextureFormats,
+                   ctx->m_num_compressedTextureFormats * sizeof(GLint));
+        }
+        break;
+    }
+
+    case GL_MAX_TEXTURE_UNITS:
+        ctx->m_glGetIntegerv_enc(self, param, ptr);
+        *ptr = MIN(*ptr, GLClientState::MAX_TEXTURE_UNITS);
+        break;
+
+    case GL_TEXTURE_BINDING_2D:
+        *ptr = state->getBoundTexture(GL_TEXTURE_2D);
+        break;
+
+    case GL_TEXTURE_BINDING_EXTERNAL_OES:
+        *ptr = state->getBoundTexture(GL_TEXTURE_EXTERNAL_OES);
+        break;
+
+    case GL_RESET_NOTIFICATION_STRATEGY_EXT:
+        // BUG: 121414786
+        *ptr = GL_LOSE_CONTEXT_ON_RESET_EXT;
+        break;
+
+    default:
+        if (!state->getClientStateParameter<GLint>(param,ptr)) {
+            ctx->m_glGetIntegerv_enc(self, param, ptr);
+        }
+        break;
+    }
+}
+
+void GLEncoder::s_glGetFloatv(void *self, GLenum param, GLfloat *ptr)
+{
+    GLEncoder *ctx = (GLEncoder *)self;
+    assert(ctx->m_state != NULL);
+    GLClientState* state = ctx->m_state;
+
+    switch (param) {
+    case GL_COMPRESSED_TEXTURE_FORMATS: {
+        GLint * compressedTextureFormats = ctx->getCompressedTextureFormats();
+        if (ctx->m_num_compressedTextureFormats > 0 &&
+                compressedTextureFormats != NULL) {
+            for (int i = 0; i < ctx->m_num_compressedTextureFormats; i++) {
+                ptr[i] = (GLfloat) compressedTextureFormats[i];
+            }
+        }
+        break;
+    }
+
+    case GL_MAX_TEXTURE_UNITS:
+        ctx->m_glGetFloatv_enc(self, param, ptr);
+        *ptr = MIN(*ptr, (GLfloat)GLClientState::MAX_TEXTURE_UNITS);
+        break;
+
+    case GL_TEXTURE_BINDING_2D:
+        *ptr = (GLfloat)state->getBoundTexture(GL_TEXTURE_2D);
+        break;
+
+    case GL_TEXTURE_BINDING_EXTERNAL_OES:
+        *ptr = (GLfloat)state->getBoundTexture(GL_TEXTURE_EXTERNAL_OES);
+        break;
+
+    default:
+        if (!state->getClientStateParameter<GLfloat>(param,ptr)) {
+            ctx->m_glGetFloatv_enc(self, param, ptr);
+        }
+        break;
+    }
+}
+
+void GLEncoder::s_glGetFixedv(void *self, GLenum param, GLfixed *ptr)
+{
+    GLEncoder *ctx = (GLEncoder *)self;
+    assert(ctx->m_state != NULL);
+    GLClientState* state = ctx->m_state;
+
+    switch (param) {
+    case GL_COMPRESSED_TEXTURE_FORMATS: {
+        GLint * compressedTextureFormats = ctx->getCompressedTextureFormats();
+        if (ctx->m_num_compressedTextureFormats > 0 &&
+                compressedTextureFormats != NULL) {
+            for (int i = 0; i < ctx->m_num_compressedTextureFormats; i++) {
+                ptr[i] =  compressedTextureFormats[i] << 16;
+            }
+        }
+        break;
+    }
+
+    case GL_MAX_TEXTURE_UNITS:
+        ctx->m_glGetFixedv_enc(self, param, ptr);
+        *ptr = MIN(*ptr, GLClientState::MAX_TEXTURE_UNITS << 16);
+        break;
+
+    case GL_TEXTURE_BINDING_2D:
+        *ptr = state->getBoundTexture(GL_TEXTURE_2D) << 16;
+        break;
+
+    case GL_TEXTURE_BINDING_EXTERNAL_OES:
+        *ptr = state->getBoundTexture(GL_TEXTURE_EXTERNAL_OES) << 16;
+        break;
+
+    default:
+        if (!state->getClientStateParameter<GLfixed>(param,ptr)) {
+            ctx->m_glGetFixedv_enc(self, param, ptr);
+        }
+        break;
+    }
+}
+
+void GLEncoder::s_glGetBooleanv(void *self, GLenum param, GLboolean *ptr)
+{
+    GLEncoder *ctx = (GLEncoder *)self;
+    assert(ctx->m_state != NULL);
+    GLClientState* state = ctx->m_state;
+
+    switch (param) {
+    case GL_COMPRESSED_TEXTURE_FORMATS: {
+        GLint* compressedTextureFormats = ctx->getCompressedTextureFormats();
+        if (ctx->m_num_compressedTextureFormats > 0 &&
+                compressedTextureFormats != NULL) {
+            for (int i = 0; i < ctx->m_num_compressedTextureFormats; i++) {
+                ptr[i] = compressedTextureFormats[i] != 0 ? GL_TRUE : GL_FALSE;
+            }
+        }
+        break;
+    }
+
+    case GL_TEXTURE_BINDING_2D:
+        *ptr = state->getBoundTexture(GL_TEXTURE_2D) != 0 ? GL_TRUE : GL_FALSE;
+        break;
+
+    case GL_TEXTURE_BINDING_EXTERNAL_OES:
+        *ptr = state->getBoundTexture(GL_TEXTURE_EXTERNAL_OES) != 0
+                ? GL_TRUE : GL_FALSE;
+        break;
+
+    default:
+        if (!state->getClientStateParameter<GLboolean>(param,ptr)) {
+            ctx->m_glGetBooleanv_enc(self, param, ptr);
+        }
+        break;
+    }
+}
+
+void GLEncoder::s_glGetPointerv(void * self, GLenum param, GLvoid **params)
+{
+    GLEncoder * ctx = (GLEncoder *) self;
+    assert(ctx->m_state != NULL);
+    ctx->m_state->getClientStatePointer(param,params);
+}
+
+void GLEncoder::s_glFlush(void *self)
+{
+    GLEncoder *ctx = (GLEncoder *)self;
+    ctx->m_glFlush_enc(self);
+    ctx->m_stream->flush();
+}
+
+const GLubyte *GLEncoder::s_glGetString(void *self, GLenum name)
+{
+    (void)self;
+
+    GLubyte *retval =  (GLubyte *) "";
+    switch(name) {
+    case GL_VENDOR:
+        retval = gVendorString;
+        break;
+    case GL_RENDERER:
+        retval = gRendererString;
+        break;
+    case GL_VERSION:
+        retval = gVersionString;
+        break;
+    case GL_EXTENSIONS:
+        retval = gExtensionsString;
+        break;
+    }
+    return retval;
+}
+
+void GLEncoder::s_glPixelStorei(void *self, GLenum param, GLint value)
+{
+    GLEncoder *ctx = (GLEncoder *)self;
+    ctx->m_glPixelStorei_enc(ctx, param, value);
+    ALOG_ASSERT(ctx->m_state, "GLEncoder::s_glPixelStorei");
+    ctx->m_state->setPixelStore(param, value);
+}
+
+void GLEncoder::s_glVertexPointer(void *self, int size, GLenum type, GLsizei stride, const void *data)
+{
+    GLEncoder *ctx = (GLEncoder *)self;
+    assert(ctx->m_state != NULL);
+    ctx->m_state->setVertexAttribState(GLClientState::VERTEX_LOCATION, size, type, false, stride, data);
+}
+
+void GLEncoder::s_glNormalPointer(void *self, GLenum type, GLsizei stride, const void *data)
+{
+    GLEncoder *ctx = (GLEncoder *)self;
+    assert(ctx->m_state != NULL);
+    ctx->m_state->setVertexAttribState(GLClientState::NORMAL_LOCATION, 3, type, false, stride, data);
+}
+
+void GLEncoder::s_glColorPointer(void *self, int size, GLenum type, GLsizei stride, const void *data)
+{
+    GLEncoder *ctx = (GLEncoder *)self;
+    assert(ctx->m_state != NULL);
+    ctx->m_state->setVertexAttribState(GLClientState::COLOR_LOCATION, size, type, false, stride, data);
+}
+
+void GLEncoder::s_glPointSizePointerOES(void *self, GLenum type, GLsizei stride, const void *data)
+{
+    GLEncoder *ctx = (GLEncoder *)self;
+    assert(ctx->m_state != NULL);
+    ctx->m_state->setVertexAttribState(GLClientState::POINTSIZE_LOCATION, 1, type, false, stride, data);
+}
+
+void GLEncoder::s_glClientActiveTexture(void *self, GLenum texture)
+{
+    GLEncoder *ctx = (GLEncoder *)self;
+    assert(ctx->m_state != NULL);
+    ctx->m_state->setActiveTexture(texture - GL_TEXTURE0);
+}
+
+void GLEncoder::s_glTexCoordPointer(void *self, int size, GLenum type, GLsizei stride, const void *data)
+{
+    GLEncoder *ctx = (GLEncoder *)self;
+    assert(ctx->m_state != NULL);
+    int loc = ctx->m_state->getLocation(GL_TEXTURE_COORD_ARRAY);
+    ctx->m_state->setVertexAttribState(loc, size, type, false, stride, data);
+}
+
+void GLEncoder::s_glMatrixIndexPointerOES(void *self, int size, GLenum type, GLsizei stride, const void * data)
+{
+    GLEncoder *ctx = (GLEncoder *)self;
+    assert(ctx->m_state != NULL);
+    int loc = ctx->m_state->getLocation(GL_MATRIX_INDEX_ARRAY_OES);
+    ctx->m_state->setVertexAttribState(loc, size, type, false, stride, data);
+}
+
+void GLEncoder::s_glWeightPointerOES(void * self, int size, GLenum type, GLsizei stride, const void * data)
+{
+    GLEncoder *ctx = (GLEncoder *)self;
+    assert(ctx->m_state != NULL);
+    int loc = ctx->m_state->getLocation(GL_WEIGHT_ARRAY_OES);
+    ctx->m_state->setVertexAttribState(loc, size, type, false, stride, data);
+}
+
+void GLEncoder::s_glEnableClientState(void *self, GLenum state)
+{
+    GLEncoder *ctx = (GLEncoder *) self;
+    assert(ctx->m_state != NULL);
+    int loc = ctx->m_state->getLocation(state);
+    ctx->m_state->enable(loc, 1);
+}
+
+void GLEncoder::s_glDisableClientState(void *self, GLenum state)
+{
+    GLEncoder *ctx = (GLEncoder *) self;
+    assert(ctx->m_state != NULL);
+    int loc = ctx->m_state->getLocation(state);
+    ctx->m_state->enable(loc, 0);
+}
+
+GLboolean GLEncoder::s_glIsEnabled(void *self, GLenum cap)
+{
+    GLEncoder *ctx = (GLEncoder *) self;
+    assert(ctx->m_state != NULL);
+    int loc = ctx->m_state->getLocation(cap);
+    const GLClientState::VertexAttribState& state = ctx->m_state->getState(loc);
+    return state.enabled;
+}
+
+void GLEncoder::s_glBindBuffer(void *self, GLenum target, GLuint id)
+{
+    GLEncoder *ctx = (GLEncoder *) self;
+    assert(ctx->m_state != NULL);
+    ctx->m_state->bindBuffer(target, id);
+    // TODO set error state if needed;
+    ctx->m_glBindBuffer_enc(self, target, id);
+}
+
+void GLEncoder::s_glBufferData(void * self, GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage)
+{
+    GLEncoder *ctx = (GLEncoder *) self;
+    GLuint bufferId = ctx->m_state->getBuffer(target);
+    SET_ERROR_IF(bufferId==0, GL_INVALID_OPERATION);
+    SET_ERROR_IF(size<0, GL_INVALID_VALUE);
+
+    ctx->m_shared->updateBufferData(bufferId, size, (void*)data);
+    ctx->m_glBufferData_enc(self, target, size, data, usage);
+}
+
+void GLEncoder::s_glBufferSubData(void * self, GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data)
+{
+    GLEncoder *ctx = (GLEncoder *) self;
+    GLuint bufferId = ctx->m_state->getBuffer(target);
+    SET_ERROR_IF(bufferId==0, GL_INVALID_OPERATION);
+
+    GLenum res = ctx->m_shared->subUpdateBufferData(bufferId, offset, size, (void*)data);
+    SET_ERROR_IF(res, res);
+
+    ctx->m_glBufferSubData_enc(self, target, offset, size, data);
+}
+
+void GLEncoder::s_glDeleteBuffers(void * self, GLsizei n, const GLuint * buffers)
+{
+    GLEncoder *ctx = (GLEncoder *) self;
+    SET_ERROR_IF(n<0, GL_INVALID_VALUE);
+    for (int i=0; i<n; i++) {
+        ctx->m_shared->deleteBufferData(buffers[i]);
+        ctx->m_glDeleteBuffers_enc(self,1,&buffers[i]);
+    }
+}
+
+void GLEncoder::sendVertexData(unsigned int first, unsigned int count)
+{
+    assert(m_state != NULL);
+    GLenum prevActiveTexUnit = m_state->getActiveTextureUnit();
+    for (int i = 0; i < GLClientState::LAST_LOCATION; i++) {
+        bool enableDirty;
+        const GLClientState::VertexAttribState& state = m_state->getStateAndEnableDirty(i, &enableDirty);
+
+        // do not send disable state if state was already disabled
+        if (!enableDirty && !state.enabled) continue;
+
+        if ( i >= GLClientState::TEXCOORD0_LOCATION &&
+            i <= GLClientState::TEXCOORD7_LOCATION ) {
+            m_glClientActiveTexture_enc(this, GL_TEXTURE0 + i - GLClientState::TEXCOORD0_LOCATION);
+        }
+
+        if (state.enabled) {
+            if (enableDirty)
+                m_glEnableClientState_enc(this, state.glConst);
+
+            unsigned int datalen = state.elementSize * count;
+            int stride = state.stride;
+            if (stride == 0) stride = state.elementSize;
+            int firstIndex = stride * first;
+
+            this->m_glBindBuffer_enc(this, GL_ARRAY_BUFFER, state.bufferObject);
+            if (state.bufferObject == 0) {
+
+                switch(i) {
+                case GLClientState::VERTEX_LOCATION:
+                    this->glVertexPointerData(this, state.size, state.type, state.stride,
+                                              (unsigned char *)state.data + firstIndex, datalen);
+                    break;
+                case GLClientState::NORMAL_LOCATION:
+                    this->glNormalPointerData(this, state.type, state.stride,
+                                              (unsigned char *)state.data + firstIndex, datalen);
+                    break;
+                case GLClientState::COLOR_LOCATION:
+                    this->glColorPointerData(this, state.size, state.type, state.stride,
+                                             (unsigned char *)state.data + firstIndex, datalen);
+                    break;
+                case GLClientState::TEXCOORD0_LOCATION:
+                case GLClientState::TEXCOORD1_LOCATION:
+                case GLClientState::TEXCOORD2_LOCATION:
+                case GLClientState::TEXCOORD3_LOCATION:
+                case GLClientState::TEXCOORD4_LOCATION:
+                case GLClientState::TEXCOORD5_LOCATION:
+                case GLClientState::TEXCOORD6_LOCATION:
+                case GLClientState::TEXCOORD7_LOCATION:
+                    m_state->setActiveTextureUnit(i - GLClientState::TEXCOORD0_LOCATION + GL_TEXTURE0);
+                    if (m_state->getPriorityEnabledTarget(GL_INVALID_ENUM) != GL_INVALID_ENUM) {
+                        this->glTexCoordPointerData(this, i - GLClientState::TEXCOORD0_LOCATION, state.size, state.type, state.stride,
+                                                (unsigned char *)state.data + firstIndex, datalen);
+                    }
+                    break;
+                case GLClientState::POINTSIZE_LOCATION:
+                    this->glPointSizePointerData(this, state.type, state.stride,
+                                                 (unsigned char *) state.data + firstIndex, datalen);
+                    break;
+                case GLClientState::WEIGHT_LOCATION:
+                    this->glWeightPointerData(this, state.size, state.type, state.stride,
+                                              (unsigned char * ) state.data + firstIndex, datalen);
+                    break;
+                case GLClientState::MATRIXINDEX_LOCATION:
+                    this->glMatrixIndexPointerData(this, state.size, state.type, state.stride,
+                                                  (unsigned char *)state.data + firstIndex, datalen);
+                    break;
+                }
+            } else {
+
+                switch(i) {
+                case GLClientState::VERTEX_LOCATION:
+                    this->glVertexPointerOffset(this, state.size, state.type, state.stride,
+                                                (uintptr_t)state.data + firstIndex);
+                    break;
+                case GLClientState::NORMAL_LOCATION:
+                    this->glNormalPointerOffset(this, state.type, state.stride,
+                                                (uintptr_t)state.data + firstIndex);
+                    break;
+                case GLClientState::POINTSIZE_LOCATION:
+                    this->glPointSizePointerOffset(this, state.type, state.stride,
+                                                   (uintptr_t)state.data + firstIndex);
+                    break;
+                case GLClientState::COLOR_LOCATION:
+                    this->glColorPointerOffset(this, state.size, state.type, state.stride,
+                                               (uintptr_t)state.data + firstIndex);
+                    break;
+                case GLClientState::TEXCOORD0_LOCATION:
+                case GLClientState::TEXCOORD1_LOCATION:
+                case GLClientState::TEXCOORD2_LOCATION:
+                case GLClientState::TEXCOORD3_LOCATION:
+                case GLClientState::TEXCOORD4_LOCATION:
+                case GLClientState::TEXCOORD5_LOCATION:
+                case GLClientState::TEXCOORD6_LOCATION:
+                case GLClientState::TEXCOORD7_LOCATION:
+                    this->glTexCoordPointerOffset(this, state.size, state.type, state.stride,
+                                                  (uintptr_t)state.data + firstIndex);
+                    break;
+                case GLClientState::WEIGHT_LOCATION:
+                    this->glWeightPointerOffset(this,state.size,state.type,state.stride,
+                                                (uintptr_t)state.data+firstIndex);
+                    break;
+                case GLClientState::MATRIXINDEX_LOCATION:
+                    this->glMatrixIndexPointerOffset(this,state.size,state.type,state.stride,
+                                              (uintptr_t)state.data+firstIndex);
+                    break;
+                }
+            }
+            this->m_glBindBuffer_enc(this, GL_ARRAY_BUFFER, m_state->currentArrayVbo());
+        } else {
+            this->m_glDisableClientState_enc(this, state.glConst);
+        }
+    }
+    m_state->setActiveTextureUnit(prevActiveTexUnit);
+}
+
+void GLEncoder::s_glDrawArrays(void *self, GLenum mode, GLint first, GLsizei count)
+{
+    GLEncoder *ctx = (GLEncoder *)self;
+
+    bool has_arrays = false;
+    for (int i = 0; i < GLClientState::LAST_LOCATION; i++) {
+        const GLClientState::VertexAttribState& state = ctx->m_state->getState(i);
+        if (state.enabled) {
+            if (state.bufferObject || state.data) {
+                has_arrays = true;
+            } else {
+                ALOGE("glDrawArrays: a vertex attribute array is enabled with no data bound\n");
+                ctx->setError(GL_INVALID_OPERATION);
+                return;
+            }
+        }
+    }
+    if (!has_arrays) {
+        ALOGE("glDrawArrays: no data bound to the command - ignoring\n");
+        return;
+    }
+
+    ctx->sendVertexData(first, count);
+    ctx->m_glDrawArrays_enc(ctx, mode, /*first*/ 0, count);
+    ctx->m_stream->flush();
+}
+
+void GLEncoder::s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum type, const void *indices)
+{
+
+    GLEncoder *ctx = (GLEncoder *)self;
+    assert(ctx->m_state != NULL);
+    SET_ERROR_IF(count<0, GL_INVALID_VALUE);
+
+    bool has_immediate_arrays = false;
+    bool has_indirect_arrays = false;
+
+    for (int i = 0; i < GLClientState::LAST_LOCATION; i++) {
+        const GLClientState::VertexAttribState& state = ctx->m_state->getState(i);
+        if (state.enabled) {
+            if (state.bufferObject != 0) {
+                has_indirect_arrays = true;
+            } else if (state.data) {
+                has_immediate_arrays = true;
+            } else {
+                ALOGE("glDrawElements: a vertex attribute array is enabled with no data bound\n");
+                ctx->setError(GL_INVALID_OPERATION);
+                return;
+            }
+        }
+    }
+
+    if (!has_immediate_arrays && !has_indirect_arrays) {
+        ALOGE("glDrawElements: no data bound to the command - ignoring\n");
+        return;
+    }
+
+    bool adjustIndices = true;
+    if (ctx->m_state->currentIndexVbo() != 0) {
+        if (!has_immediate_arrays) {
+            ctx->sendVertexData(0, count);
+            ctx->m_glBindBuffer_enc(self, GL_ELEMENT_ARRAY_BUFFER, ctx->m_state->currentIndexVbo());
+            ctx->glDrawElementsOffset(ctx, mode, count, type, (uintptr_t)indices);
+            ctx->m_stream->flush();
+            adjustIndices = false;
+        } else {
+            BufferData * buf = ctx->m_shared->getBufferData(ctx->m_state->currentIndexVbo());
+            ctx->m_glBindBuffer_enc(self, GL_ELEMENT_ARRAY_BUFFER, 0);
+            indices = &buf->m_fixedBuffer[(GLintptr)indices];
+        }
+    }
+    if (adjustIndices) {
+        void *adjustedIndices = (void*)indices;
+        int minIndex = 0, maxIndex = 0;
+
+        switch(type) {
+        case GL_BYTE:
+        case GL_UNSIGNED_BYTE:
+            GLUtils::minmax<unsigned char>((unsigned char *)indices, count, &minIndex, &maxIndex);
+            if (minIndex != 0) {
+                ctx->m_fixedBuffer.resize(glSizeof(type) * count);
+                adjustedIndices = ctx->m_fixedBuffer.data();
+                GLUtils::shiftIndices<unsigned char>((unsigned char *)indices,
+                                                 (unsigned char *)adjustedIndices,
+                                                 count, -minIndex);
+            }
+            break;
+        case GL_SHORT:
+        case GL_UNSIGNED_SHORT:
+            GLUtils::minmax<unsigned short>((unsigned short *)indices, count, &minIndex, &maxIndex);
+            if (minIndex != 0) {
+                ctx->m_fixedBuffer.resize(glSizeof(type) * count);
+                adjustedIndices = ctx->m_fixedBuffer.data();
+                GLUtils::shiftIndices<unsigned short>((unsigned short *)indices,
+                                                 (unsigned short *)adjustedIndices,
+                                                 count, -minIndex);
+            }
+            break;
+        case GL_INT:
+        case GL_UNSIGNED_INT:
+            GLUtils::minmax<unsigned int>((unsigned int *)indices, count, &minIndex, &maxIndex);
+            if (minIndex != 0) {
+                ctx->m_fixedBuffer.resize(glSizeof(type) * count);
+                adjustedIndices = ctx->m_fixedBuffer.data();
+                GLUtils::shiftIndices<unsigned int>((unsigned int *)indices,
+                                                 (unsigned int *)adjustedIndices,
+                                                 count, -minIndex);
+            }
+            break;
+        default:
+            ALOGE("unsupported index buffer type %d\n", type);
+        }
+        if (has_indirect_arrays || 1) {
+            ctx->sendVertexData(minIndex, maxIndex - minIndex + 1);
+            ctx->glDrawElementsData(ctx, mode, count, type, adjustedIndices,
+                                      count * glSizeof(type));
+            ctx->m_stream->flush();
+            // XXX - OPTIMIZATION (see the other else branch) should be implemented
+            if(!has_indirect_arrays) {
+                //ALOGD("unoptimized drawelements !!!\n");
+            }
+        } else {
+            // we are all direct arrays and immidate mode index array -
+            // rebuild the arrays and the index array;
+            ALOGE("glDrawElements: direct index & direct buffer data - will be implemented in later versions;\n");
+        }
+    }
+}
+
+void GLEncoder::s_glActiveTexture(void* self, GLenum texture)
+{
+    GLEncoder* ctx = (GLEncoder*)self;
+    GLClientState* state = ctx->m_state;
+    GLenum err;
+
+    if ((err = state->setActiveTextureUnit(texture)) != GL_NO_ERROR) {
+        ALOGE("%s:%s:%d GL error %#x\n", __FILE__, __FUNCTION__, __LINE__, err);
+        ctx->setError(err);
+        return;
+    }
+
+    ctx->m_glActiveTexture_enc(ctx, texture);
+}
+
+void GLEncoder::s_glBindTexture(void* self, GLenum target, GLuint texture)
+{
+    GLEncoder* ctx = (GLEncoder*)self;
+    GLClientState* state = ctx->m_state;
+    GLenum err;
+
+    GLboolean firstUse;
+    if ((err = state->bindTexture(target, texture, &firstUse)) != GL_NO_ERROR) {
+        ALOGE("%s:%s:%d GL error %#x\n", __FILE__, __FUNCTION__, __LINE__, err);
+        ctx->setError(err);
+        return;
+    }
+
+    if (target != GL_TEXTURE_2D && target != GL_TEXTURE_EXTERNAL_OES) {
+        ctx->m_glBindTexture_enc(ctx, target, texture);
+        return;
+    }
+
+    GLenum priorityTarget = state->getPriorityEnabledTarget(GL_TEXTURE_2D);
+
+    if (target == GL_TEXTURE_EXTERNAL_OES && firstUse) {
+        // set TEXTURE_EXTERNAL_OES default states which differ from TEXTURE_2D
+        ctx->m_glBindTexture_enc(ctx, GL_TEXTURE_2D, texture);
+        ctx->m_glTexParameteri_enc(ctx, GL_TEXTURE_2D,
+                GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+        ctx->m_glTexParameteri_enc(ctx, GL_TEXTURE_2D,
+                GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+        ctx->m_glTexParameteri_enc(ctx, GL_TEXTURE_2D,
+                GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+
+        if (target != priorityTarget) {
+            ctx->m_glBindTexture_enc(ctx, GL_TEXTURE_2D,
+                    state->getBoundTexture(GL_TEXTURE_2D));
+        }
+    }
+
+    if (target == priorityTarget) {
+        ctx->m_glBindTexture_enc(ctx, GL_TEXTURE_2D, texture);
+    }
+}
+
+void GLEncoder::s_glDeleteTextures(void* self, GLsizei n, const GLuint* textures)
+{
+    GLEncoder* ctx = (GLEncoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    state->deleteTextures(n, textures);
+    ctx->m_glDeleteTextures_enc(ctx, n, textures);
+}
+
+void GLEncoder::s_glDisable(void* self, GLenum cap)
+{
+    GLEncoder* ctx = (GLEncoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    if (cap == GL_TEXTURE_2D || cap == GL_TEXTURE_EXTERNAL_OES) {
+        GLenum prevTarget = state->getPriorityEnabledTarget(GL_INVALID_ENUM);
+        state->disableTextureTarget(cap);
+        GLenum currTarget = state->getPriorityEnabledTarget(GL_INVALID_ENUM);
+
+        if (prevTarget != currTarget) {
+            if (currTarget == GL_INVALID_ENUM) {
+                ctx->m_glDisable_enc(ctx, GL_TEXTURE_2D);
+                currTarget = GL_TEXTURE_2D;
+            }
+            // maintain the invariant that when TEXTURE_EXTERNAL_OES is
+            // disabled, the TEXTURE_2D binding is active, even if
+            // TEXTURE_2D is also disabled.
+            ctx->m_glBindTexture_enc(ctx, GL_TEXTURE_2D,
+                    state->getBoundTexture(currTarget));
+        }
+
+    } else {
+        ctx->m_glDisable_enc(ctx, cap);
+    }
+}
+
+void GLEncoder::s_glEnable(void* self, GLenum cap)
+{
+    GLEncoder* ctx = (GLEncoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    if (cap == GL_TEXTURE_2D || cap == GL_TEXTURE_EXTERNAL_OES) {
+        GLenum prevTarget = state->getPriorityEnabledTarget(GL_INVALID_ENUM);
+        state->enableTextureTarget(cap);
+        GLenum currTarget = state->getPriorityEnabledTarget(GL_INVALID_ENUM);
+
+        if (prevTarget != currTarget) {
+            if (prevTarget == GL_INVALID_ENUM) {
+                ctx->m_glEnable_enc(ctx, GL_TEXTURE_2D);
+            }
+            if (currTarget == GL_TEXTURE_EXTERNAL_OES) {
+                ctx->m_glBindTexture_enc(ctx, GL_TEXTURE_2D,
+                        state->getBoundTexture(currTarget));
+            }
+        }
+
+    } else {
+        ctx->m_glEnable_enc(ctx, cap);
+    }
+}
+
+void GLEncoder::s_glGetTexParameterfv(void* self,
+        GLenum target, GLenum pname, GLfloat* params)
+{
+    GLEncoder* ctx = (GLEncoder*)self;
+    if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
+        ctx->override2DTextureTarget(target);
+        ctx->m_glGetTexParameterfv_enc(ctx, GL_TEXTURE_2D, pname, params);
+        ctx->restore2DTextureTarget();
+    } else {
+        ctx->m_glGetTexParameterfv_enc(ctx, target, pname, params);
+    }
+}
+
+void GLEncoder::s_glGetTexParameteriv(void* self,
+        GLenum target, GLenum pname, GLint* params)
+{
+    GLEncoder* ctx = (GLEncoder*)self;
+
+    switch (pname) {
+    case GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES:
+        *params = 1;
+        break;
+
+    default:
+        if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
+            ctx->override2DTextureTarget(target);
+            ctx->m_glGetTexParameteriv_enc(ctx, GL_TEXTURE_2D, pname, params);
+            ctx->restore2DTextureTarget();
+        } else {
+            ctx->m_glGetTexParameteriv_enc(ctx, target, pname, params);
+        }
+        break;
+    }
+}
+
+void GLEncoder::s_glGetTexParameterxv(void* self,
+        GLenum target, GLenum pname, GLfixed* params)
+{
+    GLEncoder* ctx = (GLEncoder*)self;
+
+    if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
+        ctx->override2DTextureTarget(target);
+        ctx->m_glGetTexParameterxv_enc(ctx, GL_TEXTURE_2D, pname, params);
+        ctx->restore2DTextureTarget();
+    } else {
+        ctx->m_glGetTexParameterxv_enc(ctx, target, pname, params);
+    }
+}
+
+static bool isValidTextureExternalParam(GLenum pname, GLenum param)
+{
+    switch (pname) {
+    case GL_TEXTURE_MIN_FILTER:
+    case GL_TEXTURE_MAG_FILTER:
+        return param == GL_NEAREST || param == GL_LINEAR;
+
+    case GL_TEXTURE_WRAP_S:
+    case GL_TEXTURE_WRAP_T:
+        return param == GL_CLAMP_TO_EDGE;
+
+    case GL_GENERATE_MIPMAP:
+        return param == GL_FALSE;
+
+    default:
+        return true;
+    }
+}
+
+void GLEncoder::s_glTexParameterf(void* self,
+        GLenum target, GLenum pname, GLfloat param)
+{
+    GLEncoder* ctx = (GLEncoder*)self;
+
+    SET_ERROR_IF((target == GL_TEXTURE_EXTERNAL_OES &&
+            !isValidTextureExternalParam(pname, (GLenum)param)),
+            GL_INVALID_ENUM);
+
+    if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
+        ctx->override2DTextureTarget(target);
+        ctx->m_glTexParameterf_enc(ctx, GL_TEXTURE_2D, pname, param);
+        ctx->restore2DTextureTarget();
+    } else {
+        ctx->m_glTexParameterf_enc(ctx, target, pname, param);
+    }
+}
+
+void GLEncoder::s_glTexParameterfv(void* self,
+        GLenum target, GLenum pname, const GLfloat* params)
+{
+    GLEncoder* ctx = (GLEncoder*)self;
+
+    SET_ERROR_IF((target == GL_TEXTURE_EXTERNAL_OES &&
+            !isValidTextureExternalParam(pname, (GLenum)params[0])),
+            GL_INVALID_ENUM);
+
+    if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
+        ctx->override2DTextureTarget(target);
+        ctx->m_glTexParameterfv_enc(ctx, GL_TEXTURE_2D, pname, params);
+        ctx->restore2DTextureTarget();
+    } else {
+        ctx->m_glTexParameterfv_enc(ctx, target, pname, params);
+    }
+}
+
+void GLEncoder::s_glTexParameteri(void* self,
+        GLenum target, GLenum pname, GLint param)
+{
+    GLEncoder* ctx = (GLEncoder*)self;
+
+    SET_ERROR_IF((target == GL_TEXTURE_EXTERNAL_OES &&
+            !isValidTextureExternalParam(pname, (GLenum)param)),
+            GL_INVALID_ENUM);
+
+    if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
+        ctx->override2DTextureTarget(target);
+        ctx->m_glTexParameteri_enc(ctx, GL_TEXTURE_2D, pname, param);
+        ctx->restore2DTextureTarget();
+    } else {
+        ctx->m_glTexParameteri_enc(ctx, target, pname, param);
+    }
+}
+
+void GLEncoder::s_glTexParameterx(void* self,
+        GLenum target, GLenum pname, GLfixed param)
+{
+    GLEncoder* ctx = (GLEncoder*)self;
+
+    SET_ERROR_IF((target == GL_TEXTURE_EXTERNAL_OES &&
+            !isValidTextureExternalParam(pname, (GLenum)param)),
+            GL_INVALID_ENUM);
+
+    if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
+        ctx->override2DTextureTarget(target);
+        ctx->m_glTexParameterx_enc(ctx, GL_TEXTURE_2D, pname, param);
+        ctx->restore2DTextureTarget();
+    } else {
+        ctx->m_glTexParameterx_enc(ctx, target, pname, param);
+    }
+}
+
+void GLEncoder::s_glTexParameteriv(void* self,
+        GLenum target, GLenum pname, const GLint* params)
+{
+    GLEncoder* ctx = (GLEncoder*)self;
+
+    SET_ERROR_IF((target == GL_TEXTURE_EXTERNAL_OES &&
+            !isValidTextureExternalParam(pname, (GLenum)params[0])),
+            GL_INVALID_ENUM);
+
+    if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
+        ctx->override2DTextureTarget(target);
+        ctx->m_glTexParameteriv_enc(ctx, GL_TEXTURE_2D, pname, params);
+        ctx->restore2DTextureTarget();
+    } else {
+        ctx->m_glTexParameteriv_enc(ctx, target, pname, params);
+    }
+}
+
+void GLEncoder::s_glTexParameterxv(void* self,
+        GLenum target, GLenum pname, const GLfixed* params)
+{
+    GLEncoder* ctx = (GLEncoder*)self;
+
+    SET_ERROR_IF((target == GL_TEXTURE_EXTERNAL_OES &&
+            !isValidTextureExternalParam(pname, (GLenum)params[0])),
+            GL_INVALID_ENUM);
+
+    if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
+        ctx->override2DTextureTarget(target);
+        ctx->m_glTexParameterxv_enc(ctx, GL_TEXTURE_2D, pname, params);
+        ctx->restore2DTextureTarget();
+    } else {
+        ctx->m_glTexParameterxv_enc(ctx, target, pname, params);
+    }
+}
+
+void GLEncoder::override2DTextureTarget(GLenum target)
+{
+    if ((target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) &&
+        target != m_state->getPriorityEnabledTarget(GL_TEXTURE_2D)) {
+            m_glBindTexture_enc(this, GL_TEXTURE_2D,
+                    m_state->getBoundTexture(target));
+    }
+}
+
+void GLEncoder::restore2DTextureTarget()
+{
+    GLenum priorityTarget = m_state->getPriorityEnabledTarget(GL_TEXTURE_2D);
+    m_glBindTexture_enc(this, GL_TEXTURE_2D,
+            m_state->getBoundTexture(priorityTarget));
+}
+
+void GLEncoder::s_glGenFramebuffersOES(void* self,
+        GLsizei n, GLuint* framebuffers) {
+    GLEncoder* ctx = (GLEncoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    SET_ERROR_IF(n < 0, GL_INVALID_VALUE);
+
+    ctx->m_glGenFramebuffersOES_enc(self, n, framebuffers);
+    state->addFramebuffers(n, framebuffers);
+}
+
+void GLEncoder::s_glDeleteFramebuffersOES(void* self,
+        GLsizei n, const GLuint* framebuffers) {
+    GLEncoder* ctx = (GLEncoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    SET_ERROR_IF(n < 0, GL_INVALID_VALUE);
+
+    ctx->m_glDeleteFramebuffersOES_enc(self, n, framebuffers);
+    state->removeFramebuffers(n, framebuffers);
+}
+
+void GLEncoder::s_glBindFramebufferOES(void* self,
+        GLenum target, GLuint framebuffer) {
+    GLEncoder* ctx = (GLEncoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    SET_ERROR_IF((target != GL_FRAMEBUFFER),
+                 GL_INVALID_ENUM);
+
+    state->bindFramebuffer(target, framebuffer);
+
+    ctx->m_glBindFramebufferOES_enc(self, target, framebuffer);
+}
+
+void GLEncoder::s_glFramebufferTexture2DOES(void*self,
+        GLenum target, GLenum attachment,
+        GLenum textarget, GLuint texture, GLint level) {
+    GLEncoder* ctx = (GLEncoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    state->attachTextureObject(target, attachment, texture, level, 0);
+
+    ctx->m_glFramebufferTexture2DOES_enc(self, target, attachment, textarget, texture, level);
+}
+
+void GLEncoder::s_glFramebufferTexture2DMultisampleIMG(void* self,
+        GLenum target, GLenum attachment,
+        GLenum textarget, GLuint texture, GLint level, GLsizei samples) {
+    GLEncoder* ctx = (GLEncoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    state->attachTextureObject(target, attachment, texture, level, 0);
+
+    ctx->m_glFramebufferTexture2DMultisampleIMG_enc(self, target, attachment, textarget, texture, level, samples);
+}
+
+void GLEncoder::s_glGetFramebufferAttachmentParameterivOES(void* self,
+        GLenum target, GLenum attachment, GLenum pname, GLint* params)
+{
+    GLEncoder* ctx = (GLEncoder*)self;
+    const GLClientState* state = ctx->m_state;
+
+    SET_ERROR_IF(state->boundFramebuffer(GL_FRAMEBUFFER) == 0,
+                 GL_INVALID_OPERATION);
+    SET_ERROR_IF((pname != GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) &&
+                 (!state->attachmentHasObject(GL_FRAMEBUFFER, attachment)),
+                 GL_INVALID_ENUM);
+
+    ctx->m_glGetFramebufferAttachmentParameterivOES_enc(self, target, attachment, pname, params);
+}
+
+GLEncoder::GLEncoder(IOStream *stream, ChecksumCalculator *protocol)
+        : gl_encoder_context_t(stream, protocol)
+{
+    m_initialized = false;
+    m_state = NULL;
+    m_error = GL_NO_ERROR;
+    m_num_compressedTextureFormats = 0;
+    m_compressedTextureFormats = NULL;
+
+    // overrides;
+#define OVERRIDE(name)  m_##name##_enc = this-> name ; this-> name = &s_##name
+
+    OVERRIDE(glFlush);
+    OVERRIDE(glPixelStorei);
+    OVERRIDE(glVertexPointer);
+    OVERRIDE(glNormalPointer);
+    OVERRIDE(glColorPointer);
+    OVERRIDE(glPointSizePointerOES);
+    OVERRIDE(glClientActiveTexture);
+    OVERRIDE(glTexCoordPointer);
+    OVERRIDE(glMatrixIndexPointerOES);
+    OVERRIDE(glWeightPointerOES);
+
+    OVERRIDE(glGetIntegerv);
+    OVERRIDE(glGetFloatv);
+    OVERRIDE(glGetBooleanv);
+    OVERRIDE(glGetFixedv);
+    OVERRIDE(glGetPointerv);
+
+    OVERRIDE(glBindBuffer);
+    OVERRIDE(glBufferData);
+    OVERRIDE(glBufferSubData);
+    OVERRIDE(glDeleteBuffers);
+
+    OVERRIDE(glEnableClientState);
+    OVERRIDE(glDisableClientState);
+    OVERRIDE(glIsEnabled);
+    OVERRIDE(glDrawArrays);
+    OVERRIDE(glDrawElements);
+
+    this->glGetString = s_glGetString;
+    this->glFinish = s_glFinish;
+
+    OVERRIDE(glGetError);
+
+    OVERRIDE(glActiveTexture);
+    OVERRIDE(glBindTexture);
+    OVERRIDE(glDeleteTextures);
+    OVERRIDE(glDisable);
+    OVERRIDE(glEnable);
+    OVERRIDE(glGetTexParameterfv);
+    OVERRIDE(glGetTexParameteriv);
+    OVERRIDE(glGetTexParameterxv);
+    OVERRIDE(glTexParameterf);
+    OVERRIDE(glTexParameterfv);
+    OVERRIDE(glTexParameteri);
+    OVERRIDE(glTexParameterx);
+    OVERRIDE(glTexParameteriv);
+    OVERRIDE(glTexParameterxv);
+
+    OVERRIDE(glGenFramebuffersOES);
+    OVERRIDE(glDeleteFramebuffersOES);
+    OVERRIDE(glBindFramebufferOES);
+    OVERRIDE(glFramebufferTexture2DOES);
+    OVERRIDE(glFramebufferTexture2DMultisampleIMG);
+    OVERRIDE(glGetFramebufferAttachmentParameterivOES);
+
+    this->glReadnPixelsEXT = s_glReadnPixelsEXT;
+}
+
+GLEncoder::~GLEncoder()
+{
+    delete [] m_compressedTextureFormats;
+}
+
+size_t GLEncoder::pixelDataSize(GLsizei width, GLsizei height, GLenum format, GLenum type, int pack)
+{
+    assert(m_state != NULL);
+    return m_state->pixelDataSize(width, height, 1, format, type, pack);
+}
+
+void GLEncoder::s_glFinish(void *self)
+{
+    GLEncoder *ctx = (GLEncoder *)self;
+    ctx->glFinishRoundTrip(self);
+}
+
+void GLEncoder::s_glReadnPixelsEXT(void* self, GLint x, GLint y, GLsizei width,
+        GLsizei height, GLenum format, GLenum type, GLsizei bufSize,
+        GLvoid* pixels) {
+    GLEncoder *ctx = (GLEncoder*)self;
+    SET_ERROR_IF(bufSize < ctx->pixelDataSize(width, height, format,
+        type, 1), GL_INVALID_OPERATION);
+    ctx->glReadPixels(self, x, y, width, height, format, type, pixels);
+}
diff --git a/system/GLESv1_enc/GLEncoder.h b/system/GLESv1_enc/GLEncoder.h
new file mode 100644
index 0000000..1d3378a
--- /dev/null
+++ b/system/GLESv1_enc/GLEncoder.h
@@ -0,0 +1,176 @@
+/*
+* Copyright (C) 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#ifndef _GL_ENCODER_H_
+#define _GL_ENCODER_H_
+
+#include <vector>
+
+#include "gl_enc.h"
+#include "GLClientState.h"
+#include "GLSharedGroup.h"
+#include "ChecksumCalculator.h"
+
+class GLEncoder : public gl_encoder_context_t {
+
+public:
+    GLEncoder(gfxstream::IOStream *stream, ChecksumCalculator* protocol);
+    virtual ~GLEncoder();
+    void setClientState(GLClientState *state) {
+        m_state = state;
+    }
+    void setSharedGroup(GLSharedGroupPtr shared) {
+        m_shared = shared;
+        if (m_state && m_shared)
+            m_state->setTextureData(m_shared->getTextureData());
+    }
+    void flush() { m_stream->flush(); }
+    size_t pixelDataSize(GLsizei width, GLsizei height, GLenum format, GLenum type, int pack);
+
+    void setInitialized(){ m_initialized = true; };
+    bool isInitialized(){ return m_initialized; };
+
+    virtual void setError(GLenum error){ m_error = error; };
+    virtual GLenum getError() { return m_error; };
+
+    void override2DTextureTarget(GLenum target);
+    void restore2DTextureTarget();
+
+private:
+
+    bool    m_initialized;
+    GLClientState *m_state;
+    GLSharedGroupPtr m_shared;
+    GLenum  m_error;
+    std::vector<char> m_fixedBuffer;
+    GLint *m_compressedTextureFormats;
+    GLint m_num_compressedTextureFormats;
+
+    GLint *getCompressedTextureFormats();
+    // original functions;
+    glGetError_client_proc_t    m_glGetError_enc;
+    glGetIntegerv_client_proc_t m_glGetIntegerv_enc;
+    glGetFloatv_client_proc_t m_glGetFloatv_enc;
+    glGetFixedv_client_proc_t m_glGetFixedv_enc;
+    glGetBooleanv_client_proc_t m_glGetBooleanv_enc;
+    glGetPointerv_client_proc_t m_glGetPointerv_enc;
+
+    glPixelStorei_client_proc_t m_glPixelStorei_enc;
+    glVertexPointer_client_proc_t m_glVertexPointer_enc;
+    glNormalPointer_client_proc_t m_glNormalPointer_enc;
+    glColorPointer_client_proc_t m_glColorPointer_enc;
+    glPointSizePointerOES_client_proc_t m_glPointSizePointerOES_enc;
+    glTexCoordPointer_client_proc_t m_glTexCoordPointer_enc;
+    glClientActiveTexture_client_proc_t m_glClientActiveTexture_enc;
+    glMatrixIndexPointerOES_client_proc_t m_glMatrixIndexPointerOES_enc;
+    glWeightPointerOES_client_proc_t m_glWeightPointerOES_enc;
+
+    glBindBuffer_client_proc_t m_glBindBuffer_enc;
+    glBufferData_client_proc_t m_glBufferData_enc;
+    glBufferSubData_client_proc_t m_glBufferSubData_enc;
+    glDeleteBuffers_client_proc_t m_glDeleteBuffers_enc;
+    
+    glEnableClientState_client_proc_t m_glEnableClientState_enc;
+    glDisableClientState_client_proc_t m_glDisableClientState_enc;
+    glIsEnabled_client_proc_t m_glIsEnabled_enc;
+    glDrawArrays_client_proc_t m_glDrawArrays_enc;
+    glDrawElements_client_proc_t m_glDrawElements_enc;
+    glFlush_client_proc_t m_glFlush_enc;
+
+    glActiveTexture_client_proc_t m_glActiveTexture_enc;
+    glBindTexture_client_proc_t m_glBindTexture_enc;
+    glDeleteTextures_client_proc_t m_glDeleteTextures_enc;
+    glDisable_client_proc_t m_glDisable_enc;
+    glEnable_client_proc_t m_glEnable_enc;
+    glGetTexParameterfv_client_proc_t m_glGetTexParameterfv_enc;
+    glGetTexParameteriv_client_proc_t m_glGetTexParameteriv_enc;
+    glGetTexParameterxv_client_proc_t m_glGetTexParameterxv_enc;
+    glTexParameterf_client_proc_t m_glTexParameterf_enc;
+    glTexParameterfv_client_proc_t m_glTexParameterfv_enc;
+    glTexParameteri_client_proc_t m_glTexParameteri_enc;
+    glTexParameterx_client_proc_t m_glTexParameterx_enc;
+    glTexParameteriv_client_proc_t m_glTexParameteriv_enc;
+    glTexParameterxv_client_proc_t m_glTexParameterxv_enc;
+
+    glGenFramebuffersOES_client_proc_t m_glGenFramebuffersOES_enc;
+    glDeleteFramebuffersOES_client_proc_t m_glDeleteFramebuffersOES_enc;
+    glBindFramebufferOES_client_proc_t m_glBindFramebufferOES_enc;
+    glFramebufferTexture2DOES_client_proc_t m_glFramebufferTexture2DOES_enc;
+    glFramebufferTexture2DMultisampleIMG_client_proc_t m_glFramebufferTexture2DMultisampleIMG_enc;
+    glGetFramebufferAttachmentParameterivOES_client_proc_t m_glGetFramebufferAttachmentParameterivOES_enc;
+
+    // statics
+    static GLenum s_glGetError(void * self);
+    static void s_glGetIntegerv(void *self, GLenum pname, GLint *ptr);
+    static void s_glGetBooleanv(void *self, GLenum pname, GLboolean *ptr);
+    static void s_glGetFloatv(void *self, GLenum pname, GLfloat *ptr);
+    static void s_glGetFixedv(void *self, GLenum pname, GLfixed *ptr);
+    static void s_glGetPointerv(void *self, GLenum pname, GLvoid **params);
+
+    static void s_glFlush(void * self);
+    static const GLubyte * s_glGetString(void *self, GLenum name);
+    static void s_glVertexPointer(void *self, int size, GLenum type, GLsizei stride, const void *data);
+    static void s_glNormalPointer(void *self, GLenum type, GLsizei stride, const void *data);
+    static void s_glColorPointer(void *self, int size, GLenum type, GLsizei stride, const void *data);
+    static void s_glPointSizePointerOES(void *self, GLenum type, GLsizei stride, const void *data);
+    static void s_glClientActiveTexture(void *self, GLenum texture);
+    static void s_glTexCoordPointer(void *self, int size, GLenum type, GLsizei stride, const void *data);
+    static void s_glMatrixIndexPointerOES(void *self, int size, GLenum type, GLsizei stride, const void * data);
+    static void s_glWeightPointerOES(void *self, int size, GLenum type, GLsizei stride, const void * data);
+    static void s_glDisableClientState(void *self, GLenum state);
+    static void s_glEnableClientState(void *self, GLenum state);
+    static GLboolean s_glIsEnabled(void *self, GLenum cap);
+    static void s_glBindBuffer(void *self, GLenum target, GLuint id);
+    static void s_glBufferData(void *self, GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage);
+    static void s_glBufferSubData(void *self, GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data);
+    static void s_glDeleteBuffers(void *self, GLsizei n, const GLuint * buffers);
+
+    static void s_glDrawArrays(void *self, GLenum mode, GLint first, GLsizei count);
+    static void s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum type, const void *indices);
+    static void s_glPixelStorei(void *self, GLenum param, GLint value);
+
+    static void s_glFinish(void *self);
+    void sendVertexData(unsigned first, unsigned count);
+
+    static void s_glActiveTexture(void* self, GLenum texture);
+    static void s_glBindTexture(void* self, GLenum target, GLuint texture);
+    static void s_glDeleteTextures(void* self, GLsizei n, const GLuint* textures);
+    static void s_glDisable(void* self, GLenum cap);
+    static void s_glEnable(void* self, GLenum cap);
+    static void s_glGetTexParameterfv(void* self, GLenum target, GLenum pname, GLfloat* params);
+    static void s_glGetTexParameteriv(void* self, GLenum target, GLenum pname, GLint* params);
+    static void s_glGetTexParameterxv(void* self, GLenum target, GLenum pname, GLfixed* params);
+    static void s_glTexParameterf(void* self, GLenum target, GLenum pname, GLfloat param);
+    static void s_glTexParameterfv(void* self, GLenum target, GLenum pname, const GLfloat* params);
+    static void s_glTexParameteri(void* self, GLenum target, GLenum pname, GLint param);
+    static void s_glTexParameterx(void* self, GLenum target, GLenum pname, GLfixed param);
+    static void s_glTexParameteriv(void* self, GLenum target, GLenum pname, const GLint* params);
+    static void s_glTexParameterxv(void* self, GLenum target, GLenum pname, const GLfixed* params);
+
+    static void s_glGenFramebuffersOES(void* self, GLsizei n, GLuint* framebuffers);
+    static void s_glDeleteFramebuffersOES(void* self, GLsizei n, const GLuint* framebuffers);
+    static void s_glBindFramebufferOES(void* self, GLenum target, GLuint framebuffer);
+    static void s_glFramebufferTexture2DOES(void* self, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+    static void s_glFramebufferTexture2DMultisampleIMG(void* self, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+    static void s_glGetFramebufferAttachmentParameterivOES(void* self, GLenum target, GLenum attachment, GLenum pname, GLint* params);
+    static void s_glReadnPixelsEXT(void* self, GLint x, GLint y, GLsizei width,
+            GLsizei height, GLenum format, GLenum type, GLsizei bufSize,
+            GLvoid* pixels);
+
+public:
+    glEGLImageTargetTexture2DOES_client_proc_t m_glEGLImageTargetTexture2DOES_enc;
+
+};
+#endif
diff --git a/system/GLESv1_enc/GLEncoderUtils.cpp b/system/GLESv1_enc/GLEncoderUtils.cpp
new file mode 100644
index 0000000..4924392
--- /dev/null
+++ b/system/GLESv1_enc/GLEncoderUtils.cpp
@@ -0,0 +1,28 @@
+/*
+* Copyright (C) 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#include <stdio.h>
+#include <stdlib.h>
+#include "GLEncoder.h"
+
+namespace glesv1_enc {
+
+size_t pixelDataSize(void *self, GLsizei width, GLsizei height, GLenum format, GLenum type, int pack)
+{
+    GLEncoder *ctx = (GLEncoder *)self;
+    return ctx->pixelDataSize(width, height, format, type, pack);
+}
+
+}  // namespace glesv1_enc
diff --git a/system/GLESv1_enc/GLEncoderUtils.h b/system/GLESv1_enc/GLEncoderUtils.h
new file mode 100644
index 0000000..88d989f
--- /dev/null
+++ b/system/GLESv1_enc/GLEncoderUtils.h
@@ -0,0 +1,23 @@
+/*
+* Copyright (C) 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#ifndef GL_ENCODER_UTILS_H
+#define GL_ENCODER_UTILS_H
+
+namespace glesv1_enc {
+    size_t pixelDataSize(void *self, GLsizei width, GLsizei height, GLenum format, GLenum type, int pack);
+};
+
+#endif
diff --git a/system/GLESv1_enc/gl_client_context.cpp b/system/GLESv1_enc/gl_client_context.cpp
new file mode 100644
index 0000000..64fc5f5
--- /dev/null
+++ b/system/GLESv1_enc/gl_client_context.cpp
@@ -0,0 +1,308 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+
+
+#include <string.h>
+#include "gl_client_context.h"
+
+
+#include <stdio.h>
+
+int gl_client_context_t::initDispatchByName(void *(*getProc)(const char *, void *userData), void *userData)
+{
+	glAlphaFunc = (glAlphaFunc_client_proc_t) getProc("glAlphaFunc", userData);
+	glClearColor = (glClearColor_client_proc_t) getProc("glClearColor", userData);
+	glClearDepthf = (glClearDepthf_client_proc_t) getProc("glClearDepthf", userData);
+	glClipPlanef = (glClipPlanef_client_proc_t) getProc("glClipPlanef", userData);
+	glColor4f = (glColor4f_client_proc_t) getProc("glColor4f", userData);
+	glDepthRangef = (glDepthRangef_client_proc_t) getProc("glDepthRangef", userData);
+	glFogf = (glFogf_client_proc_t) getProc("glFogf", userData);
+	glFogfv = (glFogfv_client_proc_t) getProc("glFogfv", userData);
+	glFrustumf = (glFrustumf_client_proc_t) getProc("glFrustumf", userData);
+	glGetClipPlanef = (glGetClipPlanef_client_proc_t) getProc("glGetClipPlanef", userData);
+	glGetFloatv = (glGetFloatv_client_proc_t) getProc("glGetFloatv", userData);
+	glGetLightfv = (glGetLightfv_client_proc_t) getProc("glGetLightfv", userData);
+	glGetMaterialfv = (glGetMaterialfv_client_proc_t) getProc("glGetMaterialfv", userData);
+	glGetTexEnvfv = (glGetTexEnvfv_client_proc_t) getProc("glGetTexEnvfv", userData);
+	glGetTexParameterfv = (glGetTexParameterfv_client_proc_t) getProc("glGetTexParameterfv", userData);
+	glLightModelf = (glLightModelf_client_proc_t) getProc("glLightModelf", userData);
+	glLightModelfv = (glLightModelfv_client_proc_t) getProc("glLightModelfv", userData);
+	glLightf = (glLightf_client_proc_t) getProc("glLightf", userData);
+	glLightfv = (glLightfv_client_proc_t) getProc("glLightfv", userData);
+	glLineWidth = (glLineWidth_client_proc_t) getProc("glLineWidth", userData);
+	glLoadMatrixf = (glLoadMatrixf_client_proc_t) getProc("glLoadMatrixf", userData);
+	glMaterialf = (glMaterialf_client_proc_t) getProc("glMaterialf", userData);
+	glMaterialfv = (glMaterialfv_client_proc_t) getProc("glMaterialfv", userData);
+	glMultMatrixf = (glMultMatrixf_client_proc_t) getProc("glMultMatrixf", userData);
+	glMultiTexCoord4f = (glMultiTexCoord4f_client_proc_t) getProc("glMultiTexCoord4f", userData);
+	glNormal3f = (glNormal3f_client_proc_t) getProc("glNormal3f", userData);
+	glOrthof = (glOrthof_client_proc_t) getProc("glOrthof", userData);
+	glPointParameterf = (glPointParameterf_client_proc_t) getProc("glPointParameterf", userData);
+	glPointParameterfv = (glPointParameterfv_client_proc_t) getProc("glPointParameterfv", userData);
+	glPointSize = (glPointSize_client_proc_t) getProc("glPointSize", userData);
+	glPolygonOffset = (glPolygonOffset_client_proc_t) getProc("glPolygonOffset", userData);
+	glRotatef = (glRotatef_client_proc_t) getProc("glRotatef", userData);
+	glScalef = (glScalef_client_proc_t) getProc("glScalef", userData);
+	glTexEnvf = (glTexEnvf_client_proc_t) getProc("glTexEnvf", userData);
+	glTexEnvfv = (glTexEnvfv_client_proc_t) getProc("glTexEnvfv", userData);
+	glTexParameterf = (glTexParameterf_client_proc_t) getProc("glTexParameterf", userData);
+	glTexParameterfv = (glTexParameterfv_client_proc_t) getProc("glTexParameterfv", userData);
+	glTranslatef = (glTranslatef_client_proc_t) getProc("glTranslatef", userData);
+	glActiveTexture = (glActiveTexture_client_proc_t) getProc("glActiveTexture", userData);
+	glAlphaFuncx = (glAlphaFuncx_client_proc_t) getProc("glAlphaFuncx", userData);
+	glBindBuffer = (glBindBuffer_client_proc_t) getProc("glBindBuffer", userData);
+	glBindTexture = (glBindTexture_client_proc_t) getProc("glBindTexture", userData);
+	glBlendFunc = (glBlendFunc_client_proc_t) getProc("glBlendFunc", userData);
+	glBufferData = (glBufferData_client_proc_t) getProc("glBufferData", userData);
+	glBufferSubData = (glBufferSubData_client_proc_t) getProc("glBufferSubData", userData);
+	glClear = (glClear_client_proc_t) getProc("glClear", userData);
+	glClearColorx = (glClearColorx_client_proc_t) getProc("glClearColorx", userData);
+	glClearDepthx = (glClearDepthx_client_proc_t) getProc("glClearDepthx", userData);
+	glClearStencil = (glClearStencil_client_proc_t) getProc("glClearStencil", userData);
+	glClientActiveTexture = (glClientActiveTexture_client_proc_t) getProc("glClientActiveTexture", userData);
+	glColor4ub = (glColor4ub_client_proc_t) getProc("glColor4ub", userData);
+	glColor4x = (glColor4x_client_proc_t) getProc("glColor4x", userData);
+	glColorMask = (glColorMask_client_proc_t) getProc("glColorMask", userData);
+	glColorPointer = (glColorPointer_client_proc_t) getProc("glColorPointer", userData);
+	glCompressedTexImage2D = (glCompressedTexImage2D_client_proc_t) getProc("glCompressedTexImage2D", userData);
+	glCompressedTexSubImage2D = (glCompressedTexSubImage2D_client_proc_t) getProc("glCompressedTexSubImage2D", userData);
+	glCopyTexImage2D = (glCopyTexImage2D_client_proc_t) getProc("glCopyTexImage2D", userData);
+	glCopyTexSubImage2D = (glCopyTexSubImage2D_client_proc_t) getProc("glCopyTexSubImage2D", userData);
+	glCullFace = (glCullFace_client_proc_t) getProc("glCullFace", userData);
+	glDeleteBuffers = (glDeleteBuffers_client_proc_t) getProc("glDeleteBuffers", userData);
+	glDeleteTextures = (glDeleteTextures_client_proc_t) getProc("glDeleteTextures", userData);
+	glDepthFunc = (glDepthFunc_client_proc_t) getProc("glDepthFunc", userData);
+	glDepthMask = (glDepthMask_client_proc_t) getProc("glDepthMask", userData);
+	glDepthRangex = (glDepthRangex_client_proc_t) getProc("glDepthRangex", userData);
+	glDisable = (glDisable_client_proc_t) getProc("glDisable", userData);
+	glDisableClientState = (glDisableClientState_client_proc_t) getProc("glDisableClientState", userData);
+	glDrawArrays = (glDrawArrays_client_proc_t) getProc("glDrawArrays", userData);
+	glDrawElements = (glDrawElements_client_proc_t) getProc("glDrawElements", userData);
+	glEnable = (glEnable_client_proc_t) getProc("glEnable", userData);
+	glEnableClientState = (glEnableClientState_client_proc_t) getProc("glEnableClientState", userData);
+	glFinish = (glFinish_client_proc_t) getProc("glFinish", userData);
+	glFlush = (glFlush_client_proc_t) getProc("glFlush", userData);
+	glFogx = (glFogx_client_proc_t) getProc("glFogx", userData);
+	glFogxv = (glFogxv_client_proc_t) getProc("glFogxv", userData);
+	glFrontFace = (glFrontFace_client_proc_t) getProc("glFrontFace", userData);
+	glFrustumx = (glFrustumx_client_proc_t) getProc("glFrustumx", userData);
+	glGetBooleanv = (glGetBooleanv_client_proc_t) getProc("glGetBooleanv", userData);
+	glGetBufferParameteriv = (glGetBufferParameteriv_client_proc_t) getProc("glGetBufferParameteriv", userData);
+	glClipPlanex = (glClipPlanex_client_proc_t) getProc("glClipPlanex", userData);
+	glGenBuffers = (glGenBuffers_client_proc_t) getProc("glGenBuffers", userData);
+	glGenTextures = (glGenTextures_client_proc_t) getProc("glGenTextures", userData);
+	glGetError = (glGetError_client_proc_t) getProc("glGetError", userData);
+	glGetFixedv = (glGetFixedv_client_proc_t) getProc("glGetFixedv", userData);
+	glGetIntegerv = (glGetIntegerv_client_proc_t) getProc("glGetIntegerv", userData);
+	glGetLightxv = (glGetLightxv_client_proc_t) getProc("glGetLightxv", userData);
+	glGetMaterialxv = (glGetMaterialxv_client_proc_t) getProc("glGetMaterialxv", userData);
+	glGetPointerv = (glGetPointerv_client_proc_t) getProc("glGetPointerv", userData);
+	glGetString = (glGetString_client_proc_t) getProc("glGetString", userData);
+	glGetTexEnviv = (glGetTexEnviv_client_proc_t) getProc("glGetTexEnviv", userData);
+	glGetTexEnvxv = (glGetTexEnvxv_client_proc_t) getProc("glGetTexEnvxv", userData);
+	glGetTexParameteriv = (glGetTexParameteriv_client_proc_t) getProc("glGetTexParameteriv", userData);
+	glGetTexParameterxv = (glGetTexParameterxv_client_proc_t) getProc("glGetTexParameterxv", userData);
+	glHint = (glHint_client_proc_t) getProc("glHint", userData);
+	glIsBuffer = (glIsBuffer_client_proc_t) getProc("glIsBuffer", userData);
+	glIsEnabled = (glIsEnabled_client_proc_t) getProc("glIsEnabled", userData);
+	glIsTexture = (glIsTexture_client_proc_t) getProc("glIsTexture", userData);
+	glLightModelx = (glLightModelx_client_proc_t) getProc("glLightModelx", userData);
+	glLightModelxv = (glLightModelxv_client_proc_t) getProc("glLightModelxv", userData);
+	glLightx = (glLightx_client_proc_t) getProc("glLightx", userData);
+	glLightxv = (glLightxv_client_proc_t) getProc("glLightxv", userData);
+	glLineWidthx = (glLineWidthx_client_proc_t) getProc("glLineWidthx", userData);
+	glLoadIdentity = (glLoadIdentity_client_proc_t) getProc("glLoadIdentity", userData);
+	glLoadMatrixx = (glLoadMatrixx_client_proc_t) getProc("glLoadMatrixx", userData);
+	glLogicOp = (glLogicOp_client_proc_t) getProc("glLogicOp", userData);
+	glMaterialx = (glMaterialx_client_proc_t) getProc("glMaterialx", userData);
+	glMaterialxv = (glMaterialxv_client_proc_t) getProc("glMaterialxv", userData);
+	glMatrixMode = (glMatrixMode_client_proc_t) getProc("glMatrixMode", userData);
+	glMultMatrixx = (glMultMatrixx_client_proc_t) getProc("glMultMatrixx", userData);
+	glMultiTexCoord4x = (glMultiTexCoord4x_client_proc_t) getProc("glMultiTexCoord4x", userData);
+	glNormal3x = (glNormal3x_client_proc_t) getProc("glNormal3x", userData);
+	glNormalPointer = (glNormalPointer_client_proc_t) getProc("glNormalPointer", userData);
+	glOrthox = (glOrthox_client_proc_t) getProc("glOrthox", userData);
+	glPixelStorei = (glPixelStorei_client_proc_t) getProc("glPixelStorei", userData);
+	glPointParameterx = (glPointParameterx_client_proc_t) getProc("glPointParameterx", userData);
+	glPointParameterxv = (glPointParameterxv_client_proc_t) getProc("glPointParameterxv", userData);
+	glPointSizex = (glPointSizex_client_proc_t) getProc("glPointSizex", userData);
+	glPolygonOffsetx = (glPolygonOffsetx_client_proc_t) getProc("glPolygonOffsetx", userData);
+	glPopMatrix = (glPopMatrix_client_proc_t) getProc("glPopMatrix", userData);
+	glPushMatrix = (glPushMatrix_client_proc_t) getProc("glPushMatrix", userData);
+	glReadPixels = (glReadPixels_client_proc_t) getProc("glReadPixels", userData);
+	glRotatex = (glRotatex_client_proc_t) getProc("glRotatex", userData);
+	glSampleCoverage = (glSampleCoverage_client_proc_t) getProc("glSampleCoverage", userData);
+	glSampleCoveragex = (glSampleCoveragex_client_proc_t) getProc("glSampleCoveragex", userData);
+	glScalex = (glScalex_client_proc_t) getProc("glScalex", userData);
+	glScissor = (glScissor_client_proc_t) getProc("glScissor", userData);
+	glShadeModel = (glShadeModel_client_proc_t) getProc("glShadeModel", userData);
+	glStencilFunc = (glStencilFunc_client_proc_t) getProc("glStencilFunc", userData);
+	glStencilMask = (glStencilMask_client_proc_t) getProc("glStencilMask", userData);
+	glStencilOp = (glStencilOp_client_proc_t) getProc("glStencilOp", userData);
+	glTexCoordPointer = (glTexCoordPointer_client_proc_t) getProc("glTexCoordPointer", userData);
+	glTexEnvi = (glTexEnvi_client_proc_t) getProc("glTexEnvi", userData);
+	glTexEnvx = (glTexEnvx_client_proc_t) getProc("glTexEnvx", userData);
+	glTexEnviv = (glTexEnviv_client_proc_t) getProc("glTexEnviv", userData);
+	glTexEnvxv = (glTexEnvxv_client_proc_t) getProc("glTexEnvxv", userData);
+	glTexImage2D = (glTexImage2D_client_proc_t) getProc("glTexImage2D", userData);
+	glTexParameteri = (glTexParameteri_client_proc_t) getProc("glTexParameteri", userData);
+	glTexParameterx = (glTexParameterx_client_proc_t) getProc("glTexParameterx", userData);
+	glTexParameteriv = (glTexParameteriv_client_proc_t) getProc("glTexParameteriv", userData);
+	glTexParameterxv = (glTexParameterxv_client_proc_t) getProc("glTexParameterxv", userData);
+	glTexSubImage2D = (glTexSubImage2D_client_proc_t) getProc("glTexSubImage2D", userData);
+	glTranslatex = (glTranslatex_client_proc_t) getProc("glTranslatex", userData);
+	glVertexPointer = (glVertexPointer_client_proc_t) getProc("glVertexPointer", userData);
+	glViewport = (glViewport_client_proc_t) getProc("glViewport", userData);
+	glPointSizePointerOES = (glPointSizePointerOES_client_proc_t) getProc("glPointSizePointerOES", userData);
+	glVertexPointerOffset = (glVertexPointerOffset_client_proc_t) getProc("glVertexPointerOffset", userData);
+	glColorPointerOffset = (glColorPointerOffset_client_proc_t) getProc("glColorPointerOffset", userData);
+	glNormalPointerOffset = (glNormalPointerOffset_client_proc_t) getProc("glNormalPointerOffset", userData);
+	glPointSizePointerOffset = (glPointSizePointerOffset_client_proc_t) getProc("glPointSizePointerOffset", userData);
+	glTexCoordPointerOffset = (glTexCoordPointerOffset_client_proc_t) getProc("glTexCoordPointerOffset", userData);
+	glWeightPointerOffset = (glWeightPointerOffset_client_proc_t) getProc("glWeightPointerOffset", userData);
+	glMatrixIndexPointerOffset = (glMatrixIndexPointerOffset_client_proc_t) getProc("glMatrixIndexPointerOffset", userData);
+	glVertexPointerData = (glVertexPointerData_client_proc_t) getProc("glVertexPointerData", userData);
+	glColorPointerData = (glColorPointerData_client_proc_t) getProc("glColorPointerData", userData);
+	glNormalPointerData = (glNormalPointerData_client_proc_t) getProc("glNormalPointerData", userData);
+	glTexCoordPointerData = (glTexCoordPointerData_client_proc_t) getProc("glTexCoordPointerData", userData);
+	glPointSizePointerData = (glPointSizePointerData_client_proc_t) getProc("glPointSizePointerData", userData);
+	glWeightPointerData = (glWeightPointerData_client_proc_t) getProc("glWeightPointerData", userData);
+	glMatrixIndexPointerData = (glMatrixIndexPointerData_client_proc_t) getProc("glMatrixIndexPointerData", userData);
+	glDrawElementsOffset = (glDrawElementsOffset_client_proc_t) getProc("glDrawElementsOffset", userData);
+	glDrawElementsData = (glDrawElementsData_client_proc_t) getProc("glDrawElementsData", userData);
+	glGetCompressedTextureFormats = (glGetCompressedTextureFormats_client_proc_t) getProc("glGetCompressedTextureFormats", userData);
+	glFinishRoundTrip = (glFinishRoundTrip_client_proc_t) getProc("glFinishRoundTrip", userData);
+	glBlendEquationSeparateOES = (glBlendEquationSeparateOES_client_proc_t) getProc("glBlendEquationSeparateOES", userData);
+	glBlendFuncSeparateOES = (glBlendFuncSeparateOES_client_proc_t) getProc("glBlendFuncSeparateOES", userData);
+	glBlendEquationOES = (glBlendEquationOES_client_proc_t) getProc("glBlendEquationOES", userData);
+	glDrawTexsOES = (glDrawTexsOES_client_proc_t) getProc("glDrawTexsOES", userData);
+	glDrawTexiOES = (glDrawTexiOES_client_proc_t) getProc("glDrawTexiOES", userData);
+	glDrawTexxOES = (glDrawTexxOES_client_proc_t) getProc("glDrawTexxOES", userData);
+	glDrawTexsvOES = (glDrawTexsvOES_client_proc_t) getProc("glDrawTexsvOES", userData);
+	glDrawTexivOES = (glDrawTexivOES_client_proc_t) getProc("glDrawTexivOES", userData);
+	glDrawTexxvOES = (glDrawTexxvOES_client_proc_t) getProc("glDrawTexxvOES", userData);
+	glDrawTexfOES = (glDrawTexfOES_client_proc_t) getProc("glDrawTexfOES", userData);
+	glDrawTexfvOES = (glDrawTexfvOES_client_proc_t) getProc("glDrawTexfvOES", userData);
+	glEGLImageTargetTexture2DOES = (glEGLImageTargetTexture2DOES_client_proc_t) getProc("glEGLImageTargetTexture2DOES", userData);
+	glEGLImageTargetRenderbufferStorageOES = (glEGLImageTargetRenderbufferStorageOES_client_proc_t) getProc("glEGLImageTargetRenderbufferStorageOES", userData);
+	glAlphaFuncxOES = (glAlphaFuncxOES_client_proc_t) getProc("glAlphaFuncxOES", userData);
+	glClearColorxOES = (glClearColorxOES_client_proc_t) getProc("glClearColorxOES", userData);
+	glClearDepthxOES = (glClearDepthxOES_client_proc_t) getProc("glClearDepthxOES", userData);
+	glClipPlanexOES = (glClipPlanexOES_client_proc_t) getProc("glClipPlanexOES", userData);
+	glClipPlanexIMG = (glClipPlanexIMG_client_proc_t) getProc("glClipPlanexIMG", userData);
+	glColor4xOES = (glColor4xOES_client_proc_t) getProc("glColor4xOES", userData);
+	glDepthRangexOES = (glDepthRangexOES_client_proc_t) getProc("glDepthRangexOES", userData);
+	glFogxOES = (glFogxOES_client_proc_t) getProc("glFogxOES", userData);
+	glFogxvOES = (glFogxvOES_client_proc_t) getProc("glFogxvOES", userData);
+	glFrustumxOES = (glFrustumxOES_client_proc_t) getProc("glFrustumxOES", userData);
+	glGetClipPlanexOES = (glGetClipPlanexOES_client_proc_t) getProc("glGetClipPlanexOES", userData);
+	glGetClipPlanex = (glGetClipPlanex_client_proc_t) getProc("glGetClipPlanex", userData);
+	glGetFixedvOES = (glGetFixedvOES_client_proc_t) getProc("glGetFixedvOES", userData);
+	glGetLightxvOES = (glGetLightxvOES_client_proc_t) getProc("glGetLightxvOES", userData);
+	glGetMaterialxvOES = (glGetMaterialxvOES_client_proc_t) getProc("glGetMaterialxvOES", userData);
+	glGetTexEnvxvOES = (glGetTexEnvxvOES_client_proc_t) getProc("glGetTexEnvxvOES", userData);
+	glGetTexParameterxvOES = (glGetTexParameterxvOES_client_proc_t) getProc("glGetTexParameterxvOES", userData);
+	glLightModelxOES = (glLightModelxOES_client_proc_t) getProc("glLightModelxOES", userData);
+	glLightModelxvOES = (glLightModelxvOES_client_proc_t) getProc("glLightModelxvOES", userData);
+	glLightxOES = (glLightxOES_client_proc_t) getProc("glLightxOES", userData);
+	glLightxvOES = (glLightxvOES_client_proc_t) getProc("glLightxvOES", userData);
+	glLineWidthxOES = (glLineWidthxOES_client_proc_t) getProc("glLineWidthxOES", userData);
+	glLoadMatrixxOES = (glLoadMatrixxOES_client_proc_t) getProc("glLoadMatrixxOES", userData);
+	glMaterialxOES = (glMaterialxOES_client_proc_t) getProc("glMaterialxOES", userData);
+	glMaterialxvOES = (glMaterialxvOES_client_proc_t) getProc("glMaterialxvOES", userData);
+	glMultMatrixxOES = (glMultMatrixxOES_client_proc_t) getProc("glMultMatrixxOES", userData);
+	glMultiTexCoord4xOES = (glMultiTexCoord4xOES_client_proc_t) getProc("glMultiTexCoord4xOES", userData);
+	glNormal3xOES = (glNormal3xOES_client_proc_t) getProc("glNormal3xOES", userData);
+	glOrthoxOES = (glOrthoxOES_client_proc_t) getProc("glOrthoxOES", userData);
+	glPointParameterxOES = (glPointParameterxOES_client_proc_t) getProc("glPointParameterxOES", userData);
+	glPointParameterxvOES = (glPointParameterxvOES_client_proc_t) getProc("glPointParameterxvOES", userData);
+	glPointSizexOES = (glPointSizexOES_client_proc_t) getProc("glPointSizexOES", userData);
+	glPolygonOffsetxOES = (glPolygonOffsetxOES_client_proc_t) getProc("glPolygonOffsetxOES", userData);
+	glRotatexOES = (glRotatexOES_client_proc_t) getProc("glRotatexOES", userData);
+	glSampleCoveragexOES = (glSampleCoveragexOES_client_proc_t) getProc("glSampleCoveragexOES", userData);
+	glScalexOES = (glScalexOES_client_proc_t) getProc("glScalexOES", userData);
+	glTexEnvxOES = (glTexEnvxOES_client_proc_t) getProc("glTexEnvxOES", userData);
+	glTexEnvxvOES = (glTexEnvxvOES_client_proc_t) getProc("glTexEnvxvOES", userData);
+	glTexParameterxOES = (glTexParameterxOES_client_proc_t) getProc("glTexParameterxOES", userData);
+	glTexParameterxvOES = (glTexParameterxvOES_client_proc_t) getProc("glTexParameterxvOES", userData);
+	glTranslatexOES = (glTranslatexOES_client_proc_t) getProc("glTranslatexOES", userData);
+	glIsRenderbufferOES = (glIsRenderbufferOES_client_proc_t) getProc("glIsRenderbufferOES", userData);
+	glBindRenderbufferOES = (glBindRenderbufferOES_client_proc_t) getProc("glBindRenderbufferOES", userData);
+	glDeleteRenderbuffersOES = (glDeleteRenderbuffersOES_client_proc_t) getProc("glDeleteRenderbuffersOES", userData);
+	glGenRenderbuffersOES = (glGenRenderbuffersOES_client_proc_t) getProc("glGenRenderbuffersOES", userData);
+	glRenderbufferStorageOES = (glRenderbufferStorageOES_client_proc_t) getProc("glRenderbufferStorageOES", userData);
+	glGetRenderbufferParameterivOES = (glGetRenderbufferParameterivOES_client_proc_t) getProc("glGetRenderbufferParameterivOES", userData);
+	glIsFramebufferOES = (glIsFramebufferOES_client_proc_t) getProc("glIsFramebufferOES", userData);
+	glBindFramebufferOES = (glBindFramebufferOES_client_proc_t) getProc("glBindFramebufferOES", userData);
+	glDeleteFramebuffersOES = (glDeleteFramebuffersOES_client_proc_t) getProc("glDeleteFramebuffersOES", userData);
+	glGenFramebuffersOES = (glGenFramebuffersOES_client_proc_t) getProc("glGenFramebuffersOES", userData);
+	glCheckFramebufferStatusOES = (glCheckFramebufferStatusOES_client_proc_t) getProc("glCheckFramebufferStatusOES", userData);
+	glFramebufferRenderbufferOES = (glFramebufferRenderbufferOES_client_proc_t) getProc("glFramebufferRenderbufferOES", userData);
+	glFramebufferTexture2DOES = (glFramebufferTexture2DOES_client_proc_t) getProc("glFramebufferTexture2DOES", userData);
+	glGetFramebufferAttachmentParameterivOES = (glGetFramebufferAttachmentParameterivOES_client_proc_t) getProc("glGetFramebufferAttachmentParameterivOES", userData);
+	glGenerateMipmapOES = (glGenerateMipmapOES_client_proc_t) getProc("glGenerateMipmapOES", userData);
+	glMapBufferOES = (glMapBufferOES_client_proc_t) getProc("glMapBufferOES", userData);
+	glUnmapBufferOES = (glUnmapBufferOES_client_proc_t) getProc("glUnmapBufferOES", userData);
+	glGetBufferPointervOES = (glGetBufferPointervOES_client_proc_t) getProc("glGetBufferPointervOES", userData);
+	glCurrentPaletteMatrixOES = (glCurrentPaletteMatrixOES_client_proc_t) getProc("glCurrentPaletteMatrixOES", userData);
+	glLoadPaletteFromModelViewMatrixOES = (glLoadPaletteFromModelViewMatrixOES_client_proc_t) getProc("glLoadPaletteFromModelViewMatrixOES", userData);
+	glMatrixIndexPointerOES = (glMatrixIndexPointerOES_client_proc_t) getProc("glMatrixIndexPointerOES", userData);
+	glWeightPointerOES = (glWeightPointerOES_client_proc_t) getProc("glWeightPointerOES", userData);
+	glQueryMatrixxOES = (glQueryMatrixxOES_client_proc_t) getProc("glQueryMatrixxOES", userData);
+	glDepthRangefOES = (glDepthRangefOES_client_proc_t) getProc("glDepthRangefOES", userData);
+	glFrustumfOES = (glFrustumfOES_client_proc_t) getProc("glFrustumfOES", userData);
+	glOrthofOES = (glOrthofOES_client_proc_t) getProc("glOrthofOES", userData);
+	glClipPlanefOES = (glClipPlanefOES_client_proc_t) getProc("glClipPlanefOES", userData);
+	glClipPlanefIMG = (glClipPlanefIMG_client_proc_t) getProc("glClipPlanefIMG", userData);
+	glGetClipPlanefOES = (glGetClipPlanefOES_client_proc_t) getProc("glGetClipPlanefOES", userData);
+	glClearDepthfOES = (glClearDepthfOES_client_proc_t) getProc("glClearDepthfOES", userData);
+	glTexGenfOES = (glTexGenfOES_client_proc_t) getProc("glTexGenfOES", userData);
+	glTexGenfvOES = (glTexGenfvOES_client_proc_t) getProc("glTexGenfvOES", userData);
+	glTexGeniOES = (glTexGeniOES_client_proc_t) getProc("glTexGeniOES", userData);
+	glTexGenivOES = (glTexGenivOES_client_proc_t) getProc("glTexGenivOES", userData);
+	glTexGenxOES = (glTexGenxOES_client_proc_t) getProc("glTexGenxOES", userData);
+	glTexGenxvOES = (glTexGenxvOES_client_proc_t) getProc("glTexGenxvOES", userData);
+	glGetTexGenfvOES = (glGetTexGenfvOES_client_proc_t) getProc("glGetTexGenfvOES", userData);
+	glGetTexGenivOES = (glGetTexGenivOES_client_proc_t) getProc("glGetTexGenivOES", userData);
+	glGetTexGenxvOES = (glGetTexGenxvOES_client_proc_t) getProc("glGetTexGenxvOES", userData);
+	glBindVertexArrayOES = (glBindVertexArrayOES_client_proc_t) getProc("glBindVertexArrayOES", userData);
+	glDeleteVertexArraysOES = (glDeleteVertexArraysOES_client_proc_t) getProc("glDeleteVertexArraysOES", userData);
+	glGenVertexArraysOES = (glGenVertexArraysOES_client_proc_t) getProc("glGenVertexArraysOES", userData);
+	glIsVertexArrayOES = (glIsVertexArrayOES_client_proc_t) getProc("glIsVertexArrayOES", userData);
+	glDiscardFramebufferEXT = (glDiscardFramebufferEXT_client_proc_t) getProc("glDiscardFramebufferEXT", userData);
+	glMultiDrawArraysEXT = (glMultiDrawArraysEXT_client_proc_t) getProc("glMultiDrawArraysEXT", userData);
+	glMultiDrawElementsEXT = (glMultiDrawElementsEXT_client_proc_t) getProc("glMultiDrawElementsEXT", userData);
+	glMultiDrawArraysSUN = (glMultiDrawArraysSUN_client_proc_t) getProc("glMultiDrawArraysSUN", userData);
+	glMultiDrawElementsSUN = (glMultiDrawElementsSUN_client_proc_t) getProc("glMultiDrawElementsSUN", userData);
+	glRenderbufferStorageMultisampleIMG = (glRenderbufferStorageMultisampleIMG_client_proc_t) getProc("glRenderbufferStorageMultisampleIMG", userData);
+	glFramebufferTexture2DMultisampleIMG = (glFramebufferTexture2DMultisampleIMG_client_proc_t) getProc("glFramebufferTexture2DMultisampleIMG", userData);
+	glDeleteFencesNV = (glDeleteFencesNV_client_proc_t) getProc("glDeleteFencesNV", userData);
+	glGenFencesNV = (glGenFencesNV_client_proc_t) getProc("glGenFencesNV", userData);
+	glIsFenceNV = (glIsFenceNV_client_proc_t) getProc("glIsFenceNV", userData);
+	glTestFenceNV = (glTestFenceNV_client_proc_t) getProc("glTestFenceNV", userData);
+	glGetFenceivNV = (glGetFenceivNV_client_proc_t) getProc("glGetFenceivNV", userData);
+	glFinishFenceNV = (glFinishFenceNV_client_proc_t) getProc("glFinishFenceNV", userData);
+	glSetFenceNV = (glSetFenceNV_client_proc_t) getProc("glSetFenceNV", userData);
+	glGetDriverControlsQCOM = (glGetDriverControlsQCOM_client_proc_t) getProc("glGetDriverControlsQCOM", userData);
+	glGetDriverControlStringQCOM = (glGetDriverControlStringQCOM_client_proc_t) getProc("glGetDriverControlStringQCOM", userData);
+	glEnableDriverControlQCOM = (glEnableDriverControlQCOM_client_proc_t) getProc("glEnableDriverControlQCOM", userData);
+	glDisableDriverControlQCOM = (glDisableDriverControlQCOM_client_proc_t) getProc("glDisableDriverControlQCOM", userData);
+	glExtGetTexturesQCOM = (glExtGetTexturesQCOM_client_proc_t) getProc("glExtGetTexturesQCOM", userData);
+	glExtGetBuffersQCOM = (glExtGetBuffersQCOM_client_proc_t) getProc("glExtGetBuffersQCOM", userData);
+	glExtGetRenderbuffersQCOM = (glExtGetRenderbuffersQCOM_client_proc_t) getProc("glExtGetRenderbuffersQCOM", userData);
+	glExtGetFramebuffersQCOM = (glExtGetFramebuffersQCOM_client_proc_t) getProc("glExtGetFramebuffersQCOM", userData);
+	glExtGetTexLevelParameterivQCOM = (glExtGetTexLevelParameterivQCOM_client_proc_t) getProc("glExtGetTexLevelParameterivQCOM", userData);
+	glExtTexObjectStateOverrideiQCOM = (glExtTexObjectStateOverrideiQCOM_client_proc_t) getProc("glExtTexObjectStateOverrideiQCOM", userData);
+	glExtGetTexSubImageQCOM = (glExtGetTexSubImageQCOM_client_proc_t) getProc("glExtGetTexSubImageQCOM", userData);
+	glExtGetBufferPointervQCOM = (glExtGetBufferPointervQCOM_client_proc_t) getProc("glExtGetBufferPointervQCOM", userData);
+	glExtGetShadersQCOM = (glExtGetShadersQCOM_client_proc_t) getProc("glExtGetShadersQCOM", userData);
+	glExtGetProgramsQCOM = (glExtGetProgramsQCOM_client_proc_t) getProc("glExtGetProgramsQCOM", userData);
+	glExtIsProgramBinaryQCOM = (glExtIsProgramBinaryQCOM_client_proc_t) getProc("glExtIsProgramBinaryQCOM", userData);
+	glExtGetProgramBinarySourceQCOM = (glExtGetProgramBinarySourceQCOM_client_proc_t) getProc("glExtGetProgramBinarySourceQCOM", userData);
+	glStartTilingQCOM = (glStartTilingQCOM_client_proc_t) getProc("glStartTilingQCOM", userData);
+	glEndTilingQCOM = (glEndTilingQCOM_client_proc_t) getProc("glEndTilingQCOM", userData);
+	glGetGraphicsResetStatusEXT = (glGetGraphicsResetStatusEXT_client_proc_t) getProc("glGetGraphicsResetStatusEXT", userData);
+	glReadnPixelsEXT = (glReadnPixelsEXT_client_proc_t) getProc("glReadnPixelsEXT", userData);
+	return 0;
+}
+
diff --git a/system/GLESv1_enc/gl_client_context.h b/system/GLESv1_enc/gl_client_context.h
new file mode 100644
index 0000000..322972d
--- /dev/null
+++ b/system/GLESv1_enc/gl_client_context.h
@@ -0,0 +1,315 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+#ifndef __gl_client_context_t_h
+#define __gl_client_context_t_h
+
+#include "gl_client_proc.h"
+
+#include "gl_types.h"
+
+
+struct gl_client_context_t {
+
+	glAlphaFunc_client_proc_t glAlphaFunc;
+	glClearColor_client_proc_t glClearColor;
+	glClearDepthf_client_proc_t glClearDepthf;
+	glClipPlanef_client_proc_t glClipPlanef;
+	glColor4f_client_proc_t glColor4f;
+	glDepthRangef_client_proc_t glDepthRangef;
+	glFogf_client_proc_t glFogf;
+	glFogfv_client_proc_t glFogfv;
+	glFrustumf_client_proc_t glFrustumf;
+	glGetClipPlanef_client_proc_t glGetClipPlanef;
+	glGetFloatv_client_proc_t glGetFloatv;
+	glGetLightfv_client_proc_t glGetLightfv;
+	glGetMaterialfv_client_proc_t glGetMaterialfv;
+	glGetTexEnvfv_client_proc_t glGetTexEnvfv;
+	glGetTexParameterfv_client_proc_t glGetTexParameterfv;
+	glLightModelf_client_proc_t glLightModelf;
+	glLightModelfv_client_proc_t glLightModelfv;
+	glLightf_client_proc_t glLightf;
+	glLightfv_client_proc_t glLightfv;
+	glLineWidth_client_proc_t glLineWidth;
+	glLoadMatrixf_client_proc_t glLoadMatrixf;
+	glMaterialf_client_proc_t glMaterialf;
+	glMaterialfv_client_proc_t glMaterialfv;
+	glMultMatrixf_client_proc_t glMultMatrixf;
+	glMultiTexCoord4f_client_proc_t glMultiTexCoord4f;
+	glNormal3f_client_proc_t glNormal3f;
+	glOrthof_client_proc_t glOrthof;
+	glPointParameterf_client_proc_t glPointParameterf;
+	glPointParameterfv_client_proc_t glPointParameterfv;
+	glPointSize_client_proc_t glPointSize;
+	glPolygonOffset_client_proc_t glPolygonOffset;
+	glRotatef_client_proc_t glRotatef;
+	glScalef_client_proc_t glScalef;
+	glTexEnvf_client_proc_t glTexEnvf;
+	glTexEnvfv_client_proc_t glTexEnvfv;
+	glTexParameterf_client_proc_t glTexParameterf;
+	glTexParameterfv_client_proc_t glTexParameterfv;
+	glTranslatef_client_proc_t glTranslatef;
+	glActiveTexture_client_proc_t glActiveTexture;
+	glAlphaFuncx_client_proc_t glAlphaFuncx;
+	glBindBuffer_client_proc_t glBindBuffer;
+	glBindTexture_client_proc_t glBindTexture;
+	glBlendFunc_client_proc_t glBlendFunc;
+	glBufferData_client_proc_t glBufferData;
+	glBufferSubData_client_proc_t glBufferSubData;
+	glClear_client_proc_t glClear;
+	glClearColorx_client_proc_t glClearColorx;
+	glClearDepthx_client_proc_t glClearDepthx;
+	glClearStencil_client_proc_t glClearStencil;
+	glClientActiveTexture_client_proc_t glClientActiveTexture;
+	glColor4ub_client_proc_t glColor4ub;
+	glColor4x_client_proc_t glColor4x;
+	glColorMask_client_proc_t glColorMask;
+	glColorPointer_client_proc_t glColorPointer;
+	glCompressedTexImage2D_client_proc_t glCompressedTexImage2D;
+	glCompressedTexSubImage2D_client_proc_t glCompressedTexSubImage2D;
+	glCopyTexImage2D_client_proc_t glCopyTexImage2D;
+	glCopyTexSubImage2D_client_proc_t glCopyTexSubImage2D;
+	glCullFace_client_proc_t glCullFace;
+	glDeleteBuffers_client_proc_t glDeleteBuffers;
+	glDeleteTextures_client_proc_t glDeleteTextures;
+	glDepthFunc_client_proc_t glDepthFunc;
+	glDepthMask_client_proc_t glDepthMask;
+	glDepthRangex_client_proc_t glDepthRangex;
+	glDisable_client_proc_t glDisable;
+	glDisableClientState_client_proc_t glDisableClientState;
+	glDrawArrays_client_proc_t glDrawArrays;
+	glDrawElements_client_proc_t glDrawElements;
+	glEnable_client_proc_t glEnable;
+	glEnableClientState_client_proc_t glEnableClientState;
+	glFinish_client_proc_t glFinish;
+	glFlush_client_proc_t glFlush;
+	glFogx_client_proc_t glFogx;
+	glFogxv_client_proc_t glFogxv;
+	glFrontFace_client_proc_t glFrontFace;
+	glFrustumx_client_proc_t glFrustumx;
+	glGetBooleanv_client_proc_t glGetBooleanv;
+	glGetBufferParameteriv_client_proc_t glGetBufferParameteriv;
+	glClipPlanex_client_proc_t glClipPlanex;
+	glGenBuffers_client_proc_t glGenBuffers;
+	glGenTextures_client_proc_t glGenTextures;
+	glGetError_client_proc_t glGetError;
+	glGetFixedv_client_proc_t glGetFixedv;
+	glGetIntegerv_client_proc_t glGetIntegerv;
+	glGetLightxv_client_proc_t glGetLightxv;
+	glGetMaterialxv_client_proc_t glGetMaterialxv;
+	glGetPointerv_client_proc_t glGetPointerv;
+	glGetString_client_proc_t glGetString;
+	glGetTexEnviv_client_proc_t glGetTexEnviv;
+	glGetTexEnvxv_client_proc_t glGetTexEnvxv;
+	glGetTexParameteriv_client_proc_t glGetTexParameteriv;
+	glGetTexParameterxv_client_proc_t glGetTexParameterxv;
+	glHint_client_proc_t glHint;
+	glIsBuffer_client_proc_t glIsBuffer;
+	glIsEnabled_client_proc_t glIsEnabled;
+	glIsTexture_client_proc_t glIsTexture;
+	glLightModelx_client_proc_t glLightModelx;
+	glLightModelxv_client_proc_t glLightModelxv;
+	glLightx_client_proc_t glLightx;
+	glLightxv_client_proc_t glLightxv;
+	glLineWidthx_client_proc_t glLineWidthx;
+	glLoadIdentity_client_proc_t glLoadIdentity;
+	glLoadMatrixx_client_proc_t glLoadMatrixx;
+	glLogicOp_client_proc_t glLogicOp;
+	glMaterialx_client_proc_t glMaterialx;
+	glMaterialxv_client_proc_t glMaterialxv;
+	glMatrixMode_client_proc_t glMatrixMode;
+	glMultMatrixx_client_proc_t glMultMatrixx;
+	glMultiTexCoord4x_client_proc_t glMultiTexCoord4x;
+	glNormal3x_client_proc_t glNormal3x;
+	glNormalPointer_client_proc_t glNormalPointer;
+	glOrthox_client_proc_t glOrthox;
+	glPixelStorei_client_proc_t glPixelStorei;
+	glPointParameterx_client_proc_t glPointParameterx;
+	glPointParameterxv_client_proc_t glPointParameterxv;
+	glPointSizex_client_proc_t glPointSizex;
+	glPolygonOffsetx_client_proc_t glPolygonOffsetx;
+	glPopMatrix_client_proc_t glPopMatrix;
+	glPushMatrix_client_proc_t glPushMatrix;
+	glReadPixels_client_proc_t glReadPixels;
+	glRotatex_client_proc_t glRotatex;
+	glSampleCoverage_client_proc_t glSampleCoverage;
+	glSampleCoveragex_client_proc_t glSampleCoveragex;
+	glScalex_client_proc_t glScalex;
+	glScissor_client_proc_t glScissor;
+	glShadeModel_client_proc_t glShadeModel;
+	glStencilFunc_client_proc_t glStencilFunc;
+	glStencilMask_client_proc_t glStencilMask;
+	glStencilOp_client_proc_t glStencilOp;
+	glTexCoordPointer_client_proc_t glTexCoordPointer;
+	glTexEnvi_client_proc_t glTexEnvi;
+	glTexEnvx_client_proc_t glTexEnvx;
+	glTexEnviv_client_proc_t glTexEnviv;
+	glTexEnvxv_client_proc_t glTexEnvxv;
+	glTexImage2D_client_proc_t glTexImage2D;
+	glTexParameteri_client_proc_t glTexParameteri;
+	glTexParameterx_client_proc_t glTexParameterx;
+	glTexParameteriv_client_proc_t glTexParameteriv;
+	glTexParameterxv_client_proc_t glTexParameterxv;
+	glTexSubImage2D_client_proc_t glTexSubImage2D;
+	glTranslatex_client_proc_t glTranslatex;
+	glVertexPointer_client_proc_t glVertexPointer;
+	glViewport_client_proc_t glViewport;
+	glPointSizePointerOES_client_proc_t glPointSizePointerOES;
+	glVertexPointerOffset_client_proc_t glVertexPointerOffset;
+	glColorPointerOffset_client_proc_t glColorPointerOffset;
+	glNormalPointerOffset_client_proc_t glNormalPointerOffset;
+	glPointSizePointerOffset_client_proc_t glPointSizePointerOffset;
+	glTexCoordPointerOffset_client_proc_t glTexCoordPointerOffset;
+	glWeightPointerOffset_client_proc_t glWeightPointerOffset;
+	glMatrixIndexPointerOffset_client_proc_t glMatrixIndexPointerOffset;
+	glVertexPointerData_client_proc_t glVertexPointerData;
+	glColorPointerData_client_proc_t glColorPointerData;
+	glNormalPointerData_client_proc_t glNormalPointerData;
+	glTexCoordPointerData_client_proc_t glTexCoordPointerData;
+	glPointSizePointerData_client_proc_t glPointSizePointerData;
+	glWeightPointerData_client_proc_t glWeightPointerData;
+	glMatrixIndexPointerData_client_proc_t glMatrixIndexPointerData;
+	glDrawElementsOffset_client_proc_t glDrawElementsOffset;
+	glDrawElementsData_client_proc_t glDrawElementsData;
+	glGetCompressedTextureFormats_client_proc_t glGetCompressedTextureFormats;
+	glFinishRoundTrip_client_proc_t glFinishRoundTrip;
+	glBlendEquationSeparateOES_client_proc_t glBlendEquationSeparateOES;
+	glBlendFuncSeparateOES_client_proc_t glBlendFuncSeparateOES;
+	glBlendEquationOES_client_proc_t glBlendEquationOES;
+	glDrawTexsOES_client_proc_t glDrawTexsOES;
+	glDrawTexiOES_client_proc_t glDrawTexiOES;
+	glDrawTexxOES_client_proc_t glDrawTexxOES;
+	glDrawTexsvOES_client_proc_t glDrawTexsvOES;
+	glDrawTexivOES_client_proc_t glDrawTexivOES;
+	glDrawTexxvOES_client_proc_t glDrawTexxvOES;
+	glDrawTexfOES_client_proc_t glDrawTexfOES;
+	glDrawTexfvOES_client_proc_t glDrawTexfvOES;
+	glEGLImageTargetTexture2DOES_client_proc_t glEGLImageTargetTexture2DOES;
+	glEGLImageTargetRenderbufferStorageOES_client_proc_t glEGLImageTargetRenderbufferStorageOES;
+	glAlphaFuncxOES_client_proc_t glAlphaFuncxOES;
+	glClearColorxOES_client_proc_t glClearColorxOES;
+	glClearDepthxOES_client_proc_t glClearDepthxOES;
+	glClipPlanexOES_client_proc_t glClipPlanexOES;
+	glClipPlanexIMG_client_proc_t glClipPlanexIMG;
+	glColor4xOES_client_proc_t glColor4xOES;
+	glDepthRangexOES_client_proc_t glDepthRangexOES;
+	glFogxOES_client_proc_t glFogxOES;
+	glFogxvOES_client_proc_t glFogxvOES;
+	glFrustumxOES_client_proc_t glFrustumxOES;
+	glGetClipPlanexOES_client_proc_t glGetClipPlanexOES;
+	glGetClipPlanex_client_proc_t glGetClipPlanex;
+	glGetFixedvOES_client_proc_t glGetFixedvOES;
+	glGetLightxvOES_client_proc_t glGetLightxvOES;
+	glGetMaterialxvOES_client_proc_t glGetMaterialxvOES;
+	glGetTexEnvxvOES_client_proc_t glGetTexEnvxvOES;
+	glGetTexParameterxvOES_client_proc_t glGetTexParameterxvOES;
+	glLightModelxOES_client_proc_t glLightModelxOES;
+	glLightModelxvOES_client_proc_t glLightModelxvOES;
+	glLightxOES_client_proc_t glLightxOES;
+	glLightxvOES_client_proc_t glLightxvOES;
+	glLineWidthxOES_client_proc_t glLineWidthxOES;
+	glLoadMatrixxOES_client_proc_t glLoadMatrixxOES;
+	glMaterialxOES_client_proc_t glMaterialxOES;
+	glMaterialxvOES_client_proc_t glMaterialxvOES;
+	glMultMatrixxOES_client_proc_t glMultMatrixxOES;
+	glMultiTexCoord4xOES_client_proc_t glMultiTexCoord4xOES;
+	glNormal3xOES_client_proc_t glNormal3xOES;
+	glOrthoxOES_client_proc_t glOrthoxOES;
+	glPointParameterxOES_client_proc_t glPointParameterxOES;
+	glPointParameterxvOES_client_proc_t glPointParameterxvOES;
+	glPointSizexOES_client_proc_t glPointSizexOES;
+	glPolygonOffsetxOES_client_proc_t glPolygonOffsetxOES;
+	glRotatexOES_client_proc_t glRotatexOES;
+	glSampleCoveragexOES_client_proc_t glSampleCoveragexOES;
+	glScalexOES_client_proc_t glScalexOES;
+	glTexEnvxOES_client_proc_t glTexEnvxOES;
+	glTexEnvxvOES_client_proc_t glTexEnvxvOES;
+	glTexParameterxOES_client_proc_t glTexParameterxOES;
+	glTexParameterxvOES_client_proc_t glTexParameterxvOES;
+	glTranslatexOES_client_proc_t glTranslatexOES;
+	glIsRenderbufferOES_client_proc_t glIsRenderbufferOES;
+	glBindRenderbufferOES_client_proc_t glBindRenderbufferOES;
+	glDeleteRenderbuffersOES_client_proc_t glDeleteRenderbuffersOES;
+	glGenRenderbuffersOES_client_proc_t glGenRenderbuffersOES;
+	glRenderbufferStorageOES_client_proc_t glRenderbufferStorageOES;
+	glGetRenderbufferParameterivOES_client_proc_t glGetRenderbufferParameterivOES;
+	glIsFramebufferOES_client_proc_t glIsFramebufferOES;
+	glBindFramebufferOES_client_proc_t glBindFramebufferOES;
+	glDeleteFramebuffersOES_client_proc_t glDeleteFramebuffersOES;
+	glGenFramebuffersOES_client_proc_t glGenFramebuffersOES;
+	glCheckFramebufferStatusOES_client_proc_t glCheckFramebufferStatusOES;
+	glFramebufferRenderbufferOES_client_proc_t glFramebufferRenderbufferOES;
+	glFramebufferTexture2DOES_client_proc_t glFramebufferTexture2DOES;
+	glGetFramebufferAttachmentParameterivOES_client_proc_t glGetFramebufferAttachmentParameterivOES;
+	glGenerateMipmapOES_client_proc_t glGenerateMipmapOES;
+	glMapBufferOES_client_proc_t glMapBufferOES;
+	glUnmapBufferOES_client_proc_t glUnmapBufferOES;
+	glGetBufferPointervOES_client_proc_t glGetBufferPointervOES;
+	glCurrentPaletteMatrixOES_client_proc_t glCurrentPaletteMatrixOES;
+	glLoadPaletteFromModelViewMatrixOES_client_proc_t glLoadPaletteFromModelViewMatrixOES;
+	glMatrixIndexPointerOES_client_proc_t glMatrixIndexPointerOES;
+	glWeightPointerOES_client_proc_t glWeightPointerOES;
+	glQueryMatrixxOES_client_proc_t glQueryMatrixxOES;
+	glDepthRangefOES_client_proc_t glDepthRangefOES;
+	glFrustumfOES_client_proc_t glFrustumfOES;
+	glOrthofOES_client_proc_t glOrthofOES;
+	glClipPlanefOES_client_proc_t glClipPlanefOES;
+	glClipPlanefIMG_client_proc_t glClipPlanefIMG;
+	glGetClipPlanefOES_client_proc_t glGetClipPlanefOES;
+	glClearDepthfOES_client_proc_t glClearDepthfOES;
+	glTexGenfOES_client_proc_t glTexGenfOES;
+	glTexGenfvOES_client_proc_t glTexGenfvOES;
+	glTexGeniOES_client_proc_t glTexGeniOES;
+	glTexGenivOES_client_proc_t glTexGenivOES;
+	glTexGenxOES_client_proc_t glTexGenxOES;
+	glTexGenxvOES_client_proc_t glTexGenxvOES;
+	glGetTexGenfvOES_client_proc_t glGetTexGenfvOES;
+	glGetTexGenivOES_client_proc_t glGetTexGenivOES;
+	glGetTexGenxvOES_client_proc_t glGetTexGenxvOES;
+	glBindVertexArrayOES_client_proc_t glBindVertexArrayOES;
+	glDeleteVertexArraysOES_client_proc_t glDeleteVertexArraysOES;
+	glGenVertexArraysOES_client_proc_t glGenVertexArraysOES;
+	glIsVertexArrayOES_client_proc_t glIsVertexArrayOES;
+	glDiscardFramebufferEXT_client_proc_t glDiscardFramebufferEXT;
+	glMultiDrawArraysEXT_client_proc_t glMultiDrawArraysEXT;
+	glMultiDrawElementsEXT_client_proc_t glMultiDrawElementsEXT;
+	glMultiDrawArraysSUN_client_proc_t glMultiDrawArraysSUN;
+	glMultiDrawElementsSUN_client_proc_t glMultiDrawElementsSUN;
+	glRenderbufferStorageMultisampleIMG_client_proc_t glRenderbufferStorageMultisampleIMG;
+	glFramebufferTexture2DMultisampleIMG_client_proc_t glFramebufferTexture2DMultisampleIMG;
+	glDeleteFencesNV_client_proc_t glDeleteFencesNV;
+	glGenFencesNV_client_proc_t glGenFencesNV;
+	glIsFenceNV_client_proc_t glIsFenceNV;
+	glTestFenceNV_client_proc_t glTestFenceNV;
+	glGetFenceivNV_client_proc_t glGetFenceivNV;
+	glFinishFenceNV_client_proc_t glFinishFenceNV;
+	glSetFenceNV_client_proc_t glSetFenceNV;
+	glGetDriverControlsQCOM_client_proc_t glGetDriverControlsQCOM;
+	glGetDriverControlStringQCOM_client_proc_t glGetDriverControlStringQCOM;
+	glEnableDriverControlQCOM_client_proc_t glEnableDriverControlQCOM;
+	glDisableDriverControlQCOM_client_proc_t glDisableDriverControlQCOM;
+	glExtGetTexturesQCOM_client_proc_t glExtGetTexturesQCOM;
+	glExtGetBuffersQCOM_client_proc_t glExtGetBuffersQCOM;
+	glExtGetRenderbuffersQCOM_client_proc_t glExtGetRenderbuffersQCOM;
+	glExtGetFramebuffersQCOM_client_proc_t glExtGetFramebuffersQCOM;
+	glExtGetTexLevelParameterivQCOM_client_proc_t glExtGetTexLevelParameterivQCOM;
+	glExtTexObjectStateOverrideiQCOM_client_proc_t glExtTexObjectStateOverrideiQCOM;
+	glExtGetTexSubImageQCOM_client_proc_t glExtGetTexSubImageQCOM;
+	glExtGetBufferPointervQCOM_client_proc_t glExtGetBufferPointervQCOM;
+	glExtGetShadersQCOM_client_proc_t glExtGetShadersQCOM;
+	glExtGetProgramsQCOM_client_proc_t glExtGetProgramsQCOM;
+	glExtIsProgramBinaryQCOM_client_proc_t glExtIsProgramBinaryQCOM;
+	glExtGetProgramBinarySourceQCOM_client_proc_t glExtGetProgramBinarySourceQCOM;
+	glStartTilingQCOM_client_proc_t glStartTilingQCOM;
+	glEndTilingQCOM_client_proc_t glEndTilingQCOM;
+	glGetGraphicsResetStatusEXT_client_proc_t glGetGraphicsResetStatusEXT;
+	glReadnPixelsEXT_client_proc_t glReadnPixelsEXT;
+	virtual ~gl_client_context_t() {}
+
+	typedef gl_client_context_t *CONTEXT_ACCESSOR_TYPE(void);
+	static void setContextAccessor(CONTEXT_ACCESSOR_TYPE *f);
+	int initDispatchByName( void *(*getProc)(const char *name, void *userData), void *userData);
+	virtual void setError(unsigned int  error){ (void)error; }
+	virtual unsigned int getError(){ return 0; }
+};
+
+#endif
diff --git a/system/GLESv1_enc/gl_client_proc.h b/system/GLESv1_enc/gl_client_proc.h
new file mode 100644
index 0000000..92eba98
--- /dev/null
+++ b/system/GLESv1_enc/gl_client_proc.h
@@ -0,0 +1,310 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+#ifndef __gl_client_proc_t_h
+#define __gl_client_proc_t_h
+
+
+
+#include "gl_types.h"
+#ifdef _MSC_VER
+#include <stdint.h>
+#endif
+#ifndef gl_APIENTRY
+#define gl_APIENTRY 
+#endif
+typedef void (gl_APIENTRY *glAlphaFunc_client_proc_t) (void * ctx, GLenum, GLclampf);
+typedef void (gl_APIENTRY *glClearColor_client_proc_t) (void * ctx, GLclampf, GLclampf, GLclampf, GLclampf);
+typedef void (gl_APIENTRY *glClearDepthf_client_proc_t) (void * ctx, GLclampf);
+typedef void (gl_APIENTRY *glClipPlanef_client_proc_t) (void * ctx, GLenum, const GLfloat*);
+typedef void (gl_APIENTRY *glColor4f_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat, GLfloat);
+typedef void (gl_APIENTRY *glDepthRangef_client_proc_t) (void * ctx, GLclampf, GLclampf);
+typedef void (gl_APIENTRY *glFogf_client_proc_t) (void * ctx, GLenum, GLfloat);
+typedef void (gl_APIENTRY *glFogfv_client_proc_t) (void * ctx, GLenum, const GLfloat*);
+typedef void (gl_APIENTRY *glFrustumf_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+typedef void (gl_APIENTRY *glGetClipPlanef_client_proc_t) (void * ctx, GLenum, GLfloat*);
+typedef void (gl_APIENTRY *glGetFloatv_client_proc_t) (void * ctx, GLenum, GLfloat*);
+typedef void (gl_APIENTRY *glGetLightfv_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat*);
+typedef void (gl_APIENTRY *glGetMaterialfv_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat*);
+typedef void (gl_APIENTRY *glGetTexEnvfv_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat*);
+typedef void (gl_APIENTRY *glGetTexParameterfv_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat*);
+typedef void (gl_APIENTRY *glLightModelf_client_proc_t) (void * ctx, GLenum, GLfloat);
+typedef void (gl_APIENTRY *glLightModelfv_client_proc_t) (void * ctx, GLenum, const GLfloat*);
+typedef void (gl_APIENTRY *glLightf_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat);
+typedef void (gl_APIENTRY *glLightfv_client_proc_t) (void * ctx, GLenum, GLenum, const GLfloat*);
+typedef void (gl_APIENTRY *glLineWidth_client_proc_t) (void * ctx, GLfloat);
+typedef void (gl_APIENTRY *glLoadMatrixf_client_proc_t) (void * ctx, const GLfloat*);
+typedef void (gl_APIENTRY *glMaterialf_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat);
+typedef void (gl_APIENTRY *glMaterialfv_client_proc_t) (void * ctx, GLenum, GLenum, const GLfloat*);
+typedef void (gl_APIENTRY *glMultMatrixf_client_proc_t) (void * ctx, const GLfloat*);
+typedef void (gl_APIENTRY *glMultiTexCoord4f_client_proc_t) (void * ctx, GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
+typedef void (gl_APIENTRY *glNormal3f_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat);
+typedef void (gl_APIENTRY *glOrthof_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+typedef void (gl_APIENTRY *glPointParameterf_client_proc_t) (void * ctx, GLenum, GLfloat);
+typedef void (gl_APIENTRY *glPointParameterfv_client_proc_t) (void * ctx, GLenum, const GLfloat*);
+typedef void (gl_APIENTRY *glPointSize_client_proc_t) (void * ctx, GLfloat);
+typedef void (gl_APIENTRY *glPolygonOffset_client_proc_t) (void * ctx, GLfloat, GLfloat);
+typedef void (gl_APIENTRY *glRotatef_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat, GLfloat);
+typedef void (gl_APIENTRY *glScalef_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat);
+typedef void (gl_APIENTRY *glTexEnvf_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat);
+typedef void (gl_APIENTRY *glTexEnvfv_client_proc_t) (void * ctx, GLenum, GLenum, const GLfloat*);
+typedef void (gl_APIENTRY *glTexParameterf_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat);
+typedef void (gl_APIENTRY *glTexParameterfv_client_proc_t) (void * ctx, GLenum, GLenum, const GLfloat*);
+typedef void (gl_APIENTRY *glTranslatef_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat);
+typedef void (gl_APIENTRY *glActiveTexture_client_proc_t) (void * ctx, GLenum);
+typedef void (gl_APIENTRY *glAlphaFuncx_client_proc_t) (void * ctx, GLenum, GLclampx);
+typedef void (gl_APIENTRY *glBindBuffer_client_proc_t) (void * ctx, GLenum, GLuint);
+typedef void (gl_APIENTRY *glBindTexture_client_proc_t) (void * ctx, GLenum, GLuint);
+typedef void (gl_APIENTRY *glBlendFunc_client_proc_t) (void * ctx, GLenum, GLenum);
+typedef void (gl_APIENTRY *glBufferData_client_proc_t) (void * ctx, GLenum, GLsizeiptr, const GLvoid*, GLenum);
+typedef void (gl_APIENTRY *glBufferSubData_client_proc_t) (void * ctx, GLenum, GLintptr, GLsizeiptr, const GLvoid*);
+typedef void (gl_APIENTRY *glClear_client_proc_t) (void * ctx, GLbitfield);
+typedef void (gl_APIENTRY *glClearColorx_client_proc_t) (void * ctx, GLclampx, GLclampx, GLclampx, GLclampx);
+typedef void (gl_APIENTRY *glClearDepthx_client_proc_t) (void * ctx, GLclampx);
+typedef void (gl_APIENTRY *glClearStencil_client_proc_t) (void * ctx, GLint);
+typedef void (gl_APIENTRY *glClientActiveTexture_client_proc_t) (void * ctx, GLenum);
+typedef void (gl_APIENTRY *glColor4ub_client_proc_t) (void * ctx, GLubyte, GLubyte, GLubyte, GLubyte);
+typedef void (gl_APIENTRY *glColor4x_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed, GLfixed);
+typedef void (gl_APIENTRY *glColorMask_client_proc_t) (void * ctx, GLboolean, GLboolean, GLboolean, GLboolean);
+typedef void (gl_APIENTRY *glColorPointer_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, const GLvoid*);
+typedef void (gl_APIENTRY *glCompressedTexImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*);
+typedef void (gl_APIENTRY *glCompressedTexSubImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*);
+typedef void (gl_APIENTRY *glCopyTexImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint);
+typedef void (gl_APIENTRY *glCopyTexSubImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+typedef void (gl_APIENTRY *glCullFace_client_proc_t) (void * ctx, GLenum);
+typedef void (gl_APIENTRY *glDeleteBuffers_client_proc_t) (void * ctx, GLsizei, const GLuint*);
+typedef void (gl_APIENTRY *glDeleteTextures_client_proc_t) (void * ctx, GLsizei, const GLuint*);
+typedef void (gl_APIENTRY *glDepthFunc_client_proc_t) (void * ctx, GLenum);
+typedef void (gl_APIENTRY *glDepthMask_client_proc_t) (void * ctx, GLboolean);
+typedef void (gl_APIENTRY *glDepthRangex_client_proc_t) (void * ctx, GLclampx, GLclampx);
+typedef void (gl_APIENTRY *glDisable_client_proc_t) (void * ctx, GLenum);
+typedef void (gl_APIENTRY *glDisableClientState_client_proc_t) (void * ctx, GLenum);
+typedef void (gl_APIENTRY *glDrawArrays_client_proc_t) (void * ctx, GLenum, GLint, GLsizei);
+typedef void (gl_APIENTRY *glDrawElements_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, const GLvoid*);
+typedef void (gl_APIENTRY *glEnable_client_proc_t) (void * ctx, GLenum);
+typedef void (gl_APIENTRY *glEnableClientState_client_proc_t) (void * ctx, GLenum);
+typedef void (gl_APIENTRY *glFinish_client_proc_t) (void * ctx);
+typedef void (gl_APIENTRY *glFlush_client_proc_t) (void * ctx);
+typedef void (gl_APIENTRY *glFogx_client_proc_t) (void * ctx, GLenum, GLfixed);
+typedef void (gl_APIENTRY *glFogxv_client_proc_t) (void * ctx, GLenum, const GLfixed*);
+typedef void (gl_APIENTRY *glFrontFace_client_proc_t) (void * ctx, GLenum);
+typedef void (gl_APIENTRY *glFrustumx_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed);
+typedef void (gl_APIENTRY *glGetBooleanv_client_proc_t) (void * ctx, GLenum, GLboolean*);
+typedef void (gl_APIENTRY *glGetBufferParameteriv_client_proc_t) (void * ctx, GLenum, GLenum, GLint*);
+typedef void (gl_APIENTRY *glClipPlanex_client_proc_t) (void * ctx, GLenum, const GLfixed*);
+typedef void (gl_APIENTRY *glGenBuffers_client_proc_t) (void * ctx, GLsizei, GLuint*);
+typedef void (gl_APIENTRY *glGenTextures_client_proc_t) (void * ctx, GLsizei, GLuint*);
+typedef GLenum (gl_APIENTRY *glGetError_client_proc_t) (void * ctx);
+typedef void (gl_APIENTRY *glGetFixedv_client_proc_t) (void * ctx, GLenum, GLfixed*);
+typedef void (gl_APIENTRY *glGetIntegerv_client_proc_t) (void * ctx, GLenum, GLint*);
+typedef void (gl_APIENTRY *glGetLightxv_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed*);
+typedef void (gl_APIENTRY *glGetMaterialxv_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed*);
+typedef void (gl_APIENTRY *glGetPointerv_client_proc_t) (void * ctx, GLenum, GLvoid**);
+typedef const GLubyte* (gl_APIENTRY *glGetString_client_proc_t) (void * ctx, GLenum);
+typedef void (gl_APIENTRY *glGetTexEnviv_client_proc_t) (void * ctx, GLenum, GLenum, GLint*);
+typedef void (gl_APIENTRY *glGetTexEnvxv_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed*);
+typedef void (gl_APIENTRY *glGetTexParameteriv_client_proc_t) (void * ctx, GLenum, GLenum, GLint*);
+typedef void (gl_APIENTRY *glGetTexParameterxv_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed*);
+typedef void (gl_APIENTRY *glHint_client_proc_t) (void * ctx, GLenum, GLenum);
+typedef GLboolean (gl_APIENTRY *glIsBuffer_client_proc_t) (void * ctx, GLuint);
+typedef GLboolean (gl_APIENTRY *glIsEnabled_client_proc_t) (void * ctx, GLenum);
+typedef GLboolean (gl_APIENTRY *glIsTexture_client_proc_t) (void * ctx, GLuint);
+typedef void (gl_APIENTRY *glLightModelx_client_proc_t) (void * ctx, GLenum, GLfixed);
+typedef void (gl_APIENTRY *glLightModelxv_client_proc_t) (void * ctx, GLenum, const GLfixed*);
+typedef void (gl_APIENTRY *glLightx_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed);
+typedef void (gl_APIENTRY *glLightxv_client_proc_t) (void * ctx, GLenum, GLenum, const GLfixed*);
+typedef void (gl_APIENTRY *glLineWidthx_client_proc_t) (void * ctx, GLfixed);
+typedef void (gl_APIENTRY *glLoadIdentity_client_proc_t) (void * ctx);
+typedef void (gl_APIENTRY *glLoadMatrixx_client_proc_t) (void * ctx, const GLfixed*);
+typedef void (gl_APIENTRY *glLogicOp_client_proc_t) (void * ctx, GLenum);
+typedef void (gl_APIENTRY *glMaterialx_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed);
+typedef void (gl_APIENTRY *glMaterialxv_client_proc_t) (void * ctx, GLenum, GLenum, const GLfixed*);
+typedef void (gl_APIENTRY *glMatrixMode_client_proc_t) (void * ctx, GLenum);
+typedef void (gl_APIENTRY *glMultMatrixx_client_proc_t) (void * ctx, const GLfixed*);
+typedef void (gl_APIENTRY *glMultiTexCoord4x_client_proc_t) (void * ctx, GLenum, GLfixed, GLfixed, GLfixed, GLfixed);
+typedef void (gl_APIENTRY *glNormal3x_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed);
+typedef void (gl_APIENTRY *glNormalPointer_client_proc_t) (void * ctx, GLenum, GLsizei, const GLvoid*);
+typedef void (gl_APIENTRY *glOrthox_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed);
+typedef void (gl_APIENTRY *glPixelStorei_client_proc_t) (void * ctx, GLenum, GLint);
+typedef void (gl_APIENTRY *glPointParameterx_client_proc_t) (void * ctx, GLenum, GLfixed);
+typedef void (gl_APIENTRY *glPointParameterxv_client_proc_t) (void * ctx, GLenum, const GLfixed*);
+typedef void (gl_APIENTRY *glPointSizex_client_proc_t) (void * ctx, GLfixed);
+typedef void (gl_APIENTRY *glPolygonOffsetx_client_proc_t) (void * ctx, GLfixed, GLfixed);
+typedef void (gl_APIENTRY *glPopMatrix_client_proc_t) (void * ctx);
+typedef void (gl_APIENTRY *glPushMatrix_client_proc_t) (void * ctx);
+typedef void (gl_APIENTRY *glReadPixels_client_proc_t) (void * ctx, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid*);
+typedef void (gl_APIENTRY *glRotatex_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed, GLfixed);
+typedef void (gl_APIENTRY *glSampleCoverage_client_proc_t) (void * ctx, GLclampf, GLboolean);
+typedef void (gl_APIENTRY *glSampleCoveragex_client_proc_t) (void * ctx, GLclampx, GLboolean);
+typedef void (gl_APIENTRY *glScalex_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed);
+typedef void (gl_APIENTRY *glScissor_client_proc_t) (void * ctx, GLint, GLint, GLsizei, GLsizei);
+typedef void (gl_APIENTRY *glShadeModel_client_proc_t) (void * ctx, GLenum);
+typedef void (gl_APIENTRY *glStencilFunc_client_proc_t) (void * ctx, GLenum, GLint, GLuint);
+typedef void (gl_APIENTRY *glStencilMask_client_proc_t) (void * ctx, GLuint);
+typedef void (gl_APIENTRY *glStencilOp_client_proc_t) (void * ctx, GLenum, GLenum, GLenum);
+typedef void (gl_APIENTRY *glTexCoordPointer_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, const GLvoid*);
+typedef void (gl_APIENTRY *glTexEnvi_client_proc_t) (void * ctx, GLenum, GLenum, GLint);
+typedef void (gl_APIENTRY *glTexEnvx_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed);
+typedef void (gl_APIENTRY *glTexEnviv_client_proc_t) (void * ctx, GLenum, GLenum, const GLint*);
+typedef void (gl_APIENTRY *glTexEnvxv_client_proc_t) (void * ctx, GLenum, GLenum, const GLfixed*);
+typedef void (gl_APIENTRY *glTexImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid*);
+typedef void (gl_APIENTRY *glTexParameteri_client_proc_t) (void * ctx, GLenum, GLenum, GLint);
+typedef void (gl_APIENTRY *glTexParameterx_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed);
+typedef void (gl_APIENTRY *glTexParameteriv_client_proc_t) (void * ctx, GLenum, GLenum, const GLint*);
+typedef void (gl_APIENTRY *glTexParameterxv_client_proc_t) (void * ctx, GLenum, GLenum, const GLfixed*);
+typedef void (gl_APIENTRY *glTexSubImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid*);
+typedef void (gl_APIENTRY *glTranslatex_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed);
+typedef void (gl_APIENTRY *glVertexPointer_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, const GLvoid*);
+typedef void (gl_APIENTRY *glViewport_client_proc_t) (void * ctx, GLint, GLint, GLsizei, GLsizei);
+typedef void (gl_APIENTRY *glPointSizePointerOES_client_proc_t) (void * ctx, GLenum, GLsizei, const GLvoid*);
+typedef void (gl_APIENTRY *glVertexPointerOffset_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, GLuint);
+typedef void (gl_APIENTRY *glColorPointerOffset_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, GLuint);
+typedef void (gl_APIENTRY *glNormalPointerOffset_client_proc_t) (void * ctx, GLenum, GLsizei, GLuint);
+typedef void (gl_APIENTRY *glPointSizePointerOffset_client_proc_t) (void * ctx, GLenum, GLsizei, GLuint);
+typedef void (gl_APIENTRY *glTexCoordPointerOffset_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, GLuint);
+typedef void (gl_APIENTRY *glWeightPointerOffset_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, GLuint);
+typedef void (gl_APIENTRY *glMatrixIndexPointerOffset_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, GLuint);
+typedef void (gl_APIENTRY *glVertexPointerData_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, void*, GLuint);
+typedef void (gl_APIENTRY *glColorPointerData_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, void*, GLuint);
+typedef void (gl_APIENTRY *glNormalPointerData_client_proc_t) (void * ctx, GLenum, GLsizei, void*, GLuint);
+typedef void (gl_APIENTRY *glTexCoordPointerData_client_proc_t) (void * ctx, GLint, GLint, GLenum, GLsizei, void*, GLuint);
+typedef void (gl_APIENTRY *glPointSizePointerData_client_proc_t) (void * ctx, GLenum, GLsizei, void*, GLuint);
+typedef void (gl_APIENTRY *glWeightPointerData_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, void*, GLuint);
+typedef void (gl_APIENTRY *glMatrixIndexPointerData_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, void*, GLuint);
+typedef void (gl_APIENTRY *glDrawElementsOffset_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, GLuint);
+typedef void (gl_APIENTRY *glDrawElementsData_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, void*, GLuint);
+typedef void (gl_APIENTRY *glGetCompressedTextureFormats_client_proc_t) (void * ctx, int, GLint*);
+typedef int (gl_APIENTRY *glFinishRoundTrip_client_proc_t) (void * ctx);
+typedef void (gl_APIENTRY *glBlendEquationSeparateOES_client_proc_t) (void * ctx, GLenum, GLenum);
+typedef void (gl_APIENTRY *glBlendFuncSeparateOES_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLenum);
+typedef void (gl_APIENTRY *glBlendEquationOES_client_proc_t) (void * ctx, GLenum);
+typedef void (gl_APIENTRY *glDrawTexsOES_client_proc_t) (void * ctx, GLshort, GLshort, GLshort, GLshort, GLshort);
+typedef void (gl_APIENTRY *glDrawTexiOES_client_proc_t) (void * ctx, GLint, GLint, GLint, GLint, GLint);
+typedef void (gl_APIENTRY *glDrawTexxOES_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed);
+typedef void (gl_APIENTRY *glDrawTexsvOES_client_proc_t) (void * ctx, const GLshort*);
+typedef void (gl_APIENTRY *glDrawTexivOES_client_proc_t) (void * ctx, const GLint*);
+typedef void (gl_APIENTRY *glDrawTexxvOES_client_proc_t) (void * ctx, const GLfixed*);
+typedef void (gl_APIENTRY *glDrawTexfOES_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+typedef void (gl_APIENTRY *glDrawTexfvOES_client_proc_t) (void * ctx, const GLfloat*);
+typedef void (gl_APIENTRY *glEGLImageTargetTexture2DOES_client_proc_t) (void * ctx, GLenum, GLeglImageOES);
+typedef void (gl_APIENTRY *glEGLImageTargetRenderbufferStorageOES_client_proc_t) (void * ctx, GLenum, GLeglImageOES);
+typedef void (gl_APIENTRY *glAlphaFuncxOES_client_proc_t) (void * ctx, GLenum, GLclampx);
+typedef void (gl_APIENTRY *glClearColorxOES_client_proc_t) (void * ctx, GLclampx, GLclampx, GLclampx, GLclampx);
+typedef void (gl_APIENTRY *glClearDepthxOES_client_proc_t) (void * ctx, GLclampx);
+typedef void (gl_APIENTRY *glClipPlanexOES_client_proc_t) (void * ctx, GLenum, const GLfixed*);
+typedef void (gl_APIENTRY *glClipPlanexIMG_client_proc_t) (void * ctx, GLenum, const GLfixed*);
+typedef void (gl_APIENTRY *glColor4xOES_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed, GLfixed);
+typedef void (gl_APIENTRY *glDepthRangexOES_client_proc_t) (void * ctx, GLclampx, GLclampx);
+typedef void (gl_APIENTRY *glFogxOES_client_proc_t) (void * ctx, GLenum, GLfixed);
+typedef void (gl_APIENTRY *glFogxvOES_client_proc_t) (void * ctx, GLenum, const GLfixed*);
+typedef void (gl_APIENTRY *glFrustumxOES_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed);
+typedef void (gl_APIENTRY *glGetClipPlanexOES_client_proc_t) (void * ctx, GLenum, GLfixed*);
+typedef void (gl_APIENTRY *glGetClipPlanex_client_proc_t) (void * ctx, GLenum, GLfixed*);
+typedef void (gl_APIENTRY *glGetFixedvOES_client_proc_t) (void * ctx, GLenum, GLfixed*);
+typedef void (gl_APIENTRY *glGetLightxvOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed*);
+typedef void (gl_APIENTRY *glGetMaterialxvOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed*);
+typedef void (gl_APIENTRY *glGetTexEnvxvOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed*);
+typedef void (gl_APIENTRY *glGetTexParameterxvOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed*);
+typedef void (gl_APIENTRY *glLightModelxOES_client_proc_t) (void * ctx, GLenum, GLfixed);
+typedef void (gl_APIENTRY *glLightModelxvOES_client_proc_t) (void * ctx, GLenum, const GLfixed*);
+typedef void (gl_APIENTRY *glLightxOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed);
+typedef void (gl_APIENTRY *glLightxvOES_client_proc_t) (void * ctx, GLenum, GLenum, const GLfixed*);
+typedef void (gl_APIENTRY *glLineWidthxOES_client_proc_t) (void * ctx, GLfixed);
+typedef void (gl_APIENTRY *glLoadMatrixxOES_client_proc_t) (void * ctx, const GLfixed*);
+typedef void (gl_APIENTRY *glMaterialxOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed);
+typedef void (gl_APIENTRY *glMaterialxvOES_client_proc_t) (void * ctx, GLenum, GLenum, const GLfixed*);
+typedef void (gl_APIENTRY *glMultMatrixxOES_client_proc_t) (void * ctx, const GLfixed*);
+typedef void (gl_APIENTRY *glMultiTexCoord4xOES_client_proc_t) (void * ctx, GLenum, GLfixed, GLfixed, GLfixed, GLfixed);
+typedef void (gl_APIENTRY *glNormal3xOES_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed);
+typedef void (gl_APIENTRY *glOrthoxOES_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed);
+typedef void (gl_APIENTRY *glPointParameterxOES_client_proc_t) (void * ctx, GLenum, GLfixed);
+typedef void (gl_APIENTRY *glPointParameterxvOES_client_proc_t) (void * ctx, GLenum, const GLfixed*);
+typedef void (gl_APIENTRY *glPointSizexOES_client_proc_t) (void * ctx, GLfixed);
+typedef void (gl_APIENTRY *glPolygonOffsetxOES_client_proc_t) (void * ctx, GLfixed, GLfixed);
+typedef void (gl_APIENTRY *glRotatexOES_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed, GLfixed);
+typedef void (gl_APIENTRY *glSampleCoveragexOES_client_proc_t) (void * ctx, GLclampx, GLboolean);
+typedef void (gl_APIENTRY *glScalexOES_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed);
+typedef void (gl_APIENTRY *glTexEnvxOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed);
+typedef void (gl_APIENTRY *glTexEnvxvOES_client_proc_t) (void * ctx, GLenum, GLenum, const GLfixed*);
+typedef void (gl_APIENTRY *glTexParameterxOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed);
+typedef void (gl_APIENTRY *glTexParameterxvOES_client_proc_t) (void * ctx, GLenum, GLenum, const GLfixed*);
+typedef void (gl_APIENTRY *glTranslatexOES_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed);
+typedef GLboolean (gl_APIENTRY *glIsRenderbufferOES_client_proc_t) (void * ctx, GLuint);
+typedef void (gl_APIENTRY *glBindRenderbufferOES_client_proc_t) (void * ctx, GLenum, GLuint);
+typedef void (gl_APIENTRY *glDeleteRenderbuffersOES_client_proc_t) (void * ctx, GLsizei, const GLuint*);
+typedef void (gl_APIENTRY *glGenRenderbuffersOES_client_proc_t) (void * ctx, GLsizei, GLuint*);
+typedef void (gl_APIENTRY *glRenderbufferStorageOES_client_proc_t) (void * ctx, GLenum, GLenum, GLsizei, GLsizei);
+typedef void (gl_APIENTRY *glGetRenderbufferParameterivOES_client_proc_t) (void * ctx, GLenum, GLenum, GLint*);
+typedef GLboolean (gl_APIENTRY *glIsFramebufferOES_client_proc_t) (void * ctx, GLuint);
+typedef void (gl_APIENTRY *glBindFramebufferOES_client_proc_t) (void * ctx, GLenum, GLuint);
+typedef void (gl_APIENTRY *glDeleteFramebuffersOES_client_proc_t) (void * ctx, GLsizei, const GLuint*);
+typedef void (gl_APIENTRY *glGenFramebuffersOES_client_proc_t) (void * ctx, GLsizei, GLuint*);
+typedef GLenum (gl_APIENTRY *glCheckFramebufferStatusOES_client_proc_t) (void * ctx, GLenum);
+typedef void (gl_APIENTRY *glFramebufferRenderbufferOES_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLuint);
+typedef void (gl_APIENTRY *glFramebufferTexture2DOES_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLuint, GLint);
+typedef void (gl_APIENTRY *glGetFramebufferAttachmentParameterivOES_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLint*);
+typedef void (gl_APIENTRY *glGenerateMipmapOES_client_proc_t) (void * ctx, GLenum);
+typedef void* (gl_APIENTRY *glMapBufferOES_client_proc_t) (void * ctx, GLenum, GLenum);
+typedef GLboolean (gl_APIENTRY *glUnmapBufferOES_client_proc_t) (void * ctx, GLenum);
+typedef void (gl_APIENTRY *glGetBufferPointervOES_client_proc_t) (void * ctx, GLenum, GLenum, GLvoid**);
+typedef void (gl_APIENTRY *glCurrentPaletteMatrixOES_client_proc_t) (void * ctx, GLuint);
+typedef void (gl_APIENTRY *glLoadPaletteFromModelViewMatrixOES_client_proc_t) (void * ctx);
+typedef void (gl_APIENTRY *glMatrixIndexPointerOES_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, const GLvoid*);
+typedef void (gl_APIENTRY *glWeightPointerOES_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, const GLvoid*);
+typedef GLbitfield (gl_APIENTRY *glQueryMatrixxOES_client_proc_t) (void * ctx, GLfixed*, GLint*);
+typedef void (gl_APIENTRY *glDepthRangefOES_client_proc_t) (void * ctx, GLclampf, GLclampf);
+typedef void (gl_APIENTRY *glFrustumfOES_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+typedef void (gl_APIENTRY *glOrthofOES_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+typedef void (gl_APIENTRY *glClipPlanefOES_client_proc_t) (void * ctx, GLenum, const GLfloat*);
+typedef void (gl_APIENTRY *glClipPlanefIMG_client_proc_t) (void * ctx, GLenum, const GLfloat*);
+typedef void (gl_APIENTRY *glGetClipPlanefOES_client_proc_t) (void * ctx, GLenum, GLfloat*);
+typedef void (gl_APIENTRY *glClearDepthfOES_client_proc_t) (void * ctx, GLclampf);
+typedef void (gl_APIENTRY *glTexGenfOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat);
+typedef void (gl_APIENTRY *glTexGenfvOES_client_proc_t) (void * ctx, GLenum, GLenum, const GLfloat*);
+typedef void (gl_APIENTRY *glTexGeniOES_client_proc_t) (void * ctx, GLenum, GLenum, GLint);
+typedef void (gl_APIENTRY *glTexGenivOES_client_proc_t) (void * ctx, GLenum, GLenum, const GLint*);
+typedef void (gl_APIENTRY *glTexGenxOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed);
+typedef void (gl_APIENTRY *glTexGenxvOES_client_proc_t) (void * ctx, GLenum, GLenum, const GLfixed*);
+typedef void (gl_APIENTRY *glGetTexGenfvOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat*);
+typedef void (gl_APIENTRY *glGetTexGenivOES_client_proc_t) (void * ctx, GLenum, GLenum, GLint*);
+typedef void (gl_APIENTRY *glGetTexGenxvOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed*);
+typedef void (gl_APIENTRY *glBindVertexArrayOES_client_proc_t) (void * ctx, GLuint);
+typedef void (gl_APIENTRY *glDeleteVertexArraysOES_client_proc_t) (void * ctx, GLsizei, const GLuint*);
+typedef void (gl_APIENTRY *glGenVertexArraysOES_client_proc_t) (void * ctx, GLsizei, GLuint*);
+typedef GLboolean (gl_APIENTRY *glIsVertexArrayOES_client_proc_t) (void * ctx, GLuint);
+typedef void (gl_APIENTRY *glDiscardFramebufferEXT_client_proc_t) (void * ctx, GLenum, GLsizei, const GLenum*);
+typedef void (gl_APIENTRY *glMultiDrawArraysEXT_client_proc_t) (void * ctx, GLenum, const GLint*, const GLsizei*, GLsizei);
+typedef void (gl_APIENTRY *glMultiDrawElementsEXT_client_proc_t) (void * ctx, GLenum, const GLsizei*, GLenum, const GLvoid* const*, GLsizei);
+typedef void (gl_APIENTRY *glMultiDrawArraysSUN_client_proc_t) (void * ctx, GLenum, GLint*, GLsizei*, GLsizei);
+typedef void (gl_APIENTRY *glMultiDrawElementsSUN_client_proc_t) (void * ctx, GLenum, const GLsizei*, GLenum, const GLvoid**, GLsizei);
+typedef void (gl_APIENTRY *glRenderbufferStorageMultisampleIMG_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, GLsizei, GLsizei);
+typedef void (gl_APIENTRY *glFramebufferTexture2DMultisampleIMG_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLuint, GLint, GLsizei);
+typedef void (gl_APIENTRY *glDeleteFencesNV_client_proc_t) (void * ctx, GLsizei, const GLuint*);
+typedef void (gl_APIENTRY *glGenFencesNV_client_proc_t) (void * ctx, GLsizei, GLuint*);
+typedef GLboolean (gl_APIENTRY *glIsFenceNV_client_proc_t) (void * ctx, GLuint);
+typedef GLboolean (gl_APIENTRY *glTestFenceNV_client_proc_t) (void * ctx, GLuint);
+typedef void (gl_APIENTRY *glGetFenceivNV_client_proc_t) (void * ctx, GLuint, GLenum, GLint*);
+typedef void (gl_APIENTRY *glFinishFenceNV_client_proc_t) (void * ctx, GLuint);
+typedef void (gl_APIENTRY *glSetFenceNV_client_proc_t) (void * ctx, GLuint, GLenum);
+typedef void (gl_APIENTRY *glGetDriverControlsQCOM_client_proc_t) (void * ctx, GLint*, GLsizei, GLuint*);
+typedef void (gl_APIENTRY *glGetDriverControlStringQCOM_client_proc_t) (void * ctx, GLuint, GLsizei, GLsizei*, GLchar*);
+typedef void (gl_APIENTRY *glEnableDriverControlQCOM_client_proc_t) (void * ctx, GLuint);
+typedef void (gl_APIENTRY *glDisableDriverControlQCOM_client_proc_t) (void * ctx, GLuint);
+typedef void (gl_APIENTRY *glExtGetTexturesQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
+typedef void (gl_APIENTRY *glExtGetBuffersQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
+typedef void (gl_APIENTRY *glExtGetRenderbuffersQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
+typedef void (gl_APIENTRY *glExtGetFramebuffersQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
+typedef void (gl_APIENTRY *glExtGetTexLevelParameterivQCOM_client_proc_t) (void * ctx, GLuint, GLenum, GLint, GLenum, GLint*);
+typedef void (gl_APIENTRY *glExtTexObjectStateOverrideiQCOM_client_proc_t) (void * ctx, GLenum, GLenum, GLint);
+typedef void (gl_APIENTRY *glExtGetTexSubImageQCOM_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, GLvoid*);
+typedef void (gl_APIENTRY *glExtGetBufferPointervQCOM_client_proc_t) (void * ctx, GLenum, GLvoid**);
+typedef void (gl_APIENTRY *glExtGetShadersQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
+typedef void (gl_APIENTRY *glExtGetProgramsQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
+typedef GLboolean (gl_APIENTRY *glExtIsProgramBinaryQCOM_client_proc_t) (void * ctx, GLuint);
+typedef void (gl_APIENTRY *glExtGetProgramBinarySourceQCOM_client_proc_t) (void * ctx, GLuint, GLenum, GLchar*, GLint*);
+typedef void (gl_APIENTRY *glStartTilingQCOM_client_proc_t) (void * ctx, GLuint, GLuint, GLuint, GLuint, GLbitfield);
+typedef void (gl_APIENTRY *glEndTilingQCOM_client_proc_t) (void * ctx, GLbitfield);
+typedef GLenum (gl_APIENTRY *glGetGraphicsResetStatusEXT_client_proc_t) (void * ctx);
+typedef void (gl_APIENTRY *glReadnPixelsEXT_client_proc_t) (void * ctx, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLsizei, GLvoid*);
+
+
+#endif
diff --git a/system/GLESv1_enc/gl_enc.cpp b/system/GLESv1_enc/gl_enc.cpp
new file mode 100644
index 0000000..df1d7f9
--- /dev/null
+++ b/system/GLESv1_enc/gl_enc.cpp
@@ -0,0 +1,9222 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+
+
+#include <string.h>
+#include "gl_opcodes.h"
+
+#include "gl_enc.h"
+
+
+#include <vector>
+
+#include <stdio.h>
+
+#include "aemu/base/Tracing.h"
+
+#include "EncoderDebug.h"
+
+using gfxstream::IOStream;
+
+namespace {
+
+void enc_unsupported()
+{
+	ALOGE("Function is unsupported\n");
+}
+
+void glAlphaFunc_enc(void *self , GLenum func, GLclampf ref)
+{
+	ENCODER_DEBUG_LOG("glAlphaFunc(func:0x%08x, ref:%f)", func, ref);
+	AEMU_SCOPED_TRACE("glAlphaFunc encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glAlphaFunc;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &func, 4); ptr += 4;
+		memcpy(ptr, &ref, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glClearColor_enc(void *self , GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+{
+	ENCODER_DEBUG_LOG("glClearColor(red:%f, green:%f, blue:%f, alpha:%f)", red, green, blue, alpha);
+	AEMU_SCOPED_TRACE("glClearColor encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClearColor;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &red, 4); ptr += 4;
+		memcpy(ptr, &green, 4); ptr += 4;
+		memcpy(ptr, &blue, 4); ptr += 4;
+		memcpy(ptr, &alpha, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glClearDepthf_enc(void *self , GLclampf depth)
+{
+	ENCODER_DEBUG_LOG("glClearDepthf(depth:%f)", depth);
+	AEMU_SCOPED_TRACE("glClearDepthf encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClearDepthf;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &depth, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glClipPlanef_enc(void *self , GLenum plane, const GLfloat* equation)
+{
+	ENCODER_DEBUG_LOG("glClipPlanef(plane:0x%08x, equation:0x%08x)", plane, equation);
+	AEMU_SCOPED_TRACE("glClipPlanef encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_equation =  (4 * sizeof(float));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_equation + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClipPlanef;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &plane, 4); ptr += 4;
+	memcpy(ptr, &__size_equation, 4); ptr += 4;
+	memcpy(ptr, equation, __size_equation);ptr += __size_equation;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glColor4f_enc(void *self , GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
+{
+	ENCODER_DEBUG_LOG("glColor4f(red:%f, green:%f, blue:%f, alpha:%f)", red, green, blue, alpha);
+	AEMU_SCOPED_TRACE("glColor4f encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glColor4f;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &red, 4); ptr += 4;
+		memcpy(ptr, &green, 4); ptr += 4;
+		memcpy(ptr, &blue, 4); ptr += 4;
+		memcpy(ptr, &alpha, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDepthRangef_enc(void *self , GLclampf zNear, GLclampf zFar)
+{
+	ENCODER_DEBUG_LOG("glDepthRangef(zNear:%f, zFar:%f)", zNear, zFar);
+	AEMU_SCOPED_TRACE("glDepthRangef encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDepthRangef;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &zNear, 4); ptr += 4;
+		memcpy(ptr, &zFar, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glFogf_enc(void *self , GLenum pname, GLfloat param)
+{
+	ENCODER_DEBUG_LOG("glFogf(pname:0x%08x, param:%f)", pname, param);
+	AEMU_SCOPED_TRACE("glFogf encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFogf;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glFogfv_enc(void *self , GLenum pname, const GLfloat* params)
+{
+	ENCODER_DEBUG_LOG("glFogfv(pname:0x%08x, params:0x%08x)", pname, params);
+	AEMU_SCOPED_TRACE("glFogfv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFogfv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glFrustumf_enc(void *self , GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
+{
+	ENCODER_DEBUG_LOG("glFrustumf(left:%f, right:%f, bottom:%f, top:%f, zNear:%f, zFar:%f)", left, right, bottom, top, zNear, zFar);
+	AEMU_SCOPED_TRACE("glFrustumf encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFrustumf;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &left, 4); ptr += 4;
+		memcpy(ptr, &right, 4); ptr += 4;
+		memcpy(ptr, &bottom, 4); ptr += 4;
+		memcpy(ptr, &top, 4); ptr += 4;
+		memcpy(ptr, &zNear, 4); ptr += 4;
+		memcpy(ptr, &zFar, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetClipPlanef_enc(void *self , GLenum pname, GLfloat* eqn)
+{
+	ENCODER_DEBUG_LOG("glGetClipPlanef(pname:0x%08x, eqn:0x%08x)", pname, eqn);
+	AEMU_SCOPED_TRACE("glGetClipPlanef encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_eqn =  (4 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetClipPlanef;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_eqn, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(eqn, __size_eqn);
+	if (useChecksum) checksumCalculator->addBuffer(eqn, __size_eqn);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetClipPlanef: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetFloatv_enc(void *self , GLenum pname, GLfloat* params)
+{
+	ENCODER_DEBUG_LOG("glGetFloatv(pname:0x%08x, params:0x%08x)", pname, params);
+	AEMU_SCOPED_TRACE("glGetFloatv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetFloatv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetFloatv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetLightfv_enc(void *self , GLenum light, GLenum pname, GLfloat* params)
+{
+	ENCODER_DEBUG_LOG("glGetLightfv(light:0x%08x, pname:0x%08x, params:0x%08x)", light, pname, params);
+	AEMU_SCOPED_TRACE("glGetLightfv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetLightfv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &light, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetLightfv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetMaterialfv_enc(void *self , GLenum face, GLenum pname, GLfloat* params)
+{
+	ENCODER_DEBUG_LOG("glGetMaterialfv(face:0x%08x, pname:0x%08x, params:0x%08x)", face, pname, params);
+	AEMU_SCOPED_TRACE("glGetMaterialfv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetMaterialfv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &face, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetMaterialfv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetTexEnvfv_enc(void *self , GLenum env, GLenum pname, GLfloat* params)
+{
+	ENCODER_DEBUG_LOG("glGetTexEnvfv(env:0x%08x, pname:0x%08x, params:0x%08x)", env, pname, params);
+	AEMU_SCOPED_TRACE("glGetTexEnvfv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetTexEnvfv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &env, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetTexEnvfv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetTexParameterfv_enc(void *self , GLenum target, GLenum pname, GLfloat* params)
+{
+	ENCODER_DEBUG_LOG("glGetTexParameterfv(target:0x%08x, pname:0x%08x, params:0x%08x)", target, pname, params);
+	AEMU_SCOPED_TRACE("glGetTexParameterfv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetTexParameterfv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetTexParameterfv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glLightModelf_enc(void *self , GLenum pname, GLfloat param)
+{
+	ENCODER_DEBUG_LOG("glLightModelf(pname:0x%08x, param:%f)", pname, param);
+	AEMU_SCOPED_TRACE("glLightModelf encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glLightModelf;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glLightModelfv_enc(void *self , GLenum pname, const GLfloat* params)
+{
+	ENCODER_DEBUG_LOG("glLightModelfv(pname:0x%08x, params:0x%08x)", pname, params);
+	AEMU_SCOPED_TRACE("glLightModelfv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glLightModelfv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glLightf_enc(void *self , GLenum light, GLenum pname, GLfloat param)
+{
+	ENCODER_DEBUG_LOG("glLightf(light:0x%08x, pname:0x%08x, param:%f)", light, pname, param);
+	AEMU_SCOPED_TRACE("glLightf encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glLightf;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &light, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glLightfv_enc(void *self , GLenum light, GLenum pname, const GLfloat* params)
+{
+	ENCODER_DEBUG_LOG("glLightfv(light:0x%08x, pname:0x%08x, params:0x%08x)", light, pname, params);
+	AEMU_SCOPED_TRACE("glLightfv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glLightfv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &light, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glLineWidth_enc(void *self , GLfloat width)
+{
+	ENCODER_DEBUG_LOG("glLineWidth(width:%f)", width);
+	AEMU_SCOPED_TRACE("glLineWidth encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glLineWidth;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &width, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glLoadMatrixf_enc(void *self , const GLfloat* m)
+{
+	ENCODER_DEBUG_LOG("glLoadMatrixf(m:0x%08x)", m);
+	AEMU_SCOPED_TRACE("glLoadMatrixf encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_m =  (16 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + __size_m + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glLoadMatrixf;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+	memcpy(ptr, &__size_m, 4); ptr += 4;
+	memcpy(ptr, m, __size_m);ptr += __size_m;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glMaterialf_enc(void *self , GLenum face, GLenum pname, GLfloat param)
+{
+	ENCODER_DEBUG_LOG("glMaterialf(face:0x%08x, pname:0x%08x, param:%f)", face, pname, param);
+	AEMU_SCOPED_TRACE("glMaterialf encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glMaterialf;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &face, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glMaterialfv_enc(void *self , GLenum face, GLenum pname, const GLfloat* params)
+{
+	ENCODER_DEBUG_LOG("glMaterialfv(face:0x%08x, pname:0x%08x, params:0x%08x)", face, pname, params);
+	AEMU_SCOPED_TRACE("glMaterialfv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glMaterialfv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &face, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glMultMatrixf_enc(void *self , const GLfloat* m)
+{
+	ENCODER_DEBUG_LOG("glMultMatrixf(m:0x%08x)", m);
+	AEMU_SCOPED_TRACE("glMultMatrixf encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_m =  (16 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + __size_m + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glMultMatrixf;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+	memcpy(ptr, &__size_m, 4); ptr += 4;
+	memcpy(ptr, m, __size_m);ptr += __size_m;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glMultiTexCoord4f_enc(void *self , GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
+{
+	ENCODER_DEBUG_LOG("glMultiTexCoord4f(target:0x%08x, s:%f, t:%f, r:%f, q:%f)", target, s, t, r, q);
+	AEMU_SCOPED_TRACE("glMultiTexCoord4f encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glMultiTexCoord4f;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &s, 4); ptr += 4;
+		memcpy(ptr, &t, 4); ptr += 4;
+		memcpy(ptr, &r, 4); ptr += 4;
+		memcpy(ptr, &q, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glNormal3f_enc(void *self , GLfloat nx, GLfloat ny, GLfloat nz)
+{
+	ENCODER_DEBUG_LOG("glNormal3f(nx:%f, ny:%f, nz:%f)", nx, ny, nz);
+	AEMU_SCOPED_TRACE("glNormal3f encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glNormal3f;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &nx, 4); ptr += 4;
+		memcpy(ptr, &ny, 4); ptr += 4;
+		memcpy(ptr, &nz, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glOrthof_enc(void *self , GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
+{
+	ENCODER_DEBUG_LOG("glOrthof(left:%f, right:%f, bottom:%f, top:%f, zNear:%f, zFar:%f)", left, right, bottom, top, zNear, zFar);
+	AEMU_SCOPED_TRACE("glOrthof encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glOrthof;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &left, 4); ptr += 4;
+		memcpy(ptr, &right, 4); ptr += 4;
+		memcpy(ptr, &bottom, 4); ptr += 4;
+		memcpy(ptr, &top, 4); ptr += 4;
+		memcpy(ptr, &zNear, 4); ptr += 4;
+		memcpy(ptr, &zFar, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glPointParameterf_enc(void *self , GLenum pname, GLfloat param)
+{
+	ENCODER_DEBUG_LOG("glPointParameterf(pname:0x%08x, param:%f)", pname, param);
+	AEMU_SCOPED_TRACE("glPointParameterf encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glPointParameterf;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glPointParameterfv_enc(void *self , GLenum pname, const GLfloat* params)
+{
+	ENCODER_DEBUG_LOG("glPointParameterfv(pname:0x%08x, params:0x%08x)", pname, params);
+	AEMU_SCOPED_TRACE("glPointParameterfv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glPointParameterfv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glPointSize_enc(void *self , GLfloat size)
+{
+	ENCODER_DEBUG_LOG("glPointSize(size:%f)", size);
+	AEMU_SCOPED_TRACE("glPointSize encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glPointSize;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &size, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glPolygonOffset_enc(void *self , GLfloat factor, GLfloat units)
+{
+	ENCODER_DEBUG_LOG("glPolygonOffset(factor:%f, units:%f)", factor, units);
+	AEMU_SCOPED_TRACE("glPolygonOffset encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glPolygonOffset;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &factor, 4); ptr += 4;
+		memcpy(ptr, &units, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glRotatef_enc(void *self , GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
+{
+	ENCODER_DEBUG_LOG("glRotatef(angle:%f, x:%f, y:%f, z:%f)", angle, x, y, z);
+	AEMU_SCOPED_TRACE("glRotatef encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glRotatef;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &angle, 4); ptr += 4;
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &z, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glScalef_enc(void *self , GLfloat x, GLfloat y, GLfloat z)
+{
+	ENCODER_DEBUG_LOG("glScalef(x:%f, y:%f, z:%f)", x, y, z);
+	AEMU_SCOPED_TRACE("glScalef encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glScalef;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &z, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexEnvf_enc(void *self , GLenum target, GLenum pname, GLfloat param)
+{
+	ENCODER_DEBUG_LOG("glTexEnvf(target:0x%08x, pname:0x%08x, param:%f)", target, pname, param);
+	AEMU_SCOPED_TRACE("glTexEnvf encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexEnvf;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexEnvfv_enc(void *self , GLenum target, GLenum pname, const GLfloat* params)
+{
+	ENCODER_DEBUG_LOG("glTexEnvfv(target:0x%08x, pname:0x%08x, params:0x%08x)", target, pname, params);
+	AEMU_SCOPED_TRACE("glTexEnvfv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexEnvfv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexParameterf_enc(void *self , GLenum target, GLenum pname, GLfloat param)
+{
+	ENCODER_DEBUG_LOG("glTexParameterf(target:0x%08x, pname:0x%08x, param:%f)", target, pname, param);
+	AEMU_SCOPED_TRACE("glTexParameterf encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexParameterf;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexParameterfv_enc(void *self , GLenum target, GLenum pname, const GLfloat* params)
+{
+	ENCODER_DEBUG_LOG("glTexParameterfv(target:0x%08x, pname:0x%08x, params:0x%08x)", target, pname, params);
+	AEMU_SCOPED_TRACE("glTexParameterfv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexParameterfv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTranslatef_enc(void *self , GLfloat x, GLfloat y, GLfloat z)
+{
+	ENCODER_DEBUG_LOG("glTranslatef(x:%f, y:%f, z:%f)", x, y, z);
+	AEMU_SCOPED_TRACE("glTranslatef encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTranslatef;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &z, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glActiveTexture_enc(void *self , GLenum texture)
+{
+	ENCODER_DEBUG_LOG("glActiveTexture(texture:0x%08x)", texture);
+	AEMU_SCOPED_TRACE("glActiveTexture encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glActiveTexture;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &texture, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glAlphaFuncx_enc(void *self , GLenum func, GLclampx ref)
+{
+	ENCODER_DEBUG_LOG("glAlphaFuncx(func:0x%08x, ref:0x%08x)", func, ref);
+	AEMU_SCOPED_TRACE("glAlphaFuncx encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glAlphaFuncx;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &func, 4); ptr += 4;
+		memcpy(ptr, &ref, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBindBuffer_enc(void *self , GLenum target, GLuint buffer)
+{
+	ENCODER_DEBUG_LOG("glBindBuffer(target:0x%08x, buffer:%u)", target, buffer);
+	AEMU_SCOPED_TRACE("glBindBuffer encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBindBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &buffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBindTexture_enc(void *self , GLenum target, GLuint texture)
+{
+	ENCODER_DEBUG_LOG("glBindTexture(target:0x%08x, texture:%u)", target, texture);
+	AEMU_SCOPED_TRACE("glBindTexture encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBindTexture;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &texture, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBlendFunc_enc(void *self , GLenum sfactor, GLenum dfactor)
+{
+	ENCODER_DEBUG_LOG("glBlendFunc(sfactor:0x%08x, dfactor:0x%08x)", sfactor, dfactor);
+	AEMU_SCOPED_TRACE("glBlendFunc encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBlendFunc;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &sfactor, 4); ptr += 4;
+		memcpy(ptr, &dfactor, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBufferData_enc(void *self , GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage)
+{
+	ENCODER_DEBUG_LOG("glBufferData(target:0x%08x, size:0x%08lx, data:0x%08x, usage:0x%08x)", target, size, data, usage);
+	AEMU_SCOPED_TRACE("glBufferData encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data = ((data != NULL) ?  size : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_data + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBufferData;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &size, 4); ptr += 4;
+	memcpy(ptr, &__size_data, 4); ptr += 4;
+	if (data != NULL) memcpy(ptr, data, __size_data);ptr += __size_data;
+		memcpy(ptr, &usage, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBufferSubData_enc(void *self , GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data)
+{
+	ENCODER_DEBUG_LOG("glBufferSubData(target:0x%08x, offset:0x%08lx, size:0x%08lx, data:0x%08x)", target, offset, size, data);
+	AEMU_SCOPED_TRACE("glBufferSubData encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data = ((data != NULL) ?  size : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_data + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBufferSubData;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+		memcpy(ptr, &size, 4); ptr += 4;
+	memcpy(ptr, &__size_data, 4); ptr += 4;
+	if (data != NULL) memcpy(ptr, data, __size_data);ptr += __size_data;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glClear_enc(void *self , GLbitfield mask)
+{
+	ENCODER_DEBUG_LOG("glClear(mask:0x%08x)", mask);
+	AEMU_SCOPED_TRACE("glClear encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClear;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mask, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glClearColorx_enc(void *self , GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha)
+{
+	ENCODER_DEBUG_LOG("glClearColorx(red:0x%08x, green:0x%08x, blue:0x%08x, alpha:0x%08x)", red, green, blue, alpha);
+	AEMU_SCOPED_TRACE("glClearColorx encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClearColorx;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &red, 4); ptr += 4;
+		memcpy(ptr, &green, 4); ptr += 4;
+		memcpy(ptr, &blue, 4); ptr += 4;
+		memcpy(ptr, &alpha, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glClearDepthx_enc(void *self , GLclampx depth)
+{
+	ENCODER_DEBUG_LOG("glClearDepthx(depth:0x%08x)", depth);
+	AEMU_SCOPED_TRACE("glClearDepthx encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClearDepthx;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &depth, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glClearStencil_enc(void *self , GLint s)
+{
+	ENCODER_DEBUG_LOG("glClearStencil(s:%d)", s);
+	AEMU_SCOPED_TRACE("glClearStencil encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClearStencil;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &s, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glClientActiveTexture_enc(void *self , GLenum texture)
+{
+	ENCODER_DEBUG_LOG("glClientActiveTexture(texture:0x%08x)", texture);
+	AEMU_SCOPED_TRACE("glClientActiveTexture encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClientActiveTexture;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &texture, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glColor4ub_enc(void *self , GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
+{
+	ENCODER_DEBUG_LOG("glColor4ub(red:0x%02x, green:0x%02x, blue:0x%02x, alpha:0x%02x)", red, green, blue, alpha);
+	AEMU_SCOPED_TRACE("glColor4ub encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 1 + 1 + 1 + 1;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glColor4ub;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &red, 1); ptr += 1;
+		memcpy(ptr, &green, 1); ptr += 1;
+		memcpy(ptr, &blue, 1); ptr += 1;
+		memcpy(ptr, &alpha, 1); ptr += 1;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glColor4x_enc(void *self , GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
+{
+	ENCODER_DEBUG_LOG("glColor4x(red:0x%08x, green:0x%08x, blue:0x%08x, alpha:0x%08x)", red, green, blue, alpha);
+	AEMU_SCOPED_TRACE("glColor4x encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glColor4x;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &red, 4); ptr += 4;
+		memcpy(ptr, &green, 4); ptr += 4;
+		memcpy(ptr, &blue, 4); ptr += 4;
+		memcpy(ptr, &alpha, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glColorMask_enc(void *self , GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
+{
+	ENCODER_DEBUG_LOG("glColorMask(red:%d, green:%d, blue:%d, alpha:%d)", red, green, blue, alpha);
+	AEMU_SCOPED_TRACE("glColorMask encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 1 + 1 + 1 + 1;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glColorMask;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &red, 1); ptr += 1;
+		memcpy(ptr, &green, 1); ptr += 1;
+		memcpy(ptr, &blue, 1); ptr += 1;
+		memcpy(ptr, &alpha, 1); ptr += 1;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glCompressedTexImage2D_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data)
+{
+	ENCODER_DEBUG_LOG("glCompressedTexImage2D(target:0x%08x, level:%d, internalformat:0x%08x, width:%d, height:%d, border:%d, imageSize:%d, data:0x%08x)", target, level, internalformat, width, height, border, imageSize, data);
+	AEMU_SCOPED_TRACE("glCompressedTexImage2D encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data = ((data != NULL) ?  imageSize : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_data + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glCompressedTexImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &internalformat, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &border, 4); ptr += 4;
+		memcpy(ptr, &imageSize, 4); ptr += 4;
+	memcpy(ptr, &__size_data, 4); ptr += 4;
+	if (data != NULL) memcpy(ptr, data, __size_data);ptr += __size_data;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glCompressedTexSubImage2D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data)
+{
+	ENCODER_DEBUG_LOG("glCompressedTexSubImage2D(target:0x%08x, level:%d, xoffset:%d, yoffset:%d, width:%d, height:%d, format:0x%08x, imageSize:%d, data:0x%08x)", target, level, xoffset, yoffset, width, height, format, imageSize, data);
+	AEMU_SCOPED_TRACE("glCompressedTexSubImage2D encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data = ((data != NULL) ?  imageSize : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_data + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glCompressedTexSubImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &xoffset, 4); ptr += 4;
+		memcpy(ptr, &yoffset, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &imageSize, 4); ptr += 4;
+	memcpy(ptr, &__size_data, 4); ptr += 4;
+	if (data != NULL) memcpy(ptr, data, __size_data);ptr += __size_data;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glCopyTexImage2D_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
+{
+	ENCODER_DEBUG_LOG("glCopyTexImage2D(target:0x%08x, level:%d, internalformat:0x%08x, x:%d, y:%d, width:%d, height:%d, border:%d)", target, level, internalformat, x, y, width, height, border);
+	AEMU_SCOPED_TRACE("glCopyTexImage2D encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glCopyTexImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &internalformat, 4); ptr += 4;
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &border, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glCopyTexSubImage2D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+	ENCODER_DEBUG_LOG("glCopyTexSubImage2D(target:0x%08x, level:%d, xoffset:%d, yoffset:%d, x:%d, y:%d, width:%d, height:%d)", target, level, xoffset, yoffset, x, y, width, height);
+	AEMU_SCOPED_TRACE("glCopyTexSubImage2D encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glCopyTexSubImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &xoffset, 4); ptr += 4;
+		memcpy(ptr, &yoffset, 4); ptr += 4;
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glCullFace_enc(void *self , GLenum mode)
+{
+	ENCODER_DEBUG_LOG("glCullFace(mode:0x%08x)", mode);
+	AEMU_SCOPED_TRACE("glCullFace encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glCullFace;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDeleteBuffers_enc(void *self , GLsizei n, const GLuint* buffers)
+{
+	ENCODER_DEBUG_LOG("glDeleteBuffers(n:%d, buffers:0x%08x)", n, buffers);
+	AEMU_SCOPED_TRACE("glDeleteBuffers encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_buffers =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_buffers + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDeleteBuffers;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_buffers, 4); ptr += 4;
+	memcpy(ptr, buffers, __size_buffers);ptr += __size_buffers;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDeleteTextures_enc(void *self , GLsizei n, const GLuint* textures)
+{
+	ENCODER_DEBUG_LOG("glDeleteTextures(n:%d, textures:0x%08x)", n, textures);
+	AEMU_SCOPED_TRACE("glDeleteTextures encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_textures =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_textures + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDeleteTextures;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_textures, 4); ptr += 4;
+	memcpy(ptr, textures, __size_textures);ptr += __size_textures;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDepthFunc_enc(void *self , GLenum func)
+{
+	ENCODER_DEBUG_LOG("glDepthFunc(func:0x%08x)", func);
+	AEMU_SCOPED_TRACE("glDepthFunc encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDepthFunc;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &func, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDepthMask_enc(void *self , GLboolean flag)
+{
+	ENCODER_DEBUG_LOG("glDepthMask(flag:%d)", flag);
+	AEMU_SCOPED_TRACE("glDepthMask encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 1;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDepthMask;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &flag, 1); ptr += 1;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDepthRangex_enc(void *self , GLclampx zNear, GLclampx zFar)
+{
+	ENCODER_DEBUG_LOG("glDepthRangex(zNear:0x%08x, zFar:0x%08x)", zNear, zFar);
+	AEMU_SCOPED_TRACE("glDepthRangex encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDepthRangex;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &zNear, 4); ptr += 4;
+		memcpy(ptr, &zFar, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDisable_enc(void *self , GLenum cap)
+{
+	ENCODER_DEBUG_LOG("glDisable(cap:0x%08x)", cap);
+	AEMU_SCOPED_TRACE("glDisable encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDisable;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &cap, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDisableClientState_enc(void *self , GLenum array)
+{
+	ENCODER_DEBUG_LOG("glDisableClientState(array:0x%08x)", array);
+	AEMU_SCOPED_TRACE("glDisableClientState encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDisableClientState;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &array, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawArrays_enc(void *self , GLenum mode, GLint first, GLsizei count)
+{
+	ENCODER_DEBUG_LOG("glDrawArrays(mode:0x%08x, first:%d, count:%d)", mode, first, count);
+	AEMU_SCOPED_TRACE("glDrawArrays encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawArrays;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+		memcpy(ptr, &first, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glEnable_enc(void *self , GLenum cap)
+{
+	ENCODER_DEBUG_LOG("glEnable(cap:0x%08x)", cap);
+	AEMU_SCOPED_TRACE("glEnable encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glEnable;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &cap, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glEnableClientState_enc(void *self , GLenum array)
+{
+	ENCODER_DEBUG_LOG("glEnableClientState(array:0x%08x)", array);
+	AEMU_SCOPED_TRACE("glEnableClientState encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glEnableClientState;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &array, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glFinish_enc(void *self )
+{
+	ENCODER_DEBUG_LOG("glFinish()");
+	AEMU_SCOPED_TRACE("glFinish encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFinish;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glFlush_enc(void *self )
+{
+	ENCODER_DEBUG_LOG("glFlush()");
+	AEMU_SCOPED_TRACE("glFlush encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFlush;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glFogx_enc(void *self , GLenum pname, GLfixed param)
+{
+	ENCODER_DEBUG_LOG("glFogx(pname:0x%08x, param:0x%08x)", pname, param);
+	AEMU_SCOPED_TRACE("glFogx encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFogx;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glFogxv_enc(void *self , GLenum pname, const GLfixed* params)
+{
+	ENCODER_DEBUG_LOG("glFogxv(pname:0x%08x, params:0x%08x)", pname, params);
+	AEMU_SCOPED_TRACE("glFogxv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFogxv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glFrontFace_enc(void *self , GLenum mode)
+{
+	ENCODER_DEBUG_LOG("glFrontFace(mode:0x%08x)", mode);
+	AEMU_SCOPED_TRACE("glFrontFace encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFrontFace;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glFrustumx_enc(void *self , GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
+{
+	ENCODER_DEBUG_LOG("glFrustumx(left:0x%08x, right:0x%08x, bottom:0x%08x, top:0x%08x, zNear:0x%08x, zFar:0x%08x)", left, right, bottom, top, zNear, zFar);
+	AEMU_SCOPED_TRACE("glFrustumx encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFrustumx;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &left, 4); ptr += 4;
+		memcpy(ptr, &right, 4); ptr += 4;
+		memcpy(ptr, &bottom, 4); ptr += 4;
+		memcpy(ptr, &top, 4); ptr += 4;
+		memcpy(ptr, &zNear, 4); ptr += 4;
+		memcpy(ptr, &zFar, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetBooleanv_enc(void *self , GLenum pname, GLboolean* params)
+{
+	ENCODER_DEBUG_LOG("glGetBooleanv(pname:0x%08x, params:0x%08x)", pname, params);
+	AEMU_SCOPED_TRACE("glGetBooleanv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLboolean));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetBooleanv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetBooleanv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetBufferParameteriv_enc(void *self , GLenum target, GLenum pname, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glGetBufferParameteriv(target:0x%08x, pname:0x%08x, params:0x%08x)", target, pname, params);
+	AEMU_SCOPED_TRACE("glGetBufferParameteriv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetBufferParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetBufferParameteriv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glClipPlanex_enc(void *self , GLenum pname, const GLfixed* eqn)
+{
+	ENCODER_DEBUG_LOG("glClipPlanex(pname:0x%08x, eqn:0x%08x)", pname, eqn);
+	AEMU_SCOPED_TRACE("glClipPlanex encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_eqn =  (4 * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_eqn + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClipPlanex;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_eqn, 4); ptr += 4;
+	memcpy(ptr, eqn, __size_eqn);ptr += __size_eqn;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGenBuffers_enc(void *self , GLsizei n, GLuint* buffers)
+{
+	ENCODER_DEBUG_LOG("glGenBuffers(n:%d, buffers:0x%08x)", n, buffers);
+	AEMU_SCOPED_TRACE("glGenBuffers encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_buffers =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGenBuffers;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_buffers, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(buffers, __size_buffers);
+	if (useChecksum) checksumCalculator->addBuffer(buffers, __size_buffers);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGenBuffers: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGenTextures_enc(void *self , GLsizei n, GLuint* textures)
+{
+	ENCODER_DEBUG_LOG("glGenTextures(n:%d, textures:0x%08x)", n, textures);
+	AEMU_SCOPED_TRACE("glGenTextures encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_textures =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGenTextures;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_textures, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(textures, __size_textures);
+	if (useChecksum) checksumCalculator->addBuffer(textures, __size_textures);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGenTextures: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+GLenum glGetError_enc(void *self )
+{
+	ENCODER_DEBUG_LOG("glGetError()");
+	AEMU_SCOPED_TRACE("glGetError encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetError;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLenum retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetError: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glGetFixedv_enc(void *self , GLenum pname, GLfixed* params)
+{
+	ENCODER_DEBUG_LOG("glGetFixedv(pname:0x%08x, params:0x%08x)", pname, params);
+	AEMU_SCOPED_TRACE("glGetFixedv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetFixedv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetFixedv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetIntegerv_enc(void *self , GLenum pname, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glGetIntegerv(pname:0x%08x, params:0x%08x)", pname, params);
+	AEMU_SCOPED_TRACE("glGetIntegerv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetIntegerv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetIntegerv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetLightxv_enc(void *self , GLenum light, GLenum pname, GLfixed* params)
+{
+	ENCODER_DEBUG_LOG("glGetLightxv(light:0x%08x, pname:0x%08x, params:0x%08x)", light, pname, params);
+	AEMU_SCOPED_TRACE("glGetLightxv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetLightxv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &light, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetLightxv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetMaterialxv_enc(void *self , GLenum face, GLenum pname, GLfixed* params)
+{
+	ENCODER_DEBUG_LOG("glGetMaterialxv(face:0x%08x, pname:0x%08x, params:0x%08x)", face, pname, params);
+	AEMU_SCOPED_TRACE("glGetMaterialxv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetMaterialxv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &face, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetMaterialxv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetTexEnviv_enc(void *self , GLenum env, GLenum pname, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glGetTexEnviv(env:0x%08x, pname:0x%08x, params:0x%08x)", env, pname, params);
+	AEMU_SCOPED_TRACE("glGetTexEnviv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetTexEnviv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &env, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetTexEnviv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetTexEnvxv_enc(void *self , GLenum env, GLenum pname, GLfixed* params)
+{
+	ENCODER_DEBUG_LOG("glGetTexEnvxv(env:0x%08x, pname:0x%08x, params:0x%08x)", env, pname, params);
+	AEMU_SCOPED_TRACE("glGetTexEnvxv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetTexEnvxv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &env, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetTexEnvxv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetTexParameteriv_enc(void *self , GLenum target, GLenum pname, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glGetTexParameteriv(target:0x%08x, pname:0x%08x, params:0x%08x)", target, pname, params);
+	AEMU_SCOPED_TRACE("glGetTexParameteriv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetTexParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetTexParameteriv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetTexParameterxv_enc(void *self , GLenum target, GLenum pname, GLfixed* params)
+{
+	ENCODER_DEBUG_LOG("glGetTexParameterxv(target:0x%08x, pname:0x%08x, params:0x%08x)", target, pname, params);
+	AEMU_SCOPED_TRACE("glGetTexParameterxv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetTexParameterxv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetTexParameterxv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glHint_enc(void *self , GLenum target, GLenum mode)
+{
+	ENCODER_DEBUG_LOG("glHint(target:0x%08x, mode:0x%08x)", target, mode);
+	AEMU_SCOPED_TRACE("glHint encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glHint;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &mode, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+GLboolean glIsBuffer_enc(void *self , GLuint buffer)
+{
+	ENCODER_DEBUG_LOG("glIsBuffer(buffer:%u)", buffer);
+	AEMU_SCOPED_TRACE("glIsBuffer encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glIsBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &buffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glIsBuffer: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+GLboolean glIsEnabled_enc(void *self , GLenum cap)
+{
+	ENCODER_DEBUG_LOG("glIsEnabled(cap:0x%08x)", cap);
+	AEMU_SCOPED_TRACE("glIsEnabled encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glIsEnabled;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &cap, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glIsEnabled: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+GLboolean glIsTexture_enc(void *self , GLuint texture)
+{
+	ENCODER_DEBUG_LOG("glIsTexture(texture:%u)", texture);
+	AEMU_SCOPED_TRACE("glIsTexture encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glIsTexture;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &texture, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glIsTexture: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glLightModelx_enc(void *self , GLenum pname, GLfixed param)
+{
+	ENCODER_DEBUG_LOG("glLightModelx(pname:0x%08x, param:0x%08x)", pname, param);
+	AEMU_SCOPED_TRACE("glLightModelx encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glLightModelx;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glLightModelxv_enc(void *self , GLenum pname, const GLfixed* params)
+{
+	ENCODER_DEBUG_LOG("glLightModelxv(pname:0x%08x, params:0x%08x)", pname, params);
+	AEMU_SCOPED_TRACE("glLightModelxv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glLightModelxv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glLightx_enc(void *self , GLenum light, GLenum pname, GLfixed param)
+{
+	ENCODER_DEBUG_LOG("glLightx(light:0x%08x, pname:0x%08x, param:0x%08x)", light, pname, param);
+	AEMU_SCOPED_TRACE("glLightx encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glLightx;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &light, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glLightxv_enc(void *self , GLenum light, GLenum pname, const GLfixed* params)
+{
+	ENCODER_DEBUG_LOG("glLightxv(light:0x%08x, pname:0x%08x, params:0x%08x)", light, pname, params);
+	AEMU_SCOPED_TRACE("glLightxv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glLightxv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &light, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glLineWidthx_enc(void *self , GLfixed width)
+{
+	ENCODER_DEBUG_LOG("glLineWidthx(width:0x%08x)", width);
+	AEMU_SCOPED_TRACE("glLineWidthx encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glLineWidthx;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &width, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glLoadIdentity_enc(void *self )
+{
+	ENCODER_DEBUG_LOG("glLoadIdentity()");
+	AEMU_SCOPED_TRACE("glLoadIdentity encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glLoadIdentity;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glLoadMatrixx_enc(void *self , const GLfixed* m)
+{
+	ENCODER_DEBUG_LOG("glLoadMatrixx(m:0x%08x)", m);
+	AEMU_SCOPED_TRACE("glLoadMatrixx encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_m =  (16 * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + __size_m + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glLoadMatrixx;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+	memcpy(ptr, &__size_m, 4); ptr += 4;
+	memcpy(ptr, m, __size_m);ptr += __size_m;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glLogicOp_enc(void *self , GLenum opcode)
+{
+	ENCODER_DEBUG_LOG("glLogicOp(opcode:0x%08x)", opcode);
+	AEMU_SCOPED_TRACE("glLogicOp encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glLogicOp;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &opcode, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glMaterialx_enc(void *self , GLenum face, GLenum pname, GLfixed param)
+{
+	ENCODER_DEBUG_LOG("glMaterialx(face:0x%08x, pname:0x%08x, param:0x%08x)", face, pname, param);
+	AEMU_SCOPED_TRACE("glMaterialx encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glMaterialx;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &face, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glMaterialxv_enc(void *self , GLenum face, GLenum pname, const GLfixed* params)
+{
+	ENCODER_DEBUG_LOG("glMaterialxv(face:0x%08x, pname:0x%08x, params:0x%08x)", face, pname, params);
+	AEMU_SCOPED_TRACE("glMaterialxv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glMaterialxv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &face, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glMatrixMode_enc(void *self , GLenum mode)
+{
+	ENCODER_DEBUG_LOG("glMatrixMode(mode:0x%08x)", mode);
+	AEMU_SCOPED_TRACE("glMatrixMode encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glMatrixMode;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glMultMatrixx_enc(void *self , const GLfixed* m)
+{
+	ENCODER_DEBUG_LOG("glMultMatrixx(m:0x%08x)", m);
+	AEMU_SCOPED_TRACE("glMultMatrixx encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_m =  (16 * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + __size_m + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glMultMatrixx;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+	memcpy(ptr, &__size_m, 4); ptr += 4;
+	memcpy(ptr, m, __size_m);ptr += __size_m;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glMultiTexCoord4x_enc(void *self , GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
+{
+	ENCODER_DEBUG_LOG("glMultiTexCoord4x(target:0x%08x, s:0x%08x, t:0x%08x, r:0x%08x, q:0x%08x)", target, s, t, r, q);
+	AEMU_SCOPED_TRACE("glMultiTexCoord4x encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glMultiTexCoord4x;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &s, 4); ptr += 4;
+		memcpy(ptr, &t, 4); ptr += 4;
+		memcpy(ptr, &r, 4); ptr += 4;
+		memcpy(ptr, &q, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glNormal3x_enc(void *self , GLfixed nx, GLfixed ny, GLfixed nz)
+{
+	ENCODER_DEBUG_LOG("glNormal3x(nx:0x%08x, ny:0x%08x, nz:0x%08x)", nx, ny, nz);
+	AEMU_SCOPED_TRACE("glNormal3x encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glNormal3x;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &nx, 4); ptr += 4;
+		memcpy(ptr, &ny, 4); ptr += 4;
+		memcpy(ptr, &nz, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glOrthox_enc(void *self , GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
+{
+	ENCODER_DEBUG_LOG("glOrthox(left:0x%08x, right:0x%08x, bottom:0x%08x, top:0x%08x, zNear:0x%08x, zFar:0x%08x)", left, right, bottom, top, zNear, zFar);
+	AEMU_SCOPED_TRACE("glOrthox encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glOrthox;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &left, 4); ptr += 4;
+		memcpy(ptr, &right, 4); ptr += 4;
+		memcpy(ptr, &bottom, 4); ptr += 4;
+		memcpy(ptr, &top, 4); ptr += 4;
+		memcpy(ptr, &zNear, 4); ptr += 4;
+		memcpy(ptr, &zFar, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glPixelStorei_enc(void *self , GLenum pname, GLint param)
+{
+	ENCODER_DEBUG_LOG("glPixelStorei(pname:0x%08x, param:%d)", pname, param);
+	AEMU_SCOPED_TRACE("glPixelStorei encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glPixelStorei;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glPointParameterx_enc(void *self , GLenum pname, GLfixed param)
+{
+	ENCODER_DEBUG_LOG("glPointParameterx(pname:0x%08x, param:0x%08x)", pname, param);
+	AEMU_SCOPED_TRACE("glPointParameterx encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glPointParameterx;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glPointParameterxv_enc(void *self , GLenum pname, const GLfixed* params)
+{
+	ENCODER_DEBUG_LOG("glPointParameterxv(pname:0x%08x, params:0x%08x)", pname, params);
+	AEMU_SCOPED_TRACE("glPointParameterxv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glPointParameterxv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glPointSizex_enc(void *self , GLfixed size)
+{
+	ENCODER_DEBUG_LOG("glPointSizex(size:0x%08x)", size);
+	AEMU_SCOPED_TRACE("glPointSizex encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glPointSizex;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &size, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glPolygonOffsetx_enc(void *self , GLfixed factor, GLfixed units)
+{
+	ENCODER_DEBUG_LOG("glPolygonOffsetx(factor:0x%08x, units:0x%08x)", factor, units);
+	AEMU_SCOPED_TRACE("glPolygonOffsetx encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glPolygonOffsetx;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &factor, 4); ptr += 4;
+		memcpy(ptr, &units, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glPopMatrix_enc(void *self )
+{
+	ENCODER_DEBUG_LOG("glPopMatrix()");
+	AEMU_SCOPED_TRACE("glPopMatrix encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glPopMatrix;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glPushMatrix_enc(void *self )
+{
+	ENCODER_DEBUG_LOG("glPushMatrix()");
+	AEMU_SCOPED_TRACE("glPushMatrix encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glPushMatrix;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glReadPixels_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels)
+{
+	ENCODER_DEBUG_LOG("glReadPixels(x:%d, y:%d, width:%d, height:%d, format:0x%08x, type:0x%08x, pixels:0x%08x)", x, y, width, height, format, type, pixels);
+	AEMU_SCOPED_TRACE("glReadPixels encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_pixels =  glesv1_enc::pixelDataSize(self, width, height, format, type, 1);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glReadPixels;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+	memcpy(ptr, &__size_pixels, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(pixels, __size_pixels);
+	if (useChecksum) checksumCalculator->addBuffer(pixels, __size_pixels);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glReadPixels: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glRotatex_enc(void *self , GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
+{
+	ENCODER_DEBUG_LOG("glRotatex(angle:0x%08x, x:0x%08x, y:0x%08x, z:0x%08x)", angle, x, y, z);
+	AEMU_SCOPED_TRACE("glRotatex encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glRotatex;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &angle, 4); ptr += 4;
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &z, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glSampleCoverage_enc(void *self , GLclampf value, GLboolean invert)
+{
+	ENCODER_DEBUG_LOG("glSampleCoverage(value:%f, invert:%d)", value, invert);
+	AEMU_SCOPED_TRACE("glSampleCoverage encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 1;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glSampleCoverage;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &value, 4); ptr += 4;
+		memcpy(ptr, &invert, 1); ptr += 1;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glSampleCoveragex_enc(void *self , GLclampx value, GLboolean invert)
+{
+	ENCODER_DEBUG_LOG("glSampleCoveragex(value:0x%08x, invert:%d)", value, invert);
+	AEMU_SCOPED_TRACE("glSampleCoveragex encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 1;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glSampleCoveragex;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &value, 4); ptr += 4;
+		memcpy(ptr, &invert, 1); ptr += 1;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glScalex_enc(void *self , GLfixed x, GLfixed y, GLfixed z)
+{
+	ENCODER_DEBUG_LOG("glScalex(x:0x%08x, y:0x%08x, z:0x%08x)", x, y, z);
+	AEMU_SCOPED_TRACE("glScalex encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glScalex;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &z, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glScissor_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height)
+{
+	ENCODER_DEBUG_LOG("glScissor(x:%d, y:%d, width:%d, height:%d)", x, y, width, height);
+	AEMU_SCOPED_TRACE("glScissor encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glScissor;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glShadeModel_enc(void *self , GLenum mode)
+{
+	ENCODER_DEBUG_LOG("glShadeModel(mode:0x%08x)", mode);
+	AEMU_SCOPED_TRACE("glShadeModel encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glShadeModel;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glStencilFunc_enc(void *self , GLenum func, GLint ref, GLuint mask)
+{
+	ENCODER_DEBUG_LOG("glStencilFunc(func:0x%08x, ref:%d, mask:%u)", func, ref, mask);
+	AEMU_SCOPED_TRACE("glStencilFunc encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glStencilFunc;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &func, 4); ptr += 4;
+		memcpy(ptr, &ref, 4); ptr += 4;
+		memcpy(ptr, &mask, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glStencilMask_enc(void *self , GLuint mask)
+{
+	ENCODER_DEBUG_LOG("glStencilMask(mask:%u)", mask);
+	AEMU_SCOPED_TRACE("glStencilMask encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glStencilMask;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mask, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glStencilOp_enc(void *self , GLenum fail, GLenum zfail, GLenum zpass)
+{
+	ENCODER_DEBUG_LOG("glStencilOp(fail:0x%08x, zfail:0x%08x, zpass:0x%08x)", fail, zfail, zpass);
+	AEMU_SCOPED_TRACE("glStencilOp encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glStencilOp;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &fail, 4); ptr += 4;
+		memcpy(ptr, &zfail, 4); ptr += 4;
+		memcpy(ptr, &zpass, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexEnvi_enc(void *self , GLenum target, GLenum pname, GLint param)
+{
+	ENCODER_DEBUG_LOG("glTexEnvi(target:0x%08x, pname:0x%08x, param:%d)", target, pname, param);
+	AEMU_SCOPED_TRACE("glTexEnvi encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexEnvi;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexEnvx_enc(void *self , GLenum target, GLenum pname, GLfixed param)
+{
+	ENCODER_DEBUG_LOG("glTexEnvx(target:0x%08x, pname:0x%08x, param:0x%08x)", target, pname, param);
+	AEMU_SCOPED_TRACE("glTexEnvx encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexEnvx;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexEnviv_enc(void *self , GLenum target, GLenum pname, const GLint* params)
+{
+	ENCODER_DEBUG_LOG("glTexEnviv(target:0x%08x, pname:0x%08x, params:0x%08x)", target, pname, params);
+	AEMU_SCOPED_TRACE("glTexEnviv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexEnviv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexEnvxv_enc(void *self , GLenum target, GLenum pname, const GLfixed* params)
+{
+	ENCODER_DEBUG_LOG("glTexEnvxv(target:0x%08x, pname:0x%08x, params:0x%08x)", target, pname, params);
+	AEMU_SCOPED_TRACE("glTexEnvxv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexEnvxv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexImage2D_enc(void *self , GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
+{
+	ENCODER_DEBUG_LOG("glTexImage2D(target:0x%08x, level:%d, internalformat:%d, width:%d, height:%d, border:%d, format:0x%08x, type:0x%08x, pixels:0x%08x)", target, level, internalformat, width, height, border, format, type, pixels);
+	AEMU_SCOPED_TRACE("glTexImage2D encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_pixels = ((pixels != NULL) ?  glesv1_enc::pixelDataSize(self, width, height, format, type, 0) : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
+	ptr = buf;
+	int tmp = OP_glTexImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &internalformat, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &border, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	stream->flush();
+	stream->writeFully(&__size_pixels,4);
+	if (useChecksum) checksumCalculator->addBuffer(&__size_pixels,4);
+	if (pixels != NULL) {
+		stream->writeFully(pixels, __size_pixels);
+		if (useChecksum) checksumCalculator->addBuffer(pixels, __size_pixels);
+	}
+	buf = stream->alloc(checksumSize);
+	if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
+
+}
+
+void glTexParameteri_enc(void *self , GLenum target, GLenum pname, GLint param)
+{
+	ENCODER_DEBUG_LOG("glTexParameteri(target:0x%08x, pname:0x%08x, param:%d)", target, pname, param);
+	AEMU_SCOPED_TRACE("glTexParameteri encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexParameteri;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexParameterx_enc(void *self , GLenum target, GLenum pname, GLfixed param)
+{
+	ENCODER_DEBUG_LOG("glTexParameterx(target:0x%08x, pname:0x%08x, param:0x%08x)", target, pname, param);
+	AEMU_SCOPED_TRACE("glTexParameterx encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexParameterx;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexParameteriv_enc(void *self , GLenum target, GLenum pname, const GLint* params)
+{
+	ENCODER_DEBUG_LOG("glTexParameteriv(target:0x%08x, pname:0x%08x, params:0x%08x)", target, pname, params);
+	AEMU_SCOPED_TRACE("glTexParameteriv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexParameterxv_enc(void *self , GLenum target, GLenum pname, const GLfixed* params)
+{
+	ENCODER_DEBUG_LOG("glTexParameterxv(target:0x%08x, pname:0x%08x, params:0x%08x)", target, pname, params);
+	AEMU_SCOPED_TRACE("glTexParameterxv encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexParameterxv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexSubImage2D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels)
+{
+	ENCODER_DEBUG_LOG("glTexSubImage2D(target:0x%08x, level:%d, xoffset:%d, yoffset:%d, width:%d, height:%d, format:0x%08x, type:0x%08x, pixels:0x%08x)", target, level, xoffset, yoffset, width, height, format, type, pixels);
+	AEMU_SCOPED_TRACE("glTexSubImage2D encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_pixels = ((pixels != NULL) ?  glesv1_enc::pixelDataSize(self, width, height, format, type, 0) : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
+	ptr = buf;
+	int tmp = OP_glTexSubImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &xoffset, 4); ptr += 4;
+		memcpy(ptr, &yoffset, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	stream->flush();
+	stream->writeFully(&__size_pixels,4);
+	if (useChecksum) checksumCalculator->addBuffer(&__size_pixels,4);
+	if (pixels != NULL) {
+		stream->writeFully(pixels, __size_pixels);
+		if (useChecksum) checksumCalculator->addBuffer(pixels, __size_pixels);
+	}
+	buf = stream->alloc(checksumSize);
+	if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
+
+}
+
+void glTranslatex_enc(void *self , GLfixed x, GLfixed y, GLfixed z)
+{
+	ENCODER_DEBUG_LOG("glTranslatex(x:0x%08x, y:0x%08x, z:0x%08x)", x, y, z);
+	AEMU_SCOPED_TRACE("glTranslatex encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTranslatex;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &z, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glViewport_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height)
+{
+	ENCODER_DEBUG_LOG("glViewport(x:%d, y:%d, width:%d, height:%d)", x, y, width, height);
+	AEMU_SCOPED_TRACE("glViewport encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glViewport;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexPointerOffset_enc(void *self , GLint size, GLenum type, GLsizei stride, GLuint offset)
+{
+	ENCODER_DEBUG_LOG("glVertexPointerOffset(size:%d, type:0x%08x, stride:%d, offset:%u)", size, type, stride, offset);
+	AEMU_SCOPED_TRACE("glVertexPointerOffset encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexPointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &size, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &stride, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glColorPointerOffset_enc(void *self , GLint size, GLenum type, GLsizei stride, GLuint offset)
+{
+	ENCODER_DEBUG_LOG("glColorPointerOffset(size:%d, type:0x%08x, stride:%d, offset:%u)", size, type, stride, offset);
+	AEMU_SCOPED_TRACE("glColorPointerOffset encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glColorPointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &size, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &stride, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glNormalPointerOffset_enc(void *self , GLenum type, GLsizei stride, GLuint offset)
+{
+	ENCODER_DEBUG_LOG("glNormalPointerOffset(type:0x%08x, stride:%d, offset:%u)", type, stride, offset);
+	AEMU_SCOPED_TRACE("glNormalPointerOffset encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glNormalPointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &stride, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glPointSizePointerOffset_enc(void *self , GLenum type, GLsizei stride, GLuint offset)
+{
+	ENCODER_DEBUG_LOG("glPointSizePointerOffset(type:0x%08x, stride:%d, offset:%u)", type, stride, offset);
+	AEMU_SCOPED_TRACE("glPointSizePointerOffset encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glPointSizePointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &stride, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexCoordPointerOffset_enc(void *self , GLint size, GLenum type, GLsizei stride, GLuint offset)
+{
+	ENCODER_DEBUG_LOG("glTexCoordPointerOffset(size:%d, type:0x%08x, stride:%d, offset:%u)", size, type, stride, offset);
+	AEMU_SCOPED_TRACE("glTexCoordPointerOffset encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexCoordPointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &size, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &stride, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glWeightPointerOffset_enc(void *self , GLint size, GLenum type, GLsizei stride, GLuint offset)
+{
+	ENCODER_DEBUG_LOG("glWeightPointerOffset(size:%d, type:0x%08x, stride:%d, offset:%u)", size, type, stride, offset);
+	AEMU_SCOPED_TRACE("glWeightPointerOffset encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glWeightPointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &size, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &stride, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glMatrixIndexPointerOffset_enc(void *self , GLint size, GLenum type, GLsizei stride, GLuint offset)
+{
+	ENCODER_DEBUG_LOG("glMatrixIndexPointerOffset(size:%d, type:0x%08x, stride:%d, offset:%u)", size, type, stride, offset);
+	AEMU_SCOPED_TRACE("glMatrixIndexPointerOffset encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glMatrixIndexPointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &size, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &stride, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexPointerData_enc(void *self , GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
+{
+	ENCODER_DEBUG_LOG("glVertexPointerData(size:%d, type:0x%08x, stride:%d, data:0x%08x, datalen:%u)", size, type, stride, data, datalen);
+	AEMU_SCOPED_TRACE("glVertexPointerData encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data =  datalen;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_data + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexPointerData;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &size, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &stride, 4); ptr += 4;
+	memcpy(ptr, &__size_data, 4); ptr += 4;
+	 glUtilsPackPointerData((unsigned char *)ptr, (unsigned char *)data, size, type, stride, datalen);ptr += __size_data;
+		memcpy(ptr, &datalen, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glColorPointerData_enc(void *self , GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
+{
+	ENCODER_DEBUG_LOG("glColorPointerData(size:%d, type:0x%08x, stride:%d, data:0x%08x, datalen:%u)", size, type, stride, data, datalen);
+	AEMU_SCOPED_TRACE("glColorPointerData encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data =  datalen;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_data + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glColorPointerData;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &size, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &stride, 4); ptr += 4;
+	memcpy(ptr, &__size_data, 4); ptr += 4;
+	 glUtilsPackPointerData((unsigned char *)ptr, (unsigned char *)data, size, type, stride, datalen);ptr += __size_data;
+		memcpy(ptr, &datalen, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glNormalPointerData_enc(void *self , GLenum type, GLsizei stride, void* data, GLuint datalen)
+{
+	ENCODER_DEBUG_LOG("glNormalPointerData(type:0x%08x, stride:%d, data:0x%08x, datalen:%u)", type, stride, data, datalen);
+	AEMU_SCOPED_TRACE("glNormalPointerData encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data =  datalen;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_data + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glNormalPointerData;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &stride, 4); ptr += 4;
+	memcpy(ptr, &__size_data, 4); ptr += 4;
+	 glUtilsPackPointerData((unsigned char *)ptr, (unsigned char *)data, 3, type, stride, datalen);ptr += __size_data;
+		memcpy(ptr, &datalen, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexCoordPointerData_enc(void *self , GLint unit, GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
+{
+	ENCODER_DEBUG_LOG("glTexCoordPointerData(unit:%d, size:%d, type:0x%08x, stride:%d, data:0x%08x, datalen:%u)", unit, size, type, stride, data, datalen);
+	AEMU_SCOPED_TRACE("glTexCoordPointerData encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data =  datalen;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + __size_data + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexCoordPointerData;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &unit, 4); ptr += 4;
+		memcpy(ptr, &size, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &stride, 4); ptr += 4;
+	memcpy(ptr, &__size_data, 4); ptr += 4;
+	 glUtilsPackPointerData((unsigned char *)ptr, (unsigned char *)data, size, type, stride, datalen);ptr += __size_data;
+		memcpy(ptr, &datalen, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glPointSizePointerData_enc(void *self , GLenum type, GLsizei stride, void* data, GLuint datalen)
+{
+	ENCODER_DEBUG_LOG("glPointSizePointerData(type:0x%08x, stride:%d, data:0x%08x, datalen:%u)", type, stride, data, datalen);
+	AEMU_SCOPED_TRACE("glPointSizePointerData encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data =  datalen;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_data + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glPointSizePointerData;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &stride, 4); ptr += 4;
+	memcpy(ptr, &__size_data, 4); ptr += 4;
+	 glUtilsPackPointerData((unsigned char *)ptr, (unsigned char *)data, 1, type, stride, datalen);ptr += __size_data;
+		memcpy(ptr, &datalen, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glWeightPointerData_enc(void *self , GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
+{
+	ENCODER_DEBUG_LOG("glWeightPointerData(size:%d, type:0x%08x, stride:%d, data:0x%08x, datalen:%u)", size, type, stride, data, datalen);
+	AEMU_SCOPED_TRACE("glWeightPointerData encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data =  datalen;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_data + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glWeightPointerData;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &size, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &stride, 4); ptr += 4;
+	memcpy(ptr, &__size_data, 4); ptr += 4;
+	 glUtilsPackPointerData((unsigned char *)ptr, (unsigned char*)data, size, type, stride, datalen);ptr += __size_data;
+		memcpy(ptr, &datalen, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glMatrixIndexPointerData_enc(void *self , GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
+{
+	ENCODER_DEBUG_LOG("glMatrixIndexPointerData(size:%d, type:0x%08x, stride:%d, data:0x%08x, datalen:%u)", size, type, stride, data, datalen);
+	AEMU_SCOPED_TRACE("glMatrixIndexPointerData encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data =  datalen;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_data + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glMatrixIndexPointerData;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &size, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &stride, 4); ptr += 4;
+	memcpy(ptr, &__size_data, 4); ptr += 4;
+	 glUtilsPackPointerData((unsigned char *)ptr, (unsigned char*)data, size, type, stride, datalen);ptr += __size_data;
+		memcpy(ptr, &datalen, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawElementsOffset_enc(void *self , GLenum mode, GLsizei count, GLenum type, GLuint offset)
+{
+	ENCODER_DEBUG_LOG("glDrawElementsOffset(mode:0x%08x, count:%d, type:0x%08x, offset:%u)", mode, count, type, offset);
+	AEMU_SCOPED_TRACE("glDrawElementsOffset encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawElementsOffset;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawElementsData_enc(void *self , GLenum mode, GLsizei count, GLenum type, void* data, GLuint datalen)
+{
+	ENCODER_DEBUG_LOG("glDrawElementsData(mode:0x%08x, count:%d, type:0x%08x, data:0x%08x, datalen:%u)", mode, count, type, data, datalen);
+	AEMU_SCOPED_TRACE("glDrawElementsData encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data =  datalen;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_data + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawElementsData;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+	memcpy(ptr, &__size_data, 4); ptr += 4;
+	memcpy(ptr, data, __size_data);ptr += __size_data;
+		memcpy(ptr, &datalen, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetCompressedTextureFormats_enc(void *self , int count, GLint* formats)
+{
+	ENCODER_DEBUG_LOG("glGetCompressedTextureFormats(count:%d, formats:0x%08x)", count, formats);
+	AEMU_SCOPED_TRACE("glGetCompressedTextureFormats encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_formats =  (count * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetCompressedTextureFormats;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &count, 4); ptr += 4;
+	memcpy(ptr, &__size_formats, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(formats, __size_formats);
+	if (useChecksum) checksumCalculator->addBuffer(formats, __size_formats);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetCompressedTextureFormats: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+int glFinishRoundTrip_enc(void *self )
+{
+	ENCODER_DEBUG_LOG("glFinishRoundTrip()");
+	AEMU_SCOPED_TRACE("glFinishRoundTrip encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFinishRoundTrip;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	int retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glFinishRoundTrip: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glBlendEquationSeparateOES_enc(void *self , GLenum modeRGB, GLenum modeAlpha)
+{
+	ENCODER_DEBUG_LOG("glBlendEquationSeparateOES(modeRGB:0x%08x, modeAlpha:0x%08x)", modeRGB, modeAlpha);
+	AEMU_SCOPED_TRACE("glBlendEquationSeparateOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBlendEquationSeparateOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &modeRGB, 4); ptr += 4;
+		memcpy(ptr, &modeAlpha, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBlendFuncSeparateOES_enc(void *self , GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
+{
+	ENCODER_DEBUG_LOG("glBlendFuncSeparateOES(srcRGB:0x%08x, dstRGB:0x%08x, srcAlpha:0x%08x, dstAlpha:0x%08x)", srcRGB, dstRGB, srcAlpha, dstAlpha);
+	AEMU_SCOPED_TRACE("glBlendFuncSeparateOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBlendFuncSeparateOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &srcRGB, 4); ptr += 4;
+		memcpy(ptr, &dstRGB, 4); ptr += 4;
+		memcpy(ptr, &srcAlpha, 4); ptr += 4;
+		memcpy(ptr, &dstAlpha, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBlendEquationOES_enc(void *self , GLenum mode)
+{
+	ENCODER_DEBUG_LOG("glBlendEquationOES(mode:0x%08x)", mode);
+	AEMU_SCOPED_TRACE("glBlendEquationOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBlendEquationOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawTexsOES_enc(void *self , GLshort x, GLshort y, GLshort z, GLshort width, GLshort height)
+{
+	ENCODER_DEBUG_LOG("glDrawTexsOES(x:%d, y:%d, z:%d, width:%d, height:%d)", x, y, z, width, height);
+	AEMU_SCOPED_TRACE("glDrawTexsOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 2 + 2 + 2 + 2 + 2;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawTexsOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &x, 2); ptr += 2;
+		memcpy(ptr, &y, 2); ptr += 2;
+		memcpy(ptr, &z, 2); ptr += 2;
+		memcpy(ptr, &width, 2); ptr += 2;
+		memcpy(ptr, &height, 2); ptr += 2;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawTexiOES_enc(void *self , GLint x, GLint y, GLint z, GLint width, GLint height)
+{
+	ENCODER_DEBUG_LOG("glDrawTexiOES(x:%d, y:%d, z:%d, width:%d, height:%d)", x, y, z, width, height);
+	AEMU_SCOPED_TRACE("glDrawTexiOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawTexiOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &z, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawTexxOES_enc(void *self , GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height)
+{
+	ENCODER_DEBUG_LOG("glDrawTexxOES(x:0x%08x, y:0x%08x, z:0x%08x, width:0x%08x, height:0x%08x)", x, y, z, width, height);
+	AEMU_SCOPED_TRACE("glDrawTexxOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawTexxOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &z, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawTexsvOES_enc(void *self , const GLshort* coords)
+{
+	ENCODER_DEBUG_LOG("glDrawTexsvOES(coords:0x%08x)", coords);
+	AEMU_SCOPED_TRACE("glDrawTexsvOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_coords =  (5 * sizeof(GLshort));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + __size_coords + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawTexsvOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+	memcpy(ptr, &__size_coords, 4); ptr += 4;
+	memcpy(ptr, coords, __size_coords);ptr += __size_coords;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawTexivOES_enc(void *self , const GLint* coords)
+{
+	ENCODER_DEBUG_LOG("glDrawTexivOES(coords:0x%08x)", coords);
+	AEMU_SCOPED_TRACE("glDrawTexivOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_coords =  (5 * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + __size_coords + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawTexivOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+	memcpy(ptr, &__size_coords, 4); ptr += 4;
+	memcpy(ptr, coords, __size_coords);ptr += __size_coords;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawTexxvOES_enc(void *self , const GLfixed* coords)
+{
+	ENCODER_DEBUG_LOG("glDrawTexxvOES(coords:0x%08x)", coords);
+	AEMU_SCOPED_TRACE("glDrawTexxvOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_coords =  (5 * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + __size_coords + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawTexxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+	memcpy(ptr, &__size_coords, 4); ptr += 4;
+	memcpy(ptr, coords, __size_coords);ptr += __size_coords;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawTexfOES_enc(void *self , GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height)
+{
+	ENCODER_DEBUG_LOG("glDrawTexfOES(x:%f, y:%f, z:%f, width:%f, height:%f)", x, y, z, width, height);
+	AEMU_SCOPED_TRACE("glDrawTexfOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawTexfOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &z, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawTexfvOES_enc(void *self , const GLfloat* coords)
+{
+	ENCODER_DEBUG_LOG("glDrawTexfvOES(coords:0x%08x)", coords);
+	AEMU_SCOPED_TRACE("glDrawTexfvOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_coords =  (5 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + __size_coords + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawTexfvOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+	memcpy(ptr, &__size_coords, 4); ptr += 4;
+	memcpy(ptr, coords, __size_coords);ptr += __size_coords;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glEGLImageTargetTexture2DOES_enc(void *self , GLenum target, GLeglImageOES image)
+{
+	ENCODER_DEBUG_LOG("glEGLImageTargetTexture2DOES(target:0x%08x, image:%p)", target, image);
+	AEMU_SCOPED_TRACE("glEGLImageTargetTexture2DOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glEGLImageTargetTexture2DOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &image, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glEGLImageTargetRenderbufferStorageOES_enc(void *self , GLenum target, GLeglImageOES image)
+{
+	ENCODER_DEBUG_LOG("glEGLImageTargetRenderbufferStorageOES(target:0x%08x, image:%p)", target, image);
+	AEMU_SCOPED_TRACE("glEGLImageTargetRenderbufferStorageOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glEGLImageTargetRenderbufferStorageOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &image, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glAlphaFuncxOES_enc(void *self , GLenum func, GLclampx ref)
+{
+	ENCODER_DEBUG_LOG("glAlphaFuncxOES(func:0x%08x, ref:0x%08x)", func, ref);
+	AEMU_SCOPED_TRACE("glAlphaFuncxOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glAlphaFuncxOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &func, 4); ptr += 4;
+		memcpy(ptr, &ref, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glClearColorxOES_enc(void *self , GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha)
+{
+	ENCODER_DEBUG_LOG("glClearColorxOES(red:0x%08x, green:0x%08x, blue:0x%08x, alpha:0x%08x)", red, green, blue, alpha);
+	AEMU_SCOPED_TRACE("glClearColorxOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClearColorxOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &red, 4); ptr += 4;
+		memcpy(ptr, &green, 4); ptr += 4;
+		memcpy(ptr, &blue, 4); ptr += 4;
+		memcpy(ptr, &alpha, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glClearDepthxOES_enc(void *self , GLclampx depth)
+{
+	ENCODER_DEBUG_LOG("glClearDepthxOES(depth:0x%08x)", depth);
+	AEMU_SCOPED_TRACE("glClearDepthxOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClearDepthxOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &depth, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glClipPlanexOES_enc(void *self , GLenum plane, const GLfixed* equation)
+{
+	ENCODER_DEBUG_LOG("glClipPlanexOES(plane:0x%08x, equation:0x%08x)", plane, equation);
+	AEMU_SCOPED_TRACE("glClipPlanexOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_equation =  (4 * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_equation + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClipPlanexOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &plane, 4); ptr += 4;
+	memcpy(ptr, &__size_equation, 4); ptr += 4;
+	memcpy(ptr, equation, __size_equation);ptr += __size_equation;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glClipPlanexIMG_enc(void *self , GLenum plane, const GLfixed* equation)
+{
+	ENCODER_DEBUG_LOG("glClipPlanexIMG(plane:0x%08x, equation:0x%08x)", plane, equation);
+	AEMU_SCOPED_TRACE("glClipPlanexIMG encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_equation =  (4 * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_equation + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClipPlanexIMG;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &plane, 4); ptr += 4;
+	memcpy(ptr, &__size_equation, 4); ptr += 4;
+	memcpy(ptr, equation, __size_equation);ptr += __size_equation;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glColor4xOES_enc(void *self , GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
+{
+	ENCODER_DEBUG_LOG("glColor4xOES(red:0x%08x, green:0x%08x, blue:0x%08x, alpha:0x%08x)", red, green, blue, alpha);
+	AEMU_SCOPED_TRACE("glColor4xOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glColor4xOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &red, 4); ptr += 4;
+		memcpy(ptr, &green, 4); ptr += 4;
+		memcpy(ptr, &blue, 4); ptr += 4;
+		memcpy(ptr, &alpha, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDepthRangexOES_enc(void *self , GLclampx zNear, GLclampx zFar)
+{
+	ENCODER_DEBUG_LOG("glDepthRangexOES(zNear:0x%08x, zFar:0x%08x)", zNear, zFar);
+	AEMU_SCOPED_TRACE("glDepthRangexOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDepthRangexOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &zNear, 4); ptr += 4;
+		memcpy(ptr, &zFar, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glFogxOES_enc(void *self , GLenum pname, GLfixed param)
+{
+	ENCODER_DEBUG_LOG("glFogxOES(pname:0x%08x, param:0x%08x)", pname, param);
+	AEMU_SCOPED_TRACE("glFogxOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFogxOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glFogxvOES_enc(void *self , GLenum pname, const GLfixed* params)
+{
+	ENCODER_DEBUG_LOG("glFogxvOES(pname:0x%08x, params:0x%08x)", pname, params);
+	AEMU_SCOPED_TRACE("glFogxvOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFogxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glFrustumxOES_enc(void *self , GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
+{
+	ENCODER_DEBUG_LOG("glFrustumxOES(left:0x%08x, right:0x%08x, bottom:0x%08x, top:0x%08x, zNear:0x%08x, zFar:0x%08x)", left, right, bottom, top, zNear, zFar);
+	AEMU_SCOPED_TRACE("glFrustumxOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFrustumxOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &left, 4); ptr += 4;
+		memcpy(ptr, &right, 4); ptr += 4;
+		memcpy(ptr, &bottom, 4); ptr += 4;
+		memcpy(ptr, &top, 4); ptr += 4;
+		memcpy(ptr, &zNear, 4); ptr += 4;
+		memcpy(ptr, &zFar, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetClipPlanexOES_enc(void *self , GLenum pname, GLfixed* eqn)
+{
+	ENCODER_DEBUG_LOG("glGetClipPlanexOES(pname:0x%08x, eqn:0x%08x)", pname, eqn);
+	AEMU_SCOPED_TRACE("glGetClipPlanexOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_eqn =  (4 * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetClipPlanexOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_eqn, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(eqn, __size_eqn);
+	if (useChecksum) checksumCalculator->addBuffer(eqn, __size_eqn);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetClipPlanexOES: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetClipPlanex_enc(void *self , GLenum pname, GLfixed* eqn)
+{
+	ENCODER_DEBUG_LOG("glGetClipPlanex(pname:0x%08x, eqn:0x%08x)", pname, eqn);
+	AEMU_SCOPED_TRACE("glGetClipPlanex encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_eqn =  (4 * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetClipPlanex;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_eqn, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(eqn, __size_eqn);
+	if (useChecksum) checksumCalculator->addBuffer(eqn, __size_eqn);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetClipPlanex: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetFixedvOES_enc(void *self , GLenum pname, GLfixed* params)
+{
+	ENCODER_DEBUG_LOG("glGetFixedvOES(pname:0x%08x, params:0x%08x)", pname, params);
+	AEMU_SCOPED_TRACE("glGetFixedvOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetFixedvOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetFixedvOES: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetLightxvOES_enc(void *self , GLenum light, GLenum pname, GLfixed* params)
+{
+	ENCODER_DEBUG_LOG("glGetLightxvOES(light:0x%08x, pname:0x%08x, params:0x%08x)", light, pname, params);
+	AEMU_SCOPED_TRACE("glGetLightxvOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetLightxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &light, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetLightxvOES: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetMaterialxvOES_enc(void *self , GLenum face, GLenum pname, GLfixed* params)
+{
+	ENCODER_DEBUG_LOG("glGetMaterialxvOES(face:0x%08x, pname:0x%08x, params:0x%08x)", face, pname, params);
+	AEMU_SCOPED_TRACE("glGetMaterialxvOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetMaterialxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &face, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetMaterialxvOES: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetTexEnvxvOES_enc(void *self , GLenum env, GLenum pname, GLfixed* params)
+{
+	ENCODER_DEBUG_LOG("glGetTexEnvxvOES(env:0x%08x, pname:0x%08x, params:0x%08x)", env, pname, params);
+	AEMU_SCOPED_TRACE("glGetTexEnvxvOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetTexEnvxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &env, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetTexEnvxvOES: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetTexParameterxvOES_enc(void *self , GLenum target, GLenum pname, GLfixed* params)
+{
+	ENCODER_DEBUG_LOG("glGetTexParameterxvOES(target:0x%08x, pname:0x%08x, params:0x%08x)", target, pname, params);
+	AEMU_SCOPED_TRACE("glGetTexParameterxvOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetTexParameterxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetTexParameterxvOES: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glLightModelxOES_enc(void *self , GLenum pname, GLfixed param)
+{
+	ENCODER_DEBUG_LOG("glLightModelxOES(pname:0x%08x, param:0x%08x)", pname, param);
+	AEMU_SCOPED_TRACE("glLightModelxOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glLightModelxOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glLightModelxvOES_enc(void *self , GLenum pname, const GLfixed* params)
+{
+	ENCODER_DEBUG_LOG("glLightModelxvOES(pname:0x%08x, params:0x%08x)", pname, params);
+	AEMU_SCOPED_TRACE("glLightModelxvOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glLightModelxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glLightxOES_enc(void *self , GLenum light, GLenum pname, GLfixed param)
+{
+	ENCODER_DEBUG_LOG("glLightxOES(light:0x%08x, pname:0x%08x, param:0x%08x)", light, pname, param);
+	AEMU_SCOPED_TRACE("glLightxOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glLightxOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &light, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glLightxvOES_enc(void *self , GLenum light, GLenum pname, const GLfixed* params)
+{
+	ENCODER_DEBUG_LOG("glLightxvOES(light:0x%08x, pname:0x%08x, params:0x%08x)", light, pname, params);
+	AEMU_SCOPED_TRACE("glLightxvOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glLightxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &light, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glLineWidthxOES_enc(void *self , GLfixed width)
+{
+	ENCODER_DEBUG_LOG("glLineWidthxOES(width:0x%08x)", width);
+	AEMU_SCOPED_TRACE("glLineWidthxOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glLineWidthxOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &width, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glLoadMatrixxOES_enc(void *self , const GLfixed* m)
+{
+	ENCODER_DEBUG_LOG("glLoadMatrixxOES(m:0x%08x)", m);
+	AEMU_SCOPED_TRACE("glLoadMatrixxOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_m =  (16 * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + __size_m + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glLoadMatrixxOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+	memcpy(ptr, &__size_m, 4); ptr += 4;
+	memcpy(ptr, m, __size_m);ptr += __size_m;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glMaterialxOES_enc(void *self , GLenum face, GLenum pname, GLfixed param)
+{
+	ENCODER_DEBUG_LOG("glMaterialxOES(face:0x%08x, pname:0x%08x, param:0x%08x)", face, pname, param);
+	AEMU_SCOPED_TRACE("glMaterialxOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glMaterialxOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &face, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glMaterialxvOES_enc(void *self , GLenum face, GLenum pname, const GLfixed* params)
+{
+	ENCODER_DEBUG_LOG("glMaterialxvOES(face:0x%08x, pname:0x%08x, params:0x%08x)", face, pname, params);
+	AEMU_SCOPED_TRACE("glMaterialxvOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glMaterialxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &face, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glMultMatrixxOES_enc(void *self , const GLfixed* m)
+{
+	ENCODER_DEBUG_LOG("glMultMatrixxOES(m:0x%08x)", m);
+	AEMU_SCOPED_TRACE("glMultMatrixxOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_m =  (16 * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + __size_m + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glMultMatrixxOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+	memcpy(ptr, &__size_m, 4); ptr += 4;
+	memcpy(ptr, m, __size_m);ptr += __size_m;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glMultiTexCoord4xOES_enc(void *self , GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
+{
+	ENCODER_DEBUG_LOG("glMultiTexCoord4xOES(target:0x%08x, s:0x%08x, t:0x%08x, r:0x%08x, q:0x%08x)", target, s, t, r, q);
+	AEMU_SCOPED_TRACE("glMultiTexCoord4xOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glMultiTexCoord4xOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &s, 4); ptr += 4;
+		memcpy(ptr, &t, 4); ptr += 4;
+		memcpy(ptr, &r, 4); ptr += 4;
+		memcpy(ptr, &q, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glNormal3xOES_enc(void *self , GLfixed nx, GLfixed ny, GLfixed nz)
+{
+	ENCODER_DEBUG_LOG("glNormal3xOES(nx:0x%08x, ny:0x%08x, nz:0x%08x)", nx, ny, nz);
+	AEMU_SCOPED_TRACE("glNormal3xOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glNormal3xOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &nx, 4); ptr += 4;
+		memcpy(ptr, &ny, 4); ptr += 4;
+		memcpy(ptr, &nz, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glOrthoxOES_enc(void *self , GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
+{
+	ENCODER_DEBUG_LOG("glOrthoxOES(left:0x%08x, right:0x%08x, bottom:0x%08x, top:0x%08x, zNear:0x%08x, zFar:0x%08x)", left, right, bottom, top, zNear, zFar);
+	AEMU_SCOPED_TRACE("glOrthoxOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glOrthoxOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &left, 4); ptr += 4;
+		memcpy(ptr, &right, 4); ptr += 4;
+		memcpy(ptr, &bottom, 4); ptr += 4;
+		memcpy(ptr, &top, 4); ptr += 4;
+		memcpy(ptr, &zNear, 4); ptr += 4;
+		memcpy(ptr, &zFar, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glPointParameterxOES_enc(void *self , GLenum pname, GLfixed param)
+{
+	ENCODER_DEBUG_LOG("glPointParameterxOES(pname:0x%08x, param:0x%08x)", pname, param);
+	AEMU_SCOPED_TRACE("glPointParameterxOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glPointParameterxOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glPointParameterxvOES_enc(void *self , GLenum pname, const GLfixed* params)
+{
+	ENCODER_DEBUG_LOG("glPointParameterxvOES(pname:0x%08x, params:0x%08x)", pname, params);
+	AEMU_SCOPED_TRACE("glPointParameterxvOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glPointParameterxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glPointSizexOES_enc(void *self , GLfixed size)
+{
+	ENCODER_DEBUG_LOG("glPointSizexOES(size:0x%08x)", size);
+	AEMU_SCOPED_TRACE("glPointSizexOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glPointSizexOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &size, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glPolygonOffsetxOES_enc(void *self , GLfixed factor, GLfixed units)
+{
+	ENCODER_DEBUG_LOG("glPolygonOffsetxOES(factor:0x%08x, units:0x%08x)", factor, units);
+	AEMU_SCOPED_TRACE("glPolygonOffsetxOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glPolygonOffsetxOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &factor, 4); ptr += 4;
+		memcpy(ptr, &units, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glRotatexOES_enc(void *self , GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
+{
+	ENCODER_DEBUG_LOG("glRotatexOES(angle:0x%08x, x:0x%08x, y:0x%08x, z:0x%08x)", angle, x, y, z);
+	AEMU_SCOPED_TRACE("glRotatexOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glRotatexOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &angle, 4); ptr += 4;
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &z, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glSampleCoveragexOES_enc(void *self , GLclampx value, GLboolean invert)
+{
+	ENCODER_DEBUG_LOG("glSampleCoveragexOES(value:0x%08x, invert:%d)", value, invert);
+	AEMU_SCOPED_TRACE("glSampleCoveragexOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 1;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glSampleCoveragexOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &value, 4); ptr += 4;
+		memcpy(ptr, &invert, 1); ptr += 1;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glScalexOES_enc(void *self , GLfixed x, GLfixed y, GLfixed z)
+{
+	ENCODER_DEBUG_LOG("glScalexOES(x:0x%08x, y:0x%08x, z:0x%08x)", x, y, z);
+	AEMU_SCOPED_TRACE("glScalexOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glScalexOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &z, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexEnvxOES_enc(void *self , GLenum target, GLenum pname, GLfixed param)
+{
+	ENCODER_DEBUG_LOG("glTexEnvxOES(target:0x%08x, pname:0x%08x, param:0x%08x)", target, pname, param);
+	AEMU_SCOPED_TRACE("glTexEnvxOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexEnvxOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexEnvxvOES_enc(void *self , GLenum target, GLenum pname, const GLfixed* params)
+{
+	ENCODER_DEBUG_LOG("glTexEnvxvOES(target:0x%08x, pname:0x%08x, params:0x%08x)", target, pname, params);
+	AEMU_SCOPED_TRACE("glTexEnvxvOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexEnvxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexParameterxOES_enc(void *self , GLenum target, GLenum pname, GLfixed param)
+{
+	ENCODER_DEBUG_LOG("glTexParameterxOES(target:0x%08x, pname:0x%08x, param:0x%08x)", target, pname, param);
+	AEMU_SCOPED_TRACE("glTexParameterxOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexParameterxOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexParameterxvOES_enc(void *self , GLenum target, GLenum pname, const GLfixed* params)
+{
+	ENCODER_DEBUG_LOG("glTexParameterxvOES(target:0x%08x, pname:0x%08x, params:0x%08x)", target, pname, params);
+	AEMU_SCOPED_TRACE("glTexParameterxvOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexParameterxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTranslatexOES_enc(void *self , GLfixed x, GLfixed y, GLfixed z)
+{
+	ENCODER_DEBUG_LOG("glTranslatexOES(x:0x%08x, y:0x%08x, z:0x%08x)", x, y, z);
+	AEMU_SCOPED_TRACE("glTranslatexOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTranslatexOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &z, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+GLboolean glIsRenderbufferOES_enc(void *self , GLuint renderbuffer)
+{
+	ENCODER_DEBUG_LOG("glIsRenderbufferOES(renderbuffer:%u)", renderbuffer);
+	AEMU_SCOPED_TRACE("glIsRenderbufferOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glIsRenderbufferOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &renderbuffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glIsRenderbufferOES: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glBindRenderbufferOES_enc(void *self , GLenum target, GLuint renderbuffer)
+{
+	ENCODER_DEBUG_LOG("glBindRenderbufferOES(target:0x%08x, renderbuffer:%u)", target, renderbuffer);
+	AEMU_SCOPED_TRACE("glBindRenderbufferOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBindRenderbufferOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &renderbuffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDeleteRenderbuffersOES_enc(void *self , GLsizei n, const GLuint* renderbuffers)
+{
+	ENCODER_DEBUG_LOG("glDeleteRenderbuffersOES(n:%d, renderbuffers:0x%08x)", n, renderbuffers);
+	AEMU_SCOPED_TRACE("glDeleteRenderbuffersOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_renderbuffers =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_renderbuffers + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDeleteRenderbuffersOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_renderbuffers, 4); ptr += 4;
+	memcpy(ptr, renderbuffers, __size_renderbuffers);ptr += __size_renderbuffers;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGenRenderbuffersOES_enc(void *self , GLsizei n, GLuint* renderbuffers)
+{
+	ENCODER_DEBUG_LOG("glGenRenderbuffersOES(n:%d, renderbuffers:0x%08x)", n, renderbuffers);
+	AEMU_SCOPED_TRACE("glGenRenderbuffersOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_renderbuffers =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGenRenderbuffersOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_renderbuffers, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(renderbuffers, __size_renderbuffers);
+	if (useChecksum) checksumCalculator->addBuffer(renderbuffers, __size_renderbuffers);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGenRenderbuffersOES: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glRenderbufferStorageOES_enc(void *self , GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
+{
+	ENCODER_DEBUG_LOG("glRenderbufferStorageOES(target:0x%08x, internalformat:0x%08x, width:%d, height:%d)", target, internalformat, width, height);
+	AEMU_SCOPED_TRACE("glRenderbufferStorageOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glRenderbufferStorageOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &internalformat, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetRenderbufferParameterivOES_enc(void *self , GLenum target, GLenum pname, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glGetRenderbufferParameterivOES(target:0x%08x, pname:0x%08x, params:0x%08x)", target, pname, params);
+	AEMU_SCOPED_TRACE("glGetRenderbufferParameterivOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetRenderbufferParameterivOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetRenderbufferParameterivOES: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+GLboolean glIsFramebufferOES_enc(void *self , GLuint framebuffer)
+{
+	ENCODER_DEBUG_LOG("glIsFramebufferOES(framebuffer:%u)", framebuffer);
+	AEMU_SCOPED_TRACE("glIsFramebufferOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glIsFramebufferOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &framebuffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glIsFramebufferOES: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glBindFramebufferOES_enc(void *self , GLenum target, GLuint framebuffer)
+{
+	ENCODER_DEBUG_LOG("glBindFramebufferOES(target:0x%08x, framebuffer:%u)", target, framebuffer);
+	AEMU_SCOPED_TRACE("glBindFramebufferOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBindFramebufferOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &framebuffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDeleteFramebuffersOES_enc(void *self , GLsizei n, const GLuint* framebuffers)
+{
+	ENCODER_DEBUG_LOG("glDeleteFramebuffersOES(n:%d, framebuffers:0x%08x)", n, framebuffers);
+	AEMU_SCOPED_TRACE("glDeleteFramebuffersOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_framebuffers =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_framebuffers + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDeleteFramebuffersOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_framebuffers, 4); ptr += 4;
+	memcpy(ptr, framebuffers, __size_framebuffers);ptr += __size_framebuffers;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGenFramebuffersOES_enc(void *self , GLsizei n, GLuint* framebuffers)
+{
+	ENCODER_DEBUG_LOG("glGenFramebuffersOES(n:%d, framebuffers:0x%08x)", n, framebuffers);
+	AEMU_SCOPED_TRACE("glGenFramebuffersOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_framebuffers =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGenFramebuffersOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_framebuffers, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(framebuffers, __size_framebuffers);
+	if (useChecksum) checksumCalculator->addBuffer(framebuffers, __size_framebuffers);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGenFramebuffersOES: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+GLenum glCheckFramebufferStatusOES_enc(void *self , GLenum target)
+{
+	ENCODER_DEBUG_LOG("glCheckFramebufferStatusOES(target:0x%08x)", target);
+	AEMU_SCOPED_TRACE("glCheckFramebufferStatusOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glCheckFramebufferStatusOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLenum retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glCheckFramebufferStatusOES: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glFramebufferRenderbufferOES_enc(void *self , GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
+{
+	ENCODER_DEBUG_LOG("glFramebufferRenderbufferOES(target:0x%08x, attachment:0x%08x, renderbuffertarget:0x%08x, renderbuffer:%u)", target, attachment, renderbuffertarget, renderbuffer);
+	AEMU_SCOPED_TRACE("glFramebufferRenderbufferOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFramebufferRenderbufferOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &attachment, 4); ptr += 4;
+		memcpy(ptr, &renderbuffertarget, 4); ptr += 4;
+		memcpy(ptr, &renderbuffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glFramebufferTexture2DOES_enc(void *self , GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
+{
+	ENCODER_DEBUG_LOG("glFramebufferTexture2DOES(target:0x%08x, attachment:0x%08x, textarget:0x%08x, texture:%u, level:%d)", target, attachment, textarget, texture, level);
+	AEMU_SCOPED_TRACE("glFramebufferTexture2DOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFramebufferTexture2DOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &attachment, 4); ptr += 4;
+		memcpy(ptr, &textarget, 4); ptr += 4;
+		memcpy(ptr, &texture, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetFramebufferAttachmentParameterivOES_enc(void *self , GLenum target, GLenum attachment, GLenum pname, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glGetFramebufferAttachmentParameterivOES(target:0x%08x, attachment:0x%08x, pname:0x%08x, params:0x%08x)", target, attachment, pname, params);
+	AEMU_SCOPED_TRACE("glGetFramebufferAttachmentParameterivOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetFramebufferAttachmentParameterivOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &attachment, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetFramebufferAttachmentParameterivOES: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGenerateMipmapOES_enc(void *self , GLenum target)
+{
+	ENCODER_DEBUG_LOG("glGenerateMipmapOES(target:0x%08x)", target);
+	AEMU_SCOPED_TRACE("glGenerateMipmapOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGenerateMipmapOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+GLboolean glUnmapBufferOES_enc(void *self , GLenum target)
+{
+	ENCODER_DEBUG_LOG("glUnmapBufferOES(target:0x%08x)", target);
+	AEMU_SCOPED_TRACE("glUnmapBufferOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUnmapBufferOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glUnmapBufferOES: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glCurrentPaletteMatrixOES_enc(void *self , GLuint matrixpaletteindex)
+{
+	ENCODER_DEBUG_LOG("glCurrentPaletteMatrixOES(matrixpaletteindex:%u)", matrixpaletteindex);
+	AEMU_SCOPED_TRACE("glCurrentPaletteMatrixOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glCurrentPaletteMatrixOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &matrixpaletteindex, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glLoadPaletteFromModelViewMatrixOES_enc(void *self )
+{
+	ENCODER_DEBUG_LOG("glLoadPaletteFromModelViewMatrixOES()");
+	AEMU_SCOPED_TRACE("glLoadPaletteFromModelViewMatrixOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glLoadPaletteFromModelViewMatrixOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+GLbitfield glQueryMatrixxOES_enc(void *self , GLfixed* mantissa, GLint* exponent)
+{
+	ENCODER_DEBUG_LOG("glQueryMatrixxOES(mantissa:0x%08x, exponent:0x%08x)", mantissa, exponent);
+	AEMU_SCOPED_TRACE("glQueryMatrixxOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_mantissa =  (16 * sizeof(GLfixed));
+	const unsigned int __size_exponent =  (16 * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 0 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glQueryMatrixxOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+	memcpy(ptr, &__size_mantissa, 4); ptr += 4;
+	memcpy(ptr, &__size_exponent, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(mantissa, __size_mantissa);
+	if (useChecksum) checksumCalculator->addBuffer(mantissa, __size_mantissa);
+	stream->readback(exponent, __size_exponent);
+	if (useChecksum) checksumCalculator->addBuffer(exponent, __size_exponent);
+
+	GLbitfield retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glQueryMatrixxOES: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glDepthRangefOES_enc(void *self , GLclampf zNear, GLclampf zFar)
+{
+	ENCODER_DEBUG_LOG("glDepthRangefOES(zNear:%f, zFar:%f)", zNear, zFar);
+	AEMU_SCOPED_TRACE("glDepthRangefOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDepthRangefOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &zNear, 4); ptr += 4;
+		memcpy(ptr, &zFar, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glFrustumfOES_enc(void *self , GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
+{
+	ENCODER_DEBUG_LOG("glFrustumfOES(left:%f, right:%f, bottom:%f, top:%f, zNear:%f, zFar:%f)", left, right, bottom, top, zNear, zFar);
+	AEMU_SCOPED_TRACE("glFrustumfOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFrustumfOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &left, 4); ptr += 4;
+		memcpy(ptr, &right, 4); ptr += 4;
+		memcpy(ptr, &bottom, 4); ptr += 4;
+		memcpy(ptr, &top, 4); ptr += 4;
+		memcpy(ptr, &zNear, 4); ptr += 4;
+		memcpy(ptr, &zFar, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glOrthofOES_enc(void *self , GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
+{
+	ENCODER_DEBUG_LOG("glOrthofOES(left:%f, right:%f, bottom:%f, top:%f, zNear:%f, zFar:%f)", left, right, bottom, top, zNear, zFar);
+	AEMU_SCOPED_TRACE("glOrthofOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glOrthofOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &left, 4); ptr += 4;
+		memcpy(ptr, &right, 4); ptr += 4;
+		memcpy(ptr, &bottom, 4); ptr += 4;
+		memcpy(ptr, &top, 4); ptr += 4;
+		memcpy(ptr, &zNear, 4); ptr += 4;
+		memcpy(ptr, &zFar, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glClipPlanefOES_enc(void *self , GLenum plane, const GLfloat* equation)
+{
+	ENCODER_DEBUG_LOG("glClipPlanefOES(plane:0x%08x, equation:0x%08x)", plane, equation);
+	AEMU_SCOPED_TRACE("glClipPlanefOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_equation =  (4 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_equation + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClipPlanefOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &plane, 4); ptr += 4;
+	memcpy(ptr, &__size_equation, 4); ptr += 4;
+	memcpy(ptr, equation, __size_equation);ptr += __size_equation;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glClipPlanefIMG_enc(void *self , GLenum plane, const GLfloat* equation)
+{
+	ENCODER_DEBUG_LOG("glClipPlanefIMG(plane:0x%08x, equation:0x%08x)", plane, equation);
+	AEMU_SCOPED_TRACE("glClipPlanefIMG encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_equation =  (4 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_equation + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClipPlanefIMG;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &plane, 4); ptr += 4;
+	memcpy(ptr, &__size_equation, 4); ptr += 4;
+	memcpy(ptr, equation, __size_equation);ptr += __size_equation;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetClipPlanefOES_enc(void *self , GLenum pname, GLfloat* eqn)
+{
+	ENCODER_DEBUG_LOG("glGetClipPlanefOES(pname:0x%08x, eqn:0x%08x)", pname, eqn);
+	AEMU_SCOPED_TRACE("glGetClipPlanefOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_eqn =  (4 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetClipPlanefOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_eqn, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(eqn, __size_eqn);
+	if (useChecksum) checksumCalculator->addBuffer(eqn, __size_eqn);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetClipPlanefOES: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glClearDepthfOES_enc(void *self , GLclampf depth)
+{
+	ENCODER_DEBUG_LOG("glClearDepthfOES(depth:%f)", depth);
+	AEMU_SCOPED_TRACE("glClearDepthfOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClearDepthfOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &depth, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexGenfOES_enc(void *self , GLenum coord, GLenum pname, GLfloat param)
+{
+	ENCODER_DEBUG_LOG("glTexGenfOES(coord:0x%08x, pname:0x%08x, param:%f)", coord, pname, param);
+	AEMU_SCOPED_TRACE("glTexGenfOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexGenfOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &coord, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexGenfvOES_enc(void *self , GLenum coord, GLenum pname, const GLfloat* params)
+{
+	ENCODER_DEBUG_LOG("glTexGenfvOES(coord:0x%08x, pname:0x%08x, params:0x%08x)", coord, pname, params);
+	AEMU_SCOPED_TRACE("glTexGenfvOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexGenfvOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &coord, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexGeniOES_enc(void *self , GLenum coord, GLenum pname, GLint param)
+{
+	ENCODER_DEBUG_LOG("glTexGeniOES(coord:0x%08x, pname:0x%08x, param:%d)", coord, pname, param);
+	AEMU_SCOPED_TRACE("glTexGeniOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexGeniOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &coord, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexGenivOES_enc(void *self , GLenum coord, GLenum pname, const GLint* params)
+{
+	ENCODER_DEBUG_LOG("glTexGenivOES(coord:0x%08x, pname:0x%08x, params:0x%08x)", coord, pname, params);
+	AEMU_SCOPED_TRACE("glTexGenivOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexGenivOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &coord, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexGenxOES_enc(void *self , GLenum coord, GLenum pname, GLfixed param)
+{
+	ENCODER_DEBUG_LOG("glTexGenxOES(coord:0x%08x, pname:0x%08x, param:0x%08x)", coord, pname, param);
+	AEMU_SCOPED_TRACE("glTexGenxOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexGenxOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &coord, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexGenxvOES_enc(void *self , GLenum coord, GLenum pname, const GLfixed* params)
+{
+	ENCODER_DEBUG_LOG("glTexGenxvOES(coord:0x%08x, pname:0x%08x, params:0x%08x)", coord, pname, params);
+	AEMU_SCOPED_TRACE("glTexGenxvOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexGenxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &coord, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetTexGenfvOES_enc(void *self , GLenum coord, GLenum pname, GLfloat* params)
+{
+	ENCODER_DEBUG_LOG("glGetTexGenfvOES(coord:0x%08x, pname:0x%08x, params:0x%08x)", coord, pname, params);
+	AEMU_SCOPED_TRACE("glGetTexGenfvOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetTexGenfvOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &coord, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetTexGenivOES_enc(void *self , GLenum coord, GLenum pname, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glGetTexGenivOES(coord:0x%08x, pname:0x%08x, params:0x%08x)", coord, pname, params);
+	AEMU_SCOPED_TRACE("glGetTexGenivOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetTexGenivOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &coord, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetTexGenxvOES_enc(void *self , GLenum coord, GLenum pname, GLfixed* params)
+{
+	ENCODER_DEBUG_LOG("glGetTexGenxvOES(coord:0x%08x, pname:0x%08x, params:0x%08x)", coord, pname, params);
+	AEMU_SCOPED_TRACE("glGetTexGenxvOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetTexGenxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &coord, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBindVertexArrayOES_enc(void *self , GLuint array)
+{
+	ENCODER_DEBUG_LOG("glBindVertexArrayOES(array:%u)", array);
+	AEMU_SCOPED_TRACE("glBindVertexArrayOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBindVertexArrayOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &array, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDeleteVertexArraysOES_enc(void *self , GLsizei n, const GLuint* arrays)
+{
+	ENCODER_DEBUG_LOG("glDeleteVertexArraysOES(n:%d, arrays:0x%08x)", n, arrays);
+	AEMU_SCOPED_TRACE("glDeleteVertexArraysOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_arrays =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_arrays + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDeleteVertexArraysOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_arrays, 4); ptr += 4;
+	memcpy(ptr, arrays, __size_arrays);ptr += __size_arrays;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGenVertexArraysOES_enc(void *self , GLsizei n, GLuint* arrays)
+{
+	ENCODER_DEBUG_LOG("glGenVertexArraysOES(n:%d, arrays:0x%08x)", n, arrays);
+	AEMU_SCOPED_TRACE("glGenVertexArraysOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_arrays =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGenVertexArraysOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_arrays, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(arrays, __size_arrays);
+	if (useChecksum) checksumCalculator->addBuffer(arrays, __size_arrays);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGenVertexArraysOES: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+GLboolean glIsVertexArrayOES_enc(void *self , GLuint array)
+{
+	ENCODER_DEBUG_LOG("glIsVertexArrayOES(array:%u)", array);
+	AEMU_SCOPED_TRACE("glIsVertexArrayOES encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glIsVertexArrayOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &array, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glIsVertexArrayOES: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glDiscardFramebufferEXT_enc(void *self , GLenum target, GLsizei numAttachments, const GLenum* attachments)
+{
+	ENCODER_DEBUG_LOG("glDiscardFramebufferEXT(target:0x%08x, numAttachments:%d, attachments:0x%08x)", target, numAttachments, attachments);
+	AEMU_SCOPED_TRACE("glDiscardFramebufferEXT encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_attachments =  (numAttachments * sizeof(const GLenum));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_attachments + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDiscardFramebufferEXT;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &numAttachments, 4); ptr += 4;
+	memcpy(ptr, &__size_attachments, 4); ptr += 4;
+	memcpy(ptr, attachments, __size_attachments);ptr += __size_attachments;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glRenderbufferStorageMultisampleIMG_enc(void *self , GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
+{
+	ENCODER_DEBUG_LOG("glRenderbufferStorageMultisampleIMG(target:0x%08x, samples:%d, internalformat:0x%08x, width:%d, height:%d)", target, samples, internalformat, width, height);
+	AEMU_SCOPED_TRACE("glRenderbufferStorageMultisampleIMG encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glRenderbufferStorageMultisampleIMG;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &samples, 4); ptr += 4;
+		memcpy(ptr, &internalformat, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glFramebufferTexture2DMultisampleIMG_enc(void *self , GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples)
+{
+	ENCODER_DEBUG_LOG("glFramebufferTexture2DMultisampleIMG(target:0x%08x, attachment:0x%08x, textarget:0x%08x, texture:%u, level:%d, samples:%d)", target, attachment, textarget, texture, level, samples);
+	AEMU_SCOPED_TRACE("glFramebufferTexture2DMultisampleIMG encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFramebufferTexture2DMultisampleIMG;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &attachment, 4); ptr += 4;
+		memcpy(ptr, &textarget, 4); ptr += 4;
+		memcpy(ptr, &texture, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &samples, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDeleteFencesNV_enc(void *self , GLsizei n, const GLuint* fences)
+{
+	ENCODER_DEBUG_LOG("glDeleteFencesNV(n:%d, fences:0x%08x)", n, fences);
+	AEMU_SCOPED_TRACE("glDeleteFencesNV encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_fences =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_fences + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDeleteFencesNV;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_fences, 4); ptr += 4;
+	memcpy(ptr, fences, __size_fences);ptr += __size_fences;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGenFencesNV_enc(void *self , GLsizei n, GLuint* fences)
+{
+	ENCODER_DEBUG_LOG("glGenFencesNV(n:%d, fences:0x%08x)", n, fences);
+	AEMU_SCOPED_TRACE("glGenFencesNV encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_fences =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_fences + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGenFencesNV;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_fences, 4); ptr += 4;
+	memcpy(ptr, fences, __size_fences);ptr += __size_fences;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+GLboolean glIsFenceNV_enc(void *self , GLuint fence)
+{
+	ENCODER_DEBUG_LOG("glIsFenceNV(fence:%u)", fence);
+	AEMU_SCOPED_TRACE("glIsFenceNV encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glIsFenceNV;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &fence, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glIsFenceNV: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+GLboolean glTestFenceNV_enc(void *self , GLuint fence)
+{
+	ENCODER_DEBUG_LOG("glTestFenceNV(fence:%u)", fence);
+	AEMU_SCOPED_TRACE("glTestFenceNV encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTestFenceNV;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &fence, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glTestFenceNV: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glGetFenceivNV_enc(void *self , GLuint fence, GLenum pname, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glGetFenceivNV(fence:%u, pname:0x%08x, params:0x%08x)", fence, pname, params);
+	AEMU_SCOPED_TRACE("glGetFenceivNV encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetFenceivNV;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &fence, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetFenceivNV: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glFinishFenceNV_enc(void *self , GLuint fence)
+{
+	ENCODER_DEBUG_LOG("glFinishFenceNV(fence:%u)", fence);
+	AEMU_SCOPED_TRACE("glFinishFenceNV encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFinishFenceNV;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &fence, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glSetFenceNV_enc(void *self , GLuint fence, GLenum condition)
+{
+	ENCODER_DEBUG_LOG("glSetFenceNV(fence:%u, condition:0x%08x)", fence, condition);
+	AEMU_SCOPED_TRACE("glSetFenceNV encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glSetFenceNV;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &fence, 4); ptr += 4;
+		memcpy(ptr, &condition, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetDriverControlsQCOM_enc(void *self , GLint* num, GLsizei size, GLuint* driverControls)
+{
+	ENCODER_DEBUG_LOG("glGetDriverControlsQCOM(num:0x%08x, size:%d, driverControls:0x%08x)", num, size, driverControls);
+	AEMU_SCOPED_TRACE("glGetDriverControlsQCOM encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_num =  (1 * sizeof(GLint));
+	const unsigned int __size_driverControls =  (size * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 0 + 4 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetDriverControlsQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+	memcpy(ptr, &__size_num, 4); ptr += 4;
+		memcpy(ptr, &size, 4); ptr += 4;
+	memcpy(ptr, &__size_driverControls, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(num, __size_num);
+	if (useChecksum) checksumCalculator->addBuffer(num, __size_num);
+	stream->readback(driverControls, __size_driverControls);
+	if (useChecksum) checksumCalculator->addBuffer(driverControls, __size_driverControls);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetDriverControlsQCOM: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetDriverControlStringQCOM_enc(void *self , GLuint driverControl, GLsizei bufSize, GLsizei* length, GLchar* driverControlString)
+{
+	ENCODER_DEBUG_LOG("glGetDriverControlStringQCOM(driverControl:%u, bufSize:%d, length:0x%08x, driverControlString:0x%08x)", driverControl, bufSize, length, driverControlString);
+	AEMU_SCOPED_TRACE("glGetDriverControlStringQCOM encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_length =  (1 * sizeof(GLsizei));
+	const unsigned int __size_driverControlString =  (1 * sizeof(GLchar));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetDriverControlStringQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &driverControl, 4); ptr += 4;
+		memcpy(ptr, &bufSize, 4); ptr += 4;
+	memcpy(ptr, &__size_length, 4); ptr += 4;
+	memcpy(ptr, &__size_driverControlString, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(length, __size_length);
+	if (useChecksum) checksumCalculator->addBuffer(length, __size_length);
+	stream->readback(driverControlString, __size_driverControlString);
+	if (useChecksum) checksumCalculator->addBuffer(driverControlString, __size_driverControlString);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetDriverControlStringQCOM: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glEnableDriverControlQCOM_enc(void *self , GLuint driverControl)
+{
+	ENCODER_DEBUG_LOG("glEnableDriverControlQCOM(driverControl:%u)", driverControl);
+	AEMU_SCOPED_TRACE("glEnableDriverControlQCOM encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glEnableDriverControlQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &driverControl, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDisableDriverControlQCOM_enc(void *self , GLuint driverControl)
+{
+	ENCODER_DEBUG_LOG("glDisableDriverControlQCOM(driverControl:%u)", driverControl);
+	AEMU_SCOPED_TRACE("glDisableDriverControlQCOM encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDisableDriverControlQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &driverControl, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glExtGetTexturesQCOM_enc(void *self , GLuint* textures, GLint maxTextures, GLint* numTextures)
+{
+	ENCODER_DEBUG_LOG("glExtGetTexturesQCOM(textures:0x%08x, maxTextures:%d, numTextures:0x%08x)", textures, maxTextures, numTextures);
+	AEMU_SCOPED_TRACE("glExtGetTexturesQCOM encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_textures =  (maxTextures * sizeof(GLuint));
+	const unsigned int __size_numTextures =  (1 * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 0 + 4 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glExtGetTexturesQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+	memcpy(ptr, &__size_textures, 4); ptr += 4;
+		memcpy(ptr, &maxTextures, 4); ptr += 4;
+	memcpy(ptr, &__size_numTextures, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(textures, __size_textures);
+	if (useChecksum) checksumCalculator->addBuffer(textures, __size_textures);
+	stream->readback(numTextures, __size_numTextures);
+	if (useChecksum) checksumCalculator->addBuffer(numTextures, __size_numTextures);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glExtGetTexturesQCOM: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glExtGetBuffersQCOM_enc(void *self , GLuint* buffers, GLint maxBuffers, GLint* numBuffers)
+{
+	ENCODER_DEBUG_LOG("glExtGetBuffersQCOM(buffers:0x%08x, maxBuffers:%d, numBuffers:0x%08x)", buffers, maxBuffers, numBuffers);
+	AEMU_SCOPED_TRACE("glExtGetBuffersQCOM encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_buffers =  (maxBuffers * sizeof(GLuint));
+	const unsigned int __size_numBuffers =  (1 * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 0 + 4 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glExtGetBuffersQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+	memcpy(ptr, &__size_buffers, 4); ptr += 4;
+		memcpy(ptr, &maxBuffers, 4); ptr += 4;
+	memcpy(ptr, &__size_numBuffers, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(buffers, __size_buffers);
+	if (useChecksum) checksumCalculator->addBuffer(buffers, __size_buffers);
+	stream->readback(numBuffers, __size_numBuffers);
+	if (useChecksum) checksumCalculator->addBuffer(numBuffers, __size_numBuffers);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glExtGetBuffersQCOM: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glExtGetRenderbuffersQCOM_enc(void *self , GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers)
+{
+	ENCODER_DEBUG_LOG("glExtGetRenderbuffersQCOM(renderbuffers:0x%08x, maxRenderbuffers:%d, numRenderbuffers:0x%08x)", renderbuffers, maxRenderbuffers, numRenderbuffers);
+	AEMU_SCOPED_TRACE("glExtGetRenderbuffersQCOM encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_renderbuffers =  (maxRenderbuffers * sizeof(GLuint));
+	const unsigned int __size_numRenderbuffers =  (1 * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 0 + 4 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glExtGetRenderbuffersQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+	memcpy(ptr, &__size_renderbuffers, 4); ptr += 4;
+		memcpy(ptr, &maxRenderbuffers, 4); ptr += 4;
+	memcpy(ptr, &__size_numRenderbuffers, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(renderbuffers, __size_renderbuffers);
+	if (useChecksum) checksumCalculator->addBuffer(renderbuffers, __size_renderbuffers);
+	stream->readback(numRenderbuffers, __size_numRenderbuffers);
+	if (useChecksum) checksumCalculator->addBuffer(numRenderbuffers, __size_numRenderbuffers);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glExtGetRenderbuffersQCOM: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glExtGetFramebuffersQCOM_enc(void *self , GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers)
+{
+	ENCODER_DEBUG_LOG("glExtGetFramebuffersQCOM(framebuffers:0x%08x, maxFramebuffers:%d, numFramebuffers:0x%08x)", framebuffers, maxFramebuffers, numFramebuffers);
+	AEMU_SCOPED_TRACE("glExtGetFramebuffersQCOM encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_framebuffers =  (maxFramebuffers * sizeof(GLuint));
+	const unsigned int __size_numFramebuffers =  (1 * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 0 + 4 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glExtGetFramebuffersQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+	memcpy(ptr, &__size_framebuffers, 4); ptr += 4;
+		memcpy(ptr, &maxFramebuffers, 4); ptr += 4;
+	memcpy(ptr, &__size_numFramebuffers, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(framebuffers, __size_framebuffers);
+	if (useChecksum) checksumCalculator->addBuffer(framebuffers, __size_framebuffers);
+	stream->readback(numFramebuffers, __size_numFramebuffers);
+	if (useChecksum) checksumCalculator->addBuffer(numFramebuffers, __size_numFramebuffers);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glExtGetFramebuffersQCOM: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glExtGetTexLevelParameterivQCOM_enc(void *self , GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glExtGetTexLevelParameterivQCOM(texture:%u, face:0x%08x, level:%d, pname:0x%08x, params:0x%08x)", texture, face, level, pname, params);
+	AEMU_SCOPED_TRACE("glExtGetTexLevelParameterivQCOM encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glExtGetTexLevelParameterivQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &texture, 4); ptr += 4;
+		memcpy(ptr, &face, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glExtGetTexLevelParameterivQCOM: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glExtTexObjectStateOverrideiQCOM_enc(void *self , GLenum target, GLenum pname, GLint param)
+{
+	ENCODER_DEBUG_LOG("glExtTexObjectStateOverrideiQCOM(target:0x%08x, pname:0x%08x, param:%d)", target, pname, param);
+	AEMU_SCOPED_TRACE("glExtTexObjectStateOverrideiQCOM encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glExtTexObjectStateOverrideiQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glExtGetTexSubImageQCOM_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid* texels)
+{
+	ENCODER_DEBUG_LOG("glExtGetTexSubImageQCOM(target:0x%08x, level:%d, xoffset:%d, yoffset:%d, zoffset:%d, width:%d, height:%d, depth:%d, format:0x%08x, type:0x%08x, texels:0x%08x)", target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, texels);
+	AEMU_SCOPED_TRACE("glExtGetTexSubImageQCOM encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_texels =  (depth * glesv1_enc::pixelDataSize(self, width, height, format, type, 0));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glExtGetTexSubImageQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &xoffset, 4); ptr += 4;
+		memcpy(ptr, &yoffset, 4); ptr += 4;
+		memcpy(ptr, &zoffset, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &depth, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+	memcpy(ptr, &__size_texels, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(texels, __size_texels);
+	if (useChecksum) checksumCalculator->addBuffer(texels, __size_texels);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glExtGetTexSubImageQCOM: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glExtGetShadersQCOM_enc(void *self , GLuint* shaders, GLint maxShaders, GLint* numShaders)
+{
+	ENCODER_DEBUG_LOG("glExtGetShadersQCOM(shaders:0x%08x, maxShaders:%d, numShaders:0x%08x)", shaders, maxShaders, numShaders);
+	AEMU_SCOPED_TRACE("glExtGetShadersQCOM encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_shaders =  (maxShaders * sizeof(GLuint));
+	const unsigned int __size_numShaders =  (1 * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 0 + 4 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glExtGetShadersQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+	memcpy(ptr, &__size_shaders, 4); ptr += 4;
+		memcpy(ptr, &maxShaders, 4); ptr += 4;
+	memcpy(ptr, &__size_numShaders, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(shaders, __size_shaders);
+	if (useChecksum) checksumCalculator->addBuffer(shaders, __size_shaders);
+	stream->readback(numShaders, __size_numShaders);
+	if (useChecksum) checksumCalculator->addBuffer(numShaders, __size_numShaders);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glExtGetShadersQCOM: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glExtGetProgramsQCOM_enc(void *self , GLuint* programs, GLint maxPrograms, GLint* numPrograms)
+{
+	ENCODER_DEBUG_LOG("glExtGetProgramsQCOM(programs:0x%08x, maxPrograms:%d, numPrograms:0x%08x)", programs, maxPrograms, numPrograms);
+	AEMU_SCOPED_TRACE("glExtGetProgramsQCOM encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_programs =  (maxPrograms * sizeof(GLuint));
+	const unsigned int __size_numPrograms =  (1 * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 0 + 4 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glExtGetProgramsQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+	memcpy(ptr, &__size_programs, 4); ptr += 4;
+		memcpy(ptr, &maxPrograms, 4); ptr += 4;
+	memcpy(ptr, &__size_numPrograms, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(programs, __size_programs);
+	if (useChecksum) checksumCalculator->addBuffer(programs, __size_programs);
+	stream->readback(numPrograms, __size_numPrograms);
+	if (useChecksum) checksumCalculator->addBuffer(numPrograms, __size_numPrograms);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glExtGetProgramsQCOM: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+GLboolean glExtIsProgramBinaryQCOM_enc(void *self , GLuint program)
+{
+	ENCODER_DEBUG_LOG("glExtIsProgramBinaryQCOM(program:%u)", program);
+	AEMU_SCOPED_TRACE("glExtIsProgramBinaryQCOM encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glExtIsProgramBinaryQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glExtIsProgramBinaryQCOM: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glStartTilingQCOM_enc(void *self , GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask)
+{
+	ENCODER_DEBUG_LOG("glStartTilingQCOM(x:%u, y:%u, width:%u, height:%u, preserveMask:0x%08x)", x, y, width, height, preserveMask);
+	AEMU_SCOPED_TRACE("glStartTilingQCOM encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glStartTilingQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &preserveMask, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glEndTilingQCOM_enc(void *self , GLbitfield preserveMask)
+{
+	ENCODER_DEBUG_LOG("glEndTilingQCOM(preserveMask:0x%08x)", preserveMask);
+	AEMU_SCOPED_TRACE("glEndTilingQCOM encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glEndTilingQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &preserveMask, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+GLenum glGetGraphicsResetStatusEXT_enc(void *self )
+{
+	ENCODER_DEBUG_LOG("glGetGraphicsResetStatusEXT()");
+	AEMU_SCOPED_TRACE("glGetGraphicsResetStatusEXT encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetGraphicsResetStatusEXT;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLenum retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetGraphicsResetStatusEXT: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glReadnPixelsEXT_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid* data)
+{
+	ENCODER_DEBUG_LOG("glReadnPixelsEXT(x:%d, y:%d, width:%d, height:%d, format:0x%08x, type:0x%08x, bufSize:%d, data:0x%08x)", x, y, width, height, format, type, bufSize, data);
+	AEMU_SCOPED_TRACE("glReadnPixelsEXT encode");
+
+	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data =  bufSize;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glReadnPixelsEXT;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &bufSize, 4); ptr += 4;
+	memcpy(ptr, &__size_data, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(data, __size_data);
+	if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glReadnPixelsEXT: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+}  // namespace
+
+gl_encoder_context_t::gl_encoder_context_t(IOStream *stream, ChecksumCalculator *checksumCalculator)
+{
+	m_stream = stream;
+	m_checksumCalculator = checksumCalculator;
+
+	this->glAlphaFunc = &glAlphaFunc_enc;
+	this->glClearColor = &glClearColor_enc;
+	this->glClearDepthf = &glClearDepthf_enc;
+	this->glClipPlanef = &glClipPlanef_enc;
+	this->glColor4f = &glColor4f_enc;
+	this->glDepthRangef = &glDepthRangef_enc;
+	this->glFogf = &glFogf_enc;
+	this->glFogfv = &glFogfv_enc;
+	this->glFrustumf = &glFrustumf_enc;
+	this->glGetClipPlanef = &glGetClipPlanef_enc;
+	this->glGetFloatv = &glGetFloatv_enc;
+	this->glGetLightfv = &glGetLightfv_enc;
+	this->glGetMaterialfv = &glGetMaterialfv_enc;
+	this->glGetTexEnvfv = &glGetTexEnvfv_enc;
+	this->glGetTexParameterfv = &glGetTexParameterfv_enc;
+	this->glLightModelf = &glLightModelf_enc;
+	this->glLightModelfv = &glLightModelfv_enc;
+	this->glLightf = &glLightf_enc;
+	this->glLightfv = &glLightfv_enc;
+	this->glLineWidth = &glLineWidth_enc;
+	this->glLoadMatrixf = &glLoadMatrixf_enc;
+	this->glMaterialf = &glMaterialf_enc;
+	this->glMaterialfv = &glMaterialfv_enc;
+	this->glMultMatrixf = &glMultMatrixf_enc;
+	this->glMultiTexCoord4f = &glMultiTexCoord4f_enc;
+	this->glNormal3f = &glNormal3f_enc;
+	this->glOrthof = &glOrthof_enc;
+	this->glPointParameterf = &glPointParameterf_enc;
+	this->glPointParameterfv = &glPointParameterfv_enc;
+	this->glPointSize = &glPointSize_enc;
+	this->glPolygonOffset = &glPolygonOffset_enc;
+	this->glRotatef = &glRotatef_enc;
+	this->glScalef = &glScalef_enc;
+	this->glTexEnvf = &glTexEnvf_enc;
+	this->glTexEnvfv = &glTexEnvfv_enc;
+	this->glTexParameterf = &glTexParameterf_enc;
+	this->glTexParameterfv = &glTexParameterfv_enc;
+	this->glTranslatef = &glTranslatef_enc;
+	this->glActiveTexture = &glActiveTexture_enc;
+	this->glAlphaFuncx = &glAlphaFuncx_enc;
+	this->glBindBuffer = &glBindBuffer_enc;
+	this->glBindTexture = &glBindTexture_enc;
+	this->glBlendFunc = &glBlendFunc_enc;
+	this->glBufferData = &glBufferData_enc;
+	this->glBufferSubData = &glBufferSubData_enc;
+	this->glClear = &glClear_enc;
+	this->glClearColorx = &glClearColorx_enc;
+	this->glClearDepthx = &glClearDepthx_enc;
+	this->glClearStencil = &glClearStencil_enc;
+	this->glClientActiveTexture = &glClientActiveTexture_enc;
+	this->glColor4ub = &glColor4ub_enc;
+	this->glColor4x = &glColor4x_enc;
+	this->glColorMask = &glColorMask_enc;
+	this->glColorPointer = (glColorPointer_client_proc_t) &enc_unsupported;
+	this->glCompressedTexImage2D = &glCompressedTexImage2D_enc;
+	this->glCompressedTexSubImage2D = &glCompressedTexSubImage2D_enc;
+	this->glCopyTexImage2D = &glCopyTexImage2D_enc;
+	this->glCopyTexSubImage2D = &glCopyTexSubImage2D_enc;
+	this->glCullFace = &glCullFace_enc;
+	this->glDeleteBuffers = &glDeleteBuffers_enc;
+	this->glDeleteTextures = &glDeleteTextures_enc;
+	this->glDepthFunc = &glDepthFunc_enc;
+	this->glDepthMask = &glDepthMask_enc;
+	this->glDepthRangex = &glDepthRangex_enc;
+	this->glDisable = &glDisable_enc;
+	this->glDisableClientState = &glDisableClientState_enc;
+	this->glDrawArrays = &glDrawArrays_enc;
+	this->glDrawElements = (glDrawElements_client_proc_t) &enc_unsupported;
+	this->glEnable = &glEnable_enc;
+	this->glEnableClientState = &glEnableClientState_enc;
+	this->glFinish = &glFinish_enc;
+	this->glFlush = &glFlush_enc;
+	this->glFogx = &glFogx_enc;
+	this->glFogxv = &glFogxv_enc;
+	this->glFrontFace = &glFrontFace_enc;
+	this->glFrustumx = &glFrustumx_enc;
+	this->glGetBooleanv = &glGetBooleanv_enc;
+	this->glGetBufferParameteriv = &glGetBufferParameteriv_enc;
+	this->glClipPlanex = &glClipPlanex_enc;
+	this->glGenBuffers = &glGenBuffers_enc;
+	this->glGenTextures = &glGenTextures_enc;
+	this->glGetError = &glGetError_enc;
+	this->glGetFixedv = &glGetFixedv_enc;
+	this->glGetIntegerv = &glGetIntegerv_enc;
+	this->glGetLightxv = &glGetLightxv_enc;
+	this->glGetMaterialxv = &glGetMaterialxv_enc;
+	this->glGetPointerv = (glGetPointerv_client_proc_t) &enc_unsupported;
+	this->glGetString = (glGetString_client_proc_t) &enc_unsupported;
+	this->glGetTexEnviv = &glGetTexEnviv_enc;
+	this->glGetTexEnvxv = &glGetTexEnvxv_enc;
+	this->glGetTexParameteriv = &glGetTexParameteriv_enc;
+	this->glGetTexParameterxv = &glGetTexParameterxv_enc;
+	this->glHint = &glHint_enc;
+	this->glIsBuffer = &glIsBuffer_enc;
+	this->glIsEnabled = &glIsEnabled_enc;
+	this->glIsTexture = &glIsTexture_enc;
+	this->glLightModelx = &glLightModelx_enc;
+	this->glLightModelxv = &glLightModelxv_enc;
+	this->glLightx = &glLightx_enc;
+	this->glLightxv = &glLightxv_enc;
+	this->glLineWidthx = &glLineWidthx_enc;
+	this->glLoadIdentity = &glLoadIdentity_enc;
+	this->glLoadMatrixx = &glLoadMatrixx_enc;
+	this->glLogicOp = &glLogicOp_enc;
+	this->glMaterialx = &glMaterialx_enc;
+	this->glMaterialxv = &glMaterialxv_enc;
+	this->glMatrixMode = &glMatrixMode_enc;
+	this->glMultMatrixx = &glMultMatrixx_enc;
+	this->glMultiTexCoord4x = &glMultiTexCoord4x_enc;
+	this->glNormal3x = &glNormal3x_enc;
+	this->glNormalPointer = (glNormalPointer_client_proc_t) &enc_unsupported;
+	this->glOrthox = &glOrthox_enc;
+	this->glPixelStorei = &glPixelStorei_enc;
+	this->glPointParameterx = &glPointParameterx_enc;
+	this->glPointParameterxv = &glPointParameterxv_enc;
+	this->glPointSizex = &glPointSizex_enc;
+	this->glPolygonOffsetx = &glPolygonOffsetx_enc;
+	this->glPopMatrix = &glPopMatrix_enc;
+	this->glPushMatrix = &glPushMatrix_enc;
+	this->glReadPixels = &glReadPixels_enc;
+	this->glRotatex = &glRotatex_enc;
+	this->glSampleCoverage = &glSampleCoverage_enc;
+	this->glSampleCoveragex = &glSampleCoveragex_enc;
+	this->glScalex = &glScalex_enc;
+	this->glScissor = &glScissor_enc;
+	this->glShadeModel = &glShadeModel_enc;
+	this->glStencilFunc = &glStencilFunc_enc;
+	this->glStencilMask = &glStencilMask_enc;
+	this->glStencilOp = &glStencilOp_enc;
+	this->glTexCoordPointer = (glTexCoordPointer_client_proc_t) &enc_unsupported;
+	this->glTexEnvi = &glTexEnvi_enc;
+	this->glTexEnvx = &glTexEnvx_enc;
+	this->glTexEnviv = &glTexEnviv_enc;
+	this->glTexEnvxv = &glTexEnvxv_enc;
+	this->glTexImage2D = &glTexImage2D_enc;
+	this->glTexParameteri = &glTexParameteri_enc;
+	this->glTexParameterx = &glTexParameterx_enc;
+	this->glTexParameteriv = &glTexParameteriv_enc;
+	this->glTexParameterxv = &glTexParameterxv_enc;
+	this->glTexSubImage2D = &glTexSubImage2D_enc;
+	this->glTranslatex = &glTranslatex_enc;
+	this->glVertexPointer = (glVertexPointer_client_proc_t) &enc_unsupported;
+	this->glViewport = &glViewport_enc;
+	this->glPointSizePointerOES = (glPointSizePointerOES_client_proc_t) &enc_unsupported;
+	this->glVertexPointerOffset = &glVertexPointerOffset_enc;
+	this->glColorPointerOffset = &glColorPointerOffset_enc;
+	this->glNormalPointerOffset = &glNormalPointerOffset_enc;
+	this->glPointSizePointerOffset = &glPointSizePointerOffset_enc;
+	this->glTexCoordPointerOffset = &glTexCoordPointerOffset_enc;
+	this->glWeightPointerOffset = &glWeightPointerOffset_enc;
+	this->glMatrixIndexPointerOffset = &glMatrixIndexPointerOffset_enc;
+	this->glVertexPointerData = &glVertexPointerData_enc;
+	this->glColorPointerData = &glColorPointerData_enc;
+	this->glNormalPointerData = &glNormalPointerData_enc;
+	this->glTexCoordPointerData = &glTexCoordPointerData_enc;
+	this->glPointSizePointerData = &glPointSizePointerData_enc;
+	this->glWeightPointerData = &glWeightPointerData_enc;
+	this->glMatrixIndexPointerData = &glMatrixIndexPointerData_enc;
+	this->glDrawElementsOffset = &glDrawElementsOffset_enc;
+	this->glDrawElementsData = &glDrawElementsData_enc;
+	this->glGetCompressedTextureFormats = &glGetCompressedTextureFormats_enc;
+	this->glFinishRoundTrip = &glFinishRoundTrip_enc;
+	this->glBlendEquationSeparateOES = &glBlendEquationSeparateOES_enc;
+	this->glBlendFuncSeparateOES = &glBlendFuncSeparateOES_enc;
+	this->glBlendEquationOES = &glBlendEquationOES_enc;
+	this->glDrawTexsOES = &glDrawTexsOES_enc;
+	this->glDrawTexiOES = &glDrawTexiOES_enc;
+	this->glDrawTexxOES = &glDrawTexxOES_enc;
+	this->glDrawTexsvOES = &glDrawTexsvOES_enc;
+	this->glDrawTexivOES = &glDrawTexivOES_enc;
+	this->glDrawTexxvOES = &glDrawTexxvOES_enc;
+	this->glDrawTexfOES = &glDrawTexfOES_enc;
+	this->glDrawTexfvOES = &glDrawTexfvOES_enc;
+	this->glEGLImageTargetTexture2DOES = &glEGLImageTargetTexture2DOES_enc;
+	this->glEGLImageTargetRenderbufferStorageOES = &glEGLImageTargetRenderbufferStorageOES_enc;
+	this->glAlphaFuncxOES = &glAlphaFuncxOES_enc;
+	this->glClearColorxOES = &glClearColorxOES_enc;
+	this->glClearDepthxOES = &glClearDepthxOES_enc;
+	this->glClipPlanexOES = &glClipPlanexOES_enc;
+	this->glClipPlanexIMG = &glClipPlanexIMG_enc;
+	this->glColor4xOES = &glColor4xOES_enc;
+	this->glDepthRangexOES = &glDepthRangexOES_enc;
+	this->glFogxOES = &glFogxOES_enc;
+	this->glFogxvOES = &glFogxvOES_enc;
+	this->glFrustumxOES = &glFrustumxOES_enc;
+	this->glGetClipPlanexOES = &glGetClipPlanexOES_enc;
+	this->glGetClipPlanex = &glGetClipPlanex_enc;
+	this->glGetFixedvOES = &glGetFixedvOES_enc;
+	this->glGetLightxvOES = &glGetLightxvOES_enc;
+	this->glGetMaterialxvOES = &glGetMaterialxvOES_enc;
+	this->glGetTexEnvxvOES = &glGetTexEnvxvOES_enc;
+	this->glGetTexParameterxvOES = &glGetTexParameterxvOES_enc;
+	this->glLightModelxOES = &glLightModelxOES_enc;
+	this->glLightModelxvOES = &glLightModelxvOES_enc;
+	this->glLightxOES = &glLightxOES_enc;
+	this->glLightxvOES = &glLightxvOES_enc;
+	this->glLineWidthxOES = &glLineWidthxOES_enc;
+	this->glLoadMatrixxOES = &glLoadMatrixxOES_enc;
+	this->glMaterialxOES = &glMaterialxOES_enc;
+	this->glMaterialxvOES = &glMaterialxvOES_enc;
+	this->glMultMatrixxOES = &glMultMatrixxOES_enc;
+	this->glMultiTexCoord4xOES = &glMultiTexCoord4xOES_enc;
+	this->glNormal3xOES = &glNormal3xOES_enc;
+	this->glOrthoxOES = &glOrthoxOES_enc;
+	this->glPointParameterxOES = &glPointParameterxOES_enc;
+	this->glPointParameterxvOES = &glPointParameterxvOES_enc;
+	this->glPointSizexOES = &glPointSizexOES_enc;
+	this->glPolygonOffsetxOES = &glPolygonOffsetxOES_enc;
+	this->glRotatexOES = &glRotatexOES_enc;
+	this->glSampleCoveragexOES = &glSampleCoveragexOES_enc;
+	this->glScalexOES = &glScalexOES_enc;
+	this->glTexEnvxOES = &glTexEnvxOES_enc;
+	this->glTexEnvxvOES = &glTexEnvxvOES_enc;
+	this->glTexParameterxOES = &glTexParameterxOES_enc;
+	this->glTexParameterxvOES = &glTexParameterxvOES_enc;
+	this->glTranslatexOES = &glTranslatexOES_enc;
+	this->glIsRenderbufferOES = &glIsRenderbufferOES_enc;
+	this->glBindRenderbufferOES = &glBindRenderbufferOES_enc;
+	this->glDeleteRenderbuffersOES = &glDeleteRenderbuffersOES_enc;
+	this->glGenRenderbuffersOES = &glGenRenderbuffersOES_enc;
+	this->glRenderbufferStorageOES = &glRenderbufferStorageOES_enc;
+	this->glGetRenderbufferParameterivOES = &glGetRenderbufferParameterivOES_enc;
+	this->glIsFramebufferOES = &glIsFramebufferOES_enc;
+	this->glBindFramebufferOES = &glBindFramebufferOES_enc;
+	this->glDeleteFramebuffersOES = &glDeleteFramebuffersOES_enc;
+	this->glGenFramebuffersOES = &glGenFramebuffersOES_enc;
+	this->glCheckFramebufferStatusOES = &glCheckFramebufferStatusOES_enc;
+	this->glFramebufferRenderbufferOES = &glFramebufferRenderbufferOES_enc;
+	this->glFramebufferTexture2DOES = &glFramebufferTexture2DOES_enc;
+	this->glGetFramebufferAttachmentParameterivOES = &glGetFramebufferAttachmentParameterivOES_enc;
+	this->glGenerateMipmapOES = &glGenerateMipmapOES_enc;
+	this->glMapBufferOES = (glMapBufferOES_client_proc_t) &enc_unsupported;
+	this->glUnmapBufferOES = &glUnmapBufferOES_enc;
+	this->glGetBufferPointervOES = (glGetBufferPointervOES_client_proc_t) &enc_unsupported;
+	this->glCurrentPaletteMatrixOES = &glCurrentPaletteMatrixOES_enc;
+	this->glLoadPaletteFromModelViewMatrixOES = &glLoadPaletteFromModelViewMatrixOES_enc;
+	this->glMatrixIndexPointerOES = (glMatrixIndexPointerOES_client_proc_t) &enc_unsupported;
+	this->glWeightPointerOES = (glWeightPointerOES_client_proc_t) &enc_unsupported;
+	this->glQueryMatrixxOES = &glQueryMatrixxOES_enc;
+	this->glDepthRangefOES = &glDepthRangefOES_enc;
+	this->glFrustumfOES = &glFrustumfOES_enc;
+	this->glOrthofOES = &glOrthofOES_enc;
+	this->glClipPlanefOES = &glClipPlanefOES_enc;
+	this->glClipPlanefIMG = &glClipPlanefIMG_enc;
+	this->glGetClipPlanefOES = &glGetClipPlanefOES_enc;
+	this->glClearDepthfOES = &glClearDepthfOES_enc;
+	this->glTexGenfOES = &glTexGenfOES_enc;
+	this->glTexGenfvOES = &glTexGenfvOES_enc;
+	this->glTexGeniOES = &glTexGeniOES_enc;
+	this->glTexGenivOES = &glTexGenivOES_enc;
+	this->glTexGenxOES = &glTexGenxOES_enc;
+	this->glTexGenxvOES = &glTexGenxvOES_enc;
+	this->glGetTexGenfvOES = &glGetTexGenfvOES_enc;
+	this->glGetTexGenivOES = &glGetTexGenivOES_enc;
+	this->glGetTexGenxvOES = &glGetTexGenxvOES_enc;
+	this->glBindVertexArrayOES = &glBindVertexArrayOES_enc;
+	this->glDeleteVertexArraysOES = &glDeleteVertexArraysOES_enc;
+	this->glGenVertexArraysOES = &glGenVertexArraysOES_enc;
+	this->glIsVertexArrayOES = &glIsVertexArrayOES_enc;
+	this->glDiscardFramebufferEXT = &glDiscardFramebufferEXT_enc;
+	this->glMultiDrawArraysEXT = (glMultiDrawArraysEXT_client_proc_t) &enc_unsupported;
+	this->glMultiDrawElementsEXT = (glMultiDrawElementsEXT_client_proc_t) &enc_unsupported;
+	this->glMultiDrawArraysSUN = (glMultiDrawArraysSUN_client_proc_t) &enc_unsupported;
+	this->glMultiDrawElementsSUN = (glMultiDrawElementsSUN_client_proc_t) &enc_unsupported;
+	this->glRenderbufferStorageMultisampleIMG = &glRenderbufferStorageMultisampleIMG_enc;
+	this->glFramebufferTexture2DMultisampleIMG = &glFramebufferTexture2DMultisampleIMG_enc;
+	this->glDeleteFencesNV = &glDeleteFencesNV_enc;
+	this->glGenFencesNV = &glGenFencesNV_enc;
+	this->glIsFenceNV = &glIsFenceNV_enc;
+	this->glTestFenceNV = &glTestFenceNV_enc;
+	this->glGetFenceivNV = &glGetFenceivNV_enc;
+	this->glFinishFenceNV = &glFinishFenceNV_enc;
+	this->glSetFenceNV = &glSetFenceNV_enc;
+	this->glGetDriverControlsQCOM = &glGetDriverControlsQCOM_enc;
+	this->glGetDriverControlStringQCOM = &glGetDriverControlStringQCOM_enc;
+	this->glEnableDriverControlQCOM = &glEnableDriverControlQCOM_enc;
+	this->glDisableDriverControlQCOM = &glDisableDriverControlQCOM_enc;
+	this->glExtGetTexturesQCOM = &glExtGetTexturesQCOM_enc;
+	this->glExtGetBuffersQCOM = &glExtGetBuffersQCOM_enc;
+	this->glExtGetRenderbuffersQCOM = &glExtGetRenderbuffersQCOM_enc;
+	this->glExtGetFramebuffersQCOM = &glExtGetFramebuffersQCOM_enc;
+	this->glExtGetTexLevelParameterivQCOM = &glExtGetTexLevelParameterivQCOM_enc;
+	this->glExtTexObjectStateOverrideiQCOM = &glExtTexObjectStateOverrideiQCOM_enc;
+	this->glExtGetTexSubImageQCOM = &glExtGetTexSubImageQCOM_enc;
+	this->glExtGetBufferPointervQCOM = (glExtGetBufferPointervQCOM_client_proc_t) &enc_unsupported;
+	this->glExtGetShadersQCOM = &glExtGetShadersQCOM_enc;
+	this->glExtGetProgramsQCOM = &glExtGetProgramsQCOM_enc;
+	this->glExtIsProgramBinaryQCOM = &glExtIsProgramBinaryQCOM_enc;
+	this->glExtGetProgramBinarySourceQCOM = (glExtGetProgramBinarySourceQCOM_client_proc_t) &enc_unsupported;
+	this->glStartTilingQCOM = &glStartTilingQCOM_enc;
+	this->glEndTilingQCOM = &glEndTilingQCOM_enc;
+	this->glGetGraphicsResetStatusEXT = &glGetGraphicsResetStatusEXT_enc;
+	this->glReadnPixelsEXT = &glReadnPixelsEXT_enc;
+}
+
diff --git a/system/GLESv1_enc/gl_enc.h b/system/GLESv1_enc/gl_enc.h
new file mode 100644
index 0000000..8d272b3
--- /dev/null
+++ b/system/GLESv1_enc/gl_enc.h
@@ -0,0 +1,24 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+
+#ifndef GUARD_gl_encoder_context_t
+#define GUARD_gl_encoder_context_t
+
+#include "IOStream.h"
+#include "ChecksumCalculator.h"
+#include "gl_client_context.h"
+
+
+#include "glUtils.h"
+#include "GLEncoderUtils.h"
+
+struct gl_encoder_context_t : public gl_client_context_t {
+
+	gfxstream::IOStream *m_stream;
+	ChecksumCalculator *m_checksumCalculator;
+
+	gl_encoder_context_t(gfxstream::IOStream *stream, ChecksumCalculator *checksumCalculator);
+	virtual uint64_t lockAndWriteDma(void*, uint32_t) { return 0; }
+};
+
+#endif  // GUARD_gl_encoder_context_t
diff --git a/system/GLESv1_enc/gl_entry.cpp b/system/GLESv1_enc/gl_entry.cpp
new file mode 100644
index 0000000..27a8faf
--- /dev/null
+++ b/system/GLESv1_enc/gl_entry.cpp
@@ -0,0 +1,2078 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+#include <stdio.h>
+#include <stdlib.h>
+#include "gl_client_context.h"
+
+extern "C" {
+	void glAlphaFunc(GLenum func, GLclampf ref);
+	void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+	void glClearDepthf(GLclampf depth);
+	void glClipPlanef(GLenum plane, const GLfloat* equation);
+	void glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+	void glDepthRangef(GLclampf zNear, GLclampf zFar);
+	void glFogf(GLenum pname, GLfloat param);
+	void glFogfv(GLenum pname, const GLfloat* params);
+	void glFrustumf(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+	void glGetClipPlanef(GLenum pname, GLfloat* eqn);
+	void glGetFloatv(GLenum pname, GLfloat* params);
+	void glGetLightfv(GLenum light, GLenum pname, GLfloat* params);
+	void glGetMaterialfv(GLenum face, GLenum pname, GLfloat* params);
+	void glGetTexEnvfv(GLenum env, GLenum pname, GLfloat* params);
+	void glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params);
+	void glLightModelf(GLenum pname, GLfloat param);
+	void glLightModelfv(GLenum pname, const GLfloat* params);
+	void glLightf(GLenum light, GLenum pname, GLfloat param);
+	void glLightfv(GLenum light, GLenum pname, const GLfloat* params);
+	void glLineWidth(GLfloat width);
+	void glLoadMatrixf(const GLfloat* m);
+	void glMaterialf(GLenum face, GLenum pname, GLfloat param);
+	void glMaterialfv(GLenum face, GLenum pname, const GLfloat* params);
+	void glMultMatrixf(const GLfloat* m);
+	void glMultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+	void glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz);
+	void glOrthof(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+	void glPointParameterf(GLenum pname, GLfloat param);
+	void glPointParameterfv(GLenum pname, const GLfloat* params);
+	void glPointSize(GLfloat size);
+	void glPolygonOffset(GLfloat factor, GLfloat units);
+	void glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+	void glScalef(GLfloat x, GLfloat y, GLfloat z);
+	void glTexEnvf(GLenum target, GLenum pname, GLfloat param);
+	void glTexEnvfv(GLenum target, GLenum pname, const GLfloat* params);
+	void glTexParameterf(GLenum target, GLenum pname, GLfloat param);
+	void glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params);
+	void glTranslatef(GLfloat x, GLfloat y, GLfloat z);
+	void glActiveTexture(GLenum texture);
+	void glAlphaFuncx(GLenum func, GLclampx ref);
+	void glBindBuffer(GLenum target, GLuint buffer);
+	void glBindTexture(GLenum target, GLuint texture);
+	void glBlendFunc(GLenum sfactor, GLenum dfactor);
+	void glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
+	void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
+	void glClear(GLbitfield mask);
+	void glClearColorx(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
+	void glClearDepthx(GLclampx depth);
+	void glClearStencil(GLint s);
+	void glClientActiveTexture(GLenum texture);
+	void glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
+	void glColor4x(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+	void glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+	void glColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
+	void glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data);
+	void glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data);
+	void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+	void glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+	void glCullFace(GLenum mode);
+	void glDeleteBuffers(GLsizei n, const GLuint* buffers);
+	void glDeleteTextures(GLsizei n, const GLuint* textures);
+	void glDepthFunc(GLenum func);
+	void glDepthMask(GLboolean flag);
+	void glDepthRangex(GLclampx zNear, GLclampx zFar);
+	void glDisable(GLenum cap);
+	void glDisableClientState(GLenum array);
+	void glDrawArrays(GLenum mode, GLint first, GLsizei count);
+	void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices);
+	void glEnable(GLenum cap);
+	void glEnableClientState(GLenum array);
+	void glFinish();
+	void glFlush();
+	void glFogx(GLenum pname, GLfixed param);
+	void glFogxv(GLenum pname, const GLfixed* params);
+	void glFrontFace(GLenum mode);
+	void glFrustumx(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+	void glGetBooleanv(GLenum pname, GLboolean* params);
+	void glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params);
+	void glClipPlanex(GLenum pname, const GLfixed* eqn);
+	void glGenBuffers(GLsizei n, GLuint* buffers);
+	void glGenTextures(GLsizei n, GLuint* textures);
+	GLenum glGetError();
+	void glGetFixedv(GLenum pname, GLfixed* params);
+	void glGetIntegerv(GLenum pname, GLint* params);
+	void glGetLightxv(GLenum light, GLenum pname, GLfixed* params);
+	void glGetMaterialxv(GLenum face, GLenum pname, GLfixed* params);
+	void glGetPointerv(GLenum pname, GLvoid** params);
+	const GLubyte* glGetString(GLenum name);
+	void glGetTexEnviv(GLenum env, GLenum pname, GLint* params);
+	void glGetTexEnvxv(GLenum env, GLenum pname, GLfixed* params);
+	void glGetTexParameteriv(GLenum target, GLenum pname, GLint* params);
+	void glGetTexParameterxv(GLenum target, GLenum pname, GLfixed* params);
+	void glHint(GLenum target, GLenum mode);
+	GLboolean glIsBuffer(GLuint buffer);
+	GLboolean glIsEnabled(GLenum cap);
+	GLboolean glIsTexture(GLuint texture);
+	void glLightModelx(GLenum pname, GLfixed param);
+	void glLightModelxv(GLenum pname, const GLfixed* params);
+	void glLightx(GLenum light, GLenum pname, GLfixed param);
+	void glLightxv(GLenum light, GLenum pname, const GLfixed* params);
+	void glLineWidthx(GLfixed width);
+	void glLoadIdentity();
+	void glLoadMatrixx(const GLfixed* m);
+	void glLogicOp(GLenum opcode);
+	void glMaterialx(GLenum face, GLenum pname, GLfixed param);
+	void glMaterialxv(GLenum face, GLenum pname, const GLfixed* params);
+	void glMatrixMode(GLenum mode);
+	void glMultMatrixx(const GLfixed* m);
+	void glMultiTexCoord4x(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+	void glNormal3x(GLfixed nx, GLfixed ny, GLfixed nz);
+	void glNormalPointer(GLenum type, GLsizei stride, const GLvoid* pointer);
+	void glOrthox(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+	void glPixelStorei(GLenum pname, GLint param);
+	void glPointParameterx(GLenum pname, GLfixed param);
+	void glPointParameterxv(GLenum pname, const GLfixed* params);
+	void glPointSizex(GLfixed size);
+	void glPolygonOffsetx(GLfixed factor, GLfixed units);
+	void glPopMatrix();
+	void glPushMatrix();
+	void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
+	void glRotatex(GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
+	void glSampleCoverage(GLclampf value, GLboolean invert);
+	void glSampleCoveragex(GLclampx value, GLboolean invert);
+	void glScalex(GLfixed x, GLfixed y, GLfixed z);
+	void glScissor(GLint x, GLint y, GLsizei width, GLsizei height);
+	void glShadeModel(GLenum mode);
+	void glStencilFunc(GLenum func, GLint ref, GLuint mask);
+	void glStencilMask(GLuint mask);
+	void glStencilOp(GLenum fail, GLenum zfail, GLenum zpass);
+	void glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
+	void glTexEnvi(GLenum target, GLenum pname, GLint param);
+	void glTexEnvx(GLenum target, GLenum pname, GLfixed param);
+	void glTexEnviv(GLenum target, GLenum pname, const GLint* params);
+	void glTexEnvxv(GLenum target, GLenum pname, const GLfixed* params);
+	void glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
+	void glTexParameteri(GLenum target, GLenum pname, GLint param);
+	void glTexParameterx(GLenum target, GLenum pname, GLfixed param);
+	void glTexParameteriv(GLenum target, GLenum pname, const GLint* params);
+	void glTexParameterxv(GLenum target, GLenum pname, const GLfixed* params);
+	void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels);
+	void glTranslatex(GLfixed x, GLfixed y, GLfixed z);
+	void glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
+	void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
+	void glPointSizePointerOES(GLenum type, GLsizei stride, const GLvoid* pointer);
+	void glVertexPointerOffset(GLint size, GLenum type, GLsizei stride, GLuint offset);
+	void glColorPointerOffset(GLint size, GLenum type, GLsizei stride, GLuint offset);
+	void glNormalPointerOffset(GLenum type, GLsizei stride, GLuint offset);
+	void glPointSizePointerOffset(GLenum type, GLsizei stride, GLuint offset);
+	void glTexCoordPointerOffset(GLint size, GLenum type, GLsizei stride, GLuint offset);
+	void glWeightPointerOffset(GLint size, GLenum type, GLsizei stride, GLuint offset);
+	void glMatrixIndexPointerOffset(GLint size, GLenum type, GLsizei stride, GLuint offset);
+	void glVertexPointerData(GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen);
+	void glColorPointerData(GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen);
+	void glNormalPointerData(GLenum type, GLsizei stride, void* data, GLuint datalen);
+	void glTexCoordPointerData(GLint unit, GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen);
+	void glPointSizePointerData(GLenum type, GLsizei stride, void* data, GLuint datalen);
+	void glWeightPointerData(GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen);
+	void glMatrixIndexPointerData(GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen);
+	void glDrawElementsOffset(GLenum mode, GLsizei count, GLenum type, GLuint offset);
+	void glDrawElementsData(GLenum mode, GLsizei count, GLenum type, void* data, GLuint datalen);
+	void glGetCompressedTextureFormats(int count, GLint* formats);
+	int glFinishRoundTrip();
+	void glBlendEquationSeparateOES(GLenum modeRGB, GLenum modeAlpha);
+	void glBlendFuncSeparateOES(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+	void glBlendEquationOES(GLenum mode);
+	void glDrawTexsOES(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);
+	void glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height);
+	void glDrawTexxOES(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);
+	void glDrawTexsvOES(const GLshort* coords);
+	void glDrawTexivOES(const GLint* coords);
+	void glDrawTexxvOES(const GLfixed* coords);
+	void glDrawTexfOES(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
+	void glDrawTexfvOES(const GLfloat* coords);
+	void glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image);
+	void glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image);
+	void glAlphaFuncxOES(GLenum func, GLclampx ref);
+	void glClearColorxOES(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
+	void glClearDepthxOES(GLclampx depth);
+	void glClipPlanexOES(GLenum plane, const GLfixed* equation);
+	void glClipPlanexIMG(GLenum plane, const GLfixed* equation);
+	void glColor4xOES(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+	void glDepthRangexOES(GLclampx zNear, GLclampx zFar);
+	void glFogxOES(GLenum pname, GLfixed param);
+	void glFogxvOES(GLenum pname, const GLfixed* params);
+	void glFrustumxOES(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+	void glGetClipPlanexOES(GLenum pname, GLfixed* eqn);
+	void glGetClipPlanex(GLenum pname, GLfixed* eqn);
+	void glGetFixedvOES(GLenum pname, GLfixed* params);
+	void glGetLightxvOES(GLenum light, GLenum pname, GLfixed* params);
+	void glGetMaterialxvOES(GLenum face, GLenum pname, GLfixed* params);
+	void glGetTexEnvxvOES(GLenum env, GLenum pname, GLfixed* params);
+	void glGetTexParameterxvOES(GLenum target, GLenum pname, GLfixed* params);
+	void glLightModelxOES(GLenum pname, GLfixed param);
+	void glLightModelxvOES(GLenum pname, const GLfixed* params);
+	void glLightxOES(GLenum light, GLenum pname, GLfixed param);
+	void glLightxvOES(GLenum light, GLenum pname, const GLfixed* params);
+	void glLineWidthxOES(GLfixed width);
+	void glLoadMatrixxOES(const GLfixed* m);
+	void glMaterialxOES(GLenum face, GLenum pname, GLfixed param);
+	void glMaterialxvOES(GLenum face, GLenum pname, const GLfixed* params);
+	void glMultMatrixxOES(const GLfixed* m);
+	void glMultiTexCoord4xOES(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+	void glNormal3xOES(GLfixed nx, GLfixed ny, GLfixed nz);
+	void glOrthoxOES(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+	void glPointParameterxOES(GLenum pname, GLfixed param);
+	void glPointParameterxvOES(GLenum pname, const GLfixed* params);
+	void glPointSizexOES(GLfixed size);
+	void glPolygonOffsetxOES(GLfixed factor, GLfixed units);
+	void glRotatexOES(GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
+	void glSampleCoveragexOES(GLclampx value, GLboolean invert);
+	void glScalexOES(GLfixed x, GLfixed y, GLfixed z);
+	void glTexEnvxOES(GLenum target, GLenum pname, GLfixed param);
+	void glTexEnvxvOES(GLenum target, GLenum pname, const GLfixed* params);
+	void glTexParameterxOES(GLenum target, GLenum pname, GLfixed param);
+	void glTexParameterxvOES(GLenum target, GLenum pname, const GLfixed* params);
+	void glTranslatexOES(GLfixed x, GLfixed y, GLfixed z);
+	GLboolean glIsRenderbufferOES(GLuint renderbuffer);
+	void glBindRenderbufferOES(GLenum target, GLuint renderbuffer);
+	void glDeleteRenderbuffersOES(GLsizei n, const GLuint* renderbuffers);
+	void glGenRenderbuffersOES(GLsizei n, GLuint* renderbuffers);
+	void glRenderbufferStorageOES(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+	void glGetRenderbufferParameterivOES(GLenum target, GLenum pname, GLint* params);
+	GLboolean glIsFramebufferOES(GLuint framebuffer);
+	void glBindFramebufferOES(GLenum target, GLuint framebuffer);
+	void glDeleteFramebuffersOES(GLsizei n, const GLuint* framebuffers);
+	void glGenFramebuffersOES(GLsizei n, GLuint* framebuffers);
+	GLenum glCheckFramebufferStatusOES(GLenum target);
+	void glFramebufferRenderbufferOES(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+	void glFramebufferTexture2DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+	void glGetFramebufferAttachmentParameterivOES(GLenum target, GLenum attachment, GLenum pname, GLint* params);
+	void glGenerateMipmapOES(GLenum target);
+	void* glMapBufferOES(GLenum target, GLenum access);
+	GLboolean glUnmapBufferOES(GLenum target);
+	void glGetBufferPointervOES(GLenum target, GLenum pname, GLvoid** params);
+	void glCurrentPaletteMatrixOES(GLuint matrixpaletteindex);
+	void glLoadPaletteFromModelViewMatrixOES();
+	void glMatrixIndexPointerOES(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
+	void glWeightPointerOES(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
+	GLbitfield glQueryMatrixxOES(GLfixed* mantissa, GLint* exponent);
+	void glDepthRangefOES(GLclampf zNear, GLclampf zFar);
+	void glFrustumfOES(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+	void glOrthofOES(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+	void glClipPlanefOES(GLenum plane, const GLfloat* equation);
+	void glClipPlanefIMG(GLenum plane, const GLfloat* equation);
+	void glGetClipPlanefOES(GLenum pname, GLfloat* eqn);
+	void glClearDepthfOES(GLclampf depth);
+	void glTexGenfOES(GLenum coord, GLenum pname, GLfloat param);
+	void glTexGenfvOES(GLenum coord, GLenum pname, const GLfloat* params);
+	void glTexGeniOES(GLenum coord, GLenum pname, GLint param);
+	void glTexGenivOES(GLenum coord, GLenum pname, const GLint* params);
+	void glTexGenxOES(GLenum coord, GLenum pname, GLfixed param);
+	void glTexGenxvOES(GLenum coord, GLenum pname, const GLfixed* params);
+	void glGetTexGenfvOES(GLenum coord, GLenum pname, GLfloat* params);
+	void glGetTexGenivOES(GLenum coord, GLenum pname, GLint* params);
+	void glGetTexGenxvOES(GLenum coord, GLenum pname, GLfixed* params);
+	void glBindVertexArrayOES(GLuint array);
+	void glDeleteVertexArraysOES(GLsizei n, const GLuint* arrays);
+	void glGenVertexArraysOES(GLsizei n, GLuint* arrays);
+	GLboolean glIsVertexArrayOES(GLuint array);
+	void glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum* attachments);
+	void glMultiDrawArraysEXT(GLenum mode, const GLint* first, const GLsizei* count, GLsizei primcount);
+	void glMultiDrawElementsEXT(GLenum mode, const GLsizei* count, GLenum type, const GLvoid* const* indices, GLsizei primcount);
+	void glMultiDrawArraysSUN(GLenum mode, GLint* first, GLsizei* count, GLsizei primcount);
+	void glMultiDrawElementsSUN(GLenum mode, const GLsizei* count, GLenum type, const GLvoid** indices, GLsizei primcount);
+	void glRenderbufferStorageMultisampleIMG(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+	void glFramebufferTexture2DMultisampleIMG(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+	void glDeleteFencesNV(GLsizei n, const GLuint* fences);
+	void glGenFencesNV(GLsizei n, GLuint* fences);
+	GLboolean glIsFenceNV(GLuint fence);
+	GLboolean glTestFenceNV(GLuint fence);
+	void glGetFenceivNV(GLuint fence, GLenum pname, GLint* params);
+	void glFinishFenceNV(GLuint fence);
+	void glSetFenceNV(GLuint fence, GLenum condition);
+	void glGetDriverControlsQCOM(GLint* num, GLsizei size, GLuint* driverControls);
+	void glGetDriverControlStringQCOM(GLuint driverControl, GLsizei bufSize, GLsizei* length, GLchar* driverControlString);
+	void glEnableDriverControlQCOM(GLuint driverControl);
+	void glDisableDriverControlQCOM(GLuint driverControl);
+	void glExtGetTexturesQCOM(GLuint* textures, GLint maxTextures, GLint* numTextures);
+	void glExtGetBuffersQCOM(GLuint* buffers, GLint maxBuffers, GLint* numBuffers);
+	void glExtGetRenderbuffersQCOM(GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers);
+	void glExtGetFramebuffersQCOM(GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers);
+	void glExtGetTexLevelParameterivQCOM(GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params);
+	void glExtTexObjectStateOverrideiQCOM(GLenum target, GLenum pname, GLint param);
+	void glExtGetTexSubImageQCOM(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid* texels);
+	void glExtGetBufferPointervQCOM(GLenum target, GLvoid** params);
+	void glExtGetShadersQCOM(GLuint* shaders, GLint maxShaders, GLint* numShaders);
+	void glExtGetProgramsQCOM(GLuint* programs, GLint maxPrograms, GLint* numPrograms);
+	GLboolean glExtIsProgramBinaryQCOM(GLuint program);
+	void glExtGetProgramBinarySourceQCOM(GLuint program, GLenum shadertype, GLchar* source, GLint* length);
+	void glStartTilingQCOM(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
+	void glEndTilingQCOM(GLbitfield preserveMask);
+	GLenum glGetGraphicsResetStatusEXT();
+	void glReadnPixelsEXT(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid* data);
+};
+
+#ifndef GET_CONTEXT
+static gl_client_context_t::CONTEXT_ACCESSOR_TYPE *getCurrentContext = NULL;
+void gl_client_context_t::setContextAccessor(CONTEXT_ACCESSOR_TYPE *f) { getCurrentContext = f; }
+#define GET_CONTEXT gl_client_context_t * ctx = getCurrentContext()
+#endif
+
+void glAlphaFunc(GLenum func, GLclampf ref)
+{
+	GET_CONTEXT;
+	ctx->glAlphaFunc(ctx, func, ref);
+}
+
+void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+{
+	GET_CONTEXT;
+	ctx->glClearColor(ctx, red, green, blue, alpha);
+}
+
+void glClearDepthf(GLclampf depth)
+{
+	GET_CONTEXT;
+	ctx->glClearDepthf(ctx, depth);
+}
+
+void glClipPlanef(GLenum plane, const GLfloat* equation)
+{
+	GET_CONTEXT;
+	ctx->glClipPlanef(ctx, plane, equation);
+}
+
+void glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
+{
+	GET_CONTEXT;
+	ctx->glColor4f(ctx, red, green, blue, alpha);
+}
+
+void glDepthRangef(GLclampf zNear, GLclampf zFar)
+{
+	GET_CONTEXT;
+	ctx->glDepthRangef(ctx, zNear, zFar);
+}
+
+void glFogf(GLenum pname, GLfloat param)
+{
+	GET_CONTEXT;
+	ctx->glFogf(ctx, pname, param);
+}
+
+void glFogfv(GLenum pname, const GLfloat* params)
+{
+	GET_CONTEXT;
+	ctx->glFogfv(ctx, pname, params);
+}
+
+void glFrustumf(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
+{
+	GET_CONTEXT;
+	ctx->glFrustumf(ctx, left, right, bottom, top, zNear, zFar);
+}
+
+void glGetClipPlanef(GLenum pname, GLfloat* eqn)
+{
+	GET_CONTEXT;
+	ctx->glGetClipPlanef(ctx, pname, eqn);
+}
+
+void glGetFloatv(GLenum pname, GLfloat* params)
+{
+	GET_CONTEXT;
+	ctx->glGetFloatv(ctx, pname, params);
+}
+
+void glGetLightfv(GLenum light, GLenum pname, GLfloat* params)
+{
+	GET_CONTEXT;
+	ctx->glGetLightfv(ctx, light, pname, params);
+}
+
+void glGetMaterialfv(GLenum face, GLenum pname, GLfloat* params)
+{
+	GET_CONTEXT;
+	ctx->glGetMaterialfv(ctx, face, pname, params);
+}
+
+void glGetTexEnvfv(GLenum env, GLenum pname, GLfloat* params)
+{
+	GET_CONTEXT;
+	ctx->glGetTexEnvfv(ctx, env, pname, params);
+}
+
+void glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params)
+{
+	GET_CONTEXT;
+	ctx->glGetTexParameterfv(ctx, target, pname, params);
+}
+
+void glLightModelf(GLenum pname, GLfloat param)
+{
+	GET_CONTEXT;
+	ctx->glLightModelf(ctx, pname, param);
+}
+
+void glLightModelfv(GLenum pname, const GLfloat* params)
+{
+	GET_CONTEXT;
+	ctx->glLightModelfv(ctx, pname, params);
+}
+
+void glLightf(GLenum light, GLenum pname, GLfloat param)
+{
+	GET_CONTEXT;
+	ctx->glLightf(ctx, light, pname, param);
+}
+
+void glLightfv(GLenum light, GLenum pname, const GLfloat* params)
+{
+	GET_CONTEXT;
+	ctx->glLightfv(ctx, light, pname, params);
+}
+
+void glLineWidth(GLfloat width)
+{
+	GET_CONTEXT;
+	ctx->glLineWidth(ctx, width);
+}
+
+void glLoadMatrixf(const GLfloat* m)
+{
+	GET_CONTEXT;
+	ctx->glLoadMatrixf(ctx, m);
+}
+
+void glMaterialf(GLenum face, GLenum pname, GLfloat param)
+{
+	GET_CONTEXT;
+	ctx->glMaterialf(ctx, face, pname, param);
+}
+
+void glMaterialfv(GLenum face, GLenum pname, const GLfloat* params)
+{
+	GET_CONTEXT;
+	ctx->glMaterialfv(ctx, face, pname, params);
+}
+
+void glMultMatrixf(const GLfloat* m)
+{
+	GET_CONTEXT;
+	ctx->glMultMatrixf(ctx, m);
+}
+
+void glMultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
+{
+	GET_CONTEXT;
+	ctx->glMultiTexCoord4f(ctx, target, s, t, r, q);
+}
+
+void glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz)
+{
+	GET_CONTEXT;
+	ctx->glNormal3f(ctx, nx, ny, nz);
+}
+
+void glOrthof(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
+{
+	GET_CONTEXT;
+	ctx->glOrthof(ctx, left, right, bottom, top, zNear, zFar);
+}
+
+void glPointParameterf(GLenum pname, GLfloat param)
+{
+	GET_CONTEXT;
+	ctx->glPointParameterf(ctx, pname, param);
+}
+
+void glPointParameterfv(GLenum pname, const GLfloat* params)
+{
+	GET_CONTEXT;
+	ctx->glPointParameterfv(ctx, pname, params);
+}
+
+void glPointSize(GLfloat size)
+{
+	GET_CONTEXT;
+	ctx->glPointSize(ctx, size);
+}
+
+void glPolygonOffset(GLfloat factor, GLfloat units)
+{
+	GET_CONTEXT;
+	ctx->glPolygonOffset(ctx, factor, units);
+}
+
+void glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
+{
+	GET_CONTEXT;
+	ctx->glRotatef(ctx, angle, x, y, z);
+}
+
+void glScalef(GLfloat x, GLfloat y, GLfloat z)
+{
+	GET_CONTEXT;
+	ctx->glScalef(ctx, x, y, z);
+}
+
+void glTexEnvf(GLenum target, GLenum pname, GLfloat param)
+{
+	GET_CONTEXT;
+	ctx->glTexEnvf(ctx, target, pname, param);
+}
+
+void glTexEnvfv(GLenum target, GLenum pname, const GLfloat* params)
+{
+	GET_CONTEXT;
+	ctx->glTexEnvfv(ctx, target, pname, params);
+}
+
+void glTexParameterf(GLenum target, GLenum pname, GLfloat param)
+{
+	GET_CONTEXT;
+	ctx->glTexParameterf(ctx, target, pname, param);
+}
+
+void glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params)
+{
+	GET_CONTEXT;
+	ctx->glTexParameterfv(ctx, target, pname, params);
+}
+
+void glTranslatef(GLfloat x, GLfloat y, GLfloat z)
+{
+	GET_CONTEXT;
+	ctx->glTranslatef(ctx, x, y, z);
+}
+
+void glActiveTexture(GLenum texture)
+{
+	GET_CONTEXT;
+	ctx->glActiveTexture(ctx, texture);
+}
+
+void glAlphaFuncx(GLenum func, GLclampx ref)
+{
+	GET_CONTEXT;
+	ctx->glAlphaFuncx(ctx, func, ref);
+}
+
+void glBindBuffer(GLenum target, GLuint buffer)
+{
+	GET_CONTEXT;
+	ctx->glBindBuffer(ctx, target, buffer);
+}
+
+void glBindTexture(GLenum target, GLuint texture)
+{
+	GET_CONTEXT;
+	ctx->glBindTexture(ctx, target, texture);
+}
+
+void glBlendFunc(GLenum sfactor, GLenum dfactor)
+{
+	GET_CONTEXT;
+	ctx->glBlendFunc(ctx, sfactor, dfactor);
+}
+
+void glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage)
+{
+	GET_CONTEXT;
+	ctx->glBufferData(ctx, target, size, data, usage);
+}
+
+void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data)
+{
+	GET_CONTEXT;
+	ctx->glBufferSubData(ctx, target, offset, size, data);
+}
+
+void glClear(GLbitfield mask)
+{
+	GET_CONTEXT;
+	ctx->glClear(ctx, mask);
+}
+
+void glClearColorx(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha)
+{
+	GET_CONTEXT;
+	ctx->glClearColorx(ctx, red, green, blue, alpha);
+}
+
+void glClearDepthx(GLclampx depth)
+{
+	GET_CONTEXT;
+	ctx->glClearDepthx(ctx, depth);
+}
+
+void glClearStencil(GLint s)
+{
+	GET_CONTEXT;
+	ctx->glClearStencil(ctx, s);
+}
+
+void glClientActiveTexture(GLenum texture)
+{
+	GET_CONTEXT;
+	ctx->glClientActiveTexture(ctx, texture);
+}
+
+void glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
+{
+	GET_CONTEXT;
+	ctx->glColor4ub(ctx, red, green, blue, alpha);
+}
+
+void glColor4x(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
+{
+	GET_CONTEXT;
+	ctx->glColor4x(ctx, red, green, blue, alpha);
+}
+
+void glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
+{
+	GET_CONTEXT;
+	ctx->glColorMask(ctx, red, green, blue, alpha);
+}
+
+void glColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer)
+{
+	GET_CONTEXT;
+	ctx->glColorPointer(ctx, size, type, stride, pointer);
+}
+
+void glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data)
+{
+	GET_CONTEXT;
+	ctx->glCompressedTexImage2D(ctx, target, level, internalformat, width, height, border, imageSize, data);
+}
+
+void glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data)
+{
+	GET_CONTEXT;
+	ctx->glCompressedTexSubImage2D(ctx, target, level, xoffset, yoffset, width, height, format, imageSize, data);
+}
+
+void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
+{
+	GET_CONTEXT;
+	ctx->glCopyTexImage2D(ctx, target, level, internalformat, x, y, width, height, border);
+}
+
+void glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+	GET_CONTEXT;
+	ctx->glCopyTexSubImage2D(ctx, target, level, xoffset, yoffset, x, y, width, height);
+}
+
+void glCullFace(GLenum mode)
+{
+	GET_CONTEXT;
+	ctx->glCullFace(ctx, mode);
+}
+
+void glDeleteBuffers(GLsizei n, const GLuint* buffers)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glDeleteBuffers(ctx, n, buffers);
+}
+
+void glDeleteTextures(GLsizei n, const GLuint* textures)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glDeleteTextures(ctx, n, textures);
+}
+
+void glDepthFunc(GLenum func)
+{
+	GET_CONTEXT;
+	ctx->glDepthFunc(ctx, func);
+}
+
+void glDepthMask(GLboolean flag)
+{
+	GET_CONTEXT;
+	ctx->glDepthMask(ctx, flag);
+}
+
+void glDepthRangex(GLclampx zNear, GLclampx zFar)
+{
+	GET_CONTEXT;
+	ctx->glDepthRangex(ctx, zNear, zFar);
+}
+
+void glDisable(GLenum cap)
+{
+	GET_CONTEXT;
+	ctx->glDisable(ctx, cap);
+}
+
+void glDisableClientState(GLenum array)
+{
+	GET_CONTEXT;
+	ctx->glDisableClientState(ctx, array);
+}
+
+void glDrawArrays(GLenum mode, GLint first, GLsizei count)
+{
+	GET_CONTEXT;
+	ctx->glDrawArrays(ctx, mode, first, count);
+}
+
+void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices)
+{
+	GET_CONTEXT;
+	ctx->glDrawElements(ctx, mode, count, type, indices);
+}
+
+void glEnable(GLenum cap)
+{
+	GET_CONTEXT;
+	ctx->glEnable(ctx, cap);
+}
+
+void glEnableClientState(GLenum array)
+{
+	GET_CONTEXT;
+	ctx->glEnableClientState(ctx, array);
+}
+
+void glFinish()
+{
+	GET_CONTEXT;
+	ctx->glFinish(ctx);
+}
+
+void glFlush()
+{
+	GET_CONTEXT;
+	ctx->glFlush(ctx);
+}
+
+void glFogx(GLenum pname, GLfixed param)
+{
+	GET_CONTEXT;
+	ctx->glFogx(ctx, pname, param);
+}
+
+void glFogxv(GLenum pname, const GLfixed* params)
+{
+	GET_CONTEXT;
+	ctx->glFogxv(ctx, pname, params);
+}
+
+void glFrontFace(GLenum mode)
+{
+	GET_CONTEXT;
+	ctx->glFrontFace(ctx, mode);
+}
+
+void glFrustumx(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
+{
+	GET_CONTEXT;
+	ctx->glFrustumx(ctx, left, right, bottom, top, zNear, zFar);
+}
+
+void glGetBooleanv(GLenum pname, GLboolean* params)
+{
+	GET_CONTEXT;
+	ctx->glGetBooleanv(ctx, pname, params);
+}
+
+void glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetBufferParameteriv(ctx, target, pname, params);
+}
+
+void glClipPlanex(GLenum pname, const GLfixed* eqn)
+{
+	GET_CONTEXT;
+	ctx->glClipPlanex(ctx, pname, eqn);
+}
+
+void glGenBuffers(GLsizei n, GLuint* buffers)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGenBuffers(ctx, n, buffers);
+}
+
+void glGenTextures(GLsizei n, GLuint* textures)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGenTextures(ctx, n, textures);
+}
+
+GLenum glGetError()
+{
+	GET_CONTEXT;
+	return ctx->glGetError(ctx);
+}
+
+void glGetFixedv(GLenum pname, GLfixed* params)
+{
+	GET_CONTEXT;
+	ctx->glGetFixedv(ctx, pname, params);
+}
+
+void glGetIntegerv(GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetIntegerv(ctx, pname, params);
+}
+
+void glGetLightxv(GLenum light, GLenum pname, GLfixed* params)
+{
+	GET_CONTEXT;
+	ctx->glGetLightxv(ctx, light, pname, params);
+}
+
+void glGetMaterialxv(GLenum face, GLenum pname, GLfixed* params)
+{
+	GET_CONTEXT;
+	ctx->glGetMaterialxv(ctx, face, pname, params);
+}
+
+void glGetPointerv(GLenum pname, GLvoid** params)
+{
+	GET_CONTEXT;
+	ctx->glGetPointerv(ctx, pname, params);
+}
+
+const GLubyte* glGetString(GLenum name)
+{
+	GET_CONTEXT;
+	return ctx->glGetString(ctx, name);
+}
+
+void glGetTexEnviv(GLenum env, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetTexEnviv(ctx, env, pname, params);
+}
+
+void glGetTexEnvxv(GLenum env, GLenum pname, GLfixed* params)
+{
+	GET_CONTEXT;
+	ctx->glGetTexEnvxv(ctx, env, pname, params);
+}
+
+void glGetTexParameteriv(GLenum target, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetTexParameteriv(ctx, target, pname, params);
+}
+
+void glGetTexParameterxv(GLenum target, GLenum pname, GLfixed* params)
+{
+	GET_CONTEXT;
+	ctx->glGetTexParameterxv(ctx, target, pname, params);
+}
+
+void glHint(GLenum target, GLenum mode)
+{
+	GET_CONTEXT;
+	ctx->glHint(ctx, target, mode);
+}
+
+GLboolean glIsBuffer(GLuint buffer)
+{
+	GET_CONTEXT;
+	return ctx->glIsBuffer(ctx, buffer);
+}
+
+GLboolean glIsEnabled(GLenum cap)
+{
+	GET_CONTEXT;
+	return ctx->glIsEnabled(ctx, cap);
+}
+
+GLboolean glIsTexture(GLuint texture)
+{
+	GET_CONTEXT;
+	return ctx->glIsTexture(ctx, texture);
+}
+
+void glLightModelx(GLenum pname, GLfixed param)
+{
+	GET_CONTEXT;
+	ctx->glLightModelx(ctx, pname, param);
+}
+
+void glLightModelxv(GLenum pname, const GLfixed* params)
+{
+	GET_CONTEXT;
+	ctx->glLightModelxv(ctx, pname, params);
+}
+
+void glLightx(GLenum light, GLenum pname, GLfixed param)
+{
+	GET_CONTEXT;
+	ctx->glLightx(ctx, light, pname, param);
+}
+
+void glLightxv(GLenum light, GLenum pname, const GLfixed* params)
+{
+	GET_CONTEXT;
+	ctx->glLightxv(ctx, light, pname, params);
+}
+
+void glLineWidthx(GLfixed width)
+{
+	GET_CONTEXT;
+	ctx->glLineWidthx(ctx, width);
+}
+
+void glLoadIdentity()
+{
+	GET_CONTEXT;
+	ctx->glLoadIdentity(ctx);
+}
+
+void glLoadMatrixx(const GLfixed* m)
+{
+	GET_CONTEXT;
+	ctx->glLoadMatrixx(ctx, m);
+}
+
+void glLogicOp(GLenum opcode)
+{
+	GET_CONTEXT;
+	ctx->glLogicOp(ctx, opcode);
+}
+
+void glMaterialx(GLenum face, GLenum pname, GLfixed param)
+{
+	GET_CONTEXT;
+	ctx->glMaterialx(ctx, face, pname, param);
+}
+
+void glMaterialxv(GLenum face, GLenum pname, const GLfixed* params)
+{
+	GET_CONTEXT;
+	ctx->glMaterialxv(ctx, face, pname, params);
+}
+
+void glMatrixMode(GLenum mode)
+{
+	GET_CONTEXT;
+	ctx->glMatrixMode(ctx, mode);
+}
+
+void glMultMatrixx(const GLfixed* m)
+{
+	GET_CONTEXT;
+	ctx->glMultMatrixx(ctx, m);
+}
+
+void glMultiTexCoord4x(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
+{
+	GET_CONTEXT;
+	ctx->glMultiTexCoord4x(ctx, target, s, t, r, q);
+}
+
+void glNormal3x(GLfixed nx, GLfixed ny, GLfixed nz)
+{
+	GET_CONTEXT;
+	ctx->glNormal3x(ctx, nx, ny, nz);
+}
+
+void glNormalPointer(GLenum type, GLsizei stride, const GLvoid* pointer)
+{
+	GET_CONTEXT;
+	ctx->glNormalPointer(ctx, type, stride, pointer);
+}
+
+void glOrthox(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
+{
+	GET_CONTEXT;
+	ctx->glOrthox(ctx, left, right, bottom, top, zNear, zFar);
+}
+
+void glPixelStorei(GLenum pname, GLint param)
+{
+	GET_CONTEXT;
+	ctx->glPixelStorei(ctx, pname, param);
+}
+
+void glPointParameterx(GLenum pname, GLfixed param)
+{
+	GET_CONTEXT;
+	ctx->glPointParameterx(ctx, pname, param);
+}
+
+void glPointParameterxv(GLenum pname, const GLfixed* params)
+{
+	GET_CONTEXT;
+	ctx->glPointParameterxv(ctx, pname, params);
+}
+
+void glPointSizex(GLfixed size)
+{
+	GET_CONTEXT;
+	ctx->glPointSizex(ctx, size);
+}
+
+void glPolygonOffsetx(GLfixed factor, GLfixed units)
+{
+	GET_CONTEXT;
+	ctx->glPolygonOffsetx(ctx, factor, units);
+}
+
+void glPopMatrix()
+{
+	GET_CONTEXT;
+	ctx->glPopMatrix(ctx);
+}
+
+void glPushMatrix()
+{
+	GET_CONTEXT;
+	ctx->glPushMatrix(ctx);
+}
+
+void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels)
+{
+	GET_CONTEXT;
+	ctx->glReadPixels(ctx, x, y, width, height, format, type, pixels);
+}
+
+void glRotatex(GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
+{
+	GET_CONTEXT;
+	ctx->glRotatex(ctx, angle, x, y, z);
+}
+
+void glSampleCoverage(GLclampf value, GLboolean invert)
+{
+	GET_CONTEXT;
+	ctx->glSampleCoverage(ctx, value, invert);
+}
+
+void glSampleCoveragex(GLclampx value, GLboolean invert)
+{
+	GET_CONTEXT;
+	ctx->glSampleCoveragex(ctx, value, invert);
+}
+
+void glScalex(GLfixed x, GLfixed y, GLfixed z)
+{
+	GET_CONTEXT;
+	ctx->glScalex(ctx, x, y, z);
+}
+
+void glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
+{
+	GET_CONTEXT;
+	ctx->glScissor(ctx, x, y, width, height);
+}
+
+void glShadeModel(GLenum mode)
+{
+	GET_CONTEXT;
+	ctx->glShadeModel(ctx, mode);
+}
+
+void glStencilFunc(GLenum func, GLint ref, GLuint mask)
+{
+	GET_CONTEXT;
+	ctx->glStencilFunc(ctx, func, ref, mask);
+}
+
+void glStencilMask(GLuint mask)
+{
+	GET_CONTEXT;
+	ctx->glStencilMask(ctx, mask);
+}
+
+void glStencilOp(GLenum fail, GLenum zfail, GLenum zpass)
+{
+	GET_CONTEXT;
+	ctx->glStencilOp(ctx, fail, zfail, zpass);
+}
+
+void glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer)
+{
+	GET_CONTEXT;
+	ctx->glTexCoordPointer(ctx, size, type, stride, pointer);
+}
+
+void glTexEnvi(GLenum target, GLenum pname, GLint param)
+{
+	GET_CONTEXT;
+	ctx->glTexEnvi(ctx, target, pname, param);
+}
+
+void glTexEnvx(GLenum target, GLenum pname, GLfixed param)
+{
+	GET_CONTEXT;
+	ctx->glTexEnvx(ctx, target, pname, param);
+}
+
+void glTexEnviv(GLenum target, GLenum pname, const GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glTexEnviv(ctx, target, pname, params);
+}
+
+void glTexEnvxv(GLenum target, GLenum pname, const GLfixed* params)
+{
+	GET_CONTEXT;
+	ctx->glTexEnvxv(ctx, target, pname, params);
+}
+
+void glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
+{
+	GET_CONTEXT;
+	ctx->glTexImage2D(ctx, target, level, internalformat, width, height, border, format, type, pixels);
+}
+
+void glTexParameteri(GLenum target, GLenum pname, GLint param)
+{
+	GET_CONTEXT;
+	ctx->glTexParameteri(ctx, target, pname, param);
+}
+
+void glTexParameterx(GLenum target, GLenum pname, GLfixed param)
+{
+	GET_CONTEXT;
+	ctx->glTexParameterx(ctx, target, pname, param);
+}
+
+void glTexParameteriv(GLenum target, GLenum pname, const GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glTexParameteriv(ctx, target, pname, params);
+}
+
+void glTexParameterxv(GLenum target, GLenum pname, const GLfixed* params)
+{
+	GET_CONTEXT;
+	ctx->glTexParameterxv(ctx, target, pname, params);
+}
+
+void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels)
+{
+	GET_CONTEXT;
+	ctx->glTexSubImage2D(ctx, target, level, xoffset, yoffset, width, height, format, type, pixels);
+}
+
+void glTranslatex(GLfixed x, GLfixed y, GLfixed z)
+{
+	GET_CONTEXT;
+	ctx->glTranslatex(ctx, x, y, z);
+}
+
+void glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer)
+{
+	GET_CONTEXT;
+	ctx->glVertexPointer(ctx, size, type, stride, pointer);
+}
+
+void glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
+{
+	GET_CONTEXT;
+	ctx->glViewport(ctx, x, y, width, height);
+}
+
+void glPointSizePointerOES(GLenum type, GLsizei stride, const GLvoid* pointer)
+{
+	GET_CONTEXT;
+	ctx->glPointSizePointerOES(ctx, type, stride, pointer);
+}
+
+void glVertexPointerOffset(GLint size, GLenum type, GLsizei stride, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glVertexPointerOffset(ctx, size, type, stride, offset);
+}
+
+void glColorPointerOffset(GLint size, GLenum type, GLsizei stride, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glColorPointerOffset(ctx, size, type, stride, offset);
+}
+
+void glNormalPointerOffset(GLenum type, GLsizei stride, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glNormalPointerOffset(ctx, type, stride, offset);
+}
+
+void glPointSizePointerOffset(GLenum type, GLsizei stride, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glPointSizePointerOffset(ctx, type, stride, offset);
+}
+
+void glTexCoordPointerOffset(GLint size, GLenum type, GLsizei stride, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glTexCoordPointerOffset(ctx, size, type, stride, offset);
+}
+
+void glWeightPointerOffset(GLint size, GLenum type, GLsizei stride, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glWeightPointerOffset(ctx, size, type, stride, offset);
+}
+
+void glMatrixIndexPointerOffset(GLint size, GLenum type, GLsizei stride, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glMatrixIndexPointerOffset(ctx, size, type, stride, offset);
+}
+
+void glVertexPointerData(GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
+{
+	GET_CONTEXT;
+	ctx->glVertexPointerData(ctx, size, type, stride, data, datalen);
+}
+
+void glColorPointerData(GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
+{
+	GET_CONTEXT;
+	ctx->glColorPointerData(ctx, size, type, stride, data, datalen);
+}
+
+void glNormalPointerData(GLenum type, GLsizei stride, void* data, GLuint datalen)
+{
+	GET_CONTEXT;
+	ctx->glNormalPointerData(ctx, type, stride, data, datalen);
+}
+
+void glTexCoordPointerData(GLint unit, GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
+{
+	GET_CONTEXT;
+	ctx->glTexCoordPointerData(ctx, unit, size, type, stride, data, datalen);
+}
+
+void glPointSizePointerData(GLenum type, GLsizei stride, void* data, GLuint datalen)
+{
+	GET_CONTEXT;
+	ctx->glPointSizePointerData(ctx, type, stride, data, datalen);
+}
+
+void glWeightPointerData(GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
+{
+	GET_CONTEXT;
+	ctx->glWeightPointerData(ctx, size, type, stride, data, datalen);
+}
+
+void glMatrixIndexPointerData(GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
+{
+	GET_CONTEXT;
+	ctx->glMatrixIndexPointerData(ctx, size, type, stride, data, datalen);
+}
+
+void glDrawElementsOffset(GLenum mode, GLsizei count, GLenum type, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glDrawElementsOffset(ctx, mode, count, type, offset);
+}
+
+void glDrawElementsData(GLenum mode, GLsizei count, GLenum type, void* data, GLuint datalen)
+{
+	GET_CONTEXT;
+	ctx->glDrawElementsData(ctx, mode, count, type, data, datalen);
+}
+
+void glGetCompressedTextureFormats(int count, GLint* formats)
+{
+	GET_CONTEXT;
+	ctx->glGetCompressedTextureFormats(ctx, count, formats);
+}
+
+int glFinishRoundTrip()
+{
+	GET_CONTEXT;
+	return ctx->glFinishRoundTrip(ctx);
+}
+
+void glBlendEquationSeparateOES(GLenum modeRGB, GLenum modeAlpha)
+{
+	GET_CONTEXT;
+	ctx->glBlendEquationSeparateOES(ctx, modeRGB, modeAlpha);
+}
+
+void glBlendFuncSeparateOES(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
+{
+	GET_CONTEXT;
+	ctx->glBlendFuncSeparateOES(ctx, srcRGB, dstRGB, srcAlpha, dstAlpha);
+}
+
+void glBlendEquationOES(GLenum mode)
+{
+	GET_CONTEXT;
+	ctx->glBlendEquationOES(ctx, mode);
+}
+
+void glDrawTexsOES(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height)
+{
+	GET_CONTEXT;
+	ctx->glDrawTexsOES(ctx, x, y, z, width, height);
+}
+
+void glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height)
+{
+	GET_CONTEXT;
+	ctx->glDrawTexiOES(ctx, x, y, z, width, height);
+}
+
+void glDrawTexxOES(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height)
+{
+	GET_CONTEXT;
+	ctx->glDrawTexxOES(ctx, x, y, z, width, height);
+}
+
+void glDrawTexsvOES(const GLshort* coords)
+{
+	GET_CONTEXT;
+	ctx->glDrawTexsvOES(ctx, coords);
+}
+
+void glDrawTexivOES(const GLint* coords)
+{
+	GET_CONTEXT;
+	ctx->glDrawTexivOES(ctx, coords);
+}
+
+void glDrawTexxvOES(const GLfixed* coords)
+{
+	GET_CONTEXT;
+	ctx->glDrawTexxvOES(ctx, coords);
+}
+
+void glDrawTexfOES(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height)
+{
+	GET_CONTEXT;
+	ctx->glDrawTexfOES(ctx, x, y, z, width, height);
+}
+
+void glDrawTexfvOES(const GLfloat* coords)
+{
+	GET_CONTEXT;
+	ctx->glDrawTexfvOES(ctx, coords);
+}
+
+void glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image)
+{
+	GET_CONTEXT;
+	ctx->glEGLImageTargetTexture2DOES(ctx, target, image);
+}
+
+void glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image)
+{
+	GET_CONTEXT;
+	ctx->glEGLImageTargetRenderbufferStorageOES(ctx, target, image);
+}
+
+void glAlphaFuncxOES(GLenum func, GLclampx ref)
+{
+	GET_CONTEXT;
+	ctx->glAlphaFuncxOES(ctx, func, ref);
+}
+
+void glClearColorxOES(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha)
+{
+	GET_CONTEXT;
+	ctx->glClearColorxOES(ctx, red, green, blue, alpha);
+}
+
+void glClearDepthxOES(GLclampx depth)
+{
+	GET_CONTEXT;
+	ctx->glClearDepthxOES(ctx, depth);
+}
+
+void glClipPlanexOES(GLenum plane, const GLfixed* equation)
+{
+	GET_CONTEXT;
+	ctx->glClipPlanexOES(ctx, plane, equation);
+}
+
+void glClipPlanexIMG(GLenum plane, const GLfixed* equation)
+{
+	GET_CONTEXT;
+	ctx->glClipPlanexIMG(ctx, plane, equation);
+}
+
+void glColor4xOES(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
+{
+	GET_CONTEXT;
+	ctx->glColor4xOES(ctx, red, green, blue, alpha);
+}
+
+void glDepthRangexOES(GLclampx zNear, GLclampx zFar)
+{
+	GET_CONTEXT;
+	ctx->glDepthRangexOES(ctx, zNear, zFar);
+}
+
+void glFogxOES(GLenum pname, GLfixed param)
+{
+	GET_CONTEXT;
+	ctx->glFogxOES(ctx, pname, param);
+}
+
+void glFogxvOES(GLenum pname, const GLfixed* params)
+{
+	GET_CONTEXT;
+	ctx->glFogxvOES(ctx, pname, params);
+}
+
+void glFrustumxOES(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
+{
+	GET_CONTEXT;
+	ctx->glFrustumxOES(ctx, left, right, bottom, top, zNear, zFar);
+}
+
+void glGetClipPlanexOES(GLenum pname, GLfixed* eqn)
+{
+	GET_CONTEXT;
+	ctx->glGetClipPlanexOES(ctx, pname, eqn);
+}
+
+void glGetClipPlanex(GLenum pname, GLfixed* eqn)
+{
+	GET_CONTEXT;
+	ctx->glGetClipPlanex(ctx, pname, eqn);
+}
+
+void glGetFixedvOES(GLenum pname, GLfixed* params)
+{
+	GET_CONTEXT;
+	ctx->glGetFixedvOES(ctx, pname, params);
+}
+
+void glGetLightxvOES(GLenum light, GLenum pname, GLfixed* params)
+{
+	GET_CONTEXT;
+	ctx->glGetLightxvOES(ctx, light, pname, params);
+}
+
+void glGetMaterialxvOES(GLenum face, GLenum pname, GLfixed* params)
+{
+	GET_CONTEXT;
+	ctx->glGetMaterialxvOES(ctx, face, pname, params);
+}
+
+void glGetTexEnvxvOES(GLenum env, GLenum pname, GLfixed* params)
+{
+	GET_CONTEXT;
+	ctx->glGetTexEnvxvOES(ctx, env, pname, params);
+}
+
+void glGetTexParameterxvOES(GLenum target, GLenum pname, GLfixed* params)
+{
+	GET_CONTEXT;
+	ctx->glGetTexParameterxvOES(ctx, target, pname, params);
+}
+
+void glLightModelxOES(GLenum pname, GLfixed param)
+{
+	GET_CONTEXT;
+	ctx->glLightModelxOES(ctx, pname, param);
+}
+
+void glLightModelxvOES(GLenum pname, const GLfixed* params)
+{
+	GET_CONTEXT;
+	ctx->glLightModelxvOES(ctx, pname, params);
+}
+
+void glLightxOES(GLenum light, GLenum pname, GLfixed param)
+{
+	GET_CONTEXT;
+	ctx->glLightxOES(ctx, light, pname, param);
+}
+
+void glLightxvOES(GLenum light, GLenum pname, const GLfixed* params)
+{
+	GET_CONTEXT;
+	ctx->glLightxvOES(ctx, light, pname, params);
+}
+
+void glLineWidthxOES(GLfixed width)
+{
+	GET_CONTEXT;
+	ctx->glLineWidthxOES(ctx, width);
+}
+
+void glLoadMatrixxOES(const GLfixed* m)
+{
+	GET_CONTEXT;
+	ctx->glLoadMatrixxOES(ctx, m);
+}
+
+void glMaterialxOES(GLenum face, GLenum pname, GLfixed param)
+{
+	GET_CONTEXT;
+	ctx->glMaterialxOES(ctx, face, pname, param);
+}
+
+void glMaterialxvOES(GLenum face, GLenum pname, const GLfixed* params)
+{
+	GET_CONTEXT;
+	ctx->glMaterialxvOES(ctx, face, pname, params);
+}
+
+void glMultMatrixxOES(const GLfixed* m)
+{
+	GET_CONTEXT;
+	ctx->glMultMatrixxOES(ctx, m);
+}
+
+void glMultiTexCoord4xOES(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
+{
+	GET_CONTEXT;
+	ctx->glMultiTexCoord4xOES(ctx, target, s, t, r, q);
+}
+
+void glNormal3xOES(GLfixed nx, GLfixed ny, GLfixed nz)
+{
+	GET_CONTEXT;
+	ctx->glNormal3xOES(ctx, nx, ny, nz);
+}
+
+void glOrthoxOES(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
+{
+	GET_CONTEXT;
+	ctx->glOrthoxOES(ctx, left, right, bottom, top, zNear, zFar);
+}
+
+void glPointParameterxOES(GLenum pname, GLfixed param)
+{
+	GET_CONTEXT;
+	ctx->glPointParameterxOES(ctx, pname, param);
+}
+
+void glPointParameterxvOES(GLenum pname, const GLfixed* params)
+{
+	GET_CONTEXT;
+	ctx->glPointParameterxvOES(ctx, pname, params);
+}
+
+void glPointSizexOES(GLfixed size)
+{
+	GET_CONTEXT;
+	ctx->glPointSizexOES(ctx, size);
+}
+
+void glPolygonOffsetxOES(GLfixed factor, GLfixed units)
+{
+	GET_CONTEXT;
+	ctx->glPolygonOffsetxOES(ctx, factor, units);
+}
+
+void glRotatexOES(GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
+{
+	GET_CONTEXT;
+	ctx->glRotatexOES(ctx, angle, x, y, z);
+}
+
+void glSampleCoveragexOES(GLclampx value, GLboolean invert)
+{
+	GET_CONTEXT;
+	ctx->glSampleCoveragexOES(ctx, value, invert);
+}
+
+void glScalexOES(GLfixed x, GLfixed y, GLfixed z)
+{
+	GET_CONTEXT;
+	ctx->glScalexOES(ctx, x, y, z);
+}
+
+void glTexEnvxOES(GLenum target, GLenum pname, GLfixed param)
+{
+	GET_CONTEXT;
+	ctx->glTexEnvxOES(ctx, target, pname, param);
+}
+
+void glTexEnvxvOES(GLenum target, GLenum pname, const GLfixed* params)
+{
+	GET_CONTEXT;
+	ctx->glTexEnvxvOES(ctx, target, pname, params);
+}
+
+void glTexParameterxOES(GLenum target, GLenum pname, GLfixed param)
+{
+	GET_CONTEXT;
+	ctx->glTexParameterxOES(ctx, target, pname, param);
+}
+
+void glTexParameterxvOES(GLenum target, GLenum pname, const GLfixed* params)
+{
+	GET_CONTEXT;
+	ctx->glTexParameterxvOES(ctx, target, pname, params);
+}
+
+void glTranslatexOES(GLfixed x, GLfixed y, GLfixed z)
+{
+	GET_CONTEXT;
+	ctx->glTranslatexOES(ctx, x, y, z);
+}
+
+GLboolean glIsRenderbufferOES(GLuint renderbuffer)
+{
+	GET_CONTEXT;
+	return ctx->glIsRenderbufferOES(ctx, renderbuffer);
+}
+
+void glBindRenderbufferOES(GLenum target, GLuint renderbuffer)
+{
+	GET_CONTEXT;
+	ctx->glBindRenderbufferOES(ctx, target, renderbuffer);
+}
+
+void glDeleteRenderbuffersOES(GLsizei n, const GLuint* renderbuffers)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glDeleteRenderbuffersOES(ctx, n, renderbuffers);
+}
+
+void glGenRenderbuffersOES(GLsizei n, GLuint* renderbuffers)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGenRenderbuffersOES(ctx, n, renderbuffers);
+}
+
+void glRenderbufferStorageOES(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
+{
+	GET_CONTEXT;
+	ctx->glRenderbufferStorageOES(ctx, target, internalformat, width, height);
+}
+
+void glGetRenderbufferParameterivOES(GLenum target, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetRenderbufferParameterivOES(ctx, target, pname, params);
+}
+
+GLboolean glIsFramebufferOES(GLuint framebuffer)
+{
+	GET_CONTEXT;
+	return ctx->glIsFramebufferOES(ctx, framebuffer);
+}
+
+void glBindFramebufferOES(GLenum target, GLuint framebuffer)
+{
+	GET_CONTEXT;
+	ctx->glBindFramebufferOES(ctx, target, framebuffer);
+}
+
+void glDeleteFramebuffersOES(GLsizei n, const GLuint* framebuffers)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glDeleteFramebuffersOES(ctx, n, framebuffers);
+}
+
+void glGenFramebuffersOES(GLsizei n, GLuint* framebuffers)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGenFramebuffersOES(ctx, n, framebuffers);
+}
+
+GLenum glCheckFramebufferStatusOES(GLenum target)
+{
+	GET_CONTEXT;
+	return ctx->glCheckFramebufferStatusOES(ctx, target);
+}
+
+void glFramebufferRenderbufferOES(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
+{
+	GET_CONTEXT;
+	ctx->glFramebufferRenderbufferOES(ctx, target, attachment, renderbuffertarget, renderbuffer);
+}
+
+void glFramebufferTexture2DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
+{
+	GET_CONTEXT;
+	ctx->glFramebufferTexture2DOES(ctx, target, attachment, textarget, texture, level);
+}
+
+void glGetFramebufferAttachmentParameterivOES(GLenum target, GLenum attachment, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetFramebufferAttachmentParameterivOES(ctx, target, attachment, pname, params);
+}
+
+void glGenerateMipmapOES(GLenum target)
+{
+	GET_CONTEXT;
+	ctx->glGenerateMipmapOES(ctx, target);
+}
+
+void* glMapBufferOES(GLenum target, GLenum access)
+{
+	GET_CONTEXT;
+	return ctx->glMapBufferOES(ctx, target, access);
+}
+
+GLboolean glUnmapBufferOES(GLenum target)
+{
+	GET_CONTEXT;
+	return ctx->glUnmapBufferOES(ctx, target);
+}
+
+void glGetBufferPointervOES(GLenum target, GLenum pname, GLvoid** params)
+{
+	GET_CONTEXT;
+	ctx->glGetBufferPointervOES(ctx, target, pname, params);
+}
+
+void glCurrentPaletteMatrixOES(GLuint matrixpaletteindex)
+{
+	GET_CONTEXT;
+	ctx->glCurrentPaletteMatrixOES(ctx, matrixpaletteindex);
+}
+
+void glLoadPaletteFromModelViewMatrixOES()
+{
+	GET_CONTEXT;
+	ctx->glLoadPaletteFromModelViewMatrixOES(ctx);
+}
+
+void glMatrixIndexPointerOES(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer)
+{
+	GET_CONTEXT;
+	ctx->glMatrixIndexPointerOES(ctx, size, type, stride, pointer);
+}
+
+void glWeightPointerOES(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer)
+{
+	GET_CONTEXT;
+	ctx->glWeightPointerOES(ctx, size, type, stride, pointer);
+}
+
+GLbitfield glQueryMatrixxOES(GLfixed* mantissa, GLint* exponent)
+{
+	GET_CONTEXT;
+	return ctx->glQueryMatrixxOES(ctx, mantissa, exponent);
+}
+
+void glDepthRangefOES(GLclampf zNear, GLclampf zFar)
+{
+	GET_CONTEXT;
+	ctx->glDepthRangefOES(ctx, zNear, zFar);
+}
+
+void glFrustumfOES(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
+{
+	GET_CONTEXT;
+	ctx->glFrustumfOES(ctx, left, right, bottom, top, zNear, zFar);
+}
+
+void glOrthofOES(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
+{
+	GET_CONTEXT;
+	ctx->glOrthofOES(ctx, left, right, bottom, top, zNear, zFar);
+}
+
+void glClipPlanefOES(GLenum plane, const GLfloat* equation)
+{
+	GET_CONTEXT;
+	ctx->glClipPlanefOES(ctx, plane, equation);
+}
+
+void glClipPlanefIMG(GLenum plane, const GLfloat* equation)
+{
+	GET_CONTEXT;
+	ctx->glClipPlanefIMG(ctx, plane, equation);
+}
+
+void glGetClipPlanefOES(GLenum pname, GLfloat* eqn)
+{
+	GET_CONTEXT;
+	ctx->glGetClipPlanefOES(ctx, pname, eqn);
+}
+
+void glClearDepthfOES(GLclampf depth)
+{
+	GET_CONTEXT;
+	ctx->glClearDepthfOES(ctx, depth);
+}
+
+void glTexGenfOES(GLenum coord, GLenum pname, GLfloat param)
+{
+	GET_CONTEXT;
+	ctx->glTexGenfOES(ctx, coord, pname, param);
+}
+
+void glTexGenfvOES(GLenum coord, GLenum pname, const GLfloat* params)
+{
+	GET_CONTEXT;
+	ctx->glTexGenfvOES(ctx, coord, pname, params);
+}
+
+void glTexGeniOES(GLenum coord, GLenum pname, GLint param)
+{
+	GET_CONTEXT;
+	ctx->glTexGeniOES(ctx, coord, pname, param);
+}
+
+void glTexGenivOES(GLenum coord, GLenum pname, const GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glTexGenivOES(ctx, coord, pname, params);
+}
+
+void glTexGenxOES(GLenum coord, GLenum pname, GLfixed param)
+{
+	GET_CONTEXT;
+	ctx->glTexGenxOES(ctx, coord, pname, param);
+}
+
+void glTexGenxvOES(GLenum coord, GLenum pname, const GLfixed* params)
+{
+	GET_CONTEXT;
+	ctx->glTexGenxvOES(ctx, coord, pname, params);
+}
+
+void glGetTexGenfvOES(GLenum coord, GLenum pname, GLfloat* params)
+{
+	GET_CONTEXT;
+	ctx->glGetTexGenfvOES(ctx, coord, pname, params);
+}
+
+void glGetTexGenivOES(GLenum coord, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetTexGenivOES(ctx, coord, pname, params);
+}
+
+void glGetTexGenxvOES(GLenum coord, GLenum pname, GLfixed* params)
+{
+	GET_CONTEXT;
+	ctx->glGetTexGenxvOES(ctx, coord, pname, params);
+}
+
+void glBindVertexArrayOES(GLuint array)
+{
+	GET_CONTEXT;
+	ctx->glBindVertexArrayOES(ctx, array);
+}
+
+void glDeleteVertexArraysOES(GLsizei n, const GLuint* arrays)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glDeleteVertexArraysOES(ctx, n, arrays);
+}
+
+void glGenVertexArraysOES(GLsizei n, GLuint* arrays)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGenVertexArraysOES(ctx, n, arrays);
+}
+
+GLboolean glIsVertexArrayOES(GLuint array)
+{
+	GET_CONTEXT;
+	return ctx->glIsVertexArrayOES(ctx, array);
+}
+
+void glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum* attachments)
+{
+	GET_CONTEXT;
+	ctx->glDiscardFramebufferEXT(ctx, target, numAttachments, attachments);
+}
+
+void glMultiDrawArraysEXT(GLenum mode, const GLint* first, const GLsizei* count, GLsizei primcount)
+{
+	GET_CONTEXT;
+	ctx->glMultiDrawArraysEXT(ctx, mode, first, count, primcount);
+}
+
+void glMultiDrawElementsEXT(GLenum mode, const GLsizei* count, GLenum type, const GLvoid* const* indices, GLsizei primcount)
+{
+	GET_CONTEXT;
+	ctx->glMultiDrawElementsEXT(ctx, mode, count, type, indices, primcount);
+}
+
+void glMultiDrawArraysSUN(GLenum mode, GLint* first, GLsizei* count, GLsizei primcount)
+{
+	GET_CONTEXT;
+	ctx->glMultiDrawArraysSUN(ctx, mode, first, count, primcount);
+}
+
+void glMultiDrawElementsSUN(GLenum mode, const GLsizei* count, GLenum type, const GLvoid** indices, GLsizei primcount)
+{
+	GET_CONTEXT;
+	ctx->glMultiDrawElementsSUN(ctx, mode, count, type, indices, primcount);
+}
+
+void glRenderbufferStorageMultisampleIMG(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
+{
+	GET_CONTEXT;
+	ctx->glRenderbufferStorageMultisampleIMG(ctx, target, samples, internalformat, width, height);
+}
+
+void glFramebufferTexture2DMultisampleIMG(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples)
+{
+	GET_CONTEXT;
+	ctx->glFramebufferTexture2DMultisampleIMG(ctx, target, attachment, textarget, texture, level, samples);
+}
+
+void glDeleteFencesNV(GLsizei n, const GLuint* fences)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glDeleteFencesNV(ctx, n, fences);
+}
+
+void glGenFencesNV(GLsizei n, GLuint* fences)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGenFencesNV(ctx, n, fences);
+}
+
+GLboolean glIsFenceNV(GLuint fence)
+{
+	GET_CONTEXT;
+	return ctx->glIsFenceNV(ctx, fence);
+}
+
+GLboolean glTestFenceNV(GLuint fence)
+{
+	GET_CONTEXT;
+	return ctx->glTestFenceNV(ctx, fence);
+}
+
+void glGetFenceivNV(GLuint fence, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetFenceivNV(ctx, fence, pname, params);
+}
+
+void glFinishFenceNV(GLuint fence)
+{
+	GET_CONTEXT;
+	ctx->glFinishFenceNV(ctx, fence);
+}
+
+void glSetFenceNV(GLuint fence, GLenum condition)
+{
+	GET_CONTEXT;
+	ctx->glSetFenceNV(ctx, fence, condition);
+}
+
+void glGetDriverControlsQCOM(GLint* num, GLsizei size, GLuint* driverControls)
+{
+	GET_CONTEXT;
+	ctx->glGetDriverControlsQCOM(ctx, num, size, driverControls);
+}
+
+void glGetDriverControlStringQCOM(GLuint driverControl, GLsizei bufSize, GLsizei* length, GLchar* driverControlString)
+{
+	GET_CONTEXT;
+	ctx->glGetDriverControlStringQCOM(ctx, driverControl, bufSize, length, driverControlString);
+}
+
+void glEnableDriverControlQCOM(GLuint driverControl)
+{
+	GET_CONTEXT;
+	ctx->glEnableDriverControlQCOM(ctx, driverControl);
+}
+
+void glDisableDriverControlQCOM(GLuint driverControl)
+{
+	GET_CONTEXT;
+	ctx->glDisableDriverControlQCOM(ctx, driverControl);
+}
+
+void glExtGetTexturesQCOM(GLuint* textures, GLint maxTextures, GLint* numTextures)
+{
+	GET_CONTEXT;
+	ctx->glExtGetTexturesQCOM(ctx, textures, maxTextures, numTextures);
+}
+
+void glExtGetBuffersQCOM(GLuint* buffers, GLint maxBuffers, GLint* numBuffers)
+{
+	GET_CONTEXT;
+	ctx->glExtGetBuffersQCOM(ctx, buffers, maxBuffers, numBuffers);
+}
+
+void glExtGetRenderbuffersQCOM(GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers)
+{
+	GET_CONTEXT;
+	ctx->glExtGetRenderbuffersQCOM(ctx, renderbuffers, maxRenderbuffers, numRenderbuffers);
+}
+
+void glExtGetFramebuffersQCOM(GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers)
+{
+	GET_CONTEXT;
+	ctx->glExtGetFramebuffersQCOM(ctx, framebuffers, maxFramebuffers, numFramebuffers);
+}
+
+void glExtGetTexLevelParameterivQCOM(GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glExtGetTexLevelParameterivQCOM(ctx, texture, face, level, pname, params);
+}
+
+void glExtTexObjectStateOverrideiQCOM(GLenum target, GLenum pname, GLint param)
+{
+	GET_CONTEXT;
+	ctx->glExtTexObjectStateOverrideiQCOM(ctx, target, pname, param);
+}
+
+void glExtGetTexSubImageQCOM(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid* texels)
+{
+	GET_CONTEXT;
+	ctx->glExtGetTexSubImageQCOM(ctx, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, texels);
+}
+
+void glExtGetBufferPointervQCOM(GLenum target, GLvoid** params)
+{
+	GET_CONTEXT;
+	ctx->glExtGetBufferPointervQCOM(ctx, target, params);
+}
+
+void glExtGetShadersQCOM(GLuint* shaders, GLint maxShaders, GLint* numShaders)
+{
+	GET_CONTEXT;
+	ctx->glExtGetShadersQCOM(ctx, shaders, maxShaders, numShaders);
+}
+
+void glExtGetProgramsQCOM(GLuint* programs, GLint maxPrograms, GLint* numPrograms)
+{
+	GET_CONTEXT;
+	ctx->glExtGetProgramsQCOM(ctx, programs, maxPrograms, numPrograms);
+}
+
+GLboolean glExtIsProgramBinaryQCOM(GLuint program)
+{
+	GET_CONTEXT;
+	return ctx->glExtIsProgramBinaryQCOM(ctx, program);
+}
+
+void glExtGetProgramBinarySourceQCOM(GLuint program, GLenum shadertype, GLchar* source, GLint* length)
+{
+	GET_CONTEXT;
+	ctx->glExtGetProgramBinarySourceQCOM(ctx, program, shadertype, source, length);
+}
+
+void glStartTilingQCOM(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask)
+{
+	GET_CONTEXT;
+	ctx->glStartTilingQCOM(ctx, x, y, width, height, preserveMask);
+}
+
+void glEndTilingQCOM(GLbitfield preserveMask)
+{
+	GET_CONTEXT;
+	ctx->glEndTilingQCOM(ctx, preserveMask);
+}
+
+GLenum glGetGraphicsResetStatusEXT()
+{
+	GET_CONTEXT;
+	return ctx->glGetGraphicsResetStatusEXT(ctx);
+}
+
+void glReadnPixelsEXT(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid* data)
+{
+	GET_CONTEXT;
+	ctx->glReadnPixelsEXT(ctx, x, y, width, height, format, type, bufSize, data);
+}
+
diff --git a/system/GLESv1_enc/gl_ftable.h b/system/GLESv1_enc/gl_ftable.h
new file mode 100644
index 0000000..2570a82
--- /dev/null
+++ b/system/GLESv1_enc/gl_ftable.h
@@ -0,0 +1,290 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+#ifndef __gl_client_ftable_t_h
+#define __gl_client_ftable_t_h
+
+
+static const struct _gl_funcs_by_name {
+	const char *name;
+	void *proc;
+} gl_funcs_by_name[] = {
+	{"glAlphaFunc", (void*)glAlphaFunc},
+	{"glClearColor", (void*)glClearColor},
+	{"glClearDepthf", (void*)glClearDepthf},
+	{"glClipPlanef", (void*)glClipPlanef},
+	{"glColor4f", (void*)glColor4f},
+	{"glDepthRangef", (void*)glDepthRangef},
+	{"glFogf", (void*)glFogf},
+	{"glFogfv", (void*)glFogfv},
+	{"glFrustumf", (void*)glFrustumf},
+	{"glGetClipPlanef", (void*)glGetClipPlanef},
+	{"glGetFloatv", (void*)glGetFloatv},
+	{"glGetLightfv", (void*)glGetLightfv},
+	{"glGetMaterialfv", (void*)glGetMaterialfv},
+	{"glGetTexEnvfv", (void*)glGetTexEnvfv},
+	{"glGetTexParameterfv", (void*)glGetTexParameterfv},
+	{"glLightModelf", (void*)glLightModelf},
+	{"glLightModelfv", (void*)glLightModelfv},
+	{"glLightf", (void*)glLightf},
+	{"glLightfv", (void*)glLightfv},
+	{"glLineWidth", (void*)glLineWidth},
+	{"glLoadMatrixf", (void*)glLoadMatrixf},
+	{"glMaterialf", (void*)glMaterialf},
+	{"glMaterialfv", (void*)glMaterialfv},
+	{"glMultMatrixf", (void*)glMultMatrixf},
+	{"glMultiTexCoord4f", (void*)glMultiTexCoord4f},
+	{"glNormal3f", (void*)glNormal3f},
+	{"glOrthof", (void*)glOrthof},
+	{"glPointParameterf", (void*)glPointParameterf},
+	{"glPointParameterfv", (void*)glPointParameterfv},
+	{"glPointSize", (void*)glPointSize},
+	{"glPolygonOffset", (void*)glPolygonOffset},
+	{"glRotatef", (void*)glRotatef},
+	{"glScalef", (void*)glScalef},
+	{"glTexEnvf", (void*)glTexEnvf},
+	{"glTexEnvfv", (void*)glTexEnvfv},
+	{"glTexParameterf", (void*)glTexParameterf},
+	{"glTexParameterfv", (void*)glTexParameterfv},
+	{"glTranslatef", (void*)glTranslatef},
+	{"glActiveTexture", (void*)glActiveTexture},
+	{"glAlphaFuncx", (void*)glAlphaFuncx},
+	{"glBindBuffer", (void*)glBindBuffer},
+	{"glBindTexture", (void*)glBindTexture},
+	{"glBlendFunc", (void*)glBlendFunc},
+	{"glBufferData", (void*)glBufferData},
+	{"glBufferSubData", (void*)glBufferSubData},
+	{"glClear", (void*)glClear},
+	{"glClearColorx", (void*)glClearColorx},
+	{"glClearDepthx", (void*)glClearDepthx},
+	{"glClearStencil", (void*)glClearStencil},
+	{"glClientActiveTexture", (void*)glClientActiveTexture},
+	{"glColor4ub", (void*)glColor4ub},
+	{"glColor4x", (void*)glColor4x},
+	{"glColorMask", (void*)glColorMask},
+	{"glColorPointer", (void*)glColorPointer},
+	{"glCompressedTexImage2D", (void*)glCompressedTexImage2D},
+	{"glCompressedTexSubImage2D", (void*)glCompressedTexSubImage2D},
+	{"glCopyTexImage2D", (void*)glCopyTexImage2D},
+	{"glCopyTexSubImage2D", (void*)glCopyTexSubImage2D},
+	{"glCullFace", (void*)glCullFace},
+	{"glDeleteBuffers", (void*)glDeleteBuffers},
+	{"glDeleteTextures", (void*)glDeleteTextures},
+	{"glDepthFunc", (void*)glDepthFunc},
+	{"glDepthMask", (void*)glDepthMask},
+	{"glDepthRangex", (void*)glDepthRangex},
+	{"glDisable", (void*)glDisable},
+	{"glDisableClientState", (void*)glDisableClientState},
+	{"glDrawArrays", (void*)glDrawArrays},
+	{"glDrawElements", (void*)glDrawElements},
+	{"glEnable", (void*)glEnable},
+	{"glEnableClientState", (void*)glEnableClientState},
+	{"glFinish", (void*)glFinish},
+	{"glFlush", (void*)glFlush},
+	{"glFogx", (void*)glFogx},
+	{"glFogxv", (void*)glFogxv},
+	{"glFrontFace", (void*)glFrontFace},
+	{"glFrustumx", (void*)glFrustumx},
+	{"glGetBooleanv", (void*)glGetBooleanv},
+	{"glGetBufferParameteriv", (void*)glGetBufferParameteriv},
+	{"glClipPlanex", (void*)glClipPlanex},
+	{"glGenBuffers", (void*)glGenBuffers},
+	{"glGenTextures", (void*)glGenTextures},
+	{"glGetError", (void*)glGetError},
+	{"glGetFixedv", (void*)glGetFixedv},
+	{"glGetIntegerv", (void*)glGetIntegerv},
+	{"glGetLightxv", (void*)glGetLightxv},
+	{"glGetMaterialxv", (void*)glGetMaterialxv},
+	{"glGetPointerv", (void*)glGetPointerv},
+	{"glGetString", (void*)glGetString},
+	{"glGetTexEnviv", (void*)glGetTexEnviv},
+	{"glGetTexEnvxv", (void*)glGetTexEnvxv},
+	{"glGetTexParameteriv", (void*)glGetTexParameteriv},
+	{"glGetTexParameterxv", (void*)glGetTexParameterxv},
+	{"glHint", (void*)glHint},
+	{"glIsBuffer", (void*)glIsBuffer},
+	{"glIsEnabled", (void*)glIsEnabled},
+	{"glIsTexture", (void*)glIsTexture},
+	{"glLightModelx", (void*)glLightModelx},
+	{"glLightModelxv", (void*)glLightModelxv},
+	{"glLightx", (void*)glLightx},
+	{"glLightxv", (void*)glLightxv},
+	{"glLineWidthx", (void*)glLineWidthx},
+	{"glLoadIdentity", (void*)glLoadIdentity},
+	{"glLoadMatrixx", (void*)glLoadMatrixx},
+	{"glLogicOp", (void*)glLogicOp},
+	{"glMaterialx", (void*)glMaterialx},
+	{"glMaterialxv", (void*)glMaterialxv},
+	{"glMatrixMode", (void*)glMatrixMode},
+	{"glMultMatrixx", (void*)glMultMatrixx},
+	{"glMultiTexCoord4x", (void*)glMultiTexCoord4x},
+	{"glNormal3x", (void*)glNormal3x},
+	{"glNormalPointer", (void*)glNormalPointer},
+	{"glOrthox", (void*)glOrthox},
+	{"glPixelStorei", (void*)glPixelStorei},
+	{"glPointParameterx", (void*)glPointParameterx},
+	{"glPointParameterxv", (void*)glPointParameterxv},
+	{"glPointSizex", (void*)glPointSizex},
+	{"glPolygonOffsetx", (void*)glPolygonOffsetx},
+	{"glPopMatrix", (void*)glPopMatrix},
+	{"glPushMatrix", (void*)glPushMatrix},
+	{"glReadPixels", (void*)glReadPixels},
+	{"glRotatex", (void*)glRotatex},
+	{"glSampleCoverage", (void*)glSampleCoverage},
+	{"glSampleCoveragex", (void*)glSampleCoveragex},
+	{"glScalex", (void*)glScalex},
+	{"glScissor", (void*)glScissor},
+	{"glShadeModel", (void*)glShadeModel},
+	{"glStencilFunc", (void*)glStencilFunc},
+	{"glStencilMask", (void*)glStencilMask},
+	{"glStencilOp", (void*)glStencilOp},
+	{"glTexCoordPointer", (void*)glTexCoordPointer},
+	{"glTexEnvi", (void*)glTexEnvi},
+	{"glTexEnvx", (void*)glTexEnvx},
+	{"glTexEnviv", (void*)glTexEnviv},
+	{"glTexEnvxv", (void*)glTexEnvxv},
+	{"glTexImage2D", (void*)glTexImage2D},
+	{"glTexParameteri", (void*)glTexParameteri},
+	{"glTexParameterx", (void*)glTexParameterx},
+	{"glTexParameteriv", (void*)glTexParameteriv},
+	{"glTexParameterxv", (void*)glTexParameterxv},
+	{"glTexSubImage2D", (void*)glTexSubImage2D},
+	{"glTranslatex", (void*)glTranslatex},
+	{"glVertexPointer", (void*)glVertexPointer},
+	{"glViewport", (void*)glViewport},
+	{"glPointSizePointerOES", (void*)glPointSizePointerOES},
+	{"glBlendEquationSeparateOES", (void*)glBlendEquationSeparateOES},
+	{"glBlendFuncSeparateOES", (void*)glBlendFuncSeparateOES},
+	{"glBlendEquationOES", (void*)glBlendEquationOES},
+	{"glDrawTexsOES", (void*)glDrawTexsOES},
+	{"glDrawTexiOES", (void*)glDrawTexiOES},
+	{"glDrawTexxOES", (void*)glDrawTexxOES},
+	{"glDrawTexsvOES", (void*)glDrawTexsvOES},
+	{"glDrawTexivOES", (void*)glDrawTexivOES},
+	{"glDrawTexxvOES", (void*)glDrawTexxvOES},
+	{"glDrawTexfOES", (void*)glDrawTexfOES},
+	{"glDrawTexfvOES", (void*)glDrawTexfvOES},
+	{"glEGLImageTargetTexture2DOES", (void*)glEGLImageTargetTexture2DOES},
+	{"glEGLImageTargetRenderbufferStorageOES", (void*)glEGLImageTargetRenderbufferStorageOES},
+	{"glAlphaFuncxOES", (void*)glAlphaFuncxOES},
+	{"glClearColorxOES", (void*)glClearColorxOES},
+	{"glClearDepthxOES", (void*)glClearDepthxOES},
+	{"glClipPlanexOES", (void*)glClipPlanexOES},
+	{"glClipPlanexIMG", (void*)glClipPlanexIMG},
+	{"glColor4xOES", (void*)glColor4xOES},
+	{"glDepthRangexOES", (void*)glDepthRangexOES},
+	{"glFogxOES", (void*)glFogxOES},
+	{"glFogxvOES", (void*)glFogxvOES},
+	{"glFrustumxOES", (void*)glFrustumxOES},
+	{"glGetClipPlanexOES", (void*)glGetClipPlanexOES},
+	{"glGetClipPlanex", (void*)glGetClipPlanex},
+	{"glGetFixedvOES", (void*)glGetFixedvOES},
+	{"glGetLightxvOES", (void*)glGetLightxvOES},
+	{"glGetMaterialxvOES", (void*)glGetMaterialxvOES},
+	{"glGetTexEnvxvOES", (void*)glGetTexEnvxvOES},
+	{"glGetTexParameterxvOES", (void*)glGetTexParameterxvOES},
+	{"glLightModelxOES", (void*)glLightModelxOES},
+	{"glLightModelxvOES", (void*)glLightModelxvOES},
+	{"glLightxOES", (void*)glLightxOES},
+	{"glLightxvOES", (void*)glLightxvOES},
+	{"glLineWidthxOES", (void*)glLineWidthxOES},
+	{"glLoadMatrixxOES", (void*)glLoadMatrixxOES},
+	{"glMaterialxOES", (void*)glMaterialxOES},
+	{"glMaterialxvOES", (void*)glMaterialxvOES},
+	{"glMultMatrixxOES", (void*)glMultMatrixxOES},
+	{"glMultiTexCoord4xOES", (void*)glMultiTexCoord4xOES},
+	{"glNormal3xOES", (void*)glNormal3xOES},
+	{"glOrthoxOES", (void*)glOrthoxOES},
+	{"glPointParameterxOES", (void*)glPointParameterxOES},
+	{"glPointParameterxvOES", (void*)glPointParameterxvOES},
+	{"glPointSizexOES", (void*)glPointSizexOES},
+	{"glPolygonOffsetxOES", (void*)glPolygonOffsetxOES},
+	{"glRotatexOES", (void*)glRotatexOES},
+	{"glSampleCoveragexOES", (void*)glSampleCoveragexOES},
+	{"glScalexOES", (void*)glScalexOES},
+	{"glTexEnvxOES", (void*)glTexEnvxOES},
+	{"glTexEnvxvOES", (void*)glTexEnvxvOES},
+	{"glTexParameterxOES", (void*)glTexParameterxOES},
+	{"glTexParameterxvOES", (void*)glTexParameterxvOES},
+	{"glTranslatexOES", (void*)glTranslatexOES},
+	{"glIsRenderbufferOES", (void*)glIsRenderbufferOES},
+	{"glBindRenderbufferOES", (void*)glBindRenderbufferOES},
+	{"glDeleteRenderbuffersOES", (void*)glDeleteRenderbuffersOES},
+	{"glGenRenderbuffersOES", (void*)glGenRenderbuffersOES},
+	{"glRenderbufferStorageOES", (void*)glRenderbufferStorageOES},
+	{"glGetRenderbufferParameterivOES", (void*)glGetRenderbufferParameterivOES},
+	{"glIsFramebufferOES", (void*)glIsFramebufferOES},
+	{"glBindFramebufferOES", (void*)glBindFramebufferOES},
+	{"glDeleteFramebuffersOES", (void*)glDeleteFramebuffersOES},
+	{"glGenFramebuffersOES", (void*)glGenFramebuffersOES},
+	{"glCheckFramebufferStatusOES", (void*)glCheckFramebufferStatusOES},
+	{"glFramebufferRenderbufferOES", (void*)glFramebufferRenderbufferOES},
+	{"glFramebufferTexture2DOES", (void*)glFramebufferTexture2DOES},
+	{"glGetFramebufferAttachmentParameterivOES", (void*)glGetFramebufferAttachmentParameterivOES},
+	{"glGenerateMipmapOES", (void*)glGenerateMipmapOES},
+	{"glMapBufferOES", (void*)glMapBufferOES},
+	{"glUnmapBufferOES", (void*)glUnmapBufferOES},
+	{"glGetBufferPointervOES", (void*)glGetBufferPointervOES},
+	{"glCurrentPaletteMatrixOES", (void*)glCurrentPaletteMatrixOES},
+	{"glLoadPaletteFromModelViewMatrixOES", (void*)glLoadPaletteFromModelViewMatrixOES},
+	{"glMatrixIndexPointerOES", (void*)glMatrixIndexPointerOES},
+	{"glWeightPointerOES", (void*)glWeightPointerOES},
+	{"glQueryMatrixxOES", (void*)glQueryMatrixxOES},
+	{"glDepthRangefOES", (void*)glDepthRangefOES},
+	{"glFrustumfOES", (void*)glFrustumfOES},
+	{"glOrthofOES", (void*)glOrthofOES},
+	{"glClipPlanefOES", (void*)glClipPlanefOES},
+	{"glClipPlanefIMG", (void*)glClipPlanefIMG},
+	{"glGetClipPlanefOES", (void*)glGetClipPlanefOES},
+	{"glClearDepthfOES", (void*)glClearDepthfOES},
+	{"glTexGenfOES", (void*)glTexGenfOES},
+	{"glTexGenfvOES", (void*)glTexGenfvOES},
+	{"glTexGeniOES", (void*)glTexGeniOES},
+	{"glTexGenivOES", (void*)glTexGenivOES},
+	{"glTexGenxOES", (void*)glTexGenxOES},
+	{"glTexGenxvOES", (void*)glTexGenxvOES},
+	{"glGetTexGenfvOES", (void*)glGetTexGenfvOES},
+	{"glGetTexGenivOES", (void*)glGetTexGenivOES},
+	{"glGetTexGenxvOES", (void*)glGetTexGenxvOES},
+	{"glBindVertexArrayOES", (void*)glBindVertexArrayOES},
+	{"glDeleteVertexArraysOES", (void*)glDeleteVertexArraysOES},
+	{"glGenVertexArraysOES", (void*)glGenVertexArraysOES},
+	{"glIsVertexArrayOES", (void*)glIsVertexArrayOES},
+	{"glDiscardFramebufferEXT", (void*)glDiscardFramebufferEXT},
+	{"glMultiDrawArraysEXT", (void*)glMultiDrawArraysEXT},
+	{"glMultiDrawElementsEXT", (void*)glMultiDrawElementsEXT},
+	{"glMultiDrawArraysSUN", (void*)glMultiDrawArraysSUN},
+	{"glMultiDrawElementsSUN", (void*)glMultiDrawElementsSUN},
+	{"glRenderbufferStorageMultisampleIMG", (void*)glRenderbufferStorageMultisampleIMG},
+	{"glFramebufferTexture2DMultisampleIMG", (void*)glFramebufferTexture2DMultisampleIMG},
+	{"glDeleteFencesNV", (void*)glDeleteFencesNV},
+	{"glGenFencesNV", (void*)glGenFencesNV},
+	{"glIsFenceNV", (void*)glIsFenceNV},
+	{"glTestFenceNV", (void*)glTestFenceNV},
+	{"glGetFenceivNV", (void*)glGetFenceivNV},
+	{"glFinishFenceNV", (void*)glFinishFenceNV},
+	{"glSetFenceNV", (void*)glSetFenceNV},
+	{"glGetDriverControlsQCOM", (void*)glGetDriverControlsQCOM},
+	{"glGetDriverControlStringQCOM", (void*)glGetDriverControlStringQCOM},
+	{"glEnableDriverControlQCOM", (void*)glEnableDriverControlQCOM},
+	{"glDisableDriverControlQCOM", (void*)glDisableDriverControlQCOM},
+	{"glExtGetTexturesQCOM", (void*)glExtGetTexturesQCOM},
+	{"glExtGetBuffersQCOM", (void*)glExtGetBuffersQCOM},
+	{"glExtGetRenderbuffersQCOM", (void*)glExtGetRenderbuffersQCOM},
+	{"glExtGetFramebuffersQCOM", (void*)glExtGetFramebuffersQCOM},
+	{"glExtGetTexLevelParameterivQCOM", (void*)glExtGetTexLevelParameterivQCOM},
+	{"glExtTexObjectStateOverrideiQCOM", (void*)glExtTexObjectStateOverrideiQCOM},
+	{"glExtGetTexSubImageQCOM", (void*)glExtGetTexSubImageQCOM},
+	{"glExtGetBufferPointervQCOM", (void*)glExtGetBufferPointervQCOM},
+	{"glExtGetShadersQCOM", (void*)glExtGetShadersQCOM},
+	{"glExtGetProgramsQCOM", (void*)glExtGetProgramsQCOM},
+	{"glExtIsProgramBinaryQCOM", (void*)glExtIsProgramBinaryQCOM},
+	{"glExtGetProgramBinarySourceQCOM", (void*)glExtGetProgramBinarySourceQCOM},
+	{"glStartTilingQCOM", (void*)glStartTilingQCOM},
+	{"glEndTilingQCOM", (void*)glEndTilingQCOM},
+	{"glGetGraphicsResetStatusEXT", (void*)glGetGraphicsResetStatusEXT},
+	{"glReadnPixelsEXT", (void*)glReadnPixelsEXT},
+};
+static const int gl_num_funcs = sizeof(gl_funcs_by_name) / sizeof(struct _gl_funcs_by_name);
+
+
+#endif
diff --git a/system/GLESv1_enc/gl_opcodes.h b/system/GLESv1_enc/gl_opcodes.h
new file mode 100644
index 0000000..fc65260
--- /dev/null
+++ b/system/GLESv1_enc/gl_opcodes.h
@@ -0,0 +1,302 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+#ifndef __GUARD_gl_opcodes_h_
+#define __GUARD_gl_opcodes_h_
+
+#define OP_glAlphaFunc 					1024
+#define OP_glClearColor 					1025
+#define OP_glClearDepthf 					1026
+#define OP_glClipPlanef 					1027
+#define OP_glColor4f 					1028
+#define OP_glDepthRangef 					1029
+#define OP_glFogf 					1030
+#define OP_glFogfv 					1031
+#define OP_glFrustumf 					1032
+#define OP_glGetClipPlanef 					1033
+#define OP_glGetFloatv 					1034
+#define OP_glGetLightfv 					1035
+#define OP_glGetMaterialfv 					1036
+#define OP_glGetTexEnvfv 					1037
+#define OP_glGetTexParameterfv 					1038
+#define OP_glLightModelf 					1039
+#define OP_glLightModelfv 					1040
+#define OP_glLightf 					1041
+#define OP_glLightfv 					1042
+#define OP_glLineWidth 					1043
+#define OP_glLoadMatrixf 					1044
+#define OP_glMaterialf 					1045
+#define OP_glMaterialfv 					1046
+#define OP_glMultMatrixf 					1047
+#define OP_glMultiTexCoord4f 					1048
+#define OP_glNormal3f 					1049
+#define OP_glOrthof 					1050
+#define OP_glPointParameterf 					1051
+#define OP_glPointParameterfv 					1052
+#define OP_glPointSize 					1053
+#define OP_glPolygonOffset 					1054
+#define OP_glRotatef 					1055
+#define OP_glScalef 					1056
+#define OP_glTexEnvf 					1057
+#define OP_glTexEnvfv 					1058
+#define OP_glTexParameterf 					1059
+#define OP_glTexParameterfv 					1060
+#define OP_glTranslatef 					1061
+#define OP_glActiveTexture 					1062
+#define OP_glAlphaFuncx 					1063
+#define OP_glBindBuffer 					1064
+#define OP_glBindTexture 					1065
+#define OP_glBlendFunc 					1066
+#define OP_glBufferData 					1067
+#define OP_glBufferSubData 					1068
+#define OP_glClear 					1069
+#define OP_glClearColorx 					1070
+#define OP_glClearDepthx 					1071
+#define OP_glClearStencil 					1072
+#define OP_glClientActiveTexture 					1073
+#define OP_glColor4ub 					1074
+#define OP_glColor4x 					1075
+#define OP_glColorMask 					1076
+#define OP_glColorPointer 					1077
+#define OP_glCompressedTexImage2D 					1078
+#define OP_glCompressedTexSubImage2D 					1079
+#define OP_glCopyTexImage2D 					1080
+#define OP_glCopyTexSubImage2D 					1081
+#define OP_glCullFace 					1082
+#define OP_glDeleteBuffers 					1083
+#define OP_glDeleteTextures 					1084
+#define OP_glDepthFunc 					1085
+#define OP_glDepthMask 					1086
+#define OP_glDepthRangex 					1087
+#define OP_glDisable 					1088
+#define OP_glDisableClientState 					1089
+#define OP_glDrawArrays 					1090
+#define OP_glDrawElements 					1091
+#define OP_glEnable 					1092
+#define OP_glEnableClientState 					1093
+#define OP_glFinish 					1094
+#define OP_glFlush 					1095
+#define OP_glFogx 					1096
+#define OP_glFogxv 					1097
+#define OP_glFrontFace 					1098
+#define OP_glFrustumx 					1099
+#define OP_glGetBooleanv 					1100
+#define OP_glGetBufferParameteriv 					1101
+#define OP_glClipPlanex 					1102
+#define OP_glGenBuffers 					1103
+#define OP_glGenTextures 					1104
+#define OP_glGetError 					1105
+#define OP_glGetFixedv 					1106
+#define OP_glGetIntegerv 					1107
+#define OP_glGetLightxv 					1108
+#define OP_glGetMaterialxv 					1109
+#define OP_glGetPointerv 					1110
+#define OP_glGetString 					1111
+#define OP_glGetTexEnviv 					1112
+#define OP_glGetTexEnvxv 					1113
+#define OP_glGetTexParameteriv 					1114
+#define OP_glGetTexParameterxv 					1115
+#define OP_glHint 					1116
+#define OP_glIsBuffer 					1117
+#define OP_glIsEnabled 					1118
+#define OP_glIsTexture 					1119
+#define OP_glLightModelx 					1120
+#define OP_glLightModelxv 					1121
+#define OP_glLightx 					1122
+#define OP_glLightxv 					1123
+#define OP_glLineWidthx 					1124
+#define OP_glLoadIdentity 					1125
+#define OP_glLoadMatrixx 					1126
+#define OP_glLogicOp 					1127
+#define OP_glMaterialx 					1128
+#define OP_glMaterialxv 					1129
+#define OP_glMatrixMode 					1130
+#define OP_glMultMatrixx 					1131
+#define OP_glMultiTexCoord4x 					1132
+#define OP_glNormal3x 					1133
+#define OP_glNormalPointer 					1134
+#define OP_glOrthox 					1135
+#define OP_glPixelStorei 					1136
+#define OP_glPointParameterx 					1137
+#define OP_glPointParameterxv 					1138
+#define OP_glPointSizex 					1139
+#define OP_glPolygonOffsetx 					1140
+#define OP_glPopMatrix 					1141
+#define OP_glPushMatrix 					1142
+#define OP_glReadPixels 					1143
+#define OP_glRotatex 					1144
+#define OP_glSampleCoverage 					1145
+#define OP_glSampleCoveragex 					1146
+#define OP_glScalex 					1147
+#define OP_glScissor 					1148
+#define OP_glShadeModel 					1149
+#define OP_glStencilFunc 					1150
+#define OP_glStencilMask 					1151
+#define OP_glStencilOp 					1152
+#define OP_glTexCoordPointer 					1153
+#define OP_glTexEnvi 					1154
+#define OP_glTexEnvx 					1155
+#define OP_glTexEnviv 					1156
+#define OP_glTexEnvxv 					1157
+#define OP_glTexImage2D 					1158
+#define OP_glTexParameteri 					1159
+#define OP_glTexParameterx 					1160
+#define OP_glTexParameteriv 					1161
+#define OP_glTexParameterxv 					1162
+#define OP_glTexSubImage2D 					1163
+#define OP_glTranslatex 					1164
+#define OP_glVertexPointer 					1165
+#define OP_glViewport 					1166
+#define OP_glPointSizePointerOES 					1167
+#define OP_glVertexPointerOffset 					1168
+#define OP_glColorPointerOffset 					1169
+#define OP_glNormalPointerOffset 					1170
+#define OP_glPointSizePointerOffset 					1171
+#define OP_glTexCoordPointerOffset 					1172
+#define OP_glWeightPointerOffset 					1173
+#define OP_glMatrixIndexPointerOffset 					1174
+#define OP_glVertexPointerData 					1175
+#define OP_glColorPointerData 					1176
+#define OP_glNormalPointerData 					1177
+#define OP_glTexCoordPointerData 					1178
+#define OP_glPointSizePointerData 					1179
+#define OP_glWeightPointerData 					1180
+#define OP_glMatrixIndexPointerData 					1181
+#define OP_glDrawElementsOffset 					1182
+#define OP_glDrawElementsData 					1183
+#define OP_glGetCompressedTextureFormats 					1184
+#define OP_glFinishRoundTrip 					1185
+#define OP_glBlendEquationSeparateOES 					1186
+#define OP_glBlendFuncSeparateOES 					1187
+#define OP_glBlendEquationOES 					1188
+#define OP_glDrawTexsOES 					1189
+#define OP_glDrawTexiOES 					1190
+#define OP_glDrawTexxOES 					1191
+#define OP_glDrawTexsvOES 					1192
+#define OP_glDrawTexivOES 					1193
+#define OP_glDrawTexxvOES 					1194
+#define OP_glDrawTexfOES 					1195
+#define OP_glDrawTexfvOES 					1196
+#define OP_glEGLImageTargetTexture2DOES 					1197
+#define OP_glEGLImageTargetRenderbufferStorageOES 					1198
+#define OP_glAlphaFuncxOES 					1199
+#define OP_glClearColorxOES 					1200
+#define OP_glClearDepthxOES 					1201
+#define OP_glClipPlanexOES 					1202
+#define OP_glClipPlanexIMG 					1203
+#define OP_glColor4xOES 					1204
+#define OP_glDepthRangexOES 					1205
+#define OP_glFogxOES 					1206
+#define OP_glFogxvOES 					1207
+#define OP_glFrustumxOES 					1208
+#define OP_glGetClipPlanexOES 					1209
+#define OP_glGetClipPlanex 					1210
+#define OP_glGetFixedvOES 					1211
+#define OP_glGetLightxvOES 					1212
+#define OP_glGetMaterialxvOES 					1213
+#define OP_glGetTexEnvxvOES 					1214
+#define OP_glGetTexParameterxvOES 					1215
+#define OP_glLightModelxOES 					1216
+#define OP_glLightModelxvOES 					1217
+#define OP_glLightxOES 					1218
+#define OP_glLightxvOES 					1219
+#define OP_glLineWidthxOES 					1220
+#define OP_glLoadMatrixxOES 					1221
+#define OP_glMaterialxOES 					1222
+#define OP_glMaterialxvOES 					1223
+#define OP_glMultMatrixxOES 					1224
+#define OP_glMultiTexCoord4xOES 					1225
+#define OP_glNormal3xOES 					1226
+#define OP_glOrthoxOES 					1227
+#define OP_glPointParameterxOES 					1228
+#define OP_glPointParameterxvOES 					1229
+#define OP_glPointSizexOES 					1230
+#define OP_glPolygonOffsetxOES 					1231
+#define OP_glRotatexOES 					1232
+#define OP_glSampleCoveragexOES 					1233
+#define OP_glScalexOES 					1234
+#define OP_glTexEnvxOES 					1235
+#define OP_glTexEnvxvOES 					1236
+#define OP_glTexParameterxOES 					1237
+#define OP_glTexParameterxvOES 					1238
+#define OP_glTranslatexOES 					1239
+#define OP_glIsRenderbufferOES 					1240
+#define OP_glBindRenderbufferOES 					1241
+#define OP_glDeleteRenderbuffersOES 					1242
+#define OP_glGenRenderbuffersOES 					1243
+#define OP_glRenderbufferStorageOES 					1244
+#define OP_glGetRenderbufferParameterivOES 					1245
+#define OP_glIsFramebufferOES 					1246
+#define OP_glBindFramebufferOES 					1247
+#define OP_glDeleteFramebuffersOES 					1248
+#define OP_glGenFramebuffersOES 					1249
+#define OP_glCheckFramebufferStatusOES 					1250
+#define OP_glFramebufferRenderbufferOES 					1251
+#define OP_glFramebufferTexture2DOES 					1252
+#define OP_glGetFramebufferAttachmentParameterivOES 					1253
+#define OP_glGenerateMipmapOES 					1254
+#define OP_glMapBufferOES 					1255
+#define OP_glUnmapBufferOES 					1256
+#define OP_glGetBufferPointervOES 					1257
+#define OP_glCurrentPaletteMatrixOES 					1258
+#define OP_glLoadPaletteFromModelViewMatrixOES 					1259
+#define OP_glMatrixIndexPointerOES 					1260
+#define OP_glWeightPointerOES 					1261
+#define OP_glQueryMatrixxOES 					1262
+#define OP_glDepthRangefOES 					1263
+#define OP_glFrustumfOES 					1264
+#define OP_glOrthofOES 					1265
+#define OP_glClipPlanefOES 					1266
+#define OP_glClipPlanefIMG 					1267
+#define OP_glGetClipPlanefOES 					1268
+#define OP_glClearDepthfOES 					1269
+#define OP_glTexGenfOES 					1270
+#define OP_glTexGenfvOES 					1271
+#define OP_glTexGeniOES 					1272
+#define OP_glTexGenivOES 					1273
+#define OP_glTexGenxOES 					1274
+#define OP_glTexGenxvOES 					1275
+#define OP_glGetTexGenfvOES 					1276
+#define OP_glGetTexGenivOES 					1277
+#define OP_glGetTexGenxvOES 					1278
+#define OP_glBindVertexArrayOES 					1279
+#define OP_glDeleteVertexArraysOES 					1280
+#define OP_glGenVertexArraysOES 					1281
+#define OP_glIsVertexArrayOES 					1282
+#define OP_glDiscardFramebufferEXT 					1283
+#define OP_glMultiDrawArraysEXT 					1284
+#define OP_glMultiDrawElementsEXT 					1285
+#define OP_glMultiDrawArraysSUN 					1286
+#define OP_glMultiDrawElementsSUN 					1287
+#define OP_glRenderbufferStorageMultisampleIMG 					1288
+#define OP_glFramebufferTexture2DMultisampleIMG 					1289
+#define OP_glDeleteFencesNV 					1290
+#define OP_glGenFencesNV 					1291
+#define OP_glIsFenceNV 					1292
+#define OP_glTestFenceNV 					1293
+#define OP_glGetFenceivNV 					1294
+#define OP_glFinishFenceNV 					1295
+#define OP_glSetFenceNV 					1296
+#define OP_glGetDriverControlsQCOM 					1297
+#define OP_glGetDriverControlStringQCOM 					1298
+#define OP_glEnableDriverControlQCOM 					1299
+#define OP_glDisableDriverControlQCOM 					1300
+#define OP_glExtGetTexturesQCOM 					1301
+#define OP_glExtGetBuffersQCOM 					1302
+#define OP_glExtGetRenderbuffersQCOM 					1303
+#define OP_glExtGetFramebuffersQCOM 					1304
+#define OP_glExtGetTexLevelParameterivQCOM 					1305
+#define OP_glExtTexObjectStateOverrideiQCOM 					1306
+#define OP_glExtGetTexSubImageQCOM 					1307
+#define OP_glExtGetBufferPointervQCOM 					1308
+#define OP_glExtGetShadersQCOM 					1309
+#define OP_glExtGetProgramsQCOM 					1310
+#define OP_glExtIsProgramBinaryQCOM 					1311
+#define OP_glExtGetProgramBinarySourceQCOM 					1312
+#define OP_glStartTilingQCOM 					1313
+#define OP_glEndTilingQCOM 					1314
+#define OP_glGetGraphicsResetStatusEXT 					1315
+#define OP_glReadnPixelsEXT 					1316
+#define OP_last 					1317
+
+
+#endif
diff --git a/system/GLESv1_enc/gl_types.h b/system/GLESv1_enc/gl_types.h
new file mode 100644
index 0000000..36fabfb
--- /dev/null
+++ b/system/GLESv1_enc/gl_types.h
@@ -0,0 +1,20 @@
+/*
+* Copyright (C) 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#ifndef __GL_TYPES__H
+#define __GL_TYPES__H
+
+#include "gl_base_types.h"
+#endif
diff --git a/system/GLESv2/Android.mk b/system/GLESv2/Android.mk
new file mode 100644
index 0000000..c12f369
--- /dev/null
+++ b/system/GLESv2/Android.mk
@@ -0,0 +1,16 @@
+LOCAL_PATH := $(call my-dir)
+
+### GLESv2 implementation ###########################################
+$(call emugl-begin-shared-library,libGLESv2_emulation)
+$(call emugl-import,libOpenglSystemCommon libGLESv2_enc lib_renderControl_enc)
+
+LOCAL_CFLAGS += -DLOG_TAG=\"GLESv2_emulation\" -DGL_GLEXT_PROTOTYPES
+
+LOCAL_SRC_FILES := gl2.cpp
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 21 && echo PreLollipop),PreLollipop)
+    LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/egl
+else
+    LOCAL_MODULE_RELATIVE_PATH := egl
+endif
+
+$(call emugl-end-module)
diff --git a/system/GLESv2/CMakeLists.txt b/system/GLESv2/CMakeLists.txt
new file mode 100644
index 0000000..b2b844d
--- /dev/null
+++ b/system/GLESv2/CMakeLists.txt
@@ -0,0 +1,10 @@
+# This is an autogenerated file! Do not edit!
+# instead run make from .../device/generic/goldfish-opengl
+# which will re-generate this file.
+android_validate_sha256("${GOLDFISH_DEVICE_ROOT}/system/GLESv2/Android.mk" "d8f9dda69ec57ad8b7a65f02c3335b16a4724f612dec1d1a2cd793c28c0a10f9")
+set(GLESv2_emulation_src gl2.cpp)
+android_add_library(TARGET GLESv2_emulation SHARED LICENSE Apache-2.0 SRC gl2.cpp)
+target_include_directories(GLESv2_emulation PRIVATE ${GOLDFISH_DEVICE_ROOT}/system/OpenglSystemCommon/bionic-include ${GOLDFISH_DEVICE_ROOT}/system/OpenglSystemCommon ${GOLDFISH_DEVICE_ROOT}/bionic/libc/private ${GOLDFISH_DEVICE_ROOT}/bionic/libc/platform ${GOLDFISH_DEVICE_ROOT}/system/vulkan_enc ${GOLDFISH_DEVICE_ROOT}/shared/gralloc_cb/include ${GOLDFISH_DEVICE_ROOT}/shared/GoldfishAddressSpace/include ${GOLDFISH_DEVICE_ROOT}/platform/include ${GOLDFISH_DEVICE_ROOT}/system/renderControl_enc ${GOLDFISH_DEVICE_ROOT}/system/GLESv2_enc ${GOLDFISH_DEVICE_ROOT}/system/GLESv1_enc ${GOLDFISH_DEVICE_ROOT}/shared/OpenglCodecCommon ${GOLDFISH_DEVICE_ROOT}/android-emu ${GOLDFISH_DEVICE_ROOT}/shared/qemupipe/include-types ${GOLDFISH_DEVICE_ROOT}/shared/qemupipe/include ${GOLDFISH_DEVICE_ROOT}/./host/include/libOpenglRender ${GOLDFISH_DEVICE_ROOT}/./system/include ${GOLDFISH_DEVICE_ROOT}/./../../../external/qemu/android/android-emugl/guest)
+target_compile_definitions(GLESv2_emulation PRIVATE "-DPLATFORM_SDK_VERSION=29" "-DGOLDFISH_HIDL_GRALLOC" "-DHOST_BUILD" "-DANDROID" "-DGL_GLEXT_PROTOTYPES" "-DPAGE_SIZE=4096" "-DGFXSTREAM" "-DENABLE_ANDROID_HEALTH_MONITOR" "-DLOG_TAG=\"GLESv2_emulation\"")
+target_compile_options(GLESv2_emulation PRIVATE "-fvisibility=default" "-Wno-unused-parameter")
+target_link_libraries(GLESv2_emulation PRIVATE OpenglSystemCommon android-emu-shared vulkan_enc gui log _renderControl_enc GLESv2_enc GLESv1_enc OpenglCodecCommon_host cutils utils androidemu PRIVATE gralloc_cb_host GoldfishAddressSpace_host platform_host qemupipe_host)
\ No newline at end of file
diff --git a/system/GLESv2/gl2.cpp b/system/GLESv2/gl2.cpp
new file mode 100644
index 0000000..9598a30
--- /dev/null
+++ b/system/GLESv2/gl2.cpp
@@ -0,0 +1,197 @@
+/*
+* Copyright 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include "EGLClientIface.h"
+#include "HostConnection.h"
+#include "GL2Encoder.h"
+#include "GLES/gl.h"
+#include "GLES/glext.h"
+#include "ErrorLog.h"
+#include "ThreadInfo.h"
+#include "EGLImage.h"
+
+//XXX: fix this macro to get the context from fast tls path
+#define GET_CONTEXT GL2Encoder * ctx = getEGLThreadInfo()->hostConn->gl2Encoder();
+
+#include "gl2_entry.cpp"
+
+//The functions table
+#include "gl2_ftable.h"
+
+
+static EGLClient_eglInterface * s_egl = NULL;
+static EGLClient_glesInterface * s_gl = NULL;
+
+#define DEFINE_AND_VALIDATE_HOST_CONNECTION(ret) \
+    HostConnection *hostCon = HostConnection::get(); \
+    if (!hostCon) { \
+        ALOGE("egl: Failed to get host connection\n"); \
+        return ret; \
+    } \
+    renderControl_encoder_context_t *rcEnc = hostCon->rcEncoder(); \
+    if (!rcEnc) { \
+        ALOGE("egl: Failed to get renderControl encoder context\n"); \
+        return ret; \
+    } \
+    Gralloc *grallocHelper = hostCon->grallocHelper(); \
+    if (!grallocHelper) { \
+        ALOGE("egl: Failed to get grallocHelper\n"); \
+        return ret; \
+    }
+
+//GL extensions
+void glEGLImageTargetTexture2DOES(void * self, GLenum target, GLeglImageOES img)
+{
+    (void)self;
+    (void)target;
+
+    DBG("glEGLImageTargetTexture2DOES v2 target=%#x img=%p\n", target, img);
+
+    EGLImage_t *image = (EGLImage_t*)img;
+    GLeglImageOES hostImage = reinterpret_cast<GLeglImageOES>((intptr_t)image->host_egl_image);
+
+    if (image->target == EGL_NATIVE_BUFFER_ANDROID) {
+        //TODO: check error - we don't have a way to set gl error
+        android_native_buffer_t* native_buffer = image->native_buffer;
+
+        if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC) {
+            return;
+        }
+
+        if (native_buffer->common.version != sizeof(android_native_buffer_t)) {
+            return;
+        }
+
+        GET_CONTEXT;
+        DEFINE_AND_VALIDATE_HOST_CONNECTION();
+
+        ctx->override2DTextureTarget(target);
+        ctx->associateEGLImage(target, hostImage, image->width, image->height);
+        rcEnc->rcBindTexture(rcEnc,
+                grallocHelper->getHostHandle(native_buffer->handle));
+        ctx->restore2DTextureTarget(target);
+    }
+    else if (image->target == EGL_GL_TEXTURE_2D_KHR) {
+        GET_CONTEXT;
+        ctx->override2DTextureTarget(target);
+        ctx->associateEGLImage(target, hostImage, image->width, image->height);
+        ctx->m_glEGLImageTargetTexture2DOES_enc(self, GL_TEXTURE_2D, hostImage);
+        ctx->restore2DTextureTarget(target);
+    }
+}
+
+void glEGLImageTargetRenderbufferStorageOES(void *self, GLenum target, GLeglImageOES img)
+{
+    (void)self;
+    (void)target;
+
+    DBG("glEGLImageTargetRenderbufferStorageOES v2 image=%p\n", img);
+    //TODO: check error - we don't have a way to set gl error
+    EGLImage_t *image = (EGLImage_t*)img;
+    GLeglImageOES hostImage = reinterpret_cast<GLeglImageOES>((intptr_t)image->host_egl_image);
+
+    if (image->target == EGL_NATIVE_BUFFER_ANDROID) {
+        android_native_buffer_t* native_buffer = ((EGLImage_t*)image)->native_buffer;
+
+        if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC) {
+            return;
+        }
+
+        if (native_buffer->common.version != sizeof(android_native_buffer_t)) {
+            return;
+        }
+
+        DEFINE_AND_VALIDATE_HOST_CONNECTION();
+        GET_CONTEXT;
+        ctx->associateEGLImage(target, hostImage, image->width, image->height);
+        rcEnc->rcBindRenderbuffer(rcEnc,
+                grallocHelper->getHostHandle(native_buffer->handle));
+    } else {
+        //TODO
+    }
+
+    return;
+}
+
+void * getProcAddress(const char * procname)
+{
+    // search in GL function table
+    for (int i=0; i<gl2_num_funcs; i++) {
+        if (!strcmp(gl2_funcs_by_name[i].name, procname)) {
+            return gl2_funcs_by_name[i].proc;
+        }
+    }
+    return NULL;
+}
+
+void finish()
+{
+    glFinish();
+}
+
+void getIntegerv(unsigned int pname, int* param)
+{
+    glGetIntegerv((GLenum)pname, (GLint*)param);
+}
+
+const GLubyte *my_glGetString (void *self, GLenum name)
+{
+    (void)self;
+
+    //see ref in https://www.khronos.org/opengles/sdk/docs/man
+    //name in glGetString can be one of the following five values
+    switch (name) {
+        case GL_VERSION:
+        case GL_VENDOR:
+        case GL_RENDERER:
+        case GL_SHADING_LANGUAGE_VERSION:
+        case GL_EXTENSIONS:
+            if (s_egl) {
+                return (const GLubyte*)s_egl->getGLString(name);
+            }
+            break;
+        default:
+            GET_CONTEXT;
+            ctx->setError(GL_INVALID_ENUM);
+            break;
+    }
+    return NULL;
+}
+
+void init()
+{
+    GET_CONTEXT;
+    ctx->m_glEGLImageTargetTexture2DOES_enc = ctx->glEGLImageTargetTexture2DOES;
+    ctx->glEGLImageTargetTexture2DOES = &glEGLImageTargetTexture2DOES;
+    ctx->glEGLImageTargetRenderbufferStorageOES = &glEGLImageTargetRenderbufferStorageOES;
+    ctx->glGetString = &my_glGetString;
+}
+extern "C" {
+EGLClient_glesInterface * init_emul_gles(EGLClient_eglInterface *eglIface)
+{
+    s_egl = eglIface;
+
+    if (!s_gl) {
+        s_gl = new EGLClient_glesInterface();
+        s_gl->getProcAddress = getProcAddress;
+        s_gl->finish = finish;
+        s_gl->init = init;
+        s_gl->getIntegerv = getIntegerv;
+    }
+
+    return s_gl;
+}
+} //extern
diff --git a/system/GLESv2_enc/Android.mk b/system/GLESv2_enc/Android.mk
new file mode 100644
index 0000000..40acfc5
--- /dev/null
+++ b/system/GLESv2_enc/Android.mk
@@ -0,0 +1,24 @@
+LOCAL_PATH := $(call my-dir)
+
+### GLESv2_enc Encoder ###########################################
+$(call emugl-begin-shared-library,libGLESv2_enc)
+
+LOCAL_SRC_FILES := \
+    GL2EncoderUtils.cpp \
+    GL2Encoder.cpp \
+    GLESv2Validation.cpp \
+    gl2_client_context.cpp \
+    gl2_enc.cpp \
+    gl2_entry.cpp \
+    IOStream2.cpp \
+
+LOCAL_CFLAGS += -DLOG_TAG=\"emuglGLESv2_enc\"
+LOCAL_CFLAGS += -Wno-unused-private-field
+
+
+$(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
+$(call emugl-import,libOpenglCodecCommon$(GOLDFISH_OPENGL_LIB_SUFFIX))
+
+$(call emugl-end-module)
+
+
diff --git a/system/GLESv2_enc/CMakeLists.txt b/system/GLESv2_enc/CMakeLists.txt
new file mode 100644
index 0000000..756e4df
--- /dev/null
+++ b/system/GLESv2_enc/CMakeLists.txt
@@ -0,0 +1,10 @@
+# This is an autogenerated file! Do not edit!
+# instead run make from .../device/generic/goldfish-opengl
+# which will re-generate this file.
+android_validate_sha256("${GOLDFISH_DEVICE_ROOT}/system/GLESv2_enc/Android.mk" "df543672d1f36e43fb783b08200aa85dbf3a2e7167f8ecd7e4c01c80e6fd1650")
+set(GLESv2_enc_src GL2EncoderUtils.cpp GL2Encoder.cpp GLESv2Validation.cpp gl2_client_context.cpp gl2_enc.cpp gl2_entry.cpp IOStream2.cpp)
+android_add_library(TARGET GLESv2_enc SHARED LICENSE Apache-2.0 SRC GL2EncoderUtils.cpp GL2Encoder.cpp GLESv2Validation.cpp gl2_client_context.cpp gl2_enc.cpp gl2_entry.cpp IOStream2.cpp)
+target_include_directories(GLESv2_enc PRIVATE ${GOLDFISH_DEVICE_ROOT}/shared/OpenglCodecCommon ${GOLDFISH_DEVICE_ROOT}/android-emu ${GOLDFISH_DEVICE_ROOT}/shared/qemupipe/include-types ${GOLDFISH_DEVICE_ROOT}/shared/qemupipe/include ${GOLDFISH_DEVICE_ROOT}/system/GLESv2_enc ${GOLDFISH_DEVICE_ROOT}/./host/include/libOpenglRender ${GOLDFISH_DEVICE_ROOT}/./system/include ${GOLDFISH_DEVICE_ROOT}/./../../../external/qemu/android/android-emugl/guest)
+target_compile_definitions(GLESv2_enc PRIVATE "-DPLATFORM_SDK_VERSION=29" "-DGOLDFISH_HIDL_GRALLOC" "-DHOST_BUILD" "-DANDROID" "-DGL_GLEXT_PROTOTYPES" "-DPAGE_SIZE=4096" "-DGFXSTREAM" "-DENABLE_ANDROID_HEALTH_MONITOR" "-DLOG_TAG=\"emuglGLESv2_enc\"")
+target_compile_options(GLESv2_enc PRIVATE "-fvisibility=default" "-Wno-unused-parameter" "-Wno-unused-private-field")
+target_link_libraries(GLESv2_enc PRIVATE OpenglCodecCommon_host cutils utils log androidemu android-emu-shared PRIVATE qemupipe_host)
\ No newline at end of file
diff --git a/system/GLESv2_enc/GL2Encoder.cpp b/system/GLESv2_enc/GL2Encoder.cpp
new file mode 100755
index 0000000..2c0321d
--- /dev/null
+++ b/system/GLESv2_enc/GL2Encoder.cpp
@@ -0,0 +1,6827 @@
+/*
+* Copyright (C) 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include "GL2Encoder.h"
+#include "GLESv2Validation.h"
+#include "GLESTextureUtils.h"
+
+#include <string>
+#include <map>
+
+#include <assert.h>
+#include <ctype.h>
+
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+#include <GLES2/gl2platform.h>
+
+#include <GLES3/gl3.h>
+#include <GLES3/gl31.h>
+
+using gfxstream::IOStream;
+
+#ifndef MIN
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+#endif
+
+static GLubyte *gVendorString= (GLubyte *) "Android";
+static GLubyte *gRendererString= (GLubyte *) "Android HW-GLES 3.0";
+static GLubyte *gVersionString= (GLubyte *) "OpenGL ES 3.0";
+static GLubyte *gExtensionsString= (GLubyte *) "GL_OES_EGL_image_external ";
+
+#define SET_ERROR_IF(condition, err) if((condition)) { \
+        ALOGE("%s:%s:%d GL error 0x%x condition [%s]\n", __FILE__, __FUNCTION__, __LINE__, err, #condition); \
+        ctx->setError(err); \
+        return; \
+    }
+
+#define SET_ERROR_WITH_MESSAGE_IF(condition, err, generator, genargs) if ((condition)) { \
+        std::string msg = generator genargs; \
+        ALOGE("%s:%s:%d GL error 0x%x\n" \
+              "Info: %s\n", __FILE__, __FUNCTION__, __LINE__, err, msg.c_str()); \
+        ctx->setError(err); \
+        return; \
+    } \
+
+#define RET_AND_SET_ERROR_IF(condition, err, ret) if((condition)) { \
+        ALOGE("%s:%s:%d GL error 0x%x\n", __FILE__, __FUNCTION__, __LINE__, err); \
+        ctx->setError(err);  \
+        return ret; \
+    } \
+
+#define RET_AND_SET_ERROR_WITH_MESSAGE_IF(condition, err, ret, generator, genargs) if((condition)) { \
+        std::string msg = generator genargs; \
+        ALOGE("%s:%s:%d GL error 0x%x\n" \
+              "Info: %s\n", __FILE__, __FUNCTION__, __LINE__, err, msg.c_str()); \
+        ctx->setError(err);   \
+        return ret; \
+    } \
+
+GL2Encoder::GL2Encoder(IOStream *stream, ChecksumCalculator *protocol)
+        : gl2_encoder_context_t(stream, protocol)
+{
+    m_currMajorVersion = 2;
+    m_currMinorVersion = 0;
+    m_hasAsyncUnmapBuffer = false;
+    m_hasSyncBufferData = false;
+    m_initialized = false;
+    m_noHostError = false;
+    m_state = NULL;
+    m_error = GL_NO_ERROR;
+
+    m_num_compressedTextureFormats = 0;
+    m_max_combinedTextureImageUnits = 0;
+    m_max_vertexTextureImageUnits = 0;
+    m_max_array_texture_layers = 0;
+    m_max_textureImageUnits = 0;
+    m_max_cubeMapTextureSize = 0;
+    m_max_renderBufferSize = 0;
+    m_max_textureSize = 0;
+    m_max_3d_textureSize = 0;
+    m_max_vertexAttribStride = 0;
+
+    m_max_transformFeedbackSeparateAttribs = 0;
+    m_max_uniformBufferBindings = 0;
+    m_max_colorAttachments = 0;
+    m_max_drawBuffers = 0;
+
+    m_max_atomicCounterBufferBindings = 0;
+    m_max_shaderStorageBufferBindings = 0;
+    m_max_vertexAttribBindings = 0;
+
+    m_textureBufferOffsetAlign = 0;
+
+    m_compressedTextureFormats = NULL;
+
+    m_ssbo_offset_align = 0;
+    m_ubo_offset_align = 0;
+
+    m_drawCallFlushInterval = 800;
+    m_drawCallFlushCount = 0;
+    m_primitiveRestartEnabled = false;
+    m_primitiveRestartIndex = 0;
+
+    // overrides
+#define OVERRIDE(name)  m_##name##_enc = this-> name ; this-> name = &s_##name
+#define OVERRIDE_CUSTOM(name)  this-> name = &s_##name
+#define OVERRIDEWITH(name, target)  do { \
+    m_##target##_enc = this-> target; \
+    this-> target = &s_##name; \
+} while(0)
+#define OVERRIDEOES(name) OVERRIDEWITH(name, name##OES)
+
+    OVERRIDE(glFlush);
+    OVERRIDE(glPixelStorei);
+    OVERRIDE(glGetString);
+    OVERRIDE(glBindBuffer);
+    OVERRIDE(glBufferData);
+    OVERRIDE(glBufferSubData);
+    OVERRIDE(glDeleteBuffers);
+    OVERRIDE(glDrawArrays);
+    OVERRIDE(glDrawElements);
+    OVERRIDE(glDrawArraysNullAEMU);
+    OVERRIDE(glDrawElementsNullAEMU);
+    OVERRIDE(glGetIntegerv);
+    OVERRIDE(glGetFloatv);
+    OVERRIDE(glGetBooleanv);
+    OVERRIDE(glVertexAttribPointer);
+    OVERRIDE(glEnableVertexAttribArray);
+    OVERRIDE(glDisableVertexAttribArray);
+    OVERRIDE(glGetVertexAttribiv);
+    OVERRIDE(glGetVertexAttribfv);
+    OVERRIDE(glGetVertexAttribPointerv);
+
+    this->glShaderBinary = &s_glShaderBinary;
+    this->glShaderSource = &s_glShaderSource;
+    this->glFinish = &s_glFinish;
+
+    OVERRIDE(glGetError);
+    OVERRIDE(glLinkProgram);
+    OVERRIDE(glDeleteProgram);
+    OVERRIDE(glGetUniformiv);
+    OVERRIDE(glGetUniformfv);
+    OVERRIDE(glCreateProgram);
+    OVERRIDE(glCreateShader);
+    OVERRIDE(glDeleteShader);
+    OVERRIDE(glAttachShader);
+    OVERRIDE(glDetachShader);
+    OVERRIDE(glGetAttachedShaders);
+    OVERRIDE(glGetShaderSource);
+    OVERRIDE(glGetShaderInfoLog);
+    OVERRIDE(glGetProgramInfoLog);
+
+    OVERRIDE(glGetUniformLocation);
+    OVERRIDE(glUseProgram);
+
+    OVERRIDE(glUniform1f);
+    OVERRIDE(glUniform1fv);
+    OVERRIDE(glUniform1i);
+    OVERRIDE(glUniform1iv);
+    OVERRIDE(glUniform2f);
+    OVERRIDE(glUniform2fv);
+    OVERRIDE(glUniform2i);
+    OVERRIDE(glUniform2iv);
+    OVERRIDE(glUniform3f);
+    OVERRIDE(glUniform3fv);
+    OVERRIDE(glUniform3i);
+    OVERRIDE(glUniform3iv);
+    OVERRIDE(glUniform4f);
+    OVERRIDE(glUniform4fv);
+    OVERRIDE(glUniform4i);
+    OVERRIDE(glUniform4iv);
+    OVERRIDE(glUniformMatrix2fv);
+    OVERRIDE(glUniformMatrix3fv);
+    OVERRIDE(glUniformMatrix4fv);
+
+    OVERRIDE(glActiveTexture);
+    OVERRIDE(glBindTexture);
+    OVERRIDE(glDeleteTextures);
+    OVERRIDE(glGetTexParameterfv);
+    OVERRIDE(glGetTexParameteriv);
+    OVERRIDE(glTexParameterf);
+    OVERRIDE(glTexParameterfv);
+    OVERRIDE(glTexParameteri);
+    OVERRIDE(glTexParameteriv);
+    OVERRIDE(glTexImage2D);
+    OVERRIDE(glTexSubImage2D);
+    OVERRIDE(glCopyTexImage2D);
+    OVERRIDE(glTexBufferOES);
+    OVERRIDE(glTexBufferRangeOES);
+    OVERRIDE(glTexBufferEXT);
+    OVERRIDE(glTexBufferRangeEXT);
+
+    OVERRIDE(glEnableiEXT);
+    OVERRIDE(glDisableiEXT);
+    OVERRIDE(glBlendEquationiEXT);
+    OVERRIDE(glBlendEquationSeparateiEXT);
+    OVERRIDE(glBlendFunciEXT);
+    OVERRIDE(glBlendFuncSeparateiEXT);
+    OVERRIDE(glColorMaskiEXT);
+    OVERRIDE(glIsEnablediEXT);
+
+    OVERRIDE(glGenRenderbuffers);
+    OVERRIDE(glDeleteRenderbuffers);
+    OVERRIDE(glBindRenderbuffer);
+    OVERRIDE(glRenderbufferStorage);
+    OVERRIDE(glFramebufferRenderbuffer);
+
+    OVERRIDE(glGenFramebuffers);
+    OVERRIDE(glDeleteFramebuffers);
+    OVERRIDE(glBindFramebuffer);
+    OVERRIDE(glFramebufferParameteri);
+    OVERRIDE(glFramebufferTexture2D);
+    OVERRIDE(glFramebufferTexture3DOES);
+    OVERRIDE(glGetFramebufferAttachmentParameteriv);
+
+    OVERRIDE(glCheckFramebufferStatus);
+
+    OVERRIDE(glGenVertexArrays);
+    OVERRIDE(glDeleteVertexArrays);
+    OVERRIDE(glBindVertexArray);
+    OVERRIDEOES(glGenVertexArrays);
+    OVERRIDEOES(glDeleteVertexArrays);
+    OVERRIDEOES(glBindVertexArray);
+
+    OVERRIDE_CUSTOM(glMapBufferOES);
+    OVERRIDE_CUSTOM(glUnmapBufferOES);
+    OVERRIDE_CUSTOM(glMapBufferRange);
+    OVERRIDE_CUSTOM(glUnmapBuffer);
+    OVERRIDE_CUSTOM(glFlushMappedBufferRange);
+
+    OVERRIDE(glCompressedTexImage2D);
+    OVERRIDE(glCompressedTexSubImage2D);
+
+    OVERRIDE(glBindBufferRange);
+    OVERRIDE(glBindBufferBase);
+
+    OVERRIDE(glCopyBufferSubData);
+
+    OVERRIDE(glGetBufferParameteriv);
+    OVERRIDE(glGetBufferParameteri64v);
+    OVERRIDE(glGetBufferPointerv);
+
+    OVERRIDE_CUSTOM(glGetUniformIndices);
+
+    OVERRIDE(glUniform1ui);
+    OVERRIDE(glUniform2ui);
+    OVERRIDE(glUniform3ui);
+    OVERRIDE(glUniform4ui);
+    OVERRIDE(glUniform1uiv);
+    OVERRIDE(glUniform2uiv);
+    OVERRIDE(glUniform3uiv);
+    OVERRIDE(glUniform4uiv);
+    OVERRIDE(glUniformMatrix2x3fv);
+    OVERRIDE(glUniformMatrix3x2fv);
+    OVERRIDE(glUniformMatrix2x4fv);
+    OVERRIDE(glUniformMatrix4x2fv);
+    OVERRIDE(glUniformMatrix3x4fv);
+    OVERRIDE(glUniformMatrix4x3fv);
+
+    OVERRIDE(glGetUniformuiv);
+    OVERRIDE(glGetActiveUniformBlockiv);
+
+    OVERRIDE(glGetVertexAttribIiv);
+    OVERRIDE(glGetVertexAttribIuiv);
+
+    OVERRIDE_CUSTOM(glVertexAttribIPointer);
+
+    OVERRIDE(glVertexAttribDivisor);
+
+    OVERRIDE(glRenderbufferStorageMultisample);
+    OVERRIDE(glDrawBuffers);
+    OVERRIDE(glReadBuffer);
+    OVERRIDE(glFramebufferTextureLayer);
+    OVERRIDE(glTexStorage2D);
+
+    OVERRIDE_CUSTOM(glTransformFeedbackVaryings);
+    OVERRIDE(glBeginTransformFeedback);
+    OVERRIDE(glEndTransformFeedback);
+    OVERRIDE(glPauseTransformFeedback);
+    OVERRIDE(glResumeTransformFeedback);
+
+    OVERRIDE(glTexImage3D);
+    OVERRIDE(glTexSubImage3D);
+    OVERRIDE(glTexStorage3D);
+    OVERRIDE(glCompressedTexImage3D);
+    OVERRIDE(glCompressedTexSubImage3D);
+
+    OVERRIDE(glDrawArraysInstanced);
+    OVERRIDE_CUSTOM(glDrawElementsInstanced);
+    OVERRIDE_CUSTOM(glDrawRangeElements);
+
+    OVERRIDE_CUSTOM(glGetStringi);
+    OVERRIDE(glGetProgramBinary);
+    OVERRIDE(glReadPixels);
+
+    OVERRIDE(glEnable);
+    OVERRIDE(glDisable);
+    OVERRIDE(glClearBufferiv);
+    OVERRIDE(glClearBufferuiv);
+    OVERRIDE(glClearBufferfv);
+    OVERRIDE(glBlitFramebuffer);
+    OVERRIDE_CUSTOM(glGetInternalformativ);
+
+    OVERRIDE(glGenerateMipmap);
+
+    OVERRIDE(glBindSampler);
+    OVERRIDE(glDeleteSamplers);
+
+    OVERRIDE_CUSTOM(glFenceSync);
+    OVERRIDE_CUSTOM(glClientWaitSync);
+    OVERRIDE_CUSTOM(glWaitSync);
+    OVERRIDE_CUSTOM(glDeleteSync);
+    OVERRIDE_CUSTOM(glIsSync);
+    OVERRIDE_CUSTOM(glGetSynciv);
+
+    OVERRIDE(glGetIntegeri_v);
+    OVERRIDE(glGetInteger64i_v);
+    OVERRIDE(glGetInteger64v);
+    OVERRIDE(glGetBooleani_v);
+
+    OVERRIDE(glGetShaderiv);
+
+    OVERRIDE(glActiveShaderProgram);
+    OVERRIDE_CUSTOM(glCreateShaderProgramv);
+    OVERRIDE(glProgramUniform1f);
+    OVERRIDE(glProgramUniform1fv);
+    OVERRIDE(glProgramUniform1i);
+    OVERRIDE(glProgramUniform1iv);
+    OVERRIDE(glProgramUniform1ui);
+    OVERRIDE(glProgramUniform1uiv);
+    OVERRIDE(glProgramUniform2f);
+    OVERRIDE(glProgramUniform2fv);
+    OVERRIDE(glProgramUniform2i);
+    OVERRIDE(glProgramUniform2iv);
+    OVERRIDE(glProgramUniform2ui);
+    OVERRIDE(glProgramUniform2uiv);
+    OVERRIDE(glProgramUniform3f);
+    OVERRIDE(glProgramUniform3fv);
+    OVERRIDE(glProgramUniform3i);
+    OVERRIDE(glProgramUniform3iv);
+    OVERRIDE(glProgramUniform3ui);
+    OVERRIDE(glProgramUniform3uiv);
+    OVERRIDE(glProgramUniform4f);
+    OVERRIDE(glProgramUniform4fv);
+    OVERRIDE(glProgramUniform4i);
+    OVERRIDE(glProgramUniform4iv);
+    OVERRIDE(glProgramUniform4ui);
+    OVERRIDE(glProgramUniform4uiv);
+    OVERRIDE(glProgramUniformMatrix2fv);
+    OVERRIDE(glProgramUniformMatrix2x3fv);
+    OVERRIDE(glProgramUniformMatrix2x4fv);
+    OVERRIDE(glProgramUniformMatrix3fv);
+    OVERRIDE(glProgramUniformMatrix3x2fv);
+    OVERRIDE(glProgramUniformMatrix3x4fv);
+    OVERRIDE(glProgramUniformMatrix4fv);
+    OVERRIDE(glProgramUniformMatrix4x2fv);
+    OVERRIDE(glProgramUniformMatrix4x3fv);
+
+    OVERRIDE(glProgramParameteri);
+    OVERRIDE(glUseProgramStages);
+    OVERRIDE(glBindProgramPipeline);
+
+    OVERRIDE(glGetProgramResourceiv);
+    OVERRIDE(glGetProgramResourceIndex);
+    OVERRIDE(glGetProgramResourceLocation);
+    OVERRIDE(glGetProgramResourceName);
+    OVERRIDE(glGetProgramPipelineInfoLog);
+
+    OVERRIDE(glVertexAttribFormat);
+    OVERRIDE(glVertexAttribIFormat);
+    OVERRIDE(glVertexBindingDivisor);
+    OVERRIDE(glVertexAttribBinding);
+    OVERRIDE(glBindVertexBuffer);
+
+    OVERRIDE_CUSTOM(glDrawArraysIndirect);
+    OVERRIDE_CUSTOM(glDrawElementsIndirect);
+
+    OVERRIDE(glTexStorage2DMultisample);
+
+    OVERRIDE_CUSTOM(glGetGraphicsResetStatusEXT);
+    OVERRIDE_CUSTOM(glReadnPixelsEXT);
+    OVERRIDE_CUSTOM(glGetnUniformfvEXT);
+    OVERRIDE_CUSTOM(glGetnUniformivEXT);
+
+    OVERRIDE(glInvalidateFramebuffer);
+    OVERRIDE(glInvalidateSubFramebuffer);
+
+    OVERRIDE(glDispatchCompute);
+    OVERRIDE(glDispatchComputeIndirect);
+
+    OVERRIDE(glGenTransformFeedbacks);
+    OVERRIDE(glDeleteTransformFeedbacks);
+    OVERRIDE(glGenSamplers);
+    OVERRIDE(glGenQueries);
+    OVERRIDE(glDeleteQueries);
+
+    OVERRIDE(glBindTransformFeedback);
+    OVERRIDE(glBeginQuery);
+    OVERRIDE(glEndQuery);
+
+    OVERRIDE(glClear);
+    OVERRIDE(glClearBufferfi);
+    OVERRIDE(glCopyTexSubImage2D);
+    OVERRIDE(glCopyTexSubImage3D);
+    OVERRIDE(glCompileShader);
+    OVERRIDE(glValidateProgram);
+    OVERRIDE(glProgramBinary);
+
+    OVERRIDE(glGetSamplerParameterfv);
+    OVERRIDE(glGetSamplerParameteriv);
+    OVERRIDE(glSamplerParameterf);
+    OVERRIDE(glSamplerParameteri);
+    OVERRIDE(glSamplerParameterfv);
+    OVERRIDE(glSamplerParameteriv);
+
+    OVERRIDE(glGetAttribLocation);
+
+    OVERRIDE(glBindAttribLocation);
+    OVERRIDE(glUniformBlockBinding);
+    OVERRIDE(glGetTransformFeedbackVarying);
+    OVERRIDE(glScissor);
+    OVERRIDE(glDepthFunc);
+    OVERRIDE(glViewport);
+    OVERRIDE(glStencilFunc);
+    OVERRIDE(glStencilFuncSeparate);
+    OVERRIDE(glStencilOp);
+    OVERRIDE(glStencilOpSeparate);
+    OVERRIDE(glStencilMaskSeparate);
+    OVERRIDE(glBlendEquation);
+    OVERRIDE(glBlendEquationSeparate);
+    OVERRIDE(glBlendFunc);
+    OVERRIDE(glBlendFuncSeparate);
+    OVERRIDE(glCullFace);
+    OVERRIDE(glFrontFace);
+    OVERRIDE(glLineWidth);
+    OVERRIDE(glVertexAttrib1f);
+    OVERRIDE(glVertexAttrib2f);
+    OVERRIDE(glVertexAttrib3f);
+    OVERRIDE(glVertexAttrib4f);
+    OVERRIDE(glVertexAttrib1fv);
+    OVERRIDE(glVertexAttrib2fv);
+    OVERRIDE(glVertexAttrib3fv);
+    OVERRIDE(glVertexAttrib4fv);
+    OVERRIDE(glVertexAttribI4i);
+    OVERRIDE(glVertexAttribI4ui);
+    OVERRIDE(glVertexAttribI4iv);
+    OVERRIDE(glVertexAttribI4uiv);
+
+    OVERRIDE(glGetShaderPrecisionFormat);
+    OVERRIDE(glGetProgramiv);
+    OVERRIDE(glGetActiveUniform);
+    OVERRIDE(glGetActiveUniformsiv);
+    OVERRIDE(glGetActiveUniformBlockName);
+    OVERRIDE(glGetActiveAttrib);
+    OVERRIDE(glGetRenderbufferParameteriv);
+    OVERRIDE(glGetQueryiv);
+    OVERRIDE(glGetQueryObjectuiv);
+    OVERRIDE(glIsEnabled);
+    OVERRIDE(glHint);
+
+    OVERRIDE(glGetFragDataLocation);
+
+    OVERRIDE(glStencilMask);
+    OVERRIDE(glClearStencil);
+}
+
+GL2Encoder::~GL2Encoder()
+{
+    delete m_compressedTextureFormats;
+}
+
+GLenum GL2Encoder::s_glGetError(void * self)
+{
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    GLenum err = ctx->getError();
+    if(err != GL_NO_ERROR) {
+        if (!ctx->m_noHostError) {
+            ctx->m_glGetError_enc(ctx); // also clear host error
+        }
+        ctx->setError(GL_NO_ERROR);
+        return err;
+    }
+
+    if (ctx->m_noHostError) {
+        return GL_NO_ERROR;
+    } else {
+        return ctx->m_glGetError_enc(self);
+    }
+}
+
+class GL2Encoder::ErrorUpdater {
+public:
+    ErrorUpdater(GL2Encoder* ctx) :
+        mCtx(ctx),
+        guest_error(ctx->getError()),
+        host_error(ctx->m_glGetError_enc(ctx)) {
+            if (ctx->m_noHostError) {
+                host_error = GL_NO_ERROR;
+            }
+            // Preserve any existing GL error in the guest:
+            // OpenGL ES 3.0.5 spec:
+            // The command enum GetError( void ); is used to obtain error information.
+            // Each detectable error is assigned a numeric code. When an error is
+            // detected, a flag is set and the code is recorded. Further errors, if
+            // they occur, do not affect this recorded code. When GetError is called,
+            // the code is returned and the flag is cleared, so that a further error
+            // will again record its code. If a call to GetError returns NO_ERROR, then
+            // there has been no detectable error since the last call to GetError (or
+            // since the GL was initialized).
+            if (guest_error == GL_NO_ERROR) {
+                guest_error = host_error;
+            }
+        }
+
+    GLenum getHostErrorAndUpdate() {
+        host_error = mCtx->m_glGetError_enc(mCtx);
+        if (guest_error == GL_NO_ERROR) {
+            guest_error = host_error;
+        }
+        return host_error;
+    }
+
+    void updateGuestErrorState() {
+        mCtx->setError(guest_error);
+    }
+
+private:
+    GL2Encoder* mCtx;
+    GLenum guest_error;
+    GLenum host_error;
+};
+
+template<class T>
+class GL2Encoder::ScopedQueryUpdate {
+public:
+    ScopedQueryUpdate(GL2Encoder* ctx, uint32_t bytes, T* target) :
+        mCtx(ctx),
+        mBuf(bytes, 0),
+        mTarget(target),
+        mErrorUpdater(ctx) {
+    }
+    T* hostStagingBuffer() {
+        return (T*)&mBuf[0];
+    }
+    ~ScopedQueryUpdate() {
+        GLint hostError = mErrorUpdater.getHostErrorAndUpdate();
+        if (hostError == GL_NO_ERROR && mTarget) {
+            memcpy(mTarget, &mBuf[0], mBuf.size());
+        }
+        mErrorUpdater.updateGuestErrorState();
+    }
+private:
+    GL2Encoder* mCtx;
+    std::vector<char> mBuf;
+    T* mTarget;
+    ErrorUpdater mErrorUpdater;
+};
+
+void GL2Encoder::safe_glGetBooleanv(GLenum param, GLboolean* val) {
+    ScopedQueryUpdate<GLboolean> query(this, glUtilsParamSize(param) * sizeof(GLboolean), val);
+    m_glGetBooleanv_enc(this, param, query.hostStagingBuffer());
+}
+
+void GL2Encoder::safe_glGetFloatv(GLenum param, GLfloat* val) {
+    ScopedQueryUpdate<GLfloat> query(this, glUtilsParamSize(param) * sizeof(GLfloat), val);
+    m_glGetFloatv_enc(this, param, query.hostStagingBuffer());
+}
+
+void GL2Encoder::safe_glGetIntegerv(GLenum param, GLint* val) {
+    ScopedQueryUpdate<GLint> query(this, glUtilsParamSize(param) * sizeof(GLint), val);
+    m_glGetIntegerv_enc(this, param, query.hostStagingBuffer());
+}
+
+void GL2Encoder::safe_glGetInteger64v(GLenum param, GLint64* val) {
+    ScopedQueryUpdate<GLint64> query(this, glUtilsParamSize(param) * sizeof(GLint64), val);
+    m_glGetInteger64v_enc(this, param, query.hostStagingBuffer());
+}
+
+void GL2Encoder::safe_glGetIntegeri_v(GLenum param, GLuint index, GLint* val) {
+    ScopedQueryUpdate<GLint> query(this, sizeof(GLint), val);
+    m_glGetIntegeri_v_enc(this, param, index, query.hostStagingBuffer());
+}
+
+void GL2Encoder::safe_glGetInteger64i_v(GLenum param, GLuint index, GLint64* val) {
+    ScopedQueryUpdate<GLint64> query(this, sizeof(GLint64), val);
+    m_glGetInteger64i_v_enc(this, param, index, query.hostStagingBuffer());
+}
+
+void GL2Encoder::safe_glGetBooleani_v(GLenum param, GLuint index, GLboolean* val) {
+    ScopedQueryUpdate<GLboolean> query(this, sizeof(GLboolean), val);
+    m_glGetBooleani_v_enc(this, param, index, query.hostStagingBuffer());
+}
+
+void GL2Encoder::s_glFlush(void *self)
+{
+    GL2Encoder *ctx = (GL2Encoder *) self;
+    ctx->m_glFlush_enc(self);
+    ctx->m_stream->flush();
+}
+
+const GLubyte *GL2Encoder::s_glGetString(void *self, GLenum name)
+{
+    GL2Encoder *ctx = (GL2Encoder *)self;
+
+    GLubyte *retval =  (GLubyte *) "";
+    RET_AND_SET_ERROR_IF(
+        name != GL_VENDOR &&
+        name != GL_RENDERER &&
+        name != GL_VERSION &&
+        name != GL_EXTENSIONS,
+        GL_INVALID_ENUM,
+        retval);
+    switch(name) {
+    case GL_VENDOR:
+        retval = gVendorString;
+        break;
+    case GL_RENDERER:
+        retval = gRendererString;
+        break;
+    case GL_VERSION:
+        retval = gVersionString;
+        break;
+    case GL_EXTENSIONS:
+        retval = gExtensionsString;
+        break;
+    }
+    return retval;
+}
+
+void GL2Encoder::s_glPixelStorei(void *self, GLenum param, GLint value)
+{
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    SET_ERROR_IF(!GLESv2Validation::pixelStoreParam(ctx, param), GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::pixelStoreValue(param, value), GL_INVALID_VALUE);
+    ctx->m_glPixelStorei_enc(ctx, param, value);
+    assert(ctx->m_state != NULL);
+    ctx->m_state->setPixelStore(param, value);
+}
+void GL2Encoder::s_glBindBuffer(void *self, GLenum target, GLuint id)
+{
+    GL2Encoder *ctx = (GL2Encoder *) self;
+    assert(ctx->m_state != NULL);
+    SET_ERROR_IF(!GLESv2Validation::bufferTarget(ctx, target), GL_INVALID_ENUM);
+
+    bool nop = ctx->m_state->isNonIndexedBindNoOp(target, id);
+
+    if (nop) return;
+
+    ctx->m_state->bindBuffer(target, id);
+    ctx->m_state->addBuffer(id);
+    ctx->m_glBindBuffer_enc(ctx, target, id);
+    ctx->m_state->setLastEncodedBufferBind(target, id);
+}
+
+void GL2Encoder::doBindBufferEncodeCached(GLenum target, GLuint id) {
+    bool encode = id != m_state->getLastEncodedBufferBind(target);
+
+    if (encode) {
+        m_glBindBuffer_enc(this, target, id);
+    }
+
+    m_state->setLastEncodedBufferBind(target, id);
+}
+
+void GL2Encoder::s_glBufferData(void * self, GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage)
+{
+    GL2Encoder *ctx = (GL2Encoder *) self;
+    SET_ERROR_IF(!GLESv2Validation::bufferTarget(ctx, target), GL_INVALID_ENUM);
+    GLuint bufferId = ctx->m_state->getBuffer(target);
+    SET_ERROR_IF(bufferId==0, GL_INVALID_OPERATION);
+    SET_ERROR_IF(size<0, GL_INVALID_VALUE);
+    SET_ERROR_IF(!GLESv2Validation::bufferUsage(ctx, usage), GL_INVALID_ENUM);
+
+    ctx->m_shared->updateBufferData(bufferId, size, data);
+    ctx->m_shared->setBufferUsage(bufferId, usage);
+    if (ctx->m_hasSyncBufferData) {
+        ctx->glBufferDataSyncAEMU(self, target, size, data, usage);
+    } else {
+        ctx->m_glBufferData_enc(self, target, size, data, usage);
+    }
+}
+
+void GL2Encoder::s_glBufferSubData(void * self, GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data)
+{
+    GL2Encoder *ctx = (GL2Encoder *) self;
+    SET_ERROR_IF(!GLESv2Validation::bufferTarget(ctx, target), GL_INVALID_ENUM);
+    GLuint bufferId = ctx->m_state->getBuffer(target);
+    SET_ERROR_IF(bufferId==0, GL_INVALID_OPERATION);
+    SET_ERROR_IF(ctx->isBufferTargetMapped(target), GL_INVALID_OPERATION);
+
+    GLenum res = ctx->m_shared->subUpdateBufferData(bufferId, offset, size, data);
+    SET_ERROR_IF(res, res);
+
+    ctx->m_glBufferSubData_enc(self, target, offset, size, data);
+}
+
+void GL2Encoder::s_glGenBuffers(void* self, GLsizei n, GLuint* buffers) {
+    GL2Encoder *ctx = (GL2Encoder *) self;
+    SET_ERROR_IF(n<0, GL_INVALID_VALUE);
+    ctx->m_glGenBuffers_enc(self, n, buffers);
+    for (int i = 0; i < n; i++) {
+        ctx->m_state->addBuffer(buffers[i]);
+    }
+}
+
+void GL2Encoder::s_glDeleteBuffers(void * self, GLsizei n, const GLuint * buffers)
+{
+    GL2Encoder *ctx = (GL2Encoder *) self;
+    SET_ERROR_IF(n<0, GL_INVALID_VALUE);
+    for (int i=0; i<n; i++) {
+        // Technically if the buffer is mapped, we should unmap it, but we won't
+        // use it anymore after this :)
+        ctx->m_shared->deleteBufferData(buffers[i]);
+        ctx->m_state->unBindBuffer(buffers[i]);
+        ctx->m_state->removeBuffer(buffers[i]);
+        ctx->m_glDeleteBuffers_enc(self,1,&buffers[i]);
+    }
+}
+
+#define VALIDATE_VERTEX_ATTRIB_INDEX(index) \
+    SET_ERROR_IF(index >= CODEC_MAX_VERTEX_ATTRIBUTES, GL_INVALID_VALUE); \
+
+void GL2Encoder::s_glVertexAttribPointer(void *self, GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * ptr)
+{
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    assert(ctx->m_state != NULL);
+    VALIDATE_VERTEX_ATTRIB_INDEX(indx);
+    SET_ERROR_IF((size < 1 || size > 4), GL_INVALID_VALUE);
+    SET_ERROR_IF(!GLESv2Validation::vertexAttribType(ctx, type), GL_INVALID_ENUM);
+    SET_ERROR_IF(stride < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF((type == GL_INT_2_10_10_10_REV ||
+                  type == GL_UNSIGNED_INT_2_10_10_10_REV) &&
+                 size != 4,
+                 GL_INVALID_OPERATION);
+    ctx->m_state->setVertexAttribBinding(indx, indx);
+    ctx->m_state->setVertexAttribFormat(indx, size, type, normalized, 0, false);
+
+    GLsizei effectiveStride = stride;
+    if (stride == 0) {
+        effectiveStride = glSizeof(type) * size;
+        switch (type) {
+            case GL_INT_2_10_10_10_REV:
+            case GL_UNSIGNED_INT_2_10_10_10_REV:
+                effectiveStride /= 4;
+                break;
+            default:
+                break;
+        }
+    }
+
+    ctx->m_state->bindIndexedBuffer(0, indx, ctx->m_state->currentArrayVbo(), (uintptr_t)ptr, 0, stride, effectiveStride);
+
+    if (ctx->m_state->currentArrayVbo() != 0) {
+        ctx->glVertexAttribPointerOffset(ctx, indx, size, type, normalized, stride, (uintptr_t)ptr);
+    } else {
+        SET_ERROR_IF(ctx->m_state->currentVertexArrayObject() != 0 && ptr, GL_INVALID_OPERATION);
+        // wait for client-array handler
+    }
+}
+
+void GL2Encoder::s_glGetIntegerv(void *self, GLenum param, GLint *ptr)
+{
+    GL2Encoder *ctx = (GL2Encoder *) self;
+    GLClientState* state = ctx->m_state;
+
+    switch (param) {
+    case GL_NUM_EXTENSIONS:
+        *ptr = (int)ctx->m_currExtensionsArray.size();
+        break;
+    case GL_MAJOR_VERSION:
+        *ptr = ctx->m_deviceMajorVersion;
+        break;
+    case GL_MINOR_VERSION:
+        *ptr = ctx->m_deviceMinorVersion;
+        break;
+    case GL_NUM_SHADER_BINARY_FORMATS:
+        *ptr = 0;
+        break;
+    case GL_SHADER_BINARY_FORMATS:
+        // do nothing
+        break;
+
+    case GL_COMPRESSED_TEXTURE_FORMATS: {
+        GLint *compressedTextureFormats = ctx->getCompressedTextureFormats();
+        if (ctx->m_num_compressedTextureFormats > 0 &&
+                compressedTextureFormats != NULL) {
+            memcpy(ptr, compressedTextureFormats,
+                    ctx->m_num_compressedTextureFormats * sizeof(GLint));
+        }
+        break;
+    }
+
+    case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS:
+        if (ctx->m_max_combinedTextureImageUnits != 0) {
+            *ptr = ctx->m_max_combinedTextureImageUnits;
+        } else {
+            ctx->safe_glGetIntegerv(param, ptr);
+            ctx->m_max_combinedTextureImageUnits = *ptr;
+        }
+        break;
+    case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS:
+        if (ctx->m_max_vertexTextureImageUnits != 0) {
+            *ptr = ctx->m_max_vertexTextureImageUnits;
+        } else {
+            ctx->safe_glGetIntegerv(param, ptr);
+            ctx->m_max_vertexTextureImageUnits = *ptr;
+        }
+        break;
+    case GL_MAX_ARRAY_TEXTURE_LAYERS:
+        if (ctx->m_max_array_texture_layers != 0) {
+            *ptr = ctx->m_max_array_texture_layers;
+        } else {
+            ctx->safe_glGetIntegerv(param, ptr);
+            ctx->m_max_array_texture_layers = *ptr;
+        }
+        break;
+    case GL_MAX_TEXTURE_IMAGE_UNITS:
+        if (ctx->m_max_textureImageUnits != 0) {
+            *ptr = ctx->m_max_textureImageUnits;
+        } else {
+            ctx->safe_glGetIntegerv(param, ptr);
+            ctx->m_max_textureImageUnits = *ptr;
+        }
+        break;
+    case GL_TEXTURE_BINDING_2D:
+        if (!state) return;
+        *ptr = state->getBoundTexture(GL_TEXTURE_2D);
+        break;
+    case GL_TEXTURE_BINDING_EXTERNAL_OES:
+        if (!state) return;
+        *ptr = state->getBoundTexture(GL_TEXTURE_EXTERNAL_OES);
+        break;
+    case GL_MAX_VERTEX_ATTRIBS:
+        *ptr = CODEC_MAX_VERTEX_ATTRIBUTES;
+        break;
+    case GL_MAX_VERTEX_ATTRIB_STRIDE:
+        if (ctx->m_max_vertexAttribStride != 0) {
+            *ptr = ctx->m_max_vertexAttribStride;
+        } else {
+            ctx->safe_glGetIntegerv(param, ptr);
+            ctx->m_max_vertexAttribStride = *ptr;
+        }
+        break;
+    case GL_MAX_CUBE_MAP_TEXTURE_SIZE:
+        if (ctx->m_max_cubeMapTextureSize != 0) {
+            *ptr = ctx->m_max_cubeMapTextureSize;
+        } else {
+            ctx->safe_glGetIntegerv(param, ptr);
+            ctx->m_max_cubeMapTextureSize = *ptr;
+        }
+        break;
+    case GL_MAX_RENDERBUFFER_SIZE:
+        if (ctx->m_max_renderBufferSize != 0) {
+            *ptr = ctx->m_max_renderBufferSize;
+        } else {
+            ctx->safe_glGetIntegerv(param, ptr);
+            ctx->m_max_renderBufferSize = *ptr;
+        }
+        break;
+    case GL_MAX_TEXTURE_SIZE:
+        if (ctx->m_max_textureSize != 0) {
+            *ptr = ctx->m_max_textureSize;
+        } else {
+            ctx->safe_glGetIntegerv(param, ptr);
+            ctx->m_max_textureSize = *ptr;
+            if (ctx->m_max_textureSize > 0) {
+                uint32_t current = 1;
+                while (current < ctx->m_max_textureSize) {
+                    ++ctx->m_log2MaxTextureSize;
+                    current = current << 1;
+                }
+            }
+        }
+        break;
+    case GL_MAX_3D_TEXTURE_SIZE:
+        if (ctx->m_max_3d_textureSize != 0) {
+            *ptr = ctx->m_max_3d_textureSize;
+        } else {
+            ctx->safe_glGetIntegerv(param, ptr);
+            ctx->m_max_3d_textureSize = *ptr;
+        }
+        break;
+    case GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT:
+        if (ctx->m_ssbo_offset_align != 0) {
+            *ptr = ctx->m_ssbo_offset_align;
+        } else {
+            ctx->safe_glGetIntegerv(param, ptr);
+            ctx->m_ssbo_offset_align = *ptr;
+        }
+        break;
+    case GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT:
+        if (ctx->m_ubo_offset_align != 0) {
+            *ptr = ctx->m_ubo_offset_align;
+        } else {
+            ctx->safe_glGetIntegerv(param, ptr);
+            ctx->m_ubo_offset_align = *ptr;
+        }
+        break;
+    // Desktop OpenGL can allow a mindboggling # samples per pixel (such as 64).
+    // Limit to 4 (spec minimum) to keep dEQP tests from timing out.
+    case GL_MAX_SAMPLES:
+    case GL_MAX_COLOR_TEXTURE_SAMPLES:
+    case GL_MAX_INTEGER_SAMPLES:
+    case GL_MAX_DEPTH_TEXTURE_SAMPLES:
+        *ptr = 4;
+        break;
+    // Checks for version-incompatible enums.
+    // Not allowed in vanilla ES 2.0.
+    case GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:
+        SET_ERROR_IF(ctx->majorVersion() < 3, GL_INVALID_ENUM);
+        if (ctx->m_max_transformFeedbackSeparateAttribs != 0) {
+            *ptr = ctx->m_max_transformFeedbackSeparateAttribs;
+        } else {
+            ctx->safe_glGetIntegerv(param, ptr);
+            ctx->m_max_transformFeedbackSeparateAttribs = *ptr;
+        }
+        break;
+    case GL_MAX_UNIFORM_BUFFER_BINDINGS:
+        SET_ERROR_IF(ctx->majorVersion() < 3, GL_INVALID_ENUM);
+        if (ctx->m_max_uniformBufferBindings != 0) {
+            *ptr = ctx->m_max_uniformBufferBindings;
+        } else {
+            ctx->safe_glGetIntegerv(param, ptr);
+            ctx->m_max_uniformBufferBindings = *ptr;
+        }
+        break;
+    case GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT_OES:
+        SET_ERROR_IF(!ctx->es32Plus() && !ctx->getExtensions().textureBufferAny(), GL_INVALID_ENUM);
+        if(ctx->m_textureBufferOffsetAlign != 0) {
+            *ptr = ctx->m_textureBufferOffsetAlign;
+        } else {
+            ctx->safe_glGetIntegerv(param, ptr);
+            ctx->m_textureBufferOffsetAlign = *ptr;
+        }
+        break;
+    case GL_MAX_COLOR_ATTACHMENTS:
+        SET_ERROR_IF(ctx->majorVersion() < 3 &&
+                     !ctx->hasExtension("GL_EXT_draw_buffers"), GL_INVALID_ENUM);
+        if (ctx->m_max_colorAttachments != 0) {
+            *ptr = ctx->m_max_colorAttachments;
+        } else {
+            ctx->safe_glGetIntegerv(param, ptr);
+            ctx->m_max_colorAttachments = *ptr;
+        }
+        break;
+    case GL_MAX_DRAW_BUFFERS:
+        SET_ERROR_IF(ctx->majorVersion() < 3 &&
+                     !ctx->hasExtension("GL_EXT_draw_buffers"), GL_INVALID_ENUM);
+        if (ctx->m_max_drawBuffers != 0) {
+            *ptr = ctx->m_max_drawBuffers;
+        } else {
+            ctx->safe_glGetIntegerv(param, ptr);
+            ctx->m_max_drawBuffers = *ptr;
+        }
+        break;
+    // Not allowed in ES 3.0.
+    case GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS:
+        SET_ERROR_IF(ctx->majorVersion() < 3 ||
+                     (ctx->majorVersion() == 3 &&
+                      ctx->minorVersion() == 0), GL_INVALID_ENUM);
+        if (ctx->m_max_atomicCounterBufferBindings != 0) {
+            *ptr = ctx->m_max_atomicCounterBufferBindings;
+        } else {
+            ctx->safe_glGetIntegerv(param, ptr);
+            ctx->m_max_atomicCounterBufferBindings = *ptr;
+        }
+        break;
+    case GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS:
+        SET_ERROR_IF(ctx->majorVersion() < 3 ||
+                     (ctx->majorVersion() == 3 &&
+                      ctx->minorVersion() == 0), GL_INVALID_ENUM);
+        if (ctx->m_max_shaderStorageBufferBindings != 0) {
+            *ptr = ctx->m_max_shaderStorageBufferBindings;
+        } else {
+            ctx->safe_glGetIntegerv(param, ptr);
+            ctx->m_max_shaderStorageBufferBindings = *ptr;
+        }
+        break;
+    case GL_MAX_VERTEX_ATTRIB_BINDINGS:
+        SET_ERROR_IF(ctx->majorVersion() < 3 ||
+                     (ctx->majorVersion() == 3 &&
+                      ctx->minorVersion() == 0), GL_INVALID_ENUM);
+        if (ctx->m_max_vertexAttribBindings != 0) {
+            *ptr = ctx->m_max_vertexAttribBindings;
+        } else {
+            ctx->safe_glGetIntegerv(param, ptr);
+            ctx->m_max_vertexAttribBindings = *ptr;
+        }
+        break;
+    case GL_RESET_NOTIFICATION_STRATEGY_EXT:
+        // BUG: 121414786
+        *ptr = GL_LOSE_CONTEXT_ON_RESET_EXT;
+        break;
+    default:
+        if (!state) return;
+        if (!state->getClientStateParameter<GLint>(param, ptr)) {
+            ctx->safe_glGetIntegerv(param, ptr);
+        }
+        break;
+    }
+}
+
+
+void GL2Encoder::s_glGetFloatv(void *self, GLenum param, GLfloat *ptr)
+{
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    GLClientState* state = ctx->m_state;
+
+    switch (param) {
+    case GL_NUM_SHADER_BINARY_FORMATS:
+        *ptr = 0;
+        break;
+    case GL_SHADER_BINARY_FORMATS:
+        // do nothing
+        break;
+
+    case GL_COMPRESSED_TEXTURE_FORMATS: {
+        GLint *compressedTextureFormats = ctx->getCompressedTextureFormats();
+        if (ctx->m_num_compressedTextureFormats > 0 &&
+                compressedTextureFormats != NULL) {
+            for (int i = 0; i < ctx->m_num_compressedTextureFormats; i++) {
+                ptr[i] = (GLfloat) compressedTextureFormats[i];
+            }
+        }
+        break;
+    }
+
+    case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS:
+    case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS:
+    case GL_MAX_TEXTURE_IMAGE_UNITS:
+    case GL_MAX_VERTEX_ATTRIBS:
+    case GL_MAX_VERTEX_ATTRIB_STRIDE:
+    case GL_MAX_CUBE_MAP_TEXTURE_SIZE:
+    case GL_MAX_RENDERBUFFER_SIZE:
+    case GL_MAX_TEXTURE_SIZE:
+    case GL_MAX_3D_TEXTURE_SIZE:
+    case GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT:
+    case GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT:
+    case GL_MAX_SAMPLES:
+    case GL_MAX_COLOR_TEXTURE_SAMPLES:
+    case GL_MAX_INTEGER_SAMPLES:
+    case GL_MAX_DEPTH_TEXTURE_SAMPLES:
+    case GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:
+    case GL_MAX_UNIFORM_BUFFER_BINDINGS:
+    case GL_MAX_COLOR_ATTACHMENTS:
+    case GL_MAX_DRAW_BUFFERS:
+    case GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS:
+    case GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS:
+    case GL_MAX_VERTEX_ATTRIB_BINDINGS:
+    case GL_TEXTURE_BINDING_2D:
+    case GL_TEXTURE_BINDING_EXTERNAL_OES: {
+        GLint res;
+        s_glGetIntegerv(ctx, param, &res);
+        *ptr = (GLfloat)res;
+        break;
+    }
+
+    default:
+        if (!state) return;
+        if (!state->getClientStateParameter<GLfloat>(param, ptr)) {
+            ctx->safe_glGetFloatv(param, ptr);
+        }
+        break;
+    }
+}
+
+
+void GL2Encoder::s_glGetBooleanv(void *self, GLenum param, GLboolean *ptr)
+{
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    GLClientState* state = ctx->m_state;
+
+    switch (param) {
+    case GL_NUM_SHADER_BINARY_FORMATS:
+        *ptr = GL_FALSE;
+        break;
+    case GL_SHADER_BINARY_FORMATS:
+        // do nothing
+        break;
+
+    case GL_COMPRESSED_TEXTURE_FORMATS: {
+        GLint *compressedTextureFormats = ctx->getCompressedTextureFormats();
+        if (ctx->m_num_compressedTextureFormats > 0 &&
+                compressedTextureFormats != NULL) {
+            for (int i = 0; i < ctx->m_num_compressedTextureFormats; i++) {
+                ptr[i] = compressedTextureFormats[i] != 0 ? GL_TRUE : GL_FALSE;
+            }
+        }
+        break;
+    }
+
+    case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS:
+    case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS:
+    case GL_MAX_TEXTURE_IMAGE_UNITS:
+    case GL_MAX_VERTEX_ATTRIBS:
+    case GL_MAX_VERTEX_ATTRIB_STRIDE:
+    case GL_MAX_CUBE_MAP_TEXTURE_SIZE:
+    case GL_MAX_RENDERBUFFER_SIZE:
+    case GL_MAX_TEXTURE_SIZE:
+    case GL_MAX_3D_TEXTURE_SIZE:
+    case GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT:
+    case GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT:
+    case GL_MAX_SAMPLES:
+    case GL_MAX_COLOR_TEXTURE_SAMPLES:
+    case GL_MAX_INTEGER_SAMPLES:
+    case GL_MAX_DEPTH_TEXTURE_SAMPLES:
+    case GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:
+    case GL_MAX_UNIFORM_BUFFER_BINDINGS:
+    case GL_MAX_COLOR_ATTACHMENTS:
+    case GL_MAX_DRAW_BUFFERS:
+    case GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS:
+    case GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS:
+    case GL_MAX_VERTEX_ATTRIB_BINDINGS:
+    case GL_TEXTURE_BINDING_2D:
+    case GL_TEXTURE_BINDING_EXTERNAL_OES: {
+        GLint res;
+        s_glGetIntegerv(ctx, param, &res);
+        *ptr = res == 0 ? GL_FALSE : GL_TRUE;
+        break;
+    }
+
+    default:
+        if (!state) return;
+        {
+            GLint intVal;
+            if (!state->getClientStateParameter<GLint>(param, &intVal)) {
+                ctx->safe_glGetBooleanv(param, ptr);
+            } else {
+                *ptr = (intVal != 0) ? GL_TRUE : GL_FALSE;
+            }
+        }
+        break;
+    }
+}
+
+
+void GL2Encoder::s_glEnableVertexAttribArray(void *self, GLuint index)
+{
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    assert(ctx->m_state);
+    VALIDATE_VERTEX_ATTRIB_INDEX(index);
+    ctx->m_glEnableVertexAttribArray_enc(ctx, index);
+    ctx->m_state->enable(index, 1);
+}
+
+void GL2Encoder::s_glDisableVertexAttribArray(void *self, GLuint index)
+{
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    assert(ctx->m_state);
+    VALIDATE_VERTEX_ATTRIB_INDEX(index);
+    ctx->m_glDisableVertexAttribArray_enc(ctx, index);
+    ctx->m_state->enable(index, 0);
+}
+
+
+void GL2Encoder::s_glGetVertexAttribiv(void *self, GLuint index, GLenum pname, GLint *params)
+{
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    VALIDATE_VERTEX_ATTRIB_INDEX(index);
+    SET_ERROR_IF(!GLESv2Validation::allowedGetVertexAttrib(pname), GL_INVALID_ENUM);
+
+    if (!ctx->m_state->getVertexAttribParameter<GLint>(index, pname, params)) {
+        ctx->m_glGetVertexAttribiv_enc(self, index, pname, params);
+    }
+}
+
+void GL2Encoder::s_glGetVertexAttribfv(void *self, GLuint index, GLenum pname, GLfloat *params)
+{
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    VALIDATE_VERTEX_ATTRIB_INDEX(index);
+    SET_ERROR_IF(!GLESv2Validation::allowedGetVertexAttrib(pname), GL_INVALID_ENUM);
+
+    if (!ctx->m_state->getVertexAttribParameter<GLfloat>(index, pname, params)) {
+        ctx->m_glGetVertexAttribfv_enc(self, index, pname, params);
+    }
+}
+
+void GL2Encoder::s_glGetVertexAttribPointerv(void *self, GLuint index, GLenum pname, GLvoid **pointer)
+{
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    if (ctx->m_state == NULL) return;
+    VALIDATE_VERTEX_ATTRIB_INDEX(index);
+    SET_ERROR_IF(pname != GL_VERTEX_ATTRIB_ARRAY_POINTER, GL_INVALID_ENUM);
+    (void)pname;
+
+    *pointer = (GLvoid*)(ctx->m_state->getCurrAttributeBindingInfo(index).offset);
+}
+
+void GL2Encoder::calcIndexRange(const void* indices,
+                                GLenum type,
+                                GLsizei count,
+                                int* minIndex_out,
+                                int* maxIndex_out) {
+    switch(type) {
+    case GL_BYTE:
+    case GL_UNSIGNED_BYTE:
+        GLUtils::minmaxExcept(
+                (unsigned char *)indices, count,
+                minIndex_out, maxIndex_out,
+                m_primitiveRestartEnabled, GLUtils::primitiveRestartIndex<unsigned char>());
+        break;
+    case GL_SHORT:
+    case GL_UNSIGNED_SHORT:
+        GLUtils::minmaxExcept(
+                (unsigned short *)indices, count,
+                minIndex_out, maxIndex_out,
+                m_primitiveRestartEnabled, GLUtils::primitiveRestartIndex<unsigned short>());
+        break;
+    case GL_INT:
+    case GL_UNSIGNED_INT:
+        GLUtils::minmaxExcept(
+                (unsigned int *)indices, count,
+                minIndex_out, maxIndex_out,
+                m_primitiveRestartEnabled, GLUtils::primitiveRestartIndex<unsigned int>());
+        break;
+    default:
+        ALOGE("unsupported index buffer type %d\n", type);
+    }
+}
+
+void* GL2Encoder::recenterIndices(const void* src,
+                                  GLenum type,
+                                  GLsizei count,
+                                  int minIndex) {
+
+    void* adjustedIndices = (void*)src;
+
+    if (minIndex != 0) {
+        m_fixedBuffer.resize(glSizeof(type) * count);
+        adjustedIndices = m_fixedBuffer.data();
+        switch(type) {
+        case GL_BYTE:
+        case GL_UNSIGNED_BYTE:
+            GLUtils::shiftIndicesExcept(
+                    (unsigned char *)src,
+                    (unsigned char *)adjustedIndices,
+                    count, -minIndex,
+                    m_primitiveRestartEnabled,
+                    (unsigned char)m_primitiveRestartIndex);
+            break;
+        case GL_SHORT:
+        case GL_UNSIGNED_SHORT:
+            GLUtils::shiftIndicesExcept(
+                    (unsigned short *)src,
+                    (unsigned short *)adjustedIndices,
+                    count, -minIndex,
+                    m_primitiveRestartEnabled,
+                    (unsigned short)m_primitiveRestartIndex);
+            break;
+        case GL_INT:
+        case GL_UNSIGNED_INT:
+            GLUtils::shiftIndicesExcept(
+                    (unsigned int *)src,
+                    (unsigned int *)adjustedIndices,
+                    count, -minIndex,
+                    m_primitiveRestartEnabled,
+                    (unsigned int)m_primitiveRestartIndex);
+            break;
+        default:
+            ALOGE("unsupported index buffer type %d\n", type);
+        }
+    }
+
+    return adjustedIndices;
+}
+
+void GL2Encoder::getBufferIndexRange(BufferData* buf,
+                                     const void* dataWithOffset,
+                                     GLenum type,
+                                     size_t count,
+                                     size_t offset,
+                                     int* minIndex_out,
+                                     int* maxIndex_out) {
+
+    if (buf->m_indexRangeCache.findRange(
+                type, offset, count,
+                m_primitiveRestartEnabled,
+                minIndex_out,
+                maxIndex_out)) {
+        return;
+    }
+
+    calcIndexRange(dataWithOffset, type, count, minIndex_out, maxIndex_out);
+
+    buf->m_indexRangeCache.addRange(
+            type, offset, count, m_primitiveRestartEnabled,
+            *minIndex_out, *maxIndex_out);
+
+    ALOGV("%s: got range [%u %u] pr? %d", __FUNCTION__, *minIndex_out, *maxIndex_out, m_primitiveRestartEnabled);
+}
+
+// For detecting legacy usage of glVertexAttribPointer
+void GL2Encoder::getVBOUsage(bool* hasClientArrays, bool* hasVBOs) const {
+    if (hasClientArrays) *hasClientArrays = false;
+    if (hasVBOs) *hasVBOs = false;
+
+    m_state->getVBOUsage(hasClientArrays, hasVBOs);
+}
+
+void GL2Encoder::sendVertexAttributes(GLint first, GLsizei count, bool hasClientArrays, GLsizei primcount)
+{
+    assert(m_state);
+
+    m_state->updateEnableDirtyArrayForDraw();
+
+    GLuint lastBoundVbo = m_state->currentArrayVbo();
+    const GLClientState::VAOState& vaoState = m_state->currentVaoState();
+
+    for (int k = 0; k < vaoState.numAttributesNeedingUpdateForDraw; k++) {
+        int i = vaoState.attributesNeedingUpdateForDraw[k];
+
+        const GLClientState::VertexAttribState& state = vaoState.attribState[i];
+
+        if (state.enabled) {
+            const GLClientState::BufferBinding& curr_binding = m_state->getCurrAttributeBindingInfo(i);
+            GLuint bufferObject = curr_binding.buffer;
+            if (hasClientArrays && lastBoundVbo != bufferObject) {
+                doBindBufferEncodeCached(GL_ARRAY_BUFFER, bufferObject);
+                lastBoundVbo = bufferObject;
+            }
+
+            int divisor = curr_binding.divisor;
+            int stride = curr_binding.stride;
+            int effectiveStride = curr_binding.effectiveStride;
+            uintptr_t offset = curr_binding.offset;
+
+            int firstIndex = effectiveStride * first;
+            if (firstIndex && divisor && !primcount) {
+                // If firstIndex != 0 according to effectiveStride * first,
+                // it needs to be adjusted if a divisor has been specified,
+                // even if we are not in glDraw***Instanced.
+                firstIndex = 0;
+            }
+
+            if (bufferObject == 0) {
+                unsigned int datalen = state.elementSize * count;
+                if (divisor) {
+                    ALOGV("%s: divisor for att %d: %d, w/ stride %d (effective stride %d) size %d type 0x%x) datalen %u",
+                            __FUNCTION__, i, divisor, state.stride, effectiveStride, state.elementSize, state.type, datalen);
+                    int actual_count = std::max(1, (int)((primcount + divisor - 1) / divisor));
+                    datalen = state.elementSize * actual_count;
+                    ALOGV("%s: actual datalen %u", __FUNCTION__, datalen);
+                }
+                if (state.elementSize == 0) {
+                    // The vertex attribute array is uninitialized. Abandon it.
+                    this->m_glDisableVertexAttribArray_enc(this, i);
+                    continue;
+                }
+                m_glEnableVertexAttribArray_enc(this, i);
+
+                if (datalen && (!offset || !((unsigned char*)offset + firstIndex))) {
+                    continue;
+                }
+
+                unsigned char* data = (unsigned char*)offset + firstIndex;
+                if (!m_state->isAttribIndexUsedByProgram(i)) {
+                    continue;
+                }
+
+                if (state.isInt) {
+                    this->glVertexAttribIPointerDataAEMU(this, i, state.size, state.type, stride, data, datalen);
+                } else {
+                    this->glVertexAttribPointerData(this, i, state.size, state.type, state.normalized, stride, data, datalen);
+                }
+            } else {
+                const BufferData* buf = m_shared->getBufferData(bufferObject);
+                // The following expression actually means bufLen = stride*count;
+                // But the last element doesn't have to fill up the whole stride.
+                // So it becomes the current form.
+                unsigned int bufLen = effectiveStride * (count ? (count - 1) : 0) + state.elementSize;
+                if (divisor) {
+                    int actual_count = std::max(1, (int)((primcount + divisor - 1) / divisor));
+                    bufLen = effectiveStride * (actual_count ? (actual_count - 1) : 0) + state.elementSize;
+                }
+                if (buf && firstIndex >= 0 && firstIndex + bufLen <= buf->m_size) {
+                    if (hasClientArrays) {
+                        m_glEnableVertexAttribArray_enc(this, i);
+                        if (firstIndex) {
+                            if (state.isInt) {
+                                this->glVertexAttribIPointerOffsetAEMU(this, i, state.size, state.type, stride, offset + firstIndex);
+                            } else {
+                                this->glVertexAttribPointerOffset(this, i, state.size, state.type, state.normalized, stride, offset + firstIndex);
+                            }
+                        }
+                    }
+                } else {
+                    if (m_state->isAttribIndexUsedByProgram(i)) {
+                        ALOGE("a vertex attribute index out of boundary is detected. Skipping corresponding vertex attribute. buf=%p", buf);
+                        if (buf) {
+                            ALOGE("Out of bounds vertex attribute info: "
+                                    "clientArray? %d attribute %d vbo %u allocedBufferSize %u bufferDataSpecified? %d wantedStart %u wantedEnd %u",
+                                    hasClientArrays, i, bufferObject, (unsigned int)buf->m_size, buf != NULL, firstIndex, firstIndex + bufLen);
+                        }
+                        m_glDisableVertexAttribArray_enc(this, i);
+                    }
+                }
+            }
+        } else {
+            if (hasClientArrays) {
+                this->m_glDisableVertexAttribArray_enc(this, i);
+            }
+        }
+    }
+
+    if (hasClientArrays && lastBoundVbo != m_state->currentArrayVbo()) {
+        doBindBufferEncodeCached(GL_ARRAY_BUFFER, m_state->currentArrayVbo());
+    }
+}
+
+void GL2Encoder::flushDrawCall() {
+    if (m_drawCallFlushCount % m_drawCallFlushInterval == 0) {
+        m_stream->flush();
+    }
+    m_drawCallFlushCount++;
+}
+
+static bool isValidDrawMode(GLenum mode)
+{
+    bool retval = false;
+    switch (mode) {
+    case GL_POINTS:
+    case GL_LINE_STRIP:
+    case GL_LINE_LOOP:
+    case GL_LINES:
+    case GL_TRIANGLE_STRIP:
+    case GL_TRIANGLE_FAN:
+    case GL_TRIANGLES:
+        retval = true;
+    }
+    return retval;
+}
+
+void GL2Encoder::s_glDrawArrays(void *self, GLenum mode, GLint first, GLsizei count)
+{
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    assert(ctx->m_state != NULL);
+    SET_ERROR_IF(!isValidDrawMode(mode), GL_INVALID_ENUM);
+    SET_ERROR_IF(count < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(ctx->m_state->checkFramebufferCompleteness(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE, GL_INVALID_FRAMEBUFFER_OPERATION);
+
+    bool has_client_vertex_arrays = false;
+    bool has_indirect_arrays = false;
+    ctx->getVBOUsage(&has_client_vertex_arrays,
+                     &has_indirect_arrays);
+
+    if (has_client_vertex_arrays ||
+        (!has_client_vertex_arrays &&
+         !has_indirect_arrays)) {
+        ctx->sendVertexAttributes(first, count, true);
+        ctx->m_glDrawArrays_enc(ctx, mode, 0, count);
+    } else {
+        ctx->m_glDrawArrays_enc(ctx, mode, first, count);
+    }
+
+    ctx->m_state->postDraw();
+}
+
+
+void GL2Encoder::s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum type, const void *indices)
+{
+
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    assert(ctx->m_state != NULL);
+    SET_ERROR_IF(!isValidDrawMode(mode), GL_INVALID_ENUM);
+    SET_ERROR_IF(count < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(!(type == GL_UNSIGNED_BYTE || type == GL_UNSIGNED_SHORT || type == GL_UNSIGNED_INT), GL_INVALID_ENUM);
+    SET_ERROR_IF(ctx->m_state->getTransformFeedbackActiveUnpaused(), GL_INVALID_OPERATION);
+    SET_ERROR_IF(ctx->m_state->checkFramebufferCompleteness(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE, GL_INVALID_FRAMEBUFFER_OPERATION);
+
+    bool has_client_vertex_arrays = false;
+    bool has_indirect_arrays = false;
+    GLintptr offset = 0;
+
+    ctx->getVBOUsage(&has_client_vertex_arrays, &has_indirect_arrays);
+
+    if (!has_client_vertex_arrays && !has_indirect_arrays) {
+        // ALOGW("glDrawElements: no vertex arrays / buffers bound to the command\n");
+        GLenum status = ctx->glCheckFramebufferStatus(self, GL_FRAMEBUFFER);
+        SET_ERROR_IF(status != GL_FRAMEBUFFER_COMPLETE, GL_INVALID_FRAMEBUFFER_OPERATION);
+    }
+
+    BufferData* buf = NULL;
+    int minIndex = 0, maxIndex = 0;
+
+    // For validation/immediate index array purposes,
+    // we need the min/max vertex index of the index array.
+    // If the VBO != 0, this may not be the first time we have
+    // used this particular index buffer. getBufferIndexRange
+    // can more quickly get min/max vertex index by
+    // caching previous results.
+    if (ctx->m_state->currentIndexVbo() != 0) {
+        buf = ctx->m_shared->getBufferData(ctx->m_state->currentIndexVbo());
+        offset = (GLintptr)indices;
+        indices = &buf->m_fixedBuffer[offset];
+        ctx->getBufferIndexRange(buf,
+                                 indices,
+                                 type,
+                                 (size_t)count,
+                                 (size_t)offset,
+                                 &minIndex, &maxIndex);
+    } else {
+        // In this case, the |indices| field holds a real
+        // array, so calculate the indices now. They will
+        // also be needed to know how much data to
+        // transfer to host.
+        ctx->calcIndexRange(indices,
+                            type,
+                            count,
+                            &minIndex,
+                            &maxIndex);
+    }
+
+    if (count == 0) return;
+
+    bool adjustIndices = true;
+    if (ctx->m_state->currentIndexVbo() != 0) {
+        if (!has_client_vertex_arrays) {
+            ctx->doBindBufferEncodeCached(GL_ELEMENT_ARRAY_BUFFER, ctx->m_state->currentIndexVbo());
+            ctx->glDrawElementsOffset(ctx, mode, count, type, offset);
+            ctx->flushDrawCall();
+            adjustIndices = false;
+        } else {
+            ctx->doBindBufferEncodeCached(GL_ELEMENT_ARRAY_BUFFER, 0);
+        }
+    }
+    if (adjustIndices) {
+        void *adjustedIndices =
+            ctx->recenterIndices(indices,
+                                 type,
+                                 count,
+                                 minIndex);
+
+        if (has_indirect_arrays || 1) {
+            ctx->sendVertexAttributes(minIndex, maxIndex - minIndex + 1, true);
+            ctx->glDrawElementsData(ctx, mode, count, type, adjustedIndices,
+                                    count * glSizeof(type));
+            // XXX - OPTIMIZATION (see the other else branch) should be implemented
+            if(!has_indirect_arrays) {
+                //ALOGD("unoptimized drawelements !!!\n");
+            }
+        } else {
+            // we are all direct arrays and immidate mode index array -
+            // rebuild the arrays and the index array;
+            ALOGE("glDrawElements: direct index & direct buffer data - will be implemented in later versions;\n");
+        }
+    }
+
+    ctx->m_state->postDraw();
+}
+
+void GL2Encoder::s_glDrawArraysNullAEMU(void *self, GLenum mode, GLint first, GLsizei count)
+{
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    assert(ctx->m_state != NULL);
+    SET_ERROR_IF(!isValidDrawMode(mode), GL_INVALID_ENUM);
+    SET_ERROR_IF(count < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(ctx->m_state->checkFramebufferCompleteness(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE, GL_INVALID_FRAMEBUFFER_OPERATION);
+
+    bool has_client_vertex_arrays = false;
+    bool has_indirect_arrays = false;
+    ctx->getVBOUsage(&has_client_vertex_arrays,
+                     &has_indirect_arrays);
+
+    if (has_client_vertex_arrays ||
+        (!has_client_vertex_arrays &&
+         !has_indirect_arrays)) {
+        ctx->sendVertexAttributes(first, count, true);
+        ctx->m_glDrawArraysNullAEMU_enc(ctx, mode, 0, count);
+    } else {
+        ctx->m_glDrawArraysNullAEMU_enc(ctx, mode, first, count);
+    }
+    ctx->flushDrawCall();
+    ctx->m_state->postDraw();
+}
+
+void GL2Encoder::s_glDrawElementsNullAEMU(void *self, GLenum mode, GLsizei count, GLenum type, const void *indices)
+{
+
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    assert(ctx->m_state != NULL);
+    SET_ERROR_IF(!isValidDrawMode(mode), GL_INVALID_ENUM);
+    SET_ERROR_IF(count < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(!(type == GL_UNSIGNED_BYTE || type == GL_UNSIGNED_SHORT || type == GL_UNSIGNED_INT), GL_INVALID_ENUM);
+    SET_ERROR_IF(ctx->m_state->getTransformFeedbackActiveUnpaused(), GL_INVALID_OPERATION);
+    SET_ERROR_IF(ctx->m_state->checkFramebufferCompleteness(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE, GL_INVALID_FRAMEBUFFER_OPERATION);
+
+    bool has_client_vertex_arrays = false;
+    bool has_indirect_arrays = false;
+    GLintptr offset = (GLintptr)indices;
+
+    ctx->getVBOUsage(&has_client_vertex_arrays, &has_indirect_arrays);
+
+    if (!has_client_vertex_arrays && !has_indirect_arrays) {
+        // ALOGW("glDrawElements: no vertex arrays / buffers bound to the command\n");
+        GLenum status = ctx->glCheckFramebufferStatus(self, GL_FRAMEBUFFER);
+        SET_ERROR_IF(status != GL_FRAMEBUFFER_COMPLETE, GL_INVALID_FRAMEBUFFER_OPERATION);
+    }
+
+    BufferData* buf = NULL;
+    int minIndex = 0, maxIndex = 0;
+
+    // For validation/immediate index array purposes,
+    // we need the min/max vertex index of the index array.
+    // If the VBO != 0, this may not be the first time we have
+    // used this particular index buffer. getBufferIndexRange
+    // can more quickly get min/max vertex index by
+    // caching previous results.
+    if (ctx->m_state->currentIndexVbo() != 0) {
+        if (!has_client_vertex_arrays && has_indirect_arrays) {
+            // Don't do anything
+        } else {
+            buf = ctx->m_shared->getBufferData(ctx->m_state->currentIndexVbo());
+            offset = (GLintptr)indices;
+            indices = &buf->m_fixedBuffer[offset];
+            ctx->getBufferIndexRange(buf,
+                                     indices,
+                                     type,
+                                     (size_t)count,
+                                     (size_t)offset,
+                                     &minIndex, &maxIndex);
+        }
+    } else {
+        // In this case, the |indices| field holds a real
+        // array, so calculate the indices now. They will
+        // also be needed to know how much data to
+        // transfer to host.
+        ctx->calcIndexRange(indices,
+                            type,
+                            count,
+                            &minIndex,
+                            &maxIndex);
+    }
+
+    if (count == 0) return;
+
+    bool adjustIndices = true;
+    if (ctx->m_state->currentIndexVbo() != 0) {
+        if (!has_client_vertex_arrays) {
+            ctx->doBindBufferEncodeCached(GL_ELEMENT_ARRAY_BUFFER, ctx->m_state->currentIndexVbo());
+            ctx->glDrawElementsOffsetNullAEMU(ctx, mode, count, type, offset);
+            ctx->flushDrawCall();
+            adjustIndices = false;
+        } else {
+            ctx->m_glBindBuffer_enc(self, GL_ELEMENT_ARRAY_BUFFER, 0);
+        }
+    }
+    if (adjustIndices) {
+        void *adjustedIndices =
+            ctx->recenterIndices(indices,
+                                 type,
+                                 count,
+                                 minIndex);
+
+        if (has_indirect_arrays || 1) {
+            ctx->sendVertexAttributes(minIndex, maxIndex - minIndex + 1, true);
+            ctx->glDrawElementsDataNullAEMU(ctx, mode, count, type, adjustedIndices,
+                                    count * glSizeof(type));
+            // XXX - OPTIMIZATION (see the other else branch) should be implemented
+            if(!has_indirect_arrays) {
+                //ALOGD("unoptimized drawelements !!!\n");
+            }
+        } else {
+            // we are all direct arrays and immidate mode index array -
+            // rebuild the arrays and the index array;
+            ALOGE("glDrawElementsNullAEMU: direct index & direct buffer data - will be implemented in later versions;\n");
+        }
+    }
+    ctx->m_state->postDraw();
+}
+
+GLint * GL2Encoder::getCompressedTextureFormats()
+{
+    if (m_compressedTextureFormats == NULL) {
+        this->glGetIntegerv(this, GL_NUM_COMPRESSED_TEXTURE_FORMATS,
+                            &m_num_compressedTextureFormats);
+        if (m_num_compressedTextureFormats > 0) {
+            // get number of texture formats;
+            m_compressedTextureFormats = new GLint[m_num_compressedTextureFormats];
+            this->glGetCompressedTextureFormats(this, m_num_compressedTextureFormats, m_compressedTextureFormats);
+        }
+    }
+    return m_compressedTextureFormats;
+}
+
+// Replace uses of samplerExternalOES with sampler2D, recording the names of
+// modified shaders in data. Also remove
+//   #extension GL_OES_EGL_image_external : require
+//   #extension GL_OES_EGL_image_external_essl3 : require
+// statements.
+//
+// This implementation assumes the input has already been pre-processed. If not,
+// a few cases will be mishandled:
+//
+// 1. "mySampler" will be incorrectly recorded as being a samplerExternalOES in
+//    the following code:
+//      #if 1
+//      uniform sampler2D mySampler;
+//      #else
+//      uniform samplerExternalOES mySampler;
+//      #endif
+//
+// 2. Comments that look like sampler declarations will be incorrectly modified
+//    and recorded:
+//      // samplerExternalOES hahaFooledYou
+//
+// 3. However, GLSL ES does not have a concatentation operator, so things like
+//    this (valid in C) are invalid and not a problem:
+//      #define SAMPLER(TYPE, NAME) uniform sampler#TYPE NAME
+//      SAMPLER(ExternalOES, mySampler);
+//
+
+static const char STR_SAMPLER_EXTERNAL_OES[] = "samplerExternalOES";
+static const char STR_SAMPLER2D_SPACE[]      = "sampler2D         ";
+static const char STR_DEFINE[] = "#define";
+
+static std::vector<std::string> getSamplerExternalAliases(char* str) {
+    std::vector<std::string> res;
+
+    res.push_back(STR_SAMPLER_EXTERNAL_OES);
+
+    // -- capture #define x samplerExternalOES
+    char* c = str;
+    while ((c = strstr(c, STR_DEFINE))) {
+        // Don't push it if samplerExternalOES is not even there.
+        char* samplerExternalOES_next = strstr(c, STR_SAMPLER_EXTERNAL_OES);
+        if (!samplerExternalOES_next) break;
+
+        bool prevIdent = false;
+
+        std::vector<std::string> idents;
+        std::string curr;
+
+        while (*c != '\0') {
+
+            if (isspace(*c)) {
+                if (prevIdent) {
+                    idents.push_back(curr);
+                    curr = "";
+                }
+            }
+
+            if (*c == '\n' || idents.size() == 3) break;
+
+            if (isalpha(*c) || *c == '_') {
+                curr.push_back(*c);
+                prevIdent = true;
+            }
+
+            ++c;
+        }
+
+        if (idents.size() != 3) continue;
+
+        const std::string& defineLhs = idents[1];
+        const std::string& defineRhs = idents[2];
+
+        if (defineRhs == STR_SAMPLER_EXTERNAL_OES) {
+            res.push_back(defineLhs);
+        }
+
+        if (*c == '\0') break;
+    }
+
+    return res;
+}
+
+static bool replaceExternalSamplerUniformDefinition(char* str, const std::string& samplerExternalType, ShaderData* data) {
+    // -- replace "samplerExternalOES" with "sampler2D" and record name
+    char* c = str;
+    while ((c = strstr(c, samplerExternalType.c_str()))) {
+        // Make sure "samplerExternalOES" isn't a substring of a larger token
+        if (c == str || !isspace(*(c-1))) {
+            c++;
+            continue;
+        }
+        char* sampler_start = c;
+        c += samplerExternalType.size();
+        if (!isspace(*c) && *c != '\0' && *c != ';') {
+            continue;
+        } else {
+            // capture sampler name
+            while (isspace(*c) && *c != '\0') {
+                c++;
+            }
+        }
+
+        if ((!isalpha(*c) && *c != '_') || *c == ';') {
+            // not an identifier, but might have some effect anyway.
+            if (samplerExternalType == STR_SAMPLER_EXTERNAL_OES) {
+                memcpy(sampler_start, STR_SAMPLER2D_SPACE, sizeof(STR_SAMPLER2D_SPACE)-1);
+            }
+        } else {
+            char* name_start = c;
+            do {
+                c++;
+            } while (isalnum(*c) || *c == '_');
+
+            size_t len = (size_t)(c - name_start);
+            if (len) {
+                data->samplerExternalNames.push_back(
+                        std::string(name_start, len));
+            }
+
+            // We only need to perform a string replacement for the original
+            // occurrence of samplerExternalOES if a #define was used.
+            //
+            // The important part was to record the name in
+            // |data->samplerExternalNames|.
+            if (samplerExternalType == STR_SAMPLER_EXTERNAL_OES) {
+                memcpy(sampler_start, STR_SAMPLER2D_SPACE, sizeof(STR_SAMPLER2D_SPACE)-1);
+            }
+        }
+    }
+
+    return true;
+}
+
+static bool replaceSamplerExternalWith2D(char* const str, ShaderData* const data)
+{
+    static const char STR_HASH_EXTENSION[] = "#extension";
+    static const char STR_GL_OES_EGL_IMAGE_EXTERNAL[] = "GL_OES_EGL_image_external";
+    static const char STR_GL_OES_EGL_IMAGE_EXTERNAL_ESSL3[] = "GL_OES_EGL_image_external_essl3";
+
+    // -- overwrite all "#extension GL_OES_EGL_image_external : xxx" statements
+    char* c = str;
+    while ((c = strstr(c, STR_HASH_EXTENSION))) {
+        char* start = c;
+        c += sizeof(STR_HASH_EXTENSION)-1;
+        while (isspace(*c) && *c != '\0') {
+            c++;
+        }
+
+        bool hasBaseImageExternal =
+            !strncmp(c, STR_GL_OES_EGL_IMAGE_EXTERNAL,
+                     sizeof(STR_GL_OES_EGL_IMAGE_EXTERNAL) - 1);
+        bool hasEssl3ImageExternal =
+            !strncmp(c, STR_GL_OES_EGL_IMAGE_EXTERNAL_ESSL3,
+                     sizeof(STR_GL_OES_EGL_IMAGE_EXTERNAL_ESSL3) - 1);
+
+        if (hasBaseImageExternal || hasEssl3ImageExternal)
+        {
+            // #extension statements are terminated by end of line
+            c = start;
+            while (*c != '\0' && *c != '\r' && *c != '\n') {
+                *c++ = ' ';
+            }
+        }
+    }
+
+    std::vector<std::string> samplerExternalAliases =
+        getSamplerExternalAliases(str);
+
+    for (size_t i = 0; i < samplerExternalAliases.size(); i++) {
+        if (!replaceExternalSamplerUniformDefinition(
+                str, samplerExternalAliases[i], data))
+            return false;
+    }
+
+    return true;
+}
+
+void GL2Encoder::s_glShaderBinary(void *self, GLsizei, const GLuint *, GLenum, const void*, GLsizei)
+{
+    // Although it is not supported, need to set proper error code.
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(1, GL_INVALID_ENUM);
+}
+
+void GL2Encoder::s_glShaderSource(void *self, GLuint shader, GLsizei count, const GLchar * const *string, const GLint *length)
+{
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    ShaderData* shaderData = ctx->m_shared->getShaderData(shader);
+    SET_ERROR_IF(!ctx->m_shared->isShaderOrProgramObject(shader), GL_INVALID_VALUE);
+    SET_ERROR_IF(!shaderData, GL_INVALID_OPERATION);
+    SET_ERROR_IF((count<0), GL_INVALID_VALUE);
+
+    // Track original sources---they may be translated in the backend
+    std::vector<std::string> orig_sources;
+    if (length) {
+        for (int i = 0; i < count; i++) {
+            // Each element in the length array may contain the length of the corresponding
+            // string (the null character is not counted as part of the string length) or a
+            // value less than 0 to indicate that the string is null terminated.
+            if (length[i] >= 0) {
+                orig_sources.push_back(std::string((const char*)(string[i]),
+                                                   (const char*)(string[i]) + length[i]));
+            } else {
+                orig_sources.push_back(std::string((const char*)(string[i])));
+            }
+        }
+    } else {
+        for (int i = 0; i < count; i++) {
+            orig_sources.push_back(std::string((const char*)(string[i])));
+        }
+    }
+    shaderData->sources = orig_sources;
+
+    int len = glUtilsCalcShaderSourceLen((char**)string, (GLint*)length, count);
+    char *str = new char[len + 1];
+    glUtilsPackStrings(str, (char**)string, (GLint*)length, count);
+
+    // TODO: pre-process str before calling replaceSamplerExternalWith2D().
+    // Perhaps we can borrow Mesa's pre-processor?
+
+    if (!replaceSamplerExternalWith2D(str, shaderData)) {
+        delete[] str;
+        ctx->setError(GL_OUT_OF_MEMORY);
+        return;
+    }
+    ctx->glShaderString(ctx, shader, str, len + 1);
+    delete[] str;
+}
+
+void GL2Encoder::s_glFinish(void *self)
+{
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    ctx->glFinishRoundTrip(self);
+}
+
+void GL2Encoder::s_glLinkProgram(void * self, GLuint program)
+{
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    bool isProgram = ctx->m_shared->isProgram(program);
+    SET_ERROR_IF(!isProgram && !ctx->m_shared->isShader(program), GL_INVALID_VALUE);
+    SET_ERROR_IF(!isProgram, GL_INVALID_OPERATION);
+
+    if (program == ctx->m_state->currentProgram() ||
+        (!ctx->m_state->currentProgram() &&
+         (program == ctx->m_state->currentShaderProgram()))) {
+        SET_ERROR_IF(ctx->m_state->getTransformFeedbackActive(), GL_INVALID_OPERATION);
+    }
+
+    ctx->m_glLinkProgram_enc(self, program);
+
+    GLint linkStatus = 0;
+    ctx->m_glGetProgramiv_enc(self, program, GL_LINK_STATUS, &linkStatus);
+    ctx->m_shared->setProgramLinkStatus(program, linkStatus);
+    if (!linkStatus) {
+        return;
+    }
+
+    // get number of active uniforms and attributes in the program
+    GLint numUniforms=0;
+    GLint numAttributes=0;
+    ctx->m_glGetProgramiv_enc(self, program, GL_ACTIVE_UNIFORMS, &numUniforms);
+    ctx->m_glGetProgramiv_enc(self, program, GL_ACTIVE_ATTRIBUTES, &numAttributes);
+    ctx->m_shared->initProgramData(program,numUniforms,numAttributes);
+
+    //get the length of the longest uniform name
+    GLint maxLength=0;
+    GLint maxAttribLength=0;
+    ctx->m_glGetProgramiv_enc(self, program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &maxLength);
+    ctx->m_glGetProgramiv_enc(self, program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &maxAttribLength);
+
+    GLint size;
+    GLenum type;
+    size_t bufLen = maxLength > maxAttribLength ? maxLength : maxAttribLength;
+    GLchar *name = new GLchar[bufLen + 1];
+    GLint location;
+    //for each active uniform, get its size and starting location.
+    for (GLint i=0 ; i<numUniforms ; ++i)
+    {
+        ctx->m_glGetActiveUniform_enc(self, program, i, maxLength, NULL, &size, &type, name);
+        location = ctx->m_glGetUniformLocation_enc(self, program, name);
+        ctx->m_shared->setProgramIndexInfo(program, i, location, size, type, name);
+    }
+
+    for (GLint i = 0; i < numAttributes; ++i) {
+        ctx->m_glGetActiveAttrib_enc(self, program, i, maxAttribLength,  NULL, &size, &type, name);
+        location = ctx->m_glGetAttribLocation_enc(self, program, name);
+        ctx->m_shared->setProgramAttribInfo(program, i, location, size, type, name);
+    }
+
+    if (ctx->majorVersion() > 2) {
+        GLint numBlocks;
+        ctx->m_glGetProgramiv_enc(ctx, program, GL_ACTIVE_UNIFORM_BLOCKS, &numBlocks);
+        ctx->m_shared->setActiveUniformBlockCountForProgram(program, numBlocks);
+
+        GLint tfVaryingsCount;
+        ctx->m_glGetProgramiv_enc(ctx, program, GL_TRANSFORM_FEEDBACK_VARYINGS, &tfVaryingsCount);
+        ctx->m_shared->setTransformFeedbackVaryingsCountForProgram(program, tfVaryingsCount);
+    }
+
+    delete[] name;
+}
+
+#define VALIDATE_PROGRAM_NAME(program) \
+    bool isShaderOrProgramObject = \
+        ctx->m_shared->isShaderOrProgramObject(program); \
+    bool isProgram = \
+        ctx->m_shared->isProgram(program); \
+    SET_ERROR_IF(!isShaderOrProgramObject, GL_INVALID_VALUE); \
+    SET_ERROR_IF(!isProgram, GL_INVALID_OPERATION); \
+
+#define VALIDATE_PROGRAM_NAME_RET(program, ret) \
+    bool isShaderOrProgramObject = \
+        ctx->m_shared->isShaderOrProgramObject(program); \
+    bool isProgram = \
+        ctx->m_shared->isProgram(program); \
+    RET_AND_SET_ERROR_IF(!isShaderOrProgramObject, GL_INVALID_VALUE, ret); \
+    RET_AND_SET_ERROR_IF(!isProgram, GL_INVALID_OPERATION, ret); \
+
+#define VALIDATE_SHADER_NAME(shader) \
+    bool isShaderOrProgramObject = \
+        ctx->m_shared->isShaderOrProgramObject(shader); \
+    bool isShader = \
+        ctx->m_shared->isShader(shader); \
+    SET_ERROR_IF(!isShaderOrProgramObject, GL_INVALID_VALUE); \
+    SET_ERROR_IF(!isShader, GL_INVALID_OPERATION); \
+
+void GL2Encoder::s_glDeleteProgram(void *self, GLuint program)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+
+    VALIDATE_PROGRAM_NAME(program);
+
+    ctx->m_glDeleteProgram_enc(self, program);
+
+    ctx->m_shared->deleteProgramData(program);
+}
+
+void GL2Encoder::s_glGetUniformiv(void *self, GLuint program, GLint location, GLint* params)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(!ctx->m_shared->isShaderOrProgramObject(program), GL_INVALID_VALUE);
+    SET_ERROR_IF(!ctx->m_shared->isProgram(program), GL_INVALID_OPERATION);
+    SET_ERROR_IF(!ctx->m_shared->isProgramInitialized(program), GL_INVALID_OPERATION);
+    SET_ERROR_IF(ctx->m_shared->getProgramUniformType(program,location)==0, GL_INVALID_OPERATION);
+    SET_ERROR_IF(!ctx->m_shared->isProgramUniformLocationValid(program,location), GL_INVALID_OPERATION);
+    ctx->m_glGetUniformiv_enc(self, program, location, params);
+}
+void GL2Encoder::s_glGetUniformfv(void *self, GLuint program, GLint location, GLfloat* params)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(!ctx->m_shared->isShaderOrProgramObject(program), GL_INVALID_VALUE);
+    SET_ERROR_IF(!ctx->m_shared->isProgram(program), GL_INVALID_OPERATION);
+    SET_ERROR_IF(!ctx->m_shared->isProgramInitialized(program), GL_INVALID_OPERATION);
+    SET_ERROR_IF(ctx->m_shared->getProgramUniformType(program,location)==0, GL_INVALID_OPERATION);
+    SET_ERROR_IF(!ctx->m_shared->isProgramUniformLocationValid(program,location), GL_INVALID_OPERATION);
+    ctx->m_glGetUniformfv_enc(self, program, location, params);
+}
+
+GLuint GL2Encoder::s_glCreateProgram(void * self)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    GLuint program = ctx->m_glCreateProgram_enc(self);
+    if (program!=0)
+        ctx->m_shared->addProgramData(program);
+    return program;
+}
+
+GLuint GL2Encoder::s_glCreateShader(void *self, GLenum shaderType)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    RET_AND_SET_ERROR_IF(!GLESv2Validation::shaderType(ctx, shaderType), GL_INVALID_ENUM, 0);
+    GLuint shader = ctx->m_glCreateShader_enc(self, shaderType);
+    if (shader != 0) {
+        if (!ctx->m_shared->addShaderData(shader, shaderType)) {
+            ctx->m_glDeleteShader_enc(self, shader);
+            return 0;
+        }
+    }
+    return shader;
+}
+
+void GL2Encoder::s_glGetAttachedShaders(void *self, GLuint program, GLsizei maxCount,
+        GLsizei* count, GLuint* shaders)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    VALIDATE_PROGRAM_NAME(program);
+    SET_ERROR_IF(maxCount < 0, GL_INVALID_VALUE);
+    ctx->m_glGetAttachedShaders_enc(self, program, maxCount, count, shaders);
+}
+
+void GL2Encoder::s_glGetShaderSource(void *self, GLuint shader, GLsizei bufsize,
+            GLsizei* length, GLchar* source)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    VALIDATE_SHADER_NAME(shader);
+    SET_ERROR_IF(bufsize < 0, GL_INVALID_VALUE);
+    ctx->m_glGetShaderSource_enc(self, shader, bufsize, length, source);
+    ShaderData* shaderData = ctx->m_shared->getShaderData(shader);
+    if (shaderData) {
+        std::string returned;
+        int curr_len = 0;
+        for (int i = 0; i < shaderData->sources.size(); i++) {
+            if (curr_len + shaderData->sources[i].size() < bufsize - 1) {
+                returned += shaderData->sources[i];
+            } else {
+                returned += shaderData->sources[i].substr(0, bufsize - 1 - curr_len);
+                break;
+            }
+        }
+        std::string ret = returned.substr(0, bufsize - 1);
+
+        size_t toCopy = bufsize < (ret.size() + 1) ? bufsize : ret.size() + 1;
+        memcpy(source, ret.c_str(), toCopy);
+    }
+}
+
+void GL2Encoder::s_glGetShaderInfoLog(void *self, GLuint shader, GLsizei bufsize,
+        GLsizei* length, GLchar* infolog)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    VALIDATE_SHADER_NAME(shader);
+    SET_ERROR_IF(bufsize < 0, GL_INVALID_VALUE);
+    ctx->m_glGetShaderInfoLog_enc(self, shader, bufsize, length, infolog);
+}
+
+void GL2Encoder::s_glGetProgramInfoLog(void *self, GLuint program, GLsizei bufsize,
+        GLsizei* length, GLchar* infolog)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    VALIDATE_PROGRAM_NAME(program);
+    SET_ERROR_IF(bufsize < 0, GL_INVALID_VALUE);
+    ctx->m_glGetProgramInfoLog_enc(self, program, bufsize, length, infolog);
+}
+
+void GL2Encoder::s_glDeleteShader(void *self, GLenum shader)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+
+    bool isShaderOrProgramObject =
+        ctx->m_shared->isShaderOrProgramObject(shader);
+    bool isShader =
+        ctx->m_shared->isShader(shader);
+
+    SET_ERROR_IF(isShaderOrProgramObject && !isShader, GL_INVALID_OPERATION);
+    SET_ERROR_IF(!isShaderOrProgramObject && !isShader, GL_INVALID_VALUE);
+
+    ctx->m_glDeleteShader_enc(self,shader);
+    ctx->m_shared->unrefShaderData(shader);
+}
+
+void GL2Encoder::s_glAttachShader(void *self, GLuint program, GLuint shader)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    bool programIsShaderOrProgram = ctx->m_shared->isShaderOrProgramObject(program);
+    bool programIsProgram = ctx->m_shared->isProgram(program);
+    bool shaderIsShaderOrProgram = ctx->m_shared->isShaderOrProgramObject(shader);
+    bool shaderIsShader = ctx->m_shared->isShader(shader);
+
+    SET_ERROR_IF(!programIsShaderOrProgram, GL_INVALID_VALUE);
+    SET_ERROR_IF(!shaderIsShaderOrProgram, GL_INVALID_VALUE);
+    SET_ERROR_IF(!programIsProgram, GL_INVALID_OPERATION);
+    SET_ERROR_IF(!shaderIsShader, GL_INVALID_OPERATION);
+    SET_ERROR_IF(!ctx->m_shared->attachShader(program, shader), GL_INVALID_OPERATION);
+
+    ctx->m_glAttachShader_enc(self, program, shader);
+}
+
+void GL2Encoder::s_glDetachShader(void *self, GLuint program, GLuint shader)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+
+    bool programIsShaderOrProgram = ctx->m_shared->isShaderOrProgramObject(program);
+    bool programIsProgram = ctx->m_shared->isProgram(program);
+    bool shaderIsShaderOrProgram = ctx->m_shared->isShaderOrProgramObject(shader);
+    bool shaderIsShader = ctx->m_shared->isShader(shader);
+
+    SET_ERROR_IF(!programIsShaderOrProgram, GL_INVALID_VALUE);
+    SET_ERROR_IF(!shaderIsShaderOrProgram, GL_INVALID_VALUE);
+    SET_ERROR_IF(!programIsProgram, GL_INVALID_OPERATION);
+    SET_ERROR_IF(!shaderIsShader, GL_INVALID_OPERATION);
+    SET_ERROR_IF(!ctx->m_shared->detachShader(program, shader), GL_INVALID_OPERATION);
+
+    ctx->m_glDetachShader_enc(self, program, shader);
+}
+
+int sArrIndexOfUniformExpr(const char* name, int* err) {
+    *err = 0;
+    int arrIndex = 0;
+    int namelen = strlen(name);
+    if (name[namelen-1] == ']') {
+        const char *brace = strrchr(name,'[');
+        if (!brace || sscanf(brace+1,"%d",&arrIndex) != 1) {
+            *err = 1; return 0;
+        }
+    }
+    return arrIndex;
+}
+
+int GL2Encoder::s_glGetUniformLocation(void *self, GLuint program, const GLchar *name)
+{
+    if (!name) return -1;
+    GL2Encoder *ctx = (GL2Encoder*)self;
+
+    bool isShaderOrProgramObject =
+        ctx->m_shared->isShaderOrProgramObject(program);
+    bool isProgram =
+        ctx->m_shared->isProgram(program);
+
+    RET_AND_SET_ERROR_IF(!isShaderOrProgramObject, GL_INVALID_VALUE, -1);
+    RET_AND_SET_ERROR_IF(!isProgram, GL_INVALID_OPERATION, -1);
+    RET_AND_SET_ERROR_IF(!ctx->m_shared->getProgramLinkStatus(program), GL_INVALID_OPERATION, -1);
+
+    return ctx->m_glGetUniformLocation_enc(self, program, name);
+}
+
+bool GL2Encoder::updateHostTexture2DBinding(GLenum texUnit, GLenum newTarget)
+{
+    if (newTarget != GL_TEXTURE_2D && newTarget != GL_TEXTURE_EXTERNAL_OES)
+        return false;
+
+    m_state->setActiveTextureUnit(texUnit);
+
+    GLenum oldTarget = m_state->getPriorityEnabledTarget(GL_TEXTURE_2D);
+    if (newTarget != oldTarget) {
+        if (newTarget == GL_TEXTURE_EXTERNAL_OES) {
+            m_state->disableTextureTarget(GL_TEXTURE_2D);
+            m_state->enableTextureTarget(GL_TEXTURE_EXTERNAL_OES);
+        } else {
+            m_state->disableTextureTarget(GL_TEXTURE_EXTERNAL_OES);
+            m_state->enableTextureTarget(GL_TEXTURE_2D);
+        }
+        m_glActiveTexture_enc(this, texUnit);
+        m_glBindTexture_enc(this, GL_TEXTURE_2D,
+                m_state->getBoundTexture(newTarget));
+        return true;
+    }
+
+    return false;
+}
+
+void GL2Encoder::updateHostTexture2DBindingsFromProgramData(GLuint program) {
+    GL2Encoder *ctx = this;
+    GLClientState* state = ctx->m_state;
+    GLSharedGroupPtr shared = ctx->m_shared;
+
+    GLenum origActiveTexture = state->getActiveTextureUnit();
+    GLenum hostActiveTexture = origActiveTexture;
+    GLint samplerIdx = -1;
+    GLint samplerVal;
+    GLenum samplerTarget;
+    while ((samplerIdx = shared->getNextSamplerUniform(program, samplerIdx, &samplerVal, &samplerTarget)) != -1) {
+        if (samplerVal < 0 || samplerVal >= GLClientState::MAX_TEXTURE_UNITS)
+            continue;
+        if (ctx->updateHostTexture2DBinding(GL_TEXTURE0 + samplerVal,
+                    samplerTarget))
+        {
+            hostActiveTexture = GL_TEXTURE0 + samplerVal;
+        }
+    }
+    state->setActiveTextureUnit(origActiveTexture);
+    if (hostActiveTexture != origActiveTexture) {
+        ctx->m_glActiveTexture_enc(ctx, origActiveTexture);
+    }
+}
+
+void GL2Encoder::s_glUseProgram(void *self, GLuint program)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    GLSharedGroupPtr shared = ctx->m_shared;
+
+    SET_ERROR_IF(program && !shared->isShaderOrProgramObject(program), GL_INVALID_VALUE);
+    SET_ERROR_IF(program && !shared->isProgram(program), GL_INVALID_OPERATION);
+    SET_ERROR_IF(ctx->m_state->getTransformFeedbackActiveUnpaused(), GL_INVALID_OPERATION);
+
+    ctx->m_glUseProgram_enc(self, program);
+
+    GLuint currProgram = ctx->m_state->currentProgram();
+    ctx->m_shared->onUseProgram(currProgram, program);
+
+    ctx->m_state->setCurrentProgram(program);
+    ctx->m_state->setCurrentShaderProgram(program);
+    ctx->updateHostTexture2DBindingsFromProgramData(program);
+
+    if (program) {
+        ctx->m_state->currentUniformValidationInfo = ctx->m_shared->getUniformValidationInfo(program);
+        ctx->m_state->currentAttribValidationInfo = ctx->m_shared->getAttribValidationInfo(program);
+    }
+}
+
+void GL2Encoder::s_glUniform1f(void *self , GLint location, GLfloat x)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(true /* is float? */, false /* is unsigned? */, 1 /* columns */, 1 /* rows */, location, 1 /* count */, ctx->getErrorPtr());
+    ctx->m_glUniform1f_enc(self, location, x);
+}
+
+void GL2Encoder::s_glUniform1fv(void *self , GLint location, GLsizei count, const GLfloat* v)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(true /* is float? */, false /* is unsigned? */, 1 /* columns */, 1 /* rows */, location, count /* count */, ctx->getErrorPtr());
+    ctx->m_glUniform1fv_enc(self, location, count, v);
+}
+
+void GL2Encoder::s_glUniform1i(void *self , GLint location, GLint x)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+    GLSharedGroupPtr shared = ctx->m_shared;
+
+    ctx->m_state->validateUniform(false /* is float? */, false /* is unsigned? */, 1 /* columns */, 1 /* rows */, location, 1 /* count */, ctx->getErrorPtr());
+
+    ctx->m_glUniform1i_enc(self, location, x);
+
+    GLenum target;
+    if (shared->setSamplerUniform(state->currentShaderProgram(), location, x, &target)) {
+        GLenum origActiveTexture = state->getActiveTextureUnit();
+        if (ctx->updateHostTexture2DBinding(GL_TEXTURE0 + x, target)) {
+            ctx->m_glActiveTexture_enc(self, origActiveTexture);
+        }
+        state->setActiveTextureUnit(origActiveTexture);
+    }
+}
+
+void GL2Encoder::s_glUniform1iv(void *self , GLint location, GLsizei count, const GLint* v)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(false /* is float? */, false /* is unsigned? */, 1 /* columns */, 1 /* rows */, location, count /* count */, ctx->getErrorPtr());
+    ctx->m_glUniform1iv_enc(self, location, count, v);
+}
+
+void GL2Encoder::s_glUniform2f(void *self , GLint location, GLfloat x, GLfloat y)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(true /* is float? */, false /* is unsigned? */, 2 /* columns */, 1 /* rows */, location, 1 /* count */, ctx->getErrorPtr());
+    ctx->m_glUniform2f_enc(self, location, x, y);
+}
+
+void GL2Encoder::s_glUniform2fv(void *self , GLint location, GLsizei count, const GLfloat* v)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(true /* is float? */, false /* is unsigned? */, 2 /* columns */, 1 /* rows */, location, count /* count */, ctx->getErrorPtr());
+    ctx->m_glUniform2fv_enc(self, location, count, v);
+}
+
+void GL2Encoder::s_glUniform2i(void *self , GLint location, GLint x, GLint y)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(false /* is float? */, false /* is unsigned? */, 2 /* columns */, 1 /* rows */, location, 1 /* count */, ctx->getErrorPtr());
+    ctx->m_glUniform2i_enc(self, location, x, y);
+}
+
+void GL2Encoder::s_glUniform2iv(void *self , GLint location, GLsizei count, const GLint* v)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(false /* is float? */, false /* is unsigned? */, 2 /* columns */, 1 /* rows */, location, count /* count */, ctx->getErrorPtr());
+    ctx->m_glUniform2iv_enc(self, location, count, v);
+}
+
+void GL2Encoder::s_glUniform3f(void *self , GLint location, GLfloat x, GLfloat y, GLfloat z)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(true /* is float? */, false /* is unsigned? */, 3 /* columns */, 1 /* rows */, location, 1 /* count */, ctx->getErrorPtr());
+    ctx->m_glUniform3f_enc(self, location, x, y, z);
+}
+
+void GL2Encoder::s_glUniform3fv(void *self , GLint location, GLsizei count, const GLfloat* v)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(true /* is float? */, false /* is unsigned? */, 3 /* columns */, 1 /* rows */, location, count /* count */, ctx->getErrorPtr());
+    ctx->m_glUniform3fv_enc(self, location, count, v);
+}
+
+void GL2Encoder::s_glUniform3i(void *self , GLint location, GLint x, GLint y, GLint z)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(false /* is float? */, false /* is unsigned? */, 3 /* columns */, 1 /* rows */, location, 1 /* count */, ctx->getErrorPtr());
+    ctx->m_glUniform3i_enc(self, location, x, y, z);
+}
+
+void GL2Encoder::s_glUniform3iv(void *self , GLint location, GLsizei count, const GLint* v)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(false /* is float? */, false /* is unsigned? */, 3 /* columns */, 1 /* rows */, location, count /* count */, ctx->getErrorPtr());
+    ctx->m_glUniform3iv_enc(self, location, count, v);
+}
+
+void GL2Encoder::s_glUniform4f(void *self , GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(true /* is float? */, false /* is unsigned? */, 4 /* columns */, 1 /* rows */, location, 1 /* count */, ctx->getErrorPtr());
+    ctx->m_glUniform4f_enc(self, location, x, y, z, w);
+}
+
+void GL2Encoder::s_glUniform4fv(void *self , GLint location, GLsizei count, const GLfloat* v)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(true /* is float? */, false /* is unsigned? */, 4 /* columns */, 1 /* rows */, location, count /* count */, ctx->getErrorPtr());
+    ctx->m_glUniform4fv_enc(self, location, count, v);
+}
+
+void GL2Encoder::s_glUniform4i(void *self , GLint location, GLint x, GLint y, GLint z, GLint w)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(false /* is float? */, false /* is unsigned? */, 4 /* columns */, 1 /* rows */, location, 1 /* count */, ctx->getErrorPtr());
+    ctx->m_glUniform4i_enc(self, location, x, y, z, w);
+}
+
+void GL2Encoder::s_glUniform4iv(void *self , GLint location, GLsizei count, const GLint* v)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(false /* is float? */, false /* is unsigned? */, 4 /* columns */, 1 /* rows */, location, count /* count */, ctx->getErrorPtr());
+    ctx->m_glUniform4iv_enc(self, location, count, v);
+}
+
+void GL2Encoder::s_glUniformMatrix2fv(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(true /* is float? */, false /* is unsigned? */, 2 /* columns */, 2 /* rows */, location, count /* count */, ctx->getErrorPtr());
+    ctx->m_glUniformMatrix2fv_enc(self, location, count, transpose, value);
+}
+
+void GL2Encoder::s_glUniformMatrix3fv(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(true /* is float? */, false /* is unsigned? */, 3 /* columns */, 3 /* rows */, location, count /* count */, ctx->getErrorPtr());
+    ctx->m_glUniformMatrix3fv_enc(self, location, count, transpose, value);
+}
+
+void GL2Encoder::s_glUniformMatrix4fv(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(true /* is float? */, false /* is unsigned? */, 4 /* columns */, 4 /* rows */, location, count /* count */, ctx->getErrorPtr());
+    ctx->m_glUniformMatrix4fv_enc(self, location, count, transpose, value);
+}
+
+void GL2Encoder::s_glActiveTexture(void* self, GLenum texture)
+{
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+    GLenum err;
+
+    GLint maxCombinedUnits;
+    ctx->glGetIntegerv(ctx, GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxCombinedUnits);
+
+    SET_ERROR_IF(texture - GL_TEXTURE0 > maxCombinedUnits - 1, GL_INVALID_ENUM);
+    SET_ERROR_IF((err = state->setActiveTextureUnit(texture)) != GL_NO_ERROR, err);
+
+    ctx->m_glActiveTexture_enc(ctx, texture);
+}
+
+void GL2Encoder::s_glBindTexture(void* self, GLenum target, GLuint texture)
+{
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+    GLenum err;
+    GLboolean firstUse;
+
+    SET_ERROR_IF(!GLESv2Validation::textureTarget(ctx, target), GL_INVALID_ENUM);
+    SET_ERROR_IF((err = state->bindTexture(target, texture, &firstUse)) != GL_NO_ERROR, err);
+
+    if (target != GL_TEXTURE_2D && target != GL_TEXTURE_EXTERNAL_OES) {
+        ctx->m_glBindTexture_enc(ctx, target, texture);
+        return;
+    }
+
+    GLenum priorityTarget = state->getPriorityEnabledTarget(GL_TEXTURE_2D);
+
+    if (target == GL_TEXTURE_EXTERNAL_OES && firstUse) {
+        ctx->m_glBindTexture_enc(ctx, GL_TEXTURE_2D, texture);
+        ctx->m_glTexParameteri_enc(ctx, GL_TEXTURE_2D,
+                GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+        ctx->m_glTexParameteri_enc(ctx, GL_TEXTURE_2D,
+                GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+        ctx->m_glTexParameteri_enc(ctx, GL_TEXTURE_2D,
+                GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+
+        if (target != priorityTarget) {
+            ctx->m_glBindTexture_enc(ctx, GL_TEXTURE_2D,
+                    state->getBoundTexture(GL_TEXTURE_2D));
+        }
+    }
+
+    if (target == priorityTarget) {
+        ctx->m_glBindTexture_enc(ctx, GL_TEXTURE_2D, texture);
+    }
+}
+
+void GL2Encoder::s_glDeleteTextures(void* self, GLsizei n, const GLuint* textures)
+{
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    state->deleteTextures(n, textures);
+    ctx->m_glDeleteTextures_enc(ctx, n, textures);
+}
+
+void GL2Encoder::s_glGetTexParameterfv(void* self,
+        GLenum target, GLenum pname, GLfloat* params)
+{
+    GL2Encoder* ctx = (GL2Encoder*)self;
+
+    SET_ERROR_IF(!GLESv2Validation::textureTarget(ctx, target), GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::textureParams(ctx, pname), GL_INVALID_ENUM);
+    if (!params) return;
+
+    if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
+        ctx->override2DTextureTarget(target);
+        ctx->m_glGetTexParameterfv_enc(ctx, GL_TEXTURE_2D, pname, params);
+        ctx->restore2DTextureTarget(target);
+    } else {
+        ctx->m_glGetTexParameterfv_enc(ctx, target, pname, params);
+    }
+}
+
+void GL2Encoder::s_glGetTexParameteriv(void* self,
+        GLenum target, GLenum pname, GLint* params)
+{
+    GL2Encoder* ctx = (GL2Encoder*)self;
+
+    SET_ERROR_IF(!GLESv2Validation::textureTarget(ctx, target), GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::textureParams(ctx, pname), GL_INVALID_ENUM);
+
+    if (!params) return;
+
+    switch (pname) {
+    case GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES:
+        *params = 1;
+        break;
+
+    default:
+        if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
+            ctx->override2DTextureTarget(target);
+            ctx->m_glGetTexParameteriv_enc(ctx, GL_TEXTURE_2D, pname, params);
+            ctx->restore2DTextureTarget(target);
+        } else {
+            ctx->m_glGetTexParameteriv_enc(ctx, target, pname, params);
+        }
+        break;
+    }
+}
+
+static bool isValidTextureExternalParam(GLenum pname, GLenum param)
+{
+    switch (pname) {
+    case GL_TEXTURE_MIN_FILTER:
+    case GL_TEXTURE_MAG_FILTER:
+        return param == GL_NEAREST || param == GL_LINEAR;
+
+    case GL_TEXTURE_WRAP_S:
+    case GL_TEXTURE_WRAP_T:
+        return param == GL_CLAMP_TO_EDGE;
+
+    default:
+        return true;
+    }
+}
+
+void GL2Encoder::s_glTexParameterf(void* self,
+        GLenum target, GLenum pname, GLfloat param)
+{
+    GL2Encoder* ctx = (GL2Encoder*)self;
+
+    SET_ERROR_IF((target == GL_TEXTURE_EXTERNAL_OES &&
+            !isValidTextureExternalParam(pname, (GLenum)param)),
+            GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::textureTarget(ctx, target), GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::textureParams(ctx, pname), GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::textureParamValue(ctx, pname, (GLint)param, param, (GLenum)param), GL_INVALID_ENUM);
+
+    if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
+        ctx->override2DTextureTarget(target);
+        ctx->m_glTexParameterf_enc(ctx, GL_TEXTURE_2D, pname, param);
+        ctx->restore2DTextureTarget(target);
+    } else {
+        ctx->m_glTexParameterf_enc(ctx, target, pname, param);
+    }
+}
+
+void GL2Encoder::s_glTexParameterfv(void* self,
+        GLenum target, GLenum pname, const GLfloat* params)
+{
+    GL2Encoder* ctx = (GL2Encoder*)self;
+
+    SET_ERROR_IF((target == GL_TEXTURE_EXTERNAL_OES &&
+            !isValidTextureExternalParam(pname, (GLenum)params[0])),
+            GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::textureTarget(ctx, target), GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::textureParams(ctx, pname), GL_INVALID_ENUM);
+    SET_ERROR_IF(!params, GL_INVALID_VALUE);
+    GLfloat param = *params;
+    SET_ERROR_IF(!GLESv2Validation::textureParamValue(ctx, pname, (GLint)param, param, (GLenum)param), GL_INVALID_ENUM);
+
+    if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
+        ctx->override2DTextureTarget(target);
+        ctx->m_glTexParameterfv_enc(ctx, GL_TEXTURE_2D, pname, params);
+        ctx->restore2DTextureTarget(target);
+    } else {
+        ctx->m_glTexParameterfv_enc(ctx, target, pname, params);
+    }
+}
+
+void GL2Encoder::s_glTexParameteri(void* self,
+        GLenum target, GLenum pname, GLint param)
+{
+    GL2Encoder* ctx = (GL2Encoder*)self;
+
+    SET_ERROR_IF((target == GL_TEXTURE_EXTERNAL_OES &&
+            !isValidTextureExternalParam(pname, (GLenum)param)),
+            GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::textureTarget(ctx, target), GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::textureParams(ctx, pname), GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::textureParamValue(ctx, pname, param, (GLfloat)param, (GLenum)param), GL_INVALID_ENUM);
+
+    if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
+        ctx->override2DTextureTarget(target);
+        ctx->m_glTexParameteri_enc(ctx, GL_TEXTURE_2D, pname, param);
+        ctx->restore2DTextureTarget(target);
+    } else {
+        ctx->m_glTexParameteri_enc(ctx, target, pname, param);
+    }
+}
+
+bool GL2Encoder::validateTexBuffer(void* self, GLenum target, GLenum internalFormat, GLuint buffer) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    RET_AND_SET_ERROR_IF((target != GL_TEXTURE_BUFFER_OES), GL_INVALID_ENUM, false);
+    RET_AND_SET_ERROR_IF(!GLESv2Validation::textureBufferFormat(ctx, internalFormat), GL_INVALID_ENUM, false);
+    RET_AND_SET_ERROR_IF(buffer != 0 && !ctx->getBufferDataById(buffer), GL_INVALID_OPERATION, false);
+    return true;
+}
+
+bool GL2Encoder::validateTexBufferRange(void* self, GLenum target, GLenum internalFormat, GLuint buffer, GLintptr offset, GLsizeiptr size)
+{
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    RET_AND_SET_ERROR_IF((target != GL_TEXTURE_BUFFER_OES), GL_INVALID_ENUM, false);
+    RET_AND_SET_ERROR_IF(!GLESv2Validation::textureBufferFormat(ctx, internalFormat), GL_INVALID_ENUM, false);
+    if (buffer != 0) {
+        BufferData* buf = ctx->getBufferDataById(buffer);
+        RET_AND_SET_ERROR_IF(((!buf) || (buf->m_size < offset+size) || (offset < 0) || (size<0)), GL_INVALID_VALUE, false);
+    }
+    GLint tex_buffer_offset_align = 1;
+    ctx->s_glGetIntegerv(ctx, GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT_OES, &tex_buffer_offset_align);
+    RET_AND_SET_ERROR_IF((offset % tex_buffer_offset_align) != 0, GL_INVALID_VALUE, false);
+    return true;
+}
+
+void GL2Encoder::s_glTexBufferOES(void* self,
+          GLenum target, GLenum internalFormat, GLuint buffer)
+{
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(!ctx->getExtensions().textureBufferOES, GL_INVALID_OPERATION);
+    if(!validateTexBuffer(ctx, target, internalFormat, buffer)) return;
+    GLClientState* state = ctx->m_state;
+    state->setBoundTextureInternalFormat(target, internalFormat);
+    ctx->m_glTexBufferOES_enc(ctx, target, internalFormat, buffer);
+}
+
+
+void GL2Encoder::s_glTexBufferRangeOES(void* self,
+          GLenum target, GLenum internalFormat, GLuint buffer, GLintptr offset, GLsizeiptr size) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(!ctx->getExtensions().textureBufferOES, GL_INVALID_OPERATION);
+    if(!validateTexBufferRange(ctx, target, internalFormat, buffer, offset, size)) return;
+    GLClientState* state = ctx->m_state;
+    state->setBoundTextureInternalFormat(target, internalFormat);
+    ctx->m_glTexBufferRangeOES_enc(ctx, target, internalFormat, buffer, offset, size);
+}
+
+void GL2Encoder::s_glTexBufferEXT(void* self,
+          GLenum target, GLenum internalFormat, GLuint buffer)
+{
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(!ctx->getExtensions().textureBufferEXT, GL_INVALID_OPERATION);
+    if(!validateTexBuffer(ctx, target, internalFormat, buffer)) return;
+    GLClientState* state = ctx->m_state;
+    state->setBoundTextureInternalFormat(target, internalFormat);
+    ctx->m_glTexBufferEXT_enc(ctx, target, internalFormat, buffer);
+}
+
+
+void GL2Encoder::s_glTexBufferRangeEXT(void* self,
+          GLenum target, GLenum internalFormat, GLuint buffer, GLintptr offset, GLsizeiptr size) {
+     GL2Encoder* ctx = (GL2Encoder*)self;
+     SET_ERROR_IF(!ctx->getExtensions().textureBufferEXT, GL_INVALID_OPERATION);
+     if(!validateTexBufferRange(ctx, target, internalFormat, buffer, offset, size)) return;
+     GLClientState* state = ctx->m_state;
+     state->setBoundTextureInternalFormat(target, internalFormat);
+     ctx->m_glTexBufferRangeEXT_enc(ctx, target, internalFormat, buffer, offset, size);
+}
+
+bool GL2Encoder::validateAllowedEnablei(void* self, GLenum cap, GLuint index) {
+     GL2Encoder* ctx = (GL2Encoder*)self;
+     switch(cap)
+     {
+     case GL_BLEND:
+       RET_AND_SET_ERROR_IF(index >= ctx->m_state->getMaxDrawBuffers(), GL_INVALID_VALUE, false);
+       break;
+     default:
+       RET_AND_SET_ERROR_IF(false, GL_INVALID_ENUM, false);
+     }
+     return true;
+}
+
+void GL2Encoder::s_glEnableiEXT(void * self, GLenum cap, GLuint index)
+{
+     GL2Encoder* ctx = (GL2Encoder*)self;
+     SET_ERROR_IF(!ctx->getExtensions().drawBuffersIndexedEXT, GL_INVALID_OPERATION);
+     if(!validateAllowedEnablei(ctx, cap, index)) return;
+     ctx->m_glEnableiEXT_enc(ctx, cap, index);
+}
+
+void GL2Encoder::s_glDisableiEXT(void* self, GLenum cap, GLuint index)
+{
+     GL2Encoder* ctx = (GL2Encoder*)self;
+     SET_ERROR_IF(!ctx->getExtensions().drawBuffersIndexedEXT, GL_INVALID_OPERATION);
+     if(!validateAllowedEnablei(ctx, cap, index)) return;
+     ctx->m_glDisableiEXT_enc(ctx, cap, index);
+}
+
+void GL2Encoder::s_glBlendEquationiEXT(void* self, GLuint buf, GLenum mode)
+{
+     GL2Encoder* ctx = (GL2Encoder*)self;
+     SET_ERROR_IF(!ctx->getExtensions().drawBuffersIndexedEXT, GL_INVALID_OPERATION);
+     SET_ERROR_IF(buf >= ctx->m_state->getMaxDrawBuffers(), GL_INVALID_VALUE);
+     SET_ERROR_IF(
+        !GLESv2Validation::allowedBlendEquation(mode),
+        GL_INVALID_ENUM);
+     ctx->m_glBlendEquationiEXT_enc(ctx, buf, mode);
+}
+
+void GL2Encoder::s_glBlendEquationSeparateiEXT(void* self, GLuint buf, GLenum modeRGB, GLenum modeAlpha)
+{
+     GL2Encoder* ctx = (GL2Encoder*)self;
+     SET_ERROR_IF(!ctx->getExtensions().drawBuffersIndexedEXT, GL_INVALID_OPERATION);
+     SET_ERROR_IF(buf >= ctx->m_state->getMaxDrawBuffers(), GL_INVALID_VALUE);
+     SET_ERROR_IF(
+        !GLESv2Validation::allowedBlendEquation(modeRGB) ||
+        !GLESv2Validation::allowedBlendEquation(modeAlpha),
+        GL_INVALID_ENUM);
+     ctx->m_glBlendEquationSeparateiEXT_enc(ctx, buf, modeRGB, modeAlpha);
+}
+
+void GL2Encoder::s_glBlendFunciEXT(void* self, GLuint buf, GLenum sfactor, GLenum dfactor)
+{
+     GL2Encoder* ctx = (GL2Encoder*)self;
+     SET_ERROR_IF(!ctx->getExtensions().drawBuffersIndexedEXT, GL_INVALID_OPERATION);
+     SET_ERROR_IF(buf >= ctx->m_state->getMaxDrawBuffers(), GL_INVALID_VALUE);
+     SET_ERROR_IF(
+        !GLESv2Validation::allowedBlendFunc(sfactor) ||
+        !GLESv2Validation::allowedBlendFunc(dfactor),
+        GL_INVALID_ENUM);
+     ctx->m_glBlendFunciEXT_enc(ctx, buf, sfactor, dfactor);
+}
+
+void GL2Encoder::s_glBlendFuncSeparateiEXT(void* self, GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
+{
+     GL2Encoder* ctx = (GL2Encoder*)self;
+     SET_ERROR_IF(!ctx->getExtensions().drawBuffersIndexedEXT, GL_INVALID_OPERATION);
+     SET_ERROR_IF(buf >= ctx->m_state->getMaxDrawBuffers(), GL_INVALID_VALUE);
+     SET_ERROR_IF(
+        !GLESv2Validation::allowedBlendFunc(srcRGB) ||
+        !GLESv2Validation::allowedBlendFunc(dstRGB) ||
+        !GLESv2Validation::allowedBlendFunc(srcAlpha) ||
+        !GLESv2Validation::allowedBlendFunc(dstAlpha),
+        GL_INVALID_ENUM);
+     ctx->m_glBlendFuncSeparateiEXT_enc(ctx, buf, srcRGB, dstRGB, srcAlpha, dstAlpha);
+}
+
+void GL2Encoder::s_glColorMaskiEXT(void* self, GLuint buf, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
+{
+     GL2Encoder* ctx = (GL2Encoder*)self;
+     SET_ERROR_IF(!ctx->getExtensions().drawBuffersIndexedEXT, GL_INVALID_OPERATION);
+     SET_ERROR_IF(buf >= ctx->m_state->getMaxDrawBuffers(), GL_INVALID_VALUE);
+     ctx->m_glColorMaskiEXT_enc(ctx, buf, red, green, blue, alpha);
+}
+
+GLboolean GL2Encoder::s_glIsEnablediEXT(void* self, GLenum cap, GLuint index)
+{
+     GL2Encoder* ctx = (GL2Encoder*)self;
+     RET_AND_SET_ERROR_IF(!ctx->getExtensions().drawBuffersIndexedEXT, GL_INVALID_OPERATION, GL_FALSE);
+     if(!validateAllowedEnablei(ctx, cap, index)) return GL_FALSE;
+     return ctx->m_glIsEnablediEXT_enc(ctx, cap, index);
+}
+
+static int ilog2(uint32_t x) {
+    int p = 0;
+    while ((1 << p) < x)
+        p++;
+    return p;
+}
+
+void GL2Encoder::s_glTexImage2D(void* self, GLenum target, GLint level,
+        GLint internalformat, GLsizei width, GLsizei height, GLint border,
+        GLenum format, GLenum type, const GLvoid* pixels)
+{
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    SET_ERROR_IF(!GLESv2Validation::textureTarget(ctx, target), GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::pixelType(ctx, type), GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::pixelFormat(ctx, format), GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::pixelFormat(ctx, internalformat) && !GLESv2Validation::pixelInternalFormat(internalformat), GL_INVALID_VALUE);
+    SET_ERROR_IF(!(GLESv2Validation::pixelOp(format,type)),GL_INVALID_OPERATION);
+    SET_ERROR_IF(!GLESv2Validation::pixelSizedFormat(ctx, internalformat, format, type), GL_INVALID_OPERATION);
+    // If unpack buffer is nonzero, verify unmapped state.
+    SET_ERROR_IF(ctx->isBufferTargetMapped(GL_PIXEL_UNPACK_BUFFER), GL_INVALID_OPERATION);
+
+    GLint max_texture_size;
+    GLint max_cube_map_texture_size;
+    ctx->glGetIntegerv(ctx, GL_MAX_TEXTURE_SIZE, &max_texture_size);
+    ctx->glGetIntegerv(ctx, GL_MAX_CUBE_MAP_TEXTURE_SIZE, &max_cube_map_texture_size);
+    SET_ERROR_IF(level < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(level > ilog2(max_texture_size), GL_INVALID_VALUE);
+    SET_ERROR_IF((target == GL_TEXTURE_CUBE_MAP) &&
+                 (level > ilog2(max_cube_map_texture_size)), GL_INVALID_VALUE);
+    SET_ERROR_IF(width < 0 || height < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(width > max_texture_size, GL_INVALID_VALUE);
+    SET_ERROR_IF(height > max_texture_size, GL_INVALID_VALUE);
+    SET_ERROR_IF(GLESv2Validation::isCubeMapTarget(target) && width > max_cube_map_texture_size, GL_INVALID_VALUE);
+    SET_ERROR_IF(GLESv2Validation::isCubeMapTarget(target) && height > max_cube_map_texture_size, GL_INVALID_VALUE);
+    SET_ERROR_IF(GLESv2Validation::isCubeMapTarget(target) && (width != height), GL_INVALID_VALUE);
+    SET_ERROR_IF(border != 0, GL_INVALID_VALUE);
+    // If unpack buffer is nonzero, verify buffer data fits and is evenly divisible by the type.
+    SET_ERROR_IF(ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) &&
+                 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER) &&
+                 (ctx->m_state->pboNeededDataSize(width, height, 1, format, type, 0) >
+                  ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER)->m_size),
+                 GL_INVALID_OPERATION);
+    SET_ERROR_IF(ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) &&
+                 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER) &&
+                 (ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER)->m_size %
+                  glSizeof(type)),
+                 GL_INVALID_OPERATION);
+    SET_ERROR_IF(ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) &&
+                 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER) &&
+                 ((uintptr_t)pixels % glSizeof(type)),
+                 GL_INVALID_OPERATION);
+    SET_ERROR_IF(state->isBoundTextureImmutableFormat(target), GL_INVALID_OPERATION);
+
+    GLenum stateTarget = target;
+    if (target == GL_TEXTURE_CUBE_MAP_POSITIVE_X ||
+        target == GL_TEXTURE_CUBE_MAP_POSITIVE_Y ||
+        target == GL_TEXTURE_CUBE_MAP_POSITIVE_Z ||
+        target == GL_TEXTURE_CUBE_MAP_NEGATIVE_X ||
+        target == GL_TEXTURE_CUBE_MAP_NEGATIVE_Y ||
+        target == GL_TEXTURE_CUBE_MAP_NEGATIVE_Z)
+        stateTarget = GL_TEXTURE_CUBE_MAP;
+
+    state->setBoundTextureInternalFormat(stateTarget, internalformat);
+    state->setBoundTextureFormat(stateTarget, format);
+    state->setBoundTextureType(stateTarget, type);
+    state->setBoundTextureDims(stateTarget, target, level, width, height, 1);
+    state->addTextureCubeMapImage(stateTarget, target);
+
+    if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
+        ctx->override2DTextureTarget(target);
+    }
+
+    if (ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER)) {
+        ctx->glTexImage2DOffsetAEMU(
+                ctx, target, level, internalformat,
+                width, height, border,
+                format, type, (uintptr_t)pixels);
+    } else {
+        ctx->m_glTexImage2D_enc(
+                ctx, target, level, internalformat,
+                width, height, border,
+                format, type, pixels);
+    }
+
+    if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
+        ctx->restore2DTextureTarget(target);
+    }
+}
+
+void GL2Encoder::s_glTexSubImage2D(void* self, GLenum target, GLint level,
+        GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format,
+        GLenum type, const GLvoid* pixels)
+{
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    SET_ERROR_IF(!GLESv2Validation::textureTarget(ctx, target), GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::pixelType(ctx, type), GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::pixelFormat(ctx, format), GL_INVALID_ENUM);
+    // If unpack buffer is nonzero, verify unmapped state.
+    SET_ERROR_IF(ctx->isBufferTargetMapped(GL_PIXEL_UNPACK_BUFFER), GL_INVALID_OPERATION);
+
+    GLint max_texture_size;
+    GLint max_cube_map_texture_size;
+    ctx->glGetIntegerv(ctx, GL_MAX_TEXTURE_SIZE, &max_texture_size);
+    ctx->glGetIntegerv(ctx, GL_MAX_CUBE_MAP_TEXTURE_SIZE, &max_cube_map_texture_size);
+    SET_ERROR_IF(level < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(level > ilog2(max_texture_size), GL_INVALID_VALUE);
+    SET_ERROR_IF(GLESv2Validation::isCubeMapTarget(target) &&
+                 level > ilog2(max_cube_map_texture_size), GL_INVALID_VALUE);
+    SET_ERROR_IF(width < 0 || height < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(xoffset < 0 || yoffset < 0, GL_INVALID_VALUE);
+
+    GLuint tex = state->getBoundTexture(target);
+    GLsizei neededWidth = xoffset + width;
+    GLsizei neededHeight = yoffset + height;
+    GLsizei neededDepth = 1;
+
+    if (tex && !state->queryTexEGLImageBacked(tex)) {
+        SET_ERROR_IF(
+                (neededWidth > state->queryTexWidth(level, tex) ||
+                 neededHeight > state->queryTexHeight(level, tex) ||
+                 neededDepth > state->queryTexDepth(level, tex)),
+                GL_INVALID_VALUE);
+    }
+
+    // If unpack buffer is nonzero, verify buffer data fits and is evenly divisible by the type.
+    SET_ERROR_IF(ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) &&
+                 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER) &&
+                 (state->pboNeededDataSize(width, height, 1, format, type, 0, 1) + (uintptr_t)pixels >
+                  ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER)->m_size),
+                 GL_INVALID_OPERATION);
+    SET_ERROR_IF(ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) &&
+                 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER) &&
+                 ((uintptr_t)pixels %
+                  glSizeof(type)),
+                 GL_INVALID_OPERATION);
+    SET_ERROR_IF(!ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) && !pixels, GL_INVALID_OPERATION);
+
+    if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
+        ctx->override2DTextureTarget(target);
+    }
+
+    if (ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER)) {
+        ctx->glTexSubImage2DOffsetAEMU(
+                ctx, target, level,
+                xoffset, yoffset, width, height,
+                format, type, (uintptr_t)pixels);
+    } else {
+        ctx->m_glTexSubImage2D_enc(ctx, target, level, xoffset, yoffset, width,
+                height, format, type, pixels);
+    }
+
+    if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
+        ctx->restore2DTextureTarget(target);
+    }
+}
+
+void GL2Encoder::s_glCopyTexImage2D(void* self, GLenum target, GLint level,
+        GLenum internalformat, GLint x, GLint y,
+        GLsizei width, GLsizei height, GLint border)
+{
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    SET_ERROR_IF(!GLESv2Validation::textureTarget(ctx, target), GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::pixelFormat(ctx, internalformat) && !GLESv2Validation::pixelInternalFormat(internalformat), GL_INVALID_VALUE);
+    GLint max_texture_size;
+    GLint max_cube_map_texture_size;
+    ctx->glGetIntegerv(ctx, GL_MAX_TEXTURE_SIZE, &max_texture_size);
+    ctx->glGetIntegerv(ctx, GL_MAX_CUBE_MAP_TEXTURE_SIZE, &max_cube_map_texture_size);
+    SET_ERROR_IF(level < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(level > ilog2(max_texture_size), GL_INVALID_VALUE);
+    SET_ERROR_IF((target == GL_TEXTURE_CUBE_MAP) &&
+                 (level > ilog2(max_cube_map_texture_size)), GL_INVALID_VALUE);
+    SET_ERROR_IF(width < 0 || height < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(width > max_texture_size, GL_INVALID_VALUE);
+    SET_ERROR_IF(height > max_texture_size, GL_INVALID_VALUE);
+    SET_ERROR_IF(GLESv2Validation::isCubeMapTarget(target) && width > max_cube_map_texture_size, GL_INVALID_VALUE);
+    SET_ERROR_IF(GLESv2Validation::isCubeMapTarget(target) && height > max_cube_map_texture_size, GL_INVALID_VALUE);
+    SET_ERROR_IF(GLESv2Validation::isCubeMapTarget(target) && (width != height), GL_INVALID_VALUE);
+    SET_ERROR_IF(border != 0, GL_INVALID_VALUE);
+
+    GLenum stateTarget = target;
+    if (target == GL_TEXTURE_CUBE_MAP_POSITIVE_X ||
+        target == GL_TEXTURE_CUBE_MAP_POSITIVE_Y ||
+        target == GL_TEXTURE_CUBE_MAP_POSITIVE_Z ||
+        target == GL_TEXTURE_CUBE_MAP_NEGATIVE_X ||
+        target == GL_TEXTURE_CUBE_MAP_NEGATIVE_Y ||
+        target == GL_TEXTURE_CUBE_MAP_NEGATIVE_Z)
+        stateTarget = GL_TEXTURE_CUBE_MAP;
+
+    SET_ERROR_IF(state->isBoundTextureImmutableFormat(target), GL_INVALID_OPERATION);
+
+    SET_ERROR_IF(ctx->glCheckFramebufferStatus(ctx, GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE,
+                 GL_INVALID_FRAMEBUFFER_OPERATION);
+    // This is needed to work around underlying OpenGL drivers
+    // (such as those feeding some some AMD GPUs) that expect
+    // positive components of cube maps to be defined _before_
+    // the negative components (otherwise a segfault occurs).
+    GLenum extraTarget =
+        state->copyTexImageLuminanceCubeMapAMDWorkaround
+            (target, level, internalformat);
+
+    state->setBoundTextureInternalFormat(stateTarget, internalformat);
+    state->setBoundTextureDims(stateTarget, target, level, width, height, 1);
+    state->addTextureCubeMapImage(stateTarget, target);
+
+    if (extraTarget) {
+        ctx->m_glCopyTexImage2D_enc(ctx, extraTarget, level, internalformat,
+                                    x, y, width, height, border);
+    }
+
+    ctx->m_glCopyTexImage2D_enc(ctx, target, level, internalformat,
+                                x, y, width, height, border);
+}
+
+void GL2Encoder::s_glTexParameteriv(void* self,
+        GLenum target, GLenum pname, const GLint* params)
+{
+    GL2Encoder* ctx = (GL2Encoder*)self;
+
+    SET_ERROR_IF((target == GL_TEXTURE_EXTERNAL_OES &&
+            !isValidTextureExternalParam(pname, (GLenum)params[0])),
+            GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::textureTarget(ctx, target), GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::textureParams(ctx, pname), GL_INVALID_ENUM);
+    SET_ERROR_IF(!params, GL_INVALID_VALUE);
+    GLint param = *params;
+    SET_ERROR_IF(!GLESv2Validation::textureParamValue(ctx, pname, param, (GLfloat)param, (GLenum)param), GL_INVALID_ENUM);
+
+    if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
+        ctx->override2DTextureTarget(target);
+        ctx->m_glTexParameteriv_enc(ctx, GL_TEXTURE_2D, pname, params);
+        ctx->restore2DTextureTarget(target);
+    } else {
+        ctx->m_glTexParameteriv_enc(ctx, target, pname, params);
+    }
+}
+
+bool GL2Encoder::texture2DNeedsOverride(GLenum target) const {
+    return (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) &&
+           target != m_state->getPriorityEnabledTarget(GL_TEXTURE_2D);
+}
+
+void GL2Encoder::override2DTextureTarget(GLenum target)
+{
+    if (texture2DNeedsOverride(target)) {
+        m_glBindTexture_enc(this, GL_TEXTURE_2D,
+                m_state->getBoundTexture(target));
+    }
+}
+
+void GL2Encoder::restore2DTextureTarget(GLenum target)
+{
+    if (texture2DNeedsOverride(target)) {
+        GLuint priorityEnabledBoundTexture =
+                m_state->getBoundTexture(
+                    m_state->getPriorityEnabledTarget(GL_TEXTURE_2D));
+        GLuint texture2DBoundTexture =
+                m_state->getBoundTexture(GL_TEXTURE_2D);
+        if (!priorityEnabledBoundTexture) {
+            m_glBindTexture_enc(this, GL_TEXTURE_2D, texture2DBoundTexture);
+        } else {
+            m_glBindTexture_enc(this, GL_TEXTURE_2D, priorityEnabledBoundTexture);
+        }
+    }
+}
+
+void GL2Encoder::associateEGLImage(GLenum target, GLeglImageOES eglImage, int width, int height) {
+    m_state->setBoundEGLImage(target, eglImage, width, height);
+}
+
+
+GLuint GL2Encoder::boundBuffer(GLenum target) const {
+    return m_state->getBuffer(target);
+}
+
+BufferData* GL2Encoder::getBufferData(GLenum target) const {
+    GLuint bufferId = m_state->getBuffer(target);
+    if (!bufferId) return NULL;
+    return m_shared->getBufferData(bufferId);
+}
+
+BufferData* GL2Encoder::getBufferDataById(GLuint bufferId) const {
+    if (!bufferId) return NULL;
+    return m_shared->getBufferData(bufferId);
+}
+
+bool GL2Encoder::isBufferMapped(GLuint buffer) const {
+    return m_shared->getBufferData(buffer)->m_mapped;
+}
+
+bool GL2Encoder::isBufferTargetMapped(GLenum target) const {
+    BufferData* buf = getBufferData(target);
+    if (!buf) return false;
+    return buf->m_mapped;
+}
+
+void GL2Encoder::s_glGenRenderbuffers(void* self,
+        GLsizei n, GLuint* renderbuffers) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    SET_ERROR_IF(n < 0, GL_INVALID_VALUE);
+
+    ctx->m_glGenFramebuffers_enc(self, n, renderbuffers);
+    state->addRenderbuffers(n, renderbuffers);
+}
+
+void GL2Encoder::s_glDeleteRenderbuffers(void* self,
+        GLsizei n, const GLuint* renderbuffers) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    SET_ERROR_IF(n < 0, GL_INVALID_VALUE);
+
+    ctx->m_glDeleteRenderbuffers_enc(self, n, renderbuffers);
+
+    // Nope, lets just leak those for now.
+    // The spec has an *amazingly* convoluted set of conditions for when
+    // render buffers are actually deleted:
+    // glDeleteRenderbuffers deletes the n renderbuffer objects whose names are stored in the array addressed by renderbuffers. Unused names in renderbuffers that have been marked as used for the purposes of glGenRenderbuffers are marked as unused again. The name zero is reserved by the GL and is silently ignored, should it occur in renderbuffers, as are other unused names. Once a renderbuffer object is deleted, its name is again unused and it has no contents. If a renderbuffer that is currently bound to the target GL_RENDERBUFFER is deleted, it is as though glBindRenderbuffer had been executed with a target of GL_RENDERBUFFER and a name of zero.
+    //
+    // If a renderbuffer object is attached to one or more attachment points in the currently bound framebuffer, then it as if glFramebufferRenderbuffer had been called, with a renderbuffer of zero for each attachment point to which this image was attached in the currently bound framebuffer. In other words, this renderbuffer object is first detached from all attachment ponits in the currently bound framebuffer. ***Note that the renderbuffer image is specifically not detached from any non-bound framebuffers***
+    //
+    // So, just detach this one from the bound FBO, and ignore the rest.
+    for (int i = 0; i < n; i++) {
+        state->detachRbo(renderbuffers[i]);
+    }
+    state->removeRenderbuffers(n, renderbuffers);
+}
+
+void GL2Encoder::s_glBindRenderbuffer(void* self,
+        GLenum target, GLuint renderbuffer) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    SET_ERROR_IF((target != GL_RENDERBUFFER),
+                 GL_INVALID_ENUM);
+
+    ctx->m_glBindRenderbuffer_enc(self, target, renderbuffer);
+    state->bindRenderbuffer(target, renderbuffer);
+}
+
+void GL2Encoder::s_glRenderbufferStorage(void* self,
+        GLenum target, GLenum internalformat,
+        GLsizei width, GLsizei height) {
+    GL2Encoder* ctx = (GL2Encoder*) self;
+    GLClientState* state = ctx->m_state;
+
+    SET_ERROR_IF(target != GL_RENDERBUFFER, GL_INVALID_ENUM);
+    SET_ERROR_IF(0 == ctx->m_state->boundRenderbuffer(), GL_INVALID_OPERATION);
+    SET_ERROR_IF(
+        !GLESv2Validation::rboFormat(ctx, internalformat),
+        GL_INVALID_ENUM);
+
+    SET_ERROR_IF(width < 0 || height < 0, GL_INVALID_VALUE);
+    GLint max_rb_size;
+    ctx->glGetIntegerv(ctx, GL_MAX_RENDERBUFFER_SIZE, &max_rb_size);
+    SET_ERROR_IF(width > max_rb_size || height > max_rb_size, GL_INVALID_VALUE);
+
+    state->setBoundRenderbufferFormat(internalformat);
+    state->setBoundRenderbufferSamples(0);
+    state->setBoundRenderbufferDimensions(width, height);
+
+    ctx->m_glRenderbufferStorage_enc(self, target, internalformat,
+                                     width, height);
+}
+
+void GL2Encoder::s_glFramebufferRenderbuffer(void* self,
+        GLenum target, GLenum attachment,
+        GLenum renderbuffertarget, GLuint renderbuffer) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    SET_ERROR_IF(!GLESv2Validation::framebufferTarget(ctx, target), GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::framebufferAttachment(ctx, attachment), GL_INVALID_ENUM);
+    SET_ERROR_IF(GL_RENDERBUFFER != renderbuffertarget, GL_INVALID_ENUM);
+    SET_ERROR_IF(!state->getBoundFramebuffer(target), GL_INVALID_OPERATION);
+    SET_ERROR_IF(!state->isRenderbufferThatWasBound(renderbuffer), GL_INVALID_OPERATION);
+
+    state->attachRbo(target, attachment, renderbuffer);
+
+    ctx->m_glFramebufferRenderbuffer_enc(self, target, attachment, renderbuffertarget, renderbuffer);
+}
+
+void GL2Encoder::s_glGenFramebuffers(void* self,
+        GLsizei n, GLuint* framebuffers) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    SET_ERROR_IF(n < 0, GL_INVALID_VALUE);
+
+    ctx->m_glGenFramebuffers_enc(self, n, framebuffers);
+    state->addFramebuffers(n, framebuffers);
+}
+
+void GL2Encoder::s_glDeleteFramebuffers(void* self,
+        GLsizei n, const GLuint* framebuffers) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    SET_ERROR_IF(n < 0, GL_INVALID_VALUE);
+
+    ctx->m_glDeleteFramebuffers_enc(self, n, framebuffers);
+    state->removeFramebuffers(n, framebuffers);
+}
+
+void GL2Encoder::s_glBindFramebuffer(void* self,
+        GLenum target, GLuint framebuffer) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    SET_ERROR_IF(!GLESv2Validation::framebufferTarget(ctx, target), GL_INVALID_ENUM);
+
+    state->bindFramebuffer(target, framebuffer);
+
+    ctx->m_glBindFramebuffer_enc(self, target, framebuffer);
+}
+
+void GL2Encoder::s_glFramebufferParameteri(void *self,
+        GLenum target, GLenum pname, GLint param) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+    state->setFramebufferParameter(target, pname, param);
+    ctx->m_glFramebufferParameteri_enc(self, target, pname, param);
+}
+
+void GL2Encoder::s_glFramebufferTexture2D(void* self,
+        GLenum target, GLenum attachment,
+        GLenum textarget, GLuint texture, GLint level) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    SET_ERROR_IF(!GLESv2Validation::framebufferTarget(ctx, target), GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::textureTarget(ctx, textarget), GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::framebufferAttachment(ctx, attachment), GL_INVALID_ENUM);
+    SET_ERROR_IF(!state->getBoundFramebuffer(target), GL_INVALID_OPERATION);
+    SET_ERROR_IF(texture && !state->isTexture(texture), GL_INVALID_OPERATION);
+    SET_ERROR_IF(GLESv2Validation::isCubeMapTarget(textarget) && !state->isTextureCubeMap(texture), GL_INVALID_OPERATION);
+    SET_ERROR_IF(!GLESv2Validation::isCubeMapTarget(textarget) && state->isTextureCubeMap(texture), GL_INVALID_OPERATION);
+    SET_ERROR_IF((texture && (level < 0)), GL_INVALID_VALUE);
+
+    if (textarget == GL_TEXTURE_2D) {
+        SET_ERROR_IF(level > ilog2(ctx->m_state->getMaxTextureSize()), GL_INVALID_VALUE);
+    } else {
+        SET_ERROR_IF(level > ilog2(ctx->m_state->getMaxTextureSizeCubeMap()), GL_INVALID_VALUE);
+    }
+
+    state->attachTextureObject(target, attachment, texture, level, 0);
+
+    ctx->m_glFramebufferTexture2D_enc(self, target, attachment, textarget, texture, level);
+}
+
+void GL2Encoder::s_glFramebufferTexture3DOES(void* self,
+        GLenum target, GLenum attachment,
+        GLenum textarget, GLuint texture, GLint level, GLint zoffset) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    state->attachTextureObject(target, attachment, texture, level, zoffset);
+
+    ctx->m_glFramebufferTexture3DOES_enc(self, target, attachment, textarget, texture, level, zoffset);
+}
+
+void GL2Encoder::s_glGetFramebufferAttachmentParameteriv(void* self,
+        GLenum target, GLenum attachment, GLenum pname, GLint* params) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    const GLClientState* state = ctx->m_state;
+    SET_ERROR_IF(!GLESv2Validation::framebufferTarget(ctx, target), GL_INVALID_ENUM);
+    SET_ERROR_IF(!state->boundFramebuffer(target) &&
+                 attachment != GL_BACK &&
+                 attachment != GL_FRONT &&
+                 attachment != GL_DEPTH &&
+                 attachment != GL_STENCIL,
+                 GL_INVALID_OPERATION);
+    SET_ERROR_IF(pname != GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME &&
+                 pname != GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE &&
+                 !state->attachmentHasObject(target, attachment),
+                 GL_INVALID_OPERATION);
+    SET_ERROR_IF((pname == GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL ||
+                  pname == GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE ||
+                  pname == GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER) &&
+                 (!state->attachmentHasObject(target, attachment) ||
+                  state->getBoundFramebufferAttachmentType(target, attachment) !=
+                  FBO_ATTACHMENT_TEXTURE),
+                 !state->attachmentHasObject(target, attachment) ?
+                 GL_INVALID_OPERATION : GL_INVALID_ENUM);
+    SET_ERROR_IF(
+        (attachment == GL_FRONT ||
+         attachment == GL_BACK) &&
+        (pname == GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME),
+        GL_INVALID_ENUM);
+    SET_ERROR_IF(attachment == GL_DEPTH_STENCIL_ATTACHMENT &&
+                 pname == GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME &&
+                 !state->depthStencilHasSameObject(target),
+                 GL_INVALID_OPERATION);
+    SET_ERROR_IF(state->boundFramebuffer(target) &&
+                 (attachment == GL_BACK ||
+                  attachment == GL_FRONT ||
+                  attachment == GL_DEPTH || 
+                  attachment == GL_STENCIL),
+                 GL_INVALID_OPERATION);
+    ctx->m_glGetFramebufferAttachmentParameteriv_enc(self, target, attachment, pname, params);
+}
+
+GLenum GL2Encoder::s_glCheckFramebufferStatus(void* self, GLenum target) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+
+    RET_AND_SET_ERROR_IF(
+        target != GL_DRAW_FRAMEBUFFER && target != GL_FRAMEBUFFER && target != GL_READ_FRAMEBUFFER,
+        GL_INVALID_ENUM, 0);
+
+    GLClientState* state = ctx->m_state;
+
+    return state->checkFramebufferCompleteness(target);
+}
+
+void GL2Encoder::s_glGenVertexArrays(void* self, GLsizei n, GLuint* arrays) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+    SET_ERROR_IF(n < 0, GL_INVALID_VALUE);
+
+    ctx->m_glGenVertexArrays_enc(self, n, arrays);
+    for (int i = 0; i < n; i++) {
+        ALOGV("%s: gen vao %u", __FUNCTION__, arrays[i]);
+    }
+    state->addVertexArrayObjects(n, arrays);
+}
+
+void GL2Encoder::s_glDeleteVertexArrays(void* self, GLsizei n, const GLuint* arrays) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+    SET_ERROR_IF(n < 0, GL_INVALID_VALUE);
+
+    ctx->m_glDeleteVertexArrays_enc(self, n, arrays);
+    for (int i = 0; i < n; i++) {
+        ALOGV("%s: delete vao %u", __FUNCTION__, arrays[i]);
+    }
+    state->removeVertexArrayObjects(n, arrays);
+}
+
+void GL2Encoder::s_glBindVertexArray(void* self, GLuint array) {
+    ALOGV("%s: call. array=%u\n", __FUNCTION__, array);
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+    SET_ERROR_IF(!state->isVertexArrayObject(array), GL_INVALID_OPERATION);
+    ctx->m_glBindVertexArray_enc(self, array);
+    state->setVertexArrayObject(array);
+}
+
+void* GL2Encoder::s_glMapBufferOES(void* self, GLenum target, GLenum access) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+
+    RET_AND_SET_ERROR_IF(!GLESv2Validation::bufferTarget(ctx, target), GL_INVALID_ENUM, NULL);
+
+    GLuint boundBuffer = ctx->m_state->getBuffer(target);
+
+    RET_AND_SET_ERROR_IF(boundBuffer == 0, GL_INVALID_OPERATION, NULL);
+
+    BufferData* buf = ctx->m_shared->getBufferData(boundBuffer);
+    RET_AND_SET_ERROR_IF(!buf, GL_INVALID_VALUE, NULL);
+
+    return ctx->glMapBufferRange(ctx, target, 0, buf->m_size, access);
+}
+
+GLboolean GL2Encoder::s_glUnmapBufferOES(void* self, GLenum target) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+
+    return ctx->glUnmapBuffer(ctx, target);
+}
+
+void* GL2Encoder::s_glMapBufferRangeAEMUImpl(GL2Encoder* ctx, GLenum target,
+                                             GLintptr offset, GLsizeiptr length,
+                                             GLbitfield access, BufferData* buf) {
+    char* bits = &buf->m_fixedBuffer[offset];
+
+    if ((access & GL_MAP_READ_BIT) ||
+        ((access & GL_MAP_WRITE_BIT) &&
+        (!(access & GL_MAP_INVALIDATE_RANGE_BIT) &&
+         !(access & GL_MAP_INVALIDATE_BUFFER_BIT)))) {
+
+        if (ctx->m_state->shouldSkipHostMapBuffer(target))
+            return bits;
+
+        ctx->glMapBufferRangeAEMU(
+                ctx, target,
+                offset, length,
+                access,
+                bits);
+
+        ctx->m_state->onHostMappedBuffer(target);
+    }
+
+    return bits;
+}
+
+void* GL2Encoder::s_glMapBufferRange(void* self, GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+
+    // begin validation (lots)
+
+    RET_AND_SET_ERROR_IF(!GLESv2Validation::bufferTarget(ctx, target), GL_INVALID_ENUM, NULL);
+
+    GLuint boundBuffer = ctx->m_state->getBuffer(target);
+
+    RET_AND_SET_ERROR_IF(boundBuffer == 0, GL_INVALID_OPERATION, NULL);
+
+    BufferData* buf = ctx->m_shared->getBufferData(boundBuffer);
+    RET_AND_SET_ERROR_IF(!buf, GL_INVALID_VALUE, NULL);
+
+    GLsizeiptr bufferDataSize = buf->m_size;
+
+    RET_AND_SET_ERROR_IF(offset < 0, GL_INVALID_VALUE, NULL);
+    RET_AND_SET_ERROR_IF(length < 0, GL_INVALID_VALUE, NULL);
+    RET_AND_SET_ERROR_IF(offset + length > bufferDataSize, GL_INVALID_VALUE, NULL);
+    RET_AND_SET_ERROR_IF(access & ~GLESv2Validation::allBufferMapAccessFlags, GL_INVALID_VALUE, NULL);
+
+    RET_AND_SET_ERROR_IF(buf->m_mapped, GL_INVALID_OPERATION, NULL);
+    RET_AND_SET_ERROR_IF(!(access & (GL_MAP_READ_BIT | GL_MAP_WRITE_BIT)), GL_INVALID_OPERATION, NULL);
+    RET_AND_SET_ERROR_IF(
+        (access & GL_MAP_READ_BIT) &&
+             ((access & GL_MAP_INVALIDATE_RANGE_BIT) ||
+              (access & GL_MAP_INVALIDATE_BUFFER_BIT) ||
+              (access & GL_MAP_UNSYNCHRONIZED_BIT) ||
+              (access & GL_MAP_FLUSH_EXPLICIT_BIT)), GL_INVALID_OPERATION, NULL);
+
+    // end validation; actually do stuff now
+
+    buf->m_mapped = true;
+    buf->m_mappedAccess = access;
+    buf->m_mappedOffset = offset;
+    buf->m_mappedLength = length;
+
+    if (ctx->hasExtension("ANDROID_EMU_dma_v2")) {
+        if (buf->dma_buffer.get().size < length) {
+            goldfish_dma_context region;
+
+            const int PAGE_BITS = 12;
+            GLsizeiptr aligned_length = (length + (1 << PAGE_BITS) - 1) & ~((1 << PAGE_BITS) - 1);
+
+            if (goldfish_dma_create_region(aligned_length, &region)) {
+                buf->dma_buffer.reset(NULL);
+                return s_glMapBufferRangeAEMUImpl(ctx, target, offset, length, access, buf);
+            }
+
+            if (!goldfish_dma_map(&region)) {
+                buf->dma_buffer.reset(NULL);
+                return s_glMapBufferRangeAEMUImpl(ctx, target, offset, length, access, buf);
+            }
+
+            buf->m_guest_paddr = goldfish_dma_guest_paddr(&region);
+            buf->dma_buffer.reset(&region);
+        }
+
+        ctx->glMapBufferRangeDMA(
+                ctx, target,
+                offset, length,
+                access,
+                buf->m_guest_paddr);
+
+        return reinterpret_cast<void*>(buf->dma_buffer.get().mapped_addr);
+    } else {
+        return s_glMapBufferRangeAEMUImpl(ctx, target, offset, length, access, buf);
+    }
+}
+
+GLboolean GL2Encoder::s_glUnmapBuffer(void* self, GLenum target) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+
+    RET_AND_SET_ERROR_IF(!GLESv2Validation::bufferTarget(ctx, target), GL_INVALID_ENUM, GL_FALSE);
+
+    GLuint boundBuffer = ctx->m_state->getBuffer(target);
+
+    RET_AND_SET_ERROR_IF(boundBuffer == 0, GL_INVALID_OPERATION, GL_FALSE);
+
+    BufferData* buf = ctx->m_shared->getBufferData(boundBuffer);
+    RET_AND_SET_ERROR_IF(!buf, GL_INVALID_VALUE, GL_FALSE);
+    RET_AND_SET_ERROR_IF(!buf->m_mapped, GL_INVALID_OPERATION, GL_FALSE);
+
+    if (buf->m_mappedAccess & GL_MAP_WRITE_BIT) {
+        // invalide index range cache here
+        if (buf->m_mappedAccess & GL_MAP_INVALIDATE_BUFFER_BIT) {
+            buf->m_indexRangeCache.invalidateRange(0, buf->m_size);
+        } else {
+            buf->m_indexRangeCache.invalidateRange(buf->m_mappedOffset, buf->m_mappedLength);
+        }
+    }
+
+    GLboolean host_res = GL_TRUE;
+
+    if (buf->dma_buffer.get().mapped_addr) {
+        memcpy(&buf->m_fixedBuffer[buf->m_mappedOffset],
+               reinterpret_cast<void*>(buf->dma_buffer.get().mapped_addr),
+               buf->m_mappedLength);
+
+        ctx->glUnmapBufferDMA(
+            ctx, target,
+            buf->m_mappedOffset,
+            buf->m_mappedLength,
+            buf->m_mappedAccess,
+            goldfish_dma_guest_paddr(&buf->dma_buffer.get()),
+            &host_res);
+    } else {
+        if (ctx->m_hasAsyncUnmapBuffer) {
+            ctx->glUnmapBufferAsyncAEMU(
+                    ctx, target,
+                    buf->m_mappedOffset,
+                    buf->m_mappedLength,
+                    buf->m_mappedAccess,
+                    &buf->m_fixedBuffer[buf->m_mappedOffset],
+                    &host_res);
+        } else {
+            if (buf->m_mappedAccess & GL_MAP_WRITE_BIT) {
+                ctx->glUnmapBufferAEMU(
+                        ctx, target,
+                        buf->m_mappedOffset,
+                        buf->m_mappedLength,
+                        buf->m_mappedAccess,
+                        &buf->m_fixedBuffer[buf->m_mappedOffset],
+                        &host_res);
+            }
+        }
+    }
+
+    buf->m_mapped = false;
+    buf->m_mappedAccess = 0;
+    buf->m_mappedOffset = 0;
+    buf->m_mappedLength = 0;
+
+    return host_res;
+}
+
+void GL2Encoder::s_glFlushMappedBufferRange(void* self, GLenum target, GLintptr offset, GLsizeiptr length) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+
+    SET_ERROR_IF(!GLESv2Validation::bufferTarget(ctx, target), GL_INVALID_ENUM);
+
+    GLuint boundBuffer = ctx->m_state->getBuffer(target);
+    SET_ERROR_IF(!boundBuffer, GL_INVALID_OPERATION);
+
+    BufferData* buf = ctx->m_shared->getBufferData(boundBuffer);
+    SET_ERROR_IF(!buf, GL_INVALID_VALUE);
+    SET_ERROR_IF(!buf->m_mapped, GL_INVALID_OPERATION);
+    SET_ERROR_IF(!(buf->m_mappedAccess & GL_MAP_FLUSH_EXPLICIT_BIT), GL_INVALID_OPERATION);
+
+    SET_ERROR_IF(offset < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(length < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(offset + length > buf->m_mappedLength, GL_INVALID_VALUE);
+
+    GLintptr totalOffset = buf->m_mappedOffset + offset;
+
+    buf->m_indexRangeCache.invalidateRange(totalOffset, length);
+
+    if (ctx->m_hasAsyncUnmapBuffer) {
+        ctx->glFlushMappedBufferRangeAEMU2(
+                ctx, target,
+                totalOffset,
+                length,
+                buf->m_mappedAccess,
+                &buf->m_fixedBuffer[totalOffset]);
+    } else {
+        ctx->glFlushMappedBufferRangeAEMU(
+                ctx, target,
+                totalOffset,
+                length,
+                buf->m_mappedAccess,
+                &buf->m_fixedBuffer[totalOffset]);
+    }
+}
+
+void GL2Encoder::s_glCompressedTexImage2D(void* self, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    SET_ERROR_IF(!GLESv2Validation::textureTarget(ctx, target), GL_INVALID_ENUM);
+    SET_ERROR_IF(target == GL_TEXTURE_CUBE_MAP, GL_INVALID_ENUM);
+    fprintf(stderr, "%s: format: 0x%x\n", __func__, internalformat);
+    // Filter compressed formats support.
+    SET_ERROR_IF(!GLESv2Validation::supportedCompressedFormat(ctx, internalformat), GL_INVALID_ENUM);
+    // Verify level <= log2(GL_MAX_TEXTURE_SIZE).
+    GLint max_texture_size;
+    GLint max_cube_map_texture_size;
+    ctx->glGetIntegerv(ctx, GL_MAX_TEXTURE_SIZE, &max_texture_size);
+    ctx->glGetIntegerv(ctx, GL_MAX_CUBE_MAP_TEXTURE_SIZE, &max_cube_map_texture_size);
+    SET_ERROR_IF(level < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(level > ilog2(max_texture_size), GL_INVALID_VALUE);
+    SET_ERROR_IF(level > ilog2(max_cube_map_texture_size), GL_INVALID_VALUE);
+    SET_ERROR_IF(width > max_texture_size, GL_INVALID_VALUE);
+    SET_ERROR_IF(height > max_texture_size, GL_INVALID_VALUE);
+    SET_ERROR_IF(border, GL_INVALID_VALUE);
+    // If unpack buffer is nonzero, verify unmapped state.
+    SET_ERROR_IF(ctx->isBufferTargetMapped(GL_PIXEL_UNPACK_BUFFER), GL_INVALID_OPERATION);
+    SET_ERROR_IF(width < 0 || height < 0, GL_INVALID_VALUE);
+
+    // If unpack buffer is nonzero, verify buffer data fits.
+    SET_ERROR_IF(ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) &&
+                 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER) &&
+                 (imageSize > ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER)->m_size),
+                 GL_INVALID_OPERATION);
+    SET_ERROR_IF(!ctx->m_state->compressedTexImageSizeCompatible(internalformat, width, height, 1, imageSize), GL_INVALID_VALUE);
+
+    GLenum stateTarget = target;
+    if (target == GL_TEXTURE_CUBE_MAP_POSITIVE_X ||
+        target == GL_TEXTURE_CUBE_MAP_POSITIVE_Y ||
+        target == GL_TEXTURE_CUBE_MAP_POSITIVE_Z ||
+        target == GL_TEXTURE_CUBE_MAP_NEGATIVE_X ||
+        target == GL_TEXTURE_CUBE_MAP_NEGATIVE_Y ||
+        target == GL_TEXTURE_CUBE_MAP_NEGATIVE_Z)
+        stateTarget = GL_TEXTURE_CUBE_MAP;
+    state->setBoundTextureInternalFormat(stateTarget, (GLint)internalformat);
+    state->setBoundTextureDims(stateTarget, target, level, width, height, 1);
+
+    if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
+        ctx->override2DTextureTarget(target);
+    }
+
+    if (ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER)) {
+        ctx->glCompressedTexImage2DOffsetAEMU(
+                ctx, target, level, internalformat,
+                width, height, border,
+                imageSize, (uintptr_t)data);
+    } else {
+        ctx->m_glCompressedTexImage2D_enc(
+                ctx, target, level, internalformat,
+                width, height, border,
+                imageSize, data);
+    }
+
+    if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
+        ctx->restore2DTextureTarget(target);
+    }
+}
+
+void GL2Encoder::s_glCompressedTexSubImage2D(void* self, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+
+    SET_ERROR_IF(!GLESv2Validation::textureTarget(ctx, target), GL_INVALID_ENUM);
+    SET_ERROR_IF(target == GL_TEXTURE_CUBE_MAP, GL_INVALID_ENUM);
+    // If unpack buffer is nonzero, verify unmapped state.
+    SET_ERROR_IF(ctx->isBufferTargetMapped(GL_PIXEL_UNPACK_BUFFER), GL_INVALID_OPERATION);
+
+    GLenum stateTarget = target;
+    if (target == GL_TEXTURE_CUBE_MAP_POSITIVE_X ||
+        target == GL_TEXTURE_CUBE_MAP_POSITIVE_Y ||
+        target == GL_TEXTURE_CUBE_MAP_POSITIVE_Z ||
+        target == GL_TEXTURE_CUBE_MAP_NEGATIVE_X ||
+        target == GL_TEXTURE_CUBE_MAP_NEGATIVE_Y ||
+        target == GL_TEXTURE_CUBE_MAP_NEGATIVE_Z)
+        stateTarget = GL_TEXTURE_CUBE_MAP;
+    GLuint tex = ctx->m_state->getBoundTexture(stateTarget);
+
+    GLint internalFormat = ctx->m_state->queryTexInternalFormat(tex);
+    SET_ERROR_IF(internalFormat != format, GL_INVALID_OPERATION);
+    SET_ERROR_IF(level < 0, GL_INVALID_VALUE);
+
+    GLint max_texture_size;
+    GLint max_cube_map_texture_size;
+    ctx->glGetIntegerv(ctx, GL_MAX_TEXTURE_SIZE, &max_texture_size);
+    ctx->glGetIntegerv(ctx, GL_MAX_CUBE_MAP_TEXTURE_SIZE, &max_cube_map_texture_size);
+    SET_ERROR_IF(level > ilog2(max_texture_size), GL_INVALID_VALUE);
+    SET_ERROR_IF(level > ilog2(max_cube_map_texture_size), GL_INVALID_VALUE);
+    SET_ERROR_IF(width < 0 || height < 0, GL_INVALID_VALUE);
+    // If unpack buffer is nonzero, verify buffer data fits.
+    SET_ERROR_IF(ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) &&
+                 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER) &&
+                 (imageSize > ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER)->m_size),
+                 GL_INVALID_OPERATION);
+    SET_ERROR_IF(xoffset < 0 || yoffset < 0, GL_INVALID_VALUE);
+
+    GLint totalWidth = ctx->m_state->queryTexWidth(level, tex);
+    GLint totalHeight = ctx->m_state->queryTexHeight(level, tex);
+
+    if (GLESTextureUtils::isEtc2Format(internalFormat)) {
+        SET_ERROR_IF((width % 4) && (totalWidth != xoffset + width), GL_INVALID_OPERATION);
+        SET_ERROR_IF((height % 4) && (totalHeight != yoffset + height), GL_INVALID_OPERATION);
+        SET_ERROR_IF((xoffset % 4) || (yoffset % 4), GL_INVALID_OPERATION);
+    }
+
+    SET_ERROR_IF(totalWidth < xoffset + width, GL_INVALID_VALUE);
+    SET_ERROR_IF(totalHeight < yoffset + height, GL_INVALID_VALUE);
+
+    SET_ERROR_IF(!ctx->m_state->compressedTexImageSizeCompatible(internalFormat, width, height, 1, imageSize), GL_INVALID_VALUE);
+
+    if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
+        ctx->override2DTextureTarget(target);
+    }
+
+    if (ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER)) {
+        ctx->glCompressedTexSubImage2DOffsetAEMU(
+                ctx, target, level,
+                xoffset, yoffset,
+                width, height, format,
+                imageSize, (uintptr_t)data);
+    } else {
+        ctx->m_glCompressedTexSubImage2D_enc(
+                ctx, target, level,
+                xoffset, yoffset,
+                width, height, format,
+                imageSize, data);
+    }
+
+    if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
+        ctx->restore2DTextureTarget(target);
+    }
+}
+
+void GL2Encoder::s_glBindBufferRange(void* self, GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    SET_ERROR_IF(!GLESv2Validation::bufferTarget(ctx, target), GL_INVALID_ENUM);
+
+    // Only works with certain targets
+    SET_ERROR_IF(
+        !(target == GL_ATOMIC_COUNTER_BUFFER ||
+          target == GL_SHADER_STORAGE_BUFFER ||
+          target == GL_TRANSFORM_FEEDBACK_BUFFER ||
+          target == GL_UNIFORM_BUFFER),
+        GL_INVALID_ENUM);
+
+    // Can't exceed range
+    SET_ERROR_IF(index < 0 ||
+                 index >= state->getMaxIndexedBufferBindings(target),
+                 GL_INVALID_VALUE);
+    SET_ERROR_IF(buffer && size <= 0, GL_INVALID_VALUE);
+    SET_ERROR_IF((target == GL_ATOMIC_COUNTER_BUFFER ||
+                  target == GL_TRANSFORM_FEEDBACK_BUFFER) &&
+                 (size % 4 || offset % 4),
+                 GL_INVALID_VALUE);
+
+    GLint ssbo_offset_align, ubo_offset_align;
+
+    if (ctx->majorVersion() >= 3 && ctx->minorVersion() >= 1) {
+        ctx->s_glGetIntegerv(ctx, GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT, &ssbo_offset_align);
+        SET_ERROR_IF(target == GL_SHADER_STORAGE_BUFFER &&
+                     offset % ssbo_offset_align,
+                     GL_INVALID_VALUE);
+    }
+
+    ctx->s_glGetIntegerv(ctx, GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &ubo_offset_align);
+    SET_ERROR_IF(target == GL_UNIFORM_BUFFER &&
+                 offset % ubo_offset_align,
+                 GL_INVALID_VALUE);
+
+    if (ctx->m_state->isIndexedBindNoOp(target, index, buffer, offset, size, 0, 0)) return;
+
+    state->bindBuffer(target, buffer);
+    ctx->m_state->addBuffer(buffer);
+    state->bindIndexedBuffer(target, index, buffer, offset, size, 0, 0);
+
+    ctx->m_glBindBufferRange_enc(ctx, target, index, buffer, offset, size);
+    ctx->m_state->setLastEncodedBufferBind(target, buffer);
+}
+
+void GL2Encoder::s_glBindBufferBase(void* self, GLenum target, GLuint index, GLuint buffer) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    SET_ERROR_IF(!GLESv2Validation::bufferTarget(ctx, target), GL_INVALID_ENUM);
+
+    // Only works with certain targets
+    SET_ERROR_IF(
+        !(target == GL_ATOMIC_COUNTER_BUFFER ||
+          target == GL_SHADER_STORAGE_BUFFER ||
+          target == GL_TRANSFORM_FEEDBACK_BUFFER ||
+          target == GL_UNIFORM_BUFFER),
+        GL_INVALID_ENUM);
+    // Can't exceed range
+    SET_ERROR_IF(index < 0 ||
+                 index >= state->getMaxIndexedBufferBindings(target),
+                 GL_INVALID_VALUE);
+
+    BufferData* buf = ctx->getBufferDataById(buffer);
+    GLsizeiptr size = buf ? buf->m_size : 0;
+
+    if (ctx->m_state->isIndexedBindNoOp(target, index, buffer, 0, size, 0, 0)) return;
+
+    state->bindBuffer(target, buffer);
+    ctx->m_state->addBuffer(buffer);
+
+    state->bindIndexedBuffer(target, index, buffer, 0, size, 0, 0);
+
+    ctx->m_glBindBufferBase_enc(ctx, target, index, buffer);
+    ctx->m_state->setLastEncodedBufferBind(target, buffer);
+}
+
+void GL2Encoder::doIndexedBufferBindEncodeCached(IndexedBufferBindOp op, GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size, GLintptr stride, GLintptr effectiveStride)
+{
+    if (m_state->isIndexedBindNoOp(target, index, buffer, offset, size, stride, effectiveStride)) return;
+
+    switch (op) {
+        case BindBufferBase:
+            // can emulate with bindBufferRange
+        case BindBufferRange:
+            m_glBindBufferRange_enc(this, target, index, buffer, offset, size);
+            break;
+        // TODO: other ops
+    }
+
+    m_state->setLastEncodedBufferBind(target, buffer);
+}
+
+void GL2Encoder::s_glCopyBufferSubData(void *self , GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+
+    SET_ERROR_IF(!GLESv2Validation::bufferTarget(ctx, readtarget), GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::bufferTarget(ctx, writetarget), GL_INVALID_ENUM);
+    SET_ERROR_IF((readtarget == GL_ATOMIC_COUNTER_BUFFER ||
+                  readtarget == GL_DISPATCH_INDIRECT_BUFFER ||
+                  readtarget == GL_DRAW_INDIRECT_BUFFER ||
+                  readtarget == GL_SHADER_STORAGE_BUFFER), GL_INVALID_ENUM);
+    SET_ERROR_IF((writetarget == GL_ATOMIC_COUNTER_BUFFER ||
+                  writetarget == GL_DISPATCH_INDIRECT_BUFFER ||
+                  writetarget == GL_DRAW_INDIRECT_BUFFER ||
+                  writetarget == GL_SHADER_STORAGE_BUFFER), GL_INVALID_ENUM);
+
+    GLuint readBufferId = ctx->boundBuffer(readtarget);
+    GLuint writeBufferId = ctx->boundBuffer(writetarget);
+
+    SET_ERROR_IF(!readBufferId || !writeBufferId, GL_INVALID_OPERATION);
+
+    SET_ERROR_IF(ctx->isBufferTargetMapped(readtarget), GL_INVALID_OPERATION);
+    SET_ERROR_IF(ctx->isBufferTargetMapped(writetarget), GL_INVALID_OPERATION);
+
+    SET_ERROR_IF(readoffset < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(writeoffset < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(size < 0, GL_INVALID_VALUE);
+
+    BufferData* readBufferData = ctx->getBufferData(readtarget);
+    BufferData* writeBufferData = ctx->getBufferData(writetarget);
+
+    SET_ERROR_IF(
+        readBufferData &&
+        (readoffset + size > readBufferData->m_size),
+        GL_INVALID_VALUE);
+
+    SET_ERROR_IF(
+        writeBufferData &&
+        (writeoffset + size > writeBufferData->m_size),
+        GL_INVALID_VALUE);
+
+    SET_ERROR_IF(readBufferId == writeBufferId &&
+                 !((writeoffset >= readoffset + size) ||
+                   (readoffset >= writeoffset + size)),
+                 GL_INVALID_VALUE);
+
+    ctx->m_glCopyBufferSubData_enc(self, readtarget, writetarget, readoffset, writeoffset, size);
+}
+
+void GL2Encoder::s_glGetBufferParameteriv(void* self, GLenum target, GLenum pname, GLint* params) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+
+    SET_ERROR_IF(!GLESv2Validation::bufferTarget(ctx, target), GL_INVALID_ENUM);
+    SET_ERROR_IF(
+        target != GL_ARRAY_BUFFER &&
+        target != GL_ELEMENT_ARRAY_BUFFER &&
+        target != GL_COPY_READ_BUFFER &&
+        target != GL_COPY_WRITE_BUFFER &&
+        target != GL_PIXEL_PACK_BUFFER &&
+        target != GL_PIXEL_UNPACK_BUFFER &&
+        target != GL_TRANSFORM_FEEDBACK_BUFFER &&
+        target != GL_UNIFORM_BUFFER,
+        GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::bufferParam(ctx, pname), GL_INVALID_ENUM);
+    SET_ERROR_IF(!ctx->boundBuffer(target), GL_INVALID_OPERATION);
+    SET_ERROR_IF(pname != GL_BUFFER_ACCESS_FLAGS &&
+                 pname != GL_BUFFER_MAPPED &&
+                 pname != GL_BUFFER_SIZE &&
+                 pname != GL_BUFFER_USAGE &&
+                 pname != GL_BUFFER_MAP_LENGTH &&
+                 pname != GL_BUFFER_MAP_OFFSET,
+                 GL_INVALID_ENUM);
+
+    if (!params) return;
+
+    BufferData* buf = ctx->getBufferData(target);
+
+    switch (pname) {
+        case GL_BUFFER_ACCESS_FLAGS:
+            *params = buf ? buf->m_mappedAccess : 0;
+            break;
+        case GL_BUFFER_MAPPED:
+            *params = buf ? (buf->m_mapped ? GL_TRUE : GL_FALSE) : GL_FALSE;
+            break;
+        case GL_BUFFER_SIZE:
+            *params = buf ? buf->m_size : 0;
+            break;
+        case GL_BUFFER_USAGE:
+            *params = buf ? buf->m_usage : GL_STATIC_DRAW;
+            break;
+        case GL_BUFFER_MAP_LENGTH:
+            *params = buf ? buf->m_mappedLength : 0;
+            break;
+        case GL_BUFFER_MAP_OFFSET:
+            *params = buf ? buf->m_mappedOffset : 0;
+            break;
+        default:
+            break;
+    }
+}
+
+void GL2Encoder::s_glGetBufferParameteri64v(void* self, GLenum target, GLenum pname, GLint64* params) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+
+    SET_ERROR_IF(!GLESv2Validation::bufferTarget(ctx, target), GL_INVALID_ENUM);
+    SET_ERROR_IF(
+        target != GL_ARRAY_BUFFER &&
+        target != GL_ELEMENT_ARRAY_BUFFER &&
+        target != GL_COPY_READ_BUFFER &&
+        target != GL_COPY_WRITE_BUFFER &&
+        target != GL_PIXEL_PACK_BUFFER &&
+        target != GL_PIXEL_UNPACK_BUFFER &&
+        target != GL_TRANSFORM_FEEDBACK_BUFFER &&
+        target != GL_UNIFORM_BUFFER,
+        GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::bufferParam(ctx, pname), GL_INVALID_ENUM);
+    SET_ERROR_IF(!ctx->boundBuffer(target), GL_INVALID_OPERATION);
+    SET_ERROR_IF(pname != GL_BUFFER_ACCESS_FLAGS &&
+                 pname != GL_BUFFER_MAPPED &&
+                 pname != GL_BUFFER_SIZE &&
+                 pname != GL_BUFFER_USAGE &&
+                 pname != GL_BUFFER_MAP_LENGTH &&
+                 pname != GL_BUFFER_MAP_OFFSET,
+                 GL_INVALID_ENUM);
+
+    if (!params) return;
+
+    BufferData* buf = ctx->getBufferData(target);
+
+    switch (pname) {
+        case GL_BUFFER_ACCESS_FLAGS:
+            *params = buf ? buf->m_mappedAccess : 0;
+            break;
+        case GL_BUFFER_MAPPED:
+            *params = buf ? (buf->m_mapped ? GL_TRUE : GL_FALSE) : GL_FALSE;
+            break;
+        case GL_BUFFER_SIZE:
+            *params = buf ? buf->m_size : 0;
+            break;
+        case GL_BUFFER_USAGE:
+            *params = buf ? buf->m_usage : GL_STATIC_DRAW;
+            break;
+        case GL_BUFFER_MAP_LENGTH:
+            *params = buf ? buf->m_mappedLength : 0;
+            break;
+        case GL_BUFFER_MAP_OFFSET:
+            *params = buf ? buf->m_mappedOffset : 0;
+            break;
+        default:
+            break;
+    }
+}
+
+void GL2Encoder::s_glGetBufferPointerv(void* self, GLenum target, GLenum pname, GLvoid** params) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(!GLESv2Validation::bufferTarget(ctx, target), GL_INVALID_ENUM);
+    SET_ERROR_IF(
+        target == GL_ATOMIC_COUNTER_BUFFER ||
+        target == GL_DISPATCH_INDIRECT_BUFFER ||
+        target == GL_DRAW_INDIRECT_BUFFER ||
+        target == GL_SHADER_STORAGE_BUFFER,
+        GL_INVALID_ENUM);
+    SET_ERROR_IF(pname != GL_BUFFER_MAP_POINTER, GL_INVALID_ENUM);
+    SET_ERROR_IF(!ctx->boundBuffer(target), GL_INVALID_OPERATION);
+    if (!params) return;
+
+    BufferData* buf = ctx->getBufferData(target);
+
+    if (!buf || !buf->m_mapped) { *params = NULL; return; }
+
+    *params = &buf->m_fixedBuffer[buf->m_mappedOffset];
+}
+
+static const char* const kNameDelimiter = ";";
+
+static std::string packVarNames(GLsizei count, const char** names, GLint* err_out) {
+
+#define VALIDATE(cond, err) if (cond) { *err_out = err; return packed; } \
+
+    std::string packed;
+    // validate the array of char[]'s
+    const char* currName;
+    for (GLsizei i = 0; i < count; i++) {
+        currName = names[i];
+        VALIDATE(!currName, GL_INVALID_OPERATION);
+        // check if has reasonable size
+        size_t len = strlen(currName);
+        VALIDATE(!len, GL_INVALID_OPERATION);
+        // check for our delimiter, which if present
+        // in the name, means an invalid name anyway.
+        VALIDATE(strstr(currName, kNameDelimiter),
+                 GL_INVALID_OPERATION);
+        packed += currName;
+        packed += ";";
+    }
+
+    *err_out = GL_NO_ERROR;
+    return packed;
+}
+
+void GL2Encoder::s_glGetUniformIndices(void* self, GLuint program, GLsizei uniformCount, const GLchar ** uniformNames, GLuint* uniformIndices) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+
+    VALIDATE_PROGRAM_NAME(program);
+
+    if (!uniformCount) return;
+
+    GLint err = GL_NO_ERROR;
+    std::string packed = packVarNames(uniformCount, (const char**)uniformNames, &err);
+    SET_ERROR_IF(err != GL_NO_ERROR, GL_INVALID_OPERATION);
+
+    std::vector<int> arrIndices;
+    for (size_t i = 0; i < uniformCount; i++) {
+        int err;
+        arrIndices.push_back(sArrIndexOfUniformExpr(uniformNames[i], &err));
+        if (err) {
+            ALOGE("%s: invalid uniform name %s!", __FUNCTION__, uniformNames[i]);
+            return;
+        }
+    }
+
+    ctx->glGetUniformIndicesAEMU(ctx, program, uniformCount, (const GLchar*)&packed[0], packed.size() + 1, uniformIndices);
+}
+
+void GL2Encoder::s_glUniform1ui(void* self, GLint location, GLuint v0) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+    GLSharedGroupPtr shared = ctx->m_shared;
+
+    ctx->m_state->validateUniform(false /* is float? */, true /* is unsigned? */, 1 /* columns */, 1 /* rows */, location, 1 /* count */, ctx->getErrorPtr());
+    ctx->m_glUniform1ui_enc(self, location, v0);
+
+    GLenum target;
+    if (shared->setSamplerUniform(state->currentShaderProgram(), location, v0, &target)) {
+        GLenum origActiveTexture = state->getActiveTextureUnit();
+        if (ctx->updateHostTexture2DBinding(GL_TEXTURE0 + v0, target)) {
+            ctx->m_glActiveTexture_enc(self, origActiveTexture);
+        }
+        state->setActiveTextureUnit(origActiveTexture);
+    }
+}
+
+void GL2Encoder::s_glUniform2ui(void* self, GLint location, GLuint v0, GLuint v1) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(false /* is float? */, true /* is unsigned? */, 2 /* columns */, 1 /* rows */, location, 1 /* count */, ctx->getErrorPtr());
+    ctx->m_glUniform2ui_enc(self, location, v0, v1);
+}
+
+void GL2Encoder::s_glUniform3ui(void* self, GLint location, GLuint v0, GLuint v1, GLuint v2) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(false /* is float? */, true /* is unsigned? */, 3 /* columns */, 1 /* rows */, location, 1 /* count */, ctx->getErrorPtr());
+    ctx->m_glUniform3ui_enc(self, location, v0, v1, v2);
+}
+
+void GL2Encoder::s_glUniform4ui(void* self, GLint location, GLint v0, GLuint v1, GLuint v2, GLuint v3) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(false /* is float? */, true /* is unsigned? */, 4 /* columns */, 1 /* rows */, location, 1 /* count */, ctx->getErrorPtr());
+    ctx->m_glUniform4ui_enc(self, location, v0, v1, v2, v3);
+}
+
+void GL2Encoder::s_glUniform1uiv(void* self, GLint location, GLsizei count, const GLuint *value) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(false /* is float? */, true /* is unsigned? */, 1 /* columns */, 1 /* rows */, location, count /* count */, ctx->getErrorPtr());
+    ctx->m_glUniform1uiv_enc(self, location, count, value);
+}
+
+void GL2Encoder::s_glUniform2uiv(void* self, GLint location, GLsizei count, const GLuint *value) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(false /* is float? */, true /* is unsigned? */, 2 /* columns */, 1 /* rows */, location, count /* count */, ctx->getErrorPtr());
+    ctx->m_glUniform2uiv_enc(self, location, count, value);
+}
+
+void GL2Encoder::s_glUniform3uiv(void* self, GLint location, GLsizei count, const GLuint *value) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(false /* is float? */, true /* is unsigned? */, 3 /* columns */, 1 /* rows */, location, count /* count */, ctx->getErrorPtr());
+    ctx->m_glUniform3uiv_enc(self, location, count, value);
+}
+
+void GL2Encoder::s_glUniform4uiv(void* self, GLint location, GLsizei count, const GLuint *value) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(false /* is float? */, true /* is unsigned? */, 4 /* columns */, 1 /* rows */, location, count /* count */, ctx->getErrorPtr());
+    ctx->m_glUniform4uiv_enc(self, location, count, value);
+}
+
+void GL2Encoder::s_glUniformMatrix2x3fv(void* self, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(true /* is float? */, false /* is unsigned? */, 2 /* columns */, 3 /* rows */, location, count /* count */, ctx->getErrorPtr());
+    ctx->m_glUniformMatrix2x3fv_enc(self, location, count, transpose, value);
+}
+
+void GL2Encoder::s_glUniformMatrix3x2fv(void* self, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(true /* is float? */, false /* is unsigned? */, 3 /* columns */, 2 /* rows */, location, count /* count */, ctx->getErrorPtr());
+    ctx->m_glUniformMatrix3x2fv_enc(self, location, count, transpose, value);
+}
+
+void GL2Encoder::s_glUniformMatrix2x4fv(void* self, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(true /* is float? */, false /* is unsigned? */, 2 /* columns */, 4 /* rows */, location, count /* count */, ctx->getErrorPtr());
+    ctx->m_glUniformMatrix2x4fv_enc(self, location, count, transpose, value);
+}
+
+void GL2Encoder::s_glUniformMatrix4x2fv(void* self, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(true /* is float? */, false /* is unsigned? */, 4 /* columns */, 2 /* rows */, location, count /* count */, ctx->getErrorPtr());
+    ctx->m_glUniformMatrix4x2fv_enc(self, location, count, transpose, value);
+}
+
+void GL2Encoder::s_glUniformMatrix3x4fv(void* self, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(true /* is float? */, false /* is unsigned? */, 3 /* columns */, 4 /* rows */, location, count /* count */, ctx->getErrorPtr());
+    ctx->m_glUniformMatrix3x4fv_enc(self, location, count, transpose, value);
+}
+
+void GL2Encoder::s_glUniformMatrix4x3fv(void* self, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->validateUniform(true /* is float? */, false /* is unsigned? */, 4 /* columns */, 3 /* rows */, location, count /* count */, ctx->getErrorPtr());
+    ctx->m_glUniformMatrix4x3fv_enc(self, location, count, transpose, value);
+}
+
+void GL2Encoder::s_glGetUniformuiv(void* self, GLuint program, GLint location, GLuint* params) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(!ctx->m_shared->isShaderOrProgramObject(program), GL_INVALID_VALUE);
+    SET_ERROR_IF(!ctx->m_shared->isProgram(program), GL_INVALID_OPERATION);
+    SET_ERROR_IF(!ctx->m_shared->isProgramInitialized(program), GL_INVALID_OPERATION);
+    SET_ERROR_IF(ctx->m_shared->getProgramUniformType(program,location)==0, GL_INVALID_OPERATION);
+    SET_ERROR_IF(!ctx->m_shared->isProgramUniformLocationValid(program,location), GL_INVALID_OPERATION);
+    ctx->m_glGetUniformuiv_enc(self, program, location, params);
+}
+
+void GL2Encoder::s_glGetActiveUniformBlockiv(void* self, GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+
+    VALIDATE_PROGRAM_NAME(program);
+    SET_ERROR_IF(!GLESv2Validation::allowedGetActiveUniformBlock(pname), GL_INVALID_ENUM);
+    SET_ERROR_IF(uniformBlockIndex >= ctx->m_shared->getActiveUniformBlockCount(program), GL_INVALID_VALUE);
+
+    // refresh client state's # active uniforms in this block
+    if (pname == GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES) {
+        // TODO if worth it: cache uniform count and other params,
+        // invalidate on program relinking.
+        GLint numActiveUniforms;
+        ctx->m_glGetActiveUniformBlockiv_enc(ctx,
+                program, uniformBlockIndex,
+                GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS,
+                &numActiveUniforms);
+        ctx->m_state->setNumActiveUniformsInUniformBlock(
+                program, uniformBlockIndex, numActiveUniforms);
+    }
+
+    ctx->m_glGetActiveUniformBlockiv_enc(ctx,
+            program, uniformBlockIndex,
+            pname, params);
+}
+
+void GL2Encoder::s_glGetVertexAttribIiv(void* self, GLuint index, GLenum pname, GLint* params) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    VALIDATE_VERTEX_ATTRIB_INDEX(index);
+    SET_ERROR_IF(!GLESv2Validation::allowedGetVertexAttrib(pname), GL_INVALID_ENUM);
+
+    if (!ctx->m_state->getVertexAttribParameter<GLint>(index, pname, params)) {
+        ctx->m_glGetVertexAttribIiv_enc(self, index, pname, params);
+    }
+}
+
+void GL2Encoder::s_glGetVertexAttribIuiv(void* self, GLuint index, GLenum pname, GLuint* params) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    VALIDATE_VERTEX_ATTRIB_INDEX(index);
+    SET_ERROR_IF(!GLESv2Validation::allowedGetVertexAttrib(pname), GL_INVALID_ENUM);
+
+    if (!ctx->m_state->getVertexAttribParameter<GLuint>(index, pname, params)) {
+        ctx->m_glGetVertexAttribIuiv_enc(self, index, pname, params);
+    }
+}
+
+void GL2Encoder::s_glVertexAttribIPointer(void* self, GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    assert(ctx->m_state != NULL);
+    VALIDATE_VERTEX_ATTRIB_INDEX(index);
+    SET_ERROR_IF((size < 1 || size > 4), GL_INVALID_VALUE);
+    SET_ERROR_IF(
+        !(type == GL_BYTE ||
+          type == GL_UNSIGNED_BYTE ||
+          type == GL_SHORT ||
+          type == GL_UNSIGNED_SHORT ||
+          type == GL_INT ||
+          type == GL_UNSIGNED_INT),
+        GL_INVALID_ENUM);
+    SET_ERROR_IF(stride < 0, GL_INVALID_VALUE);
+
+    ctx->m_state->setVertexAttribBinding(index, index);
+    ctx->m_state->setVertexAttribFormat(index, size, type, false, 0, true);
+    GLsizei effectiveStride = stride;
+    if (stride == 0) {
+        effectiveStride = glSizeof(type) * size;
+    }
+    ctx->m_state->bindIndexedBuffer(0, index, ctx->m_state->currentArrayVbo(), (uintptr_t)pointer, 0, stride, effectiveStride);
+
+    if (ctx->m_state->currentArrayVbo() != 0) {
+        ctx->glVertexAttribIPointerOffsetAEMU(ctx, index, size, type, stride, (uintptr_t)pointer);
+    } else {
+        SET_ERROR_IF(ctx->m_state->currentVertexArrayObject() != 0 && pointer, GL_INVALID_OPERATION);
+        // wait for client-array handler
+    }
+}
+
+void GL2Encoder::s_glVertexAttribDivisor(void* self, GLuint index, GLuint divisor) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    assert(ctx->m_state != NULL);
+    VALIDATE_VERTEX_ATTRIB_INDEX(index);
+    ctx->m_state->setVertexAttribBinding(index, index);
+    ctx->m_state->setVertexBindingDivisor(index, divisor);
+    ctx->m_glVertexAttribDivisor_enc(ctx, index, divisor);
+}
+
+void GL2Encoder::s_glRenderbufferStorageMultisample(void* self,
+        GLenum target, GLsizei samples, GLenum internalformat,
+        GLsizei width, GLsizei height) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    GLClientState* state = ctx->m_state;
+
+    SET_ERROR_IF(target != GL_RENDERBUFFER, GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::rboFormat(ctx, internalformat), GL_INVALID_ENUM);
+
+    SET_ERROR_IF(width < 0 || height < 0, GL_INVALID_VALUE);
+    GLint max_rb_size;
+    ctx->glGetIntegerv(ctx, GL_MAX_RENDERBUFFER_SIZE, &max_rb_size);
+    SET_ERROR_IF(width > max_rb_size || height > max_rb_size, GL_INVALID_VALUE);
+
+    GLint max_samples;
+    ctx->s_glGetInternalformativ(ctx, target, internalformat, GL_SAMPLES, 1, &max_samples);
+    SET_ERROR_IF(samples > max_samples, GL_INVALID_OPERATION);
+
+    state->setBoundRenderbufferFormat(internalformat);
+    state->setBoundRenderbufferSamples(samples);
+    state->setBoundRenderbufferDimensions(width, height);
+    ctx->m_glRenderbufferStorageMultisample_enc(
+            self, target, samples, internalformat, width, height);
+}
+
+void GL2Encoder::s_glDrawBuffers(void* self, GLsizei n, const GLenum* bufs) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(!ctx->m_state->boundFramebuffer(GL_DRAW_FRAMEBUFFER) && n > 1, GL_INVALID_OPERATION);
+    SET_ERROR_IF(n < 0 || n > ctx->m_state->getMaxDrawBuffers(), GL_INVALID_VALUE);
+    for (int i = 0; i < n; i++) {
+        SET_ERROR_IF(
+            bufs[i] != GL_NONE &&
+            bufs[i] != GL_BACK &&
+            glUtilsColorAttachmentIndex(bufs[i]) == -1,
+            GL_INVALID_ENUM);
+        SET_ERROR_IF(
+            !ctx->m_state->boundFramebuffer(GL_DRAW_FRAMEBUFFER) &&
+            glUtilsColorAttachmentIndex(bufs[i]) != -1,
+            GL_INVALID_OPERATION);
+        SET_ERROR_IF(
+            ctx->m_state->boundFramebuffer(GL_DRAW_FRAMEBUFFER) &&
+            ((glUtilsColorAttachmentIndex(bufs[i]) != -1 &&
+              glUtilsColorAttachmentIndex(bufs[i]) != i) ||
+             (glUtilsColorAttachmentIndex(bufs[i]) == -1 &&
+              bufs[i] != GL_NONE)),
+            GL_INVALID_OPERATION);
+    }
+
+    ctx->m_glDrawBuffers_enc(ctx, n, bufs);
+}
+
+void GL2Encoder::s_glReadBuffer(void* self, GLenum src) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+
+    SET_ERROR_IF(
+        glUtilsColorAttachmentIndex(src) != -1 &&
+         (glUtilsColorAttachmentIndex(src) >=
+         ctx->m_state->getMaxColorAttachments()),
+        GL_INVALID_OPERATION);
+    SET_ERROR_IF(
+        src != GL_NONE &&
+        src != GL_BACK &&
+        src > GL_COLOR_ATTACHMENT0 &&
+        src < GL_DEPTH_ATTACHMENT &&
+        (src - GL_COLOR_ATTACHMENT0) >
+        ctx->m_state->getMaxColorAttachments(),
+        GL_INVALID_OPERATION);
+    SET_ERROR_IF(
+        src != GL_NONE &&
+        src != GL_BACK &&
+        glUtilsColorAttachmentIndex(src) == -1,
+        GL_INVALID_ENUM);
+    SET_ERROR_IF(
+        !ctx->m_state->boundFramebuffer(GL_READ_FRAMEBUFFER) &&
+        src != GL_NONE &&
+        src != GL_BACK,
+        GL_INVALID_OPERATION);
+    SET_ERROR_IF(
+        ctx->m_state->boundFramebuffer(GL_READ_FRAMEBUFFER) &&
+        src != GL_NONE &&
+        glUtilsColorAttachmentIndex(src) == -1,
+        GL_INVALID_OPERATION);
+
+    ctx->m_glReadBuffer_enc(ctx, src);
+}
+
+void GL2Encoder::s_glFramebufferTextureLayer(void* self, GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    SET_ERROR_IF(!GLESv2Validation::framebufferTarget(ctx, target), GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::framebufferAttachment(ctx, attachment), GL_INVALID_ENUM);
+    SET_ERROR_IF(texture != 0 && layer < 0, GL_INVALID_VALUE);
+    GLint maxArrayTextureLayers;
+    ctx->glGetIntegerv(ctx, GL_MAX_ARRAY_TEXTURE_LAYERS, &maxArrayTextureLayers);
+    SET_ERROR_IF(texture != 0 && layer > maxArrayTextureLayers - 1, GL_INVALID_VALUE);
+    SET_ERROR_IF(!ctx->m_state->boundFramebuffer(target), GL_INVALID_OPERATION);
+    GLenum lastBoundTarget = state->queryTexLastBoundTarget(texture);
+    SET_ERROR_IF(lastBoundTarget != GL_TEXTURE_2D_ARRAY &&
+                 lastBoundTarget != GL_TEXTURE_3D,
+                 GL_INVALID_OPERATION);
+    state->attachTextureObject(target, attachment, texture, level, layer);
+
+    GLint max3DTextureSize;
+    ctx->glGetIntegerv(ctx, GL_MAX_3D_TEXTURE_SIZE, &max3DTextureSize);
+    SET_ERROR_IF(
+            layer >= max3DTextureSize,
+            GL_INVALID_VALUE);
+
+    ctx->m_glFramebufferTextureLayer_enc(self, target, attachment, texture, level, layer);
+}
+
+void GL2Encoder::s_glTexStorage2D(void* self, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    SET_ERROR_IF(
+        target != GL_TEXTURE_2D &&
+        target != GL_TEXTURE_CUBE_MAP,
+        GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::pixelInternalFormat(internalformat), GL_INVALID_ENUM);
+    SET_ERROR_IF(!state->getBoundTexture(target), GL_INVALID_OPERATION);
+    SET_ERROR_IF(levels < 1 || width < 1 || height < 1, GL_INVALID_VALUE);
+    SET_ERROR_IF(levels > ilog2((uint32_t)std::max(width, height)) + 1,
+                 GL_INVALID_OPERATION);
+    SET_ERROR_IF(state->isBoundTextureImmutableFormat(target), GL_INVALID_OPERATION);
+
+    state->setBoundTextureInternalFormat(target, internalformat);
+    state->setBoundTextureDims(target, -1 /* set all cube dimensions */, -1, width, height, 1);
+    state->setBoundTextureImmutableFormat(target);
+
+    if (target == GL_TEXTURE_2D) {
+        ctx->override2DTextureTarget(target);
+    }
+
+    ctx->m_glTexStorage2D_enc(ctx, target, levels, internalformat, width, height);
+
+    if (target == GL_TEXTURE_2D) {
+        ctx->restore2DTextureTarget(target);
+    }
+}
+
+void GL2Encoder::s_glTransformFeedbackVaryings(void* self, GLuint program, GLsizei count, const char** varyings, GLenum bufferMode) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+
+    SET_ERROR_IF(!ctx->m_shared->isProgram(program), GL_INVALID_VALUE);
+
+    GLint maxCount = 0;
+    ctx->glGetIntegerv(ctx, GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, &maxCount);
+
+    SET_ERROR_IF(
+        bufferMode == GL_SEPARATE_ATTRIBS &&
+        maxCount < count,
+        GL_INVALID_VALUE);
+    SET_ERROR_IF(
+        bufferMode != GL_INTERLEAVED_ATTRIBS &&
+        bufferMode != GL_SEPARATE_ATTRIBS,
+        GL_INVALID_ENUM);
+
+    // NOTE: This only has an effect on the program that is being linked.
+    // The dEQP test in dEQP-GLES3.functional.negative_api doesn't know
+    // about this.
+    ctx->m_state->setTransformFeedbackVaryingsCountForLinking(count);
+
+    if (!count) return;
+
+    GLint err = GL_NO_ERROR;
+    std::string packed = packVarNames(count, varyings, &err);
+    SET_ERROR_IF(err != GL_NO_ERROR, GL_INVALID_OPERATION);
+
+    ctx->glTransformFeedbackVaryingsAEMU(ctx, program, count, (const char*)&packed[0], packed.size() + 1, bufferMode);
+}
+
+void GL2Encoder::s_glBeginTransformFeedback(void* self, GLenum primitiveMode) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+    SET_ERROR_IF(
+        primitiveMode != GL_POINTS &&
+        primitiveMode != GL_LINES &&
+        primitiveMode != GL_TRIANGLES,
+        GL_INVALID_ENUM);
+    SET_ERROR_IF(
+        ctx->m_state->getTransformFeedbackActive(),
+        GL_INVALID_OPERATION);
+    // TODO:
+    // dEQP-GLES3.functional.lifetime.attach.deleted_output.buffer_transform_feedback
+    // SET_ERROR_IF(
+    //     !ctx->boundBuffer(GL_TRANSFORM_FEEDBACK_BUFFER),
+    //     GL_INVALID_OPERATION);
+    SET_ERROR_IF(
+        !ctx->m_state->currentProgram(), GL_INVALID_OPERATION);
+    ctx->m_glBeginTransformFeedback_enc(ctx, primitiveMode);
+    state->setTransformFeedbackActive(true);
+    state->setTransformFeedbackUnpaused(true);
+}
+
+void GL2Encoder::s_glEndTransformFeedback(void* self) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+    SET_ERROR_IF(!state->getTransformFeedbackActive(), GL_INVALID_OPERATION);
+    ctx->m_glEndTransformFeedback_enc(ctx);
+    state->setTransformFeedbackActive(false);
+    state->setTransformFeedbackUnpaused(false);
+}
+
+void GL2Encoder::s_glPauseTransformFeedback(void* self) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+    SET_ERROR_IF(!state->getTransformFeedbackActive(), GL_INVALID_OPERATION);
+    SET_ERROR_IF(!state->getTransformFeedbackUnpaused(), GL_INVALID_OPERATION);
+    ctx->m_glPauseTransformFeedback_enc(ctx);
+    state->setTransformFeedbackUnpaused(false);
+}
+
+void GL2Encoder::s_glResumeTransformFeedback(void* self) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+    SET_ERROR_IF(!state->getTransformFeedbackActive(), GL_INVALID_OPERATION);
+    SET_ERROR_IF(state->getTransformFeedbackUnpaused(), GL_INVALID_OPERATION);
+    ctx->m_glResumeTransformFeedback_enc(ctx);
+    state->setTransformFeedbackUnpaused(true);
+}
+
+void GL2Encoder::s_glTexImage3D(void* self, GLenum target, GLint level, GLint internalFormat,
+                               GLsizei width, GLsizei height, GLsizei depth,
+                               GLint border, GLenum format, GLenum type, const GLvoid* data) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    SET_ERROR_IF(target != GL_TEXTURE_3D &&
+                 target != GL_TEXTURE_2D_ARRAY,
+                 GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::pixelType(ctx, type), GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::pixelFormat(ctx, format), GL_INVALID_ENUM);
+    SET_ERROR_IF(!(GLESv2Validation::pixelOp(format,type)),GL_INVALID_OPERATION);
+    SET_ERROR_IF(!GLESv2Validation::pixelSizedFormat(ctx, internalFormat, format, type), GL_INVALID_OPERATION);
+    SET_ERROR_IF(target == GL_TEXTURE_3D &&
+        ((format == GL_DEPTH_COMPONENT) ||
+         (format == GL_DEPTH_STENCIL)), GL_INVALID_OPERATION);
+
+    // If unpack buffer is nonzero, verify unmapped state.
+    SET_ERROR_IF(ctx->isBufferTargetMapped(GL_PIXEL_UNPACK_BUFFER), GL_INVALID_OPERATION);
+
+    GLint max_texture_size;
+    GLint max_3d_texture_size;
+    ctx->glGetIntegerv(ctx, GL_MAX_TEXTURE_SIZE, &max_texture_size);
+    ctx->glGetIntegerv(ctx, GL_MAX_3D_TEXTURE_SIZE, &max_3d_texture_size);
+    SET_ERROR_IF(level < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(level > ilog2(max_texture_size), GL_INVALID_VALUE);
+    SET_ERROR_IF(level > ilog2(max_3d_texture_size), GL_INVALID_VALUE);
+
+    SET_ERROR_IF(width < 0 || height < 0 || depth < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(width > max_texture_size, GL_INVALID_VALUE);
+    SET_ERROR_IF(height > max_texture_size, GL_INVALID_VALUE);
+    if (target == GL_TEXTURE_3D) {
+        SET_ERROR_IF(depth > max_texture_size, GL_INVALID_VALUE);
+    } else {
+        GLint maxArrayTextureLayers;
+        ctx->glGetIntegerv(ctx, GL_MAX_ARRAY_TEXTURE_LAYERS, &maxArrayTextureLayers);
+        SET_ERROR_IF(depth > maxArrayTextureLayers, GL_INVALID_VALUE);
+    }
+    SET_ERROR_IF(width > max_3d_texture_size, GL_INVALID_VALUE);
+    SET_ERROR_IF(height > max_3d_texture_size, GL_INVALID_VALUE);
+    SET_ERROR_IF(depth > max_3d_texture_size, GL_INVALID_VALUE);
+    SET_ERROR_IF(border != 0, GL_INVALID_VALUE);
+    // If unpack buffer is nonzero, verify buffer data fits and is evenly divisible by the type.
+    SET_ERROR_IF(ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) &&
+                 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER) &&
+                 ((uintptr_t)data + ctx->m_state->pboNeededDataSize(width, height, depth, format, type, 0) >
+                  ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER)->m_size),
+                 GL_INVALID_OPERATION);
+    SET_ERROR_IF(ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) &&
+                 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER) &&
+                 ((uintptr_t)data %
+                  glSizeof(type)),
+                 GL_INVALID_OPERATION);
+    SET_ERROR_IF(state->isBoundTextureImmutableFormat(target), GL_INVALID_OPERATION);
+
+    state->setBoundTextureInternalFormat(target, internalFormat);
+    state->setBoundTextureFormat(target, format);
+    state->setBoundTextureType(target, type);
+    state->setBoundTextureDims(target, target, level, width, height, depth);
+
+    if (ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER)) {
+        ctx->glTexImage3DOffsetAEMU(
+                ctx, target, level, internalFormat,
+                width, height, depth,
+                border, format, type, (uintptr_t)data);
+    } else {
+        ctx->m_glTexImage3D_enc(ctx,
+                target, level, internalFormat,
+                width, height, depth,
+                border, format, type, data);
+    }
+}
+
+void GL2Encoder::s_glTexSubImage3D(void* self, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* data) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    SET_ERROR_IF(target != GL_TEXTURE_3D &&
+                 target != GL_TEXTURE_2D_ARRAY,
+                 GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::pixelType(ctx, type), GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::pixelFormat(ctx, format), GL_INVALID_ENUM);
+    // If unpack buffer is nonzero, verify unmapped state.
+    SET_ERROR_IF(ctx->isBufferTargetMapped(GL_PIXEL_UNPACK_BUFFER), GL_INVALID_OPERATION);
+    GLint max_texture_size;
+    GLint max_3d_texture_size;
+    ctx->glGetIntegerv(ctx, GL_MAX_TEXTURE_SIZE, &max_texture_size);
+    ctx->glGetIntegerv(ctx, GL_MAX_3D_TEXTURE_SIZE, &max_3d_texture_size);
+    SET_ERROR_IF(level < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(level > ilog2(max_texture_size), GL_INVALID_VALUE);
+    SET_ERROR_IF(level > ilog2(max_3d_texture_size), GL_INVALID_VALUE);
+    SET_ERROR_IF(width < 0 || height < 0 || depth < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(xoffset < 0 || yoffset < 0 || zoffset < 0, GL_INVALID_VALUE);
+    GLuint tex = state->getBoundTexture(target);
+    GLsizei neededWidth = xoffset + width;
+    GLsizei neededHeight = yoffset + height;
+    GLsizei neededDepth = zoffset + depth;
+
+    SET_ERROR_IF(tex &&
+                 (neededWidth > state->queryTexWidth(level, tex) ||
+                  neededHeight > state->queryTexHeight(level, tex) ||
+                  neededDepth > state->queryTexDepth(level, tex)),
+                 GL_INVALID_VALUE);
+    // If unpack buffer is nonzero, verify buffer data fits and is evenly divisible by the type.
+    SET_ERROR_IF(ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) &&
+                 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER) &&
+                 ((uintptr_t)data + ctx->m_state->pboNeededDataSize(width, height, depth, format, type, 0) >
+                  ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER)->m_size),
+                 GL_INVALID_OPERATION);
+    SET_ERROR_IF(ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) &&
+                 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER) &&
+                 ((uintptr_t)data % glSizeof(type)),
+                 GL_INVALID_OPERATION);
+    SET_ERROR_IF(!ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) && !data, GL_INVALID_OPERATION);
+    SET_ERROR_IF(xoffset < 0 || yoffset < 0 || zoffset < 0, GL_INVALID_VALUE);
+
+    if (ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER)) {
+        ctx->glTexSubImage3DOffsetAEMU(ctx,
+                target, level,
+                xoffset, yoffset, zoffset,
+                width, height, depth,
+                format, type, (uintptr_t)data);
+    } else {
+        ctx->m_glTexSubImage3D_enc(ctx,
+                target, level,
+                xoffset, yoffset, zoffset,
+                width, height, depth,
+                format, type, data);
+    }
+}
+
+void GL2Encoder::s_glCompressedTexImage3D(void* self, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    SET_ERROR_IF(target != GL_TEXTURE_3D &&
+                 target != GL_TEXTURE_2D_ARRAY,
+                 GL_INVALID_ENUM);
+    // Filter compressed formats support.
+    SET_ERROR_IF(!GLESv2Validation::supportedCompressedFormat(ctx, internalformat), GL_INVALID_ENUM);
+    SET_ERROR_IF(target == GL_TEXTURE_CUBE_MAP, GL_INVALID_ENUM);
+    // If unpack buffer is nonzero, verify unmapped state.
+    SET_ERROR_IF(ctx->isBufferTargetMapped(GL_PIXEL_UNPACK_BUFFER), GL_INVALID_OPERATION);
+    SET_ERROR_IF(width < 0 || height < 0 || depth < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(border, GL_INVALID_VALUE);
+
+    GLint max_texture_size;
+    GLint max_3d_texture_size;
+    ctx->glGetIntegerv(ctx, GL_MAX_TEXTURE_SIZE, &max_texture_size);
+    ctx->glGetIntegerv(ctx, GL_MAX_3D_TEXTURE_SIZE, &max_3d_texture_size);
+    SET_ERROR_IF(level < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(level > ilog2(max_texture_size), GL_INVALID_VALUE);
+    SET_ERROR_IF(level > ilog2(max_3d_texture_size), GL_INVALID_VALUE);
+
+    SET_ERROR_IF(width < 0 || height < 0 || depth < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(width > max_texture_size, GL_INVALID_VALUE);
+    SET_ERROR_IF(height > max_texture_size, GL_INVALID_VALUE);
+    if (target == GL_TEXTURE_3D) {
+        SET_ERROR_IF(depth > max_texture_size, GL_INVALID_VALUE);
+    } else {
+        GLint maxArrayTextureLayers;
+        ctx->glGetIntegerv(ctx, GL_MAX_ARRAY_TEXTURE_LAYERS, &maxArrayTextureLayers);
+        SET_ERROR_IF(depth > maxArrayTextureLayers, GL_INVALID_VALUE);
+    }
+    SET_ERROR_IF(width > max_3d_texture_size, GL_INVALID_VALUE);
+    SET_ERROR_IF(height > max_3d_texture_size, GL_INVALID_VALUE);
+    SET_ERROR_IF(depth > max_3d_texture_size, GL_INVALID_VALUE);
+    SET_ERROR_IF(GLESTextureUtils::isAstcFormat(internalformat) && GL_TEXTURE_3D == target, GL_INVALID_OPERATION);
+
+    // If unpack buffer is nonzero, verify buffer data fits.
+    SET_ERROR_IF(ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) &&
+                 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER) &&
+                 (imageSize > ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER)->m_size),
+                 GL_INVALID_OPERATION);
+    SET_ERROR_IF(!ctx->m_state->compressedTexImageSizeCompatible(internalformat, width, height, depth, imageSize), GL_INVALID_VALUE);
+    state->setBoundTextureInternalFormat(target, (GLint)internalformat);
+    state->setBoundTextureDims(target, target, level, width, height, depth);
+
+    if (ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER)) {
+        ctx->glCompressedTexImage3DOffsetAEMU(
+                ctx, target, level, internalformat,
+                width, height, depth, border,
+                imageSize, (uintptr_t)data);
+    } else {
+        ctx->m_glCompressedTexImage3D_enc(
+                ctx, target, level, internalformat,
+                width, height, depth, border,
+                imageSize, data);
+    }
+}
+
+void GL2Encoder::s_glCompressedTexSubImage3D(void* self, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+
+    SET_ERROR_IF(!GLESv2Validation::textureTarget(ctx, target), GL_INVALID_ENUM);
+    SET_ERROR_IF(target == GL_TEXTURE_CUBE_MAP, GL_INVALID_ENUM);
+    // If unpack buffer is nonzero, verify unmapped state.
+    SET_ERROR_IF(ctx->isBufferTargetMapped(GL_PIXEL_UNPACK_BUFFER), GL_INVALID_OPERATION);
+    SET_ERROR_IF(width < 0 || height < 0 || depth < 0, GL_INVALID_VALUE);
+    // If unpack buffer is nonzero, verify buffer data fits.
+    SET_ERROR_IF(ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) &&
+                 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER) &&
+                 (imageSize > ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER)->m_size),
+                 GL_INVALID_OPERATION);
+    SET_ERROR_IF(xoffset < 0 || yoffset < 0 || zoffset < 0, GL_INVALID_VALUE);
+
+    GLint max_texture_size;
+    GLint max_3d_texture_size;
+    ctx->glGetIntegerv(ctx, GL_MAX_TEXTURE_SIZE, &max_texture_size);
+    ctx->glGetIntegerv(ctx, GL_MAX_3D_TEXTURE_SIZE, &max_3d_texture_size);
+    SET_ERROR_IF(level < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(level > ilog2(max_texture_size), GL_INVALID_VALUE);
+    SET_ERROR_IF(level > ilog2(max_3d_texture_size), GL_INVALID_VALUE);
+    SET_ERROR_IF(width < 0 || height < 0 || depth < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(xoffset < 0 || yoffset < 0 || zoffset < 0, GL_INVALID_VALUE);
+    GLenum stateTarget = target;
+    if (target == GL_TEXTURE_CUBE_MAP_POSITIVE_X ||
+        target == GL_TEXTURE_CUBE_MAP_POSITIVE_Y ||
+        target == GL_TEXTURE_CUBE_MAP_POSITIVE_Z ||
+        target == GL_TEXTURE_CUBE_MAP_NEGATIVE_X ||
+        target == GL_TEXTURE_CUBE_MAP_NEGATIVE_Y ||
+        target == GL_TEXTURE_CUBE_MAP_NEGATIVE_Z)
+        stateTarget = GL_TEXTURE_CUBE_MAP;
+
+    GLuint tex = ctx->m_state->getBoundTexture(stateTarget);
+    GLsizei neededWidth = xoffset + width;
+    GLsizei neededHeight = yoffset + height;
+    GLsizei neededDepth = zoffset + depth;
+
+    SET_ERROR_IF(tex &&
+                 (neededWidth > ctx->m_state->queryTexWidth(level, tex) ||
+                  neededHeight > ctx->m_state->queryTexHeight(level, tex) ||
+                  neededDepth > ctx->m_state->queryTexDepth(level, tex)),
+                 GL_INVALID_VALUE);
+
+    GLint internalFormat = ctx->m_state->queryTexInternalFormat(tex);
+    SET_ERROR_IF(internalFormat != format, GL_INVALID_OPERATION);
+
+    GLint totalWidth = ctx->m_state->queryTexWidth(level, tex);
+    GLint totalHeight = ctx->m_state->queryTexHeight(level, tex);
+
+    if (GLESTextureUtils::isEtc2Format(internalFormat)) {
+        SET_ERROR_IF((width % 4) && (totalWidth != xoffset + width), GL_INVALID_OPERATION);
+        SET_ERROR_IF((height % 4) && (totalHeight != yoffset + height), GL_INVALID_OPERATION);
+        SET_ERROR_IF((xoffset % 4) || (yoffset % 4), GL_INVALID_OPERATION);
+    }
+
+    SET_ERROR_IF(totalWidth < xoffset + width, GL_INVALID_VALUE);
+    SET_ERROR_IF(totalHeight < yoffset + height, GL_INVALID_VALUE);
+
+    SET_ERROR_IF(!ctx->m_state->compressedTexImageSizeCompatible(internalFormat, width, height, depth, imageSize), GL_INVALID_VALUE);
+
+    if (ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER)) {
+        ctx->glCompressedTexSubImage3DOffsetAEMU(
+                ctx, target, level,
+                xoffset, yoffset, zoffset,
+                width, height, depth,
+                format, imageSize, (uintptr_t)data);
+    } else {
+        ctx->m_glCompressedTexSubImage3D_enc(
+                ctx, target, level,
+                xoffset, yoffset, zoffset,
+                width, height, depth,
+                format, imageSize, data);
+
+    }
+}
+
+void GL2Encoder::s_glTexStorage3D(void* self, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+    SET_ERROR_IF(target != GL_TEXTURE_3D &&
+                 target != GL_TEXTURE_2D_ARRAY,
+                 GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::pixelInternalFormat(internalformat), GL_INVALID_ENUM);
+    SET_ERROR_IF(!state->getBoundTexture(target), GL_INVALID_OPERATION);
+    SET_ERROR_IF(levels < 1 || width < 1 || height < 1 || depth < 1, GL_INVALID_VALUE);
+    GLint max_texture_size;
+    GLint max_3d_texture_size;
+    ctx->glGetIntegerv(ctx, GL_MAX_TEXTURE_SIZE, &max_texture_size);
+    ctx->glGetIntegerv(ctx, GL_MAX_3D_TEXTURE_SIZE, &max_3d_texture_size);
+    SET_ERROR_IF(width > max_texture_size, GL_INVALID_VALUE);
+    SET_ERROR_IF(height > max_texture_size, GL_INVALID_VALUE);
+    if (target == GL_TEXTURE_3D) {
+        SET_ERROR_IF(depth > max_texture_size, GL_INVALID_VALUE);
+    } else {
+        GLint maxArrayTextureLayers;
+        ctx->glGetIntegerv(ctx, GL_MAX_ARRAY_TEXTURE_LAYERS, &maxArrayTextureLayers);
+        SET_ERROR_IF(depth > maxArrayTextureLayers, GL_INVALID_VALUE);
+    }
+
+    SET_ERROR_IF(width > max_3d_texture_size, GL_INVALID_VALUE);
+    SET_ERROR_IF(height > max_3d_texture_size, GL_INVALID_VALUE);
+    SET_ERROR_IF(depth > max_3d_texture_size, GL_INVALID_VALUE);
+
+    SET_ERROR_IF(GLESTextureUtils::isAstcFormat(internalformat) && GL_TEXTURE_3D == target, GL_INVALID_OPERATION);
+
+    SET_ERROR_IF(target == GL_TEXTURE_3D && (levels > ilog2((uint32_t)std::max(width, std::max(height, depth))) + 1),
+                 GL_INVALID_OPERATION);
+    SET_ERROR_IF(target == GL_TEXTURE_2D_ARRAY && (levels > ilog2((uint32_t)std::max(width, height)) + 1),
+                 GL_INVALID_OPERATION);
+    SET_ERROR_IF(state->isBoundTextureImmutableFormat(target), GL_INVALID_OPERATION);
+
+    state->setBoundTextureInternalFormat(target, internalformat);
+    state->setBoundTextureDims(target, target, -1, width, height, depth);
+    state->setBoundTextureImmutableFormat(target);
+    ctx->m_glTexStorage3D_enc(ctx, target, levels, internalformat, width, height, depth);
+    state->setBoundTextureImmutableFormat(target);
+}
+
+void GL2Encoder::s_glDrawArraysInstanced(void* self, GLenum mode, GLint first, GLsizei count, GLsizei primcount) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    assert(ctx->m_state != NULL);
+    SET_ERROR_IF(!isValidDrawMode(mode), GL_INVALID_ENUM);
+    SET_ERROR_IF(count < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(primcount < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(ctx->m_state->checkFramebufferCompleteness(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE, GL_INVALID_FRAMEBUFFER_OPERATION);
+
+    bool has_client_vertex_arrays = false;
+    bool has_indirect_arrays = false;
+    ctx->getVBOUsage(&has_client_vertex_arrays,
+                     &has_indirect_arrays);
+
+    if (has_client_vertex_arrays ||
+        (!has_client_vertex_arrays &&
+         !has_indirect_arrays)) {
+        ctx->sendVertexAttributes(first, count, true, primcount);
+        ctx->m_glDrawArraysInstanced_enc(ctx, mode, 0, count, primcount);
+    } else {
+        ctx->sendVertexAttributes(0, count, false, primcount);
+        ctx->m_glDrawArraysInstanced_enc(ctx, mode, first, count, primcount);
+    }
+    ctx->m_stream->flush();
+    ctx->m_state->postDraw();
+}
+
+void GL2Encoder::s_glDrawElementsInstanced(void* self, GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount)
+{
+
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    assert(ctx->m_state != NULL);
+    SET_ERROR_IF(!isValidDrawMode(mode), GL_INVALID_ENUM);
+    SET_ERROR_IF(count < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(primcount < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(!(type == GL_UNSIGNED_BYTE || type == GL_UNSIGNED_SHORT || type == GL_UNSIGNED_INT), GL_INVALID_ENUM);
+    SET_ERROR_IF(ctx->m_state->getTransformFeedbackActiveUnpaused(), GL_INVALID_OPERATION);
+    SET_ERROR_IF(ctx->m_state->checkFramebufferCompleteness(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE, GL_INVALID_FRAMEBUFFER_OPERATION);
+
+    bool has_client_vertex_arrays = false;
+    bool has_indirect_arrays = false;
+    GLintptr offset = 0;
+
+    ctx->getVBOUsage(&has_client_vertex_arrays, &has_indirect_arrays);
+
+    if (!has_client_vertex_arrays && !has_indirect_arrays) {
+        // ALOGW("glDrawElements: no vertex arrays / buffers bound to the command\n");
+        GLenum status = ctx->glCheckFramebufferStatus(self, GL_FRAMEBUFFER);
+        SET_ERROR_IF(status != GL_FRAMEBUFFER_COMPLETE, GL_INVALID_FRAMEBUFFER_OPERATION);
+    }
+
+    BufferData* buf = NULL;
+    int minIndex = 0, maxIndex = 0;
+
+    // For validation/immediate index array purposes,
+    // we need the min/max vertex index of the index array.
+    // If the VBO != 0, this may not be the first time we have
+    // used this particular index buffer. getBufferIndexRange
+    // can more quickly get min/max vertex index by
+    // caching previous results.
+    if (ctx->m_state->currentIndexVbo() != 0) {
+        buf = ctx->m_shared->getBufferData(ctx->m_state->currentIndexVbo());
+        offset = (GLintptr)indices;
+        indices = &buf->m_fixedBuffer[offset];
+        ctx->getBufferIndexRange(buf,
+                                 indices,
+                                 type,
+                                 (size_t)count,
+                                 (size_t)offset,
+                                 &minIndex, &maxIndex);
+    } else {
+        // In this case, the |indices| field holds a real
+        // array, so calculate the indices now. They will
+        // also be needed to know how much data to
+        // transfer to host.
+        ctx->calcIndexRange(indices,
+                            type,
+                            count,
+                            &minIndex,
+                            &maxIndex);
+    }
+
+    if (count == 0) return;
+
+    bool adjustIndices = true;
+    if (ctx->m_state->currentIndexVbo() != 0) {
+        if (!has_client_vertex_arrays) {
+            ctx->sendVertexAttributes(0, maxIndex + 1, false, primcount);
+            ctx->doBindBufferEncodeCached(GL_ELEMENT_ARRAY_BUFFER, ctx->m_state->currentIndexVbo());
+            ctx->glDrawElementsInstancedOffsetAEMU(ctx, mode, count, type, offset, primcount);
+            ctx->flushDrawCall();
+            adjustIndices = false;
+        } else {
+            ctx->doBindBufferEncodeCached(GL_ELEMENT_ARRAY_BUFFER, 0);
+        }
+    }
+    if (adjustIndices) {
+        void *adjustedIndices =
+            ctx->recenterIndices(indices,
+                                 type,
+                                 count,
+                                 minIndex);
+
+        if (has_indirect_arrays || 1) {
+            ctx->sendVertexAttributes(minIndex, maxIndex - minIndex + 1, true, primcount);
+            ctx->glDrawElementsInstancedDataAEMU(ctx, mode, count, type, adjustedIndices, primcount, count * glSizeof(type));
+            ctx->m_stream->flush();
+            // XXX - OPTIMIZATION (see the other else branch) should be implemented
+            if(!has_indirect_arrays) {
+                //ALOGD("unoptimized drawelements !!!\n");
+            }
+        } else {
+            // we are all direct arrays and immidate mode index array -
+            // rebuild the arrays and the index array;
+            ALOGE("glDrawElements: direct index & direct buffer data - will be implemented in later versions;\n");
+        }
+    }
+    ctx->m_state->postDraw();
+}
+
+void GL2Encoder::s_glDrawRangeElements(void* self, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void* indices)
+{
+
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    assert(ctx->m_state != NULL);
+    SET_ERROR_IF(!isValidDrawMode(mode), GL_INVALID_ENUM);
+    SET_ERROR_IF(end < start, GL_INVALID_VALUE);
+    SET_ERROR_IF(count < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(!(type == GL_UNSIGNED_BYTE || type == GL_UNSIGNED_SHORT || type == GL_UNSIGNED_INT), GL_INVALID_ENUM);
+    SET_ERROR_IF(ctx->m_state->getTransformFeedbackActiveUnpaused(), GL_INVALID_OPERATION);
+    SET_ERROR_IF(ctx->m_state->checkFramebufferCompleteness(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE, GL_INVALID_FRAMEBUFFER_OPERATION);
+
+    bool has_client_vertex_arrays = false;
+    bool has_indirect_arrays = false;
+    GLintptr offset = 0;
+
+    ctx->getVBOUsage(&has_client_vertex_arrays, &has_indirect_arrays);
+
+    if (!has_client_vertex_arrays && !has_indirect_arrays) {
+        // ALOGW("glDrawElements: no vertex arrays / buffers bound to the command\n");
+        GLenum status = ctx->glCheckFramebufferStatus(self, GL_FRAMEBUFFER);
+        SET_ERROR_IF(status != GL_FRAMEBUFFER_COMPLETE, GL_INVALID_FRAMEBUFFER_OPERATION);
+    }
+
+    BufferData* buf = NULL;
+    int minIndex = 0, maxIndex = 0;
+
+    // For validation/immediate index array purposes,
+    // we need the min/max vertex index of the index array.
+    // If the VBO != 0, this may not be the first time we have
+    // used this particular index buffer. getBufferIndexRange
+    // can more quickly get min/max vertex index by
+    // caching previous results.
+    if (ctx->m_state->currentIndexVbo() != 0) {
+        buf = ctx->m_shared->getBufferData(ctx->m_state->currentIndexVbo());
+        ALOGV("%s: current index vbo: %p len %zu count %zu\n", __func__, buf, buf->m_fixedBuffer.size(), (size_t)count);
+        offset = (GLintptr)indices;
+        void* oldIndices = (void*)indices;
+        indices = &buf->m_fixedBuffer[offset];
+        ALOGV("%s: indices arg: %p buffer start: %p indices: %p\n", __func__,
+                (void*)(uintptr_t)(oldIndices),
+                buf->m_fixedBuffer.data(),
+                indices);
+        ctx->getBufferIndexRange(buf,
+                                 indices,
+                                 type,
+                                 (size_t)count,
+                                 (size_t)offset,
+                                 &minIndex, &maxIndex);
+    } else {
+        // In this case, the |indices| field holds a real
+        // array, so calculate the indices now. They will
+        // also be needed to know how much data to
+        // transfer to host.
+        ctx->calcIndexRange(indices,
+                            type,
+                            count,
+                            &minIndex,
+                            &maxIndex);
+    }
+
+    if (count == 0) return;
+
+    bool adjustIndices = true;
+    if (ctx->m_state->currentIndexVbo() != 0) {
+        if (!has_client_vertex_arrays) {
+            ctx->sendVertexAttributes(0, maxIndex + 1, false);
+            ctx->doBindBufferEncodeCached(GL_ELEMENT_ARRAY_BUFFER, ctx->m_state->currentIndexVbo());
+            ctx->glDrawElementsOffset(ctx, mode, count, type, offset);
+            ctx->flushDrawCall();
+            adjustIndices = false;
+        } else {
+            ctx->doBindBufferEncodeCached(GL_ELEMENT_ARRAY_BUFFER, 0);
+        }
+    }
+    if (adjustIndices) {
+        void *adjustedIndices =
+            ctx->recenterIndices(indices,
+                                 type,
+                                 count,
+                                 minIndex);
+
+        if (has_indirect_arrays || 1) {
+            ctx->sendVertexAttributes(minIndex, maxIndex - minIndex + 1, true);
+            ctx->glDrawElementsData(ctx, mode, count, type, adjustedIndices, count * glSizeof(type));
+            ctx->m_stream->flush();
+            // XXX - OPTIMIZATION (see the other else branch) should be implemented
+            if(!has_indirect_arrays) {
+                //ALOGD("unoptimized drawelements !!!\n");
+            }
+        } else {
+            // we are all direct arrays and immidate mode index array -
+            // rebuild the arrays and the index array;
+            ALOGE("glDrawElements: direct index & direct buffer data - will be implemented in later versions;\n");
+        }
+    }
+    ctx->m_state->postDraw();
+}
+
+const GLubyte* GL2Encoder::s_glGetStringi(void* self, GLenum name, GLuint index) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    const GLubyte *retval =  (GLubyte *) "";
+
+    RET_AND_SET_ERROR_IF(
+        name != GL_VENDOR &&
+        name != GL_RENDERER &&
+        name != GL_VERSION &&
+        name != GL_EXTENSIONS,
+        GL_INVALID_ENUM,
+        retval);
+
+    RET_AND_SET_ERROR_IF(
+        (name == GL_VENDOR ||
+         name == GL_RENDERER ||
+         name == GL_VERSION) &&
+        index != 0,
+        GL_INVALID_VALUE,
+        retval);
+
+    RET_AND_SET_ERROR_IF(
+        name == GL_EXTENSIONS &&
+        index >= ctx->m_currExtensionsArray.size(),
+        GL_INVALID_VALUE,
+        retval);
+
+    switch (name) {
+    case GL_VENDOR:
+        retval = gVendorString;
+        break;
+    case GL_RENDERER:
+        retval = gRendererString;
+        break;
+    case GL_VERSION:
+        retval = gVersionString;
+        break;
+    case GL_EXTENSIONS:
+        retval = (const GLubyte*)(ctx->m_currExtensionsArray[index].c_str());
+        break;
+    }
+
+    return retval;
+}
+
+void GL2Encoder::s_glGetProgramBinary(void* self, GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, void* binary) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+
+    VALIDATE_PROGRAM_NAME(program);
+
+    GLint linkStatus = 0;
+    ctx->m_glGetProgramiv_enc(self, program, GL_LINK_STATUS, &linkStatus);
+    GLint properLength = 0;
+    ctx->m_glGetProgramiv_enc(self, program, GL_PROGRAM_BINARY_LENGTH, &properLength);
+
+    SET_ERROR_IF(!linkStatus, GL_INVALID_OPERATION);
+    SET_ERROR_IF(bufSize < properLength, GL_INVALID_OPERATION);
+
+    ctx->m_glGetProgramBinary_enc(ctx, program, bufSize, length, binaryFormat, binary);
+}
+
+void GL2Encoder::s_glReadPixels(void* self, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+
+    SET_ERROR_IF(!GLESv2Validation::readPixelsFormat(format), GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::readPixelsType(type), GL_INVALID_ENUM);
+    SET_ERROR_IF(!(GLESv2Validation::pixelOp(format,type)),GL_INVALID_OPERATION);
+    SET_ERROR_IF(width < 0 || height < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(ctx->isBufferTargetMapped(GL_PIXEL_PACK_BUFFER), GL_INVALID_OPERATION);
+    SET_ERROR_IF(ctx->boundBuffer(GL_PIXEL_PACK_BUFFER) &&
+                 ctx->getBufferData(GL_PIXEL_PACK_BUFFER) &&
+                 (ctx->m_state->pboNeededDataSize(width, height, 1, format, type, 1) >
+                  ctx->getBufferData(GL_PIXEL_PACK_BUFFER)->m_size),
+                 GL_INVALID_OPERATION);
+    SET_ERROR_IF(ctx->s_glCheckFramebufferStatus(ctx, GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE, GL_INVALID_FRAMEBUFFER_OPERATION);
+
+    // now is complete
+    // GL_INVALID_OPERATION is generated if GL_READ_FRAMEBUFFER_BINDING is nonzero, the read fbo is complete, and the value of
+    // GL_SAMPLE_BUFFERS for the read framebuffer is greater than zero
+    if (ctx->m_state->boundFramebuffer(GL_READ_FRAMEBUFFER) &&
+        ctx->s_glCheckFramebufferStatus(ctx, GL_READ_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE) {
+        FboFormatInfo resInfo;
+        ctx->m_state->getBoundFramebufferFormat(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, &resInfo);
+        if (resInfo.type == FBO_ATTACHMENT_RENDERBUFFER) {
+            SET_ERROR_IF(resInfo.rb_multisamples > 0, GL_INVALID_OPERATION);
+        }
+        if (resInfo.type == FBO_ATTACHMENT_TEXTURE) {
+            SET_ERROR_IF(resInfo.tex_multisamples > 0, GL_INVALID_OPERATION);
+        }
+    }
+
+
+    /*
+GL_INVALID_OPERATION is generated if the readbuffer of the currently bound framebuffer is a fixed point normalized surface and format and type are neither GL_RGBA and GL_UNSIGNED_BYTE, respectively, nor the format/type pair returned by querying GL_IMPLEMENTATION_COLOR_READ_FORMAT and GL_IMPLEMENTATION_COLOR_READ_TYPE.
+
+GL_INVALID_OPERATION is generated if the readbuffer of the currently bound framebuffer is a floating point surface and format and type are neither GL_RGBA and GL_FLOAT, respectively, nor the format/type pair returned by querying GL_IMPLEMENTATION_COLOR_READ_FORMAT and GL_IMPLEMENTATION_COLOR_READ_TYPE.
+
+GL_INVALID_OPERATION is generated if the readbuffer of the currently bound framebuffer is a signed integer surface and format and type are neither GL_RGBA_INTEGER and GL_INT, respectively, nor the format/type pair returned by querying GL_IMPLEMENTATION_COLOR_READ_FORMAT and GL_IMPLEMENTATION_COLOR_READ_TYPE.
+
+GL_INVALID_OPERATION is generated if the readbuffer of the currently bound framebuffer is an unsigned integer surface and format and type are neither GL_RGBA_INTEGER and GL_UNSIGNED_INT, respectively, nor the format/type pair returned by querying GL_IMPLEMENTATION_COLOR_READ_FORMAT and GL_IMPLEMENTATION_COLOR_READ_TYPE.
+*/
+
+    FboFormatInfo fbo_format_info;
+    ctx->m_state->getBoundFramebufferFormat(
+            GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, &fbo_format_info);
+    SET_ERROR_IF(
+        fbo_format_info.type == FBO_ATTACHMENT_TEXTURE &&
+        !GLESv2Validation::readPixelsFboFormatMatch(
+            format, type, fbo_format_info.tex_type),
+        GL_INVALID_OPERATION);
+
+    if (ctx->boundBuffer(GL_PIXEL_PACK_BUFFER)) {
+        ctx->glReadPixelsOffsetAEMU(
+                ctx, x, y, width, height,
+                format, type, (uintptr_t)pixels);
+    } else {
+        ctx->m_glReadPixels_enc(
+                ctx, x, y, width, height,
+                format, type, pixels);
+    }
+    ctx->m_state->postReadPixels();
+}
+
+// Track enabled state for some things like:
+// - Primitive restart
+void GL2Encoder::s_glEnable(void* self, GLenum what) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+
+	SET_ERROR_IF(!GLESv2Validation::allowedEnable(ctx->majorVersion(), ctx->minorVersion(), what), GL_INVALID_ENUM);
+    if (!ctx->m_state) return;
+
+    switch (what) {
+    case GL_PRIMITIVE_RESTART_FIXED_INDEX:
+        ctx->m_primitiveRestartEnabled = true;
+        break;
+    case GL_STENCIL_TEST:
+        ctx->m_state->state_GL_STENCIL_TEST = true;
+        break;
+    }
+
+    ctx->m_glEnable_enc(ctx, what);
+}
+
+void GL2Encoder::s_glDisable(void* self, GLenum what) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+
+	SET_ERROR_IF(!GLESv2Validation::allowedEnable(ctx->majorVersion(), ctx->minorVersion(), what), GL_INVALID_ENUM);
+    if (!ctx->m_state) return;
+
+    switch (what) {
+    case GL_PRIMITIVE_RESTART_FIXED_INDEX:
+        ctx->m_primitiveRestartEnabled = false;
+        break;
+    case GL_STENCIL_TEST:
+        ctx->m_state->state_GL_STENCIL_TEST = false;
+        break;
+    }
+
+    ctx->m_glDisable_enc(ctx, what);
+}
+
+void GL2Encoder::s_glClearBufferiv(void* self, GLenum buffer, GLint drawBuffer, const GLint * value) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+
+    SET_ERROR_IF(buffer != GL_COLOR && buffer != GL_STENCIL, GL_INVALID_ENUM);
+
+    GLint maxDrawBuffers;
+    ctx->glGetIntegerv(ctx, GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
+
+    SET_ERROR_IF(!value, GL_INVALID_VALUE);
+
+    if (buffer == GL_COLOR) {
+        SET_ERROR_IF(drawBuffer < 0 || drawBuffer>= maxDrawBuffers, GL_INVALID_VALUE);
+    } else {
+        SET_ERROR_IF(drawBuffer != 0, GL_INVALID_VALUE);
+    }
+
+    ctx->m_glClearBufferiv_enc(ctx, buffer, drawBuffer, value);
+}
+
+void GL2Encoder::s_glClearBufferuiv(void* self, GLenum buffer, GLint drawBuffer, const GLuint * value) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+
+    SET_ERROR_IF(buffer != GL_COLOR, GL_INVALID_ENUM);
+    SET_ERROR_IF(!value, GL_INVALID_VALUE);
+
+    GLint maxDrawBuffers;
+    ctx->glGetIntegerv(ctx, GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
+    SET_ERROR_IF(drawBuffer < 0 || drawBuffer>= maxDrawBuffers, GL_INVALID_VALUE);
+
+    ctx->m_glClearBufferuiv_enc(ctx, buffer, drawBuffer, value);
+}
+
+void GL2Encoder::s_glClearBufferfv(void* self, GLenum buffer, GLint drawBuffer, const GLfloat * value) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+
+    SET_ERROR_IF(buffer != GL_COLOR && buffer != GL_DEPTH, GL_INVALID_ENUM);
+
+    SET_ERROR_IF(!value, GL_INVALID_VALUE);
+
+    GLint maxDrawBuffers;
+    ctx->glGetIntegerv(ctx, GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
+
+    if (buffer == GL_COLOR) {
+        SET_ERROR_IF(drawBuffer < 0 || drawBuffer>= maxDrawBuffers, GL_INVALID_VALUE);
+    } else {
+        SET_ERROR_IF(drawBuffer != 0, GL_INVALID_VALUE);
+    }
+
+    ctx->m_glClearBufferfv_enc(ctx, buffer, drawBuffer, value);
+}
+
+void GL2Encoder::s_glClearBufferfi(void* self, GLenum buffer, GLint drawBuffer, float depth, int stencil) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+
+    SET_ERROR_IF(buffer != GL_DEPTH_STENCIL, GL_INVALID_ENUM);
+    SET_ERROR_IF(drawBuffer != 0, GL_INVALID_VALUE);
+
+    ctx->m_glClearBufferfi_enc(ctx, buffer, drawBuffer, depth, stencil);
+}
+
+void GL2Encoder::s_glBlitFramebuffer(void* self, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    GLClientState* state = ctx->m_state;
+
+    bool validateColor = mask & GL_COLOR_BUFFER_BIT;
+    bool validateDepth = mask & GL_DEPTH_BUFFER_BIT;
+    bool validateStencil = mask & GL_STENCIL_BUFFER_BIT;
+    bool validateDepthOrStencil = validateDepth || validateStencil;
+
+    FboFormatInfo read_fbo_format_info;
+    FboFormatInfo draw_fbo_format_info;
+    if (validateColor) {
+        state->getBoundFramebufferFormat(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, &read_fbo_format_info);
+        state->getBoundFramebufferFormat(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, &draw_fbo_format_info);
+
+        if (read_fbo_format_info.type == FBO_ATTACHMENT_TEXTURE) {
+            SET_ERROR_IF(
+                GL_LINEAR == filter &&
+                GLESv2Validation::isIntegerFormat(read_fbo_format_info.tex_format),
+                    GL_INVALID_OPERATION);
+        }
+
+        if (read_fbo_format_info.type == FBO_ATTACHMENT_TEXTURE &&
+            draw_fbo_format_info.type == FBO_ATTACHMENT_TEXTURE) {
+            SET_ERROR_IF(
+                    state->boundFramebuffer(GL_READ_FRAMEBUFFER) &&
+                    state->boundFramebuffer(GL_DRAW_FRAMEBUFFER) &&
+                    !GLESv2Validation::blitFramebufferFormat(
+                        read_fbo_format_info.tex_type,
+                        draw_fbo_format_info.tex_type),
+                    GL_INVALID_OPERATION);
+        }
+    }
+
+    if (validateDepth) {
+        state->getBoundFramebufferFormat(GL_READ_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, &read_fbo_format_info);
+        state->getBoundFramebufferFormat(GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, &draw_fbo_format_info);
+
+        if (read_fbo_format_info.type == FBO_ATTACHMENT_RENDERBUFFER &&
+            draw_fbo_format_info.type == FBO_ATTACHMENT_RENDERBUFFER) {
+            SET_ERROR_IF(
+                    state->boundFramebuffer(GL_READ_FRAMEBUFFER) &&
+                    state->boundFramebuffer(GL_DRAW_FRAMEBUFFER) &&
+                    !GLESv2Validation::blitFramebufferFormat(
+                        read_fbo_format_info.rb_format,
+                        draw_fbo_format_info.rb_format),
+                    GL_INVALID_OPERATION);
+        }
+    }
+
+    if (validateStencil) {
+        state->getBoundFramebufferFormat(GL_READ_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, &read_fbo_format_info);
+        state->getBoundFramebufferFormat(GL_DRAW_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, &draw_fbo_format_info);
+
+        if (read_fbo_format_info.type == FBO_ATTACHMENT_RENDERBUFFER &&
+            draw_fbo_format_info.type == FBO_ATTACHMENT_RENDERBUFFER) {
+            SET_ERROR_IF(
+                    state->boundFramebuffer(GL_READ_FRAMEBUFFER) &&
+                    state->boundFramebuffer(GL_DRAW_FRAMEBUFFER) &&
+                    !GLESv2Validation::blitFramebufferFormat(
+                        read_fbo_format_info.rb_format,
+                        draw_fbo_format_info.rb_format),
+                    GL_INVALID_OPERATION);
+        }
+    }
+
+    if (validateDepthOrStencil) {
+        SET_ERROR_IF(filter != GL_NEAREST, GL_INVALID_OPERATION);
+    }
+
+    state->getBoundFramebufferFormat(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, &draw_fbo_format_info);
+    SET_ERROR_IF(
+            draw_fbo_format_info.type == FBO_ATTACHMENT_RENDERBUFFER &&
+            draw_fbo_format_info.rb_multisamples > 0,
+            GL_INVALID_OPERATION);
+    SET_ERROR_IF(
+            draw_fbo_format_info.type == FBO_ATTACHMENT_TEXTURE &&
+            draw_fbo_format_info.tex_multisamples > 0,
+            GL_INVALID_OPERATION);
+
+    state->getBoundFramebufferFormat(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, &read_fbo_format_info);
+    SET_ERROR_IF(
+            read_fbo_format_info.type == FBO_ATTACHMENT_RENDERBUFFER &&
+            read_fbo_format_info.rb_multisamples > 0 &&
+            draw_fbo_format_info.type == FBO_ATTACHMENT_RENDERBUFFER &&
+            state->boundFramebuffer(GL_READ_FRAMEBUFFER) &&
+            state->boundFramebuffer(GL_DRAW_FRAMEBUFFER) &&
+            (read_fbo_format_info.rb_format !=
+             draw_fbo_format_info.rb_format),
+            GL_INVALID_OPERATION);
+    SET_ERROR_IF(
+            read_fbo_format_info.type == FBO_ATTACHMENT_RENDERBUFFER &&
+            read_fbo_format_info.rb_multisamples > 0 &&
+            draw_fbo_format_info.type == FBO_ATTACHMENT_RENDERBUFFER &&
+            (srcX0 != dstX0 || srcY0 != dstY0 ||
+             srcX1 != dstX1 || srcY1 != dstY1),
+            GL_INVALID_OPERATION);
+
+	ctx->m_glBlitFramebuffer_enc(ctx,
+            srcX0, srcY0, srcX1, srcY1,
+            dstX0, dstY0, dstX1, dstY1,
+            mask, filter);
+}
+
+void GL2Encoder::s_glGetInternalformativ(void* self, GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+
+    SET_ERROR_IF(pname != GL_NUM_SAMPLE_COUNTS &&
+                 pname != GL_SAMPLES,
+                 GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::internalFormatTarget(ctx, target), GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::unsizedFormat(internalformat) &&
+                 !GLESv2Validation::colorRenderableFormat(ctx, internalformat) &&
+                 !GLESv2Validation::depthRenderableFormat(ctx, internalformat) &&
+                 !GLESv2Validation::stencilRenderableFormat(ctx, internalformat),
+                 GL_INVALID_ENUM);
+    SET_ERROR_IF(bufSize < 0, GL_INVALID_VALUE);
+
+    if (bufSize < 1) return;
+
+    // Desktop OpenGL can allow a mindboggling # samples per pixel (such as 64).
+    // Limit to 4 (spec minimum) to keep dEQP tests from timing out.
+    switch (pname) {
+        case GL_NUM_SAMPLE_COUNTS:
+            *params = 3;
+            break;
+        case GL_SAMPLES:
+            params[0] = 4;
+            if (bufSize > 1) params[1] = 2;
+            if (bufSize > 2) params[2] = 1;
+            break;
+        default:
+            break;
+    }
+}
+
+void GL2Encoder::s_glGenerateMipmap(void* self, GLenum target) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    GLClientState* state = ctx->m_state;
+
+    SET_ERROR_IF(target != GL_TEXTURE_2D &&
+                 target != GL_TEXTURE_3D &&
+                 target != GL_TEXTURE_CUBE_MAP &&
+                 target != GL_TEXTURE_2D_ARRAY,
+                 GL_INVALID_ENUM);
+
+    GLuint tex = state->getBoundTexture(target);
+    GLenum internalformat = state->queryTexInternalFormat(tex);
+
+    SET_ERROR_IF(tex && GLESv2Validation::isCompressedFormat(internalformat),
+                 GL_INVALID_OPERATION);
+    SET_ERROR_IF(tex &&
+                 !GLESv2Validation::unsizedFormat(internalformat) &&
+                 !(GLESv2Validation::colorRenderableFormat(ctx, internalformat) &&
+                   GLESv2Validation::filterableTexFormat(ctx, internalformat)),
+                 GL_INVALID_OPERATION);
+
+    GLenum stateTarget = target;
+    if (target == GL_TEXTURE_CUBE_MAP_POSITIVE_X ||
+        target == GL_TEXTURE_CUBE_MAP_POSITIVE_Y ||
+        target == GL_TEXTURE_CUBE_MAP_POSITIVE_Z ||
+        target == GL_TEXTURE_CUBE_MAP_NEGATIVE_X ||
+        target == GL_TEXTURE_CUBE_MAP_NEGATIVE_Y ||
+        target == GL_TEXTURE_CUBE_MAP_NEGATIVE_Z)
+        stateTarget = GL_TEXTURE_CUBE_MAP;
+
+    SET_ERROR_IF(!ctx->m_state->isBoundTextureComplete(stateTarget), GL_INVALID_OPERATION);
+
+    if (target == GL_TEXTURE_2D) {
+        ctx->override2DTextureTarget(target);
+    }
+
+    ctx->m_glGenerateMipmap_enc(ctx, target);
+
+    if (target == GL_TEXTURE_2D) {
+        ctx->restore2DTextureTarget(target);
+    }
+}
+
+void GL2Encoder::s_glBindSampler(void* self, GLuint unit, GLuint sampler) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    GLint maxCombinedUnits;
+    ctx->glGetIntegerv(ctx, GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxCombinedUnits);
+    SET_ERROR_IF(unit >= maxCombinedUnits, GL_INVALID_VALUE);
+    SET_ERROR_IF(!ctx->m_state->samplerExists(sampler), GL_INVALID_OPERATION);
+    if (ctx->m_state->isSamplerBindNoOp(unit, sampler)) return;
+    ctx->m_glBindSampler_enc(ctx, unit, sampler);
+    ctx->m_state->bindSampler(unit, sampler);
+}
+
+void GL2Encoder::s_glDeleteSamplers(void* self, GLsizei n, const GLuint* samplers) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    ctx->m_state->onDeleteSamplers(n, samplers);
+    ctx->m_state->setExistence(GLClientState::ObjectType::Sampler, false, n, samplers);
+    ctx->m_glDeleteSamplers_enc(ctx, n, samplers);
+}
+
+GLsync GL2Encoder::s_glFenceSync(void* self, GLenum condition, GLbitfield flags) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    RET_AND_SET_ERROR_IF(condition != GL_SYNC_GPU_COMMANDS_COMPLETE, GL_INVALID_ENUM, 0);
+    RET_AND_SET_ERROR_IF(flags != 0, GL_INVALID_VALUE, 0);
+    uint64_t syncHandle = ctx->glFenceSyncAEMU(ctx, condition, flags);
+
+    GLsync res = (GLsync)(uintptr_t)syncHandle;
+    GLClientState::onFenceCreated(res);
+    return res;
+}
+
+GLenum GL2Encoder::s_glClientWaitSync(void* self, GLsync wait_on, GLbitfield flags, GLuint64 timeout) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    RET_AND_SET_ERROR_IF(!GLClientState::fenceExists(wait_on), GL_INVALID_VALUE, GL_WAIT_FAILED);
+    RET_AND_SET_ERROR_IF(flags && !(flags & GL_SYNC_FLUSH_COMMANDS_BIT), GL_INVALID_VALUE, GL_WAIT_FAILED);
+    return ctx->glClientWaitSyncAEMU(ctx, (uint64_t)(uintptr_t)wait_on, flags, timeout);
+}
+
+void GL2Encoder::s_glWaitSync(void* self, GLsync wait_on, GLbitfield flags, GLuint64 timeout) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    SET_ERROR_IF(flags != 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(timeout != GL_TIMEOUT_IGNORED, GL_INVALID_VALUE);
+    SET_ERROR_IF(!GLClientState::fenceExists(wait_on), GL_INVALID_VALUE);
+    ctx->glWaitSyncAEMU(ctx, (uint64_t)(uintptr_t)wait_on, flags, timeout);
+}
+
+void GL2Encoder::s_glDeleteSync(void* self, GLsync sync) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+
+    if (!sync) return;
+
+    SET_ERROR_IF(!GLClientState::fenceExists(sync), GL_INVALID_VALUE);
+    GLClientState::onFenceDestroyed(sync);
+    ctx->glDeleteSyncAEMU(ctx, (uint64_t)(uintptr_t)sync);
+}
+
+GLboolean GL2Encoder::s_glIsSync(void* self, GLsync sync) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    return ctx->glIsSyncAEMU(ctx, (uint64_t)(uintptr_t)sync);
+}
+
+void GL2Encoder::s_glGetSynciv(void* self, GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+
+    SET_ERROR_IF(!GLESv2Validation::allowedGetSyncParam(pname), GL_INVALID_ENUM);
+    SET_ERROR_IF(bufSize < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(!GLClientState::fenceExists(sync), GL_INVALID_VALUE);
+
+    return ctx->glGetSyncivAEMU(ctx, (uint64_t)(uintptr_t)sync, pname, bufSize, length, values);
+}
+
+#define LIMIT_CASE(target, lim) \
+    case target: \
+        ctx->glGetIntegerv(ctx, lim, &limit); \
+        SET_ERROR_IF(index < 0 || index >= limit, GL_INVALID_VALUE); \
+        break; \
+
+void GL2Encoder::s_glGetIntegeri_v(void* self, GLenum target, GLuint index, GLint* params) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    GLClientState* state = ctx->m_state;
+
+    GLint limit;
+
+    switch (target) {
+    LIMIT_CASE(GL_TRANSFORM_FEEDBACK_BUFFER_BINDING, GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS)
+    LIMIT_CASE(GL_UNIFORM_BUFFER_BINDING, GL_MAX_UNIFORM_BUFFER_BINDINGS)
+    LIMIT_CASE(GL_ATOMIC_COUNTER_BUFFER_BINDING, GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS)
+    LIMIT_CASE(GL_SHADER_STORAGE_BUFFER_BINDING, GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS)
+    default:
+        break;
+    }
+
+    const GLClientState::VertexAttribBindingVector& currBindings =
+        state->currentVertexBufferBindings();
+
+    switch (target) {
+    case GL_VERTEX_BINDING_DIVISOR:
+    case GL_VERTEX_BINDING_OFFSET:
+    case GL_VERTEX_BINDING_STRIDE:
+    case GL_VERTEX_BINDING_BUFFER:
+        SET_ERROR_IF(index < 0 || index > currBindings.size(), GL_INVALID_VALUE);
+        break;
+    default:
+        break;
+    }
+
+    switch (target) {
+    case GL_VERTEX_BINDING_DIVISOR:
+        *params = currBindings[index].divisor;
+        return;
+    case GL_VERTEX_BINDING_OFFSET:
+        *params = currBindings[index].offset;
+        return;
+    case GL_VERTEX_BINDING_STRIDE:
+        *params = currBindings[index].effectiveStride;
+        return;
+    case GL_VERTEX_BINDING_BUFFER:
+        *params = currBindings[index].buffer;
+        return;
+    default:
+        break;
+    }
+
+    ctx->safe_glGetIntegeri_v(target, index, params);
+}
+
+void GL2Encoder::s_glGetInteger64i_v(void* self, GLenum target, GLuint index, GLint64* params) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    GLClientState* state = ctx->m_state;
+
+    GLint limit;
+
+    switch (target) {
+    LIMIT_CASE(GL_TRANSFORM_FEEDBACK_BUFFER_BINDING, GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS)
+    LIMIT_CASE(GL_UNIFORM_BUFFER_BINDING, GL_MAX_UNIFORM_BUFFER_BINDINGS)
+    LIMIT_CASE(GL_ATOMIC_COUNTER_BUFFER_BINDING, GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS)
+    LIMIT_CASE(GL_SHADER_STORAGE_BUFFER_BINDING, GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS)
+    default:
+        break;
+    }
+
+    const GLClientState::VertexAttribBindingVector& currBindings =
+        state->currentVertexBufferBindings();
+
+    switch (target) {
+    case GL_VERTEX_BINDING_DIVISOR:
+    case GL_VERTEX_BINDING_OFFSET:
+    case GL_VERTEX_BINDING_STRIDE:
+    case GL_VERTEX_BINDING_BUFFER:
+        SET_ERROR_IF(index < 0 || index > currBindings.size(), GL_INVALID_VALUE);
+        break;
+    default:
+        break;
+    }
+
+    switch (target) {
+    case GL_VERTEX_BINDING_DIVISOR:
+        *params = currBindings[index].divisor;
+        return;
+    case GL_VERTEX_BINDING_OFFSET:
+        *params = currBindings[index].offset;
+        return;
+    case GL_VERTEX_BINDING_STRIDE:
+        *params = currBindings[index].effectiveStride;
+        return;
+    case GL_VERTEX_BINDING_BUFFER:
+        *params = currBindings[index].buffer;
+        return;
+    default:
+        break;
+    }
+
+    ctx->safe_glGetInteger64i_v(target, index, params);
+}
+
+void GL2Encoder::s_glGetInteger64v(void* self, GLenum param, GLint64* val) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    ctx->safe_glGetInteger64v(param, val);
+}
+
+void GL2Encoder::s_glGetBooleani_v(void* self, GLenum param, GLuint index, GLboolean* val) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    ctx->safe_glGetBooleani_v(param, index, val);
+}
+
+void GL2Encoder::s_glGetShaderiv(void* self, GLuint shader, GLenum pname, GLint* params) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    ctx->m_glGetShaderiv_enc(self, shader, pname, params);
+
+    SET_ERROR_IF(!GLESv2Validation::allowedGetShader(pname), GL_INVALID_ENUM);
+    VALIDATE_SHADER_NAME(shader);
+	
+    if (pname == GL_SHADER_SOURCE_LENGTH) {
+        ShaderData* shaderData = ctx->m_shared->getShaderData(shader);
+        if (shaderData) {
+            int totalLen = 0;
+            for (int i = 0; i < shaderData->sources.size(); i++) {
+                totalLen += shaderData->sources[i].size();
+            }
+            if (totalLen != 0) {
+                *params = totalLen + 1; // account for null terminator
+            }
+        }
+    }
+}
+
+void GL2Encoder::s_glActiveShaderProgram(void* self, GLuint pipeline, GLuint program) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+    GLSharedGroupPtr shared = ctx->m_shared;
+
+    SET_ERROR_IF(!pipeline, GL_INVALID_OPERATION);
+    SET_ERROR_IF(program && !shared->isShaderOrProgramObject(program), GL_INVALID_VALUE);
+    SET_ERROR_IF(program && !shared->isProgram(program), GL_INVALID_OPERATION);
+
+    ctx->m_glActiveShaderProgram_enc(ctx, pipeline, program);
+    if (!state->currentProgram()) {
+        state->setCurrentShaderProgram(program);
+    }
+}
+
+GLuint GL2Encoder::s_glCreateShaderProgramv(void* self, GLenum shaderType, GLsizei count, const char** strings) {
+
+    GLint* length = NULL;
+    GL2Encoder* ctx = (GL2Encoder*)self;
+
+    int len = glUtilsCalcShaderSourceLen((char**)strings, length, count);
+    char *str = new char[len + 1];
+    glUtilsPackStrings(str, (char**)strings, (GLint*)length, count);
+
+    // Do GLSharedGroup and location WorkARound-specific initialization
+    // Phase 1: create a ShaderData and initialize with replaceSamplerExternalWith2D()
+    uint32_t spDataId = ctx->m_shared->addNewShaderProgramData();
+    ShaderProgramData* spData = ctx->m_shared->getShaderProgramDataById(spDataId);
+
+    if (!replaceSamplerExternalWith2D(str, &spData->shaderData)) {
+        delete [] str;
+        ctx->setError(GL_OUT_OF_MEMORY);
+        ctx->m_shared->deleteShaderProgramDataById(spDataId);
+        return -1;
+    }
+
+    GLuint res = ctx->glCreateShaderProgramvAEMU(ctx, shaderType, count, str, len + 1);
+    delete [] str;
+
+    // Phase 2: do glLinkProgram-related initialization for locationWorkARound
+    GLint linkStatus = 0;
+    ctx->m_glGetProgramiv_enc(self, res, GL_LINK_STATUS ,&linkStatus);
+    ctx->m_shared->setProgramLinkStatus(res, linkStatus);
+    if (!linkStatus) {
+        ctx->m_shared->deleteShaderProgramDataById(spDataId);
+        return -1;
+    }
+
+    ctx->m_shared->associateGLShaderProgram(res, spDataId);
+
+    GLint numUniforms = 0;
+    GLint numAttributes = 0;
+    ctx->m_glGetProgramiv_enc(self, res, GL_ACTIVE_UNIFORMS, &numUniforms);
+    ctx->m_glGetProgramiv_enc(self, res, GL_ACTIVE_ATTRIBUTES, &numAttributes);
+    ctx->m_shared->initShaderProgramData(res, numUniforms, numAttributes);
+
+    GLint maxLength=0;
+    GLint maxAttribLength=0;
+    ctx->m_glGetProgramiv_enc(self, res, GL_ACTIVE_UNIFORM_MAX_LENGTH, &maxLength);
+    ctx->m_glGetProgramiv_enc(self, res, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &maxAttribLength);
+
+    size_t bufLen = maxLength > maxAttribLength ? maxLength : maxAttribLength;
+    GLint size; GLenum type; GLchar *name = new GLchar[bufLen + 1];
+
+    for (GLint i = 0; i < numUniforms; ++i) {
+        ctx->m_glGetActiveUniform_enc(self, res, i, maxLength, NULL, &size, &type, name);
+        GLint location = ctx->m_glGetUniformLocation_enc(self, res, name);
+        ctx->m_shared->setShaderProgramIndexInfo(res, i, location, size, type, name);
+    }
+
+    for (GLint i = 0; i < numAttributes; ++i) {
+        ctx->m_glGetActiveAttrib_enc(self, res, i, maxAttribLength,  NULL, &size, &type, name);
+        GLint location = ctx->m_glGetAttribLocation_enc(self, res, name);
+        ctx->m_shared->setProgramAttribInfo(res, i, location, size, type, name);
+    }
+
+    GLint numBlocks;
+    ctx->m_glGetProgramiv_enc(ctx, res, GL_ACTIVE_UNIFORM_BLOCKS, &numBlocks);
+    ctx->m_shared->setActiveUniformBlockCountForProgram(res, numBlocks);
+
+    GLint tfVaryingsCount;
+    ctx->m_glGetProgramiv_enc(ctx, res, GL_TRANSFORM_FEEDBACK_VARYINGS, &tfVaryingsCount);
+    ctx->m_shared->setTransformFeedbackVaryingsCountForProgram(res, tfVaryingsCount);
+
+    delete [] name;
+
+    return res;
+}
+
+void GL2Encoder::s_glProgramUniform1f(void* self, GLuint program, GLint location, GLfloat v0)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniform1f_enc(self, program, location, v0);
+}
+
+void GL2Encoder::s_glProgramUniform1fv(void* self, GLuint program, GLint location, GLsizei count, const GLfloat *value)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniform1fv_enc(self, program, location, count, value);
+}
+
+void GL2Encoder::s_glProgramUniform1i(void* self, GLuint program, GLint location, GLint v0)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniform1i_enc(self, program, location, v0);
+
+    GLClientState* state = ctx->m_state;
+    GLSharedGroupPtr shared = ctx->m_shared;
+    GLenum target;
+
+    if (shared->setSamplerUniform(program, location, v0, &target)) {
+        GLenum origActiveTexture = state->getActiveTextureUnit();
+        if (ctx->updateHostTexture2DBinding(GL_TEXTURE0 + v0, target)) {
+            ctx->m_glActiveTexture_enc(self, origActiveTexture);
+        }
+        state->setActiveTextureUnit(origActiveTexture);
+    }
+}
+
+void GL2Encoder::s_glProgramUniform1iv(void* self, GLuint program, GLint location, GLsizei count, const GLint *value)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniform1iv_enc(self, program, location, count, value);
+}
+
+void GL2Encoder::s_glProgramUniform1ui(void* self, GLuint program, GLint location, GLuint v0)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniform1ui_enc(self, program, location, v0);
+
+    GLClientState* state = ctx->m_state;
+    GLSharedGroupPtr shared = ctx->m_shared;
+    GLenum target;
+
+    if (shared->setSamplerUniform(program, location, v0, &target)) {
+        GLenum origActiveTexture = state->getActiveTextureUnit();
+        if (ctx->updateHostTexture2DBinding(GL_TEXTURE0 + v0, target)) {
+            ctx->m_glActiveTexture_enc(self, origActiveTexture);
+        }
+        state->setActiveTextureUnit(origActiveTexture);
+    }
+}
+
+void GL2Encoder::s_glProgramUniform1uiv(void* self, GLuint program, GLint location, GLsizei count, const GLuint *value)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniform1uiv_enc(self, program, location, count, value);
+}
+
+void GL2Encoder::s_glProgramUniform2f(void* self, GLuint program, GLint location, GLfloat v0, GLfloat v1)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniform2f_enc(self, program, location, v0, v1);
+}
+
+void GL2Encoder::s_glProgramUniform2fv(void* self, GLuint program, GLint location, GLsizei count, const GLfloat *value)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniform2fv_enc(self, program, location, count, value);
+}
+
+void GL2Encoder::s_glProgramUniform2i(void* self, GLuint program, GLint location, GLint v0, GLint v1)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniform2i_enc(self, program, location, v0, v1);
+}
+
+void GL2Encoder::s_glProgramUniform2iv(void* self, GLuint program, GLint location, GLsizei count, const GLint *value)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniform2iv_enc(self, program, location, count, value);
+}
+
+void GL2Encoder::s_glProgramUniform2ui(void* self, GLuint program, GLint location, GLint v0, GLuint v1)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniform2ui_enc(self, program, location, v0, v1);
+}
+
+void GL2Encoder::s_glProgramUniform2uiv(void* self, GLuint program, GLint location, GLsizei count, const GLuint *value)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniform2uiv_enc(self, program, location, count, value);
+}
+
+void GL2Encoder::s_glProgramUniform3f(void* self, GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniform3f_enc(self, program, location, v0, v1, v2);
+}
+
+void GL2Encoder::s_glProgramUniform3fv(void* self, GLuint program, GLint location, GLsizei count, const GLfloat *value)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniform3fv_enc(self, program, location, count, value);
+}
+
+void GL2Encoder::s_glProgramUniform3i(void* self, GLuint program, GLint location, GLint v0, GLint v1, GLint v2)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniform3i_enc(self, program, location, v0, v1, v2);
+}
+
+void GL2Encoder::s_glProgramUniform3iv(void* self, GLuint program, GLint location, GLsizei count, const GLint *value)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniform3iv_enc(self, program, location, count, value);
+}
+
+void GL2Encoder::s_glProgramUniform3ui(void* self, GLuint program, GLint location, GLint v0, GLint v1, GLuint v2)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniform3ui_enc(self, program, location, v0, v1, v2);
+}
+
+void GL2Encoder::s_glProgramUniform3uiv(void* self, GLuint program, GLint location, GLsizei count, const GLuint *value)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniform3uiv_enc(self, program, location, count, value);
+}
+
+void GL2Encoder::s_glProgramUniform4f(void* self, GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniform4f_enc(self, program, location, v0, v1, v2, v3);
+}
+
+void GL2Encoder::s_glProgramUniform4fv(void* self, GLuint program, GLint location, GLsizei count, const GLfloat *value)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniform4fv_enc(self, program, location, count, value);
+}
+
+void GL2Encoder::s_glProgramUniform4i(void* self, GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniform4i_enc(self, program, location, v0, v1, v2, v3);
+}
+
+void GL2Encoder::s_glProgramUniform4iv(void* self, GLuint program, GLint location, GLsizei count, const GLint *value)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniform4iv_enc(self, program, location, count, value);
+}
+
+void GL2Encoder::s_glProgramUniform4ui(void* self, GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLuint v3)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniform4ui_enc(self, program, location, v0, v1, v2, v3);
+}
+
+void GL2Encoder::s_glProgramUniform4uiv(void* self, GLuint program, GLint location, GLsizei count, const GLuint *value)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniform4uiv_enc(self, program, location, count, value);
+}
+
+void GL2Encoder::s_glProgramUniformMatrix2fv(void* self, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniformMatrix2fv_enc(self, program, location, count, transpose, value);
+}
+
+void GL2Encoder::s_glProgramUniformMatrix2x3fv(void* self, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniformMatrix2x3fv_enc(self, program, location, count, transpose, value);
+}
+
+void GL2Encoder::s_glProgramUniformMatrix2x4fv(void* self, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniformMatrix2x4fv_enc(self, program, location, count, transpose, value);
+}
+
+void GL2Encoder::s_glProgramUniformMatrix3fv(void* self, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniformMatrix3fv_enc(self, program, location, count, transpose, value);
+}
+
+void GL2Encoder::s_glProgramUniformMatrix3x2fv(void* self, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniformMatrix3x2fv_enc(self, program, location, count, transpose, value);
+}
+
+void GL2Encoder::s_glProgramUniformMatrix3x4fv(void* self, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniformMatrix3x4fv_enc(self, program, location, count, transpose, value);
+}
+
+void GL2Encoder::s_glProgramUniformMatrix4fv(void* self, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniformMatrix4fv_enc(self, program, location, count, transpose, value);
+}
+
+void GL2Encoder::s_glProgramUniformMatrix4x2fv(void* self, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniformMatrix4x2fv_enc(self, program, location, count, transpose, value);
+}
+
+void GL2Encoder::s_glProgramUniformMatrix4x3fv(void* self, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glProgramUniformMatrix4x3fv_enc(self, program, location, count, transpose, value);
+}
+
+void GL2Encoder::s_glProgramParameteri(void* self, GLuint program, GLenum pname, GLint value) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    VALIDATE_PROGRAM_NAME(program);
+    SET_ERROR_IF(pname != GL_PROGRAM_BINARY_RETRIEVABLE_HINT && pname != GL_PROGRAM_SEPARABLE, GL_INVALID_ENUM);
+    SET_ERROR_IF(value != GL_FALSE && value != GL_TRUE, GL_INVALID_VALUE);
+    ctx->m_glProgramParameteri_enc(self, program, pname, value);
+}
+
+void GL2Encoder::s_glUseProgramStages(void *self, GLuint pipeline, GLbitfield stages, GLuint program)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+    GLSharedGroupPtr shared = ctx->m_shared;
+
+    SET_ERROR_IF(!pipeline, GL_INVALID_OPERATION);
+    SET_ERROR_IF(program && !shared->isShaderOrProgramObject(program), GL_INVALID_VALUE);
+    SET_ERROR_IF(program && !shared->isProgram(program), GL_INVALID_OPERATION);
+
+    ctx->m_glUseProgramStages_enc(self, pipeline, stages, program);
+    state->associateProgramWithPipeline(program, pipeline);
+
+    // There is an active non-separable shader program in effect; no need to update external/2D bindings.
+    if (state->currentProgram()) {
+        return;
+    }
+
+    // Otherwise, update host texture 2D bindings.
+    ctx->updateHostTexture2DBindingsFromProgramData(program);
+
+    if (program) {
+        ctx->m_state->currentUniformValidationInfo = ctx->m_shared->getUniformValidationInfo(program);
+        ctx->m_state->currentAttribValidationInfo = ctx->m_shared->getAttribValidationInfo(program);
+    }
+}
+
+void GL2Encoder::s_glBindProgramPipeline(void* self, GLuint pipeline)
+{
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    ctx->m_glBindProgramPipeline_enc(self, pipeline);
+
+    // There is an active non-separable shader program in effect; no need to update external/2D bindings.
+    if (!pipeline || state->currentProgram()) {
+        return;
+    }
+
+    GLClientState::ProgramPipelineIterator it = state->programPipelineBegin();
+    for (; it != state->programPipelineEnd(); ++it) {
+        if (it->second == pipeline) {
+            ctx->updateHostTexture2DBindingsFromProgramData(it->first);
+        }
+    }
+}
+
+void GL2Encoder::s_glGetProgramResourceiv(void* self, GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum * props, GLsizei bufSize, GLsizei * length, GLint * params) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(bufSize < 0, GL_INVALID_VALUE);
+    if (bufSize == 0) {
+        if (length) *length = 0;
+        return;
+    }
+
+    // Avoid modifying |name| if |*length| < bufSize.
+    GLint* intermediate = new GLint[bufSize];
+    GLsizei* myLength = length ? length : new GLsizei;
+    bool needFreeLength = length == NULL;
+
+    ctx->m_glGetProgramResourceiv_enc(self, program, programInterface, index, propCount, props, bufSize, myLength, intermediate);
+    GLsizei writtenInts = *myLength;
+    memcpy(params, intermediate, writtenInts * sizeof(GLint));
+
+    delete [] intermediate;
+    if (needFreeLength)
+        delete myLength;
+}
+
+GLuint GL2Encoder::s_glGetProgramResourceIndex(void* self, GLuint program, GLenum programInterface, const char* name) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    return ctx->m_glGetProgramResourceIndex_enc(self, program, programInterface, name);
+}
+
+GLint GL2Encoder::s_glGetProgramResourceLocation(void* self, GLuint program, GLenum programInterface, const char* name) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    return ctx->m_glGetProgramResourceLocation_enc(self, program, programInterface, name);
+}
+
+void GL2Encoder::s_glGetProgramResourceName(void* self, GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, char* name) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(bufSize < 0, GL_INVALID_VALUE);
+    if (bufSize == 0) {
+        if (length) *length = 0;
+        return;
+    }
+
+    // Avoid modifying |name| if |*length| < bufSize.
+    char* intermediate = new char[bufSize];
+    GLsizei* myLength = length ? length : new GLsizei;
+    bool needFreeLength = length == NULL;
+
+    ctx->m_glGetProgramResourceName_enc(self, program, programInterface, index, bufSize, myLength, intermediate);
+    GLsizei writtenStrLen = *myLength;
+    memcpy(name, intermediate, writtenStrLen + 1);
+
+    delete [] intermediate;
+    if (needFreeLength)
+        delete myLength;
+}
+
+void GL2Encoder::s_glGetProgramPipelineInfoLog(void* self, GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar* infoLog) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(bufSize < 0, GL_INVALID_VALUE);
+    if (bufSize == 0) {
+        if (length) *length = 0;
+        return;
+    }
+
+    // Avoid modifying |infoLog| if |*length| < bufSize.
+    GLchar* intermediate = new GLchar[bufSize];
+    GLsizei* myLength = length ? length : new GLsizei;
+    bool needFreeLength = length == NULL;
+
+    ctx->m_glGetProgramPipelineInfoLog_enc(self, pipeline, bufSize, myLength, intermediate);
+    GLsizei writtenStrLen = *myLength;
+    memcpy(infoLog, intermediate, writtenStrLen + 1);
+
+    delete [] intermediate;
+    if (needFreeLength)
+        delete myLength;
+}
+
+void GL2Encoder::s_glVertexAttribFormat(void* self, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    VALIDATE_VERTEX_ATTRIB_INDEX(attribindex);
+    SET_ERROR_IF(!state->currentVertexArrayObject(), GL_INVALID_OPERATION);
+
+    state->setVertexAttribFormat(attribindex, size, type, normalized, relativeoffset, false);
+    ctx->m_glVertexAttribFormat_enc(ctx, attribindex, size, type, normalized, relativeoffset);
+}
+
+void GL2Encoder::s_glVertexAttribIFormat(void* self, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    VALIDATE_VERTEX_ATTRIB_INDEX(attribindex);
+    SET_ERROR_IF(!state->currentVertexArrayObject(), GL_INVALID_OPERATION);
+
+    state->setVertexAttribFormat(attribindex, size, type, GL_FALSE, relativeoffset, true);
+    ctx->m_glVertexAttribIFormat_enc(ctx, attribindex, size, type, relativeoffset);
+}
+
+void GL2Encoder::s_glVertexBindingDivisor(void* self, GLuint bindingindex, GLuint divisor) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    SET_ERROR_IF(!state->currentVertexArrayObject(), GL_INVALID_OPERATION);
+
+    state->setVertexBindingDivisor(bindingindex, divisor);
+    ctx->m_glVertexBindingDivisor_enc(ctx, bindingindex, divisor);
+}
+
+void GL2Encoder::s_glVertexAttribBinding(void* self, GLuint attribindex, GLuint bindingindex) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+    VALIDATE_VERTEX_ATTRIB_INDEX(attribindex);
+    SET_ERROR_IF(!state->currentVertexArrayObject(), GL_INVALID_OPERATION);
+
+    state->setVertexAttribBinding(attribindex, bindingindex);
+    ctx->m_glVertexAttribBinding_enc(ctx, attribindex, bindingindex);
+}
+
+void GL2Encoder::s_glBindVertexBuffer(void* self, GLuint bindingindex, GLuint buffer, GLintptr offset, GLintptr stride) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    SET_ERROR_IF(offset < 0, GL_INVALID_VALUE);
+
+    GLint maxStride;
+    ctx->glGetIntegerv(ctx, GL_MAX_VERTEX_ATTRIB_STRIDE, &maxStride);
+    SET_ERROR_IF(stride < 0 || stride > maxStride, GL_INVALID_VALUE);
+
+    SET_ERROR_IF(!state->currentVertexArrayObject(), GL_INVALID_OPERATION);
+
+    state->bindIndexedBuffer(0, bindingindex, buffer, offset, 0, stride, stride);
+    ctx->m_glBindVertexBuffer_enc(ctx, bindingindex, buffer, offset, stride);
+}
+
+void GL2Encoder::s_glDrawArraysIndirect(void* self, GLenum mode, const void* indirect) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    bool hasClientArrays = false;
+    bool hasVBOs = false;
+    ctx->getVBOUsage(&hasClientArrays, &hasVBOs);
+
+    SET_ERROR_IF(hasClientArrays, GL_INVALID_OPERATION);
+    SET_ERROR_IF(!state->currentVertexArrayObject(), GL_INVALID_OPERATION);
+    SET_ERROR_IF(!ctx->boundBuffer(GL_DRAW_INDIRECT_BUFFER), GL_INVALID_OPERATION);
+    SET_ERROR_IF(ctx->m_state->checkFramebufferCompleteness(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE, GL_INVALID_FRAMEBUFFER_OPERATION);
+
+    GLuint indirectStructSize = glUtilsIndirectStructSize(INDIRECT_COMMAND_DRAWARRAYS);
+    if (ctx->boundBuffer(GL_DRAW_INDIRECT_BUFFER)) {
+        // BufferData* buf = ctx->getBufferData(target);
+        // if (buf) {
+        //     SET_ERROR_IF((GLuint)(uintptr_t)indirect + indirectStructSize > buf->m_size, GL_INVALID_VALUE);
+        // }
+        ctx->glDrawArraysIndirectOffsetAEMU(ctx, mode, (uintptr_t)indirect);
+    } else {
+        // Client command structs are technically allowed in desktop OpenGL, but not in ES.
+        // This is purely for debug/dev purposes.
+        ctx->glDrawArraysIndirectDataAEMU(ctx, mode, indirect, indirectStructSize);
+    }
+    ctx->m_state->postDraw();
+}
+
+void GL2Encoder::s_glDrawElementsIndirect(void* self, GLenum mode, GLenum type, const void* indirect) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+
+    GLClientState* state = ctx->m_state;
+
+    bool hasClientArrays = false;
+    bool hasVBOs = false;
+    ctx->getVBOUsage(&hasClientArrays, &hasVBOs);
+
+    SET_ERROR_IF(hasClientArrays, GL_INVALID_OPERATION);
+    SET_ERROR_IF(!state->currentVertexArrayObject(), GL_INVALID_OPERATION);
+    SET_ERROR_IF(!ctx->boundBuffer(GL_DRAW_INDIRECT_BUFFER), GL_INVALID_OPERATION);
+
+    SET_ERROR_IF(ctx->m_state->getTransformFeedbackActiveUnpaused(), GL_INVALID_OPERATION);
+    SET_ERROR_IF(ctx->m_state->checkFramebufferCompleteness(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE, GL_INVALID_FRAMEBUFFER_OPERATION);
+
+    GLuint indirectStructSize = glUtilsIndirectStructSize(INDIRECT_COMMAND_DRAWELEMENTS);
+    if (ctx->boundBuffer(GL_DRAW_INDIRECT_BUFFER)) {
+        // BufferData* buf = ctx->getBufferData(target);
+        // if (buf) {
+        //     SET_ERROR_IF((GLuint)(uintptr_t)indirect + indirectStructSize > buf->m_size, GL_INVALID_VALUE);
+        // }
+        ctx->glDrawElementsIndirectOffsetAEMU(ctx, mode, type, (uintptr_t)indirect);
+    } else {
+        // Client command structs are technically allowed in desktop OpenGL, but not in ES.
+        // This is purely for debug/dev purposes.
+        ctx->glDrawElementsIndirectDataAEMU(ctx, mode, type, indirect, indirectStructSize);
+    }
+    ctx->m_state->postDraw();
+}
+
+void GL2Encoder::s_glTexStorage2DMultisample(void* self, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+
+    SET_ERROR_IF(target != GL_TEXTURE_2D_MULTISAMPLE, GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::pixelInternalFormat(internalformat), GL_INVALID_ENUM);
+    SET_ERROR_IF(!state->getBoundTexture(target), GL_INVALID_OPERATION);
+    SET_ERROR_IF(width < 1 || height < 1, GL_INVALID_VALUE);
+    SET_ERROR_IF(state->isBoundTextureImmutableFormat(target), GL_INVALID_OPERATION);
+    GLint max_samples;
+    ctx->s_glGetInternalformativ(ctx, target, internalformat, GL_SAMPLES, 1, &max_samples);
+    SET_ERROR_IF(samples > max_samples, GL_INVALID_OPERATION);
+
+    state->setBoundTextureInternalFormat(target, internalformat);
+    state->setBoundTextureDims(target, target, 0, width, height, 1);
+    state->setBoundTextureImmutableFormat(target);
+    state->setBoundTextureSamples(target, samples);
+
+    ctx->m_glTexStorage2DMultisample_enc(ctx, target, samples, internalformat, width, height, fixedsamplelocations);
+}
+
+GLenum GL2Encoder::s_glGetGraphicsResetStatusEXT(void* self) {
+    (void)self;
+    return GL_NO_ERROR;
+}
+
+void GL2Encoder::s_glReadnPixelsEXT(void* self, GLint x, GLint y, GLsizei width,
+        GLsizei height, GLenum format, GLenum type, GLsizei bufSize,
+        GLvoid* pixels) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(bufSize < glesv2_enc::pixelDataSize(self, width, height, format,
+        type, 1), GL_INVALID_OPERATION);
+    s_glReadPixels(self, x, y, width, height, format, type, pixels);
+    ctx->m_state->postReadPixels();
+}
+
+void GL2Encoder::s_glGetnUniformfvEXT(void *self, GLuint program, GLint location,
+        GLsizei bufSize, GLfloat* params) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(bufSize < glSizeof(glesv2_enc::uniformType(self, program,
+        location)), GL_INVALID_OPERATION);
+    s_glGetUniformfv(self, program, location, params);
+}
+
+void GL2Encoder::s_glGetnUniformivEXT(void *self, GLuint program, GLint location,
+        GLsizei bufSize, GLint* params) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(bufSize < glSizeof(glesv2_enc::uniformType(self, program,
+        location)), GL_INVALID_OPERATION);
+    s_glGetUniformiv(self, program, location, params);
+}
+
+void GL2Encoder::s_glInvalidateFramebuffer(void* self, GLenum target, GLsizei numAttachments, const GLenum *attachments) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    SET_ERROR_IF((target != GL_FRAMEBUFFER) &&
+                 (target != GL_READ_FRAMEBUFFER) &&
+                 (target != GL_DRAW_FRAMEBUFFER), GL_INVALID_ENUM);
+    SET_ERROR_IF(numAttachments < 0, GL_INVALID_VALUE);
+
+    GLint maxColorAttachments;
+    ctx->glGetIntegerv(ctx, GL_MAX_COLOR_ATTACHMENTS, &maxColorAttachments);
+    for (GLsizei i = 0; i < numAttachments; ++i) {
+        if (attachments[i] != GL_DEPTH_ATTACHMENT && attachments[i] != GL_STENCIL_ATTACHMENT && attachments[i] != GL_DEPTH_STENCIL_ATTACHMENT) {
+            SET_ERROR_IF(attachments[i] >= GL_COLOR_ATTACHMENT0 + maxColorAttachments, GL_INVALID_OPERATION);
+        }
+    }
+
+    ctx->m_glInvalidateFramebuffer_enc(ctx, target, numAttachments, attachments);
+}
+
+void GL2Encoder::s_glInvalidateSubFramebuffer(void* self, GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(target != GL_FRAMEBUFFER && target != GL_READ_FRAMEBUFFER && target != GL_DRAW_FRAMEBUFFER, GL_INVALID_ENUM);
+    SET_ERROR_IF(numAttachments < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(width < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(height < 0, GL_INVALID_VALUE);
+    GLint maxColorAttachments;
+    ctx->glGetIntegerv(ctx, GL_MAX_COLOR_ATTACHMENTS, &maxColorAttachments);
+    for (GLsizei i = 0; i < numAttachments; ++i) {
+        if (attachments[i] != GL_DEPTH_ATTACHMENT && attachments[i] != GL_STENCIL_ATTACHMENT && attachments[i] != GL_DEPTH_STENCIL_ATTACHMENT) {
+            SET_ERROR_IF(attachments[i] >= GL_COLOR_ATTACHMENT0 + maxColorAttachments, GL_INVALID_OPERATION);
+        }
+    }
+    ctx->m_glInvalidateSubFramebuffer_enc(ctx, target, numAttachments, attachments, x, y, width, height);
+}
+
+void GL2Encoder::s_glDispatchCompute(void* self, GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glDispatchCompute_enc(ctx, num_groups_x, num_groups_y, num_groups_z);
+    ctx->m_state->postDispatchCompute();
+}
+
+void GL2Encoder::s_glDispatchComputeIndirect(void* self, GLintptr indirect) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glDispatchComputeIndirect_enc(ctx, indirect);
+    ctx->m_state->postDispatchCompute();
+}
+
+void GL2Encoder::s_glGenTransformFeedbacks(void* self, GLsizei n, GLuint* ids) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glGenTransformFeedbacks_enc(ctx, n, ids);
+    ctx->m_state->setExistence(GLClientState::ObjectType::TransformFeedback, true, n, ids);
+}
+
+void GL2Encoder::s_glDeleteTransformFeedbacks(void* self, GLsizei n, const GLuint* ids) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(ctx->m_state->getTransformFeedbackActive(), GL_INVALID_OPERATION);
+
+    ctx->m_state->setExistence(GLClientState::ObjectType::TransformFeedback, false, n, ids);
+    ctx->m_glDeleteTransformFeedbacks_enc(ctx, n, ids);
+}
+
+void GL2Encoder::s_glGenSamplers(void* self, GLsizei n, GLuint* ids) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glGenSamplers_enc(ctx, n, ids);
+    ctx->m_state->setExistence(GLClientState::ObjectType::Sampler, true, n, ids);
+}
+
+void GL2Encoder::s_glGenQueries(void* self, GLsizei n, GLuint* ids) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_glGenQueries_enc(ctx, n, ids);
+    ctx->m_state->setExistence(GLClientState::ObjectType::Query, true, n, ids);
+}
+
+void GL2Encoder::s_glDeleteQueries(void* self, GLsizei n, const GLuint* ids) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    ctx->m_state->setExistence(GLClientState::ObjectType::Query, false, n, ids);
+    ctx->m_glDeleteQueries_enc(ctx, n, ids);
+}
+
+void GL2Encoder::s_glBindTransformFeedback(void* self, GLenum target, GLuint id) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(GL_TRANSFORM_FEEDBACK != target, GL_INVALID_ENUM);
+    SET_ERROR_IF(ctx->m_state->getTransformFeedbackActiveUnpaused(), GL_INVALID_OPERATION);
+    SET_ERROR_IF(!ctx->m_state->tryBind(target, id), GL_INVALID_OPERATION);
+    ctx->m_glBindTransformFeedback_enc(ctx, target, id);
+}
+
+void GL2Encoder::s_glBeginQuery(void* self, GLenum target, GLuint query) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(!GLESv2Validation::allowedQueryTarget(target), GL_INVALID_ENUM);
+
+    if (target != GL_ANY_SAMPLES_PASSED_CONSERVATIVE &&
+        target != GL_ANY_SAMPLES_PASSED) {
+        SET_ERROR_IF(ctx->m_state->isQueryBound(target), GL_INVALID_OPERATION);
+    } else {
+        SET_ERROR_IF(ctx->m_state->isQueryBound(GL_ANY_SAMPLES_PASSED_CONSERVATIVE), GL_INVALID_OPERATION);
+        SET_ERROR_IF(ctx->m_state->isQueryBound(GL_ANY_SAMPLES_PASSED), GL_INVALID_OPERATION);
+    }
+
+    GLenum lastTarget = ctx->m_state->getLastQueryTarget(query);
+
+    if (lastTarget) {
+        SET_ERROR_IF(target != lastTarget, GL_INVALID_OPERATION);
+    }
+
+    SET_ERROR_IF(!query, GL_INVALID_OPERATION);
+    SET_ERROR_IF(!ctx->m_state->tryBind(target, query), GL_INVALID_OPERATION);
+    ctx->m_state->setLastQueryTarget(target, query);
+    ctx->m_glBeginQuery_enc(ctx, target, query);
+}
+
+void GL2Encoder::s_glEndQuery(void* self, GLenum target) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(!GLESv2Validation::allowedQueryTarget(target), GL_INVALID_ENUM);
+    SET_ERROR_IF(!ctx->m_state->isBoundTargetValid(target), GL_INVALID_OPERATION);
+    SET_ERROR_IF(!ctx->m_state->tryBind(target, 0), GL_INVALID_OPERATION);
+    ctx->m_glEndQuery_enc(ctx, target);
+}
+
+void GL2Encoder::s_glClear(void* self, GLbitfield mask) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+
+    GLbitfield allowed_bits = GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT;
+    GLbitfield has_disallowed_bits = (mask & ~allowed_bits);
+    SET_ERROR_IF(has_disallowed_bits, GL_INVALID_VALUE);
+
+    ctx->m_glClear_enc(ctx, mask);
+}
+
+void GL2Encoder::s_glCopyTexSubImage2D(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(!GLESv2Validation::textureTarget(ctx, target), GL_INVALID_ENUM);
+    SET_ERROR_IF(level < 0, GL_INVALID_VALUE);
+    GLint max_texture_size;
+    GLint max_cube_map_texture_size;
+    ctx->glGetIntegerv(ctx, GL_MAX_TEXTURE_SIZE, &max_texture_size);
+    ctx->glGetIntegerv(ctx, GL_MAX_CUBE_MAP_TEXTURE_SIZE, &max_cube_map_texture_size);
+    SET_ERROR_IF(level > ilog2(max_texture_size), GL_INVALID_VALUE);
+    SET_ERROR_IF((target == GL_TEXTURE_CUBE_MAP) &&
+                 (level > ilog2(max_cube_map_texture_size)), GL_INVALID_VALUE);
+    SET_ERROR_IF(xoffset < 0 || yoffset < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(width < 0 || height < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(width > max_texture_size, GL_INVALID_VALUE);
+    SET_ERROR_IF(height > max_texture_size, GL_INVALID_VALUE);
+    SET_ERROR_IF(GLESv2Validation::isCubeMapTarget(target) && width > max_cube_map_texture_size, GL_INVALID_VALUE);
+    SET_ERROR_IF(GLESv2Validation::isCubeMapTarget(target) && height > max_cube_map_texture_size, GL_INVALID_VALUE);
+    GLuint tex = ctx->m_state->getBoundTexture(target);
+    GLsizei neededWidth = xoffset + width;
+    GLsizei neededHeight = yoffset + height;
+    ALOGV("%s: tex %u needed width height %d %d xoff %d width %d yoff %d height %d (texture width %d height %d) level %d\n", __func__,
+            tex,
+            neededWidth,
+            neededHeight,
+            xoffset,
+            width,
+            yoffset,
+            height,
+            ctx->m_state->queryTexWidth(level, tex),
+            ctx->m_state->queryTexWidth(level, tex),
+            level);
+
+    SET_ERROR_IF(tex &&
+                 (neededWidth > ctx->m_state->queryTexWidth(level, tex) ||
+                  neededHeight > ctx->m_state->queryTexHeight(level, tex)),
+                 GL_INVALID_VALUE);
+    SET_ERROR_IF(ctx->glCheckFramebufferStatus(ctx, GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE,
+                 GL_INVALID_FRAMEBUFFER_OPERATION);
+
+    ctx->m_glCopyTexSubImage2D_enc(ctx, target, level, xoffset, yoffset, x, y, width, height);
+}
+
+void GL2Encoder::s_glCopyTexSubImage3D(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(target != GL_TEXTURE_3D &&
+                 target != GL_TEXTURE_2D_ARRAY,
+                 GL_INVALID_ENUM);
+    GLint max_texture_size;
+    GLint max_3d_texture_size;
+    ctx->glGetIntegerv(ctx, GL_MAX_TEXTURE_SIZE, &max_texture_size);
+    ctx->glGetIntegerv(ctx, GL_MAX_3D_TEXTURE_SIZE, &max_3d_texture_size);
+    SET_ERROR_IF(level < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(level > ilog2(max_texture_size), GL_INVALID_VALUE);
+    SET_ERROR_IF(level > ilog2(max_3d_texture_size), GL_INVALID_VALUE);
+    SET_ERROR_IF(width < 0 || height < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(xoffset < 0 || yoffset < 0 || zoffset < 0, GL_INVALID_VALUE);
+    GLuint tex = ctx->m_state->getBoundTexture(target);
+    GLsizei neededWidth = xoffset + width;
+    GLsizei neededHeight = yoffset + height;
+    GLsizei neededDepth = zoffset + 1;
+    SET_ERROR_IF(tex &&
+                 (neededWidth > ctx->m_state->queryTexWidth(level, tex) ||
+                  neededHeight > ctx->m_state->queryTexHeight(level, tex) ||
+                  neededDepth > ctx->m_state->queryTexDepth(level, tex)),
+                 GL_INVALID_VALUE);
+    SET_ERROR_IF(ctx->glCheckFramebufferStatus(ctx, GL_READ_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE,
+                 GL_INVALID_FRAMEBUFFER_OPERATION);
+
+    ctx->m_glCopyTexSubImage3D_enc(ctx, target, level, xoffset, yoffset, zoffset, x, y, width, height);
+}
+
+void GL2Encoder::s_glCompileShader(void* self, GLuint shader) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    bool isShaderOrProgramObject =
+        ctx->m_shared->isShaderOrProgramObject(shader);
+    bool isShader =
+        ctx->m_shared->isShader(shader);
+
+    SET_ERROR_IF(isShaderOrProgramObject && !isShader, GL_INVALID_OPERATION);
+    SET_ERROR_IF(!isShaderOrProgramObject && !isShader, GL_INVALID_VALUE);
+
+    ctx->m_glCompileShader_enc(ctx, shader);
+}
+
+void GL2Encoder::s_glValidateProgram(void* self, GLuint program ) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+
+    VALIDATE_PROGRAM_NAME(program);
+
+    ctx->m_glValidateProgram_enc(self, program);
+}
+
+void GL2Encoder::s_glProgramBinary(void *self , GLuint program, GLenum binaryFormat, const void* binary, GLsizei length) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+
+    VALIDATE_PROGRAM_NAME(program);
+
+    SET_ERROR_IF(~0 == binaryFormat, GL_INVALID_ENUM);
+
+    ctx->m_glProgramBinary_enc(self, program, binaryFormat, binary, length);
+}
+
+void GL2Encoder::s_glGetSamplerParameterfv(void *self, GLuint sampler, GLenum pname, GLfloat* params) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+
+    SET_ERROR_IF(!ctx->m_state->samplerExists(sampler), GL_INVALID_OPERATION);
+    SET_ERROR_IF(!GLESv2Validation::samplerParams(ctx, pname), GL_INVALID_ENUM);
+
+    if (!params) return;
+
+    ctx->m_glGetSamplerParameterfv_enc(ctx, sampler, pname, params);
+}
+
+void GL2Encoder::s_glGetSamplerParameteriv(void *self, GLuint sampler, GLenum pname, GLint* params) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(!ctx->m_state->samplerExists(sampler), GL_INVALID_OPERATION);
+    SET_ERROR_IF(!GLESv2Validation::samplerParams(ctx, pname), GL_INVALID_ENUM);
+
+    if (!params) return;
+
+    ctx->m_glGetSamplerParameteriv_enc(ctx, sampler, pname, params);
+}
+
+void GL2Encoder::s_glSamplerParameterf(void *self , GLuint sampler, GLenum pname, GLfloat param) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(!ctx->m_state->samplerExists(sampler), GL_INVALID_OPERATION);
+    SET_ERROR_IF(!GLESv2Validation::samplerParams(ctx, pname), GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::textureParamValue(ctx, pname, (GLint)param, param, (GLenum)param), GL_INVALID_ENUM);
+
+    ctx->m_glSamplerParameterf_enc(ctx, sampler, pname, param);
+}
+
+void GL2Encoder::s_glSamplerParameteri(void *self , GLuint sampler, GLenum pname, GLint param) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(!ctx->m_state->samplerExists(sampler), GL_INVALID_OPERATION);
+    SET_ERROR_IF(!GLESv2Validation::samplerParams(ctx, pname), GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::textureParamValue(ctx, pname, param, (GLfloat)param, (GLenum)param), GL_INVALID_ENUM);
+
+    ctx->m_glSamplerParameteri_enc(ctx, sampler, pname, param);
+}
+
+void GL2Encoder::s_glSamplerParameterfv(void *self , GLuint sampler, GLenum pname, const GLfloat* params) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(!ctx->m_state->samplerExists(sampler), GL_INVALID_OPERATION);
+    SET_ERROR_IF(!GLESv2Validation::samplerParams(ctx, pname), GL_INVALID_ENUM);
+    SET_ERROR_IF(!params, GL_INVALID_VALUE);
+    GLfloat param = *params;
+    SET_ERROR_IF(!GLESv2Validation::textureParamValue(ctx, pname, (GLint)param, param, (GLenum)param), GL_INVALID_ENUM);
+
+    ctx->m_glSamplerParameterfv_enc(ctx, sampler, pname, params);
+}
+
+void GL2Encoder::s_glSamplerParameteriv(void *self , GLuint sampler, GLenum pname, const GLint* params) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(!ctx->m_state->samplerExists(sampler), GL_INVALID_OPERATION);
+    SET_ERROR_IF(!GLESv2Validation::samplerParams(ctx, pname), GL_INVALID_ENUM);
+    SET_ERROR_IF(!params, GL_INVALID_VALUE);
+    GLint param = *params;
+    SET_ERROR_IF(!GLESv2Validation::textureParamValue(ctx, pname, (GLint)param, param, (GLenum)param), GL_INVALID_ENUM);
+
+    ctx->m_glSamplerParameteriv_enc(ctx, sampler, pname, params);
+}
+
+int GL2Encoder::s_glGetAttribLocation(void *self , GLuint program, const GLchar* name) {
+    GL2Encoder *ctx = (GL2Encoder*)self;
+
+    bool isShaderOrProgramObject =
+        ctx->m_shared->isShaderOrProgramObject(program);
+    bool isProgram =
+        ctx->m_shared->isProgram(program);
+
+    RET_AND_SET_ERROR_IF(!isShaderOrProgramObject, GL_INVALID_VALUE, -1);
+    RET_AND_SET_ERROR_IF(!isProgram, GL_INVALID_OPERATION, -1);
+    RET_AND_SET_ERROR_IF(!ctx->m_shared->getProgramLinkStatus(program), GL_INVALID_OPERATION, -1);
+
+    return ctx->m_glGetAttribLocation_enc(ctx, program, name);
+}
+
+void GL2Encoder::s_glBindAttribLocation(void *self , GLuint program, GLuint index, const GLchar* name) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+
+    VALIDATE_PROGRAM_NAME(program);
+
+    GLint maxVertexAttribs;
+    ctx->glGetIntegerv(self, GL_MAX_VERTEX_ATTRIBS, &maxVertexAttribs);
+    SET_ERROR_IF(!(index < maxVertexAttribs), GL_INVALID_VALUE);
+    SET_ERROR_IF(index > maxVertexAttribs, GL_INVALID_VALUE);
+    SET_ERROR_IF(name && !strncmp("gl_", name, 3), GL_INVALID_OPERATION);
+
+    fprintf(stderr, "%s: bind attrib %u name %s\n", __func__, index, name);
+    ctx->m_glBindAttribLocation_enc(ctx, program, index, name);
+}
+
+// TODO-SLOW
+void GL2Encoder::s_glUniformBlockBinding(void *self , GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+
+    VALIDATE_PROGRAM_NAME(program);
+    SET_ERROR_IF(uniformBlockIndex >= ctx->m_shared->getActiveUniformBlockCount(program), GL_INVALID_VALUE);
+
+    GLint maxUniformBufferBindings;
+    ctx->glGetIntegerv(ctx, GL_MAX_UNIFORM_BUFFER_BINDINGS, &maxUniformBufferBindings);
+    SET_ERROR_IF(uniformBlockBinding >= maxUniformBufferBindings, GL_INVALID_VALUE);
+
+    ctx->m_glUniformBlockBinding_enc(ctx, program, uniformBlockIndex, uniformBlockBinding);
+}
+
+void GL2Encoder::s_glGetTransformFeedbackVarying(void *self , GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, char* name) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+
+    VALIDATE_PROGRAM_NAME(program);
+    SET_ERROR_IF(!ctx->m_shared->getProgramLinkStatus(program), GL_INVALID_OPERATION);
+    SET_ERROR_IF(index >= ctx->m_shared->getTransformFeedbackVaryingsCountForProgram(program), GL_INVALID_VALUE);
+
+    ctx->m_glGetTransformFeedbackVarying_enc(ctx, program, index, bufSize, length, size, type, name);
+}
+
+void GL2Encoder::s_glScissor(void *self , GLint x, GLint y, GLsizei width, GLsizei height) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(width < 0 || height < 0, GL_INVALID_VALUE);
+    ctx->m_glScissor_enc(ctx, x, y, width, height);
+}
+
+void GL2Encoder::s_glDepthFunc(void *self , GLenum func) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(
+        (func != GL_NEVER) &&
+        (func != GL_ALWAYS) &&
+        (func != GL_LESS) &&
+        (func != GL_LEQUAL) &&
+        (func != GL_EQUAL) &&
+        (func != GL_GREATER) &&
+        (func != GL_GEQUAL) &&
+        (func != GL_NOTEQUAL),
+        GL_INVALID_ENUM);
+    ctx->m_glDepthFunc_enc(ctx, func);
+}
+
+void GL2Encoder::s_glViewport(void *self , GLint x, GLint y, GLsizei width, GLsizei height) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(width < 0 || height < 0, GL_INVALID_VALUE);
+    ctx->m_glViewport_enc(ctx, x, y, width, height);
+}
+
+void GL2Encoder::s_glStencilFunc(void *self , GLenum func, GLint ref, GLuint mask) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(!GLESv2Validation::allowedFunc(func), GL_INVALID_ENUM);
+    if (!ctx->m_state) return;
+    ctx->m_state->stencilFuncSeparate(GL_FRONT_AND_BACK, func, ref, mask);
+    ctx->m_glStencilFunc_enc(ctx, func, ref, mask);
+}
+
+void GL2Encoder::s_glStencilFuncSeparate(void *self , GLenum face, GLenum func, GLint ref, GLuint mask) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(!GLESv2Validation::allowedFace(face) || !GLESv2Validation::allowedFunc(func), GL_INVALID_ENUM);
+    if (!ctx->m_state) return;
+    ctx->m_state->stencilFuncSeparate(face, func, ref, mask);
+    ctx->m_glStencilFuncSeparate_enc(ctx, face, func, ref, mask);
+}
+
+void GL2Encoder::s_glStencilOp(void *self , GLenum fail, GLenum zfail, GLenum zpass) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(
+        !GLESv2Validation::allowedStencilOp(fail) ||
+        !GLESv2Validation::allowedStencilOp(zfail) ||
+        !GLESv2Validation::allowedStencilOp(zpass),
+        GL_INVALID_ENUM);
+    if (!ctx->m_state) return;
+    ctx->m_state->stencilOpSeparate(GL_FRONT_AND_BACK, fail, zfail, zpass);
+    ctx->m_glStencilOp_enc(ctx, fail, zfail, zpass);
+}
+
+void GL2Encoder::s_glStencilOpSeparate(void *self , GLenum face, GLenum fail, GLenum zfail, GLenum zpass) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(
+        !GLESv2Validation::allowedFace(face) ||
+        !GLESv2Validation::allowedStencilOp(fail) ||
+        !GLESv2Validation::allowedStencilOp(zfail) ||
+        !GLESv2Validation::allowedStencilOp(zpass),
+        GL_INVALID_ENUM);
+    if (!ctx->m_state) return;
+    ctx->m_state->stencilOpSeparate(face, fail, zfail, zpass);
+    ctx->m_glStencilOpSeparate_enc(ctx, face, fail, zfail, zpass);
+}
+
+void GL2Encoder::s_glStencilMaskSeparate(void *self , GLenum face, GLuint mask) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(
+        !GLESv2Validation::allowedFace(face),
+        GL_INVALID_ENUM);
+    if (!ctx->m_state) return;
+    ctx->m_state->stencilMaskSeparate(face, mask);
+    ctx->m_glStencilMaskSeparate_enc(ctx, face, mask);
+}
+
+void GL2Encoder::s_glBlendEquation(void *self , GLenum mode) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(
+        !GLESv2Validation::allowedBlendEquation(mode),
+        GL_INVALID_ENUM);
+    ctx->m_glBlendEquation_enc(ctx, mode);
+}
+
+void GL2Encoder::s_glBlendEquationSeparate(void *self , GLenum modeRGB, GLenum modeAlpha) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(
+        !GLESv2Validation::allowedBlendEquation(modeRGB) ||
+        !GLESv2Validation::allowedBlendEquation(modeAlpha),
+        GL_INVALID_ENUM);
+    ctx->m_glBlendEquationSeparate_enc(ctx, modeRGB, modeAlpha);
+}
+
+void GL2Encoder::s_glBlendFunc(void *self , GLenum sfactor, GLenum dfactor) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(
+        !GLESv2Validation::allowedBlendFunc(sfactor) ||
+        !GLESv2Validation::allowedBlendFunc(dfactor),
+        GL_INVALID_ENUM);
+    ctx->m_glBlendFunc_enc(ctx, sfactor, dfactor);
+}
+
+void GL2Encoder::s_glBlendFuncSeparate(void *self , GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(
+        !GLESv2Validation::allowedBlendFunc(srcRGB) ||
+        !GLESv2Validation::allowedBlendFunc(dstRGB) ||
+        !GLESv2Validation::allowedBlendFunc(srcAlpha) ||
+        !GLESv2Validation::allowedBlendFunc(dstAlpha),
+        GL_INVALID_ENUM);
+    ctx->m_glBlendFuncSeparate_enc(ctx, srcRGB, dstRGB, srcAlpha, dstAlpha);
+}
+
+void GL2Encoder::s_glCullFace(void *self , GLenum mode) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(
+        !GLESv2Validation::allowedCullFace(mode),
+        GL_INVALID_ENUM);
+    ctx->m_glCullFace_enc(ctx, mode);
+}
+
+void GL2Encoder::s_glFrontFace(void *self , GLenum mode) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(
+        !GLESv2Validation::allowedFrontFace(mode),
+        GL_INVALID_ENUM);
+    ctx->m_glFrontFace_enc(ctx, mode);
+}
+
+void GL2Encoder::s_glLineWidth(void *self , GLfloat width) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(width <= 0.0f, GL_INVALID_VALUE);
+    ctx->m_glLineWidth_enc(ctx, width);
+}
+
+void GL2Encoder::s_glVertexAttrib1f(void *self , GLuint indx, GLfloat x) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    VALIDATE_VERTEX_ATTRIB_INDEX(indx);
+    ctx->m_glVertexAttrib1f_enc(ctx, indx, x);
+}
+
+void GL2Encoder::s_glVertexAttrib2f(void *self , GLuint indx, GLfloat x, GLfloat y) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    VALIDATE_VERTEX_ATTRIB_INDEX(indx);
+    ctx->m_glVertexAttrib2f_enc(ctx, indx, x, y);
+}
+
+void GL2Encoder::s_glVertexAttrib3f(void *self , GLuint indx, GLfloat x, GLfloat y, GLfloat z) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    VALIDATE_VERTEX_ATTRIB_INDEX(indx);
+    ctx->m_glVertexAttrib3f_enc(ctx, indx, x, y, z);
+}
+
+void GL2Encoder::s_glVertexAttrib4f(void *self , GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    VALIDATE_VERTEX_ATTRIB_INDEX(indx);
+    ctx->m_glVertexAttrib4f_enc(ctx, indx, x, y, z, w);
+}
+
+void GL2Encoder::s_glVertexAttrib1fv(void *self , GLuint indx, const GLfloat* values) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    VALIDATE_VERTEX_ATTRIB_INDEX(indx);
+    ctx->m_glVertexAttrib1fv_enc(ctx, indx, values);
+}
+
+void GL2Encoder::s_glVertexAttrib2fv(void *self , GLuint indx, const GLfloat* values) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    VALIDATE_VERTEX_ATTRIB_INDEX(indx);
+    ctx->m_glVertexAttrib2fv_enc(ctx, indx, values);
+}
+
+void GL2Encoder::s_glVertexAttrib3fv(void *self , GLuint indx, const GLfloat* values) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    VALIDATE_VERTEX_ATTRIB_INDEX(indx);
+    ctx->m_glVertexAttrib3fv_enc(ctx, indx, values);
+}
+
+void GL2Encoder::s_glVertexAttrib4fv(void *self , GLuint indx, const GLfloat* values) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    VALIDATE_VERTEX_ATTRIB_INDEX(indx);
+    ctx->m_glVertexAttrib4fv_enc(ctx, indx, values);
+}
+
+void GL2Encoder::s_glVertexAttribI4i(void *self , GLuint index, GLint v0, GLint v1, GLint v2, GLint v3) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    VALIDATE_VERTEX_ATTRIB_INDEX(index);
+    ctx->m_glVertexAttribI4i_enc(ctx, index, v0, v1, v2, v3);
+}
+
+void GL2Encoder::s_glVertexAttribI4ui(void *self , GLuint index, GLuint v0, GLuint v1, GLuint v2, GLuint v3) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    VALIDATE_VERTEX_ATTRIB_INDEX(index);
+    ctx->m_glVertexAttribI4ui_enc(ctx, index, v0, v1, v2, v3);
+}
+
+void GL2Encoder::s_glVertexAttribI4iv(void *self , GLuint index, const GLint* v) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    VALIDATE_VERTEX_ATTRIB_INDEX(index);
+    ctx->m_glVertexAttribI4iv_enc(ctx, index, v);
+}
+
+void GL2Encoder::s_glVertexAttribI4uiv(void *self , GLuint index, const GLuint* v) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    VALIDATE_VERTEX_ATTRIB_INDEX(index);
+    ctx->m_glVertexAttribI4uiv_enc(ctx, index, v);
+}
+
+void GL2Encoder::s_glGetShaderPrecisionFormat(void *self , GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(!GLESv2Validation::allowedShaderType(shadertype), GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::allowedPrecisionType(precisiontype), GL_INVALID_ENUM);
+    ctx->m_glGetShaderPrecisionFormat_enc(ctx, shadertype, precisiontype, range, precision);
+}
+
+void GL2Encoder::s_glGetProgramiv(void *self , GLuint program, GLenum pname, GLint* params) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(!GLESv2Validation::allowedGetProgram(ctx->majorVersion(), ctx->minorVersion(), pname), GL_INVALID_ENUM);
+    VALIDATE_PROGRAM_NAME(program);
+    ctx->m_glGetProgramiv_enc(ctx, program, pname, params);
+}
+
+void GL2Encoder::s_glGetActiveUniform(void *self , GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    VALIDATE_PROGRAM_NAME(program);
+    SET_ERROR_IF(index >= ctx->m_shared->getActiveUniformsCountForProgram(program), GL_INVALID_VALUE);
+    ctx->m_glGetActiveUniform_enc(ctx, program, index, bufsize, length, size, type, name);
+}
+
+void GL2Encoder::s_glGetActiveUniformsiv(void *self , GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    VALIDATE_PROGRAM_NAME(program);
+    SET_ERROR_IF(uniformCount < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(!GLESv2Validation::allowedGetActiveUniforms(pname), GL_INVALID_ENUM);
+    int activeUniformsCount = ctx->m_shared->getActiveUniformsCountForProgram(program);
+    for (GLsizei i = 0; i < uniformCount; ++i) {
+        SET_ERROR_IF(uniformIndices[i] >= activeUniformsCount, GL_INVALID_VALUE);
+    }
+    ctx->m_glGetActiveUniformsiv_enc(ctx, program, uniformCount, uniformIndices, pname, params);
+}
+
+void GL2Encoder::s_glGetActiveUniformBlockName(void *self , GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    VALIDATE_PROGRAM_NAME(program);
+    SET_ERROR_IF(bufSize < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(uniformBlockIndex >= ctx->m_shared->getActiveUniformBlockCount(program), GL_INVALID_VALUE);
+    ctx->m_glGetActiveUniformBlockName_enc(ctx, program, uniformBlockIndex, bufSize, length, uniformBlockName);
+}
+
+void GL2Encoder::s_glGetActiveAttrib(void *self , GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    VALIDATE_PROGRAM_NAME(program);
+    VALIDATE_VERTEX_ATTRIB_INDEX(index);
+    SET_ERROR_IF(bufsize < 0, GL_INVALID_VALUE);
+    SET_ERROR_IF(index >= ctx->m_shared->getActiveAttributesCountForProgram(program), GL_INVALID_VALUE);
+    ctx->m_glGetActiveAttrib_enc(ctx, program, index, bufsize, length, size, type, name);
+}
+
+void GL2Encoder::s_glGetRenderbufferParameteriv(void *self , GLenum target, GLenum pname, GLint* params) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(target != GL_RENDERBUFFER, GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::allowedGetRenderbufferParameter(pname), GL_INVALID_ENUM);
+    SET_ERROR_IF(0 == ctx->m_state->boundRenderbuffer(), GL_INVALID_OPERATION);
+    ctx->m_glGetRenderbufferParameteriv_enc(ctx, target, pname, params);
+}
+
+void GL2Encoder::s_glGetQueryiv(void *self , GLenum target, GLenum pname, GLint* params) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(!GLESv2Validation::allowedQueryTarget(target), GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::allowedQueryParam(pname), GL_INVALID_ENUM);
+    ctx->m_glGetQueryiv_enc(ctx, target, pname, params);
+}
+
+void GL2Encoder::s_glGetQueryObjectuiv(void *self , GLuint query, GLenum pname, GLuint* params) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    GLClientState* state = ctx->m_state;
+    SET_ERROR_IF(!GLESv2Validation::allowedQueryObjectParam(pname), GL_INVALID_ENUM);
+    SET_ERROR_IF(!state->queryExistence(GLClientState::ObjectType::Query, query), GL_INVALID_OPERATION);
+    SET_ERROR_IF(!state->getLastQueryTarget(query), GL_INVALID_OPERATION);
+    SET_ERROR_IF(ctx->m_state->isQueryObjectActive(query), GL_INVALID_OPERATION);
+
+    ctx->m_glGetQueryObjectuiv_enc(ctx, query, pname, params);
+}
+
+GLboolean GL2Encoder::s_glIsEnabled(void *self , GLenum cap) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    RET_AND_SET_ERROR_IF(!GLESv2Validation::allowedEnable(ctx->majorVersion(), ctx->minorVersion(), cap), GL_INVALID_ENUM, 0);
+    return ctx->m_glIsEnabled_enc(ctx, cap);
+}
+
+void GL2Encoder::s_glHint(void *self , GLenum target, GLenum mode) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    SET_ERROR_IF(!GLESv2Validation::allowedHintTarget(target), GL_INVALID_ENUM);
+    SET_ERROR_IF(!GLESv2Validation::allowedHintMode(mode), GL_INVALID_ENUM);
+    ctx->m_glHint_enc(ctx, target, mode);
+}
+
+GLint GL2Encoder::s_glGetFragDataLocation (void *self , GLuint program, const char* name) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    VALIDATE_PROGRAM_NAME_RET(program, -1);
+    RET_AND_SET_ERROR_IF(!ctx->m_shared->getProgramLinkStatus(program), GL_INVALID_OPERATION, -1);
+    return ctx->m_glGetFragDataLocation_enc(ctx, program, name);
+}
+
+void GL2Encoder::s_glStencilMask(void* self, GLuint mask) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    if (!ctx->m_state) return;
+    ctx->m_state->stencilMaskSeparate(GL_FRONT_AND_BACK, mask);
+    ctx->m_glStencilMask_enc(ctx, mask);
+}
+
+void GL2Encoder::s_glClearStencil(void* self, int v) {
+    GL2Encoder* ctx = (GL2Encoder*)self;
+    if (!ctx->m_state) return;
+    ctx->m_state->state_GL_STENCIL_CLEAR_VALUE = v;
+    ctx->m_glClearStencil_enc(ctx, v);
+}
diff --git a/system/GLESv2_enc/GL2Encoder.h b/system/GLESv2_enc/GL2Encoder.h
new file mode 100644
index 0000000..e36538b
--- /dev/null
+++ b/system/GLESv2_enc/GL2Encoder.h
@@ -0,0 +1,1015 @@
+/*
+* Copyright (C) 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#ifndef _GL2_ENCODER_H_
+#define _GL2_ENCODER_H_
+
+#include "gl2_enc.h"
+#include "GLClientState.h"
+#include "GLSharedGroup.h"
+
+#include <string>
+#include <vector>
+
+struct Extensions
+{
+    Extensions() = default;
+    Extensions(const Extensions &other) = default;
+
+    Extensions &operator=(const Extensions &other) = default;
+
+    bool textureBufferAny() const { return textureBufferEXT || textureBufferOES; }
+    // GL_EXT_texture_buffer
+    bool textureBufferEXT = false;
+
+    // GL_OES_texture_buffer
+    bool textureBufferOES = false;
+
+    // GL_EXT_draw_buffers_indexed
+    bool drawBuffersIndexedEXT = false;
+};
+
+class GL2Encoder : public gl2_encoder_context_t {
+public:
+    GL2Encoder(gfxstream::IOStream *stream, ChecksumCalculator* protocol);
+    virtual ~GL2Encoder();
+    const Extensions& getExtensions() const { return m_extensions; }
+    void setDrawCallFlushInterval(uint32_t interval) {
+        m_drawCallFlushInterval = interval;
+    }
+    void setHasAsyncUnmapBuffer(int version) {
+        m_hasAsyncUnmapBuffer = version;
+    }
+    void setHasSyncBufferData(bool value) {
+        m_hasSyncBufferData = value;
+    }
+    void setNoHostError(bool noHostError) {
+        m_noHostError = noHostError;
+    }
+    void setClientState(GLClientState *state) {
+        m_state = state;
+    }
+    void setVersion(int major, int minor,
+                    int deviceMajor, int deviceMinor) {
+        m_currMajorVersion = major;
+        m_currMinorVersion = minor;
+        m_deviceMajorVersion = deviceMajor;
+        m_deviceMinorVersion = deviceMinor;
+    }
+    void setClientStateMakeCurrent(GLClientState *state,
+                                   int majorVersion,
+                                   int minorVersion,
+                                   int deviceMajorVersion,
+                                   int deviceMinorVersion) {
+        m_state = state;
+        m_state->fromMakeCurrent();
+        m_currMajorVersion = majorVersion;
+        m_currMinorVersion = minorVersion;
+        m_deviceMajorVersion = deviceMajorVersion;
+        m_deviceMinorVersion = deviceMinorVersion;
+    }
+    void setSharedGroup(GLSharedGroupPtr shared) {
+        m_shared = shared;
+        if (m_state && m_shared) {
+            m_state->setTextureData(m_shared->getTextureData());
+            m_state->setRenderbufferInfo(m_shared->getRenderbufferInfo());
+            m_state->setSamplerInfo(m_shared->getSamplerInfo());
+        }
+    }
+    bool es32Plus() const { return m_currMajorVersion > 3 || (m_currMajorVersion == 3 && m_currMinorVersion >= 2); }
+    int majorVersion() const { return m_currMajorVersion; }
+    int minorVersion() const { return m_currMinorVersion; }
+    void setExtensions(const char* exts,
+                       const std::vector<std::string>& extArray) {
+        m_currExtensions = std::string(exts);
+        m_currExtensionsArray = extArray;
+        m_state->setExtensions(m_currExtensions);
+
+        m_extensions.textureBufferEXT = hasExtension("GL_EXT_texture_buffer");
+        m_extensions.textureBufferOES = hasExtension("GL_OES_texture_buffer");
+        m_extensions.drawBuffersIndexedEXT = hasExtension("GL_EXT_draw_buffers_indexed");
+    }
+    bool hasExtension(const char* ext) const {
+        return m_currExtensions.find(ext) != std::string::npos;
+    }
+    const GLClientState *state() { return m_state; }
+    const GLSharedGroupPtr shared() { return m_shared; }
+    void flush() { m_stream->flush(); }
+
+    void setInitialized(){ m_initialized = true; };
+    bool isInitialized(){ return m_initialized; };
+
+    virtual void setError(GLenum error){ m_error = error; };
+    virtual GLenum getError() { return m_error; };
+
+    __attribute__((always_inline)) GLenum* getErrorPtr() { return &m_error; }
+    __attribute__((always_inline)) bool hasError() const { return m_error != GL_NO_ERROR; }
+
+    void override2DTextureTarget(GLenum target);
+    void restore2DTextureTarget(GLenum target);
+    void associateEGLImage(GLenum target, GLeglImageOES eglImage, int width, int height);
+
+    // Convenience functions for buffers
+    GLuint boundBuffer(GLenum target) const;
+    BufferData* getBufferData(GLenum target) const;
+    BufferData* getBufferDataById(GLuint buffer) const;
+    bool isBufferMapped(GLuint buffer) const;
+    bool isBufferTargetMapped(GLenum target) const;
+
+private:
+
+    int m_currMajorVersion;
+    int m_currMinorVersion;
+    int m_deviceMajorVersion;
+    int m_deviceMinorVersion;
+    std::string m_currExtensions;
+    std::vector<std::string> m_currExtensionsArray;
+
+    Extensions m_extensions;
+
+    bool    m_hasAsyncUnmapBuffer;
+    bool    m_hasSyncBufferData;
+    bool    m_initialized;
+    bool    m_noHostError;
+    GLClientState *m_state;
+    GLSharedGroupPtr m_shared;
+    GLenum  m_error;
+
+    GLint *m_compressedTextureFormats;
+    GLint m_num_compressedTextureFormats;
+    GLint *getCompressedTextureFormats();
+
+    GLint m_max_combinedTextureImageUnits;
+    GLint m_max_vertexTextureImageUnits;
+    GLint m_max_array_texture_layers;;
+    GLint m_max_textureImageUnits;
+    GLint m_max_cubeMapTextureSize;
+    GLint m_max_renderBufferSize;
+    GLint m_max_textureSize;
+    GLint m_max_3d_textureSize;
+    GLint m_max_vertexAttribStride;
+
+    GLint m_max_transformFeedbackSeparateAttribs;
+    GLint m_max_uniformBufferBindings;
+    GLint m_max_colorAttachments;
+    GLint m_max_drawBuffers;
+
+    GLint m_max_atomicCounterBufferBindings;
+    GLint m_max_shaderStorageBufferBindings;
+    GLint m_max_vertexAttribBindings;
+    GLint m_textureBufferOffsetAlign;
+
+    GLuint m_ssbo_offset_align;
+    GLuint m_ubo_offset_align;
+
+    GLint m_log2MaxTextureSize;
+
+    std::vector<char> m_fixedBuffer;
+
+    uint32_t m_drawCallFlushInterval;
+    uint32_t m_drawCallFlushCount;
+
+    bool m_primitiveRestartEnabled;
+    GLuint m_primitiveRestartIndex;
+
+    void calcIndexRange(const void* indices,
+                        GLenum type, GLsizei count,
+                        int* minIndex, int* maxIndex);
+    void* recenterIndices(const void* src,
+                          GLenum type, GLsizei count,
+                          int minIndex);
+    void getBufferIndexRange(BufferData* buf, const void* dataWithOffset,
+                             GLenum type, size_t count, size_t offset,
+                             int* minIndex_out, int* maxIndex_out);
+    void getVBOUsage(bool* hasClientArrays, bool* hasVBOs) const;
+    void sendVertexAttributes(GLint first, GLsizei count, bool hasClientArrays, GLsizei primcount = 0);
+    void flushDrawCall();
+
+    bool updateHostTexture2DBinding(GLenum texUnit, GLenum newTarget);
+    void updateHostTexture2DBindingsFromProgramData(GLuint program);
+    bool texture2DNeedsOverride(GLenum target) const;
+
+    // Utility classes for safe queries that
+    // need access to private class members
+    class ErrorUpdater;
+    template<class T> class ScopedQueryUpdate;
+    
+    // General queries
+    void safe_glGetBooleanv(GLenum param, GLboolean *val);
+    void safe_glGetFloatv(GLenum param, GLfloat *val);
+    void safe_glGetIntegerv(GLenum param, GLint *val);
+    void safe_glGetInteger64v(GLenum param, GLint64 *val);
+    void safe_glGetIntegeri_v(GLenum param, GLuint index, GLint *val);
+    void safe_glGetInteger64i_v(GLenum param, GLuint index, GLint64 *val);
+    void safe_glGetBooleani_v(GLenum param, GLuint index, GLboolean *val);
+
+    // API implementation
+    glGetError_client_proc_t    m_glGetError_enc;
+    static GLenum s_glGetError(void * self);
+
+    glFlush_client_proc_t m_glFlush_enc;
+    static void s_glFlush(void * self);
+
+    glPixelStorei_client_proc_t m_glPixelStorei_enc;
+    static void s_glPixelStorei(void *self, GLenum param, GLint value);
+
+    glGetString_client_proc_t m_glGetString_enc;
+    static const GLubyte * s_glGetString(void *self, GLenum name);
+
+    glBindBuffer_client_proc_t m_glBindBuffer_enc;
+    static void s_glBindBuffer(void *self, GLenum target, GLuint id);
+    void doBindBufferEncodeCached(GLenum taret, GLuint id);
+
+    glBufferData_client_proc_t m_glBufferData_enc;
+    static void s_glBufferData(void *self, GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage);
+    glBufferSubData_client_proc_t m_glBufferSubData_enc;
+    static void s_glBufferSubData(void *self, GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data);
+
+    glGenBuffers_client_proc_t m_glGenBuffers_enc;
+    static void s_glGenBuffers(void *self, GLsizei n, GLuint * buffers);
+
+    glDeleteBuffers_client_proc_t m_glDeleteBuffers_enc;
+    static void s_glDeleteBuffers(void *self, GLsizei n, const GLuint * buffers);
+
+    glDrawArrays_client_proc_t m_glDrawArrays_enc;
+    static void s_glDrawArrays(void *self, GLenum mode, GLint first, GLsizei count);
+
+    glDrawElements_client_proc_t m_glDrawElements_enc;
+    static void s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum type, const void *indices);
+
+    glDrawArraysNullAEMU_client_proc_t m_glDrawArraysNullAEMU_enc;
+    static void s_glDrawArraysNullAEMU(void *self, GLenum mode, GLint first, GLsizei count);
+
+    glDrawElementsNullAEMU_client_proc_t m_glDrawElementsNullAEMU_enc;
+    static void s_glDrawElementsNullAEMU(void *self, GLenum mode, GLsizei count, GLenum type, const void *indices);
+
+    glGetIntegerv_client_proc_t m_glGetIntegerv_enc;
+    static void s_glGetIntegerv(void *self, GLenum pname, GLint *ptr);
+
+    glGetFloatv_client_proc_t m_glGetFloatv_enc;
+    static void s_glGetFloatv(void *self, GLenum pname, GLfloat *ptr);
+
+    glGetBooleanv_client_proc_t m_glGetBooleanv_enc;
+    static void s_glGetBooleanv(void *self, GLenum pname, GLboolean *ptr);
+
+    glGetInteger64v_client_proc_t m_glGetInteger64v_enc;
+    static void s_glGetInteger64v(void* self, GLenum param, GLint64* val);
+
+    glGetBooleani_v_client_proc_t m_glGetBooleani_v_enc;
+    static void s_glGetBooleani_v(void* self, GLenum param, GLuint index, GLboolean* val);
+
+    glVertexAttribPointer_client_proc_t m_glVertexAttribPointer_enc;
+    static void s_glVertexAttribPointer(void *self, GLuint indx, GLint size, GLenum type,
+                                        GLboolean normalized, GLsizei stride, const GLvoid * ptr);
+
+    glEnableVertexAttribArray_client_proc_t m_glEnableVertexAttribArray_enc;
+    static void s_glEnableVertexAttribArray(void *self, GLuint index);
+
+    glDisableVertexAttribArray_client_proc_t m_glDisableVertexAttribArray_enc;
+    static void s_glDisableVertexAttribArray(void *self, GLuint index);
+
+    glGetVertexAttribiv_client_proc_t m_glGetVertexAttribiv_enc;
+    static void s_glGetVertexAttribiv(void *self, GLuint index, GLenum pname, GLint *params);
+
+    glGetVertexAttribfv_client_proc_t m_glGetVertexAttribfv_enc;
+    static void s_glGetVertexAttribfv(void *self, GLuint index, GLenum pname, GLfloat *params);
+
+    glGetVertexAttribPointerv_client_proc_t m_glGetVertexAttribPointerv_enc;
+    static void s_glGetVertexAttribPointerv(void *self, GLuint index, GLenum pname, GLvoid **pointer);
+
+    static void s_glShaderBinary(void *self, GLsizei n, const GLuint *shaders, GLenum binaryformat, const void* binary, GLsizei length);
+
+    static void s_glShaderSource(void *self, GLuint shader, GLsizei count, const GLchar * const *string, const GLint *length);
+
+    static void s_glFinish(void *self);
+
+    glLinkProgram_client_proc_t m_glLinkProgram_enc;
+    static void s_glLinkProgram(void *self, GLuint program);
+
+    glDeleteProgram_client_proc_t m_glDeleteProgram_enc;
+    static void s_glDeleteProgram(void * self, GLuint program);
+
+    glGetUniformiv_client_proc_t m_glGetUniformiv_enc;
+    static void s_glGetUniformiv(void *self, GLuint program, GLint location , GLint *params);
+
+    glGetUniformfv_client_proc_t m_glGetUniformfv_enc;
+    static void s_glGetUniformfv(void *self, GLuint program, GLint location , GLfloat *params);
+
+    glCreateProgram_client_proc_t m_glCreateProgram_enc;
+    static GLuint s_glCreateProgram(void *self);
+
+    glCreateShader_client_proc_t m_glCreateShader_enc;
+    static GLuint s_glCreateShader(void *self, GLenum shaderType);
+
+    glDeleteShader_client_proc_t m_glDeleteShader_enc;
+    static void s_glDeleteShader(void *self, GLuint shader);
+
+    glAttachShader_client_proc_t m_glAttachShader_enc;
+    static void s_glAttachShader(void *self, GLuint program, GLuint shader);
+
+    glDetachShader_client_proc_t m_glDetachShader_enc;
+    static void s_glDetachShader(void *self, GLuint program, GLuint shader);
+
+    glGetAttachedShaders_client_proc_t m_glGetAttachedShaders_enc;
+    static void s_glGetAttachedShaders(void *self, GLuint program, GLsizei maxCount,
+            GLsizei* count, GLuint* shaders);
+
+    glGetShaderSource_client_proc_t m_glGetShaderSource_enc;
+    static void s_glGetShaderSource(void *self, GLuint shader, GLsizei bufsize,
+            GLsizei* length, GLchar* source);
+
+    glGetShaderInfoLog_client_proc_t m_glGetShaderInfoLog_enc;
+    static void s_glGetShaderInfoLog(void *self,GLuint shader,
+            GLsizei bufsize, GLsizei* length, GLchar* infolog);
+
+    glGetProgramInfoLog_client_proc_t m_glGetProgramInfoLog_enc;
+    static void s_glGetProgramInfoLog(void *self,GLuint program,
+            GLsizei bufsize, GLsizei* length, GLchar* infolog);
+
+    glGetUniformLocation_client_proc_t m_glGetUniformLocation_enc;
+    static int s_glGetUniformLocation(void *self, GLuint program, const GLchar *name);
+    glUseProgram_client_proc_t m_glUseProgram_enc;
+
+    glUniform1f_client_proc_t m_glUniform1f_enc;
+    glUniform1fv_client_proc_t m_glUniform1fv_enc;
+    glUniform1i_client_proc_t m_glUniform1i_enc;
+    glUniform1iv_client_proc_t m_glUniform1iv_enc;
+    glUniform2f_client_proc_t m_glUniform2f_enc;
+    glUniform2fv_client_proc_t m_glUniform2fv_enc;
+    glUniform2i_client_proc_t m_glUniform2i_enc;
+    glUniform2iv_client_proc_t m_glUniform2iv_enc;
+    glUniform3f_client_proc_t m_glUniform3f_enc;
+    glUniform3fv_client_proc_t m_glUniform3fv_enc;
+    glUniform3i_client_proc_t m_glUniform3i_enc;
+    glUniform3iv_client_proc_t m_glUniform3iv_enc;
+    glUniform4f_client_proc_t m_glUniform4f_enc;
+    glUniform4fv_client_proc_t m_glUniform4fv_enc;
+    glUniform4i_client_proc_t m_glUniform4i_enc;
+    glUniform4iv_client_proc_t m_glUniform4iv_enc;
+    glUniformMatrix2fv_client_proc_t m_glUniformMatrix2fv_enc;
+    glUniformMatrix3fv_client_proc_t m_glUniformMatrix3fv_enc;
+    glUniformMatrix4fv_client_proc_t m_glUniformMatrix4fv_enc;
+
+    static void s_glUseProgram(void *self, GLuint program);
+	static void s_glUniform1f(void *self , GLint location, GLfloat x);
+	static void s_glUniform1fv(void *self , GLint location, GLsizei count, const GLfloat* v);
+	static void s_glUniform1i(void *self , GLint location, GLint x);
+	static void s_glUniform1iv(void *self , GLint location, GLsizei count, const GLint* v);
+	static void s_glUniform2f(void *self , GLint location, GLfloat x, GLfloat y);
+	static void s_glUniform2fv(void *self , GLint location, GLsizei count, const GLfloat* v);
+	static void s_glUniform2i(void *self , GLint location, GLint x, GLint y);
+	static void s_glUniform2iv(void *self , GLint location, GLsizei count, const GLint* v);
+	static void s_glUniform3f(void *self , GLint location, GLfloat x, GLfloat y, GLfloat z);
+	static void s_glUniform3fv(void *self , GLint location, GLsizei count, const GLfloat* v);
+	static void s_glUniform3i(void *self , GLint location, GLint x, GLint y, GLint z);
+	static void s_glUniform3iv(void *self , GLint location, GLsizei count, const GLint* v);
+	static void s_glUniform4f(void *self , GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+	static void s_glUniform4fv(void *self , GLint location, GLsizei count, const GLfloat* v);
+	static void s_glUniform4i(void *self , GLint location, GLint x, GLint y, GLint z, GLint w);
+	static void s_glUniform4iv(void *self , GLint location, GLsizei count, const GLint* v);
+	static void s_glUniformMatrix2fv(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+	static void s_glUniformMatrix3fv(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+	static void s_glUniformMatrix4fv(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+
+    glActiveTexture_client_proc_t m_glActiveTexture_enc;
+    glBindTexture_client_proc_t m_glBindTexture_enc;
+    glDeleteTextures_client_proc_t m_glDeleteTextures_enc;
+    glGetTexParameterfv_client_proc_t m_glGetTexParameterfv_enc;
+    glGetTexParameteriv_client_proc_t m_glGetTexParameteriv_enc;
+    glTexParameterf_client_proc_t m_glTexParameterf_enc;
+    glTexParameterfv_client_proc_t m_glTexParameterfv_enc;
+    glTexParameteri_client_proc_t m_glTexParameteri_enc;
+    glTexParameteriv_client_proc_t m_glTexParameteriv_enc;
+    glTexImage2D_client_proc_t m_glTexImage2D_enc;
+    glTexSubImage2D_client_proc_t m_glTexSubImage2D_enc;
+    glCopyTexImage2D_client_proc_t m_glCopyTexImage2D_enc;
+    glTexBufferOES_client_proc_t m_glTexBufferOES_enc;
+    glTexBufferRangeOES_client_proc_t m_glTexBufferRangeOES_enc;
+    glTexBufferEXT_client_proc_t m_glTexBufferEXT_enc;
+    glTexBufferRangeEXT_client_proc_t m_glTexBufferRangeEXT_enc;
+
+    glEnableiEXT_client_proc_t m_glEnableiEXT_enc;
+    glDisableiEXT_client_proc_t m_glDisableiEXT_enc;
+    glBlendEquationiEXT_client_proc_t m_glBlendEquationiEXT_enc;
+    glBlendEquationSeparateiEXT_client_proc_t m_glBlendEquationSeparateiEXT_enc;
+    glBlendFunciEXT_client_proc_t m_glBlendFunciEXT_enc;
+    glBlendFuncSeparateiEXT_client_proc_t m_glBlendFuncSeparateiEXT_enc;
+    glColorMaskiEXT_client_proc_t m_glColorMaskiEXT_enc;
+    glIsEnablediEXT_client_proc_t m_glIsEnablediEXT_enc;
+
+
+    static void s_glActiveTexture(void* self, GLenum texture);
+    static void s_glBindTexture(void* self, GLenum target, GLuint texture);
+    static void s_glDeleteTextures(void* self, GLsizei n, const GLuint* textures);
+    static void s_glGetTexParameterfv(void* self, GLenum target, GLenum pname, GLfloat* params);
+    static void s_glGetTexParameteriv(void* self, GLenum target, GLenum pname, GLint* params);
+    static void s_glTexParameterf(void* self, GLenum target, GLenum pname, GLfloat param);
+    static void s_glTexParameterfv(void* self, GLenum target, GLenum pname, const GLfloat* params);
+    static void s_glTexParameteri(void* self, GLenum target, GLenum pname, GLint param);
+    static void s_glTexParameteriv(void* self, GLenum target, GLenum pname, const GLint* params);
+    static void s_glTexImage2D(void* self, GLenum target, GLint level, GLint internalformat,
+            GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type,
+            const GLvoid* pixels);
+    static void s_glTexSubImage2D(void* self, GLenum target, GLint level, GLint xoffset,
+            GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type,
+            const GLvoid* pixels);
+    static void s_glCopyTexImage2D(void* self, GLenum target, GLint level, GLenum internalformat,
+            GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+
+    static bool validateTexBuffer(void* self, GLenum target, GLenum internalFormat, GLuint buffer);
+    static bool validateTexBufferRange(void* self, GLenum target, GLenum internalFormat, GLuint buffer, GLintptr offset, GLsizeiptr size);
+
+    static void s_glTexBufferOES(void* self, GLenum target, GLenum internalFormat, GLuint buffer);
+    static void s_glTexBufferRangeOES(void* self, GLenum target, GLenum internalFormat, GLuint buffer, GLintptr offset, GLsizeiptr size);
+
+    static void s_glTexBufferEXT(void* self, GLenum target, GLenum internalFormat, GLuint buffer);
+    static void s_glTexBufferRangeEXT(void* self, GLenum target, GLenum internalFormat, GLuint buffer, GLintptr offset, GLsizeiptr size);
+
+
+    static bool validateAllowedEnablei(void* self, GLenum cap, GLuint index);
+    static void s_glEnableiEXT(void* self, GLenum cap, GLuint index);
+    static void s_glDisableiEXT(void* self, GLenum cap, GLuint index);
+    static void s_glBlendEquationiEXT(void* self, GLuint buf, GLenum mode);
+    static void s_glBlendEquationSeparateiEXT(void* self, GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+    static void s_glBlendFunciEXT(void* self, GLuint buf, GLenum sfactor, GLenum dfactor);
+    static void s_glBlendFuncSeparateiEXT(void* self, GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+    static void s_glColorMaskiEXT(void* self, GLuint buf, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+    static GLboolean s_glIsEnablediEXT(void* self, GLenum cap, GLuint index);
+
+    glGenRenderbuffers_client_proc_t m_glGenRenderbuffers_enc;
+    static void s_glGenRenderbuffers(void* self, GLsizei n, GLuint* renderbuffers);
+    glDeleteRenderbuffers_client_proc_t m_glDeleteRenderbuffers_enc;
+    static void s_glDeleteRenderbuffers(void* self, GLsizei n, const GLuint* renderbuffers);
+
+    glBindRenderbuffer_client_proc_t m_glBindRenderbuffer_enc;
+    static void s_glBindRenderbuffer(void* self, GLenum target, GLuint renderbuffer);
+
+    glRenderbufferStorage_client_proc_t m_glRenderbufferStorage_enc;
+    static void s_glRenderbufferStorage(void* self, GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+
+    glFramebufferRenderbuffer_client_proc_t m_glFramebufferRenderbuffer_enc;
+    static void s_glFramebufferRenderbuffer(void* self, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+
+    glGenFramebuffers_client_proc_t m_glGenFramebuffers_enc;
+    static void s_glGenFramebuffers(void* self, GLsizei n, GLuint* framebuffers);
+    glDeleteFramebuffers_client_proc_t m_glDeleteFramebuffers_enc;
+    static void s_glDeleteFramebuffers(void* self, GLsizei n, const GLuint* framebuffers);
+
+    glBindFramebuffer_client_proc_t m_glBindFramebuffer_enc;
+    static void s_glBindFramebuffer(void* self, GLenum target, GLuint framebuffer);
+
+    glFramebufferParameteri_client_proc_t m_glFramebufferParameteri_enc;
+    static void s_glFramebufferParameteri(void *self, GLenum target, GLenum pname, GLint param);
+
+    glFramebufferTexture2D_client_proc_t m_glFramebufferTexture2D_enc;
+    static void s_glFramebufferTexture2D(void* self, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+
+    glFramebufferTexture3DOES_client_proc_t m_glFramebufferTexture3DOES_enc;
+    static void s_glFramebufferTexture3DOES(void*self, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+
+    glGetFramebufferAttachmentParameteriv_client_proc_t m_glGetFramebufferAttachmentParameteriv_enc;
+    static void s_glGetFramebufferAttachmentParameteriv(void* self, GLenum target, GLenum attachment, GLenum pname, GLint* params);
+
+    glCheckFramebufferStatus_client_proc_t m_glCheckFramebufferStatus_enc;
+    static GLenum s_glCheckFramebufferStatus(void* self,
+            GLenum target);
+
+    // GLES 3.0-specific custom encoders
+
+    // VAO (+ ES 2 extension)
+    glGenVertexArrays_client_proc_t m_glGenVertexArrays_enc;
+    glDeleteVertexArrays_client_proc_t m_glDeleteVertexArrays_enc;
+    glBindVertexArray_client_proc_t m_glBindVertexArray_enc;
+    glGenVertexArraysOES_client_proc_t m_glGenVertexArraysOES_enc;
+    glDeleteVertexArraysOES_client_proc_t m_glDeleteVertexArraysOES_enc;
+    glBindVertexArrayOES_client_proc_t m_glBindVertexArrayOES_enc;
+    static void s_glGenVertexArrays(void *self, GLsizei n, GLuint* arrays);
+    static void s_glDeleteVertexArrays(void *self , GLsizei n, const GLuint* arrays);
+    static void s_glBindVertexArray(void *self , GLuint array);
+
+    // Mapped buffers
+    static void* s_glMapBufferOES(void* self, GLenum target, GLenum access);
+    static GLboolean s_glUnmapBufferOES(void* self, GLenum target);
+    static void* s_glMapBufferRange(void* self, GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+    static void* s_glMapBufferRangeAEMUImpl(GL2Encoder* ctx, GLenum target,
+                                            GLintptr offset, GLsizeiptr length,
+                                            GLbitfield access, BufferData* buf);
+    static GLboolean s_glUnmapBuffer(void* self, GLenum target);
+    static void s_glFlushMappedBufferRange(void* self, GLenum target, GLintptr offset, GLsizeiptr length);
+
+    // Custom encodes for 2D compressed textures b/c we need to account for
+    // nonzero GL_PIXEL_UNPACK_BUFFER
+    glCompressedTexImage2D_client_proc_t m_glCompressedTexImage2D_enc;
+    static void s_glCompressedTexImage2D(void* self, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data);
+    glCompressedTexSubImage2D_client_proc_t m_glCompressedTexSubImage2D_enc;
+    static void s_glCompressedTexSubImage2D(void* self, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data);
+
+    // Indexed, range bind
+    glBindBufferRange_client_proc_t m_glBindBufferRange_enc;
+    static void s_glBindBufferRange(void *self , GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+
+    glBindBufferBase_client_proc_t m_glBindBufferBase_enc;
+    static void s_glBindBufferBase(void *self , GLenum target, GLuint index, GLuint buffer);
+
+    // TODO:
+    // VertexAttrib(I)Pointer
+    // VertexAttribBinding
+    // BindVertexBuffer
+    // depend on other state as well
+    enum IndexedBufferBindOp {
+        BindBufferBase,
+        BindBufferRange,
+        // TODO
+        // VertexAttribPointer,
+        // VertexAttribIPointer,
+        // VertexAttribBinding,
+        // VertexAttribFormat,
+        // BindVertexBuffer,
+    };
+    void doIndexedBufferBindEncodeCached(IndexedBufferBindOp op, GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size, GLintptr stride, GLintptr effectiveStride);
+
+    glCopyBufferSubData_client_proc_t m_glCopyBufferSubData_enc;
+    static void s_glCopyBufferSubData(void *self , GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size);
+
+    glGetBufferParameteriv_client_proc_t m_glGetBufferParameteriv_enc;
+    static void s_glGetBufferParameteriv(void* self, GLenum target, GLenum pname, GLint* params);
+
+    glGetBufferParameteri64v_client_proc_t m_glGetBufferParameteri64v_enc;
+    static void s_glGetBufferParameteri64v(void* self, GLenum target, GLenum pname, GLint64* params);
+
+    glGetBufferPointerv_client_proc_t m_glGetBufferPointerv_enc;
+    static void s_glGetBufferPointerv(void* self, GLenum target, GLenum pname, GLvoid** params);
+
+    glGetUniformIndices_client_proc_t m_glGetUniformIndices_enc;
+    static void s_glGetUniformIndices(void* self, GLuint program, GLsizei uniformCount, const GLchar ** uniformNames, GLuint* uniformIndices);
+
+    glUniform1ui_client_proc_t m_glUniform1ui_enc;
+    glUniform1uiv_client_proc_t m_glUniform1uiv_enc;
+    glUniform2ui_client_proc_t m_glUniform2ui_enc;
+    glUniform2uiv_client_proc_t m_glUniform2uiv_enc;
+    glUniform3ui_client_proc_t m_glUniform3ui_enc;
+    glUniform3uiv_client_proc_t m_glUniform3uiv_enc;
+    glUniform4ui_client_proc_t m_glUniform4ui_enc;
+    glUniform4uiv_client_proc_t m_glUniform4uiv_enc;
+    glUniformMatrix2x3fv_client_proc_t m_glUniformMatrix2x3fv_enc;
+    glUniformMatrix2x4fv_client_proc_t m_glUniformMatrix2x4fv_enc;
+    glUniformMatrix3x2fv_client_proc_t m_glUniformMatrix3x2fv_enc;
+    glUniformMatrix3x4fv_client_proc_t m_glUniformMatrix3x4fv_enc;
+    glUniformMatrix4x2fv_client_proc_t m_glUniformMatrix4x2fv_enc;
+    glUniformMatrix4x3fv_client_proc_t m_glUniformMatrix4x3fv_enc;
+
+    static void s_glUniform1ui(void* self, GLint location, GLuint v0);
+    static void s_glUniform2ui(void* self, GLint location, GLuint v0, GLuint v1);
+    static void s_glUniform3ui(void* self, GLint location, GLuint v0, GLuint v1, GLuint v2);
+    static void s_glUniform4ui(void* self, GLint location, GLint v0, GLuint v1, GLuint v2, GLuint v3);
+    static void s_glUniform1uiv(void* self, GLint location, GLsizei count, const GLuint *value);
+    static void s_glUniform2uiv(void* self, GLint location, GLsizei count, const GLuint *value);
+    static void s_glUniform3uiv(void* self, GLint location, GLsizei count, const GLuint *value);
+    static void s_glUniform4uiv(void* self, GLint location, GLsizei count, const GLuint *value);
+    static void s_glUniformMatrix2x3fv(void* self, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+    static void s_glUniformMatrix3x2fv(void* self, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+    static void s_glUniformMatrix2x4fv(void* self, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+    static void s_glUniformMatrix4x2fv(void* self, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+    static void s_glUniformMatrix3x4fv(void* self, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+    static void s_glUniformMatrix4x3fv(void* self, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+    glGetUniformuiv_client_proc_t m_glGetUniformuiv_enc;
+    static void s_glGetUniformuiv(void *self, GLuint program, GLint location, GLuint* params);
+
+    glGetActiveUniformBlockiv_client_proc_t m_glGetActiveUniformBlockiv_enc;
+    static void s_glGetActiveUniformBlockiv(void* self, GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params);
+
+    glGetVertexAttribIiv_client_proc_t m_glGetVertexAttribIiv_enc;
+    static void s_glGetVertexAttribIiv(void* self, GLuint index, GLenum pname, GLint* params);
+
+    glGetVertexAttribIuiv_client_proc_t m_glGetVertexAttribIuiv_enc;
+    static void s_glGetVertexAttribIuiv(void* self, GLuint index, GLenum pname, GLuint* params);
+
+    static void s_glVertexAttribIPointer(void* self, GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
+
+    glVertexAttribDivisor_client_proc_t m_glVertexAttribDivisor_enc;
+    static void s_glVertexAttribDivisor(void* self, GLuint index, GLuint divisor);
+
+    glRenderbufferStorageMultisample_client_proc_t m_glRenderbufferStorageMultisample_enc;
+    static void s_glRenderbufferStorageMultisample(void* self, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+
+    glDrawBuffers_client_proc_t m_glDrawBuffers_enc;
+    static void s_glDrawBuffers(void* self, GLsizei n, const GLenum* bufs);
+
+    glReadBuffer_client_proc_t m_glReadBuffer_enc;
+    static void s_glReadBuffer(void* self, GLenum src);
+
+    glFramebufferTextureLayer_client_proc_t m_glFramebufferTextureLayer_enc;
+    static void s_glFramebufferTextureLayer(void* self, GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+
+    glTexStorage2D_client_proc_t m_glTexStorage2D_enc;
+    static void s_glTexStorage2D(void* self, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+
+    static void s_glTransformFeedbackVaryings(void* self, GLuint program, GLsizei count, const char** varyings, GLenum bufferMode);
+
+    glBeginTransformFeedback_client_proc_t m_glBeginTransformFeedback_enc;
+    static void s_glBeginTransformFeedback(void* self, GLenum primitiveMode);
+
+    glEndTransformFeedback_client_proc_t m_glEndTransformFeedback_enc;
+    static void s_glEndTransformFeedback(void* self);
+
+    glPauseTransformFeedback_client_proc_t m_glPauseTransformFeedback_enc;
+    static void s_glPauseTransformFeedback(void* self);
+
+    glResumeTransformFeedback_client_proc_t m_glResumeTransformFeedback_enc;
+    static void s_glResumeTransformFeedback(void* self);
+
+    glTexImage3D_client_proc_t m_glTexImage3D_enc;
+    static void s_glTexImage3D(void* self, GLenum target, GLint level, GLint internalFormat,
+                               GLsizei width, GLsizei height, GLsizei depth,
+                               GLint border, GLenum format, GLenum type, const GLvoid* data);
+
+    glTexSubImage3D_client_proc_t m_glTexSubImage3D_enc;
+    static void s_glTexSubImage3D(void* self, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* data);
+
+    glCompressedTexImage3D_client_proc_t m_glCompressedTexImage3D_enc;
+    static void s_glCompressedTexImage3D(void* self, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data);
+    glCompressedTexSubImage3D_client_proc_t m_glCompressedTexSubImage3D_enc;
+    static void s_glCompressedTexSubImage3D(void* self, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data);
+
+
+    glTexStorage3D_client_proc_t m_glTexStorage3D_enc;
+    static void s_glTexStorage3D(void* self, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+
+    glDrawArraysInstanced_client_proc_t m_glDrawArraysInstanced_enc;
+    static void s_glDrawArraysInstanced(void* self, GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+
+    static void s_glDrawElementsInstanced(void* self, GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount);
+
+    glDrawRangeElements_client_proc_t m_glDrawRangeElements_enc;
+    static void s_glDrawRangeElements(void* self, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void* indices);
+
+    static const GLubyte* s_glGetStringi(void* self, GLenum name, GLuint index);
+
+    glGetProgramBinary_client_proc_t m_glGetProgramBinary_enc;
+    static void s_glGetProgramBinary(void* self, GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, void* binary);
+
+    glReadPixels_client_proc_t m_glReadPixels_enc;
+    static void s_glReadPixels(void* self, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
+
+    glEnable_client_proc_t m_glEnable_enc;
+    static void s_glEnable(void* self, GLenum what);
+    glDisable_client_proc_t m_glDisable_enc;
+    static void s_glDisable(void* self, GLenum what);
+
+    glClearBufferiv_client_proc_t m_glClearBufferiv_enc;
+    static void s_glClearBufferiv(void* self, GLenum buffer, GLint drawBuffer, const GLint* value);
+
+    glClearBufferuiv_client_proc_t m_glClearBufferuiv_enc;
+    static void s_glClearBufferuiv(void* self, GLenum buffer, GLint drawBuffer, const GLuint* value);
+
+    glClearBufferfv_client_proc_t m_glClearBufferfv_enc;
+    static void s_glClearBufferfv(void* self, GLenum buffer, GLint drawBuffer, const GLfloat* value);
+
+    glBlitFramebuffer_client_proc_t m_glBlitFramebuffer_enc;
+    static void s_glBlitFramebuffer(void* self, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+
+    static void s_glGetInternalformativ(void* self, GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
+
+    glGenerateMipmap_client_proc_t m_glGenerateMipmap_enc;
+    static void s_glGenerateMipmap(void* self, GLenum target);
+
+    glBindSampler_client_proc_t m_glBindSampler_enc;
+    static void s_glBindSampler(void* self, GLuint unit, GLuint sampler);
+
+    glDeleteSamplers_client_proc_t m_glDeleteSamplers_enc;
+    static void s_glDeleteSamplers(void* self, GLsizei n, const GLuint* samplers);
+
+    static GLsync s_glFenceSync(void* self, GLenum condition, GLbitfield flags);
+    static GLenum s_glClientWaitSync(void* self, GLsync wait_on, GLbitfield flags, GLuint64 timeout);
+    static void s_glWaitSync(void* self, GLsync wait_on, GLbitfield flags, GLuint64 timeout);
+    static void s_glDeleteSync(void* self, GLsync to_delete);
+    static GLboolean s_glIsSync(void* self, GLsync sync);
+    static void s_glGetSynciv(void* self, GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+
+    glGetIntegeri_v_client_proc_t m_glGetIntegeri_v_enc;
+    static void s_glGetIntegeri_v(void* self, GLenum target, GLuint index, GLint* params);
+
+    glGetInteger64i_v_client_proc_t m_glGetInteger64i_v_enc;
+    static void s_glGetInteger64i_v(void* self, GLenum target, GLuint index, GLint64* params);
+
+    glGetShaderiv_client_proc_t m_glGetShaderiv_enc;
+    static void s_glGetShaderiv(void* self, GLuint shader, GLenum pname, GLint* params);
+
+    // 3.1
+    glActiveShaderProgram_client_proc_t m_glActiveShaderProgram_enc;
+    static void s_glActiveShaderProgram(void* self, GLuint pipeline, GLuint program);
+    static GLuint s_glCreateShaderProgramv(void* self, GLenum type, GLsizei count, const char** strings);
+
+    glProgramUniform1f_client_proc_t m_glProgramUniform1f_enc;
+    glProgramUniform1fv_client_proc_t m_glProgramUniform1fv_enc;
+    glProgramUniform1i_client_proc_t m_glProgramUniform1i_enc;
+    glProgramUniform1iv_client_proc_t m_glProgramUniform1iv_enc;
+    glProgramUniform1ui_client_proc_t m_glProgramUniform1ui_enc;
+    glProgramUniform1uiv_client_proc_t m_glProgramUniform1uiv_enc;
+    glProgramUniform2f_client_proc_t m_glProgramUniform2f_enc;
+    glProgramUniform2fv_client_proc_t m_glProgramUniform2fv_enc;
+    glProgramUniform2i_client_proc_t m_glProgramUniform2i_enc;
+    glProgramUniform2iv_client_proc_t m_glProgramUniform2iv_enc;
+    glProgramUniform2ui_client_proc_t m_glProgramUniform2ui_enc;
+    glProgramUniform2uiv_client_proc_t m_glProgramUniform2uiv_enc;
+    glProgramUniform3f_client_proc_t m_glProgramUniform3f_enc;
+    glProgramUniform3fv_client_proc_t m_glProgramUniform3fv_enc;
+    glProgramUniform3i_client_proc_t m_glProgramUniform3i_enc;
+    glProgramUniform3iv_client_proc_t m_glProgramUniform3iv_enc;
+    glProgramUniform3ui_client_proc_t m_glProgramUniform3ui_enc;
+    glProgramUniform3uiv_client_proc_t m_glProgramUniform3uiv_enc;
+    glProgramUniform4f_client_proc_t m_glProgramUniform4f_enc;
+    glProgramUniform4fv_client_proc_t m_glProgramUniform4fv_enc;
+    glProgramUniform4i_client_proc_t m_glProgramUniform4i_enc;
+    glProgramUniform4iv_client_proc_t m_glProgramUniform4iv_enc;
+    glProgramUniform4ui_client_proc_t m_glProgramUniform4ui_enc;
+    glProgramUniform4uiv_client_proc_t m_glProgramUniform4uiv_enc;
+    glProgramUniformMatrix2fv_client_proc_t m_glProgramUniformMatrix2fv_enc;
+    glProgramUniformMatrix2x3fv_client_proc_t m_glProgramUniformMatrix2x3fv_enc;
+    glProgramUniformMatrix2x4fv_client_proc_t m_glProgramUniformMatrix2x4fv_enc;
+    glProgramUniformMatrix3fv_client_proc_t m_glProgramUniformMatrix3fv_enc;
+    glProgramUniformMatrix3x2fv_client_proc_t m_glProgramUniformMatrix3x2fv_enc;
+    glProgramUniformMatrix3x4fv_client_proc_t m_glProgramUniformMatrix3x4fv_enc;
+    glProgramUniformMatrix4fv_client_proc_t m_glProgramUniformMatrix4fv_enc;
+    glProgramUniformMatrix4x2fv_client_proc_t m_glProgramUniformMatrix4x2fv_enc;
+    glProgramUniformMatrix4x3fv_client_proc_t m_glProgramUniformMatrix4x3fv_enc;
+
+    static void s_glProgramUniform1f(void* self, GLuint program, GLint location, GLfloat v0);
+    static void s_glProgramUniform2f(void* self, GLuint program, GLint location, GLfloat v0, GLfloat v1);
+    static void s_glProgramUniform3f(void* self, GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+    static void s_glProgramUniform4f(void* self, GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+    static void s_glProgramUniform1i(void* self, GLuint program, GLint location, GLint v0);
+    static void s_glProgramUniform2i(void* self, GLuint program, GLint location, GLint v0, GLint v1);
+    static void s_glProgramUniform3i(void* self, GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+    static void s_glProgramUniform4i(void* self, GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+    static void s_glProgramUniform1ui(void* self, GLuint program, GLint location, GLuint v0);
+    static void s_glProgramUniform2ui(void* self, GLuint program, GLint location, GLint v0, GLuint v1);
+    static void s_glProgramUniform3ui(void* self, GLuint program, GLint location, GLint v0, GLint v1, GLuint v2);
+    static void s_glProgramUniform4ui(void* self, GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLuint v3);
+    static void s_glProgramUniform1fv(void* self, GLuint program, GLint location, GLsizei count, const GLfloat *value);
+    static void s_glProgramUniform2fv(void* self, GLuint program, GLint location, GLsizei count, const GLfloat *value);
+    static void s_glProgramUniform3fv(void* self, GLuint program, GLint location, GLsizei count, const GLfloat *value);
+    static void s_glProgramUniform4fv(void* self, GLuint program, GLint location, GLsizei count, const GLfloat *value);
+    static void s_glProgramUniform1iv(void* self, GLuint program, GLint location, GLsizei count, const GLint *value);
+    static void s_glProgramUniform2iv(void* self, GLuint program, GLint location, GLsizei count, const GLint *value);
+    static void s_glProgramUniform3iv(void* self, GLuint program, GLint location, GLsizei count, const GLint *value);
+    static void s_glProgramUniform4iv(void* self, GLuint program, GLint location, GLsizei count, const GLint *value);
+    static void s_glProgramUniform1uiv(void* self, GLuint program, GLint location, GLsizei count, const GLuint *value);
+    static void s_glProgramUniform2uiv(void* self, GLuint program, GLint location, GLsizei count, const GLuint *value);
+    static void s_glProgramUniform3uiv(void* self, GLuint program, GLint location, GLsizei count, const GLuint *value);
+    static void s_glProgramUniform4uiv(void* self, GLuint program, GLint location, GLsizei count, const GLuint *value);
+    static void s_glProgramUniformMatrix2fv(void* self, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+    static void s_glProgramUniformMatrix3fv(void* self, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+    static void s_glProgramUniformMatrix4fv(void* self, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+    static void s_glProgramUniformMatrix2x3fv(void* self, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+    static void s_glProgramUniformMatrix3x2fv(void* self, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+    static void s_glProgramUniformMatrix2x4fv(void* self, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+    static void s_glProgramUniformMatrix4x2fv(void* self, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+    static void s_glProgramUniformMatrix3x4fv(void* self, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+    static void s_glProgramUniformMatrix4x3fv(void* self, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+    glProgramParameteri_client_proc_t m_glProgramParameteri_enc;
+    glUseProgramStages_client_proc_t m_glUseProgramStages_enc;
+    glBindProgramPipeline_client_proc_t m_glBindProgramPipeline_enc;
+
+    static void s_glProgramParameteri(void* self, GLuint program, GLenum pname, GLint value);
+    static void s_glUseProgramStages(void *self, GLuint pipeline, GLbitfield stages, GLuint program);
+    static void s_glBindProgramPipeline(void *self, GLuint pipeline);
+
+    glGetProgramResourceiv_client_proc_t m_glGetProgramResourceiv_enc;
+    glGetProgramResourceIndex_client_proc_t m_glGetProgramResourceIndex_enc;
+    glGetProgramResourceLocation_client_proc_t m_glGetProgramResourceLocation_enc;
+    glGetProgramResourceName_client_proc_t m_glGetProgramResourceName_enc;
+    glGetProgramPipelineInfoLog_client_proc_t m_glGetProgramPipelineInfoLog_enc;
+
+    static void s_glGetProgramResourceiv(void* self, GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum * props, GLsizei bufSize, GLsizei * length, GLint * params);
+    static GLuint s_glGetProgramResourceIndex(void* self, GLuint program, GLenum programInterface, const char* name);
+    static GLint s_glGetProgramResourceLocation(void* self, GLuint program, GLenum programInterface, const char* name);
+    static void s_glGetProgramResourceName(void* self, GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, char* name);
+
+    static void s_glGetProgramPipelineInfoLog(void* self, GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar* infoLog);
+
+    // TODO: Compute shaders:
+    // make sure it's OK to put memory barriers and compute dispatch
+    // on the default encoding path
+   
+    glVertexAttribFormat_client_proc_t m_glVertexAttribFormat_enc;
+    glVertexAttribIFormat_client_proc_t m_glVertexAttribIFormat_enc;
+    glVertexBindingDivisor_client_proc_t m_glVertexBindingDivisor_enc;
+    glVertexAttribBinding_client_proc_t m_glVertexAttribBinding_enc;
+    glBindVertexBuffer_client_proc_t m_glBindVertexBuffer_enc;
+
+    static void s_glVertexAttribFormat(void* self, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
+    static void s_glVertexAttribIFormat(void* self, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+    static void s_glVertexBindingDivisor(void* self, GLuint bindingindex, GLuint divisor);
+    static void s_glVertexAttribBinding(void* self, GLuint attribindex, GLuint bindingindex);
+    static void s_glBindVertexBuffer(void* self, GLuint bindingindex, GLuint buffer, GLintptr offset, GLintptr stride);
+
+    // Indirect draws
+    static void s_glDrawArraysIndirect(void* self, GLenum mode, const void* indirect);
+    static void s_glDrawElementsIndirect(void* self, GLenum mode, GLenum type, const void* indirect);
+
+    // Multisampled textures
+    glTexStorage2DMultisample_client_proc_t m_glTexStorage2DMultisample_enc;
+    static void s_glTexStorage2DMultisample(void* self, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+
+    static GLenum s_glGetGraphicsResetStatusEXT(void* self);
+    static void s_glReadnPixelsEXT(void* self, GLint x, GLint y, GLsizei width,
+            GLsizei height, GLenum format, GLenum type, GLsizei bufSize,
+            GLvoid* pixels);
+    static void s_glGetnUniformfvEXT(void *self, GLuint program, GLint location,
+            GLsizei bufSize, GLfloat* params);
+    static void s_glGetnUniformivEXT(void *self, GLuint program, GLint location,
+            GLsizei bufSize, GLint* params);
+
+    // Invalidate framebuffer
+    static void s_glInvalidateFramebuffer(void* self, GLenum target, GLsizei numAttachments, const GLenum *attachments);
+    static void s_glInvalidateSubFramebuffer(void* self, GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
+
+    glInvalidateFramebuffer_client_proc_t m_glInvalidateFramebuffer_enc;
+    glInvalidateSubFramebuffer_client_proc_t m_glInvalidateSubFramebuffer_enc;;
+
+    // Dispatch compute
+    static void s_glDispatchCompute(void* self, GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
+    static void s_glDispatchComputeIndirect(void* self, GLintptr indirect);
+
+    glDispatchCompute_client_proc_t m_glDispatchCompute_enc;
+    glDispatchComputeIndirect_client_proc_t m_glDispatchComputeIndirect_enc;
+
+    // State tracking for transform feedbacks, samplers, and query objects
+    static void s_glGenTransformFeedbacks(void* self, GLsizei n, GLuint* ids);
+    static void s_glDeleteTransformFeedbacks(void* self, GLsizei n, const GLuint* ids);
+    static void s_glGenSamplers(void* self, GLsizei n, GLuint* ids);
+    static void s_glGenQueries(void* self, GLsizei n, GLuint* ids);
+    static void s_glDeleteQueries(void* self, GLsizei n, const GLuint* ids);
+
+    glGenTransformFeedbacks_client_proc_t m_glGenTransformFeedbacks_enc;
+    glDeleteTransformFeedbacks_client_proc_t m_glDeleteTransformFeedbacks_enc;
+    glGenSamplers_client_proc_t m_glGenSamplers_enc;
+    glGenQueries_client_proc_t m_glGenQueries_enc;
+    glDeleteQueries_client_proc_t m_glDeleteQueries_enc;
+
+    static void s_glBindTransformFeedback(void* self, GLenum target, GLuint id);
+    static void s_glBeginQuery(void* self, GLenum target, GLuint query);
+    static void s_glEndQuery(void* self, GLenum target);
+
+    glBindTransformFeedback_client_proc_t m_glBindTransformFeedback_enc;
+    glBeginQuery_client_proc_t m_glBeginQuery_enc;
+    glEndQuery_client_proc_t m_glEndQuery_enc;
+
+    static void s_glClear(void* self, GLbitfield mask);
+    glClear_client_proc_t m_glClear_enc;
+
+    static void s_glClearBufferfi(void* self, GLenum buffer, GLint drawBuffer, float depth, int stencil);
+    glClearBufferfi_client_proc_t m_glClearBufferfi_enc;
+
+    static void s_glCopyTexSubImage2D(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+    glCopyTexSubImage2D_client_proc_t m_glCopyTexSubImage2D_enc;
+
+    static void s_glCopyTexSubImage3D(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+    glCopyTexSubImage3D_client_proc_t m_glCopyTexSubImage3D_enc;
+
+    static void s_glCompileShader(void* self, GLuint shader);
+    glCompileShader_client_proc_t m_glCompileShader_enc;
+
+    static void s_glValidateProgram(void* self, GLuint program);
+    glValidateProgram_client_proc_t m_glValidateProgram_enc;
+
+    static void s_glProgramBinary(void *self , GLuint program, GLenum binaryFormat, const void* binary, GLsizei length);
+    glProgramBinary_client_proc_t m_glProgramBinary_enc;
+
+    static void s_glGetSamplerParameterfv(void *self, GLuint sampler, GLenum pname, GLfloat* params);
+    static void s_glGetSamplerParameteriv(void *self, GLuint sampler, GLenum pname, GLint* params);
+    glGetSamplerParameterfv_client_proc_t m_glGetSamplerParameterfv_enc;
+    glGetSamplerParameteriv_client_proc_t m_glGetSamplerParameteriv_enc;
+
+    static void s_glSamplerParameterf(void *self , GLuint sampler, GLenum pname, GLfloat param);
+    static void s_glSamplerParameteri(void *self , GLuint sampler, GLenum pname, GLint param);
+    static void s_glSamplerParameterfv(void *self , GLuint sampler, GLenum pname, const GLfloat* params);
+    static void s_glSamplerParameteriv(void *self , GLuint sampler, GLenum pname, const GLint* params);
+
+    glSamplerParameterf_client_proc_t m_glSamplerParameterf_enc;
+    glSamplerParameteri_client_proc_t m_glSamplerParameteri_enc;
+    glSamplerParameterfv_client_proc_t m_glSamplerParameterfv_enc;
+    glSamplerParameteriv_client_proc_t m_glSamplerParameteriv_enc;
+
+    static int s_glGetAttribLocation(void *self , GLuint program, const GLchar* name);
+    glGetAttribLocation_client_proc_t m_glGetAttribLocation_enc;
+
+    static void s_glBindAttribLocation(void *self , GLuint program, GLuint index, const GLchar* name);
+    static void s_glUniformBlockBinding(void *self , GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
+    static void s_glGetTransformFeedbackVarying(void *self , GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, char* name);
+    static void s_glScissor(void *self , GLint x, GLint y, GLsizei width, GLsizei height);
+    static void s_glDepthFunc(void *self , GLenum func);
+    static void s_glViewport(void *self , GLint x, GLint y, GLsizei width, GLsizei height);
+    static void s_glStencilFunc(void *self , GLenum func, GLint ref, GLuint mask);
+    static void s_glStencilFuncSeparate(void *self , GLenum face, GLenum func, GLint ref, GLuint mask);
+    static void s_glStencilOp(void *self , GLenum fail, GLenum zfail, GLenum zpass);
+    static void s_glStencilOpSeparate(void *self , GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
+    static void s_glStencilMaskSeparate(void *self , GLenum face, GLuint mask);
+    static void s_glBlendEquation(void *self , GLenum mode);
+    static void s_glBlendEquationSeparate(void *self , GLenum modeRGB, GLenum modeAlpha);
+    static void s_glBlendFunc(void *self , GLenum sfactor, GLenum dfactor);
+    static void s_glBlendFuncSeparate(void *self , GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+    static void s_glCullFace(void *self , GLenum mode);
+    static void s_glFrontFace(void *self , GLenum mode);
+    static void s_glLineWidth(void *self , GLfloat width);
+    static void s_glVertexAttrib1f(void *self , GLuint indx, GLfloat x);
+    static void s_glVertexAttrib2f(void *self , GLuint indx, GLfloat x, GLfloat y);
+    static void s_glVertexAttrib3f(void *self , GLuint indx, GLfloat x, GLfloat y, GLfloat z);
+    static void s_glVertexAttrib4f(void *self , GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+    static void s_glVertexAttrib1fv(void *self , GLuint indx, const GLfloat* values);
+    static void s_glVertexAttrib2fv(void *self , GLuint indx, const GLfloat* values);
+    static void s_glVertexAttrib3fv(void *self , GLuint indx, const GLfloat* values);
+    static void s_glVertexAttrib4fv(void *self , GLuint indx, const GLfloat* values);
+    static void s_glVertexAttribI4i(void *self , GLuint index, GLint v0, GLint v1, GLint v2, GLint v3);
+    static void s_glVertexAttribI4ui(void *self , GLuint index, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+    static void s_glVertexAttribI4iv(void *self , GLuint index, const GLint* v);
+    static void s_glVertexAttribI4uiv(void *self , GLuint index, const GLuint* v);
+
+    static void s_glGetShaderPrecisionFormat(void *self , GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
+    static void s_glGetProgramiv(void *self , GLuint program, GLenum pname, GLint* params);
+    static void s_glGetActiveUniform(void *self , GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
+    static void s_glGetActiveUniformsiv(void *self , GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params);
+    static void s_glGetActiveUniformBlockName(void *self , GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName);
+    static void s_glGetActiveAttrib(void *self , GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
+    static void s_glGetRenderbufferParameteriv(void *self , GLenum target, GLenum pname, GLint* params);
+    static void s_glGetQueryiv(void *self , GLenum target, GLenum pname, GLint* params);
+    static void s_glGetQueryObjectuiv(void *self , GLuint query, GLenum pname, GLuint* params);
+    static GLboolean s_glIsEnabled(void *self , GLenum cap);
+    static void s_glHint(void *self , GLenum target, GLenum mode);
+    static GLint s_glGetFragDataLocation (void *self , GLuint program, const char* name);
+
+    static void s_glStencilMask(void* self, GLuint mask);
+    static void s_glClearStencil(void* self, int v);
+
+#define LIST_REMAINING_FUNCTIONS_FOR_VALIDATION(f) \
+    f(glBindAttribLocation) \
+    f(glUniformBlockBinding) \
+    f(glGetTransformFeedbackVarying) \
+    f(glScissor) \
+    f(glDepthFunc) \
+    f(glViewport) \
+    f(glStencilFunc) \
+    f(glStencilFuncSeparate) \
+    f(glStencilOp) \
+    f(glStencilOpSeparate) \
+    f(glStencilMaskSeparate) \
+    f(glBlendEquation) \
+    f(glBlendEquationSeparate) \
+    f(glBlendFunc) \
+    f(glBlendFuncSeparate) \
+    f(glCullFace) \
+    f(glFrontFace) \
+    f(glLineWidth) \
+    f(glVertexAttrib1f) \
+    f(glVertexAttrib2f) \
+    f(glVertexAttrib3f) \
+    f(glVertexAttrib4f) \
+    f(glVertexAttrib1fv) \
+    f(glVertexAttrib2fv) \
+    f(glVertexAttrib3fv) \
+    f(glVertexAttrib4fv) \
+    f(glVertexAttribI4i) \
+    f(glVertexAttribI4ui) \
+    f(glVertexAttribI4iv) \
+    f(glVertexAttribI4uiv) \
+    f(glGetShaderPrecisionFormat) \
+    f(glGetProgramiv) \
+    f(glGetActiveUniform) \
+    f(glGetActiveUniformsiv) \
+    f(glGetActiveUniformBlockName) \
+    f(glGetActiveAttrib) \
+    f(glGetRenderbufferParameteriv) \
+    f(glGetQueryiv) \
+    f(glGetQueryObjectuiv) \
+    f(glIsEnabled) \
+    f(glHint) \
+    f(glGetFragDataLocation) \
+    f(glStencilMask) \
+    f(glClearStencil) \
+
+#define DECLARE_CLIENT_ENCODER_PROC(n) \
+    n##_client_proc_t m_##n##_enc;
+
+    LIST_REMAINING_FUNCTIONS_FOR_VALIDATION(DECLARE_CLIENT_ENCODER_PROC)
+
+
+public:
+    glEGLImageTargetTexture2DOES_client_proc_t m_glEGLImageTargetTexture2DOES_enc;
+
+};
+#endif
diff --git a/system/GLESv2_enc/GL2EncoderUtils.cpp b/system/GLESv2_enc/GL2EncoderUtils.cpp
new file mode 100644
index 0000000..d1f73cd
--- /dev/null
+++ b/system/GLESv2_enc/GL2EncoderUtils.cpp
@@ -0,0 +1,69 @@
+/*
+* Copyright (C) 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#include <stdio.h>
+#include <stdlib.h>
+#include "GL2Encoder.h"
+#include <assert.h>
+
+#include <GLES3/gl31.h>
+
+namespace glesv2_enc {
+
+size_t pixelDataSize(void *self, GLsizei width, GLsizei height, GLenum format, GLenum type, int pack)
+{
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    assert (ctx->state() != NULL);
+    return ctx->state()->pixelDataSize(width, height, 1, format, type, pack);
+}
+
+size_t pixelDataSize3D(void *self, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, int pack)
+{
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    assert (ctx->state() != NULL);
+    return ctx->state()->pixelDataSize(width, height, depth, format, type, pack);
+}
+
+GLenum uniformType(void * self, GLuint program, GLint location)
+{
+    GL2Encoder * ctx = (GL2Encoder *) self;
+    assert (ctx->shared() != NULL);
+    return ctx->shared()->getProgramUniformType(program, location);
+}
+
+size_t clearBufferNumElts(void* self, GLenum buffer) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    assert (ctx->state() != NULL);
+    return ctx->state()->clearBufferNumElts(buffer);
+}
+
+size_t numActiveUniformsInUniformBlock(void* self, GLuint program, GLuint blockIndex) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    assert (ctx->state() != NULL);
+    return ctx->state()->numActiveUniformsInUniformBlock(program, blockIndex);
+}
+
+size_t glActiveUniformBlockivParamSize(void* self, GLuint program, GLuint blockIndex, GLenum pname) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    assert (ctx->state() != NULL);
+
+    if (pname == GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES) {
+        return ctx->state()->numActiveUniformsInUniformBlock(program, blockIndex);
+    } else {
+        return glUtilsParamSize(pname);
+    }
+}
+
+}  // namespace glesv2_enc
diff --git a/system/GLESv2_enc/GL2EncoderUtils.h b/system/GLESv2_enc/GL2EncoderUtils.h
new file mode 100644
index 0000000..8d39ca3
--- /dev/null
+++ b/system/GLESv2_enc/GL2EncoderUtils.h
@@ -0,0 +1,30 @@
+/*
+* Copyright (C) 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#ifndef GL2_ENCODER_UTILS_H
+#define GL2_ENCODER_UTILS_H
+
+namespace glesv2_enc {
+
+size_t pixelDataSize(void *self, GLsizei width, GLsizei height, GLenum format, GLenum type, int pack);
+size_t pixelDataSize3D(void *self, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, int pack);
+GLenum uniformType(void * self, GLuint program, GLint location);
+size_t clearBufferNumElts(void* self, GLenum buffer);
+size_t numActiveUniformsInUniformBlock(void* self, GLuint program, GLuint blockIndex);
+size_t glActiveUniformBlockivParamSize(void* self, GLuint program, GLuint blockIndex, GLenum pname);
+
+}  // namespace glesv2_enc
+
+#endif
diff --git a/system/GLESv2_enc/GLESv2Validation.cpp b/system/GLESv2_enc/GLESv2Validation.cpp
new file mode 100644
index 0000000..9118b7b
--- /dev/null
+++ b/system/GLESv2_enc/GLESv2Validation.cpp
@@ -0,0 +1,1661 @@
+/*
+* Copyright (C) 2016 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include "GLESv2Validation.h"
+
+#include <sstream>
+
+#define LIST_VALID_TEX_INTERNALFORMATS(f) \
+    f(GL_BGRA8_EXT) \
+    f(GL_R8) \
+    f(GL_R8_SNORM) \
+    f(GL_R16F) \
+    f(GL_R32F) \
+    f(GL_R8UI) \
+    f(GL_R8I) \
+    f(GL_R16UI) \
+    f(GL_R16I) \
+    f(GL_R32UI) \
+    f(GL_R32I) \
+    f(GL_RG8) \
+    f(GL_RG8_SNORM) \
+    f(GL_RG16F) \
+    f(GL_RG32F) \
+    f(GL_RG8UI) \
+    f(GL_RG8I) \
+    f(GL_RG16UI) \
+    f(GL_RG16I) \
+    f(GL_RG32UI) \
+    f(GL_RG32I) \
+    f(GL_RGB8) \
+    f(GL_SRGB8) \
+    f(GL_RGB565) \
+    f(GL_RGB8_SNORM) \
+    f(GL_R11F_G11F_B10F) \
+    f(GL_RGB9_E5) \
+    f(GL_RGB16F) \
+    f(GL_RGB32F) \
+    f(GL_RGB8UI) \
+    f(GL_RGB8I) \
+    f(GL_RGB16UI) \
+    f(GL_RGB16I) \
+    f(GL_RGB32UI) \
+    f(GL_RGB32I) \
+    f(GL_RGBA8) \
+    f(GL_SRGB8_ALPHA8) \
+    f(GL_RGBA8_SNORM) \
+    f(GL_RGB5_A1) \
+    f(GL_RGBA4) \
+    f(GL_RGB10_A2) \
+    f(GL_RGBA16F) \
+    f(GL_RGBA32F) \
+    f(GL_RGBA8UI) \
+    f(GL_RGBA8I) \
+    f(GL_RGB10_A2UI) \
+    f(GL_RGBA16UI) \
+    f(GL_RGBA16I) \
+    f(GL_RGBA32I) \
+    f(GL_RGBA32UI) \
+    f(GL_DEPTH_COMPONENT16) \
+    f(GL_DEPTH_COMPONENT24) \
+    f(GL_DEPTH_COMPONENT32F) \
+    f(GL_DEPTH24_STENCIL8) \
+    f(GL_DEPTH32F_STENCIL8) \
+    f(GL_ETC1_RGB8_OES) \
+    f(GL_COMPRESSED_R11_EAC) \
+    f(GL_COMPRESSED_SIGNED_R11_EAC) \
+    f(GL_COMPRESSED_RG11_EAC) \
+    f(GL_COMPRESSED_SIGNED_RG11_EAC) \
+    f(GL_COMPRESSED_RGB8_ETC2) \
+    f(GL_COMPRESSED_SRGB8_ETC2) \
+    f(GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2) \
+    f(GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2) \
+    f(GL_COMPRESSED_RGBA8_ETC2_EAC) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC) \
+    f(GL_COMPRESSED_RGBA_ASTC_4x4_KHR) \
+    f(GL_COMPRESSED_RGBA_ASTC_5x4_KHR) \
+    f(GL_COMPRESSED_RGBA_ASTC_5x5_KHR) \
+    f(GL_COMPRESSED_RGBA_ASTC_6x5_KHR) \
+    f(GL_COMPRESSED_RGBA_ASTC_6x6_KHR) \
+    f(GL_COMPRESSED_RGBA_ASTC_8x5_KHR) \
+    f(GL_COMPRESSED_RGBA_ASTC_8x6_KHR) \
+    f(GL_COMPRESSED_RGBA_ASTC_8x8_KHR) \
+    f(GL_COMPRESSED_RGBA_ASTC_10x5_KHR) \
+    f(GL_COMPRESSED_RGBA_ASTC_10x6_KHR) \
+    f(GL_COMPRESSED_RGBA_ASTC_10x8_KHR) \
+    f(GL_COMPRESSED_RGBA_ASTC_10x10_KHR) \
+    f(GL_COMPRESSED_RGBA_ASTC_12x10_KHR) \
+    f(GL_COMPRESSED_RGBA_ASTC_12x12_KHR) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR) \
+    f(GL_COMPRESSED_RGBA_BPTC_UNORM_EXT) \
+    f(GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT) \
+    f(GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT) \
+    f(GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT) \
+    f(GL_COMPRESSED_RGB_S3TC_DXT1_EXT) \
+    f(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT) \
+    f(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT) \
+    f(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT) \
+    f(GL_COMPRESSED_SRGB_S3TC_DXT1_EXT) \
+    f(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT) \
+    f(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT) \
+    f(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT) \
+    f(GL_COMPRESSED_RED_RGTC1_EXT) \
+    f(GL_COMPRESSED_SIGNED_RED_RGTC1_EXT) \
+    f(GL_COMPRESSED_RED_GREEN_RGTC2_EXT) \
+    f(GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT)
+
+#define LIST_VALID_TEX_BUFFER_FORMATS(f) \
+    f(GL_R8) \
+    f(GL_R16F) \
+    f(GL_R32F) \
+    f(GL_R8I) \
+    f(GL_R16I) \
+    f(GL_R32I) \
+    f(GL_R8UI) \
+    f(GL_R16UI) \
+    f(GL_R32UI) \
+    f(GL_RG8) \
+    f(GL_RG16F) \
+    f(GL_RG32F) \
+    f(GL_RG8I) \
+    f(GL_RG16I) \
+    f(GL_RG32I) \
+    f(GL_RG8UI) \
+    f(GL_RG16UI) \
+    f(GL_RG32UI) \
+    f(GL_RGB32F) \
+    f(GL_RGB32I) \
+    f(GL_RGB32UI) \
+    f(GL_RGBA8) \
+    f(GL_RGBA16F) \
+    f(GL_RGBA32F) \
+    f(GL_RGBA8I) \
+    f(GL_RGBA16I) \
+    f(GL_RGBA32I) \
+    f(GL_RGBA8UI) \
+    f(GL_RGBA16UI) \
+    f(GL_RGBA32UI)
+
+
+#define LIST_INTEGER_TEX_FORMATS(f) \
+    f(GL_RED_INTEGER) \
+    f(GL_RG_INTEGER) \
+    f(GL_RGB_INTEGER) \
+    f(GL_RGBA_INTEGER) \
+    f(GL_R8UI) \
+    f(GL_R8I) \
+    f(GL_R16UI) \
+    f(GL_R16I) \
+    f(GL_R32UI) \
+    f(GL_R32I) \
+    f(GL_RG8UI) \
+    f(GL_RG8I) \
+    f(GL_RG16UI) \
+    f(GL_RG16I) \
+    f(GL_RG32UI) \
+    f(GL_RG32I) \
+    f(GL_RGB8UI) \
+    f(GL_RGB8I) \
+    f(GL_RGB16UI) \
+    f(GL_RGB16I) \
+    f(GL_RGB32UI) \
+    f(GL_RGB32I) \
+    f(GL_RGBA8UI) \
+    f(GL_RGBA8I) \
+    f(GL_RGB10_A2UI) \
+    f(GL_RGBA16UI) \
+    f(GL_RGBA16I) \
+    f(GL_RGBA32I) \
+    f(GL_RGBA32UI) \
+
+#define LIST_VALID_TEXFORMAT_COMBINATIONS(f) \
+    f(GL_BGRA8_EXT, GL_BGRA_EXT, GL_UNSIGNED_BYTE) \
+    f(GL_R8, GL_RED, GL_UNSIGNED_BYTE) \
+    f(GL_R8_SNORM, GL_RED, GL_BYTE) \
+    f(GL_R16F, GL_RED, GL_FLOAT) \
+    f(GL_R16F, GL_RED, GL_HALF_FLOAT) \
+    f(GL_R32F, GL_RED, GL_FLOAT) \
+    f(GL_R8UI, GL_RED_INTEGER, GL_UNSIGNED_BYTE) \
+    f(GL_R8I, GL_RED_INTEGER, GL_BYTE) \
+    f(GL_R16UI, GL_RED_INTEGER, GL_UNSIGNED_SHORT) \
+    f(GL_R16I, GL_RED_INTEGER, GL_SHORT) \
+    f(GL_R32UI, GL_RED_INTEGER, GL_UNSIGNED_INT) \
+    f(GL_R32I, GL_RED_INTEGER, GL_INT) \
+    f(GL_RG8, GL_RG, GL_UNSIGNED_BYTE) \
+    f(GL_RG8_SNORM, GL_RG, GL_BYTE) \
+    f(GL_RG16F, GL_RG, GL_HALF_FLOAT) \
+    f(GL_RG16F, GL_RG, GL_FLOAT) \
+    f(GL_RG32F, GL_RG, GL_FLOAT) \
+    f(GL_RG8UI, GL_RG_INTEGER, GL_UNSIGNED_BYTE) \
+    f(GL_RG8I, GL_RG_INTEGER, GL_BYTE) \
+    f(GL_RG16UI, GL_RG_INTEGER, GL_UNSIGNED_SHORT) \
+    f(GL_RG16I, GL_RG_INTEGER, GL_SHORT) \
+    f(GL_RG32UI, GL_RG_INTEGER, GL_UNSIGNED_INT) \
+    f(GL_RG32I, GL_RG_INTEGER, GL_INT) \
+    f(GL_RGB8, GL_RGB, GL_UNSIGNED_BYTE) \
+    f(GL_SRGB8, GL_RGB, GL_UNSIGNED_BYTE) \
+    f(GL_RGB565, GL_RGB, GL_UNSIGNED_BYTE) \
+    f(GL_RGB565, GL_RGB, GL_UNSIGNED_SHORT_5_6_5) \
+    f(GL_RGB8_SNORM, GL_RGB, GL_BYTE) \
+    f(GL_R11F_G11F_B10F, GL_RGB, GL_UNSIGNED_INT_10F_11F_11F_REV) \
+    f(GL_R11F_G11F_B10F, GL_RGB, GL_HALF_FLOAT) \
+    f(GL_R11F_G11F_B10F, GL_RGB, GL_FLOAT) \
+    f(GL_RGB9_E5, GL_RGB, GL_UNSIGNED_INT_5_9_9_9_REV) \
+    f(GL_RGB9_E5, GL_RGB, GL_HALF_FLOAT) \
+    f(GL_RGB9_E5, GL_RGB, GL_FLOAT) \
+    f(GL_RGB16F, GL_RGB, GL_HALF_FLOAT) \
+    f(GL_RGB16F, GL_RGB, GL_FLOAT) \
+    f(GL_RGB32F, GL_RGB, GL_FLOAT) \
+    f(GL_RGB8UI, GL_RGB_INTEGER, GL_UNSIGNED_BYTE) \
+    f(GL_RGB8I, GL_RGB_INTEGER, GL_BYTE) \
+    f(GL_RGB16UI, GL_RGB_INTEGER, GL_UNSIGNED_SHORT) \
+    f(GL_RGB16I, GL_RGB_INTEGER, GL_SHORT) \
+    f(GL_RGB32UI, GL_RGB_INTEGER, GL_UNSIGNED_INT) \
+    f(GL_RGB32I, GL_RGB_INTEGER, GL_INT) \
+    f(GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_RGBA8_SNORM, GL_RGBA, GL_BYTE) \
+    f(GL_RGB5_A1, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_RGB5_A1, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1) \
+    f(GL_RGB5_A1, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV) \
+    f(GL_RGBA4, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_RGBA4, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4) \
+    f(GL_RGB10_A2, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV) \
+    f(GL_RGBA16F, GL_RGBA, GL_HALF_FLOAT) \
+    f(GL_RGBA16F, GL_RGBA, GL_FLOAT) \
+    f(GL_RGBA32F, GL_RGBA, GL_FLOAT) \
+    f(GL_RGBA8UI, GL_RGBA_INTEGER, GL_UNSIGNED_BYTE) \
+    f(GL_RGBA8I, GL_RGBA_INTEGER, GL_BYTE) \
+    f(GL_RGB10_A2UI, GL_RGBA_INTEGER, GL_UNSIGNED_INT_2_10_10_10_REV) \
+    f(GL_RGBA16UI, GL_RGBA_INTEGER, GL_UNSIGNED_SHORT) \
+    f(GL_RGBA16I, GL_RGBA_INTEGER, GL_SHORT) \
+    f(GL_RGBA32I, GL_RGBA_INTEGER, GL_INT) \
+    f(GL_RGBA32UI, GL_RGBA_INTEGER, GL_UNSIGNED_INT) \
+    f(GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT) \
+    f(GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT) \
+    f(GL_DEPTH_COMPONENT24, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT) \
+    f(GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT) \
+    f(GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8) \
+    f(GL_DEPTH32F_STENCIL8, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV) \
+    f(GL_COMPRESSED_R11_EAC, GL_RED, GL_FLOAT) \
+    f(GL_COMPRESSED_SIGNED_R11_EAC, GL_RED, GL_FLOAT) \
+    f(GL_COMPRESSED_RG11_EAC, GL_RG, GL_FLOAT) \
+    f(GL_COMPRESSED_SIGNED_RG11_EAC, GL_RG, GL_FLOAT) \
+    f(GL_COMPRESSED_RGB8_ETC2, GL_RGB, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_SRGB8_ETC2, GL_RGB, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_RGBA8_ETC2_EAC, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_RGBA_ASTC_4x4_KHR, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_RGBA_ASTC_5x4_KHR, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_RGBA_ASTC_5x5_KHR, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_RGBA_ASTC_6x5_KHR, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_RGBA_ASTC_6x6_KHR, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_RGBA_ASTC_8x5_KHR, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_RGBA_ASTC_8x6_KHR, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_RGBA_ASTC_8x8_KHR, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_RGBA_ASTC_10x5_KHR, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_RGBA_ASTC_10x6_KHR, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_RGBA_ASTC_10x8_KHR, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_RGBA_ASTC_10x10_KHR, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_RGBA_ASTC_12x10_KHR, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_RGBA_ASTC_12x12_KHR, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_RGBA_BPTC_UNORM_EXT, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT, GL_RGB, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT, GL_RGB, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GL_RGB, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_SRGB_S3TC_DXT1_EXT, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, GL_RGBA, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_RED_RGTC1_EXT, GL_RED, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_SIGNED_RED_RGTC1_EXT, GL_RED, GL_BYTE) \
+    f(GL_COMPRESSED_RED_GREEN_RGTC2_EXT, GL_RG, GL_UNSIGNED_BYTE) \
+    f(GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT, GL_RG, GL_BYTE)
+
+
+
+namespace GLESv2Validation {
+
+GLbitfield allBufferMapAccessFlags =
+    GL_MAP_READ_BIT | GL_MAP_WRITE_BIT |
+    GL_MAP_INVALIDATE_RANGE_BIT |
+    GL_MAP_INVALIDATE_BUFFER_BIT |
+    GL_MAP_FLUSH_EXPLICIT_BIT |
+    GL_MAP_UNSYNCHRONIZED_BIT;
+
+bool bufferTarget(GL2Encoder* ctx, GLenum target) {
+    int glesMajorVersion = ctx->majorVersion();
+    int glesMinorVersion = ctx->minorVersion();
+    switch (target) {
+    case GL_ARRAY_BUFFER: // Vertex attributes
+    case GL_ELEMENT_ARRAY_BUFFER: // Vertex array indices
+        return true;
+        // GLES 3.0 buffers
+    case GL_COPY_READ_BUFFER: // Buffer copy source
+    case GL_COPY_WRITE_BUFFER: // Buffer copy destination
+    case GL_PIXEL_PACK_BUFFER: // Pixel read target
+    case GL_PIXEL_UNPACK_BUFFER: // Texture data source
+    case GL_TRANSFORM_FEEDBACK_BUFFER: // Transform feedback buffer
+    case GL_UNIFORM_BUFFER: // Uniform block storage
+        return glesMajorVersion >= 3;
+        // GLES 3.1 buffers
+    case GL_ATOMIC_COUNTER_BUFFER: // Atomic counter storage
+    case GL_DISPATCH_INDIRECT_BUFFER: // Indirect compute dispatch commands
+    case GL_DRAW_INDIRECT_BUFFER: // Indirect command arguments
+    case GL_SHADER_STORAGE_BUFFER: // Read-write storage for shader
+        return glesMajorVersion >= 3 && glesMinorVersion >= 1;
+    case GL_TEXTURE_BUFFER_OES:
+        return ctx->es32Plus() || ctx->getExtensions().textureBufferAny();
+    default:
+        return false;
+    }
+}
+
+bool bufferParam(GL2Encoder* ctx, GLenum pname) {
+    int glesMajorVersion = ctx->majorVersion();
+    switch (pname) {
+    case GL_BUFFER_SIZE:
+    case GL_BUFFER_USAGE:
+        return true;
+    case GL_BUFFER_ACCESS_FLAGS:
+    case GL_BUFFER_MAPPED:
+    case GL_BUFFER_MAP_LENGTH:
+    case GL_BUFFER_MAP_OFFSET:
+        return glesMajorVersion >= 3;
+    default:
+        return false;
+    }
+}
+
+bool bufferUsage(GL2Encoder* ctx, GLenum usage) {
+    int glesMajorVersion = ctx->majorVersion();
+    switch(usage) {
+        case GL_STREAM_DRAW:
+        case GL_STATIC_DRAW:
+        case GL_DYNAMIC_DRAW:
+            return true;
+        case GL_STREAM_READ:
+        case GL_STATIC_READ:
+        case GL_DYNAMIC_READ:
+        case GL_STREAM_COPY:
+        case GL_STATIC_COPY:
+        case GL_DYNAMIC_COPY:
+            return glesMajorVersion >= 3;
+    }
+    return false;
+
+}
+bool pixelStoreParam(GL2Encoder* ctx, GLenum param) {
+    int glesMajorVersion = ctx->majorVersion();
+    switch(param) {
+    case GL_UNPACK_ALIGNMENT:
+    case GL_PACK_ALIGNMENT:
+        return true;
+    case GL_UNPACK_ROW_LENGTH:
+    case GL_UNPACK_IMAGE_HEIGHT:
+    case GL_UNPACK_SKIP_PIXELS:
+    case GL_UNPACK_SKIP_ROWS:
+    case GL_UNPACK_SKIP_IMAGES:
+    case GL_PACK_ROW_LENGTH:
+    case GL_PACK_SKIP_PIXELS:
+    case GL_PACK_SKIP_ROWS:
+        return glesMajorVersion >= 3;
+    default:
+        return false;
+    }
+}
+
+bool pixelStoreValue(GLenum param, GLint value) {
+    switch(param) {
+    case GL_UNPACK_ALIGNMENT:
+    case GL_PACK_ALIGNMENT:
+        return (value == 1) || (value == 2) || (value == 4) || (value == 8);
+    case GL_UNPACK_ROW_LENGTH:
+    case GL_UNPACK_IMAGE_HEIGHT:
+    case GL_UNPACK_SKIP_PIXELS:
+    case GL_UNPACK_SKIP_ROWS:
+    case GL_UNPACK_SKIP_IMAGES:
+    case GL_PACK_ROW_LENGTH:
+    case GL_PACK_SKIP_PIXELS:
+    case GL_PACK_SKIP_ROWS:
+        return value >= 0;
+    default:
+        return false;
+    }
+}
+
+bool rboFormat(GL2Encoder* ctx, GLenum internalformat) {
+    int glesMajorVersion = ctx->majorVersion();
+
+    switch (internalformat) {
+    // Funny internal formats
+    // that will cause an incomplete framebuffer
+    // attachment error pre-gles3. For dEQP,
+    // we can also just abort early here in
+    // RenderbufferStorage with a GL_INVALID_ENUM.
+    case GL_DEPTH_COMPONENT32F:
+    case GL_R8:
+    case GL_R8UI:
+    case GL_R8I:
+    case GL_R16UI:
+    case GL_R16I:
+    case GL_R32UI:
+    case GL_R32I:
+    case GL_RG8:
+    case GL_RG8UI:
+    case GL_RG8I:
+    case GL_RG16UI:
+    case GL_RG16I:
+    case GL_RG32UI:
+    case GL_RG32I:
+    case GL_SRGB8_ALPHA8:
+    case GL_RGBA8UI:
+    case GL_RGBA8I:
+    case GL_RGB10_A2:
+    case GL_RGB10_A2UI:
+    case GL_RGBA16UI:
+    case GL_RGBA16I:
+    case GL_RGBA32I:
+    case GL_RGBA32UI:
+    case GL_RGB32F:
+        return glesMajorVersion >= 3;
+        // These 4 formats are still not OK,
+        // but dEQP expects GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT or
+        // GL_FRAMEBUFFER_UNSUPPORTED if the extension is not present,
+        // not a GL_INVALID_ENUM from earlier on.
+        // So let's forward these to the rest of
+        // FBO initialization
+        // In GLES 3, these are rejected immediately if not
+        // supported.
+    case GL_R16F:
+    case GL_RG16F:
+    case GL_RGBA16F:
+    case GL_R32F:
+    case GL_RG32F:
+    case GL_RGBA32F:
+    case GL_R11F_G11F_B10F:
+        return glesMajorVersion >= 3 && ctx->hasExtension("GL_EXT_color_buffer_float");
+    case GL_RGB16F:
+        return glesMajorVersion >= 3 && ctx->hasExtension("GL_EXT_color_buffer_half_float");
+        // dEQP expects GL_FRAMEBUFFER_UNSUPPORTED or GL_FRAMEBUFFER_COMPLETE
+        // for this format
+        // These formats are OK
+    case GL_DEPTH_COMPONENT16:
+    case GL_DEPTH_COMPONENT24:
+    case GL_DEPTH_COMPONENT32_OES:
+    case GL_RGBA4:
+    case GL_RGB5_A1:
+    case GL_RGB565:
+    case GL_RGB8_OES:
+    case GL_RGBA8_OES:
+    case GL_STENCIL_INDEX8:
+    case GL_DEPTH32F_STENCIL8:
+    case GL_DEPTH24_STENCIL8_OES:
+        return true;
+        break;
+        // Everything else: still not OK,
+        // and they need the GL_INVALID_ENUM
+    }
+    return false;
+}
+
+bool framebufferTarget(GL2Encoder* ctx, GLenum target) {
+    int glesMajorVersion = ctx->majorVersion();
+    switch (target) {
+    case GL_FRAMEBUFFER:
+        return true;
+    case GL_DRAW_FRAMEBUFFER:
+    case GL_READ_FRAMEBUFFER:
+        return glesMajorVersion >= 3;
+    }
+    return false;
+}
+
+bool framebufferAttachment(GL2Encoder* ctx, GLenum attachment) {
+    int glesMajorVersion = ctx->majorVersion();
+    switch (attachment) {
+    case GL_COLOR_ATTACHMENT0:
+    case GL_DEPTH_ATTACHMENT:
+    case GL_STENCIL_ATTACHMENT:
+        return true;
+    case GL_COLOR_ATTACHMENT1:
+    case GL_COLOR_ATTACHMENT2:
+    case GL_COLOR_ATTACHMENT3:
+    case GL_COLOR_ATTACHMENT4:
+    case GL_COLOR_ATTACHMENT5:
+    case GL_COLOR_ATTACHMENT6:
+    case GL_COLOR_ATTACHMENT7:
+    case GL_COLOR_ATTACHMENT8:
+    case GL_COLOR_ATTACHMENT9:
+    case GL_COLOR_ATTACHMENT10:
+    case GL_COLOR_ATTACHMENT11:
+    case GL_COLOR_ATTACHMENT12:
+    case GL_COLOR_ATTACHMENT13:
+    case GL_COLOR_ATTACHMENT14:
+    case GL_COLOR_ATTACHMENT15:
+    case GL_DEPTH_STENCIL_ATTACHMENT:
+        return glesMajorVersion >= 3;
+    }
+    return false;
+}
+
+bool readPixelsFormat(GLenum format) {
+    switch (format) {
+    case GL_RED:
+    case GL_RED_INTEGER:
+    case GL_RG:
+    case GL_RG_INTEGER:
+    case GL_RGB:
+    case GL_RGB_INTEGER:
+    case GL_RGBA:
+    case GL_RGBA_INTEGER:
+    case GL_LUMINANCE_ALPHA:
+    case GL_LUMINANCE:
+    case GL_ALPHA:
+        return true;
+    }
+    return false;
+}
+
+bool readPixelsType(GLenum format) {
+    switch (format) {
+    case GL_UNSIGNED_BYTE:
+    case GL_BYTE:
+    case GL_HALF_FLOAT:
+    case GL_FLOAT:
+    case GL_INT:
+    case GL_UNSIGNED_SHORT_5_6_5:
+    case GL_UNSIGNED_SHORT_4_4_4_4:
+    case GL_UNSIGNED_SHORT_5_5_5_1:
+    case GL_UNSIGNED_INT:
+    case GL_UNSIGNED_INT_2_10_10_10_REV:
+    case GL_UNSIGNED_INT_10F_11F_11F_REV:
+    case GL_UNSIGNED_INT_5_9_9_9_REV:
+        return true;
+    }
+    return false;
+}
+
+bool pixelOp(GLenum format,GLenum type) {
+     switch(type) {
+     case GL_UNSIGNED_SHORT_4_4_4_4:
+     case GL_UNSIGNED_SHORT_5_5_5_1:
+         return format == GL_RGBA;
+     case GL_UNSIGNED_SHORT_5_6_5:
+         return format == GL_RGB;
+     }
+     return true;
+}
+
+bool vertexAttribType(GL2Encoder* ctx, GLenum type)
+{
+    int glesMajorVersion = ctx->majorVersion();
+    bool retval = false;
+    switch (type) {
+    case GL_BYTE:
+    case GL_UNSIGNED_BYTE:
+    case GL_SHORT:
+    case GL_UNSIGNED_SHORT:
+    case GL_FIXED:
+    case GL_FLOAT:
+    // The following are technically only available if certain GLES2 extensions are.
+    // However, they are supported by desktop GL3, which is a reasonable requirement
+    // for the desktop GL version. Therefore, consider them valid.
+    case GL_INT:
+    case GL_UNSIGNED_INT:
+    case GL_HALF_FLOAT_OES:
+        retval = true;
+        break;
+    case GL_HALF_FLOAT:
+    case GL_INT_2_10_10_10_REV:
+    case GL_UNSIGNED_INT_2_10_10_10_REV:
+        retval = glesMajorVersion >= 3;
+        break;
+    }
+    return retval;
+}
+
+bool readPixelsFboFormatMatch(GLenum, GLenum type, GLenum fboTexType) {
+#define INVALID_TYPE_MATCH(x, y) \
+    if (type == x && fboTexType == y) return false; \
+    if (type == y && fboTexType == x) return false; \
+
+    // These are meant to reject additional format/type mismatches
+    // not caught by underlying system.
+    INVALID_TYPE_MATCH(GL_FLOAT, GL_BYTE)
+    INVALID_TYPE_MATCH(GL_FLOAT, GL_UNSIGNED_BYTE)
+    INVALID_TYPE_MATCH(GL_FLOAT, GL_UNSIGNED_INT)
+    INVALID_TYPE_MATCH(GL_FLOAT, GL_INT)
+
+    return true;
+}
+
+bool blitFramebufferFormat(GLenum readFormat, GLenum drawFormat) {
+#define INVALID_MATCH(x, y) \
+    if (readFormat == x && drawFormat == y) return false; \
+    if (readFormat == y && drawFormat == x) return false; \
+
+    INVALID_MATCH(GL_FLOAT, GL_BYTE)
+    INVALID_MATCH(GL_FLOAT, GL_UNSIGNED_BYTE)
+    INVALID_MATCH(GL_FLOAT, GL_UNSIGNED_INT)
+    INVALID_MATCH(GL_FLOAT, GL_INT)
+    INVALID_MATCH(GL_INT, GL_UNSIGNED_BYTE);
+    INVALID_MATCH(GL_UNSIGNED_INT, GL_UNSIGNED_BYTE);
+    INVALID_MATCH(GL_INT, GL_BYTE);
+    INVALID_MATCH(GL_UNSIGNED_INT, GL_BYTE);
+    INVALID_MATCH(GL_DEPTH32F_STENCIL8, GL_DEPTH24_STENCIL8);
+
+    return true;
+}
+
+bool textureTarget(GL2Encoder* ctx, GLenum target) {
+    int glesMajorVersion = ctx->majorVersion();
+    int glesMinorVersion = ctx->minorVersion();
+    switch (target) {
+    case GL_TEXTURE_EXTERNAL_OES:
+    case GL_TEXTURE_2D:
+    case GL_TEXTURE_CUBE_MAP:
+    case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
+    case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
+    case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
+    case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
+    case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
+    case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
+        return true;
+    case GL_TEXTURE_2D_ARRAY:
+    case GL_TEXTURE_3D:
+        return glesMajorVersion >= 3;
+    case GL_TEXTURE_2D_MULTISAMPLE:
+        return glesMajorVersion >= 3 && glesMinorVersion >= 1;
+    case GL_TEXTURE_BUFFER_OES:
+        return  ctx->es32Plus() || ctx->getExtensions().textureBufferAny();
+    default:
+        break;
+    }
+    return false;
+}
+
+bool textureParams(GL2Encoder* ctx, GLenum param) {
+    int glesMajorVersion = ctx->majorVersion();
+    int glesMinorVersion = ctx->minorVersion();
+    switch(param) {
+    case GL_TEXTURE_MIN_FILTER:
+    case GL_TEXTURE_MAG_FILTER:
+    case GL_TEXTURE_WRAP_S:
+    case GL_TEXTURE_WRAP_T:
+    case GL_TEXTURE_MAX_ANISOTROPY_EXT:
+        return true;
+    case GL_TEXTURE_SWIZZLE_R:
+    case GL_TEXTURE_SWIZZLE_G:
+    case GL_TEXTURE_SWIZZLE_B:
+    case GL_TEXTURE_SWIZZLE_A:
+    case GL_TEXTURE_MIN_LOD:
+    case GL_TEXTURE_MAX_LOD:
+    case GL_TEXTURE_BASE_LEVEL:
+    case GL_TEXTURE_MAX_LEVEL:
+    case GL_TEXTURE_COMPARE_MODE:
+    case GL_TEXTURE_COMPARE_FUNC:
+    case GL_TEXTURE_WRAP_R:
+    case GL_TEXTURE_IMMUTABLE_FORMAT:
+    case GL_TEXTURE_IMMUTABLE_LEVELS:
+        return glesMajorVersion >= 3;
+    case GL_DEPTH_STENCIL_TEXTURE_MODE:
+        return glesMajorVersion >= 3 && glesMinorVersion >= 1;
+    default:
+        return false;
+    }
+}
+
+bool samplerParams(GL2Encoder* ctx, GLenum param) {
+    (void)ctx;
+    switch(param) {
+        case GL_TEXTURE_MAX_ANISOTROPY_EXT:
+        case GL_TEXTURE_MIN_FILTER:
+        case GL_TEXTURE_MAG_FILTER:
+        case GL_TEXTURE_WRAP_S:
+        case GL_TEXTURE_WRAP_T:
+        case GL_TEXTURE_WRAP_R:
+        case GL_TEXTURE_MIN_LOD:
+        case GL_TEXTURE_MAX_LOD:
+        case GL_TEXTURE_COMPARE_MODE:
+        case GL_TEXTURE_COMPARE_FUNC:
+            return true;
+        default:
+            return false;
+    }
+}
+
+bool textureParamValue(GL2Encoder* ctx, GLenum pname, GLint intval, GLfloat floatval, GLenum enumval) {
+    (void)ctx;
+    (void)floatval;
+    switch (pname) {
+    case GL_TEXTURE_BASE_LEVEL:
+        return intval >= 0;
+    case GL_TEXTURE_COMPARE_MODE:
+        return
+            (enumval == GL_NONE) ||
+            (enumval == GL_COMPARE_REF_TO_TEXTURE);
+    case GL_TEXTURE_COMPARE_FUNC:
+        return
+            (enumval == GL_LEQUAL) ||
+            (enumval == GL_GEQUAL) ||
+            (enumval == GL_LESS) ||
+            (enumval == GL_GREATER) ||
+            (enumval == GL_EQUAL) ||
+            (enumval == GL_NOTEQUAL) ||
+            (enumval == GL_ALWAYS) ||
+            (enumval == GL_NEVER);
+    case GL_TEXTURE_MAG_FILTER:
+        return
+            (enumval == GL_NEAREST) ||
+            (enumval == GL_LINEAR);
+    case GL_TEXTURE_MAX_LEVEL:
+        return intval >= 0;
+    case GL_TEXTURE_MAX_LOD:
+        return true;
+    case GL_TEXTURE_MIN_FILTER:
+        return
+            (enumval == GL_NEAREST) ||
+            (enumval == GL_LINEAR) ||
+            (enumval == GL_NEAREST_MIPMAP_NEAREST) ||
+            (enumval == GL_NEAREST_MIPMAP_LINEAR) ||
+            (enumval == GL_LINEAR_MIPMAP_NEAREST) ||
+            (enumval == GL_LINEAR_MIPMAP_LINEAR);
+    case GL_TEXTURE_MIN_LOD:
+        return true;
+    case GL_TEXTURE_SWIZZLE_R:
+    case GL_TEXTURE_SWIZZLE_G:
+    case GL_TEXTURE_SWIZZLE_B:
+    case GL_TEXTURE_SWIZZLE_A:
+        return
+            (enumval == GL_RED) ||
+            (enumval == GL_GREEN) ||
+            (enumval == GL_BLUE) ||
+            (enumval == GL_ALPHA) ||
+            (enumval == GL_ZERO) ||
+            (enumval == GL_ONE);
+    case GL_TEXTURE_WRAP_S:
+    case GL_TEXTURE_WRAP_T:
+    case GL_TEXTURE_WRAP_R:
+        return
+            (enumval == GL_CLAMP_TO_EDGE) ||
+            (enumval == GL_REPEAT) ||
+            (enumval == GL_MIRRORED_REPEAT);
+    case GL_TEXTURE_MAX_ANISOTROPY_EXT:
+        return true;
+    case GL_TEXTURE_IMMUTABLE_FORMAT:
+    case GL_TEXTURE_IMMUTABLE_LEVELS:
+    case GL_DEPTH_STENCIL_TEXTURE_MODE:
+        return true;
+    default:
+        return true;
+    }
+}
+
+bool isIntegerFormat(GLenum format) {
+
+#define CHECK_EQUAL(x) case x: return true;
+
+    switch (format) {
+        LIST_INTEGER_TEX_FORMATS(CHECK_EQUAL)
+
+    default:
+        return false;
+    }
+}
+
+bool isCompressedFormat(GLenum internalformat) {
+#define COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(internal) \
+    case internal: \
+        return true; \
+
+    switch (internalformat) {
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_R11_EAC)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_SIGNED_R11_EAC)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_RG11_EAC)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_SIGNED_RG11_EAC)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_RGB8_ETC2)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_SRGB8_ETC2)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_RGBA8_ETC2_EAC)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_RGBA_ASTC_4x4_KHR)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_RGBA_ASTC_5x4_KHR)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_RGBA_ASTC_5x5_KHR)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_RGBA_ASTC_6x5_KHR)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_RGBA_ASTC_6x6_KHR)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_RGBA_ASTC_8x5_KHR)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_RGBA_ASTC_8x6_KHR)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_RGBA_ASTC_8x8_KHR)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_RGBA_ASTC_10x5_KHR)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_RGBA_ASTC_10x6_KHR)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_RGBA_ASTC_10x8_KHR)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_RGBA_ASTC_10x10_KHR)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_RGBA_ASTC_12x10_KHR)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_RGBA_ASTC_12x12_KHR)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR)
+    COMPRESSED_TEX_IMAGE_IS_COMPRESSED_FORMAT_CASE(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR)
+    default:
+        break;
+    }
+    return false;
+}
+
+bool supportedCompressedFormat(GL2Encoder* ctx, GLenum internalformat) {
+    int glesMajorVersion = ctx->majorVersion();
+    int glesMinorVersion = ctx->minorVersion();
+
+#define COMPRESSED_TEX_IMAGE_SUPPORT_CASE_ASTC(internal) \
+    case internal: \
+        return glesMajorVersion > 1 && ctx->hasExtension("GL_KHR_texture_compression_astc_ldr"); \
+
+#define COMPRESSED_TEX_IMAGE_SUPPORT_CASE_BPTC(internal) \
+    case internal: \
+        return glesMajorVersion > 1 && ctx->hasExtension("GL_EXT_texture_compression_bptc"); \
+
+#define COMPRESSED_TEX_IMAGE_SUPPORT_CASE_S3TC(internal) \
+    case internal: \
+      return glesMajorVersion > 1 && ctx->hasExtension("GL_EXT_texture_compression_s3tc"); \
+
+#define COMPRESSED_TEX_IMAGE_SUPPORT_CASE_S3TC_SRGB(internal)       \
+    case internal: \
+      return glesMajorVersion > 1 && ctx->hasExtension("GL_EXT_texture_compression_s3tc") && ctx->hasExtension("GL_EXT_texture_sRGB"); \
+
+#define COMPRESSED_TEX_IMAGE_SUPPORT_CASE_RGTC(internal) \
+    case internal: \
+      return glesMajorVersion > 1 && ctx->hasExtension("GL_EXT_texture_compression_rgtc"); \
+
+#define COMPRESSED_TEX_IMAGE_SUPPORT_CASE(internal, maj, min) \
+    case internal: \
+        if (maj < 3) return true; \
+        if (glesMajorVersion < maj) return false; \
+        if (glesMinorVersion < min) return false; \
+        break; \
+
+#define COMPRESSED_TEX_IMAGE_NOTSUPPORTED(internal) \
+    case internal: \
+        return false ; \
+
+    switch (internalformat) {
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE(GL_ETC1_RGB8_OES, 2, 0)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE(GL_COMPRESSED_R11_EAC, 2, 0)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE(GL_COMPRESSED_SIGNED_R11_EAC, 2, 0)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE(GL_COMPRESSED_RG11_EAC, 2, 0)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE(GL_COMPRESSED_SIGNED_RG11_EAC, 2, 0)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE(GL_COMPRESSED_RGB8_ETC2, 2, 0)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE(GL_COMPRESSED_SRGB8_ETC2, 2, 0)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE(GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, 2, 0)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE(GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, 2, 0)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE(GL_COMPRESSED_RGBA8_ETC2_EAC, 2, 0)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE(GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, 2, 0)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_ASTC(GL_COMPRESSED_RGBA_ASTC_4x4_KHR)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_ASTC(GL_COMPRESSED_RGBA_ASTC_5x4_KHR)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_ASTC(GL_COMPRESSED_RGBA_ASTC_5x5_KHR)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_ASTC(GL_COMPRESSED_RGBA_ASTC_6x5_KHR)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_ASTC(GL_COMPRESSED_RGBA_ASTC_6x6_KHR)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_ASTC(GL_COMPRESSED_RGBA_ASTC_8x5_KHR)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_ASTC(GL_COMPRESSED_RGBA_ASTC_8x6_KHR)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_ASTC(GL_COMPRESSED_RGBA_ASTC_8x8_KHR)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_ASTC(GL_COMPRESSED_RGBA_ASTC_10x5_KHR)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_ASTC(GL_COMPRESSED_RGBA_ASTC_10x6_KHR)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_ASTC(GL_COMPRESSED_RGBA_ASTC_10x8_KHR)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_ASTC(GL_COMPRESSED_RGBA_ASTC_10x10_KHR)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_ASTC(GL_COMPRESSED_RGBA_ASTC_12x10_KHR)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_ASTC(GL_COMPRESSED_RGBA_ASTC_12x12_KHR)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_ASTC(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_ASTC(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_ASTC(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_ASTC(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_ASTC(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_ASTC(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_ASTC(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_ASTC(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_ASTC(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_ASTC(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_ASTC(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_ASTC(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_ASTC(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_ASTC(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_BPTC(GL_COMPRESSED_RGBA_BPTC_UNORM_EXT)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_BPTC(GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_BPTC(GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_BPTC(GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_S3TC(GL_COMPRESSED_RGB_S3TC_DXT1_EXT)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_S3TC(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_S3TC(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_S3TC(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_S3TC(GL_COMPRESSED_SRGB_S3TC_DXT1_EXT)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_S3TC_SRGB(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_S3TC_SRGB(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_S3TC_SRGB(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_RGTC(GL_COMPRESSED_RED_RGTC1_EXT)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_RGTC(GL_COMPRESSED_SIGNED_RED_RGTC1_EXT)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_RGTC(GL_COMPRESSED_RED_GREEN_RGTC2_EXT)
+    COMPRESSED_TEX_IMAGE_SUPPORT_CASE_RGTC(GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT)
+    default:
+        break;
+    }
+    return false;
+}
+
+bool unsizedFormat(GLenum format) {
+    switch (format) {
+    case GL_RED:
+    case GL_RED_INTEGER:
+    case GL_DEPTH_COMPONENT:
+    case GL_DEPTH_STENCIL:
+    case GL_RG:
+    case GL_RG_INTEGER:
+    case GL_RGB:
+    case GL_RGB_INTEGER:
+    case GL_RGBA:
+    case GL_RGBA_INTEGER:
+    case GL_ALPHA:
+    case GL_LUMINANCE:
+    case GL_LUMINANCE_ALPHA:
+        return true;
+    }
+    return false;
+}
+
+// TODO: fix this
+bool filterableTexFormat(GL2Encoder* ctx, GLenum internalformat) {
+    switch (internalformat) {
+    case GL_R32F:
+    case GL_RG32F:
+    case GL_RGB32F:
+    case GL_RGBA32F:
+        return ctx->hasExtension("GL_OES_texture_float");
+    case GL_R8UI:
+    case GL_R8I:
+    case GL_R16UI:
+    case GL_R16I:
+    case GL_R32UI:
+    case GL_R32I:
+    case GL_RG8UI:
+    case GL_RG8I:
+    case GL_RG16UI:
+    case GL_RG16I:
+    case GL_RG32UI:
+    case GL_RG32I:
+    case GL_RGBA8UI:
+    case GL_RGBA8I:
+    case GL_RGB10_A2UI:
+    case GL_RGBA16UI:
+    case GL_RGBA16I:
+    case GL_RGBA32I:
+    case GL_RGBA32UI:
+        return false;
+    }
+    return true;
+}
+
+
+bool colorRenderableFormat(GL2Encoder* ctx, GLenum internalformat) {
+    int glesMajorVersion = ctx->majorVersion();
+    switch (internalformat) {
+    case GL_R8:
+    case GL_RG8:
+    case GL_RGB8:
+    case GL_RGB565:
+    case GL_RGBA4:
+    case GL_RGB5_A1:
+    case GL_RGBA8:
+    case GL_RGB10_A2:
+    case GL_RGB10_A2UI:
+    case GL_SRGB8_ALPHA8:
+    case GL_R8I:
+    case GL_R8UI:
+    case GL_R16I:
+    case GL_R16UI:
+    case GL_R32I:
+    case GL_R32UI:
+    case GL_RG8I:
+    case GL_RG8UI:
+    case GL_RG16I:
+    case GL_RG16UI:
+    case GL_RG32I:
+    case GL_RG32UI:
+    case GL_RGBA8I:
+    case GL_RGBA8UI:
+    case GL_RGBA16I:
+    case GL_RGBA16UI:
+    case GL_RGBA32I:
+    case GL_RGBA32UI:
+        return true;
+    case GL_R16F:
+    case GL_RG16F:
+    case GL_RGBA16F:
+    case GL_R32F:
+    case GL_RG32F:
+    case GL_RGBA32F:
+    case GL_R11F_G11F_B10F:
+        return glesMajorVersion >= 3 && ctx->hasExtension("GL_EXT_color_buffer_float");
+        break;
+    case GL_RGB16F:
+        return glesMajorVersion >= 3 && ctx->hasExtension("GL_EXT_color_buffer_half_float");
+        break;
+    }
+    return false;
+}
+
+bool depthRenderableFormat(GL2Encoder* ctx, GLenum internalformat) {
+    switch (internalformat) {
+    case GL_DEPTH_COMPONENT:
+    case GL_DEPTH_STENCIL:
+    case GL_DEPTH_COMPONENT16:
+    case GL_DEPTH_COMPONENT24:
+    case GL_DEPTH_COMPONENT32F:
+    case GL_DEPTH24_STENCIL8:
+    case GL_DEPTH32F_STENCIL8:
+        return true;
+    case GL_DEPTH_COMPONENT32_OES:
+        return ctx->hasExtension("GL_OES_depth32");
+    }
+    return false;
+}
+
+bool stencilRenderableFormat(GL2Encoder*, GLenum internalformat) {
+    switch (internalformat) {
+    case GL_DEPTH_STENCIL:
+    case GL_STENCIL_INDEX8:
+    case GL_DEPTH24_STENCIL8:
+    case GL_DEPTH32F_STENCIL8:
+        return true;
+    }
+    return false;
+}
+
+bool isCubeMapTarget(GLenum target) {
+    switch (target) {
+    case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
+    case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
+    case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
+    case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
+    case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
+    case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
+        return true;
+    default:
+        break;
+    }
+    return false;
+}
+
+#define LIST_VALID_TEXFORMATS(f) \
+    f(GL_DEPTH_COMPONENT) \
+    f(GL_DEPTH_STENCIL) \
+    f(GL_RED) \
+    f(GL_RED_INTEGER) \
+    f(GL_RG) \
+    f(GL_RGB) \
+    f(GL_RGBA) \
+    f(GL_RGBA_INTEGER) \
+    f(GL_RGB_INTEGER) \
+    f(GL_RG_INTEGER) \
+    f(GL_BGRA_EXT) \
+    f(GL_ALPHA) \
+    f(GL_LUMINANCE) \
+    f(GL_LUMINANCE_ALPHA) \
+
+#define LIST_VALID_TEXTYPES(f) \
+    f(GL_BYTE) \
+    f(GL_FLOAT) \
+    f(GL_FLOAT_32_UNSIGNED_INT_24_8_REV) \
+    f(GL_HALF_FLOAT) \
+    f(GL_HALF_FLOAT_OES) \
+    f(GL_INT) \
+    f(GL_SHORT) \
+    f(GL_UNSIGNED_BYTE) \
+    f(GL_UNSIGNED_INT) \
+    f(GL_UNSIGNED_INT_10F_11F_11F_REV) \
+    f(GL_UNSIGNED_INT_2_10_10_10_REV) \
+    f(GL_UNSIGNED_INT_24_8) \
+    f(GL_UNSIGNED_INT_5_9_9_9_REV) \
+    f(GL_UNSIGNED_SHORT) \
+    f(GL_UNSIGNED_SHORT_4_4_4_4) \
+    f(GL_UNSIGNED_SHORT_5_5_5_1) \
+    f(GL_UNSIGNED_SHORT_5_6_5) \
+
+bool pixelType(GL2Encoder* ctx, GLenum type) {
+    int glesMajorVersion = ctx->majorVersion();
+    if (glesMajorVersion < 3) {
+        switch (type) {
+        case GL_UNSIGNED_BYTE:
+        case GL_UNSIGNED_SHORT:
+        case GL_UNSIGNED_SHORT_5_6_5:
+        case GL_UNSIGNED_SHORT_4_4_4_4:
+        case GL_UNSIGNED_SHORT_5_5_5_1:
+        case GL_UNSIGNED_INT:
+        case GL_UNSIGNED_INT_10F_11F_11F_REV:
+        case GL_UNSIGNED_INT_24_8:
+        case GL_HALF_FLOAT:
+        case GL_HALF_FLOAT_OES:
+        case GL_FLOAT:
+            return true;
+        }
+        return false;
+    }
+
+#define GLES3_TYPE_CASE(type) \
+    case type: \
+
+    switch (type) {
+        LIST_VALID_TEXTYPES(GLES3_TYPE_CASE)
+            return glesMajorVersion >= 3;
+        default:
+            break;
+    }
+
+    return false;
+}
+
+bool pixelFormat(GL2Encoder* ctx, GLenum format) {
+    int glesMajorVersion = ctx->majorVersion();
+    if (glesMajorVersion < 3) {
+        switch (format) {
+            case GL_DEPTH_COMPONENT:
+                // GLES3 compatible
+                // Required in dEQP
+            case GL_RED:
+            case GL_RG:
+            case GL_DEPTH_STENCIL_OES:
+            case GL_ALPHA:
+            case GL_RGB:
+            case GL_RGBA:
+            case GL_BGRA_EXT:
+            case GL_LUMINANCE:
+            case GL_LUMINANCE_ALPHA:
+                return true;
+        }
+        return false;
+    }
+
+#define GLES3_FORMAT_CASE(format) \
+    case format:
+
+    switch (format) {
+        LIST_VALID_TEXFORMATS(GLES3_FORMAT_CASE)
+            return glesMajorVersion >= 3;
+        default:
+            break;
+    }
+    return false;
+}
+
+bool pixelInternalFormat(GLenum internalformat) {
+#define VALID_INTERNAL_FORMAT(format) \
+    case format: \
+        return true; \
+
+    switch (internalformat) {
+    LIST_VALID_TEX_INTERNALFORMATS(VALID_INTERNAL_FORMAT)
+    default:
+        break;
+    }
+
+    ALOGW("error internal format: 0x%x is invalid\n", internalformat);
+    return false;
+}
+
+
+bool textureBufferFormat(__attribute__((unused)) GL2Encoder* ctx, GLenum internalFormat) {
+    switch(internalFormat) {
+    LIST_VALID_TEX_BUFFER_FORMATS(VALID_INTERNAL_FORMAT)
+    default:
+        break;
+    }
+
+    ALOGW("error internal format: 0x%x is invalid\n", internalFormat);
+    return false;
+}
+
+bool pixelSizedFormat(GL2Encoder* ctx, GLenum internalformat, GLenum format, GLenum type) {
+    int glesMajorVersion = ctx->majorVersion();
+    if (internalformat == format) {
+        return true;
+    }
+
+    if (glesMajorVersion < 3) {
+        switch (format) {
+            case GL_RED:
+                switch (type) {
+                    case GL_UNSIGNED_BYTE:
+                        return internalformat == GL_R8;
+                    case GL_HALF_FLOAT:
+                    case GL_FLOAT:
+                        return internalformat == GL_R16F;
+                    case GL_BYTE:
+                        return internalformat == GL_R8_SNORM;
+                    default:
+                        return false;
+                }
+                break;
+            case GL_RG:
+                switch (type) {
+                    case GL_UNSIGNED_BYTE:
+                        return internalformat == GL_RG8;
+                    case GL_HALF_FLOAT:
+                    case GL_FLOAT:
+                        return internalformat == GL_RG16F;
+                    default:
+                        return false;
+                }
+                break;
+            case GL_RGB:
+                switch (type) {
+                    case GL_HALF_FLOAT:
+                    case GL_FLOAT:
+                        return internalformat == GL_RGB16F
+                            || internalformat == GL_R11F_G11F_B10F;
+                    case GL_UNSIGNED_INT_10F_11F_11F_REV:
+                        return internalformat == GL_R11F_G11F_B10F;
+                    default:
+                        return internalformat == GL_RGB8 ||
+                               internalformat == GL_RGB;
+                }
+                break;
+            case GL_RGBA:
+                switch (type) {
+                    case GL_HALF_FLOAT:
+                    case GL_FLOAT:
+                        return internalformat == GL_RGBA16F;
+                    default:
+                        return internalformat == GL_RGBA8 ||
+                               internalformat == GL_RGBA;
+                }
+                break;
+        }
+    }
+
+#define VALIDATE_FORMAT_COMBINATION(x, y, z) \
+    if (internalformat == x && format == y && type == z) return true; \
+
+    LIST_VALID_TEXFORMAT_COMBINATIONS(VALIDATE_FORMAT_COMBINATION)
+
+    return false;
+}
+
+void getCompatibleFormatTypeForInternalFormat(GLenum internalformat, GLenum* format_out, GLenum* type_out) {
+#define RETURN_COMPATIBLE_FORMAT(x, y, z) \
+    if (internalformat == x) { \
+        *format_out = y; \
+        *type_out = z; \
+        return; \
+    } \
+
+    LIST_VALID_TEXFORMAT_COMBINATIONS(RETURN_COMPATIBLE_FORMAT)
+}
+
+bool shaderType(GL2Encoder* ctx, GLenum type) {
+    int glesMajorVersion = ctx->majorVersion();
+    int glesMinorVersion = ctx->minorVersion();
+    switch (type) {
+    case GL_VERTEX_SHADER:
+    case GL_FRAGMENT_SHADER:
+        return true;
+    case GL_COMPUTE_SHADER:
+        return glesMajorVersion >= 3 && glesMinorVersion >= 1;
+    }
+    return false;
+}
+
+bool internalFormatTarget(GL2Encoder* ctx, GLenum target) {
+    int glesMajorVersion = ctx->majorVersion();
+    int glesMinorVersion = ctx->minorVersion();
+    switch (target) {
+    case GL_RENDERBUFFER:
+        return true;
+    case GL_TEXTURE_2D_MULTISAMPLE:
+        return glesMajorVersion >= 3 && glesMinorVersion >= 1;
+    }
+    return false;
+}
+
+std::string vertexAttribIndexRangeErrorMsg(GL2Encoder* ctx, GLuint index) {
+    std::stringstream ss;
+    GLint maxIndex;
+    ctx->glGetIntegerv(ctx, GL_MAX_VERTEX_ATTRIBS, &maxIndex);
+    ss << "Invalid vertex attribute index. Wanted index: " << index << ". Max index: " << maxIndex;
+    return ss.str();
+}
+
+bool allowedFace(GLenum face) {
+    switch (face) {
+        case GL_FRONT:
+        case GL_BACK:
+        case GL_FRONT_AND_BACK:
+            return true;
+        default:
+            return false;
+    }
+}
+
+bool allowedFunc(GLenum func) {
+    switch (func) {
+        case GL_NEVER:
+        case GL_ALWAYS:
+        case GL_LESS:
+        case GL_LEQUAL:
+        case GL_EQUAL:
+        case GL_GREATER:
+        case GL_GEQUAL:
+        case GL_NOTEQUAL:
+            return true;
+        default:
+            return false;
+    }
+}
+
+bool allowedStencilOp(GLenum op) {
+    switch (op) {
+        case GL_KEEP:
+        case GL_ZERO:
+        case GL_REPLACE:
+        case GL_INCR:
+        case GL_DECR:
+        case GL_INVERT:
+        case GL_INCR_WRAP:
+        case GL_DECR_WRAP:
+            return true;
+        default:
+            return false;
+    }
+}
+
+bool allowedBlendEquation(GLenum eq) {
+    switch (eq) {
+        case GL_FUNC_ADD:
+        case GL_FUNC_SUBTRACT:
+        case GL_FUNC_REVERSE_SUBTRACT:
+        case GL_MIN:
+        case GL_MAX:
+            return true;
+        default:
+            return false;
+    }
+}
+
+bool allowedBlendFunc(GLenum func) {
+    switch (func) {
+        case GL_ZERO:
+        case GL_ONE:
+        case GL_SRC_COLOR:
+        case GL_ONE_MINUS_SRC_COLOR:
+        case GL_DST_COLOR:
+        case GL_ONE_MINUS_DST_COLOR:
+        case GL_SRC_ALPHA:
+        case GL_ONE_MINUS_SRC_ALPHA:
+        case GL_DST_ALPHA:
+        case GL_ONE_MINUS_DST_ALPHA:
+        case GL_CONSTANT_COLOR:
+        case GL_ONE_MINUS_CONSTANT_COLOR:
+        case GL_CONSTANT_ALPHA:
+        case GL_ONE_MINUS_CONSTANT_ALPHA:
+        case GL_SRC_ALPHA_SATURATE:
+            return true;
+        default:
+            return false;
+    }
+}
+
+bool allowedCullFace(GLenum mode) {
+    switch (mode) {
+        case GL_FRONT:
+        case GL_BACK:
+        case GL_FRONT_AND_BACK:
+            return true;
+        default:
+            return false;
+    }
+}
+
+bool allowedFrontFace(GLenum mode) {
+    switch (mode) {
+        case GL_CCW:
+        case GL_CW:
+            return true;
+        default:
+            return false;
+    }
+}
+
+bool allowedEnable(int majorVersion, int minorVersion, GLenum cap) {
+    switch (cap) {
+        case GL_CULL_FACE:
+        case GL_POLYGON_OFFSET_FILL:
+        case GL_SAMPLE_ALPHA_TO_COVERAGE:
+        case GL_SAMPLE_COVERAGE:
+        case GL_SCISSOR_TEST:
+        case GL_STENCIL_TEST:
+        case GL_DEPTH_TEST:
+        case GL_BLEND:
+        case GL_DITHER:
+            return true;
+        case GL_PRIMITIVE_RESTART_FIXED_INDEX:
+        case GL_RASTERIZER_DISCARD:
+            return majorVersion >= 3;
+        case GL_SAMPLE_MASK:
+            return majorVersion >= 3 && minorVersion >= 1;
+        default:
+            ALOGW("error cap: 0x%x is invalid\n", cap);
+	    return false;
+    }
+}
+
+bool allowedGetShader(GLenum pname) {
+	switch (pname) {
+		case GL_SHADER_TYPE:
+		case GL_DELETE_STATUS:
+		case GL_COMPILE_STATUS:
+		case GL_INFO_LOG_LENGTH:
+		case GL_SHADER_SOURCE_LENGTH:
+			return true;
+		default:
+			return false;
+	}
+}
+
+bool allowedShaderType(GLenum shadertype) {
+	switch (shadertype) {
+		case GL_VERTEX_SHADER:
+		case GL_FRAGMENT_SHADER:
+            return true;
+		default:
+			return false;
+	}
+}
+
+bool allowedPrecisionType(GLenum precisiontype) {
+	switch (precisiontype) {
+		case GL_LOW_FLOAT:
+		case GL_MEDIUM_FLOAT:
+		case GL_HIGH_FLOAT:
+		case GL_LOW_INT:
+		case GL_MEDIUM_INT:
+		case GL_HIGH_INT:
+            return true;
+		default:
+			return false;
+	}
+}
+
+bool allowedGetProgram(int majorVersion, int minorVersion, GLenum pname) {
+    switch (pname) {
+        case GL_DELETE_STATUS:
+        case GL_LINK_STATUS:
+        case GL_VALIDATE_STATUS:
+        case GL_INFO_LOG_LENGTH:
+        case GL_ATTACHED_SHADERS:
+        case GL_ACTIVE_ATTRIBUTES:
+        case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH:
+        case GL_ACTIVE_UNIFORMS:
+        case GL_ACTIVE_UNIFORM_MAX_LENGTH:
+            return true;
+        case GL_TRANSFORM_FEEDBACK_BUFFER_MODE:
+        case GL_PROGRAM_BINARY_RETRIEVABLE_HINT:
+        case GL_PROGRAM_BINARY_LENGTH:
+        case GL_TRANSFORM_FEEDBACK_VARYINGS:
+        case GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH:
+        case GL_ACTIVE_UNIFORM_BLOCKS:
+        case GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH:
+            return majorVersion > 2;
+        case GL_COMPUTE_WORK_GROUP_SIZE:
+        case GL_PROGRAM_SEPARABLE:
+        case GL_ACTIVE_ATOMIC_COUNTER_BUFFERS:
+            return majorVersion > 2 && minorVersion > 0;
+        default:
+            return false;
+    }
+}
+
+bool allowedGetActiveUniforms(GLenum pname) {
+    switch (pname) {
+        case GL_UNIFORM_TYPE:
+        case GL_UNIFORM_SIZE:
+        case GL_UNIFORM_NAME_LENGTH:
+        case GL_UNIFORM_BLOCK_INDEX:
+        case GL_UNIFORM_OFFSET:
+        case GL_UNIFORM_ARRAY_STRIDE:
+        case GL_UNIFORM_MATRIX_STRIDE:
+        case GL_UNIFORM_IS_ROW_MAJOR:
+            return true;
+        default:
+            return false;
+    }
+}
+
+bool allowedGetActiveUniformBlock(GLenum pname) {
+    switch (pname) {
+        case GL_UNIFORM_BLOCK_BINDING:
+        case GL_UNIFORM_BLOCK_DATA_SIZE:
+        case GL_UNIFORM_BLOCK_NAME_LENGTH:
+        case GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS:
+        case GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:
+        case GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:
+        case GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:
+            return true;
+        default:
+            return false;
+    }
+}
+
+bool allowedGetVertexAttrib(GLenum pname) {
+    switch (pname) {
+        case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:
+        case GL_VERTEX_ATTRIB_ARRAY_ENABLED:
+        case GL_VERTEX_ATTRIB_ARRAY_SIZE:
+        case GL_VERTEX_ATTRIB_ARRAY_STRIDE:
+        case GL_VERTEX_ATTRIB_ARRAY_TYPE:
+        case GL_VERTEX_ATTRIB_ARRAY_NORMALIZED:
+        case GL_VERTEX_ATTRIB_ARRAY_INTEGER:
+        case GL_VERTEX_ATTRIB_ARRAY_DIVISOR:
+        case GL_VERTEX_ATTRIB_BINDING:
+        case GL_VERTEX_ATTRIB_RELATIVE_OFFSET:
+        case GL_CURRENT_VERTEX_ATTRIB:
+            return true;
+        default:
+            return false;
+    }
+}
+
+bool allowedGetRenderbufferParameter(GLenum pname) {
+    switch (pname) {
+        case GL_RENDERBUFFER_WIDTH:
+        case GL_RENDERBUFFER_HEIGHT:
+        case GL_RENDERBUFFER_INTERNAL_FORMAT:
+        case GL_RENDERBUFFER_RED_SIZE:
+        case GL_RENDERBUFFER_GREEN_SIZE:
+        case GL_RENDERBUFFER_BLUE_SIZE:
+        case GL_RENDERBUFFER_ALPHA_SIZE:
+        case GL_RENDERBUFFER_DEPTH_SIZE:
+        case GL_RENDERBUFFER_STENCIL_SIZE:
+        case GL_RENDERBUFFER_SAMPLES:
+            return true;
+        default:
+            return false;
+    }
+}
+
+bool allowedQueryTarget(GLenum target) {
+    switch (target) {
+        case GL_ANY_SAMPLES_PASSED:
+        case GL_ANY_SAMPLES_PASSED_CONSERVATIVE:
+        case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
+            return true;
+        default:
+            return false;
+    }
+}
+
+bool allowedQueryParam(GLenum pname) {
+    switch (pname) {
+        case GL_CURRENT_QUERY:
+            return true;
+        default:
+            return false;
+    }
+}
+
+bool allowedQueryObjectParam(GLenum pname) {
+    switch (pname) {
+        case GL_QUERY_RESULT:
+        case GL_QUERY_RESULT_AVAILABLE:
+            return true;
+        default:
+            return false;
+    }
+}
+
+bool allowedGetSyncParam(GLenum pname) {
+    switch (pname) {
+        case GL_OBJECT_TYPE:
+        case GL_SYNC_STATUS:
+        case GL_SYNC_CONDITION:
+        case GL_SYNC_FLAGS:
+            return true;
+        default:
+            return false;
+    }
+}
+
+bool allowedHintTarget(GLenum target) {
+    switch (target) {
+        case GL_GENERATE_MIPMAP_HINT:
+        case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES:
+            return true;
+        default:
+            return false;
+    }
+}
+
+bool allowedHintMode(GLenum mode) {
+    switch (mode) {
+        case GL_DONT_CARE:
+        case GL_NICEST:
+        case GL_FASTEST:
+            return true;
+        default:
+            return false;
+    }
+}
+
+} // namespace GLESv2Validation
diff --git a/system/GLESv2_enc/GLESv2Validation.h b/system/GLESv2_enc/GLESv2Validation.h
new file mode 100644
index 0000000..8e072c3
--- /dev/null
+++ b/system/GLESv2_enc/GLESv2Validation.h
@@ -0,0 +1,124 @@
+/*
+* Copyright (C) 2016 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#ifndef GLES_VALIDATION_H
+#define GLES_VALIDATION_H
+
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+#include <GLES2/gl2platform.h>
+
+#include <GLES3/gl3.h>
+#include <GLES3/gl31.h>
+
+#include "GL2Encoder.h"
+
+#include <string>
+
+namespace GLESv2Validation {
+
+extern GLbitfield allBufferMapAccessFlags;
+bool bufferTarget(GL2Encoder* ctx, GLenum target);
+bool bufferParam(GL2Encoder* ctx, GLenum param);
+bool bufferUsage(GL2Encoder* ctx, GLenum usage);
+
+bool pixelStoreParam(GL2Encoder* ctx, GLenum param);
+bool pixelStoreValue(GLenum param, GLint value);
+
+bool rboFormat(GL2Encoder* ctx, GLenum internalformat);
+
+bool framebufferTarget(GL2Encoder* ctx, GLenum target);
+bool framebufferAttachment(GL2Encoder* ctx, GLenum attachment);
+
+bool readPixelsFormat(GLenum format);
+bool readPixelsType(GLenum type);
+bool pixelOp(GLenum format, GLenum type);
+
+bool vertexAttribType(GL2Encoder* ctx, GLenum type);
+
+bool readPixelsFboFormatMatch(GLenum format, GLenum type, GLenum fboTexType);
+bool blitFramebufferFormat(GLenum readFormat, GLenum drawFormat);
+
+bool textureTarget(GL2Encoder* ctx, GLenum target);
+bool textureParams(GL2Encoder* ctx, GLenum pname);
+bool samplerParams(GL2Encoder* ctx, GLenum pname);
+bool textureParamValue(GL2Encoder* ctx, GLenum pname, GLint intval, GLfloat floatval, GLenum enumval);
+
+bool isIntegerFormat(GLenum format);
+bool isCompressedFormat(GLenum internalformat);
+bool supportedCompressedFormat(GL2Encoder* ctx, GLenum internalformat);
+
+bool unsizedFormat(GLenum format);
+
+bool filterableTexFormat(GL2Encoder* ctx, GLenum internalformat);
+bool colorRenderableFormat(GL2Encoder* ctx, GLenum internalformat);
+bool depthRenderableFormat(GL2Encoder* ctx, GLenum internalformat);
+bool stencilRenderableFormat(GL2Encoder* ctx, GLenum internalformat);
+
+bool isCubeMapTarget(GLenum target);
+
+bool pixelType(GL2Encoder* ctx, GLenum type);
+bool pixelFormat(GL2Encoder* ctx, GLenum format);
+
+bool textureBufferFormat(GL2Encoder* ctx, GLenum internalFormat);
+
+bool pixelInternalFormat(GLenum internalformat);
+bool pixelSizedFormat(GL2Encoder* ctx, GLenum internalformat, GLenum format, GLenum type);
+void getCompatibleFormatTypeForInternalFormat(GLenum internalformat, GLenum* format_out, GLenum* type_out);
+
+bool shaderType(GL2Encoder* ctx, GLenum type);
+
+bool internalFormatTarget(GL2Encoder* ctx, GLenum target);
+
+std::string vertexAttribIndexRangeErrorMsg(GL2Encoder* ctx, GLuint index);
+
+bool allowedFace(GLenum face);
+bool allowedFunc(GLenum func);
+bool allowedStencilOp(GLenum op);
+bool allowedBlendEquation(GLenum eq);
+bool allowedBlendFunc(GLenum func);
+
+bool allowedCullFace(GLenum mode);
+bool allowedFrontFace(GLenum mode);
+
+bool allowedEnable(int majorVersion, int minorVersion, GLenum mode);
+
+bool allowedGetShader(GLenum pname);
+
+bool allowedShaderType(GLenum shadertype);
+bool allowedPrecisionType(GLenum precisiontype);
+
+bool allowedGetProgram(int majorVersion, int minorVersion, GLenum pname);
+
+bool allowedGetActiveUniforms(GLenum pname) ;
+bool allowedGetActiveUniformBlock(GLenum pname) ;
+
+bool allowedGetVertexAttrib(GLenum pname) ;
+
+bool allowedGetRenderbufferParameter(GLenum pname);
+
+bool allowedQueryTarget(GLenum target);
+bool allowedQueryParam(GLenum pname);
+bool allowedQueryObjectParam(GLenum pname);
+
+bool allowedGetSyncParam(GLenum pname);
+
+bool allowedHintTarget(GLenum target);
+bool allowedHintMode(GLenum pname);
+
+} // namespace GLESv2Validation
+
+#endif
diff --git a/system/GLESv2_enc/IOStream2.cpp b/system/GLESv2_enc/IOStream2.cpp
new file mode 100644
index 0000000..445472c
--- /dev/null
+++ b/system/GLESv2_enc/IOStream2.cpp
@@ -0,0 +1,206 @@
+#include "IOStream.h"
+
+#include "GL2Encoder.h"
+
+#include <GLES3/gl31.h>
+
+#include <vector>
+
+#include <assert.h>
+
+namespace gfxstream {
+
+void IOStream::readbackPixels(void* context, int width, int height, unsigned int format, unsigned int type, void* pixels) {
+    GL2Encoder *ctx = (GL2Encoder *)context;
+    assert (ctx->state() != NULL);
+
+    int bpp = 0;
+    int startOffset = 0;
+    int pixelRowSize = 0;
+    int totalRowSize = 0;
+    int skipRows = 0;
+
+    ctx->state()->getPackingOffsets2D(width, height, format, type,
+                                      &bpp,
+                                      &startOffset,
+                                      &pixelRowSize,
+                                      &totalRowSize,
+                                      &skipRows);
+
+    size_t pixelDataSize =
+        ctx->state()->pixelDataSize(
+            width, height, 1, format, type, 1 /* is pack */);
+
+    if (startOffset == 0 &&
+        pixelRowSize == totalRowSize) {
+        // fast path
+        readback(pixels, pixelDataSize);
+    } else if (pixelRowSize == totalRowSize && (pixelRowSize == width * bpp)) {
+        // fast path but with skip in the beginning
+        std::vector<char> paddingToDiscard(startOffset, 0);
+        readback(&paddingToDiscard[0], startOffset);
+        readback((char*)pixels + startOffset, pixelDataSize - startOffset);
+    } else {
+
+        if (startOffset > 0) {
+            std::vector<char> paddingToDiscard(startOffset, 0);
+            readback(&paddingToDiscard[0], startOffset);
+        }
+        // need to read back row by row
+        size_t paddingSize = totalRowSize - pixelRowSize;
+        std::vector<char> paddingToDiscard(paddingSize, 0);
+
+        char* start = (char*)pixels + startOffset;
+
+        for (int i = 0; i < height; i++) {
+            if (pixelRowSize > width * bpp) {
+                size_t rowSlack = pixelRowSize - width * bpp;
+                std::vector<char> rowSlackToDiscard(rowSlack, 0);
+                readback(start, width * bpp);
+                readback(&rowSlackToDiscard[0], rowSlack);
+                readback(&paddingToDiscard[0], paddingSize);
+                start += totalRowSize;
+            } else {
+                readback(start, pixelRowSize);
+                readback(&paddingToDiscard[0], paddingSize);
+                start += totalRowSize;
+            }
+        }
+    }
+}
+
+void IOStream::uploadPixels(void* context, int width, int height, int depth, unsigned int format, unsigned int type, const void* pixels) {
+    GL2Encoder *ctx = (GL2Encoder *)context;
+    assert (ctx->state() != NULL);
+
+    if (1 == depth) {
+        int bpp = 0;
+        int startOffset = 0;
+        int pixelRowSize = 0;
+        int totalRowSize = 0;
+        int skipRows = 0;
+
+        ctx->state()->getUnpackingOffsets2D(width, height, format, type,
+                &bpp,
+                &startOffset,
+                &pixelRowSize,
+                &totalRowSize,
+                &skipRows);
+
+        size_t pixelDataSize =
+            ctx->state()->pixelDataSize(
+                    width, height, 1, format, type, 0 /* is unpack */);
+
+        if (startOffset == 0 &&
+                pixelRowSize == totalRowSize) {
+            // fast path
+            writeFully(pixels, pixelDataSize);
+        } else if (pixelRowSize == totalRowSize && (pixelRowSize == width * bpp)) {
+            // fast path but with skip in the beginning
+            std::vector<char> paddingToDiscard(startOffset, 0);
+            writeFully(&paddingToDiscard[0], startOffset);
+            writeFully((char*)pixels + startOffset, pixelDataSize - startOffset);
+        } else {
+
+            if (startOffset > 0) {
+                std::vector<char> paddingToDiscard(startOffset, 0);
+                writeFully(&paddingToDiscard[0], startOffset);
+            }
+            // need to upload row by row
+            size_t paddingSize = totalRowSize - pixelRowSize;
+            std::vector<char> paddingToDiscard(paddingSize, 0);
+
+            char* start = (char*)pixels + startOffset;
+
+            for (int i = 0; i < height; i++) {
+                if (pixelRowSize > width * bpp) {
+                    size_t rowSlack = pixelRowSize - width * bpp;
+                    std::vector<char> rowSlackToDiscard(rowSlack, 0);
+                    writeFully(start, width * bpp);
+                    writeFully(&rowSlackToDiscard[0], rowSlack);
+                    writeFully(&paddingToDiscard[0], paddingSize);
+                    start += totalRowSize;
+                } else {
+                    writeFully(start, pixelRowSize);
+                    writeFully(&paddingToDiscard[0], paddingSize);
+                    start += totalRowSize;
+                }
+            }
+        }
+    } else {
+        int bpp = 0;
+        int startOffset = 0;
+        int pixelRowSize = 0;
+        int totalRowSize = 0;
+        int pixelImageSize = 0;
+        int totalImageSize = 0;
+        int skipRows = 0;
+        int skipImages = 0;
+
+        ctx->state()->getUnpackingOffsets3D(width, height, depth, format, type,
+                &bpp,
+                &startOffset,
+                &pixelRowSize,
+                &totalRowSize,
+                &pixelImageSize,
+                &totalImageSize,
+                &skipRows,
+                &skipImages);
+
+        size_t pixelDataSize =
+            ctx->state()->pixelDataSize(
+                    width, height, depth, format, type, 0 /* is unpack */);
+
+
+        if (startOffset == 0 &&
+            pixelRowSize == totalRowSize &&
+            pixelImageSize == totalImageSize) {
+            // fast path
+            writeFully(pixels, pixelDataSize);
+        } else if (pixelRowSize == totalRowSize &&
+                   pixelImageSize == totalImageSize &&
+                   pixelRowSize == (width * bpp)) {
+            // fast path but with skip in the beginning
+            std::vector<char> paddingToDiscard(startOffset, 0);
+            writeFully(&paddingToDiscard[0], startOffset);
+            writeFully((char*)pixels + startOffset, pixelDataSize - startOffset);
+        } else {
+
+            if (startOffset > 0) {
+                std::vector<char> paddingToDiscard(startOffset, 0);
+                writeFully(&paddingToDiscard[0], startOffset);
+            }
+            // need to upload row by row
+            size_t paddingSize = totalRowSize - pixelRowSize;
+            std::vector<char> paddingToDiscard(paddingSize, 0);
+
+            char* start = (char*)pixels + startOffset;
+
+            size_t imageSlack = totalImageSize - pixelImageSize;
+            std::vector<char> imageSlackToDiscard(imageSlack, 0);
+
+            for (int k = 0; k < depth; ++k) {
+                for (int i = 0; i < height; i++) {
+                    if (pixelRowSize > width * bpp) {
+                        size_t rowSlack = pixelRowSize - width * bpp;
+                        std::vector<char> rowSlackToDiscard(rowSlack, 0);
+                        writeFully(start, width * bpp);
+                        writeFully(&rowSlackToDiscard[0], rowSlack);
+                        writeFully(&paddingToDiscard[0], paddingSize);
+                        start += totalRowSize;
+                    } else {
+                        writeFully(start, pixelRowSize);
+                        writeFully(&paddingToDiscard[0], paddingSize);
+                        start += totalRowSize;
+                    }
+                }
+                if (imageSlack > 0) {
+                    writeFully(&imageSlackToDiscard[0], imageSlack);
+                    start += imageSlack;
+                }
+            }
+        }
+    }
+}
+
+}  // namespace gfxstream
\ No newline at end of file
diff --git a/system/GLESv2_enc/gl2_client_context.cpp b/system/GLESv2_enc/gl2_client_context.cpp
new file mode 100644
index 0000000..2c10f7d
--- /dev/null
+++ b/system/GLESv2_enc/gl2_client_context.cpp
@@ -0,0 +1,454 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+
+
+#include <string.h>
+#include "gl2_client_context.h"
+
+
+#include <stdio.h>
+
+int gl2_client_context_t::initDispatchByName(void *(*getProc)(const char *, void *userData), void *userData)
+{
+	glActiveTexture = (glActiveTexture_client_proc_t) getProc("glActiveTexture", userData);
+	glAttachShader = (glAttachShader_client_proc_t) getProc("glAttachShader", userData);
+	glBindAttribLocation = (glBindAttribLocation_client_proc_t) getProc("glBindAttribLocation", userData);
+	glBindBuffer = (glBindBuffer_client_proc_t) getProc("glBindBuffer", userData);
+	glBindFramebuffer = (glBindFramebuffer_client_proc_t) getProc("glBindFramebuffer", userData);
+	glBindRenderbuffer = (glBindRenderbuffer_client_proc_t) getProc("glBindRenderbuffer", userData);
+	glBindTexture = (glBindTexture_client_proc_t) getProc("glBindTexture", userData);
+	glBlendColor = (glBlendColor_client_proc_t) getProc("glBlendColor", userData);
+	glBlendEquation = (glBlendEquation_client_proc_t) getProc("glBlendEquation", userData);
+	glBlendEquationSeparate = (glBlendEquationSeparate_client_proc_t) getProc("glBlendEquationSeparate", userData);
+	glBlendFunc = (glBlendFunc_client_proc_t) getProc("glBlendFunc", userData);
+	glBlendFuncSeparate = (glBlendFuncSeparate_client_proc_t) getProc("glBlendFuncSeparate", userData);
+	glBufferData = (glBufferData_client_proc_t) getProc("glBufferData", userData);
+	glBufferSubData = (glBufferSubData_client_proc_t) getProc("glBufferSubData", userData);
+	glCheckFramebufferStatus = (glCheckFramebufferStatus_client_proc_t) getProc("glCheckFramebufferStatus", userData);
+	glClear = (glClear_client_proc_t) getProc("glClear", userData);
+	glClearColor = (glClearColor_client_proc_t) getProc("glClearColor", userData);
+	glClearDepthf = (glClearDepthf_client_proc_t) getProc("glClearDepthf", userData);
+	glClearStencil = (glClearStencil_client_proc_t) getProc("glClearStencil", userData);
+	glColorMask = (glColorMask_client_proc_t) getProc("glColorMask", userData);
+	glCompileShader = (glCompileShader_client_proc_t) getProc("glCompileShader", userData);
+	glCompressedTexImage2D = (glCompressedTexImage2D_client_proc_t) getProc("glCompressedTexImage2D", userData);
+	glCompressedTexSubImage2D = (glCompressedTexSubImage2D_client_proc_t) getProc("glCompressedTexSubImage2D", userData);
+	glCopyTexImage2D = (glCopyTexImage2D_client_proc_t) getProc("glCopyTexImage2D", userData);
+	glCopyTexSubImage2D = (glCopyTexSubImage2D_client_proc_t) getProc("glCopyTexSubImage2D", userData);
+	glCreateProgram = (glCreateProgram_client_proc_t) getProc("glCreateProgram", userData);
+	glCreateShader = (glCreateShader_client_proc_t) getProc("glCreateShader", userData);
+	glCullFace = (glCullFace_client_proc_t) getProc("glCullFace", userData);
+	glDeleteBuffers = (glDeleteBuffers_client_proc_t) getProc("glDeleteBuffers", userData);
+	glDeleteFramebuffers = (glDeleteFramebuffers_client_proc_t) getProc("glDeleteFramebuffers", userData);
+	glDeleteProgram = (glDeleteProgram_client_proc_t) getProc("glDeleteProgram", userData);
+	glDeleteRenderbuffers = (glDeleteRenderbuffers_client_proc_t) getProc("glDeleteRenderbuffers", userData);
+	glDeleteShader = (glDeleteShader_client_proc_t) getProc("glDeleteShader", userData);
+	glDeleteTextures = (glDeleteTextures_client_proc_t) getProc("glDeleteTextures", userData);
+	glDepthFunc = (glDepthFunc_client_proc_t) getProc("glDepthFunc", userData);
+	glDepthMask = (glDepthMask_client_proc_t) getProc("glDepthMask", userData);
+	glDepthRangef = (glDepthRangef_client_proc_t) getProc("glDepthRangef", userData);
+	glDetachShader = (glDetachShader_client_proc_t) getProc("glDetachShader", userData);
+	glDisable = (glDisable_client_proc_t) getProc("glDisable", userData);
+	glDisableVertexAttribArray = (glDisableVertexAttribArray_client_proc_t) getProc("glDisableVertexAttribArray", userData);
+	glDrawArrays = (glDrawArrays_client_proc_t) getProc("glDrawArrays", userData);
+	glDrawElements = (glDrawElements_client_proc_t) getProc("glDrawElements", userData);
+	glEnable = (glEnable_client_proc_t) getProc("glEnable", userData);
+	glEnableVertexAttribArray = (glEnableVertexAttribArray_client_proc_t) getProc("glEnableVertexAttribArray", userData);
+	glFinish = (glFinish_client_proc_t) getProc("glFinish", userData);
+	glFlush = (glFlush_client_proc_t) getProc("glFlush", userData);
+	glFramebufferRenderbuffer = (glFramebufferRenderbuffer_client_proc_t) getProc("glFramebufferRenderbuffer", userData);
+	glFramebufferTexture2D = (glFramebufferTexture2D_client_proc_t) getProc("glFramebufferTexture2D", userData);
+	glFrontFace = (glFrontFace_client_proc_t) getProc("glFrontFace", userData);
+	glGenBuffers = (glGenBuffers_client_proc_t) getProc("glGenBuffers", userData);
+	glGenerateMipmap = (glGenerateMipmap_client_proc_t) getProc("glGenerateMipmap", userData);
+	glGenFramebuffers = (glGenFramebuffers_client_proc_t) getProc("glGenFramebuffers", userData);
+	glGenRenderbuffers = (glGenRenderbuffers_client_proc_t) getProc("glGenRenderbuffers", userData);
+	glGenTextures = (glGenTextures_client_proc_t) getProc("glGenTextures", userData);
+	glGetActiveAttrib = (glGetActiveAttrib_client_proc_t) getProc("glGetActiveAttrib", userData);
+	glGetActiveUniform = (glGetActiveUniform_client_proc_t) getProc("glGetActiveUniform", userData);
+	glGetAttachedShaders = (glGetAttachedShaders_client_proc_t) getProc("glGetAttachedShaders", userData);
+	glGetAttribLocation = (glGetAttribLocation_client_proc_t) getProc("glGetAttribLocation", userData);
+	glGetBooleanv = (glGetBooleanv_client_proc_t) getProc("glGetBooleanv", userData);
+	glGetBufferParameteriv = (glGetBufferParameteriv_client_proc_t) getProc("glGetBufferParameteriv", userData);
+	glGetError = (glGetError_client_proc_t) getProc("glGetError", userData);
+	glGetFloatv = (glGetFloatv_client_proc_t) getProc("glGetFloatv", userData);
+	glGetFramebufferAttachmentParameteriv = (glGetFramebufferAttachmentParameteriv_client_proc_t) getProc("glGetFramebufferAttachmentParameteriv", userData);
+	glGetIntegerv = (glGetIntegerv_client_proc_t) getProc("glGetIntegerv", userData);
+	glGetProgramiv = (glGetProgramiv_client_proc_t) getProc("glGetProgramiv", userData);
+	glGetProgramInfoLog = (glGetProgramInfoLog_client_proc_t) getProc("glGetProgramInfoLog", userData);
+	glGetRenderbufferParameteriv = (glGetRenderbufferParameteriv_client_proc_t) getProc("glGetRenderbufferParameteriv", userData);
+	glGetShaderiv = (glGetShaderiv_client_proc_t) getProc("glGetShaderiv", userData);
+	glGetShaderInfoLog = (glGetShaderInfoLog_client_proc_t) getProc("glGetShaderInfoLog", userData);
+	glGetShaderPrecisionFormat = (glGetShaderPrecisionFormat_client_proc_t) getProc("glGetShaderPrecisionFormat", userData);
+	glGetShaderSource = (glGetShaderSource_client_proc_t) getProc("glGetShaderSource", userData);
+	glGetString = (glGetString_client_proc_t) getProc("glGetString", userData);
+	glGetTexParameterfv = (glGetTexParameterfv_client_proc_t) getProc("glGetTexParameterfv", userData);
+	glGetTexParameteriv = (glGetTexParameteriv_client_proc_t) getProc("glGetTexParameteriv", userData);
+	glGetUniformfv = (glGetUniformfv_client_proc_t) getProc("glGetUniformfv", userData);
+	glGetUniformiv = (glGetUniformiv_client_proc_t) getProc("glGetUniformiv", userData);
+	glGetUniformLocation = (glGetUniformLocation_client_proc_t) getProc("glGetUniformLocation", userData);
+	glGetVertexAttribfv = (glGetVertexAttribfv_client_proc_t) getProc("glGetVertexAttribfv", userData);
+	glGetVertexAttribiv = (glGetVertexAttribiv_client_proc_t) getProc("glGetVertexAttribiv", userData);
+	glGetVertexAttribPointerv = (glGetVertexAttribPointerv_client_proc_t) getProc("glGetVertexAttribPointerv", userData);
+	glHint = (glHint_client_proc_t) getProc("glHint", userData);
+	glIsBuffer = (glIsBuffer_client_proc_t) getProc("glIsBuffer", userData);
+	glIsEnabled = (glIsEnabled_client_proc_t) getProc("glIsEnabled", userData);
+	glIsFramebuffer = (glIsFramebuffer_client_proc_t) getProc("glIsFramebuffer", userData);
+	glIsProgram = (glIsProgram_client_proc_t) getProc("glIsProgram", userData);
+	glIsRenderbuffer = (glIsRenderbuffer_client_proc_t) getProc("glIsRenderbuffer", userData);
+	glIsShader = (glIsShader_client_proc_t) getProc("glIsShader", userData);
+	glIsTexture = (glIsTexture_client_proc_t) getProc("glIsTexture", userData);
+	glLineWidth = (glLineWidth_client_proc_t) getProc("glLineWidth", userData);
+	glLinkProgram = (glLinkProgram_client_proc_t) getProc("glLinkProgram", userData);
+	glPixelStorei = (glPixelStorei_client_proc_t) getProc("glPixelStorei", userData);
+	glPolygonOffset = (glPolygonOffset_client_proc_t) getProc("glPolygonOffset", userData);
+	glReadPixels = (glReadPixels_client_proc_t) getProc("glReadPixels", userData);
+	glReleaseShaderCompiler = (glReleaseShaderCompiler_client_proc_t) getProc("glReleaseShaderCompiler", userData);
+	glRenderbufferStorage = (glRenderbufferStorage_client_proc_t) getProc("glRenderbufferStorage", userData);
+	glSampleCoverage = (glSampleCoverage_client_proc_t) getProc("glSampleCoverage", userData);
+	glScissor = (glScissor_client_proc_t) getProc("glScissor", userData);
+	glShaderBinary = (glShaderBinary_client_proc_t) getProc("glShaderBinary", userData);
+	glShaderSource = (glShaderSource_client_proc_t) getProc("glShaderSource", userData);
+	glStencilFunc = (glStencilFunc_client_proc_t) getProc("glStencilFunc", userData);
+	glStencilFuncSeparate = (glStencilFuncSeparate_client_proc_t) getProc("glStencilFuncSeparate", userData);
+	glStencilMask = (glStencilMask_client_proc_t) getProc("glStencilMask", userData);
+	glStencilMaskSeparate = (glStencilMaskSeparate_client_proc_t) getProc("glStencilMaskSeparate", userData);
+	glStencilOp = (glStencilOp_client_proc_t) getProc("glStencilOp", userData);
+	glStencilOpSeparate = (glStencilOpSeparate_client_proc_t) getProc("glStencilOpSeparate", userData);
+	glTexImage2D = (glTexImage2D_client_proc_t) getProc("glTexImage2D", userData);
+	glTexParameterf = (glTexParameterf_client_proc_t) getProc("glTexParameterf", userData);
+	glTexParameterfv = (glTexParameterfv_client_proc_t) getProc("glTexParameterfv", userData);
+	glTexParameteri = (glTexParameteri_client_proc_t) getProc("glTexParameteri", userData);
+	glTexParameteriv = (glTexParameteriv_client_proc_t) getProc("glTexParameteriv", userData);
+	glTexSubImage2D = (glTexSubImage2D_client_proc_t) getProc("glTexSubImage2D", userData);
+	glUniform1f = (glUniform1f_client_proc_t) getProc("glUniform1f", userData);
+	glUniform1fv = (glUniform1fv_client_proc_t) getProc("glUniform1fv", userData);
+	glUniform1i = (glUniform1i_client_proc_t) getProc("glUniform1i", userData);
+	glUniform1iv = (glUniform1iv_client_proc_t) getProc("glUniform1iv", userData);
+	glUniform2f = (glUniform2f_client_proc_t) getProc("glUniform2f", userData);
+	glUniform2fv = (glUniform2fv_client_proc_t) getProc("glUniform2fv", userData);
+	glUniform2i = (glUniform2i_client_proc_t) getProc("glUniform2i", userData);
+	glUniform2iv = (glUniform2iv_client_proc_t) getProc("glUniform2iv", userData);
+	glUniform3f = (glUniform3f_client_proc_t) getProc("glUniform3f", userData);
+	glUniform3fv = (glUniform3fv_client_proc_t) getProc("glUniform3fv", userData);
+	glUniform3i = (glUniform3i_client_proc_t) getProc("glUniform3i", userData);
+	glUniform3iv = (glUniform3iv_client_proc_t) getProc("glUniform3iv", userData);
+	glUniform4f = (glUniform4f_client_proc_t) getProc("glUniform4f", userData);
+	glUniform4fv = (glUniform4fv_client_proc_t) getProc("glUniform4fv", userData);
+	glUniform4i = (glUniform4i_client_proc_t) getProc("glUniform4i", userData);
+	glUniform4iv = (glUniform4iv_client_proc_t) getProc("glUniform4iv", userData);
+	glUniformMatrix2fv = (glUniformMatrix2fv_client_proc_t) getProc("glUniformMatrix2fv", userData);
+	glUniformMatrix3fv = (glUniformMatrix3fv_client_proc_t) getProc("glUniformMatrix3fv", userData);
+	glUniformMatrix4fv = (glUniformMatrix4fv_client_proc_t) getProc("glUniformMatrix4fv", userData);
+	glUseProgram = (glUseProgram_client_proc_t) getProc("glUseProgram", userData);
+	glValidateProgram = (glValidateProgram_client_proc_t) getProc("glValidateProgram", userData);
+	glVertexAttrib1f = (glVertexAttrib1f_client_proc_t) getProc("glVertexAttrib1f", userData);
+	glVertexAttrib1fv = (glVertexAttrib1fv_client_proc_t) getProc("glVertexAttrib1fv", userData);
+	glVertexAttrib2f = (glVertexAttrib2f_client_proc_t) getProc("glVertexAttrib2f", userData);
+	glVertexAttrib2fv = (glVertexAttrib2fv_client_proc_t) getProc("glVertexAttrib2fv", userData);
+	glVertexAttrib3f = (glVertexAttrib3f_client_proc_t) getProc("glVertexAttrib3f", userData);
+	glVertexAttrib3fv = (glVertexAttrib3fv_client_proc_t) getProc("glVertexAttrib3fv", userData);
+	glVertexAttrib4f = (glVertexAttrib4f_client_proc_t) getProc("glVertexAttrib4f", userData);
+	glVertexAttrib4fv = (glVertexAttrib4fv_client_proc_t) getProc("glVertexAttrib4fv", userData);
+	glVertexAttribPointer = (glVertexAttribPointer_client_proc_t) getProc("glVertexAttribPointer", userData);
+	glViewport = (glViewport_client_proc_t) getProc("glViewport", userData);
+	glEGLImageTargetTexture2DOES = (glEGLImageTargetTexture2DOES_client_proc_t) getProc("glEGLImageTargetTexture2DOES", userData);
+	glEGLImageTargetRenderbufferStorageOES = (glEGLImageTargetRenderbufferStorageOES_client_proc_t) getProc("glEGLImageTargetRenderbufferStorageOES", userData);
+	glGetProgramBinaryOES = (glGetProgramBinaryOES_client_proc_t) getProc("glGetProgramBinaryOES", userData);
+	glProgramBinaryOES = (glProgramBinaryOES_client_proc_t) getProc("glProgramBinaryOES", userData);
+	glMapBufferOES = (glMapBufferOES_client_proc_t) getProc("glMapBufferOES", userData);
+	glUnmapBufferOES = (glUnmapBufferOES_client_proc_t) getProc("glUnmapBufferOES", userData);
+	glTexImage3DOES = (glTexImage3DOES_client_proc_t) getProc("glTexImage3DOES", userData);
+	glTexSubImage3DOES = (glTexSubImage3DOES_client_proc_t) getProc("glTexSubImage3DOES", userData);
+	glCopyTexSubImage3DOES = (glCopyTexSubImage3DOES_client_proc_t) getProc("glCopyTexSubImage3DOES", userData);
+	glCompressedTexImage3DOES = (glCompressedTexImage3DOES_client_proc_t) getProc("glCompressedTexImage3DOES", userData);
+	glCompressedTexSubImage3DOES = (glCompressedTexSubImage3DOES_client_proc_t) getProc("glCompressedTexSubImage3DOES", userData);
+	glFramebufferTexture3DOES = (glFramebufferTexture3DOES_client_proc_t) getProc("glFramebufferTexture3DOES", userData);
+	glBindVertexArrayOES = (glBindVertexArrayOES_client_proc_t) getProc("glBindVertexArrayOES", userData);
+	glDeleteVertexArraysOES = (glDeleteVertexArraysOES_client_proc_t) getProc("glDeleteVertexArraysOES", userData);
+	glGenVertexArraysOES = (glGenVertexArraysOES_client_proc_t) getProc("glGenVertexArraysOES", userData);
+	glIsVertexArrayOES = (glIsVertexArrayOES_client_proc_t) getProc("glIsVertexArrayOES", userData);
+	glDiscardFramebufferEXT = (glDiscardFramebufferEXT_client_proc_t) getProc("glDiscardFramebufferEXT", userData);
+	glMultiDrawArraysEXT = (glMultiDrawArraysEXT_client_proc_t) getProc("glMultiDrawArraysEXT", userData);
+	glMultiDrawElementsEXT = (glMultiDrawElementsEXT_client_proc_t) getProc("glMultiDrawElementsEXT", userData);
+	glGetPerfMonitorGroupsAMD = (glGetPerfMonitorGroupsAMD_client_proc_t) getProc("glGetPerfMonitorGroupsAMD", userData);
+	glGetPerfMonitorCountersAMD = (glGetPerfMonitorCountersAMD_client_proc_t) getProc("glGetPerfMonitorCountersAMD", userData);
+	glGetPerfMonitorGroupStringAMD = (glGetPerfMonitorGroupStringAMD_client_proc_t) getProc("glGetPerfMonitorGroupStringAMD", userData);
+	glGetPerfMonitorCounterStringAMD = (glGetPerfMonitorCounterStringAMD_client_proc_t) getProc("glGetPerfMonitorCounterStringAMD", userData);
+	glGetPerfMonitorCounterInfoAMD = (glGetPerfMonitorCounterInfoAMD_client_proc_t) getProc("glGetPerfMonitorCounterInfoAMD", userData);
+	glGenPerfMonitorsAMD = (glGenPerfMonitorsAMD_client_proc_t) getProc("glGenPerfMonitorsAMD", userData);
+	glDeletePerfMonitorsAMD = (glDeletePerfMonitorsAMD_client_proc_t) getProc("glDeletePerfMonitorsAMD", userData);
+	glSelectPerfMonitorCountersAMD = (glSelectPerfMonitorCountersAMD_client_proc_t) getProc("glSelectPerfMonitorCountersAMD", userData);
+	glBeginPerfMonitorAMD = (glBeginPerfMonitorAMD_client_proc_t) getProc("glBeginPerfMonitorAMD", userData);
+	glEndPerfMonitorAMD = (glEndPerfMonitorAMD_client_proc_t) getProc("glEndPerfMonitorAMD", userData);
+	glGetPerfMonitorCounterDataAMD = (glGetPerfMonitorCounterDataAMD_client_proc_t) getProc("glGetPerfMonitorCounterDataAMD", userData);
+	glRenderbufferStorageMultisampleIMG = (glRenderbufferStorageMultisampleIMG_client_proc_t) getProc("glRenderbufferStorageMultisampleIMG", userData);
+	glFramebufferTexture2DMultisampleIMG = (glFramebufferTexture2DMultisampleIMG_client_proc_t) getProc("glFramebufferTexture2DMultisampleIMG", userData);
+	glDeleteFencesNV = (glDeleteFencesNV_client_proc_t) getProc("glDeleteFencesNV", userData);
+	glGenFencesNV = (glGenFencesNV_client_proc_t) getProc("glGenFencesNV", userData);
+	glIsFenceNV = (glIsFenceNV_client_proc_t) getProc("glIsFenceNV", userData);
+	glTestFenceNV = (glTestFenceNV_client_proc_t) getProc("glTestFenceNV", userData);
+	glGetFenceivNV = (glGetFenceivNV_client_proc_t) getProc("glGetFenceivNV", userData);
+	glFinishFenceNV = (glFinishFenceNV_client_proc_t) getProc("glFinishFenceNV", userData);
+	glSetFenceNV = (glSetFenceNV_client_proc_t) getProc("glSetFenceNV", userData);
+	glCoverageMaskNV = (glCoverageMaskNV_client_proc_t) getProc("glCoverageMaskNV", userData);
+	glCoverageOperationNV = (glCoverageOperationNV_client_proc_t) getProc("glCoverageOperationNV", userData);
+	glGetDriverControlsQCOM = (glGetDriverControlsQCOM_client_proc_t) getProc("glGetDriverControlsQCOM", userData);
+	glGetDriverControlStringQCOM = (glGetDriverControlStringQCOM_client_proc_t) getProc("glGetDriverControlStringQCOM", userData);
+	glEnableDriverControlQCOM = (glEnableDriverControlQCOM_client_proc_t) getProc("glEnableDriverControlQCOM", userData);
+	glDisableDriverControlQCOM = (glDisableDriverControlQCOM_client_proc_t) getProc("glDisableDriverControlQCOM", userData);
+	glExtGetTexturesQCOM = (glExtGetTexturesQCOM_client_proc_t) getProc("glExtGetTexturesQCOM", userData);
+	glExtGetBuffersQCOM = (glExtGetBuffersQCOM_client_proc_t) getProc("glExtGetBuffersQCOM", userData);
+	glExtGetRenderbuffersQCOM = (glExtGetRenderbuffersQCOM_client_proc_t) getProc("glExtGetRenderbuffersQCOM", userData);
+	glExtGetFramebuffersQCOM = (glExtGetFramebuffersQCOM_client_proc_t) getProc("glExtGetFramebuffersQCOM", userData);
+	glExtGetTexLevelParameterivQCOM = (glExtGetTexLevelParameterivQCOM_client_proc_t) getProc("glExtGetTexLevelParameterivQCOM", userData);
+	glExtTexObjectStateOverrideiQCOM = (glExtTexObjectStateOverrideiQCOM_client_proc_t) getProc("glExtTexObjectStateOverrideiQCOM", userData);
+	glExtGetTexSubImageQCOM = (glExtGetTexSubImageQCOM_client_proc_t) getProc("glExtGetTexSubImageQCOM", userData);
+	glExtGetBufferPointervQCOM = (glExtGetBufferPointervQCOM_client_proc_t) getProc("glExtGetBufferPointervQCOM", userData);
+	glExtGetShadersQCOM = (glExtGetShadersQCOM_client_proc_t) getProc("glExtGetShadersQCOM", userData);
+	glExtGetProgramsQCOM = (glExtGetProgramsQCOM_client_proc_t) getProc("glExtGetProgramsQCOM", userData);
+	glExtIsProgramBinaryQCOM = (glExtIsProgramBinaryQCOM_client_proc_t) getProc("glExtIsProgramBinaryQCOM", userData);
+	glExtGetProgramBinarySourceQCOM = (glExtGetProgramBinarySourceQCOM_client_proc_t) getProc("glExtGetProgramBinarySourceQCOM", userData);
+	glStartTilingQCOM = (glStartTilingQCOM_client_proc_t) getProc("glStartTilingQCOM", userData);
+	glEndTilingQCOM = (glEndTilingQCOM_client_proc_t) getProc("glEndTilingQCOM", userData);
+	glVertexAttribPointerData = (glVertexAttribPointerData_client_proc_t) getProc("glVertexAttribPointerData", userData);
+	glVertexAttribPointerOffset = (glVertexAttribPointerOffset_client_proc_t) getProc("glVertexAttribPointerOffset", userData);
+	glDrawElementsOffset = (glDrawElementsOffset_client_proc_t) getProc("glDrawElementsOffset", userData);
+	glDrawElementsData = (glDrawElementsData_client_proc_t) getProc("glDrawElementsData", userData);
+	glGetCompressedTextureFormats = (glGetCompressedTextureFormats_client_proc_t) getProc("glGetCompressedTextureFormats", userData);
+	glShaderString = (glShaderString_client_proc_t) getProc("glShaderString", userData);
+	glFinishRoundTrip = (glFinishRoundTrip_client_proc_t) getProc("glFinishRoundTrip", userData);
+	glGenVertexArrays = (glGenVertexArrays_client_proc_t) getProc("glGenVertexArrays", userData);
+	glBindVertexArray = (glBindVertexArray_client_proc_t) getProc("glBindVertexArray", userData);
+	glDeleteVertexArrays = (glDeleteVertexArrays_client_proc_t) getProc("glDeleteVertexArrays", userData);
+	glIsVertexArray = (glIsVertexArray_client_proc_t) getProc("glIsVertexArray", userData);
+	glMapBufferRange = (glMapBufferRange_client_proc_t) getProc("glMapBufferRange", userData);
+	glUnmapBuffer = (glUnmapBuffer_client_proc_t) getProc("glUnmapBuffer", userData);
+	glFlushMappedBufferRange = (glFlushMappedBufferRange_client_proc_t) getProc("glFlushMappedBufferRange", userData);
+	glMapBufferRangeAEMU = (glMapBufferRangeAEMU_client_proc_t) getProc("glMapBufferRangeAEMU", userData);
+	glUnmapBufferAEMU = (glUnmapBufferAEMU_client_proc_t) getProc("glUnmapBufferAEMU", userData);
+	glFlushMappedBufferRangeAEMU = (glFlushMappedBufferRangeAEMU_client_proc_t) getProc("glFlushMappedBufferRangeAEMU", userData);
+	glReadPixelsOffsetAEMU = (glReadPixelsOffsetAEMU_client_proc_t) getProc("glReadPixelsOffsetAEMU", userData);
+	glCompressedTexImage2DOffsetAEMU = (glCompressedTexImage2DOffsetAEMU_client_proc_t) getProc("glCompressedTexImage2DOffsetAEMU", userData);
+	glCompressedTexSubImage2DOffsetAEMU = (glCompressedTexSubImage2DOffsetAEMU_client_proc_t) getProc("glCompressedTexSubImage2DOffsetAEMU", userData);
+	glTexImage2DOffsetAEMU = (glTexImage2DOffsetAEMU_client_proc_t) getProc("glTexImage2DOffsetAEMU", userData);
+	glTexSubImage2DOffsetAEMU = (glTexSubImage2DOffsetAEMU_client_proc_t) getProc("glTexSubImage2DOffsetAEMU", userData);
+	glBindBufferRange = (glBindBufferRange_client_proc_t) getProc("glBindBufferRange", userData);
+	glBindBufferBase = (glBindBufferBase_client_proc_t) getProc("glBindBufferBase", userData);
+	glCopyBufferSubData = (glCopyBufferSubData_client_proc_t) getProc("glCopyBufferSubData", userData);
+	glClearBufferiv = (glClearBufferiv_client_proc_t) getProc("glClearBufferiv", userData);
+	glClearBufferuiv = (glClearBufferuiv_client_proc_t) getProc("glClearBufferuiv", userData);
+	glClearBufferfv = (glClearBufferfv_client_proc_t) getProc("glClearBufferfv", userData);
+	glClearBufferfi = (glClearBufferfi_client_proc_t) getProc("glClearBufferfi", userData);
+	glGetBufferParameteri64v = (glGetBufferParameteri64v_client_proc_t) getProc("glGetBufferParameteri64v", userData);
+	glGetBufferPointerv = (glGetBufferPointerv_client_proc_t) getProc("glGetBufferPointerv", userData);
+	glUniformBlockBinding = (glUniformBlockBinding_client_proc_t) getProc("glUniformBlockBinding", userData);
+	glGetUniformBlockIndex = (glGetUniformBlockIndex_client_proc_t) getProc("glGetUniformBlockIndex", userData);
+	glGetUniformIndices = (glGetUniformIndices_client_proc_t) getProc("glGetUniformIndices", userData);
+	glGetUniformIndicesAEMU = (glGetUniformIndicesAEMU_client_proc_t) getProc("glGetUniformIndicesAEMU", userData);
+	glGetActiveUniformBlockiv = (glGetActiveUniformBlockiv_client_proc_t) getProc("glGetActiveUniformBlockiv", userData);
+	glGetActiveUniformBlockName = (glGetActiveUniformBlockName_client_proc_t) getProc("glGetActiveUniformBlockName", userData);
+	glUniform1ui = (glUniform1ui_client_proc_t) getProc("glUniform1ui", userData);
+	glUniform2ui = (glUniform2ui_client_proc_t) getProc("glUniform2ui", userData);
+	glUniform3ui = (glUniform3ui_client_proc_t) getProc("glUniform3ui", userData);
+	glUniform4ui = (glUniform4ui_client_proc_t) getProc("glUniform4ui", userData);
+	glUniform1uiv = (glUniform1uiv_client_proc_t) getProc("glUniform1uiv", userData);
+	glUniform2uiv = (glUniform2uiv_client_proc_t) getProc("glUniform2uiv", userData);
+	glUniform3uiv = (glUniform3uiv_client_proc_t) getProc("glUniform3uiv", userData);
+	glUniform4uiv = (glUniform4uiv_client_proc_t) getProc("glUniform4uiv", userData);
+	glUniformMatrix2x3fv = (glUniformMatrix2x3fv_client_proc_t) getProc("glUniformMatrix2x3fv", userData);
+	glUniformMatrix3x2fv = (glUniformMatrix3x2fv_client_proc_t) getProc("glUniformMatrix3x2fv", userData);
+	glUniformMatrix2x4fv = (glUniformMatrix2x4fv_client_proc_t) getProc("glUniformMatrix2x4fv", userData);
+	glUniformMatrix4x2fv = (glUniformMatrix4x2fv_client_proc_t) getProc("glUniformMatrix4x2fv", userData);
+	glUniformMatrix3x4fv = (glUniformMatrix3x4fv_client_proc_t) getProc("glUniformMatrix3x4fv", userData);
+	glUniformMatrix4x3fv = (glUniformMatrix4x3fv_client_proc_t) getProc("glUniformMatrix4x3fv", userData);
+	glGetUniformuiv = (glGetUniformuiv_client_proc_t) getProc("glGetUniformuiv", userData);
+	glGetActiveUniformsiv = (glGetActiveUniformsiv_client_proc_t) getProc("glGetActiveUniformsiv", userData);
+	glVertexAttribI4i = (glVertexAttribI4i_client_proc_t) getProc("glVertexAttribI4i", userData);
+	glVertexAttribI4ui = (glVertexAttribI4ui_client_proc_t) getProc("glVertexAttribI4ui", userData);
+	glVertexAttribI4iv = (glVertexAttribI4iv_client_proc_t) getProc("glVertexAttribI4iv", userData);
+	glVertexAttribI4uiv = (glVertexAttribI4uiv_client_proc_t) getProc("glVertexAttribI4uiv", userData);
+	glVertexAttribIPointer = (glVertexAttribIPointer_client_proc_t) getProc("glVertexAttribIPointer", userData);
+	glVertexAttribIPointerOffsetAEMU = (glVertexAttribIPointerOffsetAEMU_client_proc_t) getProc("glVertexAttribIPointerOffsetAEMU", userData);
+	glVertexAttribIPointerDataAEMU = (glVertexAttribIPointerDataAEMU_client_proc_t) getProc("glVertexAttribIPointerDataAEMU", userData);
+	glGetVertexAttribIiv = (glGetVertexAttribIiv_client_proc_t) getProc("glGetVertexAttribIiv", userData);
+	glGetVertexAttribIuiv = (glGetVertexAttribIuiv_client_proc_t) getProc("glGetVertexAttribIuiv", userData);
+	glVertexAttribDivisor = (glVertexAttribDivisor_client_proc_t) getProc("glVertexAttribDivisor", userData);
+	glDrawArraysInstanced = (glDrawArraysInstanced_client_proc_t) getProc("glDrawArraysInstanced", userData);
+	glDrawElementsInstanced = (glDrawElementsInstanced_client_proc_t) getProc("glDrawElementsInstanced", userData);
+	glDrawElementsInstancedDataAEMU = (glDrawElementsInstancedDataAEMU_client_proc_t) getProc("glDrawElementsInstancedDataAEMU", userData);
+	glDrawElementsInstancedOffsetAEMU = (glDrawElementsInstancedOffsetAEMU_client_proc_t) getProc("glDrawElementsInstancedOffsetAEMU", userData);
+	glDrawRangeElements = (glDrawRangeElements_client_proc_t) getProc("glDrawRangeElements", userData);
+	glDrawRangeElementsDataAEMU = (glDrawRangeElementsDataAEMU_client_proc_t) getProc("glDrawRangeElementsDataAEMU", userData);
+	glDrawRangeElementsOffsetAEMU = (glDrawRangeElementsOffsetAEMU_client_proc_t) getProc("glDrawRangeElementsOffsetAEMU", userData);
+	glFenceSync = (glFenceSync_client_proc_t) getProc("glFenceSync", userData);
+	glClientWaitSync = (glClientWaitSync_client_proc_t) getProc("glClientWaitSync", userData);
+	glWaitSync = (glWaitSync_client_proc_t) getProc("glWaitSync", userData);
+	glDeleteSync = (glDeleteSync_client_proc_t) getProc("glDeleteSync", userData);
+	glIsSync = (glIsSync_client_proc_t) getProc("glIsSync", userData);
+	glGetSynciv = (glGetSynciv_client_proc_t) getProc("glGetSynciv", userData);
+	glFenceSyncAEMU = (glFenceSyncAEMU_client_proc_t) getProc("glFenceSyncAEMU", userData);
+	glClientWaitSyncAEMU = (glClientWaitSyncAEMU_client_proc_t) getProc("glClientWaitSyncAEMU", userData);
+	glWaitSyncAEMU = (glWaitSyncAEMU_client_proc_t) getProc("glWaitSyncAEMU", userData);
+	glDeleteSyncAEMU = (glDeleteSyncAEMU_client_proc_t) getProc("glDeleteSyncAEMU", userData);
+	glIsSyncAEMU = (glIsSyncAEMU_client_proc_t) getProc("glIsSyncAEMU", userData);
+	glGetSyncivAEMU = (glGetSyncivAEMU_client_proc_t) getProc("glGetSyncivAEMU", userData);
+	glDrawBuffers = (glDrawBuffers_client_proc_t) getProc("glDrawBuffers", userData);
+	glReadBuffer = (glReadBuffer_client_proc_t) getProc("glReadBuffer", userData);
+	glBlitFramebuffer = (glBlitFramebuffer_client_proc_t) getProc("glBlitFramebuffer", userData);
+	glInvalidateFramebuffer = (glInvalidateFramebuffer_client_proc_t) getProc("glInvalidateFramebuffer", userData);
+	glInvalidateSubFramebuffer = (glInvalidateSubFramebuffer_client_proc_t) getProc("glInvalidateSubFramebuffer", userData);
+	glFramebufferTextureLayer = (glFramebufferTextureLayer_client_proc_t) getProc("glFramebufferTextureLayer", userData);
+	glRenderbufferStorageMultisample = (glRenderbufferStorageMultisample_client_proc_t) getProc("glRenderbufferStorageMultisample", userData);
+	glTexStorage2D = (glTexStorage2D_client_proc_t) getProc("glTexStorage2D", userData);
+	glGetInternalformativ = (glGetInternalformativ_client_proc_t) getProc("glGetInternalformativ", userData);
+	glBeginTransformFeedback = (glBeginTransformFeedback_client_proc_t) getProc("glBeginTransformFeedback", userData);
+	glEndTransformFeedback = (glEndTransformFeedback_client_proc_t) getProc("glEndTransformFeedback", userData);
+	glGenTransformFeedbacks = (glGenTransformFeedbacks_client_proc_t) getProc("glGenTransformFeedbacks", userData);
+	glDeleteTransformFeedbacks = (glDeleteTransformFeedbacks_client_proc_t) getProc("glDeleteTransformFeedbacks", userData);
+	glBindTransformFeedback = (glBindTransformFeedback_client_proc_t) getProc("glBindTransformFeedback", userData);
+	glPauseTransformFeedback = (glPauseTransformFeedback_client_proc_t) getProc("glPauseTransformFeedback", userData);
+	glResumeTransformFeedback = (glResumeTransformFeedback_client_proc_t) getProc("glResumeTransformFeedback", userData);
+	glIsTransformFeedback = (glIsTransformFeedback_client_proc_t) getProc("glIsTransformFeedback", userData);
+	glTransformFeedbackVaryings = (glTransformFeedbackVaryings_client_proc_t) getProc("glTransformFeedbackVaryings", userData);
+	glTransformFeedbackVaryingsAEMU = (glTransformFeedbackVaryingsAEMU_client_proc_t) getProc("glTransformFeedbackVaryingsAEMU", userData);
+	glGetTransformFeedbackVarying = (glGetTransformFeedbackVarying_client_proc_t) getProc("glGetTransformFeedbackVarying", userData);
+	glGenSamplers = (glGenSamplers_client_proc_t) getProc("glGenSamplers", userData);
+	glDeleteSamplers = (glDeleteSamplers_client_proc_t) getProc("glDeleteSamplers", userData);
+	glBindSampler = (glBindSampler_client_proc_t) getProc("glBindSampler", userData);
+	glSamplerParameterf = (glSamplerParameterf_client_proc_t) getProc("glSamplerParameterf", userData);
+	glSamplerParameteri = (glSamplerParameteri_client_proc_t) getProc("glSamplerParameteri", userData);
+	glSamplerParameterfv = (glSamplerParameterfv_client_proc_t) getProc("glSamplerParameterfv", userData);
+	glSamplerParameteriv = (glSamplerParameteriv_client_proc_t) getProc("glSamplerParameteriv", userData);
+	glGetSamplerParameterfv = (glGetSamplerParameterfv_client_proc_t) getProc("glGetSamplerParameterfv", userData);
+	glGetSamplerParameteriv = (glGetSamplerParameteriv_client_proc_t) getProc("glGetSamplerParameteriv", userData);
+	glIsSampler = (glIsSampler_client_proc_t) getProc("glIsSampler", userData);
+	glGenQueries = (glGenQueries_client_proc_t) getProc("glGenQueries", userData);
+	glDeleteQueries = (glDeleteQueries_client_proc_t) getProc("glDeleteQueries", userData);
+	glBeginQuery = (glBeginQuery_client_proc_t) getProc("glBeginQuery", userData);
+	glEndQuery = (glEndQuery_client_proc_t) getProc("glEndQuery", userData);
+	glGetQueryiv = (glGetQueryiv_client_proc_t) getProc("glGetQueryiv", userData);
+	glGetQueryObjectuiv = (glGetQueryObjectuiv_client_proc_t) getProc("glGetQueryObjectuiv", userData);
+	glIsQuery = (glIsQuery_client_proc_t) getProc("glIsQuery", userData);
+	glProgramParameteri = (glProgramParameteri_client_proc_t) getProc("glProgramParameteri", userData);
+	glProgramBinary = (glProgramBinary_client_proc_t) getProc("glProgramBinary", userData);
+	glGetProgramBinary = (glGetProgramBinary_client_proc_t) getProc("glGetProgramBinary", userData);
+	glGetFragDataLocation = (glGetFragDataLocation_client_proc_t) getProc("glGetFragDataLocation", userData);
+	glGetInteger64v = (glGetInteger64v_client_proc_t) getProc("glGetInteger64v", userData);
+	glGetIntegeri_v = (glGetIntegeri_v_client_proc_t) getProc("glGetIntegeri_v", userData);
+	glGetInteger64i_v = (glGetInteger64i_v_client_proc_t) getProc("glGetInteger64i_v", userData);
+	glTexImage3D = (glTexImage3D_client_proc_t) getProc("glTexImage3D", userData);
+	glTexImage3DOffsetAEMU = (glTexImage3DOffsetAEMU_client_proc_t) getProc("glTexImage3DOffsetAEMU", userData);
+	glTexStorage3D = (glTexStorage3D_client_proc_t) getProc("glTexStorage3D", userData);
+	glTexSubImage3D = (glTexSubImage3D_client_proc_t) getProc("glTexSubImage3D", userData);
+	glTexSubImage3DOffsetAEMU = (glTexSubImage3DOffsetAEMU_client_proc_t) getProc("glTexSubImage3DOffsetAEMU", userData);
+	glCompressedTexImage3D = (glCompressedTexImage3D_client_proc_t) getProc("glCompressedTexImage3D", userData);
+	glCompressedTexImage3DOffsetAEMU = (glCompressedTexImage3DOffsetAEMU_client_proc_t) getProc("glCompressedTexImage3DOffsetAEMU", userData);
+	glCompressedTexSubImage3D = (glCompressedTexSubImage3D_client_proc_t) getProc("glCompressedTexSubImage3D", userData);
+	glCompressedTexSubImage3DOffsetAEMU = (glCompressedTexSubImage3DOffsetAEMU_client_proc_t) getProc("glCompressedTexSubImage3DOffsetAEMU", userData);
+	glCopyTexSubImage3D = (glCopyTexSubImage3D_client_proc_t) getProc("glCopyTexSubImage3D", userData);
+	glGetStringi = (glGetStringi_client_proc_t) getProc("glGetStringi", userData);
+	glGetBooleani_v = (glGetBooleani_v_client_proc_t) getProc("glGetBooleani_v", userData);
+	glMemoryBarrier = (glMemoryBarrier_client_proc_t) getProc("glMemoryBarrier", userData);
+	glMemoryBarrierByRegion = (glMemoryBarrierByRegion_client_proc_t) getProc("glMemoryBarrierByRegion", userData);
+	glGenProgramPipelines = (glGenProgramPipelines_client_proc_t) getProc("glGenProgramPipelines", userData);
+	glDeleteProgramPipelines = (glDeleteProgramPipelines_client_proc_t) getProc("glDeleteProgramPipelines", userData);
+	glBindProgramPipeline = (glBindProgramPipeline_client_proc_t) getProc("glBindProgramPipeline", userData);
+	glGetProgramPipelineiv = (glGetProgramPipelineiv_client_proc_t) getProc("glGetProgramPipelineiv", userData);
+	glGetProgramPipelineInfoLog = (glGetProgramPipelineInfoLog_client_proc_t) getProc("glGetProgramPipelineInfoLog", userData);
+	glValidateProgramPipeline = (glValidateProgramPipeline_client_proc_t) getProc("glValidateProgramPipeline", userData);
+	glIsProgramPipeline = (glIsProgramPipeline_client_proc_t) getProc("glIsProgramPipeline", userData);
+	glUseProgramStages = (glUseProgramStages_client_proc_t) getProc("glUseProgramStages", userData);
+	glActiveShaderProgram = (glActiveShaderProgram_client_proc_t) getProc("glActiveShaderProgram", userData);
+	glCreateShaderProgramv = (glCreateShaderProgramv_client_proc_t) getProc("glCreateShaderProgramv", userData);
+	glCreateShaderProgramvAEMU = (glCreateShaderProgramvAEMU_client_proc_t) getProc("glCreateShaderProgramvAEMU", userData);
+	glProgramUniform1f = (glProgramUniform1f_client_proc_t) getProc("glProgramUniform1f", userData);
+	glProgramUniform2f = (glProgramUniform2f_client_proc_t) getProc("glProgramUniform2f", userData);
+	glProgramUniform3f = (glProgramUniform3f_client_proc_t) getProc("glProgramUniform3f", userData);
+	glProgramUniform4f = (glProgramUniform4f_client_proc_t) getProc("glProgramUniform4f", userData);
+	glProgramUniform1i = (glProgramUniform1i_client_proc_t) getProc("glProgramUniform1i", userData);
+	glProgramUniform2i = (glProgramUniform2i_client_proc_t) getProc("glProgramUniform2i", userData);
+	glProgramUniform3i = (glProgramUniform3i_client_proc_t) getProc("glProgramUniform3i", userData);
+	glProgramUniform4i = (glProgramUniform4i_client_proc_t) getProc("glProgramUniform4i", userData);
+	glProgramUniform1ui = (glProgramUniform1ui_client_proc_t) getProc("glProgramUniform1ui", userData);
+	glProgramUniform2ui = (glProgramUniform2ui_client_proc_t) getProc("glProgramUniform2ui", userData);
+	glProgramUniform3ui = (glProgramUniform3ui_client_proc_t) getProc("glProgramUniform3ui", userData);
+	glProgramUniform4ui = (glProgramUniform4ui_client_proc_t) getProc("glProgramUniform4ui", userData);
+	glProgramUniform1fv = (glProgramUniform1fv_client_proc_t) getProc("glProgramUniform1fv", userData);
+	glProgramUniform2fv = (glProgramUniform2fv_client_proc_t) getProc("glProgramUniform2fv", userData);
+	glProgramUniform3fv = (glProgramUniform3fv_client_proc_t) getProc("glProgramUniform3fv", userData);
+	glProgramUniform4fv = (glProgramUniform4fv_client_proc_t) getProc("glProgramUniform4fv", userData);
+	glProgramUniform1iv = (glProgramUniform1iv_client_proc_t) getProc("glProgramUniform1iv", userData);
+	glProgramUniform2iv = (glProgramUniform2iv_client_proc_t) getProc("glProgramUniform2iv", userData);
+	glProgramUniform3iv = (glProgramUniform3iv_client_proc_t) getProc("glProgramUniform3iv", userData);
+	glProgramUniform4iv = (glProgramUniform4iv_client_proc_t) getProc("glProgramUniform4iv", userData);
+	glProgramUniform1uiv = (glProgramUniform1uiv_client_proc_t) getProc("glProgramUniform1uiv", userData);
+	glProgramUniform2uiv = (glProgramUniform2uiv_client_proc_t) getProc("glProgramUniform2uiv", userData);
+	glProgramUniform3uiv = (glProgramUniform3uiv_client_proc_t) getProc("glProgramUniform3uiv", userData);
+	glProgramUniform4uiv = (glProgramUniform4uiv_client_proc_t) getProc("glProgramUniform4uiv", userData);
+	glProgramUniformMatrix2fv = (glProgramUniformMatrix2fv_client_proc_t) getProc("glProgramUniformMatrix2fv", userData);
+	glProgramUniformMatrix3fv = (glProgramUniformMatrix3fv_client_proc_t) getProc("glProgramUniformMatrix3fv", userData);
+	glProgramUniformMatrix4fv = (glProgramUniformMatrix4fv_client_proc_t) getProc("glProgramUniformMatrix4fv", userData);
+	glProgramUniformMatrix2x3fv = (glProgramUniformMatrix2x3fv_client_proc_t) getProc("glProgramUniformMatrix2x3fv", userData);
+	glProgramUniformMatrix3x2fv = (glProgramUniformMatrix3x2fv_client_proc_t) getProc("glProgramUniformMatrix3x2fv", userData);
+	glProgramUniformMatrix2x4fv = (glProgramUniformMatrix2x4fv_client_proc_t) getProc("glProgramUniformMatrix2x4fv", userData);
+	glProgramUniformMatrix4x2fv = (glProgramUniformMatrix4x2fv_client_proc_t) getProc("glProgramUniformMatrix4x2fv", userData);
+	glProgramUniformMatrix3x4fv = (glProgramUniformMatrix3x4fv_client_proc_t) getProc("glProgramUniformMatrix3x4fv", userData);
+	glProgramUniformMatrix4x3fv = (glProgramUniformMatrix4x3fv_client_proc_t) getProc("glProgramUniformMatrix4x3fv", userData);
+	glGetProgramInterfaceiv = (glGetProgramInterfaceiv_client_proc_t) getProc("glGetProgramInterfaceiv", userData);
+	glGetProgramResourceiv = (glGetProgramResourceiv_client_proc_t) getProc("glGetProgramResourceiv", userData);
+	glGetProgramResourceIndex = (glGetProgramResourceIndex_client_proc_t) getProc("glGetProgramResourceIndex", userData);
+	glGetProgramResourceLocation = (glGetProgramResourceLocation_client_proc_t) getProc("glGetProgramResourceLocation", userData);
+	glGetProgramResourceName = (glGetProgramResourceName_client_proc_t) getProc("glGetProgramResourceName", userData);
+	glBindImageTexture = (glBindImageTexture_client_proc_t) getProc("glBindImageTexture", userData);
+	glDispatchCompute = (glDispatchCompute_client_proc_t) getProc("glDispatchCompute", userData);
+	glDispatchComputeIndirect = (glDispatchComputeIndirect_client_proc_t) getProc("glDispatchComputeIndirect", userData);
+	glBindVertexBuffer = (glBindVertexBuffer_client_proc_t) getProc("glBindVertexBuffer", userData);
+	glVertexAttribBinding = (glVertexAttribBinding_client_proc_t) getProc("glVertexAttribBinding", userData);
+	glVertexAttribFormat = (glVertexAttribFormat_client_proc_t) getProc("glVertexAttribFormat", userData);
+	glVertexAttribIFormat = (glVertexAttribIFormat_client_proc_t) getProc("glVertexAttribIFormat", userData);
+	glVertexBindingDivisor = (glVertexBindingDivisor_client_proc_t) getProc("glVertexBindingDivisor", userData);
+	glDrawArraysIndirect = (glDrawArraysIndirect_client_proc_t) getProc("glDrawArraysIndirect", userData);
+	glDrawArraysIndirectDataAEMU = (glDrawArraysIndirectDataAEMU_client_proc_t) getProc("glDrawArraysIndirectDataAEMU", userData);
+	glDrawArraysIndirectOffsetAEMU = (glDrawArraysIndirectOffsetAEMU_client_proc_t) getProc("glDrawArraysIndirectOffsetAEMU", userData);
+	glDrawElementsIndirect = (glDrawElementsIndirect_client_proc_t) getProc("glDrawElementsIndirect", userData);
+	glDrawElementsIndirectDataAEMU = (glDrawElementsIndirectDataAEMU_client_proc_t) getProc("glDrawElementsIndirectDataAEMU", userData);
+	glDrawElementsIndirectOffsetAEMU = (glDrawElementsIndirectOffsetAEMU_client_proc_t) getProc("glDrawElementsIndirectOffsetAEMU", userData);
+	glTexStorage2DMultisample = (glTexStorage2DMultisample_client_proc_t) getProc("glTexStorage2DMultisample", userData);
+	glSampleMaski = (glSampleMaski_client_proc_t) getProc("glSampleMaski", userData);
+	glGetMultisamplefv = (glGetMultisamplefv_client_proc_t) getProc("glGetMultisamplefv", userData);
+	glFramebufferParameteri = (glFramebufferParameteri_client_proc_t) getProc("glFramebufferParameteri", userData);
+	glGetFramebufferParameteriv = (glGetFramebufferParameteriv_client_proc_t) getProc("glGetFramebufferParameteriv", userData);
+	glGetTexLevelParameterfv = (glGetTexLevelParameterfv_client_proc_t) getProc("glGetTexLevelParameterfv", userData);
+	glGetTexLevelParameteriv = (glGetTexLevelParameteriv_client_proc_t) getProc("glGetTexLevelParameteriv", userData);
+	glMapBufferRangeDMA = (glMapBufferRangeDMA_client_proc_t) getProc("glMapBufferRangeDMA", userData);
+	glUnmapBufferDMA = (glUnmapBufferDMA_client_proc_t) getProc("glUnmapBufferDMA", userData);
+	glMapBufferRangeDirect = (glMapBufferRangeDirect_client_proc_t) getProc("glMapBufferRangeDirect", userData);
+	glUnmapBufferDirect = (glUnmapBufferDirect_client_proc_t) getProc("glUnmapBufferDirect", userData);
+	glFlushMappedBufferRangeDirect = (glFlushMappedBufferRangeDirect_client_proc_t) getProc("glFlushMappedBufferRangeDirect", userData);
+	glGetGraphicsResetStatusEXT = (glGetGraphicsResetStatusEXT_client_proc_t) getProc("glGetGraphicsResetStatusEXT", userData);
+	glReadnPixelsEXT = (glReadnPixelsEXT_client_proc_t) getProc("glReadnPixelsEXT", userData);
+	glGetnUniformfvEXT = (glGetnUniformfvEXT_client_proc_t) getProc("glGetnUniformfvEXT", userData);
+	glGetnUniformivEXT = (glGetnUniformivEXT_client_proc_t) getProc("glGetnUniformivEXT", userData);
+	glDrawArraysNullAEMU = (glDrawArraysNullAEMU_client_proc_t) getProc("glDrawArraysNullAEMU", userData);
+	glDrawElementsNullAEMU = (glDrawElementsNullAEMU_client_proc_t) getProc("glDrawElementsNullAEMU", userData);
+	glDrawElementsOffsetNullAEMU = (glDrawElementsOffsetNullAEMU_client_proc_t) getProc("glDrawElementsOffsetNullAEMU", userData);
+	glDrawElementsDataNullAEMU = (glDrawElementsDataNullAEMU_client_proc_t) getProc("glDrawElementsDataNullAEMU", userData);
+	glUnmapBufferAsyncAEMU = (glUnmapBufferAsyncAEMU_client_proc_t) getProc("glUnmapBufferAsyncAEMU", userData);
+	glFlushMappedBufferRangeAEMU2 = (glFlushMappedBufferRangeAEMU2_client_proc_t) getProc("glFlushMappedBufferRangeAEMU2", userData);
+	glBufferDataSyncAEMU = (glBufferDataSyncAEMU_client_proc_t) getProc("glBufferDataSyncAEMU", userData);
+	glTexBufferOES = (glTexBufferOES_client_proc_t) getProc("glTexBufferOES", userData);
+	glTexBufferRangeOES = (glTexBufferRangeOES_client_proc_t) getProc("glTexBufferRangeOES", userData);
+	glTexBufferEXT = (glTexBufferEXT_client_proc_t) getProc("glTexBufferEXT", userData);
+	glTexBufferRangeEXT = (glTexBufferRangeEXT_client_proc_t) getProc("glTexBufferRangeEXT", userData);
+	glEnableiEXT = (glEnableiEXT_client_proc_t) getProc("glEnableiEXT", userData);
+	glDisableiEXT = (glDisableiEXT_client_proc_t) getProc("glDisableiEXT", userData);
+	glBlendEquationiEXT = (glBlendEquationiEXT_client_proc_t) getProc("glBlendEquationiEXT", userData);
+	glBlendEquationSeparateiEXT = (glBlendEquationSeparateiEXT_client_proc_t) getProc("glBlendEquationSeparateiEXT", userData);
+	glBlendFunciEXT = (glBlendFunciEXT_client_proc_t) getProc("glBlendFunciEXT", userData);
+	glBlendFuncSeparateiEXT = (glBlendFuncSeparateiEXT_client_proc_t) getProc("glBlendFuncSeparateiEXT", userData);
+	glColorMaskiEXT = (glColorMaskiEXT_client_proc_t) getProc("glColorMaskiEXT", userData);
+	glIsEnablediEXT = (glIsEnablediEXT_client_proc_t) getProc("glIsEnablediEXT", userData);
+	return 0;
+}
+
diff --git a/system/GLESv2_enc/gl2_client_context.h b/system/GLESv2_enc/gl2_client_context.h
new file mode 100644
index 0000000..97aab33
--- /dev/null
+++ b/system/GLESv2_enc/gl2_client_context.h
@@ -0,0 +1,461 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+#ifndef __gl2_client_context_t_h
+#define __gl2_client_context_t_h
+
+#include "gl2_client_proc.h"
+
+#include "gl2_types.h"
+
+
+struct gl2_client_context_t {
+
+	glActiveTexture_client_proc_t glActiveTexture;
+	glAttachShader_client_proc_t glAttachShader;
+	glBindAttribLocation_client_proc_t glBindAttribLocation;
+	glBindBuffer_client_proc_t glBindBuffer;
+	glBindFramebuffer_client_proc_t glBindFramebuffer;
+	glBindRenderbuffer_client_proc_t glBindRenderbuffer;
+	glBindTexture_client_proc_t glBindTexture;
+	glBlendColor_client_proc_t glBlendColor;
+	glBlendEquation_client_proc_t glBlendEquation;
+	glBlendEquationSeparate_client_proc_t glBlendEquationSeparate;
+	glBlendFunc_client_proc_t glBlendFunc;
+	glBlendFuncSeparate_client_proc_t glBlendFuncSeparate;
+	glBufferData_client_proc_t glBufferData;
+	glBufferSubData_client_proc_t glBufferSubData;
+	glCheckFramebufferStatus_client_proc_t glCheckFramebufferStatus;
+	glClear_client_proc_t glClear;
+	glClearColor_client_proc_t glClearColor;
+	glClearDepthf_client_proc_t glClearDepthf;
+	glClearStencil_client_proc_t glClearStencil;
+	glColorMask_client_proc_t glColorMask;
+	glCompileShader_client_proc_t glCompileShader;
+	glCompressedTexImage2D_client_proc_t glCompressedTexImage2D;
+	glCompressedTexSubImage2D_client_proc_t glCompressedTexSubImage2D;
+	glCopyTexImage2D_client_proc_t glCopyTexImage2D;
+	glCopyTexSubImage2D_client_proc_t glCopyTexSubImage2D;
+	glCreateProgram_client_proc_t glCreateProgram;
+	glCreateShader_client_proc_t glCreateShader;
+	glCullFace_client_proc_t glCullFace;
+	glDeleteBuffers_client_proc_t glDeleteBuffers;
+	glDeleteFramebuffers_client_proc_t glDeleteFramebuffers;
+	glDeleteProgram_client_proc_t glDeleteProgram;
+	glDeleteRenderbuffers_client_proc_t glDeleteRenderbuffers;
+	glDeleteShader_client_proc_t glDeleteShader;
+	glDeleteTextures_client_proc_t glDeleteTextures;
+	glDepthFunc_client_proc_t glDepthFunc;
+	glDepthMask_client_proc_t glDepthMask;
+	glDepthRangef_client_proc_t glDepthRangef;
+	glDetachShader_client_proc_t glDetachShader;
+	glDisable_client_proc_t glDisable;
+	glDisableVertexAttribArray_client_proc_t glDisableVertexAttribArray;
+	glDrawArrays_client_proc_t glDrawArrays;
+	glDrawElements_client_proc_t glDrawElements;
+	glEnable_client_proc_t glEnable;
+	glEnableVertexAttribArray_client_proc_t glEnableVertexAttribArray;
+	glFinish_client_proc_t glFinish;
+	glFlush_client_proc_t glFlush;
+	glFramebufferRenderbuffer_client_proc_t glFramebufferRenderbuffer;
+	glFramebufferTexture2D_client_proc_t glFramebufferTexture2D;
+	glFrontFace_client_proc_t glFrontFace;
+	glGenBuffers_client_proc_t glGenBuffers;
+	glGenerateMipmap_client_proc_t glGenerateMipmap;
+	glGenFramebuffers_client_proc_t glGenFramebuffers;
+	glGenRenderbuffers_client_proc_t glGenRenderbuffers;
+	glGenTextures_client_proc_t glGenTextures;
+	glGetActiveAttrib_client_proc_t glGetActiveAttrib;
+	glGetActiveUniform_client_proc_t glGetActiveUniform;
+	glGetAttachedShaders_client_proc_t glGetAttachedShaders;
+	glGetAttribLocation_client_proc_t glGetAttribLocation;
+	glGetBooleanv_client_proc_t glGetBooleanv;
+	glGetBufferParameteriv_client_proc_t glGetBufferParameteriv;
+	glGetError_client_proc_t glGetError;
+	glGetFloatv_client_proc_t glGetFloatv;
+	glGetFramebufferAttachmentParameteriv_client_proc_t glGetFramebufferAttachmentParameteriv;
+	glGetIntegerv_client_proc_t glGetIntegerv;
+	glGetProgramiv_client_proc_t glGetProgramiv;
+	glGetProgramInfoLog_client_proc_t glGetProgramInfoLog;
+	glGetRenderbufferParameteriv_client_proc_t glGetRenderbufferParameteriv;
+	glGetShaderiv_client_proc_t glGetShaderiv;
+	glGetShaderInfoLog_client_proc_t glGetShaderInfoLog;
+	glGetShaderPrecisionFormat_client_proc_t glGetShaderPrecisionFormat;
+	glGetShaderSource_client_proc_t glGetShaderSource;
+	glGetString_client_proc_t glGetString;
+	glGetTexParameterfv_client_proc_t glGetTexParameterfv;
+	glGetTexParameteriv_client_proc_t glGetTexParameteriv;
+	glGetUniformfv_client_proc_t glGetUniformfv;
+	glGetUniformiv_client_proc_t glGetUniformiv;
+	glGetUniformLocation_client_proc_t glGetUniformLocation;
+	glGetVertexAttribfv_client_proc_t glGetVertexAttribfv;
+	glGetVertexAttribiv_client_proc_t glGetVertexAttribiv;
+	glGetVertexAttribPointerv_client_proc_t glGetVertexAttribPointerv;
+	glHint_client_proc_t glHint;
+	glIsBuffer_client_proc_t glIsBuffer;
+	glIsEnabled_client_proc_t glIsEnabled;
+	glIsFramebuffer_client_proc_t glIsFramebuffer;
+	glIsProgram_client_proc_t glIsProgram;
+	glIsRenderbuffer_client_proc_t glIsRenderbuffer;
+	glIsShader_client_proc_t glIsShader;
+	glIsTexture_client_proc_t glIsTexture;
+	glLineWidth_client_proc_t glLineWidth;
+	glLinkProgram_client_proc_t glLinkProgram;
+	glPixelStorei_client_proc_t glPixelStorei;
+	glPolygonOffset_client_proc_t glPolygonOffset;
+	glReadPixels_client_proc_t glReadPixels;
+	glReleaseShaderCompiler_client_proc_t glReleaseShaderCompiler;
+	glRenderbufferStorage_client_proc_t glRenderbufferStorage;
+	glSampleCoverage_client_proc_t glSampleCoverage;
+	glScissor_client_proc_t glScissor;
+	glShaderBinary_client_proc_t glShaderBinary;
+	glShaderSource_client_proc_t glShaderSource;
+	glStencilFunc_client_proc_t glStencilFunc;
+	glStencilFuncSeparate_client_proc_t glStencilFuncSeparate;
+	glStencilMask_client_proc_t glStencilMask;
+	glStencilMaskSeparate_client_proc_t glStencilMaskSeparate;
+	glStencilOp_client_proc_t glStencilOp;
+	glStencilOpSeparate_client_proc_t glStencilOpSeparate;
+	glTexImage2D_client_proc_t glTexImage2D;
+	glTexParameterf_client_proc_t glTexParameterf;
+	glTexParameterfv_client_proc_t glTexParameterfv;
+	glTexParameteri_client_proc_t glTexParameteri;
+	glTexParameteriv_client_proc_t glTexParameteriv;
+	glTexSubImage2D_client_proc_t glTexSubImage2D;
+	glUniform1f_client_proc_t glUniform1f;
+	glUniform1fv_client_proc_t glUniform1fv;
+	glUniform1i_client_proc_t glUniform1i;
+	glUniform1iv_client_proc_t glUniform1iv;
+	glUniform2f_client_proc_t glUniform2f;
+	glUniform2fv_client_proc_t glUniform2fv;
+	glUniform2i_client_proc_t glUniform2i;
+	glUniform2iv_client_proc_t glUniform2iv;
+	glUniform3f_client_proc_t glUniform3f;
+	glUniform3fv_client_proc_t glUniform3fv;
+	glUniform3i_client_proc_t glUniform3i;
+	glUniform3iv_client_proc_t glUniform3iv;
+	glUniform4f_client_proc_t glUniform4f;
+	glUniform4fv_client_proc_t glUniform4fv;
+	glUniform4i_client_proc_t glUniform4i;
+	glUniform4iv_client_proc_t glUniform4iv;
+	glUniformMatrix2fv_client_proc_t glUniformMatrix2fv;
+	glUniformMatrix3fv_client_proc_t glUniformMatrix3fv;
+	glUniformMatrix4fv_client_proc_t glUniformMatrix4fv;
+	glUseProgram_client_proc_t glUseProgram;
+	glValidateProgram_client_proc_t glValidateProgram;
+	glVertexAttrib1f_client_proc_t glVertexAttrib1f;
+	glVertexAttrib1fv_client_proc_t glVertexAttrib1fv;
+	glVertexAttrib2f_client_proc_t glVertexAttrib2f;
+	glVertexAttrib2fv_client_proc_t glVertexAttrib2fv;
+	glVertexAttrib3f_client_proc_t glVertexAttrib3f;
+	glVertexAttrib3fv_client_proc_t glVertexAttrib3fv;
+	glVertexAttrib4f_client_proc_t glVertexAttrib4f;
+	glVertexAttrib4fv_client_proc_t glVertexAttrib4fv;
+	glVertexAttribPointer_client_proc_t glVertexAttribPointer;
+	glViewport_client_proc_t glViewport;
+	glEGLImageTargetTexture2DOES_client_proc_t glEGLImageTargetTexture2DOES;
+	glEGLImageTargetRenderbufferStorageOES_client_proc_t glEGLImageTargetRenderbufferStorageOES;
+	glGetProgramBinaryOES_client_proc_t glGetProgramBinaryOES;
+	glProgramBinaryOES_client_proc_t glProgramBinaryOES;
+	glMapBufferOES_client_proc_t glMapBufferOES;
+	glUnmapBufferOES_client_proc_t glUnmapBufferOES;
+	glTexImage3DOES_client_proc_t glTexImage3DOES;
+	glTexSubImage3DOES_client_proc_t glTexSubImage3DOES;
+	glCopyTexSubImage3DOES_client_proc_t glCopyTexSubImage3DOES;
+	glCompressedTexImage3DOES_client_proc_t glCompressedTexImage3DOES;
+	glCompressedTexSubImage3DOES_client_proc_t glCompressedTexSubImage3DOES;
+	glFramebufferTexture3DOES_client_proc_t glFramebufferTexture3DOES;
+	glBindVertexArrayOES_client_proc_t glBindVertexArrayOES;
+	glDeleteVertexArraysOES_client_proc_t glDeleteVertexArraysOES;
+	glGenVertexArraysOES_client_proc_t glGenVertexArraysOES;
+	glIsVertexArrayOES_client_proc_t glIsVertexArrayOES;
+	glDiscardFramebufferEXT_client_proc_t glDiscardFramebufferEXT;
+	glMultiDrawArraysEXT_client_proc_t glMultiDrawArraysEXT;
+	glMultiDrawElementsEXT_client_proc_t glMultiDrawElementsEXT;
+	glGetPerfMonitorGroupsAMD_client_proc_t glGetPerfMonitorGroupsAMD;
+	glGetPerfMonitorCountersAMD_client_proc_t glGetPerfMonitorCountersAMD;
+	glGetPerfMonitorGroupStringAMD_client_proc_t glGetPerfMonitorGroupStringAMD;
+	glGetPerfMonitorCounterStringAMD_client_proc_t glGetPerfMonitorCounterStringAMD;
+	glGetPerfMonitorCounterInfoAMD_client_proc_t glGetPerfMonitorCounterInfoAMD;
+	glGenPerfMonitorsAMD_client_proc_t glGenPerfMonitorsAMD;
+	glDeletePerfMonitorsAMD_client_proc_t glDeletePerfMonitorsAMD;
+	glSelectPerfMonitorCountersAMD_client_proc_t glSelectPerfMonitorCountersAMD;
+	glBeginPerfMonitorAMD_client_proc_t glBeginPerfMonitorAMD;
+	glEndPerfMonitorAMD_client_proc_t glEndPerfMonitorAMD;
+	glGetPerfMonitorCounterDataAMD_client_proc_t glGetPerfMonitorCounterDataAMD;
+	glRenderbufferStorageMultisampleIMG_client_proc_t glRenderbufferStorageMultisampleIMG;
+	glFramebufferTexture2DMultisampleIMG_client_proc_t glFramebufferTexture2DMultisampleIMG;
+	glDeleteFencesNV_client_proc_t glDeleteFencesNV;
+	glGenFencesNV_client_proc_t glGenFencesNV;
+	glIsFenceNV_client_proc_t glIsFenceNV;
+	glTestFenceNV_client_proc_t glTestFenceNV;
+	glGetFenceivNV_client_proc_t glGetFenceivNV;
+	glFinishFenceNV_client_proc_t glFinishFenceNV;
+	glSetFenceNV_client_proc_t glSetFenceNV;
+	glCoverageMaskNV_client_proc_t glCoverageMaskNV;
+	glCoverageOperationNV_client_proc_t glCoverageOperationNV;
+	glGetDriverControlsQCOM_client_proc_t glGetDriverControlsQCOM;
+	glGetDriverControlStringQCOM_client_proc_t glGetDriverControlStringQCOM;
+	glEnableDriverControlQCOM_client_proc_t glEnableDriverControlQCOM;
+	glDisableDriverControlQCOM_client_proc_t glDisableDriverControlQCOM;
+	glExtGetTexturesQCOM_client_proc_t glExtGetTexturesQCOM;
+	glExtGetBuffersQCOM_client_proc_t glExtGetBuffersQCOM;
+	glExtGetRenderbuffersQCOM_client_proc_t glExtGetRenderbuffersQCOM;
+	glExtGetFramebuffersQCOM_client_proc_t glExtGetFramebuffersQCOM;
+	glExtGetTexLevelParameterivQCOM_client_proc_t glExtGetTexLevelParameterivQCOM;
+	glExtTexObjectStateOverrideiQCOM_client_proc_t glExtTexObjectStateOverrideiQCOM;
+	glExtGetTexSubImageQCOM_client_proc_t glExtGetTexSubImageQCOM;
+	glExtGetBufferPointervQCOM_client_proc_t glExtGetBufferPointervQCOM;
+	glExtGetShadersQCOM_client_proc_t glExtGetShadersQCOM;
+	glExtGetProgramsQCOM_client_proc_t glExtGetProgramsQCOM;
+	glExtIsProgramBinaryQCOM_client_proc_t glExtIsProgramBinaryQCOM;
+	glExtGetProgramBinarySourceQCOM_client_proc_t glExtGetProgramBinarySourceQCOM;
+	glStartTilingQCOM_client_proc_t glStartTilingQCOM;
+	glEndTilingQCOM_client_proc_t glEndTilingQCOM;
+	glVertexAttribPointerData_client_proc_t glVertexAttribPointerData;
+	glVertexAttribPointerOffset_client_proc_t glVertexAttribPointerOffset;
+	glDrawElementsOffset_client_proc_t glDrawElementsOffset;
+	glDrawElementsData_client_proc_t glDrawElementsData;
+	glGetCompressedTextureFormats_client_proc_t glGetCompressedTextureFormats;
+	glShaderString_client_proc_t glShaderString;
+	glFinishRoundTrip_client_proc_t glFinishRoundTrip;
+	glGenVertexArrays_client_proc_t glGenVertexArrays;
+	glBindVertexArray_client_proc_t glBindVertexArray;
+	glDeleteVertexArrays_client_proc_t glDeleteVertexArrays;
+	glIsVertexArray_client_proc_t glIsVertexArray;
+	glMapBufferRange_client_proc_t glMapBufferRange;
+	glUnmapBuffer_client_proc_t glUnmapBuffer;
+	glFlushMappedBufferRange_client_proc_t glFlushMappedBufferRange;
+	glMapBufferRangeAEMU_client_proc_t glMapBufferRangeAEMU;
+	glUnmapBufferAEMU_client_proc_t glUnmapBufferAEMU;
+	glFlushMappedBufferRangeAEMU_client_proc_t glFlushMappedBufferRangeAEMU;
+	glReadPixelsOffsetAEMU_client_proc_t glReadPixelsOffsetAEMU;
+	glCompressedTexImage2DOffsetAEMU_client_proc_t glCompressedTexImage2DOffsetAEMU;
+	glCompressedTexSubImage2DOffsetAEMU_client_proc_t glCompressedTexSubImage2DOffsetAEMU;
+	glTexImage2DOffsetAEMU_client_proc_t glTexImage2DOffsetAEMU;
+	glTexSubImage2DOffsetAEMU_client_proc_t glTexSubImage2DOffsetAEMU;
+	glBindBufferRange_client_proc_t glBindBufferRange;
+	glBindBufferBase_client_proc_t glBindBufferBase;
+	glCopyBufferSubData_client_proc_t glCopyBufferSubData;
+	glClearBufferiv_client_proc_t glClearBufferiv;
+	glClearBufferuiv_client_proc_t glClearBufferuiv;
+	glClearBufferfv_client_proc_t glClearBufferfv;
+	glClearBufferfi_client_proc_t glClearBufferfi;
+	glGetBufferParameteri64v_client_proc_t glGetBufferParameteri64v;
+	glGetBufferPointerv_client_proc_t glGetBufferPointerv;
+	glUniformBlockBinding_client_proc_t glUniformBlockBinding;
+	glGetUniformBlockIndex_client_proc_t glGetUniformBlockIndex;
+	glGetUniformIndices_client_proc_t glGetUniformIndices;
+	glGetUniformIndicesAEMU_client_proc_t glGetUniformIndicesAEMU;
+	glGetActiveUniformBlockiv_client_proc_t glGetActiveUniformBlockiv;
+	glGetActiveUniformBlockName_client_proc_t glGetActiveUniformBlockName;
+	glUniform1ui_client_proc_t glUniform1ui;
+	glUniform2ui_client_proc_t glUniform2ui;
+	glUniform3ui_client_proc_t glUniform3ui;
+	glUniform4ui_client_proc_t glUniform4ui;
+	glUniform1uiv_client_proc_t glUniform1uiv;
+	glUniform2uiv_client_proc_t glUniform2uiv;
+	glUniform3uiv_client_proc_t glUniform3uiv;
+	glUniform4uiv_client_proc_t glUniform4uiv;
+	glUniformMatrix2x3fv_client_proc_t glUniformMatrix2x3fv;
+	glUniformMatrix3x2fv_client_proc_t glUniformMatrix3x2fv;
+	glUniformMatrix2x4fv_client_proc_t glUniformMatrix2x4fv;
+	glUniformMatrix4x2fv_client_proc_t glUniformMatrix4x2fv;
+	glUniformMatrix3x4fv_client_proc_t glUniformMatrix3x4fv;
+	glUniformMatrix4x3fv_client_proc_t glUniformMatrix4x3fv;
+	glGetUniformuiv_client_proc_t glGetUniformuiv;
+	glGetActiveUniformsiv_client_proc_t glGetActiveUniformsiv;
+	glVertexAttribI4i_client_proc_t glVertexAttribI4i;
+	glVertexAttribI4ui_client_proc_t glVertexAttribI4ui;
+	glVertexAttribI4iv_client_proc_t glVertexAttribI4iv;
+	glVertexAttribI4uiv_client_proc_t glVertexAttribI4uiv;
+	glVertexAttribIPointer_client_proc_t glVertexAttribIPointer;
+	glVertexAttribIPointerOffsetAEMU_client_proc_t glVertexAttribIPointerOffsetAEMU;
+	glVertexAttribIPointerDataAEMU_client_proc_t glVertexAttribIPointerDataAEMU;
+	glGetVertexAttribIiv_client_proc_t glGetVertexAttribIiv;
+	glGetVertexAttribIuiv_client_proc_t glGetVertexAttribIuiv;
+	glVertexAttribDivisor_client_proc_t glVertexAttribDivisor;
+	glDrawArraysInstanced_client_proc_t glDrawArraysInstanced;
+	glDrawElementsInstanced_client_proc_t glDrawElementsInstanced;
+	glDrawElementsInstancedDataAEMU_client_proc_t glDrawElementsInstancedDataAEMU;
+	glDrawElementsInstancedOffsetAEMU_client_proc_t glDrawElementsInstancedOffsetAEMU;
+	glDrawRangeElements_client_proc_t glDrawRangeElements;
+	glDrawRangeElementsDataAEMU_client_proc_t glDrawRangeElementsDataAEMU;
+	glDrawRangeElementsOffsetAEMU_client_proc_t glDrawRangeElementsOffsetAEMU;
+	glFenceSync_client_proc_t glFenceSync;
+	glClientWaitSync_client_proc_t glClientWaitSync;
+	glWaitSync_client_proc_t glWaitSync;
+	glDeleteSync_client_proc_t glDeleteSync;
+	glIsSync_client_proc_t glIsSync;
+	glGetSynciv_client_proc_t glGetSynciv;
+	glFenceSyncAEMU_client_proc_t glFenceSyncAEMU;
+	glClientWaitSyncAEMU_client_proc_t glClientWaitSyncAEMU;
+	glWaitSyncAEMU_client_proc_t glWaitSyncAEMU;
+	glDeleteSyncAEMU_client_proc_t glDeleteSyncAEMU;
+	glIsSyncAEMU_client_proc_t glIsSyncAEMU;
+	glGetSyncivAEMU_client_proc_t glGetSyncivAEMU;
+	glDrawBuffers_client_proc_t glDrawBuffers;
+	glReadBuffer_client_proc_t glReadBuffer;
+	glBlitFramebuffer_client_proc_t glBlitFramebuffer;
+	glInvalidateFramebuffer_client_proc_t glInvalidateFramebuffer;
+	glInvalidateSubFramebuffer_client_proc_t glInvalidateSubFramebuffer;
+	glFramebufferTextureLayer_client_proc_t glFramebufferTextureLayer;
+	glRenderbufferStorageMultisample_client_proc_t glRenderbufferStorageMultisample;
+	glTexStorage2D_client_proc_t glTexStorage2D;
+	glGetInternalformativ_client_proc_t glGetInternalformativ;
+	glBeginTransformFeedback_client_proc_t glBeginTransformFeedback;
+	glEndTransformFeedback_client_proc_t glEndTransformFeedback;
+	glGenTransformFeedbacks_client_proc_t glGenTransformFeedbacks;
+	glDeleteTransformFeedbacks_client_proc_t glDeleteTransformFeedbacks;
+	glBindTransformFeedback_client_proc_t glBindTransformFeedback;
+	glPauseTransformFeedback_client_proc_t glPauseTransformFeedback;
+	glResumeTransformFeedback_client_proc_t glResumeTransformFeedback;
+	glIsTransformFeedback_client_proc_t glIsTransformFeedback;
+	glTransformFeedbackVaryings_client_proc_t glTransformFeedbackVaryings;
+	glTransformFeedbackVaryingsAEMU_client_proc_t glTransformFeedbackVaryingsAEMU;
+	glGetTransformFeedbackVarying_client_proc_t glGetTransformFeedbackVarying;
+	glGenSamplers_client_proc_t glGenSamplers;
+	glDeleteSamplers_client_proc_t glDeleteSamplers;
+	glBindSampler_client_proc_t glBindSampler;
+	glSamplerParameterf_client_proc_t glSamplerParameterf;
+	glSamplerParameteri_client_proc_t glSamplerParameteri;
+	glSamplerParameterfv_client_proc_t glSamplerParameterfv;
+	glSamplerParameteriv_client_proc_t glSamplerParameteriv;
+	glGetSamplerParameterfv_client_proc_t glGetSamplerParameterfv;
+	glGetSamplerParameteriv_client_proc_t glGetSamplerParameteriv;
+	glIsSampler_client_proc_t glIsSampler;
+	glGenQueries_client_proc_t glGenQueries;
+	glDeleteQueries_client_proc_t glDeleteQueries;
+	glBeginQuery_client_proc_t glBeginQuery;
+	glEndQuery_client_proc_t glEndQuery;
+	glGetQueryiv_client_proc_t glGetQueryiv;
+	glGetQueryObjectuiv_client_proc_t glGetQueryObjectuiv;
+	glIsQuery_client_proc_t glIsQuery;
+	glProgramParameteri_client_proc_t glProgramParameteri;
+	glProgramBinary_client_proc_t glProgramBinary;
+	glGetProgramBinary_client_proc_t glGetProgramBinary;
+	glGetFragDataLocation_client_proc_t glGetFragDataLocation;
+	glGetInteger64v_client_proc_t glGetInteger64v;
+	glGetIntegeri_v_client_proc_t glGetIntegeri_v;
+	glGetInteger64i_v_client_proc_t glGetInteger64i_v;
+	glTexImage3D_client_proc_t glTexImage3D;
+	glTexImage3DOffsetAEMU_client_proc_t glTexImage3DOffsetAEMU;
+	glTexStorage3D_client_proc_t glTexStorage3D;
+	glTexSubImage3D_client_proc_t glTexSubImage3D;
+	glTexSubImage3DOffsetAEMU_client_proc_t glTexSubImage3DOffsetAEMU;
+	glCompressedTexImage3D_client_proc_t glCompressedTexImage3D;
+	glCompressedTexImage3DOffsetAEMU_client_proc_t glCompressedTexImage3DOffsetAEMU;
+	glCompressedTexSubImage3D_client_proc_t glCompressedTexSubImage3D;
+	glCompressedTexSubImage3DOffsetAEMU_client_proc_t glCompressedTexSubImage3DOffsetAEMU;
+	glCopyTexSubImage3D_client_proc_t glCopyTexSubImage3D;
+	glGetStringi_client_proc_t glGetStringi;
+	glGetBooleani_v_client_proc_t glGetBooleani_v;
+	glMemoryBarrier_client_proc_t glMemoryBarrier;
+	glMemoryBarrierByRegion_client_proc_t glMemoryBarrierByRegion;
+	glGenProgramPipelines_client_proc_t glGenProgramPipelines;
+	glDeleteProgramPipelines_client_proc_t glDeleteProgramPipelines;
+	glBindProgramPipeline_client_proc_t glBindProgramPipeline;
+	glGetProgramPipelineiv_client_proc_t glGetProgramPipelineiv;
+	glGetProgramPipelineInfoLog_client_proc_t glGetProgramPipelineInfoLog;
+	glValidateProgramPipeline_client_proc_t glValidateProgramPipeline;
+	glIsProgramPipeline_client_proc_t glIsProgramPipeline;
+	glUseProgramStages_client_proc_t glUseProgramStages;
+	glActiveShaderProgram_client_proc_t glActiveShaderProgram;
+	glCreateShaderProgramv_client_proc_t glCreateShaderProgramv;
+	glCreateShaderProgramvAEMU_client_proc_t glCreateShaderProgramvAEMU;
+	glProgramUniform1f_client_proc_t glProgramUniform1f;
+	glProgramUniform2f_client_proc_t glProgramUniform2f;
+	glProgramUniform3f_client_proc_t glProgramUniform3f;
+	glProgramUniform4f_client_proc_t glProgramUniform4f;
+	glProgramUniform1i_client_proc_t glProgramUniform1i;
+	glProgramUniform2i_client_proc_t glProgramUniform2i;
+	glProgramUniform3i_client_proc_t glProgramUniform3i;
+	glProgramUniform4i_client_proc_t glProgramUniform4i;
+	glProgramUniform1ui_client_proc_t glProgramUniform1ui;
+	glProgramUniform2ui_client_proc_t glProgramUniform2ui;
+	glProgramUniform3ui_client_proc_t glProgramUniform3ui;
+	glProgramUniform4ui_client_proc_t glProgramUniform4ui;
+	glProgramUniform1fv_client_proc_t glProgramUniform1fv;
+	glProgramUniform2fv_client_proc_t glProgramUniform2fv;
+	glProgramUniform3fv_client_proc_t glProgramUniform3fv;
+	glProgramUniform4fv_client_proc_t glProgramUniform4fv;
+	glProgramUniform1iv_client_proc_t glProgramUniform1iv;
+	glProgramUniform2iv_client_proc_t glProgramUniform2iv;
+	glProgramUniform3iv_client_proc_t glProgramUniform3iv;
+	glProgramUniform4iv_client_proc_t glProgramUniform4iv;
+	glProgramUniform1uiv_client_proc_t glProgramUniform1uiv;
+	glProgramUniform2uiv_client_proc_t glProgramUniform2uiv;
+	glProgramUniform3uiv_client_proc_t glProgramUniform3uiv;
+	glProgramUniform4uiv_client_proc_t glProgramUniform4uiv;
+	glProgramUniformMatrix2fv_client_proc_t glProgramUniformMatrix2fv;
+	glProgramUniformMatrix3fv_client_proc_t glProgramUniformMatrix3fv;
+	glProgramUniformMatrix4fv_client_proc_t glProgramUniformMatrix4fv;
+	glProgramUniformMatrix2x3fv_client_proc_t glProgramUniformMatrix2x3fv;
+	glProgramUniformMatrix3x2fv_client_proc_t glProgramUniformMatrix3x2fv;
+	glProgramUniformMatrix2x4fv_client_proc_t glProgramUniformMatrix2x4fv;
+	glProgramUniformMatrix4x2fv_client_proc_t glProgramUniformMatrix4x2fv;
+	glProgramUniformMatrix3x4fv_client_proc_t glProgramUniformMatrix3x4fv;
+	glProgramUniformMatrix4x3fv_client_proc_t glProgramUniformMatrix4x3fv;
+	glGetProgramInterfaceiv_client_proc_t glGetProgramInterfaceiv;
+	glGetProgramResourceiv_client_proc_t glGetProgramResourceiv;
+	glGetProgramResourceIndex_client_proc_t glGetProgramResourceIndex;
+	glGetProgramResourceLocation_client_proc_t glGetProgramResourceLocation;
+	glGetProgramResourceName_client_proc_t glGetProgramResourceName;
+	glBindImageTexture_client_proc_t glBindImageTexture;
+	glDispatchCompute_client_proc_t glDispatchCompute;
+	glDispatchComputeIndirect_client_proc_t glDispatchComputeIndirect;
+	glBindVertexBuffer_client_proc_t glBindVertexBuffer;
+	glVertexAttribBinding_client_proc_t glVertexAttribBinding;
+	glVertexAttribFormat_client_proc_t glVertexAttribFormat;
+	glVertexAttribIFormat_client_proc_t glVertexAttribIFormat;
+	glVertexBindingDivisor_client_proc_t glVertexBindingDivisor;
+	glDrawArraysIndirect_client_proc_t glDrawArraysIndirect;
+	glDrawArraysIndirectDataAEMU_client_proc_t glDrawArraysIndirectDataAEMU;
+	glDrawArraysIndirectOffsetAEMU_client_proc_t glDrawArraysIndirectOffsetAEMU;
+	glDrawElementsIndirect_client_proc_t glDrawElementsIndirect;
+	glDrawElementsIndirectDataAEMU_client_proc_t glDrawElementsIndirectDataAEMU;
+	glDrawElementsIndirectOffsetAEMU_client_proc_t glDrawElementsIndirectOffsetAEMU;
+	glTexStorage2DMultisample_client_proc_t glTexStorage2DMultisample;
+	glSampleMaski_client_proc_t glSampleMaski;
+	glGetMultisamplefv_client_proc_t glGetMultisamplefv;
+	glFramebufferParameteri_client_proc_t glFramebufferParameteri;
+	glGetFramebufferParameteriv_client_proc_t glGetFramebufferParameteriv;
+	glGetTexLevelParameterfv_client_proc_t glGetTexLevelParameterfv;
+	glGetTexLevelParameteriv_client_proc_t glGetTexLevelParameteriv;
+	glMapBufferRangeDMA_client_proc_t glMapBufferRangeDMA;
+	glUnmapBufferDMA_client_proc_t glUnmapBufferDMA;
+	glMapBufferRangeDirect_client_proc_t glMapBufferRangeDirect;
+	glUnmapBufferDirect_client_proc_t glUnmapBufferDirect;
+	glFlushMappedBufferRangeDirect_client_proc_t glFlushMappedBufferRangeDirect;
+	glGetGraphicsResetStatusEXT_client_proc_t glGetGraphicsResetStatusEXT;
+	glReadnPixelsEXT_client_proc_t glReadnPixelsEXT;
+	glGetnUniformfvEXT_client_proc_t glGetnUniformfvEXT;
+	glGetnUniformivEXT_client_proc_t glGetnUniformivEXT;
+	glDrawArraysNullAEMU_client_proc_t glDrawArraysNullAEMU;
+	glDrawElementsNullAEMU_client_proc_t glDrawElementsNullAEMU;
+	glDrawElementsOffsetNullAEMU_client_proc_t glDrawElementsOffsetNullAEMU;
+	glDrawElementsDataNullAEMU_client_proc_t glDrawElementsDataNullAEMU;
+	glUnmapBufferAsyncAEMU_client_proc_t glUnmapBufferAsyncAEMU;
+	glFlushMappedBufferRangeAEMU2_client_proc_t glFlushMappedBufferRangeAEMU2;
+	glBufferDataSyncAEMU_client_proc_t glBufferDataSyncAEMU;
+	glTexBufferOES_client_proc_t glTexBufferOES;
+	glTexBufferRangeOES_client_proc_t glTexBufferRangeOES;
+	glTexBufferEXT_client_proc_t glTexBufferEXT;
+	glTexBufferRangeEXT_client_proc_t glTexBufferRangeEXT;
+	glEnableiEXT_client_proc_t glEnableiEXT;
+	glDisableiEXT_client_proc_t glDisableiEXT;
+	glBlendEquationiEXT_client_proc_t glBlendEquationiEXT;
+	glBlendEquationSeparateiEXT_client_proc_t glBlendEquationSeparateiEXT;
+	glBlendFunciEXT_client_proc_t glBlendFunciEXT;
+	glBlendFuncSeparateiEXT_client_proc_t glBlendFuncSeparateiEXT;
+	glColorMaskiEXT_client_proc_t glColorMaskiEXT;
+	glIsEnablediEXT_client_proc_t glIsEnablediEXT;
+	virtual ~gl2_client_context_t() {}
+
+	typedef gl2_client_context_t *CONTEXT_ACCESSOR_TYPE(void);
+	static void setContextAccessor(CONTEXT_ACCESSOR_TYPE *f);
+	int initDispatchByName( void *(*getProc)(const char *name, void *userData), void *userData);
+	virtual void setError(unsigned int  error){ (void)error; }
+	virtual unsigned int getError(){ return 0; }
+};
+
+#endif
diff --git a/system/GLESv2_enc/gl2_client_proc.h b/system/GLESv2_enc/gl2_client_proc.h
new file mode 100644
index 0000000..18a24ae
--- /dev/null
+++ b/system/GLESv2_enc/gl2_client_proc.h
@@ -0,0 +1,456 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+#ifndef __gl2_client_proc_t_h
+#define __gl2_client_proc_t_h
+
+
+
+#include "gl2_types.h"
+#ifdef _MSC_VER
+#include <stdint.h>
+#endif
+#ifndef gl2_APIENTRY
+#define gl2_APIENTRY 
+#endif
+typedef void (gl2_APIENTRY *glActiveTexture_client_proc_t) (void * ctx, GLenum);
+typedef void (gl2_APIENTRY *glAttachShader_client_proc_t) (void * ctx, GLuint, GLuint);
+typedef void (gl2_APIENTRY *glBindAttribLocation_client_proc_t) (void * ctx, GLuint, GLuint, const GLchar*);
+typedef void (gl2_APIENTRY *glBindBuffer_client_proc_t) (void * ctx, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glBindFramebuffer_client_proc_t) (void * ctx, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glBindRenderbuffer_client_proc_t) (void * ctx, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glBindTexture_client_proc_t) (void * ctx, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glBlendColor_client_proc_t) (void * ctx, GLclampf, GLclampf, GLclampf, GLclampf);
+typedef void (gl2_APIENTRY *glBlendEquation_client_proc_t) (void * ctx, GLenum);
+typedef void (gl2_APIENTRY *glBlendEquationSeparate_client_proc_t) (void * ctx, GLenum, GLenum);
+typedef void (gl2_APIENTRY *glBlendFunc_client_proc_t) (void * ctx, GLenum, GLenum);
+typedef void (gl2_APIENTRY *glBlendFuncSeparate_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLenum);
+typedef void (gl2_APIENTRY *glBufferData_client_proc_t) (void * ctx, GLenum, GLsizeiptr, const GLvoid*, GLenum);
+typedef void (gl2_APIENTRY *glBufferSubData_client_proc_t) (void * ctx, GLenum, GLintptr, GLsizeiptr, const GLvoid*);
+typedef GLenum (gl2_APIENTRY *glCheckFramebufferStatus_client_proc_t) (void * ctx, GLenum);
+typedef void (gl2_APIENTRY *glClear_client_proc_t) (void * ctx, GLbitfield);
+typedef void (gl2_APIENTRY *glClearColor_client_proc_t) (void * ctx, GLclampf, GLclampf, GLclampf, GLclampf);
+typedef void (gl2_APIENTRY *glClearDepthf_client_proc_t) (void * ctx, GLclampf);
+typedef void (gl2_APIENTRY *glClearStencil_client_proc_t) (void * ctx, GLint);
+typedef void (gl2_APIENTRY *glColorMask_client_proc_t) (void * ctx, GLboolean, GLboolean, GLboolean, GLboolean);
+typedef void (gl2_APIENTRY *glCompileShader_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glCompressedTexImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*);
+typedef void (gl2_APIENTRY *glCompressedTexSubImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*);
+typedef void (gl2_APIENTRY *glCopyTexImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint);
+typedef void (gl2_APIENTRY *glCopyTexSubImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+typedef GLuint (gl2_APIENTRY *glCreateProgram_client_proc_t) (void * ctx);
+typedef GLuint (gl2_APIENTRY *glCreateShader_client_proc_t) (void * ctx, GLenum);
+typedef void (gl2_APIENTRY *glCullFace_client_proc_t) (void * ctx, GLenum);
+typedef void (gl2_APIENTRY *glDeleteBuffers_client_proc_t) (void * ctx, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glDeleteFramebuffers_client_proc_t) (void * ctx, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glDeleteProgram_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glDeleteRenderbuffers_client_proc_t) (void * ctx, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glDeleteShader_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glDeleteTextures_client_proc_t) (void * ctx, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glDepthFunc_client_proc_t) (void * ctx, GLenum);
+typedef void (gl2_APIENTRY *glDepthMask_client_proc_t) (void * ctx, GLboolean);
+typedef void (gl2_APIENTRY *glDepthRangef_client_proc_t) (void * ctx, GLclampf, GLclampf);
+typedef void (gl2_APIENTRY *glDetachShader_client_proc_t) (void * ctx, GLuint, GLuint);
+typedef void (gl2_APIENTRY *glDisable_client_proc_t) (void * ctx, GLenum);
+typedef void (gl2_APIENTRY *glDisableVertexAttribArray_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glDrawArrays_client_proc_t) (void * ctx, GLenum, GLint, GLsizei);
+typedef void (gl2_APIENTRY *glDrawElements_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, const GLvoid*);
+typedef void (gl2_APIENTRY *glEnable_client_proc_t) (void * ctx, GLenum);
+typedef void (gl2_APIENTRY *glEnableVertexAttribArray_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glFinish_client_proc_t) (void * ctx);
+typedef void (gl2_APIENTRY *glFlush_client_proc_t) (void * ctx);
+typedef void (gl2_APIENTRY *glFramebufferRenderbuffer_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glFramebufferTexture2D_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLuint, GLint);
+typedef void (gl2_APIENTRY *glFrontFace_client_proc_t) (void * ctx, GLenum);
+typedef void (gl2_APIENTRY *glGenBuffers_client_proc_t) (void * ctx, GLsizei, GLuint*);
+typedef void (gl2_APIENTRY *glGenerateMipmap_client_proc_t) (void * ctx, GLenum);
+typedef void (gl2_APIENTRY *glGenFramebuffers_client_proc_t) (void * ctx, GLsizei, GLuint*);
+typedef void (gl2_APIENTRY *glGenRenderbuffers_client_proc_t) (void * ctx, GLsizei, GLuint*);
+typedef void (gl2_APIENTRY *glGenTextures_client_proc_t) (void * ctx, GLsizei, GLuint*);
+typedef void (gl2_APIENTRY *glGetActiveAttrib_client_proc_t) (void * ctx, GLuint, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLchar*);
+typedef void (gl2_APIENTRY *glGetActiveUniform_client_proc_t) (void * ctx, GLuint, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLchar*);
+typedef void (gl2_APIENTRY *glGetAttachedShaders_client_proc_t) (void * ctx, GLuint, GLsizei, GLsizei*, GLuint*);
+typedef int (gl2_APIENTRY *glGetAttribLocation_client_proc_t) (void * ctx, GLuint, const GLchar*);
+typedef void (gl2_APIENTRY *glGetBooleanv_client_proc_t) (void * ctx, GLenum, GLboolean*);
+typedef void (gl2_APIENTRY *glGetBufferParameteriv_client_proc_t) (void * ctx, GLenum, GLenum, GLint*);
+typedef GLenum (gl2_APIENTRY *glGetError_client_proc_t) (void * ctx);
+typedef void (gl2_APIENTRY *glGetFloatv_client_proc_t) (void * ctx, GLenum, GLfloat*);
+typedef void (gl2_APIENTRY *glGetFramebufferAttachmentParameteriv_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLint*);
+typedef void (gl2_APIENTRY *glGetIntegerv_client_proc_t) (void * ctx, GLenum, GLint*);
+typedef void (gl2_APIENTRY *glGetProgramiv_client_proc_t) (void * ctx, GLuint, GLenum, GLint*);
+typedef void (gl2_APIENTRY *glGetProgramInfoLog_client_proc_t) (void * ctx, GLuint, GLsizei, GLsizei*, GLchar*);
+typedef void (gl2_APIENTRY *glGetRenderbufferParameteriv_client_proc_t) (void * ctx, GLenum, GLenum, GLint*);
+typedef void (gl2_APIENTRY *glGetShaderiv_client_proc_t) (void * ctx, GLuint, GLenum, GLint*);
+typedef void (gl2_APIENTRY *glGetShaderInfoLog_client_proc_t) (void * ctx, GLuint, GLsizei, GLsizei*, GLchar*);
+typedef void (gl2_APIENTRY *glGetShaderPrecisionFormat_client_proc_t) (void * ctx, GLenum, GLenum, GLint*, GLint*);
+typedef void (gl2_APIENTRY *glGetShaderSource_client_proc_t) (void * ctx, GLuint, GLsizei, GLsizei*, GLchar*);
+typedef const GLubyte* (gl2_APIENTRY *glGetString_client_proc_t) (void * ctx, GLenum);
+typedef void (gl2_APIENTRY *glGetTexParameterfv_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat*);
+typedef void (gl2_APIENTRY *glGetTexParameteriv_client_proc_t) (void * ctx, GLenum, GLenum, GLint*);
+typedef void (gl2_APIENTRY *glGetUniformfv_client_proc_t) (void * ctx, GLuint, GLint, GLfloat*);
+typedef void (gl2_APIENTRY *glGetUniformiv_client_proc_t) (void * ctx, GLuint, GLint, GLint*);
+typedef int (gl2_APIENTRY *glGetUniformLocation_client_proc_t) (void * ctx, GLuint, const GLchar*);
+typedef void (gl2_APIENTRY *glGetVertexAttribfv_client_proc_t) (void * ctx, GLuint, GLenum, GLfloat*);
+typedef void (gl2_APIENTRY *glGetVertexAttribiv_client_proc_t) (void * ctx, GLuint, GLenum, GLint*);
+typedef void (gl2_APIENTRY *glGetVertexAttribPointerv_client_proc_t) (void * ctx, GLuint, GLenum, GLvoid**);
+typedef void (gl2_APIENTRY *glHint_client_proc_t) (void * ctx, GLenum, GLenum);
+typedef GLboolean (gl2_APIENTRY *glIsBuffer_client_proc_t) (void * ctx, GLuint);
+typedef GLboolean (gl2_APIENTRY *glIsEnabled_client_proc_t) (void * ctx, GLenum);
+typedef GLboolean (gl2_APIENTRY *glIsFramebuffer_client_proc_t) (void * ctx, GLuint);
+typedef GLboolean (gl2_APIENTRY *glIsProgram_client_proc_t) (void * ctx, GLuint);
+typedef GLboolean (gl2_APIENTRY *glIsRenderbuffer_client_proc_t) (void * ctx, GLuint);
+typedef GLboolean (gl2_APIENTRY *glIsShader_client_proc_t) (void * ctx, GLuint);
+typedef GLboolean (gl2_APIENTRY *glIsTexture_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glLineWidth_client_proc_t) (void * ctx, GLfloat);
+typedef void (gl2_APIENTRY *glLinkProgram_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glPixelStorei_client_proc_t) (void * ctx, GLenum, GLint);
+typedef void (gl2_APIENTRY *glPolygonOffset_client_proc_t) (void * ctx, GLfloat, GLfloat);
+typedef void (gl2_APIENTRY *glReadPixels_client_proc_t) (void * ctx, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid*);
+typedef void (gl2_APIENTRY *glReleaseShaderCompiler_client_proc_t) (void * ctx);
+typedef void (gl2_APIENTRY *glRenderbufferStorage_client_proc_t) (void * ctx, GLenum, GLenum, GLsizei, GLsizei);
+typedef void (gl2_APIENTRY *glSampleCoverage_client_proc_t) (void * ctx, GLclampf, GLboolean);
+typedef void (gl2_APIENTRY *glScissor_client_proc_t) (void * ctx, GLint, GLint, GLsizei, GLsizei);
+typedef void (gl2_APIENTRY *glShaderBinary_client_proc_t) (void * ctx, GLsizei, const GLuint*, GLenum, const GLvoid*, GLsizei);
+typedef void (gl2_APIENTRY *glShaderSource_client_proc_t) (void * ctx, GLuint, GLsizei, const GLchar* const*, const GLint*);
+typedef void (gl2_APIENTRY *glStencilFunc_client_proc_t) (void * ctx, GLenum, GLint, GLuint);
+typedef void (gl2_APIENTRY *glStencilFuncSeparate_client_proc_t) (void * ctx, GLenum, GLenum, GLint, GLuint);
+typedef void (gl2_APIENTRY *glStencilMask_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glStencilMaskSeparate_client_proc_t) (void * ctx, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glStencilOp_client_proc_t) (void * ctx, GLenum, GLenum, GLenum);
+typedef void (gl2_APIENTRY *glStencilOpSeparate_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLenum);
+typedef void (gl2_APIENTRY *glTexImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid*);
+typedef void (gl2_APIENTRY *glTexParameterf_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat);
+typedef void (gl2_APIENTRY *glTexParameterfv_client_proc_t) (void * ctx, GLenum, GLenum, const GLfloat*);
+typedef void (gl2_APIENTRY *glTexParameteri_client_proc_t) (void * ctx, GLenum, GLenum, GLint);
+typedef void (gl2_APIENTRY *glTexParameteriv_client_proc_t) (void * ctx, GLenum, GLenum, const GLint*);
+typedef void (gl2_APIENTRY *glTexSubImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid*);
+typedef void (gl2_APIENTRY *glUniform1f_client_proc_t) (void * ctx, GLint, GLfloat);
+typedef void (gl2_APIENTRY *glUniform1fv_client_proc_t) (void * ctx, GLint, GLsizei, const GLfloat*);
+typedef void (gl2_APIENTRY *glUniform1i_client_proc_t) (void * ctx, GLint, GLint);
+typedef void (gl2_APIENTRY *glUniform1iv_client_proc_t) (void * ctx, GLint, GLsizei, const GLint*);
+typedef void (gl2_APIENTRY *glUniform2f_client_proc_t) (void * ctx, GLint, GLfloat, GLfloat);
+typedef void (gl2_APIENTRY *glUniform2fv_client_proc_t) (void * ctx, GLint, GLsizei, const GLfloat*);
+typedef void (gl2_APIENTRY *glUniform2i_client_proc_t) (void * ctx, GLint, GLint, GLint);
+typedef void (gl2_APIENTRY *glUniform2iv_client_proc_t) (void * ctx, GLint, GLsizei, const GLint*);
+typedef void (gl2_APIENTRY *glUniform3f_client_proc_t) (void * ctx, GLint, GLfloat, GLfloat, GLfloat);
+typedef void (gl2_APIENTRY *glUniform3fv_client_proc_t) (void * ctx, GLint, GLsizei, const GLfloat*);
+typedef void (gl2_APIENTRY *glUniform3i_client_proc_t) (void * ctx, GLint, GLint, GLint, GLint);
+typedef void (gl2_APIENTRY *glUniform3iv_client_proc_t) (void * ctx, GLint, GLsizei, const GLint*);
+typedef void (gl2_APIENTRY *glUniform4f_client_proc_t) (void * ctx, GLint, GLfloat, GLfloat, GLfloat, GLfloat);
+typedef void (gl2_APIENTRY *glUniform4fv_client_proc_t) (void * ctx, GLint, GLsizei, const GLfloat*);
+typedef void (gl2_APIENTRY *glUniform4i_client_proc_t) (void * ctx, GLint, GLint, GLint, GLint, GLint);
+typedef void (gl2_APIENTRY *glUniform4iv_client_proc_t) (void * ctx, GLint, GLsizei, const GLint*);
+typedef void (gl2_APIENTRY *glUniformMatrix2fv_client_proc_t) (void * ctx, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glUniformMatrix3fv_client_proc_t) (void * ctx, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glUniformMatrix4fv_client_proc_t) (void * ctx, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glUseProgram_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glValidateProgram_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glVertexAttrib1f_client_proc_t) (void * ctx, GLuint, GLfloat);
+typedef void (gl2_APIENTRY *glVertexAttrib1fv_client_proc_t) (void * ctx, GLuint, const GLfloat*);
+typedef void (gl2_APIENTRY *glVertexAttrib2f_client_proc_t) (void * ctx, GLuint, GLfloat, GLfloat);
+typedef void (gl2_APIENTRY *glVertexAttrib2fv_client_proc_t) (void * ctx, GLuint, const GLfloat*);
+typedef void (gl2_APIENTRY *glVertexAttrib3f_client_proc_t) (void * ctx, GLuint, GLfloat, GLfloat, GLfloat);
+typedef void (gl2_APIENTRY *glVertexAttrib3fv_client_proc_t) (void * ctx, GLuint, const GLfloat*);
+typedef void (gl2_APIENTRY *glVertexAttrib4f_client_proc_t) (void * ctx, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+typedef void (gl2_APIENTRY *glVertexAttrib4fv_client_proc_t) (void * ctx, GLuint, const GLfloat*);
+typedef void (gl2_APIENTRY *glVertexAttribPointer_client_proc_t) (void * ctx, GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid*);
+typedef void (gl2_APIENTRY *glViewport_client_proc_t) (void * ctx, GLint, GLint, GLsizei, GLsizei);
+typedef void (gl2_APIENTRY *glEGLImageTargetTexture2DOES_client_proc_t) (void * ctx, GLenum, GLeglImageOES);
+typedef void (gl2_APIENTRY *glEGLImageTargetRenderbufferStorageOES_client_proc_t) (void * ctx, GLenum, GLeglImageOES);
+typedef void (gl2_APIENTRY *glGetProgramBinaryOES_client_proc_t) (void * ctx, GLuint, GLsizei, GLsizei*, GLenum*, GLvoid*);
+typedef void (gl2_APIENTRY *glProgramBinaryOES_client_proc_t) (void * ctx, GLuint, GLenum, const GLvoid*, GLint);
+typedef void* (gl2_APIENTRY *glMapBufferOES_client_proc_t) (void * ctx, GLenum, GLenum);
+typedef GLboolean (gl2_APIENTRY *glUnmapBufferOES_client_proc_t) (void * ctx, GLenum);
+typedef void (gl2_APIENTRY *glTexImage3DOES_client_proc_t) (void * ctx, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid*);
+typedef void (gl2_APIENTRY *glTexSubImage3DOES_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid*);
+typedef void (gl2_APIENTRY *glCopyTexSubImage3DOES_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+typedef void (gl2_APIENTRY *glCompressedTexImage3DOES_client_proc_t) (void * ctx, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*);
+typedef void (gl2_APIENTRY *glCompressedTexSubImage3DOES_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*);
+typedef void (gl2_APIENTRY *glFramebufferTexture3DOES_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLuint, GLint, GLint);
+typedef void (gl2_APIENTRY *glBindVertexArrayOES_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glDeleteVertexArraysOES_client_proc_t) (void * ctx, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glGenVertexArraysOES_client_proc_t) (void * ctx, GLsizei, GLuint*);
+typedef GLboolean (gl2_APIENTRY *glIsVertexArrayOES_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glDiscardFramebufferEXT_client_proc_t) (void * ctx, GLenum, GLsizei, const GLenum*);
+typedef void (gl2_APIENTRY *glMultiDrawArraysEXT_client_proc_t) (void * ctx, GLenum, const GLint*, const GLsizei*, GLsizei);
+typedef void (gl2_APIENTRY *glMultiDrawElementsEXT_client_proc_t) (void * ctx, GLenum, const GLsizei*, GLenum, const GLvoid* const*, GLsizei);
+typedef void (gl2_APIENTRY *glGetPerfMonitorGroupsAMD_client_proc_t) (void * ctx, GLint*, GLsizei, GLuint*);
+typedef void (gl2_APIENTRY *glGetPerfMonitorCountersAMD_client_proc_t) (void * ctx, GLuint, GLint*, GLint*, GLsizei, GLuint*);
+typedef void (gl2_APIENTRY *glGetPerfMonitorGroupStringAMD_client_proc_t) (void * ctx, GLuint, GLsizei, GLsizei*, GLchar*);
+typedef void (gl2_APIENTRY *glGetPerfMonitorCounterStringAMD_client_proc_t) (void * ctx, GLuint, GLuint, GLsizei, GLsizei*, GLchar*);
+typedef void (gl2_APIENTRY *glGetPerfMonitorCounterInfoAMD_client_proc_t) (void * ctx, GLuint, GLuint, GLenum, GLvoid*);
+typedef void (gl2_APIENTRY *glGenPerfMonitorsAMD_client_proc_t) (void * ctx, GLsizei, GLuint*);
+typedef void (gl2_APIENTRY *glDeletePerfMonitorsAMD_client_proc_t) (void * ctx, GLsizei, GLuint*);
+typedef void (gl2_APIENTRY *glSelectPerfMonitorCountersAMD_client_proc_t) (void * ctx, GLuint, GLboolean, GLuint, GLint, GLuint*);
+typedef void (gl2_APIENTRY *glBeginPerfMonitorAMD_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glEndPerfMonitorAMD_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glGetPerfMonitorCounterDataAMD_client_proc_t) (void * ctx, GLuint, GLenum, GLsizei, GLuint*, GLint*);
+typedef void (gl2_APIENTRY *glRenderbufferStorageMultisampleIMG_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, GLsizei, GLsizei);
+typedef void (gl2_APIENTRY *glFramebufferTexture2DMultisampleIMG_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLuint, GLint, GLsizei);
+typedef void (gl2_APIENTRY *glDeleteFencesNV_client_proc_t) (void * ctx, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glGenFencesNV_client_proc_t) (void * ctx, GLsizei, GLuint*);
+typedef GLboolean (gl2_APIENTRY *glIsFenceNV_client_proc_t) (void * ctx, GLuint);
+typedef GLboolean (gl2_APIENTRY *glTestFenceNV_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glGetFenceivNV_client_proc_t) (void * ctx, GLuint, GLenum, GLint*);
+typedef void (gl2_APIENTRY *glFinishFenceNV_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glSetFenceNV_client_proc_t) (void * ctx, GLuint, GLenum);
+typedef void (gl2_APIENTRY *glCoverageMaskNV_client_proc_t) (void * ctx, GLboolean);
+typedef void (gl2_APIENTRY *glCoverageOperationNV_client_proc_t) (void * ctx, GLenum);
+typedef void (gl2_APIENTRY *glGetDriverControlsQCOM_client_proc_t) (void * ctx, GLint*, GLsizei, GLuint*);
+typedef void (gl2_APIENTRY *glGetDriverControlStringQCOM_client_proc_t) (void * ctx, GLuint, GLsizei, GLsizei*, GLchar*);
+typedef void (gl2_APIENTRY *glEnableDriverControlQCOM_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glDisableDriverControlQCOM_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glExtGetTexturesQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
+typedef void (gl2_APIENTRY *glExtGetBuffersQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
+typedef void (gl2_APIENTRY *glExtGetRenderbuffersQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
+typedef void (gl2_APIENTRY *glExtGetFramebuffersQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
+typedef void (gl2_APIENTRY *glExtGetTexLevelParameterivQCOM_client_proc_t) (void * ctx, GLuint, GLenum, GLint, GLenum, GLint*);
+typedef void (gl2_APIENTRY *glExtTexObjectStateOverrideiQCOM_client_proc_t) (void * ctx, GLenum, GLenum, GLint);
+typedef void (gl2_APIENTRY *glExtGetTexSubImageQCOM_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, GLvoid*);
+typedef void (gl2_APIENTRY *glExtGetBufferPointervQCOM_client_proc_t) (void * ctx, GLenum, GLvoidptr*);
+typedef void (gl2_APIENTRY *glExtGetShadersQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
+typedef void (gl2_APIENTRY *glExtGetProgramsQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
+typedef GLboolean (gl2_APIENTRY *glExtIsProgramBinaryQCOM_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glExtGetProgramBinarySourceQCOM_client_proc_t) (void * ctx, GLuint, GLenum, GLchar*, GLint*);
+typedef void (gl2_APIENTRY *glStartTilingQCOM_client_proc_t) (void * ctx, GLuint, GLuint, GLuint, GLuint, GLbitfield);
+typedef void (gl2_APIENTRY *glEndTilingQCOM_client_proc_t) (void * ctx, GLbitfield);
+typedef void (gl2_APIENTRY *glVertexAttribPointerData_client_proc_t) (void * ctx, GLuint, GLint, GLenum, GLboolean, GLsizei, void*, GLuint);
+typedef void (gl2_APIENTRY *glVertexAttribPointerOffset_client_proc_t) (void * ctx, GLuint, GLint, GLenum, GLboolean, GLsizei, GLuint);
+typedef void (gl2_APIENTRY *glDrawElementsOffset_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glDrawElementsData_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, void*, GLuint);
+typedef void (gl2_APIENTRY *glGetCompressedTextureFormats_client_proc_t) (void * ctx, int, GLint*);
+typedef void (gl2_APIENTRY *glShaderString_client_proc_t) (void * ctx, GLuint, const GLchar*, GLsizei);
+typedef int (gl2_APIENTRY *glFinishRoundTrip_client_proc_t) (void * ctx);
+typedef void (gl2_APIENTRY *glGenVertexArrays_client_proc_t) (void * ctx, GLsizei, GLuint*);
+typedef void (gl2_APIENTRY *glBindVertexArray_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glDeleteVertexArrays_client_proc_t) (void * ctx, GLsizei, const GLuint*);
+typedef GLboolean (gl2_APIENTRY *glIsVertexArray_client_proc_t) (void * ctx, GLuint);
+typedef void* (gl2_APIENTRY *glMapBufferRange_client_proc_t) (void * ctx, GLenum, GLintptr, GLsizeiptr, GLbitfield);
+typedef GLboolean (gl2_APIENTRY *glUnmapBuffer_client_proc_t) (void * ctx, GLenum);
+typedef void (gl2_APIENTRY *glFlushMappedBufferRange_client_proc_t) (void * ctx, GLenum, GLintptr, GLsizeiptr);
+typedef void (gl2_APIENTRY *glMapBufferRangeAEMU_client_proc_t) (void * ctx, GLenum, GLintptr, GLsizeiptr, GLbitfield, void*);
+typedef void (gl2_APIENTRY *glUnmapBufferAEMU_client_proc_t) (void * ctx, GLenum, GLintptr, GLsizeiptr, GLbitfield, void*, GLboolean*);
+typedef void (gl2_APIENTRY *glFlushMappedBufferRangeAEMU_client_proc_t) (void * ctx, GLenum, GLintptr, GLsizeiptr, GLbitfield, void*);
+typedef void (gl2_APIENTRY *glReadPixelsOffsetAEMU_client_proc_t) (void * ctx, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glCompressedTexImage2DOffsetAEMU_client_proc_t) (void * ctx, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, GLuint);
+typedef void (gl2_APIENTRY *glCompressedTexSubImage2DOffsetAEMU_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, GLuint);
+typedef void (gl2_APIENTRY *glTexImage2DOffsetAEMU_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glTexSubImage2DOffsetAEMU_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glBindBufferRange_client_proc_t) (void * ctx, GLenum, GLuint, GLuint, GLintptr, GLsizeiptr);
+typedef void (gl2_APIENTRY *glBindBufferBase_client_proc_t) (void * ctx, GLenum, GLuint, GLuint);
+typedef void (gl2_APIENTRY *glCopyBufferSubData_client_proc_t) (void * ctx, GLenum, GLenum, GLintptr, GLintptr, GLsizeiptr);
+typedef void (gl2_APIENTRY *glClearBufferiv_client_proc_t) (void * ctx, GLenum, GLint, const GLint*);
+typedef void (gl2_APIENTRY *glClearBufferuiv_client_proc_t) (void * ctx, GLenum, GLint, const GLuint*);
+typedef void (gl2_APIENTRY *glClearBufferfv_client_proc_t) (void * ctx, GLenum, GLint, const GLfloat*);
+typedef void (gl2_APIENTRY *glClearBufferfi_client_proc_t) (void * ctx, GLenum, GLint, GLfloat, GLint);
+typedef void (gl2_APIENTRY *glGetBufferParameteri64v_client_proc_t) (void * ctx, GLenum, GLenum, GLint64*);
+typedef void (gl2_APIENTRY *glGetBufferPointerv_client_proc_t) (void * ctx, GLenum, GLenum, GLvoid**);
+typedef void (gl2_APIENTRY *glUniformBlockBinding_client_proc_t) (void * ctx, GLuint, GLuint, GLuint);
+typedef GLuint (gl2_APIENTRY *glGetUniformBlockIndex_client_proc_t) (void * ctx, GLuint, const GLchar*);
+typedef void (gl2_APIENTRY *glGetUniformIndices_client_proc_t) (void * ctx, GLuint, GLsizei, const GLchar**, GLuint*);
+typedef void (gl2_APIENTRY *glGetUniformIndicesAEMU_client_proc_t) (void * ctx, GLuint, GLsizei, const GLchar*, GLsizei, GLuint*);
+typedef void (gl2_APIENTRY *glGetActiveUniformBlockiv_client_proc_t) (void * ctx, GLuint, GLuint, GLenum, GLint*);
+typedef void (gl2_APIENTRY *glGetActiveUniformBlockName_client_proc_t) (void * ctx, GLuint, GLuint, GLsizei, GLsizei*, GLchar*);
+typedef void (gl2_APIENTRY *glUniform1ui_client_proc_t) (void * ctx, GLint, GLuint);
+typedef void (gl2_APIENTRY *glUniform2ui_client_proc_t) (void * ctx, GLint, GLuint, GLuint);
+typedef void (gl2_APIENTRY *glUniform3ui_client_proc_t) (void * ctx, GLint, GLuint, GLuint, GLuint);
+typedef void (gl2_APIENTRY *glUniform4ui_client_proc_t) (void * ctx, GLint, GLint, GLuint, GLuint, GLuint);
+typedef void (gl2_APIENTRY *glUniform1uiv_client_proc_t) (void * ctx, GLint, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glUniform2uiv_client_proc_t) (void * ctx, GLint, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glUniform3uiv_client_proc_t) (void * ctx, GLint, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glUniform4uiv_client_proc_t) (void * ctx, GLint, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glUniformMatrix2x3fv_client_proc_t) (void * ctx, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glUniformMatrix3x2fv_client_proc_t) (void * ctx, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glUniformMatrix2x4fv_client_proc_t) (void * ctx, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glUniformMatrix4x2fv_client_proc_t) (void * ctx, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glUniformMatrix3x4fv_client_proc_t) (void * ctx, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glUniformMatrix4x3fv_client_proc_t) (void * ctx, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glGetUniformuiv_client_proc_t) (void * ctx, GLuint, GLint, GLuint*);
+typedef void (gl2_APIENTRY *glGetActiveUniformsiv_client_proc_t) (void * ctx, GLuint, GLsizei, const GLuint*, GLenum, GLint*);
+typedef void (gl2_APIENTRY *glVertexAttribI4i_client_proc_t) (void * ctx, GLuint, GLint, GLint, GLint, GLint);
+typedef void (gl2_APIENTRY *glVertexAttribI4ui_client_proc_t) (void * ctx, GLuint, GLuint, GLuint, GLuint, GLuint);
+typedef void (gl2_APIENTRY *glVertexAttribI4iv_client_proc_t) (void * ctx, GLuint, const GLint*);
+typedef void (gl2_APIENTRY *glVertexAttribI4uiv_client_proc_t) (void * ctx, GLuint, const GLuint*);
+typedef void (gl2_APIENTRY *glVertexAttribIPointer_client_proc_t) (void * ctx, GLuint, GLint, GLenum, GLsizei, const GLvoid*);
+typedef void (gl2_APIENTRY *glVertexAttribIPointerOffsetAEMU_client_proc_t) (void * ctx, GLuint, GLint, GLenum, GLsizei, GLuint);
+typedef void (gl2_APIENTRY *glVertexAttribIPointerDataAEMU_client_proc_t) (void * ctx, GLuint, GLint, GLenum, GLsizei, void*, GLuint);
+typedef void (gl2_APIENTRY *glGetVertexAttribIiv_client_proc_t) (void * ctx, GLuint, GLenum, GLint*);
+typedef void (gl2_APIENTRY *glGetVertexAttribIuiv_client_proc_t) (void * ctx, GLuint, GLenum, GLuint*);
+typedef void (gl2_APIENTRY *glVertexAttribDivisor_client_proc_t) (void * ctx, GLuint, GLuint);
+typedef void (gl2_APIENTRY *glDrawArraysInstanced_client_proc_t) (void * ctx, GLenum, GLint, GLsizei, GLsizei);
+typedef void (gl2_APIENTRY *glDrawElementsInstanced_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, const void*, GLsizei);
+typedef void (gl2_APIENTRY *glDrawElementsInstancedDataAEMU_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, const void*, GLsizei, GLsizei);
+typedef void (gl2_APIENTRY *glDrawElementsInstancedOffsetAEMU_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, GLuint, GLsizei);
+typedef void (gl2_APIENTRY *glDrawRangeElements_client_proc_t) (void * ctx, GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid*);
+typedef void (gl2_APIENTRY *glDrawRangeElementsDataAEMU_client_proc_t) (void * ctx, GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid*, GLsizei);
+typedef void (gl2_APIENTRY *glDrawRangeElementsOffsetAEMU_client_proc_t) (void * ctx, GLenum, GLuint, GLuint, GLsizei, GLenum, GLuint);
+typedef GLsync (gl2_APIENTRY *glFenceSync_client_proc_t) (void * ctx, GLenum, GLbitfield);
+typedef GLenum (gl2_APIENTRY *glClientWaitSync_client_proc_t) (void * ctx, GLsync, GLbitfield, GLuint64);
+typedef void (gl2_APIENTRY *glWaitSync_client_proc_t) (void * ctx, GLsync, GLbitfield, GLuint64);
+typedef void (gl2_APIENTRY *glDeleteSync_client_proc_t) (void * ctx, GLsync);
+typedef GLboolean (gl2_APIENTRY *glIsSync_client_proc_t) (void * ctx, GLsync);
+typedef void (gl2_APIENTRY *glGetSynciv_client_proc_t) (void * ctx, GLsync, GLenum, GLsizei, GLsizei*, GLint*);
+typedef uint64_t (gl2_APIENTRY *glFenceSyncAEMU_client_proc_t) (void * ctx, GLenum, GLbitfield);
+typedef GLenum (gl2_APIENTRY *glClientWaitSyncAEMU_client_proc_t) (void * ctx, uint64_t, GLbitfield, GLuint64);
+typedef void (gl2_APIENTRY *glWaitSyncAEMU_client_proc_t) (void * ctx, uint64_t, GLbitfield, GLuint64);
+typedef void (gl2_APIENTRY *glDeleteSyncAEMU_client_proc_t) (void * ctx, uint64_t);
+typedef GLboolean (gl2_APIENTRY *glIsSyncAEMU_client_proc_t) (void * ctx, uint64_t);
+typedef void (gl2_APIENTRY *glGetSyncivAEMU_client_proc_t) (void * ctx, uint64_t, GLenum, GLsizei, GLsizei*, GLint*);
+typedef void (gl2_APIENTRY *glDrawBuffers_client_proc_t) (void * ctx, GLsizei, const GLenum*);
+typedef void (gl2_APIENTRY *glReadBuffer_client_proc_t) (void * ctx, GLenum);
+typedef void (gl2_APIENTRY *glBlitFramebuffer_client_proc_t) (void * ctx, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum);
+typedef void (gl2_APIENTRY *glInvalidateFramebuffer_client_proc_t) (void * ctx, GLenum, GLsizei, const GLenum*);
+typedef void (gl2_APIENTRY *glInvalidateSubFramebuffer_client_proc_t) (void * ctx, GLenum, GLsizei, const GLenum*, GLint, GLint, GLsizei, GLsizei);
+typedef void (gl2_APIENTRY *glFramebufferTextureLayer_client_proc_t) (void * ctx, GLenum, GLenum, GLuint, GLint, GLint);
+typedef void (gl2_APIENTRY *glRenderbufferStorageMultisample_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, GLsizei, GLsizei);
+typedef void (gl2_APIENTRY *glTexStorage2D_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, GLsizei, GLsizei);
+typedef void (gl2_APIENTRY *glGetInternalformativ_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLsizei, GLint*);
+typedef void (gl2_APIENTRY *glBeginTransformFeedback_client_proc_t) (void * ctx, GLenum);
+typedef void (gl2_APIENTRY *glEndTransformFeedback_client_proc_t) (void * ctx);
+typedef void (gl2_APIENTRY *glGenTransformFeedbacks_client_proc_t) (void * ctx, GLsizei, GLuint*);
+typedef void (gl2_APIENTRY *glDeleteTransformFeedbacks_client_proc_t) (void * ctx, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glBindTransformFeedback_client_proc_t) (void * ctx, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glPauseTransformFeedback_client_proc_t) (void * ctx);
+typedef void (gl2_APIENTRY *glResumeTransformFeedback_client_proc_t) (void * ctx);
+typedef GLboolean (gl2_APIENTRY *glIsTransformFeedback_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glTransformFeedbackVaryings_client_proc_t) (void * ctx, GLuint, GLsizei, const char**, GLenum);
+typedef void (gl2_APIENTRY *glTransformFeedbackVaryingsAEMU_client_proc_t) (void * ctx, GLuint, GLsizei, const char*, GLuint, GLenum);
+typedef void (gl2_APIENTRY *glGetTransformFeedbackVarying_client_proc_t) (void * ctx, GLuint, GLuint, GLsizei, GLsizei*, GLsizei*, GLenum*, char*);
+typedef void (gl2_APIENTRY *glGenSamplers_client_proc_t) (void * ctx, GLsizei, GLuint*);
+typedef void (gl2_APIENTRY *glDeleteSamplers_client_proc_t) (void * ctx, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glBindSampler_client_proc_t) (void * ctx, GLuint, GLuint);
+typedef void (gl2_APIENTRY *glSamplerParameterf_client_proc_t) (void * ctx, GLuint, GLenum, GLfloat);
+typedef void (gl2_APIENTRY *glSamplerParameteri_client_proc_t) (void * ctx, GLuint, GLenum, GLint);
+typedef void (gl2_APIENTRY *glSamplerParameterfv_client_proc_t) (void * ctx, GLuint, GLenum, const GLfloat*);
+typedef void (gl2_APIENTRY *glSamplerParameteriv_client_proc_t) (void * ctx, GLuint, GLenum, const GLint*);
+typedef void (gl2_APIENTRY *glGetSamplerParameterfv_client_proc_t) (void * ctx, GLuint, GLenum, GLfloat*);
+typedef void (gl2_APIENTRY *glGetSamplerParameteriv_client_proc_t) (void * ctx, GLuint, GLenum, GLint*);
+typedef GLboolean (gl2_APIENTRY *glIsSampler_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glGenQueries_client_proc_t) (void * ctx, GLsizei, GLuint*);
+typedef void (gl2_APIENTRY *glDeleteQueries_client_proc_t) (void * ctx, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glBeginQuery_client_proc_t) (void * ctx, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glEndQuery_client_proc_t) (void * ctx, GLenum);
+typedef void (gl2_APIENTRY *glGetQueryiv_client_proc_t) (void * ctx, GLenum, GLenum, GLint*);
+typedef void (gl2_APIENTRY *glGetQueryObjectuiv_client_proc_t) (void * ctx, GLuint, GLenum, GLuint*);
+typedef GLboolean (gl2_APIENTRY *glIsQuery_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glProgramParameteri_client_proc_t) (void * ctx, GLuint, GLenum, GLint);
+typedef void (gl2_APIENTRY *glProgramBinary_client_proc_t) (void * ctx, GLuint, GLenum, const void*, GLsizei);
+typedef void (gl2_APIENTRY *glGetProgramBinary_client_proc_t) (void * ctx, GLuint, GLsizei, GLsizei*, GLenum*, void*);
+typedef GLint (gl2_APIENTRY *glGetFragDataLocation_client_proc_t) (void * ctx, GLuint, const char*);
+typedef void (gl2_APIENTRY *glGetInteger64v_client_proc_t) (void * ctx, GLenum, GLint64*);
+typedef void (gl2_APIENTRY *glGetIntegeri_v_client_proc_t) (void * ctx, GLenum, GLuint, GLint*);
+typedef void (gl2_APIENTRY *glGetInteger64i_v_client_proc_t) (void * ctx, GLenum, GLuint, GLint64*);
+typedef void (gl2_APIENTRY *glTexImage3D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid*);
+typedef void (gl2_APIENTRY *glTexImage3DOffsetAEMU_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glTexStorage3D_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLsizei);
+typedef void (gl2_APIENTRY *glTexSubImage3D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid*);
+typedef void (gl2_APIENTRY *glTexSubImage3DOffsetAEMU_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glCompressedTexImage3D_client_proc_t) (void * ctx, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*);
+typedef void (gl2_APIENTRY *glCompressedTexImage3DOffsetAEMU_client_proc_t) (void * ctx, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, GLuint);
+typedef void (gl2_APIENTRY *glCompressedTexSubImage3D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*);
+typedef void (gl2_APIENTRY *glCompressedTexSubImage3DOffsetAEMU_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, GLuint);
+typedef void (gl2_APIENTRY *glCopyTexSubImage3D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+typedef const GLubyte* (gl2_APIENTRY *glGetStringi_client_proc_t) (void * ctx, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glGetBooleani_v_client_proc_t) (void * ctx, GLenum, GLuint, GLboolean*);
+typedef void (gl2_APIENTRY *glMemoryBarrier_client_proc_t) (void * ctx, GLbitfield);
+typedef void (gl2_APIENTRY *glMemoryBarrierByRegion_client_proc_t) (void * ctx, GLbitfield);
+typedef void (gl2_APIENTRY *glGenProgramPipelines_client_proc_t) (void * ctx, GLsizei, GLuint*);
+typedef void (gl2_APIENTRY *glDeleteProgramPipelines_client_proc_t) (void * ctx, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glBindProgramPipeline_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glGetProgramPipelineiv_client_proc_t) (void * ctx, GLuint, GLenum, GLint*);
+typedef void (gl2_APIENTRY *glGetProgramPipelineInfoLog_client_proc_t) (void * ctx, GLuint, GLsizei, GLsizei*, GLchar*);
+typedef void (gl2_APIENTRY *glValidateProgramPipeline_client_proc_t) (void * ctx, GLuint);
+typedef GLboolean (gl2_APIENTRY *glIsProgramPipeline_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glUseProgramStages_client_proc_t) (void * ctx, GLuint, GLbitfield, GLuint);
+typedef void (gl2_APIENTRY *glActiveShaderProgram_client_proc_t) (void * ctx, GLuint, GLuint);
+typedef GLuint (gl2_APIENTRY *glCreateShaderProgramv_client_proc_t) (void * ctx, GLenum, GLsizei, const char**);
+typedef GLuint (gl2_APIENTRY *glCreateShaderProgramvAEMU_client_proc_t) (void * ctx, GLenum, GLsizei, const char*, GLuint);
+typedef void (gl2_APIENTRY *glProgramUniform1f_client_proc_t) (void * ctx, GLuint, GLint, GLfloat);
+typedef void (gl2_APIENTRY *glProgramUniform2f_client_proc_t) (void * ctx, GLuint, GLint, GLfloat, GLfloat);
+typedef void (gl2_APIENTRY *glProgramUniform3f_client_proc_t) (void * ctx, GLuint, GLint, GLfloat, GLfloat, GLfloat);
+typedef void (gl2_APIENTRY *glProgramUniform4f_client_proc_t) (void * ctx, GLuint, GLint, GLfloat, GLfloat, GLfloat, GLfloat);
+typedef void (gl2_APIENTRY *glProgramUniform1i_client_proc_t) (void * ctx, GLuint, GLint, GLint);
+typedef void (gl2_APIENTRY *glProgramUniform2i_client_proc_t) (void * ctx, GLuint, GLint, GLint, GLint);
+typedef void (gl2_APIENTRY *glProgramUniform3i_client_proc_t) (void * ctx, GLuint, GLint, GLint, GLint, GLint);
+typedef void (gl2_APIENTRY *glProgramUniform4i_client_proc_t) (void * ctx, GLuint, GLint, GLint, GLint, GLint, GLint);
+typedef void (gl2_APIENTRY *glProgramUniform1ui_client_proc_t) (void * ctx, GLuint, GLint, GLuint);
+typedef void (gl2_APIENTRY *glProgramUniform2ui_client_proc_t) (void * ctx, GLuint, GLint, GLint, GLuint);
+typedef void (gl2_APIENTRY *glProgramUniform3ui_client_proc_t) (void * ctx, GLuint, GLint, GLint, GLint, GLuint);
+typedef void (gl2_APIENTRY *glProgramUniform4ui_client_proc_t) (void * ctx, GLuint, GLint, GLint, GLint, GLint, GLuint);
+typedef void (gl2_APIENTRY *glProgramUniform1fv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, const GLfloat*);
+typedef void (gl2_APIENTRY *glProgramUniform2fv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, const GLfloat*);
+typedef void (gl2_APIENTRY *glProgramUniform3fv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, const GLfloat*);
+typedef void (gl2_APIENTRY *glProgramUniform4fv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, const GLfloat*);
+typedef void (gl2_APIENTRY *glProgramUniform1iv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, const GLint*);
+typedef void (gl2_APIENTRY *glProgramUniform2iv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, const GLint*);
+typedef void (gl2_APIENTRY *glProgramUniform3iv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, const GLint*);
+typedef void (gl2_APIENTRY *glProgramUniform4iv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, const GLint*);
+typedef void (gl2_APIENTRY *glProgramUniform1uiv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glProgramUniform2uiv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glProgramUniform3uiv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glProgramUniform4uiv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glProgramUniformMatrix2fv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glProgramUniformMatrix3fv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glProgramUniformMatrix4fv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glProgramUniformMatrix2x3fv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glProgramUniformMatrix3x2fv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glProgramUniformMatrix2x4fv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glProgramUniformMatrix4x2fv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glProgramUniformMatrix3x4fv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glProgramUniformMatrix4x3fv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glGetProgramInterfaceiv_client_proc_t) (void * ctx, GLuint, GLenum, GLenum, GLint*);
+typedef void (gl2_APIENTRY *glGetProgramResourceiv_client_proc_t) (void * ctx, GLuint, GLenum, GLuint, GLsizei, const GLenum*, GLsizei, GLsizei*, GLint*);
+typedef GLuint (gl2_APIENTRY *glGetProgramResourceIndex_client_proc_t) (void * ctx, GLuint, GLenum, const char*);
+typedef GLint (gl2_APIENTRY *glGetProgramResourceLocation_client_proc_t) (void * ctx, GLuint, GLenum, const char*);
+typedef void (gl2_APIENTRY *glGetProgramResourceName_client_proc_t) (void * ctx, GLuint, GLenum, GLuint, GLsizei, GLsizei*, char*);
+typedef void (gl2_APIENTRY *glBindImageTexture_client_proc_t) (void * ctx, GLuint, GLuint, GLint, GLboolean, GLint, GLenum, GLenum);
+typedef void (gl2_APIENTRY *glDispatchCompute_client_proc_t) (void * ctx, GLuint, GLuint, GLuint);
+typedef void (gl2_APIENTRY *glDispatchComputeIndirect_client_proc_t) (void * ctx, GLintptr);
+typedef void (gl2_APIENTRY *glBindVertexBuffer_client_proc_t) (void * ctx, GLuint, GLuint, GLintptr, GLintptr);
+typedef void (gl2_APIENTRY *glVertexAttribBinding_client_proc_t) (void * ctx, GLuint, GLuint);
+typedef void (gl2_APIENTRY *glVertexAttribFormat_client_proc_t) (void * ctx, GLuint, GLint, GLenum, GLboolean, GLuint);
+typedef void (gl2_APIENTRY *glVertexAttribIFormat_client_proc_t) (void * ctx, GLuint, GLint, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glVertexBindingDivisor_client_proc_t) (void * ctx, GLuint, GLuint);
+typedef void (gl2_APIENTRY *glDrawArraysIndirect_client_proc_t) (void * ctx, GLenum, const void*);
+typedef void (gl2_APIENTRY *glDrawArraysIndirectDataAEMU_client_proc_t) (void * ctx, GLenum, const void*, GLuint);
+typedef void (gl2_APIENTRY *glDrawArraysIndirectOffsetAEMU_client_proc_t) (void * ctx, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glDrawElementsIndirect_client_proc_t) (void * ctx, GLenum, GLenum, const void*);
+typedef void (gl2_APIENTRY *glDrawElementsIndirectDataAEMU_client_proc_t) (void * ctx, GLenum, GLenum, const void*, GLuint);
+typedef void (gl2_APIENTRY *glDrawElementsIndirectOffsetAEMU_client_proc_t) (void * ctx, GLenum, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glTexStorage2DMultisample_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLboolean);
+typedef void (gl2_APIENTRY *glSampleMaski_client_proc_t) (void * ctx, GLuint, GLbitfield);
+typedef void (gl2_APIENTRY *glGetMultisamplefv_client_proc_t) (void * ctx, GLenum, GLuint, GLfloat*);
+typedef void (gl2_APIENTRY *glFramebufferParameteri_client_proc_t) (void * ctx, GLenum, GLenum, GLint);
+typedef void (gl2_APIENTRY *glGetFramebufferParameteriv_client_proc_t) (void * ctx, GLenum, GLenum, GLint*);
+typedef void (gl2_APIENTRY *glGetTexLevelParameterfv_client_proc_t) (void * ctx, GLenum, GLint, GLenum, GLfloat*);
+typedef void (gl2_APIENTRY *glGetTexLevelParameteriv_client_proc_t) (void * ctx, GLenum, GLint, GLenum, GLint*);
+typedef void (gl2_APIENTRY *glMapBufferRangeDMA_client_proc_t) (void * ctx, GLenum, GLintptr, GLsizeiptr, GLbitfield, uint64_t);
+typedef void (gl2_APIENTRY *glUnmapBufferDMA_client_proc_t) (void * ctx, GLenum, GLintptr, GLsizeiptr, GLbitfield, uint64_t, GLboolean*);
+typedef uint64_t (gl2_APIENTRY *glMapBufferRangeDirect_client_proc_t) (void * ctx, GLenum, GLintptr, GLsizeiptr, GLbitfield, uint64_t);
+typedef void (gl2_APIENTRY *glUnmapBufferDirect_client_proc_t) (void * ctx, GLenum, GLintptr, GLsizeiptr, GLbitfield, uint64_t, uint64_t, GLboolean*);
+typedef void (gl2_APIENTRY *glFlushMappedBufferRangeDirect_client_proc_t) (void * ctx, GLenum, GLintptr, GLsizeiptr, GLbitfield);
+typedef GLenum (gl2_APIENTRY *glGetGraphicsResetStatusEXT_client_proc_t) (void * ctx);
+typedef void (gl2_APIENTRY *glReadnPixelsEXT_client_proc_t) (void * ctx, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLsizei, GLvoid*);
+typedef void (gl2_APIENTRY *glGetnUniformfvEXT_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, GLfloat*);
+typedef void (gl2_APIENTRY *glGetnUniformivEXT_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, GLint*);
+typedef void (gl2_APIENTRY *glDrawArraysNullAEMU_client_proc_t) (void * ctx, GLenum, GLint, GLsizei);
+typedef void (gl2_APIENTRY *glDrawElementsNullAEMU_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, const GLvoid*);
+typedef void (gl2_APIENTRY *glDrawElementsOffsetNullAEMU_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glDrawElementsDataNullAEMU_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, void*, GLuint);
+typedef void (gl2_APIENTRY *glUnmapBufferAsyncAEMU_client_proc_t) (void * ctx, GLenum, GLintptr, GLsizeiptr, GLbitfield, void*, GLboolean*);
+typedef void (gl2_APIENTRY *glFlushMappedBufferRangeAEMU2_client_proc_t) (void * ctx, GLenum, GLintptr, GLsizeiptr, GLbitfield, void*);
+typedef GLboolean (gl2_APIENTRY *glBufferDataSyncAEMU_client_proc_t) (void * ctx, GLenum, GLsizeiptr, const GLvoid*, GLenum);
+typedef void (gl2_APIENTRY *glTexBufferOES_client_proc_t) (void * ctx, GLenum, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glTexBufferRangeOES_client_proc_t) (void * ctx, GLenum, GLenum, GLuint, GLintptr, GLsizeiptr);
+typedef void (gl2_APIENTRY *glTexBufferEXT_client_proc_t) (void * ctx, GLenum, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glTexBufferRangeEXT_client_proc_t) (void * ctx, GLenum, GLenum, GLuint, GLintptr, GLsizeiptr);
+typedef void (gl2_APIENTRY *glEnableiEXT_client_proc_t) (void * ctx, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glDisableiEXT_client_proc_t) (void * ctx, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glBlendEquationiEXT_client_proc_t) (void * ctx, GLuint, GLenum);
+typedef void (gl2_APIENTRY *glBlendEquationSeparateiEXT_client_proc_t) (void * ctx, GLuint, GLenum, GLenum);
+typedef void (gl2_APIENTRY *glBlendFunciEXT_client_proc_t) (void * ctx, GLuint, GLenum, GLenum);
+typedef void (gl2_APIENTRY *glBlendFuncSeparateiEXT_client_proc_t) (void * ctx, GLuint, GLenum, GLenum, GLenum, GLenum);
+typedef void (gl2_APIENTRY *glColorMaskiEXT_client_proc_t) (void * ctx, GLuint, GLboolean, GLboolean, GLboolean, GLboolean);
+typedef GLboolean (gl2_APIENTRY *glIsEnablediEXT_client_proc_t) (void * ctx, GLenum, GLuint);
+
+
+#endif
diff --git a/system/GLESv2_enc/gl2_enc.cpp b/system/GLESv2_enc/gl2_enc.cpp
new file mode 100644
index 0000000..2b0dc33
--- /dev/null
+++ b/system/GLESv2_enc/gl2_enc.cpp
@@ -0,0 +1,13141 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+
+
+#include <string.h>
+#include "gl2_opcodes.h"
+
+#include "gl2_enc.h"
+
+
+#include <vector>
+
+#include <stdio.h>
+
+#include "aemu/base/Tracing.h"
+
+#include "EncoderDebug.h"
+
+using gfxstream::IOStream;
+
+namespace {
+
+void enc_unsupported()
+{
+	ALOGE("Function is unsupported\n");
+}
+
+void glActiveTexture_enc(void *self , GLenum texture)
+{
+	ENCODER_DEBUG_LOG("glActiveTexture(texture:0x%08x)", texture);
+	AEMU_SCOPED_TRACE("glActiveTexture encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glActiveTexture;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &texture, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glAttachShader_enc(void *self , GLuint program, GLuint shader)
+{
+	ENCODER_DEBUG_LOG("glAttachShader(program:%u, shader:%u)", program, shader);
+	AEMU_SCOPED_TRACE("glAttachShader encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glAttachShader;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &shader, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBindAttribLocation_enc(void *self , GLuint program, GLuint index, const GLchar* name)
+{
+	ENCODER_DEBUG_LOG("glBindAttribLocation(program:%u, index:%u, name:0x%08x)", program, index, name);
+	AEMU_SCOPED_TRACE("glBindAttribLocation encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_name =  (strlen(name) + 1);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_name + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBindAttribLocation;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &index, 4); ptr += 4;
+	memcpy(ptr, &__size_name, 4); ptr += 4;
+	memcpy(ptr, name, __size_name);ptr += __size_name;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBindBuffer_enc(void *self , GLenum target, GLuint buffer)
+{
+	ENCODER_DEBUG_LOG("glBindBuffer(target:0x%08x, buffer:%u)", target, buffer);
+	AEMU_SCOPED_TRACE("glBindBuffer encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBindBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &buffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBindFramebuffer_enc(void *self , GLenum target, GLuint framebuffer)
+{
+	ENCODER_DEBUG_LOG("glBindFramebuffer(target:0x%08x, framebuffer:%u)", target, framebuffer);
+	AEMU_SCOPED_TRACE("glBindFramebuffer encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBindFramebuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &framebuffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBindRenderbuffer_enc(void *self , GLenum target, GLuint renderbuffer)
+{
+	ENCODER_DEBUG_LOG("glBindRenderbuffer(target:0x%08x, renderbuffer:%u)", target, renderbuffer);
+	AEMU_SCOPED_TRACE("glBindRenderbuffer encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBindRenderbuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &renderbuffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBindTexture_enc(void *self , GLenum target, GLuint texture)
+{
+	ENCODER_DEBUG_LOG("glBindTexture(target:0x%08x, texture:%u)", target, texture);
+	AEMU_SCOPED_TRACE("glBindTexture encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBindTexture;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &texture, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBlendColor_enc(void *self , GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+{
+	ENCODER_DEBUG_LOG("glBlendColor(red:%f, green:%f, blue:%f, alpha:%f)", red, green, blue, alpha);
+	AEMU_SCOPED_TRACE("glBlendColor encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBlendColor;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &red, 4); ptr += 4;
+		memcpy(ptr, &green, 4); ptr += 4;
+		memcpy(ptr, &blue, 4); ptr += 4;
+		memcpy(ptr, &alpha, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBlendEquation_enc(void *self , GLenum mode)
+{
+	ENCODER_DEBUG_LOG("glBlendEquation(mode:0x%08x)", mode);
+	AEMU_SCOPED_TRACE("glBlendEquation encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBlendEquation;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBlendEquationSeparate_enc(void *self , GLenum modeRGB, GLenum modeAlpha)
+{
+	ENCODER_DEBUG_LOG("glBlendEquationSeparate(modeRGB:0x%08x, modeAlpha:0x%08x)", modeRGB, modeAlpha);
+	AEMU_SCOPED_TRACE("glBlendEquationSeparate encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBlendEquationSeparate;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &modeRGB, 4); ptr += 4;
+		memcpy(ptr, &modeAlpha, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBlendFunc_enc(void *self , GLenum sfactor, GLenum dfactor)
+{
+	ENCODER_DEBUG_LOG("glBlendFunc(sfactor:0x%08x, dfactor:0x%08x)", sfactor, dfactor);
+	AEMU_SCOPED_TRACE("glBlendFunc encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBlendFunc;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &sfactor, 4); ptr += 4;
+		memcpy(ptr, &dfactor, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBlendFuncSeparate_enc(void *self , GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
+{
+	ENCODER_DEBUG_LOG("glBlendFuncSeparate(srcRGB:0x%08x, dstRGB:0x%08x, srcAlpha:0x%08x, dstAlpha:0x%08x)", srcRGB, dstRGB, srcAlpha, dstAlpha);
+	AEMU_SCOPED_TRACE("glBlendFuncSeparate encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBlendFuncSeparate;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &srcRGB, 4); ptr += 4;
+		memcpy(ptr, &dstRGB, 4); ptr += 4;
+		memcpy(ptr, &srcAlpha, 4); ptr += 4;
+		memcpy(ptr, &dstAlpha, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBufferData_enc(void *self , GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage)
+{
+	ENCODER_DEBUG_LOG("glBufferData(target:0x%08x, size:0x%08lx, data:0x%08x, usage:0x%08x)", target, size, data, usage);
+	AEMU_SCOPED_TRACE("glBufferData encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data = ((data != NULL) ?  size : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_data + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(8 + 4 + 4);
+	ptr = buf;
+	int tmp = OP_glBufferData;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &size, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	stream->flush();
+	stream->writeFully(&__size_data,4);
+	if (useChecksum) checksumCalculator->addBuffer(&__size_data,4);
+	if (data != NULL) {
+		stream->writeFully(data, __size_data);
+		if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
+	}
+	buf = stream->alloc(4);
+	ptr = buf;
+		memcpy(ptr, &usage, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	buf = stream->alloc(checksumSize);
+	if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
+
+}
+
+void glBufferSubData_enc(void *self , GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data)
+{
+	ENCODER_DEBUG_LOG("glBufferSubData(target:0x%08x, offset:0x%08lx, size:0x%08lx, data:0x%08x)", target, offset, size, data);
+	AEMU_SCOPED_TRACE("glBufferSubData encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data = ((data != NULL) ?  size : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_data + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(8 + 4 + 4 + 4);
+	ptr = buf;
+	int tmp = OP_glBufferSubData;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+		memcpy(ptr, &size, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	stream->flush();
+	stream->writeFully(&__size_data,4);
+	if (useChecksum) checksumCalculator->addBuffer(&__size_data,4);
+	if (data != NULL) {
+		stream->writeFully(data, __size_data);
+		if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
+	}
+	buf = stream->alloc(checksumSize);
+	if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
+
+}
+
+GLenum glCheckFramebufferStatus_enc(void *self , GLenum target)
+{
+	ENCODER_DEBUG_LOG("glCheckFramebufferStatus(target:0x%08x)", target);
+	AEMU_SCOPED_TRACE("glCheckFramebufferStatus encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glCheckFramebufferStatus;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLenum retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glCheckFramebufferStatus: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glClear_enc(void *self , GLbitfield mask)
+{
+	ENCODER_DEBUG_LOG("glClear(mask:0x%08x)", mask);
+	AEMU_SCOPED_TRACE("glClear encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClear;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mask, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glClearColor_enc(void *self , GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+{
+	ENCODER_DEBUG_LOG("glClearColor(red:%f, green:%f, blue:%f, alpha:%f)", red, green, blue, alpha);
+	AEMU_SCOPED_TRACE("glClearColor encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClearColor;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &red, 4); ptr += 4;
+		memcpy(ptr, &green, 4); ptr += 4;
+		memcpy(ptr, &blue, 4); ptr += 4;
+		memcpy(ptr, &alpha, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glClearDepthf_enc(void *self , GLclampf depth)
+{
+	ENCODER_DEBUG_LOG("glClearDepthf(depth:%f)", depth);
+	AEMU_SCOPED_TRACE("glClearDepthf encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClearDepthf;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &depth, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glClearStencil_enc(void *self , GLint s)
+{
+	ENCODER_DEBUG_LOG("glClearStencil(s:%d)", s);
+	AEMU_SCOPED_TRACE("glClearStencil encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClearStencil;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &s, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glColorMask_enc(void *self , GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
+{
+	ENCODER_DEBUG_LOG("glColorMask(red:%d, green:%d, blue:%d, alpha:%d)", red, green, blue, alpha);
+	AEMU_SCOPED_TRACE("glColorMask encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 1 + 1 + 1 + 1;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glColorMask;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &red, 1); ptr += 1;
+		memcpy(ptr, &green, 1); ptr += 1;
+		memcpy(ptr, &blue, 1); ptr += 1;
+		memcpy(ptr, &alpha, 1); ptr += 1;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glCompileShader_enc(void *self , GLuint shader)
+{
+	ENCODER_DEBUG_LOG("glCompileShader(shader:%u)", shader);
+	AEMU_SCOPED_TRACE("glCompileShader encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glCompileShader;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &shader, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glCompressedTexImage2D_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data)
+{
+	ENCODER_DEBUG_LOG("glCompressedTexImage2D(target:0x%08x, level:%d, internalformat:0x%08x, width:%d, height:%d, border:%d, imageSize:%d, data:0x%08x)", target, level, internalformat, width, height, border, imageSize, data);
+	AEMU_SCOPED_TRACE("glCompressedTexImage2D encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data = ((data != NULL) ?  imageSize : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_data + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
+	ptr = buf;
+	int tmp = OP_glCompressedTexImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &internalformat, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &border, 4); ptr += 4;
+		memcpy(ptr, &imageSize, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	stream->flush();
+	stream->writeFully(&__size_data,4);
+	if (useChecksum) checksumCalculator->addBuffer(&__size_data,4);
+	if (data != NULL) {
+		stream->writeFully(data, __size_data);
+		if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
+	}
+	buf = stream->alloc(checksumSize);
+	if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
+
+}
+
+void glCompressedTexSubImage2D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data)
+{
+	ENCODER_DEBUG_LOG("glCompressedTexSubImage2D(target:0x%08x, level:%d, xoffset:%d, yoffset:%d, width:%d, height:%d, format:0x%08x, imageSize:%d, data:0x%08x)", target, level, xoffset, yoffset, width, height, format, imageSize, data);
+	AEMU_SCOPED_TRACE("glCompressedTexSubImage2D encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data = ((data != NULL) ?  imageSize : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_data + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
+	ptr = buf;
+	int tmp = OP_glCompressedTexSubImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &xoffset, 4); ptr += 4;
+		memcpy(ptr, &yoffset, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &imageSize, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	stream->flush();
+	stream->writeFully(&__size_data,4);
+	if (useChecksum) checksumCalculator->addBuffer(&__size_data,4);
+	if (data != NULL) {
+		stream->writeFully(data, __size_data);
+		if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
+	}
+	buf = stream->alloc(checksumSize);
+	if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
+
+}
+
+void glCopyTexImage2D_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
+{
+	ENCODER_DEBUG_LOG("glCopyTexImage2D(target:0x%08x, level:%d, internalformat:0x%08x, x:%d, y:%d, width:%d, height:%d, border:%d)", target, level, internalformat, x, y, width, height, border);
+	AEMU_SCOPED_TRACE("glCopyTexImage2D encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glCopyTexImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &internalformat, 4); ptr += 4;
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &border, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glCopyTexSubImage2D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+	ENCODER_DEBUG_LOG("glCopyTexSubImage2D(target:0x%08x, level:%d, xoffset:%d, yoffset:%d, x:%d, y:%d, width:%d, height:%d)", target, level, xoffset, yoffset, x, y, width, height);
+	AEMU_SCOPED_TRACE("glCopyTexSubImage2D encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glCopyTexSubImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &xoffset, 4); ptr += 4;
+		memcpy(ptr, &yoffset, 4); ptr += 4;
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+GLuint glCreateProgram_enc(void *self )
+{
+	ENCODER_DEBUG_LOG("glCreateProgram()");
+	AEMU_SCOPED_TRACE("glCreateProgram encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glCreateProgram;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLuint retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glCreateProgram: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+GLuint glCreateShader_enc(void *self , GLenum type)
+{
+	ENCODER_DEBUG_LOG("glCreateShader(type:0x%08x)", type);
+	AEMU_SCOPED_TRACE("glCreateShader encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glCreateShader;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &type, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLuint retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glCreateShader: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glCullFace_enc(void *self , GLenum mode)
+{
+	ENCODER_DEBUG_LOG("glCullFace(mode:0x%08x)", mode);
+	AEMU_SCOPED_TRACE("glCullFace encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glCullFace;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDeleteBuffers_enc(void *self , GLsizei n, const GLuint* buffers)
+{
+	ENCODER_DEBUG_LOG("glDeleteBuffers(n:%d, buffers:0x%08x)", n, buffers);
+	AEMU_SCOPED_TRACE("glDeleteBuffers encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_buffers =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_buffers + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDeleteBuffers;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_buffers, 4); ptr += 4;
+	memcpy(ptr, buffers, __size_buffers);ptr += __size_buffers;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDeleteFramebuffers_enc(void *self , GLsizei n, const GLuint* framebuffers)
+{
+	ENCODER_DEBUG_LOG("glDeleteFramebuffers(n:%d, framebuffers:0x%08x)", n, framebuffers);
+	AEMU_SCOPED_TRACE("glDeleteFramebuffers encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_framebuffers =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_framebuffers + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDeleteFramebuffers;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_framebuffers, 4); ptr += 4;
+	memcpy(ptr, framebuffers, __size_framebuffers);ptr += __size_framebuffers;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDeleteProgram_enc(void *self , GLuint program)
+{
+	ENCODER_DEBUG_LOG("glDeleteProgram(program:%u)", program);
+	AEMU_SCOPED_TRACE("glDeleteProgram encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDeleteProgram;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDeleteRenderbuffers_enc(void *self , GLsizei n, const GLuint* renderbuffers)
+{
+	ENCODER_DEBUG_LOG("glDeleteRenderbuffers(n:%d, renderbuffers:0x%08x)", n, renderbuffers);
+	AEMU_SCOPED_TRACE("glDeleteRenderbuffers encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_renderbuffers =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_renderbuffers + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDeleteRenderbuffers;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_renderbuffers, 4); ptr += 4;
+	memcpy(ptr, renderbuffers, __size_renderbuffers);ptr += __size_renderbuffers;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDeleteShader_enc(void *self , GLuint shader)
+{
+	ENCODER_DEBUG_LOG("glDeleteShader(shader:%u)", shader);
+	AEMU_SCOPED_TRACE("glDeleteShader encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDeleteShader;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &shader, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDeleteTextures_enc(void *self , GLsizei n, const GLuint* textures)
+{
+	ENCODER_DEBUG_LOG("glDeleteTextures(n:%d, textures:0x%08x)", n, textures);
+	AEMU_SCOPED_TRACE("glDeleteTextures encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_textures =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_textures + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDeleteTextures;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_textures, 4); ptr += 4;
+	memcpy(ptr, textures, __size_textures);ptr += __size_textures;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDepthFunc_enc(void *self , GLenum func)
+{
+	ENCODER_DEBUG_LOG("glDepthFunc(func:0x%08x)", func);
+	AEMU_SCOPED_TRACE("glDepthFunc encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDepthFunc;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &func, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDepthMask_enc(void *self , GLboolean flag)
+{
+	ENCODER_DEBUG_LOG("glDepthMask(flag:%d)", flag);
+	AEMU_SCOPED_TRACE("glDepthMask encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 1;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDepthMask;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &flag, 1); ptr += 1;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDepthRangef_enc(void *self , GLclampf zNear, GLclampf zFar)
+{
+	ENCODER_DEBUG_LOG("glDepthRangef(zNear:%f, zFar:%f)", zNear, zFar);
+	AEMU_SCOPED_TRACE("glDepthRangef encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDepthRangef;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &zNear, 4); ptr += 4;
+		memcpy(ptr, &zFar, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDetachShader_enc(void *self , GLuint program, GLuint shader)
+{
+	ENCODER_DEBUG_LOG("glDetachShader(program:%u, shader:%u)", program, shader);
+	AEMU_SCOPED_TRACE("glDetachShader encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDetachShader;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &shader, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDisable_enc(void *self , GLenum cap)
+{
+	ENCODER_DEBUG_LOG("glDisable(cap:0x%08x)", cap);
+	AEMU_SCOPED_TRACE("glDisable encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDisable;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &cap, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDisableVertexAttribArray_enc(void *self , GLuint index)
+{
+	ENCODER_DEBUG_LOG("glDisableVertexAttribArray(index:%u)", index);
+	AEMU_SCOPED_TRACE("glDisableVertexAttribArray encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDisableVertexAttribArray;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &index, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawArrays_enc(void *self , GLenum mode, GLint first, GLsizei count)
+{
+	ENCODER_DEBUG_LOG("glDrawArrays(mode:0x%08x, first:%d, count:%d)", mode, first, count);
+	AEMU_SCOPED_TRACE("glDrawArrays encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawArrays;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+		memcpy(ptr, &first, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glEnable_enc(void *self , GLenum cap)
+{
+	ENCODER_DEBUG_LOG("glEnable(cap:0x%08x)", cap);
+	AEMU_SCOPED_TRACE("glEnable encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glEnable;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &cap, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glEnableVertexAttribArray_enc(void *self , GLuint index)
+{
+	ENCODER_DEBUG_LOG("glEnableVertexAttribArray(index:%u)", index);
+	AEMU_SCOPED_TRACE("glEnableVertexAttribArray encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glEnableVertexAttribArray;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &index, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glFinish_enc(void *self )
+{
+	ENCODER_DEBUG_LOG("glFinish()");
+	AEMU_SCOPED_TRACE("glFinish encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFinish;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glFlush_enc(void *self )
+{
+	ENCODER_DEBUG_LOG("glFlush()");
+	AEMU_SCOPED_TRACE("glFlush encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFlush;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glFramebufferRenderbuffer_enc(void *self , GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
+{
+	ENCODER_DEBUG_LOG("glFramebufferRenderbuffer(target:0x%08x, attachment:0x%08x, renderbuffertarget:0x%08x, renderbuffer:%u)", target, attachment, renderbuffertarget, renderbuffer);
+	AEMU_SCOPED_TRACE("glFramebufferRenderbuffer encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFramebufferRenderbuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &attachment, 4); ptr += 4;
+		memcpy(ptr, &renderbuffertarget, 4); ptr += 4;
+		memcpy(ptr, &renderbuffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glFramebufferTexture2D_enc(void *self , GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
+{
+	ENCODER_DEBUG_LOG("glFramebufferTexture2D(target:0x%08x, attachment:0x%08x, textarget:0x%08x, texture:%u, level:%d)", target, attachment, textarget, texture, level);
+	AEMU_SCOPED_TRACE("glFramebufferTexture2D encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFramebufferTexture2D;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &attachment, 4); ptr += 4;
+		memcpy(ptr, &textarget, 4); ptr += 4;
+		memcpy(ptr, &texture, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glFrontFace_enc(void *self , GLenum mode)
+{
+	ENCODER_DEBUG_LOG("glFrontFace(mode:0x%08x)", mode);
+	AEMU_SCOPED_TRACE("glFrontFace encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFrontFace;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGenBuffers_enc(void *self , GLsizei n, GLuint* buffers)
+{
+	ENCODER_DEBUG_LOG("glGenBuffers(n:%d, buffers:0x%08x)", n, buffers);
+	AEMU_SCOPED_TRACE("glGenBuffers encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_buffers =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGenBuffers;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_buffers, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(buffers, __size_buffers);
+	if (useChecksum) checksumCalculator->addBuffer(buffers, __size_buffers);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGenBuffers: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGenerateMipmap_enc(void *self , GLenum target)
+{
+	ENCODER_DEBUG_LOG("glGenerateMipmap(target:0x%08x)", target);
+	AEMU_SCOPED_TRACE("glGenerateMipmap encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGenerateMipmap;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGenFramebuffers_enc(void *self , GLsizei n, GLuint* framebuffers)
+{
+	ENCODER_DEBUG_LOG("glGenFramebuffers(n:%d, framebuffers:0x%08x)", n, framebuffers);
+	AEMU_SCOPED_TRACE("glGenFramebuffers encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_framebuffers =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGenFramebuffers;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_framebuffers, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(framebuffers, __size_framebuffers);
+	if (useChecksum) checksumCalculator->addBuffer(framebuffers, __size_framebuffers);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGenFramebuffers: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGenRenderbuffers_enc(void *self , GLsizei n, GLuint* renderbuffers)
+{
+	ENCODER_DEBUG_LOG("glGenRenderbuffers(n:%d, renderbuffers:0x%08x)", n, renderbuffers);
+	AEMU_SCOPED_TRACE("glGenRenderbuffers encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_renderbuffers =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGenRenderbuffers;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_renderbuffers, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(renderbuffers, __size_renderbuffers);
+	if (useChecksum) checksumCalculator->addBuffer(renderbuffers, __size_renderbuffers);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGenRenderbuffers: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGenTextures_enc(void *self , GLsizei n, GLuint* textures)
+{
+	ENCODER_DEBUG_LOG("glGenTextures(n:%d, textures:0x%08x)", n, textures);
+	AEMU_SCOPED_TRACE("glGenTextures encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_textures =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGenTextures;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_textures, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(textures, __size_textures);
+	if (useChecksum) checksumCalculator->addBuffer(textures, __size_textures);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGenTextures: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetActiveAttrib_enc(void *self , GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
+{
+	ENCODER_DEBUG_LOG("glGetActiveAttrib(program:%u, index:%u, bufsize:%d, length:0x%08x, size:0x%08x, type:0x%08x, name:0x%08x)", program, index, bufsize, length, size, type, name);
+	AEMU_SCOPED_TRACE("glGetActiveAttrib encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_length = ((length != NULL) ?  (sizeof(GLsizei)) : 0);
+	const unsigned int __size_size = ((size != NULL) ?  (sizeof(GLint)) : 0);
+	const unsigned int __size_type = ((type != NULL) ?  (sizeof(GLenum)) : 0);
+	const unsigned int __size_name = ((name != NULL) ?  bufsize : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 0 + 0 + 0 + 0 + 4*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetActiveAttrib;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &bufsize, 4); ptr += 4;
+	memcpy(ptr, &__size_length, 4); ptr += 4;
+	memcpy(ptr, &__size_size, 4); ptr += 4;
+	memcpy(ptr, &__size_type, 4); ptr += 4;
+	memcpy(ptr, &__size_name, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	if (length != NULL) {
+		stream->readback(length, __size_length);
+		if (useChecksum) checksumCalculator->addBuffer(length, __size_length);
+	}
+	if (size != NULL) {
+		stream->readback(size, __size_size);
+		if (useChecksum) checksumCalculator->addBuffer(size, __size_size);
+	}
+	if (type != NULL) {
+		stream->readback(type, __size_type);
+		if (useChecksum) checksumCalculator->addBuffer(type, __size_type);
+	}
+	if (name != NULL) {
+		stream->readback(name, __size_name);
+		if (useChecksum) checksumCalculator->addBuffer(name, __size_name);
+	}
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetActiveAttrib: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetActiveUniform_enc(void *self , GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
+{
+	ENCODER_DEBUG_LOG("glGetActiveUniform(program:%u, index:%u, bufsize:%d, length:0x%08x, size:0x%08x, type:0x%08x, name:0x%08x)", program, index, bufsize, length, size, type, name);
+	AEMU_SCOPED_TRACE("glGetActiveUniform encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_length = ((length != NULL) ?  (sizeof(GLsizei)) : 0);
+	const unsigned int __size_size = ((size != NULL) ?  (sizeof(GLint)) : 0);
+	const unsigned int __size_type = ((type != NULL) ?  (sizeof(GLenum)) : 0);
+	const unsigned int __size_name = ((name != NULL) ?  bufsize : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 0 + 0 + 0 + 0 + 4*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetActiveUniform;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &bufsize, 4); ptr += 4;
+	memcpy(ptr, &__size_length, 4); ptr += 4;
+	memcpy(ptr, &__size_size, 4); ptr += 4;
+	memcpy(ptr, &__size_type, 4); ptr += 4;
+	memcpy(ptr, &__size_name, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	if (length != NULL) {
+		stream->readback(length, __size_length);
+		if (useChecksum) checksumCalculator->addBuffer(length, __size_length);
+	}
+	if (size != NULL) {
+		stream->readback(size, __size_size);
+		if (useChecksum) checksumCalculator->addBuffer(size, __size_size);
+	}
+	if (type != NULL) {
+		stream->readback(type, __size_type);
+		if (useChecksum) checksumCalculator->addBuffer(type, __size_type);
+	}
+	if (name != NULL) {
+		stream->readback(name, __size_name);
+		if (useChecksum) checksumCalculator->addBuffer(name, __size_name);
+	}
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetActiveUniform: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetAttachedShaders_enc(void *self , GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
+{
+	ENCODER_DEBUG_LOG("glGetAttachedShaders(program:%u, maxcount:%d, count:0x%08x, shaders:0x%08x)", program, maxcount, count, shaders);
+	AEMU_SCOPED_TRACE("glGetAttachedShaders encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_count = ((count != NULL) ?  (sizeof(GLsizei)) : 0);
+	const unsigned int __size_shaders =  (maxcount*sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetAttachedShaders;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &maxcount, 4); ptr += 4;
+	memcpy(ptr, &__size_count, 4); ptr += 4;
+	memcpy(ptr, &__size_shaders, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	if (count != NULL) {
+		stream->readback(count, __size_count);
+		if (useChecksum) checksumCalculator->addBuffer(count, __size_count);
+	}
+	stream->readback(shaders, __size_shaders);
+	if (useChecksum) checksumCalculator->addBuffer(shaders, __size_shaders);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetAttachedShaders: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+int glGetAttribLocation_enc(void *self , GLuint program, const GLchar* name)
+{
+	ENCODER_DEBUG_LOG("glGetAttribLocation(program:%u, name:0x%08x)", program, name);
+	AEMU_SCOPED_TRACE("glGetAttribLocation encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_name =  (strlen(name) + 1);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_name + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetAttribLocation;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+	memcpy(ptr, &__size_name, 4); ptr += 4;
+	memcpy(ptr, name, __size_name);ptr += __size_name;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	int retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetAttribLocation: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glGetBooleanv_enc(void *self , GLenum pname, GLboolean* params)
+{
+	ENCODER_DEBUG_LOG("glGetBooleanv(pname:0x%08x, params:0x%08x)", pname, params);
+	AEMU_SCOPED_TRACE("glGetBooleanv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLboolean));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetBooleanv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetBooleanv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetBufferParameteriv_enc(void *self , GLenum target, GLenum pname, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glGetBufferParameteriv(target:0x%08x, pname:0x%08x, params:0x%08x)", target, pname, params);
+	AEMU_SCOPED_TRACE("glGetBufferParameteriv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetBufferParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetBufferParameteriv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+GLenum glGetError_enc(void *self )
+{
+	ENCODER_DEBUG_LOG("glGetError()");
+	AEMU_SCOPED_TRACE("glGetError encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetError;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLenum retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetError: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glGetFloatv_enc(void *self , GLenum pname, GLfloat* params)
+{
+	ENCODER_DEBUG_LOG("glGetFloatv(pname:0x%08x, params:0x%08x)", pname, params);
+	AEMU_SCOPED_TRACE("glGetFloatv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetFloatv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetFloatv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetFramebufferAttachmentParameteriv_enc(void *self , GLenum target, GLenum attachment, GLenum pname, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glGetFramebufferAttachmentParameteriv(target:0x%08x, attachment:0x%08x, pname:0x%08x, params:0x%08x)", target, attachment, pname, params);
+	AEMU_SCOPED_TRACE("glGetFramebufferAttachmentParameteriv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetFramebufferAttachmentParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &attachment, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetFramebufferAttachmentParameteriv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetIntegerv_enc(void *self , GLenum pname, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glGetIntegerv(pname:0x%08x, params:0x%08x)", pname, params);
+	AEMU_SCOPED_TRACE("glGetIntegerv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetIntegerv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetIntegerv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetProgramiv_enc(void *self , GLuint program, GLenum pname, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glGetProgramiv(program:%u, pname:0x%08x, params:0x%08x)", program, pname, params);
+	AEMU_SCOPED_TRACE("glGetProgramiv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetProgramiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetProgramiv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetProgramInfoLog_enc(void *self , GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog)
+{
+	ENCODER_DEBUG_LOG("glGetProgramInfoLog(program:%u, bufsize:%d, length:0x%08x, infolog:0x%08x)", program, bufsize, length, infolog);
+	AEMU_SCOPED_TRACE("glGetProgramInfoLog encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_length = ((length != NULL) ?  sizeof(GLsizei) : 0);
+	const unsigned int __size_infolog =  bufsize;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetProgramInfoLog;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &bufsize, 4); ptr += 4;
+	memcpy(ptr, &__size_length, 4); ptr += 4;
+	memcpy(ptr, &__size_infolog, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	if (length != NULL) {
+		stream->readback(length, __size_length);
+		if (useChecksum) checksumCalculator->addBuffer(length, __size_length);
+	}
+	stream->readback(infolog, __size_infolog);
+	if (useChecksum) checksumCalculator->addBuffer(infolog, __size_infolog);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetProgramInfoLog: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetRenderbufferParameteriv_enc(void *self , GLenum target, GLenum pname, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glGetRenderbufferParameteriv(target:0x%08x, pname:0x%08x, params:0x%08x)", target, pname, params);
+	AEMU_SCOPED_TRACE("glGetRenderbufferParameteriv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  sizeof(GLint);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetRenderbufferParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetRenderbufferParameteriv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetShaderiv_enc(void *self , GLuint shader, GLenum pname, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glGetShaderiv(shader:%u, pname:0x%08x, params:0x%08x)", shader, pname, params);
+	AEMU_SCOPED_TRACE("glGetShaderiv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  sizeof(GLint);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetShaderiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &shader, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetShaderiv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetShaderInfoLog_enc(void *self , GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog)
+{
+	ENCODER_DEBUG_LOG("glGetShaderInfoLog(shader:%u, bufsize:%d, length:0x%08x, infolog:0x%08x)", shader, bufsize, length, infolog);
+	AEMU_SCOPED_TRACE("glGetShaderInfoLog encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_length = ((length != NULL) ?  (sizeof(GLsizei)) : 0);
+	const unsigned int __size_infolog =  bufsize;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetShaderInfoLog;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &shader, 4); ptr += 4;
+		memcpy(ptr, &bufsize, 4); ptr += 4;
+	memcpy(ptr, &__size_length, 4); ptr += 4;
+	memcpy(ptr, &__size_infolog, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	if (length != NULL) {
+		stream->readback(length, __size_length);
+		if (useChecksum) checksumCalculator->addBuffer(length, __size_length);
+	}
+	stream->readback(infolog, __size_infolog);
+	if (useChecksum) checksumCalculator->addBuffer(infolog, __size_infolog);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetShaderInfoLog: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetShaderPrecisionFormat_enc(void *self , GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
+{
+	ENCODER_DEBUG_LOG("glGetShaderPrecisionFormat(shadertype:0x%08x, precisiontype:0x%08x, range:0x%08x, precision:0x%08x)", shadertype, precisiontype, range, precision);
+	AEMU_SCOPED_TRACE("glGetShaderPrecisionFormat encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_range =  (2 * sizeof(GLint));
+	const unsigned int __size_precision =  (sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetShaderPrecisionFormat;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &shadertype, 4); ptr += 4;
+		memcpy(ptr, &precisiontype, 4); ptr += 4;
+	memcpy(ptr, &__size_range, 4); ptr += 4;
+	memcpy(ptr, &__size_precision, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(range, __size_range);
+	if (useChecksum) checksumCalculator->addBuffer(range, __size_range);
+	stream->readback(precision, __size_precision);
+	if (useChecksum) checksumCalculator->addBuffer(precision, __size_precision);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetShaderPrecisionFormat: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetShaderSource_enc(void *self , GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source)
+{
+	ENCODER_DEBUG_LOG("glGetShaderSource(shader:%u, bufsize:%d, length:0x%08x, source:0x%08x)", shader, bufsize, length, source);
+	AEMU_SCOPED_TRACE("glGetShaderSource encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_length = ((length != NULL) ?  (sizeof(GLsizei)) : 0);
+	const unsigned int __size_source =  bufsize;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetShaderSource;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &shader, 4); ptr += 4;
+		memcpy(ptr, &bufsize, 4); ptr += 4;
+	memcpy(ptr, &__size_length, 4); ptr += 4;
+	memcpy(ptr, &__size_source, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	if (length != NULL) {
+		stream->readback(length, __size_length);
+		if (useChecksum) checksumCalculator->addBuffer(length, __size_length);
+	}
+	stream->readback(source, __size_source);
+	if (useChecksum) checksumCalculator->addBuffer(source, __size_source);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetShaderSource: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetTexParameterfv_enc(void *self , GLenum target, GLenum pname, GLfloat* params)
+{
+	ENCODER_DEBUG_LOG("glGetTexParameterfv(target:0x%08x, pname:0x%08x, params:0x%08x)", target, pname, params);
+	AEMU_SCOPED_TRACE("glGetTexParameterfv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetTexParameterfv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetTexParameterfv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetTexParameteriv_enc(void *self , GLenum target, GLenum pname, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glGetTexParameteriv(target:0x%08x, pname:0x%08x, params:0x%08x)", target, pname, params);
+	AEMU_SCOPED_TRACE("glGetTexParameteriv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetTexParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetTexParameteriv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetUniformfv_enc(void *self , GLuint program, GLint location, GLfloat* params)
+{
+	ENCODER_DEBUG_LOG("glGetUniformfv(program:%u, location:%d, params:0x%08x)", program, location, params);
+	AEMU_SCOPED_TRACE("glGetUniformfv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  glSizeof(glesv2_enc::uniformType(self, program, location));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetUniformfv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetUniformfv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetUniformiv_enc(void *self , GLuint program, GLint location, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glGetUniformiv(program:%u, location:%d, params:0x%08x)", program, location, params);
+	AEMU_SCOPED_TRACE("glGetUniformiv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  glSizeof(glesv2_enc::uniformType(self, program, location));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetUniformiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetUniformiv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+int glGetUniformLocation_enc(void *self , GLuint program, const GLchar* name)
+{
+	ENCODER_DEBUG_LOG("glGetUniformLocation(program:%u, name:0x%08x)", program, name);
+	AEMU_SCOPED_TRACE("glGetUniformLocation encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_name =  (strlen(name) + 1);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_name + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetUniformLocation;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+	memcpy(ptr, &__size_name, 4); ptr += 4;
+	memcpy(ptr, name, __size_name);ptr += __size_name;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	int retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetUniformLocation: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glGetVertexAttribfv_enc(void *self , GLuint index, GLenum pname, GLfloat* params)
+{
+	ENCODER_DEBUG_LOG("glGetVertexAttribfv(index:%u, pname:0x%08x, params:0x%08x)", index, pname, params);
+	AEMU_SCOPED_TRACE("glGetVertexAttribfv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetVertexAttribfv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetVertexAttribfv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetVertexAttribiv_enc(void *self , GLuint index, GLenum pname, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glGetVertexAttribiv(index:%u, pname:0x%08x, params:0x%08x)", index, pname, params);
+	AEMU_SCOPED_TRACE("glGetVertexAttribiv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetVertexAttribiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetVertexAttribiv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glHint_enc(void *self , GLenum target, GLenum mode)
+{
+	ENCODER_DEBUG_LOG("glHint(target:0x%08x, mode:0x%08x)", target, mode);
+	AEMU_SCOPED_TRACE("glHint encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glHint;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &mode, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+GLboolean glIsBuffer_enc(void *self , GLuint buffer)
+{
+	ENCODER_DEBUG_LOG("glIsBuffer(buffer:%u)", buffer);
+	AEMU_SCOPED_TRACE("glIsBuffer encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glIsBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &buffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glIsBuffer: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+GLboolean glIsEnabled_enc(void *self , GLenum cap)
+{
+	ENCODER_DEBUG_LOG("glIsEnabled(cap:0x%08x)", cap);
+	AEMU_SCOPED_TRACE("glIsEnabled encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glIsEnabled;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &cap, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glIsEnabled: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+GLboolean glIsFramebuffer_enc(void *self , GLuint framebuffer)
+{
+	ENCODER_DEBUG_LOG("glIsFramebuffer(framebuffer:%u)", framebuffer);
+	AEMU_SCOPED_TRACE("glIsFramebuffer encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glIsFramebuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &framebuffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glIsFramebuffer: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+GLboolean glIsProgram_enc(void *self , GLuint program)
+{
+	ENCODER_DEBUG_LOG("glIsProgram(program:%u)", program);
+	AEMU_SCOPED_TRACE("glIsProgram encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glIsProgram;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glIsProgram: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+GLboolean glIsRenderbuffer_enc(void *self , GLuint renderbuffer)
+{
+	ENCODER_DEBUG_LOG("glIsRenderbuffer(renderbuffer:%u)", renderbuffer);
+	AEMU_SCOPED_TRACE("glIsRenderbuffer encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glIsRenderbuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &renderbuffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glIsRenderbuffer: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+GLboolean glIsShader_enc(void *self , GLuint shader)
+{
+	ENCODER_DEBUG_LOG("glIsShader(shader:%u)", shader);
+	AEMU_SCOPED_TRACE("glIsShader encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glIsShader;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &shader, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glIsShader: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+GLboolean glIsTexture_enc(void *self , GLuint texture)
+{
+	ENCODER_DEBUG_LOG("glIsTexture(texture:%u)", texture);
+	AEMU_SCOPED_TRACE("glIsTexture encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glIsTexture;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &texture, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glIsTexture: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glLineWidth_enc(void *self , GLfloat width)
+{
+	ENCODER_DEBUG_LOG("glLineWidth(width:%f)", width);
+	AEMU_SCOPED_TRACE("glLineWidth encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glLineWidth;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &width, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glLinkProgram_enc(void *self , GLuint program)
+{
+	ENCODER_DEBUG_LOG("glLinkProgram(program:%u)", program);
+	AEMU_SCOPED_TRACE("glLinkProgram encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glLinkProgram;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glPixelStorei_enc(void *self , GLenum pname, GLint param)
+{
+	ENCODER_DEBUG_LOG("glPixelStorei(pname:0x%08x, param:%d)", pname, param);
+	AEMU_SCOPED_TRACE("glPixelStorei encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glPixelStorei;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glPolygonOffset_enc(void *self , GLfloat factor, GLfloat units)
+{
+	ENCODER_DEBUG_LOG("glPolygonOffset(factor:%f, units:%f)", factor, units);
+	AEMU_SCOPED_TRACE("glPolygonOffset encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glPolygonOffset;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &factor, 4); ptr += 4;
+		memcpy(ptr, &units, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glReadPixels_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels)
+{
+	ENCODER_DEBUG_LOG("glReadPixels(x:%d, y:%d, width:%d, height:%d, format:0x%08x, type:0x%08x, pixels:0x%08x)", x, y, width, height, format, type, pixels);
+	AEMU_SCOPED_TRACE("glReadPixels encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_pixels =  glesv2_enc::pixelDataSize(self, width, height, format, type, 1);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glReadPixels;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+	memcpy(ptr, &__size_pixels, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	 stream->readbackPixels(self, width, height, format, type, pixels);
+	if (useChecksum) checksumCalculator->addBuffer(pixels, __size_pixels);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glReadPixels: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glReleaseShaderCompiler_enc(void *self )
+{
+	ENCODER_DEBUG_LOG("glReleaseShaderCompiler()");
+	AEMU_SCOPED_TRACE("glReleaseShaderCompiler encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glReleaseShaderCompiler;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glRenderbufferStorage_enc(void *self , GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
+{
+	ENCODER_DEBUG_LOG("glRenderbufferStorage(target:0x%08x, internalformat:0x%08x, width:%d, height:%d)", target, internalformat, width, height);
+	AEMU_SCOPED_TRACE("glRenderbufferStorage encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glRenderbufferStorage;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &internalformat, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glSampleCoverage_enc(void *self , GLclampf value, GLboolean invert)
+{
+	ENCODER_DEBUG_LOG("glSampleCoverage(value:%f, invert:%d)", value, invert);
+	AEMU_SCOPED_TRACE("glSampleCoverage encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 1;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glSampleCoverage;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &value, 4); ptr += 4;
+		memcpy(ptr, &invert, 1); ptr += 1;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glScissor_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height)
+{
+	ENCODER_DEBUG_LOG("glScissor(x:%d, y:%d, width:%d, height:%d)", x, y, width, height);
+	AEMU_SCOPED_TRACE("glScissor encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glScissor;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glStencilFunc_enc(void *self , GLenum func, GLint ref, GLuint mask)
+{
+	ENCODER_DEBUG_LOG("glStencilFunc(func:0x%08x, ref:%d, mask:%u)", func, ref, mask);
+	AEMU_SCOPED_TRACE("glStencilFunc encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glStencilFunc;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &func, 4); ptr += 4;
+		memcpy(ptr, &ref, 4); ptr += 4;
+		memcpy(ptr, &mask, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glStencilFuncSeparate_enc(void *self , GLenum face, GLenum func, GLint ref, GLuint mask)
+{
+	ENCODER_DEBUG_LOG("glStencilFuncSeparate(face:0x%08x, func:0x%08x, ref:%d, mask:%u)", face, func, ref, mask);
+	AEMU_SCOPED_TRACE("glStencilFuncSeparate encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glStencilFuncSeparate;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &face, 4); ptr += 4;
+		memcpy(ptr, &func, 4); ptr += 4;
+		memcpy(ptr, &ref, 4); ptr += 4;
+		memcpy(ptr, &mask, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glStencilMask_enc(void *self , GLuint mask)
+{
+	ENCODER_DEBUG_LOG("glStencilMask(mask:%u)", mask);
+	AEMU_SCOPED_TRACE("glStencilMask encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glStencilMask;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mask, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glStencilMaskSeparate_enc(void *self , GLenum face, GLuint mask)
+{
+	ENCODER_DEBUG_LOG("glStencilMaskSeparate(face:0x%08x, mask:%u)", face, mask);
+	AEMU_SCOPED_TRACE("glStencilMaskSeparate encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glStencilMaskSeparate;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &face, 4); ptr += 4;
+		memcpy(ptr, &mask, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glStencilOp_enc(void *self , GLenum fail, GLenum zfail, GLenum zpass)
+{
+	ENCODER_DEBUG_LOG("glStencilOp(fail:0x%08x, zfail:0x%08x, zpass:0x%08x)", fail, zfail, zpass);
+	AEMU_SCOPED_TRACE("glStencilOp encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glStencilOp;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &fail, 4); ptr += 4;
+		memcpy(ptr, &zfail, 4); ptr += 4;
+		memcpy(ptr, &zpass, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glStencilOpSeparate_enc(void *self , GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
+{
+	ENCODER_DEBUG_LOG("glStencilOpSeparate(face:0x%08x, fail:0x%08x, zfail:0x%08x, zpass:0x%08x)", face, fail, zfail, zpass);
+	AEMU_SCOPED_TRACE("glStencilOpSeparate encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glStencilOpSeparate;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &face, 4); ptr += 4;
+		memcpy(ptr, &fail, 4); ptr += 4;
+		memcpy(ptr, &zfail, 4); ptr += 4;
+		memcpy(ptr, &zpass, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexImage2D_enc(void *self , GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
+{
+	ENCODER_DEBUG_LOG("glTexImage2D(target:0x%08x, level:%d, internalformat:%d, width:%d, height:%d, border:%d, format:0x%08x, type:0x%08x, pixels:0x%08x)", target, level, internalformat, width, height, border, format, type, pixels);
+	AEMU_SCOPED_TRACE("glTexImage2D encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_pixels = ((pixels != NULL) ?  glesv2_enc::pixelDataSize(self, width, height, format, type, 0) : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
+	ptr = buf;
+	int tmp = OP_glTexImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &internalformat, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &border, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	stream->flush();
+	stream->writeFully(&__size_pixels,4);
+	if (useChecksum) checksumCalculator->addBuffer(&__size_pixels,4);
+	if (pixels != NULL) {
+		 stream->uploadPixels(self, width, height, 1, format, type, pixels);
+		if (useChecksum) checksumCalculator->addBuffer(pixels, __size_pixels);
+	}
+	buf = stream->alloc(checksumSize);
+	if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
+
+}
+
+void glTexParameterf_enc(void *self , GLenum target, GLenum pname, GLfloat param)
+{
+	ENCODER_DEBUG_LOG("glTexParameterf(target:0x%08x, pname:0x%08x, param:%f)", target, pname, param);
+	AEMU_SCOPED_TRACE("glTexParameterf encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexParameterf;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexParameterfv_enc(void *self , GLenum target, GLenum pname, const GLfloat* params)
+{
+	ENCODER_DEBUG_LOG("glTexParameterfv(target:0x%08x, pname:0x%08x, params:0x%08x)", target, pname, params);
+	AEMU_SCOPED_TRACE("glTexParameterfv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexParameterfv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexParameteri_enc(void *self , GLenum target, GLenum pname, GLint param)
+{
+	ENCODER_DEBUG_LOG("glTexParameteri(target:0x%08x, pname:0x%08x, param:%d)", target, pname, param);
+	AEMU_SCOPED_TRACE("glTexParameteri encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexParameteri;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexParameteriv_enc(void *self , GLenum target, GLenum pname, const GLint* params)
+{
+	ENCODER_DEBUG_LOG("glTexParameteriv(target:0x%08x, pname:0x%08x, params:0x%08x)", target, pname, params);
+	AEMU_SCOPED_TRACE("glTexParameteriv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexSubImage2D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels)
+{
+	ENCODER_DEBUG_LOG("glTexSubImage2D(target:0x%08x, level:%d, xoffset:%d, yoffset:%d, width:%d, height:%d, format:0x%08x, type:0x%08x, pixels:0x%08x)", target, level, xoffset, yoffset, width, height, format, type, pixels);
+	AEMU_SCOPED_TRACE("glTexSubImage2D encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_pixels = ((pixels != NULL) ?  glesv2_enc::pixelDataSize(self, width, height, format, type, 0) : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
+	ptr = buf;
+	int tmp = OP_glTexSubImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &xoffset, 4); ptr += 4;
+		memcpy(ptr, &yoffset, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	stream->flush();
+	stream->writeFully(&__size_pixels,4);
+	if (useChecksum) checksumCalculator->addBuffer(&__size_pixels,4);
+	if (pixels != NULL) {
+		 stream->uploadPixels(self, width, height, 1, format, type, pixels);
+		if (useChecksum) checksumCalculator->addBuffer(pixels, __size_pixels);
+	}
+	buf = stream->alloc(checksumSize);
+	if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
+
+}
+
+void glUniform1f_enc(void *self , GLint location, GLfloat x)
+{
+	ENCODER_DEBUG_LOG("glUniform1f(location:%d, x:%f)", location, x);
+	AEMU_SCOPED_TRACE("glUniform1f encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform1f;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &x, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniform1fv_enc(void *self , GLint location, GLsizei count, const GLfloat* v)
+{
+	ENCODER_DEBUG_LOG("glUniform1fv(location:%d, count:%d, v:0x%08x)", location, count, v);
+	AEMU_SCOPED_TRACE("glUniform1fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_v =  (count * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_v + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform1fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	memcpy(ptr, &__size_v, 4); ptr += 4;
+	memcpy(ptr, v, __size_v);ptr += __size_v;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniform1i_enc(void *self , GLint location, GLint x)
+{
+	ENCODER_DEBUG_LOG("glUniform1i(location:%d, x:%d)", location, x);
+	AEMU_SCOPED_TRACE("glUniform1i encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform1i;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &x, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniform1iv_enc(void *self , GLint location, GLsizei count, const GLint* v)
+{
+	ENCODER_DEBUG_LOG("glUniform1iv(location:%d, count:%d, v:0x%08x)", location, count, v);
+	AEMU_SCOPED_TRACE("glUniform1iv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_v =  (count * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_v + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform1iv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	memcpy(ptr, &__size_v, 4); ptr += 4;
+	memcpy(ptr, v, __size_v);ptr += __size_v;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniform2f_enc(void *self , GLint location, GLfloat x, GLfloat y)
+{
+	ENCODER_DEBUG_LOG("glUniform2f(location:%d, x:%f, y:%f)", location, x, y);
+	AEMU_SCOPED_TRACE("glUniform2f encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform2f;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniform2fv_enc(void *self , GLint location, GLsizei count, const GLfloat* v)
+{
+	ENCODER_DEBUG_LOG("glUniform2fv(location:%d, count:%d, v:0x%08x)", location, count, v);
+	AEMU_SCOPED_TRACE("glUniform2fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_v =  (count * 2 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_v + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform2fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	memcpy(ptr, &__size_v, 4); ptr += 4;
+	memcpy(ptr, v, __size_v);ptr += __size_v;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniform2i_enc(void *self , GLint location, GLint x, GLint y)
+{
+	ENCODER_DEBUG_LOG("glUniform2i(location:%d, x:%d, y:%d)", location, x, y);
+	AEMU_SCOPED_TRACE("glUniform2i encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform2i;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniform2iv_enc(void *self , GLint location, GLsizei count, const GLint* v)
+{
+	ENCODER_DEBUG_LOG("glUniform2iv(location:%d, count:%d, v:0x%08x)", location, count, v);
+	AEMU_SCOPED_TRACE("glUniform2iv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_v =  (count * 2 * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_v + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform2iv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	memcpy(ptr, &__size_v, 4); ptr += 4;
+	memcpy(ptr, v, __size_v);ptr += __size_v;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniform3f_enc(void *self , GLint location, GLfloat x, GLfloat y, GLfloat z)
+{
+	ENCODER_DEBUG_LOG("glUniform3f(location:%d, x:%f, y:%f, z:%f)", location, x, y, z);
+	AEMU_SCOPED_TRACE("glUniform3f encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform3f;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &z, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniform3fv_enc(void *self , GLint location, GLsizei count, const GLfloat* v)
+{
+	ENCODER_DEBUG_LOG("glUniform3fv(location:%d, count:%d, v:0x%08x)", location, count, v);
+	AEMU_SCOPED_TRACE("glUniform3fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_v =  (count * 3 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_v + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform3fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	memcpy(ptr, &__size_v, 4); ptr += 4;
+	memcpy(ptr, v, __size_v);ptr += __size_v;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniform3i_enc(void *self , GLint location, GLint x, GLint y, GLint z)
+{
+	ENCODER_DEBUG_LOG("glUniform3i(location:%d, x:%d, y:%d, z:%d)", location, x, y, z);
+	AEMU_SCOPED_TRACE("glUniform3i encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform3i;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &z, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniform3iv_enc(void *self , GLint location, GLsizei count, const GLint* v)
+{
+	ENCODER_DEBUG_LOG("glUniform3iv(location:%d, count:%d, v:0x%08x)", location, count, v);
+	AEMU_SCOPED_TRACE("glUniform3iv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_v =  (3 * count * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_v + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform3iv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	memcpy(ptr, &__size_v, 4); ptr += 4;
+	memcpy(ptr, v, __size_v);ptr += __size_v;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniform4f_enc(void *self , GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+	ENCODER_DEBUG_LOG("glUniform4f(location:%d, x:%f, y:%f, z:%f, w:%f)", location, x, y, z, w);
+	AEMU_SCOPED_TRACE("glUniform4f encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform4f;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &z, 4); ptr += 4;
+		memcpy(ptr, &w, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniform4fv_enc(void *self , GLint location, GLsizei count, const GLfloat* v)
+{
+	ENCODER_DEBUG_LOG("glUniform4fv(location:%d, count:%d, v:0x%08x)", location, count, v);
+	AEMU_SCOPED_TRACE("glUniform4fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_v =  (4 * count * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_v + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform4fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	memcpy(ptr, &__size_v, 4); ptr += 4;
+	memcpy(ptr, v, __size_v);ptr += __size_v;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniform4i_enc(void *self , GLint location, GLint x, GLint y, GLint z, GLint w)
+{
+	ENCODER_DEBUG_LOG("glUniform4i(location:%d, x:%d, y:%d, z:%d, w:%d)", location, x, y, z, w);
+	AEMU_SCOPED_TRACE("glUniform4i encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform4i;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &z, 4); ptr += 4;
+		memcpy(ptr, &w, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniform4iv_enc(void *self , GLint location, GLsizei count, const GLint* v)
+{
+	ENCODER_DEBUG_LOG("glUniform4iv(location:%d, count:%d, v:0x%08x)", location, count, v);
+	AEMU_SCOPED_TRACE("glUniform4iv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_v =  (4 * count * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_v + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform4iv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	memcpy(ptr, &__size_v, 4); ptr += 4;
+	memcpy(ptr, v, __size_v);ptr += __size_v;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniformMatrix2fv_enc(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	ENCODER_DEBUG_LOG("glUniformMatrix2fv(location:%d, count:%d, transpose:%d, value:0x%08x)", location, count, transpose, value);
+	AEMU_SCOPED_TRACE("glUniformMatrix2fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 4 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniformMatrix2fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniformMatrix3fv_enc(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	ENCODER_DEBUG_LOG("glUniformMatrix3fv(location:%d, count:%d, transpose:%d, value:0x%08x)", location, count, transpose, value);
+	AEMU_SCOPED_TRACE("glUniformMatrix3fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 9 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniformMatrix3fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniformMatrix4fv_enc(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	ENCODER_DEBUG_LOG("glUniformMatrix4fv(location:%d, count:%d, transpose:%d, value:0x%08x)", location, count, transpose, value);
+	AEMU_SCOPED_TRACE("glUniformMatrix4fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 16 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniformMatrix4fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUseProgram_enc(void *self , GLuint program)
+{
+	ENCODER_DEBUG_LOG("glUseProgram(program:%u)", program);
+	AEMU_SCOPED_TRACE("glUseProgram encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUseProgram;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glValidateProgram_enc(void *self , GLuint program)
+{
+	ENCODER_DEBUG_LOG("glValidateProgram(program:%u)", program);
+	AEMU_SCOPED_TRACE("glValidateProgram encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glValidateProgram;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexAttrib1f_enc(void *self , GLuint indx, GLfloat x)
+{
+	ENCODER_DEBUG_LOG("glVertexAttrib1f(indx:%u, x:%f)", indx, x);
+	AEMU_SCOPED_TRACE("glVertexAttrib1f encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttrib1f;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &indx, 4); ptr += 4;
+		memcpy(ptr, &x, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexAttrib1fv_enc(void *self , GLuint indx, const GLfloat* values)
+{
+	ENCODER_DEBUG_LOG("glVertexAttrib1fv(indx:%u, values:0x%08x)", indx, values);
+	AEMU_SCOPED_TRACE("glVertexAttrib1fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_values =  (sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_values + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttrib1fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &indx, 4); ptr += 4;
+	memcpy(ptr, &__size_values, 4); ptr += 4;
+	memcpy(ptr, values, __size_values);ptr += __size_values;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexAttrib2f_enc(void *self , GLuint indx, GLfloat x, GLfloat y)
+{
+	ENCODER_DEBUG_LOG("glVertexAttrib2f(indx:%u, x:%f, y:%f)", indx, x, y);
+	AEMU_SCOPED_TRACE("glVertexAttrib2f encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttrib2f;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &indx, 4); ptr += 4;
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexAttrib2fv_enc(void *self , GLuint indx, const GLfloat* values)
+{
+	ENCODER_DEBUG_LOG("glVertexAttrib2fv(indx:%u, values:0x%08x)", indx, values);
+	AEMU_SCOPED_TRACE("glVertexAttrib2fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_values =  (2 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_values + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttrib2fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &indx, 4); ptr += 4;
+	memcpy(ptr, &__size_values, 4); ptr += 4;
+	memcpy(ptr, values, __size_values);ptr += __size_values;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexAttrib3f_enc(void *self , GLuint indx, GLfloat x, GLfloat y, GLfloat z)
+{
+	ENCODER_DEBUG_LOG("glVertexAttrib3f(indx:%u, x:%f, y:%f, z:%f)", indx, x, y, z);
+	AEMU_SCOPED_TRACE("glVertexAttrib3f encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttrib3f;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &indx, 4); ptr += 4;
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &z, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexAttrib3fv_enc(void *self , GLuint indx, const GLfloat* values)
+{
+	ENCODER_DEBUG_LOG("glVertexAttrib3fv(indx:%u, values:0x%08x)", indx, values);
+	AEMU_SCOPED_TRACE("glVertexAttrib3fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_values =  (3 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_values + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttrib3fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &indx, 4); ptr += 4;
+	memcpy(ptr, &__size_values, 4); ptr += 4;
+	memcpy(ptr, values, __size_values);ptr += __size_values;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexAttrib4f_enc(void *self , GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+	ENCODER_DEBUG_LOG("glVertexAttrib4f(indx:%u, x:%f, y:%f, z:%f, w:%f)", indx, x, y, z, w);
+	AEMU_SCOPED_TRACE("glVertexAttrib4f encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttrib4f;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &indx, 4); ptr += 4;
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &z, 4); ptr += 4;
+		memcpy(ptr, &w, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexAttrib4fv_enc(void *self , GLuint indx, const GLfloat* values)
+{
+	ENCODER_DEBUG_LOG("glVertexAttrib4fv(indx:%u, values:0x%08x)", indx, values);
+	AEMU_SCOPED_TRACE("glVertexAttrib4fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_values =  (4 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_values + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttrib4fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &indx, 4); ptr += 4;
+	memcpy(ptr, &__size_values, 4); ptr += 4;
+	memcpy(ptr, values, __size_values);ptr += __size_values;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glViewport_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height)
+{
+	ENCODER_DEBUG_LOG("glViewport(x:%d, y:%d, width:%d, height:%d)", x, y, width, height);
+	AEMU_SCOPED_TRACE("glViewport encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glViewport;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glEGLImageTargetTexture2DOES_enc(void *self , GLenum target, GLeglImageOES image)
+{
+	ENCODER_DEBUG_LOG("glEGLImageTargetTexture2DOES(target:0x%08x, image:%p)", target, image);
+	AEMU_SCOPED_TRACE("glEGLImageTargetTexture2DOES encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glEGLImageTargetTexture2DOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &image, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glEGLImageTargetRenderbufferStorageOES_enc(void *self , GLenum target, GLeglImageOES image)
+{
+	ENCODER_DEBUG_LOG("glEGLImageTargetRenderbufferStorageOES(target:0x%08x, image:%p)", target, image);
+	AEMU_SCOPED_TRACE("glEGLImageTargetRenderbufferStorageOES encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glEGLImageTargetRenderbufferStorageOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &image, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+GLboolean glUnmapBufferOES_enc(void *self , GLenum target)
+{
+	ENCODER_DEBUG_LOG("glUnmapBufferOES(target:0x%08x)", target);
+	AEMU_SCOPED_TRACE("glUnmapBufferOES encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUnmapBufferOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glUnmapBufferOES: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glTexImage3DOES_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
+{
+	ENCODER_DEBUG_LOG("glTexImage3DOES(target:0x%08x, level:%d, internalformat:0x%08x, width:%d, height:%d, depth:%d, border:%d, format:0x%08x, type:0x%08x, pixels:0x%08x)", target, level, internalformat, width, height, depth, border, format, type, pixels);
+	AEMU_SCOPED_TRACE("glTexImage3DOES encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_pixels = ((pixels != NULL) ?  glesv2_enc::pixelDataSize3D(self, width, height, depth, format, type, 0) : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
+	ptr = buf;
+	int tmp = OP_glTexImage3DOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &internalformat, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &depth, 4); ptr += 4;
+		memcpy(ptr, &border, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	stream->flush();
+	stream->writeFully(&__size_pixels,4);
+	if (useChecksum) checksumCalculator->addBuffer(&__size_pixels,4);
+	if (pixels != NULL) {
+		stream->writeFully(pixels, __size_pixels);
+		if (useChecksum) checksumCalculator->addBuffer(pixels, __size_pixels);
+	}
+	buf = stream->alloc(checksumSize);
+	if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
+
+}
+
+void glTexSubImage3DOES_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels)
+{
+	ENCODER_DEBUG_LOG("glTexSubImage3DOES(target:0x%08x, level:%d, xoffset:%d, yoffset:%d, zoffset:%d, width:%d, height:%d, depth:%d, format:0x%08x, type:0x%08x, pixels:0x%08x)", target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
+	AEMU_SCOPED_TRACE("glTexSubImage3DOES encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_pixels = ((pixels != NULL) ?  glesv2_enc::pixelDataSize3D(self, width, height, depth, format, type, 0) : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
+	ptr = buf;
+	int tmp = OP_glTexSubImage3DOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &xoffset, 4); ptr += 4;
+		memcpy(ptr, &yoffset, 4); ptr += 4;
+		memcpy(ptr, &zoffset, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &depth, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	stream->flush();
+	stream->writeFully(&__size_pixels,4);
+	if (useChecksum) checksumCalculator->addBuffer(&__size_pixels,4);
+	if (pixels != NULL) {
+		stream->writeFully(pixels, __size_pixels);
+		if (useChecksum) checksumCalculator->addBuffer(pixels, __size_pixels);
+	}
+	buf = stream->alloc(checksumSize);
+	if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
+
+}
+
+void glCopyTexSubImage3DOES_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+	ENCODER_DEBUG_LOG("glCopyTexSubImage3DOES(target:0x%08x, level:%d, xoffset:%d, yoffset:%d, zoffset:%d, x:%d, y:%d, width:%d, height:%d)", target, level, xoffset, yoffset, zoffset, x, y, width, height);
+	AEMU_SCOPED_TRACE("glCopyTexSubImage3DOES encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glCopyTexSubImage3DOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &xoffset, 4); ptr += 4;
+		memcpy(ptr, &yoffset, 4); ptr += 4;
+		memcpy(ptr, &zoffset, 4); ptr += 4;
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glCompressedTexImage3DOES_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data)
+{
+	ENCODER_DEBUG_LOG("glCompressedTexImage3DOES(target:0x%08x, level:%d, internalformat:0x%08x, width:%d, height:%d, depth:%d, border:%d, imageSize:%d, data:0x%08x)", target, level, internalformat, width, height, depth, border, imageSize, data);
+	AEMU_SCOPED_TRACE("glCompressedTexImage3DOES encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data = ((data != NULL) ?  imageSize : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_data + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
+	ptr = buf;
+	int tmp = OP_glCompressedTexImage3DOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &internalformat, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &depth, 4); ptr += 4;
+		memcpy(ptr, &border, 4); ptr += 4;
+		memcpy(ptr, &imageSize, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	stream->flush();
+	stream->writeFully(&__size_data,4);
+	if (useChecksum) checksumCalculator->addBuffer(&__size_data,4);
+	if (data != NULL) {
+		stream->writeFully(data, __size_data);
+		if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
+	}
+	buf = stream->alloc(checksumSize);
+	if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
+
+}
+
+void glCompressedTexSubImage3DOES_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data)
+{
+	ENCODER_DEBUG_LOG("glCompressedTexSubImage3DOES(target:0x%08x, level:%d, xoffset:%d, yoffset:%d, zoffset:%d, width:%d, height:%d, depth:%d, format:0x%08x, imageSize:%d, data:0x%08x)", target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
+	AEMU_SCOPED_TRACE("glCompressedTexSubImage3DOES encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data = ((data != NULL) ?  imageSize : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_data + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
+	ptr = buf;
+	int tmp = OP_glCompressedTexSubImage3DOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &xoffset, 4); ptr += 4;
+		memcpy(ptr, &yoffset, 4); ptr += 4;
+		memcpy(ptr, &zoffset, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &depth, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &imageSize, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	stream->flush();
+	stream->writeFully(&__size_data,4);
+	if (useChecksum) checksumCalculator->addBuffer(&__size_data,4);
+	if (data != NULL) {
+		stream->writeFully(data, __size_data);
+		if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
+	}
+	buf = stream->alloc(checksumSize);
+	if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
+
+}
+
+void glFramebufferTexture3DOES_enc(void *self , GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
+{
+	ENCODER_DEBUG_LOG("glFramebufferTexture3DOES(target:0x%08x, attachment:0x%08x, textarget:0x%08x, texture:%u, level:%d, zoffset:%d)", target, attachment, textarget, texture, level, zoffset);
+	AEMU_SCOPED_TRACE("glFramebufferTexture3DOES encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFramebufferTexture3DOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &attachment, 4); ptr += 4;
+		memcpy(ptr, &textarget, 4); ptr += 4;
+		memcpy(ptr, &texture, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &zoffset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBindVertexArrayOES_enc(void *self , GLuint array)
+{
+	ENCODER_DEBUG_LOG("glBindVertexArrayOES(array:%u)", array);
+	AEMU_SCOPED_TRACE("glBindVertexArrayOES encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBindVertexArrayOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &array, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDeleteVertexArraysOES_enc(void *self , GLsizei n, const GLuint* arrays)
+{
+	ENCODER_DEBUG_LOG("glDeleteVertexArraysOES(n:%d, arrays:0x%08x)", n, arrays);
+	AEMU_SCOPED_TRACE("glDeleteVertexArraysOES encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_arrays =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_arrays + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDeleteVertexArraysOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_arrays, 4); ptr += 4;
+	memcpy(ptr, arrays, __size_arrays);ptr += __size_arrays;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGenVertexArraysOES_enc(void *self , GLsizei n, GLuint* arrays)
+{
+	ENCODER_DEBUG_LOG("glGenVertexArraysOES(n:%d, arrays:0x%08x)", n, arrays);
+	AEMU_SCOPED_TRACE("glGenVertexArraysOES encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_arrays =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGenVertexArraysOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_arrays, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(arrays, __size_arrays);
+	if (useChecksum) checksumCalculator->addBuffer(arrays, __size_arrays);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGenVertexArraysOES: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+GLboolean glIsVertexArrayOES_enc(void *self , GLuint array)
+{
+	ENCODER_DEBUG_LOG("glIsVertexArrayOES(array:%u)", array);
+	AEMU_SCOPED_TRACE("glIsVertexArrayOES encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glIsVertexArrayOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &array, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glIsVertexArrayOES: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glDiscardFramebufferEXT_enc(void *self , GLenum target, GLsizei numAttachments, const GLenum* attachments)
+{
+	ENCODER_DEBUG_LOG("glDiscardFramebufferEXT(target:0x%08x, numAttachments:%d, attachments:0x%08x)", target, numAttachments, attachments);
+	AEMU_SCOPED_TRACE("glDiscardFramebufferEXT encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_attachments =  (numAttachments * sizeof(GLenum));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_attachments + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDiscardFramebufferEXT;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &numAttachments, 4); ptr += 4;
+	memcpy(ptr, &__size_attachments, 4); ptr += 4;
+	memcpy(ptr, attachments, __size_attachments);ptr += __size_attachments;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexAttribPointerData_enc(void *self , GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, void* data, GLuint datalen)
+{
+	ENCODER_DEBUG_LOG("glVertexAttribPointerData(indx:%u, size:%d, type:0x%08x, normalized:%d, stride:%d, data:0x%08x, datalen:%u)", indx, size, type, normalized, stride, data, datalen);
+	AEMU_SCOPED_TRACE("glVertexAttribPointerData encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data =  datalen;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 1 + 4 + __size_data + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttribPointerData;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &indx, 4); ptr += 4;
+		memcpy(ptr, &size, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &normalized, 1); ptr += 1;
+		memcpy(ptr, &stride, 4); ptr += 4;
+	memcpy(ptr, &__size_data, 4); ptr += 4;
+	 glUtilsPackPointerData((unsigned char *)ptr, (unsigned char *)data, size, type, stride, datalen);ptr += __size_data;
+		memcpy(ptr, &datalen, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexAttribPointerOffset_enc(void *self , GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint offset)
+{
+	ENCODER_DEBUG_LOG("glVertexAttribPointerOffset(indx:%u, size:%d, type:0x%08x, normalized:%d, stride:%d, offset:%u)", indx, size, type, normalized, stride, offset);
+	AEMU_SCOPED_TRACE("glVertexAttribPointerOffset encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 1 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttribPointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &indx, 4); ptr += 4;
+		memcpy(ptr, &size, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &normalized, 1); ptr += 1;
+		memcpy(ptr, &stride, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawElementsOffset_enc(void *self , GLenum mode, GLsizei count, GLenum type, GLuint offset)
+{
+	ENCODER_DEBUG_LOG("glDrawElementsOffset(mode:0x%08x, count:%d, type:0x%08x, offset:%u)", mode, count, type, offset);
+	AEMU_SCOPED_TRACE("glDrawElementsOffset encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawElementsOffset;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawElementsData_enc(void *self , GLenum mode, GLsizei count, GLenum type, void* data, GLuint datalen)
+{
+	ENCODER_DEBUG_LOG("glDrawElementsData(mode:0x%08x, count:%d, type:0x%08x, data:0x%08x, datalen:%u)", mode, count, type, data, datalen);
+	AEMU_SCOPED_TRACE("glDrawElementsData encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data =  datalen;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_data + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawElementsData;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+	memcpy(ptr, &__size_data, 4); ptr += 4;
+	memcpy(ptr, data, __size_data);ptr += __size_data;
+		memcpy(ptr, &datalen, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetCompressedTextureFormats_enc(void *self , int count, GLint* formats)
+{
+	ENCODER_DEBUG_LOG("glGetCompressedTextureFormats(count:%d, formats:0x%08x)", count, formats);
+	AEMU_SCOPED_TRACE("glGetCompressedTextureFormats encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_formats =  (count * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetCompressedTextureFormats;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &count, 4); ptr += 4;
+	memcpy(ptr, &__size_formats, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(formats, __size_formats);
+	if (useChecksum) checksumCalculator->addBuffer(formats, __size_formats);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetCompressedTextureFormats: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glShaderString_enc(void *self , GLuint shader, const GLchar* string, GLsizei len)
+{
+	ENCODER_DEBUG_LOG("glShaderString(shader:%u, string:0x%08x, len:%d)", shader, string, len);
+	AEMU_SCOPED_TRACE("glShaderString encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_string =  len;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_string + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glShaderString;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &shader, 4); ptr += 4;
+	memcpy(ptr, &__size_string, 4); ptr += 4;
+	memcpy(ptr, string, __size_string);ptr += __size_string;
+		memcpy(ptr, &len, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+int glFinishRoundTrip_enc(void *self )
+{
+	ENCODER_DEBUG_LOG("glFinishRoundTrip()");
+	AEMU_SCOPED_TRACE("glFinishRoundTrip encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFinishRoundTrip;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	int retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glFinishRoundTrip: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glGenVertexArrays_enc(void *self , GLsizei n, GLuint* arrays)
+{
+	ENCODER_DEBUG_LOG("glGenVertexArrays(n:%d, arrays:0x%08x)", n, arrays);
+	AEMU_SCOPED_TRACE("glGenVertexArrays encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_arrays =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGenVertexArrays;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_arrays, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(arrays, __size_arrays);
+	if (useChecksum) checksumCalculator->addBuffer(arrays, __size_arrays);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGenVertexArrays: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glBindVertexArray_enc(void *self , GLuint array)
+{
+	ENCODER_DEBUG_LOG("glBindVertexArray(array:%u)", array);
+	AEMU_SCOPED_TRACE("glBindVertexArray encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBindVertexArray;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &array, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDeleteVertexArrays_enc(void *self , GLsizei n, const GLuint* arrays)
+{
+	ENCODER_DEBUG_LOG("glDeleteVertexArrays(n:%d, arrays:0x%08x)", n, arrays);
+	AEMU_SCOPED_TRACE("glDeleteVertexArrays encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_arrays =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_arrays + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDeleteVertexArrays;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_arrays, 4); ptr += 4;
+	memcpy(ptr, arrays, __size_arrays);ptr += __size_arrays;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+GLboolean glIsVertexArray_enc(void *self , GLuint array)
+{
+	ENCODER_DEBUG_LOG("glIsVertexArray(array:%u)", array);
+	AEMU_SCOPED_TRACE("glIsVertexArray encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glIsVertexArray;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &array, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glIsVertexArray: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glMapBufferRangeAEMU_enc(void *self , GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* mapped)
+{
+	ENCODER_DEBUG_LOG("glMapBufferRangeAEMU(target:0x%08x, offset:0x%08lx, length:0x%08lx, access:0x%08x, mapped:0x%08x)", target, offset, length, access, mapped);
+	AEMU_SCOPED_TRACE("glMapBufferRangeAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_mapped = ((mapped != NULL) ?  length : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glMapBufferRangeAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+		memcpy(ptr, &length, 4); ptr += 4;
+		memcpy(ptr, &access, 4); ptr += 4;
+	memcpy(ptr, &__size_mapped, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	if (mapped != NULL) {
+		stream->readback(mapped, __size_mapped);
+		if (useChecksum) checksumCalculator->addBuffer(mapped, __size_mapped);
+	}
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glMapBufferRangeAEMU: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glUnmapBufferAEMU_enc(void *self , GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* guest_buffer, GLboolean* out_res)
+{
+	ENCODER_DEBUG_LOG("glUnmapBufferAEMU(target:0x%08x, offset:0x%08lx, length:0x%08lx, access:0x%08x, guest_buffer:0x%08x, out_res:0x%08x)", target, offset, length, access, guest_buffer, out_res);
+	AEMU_SCOPED_TRACE("glUnmapBufferAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_guest_buffer = ((guest_buffer != NULL) ?  length : 0);
+	const unsigned int __size_out_res =  (sizeof(GLboolean));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + __size_guest_buffer + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUnmapBufferAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+		memcpy(ptr, &length, 4); ptr += 4;
+		memcpy(ptr, &access, 4); ptr += 4;
+	memcpy(ptr, &__size_guest_buffer, 4); ptr += 4;
+	if (guest_buffer != NULL) memcpy(ptr, guest_buffer, __size_guest_buffer);ptr += __size_guest_buffer;
+	memcpy(ptr, &__size_out_res, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(out_res, __size_out_res);
+	if (useChecksum) checksumCalculator->addBuffer(out_res, __size_out_res);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glUnmapBufferAEMU: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glFlushMappedBufferRangeAEMU_enc(void *self , GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* guest_buffer)
+{
+	ENCODER_DEBUG_LOG("glFlushMappedBufferRangeAEMU(target:0x%08x, offset:0x%08lx, length:0x%08lx, access:0x%08x, guest_buffer:0x%08x)", target, offset, length, access, guest_buffer);
+	AEMU_SCOPED_TRACE("glFlushMappedBufferRangeAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_guest_buffer = ((guest_buffer != NULL) ?  length : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + __size_guest_buffer + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFlushMappedBufferRangeAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+		memcpy(ptr, &length, 4); ptr += 4;
+		memcpy(ptr, &access, 4); ptr += 4;
+	memcpy(ptr, &__size_guest_buffer, 4); ptr += 4;
+	if (guest_buffer != NULL) memcpy(ptr, guest_buffer, __size_guest_buffer);ptr += __size_guest_buffer;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glReadPixelsOffsetAEMU_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLuint offset)
+{
+	ENCODER_DEBUG_LOG("glReadPixelsOffsetAEMU(x:%d, y:%d, width:%d, height:%d, format:0x%08x, type:0x%08x, offset:%u)", x, y, width, height, format, type, offset);
+	AEMU_SCOPED_TRACE("glReadPixelsOffsetAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glReadPixelsOffsetAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glCompressedTexImage2DOffsetAEMU_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, GLuint offset)
+{
+	ENCODER_DEBUG_LOG("glCompressedTexImage2DOffsetAEMU(target:0x%08x, level:%d, internalformat:0x%08x, width:%d, height:%d, border:%d, imageSize:%d, offset:%u)", target, level, internalformat, width, height, border, imageSize, offset);
+	AEMU_SCOPED_TRACE("glCompressedTexImage2DOffsetAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glCompressedTexImage2DOffsetAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &internalformat, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &border, 4); ptr += 4;
+		memcpy(ptr, &imageSize, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glCompressedTexSubImage2DOffsetAEMU_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, GLuint offset)
+{
+	ENCODER_DEBUG_LOG("glCompressedTexSubImage2DOffsetAEMU(target:0x%08x, level:%d, xoffset:%d, yoffset:%d, width:%d, height:%d, format:0x%08x, imageSize:%d, offset:%u)", target, level, xoffset, yoffset, width, height, format, imageSize, offset);
+	AEMU_SCOPED_TRACE("glCompressedTexSubImage2DOffsetAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glCompressedTexSubImage2DOffsetAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &xoffset, 4); ptr += 4;
+		memcpy(ptr, &yoffset, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &imageSize, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexImage2DOffsetAEMU_enc(void *self , GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLuint offset)
+{
+	ENCODER_DEBUG_LOG("glTexImage2DOffsetAEMU(target:0x%08x, level:%d, internalformat:%d, width:%d, height:%d, border:%d, format:0x%08x, type:0x%08x, offset:%u)", target, level, internalformat, width, height, border, format, type, offset);
+	AEMU_SCOPED_TRACE("glTexImage2DOffsetAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexImage2DOffsetAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &internalformat, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &border, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexSubImage2DOffsetAEMU_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLuint offset)
+{
+	ENCODER_DEBUG_LOG("glTexSubImage2DOffsetAEMU(target:0x%08x, level:%d, xoffset:%d, yoffset:%d, width:%d, height:%d, format:0x%08x, type:0x%08x, offset:%u)", target, level, xoffset, yoffset, width, height, format, type, offset);
+	AEMU_SCOPED_TRACE("glTexSubImage2DOffsetAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexSubImage2DOffsetAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &xoffset, 4); ptr += 4;
+		memcpy(ptr, &yoffset, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBindBufferRange_enc(void *self , GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
+{
+	ENCODER_DEBUG_LOG("glBindBufferRange(target:0x%08x, index:%u, buffer:%u, offset:0x%08lx, size:0x%08lx)", target, index, buffer, offset, size);
+	AEMU_SCOPED_TRACE("glBindBufferRange encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBindBufferRange;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &buffer, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+		memcpy(ptr, &size, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBindBufferBase_enc(void *self , GLenum target, GLuint index, GLuint buffer)
+{
+	ENCODER_DEBUG_LOG("glBindBufferBase(target:0x%08x, index:%u, buffer:%u)", target, index, buffer);
+	AEMU_SCOPED_TRACE("glBindBufferBase encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBindBufferBase;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &buffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glCopyBufferSubData_enc(void *self , GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size)
+{
+	ENCODER_DEBUG_LOG("glCopyBufferSubData(readtarget:0x%08x, writetarget:0x%08x, readoffset:0x%08lx, writeoffset:0x%08lx, size:0x%08lx)", readtarget, writetarget, readoffset, writeoffset, size);
+	AEMU_SCOPED_TRACE("glCopyBufferSubData encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glCopyBufferSubData;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &readtarget, 4); ptr += 4;
+		memcpy(ptr, &writetarget, 4); ptr += 4;
+		memcpy(ptr, &readoffset, 4); ptr += 4;
+		memcpy(ptr, &writeoffset, 4); ptr += 4;
+		memcpy(ptr, &size, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->flush();
+}
+
+void glClearBufferiv_enc(void *self , GLenum buffer, GLint drawBuffer, const GLint* value)
+{
+	ENCODER_DEBUG_LOG("glClearBufferiv(buffer:0x%08x, drawBuffer:%d, value:0x%08x)", buffer, drawBuffer, value);
+	AEMU_SCOPED_TRACE("glClearBufferiv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (sizeof(GLint) * glesv2_enc::clearBufferNumElts(self, buffer));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClearBufferiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &buffer, 4); ptr += 4;
+		memcpy(ptr, &drawBuffer, 4); ptr += 4;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glClearBufferuiv_enc(void *self , GLenum buffer, GLint drawBuffer, const GLuint* value)
+{
+	ENCODER_DEBUG_LOG("glClearBufferuiv(buffer:0x%08x, drawBuffer:%d, value:0x%08x)", buffer, drawBuffer, value);
+	AEMU_SCOPED_TRACE("glClearBufferuiv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (sizeof(GLuint) * glesv2_enc::clearBufferNumElts(self, buffer));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClearBufferuiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &buffer, 4); ptr += 4;
+		memcpy(ptr, &drawBuffer, 4); ptr += 4;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glClearBufferfv_enc(void *self , GLenum buffer, GLint drawBuffer, const GLfloat* value)
+{
+	ENCODER_DEBUG_LOG("glClearBufferfv(buffer:0x%08x, drawBuffer:%d, value:0x%08x)", buffer, drawBuffer, value);
+	AEMU_SCOPED_TRACE("glClearBufferfv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (sizeof(GLfloat) * glesv2_enc::clearBufferNumElts(self, buffer));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClearBufferfv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &buffer, 4); ptr += 4;
+		memcpy(ptr, &drawBuffer, 4); ptr += 4;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glClearBufferfi_enc(void *self , GLenum buffer, GLint drawBuffer, GLfloat depth, GLint stencil)
+{
+	ENCODER_DEBUG_LOG("glClearBufferfi(buffer:0x%08x, drawBuffer:%d, depth:%f, stencil:%d)", buffer, drawBuffer, depth, stencil);
+	AEMU_SCOPED_TRACE("glClearBufferfi encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClearBufferfi;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &buffer, 4); ptr += 4;
+		memcpy(ptr, &drawBuffer, 4); ptr += 4;
+		memcpy(ptr, &depth, 4); ptr += 4;
+		memcpy(ptr, &stencil, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniformBlockBinding_enc(void *self , GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding)
+{
+	ENCODER_DEBUG_LOG("glUniformBlockBinding(program:%u, uniformBlockIndex:%u, uniformBlockBinding:%u)", program, uniformBlockIndex, uniformBlockBinding);
+	AEMU_SCOPED_TRACE("glUniformBlockBinding encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniformBlockBinding;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &uniformBlockIndex, 4); ptr += 4;
+		memcpy(ptr, &uniformBlockBinding, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+GLuint glGetUniformBlockIndex_enc(void *self , GLuint program, const GLchar* uniformBlockName)
+{
+	ENCODER_DEBUG_LOG("glGetUniformBlockIndex(program:%u, uniformBlockName:0x%08x)", program, uniformBlockName);
+	AEMU_SCOPED_TRACE("glGetUniformBlockIndex encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_uniformBlockName =  (strlen(uniformBlockName) + 1);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_uniformBlockName + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetUniformBlockIndex;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+	memcpy(ptr, &__size_uniformBlockName, 4); ptr += 4;
+	memcpy(ptr, uniformBlockName, __size_uniformBlockName);ptr += __size_uniformBlockName;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLuint retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetUniformBlockIndex: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glGetUniformIndicesAEMU_enc(void *self , GLuint program, GLsizei uniformCount, const GLchar* packedUniformNames, GLsizei packedLen, GLuint* uniformIndices)
+{
+	ENCODER_DEBUG_LOG("glGetUniformIndicesAEMU(program:%u, uniformCount:%d, packedUniformNames:0x%08x, packedLen:%d, uniformIndices:0x%08x)", program, uniformCount, packedUniformNames, packedLen, uniformIndices);
+	AEMU_SCOPED_TRACE("glGetUniformIndicesAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_packedUniformNames =  packedLen;
+	const unsigned int __size_uniformIndices =  (uniformCount * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_packedUniformNames + 4 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetUniformIndicesAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &uniformCount, 4); ptr += 4;
+	memcpy(ptr, &__size_packedUniformNames, 4); ptr += 4;
+	memcpy(ptr, packedUniformNames, __size_packedUniformNames);ptr += __size_packedUniformNames;
+		memcpy(ptr, &packedLen, 4); ptr += 4;
+	memcpy(ptr, &__size_uniformIndices, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(uniformIndices, __size_uniformIndices);
+	if (useChecksum) checksumCalculator->addBuffer(uniformIndices, __size_uniformIndices);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetUniformIndicesAEMU: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetActiveUniformBlockiv_enc(void *self , GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glGetActiveUniformBlockiv(program:%u, uniformBlockIndex:%u, pname:0x%08x, params:0x%08x)", program, uniformBlockIndex, pname, params);
+	AEMU_SCOPED_TRACE("glGetActiveUniformBlockiv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glesv2_enc::glActiveUniformBlockivParamSize(self, program, uniformBlockIndex, pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetActiveUniformBlockiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &uniformBlockIndex, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetActiveUniformBlockiv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetActiveUniformBlockName_enc(void *self , GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName)
+{
+	ENCODER_DEBUG_LOG("glGetActiveUniformBlockName(program:%u, uniformBlockIndex:%u, bufSize:%d, length:0x%08x, uniformBlockName:0x%08x)", program, uniformBlockIndex, bufSize, length, uniformBlockName);
+	AEMU_SCOPED_TRACE("glGetActiveUniformBlockName encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_length = ((length != NULL) ?  (sizeof(GLsizei)) : 0);
+	const unsigned int __size_uniformBlockName = ((uniformBlockName != NULL) ?  bufSize : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 0 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetActiveUniformBlockName;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &uniformBlockIndex, 4); ptr += 4;
+		memcpy(ptr, &bufSize, 4); ptr += 4;
+	memcpy(ptr, &__size_length, 4); ptr += 4;
+	memcpy(ptr, &__size_uniformBlockName, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	if (length != NULL) {
+		stream->readback(length, __size_length);
+		if (useChecksum) checksumCalculator->addBuffer(length, __size_length);
+	}
+	if (uniformBlockName != NULL) {
+		stream->readback(uniformBlockName, __size_uniformBlockName);
+		if (useChecksum) checksumCalculator->addBuffer(uniformBlockName, __size_uniformBlockName);
+	}
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetActiveUniformBlockName: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glUniform1ui_enc(void *self , GLint location, GLuint v0)
+{
+	ENCODER_DEBUG_LOG("glUniform1ui(location:%d, v0:%u)", location, v0);
+	AEMU_SCOPED_TRACE("glUniform1ui encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform1ui;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniform2ui_enc(void *self , GLint location, GLuint v0, GLuint v1)
+{
+	ENCODER_DEBUG_LOG("glUniform2ui(location:%d, v0:%u, v1:%u)", location, v0, v1);
+	AEMU_SCOPED_TRACE("glUniform2ui encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform2ui;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+		memcpy(ptr, &v1, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniform3ui_enc(void *self , GLint location, GLuint v0, GLuint v1, GLuint v2)
+{
+	ENCODER_DEBUG_LOG("glUniform3ui(location:%d, v0:%u, v1:%u, v2:%u)", location, v0, v1, v2);
+	AEMU_SCOPED_TRACE("glUniform3ui encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform3ui;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+		memcpy(ptr, &v1, 4); ptr += 4;
+		memcpy(ptr, &v2, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniform4ui_enc(void *self , GLint location, GLint v0, GLuint v1, GLuint v2, GLuint v3)
+{
+	ENCODER_DEBUG_LOG("glUniform4ui(location:%d, v0:%d, v1:%u, v2:%u, v3:%u)", location, v0, v1, v2, v3);
+	AEMU_SCOPED_TRACE("glUniform4ui encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform4ui;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+		memcpy(ptr, &v1, 4); ptr += 4;
+		memcpy(ptr, &v2, 4); ptr += 4;
+		memcpy(ptr, &v3, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniform1uiv_enc(void *self , GLint location, GLsizei count, const GLuint* value)
+{
+	ENCODER_DEBUG_LOG("glUniform1uiv(location:%d, count:%d, value:0x%08x)", location, count, value);
+	AEMU_SCOPED_TRACE("glUniform1uiv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform1uiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniform2uiv_enc(void *self , GLint location, GLsizei count, const GLuint* value)
+{
+	ENCODER_DEBUG_LOG("glUniform2uiv(location:%d, count:%d, value:0x%08x)", location, count, value);
+	AEMU_SCOPED_TRACE("glUniform2uiv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 2 * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform2uiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniform3uiv_enc(void *self , GLint location, GLsizei count, const GLuint* value)
+{
+	ENCODER_DEBUG_LOG("glUniform3uiv(location:%d, count:%d, value:0x%08x)", location, count, value);
+	AEMU_SCOPED_TRACE("glUniform3uiv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 3 * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform3uiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniform4uiv_enc(void *self , GLint location, GLsizei count, const GLuint* value)
+{
+	ENCODER_DEBUG_LOG("glUniform4uiv(location:%d, count:%d, value:0x%08x)", location, count, value);
+	AEMU_SCOPED_TRACE("glUniform4uiv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 4 * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform4uiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniformMatrix2x3fv_enc(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	ENCODER_DEBUG_LOG("glUniformMatrix2x3fv(location:%d, count:%d, transpose:%d, value:0x%08x)", location, count, transpose, value);
+	AEMU_SCOPED_TRACE("glUniformMatrix2x3fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 6 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniformMatrix2x3fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniformMatrix3x2fv_enc(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	ENCODER_DEBUG_LOG("glUniformMatrix3x2fv(location:%d, count:%d, transpose:%d, value:0x%08x)", location, count, transpose, value);
+	AEMU_SCOPED_TRACE("glUniformMatrix3x2fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 6 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniformMatrix3x2fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniformMatrix2x4fv_enc(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	ENCODER_DEBUG_LOG("glUniformMatrix2x4fv(location:%d, count:%d, transpose:%d, value:0x%08x)", location, count, transpose, value);
+	AEMU_SCOPED_TRACE("glUniformMatrix2x4fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 8 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniformMatrix2x4fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniformMatrix4x2fv_enc(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	ENCODER_DEBUG_LOG("glUniformMatrix4x2fv(location:%d, count:%d, transpose:%d, value:0x%08x)", location, count, transpose, value);
+	AEMU_SCOPED_TRACE("glUniformMatrix4x2fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 8 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniformMatrix4x2fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniformMatrix3x4fv_enc(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	ENCODER_DEBUG_LOG("glUniformMatrix3x4fv(location:%d, count:%d, transpose:%d, value:0x%08x)", location, count, transpose, value);
+	AEMU_SCOPED_TRACE("glUniformMatrix3x4fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 12 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniformMatrix3x4fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniformMatrix4x3fv_enc(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	ENCODER_DEBUG_LOG("glUniformMatrix4x3fv(location:%d, count:%d, transpose:%d, value:0x%08x)", location, count, transpose, value);
+	AEMU_SCOPED_TRACE("glUniformMatrix4x3fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 12 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniformMatrix4x3fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetUniformuiv_enc(void *self , GLuint program, GLint location, GLuint* params)
+{
+	ENCODER_DEBUG_LOG("glGetUniformuiv(program:%u, location:%d, params:0x%08x)", program, location, params);
+	AEMU_SCOPED_TRACE("glGetUniformuiv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  glSizeof(glesv2_enc::uniformType(self, program, location));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetUniformuiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetUniformuiv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetActiveUniformsiv_enc(void *self , GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glGetActiveUniformsiv(program:%u, uniformCount:%d, uniformIndices:0x%08x, pname:0x%08x, params:0x%08x)", program, uniformCount, uniformIndices, pname, params);
+	AEMU_SCOPED_TRACE("glGetActiveUniformsiv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_uniformIndices =  (uniformCount * sizeof(GLuint));
+	const unsigned int __size_params =  (uniformCount * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_uniformIndices + 4 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetActiveUniformsiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &uniformCount, 4); ptr += 4;
+	memcpy(ptr, &__size_uniformIndices, 4); ptr += 4;
+	memcpy(ptr, uniformIndices, __size_uniformIndices);ptr += __size_uniformIndices;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetActiveUniformsiv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glVertexAttribI4i_enc(void *self , GLuint index, GLint v0, GLint v1, GLint v2, GLint v3)
+{
+	ENCODER_DEBUG_LOG("glVertexAttribI4i(index:%u, v0:%d, v1:%d, v2:%d, v3:%d)", index, v0, v1, v2, v3);
+	AEMU_SCOPED_TRACE("glVertexAttribI4i encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttribI4i;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+		memcpy(ptr, &v1, 4); ptr += 4;
+		memcpy(ptr, &v2, 4); ptr += 4;
+		memcpy(ptr, &v3, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexAttribI4ui_enc(void *self , GLuint index, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
+{
+	ENCODER_DEBUG_LOG("glVertexAttribI4ui(index:%u, v0:%u, v1:%u, v2:%u, v3:%u)", index, v0, v1, v2, v3);
+	AEMU_SCOPED_TRACE("glVertexAttribI4ui encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttribI4ui;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+		memcpy(ptr, &v1, 4); ptr += 4;
+		memcpy(ptr, &v2, 4); ptr += 4;
+		memcpy(ptr, &v3, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexAttribI4iv_enc(void *self , GLuint index, const GLint* v)
+{
+	ENCODER_DEBUG_LOG("glVertexAttribI4iv(index:%u, v:0x%08x)", index, v);
+	AEMU_SCOPED_TRACE("glVertexAttribI4iv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_v =  (4 * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_v + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttribI4iv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &index, 4); ptr += 4;
+	memcpy(ptr, &__size_v, 4); ptr += 4;
+	memcpy(ptr, v, __size_v);ptr += __size_v;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexAttribI4uiv_enc(void *self , GLuint index, const GLuint* v)
+{
+	ENCODER_DEBUG_LOG("glVertexAttribI4uiv(index:%u, v:0x%08x)", index, v);
+	AEMU_SCOPED_TRACE("glVertexAttribI4uiv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_v =  (4 * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_v + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttribI4uiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &index, 4); ptr += 4;
+	memcpy(ptr, &__size_v, 4); ptr += 4;
+	memcpy(ptr, v, __size_v);ptr += __size_v;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexAttribIPointerOffsetAEMU_enc(void *self , GLuint index, GLint size, GLenum type, GLsizei stride, GLuint offset)
+{
+	ENCODER_DEBUG_LOG("glVertexAttribIPointerOffsetAEMU(index:%u, size:%d, type:0x%08x, stride:%d, offset:%u)", index, size, type, stride, offset);
+	AEMU_SCOPED_TRACE("glVertexAttribIPointerOffsetAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttribIPointerOffsetAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &size, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &stride, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexAttribIPointerDataAEMU_enc(void *self , GLuint index, GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
+{
+	ENCODER_DEBUG_LOG("glVertexAttribIPointerDataAEMU(index:%u, size:%d, type:0x%08x, stride:%d, data:0x%08x, datalen:%u)", index, size, type, stride, data, datalen);
+	AEMU_SCOPED_TRACE("glVertexAttribIPointerDataAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data =  datalen;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + __size_data + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttribIPointerDataAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &size, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &stride, 4); ptr += 4;
+	memcpy(ptr, &__size_data, 4); ptr += 4;
+	 glUtilsPackPointerData((unsigned char *)ptr, (unsigned char *)data, size, type, stride, datalen);ptr += __size_data;
+		memcpy(ptr, &datalen, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetVertexAttribIiv_enc(void *self , GLuint index, GLenum pname, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glGetVertexAttribIiv(index:%u, pname:0x%08x, params:0x%08x)", index, pname, params);
+	AEMU_SCOPED_TRACE("glGetVertexAttribIiv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetVertexAttribIiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetVertexAttribIiv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetVertexAttribIuiv_enc(void *self , GLuint index, GLenum pname, GLuint* params)
+{
+	ENCODER_DEBUG_LOG("glGetVertexAttribIuiv(index:%u, pname:0x%08x, params:0x%08x)", index, pname, params);
+	AEMU_SCOPED_TRACE("glGetVertexAttribIuiv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetVertexAttribIuiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetVertexAttribIuiv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glVertexAttribDivisor_enc(void *self , GLuint index, GLuint divisor)
+{
+	ENCODER_DEBUG_LOG("glVertexAttribDivisor(index:%u, divisor:%u)", index, divisor);
+	AEMU_SCOPED_TRACE("glVertexAttribDivisor encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttribDivisor;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &divisor, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawArraysInstanced_enc(void *self , GLenum mode, GLint first, GLsizei count, GLsizei primcount)
+{
+	ENCODER_DEBUG_LOG("glDrawArraysInstanced(mode:0x%08x, first:%d, count:%d, primcount:%d)", mode, first, count, primcount);
+	AEMU_SCOPED_TRACE("glDrawArraysInstanced encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawArraysInstanced;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+		memcpy(ptr, &first, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &primcount, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawElementsInstancedDataAEMU_enc(void *self , GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount, GLsizei datalen)
+{
+	ENCODER_DEBUG_LOG("glDrawElementsInstancedDataAEMU(mode:0x%08x, count:%d, type:0x%08x, indices:0x%08x, primcount:%d, datalen:%d)", mode, count, type, indices, primcount, datalen);
+	AEMU_SCOPED_TRACE("glDrawElementsInstancedDataAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_indices =  datalen;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_indices + 4 + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawElementsInstancedDataAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+	memcpy(ptr, &__size_indices, 4); ptr += 4;
+	memcpy(ptr, indices, __size_indices);ptr += __size_indices;
+		memcpy(ptr, &primcount, 4); ptr += 4;
+		memcpy(ptr, &datalen, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawElementsInstancedOffsetAEMU_enc(void *self , GLenum mode, GLsizei count, GLenum type, GLuint offset, GLsizei primcount)
+{
+	ENCODER_DEBUG_LOG("glDrawElementsInstancedOffsetAEMU(mode:0x%08x, count:%d, type:0x%08x, offset:%u, primcount:%d)", mode, count, type, offset, primcount);
+	AEMU_SCOPED_TRACE("glDrawElementsInstancedOffsetAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawElementsInstancedOffsetAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+		memcpy(ptr, &primcount, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawRangeElementsDataAEMU_enc(void *self , GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices, GLsizei datalen)
+{
+	ENCODER_DEBUG_LOG("glDrawRangeElementsDataAEMU(mode:0x%08x, start:%u, end:%u, count:%d, type:0x%08x, indices:0x%08x, datalen:%d)", mode, start, end, count, type, indices, datalen);
+	AEMU_SCOPED_TRACE("glDrawRangeElementsDataAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_indices =  datalen;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + __size_indices + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawRangeElementsDataAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+		memcpy(ptr, &start, 4); ptr += 4;
+		memcpy(ptr, &end, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+	memcpy(ptr, &__size_indices, 4); ptr += 4;
+	memcpy(ptr, indices, __size_indices);ptr += __size_indices;
+		memcpy(ptr, &datalen, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawRangeElementsOffsetAEMU_enc(void *self , GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLuint offset)
+{
+	ENCODER_DEBUG_LOG("glDrawRangeElementsOffsetAEMU(mode:0x%08x, start:%u, end:%u, count:%d, type:0x%08x, offset:%u)", mode, start, end, count, type, offset);
+	AEMU_SCOPED_TRACE("glDrawRangeElementsOffsetAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawRangeElementsOffsetAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+		memcpy(ptr, &start, 4); ptr += 4;
+		memcpy(ptr, &end, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+uint64_t glFenceSyncAEMU_enc(void *self , GLenum condition, GLbitfield flags)
+{
+	ENCODER_DEBUG_LOG("glFenceSyncAEMU(condition:0x%08x, flags:0x%08x)", condition, flags);
+	AEMU_SCOPED_TRACE("glFenceSyncAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFenceSyncAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &condition, 4); ptr += 4;
+		memcpy(ptr, &flags, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	uint64_t retval;
+	stream->readback(&retval, 8);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 8);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glFenceSyncAEMU: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+GLenum glClientWaitSyncAEMU_enc(void *self , uint64_t wait_on, GLbitfield flags, GLuint64 timeout)
+{
+	ENCODER_DEBUG_LOG("glClientWaitSyncAEMU(wait_on:0x%016lx, flags:0x%08x, timeout:0x%016lx)", wait_on, flags, timeout);
+	AEMU_SCOPED_TRACE("glClientWaitSyncAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 4 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClientWaitSyncAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &wait_on, 8); ptr += 8;
+		memcpy(ptr, &flags, 4); ptr += 4;
+		memcpy(ptr, &timeout, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLenum retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glClientWaitSyncAEMU: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glWaitSyncAEMU_enc(void *self , uint64_t wait_on, GLbitfield flags, GLuint64 timeout)
+{
+	ENCODER_DEBUG_LOG("glWaitSyncAEMU(wait_on:0x%016lx, flags:0x%08x, timeout:0x%016lx)", wait_on, flags, timeout);
+	AEMU_SCOPED_TRACE("glWaitSyncAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 4 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glWaitSyncAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &wait_on, 8); ptr += 8;
+		memcpy(ptr, &flags, 4); ptr += 4;
+		memcpy(ptr, &timeout, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDeleteSyncAEMU_enc(void *self , uint64_t to_delete)
+{
+	ENCODER_DEBUG_LOG("glDeleteSyncAEMU(to_delete:0x%016lx)", to_delete);
+	AEMU_SCOPED_TRACE("glDeleteSyncAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDeleteSyncAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &to_delete, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+GLboolean glIsSyncAEMU_enc(void *self , uint64_t sync)
+{
+	ENCODER_DEBUG_LOG("glIsSyncAEMU(sync:0x%016lx)", sync);
+	AEMU_SCOPED_TRACE("glIsSyncAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glIsSyncAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &sync, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glIsSyncAEMU: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glGetSyncivAEMU_enc(void *self , uint64_t sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values)
+{
+	ENCODER_DEBUG_LOG("glGetSyncivAEMU(sync:0x%016lx, pname:0x%08x, bufSize:%d, length:0x%08x, values:0x%08x)", sync, pname, bufSize, length, values);
+	AEMU_SCOPED_TRACE("glGetSyncivAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_length = ((length != NULL) ?  (sizeof(GLsizei)) : 0);
+	const unsigned int __size_values =  (bufSize * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 4 + 4 + 0 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetSyncivAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &sync, 8); ptr += 8;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &bufSize, 4); ptr += 4;
+	memcpy(ptr, &__size_length, 4); ptr += 4;
+	memcpy(ptr, &__size_values, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	if (length != NULL) {
+		stream->readback(length, __size_length);
+		if (useChecksum) checksumCalculator->addBuffer(length, __size_length);
+	}
+	stream->readback(values, __size_values);
+	if (useChecksum) checksumCalculator->addBuffer(values, __size_values);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetSyncivAEMU: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glDrawBuffers_enc(void *self , GLsizei n, const GLenum* bufs)
+{
+	ENCODER_DEBUG_LOG("glDrawBuffers(n:%d, bufs:0x%08x)", n, bufs);
+	AEMU_SCOPED_TRACE("glDrawBuffers encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_bufs =  (n * sizeof(GLenum));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_bufs + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawBuffers;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_bufs, 4); ptr += 4;
+	memcpy(ptr, bufs, __size_bufs);ptr += __size_bufs;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glReadBuffer_enc(void *self , GLenum src)
+{
+	ENCODER_DEBUG_LOG("glReadBuffer(src:0x%08x)", src);
+	AEMU_SCOPED_TRACE("glReadBuffer encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glReadBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &src, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBlitFramebuffer_enc(void *self , GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
+{
+	ENCODER_DEBUG_LOG("glBlitFramebuffer(srcX0:%d, srcY0:%d, srcX1:%d, srcY1:%d, dstX0:%d, dstY0:%d, dstX1:%d, dstY1:%d, mask:0x%08x, filter:0x%08x)", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
+	AEMU_SCOPED_TRACE("glBlitFramebuffer encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBlitFramebuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &srcX0, 4); ptr += 4;
+		memcpy(ptr, &srcY0, 4); ptr += 4;
+		memcpy(ptr, &srcX1, 4); ptr += 4;
+		memcpy(ptr, &srcY1, 4); ptr += 4;
+		memcpy(ptr, &dstX0, 4); ptr += 4;
+		memcpy(ptr, &dstY0, 4); ptr += 4;
+		memcpy(ptr, &dstX1, 4); ptr += 4;
+		memcpy(ptr, &dstY1, 4); ptr += 4;
+		memcpy(ptr, &mask, 4); ptr += 4;
+		memcpy(ptr, &filter, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glInvalidateFramebuffer_enc(void *self , GLenum target, GLsizei numAttachments, const GLenum* attachments)
+{
+	ENCODER_DEBUG_LOG("glInvalidateFramebuffer(target:0x%08x, numAttachments:%d, attachments:0x%08x)", target, numAttachments, attachments);
+	AEMU_SCOPED_TRACE("glInvalidateFramebuffer encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_attachments =  (numAttachments * sizeof(GLenum));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_attachments + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glInvalidateFramebuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &numAttachments, 4); ptr += 4;
+	memcpy(ptr, &__size_attachments, 4); ptr += 4;
+	memcpy(ptr, attachments, __size_attachments);ptr += __size_attachments;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glInvalidateSubFramebuffer_enc(void *self , GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+	ENCODER_DEBUG_LOG("glInvalidateSubFramebuffer(target:0x%08x, numAttachments:%d, attachments:0x%08x, x:%d, y:%d, width:%d, height:%d)", target, numAttachments, attachments, x, y, width, height);
+	AEMU_SCOPED_TRACE("glInvalidateSubFramebuffer encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_attachments =  (numAttachments * sizeof(GLenum));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_attachments + 4 + 4 + 4 + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glInvalidateSubFramebuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &numAttachments, 4); ptr += 4;
+	memcpy(ptr, &__size_attachments, 4); ptr += 4;
+	memcpy(ptr, attachments, __size_attachments);ptr += __size_attachments;
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glFramebufferTextureLayer_enc(void *self , GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
+{
+	ENCODER_DEBUG_LOG("glFramebufferTextureLayer(target:0x%08x, attachment:0x%08x, texture:%u, level:%d, layer:%d)", target, attachment, texture, level, layer);
+	AEMU_SCOPED_TRACE("glFramebufferTextureLayer encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFramebufferTextureLayer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &attachment, 4); ptr += 4;
+		memcpy(ptr, &texture, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &layer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glRenderbufferStorageMultisample_enc(void *self , GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
+{
+	ENCODER_DEBUG_LOG("glRenderbufferStorageMultisample(target:0x%08x, samples:%d, internalformat:0x%08x, width:%d, height:%d)", target, samples, internalformat, width, height);
+	AEMU_SCOPED_TRACE("glRenderbufferStorageMultisample encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glRenderbufferStorageMultisample;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &samples, 4); ptr += 4;
+		memcpy(ptr, &internalformat, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexStorage2D_enc(void *self , GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
+{
+	ENCODER_DEBUG_LOG("glTexStorage2D(target:0x%08x, levels:%d, internalformat:0x%08x, width:%d, height:%d)", target, levels, internalformat, width, height);
+	AEMU_SCOPED_TRACE("glTexStorage2D encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexStorage2D;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &levels, 4); ptr += 4;
+		memcpy(ptr, &internalformat, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetInternalformativ_enc(void *self , GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glGetInternalformativ(target:0x%08x, internalformat:0x%08x, pname:0x%08x, bufSize:%d, params:0x%08x)", target, internalformat, pname, bufSize, params);
+	AEMU_SCOPED_TRACE("glGetInternalformativ encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (sizeof(GLint) * bufSize);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetInternalformativ;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &internalformat, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &bufSize, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetInternalformativ: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glBeginTransformFeedback_enc(void *self , GLenum primitiveMode)
+{
+	ENCODER_DEBUG_LOG("glBeginTransformFeedback(primitiveMode:0x%08x)", primitiveMode);
+	AEMU_SCOPED_TRACE("glBeginTransformFeedback encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBeginTransformFeedback;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &primitiveMode, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glEndTransformFeedback_enc(void *self )
+{
+	ENCODER_DEBUG_LOG("glEndTransformFeedback()");
+	AEMU_SCOPED_TRACE("glEndTransformFeedback encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glEndTransformFeedback;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGenTransformFeedbacks_enc(void *self , GLsizei n, GLuint* ids)
+{
+	ENCODER_DEBUG_LOG("glGenTransformFeedbacks(n:%d, ids:0x%08x)", n, ids);
+	AEMU_SCOPED_TRACE("glGenTransformFeedbacks encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_ids =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGenTransformFeedbacks;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_ids, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(ids, __size_ids);
+	if (useChecksum) checksumCalculator->addBuffer(ids, __size_ids);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGenTransformFeedbacks: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glDeleteTransformFeedbacks_enc(void *self , GLsizei n, const GLuint* ids)
+{
+	ENCODER_DEBUG_LOG("glDeleteTransformFeedbacks(n:%d, ids:0x%08x)", n, ids);
+	AEMU_SCOPED_TRACE("glDeleteTransformFeedbacks encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_ids =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_ids + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDeleteTransformFeedbacks;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_ids, 4); ptr += 4;
+	memcpy(ptr, ids, __size_ids);ptr += __size_ids;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBindTransformFeedback_enc(void *self , GLenum target, GLuint id)
+{
+	ENCODER_DEBUG_LOG("glBindTransformFeedback(target:0x%08x, id:%u)", target, id);
+	AEMU_SCOPED_TRACE("glBindTransformFeedback encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBindTransformFeedback;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &id, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glPauseTransformFeedback_enc(void *self )
+{
+	ENCODER_DEBUG_LOG("glPauseTransformFeedback()");
+	AEMU_SCOPED_TRACE("glPauseTransformFeedback encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glPauseTransformFeedback;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glResumeTransformFeedback_enc(void *self )
+{
+	ENCODER_DEBUG_LOG("glResumeTransformFeedback()");
+	AEMU_SCOPED_TRACE("glResumeTransformFeedback encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glResumeTransformFeedback;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+GLboolean glIsTransformFeedback_enc(void *self , GLuint id)
+{
+	ENCODER_DEBUG_LOG("glIsTransformFeedback(id:%u)", id);
+	AEMU_SCOPED_TRACE("glIsTransformFeedback encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glIsTransformFeedback;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &id, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glIsTransformFeedback: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glTransformFeedbackVaryingsAEMU_enc(void *self , GLuint program, GLsizei count, const char* packedVaryings, GLuint packedVaryingsLen, GLenum bufferMode)
+{
+	ENCODER_DEBUG_LOG("glTransformFeedbackVaryingsAEMU(program:%u, count:%d, packedVaryings:0x%08x, packedVaryingsLen:%u, bufferMode:0x%08x)", program, count, packedVaryings, packedVaryingsLen, bufferMode);
+	AEMU_SCOPED_TRACE("glTransformFeedbackVaryingsAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_packedVaryings =  packedVaryingsLen;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_packedVaryings + 4 + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTransformFeedbackVaryingsAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	memcpy(ptr, &__size_packedVaryings, 4); ptr += 4;
+	memcpy(ptr, packedVaryings, __size_packedVaryings);ptr += __size_packedVaryings;
+		memcpy(ptr, &packedVaryingsLen, 4); ptr += 4;
+		memcpy(ptr, &bufferMode, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetTransformFeedbackVarying_enc(void *self , GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, char* name)
+{
+	ENCODER_DEBUG_LOG("glGetTransformFeedbackVarying(program:%u, index:%u, bufSize:%d, length:0x%08x, size:0x%08x, type:0x%08x, name:0x%08x)", program, index, bufSize, length, size, type, name);
+	AEMU_SCOPED_TRACE("glGetTransformFeedbackVarying encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_length = ((length != NULL) ?  (sizeof(GLsizei)) : 0);
+	const unsigned int __size_size =  (sizeof(GLsizei));
+	const unsigned int __size_type = ((type != NULL) ?  (sizeof(GLenum)) : 0);
+	const unsigned int __size_name = ((name != NULL) ?  bufSize : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 0 + 0 + 0 + 0 + 4*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetTransformFeedbackVarying;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &bufSize, 4); ptr += 4;
+	memcpy(ptr, &__size_length, 4); ptr += 4;
+	memcpy(ptr, &__size_size, 4); ptr += 4;
+	memcpy(ptr, &__size_type, 4); ptr += 4;
+	memcpy(ptr, &__size_name, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	if (length != NULL) {
+		stream->readback(length, __size_length);
+		if (useChecksum) checksumCalculator->addBuffer(length, __size_length);
+	}
+	stream->readback(size, __size_size);
+	if (useChecksum) checksumCalculator->addBuffer(size, __size_size);
+	if (type != NULL) {
+		stream->readback(type, __size_type);
+		if (useChecksum) checksumCalculator->addBuffer(type, __size_type);
+	}
+	if (name != NULL) {
+		stream->readback(name, __size_name);
+		if (useChecksum) checksumCalculator->addBuffer(name, __size_name);
+	}
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetTransformFeedbackVarying: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGenSamplers_enc(void *self , GLsizei n, GLuint* samplers)
+{
+	ENCODER_DEBUG_LOG("glGenSamplers(n:%d, samplers:0x%08x)", n, samplers);
+	AEMU_SCOPED_TRACE("glGenSamplers encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_samplers =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGenSamplers;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_samplers, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(samplers, __size_samplers);
+	if (useChecksum) checksumCalculator->addBuffer(samplers, __size_samplers);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGenSamplers: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glDeleteSamplers_enc(void *self , GLsizei n, const GLuint* samplers)
+{
+	ENCODER_DEBUG_LOG("glDeleteSamplers(n:%d, samplers:0x%08x)", n, samplers);
+	AEMU_SCOPED_TRACE("glDeleteSamplers encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_samplers =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_samplers + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDeleteSamplers;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_samplers, 4); ptr += 4;
+	memcpy(ptr, samplers, __size_samplers);ptr += __size_samplers;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBindSampler_enc(void *self , GLuint unit, GLuint sampler)
+{
+	ENCODER_DEBUG_LOG("glBindSampler(unit:%u, sampler:%u)", unit, sampler);
+	AEMU_SCOPED_TRACE("glBindSampler encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBindSampler;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &unit, 4); ptr += 4;
+		memcpy(ptr, &sampler, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glSamplerParameterf_enc(void *self , GLuint sampler, GLenum pname, GLfloat param)
+{
+	ENCODER_DEBUG_LOG("glSamplerParameterf(sampler:%u, pname:0x%08x, param:%f)", sampler, pname, param);
+	AEMU_SCOPED_TRACE("glSamplerParameterf encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glSamplerParameterf;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &sampler, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glSamplerParameteri_enc(void *self , GLuint sampler, GLenum pname, GLint param)
+{
+	ENCODER_DEBUG_LOG("glSamplerParameteri(sampler:%u, pname:0x%08x, param:%d)", sampler, pname, param);
+	AEMU_SCOPED_TRACE("glSamplerParameteri encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glSamplerParameteri;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &sampler, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glSamplerParameterfv_enc(void *self , GLuint sampler, GLenum pname, const GLfloat* params)
+{
+	ENCODER_DEBUG_LOG("glSamplerParameterfv(sampler:%u, pname:0x%08x, params:0x%08x)", sampler, pname, params);
+	AEMU_SCOPED_TRACE("glSamplerParameterfv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glSamplerParameterfv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &sampler, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glSamplerParameteriv_enc(void *self , GLuint sampler, GLenum pname, const GLint* params)
+{
+	ENCODER_DEBUG_LOG("glSamplerParameteriv(sampler:%u, pname:0x%08x, params:0x%08x)", sampler, pname, params);
+	AEMU_SCOPED_TRACE("glSamplerParameteriv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glSamplerParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &sampler, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetSamplerParameterfv_enc(void *self , GLuint sampler, GLenum pname, GLfloat* params)
+{
+	ENCODER_DEBUG_LOG("glGetSamplerParameterfv(sampler:%u, pname:0x%08x, params:0x%08x)", sampler, pname, params);
+	AEMU_SCOPED_TRACE("glGetSamplerParameterfv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetSamplerParameterfv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &sampler, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetSamplerParameterfv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetSamplerParameteriv_enc(void *self , GLuint sampler, GLenum pname, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glGetSamplerParameteriv(sampler:%u, pname:0x%08x, params:0x%08x)", sampler, pname, params);
+	AEMU_SCOPED_TRACE("glGetSamplerParameteriv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetSamplerParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &sampler, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetSamplerParameteriv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+GLboolean glIsSampler_enc(void *self , GLuint sampler)
+{
+	ENCODER_DEBUG_LOG("glIsSampler(sampler:%u)", sampler);
+	AEMU_SCOPED_TRACE("glIsSampler encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glIsSampler;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &sampler, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glIsSampler: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glGenQueries_enc(void *self , GLsizei n, GLuint* queries)
+{
+	ENCODER_DEBUG_LOG("glGenQueries(n:%d, queries:0x%08x)", n, queries);
+	AEMU_SCOPED_TRACE("glGenQueries encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_queries =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGenQueries;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_queries, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(queries, __size_queries);
+	if (useChecksum) checksumCalculator->addBuffer(queries, __size_queries);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGenQueries: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glDeleteQueries_enc(void *self , GLsizei n, const GLuint* queries)
+{
+	ENCODER_DEBUG_LOG("glDeleteQueries(n:%d, queries:0x%08x)", n, queries);
+	AEMU_SCOPED_TRACE("glDeleteQueries encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_queries =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_queries + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDeleteQueries;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_queries, 4); ptr += 4;
+	memcpy(ptr, queries, __size_queries);ptr += __size_queries;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBeginQuery_enc(void *self , GLenum target, GLuint query)
+{
+	ENCODER_DEBUG_LOG("glBeginQuery(target:0x%08x, query:%u)", target, query);
+	AEMU_SCOPED_TRACE("glBeginQuery encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBeginQuery;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &query, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glEndQuery_enc(void *self , GLenum target)
+{
+	ENCODER_DEBUG_LOG("glEndQuery(target:0x%08x)", target);
+	AEMU_SCOPED_TRACE("glEndQuery encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glEndQuery;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetQueryiv_enc(void *self , GLenum target, GLenum pname, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glGetQueryiv(target:0x%08x, pname:0x%08x, params:0x%08x)", target, pname, params);
+	AEMU_SCOPED_TRACE("glGetQueryiv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetQueryiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetQueryiv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetQueryObjectuiv_enc(void *self , GLuint query, GLenum pname, GLuint* params)
+{
+	ENCODER_DEBUG_LOG("glGetQueryObjectuiv(query:%u, pname:0x%08x, params:0x%08x)", query, pname, params);
+	AEMU_SCOPED_TRACE("glGetQueryObjectuiv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetQueryObjectuiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &query, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetQueryObjectuiv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+GLboolean glIsQuery_enc(void *self , GLuint query)
+{
+	ENCODER_DEBUG_LOG("glIsQuery(query:%u)", query);
+	AEMU_SCOPED_TRACE("glIsQuery encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glIsQuery;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &query, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glIsQuery: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glProgramParameteri_enc(void *self , GLuint program, GLenum pname, GLint value)
+{
+	ENCODER_DEBUG_LOG("glProgramParameteri(program:%u, pname:0x%08x, value:%d)", program, pname, value);
+	AEMU_SCOPED_TRACE("glProgramParameteri encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramParameteri;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &value, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramBinary_enc(void *self , GLuint program, GLenum binaryFormat, const void* binary, GLsizei length)
+{
+	ENCODER_DEBUG_LOG("glProgramBinary(program:%u, binaryFormat:0x%08x, binary:0x%08x, length:%d)", program, binaryFormat, binary, length);
+	AEMU_SCOPED_TRACE("glProgramBinary encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_binary =  length;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_binary + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramBinary;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &binaryFormat, 4); ptr += 4;
+	memcpy(ptr, &__size_binary, 4); ptr += 4;
+	memcpy(ptr, binary, __size_binary);ptr += __size_binary;
+		memcpy(ptr, &length, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetProgramBinary_enc(void *self , GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, void* binary)
+{
+	ENCODER_DEBUG_LOG("glGetProgramBinary(program:%u, bufSize:%d, length:0x%08x, binaryFormat:0x%08x, binary:0x%08x)", program, bufSize, length, binaryFormat, binary);
+	AEMU_SCOPED_TRACE("glGetProgramBinary encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_length = ((length != NULL) ?  (sizeof(GLsizei)) : 0);
+	const unsigned int __size_binaryFormat =  (sizeof(GLenum));
+	const unsigned int __size_binary =  bufSize;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 0 + 0 + 3*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetProgramBinary;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &bufSize, 4); ptr += 4;
+	memcpy(ptr, &__size_length, 4); ptr += 4;
+	memcpy(ptr, &__size_binaryFormat, 4); ptr += 4;
+	memcpy(ptr, &__size_binary, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	if (length != NULL) {
+		stream->readback(length, __size_length);
+		if (useChecksum) checksumCalculator->addBuffer(length, __size_length);
+	}
+	stream->readback(binaryFormat, __size_binaryFormat);
+	if (useChecksum) checksumCalculator->addBuffer(binaryFormat, __size_binaryFormat);
+	stream->readback(binary, __size_binary);
+	if (useChecksum) checksumCalculator->addBuffer(binary, __size_binary);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetProgramBinary: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+GLint glGetFragDataLocation_enc(void *self , GLuint program, const char* name)
+{
+	ENCODER_DEBUG_LOG("glGetFragDataLocation(program:%u, name:0x%08x)", program, name);
+	AEMU_SCOPED_TRACE("glGetFragDataLocation encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_name =  (strlen(name) + 1);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_name + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetFragDataLocation;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+	memcpy(ptr, &__size_name, 4); ptr += 4;
+	memcpy(ptr, name, __size_name);ptr += __size_name;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLint retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetFragDataLocation: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glGetInteger64v_enc(void *self , GLenum pname, GLint64* data)
+{
+	ENCODER_DEBUG_LOG("glGetInteger64v(pname:0x%08x, data:%p)", pname, data);
+	AEMU_SCOPED_TRACE("glGetInteger64v encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data =  (glUtilsParamSize(pname) * sizeof(GLint64));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetInteger64v;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_data, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(data, __size_data);
+	if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetInteger64v: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetIntegeri_v_enc(void *self , GLenum target, GLuint index, GLint* data)
+{
+	ENCODER_DEBUG_LOG("glGetIntegeri_v(target:0x%08x, index:%u, data:0x%08x)", target, index, data);
+	AEMU_SCOPED_TRACE("glGetIntegeri_v encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data =  (sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetIntegeri_v;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &index, 4); ptr += 4;
+	memcpy(ptr, &__size_data, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(data, __size_data);
+	if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetIntegeri_v: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetInteger64i_v_enc(void *self , GLenum target, GLuint index, GLint64* data)
+{
+	ENCODER_DEBUG_LOG("glGetInteger64i_v(target:0x%08x, index:%u, data:%p)", target, index, data);
+	AEMU_SCOPED_TRACE("glGetInteger64i_v encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data =  (sizeof(GLint64));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetInteger64i_v;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &index, 4); ptr += 4;
+	memcpy(ptr, &__size_data, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(data, __size_data);
+	if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetInteger64i_v: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glTexImage3D_enc(void *self , GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* data)
+{
+	ENCODER_DEBUG_LOG("glTexImage3D(target:0x%08x, level:%d, internalFormat:%d, width:%d, height:%d, depth:%d, border:%d, format:0x%08x, type:0x%08x, data:0x%08x)", target, level, internalFormat, width, height, depth, border, format, type, data);
+	AEMU_SCOPED_TRACE("glTexImage3D encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data = ((data != NULL) ?  glesv2_enc::pixelDataSize3D(self, width, height, depth, format, type, 0) : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_data + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
+	ptr = buf;
+	int tmp = OP_glTexImage3D;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &internalFormat, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &depth, 4); ptr += 4;
+		memcpy(ptr, &border, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	stream->flush();
+	stream->writeFully(&__size_data,4);
+	if (useChecksum) checksumCalculator->addBuffer(&__size_data,4);
+	if (data != NULL) {
+		 stream->uploadPixels(self, width, height, depth, format, type, data);
+		if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
+	}
+	buf = stream->alloc(checksumSize);
+	if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
+
+}
+
+void glTexImage3DOffsetAEMU_enc(void *self , GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLuint offset)
+{
+	ENCODER_DEBUG_LOG("glTexImage3DOffsetAEMU(target:0x%08x, level:%d, internalFormat:%d, width:%d, height:%d, depth:%d, border:%d, format:0x%08x, type:0x%08x, offset:%u)", target, level, internalFormat, width, height, depth, border, format, type, offset);
+	AEMU_SCOPED_TRACE("glTexImage3DOffsetAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexImage3DOffsetAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &internalFormat, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &depth, 4); ptr += 4;
+		memcpy(ptr, &border, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexStorage3D_enc(void *self , GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
+{
+	ENCODER_DEBUG_LOG("glTexStorage3D(target:0x%08x, levels:%d, internalformat:0x%08x, width:%d, height:%d, depth:%d)", target, levels, internalformat, width, height, depth);
+	AEMU_SCOPED_TRACE("glTexStorage3D encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexStorage3D;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &levels, 4); ptr += 4;
+		memcpy(ptr, &internalformat, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &depth, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexSubImage3D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* data)
+{
+	ENCODER_DEBUG_LOG("glTexSubImage3D(target:0x%08x, level:%d, xoffset:%d, yoffset:%d, zoffset:%d, width:%d, height:%d, depth:%d, format:0x%08x, type:0x%08x, data:0x%08x)", target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data);
+	AEMU_SCOPED_TRACE("glTexSubImage3D encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data = ((data != NULL) ?  glesv2_enc::pixelDataSize3D(self, width, height, depth, format, type, 0) : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_data + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
+	ptr = buf;
+	int tmp = OP_glTexSubImage3D;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &xoffset, 4); ptr += 4;
+		memcpy(ptr, &yoffset, 4); ptr += 4;
+		memcpy(ptr, &zoffset, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &depth, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	stream->flush();
+	stream->writeFully(&__size_data,4);
+	if (useChecksum) checksumCalculator->addBuffer(&__size_data,4);
+	if (data != NULL) {
+		 stream->uploadPixels(self, width, height, depth, format, type, data);
+		if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
+	}
+	buf = stream->alloc(checksumSize);
+	if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
+
+}
+
+void glTexSubImage3DOffsetAEMU_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLuint offset)
+{
+	ENCODER_DEBUG_LOG("glTexSubImage3DOffsetAEMU(target:0x%08x, level:%d, xoffset:%d, yoffset:%d, zoffset:%d, width:%d, height:%d, depth:%d, format:0x%08x, type:0x%08x, offset:%u)", target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, offset);
+	AEMU_SCOPED_TRACE("glTexSubImage3DOffsetAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexSubImage3DOffsetAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &xoffset, 4); ptr += 4;
+		memcpy(ptr, &yoffset, 4); ptr += 4;
+		memcpy(ptr, &zoffset, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &depth, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glCompressedTexImage3D_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data)
+{
+	ENCODER_DEBUG_LOG("glCompressedTexImage3D(target:0x%08x, level:%d, internalformat:0x%08x, width:%d, height:%d, depth:%d, border:%d, imageSize:%d, data:0x%08x)", target, level, internalformat, width, height, depth, border, imageSize, data);
+	AEMU_SCOPED_TRACE("glCompressedTexImage3D encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data = ((data != NULL) ?  imageSize : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_data + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
+	ptr = buf;
+	int tmp = OP_glCompressedTexImage3D;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &internalformat, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &depth, 4); ptr += 4;
+		memcpy(ptr, &border, 4); ptr += 4;
+		memcpy(ptr, &imageSize, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	stream->flush();
+	stream->writeFully(&__size_data,4);
+	if (useChecksum) checksumCalculator->addBuffer(&__size_data,4);
+	if (data != NULL) {
+		stream->writeFully(data, __size_data);
+		if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
+	}
+	buf = stream->alloc(checksumSize);
+	if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
+
+}
+
+void glCompressedTexImage3DOffsetAEMU_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, GLuint offset)
+{
+	ENCODER_DEBUG_LOG("glCompressedTexImage3DOffsetAEMU(target:0x%08x, level:%d, internalformat:0x%08x, width:%d, height:%d, depth:%d, border:%d, imageSize:%d, offset:%u)", target, level, internalformat, width, height, depth, border, imageSize, offset);
+	AEMU_SCOPED_TRACE("glCompressedTexImage3DOffsetAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glCompressedTexImage3DOffsetAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &internalformat, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &depth, 4); ptr += 4;
+		memcpy(ptr, &border, 4); ptr += 4;
+		memcpy(ptr, &imageSize, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glCompressedTexSubImage3D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data)
+{
+	ENCODER_DEBUG_LOG("glCompressedTexSubImage3D(target:0x%08x, level:%d, xoffset:%d, yoffset:%d, zoffset:%d, width:%d, height:%d, depth:%d, format:0x%08x, imageSize:%d, data:0x%08x)", target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
+	AEMU_SCOPED_TRACE("glCompressedTexSubImage3D encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data = ((data != NULL) ?  imageSize : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_data + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
+	ptr = buf;
+	int tmp = OP_glCompressedTexSubImage3D;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &xoffset, 4); ptr += 4;
+		memcpy(ptr, &yoffset, 4); ptr += 4;
+		memcpy(ptr, &zoffset, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &depth, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &imageSize, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	stream->flush();
+	stream->writeFully(&__size_data,4);
+	if (useChecksum) checksumCalculator->addBuffer(&__size_data,4);
+	if (data != NULL) {
+		stream->writeFully(data, __size_data);
+		if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
+	}
+	buf = stream->alloc(checksumSize);
+	if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
+
+}
+
+void glCompressedTexSubImage3DOffsetAEMU_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, GLuint data)
+{
+	ENCODER_DEBUG_LOG("glCompressedTexSubImage3DOffsetAEMU(target:0x%08x, level:%d, xoffset:%d, yoffset:%d, zoffset:%d, width:%d, height:%d, depth:%d, format:0x%08x, imageSize:%d, data:%u)", target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
+	AEMU_SCOPED_TRACE("glCompressedTexSubImage3DOffsetAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glCompressedTexSubImage3DOffsetAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &xoffset, 4); ptr += 4;
+		memcpy(ptr, &yoffset, 4); ptr += 4;
+		memcpy(ptr, &zoffset, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &depth, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &imageSize, 4); ptr += 4;
+		memcpy(ptr, &data, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glCopyTexSubImage3D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+	ENCODER_DEBUG_LOG("glCopyTexSubImage3D(target:0x%08x, level:%d, xoffset:%d, yoffset:%d, zoffset:%d, x:%d, y:%d, width:%d, height:%d)", target, level, xoffset, yoffset, zoffset, x, y, width, height);
+	AEMU_SCOPED_TRACE("glCopyTexSubImage3D encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glCopyTexSubImage3D;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &xoffset, 4); ptr += 4;
+		memcpy(ptr, &yoffset, 4); ptr += 4;
+		memcpy(ptr, &zoffset, 4); ptr += 4;
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetBooleani_v_enc(void *self , GLenum target, GLuint index, GLboolean* data)
+{
+	ENCODER_DEBUG_LOG("glGetBooleani_v(target:0x%08x, index:%u, data:0x%08x)", target, index, data);
+	AEMU_SCOPED_TRACE("glGetBooleani_v encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data =  (sizeof(GLboolean));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetBooleani_v;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &index, 4); ptr += 4;
+	memcpy(ptr, &__size_data, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(data, __size_data);
+	if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetBooleani_v: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glMemoryBarrier_enc(void *self , GLbitfield barriers)
+{
+	ENCODER_DEBUG_LOG("glMemoryBarrier(barriers:0x%08x)", barriers);
+	AEMU_SCOPED_TRACE("glMemoryBarrier encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glMemoryBarrier;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &barriers, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glMemoryBarrierByRegion_enc(void *self , GLbitfield barriers)
+{
+	ENCODER_DEBUG_LOG("glMemoryBarrierByRegion(barriers:0x%08x)", barriers);
+	AEMU_SCOPED_TRACE("glMemoryBarrierByRegion encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glMemoryBarrierByRegion;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &barriers, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGenProgramPipelines_enc(void *self , GLsizei n, GLuint* pipelines)
+{
+	ENCODER_DEBUG_LOG("glGenProgramPipelines(n:%d, pipelines:0x%08x)", n, pipelines);
+	AEMU_SCOPED_TRACE("glGenProgramPipelines encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_pipelines =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGenProgramPipelines;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_pipelines, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(pipelines, __size_pipelines);
+	if (useChecksum) checksumCalculator->addBuffer(pipelines, __size_pipelines);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGenProgramPipelines: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glDeleteProgramPipelines_enc(void *self , GLsizei n, const GLuint* pipelines)
+{
+	ENCODER_DEBUG_LOG("glDeleteProgramPipelines(n:%d, pipelines:0x%08x)", n, pipelines);
+	AEMU_SCOPED_TRACE("glDeleteProgramPipelines encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_pipelines =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_pipelines + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDeleteProgramPipelines;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	memcpy(ptr, &__size_pipelines, 4); ptr += 4;
+	memcpy(ptr, pipelines, __size_pipelines);ptr += __size_pipelines;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBindProgramPipeline_enc(void *self , GLuint pipeline)
+{
+	ENCODER_DEBUG_LOG("glBindProgramPipeline(pipeline:%u)", pipeline);
+	AEMU_SCOPED_TRACE("glBindProgramPipeline encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBindProgramPipeline;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pipeline, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetProgramPipelineiv_enc(void *self , GLuint pipeline, GLenum pname, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glGetProgramPipelineiv(pipeline:%u, pname:0x%08x, params:0x%08x)", pipeline, pname, params);
+	AEMU_SCOPED_TRACE("glGetProgramPipelineiv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetProgramPipelineiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pipeline, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetProgramPipelineiv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetProgramPipelineInfoLog_enc(void *self , GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar* infoLog)
+{
+	ENCODER_DEBUG_LOG("glGetProgramPipelineInfoLog(pipeline:%u, bufSize:%d, length:0x%08x, infoLog:0x%08x)", pipeline, bufSize, length, infoLog);
+	AEMU_SCOPED_TRACE("glGetProgramPipelineInfoLog encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_length = ((length != NULL) ?  sizeof(GLsizei) : 0);
+	const unsigned int __size_infoLog =  bufSize;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetProgramPipelineInfoLog;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pipeline, 4); ptr += 4;
+		memcpy(ptr, &bufSize, 4); ptr += 4;
+	memcpy(ptr, &__size_length, 4); ptr += 4;
+	memcpy(ptr, &__size_infoLog, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	if (length != NULL) {
+		stream->readback(length, __size_length);
+		if (useChecksum) checksumCalculator->addBuffer(length, __size_length);
+	}
+	stream->readback(infoLog, __size_infoLog);
+	if (useChecksum) checksumCalculator->addBuffer(infoLog, __size_infoLog);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetProgramPipelineInfoLog: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glValidateProgramPipeline_enc(void *self , GLuint pipeline)
+{
+	ENCODER_DEBUG_LOG("glValidateProgramPipeline(pipeline:%u)", pipeline);
+	AEMU_SCOPED_TRACE("glValidateProgramPipeline encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glValidateProgramPipeline;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pipeline, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+GLboolean glIsProgramPipeline_enc(void *self , GLuint pipeline)
+{
+	ENCODER_DEBUG_LOG("glIsProgramPipeline(pipeline:%u)", pipeline);
+	AEMU_SCOPED_TRACE("glIsProgramPipeline encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glIsProgramPipeline;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pipeline, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glIsProgramPipeline: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glUseProgramStages_enc(void *self , GLuint pipeline, GLbitfield stages, GLuint program)
+{
+	ENCODER_DEBUG_LOG("glUseProgramStages(pipeline:%u, stages:0x%08x, program:%u)", pipeline, stages, program);
+	AEMU_SCOPED_TRACE("glUseProgramStages encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUseProgramStages;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pipeline, 4); ptr += 4;
+		memcpy(ptr, &stages, 4); ptr += 4;
+		memcpy(ptr, &program, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glActiveShaderProgram_enc(void *self , GLuint pipeline, GLuint program)
+{
+	ENCODER_DEBUG_LOG("glActiveShaderProgram(pipeline:%u, program:%u)", pipeline, program);
+	AEMU_SCOPED_TRACE("glActiveShaderProgram encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glActiveShaderProgram;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pipeline, 4); ptr += 4;
+		memcpy(ptr, &program, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+GLuint glCreateShaderProgramvAEMU_enc(void *self , GLenum type, GLsizei count, const char* packedStrings, GLuint packedLen)
+{
+	ENCODER_DEBUG_LOG("glCreateShaderProgramvAEMU(type:0x%08x, count:%d, packedStrings:0x%08x, packedLen:%u)", type, count, packedStrings, packedLen);
+	AEMU_SCOPED_TRACE("glCreateShaderProgramvAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_packedStrings =  packedLen;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_packedStrings + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glCreateShaderProgramvAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	memcpy(ptr, &__size_packedStrings, 4); ptr += 4;
+	memcpy(ptr, packedStrings, __size_packedStrings);ptr += __size_packedStrings;
+		memcpy(ptr, &packedLen, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLuint retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glCreateShaderProgramvAEMU: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glProgramUniform1f_enc(void *self , GLuint program, GLint location, GLfloat v0)
+{
+	ENCODER_DEBUG_LOG("glProgramUniform1f(program:%u, location:%d, v0:%f)", program, location, v0);
+	AEMU_SCOPED_TRACE("glProgramUniform1f encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform1f;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform2f_enc(void *self , GLuint program, GLint location, GLfloat v0, GLfloat v1)
+{
+	ENCODER_DEBUG_LOG("glProgramUniform2f(program:%u, location:%d, v0:%f, v1:%f)", program, location, v0, v1);
+	AEMU_SCOPED_TRACE("glProgramUniform2f encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform2f;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+		memcpy(ptr, &v1, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform3f_enc(void *self , GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
+{
+	ENCODER_DEBUG_LOG("glProgramUniform3f(program:%u, location:%d, v0:%f, v1:%f, v2:%f)", program, location, v0, v1, v2);
+	AEMU_SCOPED_TRACE("glProgramUniform3f encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform3f;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+		memcpy(ptr, &v1, 4); ptr += 4;
+		memcpy(ptr, &v2, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform4f_enc(void *self , GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
+{
+	ENCODER_DEBUG_LOG("glProgramUniform4f(program:%u, location:%d, v0:%f, v1:%f, v2:%f, v3:%f)", program, location, v0, v1, v2, v3);
+	AEMU_SCOPED_TRACE("glProgramUniform4f encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform4f;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+		memcpy(ptr, &v1, 4); ptr += 4;
+		memcpy(ptr, &v2, 4); ptr += 4;
+		memcpy(ptr, &v3, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform1i_enc(void *self , GLuint program, GLint location, GLint v0)
+{
+	ENCODER_DEBUG_LOG("glProgramUniform1i(program:%u, location:%d, v0:%d)", program, location, v0);
+	AEMU_SCOPED_TRACE("glProgramUniform1i encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform1i;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform2i_enc(void *self , GLuint program, GLint location, GLint v0, GLint v1)
+{
+	ENCODER_DEBUG_LOG("glProgramUniform2i(program:%u, location:%d, v0:%d, v1:%d)", program, location, v0, v1);
+	AEMU_SCOPED_TRACE("glProgramUniform2i encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform2i;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+		memcpy(ptr, &v1, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform3i_enc(void *self , GLuint program, GLint location, GLint v0, GLint v1, GLint v2)
+{
+	ENCODER_DEBUG_LOG("glProgramUniform3i(program:%u, location:%d, v0:%d, v1:%d, v2:%d)", program, location, v0, v1, v2);
+	AEMU_SCOPED_TRACE("glProgramUniform3i encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform3i;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+		memcpy(ptr, &v1, 4); ptr += 4;
+		memcpy(ptr, &v2, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform4i_enc(void *self , GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
+{
+	ENCODER_DEBUG_LOG("glProgramUniform4i(program:%u, location:%d, v0:%d, v1:%d, v2:%d, v3:%d)", program, location, v0, v1, v2, v3);
+	AEMU_SCOPED_TRACE("glProgramUniform4i encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform4i;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+		memcpy(ptr, &v1, 4); ptr += 4;
+		memcpy(ptr, &v2, 4); ptr += 4;
+		memcpy(ptr, &v3, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform1ui_enc(void *self , GLuint program, GLint location, GLuint v0)
+{
+	ENCODER_DEBUG_LOG("glProgramUniform1ui(program:%u, location:%d, v0:%u)", program, location, v0);
+	AEMU_SCOPED_TRACE("glProgramUniform1ui encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform1ui;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform2ui_enc(void *self , GLuint program, GLint location, GLint v0, GLuint v1)
+{
+	ENCODER_DEBUG_LOG("glProgramUniform2ui(program:%u, location:%d, v0:%d, v1:%u)", program, location, v0, v1);
+	AEMU_SCOPED_TRACE("glProgramUniform2ui encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform2ui;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+		memcpy(ptr, &v1, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform3ui_enc(void *self , GLuint program, GLint location, GLint v0, GLint v1, GLuint v2)
+{
+	ENCODER_DEBUG_LOG("glProgramUniform3ui(program:%u, location:%d, v0:%d, v1:%d, v2:%u)", program, location, v0, v1, v2);
+	AEMU_SCOPED_TRACE("glProgramUniform3ui encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform3ui;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+		memcpy(ptr, &v1, 4); ptr += 4;
+		memcpy(ptr, &v2, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform4ui_enc(void *self , GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLuint v3)
+{
+	ENCODER_DEBUG_LOG("glProgramUniform4ui(program:%u, location:%d, v0:%d, v1:%d, v2:%d, v3:%u)", program, location, v0, v1, v2, v3);
+	AEMU_SCOPED_TRACE("glProgramUniform4ui encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform4ui;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+		memcpy(ptr, &v1, 4); ptr += 4;
+		memcpy(ptr, &v2, 4); ptr += 4;
+		memcpy(ptr, &v3, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform1fv_enc(void *self , GLuint program, GLint location, GLsizei count, const GLfloat* value)
+{
+	ENCODER_DEBUG_LOG("glProgramUniform1fv(program:%u, location:%d, count:%d, value:0x%08x)", program, location, count, value);
+	AEMU_SCOPED_TRACE("glProgramUniform1fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform1fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform2fv_enc(void *self , GLuint program, GLint location, GLsizei count, const GLfloat* value)
+{
+	ENCODER_DEBUG_LOG("glProgramUniform2fv(program:%u, location:%d, count:%d, value:0x%08x)", program, location, count, value);
+	AEMU_SCOPED_TRACE("glProgramUniform2fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 2 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform2fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform3fv_enc(void *self , GLuint program, GLint location, GLsizei count, const GLfloat* value)
+{
+	ENCODER_DEBUG_LOG("glProgramUniform3fv(program:%u, location:%d, count:%d, value:0x%08x)", program, location, count, value);
+	AEMU_SCOPED_TRACE("glProgramUniform3fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 3 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform3fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform4fv_enc(void *self , GLuint program, GLint location, GLsizei count, const GLfloat* value)
+{
+	ENCODER_DEBUG_LOG("glProgramUniform4fv(program:%u, location:%d, count:%d, value:0x%08x)", program, location, count, value);
+	AEMU_SCOPED_TRACE("glProgramUniform4fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 4 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform4fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform1iv_enc(void *self , GLuint program, GLint location, GLsizei count, const GLint* value)
+{
+	ENCODER_DEBUG_LOG("glProgramUniform1iv(program:%u, location:%d, count:%d, value:0x%08x)", program, location, count, value);
+	AEMU_SCOPED_TRACE("glProgramUniform1iv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform1iv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform2iv_enc(void *self , GLuint program, GLint location, GLsizei count, const GLint* value)
+{
+	ENCODER_DEBUG_LOG("glProgramUniform2iv(program:%u, location:%d, count:%d, value:0x%08x)", program, location, count, value);
+	AEMU_SCOPED_TRACE("glProgramUniform2iv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 2 * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform2iv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform3iv_enc(void *self , GLuint program, GLint location, GLsizei count, const GLint* value)
+{
+	ENCODER_DEBUG_LOG("glProgramUniform3iv(program:%u, location:%d, count:%d, value:0x%08x)", program, location, count, value);
+	AEMU_SCOPED_TRACE("glProgramUniform3iv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 3 * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform3iv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform4iv_enc(void *self , GLuint program, GLint location, GLsizei count, const GLint* value)
+{
+	ENCODER_DEBUG_LOG("glProgramUniform4iv(program:%u, location:%d, count:%d, value:0x%08x)", program, location, count, value);
+	AEMU_SCOPED_TRACE("glProgramUniform4iv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 4 * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform4iv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform1uiv_enc(void *self , GLuint program, GLint location, GLsizei count, const GLuint* value)
+{
+	ENCODER_DEBUG_LOG("glProgramUniform1uiv(program:%u, location:%d, count:%d, value:0x%08x)", program, location, count, value);
+	AEMU_SCOPED_TRACE("glProgramUniform1uiv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform1uiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform2uiv_enc(void *self , GLuint program, GLint location, GLsizei count, const GLuint* value)
+{
+	ENCODER_DEBUG_LOG("glProgramUniform2uiv(program:%u, location:%d, count:%d, value:0x%08x)", program, location, count, value);
+	AEMU_SCOPED_TRACE("glProgramUniform2uiv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 2 * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform2uiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform3uiv_enc(void *self , GLuint program, GLint location, GLsizei count, const GLuint* value)
+{
+	ENCODER_DEBUG_LOG("glProgramUniform3uiv(program:%u, location:%d, count:%d, value:0x%08x)", program, location, count, value);
+	AEMU_SCOPED_TRACE("glProgramUniform3uiv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 3 * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform3uiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform4uiv_enc(void *self , GLuint program, GLint location, GLsizei count, const GLuint* value)
+{
+	ENCODER_DEBUG_LOG("glProgramUniform4uiv(program:%u, location:%d, count:%d, value:0x%08x)", program, location, count, value);
+	AEMU_SCOPED_TRACE("glProgramUniform4uiv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 4 * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform4uiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniformMatrix2fv_enc(void *self , GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	ENCODER_DEBUG_LOG("glProgramUniformMatrix2fv(program:%u, location:%d, count:%d, transpose:%d, value:0x%08x)", program, location, count, transpose, value);
+	AEMU_SCOPED_TRACE("glProgramUniformMatrix2fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 4 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniformMatrix2fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniformMatrix3fv_enc(void *self , GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	ENCODER_DEBUG_LOG("glProgramUniformMatrix3fv(program:%u, location:%d, count:%d, transpose:%d, value:0x%08x)", program, location, count, transpose, value);
+	AEMU_SCOPED_TRACE("glProgramUniformMatrix3fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 9 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniformMatrix3fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniformMatrix4fv_enc(void *self , GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	ENCODER_DEBUG_LOG("glProgramUniformMatrix4fv(program:%u, location:%d, count:%d, transpose:%d, value:0x%08x)", program, location, count, transpose, value);
+	AEMU_SCOPED_TRACE("glProgramUniformMatrix4fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 16 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniformMatrix4fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniformMatrix2x3fv_enc(void *self , GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	ENCODER_DEBUG_LOG("glProgramUniformMatrix2x3fv(program:%u, location:%d, count:%d, transpose:%d, value:0x%08x)", program, location, count, transpose, value);
+	AEMU_SCOPED_TRACE("glProgramUniformMatrix2x3fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 6 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniformMatrix2x3fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniformMatrix3x2fv_enc(void *self , GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	ENCODER_DEBUG_LOG("glProgramUniformMatrix3x2fv(program:%u, location:%d, count:%d, transpose:%d, value:0x%08x)", program, location, count, transpose, value);
+	AEMU_SCOPED_TRACE("glProgramUniformMatrix3x2fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 6 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniformMatrix3x2fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniformMatrix2x4fv_enc(void *self , GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	ENCODER_DEBUG_LOG("glProgramUniformMatrix2x4fv(program:%u, location:%d, count:%d, transpose:%d, value:0x%08x)", program, location, count, transpose, value);
+	AEMU_SCOPED_TRACE("glProgramUniformMatrix2x4fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 8 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniformMatrix2x4fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniformMatrix4x2fv_enc(void *self , GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	ENCODER_DEBUG_LOG("glProgramUniformMatrix4x2fv(program:%u, location:%d, count:%d, transpose:%d, value:0x%08x)", program, location, count, transpose, value);
+	AEMU_SCOPED_TRACE("glProgramUniformMatrix4x2fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 8 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniformMatrix4x2fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniformMatrix3x4fv_enc(void *self , GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	ENCODER_DEBUG_LOG("glProgramUniformMatrix3x4fv(program:%u, location:%d, count:%d, transpose:%d, value:0x%08x)", program, location, count, transpose, value);
+	AEMU_SCOPED_TRACE("glProgramUniformMatrix3x4fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 12 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniformMatrix3x4fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniformMatrix4x3fv_enc(void *self , GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	ENCODER_DEBUG_LOG("glProgramUniformMatrix4x3fv(program:%u, location:%d, count:%d, transpose:%d, value:0x%08x)", program, location, count, transpose, value);
+	AEMU_SCOPED_TRACE("glProgramUniformMatrix4x3fv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 12 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniformMatrix4x3fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	memcpy(ptr, &__size_value, 4); ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetProgramInterfaceiv_enc(void *self , GLuint program, GLenum programInterface, GLenum pname, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glGetProgramInterfaceiv(program:%u, programInterface:0x%08x, pname:0x%08x, params:0x%08x)", program, programInterface, pname, params);
+	AEMU_SCOPED_TRACE("glGetProgramInterfaceiv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetProgramInterfaceiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &programInterface, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetProgramInterfaceiv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetProgramResourceiv_enc(void *self , GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei* length, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glGetProgramResourceiv(program:%u, programInterface:0x%08x, index:%u, propCount:%d, props:0x%08x, bufSize:%d, length:0x%08x, params:0x%08x)", program, programInterface, index, propCount, props, bufSize, length, params);
+	AEMU_SCOPED_TRACE("glGetProgramResourceiv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_props =  (propCount * sizeof(GLenum));
+	const unsigned int __size_length = ((length != NULL) ?  (sizeof(GLsizei)) : 0);
+	const unsigned int __size_params =  (bufSize * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + __size_props + 4 + 0 + 0 + 3*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetProgramResourceiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &programInterface, 4); ptr += 4;
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &propCount, 4); ptr += 4;
+	memcpy(ptr, &__size_props, 4); ptr += 4;
+	memcpy(ptr, props, __size_props);ptr += __size_props;
+		memcpy(ptr, &bufSize, 4); ptr += 4;
+	memcpy(ptr, &__size_length, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	if (length != NULL) {
+		stream->readback(length, __size_length);
+		if (useChecksum) checksumCalculator->addBuffer(length, __size_length);
+	}
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetProgramResourceiv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+GLuint glGetProgramResourceIndex_enc(void *self , GLuint program, GLenum programInterface, const char* name)
+{
+	ENCODER_DEBUG_LOG("glGetProgramResourceIndex(program:%u, programInterface:0x%08x, name:0x%08x)", program, programInterface, name);
+	AEMU_SCOPED_TRACE("glGetProgramResourceIndex encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_name =  (strlen(name) + 1);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_name + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetProgramResourceIndex;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &programInterface, 4); ptr += 4;
+	memcpy(ptr, &__size_name, 4); ptr += 4;
+	memcpy(ptr, name, __size_name);ptr += __size_name;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLuint retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetProgramResourceIndex: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+GLint glGetProgramResourceLocation_enc(void *self , GLuint program, GLenum programInterface, const char* name)
+{
+	ENCODER_DEBUG_LOG("glGetProgramResourceLocation(program:%u, programInterface:0x%08x, name:0x%08x)", program, programInterface, name);
+	AEMU_SCOPED_TRACE("glGetProgramResourceLocation encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_name =  (strlen(name) + 1);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_name + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetProgramResourceLocation;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &programInterface, 4); ptr += 4;
+	memcpy(ptr, &__size_name, 4); ptr += 4;
+	memcpy(ptr, name, __size_name);ptr += __size_name;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLint retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetProgramResourceLocation: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glGetProgramResourceName_enc(void *self , GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, char* name)
+{
+	ENCODER_DEBUG_LOG("glGetProgramResourceName(program:%u, programInterface:0x%08x, index:%u, bufSize:%d, length:0x%08x, name:0x%08x)", program, programInterface, index, bufSize, length, name);
+	AEMU_SCOPED_TRACE("glGetProgramResourceName encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_length = ((length != NULL) ?  (sizeof(GLsizei)) : 0);
+	const unsigned int __size_name =  bufSize;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 0 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetProgramResourceName;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &programInterface, 4); ptr += 4;
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &bufSize, 4); ptr += 4;
+	memcpy(ptr, &__size_length, 4); ptr += 4;
+	memcpy(ptr, &__size_name, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	if (length != NULL) {
+		stream->readback(length, __size_length);
+		if (useChecksum) checksumCalculator->addBuffer(length, __size_length);
+	}
+	stream->readback(name, __size_name);
+	if (useChecksum) checksumCalculator->addBuffer(name, __size_name);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetProgramResourceName: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glBindImageTexture_enc(void *self , GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format)
+{
+	ENCODER_DEBUG_LOG("glBindImageTexture(unit:%u, texture:%u, level:%d, layered:%d, layer:%d, access:0x%08x, format:0x%08x)", unit, texture, level, layered, layer, access, format);
+	AEMU_SCOPED_TRACE("glBindImageTexture encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 1 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBindImageTexture;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &unit, 4); ptr += 4;
+		memcpy(ptr, &texture, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &layered, 1); ptr += 1;
+		memcpy(ptr, &layer, 4); ptr += 4;
+		memcpy(ptr, &access, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDispatchCompute_enc(void *self , GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z)
+{
+	ENCODER_DEBUG_LOG("glDispatchCompute(num_groups_x:%u, num_groups_y:%u, num_groups_z:%u)", num_groups_x, num_groups_y, num_groups_z);
+	AEMU_SCOPED_TRACE("glDispatchCompute encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDispatchCompute;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &num_groups_x, 4); ptr += 4;
+		memcpy(ptr, &num_groups_y, 4); ptr += 4;
+		memcpy(ptr, &num_groups_z, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDispatchComputeIndirect_enc(void *self , GLintptr indirect)
+{
+	ENCODER_DEBUG_LOG("glDispatchComputeIndirect(indirect:0x%08lx)", indirect);
+	AEMU_SCOPED_TRACE("glDispatchComputeIndirect encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDispatchComputeIndirect;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &indirect, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBindVertexBuffer_enc(void *self , GLuint bindingindex, GLuint buffer, GLintptr offset, GLintptr stride)
+{
+	ENCODER_DEBUG_LOG("glBindVertexBuffer(bindingindex:%u, buffer:%u, offset:0x%08lx, stride:0x%08lx)", bindingindex, buffer, offset, stride);
+	AEMU_SCOPED_TRACE("glBindVertexBuffer encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBindVertexBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &bindingindex, 4); ptr += 4;
+		memcpy(ptr, &buffer, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+		memcpy(ptr, &stride, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexAttribBinding_enc(void *self , GLuint attribindex, GLuint bindingindex)
+{
+	ENCODER_DEBUG_LOG("glVertexAttribBinding(attribindex:%u, bindingindex:%u)", attribindex, bindingindex);
+	AEMU_SCOPED_TRACE("glVertexAttribBinding encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttribBinding;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &attribindex, 4); ptr += 4;
+		memcpy(ptr, &bindingindex, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexAttribFormat_enc(void *self , GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset)
+{
+	ENCODER_DEBUG_LOG("glVertexAttribFormat(attribindex:%u, size:%d, type:0x%08x, normalized:%d, relativeoffset:%u)", attribindex, size, type, normalized, relativeoffset);
+	AEMU_SCOPED_TRACE("glVertexAttribFormat encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 1 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttribFormat;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &attribindex, 4); ptr += 4;
+		memcpy(ptr, &size, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &normalized, 1); ptr += 1;
+		memcpy(ptr, &relativeoffset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexAttribIFormat_enc(void *self , GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset)
+{
+	ENCODER_DEBUG_LOG("glVertexAttribIFormat(attribindex:%u, size:%d, type:0x%08x, relativeoffset:%u)", attribindex, size, type, relativeoffset);
+	AEMU_SCOPED_TRACE("glVertexAttribIFormat encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttribIFormat;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &attribindex, 4); ptr += 4;
+		memcpy(ptr, &size, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &relativeoffset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexBindingDivisor_enc(void *self , GLuint bindingindex, GLuint divisor)
+{
+	ENCODER_DEBUG_LOG("glVertexBindingDivisor(bindingindex:%u, divisor:%u)", bindingindex, divisor);
+	AEMU_SCOPED_TRACE("glVertexBindingDivisor encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexBindingDivisor;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &bindingindex, 4); ptr += 4;
+		memcpy(ptr, &divisor, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawArraysIndirectDataAEMU_enc(void *self , GLenum mode, const void* indirect, GLuint datalen)
+{
+	ENCODER_DEBUG_LOG("glDrawArraysIndirectDataAEMU(mode:0x%08x, indirect:0x%08x, datalen:%u)", mode, indirect, datalen);
+	AEMU_SCOPED_TRACE("glDrawArraysIndirectDataAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_indirect =  datalen;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_indirect + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawArraysIndirectDataAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+	memcpy(ptr, &__size_indirect, 4); ptr += 4;
+	memcpy(ptr, indirect, __size_indirect);ptr += __size_indirect;
+		memcpy(ptr, &datalen, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawArraysIndirectOffsetAEMU_enc(void *self , GLenum mode, GLuint offset)
+{
+	ENCODER_DEBUG_LOG("glDrawArraysIndirectOffsetAEMU(mode:0x%08x, offset:%u)", mode, offset);
+	AEMU_SCOPED_TRACE("glDrawArraysIndirectOffsetAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawArraysIndirectOffsetAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawElementsIndirectDataAEMU_enc(void *self , GLenum mode, GLenum type, const void* indirect, GLuint datalen)
+{
+	ENCODER_DEBUG_LOG("glDrawElementsIndirectDataAEMU(mode:0x%08x, type:0x%08x, indirect:0x%08x, datalen:%u)", mode, type, indirect, datalen);
+	AEMU_SCOPED_TRACE("glDrawElementsIndirectDataAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_indirect =  datalen;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_indirect + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawElementsIndirectDataAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+	memcpy(ptr, &__size_indirect, 4); ptr += 4;
+	memcpy(ptr, indirect, __size_indirect);ptr += __size_indirect;
+		memcpy(ptr, &datalen, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawElementsIndirectOffsetAEMU_enc(void *self , GLenum mode, GLenum type, GLuint offset)
+{
+	ENCODER_DEBUG_LOG("glDrawElementsIndirectOffsetAEMU(mode:0x%08x, type:0x%08x, offset:%u)", mode, type, offset);
+	AEMU_SCOPED_TRACE("glDrawElementsIndirectOffsetAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawElementsIndirectOffsetAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexStorage2DMultisample_enc(void *self , GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations)
+{
+	ENCODER_DEBUG_LOG("glTexStorage2DMultisample(target:0x%08x, samples:%d, internalformat:0x%08x, width:%d, height:%d, fixedsamplelocations:%d)", target, samples, internalformat, width, height, fixedsamplelocations);
+	AEMU_SCOPED_TRACE("glTexStorage2DMultisample encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 1;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexStorage2DMultisample;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &samples, 4); ptr += 4;
+		memcpy(ptr, &internalformat, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &fixedsamplelocations, 1); ptr += 1;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glSampleMaski_enc(void *self , GLuint maskNumber, GLbitfield mask)
+{
+	ENCODER_DEBUG_LOG("glSampleMaski(maskNumber:%u, mask:0x%08x)", maskNumber, mask);
+	AEMU_SCOPED_TRACE("glSampleMaski encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glSampleMaski;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &maskNumber, 4); ptr += 4;
+		memcpy(ptr, &mask, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetMultisamplefv_enc(void *self , GLenum pname, GLuint index, GLfloat* val)
+{
+	ENCODER_DEBUG_LOG("glGetMultisamplefv(pname:0x%08x, index:%u, val:0x%08x)", pname, index, val);
+	AEMU_SCOPED_TRACE("glGetMultisamplefv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_val =  (glUtilsParamSize(pname) * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetMultisamplefv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &index, 4); ptr += 4;
+	memcpy(ptr, &__size_val, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(val, __size_val);
+	if (useChecksum) checksumCalculator->addBuffer(val, __size_val);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetMultisamplefv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glFramebufferParameteri_enc(void *self , GLenum target, GLenum pname, GLint param)
+{
+	ENCODER_DEBUG_LOG("glFramebufferParameteri(target:0x%08x, pname:0x%08x, param:%d)", target, pname, param);
+	AEMU_SCOPED_TRACE("glFramebufferParameteri encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFramebufferParameteri;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetFramebufferParameteriv_enc(void *self , GLenum target, GLenum pname, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glGetFramebufferParameteriv(target:0x%08x, pname:0x%08x, params:0x%08x)", target, pname, params);
+	AEMU_SCOPED_TRACE("glGetFramebufferParameteriv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetFramebufferParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetFramebufferParameteriv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetTexLevelParameterfv_enc(void *self , GLenum target, GLint level, GLenum pname, GLfloat* params)
+{
+	ENCODER_DEBUG_LOG("glGetTexLevelParameterfv(target:0x%08x, level:%d, pname:0x%08x, params:0x%08x)", target, level, pname, params);
+	AEMU_SCOPED_TRACE("glGetTexLevelParameterfv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetTexLevelParameterfv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetTexLevelParameterfv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetTexLevelParameteriv_enc(void *self , GLenum target, GLint level, GLenum pname, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glGetTexLevelParameteriv(target:0x%08x, level:%d, pname:0x%08x, params:0x%08x)", target, level, pname, params);
+	AEMU_SCOPED_TRACE("glGetTexLevelParameteriv encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetTexLevelParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetTexLevelParameteriv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glMapBufferRangeDMA_enc(void *self , GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, uint64_t paddr)
+{
+	ENCODER_DEBUG_LOG("glMapBufferRangeDMA(target:0x%08x, offset:0x%08lx, length:0x%08lx, access:0x%08x, paddr:0x%016lx)", target, offset, length, access, paddr);
+	AEMU_SCOPED_TRACE("glMapBufferRangeDMA encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glMapBufferRangeDMA;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+		memcpy(ptr, &length, 4); ptr += 4;
+		memcpy(ptr, &access, 4); ptr += 4;
+		memcpy(ptr, &paddr, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUnmapBufferDMA_enc(void *self , GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, uint64_t paddr, GLboolean* out_res)
+{
+	ENCODER_DEBUG_LOG("glUnmapBufferDMA(target:0x%08x, offset:0x%08lx, length:0x%08lx, access:0x%08x, paddr:0x%016lx, out_res:0x%08x)", target, offset, length, access, paddr, out_res);
+	AEMU_SCOPED_TRACE("glUnmapBufferDMA encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_out_res =  (sizeof(GLboolean));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 8 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUnmapBufferDMA;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+		memcpy(ptr, &length, 4); ptr += 4;
+		memcpy(ptr, &access, 4); ptr += 4;
+		memcpy(ptr, &paddr, 8); ptr += 8;
+	memcpy(ptr, &__size_out_res, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(out_res, __size_out_res);
+	if (useChecksum) checksumCalculator->addBuffer(out_res, __size_out_res);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glUnmapBufferDMA: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+uint64_t glMapBufferRangeDirect_enc(void *self , GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, uint64_t paddr)
+{
+	ENCODER_DEBUG_LOG("glMapBufferRangeDirect(target:0x%08x, offset:0x%08lx, length:0x%08lx, access:0x%08x, paddr:0x%016lx)", target, offset, length, access, paddr);
+	AEMU_SCOPED_TRACE("glMapBufferRangeDirect encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glMapBufferRangeDirect;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+		memcpy(ptr, &length, 4); ptr += 4;
+		memcpy(ptr, &access, 4); ptr += 4;
+		memcpy(ptr, &paddr, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	uint64_t retval;
+	stream->readback(&retval, 8);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 8);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glMapBufferRangeDirect: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glUnmapBufferDirect_enc(void *self , GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, uint64_t paddr, uint64_t guest_ptr, GLboolean* out_res)
+{
+	ENCODER_DEBUG_LOG("glUnmapBufferDirect(target:0x%08x, offset:0x%08lx, length:0x%08lx, access:0x%08x, paddr:0x%016lx, guest_ptr:0x%016lx, out_res:0x%08x)", target, offset, length, access, paddr, guest_ptr, out_res);
+	AEMU_SCOPED_TRACE("glUnmapBufferDirect encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_out_res =  (sizeof(GLboolean));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 8 + 8 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUnmapBufferDirect;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+		memcpy(ptr, &length, 4); ptr += 4;
+		memcpy(ptr, &access, 4); ptr += 4;
+		memcpy(ptr, &paddr, 8); ptr += 8;
+		memcpy(ptr, &guest_ptr, 8); ptr += 8;
+	memcpy(ptr, &__size_out_res, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(out_res, __size_out_res);
+	if (useChecksum) checksumCalculator->addBuffer(out_res, __size_out_res);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glUnmapBufferDirect: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glFlushMappedBufferRangeDirect_enc(void *self , GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
+{
+	ENCODER_DEBUG_LOG("glFlushMappedBufferRangeDirect(target:0x%08x, offset:0x%08lx, length:0x%08lx, access:0x%08x)", target, offset, length, access);
+	AEMU_SCOPED_TRACE("glFlushMappedBufferRangeDirect encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFlushMappedBufferRangeDirect;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+		memcpy(ptr, &length, 4); ptr += 4;
+		memcpy(ptr, &access, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+GLenum glGetGraphicsResetStatusEXT_enc(void *self )
+{
+	ENCODER_DEBUG_LOG("glGetGraphicsResetStatusEXT()");
+	AEMU_SCOPED_TRACE("glGetGraphicsResetStatusEXT encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetGraphicsResetStatusEXT;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLenum retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetGraphicsResetStatusEXT: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glReadnPixelsEXT_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid* data)
+{
+	ENCODER_DEBUG_LOG("glReadnPixelsEXT(x:%d, y:%d, width:%d, height:%d, format:0x%08x, type:0x%08x, bufSize:%d, data:0x%08x)", x, y, width, height, format, type, bufSize, data);
+	AEMU_SCOPED_TRACE("glReadnPixelsEXT encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data =  bufSize;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glReadnPixelsEXT;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &bufSize, 4); ptr += 4;
+	memcpy(ptr, &__size_data, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(data, __size_data);
+	if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glReadnPixelsEXT: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetnUniformfvEXT_enc(void *self , GLuint program, GLint location, GLsizei bufSize, GLfloat* params)
+{
+	ENCODER_DEBUG_LOG("glGetnUniformfvEXT(program:%u, location:%d, bufSize:%d, params:0x%08x)", program, location, bufSize, params);
+	AEMU_SCOPED_TRACE("glGetnUniformfvEXT encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  bufSize;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetnUniformfvEXT;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &bufSize, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetnUniformfvEXT: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetnUniformivEXT_enc(void *self , GLuint program, GLint location, GLsizei bufSize, GLint* params)
+{
+	ENCODER_DEBUG_LOG("glGetnUniformivEXT(program:%u, location:%d, bufSize:%d, params:0x%08x)", program, location, bufSize, params);
+	AEMU_SCOPED_TRACE("glGetnUniformivEXT encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  bufSize;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetnUniformivEXT;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &bufSize, 4); ptr += 4;
+	memcpy(ptr, &__size_params, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetnUniformivEXT: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glDrawArraysNullAEMU_enc(void *self , GLenum mode, GLint first, GLsizei count)
+{
+	ENCODER_DEBUG_LOG("glDrawArraysNullAEMU(mode:0x%08x, first:%d, count:%d)", mode, first, count);
+	AEMU_SCOPED_TRACE("glDrawArraysNullAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawArraysNullAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+		memcpy(ptr, &first, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawElementsOffsetNullAEMU_enc(void *self , GLenum mode, GLsizei count, GLenum type, GLuint offset)
+{
+	ENCODER_DEBUG_LOG("glDrawElementsOffsetNullAEMU(mode:0x%08x, count:%d, type:0x%08x, offset:%u)", mode, count, type, offset);
+	AEMU_SCOPED_TRACE("glDrawElementsOffsetNullAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawElementsOffsetNullAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawElementsDataNullAEMU_enc(void *self , GLenum mode, GLsizei count, GLenum type, void* data, GLuint datalen)
+{
+	ENCODER_DEBUG_LOG("glDrawElementsDataNullAEMU(mode:0x%08x, count:%d, type:0x%08x, data:0x%08x, datalen:%u)", mode, count, type, data, datalen);
+	AEMU_SCOPED_TRACE("glDrawElementsDataNullAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data =  datalen;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_data + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawElementsDataNullAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+	memcpy(ptr, &__size_data, 4); ptr += 4;
+	memcpy(ptr, data, __size_data);ptr += __size_data;
+		memcpy(ptr, &datalen, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUnmapBufferAsyncAEMU_enc(void *self , GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* guest_buffer, GLboolean* out_res)
+{
+	ENCODER_DEBUG_LOG("glUnmapBufferAsyncAEMU(target:0x%08x, offset:0x%08lx, length:0x%08lx, access:0x%08x, guest_buffer:0x%08x, out_res:0x%08x)", target, offset, length, access, guest_buffer, out_res);
+	AEMU_SCOPED_TRACE("glUnmapBufferAsyncAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_guest_buffer = ((guest_buffer != NULL) ?  length : 0);
+	const unsigned int __size_out_res =  (sizeof(GLboolean));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + __size_guest_buffer + __size_out_res + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(8 + 4 + 4 + 4 + 4);
+	ptr = buf;
+	int tmp = OP_glUnmapBufferAsyncAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+		memcpy(ptr, &length, 4); ptr += 4;
+		memcpy(ptr, &access, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	stream->flush();
+	stream->writeFully(&__size_guest_buffer,4);
+	if (useChecksum) checksumCalculator->addBuffer(&__size_guest_buffer,4);
+	if (guest_buffer != NULL) {
+		stream->writeFully(guest_buffer, __size_guest_buffer);
+		if (useChecksum) checksumCalculator->addBuffer(guest_buffer, __size_guest_buffer);
+	}
+	buf = stream->alloc(__size_out_res + 1*4);
+	ptr = buf;
+	memcpy(ptr, &__size_out_res, 4); ptr += 4;
+	memcpy(ptr, out_res, __size_out_res);ptr += __size_out_res;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	buf = stream->alloc(checksumSize);
+	if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
+
+}
+
+void glFlushMappedBufferRangeAEMU2_enc(void *self , GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* guest_buffer)
+{
+	ENCODER_DEBUG_LOG("glFlushMappedBufferRangeAEMU2(target:0x%08x, offset:0x%08lx, length:0x%08lx, access:0x%08x, guest_buffer:0x%08x)", target, offset, length, access, guest_buffer);
+	AEMU_SCOPED_TRACE("glFlushMappedBufferRangeAEMU2 encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_guest_buffer = ((guest_buffer != NULL) ?  length : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + __size_guest_buffer + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(8 + 4 + 4 + 4 + 4);
+	ptr = buf;
+	int tmp = OP_glFlushMappedBufferRangeAEMU2;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+		memcpy(ptr, &length, 4); ptr += 4;
+		memcpy(ptr, &access, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	stream->flush();
+	stream->writeFully(&__size_guest_buffer,4);
+	if (useChecksum) checksumCalculator->addBuffer(&__size_guest_buffer,4);
+	if (guest_buffer != NULL) {
+		stream->writeFully(guest_buffer, __size_guest_buffer);
+		if (useChecksum) checksumCalculator->addBuffer(guest_buffer, __size_guest_buffer);
+	}
+	buf = stream->alloc(checksumSize);
+	if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
+
+}
+
+GLboolean glBufferDataSyncAEMU_enc(void *self , GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage)
+{
+	ENCODER_DEBUG_LOG("glBufferDataSyncAEMU(target:0x%08x, size:0x%08lx, data:0x%08x, usage:0x%08x)", target, size, data, usage);
+	AEMU_SCOPED_TRACE("glBufferDataSyncAEMU encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data = ((data != NULL) ?  size : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_data + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBufferDataSyncAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &size, 4); ptr += 4;
+	memcpy(ptr, &__size_data, 4); ptr += 4;
+	if (data != NULL) memcpy(ptr, data, __size_data);ptr += __size_data;
+		memcpy(ptr, &usage, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glBufferDataSyncAEMU: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glTexBufferOES_enc(void *self , GLenum target, GLenum internalFormat, GLuint buffer)
+{
+	ENCODER_DEBUG_LOG("glTexBufferOES(target:0x%08x, internalFormat:0x%08x, buffer:%u)", target, internalFormat, buffer);
+	AEMU_SCOPED_TRACE("glTexBufferOES encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexBufferOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &internalFormat, 4); ptr += 4;
+		memcpy(ptr, &buffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexBufferRangeOES_enc(void *self , GLenum target, GLenum internalFormat, GLuint buffer, GLintptr offset, GLsizeiptr size)
+{
+	ENCODER_DEBUG_LOG("glTexBufferRangeOES(target:0x%08x, internalFormat:0x%08x, buffer:%u, offset:0x%08lx, size:0x%08lx)", target, internalFormat, buffer, offset, size);
+	AEMU_SCOPED_TRACE("glTexBufferRangeOES encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexBufferRangeOES;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &internalFormat, 4); ptr += 4;
+		memcpy(ptr, &buffer, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+		memcpy(ptr, &size, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexBufferEXT_enc(void *self , GLenum target, GLenum internalFormat, GLuint buffer)
+{
+	ENCODER_DEBUG_LOG("glTexBufferEXT(target:0x%08x, internalFormat:0x%08x, buffer:%u)", target, internalFormat, buffer);
+	AEMU_SCOPED_TRACE("glTexBufferEXT encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexBufferEXT;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &internalFormat, 4); ptr += 4;
+		memcpy(ptr, &buffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexBufferRangeEXT_enc(void *self , GLenum target, GLenum internalFormat, GLuint buffer, GLintptr offset, GLsizeiptr size)
+{
+	ENCODER_DEBUG_LOG("glTexBufferRangeEXT(target:0x%08x, internalFormat:0x%08x, buffer:%u, offset:0x%08lx, size:0x%08lx)", target, internalFormat, buffer, offset, size);
+	AEMU_SCOPED_TRACE("glTexBufferRangeEXT encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexBufferRangeEXT;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &internalFormat, 4); ptr += 4;
+		memcpy(ptr, &buffer, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+		memcpy(ptr, &size, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glEnableiEXT_enc(void *self , GLenum cap, GLuint index)
+{
+	ENCODER_DEBUG_LOG("glEnableiEXT(cap:0x%08x, index:%u)", cap, index);
+	AEMU_SCOPED_TRACE("glEnableiEXT encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glEnableiEXT;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &cap, 4); ptr += 4;
+		memcpy(ptr, &index, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDisableiEXT_enc(void *self , GLenum cap, GLuint index)
+{
+	ENCODER_DEBUG_LOG("glDisableiEXT(cap:0x%08x, index:%u)", cap, index);
+	AEMU_SCOPED_TRACE("glDisableiEXT encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDisableiEXT;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &cap, 4); ptr += 4;
+		memcpy(ptr, &index, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBlendEquationiEXT_enc(void *self , GLuint index, GLenum mode)
+{
+	ENCODER_DEBUG_LOG("glBlendEquationiEXT(index:%u, mode:0x%08x)", index, mode);
+	AEMU_SCOPED_TRACE("glBlendEquationiEXT encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBlendEquationiEXT;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &mode, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBlendEquationSeparateiEXT_enc(void *self , GLuint index, GLenum modeRGB, GLenum modeAlpha)
+{
+	ENCODER_DEBUG_LOG("glBlendEquationSeparateiEXT(index:%u, modeRGB:0x%08x, modeAlpha:0x%08x)", index, modeRGB, modeAlpha);
+	AEMU_SCOPED_TRACE("glBlendEquationSeparateiEXT encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBlendEquationSeparateiEXT;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &modeRGB, 4); ptr += 4;
+		memcpy(ptr, &modeAlpha, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBlendFunciEXT_enc(void *self , GLuint index, GLenum sfactor, GLenum dfactor)
+{
+	ENCODER_DEBUG_LOG("glBlendFunciEXT(index:%u, sfactor:0x%08x, dfactor:0x%08x)", index, sfactor, dfactor);
+	AEMU_SCOPED_TRACE("glBlendFunciEXT encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBlendFunciEXT;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &sfactor, 4); ptr += 4;
+		memcpy(ptr, &dfactor, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBlendFuncSeparateiEXT_enc(void *self , GLuint index, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
+{
+	ENCODER_DEBUG_LOG("glBlendFuncSeparateiEXT(index:%u, srcRGB:0x%08x, dstRGB:0x%08x, srcAlpha:0x%08x, dstAlpha:0x%08x)", index, srcRGB, dstRGB, srcAlpha, dstAlpha);
+	AEMU_SCOPED_TRACE("glBlendFuncSeparateiEXT encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBlendFuncSeparateiEXT;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &srcRGB, 4); ptr += 4;
+		memcpy(ptr, &dstRGB, 4); ptr += 4;
+		memcpy(ptr, &srcAlpha, 4); ptr += 4;
+		memcpy(ptr, &dstAlpha, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glColorMaskiEXT_enc(void *self , GLuint index, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
+{
+	ENCODER_DEBUG_LOG("glColorMaskiEXT(index:%u, red:%d, green:%d, blue:%d, alpha:%d)", index, red, green, blue, alpha);
+	AEMU_SCOPED_TRACE("glColorMaskiEXT encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 1 + 1 + 1 + 1;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glColorMaskiEXT;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &red, 1); ptr += 1;
+		memcpy(ptr, &green, 1); ptr += 1;
+		memcpy(ptr, &blue, 1); ptr += 1;
+		memcpy(ptr, &alpha, 1); ptr += 1;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+GLboolean glIsEnablediEXT_enc(void *self , GLenum cap, GLuint index)
+{
+	ENCODER_DEBUG_LOG("glIsEnablediEXT(cap:0x%08x, index:%u)", cap, index);
+	AEMU_SCOPED_TRACE("glIsEnablediEXT encode");
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glIsEnablediEXT;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &cap, 4); ptr += 4;
+		memcpy(ptr, &index, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glIsEnablediEXT: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+}  // namespace
+
+gl2_encoder_context_t::gl2_encoder_context_t(IOStream *stream, ChecksumCalculator *checksumCalculator)
+{
+	m_stream = stream;
+	m_checksumCalculator = checksumCalculator;
+
+	this->glActiveTexture = &glActiveTexture_enc;
+	this->glAttachShader = &glAttachShader_enc;
+	this->glBindAttribLocation = &glBindAttribLocation_enc;
+	this->glBindBuffer = &glBindBuffer_enc;
+	this->glBindFramebuffer = &glBindFramebuffer_enc;
+	this->glBindRenderbuffer = &glBindRenderbuffer_enc;
+	this->glBindTexture = &glBindTexture_enc;
+	this->glBlendColor = &glBlendColor_enc;
+	this->glBlendEquation = &glBlendEquation_enc;
+	this->glBlendEquationSeparate = &glBlendEquationSeparate_enc;
+	this->glBlendFunc = &glBlendFunc_enc;
+	this->glBlendFuncSeparate = &glBlendFuncSeparate_enc;
+	this->glBufferData = &glBufferData_enc;
+	this->glBufferSubData = &glBufferSubData_enc;
+	this->glCheckFramebufferStatus = &glCheckFramebufferStatus_enc;
+	this->glClear = &glClear_enc;
+	this->glClearColor = &glClearColor_enc;
+	this->glClearDepthf = &glClearDepthf_enc;
+	this->glClearStencil = &glClearStencil_enc;
+	this->glColorMask = &glColorMask_enc;
+	this->glCompileShader = &glCompileShader_enc;
+	this->glCompressedTexImage2D = &glCompressedTexImage2D_enc;
+	this->glCompressedTexSubImage2D = &glCompressedTexSubImage2D_enc;
+	this->glCopyTexImage2D = &glCopyTexImage2D_enc;
+	this->glCopyTexSubImage2D = &glCopyTexSubImage2D_enc;
+	this->glCreateProgram = &glCreateProgram_enc;
+	this->glCreateShader = &glCreateShader_enc;
+	this->glCullFace = &glCullFace_enc;
+	this->glDeleteBuffers = &glDeleteBuffers_enc;
+	this->glDeleteFramebuffers = &glDeleteFramebuffers_enc;
+	this->glDeleteProgram = &glDeleteProgram_enc;
+	this->glDeleteRenderbuffers = &glDeleteRenderbuffers_enc;
+	this->glDeleteShader = &glDeleteShader_enc;
+	this->glDeleteTextures = &glDeleteTextures_enc;
+	this->glDepthFunc = &glDepthFunc_enc;
+	this->glDepthMask = &glDepthMask_enc;
+	this->glDepthRangef = &glDepthRangef_enc;
+	this->glDetachShader = &glDetachShader_enc;
+	this->glDisable = &glDisable_enc;
+	this->glDisableVertexAttribArray = &glDisableVertexAttribArray_enc;
+	this->glDrawArrays = &glDrawArrays_enc;
+	this->glDrawElements = (glDrawElements_client_proc_t) &enc_unsupported;
+	this->glEnable = &glEnable_enc;
+	this->glEnableVertexAttribArray = &glEnableVertexAttribArray_enc;
+	this->glFinish = &glFinish_enc;
+	this->glFlush = &glFlush_enc;
+	this->glFramebufferRenderbuffer = &glFramebufferRenderbuffer_enc;
+	this->glFramebufferTexture2D = &glFramebufferTexture2D_enc;
+	this->glFrontFace = &glFrontFace_enc;
+	this->glGenBuffers = &glGenBuffers_enc;
+	this->glGenerateMipmap = &glGenerateMipmap_enc;
+	this->glGenFramebuffers = &glGenFramebuffers_enc;
+	this->glGenRenderbuffers = &glGenRenderbuffers_enc;
+	this->glGenTextures = &glGenTextures_enc;
+	this->glGetActiveAttrib = &glGetActiveAttrib_enc;
+	this->glGetActiveUniform = &glGetActiveUniform_enc;
+	this->glGetAttachedShaders = &glGetAttachedShaders_enc;
+	this->glGetAttribLocation = &glGetAttribLocation_enc;
+	this->glGetBooleanv = &glGetBooleanv_enc;
+	this->glGetBufferParameteriv = &glGetBufferParameteriv_enc;
+	this->glGetError = &glGetError_enc;
+	this->glGetFloatv = &glGetFloatv_enc;
+	this->glGetFramebufferAttachmentParameteriv = &glGetFramebufferAttachmentParameteriv_enc;
+	this->glGetIntegerv = &glGetIntegerv_enc;
+	this->glGetProgramiv = &glGetProgramiv_enc;
+	this->glGetProgramInfoLog = &glGetProgramInfoLog_enc;
+	this->glGetRenderbufferParameteriv = &glGetRenderbufferParameteriv_enc;
+	this->glGetShaderiv = &glGetShaderiv_enc;
+	this->glGetShaderInfoLog = &glGetShaderInfoLog_enc;
+	this->glGetShaderPrecisionFormat = &glGetShaderPrecisionFormat_enc;
+	this->glGetShaderSource = &glGetShaderSource_enc;
+	this->glGetString = (glGetString_client_proc_t) &enc_unsupported;
+	this->glGetTexParameterfv = &glGetTexParameterfv_enc;
+	this->glGetTexParameteriv = &glGetTexParameteriv_enc;
+	this->glGetUniformfv = &glGetUniformfv_enc;
+	this->glGetUniformiv = &glGetUniformiv_enc;
+	this->glGetUniformLocation = &glGetUniformLocation_enc;
+	this->glGetVertexAttribfv = &glGetVertexAttribfv_enc;
+	this->glGetVertexAttribiv = &glGetVertexAttribiv_enc;
+	this->glGetVertexAttribPointerv = (glGetVertexAttribPointerv_client_proc_t) &enc_unsupported;
+	this->glHint = &glHint_enc;
+	this->glIsBuffer = &glIsBuffer_enc;
+	this->glIsEnabled = &glIsEnabled_enc;
+	this->glIsFramebuffer = &glIsFramebuffer_enc;
+	this->glIsProgram = &glIsProgram_enc;
+	this->glIsRenderbuffer = &glIsRenderbuffer_enc;
+	this->glIsShader = &glIsShader_enc;
+	this->glIsTexture = &glIsTexture_enc;
+	this->glLineWidth = &glLineWidth_enc;
+	this->glLinkProgram = &glLinkProgram_enc;
+	this->glPixelStorei = &glPixelStorei_enc;
+	this->glPolygonOffset = &glPolygonOffset_enc;
+	this->glReadPixels = &glReadPixels_enc;
+	this->glReleaseShaderCompiler = &glReleaseShaderCompiler_enc;
+	this->glRenderbufferStorage = &glRenderbufferStorage_enc;
+	this->glSampleCoverage = &glSampleCoverage_enc;
+	this->glScissor = &glScissor_enc;
+	this->glShaderBinary = (glShaderBinary_client_proc_t) &enc_unsupported;
+	this->glShaderSource = (glShaderSource_client_proc_t) &enc_unsupported;
+	this->glStencilFunc = &glStencilFunc_enc;
+	this->glStencilFuncSeparate = &glStencilFuncSeparate_enc;
+	this->glStencilMask = &glStencilMask_enc;
+	this->glStencilMaskSeparate = &glStencilMaskSeparate_enc;
+	this->glStencilOp = &glStencilOp_enc;
+	this->glStencilOpSeparate = &glStencilOpSeparate_enc;
+	this->glTexImage2D = &glTexImage2D_enc;
+	this->glTexParameterf = &glTexParameterf_enc;
+	this->glTexParameterfv = &glTexParameterfv_enc;
+	this->glTexParameteri = &glTexParameteri_enc;
+	this->glTexParameteriv = &glTexParameteriv_enc;
+	this->glTexSubImage2D = &glTexSubImage2D_enc;
+	this->glUniform1f = &glUniform1f_enc;
+	this->glUniform1fv = &glUniform1fv_enc;
+	this->glUniform1i = &glUniform1i_enc;
+	this->glUniform1iv = &glUniform1iv_enc;
+	this->glUniform2f = &glUniform2f_enc;
+	this->glUniform2fv = &glUniform2fv_enc;
+	this->glUniform2i = &glUniform2i_enc;
+	this->glUniform2iv = &glUniform2iv_enc;
+	this->glUniform3f = &glUniform3f_enc;
+	this->glUniform3fv = &glUniform3fv_enc;
+	this->glUniform3i = &glUniform3i_enc;
+	this->glUniform3iv = &glUniform3iv_enc;
+	this->glUniform4f = &glUniform4f_enc;
+	this->glUniform4fv = &glUniform4fv_enc;
+	this->glUniform4i = &glUniform4i_enc;
+	this->glUniform4iv = &glUniform4iv_enc;
+	this->glUniformMatrix2fv = &glUniformMatrix2fv_enc;
+	this->glUniformMatrix3fv = &glUniformMatrix3fv_enc;
+	this->glUniformMatrix4fv = &glUniformMatrix4fv_enc;
+	this->glUseProgram = &glUseProgram_enc;
+	this->glValidateProgram = &glValidateProgram_enc;
+	this->glVertexAttrib1f = &glVertexAttrib1f_enc;
+	this->glVertexAttrib1fv = &glVertexAttrib1fv_enc;
+	this->glVertexAttrib2f = &glVertexAttrib2f_enc;
+	this->glVertexAttrib2fv = &glVertexAttrib2fv_enc;
+	this->glVertexAttrib3f = &glVertexAttrib3f_enc;
+	this->glVertexAttrib3fv = &glVertexAttrib3fv_enc;
+	this->glVertexAttrib4f = &glVertexAttrib4f_enc;
+	this->glVertexAttrib4fv = &glVertexAttrib4fv_enc;
+	this->glVertexAttribPointer = (glVertexAttribPointer_client_proc_t) &enc_unsupported;
+	this->glViewport = &glViewport_enc;
+	this->glEGLImageTargetTexture2DOES = &glEGLImageTargetTexture2DOES_enc;
+	this->glEGLImageTargetRenderbufferStorageOES = &glEGLImageTargetRenderbufferStorageOES_enc;
+	this->glGetProgramBinaryOES = (glGetProgramBinaryOES_client_proc_t) &enc_unsupported;
+	this->glProgramBinaryOES = (glProgramBinaryOES_client_proc_t) &enc_unsupported;
+	this->glMapBufferOES = (glMapBufferOES_client_proc_t) &enc_unsupported;
+	this->glUnmapBufferOES = &glUnmapBufferOES_enc;
+	this->glTexImage3DOES = &glTexImage3DOES_enc;
+	this->glTexSubImage3DOES = &glTexSubImage3DOES_enc;
+	this->glCopyTexSubImage3DOES = &glCopyTexSubImage3DOES_enc;
+	this->glCompressedTexImage3DOES = &glCompressedTexImage3DOES_enc;
+	this->glCompressedTexSubImage3DOES = &glCompressedTexSubImage3DOES_enc;
+	this->glFramebufferTexture3DOES = &glFramebufferTexture3DOES_enc;
+	this->glBindVertexArrayOES = &glBindVertexArrayOES_enc;
+	this->glDeleteVertexArraysOES = &glDeleteVertexArraysOES_enc;
+	this->glGenVertexArraysOES = &glGenVertexArraysOES_enc;
+	this->glIsVertexArrayOES = &glIsVertexArrayOES_enc;
+	this->glDiscardFramebufferEXT = &glDiscardFramebufferEXT_enc;
+	this->glMultiDrawArraysEXT = (glMultiDrawArraysEXT_client_proc_t) &enc_unsupported;
+	this->glMultiDrawElementsEXT = (glMultiDrawElementsEXT_client_proc_t) &enc_unsupported;
+	this->glGetPerfMonitorGroupsAMD = (glGetPerfMonitorGroupsAMD_client_proc_t) &enc_unsupported;
+	this->glGetPerfMonitorCountersAMD = (glGetPerfMonitorCountersAMD_client_proc_t) &enc_unsupported;
+	this->glGetPerfMonitorGroupStringAMD = (glGetPerfMonitorGroupStringAMD_client_proc_t) &enc_unsupported;
+	this->glGetPerfMonitorCounterStringAMD = (glGetPerfMonitorCounterStringAMD_client_proc_t) &enc_unsupported;
+	this->glGetPerfMonitorCounterInfoAMD = (glGetPerfMonitorCounterInfoAMD_client_proc_t) &enc_unsupported;
+	this->glGenPerfMonitorsAMD = (glGenPerfMonitorsAMD_client_proc_t) &enc_unsupported;
+	this->glDeletePerfMonitorsAMD = (glDeletePerfMonitorsAMD_client_proc_t) &enc_unsupported;
+	this->glSelectPerfMonitorCountersAMD = (glSelectPerfMonitorCountersAMD_client_proc_t) &enc_unsupported;
+	this->glBeginPerfMonitorAMD = (glBeginPerfMonitorAMD_client_proc_t) &enc_unsupported;
+	this->glEndPerfMonitorAMD = (glEndPerfMonitorAMD_client_proc_t) &enc_unsupported;
+	this->glGetPerfMonitorCounterDataAMD = (glGetPerfMonitorCounterDataAMD_client_proc_t) &enc_unsupported;
+	this->glRenderbufferStorageMultisampleIMG = (glRenderbufferStorageMultisampleIMG_client_proc_t) &enc_unsupported;
+	this->glFramebufferTexture2DMultisampleIMG = (glFramebufferTexture2DMultisampleIMG_client_proc_t) &enc_unsupported;
+	this->glDeleteFencesNV = (glDeleteFencesNV_client_proc_t) &enc_unsupported;
+	this->glGenFencesNV = (glGenFencesNV_client_proc_t) &enc_unsupported;
+	this->glIsFenceNV = (glIsFenceNV_client_proc_t) &enc_unsupported;
+	this->glTestFenceNV = (glTestFenceNV_client_proc_t) &enc_unsupported;
+	this->glGetFenceivNV = (glGetFenceivNV_client_proc_t) &enc_unsupported;
+	this->glFinishFenceNV = (glFinishFenceNV_client_proc_t) &enc_unsupported;
+	this->glSetFenceNV = (glSetFenceNV_client_proc_t) &enc_unsupported;
+	this->glCoverageMaskNV = (glCoverageMaskNV_client_proc_t) &enc_unsupported;
+	this->glCoverageOperationNV = (glCoverageOperationNV_client_proc_t) &enc_unsupported;
+	this->glGetDriverControlsQCOM = (glGetDriverControlsQCOM_client_proc_t) &enc_unsupported;
+	this->glGetDriverControlStringQCOM = (glGetDriverControlStringQCOM_client_proc_t) &enc_unsupported;
+	this->glEnableDriverControlQCOM = (glEnableDriverControlQCOM_client_proc_t) &enc_unsupported;
+	this->glDisableDriverControlQCOM = (glDisableDriverControlQCOM_client_proc_t) &enc_unsupported;
+	this->glExtGetTexturesQCOM = (glExtGetTexturesQCOM_client_proc_t) &enc_unsupported;
+	this->glExtGetBuffersQCOM = (glExtGetBuffersQCOM_client_proc_t) &enc_unsupported;
+	this->glExtGetRenderbuffersQCOM = (glExtGetRenderbuffersQCOM_client_proc_t) &enc_unsupported;
+	this->glExtGetFramebuffersQCOM = (glExtGetFramebuffersQCOM_client_proc_t) &enc_unsupported;
+	this->glExtGetTexLevelParameterivQCOM = (glExtGetTexLevelParameterivQCOM_client_proc_t) &enc_unsupported;
+	this->glExtTexObjectStateOverrideiQCOM = (glExtTexObjectStateOverrideiQCOM_client_proc_t) &enc_unsupported;
+	this->glExtGetTexSubImageQCOM = (glExtGetTexSubImageQCOM_client_proc_t) &enc_unsupported;
+	this->glExtGetBufferPointervQCOM = (glExtGetBufferPointervQCOM_client_proc_t) &enc_unsupported;
+	this->glExtGetShadersQCOM = (glExtGetShadersQCOM_client_proc_t) &enc_unsupported;
+	this->glExtGetProgramsQCOM = (glExtGetProgramsQCOM_client_proc_t) &enc_unsupported;
+	this->glExtIsProgramBinaryQCOM = (glExtIsProgramBinaryQCOM_client_proc_t) &enc_unsupported;
+	this->glExtGetProgramBinarySourceQCOM = (glExtGetProgramBinarySourceQCOM_client_proc_t) &enc_unsupported;
+	this->glStartTilingQCOM = (glStartTilingQCOM_client_proc_t) &enc_unsupported;
+	this->glEndTilingQCOM = (glEndTilingQCOM_client_proc_t) &enc_unsupported;
+	this->glVertexAttribPointerData = &glVertexAttribPointerData_enc;
+	this->glVertexAttribPointerOffset = &glVertexAttribPointerOffset_enc;
+	this->glDrawElementsOffset = &glDrawElementsOffset_enc;
+	this->glDrawElementsData = &glDrawElementsData_enc;
+	this->glGetCompressedTextureFormats = &glGetCompressedTextureFormats_enc;
+	this->glShaderString = &glShaderString_enc;
+	this->glFinishRoundTrip = &glFinishRoundTrip_enc;
+	this->glGenVertexArrays = &glGenVertexArrays_enc;
+	this->glBindVertexArray = &glBindVertexArray_enc;
+	this->glDeleteVertexArrays = &glDeleteVertexArrays_enc;
+	this->glIsVertexArray = &glIsVertexArray_enc;
+	this->glMapBufferRange = (glMapBufferRange_client_proc_t) &enc_unsupported;
+	this->glUnmapBuffer = (glUnmapBuffer_client_proc_t) &enc_unsupported;
+	this->glFlushMappedBufferRange = (glFlushMappedBufferRange_client_proc_t) &enc_unsupported;
+	this->glMapBufferRangeAEMU = &glMapBufferRangeAEMU_enc;
+	this->glUnmapBufferAEMU = &glUnmapBufferAEMU_enc;
+	this->glFlushMappedBufferRangeAEMU = &glFlushMappedBufferRangeAEMU_enc;
+	this->glReadPixelsOffsetAEMU = &glReadPixelsOffsetAEMU_enc;
+	this->glCompressedTexImage2DOffsetAEMU = &glCompressedTexImage2DOffsetAEMU_enc;
+	this->glCompressedTexSubImage2DOffsetAEMU = &glCompressedTexSubImage2DOffsetAEMU_enc;
+	this->glTexImage2DOffsetAEMU = &glTexImage2DOffsetAEMU_enc;
+	this->glTexSubImage2DOffsetAEMU = &glTexSubImage2DOffsetAEMU_enc;
+	this->glBindBufferRange = &glBindBufferRange_enc;
+	this->glBindBufferBase = &glBindBufferBase_enc;
+	this->glCopyBufferSubData = &glCopyBufferSubData_enc;
+	this->glClearBufferiv = &glClearBufferiv_enc;
+	this->glClearBufferuiv = &glClearBufferuiv_enc;
+	this->glClearBufferfv = &glClearBufferfv_enc;
+	this->glClearBufferfi = &glClearBufferfi_enc;
+	this->glGetBufferParameteri64v = (glGetBufferParameteri64v_client_proc_t) &enc_unsupported;
+	this->glGetBufferPointerv = (glGetBufferPointerv_client_proc_t) &enc_unsupported;
+	this->glUniformBlockBinding = &glUniformBlockBinding_enc;
+	this->glGetUniformBlockIndex = &glGetUniformBlockIndex_enc;
+	this->glGetUniformIndices = (glGetUniformIndices_client_proc_t) &enc_unsupported;
+	this->glGetUniformIndicesAEMU = &glGetUniformIndicesAEMU_enc;
+	this->glGetActiveUniformBlockiv = &glGetActiveUniformBlockiv_enc;
+	this->glGetActiveUniformBlockName = &glGetActiveUniformBlockName_enc;
+	this->glUniform1ui = &glUniform1ui_enc;
+	this->glUniform2ui = &glUniform2ui_enc;
+	this->glUniform3ui = &glUniform3ui_enc;
+	this->glUniform4ui = &glUniform4ui_enc;
+	this->glUniform1uiv = &glUniform1uiv_enc;
+	this->glUniform2uiv = &glUniform2uiv_enc;
+	this->glUniform3uiv = &glUniform3uiv_enc;
+	this->glUniform4uiv = &glUniform4uiv_enc;
+	this->glUniformMatrix2x3fv = &glUniformMatrix2x3fv_enc;
+	this->glUniformMatrix3x2fv = &glUniformMatrix3x2fv_enc;
+	this->glUniformMatrix2x4fv = &glUniformMatrix2x4fv_enc;
+	this->glUniformMatrix4x2fv = &glUniformMatrix4x2fv_enc;
+	this->glUniformMatrix3x4fv = &glUniformMatrix3x4fv_enc;
+	this->glUniformMatrix4x3fv = &glUniformMatrix4x3fv_enc;
+	this->glGetUniformuiv = &glGetUniformuiv_enc;
+	this->glGetActiveUniformsiv = &glGetActiveUniformsiv_enc;
+	this->glVertexAttribI4i = &glVertexAttribI4i_enc;
+	this->glVertexAttribI4ui = &glVertexAttribI4ui_enc;
+	this->glVertexAttribI4iv = &glVertexAttribI4iv_enc;
+	this->glVertexAttribI4uiv = &glVertexAttribI4uiv_enc;
+	this->glVertexAttribIPointer = (glVertexAttribIPointer_client_proc_t) &enc_unsupported;
+	this->glVertexAttribIPointerOffsetAEMU = &glVertexAttribIPointerOffsetAEMU_enc;
+	this->glVertexAttribIPointerDataAEMU = &glVertexAttribIPointerDataAEMU_enc;
+	this->glGetVertexAttribIiv = &glGetVertexAttribIiv_enc;
+	this->glGetVertexAttribIuiv = &glGetVertexAttribIuiv_enc;
+	this->glVertexAttribDivisor = &glVertexAttribDivisor_enc;
+	this->glDrawArraysInstanced = &glDrawArraysInstanced_enc;
+	this->glDrawElementsInstanced = (glDrawElementsInstanced_client_proc_t) &enc_unsupported;
+	this->glDrawElementsInstancedDataAEMU = &glDrawElementsInstancedDataAEMU_enc;
+	this->glDrawElementsInstancedOffsetAEMU = &glDrawElementsInstancedOffsetAEMU_enc;
+	this->glDrawRangeElements = (glDrawRangeElements_client_proc_t) &enc_unsupported;
+	this->glDrawRangeElementsDataAEMU = &glDrawRangeElementsDataAEMU_enc;
+	this->glDrawRangeElementsOffsetAEMU = &glDrawRangeElementsOffsetAEMU_enc;
+	this->glFenceSync = (glFenceSync_client_proc_t) &enc_unsupported;
+	this->glClientWaitSync = (glClientWaitSync_client_proc_t) &enc_unsupported;
+	this->glWaitSync = (glWaitSync_client_proc_t) &enc_unsupported;
+	this->glDeleteSync = (glDeleteSync_client_proc_t) &enc_unsupported;
+	this->glIsSync = (glIsSync_client_proc_t) &enc_unsupported;
+	this->glGetSynciv = (glGetSynciv_client_proc_t) &enc_unsupported;
+	this->glFenceSyncAEMU = &glFenceSyncAEMU_enc;
+	this->glClientWaitSyncAEMU = &glClientWaitSyncAEMU_enc;
+	this->glWaitSyncAEMU = &glWaitSyncAEMU_enc;
+	this->glDeleteSyncAEMU = &glDeleteSyncAEMU_enc;
+	this->glIsSyncAEMU = &glIsSyncAEMU_enc;
+	this->glGetSyncivAEMU = &glGetSyncivAEMU_enc;
+	this->glDrawBuffers = &glDrawBuffers_enc;
+	this->glReadBuffer = &glReadBuffer_enc;
+	this->glBlitFramebuffer = &glBlitFramebuffer_enc;
+	this->glInvalidateFramebuffer = &glInvalidateFramebuffer_enc;
+	this->glInvalidateSubFramebuffer = &glInvalidateSubFramebuffer_enc;
+	this->glFramebufferTextureLayer = &glFramebufferTextureLayer_enc;
+	this->glRenderbufferStorageMultisample = &glRenderbufferStorageMultisample_enc;
+	this->glTexStorage2D = &glTexStorage2D_enc;
+	this->glGetInternalformativ = &glGetInternalformativ_enc;
+	this->glBeginTransformFeedback = &glBeginTransformFeedback_enc;
+	this->glEndTransformFeedback = &glEndTransformFeedback_enc;
+	this->glGenTransformFeedbacks = &glGenTransformFeedbacks_enc;
+	this->glDeleteTransformFeedbacks = &glDeleteTransformFeedbacks_enc;
+	this->glBindTransformFeedback = &glBindTransformFeedback_enc;
+	this->glPauseTransformFeedback = &glPauseTransformFeedback_enc;
+	this->glResumeTransformFeedback = &glResumeTransformFeedback_enc;
+	this->glIsTransformFeedback = &glIsTransformFeedback_enc;
+	this->glTransformFeedbackVaryings = (glTransformFeedbackVaryings_client_proc_t) &enc_unsupported;
+	this->glTransformFeedbackVaryingsAEMU = &glTransformFeedbackVaryingsAEMU_enc;
+	this->glGetTransformFeedbackVarying = &glGetTransformFeedbackVarying_enc;
+	this->glGenSamplers = &glGenSamplers_enc;
+	this->glDeleteSamplers = &glDeleteSamplers_enc;
+	this->glBindSampler = &glBindSampler_enc;
+	this->glSamplerParameterf = &glSamplerParameterf_enc;
+	this->glSamplerParameteri = &glSamplerParameteri_enc;
+	this->glSamplerParameterfv = &glSamplerParameterfv_enc;
+	this->glSamplerParameteriv = &glSamplerParameteriv_enc;
+	this->glGetSamplerParameterfv = &glGetSamplerParameterfv_enc;
+	this->glGetSamplerParameteriv = &glGetSamplerParameteriv_enc;
+	this->glIsSampler = &glIsSampler_enc;
+	this->glGenQueries = &glGenQueries_enc;
+	this->glDeleteQueries = &glDeleteQueries_enc;
+	this->glBeginQuery = &glBeginQuery_enc;
+	this->glEndQuery = &glEndQuery_enc;
+	this->glGetQueryiv = &glGetQueryiv_enc;
+	this->glGetQueryObjectuiv = &glGetQueryObjectuiv_enc;
+	this->glIsQuery = &glIsQuery_enc;
+	this->glProgramParameteri = &glProgramParameteri_enc;
+	this->glProgramBinary = &glProgramBinary_enc;
+	this->glGetProgramBinary = &glGetProgramBinary_enc;
+	this->glGetFragDataLocation = &glGetFragDataLocation_enc;
+	this->glGetInteger64v = &glGetInteger64v_enc;
+	this->glGetIntegeri_v = &glGetIntegeri_v_enc;
+	this->glGetInteger64i_v = &glGetInteger64i_v_enc;
+	this->glTexImage3D = &glTexImage3D_enc;
+	this->glTexImage3DOffsetAEMU = &glTexImage3DOffsetAEMU_enc;
+	this->glTexStorage3D = &glTexStorage3D_enc;
+	this->glTexSubImage3D = &glTexSubImage3D_enc;
+	this->glTexSubImage3DOffsetAEMU = &glTexSubImage3DOffsetAEMU_enc;
+	this->glCompressedTexImage3D = &glCompressedTexImage3D_enc;
+	this->glCompressedTexImage3DOffsetAEMU = &glCompressedTexImage3DOffsetAEMU_enc;
+	this->glCompressedTexSubImage3D = &glCompressedTexSubImage3D_enc;
+	this->glCompressedTexSubImage3DOffsetAEMU = &glCompressedTexSubImage3DOffsetAEMU_enc;
+	this->glCopyTexSubImage3D = &glCopyTexSubImage3D_enc;
+	this->glGetStringi = (glGetStringi_client_proc_t) &enc_unsupported;
+	this->glGetBooleani_v = &glGetBooleani_v_enc;
+	this->glMemoryBarrier = &glMemoryBarrier_enc;
+	this->glMemoryBarrierByRegion = &glMemoryBarrierByRegion_enc;
+	this->glGenProgramPipelines = &glGenProgramPipelines_enc;
+	this->glDeleteProgramPipelines = &glDeleteProgramPipelines_enc;
+	this->glBindProgramPipeline = &glBindProgramPipeline_enc;
+	this->glGetProgramPipelineiv = &glGetProgramPipelineiv_enc;
+	this->glGetProgramPipelineInfoLog = &glGetProgramPipelineInfoLog_enc;
+	this->glValidateProgramPipeline = &glValidateProgramPipeline_enc;
+	this->glIsProgramPipeline = &glIsProgramPipeline_enc;
+	this->glUseProgramStages = &glUseProgramStages_enc;
+	this->glActiveShaderProgram = &glActiveShaderProgram_enc;
+	this->glCreateShaderProgramv = (glCreateShaderProgramv_client_proc_t) &enc_unsupported;
+	this->glCreateShaderProgramvAEMU = &glCreateShaderProgramvAEMU_enc;
+	this->glProgramUniform1f = &glProgramUniform1f_enc;
+	this->glProgramUniform2f = &glProgramUniform2f_enc;
+	this->glProgramUniform3f = &glProgramUniform3f_enc;
+	this->glProgramUniform4f = &glProgramUniform4f_enc;
+	this->glProgramUniform1i = &glProgramUniform1i_enc;
+	this->glProgramUniform2i = &glProgramUniform2i_enc;
+	this->glProgramUniform3i = &glProgramUniform3i_enc;
+	this->glProgramUniform4i = &glProgramUniform4i_enc;
+	this->glProgramUniform1ui = &glProgramUniform1ui_enc;
+	this->glProgramUniform2ui = &glProgramUniform2ui_enc;
+	this->glProgramUniform3ui = &glProgramUniform3ui_enc;
+	this->glProgramUniform4ui = &glProgramUniform4ui_enc;
+	this->glProgramUniform1fv = &glProgramUniform1fv_enc;
+	this->glProgramUniform2fv = &glProgramUniform2fv_enc;
+	this->glProgramUniform3fv = &glProgramUniform3fv_enc;
+	this->glProgramUniform4fv = &glProgramUniform4fv_enc;
+	this->glProgramUniform1iv = &glProgramUniform1iv_enc;
+	this->glProgramUniform2iv = &glProgramUniform2iv_enc;
+	this->glProgramUniform3iv = &glProgramUniform3iv_enc;
+	this->glProgramUniform4iv = &glProgramUniform4iv_enc;
+	this->glProgramUniform1uiv = &glProgramUniform1uiv_enc;
+	this->glProgramUniform2uiv = &glProgramUniform2uiv_enc;
+	this->glProgramUniform3uiv = &glProgramUniform3uiv_enc;
+	this->glProgramUniform4uiv = &glProgramUniform4uiv_enc;
+	this->glProgramUniformMatrix2fv = &glProgramUniformMatrix2fv_enc;
+	this->glProgramUniformMatrix3fv = &glProgramUniformMatrix3fv_enc;
+	this->glProgramUniformMatrix4fv = &glProgramUniformMatrix4fv_enc;
+	this->glProgramUniformMatrix2x3fv = &glProgramUniformMatrix2x3fv_enc;
+	this->glProgramUniformMatrix3x2fv = &glProgramUniformMatrix3x2fv_enc;
+	this->glProgramUniformMatrix2x4fv = &glProgramUniformMatrix2x4fv_enc;
+	this->glProgramUniformMatrix4x2fv = &glProgramUniformMatrix4x2fv_enc;
+	this->glProgramUniformMatrix3x4fv = &glProgramUniformMatrix3x4fv_enc;
+	this->glProgramUniformMatrix4x3fv = &glProgramUniformMatrix4x3fv_enc;
+	this->glGetProgramInterfaceiv = &glGetProgramInterfaceiv_enc;
+	this->glGetProgramResourceiv = &glGetProgramResourceiv_enc;
+	this->glGetProgramResourceIndex = &glGetProgramResourceIndex_enc;
+	this->glGetProgramResourceLocation = &glGetProgramResourceLocation_enc;
+	this->glGetProgramResourceName = &glGetProgramResourceName_enc;
+	this->glBindImageTexture = &glBindImageTexture_enc;
+	this->glDispatchCompute = &glDispatchCompute_enc;
+	this->glDispatchComputeIndirect = &glDispatchComputeIndirect_enc;
+	this->glBindVertexBuffer = &glBindVertexBuffer_enc;
+	this->glVertexAttribBinding = &glVertexAttribBinding_enc;
+	this->glVertexAttribFormat = &glVertexAttribFormat_enc;
+	this->glVertexAttribIFormat = &glVertexAttribIFormat_enc;
+	this->glVertexBindingDivisor = &glVertexBindingDivisor_enc;
+	this->glDrawArraysIndirect = (glDrawArraysIndirect_client_proc_t) &enc_unsupported;
+	this->glDrawArraysIndirectDataAEMU = &glDrawArraysIndirectDataAEMU_enc;
+	this->glDrawArraysIndirectOffsetAEMU = &glDrawArraysIndirectOffsetAEMU_enc;
+	this->glDrawElementsIndirect = (glDrawElementsIndirect_client_proc_t) &enc_unsupported;
+	this->glDrawElementsIndirectDataAEMU = &glDrawElementsIndirectDataAEMU_enc;
+	this->glDrawElementsIndirectOffsetAEMU = &glDrawElementsIndirectOffsetAEMU_enc;
+	this->glTexStorage2DMultisample = &glTexStorage2DMultisample_enc;
+	this->glSampleMaski = &glSampleMaski_enc;
+	this->glGetMultisamplefv = &glGetMultisamplefv_enc;
+	this->glFramebufferParameteri = &glFramebufferParameteri_enc;
+	this->glGetFramebufferParameteriv = &glGetFramebufferParameteriv_enc;
+	this->glGetTexLevelParameterfv = &glGetTexLevelParameterfv_enc;
+	this->glGetTexLevelParameteriv = &glGetTexLevelParameteriv_enc;
+	this->glMapBufferRangeDMA = &glMapBufferRangeDMA_enc;
+	this->glUnmapBufferDMA = &glUnmapBufferDMA_enc;
+	this->glMapBufferRangeDirect = &glMapBufferRangeDirect_enc;
+	this->glUnmapBufferDirect = &glUnmapBufferDirect_enc;
+	this->glFlushMappedBufferRangeDirect = &glFlushMappedBufferRangeDirect_enc;
+	this->glGetGraphicsResetStatusEXT = &glGetGraphicsResetStatusEXT_enc;
+	this->glReadnPixelsEXT = &glReadnPixelsEXT_enc;
+	this->glGetnUniformfvEXT = &glGetnUniformfvEXT_enc;
+	this->glGetnUniformivEXT = &glGetnUniformivEXT_enc;
+	this->glDrawArraysNullAEMU = &glDrawArraysNullAEMU_enc;
+	this->glDrawElementsNullAEMU = (glDrawElementsNullAEMU_client_proc_t) &enc_unsupported;
+	this->glDrawElementsOffsetNullAEMU = &glDrawElementsOffsetNullAEMU_enc;
+	this->glDrawElementsDataNullAEMU = &glDrawElementsDataNullAEMU_enc;
+	this->glUnmapBufferAsyncAEMU = &glUnmapBufferAsyncAEMU_enc;
+	this->glFlushMappedBufferRangeAEMU2 = &glFlushMappedBufferRangeAEMU2_enc;
+	this->glBufferDataSyncAEMU = &glBufferDataSyncAEMU_enc;
+	this->glTexBufferOES = &glTexBufferOES_enc;
+	this->glTexBufferRangeOES = &glTexBufferRangeOES_enc;
+	this->glTexBufferEXT = &glTexBufferEXT_enc;
+	this->glTexBufferRangeEXT = &glTexBufferRangeEXT_enc;
+	this->glEnableiEXT = &glEnableiEXT_enc;
+	this->glDisableiEXT = &glDisableiEXT_enc;
+	this->glBlendEquationiEXT = &glBlendEquationiEXT_enc;
+	this->glBlendEquationSeparateiEXT = &glBlendEquationSeparateiEXT_enc;
+	this->glBlendFunciEXT = &glBlendFunciEXT_enc;
+	this->glBlendFuncSeparateiEXT = &glBlendFuncSeparateiEXT_enc;
+	this->glColorMaskiEXT = &glColorMaskiEXT_enc;
+	this->glIsEnablediEXT = &glIsEnablediEXT_enc;
+}
+
diff --git a/system/GLESv2_enc/gl2_enc.h b/system/GLESv2_enc/gl2_enc.h
new file mode 100644
index 0000000..501a339
--- /dev/null
+++ b/system/GLESv2_enc/gl2_enc.h
@@ -0,0 +1,25 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+
+#ifndef GUARD_gl2_encoder_context_t
+#define GUARD_gl2_encoder_context_t
+
+#include "IOStream.h"
+#include "ChecksumCalculator.h"
+#include "gl2_client_context.h"
+
+
+#include <string.h>
+#include "glUtils.h"
+#include "GL2EncoderUtils.h"
+
+struct gl2_encoder_context_t : public gl2_client_context_t {
+
+	gfxstream::IOStream *m_stream;
+	ChecksumCalculator *m_checksumCalculator;
+
+	gl2_encoder_context_t(gfxstream::IOStream *stream, ChecksumCalculator *checksumCalculator);
+	virtual uint64_t lockAndWriteDma(void*, uint32_t) { return 0; }
+};
+
+#endif  // GUARD_gl2_encoder_context_t
diff --git a/system/GLESv2_enc/gl2_entry.cpp b/system/GLESv2_enc/gl2_entry.cpp
new file mode 100644
index 0000000..a187ad0
--- /dev/null
+++ b/system/GLESv2_enc/gl2_entry.cpp
@@ -0,0 +1,3125 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+#include <stdio.h>
+#include <stdlib.h>
+#include "gl2_client_context.h"
+
+extern "C" {
+	void glActiveTexture(GLenum texture);
+	void glAttachShader(GLuint program, GLuint shader);
+	void glBindAttribLocation(GLuint program, GLuint index, const GLchar* name);
+	void glBindBuffer(GLenum target, GLuint buffer);
+	void glBindFramebuffer(GLenum target, GLuint framebuffer);
+	void glBindRenderbuffer(GLenum target, GLuint renderbuffer);
+	void glBindTexture(GLenum target, GLuint texture);
+	void glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+	void glBlendEquation(GLenum mode);
+	void glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
+	void glBlendFunc(GLenum sfactor, GLenum dfactor);
+	void glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+	void glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
+	void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
+	GLenum glCheckFramebufferStatus(GLenum target);
+	void glClear(GLbitfield mask);
+	void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+	void glClearDepthf(GLclampf depth);
+	void glClearStencil(GLint s);
+	void glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+	void glCompileShader(GLuint shader);
+	void glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data);
+	void glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data);
+	void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+	void glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+	GLuint glCreateProgram();
+	GLuint glCreateShader(GLenum type);
+	void glCullFace(GLenum mode);
+	void glDeleteBuffers(GLsizei n, const GLuint* buffers);
+	void glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers);
+	void glDeleteProgram(GLuint program);
+	void glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers);
+	void glDeleteShader(GLuint shader);
+	void glDeleteTextures(GLsizei n, const GLuint* textures);
+	void glDepthFunc(GLenum func);
+	void glDepthMask(GLboolean flag);
+	void glDepthRangef(GLclampf zNear, GLclampf zFar);
+	void glDetachShader(GLuint program, GLuint shader);
+	void glDisable(GLenum cap);
+	void glDisableVertexAttribArray(GLuint index);
+	void glDrawArrays(GLenum mode, GLint first, GLsizei count);
+	void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices);
+	void glEnable(GLenum cap);
+	void glEnableVertexAttribArray(GLuint index);
+	void glFinish();
+	void glFlush();
+	void glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+	void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+	void glFrontFace(GLenum mode);
+	void glGenBuffers(GLsizei n, GLuint* buffers);
+	void glGenerateMipmap(GLenum target);
+	void glGenFramebuffers(GLsizei n, GLuint* framebuffers);
+	void glGenRenderbuffers(GLsizei n, GLuint* renderbuffers);
+	void glGenTextures(GLsizei n, GLuint* textures);
+	void glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
+	void glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
+	void glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
+	int glGetAttribLocation(GLuint program, const GLchar* name);
+	void glGetBooleanv(GLenum pname, GLboolean* params);
+	void glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params);
+	GLenum glGetError();
+	void glGetFloatv(GLenum pname, GLfloat* params);
+	void glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params);
+	void glGetIntegerv(GLenum pname, GLint* params);
+	void glGetProgramiv(GLuint program, GLenum pname, GLint* params);
+	void glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog);
+	void glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params);
+	void glGetShaderiv(GLuint shader, GLenum pname, GLint* params);
+	void glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog);
+	void glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
+	void glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source);
+	const GLubyte* glGetString(GLenum name);
+	void glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params);
+	void glGetTexParameteriv(GLenum target, GLenum pname, GLint* params);
+	void glGetUniformfv(GLuint program, GLint location, GLfloat* params);
+	void glGetUniformiv(GLuint program, GLint location, GLint* params);
+	int glGetUniformLocation(GLuint program, const GLchar* name);
+	void glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params);
+	void glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params);
+	void glGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid** pointer);
+	void glHint(GLenum target, GLenum mode);
+	GLboolean glIsBuffer(GLuint buffer);
+	GLboolean glIsEnabled(GLenum cap);
+	GLboolean glIsFramebuffer(GLuint framebuffer);
+	GLboolean glIsProgram(GLuint program);
+	GLboolean glIsRenderbuffer(GLuint renderbuffer);
+	GLboolean glIsShader(GLuint shader);
+	GLboolean glIsTexture(GLuint texture);
+	void glLineWidth(GLfloat width);
+	void glLinkProgram(GLuint program);
+	void glPixelStorei(GLenum pname, GLint param);
+	void glPolygonOffset(GLfloat factor, GLfloat units);
+	void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
+	void glReleaseShaderCompiler();
+	void glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+	void glSampleCoverage(GLclampf value, GLboolean invert);
+	void glScissor(GLint x, GLint y, GLsizei width, GLsizei height);
+	void glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length);
+	void glShaderSource(GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length);
+	void glStencilFunc(GLenum func, GLint ref, GLuint mask);
+	void glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask);
+	void glStencilMask(GLuint mask);
+	void glStencilMaskSeparate(GLenum face, GLuint mask);
+	void glStencilOp(GLenum fail, GLenum zfail, GLenum zpass);
+	void glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
+	void glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
+	void glTexParameterf(GLenum target, GLenum pname, GLfloat param);
+	void glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params);
+	void glTexParameteri(GLenum target, GLenum pname, GLint param);
+	void glTexParameteriv(GLenum target, GLenum pname, const GLint* params);
+	void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels);
+	void glUniform1f(GLint location, GLfloat x);
+	void glUniform1fv(GLint location, GLsizei count, const GLfloat* v);
+	void glUniform1i(GLint location, GLint x);
+	void glUniform1iv(GLint location, GLsizei count, const GLint* v);
+	void glUniform2f(GLint location, GLfloat x, GLfloat y);
+	void glUniform2fv(GLint location, GLsizei count, const GLfloat* v);
+	void glUniform2i(GLint location, GLint x, GLint y);
+	void glUniform2iv(GLint location, GLsizei count, const GLint* v);
+	void glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z);
+	void glUniform3fv(GLint location, GLsizei count, const GLfloat* v);
+	void glUniform3i(GLint location, GLint x, GLint y, GLint z);
+	void glUniform3iv(GLint location, GLsizei count, const GLint* v);
+	void glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+	void glUniform4fv(GLint location, GLsizei count, const GLfloat* v);
+	void glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w);
+	void glUniform4iv(GLint location, GLsizei count, const GLint* v);
+	void glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+	void glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+	void glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+	void glUseProgram(GLuint program);
+	void glValidateProgram(GLuint program);
+	void glVertexAttrib1f(GLuint indx, GLfloat x);
+	void glVertexAttrib1fv(GLuint indx, const GLfloat* values);
+	void glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y);
+	void glVertexAttrib2fv(GLuint indx, const GLfloat* values);
+	void glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
+	void glVertexAttrib3fv(GLuint indx, const GLfloat* values);
+	void glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+	void glVertexAttrib4fv(GLuint indx, const GLfloat* values);
+	void glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr);
+	void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
+	void glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image);
+	void glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image);
+	void glGetProgramBinaryOES(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, GLvoid* binary);
+	void glProgramBinaryOES(GLuint program, GLenum binaryFormat, const GLvoid* binary, GLint length);
+	void* glMapBufferOES(GLenum target, GLenum access);
+	GLboolean glUnmapBufferOES(GLenum target);
+	void glTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
+	void glTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels);
+	void glCopyTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+	void glCompressedTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data);
+	void glCompressedTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data);
+	void glFramebufferTexture3DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+	void glBindVertexArrayOES(GLuint array);
+	void glDeleteVertexArraysOES(GLsizei n, const GLuint* arrays);
+	void glGenVertexArraysOES(GLsizei n, GLuint* arrays);
+	GLboolean glIsVertexArrayOES(GLuint array);
+	void glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum* attachments);
+	void glMultiDrawArraysEXT(GLenum mode, const GLint* first, const GLsizei* count, GLsizei primcount);
+	void glMultiDrawElementsEXT(GLenum mode, const GLsizei* count, GLenum type, const GLvoid* const* indices, GLsizei primcount);
+	void glGetPerfMonitorGroupsAMD(GLint* numGroups, GLsizei groupsSize, GLuint* groups);
+	void glGetPerfMonitorCountersAMD(GLuint group, GLint* numCounters, GLint* maxActiveCounters, GLsizei counterSize, GLuint* counters);
+	void glGetPerfMonitorGroupStringAMD(GLuint group, GLsizei bufSize, GLsizei* length, GLchar* groupString);
+	void glGetPerfMonitorCounterStringAMD(GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, GLchar* counterString);
+	void glGetPerfMonitorCounterInfoAMD(GLuint group, GLuint counter, GLenum pname, GLvoid* data);
+	void glGenPerfMonitorsAMD(GLsizei n, GLuint* monitors);
+	void glDeletePerfMonitorsAMD(GLsizei n, GLuint* monitors);
+	void glSelectPerfMonitorCountersAMD(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* countersList);
+	void glBeginPerfMonitorAMD(GLuint monitor);
+	void glEndPerfMonitorAMD(GLuint monitor);
+	void glGetPerfMonitorCounterDataAMD(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint* bytesWritten);
+	void glRenderbufferStorageMultisampleIMG(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+	void glFramebufferTexture2DMultisampleIMG(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+	void glDeleteFencesNV(GLsizei n, const GLuint* fences);
+	void glGenFencesNV(GLsizei n, GLuint* fences);
+	GLboolean glIsFenceNV(GLuint fence);
+	GLboolean glTestFenceNV(GLuint fence);
+	void glGetFenceivNV(GLuint fence, GLenum pname, GLint* params);
+	void glFinishFenceNV(GLuint fence);
+	void glSetFenceNV(GLuint fence, GLenum condition);
+	void glCoverageMaskNV(GLboolean mask);
+	void glCoverageOperationNV(GLenum operation);
+	void glGetDriverControlsQCOM(GLint* num, GLsizei size, GLuint* driverControls);
+	void glGetDriverControlStringQCOM(GLuint driverControl, GLsizei bufSize, GLsizei* length, GLchar* driverControlString);
+	void glEnableDriverControlQCOM(GLuint driverControl);
+	void glDisableDriverControlQCOM(GLuint driverControl);
+	void glExtGetTexturesQCOM(GLuint* textures, GLint maxTextures, GLint* numTextures);
+	void glExtGetBuffersQCOM(GLuint* buffers, GLint maxBuffers, GLint* numBuffers);
+	void glExtGetRenderbuffersQCOM(GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers);
+	void glExtGetFramebuffersQCOM(GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers);
+	void glExtGetTexLevelParameterivQCOM(GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params);
+	void glExtTexObjectStateOverrideiQCOM(GLenum target, GLenum pname, GLint param);
+	void glExtGetTexSubImageQCOM(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid* texels);
+	void glExtGetBufferPointervQCOM(GLenum target, GLvoidptr* params);
+	void glExtGetShadersQCOM(GLuint* shaders, GLint maxShaders, GLint* numShaders);
+	void glExtGetProgramsQCOM(GLuint* programs, GLint maxPrograms, GLint* numPrograms);
+	GLboolean glExtIsProgramBinaryQCOM(GLuint program);
+	void glExtGetProgramBinarySourceQCOM(GLuint program, GLenum shadertype, GLchar* source, GLint* length);
+	void glStartTilingQCOM(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
+	void glEndTilingQCOM(GLbitfield preserveMask);
+	void glVertexAttribPointerData(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, void* data, GLuint datalen);
+	void glVertexAttribPointerOffset(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint offset);
+	void glDrawElementsOffset(GLenum mode, GLsizei count, GLenum type, GLuint offset);
+	void glDrawElementsData(GLenum mode, GLsizei count, GLenum type, void* data, GLuint datalen);
+	void glGetCompressedTextureFormats(int count, GLint* formats);
+	void glShaderString(GLuint shader, const GLchar* string, GLsizei len);
+	int glFinishRoundTrip();
+	void glGenVertexArrays(GLsizei n, GLuint* arrays);
+	void glBindVertexArray(GLuint array);
+	void glDeleteVertexArrays(GLsizei n, const GLuint* arrays);
+	GLboolean glIsVertexArray(GLuint array);
+	void* glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+	GLboolean glUnmapBuffer(GLenum target);
+	void glFlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length);
+	void glMapBufferRangeAEMU(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* mapped);
+	void glUnmapBufferAEMU(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* guest_buffer, GLboolean* out_res);
+	void glFlushMappedBufferRangeAEMU(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* guest_buffer);
+	void glReadPixelsOffsetAEMU(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLuint offset);
+	void glCompressedTexImage2DOffsetAEMU(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, GLuint offset);
+	void glCompressedTexSubImage2DOffsetAEMU(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, GLuint offset);
+	void glTexImage2DOffsetAEMU(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLuint offset);
+	void glTexSubImage2DOffsetAEMU(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLuint offset);
+	void glBindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+	void glBindBufferBase(GLenum target, GLuint index, GLuint buffer);
+	void glCopyBufferSubData(GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size);
+	void glClearBufferiv(GLenum buffer, GLint drawBuffer, const GLint* value);
+	void glClearBufferuiv(GLenum buffer, GLint drawBuffer, const GLuint* value);
+	void glClearBufferfv(GLenum buffer, GLint drawBuffer, const GLfloat* value);
+	void glClearBufferfi(GLenum buffer, GLint drawBuffer, GLfloat depth, GLint stencil);
+	void glGetBufferParameteri64v(GLenum target, GLenum value, GLint64* data);
+	void glGetBufferPointerv(GLenum target, GLenum pname, GLvoid** params);
+	void glUniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
+	GLuint glGetUniformBlockIndex(GLuint program, const GLchar* uniformBlockName);
+	void glGetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar** uniformNames, GLuint* uniformIndices);
+	void glGetUniformIndicesAEMU(GLuint program, GLsizei uniformCount, const GLchar* packedUniformNames, GLsizei packedLen, GLuint* uniformIndices);
+	void glGetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params);
+	void glGetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName);
+	void glUniform1ui(GLint location, GLuint v0);
+	void glUniform2ui(GLint location, GLuint v0, GLuint v1);
+	void glUniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2);
+	void glUniform4ui(GLint location, GLint v0, GLuint v1, GLuint v2, GLuint v3);
+	void glUniform1uiv(GLint location, GLsizei count, const GLuint* value);
+	void glUniform2uiv(GLint location, GLsizei count, const GLuint* value);
+	void glUniform3uiv(GLint location, GLsizei count, const GLuint* value);
+	void glUniform4uiv(GLint location, GLsizei count, const GLuint* value);
+	void glUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+	void glUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+	void glUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+	void glUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+	void glUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+	void glUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+	void glGetUniformuiv(GLuint program, GLint location, GLuint* params);
+	void glGetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params);
+	void glVertexAttribI4i(GLuint index, GLint v0, GLint v1, GLint v2, GLint v3);
+	void glVertexAttribI4ui(GLuint index, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+	void glVertexAttribI4iv(GLuint index, const GLint* v);
+	void glVertexAttribI4uiv(GLuint index, const GLuint* v);
+	void glVertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
+	void glVertexAttribIPointerOffsetAEMU(GLuint index, GLint size, GLenum type, GLsizei stride, GLuint offset);
+	void glVertexAttribIPointerDataAEMU(GLuint index, GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen);
+	void glGetVertexAttribIiv(GLuint index, GLenum pname, GLint* params);
+	void glGetVertexAttribIuiv(GLuint index, GLenum pname, GLuint* params);
+	void glVertexAttribDivisor(GLuint index, GLuint divisor);
+	void glDrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+	void glDrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount);
+	void glDrawElementsInstancedDataAEMU(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount, GLsizei datalen);
+	void glDrawElementsInstancedOffsetAEMU(GLenum mode, GLsizei count, GLenum type, GLuint offset, GLsizei primcount);
+	void glDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices);
+	void glDrawRangeElementsDataAEMU(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices, GLsizei datalen);
+	void glDrawRangeElementsOffsetAEMU(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLuint offset);
+	GLsync glFenceSync(GLenum condition, GLbitfield flags);
+	GLenum glClientWaitSync(GLsync wait_on, GLbitfield flags, GLuint64 timeout);
+	void glWaitSync(GLsync wait_on, GLbitfield flags, GLuint64 timeout);
+	void glDeleteSync(GLsync to_delete);
+	GLboolean glIsSync(GLsync sync);
+	void glGetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values);
+	uint64_t glFenceSyncAEMU(GLenum condition, GLbitfield flags);
+	GLenum glClientWaitSyncAEMU(uint64_t wait_on, GLbitfield flags, GLuint64 timeout);
+	void glWaitSyncAEMU(uint64_t wait_on, GLbitfield flags, GLuint64 timeout);
+	void glDeleteSyncAEMU(uint64_t to_delete);
+	GLboolean glIsSyncAEMU(uint64_t sync);
+	void glGetSyncivAEMU(uint64_t sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values);
+	void glDrawBuffers(GLsizei n, const GLenum* bufs);
+	void glReadBuffer(GLenum src);
+	void glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+	void glInvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments);
+	void glInvalidateSubFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height);
+	void glFramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+	void glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+	void glTexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+	void glGetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params);
+	void glBeginTransformFeedback(GLenum primitiveMode);
+	void glEndTransformFeedback();
+	void glGenTransformFeedbacks(GLsizei n, GLuint* ids);
+	void glDeleteTransformFeedbacks(GLsizei n, const GLuint* ids);
+	void glBindTransformFeedback(GLenum target, GLuint id);
+	void glPauseTransformFeedback();
+	void glResumeTransformFeedback();
+	GLboolean glIsTransformFeedback(GLuint id);
+	void glTransformFeedbackVaryings(GLuint program, GLsizei count, const char** varyings, GLenum bufferMode);
+	void glTransformFeedbackVaryingsAEMU(GLuint program, GLsizei count, const char* packedVaryings, GLuint packedVaryingsLen, GLenum bufferMode);
+	void glGetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, char* name);
+	void glGenSamplers(GLsizei n, GLuint* samplers);
+	void glDeleteSamplers(GLsizei n, const GLuint* samplers);
+	void glBindSampler(GLuint unit, GLuint sampler);
+	void glSamplerParameterf(GLuint sampler, GLenum pname, GLfloat param);
+	void glSamplerParameteri(GLuint sampler, GLenum pname, GLint param);
+	void glSamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat* params);
+	void glSamplerParameteriv(GLuint sampler, GLenum pname, const GLint* params);
+	void glGetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat* params);
+	void glGetSamplerParameteriv(GLuint sampler, GLenum pname, GLint* params);
+	GLboolean glIsSampler(GLuint sampler);
+	void glGenQueries(GLsizei n, GLuint* queries);
+	void glDeleteQueries(GLsizei n, const GLuint* queries);
+	void glBeginQuery(GLenum target, GLuint query);
+	void glEndQuery(GLenum target);
+	void glGetQueryiv(GLenum target, GLenum pname, GLint* params);
+	void glGetQueryObjectuiv(GLuint query, GLenum pname, GLuint* params);
+	GLboolean glIsQuery(GLuint query);
+	void glProgramParameteri(GLuint program, GLenum pname, GLint value);
+	void glProgramBinary(GLuint program, GLenum binaryFormat, const void* binary, GLsizei length);
+	void glGetProgramBinary(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, void* binary);
+	GLint glGetFragDataLocation(GLuint program, const char* name);
+	void glGetInteger64v(GLenum pname, GLint64* data);
+	void glGetIntegeri_v(GLenum target, GLuint index, GLint* data);
+	void glGetInteger64i_v(GLenum target, GLuint index, GLint64* data);
+	void glTexImage3D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* data);
+	void glTexImage3DOffsetAEMU(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLuint offset);
+	void glTexStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+	void glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* data);
+	void glTexSubImage3DOffsetAEMU(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLuint offset);
+	void glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data);
+	void glCompressedTexImage3DOffsetAEMU(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, GLuint offset);
+	void glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data);
+	void glCompressedTexSubImage3DOffsetAEMU(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, GLuint data);
+	void glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+	const GLubyte* glGetStringi(GLenum name, GLuint index);
+	void glGetBooleani_v(GLenum target, GLuint index, GLboolean* data);
+	void glMemoryBarrier(GLbitfield barriers);
+	void glMemoryBarrierByRegion(GLbitfield barriers);
+	void glGenProgramPipelines(GLsizei n, GLuint* pipelines);
+	void glDeleteProgramPipelines(GLsizei n, const GLuint* pipelines);
+	void glBindProgramPipeline(GLuint pipeline);
+	void glGetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint* params);
+	void glGetProgramPipelineInfoLog(GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar* infoLog);
+	void glValidateProgramPipeline(GLuint pipeline);
+	GLboolean glIsProgramPipeline(GLuint pipeline);
+	void glUseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program);
+	void glActiveShaderProgram(GLuint pipeline, GLuint program);
+	GLuint glCreateShaderProgramv(GLenum type, GLsizei count, const char** strings);
+	GLuint glCreateShaderProgramvAEMU(GLenum type, GLsizei count, const char* packedStrings, GLuint packedLen);
+	void glProgramUniform1f(GLuint program, GLint location, GLfloat v0);
+	void glProgramUniform2f(GLuint program, GLint location, GLfloat v0, GLfloat v1);
+	void glProgramUniform3f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+	void glProgramUniform4f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+	void glProgramUniform1i(GLuint program, GLint location, GLint v0);
+	void glProgramUniform2i(GLuint program, GLint location, GLint v0, GLint v1);
+	void glProgramUniform3i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+	void glProgramUniform4i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+	void glProgramUniform1ui(GLuint program, GLint location, GLuint v0);
+	void glProgramUniform2ui(GLuint program, GLint location, GLint v0, GLuint v1);
+	void glProgramUniform3ui(GLuint program, GLint location, GLint v0, GLint v1, GLuint v2);
+	void glProgramUniform4ui(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLuint v3);
+	void glProgramUniform1fv(GLuint program, GLint location, GLsizei count, const GLfloat* value);
+	void glProgramUniform2fv(GLuint program, GLint location, GLsizei count, const GLfloat* value);
+	void glProgramUniform3fv(GLuint program, GLint location, GLsizei count, const GLfloat* value);
+	void glProgramUniform4fv(GLuint program, GLint location, GLsizei count, const GLfloat* value);
+	void glProgramUniform1iv(GLuint program, GLint location, GLsizei count, const GLint* value);
+	void glProgramUniform2iv(GLuint program, GLint location, GLsizei count, const GLint* value);
+	void glProgramUniform3iv(GLuint program, GLint location, GLsizei count, const GLint* value);
+	void glProgramUniform4iv(GLuint program, GLint location, GLsizei count, const GLint* value);
+	void glProgramUniform1uiv(GLuint program, GLint location, GLsizei count, const GLuint* value);
+	void glProgramUniform2uiv(GLuint program, GLint location, GLsizei count, const GLuint* value);
+	void glProgramUniform3uiv(GLuint program, GLint location, GLsizei count, const GLuint* value);
+	void glProgramUniform4uiv(GLuint program, GLint location, GLsizei count, const GLuint* value);
+	void glProgramUniformMatrix2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+	void glProgramUniformMatrix3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+	void glProgramUniformMatrix4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+	void glProgramUniformMatrix2x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+	void glProgramUniformMatrix3x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+	void glProgramUniformMatrix2x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+	void glProgramUniformMatrix4x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+	void glProgramUniformMatrix3x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+	void glProgramUniformMatrix4x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+	void glGetProgramInterfaceiv(GLuint program, GLenum programInterface, GLenum pname, GLint* params);
+	void glGetProgramResourceiv(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei* length, GLint* params);
+	GLuint glGetProgramResourceIndex(GLuint program, GLenum programInterface, const char* name);
+	GLint glGetProgramResourceLocation(GLuint program, GLenum programInterface, const char* name);
+	void glGetProgramResourceName(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, char* name);
+	void glBindImageTexture(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
+	void glDispatchCompute(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
+	void glDispatchComputeIndirect(GLintptr indirect);
+	void glBindVertexBuffer(GLuint bindingindex, GLuint buffer, GLintptr offset, GLintptr stride);
+	void glVertexAttribBinding(GLuint attribindex, GLuint bindingindex);
+	void glVertexAttribFormat(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
+	void glVertexAttribIFormat(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+	void glVertexBindingDivisor(GLuint bindingindex, GLuint divisor);
+	void glDrawArraysIndirect(GLenum mode, const void* indirect);
+	void glDrawArraysIndirectDataAEMU(GLenum mode, const void* indirect, GLuint datalen);
+	void glDrawArraysIndirectOffsetAEMU(GLenum mode, GLuint offset);
+	void glDrawElementsIndirect(GLenum mode, GLenum type, const void* indirect);
+	void glDrawElementsIndirectDataAEMU(GLenum mode, GLenum type, const void* indirect, GLuint datalen);
+	void glDrawElementsIndirectOffsetAEMU(GLenum mode, GLenum type, GLuint offset);
+	void glTexStorage2DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+	void glSampleMaski(GLuint maskNumber, GLbitfield mask);
+	void glGetMultisamplefv(GLenum pname, GLuint index, GLfloat* val);
+	void glFramebufferParameteri(GLenum target, GLenum pname, GLint param);
+	void glGetFramebufferParameteriv(GLenum target, GLenum pname, GLint* params);
+	void glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat* params);
+	void glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint* params);
+	void glMapBufferRangeDMA(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, uint64_t paddr);
+	void glUnmapBufferDMA(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, uint64_t paddr, GLboolean* out_res);
+	uint64_t glMapBufferRangeDirect(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, uint64_t paddr);
+	void glUnmapBufferDirect(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, uint64_t paddr, uint64_t guest_ptr, GLboolean* out_res);
+	void glFlushMappedBufferRangeDirect(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+	GLenum glGetGraphicsResetStatusEXT();
+	void glReadnPixelsEXT(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid* data);
+	void glGetnUniformfvEXT(GLuint program, GLint location, GLsizei bufSize, GLfloat* params);
+	void glGetnUniformivEXT(GLuint program, GLint location, GLsizei bufSize, GLint* params);
+	void glDrawArraysNullAEMU(GLenum mode, GLint first, GLsizei count);
+	void glDrawElementsNullAEMU(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices);
+	void glDrawElementsOffsetNullAEMU(GLenum mode, GLsizei count, GLenum type, GLuint offset);
+	void glDrawElementsDataNullAEMU(GLenum mode, GLsizei count, GLenum type, void* data, GLuint datalen);
+	void glUnmapBufferAsyncAEMU(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* guest_buffer, GLboolean* out_res);
+	void glFlushMappedBufferRangeAEMU2(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* guest_buffer);
+	GLboolean glBufferDataSyncAEMU(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
+	void glTexBufferOES(GLenum target, GLenum internalFormat, GLuint buffer);
+	void glTexBufferRangeOES(GLenum target, GLenum internalFormat, GLuint buffer, GLintptr offset, GLsizeiptr size);
+	void glTexBufferEXT(GLenum target, GLenum internalFormat, GLuint buffer);
+	void glTexBufferRangeEXT(GLenum target, GLenum internalFormat, GLuint buffer, GLintptr offset, GLsizeiptr size);
+	void glEnableiEXT(GLenum cap, GLuint index);
+	void glDisableiEXT(GLenum cap, GLuint index);
+	void glBlendEquationiEXT(GLuint index, GLenum mode);
+	void glBlendEquationSeparateiEXT(GLuint index, GLenum modeRGB, GLenum modeAlpha);
+	void glBlendFunciEXT(GLuint index, GLenum sfactor, GLenum dfactor);
+	void glBlendFuncSeparateiEXT(GLuint index, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+	void glColorMaskiEXT(GLuint index, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+	GLboolean glIsEnablediEXT(GLenum cap, GLuint index);
+};
+
+#ifndef GET_CONTEXT
+static gl2_client_context_t::CONTEXT_ACCESSOR_TYPE *getCurrentContext = NULL;
+void gl2_client_context_t::setContextAccessor(CONTEXT_ACCESSOR_TYPE *f) { getCurrentContext = f; }
+#define GET_CONTEXT gl2_client_context_t * ctx = getCurrentContext()
+#endif
+
+void glActiveTexture(GLenum texture)
+{
+	GET_CONTEXT;
+	ctx->glActiveTexture(ctx, texture);
+}
+
+void glAttachShader(GLuint program, GLuint shader)
+{
+	GET_CONTEXT;
+	ctx->glAttachShader(ctx, program, shader);
+}
+
+void glBindAttribLocation(GLuint program, GLuint index, const GLchar* name)
+{
+	GET_CONTEXT;
+	ctx->glBindAttribLocation(ctx, program, index, name);
+}
+
+void glBindBuffer(GLenum target, GLuint buffer)
+{
+	GET_CONTEXT;
+	ctx->glBindBuffer(ctx, target, buffer);
+}
+
+void glBindFramebuffer(GLenum target, GLuint framebuffer)
+{
+	GET_CONTEXT;
+	ctx->glBindFramebuffer(ctx, target, framebuffer);
+}
+
+void glBindRenderbuffer(GLenum target, GLuint renderbuffer)
+{
+	GET_CONTEXT;
+	ctx->glBindRenderbuffer(ctx, target, renderbuffer);
+}
+
+void glBindTexture(GLenum target, GLuint texture)
+{
+	GET_CONTEXT;
+	ctx->glBindTexture(ctx, target, texture);
+}
+
+void glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+{
+	GET_CONTEXT;
+	ctx->glBlendColor(ctx, red, green, blue, alpha);
+}
+
+void glBlendEquation(GLenum mode)
+{
+	GET_CONTEXT;
+	ctx->glBlendEquation(ctx, mode);
+}
+
+void glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
+{
+	GET_CONTEXT;
+	ctx->glBlendEquationSeparate(ctx, modeRGB, modeAlpha);
+}
+
+void glBlendFunc(GLenum sfactor, GLenum dfactor)
+{
+	GET_CONTEXT;
+	ctx->glBlendFunc(ctx, sfactor, dfactor);
+}
+
+void glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
+{
+	GET_CONTEXT;
+	ctx->glBlendFuncSeparate(ctx, srcRGB, dstRGB, srcAlpha, dstAlpha);
+}
+
+void glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage)
+{
+	GET_CONTEXT;
+	ctx->glBufferData(ctx, target, size, data, usage);
+}
+
+void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data)
+{
+	GET_CONTEXT;
+	ctx->glBufferSubData(ctx, target, offset, size, data);
+}
+
+GLenum glCheckFramebufferStatus(GLenum target)
+{
+	GET_CONTEXT;
+	return ctx->glCheckFramebufferStatus(ctx, target);
+}
+
+void glClear(GLbitfield mask)
+{
+	GET_CONTEXT;
+	ctx->glClear(ctx, mask);
+}
+
+void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+{
+	GET_CONTEXT;
+	ctx->glClearColor(ctx, red, green, blue, alpha);
+}
+
+void glClearDepthf(GLclampf depth)
+{
+	GET_CONTEXT;
+	ctx->glClearDepthf(ctx, depth);
+}
+
+void glClearStencil(GLint s)
+{
+	GET_CONTEXT;
+	ctx->glClearStencil(ctx, s);
+}
+
+void glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
+{
+	GET_CONTEXT;
+	ctx->glColorMask(ctx, red, green, blue, alpha);
+}
+
+void glCompileShader(GLuint shader)
+{
+	GET_CONTEXT;
+	ctx->glCompileShader(ctx, shader);
+}
+
+void glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data)
+{
+	GET_CONTEXT;
+	 if(imageSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glCompressedTexImage2D(ctx, target, level, internalformat, width, height, border, imageSize, data);
+}
+
+void glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data)
+{
+	GET_CONTEXT;
+	 if(imageSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glCompressedTexSubImage2D(ctx, target, level, xoffset, yoffset, width, height, format, imageSize, data);
+}
+
+void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
+{
+	GET_CONTEXT;
+	ctx->glCopyTexImage2D(ctx, target, level, internalformat, x, y, width, height, border);
+}
+
+void glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+	GET_CONTEXT;
+	ctx->glCopyTexSubImage2D(ctx, target, level, xoffset, yoffset, x, y, width, height);
+}
+
+GLuint glCreateProgram()
+{
+	GET_CONTEXT;
+	return ctx->glCreateProgram(ctx);
+}
+
+GLuint glCreateShader(GLenum type)
+{
+	GET_CONTEXT;
+	return ctx->glCreateShader(ctx, type);
+}
+
+void glCullFace(GLenum mode)
+{
+	GET_CONTEXT;
+	ctx->glCullFace(ctx, mode);
+}
+
+void glDeleteBuffers(GLsizei n, const GLuint* buffers)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glDeleteBuffers(ctx, n, buffers);
+}
+
+void glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glDeleteFramebuffers(ctx, n, framebuffers);
+}
+
+void glDeleteProgram(GLuint program)
+{
+	GET_CONTEXT;
+	ctx->glDeleteProgram(ctx, program);
+}
+
+void glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glDeleteRenderbuffers(ctx, n, renderbuffers);
+}
+
+void glDeleteShader(GLuint shader)
+{
+	GET_CONTEXT;
+	ctx->glDeleteShader(ctx, shader);
+}
+
+void glDeleteTextures(GLsizei n, const GLuint* textures)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glDeleteTextures(ctx, n, textures);
+}
+
+void glDepthFunc(GLenum func)
+{
+	GET_CONTEXT;
+	ctx->glDepthFunc(ctx, func);
+}
+
+void glDepthMask(GLboolean flag)
+{
+	GET_CONTEXT;
+	ctx->glDepthMask(ctx, flag);
+}
+
+void glDepthRangef(GLclampf zNear, GLclampf zFar)
+{
+	GET_CONTEXT;
+	ctx->glDepthRangef(ctx, zNear, zFar);
+}
+
+void glDetachShader(GLuint program, GLuint shader)
+{
+	GET_CONTEXT;
+	ctx->glDetachShader(ctx, program, shader);
+}
+
+void glDisable(GLenum cap)
+{
+	GET_CONTEXT;
+	ctx->glDisable(ctx, cap);
+}
+
+void glDisableVertexAttribArray(GLuint index)
+{
+	GET_CONTEXT;
+	ctx->glDisableVertexAttribArray(ctx, index);
+}
+
+void glDrawArrays(GLenum mode, GLint first, GLsizei count)
+{
+	GET_CONTEXT;
+	ctx->glDrawArrays(ctx, mode, first, count);
+}
+
+void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices)
+{
+	GET_CONTEXT;
+	ctx->glDrawElements(ctx, mode, count, type, indices);
+}
+
+void glEnable(GLenum cap)
+{
+	GET_CONTEXT;
+	ctx->glEnable(ctx, cap);
+}
+
+void glEnableVertexAttribArray(GLuint index)
+{
+	GET_CONTEXT;
+	ctx->glEnableVertexAttribArray(ctx, index);
+}
+
+void glFinish()
+{
+	GET_CONTEXT;
+	ctx->glFinish(ctx);
+}
+
+void glFlush()
+{
+	GET_CONTEXT;
+	ctx->glFlush(ctx);
+}
+
+void glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
+{
+	GET_CONTEXT;
+	ctx->glFramebufferRenderbuffer(ctx, target, attachment, renderbuffertarget, renderbuffer);
+}
+
+void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
+{
+	GET_CONTEXT;
+	ctx->glFramebufferTexture2D(ctx, target, attachment, textarget, texture, level);
+}
+
+void glFrontFace(GLenum mode)
+{
+	GET_CONTEXT;
+	ctx->glFrontFace(ctx, mode);
+}
+
+void glGenBuffers(GLsizei n, GLuint* buffers)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGenBuffers(ctx, n, buffers);
+}
+
+void glGenerateMipmap(GLenum target)
+{
+	GET_CONTEXT;
+	ctx->glGenerateMipmap(ctx, target);
+}
+
+void glGenFramebuffers(GLsizei n, GLuint* framebuffers)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGenFramebuffers(ctx, n, framebuffers);
+}
+
+void glGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGenRenderbuffers(ctx, n, renderbuffers);
+}
+
+void glGenTextures(GLsizei n, GLuint* textures)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGenTextures(ctx, n, textures);
+}
+
+void glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
+{
+	GET_CONTEXT;
+	 if(bufsize<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGetActiveAttrib(ctx, program, index, bufsize, length, size, type, name);
+}
+
+void glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
+{
+	GET_CONTEXT;
+	 if(bufsize<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGetActiveUniform(ctx, program, index, bufsize, length, size, type, name);
+}
+
+void glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
+{
+	GET_CONTEXT;
+	ctx->glGetAttachedShaders(ctx, program, maxcount, count, shaders);
+}
+
+int glGetAttribLocation(GLuint program, const GLchar* name)
+{
+	GET_CONTEXT;
+	return ctx->glGetAttribLocation(ctx, program, name);
+}
+
+void glGetBooleanv(GLenum pname, GLboolean* params)
+{
+	GET_CONTEXT;
+	ctx->glGetBooleanv(ctx, pname, params);
+}
+
+void glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetBufferParameteriv(ctx, target, pname, params);
+}
+
+GLenum glGetError()
+{
+	GET_CONTEXT;
+	return ctx->glGetError(ctx);
+}
+
+void glGetFloatv(GLenum pname, GLfloat* params)
+{
+	GET_CONTEXT;
+	ctx->glGetFloatv(ctx, pname, params);
+}
+
+void glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetFramebufferAttachmentParameteriv(ctx, target, attachment, pname, params);
+}
+
+void glGetIntegerv(GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetIntegerv(ctx, pname, params);
+}
+
+void glGetProgramiv(GLuint program, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetProgramiv(ctx, program, pname, params);
+}
+
+void glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog)
+{
+	GET_CONTEXT;
+	 if(bufsize<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGetProgramInfoLog(ctx, program, bufsize, length, infolog);
+}
+
+void glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetRenderbufferParameteriv(ctx, target, pname, params);
+}
+
+void glGetShaderiv(GLuint shader, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetShaderiv(ctx, shader, pname, params);
+}
+
+void glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog)
+{
+	GET_CONTEXT;
+	 if(bufsize<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGetShaderInfoLog(ctx, shader, bufsize, length, infolog);
+}
+
+void glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
+{
+	GET_CONTEXT;
+	ctx->glGetShaderPrecisionFormat(ctx, shadertype, precisiontype, range, precision);
+}
+
+void glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source)
+{
+	GET_CONTEXT;
+	 if(bufsize<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGetShaderSource(ctx, shader, bufsize, length, source);
+}
+
+const GLubyte* glGetString(GLenum name)
+{
+	GET_CONTEXT;
+	return ctx->glGetString(ctx, name);
+}
+
+void glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params)
+{
+	GET_CONTEXT;
+	ctx->glGetTexParameterfv(ctx, target, pname, params);
+}
+
+void glGetTexParameteriv(GLenum target, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetTexParameteriv(ctx, target, pname, params);
+}
+
+void glGetUniformfv(GLuint program, GLint location, GLfloat* params)
+{
+	GET_CONTEXT;
+	ctx->glGetUniformfv(ctx, program, location, params);
+}
+
+void glGetUniformiv(GLuint program, GLint location, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetUniformiv(ctx, program, location, params);
+}
+
+int glGetUniformLocation(GLuint program, const GLchar* name)
+{
+	GET_CONTEXT;
+	return ctx->glGetUniformLocation(ctx, program, name);
+}
+
+void glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
+{
+	GET_CONTEXT;
+	ctx->glGetVertexAttribfv(ctx, index, pname, params);
+}
+
+void glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetVertexAttribiv(ctx, index, pname, params);
+}
+
+void glGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid** pointer)
+{
+	GET_CONTEXT;
+	ctx->glGetVertexAttribPointerv(ctx, index, pname, pointer);
+}
+
+void glHint(GLenum target, GLenum mode)
+{
+	GET_CONTEXT;
+	ctx->glHint(ctx, target, mode);
+}
+
+GLboolean glIsBuffer(GLuint buffer)
+{
+	GET_CONTEXT;
+	return ctx->glIsBuffer(ctx, buffer);
+}
+
+GLboolean glIsEnabled(GLenum cap)
+{
+	GET_CONTEXT;
+	return ctx->glIsEnabled(ctx, cap);
+}
+
+GLboolean glIsFramebuffer(GLuint framebuffer)
+{
+	GET_CONTEXT;
+	return ctx->glIsFramebuffer(ctx, framebuffer);
+}
+
+GLboolean glIsProgram(GLuint program)
+{
+	GET_CONTEXT;
+	return ctx->glIsProgram(ctx, program);
+}
+
+GLboolean glIsRenderbuffer(GLuint renderbuffer)
+{
+	GET_CONTEXT;
+	return ctx->glIsRenderbuffer(ctx, renderbuffer);
+}
+
+GLboolean glIsShader(GLuint shader)
+{
+	GET_CONTEXT;
+	return ctx->glIsShader(ctx, shader);
+}
+
+GLboolean glIsTexture(GLuint texture)
+{
+	GET_CONTEXT;
+	return ctx->glIsTexture(ctx, texture);
+}
+
+void glLineWidth(GLfloat width)
+{
+	GET_CONTEXT;
+	ctx->glLineWidth(ctx, width);
+}
+
+void glLinkProgram(GLuint program)
+{
+	GET_CONTEXT;
+	ctx->glLinkProgram(ctx, program);
+}
+
+void glPixelStorei(GLenum pname, GLint param)
+{
+	GET_CONTEXT;
+	ctx->glPixelStorei(ctx, pname, param);
+}
+
+void glPolygonOffset(GLfloat factor, GLfloat units)
+{
+	GET_CONTEXT;
+	ctx->glPolygonOffset(ctx, factor, units);
+}
+
+void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels)
+{
+	GET_CONTEXT;
+	ctx->glReadPixels(ctx, x, y, width, height, format, type, pixels);
+}
+
+void glReleaseShaderCompiler()
+{
+	GET_CONTEXT;
+	ctx->glReleaseShaderCompiler(ctx);
+}
+
+void glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
+{
+	GET_CONTEXT;
+	ctx->glRenderbufferStorage(ctx, target, internalformat, width, height);
+}
+
+void glSampleCoverage(GLclampf value, GLboolean invert)
+{
+	GET_CONTEXT;
+	ctx->glSampleCoverage(ctx, value, invert);
+}
+
+void glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
+{
+	GET_CONTEXT;
+	ctx->glScissor(ctx, x, y, width, height);
+}
+
+void glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length)
+{
+	GET_CONTEXT;
+	ctx->glShaderBinary(ctx, n, shaders, binaryformat, binary, length);
+}
+
+void glShaderSource(GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length)
+{
+	GET_CONTEXT;
+	ctx->glShaderSource(ctx, shader, count, string, length);
+}
+
+void glStencilFunc(GLenum func, GLint ref, GLuint mask)
+{
+	GET_CONTEXT;
+	ctx->glStencilFunc(ctx, func, ref, mask);
+}
+
+void glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
+{
+	GET_CONTEXT;
+	ctx->glStencilFuncSeparate(ctx, face, func, ref, mask);
+}
+
+void glStencilMask(GLuint mask)
+{
+	GET_CONTEXT;
+	ctx->glStencilMask(ctx, mask);
+}
+
+void glStencilMaskSeparate(GLenum face, GLuint mask)
+{
+	GET_CONTEXT;
+	ctx->glStencilMaskSeparate(ctx, face, mask);
+}
+
+void glStencilOp(GLenum fail, GLenum zfail, GLenum zpass)
+{
+	GET_CONTEXT;
+	ctx->glStencilOp(ctx, fail, zfail, zpass);
+}
+
+void glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
+{
+	GET_CONTEXT;
+	ctx->glStencilOpSeparate(ctx, face, fail, zfail, zpass);
+}
+
+void glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
+{
+	GET_CONTEXT;
+	ctx->glTexImage2D(ctx, target, level, internalformat, width, height, border, format, type, pixels);
+}
+
+void glTexParameterf(GLenum target, GLenum pname, GLfloat param)
+{
+	GET_CONTEXT;
+	ctx->glTexParameterf(ctx, target, pname, param);
+}
+
+void glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params)
+{
+	GET_CONTEXT;
+	ctx->glTexParameterfv(ctx, target, pname, params);
+}
+
+void glTexParameteri(GLenum target, GLenum pname, GLint param)
+{
+	GET_CONTEXT;
+	ctx->glTexParameteri(ctx, target, pname, param);
+}
+
+void glTexParameteriv(GLenum target, GLenum pname, const GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glTexParameteriv(ctx, target, pname, params);
+}
+
+void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels)
+{
+	GET_CONTEXT;
+	ctx->glTexSubImage2D(ctx, target, level, xoffset, yoffset, width, height, format, type, pixels);
+}
+
+void glUniform1f(GLint location, GLfloat x)
+{
+	GET_CONTEXT;
+	ctx->glUniform1f(ctx, location, x);
+}
+
+void glUniform1fv(GLint location, GLsizei count, const GLfloat* v)
+{
+	GET_CONTEXT;
+	ctx->glUniform1fv(ctx, location, count, v);
+}
+
+void glUniform1i(GLint location, GLint x)
+{
+	GET_CONTEXT;
+	ctx->glUniform1i(ctx, location, x);
+}
+
+void glUniform1iv(GLint location, GLsizei count, const GLint* v)
+{
+	GET_CONTEXT;
+	ctx->glUniform1iv(ctx, location, count, v);
+}
+
+void glUniform2f(GLint location, GLfloat x, GLfloat y)
+{
+	GET_CONTEXT;
+	ctx->glUniform2f(ctx, location, x, y);
+}
+
+void glUniform2fv(GLint location, GLsizei count, const GLfloat* v)
+{
+	GET_CONTEXT;
+	ctx->glUniform2fv(ctx, location, count, v);
+}
+
+void glUniform2i(GLint location, GLint x, GLint y)
+{
+	GET_CONTEXT;
+	ctx->glUniform2i(ctx, location, x, y);
+}
+
+void glUniform2iv(GLint location, GLsizei count, const GLint* v)
+{
+	GET_CONTEXT;
+	ctx->glUniform2iv(ctx, location, count, v);
+}
+
+void glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
+{
+	GET_CONTEXT;
+	ctx->glUniform3f(ctx, location, x, y, z);
+}
+
+void glUniform3fv(GLint location, GLsizei count, const GLfloat* v)
+{
+	GET_CONTEXT;
+	ctx->glUniform3fv(ctx, location, count, v);
+}
+
+void glUniform3i(GLint location, GLint x, GLint y, GLint z)
+{
+	GET_CONTEXT;
+	ctx->glUniform3i(ctx, location, x, y, z);
+}
+
+void glUniform3iv(GLint location, GLsizei count, const GLint* v)
+{
+	GET_CONTEXT;
+	ctx->glUniform3iv(ctx, location, count, v);
+}
+
+void glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+	GET_CONTEXT;
+	ctx->glUniform4f(ctx, location, x, y, z, w);
+}
+
+void glUniform4fv(GLint location, GLsizei count, const GLfloat* v)
+{
+	GET_CONTEXT;
+	ctx->glUniform4fv(ctx, location, count, v);
+}
+
+void glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
+{
+	GET_CONTEXT;
+	ctx->glUniform4i(ctx, location, x, y, z, w);
+}
+
+void glUniform4iv(GLint location, GLsizei count, const GLint* v)
+{
+	GET_CONTEXT;
+	ctx->glUniform4iv(ctx, location, count, v);
+}
+
+void glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glUniformMatrix2fv(ctx, location, count, transpose, value);
+}
+
+void glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glUniformMatrix3fv(ctx, location, count, transpose, value);
+}
+
+void glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glUniformMatrix4fv(ctx, location, count, transpose, value);
+}
+
+void glUseProgram(GLuint program)
+{
+	GET_CONTEXT;
+	ctx->glUseProgram(ctx, program);
+}
+
+void glValidateProgram(GLuint program)
+{
+	GET_CONTEXT;
+	ctx->glValidateProgram(ctx, program);
+}
+
+void glVertexAttrib1f(GLuint indx, GLfloat x)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttrib1f(ctx, indx, x);
+}
+
+void glVertexAttrib1fv(GLuint indx, const GLfloat* values)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttrib1fv(ctx, indx, values);
+}
+
+void glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttrib2f(ctx, indx, x, y);
+}
+
+void glVertexAttrib2fv(GLuint indx, const GLfloat* values)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttrib2fv(ctx, indx, values);
+}
+
+void glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttrib3f(ctx, indx, x, y, z);
+}
+
+void glVertexAttrib3fv(GLuint indx, const GLfloat* values)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttrib3fv(ctx, indx, values);
+}
+
+void glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttrib4f(ctx, indx, x, y, z, w);
+}
+
+void glVertexAttrib4fv(GLuint indx, const GLfloat* values)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttrib4fv(ctx, indx, values);
+}
+
+void glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttribPointer(ctx, indx, size, type, normalized, stride, ptr);
+}
+
+void glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
+{
+	GET_CONTEXT;
+	ctx->glViewport(ctx, x, y, width, height);
+}
+
+void glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image)
+{
+	GET_CONTEXT;
+	ctx->glEGLImageTargetTexture2DOES(ctx, target, image);
+}
+
+void glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image)
+{
+	GET_CONTEXT;
+	ctx->glEGLImageTargetRenderbufferStorageOES(ctx, target, image);
+}
+
+void glGetProgramBinaryOES(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, GLvoid* binary)
+{
+	GET_CONTEXT;
+	ctx->glGetProgramBinaryOES(ctx, program, bufSize, length, binaryFormat, binary);
+}
+
+void glProgramBinaryOES(GLuint program, GLenum binaryFormat, const GLvoid* binary, GLint length)
+{
+	GET_CONTEXT;
+	ctx->glProgramBinaryOES(ctx, program, binaryFormat, binary, length);
+}
+
+void* glMapBufferOES(GLenum target, GLenum access)
+{
+	GET_CONTEXT;
+	return ctx->glMapBufferOES(ctx, target, access);
+}
+
+GLboolean glUnmapBufferOES(GLenum target)
+{
+	GET_CONTEXT;
+	return ctx->glUnmapBufferOES(ctx, target);
+}
+
+void glTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
+{
+	GET_CONTEXT;
+	ctx->glTexImage3DOES(ctx, target, level, internalformat, width, height, depth, border, format, type, pixels);
+}
+
+void glTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels)
+{
+	GET_CONTEXT;
+	ctx->glTexSubImage3DOES(ctx, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
+}
+
+void glCopyTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+	GET_CONTEXT;
+	ctx->glCopyTexSubImage3DOES(ctx, target, level, xoffset, yoffset, zoffset, x, y, width, height);
+}
+
+void glCompressedTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data)
+{
+	GET_CONTEXT;
+	 if(imageSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glCompressedTexImage3DOES(ctx, target, level, internalformat, width, height, depth, border, imageSize, data);
+}
+
+void glCompressedTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data)
+{
+	GET_CONTEXT;
+	 if(imageSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glCompressedTexSubImage3DOES(ctx, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
+}
+
+void glFramebufferTexture3DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
+{
+	GET_CONTEXT;
+	ctx->glFramebufferTexture3DOES(ctx, target, attachment, textarget, texture, level, zoffset);
+}
+
+void glBindVertexArrayOES(GLuint array)
+{
+	GET_CONTEXT;
+	ctx->glBindVertexArrayOES(ctx, array);
+}
+
+void glDeleteVertexArraysOES(GLsizei n, const GLuint* arrays)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glDeleteVertexArraysOES(ctx, n, arrays);
+}
+
+void glGenVertexArraysOES(GLsizei n, GLuint* arrays)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGenVertexArraysOES(ctx, n, arrays);
+}
+
+GLboolean glIsVertexArrayOES(GLuint array)
+{
+	GET_CONTEXT;
+	return ctx->glIsVertexArrayOES(ctx, array);
+}
+
+void glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum* attachments)
+{
+	GET_CONTEXT;
+	ctx->glDiscardFramebufferEXT(ctx, target, numAttachments, attachments);
+}
+
+void glMultiDrawArraysEXT(GLenum mode, const GLint* first, const GLsizei* count, GLsizei primcount)
+{
+	GET_CONTEXT;
+	ctx->glMultiDrawArraysEXT(ctx, mode, first, count, primcount);
+}
+
+void glMultiDrawElementsEXT(GLenum mode, const GLsizei* count, GLenum type, const GLvoid* const* indices, GLsizei primcount)
+{
+	GET_CONTEXT;
+	ctx->glMultiDrawElementsEXT(ctx, mode, count, type, indices, primcount);
+}
+
+void glGetPerfMonitorGroupsAMD(GLint* numGroups, GLsizei groupsSize, GLuint* groups)
+{
+	GET_CONTEXT;
+	ctx->glGetPerfMonitorGroupsAMD(ctx, numGroups, groupsSize, groups);
+}
+
+void glGetPerfMonitorCountersAMD(GLuint group, GLint* numCounters, GLint* maxActiveCounters, GLsizei counterSize, GLuint* counters)
+{
+	GET_CONTEXT;
+	ctx->glGetPerfMonitorCountersAMD(ctx, group, numCounters, maxActiveCounters, counterSize, counters);
+}
+
+void glGetPerfMonitorGroupStringAMD(GLuint group, GLsizei bufSize, GLsizei* length, GLchar* groupString)
+{
+	GET_CONTEXT;
+	ctx->glGetPerfMonitorGroupStringAMD(ctx, group, bufSize, length, groupString);
+}
+
+void glGetPerfMonitorCounterStringAMD(GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, GLchar* counterString)
+{
+	GET_CONTEXT;
+	ctx->glGetPerfMonitorCounterStringAMD(ctx, group, counter, bufSize, length, counterString);
+}
+
+void glGetPerfMonitorCounterInfoAMD(GLuint group, GLuint counter, GLenum pname, GLvoid* data)
+{
+	GET_CONTEXT;
+	ctx->glGetPerfMonitorCounterInfoAMD(ctx, group, counter, pname, data);
+}
+
+void glGenPerfMonitorsAMD(GLsizei n, GLuint* monitors)
+{
+	GET_CONTEXT;
+	ctx->glGenPerfMonitorsAMD(ctx, n, monitors);
+}
+
+void glDeletePerfMonitorsAMD(GLsizei n, GLuint* monitors)
+{
+	GET_CONTEXT;
+	ctx->glDeletePerfMonitorsAMD(ctx, n, monitors);
+}
+
+void glSelectPerfMonitorCountersAMD(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* countersList)
+{
+	GET_CONTEXT;
+	ctx->glSelectPerfMonitorCountersAMD(ctx, monitor, enable, group, numCounters, countersList);
+}
+
+void glBeginPerfMonitorAMD(GLuint monitor)
+{
+	GET_CONTEXT;
+	ctx->glBeginPerfMonitorAMD(ctx, monitor);
+}
+
+void glEndPerfMonitorAMD(GLuint monitor)
+{
+	GET_CONTEXT;
+	ctx->glEndPerfMonitorAMD(ctx, monitor);
+}
+
+void glGetPerfMonitorCounterDataAMD(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint* bytesWritten)
+{
+	GET_CONTEXT;
+	ctx->glGetPerfMonitorCounterDataAMD(ctx, monitor, pname, dataSize, data, bytesWritten);
+}
+
+void glRenderbufferStorageMultisampleIMG(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
+{
+	GET_CONTEXT;
+	ctx->glRenderbufferStorageMultisampleIMG(ctx, target, samples, internalformat, width, height);
+}
+
+void glFramebufferTexture2DMultisampleIMG(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples)
+{
+	GET_CONTEXT;
+	ctx->glFramebufferTexture2DMultisampleIMG(ctx, target, attachment, textarget, texture, level, samples);
+}
+
+void glDeleteFencesNV(GLsizei n, const GLuint* fences)
+{
+	GET_CONTEXT;
+	ctx->glDeleteFencesNV(ctx, n, fences);
+}
+
+void glGenFencesNV(GLsizei n, GLuint* fences)
+{
+	GET_CONTEXT;
+	ctx->glGenFencesNV(ctx, n, fences);
+}
+
+GLboolean glIsFenceNV(GLuint fence)
+{
+	GET_CONTEXT;
+	return ctx->glIsFenceNV(ctx, fence);
+}
+
+GLboolean glTestFenceNV(GLuint fence)
+{
+	GET_CONTEXT;
+	return ctx->glTestFenceNV(ctx, fence);
+}
+
+void glGetFenceivNV(GLuint fence, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetFenceivNV(ctx, fence, pname, params);
+}
+
+void glFinishFenceNV(GLuint fence)
+{
+	GET_CONTEXT;
+	ctx->glFinishFenceNV(ctx, fence);
+}
+
+void glSetFenceNV(GLuint fence, GLenum condition)
+{
+	GET_CONTEXT;
+	ctx->glSetFenceNV(ctx, fence, condition);
+}
+
+void glCoverageMaskNV(GLboolean mask)
+{
+	GET_CONTEXT;
+	ctx->glCoverageMaskNV(ctx, mask);
+}
+
+void glCoverageOperationNV(GLenum operation)
+{
+	GET_CONTEXT;
+	ctx->glCoverageOperationNV(ctx, operation);
+}
+
+void glGetDriverControlsQCOM(GLint* num, GLsizei size, GLuint* driverControls)
+{
+	GET_CONTEXT;
+	ctx->glGetDriverControlsQCOM(ctx, num, size, driverControls);
+}
+
+void glGetDriverControlStringQCOM(GLuint driverControl, GLsizei bufSize, GLsizei* length, GLchar* driverControlString)
+{
+	GET_CONTEXT;
+	ctx->glGetDriverControlStringQCOM(ctx, driverControl, bufSize, length, driverControlString);
+}
+
+void glEnableDriverControlQCOM(GLuint driverControl)
+{
+	GET_CONTEXT;
+	ctx->glEnableDriverControlQCOM(ctx, driverControl);
+}
+
+void glDisableDriverControlQCOM(GLuint driverControl)
+{
+	GET_CONTEXT;
+	ctx->glDisableDriverControlQCOM(ctx, driverControl);
+}
+
+void glExtGetTexturesQCOM(GLuint* textures, GLint maxTextures, GLint* numTextures)
+{
+	GET_CONTEXT;
+	ctx->glExtGetTexturesQCOM(ctx, textures, maxTextures, numTextures);
+}
+
+void glExtGetBuffersQCOM(GLuint* buffers, GLint maxBuffers, GLint* numBuffers)
+{
+	GET_CONTEXT;
+	ctx->glExtGetBuffersQCOM(ctx, buffers, maxBuffers, numBuffers);
+}
+
+void glExtGetRenderbuffersQCOM(GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers)
+{
+	GET_CONTEXT;
+	ctx->glExtGetRenderbuffersQCOM(ctx, renderbuffers, maxRenderbuffers, numRenderbuffers);
+}
+
+void glExtGetFramebuffersQCOM(GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers)
+{
+	GET_CONTEXT;
+	ctx->glExtGetFramebuffersQCOM(ctx, framebuffers, maxFramebuffers, numFramebuffers);
+}
+
+void glExtGetTexLevelParameterivQCOM(GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glExtGetTexLevelParameterivQCOM(ctx, texture, face, level, pname, params);
+}
+
+void glExtTexObjectStateOverrideiQCOM(GLenum target, GLenum pname, GLint param)
+{
+	GET_CONTEXT;
+	ctx->glExtTexObjectStateOverrideiQCOM(ctx, target, pname, param);
+}
+
+void glExtGetTexSubImageQCOM(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid* texels)
+{
+	GET_CONTEXT;
+	ctx->glExtGetTexSubImageQCOM(ctx, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, texels);
+}
+
+void glExtGetBufferPointervQCOM(GLenum target, GLvoidptr* params)
+{
+	GET_CONTEXT;
+	ctx->glExtGetBufferPointervQCOM(ctx, target, params);
+}
+
+void glExtGetShadersQCOM(GLuint* shaders, GLint maxShaders, GLint* numShaders)
+{
+	GET_CONTEXT;
+	ctx->glExtGetShadersQCOM(ctx, shaders, maxShaders, numShaders);
+}
+
+void glExtGetProgramsQCOM(GLuint* programs, GLint maxPrograms, GLint* numPrograms)
+{
+	GET_CONTEXT;
+	ctx->glExtGetProgramsQCOM(ctx, programs, maxPrograms, numPrograms);
+}
+
+GLboolean glExtIsProgramBinaryQCOM(GLuint program)
+{
+	GET_CONTEXT;
+	return ctx->glExtIsProgramBinaryQCOM(ctx, program);
+}
+
+void glExtGetProgramBinarySourceQCOM(GLuint program, GLenum shadertype, GLchar* source, GLint* length)
+{
+	GET_CONTEXT;
+	ctx->glExtGetProgramBinarySourceQCOM(ctx, program, shadertype, source, length);
+}
+
+void glStartTilingQCOM(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask)
+{
+	GET_CONTEXT;
+	ctx->glStartTilingQCOM(ctx, x, y, width, height, preserveMask);
+}
+
+void glEndTilingQCOM(GLbitfield preserveMask)
+{
+	GET_CONTEXT;
+	ctx->glEndTilingQCOM(ctx, preserveMask);
+}
+
+void glVertexAttribPointerData(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, void* data, GLuint datalen)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttribPointerData(ctx, indx, size, type, normalized, stride, data, datalen);
+}
+
+void glVertexAttribPointerOffset(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttribPointerOffset(ctx, indx, size, type, normalized, stride, offset);
+}
+
+void glDrawElementsOffset(GLenum mode, GLsizei count, GLenum type, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glDrawElementsOffset(ctx, mode, count, type, offset);
+}
+
+void glDrawElementsData(GLenum mode, GLsizei count, GLenum type, void* data, GLuint datalen)
+{
+	GET_CONTEXT;
+	ctx->glDrawElementsData(ctx, mode, count, type, data, datalen);
+}
+
+void glGetCompressedTextureFormats(int count, GLint* formats)
+{
+	GET_CONTEXT;
+	ctx->glGetCompressedTextureFormats(ctx, count, formats);
+}
+
+void glShaderString(GLuint shader, const GLchar* string, GLsizei len)
+{
+	GET_CONTEXT;
+	ctx->glShaderString(ctx, shader, string, len);
+}
+
+int glFinishRoundTrip()
+{
+	GET_CONTEXT;
+	return ctx->glFinishRoundTrip(ctx);
+}
+
+void glGenVertexArrays(GLsizei n, GLuint* arrays)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGenVertexArrays(ctx, n, arrays);
+}
+
+void glBindVertexArray(GLuint array)
+{
+	GET_CONTEXT;
+	ctx->glBindVertexArray(ctx, array);
+}
+
+void glDeleteVertexArrays(GLsizei n, const GLuint* arrays)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glDeleteVertexArrays(ctx, n, arrays);
+}
+
+GLboolean glIsVertexArray(GLuint array)
+{
+	GET_CONTEXT;
+	return ctx->glIsVertexArray(ctx, array);
+}
+
+void* glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
+{
+	GET_CONTEXT;
+	return ctx->glMapBufferRange(ctx, target, offset, length, access);
+}
+
+GLboolean glUnmapBuffer(GLenum target)
+{
+	GET_CONTEXT;
+	return ctx->glUnmapBuffer(ctx, target);
+}
+
+void glFlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length)
+{
+	GET_CONTEXT;
+	ctx->glFlushMappedBufferRange(ctx, target, offset, length);
+}
+
+void glMapBufferRangeAEMU(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* mapped)
+{
+	GET_CONTEXT;
+	ctx->glMapBufferRangeAEMU(ctx, target, offset, length, access, mapped);
+}
+
+void glUnmapBufferAEMU(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* guest_buffer, GLboolean* out_res)
+{
+	GET_CONTEXT;
+	ctx->glUnmapBufferAEMU(ctx, target, offset, length, access, guest_buffer, out_res);
+}
+
+void glFlushMappedBufferRangeAEMU(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* guest_buffer)
+{
+	GET_CONTEXT;
+	ctx->glFlushMappedBufferRangeAEMU(ctx, target, offset, length, access, guest_buffer);
+}
+
+void glReadPixelsOffsetAEMU(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glReadPixelsOffsetAEMU(ctx, x, y, width, height, format, type, offset);
+}
+
+void glCompressedTexImage2DOffsetAEMU(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glCompressedTexImage2DOffsetAEMU(ctx, target, level, internalformat, width, height, border, imageSize, offset);
+}
+
+void glCompressedTexSubImage2DOffsetAEMU(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glCompressedTexSubImage2DOffsetAEMU(ctx, target, level, xoffset, yoffset, width, height, format, imageSize, offset);
+}
+
+void glTexImage2DOffsetAEMU(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glTexImage2DOffsetAEMU(ctx, target, level, internalformat, width, height, border, format, type, offset);
+}
+
+void glTexSubImage2DOffsetAEMU(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glTexSubImage2DOffsetAEMU(ctx, target, level, xoffset, yoffset, width, height, format, type, offset);
+}
+
+void glBindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
+{
+	GET_CONTEXT;
+	ctx->glBindBufferRange(ctx, target, index, buffer, offset, size);
+}
+
+void glBindBufferBase(GLenum target, GLuint index, GLuint buffer)
+{
+	GET_CONTEXT;
+	ctx->glBindBufferBase(ctx, target, index, buffer);
+}
+
+void glCopyBufferSubData(GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size)
+{
+	GET_CONTEXT;
+	ctx->glCopyBufferSubData(ctx, readtarget, writetarget, readoffset, writeoffset, size);
+}
+
+void glClearBufferiv(GLenum buffer, GLint drawBuffer, const GLint* value)
+{
+	GET_CONTEXT;
+	ctx->glClearBufferiv(ctx, buffer, drawBuffer, value);
+}
+
+void glClearBufferuiv(GLenum buffer, GLint drawBuffer, const GLuint* value)
+{
+	GET_CONTEXT;
+	ctx->glClearBufferuiv(ctx, buffer, drawBuffer, value);
+}
+
+void glClearBufferfv(GLenum buffer, GLint drawBuffer, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glClearBufferfv(ctx, buffer, drawBuffer, value);
+}
+
+void glClearBufferfi(GLenum buffer, GLint drawBuffer, GLfloat depth, GLint stencil)
+{
+	GET_CONTEXT;
+	ctx->glClearBufferfi(ctx, buffer, drawBuffer, depth, stencil);
+}
+
+void glGetBufferParameteri64v(GLenum target, GLenum value, GLint64* data)
+{
+	GET_CONTEXT;
+	ctx->glGetBufferParameteri64v(ctx, target, value, data);
+}
+
+void glGetBufferPointerv(GLenum target, GLenum pname, GLvoid** params)
+{
+	GET_CONTEXT;
+	ctx->glGetBufferPointerv(ctx, target, pname, params);
+}
+
+void glUniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding)
+{
+	GET_CONTEXT;
+	ctx->glUniformBlockBinding(ctx, program, uniformBlockIndex, uniformBlockBinding);
+}
+
+GLuint glGetUniformBlockIndex(GLuint program, const GLchar* uniformBlockName)
+{
+	GET_CONTEXT;
+	return ctx->glGetUniformBlockIndex(ctx, program, uniformBlockName);
+}
+
+void glGetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar** uniformNames, GLuint* uniformIndices)
+{
+	GET_CONTEXT;
+	ctx->glGetUniformIndices(ctx, program, uniformCount, uniformNames, uniformIndices);
+}
+
+void glGetUniformIndicesAEMU(GLuint program, GLsizei uniformCount, const GLchar* packedUniformNames, GLsizei packedLen, GLuint* uniformIndices)
+{
+	GET_CONTEXT;
+	ctx->glGetUniformIndicesAEMU(ctx, program, uniformCount, packedUniformNames, packedLen, uniformIndices);
+}
+
+void glGetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetActiveUniformBlockiv(ctx, program, uniformBlockIndex, pname, params);
+}
+
+void glGetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName)
+{
+	GET_CONTEXT;
+	 if(bufSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGetActiveUniformBlockName(ctx, program, uniformBlockIndex, bufSize, length, uniformBlockName);
+}
+
+void glUniform1ui(GLint location, GLuint v0)
+{
+	GET_CONTEXT;
+	ctx->glUniform1ui(ctx, location, v0);
+}
+
+void glUniform2ui(GLint location, GLuint v0, GLuint v1)
+{
+	GET_CONTEXT;
+	ctx->glUniform2ui(ctx, location, v0, v1);
+}
+
+void glUniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2)
+{
+	GET_CONTEXT;
+	ctx->glUniform3ui(ctx, location, v0, v1, v2);
+}
+
+void glUniform4ui(GLint location, GLint v0, GLuint v1, GLuint v2, GLuint v3)
+{
+	GET_CONTEXT;
+	ctx->glUniform4ui(ctx, location, v0, v1, v2, v3);
+}
+
+void glUniform1uiv(GLint location, GLsizei count, const GLuint* value)
+{
+	GET_CONTEXT;
+	ctx->glUniform1uiv(ctx, location, count, value);
+}
+
+void glUniform2uiv(GLint location, GLsizei count, const GLuint* value)
+{
+	GET_CONTEXT;
+	ctx->glUniform2uiv(ctx, location, count, value);
+}
+
+void glUniform3uiv(GLint location, GLsizei count, const GLuint* value)
+{
+	GET_CONTEXT;
+	ctx->glUniform3uiv(ctx, location, count, value);
+}
+
+void glUniform4uiv(GLint location, GLsizei count, const GLuint* value)
+{
+	GET_CONTEXT;
+	ctx->glUniform4uiv(ctx, location, count, value);
+}
+
+void glUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glUniformMatrix2x3fv(ctx, location, count, transpose, value);
+}
+
+void glUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glUniformMatrix3x2fv(ctx, location, count, transpose, value);
+}
+
+void glUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glUniformMatrix2x4fv(ctx, location, count, transpose, value);
+}
+
+void glUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glUniformMatrix4x2fv(ctx, location, count, transpose, value);
+}
+
+void glUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glUniformMatrix3x4fv(ctx, location, count, transpose, value);
+}
+
+void glUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glUniformMatrix4x3fv(ctx, location, count, transpose, value);
+}
+
+void glGetUniformuiv(GLuint program, GLint location, GLuint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetUniformuiv(ctx, program, location, params);
+}
+
+void glGetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetActiveUniformsiv(ctx, program, uniformCount, uniformIndices, pname, params);
+}
+
+void glVertexAttribI4i(GLuint index, GLint v0, GLint v1, GLint v2, GLint v3)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttribI4i(ctx, index, v0, v1, v2, v3);
+}
+
+void glVertexAttribI4ui(GLuint index, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttribI4ui(ctx, index, v0, v1, v2, v3);
+}
+
+void glVertexAttribI4iv(GLuint index, const GLint* v)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttribI4iv(ctx, index, v);
+}
+
+void glVertexAttribI4uiv(GLuint index, const GLuint* v)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttribI4uiv(ctx, index, v);
+}
+
+void glVertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttribIPointer(ctx, index, size, type, stride, pointer);
+}
+
+void glVertexAttribIPointerOffsetAEMU(GLuint index, GLint size, GLenum type, GLsizei stride, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttribIPointerOffsetAEMU(ctx, index, size, type, stride, offset);
+}
+
+void glVertexAttribIPointerDataAEMU(GLuint index, GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttribIPointerDataAEMU(ctx, index, size, type, stride, data, datalen);
+}
+
+void glGetVertexAttribIiv(GLuint index, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetVertexAttribIiv(ctx, index, pname, params);
+}
+
+void glGetVertexAttribIuiv(GLuint index, GLenum pname, GLuint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetVertexAttribIuiv(ctx, index, pname, params);
+}
+
+void glVertexAttribDivisor(GLuint index, GLuint divisor)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttribDivisor(ctx, index, divisor);
+}
+
+void glDrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
+{
+	GET_CONTEXT;
+	ctx->glDrawArraysInstanced(ctx, mode, first, count, primcount);
+}
+
+void glDrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount)
+{
+	GET_CONTEXT;
+	ctx->glDrawElementsInstanced(ctx, mode, count, type, indices, primcount);
+}
+
+void glDrawElementsInstancedDataAEMU(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount, GLsizei datalen)
+{
+	GET_CONTEXT;
+	ctx->glDrawElementsInstancedDataAEMU(ctx, mode, count, type, indices, primcount, datalen);
+}
+
+void glDrawElementsInstancedOffsetAEMU(GLenum mode, GLsizei count, GLenum type, GLuint offset, GLsizei primcount)
+{
+	GET_CONTEXT;
+	ctx->glDrawElementsInstancedOffsetAEMU(ctx, mode, count, type, offset, primcount);
+}
+
+void glDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices)
+{
+	GET_CONTEXT;
+	ctx->glDrawRangeElements(ctx, mode, start, end, count, type, indices);
+}
+
+void glDrawRangeElementsDataAEMU(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices, GLsizei datalen)
+{
+	GET_CONTEXT;
+	ctx->glDrawRangeElementsDataAEMU(ctx, mode, start, end, count, type, indices, datalen);
+}
+
+void glDrawRangeElementsOffsetAEMU(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glDrawRangeElementsOffsetAEMU(ctx, mode, start, end, count, type, offset);
+}
+
+GLsync glFenceSync(GLenum condition, GLbitfield flags)
+{
+	GET_CONTEXT;
+	return ctx->glFenceSync(ctx, condition, flags);
+}
+
+GLenum glClientWaitSync(GLsync wait_on, GLbitfield flags, GLuint64 timeout)
+{
+	GET_CONTEXT;
+	return ctx->glClientWaitSync(ctx, wait_on, flags, timeout);
+}
+
+void glWaitSync(GLsync wait_on, GLbitfield flags, GLuint64 timeout)
+{
+	GET_CONTEXT;
+	ctx->glWaitSync(ctx, wait_on, flags, timeout);
+}
+
+void glDeleteSync(GLsync to_delete)
+{
+	GET_CONTEXT;
+	ctx->glDeleteSync(ctx, to_delete);
+}
+
+GLboolean glIsSync(GLsync sync)
+{
+	GET_CONTEXT;
+	return ctx->glIsSync(ctx, sync);
+}
+
+void glGetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values)
+{
+	GET_CONTEXT;
+	ctx->glGetSynciv(ctx, sync, pname, bufSize, length, values);
+}
+
+uint64_t glFenceSyncAEMU(GLenum condition, GLbitfield flags)
+{
+	GET_CONTEXT;
+	return ctx->glFenceSyncAEMU(ctx, condition, flags);
+}
+
+GLenum glClientWaitSyncAEMU(uint64_t wait_on, GLbitfield flags, GLuint64 timeout)
+{
+	GET_CONTEXT;
+	return ctx->glClientWaitSyncAEMU(ctx, wait_on, flags, timeout);
+}
+
+void glWaitSyncAEMU(uint64_t wait_on, GLbitfield flags, GLuint64 timeout)
+{
+	GET_CONTEXT;
+	ctx->glWaitSyncAEMU(ctx, wait_on, flags, timeout);
+}
+
+void glDeleteSyncAEMU(uint64_t to_delete)
+{
+	GET_CONTEXT;
+	ctx->glDeleteSyncAEMU(ctx, to_delete);
+}
+
+GLboolean glIsSyncAEMU(uint64_t sync)
+{
+	GET_CONTEXT;
+	return ctx->glIsSyncAEMU(ctx, sync);
+}
+
+void glGetSyncivAEMU(uint64_t sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values)
+{
+	GET_CONTEXT;
+	 if(bufSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGetSyncivAEMU(ctx, sync, pname, bufSize, length, values);
+}
+
+void glDrawBuffers(GLsizei n, const GLenum* bufs)
+{
+	GET_CONTEXT;
+	ctx->glDrawBuffers(ctx, n, bufs);
+}
+
+void glReadBuffer(GLenum src)
+{
+	GET_CONTEXT;
+	ctx->glReadBuffer(ctx, src);
+}
+
+void glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
+{
+	GET_CONTEXT;
+	ctx->glBlitFramebuffer(ctx, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
+}
+
+void glInvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments)
+{
+	GET_CONTEXT;
+	ctx->glInvalidateFramebuffer(ctx, target, numAttachments, attachments);
+}
+
+void glInvalidateSubFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+	GET_CONTEXT;
+	ctx->glInvalidateSubFramebuffer(ctx, target, numAttachments, attachments, x, y, width, height);
+}
+
+void glFramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
+{
+	GET_CONTEXT;
+	ctx->glFramebufferTextureLayer(ctx, target, attachment, texture, level, layer);
+}
+
+void glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
+{
+	GET_CONTEXT;
+	ctx->glRenderbufferStorageMultisample(ctx, target, samples, internalformat, width, height);
+}
+
+void glTexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
+{
+	GET_CONTEXT;
+	ctx->glTexStorage2D(ctx, target, levels, internalformat, width, height);
+}
+
+void glGetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetInternalformativ(ctx, target, internalformat, pname, bufSize, params);
+}
+
+void glBeginTransformFeedback(GLenum primitiveMode)
+{
+	GET_CONTEXT;
+	ctx->glBeginTransformFeedback(ctx, primitiveMode);
+}
+
+void glEndTransformFeedback()
+{
+	GET_CONTEXT;
+	ctx->glEndTransformFeedback(ctx);
+}
+
+void glGenTransformFeedbacks(GLsizei n, GLuint* ids)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGenTransformFeedbacks(ctx, n, ids);
+}
+
+void glDeleteTransformFeedbacks(GLsizei n, const GLuint* ids)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glDeleteTransformFeedbacks(ctx, n, ids);
+}
+
+void glBindTransformFeedback(GLenum target, GLuint id)
+{
+	GET_CONTEXT;
+	ctx->glBindTransformFeedback(ctx, target, id);
+}
+
+void glPauseTransformFeedback()
+{
+	GET_CONTEXT;
+	ctx->glPauseTransformFeedback(ctx);
+}
+
+void glResumeTransformFeedback()
+{
+	GET_CONTEXT;
+	ctx->glResumeTransformFeedback(ctx);
+}
+
+GLboolean glIsTransformFeedback(GLuint id)
+{
+	GET_CONTEXT;
+	return ctx->glIsTransformFeedback(ctx, id);
+}
+
+void glTransformFeedbackVaryings(GLuint program, GLsizei count, const char** varyings, GLenum bufferMode)
+{
+	GET_CONTEXT;
+	ctx->glTransformFeedbackVaryings(ctx, program, count, varyings, bufferMode);
+}
+
+void glTransformFeedbackVaryingsAEMU(GLuint program, GLsizei count, const char* packedVaryings, GLuint packedVaryingsLen, GLenum bufferMode)
+{
+	GET_CONTEXT;
+	ctx->glTransformFeedbackVaryingsAEMU(ctx, program, count, packedVaryings, packedVaryingsLen, bufferMode);
+}
+
+void glGetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, char* name)
+{
+	GET_CONTEXT;
+	 if(bufSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGetTransformFeedbackVarying(ctx, program, index, bufSize, length, size, type, name);
+}
+
+void glGenSamplers(GLsizei n, GLuint* samplers)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGenSamplers(ctx, n, samplers);
+}
+
+void glDeleteSamplers(GLsizei n, const GLuint* samplers)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glDeleteSamplers(ctx, n, samplers);
+}
+
+void glBindSampler(GLuint unit, GLuint sampler)
+{
+	GET_CONTEXT;
+	ctx->glBindSampler(ctx, unit, sampler);
+}
+
+void glSamplerParameterf(GLuint sampler, GLenum pname, GLfloat param)
+{
+	GET_CONTEXT;
+	ctx->glSamplerParameterf(ctx, sampler, pname, param);
+}
+
+void glSamplerParameteri(GLuint sampler, GLenum pname, GLint param)
+{
+	GET_CONTEXT;
+	ctx->glSamplerParameteri(ctx, sampler, pname, param);
+}
+
+void glSamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat* params)
+{
+	GET_CONTEXT;
+	ctx->glSamplerParameterfv(ctx, sampler, pname, params);
+}
+
+void glSamplerParameteriv(GLuint sampler, GLenum pname, const GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glSamplerParameteriv(ctx, sampler, pname, params);
+}
+
+void glGetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat* params)
+{
+	GET_CONTEXT;
+	ctx->glGetSamplerParameterfv(ctx, sampler, pname, params);
+}
+
+void glGetSamplerParameteriv(GLuint sampler, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetSamplerParameteriv(ctx, sampler, pname, params);
+}
+
+GLboolean glIsSampler(GLuint sampler)
+{
+	GET_CONTEXT;
+	return ctx->glIsSampler(ctx, sampler);
+}
+
+void glGenQueries(GLsizei n, GLuint* queries)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGenQueries(ctx, n, queries);
+}
+
+void glDeleteQueries(GLsizei n, const GLuint* queries)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glDeleteQueries(ctx, n, queries);
+}
+
+void glBeginQuery(GLenum target, GLuint query)
+{
+	GET_CONTEXT;
+	ctx->glBeginQuery(ctx, target, query);
+}
+
+void glEndQuery(GLenum target)
+{
+	GET_CONTEXT;
+	ctx->glEndQuery(ctx, target);
+}
+
+void glGetQueryiv(GLenum target, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetQueryiv(ctx, target, pname, params);
+}
+
+void glGetQueryObjectuiv(GLuint query, GLenum pname, GLuint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetQueryObjectuiv(ctx, query, pname, params);
+}
+
+GLboolean glIsQuery(GLuint query)
+{
+	GET_CONTEXT;
+	return ctx->glIsQuery(ctx, query);
+}
+
+void glProgramParameteri(GLuint program, GLenum pname, GLint value)
+{
+	GET_CONTEXT;
+	ctx->glProgramParameteri(ctx, program, pname, value);
+}
+
+void glProgramBinary(GLuint program, GLenum binaryFormat, const void* binary, GLsizei length)
+{
+	GET_CONTEXT;
+	ctx->glProgramBinary(ctx, program, binaryFormat, binary, length);
+}
+
+void glGetProgramBinary(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, void* binary)
+{
+	GET_CONTEXT;
+	 if(bufSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGetProgramBinary(ctx, program, bufSize, length, binaryFormat, binary);
+}
+
+GLint glGetFragDataLocation(GLuint program, const char* name)
+{
+	GET_CONTEXT;
+	return ctx->glGetFragDataLocation(ctx, program, name);
+}
+
+void glGetInteger64v(GLenum pname, GLint64* data)
+{
+	GET_CONTEXT;
+	ctx->glGetInteger64v(ctx, pname, data);
+}
+
+void glGetIntegeri_v(GLenum target, GLuint index, GLint* data)
+{
+	GET_CONTEXT;
+	ctx->glGetIntegeri_v(ctx, target, index, data);
+}
+
+void glGetInteger64i_v(GLenum target, GLuint index, GLint64* data)
+{
+	GET_CONTEXT;
+	ctx->glGetInteger64i_v(ctx, target, index, data);
+}
+
+void glTexImage3D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* data)
+{
+	GET_CONTEXT;
+	ctx->glTexImage3D(ctx, target, level, internalFormat, width, height, depth, border, format, type, data);
+}
+
+void glTexImage3DOffsetAEMU(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glTexImage3DOffsetAEMU(ctx, target, level, internalFormat, width, height, depth, border, format, type, offset);
+}
+
+void glTexStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
+{
+	GET_CONTEXT;
+	ctx->glTexStorage3D(ctx, target, levels, internalformat, width, height, depth);
+}
+
+void glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* data)
+{
+	GET_CONTEXT;
+	ctx->glTexSubImage3D(ctx, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data);
+}
+
+void glTexSubImage3DOffsetAEMU(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glTexSubImage3DOffsetAEMU(ctx, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, offset);
+}
+
+void glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data)
+{
+	GET_CONTEXT;
+	 if(imageSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glCompressedTexImage3D(ctx, target, level, internalformat, width, height, depth, border, imageSize, data);
+}
+
+void glCompressedTexImage3DOffsetAEMU(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glCompressedTexImage3DOffsetAEMU(ctx, target, level, internalformat, width, height, depth, border, imageSize, offset);
+}
+
+void glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data)
+{
+	GET_CONTEXT;
+	 if(imageSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glCompressedTexSubImage3D(ctx, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
+}
+
+void glCompressedTexSubImage3DOffsetAEMU(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, GLuint data)
+{
+	GET_CONTEXT;
+	ctx->glCompressedTexSubImage3DOffsetAEMU(ctx, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
+}
+
+void glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+	GET_CONTEXT;
+	ctx->glCopyTexSubImage3D(ctx, target, level, xoffset, yoffset, zoffset, x, y, width, height);
+}
+
+const GLubyte* glGetStringi(GLenum name, GLuint index)
+{
+	GET_CONTEXT;
+	return ctx->glGetStringi(ctx, name, index);
+}
+
+void glGetBooleani_v(GLenum target, GLuint index, GLboolean* data)
+{
+	GET_CONTEXT;
+	ctx->glGetBooleani_v(ctx, target, index, data);
+}
+
+void glMemoryBarrier(GLbitfield barriers)
+{
+	GET_CONTEXT;
+	ctx->glMemoryBarrier(ctx, barriers);
+}
+
+void glMemoryBarrierByRegion(GLbitfield barriers)
+{
+	GET_CONTEXT;
+	ctx->glMemoryBarrierByRegion(ctx, barriers);
+}
+
+void glGenProgramPipelines(GLsizei n, GLuint* pipelines)
+{
+	GET_CONTEXT;
+	ctx->glGenProgramPipelines(ctx, n, pipelines);
+}
+
+void glDeleteProgramPipelines(GLsizei n, const GLuint* pipelines)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glDeleteProgramPipelines(ctx, n, pipelines);
+}
+
+void glBindProgramPipeline(GLuint pipeline)
+{
+	GET_CONTEXT;
+	ctx->glBindProgramPipeline(ctx, pipeline);
+}
+
+void glGetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetProgramPipelineiv(ctx, pipeline, pname, params);
+}
+
+void glGetProgramPipelineInfoLog(GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar* infoLog)
+{
+	GET_CONTEXT;
+	 if(bufSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGetProgramPipelineInfoLog(ctx, pipeline, bufSize, length, infoLog);
+}
+
+void glValidateProgramPipeline(GLuint pipeline)
+{
+	GET_CONTEXT;
+	ctx->glValidateProgramPipeline(ctx, pipeline);
+}
+
+GLboolean glIsProgramPipeline(GLuint pipeline)
+{
+	GET_CONTEXT;
+	return ctx->glIsProgramPipeline(ctx, pipeline);
+}
+
+void glUseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program)
+{
+	GET_CONTEXT;
+	ctx->glUseProgramStages(ctx, pipeline, stages, program);
+}
+
+void glActiveShaderProgram(GLuint pipeline, GLuint program)
+{
+	GET_CONTEXT;
+	ctx->glActiveShaderProgram(ctx, pipeline, program);
+}
+
+GLuint glCreateShaderProgramv(GLenum type, GLsizei count, const char** strings)
+{
+	GET_CONTEXT;
+	return ctx->glCreateShaderProgramv(ctx, type, count, strings);
+}
+
+GLuint glCreateShaderProgramvAEMU(GLenum type, GLsizei count, const char* packedStrings, GLuint packedLen)
+{
+	GET_CONTEXT;
+	return ctx->glCreateShaderProgramvAEMU(ctx, type, count, packedStrings, packedLen);
+}
+
+void glProgramUniform1f(GLuint program, GLint location, GLfloat v0)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform1f(ctx, program, location, v0);
+}
+
+void glProgramUniform2f(GLuint program, GLint location, GLfloat v0, GLfloat v1)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform2f(ctx, program, location, v0, v1);
+}
+
+void glProgramUniform3f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform3f(ctx, program, location, v0, v1, v2);
+}
+
+void glProgramUniform4f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform4f(ctx, program, location, v0, v1, v2, v3);
+}
+
+void glProgramUniform1i(GLuint program, GLint location, GLint v0)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform1i(ctx, program, location, v0);
+}
+
+void glProgramUniform2i(GLuint program, GLint location, GLint v0, GLint v1)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform2i(ctx, program, location, v0, v1);
+}
+
+void glProgramUniform3i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform3i(ctx, program, location, v0, v1, v2);
+}
+
+void glProgramUniform4i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform4i(ctx, program, location, v0, v1, v2, v3);
+}
+
+void glProgramUniform1ui(GLuint program, GLint location, GLuint v0)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform1ui(ctx, program, location, v0);
+}
+
+void glProgramUniform2ui(GLuint program, GLint location, GLint v0, GLuint v1)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform2ui(ctx, program, location, v0, v1);
+}
+
+void glProgramUniform3ui(GLuint program, GLint location, GLint v0, GLint v1, GLuint v2)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform3ui(ctx, program, location, v0, v1, v2);
+}
+
+void glProgramUniform4ui(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLuint v3)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform4ui(ctx, program, location, v0, v1, v2, v3);
+}
+
+void glProgramUniform1fv(GLuint program, GLint location, GLsizei count, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform1fv(ctx, program, location, count, value);
+}
+
+void glProgramUniform2fv(GLuint program, GLint location, GLsizei count, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform2fv(ctx, program, location, count, value);
+}
+
+void glProgramUniform3fv(GLuint program, GLint location, GLsizei count, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform3fv(ctx, program, location, count, value);
+}
+
+void glProgramUniform4fv(GLuint program, GLint location, GLsizei count, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform4fv(ctx, program, location, count, value);
+}
+
+void glProgramUniform1iv(GLuint program, GLint location, GLsizei count, const GLint* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform1iv(ctx, program, location, count, value);
+}
+
+void glProgramUniform2iv(GLuint program, GLint location, GLsizei count, const GLint* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform2iv(ctx, program, location, count, value);
+}
+
+void glProgramUniform3iv(GLuint program, GLint location, GLsizei count, const GLint* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform3iv(ctx, program, location, count, value);
+}
+
+void glProgramUniform4iv(GLuint program, GLint location, GLsizei count, const GLint* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform4iv(ctx, program, location, count, value);
+}
+
+void glProgramUniform1uiv(GLuint program, GLint location, GLsizei count, const GLuint* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform1uiv(ctx, program, location, count, value);
+}
+
+void glProgramUniform2uiv(GLuint program, GLint location, GLsizei count, const GLuint* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform2uiv(ctx, program, location, count, value);
+}
+
+void glProgramUniform3uiv(GLuint program, GLint location, GLsizei count, const GLuint* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform3uiv(ctx, program, location, count, value);
+}
+
+void glProgramUniform4uiv(GLuint program, GLint location, GLsizei count, const GLuint* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform4uiv(ctx, program, location, count, value);
+}
+
+void glProgramUniformMatrix2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniformMatrix2fv(ctx, program, location, count, transpose, value);
+}
+
+void glProgramUniformMatrix3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniformMatrix3fv(ctx, program, location, count, transpose, value);
+}
+
+void glProgramUniformMatrix4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniformMatrix4fv(ctx, program, location, count, transpose, value);
+}
+
+void glProgramUniformMatrix2x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniformMatrix2x3fv(ctx, program, location, count, transpose, value);
+}
+
+void glProgramUniformMatrix3x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniformMatrix3x2fv(ctx, program, location, count, transpose, value);
+}
+
+void glProgramUniformMatrix2x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniformMatrix2x4fv(ctx, program, location, count, transpose, value);
+}
+
+void glProgramUniformMatrix4x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniformMatrix4x2fv(ctx, program, location, count, transpose, value);
+}
+
+void glProgramUniformMatrix3x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniformMatrix3x4fv(ctx, program, location, count, transpose, value);
+}
+
+void glProgramUniformMatrix4x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniformMatrix4x3fv(ctx, program, location, count, transpose, value);
+}
+
+void glGetProgramInterfaceiv(GLuint program, GLenum programInterface, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetProgramInterfaceiv(ctx, program, programInterface, pname, params);
+}
+
+void glGetProgramResourceiv(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei* length, GLint* params)
+{
+	GET_CONTEXT;
+	 if(bufSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGetProgramResourceiv(ctx, program, programInterface, index, propCount, props, bufSize, length, params);
+}
+
+GLuint glGetProgramResourceIndex(GLuint program, GLenum programInterface, const char* name)
+{
+	GET_CONTEXT;
+	return ctx->glGetProgramResourceIndex(ctx, program, programInterface, name);
+}
+
+GLint glGetProgramResourceLocation(GLuint program, GLenum programInterface, const char* name)
+{
+	GET_CONTEXT;
+	return ctx->glGetProgramResourceLocation(ctx, program, programInterface, name);
+}
+
+void glGetProgramResourceName(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, char* name)
+{
+	GET_CONTEXT;
+	 if(bufSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGetProgramResourceName(ctx, program, programInterface, index, bufSize, length, name);
+}
+
+void glBindImageTexture(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format)
+{
+	GET_CONTEXT;
+	ctx->glBindImageTexture(ctx, unit, texture, level, layered, layer, access, format);
+}
+
+void glDispatchCompute(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z)
+{
+	GET_CONTEXT;
+	ctx->glDispatchCompute(ctx, num_groups_x, num_groups_y, num_groups_z);
+}
+
+void glDispatchComputeIndirect(GLintptr indirect)
+{
+	GET_CONTEXT;
+	ctx->glDispatchComputeIndirect(ctx, indirect);
+}
+
+void glBindVertexBuffer(GLuint bindingindex, GLuint buffer, GLintptr offset, GLintptr stride)
+{
+	GET_CONTEXT;
+	ctx->glBindVertexBuffer(ctx, bindingindex, buffer, offset, stride);
+}
+
+void glVertexAttribBinding(GLuint attribindex, GLuint bindingindex)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttribBinding(ctx, attribindex, bindingindex);
+}
+
+void glVertexAttribFormat(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttribFormat(ctx, attribindex, size, type, normalized, relativeoffset);
+}
+
+void glVertexAttribIFormat(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttribIFormat(ctx, attribindex, size, type, relativeoffset);
+}
+
+void glVertexBindingDivisor(GLuint bindingindex, GLuint divisor)
+{
+	GET_CONTEXT;
+	ctx->glVertexBindingDivisor(ctx, bindingindex, divisor);
+}
+
+void glDrawArraysIndirect(GLenum mode, const void* indirect)
+{
+	GET_CONTEXT;
+	ctx->glDrawArraysIndirect(ctx, mode, indirect);
+}
+
+void glDrawArraysIndirectDataAEMU(GLenum mode, const void* indirect, GLuint datalen)
+{
+	GET_CONTEXT;
+	ctx->glDrawArraysIndirectDataAEMU(ctx, mode, indirect, datalen);
+}
+
+void glDrawArraysIndirectOffsetAEMU(GLenum mode, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glDrawArraysIndirectOffsetAEMU(ctx, mode, offset);
+}
+
+void glDrawElementsIndirect(GLenum mode, GLenum type, const void* indirect)
+{
+	GET_CONTEXT;
+	ctx->glDrawElementsIndirect(ctx, mode, type, indirect);
+}
+
+void glDrawElementsIndirectDataAEMU(GLenum mode, GLenum type, const void* indirect, GLuint datalen)
+{
+	GET_CONTEXT;
+	ctx->glDrawElementsIndirectDataAEMU(ctx, mode, type, indirect, datalen);
+}
+
+void glDrawElementsIndirectOffsetAEMU(GLenum mode, GLenum type, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glDrawElementsIndirectOffsetAEMU(ctx, mode, type, offset);
+}
+
+void glTexStorage2DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations)
+{
+	GET_CONTEXT;
+	ctx->glTexStorage2DMultisample(ctx, target, samples, internalformat, width, height, fixedsamplelocations);
+}
+
+void glSampleMaski(GLuint maskNumber, GLbitfield mask)
+{
+	GET_CONTEXT;
+	ctx->glSampleMaski(ctx, maskNumber, mask);
+}
+
+void glGetMultisamplefv(GLenum pname, GLuint index, GLfloat* val)
+{
+	GET_CONTEXT;
+	ctx->glGetMultisamplefv(ctx, pname, index, val);
+}
+
+void glFramebufferParameteri(GLenum target, GLenum pname, GLint param)
+{
+	GET_CONTEXT;
+	ctx->glFramebufferParameteri(ctx, target, pname, param);
+}
+
+void glGetFramebufferParameteriv(GLenum target, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetFramebufferParameteriv(ctx, target, pname, params);
+}
+
+void glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat* params)
+{
+	GET_CONTEXT;
+	ctx->glGetTexLevelParameterfv(ctx, target, level, pname, params);
+}
+
+void glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetTexLevelParameteriv(ctx, target, level, pname, params);
+}
+
+void glMapBufferRangeDMA(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, uint64_t paddr)
+{
+	GET_CONTEXT;
+	ctx->glMapBufferRangeDMA(ctx, target, offset, length, access, paddr);
+}
+
+void glUnmapBufferDMA(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, uint64_t paddr, GLboolean* out_res)
+{
+	GET_CONTEXT;
+	ctx->glUnmapBufferDMA(ctx, target, offset, length, access, paddr, out_res);
+}
+
+uint64_t glMapBufferRangeDirect(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, uint64_t paddr)
+{
+	GET_CONTEXT;
+	return ctx->glMapBufferRangeDirect(ctx, target, offset, length, access, paddr);
+}
+
+void glUnmapBufferDirect(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, uint64_t paddr, uint64_t guest_ptr, GLboolean* out_res)
+{
+	GET_CONTEXT;
+	ctx->glUnmapBufferDirect(ctx, target, offset, length, access, paddr, guest_ptr, out_res);
+}
+
+void glFlushMappedBufferRangeDirect(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
+{
+	GET_CONTEXT;
+	ctx->glFlushMappedBufferRangeDirect(ctx, target, offset, length, access);
+}
+
+GLenum glGetGraphicsResetStatusEXT()
+{
+	GET_CONTEXT;
+	return ctx->glGetGraphicsResetStatusEXT(ctx);
+}
+
+void glReadnPixelsEXT(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid* data)
+{
+	GET_CONTEXT;
+	ctx->glReadnPixelsEXT(ctx, x, y, width, height, format, type, bufSize, data);
+}
+
+void glGetnUniformfvEXT(GLuint program, GLint location, GLsizei bufSize, GLfloat* params)
+{
+	GET_CONTEXT;
+	ctx->glGetnUniformfvEXT(ctx, program, location, bufSize, params);
+}
+
+void glGetnUniformivEXT(GLuint program, GLint location, GLsizei bufSize, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetnUniformivEXT(ctx, program, location, bufSize, params);
+}
+
+void glDrawArraysNullAEMU(GLenum mode, GLint first, GLsizei count)
+{
+	GET_CONTEXT;
+	ctx->glDrawArraysNullAEMU(ctx, mode, first, count);
+}
+
+void glDrawElementsNullAEMU(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices)
+{
+	GET_CONTEXT;
+	ctx->glDrawElementsNullAEMU(ctx, mode, count, type, indices);
+}
+
+void glDrawElementsOffsetNullAEMU(GLenum mode, GLsizei count, GLenum type, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glDrawElementsOffsetNullAEMU(ctx, mode, count, type, offset);
+}
+
+void glDrawElementsDataNullAEMU(GLenum mode, GLsizei count, GLenum type, void* data, GLuint datalen)
+{
+	GET_CONTEXT;
+	ctx->glDrawElementsDataNullAEMU(ctx, mode, count, type, data, datalen);
+}
+
+void glUnmapBufferAsyncAEMU(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* guest_buffer, GLboolean* out_res)
+{
+	GET_CONTEXT;
+	ctx->glUnmapBufferAsyncAEMU(ctx, target, offset, length, access, guest_buffer, out_res);
+}
+
+void glFlushMappedBufferRangeAEMU2(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* guest_buffer)
+{
+	GET_CONTEXT;
+	ctx->glFlushMappedBufferRangeAEMU2(ctx, target, offset, length, access, guest_buffer);
+}
+
+GLboolean glBufferDataSyncAEMU(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage)
+{
+	GET_CONTEXT;
+	return ctx->glBufferDataSyncAEMU(ctx, target, size, data, usage);
+}
+
+void glTexBufferOES(GLenum target, GLenum internalFormat, GLuint buffer)
+{
+	GET_CONTEXT;
+	ctx->glTexBufferOES(ctx, target, internalFormat, buffer);
+}
+
+void glTexBufferRangeOES(GLenum target, GLenum internalFormat, GLuint buffer, GLintptr offset, GLsizeiptr size)
+{
+	GET_CONTEXT;
+	ctx->glTexBufferRangeOES(ctx, target, internalFormat, buffer, offset, size);
+}
+
+void glTexBufferEXT(GLenum target, GLenum internalFormat, GLuint buffer)
+{
+	GET_CONTEXT;
+	ctx->glTexBufferEXT(ctx, target, internalFormat, buffer);
+}
+
+void glTexBufferRangeEXT(GLenum target, GLenum internalFormat, GLuint buffer, GLintptr offset, GLsizeiptr size)
+{
+	GET_CONTEXT;
+	ctx->glTexBufferRangeEXT(ctx, target, internalFormat, buffer, offset, size);
+}
+
+void glEnableiEXT(GLenum cap, GLuint index)
+{
+	GET_CONTEXT;
+	ctx->glEnableiEXT(ctx, cap, index);
+}
+
+void glDisableiEXT(GLenum cap, GLuint index)
+{
+	GET_CONTEXT;
+	ctx->glDisableiEXT(ctx, cap, index);
+}
+
+void glBlendEquationiEXT(GLuint index, GLenum mode)
+{
+	GET_CONTEXT;
+	ctx->glBlendEquationiEXT(ctx, index, mode);
+}
+
+void glBlendEquationSeparateiEXT(GLuint index, GLenum modeRGB, GLenum modeAlpha)
+{
+	GET_CONTEXT;
+	ctx->glBlendEquationSeparateiEXT(ctx, index, modeRGB, modeAlpha);
+}
+
+void glBlendFunciEXT(GLuint index, GLenum sfactor, GLenum dfactor)
+{
+	GET_CONTEXT;
+	ctx->glBlendFunciEXT(ctx, index, sfactor, dfactor);
+}
+
+void glBlendFuncSeparateiEXT(GLuint index, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
+{
+	GET_CONTEXT;
+	ctx->glBlendFuncSeparateiEXT(ctx, index, srcRGB, dstRGB, srcAlpha, dstAlpha);
+}
+
+void glColorMaskiEXT(GLuint index, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
+{
+	GET_CONTEXT;
+	ctx->glColorMaskiEXT(ctx, index, red, green, blue, alpha);
+}
+
+GLboolean glIsEnablediEXT(GLenum cap, GLuint index)
+{
+	GET_CONTEXT;
+	return ctx->glIsEnablediEXT(ctx, cap, index);
+}
+
diff --git a/system/GLESv2_enc/gl2_ftable.h b/system/GLESv2_enc/gl2_ftable.h
new file mode 100644
index 0000000..3a3e8f5
--- /dev/null
+++ b/system/GLESv2_enc/gl2_ftable.h
@@ -0,0 +1,406 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+#ifndef __gl2_client_ftable_t_h
+#define __gl2_client_ftable_t_h
+
+
+static const struct _gl2_funcs_by_name {
+	const char *name;
+	void *proc;
+} gl2_funcs_by_name[] = {
+	{"glActiveTexture", (void*)glActiveTexture},
+	{"glAttachShader", (void*)glAttachShader},
+	{"glBindAttribLocation", (void*)glBindAttribLocation},
+	{"glBindBuffer", (void*)glBindBuffer},
+	{"glBindFramebuffer", (void*)glBindFramebuffer},
+	{"glBindRenderbuffer", (void*)glBindRenderbuffer},
+	{"glBindTexture", (void*)glBindTexture},
+	{"glBlendColor", (void*)glBlendColor},
+	{"glBlendEquation", (void*)glBlendEquation},
+	{"glBlendEquationSeparate", (void*)glBlendEquationSeparate},
+	{"glBlendFunc", (void*)glBlendFunc},
+	{"glBlendFuncSeparate", (void*)glBlendFuncSeparate},
+	{"glBufferData", (void*)glBufferData},
+	{"glBufferSubData", (void*)glBufferSubData},
+	{"glCheckFramebufferStatus", (void*)glCheckFramebufferStatus},
+	{"glClear", (void*)glClear},
+	{"glClearColor", (void*)glClearColor},
+	{"glClearDepthf", (void*)glClearDepthf},
+	{"glClearStencil", (void*)glClearStencil},
+	{"glColorMask", (void*)glColorMask},
+	{"glCompileShader", (void*)glCompileShader},
+	{"glCompressedTexImage2D", (void*)glCompressedTexImage2D},
+	{"glCompressedTexSubImage2D", (void*)glCompressedTexSubImage2D},
+	{"glCopyTexImage2D", (void*)glCopyTexImage2D},
+	{"glCopyTexSubImage2D", (void*)glCopyTexSubImage2D},
+	{"glCreateProgram", (void*)glCreateProgram},
+	{"glCreateShader", (void*)glCreateShader},
+	{"glCullFace", (void*)glCullFace},
+	{"glDeleteBuffers", (void*)glDeleteBuffers},
+	{"glDeleteFramebuffers", (void*)glDeleteFramebuffers},
+	{"glDeleteProgram", (void*)glDeleteProgram},
+	{"glDeleteRenderbuffers", (void*)glDeleteRenderbuffers},
+	{"glDeleteShader", (void*)glDeleteShader},
+	{"glDeleteTextures", (void*)glDeleteTextures},
+	{"glDepthFunc", (void*)glDepthFunc},
+	{"glDepthMask", (void*)glDepthMask},
+	{"glDepthRangef", (void*)glDepthRangef},
+	{"glDetachShader", (void*)glDetachShader},
+	{"glDisable", (void*)glDisable},
+	{"glDisableVertexAttribArray", (void*)glDisableVertexAttribArray},
+	{"glDrawArrays", (void*)glDrawArrays},
+	{"glDrawElements", (void*)glDrawElements},
+	{"glEnable", (void*)glEnable},
+	{"glEnableVertexAttribArray", (void*)glEnableVertexAttribArray},
+	{"glFinish", (void*)glFinish},
+	{"glFlush", (void*)glFlush},
+	{"glFramebufferRenderbuffer", (void*)glFramebufferRenderbuffer},
+	{"glFramebufferTexture2D", (void*)glFramebufferTexture2D},
+	{"glFrontFace", (void*)glFrontFace},
+	{"glGenBuffers", (void*)glGenBuffers},
+	{"glGenerateMipmap", (void*)glGenerateMipmap},
+	{"glGenFramebuffers", (void*)glGenFramebuffers},
+	{"glGenRenderbuffers", (void*)glGenRenderbuffers},
+	{"glGenTextures", (void*)glGenTextures},
+	{"glGetActiveAttrib", (void*)glGetActiveAttrib},
+	{"glGetActiveUniform", (void*)glGetActiveUniform},
+	{"glGetAttachedShaders", (void*)glGetAttachedShaders},
+	{"glGetAttribLocation", (void*)glGetAttribLocation},
+	{"glGetBooleanv", (void*)glGetBooleanv},
+	{"glGetBufferParameteriv", (void*)glGetBufferParameteriv},
+	{"glGetError", (void*)glGetError},
+	{"glGetFloatv", (void*)glGetFloatv},
+	{"glGetFramebufferAttachmentParameteriv", (void*)glGetFramebufferAttachmentParameteriv},
+	{"glGetIntegerv", (void*)glGetIntegerv},
+	{"glGetProgramiv", (void*)glGetProgramiv},
+	{"glGetProgramInfoLog", (void*)glGetProgramInfoLog},
+	{"glGetRenderbufferParameteriv", (void*)glGetRenderbufferParameteriv},
+	{"glGetShaderiv", (void*)glGetShaderiv},
+	{"glGetShaderInfoLog", (void*)glGetShaderInfoLog},
+	{"glGetShaderPrecisionFormat", (void*)glGetShaderPrecisionFormat},
+	{"glGetShaderSource", (void*)glGetShaderSource},
+	{"glGetString", (void*)glGetString},
+	{"glGetTexParameterfv", (void*)glGetTexParameterfv},
+	{"glGetTexParameteriv", (void*)glGetTexParameteriv},
+	{"glGetUniformfv", (void*)glGetUniformfv},
+	{"glGetUniformiv", (void*)glGetUniformiv},
+	{"glGetUniformLocation", (void*)glGetUniformLocation},
+	{"glGetVertexAttribfv", (void*)glGetVertexAttribfv},
+	{"glGetVertexAttribiv", (void*)glGetVertexAttribiv},
+	{"glGetVertexAttribPointerv", (void*)glGetVertexAttribPointerv},
+	{"glHint", (void*)glHint},
+	{"glIsBuffer", (void*)glIsBuffer},
+	{"glIsEnabled", (void*)glIsEnabled},
+	{"glIsFramebuffer", (void*)glIsFramebuffer},
+	{"glIsProgram", (void*)glIsProgram},
+	{"glIsRenderbuffer", (void*)glIsRenderbuffer},
+	{"glIsShader", (void*)glIsShader},
+	{"glIsTexture", (void*)glIsTexture},
+	{"glLineWidth", (void*)glLineWidth},
+	{"glLinkProgram", (void*)glLinkProgram},
+	{"glPixelStorei", (void*)glPixelStorei},
+	{"glPolygonOffset", (void*)glPolygonOffset},
+	{"glReadPixels", (void*)glReadPixels},
+	{"glReleaseShaderCompiler", (void*)glReleaseShaderCompiler},
+	{"glRenderbufferStorage", (void*)glRenderbufferStorage},
+	{"glSampleCoverage", (void*)glSampleCoverage},
+	{"glScissor", (void*)glScissor},
+	{"glShaderBinary", (void*)glShaderBinary},
+	{"glShaderSource", (void*)glShaderSource},
+	{"glStencilFunc", (void*)glStencilFunc},
+	{"glStencilFuncSeparate", (void*)glStencilFuncSeparate},
+	{"glStencilMask", (void*)glStencilMask},
+	{"glStencilMaskSeparate", (void*)glStencilMaskSeparate},
+	{"glStencilOp", (void*)glStencilOp},
+	{"glStencilOpSeparate", (void*)glStencilOpSeparate},
+	{"glTexImage2D", (void*)glTexImage2D},
+	{"glTexParameterf", (void*)glTexParameterf},
+	{"glTexParameterfv", (void*)glTexParameterfv},
+	{"glTexParameteri", (void*)glTexParameteri},
+	{"glTexParameteriv", (void*)glTexParameteriv},
+	{"glTexSubImage2D", (void*)glTexSubImage2D},
+	{"glUniform1f", (void*)glUniform1f},
+	{"glUniform1fv", (void*)glUniform1fv},
+	{"glUniform1i", (void*)glUniform1i},
+	{"glUniform1iv", (void*)glUniform1iv},
+	{"glUniform2f", (void*)glUniform2f},
+	{"glUniform2fv", (void*)glUniform2fv},
+	{"glUniform2i", (void*)glUniform2i},
+	{"glUniform2iv", (void*)glUniform2iv},
+	{"glUniform3f", (void*)glUniform3f},
+	{"glUniform3fv", (void*)glUniform3fv},
+	{"glUniform3i", (void*)glUniform3i},
+	{"glUniform3iv", (void*)glUniform3iv},
+	{"glUniform4f", (void*)glUniform4f},
+	{"glUniform4fv", (void*)glUniform4fv},
+	{"glUniform4i", (void*)glUniform4i},
+	{"glUniform4iv", (void*)glUniform4iv},
+	{"glUniformMatrix2fv", (void*)glUniformMatrix2fv},
+	{"glUniformMatrix3fv", (void*)glUniformMatrix3fv},
+	{"glUniformMatrix4fv", (void*)glUniformMatrix4fv},
+	{"glUseProgram", (void*)glUseProgram},
+	{"glValidateProgram", (void*)glValidateProgram},
+	{"glVertexAttrib1f", (void*)glVertexAttrib1f},
+	{"glVertexAttrib1fv", (void*)glVertexAttrib1fv},
+	{"glVertexAttrib2f", (void*)glVertexAttrib2f},
+	{"glVertexAttrib2fv", (void*)glVertexAttrib2fv},
+	{"glVertexAttrib3f", (void*)glVertexAttrib3f},
+	{"glVertexAttrib3fv", (void*)glVertexAttrib3fv},
+	{"glVertexAttrib4f", (void*)glVertexAttrib4f},
+	{"glVertexAttrib4fv", (void*)glVertexAttrib4fv},
+	{"glVertexAttribPointer", (void*)glVertexAttribPointer},
+	{"glViewport", (void*)glViewport},
+	{"glEGLImageTargetTexture2DOES", (void*)glEGLImageTargetTexture2DOES},
+	{"glEGLImageTargetRenderbufferStorageOES", (void*)glEGLImageTargetRenderbufferStorageOES},
+	{"glGetProgramBinaryOES", (void*)glGetProgramBinaryOES},
+	{"glProgramBinaryOES", (void*)glProgramBinaryOES},
+	{"glMapBufferOES", (void*)glMapBufferOES},
+	{"glUnmapBufferOES", (void*)glUnmapBufferOES},
+	{"glTexImage3DOES", (void*)glTexImage3DOES},
+	{"glTexSubImage3DOES", (void*)glTexSubImage3DOES},
+	{"glCopyTexSubImage3DOES", (void*)glCopyTexSubImage3DOES},
+	{"glCompressedTexImage3DOES", (void*)glCompressedTexImage3DOES},
+	{"glCompressedTexSubImage3DOES", (void*)glCompressedTexSubImage3DOES},
+	{"glFramebufferTexture3DOES", (void*)glFramebufferTexture3DOES},
+	{"glBindVertexArrayOES", (void*)glBindVertexArrayOES},
+	{"glDeleteVertexArraysOES", (void*)glDeleteVertexArraysOES},
+	{"glGenVertexArraysOES", (void*)glGenVertexArraysOES},
+	{"glIsVertexArrayOES", (void*)glIsVertexArrayOES},
+	{"glDiscardFramebufferEXT", (void*)glDiscardFramebufferEXT},
+	{"glMultiDrawArraysEXT", (void*)glMultiDrawArraysEXT},
+	{"glMultiDrawElementsEXT", (void*)glMultiDrawElementsEXT},
+	{"glGetPerfMonitorGroupsAMD", (void*)glGetPerfMonitorGroupsAMD},
+	{"glGetPerfMonitorCountersAMD", (void*)glGetPerfMonitorCountersAMD},
+	{"glGetPerfMonitorGroupStringAMD", (void*)glGetPerfMonitorGroupStringAMD},
+	{"glGetPerfMonitorCounterStringAMD", (void*)glGetPerfMonitorCounterStringAMD},
+	{"glGetPerfMonitorCounterInfoAMD", (void*)glGetPerfMonitorCounterInfoAMD},
+	{"glGenPerfMonitorsAMD", (void*)glGenPerfMonitorsAMD},
+	{"glDeletePerfMonitorsAMD", (void*)glDeletePerfMonitorsAMD},
+	{"glSelectPerfMonitorCountersAMD", (void*)glSelectPerfMonitorCountersAMD},
+	{"glBeginPerfMonitorAMD", (void*)glBeginPerfMonitorAMD},
+	{"glEndPerfMonitorAMD", (void*)glEndPerfMonitorAMD},
+	{"glGetPerfMonitorCounterDataAMD", (void*)glGetPerfMonitorCounterDataAMD},
+	{"glRenderbufferStorageMultisampleIMG", (void*)glRenderbufferStorageMultisampleIMG},
+	{"glFramebufferTexture2DMultisampleIMG", (void*)glFramebufferTexture2DMultisampleIMG},
+	{"glDeleteFencesNV", (void*)glDeleteFencesNV},
+	{"glGenFencesNV", (void*)glGenFencesNV},
+	{"glIsFenceNV", (void*)glIsFenceNV},
+	{"glTestFenceNV", (void*)glTestFenceNV},
+	{"glGetFenceivNV", (void*)glGetFenceivNV},
+	{"glFinishFenceNV", (void*)glFinishFenceNV},
+	{"glSetFenceNV", (void*)glSetFenceNV},
+	{"glCoverageMaskNV", (void*)glCoverageMaskNV},
+	{"glCoverageOperationNV", (void*)glCoverageOperationNV},
+	{"glGetDriverControlsQCOM", (void*)glGetDriverControlsQCOM},
+	{"glGetDriverControlStringQCOM", (void*)glGetDriverControlStringQCOM},
+	{"glEnableDriverControlQCOM", (void*)glEnableDriverControlQCOM},
+	{"glDisableDriverControlQCOM", (void*)glDisableDriverControlQCOM},
+	{"glExtGetTexturesQCOM", (void*)glExtGetTexturesQCOM},
+	{"glExtGetBuffersQCOM", (void*)glExtGetBuffersQCOM},
+	{"glExtGetRenderbuffersQCOM", (void*)glExtGetRenderbuffersQCOM},
+	{"glExtGetFramebuffersQCOM", (void*)glExtGetFramebuffersQCOM},
+	{"glExtGetTexLevelParameterivQCOM", (void*)glExtGetTexLevelParameterivQCOM},
+	{"glExtTexObjectStateOverrideiQCOM", (void*)glExtTexObjectStateOverrideiQCOM},
+	{"glExtGetTexSubImageQCOM", (void*)glExtGetTexSubImageQCOM},
+	{"glExtGetBufferPointervQCOM", (void*)glExtGetBufferPointervQCOM},
+	{"glExtGetShadersQCOM", (void*)glExtGetShadersQCOM},
+	{"glExtGetProgramsQCOM", (void*)glExtGetProgramsQCOM},
+	{"glExtIsProgramBinaryQCOM", (void*)glExtIsProgramBinaryQCOM},
+	{"glExtGetProgramBinarySourceQCOM", (void*)glExtGetProgramBinarySourceQCOM},
+	{"glStartTilingQCOM", (void*)glStartTilingQCOM},
+	{"glEndTilingQCOM", (void*)glEndTilingQCOM},
+	{"glGenVertexArrays", (void*)glGenVertexArrays},
+	{"glBindVertexArray", (void*)glBindVertexArray},
+	{"glDeleteVertexArrays", (void*)glDeleteVertexArrays},
+	{"glIsVertexArray", (void*)glIsVertexArray},
+	{"glMapBufferRange", (void*)glMapBufferRange},
+	{"glUnmapBuffer", (void*)glUnmapBuffer},
+	{"glFlushMappedBufferRange", (void*)glFlushMappedBufferRange},
+	{"glBindBufferRange", (void*)glBindBufferRange},
+	{"glBindBufferBase", (void*)glBindBufferBase},
+	{"glCopyBufferSubData", (void*)glCopyBufferSubData},
+	{"glClearBufferiv", (void*)glClearBufferiv},
+	{"glClearBufferuiv", (void*)glClearBufferuiv},
+	{"glClearBufferfv", (void*)glClearBufferfv},
+	{"glClearBufferfi", (void*)glClearBufferfi},
+	{"glGetBufferParameteri64v", (void*)glGetBufferParameteri64v},
+	{"glGetBufferPointerv", (void*)glGetBufferPointerv},
+	{"glUniformBlockBinding", (void*)glUniformBlockBinding},
+	{"glGetUniformBlockIndex", (void*)glGetUniformBlockIndex},
+	{"glGetUniformIndices", (void*)glGetUniformIndices},
+	{"glGetActiveUniformBlockiv", (void*)glGetActiveUniformBlockiv},
+	{"glGetActiveUniformBlockName", (void*)glGetActiveUniformBlockName},
+	{"glUniform1ui", (void*)glUniform1ui},
+	{"glUniform2ui", (void*)glUniform2ui},
+	{"glUniform3ui", (void*)glUniform3ui},
+	{"glUniform4ui", (void*)glUniform4ui},
+	{"glUniform1uiv", (void*)glUniform1uiv},
+	{"glUniform2uiv", (void*)glUniform2uiv},
+	{"glUniform3uiv", (void*)glUniform3uiv},
+	{"glUniform4uiv", (void*)glUniform4uiv},
+	{"glUniformMatrix2x3fv", (void*)glUniformMatrix2x3fv},
+	{"glUniformMatrix3x2fv", (void*)glUniformMatrix3x2fv},
+	{"glUniformMatrix2x4fv", (void*)glUniformMatrix2x4fv},
+	{"glUniformMatrix4x2fv", (void*)glUniformMatrix4x2fv},
+	{"glUniformMatrix3x4fv", (void*)glUniformMatrix3x4fv},
+	{"glUniformMatrix4x3fv", (void*)glUniformMatrix4x3fv},
+	{"glGetUniformuiv", (void*)glGetUniformuiv},
+	{"glGetActiveUniformsiv", (void*)glGetActiveUniformsiv},
+	{"glVertexAttribI4i", (void*)glVertexAttribI4i},
+	{"glVertexAttribI4ui", (void*)glVertexAttribI4ui},
+	{"glVertexAttribI4iv", (void*)glVertexAttribI4iv},
+	{"glVertexAttribI4uiv", (void*)glVertexAttribI4uiv},
+	{"glVertexAttribIPointer", (void*)glVertexAttribIPointer},
+	{"glGetVertexAttribIiv", (void*)glGetVertexAttribIiv},
+	{"glGetVertexAttribIuiv", (void*)glGetVertexAttribIuiv},
+	{"glVertexAttribDivisor", (void*)glVertexAttribDivisor},
+	{"glDrawArraysInstanced", (void*)glDrawArraysInstanced},
+	{"glDrawElementsInstanced", (void*)glDrawElementsInstanced},
+	{"glDrawRangeElements", (void*)glDrawRangeElements},
+	{"glFenceSync", (void*)glFenceSync},
+	{"glClientWaitSync", (void*)glClientWaitSync},
+	{"glWaitSync", (void*)glWaitSync},
+	{"glDeleteSync", (void*)glDeleteSync},
+	{"glIsSync", (void*)glIsSync},
+	{"glGetSynciv", (void*)glGetSynciv},
+	{"glDrawBuffers", (void*)glDrawBuffers},
+	{"glReadBuffer", (void*)glReadBuffer},
+	{"glBlitFramebuffer", (void*)glBlitFramebuffer},
+	{"glInvalidateFramebuffer", (void*)glInvalidateFramebuffer},
+	{"glInvalidateSubFramebuffer", (void*)glInvalidateSubFramebuffer},
+	{"glFramebufferTextureLayer", (void*)glFramebufferTextureLayer},
+	{"glRenderbufferStorageMultisample", (void*)glRenderbufferStorageMultisample},
+	{"glTexStorage2D", (void*)glTexStorage2D},
+	{"glGetInternalformativ", (void*)glGetInternalformativ},
+	{"glBeginTransformFeedback", (void*)glBeginTransformFeedback},
+	{"glEndTransformFeedback", (void*)glEndTransformFeedback},
+	{"glGenTransformFeedbacks", (void*)glGenTransformFeedbacks},
+	{"glDeleteTransformFeedbacks", (void*)glDeleteTransformFeedbacks},
+	{"glBindTransformFeedback", (void*)glBindTransformFeedback},
+	{"glPauseTransformFeedback", (void*)glPauseTransformFeedback},
+	{"glResumeTransformFeedback", (void*)glResumeTransformFeedback},
+	{"glIsTransformFeedback", (void*)glIsTransformFeedback},
+	{"glTransformFeedbackVaryings", (void*)glTransformFeedbackVaryings},
+	{"glGetTransformFeedbackVarying", (void*)glGetTransformFeedbackVarying},
+	{"glGenSamplers", (void*)glGenSamplers},
+	{"glDeleteSamplers", (void*)glDeleteSamplers},
+	{"glBindSampler", (void*)glBindSampler},
+	{"glSamplerParameterf", (void*)glSamplerParameterf},
+	{"glSamplerParameteri", (void*)glSamplerParameteri},
+	{"glSamplerParameterfv", (void*)glSamplerParameterfv},
+	{"glSamplerParameteriv", (void*)glSamplerParameteriv},
+	{"glGetSamplerParameterfv", (void*)glGetSamplerParameterfv},
+	{"glGetSamplerParameteriv", (void*)glGetSamplerParameteriv},
+	{"glIsSampler", (void*)glIsSampler},
+	{"glGenQueries", (void*)glGenQueries},
+	{"glDeleteQueries", (void*)glDeleteQueries},
+	{"glBeginQuery", (void*)glBeginQuery},
+	{"glEndQuery", (void*)glEndQuery},
+	{"glGetQueryiv", (void*)glGetQueryiv},
+	{"glGetQueryObjectuiv", (void*)glGetQueryObjectuiv},
+	{"glIsQuery", (void*)glIsQuery},
+	{"glProgramParameteri", (void*)glProgramParameteri},
+	{"glProgramBinary", (void*)glProgramBinary},
+	{"glGetProgramBinary", (void*)glGetProgramBinary},
+	{"glGetFragDataLocation", (void*)glGetFragDataLocation},
+	{"glGetInteger64v", (void*)glGetInteger64v},
+	{"glGetIntegeri_v", (void*)glGetIntegeri_v},
+	{"glGetInteger64i_v", (void*)glGetInteger64i_v},
+	{"glTexImage3D", (void*)glTexImage3D},
+	{"glTexStorage3D", (void*)glTexStorage3D},
+	{"glTexSubImage3D", (void*)glTexSubImage3D},
+	{"glCompressedTexImage3D", (void*)glCompressedTexImage3D},
+	{"glCompressedTexSubImage3D", (void*)glCompressedTexSubImage3D},
+	{"glCopyTexSubImage3D", (void*)glCopyTexSubImage3D},
+	{"glGetStringi", (void*)glGetStringi},
+	{"glGetBooleani_v", (void*)glGetBooleani_v},
+	{"glMemoryBarrier", (void*)glMemoryBarrier},
+	{"glMemoryBarrierByRegion", (void*)glMemoryBarrierByRegion},
+	{"glGenProgramPipelines", (void*)glGenProgramPipelines},
+	{"glDeleteProgramPipelines", (void*)glDeleteProgramPipelines},
+	{"glBindProgramPipeline", (void*)glBindProgramPipeline},
+	{"glGetProgramPipelineiv", (void*)glGetProgramPipelineiv},
+	{"glGetProgramPipelineInfoLog", (void*)glGetProgramPipelineInfoLog},
+	{"glValidateProgramPipeline", (void*)glValidateProgramPipeline},
+	{"glIsProgramPipeline", (void*)glIsProgramPipeline},
+	{"glUseProgramStages", (void*)glUseProgramStages},
+	{"glActiveShaderProgram", (void*)glActiveShaderProgram},
+	{"glCreateShaderProgramv", (void*)glCreateShaderProgramv},
+	{"glProgramUniform1f", (void*)glProgramUniform1f},
+	{"glProgramUniform2f", (void*)glProgramUniform2f},
+	{"glProgramUniform3f", (void*)glProgramUniform3f},
+	{"glProgramUniform4f", (void*)glProgramUniform4f},
+	{"glProgramUniform1i", (void*)glProgramUniform1i},
+	{"glProgramUniform2i", (void*)glProgramUniform2i},
+	{"glProgramUniform3i", (void*)glProgramUniform3i},
+	{"glProgramUniform4i", (void*)glProgramUniform4i},
+	{"glProgramUniform1ui", (void*)glProgramUniform1ui},
+	{"glProgramUniform2ui", (void*)glProgramUniform2ui},
+	{"glProgramUniform3ui", (void*)glProgramUniform3ui},
+	{"glProgramUniform4ui", (void*)glProgramUniform4ui},
+	{"glProgramUniform1fv", (void*)glProgramUniform1fv},
+	{"glProgramUniform2fv", (void*)glProgramUniform2fv},
+	{"glProgramUniform3fv", (void*)glProgramUniform3fv},
+	{"glProgramUniform4fv", (void*)glProgramUniform4fv},
+	{"glProgramUniform1iv", (void*)glProgramUniform1iv},
+	{"glProgramUniform2iv", (void*)glProgramUniform2iv},
+	{"glProgramUniform3iv", (void*)glProgramUniform3iv},
+	{"glProgramUniform4iv", (void*)glProgramUniform4iv},
+	{"glProgramUniform1uiv", (void*)glProgramUniform1uiv},
+	{"glProgramUniform2uiv", (void*)glProgramUniform2uiv},
+	{"glProgramUniform3uiv", (void*)glProgramUniform3uiv},
+	{"glProgramUniform4uiv", (void*)glProgramUniform4uiv},
+	{"glProgramUniformMatrix2fv", (void*)glProgramUniformMatrix2fv},
+	{"glProgramUniformMatrix3fv", (void*)glProgramUniformMatrix3fv},
+	{"glProgramUniformMatrix4fv", (void*)glProgramUniformMatrix4fv},
+	{"glProgramUniformMatrix2x3fv", (void*)glProgramUniformMatrix2x3fv},
+	{"glProgramUniformMatrix3x2fv", (void*)glProgramUniformMatrix3x2fv},
+	{"glProgramUniformMatrix2x4fv", (void*)glProgramUniformMatrix2x4fv},
+	{"glProgramUniformMatrix4x2fv", (void*)glProgramUniformMatrix4x2fv},
+	{"glProgramUniformMatrix3x4fv", (void*)glProgramUniformMatrix3x4fv},
+	{"glProgramUniformMatrix4x3fv", (void*)glProgramUniformMatrix4x3fv},
+	{"glGetProgramInterfaceiv", (void*)glGetProgramInterfaceiv},
+	{"glGetProgramResourceiv", (void*)glGetProgramResourceiv},
+	{"glGetProgramResourceIndex", (void*)glGetProgramResourceIndex},
+	{"glGetProgramResourceLocation", (void*)glGetProgramResourceLocation},
+	{"glGetProgramResourceName", (void*)glGetProgramResourceName},
+	{"glBindImageTexture", (void*)glBindImageTexture},
+	{"glDispatchCompute", (void*)glDispatchCompute},
+	{"glDispatchComputeIndirect", (void*)glDispatchComputeIndirect},
+	{"glBindVertexBuffer", (void*)glBindVertexBuffer},
+	{"glVertexAttribBinding", (void*)glVertexAttribBinding},
+	{"glVertexAttribFormat", (void*)glVertexAttribFormat},
+	{"glVertexAttribIFormat", (void*)glVertexAttribIFormat},
+	{"glVertexBindingDivisor", (void*)glVertexBindingDivisor},
+	{"glDrawArraysIndirect", (void*)glDrawArraysIndirect},
+	{"glDrawElementsIndirect", (void*)glDrawElementsIndirect},
+	{"glTexStorage2DMultisample", (void*)glTexStorage2DMultisample},
+	{"glSampleMaski", (void*)glSampleMaski},
+	{"glGetMultisamplefv", (void*)glGetMultisamplefv},
+	{"glFramebufferParameteri", (void*)glFramebufferParameteri},
+	{"glGetFramebufferParameteriv", (void*)glGetFramebufferParameteriv},
+	{"glGetTexLevelParameterfv", (void*)glGetTexLevelParameterfv},
+	{"glGetTexLevelParameteriv", (void*)glGetTexLevelParameteriv},
+	{"glGetGraphicsResetStatusEXT", (void*)glGetGraphicsResetStatusEXT},
+	{"glReadnPixelsEXT", (void*)glReadnPixelsEXT},
+	{"glGetnUniformfvEXT", (void*)glGetnUniformfvEXT},
+	{"glGetnUniformivEXT", (void*)glGetnUniformivEXT},
+	{"glDrawArraysNullAEMU", (void*)glDrawArraysNullAEMU},
+	{"glDrawElementsNullAEMU", (void*)glDrawElementsNullAEMU},
+	{"glTexBufferOES", (void*)glTexBufferOES},
+	{"glTexBufferRangeOES", (void*)glTexBufferRangeOES},
+	{"glTexBufferEXT", (void*)glTexBufferEXT},
+	{"glTexBufferRangeEXT", (void*)glTexBufferRangeEXT},
+	{"glEnableiEXT", (void*)glEnableiEXT},
+	{"glDisableiEXT", (void*)glDisableiEXT},
+	{"glBlendEquationiEXT", (void*)glBlendEquationiEXT},
+	{"glBlendEquationSeparateiEXT", (void*)glBlendEquationSeparateiEXT},
+	{"glBlendFunciEXT", (void*)glBlendFunciEXT},
+	{"glBlendFuncSeparateiEXT", (void*)glBlendFuncSeparateiEXT},
+	{"glColorMaskiEXT", (void*)glColorMaskiEXT},
+	{"glIsEnablediEXT", (void*)glIsEnablediEXT},
+};
+static const int gl2_num_funcs = sizeof(gl2_funcs_by_name) / sizeof(struct _gl2_funcs_by_name);
+
+
+#endif
diff --git a/system/GLESv2_enc/gl2_opcodes.h b/system/GLESv2_enc/gl2_opcodes.h
new file mode 100644
index 0000000..ae21891
--- /dev/null
+++ b/system/GLESv2_enc/gl2_opcodes.h
@@ -0,0 +1,448 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+#ifndef __GUARD_gl2_opcodes_h_
+#define __GUARD_gl2_opcodes_h_
+
+#define OP_glActiveTexture 					2048
+#define OP_glAttachShader 					2049
+#define OP_glBindAttribLocation 					2050
+#define OP_glBindBuffer 					2051
+#define OP_glBindFramebuffer 					2052
+#define OP_glBindRenderbuffer 					2053
+#define OP_glBindTexture 					2054
+#define OP_glBlendColor 					2055
+#define OP_glBlendEquation 					2056
+#define OP_glBlendEquationSeparate 					2057
+#define OP_glBlendFunc 					2058
+#define OP_glBlendFuncSeparate 					2059
+#define OP_glBufferData 					2060
+#define OP_glBufferSubData 					2061
+#define OP_glCheckFramebufferStatus 					2062
+#define OP_glClear 					2063
+#define OP_glClearColor 					2064
+#define OP_glClearDepthf 					2065
+#define OP_glClearStencil 					2066
+#define OP_glColorMask 					2067
+#define OP_glCompileShader 					2068
+#define OP_glCompressedTexImage2D 					2069
+#define OP_glCompressedTexSubImage2D 					2070
+#define OP_glCopyTexImage2D 					2071
+#define OP_glCopyTexSubImage2D 					2072
+#define OP_glCreateProgram 					2073
+#define OP_glCreateShader 					2074
+#define OP_glCullFace 					2075
+#define OP_glDeleteBuffers 					2076
+#define OP_glDeleteFramebuffers 					2077
+#define OP_glDeleteProgram 					2078
+#define OP_glDeleteRenderbuffers 					2079
+#define OP_glDeleteShader 					2080
+#define OP_glDeleteTextures 					2081
+#define OP_glDepthFunc 					2082
+#define OP_glDepthMask 					2083
+#define OP_glDepthRangef 					2084
+#define OP_glDetachShader 					2085
+#define OP_glDisable 					2086
+#define OP_glDisableVertexAttribArray 					2087
+#define OP_glDrawArrays 					2088
+#define OP_glDrawElements 					2089
+#define OP_glEnable 					2090
+#define OP_glEnableVertexAttribArray 					2091
+#define OP_glFinish 					2092
+#define OP_glFlush 					2093
+#define OP_glFramebufferRenderbuffer 					2094
+#define OP_glFramebufferTexture2D 					2095
+#define OP_glFrontFace 					2096
+#define OP_glGenBuffers 					2097
+#define OP_glGenerateMipmap 					2098
+#define OP_glGenFramebuffers 					2099
+#define OP_glGenRenderbuffers 					2100
+#define OP_glGenTextures 					2101
+#define OP_glGetActiveAttrib 					2102
+#define OP_glGetActiveUniform 					2103
+#define OP_glGetAttachedShaders 					2104
+#define OP_glGetAttribLocation 					2105
+#define OP_glGetBooleanv 					2106
+#define OP_glGetBufferParameteriv 					2107
+#define OP_glGetError 					2108
+#define OP_glGetFloatv 					2109
+#define OP_glGetFramebufferAttachmentParameteriv 					2110
+#define OP_glGetIntegerv 					2111
+#define OP_glGetProgramiv 					2112
+#define OP_glGetProgramInfoLog 					2113
+#define OP_glGetRenderbufferParameteriv 					2114
+#define OP_glGetShaderiv 					2115
+#define OP_glGetShaderInfoLog 					2116
+#define OP_glGetShaderPrecisionFormat 					2117
+#define OP_glGetShaderSource 					2118
+#define OP_glGetString 					2119
+#define OP_glGetTexParameterfv 					2120
+#define OP_glGetTexParameteriv 					2121
+#define OP_glGetUniformfv 					2122
+#define OP_glGetUniformiv 					2123
+#define OP_glGetUniformLocation 					2124
+#define OP_glGetVertexAttribfv 					2125
+#define OP_glGetVertexAttribiv 					2126
+#define OP_glGetVertexAttribPointerv 					2127
+#define OP_glHint 					2128
+#define OP_glIsBuffer 					2129
+#define OP_glIsEnabled 					2130
+#define OP_glIsFramebuffer 					2131
+#define OP_glIsProgram 					2132
+#define OP_glIsRenderbuffer 					2133
+#define OP_glIsShader 					2134
+#define OP_glIsTexture 					2135
+#define OP_glLineWidth 					2136
+#define OP_glLinkProgram 					2137
+#define OP_glPixelStorei 					2138
+#define OP_glPolygonOffset 					2139
+#define OP_glReadPixels 					2140
+#define OP_glReleaseShaderCompiler 					2141
+#define OP_glRenderbufferStorage 					2142
+#define OP_glSampleCoverage 					2143
+#define OP_glScissor 					2144
+#define OP_glShaderBinary 					2145
+#define OP_glShaderSource 					2146
+#define OP_glStencilFunc 					2147
+#define OP_glStencilFuncSeparate 					2148
+#define OP_glStencilMask 					2149
+#define OP_glStencilMaskSeparate 					2150
+#define OP_glStencilOp 					2151
+#define OP_glStencilOpSeparate 					2152
+#define OP_glTexImage2D 					2153
+#define OP_glTexParameterf 					2154
+#define OP_glTexParameterfv 					2155
+#define OP_glTexParameteri 					2156
+#define OP_glTexParameteriv 					2157
+#define OP_glTexSubImage2D 					2158
+#define OP_glUniform1f 					2159
+#define OP_glUniform1fv 					2160
+#define OP_glUniform1i 					2161
+#define OP_glUniform1iv 					2162
+#define OP_glUniform2f 					2163
+#define OP_glUniform2fv 					2164
+#define OP_glUniform2i 					2165
+#define OP_glUniform2iv 					2166
+#define OP_glUniform3f 					2167
+#define OP_glUniform3fv 					2168
+#define OP_glUniform3i 					2169
+#define OP_glUniform3iv 					2170
+#define OP_glUniform4f 					2171
+#define OP_glUniform4fv 					2172
+#define OP_glUniform4i 					2173
+#define OP_glUniform4iv 					2174
+#define OP_glUniformMatrix2fv 					2175
+#define OP_glUniformMatrix3fv 					2176
+#define OP_glUniformMatrix4fv 					2177
+#define OP_glUseProgram 					2178
+#define OP_glValidateProgram 					2179
+#define OP_glVertexAttrib1f 					2180
+#define OP_glVertexAttrib1fv 					2181
+#define OP_glVertexAttrib2f 					2182
+#define OP_glVertexAttrib2fv 					2183
+#define OP_glVertexAttrib3f 					2184
+#define OP_glVertexAttrib3fv 					2185
+#define OP_glVertexAttrib4f 					2186
+#define OP_glVertexAttrib4fv 					2187
+#define OP_glVertexAttribPointer 					2188
+#define OP_glViewport 					2189
+#define OP_glEGLImageTargetTexture2DOES 					2190
+#define OP_glEGLImageTargetRenderbufferStorageOES 					2191
+#define OP_glGetProgramBinaryOES 					2192
+#define OP_glProgramBinaryOES 					2193
+#define OP_glMapBufferOES 					2194
+#define OP_glUnmapBufferOES 					2195
+#define OP_glTexImage3DOES 					2196
+#define OP_glTexSubImage3DOES 					2197
+#define OP_glCopyTexSubImage3DOES 					2198
+#define OP_glCompressedTexImage3DOES 					2199
+#define OP_glCompressedTexSubImage3DOES 					2200
+#define OP_glFramebufferTexture3DOES 					2201
+#define OP_glBindVertexArrayOES 					2202
+#define OP_glDeleteVertexArraysOES 					2203
+#define OP_glGenVertexArraysOES 					2204
+#define OP_glIsVertexArrayOES 					2205
+#define OP_glDiscardFramebufferEXT 					2206
+#define OP_glMultiDrawArraysEXT 					2207
+#define OP_glMultiDrawElementsEXT 					2208
+#define OP_glGetPerfMonitorGroupsAMD 					2209
+#define OP_glGetPerfMonitorCountersAMD 					2210
+#define OP_glGetPerfMonitorGroupStringAMD 					2211
+#define OP_glGetPerfMonitorCounterStringAMD 					2212
+#define OP_glGetPerfMonitorCounterInfoAMD 					2213
+#define OP_glGenPerfMonitorsAMD 					2214
+#define OP_glDeletePerfMonitorsAMD 					2215
+#define OP_glSelectPerfMonitorCountersAMD 					2216
+#define OP_glBeginPerfMonitorAMD 					2217
+#define OP_glEndPerfMonitorAMD 					2218
+#define OP_glGetPerfMonitorCounterDataAMD 					2219
+#define OP_glRenderbufferStorageMultisampleIMG 					2220
+#define OP_glFramebufferTexture2DMultisampleIMG 					2221
+#define OP_glDeleteFencesNV 					2222
+#define OP_glGenFencesNV 					2223
+#define OP_glIsFenceNV 					2224
+#define OP_glTestFenceNV 					2225
+#define OP_glGetFenceivNV 					2226
+#define OP_glFinishFenceNV 					2227
+#define OP_glSetFenceNV 					2228
+#define OP_glCoverageMaskNV 					2229
+#define OP_glCoverageOperationNV 					2230
+#define OP_glGetDriverControlsQCOM 					2231
+#define OP_glGetDriverControlStringQCOM 					2232
+#define OP_glEnableDriverControlQCOM 					2233
+#define OP_glDisableDriverControlQCOM 					2234
+#define OP_glExtGetTexturesQCOM 					2235
+#define OP_glExtGetBuffersQCOM 					2236
+#define OP_glExtGetRenderbuffersQCOM 					2237
+#define OP_glExtGetFramebuffersQCOM 					2238
+#define OP_glExtGetTexLevelParameterivQCOM 					2239
+#define OP_glExtTexObjectStateOverrideiQCOM 					2240
+#define OP_glExtGetTexSubImageQCOM 					2241
+#define OP_glExtGetBufferPointervQCOM 					2242
+#define OP_glExtGetShadersQCOM 					2243
+#define OP_glExtGetProgramsQCOM 					2244
+#define OP_glExtIsProgramBinaryQCOM 					2245
+#define OP_glExtGetProgramBinarySourceQCOM 					2246
+#define OP_glStartTilingQCOM 					2247
+#define OP_glEndTilingQCOM 					2248
+#define OP_glVertexAttribPointerData 					2249
+#define OP_glVertexAttribPointerOffset 					2250
+#define OP_glDrawElementsOffset 					2251
+#define OP_glDrawElementsData 					2252
+#define OP_glGetCompressedTextureFormats 					2253
+#define OP_glShaderString 					2254
+#define OP_glFinishRoundTrip 					2255
+#define OP_glGenVertexArrays 					2256
+#define OP_glBindVertexArray 					2257
+#define OP_glDeleteVertexArrays 					2258
+#define OP_glIsVertexArray 					2259
+#define OP_glMapBufferRange 					2260
+#define OP_glUnmapBuffer 					2261
+#define OP_glFlushMappedBufferRange 					2262
+#define OP_glMapBufferRangeAEMU 					2263
+#define OP_glUnmapBufferAEMU 					2264
+#define OP_glFlushMappedBufferRangeAEMU 					2265
+#define OP_glReadPixelsOffsetAEMU 					2266
+#define OP_glCompressedTexImage2DOffsetAEMU 					2267
+#define OP_glCompressedTexSubImage2DOffsetAEMU 					2268
+#define OP_glTexImage2DOffsetAEMU 					2269
+#define OP_glTexSubImage2DOffsetAEMU 					2270
+#define OP_glBindBufferRange 					2271
+#define OP_glBindBufferBase 					2272
+#define OP_glCopyBufferSubData 					2273
+#define OP_glClearBufferiv 					2274
+#define OP_glClearBufferuiv 					2275
+#define OP_glClearBufferfv 					2276
+#define OP_glClearBufferfi 					2277
+#define OP_glGetBufferParameteri64v 					2278
+#define OP_glGetBufferPointerv 					2279
+#define OP_glUniformBlockBinding 					2280
+#define OP_glGetUniformBlockIndex 					2281
+#define OP_glGetUniformIndices 					2282
+#define OP_glGetUniformIndicesAEMU 					2283
+#define OP_glGetActiveUniformBlockiv 					2284
+#define OP_glGetActiveUniformBlockName 					2285
+#define OP_glUniform1ui 					2286
+#define OP_glUniform2ui 					2287
+#define OP_glUniform3ui 					2288
+#define OP_glUniform4ui 					2289
+#define OP_glUniform1uiv 					2290
+#define OP_glUniform2uiv 					2291
+#define OP_glUniform3uiv 					2292
+#define OP_glUniform4uiv 					2293
+#define OP_glUniformMatrix2x3fv 					2294
+#define OP_glUniformMatrix3x2fv 					2295
+#define OP_glUniformMatrix2x4fv 					2296
+#define OP_glUniformMatrix4x2fv 					2297
+#define OP_glUniformMatrix3x4fv 					2298
+#define OP_glUniformMatrix4x3fv 					2299
+#define OP_glGetUniformuiv 					2300
+#define OP_glGetActiveUniformsiv 					2301
+#define OP_glVertexAttribI4i 					2302
+#define OP_glVertexAttribI4ui 					2303
+#define OP_glVertexAttribI4iv 					2304
+#define OP_glVertexAttribI4uiv 					2305
+#define OP_glVertexAttribIPointer 					2306
+#define OP_glVertexAttribIPointerOffsetAEMU 					2307
+#define OP_glVertexAttribIPointerDataAEMU 					2308
+#define OP_glGetVertexAttribIiv 					2309
+#define OP_glGetVertexAttribIuiv 					2310
+#define OP_glVertexAttribDivisor 					2311
+#define OP_glDrawArraysInstanced 					2312
+#define OP_glDrawElementsInstanced 					2313
+#define OP_glDrawElementsInstancedDataAEMU 					2314
+#define OP_glDrawElementsInstancedOffsetAEMU 					2315
+#define OP_glDrawRangeElements 					2316
+#define OP_glDrawRangeElementsDataAEMU 					2317
+#define OP_glDrawRangeElementsOffsetAEMU 					2318
+#define OP_glFenceSync 					2319
+#define OP_glClientWaitSync 					2320
+#define OP_glWaitSync 					2321
+#define OP_glDeleteSync 					2322
+#define OP_glIsSync 					2323
+#define OP_glGetSynciv 					2324
+#define OP_glFenceSyncAEMU 					2325
+#define OP_glClientWaitSyncAEMU 					2326
+#define OP_glWaitSyncAEMU 					2327
+#define OP_glDeleteSyncAEMU 					2328
+#define OP_glIsSyncAEMU 					2329
+#define OP_glGetSyncivAEMU 					2330
+#define OP_glDrawBuffers 					2331
+#define OP_glReadBuffer 					2332
+#define OP_glBlitFramebuffer 					2333
+#define OP_glInvalidateFramebuffer 					2334
+#define OP_glInvalidateSubFramebuffer 					2335
+#define OP_glFramebufferTextureLayer 					2336
+#define OP_glRenderbufferStorageMultisample 					2337
+#define OP_glTexStorage2D 					2338
+#define OP_glGetInternalformativ 					2339
+#define OP_glBeginTransformFeedback 					2340
+#define OP_glEndTransformFeedback 					2341
+#define OP_glGenTransformFeedbacks 					2342
+#define OP_glDeleteTransformFeedbacks 					2343
+#define OP_glBindTransformFeedback 					2344
+#define OP_glPauseTransformFeedback 					2345
+#define OP_glResumeTransformFeedback 					2346
+#define OP_glIsTransformFeedback 					2347
+#define OP_glTransformFeedbackVaryings 					2348
+#define OP_glTransformFeedbackVaryingsAEMU 					2349
+#define OP_glGetTransformFeedbackVarying 					2350
+#define OP_glGenSamplers 					2351
+#define OP_glDeleteSamplers 					2352
+#define OP_glBindSampler 					2353
+#define OP_glSamplerParameterf 					2354
+#define OP_glSamplerParameteri 					2355
+#define OP_glSamplerParameterfv 					2356
+#define OP_glSamplerParameteriv 					2357
+#define OP_glGetSamplerParameterfv 					2358
+#define OP_glGetSamplerParameteriv 					2359
+#define OP_glIsSampler 					2360
+#define OP_glGenQueries 					2361
+#define OP_glDeleteQueries 					2362
+#define OP_glBeginQuery 					2363
+#define OP_glEndQuery 					2364
+#define OP_glGetQueryiv 					2365
+#define OP_glGetQueryObjectuiv 					2366
+#define OP_glIsQuery 					2367
+#define OP_glProgramParameteri 					2368
+#define OP_glProgramBinary 					2369
+#define OP_glGetProgramBinary 					2370
+#define OP_glGetFragDataLocation 					2371
+#define OP_glGetInteger64v 					2372
+#define OP_glGetIntegeri_v 					2373
+#define OP_glGetInteger64i_v 					2374
+#define OP_glTexImage3D 					2375
+#define OP_glTexImage3DOffsetAEMU 					2376
+#define OP_glTexStorage3D 					2377
+#define OP_glTexSubImage3D 					2378
+#define OP_glTexSubImage3DOffsetAEMU 					2379
+#define OP_glCompressedTexImage3D 					2380
+#define OP_glCompressedTexImage3DOffsetAEMU 					2381
+#define OP_glCompressedTexSubImage3D 					2382
+#define OP_glCompressedTexSubImage3DOffsetAEMU 					2383
+#define OP_glCopyTexSubImage3D 					2384
+#define OP_glGetStringi 					2385
+#define OP_glGetBooleani_v 					2386
+#define OP_glMemoryBarrier 					2387
+#define OP_glMemoryBarrierByRegion 					2388
+#define OP_glGenProgramPipelines 					2389
+#define OP_glDeleteProgramPipelines 					2390
+#define OP_glBindProgramPipeline 					2391
+#define OP_glGetProgramPipelineiv 					2392
+#define OP_glGetProgramPipelineInfoLog 					2393
+#define OP_glValidateProgramPipeline 					2394
+#define OP_glIsProgramPipeline 					2395
+#define OP_glUseProgramStages 					2396
+#define OP_glActiveShaderProgram 					2397
+#define OP_glCreateShaderProgramv 					2398
+#define OP_glCreateShaderProgramvAEMU 					2399
+#define OP_glProgramUniform1f 					2400
+#define OP_glProgramUniform2f 					2401
+#define OP_glProgramUniform3f 					2402
+#define OP_glProgramUniform4f 					2403
+#define OP_glProgramUniform1i 					2404
+#define OP_glProgramUniform2i 					2405
+#define OP_glProgramUniform3i 					2406
+#define OP_glProgramUniform4i 					2407
+#define OP_glProgramUniform1ui 					2408
+#define OP_glProgramUniform2ui 					2409
+#define OP_glProgramUniform3ui 					2410
+#define OP_glProgramUniform4ui 					2411
+#define OP_glProgramUniform1fv 					2412
+#define OP_glProgramUniform2fv 					2413
+#define OP_glProgramUniform3fv 					2414
+#define OP_glProgramUniform4fv 					2415
+#define OP_glProgramUniform1iv 					2416
+#define OP_glProgramUniform2iv 					2417
+#define OP_glProgramUniform3iv 					2418
+#define OP_glProgramUniform4iv 					2419
+#define OP_glProgramUniform1uiv 					2420
+#define OP_glProgramUniform2uiv 					2421
+#define OP_glProgramUniform3uiv 					2422
+#define OP_glProgramUniform4uiv 					2423
+#define OP_glProgramUniformMatrix2fv 					2424
+#define OP_glProgramUniformMatrix3fv 					2425
+#define OP_glProgramUniformMatrix4fv 					2426
+#define OP_glProgramUniformMatrix2x3fv 					2427
+#define OP_glProgramUniformMatrix3x2fv 					2428
+#define OP_glProgramUniformMatrix2x4fv 					2429
+#define OP_glProgramUniformMatrix4x2fv 					2430
+#define OP_glProgramUniformMatrix3x4fv 					2431
+#define OP_glProgramUniformMatrix4x3fv 					2432
+#define OP_glGetProgramInterfaceiv 					2433
+#define OP_glGetProgramResourceiv 					2434
+#define OP_glGetProgramResourceIndex 					2435
+#define OP_glGetProgramResourceLocation 					2436
+#define OP_glGetProgramResourceName 					2437
+#define OP_glBindImageTexture 					2438
+#define OP_glDispatchCompute 					2439
+#define OP_glDispatchComputeIndirect 					2440
+#define OP_glBindVertexBuffer 					2441
+#define OP_glVertexAttribBinding 					2442
+#define OP_glVertexAttribFormat 					2443
+#define OP_glVertexAttribIFormat 					2444
+#define OP_glVertexBindingDivisor 					2445
+#define OP_glDrawArraysIndirect 					2446
+#define OP_glDrawArraysIndirectDataAEMU 					2447
+#define OP_glDrawArraysIndirectOffsetAEMU 					2448
+#define OP_glDrawElementsIndirect 					2449
+#define OP_glDrawElementsIndirectDataAEMU 					2450
+#define OP_glDrawElementsIndirectOffsetAEMU 					2451
+#define OP_glTexStorage2DMultisample 					2452
+#define OP_glSampleMaski 					2453
+#define OP_glGetMultisamplefv 					2454
+#define OP_glFramebufferParameteri 					2455
+#define OP_glGetFramebufferParameteriv 					2456
+#define OP_glGetTexLevelParameterfv 					2457
+#define OP_glGetTexLevelParameteriv 					2458
+#define OP_glMapBufferRangeDMA 					2459
+#define OP_glUnmapBufferDMA 					2460
+#define OP_glMapBufferRangeDirect 					2461
+#define OP_glUnmapBufferDirect 					2462
+#define OP_glFlushMappedBufferRangeDirect 					2463
+#define OP_glGetGraphicsResetStatusEXT 					2464
+#define OP_glReadnPixelsEXT 					2465
+#define OP_glGetnUniformfvEXT 					2466
+#define OP_glGetnUniformivEXT 					2467
+#define OP_glDrawArraysNullAEMU 					2468
+#define OP_glDrawElementsNullAEMU 					2469
+#define OP_glDrawElementsOffsetNullAEMU 					2470
+#define OP_glDrawElementsDataNullAEMU 					2471
+#define OP_glUnmapBufferAsyncAEMU 					2472
+#define OP_glFlushMappedBufferRangeAEMU2 					2473
+#define OP_glBufferDataSyncAEMU 					2474
+#define OP_glTexBufferOES 					2475
+#define OP_glTexBufferRangeOES 					2476
+#define OP_glTexBufferEXT 					2477
+#define OP_glTexBufferRangeEXT 					2478
+#define OP_glEnableiEXT 					2479
+#define OP_glDisableiEXT 					2480
+#define OP_glBlendEquationiEXT 					2481
+#define OP_glBlendEquationSeparateiEXT 					2482
+#define OP_glBlendFunciEXT 					2483
+#define OP_glBlendFuncSeparateiEXT 					2484
+#define OP_glColorMaskiEXT 					2485
+#define OP_glIsEnablediEXT 					2486
+#define OP_last 					2487
+
+
+#endif
diff --git a/system/GLESv2_enc/gl2_types.h b/system/GLESv2_enc/gl2_types.h
new file mode 100644
index 0000000..bfff61d
--- /dev/null
+++ b/system/GLESv2_enc/gl2_types.h
@@ -0,0 +1,21 @@
+/*
+* Copyright (C) 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#ifndef _GL_2_TYPES_H_
+#define _GL_2_TYPES_H_
+#include "gl_base_types.h"
+
+typedef void *GLvoidptr;
+#endif
diff --git a/system/OpenglSystemCommon/AddressSpaceStream.cpp b/system/OpenglSystemCommon/AddressSpaceStream.cpp
new file mode 100644
index 0000000..cb0d58a
--- /dev/null
+++ b/system/OpenglSystemCommon/AddressSpaceStream.cpp
@@ -0,0 +1,826 @@
+/*
+* Copyright (C) 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#include "AddressSpaceStream.h"
+
+#include "VirtGpu.h"
+#include "aemu/base/Tracing.h"
+#include "util.h"
+#include "virtgpu_gfxstream_protocol.h"
+
+#if PLATFORM_SDK_VERSION < 26
+#include <cutils/log.h>
+#else
+#include <log/log.h>
+#endif
+#include <cutils/properties.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+static const size_t kReadSize = 512 * 1024;
+static const size_t kWriteOffset = kReadSize;
+
+AddressSpaceStream* createAddressSpaceStream(size_t ignored_bufSize,
+                                             HealthMonitor<>* healthMonitor) {
+    // Ignore incoming ignored_bufSize
+    (void)ignored_bufSize;
+
+    auto handle = goldfish_address_space_open();
+    address_space_handle_t child_device_handle;
+
+    if (!goldfish_address_space_set_subdevice_type(handle, GoldfishAddressSpaceSubdeviceType::Graphics, &child_device_handle)) {
+        ALOGE("AddressSpaceStream::create failed (initial device create)\n");
+        goldfish_address_space_close(handle);
+        return nullptr;
+    }
+
+    struct address_space_ping request;
+    request.metadata = ASG_GET_RING;
+    if (!goldfish_address_space_ping(child_device_handle, &request)) {
+        ALOGE("AddressSpaceStream::create failed (get ring)\n");
+        goldfish_address_space_close(child_device_handle);
+        return nullptr;
+    }
+
+    uint64_t ringOffset = request.metadata;
+
+    request.metadata = ASG_GET_BUFFER;
+    if (!goldfish_address_space_ping(child_device_handle, &request)) {
+        ALOGE("AddressSpaceStream::create failed (get buffer)\n");
+        goldfish_address_space_close(child_device_handle);
+        return nullptr;
+    }
+
+    uint64_t bufferOffset = request.metadata;
+    uint64_t bufferSize = request.size;
+
+    if (!goldfish_address_space_claim_shared(
+        child_device_handle, ringOffset, sizeof(asg_ring_storage))) {
+        ALOGE("AddressSpaceStream::create failed (claim ring storage)\n");
+        goldfish_address_space_close(child_device_handle);
+        return nullptr;
+    }
+
+    if (!goldfish_address_space_claim_shared(
+        child_device_handle, bufferOffset, bufferSize)) {
+        ALOGE("AddressSpaceStream::create failed (claim buffer storage)\n");
+        goldfish_address_space_unclaim_shared(child_device_handle, ringOffset);
+        goldfish_address_space_close(child_device_handle);
+        return nullptr;
+    }
+
+    char* ringPtr = (char*)goldfish_address_space_map(
+        child_device_handle, ringOffset, sizeof(struct asg_ring_storage));
+
+    if (!ringPtr) {
+        ALOGE("AddressSpaceStream::create failed (map ring storage)\n");
+        goldfish_address_space_unclaim_shared(child_device_handle, bufferOffset);
+        goldfish_address_space_unclaim_shared(child_device_handle, ringOffset);
+        goldfish_address_space_close(child_device_handle);
+        return nullptr;
+    }
+
+    char* bufferPtr = (char*)goldfish_address_space_map(
+        child_device_handle, bufferOffset, bufferSize);
+
+    if (!bufferPtr) {
+        ALOGE("AddressSpaceStream::create failed (map buffer storage)\n");
+        goldfish_address_space_unmap(ringPtr, sizeof(struct asg_ring_storage));
+        goldfish_address_space_unclaim_shared(child_device_handle, bufferOffset);
+        goldfish_address_space_unclaim_shared(child_device_handle, ringOffset);
+        goldfish_address_space_close(child_device_handle);
+        return nullptr;
+    }
+
+    struct asg_context context =
+        asg_context_create(
+            ringPtr, bufferPtr, bufferSize);
+
+    request.metadata = ASG_SET_VERSION;
+    request.size = 1; // version 1
+
+    if (!goldfish_address_space_ping(child_device_handle, &request)) {
+        ALOGE("AddressSpaceStream::create failed (get buffer)\n");
+        goldfish_address_space_unmap(bufferPtr, bufferSize);
+        goldfish_address_space_unmap(ringPtr, sizeof(struct asg_ring_storage));
+        goldfish_address_space_unclaim_shared(child_device_handle, bufferOffset);
+        goldfish_address_space_unclaim_shared(child_device_handle, ringOffset);
+        goldfish_address_space_close(child_device_handle);
+        return nullptr;
+    }
+
+    uint32_t version = request.size;
+
+    context.ring_config->transfer_mode = 1;
+    context.ring_config->host_consumed_pos = 0;
+    context.ring_config->guest_write_pos = 0;
+
+    struct address_space_ops ops = {
+        .open = goldfish_address_space_open,
+        .close = goldfish_address_space_close,
+        .claim_shared = goldfish_address_space_claim_shared,
+        .unclaim_shared = goldfish_address_space_unclaim_shared,
+        .map = goldfish_address_space_map,
+        .unmap = goldfish_address_space_unmap,
+        .set_subdevice_type = goldfish_address_space_set_subdevice_type,
+        .ping = goldfish_address_space_ping,
+    };
+
+    AddressSpaceStream* res =
+        new AddressSpaceStream(
+            child_device_handle, version, context,
+            ringOffset, bufferOffset, ops, healthMonitor);
+
+    return res;
+}
+
+address_space_handle_t virtgpu_address_space_open() {
+    return (address_space_handle_t)(-EINVAL);
+}
+
+void virtgpu_address_space_close(address_space_handle_t fd) {
+    // Handle opened by VirtioGpuDevice wrapper
+}
+
+bool virtgpu_address_space_ping(address_space_handle_t fd, struct address_space_ping* info) {
+    int ret;
+    struct VirtGpuExecBuffer exec = {};
+    VirtGpuDevice& instance = VirtGpuDevice::getInstance();
+    struct gfxstreamContextPing ping = {};
+
+    ping.hdr.opCode = GFXSTREAM_CONTEXT_PING;
+    ping.resourceId = info->resourceId;
+
+    exec.command = static_cast<void*>(&ping);
+    exec.command_size = sizeof(ping);
+
+    ret = instance.execBuffer(exec, nullptr);
+    if (ret)
+        return false;
+
+    return true;
+}
+
+AddressSpaceStream* createVirtioGpuAddressSpaceStream(HealthMonitor<>* healthMonitor) {
+    VirtGpuBlobPtr pipe, blob;
+    VirtGpuBlobMappingPtr pipeMapping, blobMapping;
+    struct VirtGpuExecBuffer exec = {};
+    struct VirtGpuCreateBlob blobCreate = {};
+    struct gfxstreamContextCreate contextCreate = {};
+
+    char* blobAddr, *bufferPtr;
+    int ret;
+
+    VirtGpuDevice& instance = VirtGpuDevice::getInstance();
+    VirtGpuCaps caps = instance.getCaps();
+
+    blobCreate.blobId = 0;
+    blobCreate.blobMem = kBlobMemHost3d;
+    blobCreate.flags = kBlobFlagMappable;
+    blobCreate.size = ALIGN(caps.gfxstreamCapset.ringSize + caps.gfxstreamCapset.bufferSize,
+                            caps.gfxstreamCapset.blobAlignment);
+    blob = instance.createBlob(blobCreate);
+    if (!blob)
+        return nullptr;
+
+    // Context creation command
+    contextCreate.hdr.opCode = GFXSTREAM_CONTEXT_CREATE;
+    contextCreate.resourceId = blob->getResourceHandle();
+
+    exec.command = static_cast<void*>(&contextCreate);
+    exec.command_size = sizeof(contextCreate);
+
+    ret = instance.execBuffer(exec, blob);
+    if (ret)
+        return nullptr;
+
+    // Wait occurs on global timeline -- should we use context specific one?
+    ret = blob->wait();
+    if (ret)
+        return nullptr;
+
+    blobMapping = blob->createMapping();
+    if (!blobMapping)
+        return nullptr;
+
+    blobAddr = reinterpret_cast<char*>(blobMapping->asRawPtr());
+
+    bufferPtr = blobAddr + sizeof(struct asg_ring_storage);
+    struct asg_context context =
+        asg_context_create(blobAddr, bufferPtr, caps.gfxstreamCapset.bufferSize);
+
+    context.ring_config->transfer_mode = 1;
+    context.ring_config->host_consumed_pos = 0;
+    context.ring_config->guest_write_pos = 0;
+
+    struct address_space_ops ops = {
+        .open = virtgpu_address_space_open,
+        .close = virtgpu_address_space_close,
+        .ping = virtgpu_address_space_ping,
+    };
+
+    AddressSpaceStream* res =
+            new AddressSpaceStream((address_space_handle_t)(-1), 1, context, 0, 0, ops, healthMonitor);
+
+    res->setMapping(blobMapping);
+    res->setResourceId(contextCreate.resourceId);
+    return res;
+}
+
+AddressSpaceStream::AddressSpaceStream(
+    address_space_handle_t handle,
+    uint32_t version,
+    struct asg_context context,
+    uint64_t ringOffset,
+    uint64_t writeBufferOffset,
+    struct address_space_ops ops,
+    HealthMonitor<>* healthMonitor) :
+    IOStream(context.ring_config->flush_interval),
+    m_ops(ops),
+    m_tmpBuf(0),
+    m_tmpBufSize(0),
+    m_tmpBufXferSize(0),
+    m_usingTmpBuf(0),
+    m_readBuf(0),
+    m_read(0),
+    m_readLeft(0),
+    m_handle(handle),
+    m_version(version),
+    m_context(context),
+    m_ringOffset(ringOffset),
+    m_writeBufferOffset(writeBufferOffset),
+    m_writeBufferSize(context.ring_config->buffer_size),
+    m_writeBufferMask(m_writeBufferSize - 1),
+    m_buf((unsigned char*)context.buffer),
+    m_writeStart(m_buf),
+    m_writeStep(context.ring_config->flush_interval),
+    m_notifs(0),
+    m_written(0),
+    m_backoffIters(0),
+    m_backoffFactor(1),
+    m_ringStorageSize(sizeof(struct asg_ring_storage) + m_writeBufferSize),
+    m_healthMonitor(healthMonitor) {
+    // We'll use this in the future, but at the moment,
+    // it's a potential compile Werror.
+    (void)m_ringStorageSize;
+    (void)m_version;
+}
+
+AddressSpaceStream::~AddressSpaceStream() {
+    flush();
+    ensureType3Finished();
+    ensureType1Finished();
+
+    if (!m_mapping) {
+        m_ops.unmap(m_context.to_host, sizeof(struct asg_ring_storage));
+        m_ops.unmap(m_context.buffer, m_writeBufferSize);
+        m_ops.unclaim_shared(m_handle, m_ringOffset);
+        m_ops.unclaim_shared(m_handle, m_writeBufferOffset);
+    }
+
+    m_ops.close(m_handle);
+    if (m_readBuf) free(m_readBuf);
+    if (m_tmpBuf) free(m_tmpBuf);
+}
+
+size_t AddressSpaceStream::idealAllocSize(size_t len) {
+    if (len > m_writeStep) return len;
+    return m_writeStep;
+}
+
+void *AddressSpaceStream::allocBuffer(size_t minSize) {
+    auto watchdog = WATCHDOG_BUILDER(m_healthMonitor, "ASG watchdog").build();
+    AEMU_SCOPED_TRACE("allocBuffer");
+    ensureType3Finished();
+
+    if (!m_readBuf) {
+        m_readBuf = (unsigned char*)malloc(kReadSize);
+    }
+
+    size_t allocSize =
+        (m_writeStep < minSize ? minSize : m_writeStep);
+
+    if (m_writeStep < allocSize) {
+        if (!m_tmpBuf) {
+            m_tmpBufSize = allocSize * 2;
+            m_tmpBuf = (unsigned char*)malloc(m_tmpBufSize);
+        }
+
+        if (m_tmpBufSize < allocSize) {
+            m_tmpBufSize = allocSize * 2;
+            m_tmpBuf = (unsigned char*)realloc(m_tmpBuf, m_tmpBufSize);
+        }
+
+        if (!m_usingTmpBuf) {
+            flush();
+        }
+
+        m_usingTmpBuf = true;
+        m_tmpBufXferSize = allocSize;
+        return m_tmpBuf;
+    } else {
+        if (m_usingTmpBuf) {
+            writeFully(m_tmpBuf, m_tmpBufXferSize);
+            m_usingTmpBuf = false;
+            m_tmpBufXferSize = 0;
+        }
+
+        return m_writeStart;
+    }
+}
+
+int AddressSpaceStream::commitBuffer(size_t size)
+{
+    if (size == 0) return 0;
+
+    if (m_usingTmpBuf) {
+        writeFully(m_tmpBuf, size);
+        m_tmpBufXferSize = 0;
+        m_usingTmpBuf = false;
+        return 0;
+    } else {
+        int res = type1Write(m_writeStart - m_buf, size);
+        advanceWrite();
+        return res;
+    }
+}
+
+const unsigned char *AddressSpaceStream::readFully(void *ptr, size_t totalReadSize)
+{
+
+    unsigned char* userReadBuf = static_cast<unsigned char*>(ptr);
+
+    if (!userReadBuf) {
+        if (totalReadSize > 0) {
+            ALOGE("AddressSpaceStream::commitBufferAndReadFully failed, userReadBuf=NULL, totalReadSize %zu, lethal"
+                    " error, exiting.", totalReadSize);
+            abort();
+        }
+        return nullptr;
+    }
+
+    // Advance buffered read if not yet consumed.
+    size_t remaining = totalReadSize;
+    size_t bufferedReadSize =
+        m_readLeft < remaining ? m_readLeft : remaining;
+
+    if (bufferedReadSize) {
+        memcpy(userReadBuf,
+               m_readBuf + (m_read - m_readLeft),
+               bufferedReadSize);
+        remaining -= bufferedReadSize;
+        m_readLeft -= bufferedReadSize;
+    }
+
+    if (!remaining) return userReadBuf;
+
+    // Read up to kReadSize bytes if all buffered read has been consumed.
+    size_t maxRead = m_readLeft ? 0 : kReadSize;
+    ssize_t actual = 0;
+
+    if (maxRead) {
+        actual = speculativeRead(m_readBuf, maxRead);
+
+        // Updated buffered read size.
+        if (actual > 0) {
+            m_read = m_readLeft = actual;
+        }
+
+        if (actual == 0) {
+            ALOGD("%s: end of pipe", __FUNCTION__);
+            return NULL;
+        }
+    }
+
+    // Consume buffered read and read more if necessary.
+    while (remaining) {
+        bufferedReadSize = m_readLeft < remaining ? m_readLeft : remaining;
+        if (bufferedReadSize) {
+            memcpy(userReadBuf + (totalReadSize - remaining),
+                   m_readBuf + (m_read - m_readLeft),
+                   bufferedReadSize);
+            remaining -= bufferedReadSize;
+            m_readLeft -= bufferedReadSize;
+            continue;
+        }
+
+        actual = speculativeRead(m_readBuf, kReadSize);
+
+        if (actual == 0) {
+            ALOGD("%s: Failed reading from pipe: %d", __FUNCTION__,  errno);
+            return NULL;
+        }
+
+        if (actual > 0) {
+            m_read = m_readLeft = actual;
+            continue;
+        }
+    }
+
+    resetBackoff();
+    return userReadBuf;
+}
+
+const unsigned char *AddressSpaceStream::read(void *buf, size_t *inout_len) {
+    unsigned char* dst = (unsigned char*)buf;
+    size_t wanted = *inout_len;
+    ssize_t actual = speculativeRead(dst, wanted);
+
+    if (actual >= 0) {
+        *inout_len = actual;
+    } else {
+        return nullptr;
+    }
+
+    return (const unsigned char*)dst;
+}
+
+int AddressSpaceStream::writeFully(const void *buf, size_t size)
+{
+    auto watchdog = WATCHDOG_BUILDER(m_healthMonitor, "ASG watchdog").build();
+    AEMU_SCOPED_TRACE("writeFully");
+    ensureType3Finished();
+    ensureType1Finished();
+
+    m_context.ring_config->transfer_size = size;
+    m_context.ring_config->transfer_mode = 3;
+
+    size_t sent = 0;
+    size_t preferredChunkSize = m_writeBufferSize / 4;
+    size_t chunkSize = size < preferredChunkSize ? size : preferredChunkSize;
+    const uint8_t* bufferBytes = (const uint8_t*)buf;
+
+    bool hostPinged = false;
+    while (sent < size) {
+        size_t remaining = size - sent;
+        size_t sendThisTime = remaining < chunkSize ? remaining : chunkSize;
+
+        long sentChunks =
+            ring_buffer_view_write(
+                m_context.to_host_large_xfer.ring,
+                &m_context.to_host_large_xfer.view,
+                bufferBytes + sent, sendThisTime, 1);
+
+        if (!hostPinged && *(m_context.host_state) != ASG_HOST_STATE_CAN_CONSUME &&
+            *(m_context.host_state) != ASG_HOST_STATE_RENDERING) {
+            notifyAvailable();
+            hostPinged = true;
+        }
+
+        if (sentChunks == 0) {
+            ring_buffer_yield();
+            backoff();
+        }
+
+        sent += sentChunks * sendThisTime;
+
+        if (isInError()) {
+            return -1;
+        }
+    }
+
+    bool isRenderingAfter = ASG_HOST_STATE_RENDERING == __atomic_load_n(m_context.host_state, __ATOMIC_ACQUIRE);
+
+    if (!isRenderingAfter) {
+        notifyAvailable();
+    }
+
+    ensureType3Finished();
+
+    resetBackoff();
+    m_context.ring_config->transfer_mode = 1;
+    m_written += size;
+
+    float mb = (float)m_written / 1048576.0f;
+    if (mb > 100.0f) {
+        ALOGD("%s: %f mb in %d notifs. %f mb/notif\n", __func__,
+              mb, m_notifs, m_notifs ? mb / (float)m_notifs : 0.0f);
+        m_notifs = 0;
+        m_written = 0;
+    }
+    return 0;
+}
+
+int AddressSpaceStream::writeFullyAsync(const void *buf, size_t size)
+{
+    auto watchdog = WATCHDOG_BUILDER(m_healthMonitor, "ASG watchdog").build();
+    AEMU_SCOPED_TRACE("writeFullyAsync");
+    ensureType3Finished();
+    ensureType1Finished();
+
+    __atomic_store_n(&m_context.ring_config->transfer_size, size, __ATOMIC_RELEASE);
+    m_context.ring_config->transfer_mode = 3;
+
+    size_t sent = 0;
+    size_t preferredChunkSize = m_writeBufferSize / 2;
+    size_t chunkSize = size < preferredChunkSize ? size : preferredChunkSize;
+    const uint8_t* bufferBytes = (const uint8_t*)buf;
+
+    bool pingedHost = false;
+
+    while (sent < size) {
+        size_t remaining = size - sent;
+        size_t sendThisTime = remaining < chunkSize ? remaining : chunkSize;
+
+        long sentChunks =
+            ring_buffer_view_write(
+                m_context.to_host_large_xfer.ring,
+                &m_context.to_host_large_xfer.view,
+                bufferBytes + sent, sendThisTime, 1);
+
+        uint32_t hostState = __atomic_load_n(m_context.host_state, __ATOMIC_ACQUIRE);
+
+        if (!pingedHost &&
+            hostState != ASG_HOST_STATE_CAN_CONSUME &&
+            hostState != ASG_HOST_STATE_RENDERING) {
+            pingedHost = true;
+            notifyAvailable();
+        }
+
+        if (sentChunks == 0) {
+            ring_buffer_yield();
+            backoff();
+        }
+
+        sent += sentChunks * sendThisTime;
+
+        if (isInError()) {
+            return -1;
+        }
+    }
+
+
+    bool isRenderingAfter = ASG_HOST_STATE_RENDERING == __atomic_load_n(m_context.host_state, __ATOMIC_ACQUIRE);
+
+    if (!isRenderingAfter) {
+        notifyAvailable();
+    }
+
+    resetBackoff();
+    m_context.ring_config->transfer_mode = 1;
+    m_written += size;
+
+    float mb = (float)m_written / 1048576.0f;
+    if (mb > 100.0f) {
+        ALOGD("%s: %f mb in %d notifs. %f mb/notif\n", __func__,
+              mb, m_notifs, m_notifs ? mb / (float)m_notifs : 0.0f);
+        m_notifs = 0;
+        m_written = 0;
+    }
+    return 0;
+}
+
+const unsigned char *AddressSpaceStream::commitBufferAndReadFully(
+    size_t writeSize, void *userReadBufPtr, size_t totalReadSize) {
+
+    if (m_usingTmpBuf) {
+        writeFully(m_tmpBuf, writeSize);
+        m_usingTmpBuf = false;
+        m_tmpBufXferSize = 0;
+        return readFully(userReadBufPtr, totalReadSize);
+    } else {
+        commitBuffer(writeSize);
+        return readFully(userReadBufPtr, totalReadSize);
+    }
+}
+
+bool AddressSpaceStream::isInError() const {
+    return 1 == m_context.ring_config->in_error;
+}
+
+ssize_t AddressSpaceStream::speculativeRead(unsigned char* readBuffer, size_t trySize) {
+    ensureType3Finished();
+    ensureType1Finished();
+
+    size_t actuallyRead = 0;
+
+    while (!actuallyRead) {
+
+        uint32_t readAvail =
+            ring_buffer_available_read(
+                m_context.from_host_large_xfer.ring,
+                &m_context.from_host_large_xfer.view);
+
+        if (!readAvail) {
+            ring_buffer_yield();
+            backoff();
+            continue;
+        }
+
+        uint32_t toRead = readAvail > trySize ?  trySize : readAvail;
+
+        long stepsRead = ring_buffer_view_read(
+            m_context.from_host_large_xfer.ring,
+            &m_context.from_host_large_xfer.view,
+            readBuffer, toRead, 1);
+
+        actuallyRead += stepsRead * toRead;
+
+        if (isInError()) {
+            return -1;
+        }
+    }
+
+    return actuallyRead;
+}
+
+void AddressSpaceStream::notifyAvailable() {
+    auto watchdog = WATCHDOG_BUILDER(m_healthMonitor, "ASG watchdog").build();
+    AEMU_SCOPED_TRACE("PING");
+    struct address_space_ping request;
+    request.metadata = ASG_NOTIFY_AVAILABLE;
+    request.resourceId = m_resourceId;
+    m_ops.ping(m_handle, &request);
+    ++m_notifs;
+}
+
+uint32_t AddressSpaceStream::getRelativeBufferPos(uint32_t pos) {
+    return pos & m_writeBufferMask;
+}
+
+void AddressSpaceStream::advanceWrite() {
+    m_writeStart += m_context.ring_config->flush_interval;
+
+    if (m_writeStart == m_buf + m_context.ring_config->buffer_size) {
+        m_writeStart = m_buf;
+    }
+}
+
+void AddressSpaceStream::ensureConsumerFinishing() {
+    uint32_t currAvailRead = ring_buffer_available_read(m_context.to_host, 0);
+
+    while (currAvailRead) {
+        ring_buffer_yield();
+        uint32_t nextAvailRead = ring_buffer_available_read(m_context.to_host, 0);
+
+        if (nextAvailRead != currAvailRead) {
+            break;
+        }
+
+        if (*(m_context.host_state) != ASG_HOST_STATE_CAN_CONSUME &&
+            *(m_context.host_state) != ASG_HOST_STATE_RENDERING) {
+            notifyAvailable();
+            break;
+        }
+
+        backoff();
+    }
+}
+
+void AddressSpaceStream::ensureType1Finished() {
+    auto watchdog = WATCHDOG_BUILDER(m_healthMonitor, "ASG watchdog").build();
+    AEMU_SCOPED_TRACE("ensureType1Finished");
+
+    uint32_t currAvailRead =
+        ring_buffer_available_read(m_context.to_host, 0);
+
+    while (currAvailRead) {
+        backoff();
+        ring_buffer_yield();
+        currAvailRead = ring_buffer_available_read(m_context.to_host, 0);
+        if (isInError()) {
+            return;
+        }
+    }
+}
+
+void AddressSpaceStream::ensureType3Finished() {
+    auto watchdog = WATCHDOG_BUILDER(m_healthMonitor, "ASG watchdog").build();
+    AEMU_SCOPED_TRACE("ensureType3Finished");
+    uint32_t availReadLarge =
+        ring_buffer_available_read(
+            m_context.to_host_large_xfer.ring,
+            &m_context.to_host_large_xfer.view);
+    while (availReadLarge) {
+        ring_buffer_yield();
+        backoff();
+        availReadLarge =
+            ring_buffer_available_read(
+                m_context.to_host_large_xfer.ring,
+                &m_context.to_host_large_xfer.view);
+        if (*(m_context.host_state) != ASG_HOST_STATE_CAN_CONSUME &&
+            *(m_context.host_state) != ASG_HOST_STATE_RENDERING) {
+            notifyAvailable();
+        }
+        if (isInError()) {
+            return;
+        }
+    }
+}
+
+int AddressSpaceStream::type1Write(uint32_t bufferOffset, size_t size) {
+
+    auto watchdog = WATCHDOG_BUILDER(m_healthMonitor, "ASG watchdog").build();
+    AEMU_SCOPED_TRACE("type1Write");
+
+    ensureType3Finished();
+
+    size_t sent = 0;
+    size_t sizeForRing = sizeof(struct asg_type1_xfer);
+
+    struct asg_type1_xfer xfer = {
+        bufferOffset,
+        (uint32_t)size,
+    };
+
+    uint8_t* writeBufferBytes = (uint8_t*)(&xfer);
+
+    uint32_t maxOutstanding = 1;
+    uint32_t maxSteps = m_context.ring_config->buffer_size /
+            m_context.ring_config->flush_interval;
+
+    if (maxSteps > 1) maxOutstanding = maxSteps - 1;
+
+    uint32_t ringAvailReadNow = ring_buffer_available_read(m_context.to_host, 0);
+
+    while (ringAvailReadNow >= maxOutstanding * sizeForRing) {
+        ringAvailReadNow = ring_buffer_available_read(m_context.to_host, 0);
+    }
+
+    bool hostPinged = false;
+    while (sent < sizeForRing) {
+
+        long sentChunks = ring_buffer_write(
+            m_context.to_host,
+            writeBufferBytes + sent,
+            sizeForRing - sent, 1);
+
+        if (!hostPinged &&
+            *(m_context.host_state) != ASG_HOST_STATE_CAN_CONSUME &&
+            *(m_context.host_state) != ASG_HOST_STATE_RENDERING) {
+            notifyAvailable();
+            hostPinged = true;
+        }
+
+        if (sentChunks == 0) {
+            ring_buffer_yield();
+            backoff();
+        }
+
+        sent += sentChunks * (sizeForRing - sent);
+
+        if (isInError()) {
+            return -1;
+        }
+    }
+
+    bool isRenderingAfter = ASG_HOST_STATE_RENDERING == __atomic_load_n(m_context.host_state, __ATOMIC_ACQUIRE);
+
+    if (!isRenderingAfter) {
+        notifyAvailable();
+    }
+
+    m_written += size;
+
+    float mb = (float)m_written / 1048576.0f;
+    if (mb > 100.0f) {
+        ALOGD("%s: %f mb in %d notifs. %f mb/notif\n", __func__,
+              mb, m_notifs, m_notifs ? mb / (float)m_notifs : 0.0f);
+        m_notifs = 0;
+        m_written = 0;
+    }
+
+    resetBackoff();
+    return 0;
+}
+
+void AddressSpaceStream::backoff() {
+#if defined(HOST_BUILD) || defined(__APPLE__) || defined(__MACOSX) || defined(__Fuchsia__) || defined(__linux__)
+    static const uint32_t kBackoffItersThreshold = 50000000;
+    static const uint32_t kBackoffFactorDoublingIncrement = 50000000;
+#else
+    static const uint32_t kBackoffItersThreshold = property_get_int32("ro.boot.asg.backoffiters", 50000000);
+    static const uint32_t kBackoffFactorDoublingIncrement = property_get_int32("ro.boot.asg.backoffincrement", 50000000);
+#endif
+    ++m_backoffIters;
+
+    if (m_backoffIters > kBackoffItersThreshold) {
+        usleep(m_backoffFactor);
+        uint32_t itersSoFarAfterThreshold = m_backoffIters - kBackoffItersThreshold;
+        if (itersSoFarAfterThreshold > kBackoffFactorDoublingIncrement) {
+            m_backoffFactor = m_backoffFactor << 1;
+            if (m_backoffFactor > 1000) m_backoffFactor = 1000;
+            m_backoffIters = kBackoffItersThreshold;
+        }
+    }
+}
+
+void AddressSpaceStream::resetBackoff() {
+    m_backoffIters = 0;
+    m_backoffFactor = 1;
+}
diff --git a/system/OpenglSystemCommon/AddressSpaceStream.h b/system/OpenglSystemCommon/AddressSpaceStream.h
new file mode 100644
index 0000000..1884c2d
--- /dev/null
+++ b/system/OpenglSystemCommon/AddressSpaceStream.h
@@ -0,0 +1,113 @@
+/*
+* Copyright (C) 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#ifndef __ADDRESS_SPACE_STREAM_H
+#define __ADDRESS_SPACE_STREAM_H
+
+#include "IOStream.h"
+#include "VirtGpu.h"
+#include "address_space_graphics_types.h"
+#include "aemu/base/AndroidHealthMonitor.h"
+#include "goldfish_address_space.h"
+
+using android::base::guest::HealthMonitor;
+using gfxstream::IOStream;
+
+class AddressSpaceStream;
+
+AddressSpaceStream* createAddressSpaceStream(size_t bufSize, HealthMonitor<>* healthMonitor);
+AddressSpaceStream* createVirtioGpuAddressSpaceStream(HealthMonitor<>* healthMonitor);
+
+class AddressSpaceStream : public IOStream {
+public:
+    explicit AddressSpaceStream(
+        address_space_handle_t handle,
+        uint32_t version,
+        struct asg_context context,
+        uint64_t ringOffset,
+        uint64_t writeBufferOffset,
+        struct address_space_ops ops,
+        HealthMonitor<>* healthMonitor);
+    ~AddressSpaceStream();
+
+    virtual size_t idealAllocSize(size_t len);
+    virtual void *allocBuffer(size_t minSize);
+    virtual int commitBuffer(size_t size);
+    virtual const unsigned char *readFully( void *buf, size_t len);
+    virtual const unsigned char *read( void *buf, size_t *inout_len);
+    virtual int writeFully(const void *buf, size_t len);
+    virtual int writeFullyAsync(const void *buf, size_t len);
+    virtual const unsigned char *commitBufferAndReadFully(size_t size, void *buf, size_t len);
+
+    void setMapping(VirtGpuBlobMappingPtr mapping) {
+        m_mapping = mapping;
+    }
+
+    void setResourceId(uint32_t id) {
+        m_resourceId = id;
+    }
+
+private:
+    bool isInError() const;
+    ssize_t speculativeRead(unsigned char* readBuffer, size_t trySize);
+    void notifyAvailable();
+    uint32_t getRelativeBufferPos(uint32_t pos);
+    void advanceWrite();
+    void ensureConsumerFinishing();
+    void ensureType1Finished();
+    void ensureType3Finished();
+    int type1Write(uint32_t offset, size_t size);
+
+    void backoff();
+    void resetBackoff();
+
+    VirtGpuBlobMappingPtr m_mapping = nullptr;
+    struct address_space_ops m_ops;
+
+    unsigned char* m_tmpBuf;
+    size_t m_tmpBufSize;
+    size_t m_tmpBufXferSize;
+    bool m_usingTmpBuf;
+
+    unsigned char* m_readBuf;
+    size_t m_read;
+    size_t m_readLeft;
+
+    address_space_handle_t m_handle;
+    uint32_t m_version;
+    struct asg_context m_context;
+
+    uint64_t m_ringOffset;
+    uint64_t m_writeBufferOffset;
+
+    uint32_t m_writeBufferSize;
+    uint32_t m_writeBufferMask;
+    unsigned char* m_buf;
+    unsigned char* m_writeStart;
+    uint32_t m_writeStep;
+
+    uint32_t m_notifs;
+    uint32_t m_written;
+
+    uint64_t m_backoffIters;
+    uint64_t m_backoffFactor;
+
+    size_t m_ringStorageSize;
+    uint32_t m_resourceId = 0;
+
+    HealthMonitor<>* m_healthMonitor;
+};
+
+#endif
diff --git a/system/OpenglSystemCommon/Android.mk b/system/OpenglSystemCommon/Android.mk
new file mode 100644
index 0000000..f586915
--- /dev/null
+++ b/system/OpenglSystemCommon/Android.mk
@@ -0,0 +1,71 @@
+LOCAL_PATH := $(call my-dir)
+
+$(call emugl-begin-shared-library,libOpenglSystemCommon)
+$(call emugl-import,libGLESv1_enc libGLESv2_enc lib_renderControl_enc)
+ifeq (true,$(GOLDFISH_OPENGL_BUILD_FOR_HOST))
+$(call emugl-import,libplatform$(GOLDFISH_OPENGL_LIB_SUFFIX))
+$(call emugl-import,libGoldfishAddressSpace$(GOLDFISH_OPENGL_LIB_SUFFIX))
+$(call emugl-import,libqemupipe$(GOLDFISH_OPENGL_LIB_SUFFIX))
+$(call emugl-import,libgralloc_cb$(GOLDFISH_OPENGL_LIB_SUFFIX))
+else
+$(call emugl-export,STATIC_LIBRARIES,libplatform)
+$(call emugl-export,STATIC_LIBRARIES,libGoldfishAddressSpace libringbuffer)
+$(call emugl-export,STATIC_LIBRARIES,libqemupipe.ranchu)
+$(call emugl-export,HEADER_LIBRARIES,libgralloc_cb.ranchu)
+endif
+
+LOCAL_SRC_FILES := \
+    FormatConversions.cpp \
+    HostConnection.cpp \
+    QemuPipeStream.cpp \
+    ProcessPipe.cpp    \
+    ThreadInfo.cpp \
+
+ifeq (true,$(GFXSTREAM))
+$(call emugl-import,libvulkan_enc)
+
+LOCAL_SRC_FILES += AddressSpaceStream.cpp
+
+endif
+
+LOCAL_CFLAGS += -Wno-unused-variable -Wno-unused-parameter -fno-emulated-tls
+
+ifeq (true,$(GOLDFISH_OPENGL_BUILD_FOR_HOST))
+
+else
+
+ifeq (true,$(GFXSTREAM))
+
+LOCAL_HEADER_LIBRARIES += gfxstream_vulkan_headers
+
+LOCAL_CFLAGS += -DVIRTIO_GPU
+LOCAL_SRC_FILES += \
+    VirtioGpuPipeStream.cpp \
+
+LOCAL_C_INCLUDES += external/libdrm external/minigbm/cros_gralloc
+LOCAL_SHARED_LIBRARIES += libdrm
+
+endif
+
+endif
+
+ifdef IS_AT_LEAST_OPD1
+LOCAL_HEADER_LIBRARIES += libnativebase_headers
+
+$(call emugl-export,HEADER_LIBRARIES,libnativebase_headers)
+endif
+
+ifdef IS_AT_LEAST_OPD1
+LOCAL_HEADER_LIBRARIES += libhardware_headers
+$(call emugl-export,HEADER_LIBRARIES,libhardware_headers)
+endif
+
+$(call emugl-export,C_INCLUDES,$(LOCAL_PATH)/bionic-include)
+$(call emugl-export,C_INCLUDES,$(LOCAL_PATH) bionic/libc/private)
+$(call emugl-export,C_INCLUDES,$(LOCAL_PATH) bionic/libc/platform)
+
+ifeq (true,$(GOLDFISH_OPENGL_BUILD_FOR_HOST))
+$(call emugl-export,SHARED_LIBRARIES,android-emu-shared)
+endif
+
+$(call emugl-end-module)
diff --git a/system/OpenglSystemCommon/CMakeLists.txt b/system/OpenglSystemCommon/CMakeLists.txt
new file mode 100644
index 0000000..f5509cb
--- /dev/null
+++ b/system/OpenglSystemCommon/CMakeLists.txt
@@ -0,0 +1,10 @@
+# This is an autogenerated file! Do not edit!
+# instead run make from .../device/generic/goldfish-opengl
+# which will re-generate this file.
+android_validate_sha256("${GOLDFISH_DEVICE_ROOT}/system/OpenglSystemCommon/Android.mk" "5086200ad090dcbd2e94e4d253914680c8f0b5feea92776c0f64cbdd7fe4e4fa")
+set(OpenglSystemCommon_src FormatConversions.cpp HostConnection.cpp QemuPipeStream.cpp ProcessPipe.cpp ThreadInfo.cpp AddressSpaceStream.cpp)
+android_add_library(TARGET OpenglSystemCommon SHARED LICENSE Apache-2.0 SRC FormatConversions.cpp HostConnection.cpp QemuPipeStream.cpp ProcessPipe.cpp ThreadInfo.cpp AddressSpaceStream.cpp)
+target_include_directories(OpenglSystemCommon PRIVATE ${GOLDFISH_DEVICE_ROOT}/system/OpenglSystemCommon ${GOLDFISH_DEVICE_ROOT}/bionic/libc/platform ${GOLDFISH_DEVICE_ROOT}/bionic/libc/private ${GOLDFISH_DEVICE_ROOT}/system/OpenglSystemCommon/bionic-include ${GOLDFISH_DEVICE_ROOT}/system/vulkan_enc ${GOLDFISH_DEVICE_ROOT}/shared/gralloc_cb/include ${GOLDFISH_DEVICE_ROOT}/shared/GoldfishAddressSpace/include ${GOLDFISH_DEVICE_ROOT}/platform/include ${GOLDFISH_DEVICE_ROOT}/system/renderControl_enc ${GOLDFISH_DEVICE_ROOT}/system/GLESv2_enc ${GOLDFISH_DEVICE_ROOT}/system/GLESv1_enc ${GOLDFISH_DEVICE_ROOT}/shared/OpenglCodecCommon ${GOLDFISH_DEVICE_ROOT}/android-emu ${GOLDFISH_DEVICE_ROOT}/shared/qemupipe/include-types ${GOLDFISH_DEVICE_ROOT}/shared/qemupipe/include ${GOLDFISH_DEVICE_ROOT}/./host/include/libOpenglRender ${GOLDFISH_DEVICE_ROOT}/./system/include ${GOLDFISH_DEVICE_ROOT}/./../../../external/qemu/android/android-emugl/guest)
+target_compile_definitions(OpenglSystemCommon PRIVATE "-DPLATFORM_SDK_VERSION=29" "-DGOLDFISH_HIDL_GRALLOC" "-DHOST_BUILD" "-DANDROID" "-DGL_GLEXT_PROTOTYPES" "-DPAGE_SIZE=4096" "-DGFXSTREAM" "-DENABLE_ANDROID_HEALTH_MONITOR")
+target_compile_options(OpenglSystemCommon PRIVATE "-fvisibility=default" "-Wno-unused-parameter" "-Wno-unused-variable" "-fno-emulated-tls")
+target_link_libraries(OpenglSystemCommon PRIVATE android-emu-shared vulkan_enc gui log _renderControl_enc GLESv2_enc GLESv1_enc OpenglCodecCommon_host cutils utils androidemu PRIVATE gralloc_cb_host GoldfishAddressSpace_host platform_host qemupipe_host)
\ No newline at end of file
diff --git a/system/OpenglSystemCommon/EGLClientIface.h b/system/OpenglSystemCommon/EGLClientIface.h
new file mode 100644
index 0000000..35b66bf
--- /dev/null
+++ b/system/OpenglSystemCommon/EGLClientIface.h
@@ -0,0 +1,42 @@
+/*
+* Copyright 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#ifndef _SYSTEM_COMMON_EGL_CLIENT_IFACE_H
+#define _SYSTEM_COMMON_EGL_CLIENT_IFACE_H
+
+struct EGLThreadInfo;  // defined in ThreadInfo.h
+
+typedef struct {
+    EGLThreadInfo* (*getThreadInfo)();
+    const char* (*getGLString)(int glEnum);
+} EGLClient_eglInterface;
+
+typedef struct {
+    void* (*getProcAddress)(const char *funcName);
+    void (*init)();
+    void (*finish)();
+    void (*getIntegerv)(unsigned int pname, int* param);
+} EGLClient_glesInterface;
+
+//
+// Any GLES/GLES2 client API library should define a function named "init_emul_gles"
+// with the following prototype,
+// It will be called by EGL after loading the GLES library for initialization
+// and exchanging interface function pointers.
+//
+typedef EGLClient_glesInterface *(*init_emul_gles_t)(EGLClient_eglInterface *eglIface);
+
+#endif
diff --git a/system/OpenglSystemCommon/EGLImage.h b/system/OpenglSystemCommon/EGLImage.h
new file mode 100644
index 0000000..fe320b2
--- /dev/null
+++ b/system/OpenglSystemCommon/EGLImage.h
@@ -0,0 +1,43 @@
+/*
+* Copyright (C) 2015 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#ifndef __COMMON_EGL_IMAGE_H
+#define __COMMON_EGL_IMAGE_H
+
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+#include <GLES/gl.h>
+
+#include <hardware/hardware.h>
+#include <hardware/gralloc.h>
+
+#include <nativebase/nativebase.h>
+#include <cutils/native_handle.h>
+
+struct EGLImage_t
+{
+    EGLDisplay dpy;
+    EGLenum target;
+    int width;
+    int height;
+
+    union
+    {
+        android_native_buffer_t *native_buffer;
+        uint32_t host_egl_image;
+    };
+};
+
+#endif
diff --git a/system/OpenglSystemCommon/EmulatorFeatureInfo.h b/system/OpenglSystemCommon/EmulatorFeatureInfo.h
new file mode 100644
index 0000000..03f4198
--- /dev/null
+++ b/system/OpenglSystemCommon/EmulatorFeatureInfo.h
@@ -0,0 +1,223 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#ifndef __COMMON_EMULATOR_FEATURE_INFO_H
+#define __COMMON_EMULATOR_FEATURE_INFO_H
+
+// SyncImpl determines the presence of host/guest OpenGL fence sync
+// capabilities. It corresponds exactly to EGL_ANDROID_native_fence_sync
+// capability, but for the emulator, we need to make sure that
+// OpenGL pipe protocols match, so we use a special extension name
+// here.
+// SYNC_IMPL_NONE means that the native fence sync capability is
+// not present, and we will end up using the equivalent of glFinish
+// in order to preserve buffer swapping order.
+// SYNC_IMPL_NATIVE_SYNC means that we do have native fence sync
+// capability, and we will use a fence fd to synchronize buffer swaps.
+enum SyncImpl {
+    SYNC_IMPL_NONE = 0,
+    SYNC_IMPL_NATIVE_SYNC_V2 = 1, // ANDROID_native_fence_sync
+    SYNC_IMPL_NATIVE_SYNC_V3 = 2, // KHR_wait_sync
+    SYNC_IMPL_NATIVE_SYNC_V4 = 3, // Correct eglGetSyncAttribKHR
+};
+
+// Interface for native sync:
+// Use the highest that shows up
+static const char kRCNativeSyncV2[] = "ANDROID_EMU_native_sync_v2";
+static const char kRCNativeSyncV3[] = "ANDROID_EMU_native_sync_v3";
+static const char kRCNativeSyncV4[] = "ANDROID_EMU_native_sync_v4";
+
+// DMA for OpenGL
+enum DmaImpl {
+    DMA_IMPL_NONE = 0,
+    DMA_IMPL_v1 = 1,
+};
+
+static const char kDmaExtStr_v1[] = "ANDROID_EMU_dma_v1";
+
+// OpenGL ES max supported version
+enum GLESMaxVersion {
+    GLES_MAX_VERSION_2 = 0,
+    GLES_MAX_VERSION_3_0 = 1,
+    GLES_MAX_VERSION_3_1 = 2,
+    GLES_MAX_VERSION_3_2 = 3,
+};
+
+static const char kGLESMaxVersion_2[] = "ANDROID_EMU_gles_max_version_2";
+static const char kGLESMaxVersion_3_0[] = "ANDROID_EMU_gles_max_version_3_0";
+static const char kGLESMaxVersion_3_1[] = "ANDROID_EMU_gles_max_version_3_1";
+static const char kGLESMaxVersion_3_2[] = "ANDROID_EMU_gles_max_version_3_2";
+
+enum HostComposition {
+    HOST_COMPOSITION_NONE = 0,
+    HOST_COMPOSITION_V1,
+    HOST_COMPOSITION_V2,
+};
+
+static const char kHostCompositionV1[] = "ANDROID_EMU_host_composition_v1";
+static const char kHostCompositionV2[] = "ANDROID_EMU_host_composition_v2";
+
+// No querying errors from host extension
+static const char kGLESNoHostError[] = "ANDROID_EMU_gles_no_host_error";
+
+// Host to guest memory mapping
+static const char kGLDirectMem[] = "ANDROID_EMU_direct_mem";
+
+// Vulkan host support
+// To be delivered/enabled when at least the following is working/available:
+// - HOST_COHERENT memory mapping
+// - Full gralloc interop: External memory, AHB
+static const char kVulkan[] = "ANDROID_EMU_vulkan";
+
+// Deferred Vulkan commands
+static const char kDeferredVulkanCommands[] = "ANDROID_EMU_deferred_vulkan_commands";
+
+// Vulkan null optional strings
+static const char kVulkanNullOptionalStrings[] = "ANDROID_EMU_vulkan_null_optional_strings";
+
+// Vulkan create resources with requirements
+static const char kVulkanCreateResourcesWithRequirements[] = "ANDROID_EMU_vulkan_create_resources_with_requirements";
+
+// Vulkan ignored handles
+static const char kVulkanIgnoredHandles[] = "ANDROID_EMU_vulkan_ignored_handles";
+
+// YUV host cache
+static const char kYUVCache[] = "ANDROID_EMU_YUV_Cache";
+
+// GL protocol v2
+static const char kAsyncUnmapBuffer[] = "ANDROID_EMU_async_unmap_buffer";
+
+// virtio-gpu-next
+static const char kVirtioGpuNext[] = "ANDROID_EMU_virtio_gpu_next";
+
+static const char kHasSharedSlotsHostMemoryAllocator[] = "ANDROID_EMU_has_shared_slots_host_memory_allocator";
+
+// Vulkan free memory sync
+static const char kVulkanFreeMemorySync[] = "ANDROID_EMU_vulkan_free_memory_sync";
+
+// virtio-gpu syncfd support
+static const char kVirtioGpuNativeSync[] = "ANDROID_EMU_virtio_gpu_native_sync";
+
+// Vulkan extension that required a protocol update (new marshaling structs)
+static const char kVulkanShaderFloat16Int8[] = "ANDROID_EMU_vulkan_shader_float16_int8";
+
+// Vulkan async queue submit
+static const char kVulkanAsyncQueueSubmit[] = "ANDROID_EMU_vulkan_async_queue_submit";
+
+// A flag to _not_ ignore host opengl errors (now host opengl errors are ignored by default)
+static const char kGLESUseHostError[] = "ANDROID_EMU_gles_use_host_error";
+
+// Host side tracing
+static const char kHostSideTracing[] = "ANDROID_EMU_host_side_tracing";
+
+// Make current async
+static const char kAsyncFrameCommands[] = "ANDROID_EMU_async_frame_commands";
+
+// Queue submit with commands
+static const char kVulkanQueueSubmitWithCommands[] = "ANDROID_EMU_vulkan_queue_submit_with_commands";
+//
+// Synchronized glBufferData call
+static const char kSyncBufferData[] = "ANDROID_EMU_sync_buffer_data";
+
+// Batched descriptor set update
+static const char kVulkanBatchedDescriptorSetUpdate[] = "ANDROID_EMU_vulkan_batched_descriptor_set_update";
+
+// Async QSRI
+static const char kVulkanAsyncQsri[] = "ANDROID_EMU_vulkan_async_qsri";
+
+// DMA for readback
+static const char kReadColorBufferDma[] = "ANDROID_EMU_read_color_buffer_dma";
+
+// HWC multiple display configs
+static const char kHWCMultiConfigs[] = "ANDROID_EMU_hwc_multi_configs";
+
+// Vulkan auxiliary command memory
+static const char kVulkanAuxCommandMemory[] = "ANDROID_EMU_vulkan_aux_command_memory";
+
+// Struct describing available emulator features
+struct EmulatorFeatureInfo {
+
+    EmulatorFeatureInfo() :
+        syncImpl(SYNC_IMPL_NONE),
+        dmaImpl(DMA_IMPL_NONE),
+        hostComposition(HOST_COMPOSITION_NONE),
+        glesMaxVersion(GLES_MAX_VERSION_2),
+        hasDirectMem(false),
+        hasVulkan(false),
+        hasDeferredVulkanCommands(false),
+        hasVulkanNullOptionalStrings(false),
+        hasVulkanCreateResourcesWithRequirements(false),
+        hasVulkanIgnoredHandles(false),
+        hasYUVCache (false),
+        hasAsyncUnmapBuffer (false),
+        hasVirtioGpuNext (false),
+        hasSharedSlotsHostMemoryAllocator(false),
+        hasVulkanFreeMemorySync(false),
+        hasVirtioGpuNativeSync(false),
+        hasVulkanShaderFloat16Int8(false),
+        hasVulkanAsyncQueueSubmit(false),
+        hasHostSideTracing(false),
+        hasAsyncFrameCommands(false),
+        hasVulkanQueueSubmitWithCommands(false),
+        hasVulkanBatchedDescriptorSetUpdate(false),
+        hasSyncBufferData(false),
+        hasVulkanAsyncQsri(false),
+        hasReadColorBufferDma(false),
+        hasHWCMultiConfigs(false),
+        hasVulkanAuxCommandMemory(false)
+    { }
+
+    SyncImpl syncImpl;
+    DmaImpl dmaImpl;
+    HostComposition hostComposition;
+    GLESMaxVersion glesMaxVersion;
+    bool hasDirectMem;
+    bool hasVulkan;
+    bool hasDeferredVulkanCommands;
+    bool hasVulkanNullOptionalStrings;
+    bool hasVulkanCreateResourcesWithRequirements;
+    bool hasVulkanIgnoredHandles;
+    bool hasYUVCache;
+    bool hasAsyncUnmapBuffer;
+    bool hasVirtioGpuNext;
+    bool hasSharedSlotsHostMemoryAllocator;
+    bool hasVulkanFreeMemorySync;
+    bool hasVirtioGpuNativeSync;
+    bool hasVulkanShaderFloat16Int8;
+    bool hasVulkanAsyncQueueSubmit;
+    bool hasHostSideTracing;
+    bool hasAsyncFrameCommands;
+    bool hasVulkanQueueSubmitWithCommands;
+    bool hasVulkanBatchedDescriptorSetUpdate;
+    bool hasSyncBufferData;
+    bool hasVulkanAsyncQsri;
+    bool hasReadColorBufferDma;
+    bool hasHWCMultiConfigs;
+    bool hasVulkanAuxCommandMemory; // This feature tracks if vulkan command buffers should be stored in an auxiliary shared memory
+};
+
+enum HostConnectionType {
+    HOST_CONNECTION_TCP = 0,
+    HOST_CONNECTION_QEMU_PIPE = 1,
+    HOST_CONNECTION_ADDRESS_SPACE = 2,
+    HOST_CONNECTION_VIRTIO_GPU_PIPE = 3,
+    HOST_CONNECTION_VIRTIO_GPU_ADDRESS_SPACE = 4,
+};
+
+enum GrallocType {
+    GRALLOC_TYPE_RANCHU = 0,
+    GRALLOC_TYPE_MINIGBM = 1,
+    GRALLOC_TYPE_DYN_ALLOC_MINIGBM = 2,
+};
+
+#endif // __COMMON_EMULATOR_FEATURE_INFO_H
diff --git a/system/OpenglSystemCommon/FormatConversions.cpp b/system/OpenglSystemCommon/FormatConversions.cpp
new file mode 100644
index 0000000..aae6bb9
--- /dev/null
+++ b/system/OpenglSystemCommon/FormatConversions.cpp
@@ -0,0 +1,377 @@
+// Copyright 2016 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <hardware/gralloc.h>
+#include "FormatConversions.h"
+
+#if PLATFORM_SDK_VERSION < 26
+#include <cutils/log.h>
+#else
+#include <log/log.h>
+#endif
+#include <string.h>
+#include <stdio.h>
+
+#define DEBUG 0
+
+#if DEBUG
+#define DD(...) ALOGD(__VA_ARGS__)
+#else
+#define DD(...)
+#endif
+
+static int get_rgb_offset(int row, int width, int rgbStride) {
+    return row * width * rgbStride;
+}
+
+#define OMX_COLOR_FormatYUV420Planar 0x13
+
+bool gralloc_is_yuv_format(const int format) {
+    switch (format) {
+    case HAL_PIXEL_FORMAT_YV12:
+    case HAL_PIXEL_FORMAT_YCbCr_420_888:
+    case HAL_PIXEL_FORMAT_YCrCb_420_SP:
+    case OMX_COLOR_FormatYUV420Planar:
+        return true;
+
+    default:
+        return false;
+    }
+}
+
+void get_yv12_offsets(int width, int height,
+                             uint32_t* yStride_out,
+                             uint32_t* cStride_out,
+                             uint32_t* totalSz_out) {
+    uint32_t align = 16;
+    uint32_t yStride = (width + (align - 1)) & ~(align-1);
+    uint32_t uvStride = (yStride / 2 + (align - 1)) & ~(align-1);
+    uint32_t uvHeight = height / 2;
+    uint32_t sz = yStride * height + 2 * (uvHeight * uvStride);
+
+    if (yStride_out) *yStride_out = yStride;
+    if (cStride_out) *cStride_out = uvStride;
+    if (totalSz_out) *totalSz_out = sz;
+}
+
+void get_yuv420p_offsets(int width, int height,
+                                uint32_t* yStride_out,
+                                uint32_t* cStride_out,
+                                uint32_t* totalSz_out) {
+    uint32_t align = 1;
+    uint32_t yStride = (width + (align - 1)) & ~(align-1);
+    uint32_t uvStride = (yStride / 2 + (align - 1)) & ~(align-1);
+    uint32_t uvHeight = height / 2;
+    uint32_t sz = yStride * height + 2 * (uvHeight * uvStride);
+
+    if (yStride_out) *yStride_out = yStride;
+    if (cStride_out) *cStride_out = uvStride;
+    if (totalSz_out) *totalSz_out = sz;
+}
+
+signed clamp_rgb(signed value) {
+    if (value > 255) {
+        value = 255;
+    } else if (value < 0) {
+        value = 0;
+    }
+    return value;
+}
+
+void rgb565_to_yv12(char* dest, char* src, int width, int height,
+        int left, int top, int right, int bottom) {
+    const int rgb_stride = 2;
+
+    int align = 16;
+    int yStride = (width + (align -1)) & ~(align-1);
+    int cStride = (yStride / 2 + (align - 1)) & ~(align-1);
+    int cSize = cStride * height/2;
+
+    uint16_t *rgb_ptr0 = (uint16_t *)src;
+    uint8_t *yv12_y0 = (uint8_t *)dest;
+    uint8_t *yv12_v0 = yv12_y0 + yStride * height;
+
+    for (int j = top; j <= bottom; ++j) {
+        uint8_t *yv12_y = yv12_y0 + j * yStride;
+        uint8_t *yv12_v = yv12_v0 + (j/2) * cStride;
+        uint8_t *yv12_u = yv12_v + cSize;
+        uint16_t *rgb_ptr = rgb_ptr0 + get_rgb_offset(j, width, rgb_stride) / 2;
+        bool jeven = (j & 1) == 0;
+        for (int i = left; i <= right; ++i) {
+            uint8_t r = ((rgb_ptr[i]) >> 11) & 0x01f;
+            uint8_t g = ((rgb_ptr[i]) >> 5) & 0x03f;
+            uint8_t b = (rgb_ptr[i]) & 0x01f;
+            // convert to 8bits
+            // http://stackoverflow.com/questions/2442576/how-does-one-convert-16-bit-rgb565-to-24-bit-rgb888
+            uint8_t R = (r * 527 + 23) >> 6;
+            uint8_t G = (g * 259 + 33) >> 6;
+            uint8_t B = (b * 527 + 23) >> 6;
+            // convert to YV12
+            // frameworks/base/core/jni/android_hardware_camera2_legacy_LegacyCameraDevice.cpp
+            yv12_y[i] = clamp_rgb((77 * R + 150 * G +  29 * B) >> 8);
+            bool ieven = (i & 1) == 0;
+            if (jeven && ieven) {
+                yv12_u[i] = clamp_rgb((( -43 * R - 85 * G + 128 * B) >> 8) + 128);
+                yv12_v[i] = clamp_rgb((( 128 * R - 107 * G - 21 * B) >> 8) + 128);
+            }
+        }
+    }
+}
+
+void rgb888_to_yv12(char* dest, char* src, int width, int height,
+        int left, int top, int right, int bottom) {
+    const int rgb_stride = 3;
+
+    DD("%s convert %d by %d", __func__, width, height);
+    int align = 16;
+    int yStride = (width + (align -1)) & ~(align-1);
+    int cStride = (yStride / 2 + (align - 1)) & ~(align-1);
+    int cSize = cStride * height/2;
+
+
+    uint8_t *rgb_ptr0 = (uint8_t *)src;
+    uint8_t *yv12_y0 = (uint8_t *)dest;
+    uint8_t *yv12_u0 = yv12_y0 + yStride * height + cSize;
+    uint8_t *yv12_v0 = yv12_y0 + yStride * height;
+
+#if DEBUG
+    char mybuf[1024];
+    snprintf(mybuf, sizeof(mybuf), "/sdcard/raw_%d_%d_rgb.ppm", width, height);
+    FILE *myfp = fopen(mybuf, "wb"); /* b - binary mode */
+    (void) fprintf(myfp, "P6\n%d %d\n255\n", width, height);
+
+    if (myfp == NULL) {
+        DD("failed to open /sdcard/raw_rgb888.ppm");
+    } else {
+        fwrite(rgb_ptr0, width * height * rgb_stride, 1, myfp);
+        fclose(myfp);
+    }
+#endif
+
+    int uvcount = 0;
+    for (int j = top; j <= bottom; ++j) {
+        uint8_t *yv12_y = yv12_y0 + j * yStride;
+        uint8_t *rgb_ptr = rgb_ptr0 + get_rgb_offset(j, width, rgb_stride);
+        bool jeven = (j & 1) == 0;
+        for (int i = left; i <= right; ++i) {
+            uint8_t R = rgb_ptr[i*rgb_stride];
+            uint8_t G = rgb_ptr[i*rgb_stride+1];
+            uint8_t B = rgb_ptr[i*rgb_stride+2];
+            // convert to YV12
+            // https://en.wikipedia.org/wiki/YCbCr#ITU-R_BT.601_conversion
+            // but scale up U by 1/0.96
+            yv12_y[i] = clamp_rgb(1.0 * ((0.25678823529411765 * R) + (0.5041294117647058 * G) + (0.09790588235294118 * B)) + 16);
+            bool ieven = (i & 1) == 0;
+            if (jeven && ieven) {
+                yv12_u0[uvcount] = clamp_rgb((1/0.96) * (-(0.1482235294117647 * R) - (0.2909921568627451 * G) + (0.4392156862745098 * B)) + 128);
+                yv12_v0[uvcount] = clamp_rgb((1.0)* ((0.4392156862745098 * R) - (0.36778823529411764 * G) - (0.07142745098039215 * B)) + 128);
+                uvcount ++;
+            }
+        }
+        if (jeven) {
+            yv12_u0 += cStride;
+            yv12_v0 += cStride;
+            uvcount = 0;
+        }
+    }
+
+#if DEBUG
+    snprintf(mybuf, sizeof(mybuf), "/sdcard/raw_%d_%d_yv12.yuv", width, height);
+    FILE *yuvfp = fopen(mybuf, "wb"); /* b - binary mode */
+    if (yuvfp != NULL) {
+        fwrite(yv12_y0, yStride * height + 2 * cSize, 1, yuvfp);
+        fclose(yuvfp);
+    }
+#endif
+
+}
+
+void rgb888_to_yuv420p(char* dest, char* src, int width, int height,
+        int left, int top, int right, int bottom) {
+    const int rgb_stride = 3;
+
+    DD("%s convert %d by %d", __func__, width, height);
+    int yStride = width;
+    int cStride = yStride / 2;
+    int cSize = cStride * height/2;
+
+    uint8_t *rgb_ptr0 = (uint8_t *)src;
+    uint8_t *yv12_y0 = (uint8_t *)dest;
+    uint8_t *yv12_u0 = yv12_y0 + yStride * height;
+
+    for (int j = top; j <= bottom; ++j) {
+        uint8_t *yv12_y = yv12_y0 + j * yStride;
+        uint8_t *yv12_u = yv12_u0 + (j/2) * cStride;
+        uint8_t *yv12_v = yv12_u + cSize;
+        uint8_t *rgb_ptr = rgb_ptr0 + get_rgb_offset(j, width, rgb_stride);
+        bool jeven = (j & 1) == 0;
+        for (int i = left; i <= right; ++i) {
+            uint8_t R = rgb_ptr[i*rgb_stride];
+            uint8_t G = rgb_ptr[i*rgb_stride+1];
+            uint8_t B = rgb_ptr[i*rgb_stride+2];
+            // convert to YV12
+            // frameworks/base/core/jni/android_hardware_camera2_legacy_LegacyCameraDevice.cpp
+            yv12_y[i] = clamp_rgb((77 * R + 150 * G +  29 * B) >> 8);
+            bool ieven = (i & 1) == 0;
+            if (jeven && ieven) {
+                yv12_u[i] = clamp_rgb((( -43 * R - 85 * G + 128 * B) >> 8) + 128);
+                yv12_v[i] = clamp_rgb((( 128 * R - 107 * G - 21 * B) >> 8) + 128);
+            }
+        }
+    }
+}
+
+// YV12 is aka YUV420Planar, or YUV420p; the only difference is that YV12 has
+// certain stride requirements for Y and UV respectively.
+void yv12_to_rgb565(char* dest, char* src, int width, int height,
+        int left, int top, int right, int bottom) {
+    const int rgb_stride = 2;
+
+    DD("%s convert %d by %d", __func__, width, height);
+    int align = 16;
+    int yStride = (width + (align -1)) & ~(align-1);
+    int cStride = (yStride / 2 + (align - 1)) & ~(align-1);
+    int cSize = cStride * height/2;
+
+    uint16_t *rgb_ptr0 = (uint16_t *)dest;
+    uint8_t *yv12_y0 = (uint8_t *)src;
+    uint8_t *yv12_v0 = yv12_y0 + yStride * height;
+
+    for (int j = top; j <= bottom; ++j) {
+        uint8_t *yv12_y = yv12_y0 + j * yStride;
+        uint8_t *yv12_v = yv12_v0 + (j/2) * cStride;
+        uint8_t *yv12_u = yv12_v + cSize;
+        uint16_t *rgb_ptr = rgb_ptr0 + get_rgb_offset(j, width, rgb_stride);
+        for (int i = left; i <= right; ++i) {
+            // convert to rgb
+            // frameworks/av/media/libstagefright/colorconversion/ColorConverter.cpp
+            signed y1 = (signed)yv12_y[i] - 16;
+            signed u = (signed)yv12_u[i / 2] - 128;
+            signed v = (signed)yv12_v[i / 2] - 128;
+
+            signed u_b = u * 517;
+            signed u_g = -u * 100;
+            signed v_g = -v * 208;
+            signed v_r = v * 409;
+
+            signed tmp1 = y1 * 298;
+            signed b1 = clamp_rgb((tmp1 + u_b) / 256);
+            signed g1 = clamp_rgb((tmp1 + v_g + u_g) / 256);
+            signed r1 = clamp_rgb((tmp1 + v_r) / 256);
+
+            uint16_t rgb1 = ((r1 >> 3) << 11) | ((g1 >> 2) << 5) | (b1 >> 3);
+
+            rgb_ptr[i-left] = rgb1;
+        }
+    }
+}
+
+// YV12 is aka YUV420Planar, or YUV420p; the only difference is that YV12 has
+// certain stride requirements for Y and UV respectively.
+void yv12_to_rgb888(char* dest, char* src, int width, int height,
+        int left, int top, int right, int bottom) {
+    const int rgb_stride = 3;
+
+    DD("%s convert %d by %d", __func__, width, height);
+    int align = 16;
+    int yStride = (width + (align -1)) & ~(align-1);
+    int cStride = (yStride / 2 + (align - 1)) & ~(align-1);
+    int cSize = cStride * height/2;
+
+    uint8_t *rgb_ptr0 = (uint8_t *)dest;
+    uint8_t *yv12_y0 = (uint8_t *)src;
+    uint8_t *yv12_v0 = yv12_y0 + yStride * height;
+
+    for (int j = top; j <= bottom; ++j) {
+        uint8_t *yv12_y = yv12_y0 + j * yStride;
+        uint8_t *yv12_v = yv12_v0 + (j/2) * cStride;
+        uint8_t *yv12_u = yv12_v + cSize;
+        uint8_t *rgb_ptr = rgb_ptr0 + get_rgb_offset(j - top, right - left + 1, rgb_stride);
+        for (int i = left; i <= right; ++i) {
+            // convert to rgb
+            // https://en.wikipedia.org/wiki/YCbCr#ITU-R_BT.601_conversion
+            // but scale down U by 0.96 to mitigate rgb over/under flow
+            signed y1 = (signed)yv12_y[i] - 16;
+            signed u = (signed)yv12_u[i / 2] - 128;
+            signed v = (signed)yv12_v[i / 2] - 128;
+
+            signed r1 = clamp_rgb(1 * (1.1643835616438356 * y1 + 1.5960267857142856 * v));
+            signed g1 = clamp_rgb(1 * (1.1643835616438356 * y1 - 0.39176229009491365 * u * 0.97  - 0.8129676472377708 * v));
+            signed b1 = clamp_rgb(1 * (1.1643835616438356 * y1 + 2.017232142857143 * u * 0.97));
+
+            rgb_ptr[(i-left)*rgb_stride] = r1;
+            rgb_ptr[(i-left)*rgb_stride+1] = g1;
+            rgb_ptr[(i-left)*rgb_stride+2] = b1;
+        }
+    }
+}
+
+// YV12 is aka YUV420Planar, or YUV420p; the only difference is that YV12 has
+// certain stride requirements for Y and UV respectively.
+void yuv420p_to_rgb888(char* dest, char* src, int width, int height,
+        int left, int top, int right, int bottom) {
+    const int rgb_stride = 3;
+
+    DD("%s convert %d by %d", __func__, width, height);
+    int yStride = width;
+    int cStride = yStride / 2;
+    int cSize = cStride * height/2;
+
+    uint8_t *rgb_ptr0 = (uint8_t *)dest;
+    uint8_t *yv12_y0 = (uint8_t *)src;
+    uint8_t *yv12_u0 = yv12_y0 + yStride * height;
+
+    for (int j = top; j <= bottom; ++j) {
+        uint8_t *yv12_y = yv12_y0 + j * yStride;
+        uint8_t *yv12_u = yv12_u0 + (j/2) * cStride;
+        uint8_t *yv12_v = yv12_u + cSize;
+        uint8_t *rgb_ptr = rgb_ptr0 + get_rgb_offset(j - top, right - left + 1, rgb_stride);
+        for (int i = left; i <= right; ++i) {
+            // convert to rgb
+            // frameworks/av/media/libstagefright/colorconversion/ColorConverter.cpp
+            signed y1 = (signed)yv12_y[i] - 16;
+            signed u = (signed)yv12_u[i / 2] - 128;
+            signed v = (signed)yv12_v[i / 2] - 128;
+
+            signed u_b = u * 517;
+            signed u_g = -u * 100;
+            signed v_g = -v * 208;
+            signed v_r = v * 409;
+
+            signed tmp1 = y1 * 298;
+            signed b1 = clamp_rgb((tmp1 + u_b) / 256);
+            signed g1 = clamp_rgb((tmp1 + v_g + u_g) / 256);
+            signed r1 = clamp_rgb((tmp1 + v_r) / 256);
+
+            rgb_ptr[(i-left)*rgb_stride] = r1;
+            rgb_ptr[(i-left)*rgb_stride+1] = g1;
+            rgb_ptr[(i-left)*rgb_stride+2] = b1;
+        }
+    }
+}
+
+void copy_rgb_buffer_from_unlocked(
+        char* dst, const char* raw_data,
+        int unlockedWidth,
+        int width, int height, int top, int left,
+        int bpp) {
+    int dst_line_len = width * bpp;
+    int src_line_len = unlockedWidth * bpp;
+    const char *src = raw_data + top*src_line_len + left*bpp;
+    for (int y = 0; y < height; y++) {
+        memcpy(dst, src, dst_line_len);
+        src += src_line_len;
+        dst += dst_line_len;
+    }
+}
diff --git a/system/OpenglSystemCommon/FormatConversions.h b/system/OpenglSystemCommon/FormatConversions.h
new file mode 100644
index 0000000..51aab6d
--- /dev/null
+++ b/system/OpenglSystemCommon/FormatConversions.h
@@ -0,0 +1,48 @@
+// Copyright 2016 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef __GOLDFISH_FORMATCONVERSIONS_H__
+#define __GOLDFISH_FORMATCONVERSIONS_H__
+
+#include <inttypes.h>
+
+// format conversions and helper functions
+bool gralloc_is_yuv_format(int format); // e.g. HAL_PIXEL_FORMAT_YCbCr_420_888
+
+void get_yv12_offsets(int width, int height,
+                      uint32_t* yStride_out,
+                      uint32_t* cStride_out,
+                      uint32_t* totalSz_out);
+void get_yuv420p_offsets(int width, int height,
+                         uint32_t* yStride_out,
+                         uint32_t* cStride_out,
+                         uint32_t* totalSz_out);
+signed clamp_rgb(signed value);
+void rgb565_to_yv12(char* dest, char* src, int width, int height,
+                    int left, int top, int right, int bottom);
+void rgb888_to_yv12(char* dest, char* src, int width, int height,
+                    int left, int top, int right, int bottom);
+void rgb888_to_yuv420p(char* dest, char* src, int width, int height,
+                       int left, int top, int right, int bottom);
+void yv12_to_rgb565(char* dest, char* src, int width, int height,
+                    int left, int top, int right, int bottom);
+void yv12_to_rgb888(char* dest, char* src, int width, int height,
+                    int left, int top, int right, int bottom);
+void yuv420p_to_rgb888(char* dest, char* src, int width, int height,
+                       int left, int top, int right, int bottom);
+void copy_rgb_buffer_from_unlocked(char* _dst, const char* raw_data,
+                                   int unlockedWidth,
+                                   int width, int height, int top, int left,
+                                   int bpp);
+#endif
diff --git a/system/OpenglSystemCommon/HostConnection.cpp b/system/OpenglSystemCommon/HostConnection.cpp
new file mode 100644
index 0000000..9c69732
--- /dev/null
+++ b/system/OpenglSystemCommon/HostConnection.cpp
@@ -0,0 +1,1030 @@
+/*
+* Copyright (C) 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#include "HostConnection.h"
+
+#include "aemu/base/threads/AndroidThread.h"
+#include "aemu/base/AndroidHealthMonitor.h"
+#include "aemu/base/AndroidHealthMonitorConsumerBasic.h"
+#include "cutils/properties.h"
+#include "renderControl_types.h"
+
+#ifdef HOST_BUILD
+#include "aemu/base/Tracing.h"
+#endif
+#include "aemu/base/Process.h"
+
+#define DEBUG_HOSTCONNECTION 0
+
+#if DEBUG_HOSTCONNECTION
+#define DPRINT(fmt,...) ALOGD("%s: " fmt, __FUNCTION__, ##__VA_ARGS__);
+#else
+#define DPRINT(...)
+#endif
+
+using android::base::guest::CreateHealthMonitor;
+using android::base::guest::HealthMonitor;
+using android::base::guest::HealthMonitorConsumerBasic;
+using gfxstream::IOStream;
+
+#ifdef GOLDFISH_NO_GL
+struct gl_client_context_t {
+    int placeholder;
+};
+class GLEncoder : public gl_client_context_t {
+public:
+    GLEncoder(IOStream*, ChecksumCalculator*) { }
+    void setContextAccessor(gl_client_context_t *()) { }
+};
+struct gl2_client_context_t {
+    int placeholder;
+};
+class GL2Encoder : public gl2_client_context_t {
+public:
+    GL2Encoder(IOStream*, ChecksumCalculator*) { }
+    void setContextAccessor(gl2_client_context_t *()) { }
+    void setNoHostError(bool) { }
+    void setDrawCallFlushInterval(uint32_t) { }
+    void setHasAsyncUnmapBuffer(int) { }
+    void setHasSyncBufferData(int) { }
+};
+#else
+#include "GLEncoder.h"
+#include "GL2Encoder.h"
+#endif
+
+#ifdef GFXSTREAM
+#include "VkEncoder.h"
+#include "AddressSpaceStream.h"
+#else
+namespace gfxstream {
+namespace vk {
+struct VkEncoder {
+    VkEncoder(IOStream* stream, HealthMonitor<>* healthMonitor = nullptr) { }
+    void decRef() { }
+    int placeholder;
+};
+}  // namespace vk
+}  // namespace gfxstream
+class QemuPipeStream;
+typedef QemuPipeStream AddressSpaceStream;
+AddressSpaceStream* createAddressSpaceStream(size_t bufSize, HealthMonitor<>* healthMonitor) {
+    ALOGE("%s: FATAL: Trying to create ASG stream in unsupported build\n", __func__);
+    abort();
+}
+AddressSpaceStream* createVirtioGpuAddressSpaceStream(HealthMonitor<>* healthMonitor) {
+    ALOGE("%s: FATAL: Trying to create VirtioGpu ASG stream in unsupported build\n", __func__);
+    abort();
+}
+#endif
+
+using gfxstream::vk::VkEncoder;
+
+#include "ProcessPipe.h"
+#include "QemuPipeStream.h"
+#include "TcpStream.h"
+#include "ThreadInfo.h"
+#include <gralloc_cb_bp.h>
+#include <unistd.h>
+
+using android::base::guest::getCurrentThreadId;
+
+#ifdef VIRTIO_GPU
+
+#include "VirtGpu.h"
+#include "VirtioGpuPipeStream.h"
+#include "virtgpu_drm.h"
+
+#include <cros_gralloc_handle.h>
+#include <xf86drm.h>
+
+#endif
+
+#if defined(__linux__) || defined(__ANDROID__)
+#include <fstream>
+#include <string>
+#endif
+
+#undef LOG_TAG
+#define LOG_TAG "HostConnection"
+#if PLATFORM_SDK_VERSION < 26
+#include <cutils/log.h>
+#else
+#include <log/log.h>
+#endif
+
+#define STREAM_BUFFER_SIZE  (4*1024*1024)
+#define STREAM_PORT_NUM     22468
+
+HealthMonitor<>* getGlobalHealthMonitor() {
+    // Initialize HealthMonitor
+    // Rather than inject as a construct arg, we keep it as a static variable in the .cpp
+    // to avoid setting up dependencies in other repos (external/qemu)
+    static HealthMonitorConsumerBasic sHealthMonitorConsumerBasic;
+    static std::unique_ptr<HealthMonitor<>> sHealthMonitor = CreateHealthMonitor(sHealthMonitorConsumerBasic);
+    return sHealthMonitor.get();
+}
+
+static HostConnectionType getConnectionTypeFromProperty() {
+#ifdef __Fuchsia__
+    return HOST_CONNECTION_ADDRESS_SPACE;
+#elif defined(__ANDROID__) || defined(HOST_BUILD)
+    char transportValue[PROPERTY_VALUE_MAX] = "";
+
+    do {
+        property_get("ro.boot.qemu.gltransport.name", transportValue, "");
+        if (transportValue[0]) { break; }
+
+        property_get("ro.boot.qemu.gltransport", transportValue, "");
+        if (transportValue[0]) { break; }
+
+        property_get("ro.boot.hardware.gltransport", transportValue, "");
+    } while (false);
+
+    if (!transportValue[0]) return HOST_CONNECTION_QEMU_PIPE;
+
+    if (!strcmp("tcp", transportValue)) return HOST_CONNECTION_TCP;
+    if (!strcmp("pipe", transportValue)) return HOST_CONNECTION_QEMU_PIPE;
+    if (!strcmp("asg", transportValue)) return HOST_CONNECTION_ADDRESS_SPACE;
+    if (!strcmp("virtio-gpu-pipe", transportValue)) return HOST_CONNECTION_VIRTIO_GPU_PIPE;
+    if (!strcmp("virtio-gpu-asg", transportValue)) return HOST_CONNECTION_VIRTIO_GPU_ADDRESS_SPACE;
+
+    return HOST_CONNECTION_QEMU_PIPE;
+#else
+    return HOST_CONNECTION_VIRTIO_GPU_ADDRESS_SPACE;
+#endif
+}
+
+static uint32_t getDrawCallFlushIntervalFromProperty() {
+    constexpr uint32_t kDefaultValue = 800;
+
+    char flushValue[PROPERTY_VALUE_MAX] = "";
+    property_get("ro.boot.qemu.gltransport.drawFlushInterval", flushValue, "");
+    if (!flushValue[0]) return kDefaultValue;
+
+    const long interval = strtol(flushValue, 0, 10);
+    return (interval > 0) ? uint32_t(interval) : kDefaultValue;
+}
+
+static GrallocType getGrallocTypeFromProperty() {
+    char value[PROPERTY_VALUE_MAX] = "";
+    property_get("ro.hardware.gralloc", value, "");
+
+    if (!value[0]) return GRALLOC_TYPE_RANCHU;
+
+    if (!strcmp("ranchu", value)) return GRALLOC_TYPE_RANCHU;
+    if (!strcmp("minigbm", value)) return GRALLOC_TYPE_MINIGBM;
+    return GRALLOC_TYPE_RANCHU;
+}
+
+class GoldfishGralloc : public Gralloc
+{
+public:
+    virtual uint32_t createColorBuffer(
+        ExtendedRCEncoderContext* rcEnc,
+        int width, int height, uint32_t glformat) {
+        return rcEnc->rcCreateColorBuffer(
+            rcEnc, width, height, glformat);
+    }
+
+    virtual uint32_t getHostHandle(native_handle_t const* handle)
+    {
+        return cb_handle_t::from(handle)->hostHandle;
+    }
+
+    virtual int getFormat(native_handle_t const* handle)
+    {
+        return cb_handle_t::from(handle)->format;
+    }
+
+    virtual size_t getAllocatedSize(native_handle_t const* handle)
+    {
+        return static_cast<size_t>(cb_handle_t::from(handle)->allocatedSize());
+    }
+};
+
+static inline uint32_t align_up(uint32_t n, uint32_t a) {
+    return ((n + a - 1) / a) * a;
+}
+
+#if defined(VIRTIO_GPU)
+
+class MinigbmGralloc : public Gralloc {
+public:
+    virtual uint32_t createColorBuffer(
+        ExtendedRCEncoderContext*,
+        int width, int height, uint32_t glformat) {
+
+        // Only supported format for pbuffers in gfxstream
+        // should be RGBA8
+        const uint32_t kGlRGB = 0x1907;
+        const uint32_t kGlRGBA = 0x1908;
+        const uint32_t kVirglFormatRGBA = 67; // VIRGL_FORMAT_R8G8B8A8_UNORM;
+        uint32_t virtgpu_format = 0;
+        uint32_t bpp = 0;
+        switch (glformat) {
+            case kGlRGB:
+                DPRINT("Note: egl wanted GL_RGB, still using RGBA");
+                virtgpu_format = kVirglFormatRGBA;
+                bpp = 4;
+                break;
+            case kGlRGBA:
+                virtgpu_format = kVirglFormatRGBA;
+                bpp = 4;
+                break;
+            default:
+                DPRINT("Note: egl wanted 0x%x, still using RGBA", glformat);
+                virtgpu_format = kVirglFormatRGBA;
+                bpp = 4;
+                break;
+        }
+        const uint32_t kPipeTexture2D = 2; // PIPE_TEXTURE_2D
+        const uint32_t kBindRenderTarget = 1 << 1; // VIRGL_BIND_RENDER_TARGET
+        struct drm_virtgpu_resource_create res_create;
+        memset(&res_create, 0, sizeof(res_create));
+        res_create.target = kPipeTexture2D;
+        res_create.format = virtgpu_format;
+        res_create.bind = kBindRenderTarget;
+        res_create.width = width;
+        res_create.height = height;
+        res_create.depth = 1;
+        res_create.array_size = 1;
+        res_create.last_level = 0;
+        res_create.nr_samples = 0;
+        res_create.stride = bpp * width;
+        res_create.size = align_up(bpp * width * height, PAGE_SIZE);
+
+        int ret = drmIoctl(m_fd, DRM_IOCTL_VIRTGPU_RESOURCE_CREATE, &res_create);
+        if (ret) {
+            ALOGE("%s: DRM_IOCTL_VIRTGPU_RESOURCE_CREATE failed with %s (%d)\n", __func__,
+                  strerror(errno), errno);
+            abort();
+        }
+
+        return res_create.res_handle;
+    }
+
+    virtual uint32_t getHostHandle(native_handle_t const* handle) {
+        struct drm_virtgpu_resource_info info;
+        if (!getResInfo(handle, &info)) {
+            ALOGE("%s: failed to get resource info\n", __func__);
+            return 0;
+        }
+
+        return info.res_handle;
+    }
+
+    virtual int getFormat(native_handle_t const* handle) {
+        return ((cros_gralloc_handle *)handle)->droid_format;
+    }
+
+    virtual uint32_t getFormatDrmFourcc(native_handle_t const* handle) override {
+	return ((cros_gralloc_handle *)handle)->format;
+    }
+
+    virtual size_t getAllocatedSize(native_handle_t const* handle) {
+        struct drm_virtgpu_resource_info info;
+        if (!getResInfo(handle, &info)) {
+            ALOGE("%s: failed to get resource info\n", __func__);
+            return 0;
+        }
+
+        return info.size;
+    }
+
+    void setFd(int fd) { m_fd = fd; }
+
+private:
+
+    bool getResInfo(native_handle_t const* handle,
+                    struct drm_virtgpu_resource_info* info) {
+        memset(info, 0x0, sizeof(*info));
+        if (m_fd < 0) {
+            ALOGE("%s: Error, rendernode fd missing\n", __func__);
+            return false;
+        }
+
+        struct drm_gem_close gem_close;
+        memset(&gem_close, 0x0, sizeof(gem_close));
+
+        cros_gralloc_handle const* cros_handle =
+            reinterpret_cast<cros_gralloc_handle const*>(handle);
+
+        uint32_t prime_handle;
+        int ret = drmPrimeFDToHandle(m_fd, cros_handle->fds[0], &prime_handle);
+        if (ret) {
+            ALOGE("%s: DRM_IOCTL_PRIME_FD_TO_HANDLE failed: %s (errno %d)\n",
+                  __func__, strerror(errno), errno);
+            return false;
+        }
+        struct ManagedDrmGem {
+            ManagedDrmGem(const ManagedDrmGem&) = delete;
+            ~ManagedDrmGem() {
+                struct drm_gem_close gem_close {
+                    .handle = m_prime_handle,
+                    .pad = 0,
+                };
+                int ret = drmIoctl(m_fd, DRM_IOCTL_GEM_CLOSE, &gem_close);
+                if (ret) {
+                    ALOGE("%s: DRM_IOCTL_GEM_CLOSE failed on handle %" PRIu32 ": %s(%d).",
+                          __func__, m_prime_handle, strerror(errno), errno);
+                }
+            }
+
+            int m_fd;
+            uint32_t m_prime_handle;
+        } managed_prime_handle{
+            .m_fd = m_fd,
+            .m_prime_handle = prime_handle,
+        };
+
+        info->bo_handle = managed_prime_handle.m_prime_handle;
+
+        struct drm_virtgpu_3d_wait virtgpuWait{
+            .handle = managed_prime_handle.m_prime_handle,
+            .flags = 0,
+        };
+        // This only works for host resources by VIRTGPU_RESOURCE_CREATE ioctl.
+        // We need to use a different mechanism to synchonize with the host if
+        // the minigbm gralloc swiches to virtio-gpu blobs or cross-domain
+        // backend.
+        ret = drmIoctl(m_fd, DRM_IOCTL_VIRTGPU_WAIT, &virtgpuWait);
+        if (ret) {
+            ALOGE("%s: DRM_IOCTL_VIRTGPU_WAIT failed: %s(%d)", __func__, strerror(errno), errno);
+            return false;
+        }
+
+        ret = drmIoctl(m_fd, DRM_IOCTL_VIRTGPU_RESOURCE_INFO, info);
+        if (ret) {
+            ALOGE("%s: DRM_IOCTL_VIRTGPU_RESOURCE_INFO failed: %s (errno %d)\n",
+                  __func__, strerror(errno), errno);
+            return false;
+        }
+
+        return true;
+    }
+
+    int m_fd = -1;
+};
+
+#else
+
+class MinigbmGralloc : public Gralloc {
+public:
+    virtual uint32_t createColorBuffer(
+        ExtendedRCEncoderContext*,
+        int width, int height, uint32_t glformat) {
+        ALOGE("%s: Error: using minigbm without -DVIRTIO_GPU\n", __func__);
+        return 0;
+    }
+
+    virtual uint32_t getHostHandle(native_handle_t const* handle) {
+        ALOGE("%s: Error: using minigbm without -DVIRTIO_GPU\n", __func__);
+        return 0;
+    }
+
+    virtual int getFormat(native_handle_t const* handle) {
+        ALOGE("%s: Error: using minigbm without -DVIRTIO_GPU\n", __func__);
+        return 0;
+    }
+
+    virtual size_t getAllocatedSize(native_handle_t const* handle) {
+        ALOGE("%s: Error: using minigbm without -DVIRTIO_GPU\n", __func__);
+        return 0;
+    }
+
+    void setFd(int fd) { m_fd = fd; }
+
+private:
+
+    int m_fd = -1;
+};
+
+#endif
+
+class GoldfishProcessPipe : public ProcessPipe
+{
+public:
+    bool processPipeInit(int stream_handle, HostConnectionType connType, renderControl_encoder_context_t *rcEnc)
+    {
+        return ::processPipeInit(stream_handle, connType, rcEnc);
+    }
+
+};
+
+static GoldfishGralloc m_goldfishGralloc;
+static GoldfishProcessPipe m_goldfishProcessPipe;
+
+HostConnection::HostConnection() :
+    exitUncleanly(false),
+    m_checksumHelper(),
+    m_hostExtensions(),
+    m_grallocOnly(true),
+    m_noHostError(true),
+    m_rendernodeFd(-1) {
+#ifdef HOST_BUILD
+    android::base::initializeTracing();
+#endif
+}
+
+HostConnection::~HostConnection()
+{
+    // round-trip to ensure that queued commands have been processed
+    // before process pipe closure is detected.
+    if (m_rcEnc && !exitUncleanly) {
+        (void)m_rcEnc->rcGetRendererVersion(m_rcEnc.get());
+    }
+
+    if (m_grallocType == GRALLOC_TYPE_MINIGBM) {
+        delete m_grallocHelper;
+    }
+
+    if (m_vkEnc) {
+        m_vkEnc->decRef();
+    }
+
+    if (m_stream) {
+        m_stream->decRef();
+    }
+}
+
+
+// static
+std::unique_ptr<HostConnection> HostConnection::connect(uint32_t capset_id) {
+    const enum HostConnectionType connType = getConnectionTypeFromProperty();
+
+    // Use "new" to access a non-public constructor.
+    auto con = std::unique_ptr<HostConnection>(new HostConnection);
+
+    switch (connType) {
+        case HOST_CONNECTION_ADDRESS_SPACE: {
+            auto stream = createAddressSpaceStream(STREAM_BUFFER_SIZE, getGlobalHealthMonitor());
+            if (!stream) {
+                ALOGE("Failed to create AddressSpaceStream for host connection\n");
+                return nullptr;
+            }
+            con->m_connectionType = HOST_CONNECTION_ADDRESS_SPACE;
+            con->m_grallocType = GRALLOC_TYPE_RANCHU;
+            con->m_stream = stream;
+            con->m_grallocHelper = &m_goldfishGralloc;
+            con->m_processPipe = &m_goldfishProcessPipe;
+            break;
+        }
+        case HOST_CONNECTION_QEMU_PIPE: {
+            auto stream = new QemuPipeStream(STREAM_BUFFER_SIZE);
+            if (!stream) {
+                ALOGE("Failed to create QemuPipeStream for host connection\n");
+                return nullptr;
+            }
+            if (stream->connect() < 0) {
+                ALOGE("Failed to connect to host (QemuPipeStream)\n");
+                return nullptr;
+            }
+            con->m_connectionType = HOST_CONNECTION_QEMU_PIPE;
+            con->m_grallocType = GRALLOC_TYPE_RANCHU;
+            con->m_stream = stream;
+            con->m_grallocHelper = &m_goldfishGralloc;
+            con->m_processPipe = &m_goldfishProcessPipe;
+            break;
+        }
+        case HOST_CONNECTION_TCP: {
+#ifndef __ANDROID__
+            ALOGE("Failed to create TCP connection on non-Android guest\n");
+            return nullptr;
+            break;
+#else
+            auto stream = new TcpStream(STREAM_BUFFER_SIZE);
+            if (!stream) {
+                ALOGE("Failed to create TcpStream for host connection\n");
+                return nullptr;
+            }
+
+            if (stream->connect("10.0.2.2", STREAM_PORT_NUM) < 0) {
+                ALOGE("Failed to connect to host (TcpStream)\n");
+                return nullptr;
+            }
+            con->m_connectionType = HOST_CONNECTION_TCP;
+            con->m_grallocType = GRALLOC_TYPE_RANCHU;
+            con->m_stream = stream;
+            con->m_grallocHelper = &m_goldfishGralloc;
+            con->m_processPipe = &m_goldfishProcessPipe;
+            break;
+#endif
+        }
+#if defined(VIRTIO_GPU) && !defined(HOST_BUILD)
+        case HOST_CONNECTION_VIRTIO_GPU_PIPE: {
+            auto stream = new VirtioGpuPipeStream(STREAM_BUFFER_SIZE);
+            if (!stream) {
+                ALOGE("Failed to create VirtioGpu for host connection\n");
+                return nullptr;
+            }
+            if (stream->connect() < 0) {
+                ALOGE("Failed to connect to host (VirtioGpu)\n");
+                return nullptr;
+            }
+            con->m_connectionType = HOST_CONNECTION_VIRTIO_GPU_PIPE;
+            con->m_grallocType = getGrallocTypeFromProperty();
+            auto rendernodeFd = stream->getRendernodeFd();
+            con->m_stream = stream;
+            con->m_rendernodeFd = rendernodeFd;
+            switch (con->m_grallocType) {
+                case GRALLOC_TYPE_RANCHU:
+                    con->m_grallocHelper = &m_goldfishGralloc;
+                    break;
+                case GRALLOC_TYPE_MINIGBM: {
+                    MinigbmGralloc* m = new MinigbmGralloc;
+                    m->setFd(rendernodeFd);
+                    con->m_grallocHelper = m;
+                    break;
+                }
+                default:
+                    ALOGE("Fatal: Unknown gralloc type 0x%x\n", con->m_grallocType);
+                    abort();
+            }
+            con->m_processPipe = &m_goldfishProcessPipe;
+            break;
+        }
+        case HOST_CONNECTION_VIRTIO_GPU_ADDRESS_SPACE: {
+            VirtGpuDevice& instance =
+                VirtGpuDevice::getInstance((enum VirtGpuCapset)kCapsetGfxStream);
+            auto deviceHandle = instance.getDeviceHandle();
+            auto stream = createVirtioGpuAddressSpaceStream(getGlobalHealthMonitor());
+            if (!stream) {
+                ALOGE("Failed to create virtgpu AddressSpaceStream\n");
+                return nullptr;
+            }
+            con->m_connectionType = HOST_CONNECTION_VIRTIO_GPU_ADDRESS_SPACE;
+            con->m_grallocType = getGrallocTypeFromProperty();
+            con->m_stream = stream;
+            con->m_rendernodeFd = deviceHandle;
+            switch (con->m_grallocType) {
+                case GRALLOC_TYPE_RANCHU:
+                    con->m_grallocHelper = &m_goldfishGralloc;
+                    break;
+                case GRALLOC_TYPE_MINIGBM: {
+                    MinigbmGralloc* m = new MinigbmGralloc;
+                    m->setFd(deviceHandle);
+                    con->m_grallocHelper = m;
+                    break;
+                }
+                default:
+                    ALOGE("Fatal: Unknown gralloc type 0x%x\n", con->m_grallocType);
+                    abort();
+            }
+            con->m_processPipe = &m_goldfishProcessPipe;
+            break;
+        }
+#endif // !VIRTIO_GPU && !HOST_BUILD_
+        default:
+            break;
+    }
+
+    // send zero 'clientFlags' to the host.
+    unsigned int *pClientFlags =
+            (unsigned int *)con->m_stream->allocBuffer(sizeof(unsigned int));
+    *pClientFlags = 0;
+    con->m_stream->commitBuffer(sizeof(unsigned int));
+
+#if defined(__linux__) || defined(__ANDROID__)
+    auto rcEnc = con->rcEncoder();
+    if (rcEnc != nullptr) {
+        auto processName = android::base::guest::getProcessName();
+        if (!processName.empty()) {
+            rcEnc->rcSetProcessMetadata(
+                rcEnc, const_cast<char*>("process_name"),
+                const_cast<RenderControlByte*>(processName.c_str()),
+                strlen(processName.c_str())+ 1);
+        }
+    }
+#endif
+
+    return con;
+}
+
+HostConnection *HostConnection::get() {
+    return getWithThreadInfo(getEGLThreadInfo(), VIRTIO_GPU_CAPSET_NONE);
+}
+
+HostConnection *HostConnection::getOrCreate(uint32_t capset_id) {
+    return getWithThreadInfo(getEGLThreadInfo(), capset_id);
+}
+
+HostConnection *HostConnection::getWithThreadInfo(EGLThreadInfo* tinfo, uint32_t capset_id) {
+    // Get thread info
+    if (!tinfo) {
+        return NULL;
+    }
+
+    if (tinfo->hostConn == NULL) {
+        tinfo->hostConn = HostConnection::createUnique(capset_id);
+    }
+
+    return tinfo->hostConn.get();
+}
+
+void HostConnection::exit() {
+    EGLThreadInfo *tinfo = getEGLThreadInfo();
+    if (!tinfo) {
+        return;
+    }
+
+    tinfo->hostConn.reset();
+}
+
+void HostConnection::exitUnclean() {
+    EGLThreadInfo *tinfo = getEGLThreadInfo();
+    if (!tinfo) {
+        return;
+    }
+
+    tinfo->hostConn->exitUncleanly = true;
+    tinfo->hostConn.reset();
+}
+
+// static
+std::unique_ptr<HostConnection> HostConnection::createUnique(uint32_t capset_id) {
+    return connect(capset_id);
+}
+
+GLEncoder *HostConnection::glEncoder()
+{
+    if (!m_glEnc) {
+        m_glEnc = std::make_unique<GLEncoder>(m_stream, checksumHelper());
+        DBG("HostConnection::glEncoder new encoder %p, tid %lu", m_glEnc, getCurrentThreadId());
+        m_glEnc->setContextAccessor(s_getGLContext);
+    }
+    return m_glEnc.get();
+}
+
+GL2Encoder *HostConnection::gl2Encoder()
+{
+    if (!m_gl2Enc) {
+        m_gl2Enc =
+            std::make_unique<GL2Encoder>(m_stream, checksumHelper());
+        DBG("HostConnection::gl2Encoder new encoder %p, tid %lu", m_gl2Enc, getCurrentThreadId());
+        m_gl2Enc->setContextAccessor(s_getGL2Context);
+        m_gl2Enc->setNoHostError(m_noHostError);
+        m_gl2Enc->setDrawCallFlushInterval(
+            getDrawCallFlushIntervalFromProperty());
+        m_gl2Enc->setHasAsyncUnmapBuffer(m_rcEnc->hasAsyncUnmapBuffer());
+        m_gl2Enc->setHasSyncBufferData(m_rcEnc->hasSyncBufferData());
+    }
+    return m_gl2Enc.get();
+}
+
+VkEncoder *HostConnection::vkEncoder()
+{
+    rcEncoder();
+    if (!m_vkEnc) {
+        m_vkEnc = new VkEncoder(m_stream, getGlobalHealthMonitor());
+    }
+    return m_vkEnc;
+}
+
+ExtendedRCEncoderContext *HostConnection::rcEncoder()
+{
+    if (!m_rcEnc) {
+        m_rcEnc = std::make_unique<ExtendedRCEncoderContext>(m_stream,
+                                                             checksumHelper());
+
+        ExtendedRCEncoderContext* rcEnc = m_rcEnc.get();
+        setChecksumHelper(rcEnc);
+        queryAndSetSyncImpl(rcEnc);
+        queryAndSetDmaImpl(rcEnc);
+        queryAndSetGLESMaxVersion(rcEnc);
+        queryAndSetNoErrorState(rcEnc);
+        queryAndSetHostCompositionImpl(rcEnc);
+        queryAndSetDirectMemSupport(rcEnc);
+        queryAndSetVulkanSupport(rcEnc);
+        queryAndSetDeferredVulkanCommandsSupport(rcEnc);
+        queryAndSetVulkanNullOptionalStringsSupport(rcEnc);
+        queryAndSetVulkanCreateResourcesWithRequirementsSupport(rcEnc);
+        queryAndSetVulkanIgnoredHandles(rcEnc);
+        queryAndSetYUVCache(rcEnc);
+        queryAndSetAsyncUnmapBuffer(rcEnc);
+        queryAndSetVirtioGpuNext(rcEnc);
+        queryHasSharedSlotsHostMemoryAllocator(rcEnc);
+        queryAndSetVulkanFreeMemorySync(rcEnc);
+        queryAndSetVirtioGpuNativeSync(rcEnc);
+        queryAndSetVulkanShaderFloat16Int8Support(rcEnc);
+        queryAndSetVulkanAsyncQueueSubmitSupport(rcEnc);
+        queryAndSetHostSideTracingSupport(rcEnc);
+        queryAndSetAsyncFrameCommands(rcEnc);
+        queryAndSetVulkanQueueSubmitWithCommandsSupport(rcEnc);
+        queryAndSetVulkanBatchedDescriptorSetUpdateSupport(rcEnc);
+        queryAndSetSyncBufferData(rcEnc);
+        queryAndSetVulkanAsyncQsri(rcEnc);
+        queryAndSetReadColorBufferDma(rcEnc);
+        queryAndSetHWCMultiConfigs(rcEnc);
+        queryAndSetVulkanAuxCommandBufferMemory(rcEnc);
+        queryVersion(rcEnc);
+        if (m_processPipe) {
+            auto fd = (m_connectionType == HOST_CONNECTION_VIRTIO_GPU_ADDRESS_SPACE) ? m_rendernodeFd : -1;
+            m_processPipe->processPipeInit(fd, m_connectionType, rcEnc);
+        }
+    }
+    return m_rcEnc.get();
+}
+
+gl_client_context_t *HostConnection::s_getGLContext()
+{
+    EGLThreadInfo *ti = getEGLThreadInfo();
+    if (ti->hostConn) {
+        return ti->hostConn->m_glEnc.get();
+    }
+    return NULL;
+}
+
+gl2_client_context_t *HostConnection::s_getGL2Context()
+{
+    EGLThreadInfo *ti = getEGLThreadInfo();
+    if (ti->hostConn) {
+        return ti->hostConn->m_gl2Enc.get();
+    }
+    return NULL;
+}
+
+const std::string& HostConnection::queryHostExtensions(ExtendedRCEncoderContext *rcEnc) {
+    if (!m_hostExtensions.empty()) {
+        return m_hostExtensions;
+    }
+
+    // Extensions strings are usually quite long, preallocate enough here.
+    std::string extensionsBuffer(1023, '\0');
+
+    // Returns the required size including the 0-terminator, so
+    // account it when passing/using the sizes.
+    int extensionSize = rcEnc->rcGetHostExtensionsString(rcEnc,
+                                                         extensionsBuffer.size() + 1,
+                                                         &extensionsBuffer[0]);
+    if (extensionSize < 0) {
+        extensionsBuffer.resize(-extensionSize);
+        extensionSize = rcEnc->rcGetHostExtensionsString(rcEnc,
+                                                         -extensionSize + 1,
+                                                         &extensionsBuffer[0]);
+    }
+
+    if (extensionSize > 0) {
+        extensionsBuffer.resize(extensionSize - 1);
+        m_hostExtensions.swap(extensionsBuffer);
+    }
+
+    return m_hostExtensions;
+}
+
+void HostConnection::queryAndSetHostCompositionImpl(ExtendedRCEncoderContext *rcEnc) {
+    const std::string& hostExtensions = queryHostExtensions(rcEnc);
+    DPRINT("HostComposition ext %s", hostExtensions.c_str());
+    // make sure V2 is checked first before V1, as host may declare supporting both
+    if (hostExtensions.find(kHostCompositionV2) != std::string::npos) {
+        rcEnc->setHostComposition(HOST_COMPOSITION_V2);
+    }
+    else if (hostExtensions.find(kHostCompositionV1) != std::string::npos) {
+        rcEnc->setHostComposition(HOST_COMPOSITION_V1);
+    }
+    else {
+        rcEnc->setHostComposition(HOST_COMPOSITION_NONE);
+    }
+}
+
+void HostConnection::setChecksumHelper(ExtendedRCEncoderContext *rcEnc) {
+    const std::string& hostExtensions = queryHostExtensions(rcEnc);
+    // check the host supported version
+    uint32_t checksumVersion = 0;
+    const char* checksumPrefix = ChecksumCalculator::getMaxVersionStrPrefix();
+    const char* glProtocolStr = strstr(hostExtensions.c_str(), checksumPrefix);
+    if (glProtocolStr) {
+        uint32_t maxVersion = ChecksumCalculator::getMaxVersion();
+        sscanf(glProtocolStr+strlen(checksumPrefix), "%d", &checksumVersion);
+        if (maxVersion < checksumVersion) {
+            checksumVersion = maxVersion;
+        }
+        // The ordering of the following two commands matters!
+        // Must tell the host first before setting it in the guest
+        rcEnc->rcSelectChecksumHelper(rcEnc, checksumVersion, 0);
+        m_checksumHelper.setVersion(checksumVersion);
+    }
+}
+
+void HostConnection::queryAndSetSyncImpl(ExtendedRCEncoderContext *rcEnc) {
+    const std::string& hostExtensions = queryHostExtensions(rcEnc);
+    if (hostExtensions.find(kRCNativeSyncV4) != std::string::npos) {
+        rcEnc->setSyncImpl(SYNC_IMPL_NATIVE_SYNC_V4);
+    } else if (hostExtensions.find(kRCNativeSyncV3) != std::string::npos) {
+        rcEnc->setSyncImpl(SYNC_IMPL_NATIVE_SYNC_V3);
+    } else if (hostExtensions.find(kRCNativeSyncV2) != std::string::npos) {
+        rcEnc->setSyncImpl(SYNC_IMPL_NATIVE_SYNC_V2);
+    } else {
+        rcEnc->setSyncImpl(SYNC_IMPL_NONE);
+    }
+}
+
+void HostConnection::queryAndSetDmaImpl(ExtendedRCEncoderContext *rcEnc) {
+    std::string hostExtensions = queryHostExtensions(rcEnc);
+    if (hostExtensions.find(kDmaExtStr_v1) != std::string::npos) {
+        rcEnc->setDmaImpl(DMA_IMPL_v1);
+    } else {
+        rcEnc->setDmaImpl(DMA_IMPL_NONE);
+    }
+}
+
+void HostConnection::queryAndSetGLESMaxVersion(ExtendedRCEncoderContext* rcEnc) {
+    std::string hostExtensions = queryHostExtensions(rcEnc);
+    if (hostExtensions.find(kGLESMaxVersion_2) != std::string::npos) {
+        rcEnc->setGLESMaxVersion(GLES_MAX_VERSION_2);
+    } else if (hostExtensions.find(kGLESMaxVersion_3_0) != std::string::npos) {
+        rcEnc->setGLESMaxVersion(GLES_MAX_VERSION_3_0);
+    } else if (hostExtensions.find(kGLESMaxVersion_3_1) != std::string::npos) {
+        rcEnc->setGLESMaxVersion(GLES_MAX_VERSION_3_1);
+    } else if (hostExtensions.find(kGLESMaxVersion_3_2) != std::string::npos) {
+        rcEnc->setGLESMaxVersion(GLES_MAX_VERSION_3_2);
+    } else {
+        ALOGW("Unrecognized GLES max version string in extensions: %s",
+              hostExtensions.c_str());
+        rcEnc->setGLESMaxVersion(GLES_MAX_VERSION_2);
+    }
+}
+
+void HostConnection::queryAndSetNoErrorState(ExtendedRCEncoderContext* rcEnc) {
+    std::string hostExtensions = queryHostExtensions(rcEnc);
+    if (hostExtensions.find(kGLESUseHostError) != std::string::npos) {
+        m_noHostError = false;
+    }
+}
+
+void HostConnection::queryAndSetDirectMemSupport(ExtendedRCEncoderContext* rcEnc) {
+    std::string hostExtensions = queryHostExtensions(rcEnc);
+    if (hostExtensions.find(kGLDirectMem) != std::string::npos) {
+        rcEnc->featureInfo()->hasDirectMem = true;
+    }
+}
+
+void HostConnection::queryAndSetVulkanSupport(ExtendedRCEncoderContext* rcEnc) {
+    std::string hostExtensions = queryHostExtensions(rcEnc);
+    if (hostExtensions.find(kVulkan) != std::string::npos) {
+        rcEnc->featureInfo()->hasVulkan = true;
+    }
+}
+
+void HostConnection::queryAndSetDeferredVulkanCommandsSupport(ExtendedRCEncoderContext* rcEnc) {
+    std::string hostExtensions = queryHostExtensions(rcEnc);
+    if (hostExtensions.find(kDeferredVulkanCommands) != std::string::npos) {
+        rcEnc->featureInfo()->hasDeferredVulkanCommands = true;
+    }
+}
+
+void HostConnection::queryAndSetVulkanNullOptionalStringsSupport(ExtendedRCEncoderContext* rcEnc) {
+    std::string hostExtensions = queryHostExtensions(rcEnc);
+    if (hostExtensions.find(kVulkanNullOptionalStrings) != std::string::npos) {
+        rcEnc->featureInfo()->hasVulkanNullOptionalStrings = true;
+    }
+}
+
+void HostConnection::queryAndSetVulkanCreateResourcesWithRequirementsSupport(ExtendedRCEncoderContext* rcEnc) {
+    std::string hostExtensions = queryHostExtensions(rcEnc);
+    if (hostExtensions.find(kVulkanCreateResourcesWithRequirements) != std::string::npos) {
+        rcEnc->featureInfo()->hasVulkanCreateResourcesWithRequirements = true;
+    }
+}
+
+void HostConnection::queryAndSetVulkanIgnoredHandles(ExtendedRCEncoderContext* rcEnc) {
+    std::string hostExtensions = queryHostExtensions(rcEnc);
+    if (hostExtensions.find(kVulkanIgnoredHandles) != std::string::npos) {
+        rcEnc->featureInfo()->hasVulkanIgnoredHandles = true;
+    }
+}
+
+void HostConnection::queryAndSetYUVCache(ExtendedRCEncoderContext* rcEnc) {
+    std::string hostExtensions = queryHostExtensions(rcEnc);
+    if (hostExtensions.find(kYUVCache) != std::string::npos) {
+        rcEnc->featureInfo()->hasYUVCache = true;
+    }
+}
+
+void HostConnection::queryAndSetAsyncUnmapBuffer(ExtendedRCEncoderContext* rcEnc) {
+    std::string hostExtensions = queryHostExtensions(rcEnc);
+    if (hostExtensions.find(kAsyncUnmapBuffer) != std::string::npos) {
+        rcEnc->featureInfo()->hasAsyncUnmapBuffer = true;
+    }
+}
+
+void HostConnection::queryAndSetVirtioGpuNext(ExtendedRCEncoderContext* rcEnc) {
+    std::string hostExtensions = queryHostExtensions(rcEnc);
+    if (hostExtensions.find(kVirtioGpuNext) != std::string::npos) {
+        rcEnc->featureInfo()->hasVirtioGpuNext = true;
+    }
+}
+
+void HostConnection::queryHasSharedSlotsHostMemoryAllocator(ExtendedRCEncoderContext *rcEnc) {
+    const std::string& hostExtensions = queryHostExtensions(rcEnc);
+    if (hostExtensions.find(kHasSharedSlotsHostMemoryAllocator) != std::string::npos) {
+        rcEnc->featureInfo()->hasSharedSlotsHostMemoryAllocator = true;
+    }
+}
+
+void HostConnection::queryAndSetVulkanFreeMemorySync(ExtendedRCEncoderContext *rcEnc) {
+    const std::string& hostExtensions = queryHostExtensions(rcEnc);
+    if (hostExtensions.find(kVulkanFreeMemorySync) != std::string::npos) {
+        rcEnc->featureInfo()->hasVulkanFreeMemorySync = true;
+    }
+}
+
+void HostConnection::queryAndSetVirtioGpuNativeSync(ExtendedRCEncoderContext* rcEnc) {
+    std::string hostExtensions = queryHostExtensions(rcEnc);
+    if (hostExtensions.find(kVirtioGpuNativeSync) != std::string::npos) {
+        rcEnc->featureInfo()->hasVirtioGpuNativeSync = true;
+    }
+}
+
+void HostConnection::queryAndSetVulkanShaderFloat16Int8Support(ExtendedRCEncoderContext* rcEnc) {
+    std::string hostExtensions = queryHostExtensions(rcEnc);
+    if (hostExtensions.find(kVulkanShaderFloat16Int8) != std::string::npos) {
+        rcEnc->featureInfo()->hasVulkanShaderFloat16Int8 = true;
+    }
+}
+
+void HostConnection::queryAndSetVulkanAsyncQueueSubmitSupport(ExtendedRCEncoderContext* rcEnc) {
+    std::string hostExtensions = queryHostExtensions(rcEnc);
+    if (hostExtensions.find(kVulkanAsyncQueueSubmit) != std::string::npos) {
+        rcEnc->featureInfo()->hasVulkanAsyncQueueSubmit = true;
+    }
+}
+
+void HostConnection::queryAndSetHostSideTracingSupport(ExtendedRCEncoderContext* rcEnc) {
+    std::string hostExtensions = queryHostExtensions(rcEnc);
+    if (hostExtensions.find(kHostSideTracing) != std::string::npos) {
+        rcEnc->featureInfo()->hasHostSideTracing = true;
+    }
+}
+
+void HostConnection::queryAndSetAsyncFrameCommands(ExtendedRCEncoderContext* rcEnc) {
+    std::string hostExtensions = queryHostExtensions(rcEnc);
+    if (hostExtensions.find(kAsyncFrameCommands) != std::string::npos) {
+        rcEnc->featureInfo()->hasAsyncFrameCommands = true;
+    }
+}
+
+void HostConnection::queryAndSetVulkanQueueSubmitWithCommandsSupport(ExtendedRCEncoderContext* rcEnc) {
+    std::string hostExtensions = queryHostExtensions(rcEnc);
+    if (hostExtensions.find(kVulkanQueueSubmitWithCommands) != std::string::npos) {
+        rcEnc->featureInfo()->hasVulkanQueueSubmitWithCommands = true;
+    }
+}
+
+void HostConnection::queryAndSetVulkanBatchedDescriptorSetUpdateSupport(ExtendedRCEncoderContext* rcEnc) {
+    std::string hostExtensions = queryHostExtensions(rcEnc);
+    if (hostExtensions.find(kVulkanBatchedDescriptorSetUpdate) != std::string::npos) {
+        rcEnc->featureInfo()->hasVulkanBatchedDescriptorSetUpdate = true;
+    }
+}
+
+void HostConnection::queryAndSetSyncBufferData(ExtendedRCEncoderContext* rcEnc) {
+    std::string hostExtensions = queryHostExtensions(rcEnc);
+    if (hostExtensions.find(kSyncBufferData) != std::string::npos) {
+        rcEnc->featureInfo()->hasSyncBufferData = true;
+    }
+}
+
+void HostConnection::queryAndSetVulkanAsyncQsri(ExtendedRCEncoderContext* rcEnc) {
+    std::string hostExtensions = queryHostExtensions(rcEnc);
+    if (hostExtensions.find(kVulkanAsyncQsri) != std::string::npos) {
+        rcEnc->featureInfo()->hasVulkanAsyncQsri = true;
+    }
+}
+
+void HostConnection::queryAndSetReadColorBufferDma(ExtendedRCEncoderContext* rcEnc) {
+    std::string hostExtensions = queryHostExtensions(rcEnc);
+    if (hostExtensions.find(kReadColorBufferDma) != std::string::npos) {
+        rcEnc->featureInfo()->hasReadColorBufferDma = true;
+    }
+}
+
+void HostConnection::queryAndSetHWCMultiConfigs(ExtendedRCEncoderContext* rcEnc) {
+    std::string hostExtensions = queryHostExtensions(rcEnc);
+    if (hostExtensions.find(kHWCMultiConfigs) != std::string::npos) {
+        rcEnc->featureInfo()->hasHWCMultiConfigs = true;
+    }
+}
+
+void HostConnection::queryAndSetVulkanAuxCommandBufferMemory(ExtendedRCEncoderContext* rcEnc) {
+    std::string hostExtensions = queryHostExtensions(rcEnc);
+    rcEnc->featureInfo()->hasVulkanAuxCommandMemory = hostExtensions.find(kVulkanAuxCommandMemory) != std::string::npos;
+}
+
+
+GLint HostConnection::queryVersion(ExtendedRCEncoderContext* rcEnc) {
+    GLint version = m_rcEnc->rcGetRendererVersion(m_rcEnc.get());
+    return version;
+}
diff --git a/system/OpenglSystemCommon/HostConnection.h b/system/OpenglSystemCommon/HostConnection.h
new file mode 100644
index 0000000..0df5887
--- /dev/null
+++ b/system/OpenglSystemCommon/HostConnection.h
@@ -0,0 +1,294 @@
+/*
+* Copyright (C) 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#ifndef __COMMON_HOST_CONNECTION_H
+#define __COMMON_HOST_CONNECTION_H
+
+#include "EmulatorFeatureInfo.h"
+#include "IOStream.h"
+#include "renderControl_enc.h"
+#include "ChecksumCalculator.h"
+#ifdef __Fuchsia__
+struct goldfish_dma_context;
+#else
+#include "goldfish_dma.h"
+#endif
+
+#include <cutils/native_handle.h>
+
+#ifdef GFXSTREAM
+#include <mutex>
+#else
+#include <utils/threads.h>
+#endif
+
+#include <memory>
+#include <optional>
+#include <cstring>
+
+class GLEncoder;
+struct gl_client_context_t;
+class GL2Encoder;
+struct gl2_client_context_t;
+
+namespace gfxstream {
+namespace vk {
+class VkEncoder;
+}  // namespace vk
+}  // namespace gfxstream
+
+// ExtendedRCEncoderContext is an extended version of renderControl_encoder_context_t
+// that will be used to track available emulator features.
+class ExtendedRCEncoderContext : public renderControl_encoder_context_t {
+public:
+    ExtendedRCEncoderContext(gfxstream::IOStream *stream, ChecksumCalculator *checksumCalculator)
+        : renderControl_encoder_context_t(stream, checksumCalculator),
+          m_dmaCxt(NULL), m_dmaPtr(NULL), m_dmaPhysAddr(0) { }
+    void setSyncImpl(SyncImpl syncImpl) { m_featureInfo.syncImpl = syncImpl; }
+    void setDmaImpl(DmaImpl dmaImpl) { m_featureInfo.dmaImpl = dmaImpl; }
+    void setHostComposition(HostComposition hostComposition) {
+        m_featureInfo.hostComposition = hostComposition; }
+    bool hasNativeSync() const { return m_featureInfo.syncImpl >= SYNC_IMPL_NATIVE_SYNC_V2; }
+    bool hasNativeSyncV3() const { return m_featureInfo.syncImpl >= SYNC_IMPL_NATIVE_SYNC_V3; }
+    bool hasNativeSyncV4() const { return m_featureInfo.syncImpl >= SYNC_IMPL_NATIVE_SYNC_V4; }
+    bool hasVirtioGpuNativeSync() const { return m_featureInfo.hasVirtioGpuNativeSync; }
+    bool hasHostCompositionV1() const {
+        return m_featureInfo.hostComposition == HOST_COMPOSITION_V1; }
+    bool hasHostCompositionV2() const {
+        return m_featureInfo.hostComposition == HOST_COMPOSITION_V2; }
+    bool hasYUVCache() const {
+        return m_featureInfo.hasYUVCache; }
+    bool hasAsyncUnmapBuffer() const {
+        return m_featureInfo.hasAsyncUnmapBuffer; }
+    bool hasHostSideTracing() const {
+        return m_featureInfo.hasHostSideTracing;
+    }
+    bool hasAsyncFrameCommands() const {
+        return m_featureInfo.hasAsyncFrameCommands;
+    }
+    bool hasSyncBufferData() const {
+        return m_featureInfo.hasSyncBufferData; }
+    bool hasHWCMultiConfigs() const {
+        return m_featureInfo.hasHWCMultiConfigs;
+    }
+    DmaImpl getDmaVersion() const { return m_featureInfo.dmaImpl; }
+    void bindDmaContext(struct goldfish_dma_context* cxt) { m_dmaCxt = cxt; }
+    void bindDmaDirectly(void* dmaPtr, uint64_t dmaPhysAddr) {
+        m_dmaPtr = dmaPtr;
+        m_dmaPhysAddr = dmaPhysAddr;
+    }
+    virtual uint64_t lockAndWriteDma(void* data, uint32_t size) {
+        if (m_dmaPtr && m_dmaPhysAddr) {
+            if (data != m_dmaPtr) {
+                memcpy(m_dmaPtr, data, size);
+            }
+            return m_dmaPhysAddr;
+        } else if (m_dmaCxt) {
+            return writeGoldfishDma(data, size, m_dmaCxt);
+        } else {
+            ALOGE("%s: ERROR: No DMA context bound!", __func__);
+            return 0;
+        }
+    }
+    void setGLESMaxVersion(GLESMaxVersion ver) { m_featureInfo.glesMaxVersion = ver; }
+    GLESMaxVersion getGLESMaxVersion() const { return m_featureInfo.glesMaxVersion; }
+    bool hasDirectMem() const {
+#ifdef HOST_BUILD
+        // unit tests do not support restoring "guest" ram because there is no VM
+        return false;
+#else
+        return m_featureInfo.hasDirectMem;
+#endif
+    }
+
+    const EmulatorFeatureInfo* featureInfo_const() const { return &m_featureInfo; }
+    EmulatorFeatureInfo* featureInfo() { return &m_featureInfo; }
+private:
+    static uint64_t writeGoldfishDma(void* data, uint32_t size,
+                                     struct goldfish_dma_context* dmaCxt) {
+#ifdef __Fuchsia__
+        ALOGE("%s Not implemented!", __FUNCTION__);
+        return 0u;
+#else
+        ALOGV("%s(data=%p, size=%u): call", __func__, data, size);
+
+        goldfish_dma_write(dmaCxt, data, size);
+        uint64_t paddr = goldfish_dma_guest_paddr(dmaCxt);
+
+        ALOGV("%s: paddr=0x%llx", __func__, (unsigned long long)paddr);
+        return paddr;
+#endif
+    }
+
+    EmulatorFeatureInfo m_featureInfo;
+    struct goldfish_dma_context* m_dmaCxt;
+    void* m_dmaPtr;
+    uint64_t m_dmaPhysAddr;
+};
+
+// Abstraction for gralloc handle conversion
+class Gralloc {
+public:
+    virtual uint32_t createColorBuffer(
+        ExtendedRCEncoderContext* rcEnc, int width, int height, uint32_t glformat) = 0;
+    virtual uint32_t getHostHandle(native_handle_t const* handle) = 0;
+    virtual int getFormat(native_handle_t const* handle) = 0;
+    virtual uint32_t getFormatDrmFourcc(native_handle_t const* /*handle*/) {
+        // Equal to DRM_FORMAT_INVALID -- see <drm_fourcc.h>
+        return 0;
+    }
+    virtual size_t getAllocatedSize(native_handle_t const* handle) = 0;
+    virtual ~Gralloc() {}
+};
+
+// Abstraction for process pipe helper
+class ProcessPipe {
+public:
+    virtual bool processPipeInit(int stream_handle, HostConnectionType connType, renderControl_encoder_context_t *rcEnc) = 0;
+    virtual ~ProcessPipe() {}
+};
+
+struct EGLThreadInfo;
+
+// Rutabaga capsets.
+#define VIRTIO_GPU_CAPSET_NONE 0
+#define VIRTIO_GPU_CAPSET_VIRGL 1
+#define VIRTIO_GPU_CAPSET_VIRGL2 2
+#define VIRTIO_GPU_CAPSET_GFXSTREAM 3
+#define VIRTIO_GPU_CAPSET_VENUS 4
+#define VIRTIO_GPU_CAPSET_CROSS_DOMAIN 5
+
+class HostConnection
+{
+public:
+    static HostConnection *get();
+    static HostConnection *getOrCreate(uint32_t capset_id);
+
+    static HostConnection *getWithThreadInfo(EGLThreadInfo* tInfo,
+                                             uint32_t capset_id = VIRTIO_GPU_CAPSET_NONE);
+    static void exit();
+    static void exitUnclean(); // for testing purposes
+
+    static std::unique_ptr<HostConnection> createUnique(uint32_t capset_id = VIRTIO_GPU_CAPSET_NONE);
+    HostConnection(const HostConnection&) = delete;
+
+    ~HostConnection();
+
+    GLEncoder *glEncoder();
+    GL2Encoder *gl2Encoder();
+    gfxstream::vk::VkEncoder *vkEncoder();
+    ExtendedRCEncoderContext *rcEncoder();
+
+    int getRendernodeFd() { return m_rendernodeFd; }
+
+    ChecksumCalculator *checksumHelper() { return &m_checksumHelper; }
+    Gralloc *grallocHelper() { return m_grallocHelper; }
+
+    void flush() {
+        if (m_stream) {
+            m_stream->flush();
+        }
+    }
+
+    void setGrallocOnly(bool gralloc_only) {
+        m_grallocOnly = gralloc_only;
+    }
+
+    bool isGrallocOnly() const { return m_grallocOnly; }
+
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wthread-safety-analysis"
+#endif
+    void lock() const { m_lock.lock(); }
+    void unlock() const { m_lock.unlock(); }
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
+    bool exitUncleanly; // for testing purposes
+
+private:
+    // If the connection failed, |conn| is deleted.
+    // Returns NULL if connection failed.
+    static std::unique_ptr<HostConnection> connect(uint32_t capset_id);
+
+    HostConnection();
+    static gl_client_context_t  *s_getGLContext();
+    static gl2_client_context_t *s_getGL2Context();
+
+    const std::string& queryHostExtensions(ExtendedRCEncoderContext *rcEnc);
+    // setProtocol initilizes GL communication protocol for checksums
+    // should be called when m_rcEnc is created
+    void setChecksumHelper(ExtendedRCEncoderContext *rcEnc);
+    void queryAndSetSyncImpl(ExtendedRCEncoderContext *rcEnc);
+    void queryAndSetDmaImpl(ExtendedRCEncoderContext *rcEnc);
+    void queryAndSetGLESMaxVersion(ExtendedRCEncoderContext *rcEnc);
+    void queryAndSetNoErrorState(ExtendedRCEncoderContext *rcEnc);
+    void queryAndSetHostCompositionImpl(ExtendedRCEncoderContext *rcEnc);
+    void queryAndSetDirectMemSupport(ExtendedRCEncoderContext *rcEnc);
+    void queryAndSetVulkanSupport(ExtendedRCEncoderContext *rcEnc);
+    void queryAndSetDeferredVulkanCommandsSupport(ExtendedRCEncoderContext *rcEnc);
+    void queryAndSetVulkanNullOptionalStringsSupport(ExtendedRCEncoderContext *rcEnc);
+    void queryAndSetVulkanCreateResourcesWithRequirementsSupport(ExtendedRCEncoderContext *rcEnc);
+    void queryAndSetVulkanIgnoredHandles(ExtendedRCEncoderContext *rcEnc);
+    void queryAndSetYUVCache(ExtendedRCEncoderContext *mrcEnc);
+    void queryAndSetAsyncUnmapBuffer(ExtendedRCEncoderContext *rcEnc);
+    void queryAndSetVirtioGpuNext(ExtendedRCEncoderContext *rcEnc);
+    void queryHasSharedSlotsHostMemoryAllocator(ExtendedRCEncoderContext *rcEnc);
+    void queryAndSetVulkanFreeMemorySync(ExtendedRCEncoderContext *rcEnc);
+    void queryAndSetVirtioGpuNativeSync(ExtendedRCEncoderContext *rcEnc);
+    void queryAndSetVulkanShaderFloat16Int8Support(ExtendedRCEncoderContext *rcEnc);
+    void queryAndSetVulkanAsyncQueueSubmitSupport(ExtendedRCEncoderContext *rcEnc);
+    void queryAndSetHostSideTracingSupport(ExtendedRCEncoderContext *rcEnc);
+    void queryAndSetAsyncFrameCommands(ExtendedRCEncoderContext *rcEnc);
+    void queryAndSetVulkanQueueSubmitWithCommandsSupport(ExtendedRCEncoderContext *rcEnc);
+    void queryAndSetVulkanBatchedDescriptorSetUpdateSupport(ExtendedRCEncoderContext *rcEnc);
+    void queryAndSetSyncBufferData(ExtendedRCEncoderContext *rcEnc);
+    void queryAndSetVulkanAsyncQsri(ExtendedRCEncoderContext *rcEnc);
+    void queryAndSetReadColorBufferDma(ExtendedRCEncoderContext *rcEnc);
+    void queryAndSetHWCMultiConfigs(ExtendedRCEncoderContext* rcEnc);
+    void queryAndSetVulkanAuxCommandBufferMemory(ExtendedRCEncoderContext* rcEnc);
+    GLint queryVersion(ExtendedRCEncoderContext* rcEnc);
+
+private:
+    HostConnectionType m_connectionType;
+    GrallocType m_grallocType;
+
+    // intrusively refcounted
+    gfxstream::IOStream* m_stream = nullptr;
+
+    std::unique_ptr<GLEncoder> m_glEnc;
+    std::unique_ptr<GL2Encoder> m_gl2Enc;
+
+    // intrusively refcounted
+    gfxstream::vk::VkEncoder* m_vkEnc = nullptr;
+    std::unique_ptr<ExtendedRCEncoderContext> m_rcEnc;
+
+    ChecksumCalculator m_checksumHelper;
+    Gralloc* m_grallocHelper = nullptr;
+    ProcessPipe* m_processPipe = nullptr;
+    std::string m_hostExtensions;
+    bool m_grallocOnly;
+    bool m_noHostError;
+#ifdef GFXSTREAM
+    mutable std::mutex m_lock;
+#else
+    mutable android::Mutex m_lock;
+#endif
+    int m_rendernodeFd;
+};
+
+#endif
diff --git a/system/OpenglSystemCommon/ProcessPipe.cpp b/system/OpenglSystemCommon/ProcessPipe.cpp
new file mode 100644
index 0000000..280f171
--- /dev/null
+++ b/system/OpenglSystemCommon/ProcessPipe.cpp
@@ -0,0 +1,282 @@
+/*
+* Copyright (C) 2016 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include "ProcessPipe.h"
+#include "HostConnection.h"
+#include "renderControl_enc.h"
+
+#include <qemu_pipe_bp.h>
+
+#if PLATFORM_SDK_VERSION < 26
+#include <cutils/log.h>
+#else
+#include <log/log.h>
+#endif
+#include <pthread.h>
+#include <errno.h>
+
+#ifdef __Fuchsia__
+#include <fidl/fuchsia.hardware.goldfish/cpp/wire.h>
+#include <lib/zx/vmo.h>
+
+#include "services/service_connector.h"
+
+#define GET_STATUS_SAFE(result, member) \
+    ((result).ok() ? ((result)->member) : ZX_OK)
+
+static QEMU_PIPE_HANDLE   sProcDevice = 0;
+#else // __Fuchsia__
+
+#include "VirtioGpuPipeStream.h"
+static VirtioGpuPipeStream* sVirtioGpuPipeStream = 0;
+static int sStreamHandle = -1;
+
+#endif // !__Fuchsia__
+
+static QEMU_PIPE_HANDLE   sProcPipe = 0;
+static pthread_once_t     sProcPipeOnce = PTHREAD_ONCE_INIT;
+// sProcUID is a unique ID per process assigned by the host.
+// It is different from getpid().
+static uint64_t           sProcUID = 0;
+static volatile HostConnectionType sConnType = HOST_CONNECTION_VIRTIO_GPU_PIPE;
+
+static uint32_t* sSeqnoPtr = 0;
+
+// Meant to be called only once per process.
+static void initSeqno() {
+    // So why do we reinitialize here? It's for testing purposes only;
+    // we have a unit test that exercise the case where this sequence
+    // number is reset as a result of guest process kill.
+    if (sSeqnoPtr) delete sSeqnoPtr;
+    sSeqnoPtr = new uint32_t;
+    *sSeqnoPtr = 0;
+}
+
+// processPipeInitOnce is used to generate a process unique ID (puid).
+// processPipeInitOnce will only be called at most once per process.
+// Use it with pthread_once for thread safety.
+// The host associates resources with process unique ID (puid) for memory cleanup.
+// It will fallback to the default path if the host does not support it.
+// Processes are identified by acquiring a per-process 64bit unique ID from the
+// host.
+#ifdef __Fuchsia__
+static void processPipeInitOnce() {
+    initSeqno();
+
+    fidl::ClientEnd<fuchsia_hardware_goldfish::Controller> controller_channel{
+        zx::channel(GetConnectToServiceFunction()(QEMU_PIPE_PATH))};
+    if (!controller_channel) {
+        ALOGE("%s: failed to open " QEMU_PIPE_PATH,
+              __FUNCTION__);
+        return;
+    }
+    fidl::WireSyncClient controller(std::move(controller_channel));
+    zx::result pipe_device_ends =
+        fidl::CreateEndpoints<fuchsia_hardware_goldfish::PipeDevice>();
+    if (pipe_device_ends.is_error()) {
+        ALOGE("%s: zx_channel_create failed: %s", __FUNCTION__, pipe_device_ends.status_string());
+        return;
+    }
+
+    if (fidl::Status result = controller->OpenSession(std::move(pipe_device_ends->server));
+        !result.ok()) {
+        ALOGE("%s: failed to open session: %s", __FUNCTION__, result.status_string());
+        return;
+    }
+
+    fidl::WireSyncClient device(std::move(pipe_device_ends->client));
+
+    auto pipe_ends =
+        fidl::CreateEndpoints<::fuchsia_hardware_goldfish::Pipe>();
+    if (!pipe_ends.is_ok()) {
+        ALOGE("%s: zx_channel_create failed: %d", __FUNCTION__, pipe_ends.status_value());
+        return;
+    }
+
+    fidl::WireSyncClient pipe(std::move(pipe_ends->client));
+    device->OpenPipe(std::move(pipe_ends->server));
+
+    zx::vmo vmo;
+    {
+        auto result = pipe->GetBuffer();
+        if (!result.ok() || result->res != ZX_OK) {
+            ALOGE("%s: failed to get buffer: %d:%d", __FUNCTION__,
+                  result.status(), GET_STATUS_SAFE(result, res));
+            return;
+        }
+        vmo = std::move(result->vmo);
+    }
+
+    size_t len = strlen("pipe:GLProcessPipe");
+    zx_status_t status = vmo.write("pipe:GLProcessPipe", 0, len + 1);
+    if (status != ZX_OK) {
+        ALOGE("%s: failed write pipe name", __FUNCTION__);
+        return;
+    }
+
+    {
+        auto result = pipe->Write(len + 1, 0);
+        if (!result.ok() || result->res != ZX_OK) {
+            ALOGD("%s: connecting to pipe service failed: %d:%d", __FUNCTION__,
+                  result.status(), GET_STATUS_SAFE(result, res));
+            return;
+        }
+    }
+
+    // Send a confirmation int to the host and get per-process unique ID back
+    int32_t confirmInt = 100;
+    status = vmo.write(&confirmInt, 0, sizeof(confirmInt));
+    if (status != ZX_OK) {
+        ALOGE("%s: failed write confirm int", __FUNCTION__);
+        return;
+    }
+
+    {
+        auto result = pipe->DoCall(sizeof(confirmInt), 0, sizeof(sProcUID), 0);
+        if (!result.ok() || result->res != ZX_OK) {
+            ALOGD("%s: failed to get per-process ID: %d:%d", __FUNCTION__,
+                  result.status(), GET_STATUS_SAFE(result, res));
+            return;
+        }
+    }
+
+    status = vmo.read(&sProcUID, 0, sizeof(sProcUID));
+    if (status != ZX_OK) {
+        ALOGE("%s: failed read per-process ID: %d", __FUNCTION__, status);
+        return;
+    }
+    sProcDevice = device.TakeClientEnd().TakeChannel().release();
+    sProcPipe = pipe.TakeClientEnd().TakeChannel().release();
+}
+#else // __Fuchsia__
+
+static void sQemuPipeInit() {
+    sProcPipe = qemu_pipe_open("GLProcessPipe");
+    if (!qemu_pipe_valid(sProcPipe)) {
+        sProcPipe = 0;
+        ALOGW("Process pipe failed");
+        return;
+    }
+    // Send a confirmation int to the host
+    int32_t confirmInt = 100;
+    if (qemu_pipe_write_fully(sProcPipe, &confirmInt, sizeof(confirmInt))) { // failed
+        qemu_pipe_close(sProcPipe);
+        sProcPipe = 0;
+        ALOGW("Process pipe failed");
+        return;
+    }
+
+    // Ask the host for per-process unique ID
+    if (qemu_pipe_read_fully(sProcPipe, &sProcUID, sizeof(sProcUID))) {
+        qemu_pipe_close(sProcPipe);
+        sProcPipe = 0;
+        sProcUID = 0;
+        ALOGW("Process pipe failed");
+        return;
+    }
+}
+
+static void processPipeInitOnce() {
+    initSeqno();
+
+#if defined(HOST_BUILD) || !defined(GFXSTREAM)
+    sQemuPipeInit();
+#else // HOST_BUILD
+    switch (sConnType) {
+        // TODO: Move those over too
+        case HOST_CONNECTION_QEMU_PIPE:
+        case HOST_CONNECTION_ADDRESS_SPACE:
+        case HOST_CONNECTION_TCP:
+            sQemuPipeInit();
+            break;
+        case HOST_CONNECTION_VIRTIO_GPU_PIPE:
+        case HOST_CONNECTION_VIRTIO_GPU_ADDRESS_SPACE: {
+            sVirtioGpuPipeStream = new VirtioGpuPipeStream(4096, sStreamHandle);
+            sProcUID = sVirtioGpuPipeStream->initProcessPipe();
+            break;
+        }
+    }
+#endif // !HOST_BUILD
+}
+#endif // !__Fuchsia__
+
+bool processPipeInit(int streamHandle, HostConnectionType connType, renderControl_encoder_context_t *rcEnc) {
+    sConnType = connType;
+#ifndef __Fuchsia__
+    sStreamHandle = streamHandle;
+#endif // !__Fuchsia
+    pthread_once(&sProcPipeOnce, processPipeInitOnce);
+    bool pipeHandleInvalid = !sProcPipe;
+#ifndef __Fuchsia__
+    pipeHandleInvalid = pipeHandleInvalid && !sVirtioGpuPipeStream;
+#endif // !__Fuchsia__
+    if (pipeHandleInvalid) return false;
+    rcEnc->rcSetPuid(rcEnc, sProcUID);
+    return true;
+}
+
+uint64_t getPuid() {
+    return sProcUID;
+}
+
+void processPipeRestart() {
+    ALOGW("%s: restarting process pipe\n", __func__);
+    bool isPipe = false;
+
+    switch (sConnType) {
+        // TODO: Move those over too
+        case HOST_CONNECTION_QEMU_PIPE:
+        case HOST_CONNECTION_ADDRESS_SPACE:
+        case HOST_CONNECTION_TCP:
+            isPipe = true;
+            break;
+        case HOST_CONNECTION_VIRTIO_GPU_PIPE:
+        case HOST_CONNECTION_VIRTIO_GPU_ADDRESS_SPACE: {
+            isPipe = false;
+            break;
+        }
+    }
+
+    sProcUID = 0;
+
+#ifdef __Fuchsia__
+    zx_handle_close(sProcPipe);
+    sProcPipe = ZX_HANDLE_INVALID;
+#else
+    if (isPipe) {
+        if (qemu_pipe_valid(sProcPipe)) {
+            qemu_pipe_close(sProcPipe);
+            sProcPipe = 0;
+        }
+    } else {
+        delete sVirtioGpuPipeStream;
+        sVirtioGpuPipeStream = nullptr;
+    }
+#endif // __Fuchsia__
+
+    processPipeInitOnce();
+}
+
+void refreshHostConnection() {
+    HostConnection* hostConn = HostConnection::get();
+    ExtendedRCEncoderContext* rcEnc = hostConn->rcEncoder();
+    rcEnc->rcSetPuid(rcEnc, sProcUID);
+}
+
+uint32_t* getSeqnoPtrForProcess() {
+    // It's assumed process pipe state has already been initialized.
+    return sSeqnoPtr;
+}
diff --git a/system/OpenglSystemCommon/ProcessPipe.h b/system/OpenglSystemCommon/ProcessPipe.h
new file mode 100644
index 0000000..2e5890b
--- /dev/null
+++ b/system/OpenglSystemCommon/ProcessPipe.h
@@ -0,0 +1,45 @@
+//
+// Copyright (C) 2016 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#pragma once
+
+#include "EmulatorFeatureInfo.h"
+
+#include <stdint.h>
+
+// The process pipe is used to notify the host about process exits,
+// also associate all process-owned host GL resources with a process unique ID
+// (puid). This is for the purpose that the host  can clean up process resources
+// when a process is killed. It will fallback to the default path if the host
+// does not support it. Processes are identified by acquiring a per-process
+// 64bit unique ID (puid) from the host.
+//
+// Calling processPipeInit will associate the current render thread with its
+// puid in the host.
+//
+// This is called when creating rcEncoder.
+
+struct renderControl_encoder_context_t;
+
+extern bool processPipeInit(int stream_handle, HostConnectionType connType, renderControl_encoder_context_t *rcEnc);
+extern uint64_t getPuid();
+
+// For testing purposes; this will close the current process pipe if opened, reset the state to initial,
+// and open it again with the same parameters.
+extern void processPipeRestart();
+extern void refreshHostConnection();
+
+// Each process gets a sequence number field.
+uint32_t* getSeqnoPtrForProcess();
diff --git a/system/OpenglSystemCommon/QemuPipeStream.cpp b/system/OpenglSystemCommon/QemuPipeStream.cpp
new file mode 100644
index 0000000..d5fca2b
--- /dev/null
+++ b/system/OpenglSystemCommon/QemuPipeStream.cpp
@@ -0,0 +1,256 @@
+/*
+* Copyright (C) 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#include "QemuPipeStream.h"
+#include <qemu_pipe_bp.h>
+
+#if PLATFORM_SDK_VERSION < 26
+#include <cutils/log.h>
+#else
+#include <log/log.h>
+#endif
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+
+static const size_t kReadSize = 512 * 1024;
+static const size_t kWriteOffset = kReadSize;
+
+QemuPipeStream::QemuPipeStream(size_t bufSize) :
+    IOStream(bufSize),
+    m_sock((QEMU_PIPE_HANDLE)(-1)),
+    m_bufsize(bufSize),
+    m_buf(NULL),
+    m_read(0),
+    m_readLeft(0)
+{
+}
+
+QemuPipeStream::QemuPipeStream(QEMU_PIPE_HANDLE sock, size_t bufSize) :
+    IOStream(bufSize),
+    m_sock(sock),
+    m_bufsize(bufSize),
+    m_buf(NULL),
+    m_read(0),
+    m_readLeft(0)
+{
+}
+
+QemuPipeStream::~QemuPipeStream()
+{
+    if (valid()) {
+        flush();
+        qemu_pipe_close(m_sock);
+    }
+    if (m_buf != NULL) {
+        free(m_buf);
+    }
+}
+
+
+int QemuPipeStream::connect(void)
+{
+    m_sock = qemu_pipe_open("opengles");
+    if (!valid()) {
+        ALOGE("%s: failed to connect to opengles pipe", __FUNCTION__);
+        qemu_pipe_print_error(m_sock);
+        return -1;
+    }
+    return 0;
+}
+
+void *QemuPipeStream::allocBuffer(size_t minSize)
+{
+    // Add dedicated read buffer space at the front of the buffer.
+    minSize += kReadSize;
+
+    size_t allocSize = (m_bufsize < minSize ? minSize : m_bufsize);
+    if (!m_buf) {
+        m_buf = (unsigned char *)malloc(allocSize);
+    }
+    else if (m_bufsize < allocSize) {
+        unsigned char *p = (unsigned char *)realloc(m_buf, allocSize);
+        if (p != NULL) {
+            m_buf = p;
+            m_bufsize = allocSize;
+        } else {
+            ERR("realloc (%zu) failed\n", allocSize);
+            free(m_buf);
+            m_buf = NULL;
+            m_bufsize = 0;
+        }
+    }
+
+    return m_buf + kWriteOffset;
+};
+
+int QemuPipeStream::commitBuffer(size_t size)
+{
+    if (size == 0) return 0;
+    return writeFully(m_buf + kWriteOffset, size);
+}
+
+int QemuPipeStream::writeFully(const void *buf, size_t len)
+{
+    return qemu_pipe_write_fully(m_sock, buf, len);
+}
+
+QEMU_PIPE_HANDLE QemuPipeStream::getSocket() const {
+    return m_sock;
+}
+
+const unsigned char *QemuPipeStream::readFully(void *buf, size_t len)
+{
+    return commitBufferAndReadFully(0, buf, len);
+}
+
+const unsigned char *QemuPipeStream::commitBufferAndReadFully(size_t writeSize, void *userReadBufPtr, size_t totalReadSize) {
+
+    unsigned char* userReadBuf = static_cast<unsigned char*>(userReadBufPtr);
+
+    if (!valid()) return NULL;
+
+    if (!userReadBuf) {
+        if (totalReadSize > 0) {
+            ALOGE("QemuPipeStream::commitBufferAndReadFully failed, userReadBuf=NULL, totalReadSize %zu, lethal"
+                    " error, exiting.", totalReadSize);
+            abort();
+        }
+        if (!writeSize) {
+            return NULL;
+        }
+    }
+
+    // Advance buffered read if not yet consumed.
+    size_t remaining = totalReadSize;
+    size_t bufferedReadSize = m_readLeft < remaining ? m_readLeft : remaining;
+    if (bufferedReadSize) {
+        memcpy(userReadBuf, m_buf + (m_read - m_readLeft), bufferedReadSize);
+        remaining -= bufferedReadSize;
+        m_readLeft -= bufferedReadSize;
+    }
+
+    // Early out if nothing left to do.
+    if (!writeSize && !remaining) {
+        return userReadBuf;
+    }
+
+    writeFully(m_buf + kWriteOffset, writeSize);
+
+    // Now done writing. Early out if no reading left to do.
+    if (!remaining) {
+        return userReadBuf;
+    }
+
+    // Read up to kReadSize bytes if all buffered read has been consumed.
+    size_t maxRead = m_readLeft ? 0 : kReadSize;
+
+    ssize_t actual = 0;
+
+    if (maxRead) {
+        actual = qemu_pipe_read(m_sock, m_buf, maxRead);
+        // Updated buffered read size.
+        if (actual > 0) {
+            m_read = m_readLeft = actual;
+        }
+
+        if (actual == 0) {
+            ALOGD("%s: end of pipe", __FUNCTION__);
+            return NULL;
+        }
+    }
+
+    // Consume buffered read and read more if necessary.
+    while (remaining) {
+        bufferedReadSize = m_readLeft < remaining ? m_readLeft : remaining;
+        if (bufferedReadSize) {
+            memcpy(userReadBuf + (totalReadSize - remaining),
+                   m_buf + (m_read - m_readLeft),
+                   bufferedReadSize);
+            remaining -= bufferedReadSize;
+            m_readLeft -= bufferedReadSize;
+            continue;
+        }
+
+        actual = qemu_pipe_read(m_sock, m_buf, kReadSize);
+
+        if (actual == 0) {
+            ALOGD("%s: Failed reading from pipe: %d", __FUNCTION__,  errno);
+            return NULL;
+        }
+
+        if (actual > 0) {
+            m_read = m_readLeft = actual;
+            continue;
+        }
+
+        if (!qemu_pipe_try_again(actual)) {
+            ALOGD("%s: Error reading from pipe: %d", __FUNCTION__, errno);
+            return NULL;
+        }
+    }
+
+    return userReadBuf;
+}
+
+const unsigned char *QemuPipeStream::read( void *buf, size_t *inout_len)
+{
+    //DBG(">> QemuPipeStream::read %d\n", *inout_len);
+    if (!valid()) return NULL;
+    if (!buf) {
+      ERR("QemuPipeStream::read failed, buf=NULL");
+      return NULL;  // do not allow NULL buf in that implementation
+    }
+
+    int n = recv(buf, *inout_len);
+
+    if (n > 0) {
+        *inout_len = n;
+        return (const unsigned char *)buf;
+    }
+
+    //DBG("<< QemuPipeStream::read %d\n", *inout_len);
+    return NULL;
+}
+
+int QemuPipeStream::recv(void *buf, size_t len)
+{
+    if (!valid()) return int(ERR_INVALID_SOCKET);
+    char* p = (char *)buf;
+    int ret = 0;
+    while(len > 0) {
+        int res = qemu_pipe_read(m_sock, p, len);
+        if (res > 0) {
+            p += res;
+            ret += res;
+            len -= res;
+            continue;
+        }
+        if (res == 0) { /* EOF */
+             break;
+        }
+        if (qemu_pipe_try_again(res)) {
+            continue;
+        }
+
+        /* A real error */
+        if (ret == 0)
+            ret = -1;
+        break;
+    }
+    return ret;
+}
diff --git a/system/OpenglSystemCommon/QemuPipeStream.h b/system/OpenglSystemCommon/QemuPipeStream.h
new file mode 100644
index 0000000..b70621d
--- /dev/null
+++ b/system/OpenglSystemCommon/QemuPipeStream.h
@@ -0,0 +1,72 @@
+/*
+* Copyright (C) 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#ifndef __QEMU_PIPE_STREAM_H
+#define __QEMU_PIPE_STREAM_H
+
+/* This file implements an IOStream that uses a QEMU fast-pipe
+ * to communicate with the emulator's 'opengles' service. See
+ * <hardware/qemu_pipe.h> for more details.
+ */
+#include <stdlib.h>
+#include <memory>
+#include "IOStream.h"
+
+#include <qemu_pipe_bp.h>
+
+#ifdef __Fuchsia__
+#include <fidl/fuchsia.hardware.goldfish/cpp/wire.h>
+#include <lib/zx/event.h>
+#include <lib/zx/vmo.h>
+#endif
+
+class QemuPipeStream : public gfxstream::IOStream {
+public:
+    typedef enum { ERR_INVALID_SOCKET = -1000 } QemuPipeStreamError;
+
+    explicit QemuPipeStream(size_t bufsize = 10000);
+    ~QemuPipeStream();
+    int connect(void);
+
+    virtual void *allocBuffer(size_t minSize);
+    virtual int commitBuffer(size_t size);
+    virtual const unsigned char *readFully( void *buf, size_t len);
+    virtual const unsigned char *commitBufferAndReadFully(size_t size, void *buf, size_t len);
+    virtual const unsigned char *read( void *buf, size_t *inout_len);
+
+    bool valid() { return qemu_pipe_valid(m_sock); }
+    int recv(void *buf, size_t len);
+
+    virtual int writeFully(const void *buf, size_t len);
+
+    QEMU_PIPE_HANDLE getSocket() const;
+private:
+    QEMU_PIPE_HANDLE m_sock;
+    size_t m_bufsize;
+    unsigned char *m_buf;
+    size_t m_read;
+    size_t m_readLeft;
+#ifdef __Fuchsia__
+    std::unique_ptr<::fidl::WireSyncClient<fuchsia_hardware_goldfish::PipeDevice>>
+        m_device;
+    ::fidl::WireSyncClient<fuchsia_hardware_goldfish::Pipe>
+        m_pipe;
+    zx::event m_event;
+    zx::vmo m_vmo;
+#endif
+    QemuPipeStream(QEMU_PIPE_HANDLE sock, size_t bufSize);
+};
+
+#endif
diff --git a/system/OpenglSystemCommon/QemuPipeStreamFuchsia.cpp b/system/OpenglSystemCommon/QemuPipeStreamFuchsia.cpp
new file mode 100644
index 0000000..4e47a46
--- /dev/null
+++ b/system/OpenglSystemCommon/QemuPipeStreamFuchsia.cpp
@@ -0,0 +1,348 @@
+/*
+* Copyright (C) 2019 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#include "QemuPipeStream.h"
+
+#include <cutils/log.h>
+#include <errno.h>
+#include <lib/zx/channel.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <zircon/process.h>
+
+#include <utility>
+
+#include "services/service_connector.h"
+
+#define GET_STATUS_SAFE(result, member) \
+    ((result).ok() ? ((result)->member) : ZX_OK)
+
+constexpr size_t kReadSize = 512 * 1024;
+constexpr size_t kWriteOffset = kReadSize;
+
+QemuPipeStream::QemuPipeStream(size_t bufSize) :
+    IOStream(bufSize),
+    m_sock(-1),
+    m_bufsize(bufSize),
+    m_buf(nullptr),
+    m_read(0),
+    m_readLeft(0)
+{
+}
+
+QemuPipeStream::QemuPipeStream(QEMU_PIPE_HANDLE sock, size_t bufSize) :
+    IOStream(bufSize),
+    m_sock(sock),
+    m_bufsize(bufSize),
+    m_buf(nullptr),
+    m_read(0),
+    m_readLeft(0)
+{
+}
+
+QemuPipeStream::~QemuPipeStream()
+{
+    if (m_device) {
+        flush();
+    }
+    if (m_buf) {
+        zx_status_t status = zx_vmar_unmap(zx_vmar_root_self(),
+                                           reinterpret_cast<zx_vaddr_t>(m_buf),
+                                           m_bufsize);
+        if (status != ZX_OK) {
+            ALOGE("zx_vmar_unmap failed: %d\n", status);
+            abort();
+        }
+    }
+}
+
+int QemuPipeStream::connect(void)
+{
+    fidl::ClientEnd<fuchsia_hardware_goldfish::Controller> controller_channel{
+        zx::channel(GetConnectToServiceFunction()(QEMU_PIPE_PATH))};
+    if (!controller_channel) {
+        ALOGE("%s: failed to open " QEMU_PIPE_PATH,
+              __FUNCTION__);
+        return -1;
+    }
+    fidl::WireSyncClient controller(std::move(controller_channel));
+    zx::result pipe_device_ends =
+        fidl::CreateEndpoints<fuchsia_hardware_goldfish::PipeDevice>();
+    if (pipe_device_ends.is_error()) {
+        ALOGE("%s: zx_channel_create failed: %s", __FUNCTION__, pipe_device_ends.status_string());
+        return -1;
+    }
+
+    if (fidl::Status result = controller->OpenSession(std::move(pipe_device_ends->server));
+        !result.ok()) {
+        ALOGE("%s: failed to open session: %s", __FUNCTION__, result.status_string());
+        return -1;
+    }
+
+    m_device = std::make_unique<
+        fidl::WireSyncClient<fuchsia_hardware_goldfish::PipeDevice>>(
+        std::move(pipe_device_ends->client));
+
+    auto pipe_ends =
+        fidl::CreateEndpoints<::fuchsia_hardware_goldfish::Pipe>();
+    if (!pipe_ends.is_ok()) {
+        ALOGE("zx::channel::create failed: %d", pipe_ends.status_value());
+        return ZX_HANDLE_INVALID;
+    }
+    (*m_device)->OpenPipe(std::move(pipe_ends->server));
+    m_pipe =
+        fidl::WireSyncClient<fuchsia_hardware_goldfish::Pipe>(
+            std::move(pipe_ends->client));
+
+    zx::event event;
+    zx_status_t status = zx::event::create(0, &event);
+    if (status != ZX_OK) {
+        ALOGE("%s: failed to create event: %d", __FUNCTION__, status);
+        return -1;
+    }
+    zx::event event_copy;
+    status = event.duplicate(ZX_RIGHT_SAME_RIGHTS, &event_copy);
+    if (status != ZX_OK) {
+        ALOGE("%s: failed to duplicate event: %d", __FUNCTION__, status);
+        return -1;
+    }
+
+    {
+        auto result = m_pipe->SetEvent(std::move(event_copy));
+        if (!result.ok()) {
+            ALOGE("%s: failed to set event: %d:%d", __FUNCTION__,
+                  result.status());
+            return -1;
+        }
+    }
+
+    if (!allocBuffer(m_bufsize)) {
+        ALOGE("%s: failed allocate initial buffer", __FUNCTION__);
+        return -1;
+    }
+
+    size_t len = strlen("pipe:opengles");
+    status = m_vmo.write("pipe:opengles", 0, len + 1);
+    if (status != ZX_OK) {
+        ALOGE("%s: failed write pipe name", __FUNCTION__);
+        return -1;
+    }
+
+    {
+        auto result = m_pipe->Write(len + 1, 0);
+        if (!result.ok() || result->res != ZX_OK) {
+            ALOGD("%s: connecting to pipe service failed: %d:%d", __FUNCTION__,
+                  result.status(), GET_STATUS_SAFE(result, res));
+            return -1;
+        }
+    }
+
+    m_event = std::move(event);
+    return 0;
+}
+
+void *QemuPipeStream::allocBuffer(size_t minSize)
+{
+    // Add dedicated read buffer space at the front of buffer.
+    minSize += kReadSize;
+
+    zx_status_t status;
+    if (m_buf) {
+        if (minSize <= m_bufsize) {
+            return m_buf + kWriteOffset;
+        }
+        status = zx_vmar_unmap(zx_vmar_root_self(),
+                               reinterpret_cast<zx_vaddr_t>(m_buf),
+                               m_bufsize);
+        if (status != ZX_OK) {
+          ALOGE("zx_vmar_unmap failed: %d\n", status);
+          abort();
+        }
+        m_buf = nullptr;
+    }
+
+    size_t allocSize = m_bufsize < minSize ? minSize : m_bufsize;
+
+    {
+        auto result = m_pipe->SetBufferSize(allocSize);
+        if (!result.ok() || result->res != ZX_OK) {
+            ALOGE("%s: failed to get buffer: %d:%d", __FUNCTION__,
+                  result.status(), GET_STATUS_SAFE(result, res));
+            return nullptr;
+        }
+    }
+
+    zx::vmo vmo;
+    {
+        auto result = m_pipe->GetBuffer();
+        if (!result.ok() || result->res != ZX_OK) {
+            ALOGE("%s: failed to get buffer: %d:%d", __FUNCTION__,
+                  result.status(), GET_STATUS_SAFE(result, res));
+            return nullptr;
+        }
+        vmo = std::move(result->vmo);
+    }
+
+    zx_vaddr_t mapped_addr;
+    status =
+        zx_vmar_map(zx_vmar_root_self(), ZX_VM_PERM_READ | ZX_VM_PERM_WRITE, 0,
+                    vmo.get(), 0, allocSize, &mapped_addr);
+    if (status != ZX_OK) {
+        ALOGE("%s: failed to map buffer: %d", __FUNCTION__, status);
+        return nullptr;
+    }
+
+    m_buf = reinterpret_cast<unsigned char*>(mapped_addr);
+    m_bufsize = allocSize;
+    m_vmo = std::move(vmo);
+    return m_buf + kWriteOffset;
+}
+
+int QemuPipeStream::commitBuffer(size_t size)
+{
+    if (size == 0) return 0;
+
+    auto result = m_pipe->DoCall(size, kWriteOffset, 0, 0);
+    if (!result.ok() || result->res != ZX_OK) {
+        ALOGD("%s: Pipe call failed: %d:%d", __FUNCTION__, result.status(),
+              GET_STATUS_SAFE(result, res));
+        return -1;
+    }
+
+    return 0;
+}
+
+int QemuPipeStream::writeFully(const void *buf, size_t len)
+{
+    ALOGE("%s: unsupported", __FUNCTION__);
+    abort();
+    return -1;
+}
+
+QEMU_PIPE_HANDLE QemuPipeStream::getSocket() const {
+    return m_sock;
+}
+
+const unsigned char *QemuPipeStream::readFully(void *buf, size_t len)
+{
+    return commitBufferAndReadFully(0, buf, len);
+}
+
+const unsigned char *QemuPipeStream::commitBufferAndReadFully(size_t size, void *buf, size_t len)
+{
+    if (!m_device)
+        return nullptr;
+
+    if (!buf) {
+        if (len > 0) {
+            ALOGE("QemuPipeStream::commitBufferAndReadFully failed, buf=NULL, len %zu, lethal"
+                    " error, exiting.", len);
+            abort();
+        }
+        if (!size) {
+            return nullptr;
+        }
+    }
+
+    // Advance buffered read if not yet consumed.
+    size_t remaining = len;
+    size_t readSize = m_readLeft < remaining ? m_readLeft : remaining;
+    if (readSize) {
+        memcpy(static_cast<char*>(buf), m_buf + (m_read - m_readLeft), readSize);
+        remaining -= readSize;
+        m_readLeft -= readSize;
+    }
+
+    // Early out if nothing left to do.
+    if (!size && !remaining) {
+        return static_cast<const unsigned char *>(buf);
+    }
+
+    // Read up to kReadSize bytes if all buffered read has been consumed.
+    size_t maxRead = (m_readLeft || !remaining) ? 0 : kReadSize;
+
+    auto result = m_pipe->DoCall(size, kWriteOffset, maxRead, 0);
+    if (!result.ok()) {
+        ALOGD("%s: Pipe call failed: %d", __FUNCTION__, result.status());
+        return nullptr;
+    }
+
+    // Updated buffered read size.
+    if (result->actual) {
+        m_read = m_readLeft = result->actual;
+    }
+
+    // Consume buffered read and read more if neccessary.
+    while (remaining) {
+        readSize = m_readLeft < remaining ? m_readLeft : remaining;
+        if (readSize) {
+            memcpy(static_cast<char*>(buf) + (len - remaining),
+                   m_buf + (m_read - m_readLeft),
+                   readSize);
+            remaining -= readSize;
+            m_readLeft -= readSize;
+            continue;
+        }
+
+        auto result = m_pipe->Read(kReadSize, 0);
+        if (!result.ok()) {
+            ALOGD("%s: Failed reading from pipe: %d:%d", __FUNCTION__,
+                  result.status());
+            return nullptr;
+        }
+
+        if (result->actual) {
+            m_read = m_readLeft = result->actual;
+            continue;
+        }
+        if (result->res != ZX_ERR_SHOULD_WAIT) {
+            ALOGD("%s: Error reading from pipe: %d", __FUNCTION__,
+                  result->res);
+            return nullptr;
+        }
+
+        zx_signals_t observed = ZX_SIGNAL_NONE;
+        zx_status_t status = m_event.wait_one(
+            fuchsia_hardware_goldfish::wire::kSignalReadable |
+                fuchsia_hardware_goldfish::wire::kSignalHangup,
+            zx::time::infinite(), &observed);
+        if (status != ZX_OK) {
+            ALOGD("%s: wait_one failed: %d", __FUNCTION__, status);
+            return nullptr;
+        }
+        if (observed & fuchsia_hardware_goldfish::wire::kSignalHangup) {
+            ALOGD("%s: Remote end hungup", __FUNCTION__);
+            return nullptr;
+        }
+    }
+
+    return static_cast<const unsigned char *>(buf);
+}
+
+const unsigned char *QemuPipeStream::read(void *buf, size_t *inout_len)
+{
+    ALOGE("%s: unsupported", __FUNCTION__);
+    abort();
+    return nullptr;
+}
+
+int QemuPipeStream::recv(void *buf, size_t len)
+{
+    ALOGE("%s: unsupported", __FUNCTION__);
+    abort();
+    return -1;
+}
diff --git a/system/OpenglSystemCommon/ThreadInfo.cpp b/system/OpenglSystemCommon/ThreadInfo.cpp
new file mode 100644
index 0000000..ee022e2
--- /dev/null
+++ b/system/OpenglSystemCommon/ThreadInfo.cpp
@@ -0,0 +1,106 @@
+/*
+* Copyright (C) 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include "ThreadInfo.h"
+
+#include <pthread.h>
+
+#if defined(HOST_BUILD) || defined(GFXSTREAM)
+
+static thread_local EGLThreadInfo sEglThreadInfoThreadLocal;
+
+EGLThreadInfo *goldfish_get_egl_tls()
+{
+    return &sEglThreadInfoThreadLocal;
+}
+
+EGLThreadInfo* getEGLThreadInfo() {
+    return goldfish_get_egl_tls();
+}
+
+void setTlsDestructor(tlsDtorCallback func) {
+    getEGLThreadInfo()->dtor = func;
+}
+
+#else // GFXSTREAM
+
+#ifdef __BIONIC__
+#include <bionic/tls.h>
+#endif
+
+#ifdef __ANDROID__
+// Are we missing an actual set of TLS defs?
+#ifdef GOLDFISH_OPENGL_NO_PLATFORM_BIONIC_INCLUDES
+#include <bionic_tls.h>
+#endif
+#endif
+
+static bool sDefaultTlsDestructorCallback(__attribute__((__unused__)) void* ptr) {
+  return true;
+}
+static bool (*sTlsDestructorCallback)(void*) = sDefaultTlsDestructorCallback;
+
+static void tlsDestruct(void *ptr)
+{
+    sTlsDestructorCallback(ptr);
+    if (ptr
+#ifdef __ANDROID__
+         && ((void **)__get_tls())[TLS_SLOT_OPENGL]
+#endif
+        ) {
+        EGLThreadInfo *ti = (EGLThreadInfo *)ptr;
+        delete ti;
+#ifdef __ANDROID__
+        ((void **)__get_tls())[TLS_SLOT_OPENGL] = NULL;
+#endif
+    }
+}
+
+void setTlsDestructor(tlsDtorCallback func) {
+    sTlsDestructorCallback = func;
+}
+
+static pthread_key_t s_tls;
+
+static void init_key()
+{
+    pthread_key_create(&s_tls, tlsDestruct);
+    pthread_setspecific(s_tls, new EGLThreadInfo);
+}
+
+EGLThreadInfo *goldfish_get_egl_tls()
+{
+   static pthread_once_t once = PTHREAD_ONCE_INIT;
+   pthread_once(&once, init_key);
+
+   return (EGLThreadInfo *) pthread_getspecific(s_tls);
+}
+
+EGLThreadInfo* getEGLThreadInfo() {
+#ifdef __ANDROID__
+    EGLThreadInfo *tInfo =
+        (EGLThreadInfo *)(((uintptr_t *)__get_tls())[TLS_SLOT_OPENGL]);
+    if (!tInfo) {
+        tInfo = goldfish_get_egl_tls();
+        ((uintptr_t *)__get_tls())[TLS_SLOT_OPENGL] = (uintptr_t)tInfo;
+    }
+    return tInfo;
+#else
+    return goldfish_get_egl_tls();
+#endif
+}
+
+#endif // !GFXSTREAM
diff --git a/system/OpenglSystemCommon/ThreadInfo.h b/system/OpenglSystemCommon/ThreadInfo.h
new file mode 100644
index 0000000..c8bf291
--- /dev/null
+++ b/system/OpenglSystemCommon/ThreadInfo.h
@@ -0,0 +1,44 @@
+/*
+* Copyright (C) 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#ifndef _THREAD_INFO_H
+#define _THREAD_INFO_H
+
+#include "HostConnection.h"
+
+#include <inttypes.h>
+
+struct EGLContext_t;
+
+typedef bool (*tlsDtorCallback)(void*);
+
+struct EGLThreadInfo
+{
+    EGLThreadInfo() : currentContext(NULL), eglError(EGL_SUCCESS), dtor(0) {}
+    ~EGLThreadInfo() { if (dtor) dtor(this); }
+
+    EGLContext_t *currentContext;
+    std::unique_ptr<HostConnection> hostConn;
+    int           eglError;
+    tlsDtorCallback dtor;
+};
+
+void setTlsDestructor(tlsDtorCallback);
+
+extern "C" __attribute__((visibility("default"))) EGLThreadInfo *goldfish_get_egl_tls();
+
+EGLThreadInfo* getEGLThreadInfo();
+
+#endif // of _THREAD_INFO_H
diff --git a/system/OpenglSystemCommon/TraceProviderFuchsia.cpp b/system/OpenglSystemCommon/TraceProviderFuchsia.cpp
new file mode 100644
index 0000000..2e67162
--- /dev/null
+++ b/system/OpenglSystemCommon/TraceProviderFuchsia.cpp
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "TraceProviderFuchsia.h"
+
+#include <log/log.h>
+
+#include <lib/async/cpp/task.h>
+#include <lib/zx/channel.h>
+
+#include "services/service_connector.h"
+
+TraceProviderFuchsia::~TraceProviderFuchsia() {
+    if (mTraceProvider) {
+        async::PostTask(mLoop.dispatcher(), [this]() {
+            // trace_provider_.reset() needs to run on loop_'s dispatcher or
+            // else its teardown can be racy and crash.
+            mTraceProvider.reset();
+            // Run Quit() in the loop to ensure this task executes before
+            // JoinThreads() returns and the destructor finishes.
+            mLoop.Quit();
+        });
+    } else {
+        mLoop.Quit();
+    }
+    mLoop.JoinThreads();
+}
+
+TraceProviderFuchsia::TraceProviderFuchsia()
+    : mLoop(&kAsyncLoopConfigNeverAttachToThread) {}
+
+bool TraceProviderFuchsia::Initialize() {
+    // Connect to fuchsia.tracing.provider.Registry service.
+    zx_handle_t client_channel =
+        GetConnectToServiceFunction()("/svc/fuchsia.tracing.provider.Registry");
+    if (client_channel == ZX_HANDLE_INVALID) {
+        ALOGE("Failed to connect to tracing provider service");
+        return false;
+    }
+
+    zx_status_t status = mLoop.StartThread();
+    if (status != ZX_OK) {
+        ALOGE("Failed to start async loop: %d", status);
+        return false;
+    }
+
+    mTraceProvider = std::make_unique<trace::TraceProvider>(
+        zx::channel(client_channel), mLoop.dispatcher());
+    return true;
+}
diff --git a/system/OpenglSystemCommon/TraceProviderFuchsia.h b/system/OpenglSystemCommon/TraceProviderFuchsia.h
new file mode 100644
index 0000000..86b8bdc
--- /dev/null
+++ b/system/OpenglSystemCommon/TraceProviderFuchsia.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __COMMON_TRACE_PROVIDER_FUCHSIA_H
+#define __COMMON_TRACE_PROVIDER_FUCHSIA_H
+
+#ifndef __Fuchsia__
+#error "TraceProviderFuchsia is only supported on Fuchsia!"
+#endif  // __Fuchsia__
+
+#include <memory>
+
+#include <lib/async-loop/cpp/loop.h>
+#include <lib/trace-provider/provider.h>
+
+class TraceProviderFuchsia {
+public:
+    TraceProviderFuchsia();
+    ~TraceProviderFuchsia();
+
+    bool Initialize();
+
+private:
+    async::Loop mLoop;
+    std::unique_ptr<trace::TraceProvider> mTraceProvider;
+};
+
+#endif  // __COMMON_TRACE_PROVIDER_FUCHSIA_H
\ No newline at end of file
diff --git a/system/OpenglSystemCommon/VirtioGpuPipeStream.cpp b/system/OpenglSystemCommon/VirtioGpuPipeStream.cpp
new file mode 100644
index 0000000..1cb242e
--- /dev/null
+++ b/system/OpenglSystemCommon/VirtioGpuPipeStream.cpp
@@ -0,0 +1,443 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "VirtioGpuPipeStream.h"
+#include "virtgpu_drm.h"
+
+#include <xf86drm.h>
+
+#include <sys/types.h>
+#include <sys/mman.h>
+
+#include <errno.h>
+#include <unistd.h>
+
+// In a virtual machine, there should only be one GPU
+#define RENDERNODE_MINOR 128
+
+// Attributes use to allocate our response buffer
+// Similar to virgl's fence objects
+#define PIPE_BUFFER             0
+#define VIRGL_FORMAT_R8_UNORM   64
+#define VIRGL_BIND_CUSTOM       (1 << 17)
+
+static const size_t kTransferBufferSize = (1048576);
+
+static const size_t kReadSize = 512 * 1024;
+static const size_t kWriteOffset = kReadSize;
+
+VirtioGpuPipeStream::VirtioGpuPipeStream(size_t bufSize) :
+    IOStream(bufSize),
+    m_fd(-1),
+    m_virtio_rh(~0U),
+    m_virtio_bo(0),
+    m_virtio_mapped(nullptr),
+    m_bufsize(bufSize),
+    m_buf(nullptr),
+    m_read(0),
+    m_readLeft(0),
+    m_writtenPos(0),
+    m_fd_owned(true) { }
+
+VirtioGpuPipeStream::VirtioGpuPipeStream(size_t bufSize, int stream_handle) :
+    IOStream(bufSize),
+    m_fd(stream_handle),
+    m_virtio_rh(~0U),
+    m_virtio_bo(0),
+    m_virtio_mapped(nullptr),
+    m_bufsize(bufSize),
+    m_buf(nullptr),
+    m_read(0),
+    m_readLeft(0),
+    m_writtenPos(0),
+    m_fd_owned(false) { }
+
+VirtioGpuPipeStream::~VirtioGpuPipeStream()
+{
+    if (m_virtio_mapped) {
+        munmap(m_virtio_mapped, kTransferBufferSize);
+    }
+
+    if (m_virtio_bo > 0U) {
+        drm_gem_close gem_close = {
+            .handle = m_virtio_bo,
+        };
+        drmIoctl(m_fd, DRM_IOCTL_GEM_CLOSE, &gem_close);
+    }
+
+    if (m_fd >= 0 && m_fd_owned) {
+        close(m_fd);
+    }
+
+    free(m_buf);
+}
+
+int VirtioGpuPipeStream::connect(const char* serviceName)
+{
+    if (m_fd < 0) {
+        m_fd = VirtioGpuPipeStream::openRendernode();
+        if (m_fd < 0) {
+            ERR("%s: failed with fd %d (%s)", __func__, m_fd, strerror(errno));
+            return -1;
+        }
+    }
+
+    if (!m_virtio_bo) {
+        drm_virtgpu_resource_create create = {
+            .target     = PIPE_BUFFER,
+            .format     = VIRGL_FORMAT_R8_UNORM,
+            .bind       = VIRGL_BIND_CUSTOM,
+            .width      = kTransferBufferSize,
+            .height     = 1U,
+            .depth      = 1U,
+            .array_size = 0U,
+            .size       = kTransferBufferSize,
+            .stride     = kTransferBufferSize,
+        };
+
+        int ret = drmIoctl(m_fd, DRM_IOCTL_VIRTGPU_RESOURCE_CREATE, &create);
+        if (ret) {
+            ERR("%s: failed with %d allocating command buffer (%s)",
+                __func__, ret, strerror(errno));
+            return -1;
+        }
+
+        m_virtio_bo = create.bo_handle;
+        if (!m_virtio_bo) {
+            ERR("%s: no handle when allocating command buffer",
+                __func__);
+            return -1;
+        }
+
+        m_virtio_rh = create.res_handle;
+
+        if (create.size != kTransferBufferSize) {
+            ERR("%s: command buffer wrongly sized, create.size=%zu "
+                "!= %zu", __func__,
+                static_cast<size_t>(create.size),
+                static_cast<size_t>(kTransferBufferSize));
+            abort();
+        }
+    }
+
+    if (!m_virtio_mapped) {
+        drm_virtgpu_map map;
+        memset(&map, 0, sizeof(map));
+        map.handle = m_virtio_bo;
+
+        int ret = drmIoctl(m_fd, DRM_IOCTL_VIRTGPU_MAP, &map);
+        if (ret) {
+            ERR("%s: failed with %d mapping command response buffer (%s)",
+                __func__, ret, strerror(errno));
+            return -1;
+        }
+
+        m_virtio_mapped = static_cast<unsigned char*>(
+            mmap64(nullptr, kTransferBufferSize, PROT_WRITE,
+                   MAP_SHARED, m_fd, map.offset));
+
+        if (m_virtio_mapped == MAP_FAILED) {
+            ERR("%s: failed with %d mmap'ing command response buffer (%s)",
+                __func__, ret, strerror(errno));
+            return -1;
+        }
+    }
+
+    wait();
+
+    if (serviceName) {
+        writeFully(serviceName, strlen(serviceName) + 1);
+    } else {
+        static const char kPipeString[] = "pipe:opengles";
+        std::string pipeStr(kPipeString);
+        writeFully(kPipeString, sizeof(kPipeString));
+    }
+    return 0;
+}
+
+int VirtioGpuPipeStream::openRendernode() {
+    int fd = drmOpenRender(RENDERNODE_MINOR);
+    if (fd < 0) {
+            ERR("%s: failed with fd %d (%s)", __func__, fd, strerror(errno));
+        return -1;
+    }
+    return fd;
+}
+
+uint64_t VirtioGpuPipeStream::initProcessPipe() {
+    connect("pipe:GLProcessPipe");
+    int32_t confirmInt = 100;
+    writeFully(&confirmInt, sizeof(confirmInt));
+    uint64_t res;
+    readFully(&res, sizeof(res));
+    return res;
+}
+
+void *VirtioGpuPipeStream::allocBuffer(size_t minSize) {
+    size_t allocSize = (m_bufsize < minSize ? minSize : m_bufsize);
+    if (!m_buf) {
+        m_buf = (unsigned char *)malloc(allocSize);
+    }
+    else if (m_bufsize < allocSize) {
+        unsigned char *p = (unsigned char *)realloc(m_buf, allocSize);
+        if (p != NULL) {
+            m_buf = p;
+            m_bufsize = allocSize;
+        } else {
+            ERR("realloc (%zu) failed\n", allocSize);
+            free(m_buf);
+            m_buf = NULL;
+            m_bufsize = 0;
+        }
+    }
+
+    return m_buf;
+}
+
+int VirtioGpuPipeStream::commitBuffer(size_t size) {
+    if (size == 0) return 0;
+    return writeFully(m_buf, size);
+}
+
+int VirtioGpuPipeStream::writeFully(const void *buf, size_t len)
+{
+    //DBG(">> VirtioGpuPipeStream::writeFully %d\n", len);
+    if (!valid()) return -1;
+    if (!buf) {
+       if (len>0) {
+            // If len is non-zero, buf must not be NULL. Otherwise the pipe would be
+            // in a corrupted state, which is lethal for the emulator.
+           ERR("VirtioGpuPipeStream::writeFully failed, buf=NULL, len %zu,"
+                   " lethal error, exiting", len);
+           abort();
+       }
+       return 0;
+    }
+
+    size_t res = len;
+    int retval = 0;
+
+    while (res > 0) {
+        ssize_t stat = transferToHost((const char *)(buf) + (len - res), res);
+        if (stat > 0) {
+            res -= stat;
+            continue;
+        }
+        if (stat == 0) { /* EOF */
+            ERR("VirtioGpuPipeStream::writeFully failed: premature EOF\n");
+            retval = -1;
+            break;
+        }
+        if (errno == EAGAIN) {
+            continue;
+        }
+        retval =  stat;
+        ERR("VirtioGpuPipeStream::writeFully failed: %s, lethal error, exiting.\n",
+                strerror(errno));
+        abort();
+    }
+    //DBG("<< VirtioGpuPipeStream::writeFully %d\n", len );
+    return retval;
+}
+
+const unsigned char *VirtioGpuPipeStream::readFully(void *buf, size_t len)
+{
+    flush();
+
+    if (!valid()) return NULL;
+    if (!buf) {
+        if (len > 0) {
+            // If len is non-zero, buf must not be NULL. Otherwise the pipe would be
+            // in a corrupted state, which is lethal for the emulator.
+            ERR("VirtioGpuPipeStream::readFully failed, buf=NULL, len %zu, lethal"
+                    " error, exiting.", len);
+            abort();
+        }
+    }
+
+    size_t res = len;
+    while (res > 0) {
+        ssize_t stat = transferFromHost((char *)(buf) + len - res, res);
+        if (stat == 0) {
+            // client shutdown;
+            return NULL;
+        } else if (stat < 0) {
+            if (errno == EAGAIN) {
+                continue;
+            } else {
+                ERR("VirtioGpuPipeStream::readFully failed (buf %p, len %zu"
+                    ", res %zu): %s, lethal error, exiting.", buf, len, res,
+                    strerror(errno));
+                abort();
+            }
+        } else {
+            res -= stat;
+        }
+    }
+    //DBG("<< VirtioGpuPipeStream::readFully %d\n", len);
+    return (const unsigned char *)buf;
+}
+
+const unsigned char *VirtioGpuPipeStream::commitBufferAndReadFully(
+    size_t writeSize, void *userReadBufPtr, size_t totalReadSize)
+{
+    return commitBuffer(writeSize) ? nullptr : readFully(userReadBufPtr, totalReadSize);
+}
+
+const unsigned char *VirtioGpuPipeStream::read( void *buf, size_t *inout_len)
+{
+    //DBG(">> VirtioGpuPipeStream::read %d\n", *inout_len);
+    if (!valid()) return NULL;
+    if (!buf) {
+      ERR("VirtioGpuPipeStream::read failed, buf=NULL");
+      return NULL;  // do not allow NULL buf in that implementation
+    }
+
+    int n = recv(buf, *inout_len);
+
+    if (n > 0) {
+        *inout_len = n;
+        return (const unsigned char *)buf;
+    }
+
+    //DBG("<< VirtioGpuPipeStream::read %d\n", *inout_len);
+    return NULL;
+}
+
+int VirtioGpuPipeStream::recv(void *buf, size_t len)
+{
+    if (!valid()) return int(ERR_INVALID_SOCKET);
+    char* p = (char *)buf;
+    int ret = 0;
+    while(len > 0) {
+        int res = transferFromHost(p, len);
+        if (res > 0) {
+            p += res;
+            ret += res;
+            len -= res;
+            continue;
+        }
+        if (res == 0) { /* EOF */
+             break;
+        }
+        if (errno != EAGAIN) {
+            continue;
+        }
+
+        /* A real error */
+        if (ret == 0)
+            ret = -1;
+        break;
+    }
+    return ret;
+}
+
+void VirtioGpuPipeStream::wait() {
+    struct drm_virtgpu_3d_wait waitcmd;
+    memset(&waitcmd, 0, sizeof(waitcmd));
+    waitcmd.handle = m_virtio_bo;
+    int ret = drmIoctl(m_fd, DRM_IOCTL_VIRTGPU_WAIT, &waitcmd);
+    if (ret) {
+        ERR("VirtioGpuPipeStream: DRM_IOCTL_VIRTGPU_WAIT failed with %d (%s)\n", errno, strerror(errno));
+    }
+    m_writtenPos = 0;
+}
+
+ssize_t VirtioGpuPipeStream::transferToHost(const void* buffer, size_t len) {
+    size_t todo = len;
+    size_t done = 0;
+    int ret = EAGAIN;
+    struct drm_virtgpu_3d_transfer_to_host xfer;
+
+    unsigned char* virtioPtr = m_virtio_mapped;
+
+    const unsigned char* readPtr = reinterpret_cast<const unsigned char*>(buffer);
+
+    while (done < len) {
+        size_t toXfer = todo > kTransferBufferSize ? kTransferBufferSize : todo;
+
+        if (toXfer > (kTransferBufferSize - m_writtenPos)) {
+            wait();
+        }
+
+        memcpy(virtioPtr + m_writtenPos, readPtr, toXfer);
+
+        memset(&xfer, 0, sizeof(xfer));
+        xfer.bo_handle = m_virtio_bo;
+        xfer.box.x = m_writtenPos;
+        xfer.box.y = 0;
+        xfer.box.w = toXfer;
+        xfer.box.h = 1;
+        xfer.box.d = 1;
+
+        ret = drmIoctl(m_fd, DRM_IOCTL_VIRTGPU_TRANSFER_TO_HOST, &xfer);
+
+        if (ret) {
+            ERR("VirtioGpuPipeStream: failed with errno %d (%s)\n", errno, strerror(errno));
+            return (ssize_t)ret;
+        }
+
+        done += toXfer;
+        readPtr += toXfer;
+		todo -= toXfer;
+        m_writtenPos += toXfer;
+    }
+
+    return len;
+}
+
+ssize_t VirtioGpuPipeStream::transferFromHost(void* buffer, size_t len) {
+    size_t todo = len;
+    size_t done = 0;
+    int ret = EAGAIN;
+    struct drm_virtgpu_3d_transfer_from_host xfer;
+
+    const unsigned char* virtioPtr = m_virtio_mapped;
+    unsigned char* readPtr = reinterpret_cast<unsigned char*>(buffer);
+
+    if (m_writtenPos) {
+        wait();
+    }
+
+    while (done < len) {
+        size_t toXfer = todo > kTransferBufferSize ? kTransferBufferSize : todo;
+
+        memset(&xfer, 0, sizeof(xfer));
+        xfer.bo_handle = m_virtio_bo;
+        xfer.box.x = 0;
+        xfer.box.y = 0;
+        xfer.box.w = toXfer;
+        xfer.box.h = 1;
+        xfer.box.d = 1;
+
+        ret = drmIoctl(m_fd, DRM_IOCTL_VIRTGPU_TRANSFER_FROM_HOST, &xfer);
+
+        if (ret) {
+            ERR("VirtioGpuPipeStream: failed with errno %d (%s)\n", errno, strerror(errno));
+            return (ssize_t)ret;
+        }
+
+        wait();
+
+        memcpy(readPtr, virtioPtr, toXfer);
+
+        done += toXfer;
+        readPtr += toXfer;
+	    todo -= toXfer;
+    }
+
+    return len;
+}
diff --git a/system/OpenglSystemCommon/VirtioGpuPipeStream.h b/system/OpenglSystemCommon/VirtioGpuPipeStream.h
new file mode 100644
index 0000000..e446494
--- /dev/null
+++ b/system/OpenglSystemCommon/VirtioGpuPipeStream.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "HostConnection.h"
+#include "IOStream.h"
+
+#include <stdlib.h>
+
+/* This file implements an IOStream that uses VIRTGPU TRANSFER* ioctls on a
+ * virtio-gpu DRM rendernode device to communicate with a goldfish-pipe
+ * service on the host side.
+ */
+
+class VirtioGpuPipeStream : public gfxstream::IOStream {
+public:
+    typedef enum { ERR_INVALID_SOCKET = -1000 } QemuPipeStreamError;
+
+    explicit VirtioGpuPipeStream(size_t bufsize = 10000);
+    explicit VirtioGpuPipeStream(size_t bufsize, int stream_handle);
+    ~VirtioGpuPipeStream();
+    int connect(const char* serviceName = 0);
+    static int openRendernode();
+    uint64_t initProcessPipe();
+
+    virtual void *allocBuffer(size_t minSize);
+    virtual int commitBuffer(size_t size);
+    virtual const unsigned char *readFully( void *buf, size_t len);
+    virtual const unsigned char *commitBufferAndReadFully(
+        size_t size, void *buf, size_t len);
+    virtual const unsigned char *read( void *buf, size_t *inout_len);
+
+    bool valid() { return m_fd >= 0; }
+    int getRendernodeFd() { return m_fd; }
+    int recv(void *buf, size_t len);
+
+    virtual int writeFully(const void *buf, size_t len);
+
+    int getSocket() const;
+private:
+    // sync. Also resets the write position.
+    void wait();
+
+    // transfer to/from host ops
+    ssize_t transferToHost(const void* buffer, size_t len);
+    ssize_t transferFromHost(void* buffer, size_t len);
+
+    int m_fd; // rendernode fd
+    int m_fd_owned; // Do we own the fd? We should consider using
+                    // modern C++ for this.
+
+    uint32_t m_virtio_rh; // transfer buffer res handle
+    uint32_t m_virtio_bo; // transfer bo handle
+    unsigned char* m_virtio_mapped; // user mapping of bo
+
+    // intermediate buffer
+    size_t m_bufsize;
+    unsigned char *m_buf;
+    size_t m_read;
+    size_t m_readLeft;
+
+    size_t m_writtenPos;
+};
diff --git a/system/OpenglSystemCommon/address_space_graphics_types.h b/system/OpenglSystemCommon/address_space_graphics_types.h
new file mode 100644
index 0000000..de3f49f
--- /dev/null
+++ b/system/OpenglSystemCommon/address_space_graphics_types.h
@@ -0,0 +1,362 @@
+// Copyright 2019 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#pragma once
+
+#include "aemu/base/ring_buffer.h"
+
+#include <functional>
+#include <cstddef>
+
+// This file defines common types for address space graphics and provides
+// documentation.
+
+// Address space graphics======================================================
+//
+// Basic idea
+//
+// Address space graphics (ASG) is a subdevice of the address space device that
+// provides a way to run graphics commands and data with fewer VM exits by
+// leveraging shared memory ring buffers.
+//
+// Each GL/Vk thread in the guest is associated with a context (asg_context).
+// asg_context consists of pointers into the shared memory that view it as a
+// collection of ring buffers and a common write buffer.
+//
+// Consumer concept
+//
+// ASG does not assume a particular rendering backend (though we will use
+// RenderThread's). This is for ease of coding/testing and flexibility; the
+// implementation is not coupled to emugl/libOpenglRender.
+//
+// Instead, there is the concept of a "Consumer" of ASG that will do something
+// with the data arriving from the shared memory region, and possibly reply
+// back to the guest. We register functions to construct and deconstruct
+// Consumers as part of emulator init (setConsumer).
+//
+// Guest workflow
+//
+// 1. Open address space device
+//
+// 2. Create the graphics context as the subdevice
+//
+// 3. ping(ASG_GET_RING) to get the offset/size of the ring buffer admin. info
+//
+// 4. ping(ASG_GET_BUFFER) to get the offset/size of the shared transfer buffer.
+//
+// 5. ioctl(CLAIM_SHARED) and mmap on those two offset/size pairs to get a
+// guest-side mapping.
+//
+// 6. call asg_context_create on the ring and buffer pointers to create the asg_context.
+//
+// 7. Now the guest and host share asg_context pts and can communicate.
+//
+// 8. But usually the guest will sometimes need to ping(ASG_NOTIFY_AVAILABLE)
+// so that the host side (which is usually a separate thread that we don't want
+// to spin too much) wakes up and processes data.
+
+namespace android {
+namespace base {
+
+class Stream;
+
+} // namespace base
+} // namespace android
+
+#define ADDRESS_SPACE_GRAPHICS_DEVICE_ID 0
+#define ADDRESS_SPACE_GRAPHICS_PAGE_SIZE 4096
+#define ADDRESS_SPACE_GRAPHICS_BLOCK_SIZE (16ULL * 1048576ULL)
+
+// AddressSpaceGraphicsContext shares memory with
+// the guest via the following layout:
+extern "C" {
+
+struct asg_ring_storage { // directly shared with guest
+    char to_host[ADDRESS_SPACE_GRAPHICS_PAGE_SIZE];
+    char to_host_large_xfer[ADDRESS_SPACE_GRAPHICS_PAGE_SIZE];
+    char from_host_large_xfer[ADDRESS_SPACE_GRAPHICS_PAGE_SIZE];
+};
+
+// Set by the address space graphics device to notify the guest that the host
+// has slept or is able to consume something, or we are exiting, or there is an
+// error.
+enum asg_host_state {
+    // The host renderthread is asleep and needs to be woken up.
+    ASG_HOST_STATE_NEED_NOTIFY = 0,
+
+    // The host renderthread is active and can consume new data
+    // without notification.
+    ASG_HOST_STATE_CAN_CONSUME = 1,
+
+    // Normal exit
+    ASG_HOST_STATE_EXIT = 2,
+
+    // Error: Something weird happened and we need to exit.
+    ASG_HOST_STATE_ERROR = 3,
+
+    // Host is rendering
+    ASG_HOST_STATE_RENDERING = 4,
+};
+
+struct asg_ring_config;
+
+// Each context has a pair of ring buffers for communication
+// to and from the host. There is another ring buffer for large xfers
+// to the host (all xfers from the host are already considered "large").
+//
+// Each context also comes with _one_ auxiliary buffer to hold both its own
+// commands and to perform private DMA transfers.
+struct asg_context { // ptrs into RingStorage
+    struct ring_buffer* to_host;
+    char* buffer;
+    asg_host_state* host_state;
+    asg_ring_config* ring_config;
+    struct ring_buffer_with_view to_host_large_xfer;
+    struct ring_buffer_with_view from_host_large_xfer;
+};
+
+// Helper function that will be common between guest and host:
+// Given ring storage and a write buffer, returns asg_context that
+// is the correct view into it.
+static inline struct asg_context asg_context_create(
+    char* ring_storage,
+    char* buffer,
+    uint32_t buffer_size) {
+
+    struct asg_context res;
+
+    res.to_host =
+        reinterpret_cast<struct ring_buffer*>(
+            ring_storage +
+            offsetof(struct asg_ring_storage, to_host));
+    res.to_host_large_xfer.ring =
+        reinterpret_cast<struct ring_buffer*>(
+            ring_storage +
+            offsetof(struct asg_ring_storage, to_host_large_xfer));
+    res.from_host_large_xfer.ring =
+        reinterpret_cast<struct ring_buffer*>(
+            ring_storage +
+            offsetof(struct asg_ring_storage, from_host_large_xfer));
+
+    ring_buffer_init(res.to_host);
+
+    res.buffer = buffer;
+    res.host_state =
+        reinterpret_cast<asg_host_state*>(
+            &res.to_host->state);
+    res.ring_config =
+        reinterpret_cast<asg_ring_config*>(
+            res.to_host->config);
+
+    ring_buffer_view_init(
+        res.to_host_large_xfer.ring,
+        &res.to_host_large_xfer.view,
+        (uint8_t*)res.buffer, buffer_size);
+
+    ring_buffer_view_init(
+        res.from_host_large_xfer.ring,
+        &res.from_host_large_xfer.view,
+        (uint8_t*)res.buffer, buffer_size);
+
+    return res;
+}
+
+// During operation, the guest sends commands and data over the auxiliary
+// buffer while using the |to_host| ring to communicate what parts of the auxiliary
+// buffer is outstanding traffic needing to be consumed by the host.
+// After a transfer completes to the host, the host may write back data.
+// The guest then reads the results on the same auxiliary buffer
+// while being notified of which parts to read via the |from_host| ring.
+//
+// The size of the auxiliary buffer and flush interval is defined by
+// the following config.ini android_hw setting:
+//
+// 1) android_hw->hw_gltransport_asg_writeBufferSize
+// 2) android_hw->hw_gltransport_asg_writeStepSize
+//
+// 1) the size for the auxiliary buffer
+// 2) the step size over which commands are flushed to the host
+//
+// When transferring commands, command data is built up in writeStepSize
+// chunks and flushed to the host when either writeStepSize is reached or
+// the guest flushes explicitly.
+//
+// Command vs. Data Modes
+//
+// For command data larger than writeStepSize or when transferring data, we
+// fall back to using a different mode where the entire auxiliary buffer is
+// used to perform the transfer, |asg_writeBufferSize| steps at a time. The
+// host is also notified of the total transport size.
+//
+// When writing back to the guest, it is assumed that the write buffer will
+// be completely empty as the guest has already flushed and the host has
+// already consumed all commands/data, and is writing back. In this case,
+// the full auxiliary buffer is used at the same time for writing back to
+// the guest.
+//
+// Larger / Shared transfers
+//
+// Each of |to_host| and |from_host| can contain elements of type 1, 2, or 3:
+// Type 1: 8 bytes: 4 bytes offset, 4 bytes size. Relative to write buffer.
+struct __attribute__((__packed__)) asg_type1_xfer {
+    uint32_t offset;
+    uint32_t size;
+};
+// Type 2: 16 bytes: 16 bytes offset into address space PCI space, 8 bytes
+// size.
+struct __attribute__((__packed__)) asg_type2_xfer {
+    uint64_t physAddr;
+    uint64_t size;
+};
+// Type 3: There is a large transfer of known size and the entire write buffer
+// will be used to send it over.
+//
+// For type 1 transfers, we get the corresponding host virtual address by
+// adding the offset to the beginning of the write buffer.  For type 2
+// transfers, we need to calculate the guest physical address and then call
+// addressspacecontrolops.gethostptr, which is slower since it goes through
+// a data structure map of existing mappings.
+//
+// The rings never contain a mix of type 1 and 2 elements. For to_host,
+// the guest initiates changes between type 1 and 2.
+//
+// The config fields:
+//
+struct asg_ring_config {
+    // config[0]: size of the auxiliary buffer
+    uint32_t buffer_size;
+
+    // config[1]: flush interval for the auxiliary buffer
+    uint32_t flush_interval;
+
+    // the position of the interval in the auxiliary buffer
+    // that the host has read so far
+    uint32_t host_consumed_pos;
+
+    // the start of the places the guest might write to next
+    uint32_t guest_write_pos;
+
+    // 1 if transfers are of type 1, 2 if transfers of type 2,
+    // 3 if the overall transfer size is known and we are sending something large.
+    uint32_t transfer_mode;
+
+    // the size of the transfer, used if transfer size is known.
+    // Set before setting config[2] to 3.
+    uint32_t transfer_size;
+
+    // error state
+    uint32_t in_error;
+};
+
+// State/config changes may only occur if the ring is empty, or the state
+// is transitioning to Error. That way, the host and guest have a chance to
+// synchronize on the same state.
+//
+// Thus far we've established how commands and data are transferred
+// to and from the host. Next, let's discuss how AddressSpaceGraphicsContext
+// talks to the code that actually does something with the commands
+// and sends data back.
+
+} // extern "C"
+
+namespace android {
+namespace emulation {
+namespace asg {
+
+// Consumer Concept
+//
+// AddressSpaceGraphicsContext's are each associated with a consumer that
+// takes data off the auxiliary buffer and to_host, while sending back data
+// over the auxiliary buffer / from_host.
+//
+// will read the commands and write back data.
+//
+// The consumer type is fixed at startup. The interface is as follows:
+
+// Called by the consumer, implemented in AddressSpaceGraphicsContext:
+//
+// Called when the consumer doesn't find anything to
+// read in to_host. Will make the consumer sleep
+// until another Ping(NotifyAvailable).
+using OnUnavailableReadCallback =
+    std::function<int()>;
+
+// Unpacks a type 2 transfer into host pointer and size.
+using GetPtrCallback =
+    std::function<char*(uint64_t)>;
+
+struct ConsumerCallbacks {
+    OnUnavailableReadCallback onUnavailableRead;
+    GetPtrCallback getPtr;
+};
+
+using ConsumerCreateCallback =
+    std::function<void* (struct asg_context, ConsumerCallbacks)>;
+using ConsumerDestroyCallback =
+    std::function<void(void*)>;
+using ConsumerSaveCallback =
+    std::function<void(void*, base::Stream*)>;
+using ConsumerLoadCallback =
+    std::function<void(void*, base::Stream*)>;
+
+struct ConsumerInterface {
+    ConsumerCreateCallback create;
+    ConsumerDestroyCallback destroy;
+    ConsumerSaveCallback save;
+    ConsumerLoadCallback load;
+};
+
+} // namespace asg
+} // namespace emulation
+} // namespace android
+
+// The interface for the guest:
+
+extern "C" {
+// Handled outside in address_space_device.cpp:
+//
+// Ping(device id): Create the device. On the host, the two rings and
+// auxiliary buffer are allocated. The two rings are allocated up front.
+// Both the auxiliary buffers and the rings are allocated from blocks of
+// rings and auxiliary buffers. New blocks are created if we run out either
+// way.
+enum asg_command {
+    // Ping(get_ring): Returns, in the fields:
+    // metadata: offset to give to claimShared and mmap() in the guest
+    // size: size to give to claimShared and mmap() in the guest
+    ASG_GET_RING = 0,
+
+    // Ping(get_buffer): Returns, in the fields:
+    // metadata: offset to give to claimShared and mmap() in the guest
+    // size: size to give to claimShared and mmap() in the guest
+    ASG_GET_BUFFER = 1,
+
+    // Ping(set_version): Run after the guest reads and negotiates its
+    // version of the device with the host. The host now knows the guest's
+    // version and can proceed with a protocol that works for both.
+    // size (in): the version of the guest
+    // size (out): the version of the host
+    // metadata (out): hostmem id
+    // After this command runs, the consumer is
+    // implicitly created.
+    ASG_SET_VERSION = 2,
+
+    // Ping(notiy_available): Wakes up the consumer from sleep so it
+    // can read data via toHost
+    ASG_NOTIFY_AVAILABLE = 3,
+
+    // Retrieve the host config
+    ASG_GET_CONFIG = 4,
+};
+
+} // extern "C"
diff --git a/system/OpenglSystemCommon/bionic-include/bionic/tls.h b/system/OpenglSystemCommon/bionic-include/bionic/tls.h
new file mode 100644
index 0000000..659d75f
--- /dev/null
+++ b/system/OpenglSystemCommon/bionic-include/bionic/tls.h
@@ -0,0 +1,16 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#pragma once
+
+#define GOLDFISH_OPENGL_NO_PLATFORM_BIONIC_INCLUDES
diff --git a/system/OpenglSystemCommon/meson.build b/system/OpenglSystemCommon/meson.build
new file mode 100644
index 0000000..2b834d9
--- /dev/null
+++ b/system/OpenglSystemCommon/meson.build
@@ -0,0 +1,25 @@
+# Copyright 2022 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+files_lib_stream = files(
+  'AddressSpaceStream.cpp',
+  'HostConnection.cpp',
+  'ProcessPipe.cpp',
+  'QemuPipeStream.cpp',
+  'ThreadInfo.cpp',
+  'VirtioGpuPipeStream.cpp',
+)
+
+lib_stream = static_library(
+   'stream',
+   files_lib_stream,
+   cpp_args: cpp_args,
+   include_directories: [inc_host, inc_opengl_codec, inc_android_emu,
+                         inc_render_enc, inc_android_compat,
+                         inc_qemu_pipe, inc_qemu_pipe_types, inc_gralloc,
+                         inc_vulkan_enc, inc_goldfish_address_space,
+                         inc_system, inc_platform],
+   link_with: [lib_codec_common, lib_goldfish_address_space, lib_qemu_pipe,
+               lib_render_control_enc, lib_platform],
+   dependencies: drm_dep
+)
diff --git a/system/codecs/Android.mk b/system/codecs/Android.mk
new file mode 100644
index 0000000..5053e7d
--- /dev/null
+++ b/system/codecs/Android.mk
@@ -0,0 +1 @@
+include $(call all-subdir-makefiles)
diff --git a/system/codecs/c2/decoders/avcdec/Android.bp b/system/codecs/c2/decoders/avcdec/Android.bp
new file mode 100644
index 0000000..5d840b0
--- /dev/null
+++ b/system/codecs/c2/decoders/avcdec/Android.bp
@@ -0,0 +1,34 @@
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "device_generic_goldfish-opengl_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["device_generic_goldfish-opengl_license"],
+}
+
+cc_library_shared {
+    name: "libcodec2_goldfish_avcdec",
+    vendor: true,
+    defaults: [
+        "libcodec2_goldfish-defaults",
+    ],
+
+    srcs: ["C2GoldfishAvcDec.cpp",
+        "GoldfishH264Helper.cpp",
+        "MediaH264Decoder.cpp",
+    ],
+
+    shared_libs: [
+	    "[email protected]",
+		"[email protected]",
+        "libgoldfish_codec2_store",
+    ],
+
+   header_libs: [
+    "libgralloc_cb.ranchu",
+    ],
+
+   static_libs: ["libavcdec",
+   ],
+}
diff --git a/system/codecs/c2/decoders/avcdec/C2GoldfishAvcDec.cpp b/system/codecs/c2/decoders/avcdec/C2GoldfishAvcDec.cpp
new file mode 100644
index 0000000..8ae1d0a
--- /dev/null
+++ b/system/codecs/c2/decoders/avcdec/C2GoldfishAvcDec.cpp
@@ -0,0 +1,1165 @@
+/*
+ * Copyright 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "C2GoldfishAvcDec"
+#include <inttypes.h>
+#include <log/log.h>
+#include <media/stagefright/foundation/AUtils.h>
+#include <media/stagefright/foundation/MediaDefs.h>
+
+#include <C2AllocatorGralloc.h>
+#include <C2PlatformSupport.h>
+//#include <android/hardware/graphics/common/1.0/types.h>
+
+#include <android/hardware/graphics/allocator/3.0/IAllocator.h>
+#include <android/hardware/graphics/mapper/3.0/IMapper.h>
+#include <hidl/LegacySupport.h>
+
+#include <media/stagefright/foundation/MediaDefs.h>
+
+#include <C2Debug.h>
+#include <C2PlatformSupport.h>
+#include <Codec2Mapper.h>
+#include <SimpleC2Interface.h>
+#include <goldfish_codec2/store/GoldfishComponentStore.h>
+#include <gralloc_cb_bp.h>
+
+#include <color_buffer_utils.h>
+
+#include "C2GoldfishAvcDec.h"
+
+#include <mutex>
+
+#define DEBUG 0
+#if DEBUG
+#define DDD(...) ALOGD(__VA_ARGS__)
+#else
+#define DDD(...) ((void)0)
+#endif
+
+using ::android::hardware::graphics::common::V1_0::BufferUsage;
+using ::android::hardware::graphics::common::V1_2::PixelFormat;
+
+namespace android {
+
+namespace {
+constexpr size_t kMinInputBufferSize = 6 * 1024 * 1024;
+constexpr char COMPONENT_NAME[] = "c2.goldfish.h264.decoder";
+constexpr uint32_t kDefaultOutputDelay = 8;
+/* avc specification allows for a maximum delay of 16 frames.
+   As soft avc decoder supports interlaced, this delay would be 32 fields.
+   And avc decoder implementation has an additional delay of 2 decode calls.
+   So total maximum output delay is 34 */
+constexpr uint32_t kMaxOutputDelay = 34;
+constexpr uint32_t kMinInputBytes = 4;
+
+static std::mutex s_decoder_count_mutex;
+static int s_decoder_count = 0;
+
+int allocateDecoderId() {
+  DDD("calling %s", __func__);
+  std::lock_guard<std::mutex> lock(s_decoder_count_mutex);
+  if (s_decoder_count >= 32 || s_decoder_count < 0) {
+    ALOGE("calling %s failed", __func__);
+    return -1;
+  }
+  ++ s_decoder_count;
+  DDD("calling %s success total decoder %d", __func__, s_decoder_count);
+  return s_decoder_count;;
+}
+
+bool deAllocateDecoderId() {
+  DDD("calling %s", __func__);
+  std::lock_guard<std::mutex> lock(s_decoder_count_mutex);
+  if (s_decoder_count < 1) {
+    ALOGE("calling %s failed ", __func__);
+    return false;
+  }
+  -- s_decoder_count;
+  DDD("calling %s success total decoder %d", __func__, s_decoder_count);
+  return true;
+}
+
+
+} // namespace
+
+class C2GoldfishAvcDec::IntfImpl : public SimpleInterface<void>::BaseParams {
+  public:
+    explicit IntfImpl(const std::shared_ptr<C2ReflectorHelper> &helper)
+        : SimpleInterface<void>::BaseParams(
+              helper, COMPONENT_NAME, C2Component::KIND_DECODER,
+              C2Component::DOMAIN_VIDEO, MEDIA_MIMETYPE_VIDEO_AVC) {
+        noPrivateBuffers(); // TODO: account for our buffers here
+        noInputReferences();
+        noOutputReferences();
+        noInputLatency();
+        noTimeStretch();
+
+        // TODO: Proper support for reorder depth.
+        addParameter(
+            DefineParam(mActualOutputDelay, C2_PARAMKEY_OUTPUT_DELAY)
+                .withDefault(
+                    new C2PortActualDelayTuning::output(kDefaultOutputDelay))
+                .withFields({C2F(mActualOutputDelay, value)
+                                 .inRange(0, kMaxOutputDelay)})
+                .withSetter(
+                    Setter<
+                        decltype(*mActualOutputDelay)>::StrictValueWithNoDeps)
+                .build());
+
+        // TODO: output latency and reordering
+
+        addParameter(DefineParam(mAttrib, C2_PARAMKEY_COMPONENT_ATTRIBUTES)
+                         .withConstValue(new C2ComponentAttributesSetting(
+                             C2Component::ATTRIB_IS_TEMPORAL))
+                         .build());
+
+        // coded and output picture size is the same for this codec
+        addParameter(
+            DefineParam(mSize, C2_PARAMKEY_PICTURE_SIZE)
+                .withDefault(new C2StreamPictureSizeInfo::output(0u, 320, 240))
+                .withFields({
+                    C2F(mSize, width).inRange(2, 4080, 2),
+                    C2F(mSize, height).inRange(2, 4080, 2),
+                })
+                .withSetter(SizeSetter)
+                .build());
+
+        addParameter(DefineParam(mMaxSize, C2_PARAMKEY_MAX_PICTURE_SIZE)
+                         .withDefault(new C2StreamMaxPictureSizeTuning::output(
+                             0u, 320, 240))
+                         .withFields({
+                             C2F(mSize, width).inRange(2, 4080, 2),
+                             C2F(mSize, height).inRange(2, 4080, 2),
+                         })
+                         .withSetter(MaxPictureSizeSetter, mSize)
+                         .build());
+
+        addParameter(
+            DefineParam(mProfileLevel, C2_PARAMKEY_PROFILE_LEVEL)
+                .withDefault(new C2StreamProfileLevelInfo::input(
+                    0u, C2Config::PROFILE_AVC_CONSTRAINED_BASELINE,
+                    C2Config::LEVEL_AVC_5_2))
+                .withFields(
+                    {C2F(mProfileLevel, profile)
+                         .oneOf({C2Config::PROFILE_AVC_CONSTRAINED_BASELINE,
+                                 C2Config::PROFILE_AVC_BASELINE,
+                                 C2Config::PROFILE_AVC_MAIN,
+                                 C2Config::PROFILE_AVC_CONSTRAINED_HIGH,
+                                 C2Config::PROFILE_AVC_PROGRESSIVE_HIGH,
+                                 C2Config::PROFILE_AVC_HIGH}),
+                     C2F(mProfileLevel, level)
+                         .oneOf(
+                             {C2Config::LEVEL_AVC_1, C2Config::LEVEL_AVC_1B,
+                              C2Config::LEVEL_AVC_1_1, C2Config::LEVEL_AVC_1_2,
+                              C2Config::LEVEL_AVC_1_3, C2Config::LEVEL_AVC_2,
+                              C2Config::LEVEL_AVC_2_1, C2Config::LEVEL_AVC_2_2,
+                              C2Config::LEVEL_AVC_3, C2Config::LEVEL_AVC_3_1,
+                              C2Config::LEVEL_AVC_3_2, C2Config::LEVEL_AVC_4,
+                              C2Config::LEVEL_AVC_4_1, C2Config::LEVEL_AVC_4_2,
+                              C2Config::LEVEL_AVC_5, C2Config::LEVEL_AVC_5_1,
+                              C2Config::LEVEL_AVC_5_2})})
+                .withSetter(ProfileLevelSetter, mSize)
+                .build());
+
+        addParameter(
+            DefineParam(mMaxInputSize, C2_PARAMKEY_INPUT_MAX_BUFFER_SIZE)
+                .withDefault(new C2StreamMaxBufferSizeInfo::input(
+                    0u, kMinInputBufferSize))
+                .withFields({
+                    C2F(mMaxInputSize, value).any(),
+                })
+                .calculatedAs(MaxInputSizeSetter, mMaxSize)
+                .build());
+
+        C2ChromaOffsetStruct locations[1] = {
+            C2ChromaOffsetStruct::ITU_YUV_420_0()};
+        std::shared_ptr<C2StreamColorInfo::output> defaultColorInfo =
+            C2StreamColorInfo::output::AllocShared(1u, 0u, 8u /* bitDepth */,
+                                                   C2Color::YUV_420);
+        memcpy(defaultColorInfo->m.locations, locations, sizeof(locations));
+
+        defaultColorInfo = C2StreamColorInfo::output::AllocShared(
+            {C2ChromaOffsetStruct::ITU_YUV_420_0()}, 0u, 8u /* bitDepth */,
+            C2Color::YUV_420);
+        helper->addStructDescriptors<C2ChromaOffsetStruct>();
+
+        addParameter(DefineParam(mColorInfo, C2_PARAMKEY_CODED_COLOR_INFO)
+                         .withConstValue(defaultColorInfo)
+                         .build());
+
+        addParameter(
+            DefineParam(mDefaultColorAspects, C2_PARAMKEY_DEFAULT_COLOR_ASPECTS)
+                .withDefault(new C2StreamColorAspectsTuning::output(
+                    0u, C2Color::RANGE_UNSPECIFIED,
+                    C2Color::PRIMARIES_UNSPECIFIED,
+                    C2Color::TRANSFER_UNSPECIFIED, C2Color::MATRIX_UNSPECIFIED))
+                .withFields({C2F(mDefaultColorAspects, range)
+                                 .inRange(C2Color::RANGE_UNSPECIFIED,
+                                          C2Color::RANGE_OTHER),
+                             C2F(mDefaultColorAspects, primaries)
+                                 .inRange(C2Color::PRIMARIES_UNSPECIFIED,
+                                          C2Color::PRIMARIES_OTHER),
+                             C2F(mDefaultColorAspects, transfer)
+                                 .inRange(C2Color::TRANSFER_UNSPECIFIED,
+                                          C2Color::TRANSFER_OTHER),
+                             C2F(mDefaultColorAspects, matrix)
+                                 .inRange(C2Color::MATRIX_UNSPECIFIED,
+                                          C2Color::MATRIX_OTHER)})
+                .withSetter(DefaultColorAspectsSetter)
+                .build());
+
+        addParameter(
+            DefineParam(mCodedColorAspects, C2_PARAMKEY_VUI_COLOR_ASPECTS)
+                .withDefault(new C2StreamColorAspectsInfo::input(
+                    0u, C2Color::RANGE_LIMITED, C2Color::PRIMARIES_UNSPECIFIED,
+                    C2Color::TRANSFER_UNSPECIFIED, C2Color::MATRIX_UNSPECIFIED))
+                .withFields({C2F(mCodedColorAspects, range)
+                                 .inRange(C2Color::RANGE_UNSPECIFIED,
+                                          C2Color::RANGE_OTHER),
+                             C2F(mCodedColorAspects, primaries)
+                                 .inRange(C2Color::PRIMARIES_UNSPECIFIED,
+                                          C2Color::PRIMARIES_OTHER),
+                             C2F(mCodedColorAspects, transfer)
+                                 .inRange(C2Color::TRANSFER_UNSPECIFIED,
+                                          C2Color::TRANSFER_OTHER),
+                             C2F(mCodedColorAspects, matrix)
+                                 .inRange(C2Color::MATRIX_UNSPECIFIED,
+                                          C2Color::MATRIX_OTHER)})
+                .withSetter(CodedColorAspectsSetter)
+                .build());
+
+        addParameter(
+            DefineParam(mColorAspects, C2_PARAMKEY_COLOR_ASPECTS)
+                .withDefault(new C2StreamColorAspectsInfo::output(
+                    0u, C2Color::RANGE_UNSPECIFIED,
+                    C2Color::PRIMARIES_UNSPECIFIED,
+                    C2Color::TRANSFER_UNSPECIFIED, C2Color::MATRIX_UNSPECIFIED))
+                .withFields({C2F(mColorAspects, range)
+                                 .inRange(C2Color::RANGE_UNSPECIFIED,
+                                          C2Color::RANGE_OTHER),
+                             C2F(mColorAspects, primaries)
+                                 .inRange(C2Color::PRIMARIES_UNSPECIFIED,
+                                          C2Color::PRIMARIES_OTHER),
+                             C2F(mColorAspects, transfer)
+                                 .inRange(C2Color::TRANSFER_UNSPECIFIED,
+                                          C2Color::TRANSFER_OTHER),
+                             C2F(mColorAspects, matrix)
+                                 .inRange(C2Color::MATRIX_UNSPECIFIED,
+                                          C2Color::MATRIX_OTHER)})
+                .withSetter(ColorAspectsSetter, mDefaultColorAspects,
+                            mCodedColorAspects)
+                .build());
+
+        // TODO: support more formats?
+        addParameter(DefineParam(mPixelFormat, C2_PARAMKEY_PIXEL_FORMAT)
+                         .withConstValue(new C2StreamPixelFormatInfo::output(
+                             0u, HAL_PIXEL_FORMAT_YCBCR_420_888))
+                         .build());
+    }
+    static C2R SizeSetter(bool mayBlock,
+                          const C2P<C2StreamPictureSizeInfo::output> &oldMe,
+                          C2P<C2StreamPictureSizeInfo::output> &me) {
+        (void)mayBlock;
+        DDD("calling sizesetter now %d", oldMe.v.height);
+        DDD("new calling sizesetter now %d", me.v.height);
+
+        C2R res = C2R::Ok();
+        if (!me.F(me.v.width).supportsAtAll(me.v.width)) {
+            res = res.plus(C2SettingResultBuilder::BadValue(me.F(me.v.width)));
+            me.set().width = oldMe.v.width;
+        }
+        if (!me.F(me.v.height).supportsAtAll(me.v.height)) {
+            res = res.plus(C2SettingResultBuilder::BadValue(me.F(me.v.height)));
+            me.set().height = oldMe.v.height;
+        }
+        return res;
+    }
+
+    static C2R
+    MaxPictureSizeSetter(bool mayBlock,
+                         C2P<C2StreamMaxPictureSizeTuning::output> &me,
+                         const C2P<C2StreamPictureSizeInfo::output> &size) {
+        (void)mayBlock;
+        // TODO: get max width/height from the size's field helpers vs.
+        // hardcoding
+        me.set().width = c2_min(c2_max(me.v.width, size.v.width), 4080u);
+        me.set().height = c2_min(c2_max(me.v.height, size.v.height), 4080u);
+        return C2R::Ok();
+    }
+
+    static C2R MaxInputSizeSetter(
+        bool mayBlock, C2P<C2StreamMaxBufferSizeInfo::input> &me,
+        const C2P<C2StreamMaxPictureSizeTuning::output> &maxSize) {
+        (void)mayBlock;
+        // assume compression ratio of 2
+        me.set().value = c2_max((((maxSize.v.width + 15) / 16) *
+                                 ((maxSize.v.height + 15) / 16) * 192),
+                                kMinInputBufferSize);
+        return C2R::Ok();
+    }
+
+    static C2R
+    ProfileLevelSetter(bool mayBlock, C2P<C2StreamProfileLevelInfo::input> &me,
+                       const C2P<C2StreamPictureSizeInfo::output> &size) {
+        (void)mayBlock;
+        (void)size;
+        (void)me; // TODO: validate
+        return C2R::Ok();
+    }
+
+    static C2R
+    DefaultColorAspectsSetter(bool mayBlock,
+                              C2P<C2StreamColorAspectsTuning::output> &me) {
+        (void)mayBlock;
+        if (me.v.range > C2Color::RANGE_OTHER) {
+            me.set().range = C2Color::RANGE_OTHER;
+        }
+        if (me.v.primaries > C2Color::PRIMARIES_OTHER) {
+            me.set().primaries = C2Color::PRIMARIES_OTHER;
+        }
+        if (me.v.transfer > C2Color::TRANSFER_OTHER) {
+            me.set().transfer = C2Color::TRANSFER_OTHER;
+        }
+        if (me.v.matrix > C2Color::MATRIX_OTHER) {
+            me.set().matrix = C2Color::MATRIX_OTHER;
+        }
+        DDD("default primaries %d default range %d", me.set().primaries,
+            me.set().range);
+        return C2R::Ok();
+    }
+
+    static C2R
+    CodedColorAspectsSetter(bool mayBlock,
+                            C2P<C2StreamColorAspectsInfo::input> &me) {
+        (void)mayBlock;
+        if (me.v.range > C2Color::RANGE_OTHER) {
+            me.set().range = C2Color::RANGE_OTHER;
+        }
+        if (me.v.primaries > C2Color::PRIMARIES_OTHER) {
+            me.set().primaries = C2Color::PRIMARIES_OTHER;
+        }
+        if (me.v.transfer > C2Color::TRANSFER_OTHER) {
+            me.set().transfer = C2Color::TRANSFER_OTHER;
+        }
+        if (me.v.matrix > C2Color::MATRIX_OTHER) {
+            me.set().matrix = C2Color::MATRIX_OTHER;
+        }
+        DDD("coded primaries %d coded range %d", me.set().primaries,
+            me.set().range);
+        return C2R::Ok();
+    }
+
+    static C2R
+    ColorAspectsSetter(bool mayBlock, C2P<C2StreamColorAspectsInfo::output> &me,
+                       const C2P<C2StreamColorAspectsTuning::output> &def,
+                       const C2P<C2StreamColorAspectsInfo::input> &coded) {
+        (void)mayBlock;
+        // take default values for all unspecified fields, and coded values for
+        // specified ones
+        DDD("before change primaries %d range %d", me.v.primaries, me.v.range);
+        me.set().range =
+            coded.v.range == RANGE_UNSPECIFIED ? def.v.range : coded.v.range;
+        me.set().primaries = coded.v.primaries == PRIMARIES_UNSPECIFIED
+                                 ? def.v.primaries
+                                 : coded.v.primaries;
+        me.set().transfer = coded.v.transfer == TRANSFER_UNSPECIFIED
+                                ? def.v.transfer
+                                : coded.v.transfer;
+        me.set().matrix = coded.v.matrix == MATRIX_UNSPECIFIED ? def.v.matrix
+                                                               : coded.v.matrix;
+
+        DDD("after change primaries %d range %d", me.v.primaries, me.v.range);
+        return C2R::Ok();
+    }
+
+    std::shared_ptr<C2StreamColorAspectsInfo::output> getColorAspects_l() {
+        return mColorAspects;
+    }
+
+    int width() const { return mSize->width; }
+
+    int height() const { return mSize->height; }
+
+    int primaries() const { return mColorAspects->primaries; }
+
+    int range() const { return mColorAspects->range; }
+
+    int transfer() const { return mColorAspects->transfer; }
+
+   private:
+    std::shared_ptr<C2StreamProfileLevelInfo::input> mProfileLevel;
+    std::shared_ptr<C2StreamPictureSizeInfo::output> mSize;
+    std::shared_ptr<C2StreamMaxPictureSizeTuning::output> mMaxSize;
+    std::shared_ptr<C2StreamMaxBufferSizeInfo::input> mMaxInputSize;
+    std::shared_ptr<C2StreamColorInfo::output> mColorInfo;
+    std::shared_ptr<C2StreamColorAspectsInfo::input> mCodedColorAspects;
+    std::shared_ptr<C2StreamColorAspectsTuning::output> mDefaultColorAspects;
+    std::shared_ptr<C2StreamColorAspectsInfo::output> mColorAspects;
+    std::shared_ptr<C2StreamPixelFormatInfo::output> mPixelFormat;
+};
+
+static void *ivd_aligned_malloc(void *ctxt, uint32_t alignment, uint32_t size) {
+    (void)ctxt;
+    return memalign(alignment, size);
+}
+
+static void ivd_aligned_free(void *ctxt, void *mem) {
+    (void)ctxt;
+    free(mem);
+}
+
+C2GoldfishAvcDec::C2GoldfishAvcDec(const char *name, c2_node_id_t id,
+                                   const std::shared_ptr<IntfImpl> &intfImpl)
+    : SimpleC2Component(
+          std::make_shared<SimpleInterface<IntfImpl>>(name, id, intfImpl)),
+      mIntf(intfImpl), mOutBufferFlush(nullptr), mWidth(1920), mHeight(1080),
+      mHeaderDecoded(false), mOutIndex(0u) {
+    mWidth = mIntf->width();
+    mHeight = mIntf->height();
+    DDD("creating avc decoder now w %d h %d", mWidth, mHeight);
+}
+
+C2GoldfishAvcDec::~C2GoldfishAvcDec() { onRelease(); }
+
+c2_status_t C2GoldfishAvcDec::onInit() {
+    ALOGD("calling onInit");
+    mId = allocateDecoderId();
+    if (mId <= 0) return C2_NO_MEMORY;
+    status_t err = initDecoder();
+    return err == OK ? C2_OK : C2_CORRUPTED;
+}
+
+c2_status_t C2GoldfishAvcDec::onStop() {
+    if (OK != resetDecoder())
+        return C2_CORRUPTED;
+    resetPlugin();
+    return C2_OK;
+}
+
+void C2GoldfishAvcDec::onReset() { (void)onStop(); }
+
+void C2GoldfishAvcDec::onRelease() {
+    DDD("calling onRelease");
+    if (mId > 0) {
+      deAllocateDecoderId();
+      mId = -1;
+    }
+    deleteContext();
+    if (mOutBlock) {
+        mOutBlock.reset();
+    }
+}
+
+void C2GoldfishAvcDec::decodeHeaderAfterFlush() {
+    if (mContext && !mCsd0.empty() && !mCsd1.empty()) {
+        mContext->decodeFrame(&(mCsd0[0]), mCsd0.size(), 0);
+        mContext->decodeFrame(&(mCsd1[0]), mCsd1.size(), 0);
+        DDD("resending csd0 and csd1");
+    }
+}
+
+c2_status_t C2GoldfishAvcDec::onFlush_sm() {
+    if (OK != setFlushMode())
+        return C2_CORRUPTED;
+
+    if (!mContext) {
+        // just ignore if context is not even created
+        return C2_OK;
+    }
+
+    uint32_t bufferSize = mStride * mHeight * 3 / 2;
+    mOutBufferFlush = (uint8_t *)ivd_aligned_malloc(nullptr, 128, bufferSize);
+    if (!mOutBufferFlush) {
+        ALOGE("could not allocate tmp output buffer (for flush) of size %u ",
+              bufferSize);
+        return C2_NO_MEMORY;
+    }
+
+    while (true) {
+        mPts = 0;
+        setDecodeArgs(nullptr, nullptr, 0, 0, 0);
+        mImg = mContext->getImage();
+        if (mImg.data == nullptr) {
+            resetPlugin();
+            break;
+        }
+    }
+
+    if (mOutBufferFlush) {
+        ivd_aligned_free(nullptr, mOutBufferFlush);
+        mOutBufferFlush = nullptr;
+    }
+
+    deleteContext();
+    return C2_OK;
+}
+
+void C2GoldfishAvcDec::sendMetadata() {
+    // compare and send if changed
+    MetaDataColorAspects currentMetaData = {1, 0, 0, 0};
+    currentMetaData.primaries = mIntf->primaries();
+    currentMetaData.range = mIntf->range();
+    currentMetaData.transfer = mIntf->transfer();
+
+    DDD("metadata primaries %d range %d transfer %d",
+            (int)(currentMetaData.primaries),
+            (int)(currentMetaData.range),
+            (int)(currentMetaData.transfer)
+       );
+
+    if (mSentMetadata.primaries == currentMetaData.primaries &&
+        mSentMetadata.range == currentMetaData.range &&
+        mSentMetadata.transfer == currentMetaData.transfer) {
+        DDD("metadata is the same, no need to update");
+        return;
+    }
+    std::swap(mSentMetadata, currentMetaData);
+
+    mContext->sendMetadata(&(mSentMetadata));
+}
+
+status_t C2GoldfishAvcDec::createDecoder() {
+
+    DDD("creating avc context now w %d h %d", mWidth, mHeight);
+    if (mEnableAndroidNativeBuffers) {
+        mContext.reset(new MediaH264Decoder(RenderMode::RENDER_BY_HOST_GPU));
+    } else {
+        mContext.reset(new MediaH264Decoder(RenderMode::RENDER_BY_GUEST_CPU));
+    }
+    mContext->initH264Context(mWidth, mHeight, mWidth, mHeight,
+                              MediaH264Decoder::PixelFormat::YUV420P);
+    return OK;
+}
+
+status_t C2GoldfishAvcDec::setParams(size_t stride) {
+    (void)stride;
+    return OK;
+}
+
+status_t C2GoldfishAvcDec::initDecoder() {
+    mStride = ALIGN2(mWidth);
+    mSignalledError = false;
+    resetPlugin();
+
+    return OK;
+}
+
+bool C2GoldfishAvcDec::setDecodeArgs(C2ReadView *inBuffer,
+                                     C2GraphicView *outBuffer, size_t inOffset,
+                                     size_t inSize, uint32_t tsMarker) {
+    uint32_t displayStride = mStride;
+    (void)inBuffer;
+    (void)inOffset;
+    (void)inSize;
+    (void)tsMarker;
+    if (outBuffer) {
+        C2PlanarLayout layout;
+        layout = outBuffer->layout();
+        displayStride = layout.planes[C2PlanarLayout::PLANE_Y].rowInc;
+    }
+
+    if (inBuffer) {
+        //= tsMarker;
+        mInPBuffer = const_cast<uint8_t *>(inBuffer->data() + inOffset);
+        mInPBufferSize = inSize;
+        mInTsMarker = tsMarker;
+        insertPts(tsMarker, mPts);
+    }
+
+    // uint32_t displayHeight = mHeight;
+    // size_t lumaSize = displayStride * displayHeight;
+    // size_t chromaSize = lumaSize >> 2;
+
+    if (mStride != displayStride) {
+        mStride = displayStride;
+        if (OK != setParams(mStride))
+            return false;
+    }
+
+    return true;
+}
+
+status_t C2GoldfishAvcDec::setFlushMode() {
+    if (mContext) {
+        mContext->flush();
+    }
+    mHeaderDecoded = false;
+    return OK;
+}
+
+status_t C2GoldfishAvcDec::resetDecoder() {
+    mStride = 0;
+    mSignalledError = false;
+    mHeaderDecoded = false;
+    deleteContext();
+
+    return OK;
+}
+
+void C2GoldfishAvcDec::resetPlugin() {
+    mSignalledOutputEos = false;
+    gettimeofday(&mTimeStart, nullptr);
+    gettimeofday(&mTimeEnd, nullptr);
+    if (mOutBlock) {
+        mOutBlock.reset();
+    }
+}
+
+void C2GoldfishAvcDec::deleteContext() {
+    if (mContext) {
+        mContext->destroyH264Context();
+        mContext.reset(nullptr);
+        mPts2Index.clear();
+        mOldPts2Index.clear();
+        mIndex2Pts.clear();
+    }
+}
+
+static void fillEmptyWork(const std::unique_ptr<C2Work> &work) {
+    uint32_t flags = 0;
+    if (work->input.flags & C2FrameData::FLAG_END_OF_STREAM) {
+        flags |= C2FrameData::FLAG_END_OF_STREAM;
+        DDD("signalling eos");
+    }
+    DDD("fill empty work");
+    work->worklets.front()->output.flags = (C2FrameData::flags_t)flags;
+    work->worklets.front()->output.buffers.clear();
+    work->worklets.front()->output.ordinal = work->input.ordinal;
+    work->workletsProcessed = 1u;
+}
+
+void C2GoldfishAvcDec::finishWork(uint64_t index,
+                                  const std::unique_ptr<C2Work> &work) {
+    std::shared_ptr<C2Buffer> buffer =
+        createGraphicBuffer(std::move(mOutBlock), C2Rect(mWidth, mHeight));
+    mOutBlock = nullptr;
+    {
+        IntfImpl::Lock lock = mIntf->lock();
+        buffer->setInfo(mIntf->getColorAspects_l());
+    }
+
+    class FillWork {
+      public:
+        FillWork(uint32_t flags, C2WorkOrdinalStruct ordinal,
+                 const std::shared_ptr<C2Buffer> &buffer)
+            : mFlags(flags), mOrdinal(ordinal), mBuffer(buffer) {}
+        ~FillWork() = default;
+
+        void operator()(const std::unique_ptr<C2Work> &work) {
+            work->worklets.front()->output.flags = (C2FrameData::flags_t)mFlags;
+            work->worklets.front()->output.buffers.clear();
+            work->worklets.front()->output.ordinal = mOrdinal;
+            work->workletsProcessed = 1u;
+            work->result = C2_OK;
+            if (mBuffer) {
+                work->worklets.front()->output.buffers.push_back(mBuffer);
+            }
+            DDD("timestamp = %lld, index = %lld, w/%s buffer",
+                mOrdinal.timestamp.peekll(), mOrdinal.frameIndex.peekll(),
+                mBuffer ? "" : "o");
+        }
+
+      private:
+        const uint32_t mFlags;
+        const C2WorkOrdinalStruct mOrdinal;
+        const std::shared_ptr<C2Buffer> mBuffer;
+    };
+
+    auto fillWork = [buffer](const std::unique_ptr<C2Work> &work) {
+        work->worklets.front()->output.flags = (C2FrameData::flags_t)0;
+        work->worklets.front()->output.buffers.clear();
+        work->worklets.front()->output.buffers.push_back(buffer);
+        work->worklets.front()->output.ordinal = work->input.ordinal;
+        work->workletsProcessed = 1u;
+    };
+    if (work && c2_cntr64_t(index) == work->input.ordinal.frameIndex) {
+        bool eos = ((work->input.flags & C2FrameData::FLAG_END_OF_STREAM) != 0);
+        // TODO: Check if cloneAndSend can be avoided by tracking number of
+        // frames remaining
+        if (eos) {
+            if (buffer) {
+                mOutIndex = index;
+                C2WorkOrdinalStruct outOrdinal = work->input.ordinal;
+                DDD("%s %d: cloneAndSend ", __func__, __LINE__);
+                cloneAndSend(
+                    mOutIndex, work,
+                    FillWork(C2FrameData::FLAG_INCOMPLETE, outOrdinal, buffer));
+                buffer.reset();
+            }
+        } else {
+            DDD("%s %d: fill", __func__, __LINE__);
+            fillWork(work);
+        }
+    } else {
+        DDD("%s %d: finish", __func__, __LINE__);
+        finish(index, fillWork);
+    }
+}
+
+c2_status_t
+C2GoldfishAvcDec::ensureDecoderState(const std::shared_ptr<C2BlockPool> &pool) {
+    if (mOutBlock && (mOutBlock->width() != ALIGN2(mWidth) ||
+                      mOutBlock->height() != mHeight)) {
+        mOutBlock.reset();
+    }
+    if (!mOutBlock) {
+        const uint32_t format = HAL_PIXEL_FORMAT_YCBCR_420_888;
+        const C2MemoryUsage usage = {(uint64_t)(BufferUsage::VIDEO_DECODER),
+                                     C2MemoryUsage::CPU_WRITE};
+        c2_status_t err = pool->fetchGraphicBlock(ALIGN2(mWidth), mHeight,
+                                                  format, usage, &mOutBlock);
+        if (err != C2_OK) {
+            ALOGE("fetchGraphicBlock for Output failed with status %d", err);
+            return err;
+        }
+        if (mEnableAndroidNativeBuffers) {
+            auto c2Handle = mOutBlock->handle();
+            native_handle_t *grallocHandle =
+                UnwrapNativeCodec2GrallocHandle(c2Handle);
+            mHostColorBufferId = getColorBufferHandle(grallocHandle);
+            DDD("found handle %d", mHostColorBufferId);
+        }
+        DDD("provided (%dx%d) required (%dx%d)", mOutBlock->width(),
+            mOutBlock->height(), ALIGN2(mWidth), mHeight);
+    }
+
+    return C2_OK;
+}
+
+void C2GoldfishAvcDec::checkMode(const std::shared_ptr<C2BlockPool> &pool) {
+    mWidth = mIntf->width();
+    mHeight = mIntf->height();
+    const bool isGraphic = (pool->getLocalId() == C2PlatformAllocatorStore::GRALLOC);
+    DDD("buffer pool id %x",  (int)(pool->getLocalId()));
+    if (isGraphic) {
+        DDD("decoding to host color buffer");
+        mEnableAndroidNativeBuffers = true;
+    } else {
+        DDD("decoding to guest byte buffer");
+        mEnableAndroidNativeBuffers = false;
+    }
+}
+
+void C2GoldfishAvcDec::getVuiParams(h264_image_t &img) {
+    VuiColorAspects vuiColorAspects;
+    vuiColorAspects.primaries = img.color_primaries;
+    vuiColorAspects.transfer = img.color_trc;
+    vuiColorAspects.coeffs = img.colorspace;
+    vuiColorAspects.fullRange = img.color_range == 2 ? true : false;
+
+    // convert vui aspects to C2 values if changed
+    if (!(vuiColorAspects == mBitstreamColorAspects)) {
+        mBitstreamColorAspects = vuiColorAspects;
+        ColorAspects sfAspects;
+        C2StreamColorAspectsInfo::input codedAspects = {0u};
+        ColorUtils::convertIsoColorAspectsToCodecAspects(
+            vuiColorAspects.primaries, vuiColorAspects.transfer,
+            vuiColorAspects.coeffs, vuiColorAspects.fullRange, sfAspects);
+        if (!C2Mapper::map(sfAspects.mPrimaries, &codedAspects.primaries)) {
+            codedAspects.primaries = C2Color::PRIMARIES_UNSPECIFIED;
+        }
+        if (!C2Mapper::map(sfAspects.mRange, &codedAspects.range)) {
+            codedAspects.range = C2Color::RANGE_UNSPECIFIED;
+        }
+        if (!C2Mapper::map(sfAspects.mMatrixCoeffs, &codedAspects.matrix)) {
+            codedAspects.matrix = C2Color::MATRIX_UNSPECIFIED;
+        }
+        if (!C2Mapper::map(sfAspects.mTransfer, &codedAspects.transfer)) {
+            codedAspects.transfer = C2Color::TRANSFER_UNSPECIFIED;
+        }
+        std::vector<std::unique_ptr<C2SettingResult>> failures;
+        (void)mIntf->config({&codedAspects}, C2_MAY_BLOCK, &failures);
+    }
+}
+
+void C2GoldfishAvcDec::copyImageData(h264_image_t &img) {
+    getVuiParams(img);
+    if (mEnableAndroidNativeBuffers)
+        return;
+
+    auto writeView = mOutBlock->map().get();
+    if (writeView.error()) {
+        ALOGE("graphic view map failed %d", writeView.error());
+        return;
+    }
+    size_t dstYStride = writeView.layout().planes[C2PlanarLayout::PLANE_Y].rowInc;
+    size_t dstUVStride = writeView.layout().planes[C2PlanarLayout::PLANE_U].rowInc;
+
+    uint8_t *pYBuffer = const_cast<uint8_t *>(writeView.data()[C2PlanarLayout::PLANE_Y]);
+    uint8_t *pUBuffer = const_cast<uint8_t *>(writeView.data()[C2PlanarLayout::PLANE_U]);
+    uint8_t *pVBuffer = const_cast<uint8_t *>(writeView.data()[C2PlanarLayout::PLANE_V]);
+
+    for (int i = 0; i < mHeight; ++i) {
+        memcpy(pYBuffer + i * dstYStride, img.data + i * mWidth, mWidth);
+    }
+    for (int i = 0; i < mHeight / 2; ++i) {
+        memcpy(pUBuffer + i * dstUVStride,
+               img.data + mWidth * mHeight + i * mWidth / 2, mWidth / 2);
+    }
+    for (int i = 0; i < mHeight / 2; ++i) {
+        memcpy(pVBuffer + i * dstUVStride,
+               img.data + mWidth * mHeight * 5 / 4 + i * mWidth / 2,
+               mWidth / 2);
+    }
+}
+
+uint64_t C2GoldfishAvcDec::getWorkIndex(uint64_t pts) {
+    if (!mOldPts2Index.empty()) {
+        auto iter = mOldPts2Index.find(pts);
+        if (iter != mOldPts2Index.end()) {
+            auto index = iter->second;
+            DDD("found index %d for pts %" PRIu64, (int)index, pts);
+            return index;
+        }
+    }
+    auto iter = mPts2Index.find(pts);
+    if (iter != mPts2Index.end()) {
+        auto index = iter->second;
+        DDD("found index %d for pts %" PRIu64, (int)index, pts);
+        return index;
+    }
+    DDD("not found index for pts %" PRIu64, pts);
+    return 0;
+}
+
+void C2GoldfishAvcDec::insertPts(uint32_t work_index, uint64_t pts) {
+    auto iter = mPts2Index.find(pts);
+    if (iter != mPts2Index.end()) {
+        // we have a collision here:
+        // apparently, older session is not done yet,
+        // lets save them
+        DDD("inserted to old pts %" PRIu64 " with index %d", pts, (int)iter->second);
+        mOldPts2Index[iter->first] = iter->second;
+    }
+    DDD("inserted pts %" PRIu64 " with index %d", pts, (int)work_index);
+    mIndex2Pts[work_index] = pts;
+    mPts2Index[pts] = work_index;
+}
+
+void C2GoldfishAvcDec::removePts(uint64_t pts) {
+    bool found = false;
+    uint64_t index = 0;
+    // note: check old pts first to see
+    // if we have some left over, check them
+    if (!mOldPts2Index.empty()) {
+        auto iter = mOldPts2Index.find(pts);
+        if (iter != mOldPts2Index.end()) {
+            mOldPts2Index.erase(iter);
+            index = iter->second;
+            found = true;
+        }
+    } else {
+        auto iter = mPts2Index.find(pts);
+        if (iter != mPts2Index.end()) {
+            mPts2Index.erase(iter);
+            index = iter->second;
+            found = true;
+        }
+    }
+
+    if (!found) return;
+
+    auto iter2 = mIndex2Pts.find(index);
+    if (iter2 == mIndex2Pts.end()) return;
+    mIndex2Pts.erase(iter2);
+}
+
+// TODO: can overall error checking be improved?
+// TODO: allow configuration of color format and usage for graphic buffers
+// instead
+//       of hard coding them to HAL_PIXEL_FORMAT_YV12
+// TODO: pass coloraspects information to surface
+// TODO: test support for dynamic change in resolution
+// TODO: verify if the decoder sent back all frames
+void C2GoldfishAvcDec::process(const std::unique_ptr<C2Work> &work,
+                               const std::shared_ptr<C2BlockPool> &pool) {
+    // Initialize output work
+    work->result = C2_OK;
+    work->workletsProcessed = 0u;
+    work->worklets.front()->output.flags = work->input.flags;
+    if (mSignalledError || mSignalledOutputEos) {
+        work->result = C2_BAD_VALUE;
+        return;
+    }
+
+    DDD("process work");
+    if (!mContext) {
+        DDD("creating decoder context to host in process work");
+        checkMode(pool);
+        createDecoder();
+        decodeHeaderAfterFlush();
+    }
+
+    size_t inOffset = 0u;
+    size_t inSize = 0u;
+    uint32_t workIndex = work->input.ordinal.frameIndex.peeku() & 0xFFFFFFFF;
+    mPts = work->input.ordinal.timestamp.peeku();
+    C2ReadView rView = mDummyReadView;
+    if (!work->input.buffers.empty()) {
+        rView =
+            work->input.buffers[0]->data().linearBlocks().front().map().get();
+        inSize = rView.capacity();
+        if (inSize && rView.error()) {
+            ALOGE("read view map failed %d", rView.error());
+            work->result = rView.error();
+            return;
+        }
+    }
+    bool eos = ((work->input.flags & C2FrameData::FLAG_END_OF_STREAM) != 0);
+    bool hasPicture = (inSize > 0);
+
+    DDD("in buffer attr. size %zu timestamp %d frameindex %d, flags %x", inSize,
+        (int)work->input.ordinal.timestamp.peeku(),
+        (int)work->input.ordinal.frameIndex.peeku(), work->input.flags);
+    size_t inPos = 0;
+    while (inPos < inSize && inSize - inPos >= kMinInputBytes) {
+        if (C2_OK != ensureDecoderState(pool)) {
+            mSignalledError = true;
+            work->workletsProcessed = 1u;
+            work->result = C2_CORRUPTED;
+            return;
+        }
+
+        {
+            // C2GraphicView wView;// = mOutBlock->map().get();
+            // if (wView.error()) {
+            //    ALOGE("graphic view map failed %d", wView.error());
+            //    work->result = wView.error();
+            //    return;
+            //}
+            if (!setDecodeArgs(&rView, nullptr, inOffset + inPos,
+                               inSize - inPos, workIndex)) {
+                mSignalledError = true;
+                work->workletsProcessed = 1u;
+                work->result = C2_CORRUPTED;
+                return;
+            }
+
+            DDD("flag is %x", work->input.flags);
+            if (work->input.flags & C2FrameData::FLAG_CODEC_CONFIG) {
+                hasPicture = false;
+                if (mCsd0.empty()) {
+                    mCsd0.assign(mInPBuffer, mInPBuffer + mInPBufferSize);
+                    DDD("assign to csd0 with %d bytpes", mInPBufferSize);
+                } else if (mCsd1.empty()) {
+                    mCsd1.assign(mInPBuffer, mInPBuffer + mInPBufferSize);
+                    DDD("assign to csd1 with %d bytpes", mInPBufferSize);
+                }
+                // this is not really a valid pts from config
+                removePts(mPts);
+            }
+
+            bool whChanged = false;
+            if (GoldfishH264Helper::isSpsFrame(mInPBuffer, mInPBufferSize)) {
+                mH264Helper.reset(new GoldfishH264Helper(mWidth, mHeight));
+                whChanged = mH264Helper->decodeHeader(mInPBuffer, mInPBufferSize);
+                if (whChanged) {
+                        DDD("w changed from old %d to new %d\n", mWidth, mH264Helper->getWidth());
+                        DDD("h changed from old %d to new %d\n", mHeight, mH264Helper->getHeight());
+                        if (1) {
+                            drainInternal(DRAIN_COMPONENT_NO_EOS, pool, work);
+                            resetDecoder();
+                            resetPlugin();
+                            work->workletsProcessed = 0u;
+                        }
+                        {
+                            mWidth = mH264Helper->getWidth();
+                            mHeight = mH264Helper->getHeight();
+                            C2StreamPictureSizeInfo::output size(0u, mWidth, mHeight);
+                            std::vector<std::unique_ptr<C2SettingResult>> failures;
+                            c2_status_t err = mIntf->config({&size}, C2_MAY_BLOCK, &failures);
+                            if (err == OK) {
+                                work->worklets.front()->output.configUpdate.push_back(
+                                        C2Param::Copy(size));
+                                ensureDecoderState(pool);
+                            } else {
+                                ALOGE("Cannot set width and height");
+                                mSignalledError = true;
+                                work->workletsProcessed = 1u;
+                                work->result = C2_CORRUPTED;
+                                return;
+                            }
+                        }
+                        if (!mContext) {
+                            DDD("creating decoder context to host in process work");
+                            checkMode(pool);
+                            createDecoder();
+                        }
+                        continue;
+                } // end of whChanged
+            } // end of isSpsFrame
+
+            sendMetadata();
+
+            uint32_t delay;
+            GETTIME(&mTimeStart, nullptr);
+            TIME_DIFF(mTimeEnd, mTimeStart, delay);
+            (void)delay;
+            //(void) ivdec_api_function(mDecHandle, &s_decode_ip, &s_decode_op);
+            DDD("decoding");
+            h264_result_t h264Res =
+                mContext->decodeFrame(mInPBuffer, mInPBufferSize, mIndex2Pts[mInTsMarker]);
+            mConsumedBytes = h264Res.bytesProcessed;
+            DDD("decoding consumed %d", (int)mConsumedBytes);
+
+            if (mHostColorBufferId > 0) {
+                mImg = mContext->renderOnHostAndReturnImageMetadata(
+                    mHostColorBufferId);
+            } else {
+                mImg = mContext->getImage();
+            }
+            uint32_t decodeTime;
+            GETTIME(&mTimeEnd, nullptr);
+            TIME_DIFF(mTimeStart, mTimeEnd, decodeTime);
+            (void)decodeTime;
+        }
+
+        if (mImg.data != nullptr) {
+            DDD("got data %" PRIu64 " with pts %" PRIu64,  getWorkIndex(mImg.pts), mImg.pts);
+            mHeaderDecoded = true;
+            copyImageData(mImg);
+            finishWork(getWorkIndex(mImg.pts), work);
+            removePts(mImg.pts);
+        } else {
+            work->workletsProcessed = 0u;
+        }
+
+        inPos += mConsumedBytes;
+    }
+    if (eos) {
+        DDD("drain because of eos");
+        drainInternal(DRAIN_COMPONENT_WITH_EOS, pool, work);
+        mSignalledOutputEos = true;
+    } else if (!hasPicture) {
+        DDD("no picture, fill empty work");
+        fillEmptyWork(work);
+    }
+
+    work->input.buffers.clear();
+}
+
+c2_status_t
+C2GoldfishAvcDec::drainInternal(uint32_t drainMode,
+                                const std::shared_ptr<C2BlockPool> &pool,
+                                const std::unique_ptr<C2Work> &work) {
+    if (drainMode == NO_DRAIN) {
+        ALOGW("drain with NO_DRAIN: no-op");
+        return C2_OK;
+    }
+    if (drainMode == DRAIN_CHAIN) {
+        ALOGW("DRAIN_CHAIN not supported");
+        return C2_OMITTED;
+    }
+
+    if (OK != setFlushMode())
+        return C2_CORRUPTED;
+    while (true) {
+        if (C2_OK != ensureDecoderState(pool)) {
+            mSignalledError = true;
+            work->workletsProcessed = 1u;
+            work->result = C2_CORRUPTED;
+            return C2_CORRUPTED;
+        }
+        /*
+        C2GraphicView wView = mOutBlock->map().get();
+        if (wView.error()) {
+            ALOGE("graphic view map failed %d", wView.error());
+            return C2_CORRUPTED;
+        }
+        if (!setDecodeArgs(nullptr, &wView, 0, 0, 0)) {
+            mSignalledError = true;
+            work->workletsProcessed = 1u;
+            return C2_CORRUPTED;
+        }
+        */
+
+        if (mHostColorBufferId > 0) {
+            mImg = mContext->renderOnHostAndReturnImageMetadata(
+                mHostColorBufferId);
+        } else {
+            mImg = mContext->getImage();
+        }
+
+        // TODO: maybe keep rendering to screen
+        //        mImg = mContext->getImage();
+        if (mImg.data != nullptr) {
+            DDD("got data in drain mode %" PRIu64 " with pts %" PRIu64,  getWorkIndex(mImg.pts), mImg.pts);
+            copyImageData(mImg);
+            finishWork(getWorkIndex(mImg.pts), work);
+            removePts(mImg.pts);
+        } else {
+            fillEmptyWork(work);
+            break;
+        }
+    }
+
+    return C2_OK;
+}
+
+c2_status_t C2GoldfishAvcDec::drain(uint32_t drainMode,
+                                    const std::shared_ptr<C2BlockPool> &pool) {
+    DDD("drainInternal because of drain");
+    return drainInternal(drainMode, pool, nullptr);
+}
+
+class C2GoldfishAvcDecFactory : public C2ComponentFactory {
+  public:
+    C2GoldfishAvcDecFactory()
+        : mHelper(std::static_pointer_cast<C2ReflectorHelper>(
+              GoldfishComponentStore::Create()->getParamReflector())) {}
+
+    virtual c2_status_t
+    createComponent(c2_node_id_t id,
+                    std::shared_ptr<C2Component> *const component,
+                    std::function<void(C2Component *)> deleter) override {
+        *component = std::shared_ptr<C2Component>(
+            new C2GoldfishAvcDec(
+                COMPONENT_NAME, id,
+                std::make_shared<C2GoldfishAvcDec::IntfImpl>(mHelper)),
+            deleter);
+        return C2_OK;
+    }
+
+    virtual c2_status_t createInterface(
+        c2_node_id_t id, std::shared_ptr<C2ComponentInterface> *const interface,
+        std::function<void(C2ComponentInterface *)> deleter) override {
+        *interface = std::shared_ptr<C2ComponentInterface>(
+            new SimpleInterface<C2GoldfishAvcDec::IntfImpl>(
+                COMPONENT_NAME, id,
+                std::make_shared<C2GoldfishAvcDec::IntfImpl>(mHelper)),
+            deleter);
+        return C2_OK;
+    }
+
+    virtual ~C2GoldfishAvcDecFactory() override = default;
+
+  private:
+    std::shared_ptr<C2ReflectorHelper> mHelper;
+};
+
+} // namespace android
+
+extern "C" ::C2ComponentFactory *CreateCodec2Factory() {
+    DDD("in %s", __func__);
+    return new ::android::C2GoldfishAvcDecFactory();
+}
+
+extern "C" void DestroyCodec2Factory(::C2ComponentFactory *factory) {
+    DDD("in %s", __func__);
+    delete factory;
+}
diff --git a/system/codecs/c2/decoders/avcdec/C2GoldfishAvcDec.h b/system/codecs/c2/decoders/avcdec/C2GoldfishAvcDec.h
new file mode 100644
index 0000000..d90b11a
--- /dev/null
+++ b/system/codecs/c2/decoders/avcdec/C2GoldfishAvcDec.h
@@ -0,0 +1,168 @@
+/*
+ * Copyright 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_C2_SOFT_AVC_DEC_H_
+#define ANDROID_C2_SOFT_AVC_DEC_H_
+
+#include <sys/time.h>
+
+#include <media/stagefright/foundation/ColorUtils.h>
+
+#include "MediaH264Decoder.h"
+#include "GoldfishH264Helper.h"
+#include <SimpleC2Component.h>
+#include <atomic>
+#include <map>
+
+namespace android {
+
+#define ALIGN2(x) ((((x) + 1) >> 1) << 1)
+#define ALIGN8(x) ((((x) + 7) >> 3) << 3)
+#define ALIGN16(x) ((((x) + 15) >> 4) << 4)
+#define ALIGN32(x) ((((x) + 31) >> 5) << 5)
+#define MAX_NUM_CORES 4
+#define MIN(a, b) (((a) < (b)) ? (a) : (b))
+#define GETTIME(a, b) gettimeofday(a, b);
+#define TIME_DIFF(start, end, diff)                                            \
+    diff = (((end).tv_sec - (start).tv_sec) * 1000000) +                       \
+           ((end).tv_usec - (start).tv_usec);
+
+class C2GoldfishAvcDec : public SimpleC2Component {
+  public:
+    class IntfImpl;
+    C2GoldfishAvcDec(const char *name, c2_node_id_t id,
+                     const std::shared_ptr<IntfImpl> &intfImpl);
+    virtual ~C2GoldfishAvcDec();
+
+    // From SimpleC2Component
+    c2_status_t onInit() override;
+    c2_status_t onStop() override;
+    void onReset() override;
+    void onRelease() override;
+    c2_status_t onFlush_sm() override;
+    void process(const std::unique_ptr<C2Work> &work,
+                 const std::shared_ptr<C2BlockPool> &pool) override;
+    c2_status_t drain(uint32_t drainMode,
+                      const std::shared_ptr<C2BlockPool> &pool) override;
+
+  private:
+    std::unique_ptr<MediaH264Decoder> mContext;
+    bool mEnableAndroidNativeBuffers{true};
+
+    void checkMode(const std::shared_ptr<C2BlockPool> &pool);
+    //    status_t createDecoder();
+    status_t createDecoder();
+    status_t setParams(size_t stride);
+    status_t initDecoder();
+    bool setDecodeArgs(C2ReadView *inBuffer, C2GraphicView *outBuffer,
+                       size_t inOffset, size_t inSize, uint32_t tsMarker);
+    c2_status_t ensureDecoderState(const std::shared_ptr<C2BlockPool> &pool);
+    void finishWork(uint64_t index, const std::unique_ptr<C2Work> &work);
+    status_t setFlushMode();
+    c2_status_t drainInternal(uint32_t drainMode,
+                              const std::shared_ptr<C2BlockPool> &pool,
+                              const std::unique_ptr<C2Work> &work);
+    status_t resetDecoder();
+    void resetPlugin();
+    void deleteContext();
+
+    std::shared_ptr<IntfImpl> mIntf;
+
+    void removePts(uint64_t pts);
+    void insertPts(uint32_t work_index, uint64_t pts);
+    uint64_t getWorkIndex(uint64_t pts);
+
+    // there are same pts matching to different work indices
+    // this happen during csd0/csd1 switching
+    std::map<uint64_t, uint64_t> mOldPts2Index;
+    std::map<uint64_t, uint64_t> mPts2Index;
+    std::map<uint64_t, uint64_t> mIndex2Pts;
+    uint64_t  mPts {0};
+
+    // TODO:This is not the right place for this enum. These should
+    // be part of c2-vndk so that they can be accessed by all video plugins
+    // until then, make them feel at home
+    enum {
+        kNotSupported,
+        kPreferBitstream,
+        kPreferContainer,
+    };
+
+    std::shared_ptr<C2GraphicBlock> mOutBlock;
+    uint8_t *mOutBufferFlush;
+
+    int mHostColorBufferId{-1};
+
+    void getVuiParams(h264_image_t &img);
+    void copyImageData(h264_image_t &img);
+
+    h264_image_t mImg{};
+    uint32_t mConsumedBytes{0};
+    uint8_t *mInPBuffer{nullptr};
+    uint32_t mInPBufferSize;
+    uint32_t mInTsMarker;
+
+    // size_t mNumCores;
+    // uint32_t mOutputDelay;
+    uint32_t mWidth;
+    uint32_t mHeight;
+    uint32_t mStride;
+    bool mSignalledOutputEos;
+    bool mSignalledError;
+    bool mHeaderDecoded;
+    std::atomic_uint64_t mOutIndex;
+    // Color aspects. These are ISO values and are meant to detect changes in
+    // aspects to avoid converting them to C2 values for each frame
+    struct VuiColorAspects {
+        uint8_t primaries;
+        uint8_t transfer;
+        uint8_t coeffs;
+        uint8_t fullRange;
+
+        // default color aspects
+        VuiColorAspects()
+            : primaries(2), transfer(2), coeffs(2), fullRange(0) {}
+
+        bool operator==(const VuiColorAspects &o) {
+            return primaries == o.primaries && transfer == o.transfer &&
+                   coeffs == o.coeffs && fullRange == o.fullRange;
+        }
+    } mBitstreamColorAspects;
+
+    MetaDataColorAspects mSentMetadata = {1, 0, 0, 0};
+
+    void sendMetadata();
+
+    // profile
+    struct timeval mTimeStart;
+    struct timeval mTimeEnd;
+#ifdef FILE_DUMP_ENABLE
+    char mInFile[200];
+#endif /* FILE_DUMP_ENABLE */
+
+    std::vector<uint8_t> mCsd0;
+    std::vector<uint8_t> mCsd1;
+    void decodeHeaderAfterFlush();
+
+    std::unique_ptr<GoldfishH264Helper> mH264Helper;
+
+    int mId = -1;
+    C2_DO_NOT_COPY(C2GoldfishAvcDec);
+};
+
+} // namespace android
+
+#endif // ANDROID_C2_SOFT_AVC_DEC_H_
diff --git a/system/codecs/c2/decoders/avcdec/GoldfishH264Helper.cpp b/system/codecs/c2/decoders/avcdec/GoldfishH264Helper.cpp
new file mode 100644
index 0000000..c656b90
--- /dev/null
+++ b/system/codecs/c2/decoders/avcdec/GoldfishH264Helper.cpp
@@ -0,0 +1,307 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "GoldfishH264Helper.h"
+
+#define LOG_TAG "GoldfishH264Helper"
+#include <log/log.h>
+
+#define DEBUG 0
+#if DEBUG
+#define DDD(fmt, ...) ALOGD("%s %d:" fmt, __func__, __LINE__, ##__VA_ARGS__)
+#else
+#define DDD(...) ((void)0)
+#endif
+
+
+#include <Codec2Mapper.h>
+
+#define ivdec_api_function              ih264d_api_function
+#define ivdext_create_ip_t              ih264d_create_ip_t
+#define ivdext_create_op_t              ih264d_create_op_t
+#define ivdext_delete_ip_t              ih264d_delete_ip_t
+#define ivdext_delete_op_t              ih264d_delete_op_t
+#define ivdext_ctl_set_num_cores_ip_t   ih264d_ctl_set_num_cores_ip_t
+#define ivdext_ctl_set_num_cores_op_t   ih264d_ctl_set_num_cores_op_t
+#define ivdext_ctl_get_vui_params_ip_t  ih264d_ctl_get_vui_params_ip_t
+#define ivdext_ctl_get_vui_params_op_t  ih264d_ctl_get_vui_params_op_t
+#define ALIGN128(x)                     ((((x) + 127) >> 7) << 7)
+#define MAX_NUM_CORES                   4
+#define IVDEXT_CMD_CTL_SET_NUM_CORES    \
+        (IVD_CONTROL_API_COMMAND_TYPE_T)IH264D_CMD_CTL_SET_NUM_CORES
+#define MIN(a, b)                       (((a) < (b)) ? (a) : (b))
+
+namespace android {
+
+static void *ivd_aligned_malloc(void *ctxt, WORD32 alignment, WORD32 size) {
+    (void) ctxt;
+    return memalign(alignment, size);
+}
+
+static void ivd_aligned_free(void *ctxt, void *mem) {
+    (void) ctxt;
+    free(mem);
+}
+
+
+GoldfishH264Helper::GoldfishH264Helper(int w, int h):mWidth(w),mHeight(h) { createDecoder(); }
+
+GoldfishH264Helper::~GoldfishH264Helper() {
+    destroyDecoder();
+}
+
+void GoldfishH264Helper::createDecoder() {
+    ivdext_create_ip_t s_create_ip = {};
+    ivdext_create_op_t s_create_op = {};
+
+    s_create_ip.s_ivd_create_ip_t.u4_size = sizeof(ivdext_create_ip_t);
+    s_create_ip.s_ivd_create_ip_t.e_cmd = IVD_CMD_CREATE;
+    s_create_ip.s_ivd_create_ip_t.u4_share_disp_buf = 0;
+    s_create_ip.s_ivd_create_ip_t.e_output_format = mIvColorformat;
+    s_create_ip.s_ivd_create_ip_t.pf_aligned_alloc = ivd_aligned_malloc;
+    s_create_ip.s_ivd_create_ip_t.pf_aligned_free = ivd_aligned_free;
+    s_create_ip.s_ivd_create_ip_t.pv_mem_ctxt = nullptr;
+    s_create_op.s_ivd_create_op_t.u4_size = sizeof(ivdext_create_op_t);
+    IV_API_CALL_STATUS_T status =
+        ivdec_api_function(mDecHandle, &s_create_ip, &s_create_op);
+    if (status != IV_SUCCESS) {
+        ALOGE("error in %s: 0x%x", __func__,
+              s_create_op.s_ivd_create_op_t.u4_error_code);
+        return;
+    }
+    mDecHandle = (iv_obj_t *)s_create_op.s_ivd_create_op_t.pv_handle;
+    mDecHandle->pv_fxns = (void *)ivdec_api_function;
+    mDecHandle->u4_size = sizeof(iv_obj_t);
+
+    mStride = ALIGN128(mWidth);
+
+    setNumCores();
+}
+
+void GoldfishH264Helper::destroyDecoder() {
+    if (mDecHandle) {
+        ivdext_delete_ip_t s_delete_ip = {};
+        ivdext_delete_op_t s_delete_op = {};
+
+        s_delete_ip.s_ivd_delete_ip_t.u4_size = sizeof(ivdext_delete_ip_t);
+        s_delete_ip.s_ivd_delete_ip_t.e_cmd = IVD_CMD_DELETE;
+        s_delete_op.s_ivd_delete_op_t.u4_size = sizeof(ivdext_delete_op_t);
+        IV_API_CALL_STATUS_T status =
+            ivdec_api_function(mDecHandle, &s_delete_ip, &s_delete_op);
+        if (status != IV_SUCCESS) {
+            ALOGE("error in %s: 0x%x", __func__,
+                  s_delete_op.s_ivd_delete_op_t.u4_error_code);
+        }
+        mDecHandle = nullptr;
+    }
+}
+
+void GoldfishH264Helper::setNumCores() {
+    ivdext_ctl_set_num_cores_ip_t s_set_num_cores_ip = {};
+    ivdext_ctl_set_num_cores_op_t s_set_num_cores_op = {};
+
+    s_set_num_cores_ip.u4_size = sizeof(ivdext_ctl_set_num_cores_ip_t);
+    s_set_num_cores_ip.e_cmd = IVD_CMD_VIDEO_CTL;
+    s_set_num_cores_ip.e_sub_cmd = IVDEXT_CMD_CTL_SET_NUM_CORES;
+    s_set_num_cores_ip.u4_num_cores = mNumCores;
+    s_set_num_cores_op.u4_size = sizeof(ivdext_ctl_set_num_cores_op_t);
+    IV_API_CALL_STATUS_T status = ivdec_api_function(
+        mDecHandle, &s_set_num_cores_ip, &s_set_num_cores_op);
+    if (IV_SUCCESS != status) {
+        DDD("error in %s: 0x%x", __func__, s_set_num_cores_op.u4_error_code);
+    }
+}
+
+void GoldfishH264Helper::resetDecoder() {
+    ivd_ctl_reset_ip_t s_reset_ip = {};
+    ivd_ctl_reset_op_t s_reset_op = {};
+
+    s_reset_ip.u4_size = sizeof(ivd_ctl_reset_ip_t);
+    s_reset_ip.e_cmd = IVD_CMD_VIDEO_CTL;
+    s_reset_ip.e_sub_cmd = IVD_CMD_CTL_RESET;
+    s_reset_op.u4_size = sizeof(ivd_ctl_reset_op_t);
+    IV_API_CALL_STATUS_T status =
+        ivdec_api_function(mDecHandle, &s_reset_ip, &s_reset_op);
+    if (IV_SUCCESS != status) {
+        ALOGE("error in %s: 0x%x", __func__, s_reset_op.u4_error_code);
+    }
+    setNumCores();
+}
+
+void GoldfishH264Helper::setParams(size_t stride,
+                                   IVD_VIDEO_DECODE_MODE_T dec_mode) {
+    ih264d_ctl_set_config_ip_t s_h264d_set_dyn_params_ip = {};
+    ih264d_ctl_set_config_op_t s_h264d_set_dyn_params_op = {};
+    ivd_ctl_set_config_ip_t *ps_set_dyn_params_ip =
+        &s_h264d_set_dyn_params_ip.s_ivd_ctl_set_config_ip_t;
+    ivd_ctl_set_config_op_t *ps_set_dyn_params_op =
+        &s_h264d_set_dyn_params_op.s_ivd_ctl_set_config_op_t;
+
+    ps_set_dyn_params_ip->u4_size = sizeof(ih264d_ctl_set_config_ip_t);
+    ps_set_dyn_params_ip->e_cmd = IVD_CMD_VIDEO_CTL;
+    ps_set_dyn_params_ip->e_sub_cmd = IVD_CMD_CTL_SETPARAMS;
+    ps_set_dyn_params_ip->u4_disp_wd = (UWORD32) stride;
+    ps_set_dyn_params_ip->e_frm_skip_mode = IVD_SKIP_NONE;
+    ps_set_dyn_params_ip->e_frm_out_mode = IVD_DISPLAY_FRAME_OUT;
+    ps_set_dyn_params_ip->e_vid_dec_mode = dec_mode;
+    ps_set_dyn_params_op->u4_size = sizeof(ih264d_ctl_set_config_op_t);
+    IV_API_CALL_STATUS_T status = ivdec_api_function(mDecHandle,
+                                                     &s_h264d_set_dyn_params_ip,
+                                                     &s_h264d_set_dyn_params_op);
+    if (status != IV_SUCCESS) {
+        ALOGE("error in %s: 0x%x", __func__,
+              ps_set_dyn_params_op->u4_error_code);
+    }
+}
+
+bool GoldfishH264Helper::isSpsFrame(const uint8_t* frame, int inSize) {
+    if (inSize < 5) return false;
+    if (frame[0] == 0 && frame[1] == 0 && frame[2] == 0 && frame[3] == 1) {
+        const bool forbiddenBitIsInvalid = 0x80 & frame[4];
+        if (forbiddenBitIsInvalid) {
+            return false;
+        }
+        // nalu type is the lower 5 bits
+        uint8_t naluType = 0x1f & frame[4];
+        if (naluType == 7
+            || naluType == 8
+                ) return true;
+        else return false;
+    } else {
+        return false;
+    }
+}
+
+bool GoldfishH264Helper::decodeHeader(const uint8_t *frame, int inSize) {
+    DDD("entering");
+    // should we check the header for vps/sps/pps frame ? otherwise
+    // there is no point calling decoder
+    if (!isSpsFrame(frame, inSize)) {
+        DDD("could not find valid vps frame");
+        DDD("leaving with false");
+        return false;
+    } else {
+        DDD("found valid vps frame");
+    }
+
+    ih264d_video_decode_ip_t s_h264d_decode_ip = {};
+    ih264d_video_decode_op_t s_h264d_decode_op = {};
+    ivd_video_decode_ip_t *ps_decode_ip = &s_h264d_decode_ip.s_ivd_video_decode_ip_t;
+    ivd_video_decode_op_t *ps_decode_op = &s_h264d_decode_op.s_ivd_video_decode_op_t;
+
+    // setup input/output arguments to decoder
+    setDecodeArgs(ps_decode_ip, ps_decode_op, frame, mStride,
+            0, // offset
+            inSize, // size
+            0 // time-stamp, does not matter
+            );
+
+    setParams(mStride, IVD_DECODE_HEADER);
+
+    // now kick off the decoding
+    ivdec_api_function(mDecHandle, ps_decode_ip, ps_decode_op);
+
+    if (IVD_RES_CHANGED == (ps_decode_op->u4_error_code & IVD_ERROR_MASK)) {
+        DDD("resolution changed, reset decoder");
+        resetDecoder();
+        setParams(mStride, IVD_DECODE_HEADER);
+        ivdec_api_function(mDecHandle, ps_decode_ip, ps_decode_op);
+    }
+
+    // get the w/h and update
+    if (0 < ps_decode_op->u4_pic_wd && 0 < ps_decode_op->u4_pic_ht) {
+        DDD("success decode w/h %d %d", ps_decode_op->u4_pic_wd , ps_decode_op->u4_pic_ht);
+        DDD("existing w/h %d %d", mWidth, mHeight);
+        if (ps_decode_op->u4_pic_wd != mWidth ||  ps_decode_op->u4_pic_ht != mHeight) {
+            mWidth = ps_decode_op->u4_pic_wd;
+            mHeight = ps_decode_op->u4_pic_ht;
+            DDD("leaving with true");
+            return true;
+        } else {
+            DDD("success decode w/h, but they are the same %d %d", ps_decode_op->u4_pic_wd , ps_decode_op->u4_pic_ht);
+        }
+    }
+
+    // get output delay
+    if (ps_decode_op->i4_reorder_depth >= 0) {
+        if (mOutputDelay != ps_decode_op->i4_reorder_depth) {
+            mOutputDelay = ps_decode_op->i4_reorder_depth;
+            DDD("New Output delay %d ", mOutputDelay);
+        } else {
+            DDD("same Output delay %d ", mOutputDelay);
+        }
+    }
+
+    DDD("leaving with false");
+    return false;
+}
+
+bool GoldfishH264Helper::setDecodeArgs(ivd_video_decode_ip_t *ps_decode_ip,
+                                       ivd_video_decode_op_t *ps_decode_op,
+                                       const uint8_t *inBuffer,
+                                       uint32_t displayStride, size_t inOffset,
+                                       size_t inSize, uint32_t tsMarker) {
+    uint32_t displayHeight = mHeight;
+    size_t lumaSize = displayStride * displayHeight;
+    size_t chromaSize = lumaSize >> 2;
+
+    if (mStride != displayStride) {
+        mStride = displayStride;
+    }
+
+    // force decoder to always decode header and get dimensions,
+    // hope this will be quick and cheap
+    setParams(mStride, IVD_DECODE_HEADER);
+
+    ps_decode_ip->u4_size = sizeof(ih264d_video_decode_ip_t);
+    ps_decode_ip->e_cmd = IVD_CMD_VIDEO_DECODE;
+    if (inBuffer) {
+        ps_decode_ip->u4_ts = tsMarker;
+        ps_decode_ip->pv_stream_buffer = const_cast<uint8_t *>(inBuffer) + inOffset;
+        ps_decode_ip->u4_num_Bytes = inSize;
+    } else {
+        ps_decode_ip->u4_ts = 0;
+        ps_decode_ip->pv_stream_buffer = nullptr;
+        ps_decode_ip->u4_num_Bytes = 0;
+    }
+    DDD("setting pv_stream_buffer 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x",
+            ((uint8_t*)(ps_decode_ip->pv_stream_buffer))[0],
+            ((uint8_t*)(ps_decode_ip->pv_stream_buffer))[1],
+            ((uint8_t*)(ps_decode_ip->pv_stream_buffer))[2],
+            ((uint8_t*)(ps_decode_ip->pv_stream_buffer))[3],
+            ((uint8_t*)(ps_decode_ip->pv_stream_buffer))[4],
+            ((uint8_t*)(ps_decode_ip->pv_stream_buffer))[5],
+            ((uint8_t*)(ps_decode_ip->pv_stream_buffer))[6],
+            ((uint8_t*)(ps_decode_ip->pv_stream_buffer))[7]
+            );
+    DDD("input bytes %d", ps_decode_ip->u4_num_Bytes);
+
+    ps_decode_ip->s_out_buffer.u4_min_out_buf_size[0] = lumaSize;
+    ps_decode_ip->s_out_buffer.u4_min_out_buf_size[1] = chromaSize;
+    ps_decode_ip->s_out_buffer.u4_min_out_buf_size[2] = chromaSize;
+    {
+        ps_decode_ip->s_out_buffer.pu1_bufs[0] = nullptr;
+        ps_decode_ip->s_out_buffer.pu1_bufs[1] = nullptr;
+        ps_decode_ip->s_out_buffer.pu1_bufs[2] = nullptr;
+    }
+    ps_decode_ip->s_out_buffer.u4_num_bufs = 3;
+    ps_decode_op->u4_size = sizeof(ih264d_video_decode_op_t);
+    ps_decode_op->u4_output_present = 0;
+
+    return true;
+}
+
+} // namespace android
diff --git a/system/codecs/c2/decoders/avcdec/GoldfishH264Helper.h b/system/codecs/c2/decoders/avcdec/GoldfishH264Helper.h
new file mode 100644
index 0000000..ec3b384
--- /dev/null
+++ b/system/codecs/c2/decoders/avcdec/GoldfishH264Helper.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef GOLDFISH_H264_HELPER_H_
+#define GOLDFISH_H264_HELPER_H_
+
+#include <inttypes.h>
+#include "ih264_typedefs.h"
+#include "ih264d.h"
+
+
+namespace android {
+
+// this class is just to provide some functions to decode header
+// so that we know w/h of each sps
+class GoldfishH264Helper {
+  public:
+    GoldfishH264Helper(int w, int h);
+    ~GoldfishH264Helper();
+
+    // check whether the frame is sps; typical h264 will have
+    // a frame that is sps/pps together
+    static bool isSpsFrame(const uint8_t* frame, int inSize);
+  public:
+    // return true if decoding finds out w/h changed;
+    // otherwise false
+    bool decodeHeader(const uint8_t *frame, int inSize);
+    int getWidth() const { return mWidth; }
+    int getHeight() const { return mHeight; }
+
+  private:
+    void createDecoder();
+    void destroyDecoder();
+    void resetDecoder();
+    void setNumCores();
+    void setParams(size_t stride, IVD_VIDEO_DECODE_MODE_T dec_mode);
+    bool setDecodeArgs(ivd_video_decode_ip_t *ps_decode_ip,
+                       ivd_video_decode_op_t *ps_decode_op,
+                       const uint8_t *inBuffer, uint32_t displayStride,
+                       size_t inOffset, size_t inSize, uint32_t tsMarker);
+
+  private:
+    iv_obj_t *mDecHandle = nullptr;
+    int mWidth = 320;
+    int mHeight = 240;
+    int mNumCores = 1;
+    int mStride = 16;
+    int mOutputDelay = 8; // default
+    IV_COLOR_FORMAT_T mIvColorformat = IV_YUV_420P;
+};
+
+} // namespace android
+#endif
diff --git a/system/codecs/c2/decoders/avcdec/MediaH264Decoder.cpp b/system/codecs/c2/decoders/avcdec/MediaH264Decoder.cpp
new file mode 100644
index 0000000..6560772
--- /dev/null
+++ b/system/codecs/c2/decoders/avcdec/MediaH264Decoder.cpp
@@ -0,0 +1,229 @@
+/*
+ * Copyright 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <utils/Log.h>
+
+#define DEBUG 0
+#if DEBUG
+#define DDD(...) ALOGD(__VA_ARGS__)
+#else
+#define DDD(...) ((void)0)
+#endif
+
+#include "MediaH264Decoder.h"
+#include "goldfish_media_utils.h"
+#include <string.h>
+
+MediaH264Decoder::MediaH264Decoder(RenderMode renderMode)
+    : mRenderMode(renderMode) {
+    if (renderMode == RenderMode::RENDER_BY_HOST_GPU) {
+        mVersion = 200;
+    } else if (renderMode == RenderMode::RENDER_BY_GUEST_CPU) {
+        mVersion = 100;
+    }
+}
+
+void MediaH264Decoder::initH264Context(unsigned int width, unsigned int height,
+                                       unsigned int outWidth,
+                                       unsigned int outHeight,
+                                       PixelFormat pixFmt) {
+    auto transport = GoldfishMediaTransport::getInstance();
+    if (!mHasAddressSpaceMemory) {
+        int slot = transport->getMemorySlot();
+        if (slot < 0) {
+            ALOGE("ERROR: Failed to initH264Context: cannot get memory slot");
+            return;
+        }
+        mSlot = slot;
+        mAddressOffSet = static_cast<unsigned int>(mSlot) * (1 << 20);
+        DDD("got memory lot %d addrr %lu", mSlot, mAddressOffSet);
+        mHasAddressSpaceMemory = true;
+    }
+    transport->writeParam(mVersion, 0, mAddressOffSet);
+    transport->writeParam(width, 1, mAddressOffSet);
+    transport->writeParam(height, 2, mAddressOffSet);
+    transport->writeParam(outWidth, 3, mAddressOffSet);
+    transport->writeParam(outHeight, 4, mAddressOffSet);
+    transport->writeParam(static_cast<uint64_t>(pixFmt), 5, mAddressOffSet);
+    transport->sendOperation(MediaCodecType::H264Codec,
+                             MediaOperation::InitContext, mAddressOffSet);
+    auto *retptr = transport->getReturnAddr(mAddressOffSet);
+    mHostHandle = *(uint64_t *)(retptr);
+    DDD("initH264Context: got handle to host %lu", mHostHandle);
+}
+
+void MediaH264Decoder::resetH264Context(unsigned int width, unsigned int height,
+                                        unsigned int outWidth,
+                                        unsigned int outHeight,
+                                        PixelFormat pixFmt) {
+    auto transport = GoldfishMediaTransport::getInstance();
+    if (!mHasAddressSpaceMemory) {
+        ALOGE("%s no address space memory", __func__);
+        return;
+    }
+    transport->writeParam((uint64_t)mHostHandle, 0, mAddressOffSet);
+    transport->writeParam(width, 1, mAddressOffSet);
+    transport->writeParam(height, 2, mAddressOffSet);
+    transport->writeParam(outWidth, 3, mAddressOffSet);
+    transport->writeParam(outHeight, 4, mAddressOffSet);
+    transport->writeParam(static_cast<uint64_t>(pixFmt), 5, mAddressOffSet);
+    transport->sendOperation(MediaCodecType::H264Codec, MediaOperation::Reset,
+                             mAddressOffSet);
+    DDD("resetH264Context: done");
+}
+
+void MediaH264Decoder::destroyH264Context() {
+
+    DDD("return memory lot %d addrr %lu", (int)(mAddressOffSet >> 23),
+        mAddressOffSet);
+    auto transport = GoldfishMediaTransport::getInstance();
+    transport->writeParam((uint64_t)mHostHandle, 0, mAddressOffSet);
+    transport->sendOperation(MediaCodecType::H264Codec,
+                             MediaOperation::DestroyContext, mAddressOffSet);
+    transport->returnMemorySlot(mSlot);
+    mHasAddressSpaceMemory = false;
+}
+
+h264_result_t MediaH264Decoder::decodeFrame(uint8_t *img, size_t szBytes,
+                                            uint64_t pts) {
+    DDD("decode frame: use handle to host %lu", mHostHandle);
+    h264_result_t res = {0, 0};
+    if (!mHasAddressSpaceMemory) {
+        ALOGE("%s no address space memory", __func__);
+        return res;
+    }
+    auto transport = GoldfishMediaTransport::getInstance();
+    uint8_t *hostSrc = transport->getInputAddr(mAddressOffSet);
+    if (img != nullptr && szBytes > 0) {
+        memcpy(hostSrc, img, szBytes);
+    }
+    transport->writeParam((uint64_t)mHostHandle, 0, mAddressOffSet);
+    transport->writeParam(transport->offsetOf((uint64_t)(hostSrc)) -
+                              mAddressOffSet,
+                          1, mAddressOffSet);
+    transport->writeParam((uint64_t)szBytes, 2, mAddressOffSet);
+    transport->writeParam((uint64_t)pts, 3, mAddressOffSet);
+    transport->sendOperation(MediaCodecType::H264Codec,
+                             MediaOperation::DecodeImage, mAddressOffSet);
+
+    auto *retptr = transport->getReturnAddr(mAddressOffSet);
+    res.bytesProcessed = *(uint64_t *)(retptr);
+    res.ret = *(int *)(retptr + 8);
+
+    return res;
+}
+
+void MediaH264Decoder::sendMetadata(MetaDataColorAspects *ptr) {
+    DDD("send metadata to host %p", ptr);
+    if (!mHasAddressSpaceMemory) {
+        ALOGE("%s no address space memory", __func__);
+        return;
+    }
+    MetaDataColorAspects& meta = *ptr;
+    auto transport = GoldfishMediaTransport::getInstance();
+    transport->writeParam((uint64_t)mHostHandle, 0, mAddressOffSet);
+    transport->writeParam(meta.type, 1, mAddressOffSet);
+    transport->writeParam(meta.primaries, 2, mAddressOffSet);
+    transport->writeParam(meta.range, 3, mAddressOffSet);
+    transport->writeParam(meta.transfer, 4, mAddressOffSet);
+    transport->sendOperation(MediaCodecType::H264Codec, MediaOperation::SendMetadata, mAddressOffSet);
+}
+
+void MediaH264Decoder::flush() {
+    if (!mHasAddressSpaceMemory) {
+        ALOGE("%s no address space memory", __func__);
+        return;
+    }
+    DDD("flush: use handle to host %lu", mHostHandle);
+    auto transport = GoldfishMediaTransport::getInstance();
+    transport->writeParam((uint64_t)mHostHandle, 0, mAddressOffSet);
+    transport->sendOperation(MediaCodecType::H264Codec, MediaOperation::Flush,
+                             mAddressOffSet);
+}
+
+h264_image_t MediaH264Decoder::getImage() {
+    DDD("getImage: use handle to host %lu", mHostHandle);
+    h264_image_t res{};
+    if (!mHasAddressSpaceMemory) {
+        ALOGE("%s no address space memory", __func__);
+        return res;
+    }
+    auto transport = GoldfishMediaTransport::getInstance();
+    uint8_t *dst = transport->getInputAddr(
+        mAddressOffSet); // Note: reuse the same addr for input and output
+    transport->writeParam((uint64_t)mHostHandle, 0, mAddressOffSet);
+    transport->writeParam(transport->offsetOf((uint64_t)(dst)) - mAddressOffSet,
+                          1, mAddressOffSet);
+    transport->writeParam(-1, 2, mAddressOffSet);
+    transport->sendOperation(MediaCodecType::H264Codec,
+                             MediaOperation::GetImage, mAddressOffSet);
+    auto *retptr = transport->getReturnAddr(mAddressOffSet);
+    res.ret = *(int *)(retptr);
+    if (res.ret >= 0) {
+        res.data = dst;
+        res.width = *(uint32_t *)(retptr + 8);
+        res.height = *(uint32_t *)(retptr + 16);
+        res.pts = *(uint64_t *)(retptr + 24);
+        res.color_primaries = *(uint32_t *)(retptr + 32);
+        res.color_range = *(uint32_t *)(retptr + 40);
+        res.color_trc = *(uint32_t *)(retptr + 48);
+        res.colorspace = *(uint32_t *)(retptr + 56);
+    } else if (res.ret == (int)(Err::DecoderRestarted)) {
+        res.width = *(uint32_t *)(retptr + 8);
+        res.height = *(uint32_t *)(retptr + 16);
+    }
+    return res;
+}
+
+h264_image_t
+MediaH264Decoder::renderOnHostAndReturnImageMetadata(int hostColorBufferId) {
+    DDD("%s: use handle to host %lu", __func__, mHostHandle);
+    h264_image_t res{};
+    if (hostColorBufferId < 0) {
+        ALOGE("%s negative color buffer id %d", __func__, hostColorBufferId);
+        return res;
+    }
+    DDD("%s send color buffer id %d", __func__, hostColorBufferId);
+    if (!mHasAddressSpaceMemory) {
+        ALOGE("%s no address space memory", __func__);
+        return res;
+    }
+    auto transport = GoldfishMediaTransport::getInstance();
+    uint8_t *dst = transport->getInputAddr(
+        mAddressOffSet); // Note: reuse the same addr for input and output
+    transport->writeParam((uint64_t)mHostHandle, 0, mAddressOffSet);
+    transport->writeParam(transport->offsetOf((uint64_t)(dst)) - mAddressOffSet,
+                          1, mAddressOffSet);
+    transport->writeParam((uint64_t)hostColorBufferId, 2, mAddressOffSet);
+    transport->sendOperation(MediaCodecType::H264Codec,
+                             MediaOperation::GetImage, mAddressOffSet);
+    auto *retptr = transport->getReturnAddr(mAddressOffSet);
+    res.ret = *(int *)(retptr);
+    if (res.ret >= 0) {
+        res.data = dst; // note: the data could be junk
+        res.width = *(uint32_t *)(retptr + 8);
+        res.height = *(uint32_t *)(retptr + 16);
+        res.pts = *(uint64_t *)(retptr + 24);
+        res.color_primaries = *(uint32_t *)(retptr + 32);
+        res.color_range = *(uint32_t *)(retptr + 40);
+        res.color_trc = *(uint32_t *)(retptr + 48);
+        res.colorspace = *(uint32_t *)(retptr + 56);
+    } else if (res.ret == (int)(Err::DecoderRestarted)) {
+        res.width = *(uint32_t *)(retptr + 8);
+        res.height = *(uint32_t *)(retptr + 16);
+    }
+    return res;
+}
diff --git a/system/codecs/c2/decoders/avcdec/MediaH264Decoder.h b/system/codecs/c2/decoders/avcdec/MediaH264Decoder.h
new file mode 100644
index 0000000..e184cbd
--- /dev/null
+++ b/system/codecs/c2/decoders/avcdec/MediaH264Decoder.h
@@ -0,0 +1,104 @@
+/*
+ * Copyright 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef GOLDFISH_MEDIA_H264_DEC_H_
+#define GOLDFISH_MEDIA_H264_DEC_H_
+
+#include "goldfish_media_utils.h"
+
+struct h264_init_result_t {
+    uint64_t host_handle;
+    int ret;
+};
+
+struct h264_result_t {
+    int ret;
+    uint64_t bytesProcessed;
+};
+
+struct h264_image_t {
+    const uint8_t *data;
+    uint32_t width;
+    uint32_t height;
+    uint64_t pts; // presentation time stamp
+    uint64_t color_primaries;
+    uint64_t color_range;
+    uint64_t color_trc;
+    uint64_t colorspace;
+    // on success, |ret| will indicate the size of |data|.
+    // If failed, |ret| will contain some negative error code.
+    int ret;
+};
+
+enum class RenderMode {
+    RENDER_BY_HOST_GPU = 1,
+    RENDER_BY_GUEST_CPU = 2,
+};
+
+class MediaH264Decoder {
+    uint64_t mHostHandle = 0;
+    uint32_t mVersion = 100;
+    RenderMode mRenderMode = RenderMode::RENDER_BY_GUEST_CPU;
+
+    bool mHasAddressSpaceMemory = false;
+    uint64_t mAddressOffSet = 0;
+    int mSlot = -1;
+
+  public:
+    MediaH264Decoder(RenderMode renderMode);
+    virtual ~MediaH264Decoder() = default;
+
+    enum class PixelFormat : uint8_t {
+        YUV420P = 0,
+        UYVY422 = 1,
+        BGRA8888 = 2,
+    };
+
+    enum class Err : int {
+        NoErr = 0,
+        NoDecodedFrame = -1,
+        InitContextFailed = -2,
+        DecoderRestarted = -3,
+        NALUIgnored = -4,
+    };
+
+    bool getAddressSpaceMemory();
+    void initH264Context(unsigned int width, unsigned int height,
+                         unsigned int outWidth, unsigned int outHeight,
+                         PixelFormat pixFmt);
+    void resetH264Context(unsigned int width, unsigned int height,
+                          unsigned int outWidth, unsigned int outHeight,
+                          PixelFormat pixFmt);
+    void destroyH264Context();
+    h264_result_t decodeFrame(uint8_t *img, size_t szBytes, uint64_t pts);
+    void flush();
+    // ask host to copy image data back to guest, with image metadata
+    // to guest as well
+    h264_image_t getImage();
+    // ask host to render to hostColorBufferId, return only image metadata back
+    // to guest
+    h264_image_t renderOnHostAndReturnImageMetadata(int hostColorBufferId);
+
+    // send metadata about the bitstream to host, such as color aspects that
+    // are set by the framework, e.g., color primaries (601, 709 etc), range
+    // (full range or limited range), transfer etc. given metadata could be
+    // of all kinds of types, the convention is that the first field server as
+    // metadata type id. host will check the type id to decide what to do with
+    // it; unrecognized typeid will be discarded by host side.
+
+    void sendMetadata(MetaDataColorAspects *ptr);
+};
+#endif
diff --git a/system/codecs/c2/decoders/base/Android.bp b/system/codecs/c2/decoders/base/Android.bp
new file mode 100644
index 0000000..348334b
--- /dev/null
+++ b/system/codecs/c2/decoders/base/Android.bp
@@ -0,0 +1,87 @@
+// DO NOT DEPEND ON THIS DIRECTLY
+// use libcodec2_soft-defaults instead
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "device_generic_goldfish-opengl_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["device_generic_goldfish-opengl_license"],
+}
+
+cc_library_shared {
+    name: "libcodec2_goldfish_common",
+    defaults: ["libcodec2-impl-defaults"],
+    vendor: true,
+
+    srcs: [
+        "SimpleC2Component.cpp",
+        "SimpleC2Interface.cpp",
+        "goldfish_media_utils.cpp",
+        "color_buffer_utils.cpp",
+    ],
+
+    export_include_dirs: [
+        "include",
+    ],
+
+    export_shared_lib_headers: [
+        "libsfplugin_ccodec_utils",
+        "libgoldfish_codec2_store", // for goldfish store
+    ],
+
+    shared_libs: [
+        "libcutils", // for properties
+        "liblog",    // for ALOG
+        "libdrm",    // for ALOG
+        "libbase",   // for properties, parseint
+        "libsfplugin_ccodec_utils", // for ImageCopy
+        "libstagefright_foundation", // for Mutexed
+        "libgoldfish_codec2_store", // for goldfish store
+    ],
+
+    static_libs: [
+        "libplatform",
+        "libGoldfishAddressSpace",
+    ],
+
+    header_libs: [
+        "libgralloc_cb.ranchu",
+    ],
+
+    sanitize: {
+        misc_undefined: [
+            "unsigned-integer-overflow",
+            "signed-integer-overflow",
+        ],
+        cfi: true,
+    },
+
+
+    ldflags: ["-Wl,-Bsymbolic"],
+}
+
+// public dependency for software codec implementation
+// to be used by code under media/codecs/* only as its stability is not guaranteed
+cc_defaults {
+    name: "libcodec2_goldfish-defaults",
+    defaults: ["libcodec2-impl-defaults"],
+    export_shared_lib_headers: [
+        "libsfplugin_ccodec_utils",
+    ],
+
+    shared_libs: [
+        "libcodec2_goldfish_common",
+        "libcutils", // for properties
+        "liblog", // for ALOG
+        "libsfplugin_ccodec_utils", // for ImageCopy
+        "libstagefright_foundation", // for ColorUtils and MIME
+    ],
+
+    cflags: [
+        "-Wall",
+        "-Werror",
+    ],
+
+    ldflags: ["-Wl,-Bsymbolic"],
+}
diff --git a/system/codecs/c2/decoders/base/SimpleC2Component.cpp b/system/codecs/c2/decoders/base/SimpleC2Component.cpp
new file mode 100644
index 0000000..1e1bbc7
--- /dev/null
+++ b/system/codecs/c2/decoders/base/SimpleC2Component.cpp
@@ -0,0 +1,624 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "SimpleC2Component"
+#include <log/log.h>
+
+#include <cutils/properties.h>
+#include <media/stagefright/foundation/AMessage.h>
+
+#include <inttypes.h>
+
+#include <C2Config.h>
+#include <C2Debug.h>
+#include <C2PlatformSupport.h>
+#include <SimpleC2Component.h>
+
+#define DEBUG 0
+#if DEBUG
+#define DDD(...) ALOGD(__VA_ARGS__)
+#else
+#define DDD(...) ((void)0)
+#endif
+
+namespace android {
+
+std::unique_ptr<C2Work> SimpleC2Component::WorkQueue::pop_front() {
+    std::unique_ptr<C2Work> work = std::move(mQueue.front().work);
+    mQueue.pop_front();
+    return work;
+}
+
+void SimpleC2Component::WorkQueue::push_back(std::unique_ptr<C2Work> work) {
+    mQueue.push_back({std::move(work), NO_DRAIN});
+}
+
+bool SimpleC2Component::WorkQueue::empty() const { return mQueue.empty(); }
+
+void SimpleC2Component::WorkQueue::clear() { mQueue.clear(); }
+
+uint32_t SimpleC2Component::WorkQueue::drainMode() const {
+    return mQueue.front().drainMode;
+}
+
+void SimpleC2Component::WorkQueue::markDrain(uint32_t drainMode) {
+    mQueue.push_back({nullptr, drainMode});
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+SimpleC2Component::WorkHandler::WorkHandler() : mRunning(false) {}
+
+void SimpleC2Component::WorkHandler::setComponent(
+    const std::shared_ptr<SimpleC2Component> &thiz) {
+    mThiz = thiz;
+}
+
+static void Reply(const sp<AMessage> &msg, int32_t *err = nullptr) {
+    sp<AReplyToken> replyId;
+    CHECK(msg->senderAwaitsResponse(&replyId));
+    sp<AMessage> reply = new AMessage;
+    if (err) {
+        reply->setInt32("err", *err);
+    }
+    reply->postReply(replyId);
+}
+
+void SimpleC2Component::WorkHandler::onMessageReceived(
+    const sp<AMessage> &msg) {
+    std::shared_ptr<SimpleC2Component> thiz = mThiz.lock();
+    if (!thiz) {
+        ALOGD("component not yet set; msg = %s", msg->debugString().c_str());
+        sp<AReplyToken> replyId;
+        if (msg->senderAwaitsResponse(&replyId)) {
+            sp<AMessage> reply = new AMessage;
+            reply->setInt32("err", C2_CORRUPTED);
+            reply->postReply(replyId);
+        }
+        return;
+    }
+
+    switch (msg->what()) {
+    case kWhatProcess: {
+        if (mRunning) {
+            if (thiz->processQueue()) {
+                (new AMessage(kWhatProcess, this))->post();
+            }
+        } else {
+            DDD("Ignore process message as we're not running");
+        }
+        break;
+    }
+    case kWhatInit: {
+        int32_t err = thiz->onInit();
+        Reply(msg, &err);
+        [[fallthrough]];
+    }
+    case kWhatStart: {
+        mRunning = true;
+        break;
+    }
+    case kWhatStop: {
+        int32_t err = thiz->onStop();
+        Reply(msg, &err);
+        break;
+    }
+    case kWhatReset: {
+        thiz->onReset();
+        mRunning = false;
+        Reply(msg);
+        break;
+    }
+    case kWhatRelease: {
+        thiz->onRelease();
+        mRunning = false;
+        Reply(msg);
+        break;
+    }
+    default: {
+        ALOGD("Unrecognized msg: %d", msg->what());
+        break;
+    }
+    }
+}
+
+class SimpleC2Component::BlockingBlockPool : public C2BlockPool {
+  public:
+    BlockingBlockPool(const std::shared_ptr<C2BlockPool> &base) : mBase{base} {}
+
+    virtual local_id_t getLocalId() const override {
+        return mBase->getLocalId();
+    }
+
+    virtual C2Allocator::id_t getAllocatorId() const override {
+        return mBase->getAllocatorId();
+    }
+
+    virtual c2_status_t
+    fetchLinearBlock(uint32_t capacity, C2MemoryUsage usage,
+                     std::shared_ptr<C2LinearBlock> *block) {
+        c2_status_t status;
+        do {
+            status = mBase->fetchLinearBlock(capacity, usage, block);
+        } while (status == C2_BLOCKING);
+        return status;
+    }
+
+    virtual c2_status_t
+    fetchCircularBlock(uint32_t capacity, C2MemoryUsage usage,
+                       std::shared_ptr<C2CircularBlock> *block) {
+        c2_status_t status;
+        do {
+            status = mBase->fetchCircularBlock(capacity, usage, block);
+        } while (status == C2_BLOCKING);
+        return status;
+    }
+
+    virtual c2_status_t
+    fetchGraphicBlock(uint32_t width, uint32_t height, uint32_t format,
+                      C2MemoryUsage usage,
+                      std::shared_ptr<C2GraphicBlock> *block) {
+        c2_status_t status;
+        do {
+            status =
+                mBase->fetchGraphicBlock(width, height, format, usage, block);
+        } while (status == C2_BLOCKING);
+        return status;
+    }
+
+  private:
+    std::shared_ptr<C2BlockPool> mBase;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+
+namespace {
+
+struct DummyReadView : public C2ReadView {
+    DummyReadView() : C2ReadView(C2_NO_INIT) {}
+};
+
+} // namespace
+
+SimpleC2Component::SimpleC2Component(
+    const std::shared_ptr<C2ComponentInterface> &intf)
+    : mDummyReadView(DummyReadView()), mIntf(intf), mLooper(new ALooper),
+      mHandler(new WorkHandler) {
+    mLooper->setName(intf->getName().c_str());
+    (void)mLooper->registerHandler(mHandler);
+    mLooper->start(false, false, ANDROID_PRIORITY_VIDEO);
+}
+
+SimpleC2Component::~SimpleC2Component() {
+    mLooper->unregisterHandler(mHandler->id());
+    (void)mLooper->stop();
+}
+
+c2_status_t SimpleC2Component::setListener_vb(
+    const std::shared_ptr<C2Component::Listener> &listener,
+    c2_blocking_t mayBlock) {
+    mHandler->setComponent(shared_from_this());
+
+    Mutexed<ExecState>::Locked state(mExecState);
+    if (state->mState == RUNNING) {
+        if (listener) {
+            return C2_BAD_STATE;
+        } else if (!mayBlock) {
+            return C2_BLOCKING;
+        }
+    }
+    state->mListener = listener;
+    // TODO: wait for listener change to have taken place before returning
+    // (e.g. if there is an ongoing listener callback)
+    return C2_OK;
+}
+
+c2_status_t
+SimpleC2Component::queue_nb(std::list<std::unique_ptr<C2Work>> *const items) {
+    {
+        Mutexed<ExecState>::Locked state(mExecState);
+        if (state->mState != RUNNING) {
+            return C2_BAD_STATE;
+        }
+    }
+    bool queueWasEmpty = false;
+    {
+        Mutexed<WorkQueue>::Locked queue(mWorkQueue);
+        queueWasEmpty = queue->empty();
+        while (!items->empty()) {
+            queue->push_back(std::move(items->front()));
+            items->pop_front();
+        }
+    }
+    if (queueWasEmpty) {
+        (new AMessage(WorkHandler::kWhatProcess, mHandler))->post();
+    }
+    return C2_OK;
+}
+
+c2_status_t
+SimpleC2Component::announce_nb(const std::vector<C2WorkOutline> &items) {
+    (void)items;
+    return C2_OMITTED;
+}
+
+c2_status_t SimpleC2Component::flush_sm(
+    flush_mode_t flushMode,
+    std::list<std::unique_ptr<C2Work>> *const flushedWork) {
+    (void)flushMode;
+    {
+        Mutexed<ExecState>::Locked state(mExecState);
+        if (state->mState != RUNNING) {
+            return C2_BAD_STATE;
+        }
+    }
+    {
+        Mutexed<WorkQueue>::Locked queue(mWorkQueue);
+        queue->incGeneration();
+        // TODO: queue->splicedBy(flushedWork, flushedWork->end());
+        while (!queue->empty()) {
+            std::unique_ptr<C2Work> work = queue->pop_front();
+            if (work) {
+                flushedWork->push_back(std::move(work));
+            }
+        }
+        while (!queue->pending().empty()) {
+            flushedWork->push_back(std::move(queue->pending().begin()->second));
+            queue->pending().erase(queue->pending().begin());
+        }
+    }
+
+    return C2_OK;
+}
+
+c2_status_t SimpleC2Component::drain_nb(drain_mode_t drainMode) {
+    if (drainMode == DRAIN_CHAIN) {
+        return C2_OMITTED;
+    }
+    {
+        Mutexed<ExecState>::Locked state(mExecState);
+        if (state->mState != RUNNING) {
+            return C2_BAD_STATE;
+        }
+    }
+    bool queueWasEmpty = false;
+    {
+        Mutexed<WorkQueue>::Locked queue(mWorkQueue);
+        queueWasEmpty = queue->empty();
+        queue->markDrain(drainMode);
+    }
+    if (queueWasEmpty) {
+        (new AMessage(WorkHandler::kWhatProcess, mHandler))->post();
+    }
+
+    return C2_OK;
+}
+
+c2_status_t SimpleC2Component::start() {
+    Mutexed<ExecState>::Locked state(mExecState);
+    if (state->mState == RUNNING) {
+        return C2_BAD_STATE;
+    }
+    bool needsInit = (state->mState == UNINITIALIZED);
+    state.unlock();
+    if (needsInit) {
+        sp<AMessage> reply;
+        (new AMessage(WorkHandler::kWhatInit, mHandler))
+            ->postAndAwaitResponse(&reply);
+        int32_t err;
+        CHECK(reply->findInt32("err", &err));
+        if (err != C2_OK) {
+            return (c2_status_t)err;
+        }
+    } else {
+        (new AMessage(WorkHandler::kWhatStart, mHandler))->post();
+    }
+    state.lock();
+    state->mState = RUNNING;
+    return C2_OK;
+}
+
+c2_status_t SimpleC2Component::stop() {
+    DDD("stop");
+    {
+        Mutexed<ExecState>::Locked state(mExecState);
+        if (state->mState != RUNNING) {
+            return C2_BAD_STATE;
+        }
+        state->mState = STOPPED;
+    }
+    {
+        Mutexed<WorkQueue>::Locked queue(mWorkQueue);
+        queue->clear();
+        queue->pending().clear();
+    }
+    sp<AMessage> reply;
+    (new AMessage(WorkHandler::kWhatStop, mHandler))
+        ->postAndAwaitResponse(&reply);
+    int32_t err;
+    CHECK(reply->findInt32("err", &err));
+    if (err != C2_OK) {
+        return (c2_status_t)err;
+    }
+    return C2_OK;
+}
+
+c2_status_t SimpleC2Component::reset() {
+    DDD("reset");
+    {
+        Mutexed<ExecState>::Locked state(mExecState);
+        state->mState = UNINITIALIZED;
+    }
+    {
+        Mutexed<WorkQueue>::Locked queue(mWorkQueue);
+        queue->clear();
+        queue->pending().clear();
+    }
+    sp<AMessage> reply;
+    (new AMessage(WorkHandler::kWhatReset, mHandler))
+        ->postAndAwaitResponse(&reply);
+    return C2_OK;
+}
+
+c2_status_t SimpleC2Component::release() {
+    DDD("release");
+    sp<AMessage> reply;
+    (new AMessage(WorkHandler::kWhatRelease, mHandler))
+        ->postAndAwaitResponse(&reply);
+    return C2_OK;
+}
+
+std::shared_ptr<C2ComponentInterface> SimpleC2Component::intf() {
+    return mIntf;
+}
+
+namespace {
+
+std::list<std::unique_ptr<C2Work>> vec(std::unique_ptr<C2Work> &work) {
+    std::list<std::unique_ptr<C2Work>> ret;
+    ret.push_back(std::move(work));
+    return ret;
+}
+
+} // namespace
+
+void SimpleC2Component::finish(
+    uint64_t frameIndex,
+    std::function<void(const std::unique_ptr<C2Work> &)> fillWork) {
+    std::unique_ptr<C2Work> work;
+    {
+        Mutexed<WorkQueue>::Locked queue(mWorkQueue);
+        if (queue->pending().count(frameIndex) == 0) {
+            ALOGW("unknown frame index: %" PRIu64, frameIndex);
+            return;
+        }
+        work = std::move(queue->pending().at(frameIndex));
+        queue->pending().erase(frameIndex);
+    }
+    if (work) {
+        fillWork(work);
+        std::shared_ptr<C2Component::Listener> listener =
+            mExecState.lock()->mListener;
+        listener->onWorkDone_nb(shared_from_this(), vec(work));
+        DDD("returning pending work");
+    }
+}
+
+void SimpleC2Component::cloneAndSend(
+    uint64_t frameIndex, const std::unique_ptr<C2Work> &currentWork,
+    std::function<void(const std::unique_ptr<C2Work> &)> fillWork) {
+    std::unique_ptr<C2Work> work(new C2Work);
+    if (currentWork->input.ordinal.frameIndex == frameIndex) {
+        work->input.flags = currentWork->input.flags;
+        work->input.ordinal = currentWork->input.ordinal;
+    } else {
+        Mutexed<WorkQueue>::Locked queue(mWorkQueue);
+        if (queue->pending().count(frameIndex) == 0) {
+            ALOGW("unknown frame index: %" PRIu64, frameIndex);
+            return;
+        }
+        work->input.flags = queue->pending().at(frameIndex)->input.flags;
+        work->input.ordinal = queue->pending().at(frameIndex)->input.ordinal;
+    }
+    work->worklets.emplace_back(new C2Worklet);
+    if (work) {
+        fillWork(work);
+        std::shared_ptr<C2Component::Listener> listener =
+            mExecState.lock()->mListener;
+        listener->onWorkDone_nb(shared_from_this(), vec(work));
+        DDD("cloned and sending work");
+    }
+}
+
+bool SimpleC2Component::processQueue() {
+    std::unique_ptr<C2Work> work;
+    uint64_t generation;
+    int32_t drainMode;
+    bool isFlushPending = false;
+    bool hasQueuedWork = false;
+    {
+        Mutexed<WorkQueue>::Locked queue(mWorkQueue);
+        if (queue->empty()) {
+            return false;
+        }
+
+        generation = queue->generation();
+        drainMode = queue->drainMode();
+        isFlushPending = queue->popPendingFlush();
+        work = queue->pop_front();
+        hasQueuedWork = !queue->empty();
+    }
+    if (isFlushPending) {
+        DDD("processing pending flush");
+        c2_status_t err = onFlush_sm();
+        if (err != C2_OK) {
+            ALOGD("flush err: %d", err);
+            // TODO: error
+        }
+    }
+
+    if (!mOutputBlockPool) {
+        c2_status_t err = [this] {
+            // TODO: don't use query_vb
+            C2StreamBufferTypeSetting::output outputFormat(0u);
+            std::vector<std::unique_ptr<C2Param>> params;
+            c2_status_t err = intf()->query_vb(
+                {&outputFormat}, {C2PortBlockPoolsTuning::output::PARAM_TYPE},
+                C2_DONT_BLOCK, &params);
+            if (err != C2_OK && err != C2_BAD_INDEX) {
+                ALOGD("query err = %d", err);
+                return err;
+            }
+            C2BlockPool::local_id_t poolId =
+                outputFormat.value == C2BufferData::GRAPHIC
+                    ? C2BlockPool::BASIC_GRAPHIC
+                    : C2BlockPool::BASIC_LINEAR;
+            if (params.size()) {
+                C2PortBlockPoolsTuning::output *outputPools =
+                    C2PortBlockPoolsTuning::output::From(params[0].get());
+                if (outputPools && outputPools->flexCount() >= 1) {
+                    poolId = outputPools->m.values[0];
+                }
+            }
+
+            std::shared_ptr<C2BlockPool> blockPool;
+            err = GetCodec2BlockPool(poolId, shared_from_this(), &blockPool);
+            ALOGD("Using output block pool with poolID %llu => got %llu - %d",
+                  (unsigned long long)poolId,
+                  (unsigned long long)(blockPool ? blockPool->getLocalId()
+                                                 : 111000111),
+                  err);
+            if (err == C2_OK) {
+                mOutputBlockPool =
+                    std::make_shared<BlockingBlockPool>(blockPool);
+            }
+            return err;
+        }();
+        if (err != C2_OK) {
+            Mutexed<ExecState>::Locked state(mExecState);
+            std::shared_ptr<C2Component::Listener> listener = state->mListener;
+            state.unlock();
+            listener->onError_nb(shared_from_this(), err);
+            return hasQueuedWork;
+        }
+    }
+
+    if (!work) {
+        c2_status_t err = drain(drainMode, mOutputBlockPool);
+        if (err != C2_OK) {
+            Mutexed<ExecState>::Locked state(mExecState);
+            std::shared_ptr<C2Component::Listener> listener = state->mListener;
+            state.unlock();
+            listener->onError_nb(shared_from_this(), err);
+        }
+        return hasQueuedWork;
+    }
+
+    {
+        std::vector<C2Param *> updates;
+        for (const std::unique_ptr<C2Param> &param : work->input.configUpdate) {
+            if (param) {
+                updates.emplace_back(param.get());
+            }
+        }
+        if (!updates.empty()) {
+            std::vector<std::unique_ptr<C2SettingResult>> failures;
+            c2_status_t err =
+                intf()->config_vb(updates, C2_MAY_BLOCK, &failures);
+            ALOGD("applied %zu configUpdates => %s (%d)", updates.size(),
+                  asString(err), err);
+        }
+    }
+
+    DDD("start processing frame #%" PRIu64,
+        work->input.ordinal.frameIndex.peeku());
+    // If input buffer list is not empty, it means we have some input to process
+    // on. However, input could be a null buffer. In such case, clear the buffer
+    // list before making call to process().
+    if (!work->input.buffers.empty() && !work->input.buffers[0]) {
+        ALOGD("Encountered null input buffer. Clearing the input buffer");
+        work->input.buffers.clear();
+    }
+    process(work, mOutputBlockPool);
+    DDD("processed frame #%" PRIu64, work->input.ordinal.frameIndex.peeku());
+    Mutexed<WorkQueue>::Locked queue(mWorkQueue);
+    if (queue->generation() != generation) {
+        ALOGD("work form old generation: was %" PRIu64 " now %" PRIu64,
+              queue->generation(), generation);
+        work->result = C2_NOT_FOUND;
+        queue.unlock();
+
+        Mutexed<ExecState>::Locked state(mExecState);
+        std::shared_ptr<C2Component::Listener> listener = state->mListener;
+        state.unlock();
+        listener->onWorkDone_nb(shared_from_this(), vec(work));
+        return hasQueuedWork;
+    }
+    if (work->workletsProcessed != 0u) {
+        queue.unlock();
+        Mutexed<ExecState>::Locked state(mExecState);
+        DDD("returning this work");
+        std::shared_ptr<C2Component::Listener> listener = state->mListener;
+        state.unlock();
+        listener->onWorkDone_nb(shared_from_this(), vec(work));
+    } else {
+        work->input.buffers.clear();
+        std::unique_ptr<C2Work> unexpected;
+
+        uint64_t frameIndex = work->input.ordinal.frameIndex.peeku();
+        DDD("queue pending work %" PRIu64, frameIndex);
+        if (queue->pending().count(frameIndex) != 0) {
+            unexpected = std::move(queue->pending().at(frameIndex));
+            queue->pending().erase(frameIndex);
+        }
+        (void)queue->pending().insert({frameIndex, std::move(work)});
+
+        queue.unlock();
+        if (unexpected) {
+            ALOGD("unexpected pending work");
+            unexpected->result = C2_CORRUPTED;
+            Mutexed<ExecState>::Locked state(mExecState);
+            std::shared_ptr<C2Component::Listener> listener = state->mListener;
+            state.unlock();
+            listener->onWorkDone_nb(shared_from_this(), vec(unexpected));
+        }
+    }
+    return hasQueuedWork;
+}
+
+std::shared_ptr<C2Buffer> SimpleC2Component::createLinearBuffer(
+    const std::shared_ptr<C2LinearBlock> &block) {
+    return createLinearBuffer(block, block->offset(), block->size());
+}
+
+std::shared_ptr<C2Buffer> SimpleC2Component::createLinearBuffer(
+    const std::shared_ptr<C2LinearBlock> &block, size_t offset, size_t size) {
+    return C2Buffer::CreateLinearBuffer(
+        block->share(offset, size, ::C2Fence()));
+}
+
+std::shared_ptr<C2Buffer> SimpleC2Component::createGraphicBuffer(
+    const std::shared_ptr<C2GraphicBlock> &block) {
+    return createGraphicBuffer(block, C2Rect(block->width(), block->height()));
+}
+
+std::shared_ptr<C2Buffer> SimpleC2Component::createGraphicBuffer(
+    const std::shared_ptr<C2GraphicBlock> &block, const C2Rect &crop) {
+    return C2Buffer::CreateGraphicBuffer(block->share(crop, ::C2Fence()));
+}
+
+} // namespace android
diff --git a/system/codecs/c2/decoders/base/SimpleC2Interface.cpp b/system/codecs/c2/decoders/base/SimpleC2Interface.cpp
new file mode 100644
index 0000000..5e18da9
--- /dev/null
+++ b/system/codecs/c2/decoders/base/SimpleC2Interface.cpp
@@ -0,0 +1,349 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "SimpleC2Interface"
+#include <utils/Log.h>
+
+// use MediaDefs here vs. MediaCodecConstants as this is not MediaCodec
+// specific/dependent
+#include <media/stagefright/foundation/MediaDefs.h>
+
+#include <C2PlatformSupport.h>
+#include <SimpleC2Interface.h>
+
+namespace android {
+
+/* SimpleInterface */
+
+static C2R SubscribedParamIndicesSetter(
+        bool mayBlock, C2InterfaceHelper::C2P<C2SubscribedParamIndicesTuning> &me) {
+    (void)mayBlock;
+    (void)me;
+
+    return C2R::Ok();
+}
+
+SimpleInterface<void>::BaseParams::BaseParams(
+    const std::shared_ptr<C2ReflectorHelper> &reflector, C2String name,
+    C2Component::kind_t kind, C2Component::domain_t domain, C2String mediaType,
+    std::vector<C2String> aliases)
+    : C2InterfaceHelper(reflector) {
+    setDerivedInstance(this);
+
+    /*
+    addParameter(
+        DefineParam(mApiFeatures, C2_PARAMKEY_API_FEATURES)
+            .withConstValue(new C2ApiFeaturesSetting(C2Config::api_feature_t(
+                API_REFLECTION | API_VALUES | API_CURRENT_VALUES |
+                API_DEPENDENCY | API_SAME_INPUT_BUFFER)))
+            .build());
+*/
+
+    addParameter(DefineParam(mName, C2_PARAMKEY_COMPONENT_NAME)
+                     .withConstValue(AllocSharedString<C2ComponentNameSetting>(
+                         name.c_str()))
+                     .build());
+
+    if (aliases.size()) {
+        C2String joined;
+        for (const C2String &alias : aliases) {
+            if (joined.length()) {
+                joined += ",";
+            }
+            joined += alias;
+        }
+        addParameter(
+            DefineParam(mAliases, C2_PARAMKEY_COMPONENT_ALIASES)
+                .withConstValue(AllocSharedString<C2ComponentAliasesSetting>(
+                    joined.c_str()))
+                .build());
+    }
+
+    addParameter(DefineParam(mKind, C2_PARAMKEY_COMPONENT_KIND)
+                     .withConstValue(new C2ComponentKindSetting(kind))
+                     .build());
+
+    addParameter(DefineParam(mDomain, C2_PARAMKEY_COMPONENT_DOMAIN)
+                     .withConstValue(new C2ComponentDomainSetting(domain))
+                     .build());
+
+    // simple interfaces have single streams
+    addParameter(DefineParam(mInputStreamCount, C2_PARAMKEY_INPUT_STREAM_COUNT)
+                     .withConstValue(new C2PortStreamCountTuning::input(1))
+                     .build());
+
+    addParameter(
+        DefineParam(mOutputStreamCount, C2_PARAMKEY_OUTPUT_STREAM_COUNT)
+            .withConstValue(new C2PortStreamCountTuning::output(1))
+            .build());
+
+    // set up buffer formats and allocators
+
+    // default to linear buffers and no media type
+    C2BufferData::type_t rawBufferType = C2BufferData::LINEAR;
+    C2String rawMediaType;
+    C2Allocator::id_t rawAllocator = C2AllocatorStore::DEFAULT_LINEAR;
+    C2BlockPool::local_id_t rawPoolId = C2BlockPool::BASIC_LINEAR;
+    C2BufferData::type_t codedBufferType = C2BufferData::LINEAR;
+    int poolMask = GetCodec2PoolMask();
+    C2Allocator::id_t preferredLinearId =
+        GetPreferredLinearAllocatorId(poolMask);
+    C2Allocator::id_t codedAllocator = preferredLinearId;
+    C2BlockPool::local_id_t codedPoolId = C2BlockPool::BASIC_LINEAR;
+
+    switch (domain) {
+    case C2Component::DOMAIN_IMAGE:
+        [[fallthrough]];
+    case C2Component::DOMAIN_VIDEO:
+        // TODO: should we define raw image? The only difference is timestamp
+        // handling
+        rawBufferType = C2BufferData::GRAPHIC;
+        rawMediaType = MEDIA_MIMETYPE_VIDEO_RAW;
+        rawAllocator = C2PlatformAllocatorStore::GRALLOC;
+        rawPoolId = C2BlockPool::BASIC_GRAPHIC;
+        break;
+    case C2Component::DOMAIN_AUDIO:
+        rawBufferType = C2BufferData::LINEAR;
+        rawMediaType = MEDIA_MIMETYPE_AUDIO_RAW;
+        rawAllocator = preferredLinearId;
+        rawPoolId = C2BlockPool::BASIC_LINEAR;
+        break;
+    default:
+        break;
+    }
+    bool isEncoder = kind == C2Component::KIND_ENCODER;
+
+    // handle raw decoders
+    if (mediaType == rawMediaType) {
+        codedBufferType = rawBufferType;
+        codedAllocator = rawAllocator;
+        codedPoolId = rawPoolId;
+    }
+
+    addParameter(DefineParam(mInputFormat, C2_PARAMKEY_INPUT_STREAM_BUFFER_TYPE)
+                     .withConstValue(new C2StreamBufferTypeSetting::input(
+                         0u, isEncoder ? rawBufferType : codedBufferType))
+                     .build());
+
+    addParameter(
+        DefineParam(mInputMediaType, C2_PARAMKEY_INPUT_MEDIA_TYPE)
+            .withConstValue(AllocSharedString<C2PortMediaTypeSetting::input>(
+                isEncoder ? rawMediaType : mediaType))
+            .build());
+
+    addParameter(
+        DefineParam(mOutputFormat, C2_PARAMKEY_OUTPUT_STREAM_BUFFER_TYPE)
+            .withConstValue(new C2StreamBufferTypeSetting::output(
+                0u, isEncoder ? codedBufferType : rawBufferType))
+            .build());
+
+    addParameter(
+        DefineParam(mOutputMediaType, C2_PARAMKEY_OUTPUT_MEDIA_TYPE)
+            .withConstValue(AllocSharedString<C2PortMediaTypeSetting::output>(
+                isEncoder ? mediaType : rawMediaType))
+            .build());
+
+    C2Allocator::id_t inputAllocators[1] = {isEncoder ? rawAllocator
+                                                      : codedAllocator};
+    C2Allocator::id_t outputAllocators[1] = {isEncoder ? codedAllocator
+                                                       : rawAllocator};
+    C2BlockPool::local_id_t outputPoolIds[1] = {isEncoder ? codedPoolId
+                                                          : rawPoolId};
+
+    addParameter(
+        DefineParam(mInputAllocators, C2_PARAMKEY_INPUT_ALLOCATORS)
+            .withDefault(
+                C2PortAllocatorsTuning::input::AllocShared(inputAllocators))
+            .withFields({C2F(mInputAllocators, m.values[0]).any(),
+                         C2F(mInputAllocators, m.values).inRange(0, 1)})
+            .withSetter(
+                Setter<
+                    C2PortAllocatorsTuning::input>::NonStrictValuesWithNoDeps)
+            .build());
+
+    addParameter(
+        DefineParam(mOutputAllocators, C2_PARAMKEY_OUTPUT_ALLOCATORS)
+            .withDefault(
+                C2PortAllocatorsTuning::output::AllocShared(outputAllocators))
+            .withFields({C2F(mOutputAllocators, m.values[0]).any(),
+                         C2F(mOutputAllocators, m.values).inRange(0, 1)})
+            .withSetter(
+                Setter<
+                    C2PortAllocatorsTuning::output>::NonStrictValuesWithNoDeps)
+            .build());
+
+    addParameter(
+        DefineParam(mOutputPoolIds, C2_PARAMKEY_OUTPUT_BLOCK_POOLS)
+            .withDefault(
+                C2PortBlockPoolsTuning::output::AllocShared(outputPoolIds))
+            .withFields({C2F(mOutputPoolIds, m.values[0]).any(),
+                         C2F(mOutputPoolIds, m.values).inRange(0, 1)})
+            .withSetter(
+                Setter<
+                    C2PortBlockPoolsTuning::output>::NonStrictValuesWithNoDeps)
+            .build());
+
+    // add stateless params
+    addParameter(
+        DefineParam(mSubscribedParamIndices,
+                    C2_PARAMKEY_SUBSCRIBED_PARAM_INDICES)
+            .withDefault(C2SubscribedParamIndicesTuning::AllocShared(0u))
+            .withFields({C2F(mSubscribedParamIndices, m.values[0]).any(),
+                         C2F(mSubscribedParamIndices, m.values).any()})
+            .withSetter(SubscribedParamIndicesSetter)
+            .build());
+
+    /* TODO
+
+    addParameter(
+            DefineParam(mCurrentWorkOrdinal, C2_PARAMKEY_CURRENT_WORK)
+            .withDefault(new C2CurrentWorkTuning())
+            .withFields({ C2F(mCurrentWorkOrdinal, m.timeStamp).any(),
+                          C2F(mCurrentWorkOrdinal, m.frameIndex).any(),
+                          C2F(mCurrentWorkOrdinal, m.customOrdinal).any() })
+            .withSetter(Setter<C2CurrentWorkTuning>::NonStrictValuesWithNoDeps)
+            .build());
+
+    addParameter(
+            DefineParam(mLastInputQueuedWorkOrdinal,
+    C2_PARAMKEY_LAST_INPUT_QUEUED) .withDefault(new
+    C2LastWorkQueuedTuning::input()) .withFields({
+    C2F(mLastInputQueuedWorkOrdinal, m.timeStamp).any(),
+                          C2F(mLastInputQueuedWorkOrdinal, m.frameIndex).any(),
+                          C2F(mLastInputQueuedWorkOrdinal,
+    m.customOrdinal).any() })
+            .withSetter(Setter<C2LastWorkQueuedTuning::input>::NonStrictValuesWithNoDeps)
+            .build());
+
+    addParameter(
+            DefineParam(mLastOutputQueuedWorkOrdinal,
+    C2_PARAMKEY_LAST_OUTPUT_QUEUED) .withDefault(new
+    C2LastWorkQueuedTuning::output()) .withFields({
+    C2F(mLastOutputQueuedWorkOrdinal, m.timeStamp).any(),
+                          C2F(mLastOutputQueuedWorkOrdinal, m.frameIndex).any(),
+                          C2F(mLastOutputQueuedWorkOrdinal,
+    m.customOrdinal).any() })
+            .withSetter(Setter<C2LastWorkQueuedTuning::output>::NonStrictValuesWithNoDeps)
+            .build());
+
+    std::shared_ptr<C2OutOfMemoryTuning> mOutOfMemory;
+
+    std::shared_ptr<C2PortConfigCounterTuning::input> mInputConfigCounter;
+    std::shared_ptr<C2PortConfigCounterTuning::output> mOutputConfigCounter;
+    std::shared_ptr<C2ConfigCounterTuning> mDirectConfigCounter;
+
+    */
+}
+
+void SimpleInterface<void>::BaseParams::noInputLatency() {
+    addParameter(
+        DefineParam(mRequestedInputDelay, C2_PARAMKEY_INPUT_DELAY_REQUEST)
+            .withConstValue(new C2PortRequestedDelayTuning::input(0u))
+            .build());
+
+    addParameter(DefineParam(mActualInputDelay, C2_PARAMKEY_INPUT_DELAY)
+                     .withConstValue(new C2PortActualDelayTuning::input(0u))
+                     .build());
+}
+
+void SimpleInterface<void>::BaseParams::noOutputLatency() {
+    addParameter(
+        DefineParam(mRequestedOutputDelay, C2_PARAMKEY_OUTPUT_DELAY_REQUEST)
+            .withConstValue(new C2PortRequestedDelayTuning::output(0u))
+            .build());
+
+    addParameter(DefineParam(mActualOutputDelay, C2_PARAMKEY_OUTPUT_DELAY)
+                     .withConstValue(new C2PortActualDelayTuning::output(0u))
+                     .build());
+}
+
+void SimpleInterface<void>::BaseParams::noPipelineLatency() {
+    addParameter(
+        DefineParam(mRequestedPipelineDelay, C2_PARAMKEY_PIPELINE_DELAY_REQUEST)
+            .withConstValue(new C2RequestedPipelineDelayTuning(0u))
+            .build());
+
+    addParameter(DefineParam(mActualPipelineDelay, C2_PARAMKEY_PIPELINE_DELAY)
+                     .withConstValue(new C2ActualPipelineDelayTuning(0u))
+                     .build());
+}
+
+void SimpleInterface<void>::BaseParams::noPrivateBuffers() {
+    addParameter(DefineParam(mPrivateAllocators, C2_PARAMKEY_PRIVATE_ALLOCATORS)
+                     .withConstValue(C2PrivateAllocatorsTuning::AllocShared(0u))
+                     .build());
+
+    addParameter(
+        DefineParam(mMaxPrivateBufferCount,
+                    C2_PARAMKEY_MAX_PRIVATE_BUFFER_COUNT)
+            .withConstValue(C2MaxPrivateBufferCountTuning::AllocShared(0u))
+            .build());
+
+    addParameter(DefineParam(mPrivatePoolIds, C2_PARAMKEY_PRIVATE_BLOCK_POOLS)
+                     .withConstValue(C2PrivateBlockPoolsTuning::AllocShared(0u))
+                     .build());
+}
+
+void SimpleInterface<void>::BaseParams::noInputReferences() {
+    addParameter(
+        DefineParam(mMaxInputReferenceAge, C2_PARAMKEY_INPUT_MAX_REFERENCE_AGE)
+            .withConstValue(new C2StreamMaxReferenceAgeTuning::input(0u))
+            .build());
+
+    addParameter(
+        DefineParam(mMaxInputReferenceCount,
+                    C2_PARAMKEY_INPUT_MAX_REFERENCE_COUNT)
+            .withConstValue(new C2StreamMaxReferenceCountTuning::input(0u))
+            .build());
+}
+
+void SimpleInterface<void>::BaseParams::noOutputReferences() {
+    addParameter(
+        DefineParam(mMaxOutputReferenceAge,
+                    C2_PARAMKEY_OUTPUT_MAX_REFERENCE_AGE)
+            .withConstValue(new C2StreamMaxReferenceAgeTuning::output(0u))
+            .build());
+
+    addParameter(
+        DefineParam(mMaxOutputReferenceCount,
+                    C2_PARAMKEY_OUTPUT_MAX_REFERENCE_COUNT)
+            .withConstValue(new C2StreamMaxReferenceCountTuning::output(0u))
+            .build());
+}
+
+void SimpleInterface<void>::BaseParams::noTimeStretch() {
+    addParameter(DefineParam(mTimeStretch, C2_PARAMKEY_TIME_STRETCH)
+                     .withConstValue(new C2ComponentTimeStretchTuning(1.f))
+                     .build());
+}
+
+/*
+    Clients need to handle the following base params due to custom dependency.
+
+    std::shared_ptr<C2ApiLevelSetting> mApiLevel;
+    std::shared_ptr<C2ComponentAttributesSetting> mAttrib;
+
+    std::shared_ptr<C2PortSuggestedBufferCountTuning::input>
+   mSuggestedInputBufferCount;
+    std::shared_ptr<C2PortSuggestedBufferCountTuning::output>
+   mSuggestedOutputBufferCount;
+
+    std::shared_ptr<C2TrippedTuning> mTripped;
+
+*/
+
+} // namespace android
diff --git a/system/codecs/c2/decoders/base/color_buffer_utils.cpp b/system/codecs/c2/decoders/base/color_buffer_utils.cpp
new file mode 100644
index 0000000..a36ba32
--- /dev/null
+++ b/system/codecs/c2/decoders/base/color_buffer_utils.cpp
@@ -0,0 +1,116 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include <inttypes.h>
+#include <android-base/parseint.h>
+#include <android-base/properties.h>
+#include <android-base/strings.h>
+#include <log/log.h>
+#include <gralloc_cb_bp.h>
+#include <xf86drm.h>
+
+#include "cros_gralloc_handle.h"
+#include "virtgpu_drm.h"
+
+static bool isMinigbmFromProperty() {
+  static constexpr const auto kGrallocProp = "ro.hardware.gralloc";
+
+  const auto grallocProp = android::base::GetProperty(kGrallocProp, "");
+  ALOGD("%s:codecs: minigbm query prop value is: %s", __FUNCTION__, grallocProp.c_str());
+
+  if (grallocProp == "minigbm") {
+    ALOGD("%s:codecs: Using minigbm, in minigbm mode.\n", __FUNCTION__);
+    return true;
+  } else {
+    ALOGD("%s:codecs: Is not using minigbm, in goldfish mode.\n", __FUNCTION__);
+    return false;
+  }
+}
+
+class ColorBufferUtilsGlobalState {
+public:
+    ColorBufferUtilsGlobalState() {
+        m_isMinigbm = isMinigbmFromProperty();
+
+        if (m_isMinigbm) {
+            static constexpr int kRendernodeMinor = 128;
+            m_rendernodeFd = drmOpenRender(kRendernodeMinor);
+        }
+    }
+
+    uint32_t getColorBufferHandle(native_handle_t const* handle) {
+        if (m_isMinigbm) {
+            struct drm_virtgpu_resource_info info;
+            if (!getResInfo(handle, &info)) {
+                ALOGE("%s: Error gtting color buffer handle (minigbm case)", __func__);
+                return -1;
+            }
+            return info.res_handle;
+        } else {
+            return cb_handle_t::from(handle)->hostHandle;
+        }
+    }
+
+private:
+
+    bool getResInfo(native_handle_t const* handle,
+                    struct drm_virtgpu_resource_info* info) {
+        memset(info, 0x0, sizeof(*info));
+        if (m_rendernodeFd < 0) {
+            ALOGE("%s: Error, rendernode fd missing\n", __func__);
+            return false;
+        }
+
+        struct drm_gem_close gem_close;
+        memset(&gem_close, 0x0, sizeof(gem_close));
+
+        cros_gralloc_handle const* cros_handle =
+            reinterpret_cast<cros_gralloc_handle const*>(handle);
+
+        uint32_t prime_handle;
+        int ret = drmPrimeFDToHandle(m_rendernodeFd, cros_handle->fds[0], &prime_handle);
+        if (ret) {
+            ALOGE("%s: DRM_IOCTL_PRIME_FD_TO_HANDLE failed: %s (errno %d)\n",
+                  __func__, strerror(errno), errno);
+            return false;
+        }
+
+        info->bo_handle = prime_handle;
+        gem_close.handle = prime_handle;
+
+        ret = drmIoctl(m_rendernodeFd, DRM_IOCTL_VIRTGPU_RESOURCE_INFO, info);
+        if (ret) {
+            ALOGE("%s: DRM_IOCTL_VIRTGPU_RESOURCE_INFO failed: %s (errno %d)\n",
+                  __func__, strerror(errno), errno);
+            drmIoctl(m_rendernodeFd, DRM_IOCTL_GEM_CLOSE, &gem_close);
+            return false;
+        }
+
+        drmIoctl(m_rendernodeFd, DRM_IOCTL_GEM_CLOSE, &gem_close);
+        return true;
+    }
+
+    bool m_isMinigbm;
+    int m_rendernodeFd = -1; // to be closed when this process dies
+};
+
+static ColorBufferUtilsGlobalState* getGlobals() {
+    static ColorBufferUtilsGlobalState* globals = new ColorBufferUtilsGlobalState;
+    return globals;
+}
+
+uint32_t getColorBufferHandle(native_handle_t const* handle) {
+    return getGlobals()->getColorBufferHandle(handle);
+}
diff --git a/system/codecs/c2/decoders/base/cros_gralloc_handle.h b/system/codecs/c2/decoders/base/cros_gralloc_handle.h
new file mode 100644
index 0000000..2b70d4b
--- /dev/null
+++ b/system/codecs/c2/decoders/base/cros_gralloc_handle.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2016 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef CROS_GRALLOC_HANDLE_H
+#define CROS_GRALLOC_HANDLE_H
+
+#include <cstdint>
+#include <cutils/native_handle.h>
+
+#define DRV_MAX_PLANES 4
+#define DRV_MAX_FDS (DRV_MAX_PLANES + 1)
+
+struct cros_gralloc_handle : public native_handle_t {
+	/*
+	 * File descriptors must immediately follow the native_handle_t base and used file
+	 * descriptors must be packed at the beginning of this array to work with
+	 * native_handle_clone().
+	 *
+	 * This field contains 'num_planes' plane file descriptors followed by an optional metadata
+	 * reserved region file descriptor if 'reserved_region_size' is greater than zero.
+	 */
+	int32_t fds[DRV_MAX_FDS];
+	uint32_t strides[DRV_MAX_PLANES];
+	uint32_t offsets[DRV_MAX_PLANES];
+	uint32_t sizes[DRV_MAX_PLANES];
+	uint32_t id;
+	uint32_t width;
+	uint32_t height;
+	uint32_t format; /* DRM format */
+	uint32_t tiling;
+	uint64_t format_modifier;
+	uint64_t use_flags; /* Buffer creation flags */
+	uint32_t magic;
+	uint32_t pixel_stride;
+	int32_t droid_format;
+	int32_t usage; /* Android usage. */
+	uint32_t num_planes;
+	uint64_t reserved_region_size;
+	uint64_t total_size; /* Total allocation size */
+	/*
+	 * Name is a null terminated char array located at handle->base.data[handle->name_offset].
+	 */
+	uint32_t name_offset;
+} __attribute__((packed));
+
+typedef const struct cros_gralloc_handle *cros_gralloc_handle_t;
+
+#endif
diff --git a/system/codecs/c2/decoders/base/exports.lds b/system/codecs/c2/decoders/base/exports.lds
new file mode 100644
index 0000000..641bae8
--- /dev/null
+++ b/system/codecs/c2/decoders/base/exports.lds
@@ -0,0 +1,7 @@
+{
+    global:
+        CreateCodec2Factory;
+        DestroyCodec2Factory;
+    local: *;
+};
+
diff --git a/system/codecs/c2/decoders/base/goldfish_media_utils.cpp b/system/codecs/c2/decoders/base/goldfish_media_utils.cpp
new file mode 100644
index 0000000..8013fe0
--- /dev/null
+++ b/system/codecs/c2/decoders/base/goldfish_media_utils.cpp
@@ -0,0 +1,227 @@
+// Copyright 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "goldfish_media_utils.h"
+
+#include "goldfish_address_space.h"
+
+#include <log/log.h>
+
+#define DEBUG 0
+#if DEBUG
+#define DDD(...) ALOGD(__VA_ARGS__)
+#else
+#define DDD(...) ((void)0)
+#endif
+
+#include <memory>
+#include <mutex>
+#include <vector>
+
+std::mutex sSingletonMutex;
+std::unique_ptr<GoldfishMediaTransport> sTransport;
+
+class GoldfishMediaTransportImpl : public GoldfishMediaTransport {
+  public:
+    GoldfishMediaTransportImpl();
+    ~GoldfishMediaTransportImpl();
+
+    virtual void writeParam(__u64 val, unsigned int num,
+                            unsigned int offSetToStartAddr = 0) override;
+    virtual bool sendOperation(MediaCodecType type, MediaOperation op,
+                               unsigned int offSetToStartAddr = 0) override;
+    virtual uint8_t *getBaseAddr() const override;
+    virtual uint8_t *getInputAddr(unsigned int offSet = 0) const override;
+    virtual uint8_t *getOutputAddr() const override;
+    virtual uint8_t *getReturnAddr(unsigned int offSet = 0) const override;
+    virtual __u64 offsetOf(uint64_t addr) const override;
+
+  public:
+    // each lot has 2 M
+    virtual int getMemorySlot() override {
+        std::lock_guard<std::mutex> g{mMemoryMutex};
+        // when there are just 1 decoder, it can pretty
+        // much use all the memory starting from 0;
+        // when there are two, each can use at least half
+        // the total memory, etc.
+        constexpr size_t search_order[] = {
+            0,                              // use 32M
+            16,                             // use 16M
+            8,  24,                         // use 8M
+            4,  12, 20, 28,                 // use 4M
+            2,  6,  10, 12, 18, 22, 26, 30, // use 2M
+            1,  3,  5,  7,  9,  11, 13, 15,
+            17, 19, 21, 23, 25, 27, 29, 31 // use 1M
+        };
+        for (size_t i = 0; i < sizeof(search_order) / sizeof(search_order[0]);
+             ++i) {
+            int slot = search_order[i];
+            if (mMemoryLotsAvailable[slot]) {
+                mMemoryLotsAvailable[slot] = false;
+                return slot;
+            }
+        }
+        return -1;
+    }
+    virtual void returnMemorySlot(int lot) override {
+        if (lot < 0 || lot >= mMemoryLotsAvailable.size()) {
+            return;
+        }
+        std::lock_guard<std::mutex> g{mMemoryMutex};
+        if (mMemoryLotsAvailable[lot] == false) {
+            mMemoryLotsAvailable[lot] = true;
+        } else {
+            ALOGE("Error, cannot twice");
+        }
+    }
+
+  private:
+    std::mutex mMemoryMutex;
+    std::vector<bool> mMemoryLotsAvailable = std::vector<bool>(32, true);
+
+    address_space_handle_t mHandle;
+    uint64_t mOffset;
+    uint64_t mPhysAddr;
+    uint64_t mSize;
+    void *mStartPtr = nullptr;
+
+    // MediaCodecType will be or'd together with the metadata, so the highest
+    // 8-bits will have the type.
+    static __u64 makeMetadata(MediaCodecType type, MediaOperation op,
+                              uint64_t offset);
+
+    // Chunk size for parameters/return data
+    static constexpr size_t kParamSizeBytes = 4096; // 4K
+    // Chunk size for input
+    static constexpr size_t kInputSizeBytes = 4096 * 4096; // 16M
+    // Chunk size for output
+    static constexpr size_t kOutputSizeBytes = 4096 * 4096; // 16M
+    // Maximum number of parameters that can be passed
+    static constexpr size_t kMaxParams = 32;
+    // Offset from the memory region for return data (8 is size of
+    // a parameter in bytes)
+    static constexpr size_t kReturnOffset = 8 * kMaxParams;
+};
+
+GoldfishMediaTransportImpl::~GoldfishMediaTransportImpl() {
+    if (mHandle >= 0) {
+        goldfish_address_space_close(mHandle);
+        mHandle = -1;
+    }
+}
+
+GoldfishMediaTransportImpl::GoldfishMediaTransportImpl() {
+    // Allocate host memory; the contiguous memory region will be laid out as
+    // follows:
+    // ========================================================
+    // | kParamSizeBytes | kInputSizeBytes | kOutputSizeBytes |
+    // ========================================================
+    mHandle = goldfish_address_space_open();
+    if (mHandle < 0) {
+        ALOGE("Failed to ping host to allocate memory");
+        abort();
+    }
+    mSize = kParamSizeBytes + kInputSizeBytes + kOutputSizeBytes;
+    bool success =
+        goldfish_address_space_allocate(mHandle, mSize, &mPhysAddr, &mOffset);
+    if (success) {
+        ALOGI("successfully allocated %d bytes in goldfish_address_block",
+              (int)mSize);
+        mStartPtr = goldfish_address_space_map(mHandle, mOffset, mSize);
+        ALOGI("guest address is %p", mStartPtr);
+
+        struct address_space_ping pingInfo;
+        pingInfo.metadata = GoldfishAddressSpaceSubdeviceType::Media;
+        pingInfo.offset = mOffset;
+        if (goldfish_address_space_ping(mHandle, &pingInfo) == false) {
+            ALOGE("Failed to ping host to allocate memory");
+            abort();
+            return;
+        } else {
+            ALOGI("successfully pinged host to allocate memory");
+        }
+    } else {
+        ALOGE("failed to allocate %d bytes in goldfish_address_block",
+              (int)mSize);
+        abort();
+    }
+}
+
+// static
+GoldfishMediaTransport *GoldfishMediaTransport::getInstance() {
+    std::lock_guard<std::mutex> g{sSingletonMutex};
+    if (sTransport == nullptr) {
+        sTransport.reset(new GoldfishMediaTransportImpl());
+    }
+    return sTransport.get();
+}
+
+// static
+__u64 GoldfishMediaTransportImpl::makeMetadata(MediaCodecType type,
+                                               MediaOperation op,
+                                               uint64_t offset) {
+    // Shift |type| into the highest 8-bits, leaving the lower bits for other
+    // metadata.
+    offset = offset >> 20;
+    if (offset < 0 || offset >= 32) {
+        ALOGE("offset %d is wrong", (int)offset);
+        abort();
+    }
+    return ((__u64)type << (64 - 8)) | (offset << 8) | static_cast<uint8_t>(op);
+}
+
+uint8_t *GoldfishMediaTransportImpl::getInputAddr(unsigned int offSet) const {
+    return (uint8_t *)mStartPtr + kParamSizeBytes + offSet;
+}
+
+uint8_t *GoldfishMediaTransportImpl::getOutputAddr() const {
+    return getInputAddr() + kInputSizeBytes;
+}
+
+uint8_t *GoldfishMediaTransportImpl::getBaseAddr() const {
+    return (uint8_t *)mStartPtr;
+}
+
+uint8_t *GoldfishMediaTransportImpl::getReturnAddr(unsigned int offSet) const {
+    return (uint8_t *)mStartPtr + kReturnOffset + offSet;
+}
+
+__u64 GoldfishMediaTransportImpl::offsetOf(uint64_t addr) const {
+    return addr - (uint64_t)mStartPtr;
+}
+
+void GoldfishMediaTransportImpl::writeParam(__u64 val, unsigned int num,
+                                            unsigned int offSetToStartAddr) {
+    uint8_t *p = (uint8_t *)mStartPtr + (offSetToStartAddr);
+    uint64_t *pint = (uint64_t *)(p + 8 * num);
+    *pint = val;
+}
+
+bool GoldfishMediaTransportImpl::sendOperation(MediaCodecType type,
+                                               MediaOperation op,
+                                               unsigned int offSetToStartAddr) {
+    struct address_space_ping pingInfo;
+    pingInfo.metadata = makeMetadata(type, op, offSetToStartAddr);
+    pingInfo.offset = mOffset; // + (offSetToStartAddr);
+    if (goldfish_address_space_ping(mHandle, &pingInfo) == false) {
+        ALOGE("failed to ping host");
+        abort();
+        return false;
+    } else {
+        DDD("successfully pinged host for operation type=%d, op=%d", (int)type,
+            (int)op);
+    }
+
+    return true;
+}
diff --git a/system/codecs/c2/decoders/base/include/SimpleC2Component.h b/system/codecs/c2/decoders/base/include/SimpleC2Component.h
new file mode 100644
index 0000000..2c960a7
--- /dev/null
+++ b/system/codecs/c2/decoders/base/include/SimpleC2Component.h
@@ -0,0 +1,254 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SIMPLE_C2_COMPONENT_H_
+#define SIMPLE_C2_COMPONENT_H_
+
+#include <list>
+#include <unordered_map>
+
+#include <C2Component.h>
+
+#include <media/stagefright/foundation/AHandler.h>
+#include <media/stagefright/foundation/ALooper.h>
+#include <media/stagefright/foundation/Mutexed.h>
+
+namespace android {
+
+class SimpleC2Component
+    : public C2Component,
+      public std::enable_shared_from_this<SimpleC2Component> {
+  public:
+    explicit SimpleC2Component(
+        const std::shared_ptr<C2ComponentInterface> &intf);
+    virtual ~SimpleC2Component();
+
+    // C2Component
+    // From C2Component
+    virtual c2_status_t
+    setListener_vb(const std::shared_ptr<Listener> &listener,
+                   c2_blocking_t mayBlock) override;
+    virtual c2_status_t
+    queue_nb(std::list<std::unique_ptr<C2Work>> *const items) override;
+    virtual c2_status_t
+    announce_nb(const std::vector<C2WorkOutline> &items) override;
+    virtual c2_status_t
+    flush_sm(flush_mode_t mode,
+             std::list<std::unique_ptr<C2Work>> *const flushedWork) override;
+    virtual c2_status_t drain_nb(drain_mode_t mode) override;
+    virtual c2_status_t start() override;
+    virtual c2_status_t stop() override;
+    virtual c2_status_t reset() override;
+    virtual c2_status_t release() override;
+    virtual std::shared_ptr<C2ComponentInterface> intf() override;
+
+    // for handler
+    bool processQueue();
+
+  protected:
+    /**
+     * Initialize internal states of the component according to the config set
+     * in the interface.
+     *
+     * This method is called during start(), but only at the first invocation or
+     * after reset().
+     */
+    virtual c2_status_t onInit() = 0;
+
+    /**
+     * Stop the component.
+     */
+    virtual c2_status_t onStop() = 0;
+
+    /**
+     * Reset the component.
+     */
+    virtual void onReset() = 0;
+
+    /**
+     * Release the component.
+     */
+    virtual void onRelease() = 0;
+
+    /**
+     * Flush the component.
+     */
+    virtual c2_status_t onFlush_sm() = 0;
+
+    /**
+     * Process the given work and finish pending work using finish().
+     *
+     * \param[in,out]   work    the work to process
+     * \param[in]       pool    the pool to use for allocating output blocks.
+     */
+    virtual void process(const std::unique_ptr<C2Work> &work,
+                         const std::shared_ptr<C2BlockPool> &pool) = 0;
+
+    /**
+     * Drain the component and finish pending work using finish().
+     *
+     * \param[in]   drainMode   mode of drain.
+     * \param[in]   pool        the pool to use for allocating output blocks.
+     *
+     * \retval C2_OK            The component has drained all pending output
+     *                          work.
+     * \retval C2_OMITTED       Unsupported mode (e.g. DRAIN_CHAIN)
+     */
+    virtual c2_status_t drain(uint32_t drainMode,
+                              const std::shared_ptr<C2BlockPool> &pool) = 0;
+
+    // for derived classes
+    /**
+     * Finish pending work.
+     *
+     * This method will retrieve the pending work according to |frameIndex| and
+     * feed the work into |fillWork| function. |fillWork| must be
+     * "non-blocking". Once |fillWork| returns the filled work will be returned
+     * to the client.
+     *
+     * \param[in]   frameIndex    the index of the pending work
+     * \param[in]   fillWork      the function to fill the retrieved work.
+     */
+    void finish(uint64_t frameIndex,
+                std::function<void(const std::unique_ptr<C2Work> &)> fillWork);
+
+    /**
+     * Clone pending or current work and send the work back to client.
+     *
+     * This method will retrieve and clone the pending or current work according
+     * to |frameIndex| and feed the work into |fillWork| function. |fillWork|
+     * must be "non-blocking". Once |fillWork| returns the filled work will be
+     * returned to the client.
+     *
+     * \param[in]   frameIndex    the index of the work
+     * \param[in]   currentWork   the current work under processing
+     * \param[in]   fillWork      the function to fill the retrieved work.
+     */
+    void
+    cloneAndSend(uint64_t frameIndex,
+                 const std::unique_ptr<C2Work> &currentWork,
+                 std::function<void(const std::unique_ptr<C2Work> &)> fillWork);
+
+    std::shared_ptr<C2Buffer>
+    createLinearBuffer(const std::shared_ptr<C2LinearBlock> &block);
+
+    std::shared_ptr<C2Buffer>
+    createLinearBuffer(const std::shared_ptr<C2LinearBlock> &block,
+                       size_t offset, size_t size);
+
+    std::shared_ptr<C2Buffer>
+    createGraphicBuffer(const std::shared_ptr<C2GraphicBlock> &block);
+
+    std::shared_ptr<C2Buffer>
+    createGraphicBuffer(const std::shared_ptr<C2GraphicBlock> &block,
+                        const C2Rect &crop);
+
+    static constexpr uint32_t NO_DRAIN = ~0u;
+
+    C2ReadView mDummyReadView;
+
+  private:
+    const std::shared_ptr<C2ComponentInterface> mIntf;
+
+    class WorkHandler : public AHandler {
+      public:
+        enum {
+            kWhatProcess,
+            kWhatInit,
+            kWhatStart,
+            kWhatStop,
+            kWhatReset,
+            kWhatRelease,
+        };
+
+        WorkHandler();
+        ~WorkHandler() override = default;
+
+        void setComponent(const std::shared_ptr<SimpleC2Component> &thiz);
+
+      protected:
+        void onMessageReceived(const sp<AMessage> &msg) override;
+
+      private:
+        std::weak_ptr<SimpleC2Component> mThiz;
+        bool mRunning;
+    };
+
+    enum {
+        UNINITIALIZED,
+        STOPPED,
+        RUNNING,
+    };
+
+    struct ExecState {
+        ExecState() : mState(UNINITIALIZED) {}
+
+        int mState;
+        std::shared_ptr<C2Component::Listener> mListener;
+    };
+    Mutexed<ExecState> mExecState;
+
+    sp<ALooper> mLooper;
+    sp<WorkHandler> mHandler;
+
+    class WorkQueue {
+      public:
+        typedef std::unordered_map<uint64_t, std::unique_ptr<C2Work>>
+            PendingWork;
+
+        inline WorkQueue() : mFlush(false), mGeneration(0ul) {}
+
+        inline uint64_t generation() const { return mGeneration; }
+        inline void incGeneration() {
+            ++mGeneration;
+            mFlush = true;
+        }
+
+        std::unique_ptr<C2Work> pop_front();
+        void push_back(std::unique_ptr<C2Work> work);
+        bool empty() const;
+        uint32_t drainMode() const;
+        void markDrain(uint32_t drainMode);
+        inline bool popPendingFlush() {
+            bool flush = mFlush;
+            mFlush = false;
+            return flush;
+        }
+        void clear();
+        PendingWork &pending() { return mPendingWork; }
+
+      private:
+        struct Entry {
+            std::unique_ptr<C2Work> work;
+            uint32_t drainMode;
+        };
+
+        bool mFlush;
+        uint64_t mGeneration;
+        std::list<Entry> mQueue;
+        PendingWork mPendingWork;
+    };
+    Mutexed<WorkQueue> mWorkQueue;
+
+    class BlockingBlockPool;
+    std::shared_ptr<BlockingBlockPool> mOutputBlockPool;
+
+    SimpleC2Component() = delete;
+};
+
+} // namespace android
+
+#endif // SIMPLE_C2_COMPONENT_H_
diff --git a/system/codecs/c2/decoders/base/include/SimpleC2Interface.h b/system/codecs/c2/decoders/base/include/SimpleC2Interface.h
new file mode 100644
index 0000000..5fbfa3f
--- /dev/null
+++ b/system/codecs/c2/decoders/base/include/SimpleC2Interface.h
@@ -0,0 +1,246 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_SIMPLE_C2_INTERFACE_H_
+#define ANDROID_SIMPLE_C2_INTERFACE_H_
+
+#include <C2Component.h>
+#include <C2Config.h>
+#include <util/C2InterfaceHelper.h>
+
+namespace android {
+
+/**
+ * Wrap a common interface object (such as Codec2Client::Interface, or
+ * C2InterfaceHelper into a C2ComponentInterface.
+ *
+ * \param T common interface type
+ */
+template <typename T> class SimpleC2Interface : public C2ComponentInterface {
+  public:
+    SimpleC2Interface(const char *name, c2_node_id_t id,
+                      const std::shared_ptr<T> &impl)
+        : mName(name), mId(id), mImpl(impl) {}
+
+    ~SimpleC2Interface() override = default;
+
+    // From C2ComponentInterface
+    C2String getName() const override { return mName; }
+    c2_node_id_t getId() const override { return mId; }
+    c2_status_t query_vb(const std::vector<C2Param *> &stackParams,
+                         const std::vector<C2Param::Index> &heapParamIndices,
+                         c2_blocking_t mayBlock,
+                         std::vector<std::unique_ptr<C2Param>>
+                             *const heapParams) const override {
+        return mImpl->query(stackParams, heapParamIndices, mayBlock,
+                            heapParams);
+    }
+    c2_status_t
+    config_vb(const std::vector<C2Param *> &params, c2_blocking_t mayBlock,
+              std::vector<std::unique_ptr<C2SettingResult>> *const failures)
+        override {
+        return mImpl->config(params, mayBlock, failures);
+    }
+    c2_status_t createTunnel_sm(c2_node_id_t) override { return C2_OMITTED; }
+    c2_status_t releaseTunnel_sm(c2_node_id_t) override { return C2_OMITTED; }
+    c2_status_t querySupportedParams_nb(
+        std::vector<std::shared_ptr<C2ParamDescriptor>> *const params)
+        const override {
+        return mImpl->querySupportedParams(params);
+    }
+    c2_status_t
+    querySupportedValues_vb(std::vector<C2FieldSupportedValuesQuery> &fields,
+                            c2_blocking_t mayBlock) const override {
+        return mImpl->querySupportedValues(fields, mayBlock);
+    }
+
+  private:
+    C2String mName;
+    const c2_node_id_t mId;
+    const std::shared_ptr<T> mImpl;
+};
+
+/**
+ * Utility classes for common interfaces.
+ */
+template <> class SimpleC2Interface<void> {
+  public:
+    /**
+     * Base Codec 2.0 parameters required for all components.
+     */
+    struct BaseParams : C2InterfaceHelper {
+        explicit BaseParams(
+            const std::shared_ptr<C2ReflectorHelper> &helper, C2String name,
+            C2Component::kind_t kind, C2Component::domain_t domain,
+            C2String mediaType,
+            std::vector<C2String> aliases = std::vector<C2String>());
+
+        /// Marks that this component has no input latency. Otherwise, component
+        /// must add support for C2PortRequestedDelayTuning::input and
+        /// C2PortActualDelayTuning::input.
+        void noInputLatency();
+
+        /// Marks that this component has no output latency. Otherwise,
+        /// component must add support for C2PortRequestedDelayTuning::output
+        /// and C2PortActualDelayTuning::output.
+        void noOutputLatency();
+
+        /// Marks that this component has no pipeline latency. Otherwise,
+        /// component must add support for C2RequestedPipelineDelayTuning and
+        /// C2ActualPipelineDelayTuning.
+        void noPipelineLatency();
+
+        /// Marks that this component has no need for private buffers.
+        /// Otherwise, component must add support for
+        /// C2MaxPrivateBufferCountTuning, C2PrivateAllocatorsTuning and
+        /// C2PrivateBlockPoolsTuning.
+        void noPrivateBuffers();
+
+        /// Marks that this component holds no references to input buffers.
+        /// Otherwise, component must add support for
+        /// C2StreamMaxReferenceAgeTuning::input and
+        /// C2StreamMaxReferenceCountTuning::input.
+        void noInputReferences();
+
+        /// Marks that this component holds no references to output buffers.
+        /// Otherwise, component must add support for
+        /// C2StreamMaxReferenceAgeTuning::output and
+        /// C2StreamMaxReferenceCountTuning::output.
+        void noOutputReferences();
+
+        /// Marks that this component does not stretch time. Otherwise,
+        /// component must add support for C2ComponentTimeStretchTuning.
+        void noTimeStretch();
+
+        std::shared_ptr<C2ApiLevelSetting> mApiLevel;
+        std::shared_ptr<C2ApiFeaturesSetting> mApiFeatures;
+
+        std::shared_ptr<C2PlatformLevelSetting> mPlatformLevel;
+        std::shared_ptr<C2PlatformFeaturesSetting> mPlatformFeatures;
+
+        std::shared_ptr<C2ComponentNameSetting> mName;
+        std::shared_ptr<C2ComponentAliasesSetting> mAliases;
+        std::shared_ptr<C2ComponentKindSetting> mKind;
+        std::shared_ptr<C2ComponentDomainSetting> mDomain;
+        std::shared_ptr<C2ComponentAttributesSetting> mAttrib;
+        std::shared_ptr<C2ComponentTimeStretchTuning> mTimeStretch;
+
+        std::shared_ptr<C2PortMediaTypeSetting::input> mInputMediaType;
+        std::shared_ptr<C2PortMediaTypeSetting::output> mOutputMediaType;
+        std::shared_ptr<C2StreamBufferTypeSetting::input> mInputFormat;
+        std::shared_ptr<C2StreamBufferTypeSetting::output> mOutputFormat;
+
+        std::shared_ptr<C2PortRequestedDelayTuning::input> mRequestedInputDelay;
+        std::shared_ptr<C2PortRequestedDelayTuning::output>
+            mRequestedOutputDelay;
+        std::shared_ptr<C2RequestedPipelineDelayTuning> mRequestedPipelineDelay;
+
+        std::shared_ptr<C2PortActualDelayTuning::input> mActualInputDelay;
+        std::shared_ptr<C2PortActualDelayTuning::output> mActualOutputDelay;
+        std::shared_ptr<C2ActualPipelineDelayTuning> mActualPipelineDelay;
+
+        std::shared_ptr<C2StreamMaxReferenceAgeTuning::input>
+            mMaxInputReferenceAge;
+        std::shared_ptr<C2StreamMaxReferenceCountTuning::input>
+            mMaxInputReferenceCount;
+        std::shared_ptr<C2StreamMaxReferenceAgeTuning::output>
+            mMaxOutputReferenceAge;
+        std::shared_ptr<C2StreamMaxReferenceCountTuning::output>
+            mMaxOutputReferenceCount;
+        std::shared_ptr<C2MaxPrivateBufferCountTuning> mMaxPrivateBufferCount;
+
+        std::shared_ptr<C2PortStreamCountTuning::input> mInputStreamCount;
+        std::shared_ptr<C2PortStreamCountTuning::output> mOutputStreamCount;
+
+        std::shared_ptr<C2SubscribedParamIndicesTuning> mSubscribedParamIndices;
+        std::shared_ptr<C2PortSuggestedBufferCountTuning::input>
+            mSuggestedInputBufferCount;
+        std::shared_ptr<C2PortSuggestedBufferCountTuning::output>
+            mSuggestedOutputBufferCount;
+
+        std::shared_ptr<C2CurrentWorkTuning> mCurrentWorkOrdinal;
+        std::shared_ptr<C2LastWorkQueuedTuning::input>
+            mLastInputQueuedWorkOrdinal;
+        std::shared_ptr<C2LastWorkQueuedTuning::output>
+            mLastOutputQueuedWorkOrdinal;
+
+        std::shared_ptr<C2PortAllocatorsTuning::input> mInputAllocators;
+        std::shared_ptr<C2PortAllocatorsTuning::output> mOutputAllocators;
+        std::shared_ptr<C2PrivateAllocatorsTuning> mPrivateAllocators;
+        std::shared_ptr<C2PortBlockPoolsTuning::output> mOutputPoolIds;
+        std::shared_ptr<C2PrivateBlockPoolsTuning> mPrivatePoolIds;
+
+        std::shared_ptr<C2TrippedTuning> mTripped;
+        std::shared_ptr<C2OutOfMemoryTuning> mOutOfMemory;
+
+        std::shared_ptr<C2PortConfigCounterTuning::input> mInputConfigCounter;
+        std::shared_ptr<C2PortConfigCounterTuning::output> mOutputConfigCounter;
+        std::shared_ptr<C2ConfigCounterTuning> mDirectConfigCounter;
+    };
+};
+
+template <typename T> using SimpleInterface = SimpleC2Interface<T>;
+
+template <typename T, typename... Args>
+std::shared_ptr<T> AllocSharedString(const Args(&...args), const char *str) {
+    size_t len = strlen(str) + 1;
+    std::shared_ptr<T> ret = T::AllocShared(len, args...);
+    strcpy(ret->m.value, str);
+    return ret;
+}
+
+template <typename T, typename... Args>
+std::shared_ptr<T> AllocSharedString(const Args(&...args),
+                                     const std::string &str) {
+    std::shared_ptr<T> ret = T::AllocShared(str.length() + 1, args...);
+    strcpy(ret->m.value, str.c_str());
+    return ret;
+}
+
+template <typename T> struct Setter {
+    typedef typename std::remove_reference<T>::type type;
+
+    static C2R NonStrictValueWithNoDeps(bool mayBlock,
+                                        C2InterfaceHelper::C2P<type> &me) {
+        (void)mayBlock;
+        return me.F(me.v.value).validatePossible(me.v.value);
+    }
+
+    static C2R NonStrictValuesWithNoDeps(bool mayBlock,
+                                         C2InterfaceHelper::C2P<type> &me) {
+        (void)mayBlock;
+        C2R res = C2R::Ok();
+        for (size_t ix = 0; ix < me.v.flexCount(); ++ix) {
+            res.plus(
+                me.F(me.v.m.values[ix]).validatePossible(me.v.m.values[ix]));
+        }
+        return res;
+    }
+
+    static C2R StrictValueWithNoDeps(bool mayBlock,
+                                     const C2InterfaceHelper::C2P<type> &old,
+                                     C2InterfaceHelper::C2P<type> &me) {
+        (void)mayBlock;
+        if (!me.F(me.v.value).supportsNow(me.v.value)) {
+            me.set().value = old.v.value;
+        }
+        return me.F(me.v.value).validatePossible(me.v.value);
+    }
+};
+
+} // namespace android
+
+#endif // ANDROID_SIMPLE_C2_INTERFACE_H_
diff --git a/system/codecs/c2/decoders/base/include/color_buffer_utils.h b/system/codecs/c2/decoders/base/include/color_buffer_utils.h
new file mode 100644
index 0000000..d0a7876
--- /dev/null
+++ b/system/codecs/c2/decoders/base/include/color_buffer_utils.h
@@ -0,0 +1,18 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include <cutils/native_handle.h>
+
+uint32_t getColorBufferHandle(native_handle_t const* handle);
diff --git a/system/codecs/c2/decoders/base/include/goldfish_media_utils.h b/system/codecs/c2/decoders/base/include/goldfish_media_utils.h
new file mode 100644
index 0000000..a45cda9
--- /dev/null
+++ b/system/codecs/c2/decoders/base/include/goldfish_media_utils.h
@@ -0,0 +1,110 @@
+// Copyright 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <linux/types.h>
+#include <stdint.h>
+
+#ifndef GOLDFISH_COMMON_GOLDFISH_DEFS_H
+#define GOLDFISH_COMMON_GOLDFISH_DEFS_H
+
+enum class MediaCodecType : __u8 {
+    VP8Codec = 0,
+    VP9Codec = 1,
+    H264Codec = 2,
+    HevcCodec = 3,
+    Max = 4,
+};
+
+struct MetaDataColorAspects {
+    uint64_t type = 1;
+    uint64_t primaries;
+    uint64_t range;
+    uint64_t transfer;
+};
+
+enum class MediaOperation : __u8 {
+    InitContext = 0,
+    DestroyContext = 1,
+    DecodeImage = 2,
+    GetImage = 3,
+    Flush = 4,
+    Reset = 5,
+    SendMetadata = 6,
+    Max = 7,
+};
+
+// This class will abstract away the knowledge required to send media codec data
+// to the host. The implementation should only need the following information to
+// properly send the data:
+//   1) Which codec to use (MediaCodecType)
+//   2) What operation to perform (MediaOperation)
+//
+// Example:
+//   auto transport = GoldfishMediaTransport::getInstance();
+//
+class GoldfishMediaTransport {
+  protected:
+    GoldfishMediaTransport() {}
+
+  public:
+    virtual ~GoldfishMediaTransport() {}
+
+    // Writes a parameter to send to the host. Each parameter will take up
+    // 64-bits. |val| is the value of the parameter, and |num| is the parameter
+    // number, starting from 0. If |val| is an address, wrap it around
+    // offsetOf(), e.g., writeParam(offsetOf((uint64_t)ptr), 2);
+    virtual void writeParam(__u64 val, unsigned int num,
+                            unsigned int offSetToStartAddr = 0) = 0;
+    // Send the operation to perform to the host. At the time of this call, any
+    // parameters that the host needs should have already been passed using
+    // writeParam().
+    virtual bool sendOperation(MediaCodecType codec, MediaOperation op,
+                               unsigned int offSetToStartAddr = 0) = 0;
+    // Get the address for input. This is usually given the codec context to
+    // write data into for the host to process.
+    virtual uint8_t *getInputAddr(unsigned int offSet = 0) const = 0;
+    // Get the address for base pointer
+    virtual uint8_t *getBaseAddr() const = 0;
+    // Get the address for output. This is usually given to the codec context to
+    // read data written there by the host.
+    virtual uint8_t *getOutputAddr() const = 0;
+    // Get the address for return data from the host. The guest codec
+    // implementation will have knowledge of how the return data is laid out.
+    virtual uint8_t *getReturnAddr(unsigned int offSet = 0) const = 0;
+    // Get the offset of an address relative to the starting address of the
+    // allocated memory region. Use this for passing pointers from the guest to
+    // the host, as the guest address will be translated, thus the offset is the
+    // only value of significance.
+    virtual __u64 offsetOf(uint64_t addr) const = 0;
+
+    // Get a slot of memory (8 M per slot) for use by a decoder instance.
+    // returns -1 for failure; or a slot >=0 on success.
+    // as of now, there are only 4 slots for use, each has 8 M, it is up
+    // to client on how to use it.
+    // 0th slot: [base, base+8M)
+    // ...
+    // ith slot: [base+8M*i, base+8M*(i+1))
+    virtual int getMemorySlot() = 0;
+
+    // Return a slot back to pool. the slot should be valid >=0 and less
+    // than the total size of slots. If nobody returns slot timely, the
+    // new client could get -1 from getMemorySlot()
+    virtual void returnMemorySlot(int slot) = 0;
+
+    static GoldfishMediaTransport *getInstance();
+};
+
+__u64 goldfish_create_media_metadata(MediaCodecType codecType, __u64 metadata);
+
+#endif
diff --git a/system/codecs/c2/decoders/hevcdec/Android.bp b/system/codecs/c2/decoders/hevcdec/Android.bp
new file mode 100644
index 0000000..f1b9c82
--- /dev/null
+++ b/system/codecs/c2/decoders/hevcdec/Android.bp
@@ -0,0 +1,36 @@
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "device_generic_goldfish-opengl_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["device_generic_goldfish-opengl_license"],
+}
+
+cc_library_shared {
+    name: "libcodec2_goldfish_hevcdec",
+    vendor: true,
+    defaults: [
+        "libcodec2_goldfish-defaults",
+    ],
+
+    srcs: ["C2GoldfishHevcDec.cpp",
+        "GoldfishHevcHelper.cpp",
+        "MediaHevcDecoder.cpp",
+    ],
+
+    shared_libs: [
+	    "[email protected]",
+		"[email protected]",
+        "libgoldfish_codec2_store",
+    ],
+
+   header_libs: [
+    "libgralloc_cb.ranchu",
+    ],
+
+   static_libs: ["libhevcdec",
+   ],
+
+}
+
diff --git a/system/codecs/c2/decoders/hevcdec/C2GoldfishHevcDec.cpp b/system/codecs/c2/decoders/hevcdec/C2GoldfishHevcDec.cpp
new file mode 100644
index 0000000..e8d076d
--- /dev/null
+++ b/system/codecs/c2/decoders/hevcdec/C2GoldfishHevcDec.cpp
@@ -0,0 +1,1118 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "C2GoldfishHevcDec"
+#include <inttypes.h>
+#include <log/log.h>
+#include <media/stagefright/foundation/AUtils.h>
+#include <media/stagefright/foundation/MediaDefs.h>
+
+#include <C2AllocatorGralloc.h>
+#include <C2PlatformSupport.h>
+//#include <android/hardware/graphics/common/1.0/types.h>
+
+#include <android/hardware/graphics/allocator/3.0/IAllocator.h>
+#include <android/hardware/graphics/mapper/3.0/IMapper.h>
+#include <hidl/LegacySupport.h>
+
+#include <media/stagefright/foundation/MediaDefs.h>
+
+#include <C2Debug.h>
+#include <C2PlatformSupport.h>
+#include <Codec2Mapper.h>
+#include <SimpleC2Interface.h>
+#include <goldfish_codec2/store/GoldfishComponentStore.h>
+#include <gralloc_cb_bp.h>
+
+#include <color_buffer_utils.h>
+
+#include "C2GoldfishHevcDec.h"
+
+#define DEBUG 0
+#if DEBUG
+#define DDD(...) ALOGD(__VA_ARGS__)
+#else
+#define DDD(...) ((void)0)
+#endif
+
+using ::android::hardware::graphics::common::V1_0::BufferUsage;
+using ::android::hardware::graphics::common::V1_2::PixelFormat;
+
+namespace android {
+
+namespace {
+constexpr size_t kMinInputBufferSize = 6 * 1024 * 1024;
+constexpr char COMPONENT_NAME[] = "c2.goldfish.hevc.decoder";
+constexpr uint32_t kDefaultOutputDelay = 8;
+constexpr uint32_t kMaxOutputDelay = 16;
+} // namespace
+
+class C2GoldfishHevcDec::IntfImpl : public SimpleInterface<void>::BaseParams {
+  public:
+    explicit IntfImpl(const std::shared_ptr<C2ReflectorHelper> &helper)
+        : SimpleInterface<void>::BaseParams(
+              helper, COMPONENT_NAME, C2Component::KIND_DECODER,
+              C2Component::DOMAIN_VIDEO, MEDIA_MIMETYPE_VIDEO_HEVC) {
+        noPrivateBuffers(); // TODO: account for our buffers here
+        noInputReferences();
+        noOutputReferences();
+        noInputLatency();
+        noTimeStretch();
+
+        // TODO: Proper support for reorder depth.
+        addParameter(
+            DefineParam(mActualOutputDelay, C2_PARAMKEY_OUTPUT_DELAY)
+                .withDefault(
+                    new C2PortActualDelayTuning::output(kDefaultOutputDelay))
+                .withFields({C2F(mActualOutputDelay, value)
+                                 .inRange(0, kMaxOutputDelay)})
+                .withSetter(
+                    Setter<
+                        decltype(*mActualOutputDelay)>::StrictValueWithNoDeps)
+                .build());
+
+        // TODO: output latency and reordering
+
+        addParameter(DefineParam(mAttrib, C2_PARAMKEY_COMPONENT_ATTRIBUTES)
+                         .withConstValue(new C2ComponentAttributesSetting(
+                             C2Component::ATTRIB_IS_TEMPORAL))
+                         .build());
+
+        // coded and output picture size is the same for this codec
+        addParameter(
+            DefineParam(mSize, C2_PARAMKEY_PICTURE_SIZE)
+                .withDefault(new C2StreamPictureSizeInfo::output(0u, 320, 240))
+                .withFields({
+                    C2F(mSize, width).inRange(2, 4096, 2),
+                    C2F(mSize, height).inRange(2, 4096, 2),
+                })
+                .withSetter(SizeSetter)
+                .build());
+
+        addParameter(DefineParam(mMaxSize, C2_PARAMKEY_MAX_PICTURE_SIZE)
+                         .withDefault(new C2StreamMaxPictureSizeTuning::output(
+                             0u, 320, 240))
+                         .withFields({
+                             C2F(mSize, width).inRange(2, 4096, 2),
+                             C2F(mSize, height).inRange(2, 4096, 2),
+                         })
+                         .withSetter(MaxPictureSizeSetter, mSize)
+                         .build());
+
+        addParameter(
+            DefineParam(mProfileLevel, C2_PARAMKEY_PROFILE_LEVEL)
+                .withDefault(new C2StreamProfileLevelInfo::input(
+                    0u, C2Config::PROFILE_HEVC_MAIN, C2Config::LEVEL_HEVC_MAIN_5_1))
+                .withFields({
+                    C2F(mProfileLevel, profile).oneOf({
+                            C2Config::PROFILE_HEVC_MAIN,
+                            C2Config::PROFILE_HEVC_MAIN_STILL}),
+                    C2F(mProfileLevel, level).oneOf({
+                            C2Config::LEVEL_HEVC_MAIN_1,
+                            C2Config::LEVEL_HEVC_MAIN_2, C2Config::LEVEL_HEVC_MAIN_2_1,
+                            C2Config::LEVEL_HEVC_MAIN_3, C2Config::LEVEL_HEVC_MAIN_3_1,
+                            C2Config::LEVEL_HEVC_MAIN_4, C2Config::LEVEL_HEVC_MAIN_4_1,
+                            C2Config::LEVEL_HEVC_MAIN_5, C2Config::LEVEL_HEVC_MAIN_5_1,
+                            C2Config::LEVEL_HEVC_MAIN_5_2, C2Config::LEVEL_HEVC_HIGH_4,
+                            C2Config::LEVEL_HEVC_HIGH_4_1, C2Config::LEVEL_HEVC_HIGH_5,
+                            C2Config::LEVEL_HEVC_HIGH_5_1, C2Config::LEVEL_HEVC_HIGH_5_2
+                    })
+                })
+                .withSetter(ProfileLevelSetter, mSize)
+                .build());
+
+        addParameter(
+            DefineParam(mMaxInputSize, C2_PARAMKEY_INPUT_MAX_BUFFER_SIZE)
+                .withDefault(new C2StreamMaxBufferSizeInfo::input(
+                    0u, kMinInputBufferSize))
+                .withFields({
+                    C2F(mMaxInputSize, value).any(),
+                })
+                .calculatedAs(MaxInputSizeSetter, mMaxSize)
+                .build());
+
+        C2ChromaOffsetStruct locations[1] = {
+            C2ChromaOffsetStruct::ITU_YUV_420_0()};
+        std::shared_ptr<C2StreamColorInfo::output> defaultColorInfo =
+            C2StreamColorInfo::output::AllocShared(1u, 0u, 8u /* bitDepth */,
+                                                   C2Color::YUV_420);
+        memcpy(defaultColorInfo->m.locations, locations, sizeof(locations));
+
+        defaultColorInfo = C2StreamColorInfo::output::AllocShared(
+            {C2ChromaOffsetStruct::ITU_YUV_420_0()}, 0u, 8u /* bitDepth */,
+            C2Color::YUV_420);
+        helper->addStructDescriptors<C2ChromaOffsetStruct>();
+
+        addParameter(DefineParam(mColorInfo, C2_PARAMKEY_CODED_COLOR_INFO)
+                         .withConstValue(defaultColorInfo)
+                         .build());
+
+        addParameter(
+            DefineParam(mDefaultColorAspects, C2_PARAMKEY_DEFAULT_COLOR_ASPECTS)
+                .withDefault(new C2StreamColorAspectsTuning::output(
+                    0u, C2Color::RANGE_UNSPECIFIED,
+                    C2Color::PRIMARIES_UNSPECIFIED,
+                    C2Color::TRANSFER_UNSPECIFIED, C2Color::MATRIX_UNSPECIFIED))
+                .withFields({C2F(mDefaultColorAspects, range)
+                                 .inRange(C2Color::RANGE_UNSPECIFIED,
+                                          C2Color::RANGE_OTHER),
+                             C2F(mDefaultColorAspects, primaries)
+                                 .inRange(C2Color::PRIMARIES_UNSPECIFIED,
+                                          C2Color::PRIMARIES_OTHER),
+                             C2F(mDefaultColorAspects, transfer)
+                                 .inRange(C2Color::TRANSFER_UNSPECIFIED,
+                                          C2Color::TRANSFER_OTHER),
+                             C2F(mDefaultColorAspects, matrix)
+                                 .inRange(C2Color::MATRIX_UNSPECIFIED,
+                                          C2Color::MATRIX_OTHER)})
+                .withSetter(DefaultColorAspectsSetter)
+                .build());
+
+        addParameter(
+            DefineParam(mCodedColorAspects, C2_PARAMKEY_VUI_COLOR_ASPECTS)
+                .withDefault(new C2StreamColorAspectsInfo::input(
+                    0u, C2Color::RANGE_LIMITED, C2Color::PRIMARIES_UNSPECIFIED,
+                    C2Color::TRANSFER_UNSPECIFIED, C2Color::MATRIX_UNSPECIFIED))
+                .withFields({C2F(mCodedColorAspects, range)
+                                 .inRange(C2Color::RANGE_UNSPECIFIED,
+                                          C2Color::RANGE_OTHER),
+                             C2F(mCodedColorAspects, primaries)
+                                 .inRange(C2Color::PRIMARIES_UNSPECIFIED,
+                                          C2Color::PRIMARIES_OTHER),
+                             C2F(mCodedColorAspects, transfer)
+                                 .inRange(C2Color::TRANSFER_UNSPECIFIED,
+                                          C2Color::TRANSFER_OTHER),
+                             C2F(mCodedColorAspects, matrix)
+                                 .inRange(C2Color::MATRIX_UNSPECIFIED,
+                                          C2Color::MATRIX_OTHER)})
+                .withSetter(CodedColorAspectsSetter)
+                .build());
+
+        addParameter(
+            DefineParam(mColorAspects, C2_PARAMKEY_COLOR_ASPECTS)
+                .withDefault(new C2StreamColorAspectsInfo::output(
+                    0u, C2Color::RANGE_UNSPECIFIED,
+                    C2Color::PRIMARIES_UNSPECIFIED,
+                    C2Color::TRANSFER_UNSPECIFIED, C2Color::MATRIX_UNSPECIFIED))
+                .withFields({C2F(mColorAspects, range)
+                                 .inRange(C2Color::RANGE_UNSPECIFIED,
+                                          C2Color::RANGE_OTHER),
+                             C2F(mColorAspects, primaries)
+                                 .inRange(C2Color::PRIMARIES_UNSPECIFIED,
+                                          C2Color::PRIMARIES_OTHER),
+                             C2F(mColorAspects, transfer)
+                                 .inRange(C2Color::TRANSFER_UNSPECIFIED,
+                                          C2Color::TRANSFER_OTHER),
+                             C2F(mColorAspects, matrix)
+                                 .inRange(C2Color::MATRIX_UNSPECIFIED,
+                                          C2Color::MATRIX_OTHER)})
+                .withSetter(ColorAspectsSetter, mDefaultColorAspects,
+                            mCodedColorAspects)
+                .build());
+
+        // TODO: support more formats?
+        addParameter(DefineParam(mPixelFormat, C2_PARAMKEY_PIXEL_FORMAT)
+                         .withConstValue(new C2StreamPixelFormatInfo::output(
+                             0u, HAL_PIXEL_FORMAT_YCBCR_420_888))
+                         .build());
+    }
+    static C2R SizeSetter(bool mayBlock,
+                          const C2P<C2StreamPictureSizeInfo::output> &oldMe,
+                          C2P<C2StreamPictureSizeInfo::output> &me) {
+        (void)mayBlock;
+        DDD("calling sizesetter now %d", oldMe.v.height);
+        DDD("new calling sizesetter now %d", me.v.height);
+
+        C2R res = C2R::Ok();
+        if (!me.F(me.v.width).supportsAtAll(me.v.width)) {
+            res = res.plus(C2SettingResultBuilder::BadValue(me.F(me.v.width)));
+            me.set().width = oldMe.v.width;
+        }
+        if (!me.F(me.v.height).supportsAtAll(me.v.height)) {
+            res = res.plus(C2SettingResultBuilder::BadValue(me.F(me.v.height)));
+            me.set().height = oldMe.v.height;
+        }
+        return res;
+    }
+
+    static C2R
+    MaxPictureSizeSetter(bool mayBlock,
+                         C2P<C2StreamMaxPictureSizeTuning::output> &me,
+                         const C2P<C2StreamPictureSizeInfo::output> &size) {
+        (void)mayBlock;
+        // TODO: get max width/height from the size's field helpers vs.
+        // hardcoding
+        me.set().width = c2_min(c2_max(me.v.width, size.v.width), 4096u);
+        me.set().height = c2_min(c2_max(me.v.height, size.v.height), 4096u);
+        return C2R::Ok();
+    }
+
+    static C2R MaxInputSizeSetter(
+        bool mayBlock, C2P<C2StreamMaxBufferSizeInfo::input> &me,
+        const C2P<C2StreamMaxPictureSizeTuning::output> &maxSize) {
+        (void)mayBlock;
+        // assume compression ratio of 2
+        me.set().value = c2_max((((maxSize.v.width + 63) / 64) *
+                                 ((maxSize.v.height + 64) / 64) * 3072),
+                                kMinInputBufferSize);
+        return C2R::Ok();
+    }
+
+    static C2R
+    ProfileLevelSetter(bool mayBlock, C2P<C2StreamProfileLevelInfo::input> &me,
+                       const C2P<C2StreamPictureSizeInfo::output> &size) {
+        (void)mayBlock;
+        (void)size;
+        (void)me; // TODO: validate
+        return C2R::Ok();
+    }
+
+    static C2R
+    DefaultColorAspectsSetter(bool mayBlock,
+                              C2P<C2StreamColorAspectsTuning::output> &me) {
+        (void)mayBlock;
+        if (me.v.range > C2Color::RANGE_OTHER) {
+            me.set().range = C2Color::RANGE_OTHER;
+        }
+        if (me.v.primaries > C2Color::PRIMARIES_OTHER) {
+            me.set().primaries = C2Color::PRIMARIES_OTHER;
+        }
+        if (me.v.transfer > C2Color::TRANSFER_OTHER) {
+            me.set().transfer = C2Color::TRANSFER_OTHER;
+        }
+        if (me.v.matrix > C2Color::MATRIX_OTHER) {
+            me.set().matrix = C2Color::MATRIX_OTHER;
+        }
+        return C2R::Ok();
+    }
+
+    static C2R
+    CodedColorAspectsSetter(bool mayBlock,
+                            C2P<C2StreamColorAspectsInfo::input> &me) {
+        (void)mayBlock;
+        if (me.v.range > C2Color::RANGE_OTHER) {
+            me.set().range = C2Color::RANGE_OTHER;
+        }
+        if (me.v.primaries > C2Color::PRIMARIES_OTHER) {
+            me.set().primaries = C2Color::PRIMARIES_OTHER;
+        }
+        if (me.v.transfer > C2Color::TRANSFER_OTHER) {
+            me.set().transfer = C2Color::TRANSFER_OTHER;
+        }
+        if (me.v.matrix > C2Color::MATRIX_OTHER) {
+            me.set().matrix = C2Color::MATRIX_OTHER;
+        }
+        return C2R::Ok();
+    }
+
+    static C2R
+    ColorAspectsSetter(bool mayBlock, C2P<C2StreamColorAspectsInfo::output> &me,
+                       const C2P<C2StreamColorAspectsTuning::output> &def,
+                       const C2P<C2StreamColorAspectsInfo::input> &coded) {
+        (void)mayBlock;
+        // take default values for all unspecified fields, and coded values for
+        // specified ones
+        me.set().range =
+            coded.v.range == RANGE_UNSPECIFIED ? def.v.range : coded.v.range;
+        me.set().primaries = coded.v.primaries == PRIMARIES_UNSPECIFIED
+                                 ? def.v.primaries
+                                 : coded.v.primaries;
+        me.set().transfer = coded.v.transfer == TRANSFER_UNSPECIFIED
+                                ? def.v.transfer
+                                : coded.v.transfer;
+        me.set().matrix = coded.v.matrix == MATRIX_UNSPECIFIED ? def.v.matrix
+                                                               : coded.v.matrix;
+        return C2R::Ok();
+    }
+
+    std::shared_ptr<C2StreamColorAspectsInfo::output> getColorAspects_l() {
+        return mColorAspects;
+    }
+
+    int width() const { return mSize->width; }
+
+    int height() const { return mSize->height; }
+
+    int primaries() const { return mColorAspects->primaries; }
+
+    int range() const { return mColorAspects->range; }
+
+    int transfer() const { return mColorAspects->transfer; }
+
+
+  private:
+    std::shared_ptr<C2StreamProfileLevelInfo::input> mProfileLevel;
+    std::shared_ptr<C2StreamPictureSizeInfo::output> mSize;
+    std::shared_ptr<C2StreamMaxPictureSizeTuning::output> mMaxSize;
+    std::shared_ptr<C2StreamMaxBufferSizeInfo::input> mMaxInputSize;
+    std::shared_ptr<C2StreamColorInfo::output> mColorInfo;
+    std::shared_ptr<C2StreamColorAspectsInfo::input> mCodedColorAspects;
+    std::shared_ptr<C2StreamColorAspectsTuning::output> mDefaultColorAspects;
+    std::shared_ptr<C2StreamColorAspectsInfo::output> mColorAspects;
+    std::shared_ptr<C2StreamPixelFormatInfo::output> mPixelFormat;
+};
+
+static void *ivd_aligned_malloc(void *ctxt, uint32_t alignment, uint32_t size) {
+    (void)ctxt;
+    return memalign(alignment, size);
+}
+
+static void ivd_aligned_free(void *ctxt, void *mem) {
+    (void)ctxt;
+    free(mem);
+}
+
+C2GoldfishHevcDec::C2GoldfishHevcDec(const char *name, c2_node_id_t id,
+                                   const std::shared_ptr<IntfImpl> &intfImpl)
+    : SimpleC2Component(
+          std::make_shared<SimpleInterface<IntfImpl>>(name, id, intfImpl)),
+      mIntf(intfImpl), mOutBufferFlush(nullptr), mWidth(1920), mHeight(1080),
+      mHeaderDecoded(false), mOutIndex(0u) {
+    mWidth = mIntf->width();
+    mHeight = mIntf->height();
+    DDD("creating hevc decoder now w %d h %d", mWidth, mHeight);
+}
+
+C2GoldfishHevcDec::~C2GoldfishHevcDec() { onRelease(); }
+
+c2_status_t C2GoldfishHevcDec::onInit() {
+    status_t err = initDecoder();
+    return err == OK ? C2_OK : C2_CORRUPTED;
+}
+
+c2_status_t C2GoldfishHevcDec::onStop() {
+    if (OK != resetDecoder())
+        return C2_CORRUPTED;
+    resetPlugin();
+    return C2_OK;
+}
+
+void C2GoldfishHevcDec::onReset() { (void)onStop(); }
+
+void C2GoldfishHevcDec::onRelease() {
+    deleteContext();
+    if (mOutBlock) {
+        mOutBlock.reset();
+    }
+}
+
+void C2GoldfishHevcDec::decodeHeaderAfterFlush() {
+        DDD("calling %s", __func__);
+    if (mContext && !mCsd0.empty()) {
+        mContext->decodeFrame(&(mCsd0[0]), mCsd0.size(), 0);
+        DDD("resending csd0");
+        DDD("calling %s success", __func__);
+    }
+}
+
+c2_status_t C2GoldfishHevcDec::onFlush_sm() {
+    if (OK != setFlushMode())
+        return C2_CORRUPTED;
+
+    if (!mContext) {
+        // just ignore if context is not even created
+        return C2_OK;
+    }
+
+    uint32_t bufferSize = mStride * mHeight * 3 / 2;
+    mOutBufferFlush = (uint8_t *)ivd_aligned_malloc(nullptr, 128, bufferSize);
+    if (!mOutBufferFlush) {
+        ALOGE("could not allocate tmp output buffer (for flush) of size %u ",
+              bufferSize);
+        return C2_NO_MEMORY;
+    }
+
+    while (true) {
+        mPts = 0;
+        setDecodeArgs(nullptr, nullptr, 0, 0, 0);
+        mImg = mContext->getImage();
+        if (mImg.data == nullptr) {
+            resetPlugin();
+            break;
+        }
+    }
+
+    if (mOutBufferFlush) {
+        ivd_aligned_free(nullptr, mOutBufferFlush);
+        mOutBufferFlush = nullptr;
+    }
+
+    deleteContext();
+    return C2_OK;
+}
+
+void C2GoldfishHevcDec::sendMetadata() {
+    // compare and send if changed
+    MetaDataColorAspects currentMetaData = {1, 0, 0, 0};
+    currentMetaData.primaries = mIntf->primaries();
+    currentMetaData.range = mIntf->range();
+    currentMetaData.transfer = mIntf->transfer();
+
+    DDD("metadata primaries %d range %d transfer %d",
+            (int)(currentMetaData.primaries),
+            (int)(currentMetaData.range),
+            (int)(currentMetaData.transfer)
+       );
+
+    if (mSentMetadata.primaries == currentMetaData.primaries &&
+        mSentMetadata.range == currentMetaData.range &&
+        mSentMetadata.transfer == currentMetaData.transfer) {
+        DDD("metadata is the same, no need to update");
+        return;
+    }
+    std::swap(mSentMetadata, currentMetaData);
+
+    mContext->sendMetadata(&(mSentMetadata));
+}
+
+status_t C2GoldfishHevcDec::createDecoder() {
+
+    DDD("creating hevc context now w %d h %d", mWidth, mHeight);
+    if (mEnableAndroidNativeBuffers) {
+        mContext.reset(new MediaHevcDecoder(RenderMode::RENDER_BY_HOST_GPU));
+    } else {
+        mContext.reset(new MediaHevcDecoder(RenderMode::RENDER_BY_GUEST_CPU));
+    }
+    mContext->initHevcContext(mWidth, mHeight, mWidth, mHeight,
+                              MediaHevcDecoder::PixelFormat::YUV420P);
+
+    return OK;
+}
+
+status_t C2GoldfishHevcDec::setParams(size_t stride) {
+    (void)stride;
+    return OK;
+}
+
+status_t C2GoldfishHevcDec::initDecoder() {
+    //    if (OK != createDecoder()) return UNKNOWN_ERROR;
+    mStride = ALIGN2(mWidth);
+    mSignalledError = false;
+    resetPlugin();
+
+    return OK;
+}
+
+bool C2GoldfishHevcDec::setDecodeArgs(C2ReadView *inBuffer,
+                                     C2GraphicView *outBuffer, size_t inOffset,
+                                     size_t inSize, uint32_t tsMarker) {
+    uint32_t displayStride = mStride;
+    (void)inBuffer;
+    (void)inOffset;
+    (void)inSize;
+    (void)tsMarker;
+    if (outBuffer) {
+        C2PlanarLayout layout;
+        layout = outBuffer->layout();
+        displayStride = layout.planes[C2PlanarLayout::PLANE_Y].rowInc;
+    }
+
+    if (inBuffer) {
+        //= tsMarker;
+        mInPBuffer = const_cast<uint8_t *>(inBuffer->data() + inOffset);
+        mInPBufferSize = inSize;
+        mInTsMarker = tsMarker;
+        insertPts(tsMarker, mPts);
+    }
+
+    // uint32_t displayHeight = mHeight;
+    // size_t lumaSize = displayStride * displayHeight;
+    // size_t chromaSize = lumaSize >> 2;
+
+    if (mStride != displayStride) {
+        mStride = displayStride;
+        if (OK != setParams(mStride))
+            return false;
+    }
+
+    return true;
+}
+
+status_t C2GoldfishHevcDec::setFlushMode() {
+    if (mContext) {
+        mContext->flush();
+    }
+    mHeaderDecoded = false;
+    return OK;
+}
+
+status_t C2GoldfishHevcDec::resetDecoder() {
+    mStride = 0;
+    mSignalledError = false;
+    mHeaderDecoded = false;
+    deleteContext();
+
+    return OK;
+}
+
+void C2GoldfishHevcDec::resetPlugin() {
+    mSignalledOutputEos = false;
+    gettimeofday(&mTimeStart, nullptr);
+    gettimeofday(&mTimeEnd, nullptr);
+    if (mOutBlock) {
+        mOutBlock.reset();
+    }
+}
+
+void C2GoldfishHevcDec::deleteContext() {
+    if (mContext) {
+        mContext->destroyHevcContext();
+        mContext.reset(nullptr);
+        mPts2Index.clear();
+        mOldPts2Index.clear();
+        mIndex2Pts.clear();
+    }
+}
+
+static void fillEmptyWork(const std::unique_ptr<C2Work> &work) {
+    uint32_t flags = 0;
+    if (work->input.flags & C2FrameData::FLAG_END_OF_STREAM) {
+        flags |= C2FrameData::FLAG_END_OF_STREAM;
+        DDD("signalling eos");
+    }
+    DDD("fill empty work");
+    work->worklets.front()->output.flags = (C2FrameData::flags_t)flags;
+    work->worklets.front()->output.buffers.clear();
+    work->worklets.front()->output.ordinal = work->input.ordinal;
+    work->workletsProcessed = 1u;
+}
+
+void C2GoldfishHevcDec::finishWork(uint64_t index,
+                                  const std::unique_ptr<C2Work> &work) {
+    std::shared_ptr<C2Buffer> buffer =
+        createGraphicBuffer(std::move(mOutBlock), C2Rect(mWidth, mHeight));
+    mOutBlock = nullptr;
+    {
+        IntfImpl::Lock lock = mIntf->lock();
+        buffer->setInfo(mIntf->getColorAspects_l());
+    }
+
+    class FillWork {
+      public:
+        FillWork(uint32_t flags, C2WorkOrdinalStruct ordinal,
+                 const std::shared_ptr<C2Buffer> &buffer)
+            : mFlags(flags), mOrdinal(ordinal), mBuffer(buffer) {}
+        ~FillWork() = default;
+
+        void operator()(const std::unique_ptr<C2Work> &work) {
+            work->worklets.front()->output.flags = (C2FrameData::flags_t)mFlags;
+            work->worklets.front()->output.buffers.clear();
+            work->worklets.front()->output.ordinal = mOrdinal;
+            work->workletsProcessed = 1u;
+            work->result = C2_OK;
+            if (mBuffer) {
+                work->worklets.front()->output.buffers.push_back(mBuffer);
+            }
+            DDD("timestamp = %lld, index = %lld, w/%s buffer",
+                mOrdinal.timestamp.peekll(), mOrdinal.frameIndex.peekll(),
+                mBuffer ? "" : "o");
+        }
+
+      private:
+        const uint32_t mFlags;
+        const C2WorkOrdinalStruct mOrdinal;
+        const std::shared_ptr<C2Buffer> mBuffer;
+    };
+
+    auto fillWork = [buffer](const std::unique_ptr<C2Work> &work) {
+        work->worklets.front()->output.flags = (C2FrameData::flags_t)0;
+        work->worklets.front()->output.buffers.clear();
+        work->worklets.front()->output.buffers.push_back(buffer);
+        work->worklets.front()->output.ordinal = work->input.ordinal;
+        work->workletsProcessed = 1u;
+    };
+    if (work && c2_cntr64_t(index) == work->input.ordinal.frameIndex) {
+        bool eos = ((work->input.flags & C2FrameData::FLAG_END_OF_STREAM) != 0);
+        // TODO: Check if cloneAndSend can be avoided by tracking number of
+        // frames remaining
+        if (eos) {
+            if (buffer) {
+                mOutIndex = index;
+                C2WorkOrdinalStruct outOrdinal = work->input.ordinal;
+                DDD("%s %d: cloneAndSend ", __func__, __LINE__);
+                cloneAndSend(
+                    mOutIndex, work,
+                    FillWork(C2FrameData::FLAG_INCOMPLETE, outOrdinal, buffer));
+                buffer.reset();
+            }
+        } else {
+            DDD("%s %d: fill", __func__, __LINE__);
+            fillWork(work);
+        }
+    } else {
+        DDD("%s %d: finish", __func__, __LINE__);
+        finish(index, fillWork);
+    }
+}
+
+c2_status_t
+C2GoldfishHevcDec::ensureDecoderState(const std::shared_ptr<C2BlockPool> &pool) {
+    if (mOutBlock && (mOutBlock->width() != ALIGN2(mWidth) ||
+                      mOutBlock->height() != mHeight)) {
+        mOutBlock.reset();
+    }
+    if (!mOutBlock) {
+        const uint32_t format = HAL_PIXEL_FORMAT_YCBCR_420_888;
+        const C2MemoryUsage usage = {(uint64_t)(BufferUsage::VIDEO_DECODER),
+                                     C2MemoryUsage::CPU_WRITE};
+        c2_status_t err = pool->fetchGraphicBlock(ALIGN2(mWidth), mHeight,
+                                                  format, usage, &mOutBlock);
+        if (err != C2_OK) {
+            ALOGE("fetchGraphicBlock for Output failed with status %d", err);
+            return err;
+        }
+        if (mEnableAndroidNativeBuffers) {
+            auto c2Handle = mOutBlock->handle();
+            native_handle_t *grallocHandle =
+                UnwrapNativeCodec2GrallocHandle(c2Handle);
+            mHostColorBufferId = getColorBufferHandle(grallocHandle);
+            DDD("found handle %d", mHostColorBufferId);
+        }
+        DDD("provided (%dx%d) required (%dx%d)", mOutBlock->width(),
+            mOutBlock->height(), ALIGN2(mWidth), mHeight);
+    }
+
+    return C2_OK;
+}
+
+void C2GoldfishHevcDec::checkMode(const std::shared_ptr<C2BlockPool> &pool) {
+    mWidth = mIntf->width();
+    mHeight = mIntf->height();
+    const bool isGraphic = (pool->getLocalId() == C2PlatformAllocatorStore::GRALLOC);
+    DDD("buffer pool id %x",  (int)(pool->getLocalId()));
+    if (isGraphic) {
+        DDD("decoding to host color buffer");
+        mEnableAndroidNativeBuffers = true;
+    } else {
+        DDD("decoding to guest byte buffer");
+        mEnableAndroidNativeBuffers = false;
+    }
+}
+
+void C2GoldfishHevcDec::getVuiParams(hevc_image_t &img) {
+
+    VuiColorAspects vuiColorAspects;
+    vuiColorAspects.primaries = img.color_primaries;
+    vuiColorAspects.transfer = img.color_trc;
+    vuiColorAspects.coeffs = img.colorspace;
+    vuiColorAspects.fullRange = img.color_range == 2 ? true : false;
+
+    // convert vui aspects to C2 values if changed
+    if (!(vuiColorAspects == mBitstreamColorAspects)) {
+        mBitstreamColorAspects = vuiColorAspects;
+        ColorAspects sfAspects;
+        C2StreamColorAspectsInfo::input codedAspects = {0u};
+        ColorUtils::convertIsoColorAspectsToCodecAspects(
+            vuiColorAspects.primaries, vuiColorAspects.transfer,
+            vuiColorAspects.coeffs, vuiColorAspects.fullRange, sfAspects);
+        if (!C2Mapper::map(sfAspects.mPrimaries, &codedAspects.primaries)) {
+            codedAspects.primaries = C2Color::PRIMARIES_UNSPECIFIED;
+        }
+        if (!C2Mapper::map(sfAspects.mRange, &codedAspects.range)) {
+            codedAspects.range = C2Color::RANGE_UNSPECIFIED;
+        }
+        if (!C2Mapper::map(sfAspects.mMatrixCoeffs, &codedAspects.matrix)) {
+            codedAspects.matrix = C2Color::MATRIX_UNSPECIFIED;
+        }
+        if (!C2Mapper::map(sfAspects.mTransfer, &codedAspects.transfer)) {
+            codedAspects.transfer = C2Color::TRANSFER_UNSPECIFIED;
+        }
+        std::vector<std::unique_ptr<C2SettingResult>> failures;
+        (void)mIntf->config({&codedAspects}, C2_MAY_BLOCK, &failures);
+    }
+}
+
+void C2GoldfishHevcDec::copyImageData(hevc_image_t &img) {
+    getVuiParams(img);
+    if (mEnableAndroidNativeBuffers)
+        return;
+
+    auto writeView = mOutBlock->map().get();
+    if (writeView.error()) {
+        ALOGE("graphic view map failed %d", writeView.error());
+        return;
+    }
+    size_t dstYStride = writeView.layout().planes[C2PlanarLayout::PLANE_Y].rowInc;
+    size_t dstUVStride = writeView.layout().planes[C2PlanarLayout::PLANE_U].rowInc;
+
+    uint8_t *pYBuffer = const_cast<uint8_t *>(writeView.data()[C2PlanarLayout::PLANE_Y]);
+    uint8_t *pUBuffer = const_cast<uint8_t *>(writeView.data()[C2PlanarLayout::PLANE_U]);
+    uint8_t *pVBuffer = const_cast<uint8_t *>(writeView.data()[C2PlanarLayout::PLANE_V]);
+
+    for (int i = 0; i < mHeight; ++i) {
+        memcpy(pYBuffer + i * dstYStride, img.data + i * mWidth, mWidth);
+    }
+    for (int i = 0; i < mHeight / 2; ++i) {
+        memcpy(pUBuffer + i * dstUVStride,
+               img.data + mWidth * mHeight + i * mWidth / 2, mWidth / 2);
+    }
+    for (int i = 0; i < mHeight / 2; ++i) {
+        memcpy(pVBuffer + i * dstUVStride,
+               img.data + mWidth * mHeight * 5 / 4 + i * mWidth / 2,
+               mWidth / 2);
+    }
+}
+
+uint64_t C2GoldfishHevcDec::getWorkIndex(uint64_t pts) {
+    if (!mOldPts2Index.empty()) {
+        auto iter = mOldPts2Index.find(pts);
+        if (iter != mOldPts2Index.end()) {
+            auto index = iter->second;
+            DDD("found index %d for pts %" PRIu64, (int)index, pts);
+            return index;
+        }
+    }
+    auto iter = mPts2Index.find(pts);
+    if (iter != mPts2Index.end()) {
+        auto index = iter->second;
+        DDD("found index %d for pts %" PRIu64, (int)index, pts);
+        return index;
+    }
+    DDD("not found index for pts %" PRIu64, pts);
+    return 0;
+}
+
+void C2GoldfishHevcDec::insertPts(uint32_t work_index, uint64_t pts) {
+    auto iter = mPts2Index.find(pts);
+    if (iter != mPts2Index.end()) {
+        // we have a collision here:
+        // apparently, older session is not done yet,
+        // lets save them
+        DDD("inserted to old pts %" PRIu64 " with index %d", pts, (int)iter->second);
+        mOldPts2Index[iter->first] = iter->second;
+    }
+    DDD("inserted pts %" PRIu64 " with index %d", pts, (int)work_index);
+    mIndex2Pts[work_index] = pts;
+    mPts2Index[pts] = work_index;
+}
+
+void C2GoldfishHevcDec::removePts(uint64_t pts) {
+    bool found = false;
+    uint64_t index = 0;
+    // note: check old pts first to see
+    // if we have some left over, check them
+    if (!mOldPts2Index.empty()) {
+        auto iter = mOldPts2Index.find(pts);
+        if (iter != mOldPts2Index.end()) {
+            mOldPts2Index.erase(iter);
+            index = iter->second;
+            found = true;
+        }
+    } else {
+        auto iter = mPts2Index.find(pts);
+        if (iter != mPts2Index.end()) {
+            mPts2Index.erase(iter);
+            index = iter->second;
+            found = true;
+        }
+    }
+
+    if (!found) return;
+
+    auto iter2 = mIndex2Pts.find(index);
+    if (iter2 == mIndex2Pts.end()) return;
+    mIndex2Pts.erase(iter2);
+}
+
+// TODO: can overall error checking be improved?
+// TODO: allow configuration of color format and usage for graphic buffers
+// instead
+//       of hard coding them to HAL_PIXEL_FORMAT_YV12
+// TODO: pass coloraspects information to surface
+// TODO: test support for dynamic change in resolution
+// TODO: verify if the decoder sent back all frames
+void C2GoldfishHevcDec::process(const std::unique_ptr<C2Work> &work,
+                               const std::shared_ptr<C2BlockPool> &pool) {
+    // Initialize output work
+    work->result = C2_OK;
+    work->workletsProcessed = 0u;
+    work->worklets.front()->output.flags = work->input.flags;
+    if (mSignalledError || mSignalledOutputEos) {
+        work->result = C2_BAD_VALUE;
+        return;
+    }
+
+    DDD("process work");
+    if (!mContext) {
+        DDD("creating decoder context to host in process work");
+        checkMode(pool);
+        createDecoder();
+        decodeHeaderAfterFlush();
+    }
+
+    size_t inOffset = 0u;
+    size_t inSize = 0u;
+    uint32_t workIndex = work->input.ordinal.frameIndex.peeku() & 0xFFFFFFFF;
+    mPts = work->input.ordinal.timestamp.peeku();
+    C2ReadView rView = mDummyReadView;
+    if (!work->input.buffers.empty()) {
+        rView =
+            work->input.buffers[0]->data().linearBlocks().front().map().get();
+        inSize = rView.capacity();
+        if (inSize && rView.error()) {
+            ALOGE("read view map failed %d", rView.error());
+            work->result = rView.error();
+            return;
+        }
+    }
+    bool eos = ((work->input.flags & C2FrameData::FLAG_END_OF_STREAM) != 0);
+    bool hasPicture = (inSize > 0);
+
+    DDD("in buffer attr. size %zu timestamp %d frameindex %d, flags %x", inSize,
+        (int)work->input.ordinal.timestamp.peeku(),
+        (int)work->input.ordinal.frameIndex.peeku(), work->input.flags);
+    size_t inPos = 0;
+    while (inPos < inSize) {
+        if (C2_OK != ensureDecoderState(pool)) {
+            mSignalledError = true;
+            work->workletsProcessed = 1u;
+            work->result = C2_CORRUPTED;
+            return;
+        }
+
+        {
+            // C2GraphicView wView;// = mOutBlock->map().get();
+            // if (wView.error()) {
+            //    ALOGE("graphic view map failed %d", wView.error());
+            //    work->result = wView.error();
+            //    return;
+            //}
+            if (!setDecodeArgs(&rView, nullptr, inOffset + inPos,
+                               inSize - inPos, workIndex)) {
+                mSignalledError = true;
+                work->workletsProcessed = 1u;
+                work->result = C2_CORRUPTED;
+                return;
+            }
+
+            DDD("flag is %x", work->input.flags);
+            if (work->input.flags & C2FrameData::FLAG_CODEC_CONFIG) {
+                hasPicture = false;
+                if (mCsd0.empty()) {
+                    mCsd0.assign(mInPBuffer, mInPBuffer + mInPBufferSize);
+                    DDD("assign to csd0 with %d bytpes", mInPBufferSize);
+                }
+                // this is not really a valid pts from config
+                removePts(mPts);
+            }
+
+            bool whChanged = false;
+            if (GoldfishHevcHelper::isVpsFrame(mInPBuffer, mInPBufferSize)) {
+                mHevcHelper.reset(new GoldfishHevcHelper(mWidth, mHeight));
+                bool headerStatus = true;
+                whChanged = mHevcHelper->decodeHeader(
+                    mInPBuffer, mInPBufferSize, headerStatus);
+                if (!headerStatus) {
+                    mSignalledError = true;
+                    work->workletsProcessed = 1u;
+                    work->result = C2_CORRUPTED;
+                    return;
+                }
+                if (whChanged) {
+                        DDD("w changed from old %d to new %d\n", mWidth, mHevcHelper->getWidth());
+                        DDD("h changed from old %d to new %d\n", mHeight, mHevcHelper->getHeight());
+                        if (1) {
+                            drainInternal(DRAIN_COMPONENT_NO_EOS, pool, work);
+                            resetDecoder();
+                            resetPlugin();
+                            work->workletsProcessed = 0u;
+                        }
+                        {
+                            mWidth = mHevcHelper->getWidth();
+                            mHeight = mHevcHelper->getHeight();
+                            C2StreamPictureSizeInfo::output size(0u, mWidth, mHeight);
+                            std::vector<std::unique_ptr<C2SettingResult>> failures;
+                            c2_status_t err = mIntf->config({&size}, C2_MAY_BLOCK, &failures);
+                            if (err == OK) {
+                                work->worklets.front()->output.configUpdate.push_back(
+                                        C2Param::Copy(size));
+                                ensureDecoderState(pool);
+                            } else {
+                                ALOGE("Cannot set width and height");
+                                mSignalledError = true;
+                                work->workletsProcessed = 1u;
+                                work->result = C2_CORRUPTED;
+                                return;
+                            }
+                        }
+                        if (!mContext) {
+                            DDD("creating decoder context to host in process work");
+                            checkMode(pool);
+                            createDecoder();
+                        }
+                        continue;//return;
+                } // end of whChanged
+            } // end of isVpsFrame
+
+            sendMetadata();
+
+            uint32_t delay;
+            GETTIME(&mTimeStart, nullptr);
+            TIME_DIFF(mTimeEnd, mTimeStart, delay);
+            (void)delay;
+            //(void) ivdec_api_function(mDecHandle, &s_decode_ip, &s_decode_op);
+            DDD("decoding");
+            hevc_result_t hevcRes =
+                mContext->decodeFrame(mInPBuffer, mInPBufferSize, mIndex2Pts[mInTsMarker]);
+            mConsumedBytes = hevcRes.bytesProcessed;
+            DDD("decoding consumed %d", (int)mConsumedBytes);
+
+            if (mHostColorBufferId > 0) {
+                mImg = mContext->renderOnHostAndReturnImageMetadata(
+                    mHostColorBufferId);
+            } else {
+                mImg = mContext->getImage();
+            }
+            uint32_t decodeTime;
+            GETTIME(&mTimeEnd, nullptr);
+            TIME_DIFF(mTimeStart, mTimeEnd, decodeTime);
+            (void)decodeTime;
+        }
+        if (mImg.data != nullptr) {
+            DDD("got data %" PRIu64 " with pts %" PRIu64,  getWorkIndex(mImg.pts), mImg.pts);
+            mHeaderDecoded = true;
+            copyImageData(mImg);
+            finishWork(getWorkIndex(mImg.pts), work);
+            removePts(mImg.pts);
+        } else {
+            work->workletsProcessed = 0u;
+        }
+
+        inPos += mConsumedBytes;
+    }
+    if (eos) {
+        DDD("drain because of eos");
+        drainInternal(DRAIN_COMPONENT_WITH_EOS, pool, work);
+        mSignalledOutputEos = true;
+    } else if (!hasPicture) {
+        DDD("no picture, fill empty work");
+        fillEmptyWork(work);
+    }
+
+    work->input.buffers.clear();
+}
+
+c2_status_t
+C2GoldfishHevcDec::drainInternal(uint32_t drainMode,
+                                const std::shared_ptr<C2BlockPool> &pool,
+                                const std::unique_ptr<C2Work> &work) {
+    if (drainMode == NO_DRAIN) {
+        ALOGW("drain with NO_DRAIN: no-op");
+        return C2_OK;
+    }
+    if (drainMode == DRAIN_CHAIN) {
+        ALOGW("DRAIN_CHAIN not supported");
+        return C2_OMITTED;
+    }
+
+    if (OK != setFlushMode())
+        return C2_CORRUPTED;
+    while (true) {
+        if (C2_OK != ensureDecoderState(pool)) {
+            mSignalledError = true;
+            work->workletsProcessed = 1u;
+            work->result = C2_CORRUPTED;
+            return C2_CORRUPTED;
+        }
+        /*
+        C2GraphicView wView = mOutBlock->map().get();
+        if (wView.error()) {
+            ALOGE("graphic view map failed %d", wView.error());
+            return C2_CORRUPTED;
+        }
+        if (!setDecodeArgs(nullptr, &wView, 0, 0, 0)) {
+            mSignalledError = true;
+            work->workletsProcessed = 1u;
+            return C2_CORRUPTED;
+        }
+        */
+
+        if (mHostColorBufferId > 0) {
+            mImg = mContext->renderOnHostAndReturnImageMetadata(
+                mHostColorBufferId);
+        } else {
+            mImg = mContext->getImage();
+        }
+
+        // TODO: maybe keep rendering to screen
+        //        mImg = mContext->getImage();
+        if (mImg.data != nullptr) {
+            DDD("got data in drain mode %" PRIu64 " with pts %" PRIu64,  getWorkIndex(mImg.pts), mImg.pts);
+            copyImageData(mImg);
+            finishWork(getWorkIndex(mImg.pts), work);
+            removePts(mImg.pts);
+        } else {
+            fillEmptyWork(work);
+            break;
+        }
+    }
+
+    return C2_OK;
+}
+
+c2_status_t C2GoldfishHevcDec::drain(uint32_t drainMode,
+                                    const std::shared_ptr<C2BlockPool> &pool) {
+    DDD("drainInternal because of drain");
+    return drainInternal(drainMode, pool, nullptr);
+}
+
+class C2GoldfishHevcDecFactory : public C2ComponentFactory {
+  public:
+    C2GoldfishHevcDecFactory()
+        : mHelper(std::static_pointer_cast<C2ReflectorHelper>(
+              GoldfishComponentStore::Create()->getParamReflector())) {}
+
+    virtual c2_status_t
+    createComponent(c2_node_id_t id,
+                    std::shared_ptr<C2Component> *const component,
+                    std::function<void(C2Component *)> deleter) override {
+        *component = std::shared_ptr<C2Component>(
+            new C2GoldfishHevcDec(
+                COMPONENT_NAME, id,
+                std::make_shared<C2GoldfishHevcDec::IntfImpl>(mHelper)),
+            deleter);
+        return C2_OK;
+    }
+
+    virtual c2_status_t createInterface(
+        c2_node_id_t id, std::shared_ptr<C2ComponentInterface> *const interface,
+        std::function<void(C2ComponentInterface *)> deleter) override {
+        *interface = std::shared_ptr<C2ComponentInterface>(
+            new SimpleInterface<C2GoldfishHevcDec::IntfImpl>(
+                COMPONENT_NAME, id,
+                std::make_shared<C2GoldfishHevcDec::IntfImpl>(mHelper)),
+            deleter);
+        return C2_OK;
+    }
+
+    virtual ~C2GoldfishHevcDecFactory() override = default;
+
+  private:
+    std::shared_ptr<C2ReflectorHelper> mHelper;
+};
+
+} // namespace android
+
+extern "C" ::C2ComponentFactory *CreateCodec2Factory() {
+    DDD("in %s", __func__);
+    return new ::android::C2GoldfishHevcDecFactory();
+}
+
+extern "C" void DestroyCodec2Factory(::C2ComponentFactory *factory) {
+    DDD("in %s", __func__);
+    delete factory;
+}
diff --git a/system/codecs/c2/decoders/hevcdec/C2GoldfishHevcDec.h b/system/codecs/c2/decoders/hevcdec/C2GoldfishHevcDec.h
new file mode 100644
index 0000000..bc3d65b
--- /dev/null
+++ b/system/codecs/c2/decoders/hevcdec/C2GoldfishHevcDec.h
@@ -0,0 +1,167 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_C2_SOFT_HEVC_DEC_H_
+#define ANDROID_C2_SOFT_HEVC_DEC_H_
+
+#include <sys/time.h>
+
+#include <media/stagefright/foundation/ColorUtils.h>
+
+#include "MediaHevcDecoder.h"
+#include "GoldfishHevcHelper.h"
+#include <SimpleC2Component.h>
+#include <atomic>
+#include <map>
+
+namespace android {
+
+#define ALIGN2(x) ((((x) + 1) >> 1) << 1)
+#define ALIGN8(x) ((((x) + 7) >> 3) << 3)
+#define ALIGN16(x) ((((x) + 15) >> 4) << 4)
+#define ALIGN32(x) ((((x) + 31) >> 5) << 5)
+#define MAX_NUM_CORES 4
+#define MIN(a, b) (((a) < (b)) ? (a) : (b))
+#define GETTIME(a, b) gettimeofday(a, b);
+#define TIME_DIFF(start, end, diff)                                            \
+    diff = (((end).tv_sec - (start).tv_sec) * 1000000) +                       \
+           ((end).tv_usec - (start).tv_usec);
+
+class C2GoldfishHevcDec : public SimpleC2Component {
+  public:
+    class IntfImpl;
+    C2GoldfishHevcDec(const char *name, c2_node_id_t id,
+                     const std::shared_ptr<IntfImpl> &intfImpl);
+    virtual ~C2GoldfishHevcDec();
+
+    // From SimpleC2Component
+    c2_status_t onInit() override;
+    c2_status_t onStop() override;
+    void onReset() override;
+    void onRelease() override;
+    c2_status_t onFlush_sm() override;
+    void process(const std::unique_ptr<C2Work> &work,
+                 const std::shared_ptr<C2BlockPool> &pool) override;
+    c2_status_t drain(uint32_t drainMode,
+                      const std::shared_ptr<C2BlockPool> &pool) override;
+
+  private:
+    std::unique_ptr<MediaHevcDecoder> mContext;
+    bool mEnableAndroidNativeBuffers{true};
+
+    void checkMode(const std::shared_ptr<C2BlockPool> &pool);
+    //    status_t createDecoder();
+    status_t createDecoder();
+    status_t setParams(size_t stride);
+    status_t initDecoder();
+    bool setDecodeArgs(C2ReadView *inBuffer, C2GraphicView *outBuffer,
+                       size_t inOffset, size_t inSize, uint32_t tsMarker);
+    c2_status_t ensureDecoderState(const std::shared_ptr<C2BlockPool> &pool);
+    void finishWork(uint64_t index, const std::unique_ptr<C2Work> &work);
+    status_t setFlushMode();
+    c2_status_t drainInternal(uint32_t drainMode,
+                              const std::shared_ptr<C2BlockPool> &pool,
+                              const std::unique_ptr<C2Work> &work);
+    status_t resetDecoder();
+    void resetPlugin();
+    void deleteContext();
+
+    std::shared_ptr<IntfImpl> mIntf;
+
+    void removePts(uint64_t pts);
+    void insertPts(uint32_t work_index, uint64_t pts);
+    uint64_t getWorkIndex(uint64_t pts);
+
+    // there are same pts matching to different work indices
+    // this happen during csd0/csd1 switching
+    std::map<uint64_t, uint64_t> mOldPts2Index;
+    std::map<uint64_t, uint64_t> mPts2Index;
+    std::map<uint64_t, uint64_t> mIndex2Pts;
+    uint64_t  mPts {0};
+
+    // TODO:This is not the right place for this enum. These should
+    // be part of c2-vndk so that they can be accessed by all video plugins
+    // until then, make them feel at home
+    enum {
+        kNotSupported,
+        kPreferBitstream,
+        kPreferContainer,
+    };
+
+    std::shared_ptr<C2GraphicBlock> mOutBlock;
+    uint8_t *mOutBufferFlush;
+
+    int mHostColorBufferId{-1};
+
+    void getVuiParams(hevc_image_t &img);
+    void copyImageData(hevc_image_t &img);
+
+    hevc_image_t mImg{};
+    uint32_t mConsumedBytes{0};
+    uint8_t *mInPBuffer{nullptr};
+    uint32_t mInPBufferSize;
+    uint32_t mInTsMarker;
+
+    // size_t mNumCores;
+    // uint32_t mOutputDelay;
+    uint32_t mWidth;
+    uint32_t mHeight;
+    uint32_t mStride;
+    bool mSignalledOutputEos;
+    bool mSignalledError;
+    bool mHeaderDecoded;
+    std::atomic_uint64_t mOutIndex;
+    // Color aspects. These are ISO values and are meant to detect changes in
+    // aspects to avoid converting them to C2 values for each frame
+    struct VuiColorAspects {
+        uint8_t primaries;
+        uint8_t transfer;
+        uint8_t coeffs;
+        uint8_t fullRange;
+
+        // default color aspects
+        VuiColorAspects()
+            : primaries(2), transfer(2), coeffs(2), fullRange(0) {}
+
+        bool operator==(const VuiColorAspects &o) {
+            return primaries == o.primaries && transfer == o.transfer &&
+                   coeffs == o.coeffs && fullRange == o.fullRange;
+        }
+    } mBitstreamColorAspects;
+
+    MetaDataColorAspects mSentMetadata = {1, 0, 0, 0};
+
+    void sendMetadata();
+
+    // profile
+    struct timeval mTimeStart;
+    struct timeval mTimeEnd;
+#ifdef FILE_DUMP_ENABLE
+    char mInFile[200];
+#endif /* FILE_DUMP_ENABLE */
+
+    std::vector<uint8_t> mCsd0;
+    std::vector<uint8_t> mCsd1;
+    void decodeHeaderAfterFlush();
+
+    std::unique_ptr<GoldfishHevcHelper> mHevcHelper;
+
+    C2_DO_NOT_COPY(C2GoldfishHevcDec);
+};
+
+} // namespace android
+
+#endif // ANDROID_C2_SOFT_HEVC_DEC_H_
diff --git a/system/codecs/c2/decoders/hevcdec/GoldfishHevcHelper.cpp b/system/codecs/c2/decoders/hevcdec/GoldfishHevcHelper.cpp
new file mode 100644
index 0000000..d3117a7
--- /dev/null
+++ b/system/codecs/c2/decoders/hevcdec/GoldfishHevcHelper.cpp
@@ -0,0 +1,319 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "GoldfishHevcHelper.h"
+
+#define LOG_TAG "GoldfishHevcHelper"
+#include <log/log.h>
+
+#include "ihevc_typedefs.h"
+#include "ihevcd_cxa.h"
+
+#define DEBUG 0
+#if DEBUG
+#define DDD(...) ALOGD(__VA_ARGS__)
+#else
+#define DDD(...) ((void)0)
+#endif
+
+
+#include <Codec2Mapper.h>
+
+#define ivdec_api_function ihevcd_cxa_api_function
+#define ivdext_create_ip_t ihevcd_cxa_create_ip_t
+#define ivdext_create_op_t ihevcd_cxa_create_op_t
+#define ivdext_delete_ip_t ihevcd_cxa_delete_ip_t
+#define ivdext_delete_op_t ihevcd_cxa_delete_op_t
+#define ivdext_ctl_set_num_cores_ip_t ihevcd_cxa_ctl_set_num_cores_ip_t
+#define ivdext_ctl_set_num_cores_op_t ihevcd_cxa_ctl_set_num_cores_op_t
+#define ivdext_ctl_get_vui_params_ip_t ihevcd_cxa_ctl_get_vui_params_ip_t
+#define ivdext_ctl_get_vui_params_op_t ihevcd_cxa_ctl_get_vui_params_op_t
+#define ALIGN128(x) ((((x) + 127) >> 7) << 7)
+#define MAX_NUM_CORES 4
+#define IVDEXT_CMD_CTL_SET_NUM_CORES                                           \
+    (IVD_CONTROL_API_COMMAND_TYPE_T) IHEVCD_CXA_CMD_CTL_SET_NUM_CORES
+#define MIN(a, b) (((a) < (b)) ? (a) : (b))
+
+namespace android {
+
+static void *ivd_aligned_malloc(void *ctxt, WORD32 alignment, WORD32 size) {
+    (void) ctxt;
+    return memalign(alignment, size);
+}
+
+static void ivd_aligned_free(void *ctxt, void *mem) {
+    (void) ctxt;
+    free(mem);
+}
+
+
+GoldfishHevcHelper::GoldfishHevcHelper(int w, int h):mWidth(w),mHeight(h) { createDecoder(); }
+
+GoldfishHevcHelper::~GoldfishHevcHelper() {
+    destroyDecoder();
+}
+
+void GoldfishHevcHelper::createDecoder() {
+    ivdext_create_ip_t s_create_ip = {};
+    ivdext_create_op_t s_create_op = {};
+
+    s_create_ip.s_ivd_create_ip_t.u4_size = sizeof(ivdext_create_ip_t);
+    s_create_ip.s_ivd_create_ip_t.e_cmd = IVD_CMD_CREATE;
+    s_create_ip.s_ivd_create_ip_t.u4_share_disp_buf = 0;
+    s_create_ip.s_ivd_create_ip_t.e_output_format = mIvColorformat;
+    s_create_ip.s_ivd_create_ip_t.pf_aligned_alloc = ivd_aligned_malloc;
+    s_create_ip.s_ivd_create_ip_t.pf_aligned_free = ivd_aligned_free;
+    s_create_ip.s_ivd_create_ip_t.pv_mem_ctxt = nullptr;
+    s_create_op.s_ivd_create_op_t.u4_size = sizeof(ivdext_create_op_t);
+    IV_API_CALL_STATUS_T status =
+        ivdec_api_function(mDecHandle, &s_create_ip, &s_create_op);
+    if (status != IV_SUCCESS) {
+        ALOGE("error in %s: 0x%x", __func__,
+              s_create_op.s_ivd_create_op_t.u4_error_code);
+        return;
+    }
+    mDecHandle = (iv_obj_t *)s_create_op.s_ivd_create_op_t.pv_handle;
+    mDecHandle->pv_fxns = (void *)ivdec_api_function;
+    mDecHandle->u4_size = sizeof(iv_obj_t);
+
+    mStride = ALIGN128(mWidth);
+
+    setNumCores();
+}
+
+void GoldfishHevcHelper::destroyDecoder() {
+    if (mDecHandle) {
+        ivdext_delete_ip_t s_delete_ip = {};
+        ivdext_delete_op_t s_delete_op = {};
+
+        s_delete_ip.s_ivd_delete_ip_t.u4_size = sizeof(ivdext_delete_ip_t);
+        s_delete_ip.s_ivd_delete_ip_t.e_cmd = IVD_CMD_DELETE;
+        s_delete_op.s_ivd_delete_op_t.u4_size = sizeof(ivdext_delete_op_t);
+        IV_API_CALL_STATUS_T status =
+            ivdec_api_function(mDecHandle, &s_delete_ip, &s_delete_op);
+        if (status != IV_SUCCESS) {
+            ALOGE("error in %s: 0x%x", __func__,
+                  s_delete_op.s_ivd_delete_op_t.u4_error_code);
+        }
+        mDecHandle = nullptr;
+    }
+}
+
+void GoldfishHevcHelper::setNumCores() {
+    ivdext_ctl_set_num_cores_ip_t s_set_num_cores_ip = {};
+    ivdext_ctl_set_num_cores_op_t s_set_num_cores_op = {};
+
+    s_set_num_cores_ip.u4_size = sizeof(ivdext_ctl_set_num_cores_ip_t);
+    s_set_num_cores_ip.e_cmd = IVD_CMD_VIDEO_CTL;
+    s_set_num_cores_ip.e_sub_cmd = IVDEXT_CMD_CTL_SET_NUM_CORES;
+    s_set_num_cores_ip.u4_num_cores = mNumCores;
+    s_set_num_cores_op.u4_size = sizeof(ivdext_ctl_set_num_cores_op_t);
+    IV_API_CALL_STATUS_T status = ivdec_api_function(
+        mDecHandle, &s_set_num_cores_ip, &s_set_num_cores_op);
+    if (IV_SUCCESS != status) {
+        DDD("error in %s: 0x%x", __func__, s_set_num_cores_op.u4_error_code);
+    }
+}
+
+void GoldfishHevcHelper::resetDecoder() {
+    ivd_ctl_reset_ip_t s_reset_ip = {};
+    ivd_ctl_reset_op_t s_reset_op = {};
+
+    s_reset_ip.u4_size = sizeof(ivd_ctl_reset_ip_t);
+    s_reset_ip.e_cmd = IVD_CMD_VIDEO_CTL;
+    s_reset_ip.e_sub_cmd = IVD_CMD_CTL_RESET;
+    s_reset_op.u4_size = sizeof(ivd_ctl_reset_op_t);
+    IV_API_CALL_STATUS_T status =
+        ivdec_api_function(mDecHandle, &s_reset_ip, &s_reset_op);
+    if (IV_SUCCESS != status) {
+        ALOGE("error in %s: 0x%x", __func__, s_reset_op.u4_error_code);
+    }
+    setNumCores();
+}
+
+void GoldfishHevcHelper::setParams(size_t stride,
+                                   IVD_VIDEO_DECODE_MODE_T dec_mode) {
+    ihevcd_cxa_ctl_set_config_ip_t s_hevcd_set_dyn_params_ip = {};
+    ihevcd_cxa_ctl_set_config_op_t s_hevcd_set_dyn_params_op = {};
+    ivd_ctl_set_config_ip_t *ps_set_dyn_params_ip =
+        &s_hevcd_set_dyn_params_ip.s_ivd_ctl_set_config_ip_t;
+    ivd_ctl_set_config_op_t *ps_set_dyn_params_op =
+        &s_hevcd_set_dyn_params_op.s_ivd_ctl_set_config_op_t;
+
+    ps_set_dyn_params_ip->u4_size = sizeof(ihevcd_cxa_ctl_set_config_ip_t);
+    ps_set_dyn_params_ip->e_cmd = IVD_CMD_VIDEO_CTL;
+    ps_set_dyn_params_ip->e_sub_cmd = IVD_CMD_CTL_SETPARAMS;
+    ps_set_dyn_params_ip->u4_disp_wd = (UWORD32)stride;
+    ps_set_dyn_params_ip->e_frm_skip_mode = IVD_SKIP_NONE;
+    ps_set_dyn_params_ip->e_frm_out_mode = IVD_DISPLAY_FRAME_OUT;
+    ps_set_dyn_params_ip->e_vid_dec_mode = dec_mode;
+    ps_set_dyn_params_op->u4_size = sizeof(ihevcd_cxa_ctl_set_config_op_t);
+    IV_API_CALL_STATUS_T status = ivdec_api_function(
+        mDecHandle, ps_set_dyn_params_ip, ps_set_dyn_params_op);
+    if (status != IV_SUCCESS) {
+        ALOGE("error in %s: 0x%x", __func__,
+              ps_set_dyn_params_op->u4_error_code);
+    }
+}
+
+bool GoldfishHevcHelper::isVpsFrame(const uint8_t* frame, int inSize) {
+    if (inSize < 5) return false;
+    if (frame[0] == 0 && frame[1] == 0 && frame[2] == 0 && frame[3] == 1) {
+        const bool forbiddenBitIsInvalid = 0x80 & frame[4];
+        if (forbiddenBitIsInvalid) {
+            return false;
+        }
+        // nalu type is the lower 6 bits after shiftting to right 1 bit
+        uint8_t naluType = 0x3f & (frame[4] >> 1);
+        if (naluType == 32
+            || naluType == 33
+            || naluType == 34
+                ) return true;
+        else return false;
+    } else {
+        return false;
+    }
+}
+
+bool GoldfishHevcHelper::decodeHeader(const uint8_t *frame, int inSize,
+                                      bool &helperstatus) {
+    helperstatus = true;
+    // should we check the header for vps/sps/pps frame ? otherwise
+    // there is no point calling decoder
+    if (!isVpsFrame(frame, inSize)) {
+        DDD("could not find valid vps frame");
+        return false;
+    } else {
+        DDD("found valid vps frame");
+    }
+
+    ihevcd_cxa_video_decode_ip_t s_hevcd_decode_ip = {};
+    ihevcd_cxa_video_decode_op_t s_hevcd_decode_op = {};
+    ivd_video_decode_ip_t *ps_decode_ip =
+        &s_hevcd_decode_ip.s_ivd_video_decode_ip_t;
+    ivd_video_decode_op_t *ps_decode_op =
+        &s_hevcd_decode_op.s_ivd_video_decode_op_t;
+
+    // setup input/output arguments to decoder
+    setDecodeArgs(ps_decode_ip, ps_decode_op, frame, mStride,
+            0, // offset
+            inSize, // size
+            0 // time-stamp, does not matter
+            );
+
+    setParams(mStride, IVD_DECODE_HEADER);
+
+    // now kick off the decoding
+    IV_API_CALL_STATUS_T status = ivdec_api_function(mDecHandle, ps_decode_ip, ps_decode_op);
+    if (status != IV_SUCCESS) {
+        ALOGE("failed to call decoder function for header\n");
+        ALOGE("error in %s: 0x%x", __func__,
+              ps_decode_op->u4_error_code);
+        helperstatus = false;
+        return false;
+    }
+
+    if (IVD_RES_CHANGED == (ps_decode_op->u4_error_code & IVD_ERROR_MASK)) {
+        DDD("resolution changed, reset decoder");
+        resetDecoder();
+        setParams(mStride, IVD_DECODE_HEADER);
+        ivdec_api_function(mDecHandle, ps_decode_ip, ps_decode_op);
+    }
+
+    // get the w/h and update
+    if (0 < ps_decode_op->u4_pic_wd && 0 < ps_decode_op->u4_pic_ht) {
+        DDD("success decode w/h %d %d", ps_decode_op->u4_pic_wd , ps_decode_op->u4_pic_ht);
+        DDD("existing w/h %d %d", mWidth, mHeight);
+        if (ps_decode_op->u4_pic_wd != mWidth ||  ps_decode_op->u4_pic_ht != mHeight) {
+            mWidth = ps_decode_op->u4_pic_wd;
+            mHeight = ps_decode_op->u4_pic_ht;
+            return true;
+        } else {
+            DDD("success decode w/h, but they are the same %d %d", ps_decode_op->u4_pic_wd , ps_decode_op->u4_pic_ht);
+        }
+    } else {
+        ALOGE("could not decode w/h");
+    }
+
+    // get output delay
+    if (ps_decode_op->i4_reorder_depth >= 0) {
+        if (mOutputDelay != ps_decode_op->i4_reorder_depth) {
+            mOutputDelay = ps_decode_op->i4_reorder_depth;
+            DDD("New Output delay %d ", mOutputDelay);
+        } else {
+            DDD("same Output delay %d ", mOutputDelay);
+        }
+    }
+
+    return false;
+}
+
+bool GoldfishHevcHelper::setDecodeArgs(ivd_video_decode_ip_t *ps_decode_ip,
+                                       ivd_video_decode_op_t *ps_decode_op,
+                                       const uint8_t *inBuffer,
+                                       uint32_t displayStride, size_t inOffset,
+                                       size_t inSize, uint32_t tsMarker) {
+    uint32_t displayHeight = mHeight;
+    size_t lumaSize = displayStride * displayHeight;
+    size_t chromaSize = lumaSize >> 2;
+
+    if (mStride != displayStride) {
+        mStride = displayStride;
+    }
+
+    // force decoder to always decode header and get dimensions,
+    // hope this will be quick and cheap
+    setParams(mStride, IVD_DECODE_HEADER);
+
+    ps_decode_ip->u4_size = sizeof(ihevcd_cxa_video_decode_ip_t);
+    ps_decode_ip->e_cmd = IVD_CMD_VIDEO_DECODE;
+    if (inBuffer) {
+        ps_decode_ip->u4_ts = tsMarker;
+        ps_decode_ip->pv_stream_buffer = const_cast<uint8_t *>(inBuffer) + inOffset;
+        ps_decode_ip->u4_num_Bytes = inSize;
+    } else {
+        ps_decode_ip->u4_ts = 0;
+        ps_decode_ip->pv_stream_buffer = nullptr;
+        ps_decode_ip->u4_num_Bytes = 0;
+    }
+    DDD("setting pv_stream_buffer 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x",
+            ((uint8_t*)(ps_decode_ip->pv_stream_buffer))[0],
+            ((uint8_t*)(ps_decode_ip->pv_stream_buffer))[1],
+            ((uint8_t*)(ps_decode_ip->pv_stream_buffer))[2],
+            ((uint8_t*)(ps_decode_ip->pv_stream_buffer))[3],
+            ((uint8_t*)(ps_decode_ip->pv_stream_buffer))[4],
+            ((uint8_t*)(ps_decode_ip->pv_stream_buffer))[5],
+            ((uint8_t*)(ps_decode_ip->pv_stream_buffer))[6],
+            ((uint8_t*)(ps_decode_ip->pv_stream_buffer))[7]
+            );
+    DDD("input bytes %d", ps_decode_ip->u4_num_Bytes);
+
+    ps_decode_ip->s_out_buffer.u4_min_out_buf_size[0] = lumaSize;
+    ps_decode_ip->s_out_buffer.u4_min_out_buf_size[1] = chromaSize;
+    ps_decode_ip->s_out_buffer.u4_min_out_buf_size[2] = chromaSize;
+    {
+        ps_decode_ip->s_out_buffer.pu1_bufs[0] = nullptr;
+        ps_decode_ip->s_out_buffer.pu1_bufs[1] = nullptr;
+        ps_decode_ip->s_out_buffer.pu1_bufs[2] = nullptr;
+    }
+    ps_decode_ip->s_out_buffer.u4_num_bufs = 3;
+    ps_decode_op->u4_size = sizeof(ihevcd_cxa_video_decode_op_t);
+    ps_decode_op->u4_output_present = 0;
+
+    return true;
+}
+
+} // namespace android
diff --git a/system/codecs/c2/decoders/hevcdec/GoldfishHevcHelper.h b/system/codecs/c2/decoders/hevcdec/GoldfishHevcHelper.h
new file mode 100644
index 0000000..36a496b
--- /dev/null
+++ b/system/codecs/c2/decoders/hevcdec/GoldfishHevcHelper.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef GOLDFISH_HEVC_HELPER_H_
+#define GOLDFISH_HEVC_HELPER_H_
+
+#include <inttypes.h>
+#include "ihevc_typedefs.h"
+#include "ihevcd_cxa.h"
+
+
+namespace android {
+
+// this class is just to provide some functions to decode header
+// so that we know w/h of each sps
+class GoldfishHevcHelper {
+  public:
+    GoldfishHevcHelper(int w, int h);
+    ~GoldfishHevcHelper();
+
+    // check whether the frame is vps; typical hevc will have
+    // a frame that is vps/sps/pps together
+    static bool isVpsFrame(const uint8_t* frame, int inSize);
+  public:
+    // return true if decoding finds out w/h changed;
+    // otherwise false
+   bool decodeHeader(const uint8_t *frame, int inSize, bool &status);
+   int getWidth() const { return mWidth; }
+   int getHeight() const { return mHeight; }
+
+  private:
+    void createDecoder();
+    void destroyDecoder();
+    void resetDecoder();
+    void setNumCores();
+    void setParams(size_t stride, IVD_VIDEO_DECODE_MODE_T dec_mode);
+    bool setDecodeArgs(ivd_video_decode_ip_t *ps_decode_ip,
+                       ivd_video_decode_op_t *ps_decode_op,
+                       const uint8_t *inBuffer, uint32_t displayStride,
+                       size_t inOffset, size_t inSize, uint32_t tsMarker);
+
+  private:
+    iv_obj_t *mDecHandle = nullptr;
+    int mWidth = 320;
+    int mHeight = 240;
+    int mNumCores = 1;
+    int mStride = 16;
+    int mOutputDelay = 8; // default
+    IV_COLOR_FORMAT_T mIvColorformat = IV_YUV_420P;
+};
+
+} // namespace android
+#endif
diff --git a/system/codecs/c2/decoders/hevcdec/MediaHevcDecoder.cpp b/system/codecs/c2/decoders/hevcdec/MediaHevcDecoder.cpp
new file mode 100644
index 0000000..f1bc356
--- /dev/null
+++ b/system/codecs/c2/decoders/hevcdec/MediaHevcDecoder.cpp
@@ -0,0 +1,229 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <utils/Log.h>
+
+#define DEBUG 0
+#if DEBUG
+#define DDD(...) ALOGD(__VA_ARGS__)
+#else
+#define DDD(...) ((void)0)
+#endif
+
+#include "MediaHevcDecoder.h"
+#include "goldfish_media_utils.h"
+#include <string.h>
+
+MediaHevcDecoder::MediaHevcDecoder(RenderMode renderMode)
+    : mRenderMode(renderMode) {
+    if (renderMode == RenderMode::RENDER_BY_HOST_GPU) {
+        mVersion = 200;
+    } else if (renderMode == RenderMode::RENDER_BY_GUEST_CPU) {
+        mVersion = 100;
+    }
+}
+
+void MediaHevcDecoder::initHevcContext(unsigned int width, unsigned int height,
+                                       unsigned int outWidth,
+                                       unsigned int outHeight,
+                                       PixelFormat pixFmt) {
+    auto transport = GoldfishMediaTransport::getInstance();
+    if (!mHasAddressSpaceMemory) {
+        int slot = transport->getMemorySlot();
+        if (slot < 0) {
+            ALOGE("ERROR: Failed to initHevcContext: cannot get memory slot");
+            return;
+        }
+        mSlot = slot;
+        mAddressOffSet = static_cast<unsigned int>(mSlot) * (1 << 20);
+        DDD("got memory lot %d addrr %x", mSlot, mAddressOffSet);
+        mHasAddressSpaceMemory = true;
+    }
+    transport->writeParam(mVersion, 0, mAddressOffSet);
+    transport->writeParam(width, 1, mAddressOffSet);
+    transport->writeParam(height, 2, mAddressOffSet);
+    transport->writeParam(outWidth, 3, mAddressOffSet);
+    transport->writeParam(outHeight, 4, mAddressOffSet);
+    transport->writeParam(static_cast<uint64_t>(pixFmt), 5, mAddressOffSet);
+    transport->sendOperation(MediaCodecType::HevcCodec,
+                             MediaOperation::InitContext, mAddressOffSet);
+    auto *retptr = transport->getReturnAddr(mAddressOffSet);
+    mHostHandle = *(uint64_t *)(retptr);
+    DDD("initHevcContext: got handle to host %lld", mHostHandle);
+}
+
+void MediaHevcDecoder::resetHevcContext(unsigned int width, unsigned int height,
+                                        unsigned int outWidth,
+                                        unsigned int outHeight,
+                                        PixelFormat pixFmt) {
+    auto transport = GoldfishMediaTransport::getInstance();
+    if (!mHasAddressSpaceMemory) {
+        ALOGE("%s no address space memory", __func__);
+        return;
+    }
+    transport->writeParam((uint64_t)mHostHandle, 0, mAddressOffSet);
+    transport->writeParam(width, 1, mAddressOffSet);
+    transport->writeParam(height, 2, mAddressOffSet);
+    transport->writeParam(outWidth, 3, mAddressOffSet);
+    transport->writeParam(outHeight, 4, mAddressOffSet);
+    transport->writeParam(static_cast<uint64_t>(pixFmt), 5, mAddressOffSet);
+    transport->sendOperation(MediaCodecType::HevcCodec, MediaOperation::Reset,
+                             mAddressOffSet);
+    DDD("resetHevcContext: done");
+}
+
+void MediaHevcDecoder::destroyHevcContext() {
+
+    DDD("return memory lot %d addrr %x", (int)(mAddressOffSet >> 23),
+        mAddressOffSet);
+    auto transport = GoldfishMediaTransport::getInstance();
+    transport->writeParam((uint64_t)mHostHandle, 0, mAddressOffSet);
+    transport->sendOperation(MediaCodecType::HevcCodec,
+                             MediaOperation::DestroyContext, mAddressOffSet);
+    transport->returnMemorySlot(mSlot);
+    mHasAddressSpaceMemory = false;
+}
+
+hevc_result_t MediaHevcDecoder::decodeFrame(uint8_t *img, size_t szBytes,
+                                            uint64_t pts) {
+    DDD("decode frame: use handle to host %lld", mHostHandle);
+    hevc_result_t res = {0, 0};
+    if (!mHasAddressSpaceMemory) {
+        ALOGE("%s no address space memory", __func__);
+        return res;
+    }
+    auto transport = GoldfishMediaTransport::getInstance();
+    uint8_t *hostSrc = transport->getInputAddr(mAddressOffSet);
+    if (img != nullptr && szBytes > 0) {
+        memcpy(hostSrc, img, szBytes);
+    }
+    transport->writeParam((uint64_t)mHostHandle, 0, mAddressOffSet);
+    transport->writeParam(transport->offsetOf((uint64_t)(hostSrc)) -
+                              mAddressOffSet,
+                          1, mAddressOffSet);
+    transport->writeParam((uint64_t)szBytes, 2, mAddressOffSet);
+    transport->writeParam((uint64_t)pts, 3, mAddressOffSet);
+    transport->sendOperation(MediaCodecType::HevcCodec,
+                             MediaOperation::DecodeImage, mAddressOffSet);
+
+    auto *retptr = transport->getReturnAddr(mAddressOffSet);
+    res.bytesProcessed = *(uint64_t *)(retptr);
+    res.ret = *(int *)(retptr + 8);
+
+    return res;
+}
+
+void MediaHevcDecoder::sendMetadata(MetaDataColorAspects *ptr) {
+    DDD("send metadata to host %p", ptr);
+    if (!mHasAddressSpaceMemory) {
+        ALOGE("%s no address space memory", __func__);
+        return;
+    }
+    MetaDataColorAspects& meta = *ptr;
+    auto transport = GoldfishMediaTransport::getInstance();
+    transport->writeParam((uint64_t)mHostHandle, 0, mAddressOffSet);
+    transport->writeParam(meta.type, 1, mAddressOffSet);
+    transport->writeParam(meta.primaries, 2, mAddressOffSet);
+    transport->writeParam(meta.range, 3, mAddressOffSet);
+    transport->writeParam(meta.transfer, 4, mAddressOffSet);
+    transport->sendOperation(MediaCodecType::HevcCodec, MediaOperation::SendMetadata, mAddressOffSet);
+}
+
+void MediaHevcDecoder::flush() {
+    if (!mHasAddressSpaceMemory) {
+        ALOGE("%s no address space memory", __func__);
+        return;
+    }
+    DDD("flush: use handle to host %lld", mHostHandle);
+    auto transport = GoldfishMediaTransport::getInstance();
+    transport->writeParam((uint64_t)mHostHandle, 0, mAddressOffSet);
+    transport->sendOperation(MediaCodecType::HevcCodec, MediaOperation::Flush,
+                             mAddressOffSet);
+}
+
+hevc_image_t MediaHevcDecoder::getImage() {
+    DDD("getImage: use handle to host %lld", mHostHandle);
+    hevc_image_t res{};
+    if (!mHasAddressSpaceMemory) {
+        ALOGE("%s no address space memory", __func__);
+        return res;
+    }
+    auto transport = GoldfishMediaTransport::getInstance();
+    uint8_t *dst = transport->getInputAddr(
+        mAddressOffSet); // Note: reuse the same addr for input and output
+    transport->writeParam((uint64_t)mHostHandle, 0, mAddressOffSet);
+    transport->writeParam(transport->offsetOf((uint64_t)(dst)) - mAddressOffSet,
+                          1, mAddressOffSet);
+    transport->writeParam(-1, 2, mAddressOffSet);
+    transport->sendOperation(MediaCodecType::HevcCodec,
+                             MediaOperation::GetImage, mAddressOffSet);
+    auto *retptr = transport->getReturnAddr(mAddressOffSet);
+    res.ret = *(int *)(retptr);
+    if (res.ret >= 0) {
+        res.data = dst;
+        res.width = *(uint32_t *)(retptr + 8);
+        res.height = *(uint32_t *)(retptr + 16);
+        res.pts = *(uint64_t *)(retptr + 24);
+        res.color_primaries = *(uint32_t *)(retptr + 32);
+        res.color_range = *(uint32_t *)(retptr + 40);
+        res.color_trc = *(uint32_t *)(retptr + 48);
+        res.colorspace = *(uint32_t *)(retptr + 56);
+    } else if (res.ret == (int)(Err::DecoderRestarted)) {
+        res.width = *(uint32_t *)(retptr + 8);
+        res.height = *(uint32_t *)(retptr + 16);
+    }
+    return res;
+}
+
+hevc_image_t
+MediaHevcDecoder::renderOnHostAndReturnImageMetadata(int hostColorBufferId) {
+    DDD("%s: use handle to host %lld", __func__, mHostHandle);
+    hevc_image_t res{};
+    if (hostColorBufferId < 0) {
+        ALOGE("%s negative color buffer id %d", __func__, hostColorBufferId);
+        return res;
+    }
+    DDD("%s send color buffer id %d", __func__, hostColorBufferId);
+    if (!mHasAddressSpaceMemory) {
+        ALOGE("%s no address space memory", __func__);
+        return res;
+    }
+    auto transport = GoldfishMediaTransport::getInstance();
+    uint8_t *dst = transport->getInputAddr(
+        mAddressOffSet); // Note: reuse the same addr for input and output
+    transport->writeParam((uint64_t)mHostHandle, 0, mAddressOffSet);
+    transport->writeParam(transport->offsetOf((uint64_t)(dst)) - mAddressOffSet,
+                          1, mAddressOffSet);
+    transport->writeParam((uint64_t)hostColorBufferId, 2, mAddressOffSet);
+    transport->sendOperation(MediaCodecType::HevcCodec,
+                             MediaOperation::GetImage, mAddressOffSet);
+    auto *retptr = transport->getReturnAddr(mAddressOffSet);
+    res.ret = *(int *)(retptr);
+    if (res.ret >= 0) {
+        res.data = dst; // note: the data could be junk
+        res.width = *(uint32_t *)(retptr + 8);
+        res.height = *(uint32_t *)(retptr + 16);
+        res.pts = *(uint64_t *)(retptr + 24);
+        res.color_primaries = *(uint32_t *)(retptr + 32);
+        res.color_range = *(uint32_t *)(retptr + 40);
+        res.color_trc = *(uint32_t *)(retptr + 48);
+        res.colorspace = *(uint32_t *)(retptr + 56);
+    } else if (res.ret == (int)(Err::DecoderRestarted)) {
+        res.width = *(uint32_t *)(retptr + 8);
+        res.height = *(uint32_t *)(retptr + 16);
+    }
+    return res;
+}
diff --git a/system/codecs/c2/decoders/hevcdec/MediaHevcDecoder.h b/system/codecs/c2/decoders/hevcdec/MediaHevcDecoder.h
new file mode 100644
index 0000000..878950e
--- /dev/null
+++ b/system/codecs/c2/decoders/hevcdec/MediaHevcDecoder.h
@@ -0,0 +1,98 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef GOLDFISH_MEDIA_Hevc_DEC_H_
+#define GOLDFISH_MEDIA_Hevc_DEC_H_
+
+#include "goldfish_media_utils.h"
+
+struct hevc_init_result_t {
+    uint64_t host_handle;
+    int ret;
+};
+
+struct hevc_result_t {
+    int ret;
+    uint64_t bytesProcessed;
+};
+
+struct hevc_image_t {
+    const uint8_t *data;
+    uint32_t width;
+    uint32_t height;
+    uint64_t pts; // presentation time stamp
+    uint64_t color_primaries;
+    uint64_t color_range;
+    uint64_t color_trc;
+    uint64_t colorspace;
+    // on success, |ret| will indicate the size of |data|.
+    // If failed, |ret| will contain some negative error code.
+    int ret;
+};
+
+enum class RenderMode {
+    RENDER_BY_HOST_GPU = 1,
+    RENDER_BY_GUEST_CPU = 2,
+};
+
+class MediaHevcDecoder {
+    uint64_t mHostHandle = 0;
+    uint32_t mVersion = 100;
+    RenderMode mRenderMode = RenderMode::RENDER_BY_GUEST_CPU;
+
+    bool mHasAddressSpaceMemory = false;
+    uint64_t mAddressOffSet = 0;
+    int mSlot = -1;
+
+  public:
+    MediaHevcDecoder(RenderMode renderMode);
+    virtual ~MediaHevcDecoder() = default;
+
+    enum class PixelFormat : uint8_t {
+        YUV420P = 0,
+        UYVY422 = 1,
+        BGRA8888 = 2,
+    };
+
+    enum class Err : int {
+        NoErr = 0,
+        NoDecodedFrame = -1,
+        InitContextFailed = -2,
+        DecoderRestarted = -3,
+        NALUIgnored = -4,
+    };
+
+    bool getAddressSpaceMemory();
+    void initHevcContext(unsigned int width, unsigned int height,
+                         unsigned int outWidth, unsigned int outHeight,
+                         PixelFormat pixFmt);
+    void resetHevcContext(unsigned int width, unsigned int height,
+                          unsigned int outWidth, unsigned int outHeight,
+                          PixelFormat pixFmt);
+    void destroyHevcContext();
+    hevc_result_t decodeFrame(uint8_t *img, size_t szBytes, uint64_t pts);
+    void flush();
+    // ask host to copy image data back to guest, with image metadata
+    // to guest as well
+    hevc_image_t getImage();
+    // ask host to render to hostColorBufferId, return only image metadata back
+    // to guest
+    hevc_image_t renderOnHostAndReturnImageMetadata(int hostColorBufferId);
+
+    void sendMetadata(MetaDataColorAspects *ptr);
+
+};
+#endif
diff --git a/system/codecs/c2/decoders/vpxdec/Android.bp b/system/codecs/c2/decoders/vpxdec/Android.bp
new file mode 100644
index 0000000..7be2d50
--- /dev/null
+++ b/system/codecs/c2/decoders/vpxdec/Android.bp
@@ -0,0 +1,57 @@
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "device_generic_goldfish-opengl_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["device_generic_goldfish-opengl_license"],
+}
+
+cc_library_shared {
+    name: "libcodec2_goldfish_vp9dec",
+    vendor: true,
+    defaults: [
+        "libcodec2_goldfish-defaults",
+    ],
+
+    srcs: ["C2GoldfishVpxDec.cpp",
+        "goldfish_vpx_impl.cpp",
+    ],
+
+    shared_libs: ["libvpx",
+	    "[email protected]",
+		"[email protected]",
+         "libgoldfish_codec2_store",
+    ],
+
+   header_libs: [
+    "libgralloc_cb.ranchu",
+    ],
+
+    cflags: [
+        "-DVP9",
+    ],
+}
+
+cc_library_shared {
+    name: "libcodec2_goldfish_vp8dec",
+    vendor: true,
+    defaults: [
+        "libcodec2_goldfish-defaults",
+    ],
+
+    srcs: ["C2GoldfishVpxDec.cpp",
+        "goldfish_vpx_impl.cpp",
+    ],
+
+
+   header_libs: [
+    "libgralloc_cb.ranchu",
+    ],
+
+    shared_libs: ["libvpx",
+	    "[email protected]",
+		"[email protected]",
+         "libgoldfish_codec2_store",
+    ],
+}
diff --git a/system/codecs/c2/decoders/vpxdec/C2GoldfishVpxDec.cpp b/system/codecs/c2/decoders/vpxdec/C2GoldfishVpxDec.cpp
new file mode 100644
index 0000000..6e6c651
--- /dev/null
+++ b/system/codecs/c2/decoders/vpxdec/C2GoldfishVpxDec.cpp
@@ -0,0 +1,937 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "C2GoldfishVpxDec"
+#include <log/log.h>
+
+#include <algorithm>
+
+#include <media/stagefright/foundation/AUtils.h>
+#include <media/stagefright/foundation/MediaDefs.h>
+
+#include <C2AllocatorGralloc.h>
+#include <C2PlatformSupport.h>
+//#include <android/hardware/graphics/common/1.0/types.h>
+
+#include <android/hardware/graphics/allocator/3.0/IAllocator.h>
+#include <android/hardware/graphics/mapper/3.0/IMapper.h>
+#include <hidl/LegacySupport.h>
+
+#include <C2Debug.h>
+#include <C2PlatformSupport.h>
+#include <SimpleC2Interface.h>
+#include <goldfish_codec2/store/GoldfishComponentStore.h>
+
+#include <gralloc_cb_bp.h>
+
+#include <color_buffer_utils.h>
+
+#include "C2GoldfishVpxDec.h"
+
+#define DEBUG 0
+#if DEBUG
+#define DDD(...) ALOGW(__VA_ARGS__)
+#else
+#define DDD(...) ((void)0)
+#endif
+using ::android::hardware::graphics::common::V1_0::BufferUsage;
+using ::android::hardware::graphics::common::V1_2::PixelFormat;
+
+namespace android {
+constexpr size_t kMinInputBufferSize = 6 * 1024 * 1024;
+#ifdef VP9
+constexpr char COMPONENT_NAME[] = "c2.goldfish.vp9.decoder";
+#else
+constexpr char COMPONENT_NAME[] = "c2.goldfish.vp8.decoder";
+#endif
+
+class C2GoldfishVpxDec::IntfImpl : public SimpleInterface<void>::BaseParams {
+  public:
+    explicit IntfImpl(const std::shared_ptr<C2ReflectorHelper> &helper)
+        : SimpleInterface<void>::BaseParams(helper, COMPONENT_NAME,
+                                            C2Component::KIND_DECODER,
+                                            C2Component::DOMAIN_VIDEO,
+#ifdef VP9
+                                            MEDIA_MIMETYPE_VIDEO_VP9
+#else
+                                            MEDIA_MIMETYPE_VIDEO_VP8
+#endif
+          ) {
+        DDD("calling IntfImpl now helper %p", helper.get());
+        noPrivateBuffers(); // TODO: account for our buffers here
+        noInputReferences();
+        noOutputReferences();
+        noInputLatency();
+        noTimeStretch();
+
+        // TODO: output latency and reordering
+
+        addParameter(DefineParam(mAttrib, C2_PARAMKEY_COMPONENT_ATTRIBUTES)
+                         .withConstValue(new C2ComponentAttributesSetting(
+                             C2Component::ATTRIB_IS_TEMPORAL))
+                         .build());
+
+        addParameter(
+            DefineParam(mSize, C2_PARAMKEY_PICTURE_SIZE)
+                .withDefault(new C2StreamPictureSizeInfo::output(0u, 320, 240))
+                .withFields({
+                    C2F(mSize, width).inRange(2, 4096, 2),
+                    C2F(mSize, height).inRange(2, 4096, 2),
+                })
+                .withSetter(SizeSetter)
+                .build());
+
+#ifdef VP9
+        // TODO: Add C2Config::PROFILE_VP9_2HDR ??
+        addParameter(
+            DefineParam(mProfileLevel, C2_PARAMKEY_PROFILE_LEVEL)
+                .withDefault(new C2StreamProfileLevelInfo::input(
+                    0u, C2Config::PROFILE_VP9_0, C2Config::LEVEL_VP9_5))
+                .withFields({C2F(mProfileLevel, profile)
+                                 .oneOf({C2Config::PROFILE_VP9_0,
+                                         C2Config::PROFILE_VP9_2}),
+                             C2F(mProfileLevel, level)
+                                 .oneOf({
+                                     C2Config::LEVEL_VP9_1,
+                                     C2Config::LEVEL_VP9_1_1,
+                                     C2Config::LEVEL_VP9_2,
+                                     C2Config::LEVEL_VP9_2_1,
+                                     C2Config::LEVEL_VP9_3,
+                                     C2Config::LEVEL_VP9_3_1,
+                                     C2Config::LEVEL_VP9_4,
+                                     C2Config::LEVEL_VP9_4_1,
+                                     C2Config::LEVEL_VP9_5,
+                                 })})
+                .withSetter(ProfileLevelSetter, mSize)
+                .build());
+
+        mHdr10PlusInfoInput = C2StreamHdr10PlusInfo::input::AllocShared(0);
+        addParameter(
+            DefineParam(mHdr10PlusInfoInput, C2_PARAMKEY_INPUT_HDR10_PLUS_INFO)
+                .withDefault(mHdr10PlusInfoInput)
+                .withFields({
+                    C2F(mHdr10PlusInfoInput, m.value).any(),
+                })
+                .withSetter(Hdr10PlusInfoInputSetter)
+                .build());
+
+        mHdr10PlusInfoOutput = C2StreamHdr10PlusInfo::output::AllocShared(0);
+        addParameter(DefineParam(mHdr10PlusInfoOutput,
+                                 C2_PARAMKEY_OUTPUT_HDR10_PLUS_INFO)
+                         .withDefault(mHdr10PlusInfoOutput)
+                         .withFields({
+                             C2F(mHdr10PlusInfoOutput, m.value).any(),
+                         })
+                         .withSetter(Hdr10PlusInfoOutputSetter)
+                         .build());
+
+#if 0
+        // sample BT.2020 static info
+        mHdrStaticInfo = std::make_shared<C2StreamHdrStaticInfo::output>();
+        mHdrStaticInfo->mastering = {
+            .red   = { .x = 0.708,  .y = 0.292 },
+            .green = { .x = 0.170,  .y = 0.797 },
+            .blue  = { .x = 0.131,  .y = 0.046 },
+            .white = { .x = 0.3127, .y = 0.3290 },
+            .maxLuminance = 1000,
+            .minLuminance = 0.1,
+        };
+        mHdrStaticInfo->maxCll = 1000;
+        mHdrStaticInfo->maxFall = 120;
+
+        mHdrStaticInfo->maxLuminance = 0; // disable static info
+
+        helper->addStructDescriptors<C2MasteringDisplayColorVolumeStruct, C2ColorXyStruct>();
+        addParameter(
+                DefineParam(mHdrStaticInfo, C2_PARAMKEY_HDR_STATIC_INFO)
+                .withDefault(mHdrStaticInfo)
+                .withFields({
+                    C2F(mHdrStaticInfo, mastering.red.x).inRange(0, 1),
+                    // TODO
+                })
+                .withSetter(HdrStaticInfoSetter)
+                .build());
+#endif
+#else
+        addParameter(
+            DefineParam(mProfileLevel, C2_PARAMKEY_PROFILE_LEVEL)
+                .withConstValue(new C2StreamProfileLevelInfo::input(
+                    0u, C2Config::PROFILE_UNUSED, C2Config::LEVEL_UNUSED))
+                .build());
+#endif
+
+        addParameter(DefineParam(mMaxSize, C2_PARAMKEY_MAX_PICTURE_SIZE)
+                         .withDefault(new C2StreamMaxPictureSizeTuning::output(
+                             0u, 320, 240))
+                         .withFields({
+                             C2F(mSize, width).inRange(2, 4096, 2),
+                             C2F(mSize, height).inRange(2, 4096, 2),
+                         })
+                         .withSetter(MaxPictureSizeSetter, mSize)
+                         .build());
+
+        addParameter(
+            DefineParam(mMaxInputSize, C2_PARAMKEY_INPUT_MAX_BUFFER_SIZE)
+                .withDefault(new C2StreamMaxBufferSizeInfo::input(
+                    0u, kMinInputBufferSize))
+                .withFields({
+                    C2F(mMaxInputSize, value).any(),
+                })
+                .calculatedAs(MaxInputSizeSetter, mMaxSize)
+                .build());
+
+        C2ChromaOffsetStruct locations[1] = {
+            C2ChromaOffsetStruct::ITU_YUV_420_0()};
+        std::shared_ptr<C2StreamColorInfo::output> defaultColorInfo =
+            C2StreamColorInfo::output::AllocShared(1u, 0u, 8u /* bitDepth */,
+                                                   C2Color::YUV_420);
+        memcpy(defaultColorInfo->m.locations, locations, sizeof(locations));
+
+        defaultColorInfo = C2StreamColorInfo::output::AllocShared(
+            {C2ChromaOffsetStruct::ITU_YUV_420_0()}, 0u, 8u /* bitDepth */,
+            C2Color::YUV_420);
+        helper->addStructDescriptors<C2ChromaOffsetStruct>();
+
+        addParameter(DefineParam(mColorInfo, C2_PARAMKEY_CODED_COLOR_INFO)
+                         .withConstValue(defaultColorInfo)
+                         .build());
+
+        addParameter(
+            DefineParam(mDefaultColorAspects, C2_PARAMKEY_DEFAULT_COLOR_ASPECTS)
+                .withDefault(new C2StreamColorAspectsTuning::output(
+                    0u, C2Color::RANGE_UNSPECIFIED,
+                    C2Color::PRIMARIES_UNSPECIFIED,
+                    C2Color::TRANSFER_UNSPECIFIED, C2Color::MATRIX_UNSPECIFIED))
+                .withFields({C2F(mDefaultColorAspects, range)
+                                 .inRange(C2Color::RANGE_UNSPECIFIED,
+                                          C2Color::RANGE_OTHER),
+                             C2F(mDefaultColorAspects, primaries)
+                                 .inRange(C2Color::PRIMARIES_UNSPECIFIED,
+                                          C2Color::PRIMARIES_OTHER),
+                             C2F(mDefaultColorAspects, transfer)
+                                 .inRange(C2Color::TRANSFER_UNSPECIFIED,
+                                          C2Color::TRANSFER_OTHER),
+                             C2F(mDefaultColorAspects, matrix)
+                                 .inRange(C2Color::MATRIX_UNSPECIFIED,
+                                          C2Color::MATRIX_OTHER)})
+                .withSetter(DefaultColorAspectsSetter)
+                .build());
+
+        // TODO: support more formats?
+        addParameter(DefineParam(mPixelFormat, C2_PARAMKEY_PIXEL_FORMAT)
+                         .withConstValue(new C2StreamPixelFormatInfo::output(
+                             0u, HAL_PIXEL_FORMAT_YCBCR_420_888))
+                         .build());
+    }
+
+    static C2R SizeSetter(bool mayBlock,
+                          const C2P<C2StreamPictureSizeInfo::output> &oldMe,
+                          C2P<C2StreamPictureSizeInfo::output> &me) {
+        (void)mayBlock;
+        DDD("calling sizesetter old w %d", oldMe.v.width);
+        DDD("calling sizesetter old h %d", oldMe.v.height);
+        DDD("calling sizesetter change to w %d", me.v.width);
+        DDD("calling sizesetter change to h %d", me.v.height);
+        C2R res = C2R::Ok();
+        auto mewidth = me.F(me.v.width);
+        auto meheight = me.F(me.v.height);
+
+        if (!mewidth.supportsAtAll(me.v.width)) {
+            res = res.plus(C2SettingResultBuilder::BadValue(me.F(me.v.width)));
+            DDD("override width with oldMe value");
+            me.set().width = oldMe.v.width;
+            DDD("something wrong here %s %d", __func__, __LINE__);
+        }
+        if (!meheight.supportsAtAll(me.v.height)) {
+            res = res.plus(C2SettingResultBuilder::BadValue(me.F(me.v.height)));
+            DDD("override height with oldMe value");
+            me.set().height = oldMe.v.height;
+            DDD("something wrong here %s %d", __func__, __LINE__);
+        }
+        return res;
+    }
+
+    static C2R
+    MaxPictureSizeSetter(bool mayBlock,
+                         C2P<C2StreamMaxPictureSizeTuning::output> &me,
+                         const C2P<C2StreamPictureSizeInfo::output> &size) {
+        (void)mayBlock;
+        // TODO: get max width/height from the size's field helpers vs.
+        // hardcoding
+        me.set().width = c2_min(c2_max(me.v.width, size.v.width), 4096u);
+        me.set().height = c2_min(c2_max(me.v.height, size.v.height), 4096u);
+        return C2R::Ok();
+    }
+
+    static C2R MaxInputSizeSetter(
+        bool mayBlock, C2P<C2StreamMaxBufferSizeInfo::input> &me,
+        const C2P<C2StreamMaxPictureSizeTuning::output> &maxSize) {
+        (void)mayBlock;
+        // assume compression ratio of 2
+        me.set().value = c2_max((((maxSize.v.width + 63) / 64) *
+                                 ((maxSize.v.height + 63) / 64) * 3072),
+                                kMinInputBufferSize);
+        return C2R::Ok();
+    }
+
+    static C2R
+    DefaultColorAspectsSetter(bool mayBlock,
+                              C2P<C2StreamColorAspectsTuning::output> &me) {
+        (void)mayBlock;
+        if (me.v.range > C2Color::RANGE_OTHER) {
+            me.set().range = C2Color::RANGE_OTHER;
+        }
+        if (me.v.primaries > C2Color::PRIMARIES_OTHER) {
+            me.set().primaries = C2Color::PRIMARIES_OTHER;
+        }
+        if (me.v.transfer > C2Color::TRANSFER_OTHER) {
+            me.set().transfer = C2Color::TRANSFER_OTHER;
+        }
+        if (me.v.matrix > C2Color::MATRIX_OTHER) {
+            me.set().matrix = C2Color::MATRIX_OTHER;
+        }
+        return C2R::Ok();
+    }
+
+    static C2R
+    ProfileLevelSetter(bool mayBlock, C2P<C2StreamProfileLevelInfo::input> &me,
+                       const C2P<C2StreamPictureSizeInfo::output> &size) {
+        (void)mayBlock;
+        (void)size;
+        (void)me; // TODO: validate
+        return C2R::Ok();
+    }
+    std::shared_ptr<C2StreamColorAspectsTuning::output>
+    getDefaultColorAspects_l() {
+        return mDefaultColorAspects;
+    }
+
+    int width() const { return mSize->width; }
+
+    int height() const { return mSize->height; }
+
+    int primaries() const { return mDefaultColorAspects->primaries; }
+
+    int range() const { return mDefaultColorAspects->range; }
+
+    int transfer() const { return mDefaultColorAspects->transfer; }
+
+    static C2R Hdr10PlusInfoInputSetter(bool mayBlock,
+                                        C2P<C2StreamHdr10PlusInfo::input> &me) {
+        (void)mayBlock;
+        (void)me; // TODO: validate
+        return C2R::Ok();
+    }
+
+    static C2R
+    Hdr10PlusInfoOutputSetter(bool mayBlock,
+                              C2P<C2StreamHdr10PlusInfo::output> &me) {
+        (void)mayBlock;
+        (void)me; // TODO: validate
+        return C2R::Ok();
+    }
+
+  private:
+    std::shared_ptr<C2StreamProfileLevelInfo::input> mProfileLevel;
+    std::shared_ptr<C2StreamPictureSizeInfo::output> mSize;
+    std::shared_ptr<C2StreamMaxPictureSizeTuning::output> mMaxSize;
+    std::shared_ptr<C2StreamMaxBufferSizeInfo::input> mMaxInputSize;
+    std::shared_ptr<C2StreamColorInfo::output> mColorInfo;
+    std::shared_ptr<C2StreamPixelFormatInfo::output> mPixelFormat;
+    std::shared_ptr<C2StreamColorAspectsTuning::output> mDefaultColorAspects;
+#ifdef VP9
+#if 0
+    std::shared_ptr<C2StreamHdrStaticInfo::output> mHdrStaticInfo;
+#endif
+    std::shared_ptr<C2StreamHdr10PlusInfo::input> mHdr10PlusInfoInput;
+    std::shared_ptr<C2StreamHdr10PlusInfo::output> mHdr10PlusInfoOutput;
+#endif
+};
+
+C2GoldfishVpxDec::ConverterThread::ConverterThread(
+    const std::shared_ptr<Mutexed<ConversionQueue>> &queue)
+    : Thread(false), mQueue(queue) {}
+
+bool C2GoldfishVpxDec::ConverterThread::threadLoop() {
+    Mutexed<ConversionQueue>::Locked queue(*mQueue);
+    if (queue->entries.empty()) {
+        queue.waitForCondition(queue->cond);
+        if (queue->entries.empty()) {
+            return true;
+        }
+    }
+    std::function<void()> convert = queue->entries.front();
+    queue->entries.pop_front();
+    if (!queue->entries.empty()) {
+        queue->cond.signal();
+    }
+    queue.unlock();
+
+    convert();
+
+    queue.lock();
+    if (--queue->numPending == 0u) {
+        queue->cond.broadcast();
+    }
+    return true;
+}
+
+C2GoldfishVpxDec::C2GoldfishVpxDec(const char *name, c2_node_id_t id,
+                                   const std::shared_ptr<IntfImpl> &intfImpl)
+    : SimpleC2Component(
+          std::make_shared<SimpleInterface<IntfImpl>>(name, id, intfImpl)),
+      mIntf(intfImpl), mCtx(nullptr), mQueue(new Mutexed<ConversionQueue>) {}
+
+C2GoldfishVpxDec::~C2GoldfishVpxDec() { onRelease(); }
+
+c2_status_t C2GoldfishVpxDec::onInit() {
+    status_t err = initDecoder();
+    return err == OK ? C2_OK : C2_CORRUPTED;
+}
+
+c2_status_t C2GoldfishVpxDec::onStop() {
+    mSignalledError = false;
+    mSignalledOutputEos = false;
+
+    return C2_OK;
+}
+
+void C2GoldfishVpxDec::onReset() {
+    (void)onStop();
+    c2_status_t err = onFlush_sm();
+    if (err != C2_OK) {
+        ALOGW("Failed to flush decoder. Try to hard reset decoder");
+        destroyDecoder();
+        (void)initDecoder();
+    }
+}
+
+void C2GoldfishVpxDec::onRelease() { destroyDecoder(); }
+
+void C2GoldfishVpxDec::sendMetadata() {
+    // compare and send if changed
+    MetaDataColorAspects currentMetaData = {1, 0, 0, 0};
+    currentMetaData.primaries = mIntf->primaries();
+    currentMetaData.range = mIntf->range();
+    currentMetaData.transfer = mIntf->transfer();
+
+    DDD("metadata primaries %d range %d transfer %d",
+            (int)(currentMetaData.primaries),
+            (int)(currentMetaData.range),
+            (int)(currentMetaData.transfer)
+       );
+
+    if (mSentMetadata.primaries == currentMetaData.primaries &&
+        mSentMetadata.range == currentMetaData.range &&
+        mSentMetadata.transfer == currentMetaData.transfer) {
+        DDD("metadata is the same, no need to update");
+        return;
+    }
+    std::swap(mSentMetadata, currentMetaData);
+
+    vpx_codec_send_metadata(mCtx, &(mSentMetadata));
+}
+
+c2_status_t C2GoldfishVpxDec::onFlush_sm() {
+    if (mFrameParallelMode) {
+        // Flush decoder by passing nullptr data ptr and 0 size.
+        // Ideally, this should never fail.
+        if (vpx_codec_flush(mCtx)) {
+            ALOGE("Failed to flush on2 decoder.");
+            return C2_CORRUPTED;
+        }
+    }
+
+    // Drop all the decoded frames in decoder.
+    if (mCtx) {
+        setup_ctx_parameters(mCtx);
+        while ((mImg = vpx_codec_get_frame(mCtx))) {
+        }
+    }
+
+    mSignalledError = false;
+    mSignalledOutputEos = false;
+    return C2_OK;
+}
+
+status_t C2GoldfishVpxDec::initDecoder() {
+    ALOGI("calling init GoldfishVPX");
+#ifdef VP9
+    mMode = MODE_VP9;
+#else
+    mMode = MODE_VP8;
+#endif
+
+    mWidth = 320;
+    mHeight = 240;
+    mFrameParallelMode = false;
+    mSignalledOutputEos = false;
+    mSignalledError = false;
+
+    return OK;
+}
+
+void C2GoldfishVpxDec::checkContext(const std::shared_ptr<C2BlockPool> &pool) {
+    if (mCtx)
+        return;
+
+    mWidth = mIntf->width();
+    mHeight = mIntf->height();
+    ALOGI("created decoder context w %d h %d", mWidth, mHeight);
+    mCtx = new vpx_codec_ctx_t;
+    mCtx->vpversion = mMode == MODE_VP8 ? 8 : 9;
+
+    const bool isGraphic = (pool->getLocalId() == C2PlatformAllocatorStore::GRALLOC);
+    DDD("buffer pool id %x",  (int)(pool->getLocalId()));
+    if (isGraphic) {
+        DDD("decoding to host color buffer");
+        mEnableAndroidNativeBuffers = true;
+    } else {
+        DDD("decoding to guest byte buffer");
+        mEnableAndroidNativeBuffers = false;
+    }
+
+    mCtx->version = mEnableAndroidNativeBuffers ? 200 : 100;
+
+    int vpx_err = 0;
+    if ((vpx_err = vpx_codec_dec_init(mCtx))) {
+        ALOGE("vpx decoder failed to initialize. (%d)", vpx_err);
+        delete mCtx;
+        mCtx = NULL;
+    }
+}
+
+status_t C2GoldfishVpxDec::destroyDecoder() {
+    if (mCtx) {
+        ALOGI("calling destroying GoldfishVPX ctx %p", mCtx);
+        vpx_codec_destroy(mCtx);
+        delete mCtx;
+        mCtx = NULL;
+    }
+
+    return OK;
+}
+
+void fillEmptyWork(const std::unique_ptr<C2Work> &work) {
+    uint32_t flags = 0;
+    if (work->input.flags & C2FrameData::FLAG_END_OF_STREAM) {
+        flags |= C2FrameData::FLAG_END_OF_STREAM;
+        DDD("signalling eos");
+    }
+    work->worklets.front()->output.flags = (C2FrameData::flags_t)flags;
+    work->worklets.front()->output.buffers.clear();
+    work->worklets.front()->output.ordinal = work->input.ordinal;
+    work->workletsProcessed = 1u;
+}
+
+void C2GoldfishVpxDec::finishWork(
+    uint64_t index, const std::unique_ptr<C2Work> &work,
+    const std::shared_ptr<C2GraphicBlock> &block) {
+    std::shared_ptr<C2Buffer> buffer =
+        createGraphicBuffer(block, C2Rect(mWidth, mHeight));
+    auto fillWork = [buffer, index,
+                     intf = this->mIntf](const std::unique_ptr<C2Work> &work) {
+        uint32_t flags = 0;
+        if ((work->input.flags & C2FrameData::FLAG_END_OF_STREAM) &&
+            (c2_cntr64_t(index) == work->input.ordinal.frameIndex)) {
+            flags |= C2FrameData::FLAG_END_OF_STREAM;
+            DDD("signalling eos");
+        }
+        work->worklets.front()->output.flags = (C2FrameData::flags_t)flags;
+        work->worklets.front()->output.buffers.clear();
+        work->worklets.front()->output.buffers.push_back(buffer);
+        work->worklets.front()->output.ordinal = work->input.ordinal;
+        work->workletsProcessed = 1u;
+
+        for (const std::unique_ptr<C2Param> &param : work->input.configUpdate) {
+            if (param) {
+                C2StreamHdr10PlusInfo::input *hdr10PlusInfo =
+                    C2StreamHdr10PlusInfo::input::From(param.get());
+
+                if (hdr10PlusInfo != nullptr) {
+                    std::vector<std::unique_ptr<C2SettingResult>> failures;
+                    std::unique_ptr<C2Param> outParam = C2Param::CopyAsStream(
+                        *param.get(), true /*output*/, param->stream());
+                    c2_status_t err =
+                        intf->config({outParam.get()}, C2_MAY_BLOCK, &failures);
+                    if (err == C2_OK) {
+                        work->worklets.front()->output.configUpdate.push_back(
+                            C2Param::Copy(*outParam.get()));
+                    } else {
+                        ALOGE("finishWork: Config update size failed");
+                    }
+                    break;
+                }
+            }
+        }
+    };
+    if (work && c2_cntr64_t(index) == work->input.ordinal.frameIndex) {
+        fillWork(work);
+    } else {
+        finish(index, fillWork);
+    }
+}
+
+void C2GoldfishVpxDec::process(const std::unique_ptr<C2Work> &work,
+                               const std::shared_ptr<C2BlockPool> &pool) {
+    DDD("%s %d doing work now", __func__, __LINE__);
+    // Initialize output work
+    work->result = C2_OK;
+    work->workletsProcessed = 0u;
+    work->worklets.front()->output.configUpdate.clear();
+    work->worklets.front()->output.flags = work->input.flags;
+
+    if (mSignalledError || mSignalledOutputEos) {
+        work->result = C2_BAD_VALUE;
+        return;
+    }
+
+    size_t inOffset = 0u;
+    size_t inSize = 0u;
+    C2ReadView rView = mDummyReadView;
+    if (!work->input.buffers.empty()) {
+        rView =
+            work->input.buffers[0]->data().linearBlocks().front().map().get();
+        inSize = rView.capacity();
+        if (inSize && rView.error()) {
+            ALOGE("read view map failed %d", rView.error());
+            work->result = C2_CORRUPTED;
+            return;
+        }
+    }
+
+    checkContext(pool);
+
+    bool codecConfig =
+        ((work->input.flags & C2FrameData::FLAG_CODEC_CONFIG) != 0);
+    bool eos = ((work->input.flags & C2FrameData::FLAG_END_OF_STREAM) != 0);
+
+    DDD("in buffer attr. size %zu timestamp %d frameindex %d, flags %x", inSize,
+        (int)work->input.ordinal.timestamp.peeku(),
+        (int)work->input.ordinal.frameIndex.peeku(), work->input.flags);
+
+    // Software VP9 Decoder does not need the Codec Specific Data (CSD)
+    // (specified in http://www.webmproject.org/vp9/profiles/). Ignore it if
+    // it was passed.
+    if (codecConfig) {
+        // Ignore CSD buffer for VP9.
+        if (mMode == MODE_VP9) {
+            fillEmptyWork(work);
+            return;
+        } else {
+            // Tolerate the CSD buffer for VP8. This is a workaround
+            // for b/28689536. continue
+            ALOGW("WARNING: Got CSD buffer for VP8. Continue");
+        }
+    }
+
+    sendMetadata();
+
+    if (inSize) {
+        uint8_t *bitstream = const_cast<uint8_t *>(rView.data() + inOffset);
+        vpx_codec_err_t err = vpx_codec_decode(
+            mCtx, bitstream, inSize, &work->input.ordinal.frameIndex, 0);
+        if (err != 0) {
+            ALOGE("on2 decoder failed to decode frame. err: ");
+            mSignalledError = true;
+            work->workletsProcessed = 1u;
+            work->result = C2_CORRUPTED;
+            return;
+        }
+    }
+
+    status_t err = outputBuffer(pool, work);
+    if (err == NOT_ENOUGH_DATA) {
+        if (inSize > 0) {
+            DDD("Maybe non-display frame at %lld.",
+                work->input.ordinal.frameIndex.peekll());
+            // send the work back with empty buffer.
+            inSize = 0;
+        }
+    } else if (err != OK) {
+        ALOGD("Error while getting the output frame out");
+        // work->result would be already filled; do fillEmptyWork() below to
+        // send the work back.
+        inSize = 0;
+    }
+
+    if (eos) {
+        drainInternal(DRAIN_COMPONENT_WITH_EOS, pool, work);
+        mSignalledOutputEos = true;
+    } else if (!inSize) {
+        fillEmptyWork(work);
+    }
+}
+
+static void copyOutputBufferToYuvPlanarFrame(
+    uint8_t *dst, const uint8_t *srcY, const uint8_t *srcU, const uint8_t *srcV,
+    size_t srcYStride, size_t srcUStride, size_t srcVStride, size_t dstYStride,
+    size_t dstUVStride, uint32_t width, uint32_t height) {
+    uint8_t *dstStart = dst;
+
+    for (size_t i = 0; i < height; ++i) {
+        memcpy(dst, srcY, width);
+        srcY += srcYStride;
+        dst += dstYStride;
+    }
+
+    dst = dstStart + dstYStride * height;
+    for (size_t i = 0; i < height / 2; ++i) {
+        memcpy(dst, srcV, width / 2);
+        srcV += srcVStride;
+        dst += dstUVStride;
+    }
+
+    dst = dstStart + (dstYStride * height) + (dstUVStride * height / 2);
+    for (size_t i = 0; i < height / 2; ++i) {
+        memcpy(dst, srcU, width / 2);
+        srcU += srcUStride;
+        dst += dstUVStride;
+    }
+}
+
+void C2GoldfishVpxDec::setup_ctx_parameters(vpx_codec_ctx_t *ctx,
+                                            int hostColorBufferId) {
+    ctx->width = mWidth;
+    ctx->height = mHeight;
+    ctx->hostColorBufferId = hostColorBufferId;
+    ctx->outputBufferWidth = mWidth;
+    ctx->outputBufferHeight = mHeight;
+    int32_t bpp = 1;
+    ctx->bpp = bpp;
+}
+
+status_t
+C2GoldfishVpxDec::outputBuffer(const std::shared_ptr<C2BlockPool> &pool,
+                               const std::unique_ptr<C2Work> &work) {
+    if (!(work && pool))
+        return BAD_VALUE;
+
+    // now get the block
+    std::shared_ptr<C2GraphicBlock> block;
+    uint32_t format = HAL_PIXEL_FORMAT_YCBCR_420_888;
+    const C2MemoryUsage usage = {(uint64_t)(BufferUsage::VIDEO_DECODER),
+                                 C2MemoryUsage::CPU_WRITE};
+
+    c2_status_t err = pool->fetchGraphicBlock(align(mWidth, 2), mHeight, format,
+                                              usage, &block);
+    if (err != C2_OK) {
+        ALOGE("fetchGraphicBlock for Output failed with status %d", err);
+        work->result = err;
+        return UNKNOWN_ERROR;
+    }
+
+    int hostColorBufferId = -1;
+    const bool decodingToHostColorBuffer = mEnableAndroidNativeBuffers;
+    if(decodingToHostColorBuffer){
+        auto c2Handle = block->handle();
+        native_handle_t *grallocHandle =
+            UnwrapNativeCodec2GrallocHandle(c2Handle);
+        hostColorBufferId = getColorBufferHandle(grallocHandle);
+        if (hostColorBufferId > 0) {
+            DDD("found handle %d", hostColorBufferId);
+        } else {
+            DDD("decode to buffer, because handle %d is invalid",
+                hostColorBufferId);
+            // change to -1 so host knows it is definitely invalid
+            // 0 is a bit confusing
+            hostColorBufferId = -1;
+        }
+    }
+    setup_ctx_parameters(mCtx, hostColorBufferId);
+
+    vpx_image_t *img = vpx_codec_get_frame(mCtx);
+
+    if (!img)
+        return NOT_ENOUGH_DATA;
+
+    if (img->d_w != mWidth || img->d_h != mHeight) {
+        DDD("updating w %d h %d to w %d h %d", mWidth, mHeight, img->d_w,
+            img->d_h);
+        mWidth = img->d_w;
+        mHeight = img->d_h;
+
+        // need to re-allocate since size changed, especially for byte buffer
+        // mode
+        if (true) {
+            c2_status_t err = pool->fetchGraphicBlock(align(mWidth, 2), mHeight,
+                                                      format, usage, &block);
+            if (err != C2_OK) {
+                ALOGE("fetchGraphicBlock for Output failed with status %d",
+                      err);
+                work->result = err;
+                return UNKNOWN_ERROR;
+            }
+        }
+
+        C2StreamPictureSizeInfo::output size(0u, mWidth, mHeight);
+        std::vector<std::unique_ptr<C2SettingResult>> failures;
+        c2_status_t err = mIntf->config({&size}, C2_MAY_BLOCK, &failures);
+        if (err == C2_OK) {
+            work->worklets.front()->output.configUpdate.push_back(
+                C2Param::Copy(size));
+        } else {
+            ALOGE("Config update size failed");
+            mSignalledError = true;
+            work->workletsProcessed = 1u;
+            work->result = C2_CORRUPTED;
+            return UNKNOWN_ERROR;
+        }
+    }
+    if (img->fmt != VPX_IMG_FMT_I420 && img->fmt != VPX_IMG_FMT_I42016) {
+        ALOGE("img->fmt %d not supported", img->fmt);
+        mSignalledError = true;
+        work->workletsProcessed = 1u;
+        work->result = C2_CORRUPTED;
+        return false;
+    }
+
+    if (img->fmt == VPX_IMG_FMT_I42016) {
+        IntfImpl::Lock lock = mIntf->lock();
+        std::shared_ptr<C2StreamColorAspectsTuning::output>
+            defaultColorAspects = mIntf->getDefaultColorAspects_l();
+
+        if (defaultColorAspects->primaries == C2Color::PRIMARIES_BT2020 &&
+            defaultColorAspects->matrix == C2Color::MATRIX_BT2020 &&
+            defaultColorAspects->transfer == C2Color::TRANSFER_ST2084) {
+            format = HAL_PIXEL_FORMAT_RGBA_1010102;
+        }
+    }
+
+    if (!decodingToHostColorBuffer) {
+
+        C2GraphicView wView = block->map().get();
+        if (wView.error()) {
+            ALOGE("graphic view map failed %d", wView.error());
+            work->result = C2_CORRUPTED;
+            return UNKNOWN_ERROR;
+        }
+
+        DDD("provided (%dx%d) required (%dx%d), out frameindex %lld",
+            block->width(), block->height(), mWidth, mHeight,
+            ((c2_cntr64_t *)img->user_priv)->peekll());
+
+        uint8_t *dst =
+            const_cast<uint8_t *>(wView.data()[C2PlanarLayout::PLANE_Y]);
+        size_t srcYStride = mWidth;
+        size_t srcUStride = mWidth / 2;
+        size_t srcVStride = mWidth / 2;
+        C2PlanarLayout layout = wView.layout();
+        size_t dstYStride = layout.planes[C2PlanarLayout::PLANE_Y].rowInc;
+        size_t dstUVStride = layout.planes[C2PlanarLayout::PLANE_U].rowInc;
+
+        if (img->fmt == VPX_IMG_FMT_I42016) {
+            ALOGW("WARNING: not I42016 is not supported !!!");
+        } else if (1) {
+            const uint8_t *srcY = (const uint8_t *)mCtx->dst;
+            const uint8_t *srcV = srcY + mWidth * mHeight;
+            const uint8_t *srcU = srcV + mWidth * mHeight / 4;
+            // TODO: the following crashes
+            copyOutputBufferToYuvPlanarFrame(dst, srcY, srcU, srcV, srcYStride,
+                                             srcUStride, srcVStride, dstYStride,
+                                             dstUVStride, mWidth, mHeight);
+            // memcpy(dst, srcY, mWidth * mHeight / 2);
+        }
+    }
+    DDD("provided (%dx%d) required (%dx%d), out frameindex %lld",
+        block->width(), block->height(), mWidth, mHeight,
+        ((c2_cntr64_t *)img->user_priv)->peekll());
+
+    finishWork(((c2_cntr64_t *)img->user_priv)->peekull(), work,
+               std::move(block));
+    return OK;
+}
+
+c2_status_t
+C2GoldfishVpxDec::drainInternal(uint32_t drainMode,
+                                const std::shared_ptr<C2BlockPool> &pool,
+                                const std::unique_ptr<C2Work> &work) {
+    if (drainMode == NO_DRAIN) {
+        ALOGW("drain with NO_DRAIN: no-op");
+        return C2_OK;
+    }
+    if (drainMode == DRAIN_CHAIN) {
+        ALOGW("DRAIN_CHAIN not supported");
+        return C2_OMITTED;
+    }
+
+    while (outputBuffer(pool, work) == OK) {
+    }
+
+    if (drainMode == DRAIN_COMPONENT_WITH_EOS && work &&
+        work->workletsProcessed == 0u) {
+        fillEmptyWork(work);
+    }
+
+    return C2_OK;
+}
+c2_status_t C2GoldfishVpxDec::drain(uint32_t drainMode,
+                                    const std::shared_ptr<C2BlockPool> &pool) {
+    return drainInternal(drainMode, pool, nullptr);
+}
+
+class C2GoldfishVpxFactory : public C2ComponentFactory {
+  public:
+    C2GoldfishVpxFactory()
+        : mHelper(std::static_pointer_cast<C2ReflectorHelper>(
+              GoldfishComponentStore::Create()->getParamReflector())) {
+
+        ALOGI("platform store is %p, reflector is %p",
+              GetCodec2PlatformComponentStore().get(),
+              GetCodec2PlatformComponentStore()->getParamReflector().get());
+    }
+
+    virtual c2_status_t
+    createComponent(c2_node_id_t id,
+                    std::shared_ptr<C2Component> *const component,
+                    std::function<void(C2Component *)> deleter) override {
+        *component = std::shared_ptr<C2Component>(
+            new C2GoldfishVpxDec(
+                COMPONENT_NAME, id,
+                std::make_shared<C2GoldfishVpxDec::IntfImpl>(mHelper)),
+            deleter);
+        return C2_OK;
+    }
+
+    virtual c2_status_t createInterface(
+        c2_node_id_t id, std::shared_ptr<C2ComponentInterface> *const interface,
+        std::function<void(C2ComponentInterface *)> deleter) override {
+        *interface = std::shared_ptr<C2ComponentInterface>(
+            new SimpleInterface<C2GoldfishVpxDec::IntfImpl>(
+                COMPONENT_NAME, id,
+                std::make_shared<C2GoldfishVpxDec::IntfImpl>(mHelper)),
+            deleter);
+        return C2_OK;
+    }
+
+    virtual ~C2GoldfishVpxFactory() override = default;
+
+  private:
+    std::shared_ptr<C2ReflectorHelper> mHelper;
+};
+
+} // namespace android
+
+extern "C" ::C2ComponentFactory *CreateCodec2Factory() {
+    DDD("in %s", __func__);
+    return new ::android::C2GoldfishVpxFactory();
+}
+
+extern "C" void DestroyCodec2Factory(::C2ComponentFactory *factory) {
+    DDD("in %s", __func__);
+    delete factory;
+}
diff --git a/system/codecs/c2/decoders/vpxdec/C2GoldfishVpxDec.h b/system/codecs/c2/decoders/vpxdec/C2GoldfishVpxDec.h
new file mode 100644
index 0000000..738d9fc
--- /dev/null
+++ b/system/codecs/c2/decoders/vpxdec/C2GoldfishVpxDec.h
@@ -0,0 +1,105 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "goldfish_media_utils.h"
+#include "goldfish_vpx_defs.h"
+#include <SimpleC2Component.h>
+
+namespace android {
+
+struct C2GoldfishVpxDec : public SimpleC2Component {
+    class IntfImpl;
+
+    C2GoldfishVpxDec(const char *name, c2_node_id_t id,
+                     const std::shared_ptr<IntfImpl> &intfImpl);
+    virtual ~C2GoldfishVpxDec();
+
+    // From SimpleC2Component
+    c2_status_t onInit() override;
+    c2_status_t onStop() override;
+    void onReset() override;
+    void onRelease() override;
+    c2_status_t onFlush_sm() override;
+    void process(const std::unique_ptr<C2Work> &work,
+                 const std::shared_ptr<C2BlockPool> &pool) override;
+    c2_status_t drain(uint32_t drainMode,
+                      const std::shared_ptr<C2BlockPool> &pool) override;
+
+  private:
+    enum {
+        MODE_VP8,
+        MODE_VP9,
+    } mMode;
+
+    struct ConversionQueue;
+
+    class ConverterThread : public Thread {
+      public:
+        explicit ConverterThread(
+            const std::shared_ptr<Mutexed<ConversionQueue>> &queue);
+        ~ConverterThread() override = default;
+        bool threadLoop() override;
+
+      private:
+        std::shared_ptr<Mutexed<ConversionQueue>> mQueue;
+    };
+
+    // create context that talks to host decoder: it needs to use
+    // pool to decide whether decoding to host color buffer ot
+    // decode to guest bytebuffer when pool cannot fetch valid host
+    // color buffer id
+    void checkContext(const std::shared_ptr<C2BlockPool> &pool);
+    bool mEnableAndroidNativeBuffers{true};
+
+    void setup_ctx_parameters(vpx_codec_ctx_t *ctx, int hostColorBufferId = -1);
+
+    std::shared_ptr<IntfImpl> mIntf;
+    vpx_codec_ctx_t *mCtx;
+    bool mFrameParallelMode; // Frame parallel is only supported by VP9 decoder.
+    vpx_image_t *mImg;
+
+    uint32_t mWidth;
+    uint32_t mHeight;
+    bool mSignalledOutputEos;
+    bool mSignalledError;
+
+    struct ConversionQueue {
+        std::list<std::function<void()>> entries;
+        Condition cond;
+        size_t numPending{0u};
+    };
+    std::shared_ptr<Mutexed<ConversionQueue>> mQueue;
+    std::vector<sp<ConverterThread>> mConverterThreads;
+
+    status_t initDecoder();
+    status_t destroyDecoder();
+    void finishWork(uint64_t index, const std::unique_ptr<C2Work> &work,
+                    const std::shared_ptr<C2GraphicBlock> &block);
+    status_t outputBuffer(const std::shared_ptr<C2BlockPool> &pool,
+                          const std::unique_ptr<C2Work> &work);
+    c2_status_t drainInternal(uint32_t drainMode,
+                              const std::shared_ptr<C2BlockPool> &pool,
+                              const std::unique_ptr<C2Work> &work);
+
+    MetaDataColorAspects mSentMetadata = {1, 0, 0, 0};
+    void sendMetadata();
+
+    C2_DO_NOT_COPY(C2GoldfishVpxDec);
+};
+
+} // namespace android
diff --git a/system/codecs/c2/decoders/vpxdec/goldfish_vpx_defs.h b/system/codecs/c2/decoders/vpxdec/goldfish_vpx_defs.h
new file mode 100644
index 0000000..1be05c9
--- /dev/null
+++ b/system/codecs/c2/decoders/vpxdec/goldfish_vpx_defs.h
@@ -0,0 +1,66 @@
+#ifndef MY_VPX_DEFS_H_
+#define MY_VPX_DEFS_H_
+
+#define VPX_IMG_FMT_PLANAR 0x100       /**< Image is a planar format. */
+#define VPX_IMG_FMT_UV_FLIP 0x200      /**< V plane precedes U in memory. */
+#define VPX_IMG_FMT_HAS_ALPHA 0x400    /**< Image has an alpha channel. */
+#define VPX_IMG_FMT_HIGHBITDEPTH 0x800 /**< Image uses 16bit framebuffer. */
+
+typedef unsigned char uint8_t;
+typedef int vpx_codec_err_t;
+
+enum class RenderMode {
+    RENDER_BY_HOST_GPU = 1,
+    RENDER_BY_GUEST_CPU = 2,
+};
+
+enum vpx_img_fmt_t {
+    VPX_IMG_FMT_NONE,
+    VPX_IMG_FMT_YV12 =
+        VPX_IMG_FMT_PLANAR | VPX_IMG_FMT_UV_FLIP | 1, /**< planar YVU */
+    VPX_IMG_FMT_I420 = VPX_IMG_FMT_PLANAR | 2,
+    VPX_IMG_FMT_I422 = VPX_IMG_FMT_PLANAR | 5,
+    VPX_IMG_FMT_I444 = VPX_IMG_FMT_PLANAR | 6,
+    VPX_IMG_FMT_I440 = VPX_IMG_FMT_PLANAR | 7,
+    VPX_IMG_FMT_I42016 = VPX_IMG_FMT_I420 | VPX_IMG_FMT_HIGHBITDEPTH,
+    VPX_IMG_FMT_I42216 = VPX_IMG_FMT_I422 | VPX_IMG_FMT_HIGHBITDEPTH,
+    VPX_IMG_FMT_I44416 = VPX_IMG_FMT_I444 | VPX_IMG_FMT_HIGHBITDEPTH,
+    VPX_IMG_FMT_I44016 = VPX_IMG_FMT_I440 | VPX_IMG_FMT_HIGHBITDEPTH
+};
+
+struct vpx_image_t {
+    vpx_img_fmt_t fmt; /**< Image Format */
+    unsigned int d_w;  /**< Displayed image width */
+    unsigned int d_h;  /**< Displayed image height */
+    void *user_priv;
+};
+
+#define VPX_CODEC_OK 0
+
+struct vpx_codec_ctx_t {
+    int vpversion; // 8: vp8 or 9: vp9
+    int version;   // 100: return decoded frame to guest; 200: render on host
+    int hostColorBufferId;
+    uint64_t id; // >= 1, unique
+    int memory_slot;
+    uint64_t address_offset = 0;
+    size_t outputBufferWidth;
+    size_t outputBufferHeight;
+    size_t width;
+    size_t height;
+    size_t bpp;
+    uint8_t *data;
+    uint8_t *dst;
+    vpx_image_t myImg;
+};
+
+int vpx_codec_destroy(vpx_codec_ctx_t *);
+int vpx_codec_dec_init(vpx_codec_ctx_t *);
+vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *, int hostColorBufferId = -1);
+int vpx_codec_flush(vpx_codec_ctx_t *ctx);
+int vpx_codec_decode(vpx_codec_ctx_t *ctx, const uint8_t *data,
+                     unsigned int data_sz, void *user_priv, long deadline);
+
+void vpx_codec_send_metadata(vpx_codec_ctx_t *ctx, void*ptr);
+
+#endif // MY_VPX_DEFS_H_
diff --git a/system/codecs/c2/decoders/vpxdec/goldfish_vpx_impl.cpp b/system/codecs/c2/decoders/vpxdec/goldfish_vpx_impl.cpp
new file mode 100644
index 0000000..e1fa879
--- /dev/null
+++ b/system/codecs/c2/decoders/vpxdec/goldfish_vpx_impl.cpp
@@ -0,0 +1,188 @@
+#include <log/log.h>
+
+#include "goldfish_media_utils.h"
+#include "goldfish_vpx_defs.h"
+#include <cstdlib>
+#include <errno.h>
+#include <fcntl.h>
+#include <linux/ioctl.h>
+#include <linux/types.h>
+#include <string>
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <memory>
+#include <mutex>
+#include <vector>
+
+#define DEBUG 0
+#if DEBUG
+#define DDD(...) ALOGD(__VA_ARGS__)
+#else
+#define DDD(...) ((void)0)
+#endif
+
+// static vpx_image_t myImg;
+static uint64_t s_CtxId = 0;
+static std::mutex sCtxidMutex;
+
+static uint64_t applyForOneId() {
+    DDD("%s %d", __func__, __LINE__);
+    std::lock_guard<std::mutex> g{sCtxidMutex};
+    ++s_CtxId;
+    return s_CtxId;
+}
+
+static void sendVpxOperation(vpx_codec_ctx_t *ctx, MediaOperation op) {
+    DDD("%s %d", __func__, __LINE__);
+    if (ctx->memory_slot < 0) {
+        ALOGE("ERROR: Failed %s %d: there is no memory slot", __func__,
+              __LINE__);
+    }
+    auto transport = GoldfishMediaTransport::getInstance();
+    transport->sendOperation(ctx->vpversion == 9 ? MediaCodecType::VP9Codec
+                                                 : MediaCodecType::VP8Codec,
+                             op, ctx->address_offset);
+}
+
+int vpx_codec_destroy(vpx_codec_ctx_t *ctx) {
+    DDD("%s %d", __func__, __LINE__);
+    if (!ctx) {
+        ALOGE("ERROR: Failed %s %d: ctx is nullptr", __func__, __LINE__);
+        return -1;
+    }
+    auto transport = GoldfishMediaTransport::getInstance();
+    transport->writeParam(ctx->id, 0, ctx->address_offset);
+    sendVpxOperation(ctx, MediaOperation::DestroyContext);
+    transport->returnMemorySlot(ctx->memory_slot);
+    ctx->memory_slot = -1;
+    return 0;
+}
+
+int vpx_codec_dec_init(vpx_codec_ctx_t *ctx) {
+    DDD("%s %d", __func__, __LINE__);
+    auto transport = GoldfishMediaTransport::getInstance();
+    int slot = transport->getMemorySlot();
+    if (slot < 0) {
+        ALOGE("ERROR: Failed %s %d: cannot get memory slot", __func__,
+              __LINE__);
+        return -1;
+    } else {
+        DDD("got slot %d", slot);
+    }
+    ctx->id = applyForOneId();
+    ctx->memory_slot = slot;
+    ctx->address_offset =
+        static_cast<unsigned int>(ctx->memory_slot) * (1 << 20);
+    DDD("got address offset 0x%x version %d", (int)(ctx->address_offset),
+        ctx->version);
+
+    // data and dst are on the host side actually
+    ctx->data = transport->getInputAddr(ctx->address_offset);
+    ctx->dst =
+        transport->getInputAddr(ctx->address_offset); // re-use input address
+    transport->writeParam(ctx->id, 0, ctx->address_offset);
+    transport->writeParam(ctx->version, 1, ctx->address_offset);
+    sendVpxOperation(ctx, MediaOperation::InitContext);
+    return 0;
+}
+
+static int getReturnCode(uint8_t *ptr) {
+    int *pint = (int *)(ptr);
+    return *pint;
+}
+
+// vpx_image_t myImg;
+static void getVpxFrame(uint8_t *ptr, vpx_image_t &myImg) {
+    DDD("%s %d", __func__, __LINE__);
+    uint8_t *imgptr = (ptr + 8);
+    myImg.fmt = *(vpx_img_fmt_t *)imgptr;
+    imgptr += 8;
+    myImg.d_w = *(unsigned int *)imgptr;
+    imgptr += 8;
+    myImg.d_h = *(unsigned int *)imgptr;
+    imgptr += 8;
+    myImg.user_priv = (void *)(*(uint64_t *)imgptr);
+    DDD("fmt %d dw %d dh %d userpriv %p", (int)myImg.fmt, (int)myImg.d_w,
+        (int)myImg.d_h, myImg.user_priv);
+}
+
+// TODO: we might not need to do the putting all the time
+vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx, int hostColorBufferId) {
+    DDD("%s %d %p", __func__, __LINE__);
+    (void)hostColorBufferId;
+    if (!ctx) {
+        ALOGE("ERROR: Failed %s %d: ctx is nullptr", __func__, __LINE__);
+        return nullptr;
+    }
+    auto transport = GoldfishMediaTransport::getInstance();
+
+    transport->writeParam(ctx->id, 0, ctx->address_offset);
+    transport->writeParam(ctx->outputBufferWidth, 1, ctx->address_offset);
+    transport->writeParam(ctx->outputBufferHeight, 2, ctx->address_offset);
+    transport->writeParam(ctx->width, 3, ctx->address_offset);
+    transport->writeParam(ctx->height, 4, ctx->address_offset);
+    transport->writeParam(ctx->bpp, 5, ctx->address_offset);
+    transport->writeParam(ctx->hostColorBufferId, 6, ctx->address_offset);
+    transport->writeParam(transport->offsetOf((uint64_t)(ctx->dst)) -
+                              ctx->address_offset,
+                          7, ctx->address_offset);
+
+    sendVpxOperation(ctx, MediaOperation::GetImage);
+
+    auto *retptr = transport->getReturnAddr(ctx->address_offset);
+    int ret = getReturnCode(retptr);
+    if (ret) {
+        return nullptr;
+    }
+    getVpxFrame(retptr, ctx->myImg);
+    return &(ctx->myImg);
+}
+
+void vpx_codec_send_metadata(vpx_codec_ctx_t *ctx, void *ptr) {
+    MetaDataColorAspects& meta = *(MetaDataColorAspects*)ptr;
+    auto transport = GoldfishMediaTransport::getInstance();
+    transport->writeParam(ctx->id, 0, ctx->address_offset);
+    transport->writeParam(meta.type, 1, ctx->address_offset);
+    transport->writeParam(meta.primaries, 2, ctx->address_offset);
+    transport->writeParam(meta.range, 3, ctx->address_offset);
+    transport->writeParam(meta.transfer, 4, ctx->address_offset);
+    sendVpxOperation(ctx, MediaOperation::SendMetadata);
+}
+
+int vpx_codec_flush(vpx_codec_ctx_t *ctx) {
+    DDD("%s %d", __func__, __LINE__);
+    if (!ctx) {
+        ALOGE("ERROR: Failed %s %d: ctx is nullptr", __func__, __LINE__);
+        return -1;
+    }
+    auto transport = GoldfishMediaTransport::getInstance();
+    transport->writeParam(ctx->id, 0, ctx->address_offset);
+    sendVpxOperation(ctx, MediaOperation::Flush);
+    return 0;
+}
+
+int vpx_codec_decode(vpx_codec_ctx_t *ctx, const uint8_t *data,
+                     unsigned int data_sz, void *user_priv, long deadline) {
+    if (!ctx) {
+        ALOGE("ERROR: Failed %s %d: ctx is nullptr", __func__, __LINE__);
+        return -1;
+    }
+    (void)deadline;
+    DDD("%s %d data size %d userpriv %p", __func__, __LINE__, (int)data_sz,
+        user_priv);
+    auto transport = GoldfishMediaTransport::getInstance();
+    memcpy(ctx->data, data, data_sz);
+
+    transport->writeParam(ctx->id, 0, ctx->address_offset);
+    transport->writeParam(transport->offsetOf((uint64_t)(ctx->data)) -
+                              ctx->address_offset,
+                          1, ctx->address_offset);
+    transport->writeParam((__u64)data_sz, 2, ctx->address_offset);
+    transport->writeParam((__u64)user_priv, 3, ctx->address_offset);
+    sendVpxOperation(ctx, MediaOperation::DecodeImage);
+    return 0;
+}
diff --git a/system/codecs/c2/readme.txt b/system/codecs/c2/readme.txt
new file mode 100644
index 0000000..a2b0d21
--- /dev/null
+++ b/system/codecs/c2/readme.txt
@@ -0,0 +1,11 @@
+This contains the c2 version of emulator's hardware decoders
+
+decoders/ contains avc(a.k.a. h264) and vpx(vp8 and vp9) decoders
+and base. All are based upon c2 sw codecs.
+
+store/ the store that creates decoders
+this is also borrowed from c2.
+
+service/ the hidl service that required by platform;
+to actually get it work, need to set this in file_contexts
+/vendor/bin/hw/android\.hardware\.media\.c2@1\.0-service-goldfish u:object_r:mediacodec_exec:s0
diff --git a/system/codecs/c2/service/Android.bp b/system/codecs/c2/service/Android.bp
new file mode 100644
index 0000000..8333a31
--- /dev/null
+++ b/system/codecs/c2/service/Android.bp
@@ -0,0 +1,37 @@
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "device_generic_goldfish-opengl_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-BSD
+    default_applicable_licenses: ["device_generic_goldfish-opengl_license"],
+}
+
+cc_binary {
+    name: "[email protected]",
+
+    defaults: [
+        "hidl_defaults",
+        "libcodec2-hidl-defaults",
+    ],
+    vendor: true,
+    relative_install_path: "hw",
+
+    srcs: [
+        "service.cpp",
+    ],
+
+    init_rc: ["[email protected]"],
+    vintf_fragments: ["[email protected]"],
+
+    shared_libs: [
+        "libgoldfish_codec2_store",
+        "libavservices_minijail",
+        "libcutils",
+        "libhidlbase",
+        "liblog",
+        "libutils",
+    ],
+
+    required: ["[email protected]_policy"],
+}
diff --git a/system/codecs/c2/service/[email protected] b/system/codecs/c2/service/[email protected]
new file mode 100644
index 0000000..ada90ba
--- /dev/null
+++ b/system/codecs/c2/service/[email protected]
@@ -0,0 +1,6 @@
+service android-hardware-media-c2-goldfish-hal-1-0 /vendor/bin/hw/[email protected]
+    class hal
+    user media
+    group mediadrm drmrpc
+    ioprio rt 4
+    task_profiles ProcessCapacityHigh
diff --git a/system/codecs/c2/service/[email protected] b/system/codecs/c2/service/[email protected]
new file mode 100644
index 0000000..3bc347c
--- /dev/null
+++ b/system/codecs/c2/service/[email protected]
@@ -0,0 +1,11 @@
+<manifest version="1.0" type="device">
+    <hal format="hidl">
+        <name>android.hardware.media.c2</name>
+        <transport>hwbinder</transport>
+        <version>1.0</version>
+        <interface>
+            <name>IComponentStore</name>
+            <instance>default</instance>
+        </interface>
+    </hal>
+</manifest>
diff --git a/system/codecs/c2/service/service.cpp b/system/codecs/c2/service/service.cpp
new file mode 100644
index 0000000..0e97dd2
--- /dev/null
+++ b/system/codecs/c2/service/service.cpp
@@ -0,0 +1,52 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "[email protected]"
+
+#include <C2Component.h>
+#include <codec2/hidl/1.0/ComponentStore.h>
+#include <hidl/HidlTransportSupport.h>
+#include <log/log.h>
+#include <minijail.h>
+
+#include <goldfish_codec2/store/GoldfishComponentStore.h>
+
+// Default policy for codec2.0 service.
+static constexpr char kBaseSeccompPolicyPath[] =
+    "/vendor/etc/seccomp_policy/"
+    "[email protected]_policy";
+
+// Additional device-specific seccomp permissions can be added in this file.
+static constexpr char kExtSeccompPolicyPath[] =
+    "/vendor/etc/seccomp_policy/codec2.vendor.ext.policy";
+
+int main(int /* argc */, char ** /* argv */) {
+    ALOGD("Goldfish C2 Service starting...");
+
+    signal(SIGPIPE, SIG_IGN);
+    android::SetUpMinijail(kBaseSeccompPolicyPath, kExtSeccompPolicyPath);
+
+    android::hardware::configureRpcThreadpool(8, true /* callerWillJoin */);
+
+    // Create IComponentStore service.
+    {
+        using namespace ::android::hardware::media::c2::V1_0;
+
+        ALOGD("Instantiating Codec2's Goldfish IComponentStore service...");
+        android::sp<IComponentStore> store(new utils::ComponentStore(
+            android::GoldfishComponentStore::Create()));
+        if (store == nullptr) {
+            ALOGE("Cannot create Codec2's Goldfish IComponentStore service.");
+        } else if (store->registerAsService("default") != android::OK) {
+            ALOGE("Cannot register Codec2's IComponentStore service.");
+        } else {
+            ALOGI("Codec2's IComponentStore service created.");
+        }
+    }
+
+    android::hardware::joinRpcThreadpool();
+    ALOGD("Service shutdown.");
+    return 0;
+}
diff --git a/system/codecs/c2/store/Android.bp b/system/codecs/c2/store/Android.bp
new file mode 100644
index 0000000..56b1895
--- /dev/null
+++ b/system/codecs/c2/store/Android.bp
@@ -0,0 +1,35 @@
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "device_generic_goldfish-opengl_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-GPL-2.0
+    default_applicable_licenses: ["device_generic_goldfish-opengl_license"],
+}
+
+cc_library_shared {
+    name: "libgoldfish_codec2_store",
+    vendor: true,
+
+    defaults: [
+        "libcodec2-impl-defaults",
+    ],
+
+    srcs: [
+        "GoldfishComponentStore.cpp",
+    ],
+    export_include_dirs: [
+        "include",
+    ],
+
+    shared_libs: [
+        "libcutils",
+        "liblog",
+    ],
+
+    cflags: [
+      "-Werror",
+      "-Wall",
+      "-Wthread-safety",  // Check thread annotation at build time.
+    ],
+}
diff --git a/system/codecs/c2/store/GoldfishComponentStore.cpp b/system/codecs/c2/store/GoldfishComponentStore.cpp
new file mode 100644
index 0000000..2d2ab47
--- /dev/null
+++ b/system/codecs/c2/store/GoldfishComponentStore.cpp
@@ -0,0 +1,389 @@
+/* Copyright (C) 2020 The Android Open Source Project
+**
+** This software is licensed under the terms of the GNU General Public
+** License version 2, as published by the Free Software Foundation, and
+** may be copied, distributed, and modified under those terms.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+** GNU General Public License for more details.
+*/
+
+#define LOG_TAG "GoldfishComponentStore"
+
+#include <goldfish_codec2/store/GoldfishComponentStore.h>
+
+#include <dlfcn.h>
+#include <stdint.h>
+
+#include <memory>
+#include <mutex>
+
+#include <C2.h>
+#include <C2Config.h>
+#include <cutils/properties.h>
+#include <log/log.h>
+
+namespace android {
+
+// static
+std::shared_ptr<C2ComponentStore> GoldfishComponentStore::Create() {
+    ALOGI("%s()", __func__);
+
+    static std::mutex mutex;
+    static std::weak_ptr<C2ComponentStore> platformStore;
+
+    std::lock_guard<std::mutex> lock(mutex);
+    std::shared_ptr<C2ComponentStore> store = platformStore.lock();
+    if (store != nullptr)
+        return store;
+
+    store = std::shared_ptr<C2ComponentStore>(new GoldfishComponentStore());
+    platformStore = store;
+    return store;
+}
+
+C2String GoldfishComponentStore::getName() const {
+    return "android.componentStore.goldfish";
+}
+
+c2_status_t GoldfishComponentStore::ComponentModule::init(std::string libPath) {
+    ALOGI("in %s", __func__);
+    ALOGI("loading dll of path %s", libPath.c_str());
+    mLibHandle = dlopen(libPath.c_str(), RTLD_NOW | RTLD_NODELETE);
+    LOG_ALWAYS_FATAL_IF(mLibHandle == nullptr, "could not dlopen %s: %s",
+                        libPath.c_str(), dlerror());
+
+    createFactory = (C2ComponentFactory::CreateCodec2FactoryFunc)dlsym(
+        mLibHandle, "CreateCodec2Factory");
+    LOG_ALWAYS_FATAL_IF(createFactory == nullptr, "createFactory is null in %s",
+                        libPath.c_str());
+
+    destroyFactory = (C2ComponentFactory::DestroyCodec2FactoryFunc)dlsym(
+        mLibHandle, "DestroyCodec2Factory");
+    LOG_ALWAYS_FATAL_IF(destroyFactory == nullptr,
+                        "destroyFactory is null in %s", libPath.c_str());
+
+    mComponentFactory = createFactory();
+    if (mComponentFactory == nullptr) {
+        ALOGD("could not create factory in %s", libPath.c_str());
+        mInit = C2_NO_MEMORY;
+    } else {
+        mInit = C2_OK;
+    }
+
+    if (mInit != C2_OK) {
+        return mInit;
+    }
+
+    std::shared_ptr<C2ComponentInterface> intf;
+    c2_status_t res = createInterface(0, &intf);
+    if (res != C2_OK) {
+        ALOGD("failed to create interface: %d", res);
+        return mInit;
+    }
+
+    std::shared_ptr<C2Component::Traits> traits(new (std::nothrow)
+                                                    C2Component::Traits);
+    if (traits) {
+        traits->name = intf->getName();
+
+        C2ComponentKindSetting kind;
+        C2ComponentDomainSetting domain;
+        res = intf->query_vb({&kind, &domain}, {}, C2_MAY_BLOCK, nullptr);
+        bool fixDomain = res != C2_OK;
+        if (res == C2_OK) {
+            traits->kind = kind.value;
+            traits->domain = domain.value;
+        } else {
+            // TODO: remove this fall-back
+            ALOGD("failed to query interface for kind and domain: %d", res);
+
+            traits->kind = (traits->name.find("encoder") != std::string::npos)
+                               ? C2Component::KIND_ENCODER
+                           : (traits->name.find("decoder") != std::string::npos)
+                               ? C2Component::KIND_DECODER
+                               : C2Component::KIND_OTHER;
+        }
+
+        uint32_t mediaTypeIndex =
+            traits->kind == C2Component::KIND_ENCODER
+                ? C2PortMediaTypeSetting::output::PARAM_TYPE
+                : C2PortMediaTypeSetting::input::PARAM_TYPE;
+        std::vector<std::unique_ptr<C2Param>> params;
+        res = intf->query_vb({}, {mediaTypeIndex}, C2_MAY_BLOCK, &params);
+        if (res != C2_OK) {
+            ALOGD("failed to query interface: %d", res);
+            return mInit;
+        }
+        if (params.size() != 1u) {
+            ALOGD("failed to query interface: unexpected vector size: %zu",
+                  params.size());
+            return mInit;
+        }
+        C2PortMediaTypeSetting *mediaTypeConfig =
+            C2PortMediaTypeSetting::From(params[0].get());
+        if (mediaTypeConfig == nullptr) {
+            ALOGD("failed to query media type");
+            return mInit;
+        }
+        traits->mediaType = std::string(
+            mediaTypeConfig->m.value,
+            strnlen(mediaTypeConfig->m.value, mediaTypeConfig->flexCount()));
+
+        if (fixDomain) {
+            if (strncmp(traits->mediaType.c_str(), "audio/", 6) == 0) {
+                traits->domain = C2Component::DOMAIN_AUDIO;
+            } else if (strncmp(traits->mediaType.c_str(), "video/", 6) == 0) {
+                traits->domain = C2Component::DOMAIN_VIDEO;
+            } else if (strncmp(traits->mediaType.c_str(), "image/", 6) == 0) {
+                traits->domain = C2Component::DOMAIN_IMAGE;
+            } else {
+                traits->domain = C2Component::DOMAIN_OTHER;
+            }
+        }
+
+        // TODO: get this properly from the store during emplace
+        switch (traits->domain) {
+        case C2Component::DOMAIN_AUDIO:
+            traits->rank = 8;
+            break;
+        default:
+            traits->rank = 512;
+        }
+
+        params.clear();
+        res = intf->query_vb({}, {C2ComponentAliasesSetting::PARAM_TYPE},
+                             C2_MAY_BLOCK, &params);
+        if (res == C2_OK && params.size() == 1u) {
+            C2ComponentAliasesSetting *aliasesSetting =
+                C2ComponentAliasesSetting::From(params[0].get());
+            if (aliasesSetting) {
+                // Split aliases on ','
+                // This looks simpler in plain C and even std::string would
+                // still make a copy.
+                char *aliases = ::strndup(aliasesSetting->m.value,
+                                          aliasesSetting->flexCount());
+                ALOGD("'%s' has aliases: '%s'", intf->getName().c_str(),
+                      aliases);
+
+                for (char *tok, *ptr, *str = aliases;
+                     (tok = ::strtok_r(str, ",", &ptr)); str = nullptr) {
+                    traits->aliases.push_back(tok);
+                    ALOGD("adding alias: '%s'", tok);
+                }
+                free(aliases);
+            }
+        }
+    }
+    mTraits = traits;
+
+    return mInit;
+}
+
+GoldfishComponentStore::ComponentModule::~ComponentModule() {
+    ALOGI("in %s", __func__);
+    if (destroyFactory && mComponentFactory) {
+        destroyFactory(mComponentFactory);
+    }
+    if (mLibHandle) {
+        ALOGI("unloading dll");
+        dlclose(mLibHandle);
+    }
+}
+
+c2_status_t GoldfishComponentStore::ComponentModule::createInterface(
+    c2_node_id_t id, std::shared_ptr<C2ComponentInterface> *interface,
+    std::function<void(::C2ComponentInterface *)> deleter) {
+    interface->reset();
+    if (mInit != C2_OK) {
+        return mInit;
+    }
+    std::shared_ptr<ComponentModule> module = shared_from_this();
+    c2_status_t res = mComponentFactory->createInterface(
+        id, interface, [module, deleter](C2ComponentInterface *p) mutable {
+            // capture module so that we ensure we still have it while deleting
+            // interface
+            deleter(p);     // delete interface first
+            module.reset(); // remove module ref (not technically needed)
+        });
+    ALOGI("created interface");
+    return res;
+}
+
+c2_status_t GoldfishComponentStore::ComponentModule::createComponent(
+    c2_node_id_t id, std::shared_ptr<C2Component> *component,
+    std::function<void(::C2Component *)> deleter) {
+    component->reset();
+    if (mInit != C2_OK) {
+        return mInit;
+    }
+    std::shared_ptr<ComponentModule> module = shared_from_this();
+    c2_status_t res = mComponentFactory->createComponent(
+        id, component, [module, deleter](C2Component *p) mutable {
+            // capture module so that we ensure we still have it while deleting
+            // component
+            deleter(p);     // delete component first
+            module.reset(); // remove module ref (not technically needed)
+        });
+    ALOGI("created component");
+    return res;
+}
+
+std::shared_ptr<const C2Component::Traits>
+GoldfishComponentStore::ComponentModule::getTraits() {
+    std::unique_lock<std::recursive_mutex> lock(mLock);
+    return mTraits;
+}
+
+// We have a property set indicating whether to use the host side codec
+// or not (ro.boot.qemu.hwcodec.<mLibNameSuffix>).
+static std::string BuildHWCodecPropName(const char *libname) {
+    using namespace std::literals::string_literals;
+    return "ro.boot.qemu.hwcodec."s + libname;
+}
+
+static bool useAndroidGoldfishComponentInstance(const char *libname) {
+    const std::string propName = BuildHWCodecPropName(libname);
+    char propValue[PROP_VALUE_MAX];
+    bool myret = property_get(propName.c_str(), propValue, "") > 0 &&
+                 strcmp("2", propValue) == 0;
+    if (myret) {
+        ALOGD("%s %d found prop %s val %s", __func__, __LINE__, propName.c_str(),
+              propValue);
+    }
+    return myret;
+}
+
+GoldfishComponentStore::GoldfishComponentStore()
+    : mVisited(false), mReflector(std::make_shared<C2ReflectorHelper>()) {
+
+    ALOGW("created goldfish store %p reflector of param %p", this,
+          mReflector.get());
+    auto emplace = [this](const char *libPath) {
+        mComponents.emplace(libPath, libPath);
+    };
+
+    if (useAndroidGoldfishComponentInstance("vpxdec")) {
+        emplace("libcodec2_goldfish_vp8dec.so");
+        emplace("libcodec2_goldfish_vp9dec.so");
+    }
+    if (useAndroidGoldfishComponentInstance("avcdec")) {
+        emplace("libcodec2_goldfish_avcdec.so");
+    }
+    if (useAndroidGoldfishComponentInstance("hevcdec")) {
+        emplace("libcodec2_goldfish_hevcdec.so");
+    }
+}
+
+c2_status_t
+GoldfishComponentStore::copyBuffer(std::shared_ptr<C2GraphicBuffer> src,
+                                   std::shared_ptr<C2GraphicBuffer> dst) {
+    (void)src;
+    (void)dst;
+    return C2_OMITTED;
+}
+
+c2_status_t GoldfishComponentStore::query_sm(
+    const std::vector<C2Param *> &stackParams,
+    const std::vector<C2Param::Index> &heapParamIndices,
+    std::vector<std::unique_ptr<C2Param>> *const heapParams) const {
+    (void)heapParams;
+    return stackParams.empty() && heapParamIndices.empty() ? C2_OK
+                                                           : C2_BAD_INDEX;
+}
+
+c2_status_t GoldfishComponentStore::config_sm(
+    const std::vector<C2Param *> &params,
+    std::vector<std::unique_ptr<C2SettingResult>> *const failures) {
+    (void)failures;
+    return params.empty() ? C2_OK : C2_BAD_INDEX;
+}
+
+void GoldfishComponentStore::visitComponents() {
+    std::lock_guard<std::mutex> lock(mMutex);
+    if (mVisited) {
+        return;
+    }
+    for (auto &pathAndLoader : mComponents) {
+        const C2String &path = pathAndLoader.first;
+        ComponentLoader &loader = pathAndLoader.second;
+        std::shared_ptr<ComponentModule> module;
+        if (loader.fetchModule(&module) == C2_OK) {
+            std::shared_ptr<const C2Component::Traits> traits =
+                module->getTraits();
+            if (traits) {
+                mComponentList.push_back(traits);
+                mComponentNameToPath.emplace(traits->name, path);
+                for (const C2String &alias : traits->aliases) {
+                    mComponentNameToPath.emplace(alias, path);
+                }
+            }
+        }
+    }
+    mVisited = true;
+}
+
+std::vector<std::shared_ptr<const C2Component::Traits>>
+GoldfishComponentStore::listComponents() {
+    // This method SHALL return within 500ms.
+    visitComponents();
+    return mComponentList;
+}
+
+c2_status_t GoldfishComponentStore::findComponent(
+    C2String name, std::shared_ptr<ComponentModule> *module) {
+    (*module).reset();
+    visitComponents();
+
+    auto pos = mComponentNameToPath.find(name);
+    if (pos != mComponentNameToPath.end()) {
+        return mComponents.at(pos->second).fetchModule(module);
+    }
+    return C2_NOT_FOUND;
+}
+
+c2_status_t GoldfishComponentStore::createComponent(
+    C2String name, std::shared_ptr<C2Component> *const component) {
+    // This method SHALL return within 100ms.
+    component->reset();
+    std::shared_ptr<ComponentModule> module;
+    c2_status_t res = findComponent(name, &module);
+    if (res == C2_OK) {
+        // TODO: get a unique node ID
+        res = module->createComponent(0, component);
+    }
+    return res;
+}
+
+c2_status_t GoldfishComponentStore::createInterface(
+    C2String name, std::shared_ptr<C2ComponentInterface> *const interface) {
+    // This method SHALL return within 100ms.
+    interface->reset();
+    std::shared_ptr<ComponentModule> module;
+    c2_status_t res = findComponent(name, &module);
+    if (res == C2_OK) {
+        // TODO: get a unique node ID
+        res = module->createInterface(0, interface);
+    }
+    return res;
+}
+
+c2_status_t GoldfishComponentStore::querySupportedParams_nb(
+    std::vector<std::shared_ptr<C2ParamDescriptor>> *const params) const {
+    (void)params;
+    return C2_OK;
+}
+
+c2_status_t GoldfishComponentStore::querySupportedValues_sm(
+    std::vector<C2FieldSupportedValuesQuery> &fields) const {
+    return fields.empty() ? C2_OK : C2_BAD_INDEX;
+}
+
+std::shared_ptr<C2ParamReflector>
+GoldfishComponentStore::getParamReflector() const {
+    return mReflector;
+}
+
+} // namespace android
diff --git a/system/codecs/c2/store/include/goldfish_codec2/store/GoldfishComponentStore.h b/system/codecs/c2/store/include/goldfish_codec2/store/GoldfishComponentStore.h
new file mode 100644
index 0000000..f484bd4
--- /dev/null
+++ b/system/codecs/c2/store/include/goldfish_codec2/store/GoldfishComponentStore.h
@@ -0,0 +1,214 @@
+/* Copyright (C) 2020 The Android Open Source Project
+**
+** This software is licensed under the terms of the GNU General Public
+** License version 2, as published by the Free Software Foundation, and
+** may be copied, distributed, and modified under those terms.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+** GNU General Public License for more details.
+*/
+
+#pragma once
+
+#include <map>
+#include <mutex>
+
+#include <C2Component.h>
+#include <C2ComponentFactory.h>
+#include <android-base/thread_annotations.h>
+#include <util/C2InterfaceHelper.h>
+
+namespace android {
+
+class GoldfishComponentStore : public C2ComponentStore {
+  public:
+    static std::shared_ptr<C2ComponentStore> Create();
+
+    virtual std::vector<std::shared_ptr<const C2Component::Traits>>
+    listComponents() override;
+    virtual std::shared_ptr<C2ParamReflector>
+    getParamReflector() const override;
+    virtual C2String getName() const override;
+    virtual c2_status_t querySupportedValues_sm(
+        std::vector<C2FieldSupportedValuesQuery> &fields) const override;
+    virtual c2_status_t querySupportedParams_nb(
+        std::vector<std::shared_ptr<C2ParamDescriptor>> *const params)
+        const override;
+    virtual c2_status_t query_sm(
+        const std::vector<C2Param *> &stackParams,
+        const std::vector<C2Param::Index> &heapParamIndices,
+        std::vector<std::unique_ptr<C2Param>> *const heapParams) const override;
+    virtual c2_status_t createInterface(
+        C2String name,
+        std::shared_ptr<C2ComponentInterface> *const interface) override;
+    virtual c2_status_t
+    createComponent(C2String name,
+                    std::shared_ptr<C2Component> *const component) override;
+    virtual c2_status_t
+    copyBuffer(std::shared_ptr<C2GraphicBuffer> src,
+               std::shared_ptr<C2GraphicBuffer> dst) override;
+    virtual c2_status_t config_sm(
+        const std::vector<C2Param *> &params,
+        std::vector<std::unique_ptr<C2SettingResult>> *const failures) override;
+    GoldfishComponentStore();
+
+    virtual ~GoldfishComponentStore() override = default;
+
+  private:
+    /**
+     * An object encapsulating a loaded component module.
+     *
+     * \todo provide a way to add traits to known components here to avoid
+     * loading the .so-s for listComponents
+     */
+    struct ComponentModule
+        : public C2ComponentFactory,
+          public std::enable_shared_from_this<ComponentModule> {
+        virtual c2_status_t
+        createComponent(c2_node_id_t id,
+                        std::shared_ptr<C2Component> *component,
+                        ComponentDeleter deleter =
+                            std::default_delete<C2Component>()) override;
+        virtual c2_status_t createInterface(
+            c2_node_id_t id, std::shared_ptr<C2ComponentInterface> *interface,
+            InterfaceDeleter deleter =
+                std::default_delete<C2ComponentInterface>()) override;
+
+        /**
+         * \returns the traits of the component in this module.
+         */
+        std::shared_ptr<const C2Component::Traits> getTraits();
+
+        /**
+         * Creates an uninitialized component module.
+         *
+         * \param name[in]  component name.
+         *
+         * \note Only used by ComponentLoader.
+         */
+        ComponentModule()
+            : mInit(C2_NO_INIT), mLibHandle(nullptr), createFactory(nullptr),
+              destroyFactory(nullptr), mComponentFactory(nullptr) {}
+
+        /**
+         * Initializes a component module with a given library path. Must be
+         * called exactly once.
+         *
+         * \note Only used by ComponentLoader.
+         *
+         * \param libPath[in] library path
+         *
+         * \retval C2_OK        the component module has been successfully
+         * loaded \retval C2_NO_MEMORY not enough memory to loading the
+         * component module \retval C2_NOT_FOUND could not locate the component
+         * module \retval C2_CORRUPTED the component module could not be loaded
+         * (unexpected) \retval C2_REFUSED   permission denied to load the
+         * component module (unexpected) \retval C2_TIMED_OUT could not load the
+         * module within the time limit (unexpected)
+         */
+        c2_status_t init(std::string libPath);
+
+        virtual ~ComponentModule() override;
+
+      protected:
+        std::recursive_mutex mLock; ///< lock protecting mTraits
+        std::shared_ptr<C2Component::Traits>
+            mTraits; ///< cached component traits
+
+        c2_status_t mInit; ///< initialization result
+
+        void *mLibHandle; ///< loaded library handle
+        C2ComponentFactory::CreateCodec2FactoryFunc
+            createFactory; ///< loaded create function
+        C2ComponentFactory::DestroyCodec2FactoryFunc
+            destroyFactory; ///< loaded destroy function
+        C2ComponentFactory
+            *mComponentFactory; ///< loaded/created component factory
+    };
+
+    /**
+     * An object encapsulating a loadable component module.
+     *
+     * \todo make this also work for enumerations
+     */
+    struct ComponentLoader {
+        /**
+         * Load the component module.
+         *
+         * This method simply returns the component module if it is already
+         * currently loaded, or attempts to load it if it is not.
+         *
+         * \param module[out] pointer to the shared pointer where the loaded
+         * module shall be stored. This will be nullptr on error.
+         *
+         * \retval C2_OK        the component module has been successfully
+         * loaded \retval C2_NO_MEMORY not enough memory to loading the
+         * component module \retval C2_NOT_FOUND could not locate the component
+         * module \retval C2_CORRUPTED the component module could not be loaded
+         * \retval C2_REFUSED   permission denied to load the component module
+         */
+        c2_status_t fetchModule(std::shared_ptr<ComponentModule> *module) {
+            c2_status_t res = C2_OK;
+            std::lock_guard<std::mutex> lock(mMutex);
+            std::shared_ptr<ComponentModule> localModule = mModule.lock();
+            if (localModule == nullptr) {
+                localModule = std::make_shared<ComponentModule>();
+                res = localModule->init(mLibPath);
+                if (res == C2_OK) {
+                    mModule = localModule;
+                }
+            }
+            *module = localModule;
+            return res;
+        }
+
+        /**
+         * Creates a component loader for a specific library path (or name).
+         */
+        ComponentLoader(std::string libPath) : mLibPath(libPath) {}
+
+      private:
+        std::mutex mMutex; ///< mutex guarding the module
+        std::weak_ptr<ComponentModule>
+            mModule;          ///< weak reference to the loaded module
+        std::string mLibPath; ///< library path
+    };
+
+    /**
+     * Retrieves the component module for a component.
+     *
+     * \param module pointer to a shared_pointer where the component module will
+     * be stored on success.
+     *
+     * \retval C2_OK        the component loader has been successfully retrieved
+     * \retval C2_NO_MEMORY not enough memory to locate the component loader
+     * \retval C2_NOT_FOUND could not locate the component to be loaded
+     * \retval C2_CORRUPTED the component loader could not be identified due to
+     * some modules being corrupted (this can happen if the name does not refer
+     * to an already identified component but some components could not be
+     * loaded due to bad library) \retval C2_REFUSED   permission denied to find
+     * the component loader for the named component (this can happen if the name
+     * does not refer to an already identified component but some components
+     * could not be loaded due to lack of permissions)
+     */
+    c2_status_t findComponent(C2String name,
+                              std::shared_ptr<ComponentModule> *module);
+
+    /**
+     * Loads each component module and discover its contents.
+     */
+    void visitComponents();
+
+    std::mutex
+        mMutex;    ///< mutex guarding the component lists during construction
+    bool mVisited; ///< component modules visited
+    std::map<C2String, ComponentLoader>
+        mComponents; ///< path -> component module
+    std::map<C2String, C2String> mComponentNameToPath; ///< name -> path
+    std::vector<std::shared_ptr<const C2Component::Traits>> mComponentList;
+
+    std::shared_ptr<C2ReflectorHelper> mReflector;
+};
+} // namespace android
diff --git a/system/codecs/omx/Android.mk b/system/codecs/omx/Android.mk
new file mode 100644
index 0000000..c307f8e
--- /dev/null
+++ b/system/codecs/omx/Android.mk
@@ -0,0 +1,16 @@
+#
+# Copyright 2018 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+include $(call all-subdir-makefiles)
diff --git a/system/codecs/omx/avcdec/Android.mk b/system/codecs/omx/avcdec/Android.mk
new file mode 100644
index 0000000..4ab6db3
--- /dev/null
+++ b/system/codecs/omx/avcdec/Android.mk
@@ -0,0 +1,57 @@
+#
+# Copyright 2019 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+LOCAL_PATH := $(call my-dir)
+
+commonSources := \
+        GoldfishAVCDec.cpp  \
+        MediaH264Decoder.cpp
+
+$(call emugl-begin-shared-library,libstagefright_goldfish_avcdec$(GOLDFISH_OPENGL_LIB_SUFFIX))
+
+LOCAL_SRC_FILES := $(commonSources)
+
+LOCAL_CFLAGS += -DLOG_TAG=\"goldfish_avcdec\"
+LOCAL_CFLAGS += -Wno-unused-private-field
+
+$(call emugl-export,SHARED_LIBRARIES,libcutils libutils liblog)
+
+LOCAL_HEADER_LIBRARIES := media_plugin_headers \
+                          libmedia_headers \
+                          libbinder_headers \
+                          libhidlbase_impl_internal \
+                          libbase
+LOCAL_HEADER_LIBRARIES += libui_headers \
+                          libnativewindow_headers \
+                          libhardware_headers \
+                          libarect_headers \
+                          libarect_headers_for_ndk
+LOCAL_SHARED_LIBRARIES :=       \
+        libbinder               \
+        libutils                \
+        liblog                  \
+        libcutils               \
+        libui \
+        [email protected] \
+	    [email protected] \
+		[email protected] \
+        libstagefright_foundation
+
+LOCAL_HEADER_LIBRARIES += libgralloc_cb.ranchu
+
+$(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
+$(call emugl-import,libgoldfish_codecs_common)
+$(call emugl-import,libstagefrighthw)
+$(call emugl-end-module)
diff --git a/system/codecs/omx/avcdec/GoldfishAVCDec.cpp b/system/codecs/omx/avcdec/GoldfishAVCDec.cpp
new file mode 100644
index 0000000..02c0dc1
--- /dev/null
+++ b/system/codecs/omx/avcdec/GoldfishAVCDec.cpp
@@ -0,0 +1,631 @@
+/*
+ * Copyright 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <utils/Log.h>
+
+#define DEBUG  0
+#if DEBUG
+#  define  DDD(...)    ALOGD(__VA_ARGS__)
+#else
+#  define  DDD(...)    ((void)0)
+#endif
+
+#include "GoldfishAVCDec.h"
+
+#include <media/stagefright/foundation/ADebug.h>
+#include <media/stagefright/MediaDefs.h>
+#include <OMX_VideoExt.h>
+#include <inttypes.h>
+
+#include <nativebase/nativebase.h>
+
+#include <android/hardware/graphics/allocator/3.0/IAllocator.h>
+#include <android/hardware/graphics/mapper/3.0/IMapper.h>
+#include <hidl/LegacySupport.h>
+
+using ::android::hardware::graphics::common::V1_2::PixelFormat;
+using ::android::hardware::graphics::common::V1_0::BufferUsage;
+
+namespace android {
+
+#define componentName                   "video_decoder.avc"
+#define codingType                      OMX_VIDEO_CodingAVC
+#define CODEC_MIME_TYPE                 MEDIA_MIMETYPE_VIDEO_AVC
+
+/** Function and structure definitions to keep code similar for each codec */
+#define ivdec_api_function              ih264d_api_function
+#define ivdext_create_ip_t              ih264d_create_ip_t
+#define ivdext_create_op_t              ih264d_create_op_t
+#define ivdext_delete_ip_t              ih264d_delete_ip_t
+#define ivdext_delete_op_t              ih264d_delete_op_t
+#define ivdext_ctl_set_num_cores_ip_t   ih264d_ctl_set_num_cores_ip_t
+#define ivdext_ctl_set_num_cores_op_t   ih264d_ctl_set_num_cores_op_t
+
+#define IVDEXT_CMD_CTL_SET_NUM_CORES    \
+        (IVD_CONTROL_API_COMMAND_TYPE_T)IH264D_CMD_CTL_SET_NUM_CORES
+
+static const CodecProfileLevel kProfileLevels[] = {
+    { OMX_VIDEO_AVCProfileConstrainedBaseline, OMX_VIDEO_AVCLevel52 },
+
+    { OMX_VIDEO_AVCProfileBaseline, OMX_VIDEO_AVCLevel52 },
+
+    { OMX_VIDEO_AVCProfileMain,     OMX_VIDEO_AVCLevel52 },
+
+    { OMX_VIDEO_AVCProfileConstrainedHigh,     OMX_VIDEO_AVCLevel52 },
+
+    { OMX_VIDEO_AVCProfileHigh,     OMX_VIDEO_AVCLevel52 },
+};
+
+GoldfishAVCDec::GoldfishAVCDec(
+        const char *name,
+        const OMX_CALLBACKTYPE *callbacks,
+        OMX_PTR appData,
+        OMX_COMPONENTTYPE **component, RenderMode renderMode)
+    : GoldfishVideoDecoderOMXComponent(
+            name, componentName, codingType,
+            kProfileLevels, ARRAY_SIZE(kProfileLevels),
+            320 /* width */, 240 /* height */, callbacks,
+            appData, component),
+      mOmxColorFormat(OMX_COLOR_FormatYUV420Planar),
+      mChangingResolution(false),
+      mSignalledError(false),
+      mInputOffset(0), mRenderMode(renderMode){
+    initPorts(
+            1 /* numMinInputBuffers */, kNumBuffers, INPUT_BUF_SIZE,
+            1 /* numMinOutputBuffers */, kNumBuffers, CODEC_MIME_TYPE);
+
+    mTimeStart = mTimeEnd = systemTime();
+
+    // If input dump is enabled, then open create an empty file
+    GENERATE_FILE_NAMES();
+    CREATE_DUMP_FILE(mInFile);
+    ALOGI("created %s %d object %p", __func__, __LINE__, this);
+}
+
+GoldfishAVCDec::~GoldfishAVCDec() {
+    CHECK_EQ(deInitDecoder(), (status_t)OK);
+    DDD("destroyed %s %d object %p", __func__, __LINE__, this);
+}
+
+void GoldfishAVCDec::logVersion() {
+    // TODO: get emulation decoder implementation version from the host.
+    ALOGI("GoldfishAVC decoder version 1.0");
+}
+
+status_t GoldfishAVCDec::resetPlugin() {
+    mIsInFlush = false;
+    mReceivedEOS = false;
+
+    /* Initialize both start and end times */
+    mTimeStart = mTimeEnd = systemTime();
+
+    return OK;
+}
+
+status_t GoldfishAVCDec::resetDecoder() {
+    if (mContext) {
+    // The resolution may have changed, so our safest bet is to just destroy the
+    // current context and recreate another one, with the new width and height.
+    mContext->destroyH264Context();
+    mContext.reset(nullptr);
+
+    }
+    return OK;
+}
+
+status_t GoldfishAVCDec::setFlushMode() {
+    /* Set the decoder in Flush mode, subsequent decode() calls will flush */
+    mIsInFlush = true;
+    mContext->flush();
+    return OK;
+}
+
+status_t GoldfishAVCDec::initDecoder() {
+    /* Initialize the decoder */
+    if (mEnableAndroidNativeBuffers == false) {
+        mRenderMode = RenderMode::RENDER_BY_GUEST_CPU;
+    }
+    mContext.reset(new MediaH264Decoder(mRenderMode));
+    mContext->initH264Context(mWidth,
+                              mHeight,
+                              mWidth,
+                              mHeight,
+                              MediaH264Decoder::PixelFormat::YUV420P);
+
+    /* Reset the plugin state */
+    resetPlugin();
+
+    /* Get codec version */
+    logVersion();
+
+    return OK;
+}
+
+status_t GoldfishAVCDec::deInitDecoder() {
+    if (mContext) {
+        mContext->destroyH264Context();
+        mContext.reset();
+    }
+
+    mChangingResolution = false;
+
+    return OK;
+}
+
+void GoldfishAVCDec::onReset() {
+    GoldfishVideoDecoderOMXComponent::onReset();
+
+    mSignalledError = false;
+    mInputOffset = 0;
+    resetDecoder();
+    resetPlugin();
+}
+
+bool GoldfishAVCDec::getVUIParams(h264_image_t& img) {
+    int32_t primaries = img.color_primaries;
+    bool fullRange = img.color_range == 2 ? true : false;
+    int32_t transfer = img.color_trc;
+    int32_t coeffs = img.colorspace;
+
+    ColorAspects colorAspects;
+    ColorUtils::convertIsoColorAspectsToCodecAspects(
+            primaries, transfer, coeffs, fullRange, colorAspects);
+
+    DDD("img pts %lld, primaries %d, range %d transfer %d colorspace %d", (long long)img.pts,
+            (int)img.color_primaries, (int)img.color_range, (int)img.color_trc, (int)img.colorspace);
+
+    // Update color aspects if necessary.
+    if (colorAspectsDiffer(colorAspects, mBitstreamColorAspects)) {
+        mBitstreamColorAspects = colorAspects;
+        status_t err = handleColorAspectsChange();
+        CHECK(err == OK);
+    }
+    return true;
+}
+
+bool GoldfishAVCDec::setDecodeArgs(
+        OMX_BUFFERHEADERTYPE *inHeader,
+        OMX_BUFFERHEADERTYPE *outHeader) {
+    size_t sizeY = outputBufferWidth() * outputBufferHeight();
+    size_t sizeUV = sizeY / 4;
+
+    /* When in flush and after EOS with zero byte input,
+     * inHeader is set to zero. Hence check for non-null */
+    if (inHeader) {
+        mConsumedBytes = inHeader->nFilledLen - mInputOffset;
+        mInPBuffer = inHeader->pBuffer + inHeader->nOffset + mInputOffset;
+        DDD("got input timestamp %lld in-addr-base %p real-data-offset %d inputoffset %d", (long long)(inHeader->nTimeStamp),
+                inHeader->pBuffer, (int)(inHeader->nOffset + mInputOffset), (int)mInputOffset);
+    } else {
+        mConsumedBytes = 0;
+        mInPBuffer = nullptr;
+    }
+
+    if (outHeader) {
+        if (outHeader->nAllocLen < sizeY + (sizeUV * 2)) {
+            ALOGE("outHeader->nAllocLen %d < needed size %d", outHeader->nAllocLen, (int)(sizeY + sizeUV * 2));
+            android_errorWriteLog(0x534e4554, "27833616");
+            return false;
+        }
+        mOutHeaderBuf = outHeader->pBuffer;
+    } else {
+        // We flush out on the host side
+        mOutHeaderBuf = nullptr;
+    }
+
+    return true;
+}
+
+void GoldfishAVCDec::readAndDiscardAllHostBuffers() {
+    while (mContext) {
+        h264_image_t img = mContext->getImage();
+        if (img.data != nullptr) {
+            DDD("img pts %lld is discarded", (long long)img.pts);
+        } else {
+            return;
+        }
+    }
+}
+
+void GoldfishAVCDec::onPortFlushCompleted(OMX_U32 portIndex) {
+    /* Once the output buffers are flushed, ignore any buffers that are held in decoder */
+    if (kOutputPortIndex == portIndex) {
+        setFlushMode();
+        DDD("%s %d", __func__, __LINE__);
+        readAndDiscardAllHostBuffers();
+        mContext->resetH264Context(mWidth, mHeight, mWidth, mHeight, MediaH264Decoder::PixelFormat::YUV420P);
+        if (!mCsd0.empty() && !mCsd1.empty()) {
+            mContext->decodeFrame(&(mCsd0[0]), mCsd0.size(), 0);
+            mContext->getImage();
+            mContext->decodeFrame(&(mCsd1[0]), mCsd1.size(), 0);
+            mContext->getImage();
+        }
+        resetPlugin();
+    } else {
+        mInputOffset = 0;
+    }
+}
+
+void GoldfishAVCDec::copyImageData( OMX_BUFFERHEADERTYPE *outHeader, h264_image_t & img) {
+    int myStride = outputBufferWidth();
+    for (int i=0; i < mHeight; ++i) {
+        memcpy(outHeader->pBuffer + i * myStride, img.data + i * mWidth, mWidth);
+    }
+    int Y = myStride * outputBufferHeight();
+    for (int i=0; i < mHeight/2; ++i) {
+        memcpy(outHeader->pBuffer + Y + i * myStride / 2 , img.data + mWidth * mHeight + i * mWidth/2, mWidth/2);
+    }
+    int UV = Y/4;
+    for (int i=0; i < mHeight/2; ++i) {
+        memcpy(outHeader->pBuffer + Y + UV + i * myStride / 2 , img.data + mWidth * mHeight * 5/4 + i * mWidth/2, mWidth/2);
+    }
+}
+
+int GoldfishAVCDec::getHostColorBufferId(void* header) {
+  if (mNWBuffers.find(header) == mNWBuffers.end()) {
+      DDD("cannot find color buffer for header %p", header);
+    return -1;
+  }
+  sp<ANativeWindowBuffer> nBuf = mNWBuffers[header];
+  cb_handle_t *handle = (cb_handle_t*)nBuf->handle;
+  DDD("found color buffer for header %p --> %d", header, handle->hostHandle);
+  return handle->hostHandle;
+}
+
+void GoldfishAVCDec::onQueueFilled(OMX_U32 portIndex) {
+    static int count1=0;
+    DDD("calling %s count %d object %p", __func__, ++count1, this);
+    UNUSED(portIndex);
+    OMX_BUFFERHEADERTYPE *inHeader = NULL;
+    BufferInfo *inInfo = NULL;
+
+    if (mSignalledError) {
+        return;
+    }
+    if (mOutputPortSettingsChange != NONE) {
+        return;
+    }
+
+    if (mContext == nullptr) {
+        if (OK != initDecoder()) {
+            ALOGE("Failed to initialize decoder");
+            notify(OMX_EventError, OMX_ErrorUnsupportedSetting, 0, NULL);
+            mSignalledError = true;
+            return;
+        }
+    }
+
+    List<BufferInfo *> &inQueue = getPortQueue(kInputPortIndex);
+    List<BufferInfo *> &outQueue = getPortQueue(kOutputPortIndex);
+
+    int count2=0;
+    while (!outQueue.empty()) {
+        DDD("calling %s in while loop count %d", __func__, ++count2);
+        BufferInfo *outInfo;
+        OMX_BUFFERHEADERTYPE *outHeader;
+
+        if (!mIsInFlush && (NULL == inHeader)) {
+            if (!inQueue.empty()) {
+                inInfo = *inQueue.begin();
+                inHeader = inInfo->mHeader;
+                if (inHeader == NULL) {
+                    inQueue.erase(inQueue.begin());
+                    inInfo->mOwnedByUs = false;
+                    continue;
+                }
+            } else {
+                break;
+            }
+        }
+
+        outInfo = *outQueue.begin();
+        outHeader = outInfo->mHeader;
+        outHeader->nFlags = 0;
+        outHeader->nTimeStamp = 0;
+        outHeader->nOffset = 0;
+
+        if (inHeader != NULL) {
+            if (inHeader->nFilledLen == 0) {
+                // An empty buffer can be end of stream (EOS) buffer, so
+                // we'll set the decoder in flush mode if so. If it's not EOS,
+                // then just release the buffer.
+                inQueue.erase(inQueue.begin());
+                inInfo->mOwnedByUs = false;
+                notifyEmptyBufferDone(inHeader);
+
+                if (!(inHeader->nFlags & OMX_BUFFERFLAG_EOS)) {
+                    return;
+                }
+
+                mReceivedEOS = true;
+                inHeader = NULL;
+                setFlushMode();
+            } else if (inHeader->nFlags & OMX_BUFFERFLAG_EOS) {
+                mReceivedEOS = true;
+            }
+        }
+
+        {
+
+            if (!setDecodeArgs(inHeader, outHeader)) {
+                ALOGE("Decoder arg setup failed");
+                notify(OMX_EventError, OMX_ErrorUndefined, 0, NULL);
+                mSignalledError = true;
+                return;
+            }
+
+            // TODO: We also need to send the timestamp
+            h264_result_t h264Res = {(int)MediaH264Decoder::Err::NoErr, 0};
+            if (inHeader != nullptr) {
+                if (inHeader->nFlags & OMX_BUFFERFLAG_CODECCONFIG) { 
+                    unsigned long mysize = (inHeader->nFilledLen - mInputOffset);
+                    uint8_t* mydata = mInPBuffer;
+                    if (mCsd0.empty()) {
+                        mCsd0.assign(mydata, mydata + mysize);
+                    } else if (mCsd1.empty()) {
+                        mCsd1.assign(mydata, mydata + mysize);
+                    }
+                }
+                DDD("Decoding frame(sz=%lu)", (unsigned long)(inHeader->nFilledLen - mInputOffset));
+                h264Res = mContext->decodeFrame(mInPBuffer,
+                                                inHeader->nFilledLen - mInputOffset,
+                                                inHeader->nTimeStamp);
+                mConsumedBytes = h264Res.bytesProcessed;
+                if (h264Res.ret == (int)MediaH264Decoder::Err::DecoderRestarted) {
+                    mChangingResolution = true;
+                }
+            } else {
+                DDD("No more input data. Attempting to get a decoded frame, if any.");
+            }
+            h264_image_t img = {};
+
+            bool readBackPixels = true;
+            if (mRenderMode == RenderMode::RENDER_BY_GUEST_CPU) {
+              img = mContext->getImage();
+            } else {
+                int hostColorBufferId = getHostColorBufferId(outHeader);
+                if (hostColorBufferId >= 0) {
+                    img = mContext->renderOnHostAndReturnImageMetadata(getHostColorBufferId(outHeader));
+                    readBackPixels = false;
+                } else {
+                    img = mContext->getImage();
+                }
+            }
+
+
+            if (img.data != nullptr) {
+                getVUIParams(img);
+            }
+
+
+            if (inHeader) {
+                DDD("input time stamp %lld flag %d", inHeader->nTimeStamp, (int)(inHeader->nFlags));
+            }
+
+            // If the decoder is in the changing resolution mode and there is no output present,
+            // that means the switching is done and it's ready to reset the decoder and the plugin.
+            if (mChangingResolution && img.data == nullptr) {
+                mChangingResolution = false;
+                DDD("re-create decoder because resolution changed");
+                bool portWillReset = false;
+                handlePortSettingsChange(&portWillReset, img.width, img.height);
+                {
+                    DDD("handling port reset");
+                    DDD("port resetting (img.width=%u, img.height=%u, mWidth=%u, mHeight=%u)",
+                          img.width, img.height, mWidth, mHeight);
+                    //resetDecoder();
+                    resetPlugin();
+
+                //mContext->destroyH264Context();
+                //mContext.reset(new MediaH264Decoder());
+                mContext->resetH264Context(mWidth,
+                              mHeight,
+                              mWidth,
+                              mHeight,
+                              MediaH264Decoder::PixelFormat::YUV420P);
+                //mInputOffset += mConsumedBytes;
+                return;
+                }
+            }
+
+            if (img.data != nullptr) {
+                int myWidth = img.width;
+                int myHeight = img.height;
+                if (myWidth != mWidth || myHeight != mHeight) {
+                    bool portWillReset = false;
+                    handlePortSettingsChange(&portWillReset, myWidth, myHeight);
+                    resetPlugin();
+                    mWidth = myWidth;
+                    mHeight = myHeight;
+                    if (portWillReset) {
+                        DDD("port will reset return now");
+                        return;
+                    } else {
+                        DDD("port will NOT reset keep going now");
+                    }
+                }
+                outHeader->nFilledLen =  (outputBufferWidth() * outputBufferHeight() * 3) / 2;
+                if (readBackPixels) {
+                  if (outputBufferWidth() == mWidth && outputBufferHeight() == mHeight) {
+                    memcpy(outHeader->pBuffer, img.data, outHeader->nFilledLen);
+                  } else {
+                    copyImageData(outHeader, img);
+                  }
+                }
+
+                outHeader->nTimeStamp = img.pts;
+                DDD("got output timestamp %lld", (long long)(img.pts));
+
+                outInfo->mOwnedByUs = false;
+                outQueue.erase(outQueue.begin());
+                outInfo = NULL;
+                notifyFillBufferDone(outHeader);
+                outHeader = NULL;
+            } else if (mIsInFlush) {
+                DDD("not img.data and it is in flush mode");
+                /* If in flush mode and no output is returned by the codec,
+                 * then come out of flush mode */
+                mIsInFlush = false;
+
+                /* If EOS was recieved on input port and there is no output
+                 * from the codec, then signal EOS on output port */
+                if (mReceivedEOS) {
+                    ALOGI("received EOS, re-create host context");
+                    outHeader->nFilledLen = 0;
+                    outHeader->nFlags |= OMX_BUFFERFLAG_EOS;
+
+                    outInfo->mOwnedByUs = false;
+                    outQueue.erase(outQueue.begin());
+                    outInfo = NULL;
+                    notifyFillBufferDone(outHeader);
+                    outHeader = NULL;
+                    resetPlugin();
+
+                    //mContext->destroyH264Context();
+                //mContext.reset(new MediaH264Decoder());
+                    mContext->resetH264Context(mWidth,
+                              mHeight,
+                              mWidth,
+                              mHeight,
+                              MediaH264Decoder::PixelFormat::YUV420P);
+
+                }
+            }
+            mInputOffset += mConsumedBytes;
+        }
+
+        // If more than 4 bytes are remaining in input, then do not release it
+        if (inHeader != NULL && ((inHeader->nFilledLen - mInputOffset) <= 4)) {
+            inInfo->mOwnedByUs = false;
+            inQueue.erase(inQueue.begin());
+            inInfo = NULL;
+            notifyEmptyBufferDone(inHeader);
+            inHeader = NULL;
+            mInputOffset = 0;
+
+            /* If input EOS is seen and decoder is not in flush mode,
+             * set the decoder in flush mode.
+             * There can be a case where EOS is sent along with last picture data
+             * In that case, only after decoding that input data, decoder has to be
+             * put in flush. This case is handled here  */
+
+            if (mReceivedEOS && !mIsInFlush) {
+                setFlushMode();
+            }
+        }
+    }
+}
+
+OMX_ERRORTYPE GoldfishAVCDec::internalGetParameter(
+        OMX_INDEXTYPE index, OMX_PTR params) {
+    const int32_t indexFull = index;
+    switch (indexFull) {
+        case kGetAndroidNativeBufferUsageIndex:
+        {
+            DDD("calling kGetAndroidNativeBufferUsageIndex");
+            GetAndroidNativeBufferUsageParams* nativeBuffersUsage = (GetAndroidNativeBufferUsageParams *) params;
+            nativeBuffersUsage->nUsage = (unsigned int)(BufferUsage::GPU_DATA_BUFFER);
+            return OMX_ErrorNone;
+        }
+
+        default:
+            return GoldfishVideoDecoderOMXComponent::internalGetParameter(index, params);
+    }
+}
+
+OMX_ERRORTYPE GoldfishAVCDec::internalSetParameter(
+        OMX_INDEXTYPE index, const OMX_PTR params) {
+    // Include extension index OMX_INDEXEXTTYPE.
+    const int32_t indexFull = index;
+
+    switch (indexFull) {
+        case kEnableAndroidNativeBuffersIndex:
+        {
+            DDD("calling kEnableAndroidNativeBuffersIndex");
+            EnableAndroidNativeBuffersParams* enableNativeBuffers = (EnableAndroidNativeBuffersParams *) params;
+            if (enableNativeBuffers) {
+                mEnableAndroidNativeBuffers = enableNativeBuffers->enable;
+                if (mEnableAndroidNativeBuffers == false) {
+                    mNWBuffers.clear();
+                    DDD("disabled kEnableAndroidNativeBuffersIndex");
+                } else {
+                    DDD("enabled kEnableAndroidNativeBuffersIndex");
+                }
+            }
+            return OMX_ErrorNone;
+        }
+
+        case kUseAndroidNativeBufferIndex:
+        {
+            if (mEnableAndroidNativeBuffers == false) {
+                ALOGE("Error: not enabled Android Native Buffers");
+                return OMX_ErrorBadParameter;
+            }
+            UseAndroidNativeBufferParams *use_buffer_params = (UseAndroidNativeBufferParams *)params;
+            if (use_buffer_params) {
+                sp<ANativeWindowBuffer> nBuf = use_buffer_params->nativeBuffer;
+                cb_handle_t *handle = (cb_handle_t*)nBuf->handle;
+                void* dst = NULL;
+                DDD("kUseAndroidNativeBufferIndex with handle %p host color handle %d calling usebuffer", handle,
+                      handle->hostHandle);
+                useBufferCallerLockedAlready(use_buffer_params->bufferHeader,use_buffer_params->nPortIndex,
+                        use_buffer_params->pAppPrivate,handle->allocatedSize(), (OMX_U8*)dst);
+                mNWBuffers[*(use_buffer_params->bufferHeader)] = use_buffer_params->nativeBuffer;;
+            }
+            return OMX_ErrorNone;
+        }
+
+        default:
+            return GoldfishVideoDecoderOMXComponent::internalSetParameter(index, params);
+    }
+}
+
+OMX_ERRORTYPE GoldfishAVCDec::getExtensionIndex(
+        const char *name, OMX_INDEXTYPE *index) {
+
+    if (mRenderMode == RenderMode::RENDER_BY_HOST_GPU) {
+        if (!strcmp(name, "OMX.google.android.index.enableAndroidNativeBuffers")) {
+            DDD("calling getExtensionIndex for enable ANB");
+            *(int32_t*)index = kEnableAndroidNativeBuffersIndex;
+            return OMX_ErrorNone;
+        } else if (!strcmp(name, "OMX.google.android.index.useAndroidNativeBuffer")) {
+            *(int32_t*)index = kUseAndroidNativeBufferIndex;
+            return OMX_ErrorNone;
+        } else if (!strcmp(name, "OMX.google.android.index.getAndroidNativeBufferUsage")) {
+            *(int32_t*)index = kGetAndroidNativeBufferUsageIndex;
+            return OMX_ErrorNone;
+        }
+    }
+    return GoldfishVideoDecoderOMXComponent::getExtensionIndex(name, index);
+}
+
+int GoldfishAVCDec::getColorAspectPreference() {
+    return kPreferBitstream;
+}
+
+}  // namespace android
+
+android::GoldfishOMXComponent *createGoldfishOMXComponent(
+        const char *name, const OMX_CALLBACKTYPE *callbacks, OMX_PTR appData,
+        OMX_COMPONENTTYPE **component) {
+    if (!strncmp("OMX.android.goldfish", name, 20)) {
+      return new android::GoldfishAVCDec(name, callbacks, appData, component, RenderMode::RENDER_BY_HOST_GPU);
+    } else {
+      return new android::GoldfishAVCDec(name, callbacks, appData, component, RenderMode::RENDER_BY_GUEST_CPU);
+    }
+}
+
diff --git a/system/codecs/omx/avcdec/GoldfishAVCDec.h b/system/codecs/omx/avcdec/GoldfishAVCDec.h
new file mode 100644
index 0000000..0fd52b0
--- /dev/null
+++ b/system/codecs/omx/avcdec/GoldfishAVCDec.h
@@ -0,0 +1,184 @@
+/*
+ * Copyright 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef GOLDFISH_H264_DEC_H_
+
+#define GOLDFISH_H264_DEC_H_
+
+#include "GoldfishVideoDecoderOMXComponent.h"
+#include "MediaH264Decoder.h"
+#include <sys/time.h>
+
+#include <vector>
+#include <map>
+
+#include <gralloc_cb_bp.h>
+#include <utils/RefBase.h>
+#include <utils/threads.h>
+#include <utils/Vector.h>
+#include <utils/List.h>
+#include <ui/GraphicBuffer.h>
+
+
+namespace android {
+
+/** Number of entries in the time-stamp array */
+#define MAX_TIME_STAMPS 64
+
+/** Maximum number of cores supported by the codec */
+#define CODEC_MAX_NUM_CORES 4
+
+#define CODEC_MAX_WIDTH     1920
+
+#define CODEC_MAX_HEIGHT    1088
+
+/** Input buffer size */
+#define INPUT_BUF_SIZE (1024 * 1024)
+
+#define MIN(a, b) ((a) < (b)) ? (a) : (b)
+
+/** Used to remove warnings about unused parameters */
+#define UNUSED(x) ((void)(x))
+
+struct GoldfishAVCDec : public GoldfishVideoDecoderOMXComponent {
+    GoldfishAVCDec(const char *name, const OMX_CALLBACKTYPE *callbacks,
+            OMX_PTR appData, OMX_COMPONENTTYPE **component, RenderMode renderMode);
+
+protected:
+    virtual ~GoldfishAVCDec();
+
+    virtual void onQueueFilled(OMX_U32 portIndex);
+    virtual void onPortFlushCompleted(OMX_U32 portIndex);
+    virtual void onReset();
+    virtual int getColorAspectPreference();
+
+    virtual OMX_ERRORTYPE internalGetParameter(OMX_INDEXTYPE index, OMX_PTR params);
+
+    virtual OMX_ERRORTYPE internalSetParameter(OMX_INDEXTYPE index, const OMX_PTR params);
+
+    virtual OMX_ERRORTYPE getExtensionIndex(const char *name, OMX_INDEXTYPE *index);
+
+private:
+    // Number of input and output buffers
+    enum {
+        kNumBuffers = 8
+    };
+
+    RenderMode  mRenderMode = RenderMode::RENDER_BY_GUEST_CPU;
+    bool mEnableAndroidNativeBuffers = false;
+    std::map<void*, sp<ANativeWindowBuffer>> mNWBuffers;
+
+    int getHostColorBufferId(void* header);
+
+    size_t mNumCores;            // Number of cores to be uesd by the codec
+
+    nsecs_t mTimeStart;   // Time at the start of decode()
+    nsecs_t mTimeEnd;     // Time at the end of decode()
+
+#ifdef FILE_DUMP_ENABLE
+    char mInFile[200];
+#endif /* FILE_DUMP_ENABLE */
+
+    OMX_COLOR_FORMATTYPE mOmxColorFormat;    // OMX Color format
+
+    bool mIsInFlush;        // codec is flush mode
+    bool mReceivedEOS;      // EOS is receieved on input port
+
+    // The input stream has changed to a different resolution, which is still supported by the
+    // codec. So the codec is switching to decode the new resolution.
+    bool mChangingResolution;
+    bool mSignalledError;
+    size_t mInputOffset;
+
+    status_t initDecoder();
+    status_t deInitDecoder();
+    status_t setFlushMode();
+    status_t setParams(size_t stride);
+    void logVersion();
+    status_t setNumCores();
+    status_t resetDecoder();
+    status_t resetPlugin();
+
+
+    void readAndDiscardAllHostBuffers();
+
+    bool setDecodeArgs(
+            OMX_BUFFERHEADERTYPE *inHeader,
+            OMX_BUFFERHEADERTYPE *outHeader);
+
+    bool getVUIParams(h264_image_t& img);
+
+    void copyImageData( OMX_BUFFERHEADERTYPE *outHeader, h264_image_t & img);
+
+    std::unique_ptr<MediaH264Decoder> mContext;
+    std::vector<uint8_t> mCsd0;
+    std::vector<uint8_t> mCsd1;
+    uint64_t mConsumedBytes = 0;
+    uint8_t* mInPBuffer = nullptr;
+    uint8_t* mOutHeaderBuf = nullptr;
+    DISALLOW_EVIL_CONSTRUCTORS(GoldfishAVCDec);
+};
+#ifdef FILE_DUMP_ENABLE
+
+#define INPUT_DUMP_PATH     "/sdcard/media/avcd_input"
+#define INPUT_DUMP_EXT      "h264"
+
+#define GENERATE_FILE_NAMES() {                         \
+    strcpy(mInFile, "");                                \
+    sprintf(mInFile, "%s_%lld.%s", INPUT_DUMP_PATH,     \
+            (long long) mTimeStart,                     \
+            INPUT_DUMP_EXT);                            \
+}
+
+#define CREATE_DUMP_FILE(m_filename) {                  \
+    FILE *fp = fopen(m_filename, "wb");                 \
+    if (fp != NULL) {                                   \
+        fclose(fp);                                     \
+    } else {                                            \
+        ALOGD("Could not open file %s", m_filename);    \
+    }                                                   \
+}
+#define DUMP_TO_FILE(m_filename, m_buf, m_size, m_offset)\
+{                                                       \
+    FILE *fp = fopen(m_filename, "ab");                 \
+    if (fp != NULL && m_buf != NULL && m_offset == 0) { \
+        int i;                                          \
+        i = fwrite(m_buf, 1, m_size, fp);               \
+        ALOGD("fwrite ret %d to write %d", i, m_size);  \
+        if (i != (int) m_size) {                        \
+            ALOGD("Error in fwrite, returned %d", i);   \
+            perror("Error in write to file");           \
+        }                                               \
+    } else if (fp == NULL) {                            \
+        ALOGD("Could not write to file %s", m_filename);\
+    }                                                   \
+    if (fp) {                                           \
+        fclose(fp);                                     \
+    }                                                   \
+}
+#else /* FILE_DUMP_ENABLE */
+#define INPUT_DUMP_PATH
+#define INPUT_DUMP_EXT
+#define OUTPUT_DUMP_PATH
+#define OUTPUT_DUMP_EXT
+#define GENERATE_FILE_NAMES()
+#define CREATE_DUMP_FILE(m_filename)
+#define DUMP_TO_FILE(m_filename, m_buf, m_size, m_offset)
+#endif /* FILE_DUMP_ENABLE */
+
+} // namespace android
+
+#endif  // GOLDFISH_H264_DEC_H_
diff --git a/system/codecs/omx/avcdec/MediaH264Decoder.cpp b/system/codecs/omx/avcdec/MediaH264Decoder.cpp
new file mode 100644
index 0000000..6e14797
--- /dev/null
+++ b/system/codecs/omx/avcdec/MediaH264Decoder.cpp
@@ -0,0 +1,209 @@
+/*
+ * Copyright 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <utils/Log.h>
+
+#define DEBUG  0
+#if DEBUG
+#  define  DDD(...)    ALOGD(__VA_ARGS__)
+#else
+#  define  DDD(...)    ((void)0)
+#endif
+
+#include "MediaH264Decoder.h"
+#include "goldfish_media_utils.h"
+#include <string.h>
+
+MediaH264Decoder::MediaH264Decoder(RenderMode renderMode) :mRenderMode(renderMode) {
+  if (renderMode == RenderMode::RENDER_BY_HOST_GPU) {
+      mVersion = 200;
+  } else if (renderMode == RenderMode::RENDER_BY_GUEST_CPU) {
+      mVersion = 100;
+  }
+}
+
+void MediaH264Decoder::initH264Context(unsigned int width,
+                                       unsigned int height,
+                                       unsigned int outWidth,
+                                       unsigned int outHeight,
+                                       PixelFormat pixFmt) {
+    auto transport = GoldfishMediaTransport::getInstance();
+    if (!mHasAddressSpaceMemory) {
+        int slot = transport->getMemorySlot();
+        if (slot < 0) {
+            ALOGE("ERROR: Failed to initH264Context: cannot get memory slot");
+            return;
+        }
+        mSlot = slot;
+        mAddressOffSet = static_cast<unsigned int>(mSlot) * (1 << 20);
+        DDD("got memory lot %d addrr %x", mSlot, mAddressOffSet);
+        mHasAddressSpaceMemory = true;
+    }
+    transport->writeParam(mVersion, 0, mAddressOffSet);
+    transport->writeParam(width, 1, mAddressOffSet);
+    transport->writeParam(height, 2, mAddressOffSet);
+    transport->writeParam(outWidth, 3, mAddressOffSet);
+    transport->writeParam(outHeight, 4, mAddressOffSet);
+    transport->writeParam(static_cast<uint64_t>(pixFmt), 5, mAddressOffSet);
+    transport->sendOperation(MediaCodecType::H264Codec,
+                             MediaOperation::InitContext, mAddressOffSet);
+    auto* retptr = transport->getReturnAddr(mAddressOffSet);
+    mHostHandle = *(uint64_t*)(retptr);
+    DDD("initH264Context: got handle to host %lld", mHostHandle);
+}
+
+
+void MediaH264Decoder::resetH264Context(unsigned int width,
+                                       unsigned int height,
+                                       unsigned int outWidth,
+                                       unsigned int outHeight,
+                                       PixelFormat pixFmt) {
+    auto transport = GoldfishMediaTransport::getInstance();
+    if (!mHasAddressSpaceMemory) {
+        ALOGE("%s no address space memory", __func__);
+        return;
+    }
+    transport->writeParam((uint64_t)mHostHandle, 0, mAddressOffSet);
+    transport->writeParam(width, 1, mAddressOffSet);
+    transport->writeParam(height, 2, mAddressOffSet);
+    transport->writeParam(outWidth, 3, mAddressOffSet);
+    transport->writeParam(outHeight, 4, mAddressOffSet);
+    transport->writeParam(static_cast<uint64_t>(pixFmt), 5, mAddressOffSet);
+    transport->sendOperation(MediaCodecType::H264Codec,
+                             MediaOperation::Reset, mAddressOffSet);
+    DDD("resetH264Context: done");
+}
+
+
+void MediaH264Decoder::destroyH264Context() {
+
+    DDD("return memory lot %d addrr %x", (int)(mAddressOffSet >> 23), mAddressOffSet);
+    auto transport = GoldfishMediaTransport::getInstance();
+    transport->writeParam((uint64_t)mHostHandle, 0, mAddressOffSet);
+    transport->sendOperation(MediaCodecType::H264Codec,
+                             MediaOperation::DestroyContext, mAddressOffSet);
+    transport->returnMemorySlot(mSlot);
+    mHasAddressSpaceMemory = false;
+}
+
+h264_result_t MediaH264Decoder::decodeFrame(uint8_t* img, size_t szBytes, uint64_t pts) {
+    DDD("decode frame: use handle to host %lld", mHostHandle);
+    h264_result_t res = {0, 0};
+    if (!mHasAddressSpaceMemory) {
+        ALOGE("%s no address space memory", __func__);
+        return res;
+    }
+    auto transport = GoldfishMediaTransport::getInstance();
+    uint8_t* hostSrc = transport->getInputAddr(mAddressOffSet);
+    if (img != nullptr && szBytes > 0) {
+        memcpy(hostSrc, img, szBytes);
+    }
+    transport->writeParam((uint64_t)mHostHandle, 0, mAddressOffSet);
+    transport->writeParam(transport->offsetOf((uint64_t)(hostSrc)) - mAddressOffSet, 1, mAddressOffSet);
+    transport->writeParam((uint64_t)szBytes, 2, mAddressOffSet);
+    transport->writeParam((uint64_t)pts, 3, mAddressOffSet);
+    transport->sendOperation(MediaCodecType::H264Codec,
+                             MediaOperation::DecodeImage, mAddressOffSet);
+
+
+    auto* retptr = transport->getReturnAddr(mAddressOffSet);
+    res.bytesProcessed = *(uint64_t*)(retptr);
+    res.ret = *(int*)(retptr + 8);
+
+    return res;
+}
+
+void MediaH264Decoder::flush() {
+    if (!mHasAddressSpaceMemory) {
+        ALOGE("%s no address space memory", __func__);
+        return;
+    }
+    DDD("flush: use handle to host %lld", mHostHandle);
+    auto transport = GoldfishMediaTransport::getInstance();
+    transport->writeParam((uint64_t)mHostHandle, 0, mAddressOffSet);
+    transport->sendOperation(MediaCodecType::H264Codec,
+                             MediaOperation::Flush, mAddressOffSet);
+}
+
+h264_image_t MediaH264Decoder::getImage() {
+    DDD("getImage: use handle to host %lld", mHostHandle);
+    h264_image_t res { };
+    if (!mHasAddressSpaceMemory) {
+        ALOGE("%s no address space memory", __func__);
+        return res;
+    }
+    auto transport = GoldfishMediaTransport::getInstance();
+    uint8_t* dst = transport->getInputAddr(mAddressOffSet); // Note: reuse the same addr for input and output
+    transport->writeParam((uint64_t)mHostHandle, 0, mAddressOffSet);
+    transport->writeParam(transport->offsetOf((uint64_t)(dst)) - mAddressOffSet, 1, mAddressOffSet);
+    transport->writeParam(-1, 2, mAddressOffSet);
+    transport->sendOperation(MediaCodecType::H264Codec,
+                             MediaOperation::GetImage, mAddressOffSet);
+    auto* retptr = transport->getReturnAddr(mAddressOffSet);
+    res.ret = *(int*)(retptr);
+    if (res.ret >= 0) {
+        res.data = dst;
+        res.width = *(uint32_t*)(retptr + 8);
+        res.height = *(uint32_t*)(retptr + 16);
+        res.pts = *(uint64_t*)(retptr + 24);
+        res.color_primaries = *(uint32_t*)(retptr + 32);
+        res.color_range = *(uint32_t*)(retptr + 40);
+        res.color_trc = *(uint32_t*)(retptr + 48);
+        res.colorspace = *(uint32_t*)(retptr + 56);
+    } else if (res.ret == (int)(Err::DecoderRestarted)) {
+        res.width = *(uint32_t*)(retptr + 8);
+        res.height = *(uint32_t*)(retptr + 16);
+    }
+    return res;
+}
+
+
+h264_image_t MediaH264Decoder::renderOnHostAndReturnImageMetadata(int hostColorBufferId) {
+    DDD("%s: use handle to host %lld", __func__, mHostHandle);
+    h264_image_t res { };
+    if (hostColorBufferId < 0) {
+      ALOGE("%s negative color buffer id %d", __func__, hostColorBufferId);
+      return res;
+    }
+    DDD("%s send color buffer id %d", __func__, hostColorBufferId);
+    if (!mHasAddressSpaceMemory) {
+        ALOGE("%s no address space memory", __func__);
+        return res;
+    }
+    auto transport = GoldfishMediaTransport::getInstance();
+    uint8_t* dst = transport->getInputAddr(mAddressOffSet); // Note: reuse the same addr for input and output
+    transport->writeParam((uint64_t)mHostHandle, 0, mAddressOffSet);
+    transport->writeParam(transport->offsetOf((uint64_t)(dst)) - mAddressOffSet, 1, mAddressOffSet);
+    transport->writeParam((uint64_t)hostColorBufferId, 2, mAddressOffSet);
+    transport->sendOperation(MediaCodecType::H264Codec,
+                             MediaOperation::GetImage, mAddressOffSet);
+    auto* retptr = transport->getReturnAddr(mAddressOffSet);
+    res.ret = *(int*)(retptr);
+    if (res.ret >= 0) {
+        res.data = dst; // note: the data could be junk
+        res.width = *(uint32_t*)(retptr + 8);
+        res.height = *(uint32_t*)(retptr + 16);
+        res.pts = *(uint64_t*)(retptr + 24);
+        res.color_primaries = *(uint32_t*)(retptr + 32);
+        res.color_range = *(uint32_t*)(retptr + 40);
+        res.color_trc = *(uint32_t*)(retptr + 48);
+        res.colorspace = *(uint32_t*)(retptr + 56);
+    } else if (res.ret == (int)(Err::DecoderRestarted)) {
+        res.width = *(uint32_t*)(retptr + 8);
+        res.height = *(uint32_t*)(retptr + 16);
+    }
+    return res;
+}
diff --git a/system/codecs/omx/avcdec/MediaH264Decoder.h b/system/codecs/omx/avcdec/MediaH264Decoder.h
new file mode 100644
index 0000000..a75758f
--- /dev/null
+++ b/system/codecs/omx/avcdec/MediaH264Decoder.h
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef GOLDFISH_MEDIA_H264_DEC_H_
+#define GOLDFISH_MEDIA_H264_DEC_H_
+
+struct h264_init_result_t {
+    uint64_t host_handle;
+    int ret;
+};
+
+struct h264_result_t {
+    int ret;
+    uint64_t bytesProcessed;
+};
+
+struct h264_image_t {
+    const uint8_t* data;
+    uint32_t width;
+    uint32_t height;
+    uint64_t pts; // presentation time stamp
+    uint64_t color_primaries;
+    uint64_t color_range;
+    uint64_t color_trc;
+    uint64_t colorspace;
+    // on success, |ret| will indicate the size of |data|.
+    // If failed, |ret| will contain some negative error code.
+    int ret;
+};
+
+enum class RenderMode {
+  RENDER_BY_HOST_GPU = 1,
+  RENDER_BY_GUEST_CPU = 2,
+};
+
+class MediaH264Decoder {
+    uint64_t mHostHandle = 0;
+    uint32_t mVersion = 100;
+    RenderMode  mRenderMode = RenderMode::RENDER_BY_GUEST_CPU;
+
+    bool mHasAddressSpaceMemory = false;
+    uint64_t mAddressOffSet = 0;
+    int mSlot = -1;
+
+public:
+    MediaH264Decoder(RenderMode renderMode);
+    virtual ~MediaH264Decoder() = default;
+
+    enum class PixelFormat : uint8_t {
+        YUV420P = 0,
+        UYVY422 = 1,
+        BGRA8888 = 2,
+    };
+
+    enum class Err : int {
+        NoErr = 0,
+        NoDecodedFrame = -1,
+        InitContextFailed = -2,
+        DecoderRestarted = -3,
+        NALUIgnored = -4,
+    };
+
+    bool getAddressSpaceMemory();
+    void initH264Context(unsigned int width,
+                         unsigned int height,
+                         unsigned int outWidth,
+                         unsigned int outHeight,
+                         PixelFormat pixFmt);
+    void resetH264Context(unsigned int width,
+                         unsigned int height,
+                         unsigned int outWidth,
+                         unsigned int outHeight,
+                         PixelFormat pixFmt);
+    void destroyH264Context();
+    h264_result_t decodeFrame(uint8_t* img, size_t szBytes, uint64_t pts);
+    void flush();
+    // ask host to copy image data back to guest, with image metadata
+    // to guest as well
+    h264_image_t getImage();
+    // ask host to render to hostColorBufferId, return only image metadata back to
+    // guest
+    h264_image_t renderOnHostAndReturnImageMetadata(int hostColorBufferId);
+};
+#endif
diff --git a/system/codecs/omx/common/Android.mk b/system/codecs/omx/common/Android.mk
new file mode 100644
index 0000000..6b1674c
--- /dev/null
+++ b/system/codecs/omx/common/Android.mk
@@ -0,0 +1,48 @@
+#
+# Copyright 2019 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+LOCAL_PATH := $(call my-dir)
+
+commonSources := \
+        goldfish_media_utils.cpp
+
+$(call emugl-begin-shared-library,libgoldfish_codecs_common$(GOLDFISH_OPENGL_LIB_SUFFIX))
+
+LOCAL_SRC_FILES := $(commonSources)
+
+LOCAL_CFLAGS += -DLOG_TAG=\"goldfish_codecs_common\"
+LOCAL_CFLAGS += -Wno-unused-private-field
+
+$(call emugl-export,SHARED_LIBRARIES,libcutils libutils liblog)
+
+$(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
+
+ifeq (true,$(GOLDFISH_OPENGL_BUILD_FOR_HOST))
+$(call emugl-import,libGoldfishAddressSpace$(GOLDFISH_OPENGL_LIB_SUFFIX))
+else
+$(call emugl-export,STATIC_LIBRARIES,libplatform)
+$(call emugl-export,STATIC_LIBRARIES,libGoldfishAddressSpace)
+
+ifeq (true,$(GFXSTREAM))
+
+LOCAL_CFLAGS += -DVIRTIO_GPU
+LOCAL_C_INCLUDES += external/libdrm external/minigbm/cros_gralloc
+LOCAL_SHARED_LIBRARIES += libdrm
+
+endif
+
+endif
+
+$(call emugl-end-module)
diff --git a/system/codecs/omx/common/goldfish_media_utils.cpp b/system/codecs/omx/common/goldfish_media_utils.cpp
new file mode 100644
index 0000000..2cf6ff6
--- /dev/null
+++ b/system/codecs/omx/common/goldfish_media_utils.cpp
@@ -0,0 +1,217 @@
+// Copyright 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "goldfish_media_utils.h"
+
+#include "goldfish_address_space.h"
+
+#include <log/log.h>
+
+#define DEBUG  0
+#if DEBUG
+#  define  DDD(...)    ALOGD(__VA_ARGS__)
+#else
+#  define  DDD(...)    ((void)0)
+#endif
+
+#include <memory>
+#include <vector>
+#include <mutex>
+
+
+
+std::mutex sSingletonMutex;
+std::unique_ptr<GoldfishMediaTransport> sTransport;
+
+class GoldfishMediaTransportImpl : public GoldfishMediaTransport {
+public:
+    GoldfishMediaTransportImpl();
+    ~GoldfishMediaTransportImpl();
+
+    virtual void writeParam(__u64 val, unsigned int num, unsigned int offSetToStartAddr = 0) override;
+    virtual bool sendOperation(MediaCodecType type, MediaOperation op, unsigned int offSetToStartAddr = 0) override;
+    virtual uint8_t* getBaseAddr() const override;
+    virtual uint8_t* getInputAddr(unsigned int offSet = 0) const override;
+    virtual uint8_t* getOutputAddr() const override;
+    virtual uint8_t* getReturnAddr(unsigned int offSet = 0) const override;
+    virtual __u64 offsetOf(uint64_t addr) const override;
+
+public:
+    // each lot has 2 M
+    virtual int getMemorySlot() override {
+        std::lock_guard<std::mutex> g{mMemoryMutex};
+        // when there are just 1 decoder, it can pretty
+        // much use all the memory starting from 0;
+        // when there are two, each can use at least half
+        // the total memory, etc.
+        constexpr size_t search_order[] = {
+                0, // use 32M
+                16, // use 16M
+                8, 24, // use 8M
+                4, 12, 20, 28, // use 4M
+                2, 6, 10, 12, 18, 22, 26, 30, // use 2M
+                1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31 // use 1M
+        };
+        for (size_t i = 0; i < sizeof(search_order)/sizeof(search_order[0]); ++i) {
+            int slot = search_order[i];
+            if (mMemoryLotsAvailable[slot]) {
+                mMemoryLotsAvailable[slot] = false;
+                return slot;
+            }
+        }
+        return -1;
+    }
+    virtual void returnMemorySlot(int lot) override {
+        if (lot < 0 || lot >= mMemoryLotsAvailable.size()) {
+            return;
+        }
+        std::lock_guard<std::mutex> g{mMemoryMutex};
+        if (mMemoryLotsAvailable[lot] == false) {
+            mMemoryLotsAvailable[lot] = true;
+        } else {
+            ALOGE("Error, cannot twice");
+        }
+    }
+private:
+    std::mutex mMemoryMutex;
+    std::vector<bool> mMemoryLotsAvailable = std::vector<bool>(32,true);
+
+    address_space_handle_t mHandle;
+    uint64_t  mOffset;
+    uint64_t  mPhysAddr;
+    uint64_t  mSize;
+    void* mStartPtr = nullptr;
+
+    // MediaCodecType will be or'd together with the metadata, so the highest 8-bits
+    // will have the type.
+    static __u64 makeMetadata(MediaCodecType type,
+                              MediaOperation op, uint64_t offset);
+
+    // Chunk size for parameters/return data
+    static constexpr size_t kParamSizeBytes = 4096; // 4K
+    // Chunk size for input
+    static constexpr size_t kInputSizeBytes = 4096 * 4096; // 16M
+    // Chunk size for output
+    static constexpr size_t kOutputSizeBytes = 4096 * 4096; // 16M
+    // Maximum number of parameters that can be passed
+    static constexpr size_t kMaxParams = 32;
+    // Offset from the memory region for return data (8 is size of
+    // a parameter in bytes)
+    static constexpr size_t kReturnOffset = 8 * kMaxParams;
+};
+
+GoldfishMediaTransportImpl::~GoldfishMediaTransportImpl() {
+  if(mHandle >= 0) {
+    goldfish_address_space_close(mHandle);
+    mHandle = -1;
+  }
+}
+
+GoldfishMediaTransportImpl::GoldfishMediaTransportImpl() {
+    // Allocate host memory; the contiguous memory region will be laid out as
+    // follows:
+    // ========================================================
+    // | kParamSizeBytes | kInputSizeBytes | kOutputSizeBytes |
+    // ========================================================
+    mHandle = goldfish_address_space_open();
+    if (mHandle < 0) {
+        ALOGE("Failed to ping host to allocate memory");
+        abort();
+    }
+    mSize = kParamSizeBytes + kInputSizeBytes + kOutputSizeBytes;
+    bool success = goldfish_address_space_allocate(mHandle, mSize, &mPhysAddr, &mOffset);
+    if (success) {
+        ALOGI("successfully allocated %d bytes in goldfish_address_block", (int)mSize);
+        mStartPtr = goldfish_address_space_map(mHandle, mOffset, mSize);
+        ALOGI("guest address is %p", mStartPtr);
+
+        struct address_space_ping pingInfo;
+        pingInfo.metadata = GoldfishAddressSpaceSubdeviceType::Media;
+        pingInfo.offset = mOffset;
+        if (goldfish_address_space_ping(mHandle, &pingInfo) == false) {
+            ALOGE("Failed to ping host to allocate memory");
+            abort();
+            return;
+        } else {
+            ALOGI("successfully pinged host to allocate memory");
+        }
+    } else {
+        ALOGE("failed to allocate %d bytes in goldfish_address_block", (int)mSize);
+        abort();
+    }
+}
+
+// static
+GoldfishMediaTransport* GoldfishMediaTransport::getInstance() {
+    std::lock_guard<std::mutex> g{sSingletonMutex};
+    if (sTransport == nullptr) {
+        sTransport.reset(new GoldfishMediaTransportImpl());
+    }
+    return sTransport.get();
+}
+
+// static
+__u64 GoldfishMediaTransportImpl::makeMetadata(MediaCodecType type,
+                                               MediaOperation op, uint64_t offset) {
+    // Shift |type| into the highest 8-bits, leaving the lower bits for other
+    // metadata.
+    offset = offset >> 20;
+    if (offset < 0 || offset >= 32) {
+        ALOGE("offset %d is wrong", (int)offset);
+        abort();
+    }
+    return ((__u64)type << (64 - 8)) | (offset << 8) | static_cast<uint8_t>(op);
+}
+
+uint8_t* GoldfishMediaTransportImpl::getInputAddr(unsigned int offSet) const {
+    return (uint8_t*)mStartPtr + kParamSizeBytes + offSet;
+}
+
+uint8_t* GoldfishMediaTransportImpl::getOutputAddr() const {
+    return getInputAddr() + kInputSizeBytes;
+}
+
+uint8_t* GoldfishMediaTransportImpl::getBaseAddr() const {
+    return (uint8_t*)mStartPtr;
+}
+
+uint8_t* GoldfishMediaTransportImpl::getReturnAddr(unsigned int offSet) const {
+    return (uint8_t*)mStartPtr + kReturnOffset + offSet;
+}
+
+__u64 GoldfishMediaTransportImpl::offsetOf(uint64_t addr) const {
+    return addr - (uint64_t)mStartPtr;
+}
+
+void GoldfishMediaTransportImpl::writeParam(__u64 val, unsigned int num, unsigned int offSetToStartAddr) {
+    uint8_t* p = (uint8_t*)mStartPtr + (offSetToStartAddr);
+    uint64_t* pint = (uint64_t*)(p + 8 * num);
+    *pint = val;
+}
+
+bool GoldfishMediaTransportImpl::sendOperation(MediaCodecType type,
+                                               MediaOperation op, unsigned int offSetToStartAddr) {
+    struct address_space_ping pingInfo;
+    pingInfo.metadata = makeMetadata(type, op, offSetToStartAddr);
+    pingInfo.offset = mOffset; // + (offSetToStartAddr);
+    if (goldfish_address_space_ping(mHandle, &pingInfo) == false) {
+        ALOGE("failed to ping host");
+        abort();
+        return false;
+    } else {
+        DDD("successfully pinged host for operation type=%d, op=%d", (int)type, (int)op);
+    }
+
+    return true;
+}
diff --git a/system/codecs/omx/common/goldfish_media_utils.h b/system/codecs/omx/common/goldfish_media_utils.h
new file mode 100644
index 0000000..d25ee30
--- /dev/null
+++ b/system/codecs/omx/common/goldfish_media_utils.h
@@ -0,0 +1,100 @@
+// Copyright 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <linux/types.h>
+#include <stdint.h>
+
+#ifndef GOLDFISH_COMMON_GOLDFISH_DEFS_H
+#define GOLDFISH_COMMON_GOLDFISH_DEFS_H
+
+enum class MediaCodecType : __u8 {
+    VP8Codec = 0,
+    VP9Codec = 1,
+    H264Codec = 2,
+    Max = 3,
+};
+
+enum class MediaOperation : __u8 {
+    InitContext = 0,
+    DestroyContext = 1,
+    DecodeImage = 2,
+    GetImage = 3,
+    Flush = 4,
+    Reset = 5,
+    Max = 6,
+};
+
+// This class will abstract away the knowledge required to send media codec data
+// to the host. The implementation should only need the following information to
+// properly send the data:
+//   1) Which codec to use (MediaCodecType)
+//   2) What operation to perform (MediaOperation)
+//
+// Example:
+//   auto transport = GoldfishMediaTransport::getInstance();
+//
+class GoldfishMediaTransport {
+protected:
+    GoldfishMediaTransport() {}
+
+public:
+    virtual ~GoldfishMediaTransport() {}
+
+    // Writes a parameter to send to the host. Each parameter will take up
+    // 64-bits. |val| is the value of the parameter, and |num| is the parameter
+    // number, starting from 0. If |val| is an address, wrap it around
+    // offsetOf(), e.g., writeParam(offsetOf((uint64_t)ptr), 2);
+    virtual void writeParam(__u64 val, unsigned int num, unsigned int offSetToStartAddr = 0) = 0;
+    // Send the operation to perform to the host. At the time of this call, any
+    // parameters that the host needs should have already been passed using
+    // writeParam().
+    virtual bool sendOperation(MediaCodecType codec, MediaOperation op, unsigned int offSetToStartAddr = 0) = 0;
+    // Get the address for input. This is usually given the the codec context to
+    // write data into for the host to process.
+    virtual uint8_t* getInputAddr(unsigned int offSet = 0) const = 0;
+    // Get the address for base pointer
+    virtual uint8_t* getBaseAddr() const = 0;
+    // Get the address for output. This is usually given to the codec context to
+    // read data written there by the host.
+    virtual uint8_t* getOutputAddr() const = 0;
+    // Get the address for return data from the host. The guest codec
+    // implementation will have knowledge of how the return data is laid out.
+    virtual uint8_t* getReturnAddr(unsigned int offSet = 0) const = 0;
+    // Get the offset of an address relative to the starting address of the
+    // allocated memory region. Use this for passing pointers from the guest to
+    // the host, as the guest address will be translated, thus the offset is the
+    // only value of significance.
+    virtual __u64 offsetOf(uint64_t addr) const = 0;
+
+    // Get a slot of memory (8 M per slot) for use by a decoder instance.
+    // returns -1 for failure; or a slot >=0 on success.
+    // as of now, there are only 4 slots for use, each has 8 M, it is up
+    // to client on how to use it.
+    // 0th slot: [base, base+8M)
+    // ...
+    // ith slot: [base+8M*i, base+8M*(i+1))
+    virtual int getMemorySlot() = 0;
+
+    // Return a slot back to pool. the slot should be valid >=0 and less
+    // than the total size of slots. If nobody returns slot timely, the
+    // new client could get -1 from getMemorySlot()
+    virtual void returnMemorySlot(int slot) = 0;
+
+    static GoldfishMediaTransport* getInstance();
+};
+
+__u64 goldfish_create_media_metadata(MediaCodecType codecType,
+                                     __u64 metadata);
+
+#endif
diff --git a/system/codecs/omx/plugin/Android.mk b/system/codecs/omx/plugin/Android.mk
new file mode 100644
index 0000000..4adfd8a
--- /dev/null
+++ b/system/codecs/omx/plugin/Android.mk
@@ -0,0 +1,54 @@
+#
+# Copyright 2018 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+LOCAL_PATH := $(call my-dir)
+
+commonSources := \
+    GoldfishOMXComponent.cpp \
+    GoldfishOMXPlugin.cpp \
+    GoldfishVideoDecoderOMXComponent.cpp \
+    SimpleGoldfishOMXComponent.cpp \
+
+$(call emugl-begin-shared-library,libstagefrighthw$(GOLDFISH_OPENGL_LIB_SUFFIX))
+
+LOCAL_SRC_FILES := $(commonSources)
+
+LOCAL_CFLAGS += $(PV_CFLAGS_MINUS_VISIBILITY) -Werror
+LOCAL_CFLAGS += -Wno-unused-private-field
+
+LOCAL_C_INCLUDES += \
+        $(call include-path-for, frameworks-native)/media/hardware \
+        $(call include-path-for, frameworks-native)/media/openmax \
+
+$(call emugl-export,SHARED_LIBRARIES,libcutils libutils liblog)
+$(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
+
+LOCAL_HEADER_LIBRARIES += media_plugin_headers \
+	                      libmedia_headers \
+	                      libbinder_headers \
+	                      libhidlbase_impl_internal \
+	                      libbase
+
+LOCAL_SHARED_LIBRARIES +=       \
+        libbinder               \
+        libutils                \
+        liblog                  \
+        libcutils               \
+        [email protected] \
+        libstagefright_foundation
+
+LOCAL_VENDOR_MODULE := true
+
+$(call emugl-end-module)
diff --git a/system/codecs/omx/plugin/GoldfishOMXComponent.cpp b/system/codecs/omx/plugin/GoldfishOMXComponent.cpp
new file mode 100644
index 0000000..021a99b
--- /dev/null
+++ b/system/codecs/omx/plugin/GoldfishOMXComponent.cpp
@@ -0,0 +1,330 @@
+/*
+ * Copyright 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "GoldfishOMXComponent"
+#include "GoldfishOMXComponent.h"
+
+#include <log/log.h>
+
+#include <media/stagefright/foundation/ADebug.h>
+
+namespace android {
+
+GoldfishOMXComponent::GoldfishOMXComponent(
+        const char *name,
+        const OMX_CALLBACKTYPE *callbacks,
+        OMX_PTR appData,
+        OMX_COMPONENTTYPE **component)
+    : mName(name),
+      mCallbacks(callbacks),
+      mComponent(new OMX_COMPONENTTYPE),
+      mLibHandle(NULL) {
+    mComponent->nSize = sizeof(*mComponent);
+    mComponent->nVersion.s.nVersionMajor = 1;
+    mComponent->nVersion.s.nVersionMinor = 0;
+    mComponent->nVersion.s.nRevision = 0;
+    mComponent->nVersion.s.nStep = 0;
+    mComponent->pComponentPrivate = this;
+    mComponent->pApplicationPrivate = appData;
+
+    mComponent->GetComponentVersion = NULL;
+    mComponent->SendCommand = SendCommandWrapper;
+    mComponent->GetParameter = GetParameterWrapper;
+    mComponent->SetParameter = SetParameterWrapper;
+    mComponent->GetConfig = GetConfigWrapper;
+    mComponent->SetConfig = SetConfigWrapper;
+    mComponent->GetExtensionIndex = GetExtensionIndexWrapper;
+    mComponent->GetState = GetStateWrapper;
+    mComponent->ComponentTunnelRequest = NULL;
+    mComponent->UseBuffer = UseBufferWrapper;
+    mComponent->AllocateBuffer = AllocateBufferWrapper;
+    mComponent->FreeBuffer = FreeBufferWrapper;
+    mComponent->EmptyThisBuffer = EmptyThisBufferWrapper;
+    mComponent->FillThisBuffer = FillThisBufferWrapper;
+    mComponent->SetCallbacks = NULL;
+    mComponent->ComponentDeInit = NULL;
+    mComponent->UseEGLImage = NULL;
+    mComponent->ComponentRoleEnum = NULL;
+
+    *component = mComponent;
+}
+
+GoldfishOMXComponent::~GoldfishOMXComponent() {
+    delete mComponent;
+    mComponent = NULL;
+}
+
+void GoldfishOMXComponent::setLibHandle(void *libHandle) {
+    CHECK(libHandle != NULL);
+    mLibHandle = libHandle;
+}
+
+void *GoldfishOMXComponent::libHandle() const {
+    return mLibHandle;
+}
+
+OMX_ERRORTYPE GoldfishOMXComponent::initCheck() {
+    return OMX_ErrorNone;
+}
+
+void
+GoldfishOMXComponent::prepareForDestruction() {
+}
+
+const char *GoldfishOMXComponent::name() const {
+    return mName.c_str();
+}
+
+void GoldfishOMXComponent::notify(
+        OMX_EVENTTYPE event,
+        OMX_U32 data1, OMX_U32 data2, OMX_PTR data) {
+    (*mCallbacks->EventHandler)(
+            mComponent,
+            mComponent->pApplicationPrivate,
+            event,
+            data1,
+            data2,
+            data);
+}
+
+void GoldfishOMXComponent::notifyEmptyBufferDone(OMX_BUFFERHEADERTYPE *header) {
+    (*mCallbacks->EmptyBufferDone)(
+            mComponent, mComponent->pApplicationPrivate, header);
+}
+
+void GoldfishOMXComponent::notifyFillBufferDone(OMX_BUFFERHEADERTYPE *header) {
+    (*mCallbacks->FillBufferDone)(
+            mComponent, mComponent->pApplicationPrivate, header);
+}
+
+// static
+OMX_ERRORTYPE GoldfishOMXComponent::SendCommandWrapper(
+        OMX_HANDLETYPE component,
+        OMX_COMMANDTYPE cmd,
+        OMX_U32 param,
+        OMX_PTR data) {
+    GoldfishOMXComponent *me =
+        (GoldfishOMXComponent *)
+            ((OMX_COMPONENTTYPE *)component)->pComponentPrivate;
+
+    return me->sendCommand(cmd, param, data);
+}
+
+// static
+OMX_ERRORTYPE GoldfishOMXComponent::GetParameterWrapper(
+        OMX_HANDLETYPE component,
+        OMX_INDEXTYPE index,
+        OMX_PTR params) {
+    GoldfishOMXComponent *me =
+        (GoldfishOMXComponent *)
+            ((OMX_COMPONENTTYPE *)component)->pComponentPrivate;
+
+    return me->getParameter(index, params);
+}
+
+// static
+OMX_ERRORTYPE GoldfishOMXComponent::SetParameterWrapper(
+        OMX_HANDLETYPE component,
+        OMX_INDEXTYPE index,
+        OMX_PTR params) {
+    GoldfishOMXComponent *me =
+        (GoldfishOMXComponent *)
+            ((OMX_COMPONENTTYPE *)component)->pComponentPrivate;
+
+    return me->setParameter(index, params);
+}
+
+// static
+OMX_ERRORTYPE GoldfishOMXComponent::GetConfigWrapper(
+        OMX_HANDLETYPE component,
+        OMX_INDEXTYPE index,
+        OMX_PTR params) {
+    GoldfishOMXComponent *me =
+        (GoldfishOMXComponent *)
+            ((OMX_COMPONENTTYPE *)component)->pComponentPrivate;
+
+    return me->getConfig(index, params);
+}
+
+// static
+OMX_ERRORTYPE GoldfishOMXComponent::SetConfigWrapper(
+        OMX_HANDLETYPE component,
+        OMX_INDEXTYPE index,
+        OMX_PTR params) {
+    GoldfishOMXComponent *me =
+        (GoldfishOMXComponent *)
+            ((OMX_COMPONENTTYPE *)component)->pComponentPrivate;
+
+    return me->setConfig(index, params);
+}
+
+// static
+OMX_ERRORTYPE GoldfishOMXComponent::GetExtensionIndexWrapper(
+        OMX_HANDLETYPE component,
+        OMX_STRING name,
+        OMX_INDEXTYPE *index) {
+    GoldfishOMXComponent *me =
+        (GoldfishOMXComponent *)
+            ((OMX_COMPONENTTYPE *)component)->pComponentPrivate;
+
+    return me->getExtensionIndex(name, index);
+}
+
+// static
+OMX_ERRORTYPE GoldfishOMXComponent::UseBufferWrapper(
+        OMX_HANDLETYPE component,
+        OMX_BUFFERHEADERTYPE **buffer,
+        OMX_U32 portIndex,
+        OMX_PTR appPrivate,
+        OMX_U32 size,
+        OMX_U8 *ptr) {
+    GoldfishOMXComponent *me =
+        (GoldfishOMXComponent *)
+            ((OMX_COMPONENTTYPE *)component)->pComponentPrivate;
+
+    return me->useBuffer(buffer, portIndex, appPrivate, size, ptr);
+}
+
+// static
+OMX_ERRORTYPE GoldfishOMXComponent::AllocateBufferWrapper(
+        OMX_HANDLETYPE component,
+        OMX_BUFFERHEADERTYPE **buffer,
+        OMX_U32 portIndex,
+        OMX_PTR appPrivate,
+        OMX_U32 size) {
+    GoldfishOMXComponent *me =
+        (GoldfishOMXComponent *)
+            ((OMX_COMPONENTTYPE *)component)->pComponentPrivate;
+
+    return me->allocateBuffer(buffer, portIndex, appPrivate, size);
+}
+
+// static
+OMX_ERRORTYPE GoldfishOMXComponent::FreeBufferWrapper(
+        OMX_HANDLETYPE component,
+        OMX_U32 portIndex,
+        OMX_BUFFERHEADERTYPE *buffer) {
+    GoldfishOMXComponent *me =
+        (GoldfishOMXComponent *)
+            ((OMX_COMPONENTTYPE *)component)->pComponentPrivate;
+
+    return me->freeBuffer(portIndex, buffer);
+}
+
+// static
+OMX_ERRORTYPE GoldfishOMXComponent::EmptyThisBufferWrapper(
+        OMX_HANDLETYPE component,
+        OMX_BUFFERHEADERTYPE *buffer) {
+    GoldfishOMXComponent *me =
+        (GoldfishOMXComponent *)
+            ((OMX_COMPONENTTYPE *)component)->pComponentPrivate;
+
+    return me->emptyThisBuffer(buffer);
+}
+
+// static
+OMX_ERRORTYPE GoldfishOMXComponent::FillThisBufferWrapper(
+        OMX_HANDLETYPE component,
+        OMX_BUFFERHEADERTYPE *buffer) {
+    GoldfishOMXComponent *me =
+        (GoldfishOMXComponent *)
+            ((OMX_COMPONENTTYPE *)component)->pComponentPrivate;
+
+    return me->fillThisBuffer(buffer);
+}
+
+// static
+OMX_ERRORTYPE GoldfishOMXComponent::GetStateWrapper(
+        OMX_HANDLETYPE component,
+        OMX_STATETYPE *state) {
+    GoldfishOMXComponent *me =
+        (GoldfishOMXComponent *)
+            ((OMX_COMPONENTTYPE *)component)->pComponentPrivate;
+
+    return me->getState(state);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+OMX_ERRORTYPE GoldfishOMXComponent::sendCommand(
+        OMX_COMMANDTYPE /* cmd */, OMX_U32 /* param */, OMX_PTR /* data */) {
+    return OMX_ErrorUndefined;
+}
+
+OMX_ERRORTYPE GoldfishOMXComponent::getParameter(
+        OMX_INDEXTYPE /* index */, OMX_PTR /* params */) {
+    return OMX_ErrorUndefined;
+}
+
+OMX_ERRORTYPE GoldfishOMXComponent::setParameter(
+        OMX_INDEXTYPE /* index */, const OMX_PTR /* params */) {
+    return OMX_ErrorUndefined;
+}
+
+OMX_ERRORTYPE GoldfishOMXComponent::getConfig(
+        OMX_INDEXTYPE /* index */, OMX_PTR /* params */) {
+    return OMX_ErrorUndefined;
+}
+
+OMX_ERRORTYPE GoldfishOMXComponent::setConfig(
+        OMX_INDEXTYPE /* index */, const OMX_PTR /* params */) {
+    return OMX_ErrorUndefined;
+}
+
+OMX_ERRORTYPE GoldfishOMXComponent::getExtensionIndex(
+        const char * /* name */, OMX_INDEXTYPE * /* index */) {
+    return OMX_ErrorUnsupportedIndex;
+}
+
+OMX_ERRORTYPE GoldfishOMXComponent::useBuffer(
+        OMX_BUFFERHEADERTYPE ** /* buffer */,
+        OMX_U32 /* portIndex */,
+        OMX_PTR /* appPrivate */,
+        OMX_U32 /* size */,
+        OMX_U8 * /* ptr */) {
+    return OMX_ErrorUndefined;
+}
+
+OMX_ERRORTYPE GoldfishOMXComponent::allocateBuffer(
+        OMX_BUFFERHEADERTYPE ** /* buffer */,
+        OMX_U32 /* portIndex */,
+        OMX_PTR /* appPrivate */,
+        OMX_U32 /* size */) {
+    return OMX_ErrorUndefined;
+}
+
+OMX_ERRORTYPE GoldfishOMXComponent::freeBuffer(
+        OMX_U32 /* portIndex */,
+        OMX_BUFFERHEADERTYPE * /* buffer */) {
+    return OMX_ErrorUndefined;
+}
+
+OMX_ERRORTYPE GoldfishOMXComponent::emptyThisBuffer(
+        OMX_BUFFERHEADERTYPE * /* buffer */) {
+    return OMX_ErrorUndefined;
+}
+
+OMX_ERRORTYPE GoldfishOMXComponent::fillThisBuffer(
+        OMX_BUFFERHEADERTYPE * /* buffer */) {
+    return OMX_ErrorUndefined;
+}
+
+OMX_ERRORTYPE GoldfishOMXComponent::getState(OMX_STATETYPE * /* state */) {
+    return OMX_ErrorUndefined;
+}
+
+}  // namespace android
diff --git a/system/codecs/omx/plugin/GoldfishOMXComponent.h b/system/codecs/omx/plugin/GoldfishOMXComponent.h
new file mode 100644
index 0000000..87a65ae
--- /dev/null
+++ b/system/codecs/omx/plugin/GoldfishOMXComponent.h
@@ -0,0 +1,189 @@
+/*
+ * Copyright 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef GOLDFISH_OMX_COMPONENT_H_
+
+#define GOLDFISH_OMX_COMPONENT_H_
+
+#include <media/stagefright/foundation/ABase.h>
+#include <media/stagefright/foundation/AString.h>
+#include <utils/RefBase.h>
+
+#include <OMX_Component.h>
+
+namespace android {
+
+struct GoldfishOMXComponent : public RefBase {
+    GoldfishOMXComponent(
+            const char *name,
+            const OMX_CALLBACKTYPE *callbacks,
+            OMX_PTR appData,
+            OMX_COMPONENTTYPE **component);
+
+    virtual OMX_ERRORTYPE initCheck();
+
+    void setLibHandle(void *libHandle);
+    void *libHandle() const;
+
+    virtual void prepareForDestruction();
+
+protected:
+    virtual ~GoldfishOMXComponent();
+
+    const char *name() const;
+
+    void notify(
+            OMX_EVENTTYPE event,
+            OMX_U32 data1, OMX_U32 data2, OMX_PTR data);
+
+    void notifyEmptyBufferDone(OMX_BUFFERHEADERTYPE *header);
+    void notifyFillBufferDone(OMX_BUFFERHEADERTYPE *header);
+
+    virtual OMX_ERRORTYPE sendCommand(
+            OMX_COMMANDTYPE cmd, OMX_U32 param, OMX_PTR data);
+
+    virtual OMX_ERRORTYPE getParameter(
+            OMX_INDEXTYPE index, OMX_PTR params);
+
+    virtual OMX_ERRORTYPE setParameter(
+            OMX_INDEXTYPE index, const OMX_PTR params);
+
+    virtual OMX_ERRORTYPE getConfig(
+            OMX_INDEXTYPE index, OMX_PTR params);
+
+    virtual OMX_ERRORTYPE setConfig(
+            OMX_INDEXTYPE index, const OMX_PTR params);
+
+    virtual OMX_ERRORTYPE getExtensionIndex(
+            const char *name, OMX_INDEXTYPE *index);
+
+    virtual OMX_ERRORTYPE useBuffer(
+            OMX_BUFFERHEADERTYPE **buffer,
+            OMX_U32 portIndex,
+            OMX_PTR appPrivate,
+            OMX_U32 size,
+            OMX_U8 *ptr);
+
+    virtual OMX_ERRORTYPE allocateBuffer(
+            OMX_BUFFERHEADERTYPE **buffer,
+            OMX_U32 portIndex,
+            OMX_PTR appPrivate,
+            OMX_U32 size);
+
+    virtual OMX_ERRORTYPE freeBuffer(
+            OMX_U32 portIndex,
+            OMX_BUFFERHEADERTYPE *buffer);
+
+    virtual OMX_ERRORTYPE emptyThisBuffer(
+            OMX_BUFFERHEADERTYPE *buffer);
+
+    virtual OMX_ERRORTYPE fillThisBuffer(
+            OMX_BUFFERHEADERTYPE *buffer);
+
+    virtual OMX_ERRORTYPE getState(OMX_STATETYPE *state);
+
+private:
+    AString mName;
+    const OMX_CALLBACKTYPE *mCallbacks;
+    OMX_COMPONENTTYPE *mComponent;
+
+    void *mLibHandle;
+
+    static OMX_ERRORTYPE SendCommandWrapper(
+            OMX_HANDLETYPE component,
+            OMX_COMMANDTYPE cmd,
+            OMX_U32 param,
+            OMX_PTR data);
+
+    static OMX_ERRORTYPE GetParameterWrapper(
+            OMX_HANDLETYPE component,
+            OMX_INDEXTYPE index,
+            OMX_PTR params);
+
+    static OMX_ERRORTYPE SetParameterWrapper(
+            OMX_HANDLETYPE component,
+            OMX_INDEXTYPE index,
+            OMX_PTR params);
+
+    static OMX_ERRORTYPE GetConfigWrapper(
+            OMX_HANDLETYPE component,
+            OMX_INDEXTYPE index,
+            OMX_PTR params);
+
+    static OMX_ERRORTYPE SetConfigWrapper(
+            OMX_HANDLETYPE component,
+            OMX_INDEXTYPE index,
+            OMX_PTR params);
+
+    static OMX_ERRORTYPE GetExtensionIndexWrapper(
+            OMX_HANDLETYPE component,
+            OMX_STRING name,
+            OMX_INDEXTYPE *index);
+
+    static OMX_ERRORTYPE UseBufferWrapper(
+            OMX_HANDLETYPE component,
+            OMX_BUFFERHEADERTYPE **buffer,
+            OMX_U32 portIndex,
+            OMX_PTR appPrivate,
+            OMX_U32 size,
+            OMX_U8 *ptr);
+
+    static OMX_ERRORTYPE AllocateBufferWrapper(
+            OMX_HANDLETYPE component,
+            OMX_BUFFERHEADERTYPE **buffer,
+            OMX_U32 portIndex,
+            OMX_PTR appPrivate,
+            OMX_U32 size);
+
+    static OMX_ERRORTYPE FreeBufferWrapper(
+            OMX_HANDLETYPE component,
+            OMX_U32 portIndex,
+            OMX_BUFFERHEADERTYPE *buffer);
+
+    static OMX_ERRORTYPE EmptyThisBufferWrapper(
+            OMX_HANDLETYPE component,
+            OMX_BUFFERHEADERTYPE *buffer);
+
+    static OMX_ERRORTYPE FillThisBufferWrapper(
+            OMX_HANDLETYPE component,
+            OMX_BUFFERHEADERTYPE *buffer);
+
+    static OMX_ERRORTYPE GetStateWrapper(
+            OMX_HANDLETYPE component,
+            OMX_STATETYPE *state);
+
+    DISALLOW_EVIL_CONSTRUCTORS(GoldfishOMXComponent);
+};
+
+template<typename T>
+bool isValidOMXParam(T *a) {
+  static_assert(offsetof(typeof(*a), nSize) == 0, "nSize not at offset 0");
+  static_assert(std::is_same< decltype(a->nSize), OMX_U32>::value, "nSize has wrong type");
+  static_assert(offsetof(typeof(*a), nVersion) == 4, "nVersion not at offset 4");
+  static_assert(std::is_same< decltype(a->nVersion), OMX_VERSIONTYPE>::value,
+          "nVersion has wrong type");
+
+  if (a->nSize < sizeof(*a)) {
+      ALOGE("b/27207275: need %zu, got %u", sizeof(*a), a->nSize);
+      //android_errorWriteLog(0x534e4554, "27207275");
+      return false;
+  }
+  return true;
+}
+
+}  // namespace android
+
+#endif  // GOLDFISH_OMX_COMPONENT_H_
diff --git a/system/codecs/omx/plugin/GoldfishOMXPlugin.cpp b/system/codecs/omx/plugin/GoldfishOMXPlugin.cpp
new file mode 100644
index 0000000..6843381
--- /dev/null
+++ b/system/codecs/omx/plugin/GoldfishOMXPlugin.cpp
@@ -0,0 +1,244 @@
+/*
+ * Copyright 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "GoldfishOMXPlugin"
+#include "GoldfishOMXPlugin.h"
+
+//#define LOG_NDEBUG 0
+#include <vector>
+
+#include <cutils/properties.h>
+#include <log/log.h>
+
+#include "GoldfishOMXComponent.h"
+
+#include <media/stagefright/foundation/ADebug.h>
+#include <media/stagefright/foundation/AString.h>
+
+#include <dlfcn.h>
+
+namespace android {
+
+OMXPluginBase *createOMXPlugin() {
+    ALOGD("called createOMXPlugin for Goldfish");
+    return new GoldfishOMXPlugin;
+}
+
+// Each component's name should have it's own feature flag in order to toggle
+// individual codecs
+struct GoldfishComponent {
+    const char *mName;
+    const char *mLibNameSuffix;
+    const char *mRole;
+};
+
+static bool useOmxCodecs() {
+    char propValue[PROP_VALUE_MAX];
+    AString prop = "debug.stagefright.ccodec";
+    bool myret = property_get(prop.c_str(), propValue, "") > 0 &&
+           strcmp("0", propValue) == 0;
+    if (myret) {
+        ALOGD("%s %d found prop %s val %s", __func__, __LINE__, prop.c_str(), propValue);
+    }
+    return myret;
+}
+
+// We have a property set indicating whether to use the host side codec
+// or not (ro.boot.qemu.hwcodec.<mLibNameSuffix>).
+static std::string BuildHWCodecPropName(const char *libname) {
+    using namespace std::literals::string_literals;
+    return "ro.boot.qemu.hwcodec."s + libname;
+}
+
+static bool useGoogleGoldfishComponentInstance(const char* libname) {
+    const std::string propName = BuildHWCodecPropName(libname);
+    char propValue[PROP_VALUE_MAX];
+
+    bool myret = property_get(propName.c_str(), propValue, "") > 0 &&
+           strcmp("1", propValue) == 0;
+    if (myret) {
+        ALOGD("%s %d found prop %s val %s", __func__, __LINE__, propName.c_str(), propValue);
+    }
+    return myret;
+}
+
+static bool useAndroidGoldfishComponentInstance(const char* libname) {
+    const std::string propName = BuildHWCodecPropName(libname);
+    char propValue[PROP_VALUE_MAX];
+
+    bool myret = property_get(propName.c_str(), propValue, "") > 0 &&
+           strcmp("2", propValue) == 0;
+    if (myret) {
+        ALOGD("%s %d found prop %s val %s", __func__, __LINE__, propName.c_str(), propValue);
+    }
+    return myret;
+}
+
+static const GoldfishComponent kComponents[] = {
+        {"OMX.google.goldfish.vp8.decoder", "vpxdec", "video_decoder.vp8"},
+        {"OMX.google.goldfish.vp9.decoder", "vpxdec", "video_decoder.vp9"},
+        {"OMX.google.goldfish.h264.decoder", "avcdec", "video_decoder.avc"},
+        {"OMX.android.goldfish.vp8.decoder", "vpxdec", "video_decoder.vp8"},
+        {"OMX.android.goldfish.vp9.decoder", "vpxdec", "video_decoder.vp9"},
+        {"OMX.android.goldfish.h264.decoder", "avcdec", "video_decoder.avc"},
+};
+
+static std::vector<GoldfishComponent> kActiveComponents;
+
+static const size_t kNumComponents =
+    sizeof(kComponents) / sizeof(kComponents[0]);
+
+GoldfishOMXPlugin::GoldfishOMXPlugin() {
+    if (useOmxCodecs()) {
+        for (int i = 0; i < kNumComponents; ++i) {
+            if (!strncmp("OMX.google", kComponents[i].mName, 10) &&
+                useGoogleGoldfishComponentInstance(
+                    kComponents[i].mLibNameSuffix)) {
+                ALOGD("found and use kComponents[i].name %s",
+                      kComponents[i].mName);
+                kActiveComponents.push_back(kComponents[i]);
+            } else if (!strncmp("OMX.android", kComponents[i].mName, 11) &&
+                       useAndroidGoldfishComponentInstance(
+                           kComponents[i].mLibNameSuffix)) {
+                ALOGD("found and use kComponents[i].name %s",
+                      kComponents[i].mName);
+                kActiveComponents.push_back(kComponents[i]);
+            }
+        }
+    }
+}
+
+OMX_ERRORTYPE GoldfishOMXPlugin::makeComponentInstance(
+        const char *name,
+        const OMX_CALLBACKTYPE *callbacks,
+        OMX_PTR appData,
+        OMX_COMPONENTTYPE **component) {
+    ALOGI("makeComponentInstance '%s'", name);
+
+    for (size_t i = 0; i < kActiveComponents.size(); ++i) {
+        if (strcmp(name, kActiveComponents[i].mName)) {
+            continue;
+        }
+
+        AString libName;
+        AString ldsExport;
+        libName = "libstagefright_goldfish_";
+        ldsExport = "_Z26createGoldfishOMXComponentPKcPK16OMX_CALLBACKTYPEPvPP17OMX_COMPONENTTYPE";
+        ALOGI("Using goldfish codec for '%s'", kActiveComponents[i].mLibNameSuffix);
+
+        libName.append(kActiveComponents[i].mLibNameSuffix);
+        libName.append(".so");
+
+        void *libHandle = dlopen(libName.c_str(), RTLD_NOW|RTLD_NODELETE);
+
+        if (libHandle == NULL) {
+            ALOGE("unable to dlopen %s: %s", libName.c_str(), dlerror());
+
+            return OMX_ErrorComponentNotFound;
+        }
+
+        typedef GoldfishOMXComponent *(*CreateGoldfishOMXComponentFunc)(
+                const char *, const OMX_CALLBACKTYPE *,
+                OMX_PTR, OMX_COMPONENTTYPE **);
+
+        CreateGoldfishOMXComponentFunc createGoldfishOMXComponent =
+            (CreateGoldfishOMXComponentFunc)dlsym(
+                    libHandle,
+                    ldsExport.c_str()
+                    );
+
+        if (createGoldfishOMXComponent == NULL) {
+            ALOGE("unable to create component for %s", libName.c_str());
+            dlclose(libHandle);
+            libHandle = NULL;
+
+            return OMX_ErrorComponentNotFound;
+        }
+
+        sp<GoldfishOMXComponent> codec =
+            (*createGoldfishOMXComponent)(name, callbacks, appData, component);
+
+        if (codec == NULL) {
+            dlclose(libHandle);
+            libHandle = NULL;
+
+            return OMX_ErrorInsufficientResources;
+        }
+
+        OMX_ERRORTYPE err = codec->initCheck();
+        if (err != OMX_ErrorNone) {
+            dlclose(libHandle);
+            libHandle = NULL;
+
+            return err;
+        }
+
+        codec->incStrong(this);
+        codec->setLibHandle(libHandle);
+
+        return OMX_ErrorNone;
+    }
+
+    return OMX_ErrorInvalidComponentName;
+}
+
+OMX_ERRORTYPE GoldfishOMXPlugin::destroyComponentInstance(
+        OMX_COMPONENTTYPE *component) {
+    GoldfishOMXComponent *me =
+        (GoldfishOMXComponent *)
+            ((OMX_COMPONENTTYPE *)component)->pComponentPrivate;
+
+    me->prepareForDestruction();
+
+    CHECK_EQ(me->getStrongCount(), 1);
+    me->decStrong(this);
+    me = NULL;
+
+    return OMX_ErrorNone;
+}
+
+OMX_ERRORTYPE GoldfishOMXPlugin::enumerateComponents(
+        OMX_STRING name,
+        size_t /* size */,
+        OMX_U32 index) {
+    if (index >= kActiveComponents.size()) {
+        return OMX_ErrorNoMore;
+    }
+
+    ALOGD("enumerate %s component", kActiveComponents[index].mName);
+    strcpy(name, kActiveComponents[index].mName);
+
+    return OMX_ErrorNone;
+}
+
+OMX_ERRORTYPE GoldfishOMXPlugin::getRolesOfComponent(
+        const char *name,
+        Vector<String8> *roles) {
+    for (size_t i = 0; i < kActiveComponents.size(); ++i) {
+        if (strcmp(name, kActiveComponents[i].mName)) {
+            continue;
+        }
+
+        roles->clear();
+        roles->push(String8(kActiveComponents[i].mRole));
+
+        return OMX_ErrorNone;
+    }
+
+    return OMX_ErrorInvalidComponentName;
+}
+
+}  // namespace android
diff --git a/system/codecs/omx/plugin/GoldfishOMXPlugin.h b/system/codecs/omx/plugin/GoldfishOMXPlugin.h
new file mode 100644
index 0000000..26cee76
--- /dev/null
+++ b/system/codecs/omx/plugin/GoldfishOMXPlugin.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef GOLDFISH_OMX_PLUGIN_H_
+
+#define GOLDFISH_OMX_PLUGIN_H_
+
+#include <media/stagefright/foundation/ABase.h>
+#include <media/hardware/OMXPluginBase.h>
+
+namespace android {
+
+struct GoldfishOMXPlugin : public OMXPluginBase {
+    GoldfishOMXPlugin();
+
+    virtual OMX_ERRORTYPE makeComponentInstance(
+            const char *name,
+            const OMX_CALLBACKTYPE *callbacks,
+            OMX_PTR appData,
+            OMX_COMPONENTTYPE **component);
+
+    virtual OMX_ERRORTYPE destroyComponentInstance(
+            OMX_COMPONENTTYPE *component);
+
+    virtual OMX_ERRORTYPE enumerateComponents(
+            OMX_STRING name,
+            size_t size,
+            OMX_U32 index);
+
+    virtual OMX_ERRORTYPE getRolesOfComponent(
+            const char *name,
+            Vector<String8> *roles);
+
+private:
+    DISALLOW_EVIL_CONSTRUCTORS(GoldfishOMXPlugin);
+};
+
+}  // namespace android
+
+#endif  // GOLDFISH_OMX_PLUGIN_H_
diff --git a/system/codecs/omx/plugin/GoldfishVideoDecoderOMXComponent.cpp b/system/codecs/omx/plugin/GoldfishVideoDecoderOMXComponent.cpp
new file mode 100644
index 0000000..f98adab
--- /dev/null
+++ b/system/codecs/omx/plugin/GoldfishVideoDecoderOMXComponent.cpp
@@ -0,0 +1,806 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <inttypes.h>
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "GoldfishVideoDecoderOMXComponent"
+#include <utils/Log.h>
+
+#include "GoldfishVideoDecoderOMXComponent.h"
+
+#include <media/stagefright/foundation/ADebug.h>
+#include <media/stagefright/foundation/ALooper.h>
+#include <media/stagefright/foundation/AMessage.h>
+#include <media/stagefright/foundation/AUtils.h>
+#include <media/stagefright/foundation/MediaDefs.h>
+#include <media/hardware/HardwareAPI.h>
+
+namespace android {
+
+template<class T>
+static void InitOMXParams(T *params) {
+    params->nSize = sizeof(T);
+    params->nVersion.s.nVersionMajor = 1;
+    params->nVersion.s.nVersionMinor = 0;
+    params->nVersion.s.nRevision = 0;
+    params->nVersion.s.nStep = 0;
+}
+
+GoldfishVideoDecoderOMXComponent::GoldfishVideoDecoderOMXComponent(
+        const char *name,
+        const char *componentRole,
+        OMX_VIDEO_CODINGTYPE codingType,
+        const CodecProfileLevel *profileLevels,
+        size_t numProfileLevels,
+        int32_t width,
+        int32_t height,
+        const OMX_CALLBACKTYPE *callbacks,
+        OMX_PTR appData,
+        OMX_COMPONENTTYPE **component)
+        : SimpleGoldfishOMXComponent(name, callbacks, appData, component),
+        mIsAdaptive(false),
+        mAdaptiveMaxWidth(0),
+        mAdaptiveMaxHeight(0),
+        mWidth(width),
+        mHeight(height),
+        mCropLeft(0),
+        mCropTop(0),
+        mCropWidth(width),
+        mCropHeight(height),
+        mOutputFormat(OMX_COLOR_FormatYUV420Planar),
+        mOutputPortSettingsChange(NONE),
+        mUpdateColorAspects(false),
+        mMinInputBufferSize(384), // arbitrary, using one uncompressed macroblock
+        mMinCompressionRatio(1),  // max input size is normally the output size
+        mComponentRole(componentRole),
+        mCodingType(codingType),
+        mProfileLevels(profileLevels),
+        mNumProfileLevels(numProfileLevels) {
+
+    // init all the color aspects to be Unspecified.
+    memset(&mDefaultColorAspects, 0, sizeof(ColorAspects));
+    memset(&mBitstreamColorAspects, 0, sizeof(ColorAspects));
+    memset(&mFinalColorAspects, 0, sizeof(ColorAspects));
+    memset(&mHdrStaticInfo, 0, sizeof(HDRStaticInfo));
+}
+
+void GoldfishVideoDecoderOMXComponent::initPorts(
+        OMX_U32 numInputBuffers,
+        OMX_U32 inputBufferSize,
+        OMX_U32 numOutputBuffers,
+        const char *mimeType,
+        OMX_U32 minCompressionRatio) {
+    initPorts(numInputBuffers, numInputBuffers, inputBufferSize,
+            numOutputBuffers, numOutputBuffers, mimeType, minCompressionRatio);
+}
+
+void GoldfishVideoDecoderOMXComponent::initPorts(
+        OMX_U32 numMinInputBuffers,
+        OMX_U32 numInputBuffers,
+        OMX_U32 inputBufferSize,
+        OMX_U32 numMinOutputBuffers,
+        OMX_U32 numOutputBuffers,
+        const char *mimeType,
+        OMX_U32 minCompressionRatio) {
+    mMinInputBufferSize = inputBufferSize;
+    mMinCompressionRatio = minCompressionRatio;
+
+    OMX_PARAM_PORTDEFINITIONTYPE def;
+    InitOMXParams(&def);
+
+    def.nPortIndex = kInputPortIndex;
+    def.eDir = OMX_DirInput;
+    def.nBufferCountMin = numMinInputBuffers;
+    def.nBufferCountActual = numInputBuffers;
+    def.nBufferSize = inputBufferSize;
+    def.bEnabled = OMX_TRUE;
+    def.bPopulated = OMX_FALSE;
+    def.eDomain = OMX_PortDomainVideo;
+    def.bBuffersContiguous = OMX_FALSE;
+    def.nBufferAlignment = 1;
+
+    def.format.video.cMIMEType = const_cast<char *>(mimeType);
+    def.format.video.pNativeRender = NULL;
+    /* size is initialized in updatePortDefinitions() */
+    def.format.video.nBitrate = 0;
+    def.format.video.xFramerate = 0;
+    def.format.video.bFlagErrorConcealment = OMX_FALSE;
+    def.format.video.eCompressionFormat = mCodingType;
+    def.format.video.eColorFormat = OMX_COLOR_FormatUnused;
+    def.format.video.pNativeWindow = NULL;
+
+    addPort(def);
+
+    def.nPortIndex = kOutputPortIndex;
+    def.eDir = OMX_DirOutput;
+    def.nBufferCountMin = numMinOutputBuffers;
+    def.nBufferCountActual = numOutputBuffers;
+    def.bEnabled = OMX_TRUE;
+    def.bPopulated = OMX_FALSE;
+    def.eDomain = OMX_PortDomainVideo;
+    def.bBuffersContiguous = OMX_FALSE;
+    def.nBufferAlignment = 2;
+
+    def.format.video.cMIMEType = const_cast<char *>("video/raw");
+    def.format.video.pNativeRender = NULL;
+    /* size is initialized in updatePortDefinitions() */
+    def.format.video.nBitrate = 0;
+    def.format.video.xFramerate = 0;
+    def.format.video.bFlagErrorConcealment = OMX_FALSE;
+    def.format.video.eCompressionFormat = OMX_VIDEO_CodingUnused;
+    def.format.video.pNativeWindow = NULL;
+
+    addPort(def);
+
+    updatePortDefinitions(true /* updateCrop */, true /* updateInputSize */);
+}
+
+void GoldfishVideoDecoderOMXComponent::updatePortDefinitions(bool updateCrop, bool updateInputSize) {
+    OMX_PARAM_PORTDEFINITIONTYPE *outDef = &editPortInfo(kOutputPortIndex)->mDef;
+    outDef->format.video.nFrameWidth = outputBufferWidth();
+    outDef->format.video.nFrameHeight = outputBufferHeight();
+    outDef->format.video.eColorFormat = mOutputFormat;
+    outDef->format.video.nSliceHeight = outDef->format.video.nFrameHeight;
+
+    int32_t bpp = (mOutputFormat == OMX_COLOR_FormatYUV420Planar16) ? 2 : 1;
+    outDef->format.video.nStride = outDef->format.video.nFrameWidth * bpp;
+    outDef->nBufferSize =
+            (outDef->format.video.nStride * outDef->format.video.nSliceHeight * 3) / 2;
+
+    OMX_PARAM_PORTDEFINITIONTYPE *inDef = &editPortInfo(kInputPortIndex)->mDef;
+    inDef->format.video.nFrameWidth = mWidth;
+    inDef->format.video.nFrameHeight = mHeight;
+    // input port is compressed, hence it has no stride
+    inDef->format.video.nStride = 0;
+    inDef->format.video.nSliceHeight = 0;
+
+    // when output format changes, input buffer size does not actually change
+    if (updateInputSize) {
+        inDef->nBufferSize = max(
+                outDef->nBufferSize / mMinCompressionRatio,
+                max(mMinInputBufferSize, inDef->nBufferSize));
+    }
+
+    if (updateCrop) {
+        mCropLeft = 0;
+        mCropTop = 0;
+        mCropWidth = mWidth;
+        mCropHeight = mHeight;
+    }
+}
+
+
+uint32_t GoldfishVideoDecoderOMXComponent::outputBufferWidth() {
+    return max(mIsAdaptive ? mAdaptiveMaxWidth : 0, mWidth);
+}
+
+uint32_t GoldfishVideoDecoderOMXComponent::outputBufferHeight() {
+    return max(mIsAdaptive ? mAdaptiveMaxHeight : 0, mHeight);
+}
+
+void GoldfishVideoDecoderOMXComponent::handlePortSettingsChange(
+        bool *portWillReset, uint32_t width, uint32_t height,
+        OMX_COLOR_FORMATTYPE outputFormat,
+        CropSettingsMode cropSettingsMode, bool fakeStride) {
+    *portWillReset = false;
+    bool sizeChanged = (width != mWidth || height != mHeight);
+    bool formatChanged = (outputFormat != mOutputFormat);
+    bool updateCrop = (cropSettingsMode == kCropUnSet);
+    bool cropChanged = (cropSettingsMode == kCropChanged);
+    bool strideChanged = false;
+    if (fakeStride) {
+        OMX_PARAM_PORTDEFINITIONTYPE *def = &editPortInfo(kOutputPortIndex)->mDef;
+        if (def->format.video.nStride != (OMX_S32)width
+                || def->format.video.nSliceHeight != (OMX_U32)height) {
+            strideChanged = true;
+        }
+    }
+
+    if (formatChanged || sizeChanged || cropChanged || strideChanged) {
+        if (formatChanged) {
+            ALOGD("formatChanged: 0x%08x -> 0x%08x", mOutputFormat, outputFormat);
+        }
+        mOutputFormat = outputFormat;
+        mWidth = width;
+        mHeight = height;
+
+        if ((sizeChanged && !mIsAdaptive)
+            || width > mAdaptiveMaxWidth
+            || height > mAdaptiveMaxHeight
+            || formatChanged) {
+            if (mIsAdaptive) {
+                if (width > mAdaptiveMaxWidth) {
+                    mAdaptiveMaxWidth = width;
+                }
+                if (height > mAdaptiveMaxHeight) {
+                    mAdaptiveMaxHeight = height;
+                }
+            }
+            updatePortDefinitions(updateCrop);
+            notify(OMX_EventPortSettingsChanged, kOutputPortIndex, 0, NULL);
+            mOutputPortSettingsChange = AWAITING_DISABLED;
+            *portWillReset = true;
+        } else {
+            updatePortDefinitions(updateCrop);
+
+            if (fakeStride) {
+                // MAJOR HACK that is not pretty, it's just to fool the renderer to read the correct
+                // data.
+                // Some software decoders (e.g. SoftMPEG4) fill decoded frame directly to output
+                // buffer without considering the output buffer stride and slice height. So this is
+                // used to signal how the buffer is arranged.  The alternative is to re-arrange the
+                // output buffer in SoftMPEG4, but that results in memcopies.
+                OMX_PARAM_PORTDEFINITIONTYPE *def = &editPortInfo(kOutputPortIndex)->mDef;
+                def->format.video.nStride = mWidth;
+                def->format.video.nSliceHeight = mHeight;
+            }
+
+            notify(OMX_EventPortSettingsChanged, kOutputPortIndex,
+                   OMX_IndexConfigCommonOutputCrop, NULL);
+        }
+    } else if (mUpdateColorAspects) {
+        notify(OMX_EventPortSettingsChanged, kOutputPortIndex,
+                kDescribeColorAspectsIndex, NULL);
+        mUpdateColorAspects = false;
+    }
+}
+
+void GoldfishVideoDecoderOMXComponent::dumpColorAspects(const ColorAspects &colorAspects) {
+    ALOGD("dumpColorAspects: (R:%d(%s), P:%d(%s), M:%d(%s), T:%d(%s)) ",
+            colorAspects.mRange, asString(colorAspects.mRange),
+            colorAspects.mPrimaries, asString(colorAspects.mPrimaries),
+            colorAspects.mMatrixCoeffs, asString(colorAspects.mMatrixCoeffs),
+            colorAspects.mTransfer, asString(colorAspects.mTransfer));
+}
+
+bool GoldfishVideoDecoderOMXComponent::colorAspectsDiffer(
+        const ColorAspects &a, const ColorAspects &b) {
+    if (a.mRange != b.mRange
+        || a.mPrimaries != b.mPrimaries
+        || a.mTransfer != b.mTransfer
+        || a.mMatrixCoeffs != b.mMatrixCoeffs) {
+        return true;
+    }
+    return false;
+}
+
+void GoldfishVideoDecoderOMXComponent::updateFinalColorAspects(
+        const ColorAspects &otherAspects, const ColorAspects &preferredAspects) {
+    Mutex::Autolock autoLock(mColorAspectsLock);
+    ColorAspects newAspects;
+    newAspects.mRange = preferredAspects.mRange != ColorAspects::RangeUnspecified ?
+        preferredAspects.mRange : otherAspects.mRange;
+    newAspects.mPrimaries = preferredAspects.mPrimaries != ColorAspects::PrimariesUnspecified ?
+        preferredAspects.mPrimaries : otherAspects.mPrimaries;
+    newAspects.mTransfer = preferredAspects.mTransfer != ColorAspects::TransferUnspecified ?
+        preferredAspects.mTransfer : otherAspects.mTransfer;
+    newAspects.mMatrixCoeffs = preferredAspects.mMatrixCoeffs != ColorAspects::MatrixUnspecified ?
+        preferredAspects.mMatrixCoeffs : otherAspects.mMatrixCoeffs;
+
+    // Check to see if need update mFinalColorAspects.
+    if (colorAspectsDiffer(mFinalColorAspects, newAspects)) {
+        mFinalColorAspects = newAspects;
+        mUpdateColorAspects = true;
+    }
+}
+
+status_t GoldfishVideoDecoderOMXComponent::handleColorAspectsChange() {
+    int perference = getColorAspectPreference();
+    ALOGD("Color Aspects preference: %d ", perference);
+
+    if (perference == kPreferBitstream) {
+        updateFinalColorAspects(mDefaultColorAspects, mBitstreamColorAspects);
+    } else if (perference == kPreferContainer) {
+        updateFinalColorAspects(mBitstreamColorAspects, mDefaultColorAspects);
+    } else {
+        return OMX_ErrorUnsupportedSetting;
+    }
+    return OK;
+}
+
+void GoldfishVideoDecoderOMXComponent::copyYV12FrameToOutputBuffer(
+        uint8_t *dst, const uint8_t *srcY, const uint8_t *srcU, const uint8_t *srcV,
+        size_t srcYStride, size_t srcUStride, size_t srcVStride) {
+    OMX_PARAM_PORTDEFINITIONTYPE *outDef = &editPortInfo(kOutputPortIndex)->mDef;
+    int32_t bpp = (outDef->format.video.eColorFormat == OMX_COLOR_FormatYUV420Planar16) ? 2 : 1;
+
+    size_t dstYStride = outputBufferWidth() * bpp;
+    size_t dstUVStride = dstYStride / 2;
+    size_t dstHeight = outputBufferHeight();
+    uint8_t *dstStart = dst;
+
+    for (size_t i = 0; i < mHeight; ++i) {
+         memcpy(dst, srcY, mWidth * bpp);
+         srcY += srcYStride;
+         dst += dstYStride;
+    }
+
+    dst = dstStart + dstYStride * dstHeight;
+    for (size_t i = 0; i < mHeight / 2; ++i) {
+         memcpy(dst, srcU, mWidth / 2 * bpp);
+         srcU += srcUStride;
+         dst += dstUVStride;
+    }
+
+    dst = dstStart + (5 * dstYStride * dstHeight) / 4;
+    for (size_t i = 0; i < mHeight / 2; ++i) {
+         memcpy(dst, srcV, mWidth / 2 * bpp);
+         srcV += srcVStride;
+         dst += dstUVStride;
+    }
+}
+
+OMX_ERRORTYPE GoldfishVideoDecoderOMXComponent::internalGetParameter(
+        OMX_INDEXTYPE index, OMX_PTR params) {
+    switch (index) {
+        case OMX_IndexParamVideoPortFormat:
+        {
+            OMX_VIDEO_PARAM_PORTFORMATTYPE *formatParams =
+                (OMX_VIDEO_PARAM_PORTFORMATTYPE *)params;
+
+            if (!isValidOMXParam(formatParams)) {
+                return OMX_ErrorBadParameter;
+            }
+
+            if (formatParams->nPortIndex > kMaxPortIndex) {
+                return OMX_ErrorBadPortIndex;
+            }
+
+            if (formatParams->nIndex != 0) {
+                return OMX_ErrorNoMore;
+            }
+
+            if (formatParams->nPortIndex == kInputPortIndex) {
+                formatParams->eCompressionFormat = mCodingType;
+                formatParams->eColorFormat = OMX_COLOR_FormatUnused;
+                formatParams->xFramerate = 0;
+            } else {
+                CHECK_EQ(formatParams->nPortIndex, 1u);
+
+                formatParams->eCompressionFormat = OMX_VIDEO_CodingUnused;
+                formatParams->eColorFormat = OMX_COLOR_FormatYUV420Planar;
+                formatParams->xFramerate = 0;
+            }
+
+            return OMX_ErrorNone;
+        }
+
+        case OMX_IndexParamVideoProfileLevelQuerySupported:
+        {
+            OMX_VIDEO_PARAM_PROFILELEVELTYPE *profileLevel =
+                  (OMX_VIDEO_PARAM_PROFILELEVELTYPE *) params;
+
+            if (!isValidOMXParam(profileLevel)) {
+                return OMX_ErrorBadParameter;
+            }
+
+            if (profileLevel->nPortIndex != kInputPortIndex) {
+                ALOGE("Invalid port index: %" PRIu32, profileLevel->nPortIndex);
+                return OMX_ErrorUnsupportedIndex;
+            }
+
+            if (profileLevel->nProfileIndex >= mNumProfileLevels) {
+                return OMX_ErrorNoMore;
+            }
+
+            profileLevel->eProfile = mProfileLevels[profileLevel->nProfileIndex].mProfile;
+            profileLevel->eLevel   = mProfileLevels[profileLevel->nProfileIndex].mLevel;
+            return OMX_ErrorNone;
+        }
+
+        default:
+            return SimpleGoldfishOMXComponent::internalGetParameter(index, params);
+    }
+}
+
+OMX_ERRORTYPE GoldfishVideoDecoderOMXComponent::internalSetParameter(
+        OMX_INDEXTYPE index, const OMX_PTR params) {
+    // Include extension index OMX_INDEXEXTTYPE.
+    const int32_t indexFull = index;
+
+    switch (indexFull) {
+        case OMX_IndexParamStandardComponentRole:
+        {
+            const OMX_PARAM_COMPONENTROLETYPE *roleParams =
+                (const OMX_PARAM_COMPONENTROLETYPE *)params;
+
+            if (!isValidOMXParam(roleParams)) {
+                return OMX_ErrorBadParameter;
+            }
+
+            if (strncmp((const char *)roleParams->cRole,
+                        mComponentRole,
+                        OMX_MAX_STRINGNAME_SIZE - 1)) {
+                return OMX_ErrorUndefined;
+            }
+
+            return OMX_ErrorNone;
+        }
+
+        case OMX_IndexParamVideoPortFormat:
+        {
+            OMX_VIDEO_PARAM_PORTFORMATTYPE *formatParams =
+                (OMX_VIDEO_PARAM_PORTFORMATTYPE *)params;
+
+            if (!isValidOMXParam(formatParams)) {
+                return OMX_ErrorBadParameter;
+            }
+
+            if (formatParams->nPortIndex > kMaxPortIndex) {
+                return OMX_ErrorBadPortIndex;
+            }
+
+            if (formatParams->nPortIndex == kInputPortIndex) {
+                if (formatParams->eCompressionFormat != mCodingType
+                        || formatParams->eColorFormat != OMX_COLOR_FormatUnused) {
+                    return OMX_ErrorUnsupportedSetting;
+                }
+            } else {
+                if (formatParams->eCompressionFormat != OMX_VIDEO_CodingUnused
+                        || formatParams->eColorFormat != OMX_COLOR_FormatYUV420Planar) {
+                    return OMX_ErrorUnsupportedSetting;
+                }
+            }
+
+            return OMX_ErrorNone;
+        }
+
+        case kPrepareForAdaptivePlaybackIndex:
+        {
+            const PrepareForAdaptivePlaybackParams* adaptivePlaybackParams =
+                    (const PrepareForAdaptivePlaybackParams *)params;
+
+            if (!isValidOMXParam(adaptivePlaybackParams)) {
+                return OMX_ErrorBadParameter;
+            }
+
+            mIsAdaptive = adaptivePlaybackParams->bEnable;
+            if (mIsAdaptive) {
+                mAdaptiveMaxWidth = adaptivePlaybackParams->nMaxFrameWidth;
+                mAdaptiveMaxHeight = adaptivePlaybackParams->nMaxFrameHeight;
+                mWidth = mAdaptiveMaxWidth;
+                mHeight = mAdaptiveMaxHeight;
+            } else {
+                mAdaptiveMaxWidth = 0;
+                mAdaptiveMaxHeight = 0;
+            }
+            updatePortDefinitions(true /* updateCrop */, true /* updateInputSize */);
+            return OMX_ErrorNone;
+        }
+
+        case OMX_IndexParamPortDefinition:
+        {
+            OMX_PARAM_PORTDEFINITIONTYPE *newParams =
+                (OMX_PARAM_PORTDEFINITIONTYPE *)params;
+
+            if (!isValidOMXParam(newParams)) {
+                return OMX_ErrorBadParameter;
+            }
+
+            OMX_VIDEO_PORTDEFINITIONTYPE *video_def = &newParams->format.video;
+            OMX_PARAM_PORTDEFINITIONTYPE *def = &editPortInfo(newParams->nPortIndex)->mDef;
+
+            uint32_t oldWidth = def->format.video.nFrameWidth;
+            uint32_t oldHeight = def->format.video.nFrameHeight;
+            uint32_t newWidth = video_def->nFrameWidth;
+            uint32_t newHeight = video_def->nFrameHeight;
+            // We need width, height, stride and slice-height to be non-zero and sensible.
+            // These values were chosen to prevent integer overflows further down the line, and do
+            // not indicate support for 32kx32k video.
+            if (newWidth > 32768 || newHeight > 32768
+                    || video_def->nStride > 32768 || video_def->nStride < -32768
+                    || video_def->nSliceHeight > 32768) {
+                ALOGE("b/22885421");
+                return OMX_ErrorBadParameter;
+            }
+            if (newWidth != oldWidth || newHeight != oldHeight) {
+                bool outputPort = (newParams->nPortIndex == kOutputPortIndex);
+                if (outputPort) {
+                    // only update (essentially crop) if size changes
+                    mWidth = newWidth;
+                    mHeight = newHeight;
+
+                    updatePortDefinitions(true /* updateCrop */, true /* updateInputSize */);
+                    // reset buffer size based on frame size
+                    newParams->nBufferSize = def->nBufferSize;
+                } else {
+                    // For input port, we only set nFrameWidth and nFrameHeight. Buffer size
+                    // is updated when configuring the output port using the max-frame-size,
+                    // though client can still request a larger size.
+                    def->format.video.nFrameWidth = newWidth;
+                    def->format.video.nFrameHeight = newHeight;
+                }
+            }
+            return SimpleGoldfishOMXComponent::internalSetParameter(index, params);
+        }
+
+        default:
+            return SimpleGoldfishOMXComponent::internalSetParameter(index, params);
+    }
+}
+
+OMX_ERRORTYPE GoldfishVideoDecoderOMXComponent::getConfig(
+        OMX_INDEXTYPE index, OMX_PTR params) {
+    switch ((int)index) {
+        case OMX_IndexConfigCommonOutputCrop:
+        {
+            OMX_CONFIG_RECTTYPE *rectParams = (OMX_CONFIG_RECTTYPE *)params;
+
+            if (!isValidOMXParam(rectParams)) {
+                return OMX_ErrorBadParameter;
+            }
+
+            if (rectParams->nPortIndex != kOutputPortIndex) {
+                return OMX_ErrorUndefined;
+            }
+
+            rectParams->nLeft = mCropLeft;
+            rectParams->nTop = mCropTop;
+            rectParams->nWidth = mCropWidth;
+            rectParams->nHeight = mCropHeight;
+
+            return OMX_ErrorNone;
+        }
+        case kDescribeColorAspectsIndex:
+        {
+            if (!supportsDescribeColorAspects()) {
+                return OMX_ErrorUnsupportedIndex;
+            }
+
+            DescribeColorAspectsParams* colorAspectsParams =
+                    (DescribeColorAspectsParams *)params;
+
+            if (!isValidOMXParam(colorAspectsParams)) {
+                return OMX_ErrorBadParameter;
+            }
+
+            if (colorAspectsParams->nPortIndex != kOutputPortIndex) {
+                return OMX_ErrorBadParameter;
+            }
+
+            colorAspectsParams->sAspects = mFinalColorAspects;
+            if (colorAspectsParams->bRequestingDataSpace || colorAspectsParams->bDataSpaceChanged) {
+                return OMX_ErrorUnsupportedSetting;
+            }
+
+            return OMX_ErrorNone;
+        }
+
+        case kDescribeHdrStaticInfoIndex:
+        {
+            if (!supportDescribeHdrStaticInfo()) {
+                return OMX_ErrorUnsupportedIndex;
+            }
+
+            DescribeHDRStaticInfoParams* hdrStaticInfoParams =
+                    (DescribeHDRStaticInfoParams *)params;
+
+            if (!isValidOMXParam(hdrStaticInfoParams)) {
+                return OMX_ErrorBadParameter;
+            }
+
+            if (hdrStaticInfoParams->nPortIndex != kOutputPortIndex) {
+                return OMX_ErrorBadPortIndex;
+            }
+
+            hdrStaticInfoParams->sInfo = mHdrStaticInfo;
+
+            return OMX_ErrorNone;
+        }
+
+        case kDescribeHdr10PlusInfoIndex:
+        {
+            if (!supportDescribeHdr10PlusInfo()) {
+                return OMX_ErrorUnsupportedIndex;
+            }
+
+            if (mHdr10PlusOutputs.size() > 0) {
+                auto it = mHdr10PlusOutputs.begin();
+
+                auto info = (*it).get();
+
+                DescribeHDR10PlusInfoParams* outParams =
+                        (DescribeHDR10PlusInfoParams *)params;
+
+                outParams->nParamSizeUsed = info->size();
+
+                // If the buffer provided by the client does not have enough
+                // storage, return the size only and do not remove the param yet.
+                if (outParams->nParamSize >= info->size()) {
+                    memcpy(outParams->nValue, info->data(), info->size());
+                    mHdr10PlusOutputs.erase(it);
+                }
+                return OMX_ErrorNone;
+            }
+            return OMX_ErrorUnderflow;
+        }
+
+        default:
+            return OMX_ErrorUnsupportedIndex;
+    }
+}
+
+OMX_ERRORTYPE GoldfishVideoDecoderOMXComponent::internalSetConfig(
+        OMX_INDEXTYPE index, const OMX_PTR params, bool *frameConfig){
+    switch ((int)index) {
+        case kDescribeColorAspectsIndex:
+        {
+            if (!supportsDescribeColorAspects()) {
+                return OMX_ErrorUnsupportedIndex;
+            }
+            const DescribeColorAspectsParams* colorAspectsParams =
+                    (const DescribeColorAspectsParams *)params;
+
+            if (!isValidOMXParam(colorAspectsParams)) {
+                return OMX_ErrorBadParameter;
+            }
+
+            if (colorAspectsParams->nPortIndex != kOutputPortIndex) {
+                return OMX_ErrorBadParameter;
+            }
+
+            // Update color aspects if necessary.
+            if (colorAspectsDiffer(colorAspectsParams->sAspects, mDefaultColorAspects)) {
+                mDefaultColorAspects = colorAspectsParams->sAspects;
+                status_t err = handleColorAspectsChange();
+                CHECK(err == OK);
+            }
+            return OMX_ErrorNone;
+        }
+
+        case kDescribeHdrStaticInfoIndex:
+        {
+            if (!supportDescribeHdrStaticInfo()) {
+                return OMX_ErrorUnsupportedIndex;
+            }
+
+            const DescribeHDRStaticInfoParams* hdrStaticInfoParams =
+                    (DescribeHDRStaticInfoParams *)params;
+
+            if (!isValidOMXParam(hdrStaticInfoParams)) {
+                return OMX_ErrorBadParameter;
+            }
+
+            if (hdrStaticInfoParams->nPortIndex != kOutputPortIndex) {
+                return OMX_ErrorBadPortIndex;
+            }
+
+            mHdrStaticInfo = hdrStaticInfoParams->sInfo;
+            updatePortDefinitions(false);
+
+            return OMX_ErrorNone;
+        }
+
+        case kDescribeHdr10PlusInfoIndex:
+        {
+            if (!supportDescribeHdr10PlusInfo()) {
+                return OMX_ErrorUnsupportedIndex;
+            }
+
+            const DescribeHDR10PlusInfoParams* inParams =
+                    (DescribeHDR10PlusInfoParams *)params;
+
+            if (*frameConfig) {
+                // This is a request to append to the current frame config set.
+                // For now, we only support kDescribeHdr10PlusInfoIndex, which
+                // we simply replace with the last set value.
+                if (mHdr10PlusInputs.size() > 0) {
+                    *(--mHdr10PlusInputs.end()) = ABuffer::CreateAsCopy(
+                            inParams->nValue, inParams->nParamSizeUsed);
+                } else {
+                    ALOGW("Ignoring kDescribeHdr10PlusInfoIndex: append to "
+                            "frame config while no frame config is present");
+                }
+            } else {
+                // This is a frame config, setting *frameConfig to true so that
+                // the client marks the next queued input frame to apply it.
+                *frameConfig = true;
+                mHdr10PlusInputs.push_back(ABuffer::CreateAsCopy(
+                        inParams->nValue, inParams->nParamSizeUsed));
+            }
+            return OMX_ErrorNone;
+        }
+
+        default:
+            return OMX_ErrorUnsupportedIndex;
+    }
+}
+
+sp<ABuffer> GoldfishVideoDecoderOMXComponent::dequeueInputFrameConfig() {
+    auto it = mHdr10PlusInputs.begin();
+    sp<ABuffer> info = *it;
+    mHdr10PlusInputs.erase(it);
+    return info;
+}
+
+void GoldfishVideoDecoderOMXComponent::queueOutputFrameConfig(const sp<ABuffer> &info) {
+    mHdr10PlusOutputs.push_back(info);
+    notify(OMX_EventConfigUpdate,
+           kOutputPortIndex,
+           kDescribeHdr10PlusInfoIndex,
+           NULL);
+}
+
+OMX_ERRORTYPE GoldfishVideoDecoderOMXComponent::getExtensionIndex(
+        const char *name, OMX_INDEXTYPE *index) {
+    if (!strcmp(name, "OMX.google.android.index.prepareForAdaptivePlayback")) {
+        *(int32_t*)index = kPrepareForAdaptivePlaybackIndex;
+        return OMX_ErrorNone;
+    } else if (!strcmp(name, "OMX.google.android.index.describeColorAspects")
+                && supportsDescribeColorAspects()) {
+        *(int32_t*)index = kDescribeColorAspectsIndex;
+        return OMX_ErrorNone;
+    } else if (!strcmp(name, "OMX.google.android.index.describeHDRStaticInfo")
+            && supportDescribeHdrStaticInfo()) {
+        *(int32_t*)index = kDescribeHdrStaticInfoIndex;
+        return OMX_ErrorNone;
+    } else if (!strcmp(name, "OMX.google.android.index.describeHDR10PlusInfo")
+            && supportDescribeHdr10PlusInfo()) {
+        *(int32_t*)index = kDescribeHdr10PlusInfoIndex;
+        return OMX_ErrorNone;
+    }
+
+    return SimpleGoldfishOMXComponent::getExtensionIndex(name, index);
+}
+
+bool GoldfishVideoDecoderOMXComponent::supportsDescribeColorAspects() {
+    return getColorAspectPreference() != kNotSupported;
+}
+
+int GoldfishVideoDecoderOMXComponent::getColorAspectPreference() {
+    return kNotSupported;
+}
+
+bool GoldfishVideoDecoderOMXComponent::supportDescribeHdrStaticInfo() {
+    return false;
+}
+
+bool GoldfishVideoDecoderOMXComponent::supportDescribeHdr10PlusInfo() {
+    return false;
+}
+
+void GoldfishVideoDecoderOMXComponent::onReset() {
+    mOutputPortSettingsChange = NONE;
+}
+
+void GoldfishVideoDecoderOMXComponent::onPortEnableCompleted(OMX_U32 portIndex, bool enabled) {
+    if (portIndex != kOutputPortIndex) {
+        return;
+    }
+
+    switch (mOutputPortSettingsChange) {
+        case NONE:
+            break;
+
+        case AWAITING_DISABLED:
+        {
+            CHECK(!enabled);
+            mOutputPortSettingsChange = AWAITING_ENABLED;
+            break;
+        }
+
+        default:
+        {
+            CHECK_EQ((int)mOutputPortSettingsChange, (int)AWAITING_ENABLED);
+            CHECK(enabled);
+            mOutputPortSettingsChange = NONE;
+            break;
+        }
+    }
+}
+
+}  // namespace android
diff --git a/system/codecs/omx/plugin/GoldfishVideoDecoderOMXComponent.h b/system/codecs/omx/plugin/GoldfishVideoDecoderOMXComponent.h
new file mode 100644
index 0000000..bf60f61
--- /dev/null
+++ b/system/codecs/omx/plugin/GoldfishVideoDecoderOMXComponent.h
@@ -0,0 +1,197 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef GOLDFISH_VIDEO_DECODER_OMX_COMPONENT_H_
+
+#define GOLDFISH_VIDEO_DECODER_OMX_COMPONENT_H_
+
+#include "SimpleGoldfishOMXComponent.h"
+
+#include <media/stagefright/foundation/ABuffer.h>
+#include <media/stagefright/foundation/AHandlerReflector.h>
+#include <media/stagefright/foundation/ColorUtils.h>
+#include <media/IOMX.h>
+#include <media/hardware/HardwareAPI.h>
+
+#include <utils/RefBase.h>
+#include <utils/threads.h>
+#include <utils/Vector.h>
+#include <utils/List.h>
+
+namespace android {
+
+struct GoldfishVideoDecoderOMXComponent : public SimpleGoldfishOMXComponent {
+    GoldfishVideoDecoderOMXComponent(
+            const char *name,
+            const char *componentRole,
+            OMX_VIDEO_CODINGTYPE codingType,
+            const CodecProfileLevel *profileLevels,
+            size_t numProfileLevels,
+            int32_t width,
+            int32_t height,
+            const OMX_CALLBACKTYPE *callbacks,
+            OMX_PTR appData,
+            OMX_COMPONENTTYPE **component);
+
+protected:
+    enum {
+        kDescribeColorAspectsIndex = kPrepareForAdaptivePlaybackIndex + 1,
+        kDescribeHdrStaticInfoIndex = kPrepareForAdaptivePlaybackIndex + 2,
+        kDescribeHdr10PlusInfoIndex = kPrepareForAdaptivePlaybackIndex + 3,
+        kEnableAndroidNativeBuffersIndex = kPrepareForAdaptivePlaybackIndex + 4,
+        kUseAndroidNativeBufferIndex = kPrepareForAdaptivePlaybackIndex + 5,
+        kGetAndroidNativeBufferUsageIndex = kPrepareForAdaptivePlaybackIndex + 6,
+    };
+
+    enum {
+        kNotSupported,
+        kPreferBitstream,
+        kPreferContainer,
+    };
+
+    virtual void onPortEnableCompleted(OMX_U32 portIndex, bool enabled);
+    virtual void onReset();
+
+    virtual OMX_ERRORTYPE internalGetParameter(
+            OMX_INDEXTYPE index, OMX_PTR params);
+
+    virtual OMX_ERRORTYPE internalSetParameter(
+            OMX_INDEXTYPE index, const OMX_PTR params);
+
+    virtual OMX_ERRORTYPE getConfig(
+            OMX_INDEXTYPE index, OMX_PTR params);
+
+    virtual OMX_ERRORTYPE internalSetConfig(
+            OMX_INDEXTYPE index, const OMX_PTR params, bool *frameConfig);
+
+    virtual OMX_ERRORTYPE getExtensionIndex(
+            const char *name, OMX_INDEXTYPE *index);
+
+    virtual bool supportsDescribeColorAspects();
+
+    virtual int getColorAspectPreference();
+
+    virtual bool supportDescribeHdrStaticInfo();
+
+    virtual bool supportDescribeHdr10PlusInfo();
+
+    // This function sets both minimum buffer count and actual buffer count of
+    // input port to be |numInputBuffers|. It will also set both minimum buffer
+    // count and actual buffer count of output port to be |numOutputBuffers|.
+    void initPorts(OMX_U32 numInputBuffers,
+            OMX_U32 inputBufferSize,
+            OMX_U32 numOutputBuffers,
+            const char *mimeType,
+            OMX_U32 minCompressionRatio = 1u);
+
+    // This function sets input port's minimum buffer count to |numMinInputBuffers|,
+    // sets input port's actual buffer count to |numInputBuffers|, sets output port's
+    // minimum buffer count to |numMinOutputBuffers| and sets output port's actual buffer
+    // count to be |numOutputBuffers|.
+    void initPorts(OMX_U32 numMinInputBuffers,
+            OMX_U32 numInputBuffers,
+            OMX_U32 inputBufferSize,
+            OMX_U32 numMinOutputBuffers,
+            OMX_U32 numOutputBuffers,
+            const char *mimeType,
+            OMX_U32 minCompressionRatio = 1u);
+
+    virtual void updatePortDefinitions(bool updateCrop = true, bool updateInputSize = false);
+
+    uint32_t outputBufferWidth();
+    uint32_t outputBufferHeight();
+
+    enum CropSettingsMode {
+        kCropUnSet = 0,
+        kCropSet,
+        kCropChanged,
+    };
+
+    // This function will handle several port change events which include
+    // size changed, crop changed, stride changed and coloraspects changed.
+    // It will trigger OMX_EventPortSettingsChanged event if necessary.
+    void handlePortSettingsChange(
+            bool *portWillReset, uint32_t width, uint32_t height,
+            OMX_COLOR_FORMATTYPE outputFormat = OMX_COLOR_FormatYUV420Planar,
+            CropSettingsMode cropSettingsMode = kCropUnSet,
+            bool fakeStride = false);
+
+    void copyYV12FrameToOutputBuffer(
+            uint8_t *dst, const uint8_t *srcY, const uint8_t *srcU, const uint8_t *srcV,
+            size_t srcYStride, size_t srcUStride, size_t srcVStride);
+
+    enum {
+        kInputPortIndex  = 0,
+        kOutputPortIndex = 1,
+        kMaxPortIndex = 1,
+    };
+
+    bool mIsAdaptive;
+    uint32_t mAdaptiveMaxWidth, mAdaptiveMaxHeight;
+    uint32_t mWidth, mHeight;
+    uint32_t mCropLeft, mCropTop, mCropWidth, mCropHeight;
+    OMX_COLOR_FORMATTYPE mOutputFormat;
+    HDRStaticInfo mHdrStaticInfo;
+    enum {
+        NONE,
+        AWAITING_DISABLED,
+        AWAITING_ENABLED
+    } mOutputPortSettingsChange;
+
+    bool mUpdateColorAspects;
+
+    Mutex mColorAspectsLock;
+    // color aspects passed from the framework.
+    ColorAspects mDefaultColorAspects;
+    // color aspects parsed from the bitstream.
+    ColorAspects mBitstreamColorAspects;
+    // final color aspects after combining the above two aspects.
+    ColorAspects mFinalColorAspects;
+
+    bool colorAspectsDiffer(const ColorAspects &a, const ColorAspects &b);
+
+    // This functions takes two color aspects and updates the mFinalColorAspects
+    // based on |preferredAspects|.
+    void updateFinalColorAspects(
+            const ColorAspects &otherAspects, const ColorAspects &preferredAspects);
+
+    // This function will update the mFinalColorAspects based on codec preference.
+    status_t handleColorAspectsChange();
+
+    // Helper function to dump the ColorAspects.
+    void dumpColorAspects(const ColorAspects &colorAspects);
+
+    sp<ABuffer> dequeueInputFrameConfig();
+    void queueOutputFrameConfig(const sp<ABuffer> &info);
+
+private:
+    uint32_t mMinInputBufferSize;
+    uint32_t mMinCompressionRatio;
+
+    const char *mComponentRole;
+    OMX_VIDEO_CODINGTYPE mCodingType;
+    const CodecProfileLevel *mProfileLevels;
+    size_t mNumProfileLevels;
+    typedef List<sp<ABuffer> > Hdr10PlusInfoList;
+    Hdr10PlusInfoList mHdr10PlusInputs;
+    Hdr10PlusInfoList mHdr10PlusOutputs;
+
+    DISALLOW_EVIL_CONSTRUCTORS(GoldfishVideoDecoderOMXComponent);
+};
+
+}  // namespace android
+
+#endif  // GOLDFISH_VIDEO_DECODER_OMX_COMPONENT_H_
diff --git a/system/codecs/omx/plugin/SimpleGoldfishOMXComponent.cpp b/system/codecs/omx/plugin/SimpleGoldfishOMXComponent.cpp
new file mode 100644
index 0000000..41f71c4
--- /dev/null
+++ b/system/codecs/omx/plugin/SimpleGoldfishOMXComponent.cpp
@@ -0,0 +1,750 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "SimpleGoldfishOMXComponent"
+#include <utils/Log.h>
+
+#include "SimpleGoldfishOMXComponent.h"
+#include <media/stagefright/foundation/ADebug.h>
+#include <media/stagefright/foundation/ALooper.h>
+#include <media/stagefright/foundation/AMessage.h>
+
+namespace android {
+
+SimpleGoldfishOMXComponent::SimpleGoldfishOMXComponent(
+        const char *name,
+        const OMX_CALLBACKTYPE *callbacks,
+        OMX_PTR appData,
+        OMX_COMPONENTTYPE **component)
+    : GoldfishOMXComponent(name, callbacks, appData, component),
+      mLooper(new ALooper),
+      mHandler(new AHandlerReflector<SimpleGoldfishOMXComponent>(this)),
+      mState(OMX_StateLoaded),
+      mTargetState(OMX_StateLoaded),
+      mFrameConfig(false) {
+    mLooper->setName(name);
+    mLooper->registerHandler(mHandler);
+
+    mLooper->start(
+            false, // runOnCallingThread
+            false, // canCallJava
+            ANDROID_PRIORITY_VIDEO);
+}
+
+void SimpleGoldfishOMXComponent::prepareForDestruction() {
+    // The looper's queue may still contain messages referencing this
+    // object. Make sure those are flushed before returning so that
+    // a subsequent dlunload() does not pull out the rug from under us.
+
+    mLooper->unregisterHandler(mHandler->id());
+    mLooper->stop();
+}
+
+OMX_ERRORTYPE SimpleGoldfishOMXComponent::sendCommand(
+        OMX_COMMANDTYPE cmd, OMX_U32 param, OMX_PTR data) {
+    CHECK(data == NULL);
+
+    sp<AMessage> msg = new AMessage(kWhatSendCommand, mHandler);
+    msg->setInt32("cmd", cmd);
+    msg->setInt32("param", param);
+    msg->post();
+
+    return OMX_ErrorNone;
+}
+
+bool SimpleGoldfishOMXComponent::isSetParameterAllowed(
+        OMX_INDEXTYPE index, const OMX_PTR params) const {
+    if (mState == OMX_StateLoaded) {
+        return true;
+    }
+
+    OMX_U32 portIndex;
+
+    switch (index) {
+        case OMX_IndexParamPortDefinition:
+        {
+            const OMX_PARAM_PORTDEFINITIONTYPE *portDefs =
+                    (const OMX_PARAM_PORTDEFINITIONTYPE *) params;
+            if (!isValidOMXParam(portDefs)) {
+                return false;
+            }
+            portIndex = portDefs->nPortIndex;
+            break;
+        }
+
+        case OMX_IndexParamAudioPcm:
+        {
+            const OMX_AUDIO_PARAM_PCMMODETYPE *pcmMode =
+                    (const OMX_AUDIO_PARAM_PCMMODETYPE *) params;
+            if (!isValidOMXParam(pcmMode)) {
+                return false;
+            }
+            portIndex = pcmMode->nPortIndex;
+            break;
+        }
+
+        case OMX_IndexParamAudioAac:
+        {
+            const OMX_AUDIO_PARAM_AACPROFILETYPE *aacMode =
+                    (const OMX_AUDIO_PARAM_AACPROFILETYPE *) params;
+            if (!isValidOMXParam(aacMode)) {
+                return false;
+            }
+            portIndex = aacMode->nPortIndex;
+            break;
+        }
+
+        default:
+            return false;
+    }
+
+    CHECK(portIndex < mPorts.size());
+
+    return !mPorts.itemAt(portIndex).mDef.bEnabled;
+}
+
+OMX_ERRORTYPE SimpleGoldfishOMXComponent::getParameter(
+        OMX_INDEXTYPE index, OMX_PTR params) {
+    Mutex::Autolock autoLock(mLock);
+    return internalGetParameter(index, params);
+}
+
+OMX_ERRORTYPE SimpleGoldfishOMXComponent::setParameter(
+        OMX_INDEXTYPE index, const OMX_PTR params) {
+    Mutex::Autolock autoLock(mLock);
+
+    //CHECK(isSetParameterAllowed(index, params));
+
+    return internalSetParameter(index, params);
+}
+
+OMX_ERRORTYPE SimpleGoldfishOMXComponent::internalGetParameter(
+        OMX_INDEXTYPE index, OMX_PTR params) {
+    switch (index) {
+        case OMX_IndexParamPortDefinition:
+        {
+            OMX_PARAM_PORTDEFINITIONTYPE *defParams =
+                (OMX_PARAM_PORTDEFINITIONTYPE *)params;
+
+            if (!isValidOMXParam(defParams)) {
+                return OMX_ErrorBadParameter;
+            }
+
+            if (defParams->nPortIndex >= mPorts.size()
+                    || defParams->nSize
+                            != sizeof(OMX_PARAM_PORTDEFINITIONTYPE)) {
+                return OMX_ErrorUndefined;
+            }
+
+            const PortInfo *port =
+                &mPorts.itemAt(defParams->nPortIndex);
+
+            memcpy(defParams, &port->mDef, sizeof(port->mDef));
+
+            return OMX_ErrorNone;
+        }
+
+        default:
+            return OMX_ErrorUnsupportedIndex;
+    }
+}
+
+OMX_ERRORTYPE SimpleGoldfishOMXComponent::internalSetParameter(
+        OMX_INDEXTYPE index, const OMX_PTR params) {
+    switch (index) {
+        case OMX_IndexParamPortDefinition:
+        {
+            OMX_PARAM_PORTDEFINITIONTYPE *defParams =
+                (OMX_PARAM_PORTDEFINITIONTYPE *)params;
+
+            if (!isValidOMXParam(defParams)) {
+                return OMX_ErrorBadParameter;
+            }
+
+            if (defParams->nPortIndex >= mPorts.size()) {
+                return OMX_ErrorBadPortIndex;
+            }
+            if (defParams->nSize != sizeof(OMX_PARAM_PORTDEFINITIONTYPE)) {
+                return OMX_ErrorUnsupportedSetting;
+            }
+
+            PortInfo *port =
+                &mPorts.editItemAt(defParams->nPortIndex);
+
+            // default behavior is that we only allow buffer size to increase
+            if (defParams->nBufferSize > port->mDef.nBufferSize) {
+                port->mDef.nBufferSize = defParams->nBufferSize;
+            }
+
+            if (defParams->nBufferCountActual < port->mDef.nBufferCountMin) {
+                ALOGW("component requires at least %u buffers (%u requested)",
+                        port->mDef.nBufferCountMin, defParams->nBufferCountActual);
+                return OMX_ErrorUnsupportedSetting;
+            }
+
+            port->mDef.nBufferCountActual = defParams->nBufferCountActual;
+            return OMX_ErrorNone;
+        }
+
+        default:
+            return OMX_ErrorUnsupportedIndex;
+    }
+}
+
+OMX_ERRORTYPE SimpleGoldfishOMXComponent::internalSetConfig(
+        OMX_INDEXTYPE index __unused, const OMX_PTR params __unused, bool *frameConfig __unused) {
+    return OMX_ErrorUndefined;
+}
+
+OMX_ERRORTYPE SimpleGoldfishOMXComponent::setConfig(
+        OMX_INDEXTYPE index, const OMX_PTR params) {
+    bool frameConfig = mFrameConfig;
+    OMX_ERRORTYPE err = internalSetConfig(index, params, &frameConfig);
+    if (err == OMX_ErrorNone) {
+        mFrameConfig = frameConfig;
+    }
+    return err;
+}
+
+OMX_ERRORTYPE SimpleGoldfishOMXComponent::useBuffer(
+        OMX_BUFFERHEADERTYPE **header,
+        OMX_U32 portIndex,
+        OMX_PTR appPrivate,
+        OMX_U32 size,
+        OMX_U8 *ptr) {
+    Mutex::Autolock autoLock(mLock);
+    return useBufferCallerLockedAlready(header, portIndex, appPrivate, size, ptr);
+}
+
+OMX_ERRORTYPE SimpleGoldfishOMXComponent::useBufferCallerLockedAlready(
+        OMX_BUFFERHEADERTYPE **header,
+        OMX_U32 portIndex,
+        OMX_PTR appPrivate,
+        OMX_U32 size,
+        OMX_U8 *ptr) {
+    CHECK_LT(portIndex, mPorts.size());
+    CHECK_LT(portIndex, mPorts.size());
+
+    PortInfo *port = &mPorts.editItemAt(portIndex);
+    if (size < port->mDef.nBufferSize) {
+        ALOGE("b/63522430, Buffer size is too small.");
+        android_errorWriteLog(0x534e4554, "63522430");
+        return OMX_ErrorBadParameter;
+    }
+
+    *header = new OMX_BUFFERHEADERTYPE;
+    (*header)->nSize = sizeof(OMX_BUFFERHEADERTYPE);
+    (*header)->nVersion.s.nVersionMajor = 1;
+    (*header)->nVersion.s.nVersionMinor = 0;
+    (*header)->nVersion.s.nRevision = 0;
+    (*header)->nVersion.s.nStep = 0;
+    (*header)->pBuffer = ptr;
+    (*header)->nAllocLen = size;
+    (*header)->nFilledLen = 0;
+    (*header)->nOffset = 0;
+    (*header)->pAppPrivate = appPrivate;
+    (*header)->pPlatformPrivate = NULL;
+    (*header)->pInputPortPrivate = NULL;
+    (*header)->pOutputPortPrivate = NULL;
+    (*header)->hMarkTargetComponent = NULL;
+    (*header)->pMarkData = NULL;
+    (*header)->nTickCount = 0;
+    (*header)->nTimeStamp = 0;
+    (*header)->nFlags = 0;
+    (*header)->nOutputPortIndex = portIndex;
+    (*header)->nInputPortIndex = portIndex;
+
+    CHECK(mState == OMX_StateLoaded || port->mDef.bEnabled == OMX_FALSE);
+
+    CHECK_LT(port->mBuffers.size(), port->mDef.nBufferCountActual);
+
+    port->mBuffers.push();
+
+    BufferInfo *buffer =
+        &port->mBuffers.editItemAt(port->mBuffers.size() - 1);
+
+    buffer->mHeader = *header;
+    buffer->mOwnedByUs = false;
+
+    if (port->mBuffers.size() == port->mDef.nBufferCountActual) {
+        port->mDef.bPopulated = OMX_TRUE;
+        checkTransitions();
+    }
+
+    return OMX_ErrorNone;
+}
+
+OMX_ERRORTYPE SimpleGoldfishOMXComponent::allocateBuffer(
+        OMX_BUFFERHEADERTYPE **header,
+        OMX_U32 portIndex,
+        OMX_PTR appPrivate,
+        OMX_U32 size) {
+    OMX_U8 *ptr = new OMX_U8[size];
+
+    OMX_ERRORTYPE err =
+        useBuffer(header, portIndex, appPrivate, size, ptr);
+
+    if (err != OMX_ErrorNone) {
+        delete[] ptr;
+        ptr = NULL;
+
+        return err;
+    }
+
+    CHECK((*header)->pPlatformPrivate == NULL);
+    (*header)->pPlatformPrivate = ptr;
+
+    return OMX_ErrorNone;
+}
+
+OMX_ERRORTYPE SimpleGoldfishOMXComponent::freeBuffer(
+        OMX_U32 portIndex,
+        OMX_BUFFERHEADERTYPE *header) {
+    Mutex::Autolock autoLock(mLock);
+
+    CHECK_LT(portIndex, mPorts.size());
+
+    PortInfo *port = &mPorts.editItemAt(portIndex);
+
+#if 0 // XXX
+    CHECK((mState == OMX_StateIdle && mTargetState == OMX_StateLoaded)
+            || port->mDef.bEnabled == OMX_FALSE);
+#endif
+
+    bool found = false;
+    for (size_t i = 0; i < port->mBuffers.size(); ++i) {
+        BufferInfo *buffer = &port->mBuffers.editItemAt(i);
+
+        if (buffer->mHeader == header) {
+            CHECK(!buffer->mOwnedByUs);
+
+            if (header->pPlatformPrivate != NULL) {
+                // This buffer's data was allocated by us.
+                CHECK(header->pPlatformPrivate == header->pBuffer);
+
+                delete[] header->pBuffer;
+                header->pBuffer = NULL;
+            }
+
+            delete header;
+            header = NULL;
+
+            port->mBuffers.removeAt(i);
+            port->mDef.bPopulated = OMX_FALSE;
+
+            checkTransitions();
+
+            found = true;
+            break;
+        }
+    }
+
+    CHECK(found);
+
+    return OMX_ErrorNone;
+}
+
+OMX_ERRORTYPE SimpleGoldfishOMXComponent::emptyThisBuffer(
+        OMX_BUFFERHEADERTYPE *buffer) {
+    sp<AMessage> msg = new AMessage(kWhatEmptyThisBuffer, mHandler);
+    msg->setPointer("header", buffer);
+    if (mFrameConfig) {
+        msg->setInt32("frame-config", mFrameConfig);
+        mFrameConfig = false;
+    }
+    msg->post();
+
+    return OMX_ErrorNone;
+}
+
+OMX_ERRORTYPE SimpleGoldfishOMXComponent::fillThisBuffer(
+        OMX_BUFFERHEADERTYPE *buffer) {
+    sp<AMessage> msg = new AMessage(kWhatFillThisBuffer, mHandler);
+    msg->setPointer("header", buffer);
+    msg->post();
+
+    return OMX_ErrorNone;
+}
+
+OMX_ERRORTYPE SimpleGoldfishOMXComponent::getState(OMX_STATETYPE *state) {
+    Mutex::Autolock autoLock(mLock);
+
+    *state = mState;
+
+    return OMX_ErrorNone;
+}
+
+void SimpleGoldfishOMXComponent::onMessageReceived(const sp<AMessage> &msg) {
+    Mutex::Autolock autoLock(mLock);
+    uint32_t msgType = msg->what();
+    ALOGV("msgType = %d", msgType);
+    switch (msgType) {
+        case kWhatSendCommand:
+        {
+            int32_t cmd, param;
+            CHECK(msg->findInt32("cmd", &cmd));
+            CHECK(msg->findInt32("param", &param));
+
+            onSendCommand((OMX_COMMANDTYPE)cmd, (OMX_U32)param);
+            break;
+        }
+
+        case kWhatEmptyThisBuffer:
+        case kWhatFillThisBuffer:
+        {
+            OMX_BUFFERHEADERTYPE *header;
+            CHECK(msg->findPointer("header", (void **)&header));
+            int32_t frameConfig;
+            if (!msg->findInt32("frame-config", &frameConfig)) {
+                frameConfig = 0;
+            }
+
+            CHECK(mState == OMX_StateExecuting && mTargetState == mState);
+
+            bool found = false;
+            size_t portIndex = (kWhatEmptyThisBuffer == msgType)?
+                    header->nInputPortIndex: header->nOutputPortIndex;
+            PortInfo *port = &mPorts.editItemAt(portIndex);
+
+            for (size_t j = 0; j < port->mBuffers.size(); ++j) {
+                BufferInfo *buffer = &port->mBuffers.editItemAt(j);
+
+                if (buffer->mHeader == header) {
+                    CHECK(!buffer->mOwnedByUs);
+
+                    buffer->mOwnedByUs = true;
+                    buffer->mFrameConfig = (bool)frameConfig;
+
+                    CHECK((msgType == kWhatEmptyThisBuffer
+                            && port->mDef.eDir == OMX_DirInput)
+                            || (port->mDef.eDir == OMX_DirOutput));
+
+                    port->mQueue.push_back(buffer);
+                    onQueueFilled(portIndex);
+
+                    found = true;
+                    break;
+                }
+            }
+
+            CHECK(found);
+            break;
+        }
+
+        default:
+            TRESPASS();
+            break;
+    }
+}
+
+void SimpleGoldfishOMXComponent::onSendCommand(
+        OMX_COMMANDTYPE cmd, OMX_U32 param) {
+    switch (cmd) {
+        case OMX_CommandStateSet:
+        {
+            onChangeState((OMX_STATETYPE)param);
+            break;
+        }
+
+        case OMX_CommandPortEnable:
+        case OMX_CommandPortDisable:
+        {
+            onPortEnable(param, cmd == OMX_CommandPortEnable);
+            break;
+        }
+
+        case OMX_CommandFlush:
+        {
+            onPortFlush(param, true /* sendFlushComplete */);
+            break;
+        }
+
+        default:
+            TRESPASS();
+            break;
+    }
+}
+
+void SimpleGoldfishOMXComponent::onChangeState(OMX_STATETYPE state) {
+    ALOGV("%p requesting change from %d to %d", this, mState, state);
+    // We shouldn't be in a state transition already.
+
+    if (mState == OMX_StateLoaded
+            && mTargetState == OMX_StateIdle
+            && state == OMX_StateLoaded) {
+        // OMX specifically allows "canceling" a state transition from loaded
+        // to idle. Pretend we made it to idle, and go back to loaded
+        ALOGV("load->idle canceled");
+        mState = mTargetState = OMX_StateIdle;
+        state = OMX_StateLoaded;
+    }
+
+    if (mState != mTargetState) {
+        ALOGE("State change to state %d requested while still transitioning from state %d to %d",
+                state, mState, mTargetState);
+        notify(OMX_EventError, OMX_ErrorUndefined, 0, NULL);
+        return;
+    }
+
+    switch (mState) {
+        case OMX_StateLoaded:
+            CHECK_EQ((int)state, (int)OMX_StateIdle);
+            break;
+        case OMX_StateIdle:
+            CHECK(state == OMX_StateLoaded || state == OMX_StateExecuting);
+            break;
+        case OMX_StateExecuting:
+        {
+            CHECK_EQ((int)state, (int)OMX_StateIdle);
+
+            for (size_t i = 0; i < mPorts.size(); ++i) {
+                onPortFlush(i, false /* sendFlushComplete */);
+            }
+
+            mState = OMX_StateIdle;
+            notify(OMX_EventCmdComplete, OMX_CommandStateSet, state, NULL);
+            break;
+        }
+
+        default:
+            TRESPASS();
+    }
+
+    mTargetState = state;
+
+    checkTransitions();
+}
+
+void SimpleGoldfishOMXComponent::onReset() {
+    // no-op
+}
+
+void SimpleGoldfishOMXComponent::onPortEnable(OMX_U32 portIndex, bool enable) {
+    CHECK_LT(portIndex, mPorts.size());
+
+    PortInfo *port = &mPorts.editItemAt(portIndex);
+    CHECK_EQ((int)port->mTransition, (int)PortInfo::NONE);
+    CHECK(port->mDef.bEnabled == !enable);
+
+    if (port->mDef.eDir != OMX_DirOutput) {
+        ALOGE("Port enable/disable allowed only on output ports.");
+        notify(OMX_EventError, OMX_ErrorUndefined, 0, NULL);
+        android_errorWriteLog(0x534e4554, "29421804");
+        return;
+    }
+
+    if (!enable) {
+        port->mDef.bEnabled = OMX_FALSE;
+        port->mTransition = PortInfo::DISABLING;
+
+        for (size_t i = 0; i < port->mBuffers.size(); ++i) {
+            BufferInfo *buffer = &port->mBuffers.editItemAt(i);
+
+            if (buffer->mOwnedByUs) {
+                buffer->mOwnedByUs = false;
+
+                if (port->mDef.eDir == OMX_DirInput) {
+                    notifyEmptyBufferDone(buffer->mHeader);
+                } else {
+                    CHECK_EQ(port->mDef.eDir, OMX_DirOutput);
+                    notifyFillBufferDone(buffer->mHeader);
+                }
+            }
+        }
+
+        port->mQueue.clear();
+    } else {
+        port->mTransition = PortInfo::ENABLING;
+    }
+
+    checkTransitions();
+}
+
+void SimpleGoldfishOMXComponent::onPortFlush(
+        OMX_U32 portIndex, bool sendFlushComplete) {
+    if (portIndex == OMX_ALL) {
+        for (size_t i = 0; i < mPorts.size(); ++i) {
+            onPortFlush(i, sendFlushComplete);
+        }
+
+        if (sendFlushComplete) {
+            notify(OMX_EventCmdComplete, OMX_CommandFlush, OMX_ALL, NULL);
+        }
+
+        return;
+    }
+
+    CHECK_LT(portIndex, mPorts.size());
+
+    PortInfo *port = &mPorts.editItemAt(portIndex);
+    // Ideally, the port should not in transitioning state when flushing.
+    // However, in error handling case, e.g., the client can't allocate buffers
+    // when it tries to re-enable the port, the port will be stuck in ENABLING.
+    // The client will then transition the component from Executing to Idle,
+    // which leads to flushing ports. At this time, it should be ok to notify
+    // the client of the error and still clear all buffers on the port.
+    if (port->mTransition != PortInfo::NONE) {
+        notify(OMX_EventError, OMX_ErrorUndefined, 0, 0);
+    }
+
+    for (size_t i = 0; i < port->mBuffers.size(); ++i) {
+        BufferInfo *buffer = &port->mBuffers.editItemAt(i);
+
+        if (!buffer->mOwnedByUs) {
+            continue;
+        }
+
+        buffer->mHeader->nFilledLen = 0;
+        buffer->mHeader->nOffset = 0;
+        buffer->mHeader->nFlags = 0;
+
+        buffer->mOwnedByUs = false;
+
+        if (port->mDef.eDir == OMX_DirInput) {
+            notifyEmptyBufferDone(buffer->mHeader);
+        } else {
+            CHECK_EQ(port->mDef.eDir, OMX_DirOutput);
+
+            notifyFillBufferDone(buffer->mHeader);
+        }
+    }
+
+    port->mQueue.clear();
+
+    if (sendFlushComplete) {
+        notify(OMX_EventCmdComplete, OMX_CommandFlush, portIndex, NULL);
+
+        onPortFlushCompleted(portIndex);
+    }
+}
+
+void SimpleGoldfishOMXComponent::checkTransitions() {
+    if (mState != mTargetState) {
+        bool transitionComplete = true;
+
+        if (mState == OMX_StateLoaded) {
+            CHECK_EQ((int)mTargetState, (int)OMX_StateIdle);
+
+            for (size_t i = 0; i < mPorts.size(); ++i) {
+                const PortInfo &port = mPorts.itemAt(i);
+                if (port.mDef.bEnabled == OMX_FALSE) {
+                    continue;
+                }
+
+                if (port.mDef.bPopulated == OMX_FALSE) {
+                    transitionComplete = false;
+                    break;
+                }
+            }
+        } else if (mTargetState == OMX_StateLoaded) {
+            CHECK_EQ((int)mState, (int)OMX_StateIdle);
+
+            for (size_t i = 0; i < mPorts.size(); ++i) {
+                const PortInfo &port = mPorts.itemAt(i);
+                if (port.mDef.bEnabled == OMX_FALSE) {
+                    continue;
+                }
+
+                size_t n = port.mBuffers.size();
+
+                if (n > 0) {
+                    CHECK_LE(n, port.mDef.nBufferCountActual);
+
+                    if (n == port.mDef.nBufferCountActual) {
+                        CHECK_EQ((int)port.mDef.bPopulated, (int)OMX_TRUE);
+                    } else {
+                        CHECK_EQ((int)port.mDef.bPopulated, (int)OMX_FALSE);
+                    }
+
+                    transitionComplete = false;
+                    break;
+                }
+            }
+        }
+
+        if (transitionComplete) {
+            ALOGV("state transition from %d to %d complete", mState, mTargetState);
+            mState = mTargetState;
+
+            if (mState == OMX_StateLoaded) {
+                onReset();
+            }
+
+            notify(OMX_EventCmdComplete, OMX_CommandStateSet, mState, NULL);
+        } else {
+            ALOGV("state transition from %d to %d not yet complete", mState, mTargetState);
+        }
+    }
+
+    for (size_t i = 0; i < mPorts.size(); ++i) {
+        PortInfo *port = &mPorts.editItemAt(i);
+
+        if (port->mTransition == PortInfo::DISABLING) {
+            if (port->mBuffers.empty()) {
+                ALOGV("Port %zu now disabled.", i);
+
+                port->mTransition = PortInfo::NONE;
+                notify(OMX_EventCmdComplete, OMX_CommandPortDisable, i, NULL);
+
+                onPortEnableCompleted(i, false /* enabled */);
+            }
+        } else if (port->mTransition == PortInfo::ENABLING) {
+            if (port->mDef.bPopulated == OMX_TRUE) {
+                ALOGV("Port %zu now enabled.", i);
+
+                port->mTransition = PortInfo::NONE;
+                port->mDef.bEnabled = OMX_TRUE;
+                notify(OMX_EventCmdComplete, OMX_CommandPortEnable, i, NULL);
+
+                onPortEnableCompleted(i, true /* enabled */);
+            }
+        }
+    }
+}
+
+void SimpleGoldfishOMXComponent::addPort(const OMX_PARAM_PORTDEFINITIONTYPE &def) {
+    CHECK_EQ(def.nPortIndex, mPorts.size());
+
+    mPorts.push();
+    PortInfo *info = &mPorts.editItemAt(mPorts.size() - 1);
+    info->mDef = def;
+    info->mTransition = PortInfo::NONE;
+}
+
+void SimpleGoldfishOMXComponent::onQueueFilled(OMX_U32 portIndex __unused) {
+}
+
+void SimpleGoldfishOMXComponent::onPortFlushCompleted(OMX_U32 portIndex __unused) {
+}
+
+void SimpleGoldfishOMXComponent::onPortEnableCompleted(
+        OMX_U32 portIndex __unused, bool enabled __unused) {
+}
+
+List<SimpleGoldfishOMXComponent::BufferInfo *> &
+SimpleGoldfishOMXComponent::getPortQueue(OMX_U32 portIndex) {
+    CHECK_LT(portIndex, mPorts.size());
+    return mPorts.editItemAt(portIndex).mQueue;
+}
+
+SimpleGoldfishOMXComponent::PortInfo *SimpleGoldfishOMXComponent::editPortInfo(
+        OMX_U32 portIndex) {
+    CHECK_LT(portIndex, mPorts.size());
+    return &mPorts.editItemAt(portIndex);
+}
+
+}  // namespace android
diff --git a/system/codecs/omx/plugin/SimpleGoldfishOMXComponent.h b/system/codecs/omx/plugin/SimpleGoldfishOMXComponent.h
new file mode 100644
index 0000000..d2a3bf5
--- /dev/null
+++ b/system/codecs/omx/plugin/SimpleGoldfishOMXComponent.h
@@ -0,0 +1,171 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SIMPLE_GOLDFISH_OMX_COMPONENT_H_
+
+#define SIMPLE_GOLDFISH_OMX_COMPONENT_H_
+
+#include "GoldfishOMXComponent.h"
+
+#include <atomic>
+#include <media/stagefright/foundation/AHandlerReflector.h>
+#include <utils/RefBase.h>
+#include <utils/threads.h>
+#include <utils/Vector.h>
+
+namespace android {
+
+struct ALooper;
+struct ABuffer;
+
+struct CodecProfileLevel {
+    OMX_U32 mProfile;
+    OMX_U32 mLevel;
+};
+
+struct SimpleGoldfishOMXComponent : public GoldfishOMXComponent {
+    SimpleGoldfishOMXComponent(
+            const char *name,
+            const OMX_CALLBACKTYPE *callbacks,
+            OMX_PTR appData,
+            OMX_COMPONENTTYPE **component);
+
+    virtual void prepareForDestruction();
+
+    void onMessageReceived(const sp<AMessage> &msg);
+
+protected:
+    struct BufferInfo {
+        OMX_BUFFERHEADERTYPE *mHeader;
+        bool mOwnedByUs;
+        bool mFrameConfig;
+    };
+
+    struct PortInfo {
+        OMX_PARAM_PORTDEFINITIONTYPE mDef;
+        Vector<BufferInfo> mBuffers;
+        List<BufferInfo *> mQueue;
+
+        enum {
+            NONE,
+            DISABLING,
+            ENABLING,
+        } mTransition;
+    };
+
+    enum {
+        kStoreMetaDataExtensionIndex = OMX_IndexVendorStartUnused + 1,
+        kPrepareForAdaptivePlaybackIndex,
+    };
+
+    void addPort(const OMX_PARAM_PORTDEFINITIONTYPE &def);
+
+    virtual OMX_ERRORTYPE internalGetParameter(
+            OMX_INDEXTYPE index, OMX_PTR params);
+
+    virtual OMX_ERRORTYPE internalSetParameter(
+            OMX_INDEXTYPE index, const OMX_PTR params);
+
+    virtual OMX_ERRORTYPE internalSetConfig(
+            OMX_INDEXTYPE index, const OMX_PTR params, bool *frameConfig);
+
+    virtual void onQueueFilled(OMX_U32 portIndex);
+    List<BufferInfo *> &getPortQueue(OMX_U32 portIndex);
+
+    virtual void onPortFlushCompleted(OMX_U32 portIndex);
+    virtual void onPortEnableCompleted(OMX_U32 portIndex, bool enabled);
+    virtual void onReset();
+
+    PortInfo *editPortInfo(OMX_U32 portIndex);
+
+protected:
+    enum {
+        kWhatSendCommand,
+        kWhatEmptyThisBuffer,
+        kWhatFillThisBuffer,
+    };
+
+    Mutex mLock;
+
+    sp<ALooper> mLooper;
+    sp<AHandlerReflector<SimpleGoldfishOMXComponent> > mHandler;
+
+    OMX_STATETYPE mState;
+    OMX_STATETYPE mTargetState;
+
+    Vector<PortInfo> mPorts;
+    std::atomic_bool mFrameConfig;
+
+    bool isSetParameterAllowed(
+            OMX_INDEXTYPE index, const OMX_PTR params) const;
+
+    virtual OMX_ERRORTYPE sendCommand(
+            OMX_COMMANDTYPE cmd, OMX_U32 param, OMX_PTR data);
+
+    virtual OMX_ERRORTYPE getParameter(
+            OMX_INDEXTYPE index, OMX_PTR params);
+
+    virtual OMX_ERRORTYPE setParameter(
+            OMX_INDEXTYPE index, const OMX_PTR params);
+
+    virtual OMX_ERRORTYPE setConfig(
+            OMX_INDEXTYPE index, const OMX_PTR params);
+
+    virtual OMX_ERRORTYPE useBuffer(
+            OMX_BUFFERHEADERTYPE **buffer,
+            OMX_U32 portIndex,
+            OMX_PTR appPrivate,
+            OMX_U32 size,
+            OMX_U8 *ptr);
+
+    OMX_ERRORTYPE useBufferCallerLockedAlready(
+            OMX_BUFFERHEADERTYPE **buffer,
+            OMX_U32 portIndex,
+            OMX_PTR appPrivate,
+            OMX_U32 size,
+            OMX_U8 *ptr);
+
+    virtual OMX_ERRORTYPE allocateBuffer(
+            OMX_BUFFERHEADERTYPE **buffer,
+            OMX_U32 portIndex,
+            OMX_PTR appPrivate,
+            OMX_U32 size);
+
+    virtual OMX_ERRORTYPE freeBuffer(
+            OMX_U32 portIndex,
+            OMX_BUFFERHEADERTYPE *buffer);
+
+    virtual OMX_ERRORTYPE emptyThisBuffer(
+            OMX_BUFFERHEADERTYPE *buffer);
+
+    virtual OMX_ERRORTYPE fillThisBuffer(
+            OMX_BUFFERHEADERTYPE *buffer);
+
+    virtual OMX_ERRORTYPE getState(OMX_STATETYPE *state);
+
+    void onSendCommand(OMX_COMMANDTYPE cmd, OMX_U32 param);
+    void onChangeState(OMX_STATETYPE state);
+    void onPortEnable(OMX_U32 portIndex, bool enable);
+    void onPortFlush(OMX_U32 portIndex, bool sendFlushComplete);
+
+    void checkTransitions();
+
+    DISALLOW_EVIL_CONSTRUCTORS(SimpleGoldfishOMXComponent);
+};
+
+}  // namespace android
+
+#endif  // SIMPLE_GOLDFISH_OMX_COMPONENT_H_
diff --git a/system/codecs/omx/vpxdec/Android.mk b/system/codecs/omx/vpxdec/Android.mk
new file mode 100644
index 0000000..e7ec2d4
--- /dev/null
+++ b/system/codecs/omx/vpxdec/Android.mk
@@ -0,0 +1,59 @@
+#
+# Copyright 2019 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+LOCAL_PATH := $(call my-dir)
+
+commonSources := \
+        GoldfishVPX.cpp  \
+        goldfish_vpx_impl.cpp
+
+$(call emugl-begin-shared-library,libstagefright_goldfish_vpxdec$(GOLDFISH_OPENGL_LIB_SUFFIX))
+
+LOCAL_SRC_FILES := $(commonSources)
+
+LOCAL_CFLAGS += -DLOG_TAG=\"goldfish_vpxdec\"
+LOCAL_CFLAGS += -Wno-unused-private-field
+
+$(call emugl-export,SHARED_LIBRARIES,libcutils libutils liblog)
+
+LOCAL_HEADER_LIBRARIES := media_plugin_headers \
+	                      libmedia_headers \
+	                      libbinder_headers \
+	                      libhidlbase_impl_internal \
+	                      libbase
+
+LOCAL_HEADER_LIBRARIES += libui_headers \
+                          libnativewindow_headers \
+                          libhardware_headers \
+                          libarect_headers \
+                          libarect_headers_for_ndk
+
+LOCAL_HEADER_LIBRARIES += libgralloc_cb.ranchu
+
+LOCAL_SHARED_LIBRARIES +=       \
+        libbinder               \
+        libutils                \
+        liblog                  \
+        libcutils               \
+        libui                   \
+        [email protected] \
+        [email protected] \
+        [email protected] \
+        libstagefright_foundation
+
+$(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
+$(call emugl-import,libgoldfish_codecs_common)
+$(call emugl-import,libstagefrighthw)
+$(call emugl-end-module)
diff --git a/system/codecs/omx/vpxdec/GoldfishVPX.cpp b/system/codecs/omx/vpxdec/GoldfishVPX.cpp
new file mode 100644
index 0000000..edf6aa3
--- /dev/null
+++ b/system/codecs/omx/vpxdec/GoldfishVPX.cpp
@@ -0,0 +1,528 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//#define LOG_NDEBUG 0
+#include <utils/Log.h>
+#include <utils/misc.h>
+//#include "OMX_VideoExt.h"
+
+#define DEBUG 0
+#if DEBUG
+#define DDD(...) ALOGD(__VA_ARGS__)
+#else
+#define DDD(...) ((void)0)
+#endif
+
+#include "GoldfishVPX.h"
+
+#include <media/stagefright/foundation/ADebug.h>
+#include <media/stagefright/MediaDefs.h>
+
+#include <OMX_VideoExt.h>
+#include <inttypes.h>
+
+#include <nativebase/nativebase.h>
+
+#include <android/hardware/graphics/allocator/3.0/IAllocator.h>
+#include <android/hardware/graphics/mapper/3.0/IMapper.h>
+#include <hidl/LegacySupport.h>
+
+using ::android::hardware::graphics::common::V1_0::BufferUsage;
+using ::android::hardware::graphics::common::V1_2::PixelFormat;
+
+namespace android {
+
+// Only need to declare the highest supported profile and level here.
+static const CodecProfileLevel kVP9ProfileLevels[] = {
+    { OMX_VIDEO_VP9Profile0, OMX_VIDEO_VP9Level5 },
+    { OMX_VIDEO_VP9Profile2, OMX_VIDEO_VP9Level5 },
+    { OMX_VIDEO_VP9Profile2HDR, OMX_VIDEO_VP9Level5 },
+    { OMX_VIDEO_VP9Profile2HDR10Plus, OMX_VIDEO_VP9Level5 },
+};
+
+GoldfishVPX::GoldfishVPX(const char* name,
+                         const char* componentRole,
+                         OMX_VIDEO_CODINGTYPE codingType,
+                         const OMX_CALLBACKTYPE* callbacks,
+                         OMX_PTR appData,
+                         OMX_COMPONENTTYPE** component,
+                         RenderMode renderMode)
+    : GoldfishVideoDecoderOMXComponent(
+              name,
+              componentRole,
+              codingType,
+              codingType == OMX_VIDEO_CodingVP8 ? NULL : kVP9ProfileLevels,
+              codingType == OMX_VIDEO_CodingVP8 ? 0 : NELEM(kVP9ProfileLevels),
+              320 /* width */,
+              240 /* height */,
+              callbacks,
+              appData,
+              component),
+      mMode(codingType == OMX_VIDEO_CodingVP8 ? MODE_VP8 : MODE_VP9),
+      mRenderMode(renderMode),
+      mEOSStatus(INPUT_DATA_AVAILABLE),
+      mCtx(NULL),
+      mFrameParallelMode(true),
+      mTimeStampIdx(0),
+      mImg(NULL) {
+    // arbitrary from avc/hevc as vpx does not specify a min compression ratio
+    const size_t kMinCompressionRatio = mMode == MODE_VP8 ? 2 : 4;
+    const char* mime = mMode == MODE_VP8 ? MEDIA_MIMETYPE_VIDEO_VP8
+                                         : MEDIA_MIMETYPE_VIDEO_VP9;
+    const size_t kMaxOutputBufferSize = 3840 * 2160 * 3 / 2;  // 4k
+    initPorts(kNumBuffers,
+              kMaxOutputBufferSize / kMinCompressionRatio /* inputBufferSize */,
+              kNumBuffers, mime, kMinCompressionRatio);
+    ALOGI("calling constructor of GoldfishVPX");
+    // wait till later
+    // CHECK_EQ(initDecoder(), (status_t)OK);
+}
+
+GoldfishVPX::~GoldfishVPX() {
+    ALOGI("calling destructor of GoldfishVPX");
+    destroyDecoder();
+}
+
+bool GoldfishVPX::supportDescribeHdrStaticInfo() {
+    return true;
+}
+
+bool GoldfishVPX::supportDescribeHdr10PlusInfo() {
+    return true;
+}
+
+status_t GoldfishVPX::initDecoder() {
+    mCtx = new vpx_codec_ctx_t;
+    mCtx->vpversion = mMode == MODE_VP8 ? 8 : 9;
+
+    mCtx->version = mEnableAndroidNativeBuffers ? 200 : 100;
+
+    int vpx_err = 0;
+    if ((vpx_err = vpx_codec_dec_init(mCtx))) {
+        ALOGE("vpx decoder failed to initialize. (%d)", vpx_err);
+        delete mCtx;
+        mCtx = NULL;
+        return UNKNOWN_ERROR;
+    }
+
+    ALOGI("calling init GoldfishVPX ctx %p", mCtx);
+    return OK;
+}
+
+status_t GoldfishVPX::destroyDecoder() {
+    if (mCtx) {
+        ALOGI("calling destroying GoldfishVPX ctx %p", mCtx);
+        vpx_codec_destroy(mCtx);
+        delete mCtx;
+        mCtx = NULL;
+    }
+    return OK;
+}
+
+void GoldfishVPX::setup_ctx_parameters(vpx_codec_ctx_t* ctx,
+                                       int hostColorBufferId) {
+    ctx->width = mWidth;
+    ctx->height = mHeight;
+    ctx->hostColorBufferId = hostColorBufferId;
+    ctx->outputBufferWidth = outputBufferWidth();
+    ctx->outputBufferHeight = outputBufferHeight();
+    OMX_PARAM_PORTDEFINITIONTYPE *outDef = &editPortInfo(kOutputPortIndex)->mDef;
+    int32_t bpp = (outDef->format.video.eColorFormat == OMX_COLOR_FormatYUV420Planar16) ? 2 : 1;
+    ctx->bpp =  bpp;
+}
+
+bool GoldfishVPX::outputBuffers(bool flushDecoder, bool display, bool eos, bool *portWillReset) {
+    List<BufferInfo *> &outQueue = getPortQueue(1);
+    BufferInfo *outInfo = NULL;
+    OMX_BUFFERHEADERTYPE *outHeader = NULL;
+    DDD("%s %d", __func__, __LINE__);
+
+    if (flushDecoder && mFrameParallelMode) {
+        // Flush decoder by passing NULL data ptr and 0 size.
+        // Ideally, this should never fail.
+        if (vpx_codec_flush(mCtx)) {
+            ALOGE("Failed to flush on2 decoder.");
+            return false;
+        }
+    }
+
+    if (!display) {
+        if (!flushDecoder) {
+            ALOGE("Invalid operation.");
+            return false;
+        }
+        // Drop all the decoded frames in decoder.
+        // TODO: move this to host, with something like
+        // vpx_codec_drop_all_frames(mCtx);
+        setup_ctx_parameters(mCtx);
+        while ((mImg = vpx_codec_get_frame(mCtx))) {
+        }
+        return true;
+    }
+
+    while (!outQueue.empty()) {
+        DDD("%s %d", __func__, __LINE__);
+        outInfo = *outQueue.begin();
+        outHeader = outInfo->mHeader;
+        if (mImg == NULL) {
+            setup_ctx_parameters(mCtx, getHostColorBufferId(outHeader));
+            mImg = vpx_codec_get_frame(mCtx);
+            if (mImg == NULL) {
+                break;
+            }
+        }
+        uint32_t width = mImg->d_w;
+        uint32_t height = mImg->d_h;
+        CHECK(mImg->fmt == VPX_IMG_FMT_I420 || mImg->fmt == VPX_IMG_FMT_I42016);
+        OMX_COLOR_FORMATTYPE outputColorFormat = OMX_COLOR_FormatYUV420Planar;
+        int32_t bpp = 1;
+        if (mImg->fmt == VPX_IMG_FMT_I42016) {
+            outputColorFormat = OMX_COLOR_FormatYUV420Planar16;
+            bpp = 2;
+        }
+        handlePortSettingsChange(portWillReset, width, height, outputColorFormat);
+        if (*portWillReset) {
+            return true;
+        }
+
+        outHeader->nOffset = 0;
+        outHeader->nFlags = 0;
+        outHeader->nFilledLen = (outputBufferWidth() * outputBufferHeight() * bpp * 3) / 2;
+        PrivInfo *privInfo = (PrivInfo *)mImg->user_priv;
+        outHeader->nTimeStamp = privInfo->mTimeStamp;
+        if (privInfo->mHdr10PlusInfo != nullptr) {
+            queueOutputFrameConfig(privInfo->mHdr10PlusInfo);
+        }
+
+        if (outputBufferSafe(outHeader) &&
+            getHostColorBufferId(outHeader) < 0) {
+            uint8_t *dst = outHeader->pBuffer;
+            memcpy(dst, mCtx->dst, outHeader->nFilledLen);
+        } else {
+            // outHeader->nFilledLen = 0;
+        }
+
+        mImg = NULL;
+        outInfo->mOwnedByUs = false;
+        outQueue.erase(outQueue.begin());
+        outInfo = NULL;
+        notifyFillBufferDone(outHeader);
+        outHeader = NULL;
+    }
+
+    if (!eos) {
+        return true;
+    }
+
+    if (!outQueue.empty()) {
+        outInfo = *outQueue.begin();
+        outQueue.erase(outQueue.begin());
+        outHeader = outInfo->mHeader;
+        outHeader->nTimeStamp = 0;
+        outHeader->nFilledLen = 0;
+        outHeader->nFlags = OMX_BUFFERFLAG_EOS;
+        outInfo->mOwnedByUs = false;
+        notifyFillBufferDone(outHeader);
+        mEOSStatus = OUTPUT_FRAMES_FLUSHED;
+    }
+    return true;
+}
+
+bool GoldfishVPX::outputBufferSafe(OMX_BUFFERHEADERTYPE *outHeader) {
+    DDD("%s %d", __func__, __LINE__);
+    uint32_t width = outputBufferWidth();
+    uint32_t height = outputBufferHeight();
+    uint64_t nFilledLen = width;
+    nFilledLen *= height;
+    if (nFilledLen > UINT32_MAX / 3) {
+        ALOGE("b/29421675, nFilledLen overflow %llu w %u h %u",
+                (unsigned long long)nFilledLen, width, height);
+        android_errorWriteLog(0x534e4554, "29421675");
+        return false;
+    } else if (outHeader->nAllocLen < outHeader->nFilledLen) {
+        ALOGE("b/27597103, buffer too small");
+        android_errorWriteLog(0x534e4554, "27597103");
+        return false;
+    }
+
+    return true;
+}
+
+void GoldfishVPX::onQueueFilled(OMX_U32 /* portIndex */) {
+    DDD("%s %d", __func__, __LINE__);
+    if (mOutputPortSettingsChange != NONE || mEOSStatus == OUTPUT_FRAMES_FLUSHED) {
+        return;
+    }
+
+    if (mCtx == nullptr) {
+        if (OK != initDecoder()) {
+            ALOGE("Failed to initialize decoder");
+            notify(OMX_EventError, OMX_ErrorUnsupportedSetting, 0, NULL);
+            return;
+        }
+    }
+
+    List<BufferInfo *> &inQueue = getPortQueue(0);
+    List<BufferInfo *> &outQueue = getPortQueue(1);
+    bool EOSseen = false;
+    bool portWillReset = false;
+
+    while ((mEOSStatus == INPUT_EOS_SEEN || !inQueue.empty())
+            && !outQueue.empty()) {
+        // Output the pending frames that left from last port reset or decoder flush.
+        if (mEOSStatus == INPUT_EOS_SEEN || mImg != NULL) {
+            if (!outputBuffers(
+                     mEOSStatus == INPUT_EOS_SEEN, true /* display */,
+                     mEOSStatus == INPUT_EOS_SEEN, &portWillReset)) {
+                ALOGE("on2 decoder failed to output frame.");
+                notify(OMX_EventError, OMX_ErrorUndefined, 0, NULL);
+                return;
+            }
+            if (portWillReset || mEOSStatus == OUTPUT_FRAMES_FLUSHED ||
+                    mEOSStatus == INPUT_EOS_SEEN) {
+                return;
+            }
+            // Continue as outQueue may be empty now.
+            continue;
+        }
+
+        BufferInfo *inInfo = *inQueue.begin();
+        OMX_BUFFERHEADERTYPE *inHeader = inInfo->mHeader;
+
+        // Software VP9 Decoder does not need the Codec Specific Data (CSD)
+        // (specified in http://www.webmproject.org/vp9/profiles/). Ignore it if
+        // it was passed.
+        if (inHeader->nFlags & OMX_BUFFERFLAG_CODECCONFIG) {
+            // Only ignore CSD buffer for VP9.
+            if (mMode == MODE_VP9) {
+                inQueue.erase(inQueue.begin());
+                inInfo->mOwnedByUs = false;
+                notifyEmptyBufferDone(inHeader);
+                continue;
+            } else {
+                // Tolerate the CSD buffer for VP8. This is a workaround
+                // for b/28689536.
+                ALOGW("WARNING: Got CSD buffer for VP8.");
+            }
+        }
+
+        mPrivInfo[mTimeStampIdx].mTimeStamp = inHeader->nTimeStamp;
+
+        if (inInfo->mFrameConfig) {
+            mPrivInfo[mTimeStampIdx].mHdr10PlusInfo = dequeueInputFrameConfig();
+        } else {
+            mPrivInfo[mTimeStampIdx].mHdr10PlusInfo.clear();
+        }
+
+        if (inHeader->nFlags & OMX_BUFFERFLAG_EOS) {
+            mEOSStatus = INPUT_EOS_SEEN;
+            EOSseen = true;
+        }
+
+        if (inHeader->nFilledLen > 0) {
+            int err = vpx_codec_decode(mCtx, inHeader->pBuffer + inHeader->nOffset,
+                    inHeader->nFilledLen, &mPrivInfo[mTimeStampIdx], 0);
+            if (err == VPX_CODEC_OK) {
+                inInfo->mOwnedByUs = false;
+                inQueue.erase(inQueue.begin());
+                inInfo = NULL;
+                notifyEmptyBufferDone(inHeader);
+                inHeader = NULL;
+            } else {
+                ALOGE("on2 decoder failed to decode frame. err: %d", err);
+                notify(OMX_EventError, OMX_ErrorUndefined, 0, NULL);
+                return;
+            }
+        }
+
+        mTimeStampIdx = (mTimeStampIdx + 1) % kNumBuffers;
+
+        if (!outputBuffers(
+                 EOSseen /* flushDecoder */, true /* display */, EOSseen, &portWillReset)) {
+            ALOGE("on2 decoder failed to output frame.");
+            notify(OMX_EventError, OMX_ErrorUndefined, 0, NULL);
+            return;
+        }
+        if (portWillReset) {
+            return;
+        }
+    }
+}
+
+void GoldfishVPX::onPortFlushCompleted(OMX_U32 portIndex) {
+    DDD("%s %d", __func__, __LINE__);
+    if (portIndex == kInputPortIndex) {
+        bool portWillReset = false;
+        if (!outputBuffers(
+                 true /* flushDecoder */, false /* display */, false /* eos */, &portWillReset)) {
+            ALOGE("Failed to flush decoder.");
+            notify(OMX_EventError, OMX_ErrorUndefined, 0, NULL);
+            return;
+        }
+        mEOSStatus = INPUT_DATA_AVAILABLE;
+    }
+}
+
+void GoldfishVPX::onReset() {
+    DDD("%s %d", __func__, __LINE__);
+    bool portWillReset = false;
+    if (!outputBuffers(
+             true /* flushDecoder */, false /* display */, false /* eos */, &portWillReset)) {
+        ALOGW("Failed to flush decoder. Try to hard reset decoder");
+        destroyDecoder();
+        initDecoder();
+    }
+    mEOSStatus = INPUT_DATA_AVAILABLE;
+}
+
+int GoldfishVPX::getHostColorBufferId(void* header) {
+    DDD("%s %d", __func__, __LINE__);
+    if (mNWBuffers.find(header) == mNWBuffers.end()) {
+        DDD("cannot find color buffer for header %p", header);
+        return -1;
+    }
+    sp<ANativeWindowBuffer> nBuf = mNWBuffers[header];
+    cb_handle_t* handle = (cb_handle_t*)nBuf->handle;
+    DDD("found color buffer for header %p --> %d", header, handle->hostHandle);
+    return handle->hostHandle;
+}
+
+OMX_ERRORTYPE GoldfishVPX::internalGetParameter(OMX_INDEXTYPE index,
+                                                OMX_PTR params) {
+    const int32_t indexFull = index;
+    switch (indexFull) {
+        case kGetAndroidNativeBufferUsageIndex: {
+            DDD("calling kGetAndroidNativeBufferUsageIndex");
+            GetAndroidNativeBufferUsageParams* nativeBuffersUsage =
+                    (GetAndroidNativeBufferUsageParams*)params;
+            nativeBuffersUsage->nUsage =
+                    (unsigned int)(BufferUsage::GPU_DATA_BUFFER);
+            return OMX_ErrorNone;
+        }
+
+        default:
+            return GoldfishVideoDecoderOMXComponent::internalGetParameter(
+                    index, params);
+    }
+}
+
+OMX_ERRORTYPE GoldfishVPX::internalSetParameter(OMX_INDEXTYPE index,
+                                                const OMX_PTR params) {
+    // Include extension index OMX_INDEXEXTTYPE.
+    const int32_t indexFull = index;
+
+    switch (indexFull) {
+        case kEnableAndroidNativeBuffersIndex: {
+            DDD("calling kEnableAndroidNativeBuffersIndex");
+            EnableAndroidNativeBuffersParams* enableNativeBuffers =
+                    (EnableAndroidNativeBuffersParams*)params;
+            if (enableNativeBuffers) {
+                mEnableAndroidNativeBuffers = enableNativeBuffers->enable;
+                if (mEnableAndroidNativeBuffers == false) {
+                    mNWBuffers.clear();
+                    DDD("disabled kEnableAndroidNativeBuffersIndex");
+                } else {
+                    DDD("enabled kEnableAndroidNativeBuffersIndex");
+                }
+            }
+            return OMX_ErrorNone;
+        }
+
+        case kUseAndroidNativeBufferIndex: {
+            if (mEnableAndroidNativeBuffers == false) {
+                ALOGE("Error: not enabled Android Native Buffers");
+                return OMX_ErrorBadParameter;
+            }
+            UseAndroidNativeBufferParams* use_buffer_params =
+                    (UseAndroidNativeBufferParams*)params;
+            if (use_buffer_params) {
+                sp<ANativeWindowBuffer> nBuf = use_buffer_params->nativeBuffer;
+                cb_handle_t* handle = (cb_handle_t*)nBuf->handle;
+                void* dst = NULL;
+                DDD("kUseAndroidNativeBufferIndex with handle %p host color "
+                    "handle %d "
+                    "calling usebuffer",
+                    handle, handle->hostHandle);
+                useBufferCallerLockedAlready(use_buffer_params->bufferHeader,
+                                             use_buffer_params->nPortIndex,
+                                             use_buffer_params->pAppPrivate,
+                                             handle->allocatedSize(),
+                                             (OMX_U8*)dst);
+                mNWBuffers[*(use_buffer_params->bufferHeader)] =
+                        use_buffer_params->nativeBuffer;
+                ;
+            }
+            return OMX_ErrorNone;
+        }
+
+        default:
+            return GoldfishVideoDecoderOMXComponent::internalSetParameter(
+                    index, params);
+    }
+}
+
+OMX_ERRORTYPE GoldfishVPX::getExtensionIndex(const char* name,
+                                             OMX_INDEXTYPE* index) {
+    if (mRenderMode == RenderMode::RENDER_BY_HOST_GPU) {
+        if (!strcmp(name,
+                    "OMX.google.android.index.enableAndroidNativeBuffers")) {
+            DDD("calling getExtensionIndex for enable ANB");
+            *(int32_t*)index = kEnableAndroidNativeBuffersIndex;
+            return OMX_ErrorNone;
+        } else if (!strcmp(name,
+                           "OMX.google.android.index.useAndroidNativeBuffer")) {
+            *(int32_t*)index = kUseAndroidNativeBufferIndex;
+            return OMX_ErrorNone;
+        } else if (!strcmp(name,
+                           "OMX.google.android.index."
+                           "getAndroidNativeBufferUsage")) {
+            *(int32_t*)index = kGetAndroidNativeBufferUsageIndex;
+            return OMX_ErrorNone;
+        }
+    }
+    return GoldfishVideoDecoderOMXComponent::getExtensionIndex(name, index);
+}
+
+}  // namespace android
+
+android::GoldfishOMXComponent *createGoldfishOMXComponent(
+        const char *name, const OMX_CALLBACKTYPE *callbacks,
+        OMX_PTR appData, OMX_COMPONENTTYPE **component) {
+    DDD("%s %d", __func__, __LINE__);
+    // only support vp9 to use host hardware decoder, for now
+    if (!strncmp("OMX.android.goldfish.vp9.decoder", name, 32)) {
+        return new android::GoldfishVPX(
+                name, "video_decoder.vp9", OMX_VIDEO_CodingVP9, callbacks,
+                appData, component, RenderMode::RENDER_BY_HOST_GPU);
+    }
+    if (!strncmp("OMX.android.goldfish.vp8.decoder", name, 32)) {
+        return new android::GoldfishVPX(
+                name, "video_decoder.vp8", OMX_VIDEO_CodingVP8, callbacks,
+                appData, component, RenderMode::RENDER_BY_HOST_GPU);
+    }
+    if (!strncmp("OMX.google.goldfish.vp9.decoder", name, 30)) {
+        return new android::GoldfishVPX(
+                name, "video_decoder.vp9", OMX_VIDEO_CodingVP9, callbacks,
+                appData, component, RenderMode::RENDER_BY_GUEST_CPU);
+    }
+    if (!strncmp("OMX.google.goldfish.vp8.decoder", name, 30)) {
+        return new android::GoldfishVPX(
+                name, "video_decoder.vp8", OMX_VIDEO_CodingVP8, callbacks,
+                appData, component, RenderMode::RENDER_BY_GUEST_CPU);
+    }
+    { CHECK(!"Unknown component"); }
+    return NULL;
+}
diff --git a/system/codecs/omx/vpxdec/GoldfishVPX.h b/system/codecs/omx/vpxdec/GoldfishVPX.h
new file mode 100644
index 0000000..cb9321f
--- /dev/null
+++ b/system/codecs/omx/vpxdec/GoldfishVPX.h
@@ -0,0 +1,111 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef GOLDFISH_VPX_H_
+
+#define GOLDFISH_VPX_H_
+
+#include "GoldfishVideoDecoderOMXComponent.h"
+#include "goldfish_vpx_defs.h"
+
+#include <sys/time.h>
+
+#include <map>
+#include <vector>
+
+#include <ui/GraphicBuffer.h>
+#include <utils/List.h>
+#include <utils/RefBase.h>
+#include <utils/Vector.h>
+#include <utils/threads.h>
+#include <gralloc_cb_bp.h>
+
+namespace android {
+
+struct ABuffer;
+
+struct GoldfishVPX : public GoldfishVideoDecoderOMXComponent {
+    GoldfishVPX(const char* name,
+                const char* componentRole,
+                OMX_VIDEO_CODINGTYPE codingType,
+                const OMX_CALLBACKTYPE* callbacks,
+                OMX_PTR appData,
+                OMX_COMPONENTTYPE** component,
+                RenderMode renderMode);
+
+protected:
+    virtual ~GoldfishVPX();
+
+    virtual void onQueueFilled(OMX_U32 portIndex);
+    virtual void onPortFlushCompleted(OMX_U32 portIndex);
+    virtual void onReset();
+    virtual bool supportDescribeHdrStaticInfo();
+    virtual bool supportDescribeHdr10PlusInfo();
+
+    virtual OMX_ERRORTYPE internalGetParameter(OMX_INDEXTYPE index,
+                                               OMX_PTR params);
+
+    virtual OMX_ERRORTYPE internalSetParameter(OMX_INDEXTYPE index,
+                                               const OMX_PTR params);
+
+    virtual OMX_ERRORTYPE getExtensionIndex(const char* name,
+                                            OMX_INDEXTYPE* index);
+
+private:
+    enum {
+        kNumBuffers = 10
+    };
+
+    enum {
+        MODE_VP8,
+        MODE_VP9
+    } mMode;
+
+    RenderMode mRenderMode = RenderMode::RENDER_BY_GUEST_CPU;
+    bool mEnableAndroidNativeBuffers = false;
+    std::map<void*, sp<ANativeWindowBuffer>> mNWBuffers;
+
+    int getHostColorBufferId(void* header);
+
+    enum {
+        INPUT_DATA_AVAILABLE,  // VPX component is ready to decode data.
+        INPUT_EOS_SEEN,        // VPX component saw EOS and is flushing On2 decoder.
+        OUTPUT_FRAMES_FLUSHED  // VPX component finished flushing On2 decoder.
+    } mEOSStatus;
+
+    vpx_codec_ctx_t *mCtx;
+    bool mFrameParallelMode;  // Frame parallel is only supported by VP9 decoder.
+    struct PrivInfo {
+        OMX_TICKS mTimeStamp;
+        sp<ABuffer> mHdr10PlusInfo;
+    };
+    PrivInfo mPrivInfo[kNumBuffers];
+    uint8_t mTimeStampIdx;
+    vpx_image_t *mImg;
+
+    status_t initDecoder();
+    status_t destroyDecoder();
+    bool outputBuffers(bool flushDecoder, bool display, bool eos, bool *portWillReset);
+    bool outputBufferSafe(OMX_BUFFERHEADERTYPE *outHeader);
+
+    void setup_ctx_parameters(vpx_codec_ctx_t*, int hostColorBufferId = -1);
+
+    DISALLOW_EVIL_CONSTRUCTORS(GoldfishVPX);
+};
+
+}  // namespace android
+
+#endif  // GOLDFISH_VPX_H_
diff --git a/system/codecs/omx/vpxdec/goldfish_vpx_defs.h b/system/codecs/omx/vpxdec/goldfish_vpx_defs.h
new file mode 100644
index 0000000..25fecde
--- /dev/null
+++ b/system/codecs/omx/vpxdec/goldfish_vpx_defs.h
@@ -0,0 +1,65 @@
+#ifndef MY_VPX_DEFS_H_
+#define MY_VPX_DEFS_H_
+
+
+#define VPX_IMG_FMT_PLANAR 0x100       /**< Image is a planar format. */
+#define VPX_IMG_FMT_UV_FLIP 0x200      /**< V plane precedes U in memory. */
+#define VPX_IMG_FMT_HAS_ALPHA 0x400    /**< Image has an alpha channel. */
+#define VPX_IMG_FMT_HIGHBITDEPTH 0x800 /**< Image uses 16bit framebuffer. */
+
+typedef unsigned char uint8_t;
+
+enum class RenderMode {
+    RENDER_BY_HOST_GPU = 1,
+    RENDER_BY_GUEST_CPU = 2,
+};
+
+enum vpx_img_fmt_t {
+  VPX_IMG_FMT_NONE,
+  VPX_IMG_FMT_YV12 =
+      VPX_IMG_FMT_PLANAR | VPX_IMG_FMT_UV_FLIP | 1, /**< planar YVU */
+  VPX_IMG_FMT_I420 = VPX_IMG_FMT_PLANAR | 2,
+  VPX_IMG_FMT_I422 = VPX_IMG_FMT_PLANAR | 5,
+  VPX_IMG_FMT_I444 = VPX_IMG_FMT_PLANAR | 6,
+  VPX_IMG_FMT_I440 = VPX_IMG_FMT_PLANAR | 7,
+  VPX_IMG_FMT_I42016 = VPX_IMG_FMT_I420 | VPX_IMG_FMT_HIGHBITDEPTH,
+  VPX_IMG_FMT_I42216 = VPX_IMG_FMT_I422 | VPX_IMG_FMT_HIGHBITDEPTH,
+  VPX_IMG_FMT_I44416 = VPX_IMG_FMT_I444 | VPX_IMG_FMT_HIGHBITDEPTH,
+  VPX_IMG_FMT_I44016 = VPX_IMG_FMT_I440 | VPX_IMG_FMT_HIGHBITDEPTH
+};
+    
+struct vpx_image_t {
+    vpx_img_fmt_t fmt;       /**< Image Format */
+    unsigned int d_w; /**< Displayed image width */
+    unsigned int d_h; /**< Displayed image height */
+    void *user_priv;
+};
+
+#define VPX_CODEC_OK 0
+
+struct vpx_codec_ctx_t {
+    int vpversion; //8: vp8 or 9: vp9
+    int version;   // 100: return decoded frame to guest; 200: render on host
+    int hostColorBufferId;
+    uint64_t id;  // >= 1, unique
+    int memory_slot;
+    uint64_t address_offset = 0;
+    size_t outputBufferWidth;
+    size_t outputBufferHeight;
+    size_t width;
+    size_t height;
+    size_t bpp;
+    uint8_t *data;
+    uint8_t *dst;
+    vpx_image_t myImg;
+};
+
+int vpx_codec_destroy(vpx_codec_ctx_t*);
+int vpx_codec_dec_init(vpx_codec_ctx_t*);
+vpx_image_t* vpx_codec_get_frame(vpx_codec_ctx_t*, int hostColorBufferId = -1);
+int vpx_codec_flush(vpx_codec_ctx_t *ctx);
+int vpx_codec_decode(vpx_codec_ctx_t *ctx, const uint8_t *data,
+                                 unsigned int data_sz, void *user_priv,
+                                 long deadline);
+
+#endif  // MY_VPX_DEFS_H_
diff --git a/system/codecs/omx/vpxdec/goldfish_vpx_impl.cpp b/system/codecs/omx/vpxdec/goldfish_vpx_impl.cpp
new file mode 100644
index 0000000..03bbbb2
--- /dev/null
+++ b/system/codecs/omx/vpxdec/goldfish_vpx_impl.cpp
@@ -0,0 +1,177 @@
+#include <log/log.h>
+
+#include <linux/types.h>
+#include <linux/ioctl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+#include <sys/ioctl.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <cstdlib>
+#include <string>
+#include <errno.h>
+#include "goldfish_vpx_defs.h"
+#include "goldfish_media_utils.h"
+
+#include <memory>
+#include <mutex>
+#include <vector>
+
+#define DEBUG 0
+#if DEBUG
+#define DDD(...) ALOGD(__VA_ARGS__)
+#else
+#define DDD(...) ((void)0)
+#endif
+
+// static vpx_image_t myImg;
+static uint64_t s_CtxId = 0;
+static std::mutex sCtxidMutex;
+
+static uint64_t applyForOneId() {
+    DDD("%s %d", __func__, __LINE__);
+    std::lock_guard<std::mutex> g{sCtxidMutex};
+    ++s_CtxId;
+    return s_CtxId;
+}
+
+static void sendVpxOperation(vpx_codec_ctx_t* ctx, MediaOperation op) {
+    DDD("%s %d", __func__, __LINE__);
+    if (ctx->memory_slot < 0) {
+        ALOGE("ERROR: Failed %s %d: there is no memory slot", __func__,
+              __LINE__);
+    }
+    auto transport = GoldfishMediaTransport::getInstance();
+    transport->sendOperation(ctx->vpversion == 9 ? MediaCodecType::VP9Codec
+                                                 : MediaCodecType::VP8Codec,
+                             op, ctx->address_offset);
+}
+
+int vpx_codec_destroy(vpx_codec_ctx_t* ctx) {
+    DDD("%s %d", __func__, __LINE__);
+    if (!ctx) {
+      ALOGE("ERROR: Failed %s %d: ctx is nullptr", __func__, __LINE__);
+      return -1;
+    }
+    auto transport = GoldfishMediaTransport::getInstance();
+    transport->writeParam(ctx->id, 0, ctx->address_offset);
+    sendVpxOperation(ctx, MediaOperation::DestroyContext);
+    transport->returnMemorySlot(ctx->memory_slot);
+    ctx->memory_slot = -1;
+    return 0;
+}
+
+int vpx_codec_dec_init(vpx_codec_ctx_t* ctx) {
+    DDD("%s %d", __func__, __LINE__);
+    auto transport = GoldfishMediaTransport::getInstance();
+    int slot = transport->getMemorySlot();
+    if (slot < 0) {
+        ALOGE("ERROR: Failed %s %d: cannot get memory slot", __func__,
+              __LINE__);
+        return -1;
+    } else {
+        DDD("got slot %d", slot);
+    }
+    ctx->id = applyForOneId();
+    ctx->memory_slot = slot;
+    ctx->address_offset = static_cast<unsigned int>(ctx->memory_slot) * (1 << 20);
+    DDD("got address offset 0x%x version %d", (int)(ctx->address_offset),
+        ctx->version);
+
+    // data and dst are on the host side actually
+    ctx->data = transport->getInputAddr(ctx->address_offset);
+    ctx->dst = transport->getInputAddr(
+            ctx->address_offset);  // re-use input address
+    transport->writeParam(ctx->id, 0, ctx->address_offset);
+    transport->writeParam(ctx->version, 1, ctx->address_offset);
+    sendVpxOperation(ctx, MediaOperation::InitContext);
+    return 0;
+}
+
+static int getReturnCode(uint8_t* ptr) {
+    int* pint = (int*)(ptr);
+    return *pint;
+}
+
+// vpx_image_t myImg;
+static void getVpxFrame(uint8_t* ptr, vpx_image_t& myImg) {
+    DDD("%s %d", __func__, __LINE__);
+    uint8_t* imgptr = (ptr + 8);
+    myImg.fmt = *(vpx_img_fmt_t*)imgptr;
+    imgptr += 8;
+    myImg.d_w = *(unsigned int *)imgptr;
+    imgptr += 8;
+    myImg.d_h = *(unsigned int *)imgptr;
+    imgptr += 8;
+    myImg.user_priv = (void*)(*(uint64_t*)imgptr);
+    DDD("fmt %d dw %d dh %d userpriv %p", (int)myImg.fmt, (int)myImg.d_w,
+        (int)myImg.d_h, myImg.user_priv);
+}
+
+//TODO: we might not need to do the putting all the time
+vpx_image_t* vpx_codec_get_frame(vpx_codec_ctx_t* ctx, __attribute__((unused)) int hostColorBufferId) {
+    DDD("%s %d %p", __func__, __LINE__);
+    if (!ctx) {
+      ALOGE("ERROR: Failed %s %d: ctx is nullptr", __func__, __LINE__);
+      return nullptr;
+    }
+    auto transport = GoldfishMediaTransport::getInstance();
+
+    transport->writeParam(ctx->id, 0, ctx->address_offset);
+    transport->writeParam(ctx->outputBufferWidth, 1, ctx->address_offset);
+    transport->writeParam(ctx->outputBufferHeight, 2, ctx->address_offset);
+    transport->writeParam(ctx->width, 3, ctx->address_offset);
+    transport->writeParam(ctx->height, 4, ctx->address_offset);
+    transport->writeParam(ctx->bpp, 5, ctx->address_offset);
+    transport->writeParam(ctx->hostColorBufferId, 6, ctx->address_offset);
+    transport->writeParam(
+            transport->offsetOf((uint64_t)(ctx->dst)) - ctx->address_offset, 7,
+            ctx->address_offset);
+
+    sendVpxOperation(ctx, MediaOperation::GetImage);
+
+    auto* retptr = transport->getReturnAddr(ctx->address_offset);
+    int ret = getReturnCode(retptr);
+    if (ret) {
+        return nullptr;
+    }
+    getVpxFrame(retptr, ctx->myImg);
+    return &(ctx->myImg);
+}
+
+int vpx_codec_flush(vpx_codec_ctx_t* ctx) {
+    DDD("%s %d", __func__, __LINE__);
+    if (!ctx) {
+      ALOGE("ERROR: Failed %s %d: ctx is nullptr", __func__, __LINE__);
+      return -1;
+    }
+    auto transport = GoldfishMediaTransport::getInstance();
+    transport->writeParam(ctx->id, 0, ctx->address_offset);
+    sendVpxOperation(ctx, MediaOperation::Flush);
+    return 0;
+}
+
+int vpx_codec_decode(vpx_codec_ctx_t *ctx,
+                     const uint8_t* data,
+                     unsigned int data_sz,
+                     void* user_priv,
+                     __attribute__((unused)) long deadline) {
+    if (!ctx) {
+      ALOGE("ERROR: Failed %s %d: ctx is nullptr", __func__, __LINE__);
+      return -1;
+    }
+    DDD("%s %d data size %d userpriv %p", __func__, __LINE__, (int)data_sz,
+        user_priv);
+    auto transport = GoldfishMediaTransport::getInstance();
+    memcpy(ctx->data, data, data_sz);
+
+    transport->writeParam(ctx->id, 0, ctx->address_offset);
+    transport->writeParam(
+            transport->offsetOf((uint64_t)(ctx->data)) - ctx->address_offset, 1,
+            ctx->address_offset);
+    transport->writeParam((__u64)data_sz, 2, ctx->address_offset);
+    transport->writeParam((__u64)user_priv, 3, ctx->address_offset);
+    sendVpxOperation(ctx, MediaOperation::DecodeImage);
+    return 0;
+}
diff --git a/system/egl/Android.mk b/system/egl/Android.mk
new file mode 100644
index 0000000..e63e7e0
--- /dev/null
+++ b/system/egl/Android.mk
@@ -0,0 +1,73 @@
+ifneq (false,$(BUILD_EMULATOR_OPENGL_DRIVER))
+
+LOCAL_PATH := $(call my-dir)
+
+$(call emugl-begin-shared-library,libEGL_emulation)
+$(call emugl-import,libOpenglSystemCommon libGoldfishProfiler)
+$(call emugl-set-shared-library-subpath,egl)
+
+ifeq (true,$(GOLDFISH_OPENGL_BUILD_FOR_HOST))
+$(call emugl-import,libqemupipe$(GOLDFISH_OPENGL_LIB_SUFFIX))
+else
+$(call emugl-export,STATIC_LIBRARIES,libqemupipe.ranchu)
+endif
+
+LOCAL_CFLAGS += -DLOG_TAG=\"EGL_emulation\" -DEGL_EGLEXT_PROTOTYPES -DWITH_GLES2
+LOCAL_CFLAGS += -Wno-gnu-designator
+
+LOCAL_SRC_FILES := \
+    eglDisplay.cpp \
+    egl.cpp \
+    ClientAPIExts.cpp
+
+ifneq (true,$(GOLDFISH_OPENGL_BUILD_FOR_HOST))
+
+LOCAL_SHARED_LIBRARIES += libdl
+ifeq (true,$(GFXSTREAM))
+LOCAL_CFLAGS += -DVIRTIO_GPU
+LOCAL_C_INCLUDES += external/libdrm
+LOCAL_SHARED_LIBRARIES += libdrm
+endif # GFXSTREAM
+endif # GOLDFISH_OPENGL_BUILD_FOR_HOST
+
+ifneq (true,$(GOLDFISH_OPENGL_BUILD_FOR_HOST))
+ifdef IS_AT_LEAST_OPM1
+LOCAL_HEADER_LIBRARIES += libui_headers
+endif
+
+ifdef IS_AT_LEAST_OPD1
+LOCAL_HEADER_LIBRARIES += libnativebase_headers
+LOCAL_STATIC_LIBRARIES += libarect
+LOCAL_SHARED_LIBRARIES += libnativewindow
+endif
+
+endif # !GOLDFISH_OPENGL_BUILD_FOR_HOST
+
+$(call emugl-end-module)
+
+#### egl.cfg ####
+
+# Ensure that this file is only copied to emulator-specific builds.
+# Other builds are device-specific and will provide their own
+# version of this file to point to the appropriate HW EGL libraries.
+#
+ifneq (,$(filter aosp_arm aosp_x86 aosp_mips full full_x86 full_mips sdk sdk_x86 sdk_mips google_sdk google_sdk_x86 google_sdk_mips,$(TARGET_PRODUCT)))
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := egl.cfg
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../LICENSE
+LOCAL_SRC_FILES := $(LOCAL_MODULE)
+
+LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/egl
+LOCAL_MODULE_CLASS := ETC
+
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 19 && echo PreKitkat),PreKitkat)
+    LOCAL_MODULE_TAGS := debug
+endif
+
+include $(BUILD_PREBUILT)
+endif # TARGET_PRODUCT in 'full full_x86 full_mips sdk sdk_x86 sdk_mips google_sdk google_sdk_x86 google_sdk_mips')
+
+endif # BUILD_EMULATOR_OPENGL_DRIVER != false
diff --git a/system/egl/CMakeLists.txt b/system/egl/CMakeLists.txt
new file mode 100644
index 0000000..26ac0f3
--- /dev/null
+++ b/system/egl/CMakeLists.txt
@@ -0,0 +1,10 @@
+# This is an autogenerated file! Do not edit!
+# instead run make from .../device/generic/goldfish-opengl
+# which will re-generate this file.
+android_validate_sha256("${GOLDFISH_DEVICE_ROOT}/system/egl/Android.mk" "d7a50905a3d2624cf594158d9c370bf29bc6115d967bdfa919e9ffa42a87d0bb")
+set(EGL_emulation_src eglDisplay.cpp egl.cpp ClientAPIExts.cpp)
+android_add_library(TARGET EGL_emulation SHARED LICENSE Apache-2.0 SRC eglDisplay.cpp egl.cpp ClientAPIExts.cpp)
+target_include_directories(EGL_emulation PRIVATE ${GOLDFISH_DEVICE_ROOT}/system/profiler ${GOLDFISH_DEVICE_ROOT}/system/OpenglSystemCommon/bionic-include ${GOLDFISH_DEVICE_ROOT}/system/OpenglSystemCommon ${GOLDFISH_DEVICE_ROOT}/bionic/libc/private ${GOLDFISH_DEVICE_ROOT}/bionic/libc/platform ${GOLDFISH_DEVICE_ROOT}/system/vulkan_enc ${GOLDFISH_DEVICE_ROOT}/shared/gralloc_cb/include ${GOLDFISH_DEVICE_ROOT}/shared/GoldfishAddressSpace/include ${GOLDFISH_DEVICE_ROOT}/platform/include ${GOLDFISH_DEVICE_ROOT}/system/renderControl_enc ${GOLDFISH_DEVICE_ROOT}/system/GLESv2_enc ${GOLDFISH_DEVICE_ROOT}/system/GLESv1_enc ${GOLDFISH_DEVICE_ROOT}/shared/OpenglCodecCommon ${GOLDFISH_DEVICE_ROOT}/android-emu ${GOLDFISH_DEVICE_ROOT}/shared/qemupipe/include-types ${GOLDFISH_DEVICE_ROOT}/shared/qemupipe/include ${GOLDFISH_DEVICE_ROOT}/./host/include/libOpenglRender ${GOLDFISH_DEVICE_ROOT}/./system/include ${GOLDFISH_DEVICE_ROOT}/./../../../external/qemu/android/android-emugl/guest)
+target_compile_definitions(EGL_emulation PRIVATE "-DPLATFORM_SDK_VERSION=29" "-DGOLDFISH_HIDL_GRALLOC" "-DHOST_BUILD" "-DANDROID" "-DGL_GLEXT_PROTOTYPES" "-DPAGE_SIZE=4096" "-DGFXSTREAM" "-DENABLE_ANDROID_HEALTH_MONITOR" "-DLOG_TAG=\"EGL_emulation\"" "-DEGL_EGLEXT_PROTOTYPES" "-DWITH_GLES2")
+target_compile_options(EGL_emulation PRIVATE "-fvisibility=default" "-Wno-unused-parameter" "-Wno-gnu-designator")
+target_link_libraries(EGL_emulation PRIVATE GoldfishProfiler OpenglSystemCommon android-emu-shared vulkan_enc gui log _renderControl_enc GLESv2_enc GLESv1_enc OpenglCodecCommon_host cutils utils androidemu PRIVATE gralloc_cb_host GoldfishAddressSpace_host platform_host qemupipe_host)
\ No newline at end of file
diff --git a/system/egl/ClientAPIExts.cpp b/system/egl/ClientAPIExts.cpp
new file mode 100644
index 0000000..40644e7
--- /dev/null
+++ b/system/egl/ClientAPIExts.cpp
@@ -0,0 +1,160 @@
+/*
+* Copyright (C) 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#include "ClientAPIExts.h"
+#include "ThreadInfo.h"
+#include <GLES/gl.h>
+#include <GLES/glext.h>
+#include "eglContext.h"
+
+namespace ClientAPIExts
+{
+
+//
+// define function pointer type for each extention function
+// typename has the form __egl_{funcname}_t
+//
+#define FUNC_TYPE(fname) __egl_ ## fname ## _t
+// NOLINT: clang-tidy adds parentheses around 'params'.
+#define API_ENTRY(fname,params,args) \
+    typedef void (GL_APIENTRY *FUNC_TYPE(fname)) params;  // NOLINT
+
+#define API_ENTRY_RET(rtype,fname,params,args) \
+    typedef rtype (GL_APIENTRY *FUNC_TYPE(fname)) params;  // NOLINT
+
+#include "ClientAPIExts.in"
+#undef API_ENTRY
+#undef API_ENTRY_RET
+
+/////
+// Define static table to store the function value for each
+// client API. functions pointers will get initialized through
+// ClientAPIExts::initClientFuncs function after each client API has been
+// loaded.
+/////
+#define API_ENTRY(fname,params,args) \
+    FUNC_TYPE(fname) (fname);
+
+#define API_ENTRY_RET(rtype,fname,params,args) \
+    API_ENTRY(fname,params,args)
+
+static struct _ext_table
+{
+#include "ClientAPIExts.in"
+} s_client_extensions[2];
+
+#undef API_ENTRY
+#undef API_ENTRY_RET
+
+//
+// This function initialized each entry in the s_client_extensions
+// struct at the givven index using the givven client interface
+//
+void initClientFuncs(const EGLClient_glesInterface *iface, int idx)
+{
+#define API_ENTRY(fname,params,args) \
+    s_client_extensions[idx].fname = \
+          (FUNC_TYPE(fname))iface->getProcAddress(#fname);
+
+#define API_ENTRY_RET(rtype,fname,params,args) \
+    API_ENTRY(fname,params,args)
+
+    //
+    // reset all func pointers to NULL
+    //
+    memset(&s_client_extensions[idx], 0, sizeof(struct _ext_table));
+
+    //
+    // And now query the GLES library for each proc address
+    //
+#include "ClientAPIExts.in"
+#undef API_ENTRY
+#undef API_ENTRY_RET
+}
+
+//
+// Define implementation for each extension function which checks
+// the current context version and calls to the correct client API
+// function.
+//
+// NOLINT: clang-tidy adds parentheses around 'args'.
+#define API_ENTRY(fname,params,args) \
+    static void _egl_ ## fname params \
+    { \
+        EGLThreadInfo* thread  = getEGLThreadInfo(); \
+        if (!thread->currentContext) { \
+            return; \
+        } \
+        int clientMajorVersion = (int)thread->currentContext->majorVersion; \
+        int idx = clientMajorVersion == 1 ? 0 : 1; \
+        if (!s_client_extensions[idx].fname) { \
+            return; \
+        } \
+        (*s_client_extensions[idx].fname) args; /* NOLINT */ \
+    }
+
+#define API_ENTRY_RET(rtype,fname,params,args) \
+    static rtype _egl_ ## fname params \
+    { \
+        EGLThreadInfo* thread  = getEGLThreadInfo(); \
+        if (!thread->currentContext) { \
+            return (rtype)0; \
+        } \
+        int idx = (int)thread->currentContext->majorVersion - 1; \
+        if (!s_client_extensions[idx].fname) { \
+            return (rtype)0; \
+        } \
+        return (*s_client_extensions[idx].fname) args; /* NOLINT */ \
+    }
+
+#include "ClientAPIExts.in"
+#undef API_ENTRY
+#undef API_ENTRY_RET
+
+//
+// Define a table to map function names to the local _egl_ version of
+// the extension function, to be used in eglGetProcAddress.
+//
+#define API_ENTRY(fname,params,args) \
+    { #fname, (void*)_egl_ ## fname},
+#define API_ENTRY_RET(rtype,fname,params,args) \
+    API_ENTRY(fname,params,args)
+
+static const struct _client_ext_funcs {
+    const char *fname;
+    void* proc;
+} s_client_ext_funcs[] = {
+#include "ClientAPIExts.in"
+};
+static const int numExtFuncs = sizeof(s_client_ext_funcs) / 
+                               sizeof(s_client_ext_funcs[0]);
+
+#undef API_ENTRY
+#undef API_ENTRY_RET
+
+//
+// returns the __egl_ version of the givven extension function name.
+//
+void* getProcAddress(const char *fname)
+{
+    for (int i=0; i<numExtFuncs; i++) {
+        if (!strcmp(fname, s_client_ext_funcs[i].fname)) {
+            return s_client_ext_funcs[i].proc;
+        }
+    }
+    return NULL;
+}
+
+} // of namespace ClientAPIExts
diff --git a/system/egl/ClientAPIExts.h b/system/egl/ClientAPIExts.h
new file mode 100644
index 0000000..eee9172
--- /dev/null
+++ b/system/egl/ClientAPIExts.h
@@ -0,0 +1,29 @@
+/*
+* Copyright (C) 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#ifndef _CLIENT_APIS_EXTS_H
+#define _CLIENT_APIS_EXTS_H
+
+#include "EGLClientIface.h"
+
+namespace ClientAPIExts
+{
+
+void initClientFuncs(const EGLClient_glesInterface *iface, int idx);
+void* getProcAddress(const char *fname);
+
+} // of namespace ClientAPIExts
+
+#endif
diff --git a/system/egl/ClientAPIExts.in b/system/egl/ClientAPIExts.in
new file mode 100644
index 0000000..a4595f2
--- /dev/null
+++ b/system/egl/ClientAPIExts.in
@@ -0,0 +1,225 @@
+//
+// Each extension function should have one of the following
+// macro definitions:
+//    API_ENTRY(funcname, paramlist, arglist)
+//  -or- (if the function has a return value)
+//    API_ENTRY_RET(return_type,funcname, paramlist, arglist)
+//
+API_ENTRY(glEGLImageTargetTexture2DOES,
+          (GLenum target, GLeglImageOES image),
+          (target, image))
+
+API_ENTRY(glEGLImageTargetRenderbufferStorageOES,
+          (GLenum target, GLeglImageOES image),
+          (target, image))
+
+API_ENTRY(glBlendEquationSeparateOES,
+          (GLenum modeRGB, GLenum modeAlpha),
+          (modeRGB, modeAlpha))
+
+API_ENTRY(glBlendFuncSeparateOES,
+          (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha),
+          (srcRGB, dstRGB, srcAlpha, dstAlpha))
+
+API_ENTRY(glBlendEquationOES,
+          (GLenum mode),
+          (mode))
+
+API_ENTRY(glCurrentPaletteMatrixOES,
+          (GLuint matrixpaletteindex),
+          (matrixpaletteindex))
+
+API_ENTRY(glLoadPaletteFromModelViewMatrixOES,
+          (void),
+          ())
+
+API_ENTRY(glMatrixIndexPointerOES,
+          (GLint size, GLenum type, GLsizei stride, const GLvoid * pointer),
+          (size, type, stride, pointer))
+
+API_ENTRY(glWeightPointerOES,
+          (GLint size, GLenum type, GLsizei stride, const GLvoid * pointer),
+          (size, type, stride, pointer))
+
+API_ENTRY(glDepthRangefOES,
+          (GLclampf zNear, GLclampf zFar),
+          (zNear, zFar))
+
+API_ENTRY(glFrustumfOES,
+          (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar),
+          (left, right, bottom, top, zNear, zFar))
+
+API_ENTRY(glOrthofOES,
+          (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar),
+          (left, right, bottom, top, zNear, zFar))
+
+API_ENTRY(glClipPlanefOES,
+          (GLenum plane, const GLfloat *equation),
+          (plane, equation))
+
+API_ENTRY(glGetClipPlanefOES,
+          (GLenum pname, GLfloat * eqn),
+          (pname, eqn))
+
+API_ENTRY(glClearDepthfOES,
+          (GLclampf depth),
+          (depth))
+
+API_ENTRY(glPointSizePointerOES,
+          (GLenum type, GLsizei stride, const GLvoid *pointer),
+          (type, stride, pointer))
+
+API_ENTRY(glTexGenfOES,
+          (GLenum coord, GLenum pname, GLfloat param),
+          (coord, pname, param))
+
+API_ENTRY(glTexGenfvOES,
+          (GLenum coord, GLenum pname, const GLfloat *params),
+          (coord, pname, params))
+
+API_ENTRY(glTexGeniOES,
+          (GLenum coord, GLenum pname, GLint param),
+          (coord, pname, param))
+
+API_ENTRY(glTexGenivOES,
+          (GLenum coord, GLenum pname, const GLint *params),
+          (coord, pname, params))
+
+API_ENTRY(glTexGenxOES,
+          (GLenum coord, GLenum pname, GLfixed param),
+          (coord, pname, param))
+
+API_ENTRY(glTexGenxvOES,
+          (GLenum coord, GLenum pname, const GLfixed *params),
+          (coord, pname, params))
+
+API_ENTRY(glGetTexGenfvOES,
+          (GLenum coord, GLenum pname, GLfloat *params),
+          (coord, pname, params))
+
+API_ENTRY(glGetTexGenivOES,
+          (GLenum coord, GLenum pname, GLint *params),
+          (coord, pname, params))
+
+API_ENTRY(glGetTexGenxvOES,
+          (GLenum coord, GLenum pname, GLfixed *params),
+          (coord, pname, params))
+
+API_ENTRY_RET(GLboolean,
+              glIsRenderbufferOES,
+              (GLuint renderbuffer),
+              (renderbuffer))
+
+API_ENTRY(glBindRenderbufferOES,
+          (GLenum target, GLuint renderbuffer),
+          (target, renderbuffer))
+
+API_ENTRY(glDeleteRenderbuffersOES,
+          (GLsizei n, const GLuint* renderbuffers),
+          (n, renderbuffers))
+
+API_ENTRY(glGenRenderbuffersOES,
+          (GLsizei n, GLuint* renderbuffers),
+          (n, renderbuffers))
+
+API_ENTRY(glRenderbufferStorageOES,
+          (GLenum target, GLenum internalformat, GLsizei width, GLsizei height),
+          (target, internalformat, width, height))
+
+API_ENTRY(glGetRenderbufferParameterivOES,
+          (GLenum target, GLenum pname, GLint* params),
+          (target, pname, params))
+
+API_ENTRY_RET(GLboolean,
+              glIsFramebufferOES,
+              (GLuint framebuffer),
+              (framebuffer))
+
+API_ENTRY(glBindFramebufferOES,
+          (GLenum target, GLuint framebuffer),
+          (target, framebuffer))
+
+API_ENTRY(glDeleteFramebuffersOES,
+          (GLsizei n, const GLuint* framebuffers),
+          (n, framebuffers))
+
+API_ENTRY(glGenFramebuffersOES,
+          (GLsizei n, GLuint* framebuffers),
+          (n, framebuffers))
+
+API_ENTRY_RET(GLenum,
+              glCheckFramebufferStatusOES,
+              (GLenum target),
+              (target))
+
+API_ENTRY(glFramebufferTexture2DOES,
+          (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level),
+          (target, attachment, textarget, texture, level))
+
+API_ENTRY(glFramebufferRenderbufferOES,
+          (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer),
+          (target, attachment, renderbuffertarget, renderbuffer))
+
+API_ENTRY(glGetFramebufferAttachmentParameterivOES,
+          (GLenum target, GLenum attachment, GLenum pname, GLint* params),
+          (target, attachment, pname, params))
+
+API_ENTRY(glGenerateMipmapOES,
+          (GLenum target),
+          (target))
+
+API_ENTRY(glDrawTexsOES,
+          (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height),
+          (x, y, z, width, height))
+
+API_ENTRY(glDrawTexiOES,
+          (GLint x, GLint y, GLint z, GLint width, GLint height),
+          (x, y, z, width, height))
+
+API_ENTRY(glDrawTexfOES,
+          (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height),
+          (x, y, z, width, height))
+
+API_ENTRY(glDrawTexxOES,
+          (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height),
+          (x, y, z, width, height))
+
+API_ENTRY(glDrawTexsvOES,
+          (const GLshort *coords),
+          (coords))
+
+API_ENTRY(glDrawTexivOES,
+          (const GLint *coords),
+          (coords))
+
+API_ENTRY(glDrawTexfvOES,
+          (const GLfloat *coords),
+          (coords))
+
+API_ENTRY(glDrawTexxvOES,
+          (const GLfixed *coords),
+          (coords))
+
+API_ENTRY(glBindVertexArrayOES,
+          (GLuint array),
+          (array))
+
+API_ENTRY(glDeleteVertexArraysOES,
+          (GLsizei n, const GLuint* arrays),
+          (n, arrays))
+
+API_ENTRY(glGenVertexArraysOES,
+          (GLsizei n, GLuint* arrays),
+          (n, arrays))
+
+API_ENTRY(glIsVertexArrayOES,
+          (GLuint array),
+          (array))
+
+API_ENTRY(glMapBufferOES,
+          (GLenum target, GLenum access),
+          (target, access))
+
+API_ENTRY(glUnmapBufferOES,
+          (GLenum target),
+          (target))
\ No newline at end of file
diff --git a/system/egl/egl.cfg b/system/egl/egl.cfg
new file mode 100644
index 0000000..9d3f2dc
--- /dev/null
+++ b/system/egl/egl.cfg
@@ -0,0 +1 @@
+0 0 emulation
diff --git a/system/egl/egl.cpp b/system/egl/egl.cpp
new file mode 100644
index 0000000..d52d627
--- /dev/null
+++ b/system/egl/egl.cpp
@@ -0,0 +1,2589 @@
+/*
+* Copyright (C) 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#ifdef GFXSTREAM
+#include <atomic>
+#include <time.h>
+#endif
+
+#include <assert.h>
+
+#include "HostConnection.h"
+#include "ThreadInfo.h"
+#include "aemu/base/threads/AndroidThread.h"
+#include "eglDisplay.h"
+#include "eglSync.h"
+#include "egl_ftable.h"
+#if PLATFORM_SDK_VERSION < 26
+#include <cutils/log.h>
+#else
+#include <log/log.h>
+#endif
+#include <cutils/properties.h>
+#include "goldfish_sync.h"
+#include "GLClientState.h"
+#include "GLSharedGroup.h"
+#include "eglContext.h"
+#include "ClientAPIExts.h"
+#include "EGLImage.h"
+#include "ProcessPipe.h"
+#include "profiler.h"
+
+#include <qemu_pipe_bp.h>
+
+#include "GLEncoder.h"
+#include "GL2Encoder.h"
+
+#include <GLES3/gl31.h>
+
+#ifdef VIRTIO_GPU
+#include <xf86drm.h>
+#include <poll.h>
+
+#include "virtgpu_drm.h"
+
+#endif // VIRTIO_GPU
+
+#ifdef GFXSTREAM
+#include "aemu/base/Tracing.h"
+#endif
+#include <cutils/trace.h>
+
+#include <system/window.h>
+
+using android::base::guest::getCurrentThreadId;
+
+#define DEBUG_EGL 0
+
+#if DEBUG_EGL
+#define DPRINT(fmt,...) ALOGD("%s: " fmt, __FUNCTION__, ##__VA_ARGS__);
+#else
+#define DPRINT(...)
+#endif
+
+template<typename T>
+static T setErrorFunc(GLint error, T returnValue) {
+    getEGLThreadInfo()->eglError = error;
+    return returnValue;
+}
+
+const char *  eglStrError(EGLint err)
+{
+    switch (err){
+        case EGL_SUCCESS:           return "EGL_SUCCESS";
+        case EGL_NOT_INITIALIZED:   return "EGL_NOT_INITIALIZED";
+        case EGL_BAD_ACCESS:        return "EGL_BAD_ACCESS";
+        case EGL_BAD_ALLOC:         return "EGL_BAD_ALLOC";
+        case EGL_BAD_ATTRIBUTE:     return "EGL_BAD_ATTRIBUTE";
+        case EGL_BAD_CONFIG:        return "EGL_BAD_CONFIG";
+        case EGL_BAD_CONTEXT:       return "EGL_BAD_CONTEXT";
+        case EGL_BAD_CURRENT_SURFACE: return "EGL_BAD_CURRENT_SURFACE";
+        case EGL_BAD_DISPLAY:       return "EGL_BAD_DISPLAY";
+        case EGL_BAD_MATCH:         return "EGL_BAD_MATCH";
+        case EGL_BAD_NATIVE_PIXMAP: return "EGL_BAD_NATIVE_PIXMAP";
+        case EGL_BAD_NATIVE_WINDOW: return "EGL_BAD_NATIVE_WINDOW";
+        case EGL_BAD_PARAMETER:     return "EGL_BAD_PARAMETER";
+        case EGL_BAD_SURFACE:       return "EGL_BAD_SURFACE";
+        case EGL_CONTEXT_LOST:      return "EGL_CONTEXT_LOST";
+        default: return "UNKNOWN";
+    }
+}
+
+#define LOG_EGL_ERRORS 1
+
+#ifdef LOG_EGL_ERRORS
+
+#define setErrorReturn(error, retVal)                                                           \
+    {                                                                                           \
+        ALOGE("tid %lu: %s(%d): error 0x%x (%s)", getCurrentThreadId(), __FUNCTION__, __LINE__, \
+              error, eglStrError(error));                                                       \
+        return setErrorFunc(error, retVal);                                                     \
+    }
+
+#define RETURN_ERROR(ret, err)                                                                   \
+    ALOGE("tid %lu: %s(%d): error 0x%x (%s)", getCurrentThreadId(), __FUNCTION__, __LINE__, err, \
+          eglStrError(err));                                                                     \
+    getEGLThreadInfo()->eglError = err;                                                          \
+    return ret;
+
+#else //!LOG_EGL_ERRORS
+
+#define setErrorReturn(error, retVal) return setErrorFunc(error, retVal);
+
+#define RETURN_ERROR(ret,err)           \
+    getEGLThreadInfo()->eglError = err; \
+    return ret;
+
+#endif //LOG_EGL_ERRORS
+
+#define VALIDATE_CONFIG(cfg,ret) \
+    if (!s_display.isValidConfig(cfg)) { \
+        RETURN_ERROR(ret,EGL_BAD_CONFIG); \
+    }
+
+#define VALIDATE_DISPLAY(dpy,ret) \
+    if ((dpy) != (EGLDisplay)&s_display) { \
+        RETURN_ERROR(ret, EGL_BAD_DISPLAY);    \
+    }
+
+#define VALIDATE_DISPLAY_INIT(dpy,ret) \
+    VALIDATE_DISPLAY(dpy, ret)    \
+    if (!s_display.initialized()) {        \
+        RETURN_ERROR(ret, EGL_NOT_INITIALIZED);    \
+    }
+
+#define DEFINE_HOST_CONNECTION \
+    HostConnection *hostCon = HostConnection::get(); \
+    ExtendedRCEncoderContext *rcEnc = (hostCon ? hostCon->rcEncoder() : NULL)
+
+#define DEFINE_AND_VALIDATE_HOST_CONNECTION(ret) \
+    HostConnection *hostCon = HostConnection::get(); \
+    if (!hostCon) { \
+        ALOGE("egl: Failed to get host connection\n"); \
+        return ret; \
+    } \
+    ExtendedRCEncoderContext *rcEnc = hostCon->rcEncoder(); \
+    if (!rcEnc) { \
+        ALOGE("egl: Failed to get renderControl encoder context\n"); \
+        return ret; \
+    } \
+    Gralloc *grallocHelper = hostCon->grallocHelper(); \
+    if (!grallocHelper) { \
+        ALOGE("egl: Failed to get grallocHelper\n"); \
+        return ret; \
+    }
+
+#define DEFINE_AND_VALIDATE_HOST_CONNECTION_FOR_TLS(ret, tls) \
+    HostConnection *hostCon = HostConnection::getWithThreadInfo(tls); \
+    if (!hostCon) { \
+        ALOGE("egl: Failed to get host connection\n"); \
+        return ret; \
+    } \
+    ExtendedRCEncoderContext *rcEnc = hostCon->rcEncoder(); \
+    if (!rcEnc) { \
+        ALOGE("egl: Failed to get renderControl encoder context\n"); \
+        return ret; \
+    } \
+    Gralloc const* grallocHelper = hostCon->grallocHelper(); \
+    if (!grallocHelper) { \
+        ALOGE("egl: Failed to get grallocHelper\n"); \
+        return ret; \
+    }
+
+#define VALIDATE_CONTEXT_RETURN(context,ret)  \
+    if (!(context) || !s_display.isContext((context))) {                         \
+        RETURN_ERROR(ret,EGL_BAD_CONTEXT);    \
+    }
+
+#define VALIDATE_SURFACE_RETURN(surface, ret)    \
+    if ((surface) != EGL_NO_SURFACE) {    \
+        if (!s_display.isSurface((surface))) \
+            setErrorReturn(EGL_BAD_SURFACE, EGL_FALSE); \
+        egl_surface_t* s( static_cast<egl_surface_t*>(surface) );    \
+        if (s->dpy != (EGLDisplay)&s_display)    \
+            setErrorReturn(EGL_BAD_DISPLAY, EGL_FALSE);    \
+    }
+
+// The one and only supported display object.
+static eglDisplay s_display;
+
+// Extra defines not in the official EGL spec yet,
+// but required in Android CTS.
+
+#define EGL_TIMESTAMPS_ANDROID 0x314D
+
+EGLContext_t::EGLContext_t(EGLDisplay dpy, EGLConfig config, EGLContext_t* shareCtx, int maj, int min) :
+    dpy(dpy),
+    config(config),
+    read(EGL_NO_SURFACE),
+    draw(EGL_NO_SURFACE),
+    shareCtx(shareCtx),
+    rcContext(0),
+    versionString(NULL),
+    majorVersion(maj),
+    minorVersion(min),
+    vendorString(NULL) ,
+    rendererString(NULL),
+    shaderVersionString(NULL),
+    extensionString(NULL),
+    deletePending(0),
+    goldfishSyncFd(-1)
+{
+
+    DEFINE_HOST_CONNECTION;
+    switch (rcEnc->getGLESMaxVersion()) {
+        case GLES_MAX_VERSION_3_0:
+            deviceMajorVersion = 3;
+            deviceMinorVersion = 0;
+            break;
+        case GLES_MAX_VERSION_3_1:
+            deviceMajorVersion = 3;
+            deviceMinorVersion = 1;
+            break;
+        case GLES_MAX_VERSION_3_2:
+            deviceMajorVersion = 3;
+            deviceMinorVersion = 2;
+            break;
+        default:
+            deviceMajorVersion = 2;
+            deviceMinorVersion = 0;
+            break;
+    }
+
+    flags = 0;
+    clientState = new GLClientState(majorVersion, minorVersion);
+     if (shareCtx)
+        sharedGroup = shareCtx->getSharedGroup();
+    else
+        sharedGroup = GLSharedGroupPtr(new GLSharedGroup());
+    assert(dpy == (EGLDisplay)&s_display);
+    s_display.onCreateContext((EGLContext)this);
+};
+
+int EGLContext_t::getGoldfishSyncFd() {
+    if (goldfishSyncFd < 0) {
+        goldfishSyncFd = goldfish_sync_open();
+    }
+    return goldfishSyncFd;
+}
+
+EGLContext_t::~EGLContext_t()
+{
+    if (goldfishSyncFd > 0) {
+        goldfish_sync_close(goldfishSyncFd);
+        goldfishSyncFd = -1;
+    }
+    assert(dpy == (EGLDisplay)&s_display);
+    s_display.onDestroyContext((EGLContext)this);
+    delete clientState;
+    delete [] versionString;
+    delete [] vendorString;
+    delete [] rendererString;
+    delete [] shaderVersionString;
+    delete [] extensionString;
+}
+
+uint64_t currGuestTimeNs() {
+    struct timespec ts;
+#ifdef __APPLE__
+    clock_gettime(CLOCK_REALTIME, &ts);
+#else
+    clock_gettime(CLOCK_BOOTTIME, &ts);
+#endif
+    uint64_t res = (uint64_t)(ts.tv_sec * 1000000000ULL + ts.tv_nsec);
+    return res;
+}
+
+struct app_time_metric_t {
+    uint64_t lastLogTime;
+    uint64_t lastSwapBuffersReturnTime;
+    unsigned int numSamples;
+    uint64_t totalAppTime;
+    uint64_t minAppTime;
+    uint64_t maxAppTime;
+
+    app_time_metric_t() :
+        lastLogTime(0),
+        lastSwapBuffersReturnTime(0),
+        numSamples(0),
+        totalAppTime(0),
+        minAppTime(0),
+        maxAppTime(0)
+    {
+    }
+
+    void onSwapBuffersReturn() {
+        lastSwapBuffersReturnTime = currGuestTimeNs();
+    }
+
+    static float ns2ms(uint64_t ns) {
+        return (float)ns / 1000000.0;
+    }
+
+    void onQueueBufferReturn() {
+        if(lastSwapBuffersReturnTime == 0) {
+            // First swapBuffers call, or last call failed.
+            return;
+        }
+
+        uint64_t now = currGuestTimeNs();
+        uint64_t appTime = now - lastSwapBuffersReturnTime;
+        if(numSamples == 0) {
+          minAppTime = appTime;
+          maxAppTime = appTime;
+        }
+        else {
+          minAppTime = fmin(minAppTime, appTime);
+          maxAppTime = fmax(maxAppTime, appTime);
+        }
+        totalAppTime += appTime;
+        numSamples++;
+        // Reset so we don't record a bad sample if swapBuffers fails
+        lastSwapBuffersReturnTime = 0;
+
+        if(lastLogTime == 0) {
+            lastLogTime = now;
+            return;
+        }
+
+        // Log/reset once every second
+        if(now - lastLogTime > 1000000000) {
+            float avgMs = ns2ms(totalAppTime) / numSamples;
+            float minMs = ns2ms(minAppTime);
+            float maxMs = ns2ms(maxAppTime);
+            // B* needs the following log.
+            ALOGD("app_time_stats: avg=%0.2fms min=%0.2fms max=%0.2fms count=%u", avgMs, minMs, maxMs, numSamples);
+            totalAppTime = 0;
+            minAppTime = 0;
+            maxAppTime = 0;
+            numSamples = 0;
+            lastLogTime = now;
+        }
+    }
+};
+
+// ----------------------------------------------------------------------------
+//egl_surface_t
+
+//we don't need to handle depth since it's handled when window created on the host
+
+struct egl_surface_t {
+
+    EGLDisplay          dpy;
+    EGLConfig           config;
+
+
+    egl_surface_t(EGLDisplay dpy, EGLConfig config, EGLint surfaceType);
+    virtual     ~egl_surface_t();
+
+    virtual     void        setSwapInterval(int interval) = 0;
+    virtual     EGLBoolean  swapBuffers() = 0;
+
+    EGLint      getSwapBehavior() const;
+    uint32_t    getRcSurface()   { return rcSurface; }
+    EGLint      getSurfaceType() { return surfaceType; }
+
+    EGLint      getWidth(){ return width; }
+    EGLint      getHeight(){ return height; }
+    EGLint      getNativeWidth(){ return nativeWidth; }
+    EGLint      getNativeHeight(){ return nativeHeight; }
+    void        setTextureFormat(EGLint _texFormat) { texFormat = _texFormat; }
+    EGLint      getTextureFormat() { return texFormat; }
+    void        setTextureTarget(EGLint _texTarget) { texTarget = _texTarget; }
+    EGLint      getTextureTarget() { return texTarget; }
+
+    virtual     void setCollectingTimestamps(EGLint) { }
+    virtual     EGLint isCollectingTimestamps() const { return EGL_FALSE; }
+    EGLint      deletePending;
+    void        setIsCurrent(bool isCurrent) { mIsCurrent = isCurrent; }
+    bool        isCurrent() const { return mIsCurrent;}
+private:
+    //
+    //Surface attributes
+    //
+    EGLint      width;
+    EGLint      height;
+    EGLint      texFormat;
+    EGLint      texTarget;
+
+    // Width of the actual window being presented (not the EGL texture)
+    // Give it some default values.
+    int nativeWidth;
+    int nativeHeight;
+    bool mIsCurrent;
+protected:
+    void        setWidth(EGLint w)  { width = w;  }
+    void        setHeight(EGLint h) { height = h; }
+    void        setNativeWidth(int w)  { nativeWidth = w;  }
+    void        setNativeHeight(int h) { nativeHeight = h; }
+
+    EGLint      surfaceType;
+    uint32_t    rcSurface; //handle to surface created via remote control
+
+    app_time_metric_t appTimeMetric;
+};
+
+egl_surface_t::egl_surface_t(EGLDisplay dpy, EGLConfig config, EGLint surfaceType)
+    : dpy(dpy), config(config), deletePending(0), mIsCurrent(false),
+      surfaceType(surfaceType), rcSurface(0)
+{
+    width = 0;
+    height = 0;
+    // prevent div by 0 in EGL_(HORIZONTAL|VERTICAL)_RESOLUTION queries.
+    nativeWidth = 1;
+    nativeHeight = 1;
+    texFormat = EGL_NO_TEXTURE;
+    texTarget = EGL_NO_TEXTURE;
+    assert(dpy == (EGLDisplay)&s_display);
+    s_display.onCreateSurface((EGLSurface)this);
+}
+
+EGLint egl_surface_t::getSwapBehavior() const {
+    return EGL_BUFFER_PRESERVED;
+}
+
+egl_surface_t::~egl_surface_t()
+{
+    assert(dpy == (EGLDisplay)&s_display);
+    s_display.onDestroySurface((EGLSurface)this);
+}
+
+// ----------------------------------------------------------------------------
+// egl_window_surface_t
+
+struct egl_window_surface_t : public egl_surface_t {
+    static egl_window_surface_t* create(
+            EGLDisplay dpy, EGLConfig config, EGLint surfType,
+            ANativeWindow* window);
+
+    virtual ~egl_window_surface_t();
+
+    virtual void       setSwapInterval(int interval);
+    virtual EGLBoolean swapBuffers();
+
+    virtual     void        setCollectingTimestamps(EGLint collect)
+        override { collectingTimestamps = (collect == EGL_TRUE) ? true : false; }
+    virtual     EGLint isCollectingTimestamps() const override { return collectingTimestamps ? EGL_TRUE : EGL_FALSE; }
+
+
+private:
+    egl_window_surface_t(
+            EGLDisplay dpy, EGLConfig config, EGLint surfType,
+            ANativeWindow* window);
+    EGLBoolean init();
+
+    ANativeWindow*              nativeWindow;
+    android_native_buffer_t*    buffer;
+    bool collectingTimestamps;
+};
+
+egl_window_surface_t::egl_window_surface_t (
+        EGLDisplay dpy, EGLConfig config, EGLint surfType,
+        ANativeWindow* window)
+:   egl_surface_t(dpy, config, surfType),
+    nativeWindow(window),
+    buffer(NULL),
+    collectingTimestamps(false)
+{
+    // keep a reference on the window
+    nativeWindow->common.incRef(&nativeWindow->common);
+}
+
+
+EGLBoolean egl_window_surface_t::init()
+{
+#ifndef HOST_BUILD
+    int consumerUsage = 0;
+    if (nativeWindow->query(nativeWindow, NATIVE_WINDOW_CONSUMER_USAGE_BITS, &consumerUsage) != 0) {
+        setErrorReturn(EGL_BAD_ALLOC, EGL_FALSE);
+    } else {
+        int producerUsage = GRALLOC_USAGE_HW_RENDER;
+        native_window_set_usage(nativeWindow, consumerUsage | producerUsage);
+    }
+#endif
+
+    if (nativeWindow->dequeueBuffer_DEPRECATED(nativeWindow, &buffer) != 0) {
+        setErrorReturn(EGL_BAD_ALLOC, EGL_FALSE);
+    }
+    setWidth(buffer->width);
+    setHeight(buffer->height);
+
+    int nativeWidth, nativeHeight;
+          nativeWindow->query(nativeWindow, NATIVE_WINDOW_WIDTH, &nativeWidth);
+          nativeWindow->query(nativeWindow, NATIVE_WINDOW_HEIGHT, &nativeHeight);
+
+    setNativeWidth(nativeWidth);
+    setNativeHeight(nativeHeight);
+
+    DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_FALSE);
+    rcSurface = rcEnc->rcCreateWindowSurface(rcEnc, (uintptr_t)s_display.getIndexOfConfig(config),
+            getWidth(), getHeight());
+
+    if (!rcSurface) {
+        ALOGE("rcCreateWindowSurface returned 0");
+        return EGL_FALSE;
+    }
+    rcEnc->rcSetWindowColorBuffer(rcEnc, rcSurface,
+            grallocHelper->getHostHandle(buffer->handle));
+
+    return EGL_TRUE;
+}
+
+egl_window_surface_t* egl_window_surface_t::create(
+        EGLDisplay dpy, EGLConfig config, EGLint surfType,
+        ANativeWindow* window)
+{
+    egl_window_surface_t* wnd = new egl_window_surface_t(
+            dpy, config, surfType, window);
+    if (wnd && !wnd->init()) {
+        delete wnd;
+        wnd = NULL;
+    }
+    return wnd;
+}
+
+egl_window_surface_t::~egl_window_surface_t() {
+    DEFINE_HOST_CONNECTION;
+    if (rcSurface && rcEnc) {
+        rcEnc->rcDestroyWindowSurface(rcEnc, rcSurface);
+    }
+
+    if (buffer) {
+        nativeWindow->cancelBuffer_DEPRECATED(nativeWindow, buffer);
+    }
+    nativeWindow->common.decRef(&nativeWindow->common);
+}
+
+void egl_window_surface_t::setSwapInterval(int interval)
+{
+    nativeWindow->setSwapInterval(nativeWindow, interval);
+}
+
+// createNativeSync() creates an OpenGL sync object on the host
+// using rcCreateSyncKHR. If necessary, a native fence FD will
+// also be created through the goldfish sync device.
+// Returns a handle to the host-side FenceSync object.
+static uint64_t createNativeSync(EGLenum type,
+                                 const EGLint* attrib_list,
+                                 int num_actual_attribs,
+                                 bool destroy_when_signaled,
+                                 int fd_in,
+                                 int* fd_out) {
+    DEFINE_HOST_CONNECTION;
+
+    uint64_t sync_handle;
+    uint64_t thread_handle;
+
+    EGLint* actual_attribs =
+        (EGLint*)(num_actual_attribs == 0 ? NULL : attrib_list);
+
+    rcEnc->rcCreateSyncKHR(rcEnc, type,
+                           actual_attribs,
+                           num_actual_attribs * sizeof(EGLint),
+                           destroy_when_signaled,
+                           &sync_handle,
+                           &thread_handle);
+
+    if (type == EGL_SYNC_NATIVE_FENCE_ANDROID && fd_in < 0) {
+        int queue_work_err =
+            goldfish_sync_queue_work(
+                    getEGLThreadInfo()->currentContext->getGoldfishSyncFd(),
+                    sync_handle,
+                    thread_handle,
+                    fd_out);
+
+        (void)queue_work_err;
+
+        DPRINT("got native fence fd=%d queue_work_err=%d",
+               *fd_out, queue_work_err);
+    }
+
+    return sync_handle;
+}
+
+// our cmd
+#define VIRTIO_GPU_NATIVE_SYNC_CREATE_EXPORT_FD 0x9000
+#define VIRTIO_GPU_NATIVE_SYNC_CREATE_IMPORT_FD 0x9001
+
+// createNativeSync_virtioGpu()
+// creates an OpenGL sync object on the host
+// using rcCreateSyncKHR.
+// If necessary, a native fence FD will be exported or imported.
+// Returns a handle to the host-side FenceSync object.
+static uint64_t createNativeSync_virtioGpu(
+    EGLenum type,
+    const EGLint* attrib_list,
+    int num_actual_attribs,
+    bool destroy_when_signaled,
+    int fd_in,
+    int* fd_out) {
+#ifndef VIRTIO_GPU
+    ALOGE("%s: Error: called with no virtio-gpu support built in\n", __func__);
+    return 0;
+#else
+    DEFINE_HOST_CONNECTION;
+
+    uint64_t sync_handle;
+    uint64_t thread_handle;
+
+    EGLint* actual_attribs =
+        (EGLint*)(num_actual_attribs == 0 ? NULL : attrib_list);
+
+    // Create a normal sync obj
+    rcEnc->rcCreateSyncKHR(rcEnc, type,
+                           actual_attribs,
+                           num_actual_attribs * sizeof(EGLint),
+                           destroy_when_signaled,
+                           &sync_handle,
+                           &thread_handle);
+
+    // Import fence fd; dup and close
+    if (type == EGL_SYNC_NATIVE_FENCE_ANDROID && fd_in >= 0) {
+        int importedFd = dup(fd_in);
+
+        if (importedFd < 0) {
+            ALOGE("%s: error: failed to dup imported fd. original: %d errno %d\n",
+                  __func__, fd_in, errno);
+        }
+
+        *fd_out = importedFd;
+
+        if (close(fd_in)) {
+            ALOGE("%s: error: failed to close imported fd. original: %d errno %d\n",
+                  __func__, fd_in, errno);
+        }
+
+    } else if (type == EGL_SYNC_NATIVE_FENCE_ANDROID && fd_in < 0) {
+        // Export fence fd
+
+        uint32_t sync_handle_lo = (uint32_t)sync_handle;
+        uint32_t sync_handle_hi = (uint32_t)(sync_handle >> 32);
+
+        uint32_t cmdDwords[3] = {
+            VIRTIO_GPU_NATIVE_SYNC_CREATE_EXPORT_FD,
+            sync_handle_lo,
+            sync_handle_hi,
+        };
+
+        drm_virtgpu_execbuffer createSyncExport = {
+            .flags = VIRTGPU_EXECBUF_FENCE_FD_OUT,
+            .size = 3 * sizeof(uint32_t),
+            .command = (uint64_t)(cmdDwords),
+            .bo_handles = 0,
+            .num_bo_handles = 0,
+            .fence_fd = -1,
+        };
+
+        int queue_work_err =
+            drmIoctl(
+                hostCon->getRendernodeFd(),
+                DRM_IOCTL_VIRTGPU_EXECBUFFER, &createSyncExport);
+
+        if (queue_work_err) {
+            ERR("%s: failed with %d executing command buffer (%s)",  __func__,
+                queue_work_err, strerror(errno));
+            return 0;
+        }
+
+        *fd_out = createSyncExport.fence_fd;
+
+        DPRINT("virtio-gpu: got native fence fd=%d queue_work_err=%d",
+               *fd_out, queue_work_err);
+
+    }
+
+    return sync_handle;
+#endif
+}
+
+// createGoldfishOpenGLNativeSync() is for creating host-only sync objects
+// that are needed by only this goldfish opengl driver,
+// such as in swapBuffers().
+// The guest will not see any of these, and these sync objects will be
+// destroyed on the host when signaled.
+// A native fence FD is possibly returned.
+static void createGoldfishOpenGLNativeSync(int* fd_out) {
+    createNativeSync(EGL_SYNC_NATIVE_FENCE_ANDROID,
+                     NULL /* empty attrib list */,
+                     0 /* 0 attrib count */,
+                     true /* destroy when signaled. this is host-only
+                             and there will only be one waiter */,
+                     -1 /* we want a new fd */,
+                     fd_out);
+}
+
+struct FrameTracingState {
+    uint32_t frameNumber = 0;
+    bool tracingEnabled = false;
+    void onSwapBuffersSuccesful(ExtendedRCEncoderContext* rcEnc) {
+#ifdef GFXSTREAM
+        // edge trigger
+        if (android::base::isTracingEnabled() && !tracingEnabled) {
+            if (rcEnc->hasHostSideTracing()) {
+                rcEnc->rcSetTracingForPuid(rcEnc, getPuid(), 1, currGuestTimeNs());
+            }
+        }
+        if (!android::base::isTracingEnabled() && tracingEnabled) {
+            if (rcEnc->hasHostSideTracing()) {
+                rcEnc->rcSetTracingForPuid(rcEnc, getPuid(), 0, currGuestTimeNs());
+            }
+        }
+        tracingEnabled = android::base::isTracingEnabled();
+#endif
+        ++frameNumber;
+    }
+};
+
+static FrameTracingState sFrameTracingState;
+
+static void sFlushBufferAndCreateFence(
+    HostConnection* hostCon, ExtendedRCEncoderContext* rcEnc, uint32_t rcSurface, uint32_t frameNumber, int* presentFenceFd) {
+    atrace_int(ATRACE_TAG_GRAPHICS, "gfxstreamFrameNumber", (int32_t)frameNumber);
+
+    if (rcEnc->hasHostSideTracing()) {
+        rcEnc->rcFlushWindowColorBufferAsyncWithFrameNumber(rcEnc, rcSurface, frameNumber);
+    } else {
+        rcEnc->rcFlushWindowColorBufferAsync(rcEnc, rcSurface);
+    }
+
+    if (rcEnc->hasVirtioGpuNativeSync()) {
+        createNativeSync_virtioGpu(EGL_SYNC_NATIVE_FENCE_ANDROID,
+                     NULL /* empty attrib list */,
+                     0 /* 0 attrib count */,
+                     true /* destroy when signaled. this is host-only
+                             and there will only be one waiter */,
+                     -1 /* we want a new fd */,
+                     presentFenceFd);
+    } else if (rcEnc->hasNativeSync()) {
+        createGoldfishOpenGLNativeSync(presentFenceFd);
+    } else {
+        // equivalent to glFinish if no native sync
+        eglWaitClient();
+    }
+}
+
+EGLBoolean egl_window_surface_t::swapBuffers()
+{
+
+    DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_FALSE);
+
+    // Follow up flushWindowColorBuffer with a fence command.
+    // When the fence command finishes,
+    // we're sure that the buffer on the host
+    // has been blitted.
+    //
+    // |presentFenceFd| guards the presentation of the
+    // current frame with a goldfish sync fence fd.
+    //
+    // When |presentFenceFd| is signaled, the recipient
+    // of the buffer that was sent through queueBuffer
+    // can be sure that the buffer is current.
+    //
+    // If we don't take care of this synchronization,
+    // an old frame can be processed by surfaceflinger,
+    // resulting in out of order frames.
+
+    int presentFenceFd = -1;
+
+    if (buffer == NULL) {
+        ALOGE("egl_window_surface_t::swapBuffers called with NULL buffer");
+        setErrorReturn(EGL_BAD_SURFACE, EGL_FALSE);
+    }
+
+    sFlushBufferAndCreateFence(
+        hostCon, rcEnc, rcSurface,
+        sFrameTracingState.frameNumber, &presentFenceFd);
+
+    DPRINT("queueBuffer with fence %d", presentFenceFd);
+    nativeWindow->queueBuffer(nativeWindow, buffer, presentFenceFd);
+
+    appTimeMetric.onQueueBufferReturn();
+
+    DPRINT("calling dequeueBuffer...");
+
+    int acquireFenceFd = -1;
+    if (nativeWindow->dequeueBuffer(nativeWindow, &buffer, &acquireFenceFd)) {
+        buffer = NULL;
+        setErrorReturn(EGL_BAD_SURFACE, EGL_FALSE);
+    }
+
+    DPRINT("dequeueBuffer with fence %d", acquireFenceFd);
+
+    if (acquireFenceFd > 0) {
+        close(acquireFenceFd);
+    }
+
+    rcEnc->rcSetWindowColorBuffer(rcEnc, rcSurface,
+            grallocHelper->getHostHandle(buffer->handle));
+
+    setWidth(buffer->width);
+    setHeight(buffer->height);
+
+    sFrameTracingState.onSwapBuffersSuccesful(rcEnc);
+    appTimeMetric.onSwapBuffersReturn();
+
+    return EGL_TRUE;
+}
+
+// ----------------------------------------------------------------------------
+//egl_pbuffer_surface_t
+
+struct egl_pbuffer_surface_t : public egl_surface_t {
+    static egl_pbuffer_surface_t* create(EGLDisplay dpy, EGLConfig config,
+            EGLint surfType, int32_t w, int32_t h, GLenum pixelFormat);
+
+    virtual ~egl_pbuffer_surface_t();
+
+    virtual void       setSwapInterval(int interval) { (void)interval; }
+    virtual EGLBoolean swapBuffers() { return EGL_TRUE; }
+
+    uint32_t getRcColorBuffer() { return rcColorBuffer; }
+
+private:
+    egl_pbuffer_surface_t(EGLDisplay dpy, EGLConfig config, EGLint surfType,
+            int32_t w, int32_t h);
+    EGLBoolean init(GLenum format);
+
+    uint32_t rcColorBuffer;
+    QEMU_PIPE_HANDLE refcountPipeFd;
+};
+
+egl_pbuffer_surface_t::egl_pbuffer_surface_t(EGLDisplay dpy, EGLConfig config,
+        EGLint surfType, int32_t w, int32_t h)
+:   egl_surface_t(dpy, config, surfType),
+    rcColorBuffer(0), refcountPipeFd(QEMU_PIPE_INVALID_HANDLE)
+{
+    setWidth(w);
+    setHeight(h);
+}
+
+egl_pbuffer_surface_t::~egl_pbuffer_surface_t()
+{
+    DEFINE_HOST_CONNECTION;
+    if (rcEnc) {
+        if (rcColorBuffer){
+            if(qemu_pipe_valid(refcountPipeFd)) {
+                qemu_pipe_close(refcountPipeFd);
+            } else {
+                rcEnc->rcCloseColorBuffer(rcEnc, rcColorBuffer);
+            }
+        }
+        if (rcSurface)     rcEnc->rcDestroyWindowSurface(rcEnc, rcSurface);
+    }
+}
+
+// Destroy a pending surface and set it to NULL.
+
+static void s_destroyPendingSurfaceAndSetNull(EGLSurface* surface) {
+    if (!surface)
+        return;
+
+    if (!s_display.isSurface(*surface)) {
+        *surface = NULL;
+        return;
+    }
+
+    egl_surface_t* surf = static_cast<egl_surface_t *>(*surface);
+    if (surf && surf->deletePending) {
+        delete surf;
+        *surface = NULL;
+    }
+}
+
+static void s_destroyPendingSurfacesInContext(EGLContext_t* context) {
+    if (context->read == context->draw) {
+        // If they are the same, delete it only once
+        s_destroyPendingSurfaceAndSetNull(&context->draw);
+        if (context->draw == NULL) {
+            context->read = NULL;
+        }
+    } else {
+        s_destroyPendingSurfaceAndSetNull(&context->draw);
+        s_destroyPendingSurfaceAndSetNull(&context->read);
+    }
+}
+
+EGLBoolean egl_pbuffer_surface_t::init(GLenum pixelFormat)
+{
+    DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_FALSE);
+
+    rcSurface = rcEnc->rcCreateWindowSurface(rcEnc, (uintptr_t)s_display.getIndexOfConfig(config),
+            getWidth(), getHeight());
+    if (!rcSurface) {
+        ALOGE("rcCreateWindowSurface returned 0");
+        return EGL_FALSE;
+    }
+
+    rcColorBuffer = grallocHelper->createColorBuffer(rcEnc, getWidth(), getHeight(), pixelFormat);
+    if (!rcColorBuffer) {
+        ALOGE("rcCreateColorBuffer returned 0");
+        return EGL_FALSE;
+    } else {
+        refcountPipeFd = qemu_pipe_open("refcount");
+        //Send color buffer handle in case RefCountPipe feature is turned on.
+        if (qemu_pipe_valid(refcountPipeFd)) {
+            qemu_pipe_write(refcountPipeFd, &rcColorBuffer, 4);
+        }
+    }
+
+    rcEnc->rcSetWindowColorBuffer(rcEnc, rcSurface, rcColorBuffer);
+
+    return EGL_TRUE;
+}
+
+egl_pbuffer_surface_t* egl_pbuffer_surface_t::create(EGLDisplay dpy,
+        EGLConfig config, EGLint surfType, int32_t w, int32_t h,
+        GLenum pixelFormat)
+{
+    egl_pbuffer_surface_t* pb = new egl_pbuffer_surface_t(dpy, config, surfType,
+            w, h);
+    if (pb && !pb->init(pixelFormat)) {
+        delete pb;
+        pb = NULL;
+    }
+    return pb;
+}
+
+// Required for Skia.
+static const char kOESEGLImageExternalEssl3[] = "GL_OES_EGL_image_external_essl3";
+
+static bool sWantES30OrAbove(const char* exts) {
+    if (strstr(exts, kGLESMaxVersion_3_0) ||
+        strstr(exts, kGLESMaxVersion_3_1) ||
+        strstr(exts, kGLESMaxVersion_3_2)) {
+        return true;
+    }
+    return false;
+}
+
+static std::vector<std::string> getExtStringArray() {
+    std::vector<std::string> res;
+
+    EGLThreadInfo *tInfo = getEGLThreadInfo();
+    if (!tInfo || !tInfo->currentContext) {
+        return res;
+    }
+
+    if (tInfo->currentContext->extensionStringArray.size() > 0) {
+        return tInfo->currentContext->extensionStringArray;
+    }
+
+#define GL_EXTENSIONS                     0x1F03
+
+    DEFINE_AND_VALIDATE_HOST_CONNECTION(res);
+
+    char *hostStr = NULL;
+    int n = rcEnc->rcGetGLString(rcEnc, GL_EXTENSIONS, NULL, 0);
+    if (n < 0) {
+        hostStr = new char[-n+1];
+        n = rcEnc->rcGetGLString(rcEnc, GL_EXTENSIONS, hostStr, -n);
+        if (n <= 0) {
+            delete [] hostStr;
+            hostStr = NULL;
+        }
+    }
+
+    // push guest strings
+    res.push_back("GL_EXT_robustness");
+
+    if (!hostStr || !strlen(hostStr)) { return res; }
+
+    // find the number of extensions
+    int extStart = 0;
+    int extEnd = 0;
+
+    if (sWantES30OrAbove(hostStr) &&
+        !strstr(hostStr, kOESEGLImageExternalEssl3)) {
+        res.push_back(kOESEGLImageExternalEssl3);
+    }
+
+    const int hostStrLen = strlen(hostStr);
+    while (extEnd < hostStrLen) {
+        if (hostStr[extEnd] == ' ') {
+            int extSz = extEnd - extStart;
+            res.push_back(std::string(hostStr + extStart, extSz));
+            extStart = extEnd + 1;
+        }
+        extEnd++;
+    }
+
+    tInfo->currentContext->extensionStringArray = res;
+
+    delete [] hostStr;
+    return res;
+}
+
+static const char *getGLString(int glEnum)
+{
+    EGLThreadInfo *tInfo = getEGLThreadInfo();
+    if (!tInfo || !tInfo->currentContext) {
+        return NULL;
+    }
+
+    const char** strPtr = NULL;
+
+#define GL_VENDOR                         0x1F00
+#define GL_RENDERER                       0x1F01
+#define GL_VERSION                        0x1F02
+#define GL_SHADING_LANGUAGE_VERSION       0x8B8C
+#define GL_EXTENSIONS                     0x1F03
+
+    switch(glEnum) {
+        case GL_VERSION:
+            strPtr = &tInfo->currentContext->versionString;
+            break;
+        case GL_VENDOR:
+            strPtr = &tInfo->currentContext->vendorString;
+            break;
+        case GL_RENDERER:
+            strPtr = &tInfo->currentContext->rendererString;
+            break;
+        case GL_SHADING_LANGUAGE_VERSION:
+            strPtr = &tInfo->currentContext->shaderVersionString;
+            break;
+        case GL_EXTENSIONS:
+            strPtr = &tInfo->currentContext->extensionString;
+            break;
+    }
+
+    if (!strPtr) {
+        return NULL;
+    }
+
+    if (*strPtr) {
+        return *strPtr;
+    }
+
+    char* hostStr = NULL;
+
+    if (glEnum == GL_EXTENSIONS) {
+
+        std::vector<std::string> exts = getExtStringArray();
+
+        int totalSz = 1; // null terminator
+        for (unsigned int i = 0; i < exts.size(); i++) {
+            totalSz += exts[i].size() + 1; // for space
+        }
+
+        if (totalSz == 1) return NULL;
+
+        hostStr = new char[totalSz];
+        memset(hostStr, 0, totalSz);
+
+        char* current = hostStr;
+        for (unsigned int i = 0; i < exts.size(); i++) {
+            memcpy(current, exts[i].c_str(), exts[i].size());
+            current += exts[i].size();
+            *current = ' ';
+            ++current;
+        }
+    } else {
+        //
+        // first query of that string - need to query host
+        //
+        DEFINE_AND_VALIDATE_HOST_CONNECTION(NULL);
+        int n = rcEnc->rcGetGLString(rcEnc, glEnum, NULL, 0);
+        if (n < 0) {
+            hostStr = new char[-n+1];
+            n = rcEnc->rcGetGLString(rcEnc, glEnum, hostStr, -n);
+            if (n <= 0) {
+                delete [] hostStr;
+                hostStr = NULL;
+            }
+        }
+    }
+
+    //
+    // keep the string in the context and return its value
+    //
+    *strPtr = hostStr;
+    return hostStr;
+}
+
+// ----------------------------------------------------------------------------
+
+// Note: C99 syntax was tried here but does not work for all compilers.
+static EGLClient_eglInterface s_eglIface = {
+    getThreadInfo: getEGLThreadInfo,
+    getGLString: getGLString,
+};
+
+#define DBG_FUNC DBG("%s\n", __FUNCTION__)
+EGLDisplay eglGetDisplay(EGLNativeDisplayType display_id)
+{
+    //
+    // we support only EGL_DEFAULT_DISPLAY.
+    //
+    if (display_id != EGL_DEFAULT_DISPLAY) {
+        return EGL_NO_DISPLAY;
+    }
+
+    return (EGLDisplay)&s_display;
+}
+
+EGLBoolean eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
+{
+    VALIDATE_DISPLAY(dpy,EGL_FALSE);
+
+    if (!s_display.initialize(&s_eglIface)) {
+        return EGL_FALSE;
+    }
+    if (major!=NULL)
+        *major = s_display.getVersionMajor();
+    if (minor!=NULL)
+        *minor = s_display.getVersionMinor();
+    try_register_goldfish_perfetto();
+    return EGL_TRUE;
+}
+
+EGLBoolean eglTerminate(EGLDisplay dpy)
+{
+    VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
+
+    s_display.terminate();
+    DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_FALSE);
+    rcEnc->rcGetRendererVersion(rcEnc);
+    return EGL_TRUE;
+}
+
+EGLint eglGetError()
+{
+    EGLint error = getEGLThreadInfo()->eglError;
+    getEGLThreadInfo()->eglError = EGL_SUCCESS;
+    return error;
+}
+
+__eglMustCastToProperFunctionPointerType eglGetProcAddress(const char *procname)
+{
+    // search in EGL function table
+    for (int i=0; i<egl_num_funcs; i++) {
+        if (!strcmp(egl_funcs_by_name[i].name, procname)) {
+            return (__eglMustCastToProperFunctionPointerType)egl_funcs_by_name[i].proc;
+        }
+    }
+
+    // look in gles client api's extensions table
+    return (__eglMustCastToProperFunctionPointerType)ClientAPIExts::getProcAddress(procname);
+
+    // Fail - function not found.
+    return NULL;
+}
+
+const char* eglQueryString(EGLDisplay dpy, EGLint name)
+{
+    // EGL_BAD_DISPLAY is generated if display is not an EGL display connection, unless display is
+    // EGL_NO_DISPLAY and name is EGL_EXTENSIONS.
+    if (dpy || name != EGL_EXTENSIONS) {
+        VALIDATE_DISPLAY_INIT(dpy, NULL);
+    }
+
+    return s_display.queryString(name);
+}
+
+EGLBoolean eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config)
+{
+    VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
+
+    if(!num_config) {
+        RETURN_ERROR(EGL_FALSE,EGL_BAD_PARAMETER);
+    }
+
+    GLint numConfigs = s_display.getNumConfigs();
+    if (!configs) {
+        *num_config = numConfigs;
+        return EGL_TRUE;
+    }
+
+    EGLint i;
+    for (i = 0 ; i < numConfigs && i < config_size ; i++) {
+        *configs++ = (EGLConfig)(uintptr_t)s_display.getConfigAtIndex(i);
+    }
+    *num_config = i;
+    return EGL_TRUE;
+}
+
+EGLBoolean eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config)
+{
+    VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
+
+    if (!num_config) {
+        setErrorReturn(EGL_BAD_PARAMETER, EGL_FALSE);
+    }
+
+    int attribs_size = 0;
+    EGLint backup_attribs[1];
+    if (attrib_list) {
+        const EGLint * attrib_p = attrib_list;
+        while (attrib_p[0] != EGL_NONE) {
+            attribs_size += 2;
+            attrib_p += 2;
+        }
+        attribs_size++; //for the terminating EGL_NONE
+    } else {
+        attribs_size = 1;
+        backup_attribs[0] = EGL_NONE;
+        attrib_list = backup_attribs;
+    }
+
+    uint32_t* tempConfigs[config_size];
+    DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_FALSE);
+    *num_config = rcEnc->rcChooseConfig(rcEnc, (EGLint*)attrib_list,
+            attribs_size * sizeof(EGLint), (uint32_t*)tempConfigs, config_size);
+
+    if (*num_config < 0) {
+        EGLint err = -(*num_config);
+        *num_config = 0;
+        switch (err) {
+            case EGL_BAD_ATTRIBUTE:
+                setErrorReturn(EGL_BAD_ATTRIBUTE, EGL_FALSE);
+            default:
+                return EGL_FALSE;
+        }
+    }
+
+    if (configs!=NULL) {
+        EGLint i=0;
+        for (i=0;i<(*num_config);i++) {
+            EGLConfig guestConfig = s_display.getConfigAtIndex(*((uint32_t*)tempConfigs+i));
+            configs[i] = guestConfig;
+        }
+    }
+
+    return EGL_TRUE;
+}
+
+EGLBoolean eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value)
+{
+    VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
+    VALIDATE_CONFIG(config, EGL_FALSE);
+
+    if (s_display.getConfigAttrib(config, attribute, value))
+    {
+        return EGL_TRUE;
+    }
+    else
+    {
+        DPRINT("%s: bad attrib 0x%x", __FUNCTION__, attribute);
+        RETURN_ERROR(EGL_FALSE, EGL_BAD_ATTRIBUTE);
+    }
+}
+
+EGLSurface eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list)
+{
+    (void)attrib_list;
+
+    VALIDATE_DISPLAY_INIT(dpy, NULL);
+    VALIDATE_CONFIG(config, EGL_FALSE);
+    if (win == 0) {
+        setErrorReturn(EGL_BAD_MATCH, EGL_NO_SURFACE);
+    }
+
+    EGLint surfaceType;
+    if (s_display.getConfigAttrib(config, EGL_SURFACE_TYPE, &surfaceType) == EGL_FALSE)    return EGL_FALSE;
+
+    if (!(surfaceType & EGL_WINDOW_BIT)) {
+        setErrorReturn(EGL_BAD_MATCH, EGL_NO_SURFACE);
+    }
+
+    if (reinterpret_cast<ANativeWindow*>(win)->common.magic != ANDROID_NATIVE_WINDOW_MAGIC) {
+        setErrorReturn(EGL_BAD_NATIVE_WINDOW, EGL_NO_SURFACE);
+    }
+
+    egl_surface_t* surface = egl_window_surface_t::create(
+            &s_display, config, EGL_WINDOW_BIT, reinterpret_cast<ANativeWindow*>(win));
+    if (!surface) {
+        setErrorReturn(EGL_BAD_ALLOC, EGL_NO_SURFACE);
+    }
+
+    return surface;
+}
+
+EGLSurface eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list)
+{
+    VALIDATE_DISPLAY_INIT(dpy, NULL);
+    VALIDATE_CONFIG(config, EGL_FALSE);
+
+    EGLint surfaceType;
+    if (s_display.getConfigAttrib(config, EGL_SURFACE_TYPE, &surfaceType) == EGL_FALSE)    return EGL_FALSE;
+
+    if (!(surfaceType & EGL_PBUFFER_BIT)) {
+        setErrorReturn(EGL_BAD_MATCH, EGL_NO_SURFACE);
+    }
+
+    int32_t w = 0;
+    int32_t h = 0;
+    EGLint texFormat = EGL_NO_TEXTURE;
+    EGLint texTarget = EGL_NO_TEXTURE;
+    while (attrib_list[0] != EGL_NONE) {
+        switch (attrib_list[0]) {
+            case EGL_WIDTH:
+                w = attrib_list[1];
+                if (w < 0) setErrorReturn(EGL_BAD_PARAMETER, EGL_NO_SURFACE);
+                break;
+            case EGL_HEIGHT:
+                h = attrib_list[1];
+                if (h < 0) setErrorReturn(EGL_BAD_PARAMETER, EGL_NO_SURFACE);
+                break;
+            case EGL_TEXTURE_FORMAT:
+                texFormat = attrib_list[1];
+                break;
+            case EGL_TEXTURE_TARGET:
+                texTarget = attrib_list[1];
+                break;
+            // the followings are not supported
+            case EGL_LARGEST_PBUFFER:
+            case EGL_MIPMAP_TEXTURE:
+            case EGL_VG_ALPHA_FORMAT:
+            case EGL_VG_COLORSPACE:
+                break;
+            default:
+                ALOGE("%s:%d unknown attribute: 0x%x\n", __func__, __LINE__, attrib_list[0]);
+                setErrorReturn(EGL_BAD_ATTRIBUTE, EGL_NO_SURFACE);
+        };
+        attrib_list+=2;
+    }
+    if (((texFormat == EGL_NO_TEXTURE)&&(texTarget != EGL_NO_TEXTURE)) ||
+        ((texFormat != EGL_NO_TEXTURE)&&(texTarget == EGL_NO_TEXTURE))) {
+        setErrorReturn(EGL_BAD_MATCH, EGL_NO_SURFACE);
+    }
+    // TODO: check EGL_TEXTURE_FORMAT - need to support eglBindTexImage
+
+    GLenum pixelFormat;
+    if (s_display.getConfigGLPixelFormat(config, &pixelFormat) == EGL_FALSE)
+        setErrorReturn(EGL_BAD_MATCH, EGL_NO_SURFACE);
+
+    egl_surface_t* surface = egl_pbuffer_surface_t::create(dpy, config,
+            EGL_PBUFFER_BIT, w, h, pixelFormat);
+    if (!surface) {
+        setErrorReturn(EGL_BAD_ALLOC, EGL_NO_SURFACE);
+    }
+
+    //setup attributes
+    surface->setTextureFormat(texFormat);
+    surface->setTextureTarget(texTarget);
+
+    return surface;
+}
+
+EGLSurface eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list)
+{
+    //XXX: Pixmap not supported. The host cannot render to a pixmap resource
+    //     located on host. In order to support Pixmaps we should either punt
+    //     to s/w rendering -or- let the host render to a buffer that will be
+    //     copied back to guest at some sync point. None of those methods not
+    //     implemented and pixmaps are not used with OpenGL anyway ...
+    VALIDATE_CONFIG(config, EGL_FALSE);
+    (void)dpy;
+    (void)pixmap;
+    (void)attrib_list;
+    return EGL_NO_SURFACE;
+}
+
+EGLBoolean eglDestroySurface(EGLDisplay dpy, EGLSurface eglSurface)
+{
+    VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
+    VALIDATE_SURFACE_RETURN(eglSurface, EGL_FALSE);
+
+    egl_surface_t* surface(static_cast<egl_surface_t*>(eglSurface));
+    if (surface->isCurrent()) {
+        surface->deletePending = 1;
+    } else {
+        delete surface;
+    }
+
+    return EGL_TRUE;
+}
+
+static float s_getNativeDpi() {
+    float nativeDPI = 560.0f;
+    const char* dpiPropName = "qemu.sf.lcd_density";
+    char dpiProp[PROPERTY_VALUE_MAX];
+    if (property_get(dpiPropName, dpiProp, NULL) > 0) {
+        nativeDPI = atof(dpiProp);
+    }
+    return nativeDPI;
+}
+
+EGLBoolean eglQuerySurface(EGLDisplay dpy, EGLSurface eglSurface, EGLint attribute, EGLint *value)
+{
+    VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
+    VALIDATE_SURFACE_RETURN(eglSurface, EGL_FALSE);
+
+    egl_surface_t* surface( static_cast<egl_surface_t*>(eglSurface) );
+
+    // Parameters involved in queries of EGL_(HORIZONTAL|VERTICAL)_RESOLUTION
+    float currWidth, currHeight, scaledResolution, effectiveSurfaceDPI;
+    EGLBoolean ret = EGL_TRUE;
+    switch (attribute) {
+        case EGL_CONFIG_ID:
+            ret = s_display.getConfigAttrib(surface->config, EGL_CONFIG_ID, value);
+            break;
+        case EGL_WIDTH:
+            *value = surface->getWidth();
+            break;
+        case EGL_HEIGHT:
+            *value = surface->getHeight();
+            break;
+        case EGL_TEXTURE_FORMAT:
+            if (surface->getSurfaceType() & EGL_PBUFFER_BIT) {
+                *value = surface->getTextureFormat();
+            }
+            break;
+        case EGL_TEXTURE_TARGET:
+            if (surface->getSurfaceType() & EGL_PBUFFER_BIT) {
+                *value = surface->getTextureTarget();
+            }
+            break;
+        case EGL_SWAP_BEHAVIOR:
+        {
+            EGLint surfaceType;
+            ret = s_display.getConfigAttrib(surface->config, EGL_SURFACE_TYPE,
+                    &surfaceType);
+            if (ret == EGL_TRUE) {
+                if (surfaceType & EGL_SWAP_BEHAVIOR_PRESERVED_BIT) {
+                    *value = EGL_BUFFER_PRESERVED;
+                } else {
+                    *value = EGL_BUFFER_DESTROYED;
+                }
+            }
+            break;
+        }
+        case EGL_LARGEST_PBUFFER:
+            // not modified for a window or pixmap surface
+            // and we ignore it when creating a PBuffer surface (default is EGL_FALSE)
+            if (surface->getSurfaceType() & EGL_PBUFFER_BIT) *value = EGL_FALSE;
+            break;
+        case EGL_MIPMAP_TEXTURE:
+            // not modified for a window or pixmap surface
+            // and we ignore it when creating a PBuffer surface (default is 0)
+            if (surface->getSurfaceType() & EGL_PBUFFER_BIT) *value = false;
+            break;
+        case EGL_MIPMAP_LEVEL:
+            // not modified for a window or pixmap surface
+            // and we ignore it when creating a PBuffer surface (default is 0)
+            if (surface->getSurfaceType() & EGL_PBUFFER_BIT) *value = 0;
+            break;
+        case EGL_MULTISAMPLE_RESOLVE:
+            // ignored when creating the surface, return default
+            *value = EGL_MULTISAMPLE_RESOLVE_DEFAULT;
+            break;
+        case EGL_HORIZONTAL_RESOLUTION:
+            // pixel/mm * EGL_DISPLAY_SCALING
+            // TODO: get the DPI from avd config
+            currWidth = surface->getWidth();
+            scaledResolution = currWidth / surface->getNativeWidth();
+            effectiveSurfaceDPI =
+                scaledResolution * s_getNativeDpi() * EGL_DISPLAY_SCALING;
+            *value = (EGLint)(effectiveSurfaceDPI);
+            break;
+        case EGL_VERTICAL_RESOLUTION:
+            // pixel/mm * EGL_DISPLAY_SCALING
+            // TODO: get the real DPI from avd config
+            currHeight = surface->getHeight();
+            scaledResolution = currHeight / surface->getNativeHeight();
+            effectiveSurfaceDPI =
+                scaledResolution * s_getNativeDpi() * EGL_DISPLAY_SCALING;
+            *value = (EGLint)(effectiveSurfaceDPI);
+            break;
+        case EGL_PIXEL_ASPECT_RATIO:
+            // w / h * EGL_DISPLAY_SCALING
+            // Please don't ask why * EGL_DISPLAY_SCALING, the document says it
+            *value = 1 * EGL_DISPLAY_SCALING;
+            break;
+        case EGL_RENDER_BUFFER:
+            switch (surface->getSurfaceType()) {
+                case EGL_PBUFFER_BIT:
+                    *value = EGL_BACK_BUFFER;
+                    break;
+                case EGL_PIXMAP_BIT:
+                    *value = EGL_SINGLE_BUFFER;
+                    break;
+                case EGL_WINDOW_BIT:
+                    // ignored when creating the surface, return default
+                    *value = EGL_BACK_BUFFER;
+                    break;
+                default:
+                    ALOGE("eglQuerySurface %x unknown surface type %x",
+                            attribute, surface->getSurfaceType());
+                    ret = setErrorFunc(EGL_BAD_ATTRIBUTE, EGL_FALSE);
+                    break;
+            }
+            break;
+        case EGL_VG_COLORSPACE:
+            // ignored when creating the surface, return default
+            *value = EGL_VG_COLORSPACE_sRGB;
+            break;
+        case EGL_VG_ALPHA_FORMAT:
+            // ignored when creating the surface, return default
+            *value = EGL_VG_ALPHA_FORMAT_NONPRE;
+            break;
+        case EGL_TIMESTAMPS_ANDROID:
+            *value = surface->isCollectingTimestamps();
+            break;
+        //TODO: complete other attributes
+        default:
+            ALOGE("eglQuerySurface %x  EGL_BAD_ATTRIBUTE", attribute);
+            ret = setErrorFunc(EGL_BAD_ATTRIBUTE, EGL_FALSE);
+            break;
+    }
+
+    return ret;
+}
+
+EGLBoolean eglBindAPI(EGLenum api)
+{
+    if (api != EGL_OPENGL_ES_API)
+        setErrorReturn(EGL_BAD_PARAMETER, EGL_FALSE);
+    return EGL_TRUE;
+}
+
+EGLenum eglQueryAPI()
+{
+    return EGL_OPENGL_ES_API;
+}
+
+EGLBoolean eglWaitClient()
+{
+    return eglWaitGL();
+}
+
+// We may need to trigger this directly from the TLS destructor.
+static EGLBoolean s_eglReleaseThreadImpl(EGLThreadInfo* tInfo) {
+    if (!tInfo) return EGL_TRUE;
+
+    tInfo->eglError = EGL_SUCCESS;
+    EGLContext_t* context = tInfo->currentContext;
+
+    if (!context || !s_display.isContext(context)) {
+        HostConnection::exit();
+        return EGL_TRUE;
+    }
+
+    // The following code is doing pretty much the same thing as
+    // eglMakeCurrent(&s_display, EGL_NO_CONTEXT, EGL_NO_SURFACE, EGL_NO_SURFACE)
+    // with the only issue that we do not require a valid display here.
+    DEFINE_AND_VALIDATE_HOST_CONNECTION_FOR_TLS(EGL_FALSE, tInfo);
+    // We are going to call makeCurrent on the null context and surface
+    // anyway once we are on the host, so skip rcMakeCurrent here.
+    // rcEnc->rcMakeCurrent(rcEnc, 0, 0, 0);
+    context->flags &= ~EGLContext_t::IS_CURRENT;
+
+    s_destroyPendingSurfacesInContext(context);
+
+    if (context->deletePending) {
+        if (context->rcContext) {
+            rcEnc->rcDestroyContext(rcEnc, context->rcContext);
+            context->rcContext = 0;
+        }
+        delete context;
+    }
+    tInfo->currentContext = 0;
+
+    HostConnection::exit();
+
+    return EGL_TRUE;
+}
+
+EGLBoolean eglReleaseThread()
+{
+    return s_eglReleaseThreadImpl(getEGLThreadInfo());
+}
+
+EGLSurface eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list)
+{
+    //TODO
+    (void)dpy;
+    (void)buftype;
+    (void)buffer;
+    (void)config;
+    (void)attrib_list;
+    ALOGW("%s not implemented", __FUNCTION__);
+    return 0;
+}
+
+EGLBoolean eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value)
+{
+    // Right now we don't do anything when using host GPU.
+    // This is purely just to pass the data through
+    // without issuing a warning. We may benefit from validating the
+    // display and surface for debug purposes.
+    // TODO: Find cases where we actually need to do something.
+    VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
+    VALIDATE_SURFACE_RETURN(surface, EGL_FALSE);
+    if (surface == EGL_NO_SURFACE) {
+        setErrorReturn(EGL_BAD_SURFACE, EGL_FALSE);
+    }
+
+    (void)value;
+
+    egl_surface_t* p_surface( static_cast<egl_surface_t*>(surface) );
+    switch (attribute) {
+    case EGL_MIPMAP_LEVEL:
+        return true;
+    case EGL_MULTISAMPLE_RESOLVE:
+    {
+        if (value == EGL_MULTISAMPLE_RESOLVE_BOX) {
+            EGLint surface_type;
+            s_display.getConfigAttrib(p_surface->config, EGL_SURFACE_TYPE, &surface_type);
+            if (0 == (surface_type & EGL_MULTISAMPLE_RESOLVE_BOX_BIT)) {
+                setErrorReturn(EGL_BAD_MATCH, EGL_FALSE);
+            }
+        }
+        return true;
+    }
+    case EGL_SWAP_BEHAVIOR:
+        if (value == EGL_BUFFER_PRESERVED) {
+            EGLint surface_type;
+            s_display.getConfigAttrib(p_surface->config, EGL_SURFACE_TYPE, &surface_type);
+            if (0 == (surface_type & EGL_SWAP_BEHAVIOR_PRESERVED_BIT)) {
+                setErrorReturn(EGL_BAD_MATCH, EGL_FALSE);
+            }
+        }
+        return true;
+    case EGL_TIMESTAMPS_ANDROID:
+        DPRINT("%s: set frame timestamps collecting %d\n", __func__, value);
+        p_surface->setCollectingTimestamps(value);
+        return true;
+    default:
+        ALOGW("%s: attr=0x%x not implemented", __FUNCTION__, attribute);
+        setErrorReturn(EGL_BAD_ATTRIBUTE, EGL_FALSE);
+    }
+    return false;
+}
+
+EGLBoolean eglBindTexImage(EGLDisplay dpy, EGLSurface eglSurface, EGLint buffer)
+{
+    VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
+    VALIDATE_SURFACE_RETURN(eglSurface, EGL_FALSE);
+    if (eglSurface == EGL_NO_SURFACE) {
+        setErrorReturn(EGL_BAD_SURFACE, EGL_FALSE);
+    }
+
+    if (buffer != EGL_BACK_BUFFER) {
+        setErrorReturn(EGL_BAD_PARAMETER, EGL_FALSE);
+    }
+
+    egl_surface_t* surface( static_cast<egl_surface_t*>(eglSurface) );
+
+    if (surface->getTextureFormat() == EGL_NO_TEXTURE) {
+        setErrorReturn(EGL_BAD_MATCH, EGL_FALSE);
+    }
+
+    if (!(surface->getSurfaceType() & EGL_PBUFFER_BIT)) {
+        setErrorReturn(EGL_BAD_SURFACE, EGL_FALSE);
+    }
+
+    //It's now safe to cast to pbuffer surface
+    egl_pbuffer_surface_t* pbSurface = (egl_pbuffer_surface_t*)surface;
+
+    DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_FALSE);
+    rcEnc->rcBindTexture(rcEnc, pbSurface->getRcColorBuffer());
+
+    return GL_TRUE;
+}
+
+EGLBoolean eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer)
+{
+    //TODO
+    (void)dpy;
+    (void)surface;
+    (void)buffer;
+    ALOGW("%s not implemented", __FUNCTION__);
+    return 0;
+}
+
+EGLBoolean eglSwapInterval(EGLDisplay dpy, EGLint interval)
+{
+    VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
+    DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_FALSE);
+
+    EGLContext_t* ctx = getEGLThreadInfo()->currentContext;
+    if (!ctx) {
+        setErrorReturn(EGL_BAD_CONTEXT, EGL_FALSE);
+    }
+    if (!ctx->draw) {
+        setErrorReturn(EGL_BAD_SURFACE, EGL_FALSE);
+    }
+    egl_surface_t* draw(static_cast<egl_surface_t*>(ctx->draw));
+    draw->setSwapInterval(interval);
+
+    rcEnc->rcFBSetSwapInterval(rcEnc, interval); //TODO: implement on the host
+
+    return EGL_TRUE;
+}
+
+EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list)
+{
+    VALIDATE_DISPLAY_INIT(dpy, EGL_NO_CONTEXT);
+    VALIDATE_CONFIG(config, EGL_NO_CONTEXT);
+
+    EGLint majorVersion = 1; //default
+    EGLint minorVersion = 0;
+    EGLint context_flags = 0;
+    EGLint profile_mask = 0;
+
+    bool wantedMajorVersion = false;
+    bool wantedMinorVersion = false;
+
+    while (attrib_list && attrib_list[0] != EGL_NONE) {
+           EGLint attrib_val = attrib_list[1];
+        switch(attrib_list[0]) {
+        case EGL_CONTEXT_MAJOR_VERSION_KHR:
+            majorVersion = attrib_val;
+            wantedMajorVersion = true;
+            break;
+        case EGL_CONTEXT_MINOR_VERSION_KHR:
+            minorVersion = attrib_val;
+            wantedMinorVersion = true;
+            break;
+        case EGL_CONTEXT_FLAGS_KHR:
+            if ((attrib_val & EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR) ||
+                (attrib_val & EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR)  ||
+                (attrib_val & EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR)) {
+                context_flags = attrib_val;
+            } else {
+                RETURN_ERROR(EGL_NO_CONTEXT,EGL_BAD_ATTRIBUTE);
+            }
+            break;
+        case EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR:
+            if ((attrib_val | EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR) ||
+                (attrib_val | EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR)) {
+                profile_mask = attrib_val;
+            } else {
+                RETURN_ERROR(EGL_NO_CONTEXT,EGL_BAD_ATTRIBUTE);
+            }
+            break;
+        case EGL_CONTEXT_PRIORITY_LEVEL_IMG:
+            // According to the spec, we are allowed not to honor this hint.
+            // https://www.khronos.org/registry/EGL/extensions/IMG/EGL_IMG_context_priority.txt
+            break;
+        default:
+            ALOGV("eglCreateContext unsupported attrib 0x%x", attrib_list[0]);
+            setErrorReturn(EGL_BAD_ATTRIBUTE, EGL_NO_CONTEXT);
+        }
+        attrib_list+=2;
+    }
+
+    // Support up to GLES 3.2 depending on advertised version from the host system.
+    DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_NO_CONTEXT);
+    if (rcEnc->getGLESMaxVersion() >= GLES_MAX_VERSION_3_0) {
+        if (!wantedMajorVersion) {
+            majorVersion = 1;
+            wantedMinorVersion = false;
+        }
+
+        if (wantedMajorVersion &&
+            majorVersion == 2) {
+            majorVersion = 3;
+            wantedMinorVersion = false;
+        }
+
+        if (majorVersion == 3 && !wantedMinorVersion) {
+            switch (rcEnc->getGLESMaxVersion()) {
+                case GLES_MAX_VERSION_3_0:
+                    minorVersion = 0;
+                    break;
+                case GLES_MAX_VERSION_3_1:
+                    minorVersion = 1;
+                    break;
+                case GLES_MAX_VERSION_3_2:
+                    minorVersion = 2;
+                    break;
+                default:
+                    minorVersion = 0;
+                    break;
+            }
+        }
+    } else {
+        if (!wantedMajorVersion) {
+            majorVersion = 1;
+        }
+    }
+
+    switch (majorVersion) {
+    case 1:
+    case 2:
+        break;
+    case 3:
+        if (rcEnc->getGLESMaxVersion() < GLES_MAX_VERSION_3_0) {
+            ALOGE("%s: EGL_BAD_CONFIG: no ES 3 support", __FUNCTION__);
+            setErrorReturn(EGL_BAD_CONFIG, EGL_NO_CONTEXT);
+        }
+        switch (minorVersion) {
+            case 0:
+                break;
+            case 1:
+                if (rcEnc->getGLESMaxVersion() < GLES_MAX_VERSION_3_1) {
+                    ALOGE("%s: EGL_BAD_CONFIG: no ES 3.1 support", __FUNCTION__);
+                    setErrorReturn(EGL_BAD_CONFIG, EGL_NO_CONTEXT);
+                }
+                break;
+            case 2:
+                if (rcEnc->getGLESMaxVersion() < GLES_MAX_VERSION_3_2) {
+                    ALOGE("%s: EGL_BAD_CONFIG: no ES 3.2 support", __FUNCTION__);
+                    setErrorReturn(EGL_BAD_CONFIG, EGL_NO_CONTEXT);
+                }
+                break;
+            default:
+                ALOGE("%s: EGL_BAD_CONFIG: Unknown ES version %d.%d",
+                      __FUNCTION__, majorVersion, minorVersion);
+                setErrorReturn(EGL_BAD_CONFIG, EGL_NO_CONTEXT);
+        }
+        break;
+    default:
+        ALOGE("%s:%d EGL_BAD_CONFIG: invalid major GLES version: %d\n",
+              __func__, __LINE__, majorVersion);
+        setErrorReturn(EGL_BAD_CONFIG, EGL_NO_CONTEXT);
+    }
+
+    uint32_t rcShareCtx = 0;
+    EGLContext_t * shareCtx = NULL;
+    if (share_context) {
+        shareCtx = static_cast<EGLContext_t*>(share_context);
+        rcShareCtx = shareCtx->rcContext;
+        if (shareCtx->dpy != dpy)
+            setErrorReturn(EGL_BAD_MATCH, EGL_NO_CONTEXT);
+    }
+
+    // We've created EGL context. Disconnecting
+    // would be dangerous at this point.
+    hostCon->setGrallocOnly(false);
+
+    int rcMajorVersion = majorVersion;
+    if (majorVersion == 3 && minorVersion == 1) {
+        rcMajorVersion = 4;
+    }
+    if (majorVersion == 3 && minorVersion == 2) {
+        rcMajorVersion = 4;
+    }
+    uint32_t rcContext = rcEnc->rcCreateContext(rcEnc, (uintptr_t)s_display.getIndexOfConfig(config), rcShareCtx, rcMajorVersion);
+    if (!rcContext) {
+        ALOGE("rcCreateContext returned 0");
+        setErrorReturn(EGL_BAD_ALLOC, EGL_NO_CONTEXT);
+    }
+
+    EGLContext_t * context = new EGLContext_t(dpy, config, shareCtx, majorVersion, minorVersion);
+    DPRINT("%s: %p: maj %d min %d rcv %d", __FUNCTION__, context, majorVersion, minorVersion, rcMajorVersion);
+    if (!context) {
+        ALOGE("could not alloc egl context!");
+        setErrorReturn(EGL_BAD_ALLOC, EGL_NO_CONTEXT);
+    }
+
+    context->rcContext = rcContext;
+    return context;
+}
+
+EGLBoolean eglDestroyContext(EGLDisplay dpy, EGLContext ctx)
+{
+    VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
+    VALIDATE_CONTEXT_RETURN(ctx, EGL_FALSE);
+
+    EGLContext_t * context = static_cast<EGLContext_t*>(ctx);
+
+    if (context->flags & EGLContext_t::IS_CURRENT) {
+        context->deletePending = 1;
+        return EGL_TRUE;
+    }
+
+    if (context->rcContext) {
+        DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_FALSE);
+        rcEnc->rcDestroyContext(rcEnc, context->rcContext);
+        context->rcContext = 0;
+    }
+
+    delete context;
+    return EGL_TRUE;
+}
+
+EGLBoolean eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx)
+{
+    VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
+    VALIDATE_SURFACE_RETURN(draw, EGL_FALSE);
+    VALIDATE_SURFACE_RETURN(read, EGL_FALSE);
+
+    // Only place to initialize the TLS destructor; any
+    // thread can suddenly jump in any eglMakeCurrent
+    setTlsDestructor((tlsDtorCallback)s_eglReleaseThreadImpl);
+
+    if ((read == EGL_NO_SURFACE && draw == EGL_NO_SURFACE) && (ctx != EGL_NO_CONTEXT))
+        setErrorReturn(EGL_BAD_MATCH, EGL_FALSE);
+    if ((read != EGL_NO_SURFACE || draw != EGL_NO_SURFACE) && (ctx == EGL_NO_CONTEXT))
+        setErrorReturn(EGL_BAD_MATCH, EGL_FALSE);
+
+    EGLContext_t * context = static_cast<EGLContext_t*>(ctx);
+    uint32_t ctxHandle = (context) ? context->rcContext : 0;
+    egl_surface_t * drawSurf = static_cast<egl_surface_t *>(draw);
+    uint32_t drawHandle = (drawSurf) ? drawSurf->getRcSurface() : 0;
+    egl_surface_t * readSurf = static_cast<egl_surface_t *>(read);
+    uint32_t readHandle = (readSurf) ? readSurf->getRcSurface() : 0;
+
+    //
+    // Nothing to do if no binding change has made
+    //
+    EGLThreadInfo *tInfo = getEGLThreadInfo();
+
+    if (tInfo->currentContext == context &&
+        (context == NULL ||
+        (context && (context->draw == draw) && (context->read == read)))) {
+        return EGL_TRUE;
+    }
+
+    // Destroy surfaces while the previous context is still current.
+    EGLContext_t* prevCtx = tInfo->currentContext;
+    if (tInfo->currentContext) {
+        if (prevCtx->draw) {
+            static_cast<egl_surface_t *>(prevCtx->draw)->setIsCurrent(false);
+        }
+        if (prevCtx->read) {
+            static_cast<egl_surface_t *>(prevCtx->read)->setIsCurrent(false);
+        }
+        s_destroyPendingSurfacesInContext(tInfo->currentContext);
+    }
+
+    if (context && (context->flags & EGLContext_t::IS_CURRENT) && (context != tInfo->currentContext)) {
+        // context is current to another thread
+        ALOGE("%s: error: EGL_BAD_ACCESS: context %p current to another thread!\n", __FUNCTION__, context);
+        setErrorReturn(EGL_BAD_ACCESS, EGL_FALSE);
+    }
+
+    DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_FALSE);
+    if (rcEnc->hasAsyncFrameCommands()) {
+        rcEnc->rcMakeCurrentAsync(rcEnc, ctxHandle, drawHandle, readHandle);
+    } else {
+        rcEnc->rcMakeCurrent(rcEnc, ctxHandle, drawHandle, readHandle);
+    }
+
+    //Now make the local bind
+    if (context) {
+
+        // This is a nontrivial context.
+        // The thread cannot be gralloc-only anymore.
+        hostCon->setGrallocOnly(false);
+        context->draw = draw;
+        context->read = read;
+        if (drawSurf) {
+            drawSurf->setIsCurrent(true);
+        }
+        if (readSurf) {
+            readSurf->setIsCurrent(true);
+        }
+        context->flags |= EGLContext_t::IS_CURRENT;
+        GLClientState* contextState =
+            context->getClientState();
+
+        if (!hostCon->gl2Encoder()->isInitialized()) {
+            DPRINT("%s: %p: ver %d %d (tinfo %p) (first time)",
+                  __FUNCTION__,
+                  context, context->majorVersion, context->minorVersion, tInfo);
+            s_display.gles2_iface()->init();
+            hostCon->gl2Encoder()->setInitialized();
+            ClientAPIExts::initClientFuncs(s_display.gles2_iface(), 1);
+        }
+        if (contextState->needsInitFromCaps()) {
+            // Need to set the version first if
+            // querying caps, or validation will trip incorrectly.
+            hostCon->gl2Encoder()->setVersion(
+                context->majorVersion,
+                context->minorVersion,
+                context->deviceMajorVersion,
+                context->deviceMinorVersion);
+            hostCon->gl2Encoder()->setClientState(contextState);
+            if (context->majorVersion > 1) {
+                HostDriverCaps caps = s_display.getHostDriverCaps(
+                    context->majorVersion,
+                    context->minorVersion);
+                contextState->initFromCaps(caps);
+            } else {
+                // Just put some stuff here to make gles1 happy
+                HostDriverCaps gles1Caps = {
+                    .max_vertex_attribs = 16,
+                    .max_combined_texture_image_units = 8,
+                    .max_color_attachments = 8,
+
+                    .max_texture_size = 4096,
+                    .max_texture_size_cube_map = 2048,
+                    .max_renderbuffer_size = 4096,
+                };
+                contextState->initFromCaps(gles1Caps);
+            }
+        }
+
+        // update the client state, share group, and version
+        if (context->majorVersion > 1) {
+            hostCon->gl2Encoder()->setClientStateMakeCurrent(
+                    contextState,
+                    context->majorVersion,
+                    context->minorVersion,
+                    context->deviceMajorVersion,
+                    context->deviceMinorVersion);
+            hostCon->gl2Encoder()->setSharedGroup(context->getSharedGroup());
+        }
+        else {
+            hostCon->glEncoder()->setClientState(context->getClientState());
+            hostCon->glEncoder()->setSharedGroup(context->getSharedGroup());
+        }
+    }
+    else if (tInfo->currentContext) {
+        //release ClientState & SharedGroup
+        if (tInfo->currentContext->majorVersion > 1) {
+            hostCon->gl2Encoder()->setClientState(NULL);
+            hostCon->gl2Encoder()->setSharedGroup(GLSharedGroupPtr(NULL));
+        }
+        else {
+            hostCon->glEncoder()->setClientState(NULL);
+            hostCon->glEncoder()->setSharedGroup(GLSharedGroupPtr(NULL));
+        }
+
+    }
+
+    // Delete the previous context here
+    if (tInfo->currentContext && (tInfo->currentContext != context)) {
+        tInfo->currentContext->flags &= ~EGLContext_t::IS_CURRENT;
+        if (tInfo->currentContext->deletePending && tInfo->currentContext != context) {
+            eglDestroyContext(dpy, tInfo->currentContext);
+        }
+    }
+
+    // Now the new context is current in tInfo
+    tInfo->currentContext = context;
+
+    //Check maybe we need to init the encoder, if it's first eglMakeCurrent
+    if (tInfo->currentContext) {
+        if (tInfo->currentContext->majorVersion > 1) {
+            if (!hostCon->gl2Encoder()->isInitialized()) {
+                s_display.gles2_iface()->init();
+                hostCon->gl2Encoder()->setInitialized();
+                ClientAPIExts::initClientFuncs(s_display.gles2_iface(), 1);
+            }
+            const char* exts = getGLString(GL_EXTENSIONS);
+            if (exts) {
+                hostCon->gl2Encoder()->setExtensions(exts, getExtStringArray());
+            }
+        }
+        else {
+            if (!hostCon->glEncoder()->isInitialized()) {
+                DPRINT("%s: %p: ver %d %d (tinfo %p) (first time)",
+                      __FUNCTION__,
+                      context, context->majorVersion, context->minorVersion, tInfo);
+                s_display.gles_iface()->init();
+                hostCon->glEncoder()->setInitialized();
+                ClientAPIExts::initClientFuncs(s_display.gles_iface(), 0);
+            }
+        }
+    }
+
+    return EGL_TRUE;
+}
+
+EGLContext eglGetCurrentContext()
+{
+    return getEGLThreadInfo()->currentContext;
+}
+
+EGLSurface eglGetCurrentSurface(EGLint readdraw)
+{
+    EGLContext_t * context = getEGLThreadInfo()->currentContext;
+    if (!context)
+        return EGL_NO_SURFACE; //not an error
+
+    switch (readdraw) {
+        case EGL_READ:
+            return context->read;
+        case EGL_DRAW:
+            return context->draw;
+        default:
+            ALOGE("%s:%d unknown parameter: 0x%x\n", __func__, __LINE__, readdraw);
+            setErrorReturn(EGL_BAD_PARAMETER, EGL_NO_SURFACE);
+    }
+}
+
+EGLDisplay eglGetCurrentDisplay()
+{
+    EGLContext_t * context = getEGLThreadInfo()->currentContext;
+    if (!context)
+        return EGL_NO_DISPLAY; //not an error
+
+    return context->dpy;
+}
+
+EGLBoolean eglQueryContext(EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value)
+{
+    VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
+    VALIDATE_CONTEXT_RETURN(ctx, EGL_FALSE);
+
+    EGLContext_t * context = static_cast<EGLContext_t*>(ctx);
+
+    EGLBoolean ret = EGL_TRUE;
+    switch (attribute) {
+        case EGL_CONFIG_ID:
+            ret = s_display.getConfigAttrib(context->config, EGL_CONFIG_ID, value);
+            break;
+        case EGL_CONTEXT_CLIENT_TYPE:
+            *value = EGL_OPENGL_ES_API;
+            break;
+        case EGL_CONTEXT_CLIENT_VERSION:
+            *value = context->majorVersion;
+            break;
+        case EGL_RENDER_BUFFER:
+            if (!context->draw)
+                *value = EGL_NONE;
+            else
+                *value = EGL_BACK_BUFFER; //single buffer not supported
+            break;
+        default:
+            ALOGE("eglQueryContext %x  EGL_BAD_ATTRIBUTE", attribute);
+            setErrorReturn(EGL_BAD_ATTRIBUTE, EGL_FALSE);
+            break;
+    }
+
+    return ret;
+}
+
+EGLBoolean eglWaitGL()
+{
+    EGLThreadInfo *tInfo = getEGLThreadInfo();
+    if (!tInfo || !tInfo->currentContext) {
+        return EGL_FALSE;
+    }
+
+    if (tInfo->currentContext->majorVersion > 1) {
+        s_display.gles2_iface()->finish();
+    }
+    else {
+        s_display.gles_iface()->finish();
+    }
+
+    return EGL_TRUE;
+}
+
+EGLBoolean eglWaitNative(EGLint engine)
+{
+    (void)engine;
+    return EGL_TRUE;
+}
+
+EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface eglSurface)
+{
+    VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
+    if (eglSurface == EGL_NO_SURFACE)
+        setErrorReturn(EGL_BAD_SURFACE, EGL_FALSE);
+
+    DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_FALSE);
+
+    egl_surface_t* d = static_cast<egl_surface_t*>(eglSurface);
+    if (d->dpy != dpy)
+        setErrorReturn(EGL_BAD_DISPLAY, EGL_FALSE);
+
+    // post the surface
+    EGLBoolean ret = d->swapBuffers();
+
+    hostCon->flush();
+    return ret;
+}
+
+EGLBoolean eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target)
+{
+    //TODO :later
+    (void)dpy;
+    (void)surface;
+    (void)target;
+    return 0;
+}
+
+EGLBoolean eglLockSurfaceKHR(EGLDisplay display, EGLSurface surface, const EGLint *attrib_list)
+{
+    //TODO later
+    (void)display;
+    (void)surface;
+    (void)attrib_list;
+    return 0;
+}
+
+EGLBoolean eglUnlockSurfaceKHR(EGLDisplay display, EGLSurface surface)
+{
+    //TODO later
+    (void)display;
+    (void)surface;
+    return 0;
+}
+
+/* Define to match AIDL PixelFormat::R_8. */
+#define HAL_PIXEL_FORMAT_R8 0x38
+
+EGLImageKHR eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list)
+{
+    (void)attrib_list;
+
+    VALIDATE_DISPLAY_INIT(dpy, EGL_NO_IMAGE_KHR);
+
+    if (target == EGL_NATIVE_BUFFER_ANDROID) {
+        if (ctx != EGL_NO_CONTEXT) {
+            setErrorReturn(EGL_BAD_CONTEXT, EGL_NO_IMAGE_KHR);
+        }
+
+        android_native_buffer_t* native_buffer = (android_native_buffer_t*)buffer;
+
+        if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC)
+            setErrorReturn(EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR);
+
+        if (native_buffer->common.version != sizeof(android_native_buffer_t))
+            setErrorReturn(EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR);
+
+        if (native_buffer->handle == NULL)
+            setErrorReturn(EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR);
+
+        DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_FALSE);
+        int format = grallocHelper->getFormat(native_buffer->handle);
+        switch (format) {
+            case HAL_PIXEL_FORMAT_R8:
+            case HAL_PIXEL_FORMAT_RGBA_8888:
+            case HAL_PIXEL_FORMAT_RGBX_8888:
+            case HAL_PIXEL_FORMAT_RGB_888:
+            case HAL_PIXEL_FORMAT_RGB_565:
+            case HAL_PIXEL_FORMAT_YV12:
+            case HAL_PIXEL_FORMAT_BGRA_8888:
+#if PLATFORM_SDK_VERSION >= 26
+            case HAL_PIXEL_FORMAT_RGBA_FP16:
+            case HAL_PIXEL_FORMAT_RGBA_1010102:
+#endif
+#if PLATFORM_SDK_VERSION >= 28
+            case HAL_PIXEL_FORMAT_YCBCR_420_888:
+#endif
+#if PLATFORM_SDK_VERSION >= 30
+            case HAL_PIXEL_FORMAT_YCBCR_P010:
+#endif
+                break;
+            case HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED:
+                ALOGW("%s:%d using HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED\n", __func__, __LINE__);
+                break;
+            default:
+                ALOGE("%s:%d unknown parameter: 0x%x\n", __func__, __LINE__, format);
+                setErrorReturn(EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR);
+        }
+
+        native_buffer->common.incRef(&native_buffer->common);
+
+        EGLImage_t *image = new EGLImage_t();
+        image->dpy = dpy;
+        image->target = target;
+        image->native_buffer = native_buffer;
+        image->width = native_buffer->width;
+        image->height = native_buffer->width;
+
+        return (EGLImageKHR)image;
+    }
+    else if (target == EGL_GL_TEXTURE_2D_KHR) {
+        VALIDATE_CONTEXT_RETURN(ctx, EGL_NO_IMAGE_KHR);
+
+        EGLContext_t *context = static_cast<EGLContext_t*>(ctx);
+        DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_NO_IMAGE_KHR);
+
+        uint32_t ctxHandle = (context) ? context->rcContext : 0;
+        GLuint texture = (GLuint)reinterpret_cast<uintptr_t>(buffer);
+        uint32_t img = rcEnc->rcCreateClientImage(rcEnc, ctxHandle, target, texture);
+        EGLImage_t *image = new EGLImage_t();
+        image->dpy = dpy;
+        image->target = target;
+        image->host_egl_image = img;
+        image->width = context->getClientState()->queryTexWidth(0, texture);
+        image->height = context->getClientState()->queryTexHeight(0, texture);
+
+        return (EGLImageKHR)image;
+    }
+
+    setErrorReturn(EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR);
+}
+
+EGLBoolean eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR img)
+{
+    VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
+    EGLImage_t *image = (EGLImage_t*)img;
+
+    if (!image || image->dpy != dpy) {
+        RETURN_ERROR(EGL_FALSE, EGL_BAD_PARAMETER);
+    }
+
+    if (image->target == EGL_NATIVE_BUFFER_ANDROID) {
+        android_native_buffer_t* native_buffer = image->native_buffer;
+
+        if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC)
+            setErrorReturn(EGL_BAD_PARAMETER, EGL_FALSE);
+
+        if (native_buffer->common.version != sizeof(android_native_buffer_t))
+            setErrorReturn(EGL_BAD_PARAMETER, EGL_FALSE);
+
+        native_buffer->common.decRef(&native_buffer->common);
+        delete image;
+
+        return EGL_TRUE;
+    }
+    else if (image->target == EGL_GL_TEXTURE_2D_KHR) {
+        uint32_t host_egl_image = image->host_egl_image;
+        delete image;
+        DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_FALSE);
+        return rcEnc->rcDestroyClientImage(rcEnc, host_egl_image);
+    }
+
+    setErrorReturn(EGL_BAD_PARAMETER, EGL_FALSE);
+}
+
+#define FENCE_SYNC_HANDLE (EGLSyncKHR)0xFE4CE
+#define MAX_EGL_SYNC_ATTRIBS 10
+
+EGLSyncKHR eglCreateSyncKHR(EGLDisplay dpy, EGLenum type,
+        const EGLint *attrib_list)
+{
+    VALIDATE_DISPLAY(dpy, EGL_NO_SYNC_KHR);
+    DPRINT("type for eglCreateSyncKHR: 0x%x", type);
+
+    DEFINE_HOST_CONNECTION;
+
+    if ((type != EGL_SYNC_FENCE_KHR &&
+         type != EGL_SYNC_NATIVE_FENCE_ANDROID) ||
+        (type != EGL_SYNC_FENCE_KHR &&
+         !rcEnc->hasNativeSync() &&
+         !rcEnc->hasVirtioGpuNativeSync())) {
+        setErrorReturn(EGL_BAD_ATTRIBUTE, EGL_NO_SYNC_KHR);
+    }
+
+    EGLThreadInfo *tInfo = getEGLThreadInfo();
+    if (!tInfo || !tInfo->currentContext) {
+        setErrorReturn(EGL_BAD_MATCH, EGL_NO_SYNC_KHR);
+    }
+
+    int num_actual_attribs = 0;
+
+    // If attrib_list is not NULL,
+    // ensure attrib_list contains (key, value) pairs
+    // followed by a single EGL_NONE.
+    // Also validate attribs.
+    int inputFenceFd = -1;
+    if (attrib_list) {
+        for (int i = 0; i < MAX_EGL_SYNC_ATTRIBS; i += 2) {
+            if (attrib_list[i] == EGL_NONE) {
+                num_actual_attribs = i;
+                break;
+            }
+            if (i + 1 == MAX_EGL_SYNC_ATTRIBS) {
+                DPRINT("ERROR: attrib list without EGL_NONE");
+                setErrorReturn(EGL_BAD_ATTRIBUTE, EGL_NO_SYNC_KHR);
+            }
+        }
+
+        // Validate and input attribs
+        for (int i = 0; i < num_actual_attribs; i += 2) {
+            EGLint attrib_key = attrib_list[i];
+            EGLint attrib_val = attrib_list[i + 1];
+            switch (attrib_key) {
+                case EGL_SYNC_TYPE_KHR:
+                case EGL_SYNC_STATUS_KHR:
+                case EGL_SYNC_CONDITION_KHR:
+                case EGL_SYNC_NATIVE_FENCE_FD_ANDROID:
+                    break;
+                default:
+                    setErrorReturn(EGL_BAD_ATTRIBUTE, EGL_NO_SYNC_KHR);
+            }
+            if (attrib_key == EGL_SYNC_NATIVE_FENCE_FD_ANDROID) {
+                if (attrib_val != EGL_NO_NATIVE_FENCE_FD_ANDROID) {
+                    inputFenceFd = attrib_val;
+                }
+            }
+            DPRINT("attrib: 0x%x : 0x%x", attrib_key, attrib_val);
+        }
+    }
+
+    uint64_t sync_handle = 0;
+    int newFenceFd = -1;
+
+    if (rcEnc->hasVirtioGpuNativeSync()) {
+        sync_handle =
+            createNativeSync_virtioGpu(
+                type, attrib_list, num_actual_attribs,
+                false /* don't destroy when signaled on the host;
+                         let the guest clean this up,
+                         because the guest called eglCreateSyncKHR. */,
+                inputFenceFd, &newFenceFd);
+    } else if (rcEnc->hasNativeSync()) {
+        sync_handle =
+            createNativeSync(
+                type, attrib_list, num_actual_attribs,
+                false /* don't destroy when signaled on the host;
+                         let the guest clean this up,
+                         because the guest called eglCreateSyncKHR. */,
+                inputFenceFd,
+                &newFenceFd);
+
+    } else {
+        // Just trigger a glFinish if the native sync on host
+        // is unavailable.
+        eglWaitClient();
+    }
+
+    EGLSync_t* syncRes = new EGLSync_t(sync_handle);
+
+    if (type == EGL_SYNC_NATIVE_FENCE_ANDROID) {
+        syncRes->type = EGL_SYNC_NATIVE_FENCE_ANDROID;
+
+        if (rcEnc->hasVirtioGpuNativeSync()) {
+            syncRes->android_native_fence_fd = newFenceFd;
+        } else {
+            if (inputFenceFd < 0) {
+                syncRes->android_native_fence_fd = newFenceFd;
+            } else {
+                DPRINT("has input fence fd %d",
+                        inputFenceFd);
+                syncRes->android_native_fence_fd = inputFenceFd;
+            }
+        }
+    } else {
+        syncRes->type = EGL_SYNC_FENCE_KHR;
+        syncRes->android_native_fence_fd = -1;
+        if (!rcEnc->hasNativeSync() && !rcEnc->hasVirtioGpuNativeSync()) {
+            syncRes->status = EGL_SIGNALED_KHR;
+        }
+    }
+
+    return (EGLSyncKHR)syncRes;
+}
+
+EGLBoolean eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR eglsync)
+{
+    (void)dpy;
+
+    if (!eglsync) {
+        ALOGE("%s: null sync object!", __FUNCTION__);
+        setErrorReturn(EGL_BAD_PARAMETER, EGL_FALSE);
+    }
+
+    EGLSync_t* sync = static_cast<EGLSync_t*>(eglsync);
+
+    if (sync && sync->android_native_fence_fd > 0) {
+        close(sync->android_native_fence_fd);
+        sync->android_native_fence_fd = -1;
+    }
+
+    if (sync) {
+        DEFINE_HOST_CONNECTION;
+        if (rcEnc->hasVirtioGpuNativeSync() || rcEnc->hasNativeSync()) {
+            if (rcEnc->hasAsyncFrameCommands()) {
+                rcEnc->rcDestroySyncKHRAsync(rcEnc, sync->handle);
+            } else {
+                rcEnc->rcDestroySyncKHR(rcEnc, sync->handle);
+            }
+        }
+        delete sync;
+    }
+
+    return EGL_TRUE;
+}
+
+EGLint eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR eglsync, EGLint flags,
+        EGLTimeKHR timeout)
+{
+    (void)dpy;
+
+    if (!eglsync) {
+        ALOGE("%s: null sync object!", __FUNCTION__);
+        setErrorReturn(EGL_BAD_PARAMETER, EGL_FALSE);
+    }
+
+    EGLSync_t* sync = (EGLSync_t*)eglsync;
+
+    DPRINT("sync=0x%lx (handle=0x%lx) flags=0x%x timeout=0x%llx",
+           sync, sync->handle, flags, timeout);
+
+    DEFINE_HOST_CONNECTION;
+
+    EGLint retval;
+    if (rcEnc->hasVirtioGpuNativeSync() || rcEnc->hasNativeSync()) {
+        retval = rcEnc->rcClientWaitSyncKHR
+            (rcEnc, sync->handle, flags, timeout);
+    } else {
+        retval = EGL_CONDITION_SATISFIED_KHR;
+    }
+    EGLint res_status;
+    switch (sync->type) {
+        case EGL_SYNC_FENCE_KHR:
+            res_status = EGL_SIGNALED_KHR;
+            break;
+        case EGL_SYNC_NATIVE_FENCE_ANDROID:
+            res_status = EGL_SYNC_NATIVE_FENCE_SIGNALED_ANDROID;
+            break;
+        default:
+            res_status = EGL_SIGNALED_KHR;
+    }
+    sync->status = res_status;
+    return retval;
+}
+
+EGLBoolean eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR eglsync,
+        EGLint attribute, EGLint *value)
+{
+    (void)dpy;
+
+    EGLSync_t* sync = (EGLSync_t*)eglsync;
+
+    if (!sync) {
+        setErrorReturn(EGL_BAD_PARAMETER, EGL_FALSE);
+    }
+
+    if (!value) {
+        setErrorReturn(EGL_BAD_PARAMETER, EGL_FALSE);
+    }
+
+    switch (attribute) {
+    case EGL_SYNC_TYPE_KHR:
+        *value = sync->type;
+        return EGL_TRUE;
+    case EGL_SYNC_STATUS_KHR: {
+        if (sync->status == EGL_SIGNALED_KHR) {
+            *value = sync->status;
+            return EGL_TRUE;
+        } else {
+            // ask the host again
+            DEFINE_HOST_CONNECTION;
+            if (rcEnc->hasVirtioGpuNativeSync() || rcEnc->hasNativeSyncV4()) {
+                if (rcEnc->rcIsSyncSignaled(rcEnc, sync->handle)) {
+                    sync->status = EGL_SIGNALED_KHR;
+                }
+            }
+            *value = sync->status;
+            return EGL_TRUE;
+        }
+    }
+    case EGL_SYNC_CONDITION_KHR:
+        *value = EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR;
+        return EGL_TRUE;
+    default:
+        setErrorReturn(EGL_BAD_ATTRIBUTE, EGL_FALSE);
+    }
+}
+
+int eglDupNativeFenceFDANDROID(EGLDisplay dpy, EGLSyncKHR eglsync) {
+    (void)dpy;
+
+    DPRINT("call");
+
+    EGLSync_t* sync = (EGLSync_t*)eglsync;
+    if (sync && sync->android_native_fence_fd > 0) {
+        int res = dup(sync->android_native_fence_fd);
+        return res;
+    } else {
+        return -1;
+    }
+}
+
+EGLint eglWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR eglsync, EGLint flags) {
+    (void)dpy;
+
+    if (!eglsync) {
+        ALOGE("%s: null sync object!", __FUNCTION__);
+        setErrorReturn(EGL_BAD_PARAMETER, EGL_FALSE);
+    }
+
+    if (flags) {
+        ALOGE("%s: flags must be 0, got 0x%x", __FUNCTION__, flags);
+        setErrorReturn(EGL_BAD_PARAMETER, EGL_FALSE);
+    }
+
+    DEFINE_HOST_CONNECTION;
+    if (rcEnc->hasVirtioGpuNativeSync() || rcEnc->hasNativeSyncV3()) {
+        EGLSync_t* sync = (EGLSync_t*)eglsync;
+        rcEnc->rcWaitSyncKHR(rcEnc, sync->handle, flags);
+    }
+
+    return EGL_TRUE;
+}
diff --git a/system/egl/eglContext.h b/system/egl/eglContext.h
new file mode 100644
index 0000000..c71c7c4
--- /dev/null
+++ b/system/egl/eglContext.h
@@ -0,0 +1,61 @@
+/*
+* Copyright (C) 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#ifndef _EGL_CONTEXT_H
+#define _EGL_CONTEXT_H
+
+#include "GLClientState.h"
+#include "GLSharedGroup.h"
+
+#include <string>
+#include <vector>
+
+struct EGLContext_t {
+
+    enum {
+        IS_CURRENT      =   0x00010000,
+        NEVER_CURRENT   =   0x00020000
+    };
+
+    EGLContext_t(EGLDisplay dpy, EGLConfig config, EGLContext_t* shareCtx, int maj, int min);
+    ~EGLContext_t();
+    uint32_t            flags;
+    EGLDisplay          dpy;
+    EGLConfig           config;
+    EGLSurface          read;
+    EGLSurface          draw;
+    EGLContext_t    *   shareCtx;
+    uint32_t            rcContext;
+    const char*         versionString;
+    EGLint              majorVersion;
+    EGLint              minorVersion;
+    EGLint              deviceMajorVersion;
+    EGLint              deviceMinorVersion;
+    const char*         vendorString;
+    const char*         rendererString;
+    const char*         shaderVersionString;
+    const char*         extensionString;
+    std::vector<std::string> extensionStringArray;
+    EGLint              deletePending;
+    GLClientState * getClientState(){ return clientState; }
+    GLSharedGroupPtr getSharedGroup(){ return sharedGroup; }
+    int getGoldfishSyncFd();
+private:
+    GLClientState    *    clientState;
+    GLSharedGroupPtr      sharedGroup;
+    int goldfishSyncFd;
+};
+
+#endif
diff --git a/system/egl/eglDisplay.cpp b/system/egl/eglDisplay.cpp
new file mode 100644
index 0000000..79019c8
--- /dev/null
+++ b/system/egl/eglDisplay.cpp
@@ -0,0 +1,706 @@
+/*
+* Copyright (C) 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#include "eglDisplay.h"
+#include "HostConnection.h"
+#include "KeyedVectorUtils.h"
+
+#ifdef HOST_BUILD
+#include "android/base/files/PathUtils.cpp"
+#include "android/base/system/System.cpp"
+#endif
+
+#include <string>
+#include <dlfcn.h>
+#include <GLES3/gl31.h>
+
+#include <system/graphics.h>
+
+static const int systemEGLVersionMajor = 1;
+static const int systemEGLVersionMinor = 4;
+static const char systemEGLVendor[] = "Google Android emulator";
+
+// list of extensions supported by this EGL implementation
+//  NOTE that each extension name should be suffixed with space
+static const char systemStaticEGLExtensions[] =
+            "EGL_ANDROID_image_native_buffer "
+            "EGL_KHR_fence_sync "
+            "EGL_KHR_image_base "
+            "EGL_KHR_gl_texture_2d_image ";
+
+// extensions to add dynamically depending on host-side support
+static const char kDynamicEGLExtNativeSync[] = "EGL_ANDROID_native_fence_sync ";
+static const char kDynamicEGLExtWaitSync[] = "EGL_KHR_wait_sync ";
+
+static void *s_gles_lib = NULL;
+static void *s_gles2_lib = NULL;
+
+// The following function will be called when we (libEGL)
+// gets unloaded
+// At this point we want to unload the gles libraries we
+// might have loaded during initialization
+static void __attribute__ ((destructor)) do_on_unload(void)
+{
+    if (s_gles_lib) {
+        dlclose(s_gles_lib);
+    }
+
+    if (s_gles2_lib) {
+        dlclose(s_gles2_lib);
+    }
+}
+
+eglDisplay::eglDisplay() :
+    m_initialized(false),
+    m_major(0),
+    m_minor(0),
+    m_hostRendererVersion(0),
+    m_numConfigs(0),
+    m_numConfigAttribs(0),
+    m_attribs(),
+    m_configs(NULL),
+    m_gles_iface(NULL),
+    m_gles2_iface(NULL),
+    m_versionString(NULL),
+    m_vendorString(NULL),
+    m_extensionString(NULL),
+    m_hostDriverCaps_knownMajorVersion(0),
+    m_hostDriverCaps_knownMinorVersion(0)
+{
+    pthread_mutex_init(&m_lock, NULL);
+    pthread_mutex_init(&m_ctxLock, NULL);
+    pthread_mutex_init(&m_surfaceLock, NULL);
+}
+
+eglDisplay::~eglDisplay()
+{
+    terminate();
+    pthread_mutex_destroy(&m_lock);
+    pthread_mutex_destroy(&m_ctxLock);
+    pthread_mutex_destroy(&m_surfaceLock);
+}
+
+
+
+bool eglDisplay::initialize(EGLClient_eglInterface *eglIface)
+{
+    pthread_mutex_lock(&m_lock);
+    if (!m_initialized) {
+
+        //
+        // load GLES client API
+        //
+        m_gles_iface = loadGLESClientAPI("libGLESv1_CM_emulation",
+                                         eglIface,
+                                         &s_gles_lib);
+        if (!m_gles_iface) {
+            pthread_mutex_unlock(&m_lock);
+            ALOGE("Failed to load gles1 iface");
+            return false;
+        }
+
+        m_gles2_iface = loadGLESClientAPI("libGLESv2_emulation",
+                                          eglIface,
+                                          &s_gles2_lib);
+
+        //
+        // establish connection with the host
+        //
+        HostConnection *hcon = HostConnection::get();
+        if (!hcon) {
+            pthread_mutex_unlock(&m_lock);
+            ALOGE("Failed to establish connection with the host\n");
+            return false;
+        }
+        hcon->setGrallocOnly(false);
+
+        //
+        // get renderControl encoder instance
+        //
+        renderControl_encoder_context_t *rcEnc = hcon->rcEncoder();
+        if (!rcEnc) {
+            pthread_mutex_unlock(&m_lock);
+            ALOGE("Failed to get renderControl encoder instance");
+            return false;
+        }
+
+        //
+        // Query host reneder and EGL version
+        //
+        m_hostRendererVersion = rcEnc->rcGetRendererVersion(rcEnc);
+        EGLint status = rcEnc->rcGetEGLVersion(rcEnc, &m_major, &m_minor);
+        if (status != EGL_TRUE) {
+            // host EGL initialization failed !!
+            pthread_mutex_unlock(&m_lock);
+            return false;
+        }
+
+        //
+        // Take minimum version beween what we support and what the host support
+        //
+        if (m_major > systemEGLVersionMajor) {
+            m_major = systemEGLVersionMajor;
+            m_minor = systemEGLVersionMinor;
+        }
+        else if (m_major == systemEGLVersionMajor &&
+                 m_minor > systemEGLVersionMinor) {
+            m_minor = systemEGLVersionMinor;
+        }
+
+        //
+        // Query the host for the set of configs
+        //
+        m_numConfigs = rcEnc->rcGetNumConfigs(rcEnc, (uint32_t*)&m_numConfigAttribs);
+        if (m_numConfigs <= 0 || m_numConfigAttribs <= 0) {
+            // just sanity check - should never happen
+            pthread_mutex_unlock(&m_lock);
+            return false;
+        }
+
+        uint32_t nInts = m_numConfigAttribs * (m_numConfigs + 1);
+        EGLint tmp_buf[nInts];
+
+        m_configs = new EGLint[nInts-m_numConfigAttribs];
+
+        if (!m_configs) {
+            pthread_mutex_unlock(&m_lock);
+            return false;
+        }
+
+        EGLint n = rcEnc->rcGetConfigs(rcEnc, nInts*sizeof(EGLint), (GLuint*)tmp_buf);
+        if (n != m_numConfigs) {
+            pthread_mutex_unlock(&m_lock);
+            return false;
+        }
+
+        // Fill the attributes vector.
+        // The first m_numConfigAttribs values of tmp_buf are the actual attributes enums.
+        for (int i=0; i<m_numConfigAttribs; i++) {
+            m_attribs[tmp_buf[i]] = i;
+        }
+
+        memcpy(m_configs, tmp_buf + m_numConfigAttribs,
+               m_numConfigs*m_numConfigAttribs*sizeof(EGLint));
+
+        m_initialized = true;
+    }
+    pthread_mutex_unlock(&m_lock);
+
+    processConfigs();
+
+    return true;
+}
+
+void eglDisplay::processConfigs()
+{
+    for (intptr_t i=0; i<m_numConfigs; i++) {
+        EGLConfig config = getConfigAtIndex(i);
+        uint32_t format;
+        if (getConfigNativePixelFormat(config, &format)) {
+            setConfigAttrib(config, EGL_NATIVE_VISUAL_ID, format);
+        }
+    }
+}
+
+void eglDisplay::terminate()
+{
+    pthread_mutex_lock(&m_lock);
+    if (m_initialized) {
+        // Cannot use the for loop in the following code because
+        // eglDestroyContext may erase elements.
+        EGLContextSet::iterator ctxIte = m_contexts.begin();
+        while (ctxIte != m_contexts.end()) {
+            EGLContextSet::iterator ctxToDelete = ctxIte;
+            ctxIte ++;
+            eglDestroyContext(static_cast<EGLDisplay>(this), *ctxToDelete);
+        }
+        EGLSurfaceSet::iterator surfaceIte = m_surfaces.begin();
+        while (surfaceIte != m_surfaces.end()) {
+            EGLSurfaceSet::iterator surfaceToDelete = surfaceIte;
+            surfaceIte ++;
+            eglDestroySurface(static_cast<EGLDisplay>(this), *surfaceToDelete);
+        }
+        m_initialized = false;
+        delete [] m_configs;
+        m_configs = NULL;
+
+        if (m_versionString) {
+            free(m_versionString);
+            m_versionString = NULL;
+        }
+        if (m_vendorString) {
+            free(m_vendorString);
+            m_vendorString = NULL;
+        }
+        if (m_extensionString) {
+            free(m_extensionString);
+            m_extensionString = NULL;
+        }
+    }
+    pthread_mutex_unlock(&m_lock);
+}
+
+#ifdef __APPLE__
+#define LIBSUFFIX ".dylib"
+#else
+#ifdef _WIN32
+#define LIBSUFFIX ".dll"
+#else
+#define LIBSUFFIX ".so"
+#endif // !_WIN32 (linux)
+#endif // !__APPLE__
+
+#ifndef HOST_BUILD
+#if PLATFORM_SDK_VERSION >= 26
+#define PARTITION "/vendor"
+#else
+#define PARTITION "/system"
+#endif // !PLATFORM_SDK_VERSION >= 26
+#if __LP64__
+#define LIBDIR "/lib64/egl/"
+#else
+#define LIBDIR "/lib/egl/"
+#endif // !__LP64__
+#endif // !HOST_BUILD
+
+EGLClient_glesInterface *eglDisplay::loadGLESClientAPI(const char *basename,
+                                                       EGLClient_eglInterface *eglIface,
+                                                       void **libHandle)
+{
+#ifdef HOST_BUILD
+    std::string baseDir =
+        android::base::System::get()->getProgramDirectory();
+    std::string path =
+        android::base::pj({
+            baseDir, "lib64", std::string(basename) + LIBSUFFIX});
+    void *lib = dlopen(path.c_str(), RTLD_NOW);
+#else
+    std::string path(PARTITION);
+    path += LIBDIR;
+    path += basename;
+    path += LIBSUFFIX;
+    void *lib = dlopen(path.c_str(), RTLD_NOW);
+#endif
+
+    if (!lib) {
+        ALOGE("Failed to dlopen %s", basename);
+        return NULL;
+    }
+
+    init_emul_gles_t init_gles_func = (init_emul_gles_t)dlsym(lib,"init_emul_gles");
+    if (!init_gles_func) {
+        ALOGE("Failed to find init_emul_gles");
+        dlclose((void*)lib);
+        return NULL;
+    }
+
+    *libHandle = lib;
+    return (*init_gles_func)(eglIface);
+}
+
+static char *queryHostEGLString(EGLint name)
+{
+    HostConnection *hcon = HostConnection::get();
+    if (hcon) {
+        renderControl_encoder_context_t *rcEnc = hcon->rcEncoder();
+        if (rcEnc) {
+            int n = rcEnc->rcQueryEGLString(rcEnc, name, NULL, 0);
+            if (n < 0) {
+                // allocate space for the string.
+                char *str = (char *)malloc(-n);
+                n = rcEnc->rcQueryEGLString(rcEnc, name, str, -n);
+                if (n > 0) {
+                    return str;
+                }
+
+                free(str);
+            }
+        }
+    }
+
+    return NULL;
+}
+
+static char *buildExtensionString()
+{
+    //Query host extension string
+    char *hostExt = queryHostEGLString(EGL_EXTENSIONS);
+    if (!hostExt || (hostExt[1] == '\0')) {
+        // no extensions on host - only static extension list supported
+        return strdup(systemStaticEGLExtensions);
+    }
+
+    int n = strlen(hostExt);
+    if (n > 0) {
+        char *initialEGLExts;
+        char *finalEGLExts;
+
+        HostConnection *hcon = HostConnection::get();
+        // If we got here, we must have succeeded in queryHostEGLString
+        // and we thus should have a valid connection
+        assert(hcon);
+
+        asprintf(&initialEGLExts,"%s%s", systemStaticEGLExtensions, hostExt);
+
+        std::string dynamicEGLExtensions;
+
+        if ((hcon->rcEncoder()->hasVirtioGpuNativeSync() || hcon->rcEncoder()->hasNativeSync()) &&
+            !strstr(initialEGLExts, kDynamicEGLExtNativeSync)) {
+            dynamicEGLExtensions += kDynamicEGLExtNativeSync;
+
+            if (hcon->rcEncoder()->hasVirtioGpuNativeSync() || hcon->rcEncoder()->hasNativeSyncV3()) {
+                dynamicEGLExtensions += kDynamicEGLExtWaitSync;
+            }
+        }
+
+        asprintf(&finalEGLExts, "%s%s", initialEGLExts, dynamicEGLExtensions.c_str());
+
+        free(initialEGLExts);
+        free((char*)hostExt);
+        return finalEGLExts;
+    }
+    else {
+        free((char*)hostExt);
+        return strdup(systemStaticEGLExtensions);
+    }
+}
+
+const char *eglDisplay::queryString(EGLint name)
+{
+    if (name == EGL_CLIENT_APIS) {
+        return "OpenGL_ES";
+    }
+    else if (name == EGL_VERSION) {
+        pthread_mutex_lock(&m_lock);
+        if (m_versionString) {
+            pthread_mutex_unlock(&m_lock);
+            return m_versionString;
+        }
+
+        // build version string
+        asprintf(&m_versionString, "%d.%d", m_major, m_minor);
+        pthread_mutex_unlock(&m_lock);
+
+        return m_versionString;
+    }
+    else if (name == EGL_VENDOR) {
+        pthread_mutex_lock(&m_lock);
+        if (m_vendorString) {
+            pthread_mutex_unlock(&m_lock);
+            return m_vendorString;
+        }
+
+        // build vendor string
+        const char *hostVendor = queryHostEGLString(EGL_VENDOR);
+
+        if (hostVendor) {
+            asprintf(&m_vendorString, "%s Host: %s",
+                                     systemEGLVendor, hostVendor);
+            free((char*)hostVendor);
+        }
+        else {
+            m_vendorString = (char *)systemEGLVendor;
+        }
+        pthread_mutex_unlock(&m_lock);
+
+        return m_vendorString;
+    }
+    else if (name == EGL_EXTENSIONS) {
+        pthread_mutex_lock(&m_lock);
+        if (m_extensionString) {
+            pthread_mutex_unlock(&m_lock);
+            return m_extensionString;
+        }
+
+        // build extension string
+        m_extensionString = buildExtensionString();
+        pthread_mutex_unlock(&m_lock);
+
+        return m_extensionString;
+    }
+    else {
+        ALOGE("[%s] Unknown name %d\n", __FUNCTION__, name);
+        return NULL;
+    }
+}
+
+/* To get the value of attribute <a> of config <c> use the following formula:
+ * value = *(m_configs + (int)c*m_numConfigAttribs + a);
+ */
+EGLBoolean eglDisplay::getAttribValue(EGLConfig config, EGLint attribIdx, EGLint * value)
+{
+    if (attribIdx == ATTRIBUTE_NONE)
+    {
+        ALOGE("[%s] Bad attribute idx\n", __FUNCTION__);
+        return EGL_FALSE;
+    }
+    *value = *(m_configs + (intptr_t)(getIndexOfConfig(config))*m_numConfigAttribs + attribIdx);
+    return EGL_TRUE;
+}
+
+#define EGL_COLOR_COMPONENT_TYPE_EXT 0x3339
+#define EGL_COLOR_COMPONENT_TYPE_FIXED_EXT 0x333A
+
+EGLConfig eglDisplay::getConfigAtIndex(uint32_t index) const {
+    uintptr_t asPtr = (uintptr_t)index;
+    return (EGLConfig)(asPtr + 1);
+}
+
+uint32_t eglDisplay::getIndexOfConfig(EGLConfig config) const {
+    uintptr_t asInteger = (uintptr_t)config;
+    return (uint32_t)(asInteger - 1);
+}
+
+bool eglDisplay::isValidConfig(EGLConfig cfg) const {
+    uint32_t index = getIndexOfConfig(cfg);
+    intptr_t asInt = (intptr_t)index;
+    return !(asInt < 0 || asInt > m_numConfigs);
+}
+
+EGLBoolean eglDisplay::getConfigAttrib(EGLConfig config, EGLint attrib, EGLint * value)
+{
+    if (attrib == EGL_FRAMEBUFFER_TARGET_ANDROID) {
+        *value = EGL_TRUE;
+        return EGL_TRUE;
+    }
+    if (attrib == EGL_COVERAGE_SAMPLES_NV ||
+        attrib == EGL_COVERAGE_BUFFERS_NV) {
+        *value = 0;
+        return EGL_TRUE;
+    }
+    if (attrib == EGL_DEPTH_ENCODING_NV) {
+        *value = EGL_DEPTH_ENCODING_NONE_NV;
+        return EGL_TRUE;
+    }
+    if  (attrib == EGL_COLOR_COMPONENT_TYPE_EXT) {
+        *value = EGL_COLOR_COMPONENT_TYPE_FIXED_EXT;
+        return EGL_TRUE;
+    }
+    //Though it seems that valueFor() is thread-safe, we don't take chanses
+    pthread_mutex_lock(&m_lock);
+    EGLBoolean ret =
+        getAttribValue(
+            config,
+            findObjectOrDefault(
+                m_attribs, attrib, EGL_DONT_CARE),
+            value);
+    pthread_mutex_unlock(&m_lock);
+    return ret;
+}
+
+void eglDisplay::dumpConfig(EGLConfig config)
+{
+    EGLint value = 0;
+    DBG("^^^^^^^^^^ dumpConfig %p ^^^^^^^^^^^^^^^^^^", config);
+    for (int i=0; i<m_numConfigAttribs; i++) {
+        getAttribValue(config, i, &value);
+        DBG("Config %p: {%u}[%d] %d\n", config, getIndexOfConfig(config), i, value);
+    }
+}
+
+/* To set the value of attribute <a> of config <c> use the following formula:
+ * *(m_configs + (int)c*m_numConfigAttribs + a) = value;
+ */
+EGLBoolean eglDisplay::setAttribValue(EGLConfig config, EGLint attribIdx, EGLint value)
+{
+    if (attribIdx == ATTRIBUTE_NONE)
+    {
+        ALOGE("[%s] Bad attribute idx\n", __FUNCTION__);
+        return EGL_FALSE;
+    }
+    *(m_configs + (intptr_t)(getIndexOfConfig(config))*m_numConfigAttribs + attribIdx) = value;
+    return EGL_TRUE;
+}
+
+EGLBoolean eglDisplay::setConfigAttrib(EGLConfig config, EGLint attrib, EGLint value)
+{
+    //Though it seems that valueFor() is thread-safe, we don't take chanses
+    pthread_mutex_lock(&m_lock);
+    EGLBoolean ret =
+        setAttribValue(
+            config,
+            findObjectOrDefault(
+                m_attribs,
+                attrib,
+                EGL_DONT_CARE),
+            value);
+    pthread_mutex_unlock(&m_lock);
+    return ret;
+}
+
+
+EGLBoolean eglDisplay::getConfigNativePixelFormat(EGLConfig config, uint32_t * format)
+{
+    EGLint redSize, blueSize, greenSize, alphaSize;
+
+    if (!(
+            getAttribValue(
+                config,
+                findObjectOrDefault(m_attribs, EGL_RED_SIZE, EGL_DONT_CARE),
+                &redSize) &&
+            getAttribValue(
+                config,
+                findObjectOrDefault(m_attribs, EGL_BLUE_SIZE, EGL_DONT_CARE),
+                &blueSize) &&
+            getAttribValue(
+                config,
+                findObjectOrDefault(m_attribs, EGL_GREEN_SIZE, EGL_DONT_CARE),
+                &greenSize) &&
+            getAttribValue(
+                config,
+                findObjectOrDefault(m_attribs, EGL_ALPHA_SIZE, EGL_DONT_CARE),
+                &alphaSize))) {
+        ALOGE("Couldn't find value for one of the pixel format attributes");
+        return EGL_FALSE;
+    }
+
+    //calculate the GL internal format
+    if ((redSize==8)&&(greenSize==8)&&(blueSize==8)&&(alphaSize==8)) *format = HAL_PIXEL_FORMAT_RGBA_8888; //XXX: BGR?
+    else if ((redSize==8)&&(greenSize==8)&&(blueSize==8)&&(alphaSize==0)) *format = HAL_PIXEL_FORMAT_RGBX_8888; //XXX or HAL_PIXEL_FORMAT_RGB_888
+    else if ((redSize==5)&&(greenSize==6)&&(blueSize==5)&&(alphaSize==0)) *format = HAL_PIXEL_FORMAT_RGB_565;
+    else {
+        return EGL_FALSE;
+    }
+    return EGL_TRUE;
+}
+EGLBoolean eglDisplay::getConfigGLPixelFormat(EGLConfig config, GLenum * format)
+{
+    EGLint redSize, blueSize, greenSize, alphaSize;
+
+    if (!(
+            getAttribValue(
+                config,
+                findObjectOrDefault(m_attribs, EGL_RED_SIZE, EGL_DONT_CARE),
+                &redSize) &&
+            getAttribValue(
+                config,
+                findObjectOrDefault(m_attribs, EGL_BLUE_SIZE, EGL_DONT_CARE),
+                &blueSize) &&
+            getAttribValue(
+                config,
+                findObjectOrDefault(m_attribs, EGL_GREEN_SIZE, EGL_DONT_CARE),
+                &greenSize) &&
+            getAttribValue(
+                config,
+                findObjectOrDefault(m_attribs, EGL_ALPHA_SIZE, EGL_DONT_CARE),
+                &alphaSize))) {
+        ALOGE("Couldn't find value for one of the pixel format attributes");
+        return EGL_FALSE;
+    }
+
+    //calculate the GL internal format
+    if ((redSize == greenSize) && (redSize == blueSize) &&
+        ((redSize == 8) || (redSize == 16) || (redSize == 32)))
+    {
+        if (alphaSize == 0) *format = GL_RGB;
+        else *format = GL_RGBA;
+    }
+    else if ((redSize==5)&&(greenSize==6)&&(blueSize==5)&&(alphaSize==0)) *format = GL_RGB565_OES;
+    else if ((redSize==5)&&(greenSize==5)&&(blueSize==5)&&(alphaSize==1)) *format = GL_RGB5_A1_OES;
+    else if ((redSize==4)&&(greenSize==4)&&(blueSize==4)&&(alphaSize==4)) *format = GL_RGBA4_OES;
+    else return EGL_FALSE;
+
+    return EGL_TRUE;
+}
+
+void eglDisplay::onCreateContext(EGLContext ctx) {
+    pthread_mutex_lock(&m_ctxLock);
+    m_contexts.insert(ctx);
+    pthread_mutex_unlock(&m_ctxLock);
+}
+
+void eglDisplay::onCreateSurface(EGLSurface surface) {
+    pthread_mutex_lock(&m_surfaceLock);
+    m_surfaces.insert(surface);
+    pthread_mutex_unlock(&m_surfaceLock);
+}
+
+void eglDisplay::onDestroyContext(EGLContext ctx) {
+    pthread_mutex_lock(&m_ctxLock);
+    m_contexts.erase(ctx);
+    pthread_mutex_unlock(&m_ctxLock);
+}
+
+void eglDisplay::onDestroySurface(EGLSurface surface) {
+    pthread_mutex_lock(&m_surfaceLock);
+    m_surfaces.erase(surface);
+    pthread_mutex_unlock(&m_surfaceLock);
+}
+
+bool eglDisplay::isContext(EGLContext ctx) {
+    pthread_mutex_lock(&m_ctxLock);
+    bool res = m_contexts.find(ctx) != m_contexts.end();
+    pthread_mutex_unlock(&m_ctxLock);
+    return res;
+}
+
+bool eglDisplay::isSurface(EGLSurface surface) {
+    pthread_mutex_lock(&m_surfaceLock);
+    bool res = m_surfaces.find(surface) != m_surfaces.end();
+    pthread_mutex_unlock(&m_surfaceLock);
+    return res;
+}
+
+HostDriverCaps eglDisplay::getHostDriverCaps(int majorVersion, int minorVersion) {
+    pthread_mutex_lock(&m_lock);
+    if (majorVersion <= m_hostDriverCaps_knownMajorVersion &&
+        minorVersion <= m_hostDriverCaps_knownMinorVersion) {
+        pthread_mutex_unlock(&m_lock);
+        return m_hostDriverCaps;
+    }
+
+    memset(&m_hostDriverCaps, 0x0, sizeof(m_hostDriverCaps));
+
+    m_hostDriverCaps.max_color_attachments = 8;
+
+    // Can we query gles2?
+    if (majorVersion >= 1) {
+        m_gles2_iface->getIntegerv(GL_MAX_VERTEX_ATTRIBS, &m_hostDriverCaps.max_vertex_attribs);
+        m_gles2_iface->getIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &m_hostDriverCaps.max_combined_texture_image_units);
+
+        m_gles2_iface->getIntegerv(GL_MAX_TEXTURE_SIZE, &m_hostDriverCaps.max_texture_size);
+        m_gles2_iface->getIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE, &m_hostDriverCaps.max_texture_size_cube_map);
+        m_gles2_iface->getIntegerv(GL_MAX_RENDERBUFFER_SIZE, &m_hostDriverCaps.max_renderbuffer_size);
+        m_hostDriverCaps_knownMajorVersion = 2;
+    }
+
+    // Can we query gles3.0?
+    if (majorVersion >= 3) {
+        m_gles2_iface->getIntegerv(GL_MAX_COLOR_ATTACHMENTS, &m_hostDriverCaps.max_color_attachments);
+        m_gles2_iface->getIntegerv(GL_MAX_DRAW_BUFFERS, &m_hostDriverCaps.max_draw_buffers);
+        m_gles2_iface->getIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &m_hostDriverCaps.ubo_offset_alignment);
+        m_gles2_iface->getIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, &m_hostDriverCaps.max_uniform_buffer_bindings);
+        m_gles2_iface->getIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, &m_hostDriverCaps.max_transform_feedback_separate_attribs);
+        m_gles2_iface->getIntegerv(GL_MAX_3D_TEXTURE_SIZE, &m_hostDriverCaps.max_texture_size_3d);
+        m_gles2_iface->getIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, &m_hostDriverCaps.max_array_texture_layers);
+
+        m_hostDriverCaps_knownMajorVersion = 3;
+
+        // Can we query gles3.1?
+        if (minorVersion >= 1) {
+            m_gles2_iface->getIntegerv(GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS, &m_hostDriverCaps.max_atomic_counter_buffer_bindings);
+            m_gles2_iface->getIntegerv(GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, &m_hostDriverCaps.max_shader_storage_buffer_bindings);
+            m_gles2_iface->getIntegerv(GL_MAX_VERTEX_ATTRIB_BINDINGS, &m_hostDriverCaps.max_vertex_attrib_bindings);
+            m_gles2_iface->getIntegerv(GL_MAX_VERTEX_ATTRIB_STRIDE, &m_hostDriverCaps.max_vertex_attrib_stride);
+            m_gles2_iface->getIntegerv(GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT, &m_hostDriverCaps.ssbo_offset_alignment);
+            m_hostDriverCaps_knownMinorVersion = 1;
+        }
+    }
+
+    pthread_mutex_unlock(&m_lock);
+
+    return m_hostDriverCaps;
+}
+
diff --git a/system/egl/eglDisplay.h b/system/egl/eglDisplay.h
new file mode 100644
index 0000000..1e5d5c2
--- /dev/null
+++ b/system/egl/eglDisplay.h
@@ -0,0 +1,130 @@
+/*
+* Copyright (C) 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#ifndef _SYSTEM_EGL_DISPLAY_H
+#define _SYSTEM_EGL_DISPLAY_H
+
+#include <assert.h>
+#include <pthread.h>
+#include "glUtils.h"
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+#include "EGLClientIface.h"
+#include "GLClientState.h"
+
+#if __cplusplus >= 201103L
+#include <unordered_set>
+#else
+#include <hash_set>
+#endif
+
+#include <map>
+
+#define ATTRIBUTE_NONE (-1)
+//FIXME: are we in this namespace?
+using namespace android;
+
+class eglDisplay
+{
+public:
+    eglDisplay();
+    ~eglDisplay();
+
+    bool initialize(EGLClient_eglInterface *eglIface);
+    void terminate();
+
+    int getVersionMajor() const { return m_major; }
+    int getVersionMinor() const { return m_minor; }
+    bool initialized() const { return m_initialized; }
+
+    const char *queryString(EGLint name);
+
+    const EGLClient_glesInterface *gles_iface() const { return m_gles_iface; }
+    const EGLClient_glesInterface *gles2_iface() const { return m_gles2_iface; }
+
+    int     getNumConfigs(){ return m_numConfigs; }
+
+    EGLConfig getConfigAtIndex(uint32_t index) const;
+    uint32_t getIndexOfConfig(EGLConfig config) const;
+    bool isValidConfig(EGLConfig cfg) const;
+
+    EGLBoolean  getConfigAttrib(EGLConfig config, EGLint attrib, EGLint * value);
+    EGLBoolean  setConfigAttrib(EGLConfig config, EGLint attrib, EGLint value);
+    EGLBoolean getConfigGLPixelFormat(EGLConfig config, GLenum * format);
+    EGLBoolean getConfigNativePixelFormat(EGLConfig config, uint32_t * format);
+
+    void     dumpConfig(EGLConfig config);
+
+    void onCreateContext(EGLContext ctx);
+    void onCreateSurface(EGLSurface surface);
+
+    void onDestroyContext(EGLContext ctx);
+    void onDestroySurface(EGLSurface surface);
+
+    bool isContext(EGLContext ctx);
+    bool isSurface(EGLSurface ctx);
+
+    // Needs a current context (put this near eglMakeCurrent)
+    HostDriverCaps getHostDriverCaps(int majorVersion, int minorVersion);
+
+private:
+    EGLClient_glesInterface *loadGLESClientAPI(const char *libName,
+                                               EGLClient_eglInterface *eglIface,
+                                               void **libHandle);
+    EGLBoolean getAttribValue(EGLConfig config, EGLint attribIdxi, EGLint * value);
+    EGLBoolean setAttribValue(EGLConfig config, EGLint attribIdxi, EGLint value);
+    void     processConfigs();
+
+private:
+    pthread_mutex_t m_lock;
+    bool m_initialized;
+    int  m_major;
+    int  m_minor;
+    int  m_hostRendererVersion;
+    int  m_numConfigs;
+    int  m_numConfigAttribs;
+
+    /* This is the mapping between an attribute name to it's index in any given config */
+    std::map<EGLint, EGLint>    m_attribs;
+    /* This is an array of all config's attributes values stored in the following sequencial fasion (read: v[c,a] = the value of attribute <a> of config <c>)
+     * v[0,0],..,v[0,m_numConfigAttribs-1],
+     *...
+     * v[m_numConfigs-1,0],..,v[m_numConfigs-1,m_numConfigAttribs-1]
+     */
+    EGLint *m_configs;
+    EGLClient_glesInterface *m_gles_iface;
+    EGLClient_glesInterface *m_gles2_iface;
+    char *m_versionString;
+    char *m_vendorString;
+    char *m_extensionString;
+
+#if __cplusplus >= 201103L
+    typedef std::unordered_set<EGLContext> EGLContextSet;
+    typedef std::unordered_set<EGLSurface> EGLSurfaceSet;
+#else
+    typedef std::hash_set<EGLContext> EGLContextSet;
+    typedef std::hash_set<EGLSurface> EGLSurfaceSet;
+#endif
+    EGLContextSet m_contexts;
+    EGLSurfaceSet m_surfaces;
+    pthread_mutex_t m_ctxLock;
+    pthread_mutex_t m_surfaceLock;
+
+    int m_hostDriverCaps_knownMajorVersion;
+    int m_hostDriverCaps_knownMinorVersion;
+    HostDriverCaps m_hostDriverCaps;
+};
+
+#endif
diff --git a/system/egl/eglSync.h b/system/egl/eglSync.h
new file mode 100644
index 0000000..9f84a4e
--- /dev/null
+++ b/system/egl/eglSync.h
@@ -0,0 +1,42 @@
+/*
+* Copyright (C) 2016 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#ifndef _EGL_SYNC_H
+#define _EGL_SYNC_H
+
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+#include <inttypes.h>
+
+// EGLSync_t is our driver's internal representation
+// of EGLSyncKHR objects.
+// The components are:
+// a. handle: reference host sync objects
+// b. android_native_fence_fd: for ANDROID_native_fence_sync
+// when we want to wrap native fence fd's in EGLSyncKHR's
+// c. type/status: track status of fence so SyncAttrib works
+struct EGLSync_t {
+    EGLSync_t(uint64_t handle_in) :
+        handle(handle_in), android_native_fence_fd(-1),
+        type(EGL_SYNC_FENCE_KHR),
+        status(EGL_UNSIGNALED_KHR) { }
+    uint64_t handle;
+    int android_native_fence_fd;
+    EGLint type;
+    EGLint status;
+};
+
+#endif
diff --git a/system/egl/egl_ftable.h b/system/egl/egl_ftable.h
new file mode 100644
index 0000000..16d130c
--- /dev/null
+++ b/system/egl/egl_ftable.h
@@ -0,0 +1,64 @@
+/*
+* Copyright (C) 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+static const struct _egl_funcs_by_name {
+    const char *name;
+    void *proc;
+} egl_funcs_by_name[] = {
+    {"eglGetError", (void *)eglGetError},
+    {"eglGetDisplay", (void *)eglGetDisplay},
+    {"eglInitialize", (void *)eglInitialize},
+    {"eglTerminate", (void *)eglTerminate},
+    {"eglQueryString", (void *)eglQueryString},
+    {"eglGetConfigs", (void *)eglGetConfigs},
+    {"eglChooseConfig", (void *)eglChooseConfig},
+    {"eglGetConfigAttrib", (void *)eglGetConfigAttrib},
+    {"eglCreateWindowSurface", (void *)eglCreateWindowSurface},
+    {"eglCreatePbufferSurface", (void *)eglCreatePbufferSurface},
+    {"eglCreatePixmapSurface", (void *)eglCreatePixmapSurface},
+    {"eglDestroySurface", (void *)eglDestroySurface},
+    {"eglQuerySurface", (void *)eglQuerySurface},
+    {"eglBindAPI", (void *)eglBindAPI},
+    {"eglQueryAPI", (void *)eglQueryAPI},
+    {"eglWaitClient", (void *)eglWaitClient},
+    {"eglReleaseThread", (void *)eglReleaseThread},
+    {"eglCreatePbufferFromClientBuffer", (void *)eglCreatePbufferFromClientBuffer},
+    {"eglSurfaceAttrib", (void *)eglSurfaceAttrib},
+    {"eglBindTexImage", (void *)eglBindTexImage},
+    {"eglReleaseTexImage", (void *)eglReleaseTexImage},
+    {"eglSwapInterval", (void *)eglSwapInterval},
+    {"eglCreateContext", (void *)eglCreateContext},
+    {"eglDestroyContext", (void *)eglDestroyContext},
+    {"eglMakeCurrent", (void *)eglMakeCurrent},
+    {"eglGetCurrentContext", (void *)eglGetCurrentContext},
+    {"eglGetCurrentSurface", (void *)eglGetCurrentSurface},
+    {"eglGetCurrentDisplay", (void *)eglGetCurrentDisplay},
+    {"eglQueryContext", (void *)eglQueryContext},
+    {"eglWaitGL", (void *)eglWaitGL},
+    {"eglWaitNative", (void *)eglWaitNative},
+    {"eglSwapBuffers", (void *)eglSwapBuffers},
+    {"eglCopyBuffers", (void *)eglCopyBuffers},
+    {"eglGetProcAddress", (void *)eglGetProcAddress},
+    {"eglLockSurfaceKHR", (void *)eglLockSurfaceKHR},
+    {"eglUnlockSurfaceKHR", (void *)eglUnlockSurfaceKHR},
+    {"eglCreateImageKHR", (void *)eglCreateImageKHR},
+    {"eglDestroyImageKHR", (void *)eglDestroyImageKHR},
+    {"eglCreateSyncKHR", (void *)eglCreateSyncKHR},
+    {"eglDestroySyncKHR", (void *)eglDestroySyncKHR},
+    {"eglClientWaitSyncKHR", (void *)eglClientWaitSyncKHR},
+    {"eglGetSyncAttribKHR", (void *)eglGetSyncAttribKHR}
+};
+
+static const int egl_num_funcs = sizeof(egl_funcs_by_name) / sizeof(struct _egl_funcs_by_name);
diff --git a/system/egl/goldfish_sync.h b/system/egl/goldfish_sync.h
new file mode 100644
index 0000000..a9e0594
--- /dev/null
+++ b/system/egl/goldfish_sync.h
@@ -0,0 +1,114 @@
+// Copyright 2016 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef ANDROID_INCLUDE_HARDWARE_GOLDFISH_SYNC_H
+#define ANDROID_INCLUDE_HARDWARE_GOLDFISH_SYNC_H
+
+#define GOLDFISH_SYNC_VULKAN_SEMAPHORE_SYNC 0x00000001
+#define GOLDFISH_SYNC_VULKAN_QSRI 0x00000002
+
+#ifdef HOST_BUILD
+
+static __inline__ int goldfish_sync_open() {
+    return 0;
+}
+
+static __inline__ int goldfish_sync_close(int) {
+    return 0;
+}
+
+static __inline__ int goldfish_sync_queue_work(int,
+                                               uint64_t,
+                                               uint64_t,
+                                               int*) {
+    return 0;
+}
+
+static __inline__ int goldfish_sync_signal(int goldfish_sync_fd) {
+    return 0;
+}
+
+#else
+
+#include <errno.h>
+#include <linux/ioctl.h>
+#include <linux/types.h>
+#include <sys/cdefs.h>
+#include <sys/ioctl.h>
+#include <sys/unistd.h>
+#include <fcntl.h>
+
+// Make it conflict with ioctls that are not likely to be used
+// in the emulator.
+//
+// '@'	00-0F	linux/radeonfb.h	conflict!
+// '@'	00-0F	drivers/video/aty/aty128fb.c	conflict!
+#define GOLDFISH_SYNC_IOC_MAGIC	'@'
+
+struct goldfish_sync_ioctl_info {
+    uint64_t host_glsync_handle_in;
+    uint64_t host_syncthread_handle_in;
+    int fence_fd_out;
+};
+
+#define GOLDFISH_SYNC_IOC_QUEUE_WORK	_IOWR(GOLDFISH_SYNC_IOC_MAGIC, 0, struct goldfish_sync_ioctl_info)
+#define GOLDFISH_SYNC_IOC_SIGNAL	_IOWR(GOLDFISH_SYNC_IOC_MAGIC, 1, struct goldfish_sync_ioctl_info)
+
+static __inline__ int goldfish_sync_open() {
+    return open("/dev/goldfish_sync", O_RDWR);
+}
+
+static __inline__ int goldfish_sync_close(int sync_fd) {
+    return close(sync_fd);
+}
+
+static unsigned int sQueueWorkIoctlCmd = GOLDFISH_SYNC_IOC_QUEUE_WORK;
+
+// If we are running on a 64-bit kernel.
+static unsigned int sQueueWorkIoctlCmd64Kernel = 0xc0184000;
+
+static __inline__ int goldfish_sync_queue_work(int goldfish_sync_fd,
+                                                uint64_t host_glsync,
+                                                uint64_t host_thread,
+                                                int* fd_out) {
+
+    struct goldfish_sync_ioctl_info info;
+    int err;
+
+    info.host_glsync_handle_in = host_glsync;
+    info.host_syncthread_handle_in = host_thread;
+    info.fence_fd_out = -1;
+
+    err = ioctl(goldfish_sync_fd, sQueueWorkIoctlCmd, &info);
+
+    if (err < 0 && errno == ENOTTY) {
+        sQueueWorkIoctlCmd = sQueueWorkIoctlCmd64Kernel;
+        err = ioctl(goldfish_sync_fd, sQueueWorkIoctlCmd, &info);
+        if (err < 0) {
+            sQueueWorkIoctlCmd = GOLDFISH_SYNC_IOC_QUEUE_WORK;
+        }
+    }
+
+    if (fd_out) *fd_out = info.fence_fd_out;
+
+    return err;
+}
+
+static __inline__ int goldfish_sync_signal(int goldfish_sync_fd) {
+    return ioctl(goldfish_sync_fd, GOLDFISH_SYNC_IOC_SIGNAL, 0);
+}
+
+#endif // !HOST_BUILD
+
+#endif
diff --git a/system/gralloc/Android.mk b/system/gralloc/Android.mk
new file mode 100644
index 0000000..20c7606
--- /dev/null
+++ b/system/gralloc/Android.mk
@@ -0,0 +1,36 @@
+ifneq (false,$(BUILD_EMULATOR_OPENGL_DRIVER))
+
+LOCAL_PATH := $(call my-dir)
+
+define gralloc_recipe
+$$(call emugl-begin-shared-library,gralloc.$(1))
+$$(call emugl-import,libGLESv1_enc lib_renderControl_enc libOpenglSystemCommon)
+$$(call emugl-set-shared-library-subpath,hw)
+
+LOCAL_CFLAGS += -DLOG_TAG=\"gralloc_$(1)\"
+LOCAL_CFLAGS += -Wno-missing-field-initializers
+LOCAL_CFLAGS += -Wno-gnu-designator
+
+LOCAL_SRC_FILES := gralloc_old.cpp
+
+ifneq (true,$(GOLDFISH_OPENGL_BUILD_FOR_HOST))
+LOCAL_SHARED_LIBRARIES += libdl
+
+ifeq (true,$(GFXSTREAM))
+LOCAL_CFLAGS += -DVIRTIO_GPU
+LOCAL_C_INCLUDES += external/libdrm external/minigbm/cros_gralloc
+LOCAL_SHARED_LIBRARIES += libdrm
+endif
+
+endif
+
+$$(call emugl-end-module)
+endef  # define gralloc_recipe
+
+$(eval $(call gralloc_recipe,goldfish))
+$(eval $(call gralloc_recipe,ranchu))
+ifeq ($(TARGET_BOARD_PLATFORM),brilloemulator)
+$(eval $(call gralloc_recipe,$(TARGET_BOARD_PLATFORM)))
+endif  # defined(BRILLO)
+
+endif # BUILD_EMULATOR_OPENGL_DRIVER != false
diff --git a/system/gralloc/CMakeLists.txt b/system/gralloc/CMakeLists.txt
new file mode 100644
index 0000000..7f6799e
--- /dev/null
+++ b/system/gralloc/CMakeLists.txt
@@ -0,0 +1,20 @@
+# This is an autogenerated file! Do not edit!
+# instead run make from .../device/generic/goldfish-opengl
+# which will re-generate this file.
+android_validate_sha256("${GOLDFISH_DEVICE_ROOT}/system/gralloc/Android.mk" "f5a55e94afe1130c03c592aa23bf353e77fd9c3db5649112c23b53ea687cac1b")
+set(gralloc.goldfish_src gralloc_old.cpp)
+android_add_library(TARGET gralloc.goldfish SHARED LICENSE Apache-2.0 SRC gralloc_old.cpp)
+target_include_directories(gralloc.goldfish PRIVATE ${GOLDFISH_DEVICE_ROOT}/system/OpenglSystemCommon/bionic-include ${GOLDFISH_DEVICE_ROOT}/system/OpenglSystemCommon ${GOLDFISH_DEVICE_ROOT}/bionic/libc/private ${GOLDFISH_DEVICE_ROOT}/bionic/libc/platform ${GOLDFISH_DEVICE_ROOT}/system/vulkan_enc ${GOLDFISH_DEVICE_ROOT}/shared/gralloc_cb/include ${GOLDFISH_DEVICE_ROOT}/shared/GoldfishAddressSpace/include ${GOLDFISH_DEVICE_ROOT}/platform/include ${GOLDFISH_DEVICE_ROOT}/system/GLESv2_enc ${GOLDFISH_DEVICE_ROOT}/system/renderControl_enc ${GOLDFISH_DEVICE_ROOT}/system/GLESv1_enc ${GOLDFISH_DEVICE_ROOT}/shared/OpenglCodecCommon ${GOLDFISH_DEVICE_ROOT}/android-emu ${GOLDFISH_DEVICE_ROOT}/shared/qemupipe/include-types ${GOLDFISH_DEVICE_ROOT}/shared/qemupipe/include ${GOLDFISH_DEVICE_ROOT}/./host/include/libOpenglRender ${GOLDFISH_DEVICE_ROOT}/./system/include ${GOLDFISH_DEVICE_ROOT}/./../../../external/qemu/android/android-emugl/guest)
+target_compile_definitions(gralloc.goldfish PRIVATE "-DPLATFORM_SDK_VERSION=29" "-DGOLDFISH_HIDL_GRALLOC" "-DHOST_BUILD" "-DANDROID" "-DGL_GLEXT_PROTOTYPES" "-DPAGE_SIZE=4096" "-DGFXSTREAM" "-DENABLE_ANDROID_HEALTH_MONITOR" "-DLOG_TAG=\"gralloc_goldfish\"")
+target_compile_options(gralloc.goldfish PRIVATE "-fvisibility=default" "-Wno-unused-parameter" "-Wno-missing-field-initializers" "-Wno-gnu-designator")
+target_link_libraries(gralloc.goldfish PRIVATE OpenglSystemCommon android-emu-shared vulkan_enc gui log GLESv2_enc _renderControl_enc GLESv1_enc OpenglCodecCommon_host cutils utils androidemu PRIVATE gralloc_cb_host GoldfishAddressSpace_host platform_host qemupipe_host)
+# This is an autogenerated file! Do not edit!
+# instead run make from .../device/generic/goldfish-opengl
+# which will re-generate this file.
+android_validate_sha256("${GOLDFISH_DEVICE_ROOT}/system/gralloc/Android.mk" "f5a55e94afe1130c03c592aa23bf353e77fd9c3db5649112c23b53ea687cac1b")
+set(gralloc.ranchu_src gralloc_old.cpp)
+android_add_library(TARGET gralloc.ranchu SHARED LICENSE Apache-2.0 SRC gralloc_old.cpp)
+target_include_directories(gralloc.ranchu PRIVATE ${GOLDFISH_DEVICE_ROOT}/system/OpenglSystemCommon/bionic-include ${GOLDFISH_DEVICE_ROOT}/system/OpenglSystemCommon ${GOLDFISH_DEVICE_ROOT}/bionic/libc/private ${GOLDFISH_DEVICE_ROOT}/bionic/libc/platform ${GOLDFISH_DEVICE_ROOT}/system/vulkan_enc ${GOLDFISH_DEVICE_ROOT}/shared/gralloc_cb/include ${GOLDFISH_DEVICE_ROOT}/shared/GoldfishAddressSpace/include ${GOLDFISH_DEVICE_ROOT}/platform/include ${GOLDFISH_DEVICE_ROOT}/system/GLESv2_enc ${GOLDFISH_DEVICE_ROOT}/system/renderControl_enc ${GOLDFISH_DEVICE_ROOT}/system/GLESv1_enc ${GOLDFISH_DEVICE_ROOT}/shared/OpenglCodecCommon ${GOLDFISH_DEVICE_ROOT}/android-emu ${GOLDFISH_DEVICE_ROOT}/shared/qemupipe/include-types ${GOLDFISH_DEVICE_ROOT}/shared/qemupipe/include ${GOLDFISH_DEVICE_ROOT}/./host/include/libOpenglRender ${GOLDFISH_DEVICE_ROOT}/./system/include ${GOLDFISH_DEVICE_ROOT}/./../../../external/qemu/android/android-emugl/guest)
+target_compile_definitions(gralloc.ranchu PRIVATE "-DPLATFORM_SDK_VERSION=29" "-DGOLDFISH_HIDL_GRALLOC" "-DHOST_BUILD" "-DANDROID" "-DGL_GLEXT_PROTOTYPES" "-DPAGE_SIZE=4096" "-DGFXSTREAM" "-DENABLE_ANDROID_HEALTH_MONITOR" "-DLOG_TAG=\"gralloc_ranchu\"")
+target_compile_options(gralloc.ranchu PRIVATE "-fvisibility=default" "-Wno-unused-parameter" "-Wno-missing-field-initializers" "-Wno-gnu-designator")
+target_link_libraries(gralloc.ranchu PRIVATE OpenglSystemCommon android-emu-shared vulkan_enc gui log GLESv2_enc _renderControl_enc GLESv1_enc OpenglCodecCommon_host cutils utils androidemu PRIVATE gralloc_cb_host GoldfishAddressSpace_host platform_host qemupipe_host)
\ No newline at end of file
diff --git a/system/gralloc/gralloc_common.h b/system/gralloc/gralloc_common.h
new file mode 100644
index 0000000..6dba9cd
--- /dev/null
+++ b/system/gralloc/gralloc_common.h
@@ -0,0 +1,49 @@
+/*
+* Copyright 2019 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#ifndef __GRALLOC_COMMON_H__
+#define __GRALLOC_COMMON_H__
+
+// Tell the emulator which gralloc formats
+// need special handling.
+enum EmulatorFrameworkFormat {
+    FRAMEWORK_FORMAT_GL_COMPATIBLE = 0,
+    FRAMEWORK_FORMAT_YV12 = 1,
+    FRAMEWORK_FORMAT_YUV_420_888 = 2,              // (Y+)(U+)(V+)
+};
+
+#ifndef GL_RGBA16F
+#define GL_RGBA16F                        0x881A
+#endif // GL_RGBA16F
+
+#ifndef GL_HALF_FLOAT
+#define GL_HALF_FLOAT                     0x140B
+#endif // GL_HALF_FLOAT
+
+#ifndef GL_RGB10_A2
+#define GL_RGB10_A2                       0x8059
+#endif // GL_RGB10_A2
+
+#ifndef GL_UNSIGNED_INT_2_10_10_10_REV
+#define GL_UNSIGNED_INT_2_10_10_10_REV    0x8368
+#endif // GL_UNSIGNED_INT_2_10_10_10_REV
+
+// defined in hardware/interfaces/graphics/common/1.0/types.hal
+#ifndef GOLDFISH_GRALLOC_USAGE_GPU_DATA_BUFFER
+#define GOLDFISH_GRALLOC_USAGE_GPU_DATA_BUFFER (1ULL << 24)
+#endif // GOLDFISH_GRALLOC_USAGE_GPU_DATA_BUFFER
+
+#endif //__GRALLOC_COMMON_H__
diff --git a/system/gralloc/gralloc_old.cpp b/system/gralloc/gralloc_old.cpp
new file mode 100644
index 0000000..080b34c
--- /dev/null
+++ b/system/gralloc/gralloc_old.cpp
@@ -0,0 +1,1670 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include <cutils/ashmem.h>
+#include <dlfcn.h>
+#include <errno.h>
+#include <gralloc_cb_bp.h>
+#include <hardware/gralloc.h>
+#include <limits.h>
+#include <pthread.h>
+#include <qemu_pipe_bp.h>
+#include <string.h>
+#include <sys/mman.h>
+#include <unistd.h>
+
+#include "FormatConversions.h"
+#include "HostConnection.h"
+#include "ProcessPipe.h"
+#include "ThreadInfo.h"
+#include "aemu/base/threads/AndroidThread.h"
+#include "glUtils.h"
+#include "goldfish_address_space.h"
+#include "goldfish_dma.h"
+#include "gralloc_common.h"
+
+#if PLATFORM_SDK_VERSION < 26
+#include <cutils/log.h>
+#else
+#include <log/log.h>
+#endif
+#include <cutils/properties.h>
+
+#include <set>
+#include <map>
+#include <vector>
+#include <string>
+#include <sstream>
+
+/* Set to 1 or 2 to enable debug traces */
+#define DEBUG  0
+
+#ifndef D
+
+#if DEBUG >= 1
+#  define D(...)   ALOGD(__VA_ARGS__)
+#else
+#  define D(...)   ((void)0)
+#endif
+
+#endif
+
+#if DEBUG >= 2
+#  define DD(...)  ALOGD(__VA_ARGS__)
+#else
+#  define DD(...)  ((void)0)
+#endif
+
+#define DBG_FUNC DBG("%s\n", __FUNCTION__)
+
+#define GOLDFISH_OFFSET_UNIT 8
+
+#define OMX_COLOR_FormatYUV420Planar 19
+
+#ifdef GOLDFISH_HIDL_GRALLOC
+static const bool isHidlGralloc = true;
+#else
+static const bool isHidlGralloc = false;
+#endif
+
+using android::base::guest::getCurrentThreadId;
+
+const uint32_t CB_HANDLE_MAGIC_OLD = CB_HANDLE_MAGIC_BASE | 0x1;
+const int kBufferFdIndex = 0;
+const int kHostHandleRefCountIndex = 1;
+
+struct cb_handle_old_t : public cb_handle_t {
+    cb_handle_old_t(int p_fd, int p_ashmemSize, int p_usage,
+                    int p_width, int p_height,
+                    int p_format, int p_glFormat, int p_glType)
+            : cb_handle_t(CB_HANDLE_MAGIC_OLD,
+                          0,
+                          p_format,
+                          p_width,
+                          p_ashmemSize,
+                          ~uint64_t(0)),
+              usage(p_usage),
+              width(p_width),
+              height(p_height),
+              glFormat(p_glFormat),
+              glType(p_glType),
+              ashmemBasePid(0),
+              mappedPid(0),
+              bufferPtrLo(0),
+              bufferPtrHi(0),
+              lockedLeft(0),
+              lockedTop(0),
+              lockedWidth(0),
+              lockedHeight(0) {
+        fds[kBufferFdIndex] = p_fd;
+        numFds = 1;
+        numInts = CB_HANDLE_NUM_INTS(numFds);
+    }
+
+    bool hasRefcountPipe() const {
+        return qemu_pipe_valid(fds[kHostHandleRefCountIndex]);
+    }
+
+    void setRefcountPipeFd(QEMU_PIPE_HANDLE fd) {
+        if (qemu_pipe_valid(fd)) {
+            numFds++;
+        }
+        fds[kHostHandleRefCountIndex] = fd;
+        numInts = CB_HANDLE_NUM_INTS(numFds);
+    }
+
+    bool canBePosted() const {
+        return (0 != (usage & GRALLOC_USAGE_HW_FB));
+    }
+
+    void* getBufferPtr() const {
+        const uint64_t addr = (uint64_t(bufferPtrHi) << 32) | bufferPtrLo;
+        return reinterpret_cast<void*>(static_cast<uintptr_t>(addr));
+    }
+
+    void setBufferPtr(void* ptr) {
+        const uint64_t addr = static_cast<uint64_t>(reinterpret_cast<uintptr_t>(ptr));
+        bufferPtrLo = uint32_t(addr);
+        bufferPtrHi = uint32_t(addr >> 32);
+    }
+
+    bool isValid() const {
+        return (version == sizeof(native_handle)) && (magic == CB_HANDLE_MAGIC_OLD);
+    }
+
+    static cb_handle_old_t* from(void* p) {
+        if (!p) { return NULL; }
+        cb_handle_old_t* cb = static_cast<cb_handle_old_t*>(p);
+        return cb->isValid() ? cb : NULL;
+    }
+
+    static const cb_handle_old_t* from(const void* p) {
+        return from(const_cast<void*>(p));
+    }
+
+    static cb_handle_old_t* from_unconst(const void* p) {
+        return from(const_cast<void*>(p));
+    }
+
+    uint32_t usage;         // usage bits the buffer was created with
+    uint32_t width;         // buffer width
+    uint32_t height;        // buffer height
+    uint32_t glFormat;      // OpenGL format enum used for host h/w color buffer
+    uint32_t glType;        // OpenGL type enum used when uploading to host
+    int32_t ashmemBasePid;      // process id which mapped the ashmem region
+    int32_t mappedPid;          // process id which succeeded gralloc_register call
+    uint32_t bufferPtrLo;
+    uint32_t bufferPtrHi;
+    uint32_t lockedLeft;    // region of buffer locked for s/w write
+    uint32_t lockedTop;
+    uint32_t lockedWidth;
+    uint32_t lockedHeight;
+};
+
+int32_t* getOpenCountPtr(const cb_handle_old_t* cb) {
+    return ((int32_t*)cb->getBufferPtr()) + 1;
+}
+
+uint32_t getAshmemColorOffset(cb_handle_old_t* cb) {
+    uint32_t res = 0;
+    if (cb->canBePosted()) res = GOLDFISH_OFFSET_UNIT;
+    if (isHidlGralloc) res = GOLDFISH_OFFSET_UNIT * 2;
+    return res;
+}
+
+//
+// our private gralloc module structure
+//
+struct private_module_t {
+    gralloc_module_t base;
+};
+
+/* If not NULL, this is a pointer to the fallback module.
+ * This really is gralloc.default, which we'll use if we detect
+ * that the emulator we're running in does not support GPU emulation.
+ */
+static gralloc_module_t*  sFallback;
+static pthread_once_t     sFallbackOnce = PTHREAD_ONCE_INIT;
+
+static void fallback_init(void);  // forward
+
+//
+// Our gralloc device structure (alloc interface)
+//
+struct gralloc_device_t {
+    alloc_device_t  device;
+    std::set<buffer_handle_t> allocated;
+    pthread_mutex_t lock;
+};
+
+struct gralloc_memregions_t {
+    typedef std::map<void*, uint32_t> MemRegionMap;  // base -> refCount
+    typedef MemRegionMap::const_iterator mem_region_handle_t;
+
+    gralloc_memregions_t() {
+        pthread_mutex_init(&lock, NULL);
+    }
+
+    MemRegionMap ashmemRegions;
+    pthread_mutex_t lock;
+};
+
+#define INITIAL_DMA_REGION_SIZE 4096
+struct gralloc_dmaregion_t {
+    gralloc_dmaregion_t(ExtendedRCEncoderContext *rcEnc)
+      : host_memory_allocator(
+            rcEnc->featureInfo_const()->hasSharedSlotsHostMemoryAllocator),
+        sz(INITIAL_DMA_REGION_SIZE),
+        refcount(0),
+        bigbufCount(0) {
+        memset(&goldfish_dma, 0, sizeof(goldfish_dma));
+        pthread_mutex_init(&lock, NULL);
+
+        if (rcEnc->hasDirectMem()) {
+            host_memory_allocator.hostMalloc(&address_space_block, sz);
+        } else if (rcEnc->getDmaVersion() > 0) {
+            goldfish_dma_create_region(sz, &goldfish_dma);
+        }
+    }
+
+    goldfish_dma_context goldfish_dma;
+    GoldfishAddressSpaceHostMemoryAllocator host_memory_allocator;
+    GoldfishAddressSpaceBlock address_space_block;
+    uint32_t sz;
+    uint32_t refcount;
+    pthread_mutex_t lock;
+    uint32_t bigbufCount;
+};
+
+// global device instance
+static gralloc_memregions_t* s_memregions = NULL;
+static gralloc_dmaregion_t* s_grdma = NULL;
+
+static gralloc_memregions_t* init_gralloc_memregions() {
+    if (!s_memregions) {
+        s_memregions = new gralloc_memregions_t;
+    }
+    return s_memregions;
+}
+
+static bool has_DMA_support(const ExtendedRCEncoderContext *rcEnc) {
+    return rcEnc->getDmaVersion() > 0 || rcEnc->hasDirectMem();
+}
+
+static gralloc_dmaregion_t* init_gralloc_dmaregion(ExtendedRCEncoderContext *rcEnc) {
+    D("%s: call\n", __func__);
+    if (!s_grdma) {
+        s_grdma = new gralloc_dmaregion_t(rcEnc);
+    }
+    return s_grdma;
+}
+
+static void get_gralloc_region(ExtendedRCEncoderContext *rcEnc) {
+    gralloc_dmaregion_t* grdma = init_gralloc_dmaregion(rcEnc);
+
+    pthread_mutex_lock(&grdma->lock);
+    grdma->refcount++;
+    D("%s: call. refcount: %u\n", __func__, grdma->refcount);
+    pthread_mutex_unlock(&grdma->lock);
+}
+
+static void resize_gralloc_dmaregion_locked(gralloc_dmaregion_t* grdma, uint32_t new_sz) {
+    if (grdma->goldfish_dma.mapped_addr) {
+        goldfish_dma_unmap(&grdma->goldfish_dma);
+    }
+    close(grdma->goldfish_dma.fd);
+    goldfish_dma_create_region(new_sz, &grdma->goldfish_dma);
+    grdma->sz = new_sz;
+}
+
+// max dma size: 2x 4K rgba8888
+#define MAX_DMA_SIZE 66355200
+
+static bool put_gralloc_region_direct_mem_locked(gralloc_dmaregion_t* grdma, uint32_t /* sz, unused */) {
+    const bool shouldDelete = !grdma->refcount;
+    if (shouldDelete) {
+        grdma->host_memory_allocator.hostFree(&grdma->address_space_block);
+    }
+
+    return shouldDelete;
+}
+
+static bool put_gralloc_region_dma_locked(gralloc_dmaregion_t* grdma, uint32_t sz) {
+    D("%s: call. refcount before: %u\n", __func__, grdma->refcount);
+    grdma->refcount--;
+    if (sz > MAX_DMA_SIZE && grdma->bigbufCount) {
+        grdma->bigbufCount--;
+    }
+    bool shouldDelete = !grdma->refcount;
+    if (shouldDelete) {
+        D("%s: should delete!\n", __func__);
+        resize_gralloc_dmaregion_locked(grdma, INITIAL_DMA_REGION_SIZE);
+        D("%s: done\n", __func__);
+    }
+    D("%s: exit\n", __func__);
+    return shouldDelete;
+}
+
+static bool put_gralloc_region(ExtendedRCEncoderContext *rcEnc, uint32_t sz) {
+    bool shouldDelete;
+
+    gralloc_dmaregion_t* grdma = init_gralloc_dmaregion(rcEnc);
+    pthread_mutex_lock(&grdma->lock);
+    if (rcEnc->hasDirectMem()) {
+        shouldDelete = put_gralloc_region_direct_mem_locked(grdma, sz);
+    } else if (rcEnc->getDmaVersion() > 0) {
+        shouldDelete = put_gralloc_region_dma_locked(grdma, sz);
+    } else {
+        shouldDelete = false;
+    }
+    pthread_mutex_unlock(&grdma->lock);
+
+    return shouldDelete;
+}
+
+static void gralloc_dmaregion_register_ashmem_direct_mem_locked(gralloc_dmaregion_t* grdma, uint32_t new_sz) {
+    if (new_sz == grdma->sz) return;
+
+    GoldfishAddressSpaceHostMemoryAllocator* allocator = &grdma->host_memory_allocator;
+    GoldfishAddressSpaceBlock* block = &grdma->address_space_block;
+    allocator->hostFree(block);
+    allocator->hostMalloc(block, new_sz);
+    grdma->sz = new_sz;
+}
+
+static void gralloc_dmaregion_register_ashmem_dma_locked(gralloc_dmaregion_t* grdma, uint32_t new_sz) {
+    if (new_sz != grdma->sz) {
+        if (new_sz > MAX_DMA_SIZE)  {
+            D("%s: requested sz %u too large (limit %u), set to fallback.",
+              __func__, new_sz, MAX_DMA_SIZE);
+            grdma->bigbufCount++;
+        } else {
+            D("%s: change sz from %u to %u", __func__, grdma->sz, new_sz);
+            resize_gralloc_dmaregion_locked(grdma, new_sz);
+        }
+    }
+    if (!grdma->goldfish_dma.mapped_addr) {
+        goldfish_dma_map(&grdma->goldfish_dma);
+    }
+}
+
+static void gralloc_dmaregion_register_ashmem(ExtendedRCEncoderContext *rcEnc, uint32_t sz) {
+    gralloc_dmaregion_t* grdma = init_gralloc_dmaregion(rcEnc);
+
+    pthread_mutex_lock(&grdma->lock);
+    D("%s: for sz %u, refcount %u", __func__, sz, grdma->refcount);
+    const uint32_t new_sz = std::max(grdma->sz, sz);
+
+    if (rcEnc->hasDirectMem()) {
+        gralloc_dmaregion_register_ashmem_direct_mem_locked(grdma, new_sz);
+    } else if (rcEnc->getDmaVersion() > 0) {
+        gralloc_dmaregion_register_ashmem_dma_locked(grdma, new_sz);
+    } else {
+        ALOGE("%s: unexpected DMA type", __func__);
+    }
+
+    pthread_mutex_unlock(&grdma->lock);
+}
+
+static void get_mem_region(void* ashmemBase) {
+    D("%s: call for %p", __func__, ashmemBase);
+
+    gralloc_memregions_t* memregions = init_gralloc_memregions();
+
+    pthread_mutex_lock(&memregions->lock);
+    ++memregions->ashmemRegions[ashmemBase];
+    pthread_mutex_unlock(&memregions->lock);
+}
+
+static bool put_mem_region(ExtendedRCEncoderContext *, void* ashmemBase) {
+    D("%s: call for %p", __func__, ashmemBase);
+
+    gralloc_memregions_t* memregions = init_gralloc_memregions();
+    bool shouldRemove;
+
+    pthread_mutex_lock(&memregions->lock);
+    gralloc_memregions_t::MemRegionMap::iterator i = memregions->ashmemRegions.find(ashmemBase);
+    if (i == memregions->ashmemRegions.end()) {
+        shouldRemove = true;
+        ALOGE("%s: error: tried to put a nonexistent mem region (%p)!", __func__, ashmemBase);
+    } else {
+        shouldRemove = --i->second == 0;
+        if (shouldRemove) {
+            memregions->ashmemRegions.erase(i);
+        }
+    }
+    pthread_mutex_unlock(&memregions->lock);
+
+    return shouldRemove;
+}
+
+#if DEBUG
+static void dump_regions(ExtendedRCEncoderContext *) {
+    gralloc_memregions_t* memregions = init_gralloc_memregions();
+    gralloc_memregions_t::mem_region_handle_t curr = memregions->ashmemRegions.begin();
+    std::stringstream res;
+    for (; curr != memregions->ashmemRegions.end(); ++curr) {
+        res << "\tashmem base " << curr->first << " refcount " << curr->second << "\n";
+    }
+    ALOGD("ashmem region dump [\n%s]", res.str().c_str());
+}
+#endif
+
+static void get_ashmem_region(ExtendedRCEncoderContext *rcEnc, cb_handle_old_t *cb) {
+#if DEBUG
+    dump_regions(rcEnc);
+#endif
+
+    get_mem_region(cb->getBufferPtr());
+
+#if DEBUG
+    dump_regions(rcEnc);
+#endif
+
+    get_gralloc_region(rcEnc);
+}
+
+static bool put_ashmem_region(ExtendedRCEncoderContext *rcEnc, cb_handle_old_t *cb) {
+#if DEBUG
+    dump_regions(rcEnc);
+#endif
+
+    const bool should_unmap = put_mem_region(rcEnc, cb->getBufferPtr());
+
+#if DEBUG
+    dump_regions(rcEnc);
+#endif
+
+    put_gralloc_region(rcEnc, cb->bufferSize);
+
+    return should_unmap;
+}
+
+static int map_buffer(cb_handle_old_t *cb, void **vaddr)
+{
+    const int bufferFd = cb->fds[kBufferFdIndex];
+    if (bufferFd < 0) {
+        return -EINVAL;
+    }
+
+    void *addr = mmap(0, cb->bufferSize, PROT_READ | PROT_WRITE,
+                      MAP_SHARED, bufferFd, 0);
+    if (addr == MAP_FAILED) {
+        ALOGE("%s: failed to map ashmem region!", __FUNCTION__);
+        return -errno;
+    }
+
+    cb->setBufferPtr(addr);
+    cb->ashmemBasePid = getpid();
+    D("%s: %p mapped ashmem base %p size %d\n", __FUNCTION__,
+      cb, addr, cb->bufferSize);
+
+    *vaddr = addr;
+    return 0;
+}
+
+static HostConnection* sHostCon = NULL;
+
+static HostConnection* createOrGetHostConnection() {
+    if (!sHostCon) {
+        sHostCon = HostConnection::createUnique().release();
+    }
+    return sHostCon;
+}
+
+#define DEFINE_HOST_CONNECTION \
+    HostConnection *hostCon = createOrGetHostConnection(); \
+    ExtendedRCEncoderContext *rcEnc = (hostCon ? hostCon->rcEncoder() : NULL); \
+    bool hasVulkan = rcEnc->featureInfo_const()->hasVulkan; (void)hasVulkan; \
+
+#define DEFINE_AND_VALIDATE_HOST_CONNECTION \
+    HostConnection *hostCon = createOrGetHostConnection(); \
+    if (!hostCon) { \
+        ALOGE("gralloc: Failed to get host connection\n"); \
+        return -EIO; \
+    } \
+    ExtendedRCEncoderContext *rcEnc = hostCon->rcEncoder(); \
+    if (!rcEnc) { \
+        ALOGE("gralloc: Failed to get renderControl encoder context\n"); \
+        return -EIO; \
+    } \
+    bool hasVulkan = rcEnc->featureInfo_const()->hasVulkan; (void)hasVulkan;\
+
+#if PLATFORM_SDK_VERSION < 18
+// On older APIs, just define it as a value no one is going to use.
+#define HAL_PIXEL_FORMAT_YCbCr_420_888 0xFFFFFFFF
+#endif
+
+static void updateHostColorBuffer(cb_handle_old_t* cb,
+                              bool doLocked,
+                              char* pixels) {
+    D("%s: call. doLocked=%d", __FUNCTION__, doLocked);
+
+    DEFINE_HOST_CONNECTION;
+    gralloc_dmaregion_t* grdma = init_gralloc_dmaregion(rcEnc);
+
+    int bpp = glUtilsPixelBitSize(cb->glFormat, cb->glType) >> 3;
+    int left = doLocked ? cb->lockedLeft : 0;
+    int top = doLocked ? cb->lockedTop : 0;
+    int width = doLocked ? cb->lockedWidth : cb->width;
+    int height = doLocked ? cb->lockedHeight : cb->height;
+
+    char* to_send = pixels;
+    uint32_t rgbSz = width * height * bpp;
+    uint32_t send_buffer_size = rgbSz;
+    bool is_rgb_format =
+        cb->format != HAL_PIXEL_FORMAT_YV12 &&
+        cb->format != HAL_PIXEL_FORMAT_YCbCr_420_888;
+
+    std::vector<char> convertedBuf;
+
+    if (doLocked && is_rgb_format) {
+        convertedBuf.resize(rgbSz);
+        to_send = &convertedBuf.front();
+        copy_rgb_buffer_from_unlocked(
+                to_send, pixels,
+                cb->width,
+                width, height, top, left, bpp);
+    }
+
+    const bool hasDMA = has_DMA_support(rcEnc);
+    if (hasDMA && grdma->bigbufCount) {
+        D("%s: there are big buffers alive, use fallback (count %u)", __FUNCTION__,
+          grdma->bigbufCount);
+    }
+
+    if (hasDMA && !grdma->bigbufCount) {
+        switch (cb->format) {
+        case HAL_PIXEL_FORMAT_YV12:
+            get_yv12_offsets(width, height, NULL, NULL, &send_buffer_size);
+            break;
+
+        case HAL_PIXEL_FORMAT_YCbCr_420_888:
+            get_yuv420p_offsets(width, height, NULL, NULL, &send_buffer_size);
+            break;
+        }
+
+        if (grdma->address_space_block.guestPtr()) {
+            rcEnc->bindDmaDirectly(grdma->address_space_block.guestPtr(),
+                                   grdma->address_space_block.physAddr());
+        } else if (grdma->goldfish_dma.mapped_addr) {
+            rcEnc->bindDmaContext(&grdma->goldfish_dma);
+        } else {
+            ALOGE("%s: Unexpected DMA", __func__);
+        }
+
+        D("%s: call. dma update with sz=%u", __func__, send_buffer_size);
+        pthread_mutex_lock(&grdma->lock);
+        rcEnc->rcUpdateColorBufferDMA(rcEnc, cb->hostHandle,
+                left, top, width, height,
+                cb->glFormat, cb->glType,
+                to_send, send_buffer_size);
+        pthread_mutex_unlock(&grdma->lock);
+    } else {
+        switch (cb->format) {
+        case HAL_PIXEL_FORMAT_YV12:
+            convertedBuf.resize(rgbSz);
+            to_send = &convertedBuf.front();
+            D("convert yv12 to rgb888 here");
+            yv12_to_rgb888(to_send, pixels,
+                           width, height, left, top,
+                           left + width - 1, top + height - 1);
+            break;
+
+        case HAL_PIXEL_FORMAT_YCbCr_420_888:
+            convertedBuf.resize(rgbSz);
+            to_send = &convertedBuf.front();
+            yuv420p_to_rgb888(to_send, pixels,
+                              width, height, left, top,
+                              left + width - 1, top + height - 1);
+            break;
+        }
+
+        rcEnc->rcUpdateColorBuffer(rcEnc, cb->hostHandle,
+                left, top, width, height,
+                cb->glFormat, cb->glType, to_send);
+    }
+}
+
+//
+// gralloc device functions (alloc interface)
+//
+static void gralloc_dump(struct alloc_device_t* /*dev*/, char* /*buff*/, int /*buff_len*/) {}
+
+static int gralloc_get_buffer_format(const int frameworkFormat, const int usage) {
+    // Pick the right concrete pixel format given the endpoints as encoded in
+    // the usage bits.  Every end-point pair needs explicit listing here.
+#if PLATFORM_SDK_VERSION >= 17
+    if (frameworkFormat == HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED) {
+        // Camera as producer
+        if (usage & GRALLOC_USAGE_HW_CAMERA_WRITE) {
+            if (usage & GRALLOC_USAGE_HW_TEXTURE) {
+                // Camera-to-display is RGBA
+                return HAL_PIXEL_FORMAT_RGBA_8888;
+            } else if (usage & GRALLOC_USAGE_HW_VIDEO_ENCODER) {
+                // Camera-to-encoder is NV21
+                return HAL_PIXEL_FORMAT_YCrCb_420_SP;
+            }
+        }
+
+        ALOGE("gralloc_alloc: Requested auto format selection, "
+              "but no known format for this usage=%x", usage);
+        return -EINVAL;
+    } else if (frameworkFormat == HAL_PIXEL_FORMAT_YCbCr_420_888) {
+        ALOGW("gralloc_alloc: Requested YCbCr_420_888, taking experimental path. "
+              "usage=%x", usage);
+    } else if (frameworkFormat == OMX_COLOR_FormatYUV420Planar &&
+               (usage & GOLDFISH_GRALLOC_USAGE_GPU_DATA_BUFFER)) {
+        ALOGW("gralloc_alloc: Requested OMX_COLOR_FormatYUV420Planar, given "
+              "YCbCr_420_888, taking experimental path. "
+              "usage=%x", usage);
+        return HAL_PIXEL_FORMAT_YCbCr_420_888;
+    }
+#endif // PLATFORM_SDK_VERSION >= 17
+
+    return frameworkFormat;
+}
+
+static int gralloc_alloc(alloc_device_t* dev,
+                         int w, int h, const int frameworkFormat, int usage,
+                         buffer_handle_t* pHandle, int* pStride)
+{
+    D("gralloc_alloc w=%d h=%d usage=0x%x frameworkFormat=0x%x\n", w, h, usage, frameworkFormat);
+
+    gralloc_device_t *grdev = (gralloc_device_t *)dev;
+    if (!grdev || !pHandle || !pStride) {
+        ALOGE("gralloc_alloc: Bad inputs (grdev: %p, pHandle: %p, pStride: %p",
+                grdev, pHandle, pStride);
+        return -EINVAL;
+    }
+
+    const int format = gralloc_get_buffer_format(frameworkFormat, usage);
+    if (format < 0) {
+        return format;
+    }
+
+    //
+    // Note: in screen capture mode, both sw_write and hw_write will be on
+    // and this is a valid usage
+    //
+    bool sw_write = (0 != (usage & GRALLOC_USAGE_SW_WRITE_MASK));
+    bool hw_write = (usage & GRALLOC_USAGE_HW_RENDER); (void)hw_write;
+    bool sw_read = (0 != (usage & GRALLOC_USAGE_SW_READ_MASK));
+    const bool hw_texture = usage & GRALLOC_USAGE_HW_TEXTURE;
+    const bool hw_render = usage & GRALLOC_USAGE_HW_RENDER;
+    const bool hw_2d = usage & GRALLOC_USAGE_HW_2D;
+    const bool hw_composer = usage & GRALLOC_USAGE_HW_COMPOSER;
+    const bool hw_fb = usage & GRALLOC_USAGE_HW_FB;
+    const bool rgb888_unsupported_usage =
+        hw_texture || hw_render || hw_2d || hw_composer || hw_fb;
+#if PLATFORM_SDK_VERSION >= 17
+    bool hw_cam_write = (usage & GRALLOC_USAGE_HW_CAMERA_WRITE);
+    bool hw_cam_read = (usage & GRALLOC_USAGE_HW_CAMERA_READ);
+#else // PLATFORM_SDK_VERSION
+    bool hw_cam_write = false;
+    bool hw_cam_read = false;
+#endif // PLATFORM_SDK_VERSION
+#if PLATFORM_SDK_VERSION >= 15
+    bool hw_vid_enc_read = usage & GRALLOC_USAGE_HW_VIDEO_ENCODER;
+#else // PLATFORM_SDK_VERSION
+    bool hw_vid_enc_read = false;
+#endif // PLATFORM_SDK_VERSION
+
+    bool yuv_format = false;
+    bool raw_format = false;
+    int ashmem_size = 0;
+    int stride = w;
+
+    GLenum glFormat = 0;
+    GLenum glType = 0;
+    EmulatorFrameworkFormat selectedEmuFrameworkFormat = FRAMEWORK_FORMAT_GL_COMPATIBLE;
+
+    int bpp = 0;
+    int align = 1;
+    switch (format) {
+        case HAL_PIXEL_FORMAT_RGBA_8888:
+        case HAL_PIXEL_FORMAT_RGBX_8888:
+        case HAL_PIXEL_FORMAT_BGRA_8888:
+            bpp = 4;
+            glFormat = GL_RGBA;
+            glType = GL_UNSIGNED_BYTE;
+            break;
+        case HAL_PIXEL_FORMAT_RGB_888:
+            if (rgb888_unsupported_usage) {
+                return -EINVAL;  // we dont support RGB_888 for HW usage
+            } else {
+                bpp = 3;
+                glFormat = GL_RGB;
+                glType = GL_UNSIGNED_BYTE;
+                break;
+            }
+        case HAL_PIXEL_FORMAT_RGB_565:
+            bpp = 2;
+            // Workaround: distinguish vs the RGB8/RGBA8
+            // by changing |glFormat| to GL_RGB565
+            // (previously, it was still GL_RGB)
+            glFormat = GL_RGB565;
+            glType = GL_UNSIGNED_SHORT_5_6_5;
+            break;
+#if PLATFORM_SDK_VERSION >= 26
+        case HAL_PIXEL_FORMAT_RGBA_FP16:
+            bpp = 8;
+            glFormat = GL_RGBA16F;
+            glType = GL_HALF_FLOAT;
+            break;
+        case HAL_PIXEL_FORMAT_RGBA_1010102:
+            bpp = 4;
+            glFormat = GL_RGB10_A2;
+            glType = GL_UNSIGNED_INT_2_10_10_10_REV;
+            break;
+#endif // PLATFORM_SDK_VERSION >= 26
+#if PLATFORM_SDK_VERSION >= 21
+        case HAL_PIXEL_FORMAT_RAW16:
+        case HAL_PIXEL_FORMAT_Y16:
+#elif PLATFORM_SDK_VERSION >= 16
+        case HAL_PIXEL_FORMAT_RAW_SENSOR:
+#endif
+            bpp = 2;
+            align = 16*bpp;
+            if (! ((sw_read || hw_cam_read) && (sw_write || hw_cam_write) ) ) {
+                // Raw sensor data or Y16 only goes between camera and CPU
+                return -EINVAL;
+            }
+            // Not expecting to actually create any GL surfaces for this
+            glFormat = GL_LUMINANCE;
+            glType = GL_UNSIGNED_SHORT;
+            raw_format = true;
+            break;
+#if PLATFORM_SDK_VERSION >= 17
+        case HAL_PIXEL_FORMAT_BLOB:
+            bpp = 1;
+            if (! (sw_read) ) {
+                // Blob data cannot be used by HW other than camera emulator
+                // But there is a CTS test trying to have access to it
+                // BUG: https://buganizer.corp.google.com/issues/37719518
+                return -EINVAL;
+            }
+            // Not expecting to actually create any GL surfaces for this
+            glFormat = GL_LUMINANCE;
+            glType = GL_UNSIGNED_BYTE;
+            break;
+#endif // PLATFORM_SDK_VERSION >= 17
+        case HAL_PIXEL_FORMAT_YCrCb_420_SP:
+            align = 1;
+            bpp = 1; // per-channel bpp
+            yuv_format = true;
+            // Not expecting to actually create any GL surfaces for this
+            break;
+        case HAL_PIXEL_FORMAT_YV12:
+            align = 16;
+            bpp = 1; // per-channel bpp
+            yuv_format = true;
+            // We are going to use RGB8888 on the host for Vulkan
+            glFormat = GL_RGBA;
+            glType = GL_UNSIGNED_BYTE;
+            selectedEmuFrameworkFormat = FRAMEWORK_FORMAT_YV12;
+            break;
+        case HAL_PIXEL_FORMAT_YCbCr_420_888:
+            align = 1;
+            bpp = 1; // per-channel bpp
+            yuv_format = true;
+            // We are going to use RGB888 on the host
+            glFormat = GL_RGB;
+            glType = GL_UNSIGNED_BYTE;
+            selectedEmuFrameworkFormat = FRAMEWORK_FORMAT_YUV_420_888;
+            break;
+        default:
+            ALOGE("gralloc_alloc: Unknown format %d", format);
+            return -EINVAL;
+    }
+
+    //
+    // Allocate ColorBuffer handle on the host (only if h/w access is allowed)
+    // Only do this for some h/w usages, not all.
+    // Also do this if we need to read from the surface, in this case the
+    // rendering will still happen on the host but we also need to be able to
+    // read back from the color buffer, which requires that there is a buffer
+    //
+    DEFINE_AND_VALIDATE_HOST_CONNECTION;
+#if PLATFORM_SDK_VERSION >= 17
+    bool needHostCb = ((!yuv_format && frameworkFormat != HAL_PIXEL_FORMAT_BLOB) ||
+                      usage & GOLDFISH_GRALLOC_USAGE_GPU_DATA_BUFFER ||
+#else
+    bool needHostCb = (!yuv_format ||
+#endif // !(PLATFORM_SDK_VERSION >= 17)
+                       frameworkFormat == HAL_PIXEL_FORMAT_YV12 ||
+                       frameworkFormat == HAL_PIXEL_FORMAT_YCbCr_420_888) &&
+                       !raw_format &&
+#if PLATFORM_SDK_VERSION >= 15
+                      (usage & (GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_HW_RENDER |
+                                GRALLOC_USAGE_HW_2D | GRALLOC_USAGE_HW_COMPOSER |
+                                GRALLOC_USAGE_HW_VIDEO_ENCODER |
+                                GRALLOC_USAGE_HW_FB | GRALLOC_USAGE_SW_READ_MASK))
+#else // PLATFORM_SDK_VERSION
+                      (usage & (GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_HW_RENDER |
+                                GRALLOC_USAGE_HW_2D |
+                                GRALLOC_USAGE_HW_FB | GRALLOC_USAGE_SW_READ_MASK))
+#endif // PLATFORM_SDK_VERSION
+                      ;
+
+    if (isHidlGralloc) {
+        if (needHostCb || (usage & GRALLOC_USAGE_HW_FB)) {
+            // keep space for postCounter
+            // AND openCounter for all host cb
+            ashmem_size += GOLDFISH_OFFSET_UNIT * 2;
+        }
+    } else {
+        if (usage & GRALLOC_USAGE_HW_FB) {
+            // keep space for postCounter
+            ashmem_size += GOLDFISH_OFFSET_UNIT * 1;
+        }
+    }
+
+    // API26 always expect at least one file descriptor is associated with
+    // one color buffer
+    // BUG: 37719038
+    if (PLATFORM_SDK_VERSION >= 26 ||
+        sw_read || sw_write || hw_cam_write || hw_vid_enc_read) {
+        // keep space for image on guest memory if SW access is needed
+        // or if the camera is doing writing
+        if (yuv_format) {
+            size_t yStride = (w*bpp + (align - 1)) & ~(align-1);
+            size_t uvStride = (yStride / 2 + (align - 1)) & ~(align-1);
+            size_t uvHeight = h / 2;
+            ashmem_size += yStride * h + 2 * (uvHeight * uvStride);
+            stride = yStride / bpp;
+        } else {
+            size_t bpr = (w*bpp + (align-1)) & ~(align-1);
+            ashmem_size += (bpr * h);
+            stride = bpr / bpp;
+        }
+    }
+
+    D("gralloc_alloc format=%d, ashmem_size=%d, stride=%d, tid %lu\n", format, ashmem_size, stride,
+      getCurrentThreadId());
+
+    //
+    // Allocate space in ashmem if needed
+    //
+    int fd = -1;
+    if (ashmem_size > 0) {
+        // round to page size;
+        ashmem_size = (ashmem_size + (PAGE_SIZE-1)) & ~(PAGE_SIZE-1);
+
+        ALOGD("%s: Creating ashmem region of size %d\n", __FUNCTION__, ashmem_size);
+        fd = ashmem_create_region("gralloc-buffer", ashmem_size);
+        if (fd < 0) {
+            ALOGE("gralloc_alloc failed to create ashmem region: %s\n",
+                    strerror(errno));
+            return -errno;
+        }
+    }
+
+    cb_handle_old_t *cb = new cb_handle_old_t(fd, ashmem_size, usage,
+                                              w, h, format,
+                                              glFormat, glType);
+
+    if (ashmem_size > 0) {
+        //
+        // map ashmem region if exist
+        //
+        void *vaddr;
+        int err = map_buffer(cb, &vaddr);
+        if (err) {
+            close(fd);
+            delete cb;
+            return err;
+        }
+    }
+
+    const bool hasDMA = has_DMA_support(rcEnc);
+
+    if (needHostCb) {
+        if (hostCon && rcEnc) {
+            GLenum allocFormat = glFormat;
+            // The handling of RGBX_8888 is very subtle. Most of the time
+            // we want it to be treated as RGBA_8888, with the exception
+            // that alpha is always ignored and treated as 1. The solution
+            // is to create 3 channel RGB texture instead and host GL will
+            // handle the Alpha channel.
+            if (HAL_PIXEL_FORMAT_RGBX_8888 == format) {
+                allocFormat = GL_RGB;
+            }
+
+            hostCon->lock();
+            if (hasDMA) {
+                cb->hostHandle = rcEnc->rcCreateColorBufferDMA(rcEnc, w, h, allocFormat, selectedEmuFrameworkFormat);
+            } else {
+                cb->hostHandle = rcEnc->rcCreateColorBuffer(rcEnc, w, h, allocFormat);
+            }
+            hostCon->unlock();
+        }
+
+        if (!cb->hostHandle) {
+            // Could not create colorbuffer on host !!!
+            close(fd);
+            delete cb;
+            ALOGE("%s: failed to create host cb! -EIO", __FUNCTION__);
+            return -EIO;
+        } else {
+            QEMU_PIPE_HANDLE refcountPipeFd = qemu_pipe_open("refcount");
+            if(qemu_pipe_valid(refcountPipeFd)) {
+                cb->setRefcountPipeFd(refcountPipeFd);
+                qemu_pipe_write(refcountPipeFd, &cb->hostHandle, 4);
+            }
+            D("Created host ColorBuffer 0x%x\n", cb->hostHandle);
+        }
+
+        if (isHidlGralloc) { *getOpenCountPtr(cb) = 0; }
+    }
+
+    //
+    // alloc succeeded - insert the allocated handle to the allocated list
+    //
+    pthread_mutex_lock(&grdev->lock);
+    grdev->allocated.insert(cb);
+    pthread_mutex_unlock(&grdev->lock);
+
+    *pHandle = cb;
+    D("%s: alloc succeded, new ashmem base and size: %p %d handle: %p",
+      __FUNCTION__, cb->ashmemBase, cb->ashmemSize, cb);
+    switch (frameworkFormat) {
+    case HAL_PIXEL_FORMAT_YCbCr_420_888:
+        *pStride = 0;
+        break;
+    default:
+        *pStride = stride;
+        break;
+    }
+
+    hostCon->lock();
+    if (hasDMA) {
+        get_gralloc_region(rcEnc);  // map_buffer(cb, ...) refers here
+    }
+    hostCon->unlock();
+
+    return 0;
+}
+
+static int gralloc_free(alloc_device_t* dev,
+                        buffer_handle_t handle)
+{
+    DEFINE_AND_VALIDATE_HOST_CONNECTION;
+
+    const cb_handle_old_t *cb = cb_handle_old_t::from(handle);
+    if (!cb) {
+        ERR("gralloc_free: invalid handle %p", handle);
+        return -EINVAL;
+    }
+
+    D("%s: for buf %p ptr %p size %d\n",
+      __FUNCTION__, handle, cb->getBufferPtr(), cb->bufferSize);
+
+    if (cb->hostHandle && !cb->hasRefcountPipe()) {
+        int32_t openCount = 1;
+        int32_t* openCountPtr = &openCount;
+
+        if (isHidlGralloc && cb->getBufferPtr()) {
+            openCountPtr = getOpenCountPtr(cb);
+        }
+
+        if (*openCountPtr > 0) {
+            D("Closing host ColorBuffer 0x%x\n", cb->hostHandle);
+            hostCon->lock();
+            rcEnc->rcCloseColorBuffer(rcEnc, cb->hostHandle);
+            hostCon->unlock();
+        } else {
+            D("A rcCloseColorBuffer is owed!!! sdk ver: %d", PLATFORM_SDK_VERSION);
+            *openCountPtr = -1;
+        }
+    }
+
+    //
+    // detach and unmap ashmem area if present
+    //
+    const int bufferFd = cb->fds[kBufferFdIndex];
+    if (bufferFd > 0) {
+        if (cb->bufferSize > 0 && cb->getBufferPtr()) {
+            D("%s: unmapped %p", __FUNCTION__, cb->getBufferPtr());
+            munmap(cb->getBufferPtr(), cb->bufferSize);
+            put_gralloc_region(rcEnc, cb->bufferSize);
+        }
+        close(bufferFd);
+    }
+
+    if(qemu_pipe_valid(cb->fds[kHostHandleRefCountIndex])) {
+        qemu_pipe_close(cb->fds[kHostHandleRefCountIndex]);
+    }
+    D("%s: done", __FUNCTION__);
+    // remove it from the allocated list
+    gralloc_device_t *grdev = (gralloc_device_t *)dev;
+
+    pthread_mutex_lock(&grdev->lock);
+    grdev->allocated.erase(cb);
+    pthread_mutex_unlock(&grdev->lock);
+
+    delete cb;
+
+    D("%s: exit", __FUNCTION__);
+    return 0;
+}
+
+static int gralloc_device_close(struct hw_device_t *dev)
+{
+    gralloc_device_t* d = reinterpret_cast<gralloc_device_t*>(dev);
+    if (d) {
+        for (std::set<buffer_handle_t>::const_iterator i = d->allocated.begin();
+             i != d->allocated.end(); ++i) {
+            gralloc_free(&d->device, *i);
+        }
+
+        delete d;
+
+        if (sHostCon) {
+            delete sHostCon;
+            sHostCon = nullptr;
+        }
+    }
+    return 0;
+}
+
+//
+// gralloc module functions - refcount + locking interface
+//
+static int gralloc_register_buffer(gralloc_module_t const* module,
+                                   buffer_handle_t handle)
+{
+    DEFINE_AND_VALIDATE_HOST_CONNECTION;
+
+    D("%s: start", __FUNCTION__);
+    pthread_once(&sFallbackOnce, fallback_init);
+    if (sFallback != NULL) {
+        return sFallback->registerBuffer(sFallback, handle);
+    }
+
+    private_module_t *gr = (private_module_t *)module;
+    if (!gr) {
+        return -EINVAL;
+    }
+
+    cb_handle_old_t *cb = cb_handle_old_t::from_unconst(handle);
+    if (!cb) {
+        ERR("gralloc_register_buffer(%p): invalid buffer", cb);
+        return -EINVAL;
+    }
+
+    D("gralloc_register_buffer(%p) w %d h %d format 0x%x",
+        handle, cb->width, cb->height, cb->format);
+
+    if (cb->hostHandle != 0 && !cb->hasRefcountPipe()) {
+        D("Opening host ColorBuffer 0x%x\n", cb->hostHandle);
+        hostCon->lock();
+        rcEnc->rcOpenColorBuffer2(rcEnc, cb->hostHandle);
+        hostCon->unlock();
+    }
+
+    //
+    // if the color buffer has ashmem region and it is not mapped in this
+    // process map it now.
+    //
+    if (cb->bufferSize > 0 && cb->mappedPid != getpid()) {
+        void *vaddr;
+        int err = map_buffer(cb, &vaddr);
+        if (err) {
+            ERR("gralloc_register_buffer(%p): map failed: %s", cb, strerror(-err));
+            return -err;
+        }
+        cb->mappedPid = getpid();
+
+        if (isHidlGralloc) {
+            int32_t* openCountPtr = getOpenCountPtr(cb);
+            if (!*openCountPtr) *openCountPtr = 1;
+        }
+    }
+
+    if (cb->bufferSize > 0) {
+        get_ashmem_region(rcEnc, cb);
+    }
+
+    return 0;
+}
+
+static int gralloc_unregister_buffer(gralloc_module_t const* module,
+                                     buffer_handle_t handle)
+{
+    DEFINE_AND_VALIDATE_HOST_CONNECTION;
+
+    if (sFallback != NULL) {
+        return sFallback->unregisterBuffer(sFallback, handle);
+    }
+
+    private_module_t *gr = (private_module_t *)module;
+    if (!gr) {
+        return -EINVAL;
+    }
+
+    cb_handle_old_t *cb = cb_handle_old_t::from_unconst(handle);
+    if (!cb) {
+        ERR("gralloc_unregister_buffer(%p): invalid buffer", cb);
+        return -EINVAL;
+    }
+
+
+    if (cb->hostHandle && !cb->hasRefcountPipe()) {
+        D("Closing host ColorBuffer 0x%x\n", cb->hostHandle);
+        hostCon->lock();
+        rcEnc->rcCloseColorBuffer(rcEnc, cb->hostHandle);
+
+        if (isHidlGralloc) {
+            // Queue up another rcCloseColorBuffer if applicable.
+            // invariant: have ashmem.
+            if (cb->bufferSize > 0 && cb->mappedPid == getpid()) {
+                int32_t* openCountPtr = getOpenCountPtr(cb);
+                if (*openCountPtr == -1) {
+                    D("%s: revenge of the rcCloseColorBuffer!", __func__);
+                    rcEnc->rcCloseColorBuffer(rcEnc, cb->hostHandle);
+                    *openCountPtr = -2;
+                }
+            }
+        }
+        hostCon->unlock();
+    }
+
+    //
+    // unmap ashmem region if it was previously mapped in this process
+    // (through register_buffer)
+    //
+    if (cb->bufferSize > 0 && cb->mappedPid == getpid()) {
+        const bool should_unmap = put_ashmem_region(rcEnc, cb);
+        if (!should_unmap) goto done;
+
+        int err = munmap(cb->getBufferPtr(), cb->bufferSize);
+        if (err) {
+            ERR("gralloc_unregister_buffer(%p): unmap failed", cb);
+            return -EINVAL;
+        }
+        cb->bufferSize = 0;
+        cb->mappedPid = 0;
+        D("%s: Unregister buffer previous mapped to pid %d", __FUNCTION__, getpid());
+    }
+
+done:
+    D("gralloc_unregister_buffer(%p) done\n", cb);
+    return 0;
+}
+
+static int gralloc_lock(gralloc_module_t const* module,
+                        buffer_handle_t handle, int usage,
+                        int l, int t, int w, int h,
+                        void** vaddr)
+{
+    if (sFallback != NULL) {
+        return sFallback->lock(sFallback, handle, usage, l, t, w, h, vaddr);
+    }
+
+    private_module_t *gr = (private_module_t *)module;
+    if (!gr) {
+        return -EINVAL;
+    }
+
+    cb_handle_old_t *cb = cb_handle_old_t::from_unconst(handle);
+    if (!cb) {
+        ALOGE("gralloc_lock bad handle\n");
+        return -EINVAL;
+    }
+
+    // Validate usage,
+    //   1. cannot be locked for hw access
+    //   2. lock for either sw read or write.
+    //   3. locked sw access must match usage during alloc time.
+    bool sw_read = (0 != (usage & GRALLOC_USAGE_SW_READ_MASK));
+    bool sw_write = (0 != (usage & GRALLOC_USAGE_SW_WRITE_MASK));
+    bool hw_read = (usage & GRALLOC_USAGE_HW_TEXTURE);
+    bool hw_write = (usage & GRALLOC_USAGE_HW_RENDER);
+#if PLATFORM_SDK_VERSION >= 17
+    bool hw_cam_write = (usage & GRALLOC_USAGE_HW_CAMERA_WRITE);
+    bool hw_cam_read = (usage & GRALLOC_USAGE_HW_CAMERA_READ);
+#else // PLATFORM_SDK_VERSION
+    bool hw_cam_write = false;
+    bool hw_cam_read = false;
+#endif // PLATFORM_SDK_VERSION
+
+#if PLATFORM_SDK_VERSION >= 15
+    bool hw_vid_enc_read = (usage & GRALLOC_USAGE_HW_VIDEO_ENCODER);
+#else // PLATFORM_SDK_VERSION
+    bool hw_vid_enc_read = false;
+#endif // PLATFORM_SDK_VERSION
+
+    bool sw_read_allowed = (0 != (cb->usage & GRALLOC_USAGE_SW_READ_MASK));
+
+#if PLATFORM_SDK_VERSION >= 15
+    // bug: 30088791
+    // a buffer was created for GRALLOC_USAGE_HW_VIDEO_ENCODER usage but
+    // later a software encoder is reading this buffer: this is actually
+    // legit usage.
+    sw_read_allowed = sw_read_allowed || (cb->usage & GRALLOC_USAGE_HW_VIDEO_ENCODER);
+#endif // PLATFORM_SDK_VERSION >= 15
+
+    bool sw_write_allowed = (0 != (cb->usage & GRALLOC_USAGE_SW_WRITE_MASK));
+
+    if ( (hw_read || hw_write) ||
+         (!sw_read && !sw_write &&
+                 !hw_cam_write && !hw_cam_read &&
+                 !hw_vid_enc_read) ||
+         (sw_read && !sw_read_allowed) ||
+         (sw_write && !sw_write_allowed) ) {
+        ALOGE("gralloc_lock usage mismatch usage=0x%x cb->usage=0x%x\n", usage,
+                cb->usage);
+        //This is not exactly an error and loose it up.
+        //bug: 30784436
+        //return -EINVAL;
+    }
+
+    void *cpu_addr = NULL;
+
+    //
+    // make sure ashmem area is mapped if needed
+    //
+    if (cb->canBePosted() || sw_read || sw_write ||
+            hw_cam_write || hw_cam_read ||
+            hw_vid_enc_read) {
+        if (cb->ashmemBasePid != getpid() || !cb->getBufferPtr()) {
+            return -EACCES;
+        }
+
+        cpu_addr = (void *)((char*)cb->getBufferPtr() + getAshmemColorOffset(cb));
+    }
+
+    if (cb->hostHandle) {
+        // Make sure we have host connection
+        DEFINE_AND_VALIDATE_HOST_CONNECTION;
+        hostCon->lock();
+
+        //
+        // flush color buffer write cache on host and get its sync status.
+        //
+        int hostSyncStatus = rcEnc->rcColorBufferCacheFlush(rcEnc, cb->hostHandle,
+                                                            0,
+                                                            sw_read);
+        if (hostSyncStatus < 0) {
+            // host failed the color buffer sync - probably since it was already
+            // locked for write access. fail the lock.
+            ALOGE("gralloc_lock cacheFlush failed sw_read=%d\n", sw_read);
+            return -EBUSY;
+        }
+
+        // camera delivers bits to the buffer directly and does not require
+        // an explicit read.
+        if (sw_read & !(usage & GRALLOC_USAGE_HW_CAMERA_MASK)) {
+            D("gralloc_lock read back color buffer %d %d ashmem base %p sz %d\n",
+              cb->width, cb->height, cb->ashmemBase, cb->ashmemSize);
+            void* rgb_addr = cpu_addr;
+            char* tmpBuf = 0;
+            if (cb->format == HAL_PIXEL_FORMAT_YV12 ||
+                cb->format == HAL_PIXEL_FORMAT_YCbCr_420_888) {
+                if (rcEnc->hasYUVCache()) {
+                    uint32_t buffer_size;
+                    if (cb->format == HAL_PIXEL_FORMAT_YV12) {
+                       get_yv12_offsets(cb->width, cb->height, NULL, NULL,
+                                        &buffer_size);
+                    } else {
+                       get_yuv420p_offsets(cb->width, cb->height, NULL, NULL,
+                                           &buffer_size);
+                    }
+                    D("read YUV copy from host");
+                    rcEnc->rcReadColorBufferYUV(rcEnc, cb->hostHandle,
+                                            0, 0, cb->width, cb->height,
+                                            rgb_addr, buffer_size);
+                } else {
+                    // We are using RGB888
+                    tmpBuf = new char[cb->width * cb->height * 3];
+                    rcEnc->rcReadColorBuffer(rcEnc, cb->hostHandle,
+                                              0, 0, cb->width, cb->height, cb->glFormat, cb->glType, tmpBuf);
+                    if (cb->format == HAL_PIXEL_FORMAT_YV12) {
+                        D("convert rgb888 to yv12 here");
+                        rgb888_to_yv12((char*)cpu_addr, tmpBuf, cb->width, cb->height, l, t, l+w-1, t+h-1);
+                    } else if (cb->format == HAL_PIXEL_FORMAT_YCbCr_420_888) {
+                        D("convert rgb888 to yuv420p here");
+                        rgb888_to_yuv420p((char*)cpu_addr, tmpBuf, cb->width, cb->height, l, t, l+w-1, t+h-1);
+                    }
+                    delete [] tmpBuf;
+                }
+            } else {
+                rcEnc->rcReadColorBuffer(rcEnc, cb->hostHandle,
+                        0, 0, cb->width, cb->height, cb->glFormat, cb->glType, rgb_addr);
+            }
+        }
+
+        if (has_DMA_support(rcEnc)) {
+            gralloc_dmaregion_register_ashmem(rcEnc, cb->bufferSize);
+        }
+        hostCon->unlock();
+    }
+
+    //
+    // is virtual address required ?
+    //
+    if (sw_read || sw_write || hw_cam_write || hw_cam_read || hw_vid_enc_read) {
+        *vaddr = cpu_addr;
+    }
+
+    if (sw_write || hw_cam_write) {
+        //
+        // Keep locked region if locked for s/w write access.
+        //
+        cb->lockedLeft = l;
+        cb->lockedTop = t;
+        cb->lockedWidth = w;
+        cb->lockedHeight = h;
+    }
+
+    DD("gralloc_lock success. vaddr: %p, *vaddr: %p, usage: %x, cpu_addr: %p, base: %p",
+            vaddr, vaddr ? *vaddr : 0, usage, cpu_addr, cb->ashmemBase);
+
+    return 0;
+}
+
+static int gralloc_unlock(gralloc_module_t const* module,
+                          buffer_handle_t handle)
+{
+    if (sFallback != NULL) {
+        return sFallback->unlock(sFallback, handle);
+    }
+
+    private_module_t *gr = (private_module_t *)module;
+    if (!gr) {
+        return -EINVAL;
+    }
+
+    cb_handle_old_t *cb = cb_handle_old_t::from_unconst(handle);
+    if (!cb) {
+        ALOGD("%s: invalid cb handle. -EINVAL", __FUNCTION__);
+        return -EINVAL;
+    }
+
+    //
+    // if buffer was locked for s/w write, we need to update the host with
+    // the updated data
+    //
+    if (cb->hostHandle) {
+
+        // Make sure we have host connection
+        DEFINE_AND_VALIDATE_HOST_CONNECTION;
+        hostCon->lock();
+
+        char *cpu_addr = (char*)cb->getBufferPtr() + getAshmemColorOffset(cb);
+
+        if (cb->lockedWidth < cb->width || cb->lockedHeight < cb->height) {
+            updateHostColorBuffer(cb, true, cpu_addr);
+        }
+        else {
+            updateHostColorBuffer(cb, false, cpu_addr);
+        }
+
+        hostCon->unlock();
+        DD("gralloc_unlock success. cpu_addr: %p", cpu_addr);
+    }
+
+    cb->lockedWidth = cb->lockedHeight = 0;
+    return 0;
+}
+
+#if PLATFORM_SDK_VERSION >= 18
+static int gralloc_lock_ycbcr(gralloc_module_t const* module,
+                              buffer_handle_t handle, int usage,
+                              int l, int t, int w, int h,
+                              android_ycbcr *ycbcr)
+{
+    // Not supporting fallback module for YCbCr
+    if (sFallback != NULL) {
+        ALOGD("%s: has fallback, return -EINVAL", __FUNCTION__);
+        return -EINVAL;
+    }
+
+    if (!ycbcr) {
+        ALOGE("%s: got NULL ycbcr struct! -EINVAL", __FUNCTION__);
+        return -EINVAL;
+    }
+
+    private_module_t *gr = (private_module_t *)module;
+    if (!gr) {
+        return -EINVAL;
+    }
+
+    cb_handle_old_t *cb = cb_handle_old_t::from_unconst(handle);
+    if (!cb) {
+        ALOGE("%s: bad colorbuffer handle. -EINVAL", __FUNCTION__);
+        return -EINVAL;
+    }
+
+    if (cb->format != HAL_PIXEL_FORMAT_YV12 &&
+        cb->format != HAL_PIXEL_FORMAT_YCbCr_420_888) {
+        ALOGE("gralloc_lock_ycbcr can only be used with "
+                "HAL_PIXEL_FORMAT_YCbCr_420_888 or HAL_PIXEL_FORMAT_YV12, got %x instead. "
+                "-EINVAL",
+                cb->format);
+        return -EINVAL;
+    }
+
+    usage |= (cb->usage & GRALLOC_USAGE_HW_CAMERA_MASK);
+
+    void *vaddr;
+    int ret = gralloc_lock(module, handle, usage, l, t, w, h, &vaddr);
+    if (ret) {
+        return ret;
+    }
+
+    uint8_t* cpu_addr = static_cast<uint8_t*>(vaddr);
+
+    // Calculate offsets to underlying YUV data
+    size_t yStride;
+    size_t cStride;
+    size_t cSize;
+    size_t yOffset;
+    size_t uOffset;
+    size_t vOffset;
+    size_t cStep;
+    size_t align;
+    switch (cb->format) {
+        case HAL_PIXEL_FORMAT_YCrCb_420_SP:
+            yStride = cb->width;
+            cStride = cb->width;
+            yOffset = 0;
+            vOffset = yStride * cb->height;
+            uOffset = vOffset + 1;
+            cStep = 2;
+            break;
+        case HAL_PIXEL_FORMAT_YV12:
+            // https://developer.android.com/reference/android/graphics/ImageFormat.html#YV12
+            align = 16;
+            yStride = (cb->width + (align -1)) & ~(align-1);
+            cStride = (yStride / 2 + (align - 1)) & ~(align-1);
+            yOffset = 0;
+            cSize = cStride * cb->height/2;
+            vOffset = yStride * cb->height;
+            uOffset = vOffset + cSize;
+            cStep = 1;
+            break;
+        case HAL_PIXEL_FORMAT_YCbCr_420_888:
+            yStride = cb->width;
+            cStride = yStride / 2;
+            yOffset = 0;
+            uOffset = cb->height * yStride;
+            vOffset = uOffset + cStride * cb->height / 2;
+            cStep = 1;
+            break;
+        default:
+            ALOGE("gralloc_lock_ycbcr unexpected internal format %x",
+                    cb->format);
+            return -EINVAL;
+    }
+
+    ycbcr->y = cpu_addr + yOffset;
+    ycbcr->cb = cpu_addr + uOffset;
+    ycbcr->cr = cpu_addr + vOffset;
+    ycbcr->ystride = yStride;
+    ycbcr->cstride = cStride;
+    ycbcr->chroma_step = cStep;
+
+    // Zero out reserved fields
+    memset(ycbcr->reserved, 0, sizeof(ycbcr->reserved));
+
+    DD("gralloc_lock_ycbcr success. usage: %x, ycbcr.y: %p, .cb: %p, .cr: %p, "
+           ".ystride: %d , .cstride: %d, .chroma_step: %d, base: %p", usage,
+           ycbcr->y, ycbcr->cb, ycbcr->cr, ycbcr->ystride, ycbcr->cstride,
+           ycbcr->chroma_step, cb->ashmemBase);
+
+    return 0;
+}
+#endif // PLATFORM_SDK_VERSION >= 18
+
+static int gralloc_device_open(const hw_module_t* module,
+                               const char* name,
+                               hw_device_t** device)
+{
+    int status = -EINVAL;
+
+    D("gralloc_device_open %s\n", name);
+
+    pthread_once( &sFallbackOnce, fallback_init );
+    if (sFallback != NULL) {
+        return sFallback->common.methods->open(&sFallback->common, name, device);
+    }
+
+    if (!strcmp(name, GRALLOC_HARDWARE_GPU0)) {
+
+        // Create host connection and keep it in the TLS.
+        // return error if connection with host can not be established
+        HostConnection *hostConn = createOrGetHostConnection();
+        if (!hostConn) {
+            ALOGE("gralloc: failed to get host connection while opening %s\n", name);
+            return -EIO;
+        }
+
+        //
+        // Allocate memory for the gralloc device (alloc interface)
+        //
+        gralloc_device_t *dev = new gralloc_device_t;
+        if (NULL == dev) {
+            return -ENOMEM;
+        }
+
+        // Initialize our device structure
+        //
+        dev->device.common.tag = HARDWARE_DEVICE_TAG;
+        dev->device.common.version = 0;
+        dev->device.common.module = const_cast<hw_module_t*>(module);
+        dev->device.common.close = gralloc_device_close;
+
+        dev->device.alloc   = gralloc_alloc;
+        dev->device.free    = gralloc_free;
+        dev->device.dump = gralloc_dump;
+        pthread_mutex_init(&dev->lock, NULL);
+
+        *device = &dev->device.common;
+        status = 0;
+    }
+
+    return status;
+}
+
+//
+// define the HMI symbol - our module interface
+//
+static struct hw_module_methods_t gralloc_module_methods = {
+    .open = gralloc_device_open,
+};
+
+struct private_module_t HAL_MODULE_INFO_SYM = {
+    base: {
+        common: {
+            tag: HARDWARE_MODULE_TAG,
+#if PLATFORM_SDK_VERSION >= 18
+            module_api_version: GRALLOC_MODULE_API_VERSION_0_2,
+            hal_api_version: 0,
+#elif PLATFORM_SDK_VERSION >= 16
+            module_api_version: 1,
+            hal_api_version: 0,
+#else // PLATFORM_SDK_VERSION
+            version_major: 1,
+            version_minor: 0,
+#endif // PLATFORM_SDK_VERSION
+            id: GRALLOC_HARDWARE_MODULE_ID,
+            name: "Graphics Memory Allocator Module",
+            author: "The Android Open Source Project",
+            methods: &gralloc_module_methods,
+            dso: NULL,
+            reserved: {0, }
+        },
+        registerBuffer: gralloc_register_buffer,
+        unregisterBuffer: gralloc_unregister_buffer,
+        lock: gralloc_lock,
+        unlock: gralloc_unlock,
+        perform: NULL,
+#if PLATFORM_SDK_VERSION >= 18
+        lock_ycbcr: gralloc_lock_ycbcr,
+#endif // PLATFORM_SDK_VERSION >= 18
+#if PLATFORM_SDK_VERSION >= 29 // For Q and later
+        getTransportSize: NULL,
+        validateBufferSize: NULL,
+#endif // PLATFORM_SDK_VERSION >= 29
+    }
+};
+
+/* This function is called once to detect whether the emulator supports
+ * GPU emulation (this is done by looking at the qemu.gles kernel
+ * parameter, which must be == 1 if this is the case).
+ *
+ * If not, then load gralloc.default instead as a fallback.
+ */
+
+#if __LP64__
+static const char kGrallocDefaultSystemPath[] = "/system/lib64/hw/gralloc.goldfish.default.so";
+static const char kGrallocDefaultVendorPath[] = "/vendor/lib64/hw/gralloc.goldfish.default.so";
+static const char kGrallocDefaultSystemPathPreP[] = "/system/lib64/hw/gralloc.default.so";
+static const char kGrallocDefaultVendorPathPreP[] = "/vendor/lib64/hw/gralloc.default.so";
+#else
+static const char kGrallocDefaultSystemPath[] = "/system/lib/hw/gralloc.goldfish.default.so";
+static const char kGrallocDefaultVendorPath[] = "/vendor/lib/hw/gralloc.goldfish.default.so";
+static const char kGrallocDefaultSystemPathPreP[] = "/system/lib/hw/gralloc.default.so";
+static const char kGrallocDefaultVendorPathPreP[] = "/vendor/lib/hw/gralloc.default.so";
+#endif
+
+static void
+fallback_init(void)
+{
+    char  prop[PROPERTY_VALUE_MAX];
+    void* module;
+
+    // cuttlefish case: no fallback (if we use sw rendering,
+    // we are not using this lib anyway (would use minigbm))
+    property_get("ro.boot.hardware", prop, "");
+
+    bool isValid = prop[0] != '\0';
+
+    if (isValid && !strcmp(prop, "cutf_cvm")) {
+        return;
+    }
+
+    // qemu.gles=0 -> no GLES 2.x support (only 1.x through software).
+    // qemu.gles=1 -> host-side GPU emulation through EmuGL
+    // qemu.gles=2 -> guest-side GPU emulation.
+    property_get("ro.boot.qemu.gles", prop, "999");
+
+    bool useFallback = false;
+    switch (atoi(prop)) {
+        case 0:
+            useFallback = true;
+            break;
+        case 1:
+            useFallback = false;
+            break;
+        case 2:
+            useFallback = true;
+            break;
+        default:
+            useFallback = false;
+            break;
+    }
+
+    if (!useFallback) return;
+
+    ALOGD("Emulator without host-side GPU emulation detected. "
+          "Loading gralloc.default.so from %s...",
+          kGrallocDefaultVendorPath);
+    module = dlopen(kGrallocDefaultVendorPath, RTLD_LAZY | RTLD_LOCAL);
+    if (!module) {
+      module = dlopen(kGrallocDefaultVendorPathPreP, RTLD_LAZY | RTLD_LOCAL);
+    }
+    if (!module) {
+        // vendor folder didn't work. try system
+        ALOGD("gralloc.default.so not found in /vendor. Trying %s...",
+              kGrallocDefaultSystemPath);
+        module = dlopen(kGrallocDefaultSystemPath, RTLD_LAZY | RTLD_LOCAL);
+        if (!module) {
+          module = dlopen(kGrallocDefaultSystemPathPreP, RTLD_LAZY | RTLD_LOCAL);
+        }
+    }
+
+    if (module != NULL) {
+        sFallback = reinterpret_cast<gralloc_module_t*>(dlsym(module, HAL_MODULE_INFO_SYM_AS_STR));
+        if (sFallback == NULL) {
+            dlclose(module);
+        }
+    }
+    if (sFallback == NULL) {
+        ALOGE("FATAL: Could not find gralloc.default.so!");
+    }
+}
diff --git a/system/hals/Android.mk b/system/hals/Android.mk
new file mode 100644
index 0000000..ee00507
--- /dev/null
+++ b/system/hals/Android.mk
@@ -0,0 +1,97 @@
+#
+# Copyright 2015 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := [email protected]
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../LICENSE
+LOCAL_MODULE_RELATIVE_PATH := hw
+LOCAL_VENDOR_MODULE := true
+LOCAL_SRC_FILES := allocator3.cpp
+LOCAL_INIT_RC := [email protected]
+LOCAL_VINTF_FRAGMENTS := android.hardware.graphics.gralloc3.ranchu.xml
+
+LOCAL_SHARED_LIBRARIES += \
+    [email protected] \
+    [email protected] \
+    libOpenglSystemCommon \
+    libOpenglCodecCommon$(GOLDFISH_OPENGL_LIB_SUFFIX) \
+    libbase \
+    libcutils \
+    libhidlbase \
+    liblog \
+    libutils \
+
+LOCAL_STATIC_LIBRARIES += libqemupipe.ranchu libGoldfishAddressSpace$(GOLDFISH_OPENGL_LIB_SUFFIX)
+LOCAL_HEADER_LIBRARIES += libgralloc_cb.ranchu
+
+LOCAL_C_INCLUDES += \
+    device/generic/goldfish-opengl/system/include \
+    device/generic/goldfish-opengl/system/OpenglSystemCommon \
+    device/generic/goldfish-opengl/shared/GoldfishAddressSpace/include \
+    device/generic/goldfish-opengl/shared/OpenglCodecCommon \
+    device/generic/goldfish-opengl/host/include/libOpenglRender \
+    device/generic/goldfish-opengl/system/renderControl_enc \
+
+LOCAL_CFLAGS += -DVIRTIO_GPU
+LOCAL_C_INCLUDES += external/libdrm external/minigbm/cros_gralloc
+LOCAL_SHARED_LIBRARIES += libdrm
+
+include $(BUILD_EXECUTABLE)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := [email protected]
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../LICENSE
+LOCAL_MODULE_RELATIVE_PATH := hw
+LOCAL_VENDOR_MODULE := true
+LOCAL_SRC_FILES := mapper3.cpp
+
+#     [email protected] \
+
+LOCAL_SHARED_LIBRARIES += \
+    [email protected] \
+    libOpenglSystemCommon \
+    libOpenglCodecCommon$(GOLDFISH_OPENGL_LIB_SUFFIX) \
+    libbase \
+    libcutils \
+    libhidlbase \
+    liblog \
+    libutils \
+    libsync \
+	libandroidemu \
+
+LOCAL_STATIC_LIBRARIES += libqemupipe.ranchu libGoldfishAddressSpace$(GOLDFISH_OPENGL_LIB_SUFFIX)
+LOCAL_HEADER_LIBRARIES += libgralloc_cb.ranchu
+
+LOCAL_C_INCLUDES += \
+    device/generic/goldfish-opengl/system/include \
+    device/generic/goldfish-opengl/system/OpenglSystemCommon \
+    device/generic/goldfish-opengl/shared/GoldfishAddressSpace/include \
+    device/generic/goldfish-opengl/shared/OpenglCodecCommon \
+    device/generic/goldfish-opengl/host/include/libOpenglRender \
+    device/generic/goldfish-opengl/system/renderControl_enc \
+
+LOCAL_CFLAGS += -DVIRTIO_GPU
+LOCAL_C_INCLUDES += external/libdrm external/minigbm/cros_gralloc
+LOCAL_SHARED_LIBRARIES += libdrm
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/system/hals/allocator3.cpp b/system/hals/allocator3.cpp
new file mode 100644
index 0000000..3ff8c84
--- /dev/null
+++ b/system/hals/allocator3.cpp
@@ -0,0 +1,429 @@
+/*
+* Copyright (C) 2020 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include <android-base/unique_fd.h>
+#include <android/hardware/graphics/allocator/3.0/IAllocator.h>
+#include <android/hardware/graphics/mapper/3.0/IMapper.h>
+#include <hidl/LegacySupport.h>
+#include <qemu_pipe_bp.h>
+
+#include "glUtils.h"
+#include "cb_handle_30.h"
+#include "host_connection_session.h"
+#include "types.h"
+#include "debug.h"
+
+const int kOMX_COLOR_FormatYUV420Planar = 19;
+const int kC2_COLOR_FormatYCBCR_420_888 = 0x23;
+
+using ::android::hardware::hidl_handle;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::hidl_bitfield;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+
+using ::android::hardware::graphics::common::V1_2::PixelFormat;
+using ::android::hardware::graphics::common::V1_0::BufferUsage;
+
+namespace AllocatorV3 = ::android::hardware::graphics::allocator::V3_0;
+namespace MapperV3 = ::android::hardware::graphics::mapper::V3_0;
+
+using IAllocator3 = AllocatorV3::IAllocator;
+using IMapper3 = MapperV3::IMapper;
+using Error3 = MapperV3::Error;
+using BufferDescriptorInfo = IMapper3::BufferDescriptorInfo;
+
+namespace {
+bool needGpuBuffer(const uint32_t usage) {
+    return usage & (BufferUsage::GPU_TEXTURE
+                    | BufferUsage::GPU_RENDER_TARGET
+                    | BufferUsage::COMPOSER_OVERLAY
+                    | BufferUsage::COMPOSER_CLIENT_TARGET
+                    | BufferUsage::GPU_DATA_BUFFER);
+}
+}  // namespace
+
+class GoldfishAllocator : public IAllocator3 {
+public:
+    GoldfishAllocator() : m_hostConn(HostConnection::createUnique()) {}
+
+    Return<void> dumpDebugInfo(dumpDebugInfo_cb hidl_cb) {
+        hidl_cb("GoldfishAllocator::dumpDebugInfo is not implemented");
+        return {};
+    }
+
+    Return<void> allocate(const hidl_vec<uint32_t>& rawDescriptor,
+                          uint32_t count,
+                          allocate_cb hidl_cb) {
+        uint32_t stride = 0;
+        std::vector<cb_handle_30_t*> cbs;
+        cbs.reserve(count);
+
+        const Error3 e = allocateImpl(rawDescriptor, count, &stride, &cbs);
+        if (e == Error3::NONE) {
+            hidl_vec<hidl_handle> handles(cbs.cbegin(), cbs.cend());
+            hidl_cb(Error3::NONE, stride, handles);
+        } else {
+            hidl_cb(e, 0, {});
+        }
+
+        for (cb_handle_30_t* cb : cbs) {
+            freeCb(std::unique_ptr<cb_handle_30_t>(cb));
+        }
+
+        return {};
+    }
+
+private:
+    // this function should be in sync with GoldfishMapper::isSupportedImpl
+    Error3 allocateImpl(const hidl_vec<uint32_t>& rawDescriptor,
+                        uint32_t count,
+                        uint32_t* pStride,
+                        std::vector<cb_handle_30_t*>* cbs) {
+        BufferDescriptorInfo descriptor;
+        if (!decodeBufferDescriptorInfo(rawDescriptor, &descriptor)) {
+            RETURN_ERROR(Error3::BAD_DESCRIPTOR);
+        }
+
+        if (!descriptor.width) { RETURN_ERROR(Error3::UNSUPPORTED); }
+        if (!descriptor.height) { RETURN_ERROR(Error3::UNSUPPORTED); }
+        if (descriptor.layerCount != 1) { RETURN_ERROR(Error3::UNSUPPORTED); }
+
+        uint32_t usage = descriptor.usage;
+
+        int bpp = 1;
+        int glFormat = 0;
+        int glType = 0;
+        int align = 1;
+        bool yuv_format = false;
+        EmulatorFrameworkFormat emulatorFrameworkFormat =
+            EmulatorFrameworkFormat::GL_COMPATIBLE;
+
+        PixelFormat format;
+        Error3 e = getBufferFormat(descriptor.format, &usage, &format);
+        if (e != Error3::NONE) {
+            ALOGE("%s:%d Unsupported format: frameworkFormat=%d, usage=%x",
+                  __func__, __LINE__, descriptor.format, usage);
+            return e;
+        }
+
+        switch (format) {
+        case PixelFormat::RGBA_8888:
+        case PixelFormat::RGBX_8888:
+        case PixelFormat::BGRA_8888:
+            bpp = 4;
+            glFormat = GL_RGBA;
+            glType = GL_UNSIGNED_BYTE;
+            break;
+
+        case PixelFormat::RGB_888:
+            if (needGpuBuffer(usage)) {
+                RETURN_ERROR(Error3::UNSUPPORTED);
+            }
+            bpp = 3;
+            glFormat = GL_RGB;
+            glType = GL_UNSIGNED_BYTE;
+            break;
+
+        case PixelFormat::RGB_565:
+            bpp = 2;
+            glFormat = GL_RGB565;
+            glType = GL_UNSIGNED_SHORT_5_6_5;
+            break;
+
+        case PixelFormat::RGBA_FP16:
+            bpp = 8;
+            glFormat = GL_RGBA16F;
+            glType = GL_HALF_FLOAT;
+            break;
+
+        case PixelFormat::RGBA_1010102:
+            bpp = 4;
+            glFormat = GL_RGB10_A2;
+            glType = GL_UNSIGNED_INT_2_10_10_10_REV;
+            break;
+
+        case PixelFormat::RAW16:
+        case PixelFormat::Y16:
+            if (needGpuBuffer(usage)) {
+                RETURN_ERROR(Error3::UNSUPPORTED);
+            }
+            bpp = 2;
+            align = 16 * bpp;
+            glFormat = GL_LUMINANCE;
+            glType = GL_UNSIGNED_SHORT;
+            break;
+
+        case PixelFormat::BLOB:
+            if (needGpuBuffer(usage)) {
+                RETURN_ERROR(Error3::UNSUPPORTED);
+            }
+            glFormat = GL_LUMINANCE;
+            glType = GL_UNSIGNED_BYTE;
+            break;
+
+        case PixelFormat::YCRCB_420_SP:
+            if (needGpuBuffer(usage)) {
+                RETURN_ERROR(Error3::UNSUPPORTED);
+            }
+            yuv_format = true;
+            break;
+
+        case PixelFormat::YV12:
+            align = 16;
+            yuv_format = true;
+            // We are going to use RGB8888 on the host for Vulkan
+            glFormat = GL_RGBA;
+            glType = GL_UNSIGNED_BYTE;
+            emulatorFrameworkFormat = EmulatorFrameworkFormat::YV12;
+            break;
+
+        case PixelFormat::YCBCR_420_888:
+            yuv_format = true;
+            // We are going to use RGBA 8888 on the host
+            glFormat = GL_RGBA;
+            glType = GL_UNSIGNED_BYTE;
+            emulatorFrameworkFormat = EmulatorFrameworkFormat::YUV_420_888;
+            break;
+
+        case PixelFormat::YCBCR_P010:
+            yuv_format = true;
+            glFormat = GL_RGBA;
+            glType = GL_UNSIGNED_BYTE;
+            bpp = 2;
+            break;
+
+        default:
+            ALOGE("%s:%d Unsupported format: format=%d, frameworkFormat=%d, usage=%x",
+                  __func__, __LINE__, format, descriptor.format, usage);
+            RETURN_ERROR(Error3::UNSUPPORTED);
+        }
+
+        const uint32_t width = descriptor.width;
+        const uint32_t height = descriptor.height;
+        size_t bufferSize;
+        uint32_t stride;
+
+        if (usage & (BufferUsage::CPU_READ_MASK | BufferUsage::CPU_WRITE_MASK)) {
+            const size_t align1 = align - 1;
+            if (yuv_format) {
+                const size_t yStride = (width * bpp + align1) & ~align1;
+                const size_t uvStride = (yStride / 2 + align1) & ~align1;
+                const size_t uvHeight = height / 2;
+                bufferSize = yStride * height + 2 * (uvHeight * uvStride);
+                stride = yStride / bpp;
+            } else {
+                const size_t bpr = (width * bpp + align1) & ~align1;
+                bufferSize = bpr * height;
+                stride = bpr / bpp;
+            }
+        } else {
+            bufferSize = 0;
+            stride = 0;
+        }
+
+        *pStride = stride;
+
+        return allocateImpl2(usage,
+                             width, height,
+                             format, emulatorFrameworkFormat,
+                             glFormat, glType,
+                             bufferSize,
+                             bpp, stride,
+                             count, cbs);
+    }
+
+    Error3 allocateImpl2(const uint32_t usage,
+                         const uint32_t width, const uint32_t height,
+                         const PixelFormat format,
+                         const EmulatorFrameworkFormat emulatorFrameworkFormat,
+                         const int glFormat, const int glType,
+                         const size_t bufferSize,
+                         const uint32_t bytesPerPixel,
+                         const uint32_t stride,
+                         const uint32_t count,
+                         std::vector<cb_handle_30_t*>* cbs) {
+        for (uint32_t i = 0; i < count; ++i) {
+            cb_handle_30_t* cb;
+            Error3 e = allocateCb(usage,
+                                  width, height,
+                                  format, emulatorFrameworkFormat,
+                                  glFormat, glType,
+                                  bufferSize,
+                                  bytesPerPixel, stride,
+                                  &cb);
+            if (e == Error3::NONE) {
+                cbs->push_back(cb);
+            } else {
+                return e;
+            }
+        }
+
+        RETURN(Error3::NONE);
+    }
+
+    // see GoldfishMapper::encodeBufferDescriptorInfo
+    static bool decodeBufferDescriptorInfo(const hidl_vec<uint32_t>& raw,
+                                           BufferDescriptorInfo* d) {
+        if (raw.size() == 5) {
+            d->width = raw[0];
+            d->height = raw[1];
+            d->layerCount = raw[2];
+            d->format = static_cast<PixelFormat>(raw[3]);
+            d->usage = raw[4];
+
+            RETURN(true);
+        } else {
+            RETURN_ERROR(false);
+        }
+    }
+
+    static Error3 getBufferFormat(const PixelFormat frameworkFormat, uint32_t* pusage,
+                                  PixelFormat* format) {
+        uint32_t& usage = *pusage;
+        if (frameworkFormat == PixelFormat::IMPLEMENTATION_DEFINED) {
+            RETURN_ERROR(Error3::UNSUPPORTED);
+        } else if ((static_cast<int>(frameworkFormat) == kOMX_COLOR_FormatYUV420Planar ||
+                    static_cast<int>(frameworkFormat) == kC2_COLOR_FormatYCBCR_420_888) &&
+                   (usage & BufferUsage::VIDEO_DECODER)) {
+            ALOGW("gralloc_alloc: Requested OMX_COLOR_FormatYUV420Planar, given "
+              "YCbCr_420_888, taking experimental path. "
+              "usage=%x", usage);
+            *format = PixelFormat::YCBCR_420_888;
+            usage = static_cast<typeof(usage)>(usage | BufferUsage::CPU_READ_OFTEN);
+            usage = static_cast<typeof(usage)>(usage | BufferUsage::CPU_WRITE_OFTEN);
+            RETURN(Error3::NONE);
+        } else {
+            *format = frameworkFormat;
+            RETURN(Error3::NONE);
+        }
+    }
+
+    Error3 allocateCb(const uint32_t usage,
+                      const uint32_t width, const uint32_t height,
+                      const PixelFormat format,
+                      const EmulatorFrameworkFormat emulatorFrameworkFormat,
+                      const int glFormat, const int glType,
+                      const size_t bufferSize,
+                      const int32_t bytesPerPixel,
+                      const int32_t stride,
+                      cb_handle_30_t** cb) {
+        const HostConnectionSession conn = getHostConnectionSession();
+        ExtendedRCEncoderContext *const rcEnc = conn.getRcEncoder();
+        CRASH_IF(!rcEnc, "conn.getRcEncoder() failed");
+
+        android::base::unique_fd cpuAlocatorFd;
+        GoldfishAddressSpaceBlock bufferBits;
+        if (bufferSize > 0) {
+            GoldfishAddressSpaceHostMemoryAllocator host_memory_allocator(
+                rcEnc->featureInfo_const()->hasSharedSlotsHostMemoryAllocator);
+            if (!host_memory_allocator.is_opened()) {
+                RETURN_ERROR(Error3::NO_RESOURCES);
+            }
+
+            if (host_memory_allocator.hostMalloc(&bufferBits, bufferSize)) {
+                RETURN_ERROR(Error3::NO_RESOURCES);
+            }
+
+            cpuAlocatorFd.reset(host_memory_allocator.release());
+        }
+
+        uint32_t hostHandle = 0;
+        android::base::unique_fd hostHandleRefCountFd;
+        if (needGpuBuffer(usage)) {
+            hostHandleRefCountFd.reset(qemu_pipe_open("refcount"));
+            if (!hostHandleRefCountFd.ok()) {
+                RETURN_ERROR(Error3::NO_RESOURCES);
+            }
+
+            const GLenum allocFormat =
+                (PixelFormat::RGBX_8888 == format) ? GL_RGB : glFormat;
+
+            hostHandle = rcEnc->rcCreateColorBufferDMA(
+                rcEnc,
+                width, height,
+                allocFormat, static_cast<int>(emulatorFrameworkFormat));
+
+            if (!hostHandle) {
+                RETURN_ERROR(Error3::NO_RESOURCES);
+            }
+
+            if (qemu_pipe_write(hostHandleRefCountFd.get(),
+                                &hostHandle,
+                                sizeof(hostHandle)) != sizeof(hostHandle)) {
+                rcEnc->rcCloseColorBuffer(rcEnc, hostHandle);
+                RETURN_ERROR(Error3::NO_RESOURCES);
+            }
+        }
+
+        std::unique_ptr<cb_handle_30_t> handle =
+            std::make_unique<cb_handle_30_t>(
+                cpuAlocatorFd.release(),
+                hostHandleRefCountFd.release(),
+                hostHandle,
+                usage,
+                width,
+                height,
+                static_cast<int>(format),
+                glFormat,
+                glType,
+                bufferSize,
+                bufferBits.guestPtr(),
+                bufferBits.size(),
+                bufferBits.offset(),
+                bytesPerPixel,
+                stride);
+
+        bufferBits.release();
+        *cb = handle.release();
+        RETURN(Error3::NONE);
+    }
+
+    void freeCb(std::unique_ptr<cb_handle_30_t> cb) {
+        if (cb->hostHandleRefcountFdIndex >= 0) {
+            ::close(cb->fds[cb->hostHandleRefcountFdIndex]);
+        }
+
+        if (cb->bufferFdIndex >= 0) {
+            GoldfishAddressSpaceBlock::memoryUnmap(cb->getBufferPtr(), cb->mmapedSize);
+            GoldfishAddressSpaceHostMemoryAllocator::closeHandle(cb->fds[cb->bufferFdIndex]);
+        }
+    }
+
+    HostConnectionSession getHostConnectionSession() const {
+        return HostConnectionSession(m_hostConn.get());
+    }
+
+    std::unique_ptr<HostConnection> m_hostConn;
+};
+
+int main(int, char**) {
+    using ::android::sp;
+
+    ::android::hardware::configureRpcThreadpool(4, true /* callerWillJoin */);
+
+    sp<IAllocator3> allocator(new GoldfishAllocator());
+    if (allocator->registerAsService() != ::android::NO_ERROR) {
+        ALOGE("failed to register graphics [email protected] service");
+        return -EINVAL;
+    }
+
+    ALOGI("graphics [email protected] service is initialized");
+    ::android::hardware::joinRpcThreadpool();
+
+    ALOGI("graphics [email protected] service is terminating");
+    return 0;
+}
diff --git a/system/hals/[email protected] b/system/hals/[email protected]
new file mode 100644
index 0000000..f874b14
--- /dev/null
+++ b/system/hals/[email protected]
@@ -0,0 +1,7 @@
+service vendor.gralloc-3-0 /vendor/bin/hw/[email protected]
+    interface [email protected]::IAllocator default
+    class hal animation
+    user system
+    group graphics drmrpc
+    capabilities SYS_NICE
+    onrestart restart surfaceflinger
diff --git a/system/hals/android.hardware.graphics.gralloc3.ranchu.xml b/system/hals/android.hardware.graphics.gralloc3.ranchu.xml
new file mode 100644
index 0000000..f3e7d3b
--- /dev/null
+++ b/system/hals/android.hardware.graphics.gralloc3.ranchu.xml
@@ -0,0 +1,20 @@
+<manifest version="1.0" type="device">
+    <hal format="hidl">
+        <name>android.hardware.graphics.allocator</name>
+        <transport>hwbinder</transport>
+        <version>3.0</version>
+        <interface>
+            <name>IAllocator</name>
+            <instance>default</instance>
+        </interface>
+    </hal>
+    <hal format="hidl">
+        <name>android.hardware.graphics.mapper</name>
+        <transport arch="32+64">passthrough</transport>
+        <version>3.0</version>
+        <interface>
+            <name>IMapper</name>
+            <instance>default</instance>
+        </interface>
+    </hal>
+</manifest>
diff --git a/system/hals/cb_handle_30.h b/system/hals/cb_handle_30.h
new file mode 100644
index 0000000..ca305c9
--- /dev/null
+++ b/system/hals/cb_handle_30.h
@@ -0,0 +1,123 @@
+/*
+* Copyright 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#ifndef SYSTEM_HALS_CB_HANDLE_30_H
+#define SYSTEM_HALS_CB_HANDLE_30_H
+
+#include <gralloc_cb_bp.h>
+#include "goldfish_address_space.h"
+
+const uint32_t CB_HANDLE_MAGIC_30 = CB_HANDLE_MAGIC_BASE | 0x2;
+
+struct cb_handle_30_t : public cb_handle_t {
+    cb_handle_30_t(int p_bufferFd,
+                   int p_hostHandleRefCountFd,
+                   uint32_t p_hostHandle,
+                   uint32_t p_usage,
+                   uint32_t p_width,
+                   uint32_t p_height,
+                   uint32_t p_format,
+                   uint32_t p_glFormat,
+                   uint32_t p_glType,
+                   uint32_t p_bufSize,
+                   void* p_bufPtr,
+                   uint32_t p_mmapedSize,
+                   uint64_t p_mmapedOffset,
+                   uint32_t p_bytesPerPixel,
+                   uint32_t p_stride)
+            : cb_handle_t(CB_HANDLE_MAGIC_30,
+                          p_hostHandle,
+                          p_format,
+                          p_stride,
+                          p_bufSize,
+                          p_mmapedOffset),
+              usage(p_usage),
+              width(p_width),
+              height(p_height),
+              glFormat(p_glFormat),
+              glType(p_glType),
+              bytesPerPixel(p_bytesPerPixel),
+              mmapedSize(p_mmapedSize),
+              lockedUsage(0) {
+        fds[0] = -1;
+        fds[1] = -1;
+        int n = 0;
+        if (p_bufferFd >= 0) {
+            bufferFdIndex = n++;
+            fds[bufferFdIndex] = p_bufferFd;
+        } else {
+            bufferFdIndex = -1;
+        }
+
+        if (p_hostHandleRefCountFd >= 0) {
+            hostHandleRefcountFdIndex = n++;
+            fds[hostHandleRefcountFdIndex] = p_hostHandleRefCountFd;
+        } else {
+            hostHandleRefcountFdIndex = -1;
+        }
+
+        numFds = n;
+        numInts = CB_HANDLE_NUM_INTS(n);
+        setBufferPtr(p_bufPtr);
+    }
+
+    bool isValid() const { return (version == sizeof(native_handle_t)) && (magic == CB_HANDLE_MAGIC_30); }
+
+    void* getBufferPtr() const {
+        const uint64_t addr = (uint64_t(bufferPtrHi) << 32) | bufferPtrLo;
+        return reinterpret_cast<void*>(static_cast<uintptr_t>(addr));
+    }
+
+    void setBufferPtr(void* ptr) {
+        const uint64_t addr = static_cast<uint64_t>(reinterpret_cast<uintptr_t>(ptr));
+        bufferPtrLo = uint32_t(addr);
+        bufferPtrHi = uint32_t(addr >> 32);
+    }
+
+    static cb_handle_30_t* from(void* p) {
+        if (!p) { return nullptr; }
+        cb_handle_30_t* cb = static_cast<cb_handle_30_t*>(p);
+        return cb->isValid() ? cb : nullptr;
+    }
+
+    static const cb_handle_30_t* from(const void* p) {
+        return from(const_cast<void*>(p));
+    }
+
+    static cb_handle_30_t* from_unconst(const void* p) {
+        return from(const_cast<void*>(p));
+    }
+
+    uint32_t usage;         // usage bits the buffer was created with
+    uint32_t width;         // buffer width
+    uint32_t height;        // buffer height
+    uint32_t glFormat;      // OpenGL format enum used for host h/w color buffer
+    uint32_t glType;        // OpenGL type enum used when uploading to host
+    uint32_t bytesPerPixel;
+    uint32_t mmapedSize;    // real allocation side
+    uint32_t bufferPtrLo;
+    uint32_t bufferPtrHi;
+    uint8_t  lockedUsage;
+    int8_t   bufferFdIndex;
+    int8_t   hostHandleRefcountFdIndex;
+    int8_t   unused;
+    uint32_t lockedLeft;    // region of buffer locked for s/w write
+    uint32_t lockedTop;
+    uint32_t lockedWidth;
+    uint32_t lockedHeight;
+};
+
+#endif // SYSTEM_HALS_CB_HANDLE_30_H
diff --git a/system/hals/debug.h b/system/hals/debug.h
new file mode 100644
index 0000000..f8e41b4
--- /dev/null
+++ b/system/hals/debug.h
@@ -0,0 +1,44 @@
+/*
+* Copyright (C) 2020 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#ifndef GOLDFISH_OPENGL_SYSTEM_HALS_DEBUG_H_INCLUDED
+#define GOLDFISH_OPENGL_SYSTEM_HALS_DEBUG_H_INCLUDED
+
+#include <log/log.h>
+
+#define RETURN(X) return (X)
+
+#define RETURN_ERROR(X) \
+    do { \
+        ALOGE("%s:%d failed with '%s'", __func__, __LINE__, #X); \
+        return (X); \
+    } while (false)
+
+#define CRASH(MSG) \
+    do { \
+        ALOGE("%s:%d crashed with '%s'", __func__, __LINE__, MSG); \
+        ::abort(); \
+    } while (false)
+
+#define CRASH_IF(COND, MSG) \
+    do { \
+        if ((COND)) { \
+            ALOGE("%s:%d crashed on '%s' with '%s'", __func__, __LINE__, #COND, MSG); \
+            ::abort(); \
+        } \
+    } while (false)
+
+#endif  // GOLDFISH_OPENGL_SYSTEM_HALS_DEBUG_H_INCLUDED
diff --git a/system/hals/host_connection_session.h b/system/hals/host_connection_session.h
new file mode 100644
index 0000000..12d3b76
--- /dev/null
+++ b/system/hals/host_connection_session.h
@@ -0,0 +1,56 @@
+/*
+* Copyright (C) 2020 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#ifndef GOLDFISH_OPENGL_SYSTEM_HALS_HOST_CONNECTION_SESSION_H_INCLUDED
+#define GOLDFISH_OPENGL_SYSTEM_HALS_HOST_CONNECTION_SESSION_H_INCLUDED
+
+#include "HostConnection.h"
+
+class HostConnectionSession {
+public:
+    explicit HostConnectionSession(HostConnection* hc) : conn(hc) {
+        hc->lock();
+    }
+
+    ~HostConnectionSession() {
+        if (conn) {
+            conn->unlock();
+        }
+     }
+
+    HostConnectionSession(HostConnectionSession&& rhs) : conn(rhs.conn) {
+        rhs.conn = nullptr;
+    }
+
+    HostConnectionSession& operator=(HostConnectionSession&& rhs) {
+        if (this != &rhs) {
+            std::swap(conn, rhs.conn);
+        }
+        return *this;
+    }
+
+    HostConnectionSession(const HostConnectionSession&) = delete;
+    HostConnectionSession& operator=(const HostConnectionSession&) = delete;
+
+    ExtendedRCEncoderContext* getRcEncoder() const {
+        return conn->rcEncoder();
+    }
+
+private:
+    HostConnection* conn;
+};
+
+#endif  // GOLDFISH_OPENGL_SYSTEM_HALS_HOST_CONNECTION_SESSION_H_INCLUDED
diff --git a/system/hals/mapper3.cpp b/system/hals/mapper3.cpp
new file mode 100644
index 0000000..46956d6
--- /dev/null
+++ b/system/hals/mapper3.cpp
@@ -0,0 +1,668 @@
+/*
+* Copyright (C) 2020 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include <android/hardware/graphics/mapper/3.0/IMapper.h>
+#include <cutils/native_handle.h>
+#include <sync/sync.h>
+
+#include "cb_handle_30.h"
+#include "host_connection_session.h"
+#include "FormatConversions.h"
+#include "debug.h"
+
+#include "aemu/base/Tracing.h"
+
+#define ATRACE_TAG ATRACE_TAG_GRAPHICS
+
+const int kOMX_COLOR_FormatYUV420Planar = 19;
+
+using ::android::hardware::hidl_handle;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+
+using ::android::hardware::graphics::common::V1_2::PixelFormat;
+using ::android::hardware::graphics::common::V1_0::BufferUsage;
+
+namespace MapperV3 = ::android::hardware::graphics::mapper::V3_0;
+
+using IMapper3 = MapperV3::IMapper;
+using Error3 = MapperV3::Error;
+using YCbCrLayout3 = MapperV3::YCbCrLayout;
+
+namespace {
+size_t align(const size_t v, const size_t a) { return (v + a - 1) & ~(a - 1); }
+
+static int waitFenceFd(const int fd, const char* logname) {
+    const int warningTimeout = 5000;
+    if (sync_wait(fd, warningTimeout) < 0) {
+        if (errno == ETIME) {
+            ALOGW("%s: fence %d didn't signal in %d ms", logname, fd, warningTimeout);
+            if (sync_wait(fd, -1) < 0) {
+                RETURN_ERROR(errno);
+            } else {
+                RETURN(0);
+            }
+        } else {
+            RETURN_ERROR(errno);
+        }
+    } else {
+        RETURN(0);
+    }
+}
+
+int waitHidlFence(const hidl_handle& hidlHandle, const char* logname) {
+    const native_handle_t* nativeHandle = hidlHandle.getNativeHandle();
+
+    if (!nativeHandle) {
+        RETURN(0);
+    }
+    if (nativeHandle->numFds > 1) {
+        RETURN_ERROR(-EINVAL);
+    }
+    if (nativeHandle->numInts != 0) {
+        RETURN_ERROR(-EINVAL);
+    }
+
+    return waitFenceFd(nativeHandle->data[0], logname);
+}
+
+bool needGpuBuffer(const uint32_t usage) {
+    return usage & (BufferUsage::GPU_TEXTURE
+                    | BufferUsage::GPU_RENDER_TARGET
+                    | BufferUsage::COMPOSER_OVERLAY
+                    | BufferUsage::COMPOSER_CLIENT_TARGET
+                    | BufferUsage::GPU_DATA_BUFFER);
+}
+
+constexpr uint64_t one64 = 1;
+
+constexpr uint64_t ones(int from, int to) {
+    return ((one64 << (to - from + 1)) - 1) << from;
+}
+
+class GoldfishMapper : public IMapper3 {
+public:
+    GoldfishMapper() : m_hostConn(HostConnection::createUnique()) {
+        GoldfishAddressSpaceHostMemoryAllocator host_memory_allocator(false);
+        CRASH_IF(!host_memory_allocator.is_opened(),
+                 "GoldfishAddressSpaceHostMemoryAllocator failed to open");
+
+        GoldfishAddressSpaceBlock bufferBits;
+        CRASH_IF(host_memory_allocator.hostMalloc(&bufferBits, 256),
+                 "hostMalloc failed");
+
+        m_physAddrToOffset = bufferBits.physAddr() - bufferBits.offset();
+
+        host_memory_allocator.hostFree(&bufferBits);
+    }
+
+    Return<void> importBuffer(const hidl_handle& hh,
+                              importBuffer_cb hidl_cb) {
+        native_handle_t* imported = nullptr;
+        const Error3 e = importBufferImpl(hh.getNativeHandle(), &imported);
+        if (e == Error3::NONE) {
+            hidl_cb(Error3::NONE, imported);
+        } else {
+            hidl_cb(e, nullptr);
+        }
+        return {};
+    }
+
+    Return<Error3> freeBuffer(void* raw) {
+        if (!raw) {
+            RETURN_ERROR(Error3::BAD_BUFFER);
+        }
+        cb_handle_30_t* cb = cb_handle_30_t::from(raw);
+        if (!cb) {
+            RETURN_ERROR(Error3::BAD_BUFFER);
+        }
+
+        if (cb->mmapedSize > 0) {
+            GoldfishAddressSpaceBlock::memoryUnmap(cb->getBufferPtr(), cb->mmapedSize);
+        }
+
+        native_handle_close(cb);
+        native_handle_delete(cb);
+
+        RETURN(Error3::NONE);
+    }
+
+    Return<void> lock(void* raw,
+                      uint64_t cpuUsage,
+                      const Rect& accessRegion,
+                      const hidl_handle& acquireFence,
+                      lock_cb hidl_cb) {
+        void* ptr = nullptr;
+        int32_t bytesPerPixel = 0;
+        int32_t bytesPerStride = 0;
+
+        const Error3 e = lockImpl(raw, cpuUsage, accessRegion, acquireFence,
+                                  &ptr, &bytesPerPixel, &bytesPerStride);
+        if (e == Error3::NONE) {
+            hidl_cb(Error3::NONE, ptr, bytesPerPixel, bytesPerStride);
+        } else {
+            hidl_cb(e, nullptr, 0, 0);
+        }
+        return {};
+    }
+
+    Return<void> lockYCbCr(void* raw,
+                           uint64_t cpuUsage,
+                           const Rect& accessRegion,
+                           const hidl_handle& acquireFence,
+                           lockYCbCr_cb hidl_cb) {
+        YCbCrLayout3 ycbcr = {};
+        const Error3 e = lockYCbCrImpl(raw, cpuUsage, accessRegion, acquireFence,
+                                       &ycbcr);
+        if (e == Error3::NONE) {
+            hidl_cb(Error3::NONE, ycbcr);
+        } else {
+            hidl_cb(e, {});
+        }
+        return {};
+    }
+
+    Return<void> unlock(void* raw, unlock_cb hidl_cb) {
+        hidl_cb(unlockImpl(raw), {});
+        return {};
+
+    }
+
+    Return<void> createDescriptor(const BufferDescriptorInfo& description,
+                                  createDescriptor_cb hidl_cb) {
+        hidl_vec<uint32_t> raw;
+        encodeBufferDescriptorInfo(description, &raw);
+        hidl_cb(Error3::NONE, raw);
+        return {};
+    }
+
+    Return<void> isSupported(const IMapper::BufferDescriptorInfo& description,
+                             isSupported_cb hidl_cb) {
+        hidl_cb(Error3::NONE, isSupportedImpl(description));
+        return {};
+    }
+
+    Return<Error3> validateBufferSize(void* buffer,
+                                      const BufferDescriptorInfo& descriptor,
+                                      uint32_t stride) {
+        const cb_handle_30_t* cb = cb_handle_30_t::from(buffer);
+        if (cb) {
+            return validateBufferSizeImpl(*cb, descriptor, stride);
+        } else {
+            RETURN_ERROR(Error3::BAD_BUFFER);
+        }
+    }
+
+    Return<void> getTransportSize(void* buffer,
+                                  getTransportSize_cb hidl_cb) {
+        const cb_handle_30_t* cb = cb_handle_30_t::from(buffer);
+        if (cb) {
+            hidl_cb(Error3::NONE, cb->numFds, cb->numInts);
+        } else {
+            hidl_cb(Error3::BAD_BUFFER, 0, 0);
+        }
+
+        return {};
+    }
+
+private:  // **** impl ****
+    Error3 importBufferImpl(const native_handle_t* nh, native_handle_t** phandle) {
+        if (!nh) {
+            RETURN_ERROR(Error3::BAD_BUFFER);
+        }
+        native_handle_t* imported = native_handle_clone(nh);
+        if (!imported) {
+            RETURN_ERROR(Error3::BAD_BUFFER);
+        }
+        cb_handle_30_t* cb = cb_handle_30_t::from(imported);
+        if (!cb) {
+            native_handle_close(imported);
+            native_handle_delete(imported);
+            RETURN_ERROR(Error3::BAD_BUFFER);
+        }
+
+        if (cb->mmapedSize > 0) {
+            LOG_ALWAYS_FATAL_IF(cb->bufferFdIndex < 0);
+            void* ptr;
+            const int res = GoldfishAddressSpaceBlock::memoryMap(
+                cb->getBufferPtr(),
+                cb->mmapedSize,
+                cb->fds[cb->bufferFdIndex],
+                cb->getMmapedOffset(),
+                &ptr);
+            if (res) {
+                native_handle_close(imported);
+                native_handle_delete(imported);
+                RETURN_ERROR(Error3::NO_RESOURCES);
+            }
+            cb->setBufferPtr(ptr);
+        }
+
+        *phandle = imported;
+        RETURN(Error3::NONE);
+    }
+
+    void setLocked(cb_handle_30_t* cb, const uint8_t checkedUsage,
+                   const Rect& accessRegion) {
+        if (checkedUsage & BufferUsage::CPU_WRITE_MASK) {
+            cb->lockedLeft = accessRegion.left;
+            cb->lockedTop = accessRegion.top;
+            cb->lockedWidth = accessRegion.width;
+            cb->lockedHeight = accessRegion.height;
+        } else {
+            cb->lockedLeft = 0;
+            cb->lockedTop = 0;
+            cb->lockedWidth = cb->width;
+            cb->lockedHeight = cb->height;
+        }
+        cb->lockedUsage = checkedUsage;
+    }
+
+    Error3 lockImpl(void* raw,
+                    const uint64_t uncheckedUsage,
+                    const Rect& accessRegion,
+                    const hidl_handle& acquireFence,
+                    void** pptr,
+                    int32_t* pBytesPerPixel,
+                    int32_t* pBytesPerStride) {
+        if (!raw) {
+            RETURN_ERROR(Error3::BAD_BUFFER);
+        }
+        cb_handle_30_t* cb = cb_handle_30_t::from(raw);
+        if (!cb) {
+            RETURN_ERROR(Error3::BAD_BUFFER);
+        }
+        if (cb->lockedUsage) {
+            RETURN_ERROR(Error3::BAD_VALUE);
+        }
+        const uint8_t checkedUsage = uncheckedUsage & cb->usage &
+            (BufferUsage::CPU_READ_MASK | BufferUsage::CPU_WRITE_MASK);
+        if (checkedUsage == 0) {
+            RETURN_ERROR(Error3::BAD_VALUE);
+        }
+        if (!cb->bufferSize) {
+            RETURN_ERROR(Error3::BAD_BUFFER);
+        }
+        char* const bufferBits = static_cast<char*>(cb->getBufferPtr());
+        if (!bufferBits) {
+            RETURN_ERROR(Error3::BAD_BUFFER);
+        }
+        if (waitHidlFence(acquireFence, __func__)) {
+            RETURN_ERROR(Error3::BAD_VALUE);
+        }
+
+        if (cb->hostHandle) {
+            const Error3 e = lockHostImpl(*cb, checkedUsage, accessRegion, bufferBits);
+            if (e != Error3::NONE) {
+                return e;
+            }
+        }
+
+        setLocked(cb, checkedUsage, accessRegion);
+
+        *pptr = bufferBits;
+        *pBytesPerPixel = cb->bytesPerPixel;
+        *pBytesPerStride = cb->bytesPerPixel * cb->stride;
+        RETURN(Error3::NONE);
+    }
+
+    Error3 lockYCbCrImpl(void* raw,
+                         const uint64_t uncheckedUsage,
+                         const Rect& accessRegion,
+                         const hidl_handle& acquireFence,
+                         YCbCrLayout3* pYcbcr) {
+        if (!raw) {
+            RETURN_ERROR(Error3::BAD_BUFFER);
+        }
+        cb_handle_30_t* cb = cb_handle_30_t::from(raw);
+        if (!cb) {
+            RETURN_ERROR(Error3::BAD_BUFFER);
+        }
+        if (cb->lockedUsage) {
+            RETURN_ERROR(Error3::BAD_VALUE);
+        }
+        const uint8_t checkedUsage = uncheckedUsage & cb->usage &
+            (BufferUsage::CPU_READ_MASK | BufferUsage::CPU_WRITE_MASK);
+        if (checkedUsage == 0) {
+            RETURN_ERROR(Error3::BAD_VALUE);
+        }
+        if (!cb->bufferSize) {
+            RETURN_ERROR(Error3::BAD_BUFFER);
+        }
+        char* const bufferBits = static_cast<char*>(cb->getBufferPtr());
+        if (!bufferBits) {
+            RETURN_ERROR(Error3::BAD_BUFFER);
+        }
+        if (waitHidlFence(acquireFence, __func__)) {
+            RETURN_ERROR(Error3::BAD_VALUE);
+        }
+
+        size_t uOffset;
+        size_t vOffset;
+        size_t yStride;
+        size_t cStride;
+        size_t cStep;
+        switch (static_cast<PixelFormat>(cb->format)) {
+        case PixelFormat::YCRCB_420_SP:
+            yStride = cb->width;
+            cStride = yStride;
+            vOffset = yStride * cb->height;
+            uOffset = vOffset + 1;
+            cStep = 2;
+            break;
+
+        case PixelFormat::YV12:
+            // https://developer.android.com/reference/android/graphics/ImageFormat.html#YV12
+            yStride = align(cb->width, 16);
+            cStride = align(yStride / 2, 16);
+            vOffset = yStride * cb->height;
+            uOffset = vOffset + (cStride * cb->height / 2);
+            cStep = 1;
+            break;
+
+        case PixelFormat::YCBCR_420_888:
+            yStride = cb->width;
+            cStride = yStride / 2;
+            uOffset = cb->height * yStride;
+            vOffset = uOffset + cStride * cb->height / 2;
+            cStep = 1;
+            break;
+
+        case PixelFormat::YCBCR_P010:
+            yStride = cb->width * 2;
+            cStride = yStride;
+            uOffset = cb->height * yStride;
+            vOffset = uOffset + 2;
+            cStep = 4;
+            break;
+
+        default:
+            ALOGE("%s:%d unexpected format (%d)", __func__, __LINE__, cb->format);
+            RETURN_ERROR(Error3::BAD_BUFFER);
+        }
+
+        if (cb->hostHandle) {
+            const Error3 e = lockHostImpl(*cb, checkedUsage, accessRegion, bufferBits);
+            if (e != Error3::NONE) {
+                return e;
+            }
+        }
+
+        setLocked(cb, checkedUsage, accessRegion);
+
+        pYcbcr->y = bufferBits;
+        pYcbcr->cb = bufferBits + uOffset;
+        pYcbcr->cr = bufferBits + vOffset;
+        pYcbcr->yStride = yStride;
+        pYcbcr->cStride = cStride;
+        pYcbcr->chromaStep = cStep;
+
+        RETURN(Error3::NONE);
+    }
+
+    Error3 lockHostImpl(cb_handle_30_t& cb,
+                        const uint8_t checkedUsage,
+                        const Rect& accessRegion,
+                        char* const bufferBits) {
+        const HostConnectionSession conn = getHostConnectionSession();
+        ExtendedRCEncoderContext *const rcEnc = conn.getRcEncoder();
+        const bool usageSwRead = (checkedUsage & BufferUsage::CPU_READ_MASK) != 0;
+
+        const int res = rcEnc->rcColorBufferCacheFlush(
+            rcEnc, cb.hostHandle, 0, usageSwRead);
+        if (res < 0) {
+            RETURN_ERROR(Error3::NO_RESOURCES);
+        }
+
+        if (usageSwRead) {
+            if (gralloc_is_yuv_format(cb.format)) {
+                if (rcEnc->hasYUVCache()) {
+                    uint32_t bufferSize;
+                    switch (static_cast<PixelFormat>(cb.format)) {
+                    case PixelFormat::YV12:
+                        get_yv12_offsets(cb.width, cb.height,
+                                         nullptr, nullptr, &bufferSize);
+                        break;
+                    case PixelFormat::YCBCR_420_888:
+                        get_yuv420p_offsets(cb.width, cb.height,
+                                            nullptr, nullptr, &bufferSize);
+                        break;
+                    default:
+                        CRASH("Unexpected format, switch is out of sync with gralloc_is_yuv_format");
+                        break;
+                    }
+
+                    rcEnc->rcReadColorBufferYUV(rcEnc, cb.hostHandle,
+                        0, 0, cb.width, cb.height,
+                        bufferBits, bufferSize);
+                } else {
+                    // We are using RGB888
+                    std::vector<char> tmpBuf(cb.width * cb.height * 3);
+                    rcEnc->rcReadColorBuffer(rcEnc, cb.hostHandle,
+                                             0, 0, cb.width, cb.height,
+                                             cb.glFormat, cb.glType,
+                                             tmpBuf.data());
+                    switch (static_cast<PixelFormat>(cb.format)) {
+                    case PixelFormat::YV12:
+                        rgb888_to_yv12(bufferBits, tmpBuf.data(),
+                                       cb.width, cb.height,
+                                       accessRegion.left,
+                                       accessRegion.top,
+                                       accessRegion.left + accessRegion.width - 1,
+                                       accessRegion.top + accessRegion.height - 1);
+                        break;
+                    case PixelFormat::YCBCR_420_888:
+                        rgb888_to_yuv420p(bufferBits, tmpBuf.data(),
+                                          cb.width, cb.height,
+                                          accessRegion.left,
+                                          accessRegion.top,
+                                          accessRegion.left + accessRegion.width - 1,
+                                          accessRegion.top + accessRegion.height - 1);
+                        break;
+                    default:
+                        CRASH("Unexpected format, switch is out of sync with gralloc_is_yuv_format");
+                        break;
+                    }
+                }
+            } else {
+                if (rcEnc->featureInfo()->hasReadColorBufferDma) {
+                    {
+                        AEMU_SCOPED_TRACE("bindDmaDirectly");
+                        rcEnc->bindDmaDirectly(bufferBits,
+                                getMmapedPhysAddr(cb.getMmapedOffset()));
+                    }
+                    rcEnc->rcReadColorBufferDMA(rcEnc,
+                        cb.hostHandle,
+                        0, 0, cb.width, cb.height,
+                        cb.glFormat, cb.glType,
+                        bufferBits, cb.width * cb.height * cb.bytesPerPixel);
+                } else {
+                    rcEnc->rcReadColorBuffer(rcEnc,
+                        cb.hostHandle,
+                        0, 0, cb.width, cb.height,
+                        cb.glFormat, cb.glType,
+                        bufferBits);
+                }
+            }
+        }
+
+        RETURN(Error3::NONE);
+    }
+
+    Error3 unlockImpl(void* raw) {
+        AEMU_SCOPED_TRACE("unlockImpl body");
+        if (!raw) {
+            RETURN_ERROR(Error3::BAD_BUFFER);
+        }
+        cb_handle_30_t* cb = cb_handle_30_t::from(raw);
+        if (!cb) {
+            RETURN_ERROR(Error3::BAD_BUFFER);
+        }
+        if (cb->lockedUsage == 0) {
+            RETURN_ERROR(Error3::BAD_VALUE);
+        }
+        if (!cb->bufferSize) {
+            RETURN_ERROR(Error3::BAD_BUFFER);
+        }
+        char* const bufferBits = static_cast<char*>(cb->getBufferPtr());
+        if (!bufferBits) {
+            RETURN_ERROR(Error3::BAD_BUFFER);
+        }
+
+        if (cb->hostHandle) {
+            unlockHostImpl(*cb, bufferBits);
+        }
+
+        cb->lockedLeft = 0;
+        cb->lockedTop = 0;
+        cb->lockedWidth = 0;
+        cb->lockedHeight = 0;
+        cb->lockedUsage = 0;
+
+        RETURN(Error3::NONE);
+    }
+
+    void unlockHostImpl(cb_handle_30_t& cb, char* const bufferBits) {
+        AEMU_SCOPED_TRACE("unlockHostImpl body");
+        if (cb.lockedUsage & BufferUsage::CPU_WRITE_MASK) {
+            const int bpp = glUtilsPixelBitSize(cb.glFormat, cb.glType) >> 3;
+            const uint32_t rgbSize = cb.width * cb.height * bpp;
+            const char* bitsToSend;
+            uint32_t sizeToSend;
+
+            if (gralloc_is_yuv_format(cb.format)) {
+                bitsToSend = bufferBits;
+                switch (static_cast<PixelFormat>(cb.format)) {
+                    case PixelFormat::YV12:
+                        get_yv12_offsets(cb.width, cb.height, nullptr, nullptr, &sizeToSend);
+                        break;
+                    case PixelFormat::YCBCR_420_888:
+                        get_yuv420p_offsets(cb.width, cb.height, nullptr, nullptr, &sizeToSend);
+                        break;
+                    default:
+                        CRASH("Unexpected format, switch is out of sync with gralloc_is_yuv_format");
+                        break;
+                }
+            } else {
+                bitsToSend = bufferBits;
+                sizeToSend = rgbSize;
+            }
+
+            {
+                const HostConnectionSession conn = getHostConnectionSession();
+                ExtendedRCEncoderContext *const rcEnc = conn.getRcEncoder();
+                {
+                    AEMU_SCOPED_TRACE("bindDmaDirectly");
+                    rcEnc->bindDmaDirectly(bufferBits,
+                            getMmapedPhysAddr(cb.getMmapedOffset()));
+                }
+                {
+                    AEMU_SCOPED_TRACE("updateColorBuffer");
+                    rcEnc->rcUpdateColorBufferDMA(rcEnc, cb.hostHandle,
+                            0, 0, cb.width, cb.height,
+                            cb.glFormat, cb.glType,
+                            const_cast<char*>(bitsToSend),
+                            sizeToSend);
+                }
+            }
+        }
+    }
+
+    /* BufferUsage bits that must be zero */
+    static constexpr uint64_t kReservedUsage =
+        (one64 << 10)
+        | (one64 << 13)
+        | (one64 << 19)
+        | (one64 << 21)
+        | ones(25, 27) /* bits 25-27 must be zero and are reserved for future versions */
+        | ones(32, 47); /* bits 32-47 must be zero and are reserved for future versions */
+
+    bool isSupportedImpl(const IMapper::BufferDescriptorInfo& descriptor) const {
+        if (!descriptor.width) { RETURN(false); }
+        if (!descriptor.height) { RETURN(false); }
+        if (descriptor.layerCount != 1) { RETURN(false); }
+
+        const uint64_t usage64 = descriptor.usage;
+        if (usage64 & kReservedUsage) {
+            RETURN(false);
+        }
+
+        const uint32_t usage = usage64;
+
+        switch (descriptor.format) {
+        case PixelFormat::RGBA_8888:
+        case PixelFormat::RGBX_8888:
+        case PixelFormat::BGRA_8888:
+        case PixelFormat::RGB_565:
+        case PixelFormat::RGBA_FP16:
+        case PixelFormat::RGBA_1010102:
+        case PixelFormat::YV12:
+        case PixelFormat::YCBCR_420_888:
+            RETURN(true);
+
+        case PixelFormat::IMPLEMENTATION_DEFINED:
+            RETURN(false);
+
+        case PixelFormat::RGB_888:
+        case PixelFormat::YCRCB_420_SP:
+        case PixelFormat::RAW16:
+        case PixelFormat::Y16:
+        case PixelFormat::BLOB:
+            RETURN(!needGpuBuffer(usage));
+
+        default:
+            if (static_cast<int>(descriptor.format) == kOMX_COLOR_FormatYUV420Planar) {
+                return (usage & BufferUsage::VIDEO_DECODER) != 0;
+            }
+
+            RETURN(false);
+        }
+    }
+
+    Error3 validateBufferSizeImpl(const cb_handle_t& /*cb*/,
+                                  const BufferDescriptorInfo& /*descriptor*/,
+                                  uint32_t /*stride*/) {
+        RETURN(Error3::NONE);
+    }
+
+    HostConnectionSession getHostConnectionSession() const {
+        return HostConnectionSession(m_hostConn.get());
+    }
+
+    static void encodeBufferDescriptorInfo(const BufferDescriptorInfo& d,
+                                           hidl_vec<uint32_t>* raw) {
+        raw->resize(5);
+
+        (*raw)[0] = d.width;
+        (*raw)[1] = d.height;
+        (*raw)[2] = d.layerCount;
+        (*raw)[3] = static_cast<uint32_t>(d.format);
+        (*raw)[4] = d.usage & UINT32_MAX;
+    }
+
+    uint64_t getMmapedPhysAddr(uint64_t offset) const {
+        return m_physAddrToOffset + offset;
+    }
+
+    std::unique_ptr<HostConnection> m_hostConn;
+    uint64_t m_physAddrToOffset;
+};
+}  // namespace
+
+extern "C" IMapper3* HIDL_FETCH_IMapper(const char* /*name*/) {
+    return new GoldfishMapper;
+}
diff --git a/system/hals/types.h b/system/hals/types.h
new file mode 100644
index 0000000..c7d2646
--- /dev/null
+++ b/system/hals/types.h
@@ -0,0 +1,43 @@
+/*
+* Copyright (C) 2020 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#ifndef GOLDFISH_OPENGL_SYSTEM_HALS_TYPES_H_INCLUDED
+#define GOLDFISH_OPENGL_SYSTEM_HALS_TYPES_H_INCLUDED
+
+/* Tell the emulator which formats need special handling. */
+enum class EmulatorFrameworkFormat {
+    GL_COMPATIBLE = 0,
+    YV12 = 1,
+    YUV_420_888 = 2, // (Y+)(U+)(V+)
+};
+
+#ifndef GL_RGBA16F
+#define GL_RGBA16F                        0x881A
+#endif // GL_RGBA16F
+
+#ifndef GL_HALF_FLOAT
+#define GL_HALF_FLOAT                     0x140B
+#endif // GL_HALF_FLOAT
+
+#ifndef GL_RGB10_A2
+#define GL_RGB10_A2                       0x8059
+#endif // GL_RGB10_A2
+
+#ifndef GL_UNSIGNED_INT_2_10_10_10_REV
+#define GL_UNSIGNED_INT_2_10_10_10_REV    0x8368
+#endif // GL_UNSIGNED_INT_2_10_10_10_REV
+
+#endif  // GOLDFISH_OPENGL_SYSTEM_HALS_TYPES_H_INCLUDED
diff --git a/system/hwc3/Android.mk b/system/hwc3/Android.mk
new file mode 100644
index 0000000..a0d0843
--- /dev/null
+++ b/system/hwc3/Android.mk
@@ -0,0 +1,109 @@
+#
+# Copyright 2022 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := android.hardware.graphics.composer3-service.ranchu
+
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../LICENSE
+
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_RELATIVE_PATH := hw
+LOCAL_VENDOR_MODULE := true
+
+LOCAL_SHARED_LIBRARIES := \
+    [email protected] \
+    [email protected] \
+    android.hardware.graphics.composer3-V1-ndk \
+    [email protected] \
+    [email protected] \
+    libbase \
+    libbinder \
+    libbinder_ndk \
+    libEGL \
+    libcutils \
+    libcuttlefish_device_config \
+    libcuttlefish_device_config_proto \
+    libcuttlefish_utils \
+    libcuttlefish_fs \
+    libdrm \
+    libgralloctypes \
+    libhardware \
+    libhidlbase \
+    libjsoncpp \
+    libjpeg \
+    liblog \
+    libsync \
+    libui \
+    libutils \
+    libutils \
+    libOpenglSystemCommon \
+    lib_renderControl_enc \
+    libui
+
+LOCAL_STATIC_LIBRARIES := \
+    libaidlcommonsupport \
+    libyuv_static
+
+LOCAL_C_INCLUDES := \
+    device/generic/goldfish-opengl/host/include/libOpenglRender \
+    device/generic/goldfish-opengl/android-emu \
+    device/generic/goldfish-opengl/shared/OpenglCodecCommon \
+    device/generic/goldfish-opengl/system/OpenglSystemCommon \
+    device/generic/goldfish-opengl/system/include \
+    device/generic/goldfish-opengl/system/renderControl_enc \
+    external/libdrm \
+    external/minigbm/cros_gralloc \
+    system/core/libsync \
+    system/core/libsync/include \
+
+LOCAL_SRC_FILES := \
+    ClientFrameComposer.cpp \
+    Common.cpp \
+    Composer.cpp \
+    ComposerClient.cpp \
+    ComposerResources.cpp \
+    Device.cpp \
+    Display.cpp \
+    DisplayConfig.cpp \
+    DisplayFinder.cpp \
+    Drm.cpp \
+    DrmAtomicRequest.cpp \
+    DrmBuffer.cpp \
+    DrmClient.cpp \
+    DrmConnector.cpp \
+    DrmCrtc.cpp \
+    DrmDisplay.cpp \
+    DrmEventListener.cpp \
+    DrmMode.cpp \
+    DrmPlane.cpp \
+    Gralloc.cpp \
+    GuestFrameComposer.cpp \
+    HostFrameComposer.cpp \
+    HostUtils.cpp \
+    Layer.cpp \
+    Main.cpp \
+    NoOpFrameComposer.cpp \
+    VsyncThread.cpp \
+
+LOCAL_VINTF_FRAGMENTS := hwc3.xml
+LOCAL_INIT_RC := hwc3.rc
+
+include $(BUILD_EXECUTABLE)
+
diff --git a/system/hwc3/ClientFrameComposer.cpp b/system/hwc3/ClientFrameComposer.cpp
new file mode 100644
index 0000000..85ba90f
--- /dev/null
+++ b/system/hwc3/ClientFrameComposer.cpp
@@ -0,0 +1,168 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ClientFrameComposer.h"
+
+#include <android-base/parseint.h>
+#include <android-base/properties.h>
+#include <android-base/strings.h>
+#include <android/hardware/graphics/common/1.0/types.h>
+#include <device_config_shared.h>
+#include <drm_fourcc.h>
+#include <libyuv.h>
+#include <sync/sync.h>
+#include <ui/GraphicBuffer.h>
+#include <ui/GraphicBufferAllocator.h>
+#include <ui/GraphicBufferMapper.h>
+
+#include "Display.h"
+#include "Drm.h"
+#include "Layer.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+HWC3::Error ClientFrameComposer::init() {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  HWC3::Error error = mDrmClient.init();
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: failed to initialize DrmClient", __FUNCTION__);
+    return error;
+  }
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error ClientFrameComposer::registerOnHotplugCallback(
+    const HotplugCallback& cb) {
+  return mDrmClient.registerOnHotplugCallback(cb);
+  return HWC3::Error::None;
+}
+
+HWC3::Error ClientFrameComposer::unregisterOnHotplugCallback() {
+  return mDrmClient.unregisterOnHotplugCallback();
+}
+
+HWC3::Error ClientFrameComposer::onDisplayCreate(Display* display) {
+  const auto displayId = display->getId();
+  DEBUG_LOG("%s display:%" PRIu64, __FUNCTION__, displayId);
+
+  // Ensure created.
+  mDisplayInfos.emplace(displayId, DisplayInfo{});
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error ClientFrameComposer::onDisplayDestroy(Display* display) {
+  const auto displayId = display->getId();
+  DEBUG_LOG("%s display:%" PRIu64, __FUNCTION__, displayId);
+
+  auto it = mDisplayInfos.find(displayId);
+  if (it == mDisplayInfos.end()) {
+    ALOGE("%s: display:%" PRIu64 " missing display buffers?", __FUNCTION__,
+          displayId);
+    return HWC3::Error::BadDisplay;
+  }
+
+  mDisplayInfos.erase(it);
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error ClientFrameComposer::onDisplayClientTargetSet(Display* display) {
+  const auto displayId = display->getId();
+  DEBUG_LOG("%s display:%" PRIu64, __FUNCTION__, displayId);
+
+  auto it = mDisplayInfos.find(displayId);
+  if (it == mDisplayInfos.end()) {
+    ALOGE("%s: display:%" PRIu64 " missing display buffers?", __FUNCTION__,
+          displayId);
+    return HWC3::Error::BadDisplay;
+  }
+
+  DisplayInfo& displayInfo = it->second;
+
+  auto [drmBufferCreateError, drmBuffer] =
+    mDrmClient.create(display->getClientTarget().getBuffer());
+  if (drmBufferCreateError != HWC3::Error::None) {
+    ALOGE("%s: display:%" PRIu64 " failed to create client target drm buffer",
+          __FUNCTION__, displayId);
+    return HWC3::Error::NoResources;
+  }
+  displayInfo.clientTargetDrmBuffer = std::move(drmBuffer);
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error ClientFrameComposer::onActiveConfigChange(Display* /*display*/) {
+  return HWC3::Error::None;
+};
+
+HWC3::Error ClientFrameComposer::validateDisplay(Display* display,
+                                                DisplayChanges* outChanges) {
+  const auto displayId = display->getId();
+  DEBUG_LOG("%s display:%" PRIu64, __FUNCTION__, displayId);
+
+  const std::vector<Layer*>& layers = display->getOrderedLayers();
+
+  for (Layer* layer : layers) {
+    const auto layerId = layer->getId();
+    const auto layerCompositionType = layer->getCompositionType();
+
+    if (layerCompositionType != Composition::CLIENT) {
+      outChanges->addLayerCompositionChange(displayId, layerId, Composition::CLIENT);
+      continue;
+    }
+  }
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error ClientFrameComposer::presentDisplay(
+    Display* display, ::android::base::unique_fd* outDisplayFence,
+    std::unordered_map<int64_t,
+                       ::android::base::unique_fd>* /*outLayerFences*/) {
+  const auto displayId = display->getId();
+  DEBUG_LOG("%s display:%" PRIu64, __FUNCTION__, displayId);
+
+  auto displayInfoIt = mDisplayInfos.find(displayId);
+  if (displayInfoIt == mDisplayInfos.end()) {
+    ALOGE("%s: failed to find display buffers for display:%" PRIu64,
+          __FUNCTION__, displayId);
+    return HWC3::Error::BadDisplay;
+  }
+
+  DisplayInfo& displayInfo = displayInfoIt->second;
+  if (!displayInfo.clientTargetDrmBuffer) {
+    ALOGW("%s: display:%" PRIu64 " no client target set, nothing to present.",
+          __FUNCTION__, displayId);
+    return HWC3::Error::None;
+  }
+
+  ::android::base::unique_fd fence = display->getClientTarget().getFence();
+
+  auto [flushError, flushCompleteFence] = mDrmClient.flushToDisplay(
+        displayId, displayInfo.clientTargetDrmBuffer, fence);
+  if (flushError != HWC3::Error::None) {
+    ALOGE("%s: display:%" PRIu64 " failed to flush drm buffer" PRIu64,
+          __FUNCTION__, displayId);
+  }
+
+  *outDisplayFence = std::move(flushCompleteFence);
+  return flushError;
+}
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/ClientFrameComposer.h b/system/hwc3/ClientFrameComposer.h
new file mode 100644
index 0000000..8798807
--- /dev/null
+++ b/system/hwc3/ClientFrameComposer.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_HWC_CLIENTFRAMECOMPOSER_H
+#define ANDROID_HWC_CLIENTFRAMECOMPOSER_H
+
+#include "Common.h"
+#include "Display.h"
+#include "DrmClient.h"
+#include "FrameComposer.h"
+#include "Gralloc.h"
+#include "Layer.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+// A frame composer which always fallsback to client composition
+// (a.k.a make SurfaceFlinger do the composition).
+class ClientFrameComposer : public FrameComposer {
+ public:
+  ClientFrameComposer() = default;
+
+  ClientFrameComposer(const ClientFrameComposer&) = delete;
+  ClientFrameComposer& operator=(const ClientFrameComposer&) = delete;
+
+  ClientFrameComposer(ClientFrameComposer&&) = delete;
+  ClientFrameComposer& operator=(ClientFrameComposer&&) = delete;
+
+  HWC3::Error init() override;
+
+  HWC3::Error registerOnHotplugCallback(const HotplugCallback& cb) override;
+
+  HWC3::Error unregisterOnHotplugCallback() override;
+
+  HWC3::Error onDisplayCreate(Display* display) override;
+
+  HWC3::Error onDisplayDestroy(Display* display) override;
+
+  HWC3::Error onDisplayClientTargetSet(Display* display) override;
+
+  HWC3::Error onActiveConfigChange(Display* display) override;
+
+  // Determines if this composer can compose the given layers on the given
+  // display and requests changes for layers that can't not be composed.
+  HWC3::Error validateDisplay(Display* display,
+                              DisplayChanges* outChanges) override;
+
+  // Performs the actual composition of layers and presents the composed result
+  // to the display.
+  HWC3::Error presentDisplay(
+      Display* display, ::android::base::unique_fd* outDisplayFence,
+      std::unordered_map<int64_t, ::android::base::unique_fd>* outLayerFences)
+      override;
+
+  const DrmClient* getDrmPresenter() const override {
+    return &mDrmClient;
+  }
+
+ private:
+  struct DisplayInfo {
+    std::shared_ptr<DrmBuffer> clientTargetDrmBuffer;
+  };
+
+  std::unordered_map<int64_t, DisplayInfo> mDisplayInfos;
+
+  DrmClient mDrmClient;
+};
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
+
+#endif
diff --git a/system/hwc3/Common.cpp b/system/hwc3/Common.cpp
new file mode 100644
index 0000000..edbe93c
--- /dev/null
+++ b/system/hwc3/Common.cpp
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Common.h"
+
+#include <android-base/properties.h>
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+bool IsAutoDevice() {
+  // gcar_emu_x86_64, sdk_car_md_x86_64, cf_x86_64_auto, cf_x86_64_only_auto_md
+  const std::string product_name = ::android::base::GetProperty("ro.product.name", "");
+  return product_name.find("car_") || product_name.find("_auto");
+}
+
+bool IsCuttlefish() {
+  return ::android::base::GetProperty("ro.product.board", "") == "cutf";
+}
+
+bool IsCuttlefishFoldable() {
+  return IsCuttlefish() &&
+         ::android::base::GetProperty("ro.product.name", "").find("foldable") !=
+             std::string::npos;
+}
+
+
+bool IsInNoOpCompositionMode() {
+  const std::string mode = ::android::base::GetProperty("ro.vendor.hwcomposer.mode", "");
+  DEBUG_LOG("%s: sysprop ro.vendor.hwcomposer.mode is %s", __FUNCTION__, mode.c_str());
+  return mode == "noop";
+}
+
+bool IsInClientCompositionMode() {
+  const std::string mode = ::android::base::GetProperty("ro.vendor.hwcomposer.mode", "");
+  DEBUG_LOG("%s: sysprop ro.vendor.hwcomposer.mode is %s", __FUNCTION__, mode.c_str());
+  return mode == "client";
+}
+
+bool IsInGem5DisplayFinderMode() {
+  const std::string mode =
+    ::android::base::GetProperty("ro.vendor.hwcomposer.display_finder_mode", "");
+  DEBUG_LOG("%s: sysprop ro.vendor.hwcomposer.display_finder_mode is %s",
+            __FUNCTION__, mode.c_str());
+  return mode == "gem5";
+}
+
+bool IsInNoOpDisplayFinderMode() {
+  const std::string mode =
+    ::android::base::GetProperty("ro.vendor.hwcomposer.display_finder_mode", "");
+  DEBUG_LOG("%s: sysprop ro.vendor.hwcomposer.display_finder_mode is %s",
+            __FUNCTION__, mode.c_str());
+  return mode == "noop";
+}
+
+bool IsInDrmDisplayFinderMode() {
+  const std::string mode =
+    ::android::base::GetProperty("ro.vendor.hwcomposer.display_finder_mode", "");
+  DEBUG_LOG("%s: sysprop ro.vendor.hwcomposer.display_finder_mode is %s",
+            __FUNCTION__, mode.c_str());
+  return mode == "drm";
+}
+
+std::string toString(HWC3::Error error) {
+  switch (error) {
+    case HWC3::Error::None:
+      return "None";
+    case HWC3::Error::BadConfig:
+      return "BadConfig";
+    case HWC3::Error::BadDisplay:
+      return "BadDisplay";
+    case HWC3::Error::BadLayer:
+      return "BadLayer";
+    case HWC3::Error::BadParameter:
+      return "BadParameter";
+    case HWC3::Error::NoResources:
+      return "NoResources";
+    case HWC3::Error::NotValidated:
+      return "NotValidated";
+    case HWC3::Error::Unsupported:
+      return "Unsupported";
+    case HWC3::Error::SeamlessNotAllowed:
+      return "SeamlessNotAllowed";
+  }
+}
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/Common.h b/system/hwc3/Common.h
new file mode 100644
index 0000000..bca365b
--- /dev/null
+++ b/system/hwc3/Common.h
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_HWC_COMMON_H
+#define ANDROID_HWC_COMMON_H
+
+#include <inttypes.h>
+
+#include <string>
+
+#define ATRACE_TAG (ATRACE_TAG_GRAPHICS | ATRACE_TAG_HAL)
+
+#undef LOG_TAG
+#define LOG_TAG "RanchuHwc"
+
+#include <aidl/android/hardware/graphics/composer3/IComposerClient.h>
+#include <android-base/logging.h>
+#include <log/log.h>
+#include <utils/Trace.h>
+
+// Uncomment to enable additional debug logging.
+//#define DEBUG_RANCHU_HWC
+
+#if defined(DEBUG_RANCHU_HWC)
+#define DEBUG_LOG ALOGE
+#else
+#define DEBUG_LOG(...) ((void)0)
+#endif
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+bool IsAutoDevice();
+bool IsCuttlefish();
+bool IsCuttlefishFoldable();
+
+bool IsInNoOpCompositionMode();
+bool IsInClientCompositionMode();
+
+bool IsInGem5DisplayFinderMode();
+bool IsInNoOpDisplayFinderMode();
+bool IsInDrmDisplayFinderMode();
+
+namespace HWC3 {
+enum class Error : int32_t {
+  None = 0,
+  BadConfig = aidl::android::hardware::graphics::composer3::IComposerClient::
+      EX_BAD_CONFIG,
+  BadDisplay = aidl::android::hardware::graphics::composer3::IComposerClient::
+      EX_BAD_DISPLAY,
+  BadLayer = aidl::android::hardware::graphics::composer3::IComposerClient::
+      EX_BAD_LAYER,
+  BadParameter = aidl::android::hardware::graphics::composer3::IComposerClient::
+      EX_BAD_PARAMETER,
+  NoResources = aidl::android::hardware::graphics::composer3::IComposerClient::
+      EX_NO_RESOURCES,
+  NotValidated = aidl::android::hardware::graphics::composer3::IComposerClient::
+      EX_NOT_VALIDATED,
+  Unsupported = aidl::android::hardware::graphics::composer3::IComposerClient::
+      EX_UNSUPPORTED,
+  SeamlessNotAllowed = aidl::android::hardware::graphics::composer3::
+      IComposerClient::EX_SEAMLESS_NOT_ALLOWED,
+};
+}  // namespace HWC3
+
+std::string toString(HWC3::Error error);
+
+inline ndk::ScopedAStatus ToBinderStatus(HWC3::Error error) {
+  if (error != HWC3::Error::None) {
+    return ndk::ScopedAStatus::fromServiceSpecificError(
+        static_cast<int32_t>(error));
+  }
+  return ndk::ScopedAStatus::ok();
+}
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
+
+#endif
diff --git a/system/hwc3/Composer.cpp b/system/hwc3/Composer.cpp
new file mode 100644
index 0000000..b2a1b7e
--- /dev/null
+++ b/system/hwc3/Composer.cpp
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Composer.h"
+
+#include <android-base/logging.h>
+#include <android/binder_ibinder_platform.h>
+
+#include "Common.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+ndk::ScopedAStatus Composer::createClient(
+    std::shared_ptr<IComposerClient>* outClient) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mClientMutex);
+
+  const bool previousClientDestroyed = waitForClientDestroyedLocked(lock);
+  if (!previousClientDestroyed) {
+    ALOGE("%s: failed as composer client already exists", __FUNCTION__);
+    *outClient = nullptr;
+    return ToBinderStatus(HWC3::Error::NoResources);
+  }
+
+  auto client = ndk::SharedRefBase::make<ComposerClient>();
+  if (!client) {
+    ALOGE("%s: failed to init composer client", __FUNCTION__);
+    *outClient = nullptr;
+    return ToBinderStatus(HWC3::Error::NoResources);
+  }
+
+  auto error = client->init();
+  if (error != HWC3::Error::None) {
+    *outClient = nullptr;
+    return ToBinderStatus(error);
+  }
+
+  auto clientDestroyed = [this]() { onClientDestroyed(); };
+  client->setOnClientDestroyed(clientDestroyed);
+
+  mClient = client;
+  *outClient = client;
+
+  return ndk::ScopedAStatus::ok();
+}
+
+bool Composer::waitForClientDestroyedLocked(
+    std::unique_lock<std::mutex>& lock) {
+  if (!mClient.expired()) {
+    // In surface flinger we delete a composer client on one thread and
+    // then create a new client on another thread. Although surface
+    // flinger ensures the calls are made in that sequence (destroy and
+    // then create), sometimes the calls land in the composer service
+    // inverted (create and then destroy). Wait for a brief period to
+    // see if the existing client is destroyed.
+    constexpr const auto kTimeout = std::chrono::seconds(5);
+    mClientDestroyedCondition.wait_for(
+        lock, kTimeout, [this]() -> bool { return mClient.expired(); });
+    if (!mClient.expired()) {
+      ALOGW("%s: previous client was not destroyed", __FUNCTION__);
+    }
+  }
+
+  return mClient.expired();
+}
+
+void Composer::onClientDestroyed() {
+  std::lock_guard<std::mutex> lock(mClientMutex);
+
+  mClientDestroyedCondition.notify_all();
+}
+
+binder_status_t Composer::dump(int fd, const char** /*args*/,
+                               uint32_t /*numArgs*/) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::string output("TODO");
+
+  write(fd, output.c_str(), output.size());
+  return STATUS_OK;
+}
+
+ndk::ScopedAStatus Composer::getCapabilities(std::vector<Capability>* caps) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  caps->clear();
+  caps->emplace_back(Capability::PRESENT_FENCE_IS_NOT_RELIABLE);
+  caps->emplace_back(Capability::BOOT_DISPLAY_CONFIG);
+
+  return ndk::ScopedAStatus::ok();
+}
+
+::ndk::SpAIBinder Composer::createBinder() {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  auto binder = BnComposer::createBinder();
+  AIBinder_setInheritRt(binder.get(), true);
+  return binder;
+}
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
\ No newline at end of file
diff --git a/system/hwc3/Composer.h b/system/hwc3/Composer.h
new file mode 100644
index 0000000..f564169
--- /dev/null
+++ b/system/hwc3/Composer.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_HWC_COMPOSER_H
+#define ANDROID_HWC_COMPOSER_H
+
+#include <aidl/android/hardware/graphics/composer3/BnComposer.h>
+#include <utils/Mutex.h>
+
+#include <memory>
+
+#include "ComposerClient.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+// This class is basically just the interface to create a client.
+class Composer : public BnComposer {
+ public:
+  Composer() = default;
+
+  binder_status_t dump(int fd, const char** args, uint32_t numArgs) override;
+
+  // compser3 api
+  ndk::ScopedAStatus createClient(
+      std::shared_ptr<IComposerClient>* client) override;
+  ndk::ScopedAStatus getCapabilities(std::vector<Capability>* caps) override;
+
+ protected:
+  ndk::SpAIBinder createBinder() override;
+
+ private:
+  bool waitForClientDestroyedLocked(std::unique_lock<std::mutex>& lock);
+  void onClientDestroyed();
+
+  std::mutex mClientMutex;
+  std::weak_ptr<ComposerClient> mClient GUARDED_BY(mClientMutex);
+  std::condition_variable mClientDestroyedCondition;
+};
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
+
+#endif
\ No newline at end of file
diff --git a/system/hwc3/ComposerClient.cpp b/system/hwc3/ComposerClient.cpp
new file mode 100644
index 0000000..6bd8f0c
--- /dev/null
+++ b/system/hwc3/ComposerClient.cpp
@@ -0,0 +1,1385 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ComposerClient.h"
+
+#include <aidlcommonsupport/NativeHandle.h>
+#include <android/binder_ibinder_platform.h>
+
+#include "Common.h"
+#include "Device.h"
+#include "GuestFrameComposer.h"
+#include "HostFrameComposer.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+namespace {
+
+#define GET_DISPLAY_OR_RETURN_ERROR()                                    \
+  Display* display = getDisplay(displayId);                              \
+  if (display == nullptr) {                                              \
+    ALOGE("%s failed to get display:%" PRIu64, __FUNCTION__, displayId); \
+    return ToBinderStatus(HWC3::Error::BadDisplay);                      \
+  }
+
+}  // namespace
+
+using ::aidl::android::hardware::graphics::common::PixelFormat;
+
+class ComposerClient::CommandResultWriter {
+ public:
+  CommandResultWriter(std::vector<CommandResultPayload>* results)
+      : mIndex(0), mResults(results) {}
+
+  void nextCommand() { ++mIndex; }
+
+  void addError(HWC3::Error error) {
+    CommandError commandErrorResult;
+    commandErrorResult.commandIndex = mIndex;
+    commandErrorResult.errorCode = static_cast<int32_t>(error);
+    mResults->emplace_back(std::move(commandErrorResult));
+  }
+
+  void addPresentFence(int64_t displayId, ::android::base::unique_fd fence) {
+    if (fence >= 0) {
+      PresentFence presentFenceResult;
+      presentFenceResult.display = displayId;
+      presentFenceResult.fence = ndk::ScopedFileDescriptor(fence.release());
+      mResults->emplace_back(std::move(presentFenceResult));
+    }
+  }
+
+  void addReleaseFences(
+      int64_t displayId,
+      std::unordered_map<int64_t, ::android::base::unique_fd> layerFences) {
+    ReleaseFences releaseFencesResult;
+    releaseFencesResult.display = displayId;
+    for (auto& [layer, layerFence] : layerFences) {
+      if (layerFence >= 0) {
+        ReleaseFences::Layer releaseFencesLayerResult;
+        releaseFencesLayerResult.layer = layer;
+        releaseFencesLayerResult.fence =
+            ndk::ScopedFileDescriptor(layerFence.release());
+        releaseFencesResult.layers.emplace_back(
+            std::move(releaseFencesLayerResult));
+      }
+    }
+    mResults->emplace_back(std::move(releaseFencesResult));
+  }
+
+  void addChanges(const DisplayChanges& changes) {
+    if (changes.compositionChanges) {
+      mResults->emplace_back(*changes.compositionChanges);
+    }
+    if (changes.displayRequestChanges) {
+      mResults->emplace_back(*changes.displayRequestChanges);
+    }
+  }
+
+  void addPresentOrValidateResult(int64_t displayId,
+                                  PresentOrValidate::Result pov) {
+    PresentOrValidate result;
+    result.display = displayId;
+    result.result = pov;
+    mResults->emplace_back(std::move(result));
+  }
+
+ private:
+  int32_t mIndex = 0;
+  std::vector<CommandResultPayload>* mResults = nullptr;
+};
+
+ComposerClient::ComposerClient() { DEBUG_LOG("%s", __FUNCTION__); }
+
+ComposerClient::~ComposerClient() {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  destroyDisplaysLocked();
+
+  if (mOnClientDestroyed) {
+    mOnClientDestroyed();
+  }
+}
+
+HWC3::Error ComposerClient::init() {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  HWC3::Error error = HWC3::Error::None;
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  mResources = std::make_unique<ComposerResources>();
+  if (!mResources) {
+    ALOGE("%s failed to allocate ComposerResources", __FUNCTION__);
+    return HWC3::Error::NoResources;
+  }
+
+  error = mResources->init();
+  if (error != HWC3::Error::None) {
+    ALOGE("%s failed to initialize ComposerResources", __FUNCTION__);
+    return error;
+  }
+
+  error = Device::getInstance().getComposer(&mComposer);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s failed to get FrameComposer", __FUNCTION__);
+    return error;
+  }
+
+  const auto HotplugCallback = [this](bool connected,   //
+                                      int32_t id,       //
+                                      uint32_t width,   //
+                                      uint32_t height,  //
+                                      uint32_t dpiX,    //
+                                      uint32_t dpiY,    //
+                                      uint32_t refreshRate) {
+    handleHotplug(connected, id, width, height, dpiX, dpiY, refreshRate);
+  };
+  error = mComposer->registerOnHotplugCallback(HotplugCallback);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s failed to register hotplug callback", __FUNCTION__);
+    return error;
+  }
+
+  error = createDisplaysLocked();
+  if (error != HWC3::Error::None) {
+    ALOGE("%s failed to create displays.", __FUNCTION__);
+    return error;
+  }
+
+  DEBUG_LOG("%s initialized!", __FUNCTION__);
+  return HWC3::Error::None;
+}
+
+ndk::ScopedAStatus ComposerClient::createLayer(int64_t displayId,
+                                               int32_t bufferSlotCount,
+                                               int64_t* layerId) {
+  DEBUG_LOG("%s display:%" PRIu64, __FUNCTION__, displayId);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  HWC3::Error error = display->createLayer(layerId);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: display:%" PRIu64 " failed to create layer", __FUNCTION__,
+          displayId);
+    return ToBinderStatus(error);
+  }
+
+  error = mResources->addLayer(displayId, *layerId, bufferSlotCount);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: display:%" PRIu64 " resources failed to create layer",
+          __FUNCTION__, displayId);
+    return ToBinderStatus(error);
+  }
+
+  return ToBinderStatus(HWC3::Error::None);
+}
+
+ndk::ScopedAStatus ComposerClient::createVirtualDisplay(
+    int32_t /*width*/, int32_t /*height*/, PixelFormat /*formatHint*/,
+    int32_t /*outputBufferSlotCount*/, VirtualDisplay* /*display*/) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  return ToBinderStatus(HWC3::Error::Unsupported);
+}
+
+ndk::ScopedAStatus ComposerClient::destroyLayer(int64_t displayId,
+                                                int64_t layerId) {
+  DEBUG_LOG("%s display:%" PRIu64, __FUNCTION__, displayId);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  HWC3::Error error = display->destroyLayer(layerId);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: display:%" PRIu64 " failed to destroy layer:%" PRIu64,
+          __FUNCTION__, displayId, layerId);
+    return ToBinderStatus(error);
+  }
+
+  error = mResources->removeLayer(displayId, layerId);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: display:%" PRIu64 " resources failed to destroy layer:%" PRIu64,
+          __FUNCTION__, displayId, layerId);
+    return ToBinderStatus(error);
+  }
+
+  return ToBinderStatus(HWC3::Error::None);
+}
+
+ndk::ScopedAStatus ComposerClient::destroyVirtualDisplay(
+    int64_t /*displayId*/) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  return ToBinderStatus(HWC3::Error::Unsupported);
+}
+
+ndk::ScopedAStatus ComposerClient::executeCommands(
+    const std::vector<DisplayCommand>& commands,
+    std::vector<CommandResultPayload>* commandResultPayloads) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  mCommandResults =
+      std::make_unique<CommandResultWriter>(commandResultPayloads);
+
+  for (const DisplayCommand& command : commands) {
+    executeDisplayCommand(command);
+    mCommandResults->nextCommand();
+  }
+
+  mCommandResults.reset();
+
+  return ToBinderStatus(HWC3::Error::None);
+}
+
+ndk::ScopedAStatus ComposerClient::getActiveConfig(int64_t displayId,
+                                                   int32_t* config) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(display->getActiveConfig(config));
+}
+
+ndk::ScopedAStatus ComposerClient::getColorModes(
+    int64_t displayId, std::vector<ColorMode>* colorModes) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(display->getColorModes(colorModes));
+}
+
+ndk::ScopedAStatus ComposerClient::getDataspaceSaturationMatrix(
+    common::Dataspace dataspace, std::vector<float>* matrix) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  if (dataspace != common::Dataspace::SRGB_LINEAR) {
+    return ToBinderStatus(HWC3::Error::BadParameter);
+  }
+
+  // clang-format off
+  constexpr std::array<float, 16> kUnit {
+    1.0f, 0.0f, 0.0f, 0.0f,
+    0.0f, 1.0f, 0.0f, 0.0f,
+    0.0f, 0.0f, 1.0f, 0.0f,
+    0.0f, 0.0f, 0.0f, 1.0f,
+  };
+  // clang-format on
+  matrix->clear();
+  matrix->insert(matrix->begin(), kUnit.begin(), kUnit.end());
+
+  return ToBinderStatus(HWC3::Error::None);
+}
+
+ndk::ScopedAStatus ComposerClient::getDisplayAttribute(
+    int64_t displayId, int32_t config, DisplayAttribute attribute,
+    int32_t* value) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(display->getDisplayAttribute(config, attribute, value));
+}
+
+ndk::ScopedAStatus ComposerClient::getDisplayCapabilities(
+    int64_t displayId, std::vector<DisplayCapability>* outCaps) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(display->getDisplayCapabilities(outCaps));
+}
+
+ndk::ScopedAStatus ComposerClient::getDisplayConfigs(
+    int64_t displayId, std::vector<int32_t>* outConfigs) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(display->getDisplayConfigs(outConfigs));
+}
+
+ndk::ScopedAStatus ComposerClient::getDisplayConnectionType(
+    int64_t displayId, DisplayConnectionType* outType) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(display->getDisplayConnectionType(outType));
+}
+
+ndk::ScopedAStatus ComposerClient::getDisplayIdentificationData(
+    int64_t displayId, DisplayIdentification* outIdentification) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(
+      display->getDisplayIdentificationData(outIdentification));
+}
+
+ndk::ScopedAStatus ComposerClient::getDisplayName(int64_t displayId,
+                                                  std::string* outName) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(display->getDisplayName(outName));
+}
+
+ndk::ScopedAStatus ComposerClient::getDisplayVsyncPeriod(
+    int64_t displayId, int32_t* outVsyncPeriod) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(display->getDisplayVsyncPeriod(outVsyncPeriod));
+}
+
+ndk::ScopedAStatus ComposerClient::getDisplayedContentSample(
+    int64_t displayId, int64_t maxFrames, int64_t timestamp,
+    DisplayContentSample* outSamples) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(
+      display->getDisplayedContentSample(maxFrames, timestamp, outSamples));
+}
+
+ndk::ScopedAStatus ComposerClient::getDisplayedContentSamplingAttributes(
+    int64_t displayId, DisplayContentSamplingAttributes* outAttributes) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(
+      display->getDisplayedContentSamplingAttributes(outAttributes));
+}
+
+ndk::ScopedAStatus ComposerClient::getDisplayPhysicalOrientation(
+    int64_t displayId, common::Transform* outOrientation) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(display->getDisplayPhysicalOrientation(outOrientation));
+}
+
+ndk::ScopedAStatus ComposerClient::getHdrCapabilities(
+    int64_t displayId, HdrCapabilities* outCapabilities) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(display->getHdrCapabilities(outCapabilities));
+}
+
+ndk::ScopedAStatus ComposerClient::getMaxVirtualDisplayCount(
+    int32_t* outCount) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  // Not supported.
+  *outCount = 0;
+
+  return ToBinderStatus(HWC3::Error::None);
+}
+
+ndk::ScopedAStatus ComposerClient::getPerFrameMetadataKeys(
+    int64_t displayId, std::vector<PerFrameMetadataKey>* outKeys) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(display->getPerFrameMetadataKeys(outKeys));
+}
+
+ndk::ScopedAStatus ComposerClient::getReadbackBufferAttributes(
+    int64_t displayId, ReadbackBufferAttributes* outAttributes) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(display->getReadbackBufferAttributes(outAttributes));
+}
+
+ndk::ScopedAStatus ComposerClient::getReadbackBufferFence(
+    int64_t displayId, ndk::ScopedFileDescriptor* outAcquireFence) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(display->getReadbackBufferFence(outAcquireFence));
+}
+
+ndk::ScopedAStatus ComposerClient::getRenderIntents(
+    int64_t displayId, ColorMode mode, std::vector<RenderIntent>* outIntents) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(display->getRenderIntents(mode, outIntents));
+}
+
+ndk::ScopedAStatus ComposerClient::getSupportedContentTypes(
+    int64_t displayId, std::vector<ContentType>* outTypes) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(display->getSupportedContentTypes(outTypes));
+}
+
+ndk::ScopedAStatus ComposerClient::getDisplayDecorationSupport(
+    int64_t displayId,
+    std::optional<common::DisplayDecorationSupport>* outSupport) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(display->getDecorationSupport(outSupport));
+}
+
+ndk::ScopedAStatus ComposerClient::registerCallback(
+    const std::shared_ptr<IComposerCallback>& callback) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  const bool isFirstRegisterCallback = mCallbacks == nullptr;
+
+  mCallbacks = callback;
+
+  for (auto& [_, display] : mDisplays) {
+    display->registerCallback(callback);
+  }
+
+  if (isFirstRegisterCallback) {
+    lock.unlock();
+    for (auto& [displayId, _] : mDisplays) {
+      mCallbacks->onHotplug(displayId, /*connected=*/true);
+    }
+  }
+
+  return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus ComposerClient::setActiveConfig(int64_t displayId,
+                                                   int32_t configId) {
+  DEBUG_LOG("%s display:%" PRIu64 " config:%" PRIu32, __FUNCTION__, displayId,
+            configId);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(display->setActiveConfig(configId));
+}
+
+ndk::ScopedAStatus ComposerClient::setActiveConfigWithConstraints(
+    int64_t displayId, int32_t configId,
+    const VsyncPeriodChangeConstraints& constraints,
+    VsyncPeriodChangeTimeline* outTimeline) {
+  DEBUG_LOG("%s display:%" PRIu64 " config:%" PRIu32, __FUNCTION__, displayId,
+            configId);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(display->setActiveConfigWithConstraints(
+      configId, constraints, outTimeline));
+}
+
+ndk::ScopedAStatus ComposerClient::setBootDisplayConfig(int64_t displayId,
+                                                        int32_t configId) {
+  DEBUG_LOG("%s display:%" PRIu64 " config:%" PRIu32, __FUNCTION__, displayId,
+            configId);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(display->setBootConfig(configId));
+}
+
+ndk::ScopedAStatus ComposerClient::clearBootDisplayConfig(int64_t displayId) {
+  DEBUG_LOG("%s display:%" PRIu64, __FUNCTION__, displayId);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(display->clearBootConfig());
+}
+
+ndk::ScopedAStatus ComposerClient::getPreferredBootDisplayConfig(
+    int64_t displayId, int32_t* outConfigId) {
+  DEBUG_LOG("%s display:%" PRIu64, __FUNCTION__, displayId);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(display->getPreferredBootConfig(outConfigId));
+}
+
+ndk::ScopedAStatus ComposerClient::setAutoLowLatencyMode(int64_t displayId,
+                                                         bool on) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(display->setAutoLowLatencyMode(on));
+}
+
+ndk::ScopedAStatus ComposerClient::setClientTargetSlotCount(int64_t displayId,
+                                                            int32_t count) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(
+      mResources->setDisplayClientTargetCacheSize(displayId, count));
+}
+
+ndk::ScopedAStatus ComposerClient::setColorMode(int64_t displayId,
+                                                ColorMode mode,
+                                                RenderIntent intent) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(display->setColorMode(mode, intent));
+}
+
+ndk::ScopedAStatus ComposerClient::setContentType(int64_t displayId,
+                                                  ContentType type) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(display->setContentType(type));
+}
+
+ndk::ScopedAStatus ComposerClient::setDisplayedContentSamplingEnabled(
+    int64_t displayId, bool enable, FormatColorComponent componentMask,
+    int64_t maxFrames) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(display->setDisplayedContentSamplingEnabled(
+      enable, componentMask, maxFrames));
+}
+
+ndk::ScopedAStatus ComposerClient::setPowerMode(int64_t displayId,
+                                                PowerMode mode) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(display->setPowerMode(mode));
+}
+
+ndk::ScopedAStatus ComposerClient::setReadbackBuffer(
+    int64_t displayId,
+    const aidl::android::hardware::common::NativeHandle& buffer,
+    const ndk::ScopedFileDescriptor& releaseFence) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  // Owned by mResources.
+  buffer_handle_t importedBuffer = nullptr;
+
+  auto releaser = mResources->createReleaser(true /* isBuffer */);
+  auto error = mResources->getDisplayReadbackBuffer(
+      displayId, buffer, &importedBuffer, releaser.get());
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: failed to get readback buffer from resources.", __FUNCTION__);
+    return ToBinderStatus(error);
+  }
+
+  error = display->setReadbackBuffer(importedBuffer, releaseFence);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: failed to set readback buffer to display.", __FUNCTION__);
+    return ToBinderStatus(error);
+  }
+
+  return ToBinderStatus(HWC3::Error::None);
+}
+
+ndk::ScopedAStatus ComposerClient::setVsyncEnabled(int64_t displayId,
+                                                   bool enabled) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(display->setVsyncEnabled(enabled));
+}
+
+ndk::ScopedAStatus ComposerClient::setIdleTimerEnabled(int64_t displayId,
+                                                       int32_t timeoutMs) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  GET_DISPLAY_OR_RETURN_ERROR();
+
+  return ToBinderStatus(display->setIdleTimerEnabled(timeoutMs));
+}
+
+ndk::SpAIBinder ComposerClient::createBinder() {
+  auto binder = BnComposerClient::createBinder();
+  AIBinder_setInheritRt(binder.get(), true);
+  return binder;
+}
+
+namespace {
+
+#define DISPATCH_LAYER_COMMAND(layerCmd, display, layer, field, funcName)     \
+  do {                                                                        \
+    if (layerCmd.field) {                                                     \
+      ComposerClient::executeLayerCommandSetLayer##funcName(display, layer,   \
+                                                            *layerCmd.field); \
+    }                                                                         \
+  } while (0)
+
+#define DISPATCH_DISPLAY_COMMAND(displayCmd, display, field, funcName) \
+  do {                                                                 \
+    if (displayCmd.field) {                                            \
+      executeDisplayCommand##funcName(display, *displayCmd.field);     \
+    }                                                                  \
+  } while (0)
+
+#define DISPATCH_DISPLAY_BOOL_COMMAND(displayCmd, display, field, funcName) \
+  do {                                                                      \
+    if (displayCmd.field) {                                                 \
+      executeDisplayCommand##funcName(display);                             \
+    }                                                                       \
+  } while (0)
+
+#define DISPATCH_DISPLAY_BOOL_COMMAND_AND_DATA(displayCmd, display, field, \
+                                               data, funcName)             \
+  do {                                                                     \
+    if (displayCmd.field) {                                                \
+      executeDisplayCommand##funcName(display, displayCmd.data);           \
+    }                                                                      \
+  } while (0)
+
+#define LOG_DISPLAY_COMMAND_ERROR(display, error)                 \
+  do {                                                            \
+    const std::string errorString = toString(error);              \
+    ALOGE("%s: display:%" PRId64 " failed with:%s", __FUNCTION__, \
+          display->getId(), errorString.c_str());                 \
+  } while (0)
+
+#define LOG_LAYER_COMMAND_ERROR(display, layer, error)                \
+  do {                                                                \
+    const std::string errorString = toString(error);                  \
+    ALOGE("%s: display:%" PRId64 " layer:%" PRId64 " failed with:%s", \
+          __FUNCTION__, display->getId(), layer->getId(),             \
+          errorString.c_str());                                       \
+  } while (0)
+
+}  // namespace
+
+void ComposerClient::executeDisplayCommand(
+    const DisplayCommand& displayCommand) {
+  Display* display = getDisplay(displayCommand.display);
+  if (display == nullptr) {
+    mCommandResults->addError(HWC3::Error::BadDisplay);
+    return;
+  }
+
+  for (const LayerCommand& layerCmd : displayCommand.layers) {
+    executeLayerCommand(display, layerCmd);
+  }
+
+  DISPATCH_DISPLAY_COMMAND(displayCommand, display, colorTransformMatrix,
+                           SetColorTransform);
+  DISPATCH_DISPLAY_COMMAND(displayCommand, display, brightness, SetBrightness);
+  DISPATCH_DISPLAY_COMMAND(displayCommand, display, clientTarget,
+                           SetClientTarget);
+  DISPATCH_DISPLAY_COMMAND(displayCommand, display, virtualDisplayOutputBuffer,
+                           SetOutputBuffer);
+  DISPATCH_DISPLAY_BOOL_COMMAND_AND_DATA(displayCommand, display,
+                                         validateDisplay, expectedPresentTime,
+                                         ValidateDisplay);
+  DISPATCH_DISPLAY_BOOL_COMMAND(displayCommand, display, acceptDisplayChanges,
+                                AcceptDisplayChanges);
+  DISPATCH_DISPLAY_BOOL_COMMAND(displayCommand, display, presentDisplay,
+                                PresentDisplay);
+  DISPATCH_DISPLAY_BOOL_COMMAND_AND_DATA(
+      displayCommand, display, presentOrValidateDisplay, expectedPresentTime,
+      PresentOrValidateDisplay);
+}
+
+void ComposerClient::executeLayerCommand(Display* display,
+                                         const LayerCommand& layerCommand) {
+  Layer* layer = display->getLayer(layerCommand.layer);
+  if (layer == nullptr) {
+    mCommandResults->addError(HWC3::Error::BadLayer);
+    return;
+  }
+
+  DISPATCH_LAYER_COMMAND(layerCommand, display, layer, cursorPosition,
+                         CursorPosition);
+  DISPATCH_LAYER_COMMAND(layerCommand, display, layer, buffer, Buffer);
+  DISPATCH_LAYER_COMMAND(layerCommand, display, layer, damage, SurfaceDamage);
+  DISPATCH_LAYER_COMMAND(layerCommand, display, layer, blendMode, BlendMode);
+  DISPATCH_LAYER_COMMAND(layerCommand, display, layer, color, Color);
+  DISPATCH_LAYER_COMMAND(layerCommand, display, layer, composition,
+                         Composition);
+  DISPATCH_LAYER_COMMAND(layerCommand, display, layer, dataspace, Dataspace);
+  DISPATCH_LAYER_COMMAND(layerCommand, display, layer, displayFrame,
+                         DisplayFrame);
+  DISPATCH_LAYER_COMMAND(layerCommand, display, layer, planeAlpha, PlaneAlpha);
+  DISPATCH_LAYER_COMMAND(layerCommand, display, layer, sidebandStream,
+                         SidebandStream);
+  DISPATCH_LAYER_COMMAND(layerCommand, display, layer, sourceCrop, SourceCrop);
+  DISPATCH_LAYER_COMMAND(layerCommand, display, layer, transform, Transform);
+  DISPATCH_LAYER_COMMAND(layerCommand, display, layer, visibleRegion,
+                         VisibleRegion);
+  DISPATCH_LAYER_COMMAND(layerCommand, display, layer, z, ZOrder);
+  DISPATCH_LAYER_COMMAND(layerCommand, display, layer, colorTransform,
+                         ColorTransform);
+  DISPATCH_LAYER_COMMAND(layerCommand, display, layer, brightness, Brightness);
+  DISPATCH_LAYER_COMMAND(layerCommand, display, layer, perFrameMetadata,
+                         PerFrameMetadata);
+  DISPATCH_LAYER_COMMAND(layerCommand, display, layer, perFrameMetadataBlob,
+                         PerFrameMetadataBlobs);
+}
+
+void ComposerClient::executeDisplayCommandSetColorTransform(
+    Display* display, const std::vector<float>& matrix) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  auto error = display->setColorTransform(matrix);
+  if (error != HWC3::Error::None) {
+    LOG_DISPLAY_COMMAND_ERROR(display, error);
+    mCommandResults->addError(error);
+  }
+}
+
+void ComposerClient::executeDisplayCommandSetBrightness(
+    Display* display, const DisplayBrightness& brightness) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  auto error = display->setBrightness(brightness.brightness);
+  if (error != HWC3::Error::None) {
+    LOG_DISPLAY_COMMAND_ERROR(display, error);
+    mCommandResults->addError(error);
+  }
+}
+
+void ComposerClient::executeDisplayCommandSetClientTarget(
+    Display* display, const ClientTarget& clientTarget) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  // Owned by mResources.
+  buffer_handle_t importedBuffer = nullptr;
+
+  auto releaser = mResources->createReleaser(/*isBuffer=*/true);
+  auto error = mResources->getDisplayClientTarget(
+      display->getId(), clientTarget.buffer, &importedBuffer, releaser.get());
+  if (error != HWC3::Error::None) {
+    LOG_DISPLAY_COMMAND_ERROR(display, error);
+    mCommandResults->addError(error);
+    return;
+  }
+
+  error = display->setClientTarget(importedBuffer, clientTarget.buffer.fence,
+                                   clientTarget.dataspace, clientTarget.damage);
+  if (error != HWC3::Error::None) {
+    LOG_DISPLAY_COMMAND_ERROR(display, error);
+    mCommandResults->addError(error);
+    return;
+  }
+}
+
+void ComposerClient::executeDisplayCommandSetOutputBuffer(
+    Display* display, const Buffer& buffer) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  // Owned by mResources.
+  buffer_handle_t importedBuffer = nullptr;
+
+  auto releaser = mResources->createReleaser(/*isBuffer=*/true);
+  auto error = mResources->getDisplayOutputBuffer(
+      display->getId(), buffer, &importedBuffer, releaser.get());
+  if (error != HWC3::Error::None) {
+    LOG_DISPLAY_COMMAND_ERROR(display, error);
+    mCommandResults->addError(error);
+    return;
+  }
+
+  error = display->setOutputBuffer(importedBuffer, buffer.fence);
+  if (error != HWC3::Error::None) {
+    LOG_DISPLAY_COMMAND_ERROR(display, error);
+    mCommandResults->addError(error);
+    return;
+  }
+}
+
+void ComposerClient::executeDisplayCommandValidateDisplay(
+    Display* display,
+    const std::optional<ClockMonotonicTimestamp> expectedPresentTime) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  auto error = display->setExpectedPresentTime(expectedPresentTime);
+  if (error != HWC3::Error::None) {
+    LOG_DISPLAY_COMMAND_ERROR(display, error);
+    mCommandResults->addError(error);
+  }
+
+  DisplayChanges changes;
+
+  error = display->validate(&changes);
+  if (error != HWC3::Error::None) {
+    LOG_DISPLAY_COMMAND_ERROR(display, error);
+    mCommandResults->addError(error);
+  } else {
+    mCommandResults->addChanges(changes);
+  }
+
+  mResources->setDisplayMustValidateState(display->getId(), false);
+}
+
+void ComposerClient::executeDisplayCommandAcceptDisplayChanges(
+    Display* display) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  auto error = display->acceptChanges();
+  if (error != HWC3::Error::None) {
+    LOG_DISPLAY_COMMAND_ERROR(display, error);
+    mCommandResults->addError(error);
+  }
+}
+
+void ComposerClient::executeDisplayCommandPresentOrValidateDisplay(
+    Display* display,
+    const std::optional<ClockMonotonicTimestamp> expectedPresentTime) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  // TODO: Support SKIP_VALIDATE.
+
+  auto error = display->setExpectedPresentTime(expectedPresentTime);
+  if (error != HWC3::Error::None) {
+    LOG_DISPLAY_COMMAND_ERROR(display, error);
+    mCommandResults->addError(error);
+  }
+
+  DisplayChanges changes;
+
+  error = display->validate(&changes);
+  if (error != HWC3::Error::None) {
+    LOG_DISPLAY_COMMAND_ERROR(display, error);
+    mCommandResults->addError(error);
+  } else {
+    const int64_t displayId = display->getId();
+    mCommandResults->addChanges(changes);
+    mCommandResults->addPresentOrValidateResult(
+        displayId, PresentOrValidate::Result::Validated);
+  }
+
+  mResources->setDisplayMustValidateState(display->getId(), false);
+}
+
+void ComposerClient::executeDisplayCommandPresentDisplay(Display* display) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  if (mResources->mustValidateDisplay(display->getId())) {
+    ALOGE("%s: display:%" PRIu64 " not validated", __FUNCTION__,
+          display->getId());
+    mCommandResults->addError(HWC3::Error::NotValidated);
+    return;
+  }
+
+  ::android::base::unique_fd displayFence;
+  std::unordered_map<int64_t, ::android::base::unique_fd> layerFences;
+
+  auto error = display->present(&displayFence, &layerFences);
+  if (error != HWC3::Error::None) {
+    LOG_DISPLAY_COMMAND_ERROR(display, error);
+    mCommandResults->addError(error);
+  } else {
+    const int64_t displayId = display->getId();
+    mCommandResults->addPresentFence(displayId, std::move(displayFence));
+    mCommandResults->addReleaseFences(displayId, std::move(layerFences));
+  }
+}
+
+void ComposerClient::executeLayerCommandSetLayerCursorPosition(
+    Display* display, Layer* layer, const common::Point& cursorPosition) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  auto error = layer->setCursorPosition(cursorPosition);
+  if (error != HWC3::Error::None) {
+    LOG_LAYER_COMMAND_ERROR(display, layer, error);
+    mCommandResults->addError(error);
+  }
+}
+
+void ComposerClient::executeLayerCommandSetLayerBuffer(Display* display,
+                                                       Layer* layer,
+                                                       const Buffer& buffer) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  // Owned by mResources.
+  buffer_handle_t importedBuffer = nullptr;
+
+  auto releaser = mResources->createReleaser(/*isBuffer=*/true);
+  auto error =
+      mResources->getLayerBuffer(display->getId(), layer->getId(), buffer,
+                                 &importedBuffer, releaser.get());
+  if (error != HWC3::Error::None) {
+    LOG_LAYER_COMMAND_ERROR(display, layer, error);
+    mCommandResults->addError(error);
+    return;
+  }
+
+  error = layer->setBuffer(importedBuffer, buffer.fence);
+  if (error != HWC3::Error::None) {
+    LOG_LAYER_COMMAND_ERROR(display, layer, error);
+    mCommandResults->addError(error);
+  }
+}
+
+void ComposerClient::executeLayerCommandSetLayerSurfaceDamage(
+    Display* display, Layer* layer,
+    const std::vector<std::optional<common::Rect>>& damage) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  auto error = layer->setSurfaceDamage(damage);
+  if (error != HWC3::Error::None) {
+    LOG_LAYER_COMMAND_ERROR(display, layer, error);
+    mCommandResults->addError(error);
+  }
+}
+
+void ComposerClient::executeLayerCommandSetLayerBlendMode(
+    Display* display, Layer* layer, const ParcelableBlendMode& blendMode) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  auto error = layer->setBlendMode(blendMode.blendMode);
+  if (error != HWC3::Error::None) {
+    LOG_LAYER_COMMAND_ERROR(display, layer, error);
+    mCommandResults->addError(error);
+  }
+}
+
+void ComposerClient::executeLayerCommandSetLayerColor(Display* display,
+                                                      Layer* layer,
+                                                      const Color& color) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  auto error = layer->setColor(color);
+  if (error != HWC3::Error::None) {
+    LOG_LAYER_COMMAND_ERROR(display, layer, error);
+    mCommandResults->addError(error);
+  }
+}
+
+void ComposerClient::executeLayerCommandSetLayerComposition(
+    Display* display, Layer* layer, const ParcelableComposition& composition) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  auto error = layer->setCompositionType(composition.composition);
+  if (error != HWC3::Error::None) {
+    LOG_LAYER_COMMAND_ERROR(display, layer, error);
+    mCommandResults->addError(error);
+  }
+}
+
+void ComposerClient::executeLayerCommandSetLayerDataspace(
+    Display* display, Layer* layer, const ParcelableDataspace& dataspace) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  auto error = layer->setDataspace(dataspace.dataspace);
+  if (error != HWC3::Error::None) {
+    LOG_LAYER_COMMAND_ERROR(display, layer, error);
+    mCommandResults->addError(error);
+  }
+}
+
+void ComposerClient::executeLayerCommandSetLayerDisplayFrame(
+    Display* display, Layer* layer, const common::Rect& rect) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  auto error = layer->setDisplayFrame(rect);
+  if (error != HWC3::Error::None) {
+    LOG_LAYER_COMMAND_ERROR(display, layer, error);
+    mCommandResults->addError(error);
+  }
+}
+
+void ComposerClient::executeLayerCommandSetLayerPlaneAlpha(
+    Display* display, Layer* layer, const PlaneAlpha& planeAlpha) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  auto error = layer->setPlaneAlpha(planeAlpha.alpha);
+  if (error != HWC3::Error::None) {
+    LOG_LAYER_COMMAND_ERROR(display, layer, error);
+    mCommandResults->addError(error);
+  }
+}
+
+void ComposerClient::executeLayerCommandSetLayerSidebandStream(
+    Display* display, Layer* layer,
+    const aidl::android::hardware::common::NativeHandle& handle) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  // Owned by mResources.
+  buffer_handle_t importedStream = nullptr;
+
+  auto releaser = mResources->createReleaser(/*isBuffer=*/false);
+  auto error = mResources->getLayerSidebandStream(
+      display->getId(), layer->getId(), handle, &importedStream,
+      releaser.get());
+  if (error != HWC3::Error::None) {
+    LOG_LAYER_COMMAND_ERROR(display, layer, error);
+    mCommandResults->addError(error);
+    return;
+  }
+
+  error = layer->setSidebandStream(importedStream);
+  if (error != HWC3::Error::None) {
+    LOG_LAYER_COMMAND_ERROR(display, layer, error);
+    mCommandResults->addError(error);
+  }
+}
+
+void ComposerClient::executeLayerCommandSetLayerSourceCrop(
+    Display* display, Layer* layer, const common::FRect& sourceCrop) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  auto error = layer->setSourceCrop(sourceCrop);
+  if (error != HWC3::Error::None) {
+    LOG_LAYER_COMMAND_ERROR(display, layer, error);
+    mCommandResults->addError(error);
+  }
+}
+
+void ComposerClient::executeLayerCommandSetLayerTransform(
+    Display* display, Layer* layer, const ParcelableTransform& transform) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  auto error = layer->setTransform(transform.transform);
+  if (error != HWC3::Error::None) {
+    LOG_LAYER_COMMAND_ERROR(display, layer, error);
+    mCommandResults->addError(error);
+  }
+}
+
+void ComposerClient::executeLayerCommandSetLayerVisibleRegion(
+    Display* display, Layer* layer,
+    const std::vector<std::optional<common::Rect>>& visibleRegion) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  auto error = layer->setVisibleRegion(visibleRegion);
+  if (error != HWC3::Error::None) {
+    LOG_LAYER_COMMAND_ERROR(display, layer, error);
+    mCommandResults->addError(error);
+  }
+}
+
+void ComposerClient::executeLayerCommandSetLayerZOrder(Display* display,
+                                                       Layer* layer,
+                                                       const ZOrder& zOrder) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  auto error = layer->setZOrder(zOrder.z);
+  if (error != HWC3::Error::None) {
+    LOG_LAYER_COMMAND_ERROR(display, layer, error);
+    mCommandResults->addError(error);
+  }
+}
+
+void ComposerClient::executeLayerCommandSetLayerPerFrameMetadata(
+    Display* display, Layer* layer,
+    const std::vector<std::optional<PerFrameMetadata>>& perFrameMetadata) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  auto error = layer->setPerFrameMetadata(perFrameMetadata);
+  if (error != HWC3::Error::None) {
+    LOG_LAYER_COMMAND_ERROR(display, layer, error);
+    mCommandResults->addError(error);
+  }
+}
+
+void ComposerClient::executeLayerCommandSetLayerColorTransform(
+    Display* display, Layer* layer, const std::vector<float>& colorTransform) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  auto error = layer->setColorTransform(colorTransform);
+  if (error != HWC3::Error::None) {
+    LOG_LAYER_COMMAND_ERROR(display, layer, error);
+    mCommandResults->addError(error);
+  }
+}
+
+void ComposerClient::executeLayerCommandSetLayerBrightness(
+    Display* display, Layer* layer, const LayerBrightness& brightness) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  auto error = layer->setBrightness(brightness.brightness);
+  if (error != HWC3::Error::None) {
+    LOG_LAYER_COMMAND_ERROR(display, layer, error);
+    mCommandResults->addError(error);
+  }
+}
+
+void ComposerClient::executeLayerCommandSetLayerPerFrameMetadataBlobs(
+    Display* display, Layer* layer,
+    const std::vector<std::optional<PerFrameMetadataBlob>>&
+        perFrameMetadataBlob) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  auto error = layer->setPerFrameMetadataBlobs(perFrameMetadataBlob);
+  if (error != HWC3::Error::None) {
+    LOG_LAYER_COMMAND_ERROR(display, layer, error);
+    mCommandResults->addError(error);
+  }
+}
+
+Display* ComposerClient::getDisplay(int64_t displayId) {
+  auto it = mDisplays.find(displayId);
+  if (it == mDisplays.end()) {
+    ALOGE("%s: no display:%" PRIu64, __FUNCTION__, displayId);
+    return nullptr;
+  }
+  return it->second.get();
+}
+
+HWC3::Error ComposerClient::createDisplaysLocked() {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  if (!mComposer) {
+    ALOGE("%s composer not initialized!", __FUNCTION__);
+    return HWC3::Error::NoResources;
+  }
+
+  std::vector<DisplayMultiConfigs> displays;
+
+  HWC3::Error error = findDisplays(mComposer->getDrmPresenter(), &displays);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s failed to find display configs", __FUNCTION__);
+    return error;
+  }
+
+  for (const auto& iter : displays) {
+    error =
+        createDisplayLocked(iter.displayId, iter.activeConfigId, iter.configs);
+    if (error != HWC3::Error::None) {
+      ALOGE("%s failed to create display from config", __FUNCTION__);
+      return error;
+    }
+  }
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error ComposerClient::createDisplayLocked(
+    int64_t displayId, int32_t activeConfigId,
+    const std::vector<DisplayConfig>& configs) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  if (!mComposer) {
+    ALOGE("%s composer not initialized!", __FUNCTION__);
+    return HWC3::Error::NoResources;
+  }
+
+  auto display = std::make_unique<Display>(mComposer, displayId);
+  if (display == nullptr) {
+    ALOGE("%s failed to allocate display", __FUNCTION__);
+    return HWC3::Error::NoResources;
+  }
+
+  HWC3::Error error = display->init(configs, activeConfigId);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s failed to initialize display:%" PRIu64, __FUNCTION__, displayId);
+    return error;
+  }
+
+  error = mComposer->onDisplayCreate(display.get());
+  if (error != HWC3::Error::None) {
+    ALOGE("%s failed to register display:%" PRIu64 " with composer",
+          __FUNCTION__, displayId);
+    return error;
+  }
+
+  display->setPowerMode(PowerMode::ON);
+
+  DEBUG_LOG("%s: adding display:%" PRIu64, __FUNCTION__, displayId);
+  mDisplays.emplace(displayId, std::move(display));
+
+  error = mResources->addPhysicalDisplay(displayId);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s failed to initialize display:%" PRIu64 " resources", __FUNCTION__,
+          displayId);
+    return error;
+  }
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error ComposerClient::destroyDisplaysLocked() {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  std::vector<int64_t> displayIds;
+  for (const auto& [displayId, _] : mDisplays) {
+    displayIds.push_back(displayId);
+  }
+  for (const int64_t displayId : displayIds) {
+    destroyDisplayLocked(displayId);
+  }
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error ComposerClient::destroyDisplayLocked(int64_t displayId) {
+  DEBUG_LOG("%s display:%" PRId64, __FUNCTION__, displayId);
+
+  auto it = mDisplays.find(displayId);
+  if (it == mDisplays.end()) {
+    ALOGE("%s: display:%" PRId64 " no such display?", __FUNCTION__, displayId);
+    return HWC3::Error::BadDisplay;
+  }
+
+  Display* display = it->second.get();
+
+  display->setPowerMode(PowerMode::OFF);
+
+  HWC3::Error error = mComposer->onDisplayDestroy(it->second.get());
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: display:%" PRId64 " failed to destroy with frame composer",
+          __FUNCTION__, displayId);
+  }
+
+  error = mResources->removeDisplay(displayId);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: display:%" PRId64 " failed to destroy with resources",
+          __FUNCTION__, displayId);
+  }
+
+  mDisplays.erase(it);
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error ComposerClient::handleHotplug(bool connected, uint32_t id,
+                                          uint32_t width, uint32_t height,
+                                          uint32_t dpiX, uint32_t dpiY,
+                                          uint32_t refreshRate) {
+  if (!mCallbacks) {
+    return HWC3::Error::None;
+  }
+
+  const int64_t displayId = static_cast<int64_t>(id);
+
+  if (connected) {
+    const int32_t configId = static_cast<int32_t>(id);
+    const std::vector<DisplayConfig> configs = {
+        DisplayConfig(configId, static_cast<int>(width),
+                      static_cast<int>(height), static_cast<int>(dpiX),
+                      static_cast<int>(dpiY), static_cast<int>(refreshRate))};
+    {
+      std::unique_lock<std::mutex> lock(mStateMutex);
+      createDisplayLocked(displayId, configId, configs);
+    }
+
+    ALOGI("Connecting display:%" PRIu32 " w:%" PRIu32 " h:%" PRIu32
+          " dpiX:%" PRIu32 " dpiY %" PRIu32 "fps %" PRIu32,
+          id, width, height, dpiX, dpiY, refreshRate);
+    mCallbacks->onHotplug(displayId, /*connected=*/true);
+  } else {
+    ALOGI("Disconnecting display:%" PRIu64, displayId);
+    mCallbacks->onHotplug(displayId, /*connected=*/false);
+
+    Display* display = getDisplay(displayId);
+    if (display != nullptr) {
+      std::unique_lock<std::mutex> lock(mStateMutex);
+      destroyDisplayLocked(displayId);
+    }
+  }
+
+  return HWC3::Error::None;
+}
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
\ No newline at end of file
diff --git a/system/hwc3/ComposerClient.h b/system/hwc3/ComposerClient.h
new file mode 100644
index 0000000..7e19d2c
--- /dev/null
+++ b/system/hwc3/ComposerClient.h
@@ -0,0 +1,246 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_HWC_COMPOSERCLIENT_H
+#define ANDROID_HWC_COMPOSERCLIENT_H
+
+#include <aidl/android/hardware/graphics/composer3/BnComposerClient.h>
+#include <utils/Mutex.h>
+
+#include <memory>
+
+#include "ComposerResources.h"
+#include "Display.h"
+#include "FrameComposer.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+class ComposerClient : public BnComposerClient {
+ public:
+  ComposerClient();
+  virtual ~ComposerClient();
+
+  HWC3::Error init();
+
+  void setOnClientDestroyed(std::function<void()> onClientDestroyed) {
+    mOnClientDestroyed = onClientDestroyed;
+  }
+
+  // HWC3 interface:
+  ndk::ScopedAStatus createLayer(int64_t displayId, int32_t bufferSlotCount,
+                                 int64_t* layer) override;
+  ndk::ScopedAStatus createVirtualDisplay(int32_t width, int32_t height,
+                                          common::PixelFormat formatHint,
+                                          int32_t outputBufferSlotCount,
+                                          VirtualDisplay* display) override;
+  ndk::ScopedAStatus destroyLayer(int64_t displayId, int64_t layer) override;
+  ndk::ScopedAStatus destroyVirtualDisplay(int64_t displayId) override;
+  ndk::ScopedAStatus executeCommands(
+      const std::vector<DisplayCommand>& commands,
+      std::vector<CommandResultPayload>* results) override;
+  ndk::ScopedAStatus getActiveConfig(int64_t displayId,
+                                     int32_t* config) override;
+  ndk::ScopedAStatus getColorModes(int64_t displayId,
+                                   std::vector<ColorMode>* colorModes) override;
+  ndk::ScopedAStatus getDataspaceSaturationMatrix(
+      common::Dataspace dataspace, std::vector<float>* matrix) override;
+  ndk::ScopedAStatus getDisplayAttribute(int64_t displayId, int32_t config,
+                                         DisplayAttribute attribute,
+                                         int32_t* value) override;
+  ndk::ScopedAStatus getDisplayCapabilities(
+      int64_t displayId, std::vector<DisplayCapability>* caps) override;
+  ndk::ScopedAStatus getDisplayConfigs(int64_t displayId,
+                                       std::vector<int32_t>* configs) override;
+  ndk::ScopedAStatus getDisplayConnectionType(
+      int64_t displayId, DisplayConnectionType* type) override;
+  ndk::ScopedAStatus getDisplayIdentificationData(
+      int64_t displayId, DisplayIdentification* id) override;
+  ndk::ScopedAStatus getDisplayName(int64_t displayId,
+                                    std::string* name) override;
+  ndk::ScopedAStatus getDisplayVsyncPeriod(int64_t displayId,
+                                           int32_t* vsyncPeriod) override;
+  ndk::ScopedAStatus getDisplayedContentSample(
+      int64_t displayId, int64_t maxFrames, int64_t timestamp,
+      DisplayContentSample* samples) override;
+  ndk::ScopedAStatus getDisplayedContentSamplingAttributes(
+      int64_t displayId, DisplayContentSamplingAttributes* attrs) override;
+  ndk::ScopedAStatus getDisplayPhysicalOrientation(
+      int64_t displayId, common::Transform* orientation) override;
+  ndk::ScopedAStatus getHdrCapabilities(int64_t displayId,
+                                        HdrCapabilities* caps) override;
+  ndk::ScopedAStatus getMaxVirtualDisplayCount(int32_t* count) override;
+  ndk::ScopedAStatus getPerFrameMetadataKeys(
+      int64_t displayId, std::vector<PerFrameMetadataKey>* keys) override;
+  ndk::ScopedAStatus getReadbackBufferAttributes(
+      int64_t displayId, ReadbackBufferAttributes* attrs) override;
+  ndk::ScopedAStatus getReadbackBufferFence(
+      int64_t displayId, ndk::ScopedFileDescriptor* acquireFence) override;
+  ndk::ScopedAStatus getRenderIntents(
+      int64_t displayId, ColorMode mode,
+      std::vector<RenderIntent>* intents) override;
+  ndk::ScopedAStatus getSupportedContentTypes(
+      int64_t displayId, std::vector<ContentType>* types) override;
+  ndk::ScopedAStatus getDisplayDecorationSupport(
+      int64_t displayId,
+      std::optional<common::DisplayDecorationSupport>* support) override;
+  ndk::ScopedAStatus registerCallback(
+      const std::shared_ptr<IComposerCallback>& callback) override;
+  ndk::ScopedAStatus setActiveConfig(int64_t displayId,
+                                     int32_t config) override;
+  ndk::ScopedAStatus setActiveConfigWithConstraints(
+      int64_t displayId, int32_t config,
+      const VsyncPeriodChangeConstraints& constraints,
+      VsyncPeriodChangeTimeline* timeline) override;
+  ndk::ScopedAStatus setBootDisplayConfig(int64_t displayId,
+                                          int32_t config) override;
+  ndk::ScopedAStatus clearBootDisplayConfig(int64_t displayId) override;
+  ndk::ScopedAStatus getPreferredBootDisplayConfig(int64_t displayId,
+                                                   int32_t* config) override;
+  ndk::ScopedAStatus setAutoLowLatencyMode(int64_t displayId, bool on) override;
+  ndk::ScopedAStatus setClientTargetSlotCount(int64_t displayId,
+                                              int32_t count) override;
+  ndk::ScopedAStatus setColorMode(int64_t displayId, ColorMode mode,
+                                  RenderIntent intent) override;
+  ndk::ScopedAStatus setContentType(int64_t displayId,
+                                    ContentType type) override;
+  ndk::ScopedAStatus setDisplayedContentSamplingEnabled(
+      int64_t displayId, bool enable, FormatColorComponent componentMask,
+      int64_t maxFrames) override;
+  ndk::ScopedAStatus setPowerMode(int64_t displayId, PowerMode mode) override;
+  ndk::ScopedAStatus setReadbackBuffer(
+      int64_t displayId,
+      const aidl::android::hardware::common::NativeHandle& buffer,
+      const ndk::ScopedFileDescriptor& releaseFence) override;
+  ndk::ScopedAStatus setVsyncEnabled(int64_t displayId, bool enabled) override;
+  ndk::ScopedAStatus setIdleTimerEnabled(int64_t displayId,
+                                         int32_t timeoutMs) override;
+
+ protected:
+  ndk::SpAIBinder createBinder() override;
+
+ private:
+  class CommandResultWriter;
+
+  void executeDisplayCommand(const DisplayCommand& displayCommand);
+  void executeLayerCommand(Display* display, const LayerCommand& layerCommand);
+
+  void executeDisplayCommandSetColorTransform(Display* display,
+                                              const std::vector<float>& matrix);
+  void executeDisplayCommandSetBrightness(Display* display,
+                                          const DisplayBrightness& brightness);
+  void executeDisplayCommandSetClientTarget(Display* display,
+                                            const ClientTarget& command);
+  void executeDisplayCommandSetOutputBuffer(Display* display,
+                                            const Buffer& buffer);
+  void executeDisplayCommandValidateDisplay(
+      Display* display,
+      const std::optional<ClockMonotonicTimestamp> expectedPresentTime);
+  void executeDisplayCommandAcceptDisplayChanges(Display* display);
+  void executeDisplayCommandPresentOrValidateDisplay(
+      Display* display,
+      const std::optional<ClockMonotonicTimestamp> expectedPresentTime);
+  void executeDisplayCommandPresentDisplay(Display* display);
+
+  void executeLayerCommandSetLayerCursorPosition(
+      Display* display, Layer* layer, const common::Point& cursorPosition);
+  void executeLayerCommandSetLayerBuffer(Display* display, Layer* layer,
+                                         const Buffer& buffer);
+  void executeLayerCommandSetLayerSurfaceDamage(
+      Display* display, Layer* layer,
+      const std::vector<std::optional<common::Rect>>& damage);
+  void executeLayerCommandSetLayerBlendMode(
+      Display* display, Layer* layer, const ParcelableBlendMode& blendMode);
+  void executeLayerCommandSetLayerColor(Display* display, Layer* layer,
+                                        const Color& color);
+  void executeLayerCommandSetLayerComposition(
+      Display* display, Layer* layer, const ParcelableComposition& composition);
+  void executeLayerCommandSetLayerDataspace(
+      Display* display, Layer* layer, const ParcelableDataspace& dataspace);
+  void executeLayerCommandSetLayerDisplayFrame(Display* display, Layer* layer,
+                                               const common::Rect& rect);
+  void executeLayerCommandSetLayerPlaneAlpha(Display* display, Layer* layer,
+                                             const PlaneAlpha& planeAlpha);
+  void executeLayerCommandSetLayerSidebandStream(
+      Display* display, Layer* layer,
+      const aidl::android::hardware::common::NativeHandle& sidebandStream);
+  void executeLayerCommandSetLayerSourceCrop(Display* display, Layer* layer,
+                                             const common::FRect& sourceCrop);
+  void executeLayerCommandSetLayerTransform(
+      Display* display, Layer* layer, const ParcelableTransform& transform);
+  void executeLayerCommandSetLayerVisibleRegion(
+      Display* display, Layer* layer,
+      const std::vector<std::optional<common::Rect>>& visibleRegion);
+  void executeLayerCommandSetLayerZOrder(Display* display, Layer* layer,
+                                         const ZOrder& zOrder);
+  void executeLayerCommandSetLayerPerFrameMetadata(
+      Display* display, Layer* layer,
+      const std::vector<std::optional<PerFrameMetadata>>& perFrameMetadata);
+  void executeLayerCommandSetLayerColorTransform(
+      Display* display, Layer* layer, const std::vector<float>& colorTransform);
+  void executeLayerCommandSetLayerBrightness(Display* display, Layer* layer,
+                                             const LayerBrightness& brightness);
+  void executeLayerCommandSetLayerPerFrameMetadataBlobs(
+      Display* display, Layer* layer,
+      const std::vector<std::optional<PerFrameMetadataBlob>>&
+          perFrameMetadataBlob);
+
+  // Returns the display with the given id or nullptr if not found.
+  Display* getDisplay(int64_t displayId);
+
+  // Finds the Cuttlefish/Goldfish specific configuration and initializes the
+  // displays.
+  HWC3::Error createDisplaysLocked();
+
+  // Creates a display with the given properties.
+  HWC3::Error createDisplayLocked(int64_t displayId, int32_t activeConfigId,
+                                  const std::vector<DisplayConfig>& configs);
+
+  HWC3::Error destroyDisplaysLocked();
+
+  HWC3::Error destroyDisplayLocked(int64_t displayId);
+
+  HWC3::Error handleHotplug(bool connected,   //
+                            uint32_t id,      //
+                            uint32_t width,   //
+                            uint32_t height,  //
+                            uint32_t dpiX,    //
+                            uint32_t dpiY,    //
+                            uint32_t refreshRate);
+
+  std::mutex mStateMutex;
+
+  std::map<int64_t, std::unique_ptr<Display>> mDisplays;
+
+  // The onHotplug(), onVsync(), etc callbacks registered by SurfaceFlinger.
+  std::shared_ptr<IComposerCallback> mCallbacks;
+
+  std::function<void()> mOnClientDestroyed;
+
+  // Underlying interface for composing layers in the guest using libyuv or in
+  // the host using opengl. Owned by Device.
+  FrameComposer* mComposer = nullptr;
+
+  // For the duration of a executeCommands(), the helper used to collect
+  // individual command results.
+  std::unique_ptr<CommandResultWriter> mCommandResults;
+
+  // Manages importing and caching gralloc buffers for displays and layers.
+  std::unique_ptr<ComposerResources> mResources;
+};
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
+
+#endif
\ No newline at end of file
diff --git a/system/hwc3/ComposerResources.cpp b/system/hwc3/ComposerResources.cpp
new file mode 100644
index 0000000..2e17c2c
--- /dev/null
+++ b/system/hwc3/ComposerResources.cpp
@@ -0,0 +1,255 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ComposerResources.h"
+
+#include <aidlcommonsupport/NativeHandle.h>
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+namespace {
+
+HWC3::Error toHwc3Error(
+    ::android::hardware::graphics::composer::V2_1::Error error) {
+  switch (error) {
+    case ::android::hardware::graphics::composer::V2_1::Error::NONE:
+      return HWC3::Error::None;
+    case ::android::hardware::graphics::composer::V2_1::Error::BAD_CONFIG:
+      return HWC3::Error::BadConfig;
+    case ::android::hardware::graphics::composer::V2_1::Error::BAD_DISPLAY:
+      return HWC3::Error::BadDisplay;
+    case ::android::hardware::graphics::composer::V2_1::Error::BAD_LAYER:
+      return HWC3::Error::BadLayer;
+    case ::android::hardware::graphics::composer::V2_1::Error::BAD_PARAMETER:
+      return HWC3::Error::BadParameter;
+    case ::android::hardware::graphics::composer::V2_1::Error::NO_RESOURCES:
+      return HWC3::Error::NoResources;
+    case ::android::hardware::graphics::composer::V2_1::Error::NOT_VALIDATED:
+      return HWC3::Error::NotValidated;
+    case ::android::hardware::graphics::composer::V2_1::Error::UNSUPPORTED:
+      return HWC3::Error::Unsupported;
+  }
+}
+
+::android::hardware::graphics::composer::V2_1::Display toHwc2Display(
+    int64_t displayId) {
+  return static_cast<::android::hardware::graphics::composer::V2_1::Display>(
+      displayId);
+}
+
+::android::hardware::graphics::composer::V2_1::Layer toHwc2Layer(
+    int64_t layerId) {
+  return static_cast<::android::hardware::graphics::composer::V2_1::Layer>(
+      layerId);
+}
+
+}  // namespace
+
+std::unique_ptr<ComposerResourceReleaser> ComposerResources::createReleaser(
+    bool isBuffer) {
+  return std::make_unique<ComposerResourceReleaser>(isBuffer);
+}
+
+HWC3::Error ComposerResources::init() {
+  mImpl = ::android::hardware::graphics::composer::V2_2::hal::
+      ComposerResources::create();
+  if (!mImpl) {
+    ALOGE("%s: failed to create underlying ComposerResources.", __FUNCTION__);
+    return HWC3::Error::NoResources;
+  }
+  return HWC3::Error::None;
+}
+
+void ComposerResources::clear(
+    ::android::hardware::graphics::composer::V2_2::hal::ComposerResources::
+        RemoveDisplay removeDisplay) {
+  mImpl->clear(removeDisplay);
+}
+
+bool ComposerResources::hasDisplay(int64_t displayId) {
+  ::android::hardware::graphics::composer::V2_1::Display display =
+      toHwc2Display(displayId);
+  return mImpl->hasDisplay(display);
+}
+
+HWC3::Error ComposerResources::addPhysicalDisplay(int64_t displayId) {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, displayId);
+  ::android::hardware::graphics::composer::V2_1::Display display =
+      toHwc2Display(displayId);
+  return toHwc3Error(mImpl->addPhysicalDisplay(display));
+}
+
+HWC3::Error ComposerResources::addVirtualDisplay(
+    int64_t displayId, uint32_t outputBufferCacheSize) {
+  ::android::hardware::graphics::composer::V2_1::Display display =
+      toHwc2Display(displayId);
+  return toHwc3Error(mImpl->addVirtualDisplay(display, outputBufferCacheSize));
+}
+
+HWC3::Error ComposerResources::removeDisplay(int64_t displayId) {
+  ::android::hardware::graphics::composer::V2_1::Display display =
+      toHwc2Display(displayId);
+  return toHwc3Error(mImpl->removeDisplay(display));
+}
+
+HWC3::Error ComposerResources::setDisplayClientTargetCacheSize(
+    int64_t displayId, uint32_t clientTargetCacheSize) {
+  ::android::hardware::graphics::composer::V2_1::Display display =
+      toHwc2Display(displayId);
+  return toHwc3Error(
+      mImpl->setDisplayClientTargetCacheSize(display, clientTargetCacheSize));
+}
+
+HWC3::Error ComposerResources::getDisplayClientTargetCacheSize(
+    int64_t displayId, size_t* outCacheSize) {
+  ::android::hardware::graphics::composer::V2_1::Display display =
+      toHwc2Display(displayId);
+  return toHwc3Error(
+      mImpl->getDisplayClientTargetCacheSize(display, outCacheSize));
+}
+
+HWC3::Error ComposerResources::getDisplayOutputBufferCacheSize(
+    int64_t displayId, size_t* outCacheSize) {
+  ::android::hardware::graphics::composer::V2_1::Display display =
+      toHwc2Display(displayId);
+  return toHwc3Error(
+      mImpl->getDisplayOutputBufferCacheSize(display, outCacheSize));
+}
+
+HWC3::Error ComposerResources::addLayer(int64_t displayId, int64_t layerId,
+                                        uint32_t bufferCacheSize) {
+  DEBUG_LOG("%s: display:%" PRId64 " layer:%" PRId64, __FUNCTION__, displayId,
+            layerId);
+
+  ::android::hardware::graphics::composer::V2_1::Display display =
+      toHwc2Display(displayId);
+  ::android::hardware::graphics::composer::V2_1::Layer layer =
+      toHwc2Layer(layerId);
+  return toHwc3Error(mImpl->addLayer(display, layer, bufferCacheSize));
+}
+
+HWC3::Error ComposerResources::removeLayer(int64_t displayId, int64_t layerId) {
+  DEBUG_LOG("%s: display:%" PRId64 " layer:%" PRId64, __FUNCTION__, displayId,
+            layerId);
+
+  ::android::hardware::graphics::composer::V2_1::Display display =
+      toHwc2Display(displayId);
+  ::android::hardware::graphics::composer::V2_1::Layer layer =
+      toHwc2Layer(layerId);
+
+  return toHwc3Error(mImpl->removeLayer(display, layer));
+}
+
+void ComposerResources::setDisplayMustValidateState(int64_t displayId,
+                                                    bool mustValidate) {
+  ::android::hardware::graphics::composer::V2_1::Display display =
+      toHwc2Display(displayId);
+  mImpl->setDisplayMustValidateState(display, mustValidate);
+}
+
+bool ComposerResources::mustValidateDisplay(int64_t displayId) {
+  ::android::hardware::graphics::composer::V2_1::Display display =
+      toHwc2Display(displayId);
+  return mImpl->mustValidateDisplay(display);
+}
+
+HWC3::Error ComposerResources::getDisplayReadbackBuffer(
+    int64_t displayId,
+    const aidl::android::hardware::common::NativeHandle& handle,
+    buffer_handle_t* outHandle, ComposerResourceReleaser* releaser) {
+  ::android::hardware::graphics::composer::V2_1::Display display =
+      toHwc2Display(displayId);
+  return toHwc3Error(mImpl->getDisplayReadbackBuffer(
+      display, ::android::makeFromAidl(handle), outHandle,
+      releaser->getReplacedHandle()));
+}
+
+HWC3::Error ComposerResources::getDisplayClientTarget(
+    int64_t displayId, const Buffer& buffer, buffer_handle_t* outHandle,
+    ComposerResourceReleaser* releaser) {
+  ::android::hardware::graphics::composer::V2_1::Display display =
+      toHwc2Display(displayId);
+
+  const bool useCache = !buffer.handle.has_value();
+
+  buffer_handle_t bufferHandle = nullptr;
+  if (buffer.handle.has_value()) {
+    bufferHandle = ::android::makeFromAidl(*buffer.handle);
+  }
+
+  return toHwc3Error(mImpl->getDisplayClientTarget(
+      display, buffer.slot, useCache, bufferHandle, outHandle,
+      releaser->getReplacedHandle()));
+}
+
+HWC3::Error ComposerResources::getDisplayOutputBuffer(
+    int64_t displayId, const Buffer& buffer, buffer_handle_t* outHandle,
+    ComposerResourceReleaser* releaser) {
+  ::android::hardware::graphics::composer::V2_1::Display display =
+      toHwc2Display(displayId);
+
+  const bool useCache = !buffer.handle.has_value();
+
+  buffer_handle_t bufferHandle = nullptr;
+  if (buffer.handle.has_value()) {
+    bufferHandle = ::android::makeFromAidl(*buffer.handle);
+  }
+
+  return toHwc3Error(mImpl->getDisplayOutputBuffer(
+      display, buffer.slot, useCache, bufferHandle, outHandle,
+      releaser->getReplacedHandle()));
+}
+
+HWC3::Error ComposerResources::getLayerBuffer(
+    int64_t displayId, int64_t layerId, const Buffer& buffer,
+    buffer_handle_t* outHandle, ComposerResourceReleaser* releaser) {
+  DEBUG_LOG("%s: display:%" PRId64 " layer:%" PRId64, __FUNCTION__, displayId,
+            layerId);
+
+  ::android::hardware::graphics::composer::V2_1::Display display =
+      toHwc2Display(displayId);
+  ::android::hardware::graphics::composer::V2_1::Layer layer =
+      toHwc2Layer(layerId);
+
+  const bool useCache = !buffer.handle.has_value();
+
+  buffer_handle_t bufferHandle = nullptr;
+  if (buffer.handle.has_value()) {
+    bufferHandle = ::android::makeFromAidl(*buffer.handle);
+  }
+
+  DEBUG_LOG("%s fromCache:%s", __FUNCTION__, (useCache ? "yes" : "no"));
+  return toHwc3Error(mImpl->getLayerBuffer(display, layer, buffer.slot,
+                                           useCache, bufferHandle, outHandle,
+                                           releaser->getReplacedHandle()));
+}
+
+HWC3::Error ComposerResources::getLayerSidebandStream(
+    int64_t displayId, int64_t layerId,
+    const aidl::android::hardware::common::NativeHandle& handle,
+    buffer_handle_t* outHandle, ComposerResourceReleaser* releaser) {
+  DEBUG_LOG("%s: display:%" PRId64 " layer:%" PRId64, __FUNCTION__, displayId,
+            layerId);
+
+  ::android::hardware::graphics::composer::V2_1::Display display =
+      toHwc2Display(displayId);
+  ::android::hardware::graphics::composer::V2_1::Layer layer =
+      toHwc2Layer(layerId);
+  return toHwc3Error(mImpl->getLayerSidebandStream(
+      display, layer, ::android::makeFromAidl(handle), outHandle,
+      releaser->getReplacedHandle()));
+}
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
\ No newline at end of file
diff --git a/system/hwc3/ComposerResources.h b/system/hwc3/ComposerResources.h
new file mode 100644
index 0000000..faf6a4d
--- /dev/null
+++ b/system/hwc3/ComposerResources.h
@@ -0,0 +1,119 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Thin wrappers around V2_2::hal::ComposerResources related classes that
+// return HWC3 error codes and accept HWC3 argument types.
+
+#ifndef ANDROID_HWC_COMPOSERRESOURCES_H
+#define ANDROID_HWC_COMPOSERRESOURCES_H
+
+// Must include our LOG_TAG first:
+// clang-format off
+#include "Common.h"
+#include <composer-resources/2.2/ComposerResources.h>
+// clang-format on
+
+#include <memory>
+#include <optional>
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+class ComposerResourceReleaser {
+ public:
+  ComposerResourceReleaser(bool isBuffer) : mReplacedHandle(isBuffer) {}
+  virtual ~ComposerResourceReleaser() = default;
+
+  ::android::hardware::graphics::composer::V2_2::hal::ComposerResources::
+      ReplacedHandle*
+      getReplacedHandle() {
+    return &mReplacedHandle;
+  }
+
+ private:
+  ::android::hardware::graphics::composer::V2_2::hal::ComposerResources::
+      ReplacedHandle mReplacedHandle;
+};
+
+class ComposerResources {
+ public:
+  ComposerResources() = default;
+
+  HWC3::Error init();
+
+  std::unique_ptr<ComposerResourceReleaser> createReleaser(bool isBuffer);
+
+  void clear(::android::hardware::graphics::composer::V2_2::hal::
+                 ComposerResources::RemoveDisplay removeDisplay);
+
+  bool hasDisplay(int64_t display);
+
+  HWC3::Error addPhysicalDisplay(int64_t display);
+
+  HWC3::Error addVirtualDisplay(int64_t displayId,
+                                uint32_t outputBufferCacheSize);
+
+  HWC3::Error removeDisplay(int64_t display);
+
+  HWC3::Error setDisplayClientTargetCacheSize(int64_t displayId,
+                                              uint32_t clientTargetCacheSize);
+
+  HWC3::Error getDisplayClientTargetCacheSize(int64_t displayId,
+                                              size_t* outCacheSize);
+
+  HWC3::Error getDisplayOutputBufferCacheSize(int64_t displayId,
+                                              size_t* outCacheSize);
+
+  HWC3::Error addLayer(int64_t displayId, int64_t layerId,
+                       uint32_t bufferCacheSize);
+
+  HWC3::Error removeLayer(int64_t displayId, int64_t layer);
+
+  void setDisplayMustValidateState(int64_t displayId, bool mustValidate);
+
+  bool mustValidateDisplay(int64_t displayId);
+
+  HWC3::Error getDisplayReadbackBuffer(
+      int64_t displayId,
+      const aidl::android::hardware::common::NativeHandle& handle,
+      buffer_handle_t* outHandle, ComposerResourceReleaser* bufReleaser);
+
+  HWC3::Error getDisplayClientTarget(int64_t displayId, const Buffer& buffer,
+                                     buffer_handle_t* outHandle,
+                                     ComposerResourceReleaser* bufReleaser);
+
+  HWC3::Error getDisplayOutputBuffer(int64_t displayId, const Buffer& buffer,
+                                     buffer_handle_t* outHandle,
+                                     ComposerResourceReleaser* bufReleaser);
+
+  HWC3::Error getLayerBuffer(int64_t displayId, int64_t layerId,
+                             const Buffer& buffer,
+                             buffer_handle_t* outBufferHandle,
+                             ComposerResourceReleaser* bufReleaser);
+
+  HWC3::Error getLayerSidebandStream(
+      int64_t displayId, int64_t layerId,
+      const aidl::android::hardware::common::NativeHandle& rawHandle,
+      buffer_handle_t* outStreamHandle, ComposerResourceReleaser* bufReleaser);
+
+ private:
+  std::unique_ptr<
+      ::android::hardware::graphics::composer::V2_2::hal::ComposerResources>
+      mImpl;
+};
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
+
+#endif
\ No newline at end of file
diff --git a/system/hwc3/Device.cpp b/system/hwc3/Device.cpp
new file mode 100644
index 0000000..894d48b
--- /dev/null
+++ b/system/hwc3/Device.cpp
@@ -0,0 +1,172 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Device.h"
+
+#include <android-base/file.h>
+#include <android-base/properties.h>
+#include <json/json.h>
+
+#include "ClientFrameComposer.h"
+#include "FrameComposer.h"
+#include "GuestFrameComposer.h"
+#include "HostFrameComposer.h"
+#include "NoOpFrameComposer.h"
+
+ANDROID_SINGLETON_STATIC_INSTANCE(
+    aidl::android::hardware::graphics::composer3::impl::Device);
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+namespace {
+
+bool shouldUseGuestComposer() {
+  return ::android::base::GetProperty("ro.hardware.vulkan", "") == "pastel";
+}
+
+std::string getPmemPath() {
+  return ::android::base::GetProperty("ro.vendor.hwcomposer.pmem", "");
+}
+
+HWC3::Error loadPersistentKeyValues(Json::Value* dictionary) {
+  *dictionary = Json::Value(Json::ValueType::objectValue);
+
+  const std::string path = getPmemPath();
+  if (path.empty()) {
+    ALOGE("%s: persistent key-value store path not available.", __FUNCTION__);
+    return HWC3::Error::NoResources;
+  }
+
+  std::string content;
+  if (!::android::base::ReadFileToString(path, &content)) {
+    ALOGE("%s: failed to read key-value store from %s", __FUNCTION__,
+          path.c_str());
+    return HWC3::Error::NoResources;
+  }
+
+  if (content.empty() || content[0] == '\0') {
+    return HWC3::Error::None;
+  }
+
+  Json::Reader reader;
+  if (!reader.parse(content, *dictionary)) {
+    const std::string error = reader.getFormattedErrorMessages();
+    ALOGE("%s: failed to parse key-value store from %s:%s", __FUNCTION__,
+          path.c_str(), error.c_str());
+    return HWC3::Error::NoResources;
+  }
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error savePersistentKeyValues(const Json::Value& dictionary) {
+  const std::string path = getPmemPath();
+  if (path.empty()) {
+    ALOGE("%s: persistent key-value store path not available.", __FUNCTION__);
+    return HWC3::Error::NoResources;
+  }
+
+  const std::string contents = dictionary.toStyledString();
+  if (!::android::base::WriteStringToFile(contents, path)) {
+    ALOGE("%s: failed to write key-value store to %s", __FUNCTION__,
+          path.c_str());
+    return HWC3::Error::NoResources;
+  }
+
+  return HWC3::Error::None;
+}
+
+}  // namespace
+
+HWC3::Error Device::getComposer(FrameComposer** outComposer) {
+  std::unique_lock<std::mutex> lock(mMutex);
+
+  if (mComposer == nullptr) {
+    if (IsInNoOpCompositionMode()) {
+      DEBUG_LOG("%s: using NoOpFrameComposer", __FUNCTION__);
+      mComposer = std::make_unique<NoOpFrameComposer>();
+    } else if (IsInClientCompositionMode()) {
+      DEBUG_LOG("%s: using ClientFrameComposer", __FUNCTION__);
+      mComposer = std::make_unique<ClientFrameComposer>();
+    } else if (shouldUseGuestComposer()) {
+      DEBUG_LOG("%s: using GuestFrameComposer", __FUNCTION__);
+      mComposer = std::make_unique<GuestFrameComposer>();
+    } else {
+      DEBUG_LOG("%s: using HostFrameComposer", __FUNCTION__);
+      mComposer = std::make_unique<HostFrameComposer>();
+    }
+    if (!mComposer) {
+      ALOGE("%s failed to allocate FrameComposer", __FUNCTION__);
+      return HWC3::Error::NoResources;
+    }
+
+    HWC3::Error error = mComposer->init();
+    if (error != HWC3::Error::None) {
+      ALOGE("%s failed to init FrameComposer", __FUNCTION__);
+      return error;
+    }
+  }
+
+  *outComposer = mComposer.get();
+  return HWC3::Error::None;
+}
+
+HWC3::Error Device::getPersistentKeyValue(const std::string& key,
+                                          const std::string& defaultValue,
+                                          std::string* outValue) {
+  std::unique_lock<std::mutex> lock(mMutex);
+
+  Json::Value dictionary;
+
+  HWC3::Error error = loadPersistentKeyValues(&dictionary);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: failed to load pmem json", __FUNCTION__);
+    return error;
+  }
+
+  if (!dictionary.isMember(key)) {
+    *outValue = defaultValue;
+    return HWC3::Error::None;
+  }
+
+  *outValue = defaultValue;
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error Device::setPersistentKeyValue(const std::string& key,
+                                          const std::string& value) {
+  std::unique_lock<std::mutex> lock(mMutex);
+
+  Json::Value dictionary;
+
+  HWC3::Error error = loadPersistentKeyValues(&dictionary);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: failed to load pmem json", __FUNCTION__);
+    return error;
+  }
+
+  dictionary[key] = value;
+
+  error = savePersistentKeyValues(dictionary);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: failed to save pmem json", __FUNCTION__);
+    return error;
+  }
+
+  return HWC3::Error::None;
+}
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/Device.h b/system/hwc3/Device.h
new file mode 100644
index 0000000..6a3d064
--- /dev/null
+++ b/system/hwc3/Device.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_HWC_DEVICE_H
+#define ANDROID_HWC_DEVICE_H
+
+#include <utils/Singleton.h>
+
+#include <memory>
+#include <thread>
+
+#include "Common.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+class FrameComposer;
+
+// Provides resources that are stable for the duration of the virtual
+// device.
+class Device : public ::android::Singleton<Device> {
+ public:
+  virtual ~Device() = default;
+
+  HWC3::Error getComposer(FrameComposer** outComposer);
+
+  HWC3::Error getPersistentKeyValue(const std::string& key,
+                                    const std::string& defaultVal,
+                                    std::string* outValue);
+
+  HWC3::Error setPersistentKeyValue(const std::string& key,
+                                    const std::string& outValue);
+
+ private:
+  friend class Singleton<Device>;
+  Device() = default;
+
+  std::mutex mMutex;
+  std::unique_ptr<FrameComposer> mComposer;
+};
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
+
+#endif
\ No newline at end of file
diff --git a/system/hwc3/Display.cpp b/system/hwc3/Display.cpp
new file mode 100644
index 0000000..40f0382
--- /dev/null
+++ b/system/hwc3/Display.cpp
@@ -0,0 +1,1052 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Display.h"
+
+#include <android-base/parseint.h>
+#include <android-base/unique_fd.h>
+#include <pthread.h>
+#include <sched.h>
+#include <sync/sync.h>
+#include <sys/types.h>
+
+#include <algorithm>
+#include <atomic>
+#include <numeric>
+#include <sstream>
+#include <thread>
+
+#include "Common.h"
+#include "Device.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+namespace {
+
+bool isValidColorMode(ColorMode mode) {
+  switch (mode) {
+    case ColorMode::NATIVE:
+    case ColorMode::STANDARD_BT601_625:
+    case ColorMode::STANDARD_BT601_625_UNADJUSTED:
+    case ColorMode::STANDARD_BT601_525:
+    case ColorMode::STANDARD_BT601_525_UNADJUSTED:
+    case ColorMode::STANDARD_BT709:
+    case ColorMode::DCI_P3:
+    case ColorMode::SRGB:
+    case ColorMode::ADOBE_RGB:
+    case ColorMode::DISPLAY_P3:
+    case ColorMode::BT2020:
+    case ColorMode::BT2100_PQ:
+    case ColorMode::BT2100_HLG:
+    case ColorMode::DISPLAY_BT2020:
+      return true;
+    default:
+      return false;
+  }
+}
+
+bool isValidRenderIntent(RenderIntent intent) {
+  switch (intent) {
+    case RenderIntent::COLORIMETRIC:
+    case RenderIntent::ENHANCE:
+    case RenderIntent::TONE_MAP_COLORIMETRIC:
+    case RenderIntent::TONE_MAP_ENHANCE:
+      return true;
+    default:
+      return false;
+  }
+}
+
+bool isValidPowerMode(PowerMode mode) {
+  switch (mode) {
+    case PowerMode::OFF:
+    case PowerMode::DOZE:
+    case PowerMode::DOZE_SUSPEND:
+    case PowerMode::ON:
+    case PowerMode::ON_SUSPEND:
+      return true;
+    default:
+      return false;
+  }
+}
+
+}  // namespace
+
+Display::Display(FrameComposer* composer, int64_t id)
+    : mComposer(composer), mId(id), mVsyncThread(id) {
+  setLegacyEdid();
+}
+
+Display::~Display() {}
+
+HWC3::Error Display::init(const std::vector<DisplayConfig>& configs,
+                          int32_t activeConfigId,
+                          const std::optional<std::vector<uint8_t>>& edid) {
+  std::unique_lock<std::recursive_mutex> lock(mStateMutex);
+
+  for (const DisplayConfig& config : configs) {
+    mConfigs.emplace(config.getId(), config);
+  }
+
+  mActiveConfigId = activeConfigId;
+
+  auto bootConfigIdOpt = getBootConfigId();
+  if (bootConfigIdOpt) {
+    mActiveConfigId = *bootConfigIdOpt;
+  }
+
+  if (edid.has_value()) {
+    mEdid = *edid;
+  }
+
+  auto it = mConfigs.find(activeConfigId);
+  if (it == mConfigs.end()) {
+    ALOGE("%s: display:%" PRId64 "missing config:%" PRId32, __FUNCTION__, mId,
+          activeConfigId);
+    return HWC3::Error::NoResources;
+  }
+
+  const auto& activeConfig = it->second;
+  const auto activeConfigString = activeConfig.toString();
+  ALOGD("%s display:%" PRId64 " with config:%s", __FUNCTION__, mId,
+        activeConfigString.c_str());
+
+  mVsyncThread.start(activeConfig.getVsyncPeriod());
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error Display::updateParameters(
+    uint32_t width, uint32_t height, uint32_t dpiX, uint32_t dpiY,
+    uint32_t refreshRateHz, const std::optional<std::vector<uint8_t>>& edid) {
+  DEBUG_LOG("%s: updating display:%" PRId64
+            " width:%d height:%d dpiX:%d dpiY:%d refreshRateHz:%d",
+            __FUNCTION__, mId, width, height, dpiX, dpiY, refreshRateHz);
+
+  std::unique_lock<std::recursive_mutex> lock(mStateMutex);
+
+  auto it = mConfigs.find(*mActiveConfigId);
+  if (it == mConfigs.end()) {
+    ALOGE("%s: failed to find config %" PRId32, __func__, *mActiveConfigId);
+    return HWC3::Error::NoResources;
+  }
+  it->second.setAttribute(DisplayAttribute::VSYNC_PERIOD,
+                          1000 * 1000 * 1000 / refreshRateHz);
+  it->second.setAttribute(DisplayAttribute::WIDTH, width);
+  it->second.setAttribute(DisplayAttribute::HEIGHT, height);
+  it->second.setAttribute(DisplayAttribute::DPI_X, dpiX);
+  it->second.setAttribute(DisplayAttribute::DPI_Y, dpiY);
+
+  if (edid.has_value()) {
+    mEdid = *edid;
+  }
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error Display::createLayer(int64_t* outLayerId) {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  std::unique_lock<std::recursive_mutex> lock(mStateMutex);
+
+  auto layer = std::make_unique<Layer>();
+
+  const int64_t layerId = layer->getId();
+  DEBUG_LOG("%s: created layer:%" PRId64, __FUNCTION__, layerId);
+
+  mLayers.emplace(layerId, std::move(layer));
+
+  *outLayerId = layerId;
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error Display::destroyLayer(int64_t layerId) {
+  DEBUG_LOG("%s: destroy layer:%" PRId64, __FUNCTION__, layerId);
+
+  std::unique_lock<std::recursive_mutex> lock(mStateMutex);
+
+  auto it = mLayers.find(layerId);
+  if (it == mLayers.end()) {
+    ALOGE("%s display:%" PRId64 " has no such layer:%." PRId64, __FUNCTION__,
+          mId, layerId);
+    return HWC3::Error::BadLayer;
+  }
+
+  mOrderedLayers.erase(std::remove_if(mOrderedLayers.begin(),  //
+                                      mOrderedLayers.end(),    //
+                                      [layerId](Layer* layer) {
+                                        return layer->getId() == layerId;
+                                      }),
+                       mOrderedLayers.end());
+
+  mLayers.erase(it);
+
+  DEBUG_LOG("%s: destroyed layer:%" PRId64, __FUNCTION__, layerId);
+  return HWC3::Error::None;
+}
+
+HWC3::Error Display::getActiveConfig(int32_t* outConfig) {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  std::unique_lock<std::recursive_mutex> lock(mStateMutex);
+
+  if (!mActiveConfigId) {
+    ALOGW("%s: display:%" PRId64 " has no active config.", __FUNCTION__, mId);
+    return HWC3::Error::BadConfig;
+  }
+
+  *outConfig = *mActiveConfigId;
+  return HWC3::Error::None;
+}
+
+HWC3::Error Display::getDisplayAttribute(int32_t configId,
+                                         DisplayAttribute attribute,
+                                         int32_t* outValue) {
+  auto attributeString = toString(attribute);
+  DEBUG_LOG("%s: display:%" PRId64 " attribute:%s", __FUNCTION__, mId,
+            attributeString.c_str());
+
+  std::unique_lock<std::recursive_mutex> lock(mStateMutex);
+
+  auto it = mConfigs.find(configId);
+  if (it == mConfigs.end()) {
+    ALOGW("%s: display:%" PRId64 " bad config:%" PRId32, __FUNCTION__, mId,
+          configId);
+    return HWC3::Error::BadConfig;
+  }
+
+  const DisplayConfig& config = it->second;
+  *outValue = config.getAttribute(attribute);
+  DEBUG_LOG("%s: display:%" PRId64 " attribute:%s value is %" PRIi32,
+            __FUNCTION__, mId, attributeString.c_str(), *outValue);
+  return HWC3::Error::None;
+}
+
+HWC3::Error Display::getColorModes(std::vector<ColorMode>* outModes) {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  std::unique_lock<std::recursive_mutex> lock(mStateMutex);
+
+  outModes->clear();
+  outModes->insert(outModes->end(), mColorModes.begin(), mColorModes.end());
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error Display::getDisplayCapabilities(
+    std::vector<DisplayCapability>* outCapabilities) {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  outCapabilities->clear();
+  outCapabilities->push_back(DisplayCapability::SKIP_CLIENT_COLOR_TRANSFORM);
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error Display::getDisplayConfigs(std::vector<int32_t>* outConfigIds) {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  std::unique_lock<std::recursive_mutex> lock(mStateMutex);
+
+  outConfigIds->clear();
+  outConfigIds->reserve(mConfigs.size());
+  for (const auto& [configId, _] : mConfigs) {
+    outConfigIds->push_back(configId);
+  }
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error Display::getDisplayConnectionType(DisplayConnectionType* outType) {
+  if (IsCuttlefishFoldable() || IsAutoDevice()) {
+    // Android Auto OS needs to set all displays to INTERNAL since they're used
+    // for the passenger displays.
+    // Workaround to force all displays to INTERNAL for cf_x86_64_foldable.
+    // TODO(b/193568008): Allow configuring internal/external per display.
+    *outType = DisplayConnectionType::INTERNAL;
+  } else {
+    // Other devices default to the first display INTERNAL, others EXTERNAL.
+    *outType = mId == 0 ? DisplayConnectionType::INTERNAL
+                        : DisplayConnectionType::EXTERNAL;
+  }
+  return HWC3::Error::None;
+}
+
+HWC3::Error Display::getDisplayIdentificationData(
+    DisplayIdentification* outIdentification) {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  if (outIdentification == nullptr) {
+    return HWC3::Error::BadParameter;
+  }
+
+  outIdentification->port = mId;
+  outIdentification->data = mEdid;
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error Display::getDisplayName(std::string* outName) {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  std::unique_lock<std::recursive_mutex> lock(mStateMutex);
+
+  *outName = mName;
+  return HWC3::Error::None;
+}
+
+HWC3::Error Display::getDisplayVsyncPeriod(int32_t* outVsyncPeriod) {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  std::unique_lock<std::recursive_mutex> lock(mStateMutex);
+
+  if (!mActiveConfigId) {
+    ALOGE("%s : display:%" PRId64 " no active config", __FUNCTION__, mId);
+    return HWC3::Error::BadConfig;
+  }
+
+  const auto it = mConfigs.find(*mActiveConfigId);
+  if (it == mConfigs.end()) {
+    ALOGE("%s : display:%" PRId64 " failed to find active config:%" PRId32,
+          __FUNCTION__, mId, *mActiveConfigId);
+    return HWC3::Error::BadConfig;
+  }
+  const DisplayConfig& activeConfig = it->second;
+
+  *outVsyncPeriod = activeConfig.getAttribute(DisplayAttribute::VSYNC_PERIOD);
+  return HWC3::Error::None;
+}
+
+HWC3::Error Display::getDisplayedContentSample(
+    int64_t /*maxFrames*/, int64_t /*timestamp*/,
+    DisplayContentSample* /*samples*/) {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  return HWC3::Error::Unsupported;
+}
+
+HWC3::Error Display::getDisplayedContentSamplingAttributes(
+    DisplayContentSamplingAttributes* /*outAttributes*/) {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  return HWC3::Error::Unsupported;
+}
+
+HWC3::Error Display::getDisplayPhysicalOrientation(
+    common::Transform* outOrientation) {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  *outOrientation = common::Transform::NONE;
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error Display::getHdrCapabilities(HdrCapabilities* outCapabilities) {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  // No supported types.
+  outCapabilities->types.clear();
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error Display::getPerFrameMetadataKeys(
+    std::vector<PerFrameMetadataKey>* outKeys) {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  outKeys->clear();
+
+  return HWC3::Error::Unsupported;
+}
+
+HWC3::Error Display::getReadbackBufferAttributes(
+    ReadbackBufferAttributes* outAttributes) {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  outAttributes->format = common::PixelFormat::RGBA_8888;
+  outAttributes->dataspace = common::Dataspace::UNKNOWN;
+
+  return HWC3::Error::Unsupported;
+}
+
+HWC3::Error Display::getReadbackBufferFence(
+    ndk::ScopedFileDescriptor* /*outAcquireFence*/) {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  return HWC3::Error::Unsupported;
+}
+
+HWC3::Error Display::getRenderIntents(ColorMode mode,
+                                      std::vector<RenderIntent>* outIntents) {
+  const auto modeString = toString(mode);
+  DEBUG_LOG("%s: display:%" PRId64 "for mode:%s", __FUNCTION__, mId,
+            modeString.c_str());
+
+  outIntents->clear();
+
+  if (!isValidColorMode(mode)) {
+    DEBUG_LOG("%s: display:%" PRId64 "invalid mode:%s", __FUNCTION__, mId,
+              modeString.c_str());
+    return HWC3::Error::BadParameter;
+  }
+
+  outIntents->push_back(RenderIntent::COLORIMETRIC);
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error Display::getSupportedContentTypes(
+    std::vector<ContentType>* outTypes) {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  outTypes->clear();
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error Display::getDecorationSupport(
+    std::optional<common::DisplayDecorationSupport>* outSupport) {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  outSupport->reset();
+
+  return HWC3::Error::Unsupported;
+}
+
+HWC3::Error Display::registerCallback(
+    const std::shared_ptr<IComposerCallback>& callback) {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  mVsyncThread.setCallbacks(callback);
+
+  return HWC3::Error::Unsupported;
+}
+
+HWC3::Error Display::setActiveConfig(int32_t configId) {
+  DEBUG_LOG("%s: display:%" PRId64 " setting active config to %" PRId32,
+            __FUNCTION__, mId, configId);
+
+  VsyncPeriodChangeConstraints constraints;
+  constraints.desiredTimeNanos = 0;
+  constraints.seamlessRequired = false;
+
+  VsyncPeriodChangeTimeline timeline;
+
+  return setActiveConfigWithConstraints(configId, constraints, &timeline);
+}
+
+HWC3::Error Display::setActiveConfigWithConstraints(
+    int32_t configId, const VsyncPeriodChangeConstraints& constraints,
+    VsyncPeriodChangeTimeline* outTimeline) {
+  DEBUG_LOG("%s: display:%" PRId64 " config:%" PRId32, __FUNCTION__, mId,
+            configId);
+
+  if (outTimeline == nullptr) {
+    return HWC3::Error::BadParameter;
+  }
+
+  std::unique_lock<std::recursive_mutex> lock(mStateMutex);
+
+  if (mActiveConfigId == configId) {
+    return HWC3::Error::None;
+  }
+
+  DisplayConfig* newConfig = getConfig(configId);
+  if (newConfig == nullptr) {
+    ALOGE("%s: display:%" PRId64 " bad config:%" PRId32, __FUNCTION__, mId,
+          configId);
+    return HWC3::Error::BadConfig;
+  }
+
+  if (constraints.seamlessRequired) {
+    if (mActiveConfigId) {
+      DisplayConfig* oldConfig = getConfig(*mActiveConfigId);
+      if (oldConfig == nullptr) {
+        ALOGE("%s: display:%" PRId64 " missing config:%" PRId32, __FUNCTION__,
+              mId, *mActiveConfigId);
+        return HWC3::Error::NoResources;
+      }
+
+      const int32_t newConfigGroup = newConfig->getConfigGroup();
+      const int32_t oldConfigGroup = oldConfig->getConfigGroup();
+      if (newConfigGroup != oldConfigGroup) {
+        DEBUG_LOG("%s: display:%" PRId64 " config:%" PRId32
+                  " seamless not supported between different config groups "
+                  "old:%d vs new:%d",
+                  __FUNCTION__, mId, configId, oldConfigGroup, newConfigGroup);
+        return HWC3::Error::SeamlessNotAllowed;
+      }
+    }
+  }
+
+  mActiveConfigId = configId;
+
+  if (mComposer == nullptr) {
+    ALOGE("%s: display:%" PRId64 " missing composer", __FUNCTION__, mId);
+    return HWC3::Error::NoResources;
+  }
+
+  HWC3::Error error = mComposer->onActiveConfigChange(this);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: display:%" PRId64 " composer failed to handle config change",
+          __FUNCTION__, mId);
+    return error;
+  }
+
+  int32_t vsyncPeriod;
+  error = getDisplayVsyncPeriod(&vsyncPeriod);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: display:%" PRId64 " composer failed to handle config change",
+          __FUNCTION__, mId);
+    return error;
+  }
+
+  return mVsyncThread.scheduleVsyncUpdate(vsyncPeriod, constraints,
+                                          outTimeline);
+}
+
+std::optional<int32_t> Display::getBootConfigId() {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  std::unique_lock<std::recursive_mutex> lock(mStateMutex);
+
+  std::string val;
+  HWC3::Error error = Device::getInstance().getPersistentKeyValue(
+      std::to_string(mId), "", &val);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: display:%" PRId64 " failed to get persistent boot config",
+          __FUNCTION__, mId);
+    return std::nullopt;
+  }
+
+  if (val.empty()) {
+    return std::nullopt;
+  }
+
+  int32_t configId = 0;
+  if (!::android::base::ParseInt(val, &configId)) {
+    ALOGE("%s: display:%" PRId64
+          " failed to parse persistent boot config from: %s",
+          __FUNCTION__, mId, val.c_str());
+    return std::nullopt;
+  }
+
+  if (!hasConfig(configId)) {
+    ALOGE("%s: display:%" PRId64 " invalid persistent boot config:%" PRId32,
+          __FUNCTION__, mId, configId);
+    return std::nullopt;
+  }
+
+  return configId;
+}
+
+HWC3::Error Display::setBootConfig(int32_t configId) {
+  DEBUG_LOG("%s: display:%" PRId64 " config:%" PRId32, __FUNCTION__, mId,
+            configId);
+
+  std::unique_lock<std::recursive_mutex> lock(mStateMutex);
+
+  DisplayConfig* newConfig = getConfig(configId);
+  if (newConfig == nullptr) {
+    ALOGE("%s: display:%" PRId64 " bad config:%" PRId32, __FUNCTION__, mId,
+          configId);
+    return HWC3::Error::BadConfig;
+  }
+
+  const std::string key = std::to_string(mId);
+  const std::string val = std::to_string(configId);
+  HWC3::Error error = Device::getInstance().setPersistentKeyValue(key, val);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: display:%" PRId64 " failed to save persistent boot config",
+          __FUNCTION__, mId);
+    return error;
+  }
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error Display::clearBootConfig() {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  std::unique_lock<std::recursive_mutex> lock(mStateMutex);
+
+  const std::string key = std::to_string(mId);
+  const std::string val = "";
+  HWC3::Error error = Device::getInstance().setPersistentKeyValue(key, val);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: display:%" PRId64 " failed to save persistent boot config",
+          __FUNCTION__, mId);
+    return error;
+  }
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error Display::getPreferredBootConfig(int32_t* outConfigId) {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  std::unique_lock<std::recursive_mutex> lock(mStateMutex);
+
+  std::vector<int32_t> configIds;
+  for (const auto [configId, _] : mConfigs) {
+    configIds.push_back(configId);
+  }
+  *outConfigId = *std::min_element(configIds.begin(), configIds.end());
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error Display::setAutoLowLatencyMode(bool /*on*/) {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  return HWC3::Error::Unsupported;
+}
+
+HWC3::Error Display::setColorMode(ColorMode mode, RenderIntent intent) {
+  const std::string modeString = toString(mode);
+  const std::string intentString = toString(intent);
+  DEBUG_LOG("%s: display:%" PRId64 " setting color mode:%s intent:%s",
+            __FUNCTION__, mId, modeString.c_str(), intentString.c_str());
+
+  if (!isValidColorMode(mode)) {
+    ALOGE("%s: display:%" PRId64 " invalid color mode:%s", __FUNCTION__, mId,
+          modeString.c_str());
+    return HWC3::Error::BadParameter;
+  }
+
+  if (!isValidRenderIntent(intent)) {
+    ALOGE("%s: display:%" PRId64 " invalid intent:%s", __FUNCTION__, mId,
+          intentString.c_str());
+    return HWC3::Error::BadParameter;
+  }
+
+  std::unique_lock<std::recursive_mutex> lock(mStateMutex);
+
+  if (mColorModes.count(mode) == 0) {
+    ALOGE("%s: display %" PRId64 " mode %s not supported", __FUNCTION__, mId,
+          modeString.c_str());
+    return HWC3::Error::Unsupported;
+  }
+
+  mActiveColorMode = mode;
+  return HWC3::Error::None;
+}
+
+HWC3::Error Display::setContentType(ContentType contentType) {
+  auto contentTypeString = toString(contentType);
+  DEBUG_LOG("%s: display:%" PRId64 " content type:%s", __FUNCTION__, mId,
+            contentTypeString.c_str());
+
+  if (contentType != ContentType::NONE) {
+    return HWC3::Error::Unsupported;
+  }
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error Display::setDisplayedContentSamplingEnabled(
+    bool /*enable*/, FormatColorComponent /*componentMask*/,
+    int64_t /*maxFrames*/) {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  return HWC3::Error::Unsupported;
+}
+
+HWC3::Error Display::setPowerMode(PowerMode mode) {
+  auto modeString = toString(mode);
+  DEBUG_LOG("%s: display:%" PRId64 " to mode:%s", __FUNCTION__, mId,
+            modeString.c_str());
+
+  if (!isValidPowerMode(mode)) {
+    ALOGE("%s: display:%" PRId64 " invalid mode:%s", __FUNCTION__, mId,
+          modeString.c_str());
+    return HWC3::Error::BadParameter;
+  }
+
+  if (mode == PowerMode::DOZE || mode == PowerMode::DOZE_SUSPEND ||
+      mode == PowerMode::ON_SUSPEND) {
+    ALOGE("%s display %" PRId64 " mode:%s not supported", __FUNCTION__, mId,
+          modeString.c_str());
+    return HWC3::Error::Unsupported;
+  }
+
+  std::unique_lock<std::recursive_mutex> lock(mStateMutex);
+
+  if (IsCuttlefish()) {
+    if (int fd = open("/dev/kmsg", O_WRONLY | O_CLOEXEC); fd != -1) {
+      std::ostringstream stream;
+      stream << "VIRTUAL_DEVICE_DISPLAY_POWER_MODE_CHANGED display=" << mId
+             << " mode=" << modeString;
+      std::string message = stream.str();
+      write(fd, message.c_str(), message.length());
+      close(fd);
+    }
+  }
+
+  mPowerMode = mode;
+  return HWC3::Error::None;
+}
+
+HWC3::Error Display::setReadbackBuffer(const buffer_handle_t buffer,
+                                       const ndk::ScopedFileDescriptor& fence) {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  mReadbackBuffer.set(buffer, fence);
+
+  return HWC3::Error::Unsupported;
+}
+
+HWC3::Error Display::setVsyncEnabled(bool enabled) {
+  DEBUG_LOG("%s: display:%" PRId64 " setting vsync %s", __FUNCTION__, mId,
+            (enabled ? "on" : "off"));
+
+  std::unique_lock<std::recursive_mutex> lock(mStateMutex);
+
+  return mVsyncThread.setVsyncEnabled(enabled);
+}
+
+HWC3::Error Display::setIdleTimerEnabled(int32_t timeoutMs) {
+  DEBUG_LOG("%s: display:%" PRId64 " timeout:%" PRId32, __FUNCTION__, mId,
+            timeoutMs);
+
+  (void)timeoutMs;
+
+  return HWC3::Error::Unsupported;
+}
+
+HWC3::Error Display::setColorTransform(
+    const std::vector<float>& transformMatrix) {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  if (transformMatrix.size() < 16) {
+    ALOGE("%s: display:%" PRId64 " has non 4x4 matrix, size:%zu", __FUNCTION__,
+          mId, transformMatrix.size());
+    return HWC3::Error::BadParameter;
+  }
+
+  std::unique_lock<std::recursive_mutex> lock(mStateMutex);
+
+  auto& colorTransform = mColorTransform.emplace();
+  std::copy_n(transformMatrix.data(), colorTransform.size(),
+              colorTransform.begin());
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error Display::setBrightness(float brightness) {
+  DEBUG_LOG("%s: display:%" PRId64 " brightness:%f", __FUNCTION__, mId,
+            brightness);
+
+  if (brightness < 0.0f) {
+    ALOGE("%s: display:%" PRId64 " invalid brightness:%f", __FUNCTION__, mId,
+          brightness);
+    return HWC3::Error::BadParameter;
+  }
+
+  return HWC3::Error::Unsupported;
+}
+
+HWC3::Error Display::setClientTarget(
+    buffer_handle_t buffer, const ndk::ScopedFileDescriptor& fence,
+    common::Dataspace /*dataspace*/,
+    const std::vector<common::Rect>& /*damage*/) {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  std::unique_lock<std::recursive_mutex> lock(mStateMutex);
+
+  mClientTarget.set(buffer, fence);
+
+  mComposer->onDisplayClientTargetSet(this);
+  return HWC3::Error::None;
+}
+
+HWC3::Error Display::setOutputBuffer(
+    buffer_handle_t /*buffer*/, const ndk::ScopedFileDescriptor& /*fence*/) {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  // TODO: for virtual display
+  return HWC3::Error::None;
+}
+
+HWC3::Error Display::setExpectedPresentTime(
+    const std::optional<ClockMonotonicTimestamp>& expectedPresentTime) {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  if (!expectedPresentTime.has_value()) {
+    return HWC3::Error::None;
+  }
+
+  std::unique_lock<std::recursive_mutex> lock(mStateMutex);
+
+  mExpectedPresentTime.emplace(
+      asTimePoint(expectedPresentTime->timestampNanos));
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error Display::validate(DisplayChanges* outChanges) {
+  ATRACE_CALL();
+
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  std::unique_lock<std::recursive_mutex> lock(mStateMutex);
+
+  mPendingChanges.reset();
+
+  mOrderedLayers.clear();
+  mOrderedLayers.reserve(mLayers.size());
+  for (auto& [_, layerPtr] : mLayers) {
+    mOrderedLayers.push_back(layerPtr.get());
+  }
+  std::sort(mOrderedLayers.begin(), mOrderedLayers.end(),
+            [](const Layer* layerA, const Layer* layerB) {
+              const auto zA = layerA->getZOrder();
+              const auto zB = layerB->getZOrder();
+              if (zA != zB) {
+                return zA < zB;
+              }
+              return layerA->getId() < layerB->getId();
+            });
+
+  if (mComposer == nullptr) {
+    ALOGE("%s: display:%" PRId64 " missing composer", __FUNCTION__, mId);
+    return HWC3::Error::NoResources;
+  }
+
+  HWC3::Error error = mComposer->validateDisplay(this, &mPendingChanges);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: display:%" PRId64 " failed to validate", __FUNCTION__, mId);
+    return error;
+  }
+
+  if (mPendingChanges.hasAnyChanges()) {
+    mPresentFlowState = PresentFlowState::WAITING_FOR_ACCEPT;
+    DEBUG_LOG("%s: display:%" PRId64 " now WAITING_FOR_ACCEPT", __FUNCTION__,
+              mId);
+  } else {
+    mPresentFlowState = PresentFlowState::WAITING_FOR_PRESENT;
+    DEBUG_LOG("%s: display:%" PRId64 " now WAITING_FOR_PRESENT", __FUNCTION__,
+              mId);
+  }
+
+  *outChanges = mPendingChanges;
+  return HWC3::Error::None;
+}
+
+HWC3::Error Display::acceptChanges() {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  std::unique_lock<std::recursive_mutex> lock(mStateMutex);
+
+  switch (mPresentFlowState) {
+    case PresentFlowState::WAITING_FOR_VALIDATE: {
+      ALOGE("%s: display %" PRId64 " failed, not validated", __FUNCTION__, mId);
+      return HWC3::Error::NotValidated;
+    }
+    case PresentFlowState::WAITING_FOR_ACCEPT:
+    case PresentFlowState::WAITING_FOR_PRESENT: {
+      break;
+    }
+  }
+
+  if (mPendingChanges.compositionChanges) {
+    const ChangedCompositionTypes& compositionChanges =
+        *mPendingChanges.compositionChanges;
+    for (const ChangedCompositionLayer& compositionChange :
+         compositionChanges.layers) {
+      const auto layerId = compositionChange.layer;
+      const auto layerComposition = compositionChange.composition;
+      auto* layer = getLayer(layerId);
+      if (layer == nullptr) {
+        ALOGE("%s: display:%" PRId64 " layer:%" PRId64
+              " dropped before acceptChanges()?",
+              __FUNCTION__, mId, layerId);
+        continue;
+      }
+
+      layer->setCompositionType(layerComposition);
+    }
+  }
+  mPendingChanges.reset();
+
+  mPresentFlowState = PresentFlowState::WAITING_FOR_PRESENT;
+  DEBUG_LOG("%s: display:%" PRId64 " now WAITING_FOR_PRESENT", __FUNCTION__,
+            mId);
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error Display::present(
+    ::android::base::unique_fd* outDisplayFence,
+    std::unordered_map<int64_t, ::android::base::unique_fd>* outLayerFences) {
+  ATRACE_CALL();
+
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  outDisplayFence->reset();
+  outLayerFences->clear();
+
+  std::unique_lock<std::recursive_mutex> lock(mStateMutex);
+
+  switch (mPresentFlowState) {
+    case PresentFlowState::WAITING_FOR_VALIDATE: {
+      ALOGE("%s: display %" PRId64 " failed, not validated", __FUNCTION__, mId);
+      return HWC3::Error::NotValidated;
+    }
+    case PresentFlowState::WAITING_FOR_ACCEPT: {
+      ALOGE("%s: display %" PRId64 " failed, changes not accepted",
+            __FUNCTION__, mId);
+      return HWC3::Error::NotValidated;
+    }
+    case PresentFlowState::WAITING_FOR_PRESENT: {
+      break;
+    }
+  }
+  mPresentFlowState = PresentFlowState::WAITING_FOR_VALIDATE;
+  DEBUG_LOG("%s: display:%" PRId64 " now WAITING_FOR_VALIDATE", __FUNCTION__,
+            mId);
+
+  if (mComposer == nullptr) {
+    ALOGE("%s: display:%" PRId64 " missing composer", __FUNCTION__, mId);
+    return HWC3::Error::NoResources;
+  }
+
+  return mComposer->presentDisplay(this, outDisplayFence, outLayerFences);
+}
+
+bool Display::hasConfig(int32_t configId) const {
+  return mConfigs.find(configId) != mConfigs.end();
+}
+
+DisplayConfig* Display::getConfig(int32_t configId) {
+  auto it = mConfigs.find(configId);
+  if (it != mConfigs.end()) {
+    return &it->second;
+  }
+  return nullptr;
+}
+
+HWC3::Error Display::setEdid(std::vector<uint8_t> edid) {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  mEdid = edid;
+  return HWC3::Error::None;
+}
+
+void Display::setLegacyEdid() {
+  // thess EDIDs are carefully generated according to the EDID spec version 1.3,
+  // more info can be found from the following file:
+  //   frameworks/native/services/surfaceflinger/DisplayHardware/DisplayIdentification.cpp
+  // approved pnp ids can be found here: https://uefi.org/pnp_id_list
+  // pnp id: GGL, name: EMU_display_0, last byte is checksum
+  // display id is local:8141603649153536
+  static constexpr const std::array<uint8_t, 128> kEdid0 = {
+      0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x1c, 0xec, 0x01, 0x00,
+      0x01, 0x00, 0x00, 0x00, 0x1b, 0x10, 0x01, 0x03, 0x80, 0x50, 0x2d, 0x78,
+      0x0a, 0x0d, 0xc9, 0xa0, 0x57, 0x47, 0x98, 0x27, 0x12, 0x48, 0x4c, 0x00,
+      0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+      0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x3a, 0x80, 0x18, 0x71, 0x38,
+      0x2d, 0x40, 0x58, 0x2c, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+      0x00, 0x00, 0x00, 0xfc, 0x00, 0x45, 0x4d, 0x55, 0x5f, 0x64, 0x69, 0x73,
+      0x70, 0x6c, 0x61, 0x79, 0x5f, 0x30, 0x00, 0x4b};
+
+  // pnp id: GGL, name: EMU_display_1
+  // display id is local:8140900251843329
+  static constexpr const std::array<uint8_t, 128> kEdid1 = {
+      0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x1c, 0xec, 0x01, 0x00,
+      0x01, 0x00, 0x00, 0x00, 0x1b, 0x10, 0x01, 0x03, 0x80, 0x50, 0x2d, 0x78,
+      0x0a, 0x0d, 0xc9, 0xa0, 0x57, 0x47, 0x98, 0x27, 0x12, 0x48, 0x4c, 0x00,
+      0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+      0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x3a, 0x80, 0x18, 0x71, 0x38,
+      0x2d, 0x40, 0x58, 0x2c, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+      0x00, 0x00, 0x00, 0xfc, 0x00, 0x45, 0x4d, 0x55, 0x5f, 0x64, 0x69, 0x73,
+      0x70, 0x6c, 0x61, 0x79, 0x5f, 0x31, 0x00, 0x3b};
+
+  // pnp id: GGL, name: EMU_display_2
+  // display id is local:8140940453066754
+  static constexpr const std::array<uint8_t, 128> kEdid2 = {
+      0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x1c, 0xec, 0x01, 0x00,
+      0x01, 0x00, 0x00, 0x00, 0x1b, 0x10, 0x01, 0x03, 0x80, 0x50, 0x2d, 0x78,
+      0x0a, 0x0d, 0xc9, 0xa0, 0x57, 0x47, 0x98, 0x27, 0x12, 0x48, 0x4c, 0x00,
+      0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+      0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x3a, 0x80, 0x18, 0x71, 0x38,
+      0x2d, 0x40, 0x58, 0x2c, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+      0x00, 0x00, 0x00, 0xfc, 0x00, 0x45, 0x4d, 0x55, 0x5f, 0x64, 0x69, 0x73,
+      0x70, 0x6c, 0x61, 0x79, 0x5f, 0x32, 0x00, 0x49};
+
+  mEdid.clear();
+  switch (mId) {
+    case 0: {
+      mEdid.insert(mEdid.end(), kEdid0.begin(), kEdid0.end());
+      break;
+    }
+    case 1: {
+      mEdid.insert(mEdid.end(), kEdid1.begin(), kEdid1.end());
+      break;
+    }
+    case 2: {
+      mEdid.insert(mEdid.end(), kEdid2.begin(), kEdid2.end());
+      break;
+    }
+    default: {
+      mEdid.insert(mEdid.end(), kEdid2.begin(), kEdid2.end());
+      const uint32_t size = mEdid.size();
+      // Update the name to EMU_display_<mID>
+      mEdid[size - 3] = '0' + (uint8_t)mId;
+      // Update the checksum byte
+      uint8_t checksum = -(uint8_t)std::accumulate(
+          mEdid.data(), mEdid.data() + size - 1, static_cast<uint8_t>(0));
+      mEdid[size - 1] = checksum;
+      break;
+    }
+  }
+}
+
+Layer* Display::getLayer(int64_t layerId) {
+  auto it = mLayers.find(layerId);
+  if (it == mLayers.end()) {
+    ALOGE("%s Unknown layer:%" PRId64, __FUNCTION__, layerId);
+    return nullptr;
+  }
+
+  return it->second.get();
+}
+
+buffer_handle_t Display::waitAndGetClientTargetBuffer() {
+  DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+  ::android::base::unique_fd fence = mClientTarget.getFence();
+  if (fence.ok()) {
+    int err = sync_wait(fence.get(), 3000);
+    if (err < 0 && errno == ETIME) {
+      ALOGE("%s waited on fence %" PRId32 " for 3000 ms", __FUNCTION__,
+            fence.get());
+    }
+  }
+
+  return mClientTarget.getBuffer();
+}
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/Display.h b/system/hwc3/Display.h
new file mode 100644
index 0000000..707bc19
--- /dev/null
+++ b/system/hwc3/Display.h
@@ -0,0 +1,202 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_HWC_DISPLAY_H
+#define ANDROID_HWC_DISPLAY_H
+
+#include <aidl/android/hardware/graphics/common/DisplayDecorationSupport.h>
+#include <aidl/android/hardware/graphics/composer3/ColorMode.h>
+#include <aidl/android/hardware/graphics/composer3/ContentType.h>
+#include <aidl/android/hardware/graphics/composer3/DisplayAttribute.h>
+#include <aidl/android/hardware/graphics/composer3/DisplayCapability.h>
+#include <aidl/android/hardware/graphics/composer3/DisplayConnectionType.h>
+#include <aidl/android/hardware/graphics/composer3/DisplayContentSample.h>
+#include <aidl/android/hardware/graphics/composer3/DisplayIdentification.h>
+#include <aidl/android/hardware/graphics/composer3/HdrCapabilities.h>
+#include <aidl/android/hardware/graphics/composer3/PerFrameMetadataKey.h>
+#include <aidl/android/hardware/graphics/composer3/PowerMode.h>
+#include <aidl/android/hardware/graphics/composer3/ReadbackBufferAttributes.h>
+#include <aidl/android/hardware/graphics/composer3/RenderIntent.h>
+#include <aidl/android/hardware/graphics/composer3/VsyncPeriodChangeConstraints.h>
+#include <aidl/android/hardware/graphics/composer3/VsyncPeriodChangeTimeline.h>
+#include <android-base/unique_fd.h>
+
+#include <array>
+#include <mutex>
+#include <optional>
+#include <thread>
+#include <unordered_map>
+#include <unordered_set>
+#include <vector>
+
+#include "Common.h"
+#include "DisplayChanges.h"
+#include "DisplayConfig.h"
+#include "DisplayFinder.h"
+#include "FencedBuffer.h"
+#include "FrameComposer.h"
+#include "Layer.h"
+#include "Time.h"
+#include "VsyncThread.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+class FrameComposer;
+
+class Display {
+ public:
+  Display(FrameComposer* composer, int64_t id);
+  ~Display();
+
+  Display(const Display& display) = delete;
+  Display& operator=(const Display& display) = delete;
+
+  Display(Display&& display) = delete;
+  Display& operator=(Display&& display) = delete;
+
+  HWC3::Error init(
+      const std::vector<DisplayConfig>& configs, int32_t activeConfigId,
+      const std::optional<std::vector<uint8_t>>& edid = std::nullopt);
+
+  HWC3::Error updateParameters(
+      uint32_t width, uint32_t height, uint32_t dpiX, uint32_t dpiY,
+      uint32_t refreshRateHz,
+      const std::optional<std::vector<uint8_t>>& edid = std::nullopt);
+
+  // HWComposer3 interface.
+  HWC3::Error createLayer(int64_t* outLayerId);
+  HWC3::Error destroyLayer(int64_t layerId);
+  HWC3::Error getActiveConfig(int32_t* outConfigId);
+  HWC3::Error getDisplayAttribute(int32_t configId, DisplayAttribute attribute,
+                                  int32_t* outValue);
+  HWC3::Error getColorModes(std::vector<ColorMode>* outColorModes);
+  HWC3::Error getDisplayCapabilities(std::vector<DisplayCapability>* caps);
+  HWC3::Error getDisplayConfigs(std::vector<int32_t>* configs);
+  HWC3::Error getDisplayConnectionType(DisplayConnectionType* outType);
+  HWC3::Error getDisplayIdentificationData(
+      DisplayIdentification* outIdentification);
+  HWC3::Error getDisplayName(std::string* outName);
+  HWC3::Error getDisplayVsyncPeriod(int32_t* outVsyncPeriod);
+  HWC3::Error getDisplayedContentSample(int64_t maxFrames, int64_t timestamp,
+                                        DisplayContentSample* samples);
+  HWC3::Error getDisplayedContentSamplingAttributes(
+      DisplayContentSamplingAttributes* outAttributes);
+  HWC3::Error getDisplayPhysicalOrientation(common::Transform* outOrientation);
+  HWC3::Error getHdrCapabilities(HdrCapabilities* outCapabilities);
+  HWC3::Error getPerFrameMetadataKeys(
+      std::vector<PerFrameMetadataKey>* outKeys);
+  HWC3::Error getReadbackBufferAttributes(ReadbackBufferAttributes* attrs);
+  HWC3::Error getReadbackBufferFence(ndk::ScopedFileDescriptor* acquireFence);
+  HWC3::Error getRenderIntents(ColorMode mode,
+                               std::vector<RenderIntent>* intents);
+  HWC3::Error getSupportedContentTypes(std::vector<ContentType>* types);
+  HWC3::Error getDecorationSupport(
+      std::optional<common::DisplayDecorationSupport>* support);
+  HWC3::Error registerCallback(
+      const std::shared_ptr<IComposerCallback>& callback);
+  HWC3::Error setActiveConfig(int32_t configId);
+  HWC3::Error setActiveConfigWithConstraints(
+      int32_t config, const VsyncPeriodChangeConstraints& constraints,
+      VsyncPeriodChangeTimeline* outTimeline);
+  HWC3::Error setBootConfig(int32_t configId);
+  HWC3::Error clearBootConfig();
+  HWC3::Error getPreferredBootConfig(int32_t* outConfigId);
+  HWC3::Error setAutoLowLatencyMode(bool on);
+  HWC3::Error setColorMode(ColorMode mode, RenderIntent intent);
+  HWC3::Error setContentType(ContentType contentType);
+  HWC3::Error setDisplayedContentSamplingEnabled(
+      bool enable, FormatColorComponent componentMask, int64_t maxFrames);
+  HWC3::Error setPowerMode(PowerMode mode);
+  HWC3::Error setReadbackBuffer(const buffer_handle_t buffer,
+                                const ndk::ScopedFileDescriptor& releaseFence);
+  HWC3::Error setVsyncEnabled(bool enabled);
+  HWC3::Error setIdleTimerEnabled(int32_t timeoutMs);
+  HWC3::Error setColorTransform(const std::vector<float>& transform);
+  HWC3::Error setBrightness(float brightness);
+  HWC3::Error setClientTarget(buffer_handle_t buffer,
+                              const ndk::ScopedFileDescriptor& fence,
+                              common::Dataspace dataspace,
+                              const std::vector<common::Rect>& damage);
+  HWC3::Error setOutputBuffer(buffer_handle_t buffer,
+                              const ndk::ScopedFileDescriptor& fence);
+  HWC3::Error setExpectedPresentTime(
+      const std::optional<ClockMonotonicTimestamp>& expectedPresentTime);
+  HWC3::Error validate(DisplayChanges* outChanges);
+  HWC3::Error acceptChanges();
+  HWC3::Error present(
+      ::android::base::unique_fd* outDisplayFence,
+      std::unordered_map<int64_t, ::android::base::unique_fd>* outLayerFences);
+
+  // Non HWCComposer3 interface.
+  int64_t getId() const { return mId; }
+
+  Layer* getLayer(int64_t layerHandle);
+
+  HWC3::Error setEdid(std::vector<uint8_t> edid);
+
+  bool hasColorTransform() const { return mColorTransform.has_value(); }
+  std::array<float, 16> getColorTransform() const { return *mColorTransform; }
+
+  FencedBuffer& getClientTarget() { return mClientTarget; }
+  buffer_handle_t waitAndGetClientTargetBuffer();
+
+  const std::vector<Layer*>& getOrderedLayers() { return mOrderedLayers; }
+
+ private:
+  bool hasConfig(int32_t configId) const;
+  DisplayConfig* getConfig(int32_t configId);
+
+  std::optional<int32_t> getBootConfigId();
+
+  void setLegacyEdid();
+
+  // The state of this display should only be modified from
+  // SurfaceFlinger's main loop, with the exception of when dump is
+  // called. To prevent a bad state from crashing us during a dump
+  // call, all public calls into Display must acquire this mutex.
+  mutable std::recursive_mutex mStateMutex;
+
+  FrameComposer* mComposer = nullptr;
+  const int64_t mId;
+  std::string mName;
+  PowerMode mPowerMode = PowerMode::OFF;
+  VsyncThread mVsyncThread;
+  FencedBuffer mClientTarget;
+  FencedBuffer mReadbackBuffer;
+  // Will only be non-null after the Display has been validated and
+  // before it has been accepted.
+  enum class PresentFlowState {
+    WAITING_FOR_VALIDATE,
+    WAITING_FOR_ACCEPT,
+    WAITING_FOR_PRESENT,
+  };
+  PresentFlowState mPresentFlowState = PresentFlowState::WAITING_FOR_VALIDATE;
+  DisplayChanges mPendingChanges;
+  std::optional<TimePoint> mExpectedPresentTime;
+  std::unordered_map<int64_t, std::unique_ptr<Layer>> mLayers;
+  // Ordered layers available after validate().
+  std::vector<Layer*> mOrderedLayers;
+  std::optional<int32_t> mActiveConfigId;
+  std::unordered_map<int32_t, DisplayConfig> mConfigs;
+  std::unordered_set<ColorMode> mColorModes = {ColorMode::NATIVE};
+  ColorMode mActiveColorMode = ColorMode::NATIVE;
+  std::optional<std::array<float, 16>> mColorTransform;
+  std::vector<uint8_t> mEdid;
+};
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
+
+#endif
diff --git a/system/hwc3/DisplayChanges.h b/system/hwc3/DisplayChanges.h
new file mode 100644
index 0000000..2745a4d
--- /dev/null
+++ b/system/hwc3/DisplayChanges.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_HWC_DISPLAYCHANGES_H
+#define ANDROID_HWC_DISPLAYCHANGES_H
+
+#include <aidl/android/hardware/graphics/composer3/ChangedCompositionLayer.h>
+#include <aidl/android/hardware/graphics/composer3/ChangedCompositionTypes.h>
+#include <aidl/android/hardware/graphics/composer3/DisplayRequest.h>
+
+#include <optional>
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+struct DisplayChanges {
+  std::optional<ChangedCompositionTypes> compositionChanges;
+  std::optional<DisplayRequest> displayRequestChanges;
+
+  void addLayerCompositionChange(int64_t displayId, int64_t layerId,
+                                 Composition layerComposition) {
+    if (!compositionChanges) {
+      compositionChanges.emplace();
+      compositionChanges->display = displayId;
+    }
+
+    ChangedCompositionLayer compositionChange;
+    compositionChange.layer = layerId;
+    compositionChange.composition = layerComposition;
+    compositionChanges->layers.emplace_back(std::move(compositionChange));
+  }
+
+  void clearLayerCompositionChanges() { compositionChanges.reset(); }
+
+  bool hasAnyChanges() const {
+    return compositionChanges.has_value() || displayRequestChanges.has_value();
+  }
+
+  void reset() {
+    compositionChanges.reset();
+    displayRequestChanges.reset();
+  }
+};
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
+
+#endif
\ No newline at end of file
diff --git a/system/hwc3/DisplayConfig.cpp b/system/hwc3/DisplayConfig.cpp
new file mode 100644
index 0000000..3605010
--- /dev/null
+++ b/system/hwc3/DisplayConfig.cpp
@@ -0,0 +1,132 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "DisplayConfig.h"
+
+#include <unordered_map>
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+namespace {
+
+template <class T>
+inline void hashCombine(size_t& hash, const T& value) {
+  std::hash<T> hasher;
+  hash ^= hasher(value) + 0x9e3779b9 + (hash << 6) + (hash >> 2);
+}
+
+}  // namespace
+
+void DisplayConfig::setAttribute(DisplayAttribute attribute, int32_t value) {
+  if (attribute == DisplayAttribute::WIDTH) {
+    mWidth = value;
+  }
+  if (attribute == DisplayAttribute::HEIGHT) {
+    mHeight = value;
+  }
+  if (attribute == DisplayAttribute::DPI_X) {
+    mDpiX = value;
+  }
+  if (attribute == DisplayAttribute::DPI_Y) {
+    mDpiY = value;
+  }
+  if (attribute == DisplayAttribute::VSYNC_PERIOD) {
+    mVsyncPeriodNanos = value;
+  }
+  if (attribute == DisplayAttribute::CONFIG_GROUP) {
+    mConfigGroup = value;
+  }
+}
+
+int32_t DisplayConfig::getAttribute(DisplayAttribute attribute) const {
+  if (attribute == DisplayAttribute::WIDTH) {
+    return mWidth;
+  }
+  if (attribute == DisplayAttribute::HEIGHT) {
+    return mHeight;
+  }
+  if (attribute == DisplayAttribute::DPI_X) {
+    // From hwcomposer2.h, HWC2_ATTRIBUTE_DPI_X returns "Dots per thousand
+    // inches (DPI * 1000)".
+    return getDotsPerThousandInchesX();
+  }
+  if (attribute == DisplayAttribute::DPI_Y) {
+    // From hwcomposer2.h, HWC2_ATTRIBUTE_DPI_Y returns "Dots per thousand
+    // inches (DPI * 1000)"
+    return getDotsPerThousandInchesY();
+  }
+  if (attribute == DisplayAttribute::VSYNC_PERIOD) {
+    return mVsyncPeriodNanos;
+  }
+  if (attribute == DisplayAttribute::CONFIG_GROUP) {
+    return mConfigGroup;
+  }
+  return -1;
+}
+
+std::string DisplayConfig::toString() const {
+  std::string output;
+  output += " id: " + std::to_string(mId);
+  output += " w:" + std::to_string(mWidth);
+  output += " h:" + std::to_string(mHeight);
+  output += " dpi-x:" + std::to_string(mDpiX);
+  output += " dpi-y:" + std::to_string(mDpiY);
+  output += " vsync:" + std::to_string(1e9 / mVsyncPeriodNanos);
+  output += " config-group:" + std::to_string(mConfigGroup);
+  return output;
+}
+
+/*static*/
+void DisplayConfig::addConfigGroups(std::vector<DisplayConfig>* configs) {
+  // From /hardware/interfaces/graphics/composer/2.4/IComposerClient.hal:
+  // "Configurations which share the same config group are similar in all
+  // attributes except for the vsync period."
+  struct ConfigForGroupHash {
+    size_t operator()(const DisplayConfig& config) const {
+      size_t hash = 0;
+      hashCombine(hash, config.mWidth);
+      hashCombine(hash, config.mHeight);
+      hashCombine(hash, config.mDpiX);
+      hashCombine(hash, config.mDpiY);
+      return hash;
+    }
+  };
+  struct ConfigForGroupEq {
+    size_t operator()(const DisplayConfig& a, const DisplayConfig& b) const {
+      if (a.mWidth != b.mWidth) {
+        return a.mWidth < b.mWidth;
+      }
+      if (a.mHeight != b.mHeight) {
+        return a.mHeight < b.mHeight;
+      }
+      if (a.mDpiX != b.mDpiX) {
+        return a.mDpiX < b.mDpiX;
+      }
+      return a.mDpiY < b.mDpiY;
+    }
+  };
+
+  std::unordered_map<DisplayConfig, int32_t, ConfigForGroupHash,
+                     ConfigForGroupEq>
+      configToConfigGroup;
+
+  for (auto& config : *configs) {
+    auto [it, inserted] =
+        configToConfigGroup.try_emplace(config, configToConfigGroup.size());
+    config.setConfigGroup(it->second);
+  }
+}
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/DisplayConfig.h b/system/hwc3/DisplayConfig.h
new file mode 100644
index 0000000..7130fff
--- /dev/null
+++ b/system/hwc3/DisplayConfig.h
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_HWC_DISPLAYCONFIG_H
+#define ANDROID_HWC_DISPLAYCONFIG_H
+
+#include <aidl/android/hardware/graphics/composer3/DisplayAttribute.h>
+
+#include <vector>
+
+#include "Common.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+class DisplayConfig {
+ public:
+  DisplayConfig(int32_t configId) : mId(configId) {}
+
+  DisplayConfig(int32_t configId, int32_t width, int32_t height, int32_t dpiX,
+                int32_t dpiY, int32_t vsyncPeriodNanos)
+      : mId(configId),
+        mWidth(width),
+        mHeight(height),
+        mDpiX(dpiX),
+        mDpiY(dpiY),
+        mVsyncPeriodNanos(vsyncPeriodNanos) {}
+
+  DisplayConfig(const DisplayConfig& other) = default;
+  DisplayConfig& operator=(DisplayConfig& other) = default;
+
+  DisplayConfig(DisplayConfig&& other) = default;
+  DisplayConfig& operator=(DisplayConfig&& other) = default;
+
+  int32_t getId() const { return mId; }
+  void setId(int32_t id) { mId = id; }
+
+  int32_t getAttribute(DisplayAttribute attribute) const;
+  void setAttribute(DisplayAttribute attribute, int32_t value);
+
+  int32_t getWidth() const { return mWidth; }
+  void setWidth(int32_t width) { mWidth = width; }
+
+  int32_t getHeight() const { return mHeight; }
+  void getHeight(int32_t height) { mHeight = height; }
+
+  int32_t getDpiX() const { return mDpiX; }
+  void setDpiX(int32_t dpi) { mDpiX = dpi; }
+
+  int32_t getDpiY() const { return mDpiY; }
+  void setDpiY(int32_t dpi) { mDpiY = dpi; }
+
+  int32_t getDotsPerThousandInchesX() const { return mDpiX * 1000; }
+  int32_t getDotsPerThousandInchesY() const { return mDpiY * 1000; }
+
+  int32_t getVsyncPeriod() const { return mVsyncPeriodNanos; }
+  void setVsyncPeriod(int32_t vsync) { mVsyncPeriodNanos = vsync; }
+
+  int32_t getConfigGroup() const { return mConfigGroup; }
+  void setConfigGroup(int32_t group) { mConfigGroup = group; }
+
+  std::string toString() const;
+
+  static void addConfigGroups(std::vector<DisplayConfig>* configs);
+
+ private:
+  int32_t mId;
+  int32_t mWidth;
+  int32_t mHeight;
+  int32_t mDpiX;
+  int32_t mDpiY;
+  int32_t mVsyncPeriodNanos;
+  int32_t mConfigGroup;
+};
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
+
+#endif
\ No newline at end of file
diff --git a/system/hwc3/DisplayFinder.cpp b/system/hwc3/DisplayFinder.cpp
new file mode 100644
index 0000000..1bbb56c
--- /dev/null
+++ b/system/hwc3/DisplayFinder.cpp
@@ -0,0 +1,278 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "DisplayFinder.h"
+
+#include <android-base/parseint.h>
+#include <android-base/properties.h>
+#include <android-base/strings.h>
+#include <device_config_shared.h>
+
+#include "Common.h"
+#include "HostUtils.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+namespace {
+
+constexpr int32_t HertzToPeriodNanos(uint32_t hertz) {
+  return 1000 * 1000 * 1000 / hertz;
+}
+
+HWC3::Error findCuttlefishDisplays(std::vector<DisplayMultiConfigs>* outDisplays) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  // TODO: replace with initializing directly from DRM info.
+  const auto deviceConfig = cuttlefish::GetDeviceConfig();
+
+  int64_t displayId = 0;
+  for (const auto& deviceDisplayConfig : deviceConfig.display_config()) {
+    const auto vsyncPeriodNanos =
+        HertzToPeriodNanos(deviceDisplayConfig.refresh_rate_hz());
+
+    DisplayMultiConfigs display = {
+        .displayId = displayId,
+        .activeConfigId = 0,
+        .configs =
+            {
+                DisplayConfig(0,                             //
+                              deviceDisplayConfig.width(),   //
+                              deviceDisplayConfig.height(),  //
+                              deviceDisplayConfig.dpi(),     //
+                              deviceDisplayConfig.dpi(),     //
+                              vsyncPeriodNanos),
+            },
+    };
+    outDisplays->push_back(display);
+    ++displayId;
+  }
+
+  return HWC3::Error::None;
+}
+
+static int getVsyncHzFromProperty() {
+  static constexpr const auto kVsyncProp = "ro.boot.qemu.vsync";
+
+  const auto vsyncProp = ::android::base::GetProperty(kVsyncProp, "");
+  DEBUG_LOG("%s: prop value is: %s", __FUNCTION__, vsyncProp.c_str());
+
+  uint64_t vsyncPeriod;
+  if (!::android::base::ParseUint(vsyncProp, &vsyncPeriod)) {
+    ALOGE("%s: failed to parse vsync period '%s', returning default 60",
+          __FUNCTION__, vsyncProp.c_str());
+    return 60;
+  }
+
+  return static_cast<int>(vsyncPeriod);
+}
+
+HWC3::Error findGoldfishPrimaryDisplay(
+    std::vector<DisplayMultiConfigs>* outDisplays) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  DEFINE_AND_VALIDATE_HOST_CONNECTION
+  hostCon->lock();
+  const int32_t vsyncPeriodNanos = HertzToPeriodNanos(getVsyncHzFromProperty());
+  DisplayMultiConfigs display;
+  display.displayId = 0;
+  if (rcEnc->hasHWCMultiConfigs()) {
+    int count = rcEnc->rcGetFBDisplayConfigsCount(rcEnc);
+    if (count <= 0) {
+      ALOGE("%s failed to allocate primary display, config count %d", __func__,
+            count);
+      return HWC3::Error::NoResources;
+    }
+    display.activeConfigId = rcEnc->rcGetFBDisplayActiveConfig(rcEnc);
+    for (int configId = 0; configId < count; configId++) {
+      display.configs.push_back(DisplayConfig(
+          configId,                                                       //
+          rcEnc->rcGetFBDisplayConfigsParam(rcEnc, configId, FB_WIDTH),   //
+          rcEnc->rcGetFBDisplayConfigsParam(rcEnc, configId, FB_HEIGHT),  //
+          rcEnc->rcGetFBDisplayConfigsParam(rcEnc, configId, FB_XDPI),    //
+          rcEnc->rcGetFBDisplayConfigsParam(rcEnc, configId, FB_YDPI),    //
+          vsyncPeriodNanos                                                //
+          ));
+    }
+  } else {
+    display.activeConfigId = 0;
+    display.configs.push_back(DisplayConfig(
+        0,                                      //
+        rcEnc->rcGetFBParam(rcEnc, FB_WIDTH),   //
+        rcEnc->rcGetFBParam(rcEnc, FB_HEIGHT),  //
+        rcEnc->rcGetFBParam(rcEnc, FB_XDPI),    //
+        rcEnc->rcGetFBParam(rcEnc, FB_YDPI),    //
+        vsyncPeriodNanos                        //
+        ));
+  }
+  hostCon->unlock();
+
+  outDisplays->push_back(display);
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error findGoldfishSecondaryDisplays(
+    std::vector<DisplayMultiConfigs>* outDisplays) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  static constexpr const char kExternalDisplayProp[] =
+      "hwservicemanager.external.displays";
+
+  const auto propString =
+      ::android::base::GetProperty(kExternalDisplayProp, "");
+  DEBUG_LOG("%s: prop value is: %s", __FUNCTION__, propString.c_str());
+
+  if (propString.empty()) {
+    return HWC3::Error::None;
+  }
+
+  const std::vector<std::string> propStringParts =
+      ::android::base::Split(propString, ",");
+  if (propStringParts.size() % 5 != 0) {
+    ALOGE("%s: Invalid syntax for system prop %s which is %s", __FUNCTION__,
+          kExternalDisplayProp, propString.c_str());
+    return HWC3::Error::BadParameter;
+  }
+
+  std::vector<int> propIntParts;
+  for (const std::string& propStringPart : propStringParts) {
+    int propIntPart;
+    if (!::android::base::ParseInt(propStringPart, &propIntPart)) {
+      ALOGE("%s: Invalid syntax for system prop %s which is %s", __FUNCTION__,
+            kExternalDisplayProp, propString.c_str());
+      return HWC3::Error::BadParameter;
+    }
+    propIntParts.push_back(propIntPart);
+  }
+
+  int64_t secondaryDisplayId = 1;
+  while (!propIntParts.empty()) {
+    DisplayMultiConfigs display;
+    display.displayId = secondaryDisplayId;
+    display.activeConfigId = 0;
+    display.configs.push_back(DisplayConfig(
+        0,                                       //
+        /*width=*/propIntParts[1],               //
+        /*heighth=*/propIntParts[2],             //
+        /*dpiXh=*/propIntParts[3],               //
+        /*dpiYh=*/propIntParts[3],               //
+        /*vsyncPeriod=*/HertzToPeriodNanos(160)  //
+        ));
+    outDisplays->push_back(display);
+
+    ++secondaryDisplayId;
+
+    propIntParts.erase(propIntParts.begin(), propIntParts.begin() + 5);
+  }
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error findGoldfishDisplays(std::vector<DisplayMultiConfigs>* outDisplays) {
+  HWC3::Error error = findGoldfishPrimaryDisplay(outDisplays);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s failed to find Goldfish primary display", __FUNCTION__);
+    return error;
+  }
+
+  error = findGoldfishSecondaryDisplays(outDisplays);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s failed to find Goldfish secondary displays", __FUNCTION__);
+  }
+
+  return error;
+}
+
+// This is currently only used for Gem5 bring-up where virtio-gpu and drm
+// are not currently available. For now, just return a placeholder display.
+HWC3::Error findNoOpDisplays(std::vector<DisplayMultiConfigs>* outDisplays) {
+  outDisplays->push_back(DisplayMultiConfigs{
+      .displayId = 0,
+      .activeConfigId = 0,
+      .configs = {DisplayConfig(0,
+                                /*width=*/720,                          //
+                                /*heighth=*/1280,                       //
+                                /*dpiXh=*/320,                          //
+                                /*dpiYh=*/320,                          //
+                                /*vsyncPeriod=*/HertzToPeriodNanos(30)  //
+                                )},
+  });
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error findDrmDisplays(const DrmClient& drm,
+                            std::vector<DisplayMultiConfigs>* outDisplays) {
+  outDisplays->clear();
+
+  std::vector<DrmClient::DisplayConfig> drmDisplayConfigs;
+
+  HWC3::Error error = drm.getDisplayConfigs(&drmDisplayConfigs);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s failed to find displays from DRM.", __FUNCTION__);
+    return error;
+  }
+
+  for (const DrmClient::DisplayConfig drmDisplayConfig : drmDisplayConfigs) {
+    outDisplays->push_back(DisplayMultiConfigs{
+      .displayId = drmDisplayConfig.id,
+      .activeConfigId = static_cast<int32_t>(drmDisplayConfig.id),
+      .configs = {
+        DisplayConfig(static_cast<int32_t>(drmDisplayConfig.id),
+                      drmDisplayConfig.width,
+                      drmDisplayConfig.height,
+                      drmDisplayConfig.dpiX,
+                      drmDisplayConfig.dpiY,
+                      HertzToPeriodNanos(drmDisplayConfig.refreshRateHz)),
+      },
+    });
+  }
+
+  return HWC3::Error::None;
+}
+
+}  // namespace
+
+HWC3::Error findDisplays(const DrmClient* drm,
+                         std::vector<DisplayMultiConfigs>* outDisplays) {
+  HWC3::Error error = HWC3::Error::None;
+  if (IsInGem5DisplayFinderMode() || IsInNoOpCompositionMode()) {
+    error = findNoOpDisplays(outDisplays);
+  } else if (IsInDrmDisplayFinderMode()) {
+    if (drm == nullptr) {
+      ALOGE("%s asked to find displays from DRM, but DRM not available.",
+            __FUNCTION__);
+      return HWC3::Error::NoResources;
+    }
+    error = findDrmDisplays(*drm, outDisplays);
+  } else if (IsCuttlefish()) {
+    error = findCuttlefishDisplays(outDisplays);
+  } else {
+    error = findGoldfishDisplays(outDisplays);
+  }
+
+  if (error != HWC3::Error::None) {
+    ALOGE("%s failed to find displays", __FUNCTION__);
+    return error;
+  }
+
+  for (auto& display : *outDisplays) {
+    DisplayConfig::addConfigGroups(&display.configs);
+  }
+
+  return HWC3::Error::None;
+}
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/DisplayFinder.h b/system/hwc3/DisplayFinder.h
new file mode 100644
index 0000000..963e4c1
--- /dev/null
+++ b/system/hwc3/DisplayFinder.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_HWC_DISPLAYFINDER_H
+#define ANDROID_HWC_DISPLAYFINDER_H
+
+#include <optional>
+#include <vector>
+
+#include "Common.h"
+#include "DisplayConfig.h"
+#include "DrmClient.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+struct DisplayMultiConfigs {
+  int64_t displayId;
+  int32_t activeConfigId;
+  // Modes that this display can be configured to use.
+  std::vector<DisplayConfig> configs;
+};
+
+HWC3::Error findDisplays(const DrmClient* drm,
+                         std::vector<DisplayMultiConfigs>* outDisplays);
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
+
+#endif
diff --git a/system/hwc3/Drm.cpp b/system/hwc3/Drm.cpp
new file mode 100644
index 0000000..d5cf1d7
--- /dev/null
+++ b/system/hwc3/Drm.cpp
@@ -0,0 +1,180 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Drm.h"
+
+#include <drm_fourcc.h>
+#include <log/log.h>
+#include <system/graphics.h>
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+const char* GetDrmFormatString(uint32_t drm_format) {
+    switch (drm_format) {
+        case DRM_FORMAT_ABGR1555:
+            return "DRM_FORMAT_ABGR1555";
+        case DRM_FORMAT_ABGR2101010:
+            return "DRM_FORMAT_ABGR2101010";
+        case DRM_FORMAT_ABGR4444:
+            return "DRM_FORMAT_ABGR4444";
+        case DRM_FORMAT_ABGR8888:
+            return "DRM_FORMAT_ABGR8888";
+        case DRM_FORMAT_ARGB1555:
+            return "DRM_FORMAT_ARGB1555";
+        case DRM_FORMAT_ARGB2101010:
+            return "DRM_FORMAT_ARGB2101010";
+        case DRM_FORMAT_ARGB4444:
+            return "DRM_FORMAT_ARGB4444";
+        case DRM_FORMAT_ARGB8888:
+            return "DRM_FORMAT_ARGB8888";
+        case DRM_FORMAT_AYUV:
+            return "DRM_FORMAT_AYUV";
+        case DRM_FORMAT_BGR233:
+            return "DRM_FORMAT_BGR233";
+        case DRM_FORMAT_BGR565:
+            return "DRM_FORMAT_BGR565";
+        case DRM_FORMAT_BGR888:
+            return "DRM_FORMAT_BGR888";
+        case DRM_FORMAT_BGRA1010102:
+            return "DRM_FORMAT_BGRA1010102";
+        case DRM_FORMAT_BGRA4444:
+            return "DRM_FORMAT_BGRA4444";
+        case DRM_FORMAT_BGRA5551:
+            return "DRM_FORMAT_BGRA5551";
+        case DRM_FORMAT_BGRA8888:
+            return "DRM_FORMAT_BGRA8888";
+        case DRM_FORMAT_BGRX1010102:
+            return "DRM_FORMAT_BGRX1010102";
+        case DRM_FORMAT_BGRX4444:
+            return "DRM_FORMAT_BGRX4444";
+        case DRM_FORMAT_BGRX5551:
+            return "DRM_FORMAT_BGRX5551";
+        case DRM_FORMAT_BGRX8888:
+            return "DRM_FORMAT_BGRX8888";
+        case DRM_FORMAT_C8:
+            return "DRM_FORMAT_C8";
+        case DRM_FORMAT_GR88:
+            return "DRM_FORMAT_GR88";
+        case DRM_FORMAT_NV12:
+            return "DRM_FORMAT_NV12";
+        case DRM_FORMAT_NV21:
+            return "DRM_FORMAT_NV21";
+        case DRM_FORMAT_R8:
+            return "DRM_FORMAT_R8";
+        case DRM_FORMAT_RG88:
+            return "DRM_FORMAT_RG88";
+        case DRM_FORMAT_RGB332:
+            return "DRM_FORMAT_RGB332";
+        case DRM_FORMAT_RGB565:
+            return "DRM_FORMAT_RGB565";
+        case DRM_FORMAT_RGB888:
+            return "DRM_FORMAT_RGB888";
+        case DRM_FORMAT_RGBA1010102:
+            return "DRM_FORMAT_RGBA1010102";
+        case DRM_FORMAT_RGBA4444:
+            return "DRM_FORMAT_RGBA4444";
+        case DRM_FORMAT_RGBA5551:
+            return "DRM_FORMAT_RGBA5551";
+        case DRM_FORMAT_RGBA8888:
+            return "DRM_FORMAT_RGBA8888";
+        case DRM_FORMAT_RGBX1010102:
+            return "DRM_FORMAT_RGBX1010102";
+        case DRM_FORMAT_RGBX4444:
+            return "DRM_FORMAT_RGBX4444";
+        case DRM_FORMAT_RGBX5551:
+            return "DRM_FORMAT_RGBX5551";
+        case DRM_FORMAT_RGBX8888:
+            return "DRM_FORMAT_RGBX8888";
+        case DRM_FORMAT_UYVY:
+            return "DRM_FORMAT_UYVY";
+        case DRM_FORMAT_VYUY:
+            return "DRM_FORMAT_VYUY";
+        case DRM_FORMAT_XBGR1555:
+            return "DRM_FORMAT_XBGR1555";
+        case DRM_FORMAT_XBGR2101010:
+            return "DRM_FORMAT_XBGR2101010";
+        case DRM_FORMAT_XBGR4444:
+            return "DRM_FORMAT_XBGR4444";
+        case DRM_FORMAT_XBGR8888:
+            return "DRM_FORMAT_XBGR8888";
+        case DRM_FORMAT_XRGB1555:
+            return "DRM_FORMAT_XRGB1555";
+        case DRM_FORMAT_XRGB2101010:
+            return "DRM_FORMAT_XRGB2101010";
+        case DRM_FORMAT_XRGB4444:
+            return "DRM_FORMAT_XRGB4444";
+        case DRM_FORMAT_XRGB8888:
+            return "DRM_FORMAT_XRGB8888";
+        case DRM_FORMAT_YUYV:
+            return "DRM_FORMAT_YUYV";
+        case DRM_FORMAT_YVU420:
+            return "DRM_FORMAT_YVU420";
+        case DRM_FORMAT_YVYU:
+            return "DRM_FORMAT_YVYU";
+    }
+    return "Unknown";
+}
+
+int GetDrmFormatBytesPerPixel(uint32_t drm_format) {
+    switch (drm_format) {
+        case DRM_FORMAT_ABGR8888:
+        case DRM_FORMAT_ARGB8888:
+        case DRM_FORMAT_XBGR8888:
+            return 4;
+        case DRM_FORMAT_BGR888:
+            return 3;
+        case DRM_FORMAT_RGB565:
+        case DRM_FORMAT_YVU420:
+#ifdef GRALLOC_MODULE_API_VERSION_0_2
+        case DRM_FORMAT_FLEX_YCbCr_420_888:
+#endif
+            return 2;
+        case DRM_FORMAT_R8:
+            return 1;
+    }
+    ALOGE("%s: format size unknown %d(%s)", __FUNCTION__, drm_format,
+          GetDrmFormatString(drm_format));
+    return 8;
+}
+
+int GetDrmFormatFromHalFormat(int hal_format) {
+    switch (hal_format) {
+        case HAL_PIXEL_FORMAT_RGBA_FP16:
+            return DRM_FORMAT_ABGR16161616F;
+        case HAL_PIXEL_FORMAT_RGBA_8888:
+            return DRM_FORMAT_ABGR8888;
+        case HAL_PIXEL_FORMAT_RGBX_8888:
+            return DRM_FORMAT_XBGR8888;
+        case HAL_PIXEL_FORMAT_BGRA_8888:
+            return DRM_FORMAT_ARGB8888;
+        case HAL_PIXEL_FORMAT_RGB_888:
+            return DRM_FORMAT_BGR888;
+        case HAL_PIXEL_FORMAT_RGB_565:
+            return DRM_FORMAT_BGR565;
+        case HAL_PIXEL_FORMAT_YV12:
+            return DRM_FORMAT_YVU420;
+        case HAL_PIXEL_FORMAT_YCbCr_420_888:
+            return DRM_FORMAT_YVU420;
+        case HAL_PIXEL_FORMAT_BLOB:
+            return DRM_FORMAT_R8;
+        default:
+            break;
+    }
+    ALOGE("%s unhandled hal format: %d", __FUNCTION__, hal_format);
+    return 0;
+}
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
\ No newline at end of file
diff --git a/system/hwc3/Drm.h b/system/hwc3/Drm.h
new file mode 100644
index 0000000..1d25033
--- /dev/null
+++ b/system/hwc3/Drm.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef ANDROID_HWC_DRM_H
+#define ANDROID_HWC_DRM_H
+
+#include <cstdlib>
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+const char* GetDrmFormatString(uint32_t drm_format);
+
+int GetDrmFormatBytesPerPixel(uint32_t drm_format);
+
+int GetDrmFormatFromHalFormat(int hal_format);
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
+
+#endif
\ No newline at end of file
diff --git a/system/hwc3/DrmAtomicRequest.cpp b/system/hwc3/DrmAtomicRequest.cpp
new file mode 100644
index 0000000..63e5c10
--- /dev/null
+++ b/system/hwc3/DrmAtomicRequest.cpp
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "DrmAtomicRequest.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+std::unique_ptr<DrmAtomicRequest> DrmAtomicRequest::create() {
+    drmModeAtomicReqPtr request = drmModeAtomicAlloc();
+    if (!request) {
+        return nullptr;
+    }
+
+    return std::unique_ptr<DrmAtomicRequest>(new DrmAtomicRequest(request));
+}
+
+DrmAtomicRequest::~DrmAtomicRequest() {
+    if (mRequest) {
+        drmModeAtomicFree(mRequest);
+    }
+}
+
+bool DrmAtomicRequest::Set(uint32_t objectId, const DrmProperty& prop, uint64_t value) {
+    int ret = drmModeAtomicAddProperty(mRequest, objectId, prop.getId(), value);
+    if (ret < 0) {
+        ALOGE("%s: failed to set atomic request property %s to %" PRIu64 ": %s", __FUNCTION__,
+              prop.getName().c_str(), value, strerror(errno));
+        return false;
+    }
+    return true;
+}
+
+bool DrmAtomicRequest::Commit(::android::base::borrowed_fd drmFd) {
+    constexpr const uint32_t kCommitFlags = DRM_MODE_ATOMIC_ALLOW_MODESET;
+
+    int ret = drmModeAtomicCommit(drmFd.get(), mRequest, kCommitFlags, 0);
+    if (ret) {
+        ALOGE("%s:%d: atomic commit failed: %s\n", __FUNCTION__, __LINE__, strerror(errno));
+        return false;
+    }
+
+    return true;
+}
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/DrmAtomicRequest.h b/system/hwc3/DrmAtomicRequest.h
new file mode 100644
index 0000000..862ea2f
--- /dev/null
+++ b/system/hwc3/DrmAtomicRequest.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <android-base/logging.h>
+#include <android-base/unique_fd.h>
+#include <xf86drm.h>
+#include <xf86drmMode.h>
+
+#include <cstdint>
+#include <memory>
+#include <string>
+#include <unordered_map>
+
+#include "Common.h"
+#include "DrmMode.h"
+#include "DrmProperty.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+class DrmAtomicRequest {
+   public:
+    static std::unique_ptr<DrmAtomicRequest> create();
+    ~DrmAtomicRequest();
+
+    bool Set(uint32_t objectId, const DrmProperty& prop, uint64_t value);
+
+    bool Commit(::android::base::borrowed_fd drmFd);
+
+   private:
+    DrmAtomicRequest(drmModeAtomicReqPtr request) : mRequest(request) {}
+
+    drmModeAtomicReqPtr mRequest;
+};
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/DrmBuffer.cpp b/system/hwc3/DrmBuffer.cpp
new file mode 100644
index 0000000..68b5457
--- /dev/null
+++ b/system/hwc3/DrmBuffer.cpp
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "DrmBuffer.h"
+
+#include "DrmClient.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+DrmBuffer::DrmBuffer(DrmClient& DrmClient) : mDrmClient(DrmClient) {}
+
+DrmBuffer::~DrmBuffer() { mDrmClient.destroyDrmFramebuffer(this); }
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/DrmBuffer.h b/system/hwc3/DrmBuffer.h
new file mode 100644
index 0000000..1d5e30a
--- /dev/null
+++ b/system/hwc3/DrmBuffer.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <android-base/logging.h>
+#include <android-base/unique_fd.h>
+#include <xf86drm.h>
+#include <xf86drmMode.h>
+
+#include <cstdint>
+#include <optional>
+#include <unordered_map>
+
+#include "Common.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+class DrmClient;
+
+// A RAII object that will clear a drm framebuffer upon destruction.
+class DrmBuffer {
+   public:
+    ~DrmBuffer();
+
+    DrmBuffer(const DrmBuffer&) = delete;
+    DrmBuffer& operator=(const DrmBuffer&) = delete;
+
+    DrmBuffer(DrmBuffer&&) = delete;
+    DrmBuffer& operator=(DrmBuffer&&) = delete;
+
+   private:
+    friend class DrmClient;
+    friend class DrmDisplay;
+    DrmBuffer(DrmClient& drmClient);
+
+    DrmClient& mDrmClient;
+
+    uint32_t mWidth = 0;
+    uint32_t mHeight = 0;
+    uint32_t mDrmFormat = 0;
+    uint32_t mPlaneFds[4] = {0, 0, 0, 0};
+    uint32_t mPlaneHandles[4] = {0, 0, 0, 0};
+    uint32_t mPlanePitches[4] = {0, 0, 0, 0};
+    uint32_t mPlaneOffsets[4] = {0, 0, 0, 0};
+    std::optional<uint32_t> mDrmFramebuffer;
+};
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/DrmClient.cpp b/system/hwc3/DrmClient.cpp
new file mode 100644
index 0000000..b25acc3
--- /dev/null
+++ b/system/hwc3/DrmClient.cpp
@@ -0,0 +1,339 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "DrmClient.h"
+
+#include <cros_gralloc_handle.h>
+
+using ::android::base::guest::AutoReadLock;
+using ::android::base::guest::AutoWriteLock;
+using ::android::base::guest::ReadWriteLock;
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+DrmClient::~DrmClient() {
+    if (mFd > 0) {
+        drmDropMaster(mFd.get());
+    }
+}
+
+HWC3::Error DrmClient::init() {
+    DEBUG_LOG("%s", __FUNCTION__);
+
+    mFd = ::android::base::unique_fd(open("/dev/dri/card0", O_RDWR | O_CLOEXEC));
+    if (mFd < 0) {
+        ALOGE("%s: failed to open drm device: %s", __FUNCTION__, strerror(errno));
+        return HWC3::Error::NoResources;
+    }
+
+    int ret = drmSetClientCap(mFd.get(), DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
+    if (ret) {
+        ALOGE("%s: failed to set cap universal plane %s\n", __FUNCTION__, strerror(errno));
+        return HWC3::Error::NoResources;
+    }
+
+    ret = drmSetClientCap(mFd.get(), DRM_CLIENT_CAP_ATOMIC, 1);
+    if (ret) {
+        ALOGE("%s: failed to set cap atomic %s\n", __FUNCTION__, strerror(errno));
+        return HWC3::Error::NoResources;
+    }
+
+    drmSetMaster(mFd.get());
+
+    if (!drmIsMaster(mFd.get())) {
+        ALOGE("%s: failed to get master drm device", __FUNCTION__);
+        return HWC3::Error::NoResources;
+    }
+
+    {
+        AutoWriteLock lock(mDisplaysMutex);
+        bool success = loadDrmDisplays();
+        if (success) {
+            DEBUG_LOG("%s: Successfully initialized DRM backend", __FUNCTION__);
+        } else {
+            ALOGE("%s: Failed to initialize DRM backend", __FUNCTION__);
+            return HWC3::Error::NoResources;
+        }
+    }
+
+    mDrmEventListener = DrmEventListener::create(mFd, [this]() { handleHotplug(); });
+    if (!mDrmEventListener) {
+        ALOGE("%s: Failed to initialize DRM event listener", __FUNCTION__);
+    } else {
+        DEBUG_LOG("%s: Successfully initialized DRM event listener", __FUNCTION__);
+    }
+
+    DEBUG_LOG("%s: Successfully initialized.", __FUNCTION__);
+    return HWC3::Error::None;
+}
+
+HWC3::Error DrmClient::getDisplayConfigs(std::vector<DisplayConfig>* configs) const {
+    DEBUG_LOG("%s", __FUNCTION__);
+
+    AutoReadLock lock(mDisplaysMutex);
+
+    configs->clear();
+
+    for (const auto& display : mDisplays) {
+        if (!display->isConnected()) {
+            continue;
+        }
+
+        configs->emplace_back(DisplayConfig{
+            .id = display->getId(),
+            .width = display->getWidth(),
+            .height = display->getHeight(),
+            .dpiX = display->getDpiX(),
+            .dpiY = display->getDpiY(),
+            .refreshRateHz = display->getRefreshRateUint(),
+        });
+    }
+
+    return HWC3::Error::None;
+}
+
+HWC3::Error DrmClient::registerOnHotplugCallback(const HotplugCallback& cb) {
+    mHotplugCallback = cb;
+    return HWC3::Error::None;
+}
+
+HWC3::Error DrmClient::unregisterOnHotplugCallback() {
+    mHotplugCallback.reset();
+    return HWC3::Error::None;
+}
+
+bool DrmClient::loadDrmDisplays() {
+    DEBUG_LOG("%s", __FUNCTION__);
+
+    std::vector<std::unique_ptr<DrmCrtc>> crtcs;
+    std::vector<std::unique_ptr<DrmConnector>> connectors;
+    std::vector<std::unique_ptr<DrmPlane>> planes;
+
+    drmModePlaneResPtr drmPlaneResources = drmModeGetPlaneResources(mFd.get());
+    for (uint32_t i = 0; i < drmPlaneResources->count_planes; ++i) {
+        const uint32_t planeId = drmPlaneResources->planes[i];
+
+        auto crtc = DrmPlane::create(mFd, planeId);
+        if (!crtc) {
+            ALOGE("%s: Failed to create DRM CRTC.", __FUNCTION__);
+            return false;
+        }
+
+        planes.emplace_back(std::move(crtc));
+    }
+    drmModeFreePlaneResources(drmPlaneResources);
+
+    drmModeRes* drmResources = drmModeGetResources(mFd.get());
+    for (uint32_t crtcIndex = 0; crtcIndex < drmResources->count_crtcs; crtcIndex++) {
+        const uint32_t crtcId = drmResources->crtcs[crtcIndex];
+
+        auto crtc = DrmCrtc::create(mFd, crtcId, crtcIndex);
+        if (!crtc) {
+            ALOGE("%s: Failed to create DRM CRTC.", __FUNCTION__);
+            return false;
+        }
+
+        crtcs.emplace_back(std::move(crtc));
+    }
+
+    for (uint32_t i = 0; i < drmResources->count_connectors; ++i) {
+        const uint32_t connectorId = drmResources->connectors[i];
+
+        auto connector = DrmConnector::create(mFd, connectorId);
+        if (!connector) {
+            ALOGE("%s: Failed to create DRM CRTC.", __FUNCTION__);
+            return false;
+        }
+
+        connectors.emplace_back(std::move(connector));
+    }
+
+    drmModeFreeResources(drmResources);
+
+    if (crtcs.size() != connectors.size()) {
+        ALOGE("%s: Failed assumption mCrtcs.size():%zu equals mConnectors.size():%zu", __FUNCTION__,
+              crtcs.size(), connectors.size());
+        return false;
+    }
+
+    for (uint32_t i = 0; i < crtcs.size(); i++) {
+        std::unique_ptr<DrmCrtc> crtc = std::move(crtcs[i]);
+        std::unique_ptr<DrmConnector> connector = std::move(connectors[i]);
+
+        auto planeIt =
+            std::find_if(planes.begin(), planes.end(), [&](const std::unique_ptr<DrmPlane>& plane) {
+                if (!plane->isOverlay() && !plane->isPrimary()) {
+                    return false;
+                }
+                return plane->isCompatibleWith(*crtc);
+            });
+        if (planeIt == planes.end()) {
+            ALOGE("%s: Failed to find plane for display:%" PRIu32, __FUNCTION__, i);
+            return false;
+        }
+
+        std::unique_ptr<DrmPlane> plane = std::move(*planeIt);
+        planes.erase(planeIt);
+
+        auto display =
+            DrmDisplay::create(i, std::move(connector), std::move(crtc), std::move(plane), mFd);
+        if (!display) {
+            return false;
+        }
+        mDisplays.push_back(std::move(display));
+    }
+
+    return true;
+}
+
+std::tuple<HWC3::Error, std::shared_ptr<DrmBuffer>> DrmClient::create(
+    const native_handle_t* handle) {
+    cros_gralloc_handle* crosHandle = (cros_gralloc_handle*)handle;
+    if (crosHandle == nullptr) {
+        ALOGE("%s: invalid cros_gralloc_handle", __FUNCTION__);
+        return std::make_tuple(HWC3::Error::NoResources, nullptr);
+    }
+
+    DrmPrimeBufferHandle primeHandle = 0;
+    int ret = drmPrimeFDToHandle(mFd.get(), crosHandle->fds[0], &primeHandle);
+    if (ret) {
+        ALOGE("%s: drmPrimeFDToHandle failed: %s (errno %d)", __FUNCTION__, strerror(errno), errno);
+        return std::make_tuple(HWC3::Error::NoResources, nullptr);
+    }
+
+    auto buffer = std::shared_ptr<DrmBuffer>(new DrmBuffer(*this));
+    buffer->mWidth = crosHandle->width;
+    buffer->mHeight = crosHandle->height;
+    buffer->mDrmFormat = crosHandle->format;
+    buffer->mPlaneFds[0] = crosHandle->fds[0];
+    buffer->mPlaneHandles[0] = primeHandle;
+    buffer->mPlanePitches[0] = crosHandle->strides[0];
+    buffer->mPlaneOffsets[0] = crosHandle->offsets[0];
+
+    uint32_t framebuffer = 0;
+    ret = drmModeAddFB2(mFd.get(), buffer->mWidth, buffer->mHeight, buffer->mDrmFormat,
+                        buffer->mPlaneHandles, buffer->mPlanePitches, buffer->mPlaneOffsets,
+                        &framebuffer, 0);
+    if (ret) {
+        ALOGE("%s: drmModeAddFB2 failed: %s (errno %d)", __FUNCTION__, strerror(errno), errno);
+        return std::make_tuple(HWC3::Error::NoResources, nullptr);
+    }
+    DEBUG_LOG("%s: created framebuffer:%" PRIu32, __FUNCTION__, framebuffer);
+    buffer->mDrmFramebuffer = framebuffer;
+
+    return std::make_tuple(HWC3::Error::None, std::shared_ptr<DrmBuffer>(buffer));
+}
+
+HWC3::Error DrmClient::destroyDrmFramebuffer(DrmBuffer* buffer) {
+    if (buffer->mDrmFramebuffer) {
+        uint32_t framebuffer = *buffer->mDrmFramebuffer;
+        if (drmModeRmFB(mFd.get(), framebuffer)) {
+            ALOGE("%s: drmModeRmFB failed: %s (errno %d)", __FUNCTION__, strerror(errno), errno);
+            return HWC3::Error::NoResources;
+        }
+        DEBUG_LOG("%s: destroyed framebuffer:%" PRIu32, __FUNCTION__, framebuffer);
+        buffer->mDrmFramebuffer.reset();
+    }
+    if (buffer->mPlaneHandles[0]) {
+        struct drm_gem_close gem_close = {};
+        gem_close.handle = buffer->mPlaneHandles[0];
+        if (drmIoctl(mFd.get(), DRM_IOCTL_GEM_CLOSE, &gem_close)) {
+            ALOGE("%s: DRM_IOCTL_GEM_CLOSE failed: %s (errno %d)", __FUNCTION__, strerror(errno),
+                  errno);
+            return HWC3::Error::NoResources;
+        }
+    }
+
+    return HWC3::Error::None;
+}
+
+bool DrmClient::handleHotplug() {
+    DEBUG_LOG("%s", __FUNCTION__);
+
+    struct HotplugToReport {
+        uint32_t id;
+        uint32_t width;
+        uint32_t height;
+        uint32_t dpiX;
+        uint32_t dpiY;
+        uint32_t rr;
+        bool connected;
+    };
+
+    std::vector<HotplugToReport> hotplugs;
+
+    {
+        AutoWriteLock lock(mDisplaysMutex);
+
+        for (auto& display : mDisplays) {
+            auto change = display->checkAndHandleHotplug(mFd);
+            if (change == DrmHotplugChange::kNoChange) {
+                continue;
+            }
+
+            hotplugs.push_back(HotplugToReport{
+                .id = display->getId(),
+                .width = display->getWidth(),
+                .height = display->getHeight(),
+                .dpiX = display->getDpiX(),
+                .dpiY = display->getDpiY(),
+                .rr = display->getRefreshRateUint(),
+                .connected = change == DrmHotplugChange::kConnected,
+            });
+        }
+    }
+
+    for (const auto& hotplug : hotplugs) {
+        if (mHotplugCallback) {
+            (*mHotplugCallback)(hotplug.connected,  //
+                                hotplug.id,         //
+                                hotplug.width,      //
+                                hotplug.height,     //
+                                hotplug.dpiX,       //
+                                hotplug.dpiY,       //
+                                hotplug.rr);
+        }
+    }
+
+    return true;
+}
+
+std::tuple<HWC3::Error, ::android::base::unique_fd> DrmClient::flushToDisplay(
+    int displayId, const std::shared_ptr<DrmBuffer>& buffer,
+    ::android::base::borrowed_fd inSyncFd) {
+    ATRACE_CALL();
+
+    if (!buffer->mDrmFramebuffer) {
+        ALOGE("%s: failed, no framebuffer created.", __FUNCTION__);
+        return std::make_tuple(HWC3::Error::NoResources, ::android::base::unique_fd());
+    }
+
+    AutoReadLock lock(mDisplaysMutex);
+    return mDisplays[displayId]->flush(mFd, inSyncFd, buffer);
+}
+
+std::optional<std::vector<uint8_t>> DrmClient::getEdid(uint32_t displayId) {
+    AutoReadLock lock(mDisplaysMutex);
+
+    if (displayId >= mDisplays.size()) {
+        DEBUG_LOG("%s: invalid display:%" PRIu32, __FUNCTION__, displayId);
+        return std::nullopt;
+    }
+
+    return mDisplays[displayId]->getEdid();
+}
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/DrmClient.h b/system/hwc3/DrmClient.h
new file mode 100644
index 0000000..7919cbf
--- /dev/null
+++ b/system/hwc3/DrmClient.h
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <android-base/unique_fd.h>
+#include <cutils/native_handle.h>
+
+#include <memory>
+#include <tuple>
+#include <vector>
+
+#include "Common.h"
+#include "DrmAtomicRequest.h"
+#include "DrmBuffer.h"
+#include "DrmConnector.h"
+#include "DrmCrtc.h"
+#include "DrmDisplay.h"
+#include "DrmEventListener.h"
+#include "DrmMode.h"
+#include "DrmPlane.h"
+#include "DrmProperty.h"
+#include "LruCache.h"
+#include "aemu/base/synchronization/AndroidLock.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+class DrmClient {
+   public:
+    DrmClient() = default;
+    ~DrmClient();
+
+    DrmClient(const DrmClient&) = delete;
+    DrmClient& operator=(const DrmClient&) = delete;
+
+    DrmClient(DrmClient&&) = delete;
+    DrmClient& operator=(DrmClient&&) = delete;
+
+    HWC3::Error init();
+
+    struct DisplayConfig {
+        uint32_t id;
+        uint32_t width;
+        uint32_t height;
+        uint32_t dpiX;
+        uint32_t dpiY;
+        uint32_t refreshRateHz;
+    };
+
+    HWC3::Error getDisplayConfigs(std::vector<DisplayConfig>* configs) const;
+
+    using HotplugCallback = std::function<void(bool /*connected*/,   //
+                                               uint32_t /*id*/,      //
+                                               uint32_t /*width*/,   //
+                                               uint32_t /*height*/,  //
+                                               uint32_t /*dpiX*/,    //
+                                               uint32_t /*dpiY*/,    //
+                                               uint32_t /*refreshRate*/)>;
+
+    HWC3::Error registerOnHotplugCallback(const HotplugCallback& cb);
+    HWC3::Error unregisterOnHotplugCallback();
+
+    uint32_t refreshRate() const { return mDisplays[0]->getRefreshRateUint(); }
+
+    std::tuple<HWC3::Error, std::shared_ptr<DrmBuffer>> create(const native_handle_t* handle);
+
+    std::tuple<HWC3::Error, ::android::base::unique_fd> flushToDisplay(
+        int display, const std::shared_ptr<DrmBuffer>& buffer,
+        ::android::base::borrowed_fd inWaitSyncFd);
+
+    std::optional<std::vector<uint8_t>> getEdid(uint32_t id);
+
+   private:
+    using DrmPrimeBufferHandle = uint32_t;
+
+    // Grant visibility to destroyDrmFramebuffer to DrmBuffer.
+    friend class DrmBuffer;
+    HWC3::Error destroyDrmFramebuffer(DrmBuffer* buffer);
+
+    // Grant visibility for handleHotplug to DrmEventListener.
+    bool handleHotplug();
+
+    bool loadDrmDisplays();
+
+    // Drm device.
+    ::android::base::unique_fd mFd;
+
+    mutable ::android::base::guest::ReadWriteLock mDisplaysMutex;
+    std::vector<std::unique_ptr<DrmDisplay>> mDisplays;
+
+    std::optional<HotplugCallback> mHotplugCallback;
+
+    std::unique_ptr<DrmEventListener> mDrmEventListener;
+};
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/DrmConnector.cpp b/system/hwc3/DrmConnector.cpp
new file mode 100644
index 0000000..0924af5
--- /dev/null
+++ b/system/hwc3/DrmConnector.cpp
@@ -0,0 +1,195 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "DrmConnector.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+namespace {
+
+static constexpr const float kMillimetersPerInch = 25.4;
+
+}  // namespace
+
+std::unique_ptr<DrmConnector> DrmConnector::create(::android::base::borrowed_fd drmFd,
+                                                   uint32_t connectorId) {
+    std::unique_ptr<DrmConnector> connector(new DrmConnector(connectorId));
+
+    if (!LoadDrmProperties(drmFd, connectorId, DRM_MODE_OBJECT_CONNECTOR, GetPropertiesMap(),
+                           connector.get())) {
+        ALOGE("%s: Failed to load connector properties.", __FUNCTION__);
+        return nullptr;
+    }
+
+    if (!connector->update(drmFd)) {
+        return nullptr;
+    }
+
+    return connector;
+}
+
+bool DrmConnector::update(::android::base::borrowed_fd drmFd) {
+    DEBUG_LOG("%s: Loading properties for connector:%" PRIu32, __FUNCTION__, mId);
+
+    drmModeConnector* drmConnector = drmModeGetConnector(drmFd.get(), mId);
+    if (!drmConnector) {
+        ALOGE("%s: Failed to load connector.", __FUNCTION__);
+        return false;
+    }
+
+    mStatus = drmConnector->connection;
+
+    mModes.clear();
+    for (uint32_t i = 0; i < drmConnector->count_modes; i++) {
+        auto mode = DrmMode::create(drmFd, drmConnector->modes[i]);
+        if (!mode) {
+            ALOGE("%s: Failed to create mode for connector.", __FUNCTION__);
+            return false;
+        }
+
+        mModes.push_back(std::move(mode));
+    }
+
+    drmModeFreeConnector(drmConnector);
+
+    if (mStatus == DRM_MODE_CONNECTED) {
+        if (!loadEdid(drmFd)) {
+            return false;
+        }
+    }
+
+    DEBUG_LOG("%s: connector:%" PRIu32 " widthMillimeters:%" PRIu32 " heightMillimeters:%" PRIu32,
+              __FUNCTION__, mId, mWidthMillimeters, mHeightMillimeters);
+
+    return true;
+}
+
+bool DrmConnector::loadEdid(::android::base::borrowed_fd drmFd) {
+    DEBUG_LOG("%s: display:%" PRIu32, __FUNCTION__, mId);
+
+    mWidthMillimeters = 0;
+    mHeightMillimeters = 0;
+
+    const uint64_t edidBlobId = mEdidProp.getValue();
+    if (edidBlobId == -1) {
+        ALOGW("%s: display:%" PRIu32 " does not have EDID.", __FUNCTION__, mId);
+        return true;
+    }
+
+    auto blob = drmModeGetPropertyBlob(drmFd.get(), edidBlobId);
+    if (!blob) {
+        ALOGE("%s: display:%" PRIu32 " failed to read EDID blob (%" PRIu64 "): %s", __FUNCTION__,
+              mId, edidBlobId, strerror(errno));
+        return false;
+    }
+
+    const uint8_t* blobStart = static_cast<uint8_t*>(blob->data);
+    mEdid = std::vector<uint8_t>(blobStart, blobStart + blob->length);
+
+    drmModeFreePropertyBlob(blob);
+
+    using byte_view = std::basic_string_view<uint8_t>;
+
+    constexpr size_t kEdidDescriptorOffset = 54;
+    constexpr size_t kEdidDescriptorLength = 18;
+
+    byte_view edid(mEdid->data(), mEdid->size());
+    edid.remove_prefix(kEdidDescriptorOffset);
+
+    byte_view descriptor(edid.data(), kEdidDescriptorLength);
+    if (descriptor[0] == 0 && descriptor[1] == 0) {
+        ALOGE("%s: display:%" PRIu32 " is missing preferred detailed timing descriptor.",
+              __FUNCTION__, mId);
+        return -1;
+    }
+
+    const uint8_t w_mm_lsb = descriptor[12];
+    const uint8_t h_mm_lsb = descriptor[13];
+    const uint8_t w_and_h_mm_msb = descriptor[14];
+
+    mWidthMillimeters = w_mm_lsb | (w_and_h_mm_msb & 0xf0) << 4;
+    mHeightMillimeters = h_mm_lsb | (w_and_h_mm_msb & 0xf) << 8;
+
+    return true;
+}
+
+uint32_t DrmConnector::getWidth() const {
+    DEBUG_LOG("%s: connector:%" PRIu32, __FUNCTION__, mId);
+
+    if (mModes.empty()) {
+        return 0;
+    }
+    return mModes[0]->hdisplay;
+}
+
+uint32_t DrmConnector::getHeight() const {
+    DEBUG_LOG("%s: connector:%" PRIu32, __FUNCTION__, mId);
+
+    if (mModes.empty()) {
+        return 0;
+    }
+    return mModes[0]->vdisplay;
+}
+
+int32_t DrmConnector::getDpiX() const {
+    DEBUG_LOG("%s: connector:%" PRIu32, __FUNCTION__, mId);
+
+    if (mModes.empty()) {
+        return -1;
+    }
+
+    const auto& mode = mModes[0];
+    if (mWidthMillimeters) {
+        const int32_t dpi = static_cast<int32_t>(
+            (static_cast<float>(mode->hdisplay) / static_cast<float>(mWidthMillimeters)) *
+            kMillimetersPerInch);
+        DEBUG_LOG("%s: connector:%" PRIu32 " has dpi-x:%" PRId32, __FUNCTION__, mId, dpi);
+        return dpi;
+    }
+
+    return -1;
+}
+
+int32_t DrmConnector::getDpiY() const {
+    DEBUG_LOG("%s: connector:%" PRIu32, __FUNCTION__, mId);
+
+    if (mModes.empty()) {
+        return -1;
+    }
+
+    const auto& mode = mModes[0];
+    if (mHeightMillimeters) {
+        const int32_t dpi = static_cast<int32_t>(
+            (static_cast<float>(mode->vdisplay) / static_cast<float>(mHeightMillimeters)) *
+            kMillimetersPerInch);
+        DEBUG_LOG("%s: connector:%" PRIu32 " has dpi-x:%" PRId32, __FUNCTION__, mId, dpi);
+        return dpi;
+    }
+
+    return -1;
+}
+
+float DrmConnector::getRefreshRate() const {
+    DEBUG_LOG("%s: connector:%" PRIu32, __FUNCTION__, mId);
+
+    if (!mModes.empty()) {
+        const auto& mode = mModes[0];
+        return 1000.0f * mode->clock / ((float)mode->vtotal * (float)mode->htotal);
+    }
+
+    return -1.0f;
+}
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/DrmConnector.h b/system/hwc3/DrmConnector.h
new file mode 100644
index 0000000..624d38c
--- /dev/null
+++ b/system/hwc3/DrmConnector.h
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <android-base/logging.h>
+#include <android-base/unique_fd.h>
+#include <xf86drm.h>
+#include <xf86drmMode.h>
+
+#include <cstdint>
+#include <memory>
+#include <string>
+#include <unordered_map>
+
+#include "Common.h"
+#include "DrmMode.h"
+#include "DrmProperty.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+// A "cable" to the display (HDMI, DisplayPort, etc).
+class DrmConnector {
+   public:
+    static std::unique_ptr<DrmConnector> create(::android::base::borrowed_fd drmFd,
+                                                uint32_t connectorId);
+    ~DrmConnector(){};
+
+    uint32_t getId() const { return mId; }
+
+    uint32_t getWidth() const;
+    uint32_t getHeight() const;
+
+    int32_t getDpiX() const;
+    int32_t getDpiY() const;
+
+    float getRefreshRate() const;
+    uint32_t getRefreshRateUint() const { return (uint32_t)(getRefreshRate() + 0.5f); }
+
+    bool isConnected() const { return mStatus == DRM_MODE_CONNECTED; }
+
+    std::optional<std::vector<uint8_t>> getEdid() const { return mEdid; }
+
+    const DrmProperty& getCrtcProperty() const { return mCrtc; }
+    const DrmMode* getDefaultMode() const { return mModes[0].get(); }
+
+    bool update(::android::base::borrowed_fd drmFd);
+
+   private:
+    DrmConnector(uint32_t id) : mId(id) {}
+
+    bool loadEdid(::android::base::borrowed_fd drmFd);
+
+    const uint32_t mId;
+
+    drmModeConnection mStatus = DRM_MODE_UNKNOWNCONNECTION;
+    uint32_t mWidthMillimeters = -1;
+    uint32_t mHeightMillimeters = -1;
+    std::vector<std::unique_ptr<DrmMode>> mModes;
+
+    DrmProperty mCrtc;
+    DrmProperty mEdidProp;
+    std::optional<std::vector<uint8_t>> mEdid;
+
+    static const auto& GetPropertiesMap() {
+        static const auto* sMap = []() {
+            return new DrmPropertyMemberMap<DrmConnector>{
+                {"CRTC_ID", &DrmConnector::mCrtc},
+                {"EDID", &DrmConnector::mEdidProp},
+            };
+        }();
+        return *sMap;
+    }
+};
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/DrmCrtc.cpp b/system/hwc3/DrmCrtc.cpp
new file mode 100644
index 0000000..4648a9f
--- /dev/null
+++ b/system/hwc3/DrmCrtc.cpp
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "DrmCrtc.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+std::unique_ptr<DrmCrtc> DrmCrtc::create(::android::base::borrowed_fd drmFd, uint32_t crtcId,
+                                         uint32_t crtcIndexInResourcesArray) {
+    std::unique_ptr<DrmCrtc> crtc(new DrmCrtc(crtcId, crtcIndexInResourcesArray));
+
+    DEBUG_LOG("%s: Loading properties for crtc:%" PRIu32, __FUNCTION__, crtcId);
+    if (!LoadDrmProperties(drmFd, crtcId, DRM_MODE_OBJECT_CRTC, GetPropertiesMap(), crtc.get())) {
+        ALOGE("%s: Failed to load crtc properties.", __FUNCTION__);
+        return nullptr;
+    }
+
+    return crtc;
+}
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/DrmCrtc.h b/system/hwc3/DrmCrtc.h
new file mode 100644
index 0000000..947ff51
--- /dev/null
+++ b/system/hwc3/DrmCrtc.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <android-base/logging.h>
+#include <android-base/unique_fd.h>
+#include <xf86drm.h>
+#include <xf86drmMode.h>
+
+#include <cstdint>
+#include <memory>
+#include <string>
+#include <unordered_map>
+
+#include "Common.h"
+#include "DrmProperty.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+class DrmCrtc {
+   public:
+    static std::unique_ptr<DrmCrtc> create(::android::base::borrowed_fd drmFd, uint32_t crtcId,
+                                           uint32_t crtcIndexInResourcesArray);
+    ~DrmCrtc() {}
+
+    uint32_t getId() const { return mId; }
+
+    const DrmProperty& getActiveProperty() const { return mActive; }
+    const DrmProperty& getModeProperty() const { return mMode; }
+    const DrmProperty& getOutFenceProperty() const { return mOutFence; }
+
+   private:
+    DrmCrtc(uint32_t id, uint32_t index) : mId(id), mIndexInResourcesArray(index) {}
+
+    friend class DrmPlane;
+
+    const uint32_t mId = -1;
+    const uint32_t mIndexInResourcesArray = -1;
+
+    DrmProperty mActive;
+    DrmProperty mMode;
+    DrmProperty mOutFence;
+
+    static const auto& GetPropertiesMap() {
+        static const auto* sMap = []() {
+            return new DrmPropertyMemberMap<DrmCrtc>{
+                {"ACTIVE", &DrmCrtc::mActive},
+                {"MODE_ID", &DrmCrtc::mMode},
+                {"OUT_FENCE_PTR", &DrmCrtc::mOutFence},
+            };
+        }();
+        return *sMap;
+    }
+};
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/DrmDisplay.cpp b/system/hwc3/DrmDisplay.cpp
new file mode 100644
index 0000000..a1edb10
--- /dev/null
+++ b/system/hwc3/DrmDisplay.cpp
@@ -0,0 +1,182 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "DrmDisplay.h"
+
+#include "DrmAtomicRequest.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+namespace {
+
+template <typename T>
+uint64_t addressAsUint(T* pointer) {
+    return static_cast<uint64_t>(reinterpret_cast<uintptr_t>(pointer));
+}
+
+}  // namespace
+
+std::unique_ptr<DrmDisplay> DrmDisplay::create(uint32_t id, std::unique_ptr<DrmConnector> connector,
+                                               std::unique_ptr<DrmCrtc> crtc,
+                                               std::unique_ptr<DrmPlane> plane,
+                                               ::android::base::borrowed_fd drmFd) {
+    if (!crtc) {
+        ALOGE("%s: invalid crtc.", __FUNCTION__);
+        return nullptr;
+    }
+    if (!connector) {
+        ALOGE("%s: invalid connector.", __FUNCTION__);
+        return nullptr;
+    }
+    if (!plane) {
+        ALOGE("%s: invalid plane.", __FUNCTION__);
+        return nullptr;
+    }
+
+    if (connector->isConnected()) {
+        auto request = DrmAtomicRequest::create();
+        if (!request) {
+            ALOGE("%s: failed to create atomic request.", __FUNCTION__);
+            return nullptr;
+        }
+
+        bool okay = true;
+        okay &= request->Set(connector->getId(), connector->getCrtcProperty(), crtc->getId());
+        okay &= request->Set(crtc->getId(), crtc->getActiveProperty(), 1);
+        okay &= request->Set(crtc->getId(), crtc->getModeProperty(),
+                             connector->getDefaultMode()->getBlobId());
+        okay &= request->Commit(drmFd);
+        if (!okay) {
+            ALOGE("%s: failed to set display mode.", __FUNCTION__);
+            return nullptr;
+        }
+    }
+
+    return std::unique_ptr<DrmDisplay>(
+        new DrmDisplay(id, std::move(connector), std::move(crtc), std::move(plane)));
+}
+
+std::tuple<HWC3::Error, ::android::base::unique_fd> DrmDisplay::flush(
+    ::android::base::borrowed_fd drmFd, ::android::base::borrowed_fd inSyncFd,
+    const std::shared_ptr<DrmBuffer>& buffer) {
+    std::unique_ptr<DrmAtomicRequest> request = DrmAtomicRequest::create();
+    if (!request) {
+        ALOGE("%s: failed to create atomic request.", __FUNCTION__);
+        return std::make_tuple(HWC3::Error::NoResources, ::android::base::unique_fd());
+    }
+
+    int flushFenceFd = -1;
+
+    bool okay = true;
+    okay &=
+        request->Set(mCrtc->getId(), mCrtc->getOutFenceProperty(), addressAsUint(&flushFenceFd));
+    okay &= request->Set(mPlane->getId(), mPlane->getCrtcProperty(), mCrtc->getId());
+    okay &= request->Set(mPlane->getId(), mPlane->getInFenceProperty(), inSyncFd.get());
+    okay &= request->Set(mPlane->getId(), mPlane->getFbProperty(), *buffer->mDrmFramebuffer);
+    okay &= request->Set(mPlane->getId(), mPlane->getCrtcXProperty(), 0);
+    okay &= request->Set(mPlane->getId(), mPlane->getCrtcYProperty(), 0);
+    okay &= request->Set(mPlane->getId(), mPlane->getCrtcWProperty(), buffer->mWidth);
+    okay &= request->Set(mPlane->getId(), mPlane->getCrtcHProperty(), buffer->mHeight);
+    okay &= request->Set(mPlane->getId(), mPlane->getSrcXProperty(), 0);
+    okay &= request->Set(mPlane->getId(), mPlane->getSrcYProperty(), 0);
+    okay &= request->Set(mPlane->getId(), mPlane->getSrcWProperty(), buffer->mWidth << 16);
+    okay &= request->Set(mPlane->getId(), mPlane->getSrcHProperty(), buffer->mHeight << 16);
+
+    okay &= request->Commit(drmFd);
+    if (!okay) {
+        ALOGE("%s: failed to flush to display.", __FUNCTION__);
+        return std::make_tuple(HWC3::Error::NoResources, ::android::base::unique_fd());
+    }
+
+    mPreviousBuffer = buffer;
+
+    DEBUG_LOG("%s: submitted atomic update, flush fence:%d\n", __FUNCTION__, flushFenceFd);
+    return std::make_tuple(HWC3::Error::None, ::android::base::unique_fd(flushFenceFd));
+}
+
+bool DrmDisplay::onConnect(::android::base::borrowed_fd drmFd) {
+    DEBUG_LOG("%s: display:%" PRIu32, __FUNCTION__, mId);
+
+    auto request = DrmAtomicRequest::create();
+    if (!request) {
+        ALOGE("%s: display:%" PRIu32 " failed to create atomic request.", __FUNCTION__, mId);
+        return false;
+    }
+
+    bool okay = true;
+    okay &= request->Set(mConnector->getId(), mConnector->getCrtcProperty(), mCrtc->getId());
+    okay &= request->Set(mCrtc->getId(), mCrtc->getActiveProperty(), 1);
+    okay &= request->Set(mCrtc->getId(), mCrtc->getModeProperty(),
+                         mConnector->getDefaultMode()->getBlobId());
+
+    okay &= request->Commit(drmFd);
+    if (!okay) {
+        ALOGE("%s: display:%" PRIu32 " failed to set mode.", __FUNCTION__, mId);
+        return false;
+    }
+
+    return true;
+}
+
+bool DrmDisplay::onDisconnect(::android::base::borrowed_fd drmFd) {
+    DEBUG_LOG("%s: display:%" PRIu32, __FUNCTION__, mId);
+
+    auto request = DrmAtomicRequest::create();
+    if (!request) {
+        ALOGE("%s: display:%" PRIu32 " failed to create atomic request.", __FUNCTION__, mId);
+        return false;
+    }
+
+    bool okay = true;
+    okay &= request->Set(mPlane->getId(), mPlane->getCrtcProperty(), 0);
+    okay &= request->Set(mPlane->getId(), mPlane->getFbProperty(), 0);
+
+    okay &= request->Commit(drmFd);
+    if (!okay) {
+        ALOGE("%s: display:%" PRIu32 " failed to set mode", __FUNCTION__, mId);
+    }
+
+    mPreviousBuffer.reset();
+
+    return okay;
+}
+
+DrmHotplugChange DrmDisplay::checkAndHandleHotplug(::android::base::borrowed_fd drmFd) {
+    DEBUG_LOG("%s: display:%" PRIu32, __FUNCTION__, mId);
+
+    const bool oldConnected = mConnector->isConnected();
+    mConnector->update(drmFd);
+    const bool newConnected = mConnector->isConnected();
+
+    if (oldConnected == newConnected) {
+        return DrmHotplugChange::kNoChange;
+    }
+
+    if (newConnected) {
+        ALOGI("%s: display:%" PRIu32 " was connected.", __FUNCTION__, mId);
+        if (!onConnect(drmFd)) {
+            ALOGE("%s: display:%" PRIu32 " failed to connect.", __FUNCTION__, mId);
+        }
+        return DrmHotplugChange::kConnected;
+    } else {
+        ALOGI("%s: display:%" PRIu32 " was disconnected.", __FUNCTION__, mId);
+        if (!onDisconnect(drmFd)) {
+            ALOGE("%s: display:%" PRIu32 " failed to disconnect.", __FUNCTION__, mId);
+        }
+        return DrmHotplugChange::kDisconnected;
+    }
+}
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/DrmDisplay.h b/system/hwc3/DrmDisplay.h
new file mode 100644
index 0000000..0a349c7
--- /dev/null
+++ b/system/hwc3/DrmDisplay.h
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <android-base/logging.h>
+#include <android-base/unique_fd.h>
+#include <xf86drm.h>
+#include <xf86drmMode.h>
+
+#include <cstdint>
+#include <memory>
+#include <string>
+#include <unordered_map>
+
+#include "Common.h"
+#include "DrmBuffer.h"
+#include "DrmConnector.h"
+#include "DrmCrtc.h"
+#include "DrmPlane.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+enum class DrmHotplugChange {
+    kNoChange,
+    kConnected,
+    kDisconnected,
+};
+
+class DrmDisplay {
+   public:
+    static std::unique_ptr<DrmDisplay> create(uint32_t id, std::unique_ptr<DrmConnector> connector,
+                                              std::unique_ptr<DrmCrtc> crtc,
+                                              std::unique_ptr<DrmPlane> plane,
+                                              ::android::base::borrowed_fd drmFd);
+
+    uint32_t getId() const { return mId; }
+
+    uint32_t getWidth() const { return mConnector->getWidth(); }
+    uint32_t getHeight() const { return mConnector->getHeight(); }
+
+    uint32_t getDpiX() const { return mConnector->getDpiX(); }
+    uint32_t getDpiY() const { return mConnector->getDpiY(); }
+
+    uint32_t getRefreshRateUint() const { return mConnector->getRefreshRateUint(); }
+
+    bool isConnected() const { return mConnector->isConnected(); }
+
+    std::optional<std::vector<uint8_t>> getEdid() const { return mConnector->getEdid(); }
+
+    std::tuple<HWC3::Error, ::android::base::unique_fd> flush(
+        ::android::base::borrowed_fd drmFd, ::android::base::borrowed_fd inWaitSyncFd,
+        const std::shared_ptr<DrmBuffer>& buffer);
+
+    DrmHotplugChange checkAndHandleHotplug(::android::base::borrowed_fd drmFd);
+
+   private:
+    DrmDisplay(uint32_t id, std::unique_ptr<DrmConnector> connector, std::unique_ptr<DrmCrtc> crtc,
+               std::unique_ptr<DrmPlane> plane)
+        : mId(id),
+          mConnector(std::move(connector)),
+          mCrtc(std::move(crtc)),
+          mPlane(std::move(plane)) {}
+
+    bool onConnect(::android::base::borrowed_fd drmFd);
+
+    bool onDisconnect(::android::base::borrowed_fd drmFd);
+
+    const uint32_t mId;
+    std::unique_ptr<DrmConnector> mConnector;
+    std::unique_ptr<DrmCrtc> mCrtc;
+    std::unique_ptr<DrmPlane> mPlane;
+
+    // The last presented buffer / DRM framebuffer is cached until
+    // the next present to avoid toggling the display on and off.
+    std::shared_ptr<DrmBuffer> mPreviousBuffer;
+};
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/DrmEventListener.cpp b/system/hwc3/DrmEventListener.cpp
new file mode 100644
index 0000000..208824b
--- /dev/null
+++ b/system/hwc3/DrmEventListener.cpp
@@ -0,0 +1,103 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "DrmEventListener.h"
+
+#include <linux/netlink.h>
+#include <sys/socket.h>
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+std::unique_ptr<DrmEventListener> DrmEventListener::create(::android::base::borrowed_fd drmFd,
+                                                           std::function<void()> callback) {
+    std::unique_ptr<DrmEventListener> listener(new DrmEventListener(std::move(callback)));
+
+    if (!listener->init(drmFd)) {
+        return nullptr;
+    }
+
+    return listener;
+}
+
+bool DrmEventListener::init(::android::base::borrowed_fd drmFd) {
+    mEventFd = ::android::base::unique_fd(socket(PF_NETLINK, SOCK_DGRAM, NETLINK_KOBJECT_UEVENT));
+    if (!mEventFd.ok()) {
+        ALOGE("Failed to open uevent socket: %s", strerror(errno));
+        return false;
+    }
+    struct sockaddr_nl addr;
+    memset(&addr, 0, sizeof(addr));
+    addr.nl_family = AF_NETLINK;
+    addr.nl_pid = 0;
+    addr.nl_groups = 0xFFFFFFFF;
+
+    int ret = bind(mEventFd, (struct sockaddr*)&addr, sizeof(addr));
+    if (ret) {
+        ALOGE("Failed to bind uevent socket: %s", strerror(errno));
+        return false;
+    }
+
+    FD_ZERO(&mMonitoredFds);
+    FD_SET(drmFd.get(), &mMonitoredFds);
+    FD_SET(mEventFd.get(), &mMonitoredFds);
+    mMaxMonitoredFd = std::max(drmFd.get(), mEventFd.get());
+
+    mThread = std::thread([this]() { threadLoop(); });
+
+    return true;
+}
+
+void DrmEventListener::threadLoop() {
+    int ret;
+    do {
+        ret = select(mMaxMonitoredFd + 1, &mMonitoredFds, NULL, NULL, NULL);
+    } while (ret == -1 && errno == EINTR);
+
+    if (!FD_ISSET(mEventFd.get(), &mMonitoredFds)) {
+        ALOGE("%s: DrmEventListevener event fd unset?", __FUNCTION__);
+        return;
+    }
+
+    char buffer[1024];
+    while (true) {
+        ret = read(mEventFd.get(), &buffer, sizeof(buffer));
+        if (ret == 0) {
+            return;
+        } else if (ret < 0) {
+            ALOGE("Got error reading uevent %d", ret);
+            return;
+        }
+
+        bool drmEvent = false, hotplugEvent = false;
+        for (int i = 0; i < ret;) {
+            char* event = buffer + i;
+            if (strcmp(event, "DEVTYPE=drm_minor")) {
+                drmEvent = true;
+            } else if (strcmp(event, "HOTPLUG=1")) {
+                hotplugEvent = true;
+            }
+
+            i += strlen(event) + 1;
+        }
+
+        if (drmEvent && hotplugEvent) {
+            DEBUG_LOG("DrmEventListener detected hotplug event .");
+            mOnEventCallback();
+        }
+    }
+}
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/DrmEventListener.h b/system/hwc3/DrmEventListener.h
new file mode 100644
index 0000000..4ab29b6
--- /dev/null
+++ b/system/hwc3/DrmEventListener.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <android-base/logging.h>
+#include <android-base/unique_fd.h>
+#include <xf86drm.h>
+#include <xf86drmMode.h>
+
+#include <cstdint>
+#include <functional>
+#include <optional>
+#include <thread>
+#include <unordered_map>
+
+#include "Common.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+class DrmEventListener {
+   public:
+    static std::unique_ptr<DrmEventListener> create(::android::base::borrowed_fd drmFd,
+                                                    std::function<void()> callback);
+
+    ~DrmEventListener() {}
+
+   private:
+    DrmEventListener(std::function<void()> callback) : mOnEventCallback(std::move(callback)) {}
+
+    bool init(::android::base::borrowed_fd drmFd);
+
+    void threadLoop();
+
+    std::thread mThread;
+    std::function<void()> mOnEventCallback;
+    ::android::base::unique_fd mEventFd;
+    fd_set mMonitoredFds;
+    int mMaxMonitoredFd = 0;
+};
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/DrmMode.cpp b/system/hwc3/DrmMode.cpp
new file mode 100644
index 0000000..d65f0cc
--- /dev/null
+++ b/system/hwc3/DrmMode.cpp
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "DrmMode.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+std::unique_ptr<DrmMode> DrmMode::create(::android::base::borrowed_fd drmFd,
+                                         const drmModeModeInfo& info) {
+    uint32_t blobId = 0;
+
+    int ret = drmModeCreatePropertyBlob(drmFd.get(), &info, sizeof(info), &blobId);
+    if (ret != 0) {
+        ALOGE("%s: Failed to create mode blob: %s.", __FUNCTION__, strerror(errno));
+        return nullptr;
+    }
+
+    return std::unique_ptr<DrmMode>(new DrmMode(info, blobId));
+}
+
+DrmMode::~DrmMode() {
+    // TODO: don't leak the blob.
+}
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/DrmMode.h b/system/hwc3/DrmMode.h
new file mode 100644
index 0000000..23b170d
--- /dev/null
+++ b/system/hwc3/DrmMode.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <android-base/logging.h>
+#include <android-base/unique_fd.h>
+#include <xf86drm.h>
+#include <xf86drmMode.h>
+
+#include <cstdint>
+#include <memory>
+
+#include "Common.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+class DrmMode {
+   public:
+    static std::unique_ptr<DrmMode> create(::android::base::borrowed_fd drmFd,
+                                           const drmModeModeInfo& info);
+
+    ~DrmMode();
+
+    const uint32_t clock;
+    const uint16_t hdisplay;
+    const uint16_t hsync_start;
+    const uint16_t hsync_end;
+    const uint16_t htotal;
+    const uint16_t hskew;
+    const uint16_t vdisplay;
+    const uint16_t vsync_start;
+    const uint16_t vsync_end;
+    const uint16_t vtotal;
+    const uint16_t vscan;
+    const uint32_t vrefresh;
+    const uint32_t flags;
+    const uint32_t type;
+    const std::string name;
+
+    uint32_t getBlobId() const { return mBlobId; }
+
+   private:
+    DrmMode(const drmModeModeInfo& info, uint32_t blobId)
+        : clock(info.clock),
+          hdisplay(info.hdisplay),
+          hsync_start(info.hsync_start),
+          hsync_end(info.hsync_end),
+          htotal(info.htotal),
+          hskew(info.hskew),
+          vdisplay(info.vdisplay),
+          vsync_start(info.vsync_start),
+          vsync_end(info.vsync_end),
+          vtotal(info.vtotal),
+          vscan(info.vscan),
+          vrefresh(info.vrefresh),
+          flags(info.flags),
+          type(info.type),
+          name(info.name),
+          mBlobId(blobId) {}
+
+    const uint32_t mBlobId;
+};
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/DrmPlane.cpp b/system/hwc3/DrmPlane.cpp
new file mode 100644
index 0000000..f2027ee
--- /dev/null
+++ b/system/hwc3/DrmPlane.cpp
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "DrmPlane.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+std::unique_ptr<DrmPlane> DrmPlane::create(::android::base::borrowed_fd drmFd, uint32_t planeId) {
+    std::unique_ptr<DrmPlane> plane(new DrmPlane(planeId));
+
+    DEBUG_LOG("%s: Loading properties for DRM plane:%" PRIu32, __FUNCTION__, planeId);
+    if (!LoadDrmProperties(drmFd, planeId, DRM_MODE_OBJECT_PLANE, GetPropertiesMap(),
+                           plane.get())) {
+        ALOGE("%s: Failed to load plane properties.", __FUNCTION__);
+        return nullptr;
+    }
+
+    drmModePlanePtr drmPlane = drmModeGetPlane(drmFd.get(), planeId);
+    plane->mPossibleCrtcsMask = drmPlane->possible_crtcs;
+    drmModeFreePlane(drmPlane);
+
+    return plane;
+}
+
+bool DrmPlane::isPrimary() const { return mType.getValue() == DRM_PLANE_TYPE_PRIMARY; }
+
+bool DrmPlane::isOverlay() const { return mType.getValue() == DRM_PLANE_TYPE_OVERLAY; }
+
+bool DrmPlane::isCompatibleWith(const DrmCrtc& crtc) {
+    return ((0x1 << crtc.mIndexInResourcesArray) & mPossibleCrtcsMask);
+}
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/DrmPlane.h b/system/hwc3/DrmPlane.h
new file mode 100644
index 0000000..b244756
--- /dev/null
+++ b/system/hwc3/DrmPlane.h
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <android-base/logging.h>
+#include <android-base/unique_fd.h>
+#include <xf86drm.h>
+#include <xf86drmMode.h>
+
+#include <cstdint>
+#include <memory>
+#include <string>
+#include <unordered_map>
+
+#include "Common.h"
+#include "DrmCrtc.h"
+#include "DrmProperty.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+class DrmPlane {
+   public:
+    static std::unique_ptr<DrmPlane> create(::android::base::borrowed_fd drmFd, uint32_t planeId);
+    ~DrmPlane(){};
+
+    uint32_t getId() const { return mId; }
+
+    bool isPrimary() const;
+    bool isOverlay() const;
+
+    bool isCompatibleWith(const DrmCrtc& crtc);
+
+    const DrmProperty& getCrtcProperty() const { return mCrtc; }
+    const DrmProperty& getInFenceProperty() const { return mInFenceFd; }
+    const DrmProperty& getFbProperty() const { return mFb; }
+    const DrmProperty& getCrtcXProperty() const { return mCrtcX; }
+    const DrmProperty& getCrtcYProperty() const { return mCrtcY; }
+    const DrmProperty& getCrtcWProperty() const { return mCrtcW; }
+    const DrmProperty& getCrtcHProperty() const { return mCrtcH; }
+    const DrmProperty& getSrcXProperty() const { return mSrcX; }
+    const DrmProperty& getSrcYProperty() const { return mSrcY; }
+    const DrmProperty& getSrcWProperty() const { return mSrcW; }
+    const DrmProperty& getSrcHProperty() const { return mSrcH; }
+
+   private:
+    DrmPlane(uint32_t id) : mId(id){};
+
+    const uint32_t mId;
+
+    uint32_t mPossibleCrtcsMask = 0;
+
+    DrmProperty mCrtc;
+    DrmProperty mInFenceFd;
+    DrmProperty mFb;
+    DrmProperty mCrtcX;
+    DrmProperty mCrtcY;
+    DrmProperty mCrtcW;
+    DrmProperty mCrtcH;
+    DrmProperty mSrcX;
+    DrmProperty mSrcY;
+    DrmProperty mSrcW;
+    DrmProperty mSrcH;
+    DrmProperty mType;
+
+    static const auto& GetPropertiesMap() {
+        static const auto* sMap = []() {
+            return new DrmPropertyMemberMap<DrmPlane>{
+                {"CRTC_ID", &DrmPlane::mCrtc},
+                {"CRTC_X", &DrmPlane::mCrtcX},
+                {"CRTC_Y", &DrmPlane::mCrtcY},
+                {"CRTC_W", &DrmPlane::mCrtcW},
+                {"CRTC_H", &DrmPlane::mCrtcH},
+                {"FB_ID", &DrmPlane::mFb},
+                {"IN_FENCE_FD", &DrmPlane::mInFenceFd},
+                {"SRC_X", &DrmPlane::mSrcX},
+                {"SRC_Y", &DrmPlane::mSrcY},
+                {"SRC_W", &DrmPlane::mSrcW},
+                {"SRC_H", &DrmPlane::mSrcH},
+                {"type", &DrmPlane::mType},
+            };
+        }();
+        return *sMap;
+    }
+};
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/DrmProperty.h b/system/hwc3/DrmProperty.h
new file mode 100644
index 0000000..9e7b798
--- /dev/null
+++ b/system/hwc3/DrmProperty.h
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <android-base/logging.h>
+#include <android-base/unique_fd.h>
+#include <xf86drm.h>
+#include <xf86drmMode.h>
+
+#include <cstdint>
+#include <string>
+#include <unordered_map>
+
+#include "Common.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+class DrmProperty {
+   public:
+    DrmProperty() {}
+    DrmProperty(uint32_t id, uint64_t value, std::string name)
+        : mId(id), mValue(value), mName(name) {}
+
+    ~DrmProperty() {}
+
+    uint32_t getId() const { return mId; }
+
+    uint64_t getValue() const { return mValue; }
+
+    const std::string& getName() const { return mName; }
+
+   private:
+    uint32_t mId = -1;
+    uint64_t mValue = -1;
+    std::string mName;
+};
+
+template <typename T>
+using DrmPropertyMember = DrmProperty T::*;
+
+template <typename T>
+using DrmPropertyMemberMap = std::unordered_map<std::string, DrmPropertyMember<T>>;
+
+// Helper to many DrmProperty members for DrmCrtc, DrmConnector, and DrmPlane.
+template <typename T>
+bool LoadDrmProperties(::android::base::borrowed_fd drmFd, uint32_t objectId, uint32_t objectType,
+                       const DrmPropertyMemberMap<T>& objectPropertyMap, T* object) {
+    auto drmProperties = drmModeObjectGetProperties(drmFd.get(), objectId, objectType);
+    if (!drmProperties) {
+        ALOGE("%s: Failed to get properties: %s", __FUNCTION__, strerror(errno));
+        return false;
+    }
+
+    for (uint32_t i = 0; i < drmProperties->count_props; ++i) {
+        const auto propertyId = drmProperties->props[i];
+
+        auto drmProperty = drmModeGetProperty(drmFd.get(), propertyId);
+        if (!drmProperty) {
+            ALOGE("%s: Failed to get property: %s", __FUNCTION__, strerror(errno));
+            continue;
+        }
+
+        const auto propertyName = drmProperty->name;
+        const auto propertyValue = drmProperties->prop_values[i];
+
+        auto it = objectPropertyMap.find(propertyName);
+        if (it != objectPropertyMap.end()) {
+            DEBUG_LOG("%s: Loaded property:%" PRIu32 " (%s) val:%" PRIu64, __FUNCTION__, propertyId,
+                      propertyName, propertyValue);
+
+            auto& objectPointerToMember = it->second;
+            object->*objectPointerToMember = DrmProperty(propertyId, propertyValue, propertyName);
+        }
+
+        drmModeFreeProperty(drmProperty);
+    }
+
+    drmModeFreeObjectProperties(drmProperties);
+
+    return true;
+}
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/FencedBuffer.h b/system/hwc3/FencedBuffer.h
new file mode 100644
index 0000000..50e8534
--- /dev/null
+++ b/system/hwc3/FencedBuffer.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_HWC_FENCEDBUFFER_H
+#define ANDROID_HWC_FENCEDBUFFER_H
+
+#include <aidlcommonsupport/NativeHandle.h>
+#include <android-base/unique_fd.h>
+#include <cutils/native_handle.h>
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+class FencedBuffer {
+ public:
+  FencedBuffer() : mBuffer(nullptr) {}
+
+  void set(buffer_handle_t buffer, const ndk::ScopedFileDescriptor& fence) {
+    mBuffer = buffer;
+    mFence = GetUniqueFd(fence);
+  }
+
+  buffer_handle_t getBuffer() const { return mBuffer; }
+
+  ::android::base::unique_fd getFence() const {
+    if (mFence.ok()) {
+      return ::android::base::unique_fd(dup(mFence.get()));
+    } else {
+      return ::android::base::unique_fd();
+    }
+  }
+
+ private:
+  static ::android::base::unique_fd GetUniqueFd(
+      const ndk::ScopedFileDescriptor& in) {
+    auto& sfd = const_cast<ndk::ScopedFileDescriptor&>(in);
+    ::android::base::unique_fd ret(sfd.get());
+    *sfd.getR() = -1;
+    return ret;
+  }
+
+  buffer_handle_t mBuffer;
+  ::android::base::unique_fd mFence;
+};
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
+
+#endif
diff --git a/system/hwc3/FrameComposer.h b/system/hwc3/FrameComposer.h
new file mode 100644
index 0000000..70e0f00
--- /dev/null
+++ b/system/hwc3/FrameComposer.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_HWC_COMPOSER_H
+#define ANDROID_HWC_COMPOSER_H
+
+#include <android-base/unique_fd.h>
+
+#include <functional>
+#include <tuple>
+#include <unordered_map>
+#include <vector>
+
+#include "Common.h"
+#include "DisplayChanges.h"
+#include "DrmClient.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+class Display;
+
+class FrameComposer {
+ public:
+  virtual ~FrameComposer() {}
+
+  virtual HWC3::Error init() = 0;
+
+  using HotplugCallback = std::function<void(bool /*connected*/,   //
+                                             uint32_t /*id*/,      //
+                                             uint32_t /*width*/,   //
+                                             uint32_t /*height*/,  //
+                                             uint32_t /*dpiX*/,    //
+                                             uint32_t /*dpiY*/,    //
+                                             uint32_t /*refreshRate*/)>;
+
+  virtual HWC3::Error registerOnHotplugCallback(const HotplugCallback& cb) = 0;
+
+  virtual HWC3::Error unregisterOnHotplugCallback() = 0;
+
+  virtual HWC3::Error onDisplayCreate(Display* display) = 0;
+
+  virtual HWC3::Error onDisplayDestroy(Display* display) = 0;
+
+  virtual HWC3::Error onDisplayClientTargetSet(Display* display) = 0;
+
+  // Determines if this composer can compose the given layers and requests
+  // changes for layers that can't not be composed.
+  virtual HWC3::Error validateDisplay(Display* display,
+                                      DisplayChanges* outChanges) = 0;
+
+  // Performs the actual composition of layers and presents the composed result
+  // to the display.
+  virtual HWC3::Error presentDisplay(
+      Display* display, ::android::base::unique_fd* outDisplayFence,
+      std::unordered_map<int64_t, ::android::base::unique_fd>*
+          outLayerFences) = 0;
+
+  virtual HWC3::Error onActiveConfigChange(Display* display) = 0;
+
+  virtual const DrmClient* getDrmPresenter() const {
+    return nullptr;
+  }
+};
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
+
+#endif
diff --git a/system/hwc3/Gralloc.cpp b/system/hwc3/Gralloc.cpp
new file mode 100644
index 0000000..9234df4
--- /dev/null
+++ b/system/hwc3/Gralloc.cpp
@@ -0,0 +1,493 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Gralloc.h"
+
+#include <aidl/android/hardware/graphics/common/PlaneLayoutComponent.h>
+#include <aidl/android/hardware/graphics/common/PlaneLayoutComponentType.h>
+#include <drm_fourcc.h>
+#include <gralloctypes/Gralloc4.h>
+#include <hidl/ServiceManagement.h>
+#include <log/log.h>
+
+#include <algorithm>
+
+#include "Drm.h"
+
+using aidl::android::hardware::graphics::common::PlaneLayout;
+using aidl::android::hardware::graphics::common::PlaneLayoutComponent;
+using aidl::android::hardware::graphics::common::PlaneLayoutComponentType;
+using android::hardware::hidl_handle;
+using android::hardware::hidl_vec;
+using android::hardware::graphics::common::V1_2::BufferUsage;
+using android::hardware::graphics::mapper::V4_0::Error;
+using android::hardware::graphics::mapper::V4_0::IMapper;
+using MetadataType =
+    android::hardware::graphics::mapper::V4_0::IMapper::MetadataType;
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+Gralloc::Gralloc() {
+  ::android::hardware::preloadPassthroughService<IMapper>();
+
+  gralloc4_ = IMapper::getService();
+  if (gralloc4_ != nullptr) {
+    ALOGE("%s using Gralloc4.", __FUNCTION__);
+    return;
+  }
+  ALOGE("%s Gralloc4 not available.", __FUNCTION__);
+
+  ALOGE("%s No Grallocs available!", __FUNCTION__);
+}
+
+Error Gralloc::GetMetadata(buffer_handle_t buffer, MetadataType type,
+                           hidl_vec<uint8_t>* metadata) {
+  if (gralloc4_ == nullptr) {
+    ALOGE("%s Gralloc4 not available.", __FUNCTION__);
+    return Error::NO_RESOURCES;
+  }
+
+  if (metadata == nullptr) {
+    return Error::BAD_VALUE;
+  }
+
+  Error error = Error::NONE;
+
+  auto native_handle = const_cast<native_handle_t*>(buffer);
+
+  auto ret =
+      gralloc4_->get(native_handle, type,
+                     [&](const auto& get_error, const auto& get_metadata) {
+                       error = get_error;
+                       *metadata = get_metadata;
+                     });
+
+  if (!ret.isOk()) {
+    error = Error::NO_RESOURCES;
+  }
+
+  if (error != Error::NONE) {
+    ALOGE("%s failed to get metadata %s", __FUNCTION__, type.name.c_str());
+  }
+  return error;
+}
+
+std::optional<uint32_t> Gralloc::GetWidth(buffer_handle_t buffer) {
+  if (gralloc4_ == nullptr) {
+    ALOGE("%s Gralloc4 not available.", __FUNCTION__);
+    return std::nullopt;
+  }
+
+  hidl_vec<uint8_t> encoded_width;
+
+  Error error = GetMetadata(buffer, ::android::gralloc4::MetadataType_Width,
+                            &encoded_width);
+  if (error != Error::NONE) {
+    return std::nullopt;
+  }
+
+  uint64_t width = 0;
+  ::android::gralloc4::decodeWidth(encoded_width, &width);
+  return static_cast<uint32_t>(width);
+}
+
+std::optional<uint32_t> Gralloc::GetHeight(buffer_handle_t buffer) {
+  if (gralloc4_ == nullptr) {
+    ALOGE("%s Gralloc4 not available.", __FUNCTION__);
+    return std::nullopt;
+  }
+
+  hidl_vec<uint8_t> encoded_height;
+
+  Error error = GetMetadata(buffer, ::android::gralloc4::MetadataType_Height,
+                            &encoded_height);
+  if (error != Error::NONE) {
+    return std::nullopt;
+  }
+
+  uint64_t height = 0;
+  ::android::gralloc4::decodeHeight(encoded_height, &height);
+  return static_cast<uint32_t>(height);
+}
+
+std::optional<uint32_t> Gralloc::GetDrmFormat(buffer_handle_t buffer) {
+  if (gralloc4_ == nullptr) {
+    ALOGE("%s Gralloc4 not available.", __FUNCTION__);
+    return std::nullopt;
+  }
+
+  hidl_vec<uint8_t> encoded_format;
+
+  Error error =
+      GetMetadata(buffer, ::android::gralloc4::MetadataType_PixelFormatFourCC,
+                  &encoded_format);
+  if (error != Error::NONE) {
+    return std::nullopt;
+  }
+
+  uint32_t format = 0;
+  ::android::gralloc4::decodePixelFormatFourCC(encoded_format, &format);
+  return static_cast<uint32_t>(format);
+}
+
+std::optional<std::vector<PlaneLayout>> Gralloc::GetPlaneLayouts(
+    buffer_handle_t buffer) {
+  if (gralloc4_ == nullptr) {
+    ALOGE("%s Gralloc4 not available.", __FUNCTION__);
+    return std::nullopt;
+  }
+
+  hidl_vec<uint8_t> encoded_layouts;
+
+  Error error = GetMetadata(
+      buffer, ::android::gralloc4::MetadataType_PlaneLayouts, &encoded_layouts);
+  if (error != Error::NONE) {
+    return std::nullopt;
+  }
+
+  std::vector<PlaneLayout> plane_layouts;
+  ::android::gralloc4::decodePlaneLayouts(encoded_layouts, &plane_layouts);
+  return plane_layouts;
+}
+
+std::optional<uint32_t> Gralloc::GetMonoPlanarStrideBytes(
+    buffer_handle_t buffer) {
+  if (gralloc4_ == nullptr) {
+    ALOGE("%s Gralloc4 not available.", __FUNCTION__);
+    return std::nullopt;
+  }
+
+  auto plane_layouts_opt = GetPlaneLayouts(buffer);
+  if (!plane_layouts_opt) {
+    return std::nullopt;
+  }
+
+  std::vector<PlaneLayout>& plane_layouts = *plane_layouts_opt;
+  if (plane_layouts.size() != 1) {
+    return std::nullopt;
+  }
+
+  return static_cast<uint32_t>(plane_layouts[0].strideInBytes);
+}
+
+std::optional<GrallocBuffer> Gralloc::Import(buffer_handle_t buffer) {
+  if (gralloc4_ == nullptr) {
+    ALOGE("%s Gralloc4 not available.", __FUNCTION__);
+    return std::nullopt;
+  }
+
+  buffer_handle_t imported_buffer;
+
+  Error error;
+  auto ret =
+      gralloc4_->importBuffer(buffer, [&](const auto& err, const auto& buf) {
+        error = err;
+        if (err == Error::NONE) {
+          imported_buffer = static_cast<buffer_handle_t>(buf);
+        }
+      });
+
+  if (!ret.isOk() || error != Error::NONE) {
+    ALOGE("%s failed to import buffer", __FUNCTION__);
+    return std::nullopt;
+  }
+  return GrallocBuffer(this, imported_buffer);
+}
+
+void Gralloc::Release(buffer_handle_t buffer) {
+  if (gralloc4_ == nullptr) {
+    ALOGE("%s Gralloc4 not available.", __FUNCTION__);
+    return;
+  }
+
+  auto native_buffer = const_cast<native_handle_t*>(buffer);
+  auto ret = gralloc4_->freeBuffer(native_buffer);
+
+  if (!ret.isOk()) {
+    ALOGE("%s failed to release buffer", __FUNCTION__);
+  }
+}
+
+std::optional<void*> Gralloc::Lock(buffer_handle_t buffer) {
+  if (gralloc4_ == nullptr) {
+    ALOGE("%s Gralloc4 not available.", __FUNCTION__);
+    return std::nullopt;
+  }
+
+  auto native_buffer = const_cast<native_handle_t*>(buffer);
+
+  const auto buffer_usage = static_cast<uint64_t>(BufferUsage::CPU_READ_OFTEN |
+                                                  BufferUsage::CPU_WRITE_OFTEN);
+
+  auto width_opt = GetWidth(buffer);
+  if (!width_opt) {
+    return std::nullopt;
+  }
+
+  auto height_opt = GetHeight(buffer);
+  if (!height_opt) {
+    return std::nullopt;
+  }
+
+  IMapper::Rect buffer_region;
+  buffer_region.left = 0;
+  buffer_region.top = 0;
+  buffer_region.width = *width_opt;
+  buffer_region.height = *height_opt;
+
+  // Empty fence, lock immedietly.
+  hidl_handle fence;
+
+  Error error = Error::NONE;
+  void* data = nullptr;
+
+  auto ret =
+      gralloc4_->lock(native_buffer, buffer_usage, buffer_region, fence,
+                      [&](const auto& lock_error, const auto& lock_data) {
+                        error = lock_error;
+                        if (lock_error == Error::NONE) {
+                          data = lock_data;
+                        }
+                      });
+
+  if (!ret.isOk()) {
+    error = Error::NO_RESOURCES;
+  }
+
+  if (error != Error::NONE) {
+    ALOGE("%s failed to lock buffer", __FUNCTION__);
+    return std::nullopt;
+  }
+
+  return data;
+}
+
+std::optional<android_ycbcr> Gralloc::LockYCbCr(buffer_handle_t buffer) {
+  if (gralloc4_ == nullptr) {
+    ALOGE("%s Gralloc4 not available.", __FUNCTION__);
+    return std::nullopt;
+  }
+
+  auto format_opt = GetDrmFormat(buffer);
+  if (!format_opt) {
+    ALOGE("%s failed to check format of buffer", __FUNCTION__);
+    return std::nullopt;
+  }
+
+  if (*format_opt != DRM_FORMAT_NV12 && *format_opt != DRM_FORMAT_NV21 &&
+      *format_opt != DRM_FORMAT_YVU420) {
+    ALOGE("%s called on non-ycbcr buffer", __FUNCTION__);
+    return std::nullopt;
+  }
+
+  auto lock_opt = Lock(buffer);
+  if (!lock_opt) {
+    ALOGE("%s failed to lock buffer", __FUNCTION__);
+    return std::nullopt;
+  }
+
+  auto plane_layouts_opt = GetPlaneLayouts(buffer);
+  if (!plane_layouts_opt) {
+    ALOGE("%s failed to get plane layouts", __FUNCTION__);
+    return std::nullopt;
+  }
+
+  android_ycbcr buffer_ycbcr;
+  buffer_ycbcr.y = nullptr;
+  buffer_ycbcr.cb = nullptr;
+  buffer_ycbcr.cr = nullptr;
+  buffer_ycbcr.ystride = 0;
+  buffer_ycbcr.cstride = 0;
+  buffer_ycbcr.chroma_step = 0;
+
+  for (const auto& plane_layout : *plane_layouts_opt) {
+    for (const auto& plane_layout_component : plane_layout.components) {
+      const auto& type = plane_layout_component.type;
+
+      if (!::android::gralloc4::isStandardPlaneLayoutComponentType(type)) {
+        continue;
+      }
+
+      auto* component_data = reinterpret_cast<uint8_t*>(*lock_opt) +
+                             plane_layout.offsetInBytes +
+                             plane_layout_component.offsetInBits / 8;
+
+      switch (static_cast<PlaneLayoutComponentType>(type.value)) {
+        case PlaneLayoutComponentType::Y:
+          buffer_ycbcr.y = component_data;
+          buffer_ycbcr.ystride = plane_layout.strideInBytes;
+          break;
+        case PlaneLayoutComponentType::CB:
+          buffer_ycbcr.cb = component_data;
+          buffer_ycbcr.cstride = plane_layout.strideInBytes;
+          buffer_ycbcr.chroma_step = plane_layout.sampleIncrementInBits / 8;
+          break;
+        case PlaneLayoutComponentType::CR:
+          buffer_ycbcr.cr = component_data;
+          buffer_ycbcr.cstride = plane_layout.strideInBytes;
+          buffer_ycbcr.chroma_step = plane_layout.sampleIncrementInBits / 8;
+          break;
+        default:
+          break;
+      }
+    }
+  }
+
+  return buffer_ycbcr;
+}
+
+void Gralloc::Unlock(buffer_handle_t buffer) {
+  if (gralloc4_ == nullptr) {
+    ALOGE("%s Gralloc4 not available.", __FUNCTION__);
+    return;
+  }
+
+  auto native_handle = const_cast<native_handle_t*>(buffer);
+
+  Error error = Error::NONE;
+  auto ret = gralloc4_->unlock(
+      native_handle,
+      [&](const auto& unlock_error, const auto&) { error = unlock_error; });
+
+  if (!ret.isOk()) {
+    error = Error::NO_RESOURCES;
+  }
+
+  if (error != Error::NONE) {
+    ALOGE("%s failed to unlock buffer", __FUNCTION__);
+  }
+}
+
+GrallocBuffer::GrallocBuffer(Gralloc* gralloc, buffer_handle_t buffer)
+    : gralloc_(gralloc), buffer_(buffer) {}
+
+GrallocBuffer::~GrallocBuffer() { Release(); }
+
+GrallocBuffer::GrallocBuffer(GrallocBuffer&& rhs) { *this = std::move(rhs); }
+
+GrallocBuffer& GrallocBuffer::operator=(GrallocBuffer&& rhs) {
+  gralloc_ = rhs.gralloc_;
+  buffer_ = rhs.buffer_;
+  rhs.gralloc_ = nullptr;
+  rhs.buffer_ = nullptr;
+  return *this;
+}
+
+void GrallocBuffer::Release() {
+  if (gralloc_ && buffer_) {
+    gralloc_->Release(buffer_);
+    gralloc_ = nullptr;
+    buffer_ = nullptr;
+  }
+}
+
+std::optional<GrallocBufferView> GrallocBuffer::Lock() {
+  if (gralloc_ && buffer_) {
+    auto format_opt = GetDrmFormat();
+    if (!format_opt) {
+      ALOGE("%s failed to check format of buffer", __FUNCTION__);
+      return std::nullopt;
+    }
+    if (*format_opt != DRM_FORMAT_NV12 && *format_opt != DRM_FORMAT_NV21 &&
+        *format_opt != DRM_FORMAT_YVU420) {
+      auto locked_opt = gralloc_->Lock(buffer_);
+      if (!locked_opt) {
+        return std::nullopt;
+      }
+      return GrallocBufferView(this, *locked_opt);
+    } else {
+      auto locked_ycbcr_opt = gralloc_->LockYCbCr(buffer_);
+      if (!locked_ycbcr_opt) {
+        ALOGE("%s failed to lock ycbcr buffer", __FUNCTION__);
+        return std::nullopt;
+      }
+      return GrallocBufferView(this, *locked_ycbcr_opt);
+    }
+  }
+  return std::nullopt;
+}
+
+void GrallocBuffer::Unlock() {
+  if (gralloc_ && buffer_) {
+    gralloc_->Unlock(buffer_);
+  }
+}
+
+std::optional<uint32_t> GrallocBuffer::GetWidth() {
+  if (gralloc_ && buffer_) {
+    return gralloc_->GetWidth(buffer_);
+  }
+  return std::nullopt;
+}
+
+std::optional<uint32_t> GrallocBuffer::GetHeight() {
+  if (gralloc_ && buffer_) {
+    return gralloc_->GetHeight(buffer_);
+  }
+  return std::nullopt;
+}
+
+std::optional<uint32_t> GrallocBuffer::GetDrmFormat() {
+  if (gralloc_ && buffer_) {
+    return gralloc_->GetDrmFormat(buffer_);
+  }
+  return std::nullopt;
+}
+
+std::optional<std::vector<PlaneLayout>> GrallocBuffer::GetPlaneLayouts() {
+  if (gralloc_ && buffer_) {
+    return gralloc_->GetPlaneLayouts(buffer_);
+  }
+  return std::nullopt;
+}
+
+std::optional<uint32_t> GrallocBuffer::GetMonoPlanarStrideBytes() {
+  if (gralloc_ && buffer_) {
+    return gralloc_->GetMonoPlanarStrideBytes(buffer_);
+  }
+  return std::nullopt;
+}
+
+GrallocBufferView::GrallocBufferView(GrallocBuffer* buffer, void* raw)
+    : gralloc_buffer_(buffer), locked_(raw) {}
+
+GrallocBufferView::GrallocBufferView(GrallocBuffer* buffer, android_ycbcr raw)
+    : gralloc_buffer_(buffer), locked_ycbcr_(raw) {}
+
+GrallocBufferView::~GrallocBufferView() {
+  if (gralloc_buffer_) {
+    gralloc_buffer_->Unlock();
+  }
+}
+
+GrallocBufferView::GrallocBufferView(GrallocBufferView&& rhs) {
+  *this = std::move(rhs);
+}
+
+GrallocBufferView& GrallocBufferView::operator=(GrallocBufferView&& rhs) {
+  std::swap(gralloc_buffer_, rhs.gralloc_buffer_);
+  std::swap(locked_, rhs.locked_);
+  std::swap(locked_ycbcr_, rhs.locked_ycbcr_);
+  return *this;
+}
+
+const std::optional<void*> GrallocBufferView::Get() const { return locked_; }
+
+const std::optional<android_ycbcr>& GrallocBufferView::GetYCbCr() const {
+  return locked_ycbcr_;
+}
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/Gralloc.h b/system/hwc3/Gralloc.h
new file mode 100644
index 0000000..f259f29
--- /dev/null
+++ b/system/hwc3/Gralloc.h
@@ -0,0 +1,160 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_HWC_GRALLOC_H
+#define ANDROID_HWC_GRALLOC_H
+
+#include <aidl/android/hardware/graphics/common/PlaneLayout.h>
+#include <android/hardware/graphics/mapper/4.0/IMapper.h>
+#include <hardware/gralloc.h>
+#include <system/graphics.h>
+#include <utils/StrongPointer.h>
+
+#include <memory>
+#include <optional>
+#include <vector>
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+class Gralloc;
+class GrallocBuffer;
+
+// An RAII object that will Unlock() a GrallocBuffer upon destruction.
+class GrallocBufferView {
+ public:
+  virtual ~GrallocBufferView();
+
+  GrallocBufferView(const GrallocBufferView& rhs) = delete;
+  GrallocBufferView& operator=(const GrallocBufferView& rhs) = delete;
+
+  GrallocBufferView(GrallocBufferView&& rhs);
+  GrallocBufferView& operator=(GrallocBufferView&& rhs);
+
+  const std::optional<void*> Get() const;
+
+  const std::optional<android_ycbcr>& GetYCbCr() const;
+
+ private:
+  friend class GrallocBuffer;
+  GrallocBufferView(GrallocBuffer* buffer, void* raw);
+  GrallocBufferView(GrallocBuffer* buffer, android_ycbcr raw);
+
+  // The GrallocBuffer that should be unlocked upon destruction of this object.
+  GrallocBuffer* gralloc_buffer_ = nullptr;
+
+  std::optional<void*> locked_;
+  std::optional<android_ycbcr> locked_ycbcr_;
+};
+
+// A gralloc 4.0 buffer that has been imported in the current process and
+// that will be released upon destruction. Users must ensure that the Gralloc
+// instance that this buffer is created with out lives this buffer.
+class GrallocBuffer {
+ public:
+  GrallocBuffer(Gralloc* gralloc, buffer_handle_t buffer);
+  virtual ~GrallocBuffer();
+
+  GrallocBuffer(const GrallocBuffer& rhs) = delete;
+  GrallocBuffer& operator=(const GrallocBuffer& rhs) = delete;
+
+  GrallocBuffer(GrallocBuffer&& rhs);
+  GrallocBuffer& operator=(GrallocBuffer&& rhs);
+
+  // Locks the buffer for reading and returns a view if successful.
+  std::optional<GrallocBufferView> Lock();
+
+  std::optional<uint32_t> GetWidth();
+  std::optional<uint32_t> GetHeight();
+  std::optional<uint32_t> GetDrmFormat();
+
+  // Returns the stride of the buffer if it is a single plane buffer or fails
+  // and returns nullopt if the buffer is for a multi plane buffer.
+  std::optional<uint32_t> GetMonoPlanarStrideBytes();
+
+  std::optional<
+      std::vector<aidl::android::hardware::graphics::common::PlaneLayout>>
+  GetPlaneLayouts();
+
+ private:
+  // Internal visibility for Unlock().
+  friend class GrallocBufferView;
+
+  // Unlocks the buffer from reading.
+  void Unlock();
+
+  void Release();
+
+  Gralloc* gralloc_ = nullptr;
+  buffer_handle_t buffer_ = nullptr;
+};
+
+class Gralloc {
+ public:
+  Gralloc();
+  virtual ~Gralloc() = default;
+
+  // Imports the given buffer handle into the current process and returns an
+  // imported buffer which can be used for reading. Users must ensure that the
+  // Gralloc instance outlives any GrallocBuffers.
+  std::optional<GrallocBuffer> Import(buffer_handle_t buffer);
+
+ private:
+  // The below functions are made available only to GrallocBuffer so that
+  // users only call gralloc functions on *imported* buffers.
+  friend class GrallocBuffer;
+
+  // See GrallocBuffer::Release.
+  void Release(buffer_handle_t buffer);
+
+  // See GrallocBuffer::Lock.
+  std::optional<void*> Lock(buffer_handle_t buffer);
+
+  // See GrallocBuffer::LockYCbCr.
+  std::optional<android_ycbcr> LockYCbCr(buffer_handle_t buffer);
+
+  // See GrallocBuffer::Unlock.
+  void Unlock(buffer_handle_t buffer);
+
+  // See GrallocBuffer::GetWidth.
+  std::optional<uint32_t> GetWidth(buffer_handle_t buffer);
+
+  // See GrallocBuffer::GetHeight.
+  std::optional<uint32_t> GetHeight(buffer_handle_t buffer);
+
+  // See GrallocBuffer::GetDrmFormat.
+  std::optional<uint32_t> GetDrmFormat(buffer_handle_t buffer);
+
+  // See GrallocBuffer::GetPlaneLayouts.
+  std::optional<
+      std::vector<aidl::android::hardware::graphics::common::PlaneLayout>>
+  GetPlaneLayouts(buffer_handle_t buffer);
+
+  // Returns the stride of the buffer if it is a single plane buffer or fails
+  // and returns nullopt if the buffer is for a multi plane buffer.
+  std::optional<uint32_t> GetMonoPlanarStrideBytes(buffer_handle_t);
+
+  // See GrallocBuffer::GetMetadata.
+  ::android::hardware::graphics::mapper::V4_0::Error GetMetadata(
+      buffer_handle_t buffer,
+      ::android::hardware::graphics::mapper::V4_0::IMapper::MetadataType type,
+      ::android::hardware::hidl_vec<uint8_t>* metadata);
+
+  ::android::sp<::android::hardware::graphics::mapper::V4_0::IMapper> gralloc4_;
+};
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
+
+#endif
\ No newline at end of file
diff --git a/system/hwc3/GuestFrameComposer.cpp b/system/hwc3/GuestFrameComposer.cpp
new file mode 100644
index 0000000..078cce4
--- /dev/null
+++ b/system/hwc3/GuestFrameComposer.cpp
@@ -0,0 +1,1249 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "GuestFrameComposer.h"
+
+#include <android-base/parseint.h>
+#include <android-base/properties.h>
+#include <android-base/strings.h>
+#include <android/hardware/graphics/common/1.0/types.h>
+#include <device_config_shared.h>
+#include <drm_fourcc.h>
+#include <libyuv.h>
+#include <sync/sync.h>
+#include <ui/GraphicBuffer.h>
+#include <ui/GraphicBufferAllocator.h>
+#include <ui/GraphicBufferMapper.h>
+
+#include "Display.h"
+#include "Drm.h"
+#include "Layer.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+namespace {
+
+using ::android::hardware::graphics::common::V1_0::ColorTransform;
+
+uint64_t AlignToPower2(uint64_t val, uint8_t align_log) {
+  uint64_t align = 1ULL << align_log;
+  return ((val + (align - 1)) / align) * align;
+}
+
+bool LayerNeedsScaling(const Layer& layer) {
+  common::Rect crop = layer.getSourceCropInt();
+  common::Rect frame = layer.getDisplayFrame();
+
+  int fromW = crop.right - crop.left;
+  int fromH = crop.bottom - crop.top;
+  int toW = frame.right - frame.left;
+  int toH = frame.bottom - frame.top;
+
+  bool not_rot_scale = fromW != toW || fromH != toH;
+  bool rot_scale = fromW != toH || fromH != toW;
+
+  bool needs_rot = static_cast<int32_t>(layer.getTransform()) &
+                   static_cast<int32_t>(common::Transform::ROT_90);
+
+  return needs_rot ? rot_scale : not_rot_scale;
+}
+
+bool LayerNeedsBlending(const Layer& layer) {
+  return layer.getBlendMode() != common::BlendMode::NONE;
+}
+
+bool LayerNeedsAttenuation(const Layer& layer) {
+  return layer.getBlendMode() == common::BlendMode::COVERAGE;
+}
+
+struct BufferSpec;
+typedef int (*ConverterFunction)(const BufferSpec& src, const BufferSpec& dst,
+                                 bool v_flip);
+int DoCopy(const BufferSpec& src, const BufferSpec& dst, bool vFlip);
+int ConvertFromRGB565(const BufferSpec& src, const BufferSpec& dst, bool vFlip);
+int ConvertFromYV12(const BufferSpec& src, const BufferSpec& dst, bool vFlip);
+
+ConverterFunction GetConverterForDrmFormat(uint32_t drmFormat) {
+  switch (drmFormat) {
+    case DRM_FORMAT_ABGR8888:
+    case DRM_FORMAT_XBGR8888:
+      return &DoCopy;
+    case DRM_FORMAT_RGB565:
+      return &ConvertFromRGB565;
+    case DRM_FORMAT_YVU420:
+      return &ConvertFromYV12;
+  }
+  DEBUG_LOG("Unsupported drm format: %d(%s), returning null converter",
+            drmFormat, GetDrmFormatString(drmFormat));
+  return nullptr;
+}
+
+bool IsDrmFormatSupported(uint32_t drmFormat) {
+  return GetConverterForDrmFormat(drmFormat) != nullptr;
+}
+
+// Libyuv's convert functions only allow the combination of any rotation
+// (multiple of 90 degrees) and a vertical flip, but not horizontal flips.
+// Surfaceflinger's transformations are expressed in terms of a vertical flip,
+// a horizontal flip and/or a single 90 degrees clockwise rotation (see
+// NATIVE_WINDOW_TRANSFORM_HINT documentation on system/window.h for more
+// insight). The following code allows to turn a horizontal flip into a 180
+// degrees rotation and a vertical flip.
+libyuv::RotationMode GetRotationFromTransform(common::Transform transform) {
+  uint32_t rotation = 0;
+  rotation += (static_cast<int32_t>(transform) &
+               static_cast<int32_t>(common::Transform::ROT_90))
+                  ? 1
+                  : 0;  // 1 * ROT90 bit
+  rotation += (static_cast<int32_t>(transform) &
+               static_cast<int32_t>(common::Transform::FLIP_H))
+                  ? 2
+                  : 0;  // 2 * VFLIP bit
+  return static_cast<libyuv::RotationMode>(90 * rotation);
+}
+
+bool GetVFlipFromTransform(common::Transform transform) {
+  // vertical flip xor horizontal flip
+  bool hasVFlip = static_cast<int32_t>(transform) &
+                  static_cast<int32_t>(common::Transform::FLIP_V);
+  bool hasHFlip = static_cast<int32_t>(transform) &
+                  static_cast<int32_t>(common::Transform::FLIP_H);
+  return hasVFlip ^ hasHFlip;
+}
+
+struct BufferSpec {
+  uint8_t* buffer;
+  std::optional<android_ycbcr> buffer_ycbcr;
+  int width;
+  int height;
+  int cropX;
+  int cropY;
+  int cropWidth;
+  int cropHeight;
+  uint32_t drmFormat;
+  int strideBytes;
+  int sampleBytes;
+
+  BufferSpec() = default;
+
+  BufferSpec(uint8_t* buffer, std::optional<android_ycbcr> buffer_ycbcr,
+             int width, int height, int cropX, int cropY, int cropWidth,
+             int cropHeight, uint32_t drmFormat, int strideBytes,
+             int sampleBytes)
+      : buffer(buffer),
+        buffer_ycbcr(buffer_ycbcr),
+        width(width),
+        height(height),
+        cropX(cropX),
+        cropY(cropY),
+        cropWidth(cropWidth),
+        cropHeight(cropHeight),
+        drmFormat(drmFormat),
+        strideBytes(strideBytes),
+        sampleBytes(sampleBytes) {}
+
+  BufferSpec(uint8_t* buffer, int width, int height, int strideBytes)
+      : BufferSpec(buffer,
+                   /*buffer_ycbcr=*/std::nullopt, width, height,
+                   /*cropX=*/0,
+                   /*cropY=*/0,
+                   /*cropWidth=*/width,
+                   /*cropHeight=*/height,
+                   /*drmFormat=*/DRM_FORMAT_ABGR8888, strideBytes,
+                   /*sampleBytes=*/4) {}
+};
+
+int DoFill(const BufferSpec& dst, const Color& color) {
+  ATRACE_CALL();
+
+  const uint8_t r = static_cast<uint8_t>(color.r * 255.0f);
+  const uint8_t g = static_cast<uint8_t>(color.g * 255.0f);
+  const uint8_t b = static_cast<uint8_t>(color.b * 255.0f);
+  const uint8_t a = static_cast<uint8_t>(color.a * 255.0f);
+
+  const uint32_t rgba = r | g << 8 | b << 16 | a << 24;
+
+  // Point to the upper left corner of the crop rectangle.
+  uint8_t* dstBuffer =
+      dst.buffer + dst.cropY * dst.strideBytes + dst.cropX * dst.sampleBytes;
+
+  libyuv::SetPlane(dstBuffer,
+                   dst.strideBytes,
+                   dst.cropWidth,
+                   dst.cropHeight,
+                   rgba);
+  return 0;
+}
+
+int ConvertFromRGB565(const BufferSpec& src, const BufferSpec& dst,
+                      bool vFlip) {
+  ATRACE_CALL();
+
+  // Point to the upper left corner of the crop rectangle
+  uint8_t* srcBuffer =
+      src.buffer + src.cropY * src.strideBytes + src.cropX * src.sampleBytes;
+  uint8_t* dstBuffer =
+      dst.buffer + dst.cropY * dst.strideBytes + dst.cropX * dst.sampleBytes;
+
+  int width = src.cropWidth;
+  int height = src.cropHeight;
+  if (vFlip) {
+    height = -height;
+  }
+
+  return libyuv::RGB565ToARGB(srcBuffer, src.strideBytes,  //
+                              dstBuffer, dst.strideBytes,  //
+                              width, height);
+}
+
+int ConvertFromYV12(const BufferSpec& src, const BufferSpec& dst, bool vFlip) {
+  ATRACE_CALL();
+
+  // The following calculation of plane offsets and alignments are based on
+  // swiftshader's Sampler::setTextureLevel() implementation
+  // (Renderer/Sampler.cpp:225)
+
+  auto& srcBufferYCbCrOpt = src.buffer_ycbcr;
+  if (!srcBufferYCbCrOpt) {
+    ALOGE("%s called on non ycbcr buffer", __FUNCTION__);
+    return -1;
+  }
+  auto& srcBufferYCbCr = *srcBufferYCbCrOpt;
+
+  // The libyuv::I420ToARGB() function is for tri-planar.
+  if (srcBufferYCbCr.chroma_step != 1) {
+    ALOGE("%s called with bad chroma step", __FUNCTION__);
+    return -1;
+  }
+
+  uint8_t* srcY = reinterpret_cast<uint8_t*>(srcBufferYCbCr.y);
+  int strideY = srcBufferYCbCr.ystride;
+  uint8_t* srcU = reinterpret_cast<uint8_t*>(srcBufferYCbCr.cb);
+  int strideU = srcBufferYCbCr.cstride;
+  uint8_t* srcV = reinterpret_cast<uint8_t*>(srcBufferYCbCr.cr);
+  int strideV = srcBufferYCbCr.cstride;
+
+  // Adjust for crop
+  srcY += src.cropY * strideY + src.cropX;
+  srcV += (src.cropY / 2) * strideV + (src.cropX / 2);
+  srcU += (src.cropY / 2) * strideU + (src.cropX / 2);
+  uint8_t* dstBuffer =
+      dst.buffer + dst.cropY * dst.strideBytes + dst.cropX * dst.sampleBytes;
+
+  int width = dst.cropWidth;
+  int height = dst.cropHeight;
+
+  if (vFlip) {
+    height = -height;
+  }
+
+  // YV12 is the same as I420, with the U and V planes swapped
+  return libyuv::I420ToARGB(srcY, strideY, srcV, strideV, srcU, strideU,
+                            dstBuffer, dst.strideBytes, width, height);
+}
+
+int DoConversion(const BufferSpec& src, const BufferSpec& dst, bool v_flip) {
+  ConverterFunction func = GetConverterForDrmFormat(src.drmFormat);
+  if (!func) {
+    // GetConverterForDrmFormat should've logged the issue for us.
+    return -1;
+  }
+  return func(src, dst, v_flip);
+}
+
+int DoCopy(const BufferSpec& src, const BufferSpec& dst, bool v_flip) {
+  ATRACE_CALL();
+
+  // Point to the upper left corner of the crop rectangle
+  uint8_t* srcBuffer =
+      src.buffer + src.cropY * src.strideBytes + src.cropX * src.sampleBytes;
+  uint8_t* dstBuffer =
+      dst.buffer + dst.cropY * dst.strideBytes + dst.cropX * dst.sampleBytes;
+  int width = src.cropWidth;
+  int height = src.cropHeight;
+
+  if (v_flip) {
+    height = -height;
+  }
+
+  // HAL formats are named based on the order of the pixel components on the
+  // byte stream, while libyuv formats are named based on the order of those
+  // pixel components in an integer written from left to right. So
+  // libyuv::FOURCC_ARGB is equivalent to HAL_PIXEL_FORMAT_BGRA_8888.
+  auto ret = libyuv::ARGBCopy(srcBuffer, src.strideBytes, dstBuffer,
+                              dst.strideBytes, width, height);
+  return ret;
+}
+
+int DoRotation(const BufferSpec& src, const BufferSpec& dst,
+               libyuv::RotationMode rotation, bool v_flip) {
+  ATRACE_CALL();
+
+  // Point to the upper left corner of the crop rectangles
+  uint8_t* srcBuffer =
+      src.buffer + src.cropY * src.strideBytes + src.cropX * src.sampleBytes;
+  uint8_t* dstBuffer =
+      dst.buffer + dst.cropY * dst.strideBytes + dst.cropX * dst.sampleBytes;
+  int width = src.cropWidth;
+  int height = src.cropHeight;
+
+  if (v_flip) {
+    height = -height;
+  }
+
+  return libyuv::ARGBRotate(srcBuffer, src.strideBytes, dstBuffer,
+                            dst.strideBytes, width, height, rotation);
+}
+
+int DoScaling(const BufferSpec& src, const BufferSpec& dst, bool v_flip) {
+  ATRACE_CALL();
+
+  // Point to the upper left corner of the crop rectangles
+  uint8_t* srcBuffer =
+      src.buffer + src.cropY * src.strideBytes + src.cropX * src.sampleBytes;
+  uint8_t* dstBuffer =
+      dst.buffer + dst.cropY * dst.strideBytes + dst.cropX * dst.sampleBytes;
+  int srcWidth = src.cropWidth;
+  int srcHeight = src.cropHeight;
+  int dstWidth = dst.cropWidth;
+  int dstHeight = dst.cropHeight;
+
+  if (v_flip) {
+    srcHeight = -srcHeight;
+  }
+
+  return libyuv::ARGBScale(srcBuffer, src.strideBytes, srcWidth, srcHeight,
+                           dstBuffer, dst.strideBytes, dstWidth, dstHeight,
+                           libyuv::kFilterBilinear);
+}
+
+int DoAttenuation(const BufferSpec& src, const BufferSpec& dst, bool v_flip) {
+  ATRACE_CALL();
+
+  // Point to the upper left corner of the crop rectangles
+  uint8_t* srcBuffer =
+      src.buffer + src.cropY * src.strideBytes + src.cropX * src.sampleBytes;
+  uint8_t* dstBuffer =
+      dst.buffer + dst.cropY * dst.strideBytes + dst.cropX * dst.sampleBytes;
+  int width = dst.cropWidth;
+  int height = dst.cropHeight;
+
+  if (v_flip) {
+    height = -height;
+  }
+
+  return libyuv::ARGBAttenuate(srcBuffer, src.strideBytes, dstBuffer,
+                               dst.strideBytes, width, height);
+}
+
+int DoBlending(const BufferSpec& src, const BufferSpec& dst, bool v_flip) {
+  ATRACE_CALL();
+
+  // Point to the upper left corner of the crop rectangles
+  uint8_t* srcBuffer =
+      src.buffer + src.cropY * src.strideBytes + src.cropX * src.sampleBytes;
+  uint8_t* dstBuffer =
+      dst.buffer + dst.cropY * dst.strideBytes + dst.cropX * dst.sampleBytes;
+  int width = dst.cropWidth;
+  int height = dst.cropHeight;
+
+  if (v_flip) {
+    height = -height;
+  }
+
+  // libyuv's ARGB format is hwcomposer's BGRA format, since blending only cares
+  // for the position of alpha in the pixel and not the position of the colors
+  // this function is perfectly usable.
+  return libyuv::ARGBBlend(srcBuffer, src.strideBytes, dstBuffer,
+                           dst.strideBytes, dstBuffer, dst.strideBytes, width,
+                           height);
+}
+
+std::optional<BufferSpec> GetBufferSpec(GrallocBuffer& buffer,
+                                        GrallocBufferView& bufferView,
+                                        const common::Rect& bufferCrop) {
+  auto bufferFormatOpt = buffer.GetDrmFormat();
+  if (!bufferFormatOpt) {
+    ALOGE("Failed to get gralloc buffer format.");
+    return std::nullopt;
+  }
+  uint32_t bufferFormat = *bufferFormatOpt;
+
+  auto bufferWidthOpt = buffer.GetWidth();
+  if (!bufferWidthOpt) {
+    ALOGE("Failed to get gralloc buffer width.");
+    return std::nullopt;
+  }
+  uint32_t bufferWidth = *bufferWidthOpt;
+
+  auto bufferHeightOpt = buffer.GetHeight();
+  if (!bufferHeightOpt) {
+    ALOGE("Failed to get gralloc buffer height.");
+    return std::nullopt;
+  }
+  uint32_t bufferHeight = *bufferHeightOpt;
+
+  uint8_t* bufferData = nullptr;
+  uint32_t bufferStrideBytes = 0;
+  std::optional<android_ycbcr> bufferYCbCrData;
+
+  if (bufferFormat == DRM_FORMAT_NV12 || bufferFormat == DRM_FORMAT_NV21 ||
+      bufferFormat == DRM_FORMAT_YVU420) {
+    bufferYCbCrData = bufferView.GetYCbCr();
+    if (!bufferYCbCrData) {
+      ALOGE("%s failed to get raw ycbcr from view.", __FUNCTION__);
+      return std::nullopt;
+    }
+  } else {
+    auto bufferDataOpt = bufferView.Get();
+    if (!bufferDataOpt) {
+      ALOGE("%s failed to lock gralloc buffer.", __FUNCTION__);
+      return std::nullopt;
+    }
+    bufferData = reinterpret_cast<uint8_t*>(*bufferDataOpt);
+
+    auto bufferStrideBytesOpt = buffer.GetMonoPlanarStrideBytes();
+    if (!bufferStrideBytesOpt) {
+      ALOGE("%s failed to get plane stride.", __FUNCTION__);
+      return std::nullopt;
+    }
+    bufferStrideBytes = *bufferStrideBytesOpt;
+  }
+
+  return BufferSpec(bufferData, bufferYCbCrData, bufferWidth, bufferHeight,
+                    bufferCrop.left, bufferCrop.top,
+                    bufferCrop.right - bufferCrop.left,
+                    bufferCrop.bottom - bufferCrop.top, bufferFormat,
+                    bufferStrideBytes, GetDrmFormatBytesPerPixel(bufferFormat));
+}
+
+}  // namespace
+
+HWC3::Error GuestFrameComposer::init() {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  HWC3::Error error = mDrmClient.init();
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: failed to initialize DrmClient", __FUNCTION__);
+    return error;
+  }
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error GuestFrameComposer::registerOnHotplugCallback(
+    const HotplugCallback& cb) {
+  return mDrmClient.registerOnHotplugCallback(cb);
+  return HWC3::Error::None;
+}
+
+HWC3::Error GuestFrameComposer::unregisterOnHotplugCallback() {
+  return mDrmClient.unregisterOnHotplugCallback();
+}
+
+HWC3::Error GuestFrameComposer::onDisplayCreate(Display* display) {
+  int64_t displayId = display->getId();
+  int32_t displayConfigId;
+  int32_t displayWidth;
+  int32_t displayHeight;
+
+  HWC3::Error error = display->getActiveConfig(&displayConfigId);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: display:%" PRIu64 " has no active config", __FUNCTION__,
+          displayId);
+    return error;
+  }
+
+  error = display->getDisplayAttribute(displayConfigId, DisplayAttribute::WIDTH,
+                                       &displayWidth);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: display:%" PRIu64 " failed to get width", __FUNCTION__,
+          displayId);
+    return error;
+  }
+
+  error = display->getDisplayAttribute(
+      displayConfigId, DisplayAttribute::HEIGHT, &displayHeight);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: display:%" PRIu64 " failed to get height", __FUNCTION__,
+          displayId);
+    return error;
+  }
+
+  auto it = mDisplayInfos.find(displayId);
+  if (it != mDisplayInfos.end()) {
+    ALOGE("%s: display:%" PRIu64 " already created?", __FUNCTION__, displayId);
+  }
+
+  DisplayInfo& displayInfo = mDisplayInfos[displayId];
+
+  uint32_t bufferStride;
+  buffer_handle_t bufferHandle;
+
+  auto status = ::android::GraphicBufferAllocator::get().allocate(
+      displayWidth,                       //
+      displayHeight,                      //
+      ::android::PIXEL_FORMAT_RGBA_8888,  //
+      /*layerCount=*/1,                   //
+      ::android::GraphicBuffer::USAGE_HW_COMPOSER |
+          ::android::GraphicBuffer::USAGE_SW_READ_OFTEN |
+          ::android::GraphicBuffer::USAGE_SW_WRITE_OFTEN,  //
+      &bufferHandle,                                       //
+      &bufferStride,                                       //
+      "RanchuHwc");
+  if (status != ::android::OK) {
+    ALOGE("%s: failed to allocate composition buffer for display:%" PRIu64,
+          __FUNCTION__, displayId);
+    return HWC3::Error::NoResources;
+  }
+
+  displayInfo.compositionResultBuffer = bufferHandle;
+
+  auto [drmBufferCreateError, drmBuffer] = mDrmClient.create(bufferHandle);
+  if (drmBufferCreateError != HWC3::Error::None) {
+    ALOGE("%s: failed to create drm buffer for display:%" PRIu64, __FUNCTION__,
+          displayId);
+    return drmBufferCreateError;
+  }
+  displayInfo.compositionResultDrmBuffer = std::move(drmBuffer);
+
+  if (displayId == 0) {
+    auto [flushError, flushSyncFd] = mDrmClient.flushToDisplay(
+        displayId, displayInfo.compositionResultDrmBuffer, -1);
+    if (flushError != HWC3::Error::None) {
+      ALOGW(
+          "%s: Initial display flush failed. HWComposer assuming that we are "
+          "running in QEMU without a display and disabling presenting.",
+          __FUNCTION__);
+      mPresentDisabled = true;
+    }
+  }
+
+  std::optional<std::vector<uint8_t>> edid = mDrmClient.getEdid(displayId);
+  if (edid) {
+    display->setEdid(*edid);
+  }
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error GuestFrameComposer::onDisplayDestroy(Display* display) {
+  auto displayId = display->getId();
+
+  auto it = mDisplayInfos.find(displayId);
+  if (it == mDisplayInfos.end()) {
+    ALOGE("%s: display:%" PRIu64 " missing display buffers?", __FUNCTION__,
+          displayId);
+    return HWC3::Error::BadDisplay;
+  }
+
+  DisplayInfo& displayInfo = mDisplayInfos[displayId];
+
+  ::android::GraphicBufferAllocator::get().free(
+      displayInfo.compositionResultBuffer);
+
+  mDisplayInfos.erase(it);
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error GuestFrameComposer::onDisplayClientTargetSet(Display*) {
+  return HWC3::Error::None;
+}
+
+HWC3::Error GuestFrameComposer::onActiveConfigChange(Display* /*display*/) {
+  return HWC3::Error::None;
+};
+
+HWC3::Error GuestFrameComposer::getDisplayConfigsFromDeviceConfig(
+    std::vector<GuestFrameComposer::DisplayConfig>* configs) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  const auto deviceConfig = cuttlefish::GetDeviceConfig();
+  for (const auto& deviceDisplayConfig : deviceConfig.display_config()) {
+    DisplayConfig displayConfig = {
+        .width = deviceDisplayConfig.width(),
+        .height = deviceDisplayConfig.height(),
+        .dpiX = deviceDisplayConfig.dpi(),
+        .dpiY = deviceDisplayConfig.dpi(),
+        .refreshRateHz = deviceDisplayConfig.refresh_rate_hz(),
+    };
+
+    configs->push_back(displayConfig);
+  }
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error GuestFrameComposer::getDisplayConfigsFromSystemProp(
+    std::vector<GuestFrameComposer::DisplayConfig>* configs) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  static constexpr const char kExternalDisplayProp[] =
+      "hwservicemanager.external.displays";
+
+  const auto propString =
+      ::android::base::GetProperty(kExternalDisplayProp, "");
+  DEBUG_LOG("%s: prop value is: %s", __FUNCTION__, propString.c_str());
+
+  if (propString.empty()) {
+    return HWC3::Error::None;
+  }
+
+  const std::vector<std::string> propStringParts =
+      ::android::base::Split(propString, ",");
+  if (propStringParts.size() % 5 != 0) {
+    ALOGE("%s: Invalid syntax for system prop %s which is %s", __FUNCTION__,
+          kExternalDisplayProp, propString.c_str());
+    return HWC3::Error::BadParameter;
+  }
+
+  std::vector<int> propIntParts;
+  for (const std::string& propStringPart : propStringParts) {
+    int propIntPart;
+    if (!::android::base::ParseInt(propStringPart, &propIntPart)) {
+      ALOGE("%s: Invalid syntax for system prop %s which is %s", __FUNCTION__,
+            kExternalDisplayProp, propString.c_str());
+      return HWC3::Error::BadParameter;
+    }
+    propIntParts.push_back(propIntPart);
+  }
+
+  while (!propIntParts.empty()) {
+    DisplayConfig display_config = {
+        .width = propIntParts[1],
+        .height = propIntParts[2],
+        .dpiX = propIntParts[3],
+        .dpiY = propIntParts[3],
+        .refreshRateHz = 160,
+    };
+
+    configs->push_back(display_config);
+
+    propIntParts.erase(propIntParts.begin(), propIntParts.begin() + 5);
+  }
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error GuestFrameComposer::validateDisplay(Display* display,
+                                                DisplayChanges* outChanges) {
+  const auto displayId = display->getId();
+  DEBUG_LOG("%s display:%" PRIu64, __FUNCTION__, displayId);
+
+  const std::vector<Layer*>& layers = display->getOrderedLayers();
+
+  bool fallbackToClientComposition = false;
+  for (Layer* layer : layers) {
+    const auto layerId = layer->getId();
+    const auto layerCompositionType = layer->getCompositionType();
+    const auto layerCompositionTypeString = toString(layerCompositionType);
+
+    if (layerCompositionType == Composition::INVALID) {
+      ALOGE("%s display:%" PRIu64 " layer:%" PRIu64 " has Invalid composition",
+            __FUNCTION__, displayId, layerId);
+      continue;
+    }
+
+    if (layerCompositionType == Composition::CLIENT ||
+        layerCompositionType == Composition::CURSOR ||
+        layerCompositionType == Composition::SIDEBAND) {
+      DEBUG_LOG("%s: display:%" PRIu64 " layer:%" PRIu64
+                " has composition type %s, falling back to client composition",
+                __FUNCTION__, displayId, layerId,
+                layerCompositionTypeString.c_str());
+      fallbackToClientComposition = true;
+      break;
+    }
+
+    if (layerCompositionType == Composition::DISPLAY_DECORATION) {
+      return HWC3::Error::Unsupported;
+    }
+
+    if (!canComposeLayer(layer)) {
+      DEBUG_LOG(
+          "%s: display:%" PRIu64 " layer:%" PRIu64
+          " composition not supported, falling back to client composition",
+          __FUNCTION__, displayId, layerId);
+      fallbackToClientComposition = true;
+      break;
+    }
+  }
+
+  if (fallbackToClientComposition) {
+    for (Layer* layer : layers) {
+      const auto layerId = layer->getId();
+      const auto layerCompositionType = layer->getCompositionType();
+
+      if (layerCompositionType == Composition::INVALID) {
+        continue;
+      }
+
+      if (layerCompositionType != Composition::CLIENT) {
+        DEBUG_LOG("%s display:%" PRIu64 " layer:%" PRIu64
+                  "composition updated to Client",
+                  __FUNCTION__, displayId, layerId);
+
+        outChanges->addLayerCompositionChange(displayId, layerId,
+                                              Composition::CLIENT);
+      }
+    }
+  }
+
+  // We can not draw below a Client (SurfaceFlinger) composed layer. Change all
+  // layers below a Client composed layer to also be Client composed.
+  if (layers.size() > 1) {
+    for (std::size_t layerIndex = layers.size() - 1; layerIndex > 0;
+         layerIndex--) {
+      auto layer = layers[layerIndex];
+      auto layerCompositionType = layer->getCompositionType();
+
+      if (layerCompositionType == Composition::CLIENT) {
+        for (std::size_t lowerLayerIndex = 0; lowerLayerIndex < layerIndex;
+             lowerLayerIndex++) {
+          auto lowerLayer = layers[lowerLayerIndex];
+          auto lowerLayerId = lowerLayer->getId();
+          auto lowerLayerCompositionType = lowerLayer->getCompositionType();
+
+          if (lowerLayerCompositionType != Composition::CLIENT) {
+            DEBUG_LOG("%s: display:%" PRIu64 " changing layer:%" PRIu64
+                      " to Client because"
+                      "hwcomposer can not draw below the Client composed "
+                      "layer:%" PRIu64,
+                      __FUNCTION__, displayId, lowerLayerId, layer->getId());
+
+            outChanges->addLayerCompositionChange(displayId, lowerLayerId,
+                                                  Composition::CLIENT);
+          }
+        }
+      }
+    }
+  }
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error GuestFrameComposer::presentDisplay(
+    Display* display, ::android::base::unique_fd* outDisplayFence,
+    std::unordered_map<int64_t,
+                       ::android::base::unique_fd>* /*outLayerFences*/) {
+  const auto displayId = display->getId();
+  DEBUG_LOG("%s display:%" PRIu64, __FUNCTION__, displayId);
+
+  if (mPresentDisabled) {
+    return HWC3::Error::None;
+  }
+
+  auto it = mDisplayInfos.find(displayId);
+  if (it == mDisplayInfos.end()) {
+    ALOGE("%s: display:%" PRIu64 " not found", __FUNCTION__, displayId);
+    return HWC3::Error::NoResources;
+  }
+
+  DisplayInfo& displayInfo = it->second;
+
+  if (displayInfo.compositionResultBuffer == nullptr) {
+    ALOGE("%s: display:%" PRIu64 " missing composition result buffer",
+          __FUNCTION__, displayId);
+    return HWC3::Error::NoResources;
+  }
+
+  if (displayInfo.compositionResultDrmBuffer == nullptr) {
+    ALOGE("%s: display:%" PRIu64 " missing composition result drm buffer",
+          __FUNCTION__, displayId);
+    return HWC3::Error::NoResources;
+  }
+
+  std::optional<GrallocBuffer> compositionResultBufferOpt =
+      mGralloc.Import(displayInfo.compositionResultBuffer);
+  if (!compositionResultBufferOpt) {
+    ALOGE("%s: display:%" PRIu64 " failed to import buffer", __FUNCTION__,
+          displayId);
+    return HWC3::Error::NoResources;
+  }
+
+  std::optional<uint32_t> compositionResultBufferWidthOpt =
+      compositionResultBufferOpt->GetWidth();
+  if (!compositionResultBufferWidthOpt) {
+    ALOGE("%s: display:%" PRIu64 " failed to query buffer width", __FUNCTION__,
+          displayId);
+    return HWC3::Error::NoResources;
+  }
+
+  std::optional<uint32_t> compositionResultBufferHeightOpt =
+      compositionResultBufferOpt->GetHeight();
+  if (!compositionResultBufferHeightOpt) {
+    ALOGE("%s: display:%" PRIu64 " failed to query buffer height", __FUNCTION__,
+          displayId);
+    return HWC3::Error::NoResources;
+  }
+
+  std::optional<uint32_t> compositionResultBufferStrideOpt =
+      compositionResultBufferOpt->GetMonoPlanarStrideBytes();
+  if (!compositionResultBufferStrideOpt) {
+    ALOGE("%s: display:%" PRIu64 " failed to query buffer stride", __FUNCTION__,
+          displayId);
+    return HWC3::Error::NoResources;
+  }
+
+  std::optional<GrallocBufferView> compositionResultBufferViewOpt =
+      compositionResultBufferOpt->Lock();
+  if (!compositionResultBufferViewOpt) {
+    ALOGE("%s: display:%" PRIu64 " failed to get buffer view", __FUNCTION__,
+          displayId);
+    return HWC3::Error::NoResources;
+  }
+
+  const std::optional<void*> compositionResultBufferDataOpt =
+      compositionResultBufferViewOpt->Get();
+  if (!compositionResultBufferDataOpt) {
+    ALOGE("%s: display:%" PRIu64 " failed to get buffer data", __FUNCTION__,
+          displayId);
+    return HWC3::Error::NoResources;
+  }
+
+  uint32_t compositionResultBufferWidth = *compositionResultBufferWidthOpt;
+  uint32_t compositionResultBufferHeight = *compositionResultBufferHeightOpt;
+  uint32_t compositionResultBufferStride = *compositionResultBufferStrideOpt;
+  uint8_t* compositionResultBufferData =
+      reinterpret_cast<uint8_t*>(*compositionResultBufferDataOpt);
+
+  const std::vector<Layer*>& layers = display->getOrderedLayers();
+
+  const bool noOpComposition = layers.empty();
+  const bool allLayersClientComposed =
+      std::all_of(layers.begin(),  //
+                  layers.end(),    //
+                  [](const Layer* layer) {
+                    return layer->getCompositionType() == Composition::CLIENT;
+                  });
+
+  if (noOpComposition) {
+    ALOGW("%s: display:%" PRIu64 " empty composition", __FUNCTION__, displayId);
+  } else if (allLayersClientComposed) {
+    auto clientTargetBufferOpt =
+        mGralloc.Import(display->waitAndGetClientTargetBuffer());
+    if (!clientTargetBufferOpt) {
+      ALOGE("%s: failed to import client target buffer.", __FUNCTION__);
+      return HWC3::Error::NoResources;
+    }
+    GrallocBuffer& clientTargetBuffer = *clientTargetBufferOpt;
+
+    auto clientTargetBufferViewOpt = clientTargetBuffer.Lock();
+    if (!clientTargetBufferViewOpt) {
+      ALOGE("%s: failed to lock client target buffer.", __FUNCTION__);
+      return HWC3::Error::NoResources;
+    }
+    GrallocBufferView& clientTargetBufferView = *clientTargetBufferViewOpt;
+
+    auto clientTargetPlaneLayoutsOpt = clientTargetBuffer.GetPlaneLayouts();
+    if (!clientTargetPlaneLayoutsOpt) {
+      ALOGE("Failed to get client target buffer plane layouts.");
+      return HWC3::Error::NoResources;
+    }
+    auto& clientTargetPlaneLayouts = *clientTargetPlaneLayoutsOpt;
+
+    if (clientTargetPlaneLayouts.size() != 1) {
+      ALOGE("Unexpected number of plane layouts for client target buffer.");
+      return HWC3::Error::NoResources;
+    }
+
+    std::size_t clientTargetPlaneSize =
+        clientTargetPlaneLayouts[0].totalSizeInBytes;
+
+    auto clientTargetDataOpt = clientTargetBufferView.Get();
+    if (!clientTargetDataOpt) {
+      ALOGE("%s failed to lock gralloc buffer.", __FUNCTION__);
+      return HWC3::Error::NoResources;
+    }
+    auto* clientTargetData = reinterpret_cast<uint8_t*>(*clientTargetDataOpt);
+
+    std::memcpy(compositionResultBufferData, clientTargetData,
+                clientTargetPlaneSize);
+  } else {
+    for (Layer* layer : layers) {
+      const auto layerId = layer->getId();
+      const auto layerCompositionType = layer->getCompositionType();
+      if (layerCompositionType != Composition::DEVICE &&
+          layerCompositionType != Composition::SOLID_COLOR) {
+        continue;
+      }
+
+      HWC3::Error error = composeLayerInto(layer,                          //
+                                           compositionResultBufferData,    //
+                                           compositionResultBufferWidth,   //
+                                           compositionResultBufferHeight,  //
+                                           compositionResultBufferStride,  //
+                                           4);
+      if (error != HWC3::Error::None) {
+        ALOGE("%s: display:%" PRIu64 " failed to compose layer:%" PRIu64,
+              __FUNCTION__, displayId, layerId);
+        return error;
+      }
+    }
+  }
+
+  if (display->hasColorTransform()) {
+    HWC3::Error error =
+        applyColorTransformToRGBA(display->getColorTransform(),   //
+                                  compositionResultBufferData,    //
+                                  compositionResultBufferWidth,   //
+                                  compositionResultBufferHeight,  //
+                                  compositionResultBufferStride);
+    if (error != HWC3::Error::None) {
+      ALOGE("%s: display:%" PRIu64 " failed to apply color transform",
+            __FUNCTION__, displayId);
+      return error;
+    }
+  }
+
+  DEBUG_LOG("%s display:%" PRIu64 " flushing drm buffer", __FUNCTION__,
+            displayId);
+
+  auto [error, fence] = mDrmClient.flushToDisplay(
+      displayId, displayInfo.compositionResultDrmBuffer, -1);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: display:%" PRIu64 " failed to flush drm buffer" PRIu64,
+          __FUNCTION__, displayId);
+  }
+
+  *outDisplayFence = std::move(fence);
+  return error;
+}
+
+bool GuestFrameComposer::canComposeLayer(Layer* layer) {
+  const auto layerCompositionType = layer->getCompositionType();
+  if (layerCompositionType == Composition::SOLID_COLOR) {
+    return true;
+  }
+
+  if (layerCompositionType != Composition::DEVICE) {
+    return false;
+  }
+
+  buffer_handle_t bufferHandle = layer->getBuffer().getBuffer();
+  if (bufferHandle == nullptr) {
+    ALOGW("%s received a layer with a null handle", __FUNCTION__);
+    return false;
+  }
+
+  auto bufferOpt = mGralloc.Import(bufferHandle);
+  if (!bufferOpt) {
+    ALOGE("Failed to import layer buffer.");
+    return false;
+  }
+  GrallocBuffer& buffer = *bufferOpt;
+
+  auto bufferFormatOpt = buffer.GetDrmFormat();
+  if (!bufferFormatOpt) {
+    ALOGE("Failed to get layer buffer format.");
+    return false;
+  }
+  uint32_t bufferFormat = *bufferFormatOpt;
+
+  if (!IsDrmFormatSupported(bufferFormat)) {
+    return false;
+  }
+
+  return true;
+}
+
+HWC3::Error GuestFrameComposer::composeLayerInto(
+    Layer* srcLayer,                     //
+    std::uint8_t* dstBuffer,             //
+    std::uint32_t dstBufferWidth,        //
+    std::uint32_t dstBufferHeight,       //
+    std::uint32_t dstBufferStrideBytes,  //
+    std::uint32_t dstBufferBytesPerPixel) {
+  ATRACE_CALL();
+
+  libyuv::RotationMode rotation =
+      GetRotationFromTransform(srcLayer->getTransform());
+
+  common::Rect srcLayerCrop = srcLayer->getSourceCropInt();
+  common::Rect srcLayerDisplayFrame = srcLayer->getDisplayFrame();
+
+  BufferSpec srcLayerSpec;
+
+  std::optional<GrallocBuffer> srcBufferOpt;
+  std::optional<GrallocBufferView> srcBufferViewOpt;
+
+  const auto srcLayerCompositionType = srcLayer->getCompositionType();
+  if (srcLayerCompositionType == Composition::DEVICE) {
+    srcBufferOpt = mGralloc.Import(srcLayer->waitAndGetBuffer());
+    if (!srcBufferOpt) {
+      ALOGE("%s: failed to import layer buffer.", __FUNCTION__);
+      return HWC3::Error::NoResources;
+    }
+    GrallocBuffer& srcBuffer = *srcBufferOpt;
+
+    srcBufferViewOpt = srcBuffer.Lock();
+    if (!srcBufferViewOpt) {
+      ALOGE("%s: failed to lock import layer buffer.", __FUNCTION__);
+      return HWC3::Error::NoResources;
+    }
+    GrallocBufferView& srcBufferView = *srcBufferViewOpt;
+
+    auto srcLayerSpecOpt = GetBufferSpec(srcBuffer, srcBufferView, srcLayerCrop);
+    if (!srcLayerSpecOpt) {
+      return HWC3::Error::NoResources;
+    }
+
+    srcLayerSpec = *srcLayerSpecOpt;
+  } else if (srcLayerCompositionType == Composition::SOLID_COLOR) {
+    // srcLayerSpec not used by `needsFill` below.
+  }
+
+  // TODO(jemoreira): Remove the hardcoded fomat.
+  bool needsFill = srcLayerCompositionType == Composition::SOLID_COLOR;
+  bool needsConversion = srcLayerCompositionType == Composition::DEVICE &&
+                         srcLayerSpec.drmFormat != DRM_FORMAT_XBGR8888 &&
+                         srcLayerSpec.drmFormat != DRM_FORMAT_ABGR8888;
+  bool needsScaling = LayerNeedsScaling(*srcLayer);
+  bool needsRotation = rotation != libyuv::kRotate0;
+  bool needsTranspose = needsRotation && rotation != libyuv::kRotate180;
+  bool needsVFlip = GetVFlipFromTransform(srcLayer->getTransform());
+  bool needsAttenuation = LayerNeedsAttenuation(*srcLayer);
+  bool needsBlending = LayerNeedsBlending(*srcLayer);
+  bool needsCopy = !(needsConversion || needsScaling || needsRotation ||
+                     needsVFlip || needsAttenuation || needsBlending);
+
+  BufferSpec dstLayerSpec(
+      dstBuffer,
+      /*buffer_ycbcr=*/std::nullopt, dstBufferWidth, dstBufferHeight,
+      srcLayerDisplayFrame.left, srcLayerDisplayFrame.top,
+      srcLayerDisplayFrame.right - srcLayerDisplayFrame.left,
+      srcLayerDisplayFrame.bottom - srcLayerDisplayFrame.top,
+      DRM_FORMAT_XBGR8888, dstBufferStrideBytes, dstBufferBytesPerPixel);
+
+  // Add the destination layer to the bottom of the buffer stack
+  std::vector<BufferSpec> dstBufferStack(1, dstLayerSpec);
+
+  // If more than operation is to be performed, a temporary buffer is needed for
+  // each additional operation
+
+  // N operations need N destination buffers, the destination layer (the
+  // framebuffer) is one of them, so only N-1 temporary buffers are needed.
+  // Vertical flip is not taken into account because it can be done together
+  // with any other operation.
+  int neededScratchBuffers = (needsFill ? 1 : 0) +
+                             (needsConversion ? 1 : 0) +
+                             (needsScaling ? 1 : 0) + (needsRotation ? 1 : 0) +
+                             (needsAttenuation ? 1 : 0) +
+                             (needsBlending ? 1 : 0) + (needsCopy ? 1 : 0) - 1;
+
+  int mScratchBufferWidth =
+      srcLayerDisplayFrame.right - srcLayerDisplayFrame.left;
+  int mScratchBufferHeight =
+      srcLayerDisplayFrame.bottom - srcLayerDisplayFrame.top;
+  int mScratchBufferStrideBytes =
+      AlignToPower2(mScratchBufferWidth * dstBufferBytesPerPixel, 4);
+  int mScratchBufferSizeBytes =
+      mScratchBufferHeight * mScratchBufferStrideBytes;
+
+  for (int i = 0; i < neededScratchBuffers; i++) {
+    BufferSpec mScratchBufferspec(
+        getRotatingScratchBuffer(mScratchBufferSizeBytes, i),
+        mScratchBufferWidth, mScratchBufferHeight, mScratchBufferStrideBytes);
+    dstBufferStack.push_back(mScratchBufferspec);
+  }
+
+  // Filling, conversion, and scaling should always be the first operations, so
+  // that every other operation works on equally sized frames (guaranteed to fit
+  // in the scratch buffers) in a common format.
+
+  if (needsFill) {
+    BufferSpec& dstBufferSpec = dstBufferStack.back();
+
+    int retval = DoFill(dstBufferSpec, srcLayer->getColor());
+    if (retval) {
+      ALOGE("Got error code %d from DoFill function", retval);
+    }
+
+    srcLayerSpec = dstBufferSpec;
+    dstBufferStack.pop_back();
+  }
+
+  // TODO(jemoreira): We are converting to ARGB as the first step under the
+  // assumption that scaling ARGB is faster than scaling I420 (the most common).
+  // This should be confirmed with testing.
+  if (needsConversion) {
+    BufferSpec& dstBufferSpec = dstBufferStack.back();
+    if (needsScaling || needsTranspose) {
+      // If a rotation or a scaling operation are needed the dimensions at the
+      // top of the buffer stack are wrong (wrong sizes for scaling, swapped
+      // width and height for 90 and 270 rotations).
+      // Make width and height match the crop sizes on the source
+      int srcWidth = srcLayerSpec.cropWidth;
+      int srcHeight = srcLayerSpec.cropHeight;
+      int dst_stride_bytes =
+          AlignToPower2(srcWidth * dstBufferBytesPerPixel, 4);
+      size_t needed_size = dst_stride_bytes * srcHeight;
+      dstBufferSpec.width = srcWidth;
+      dstBufferSpec.height = srcHeight;
+      // Adjust the stride accordingly
+      dstBufferSpec.strideBytes = dst_stride_bytes;
+      // Crop sizes also need to be adjusted
+      dstBufferSpec.cropWidth = srcWidth;
+      dstBufferSpec.cropHeight = srcHeight;
+      // cropX and y are fine at 0, format is already set to match destination
+
+      // In case of a scale, the source frame may be bigger than the default tmp
+      // buffer size
+      dstBufferSpec.buffer = getSpecialScratchBuffer(needed_size);
+    }
+
+    int retval = DoConversion(srcLayerSpec, dstBufferSpec, needsVFlip);
+    if (retval) {
+      ALOGE("Got error code %d from DoConversion function", retval);
+    }
+    needsVFlip = false;
+    srcLayerSpec = dstBufferSpec;
+    dstBufferStack.pop_back();
+  }
+
+  if (needsScaling) {
+    BufferSpec& dstBufferSpec = dstBufferStack.back();
+    if (needsTranspose) {
+      // If a rotation is needed, the temporary buffer has the correct size but
+      // needs to be transposed and have its stride updated accordingly. The
+      // crop sizes also needs to be transposed, but not the x and y since they
+      // are both zero in a temporary buffer (and it is a temporary buffer
+      // because a rotation will be performed next).
+      std::swap(dstBufferSpec.width, dstBufferSpec.height);
+      std::swap(dstBufferSpec.cropWidth, dstBufferSpec.cropHeight);
+      // TODO (jemoreira): Aligment (To align here may cause the needed size to
+      // be bigger than the buffer, so care should be taken)
+      dstBufferSpec.strideBytes = dstBufferSpec.width * dstBufferBytesPerPixel;
+    }
+    int retval = DoScaling(srcLayerSpec, dstBufferSpec, needsVFlip);
+    needsVFlip = false;
+    if (retval) {
+      ALOGE("Got error code %d from DoScaling function", retval);
+    }
+    srcLayerSpec = dstBufferSpec;
+    dstBufferStack.pop_back();
+  }
+
+  if (needsRotation) {
+    int retval =
+        DoRotation(srcLayerSpec, dstBufferStack.back(), rotation, needsVFlip);
+    needsVFlip = false;
+    if (retval) {
+      ALOGE("Got error code %d from DoTransform function", retval);
+    }
+    srcLayerSpec = dstBufferStack.back();
+    dstBufferStack.pop_back();
+  }
+
+  if (needsAttenuation) {
+    int retval = DoAttenuation(srcLayerSpec, dstBufferStack.back(), needsVFlip);
+    needsVFlip = false;
+    if (retval) {
+      ALOGE("Got error code %d from DoBlending function", retval);
+    }
+    srcLayerSpec = dstBufferStack.back();
+    dstBufferStack.pop_back();
+  }
+
+  if (needsCopy) {
+    int retval = DoCopy(srcLayerSpec, dstBufferStack.back(), needsVFlip);
+    needsVFlip = false;
+    if (retval) {
+      ALOGE("Got error code %d from DoBlending function", retval);
+    }
+    srcLayerSpec = dstBufferStack.back();
+    dstBufferStack.pop_back();
+  }
+
+  // Blending (if needed) should always be the last operation, so that it reads
+  // and writes in the destination layer and not some temporary buffer.
+  if (needsBlending) {
+    int retval = DoBlending(srcLayerSpec, dstBufferStack.back(), needsVFlip);
+    needsVFlip = false;
+    if (retval) {
+      ALOGE("Got error code %d from DoBlending function", retval);
+    }
+    // Don't need to assign destination to source in the last one
+    dstBufferStack.pop_back();
+  }
+
+  return HWC3::Error::None;
+}
+
+namespace {
+
+// Returns a color matrix that can be used with libyuv by converting values
+// in -1 to 1 into -64 to 64 and transposing.
+std::array<std::int8_t, 16> ToLibyuvColorMatrix(
+    const std::array<float, 16>& in) {
+  std::array<std::int8_t, 16> out;
+
+  for (int r = 0; r < 4; r++) {
+    for (int c = 0; c < 4; c++) {
+      int indexIn = (4 * r) + c;
+      int indexOut = (4 * c) + r;
+
+      out[indexOut] = std::max(
+          -128, std::min(127, static_cast<int>(in[indexIn] * 64.0f + 0.5f)));
+    }
+  }
+
+  return out;
+}
+
+}  // namespace
+
+HWC3::Error GuestFrameComposer::applyColorTransformToRGBA(
+    const std::array<float, 16>& transfromMatrix,  //
+    std::uint8_t* buffer,                          //
+    std::uint32_t bufferWidth,                     //
+    std::uint32_t bufferHeight,                    //
+    std::uint32_t bufferStrideBytes) {
+  ATRACE_CALL();
+
+  const auto transformMatrixLibyuv = ToLibyuvColorMatrix(transfromMatrix);
+  libyuv::ARGBColorMatrix(buffer, bufferStrideBytes,     // in buffer params
+                          buffer, bufferStrideBytes,     // out buffer params
+                          transformMatrixLibyuv.data(),  //
+                          bufferWidth,                   //
+                          bufferHeight);
+
+  return HWC3::Error::None;
+}
+
+uint8_t* GuestFrameComposer::getRotatingScratchBuffer(std::size_t neededSize,
+                                                      std::uint32_t order) {
+  static constexpr const int kNumScratchBufferPieces = 2;
+
+  std::size_t totalNeededSize = neededSize * kNumScratchBufferPieces;
+  if (mScratchBuffer.size() < totalNeededSize) {
+    mScratchBuffer.resize(totalNeededSize);
+  }
+
+  std::size_t bufferIndex = order % kNumScratchBufferPieces;
+  std::size_t bufferOffset = bufferIndex * neededSize;
+  return &mScratchBuffer[bufferOffset];
+}
+
+uint8_t* GuestFrameComposer::getSpecialScratchBuffer(size_t neededSize) {
+  if (mSpecialScratchBuffer.size() < neededSize) {
+    mSpecialScratchBuffer.resize(neededSize);
+  }
+
+  return &mSpecialScratchBuffer[0];
+}
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/GuestFrameComposer.h b/system/hwc3/GuestFrameComposer.h
new file mode 100644
index 0000000..2df2f32
--- /dev/null
+++ b/system/hwc3/GuestFrameComposer.h
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_HWC_GUESTFRAMECOMPOSER_H
+#define ANDROID_HWC_GUESTFRAMECOMPOSER_H
+
+#include "Common.h"
+#include "Display.h"
+#include "DrmClient.h"
+#include "FrameComposer.h"
+#include "Gralloc.h"
+#include "Layer.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+class GuestFrameComposer : public FrameComposer {
+ public:
+  GuestFrameComposer() = default;
+
+  GuestFrameComposer(const GuestFrameComposer&) = delete;
+  GuestFrameComposer& operator=(const GuestFrameComposer&) = delete;
+
+  GuestFrameComposer(GuestFrameComposer&&) = delete;
+  GuestFrameComposer& operator=(GuestFrameComposer&&) = delete;
+
+  HWC3::Error init() override;
+
+  HWC3::Error registerOnHotplugCallback(const HotplugCallback& cb) override;
+
+  HWC3::Error unregisterOnHotplugCallback() override;
+
+  HWC3::Error onDisplayCreate(Display*) override;
+
+  HWC3::Error onDisplayDestroy(Display*) override;
+
+  HWC3::Error onDisplayClientTargetSet(Display*) override;
+
+  // Determines if this composer can compose the given layers on the given
+  // display and requests changes for layers that can't not be composed.
+  HWC3::Error validateDisplay(Display* display,
+                              DisplayChanges* outChanges) override;
+
+  // Performs the actual composition of layers and presents the composed result
+  // to the display.
+  HWC3::Error presentDisplay(
+      Display* display, ::android::base::unique_fd* outDisplayFence,
+      std::unordered_map<int64_t, ::android::base::unique_fd>* outLayerFences)
+      override;
+
+  HWC3::Error onActiveConfigChange(Display* /*display*/) override;
+
+  const DrmClient* getDrmPresenter() const override {
+    return &mDrmClient;
+  }
+
+ private:
+  struct DisplayConfig {
+    int width;
+    int height;
+    int dpiX;
+    int dpiY;
+    int refreshRateHz;
+  };
+
+  HWC3::Error getDisplayConfigsFromDeviceConfig(
+      std::vector<DisplayConfig>* configs);
+
+  HWC3::Error getDisplayConfigsFromSystemProp(
+      std::vector<DisplayConfig>* configs);
+
+  // Returns true if the given layer's buffer has supported format.
+  bool canComposeLayer(Layer* layer);
+
+  // Composes the given layer into the given destination buffer.
+  HWC3::Error composeLayerInto(Layer* layer, std::uint8_t* dstBuffer,
+                               std::uint32_t dstBufferWidth,
+                               std::uint32_t dstBufferHeight,
+                               std::uint32_t dstBufferStrideBytes,
+                               std::uint32_t dstBufferBytesPerPixel);
+
+  struct DisplayInfo {
+    // Additional per display buffer for the composition result.
+    buffer_handle_t compositionResultBuffer = nullptr;
+
+    std::shared_ptr<DrmBuffer> compositionResultDrmBuffer;
+  };
+
+  std::unordered_map<int64_t, DisplayInfo> mDisplayInfos;
+
+  Gralloc mGralloc;
+
+  DrmClient mDrmClient;
+
+  // Cuttlefish on QEMU does not have a display. Disable presenting to avoid
+  // spamming logcat with DRM commit failures.
+  bool mPresentDisabled = false;
+
+  uint8_t* getRotatingScratchBuffer(std::size_t neededSize,
+                                    std::uint32_t order);
+  uint8_t* getSpecialScratchBuffer(std::size_t neededSize);
+
+  HWC3::Error applyColorTransformToRGBA(
+      const std::array<float, 16>& colorTransform,  //
+      std::uint8_t* buffer,                         //
+      std::uint32_t bufferWidth,                    //
+      std::uint32_t bufferHeight,                   //
+      std::uint32_t bufferStrideBytes);
+
+  std::vector<uint8_t> mScratchBuffer;
+  std::vector<uint8_t> mSpecialScratchBuffer;
+};
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
+
+#endif
diff --git a/system/hwc3/HostFrameComposer.cpp b/system/hwc3/HostFrameComposer.cpp
new file mode 100644
index 0000000..91590ee
--- /dev/null
+++ b/system/hwc3/HostFrameComposer.cpp
@@ -0,0 +1,800 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "HostFrameComposer.h"
+
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+#include <android-base/parseint.h>
+#include <android-base/properties.h>
+#include <android-base/strings.h>
+#include <android-base/unique_fd.h>
+#include <hardware/hwcomposer2.h>
+#include <poll.h>
+#include <sync/sync.h>
+#include <ui/GraphicBuffer.h>
+#include <ui/GraphicBufferAllocator.h>
+#include <ui/GraphicBufferMapper.h>
+
+#include <optional>
+#include <tuple>
+
+#include "../egl/goldfish_sync.h"
+#include "Display.h"
+#include "HostUtils.h"
+#include "virtgpu_drm.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+namespace {
+
+hwc_rect AsHwcRect(const common::Rect& rect) {
+  hwc_rect out;
+  out.left = rect.left;
+  out.top = rect.top;
+  out.right = rect.right;
+  out.bottom = rect.bottom;
+  return out;
+}
+
+hwc_frect AsHwcFrect(const common::FRect& rect) {
+  hwc_frect out;
+  out.left = rect.left;
+  out.top = rect.top;
+  out.right = rect.right;
+  out.bottom = rect.bottom;
+  return out;
+}
+
+hwc_color AsHwcColor(const Color& color) {
+  hwc_color out;
+  out.r = color.r;
+  out.g = color.g;
+  out.b = color.b;
+  out.a = color.a;
+  return out;
+}
+
+hwc_transform_t AsHwcTransform(const common::Transform& transform) {
+  switch (transform) {
+    case common::Transform::NONE:
+      return static_cast<hwc_transform_t>(0);
+    case common::Transform::FLIP_H:
+      return HWC_TRANSFORM_FLIP_H;
+    case common::Transform::FLIP_V:
+      return HWC_TRANSFORM_FLIP_V;
+    case common::Transform::ROT_90:
+      return HWC_TRANSFORM_ROT_90;
+    case common::Transform::ROT_180:
+      return HWC_TRANSFORM_ROT_180;
+    case common::Transform::ROT_270:
+      return HWC_TRANSFORM_ROT_270;
+  }
+}
+
+static bool isMinigbmFromProperty() {
+  static constexpr const auto kGrallocProp = "ro.hardware.gralloc";
+
+  const auto grallocProp = ::android::base::GetProperty(kGrallocProp, "");
+  DEBUG_LOG("%s: prop value is: %s", __FUNCTION__, grallocProp.c_str());
+
+  if (grallocProp == "minigbm") {
+    DEBUG_LOG("%s: Using minigbm, in minigbm mode.\n", __FUNCTION__);
+    return true;
+  } else {
+    DEBUG_LOG("%s: Is not using minigbm, in goldfish mode.\n", __FUNCTION__);
+    return false;
+  }
+}
+
+static bool useAngleFromProperty() {
+  static constexpr const auto kEglProp = "ro.hardware.egl";
+
+  const auto eglProp = ::android::base::GetProperty(kEglProp, "");
+  DEBUG_LOG("%s: prop value is: %s", __FUNCTION__, eglProp.c_str());
+
+  if (eglProp == "angle") {
+    DEBUG_LOG("%s: Using ANGLE.\n", __FUNCTION__);
+    return true;
+  } else {
+    DEBUG_LOG("%s: Not using ANGLE.\n", __FUNCTION__);
+    return false;
+  }
+}
+
+typedef struct compose_layer {
+  uint32_t cbHandle;
+  hwc2_composition_t composeMode;
+  hwc_rect_t displayFrame;
+  hwc_frect_t crop;
+  int32_t blendMode;
+  float alpha;
+  hwc_color_t color;
+  hwc_transform_t transform;
+} ComposeLayer;
+
+typedef struct compose_device {
+  uint32_t version;
+  uint32_t targetHandle;
+  uint32_t numLayers;
+  struct compose_layer layer[0];
+} ComposeDevice;
+
+typedef struct compose_device_v2 {
+  uint32_t version;
+  uint32_t displayId;
+  uint32_t targetHandle;
+  uint32_t numLayers;
+  struct compose_layer layer[0];
+} ComposeDevice_v2;
+
+class ComposeMsg {
+ public:
+  ComposeMsg(uint32_t layerCnt = 0)
+      : mData(sizeof(ComposeDevice) + layerCnt * sizeof(ComposeLayer)) {
+    mComposeDevice = reinterpret_cast<ComposeDevice*>(mData.data());
+    mLayerCnt = layerCnt;
+  }
+
+  ComposeDevice* get() { return mComposeDevice; }
+
+  uint32_t getLayerCnt() { return mLayerCnt; }
+
+ private:
+  std::vector<uint8_t> mData;
+  uint32_t mLayerCnt;
+  ComposeDevice* mComposeDevice;
+};
+
+class ComposeMsg_v2 {
+ public:
+  ComposeMsg_v2(uint32_t layerCnt = 0)
+      : mData(sizeof(ComposeDevice_v2) + layerCnt * sizeof(ComposeLayer)) {
+    mComposeDevice = reinterpret_cast<ComposeDevice_v2*>(mData.data());
+    mLayerCnt = layerCnt;
+  }
+
+  ComposeDevice_v2* get() { return mComposeDevice; }
+
+  uint32_t getLayerCnt() { return mLayerCnt; }
+
+ private:
+  std::vector<uint8_t> mData;
+  uint32_t mLayerCnt;
+  ComposeDevice_v2* mComposeDevice;
+};
+
+const native_handle_t* AllocateDisplayColorBuffer(int width, int height) {
+  const uint32_t layerCount = 1;
+  const uint64_t graphicBufferId = 0;  // not used
+  buffer_handle_t handle;
+  uint32_t stride;
+
+  if (::android::GraphicBufferAllocator::get().allocate(
+          width, height, ::android::PIXEL_FORMAT_RGBA_8888, layerCount,
+          ::android::GraphicBuffer::USAGE_HW_COMPOSER |
+              ::android::GraphicBuffer::USAGE_HW_RENDER,
+          &handle, &stride, graphicBufferId, "EmuHWC2") == ::android::OK) {
+    return static_cast<const native_handle_t*>(handle);
+  } else {
+    return nullptr;
+  }
+}
+
+void FreeDisplayColorBuffer(const native_handle_t* h) {
+  ::android::GraphicBufferAllocator::get().free(h);
+}
+
+}  // namespace
+
+HWC3::Error HostFrameComposer::init() {
+  mIsMinigbm = isMinigbmFromProperty();
+  mUseAngle = useAngleFromProperty();
+
+  if (mIsMinigbm) {
+    mDrmClient.emplace();
+
+    HWC3::Error error = mDrmClient->init();
+    if (error != HWC3::Error::None) {
+      ALOGE("%s: failed to initialize DrmClient", __FUNCTION__);
+      return error;
+    }
+  } else {
+    mSyncDeviceFd = goldfish_sync_open();
+  }
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error HostFrameComposer::registerOnHotplugCallback(
+    const HotplugCallback& cb) {
+  if (mDrmClient) {
+    mDrmClient->registerOnHotplugCallback(cb);
+  }
+  return HWC3::Error::None;
+}
+
+HWC3::Error HostFrameComposer::unregisterOnHotplugCallback() {
+  if (mDrmClient) {
+    mDrmClient->unregisterOnHotplugCallback();
+  }
+  return HWC3::Error::None;
+}
+
+HWC3::Error HostFrameComposer::createHostComposerDisplayInfo(
+    Display* display, uint32_t hostDisplayId) {
+  HWC3::Error error = HWC3::Error::None;
+
+  int64_t displayId = display->getId();
+  int32_t displayConfigId;
+  int32_t displayWidth;
+  int32_t displayHeight;
+
+  error = display->getActiveConfig(&displayConfigId);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: display:%" PRIu64 " has no active config", __FUNCTION__,
+          displayId);
+    return error;
+  }
+
+  error = display->getDisplayAttribute(displayConfigId, DisplayAttribute::WIDTH,
+                                       &displayWidth);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: display:%" PRIu64 " failed to get width", __FUNCTION__,
+          displayId);
+    return error;
+  }
+
+  error = display->getDisplayAttribute(
+      displayConfigId, DisplayAttribute::HEIGHT, &displayHeight);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: display:%" PRIu64 " failed to get height", __FUNCTION__,
+          displayId);
+    return error;
+  }
+
+  HostComposerDisplayInfo& displayInfo = mDisplayInfos[displayId];
+
+  displayInfo.hostDisplayId = hostDisplayId;
+
+  if (displayInfo.compositionResultBuffer) {
+    FreeDisplayColorBuffer(displayInfo.compositionResultBuffer);
+  }
+  displayInfo.compositionResultBuffer =
+      AllocateDisplayColorBuffer(displayWidth, displayHeight);
+  if (displayInfo.compositionResultBuffer == nullptr) {
+    ALOGE("%s: display:%" PRIu64 " failed to create target buffer",
+          __FUNCTION__, displayId);
+    return HWC3::Error::NoResources;
+  }
+
+  if (mDrmClient) {
+    auto [drmBufferCreateError, drmBuffer] =
+        mDrmClient->create(displayInfo.compositionResultBuffer);
+    if (drmBufferCreateError != HWC3::Error::None) {
+      ALOGE("%s: display:%" PRIu64 " failed to create target drm buffer",
+            __FUNCTION__, displayId);
+      return HWC3::Error::NoResources;
+    }
+    displayInfo.compositionResultDrmBuffer = std::move(drmBuffer);
+  }
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error HostFrameComposer::onDisplayCreate(Display* display) {
+  HWC3::Error error = HWC3::Error::None;
+
+  int64_t displayId = display->getId();
+  int32_t displayConfigId;
+  int32_t displayWidth;
+  int32_t displayHeight;
+  int32_t displayDpiX;
+
+  error = display->getActiveConfig(&displayConfigId);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: display:%" PRIu64 " has no active config", __FUNCTION__,
+          displayId);
+    return error;
+  }
+
+  error = display->getDisplayAttribute(displayConfigId, DisplayAttribute::WIDTH,
+                                       &displayWidth);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: display:%" PRIu64 " failed to get width", __FUNCTION__,
+          displayId);
+    return error;
+  }
+
+  error = display->getDisplayAttribute(
+      displayConfigId, DisplayAttribute::HEIGHT, &displayHeight);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: display:%" PRIu64 " failed to get height", __FUNCTION__,
+          displayId);
+    return error;
+  }
+
+  error = display->getDisplayAttribute(displayConfigId, DisplayAttribute::DPI_X,
+                                       &displayDpiX);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s: display:%" PRIu64 " failed to get height", __FUNCTION__,
+          displayId);
+    return error;
+  }
+
+  uint32_t hostDisplayId = 0;
+
+  DEFINE_AND_VALIDATE_HOST_CONNECTION
+  if (displayId == 0) {
+    // Primary display:
+    hostCon->lock();
+    if (rcEnc->rcCreateDisplayById(rcEnc, displayId)) {
+      ALOGE("%s host failed to create display %" PRIu64, __func__, displayId);
+      hostCon->unlock();
+      return HWC3::Error::NoResources;
+    }
+    if (rcEnc->rcSetDisplayPoseDpi(rcEnc, displayId, -1, -1, displayWidth,
+                                   displayHeight, displayDpiX / 1000)) {
+      ALOGE("%s host failed to set display %" PRIu64, __func__, displayId);
+      hostCon->unlock();
+      return HWC3::Error::NoResources;
+    }
+    hostCon->unlock();
+  } else {
+    // Secondary display:
+    static constexpr const uint32_t kHostDisplayIdStart = 6;
+
+    uint32_t expectedHostDisplayId = kHostDisplayIdStart + displayId - 1;
+    uint32_t actualHostDisplayId = 0;
+
+    hostCon->lock();
+    rcEnc->rcDestroyDisplay(rcEnc, expectedHostDisplayId);
+    rcEnc->rcCreateDisplay(rcEnc, &actualHostDisplayId);
+    rcEnc->rcSetDisplayPose(rcEnc, actualHostDisplayId, -1, -1, displayWidth,
+                            displayHeight);
+    hostCon->unlock();
+
+    if (actualHostDisplayId != expectedHostDisplayId) {
+      ALOGE(
+          "Something wrong with host displayId allocation, expected %d "
+          "but received %d",
+          expectedHostDisplayId, actualHostDisplayId);
+    }
+
+    hostDisplayId = actualHostDisplayId;
+  }
+
+  error = createHostComposerDisplayInfo(display, hostDisplayId);
+  if (error != HWC3::Error::None) {
+    ALOGE("%s failed to initialize host info for display:%" PRIu64,
+          __FUNCTION__, displayId);
+    return error;
+  }
+
+  std::optional<std::vector<uint8_t>> edid;
+  if (mDrmClient) {
+    edid = mDrmClient->getEdid(displayId);
+    if (edid) {
+      display->setEdid(*edid);
+    }
+  }
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error HostFrameComposer::onDisplayDestroy(Display* display) {
+  int64_t displayId = display->getId();
+
+  auto it = mDisplayInfos.find(displayId);
+  if (it == mDisplayInfos.end()) {
+    ALOGE("%s: display:%" PRIu64 " missing display buffers?", __FUNCTION__,
+          displayId);
+    return HWC3::Error::BadDisplay;
+  }
+
+  HostComposerDisplayInfo& displayInfo = mDisplayInfos[displayId];
+
+  if (displayId != 0) {
+    DEFINE_AND_VALIDATE_HOST_CONNECTION
+    hostCon->lock();
+    rcEnc->rcDestroyDisplay(rcEnc, displayInfo.hostDisplayId);
+    hostCon->unlock();
+  }
+
+  FreeDisplayColorBuffer(displayInfo.compositionResultBuffer);
+
+  mDisplayInfos.erase(it);
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error HostFrameComposer::onDisplayClientTargetSet(Display* display) {
+  int64_t displayId = display->getId();
+
+  auto it = mDisplayInfos.find(displayId);
+  if (it == mDisplayInfos.end()) {
+    ALOGE("%s: display:%" PRIu64 " missing display buffers?", __FUNCTION__,
+          displayId);
+    return HWC3::Error::BadDisplay;
+  }
+
+  HostComposerDisplayInfo& displayInfo = mDisplayInfos[displayId];
+
+  if (mIsMinigbm) {
+    FencedBuffer& clientTargetFencedBuffer = display->getClientTarget();
+
+    auto [drmBufferCreateError, drmBuffer] =
+        mDrmClient->create(clientTargetFencedBuffer.getBuffer());
+    if (drmBufferCreateError != HWC3::Error::None) {
+      ALOGE("%s: display:%" PRIu64 " failed to create client target drm buffer",
+            __FUNCTION__, displayId);
+      return HWC3::Error::NoResources;
+    }
+    displayInfo.clientTargetDrmBuffer = std::move(drmBuffer);
+  }
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error HostFrameComposer::validateDisplay(Display* display,
+                                               DisplayChanges* outChanges) {
+  const auto& displayId = display->getId();
+
+  DEFINE_AND_VALIDATE_HOST_CONNECTION
+  hostCon->lock();
+  bool hostCompositionV1 = rcEnc->hasHostCompositionV1();
+  bool hostCompositionV2 = rcEnc->hasHostCompositionV2();
+  hostCon->unlock();
+
+  const std::vector<Layer*> layers = display->getOrderedLayers();
+  for (const auto& layer : layers) {
+    switch (layer->getCompositionType()) {
+      case Composition::INVALID:
+        // Log error for unused layers, layer leak?
+        ALOGE("%s layer:%" PRIu64 " CompositionType not set", __FUNCTION__,
+              layer->getId());
+        break;
+      case Composition::DISPLAY_DECORATION:
+        return HWC3::Error::Unsupported;
+      default:
+        break;
+    }
+  }
+
+  // If one layer requires a fall back to the client composition type, all
+  // layers will fall back to the client composition type.
+  bool fallBackToClient = (!hostCompositionV1 && !hostCompositionV2) ||
+                          display->hasColorTransform();
+
+  if (!fallBackToClient) {
+    for (const auto& layer : layers) {
+      const auto& layerId = layer->getId();
+      const auto& layerCompositionType = layer->getCompositionType();
+
+      std::optional<Composition> layerFallBackTo = std::nullopt;
+      switch (layerCompositionType) {
+        case Composition::CLIENT:
+        case Composition::SIDEBAND:
+          ALOGV("%s: layer %" PRIu32 " CompositionType %d, fallback to client",
+                __FUNCTION__, static_cast<uint32_t>(layer->getId()),
+                layerCompositionType);
+          layerFallBackTo = Composition::CLIENT;
+          break;
+        case Composition::CURSOR:
+          ALOGV("%s: layer %" PRIu32 " CompositionType %d, fallback to device",
+                __FUNCTION__, static_cast<uint32_t>(layer->getId()),
+                layerCompositionType);
+          layerFallBackTo = Composition::DEVICE;
+          break;
+        case Composition::INVALID:
+        case Composition::DEVICE:
+        case Composition::SOLID_COLOR:
+          layerFallBackTo = std::nullopt;
+          break;
+        default:
+          ALOGE("%s: layer %" PRIu32 " has an unknown composition type: %d",
+                __FUNCTION__, static_cast<uint32_t>(layer->getId()),
+                layerCompositionType);
+      }
+      if (layerFallBackTo == Composition::CLIENT) {
+        fallBackToClient = true;
+      }
+      if (layerFallBackTo.has_value()) {
+        outChanges->addLayerCompositionChange(displayId, layerId,
+                                              *layerFallBackTo);
+      }
+    }
+  }
+
+  if (fallBackToClient) {
+    outChanges->clearLayerCompositionChanges();
+    for (auto& layer : layers) {
+      const auto& layerId = layer->getId();
+      if (layer->getCompositionType() == Composition::INVALID) {
+        continue;
+      }
+      if (layer->getCompositionType() != Composition::CLIENT) {
+        outChanges->addLayerCompositionChange(displayId, layerId,
+                                              Composition::CLIENT);
+      }
+    }
+  }
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error HostFrameComposer::presentDisplay(
+    Display* display, ::android::base::unique_fd* outDisplayFence,
+    std::unordered_map<int64_t, ::android::base::unique_fd>* outLayerFences) {
+  auto displayId = display->getId();
+  auto displayInfoIt = mDisplayInfos.find(displayId);
+  if (displayInfoIt == mDisplayInfos.end()) {
+    ALOGE("%s: failed to find display buffers for display:%" PRIu64,
+          __FUNCTION__, displayId);
+    return HWC3::Error::BadDisplay;
+  }
+
+  HostComposerDisplayInfo& displayInfo = displayInfoIt->second;
+
+  HostConnection* hostCon;
+  ExtendedRCEncoderContext* rcEnc;
+  HWC3::Error error = getAndValidateHostConnection(&hostCon, &rcEnc);
+  if (error != HWC3::Error::None) {
+    return error;
+  }
+  hostCon->lock();
+  bool hostCompositionV1 = rcEnc->hasHostCompositionV1();
+  bool hostCompositionV2 = rcEnc->hasHostCompositionV2();
+  hostCon->unlock();
+
+  // Ff we supports v2, then discard v1
+  if (hostCompositionV2) {
+    hostCompositionV1 = false;
+  }
+
+  const std::vector<Layer*> layers = display->getOrderedLayers();
+  if (hostCompositionV2 || hostCompositionV1) {
+    uint32_t numLayer = 0;
+    for (auto layer : layers) {
+      if (layer->getCompositionType() == Composition::DEVICE ||
+          layer->getCompositionType() == Composition::SOLID_COLOR) {
+        numLayer++;
+      }
+    }
+
+    DEBUG_LOG("%s: presenting display:%" PRIu64 " with %d layers", __FUNCTION__,
+              displayId, static_cast<int>(layers.size()));
+
+    if (numLayer == 0) {
+      ALOGV(
+          "%s display has no layers to compose, flushing client target buffer.",
+          __FUNCTION__);
+
+      FencedBuffer& displayClientTarget = display->getClientTarget();
+      if (displayClientTarget.getBuffer() != nullptr) {
+        ::android::base::unique_fd fence = displayClientTarget.getFence();
+        if (mIsMinigbm) {
+          auto [_, flushCompleteFence] = mDrmClient->flushToDisplay(
+              displayId, displayInfo.clientTargetDrmBuffer, fence);
+
+          *outDisplayFence = std::move(flushCompleteFence);
+        } else {
+          post(hostCon, rcEnc, displayClientTarget.getBuffer());
+          *outDisplayFence = std::move(fence);
+        }
+      }
+      return HWC3::Error::None;
+    }
+
+    std::unique_ptr<ComposeMsg> composeMsg;
+    std::unique_ptr<ComposeMsg_v2> composeMsgV2;
+
+    if (hostCompositionV1) {
+      composeMsg.reset(new ComposeMsg(numLayer));
+    } else {
+      composeMsgV2.reset(new ComposeMsg_v2(numLayer));
+    }
+
+    // Handle the composition
+    ComposeDevice* p;
+    ComposeDevice_v2* p2;
+    ComposeLayer* l;
+
+    if (hostCompositionV1) {
+      p = composeMsg->get();
+      l = p->layer;
+    } else {
+      p2 = composeMsgV2->get();
+      l = p2->layer;
+    }
+
+    std::vector<int64_t> releaseLayerIds;
+    for (auto layer : layers) {
+      // TODO: use local var composisitonType to store getCompositionType()
+      if (layer->getCompositionType() != Composition::DEVICE &&
+          layer->getCompositionType() != Composition::SOLID_COLOR) {
+        ALOGE("%s: Unsupported composition types %d layer %u", __FUNCTION__,
+              layer->getCompositionType(), (uint32_t)layer->getId());
+        continue;
+      }
+      // send layer composition command to host
+      if (layer->getCompositionType() == Composition::DEVICE) {
+        releaseLayerIds.emplace_back(layer->getId());
+
+        ::android::base::unique_fd fence = layer->getBuffer().getFence();
+        if (fence.ok()) {
+          int err = sync_wait(fence.get(), 3000);
+          if (err < 0 && errno == ETIME) {
+            ALOGE("%s waited on fence %d for 3000 ms", __FUNCTION__,
+                  fence.get());
+          }
+        } else {
+          ALOGV("%s: acquire fence not set for layer %u", __FUNCTION__,
+                (uint32_t)layer->getId());
+        }
+        const native_handle_t* cb = layer->getBuffer().getBuffer();
+        if (cb != nullptr) {
+          l->cbHandle = hostCon->grallocHelper()->getHostHandle(cb);
+        } else {
+          ALOGE("%s null buffer for layer %d", __FUNCTION__,
+                (uint32_t)layer->getId());
+        }
+      } else {
+        // solidcolor has no buffer
+        l->cbHandle = 0;
+      }
+      l->composeMode = (hwc2_composition_t)layer->getCompositionType();
+      l->displayFrame = AsHwcRect(layer->getDisplayFrame());
+      l->crop = AsHwcFrect(layer->getSourceCrop());
+      l->blendMode = static_cast<int32_t>(layer->getBlendMode());
+      l->alpha = layer->getPlaneAlpha();
+      l->color = AsHwcColor(layer->getColor());
+      l->transform = AsHwcTransform(layer->getTransform());
+      ALOGV(
+          "   cb %d blendmode %d alpha %f %d %d %d %d z %d"
+          " composeMode %d, transform %d",
+          l->cbHandle, l->blendMode, l->alpha, l->displayFrame.left,
+          l->displayFrame.top, l->displayFrame.right, l->displayFrame.bottom,
+          layer->getZOrder(), l->composeMode, l->transform);
+      l++;
+    }
+    if (hostCompositionV1) {
+      p->version = 1;
+      p->targetHandle = hostCon->grallocHelper()->getHostHandle(
+          displayInfo.compositionResultBuffer);
+      p->numLayers = numLayer;
+    } else {
+      p2->version = 2;
+      p2->displayId = displayInfo.hostDisplayId;
+      p2->targetHandle = hostCon->grallocHelper()->getHostHandle(
+          displayInfo.compositionResultBuffer);
+      p2->numLayers = numLayer;
+    }
+
+    void* buffer;
+    uint32_t bufferSize;
+    if (hostCompositionV1) {
+      buffer = (void*)p;
+      bufferSize = sizeof(ComposeDevice) + numLayer * sizeof(ComposeLayer);
+    } else {
+      bufferSize = sizeof(ComposeDevice_v2) + numLayer * sizeof(ComposeLayer);
+      buffer = (void*)p2;
+    }
+
+    ::android::base::unique_fd retire_fd;
+    hostCon->lock();
+    if (rcEnc->hasAsyncFrameCommands()) {
+      if (mIsMinigbm) {
+        rcEnc->rcComposeAsyncWithoutPost(rcEnc, bufferSize, buffer);
+      } else {
+        rcEnc->rcComposeAsync(rcEnc, bufferSize, buffer);
+      }
+    } else {
+      if (mIsMinigbm) {
+        rcEnc->rcComposeWithoutPost(rcEnc, bufferSize, buffer);
+      } else {
+        rcEnc->rcCompose(rcEnc, bufferSize, buffer);
+      }
+    }
+    hostCon->unlock();
+
+    // Send a retire fence and use it as the release fence for all layers,
+    // since media expects it
+    EGLint attribs[] = {EGL_SYNC_NATIVE_FENCE_ANDROID,
+                        EGL_NO_NATIVE_FENCE_FD_ANDROID};
+
+    uint64_t sync_handle, thread_handle;
+
+    // We don't use rc command to sync if we are using ANGLE on the guest with
+    // virtio-gpu.
+    bool useRcCommandToSync = !(mUseAngle && mIsMinigbm);
+
+    if (useRcCommandToSync) {
+      hostCon->lock();
+      rcEnc->rcCreateSyncKHR(
+          rcEnc, EGL_SYNC_NATIVE_FENCE_ANDROID, attribs, 2 * sizeof(EGLint),
+          true /* destroy when signaled */, &sync_handle, &thread_handle);
+      hostCon->unlock();
+    }
+
+    if (mIsMinigbm) {
+      auto [_, fence] = mDrmClient->flushToDisplay(
+          displayId, displayInfo.compositionResultDrmBuffer, -1);
+      retire_fd = std::move(fence);
+    } else {
+      int fd;
+      goldfish_sync_queue_work(mSyncDeviceFd, sync_handle, thread_handle, &fd);
+      retire_fd = ::android::base::unique_fd(fd);
+    }
+
+    for (int64_t layerId : releaseLayerIds) {
+      (*outLayerFences)[layerId] =
+          ::android::base::unique_fd(dup(retire_fd.get()));
+    }
+    *outDisplayFence = ::android::base::unique_fd(dup(retire_fd.get()));
+
+    if (useRcCommandToSync) {
+      hostCon->lock();
+      if (rcEnc->hasAsyncFrameCommands()) {
+        rcEnc->rcDestroySyncKHRAsync(rcEnc, sync_handle);
+      } else {
+        rcEnc->rcDestroySyncKHR(rcEnc, sync_handle);
+      }
+      hostCon->unlock();
+    }
+
+  } else {
+    // we set all layers Composition::CLIENT, so do nothing.
+    FencedBuffer& displayClientTarget = display->getClientTarget();
+    ::android::base::unique_fd displayClientTargetFence =
+        displayClientTarget.getFence();
+    if (mIsMinigbm) {
+      auto [_, flushFence] = mDrmClient->flushToDisplay(
+          displayId, displayInfo.compositionResultDrmBuffer,
+          displayClientTargetFence);
+      *outDisplayFence = std::move(flushFence);
+    } else {
+      post(hostCon, rcEnc, displayClientTarget.getBuffer());
+      *outDisplayFence = std::move(displayClientTargetFence);
+    }
+    ALOGV("%s fallback to post, returns outRetireFence %d", __FUNCTION__,
+          outDisplayFence->get());
+  }
+  return HWC3::Error::None;
+}
+
+void HostFrameComposer::post(HostConnection* hostCon,
+                             ExtendedRCEncoderContext* rcEnc,
+                             buffer_handle_t h) {
+  assert(cb && "native_handle_t::from(h) failed");
+
+  hostCon->lock();
+  rcEnc->rcFBPost(rcEnc, hostCon->grallocHelper()->getHostHandle(h));
+  hostCon->flush();
+  hostCon->unlock();
+}
+
+HWC3::Error HostFrameComposer::onActiveConfigChange(Display* display) {
+  DEBUG_LOG("%s: display:%" PRIu64, __FUNCTION__, display->getId());
+  HWC3::Error error = createHostComposerDisplayInfo(display, display->getId());
+  if (error != HWC3::Error::None) {
+    ALOGE("%s failed to update host info for display:%" PRIu64, __FUNCTION__,
+          display->getId());
+    return error;
+  }
+  return HWC3::Error::None;
+}
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/HostFrameComposer.h b/system/hwc3/HostFrameComposer.h
new file mode 100644
index 0000000..aebf716
--- /dev/null
+++ b/system/hwc3/HostFrameComposer.h
@@ -0,0 +1,108 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_HWC_HOSTFRAMECOMPOSER_H
+#define ANDROID_HWC_HOSTFRAMECOMPOSER_H
+
+#include <android-base/unique_fd.h>
+
+#include <optional>
+#include <tuple>
+
+#include "Common.h"
+#include "DrmClient.h"
+#include "FrameComposer.h"
+#include "HostConnection.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+class HostFrameComposer : public FrameComposer {
+ public:
+  HostFrameComposer() = default;
+
+  HostFrameComposer(const HostFrameComposer&) = delete;
+  HostFrameComposer& operator=(const HostFrameComposer&) = delete;
+
+  HostFrameComposer(HostFrameComposer&&) = delete;
+  HostFrameComposer& operator=(HostFrameComposer&&) = delete;
+
+  HWC3::Error init() override;
+
+  HWC3::Error registerOnHotplugCallback(const HotplugCallback& cb) override;
+
+  HWC3::Error unregisterOnHotplugCallback() override;
+
+  HWC3::Error onDisplayCreate(Display* display) override;
+
+  HWC3::Error onDisplayDestroy(Display* display) override;
+
+  HWC3::Error onDisplayClientTargetSet(Display* display) override;
+
+  // Determines if this composer can compose the given layers on the given
+  // display and requests changes for layers that can't not be composed.
+  HWC3::Error validateDisplay(Display* display,
+                              DisplayChanges* outChanges) override;
+
+  // Performs the actual composition of layers and presents the composed result
+  // to the display.
+  HWC3::Error presentDisplay(
+      Display* display, ::android::base::unique_fd* outDisplayFence,
+      std::unordered_map<int64_t, ::android::base::unique_fd>* outLayerFences)
+      override;
+
+  HWC3::Error onActiveConfigChange(Display* display) override;
+
+  const DrmClient* getDrmPresenter() const override {
+    if (mDrmClient) {
+      return &*mDrmClient;
+    }
+    return nullptr;
+  }
+
+ private:
+  HWC3::Error createHostComposerDisplayInfo(Display* display,
+                                            uint32_t hostDisplayId);
+
+  void post(HostConnection* hostCon, ExtendedRCEncoderContext* rcEnc,
+            buffer_handle_t h);
+
+  bool mIsMinigbm = false;
+
+  bool mUseAngle = false;
+
+  int mSyncDeviceFd = -1;
+
+  struct HostComposerDisplayInfo {
+    uint32_t hostDisplayId = 0;
+
+    // Additional per display buffer for the composition result.
+    const native_handle_t* compositionResultBuffer = nullptr;
+
+    // Drm info for the additional composition result buffer.
+    std::shared_ptr<DrmBuffer> compositionResultDrmBuffer;
+
+    // Drm info for the displays client target buffer.
+    std::shared_ptr<DrmBuffer> clientTargetDrmBuffer;
+  };
+
+  std::unordered_map<int64_t, HostComposerDisplayInfo> mDisplayInfos;
+
+  std::optional<DrmClient> mDrmClient;
+};
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
+
+#endif
diff --git a/system/hwc3/HostUtils.cpp b/system/hwc3/HostUtils.cpp
new file mode 100644
index 0000000..ea0e807
--- /dev/null
+++ b/system/hwc3/HostUtils.cpp
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "HostUtils.h"
+
+#include <memory>
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+HostConnection* createOrGetHostConnection() {
+  static std::unique_ptr<HostConnection> sHostCon;
+
+  if (!sHostCon) {
+    sHostCon = HostConnection::createUnique();
+  }
+  return sHostCon.get();
+}
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
\ No newline at end of file
diff --git a/system/hwc3/HostUtils.h b/system/hwc3/HostUtils.h
new file mode 100644
index 0000000..ef02389
--- /dev/null
+++ b/system/hwc3/HostUtils.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_HWC_HOSTUTILS_H
+#define ANDROID_HWC_HOSTUTILS_H
+
+#include "Common.h"
+#include "HostConnection.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+HostConnection* createOrGetHostConnection();
+
+inline HWC3::Error getAndValidateHostConnection(
+    HostConnection** ppHostCon, ExtendedRCEncoderContext** ppRcEnc) {
+  *ppHostCon = nullptr;
+  *ppRcEnc = nullptr;
+
+  HostConnection* hostCon = createOrGetHostConnection();
+  if (!hostCon) {
+    ALOGE("%s: Failed to get host connection\n", __FUNCTION__);
+    return HWC3::Error::NoResources;
+  }
+  ExtendedRCEncoderContext* rcEnc = hostCon->rcEncoder();
+  if (!rcEnc) {
+    ALOGE("%s: Failed to get renderControl encoder context\n", __FUNCTION__);
+    return HWC3::Error::NoResources;
+  }
+
+  *ppHostCon = hostCon;
+  *ppRcEnc = rcEnc;
+  return HWC3::Error::None;
+}
+
+#define DEFINE_AND_VALIDATE_HOST_CONNECTION                           \
+  HostConnection* hostCon;                                            \
+  ExtendedRCEncoderContext* rcEnc;                                    \
+  {                                                                   \
+    HWC3::Error res = getAndValidateHostConnection(&hostCon, &rcEnc); \
+    if (res != HWC3::Error::None) {                                   \
+      return res;                                                     \
+    }                                                                 \
+  }
+}  // namespace aidl::android::hardware::graphics::composer3::impl
+
+#endif
diff --git a/system/hwc3/Layer.cpp b/system/hwc3/Layer.cpp
new file mode 100644
index 0000000..f58d5a5
--- /dev/null
+++ b/system/hwc3/Layer.cpp
@@ -0,0 +1,339 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Layer.h"
+
+#include <android-base/unique_fd.h>
+#include <sync/sync.h>
+
+#include <atomic>
+#include <cmath>
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+namespace {
+
+std::atomic<int64_t> sNextId{1};
+
+}  // namespace
+
+Layer::Layer() : mId(sNextId++) {}
+
+HWC3::Error Layer::setCursorPosition(const common::Point& position) {
+  DEBUG_LOG("%s: layer:%" PRId64, __FUNCTION__, mId);
+
+  if (mCompositionType != Composition::CURSOR) {
+    ALOGE("%s: CompositionType not Cursor type", __FUNCTION__);
+    return HWC3::Error::BadLayer;
+  }
+
+  mCursorPosition = position;
+  return HWC3::Error::None;
+}
+
+common::Point Layer::getCursorPosition() const {
+  DEBUG_LOG("%s: layer:%" PRId64, __FUNCTION__, mId);
+
+  return mCursorPosition;
+}
+
+HWC3::Error Layer::setBuffer(buffer_handle_t buffer,
+                             const ndk::ScopedFileDescriptor& fence) {
+  DEBUG_LOG("%s: layer:%" PRId64, __FUNCTION__, mId);
+
+  if (buffer == nullptr) {
+    ALOGE("%s: missing handle", __FUNCTION__);
+    return HWC3::Error::BadParameter;
+  }
+
+  mBuffer.set(buffer, fence);
+  return HWC3::Error::None;
+}
+
+FencedBuffer& Layer::getBuffer() {
+  DEBUG_LOG("%s: layer:%" PRId64, __FUNCTION__, mId);
+
+  return mBuffer;
+}
+
+buffer_handle_t Layer::waitAndGetBuffer() {
+  DEBUG_LOG("%s: layer:%" PRId64, __FUNCTION__, mId);
+
+  ::android::base::unique_fd fence = mBuffer.getFence();
+  if (fence.ok()) {
+    int err = sync_wait(fence.get(), 3000);
+    if (err < 0 && errno == ETIME) {
+      ALOGE("%s waited on fence %" PRId32 " for 3000 ms", __FUNCTION__,
+            fence.get());
+    }
+  }
+
+  return mBuffer.getBuffer();
+}
+
+HWC3::Error Layer::setSurfaceDamage(
+    const std::vector<std::optional<common::Rect>>& /*damage*/) {
+  DEBUG_LOG("%s: layer:%" PRId64, __FUNCTION__, mId);
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error Layer::setBlendMode(common::BlendMode blendMode) {
+  const auto blendModeString = toString(blendMode);
+  DEBUG_LOG("%s: layer:%" PRId64 " blend mode:%s", __FUNCTION__, mId,
+            blendModeString.c_str());
+
+  mBlendMode = blendMode;
+  return HWC3::Error::None;
+}
+
+common::BlendMode Layer::getBlendMode() const {
+  const auto blendMode = mBlendMode;
+  const auto blendModeString = toString(blendMode);
+  DEBUG_LOG("%s: layer:%" PRId64 " blend mode:%s", __FUNCTION__, mId,
+            blendModeString.c_str());
+
+  return blendMode;
+}
+
+HWC3::Error Layer::setColor(Color color) {
+  DEBUG_LOG("%s: layer:%" PRId64
+            " color-r:%d color-g:%d color-b:%d color-a:%d)",
+            __FUNCTION__, mId, color.r, color.g, color.b, color.a);
+
+  mColor = color;
+  return HWC3::Error::None;
+}
+
+Color Layer::getColor() const {
+  auto color = mColor;
+  DEBUG_LOG("%s: layer:%" PRId64
+            " color-r:%d color-g:%d color-b:%d color-a:%d)",
+            __FUNCTION__, mId, color.r, color.g, color.b, color.a);
+
+  return color;
+}
+
+HWC3::Error Layer::setCompositionType(Composition compositionType) {
+  const auto compositionTypeString = toString(compositionType);
+  DEBUG_LOG("%s: layer:%" PRId64 " composition type:%s", __FUNCTION__, mId,
+            compositionTypeString.c_str());
+
+  mCompositionType = compositionType;
+  return HWC3::Error::None;
+}
+
+Composition Layer::getCompositionType() const {
+  const auto compositionTypeString = toString(mCompositionType);
+  DEBUG_LOG("%s: layer:%" PRId64 " composition type:%s", __FUNCTION__, mId,
+            compositionTypeString.c_str());
+
+  return mCompositionType;
+}
+
+HWC3::Error Layer::setDataspace(common::Dataspace dataspace) {
+  const auto dataspaceString = toString(dataspace);
+  DEBUG_LOG("%s: layer:%" PRId64 " dataspace:%s", __FUNCTION__, mId,
+            dataspaceString.c_str());
+
+  mDataspace = dataspace;
+  return HWC3::Error::None;
+}
+
+common::Dataspace Layer::getDataspace() const {
+  const auto dataspaceString = toString(mDataspace);
+  DEBUG_LOG("%s: layer:%" PRId64 " dataspace:%s", __FUNCTION__, mId,
+            dataspaceString.c_str());
+
+  return mDataspace;
+}
+
+HWC3::Error Layer::setDisplayFrame(common::Rect frame) {
+  DEBUG_LOG("%s: layer:%" PRId64
+            " display frame rect-left:%d rect-top:%d rect-right:%d rect-bot:%d",
+            __FUNCTION__, mId, frame.left, frame.top, frame.right,
+            frame.bottom);
+
+  mDisplayFrame = frame;
+  return HWC3::Error::None;
+}
+
+common::Rect Layer::getDisplayFrame() const {
+  auto frame = mDisplayFrame;
+  DEBUG_LOG("%s: layer:%" PRId64
+            " display frame rect-left:%d rect-top:%d rect-right:%d rect-bot:%d",
+            __FUNCTION__, mId, frame.left, frame.top, frame.right,
+            frame.bottom);
+
+  return frame;
+}
+
+HWC3::Error Layer::setPlaneAlpha(float alpha) {
+  DEBUG_LOG("%s: layer:%" PRId64 "alpha:%f", __FUNCTION__, mId, alpha);
+
+  mPlaneAlpha = alpha;
+  return HWC3::Error::None;
+}
+
+float Layer::getPlaneAlpha() const {
+  auto alpha = mPlaneAlpha;
+  DEBUG_LOG("%s: layer:%" PRId64 "alpha:%f", __FUNCTION__, mId, alpha);
+
+  return alpha;
+}
+
+HWC3::Error Layer::setSidebandStream(buffer_handle_t /*stream*/) {
+  DEBUG_LOG("%s: layer:%" PRId64, __FUNCTION__, mId);
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error Layer::setSourceCrop(common::FRect crop) {
+  DEBUG_LOG("%s: layer:%" PRId64
+            "crop rect-left:%f rect-top:%f rect-right:%f rect-bot:%f",
+            __FUNCTION__, mId, crop.left, crop.top, crop.right, crop.bottom);
+
+  mSourceCrop = crop;
+  return HWC3::Error::None;
+}
+
+common::FRect Layer::getSourceCrop() const {
+  common::FRect crop = mSourceCrop;
+  DEBUG_LOG("%s: layer:%" PRId64
+            "crop rect-left:%f rect-top:%f rect-right:%f rect-bot:%f",
+            __FUNCTION__, mId, crop.left, crop.top, crop.right, crop.bottom);
+
+  return crop;
+}
+
+common::Rect Layer::getSourceCropInt() const {
+  common::Rect crop = {};
+  crop.left = static_cast<int>(mSourceCrop.left);
+  crop.top = static_cast<int>(mSourceCrop.top);
+  crop.right = static_cast<int>(mSourceCrop.right);
+  crop.bottom = static_cast<int>(mSourceCrop.bottom);
+  DEBUG_LOG("%s: layer:%" PRId64
+            "crop rect-left:%d rect-top:%d rect-right:%d rect-bot:%d",
+            __FUNCTION__, mId, crop.left, crop.top, crop.right, crop.bottom);
+
+  return crop;
+}
+
+HWC3::Error Layer::setTransform(common::Transform transform) {
+  const auto transformString = toString(transform);
+  DEBUG_LOG("%s: layer:%" PRId64 " transform:%s", __FUNCTION__, mId,
+            transformString.c_str());
+
+  mTransform = transform;
+  return HWC3::Error::None;
+}
+
+common::Transform Layer::getTransform() const {
+  const auto transformString = toString(mTransform);
+  DEBUG_LOG("%s: layer:%" PRId64 " transform:%s", __FUNCTION__, mId,
+            transformString.c_str());
+
+  return mTransform;
+}
+
+HWC3::Error Layer::setVisibleRegion(
+    const std::vector<std::optional<common::Rect>>& visible) {
+  DEBUG_LOG("%s: layer:%" PRId64, __FUNCTION__, mId);
+
+  mVisibleRegion.clear();
+  mVisibleRegion.reserve(visible.size());
+  for (const auto& rectOption : visible) {
+    if (rectOption) {
+      mVisibleRegion.push_back(*rectOption);
+    }
+  }
+
+  return HWC3::Error::None;
+}
+
+std::size_t Layer::getNumVisibleRegions() const {
+  const std::size_t num = mVisibleRegion.size();
+  DEBUG_LOG("%s: layer:%" PRId64 " number of visible regions: %zu",
+            __FUNCTION__, mId, num);
+
+  return num;
+}
+
+HWC3::Error Layer::setZOrder(int32_t z) {
+  DEBUG_LOG("%s: layer:%" PRId64 " z:%d", __FUNCTION__, mId, z);
+
+  mZOrder = z;
+  return HWC3::Error::None;
+}
+
+int32_t Layer::getZOrder() const {
+  DEBUG_LOG("%s: layer:%" PRId64 " z:%d", __FUNCTION__, mId, mZOrder);
+
+  return mZOrder;
+}
+
+HWC3::Error Layer::setPerFrameMetadata(
+    const std::vector<std::optional<PerFrameMetadata>>& /*perFrameMetadata*/) {
+  DEBUG_LOG("%s: layer:%" PRId64, __FUNCTION__, mId);
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error Layer::setColorTransform(const std::vector<float>& colorTransform) {
+  DEBUG_LOG("%s: layer:%" PRId64, __FUNCTION__, mId);
+
+  if (colorTransform.size() < 16) {
+    return HWC3::Error::BadParameter;
+  }
+
+  mColorTransform.emplace();
+  std::copy_n(colorTransform.data(), 16, mColorTransform->data());
+  return HWC3::Error::None;
+}
+
+const std::optional<std::array<float, 16>>& Layer::getColorTransform() const {
+  DEBUG_LOG("%s: layer:%" PRId64, __FUNCTION__, mId);
+
+  return mColorTransform;
+}
+
+HWC3::Error Layer::setBrightness(float brightness) {
+  DEBUG_LOG("%s: layer:%" PRId64 " brightness:%f", __FUNCTION__, mId,
+            brightness);
+
+  if (std::isnan(brightness) || brightness < 0.0f || brightness > 1.0f) {
+    ALOGE("%s: layer:%" PRId64 " brightness:%f", __FUNCTION__, mId, brightness);
+    return HWC3::Error::BadParameter;
+  }
+
+  mBrightness = brightness;
+  return HWC3::Error::None;
+}
+
+float Layer::getBrightness() const {
+  DEBUG_LOG("%s: layer:%" PRId64, __FUNCTION__, mId);
+
+  return mBrightness;
+}
+
+HWC3::Error Layer::setPerFrameMetadataBlobs(
+    const std::vector<
+        std::optional<PerFrameMetadataBlob>>& /*perFrameMetadata*/) {
+  DEBUG_LOG("%s: layer:%" PRId64, __FUNCTION__, mId);
+
+  return HWC3::Error::None;
+}
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/Layer.h b/system/hwc3/Layer.h
new file mode 100644
index 0000000..4d100a1
--- /dev/null
+++ b/system/hwc3/Layer.h
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_HWC_LAYER_H
+#define ANDROID_HWC_LAYER_H
+
+#include <vector>
+
+#include "Common.h"
+#include "FencedBuffer.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+class Layer {
+ public:
+  explicit Layer();
+
+  Layer(const Layer&) = delete;
+  Layer& operator=(const Layer&) = delete;
+
+  Layer(Layer&&) = delete;
+  Layer& operator=(Layer&&) = delete;
+
+  int64_t getId() const { return mId; }
+
+  HWC3::Error setCursorPosition(const common::Point& cursorPosition);
+  common::Point getCursorPosition() const;
+
+  HWC3::Error setBuffer(buffer_handle_t buffer,
+                        const ndk::ScopedFileDescriptor& fence);
+  FencedBuffer& getBuffer();
+  buffer_handle_t waitAndGetBuffer();
+
+  HWC3::Error setSurfaceDamage(
+      const std::vector<std::optional<common::Rect>>& damage);
+
+  HWC3::Error setBlendMode(common::BlendMode mode);
+  common::BlendMode getBlendMode() const;
+
+  HWC3::Error setColor(Color color);
+  Color getColor() const;
+
+  HWC3::Error setCompositionType(Composition composition);
+  Composition getCompositionType() const;
+
+  HWC3::Error setDataspace(common::Dataspace dataspace);
+  common::Dataspace getDataspace() const;
+
+  HWC3::Error setDisplayFrame(common::Rect frame);
+  common::Rect getDisplayFrame() const;
+
+  HWC3::Error setPlaneAlpha(float alpha);
+  float getPlaneAlpha() const;
+
+  HWC3::Error setSidebandStream(buffer_handle_t stream);
+
+  HWC3::Error setSourceCrop(common::FRect crop);
+  common::FRect getSourceCrop() const;
+  common::Rect getSourceCropInt() const;
+
+  HWC3::Error setTransform(common::Transform transform);
+  common::Transform getTransform() const;
+
+  HWC3::Error setVisibleRegion(
+      const std::vector<std::optional<common::Rect>>& visible);
+  std::size_t getNumVisibleRegions() const;
+
+  HWC3::Error setZOrder(int32_t z);
+  int32_t getZOrder() const;
+
+  HWC3::Error setPerFrameMetadata(
+      const std::vector<std::optional<PerFrameMetadata>>& perFrameMetadata);
+
+  HWC3::Error setColorTransform(const std::vector<float>& colorTransform);
+  const std::optional<std::array<float, 16>>& getColorTransform() const;
+
+  HWC3::Error setBrightness(float brightness);
+  float getBrightness() const;
+
+  HWC3::Error setPerFrameMetadataBlobs(
+      const std::vector<std::optional<PerFrameMetadataBlob>>& perFrameMetadata);
+
+ private:
+  const int64_t mId;
+  common::Point mCursorPosition;
+  FencedBuffer mBuffer;
+  common::BlendMode mBlendMode = common::BlendMode::NONE;
+  Color mColor = {0, 0, 0, 0};
+  Composition mCompositionType = Composition::INVALID;
+  common::Dataspace mDataspace = common::Dataspace::UNKNOWN;
+  common::Rect mDisplayFrame = {0, 0, -1, -1};
+  float mPlaneAlpha = 0.0f;
+  common::FRect mSourceCrop = {0.0f, 0.0f, -1.0f, -1.0f};
+  common::Transform mTransform = common::Transform{0};
+  std::vector<common::Rect> mVisibleRegion;
+  int32_t mZOrder = 0;
+  std::optional<std::array<float, 16>> mColorTransform;
+  float mBrightness = 1.0f;
+};
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
+
+#endif
diff --git a/system/hwc3/LruCache.h b/system/hwc3/LruCache.h
new file mode 100644
index 0000000..9ffca46
--- /dev/null
+++ b/system/hwc3/LruCache.h
@@ -0,0 +1,83 @@
+// Copyright 2022 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include <list>
+#include <unordered_map>
+
+template <typename Key, typename Value>
+class LruCache {
+  public:
+    LruCache(std::size_t maxSize) : m_maxSize(maxSize) {
+        m_table.reserve(maxSize);
+    }
+
+    Value* get(const Key& key) {
+        auto tableIt = m_table.find(key);
+        if (tableIt == m_table.end()) {
+            return nullptr;
+        }
+
+        // Move to front.
+        auto elementsIt = tableIt->second;
+        m_elements.splice(elementsIt, m_elements, m_elements.begin());
+        return &elementsIt->value;
+    }
+
+    void set(const Key& key, Value&& value) {
+        auto tableIt = m_table.find(key);
+        if (tableIt == m_table.end()) {
+            if (m_table.size() >= m_maxSize) {
+                auto& kv = m_elements.back();
+                m_table.erase(kv.key);
+                m_elements.pop_back();
+            }
+        } else {
+            auto elementsIt = tableIt->second;
+            m_elements.erase(elementsIt);
+        }
+        m_elements.emplace_front(KeyValue{
+            key,
+            std::forward<Value>(value),
+        });
+        m_table[key] = m_elements.begin();
+    }
+
+    void remove(const Key& key) {
+        auto tableIt = m_table.find(key);
+        if (tableIt == m_table.end()) {
+            return;
+        }
+        auto elementsIt = tableIt->second;
+        m_elements.erase(elementsIt);
+        m_table.erase(tableIt);
+    }
+
+    void clear() {
+        m_elements.clear();
+        m_table.clear();
+    }
+
+  private:
+    struct KeyValue {
+        Key key;
+        Value value;
+    };
+
+    const std::size_t m_maxSize;
+    // Front is the most recently used and back is the least recently used.
+    std::list<KeyValue> m_elements;
+    std::unordered_map<Key, typename std::list<KeyValue>::iterator> m_table;
+};
diff --git a/system/hwc3/Main.cpp b/system/hwc3/Main.cpp
new file mode 100644
index 0000000..440a1c2
--- /dev/null
+++ b/system/hwc3/Main.cpp
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2022, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <android-base/logging.h>
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
+#include <binder/ProcessState.h>
+#include <sched.h>
+
+#include "Composer.h"
+
+using aidl::android::hardware::graphics::composer3::impl::Composer;
+
+int main(int /*argc*/, char** /*argv*/) {
+  ALOGI("RanchuHWC (HWComposer3/HWC3) starting up...");
+
+  // same as SF main thread
+  struct sched_param param = {0};
+  param.sched_priority = 2;
+  if (sched_setscheduler(0, SCHED_FIFO | SCHED_RESET_ON_FORK, &param) != 0) {
+    ALOGE("%s: failed to set priority: %s", __FUNCTION__, strerror(errno));
+  }
+
+  auto composer = ndk::SharedRefBase::make<Composer>();
+  CHECK(composer != nullptr);
+
+  const std::string instance =
+      std::string() + Composer::descriptor + "/default";
+  binder_status_t status =
+      AServiceManager_addService(composer->asBinder().get(), instance.c_str());
+  CHECK(status == STATUS_OK);
+
+  // Thread pool for vendor libbinder for internal vendor services
+  android::ProcessState::self()->setThreadPoolMaxThreadCount(2);
+  android::ProcessState::self()->startThreadPool();
+
+  // Thread pool for system libbinder (via libbinder_ndk) for aidl services
+  // IComposer and IDisplay
+  ABinderProcess_setThreadPoolMaxThreadCount(5);
+  ABinderProcess_startThreadPool();
+  ABinderProcess_joinThreadPool();
+
+  return EXIT_FAILURE;
+}
\ No newline at end of file
diff --git a/system/hwc3/NoOpFrameComposer.cpp b/system/hwc3/NoOpFrameComposer.cpp
new file mode 100644
index 0000000..e988d46
--- /dev/null
+++ b/system/hwc3/NoOpFrameComposer.cpp
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "NoOpFrameComposer.h"
+
+#include "Display.h"
+#include "Drm.h"
+#include "Layer.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+HWC3::Error NoOpFrameComposer::init() {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error NoOpFrameComposer::registerOnHotplugCallback(
+    const HotplugCallback&) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error NoOpFrameComposer::unregisterOnHotplugCallback() {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error NoOpFrameComposer::onDisplayCreate(Display*) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error NoOpFrameComposer::onDisplayDestroy(Display*) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error NoOpFrameComposer::onDisplayClientTargetSet(Display*) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error NoOpFrameComposer::onActiveConfigChange(Display*) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  return HWC3::Error::None;
+};
+
+HWC3::Error NoOpFrameComposer::validateDisplay(Display*, DisplayChanges*) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error NoOpFrameComposer::presentDisplay(
+    Display*, ::android::base::unique_fd*,
+    std::unordered_map<int64_t,
+                       ::android::base::unique_fd>* /*outLayerFences*/) {
+  DEBUG_LOG("%s", __FUNCTION__);
+
+  return HWC3::Error::None;
+}
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/NoOpFrameComposer.h b/system/hwc3/NoOpFrameComposer.h
new file mode 100644
index 0000000..b773a3e
--- /dev/null
+++ b/system/hwc3/NoOpFrameComposer.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_HWC_NOOPFRAMECOMPOSER_H
+#define ANDROID_HWC_NOOPFRAMECOMPOSER_H
+
+#include "Common.h"
+#include "Display.h"
+#include "DrmClient.h"
+#include "FrameComposer.h"
+#include "Gralloc.h"
+#include "Layer.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+class NoOpFrameComposer : public FrameComposer {
+ public:
+  NoOpFrameComposer() = default;
+
+  NoOpFrameComposer(const NoOpFrameComposer&) = delete;
+  NoOpFrameComposer& operator=(const NoOpFrameComposer&) = delete;
+
+  NoOpFrameComposer(NoOpFrameComposer&&) = delete;
+  NoOpFrameComposer& operator=(NoOpFrameComposer&&) = delete;
+
+  HWC3::Error init() override;
+
+  HWC3::Error registerOnHotplugCallback(const HotplugCallback& cb) override;
+
+  HWC3::Error unregisterOnHotplugCallback() override;
+
+  HWC3::Error onDisplayCreate(Display*) override;
+
+  HWC3::Error onDisplayDestroy(Display*) override;
+
+  HWC3::Error onDisplayClientTargetSet(Display*) override;
+
+  // Determines if this composer can compose the given layers on the given
+  // display and requests changes for layers that can't not be composed.
+  HWC3::Error validateDisplay(Display* display,
+                              DisplayChanges* outChanges) override;
+
+  // Performs the actual composition of layers and presents the composed result
+  // to the display.
+  HWC3::Error presentDisplay(
+      Display* display, ::android::base::unique_fd* outDisplayFence,
+      std::unordered_map<int64_t, ::android::base::unique_fd>* outLayerFences)
+      override;
+
+  HWC3::Error onActiveConfigChange(Display* /*display*/) override;
+};
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
+
+#endif
diff --git a/system/hwc3/Time.h b/system/hwc3/Time.h
new file mode 100644
index 0000000..79473a5
--- /dev/null
+++ b/system/hwc3/Time.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_HWC_TIME_H
+#define ANDROID_HWC_TIME_H
+
+#include <utils/Timers.h>
+
+#include <chrono>
+
+#include "Common.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+using Nanoseconds = std::chrono::nanoseconds;
+
+using TimePoint = std::chrono::time_point<std::chrono::steady_clock>;
+
+inline TimePoint asTimePoint(int64_t nanos) {
+  return TimePoint(Nanoseconds(nanos));
+}
+
+inline TimePoint now() {
+  return asTimePoint(systemTime(SYSTEM_TIME_MONOTONIC));
+}
+
+inline int32_t asNanosDuration(Nanoseconds duration) {
+  return duration.count();
+}
+
+inline int64_t asNanosTimePoint(TimePoint time) {
+  TimePoint zero(Nanoseconds(0));
+  return std::chrono::duration_cast<Nanoseconds>(time - zero).count();
+}
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
+
+#endif
diff --git a/system/hwc3/VsyncThread.cpp b/system/hwc3/VsyncThread.cpp
new file mode 100644
index 0000000..350a906
--- /dev/null
+++ b/system/hwc3/VsyncThread.cpp
@@ -0,0 +1,184 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "VsyncThread.h"
+
+#include <utils/ThreadDefs.h>
+
+#include <thread>
+
+#include "Time.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+namespace {
+
+// Returns the timepoint of the next vsync after the 'now' timepoint that is
+// a multiple of 'vsyncPeriod' in-phase/offset-from 'previousSync'.
+//
+// Some examples:
+//  * vsyncPeriod=50ns previousVsync=500ns now=510ns => 550ns
+//  * vsyncPeriod=50ns previousVsync=300ns now=510ns => 550ns
+//  * vsyncPeriod=50ns previousVsync=500ns now=550ns => 550ns
+TimePoint GetNextVsyncInPhase(Nanoseconds vsyncPeriod, TimePoint previousVsync,
+                              TimePoint now) {
+  const auto elapsed = Nanoseconds(now - previousVsync);
+  const auto nextMultiple = (elapsed / vsyncPeriod) + 1;
+  return previousVsync + (nextMultiple * vsyncPeriod);
+}
+
+}  // namespace
+
+VsyncThread::VsyncThread(int64_t displayId) : mDisplayId(displayId) {
+  mPreviousVsync = std::chrono::steady_clock::now() - mVsyncPeriod;
+}
+
+VsyncThread::~VsyncThread() { stop(); }
+
+HWC3::Error VsyncThread::start(int32_t vsyncPeriodNanos) {
+  DEBUG_LOG("%s for display:%" PRIu64, __FUNCTION__, mDisplayId);
+
+  mVsyncPeriod = Nanoseconds(vsyncPeriodNanos);
+
+  mThread = std::thread([this]() { threadLoop(); });
+
+  const std::string name =
+      "display_" + std::to_string(mDisplayId) + "_vsync_thread";
+
+  int ret = pthread_setname_np(mThread.native_handle(), name.c_str());
+  if (ret != 0) {
+    ALOGE("%s: failed to set Vsync thread name: %s", __FUNCTION__,
+          strerror(ret));
+  }
+
+  struct sched_param param = {
+      .sched_priority = ANDROID_PRIORITY_DISPLAY,
+  };
+  ret = pthread_setschedparam(mThread.native_handle(), SCHED_FIFO, &param);
+  if (ret != 0) {
+    ALOGE("%s: failed to set Vsync thread priority: %s", __FUNCTION__,
+          strerror(ret));
+  }
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error VsyncThread::stop() {
+  mShuttingDown.store(true);
+  mThread.join();
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error VsyncThread::setCallbacks(
+    const std::shared_ptr<IComposerCallback>& callback) {
+  DEBUG_LOG("%s for display:%" PRIu64, __FUNCTION__, mDisplayId);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  mCallbacks = callback;
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error VsyncThread::setVsyncEnabled(bool enabled) {
+  DEBUG_LOG("%s for display:%" PRIu64 " enabled:%d", __FUNCTION__, mDisplayId,
+            enabled);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+
+  mVsyncEnabled = enabled;
+
+  return HWC3::Error::None;
+}
+
+HWC3::Error VsyncThread::scheduleVsyncUpdate(
+    int32_t newVsyncPeriod, const VsyncPeriodChangeConstraints& constraints,
+    VsyncPeriodChangeTimeline* outTimeline) {
+  DEBUG_LOG("%s for display:%" PRIu64, __FUNCTION__, mDisplayId);
+
+  PendingUpdate update;
+  update.period = Nanoseconds(newVsyncPeriod);
+  update.updateAfter = asTimePoint(constraints.desiredTimeNanos);
+
+  std::unique_lock<std::mutex> lock(mStateMutex);
+  mPendingUpdate.emplace(std::move(update));
+
+  TimePoint nextVsync =
+      GetNextVsyncInPhase(mVsyncPeriod, mPreviousVsync, update.updateAfter);
+
+  outTimeline->newVsyncAppliedTimeNanos = asNanosTimePoint(nextVsync);
+  outTimeline->refreshRequired = false;
+  outTimeline->refreshTimeNanos = 0;
+
+  return HWC3::Error::None;
+}
+
+Nanoseconds VsyncThread::updateVsyncPeriodLocked(TimePoint now) {
+  if (mPendingUpdate && now > mPendingUpdate->updateAfter) {
+    mVsyncPeriod = mPendingUpdate->period;
+    mPendingUpdate.reset();
+  }
+
+  return mVsyncPeriod;
+}
+
+void VsyncThread::threadLoop() {
+  ALOGI("Vsync thread for display:%" PRId64 " starting", mDisplayId);
+
+  Nanoseconds vsyncPeriod = mVsyncPeriod;
+
+  int vsyncs = 0;
+  TimePoint previousLog = std::chrono::steady_clock::now();
+
+  while (!mShuttingDown.load()) {
+    TimePoint now = std::chrono::steady_clock::now();
+    TimePoint nextVsync = GetNextVsyncInPhase(vsyncPeriod, mPreviousVsync, now);
+
+    std::this_thread::sleep_until(nextVsync);
+    {
+      std::unique_lock<std::mutex> lock(mStateMutex);
+
+      mPreviousVsync = nextVsync;
+
+      // Display has finished refreshing at previous vsync period. Update the
+      // vsync period if there was a pending update.
+      vsyncPeriod = updateVsyncPeriodLocked(mPreviousVsync);
+    }
+
+    if (mVsyncEnabled) {
+      if (mCallbacks) {
+        DEBUG_LOG("%s: for display:%" PRIu64 " calling vsync", __FUNCTION__,
+                  mDisplayId);
+        mCallbacks->onVsync(mDisplayId, asNanosTimePoint(nextVsync),
+                            asNanosDuration(vsyncPeriod));
+      }
+    }
+
+    static constexpr const int kLogIntervalSeconds = 60;
+    if (now > (previousLog + std::chrono::seconds(kLogIntervalSeconds))) {
+      DEBUG_LOG("%s: for display:%" PRIu64 " send %" PRIu32
+                " in last %d seconds",
+                __FUNCTION__, mDisplayId, vsyncs, kLogIntervalSeconds);
+      previousLog = now;
+      vsyncs = 0;
+    }
+    ++vsyncs;
+  }
+
+  ALOGI("Vsync thread for display:%" PRId64 " finished", mDisplayId);
+}
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
diff --git a/system/hwc3/VsyncThread.h b/system/hwc3/VsyncThread.h
new file mode 100644
index 0000000..ffa859f
--- /dev/null
+++ b/system/hwc3/VsyncThread.h
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_HWC_VSYNCTHREAD_H
+#define ANDROID_HWC_VSYNCTHREAD_H
+
+#include <aidl/android/hardware/graphics/composer3/VsyncPeriodChangeConstraints.h>
+#include <aidl/android/hardware/graphics/composer3/VsyncPeriodChangeTimeline.h>
+#include <android/hardware/graphics/common/1.0/types.h>
+
+#include <chrono>
+#include <mutex>
+#include <optional>
+#include <thread>
+
+#include "Common.h"
+
+namespace aidl::android::hardware::graphics::composer3::impl {
+
+// Generates Vsync signals in software.
+class VsyncThread {
+ public:
+  VsyncThread(int64_t id);
+  virtual ~VsyncThread();
+
+  VsyncThread(const VsyncThread&) = delete;
+  VsyncThread& operator=(const VsyncThread&) = delete;
+
+  VsyncThread(VsyncThread&&) = delete;
+  VsyncThread& operator=(VsyncThread&&) = delete;
+
+  HWC3::Error start(int32_t periodNanos);
+
+  HWC3::Error setCallbacks(const std::shared_ptr<IComposerCallback>& callback);
+
+  HWC3::Error setVsyncEnabled(bool enabled);
+
+  HWC3::Error scheduleVsyncUpdate(
+      int32_t newVsyncPeriod,
+      const VsyncPeriodChangeConstraints& newVsyncPeriodChangeConstraints,
+      VsyncPeriodChangeTimeline* timeline);
+
+ private:
+  HWC3::Error stop();
+
+  void threadLoop();
+
+  std::chrono::nanoseconds updateVsyncPeriodLocked(
+      std::chrono::time_point<std::chrono::steady_clock> now);
+
+  const int64_t mDisplayId;
+
+  std::thread mThread;
+
+  std::mutex mStateMutex;
+
+  std::atomic<bool> mShuttingDown{false};
+
+  std::shared_ptr<IComposerCallback> mCallbacks;
+
+  bool mVsyncEnabled = false;
+  std::chrono::nanoseconds mVsyncPeriod;
+  std::chrono::time_point<std::chrono::steady_clock> mPreviousVsync;
+
+  struct PendingUpdate {
+    std::chrono::nanoseconds period;
+    std::chrono::time_point<std::chrono::steady_clock> updateAfter;
+  };
+  std::optional<PendingUpdate> mPendingUpdate;
+};
+
+}  // namespace aidl::android::hardware::graphics::composer3::impl
+
+#endif
diff --git a/system/hwc3/hwc3.rc b/system/hwc3/hwc3.rc
new file mode 100644
index 0000000..ebb2948
--- /dev/null
+++ b/system/hwc3/hwc3.rc
@@ -0,0 +1,7 @@
+service vendor.hwcomposer-3 /vendor/bin/hw/android.hardware.graphics.composer3-service.ranchu
+    class hal animation
+    user system
+    group graphics drmrpc
+    capabilities SYS_NICE
+    onrestart restart surfaceflinger
+    task_profiles ServiceCapacityLow
\ No newline at end of file
diff --git a/system/hwc3/hwc3.xml b/system/hwc3/hwc3.xml
new file mode 100644
index 0000000..79d6a8d
--- /dev/null
+++ b/system/hwc3/hwc3.xml
@@ -0,0 +1,10 @@
+<manifest version="1.0" type="device">
+    <hal format="aidl">
+        <name>android.hardware.graphics.composer3</name>
+        <version>1</version>
+        <interface>
+            <name>IComposer</name>
+            <instance>default</instance>
+        </interface>
+    </hal>
+</manifest>
\ No newline at end of file
diff --git a/system/hwc3/virtgpu_drm.h b/system/hwc3/virtgpu_drm.h
new file mode 100644
index 0000000..a13e20c
--- /dev/null
+++ b/system/hwc3/virtgpu_drm.h
@@ -0,0 +1,246 @@
+/*
+ * Copyright 2013 Red Hat
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+#ifndef VIRTGPU_DRM_H
+#define VIRTGPU_DRM_H
+
+#include "drm.h"
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/* Please note that modifications to all structs defined here are
+ * subject to backwards-compatibility constraints.
+ *
+ * Do not use pointers, use __u64 instead for 32 bit / 64 bit user/kernel
+ * compatibility Keep fields aligned to their size
+ */
+
+#define DRM_VIRTGPU_MAP         0x01
+#define DRM_VIRTGPU_EXECBUFFER  0x02
+#define DRM_VIRTGPU_GETPARAM    0x03
+#define DRM_VIRTGPU_RESOURCE_CREATE 0x04
+#define DRM_VIRTGPU_RESOURCE_INFO     0x05
+#define DRM_VIRTGPU_TRANSFER_FROM_HOST 0x06
+#define DRM_VIRTGPU_TRANSFER_TO_HOST 0x07
+#define DRM_VIRTGPU_WAIT     0x08
+#define DRM_VIRTGPU_GET_CAPS  0x09
+#define DRM_VIRTGPU_RESOURCE_CREATE_BLOB 0x0a
+#define DRM_VIRTGPU_CONTEXT_INIT 0x0b
+
+#define VIRTGPU_EXECBUF_FENCE_FD_IN	0x01
+#define VIRTGPU_EXECBUF_FENCE_FD_OUT	0x02
+#define VIRTGPU_EXECBUF_RING_IDX	0x04
+#define VIRTGPU_EXECBUF_FLAGS  (\
+		VIRTGPU_EXECBUF_FENCE_FD_IN |\
+		VIRTGPU_EXECBUF_FENCE_FD_OUT |\
+		VIRTGPU_EXECBUF_RING_IDX |\
+		0)
+
+struct drm_virtgpu_map {
+	__u64 offset; /* use for mmap system call */
+	__u32 handle;
+	__u32 pad;
+};
+
+struct drm_virtgpu_execbuffer {
+	__u32 flags;
+	__u32 size;
+	__u64 command; /* void* */
+	__u64 bo_handles;
+	__u32 num_bo_handles;
+	__s32 fence_fd; /* in/out fence fd (see VIRTGPU_EXECBUF_FENCE_FD_IN/OUT) */
+	__u32 ring_idx; /* command ring index (see VIRTGPU_EXECBUF_RING_IDX) */
+	__u32 pad;
+};
+
+#define VIRTGPU_PARAM_3D_FEATURES 1 /* do we have 3D features in the hw */
+#define VIRTGPU_PARAM_CAPSET_QUERY_FIX 2 /* do we have the capset fix */
+#define VIRTGPU_PARAM_RESOURCE_BLOB 3 /* DRM_VIRTGPU_RESOURCE_CREATE_BLOB */
+#define VIRTGPU_PARAM_HOST_VISIBLE 4 /* Host blob resources are mappable */
+#define VIRTGPU_PARAM_CROSS_DEVICE 5 /* Cross virtio-device resource sharing  */
+#define VIRTGPU_PARAM_CONTEXT_INIT 6 /* DRM_VIRTGPU_CONTEXT_INIT */
+#define VIRTGPU_PARAM_SUPPORTED_CAPSET_IDs 7 /* Bitmask of supported capability set ids */
+
+struct drm_virtgpu_getparam {
+	__u64 param;
+	__u64 value;
+};
+
+/* NO_BO flags? NO resource flag? */
+/* resource flag for y_0_top */
+struct drm_virtgpu_resource_create {
+	__u32 target;
+	__u32 format;
+	__u32 bind;
+	__u32 width;
+	__u32 height;
+	__u32 depth;
+	__u32 array_size;
+	__u32 last_level;
+	__u32 nr_samples;
+	__u32 flags;
+	__u32 bo_handle; /* if this is set - recreate a new resource attached to this bo ? */
+	__u32 res_handle;  /* returned by kernel */
+	__u32 size;        /* validate transfer in the host */
+	__u32 stride;      /* validate transfer in the host */
+};
+
+struct drm_virtgpu_resource_info {
+	__u32 bo_handle;
+	__u32 res_handle;
+	__u32 size;
+	__u32 blob_mem;
+};
+
+struct drm_virtgpu_3d_box {
+	__u32 x;
+	__u32 y;
+	__u32 z;
+	__u32 w;
+	__u32 h;
+	__u32 d;
+};
+
+struct drm_virtgpu_3d_transfer_to_host {
+	__u32 bo_handle;
+	struct drm_virtgpu_3d_box box;
+	__u32 level;
+	__u32 offset;
+	__u32 stride;
+	__u32 layer_stride;
+};
+
+struct drm_virtgpu_3d_transfer_from_host {
+	__u32 bo_handle;
+	struct drm_virtgpu_3d_box box;
+	__u32 level;
+	__u32 offset;
+	__u32 stride;
+	__u32 layer_stride;
+};
+
+#define VIRTGPU_WAIT_NOWAIT 1 /* like it */
+struct drm_virtgpu_3d_wait {
+	__u32 handle; /* 0 is an invalid handle */
+	__u32 flags;
+};
+
+struct drm_virtgpu_get_caps {
+	__u32 cap_set_id;
+	__u32 cap_set_ver;
+	__u64 addr;
+	__u32 size;
+	__u32 pad;
+};
+
+struct drm_virtgpu_resource_create_blob {
+#define VIRTGPU_BLOB_MEM_GUEST             0x0001
+#define VIRTGPU_BLOB_MEM_HOST3D            0x0002
+#define VIRTGPU_BLOB_MEM_HOST3D_GUEST      0x0003
+
+#define VIRTGPU_BLOB_FLAG_USE_MAPPABLE     0x0001
+#define VIRTGPU_BLOB_FLAG_USE_SHAREABLE    0x0002
+#define VIRTGPU_BLOB_FLAG_USE_CROSS_DEVICE 0x0004
+	/* zero is invalid blob_mem */
+	__u32 blob_mem;
+	__u32 blob_flags;
+	__u32 bo_handle;
+	__u32 res_handle;
+	__u64 size;
+
+	/*
+	 * for 3D contexts with VIRTGPU_BLOB_MEM_HOST3D_GUEST and
+	 * VIRTGPU_BLOB_MEM_HOST3D otherwise, must be zero.
+	 */
+	__u32 pad;
+	__u32 cmd_size;
+	__u64 cmd;
+	__u64 blob_id;
+};
+
+#define VIRTGPU_CONTEXT_PARAM_CAPSET_ID       0x0001
+#define VIRTGPU_CONTEXT_PARAM_NUM_RINGS       0x0002
+#define VIRTGPU_CONTEXT_PARAM_POLL_RINGS_MASK 0x0003
+struct drm_virtgpu_context_set_param {
+	__u64 param;
+	__u64 value;
+};
+
+struct drm_virtgpu_context_init {
+	__u32 num_params;
+	__u32 pad;
+
+	/* pointer to drm_virtgpu_context_set_param array */
+	__u64 ctx_set_params;
+};
+
+#define DRM_IOCTL_VIRTGPU_MAP \
+	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_MAP, struct drm_virtgpu_map)
+
+#define DRM_IOCTL_VIRTGPU_EXECBUFFER \
+	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_EXECBUFFER,\
+		struct drm_virtgpu_execbuffer)
+
+#define DRM_IOCTL_VIRTGPU_GETPARAM \
+	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_GETPARAM,\
+		struct drm_virtgpu_getparam)
+
+#define DRM_IOCTL_VIRTGPU_RESOURCE_CREATE			\
+	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_RESOURCE_CREATE,	\
+		struct drm_virtgpu_resource_create)
+
+#define DRM_IOCTL_VIRTGPU_RESOURCE_INFO \
+	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_RESOURCE_INFO, \
+		 struct drm_virtgpu_resource_info)
+
+#define DRM_IOCTL_VIRTGPU_TRANSFER_FROM_HOST \
+	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_TRANSFER_FROM_HOST,	\
+		struct drm_virtgpu_3d_transfer_from_host)
+
+#define DRM_IOCTL_VIRTGPU_TRANSFER_TO_HOST \
+	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_TRANSFER_TO_HOST,	\
+		struct drm_virtgpu_3d_transfer_to_host)
+
+#define DRM_IOCTL_VIRTGPU_WAIT				\
+	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_WAIT,	\
+		struct drm_virtgpu_3d_wait)
+
+#define DRM_IOCTL_VIRTGPU_GET_CAPS \
+	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_GET_CAPS, \
+	struct drm_virtgpu_get_caps)
+
+#define DRM_IOCTL_VIRTGPU_RESOURCE_CREATE_BLOB				\
+	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_RESOURCE_CREATE_BLOB,	\
+		struct drm_virtgpu_resource_create_blob)
+
+#define DRM_IOCTL_VIRTGPU_CONTEXT_INIT					\
+	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_CONTEXT_INIT,		\
+		struct drm_virtgpu_context_init)
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif
diff --git a/system/include/EGL/egl.h b/system/include/EGL/egl.h
new file mode 100644
index 0000000..99ea342
--- /dev/null
+++ b/system/include/EGL/egl.h
@@ -0,0 +1,329 @@
+/* -*- mode: c; tab-width: 8; -*- */
+/* vi: set sw=4 ts=8: */
+/* Reference version of egl.h for EGL 1.4.
+ * $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $
+ */
+
+/*
+** Copyright (c) 2007-2009 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+#ifndef __egl_h_
+#define __egl_h_
+
+/* All platform-dependent types and macro boilerplate (such as EGLAPI
+ * and EGLAPIENTRY) should go in eglplatform.h.
+ */
+#include <EGL/eglplatform.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* EGL Types */
+/* EGLint is defined in eglplatform.h */
+typedef unsigned int EGLBoolean;
+typedef unsigned int EGLenum;
+typedef void *EGLConfig;
+typedef void *EGLContext;
+typedef void *EGLDisplay;
+typedef void *EGLSurface;
+typedef void *EGLClientBuffer;
+
+/* EGL Versioning */
+#define EGL_VERSION_1_0			1
+#define EGL_VERSION_1_1			1
+#define EGL_VERSION_1_2			1
+#define EGL_VERSION_1_3			1
+#define EGL_VERSION_1_4			1
+
+/* EGL Enumerants. Bitmasks and other exceptional cases aside, most
+ * enums are assigned unique values starting at 0x3000.
+ */
+
+/* EGL aliases */
+#define EGL_FALSE			0
+#define EGL_TRUE			1
+
+/* Out-of-band handle values */
+#define EGL_DEFAULT_DISPLAY		((EGLNativeDisplayType)0)
+#define EGL_NO_CONTEXT			((EGLContext)0)
+#define EGL_NO_DISPLAY			((EGLDisplay)0)
+#define EGL_NO_SURFACE			((EGLSurface)0)
+
+/* Out-of-band attribute value */
+#define EGL_DONT_CARE			((EGLint)-1)
+
+/* Errors / GetError return values */
+#define EGL_SUCCESS			0x3000
+#define EGL_NOT_INITIALIZED		0x3001
+#define EGL_BAD_ACCESS			0x3002
+#define EGL_BAD_ALLOC			0x3003
+#define EGL_BAD_ATTRIBUTE		0x3004
+#define EGL_BAD_CONFIG			0x3005
+#define EGL_BAD_CONTEXT			0x3006
+#define EGL_BAD_CURRENT_SURFACE		0x3007
+#define EGL_BAD_DISPLAY			0x3008
+#define EGL_BAD_MATCH			0x3009
+#define EGL_BAD_NATIVE_PIXMAP		0x300A
+#define EGL_BAD_NATIVE_WINDOW		0x300B
+#define EGL_BAD_PARAMETER		0x300C
+#define EGL_BAD_SURFACE			0x300D
+#define EGL_CONTEXT_LOST		0x300E	/* EGL 1.1 - IMG_power_management */
+
+/* Reserved 0x300F-0x301F for additional errors */
+
+/* Config attributes */
+#define EGL_BUFFER_SIZE			0x3020
+#define EGL_ALPHA_SIZE			0x3021
+#define EGL_BLUE_SIZE			0x3022
+#define EGL_GREEN_SIZE			0x3023
+#define EGL_RED_SIZE			0x3024
+#define EGL_DEPTH_SIZE			0x3025
+#define EGL_STENCIL_SIZE		0x3026
+#define EGL_CONFIG_CAVEAT		0x3027
+#define EGL_CONFIG_ID			0x3028
+#define EGL_LEVEL			0x3029
+#define EGL_MAX_PBUFFER_HEIGHT		0x302A
+#define EGL_MAX_PBUFFER_PIXELS		0x302B
+#define EGL_MAX_PBUFFER_WIDTH		0x302C
+#define EGL_NATIVE_RENDERABLE		0x302D
+#define EGL_NATIVE_VISUAL_ID		0x302E
+#define EGL_NATIVE_VISUAL_TYPE		0x302F
+#define EGL_SAMPLES			0x3031
+#define EGL_SAMPLE_BUFFERS		0x3032
+#define EGL_SURFACE_TYPE		0x3033
+#define EGL_TRANSPARENT_TYPE		0x3034
+#define EGL_TRANSPARENT_BLUE_VALUE	0x3035
+#define EGL_TRANSPARENT_GREEN_VALUE	0x3036
+#define EGL_TRANSPARENT_RED_VALUE	0x3037
+#define EGL_NONE			0x3038	/* Attrib list terminator */
+#define EGL_BIND_TO_TEXTURE_RGB		0x3039
+#define EGL_BIND_TO_TEXTURE_RGBA	0x303A
+#define EGL_MIN_SWAP_INTERVAL		0x303B
+#define EGL_MAX_SWAP_INTERVAL		0x303C
+#define EGL_LUMINANCE_SIZE		0x303D
+#define EGL_ALPHA_MASK_SIZE		0x303E
+#define EGL_COLOR_BUFFER_TYPE		0x303F
+#define EGL_RENDERABLE_TYPE		0x3040
+#define EGL_MATCH_NATIVE_PIXMAP		0x3041	/* Pseudo-attribute (not queryable) */
+#define EGL_CONFORMANT			0x3042
+
+/* Reserved 0x3041-0x304F for additional config attributes */
+
+/* Config attribute values */
+#define EGL_SLOW_CONFIG			0x3050	/* EGL_CONFIG_CAVEAT value */
+#define EGL_NON_CONFORMANT_CONFIG	0x3051	/* EGL_CONFIG_CAVEAT value */
+#define EGL_TRANSPARENT_RGB		0x3052	/* EGL_TRANSPARENT_TYPE value */
+#define EGL_RGB_BUFFER			0x308E	/* EGL_COLOR_BUFFER_TYPE value */
+#define EGL_LUMINANCE_BUFFER		0x308F	/* EGL_COLOR_BUFFER_TYPE value */
+
+/* More config attribute values, for EGL_TEXTURE_FORMAT */
+#define EGL_NO_TEXTURE			0x305C
+#define EGL_TEXTURE_RGB			0x305D
+#define EGL_TEXTURE_RGBA		0x305E
+#define EGL_TEXTURE_2D			0x305F
+
+/* Config attribute mask bits */
+#define EGL_PBUFFER_BIT			0x0001	/* EGL_SURFACE_TYPE mask bits */
+#define EGL_PIXMAP_BIT			0x0002	/* EGL_SURFACE_TYPE mask bits */
+#define EGL_WINDOW_BIT			0x0004	/* EGL_SURFACE_TYPE mask bits */
+#define EGL_VG_COLORSPACE_LINEAR_BIT	0x0020	/* EGL_SURFACE_TYPE mask bits */
+#define EGL_VG_ALPHA_FORMAT_PRE_BIT	0x0040	/* EGL_SURFACE_TYPE mask bits */
+#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200	/* EGL_SURFACE_TYPE mask bits */
+#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400	/* EGL_SURFACE_TYPE mask bits */
+
+#define EGL_OPENGL_ES_BIT		0x0001	/* EGL_RENDERABLE_TYPE mask bits */
+#define EGL_OPENVG_BIT			0x0002	/* EGL_RENDERABLE_TYPE mask bits */
+#define EGL_OPENGL_ES2_BIT		0x0004	/* EGL_RENDERABLE_TYPE mask bits */
+#define EGL_OPENGL_BIT			0x0008	/* EGL_RENDERABLE_TYPE mask bits */
+
+/* QueryString targets */
+#define EGL_VENDOR			0x3053
+#define EGL_VERSION			0x3054
+#define EGL_EXTENSIONS			0x3055
+#define EGL_CLIENT_APIS			0x308D
+
+/* QuerySurface / SurfaceAttrib / CreatePbufferSurface targets */
+#define EGL_HEIGHT			0x3056
+#define EGL_WIDTH			0x3057
+#define EGL_LARGEST_PBUFFER		0x3058
+#define EGL_TEXTURE_FORMAT		0x3080
+#define EGL_TEXTURE_TARGET		0x3081
+#define EGL_MIPMAP_TEXTURE		0x3082
+#define EGL_MIPMAP_LEVEL		0x3083
+#define EGL_RENDER_BUFFER		0x3086
+#define EGL_VG_COLORSPACE		0x3087
+#define EGL_VG_ALPHA_FORMAT		0x3088
+#define EGL_HORIZONTAL_RESOLUTION	0x3090
+#define EGL_VERTICAL_RESOLUTION		0x3091
+#define EGL_PIXEL_ASPECT_RATIO		0x3092
+#define EGL_SWAP_BEHAVIOR		0x3093
+#define EGL_MULTISAMPLE_RESOLVE		0x3099
+
+/* EGL_RENDER_BUFFER values / BindTexImage / ReleaseTexImage buffer targets */
+#define EGL_BACK_BUFFER			0x3084
+#define EGL_SINGLE_BUFFER		0x3085
+
+/* OpenVG color spaces */
+#define EGL_VG_COLORSPACE_sRGB		0x3089	/* EGL_VG_COLORSPACE value */
+#define EGL_VG_COLORSPACE_LINEAR	0x308A	/* EGL_VG_COLORSPACE value */
+
+/* OpenVG alpha formats */
+#define EGL_VG_ALPHA_FORMAT_NONPRE	0x308B	/* EGL_ALPHA_FORMAT value */
+#define EGL_VG_ALPHA_FORMAT_PRE		0x308C	/* EGL_ALPHA_FORMAT value */
+
+/* Constant scale factor by which fractional display resolutions &
+ * aspect ratio are scaled when queried as integer values.
+ */
+#define EGL_DISPLAY_SCALING		10000
+
+/* Unknown display resolution/aspect ratio */
+#define EGL_UNKNOWN			((EGLint)-1)
+
+/* Back buffer swap behaviors */
+#define EGL_BUFFER_PRESERVED		0x3094	/* EGL_SWAP_BEHAVIOR value */
+#define EGL_BUFFER_DESTROYED		0x3095	/* EGL_SWAP_BEHAVIOR value */
+
+/* CreatePbufferFromClientBuffer buffer types */
+#define EGL_OPENVG_IMAGE		0x3096
+
+/* QueryContext targets */
+#define EGL_CONTEXT_CLIENT_TYPE		0x3097
+
+/* CreateContext attributes */
+#define EGL_CONTEXT_CLIENT_VERSION	0x3098
+
+/* Multisample resolution behaviors */
+#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A	/* EGL_MULTISAMPLE_RESOLVE value */
+#define EGL_MULTISAMPLE_RESOLVE_BOX	0x309B	/* EGL_MULTISAMPLE_RESOLVE value */
+
+/* BindAPI/QueryAPI targets */
+#define EGL_OPENGL_ES_API		0x30A0
+#define EGL_OPENVG_API			0x30A1
+#define EGL_OPENGL_API			0x30A2
+
+/* GetCurrentSurface targets */
+#define EGL_DRAW			0x3059
+#define EGL_READ			0x305A
+
+/* WaitNative engines */
+#define EGL_CORE_NATIVE_ENGINE		0x305B
+
+/* EGL 1.2 tokens renamed for consistency in EGL 1.3 */
+#define EGL_COLORSPACE			EGL_VG_COLORSPACE
+#define EGL_ALPHA_FORMAT		EGL_VG_ALPHA_FORMAT
+#define EGL_COLORSPACE_sRGB		EGL_VG_COLORSPACE_sRGB
+#define EGL_COLORSPACE_LINEAR		EGL_VG_COLORSPACE_LINEAR
+#define EGL_ALPHA_FORMAT_NONPRE		EGL_VG_ALPHA_FORMAT_NONPRE
+#define EGL_ALPHA_FORMAT_PRE		EGL_VG_ALPHA_FORMAT_PRE
+
+/* EGL extensions must request enum blocks from the Khronos
+ * API Registrar, who maintains the enumerant registry. Submit
+ * a bug in Khronos Bugzilla against task "Registry".
+ */
+
+
+
+/* EGL Functions */
+
+EGLAPI EGLint EGLAPIENTRY eglGetError(void);
+
+EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id);
+EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor);
+EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy);
+
+EGLAPI const char * EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name);
+
+EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy, EGLConfig *configs,
+			 EGLint config_size, EGLint *num_config);
+EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list,
+			   EGLConfig *configs, EGLint config_size,
+			   EGLint *num_config);
+EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config,
+			      EGLint attribute, EGLint *value);
+
+EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config,
+				  EGLNativeWindowType win,
+				  const EGLint *attrib_list);
+EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config,
+				   const EGLint *attrib_list);
+EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config,
+				  EGLNativePixmapType pixmap,
+				  const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface);
+EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface,
+			   EGLint attribute, EGLint *value);
+
+EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api);
+EGLAPI EGLenum EGLAPIENTRY eglQueryAPI(void);
+
+EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient(void);
+
+EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread(void);
+
+EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer(
+	      EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer,
+	      EGLConfig config, const EGLint *attrib_list);
+
+EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface,
+			    EGLint attribute, EGLint value);
+EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
+EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
+
+
+EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval);
+
+
+EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config,
+			    EGLContext share_context,
+			    const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx);
+EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw,
+			  EGLSurface read, EGLContext ctx);
+
+EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext(void);
+EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw);
+EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay(void);
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext(EGLDisplay dpy, EGLContext ctx,
+			   EGLint attribute, EGLint *value);
+
+EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL(void);
+EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative(EGLint engine);
+EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface);
+EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy, EGLSurface surface,
+			  EGLNativePixmapType target);
+
+/* This is a generic function pointer type, whose name indicates it must
+ * be cast to the proper type *and calling convention* before use.
+ */
+typedef void (*__eglMustCastToProperFunctionPointerType)(void);
+
+/* Now, define eglGetProcAddress using the generic function ptr. type */
+EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY
+       eglGetProcAddress(const char *procname);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __egl_h_ */
diff --git a/system/include/EGL/eglext.h b/system/include/EGL/eglext.h
new file mode 100644
index 0000000..b2abdb1
--- /dev/null
+++ b/system/include/EGL/eglext.h
@@ -0,0 +1,605 @@
+#ifndef __eglext_h_
+#define __eglext_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** Copyright (c) 2007-2013 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+#include <EGL/eglplatform.h>
+
+/*************************************************************/
+
+/* Header file version number */
+/* Current version at http://www.khronos.org/registry/egl/ */
+/* $Revision: 20690 $ on $Date: 2013-02-22 17:15:05 -0800 (Fri, 22 Feb 2013) $ */
+#define EGL_EGLEXT_VERSION 15
+
+#ifndef EGL_KHR_config_attribs
+#define EGL_KHR_config_attribs 1
+#define EGL_CONFORMANT_KHR			0x3042	/* EGLConfig attribute */
+#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR	0x0020	/* EGL_SURFACE_TYPE bitfield */
+#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR		0x0040	/* EGL_SURFACE_TYPE bitfield */
+#endif
+
+#ifndef EGL_KHR_lock_surface
+#define EGL_KHR_lock_surface 1
+#define EGL_READ_SURFACE_BIT_KHR		0x0001	/* EGL_LOCK_USAGE_HINT_KHR bitfield */
+#define EGL_WRITE_SURFACE_BIT_KHR		0x0002	/* EGL_LOCK_USAGE_HINT_KHR bitfield */
+#define EGL_LOCK_SURFACE_BIT_KHR		0x0080	/* EGL_SURFACE_TYPE bitfield */
+#define EGL_OPTIMAL_FORMAT_BIT_KHR		0x0100	/* EGL_SURFACE_TYPE bitfield */
+#define EGL_MATCH_FORMAT_KHR			0x3043	/* EGLConfig attribute */
+#define EGL_FORMAT_RGB_565_EXACT_KHR		0x30C0	/* EGL_MATCH_FORMAT_KHR value */
+#define EGL_FORMAT_RGB_565_KHR			0x30C1	/* EGL_MATCH_FORMAT_KHR value */
+#define EGL_FORMAT_RGBA_8888_EXACT_KHR		0x30C2	/* EGL_MATCH_FORMAT_KHR value */
+#define EGL_FORMAT_RGBA_8888_KHR		0x30C3	/* EGL_MATCH_FORMAT_KHR value */
+#define EGL_MAP_PRESERVE_PIXELS_KHR		0x30C4	/* eglLockSurfaceKHR attribute */
+#define EGL_LOCK_USAGE_HINT_KHR			0x30C5	/* eglLockSurfaceKHR attribute */
+#define EGL_BITMAP_POINTER_KHR			0x30C6	/* eglQuerySurface attribute */
+#define EGL_BITMAP_PITCH_KHR			0x30C7	/* eglQuerySurface attribute */
+#define EGL_BITMAP_ORIGIN_KHR			0x30C8	/* eglQuerySurface attribute */
+#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR		0x30C9	/* eglQuerySurface attribute */
+#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR	0x30CA	/* eglQuerySurface attribute */
+#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR	0x30CB	/* eglQuerySurface attribute */
+#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR	0x30CC	/* eglQuerySurface attribute */
+#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR	0x30CD	/* eglQuerySurface attribute */
+#define EGL_LOWER_LEFT_KHR			0x30CE	/* EGL_BITMAP_ORIGIN_KHR value */
+#define EGL_UPPER_LEFT_KHR			0x30CF	/* EGL_BITMAP_ORIGIN_KHR value */
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay display, EGLSurface surface);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface);
+#endif
+
+#ifndef EGL_KHR_image
+#define EGL_KHR_image 1
+#define EGL_NATIVE_PIXMAP_KHR			0x30B0	/* eglCreateImageKHR target */
+typedef void *EGLImageKHR;
+#define EGL_NO_IMAGE_KHR			((EGLImageKHR)0)
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image);
+#endif
+
+#ifndef EGL_KHR_vg_parent_image
+#define EGL_KHR_vg_parent_image 1
+#define EGL_VG_PARENT_IMAGE_KHR			0x30BA	/* eglCreateImageKHR target */
+#endif
+
+#ifndef EGL_KHR_gl_texture_2D_image
+#define EGL_KHR_gl_texture_2D_image 1
+#define EGL_GL_TEXTURE_2D_KHR			0x30B1	/* eglCreateImageKHR target */
+#define EGL_GL_TEXTURE_LEVEL_KHR		0x30BC	/* eglCreateImageKHR attribute */
+#endif
+
+#ifndef EGL_KHR_gl_texture_cubemap_image
+#define EGL_KHR_gl_texture_cubemap_image 1
+#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR	0x30B3	/* eglCreateImageKHR target */
+#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR	0x30B4	/* eglCreateImageKHR target */
+#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR	0x30B5	/* eglCreateImageKHR target */
+#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR	0x30B6	/* eglCreateImageKHR target */
+#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR	0x30B7	/* eglCreateImageKHR target */
+#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR	0x30B8	/* eglCreateImageKHR target */
+#endif
+
+#ifndef EGL_KHR_gl_texture_3D_image
+#define EGL_KHR_gl_texture_3D_image 1
+#define EGL_GL_TEXTURE_3D_KHR			0x30B2	/* eglCreateImageKHR target */
+#define EGL_GL_TEXTURE_ZOFFSET_KHR		0x30BD	/* eglCreateImageKHR attribute */
+#endif
+
+#ifndef EGL_KHR_gl_renderbuffer_image
+#define EGL_KHR_gl_renderbuffer_image 1
+#define EGL_GL_RENDERBUFFER_KHR			0x30B9	/* eglCreateImageKHR target */
+#endif
+
+#if KHRONOS_SUPPORT_INT64   /* EGLTimeKHR requires 64-bit uint support */
+#ifndef EGL_KHR_reusable_sync
+#define EGL_KHR_reusable_sync 1
+
+typedef void* EGLSyncKHR;
+typedef khronos_utime_nanoseconds_t EGLTimeKHR;
+
+#define EGL_SYNC_STATUS_KHR			0x30F1
+#define EGL_SIGNALED_KHR			0x30F2
+#define EGL_UNSIGNALED_KHR			0x30F3
+#define EGL_TIMEOUT_EXPIRED_KHR			0x30F5
+#define EGL_CONDITION_SATISFIED_KHR		0x30F6
+#define EGL_SYNC_TYPE_KHR			0x30F7
+#define EGL_SYNC_REUSABLE_KHR			0x30FA
+#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR		0x0001	/* eglClientWaitSyncKHR <flags> bitfield */
+#define EGL_FOREVER_KHR				0xFFFFFFFFFFFFFFFFull
+#define EGL_NO_SYNC_KHR				((EGLSyncKHR)0)
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync);
+EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
+EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
+EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync);
+typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
+#endif
+#endif
+
+#ifndef EGL_KHR_image_base
+#define EGL_KHR_image_base 1
+/* Most interfaces defined by EGL_KHR_image_pixmap above */
+#define EGL_IMAGE_PRESERVED_KHR			0x30D2	/* eglCreateImageKHR attribute */
+#endif
+
+#ifndef EGL_KHR_image_pixmap
+#define EGL_KHR_image_pixmap 1
+/* Interfaces defined by EGL_KHR_image above */
+#endif
+
+#ifndef EGL_IMG_context_priority
+#define EGL_IMG_context_priority 1
+#define EGL_CONTEXT_PRIORITY_LEVEL_IMG		0x3100
+#define EGL_CONTEXT_PRIORITY_HIGH_IMG		0x3101
+#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG		0x3102
+#define EGL_CONTEXT_PRIORITY_LOW_IMG		0x3103
+#endif
+
+#ifndef EGL_KHR_lock_surface2
+#define EGL_KHR_lock_surface2 1
+#define EGL_BITMAP_PIXEL_SIZE_KHR		0x3110
+#endif
+
+#ifndef EGL_KHR_partial_update
+#define EGL_KHR_partial_update 1
+#define EGL_BUFFER_AGE_KHR                0x313D
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETDAMAGEREGIONKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglSetDamageRegionKHR (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
+#endif
+#endif /* EGL_KHR_partial_update */
+
+#ifndef EGL_NV_coverage_sample
+#define EGL_NV_coverage_sample 1
+#define EGL_COVERAGE_BUFFERS_NV			0x30E0
+#define EGL_COVERAGE_SAMPLES_NV			0x30E1
+#endif
+
+#ifndef EGL_NV_depth_nonlinear
+#define EGL_NV_depth_nonlinear 1
+#define EGL_DEPTH_ENCODING_NV			0x30E2
+#define EGL_DEPTH_ENCODING_NONE_NV 0
+#define EGL_DEPTH_ENCODING_NONLINEAR_NV		0x30E3
+#endif
+
+#if KHRONOS_SUPPORT_INT64   /* EGLTimeNV requires 64-bit uint support */
+#ifndef EGL_NV_sync
+#define EGL_NV_sync 1
+#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV	0x30E6
+#define EGL_SYNC_STATUS_NV			0x30E7
+#define EGL_SIGNALED_NV				0x30E8
+#define EGL_UNSIGNALED_NV			0x30E9
+#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV		0x0001
+#define EGL_FOREVER_NV				0xFFFFFFFFFFFFFFFFull
+#define EGL_ALREADY_SIGNALED_NV			0x30EA
+#define EGL_TIMEOUT_EXPIRED_NV			0x30EB
+#define EGL_CONDITION_SATISFIED_NV		0x30EC
+#define EGL_SYNC_TYPE_NV			0x30ED
+#define EGL_SYNC_CONDITION_NV			0x30EE
+#define EGL_SYNC_FENCE_NV			0x30EF
+#define EGL_NO_SYNC_NV				((EGLSyncNV)0)
+typedef void* EGLSyncNV;
+typedef khronos_utime_nanoseconds_t EGLTimeNV;
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLSyncNV EGLAPIENTRY eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncNV (EGLSyncNV sync);
+EGLAPI EGLBoolean EGLAPIENTRY eglFenceNV (EGLSyncNV sync);
+EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
+EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncNV (EGLSyncNV sync, EGLenum mode);
+EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync);
+typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value);
+#endif
+#endif
+
+#if KHRONOS_SUPPORT_INT64   /* Dependent on EGL_KHR_reusable_sync which requires 64-bit uint support */
+#ifndef EGL_KHR_fence_sync
+#define EGL_KHR_fence_sync 1
+/* Reuses most tokens and entry points from EGL_KHR_reusable_sync */
+#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR	0x30F0
+#define EGL_SYNC_CONDITION_KHR			0x30F8
+#define EGL_SYNC_FENCE_KHR			0x30F9
+#endif
+#endif
+
+#ifndef EGL_HI_clientpixmap
+#define EGL_HI_clientpixmap 1
+
+/* Surface Attribute */
+#define EGL_CLIENT_PIXMAP_POINTER_HI		0x8F74
+/*
+ * Structure representing a client pixmap
+ * (pixmap's data is in client-space memory).
+ */
+struct EGLClientPixmapHI
+{
+	void*		pData;
+	EGLint		iWidth;
+	EGLint		iHeight;
+	EGLint		iStride;
+};
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurfaceHI(EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI* pixmap);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI* pixmap);
+#endif	/* EGL_HI_clientpixmap */
+
+#ifndef EGL_HI_colorformats
+#define EGL_HI_colorformats 1
+/* Config Attribute */
+#define EGL_COLOR_FORMAT_HI			0x8F70
+/* Color Formats */
+#define EGL_COLOR_RGB_HI			0x8F71
+#define EGL_COLOR_RGBA_HI			0x8F72
+#define EGL_COLOR_ARGB_HI			0x8F73
+#endif /* EGL_HI_colorformats */
+
+#ifndef EGL_MESA_drm_image
+#define EGL_MESA_drm_image 1
+#define EGL_DRM_BUFFER_FORMAT_MESA		0x31D0	    /* CreateDRMImageMESA attribute */
+#define EGL_DRM_BUFFER_USE_MESA			0x31D1	    /* CreateDRMImageMESA attribute */
+#define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA	0x31D2	    /* EGL_IMAGE_FORMAT_MESA attribute value */
+#define EGL_DRM_BUFFER_MESA			0x31D3	    /* eglCreateImageKHR target */
+#define EGL_DRM_BUFFER_STRIDE_MESA		0x31D4
+#define EGL_DRM_BUFFER_USE_SCANOUT_MESA		0x00000001  /* EGL_DRM_BUFFER_USE_MESA bits */
+#define EGL_DRM_BUFFER_USE_SHARE_MESA		0x00000002  /* EGL_DRM_BUFFER_USE_MESA bits */
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLImageKHR EGLAPIENTRY eglCreateDRMImageMESA (EGLDisplay dpy, const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglExportDRMImageMESA (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEDRMIMAGEMESAPROC) (EGLDisplay dpy, const EGLint *attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDRMIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride);
+#endif
+
+#ifndef EGL_NV_post_sub_buffer
+#define EGL_NV_post_sub_buffer 1
+#define EGL_POST_SUB_BUFFER_SUPPORTED_NV	0x30BE
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height);
+#endif
+
+#ifndef EGL_ANGLE_query_surface_pointer
+#define EGL_ANGLE_query_surface_pointer 1
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean eglQuerySurfacePointerANGLE(EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value);
+#endif
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value);
+#endif
+
+#ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle
+#define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1
+#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE	0x3200
+#endif
+
+#ifndef EGL_NV_coverage_sample_resolve
+#define EGL_NV_coverage_sample_resolve 1
+#define EGL_COVERAGE_SAMPLE_RESOLVE_NV		0x3131
+#define EGL_COVERAGE_SAMPLE_RESOLVE_DEFAULT_NV	0x3132
+#define EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV	0x3133
+#endif
+
+#if KHRONOS_SUPPORT_INT64   /* EGLuint64NV requires 64-bit uint support */
+#ifndef EGL_NV_system_time
+#define EGL_NV_system_time 1
+typedef khronos_utime_nanoseconds_t EGLuint64NV;
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeFrequencyNV(void);
+EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV(void);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC) (void);
+typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC) (void);
+#endif
+#endif
+
+#if KHRONOS_SUPPORT_INT64 /* EGLuint64KHR requires 64-bit uint support */
+#ifndef EGL_KHR_stream
+#define EGL_KHR_stream 1
+typedef void* EGLStreamKHR;
+typedef khronos_uint64_t EGLuint64KHR;
+#define EGL_NO_STREAM_KHR			((EGLStreamKHR)0)
+#define EGL_CONSUMER_LATENCY_USEC_KHR		0x3210
+#define EGL_PRODUCER_FRAME_KHR			0x3212
+#define EGL_CONSUMER_FRAME_KHR			0x3213
+#define EGL_STREAM_STATE_KHR			0x3214
+#define EGL_STREAM_STATE_CREATED_KHR		0x3215
+#define EGL_STREAM_STATE_CONNECTING_KHR		0x3216
+#define EGL_STREAM_STATE_EMPTY_KHR		0x3217
+#define EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR    0x3218
+#define EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR    0x3219
+#define EGL_STREAM_STATE_DISCONNECTED_KHR	0x321A
+#define EGL_BAD_STREAM_KHR			0x321B
+#define EGL_BAD_STATE_KHR			0x321C
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamKHR(EGLDisplay dpy, const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroyStreamKHR(EGLDisplay dpy, EGLStreamKHR stream);
+EGLAPI EGLBoolean EGLAPIENTRY eglStreamAttribKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value);
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value);
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamu64KHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMKHRPROC)(EGLDisplay dpy, const EGLint *attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSTREAMKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMATTRIBKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMU64KHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);
+#endif
+#endif
+
+#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
+#ifndef EGL_KHR_stream_consumer_gltexture
+#define EGL_KHR_stream_consumer_gltexture 1
+#define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR	0x321E
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalKHR(EGLDisplay dpy, EGLStreamKHR stream);
+EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireKHR(EGLDisplay dpy, EGLStreamKHR stream);
+EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerReleaseKHR(EGLDisplay dpy, EGLStreamKHR stream);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERACQUIREKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERRELEASEKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
+#endif
+#endif
+
+#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
+#ifndef EGL_KHR_stream_producer_eglsurface
+#define EGL_KHR_stream_producer_eglsurface 1
+#define EGL_STREAM_BIT_KHR			0x0800
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLSurface EGLAPIENTRY eglCreateStreamProducerSurfaceKHR(EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC)(EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list);
+#endif
+#endif
+
+#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
+#ifndef EGL_KHR_stream_producer_aldatalocator
+#define EGL_KHR_stream_producer_aldatalocator 1
+#endif
+#endif
+
+#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
+#ifndef EGL_KHR_stream_fifo
+#define EGL_KHR_stream_fifo 1
+/* reuse EGLTimeKHR */
+#define EGL_STREAM_FIFO_LENGTH_KHR		0x31FC
+#define EGL_STREAM_TIME_NOW_KHR			0x31FD
+#define EGL_STREAM_TIME_CONSUMER_KHR		0x31FE
+#define EGL_STREAM_TIME_PRODUCER_KHR		0x31FF
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamTimeKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMTIMEKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value);
+#endif
+#endif
+
+#ifndef EGL_EXT_create_context_robustness
+#define EGL_EXT_create_context_robustness 1
+#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT	0x30BF
+#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT 0x3138
+#define EGL_NO_RESET_NOTIFICATION_EXT		0x31BE
+#define EGL_LOSE_CONTEXT_ON_RESET_EXT		0x31BF
+#endif
+
+#ifndef EGL_ANGLE_d3d_share_handle_client_buffer
+#define EGL_ANGLE_d3d_share_handle_client_buffer 1
+/* reuse EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE */
+#endif
+
+#ifndef EGL_KHR_create_context
+#define EGL_KHR_create_context 1
+#define EGL_CONTEXT_MAJOR_VERSION_KHR			    EGL_CONTEXT_CLIENT_VERSION
+#define EGL_CONTEXT_MINOR_VERSION_KHR			    0x30FB
+#define EGL_CONTEXT_FLAGS_KHR				    0x30FC
+#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR		    0x30FD
+#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR  0x31BD
+#define EGL_NO_RESET_NOTIFICATION_KHR			    0x31BE
+#define EGL_LOSE_CONTEXT_ON_RESET_KHR			    0x31BF
+#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR		    0x00000001
+#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR	    0x00000002
+#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR	    0x00000004
+#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR		    0x00000001
+#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR    0x00000002
+#define EGL_OPENGL_ES3_BIT_KHR				    0x00000040
+#endif
+
+#ifndef EGL_KHR_create_context_no_error
+#define EGL_KHR_create_context_no_error 1
+#define EGL_CONTEXT_OPENGL_NO_ERROR_KHR   0x31B3
+#endif /* EGL_KHR_create_context_no_error */
+
+#ifndef EGL_KHR_surfaceless_context
+#define EGL_KHR_surfaceless_context 1
+/* No tokens/entry points, just relaxes an error condition */
+#endif
+
+#ifndef EGL_KHR_swap_buffers_with_damage
+#define EGL_KHR_swap_buffers_with_damage 1
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageKHR (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
+#endif
+#endif /* EGL_KHR_swap_buffers_with_damage */
+
+#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
+#ifndef EGL_KHR_stream_cross_process_fd
+#define EGL_KHR_stream_cross_process_fd 1
+typedef int EGLNativeFileDescriptorKHR;
+#define EGL_NO_FILE_DESCRIPTOR_KHR		((EGLNativeFileDescriptorKHR)(-1))
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLNativeFileDescriptorKHR EGLAPIENTRY eglGetStreamFileDescriptorKHR(EGLDisplay dpy, EGLStreamKHR stream);
+EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamFromFileDescriptorKHR(EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLNativeFileDescriptorKHR (EGLAPIENTRYP PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
+typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC)(EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor);
+#endif
+#endif
+
+#ifndef EGL_EXT_multiview_window
+#define EGL_EXT_multiview_window 1
+#define EGL_MULTIVIEW_VIEW_COUNT_EXT		0x3134
+#endif
+
+#ifndef EGL_KHR_wait_sync
+#define EGL_KHR_wait_sync 1
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLint EGLAPIENTRY eglWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLint (EGLAPIENTRYP PFNEGLWAITSYNCKHRPROC)(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags);
+#endif
+
+#ifndef EGL_NV_post_convert_rounding
+#define EGL_NV_post_convert_rounding 1
+/* No tokens or entry points, just relaxes behavior of SwapBuffers */
+#endif
+
+#ifndef EGL_NV_native_query
+#define EGL_NV_native_query 1
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeDisplayNV( EGLDisplay dpy, EGLNativeDisplayType* display_id);
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeWindowNV( EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType* window);
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativePixmapNV( EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType* pixmap);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEDISPLAYNVPROC)(EGLDisplay dpy, EGLNativeDisplayType *display_id);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEWINDOWNVPROC)(EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType *window);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEPIXMAPNVPROC)(EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType *pixmap);
+#endif
+
+#ifndef EGL_NV_3dvision_surface
+#define EGL_NV_3dvision_surface 1
+#define EGL_AUTO_STEREO_NV			0x3136
+#endif
+
+#ifndef EGL_ANDROID_framebuffer_target
+#define EGL_ANDROID_framebuffer_target 1
+#define EGL_FRAMEBUFFER_TARGET_ANDROID		0x3147
+#endif
+
+#ifndef EGL_ANDROID_image_crop
+#define EGL_ANDROID_image_crop 1
+#define EGL_IMAGE_CROP_LEFT_ANDROID   0x3148
+#define EGL_IMAGE_CROP_TOP_ANDROID    0x3149
+#define EGL_IMAGE_CROP_RIGHT_ANDROID  0x314A
+#define EGL_IMAGE_CROP_BOTTOM_ANDROID 0x314B
+#endif
+
+#ifndef EGL_ANDROID_blob_cache
+#define EGL_ANDROID_blob_cache 1
+typedef khronos_ssize_t EGLsizeiANDROID;
+typedef void (*EGLSetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, const void *value, EGLsizeiANDROID valueSize);
+typedef EGLsizeiANDROID (*EGLGetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, void *value, EGLsizeiANDROID valueSize);
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI void EGLAPIENTRY eglSetBlobCacheFuncsANDROID(EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef void (EGLAPIENTRYP PFNEGLSETBLOBCACHEFUNCSANDROIDPROC)(EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get);
+#endif
+
+#ifndef EGL_ANDROID_image_native_buffer
+#define EGL_ANDROID_image_native_buffer 1
+#define EGL_NATIVE_BUFFER_ANDROID		0x3140
+#endif
+
+#ifndef EGL_ANDROID_native_fence_sync
+#define EGL_ANDROID_native_fence_sync 1
+#define EGL_SYNC_NATIVE_FENCE_ANDROID		0x3144
+#define EGL_SYNC_NATIVE_FENCE_FD_ANDROID	0x3145
+#define EGL_SYNC_NATIVE_FENCE_SIGNALED_ANDROID	0x3146
+#define EGL_NO_NATIVE_FENCE_FD_ANDROID		-1
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLint EGLAPIENTRY eglDupNativeFenceFDANDROID( EGLDisplay dpy, EGLSyncKHR);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLint (EGLAPIENTRYP PFNEGLDUPNATIVEFENCEFDANDROIDPROC)(EGLDisplay dpy, EGLSyncKHR);
+#endif
+
+#ifndef EGL_ANDROID_recordable
+#define EGL_ANDROID_recordable 1
+#define EGL_RECORDABLE_ANDROID			0x3142
+#endif
+
+#ifndef EGL_EXT_buffer_age
+#define EGL_EXT_buffer_age 1
+#define EGL_BUFFER_AGE_EXT			0x313D
+#endif
+
+#ifndef EGL_EXT_image_dma_buf_import
+#define EGL_EXT_image_dma_buf_import 1
+#define EGL_LINUX_DMA_BUF_EXT			0x3270
+#define EGL_LINUX_DRM_FOURCC_EXT		0x3271
+#define EGL_DMA_BUF_PLANE0_FD_EXT		0x3272
+#define EGL_DMA_BUF_PLANE0_OFFSET_EXT		0x3273
+#define EGL_DMA_BUF_PLANE0_PITCH_EXT		0x3274
+#define EGL_DMA_BUF_PLANE1_FD_EXT		0x3275
+#define EGL_DMA_BUF_PLANE1_OFFSET_EXT		0x3276
+#define EGL_DMA_BUF_PLANE1_PITCH_EXT		0x3277
+#define EGL_DMA_BUF_PLANE2_FD_EXT		0x3278
+#define EGL_DMA_BUF_PLANE2_OFFSET_EXT		0x3279
+#define EGL_DMA_BUF_PLANE2_PITCH_EXT		0x327A
+#define EGL_YUV_COLOR_SPACE_HINT_EXT		0x327B
+#define EGL_SAMPLE_RANGE_HINT_EXT		0x327C
+#define EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT 0x327D
+#define EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT 0x327E
+#define EGL_ITU_REC601_EXT			0x327F
+#define EGL_ITU_REC709_EXT			0x3280
+#define EGL_ITU_REC2020_EXT			0x3281
+#define EGL_YUV_FULL_RANGE_EXT			0x3282
+#define EGL_YUV_NARROW_RANGE_EXT		0x3283
+#define EGL_YUV_CHROMA_SITING_0_EXT		0x3284
+#define EGL_YUV_CHROMA_SITING_0_5_EXT		0x3285
+#endif
+
+#ifndef EGL_ANDROID_presentation_time
+#define EGL_ANDROID_presentation_time 1
+typedef khronos_stime_nanoseconds_t EGLnsecsANDROID;
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean eglPresentationTimeANDROID(EGLDisplay dpy, EGLSurface sur, EGLnsecsANDROID time);
+#else
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLPRESENTATIONTIMEANDROID) (EGLDisplay dpy, EGLSurface sur, EGLnsecsANDROID time);
+#endif
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __eglext_h_ */
diff --git a/system/include/EGL/eglplatform.h b/system/include/EGL/eglplatform.h
new file mode 100644
index 0000000..4358947
--- /dev/null
+++ b/system/include/EGL/eglplatform.h
@@ -0,0 +1,130 @@
+#ifndef __eglplatform_h_
+#define __eglplatform_h_
+
+/*
+** Copyright (c) 2007-2009 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+/* Platform-specific types and definitions for egl.h
+ * $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $
+ *
+ * Adopters may modify khrplatform.h and this file to suit their platform.
+ * You are encouraged to submit all modifications to the Khronos group so that
+ * they can be included in future versions of this file.  Please submit changes
+ * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
+ * by filing a bug against product "EGL" component "Registry".
+ */
+
+#include <KHR/khrplatform.h>
+
+/* Macros used in EGL function prototype declarations.
+ *
+ * EGL functions should be prototyped as:
+ *
+ * EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
+ * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
+ *
+ * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h
+ */
+
+#ifndef EGLAPI
+#define EGLAPI KHRONOS_APICALL
+#endif
+
+#ifndef EGLAPIENTRY
+#define EGLAPIENTRY  KHRONOS_APIENTRY
+#endif
+#define EGLAPIENTRYP EGLAPIENTRY*
+
+/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
+ * are aliases of window-system-dependent types, such as X Display * or
+ * Windows Device Context. They must be defined in platform-specific
+ * code below. The EGL-prefixed versions of Native*Type are the same
+ * types, renamed in EGL 1.3 so all types in the API start with "EGL".
+ *
+ * Khronos STRONGLY RECOMMENDS that you use the default definitions
+ * provided below, since these changes affect both binary and source
+ * portability of applications using EGL running on different EGL
+ * implementations.
+ */
+
+#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN 1
+#endif
+#include <windows.h>
+
+typedef HDC     EGLNativeDisplayType;
+typedef HBITMAP EGLNativePixmapType;
+typedef HWND    EGLNativeWindowType;
+
+#elif defined(__WINSCW__) || defined(__SYMBIAN32__)  /* Symbian */
+
+typedef int   EGLNativeDisplayType;
+typedef void *EGLNativeWindowType;
+typedef void *EGLNativePixmapType;
+
+#elif defined(__ANDROID__) || defined(ANDROID)
+
+struct ANativeWindow;
+struct egl_native_pixmap_t;
+
+typedef struct ANativeWindow*           EGLNativeWindowType;
+typedef struct egl_native_pixmap_t*     EGLNativePixmapType;
+typedef void*                           EGLNativeDisplayType;
+
+#elif defined(__unix__)
+
+/* X11 (tentative)  */
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+
+typedef Display *EGLNativeDisplayType;
+typedef Pixmap   EGLNativePixmapType;
+typedef Window   EGLNativeWindowType;
+
+#elif defined(__Fuchsia__)
+
+typedef void* EGLNativeWindowType;
+typedef void* EGLNativePixmapType;
+typedef void* EGLNativeDisplayType;
+
+#else
+#error "Platform not recognized"
+#endif
+
+/* EGL 1.2 types, renamed for consistency in EGL 1.3 */
+typedef EGLNativeDisplayType NativeDisplayType;
+typedef EGLNativePixmapType  NativePixmapType;
+typedef EGLNativeWindowType  NativeWindowType;
+
+
+/* Define EGLint. This must be a signed integral type large enough to contain
+ * all legal attribute names and values passed into and out of EGL, whether
+ * their type is boolean, bitmask, enumerant (symbolic constant), integer,
+ * handle, or other.  While in general a 32-bit integer will suffice, if
+ * handles are 64 bit types, then EGLint should be defined as a signed 64-bit
+ * integer type.
+ */
+typedef khronos_int32_t EGLint;
+
+#endif /* __eglplatform_h */
diff --git a/system/include/ETC1/etc1.h b/system/include/ETC1/etc1.h
new file mode 100644
index 0000000..0d38905
--- /dev/null
+++ b/system/include/ETC1/etc1.h
@@ -0,0 +1,106 @@
+// Copyright 2009 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef __etc1_h__
+#define __etc1_h__
+
+#define ETC1_ENCODED_BLOCK_SIZE 8
+#define ETC1_DECODED_BLOCK_SIZE 48
+
+#ifndef ETC1_RGB8_OES
+#define ETC1_RGB8_OES 0x8D64
+#endif
+
+typedef unsigned char etc1_byte;
+typedef int etc1_bool;
+typedef unsigned int etc1_uint32;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Encode a block of pixels.
+//
+// pIn is a pointer to a ETC_DECODED_BLOCK_SIZE array of bytes that represent a
+// 4 x 4 square of 3-byte pixels in form R, G, B. Byte (3 * (x + 4 * y) is the R
+// value of pixel (x, y).
+//
+// validPixelMask is a 16-bit mask where bit (1 << (x + y * 4)) indicates whether
+// the corresponding (x,y) pixel is valid. Invalid pixel color values are ignored when compressing.
+//
+// pOut is an ETC1 compressed version of the data.
+
+void etc1_encode_block(const etc1_byte* pIn, etc1_uint32 validPixelMask, etc1_byte* pOut);
+
+// Decode a block of pixels.
+//
+// pIn is an ETC1 compressed version of the data.
+//
+// pOut is a pointer to a ETC_DECODED_BLOCK_SIZE array of bytes that represent a
+// 4 x 4 square of 3-byte pixels in form R, G, B. Byte (3 * (x + 4 * y) is the R
+// value of pixel (x, y).
+
+void etc1_decode_block(const etc1_byte* pIn, etc1_byte* pOut);
+
+// Return the size of the encoded image data (does not include size of PKM header).
+
+etc1_uint32 etc1_get_encoded_data_size(etc1_uint32 width, etc1_uint32 height);
+
+// Encode an entire image.
+// pIn - pointer to the image data. Formatted such that
+//       pixel (x,y) is at pIn + pixelSize * x + stride * y;
+// pOut - pointer to encoded data. Must be large enough to store entire encoded image.
+// pixelSize can be 2 or 3. 2 is an GL_UNSIGNED_SHORT_5_6_5 image, 3 is a GL_BYTE RGB image.
+// returns non-zero if there is an error.
+
+int etc1_encode_image(const etc1_byte* pIn, etc1_uint32 width, etc1_uint32 height,
+        etc1_uint32 pixelSize, etc1_uint32 stride, etc1_byte* pOut);
+
+// Decode an entire image.
+// pIn - pointer to encoded data.
+// pOut - pointer to the image data. Will be written such that
+//        pixel (x,y) is at pIn + pixelSize * x + stride * y. Must be
+//        large enough to store entire image.
+// pixelSize can be 2 or 3. 2 is an GL_UNSIGNED_SHORT_5_6_5 image, 3 is a GL_BYTE RGB image.
+// returns non-zero if there is an error.
+
+int etc1_decode_image(const etc1_byte* pIn, etc1_byte* pOut,
+        etc1_uint32 width, etc1_uint32 height,
+        etc1_uint32 pixelSize, etc1_uint32 stride);
+
+// Size of a PKM header, in bytes.
+
+#define ETC_PKM_HEADER_SIZE 16
+
+// Format a PKM header
+
+void etc1_pkm_format_header(etc1_byte* pHeader, etc1_uint32 width, etc1_uint32 height);
+
+// Check if a PKM header is correctly formatted.
+
+etc1_bool etc1_pkm_is_valid(const etc1_byte* pHeader);
+
+// Read the image width from a PKM header
+
+etc1_uint32 etc1_pkm_get_width(const etc1_byte* pHeader);
+
+// Read the image height from a PKM header
+
+etc1_uint32 etc1_pkm_get_height(const etc1_byte* pHeader);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/system/include/GLES/egl.h b/system/include/GLES/egl.h
new file mode 100644
index 0000000..5778e00
--- /dev/null
+++ b/system/include/GLES/egl.h
@@ -0,0 +1,15 @@
+/*
+ * Skeleton egl.h to provide compatibility for early GLES 1.0
+ * applications. Several early implementations included gl.h
+ * in egl.h leading applications to include only egl.h
+ *
+ * $Revision: 6252 $ on $Date:: 2008-08-06 16:35:08 -0700 #$
+ */
+
+#ifndef __legacy_egl_h_
+#define __legacy_egl_h_
+
+#include <EGL/egl.h>
+#include <GLES/gl.h>
+
+#endif /* __legacy_egl_h_ */
diff --git a/system/include/GLES/gl.h b/system/include/GLES/gl.h
new file mode 100644
index 0000000..5b8d85a
--- /dev/null
+++ b/system/include/GLES/gl.h
@@ -0,0 +1,770 @@
+#ifndef __gl_h_
+#define __gl_h_
+
+/* $Revision: 10601 $ on $Date:: 2010-03-04 22:15:27 -0800 #$ */
+
+#include <GLES/glplatform.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * This document is licensed under the SGI Free Software B License Version
+ * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
+ */
+
+typedef void             GLvoid;
+typedef char             GLchar;
+typedef unsigned int     GLenum;
+typedef unsigned char    GLboolean;
+typedef unsigned int     GLbitfield;
+typedef khronos_int8_t   GLbyte;
+typedef short            GLshort;
+typedef int              GLint;
+typedef int              GLsizei;
+typedef khronos_uint8_t  GLubyte;
+typedef unsigned short   GLushort;
+typedef unsigned int     GLuint;
+typedef khronos_float_t  GLfloat;
+typedef khronos_float_t  GLclampf;
+typedef khronos_int32_t  GLfixed;
+typedef khronos_int32_t  GLclampx;
+
+typedef khronos_intptr_t GLintptr;
+typedef khronos_ssize_t  GLsizeiptr;
+
+
+/*************************************************************/
+
+/* OpenGL ES core versions */
+#define GL_VERSION_ES_CM_1_0          1
+#define GL_VERSION_ES_CL_1_0          1
+#define GL_VERSION_ES_CM_1_1          1
+#define GL_VERSION_ES_CL_1_1          1
+
+/* ClearBufferMask */
+#define GL_DEPTH_BUFFER_BIT               0x00000100
+#define GL_STENCIL_BUFFER_BIT             0x00000400
+#define GL_COLOR_BUFFER_BIT               0x00004000
+
+/* Boolean */
+#define GL_FALSE                          0
+#define GL_TRUE                           1
+
+/* BeginMode */
+#define GL_POINTS                         0x0000
+#define GL_LINES                          0x0001
+#define GL_LINE_LOOP                      0x0002
+#define GL_LINE_STRIP                     0x0003
+#define GL_TRIANGLES                      0x0004
+#define GL_TRIANGLE_STRIP                 0x0005
+#define GL_TRIANGLE_FAN                   0x0006
+
+/* AlphaFunction */
+#define GL_NEVER                          0x0200
+#define GL_LESS                           0x0201
+#define GL_EQUAL                          0x0202
+#define GL_LEQUAL                         0x0203
+#define GL_GREATER                        0x0204
+#define GL_NOTEQUAL                       0x0205
+#define GL_GEQUAL                         0x0206
+#define GL_ALWAYS                         0x0207
+
+/* BlendingFactorDest */
+#define GL_ZERO                           0
+#define GL_ONE                            1
+#define GL_SRC_COLOR                      0x0300
+#define GL_ONE_MINUS_SRC_COLOR            0x0301
+#define GL_SRC_ALPHA                      0x0302
+#define GL_ONE_MINUS_SRC_ALPHA            0x0303
+#define GL_DST_ALPHA                      0x0304
+#define GL_ONE_MINUS_DST_ALPHA            0x0305
+
+/* BlendingFactorSrc */
+/*      GL_ZERO */
+/*      GL_ONE */
+#define GL_DST_COLOR                      0x0306
+#define GL_ONE_MINUS_DST_COLOR            0x0307
+#define GL_SRC_ALPHA_SATURATE             0x0308
+/*      GL_SRC_ALPHA */
+/*      GL_ONE_MINUS_SRC_ALPHA */
+/*      GL_DST_ALPHA */
+/*      GL_ONE_MINUS_DST_ALPHA */
+
+/* ClipPlaneName */
+#define GL_CLIP_PLANE0                    0x3000
+#define GL_CLIP_PLANE1                    0x3001
+#define GL_CLIP_PLANE2                    0x3002
+#define GL_CLIP_PLANE3                    0x3003
+#define GL_CLIP_PLANE4                    0x3004
+#define GL_CLIP_PLANE5                    0x3005
+
+/* ColorMaterialFace */
+/*      GL_FRONT_AND_BACK */
+
+/* ColorMaterialParameter */
+/*      GL_AMBIENT_AND_DIFFUSE */
+
+/* ColorPointerType */
+/*      GL_UNSIGNED_BYTE */
+/*      GL_FLOAT */
+/*      GL_FIXED */
+
+/* CullFaceMode */
+#define GL_FRONT                          0x0404
+#define GL_BACK                           0x0405
+#define GL_FRONT_AND_BACK                 0x0408
+
+/* DepthFunction */
+/*      GL_NEVER */
+/*      GL_LESS */
+/*      GL_EQUAL */
+/*      GL_LEQUAL */
+/*      GL_GREATER */
+/*      GL_NOTEQUAL */
+/*      GL_GEQUAL */
+/*      GL_ALWAYS */
+
+/* EnableCap */
+#define GL_FOG                            0x0B60
+#define GL_LIGHTING                       0x0B50
+#define GL_TEXTURE_2D                     0x0DE1
+#define GL_CULL_FACE                      0x0B44
+#define GL_ALPHA_TEST                     0x0BC0
+#define GL_BLEND                          0x0BE2
+#define GL_COLOR_LOGIC_OP                 0x0BF2
+#define GL_DITHER                         0x0BD0
+#define GL_STENCIL_TEST                   0x0B90
+#define GL_DEPTH_TEST                     0x0B71
+/*      GL_LIGHT0 */
+/*      GL_LIGHT1 */
+/*      GL_LIGHT2 */
+/*      GL_LIGHT3 */
+/*      GL_LIGHT4 */
+/*      GL_LIGHT5 */
+/*      GL_LIGHT6 */
+/*      GL_LIGHT7 */
+#define GL_POINT_SMOOTH                   0x0B10
+#define GL_LINE_SMOOTH                    0x0B20
+#define GL_SCISSOR_TEST                   0x0C11
+#define GL_COLOR_MATERIAL                 0x0B57
+#define GL_NORMALIZE                      0x0BA1
+#define GL_RESCALE_NORMAL                 0x803A
+#define GL_POLYGON_OFFSET_FILL            0x8037
+#define GL_VERTEX_ARRAY                   0x8074
+#define GL_NORMAL_ARRAY                   0x8075
+#define GL_COLOR_ARRAY                    0x8076
+#define GL_TEXTURE_COORD_ARRAY            0x8078
+#define GL_MULTISAMPLE                    0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE       0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE            0x809F
+#define GL_SAMPLE_COVERAGE                0x80A0
+
+/* ErrorCode */
+#define GL_NO_ERROR                       0
+#define GL_INVALID_ENUM                   0x0500
+#define GL_INVALID_VALUE                  0x0501
+#define GL_INVALID_OPERATION              0x0502
+#define GL_STACK_OVERFLOW                 0x0503
+#define GL_STACK_UNDERFLOW                0x0504
+#define GL_OUT_OF_MEMORY                  0x0505
+
+/* FogMode */
+/*      GL_LINEAR */
+#define GL_EXP                            0x0800
+#define GL_EXP2                           0x0801
+
+/* FogParameter */
+#define GL_FOG_DENSITY                    0x0B62
+#define GL_FOG_START                      0x0B63
+#define GL_FOG_END                        0x0B64
+#define GL_FOG_MODE                       0x0B65
+#define GL_FOG_COLOR                      0x0B66
+
+/* FrontFaceDirection */
+#define GL_CW                             0x0900
+#define GL_CCW                            0x0901
+
+/* GetPName */
+#define GL_CURRENT_COLOR                  0x0B00
+#define GL_CURRENT_NORMAL                 0x0B02
+#define GL_CURRENT_TEXTURE_COORDS         0x0B03
+#define GL_POINT_SIZE                     0x0B11
+#define GL_POINT_SIZE_MIN                 0x8126
+#define GL_POINT_SIZE_MAX                 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE      0x8128
+#define GL_POINT_DISTANCE_ATTENUATION     0x8129
+#define GL_SMOOTH_POINT_SIZE_RANGE        0x0B12
+#define GL_LINE_WIDTH                     0x0B21
+#define GL_SMOOTH_LINE_WIDTH_RANGE        0x0B22
+#define GL_ALIASED_POINT_SIZE_RANGE       0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE       0x846E
+#define GL_CULL_FACE_MODE                 0x0B45
+#define GL_FRONT_FACE                     0x0B46
+#define GL_SHADE_MODEL                    0x0B54
+#define GL_DEPTH_RANGE                    0x0B70
+#define GL_DEPTH_WRITEMASK                0x0B72
+#define GL_DEPTH_CLEAR_VALUE              0x0B73
+#define GL_DEPTH_FUNC                     0x0B74
+#define GL_STENCIL_CLEAR_VALUE            0x0B91
+#define GL_STENCIL_FUNC                   0x0B92
+#define GL_STENCIL_VALUE_MASK             0x0B93
+#define GL_STENCIL_FAIL                   0x0B94
+#define GL_STENCIL_PASS_DEPTH_FAIL        0x0B95
+#define GL_STENCIL_PASS_DEPTH_PASS        0x0B96
+#define GL_STENCIL_REF                    0x0B97
+#define GL_STENCIL_WRITEMASK              0x0B98
+#define GL_MATRIX_MODE                    0x0BA0
+#define GL_VIEWPORT                       0x0BA2
+#define GL_MODELVIEW_STACK_DEPTH          0x0BA3
+#define GL_PROJECTION_STACK_DEPTH         0x0BA4
+#define GL_TEXTURE_STACK_DEPTH            0x0BA5
+#define GL_MODELVIEW_MATRIX               0x0BA6
+#define GL_PROJECTION_MATRIX              0x0BA7
+#define GL_TEXTURE_MATRIX                 0x0BA8
+#define GL_ALPHA_TEST_FUNC                0x0BC1
+#define GL_ALPHA_TEST_REF                 0x0BC2
+#define GL_BLEND_DST                      0x0BE0
+#define GL_BLEND_SRC                      0x0BE1
+#define GL_LOGIC_OP_MODE                  0x0BF0
+#define GL_SCISSOR_BOX                    0x0C10
+#define GL_SCISSOR_TEST                   0x0C11
+#define GL_COLOR_CLEAR_VALUE              0x0C22
+#define GL_COLOR_WRITEMASK                0x0C23
+#define GL_UNPACK_ALIGNMENT               0x0CF5
+#define GL_PACK_ALIGNMENT                 0x0D05
+#define GL_MAX_LIGHTS                     0x0D31
+#define GL_MAX_CLIP_PLANES                0x0D32
+#define GL_MAX_TEXTURE_SIZE               0x0D33
+#define GL_MAX_MODELVIEW_STACK_DEPTH      0x0D36
+#define GL_MAX_PROJECTION_STACK_DEPTH     0x0D38
+#define GL_MAX_TEXTURE_STACK_DEPTH        0x0D39
+#define GL_MAX_VIEWPORT_DIMS              0x0D3A
+#define GL_MAX_TEXTURE_UNITS              0x84E2
+#define GL_SUBPIXEL_BITS                  0x0D50
+#define GL_RED_BITS                       0x0D52
+#define GL_GREEN_BITS                     0x0D53
+#define GL_BLUE_BITS                      0x0D54
+#define GL_ALPHA_BITS                     0x0D55
+#define GL_DEPTH_BITS                     0x0D56
+#define GL_STENCIL_BITS                   0x0D57
+#define GL_POLYGON_OFFSET_UNITS           0x2A00
+#define GL_POLYGON_OFFSET_FILL            0x8037
+#define GL_POLYGON_OFFSET_FACTOR          0x8038
+#define GL_TEXTURE_BINDING_2D             0x8069
+#define GL_VERTEX_ARRAY_SIZE              0x807A
+#define GL_VERTEX_ARRAY_TYPE              0x807B
+#define GL_VERTEX_ARRAY_STRIDE            0x807C
+#define GL_NORMAL_ARRAY_TYPE              0x807E
+#define GL_NORMAL_ARRAY_STRIDE            0x807F
+#define GL_COLOR_ARRAY_SIZE               0x8081
+#define GL_COLOR_ARRAY_TYPE               0x8082
+#define GL_COLOR_ARRAY_STRIDE             0x8083
+#define GL_TEXTURE_COORD_ARRAY_SIZE       0x8088
+#define GL_TEXTURE_COORD_ARRAY_TYPE       0x8089
+#define GL_TEXTURE_COORD_ARRAY_STRIDE     0x808A
+#define GL_VERTEX_ARRAY_POINTER           0x808E
+#define GL_NORMAL_ARRAY_POINTER           0x808F
+#define GL_COLOR_ARRAY_POINTER            0x8090
+#define GL_TEXTURE_COORD_ARRAY_POINTER    0x8092
+#define GL_SAMPLE_BUFFERS                 0x80A8
+#define GL_SAMPLES                        0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE          0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT         0x80AB
+
+/* GetTextureParameter */
+/*      GL_TEXTURE_MAG_FILTER */
+/*      GL_TEXTURE_MIN_FILTER */
+/*      GL_TEXTURE_WRAP_S */
+/*      GL_TEXTURE_WRAP_T */
+
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS     0x86A3
+
+/* HintMode */
+#define GL_DONT_CARE                      0x1100
+#define GL_FASTEST                        0x1101
+#define GL_NICEST                         0x1102
+
+/* HintTarget */
+#define GL_PERSPECTIVE_CORRECTION_HINT    0x0C50
+#define GL_POINT_SMOOTH_HINT              0x0C51
+#define GL_LINE_SMOOTH_HINT               0x0C52
+#define GL_FOG_HINT                       0x0C54
+#define GL_GENERATE_MIPMAP_HINT           0x8192
+
+/* LightModelParameter */
+#define GL_LIGHT_MODEL_AMBIENT            0x0B53
+#define GL_LIGHT_MODEL_TWO_SIDE           0x0B52
+
+/* LightParameter */
+#define GL_AMBIENT                        0x1200
+#define GL_DIFFUSE                        0x1201
+#define GL_SPECULAR                       0x1202
+#define GL_POSITION                       0x1203
+#define GL_SPOT_DIRECTION                 0x1204
+#define GL_SPOT_EXPONENT                  0x1205
+#define GL_SPOT_CUTOFF                    0x1206
+#define GL_CONSTANT_ATTENUATION           0x1207
+#define GL_LINEAR_ATTENUATION             0x1208
+#define GL_QUADRATIC_ATTENUATION          0x1209
+
+/* DataType */
+#define GL_BYTE                           0x1400
+#define GL_UNSIGNED_BYTE                  0x1401
+#define GL_SHORT                          0x1402
+#define GL_UNSIGNED_SHORT                 0x1403
+#define GL_FLOAT                          0x1406
+#define GL_FIXED                          0x140C
+
+/* LogicOp */
+#define GL_CLEAR                          0x1500
+#define GL_AND                            0x1501
+#define GL_AND_REVERSE                    0x1502
+#define GL_COPY                           0x1503
+#define GL_AND_INVERTED                   0x1504
+#define GL_NOOP                           0x1505
+#define GL_XOR                            0x1506
+#define GL_OR                             0x1507
+#define GL_NOR                            0x1508
+#define GL_EQUIV                          0x1509
+#define GL_INVERT                         0x150A
+#define GL_OR_REVERSE                     0x150B
+#define GL_COPY_INVERTED                  0x150C
+#define GL_OR_INVERTED                    0x150D
+#define GL_NAND                           0x150E
+#define GL_SET                            0x150F
+
+/* MaterialFace */
+/*      GL_FRONT_AND_BACK */
+
+/* MaterialParameter */
+#define GL_EMISSION                       0x1600
+#define GL_SHININESS                      0x1601
+#define GL_AMBIENT_AND_DIFFUSE            0x1602
+/*      GL_AMBIENT */
+/*      GL_DIFFUSE */
+/*      GL_SPECULAR */
+
+/* MatrixMode */
+#define GL_MODELVIEW                      0x1700
+#define GL_PROJECTION                     0x1701
+#define GL_TEXTURE                        0x1702
+
+/* NormalPointerType */
+/*      GL_BYTE */
+/*      GL_SHORT */
+/*      GL_FLOAT */
+/*      GL_FIXED */
+
+/* PixelFormat */
+#define GL_ALPHA                          0x1906
+#define GL_RGB                            0x1907
+#define GL_RGBA                           0x1908
+#define GL_LUMINANCE                      0x1909
+#define GL_LUMINANCE_ALPHA                0x190A
+
+/* PixelStoreParameter */
+#define GL_UNPACK_ALIGNMENT               0x0CF5
+#define GL_PACK_ALIGNMENT                 0x0D05
+
+/* PixelType */
+/*      GL_UNSIGNED_BYTE */
+#define GL_UNSIGNED_SHORT_4_4_4_4         0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1         0x8034
+#define GL_UNSIGNED_SHORT_5_6_5           0x8363
+
+/* ShadingModel */
+#define GL_FLAT                           0x1D00
+#define GL_SMOOTH                         0x1D01
+
+/* StencilFunction */
+/*      GL_NEVER */
+/*      GL_LESS */
+/*      GL_EQUAL */
+/*      GL_LEQUAL */
+/*      GL_GREATER */
+/*      GL_NOTEQUAL */
+/*      GL_GEQUAL */
+/*      GL_ALWAYS */
+
+/* StencilOp */
+/*      GL_ZERO */
+#define GL_KEEP                           0x1E00
+#define GL_REPLACE                        0x1E01
+#define GL_INCR                           0x1E02
+#define GL_DECR                           0x1E03
+/*      GL_INVERT */
+
+/* StringName */
+#define GL_VENDOR                         0x1F00
+#define GL_RENDERER                       0x1F01
+#define GL_VERSION                        0x1F02
+#define GL_EXTENSIONS                     0x1F03
+
+/* TexCoordPointerType */
+/*      GL_SHORT */
+/*      GL_FLOAT */
+/*      GL_FIXED */
+/*      GL_BYTE */
+
+/* TextureEnvMode */
+#define GL_MODULATE                       0x2100
+#define GL_DECAL                          0x2101
+/*      GL_BLEND */
+#define GL_ADD                            0x0104
+/*      GL_REPLACE */
+
+/* TextureEnvParameter */
+#define GL_TEXTURE_ENV_MODE               0x2200
+#define GL_TEXTURE_ENV_COLOR              0x2201
+
+/* TextureEnvTarget */
+#define GL_TEXTURE_ENV                    0x2300
+
+/* TextureMagFilter */
+#define GL_NEAREST                        0x2600
+#define GL_LINEAR                         0x2601
+
+/* TextureMinFilter */
+/*      GL_NEAREST */
+/*      GL_LINEAR */
+#define GL_NEAREST_MIPMAP_NEAREST         0x2700
+#define GL_LINEAR_MIPMAP_NEAREST          0x2701
+#define GL_NEAREST_MIPMAP_LINEAR          0x2702
+#define GL_LINEAR_MIPMAP_LINEAR           0x2703
+
+/* TextureParameterName */
+#define GL_TEXTURE_MAG_FILTER             0x2800
+#define GL_TEXTURE_MIN_FILTER             0x2801
+#define GL_TEXTURE_WRAP_S                 0x2802
+#define GL_TEXTURE_WRAP_T                 0x2803
+#define GL_GENERATE_MIPMAP                0x8191
+
+/* TextureTarget */
+/*      GL_TEXTURE_2D */
+
+/* TextureUnit */
+#define GL_TEXTURE0                       0x84C0
+#define GL_TEXTURE1                       0x84C1
+#define GL_TEXTURE2                       0x84C2
+#define GL_TEXTURE3                       0x84C3
+#define GL_TEXTURE4                       0x84C4
+#define GL_TEXTURE5                       0x84C5
+#define GL_TEXTURE6                       0x84C6
+#define GL_TEXTURE7                       0x84C7
+#define GL_TEXTURE8                       0x84C8
+#define GL_TEXTURE9                       0x84C9
+#define GL_TEXTURE10                      0x84CA
+#define GL_TEXTURE11                      0x84CB
+#define GL_TEXTURE12                      0x84CC
+#define GL_TEXTURE13                      0x84CD
+#define GL_TEXTURE14                      0x84CE
+#define GL_TEXTURE15                      0x84CF
+#define GL_TEXTURE16                      0x84D0
+#define GL_TEXTURE17                      0x84D1
+#define GL_TEXTURE18                      0x84D2
+#define GL_TEXTURE19                      0x84D3
+#define GL_TEXTURE20                      0x84D4
+#define GL_TEXTURE21                      0x84D5
+#define GL_TEXTURE22                      0x84D6
+#define GL_TEXTURE23                      0x84D7
+#define GL_TEXTURE24                      0x84D8
+#define GL_TEXTURE25                      0x84D9
+#define GL_TEXTURE26                      0x84DA
+#define GL_TEXTURE27                      0x84DB
+#define GL_TEXTURE28                      0x84DC
+#define GL_TEXTURE29                      0x84DD
+#define GL_TEXTURE30                      0x84DE
+#define GL_TEXTURE31                      0x84DF
+#define GL_ACTIVE_TEXTURE                 0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE          0x84E1
+
+/* TextureWrapMode */
+#define GL_REPEAT                         0x2901
+#define GL_CLAMP_TO_EDGE                  0x812F
+
+/* VertexPointerType */
+/*      GL_SHORT */
+/*      GL_FLOAT */
+/*      GL_FIXED */
+/*      GL_BYTE */
+
+/* LightName */
+#define GL_LIGHT0                         0x4000
+#define GL_LIGHT1                         0x4001
+#define GL_LIGHT2                         0x4002
+#define GL_LIGHT3                         0x4003
+#define GL_LIGHT4                         0x4004
+#define GL_LIGHT5                         0x4005
+#define GL_LIGHT6                         0x4006
+#define GL_LIGHT7                         0x4007
+
+/* Buffer Objects */
+#define GL_ARRAY_BUFFER                   0x8892
+#define GL_ELEMENT_ARRAY_BUFFER           0x8893
+
+#define GL_ARRAY_BUFFER_BINDING               0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING       0x8895
+#define GL_VERTEX_ARRAY_BUFFER_BINDING        0x8896
+#define GL_NORMAL_ARRAY_BUFFER_BINDING        0x8897
+#define GL_COLOR_ARRAY_BUFFER_BINDING         0x8898
+#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
+
+#define GL_STATIC_DRAW                    0x88E4
+#define GL_DYNAMIC_DRAW                   0x88E8
+
+#define GL_BUFFER_SIZE                    0x8764
+#define GL_BUFFER_USAGE                   0x8765
+
+/* Texture combine + dot3 */
+#define GL_SUBTRACT                       0x84E7
+#define GL_COMBINE                        0x8570
+#define GL_COMBINE_RGB                    0x8571
+#define GL_COMBINE_ALPHA                  0x8572
+#define GL_RGB_SCALE                      0x8573
+#define GL_ADD_SIGNED                     0x8574
+#define GL_INTERPOLATE                    0x8575
+#define GL_CONSTANT                       0x8576
+#define GL_PRIMARY_COLOR                  0x8577
+#define GL_PREVIOUS                       0x8578
+#define GL_OPERAND0_RGB                   0x8590
+#define GL_OPERAND1_RGB                   0x8591
+#define GL_OPERAND2_RGB                   0x8592
+#define GL_OPERAND0_ALPHA                 0x8598
+#define GL_OPERAND1_ALPHA                 0x8599
+#define GL_OPERAND2_ALPHA                 0x859A
+
+#define GL_ALPHA_SCALE                    0x0D1C
+
+#define GL_SRC0_RGB                       0x8580
+#define GL_SRC1_RGB                       0x8581
+#define GL_SRC2_RGB                       0x8582
+#define GL_SRC0_ALPHA                     0x8588
+#define GL_SRC1_ALPHA                     0x8589
+#define GL_SRC2_ALPHA                     0x858A
+
+#define GL_DOT3_RGB                       0x86AE
+#define GL_DOT3_RGBA                      0x86AF
+
+/*------------------------------------------------------------------------*
+ * required OES extension tokens
+ *------------------------------------------------------------------------*/
+
+/* OES_read_format */
+#ifndef GL_OES_read_format
+#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES                   0x8B9A
+#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES                 0x8B9B
+#endif
+
+/* GL_OES_compressed_paletted_texture */
+#ifndef GL_OES_compressed_paletted_texture
+#define GL_PALETTE4_RGB8_OES                                    0x8B90
+#define GL_PALETTE4_RGBA8_OES                                   0x8B91
+#define GL_PALETTE4_R5_G6_B5_OES                                0x8B92
+#define GL_PALETTE4_RGBA4_OES                                   0x8B93
+#define GL_PALETTE4_RGB5_A1_OES                                 0x8B94
+#define GL_PALETTE8_RGB8_OES                                    0x8B95
+#define GL_PALETTE8_RGBA8_OES                                   0x8B96
+#define GL_PALETTE8_R5_G6_B5_OES                                0x8B97
+#define GL_PALETTE8_RGBA4_OES                                   0x8B98
+#define GL_PALETTE8_RGB5_A1_OES                                 0x8B99
+#endif
+
+/* OES_point_size_array */
+#ifndef GL_OES_point_size_array
+#define GL_POINT_SIZE_ARRAY_OES                                 0x8B9C
+#define GL_POINT_SIZE_ARRAY_TYPE_OES                            0x898A
+#define GL_POINT_SIZE_ARRAY_STRIDE_OES                          0x898B
+#define GL_POINT_SIZE_ARRAY_POINTER_OES                         0x898C
+#define GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES                  0x8B9F
+#endif
+
+/* GL_OES_point_sprite */
+#ifndef GL_OES_point_sprite
+#define GL_POINT_SPRITE_OES                                     0x8861
+#define GL_COORD_REPLACE_OES                                    0x8862
+#endif
+
+/*************************************************************/
+
+/* Available only in Common profile */
+GL_API void GL_APIENTRY glAlphaFunc (GLenum func, GLclampf ref);
+GL_API void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+GL_API void GL_APIENTRY glClearDepthf (GLclampf depth);
+GL_API void GL_APIENTRY glClipPlanef (GLenum plane, const GLfloat *equation);
+GL_API void GL_APIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+GL_API void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar);
+GL_API void GL_APIENTRY glFogf (GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glFogfv (GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glFrustumf (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+GL_API void GL_APIENTRY glGetClipPlanef (GLenum pname, GLfloat eqn[4]);
+GL_API void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *params);
+GL_API void GL_APIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params);
+GL_API void GL_APIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params);
+GL_API void GL_APIENTRY glGetTexEnvfv (GLenum env, GLenum pname, GLfloat *params);
+GL_API void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GL_API void GL_APIENTRY glLightModelf (GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glLightModelfv (GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glLightf (GLenum light, GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glLineWidth (GLfloat width);
+GL_API void GL_APIENTRY glLoadMatrixf (const GLfloat *m);
+GL_API void GL_APIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glMultMatrixf (const GLfloat *m);
+GL_API void GL_APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+GL_API void GL_APIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz);
+GL_API void GL_APIENTRY glOrthof (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+GL_API void GL_APIENTRY glPointParameterf (GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glPointSize (GLfloat size);
+GL_API void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
+GL_API void GL_APIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+GL_API void GL_APIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z);
+GL_API void GL_APIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z);
+
+/* Available in both Common and Common-Lite profiles */
+GL_API void GL_APIENTRY glActiveTexture (GLenum texture);
+GL_API void GL_APIENTRY glAlphaFuncx (GLenum func, GLclampx ref);
+GL_API void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
+GL_API void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
+GL_API void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
+GL_API void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
+GL_API void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
+GL_API void GL_APIENTRY glClear (GLbitfield mask);
+GL_API void GL_APIENTRY glClearColorx (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
+GL_API void GL_APIENTRY glClearDepthx (GLclampx depth);
+GL_API void GL_APIENTRY glClearStencil (GLint s);
+GL_API void GL_APIENTRY glClientActiveTexture (GLenum texture);
+GL_API void GL_APIENTRY glClipPlanex (GLenum plane, const GLfixed *equation);
+GL_API void GL_APIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
+GL_API void GL_APIENTRY glColor4x (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+GL_API void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+GL_API void GL_APIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GL_API void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+GL_API void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+GL_API void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GL_API void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GL_API void GL_APIENTRY glCullFace (GLenum mode);
+GL_API void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
+GL_API void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
+GL_API void GL_APIENTRY glDepthFunc (GLenum func);
+GL_API void GL_APIENTRY glDepthMask (GLboolean flag);
+GL_API void GL_APIENTRY glDepthRangex (GLclampx zNear, GLclampx zFar);
+GL_API void GL_APIENTRY glDisable (GLenum cap);
+GL_API void GL_APIENTRY glDisableClientState (GLenum array);
+GL_API void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
+GL_API void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
+GL_API void GL_APIENTRY glEnable (GLenum cap);
+GL_API void GL_APIENTRY glEnableClientState (GLenum array);
+GL_API void GL_APIENTRY glFinish (void);
+GL_API void GL_APIENTRY glFlush (void);
+GL_API void GL_APIENTRY glFogx (GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glFogxv (GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glFrontFace (GLenum mode);
+GL_API void GL_APIENTRY glFrustumx (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+GL_API void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *params);
+GL_API void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_API void GL_APIENTRY glGetClipPlanex (GLenum pname, GLfixed eqn[4]);
+GL_API void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
+GL_API void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures);
+GL_API GLenum GL_APIENTRY glGetError (void);
+GL_API void GL_APIENTRY glGetFixedv (GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *params);
+GL_API void GL_APIENTRY glGetLightxv (GLenum light, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetMaterialxv (GLenum face, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetPointerv (GLenum pname, GLvoid **params);
+GL_API const GLubyte * GL_APIENTRY glGetString (GLenum name);
+GL_API void GL_APIENTRY glGetTexEnviv (GLenum env, GLenum pname, GLint *params);
+GL_API void GL_APIENTRY glGetTexEnvxv (GLenum env, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_API void GL_APIENTRY glGetTexParameterxv (GLenum target, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glHint (GLenum target, GLenum mode);
+GL_API GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
+GL_API GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
+GL_API GLboolean GL_APIENTRY glIsTexture (GLuint texture);
+GL_API void GL_APIENTRY glLightModelx (GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glLightModelxv (GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glLightx (GLenum light, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glLightxv (GLenum light, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glLineWidthx (GLfixed width);
+GL_API void GL_APIENTRY glLoadIdentity (void);
+GL_API void GL_APIENTRY glLoadMatrixx (const GLfixed *m);
+GL_API void GL_APIENTRY glLogicOp (GLenum opcode);
+GL_API void GL_APIENTRY glMaterialx (GLenum face, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glMaterialxv (GLenum face, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glMatrixMode (GLenum mode);
+GL_API void GL_APIENTRY glMultMatrixx (const GLfixed *m);
+GL_API void GL_APIENTRY glMultiTexCoord4x (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+GL_API void GL_APIENTRY glNormal3x (GLfixed nx, GLfixed ny, GLfixed nz);
+GL_API void GL_APIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer);
+GL_API void GL_APIENTRY glOrthox (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+GL_API void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
+GL_API void GL_APIENTRY glPointParameterx (GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glPointParameterxv (GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glPointSizex (GLfixed size);
+GL_API void GL_APIENTRY glPolygonOffsetx (GLfixed factor, GLfixed units);
+GL_API void GL_APIENTRY glPopMatrix (void);
+GL_API void GL_APIENTRY glPushMatrix (void);
+GL_API void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
+GL_API void GL_APIENTRY glRotatex (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
+GL_API void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
+GL_API void GL_APIENTRY glSampleCoveragex (GLclampx value, GLboolean invert);
+GL_API void GL_APIENTRY glScalex (GLfixed x, GLfixed y, GLfixed z);
+GL_API void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
+GL_API void GL_APIENTRY glShadeModel (GLenum mode);
+GL_API void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
+GL_API void GL_APIENTRY glStencilMask (GLuint mask);
+GL_API void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
+GL_API void GL_APIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GL_API void GL_APIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param);
+GL_API void GL_APIENTRY glTexEnvx (GLenum target, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params);
+GL_API void GL_APIENTRY glTexEnvxv (GLenum target, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GL_API void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
+GL_API void GL_APIENTRY glTexParameterx (GLenum target, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
+GL_API void GL_APIENTRY glTexParameterxv (GLenum target, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+GL_API void GL_APIENTRY glTranslatex (GLfixed x, GLfixed y, GLfixed z);
+GL_API void GL_APIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GL_API void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
+
+/*------------------------------------------------------------------------*
+ * Required OES extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_OES_read_format */
+#ifndef GL_OES_read_format
+#define GL_OES_read_format 1
+#endif
+
+/* GL_OES_compressed_paletted_texture */
+#ifndef GL_OES_compressed_paletted_texture
+#define GL_OES_compressed_paletted_texture 1
+#endif
+
+/* GL_OES_point_size_array */
+#ifndef GL_OES_point_size_array
+#define GL_OES_point_size_array 1
+GL_API void GL_APIENTRY glPointSizePointerOES (GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+/* GL_OES_point_sprite */
+#ifndef GL_OES_point_sprite
+#define GL_OES_point_sprite 1
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __gl_h_ */
+
diff --git a/system/include/GLES/glext.h b/system/include/GLES/glext.h
new file mode 100644
index 0000000..69ac4ee
--- /dev/null
+++ b/system/include/GLES/glext.h
@@ -0,0 +1,1281 @@
+#ifndef __glext_h_
+#define __glext_h_
+
+/* $Revision: 20798 $ on $Date:: 2013-03-07 01:19:34 -0800 #$ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * This document is licensed under the SGI Free Software B License Version
+ * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
+ */
+
+#ifndef GL_APIENTRYP
+#   define GL_APIENTRYP GL_APIENTRY*
+#endif
+
+/*------------------------------------------------------------------------*
+ * OES extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_OES_blend_equation_separate */
+#ifndef GL_OES_blend_equation_separate
+/* BLEND_EQUATION_RGB_OES same as BLEND_EQUATION_OES */
+#define GL_BLEND_EQUATION_RGB_OES                               0x8009
+#define GL_BLEND_EQUATION_ALPHA_OES                             0x883D
+#endif
+
+/* GL_OES_blend_func_separate */
+#ifndef GL_OES_blend_func_separate
+#define GL_BLEND_DST_RGB_OES                                    0x80C8
+#define GL_BLEND_SRC_RGB_OES                                    0x80C9
+#define GL_BLEND_DST_ALPHA_OES                                  0x80CA
+#define GL_BLEND_SRC_ALPHA_OES                                  0x80CB
+#endif
+
+/* GL_OES_blend_subtract */
+#ifndef GL_OES_blend_subtract
+#define GL_BLEND_EQUATION_OES                                   0x8009
+#define GL_FUNC_ADD_OES                                         0x8006
+#define GL_FUNC_SUBTRACT_OES                                    0x800A
+#define GL_FUNC_REVERSE_SUBTRACT_OES                            0x800B
+#endif
+
+/* GL_OES_compressed_ETC1_RGB8_texture */
+#ifndef GL_OES_compressed_ETC1_RGB8_texture
+#define GL_ETC1_RGB8_OES                                        0x8D64
+#endif
+
+/* GL_OES_depth24 */
+#ifndef GL_OES_depth24
+#define GL_DEPTH_COMPONENT24_OES                                0x81A6
+#endif
+
+/* GL_OES_depth32 */
+#ifndef GL_OES_depth32
+#define GL_DEPTH_COMPONENT32_OES                                0x81A7
+#endif
+
+/* GL_OES_draw_texture */
+#ifndef GL_OES_draw_texture
+#define GL_TEXTURE_CROP_RECT_OES                                0x8B9D
+#endif
+
+/* GL_OES_EGL_image */
+#ifndef GL_OES_EGL_image
+typedef void* GLeglImageOES;
+#endif
+
+/* GL_OES_EGL_image_external */
+#ifndef GL_OES_EGL_image_external
+/* GLeglImageOES defined in GL_OES_EGL_image already. */
+#define GL_TEXTURE_EXTERNAL_OES                                 0x8D65
+#define GL_TEXTURE_BINDING_EXTERNAL_OES                         0x8D67
+#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES                     0x8D68
+#endif
+
+/* GL_OES_element_index_uint */
+#ifndef GL_OES_element_index_uint
+#define GL_UNSIGNED_INT                                         0x1405
+#endif
+
+/* GL_OES_fixed_point */
+#ifndef GL_OES_fixed_point
+#define GL_FIXED_OES                                            0x140C
+#endif
+
+/* GL_OES_framebuffer_object */
+#ifndef GL_OES_framebuffer_object
+#define GL_NONE_OES                                             0
+#define GL_FRAMEBUFFER_OES                                      0x8D40
+#define GL_RENDERBUFFER_OES                                     0x8D41
+#define GL_RGBA4_OES                                            0x8056
+#define GL_RGB5_A1_OES                                          0x8057
+#define GL_RGB565_OES                                           0x8D62
+#define GL_DEPTH_COMPONENT16_OES                                0x81A5
+#define GL_RENDERBUFFER_WIDTH_OES                               0x8D42
+#define GL_RENDERBUFFER_HEIGHT_OES                              0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT_OES                     0x8D44
+#define GL_RENDERBUFFER_RED_SIZE_OES                            0x8D50
+#define GL_RENDERBUFFER_GREEN_SIZE_OES                          0x8D51
+#define GL_RENDERBUFFER_BLUE_SIZE_OES                           0x8D52
+#define GL_RENDERBUFFER_ALPHA_SIZE_OES                          0x8D53
+#define GL_RENDERBUFFER_DEPTH_SIZE_OES                          0x8D54
+#define GL_RENDERBUFFER_STENCIL_SIZE_OES                        0x8D55
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES               0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES               0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES             0x8CD2
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES     0x8CD3
+#define GL_COLOR_ATTACHMENT0_OES                                0x8CE0
+#define GL_DEPTH_ATTACHMENT_OES                                 0x8D00
+#define GL_STENCIL_ATTACHMENT_OES                               0x8D20
+#define GL_FRAMEBUFFER_COMPLETE_OES                             0x8CD5
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES                0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES        0x8CD7
+#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES                0x8CD9
+#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES                   0x8CDA
+#define GL_FRAMEBUFFER_UNSUPPORTED_OES                          0x8CDD
+#define GL_FRAMEBUFFER_BINDING_OES                              0x8CA6
+#define GL_RENDERBUFFER_BINDING_OES                             0x8CA7
+#define GL_MAX_RENDERBUFFER_SIZE_OES                            0x84E8
+#define GL_INVALID_FRAMEBUFFER_OPERATION_OES                    0x0506
+#endif
+
+/* GL_OES_mapbuffer */
+#ifndef GL_OES_mapbuffer
+#define GL_WRITE_ONLY_OES                                       0x88B9
+#define GL_BUFFER_ACCESS_OES                                    0x88BB
+#define GL_BUFFER_MAPPED_OES                                    0x88BC
+#define GL_BUFFER_MAP_POINTER_OES                               0x88BD
+#endif
+
+/* GL_OES_matrix_get */
+#ifndef GL_OES_matrix_get
+#define GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES               0x898D
+#define GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES              0x898E
+#define GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES                 0x898F
+#endif
+
+/* GL_OES_matrix_palette */
+#ifndef GL_OES_matrix_palette
+#define GL_MAX_VERTEX_UNITS_OES                                 0x86A4
+#define GL_MAX_PALETTE_MATRICES_OES                             0x8842
+#define GL_MATRIX_PALETTE_OES                                   0x8840
+#define GL_MATRIX_INDEX_ARRAY_OES                               0x8844
+#define GL_WEIGHT_ARRAY_OES                                     0x86AD
+#define GL_CURRENT_PALETTE_MATRIX_OES                           0x8843
+#define GL_MATRIX_INDEX_ARRAY_SIZE_OES                          0x8846
+#define GL_MATRIX_INDEX_ARRAY_TYPE_OES                          0x8847
+#define GL_MATRIX_INDEX_ARRAY_STRIDE_OES                        0x8848
+#define GL_MATRIX_INDEX_ARRAY_POINTER_OES                       0x8849
+#define GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES                0x8B9E
+#define GL_WEIGHT_ARRAY_SIZE_OES                                0x86AB
+#define GL_WEIGHT_ARRAY_TYPE_OES                                0x86A9
+#define GL_WEIGHT_ARRAY_STRIDE_OES                              0x86AA
+#define GL_WEIGHT_ARRAY_POINTER_OES                             0x86AC
+#define GL_WEIGHT_ARRAY_BUFFER_BINDING_OES                      0x889E
+#endif
+
+/* GL_OES_packed_depth_stencil */
+#ifndef GL_OES_packed_depth_stencil
+#define GL_DEPTH_STENCIL_OES                                    0x84F9
+#define GL_UNSIGNED_INT_24_8_OES                                0x84FA
+#define GL_DEPTH24_STENCIL8_OES                                 0x88F0
+#endif
+
+/* GL_OES_required_internalformat */
+/* No new tokens introduced by this extension. */
+
+/* GL_OES_rgb8_rgba8 */
+#ifndef GL_OES_rgb8_rgba8
+#define GL_RGB8_OES                                             0x8051
+#define GL_RGBA8_OES                                            0x8058
+#endif
+
+/* GL_OES_stencil1 */
+#ifndef GL_OES_stencil1
+#define GL_STENCIL_INDEX1_OES                                   0x8D46
+#endif
+
+/* GL_OES_stencil4 */
+#ifndef GL_OES_stencil4
+#define GL_STENCIL_INDEX4_OES                                   0x8D47
+#endif
+
+/* GL_OES_stencil8 */
+#ifndef GL_OES_stencil8
+#define GL_STENCIL_INDEX8_OES                                   0x8D48
+#endif
+
+/* GL_OES_stencil_wrap */
+#ifndef GL_OES_stencil_wrap
+#define GL_INCR_WRAP_OES                                        0x8507
+#define GL_DECR_WRAP_OES                                        0x8508
+#endif
+
+/* GL_OES_texture_cube_map */
+#ifndef GL_OES_texture_cube_map
+#define GL_NORMAL_MAP_OES                                       0x8511
+#define GL_REFLECTION_MAP_OES                                   0x8512
+#define GL_TEXTURE_CUBE_MAP_OES                                 0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP_OES                         0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES                      0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES                      0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES                      0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES                      0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES                      0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES                      0x851A
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_OES                        0x851C
+#define GL_TEXTURE_GEN_MODE_OES                                 0x2500
+#define GL_TEXTURE_GEN_STR_OES                                  0x8D60
+#endif
+
+/* GL_OES_texture_mirrored_repeat */
+#ifndef GL_OES_texture_mirrored_repeat
+#define GL_MIRRORED_REPEAT_OES                                  0x8370
+#endif
+
+/* GL_OES_vertex_array_object */
+#ifndef GL_OES_vertex_array_object
+#define GL_VERTEX_ARRAY_BINDING_OES                             0x85B5
+#endif
+
+/*------------------------------------------------------------------------*
+ * AMD extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_AMD_compressed_3DC_texture */
+#ifndef GL_AMD_compressed_3DC_texture
+#define GL_3DC_X_AMD                                            0x87F9
+#define GL_3DC_XY_AMD                                           0x87FA
+#endif
+
+/* GL_AMD_compressed_ATC_texture */
+#ifndef GL_AMD_compressed_ATC_texture
+#define GL_ATC_RGB_AMD                                          0x8C92
+#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD                          0x8C93
+#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD                      0x87EE
+#endif
+
+/*------------------------------------------------------------------------*
+ * APPLE extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_APPLE_copy_texture_levels */
+/* No new tokens introduced by this extension. */
+
+/* GL_APPLE_framebuffer_multisample */
+#ifndef GL_APPLE_framebuffer_multisample
+#define GL_RENDERBUFFER_SAMPLES_APPLE                           0x8CAB
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE             0x8D56
+#define GL_MAX_SAMPLES_APPLE                                    0x8D57
+#define GL_READ_FRAMEBUFFER_APPLE                               0x8CA8
+#define GL_DRAW_FRAMEBUFFER_APPLE                               0x8CA9
+#define GL_DRAW_FRAMEBUFFER_BINDING_APPLE                       0x8CA6
+#define GL_READ_FRAMEBUFFER_BINDING_APPLE                       0x8CAA
+#endif
+
+/* GL_APPLE_sync */
+#ifndef GL_APPLE_sync
+
+/* These types are defined with reference to <inttypes.h>
+ * in the Apple extension spec, but here we use the Khronos
+ * portable types in khrplatform.h, and assume those types
+ * are always defined.
+ * If any other extensions using these types are defined,
+ * the typedefs must move out of this block and be shared.
+ */
+typedef khronos_int64_t GLint64;
+typedef khronos_uint64_t GLuint64;
+typedef struct __GLsync *GLsync;
+
+#define GL_SYNC_OBJECT_APPLE                                    0x8A53
+#define GL_MAX_SERVER_WAIT_TIMEOUT_APPLE                        0x9111
+#define GL_OBJECT_TYPE_APPLE                                    0x9112
+#define GL_SYNC_CONDITION_APPLE                                 0x9113
+#define GL_SYNC_STATUS_APPLE                                    0x9114
+#define GL_SYNC_FLAGS_APPLE                                     0x9115
+#define GL_SYNC_FENCE_APPLE                                     0x9116
+#define GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE                     0x9117
+#define GL_UNSIGNALED_APPLE                                     0x9118
+#define GL_SIGNALED_APPLE                                       0x9119
+#define GL_ALREADY_SIGNALED_APPLE                               0x911A
+#define GL_TIMEOUT_EXPIRED_APPLE                                0x911B
+#define GL_CONDITION_SATISFIED_APPLE                            0x911C
+#define GL_WAIT_FAILED_APPLE                                    0x911D
+#define GL_SYNC_FLUSH_COMMANDS_BIT_APPLE                        0x00000001
+#define GL_TIMEOUT_IGNORED_APPLE                                0xFFFFFFFFFFFFFFFFull
+#endif
+
+/* GL_APPLE_texture_2D_limited_npot */
+/* No new tokens introduced by this extension. */
+
+/* GL_APPLE_texture_format_BGRA8888 */
+#ifndef GL_APPLE_texture_format_BGRA8888
+#define GL_BGRA_EXT                                             0x80E1
+#endif
+
+/* GL_APPLE_texture_max_level */
+#ifndef GL_APPLE_texture_max_level
+#define GL_TEXTURE_MAX_LEVEL_APPLE                              0x813D
+#endif
+
+/*------------------------------------------------------------------------*
+ * ARM extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_ARM_rgba8 */
+/* No new tokens introduced by this extension. */
+
+/*------------------------------------------------------------------------*
+ * EXT extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_EXT_blend_minmax */
+#ifndef GL_EXT_blend_minmax
+#define GL_MIN_EXT                                              0x8007
+#define GL_MAX_EXT                                              0x8008
+#endif
+
+/* GL_EXT_discard_framebuffer */
+#ifndef GL_EXT_discard_framebuffer
+#define GL_COLOR_EXT                                            0x1800
+#define GL_DEPTH_EXT                                            0x1801
+#define GL_STENCIL_EXT                                          0x1802
+#endif
+
+/* GL_EXT_map_buffer_range */
+#ifndef GL_EXT_map_buffer_range
+#define GL_MAP_READ_BIT_EXT                                     0x0001
+#define GL_MAP_WRITE_BIT_EXT                                    0x0002
+#define GL_MAP_INVALIDATE_RANGE_BIT_EXT                         0x0004
+#define GL_MAP_INVALIDATE_BUFFER_BIT_EXT                        0x0008
+#define GL_MAP_FLUSH_EXPLICIT_BIT_EXT                           0x0010
+#define GL_MAP_UNSYNCHRONIZED_BIT_EXT                           0x0020
+#endif
+
+/* GL_EXT_multisampled_render_to_texture */
+#ifndef GL_EXT_multisampled_render_to_texture
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT           0x8D6C
+/* reuse values from GL_EXT_framebuffer_multisample (desktop extension) */
+#define GL_RENDERBUFFER_SAMPLES_EXT                             0x8CAB
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT               0x8D56
+#define GL_MAX_SAMPLES_EXT                                      0x8D57
+#endif
+
+/* GL_EXT_multi_draw_arrays */
+/* No new tokens introduced by this extension. */
+
+/* GL_EXT_read_format_bgra */
+#ifndef GL_EXT_read_format_bgra
+#define GL_BGRA_EXT                                             0x80E1
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT                       0x8365
+#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT                       0x8366
+#endif
+
+/* GL_EXT_robustness */
+#ifndef GL_EXT_robustness
+/* reuse GL_NO_ERROR */
+#define GL_GUILTY_CONTEXT_RESET_EXT                             0x8253
+#define GL_INNOCENT_CONTEXT_RESET_EXT                           0x8254
+#define GL_UNKNOWN_CONTEXT_RESET_EXT                            0x8255
+#define GL_CONTEXT_ROBUST_ACCESS_EXT                            0x90F3
+#define GL_RESET_NOTIFICATION_STRATEGY_EXT                      0x8256
+#define GL_LOSE_CONTEXT_ON_RESET_EXT                            0x8252
+#define GL_NO_RESET_NOTIFICATION_EXT                            0x8261
+#endif
+
+/* GL_EXT_sRGB */
+#ifndef GL_EXT_sRGB
+#define GL_SRGB_EXT                                             0x8C40
+#define GL_SRGB_ALPHA_EXT                                       0x8C42
+#define GL_SRGB8_ALPHA8_EXT                                     0x8C43
+#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT            0x8210
+#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT                        0x8C4C
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT                  0x8C4D
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT                  0x8C4E
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT                  0x8C4F
+#endif
+
+/* GL_EXT_texture_compression_dxt1 */
+#ifndef GL_EXT_texture_compression_dxt1
+#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT                         0x83F0
+#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT                        0x83F1
+#endif
+
+/* GL_EXT_texture_filter_anisotropic */
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_TEXTURE_MAX_ANISOTROPY_EXT                           0x84FE
+#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT                       0x84FF
+#endif
+
+/* GL_EXT_texture_format_BGRA8888 */
+#ifndef GL_EXT_texture_format_BGRA8888
+#define GL_BGRA_EXT                                             0x80E1
+#endif
+
+/* GL_EXT_texture_lod_bias */
+#ifndef GL_EXT_texture_lod_bias
+#define GL_MAX_TEXTURE_LOD_BIAS_EXT                             0x84FD
+#define GL_TEXTURE_FILTER_CONTROL_EXT                           0x8500
+#define GL_TEXTURE_LOD_BIAS_EXT                                 0x8501
+#endif
+
+/* GL_EXT_texture_storage */
+#ifndef GL_EXT_texture_storage
+#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT                         0x912F
+#define GL_ALPHA8_EXT                                           0x803C
+#define GL_LUMINANCE8_EXT                                       0x8040
+#define GL_LUMINANCE8_ALPHA8_EXT                                0x8045
+#define GL_RGBA32F_EXT                                          0x8814
+#define GL_RGB32F_EXT                                           0x8815
+#define GL_ALPHA32F_EXT                                         0x8816
+#define GL_LUMINANCE32F_EXT                                     0x8818
+#define GL_LUMINANCE_ALPHA32F_EXT                               0x8819
+/* reuse GL_RGBA16F_EXT */
+#define GL_RGB16F_EXT                                           0x881B
+#define GL_ALPHA16F_EXT                                         0x881C
+#define GL_LUMINANCE16F_EXT                                     0x881E
+#define GL_LUMINANCE_ALPHA16F_EXT                               0x881F
+#define GL_RGB10_A2_EXT                                         0x8059
+#define GL_RGB10_EXT                                            0x8052
+#define GL_BGRA8_EXT                                            0x93A1
+#endif
+
+/*------------------------------------------------------------------------*
+ * IMG extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_IMG_read_format */
+#ifndef GL_IMG_read_format
+#define GL_BGRA_IMG                                             0x80E1
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG                       0x8365
+#endif
+
+/* GL_IMG_texture_compression_pvrtc */
+#ifndef GL_IMG_texture_compression_pvrtc
+#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG                      0x8C00
+#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG                      0x8C01
+#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG                     0x8C02
+#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG                     0x8C03
+#endif
+
+/* GL_IMG_texture_env_enhanced_fixed_function */
+#ifndef GL_IMG_texture_env_enhanced_fixed_function
+#define GL_MODULATE_COLOR_IMG                                   0x8C04
+#define GL_RECIP_ADD_SIGNED_ALPHA_IMG                           0x8C05
+#define GL_TEXTURE_ALPHA_MODULATE_IMG                           0x8C06
+#define GL_FACTOR_ALPHA_MODULATE_IMG                            0x8C07
+#define GL_FRAGMENT_ALPHA_MODULATE_IMG                          0x8C08
+#define GL_ADD_BLEND_IMG                                        0x8C09
+#define GL_DOT3_RGBA_IMG                                        0x86AF
+#endif
+
+/* GL_IMG_user_clip_plane */
+#ifndef GL_IMG_user_clip_plane
+#define GL_CLIP_PLANE0_IMG                                      0x3000
+#define GL_CLIP_PLANE1_IMG                                      0x3001
+#define GL_CLIP_PLANE2_IMG                                      0x3002
+#define GL_CLIP_PLANE3_IMG                                      0x3003
+#define GL_CLIP_PLANE4_IMG                                      0x3004
+#define GL_CLIP_PLANE5_IMG                                      0x3005
+#define GL_MAX_CLIP_PLANES_IMG                                  0x0D32
+#endif
+
+/* GL_IMG_multisampled_render_to_texture */
+#ifndef GL_IMG_multisampled_render_to_texture
+#define GL_RENDERBUFFER_SAMPLES_IMG                             0x9133
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG               0x9134
+#define GL_MAX_SAMPLES_IMG                                      0x9135
+#define GL_TEXTURE_SAMPLES_IMG                                  0x9136
+#endif
+
+/*------------------------------------------------------------------------*
+ * NV extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_NV_fence */
+#ifndef GL_NV_fence
+#define GL_ALL_COMPLETED_NV                                     0x84F2
+#define GL_FENCE_STATUS_NV                                      0x84F3
+#define GL_FENCE_CONDITION_NV                                   0x84F4
+#endif
+
+/*------------------------------------------------------------------------*
+ * QCOM extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_QCOM_driver_control */
+/* No new tokens introduced by this extension. */
+
+/* GL_QCOM_extended_get */
+#ifndef GL_QCOM_extended_get
+#define GL_TEXTURE_WIDTH_QCOM                                   0x8BD2
+#define GL_TEXTURE_HEIGHT_QCOM                                  0x8BD3
+#define GL_TEXTURE_DEPTH_QCOM                                   0x8BD4
+#define GL_TEXTURE_INTERNAL_FORMAT_QCOM                         0x8BD5
+#define GL_TEXTURE_FORMAT_QCOM                                  0x8BD6
+#define GL_TEXTURE_TYPE_QCOM                                    0x8BD7
+#define GL_TEXTURE_IMAGE_VALID_QCOM                             0x8BD8
+#define GL_TEXTURE_NUM_LEVELS_QCOM                              0x8BD9
+#define GL_TEXTURE_TARGET_QCOM                                  0x8BDA
+#define GL_TEXTURE_OBJECT_VALID_QCOM                            0x8BDB
+#define GL_STATE_RESTORE                                        0x8BDC
+#endif
+
+/* GL_QCOM_extended_get2 */
+/* No new tokens introduced by this extension. */
+
+/* GL_QCOM_perfmon_global_mode */
+#ifndef GL_QCOM_perfmon_global_mode
+#define GL_PERFMON_GLOBAL_MODE_QCOM                             0x8FA0
+#endif
+
+/* GL_QCOM_writeonly_rendering */
+#ifndef GL_QCOM_writeonly_rendering
+#define GL_WRITEONLY_RENDERING_QCOM                             0x8823
+#endif
+
+/* GL_QCOM_tiled_rendering */
+#ifndef GL_QCOM_tiled_rendering
+#define GL_COLOR_BUFFER_BIT0_QCOM                               0x00000001
+#define GL_COLOR_BUFFER_BIT1_QCOM                               0x00000002
+#define GL_COLOR_BUFFER_BIT2_QCOM                               0x00000004
+#define GL_COLOR_BUFFER_BIT3_QCOM                               0x00000008
+#define GL_COLOR_BUFFER_BIT4_QCOM                               0x00000010
+#define GL_COLOR_BUFFER_BIT5_QCOM                               0x00000020
+#define GL_COLOR_BUFFER_BIT6_QCOM                               0x00000040
+#define GL_COLOR_BUFFER_BIT7_QCOM                               0x00000080
+#define GL_DEPTH_BUFFER_BIT0_QCOM                               0x00000100
+#define GL_DEPTH_BUFFER_BIT1_QCOM                               0x00000200
+#define GL_DEPTH_BUFFER_BIT2_QCOM                               0x00000400
+#define GL_DEPTH_BUFFER_BIT3_QCOM                               0x00000800
+#define GL_DEPTH_BUFFER_BIT4_QCOM                               0x00001000
+#define GL_DEPTH_BUFFER_BIT5_QCOM                               0x00002000
+#define GL_DEPTH_BUFFER_BIT6_QCOM                               0x00004000
+#define GL_DEPTH_BUFFER_BIT7_QCOM                               0x00008000
+#define GL_STENCIL_BUFFER_BIT0_QCOM                             0x00010000
+#define GL_STENCIL_BUFFER_BIT1_QCOM                             0x00020000
+#define GL_STENCIL_BUFFER_BIT2_QCOM                             0x00040000
+#define GL_STENCIL_BUFFER_BIT3_QCOM                             0x00080000
+#define GL_STENCIL_BUFFER_BIT4_QCOM                             0x00100000
+#define GL_STENCIL_BUFFER_BIT5_QCOM                             0x00200000
+#define GL_STENCIL_BUFFER_BIT6_QCOM                             0x00400000
+#define GL_STENCIL_BUFFER_BIT7_QCOM                             0x00800000
+#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM                         0x01000000
+#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM                         0x02000000
+#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM                         0x04000000
+#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM                         0x08000000
+#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM                         0x10000000
+#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM                         0x20000000
+#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM                         0x40000000
+#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM                         0x80000000
+#endif
+
+/*------------------------------------------------------------------------*
+ * End of extension tokens, start of corresponding extension functions
+ *------------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------------*
+ * OES extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_OES_blend_equation_separate */
+#ifndef GL_OES_blend_equation_separate
+#define GL_OES_blend_equation_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glBlendEquationSeparateOES (GLenum modeRGB, GLenum modeAlpha);
+#endif
+typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEOESPROC) (GLenum modeRGB, GLenum modeAlpha);
+#endif
+
+/* GL_OES_blend_func_separate */
+#ifndef GL_OES_blend_func_separate
+#define GL_OES_blend_func_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glBlendFuncSeparateOES (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+#endif
+typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEOESPROC) (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+#endif
+
+/* GL_OES_blend_subtract */
+#ifndef GL_OES_blend_subtract
+#define GL_OES_blend_subtract 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glBlendEquationOES (GLenum mode);
+#endif
+typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONOESPROC) (GLenum mode);
+#endif
+
+/* GL_OES_byte_coordinates */
+#ifndef GL_OES_byte_coordinates
+#define GL_OES_byte_coordinates 1
+#endif
+
+/* GL_OES_compressed_ETC1_RGB8_texture */
+#ifndef GL_OES_compressed_ETC1_RGB8_texture
+#define GL_OES_compressed_ETC1_RGB8_texture 1
+#endif
+
+/* GL_OES_depth24 */
+#ifndef GL_OES_depth24
+#define GL_OES_depth24 1
+#endif
+
+/* GL_OES_depth32 */
+#ifndef GL_OES_depth32
+#define GL_OES_depth32 1
+#endif
+
+/* GL_OES_draw_texture */
+#ifndef GL_OES_draw_texture
+#define GL_OES_draw_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glDrawTexsOES (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);
+GL_API void GL_APIENTRY glDrawTexiOES (GLint x, GLint y, GLint z, GLint width, GLint height);
+GL_API void GL_APIENTRY glDrawTexxOES (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);
+GL_API void GL_APIENTRY glDrawTexsvOES (const GLshort *coords);
+GL_API void GL_APIENTRY glDrawTexivOES (const GLint *coords);
+GL_API void GL_APIENTRY glDrawTexxvOES (const GLfixed *coords);
+GL_API void GL_APIENTRY glDrawTexfOES (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
+GL_API void GL_APIENTRY glDrawTexfvOES (const GLfloat *coords);
+#endif
+typedef void (GL_APIENTRYP PFNGLDRAWTEXSOESPROC) (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);
+typedef void (GL_APIENTRYP PFNGLDRAWTEXIOESPROC) (GLint x, GLint y, GLint z, GLint width, GLint height);
+typedef void (GL_APIENTRYP PFNGLDRAWTEXXOESPROC) (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);
+typedef void (GL_APIENTRYP PFNGLDRAWTEXSVOESPROC) (const GLshort *coords);
+typedef void (GL_APIENTRYP PFNGLDRAWTEXIVOESPROC) (const GLint *coords);
+typedef void (GL_APIENTRYP PFNGLDRAWTEXXVOESPROC) (const GLfixed *coords);
+typedef void (GL_APIENTRYP PFNGLDRAWTEXFOESPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
+typedef void (GL_APIENTRYP PFNGLDRAWTEXFVOESPROC) (const GLfloat *coords);
+#endif
+
+/* GL_OES_EGL_image */
+#ifndef GL_OES_EGL_image
+#define GL_OES_EGL_image 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image);
+GL_API void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image);
+#endif
+typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
+typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
+#endif
+
+/* GL_OES_EGL_image_external */
+#ifndef GL_OES_EGL_image_external
+#define GL_OES_EGL_image_external 1
+/* glEGLImageTargetTexture2DOES defined in GL_OES_EGL_image already. */
+#endif
+
+/* GL_OES_element_index_uint */
+#ifndef GL_OES_element_index_uint
+#define GL_OES_element_index_uint 1
+#endif
+
+/* GL_OES_extended_matrix_palette */
+#ifndef GL_OES_extended_matrix_palette
+#define GL_OES_extended_matrix_palette 1
+#endif
+
+/* GL_OES_fbo_render_mipmap */
+#ifndef GL_OES_fbo_render_mipmap
+#define GL_OES_fbo_render_mipmap 1
+#endif
+
+/* GL_OES_fixed_point */
+#ifndef GL_OES_fixed_point
+#define GL_OES_fixed_point 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glAlphaFuncxOES (GLenum func, GLclampx ref);
+GL_API void GL_APIENTRY glClearColorxOES (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
+GL_API void GL_APIENTRY glClearDepthxOES (GLclampx depth);
+GL_API void GL_APIENTRY glClipPlanexOES (GLenum plane, const GLfixed *equation);
+GL_API void GL_APIENTRY glColor4xOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+GL_API void GL_APIENTRY glDepthRangexOES (GLclampx zNear, GLclampx zFar);
+GL_API void GL_APIENTRY glFogxOES (GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glFogxvOES (GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glFrustumxOES (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+GL_API void GL_APIENTRY glGetClipPlanexOES (GLenum pname, GLfixed eqn[4]);
+GL_API void GL_APIENTRY glGetFixedvOES (GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetLightxvOES (GLenum light, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetMaterialxvOES (GLenum face, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetTexEnvxvOES (GLenum env, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetTexParameterxvOES (GLenum target, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glLightModelxOES (GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glLightModelxvOES (GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glLightxOES (GLenum light, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glLightxvOES (GLenum light, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glLineWidthxOES (GLfixed width);
+GL_API void GL_APIENTRY glLoadMatrixxOES (const GLfixed *m);
+GL_API void GL_APIENTRY glMaterialxOES (GLenum face, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glMaterialxvOES (GLenum face, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glMultMatrixxOES (const GLfixed *m);
+GL_API void GL_APIENTRY glMultiTexCoord4xOES (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+GL_API void GL_APIENTRY glNormal3xOES (GLfixed nx, GLfixed ny, GLfixed nz);
+GL_API void GL_APIENTRY glOrthoxOES (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+GL_API void GL_APIENTRY glPointParameterxOES (GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glPointParameterxvOES (GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glPointSizexOES (GLfixed size);
+GL_API void GL_APIENTRY glPolygonOffsetxOES (GLfixed factor, GLfixed units);
+GL_API void GL_APIENTRY glRotatexOES (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
+GL_API void GL_APIENTRY glSampleCoveragexOES (GLclampx value, GLboolean invert);
+GL_API void GL_APIENTRY glScalexOES (GLfixed x, GLfixed y, GLfixed z);
+GL_API void GL_APIENTRY glTexEnvxOES (GLenum target, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glTexEnvxvOES (GLenum target, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glTexParameterxOES (GLenum target, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glTexParameterxvOES (GLenum target, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glTranslatexOES (GLfixed x, GLfixed y, GLfixed z);
+#endif
+typedef void (GL_APIENTRYP PFNGLALPHAFUNCXOESPROC) (GLenum func, GLclampx ref);
+typedef void (GL_APIENTRYP PFNGLCLEARCOLORXOESPROC) (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
+typedef void (GL_APIENTRYP PFNGLCLEARDEPTHXOESPROC) (GLclampx depth);
+typedef void (GL_APIENTRYP PFNGLCLIPPLANEXOESPROC) (GLenum plane, const GLfixed *equation);
+typedef void (GL_APIENTRYP PFNGLCOLOR4XOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+typedef void (GL_APIENTRYP PFNGLDEPTHRANGEXOESPROC) (GLclampx zNear, GLclampx zFar);
+typedef void (GL_APIENTRYP PFNGLFOGXOESPROC) (GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLFOGXVOESPROC) (GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLFRUSTUMXOESPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+typedef void (GL_APIENTRYP PFNGLGETCLIPPLANEXOESPROC) (GLenum pname, GLfixed eqn[4]);
+typedef void (GL_APIENTRYP PFNGLGETFIXEDVOESPROC) (GLenum pname, GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLGETLIGHTXVOESPROC) (GLenum light, GLenum pname, GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLGETMATERIALXVOESPROC) (GLenum face, GLenum pname, GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXENVXVOESPROC) (GLenum env, GLenum pname, GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLLIGHTMODELXOESPROC) (GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLLIGHTMODELXVOESPROC) (GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLLIGHTXOESPROC) (GLenum light, GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLLIGHTXVOESPROC) (GLenum light, GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLLINEWIDTHXOESPROC) (GLfixed width);
+typedef void (GL_APIENTRYP PFNGLLOADMATRIXXOESPROC) (const GLfixed *m);
+typedef void (GL_APIENTRYP PFNGLMATERIALXOESPROC) (GLenum face, GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLMATERIALXVOESPROC) (GLenum face, GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLMULTMATRIXXOESPROC) (const GLfixed *m);
+typedef void (GL_APIENTRYP PFNGLMULTITEXCOORD4XOESPROC) (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+typedef void (GL_APIENTRYP PFNGLNORMAL3XOESPROC) (GLfixed nx, GLfixed ny, GLfixed nz);
+typedef void (GL_APIENTRYP PFNGLORTHOXOESPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+typedef void (GL_APIENTRYP PFNGLPOINTPARAMETERXOESPROC) (GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLPOINTPARAMETERXVOESPROC) (GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLPOINTSIZEXOESPROC) (GLfixed size);
+typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETXOESPROC) (GLfixed factor, GLfixed units);
+typedef void (GL_APIENTRYP PFNGLROTATEXOESPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
+typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEXOESPROC) (GLclampx value, GLboolean invert);
+typedef void (GL_APIENTRYP PFNGLSCALEXOESPROC) (GLfixed x, GLfixed y, GLfixed z);
+typedef void (GL_APIENTRYP PFNGLTEXENVXOESPROC) (GLenum target, GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLTEXENVXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLTEXPARAMETERXOESPROC) (GLenum target, GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLTRANSLATEXOESPROC) (GLfixed x, GLfixed y, GLfixed z);
+#endif
+
+/* GL_OES_framebuffer_object */
+#ifndef GL_OES_framebuffer_object
+#define GL_OES_framebuffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API GLboolean GL_APIENTRY glIsRenderbufferOES (GLuint renderbuffer);
+GL_API void GL_APIENTRY glBindRenderbufferOES (GLenum target, GLuint renderbuffer);
+GL_API void GL_APIENTRY glDeleteRenderbuffersOES (GLsizei n, const GLuint* renderbuffers);
+GL_API void GL_APIENTRY glGenRenderbuffersOES (GLsizei n, GLuint* renderbuffers);
+GL_API void GL_APIENTRY glRenderbufferStorageOES (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+GL_API void GL_APIENTRY glGetRenderbufferParameterivOES (GLenum target, GLenum pname, GLint* params);
+GL_API GLboolean GL_APIENTRY glIsFramebufferOES (GLuint framebuffer);
+GL_API void GL_APIENTRY glBindFramebufferOES (GLenum target, GLuint framebuffer);
+GL_API void GL_APIENTRY glDeleteFramebuffersOES (GLsizei n, const GLuint* framebuffers);
+GL_API void GL_APIENTRY glGenFramebuffersOES (GLsizei n, GLuint* framebuffers);
+GL_API GLenum GL_APIENTRY glCheckFramebufferStatusOES (GLenum target);
+GL_API void GL_APIENTRY glFramebufferRenderbufferOES (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GL_API void GL_APIENTRY glFramebufferTexture2DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GL_API void GL_APIENTRY glGetFramebufferAttachmentParameterivOES (GLenum target, GLenum attachment, GLenum pname, GLint* params);
+GL_API void GL_APIENTRY glGenerateMipmapOES (GLenum target);
+#endif
+typedef GLboolean (GL_APIENTRYP PFNGLISRENDERBUFFEROESPROC) (GLuint renderbuffer);
+typedef void (GL_APIENTRYP PFNGLBINDRENDERBUFFEROESPROC) (GLenum target, GLuint renderbuffer);
+typedef void (GL_APIENTRYP PFNGLDELETERENDERBUFFERSOESPROC) (GLsizei n, const GLuint* renderbuffers);
+typedef void (GL_APIENTRYP PFNGLGENRENDERBUFFERSOESPROC) (GLsizei n, GLuint* renderbuffers);
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVOESPROC) (GLenum target, GLenum pname, GLint* params);
+typedef GLboolean (GL_APIENTRYP PFNGLISFRAMEBUFFEROESPROC) (GLuint framebuffer);
+typedef void (GL_APIENTRYP PFNGLBINDFRAMEBUFFEROESPROC) (GLenum target, GLuint framebuffer);
+typedef void (GL_APIENTRYP PFNGLDELETEFRAMEBUFFERSOESPROC) (GLsizei n, const GLuint* framebuffers);
+typedef void (GL_APIENTRYP PFNGLGENFRAMEBUFFERSOESPROC) (GLsizei n, GLuint* framebuffers);
+typedef GLenum (GL_APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSOESPROC) (GLenum target);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEROESPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DOESPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVOESPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params);
+typedef void (GL_APIENTRYP PFNGLGENERATEMIPMAPOESPROC) (GLenum target);
+#endif
+
+/* GL_OES_mapbuffer */
+#ifndef GL_OES_mapbuffer
+#define GL_OES_mapbuffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void* GL_APIENTRY glMapBufferOES (GLenum target, GLenum access);
+GL_API GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target);
+GL_API void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, GLvoid ** params);
+#endif
+typedef void* (GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access);
+typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target);
+typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, GLvoid ** params);
+#endif
+
+/* GL_OES_matrix_get */
+#ifndef GL_OES_matrix_get
+#define GL_OES_matrix_get 1
+#endif
+
+/* GL_OES_matrix_palette */
+#ifndef GL_OES_matrix_palette
+#define GL_OES_matrix_palette 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glCurrentPaletteMatrixOES (GLuint matrixpaletteindex);
+GL_API void GL_APIENTRY glLoadPaletteFromModelViewMatrixOES (void);
+GL_API void GL_APIENTRY glMatrixIndexPointerOES (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GL_API void GL_APIENTRY glWeightPointerOES (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+typedef void (GL_APIENTRYP PFNGLCURRENTPALETTEMATRIXOESPROC) (GLuint matrixpaletteindex);
+typedef void (GL_APIENTRYP PFNGLLOADPALETTEFROMMODELVIEWMATRIXOESPROC) (void);
+typedef void (GL_APIENTRYP PFNGLMATRIXINDEXPOINTEROESPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (GL_APIENTRYP PFNGLWEIGHTPOINTEROESPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+/* GL_OES_packed_depth_stencil */
+#ifndef GL_OES_packed_depth_stencil
+#define GL_OES_packed_depth_stencil 1
+#endif
+
+/* GL_OES_required_internalformat */
+#ifndef GL_OES_required_internalformat
+#define GL_OES_required_internalformat 1
+#endif
+
+/* GL_OES_query_matrix */
+#ifndef GL_OES_query_matrix
+#define GL_OES_query_matrix 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API GLbitfield GL_APIENTRY glQueryMatrixxOES (GLfixed mantissa[16], GLint exponent[16]);
+#endif
+typedef GLbitfield (GL_APIENTRYP PFNGLQUERYMATRIXXOESPROC) (GLfixed mantissa[16], GLint exponent[16]);
+#endif
+
+/* GL_OES_rgb8_rgba8 */
+#ifndef GL_OES_rgb8_rgba8
+#define GL_OES_rgb8_rgba8 1
+#endif
+
+/* GL_OES_single_precision */
+#ifndef GL_OES_single_precision
+#define GL_OES_single_precision 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glDepthRangefOES (GLclampf zNear, GLclampf zFar);
+GL_API void GL_APIENTRY glFrustumfOES (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+GL_API void GL_APIENTRY glOrthofOES (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+GL_API void GL_APIENTRY glClipPlanefOES (GLenum plane, const GLfloat *equation);
+GL_API void GL_APIENTRY glGetClipPlanefOES (GLenum pname, GLfloat eqn[4]);
+GL_API void GL_APIENTRY glClearDepthfOES (GLclampf depth);
+#endif
+typedef void (GL_APIENTRYP PFNGLDEPTHRANGEFOESPROC) (GLclampf zNear, GLclampf zFar);
+typedef void (GL_APIENTRYP PFNGLFRUSTUMFOESPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+typedef void (GL_APIENTRYP PFNGLORTHOFOESPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+typedef void (GL_APIENTRYP PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat *equation);
+typedef void (GL_APIENTRYP PFNGLGETCLIPPLANEFOESPROC) (GLenum pname, GLfloat eqn[4]);
+typedef void (GL_APIENTRYP PFNGLCLEARDEPTHFOESPROC) (GLclampf depth);
+#endif
+
+/* GL_OES_stencil1 */
+#ifndef GL_OES_stencil1
+#define GL_OES_stencil1 1
+#endif
+
+/* GL_OES_stencil4 */
+#ifndef GL_OES_stencil4
+#define GL_OES_stencil4 1
+#endif
+
+/* GL_OES_stencil8 */
+#ifndef GL_OES_stencil8
+#define GL_OES_stencil8 1
+#endif
+
+/* GL_OES_stencil_wrap */
+#ifndef GL_OES_stencil_wrap
+#define GL_OES_stencil_wrap 1
+#endif
+
+/* GL_OES_texture_cube_map */
+#ifndef GL_OES_texture_cube_map
+#define GL_OES_texture_cube_map 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glTexGenfOES (GLenum coord, GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glTexGenfvOES (GLenum coord, GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glTexGeniOES (GLenum coord, GLenum pname, GLint param);
+GL_API void GL_APIENTRY glTexGenivOES (GLenum coord, GLenum pname, const GLint *params);
+GL_API void GL_APIENTRY glTexGenxOES (GLenum coord, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glTexGenxvOES (GLenum coord, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glGetTexGenfvOES (GLenum coord, GLenum pname, GLfloat *params);
+GL_API void GL_APIENTRY glGetTexGenivOES (GLenum coord, GLenum pname, GLint *params);
+GL_API void GL_APIENTRY glGetTexGenxvOES (GLenum coord, GLenum pname, GLfixed *params);
+#endif
+typedef void (GL_APIENTRYP PFNGLTEXGENFOESPROC) (GLenum coord, GLenum pname, GLfloat param);
+typedef void (GL_APIENTRYP PFNGLTEXGENFVOESPROC) (GLenum coord, GLenum pname, const GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLTEXGENIOESPROC) (GLenum coord, GLenum pname, GLint param);
+typedef void (GL_APIENTRYP PFNGLTEXGENIVOESPROC) (GLenum coord, GLenum pname, const GLint *params);
+typedef void (GL_APIENTRYP PFNGLTEXGENXOESPROC) (GLenum coord, GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLTEXGENXVOESPROC) (GLenum coord, GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXGENFVOESPROC) (GLenum coord, GLenum pname, GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXGENIVOESPROC) (GLenum coord, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXGENXVOESPROC) (GLenum coord, GLenum pname, GLfixed *params);
+#endif
+
+/* GL_OES_texture_env_crossbar */
+#ifndef GL_OES_texture_env_crossbar
+#define GL_OES_texture_env_crossbar 1
+#endif
+
+/* GL_OES_texture_mirrored_repeat */
+#ifndef GL_OES_texture_mirrored_repeat
+#define GL_OES_texture_mirrored_repeat 1
+#endif
+
+/* GL_OES_vertex_array_object */
+#ifndef GL_OES_vertex_array_object
+#define GL_OES_vertex_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glBindVertexArrayOES (GLuint array);
+GL_API void GL_APIENTRY glDeleteVertexArraysOES (GLsizei n, const GLuint *arrays);
+GL_API void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays);
+GL_API GLboolean GL_APIENTRY glIsVertexArrayOES (GLuint array);
+#endif
+typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array);
+typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays);
+typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays);
+typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array);
+#endif
+
+/*------------------------------------------------------------------------*
+ * AMD extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_AMD_compressed_3DC_texture */
+#ifndef GL_AMD_compressed_3DC_texture
+#define GL_AMD_compressed_3DC_texture 1
+#endif
+
+/* GL_AMD_compressed_ATC_texture */
+#ifndef GL_AMD_compressed_ATC_texture
+#define GL_AMD_compressed_ATC_texture 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * APPLE extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_APPLE_copy_texture_levels */
+#ifndef GL_APPLE_copy_texture_levels
+#define GL_APPLE_copy_texture_levels 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glCopyTextureLevelsAPPLE (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount);
+#endif
+typedef void (GL_APIENTRYP PFNGLCOPYTEXTURELEVELSAPPLEPROC) (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount);
+#endif
+
+/* GL_APPLE_framebuffer_multisample */
+#ifndef GL_APPLE_framebuffer_multisample
+#define GL_APPLE_framebuffer_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glRenderbufferStorageMultisampleAPPLE (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
+GL_API void GL_APIENTRY glResolveMultisampleFramebufferAPPLE (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void);
+#endif
+
+/* GL_APPLE_sync */
+#ifndef GL_APPLE_sync
+#define GL_APPLE_sync 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API GLsync GL_APIENTRY glFenceSyncAPPLE (GLenum condition, GLbitfield flags);
+GL_API GLboolean GL_APIENTRY glIsSyncAPPLE (GLsync sync);
+GL_API void GL_APIENTRY glDeleteSyncAPPLE (GLsync sync);
+GL_API GLenum GL_APIENTRY glClientWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout);
+GL_API void GL_APIENTRY glWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout);
+GL_API void GL_APIENTRY glGetInteger64vAPPLE (GLenum pname, GLint64 *params);
+GL_API void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+#endif
+typedef GLsync (GL_APIENTRYP PFNGLFENCESYNCAPPLEPROC) (GLenum condition, GLbitfield flags);
+typedef GLboolean (GL_APIENTRYP PFNGLISSYNCAPPLEPROC) (GLsync sync);
+typedef void (GL_APIENTRYP PFNGLDELETESYNCAPPLEPROC) (GLsync sync);
+typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
+typedef void (GL_APIENTRYP PFNGLWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
+typedef void (GL_APIENTRYP PFNGLGETINTEGER64VAPPLEPROC) (GLenum pname, GLint64 *params);
+typedef void (GL_APIENTRYP PFNGLGETSYNCIVAPPLEPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+#endif
+
+/* GL_APPLE_texture_2D_limited_npot */
+#ifndef GL_APPLE_texture_2D_limited_npot
+#define GL_APPLE_texture_2D_limited_npot 1
+#endif
+
+/* GL_APPLE_texture_format_BGRA8888 */
+#ifndef GL_APPLE_texture_format_BGRA8888
+#define GL_APPLE_texture_format_BGRA8888 1
+#endif
+
+/* GL_APPLE_texture_max_level */
+#ifndef GL_APPLE_texture_max_level
+#define GL_APPLE_texture_max_level 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * ARM extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_ARM_rgba8 */
+#ifndef GL_ARM_rgba8
+#define GL_ARM_rgba8 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * EXT extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_EXT_blend_minmax */
+#ifndef GL_EXT_blend_minmax
+#define GL_EXT_blend_minmax 1
+#endif
+
+/* GL_EXT_discard_framebuffer */
+#ifndef GL_EXT_discard_framebuffer
+#define GL_EXT_discard_framebuffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments);
+#endif
+typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
+#endif
+
+/* GL_EXT_map_buffer_range */
+#ifndef GL_EXT_map_buffer_range
+#define GL_EXT_map_buffer_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY *glMapBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+GL_API void GL_APIENTRY glFlushMappedBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length);
+#endif
+typedef void* (GL_APIENTRYP PFNGLMAPBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+typedef void (GL_APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
+#endif
+
+/* GL_EXT_multisampled_render_to_texture */
+#ifndef GL_EXT_multisampled_render_to_texture
+#define GL_EXT_multisampled_render_to_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
+GL_API void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei);
+#endif
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+#endif
+
+/* GL_EXT_multi_draw_arrays */
+#ifndef GL_EXT_multi_draw_arrays
+#define GL_EXT_multi_draw_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glMultiDrawArraysEXT (GLenum, const GLint *, const GLsizei *, GLsizei);
+GL_API void GL_APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* const*, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const*indices, GLsizei primcount);
+#endif
+
+/* GL_EXT_read_format_bgra */
+#ifndef GL_EXT_read_format_bgra
+#define GL_EXT_read_format_bgra 1
+#endif
+
+/* GL_EXT_robustness */
+#ifndef GL_EXT_robustness
+#define GL_EXT_robustness 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API GLenum GL_APIENTRY glGetGraphicsResetStatusEXT (void);
+GL_API void GL_APIENTRY glReadnPixelsEXT (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+GL_API void GL_APIENTRY glGetnUniformfvEXT (GLuint program, GLint location, GLsizei bufSize, float *params);
+GL_API void GL_APIENTRY glGetnUniformivEXT (GLuint program, GLint location, GLsizei bufSize, GLint *params);
+#endif
+typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSEXTPROC) (void);
+typedef void (GL_APIENTRYP PFNGLREADNPIXELSEXTPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, float *params);
+typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
+#endif
+
+/* GL_EXT_sRGB */
+#ifndef GL_EXT_sRGB
+#define GL_EXT_sRGB 1
+#endif
+
+/* GL_EXT_texture_compression_dxt1 */
+#ifndef GL_EXT_texture_compression_dxt1
+#define GL_EXT_texture_compression_dxt1 1
+#endif
+
+/* GL_EXT_texture_filter_anisotropic */
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_EXT_texture_filter_anisotropic 1
+#endif
+
+/* GL_EXT_texture_format_BGRA8888 */
+#ifndef GL_EXT_texture_format_BGRA8888
+#define GL_EXT_texture_format_BGRA8888 1
+#endif
+
+/* GL_EXT_texture_lod_bias */
+#ifndef GL_EXT_texture_lod_bias
+#define GL_EXT_texture_lod_bias 1
+#endif
+
+/* GL_EXT_texture_storage */
+#ifndef GL_EXT_texture_storage
+#define GL_EXT_texture_storage 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+GL_API void GL_APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+GL_API void GL_APIENTRY glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+GL_API void GL_APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+GL_API void GL_APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+GL_API void GL_APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+#endif
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+#endif
+
+/*------------------------------------------------------------------------*
+ * IMG extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_IMG_read_format */
+#ifndef GL_IMG_read_format
+#define GL_IMG_read_format 1
+#endif
+
+/* GL_IMG_texture_compression_pvrtc */
+#ifndef GL_IMG_texture_compression_pvrtc
+#define GL_IMG_texture_compression_pvrtc 1
+#endif
+
+/* GL_IMG_texture_env_enhanced_fixed_function */
+#ifndef GL_IMG_texture_env_enhanced_fixed_function
+#define GL_IMG_texture_env_enhanced_fixed_function 1
+#endif
+
+/* GL_IMG_user_clip_plane */
+#ifndef GL_IMG_user_clip_plane
+#define GL_IMG_user_clip_plane 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glClipPlanefIMG (GLenum, const GLfloat *);
+GL_API void GL_APIENTRY glClipPlanexIMG (GLenum, const GLfixed *);
+#endif
+typedef void (GL_APIENTRYP PFNGLCLIPPLANEFIMGPROC) (GLenum p, const GLfloat *eqn);
+typedef void (GL_APIENTRYP PFNGLCLIPPLANEXIMGPROC) (GLenum p, const GLfixed *eqn);
+#endif
+
+/* GL_IMG_multisampled_render_to_texture */
+#ifndef GL_IMG_multisampled_render_to_texture
+#define GL_IMG_multisampled_render_to_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
+GL_API void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei);
+#endif
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMGPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+#endif
+
+/*------------------------------------------------------------------------*
+ * NV extension functions
+ *------------------------------------------------------------------------*/
+
+/* NV_fence */
+#ifndef GL_NV_fence
+#define GL_NV_fence 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glDeleteFencesNV (GLsizei, const GLuint *);
+GL_API void GL_APIENTRY glGenFencesNV (GLsizei, GLuint *);
+GL_API GLboolean GL_APIENTRY glIsFenceNV (GLuint);
+GL_API GLboolean GL_APIENTRY glTestFenceNV (GLuint);
+GL_API void GL_APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *);
+GL_API void GL_APIENTRY glFinishFenceNV (GLuint);
+GL_API void GL_APIENTRY glSetFenceNV (GLuint, GLenum);
+#endif
+typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
+typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
+typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
+typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
+typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
+typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
+#endif
+
+/*------------------------------------------------------------------------*
+ * QCOM extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_QCOM_driver_control */
+#ifndef GL_QCOM_driver_control
+#define GL_QCOM_driver_control 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls);
+GL_API void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
+GL_API void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl);
+GL_API void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl);
+#endif
+typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls);
+typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
+typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
+typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
+#endif
+
+/* GL_QCOM_extended_get */
+#ifndef GL_QCOM_extended_get
+#define GL_QCOM_extended_get 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glExtGetTexturesQCOM (GLuint *textures, GLint maxTextures, GLint *numTextures);
+GL_API void GL_APIENTRY glExtGetBuffersQCOM (GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
+GL_API void GL_APIENTRY glExtGetRenderbuffersQCOM (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
+GL_API void GL_APIENTRY glExtGetFramebuffersQCOM (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
+GL_API void GL_APIENTRY glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
+GL_API void GL_APIENTRY glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param);
+GL_API void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels);
+GL_API void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, GLvoid **params);
+#endif
+typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures);
+typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
+typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
+typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
+typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels);
+typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, GLvoid **params);
+#endif
+
+/* GL_QCOM_extended_get2 */
+#ifndef GL_QCOM_extended_get2
+#define GL_QCOM_extended_get2 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint maxShaders, GLint *numShaders);
+GL_API void GL_APIENTRY glExtGetProgramsQCOM (GLuint *programs, GLint maxPrograms, GLint *numPrograms);
+GL_API GLboolean GL_APIENTRY glExtIsProgramBinaryQCOM (GLuint program);
+GL_API void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, GLchar *source, GLint *length);
+#endif
+typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders);
+typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms);
+typedef GLboolean (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program);
+typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length);
+#endif
+
+/* GL_QCOM_perfmon_global_mode */
+#ifndef GL_QCOM_perfmon_global_mode
+#define GL_QCOM_perfmon_global_mode 1
+#endif
+
+/* GL_QCOM_writeonly_rendering */
+#ifndef GL_QCOM_writeonly_rendering
+#define GL_QCOM_writeonly_rendering 1
+#endif
+
+/* GL_QCOM_tiled_rendering */
+#ifndef GL_QCOM_tiled_rendering
+#define GL_QCOM_tiled_rendering 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glStartTilingQCOM (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
+GL_API void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask);
+#endif
+typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
+typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __glext_h_ */
diff --git a/system/include/GLES/glplatform.h b/system/include/GLES/glplatform.h
new file mode 100644
index 0000000..2db6ee2
--- /dev/null
+++ b/system/include/GLES/glplatform.h
@@ -0,0 +1,30 @@
+#ifndef __glplatform_h_
+#define __glplatform_h_
+
+/* $Revision: 10601 $ on $Date:: 2010-03-04 22:15:27 -0800 #$ */
+
+/*
+ * This document is licensed under the SGI Free Software B License Version
+ * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
+ */
+
+/* Platform-specific types and definitions for OpenGL ES 1.X  gl.h
+ *
+ * Adopters may modify khrplatform.h and this file to suit their platform.
+ * You are encouraged to submit all modifications to the Khronos group so that
+ * they can be included in future versions of this file.  Please submit changes
+ * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
+ * by filing a bug against product "OpenGL-ES" component "Registry".
+ */
+
+#include <KHR/khrplatform.h>
+
+#ifndef GL_API
+#define GL_API      KHRONOS_APICALL
+#endif
+
+#ifndef GL_APIENTRY
+#define GL_APIENTRY KHRONOS_APIENTRY
+#endif
+
+#endif /* __glplatform_h_ */
diff --git a/system/include/GLES2/gl2.h b/system/include/GLES2/gl2.h
new file mode 100644
index 0000000..c658c0b
--- /dev/null
+++ b/system/include/GLES2/gl2.h
@@ -0,0 +1,656 @@
+#ifndef __gles2_gl2_h_
+#define __gles2_gl2_h_ 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** Copyright 2013-2020 The Khronos Group Inc.
+** SPDX-License-Identifier: MIT
+**
+** This header is generated from the Khronos OpenGL / OpenGL ES XML
+** API Registry. The current version of the Registry, generator scripts
+** used to make the header, and the header can be found at
+**   https://github.com/KhronosGroup/OpenGL-Registry
+*/
+
+#include <GLES2/gl2platform.h>
+
+#ifndef GL_APIENTRYP
+#define GL_APIENTRYP GL_APIENTRY*
+#endif
+
+#ifndef GL_GLES_PROTOTYPES
+#define GL_GLES_PROTOTYPES 1
+#endif
+
+/* Generated on date 20211115 */
+
+/* Generated C header for:
+ * API: gles2
+ * Profile: common
+ * Versions considered: 2\.[0-9]
+ * Versions emitted: .*
+ * Default extensions included: None
+ * Additional extensions included: _nomatch_^
+ * Extensions removed: _nomatch_^
+ */
+
+#ifndef GL_ES_VERSION_2_0
+#define GL_ES_VERSION_2_0 1
+#include <KHR/khrplatform.h>
+typedef khronos_int8_t GLbyte;
+typedef khronos_float_t GLclampf;
+typedef khronos_int32_t GLfixed;
+typedef khronos_int16_t GLshort;
+typedef khronos_uint16_t GLushort;
+typedef void GLvoid;
+typedef struct __GLsync *GLsync;
+typedef khronos_int64_t GLint64;
+typedef khronos_uint64_t GLuint64;
+typedef unsigned int GLenum;
+typedef unsigned int GLuint;
+typedef char GLchar;
+typedef khronos_float_t GLfloat;
+typedef khronos_ssize_t GLsizeiptr;
+typedef khronos_intptr_t GLintptr;
+typedef unsigned int GLbitfield;
+typedef int GLint;
+typedef unsigned char GLboolean;
+typedef int GLsizei;
+typedef khronos_uint8_t GLubyte;
+#define GL_DEPTH_BUFFER_BIT               0x00000100
+#define GL_STENCIL_BUFFER_BIT             0x00000400
+#define GL_COLOR_BUFFER_BIT               0x00004000
+#define GL_FALSE                          0
+#define GL_TRUE                           1
+#define GL_POINTS                         0x0000
+#define GL_LINES                          0x0001
+#define GL_LINE_LOOP                      0x0002
+#define GL_LINE_STRIP                     0x0003
+#define GL_TRIANGLES                      0x0004
+#define GL_TRIANGLE_STRIP                 0x0005
+#define GL_TRIANGLE_FAN                   0x0006
+#define GL_ZERO                           0
+#define GL_ONE                            1
+#define GL_SRC_COLOR                      0x0300
+#define GL_ONE_MINUS_SRC_COLOR            0x0301
+#define GL_SRC_ALPHA                      0x0302
+#define GL_ONE_MINUS_SRC_ALPHA            0x0303
+#define GL_DST_ALPHA                      0x0304
+#define GL_ONE_MINUS_DST_ALPHA            0x0305
+#define GL_DST_COLOR                      0x0306
+#define GL_ONE_MINUS_DST_COLOR            0x0307
+#define GL_SRC_ALPHA_SATURATE             0x0308
+#define GL_FUNC_ADD                       0x8006
+#define GL_BLEND_EQUATION                 0x8009
+#define GL_BLEND_EQUATION_RGB             0x8009
+#define GL_BLEND_EQUATION_ALPHA           0x883D
+#define GL_FUNC_SUBTRACT                  0x800A
+#define GL_FUNC_REVERSE_SUBTRACT          0x800B
+#define GL_BLEND_DST_RGB                  0x80C8
+#define GL_BLEND_SRC_RGB                  0x80C9
+#define GL_BLEND_DST_ALPHA                0x80CA
+#define GL_BLEND_SRC_ALPHA                0x80CB
+#define GL_CONSTANT_COLOR                 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR       0x8002
+#define GL_CONSTANT_ALPHA                 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA       0x8004
+#define GL_BLEND_COLOR                    0x8005
+#define GL_ARRAY_BUFFER                   0x8892
+#define GL_ELEMENT_ARRAY_BUFFER           0x8893
+#define GL_ARRAY_BUFFER_BINDING           0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING   0x8895
+#define GL_STREAM_DRAW                    0x88E0
+#define GL_STATIC_DRAW                    0x88E4
+#define GL_DYNAMIC_DRAW                   0x88E8
+#define GL_BUFFER_SIZE                    0x8764
+#define GL_BUFFER_USAGE                   0x8765
+#define GL_CURRENT_VERTEX_ATTRIB          0x8626
+#define GL_FRONT                          0x0404
+#define GL_BACK                           0x0405
+#define GL_FRONT_AND_BACK                 0x0408
+#define GL_TEXTURE_2D                     0x0DE1
+#define GL_CULL_FACE                      0x0B44
+#define GL_BLEND                          0x0BE2
+#define GL_DITHER                         0x0BD0
+#define GL_STENCIL_TEST                   0x0B90
+#define GL_DEPTH_TEST                     0x0B71
+#define GL_SCISSOR_TEST                   0x0C11
+#define GL_POLYGON_OFFSET_FILL            0x8037
+#define GL_SAMPLE_ALPHA_TO_COVERAGE       0x809E
+#define GL_SAMPLE_COVERAGE                0x80A0
+#define GL_NO_ERROR                       0
+#define GL_INVALID_ENUM                   0x0500
+#define GL_INVALID_VALUE                  0x0501
+#define GL_INVALID_OPERATION              0x0502
+#define GL_OUT_OF_MEMORY                  0x0505
+#define GL_CW                             0x0900
+#define GL_CCW                            0x0901
+#define GL_LINE_WIDTH                     0x0B21
+#define GL_ALIASED_POINT_SIZE_RANGE       0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE       0x846E
+#define GL_CULL_FACE_MODE                 0x0B45
+#define GL_FRONT_FACE                     0x0B46
+#define GL_DEPTH_RANGE                    0x0B70
+#define GL_DEPTH_WRITEMASK                0x0B72
+#define GL_DEPTH_CLEAR_VALUE              0x0B73
+#define GL_DEPTH_FUNC                     0x0B74
+#define GL_STENCIL_CLEAR_VALUE            0x0B91
+#define GL_STENCIL_FUNC                   0x0B92
+#define GL_STENCIL_FAIL                   0x0B94
+#define GL_STENCIL_PASS_DEPTH_FAIL        0x0B95
+#define GL_STENCIL_PASS_DEPTH_PASS        0x0B96
+#define GL_STENCIL_REF                    0x0B97
+#define GL_STENCIL_VALUE_MASK             0x0B93
+#define GL_STENCIL_WRITEMASK              0x0B98
+#define GL_STENCIL_BACK_FUNC              0x8800
+#define GL_STENCIL_BACK_FAIL              0x8801
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL   0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS   0x8803
+#define GL_STENCIL_BACK_REF               0x8CA3
+#define GL_STENCIL_BACK_VALUE_MASK        0x8CA4
+#define GL_STENCIL_BACK_WRITEMASK         0x8CA5
+#define GL_VIEWPORT                       0x0BA2
+#define GL_SCISSOR_BOX                    0x0C10
+#define GL_COLOR_CLEAR_VALUE              0x0C22
+#define GL_COLOR_WRITEMASK                0x0C23
+#define GL_UNPACK_ALIGNMENT               0x0CF5
+#define GL_PACK_ALIGNMENT                 0x0D05
+#define GL_MAX_TEXTURE_SIZE               0x0D33
+#define GL_MAX_VIEWPORT_DIMS              0x0D3A
+#define GL_SUBPIXEL_BITS                  0x0D50
+#define GL_RED_BITS                       0x0D52
+#define GL_GREEN_BITS                     0x0D53
+#define GL_BLUE_BITS                      0x0D54
+#define GL_ALPHA_BITS                     0x0D55
+#define GL_DEPTH_BITS                     0x0D56
+#define GL_STENCIL_BITS                   0x0D57
+#define GL_POLYGON_OFFSET_UNITS           0x2A00
+#define GL_POLYGON_OFFSET_FACTOR          0x8038
+#define GL_TEXTURE_BINDING_2D             0x8069
+#define GL_SAMPLE_BUFFERS                 0x80A8
+#define GL_SAMPLES                        0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE          0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT         0x80AB
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS     0x86A3
+#define GL_DONT_CARE                      0x1100
+#define GL_FASTEST                        0x1101
+#define GL_NICEST                         0x1102
+#define GL_GENERATE_MIPMAP_HINT           0x8192
+#define GL_BYTE                           0x1400
+#define GL_UNSIGNED_BYTE                  0x1401
+#define GL_SHORT                          0x1402
+#define GL_UNSIGNED_SHORT                 0x1403
+#define GL_INT                            0x1404
+#define GL_UNSIGNED_INT                   0x1405
+#define GL_FLOAT                          0x1406
+#define GL_FIXED                          0x140C
+#define GL_DEPTH_COMPONENT                0x1902
+#define GL_ALPHA                          0x1906
+#define GL_RGB                            0x1907
+#define GL_RGBA                           0x1908
+#define GL_LUMINANCE                      0x1909
+#define GL_LUMINANCE_ALPHA                0x190A
+#define GL_UNSIGNED_SHORT_4_4_4_4         0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1         0x8034
+#define GL_UNSIGNED_SHORT_5_6_5           0x8363
+#define GL_FRAGMENT_SHADER                0x8B30
+#define GL_VERTEX_SHADER                  0x8B31
+#define GL_MAX_VERTEX_ATTRIBS             0x8869
+#define GL_MAX_VERTEX_UNIFORM_VECTORS     0x8DFB
+#define GL_MAX_VARYING_VECTORS            0x8DFC
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
+#define GL_MAX_TEXTURE_IMAGE_UNITS        0x8872
+#define GL_MAX_FRAGMENT_UNIFORM_VECTORS   0x8DFD
+#define GL_SHADER_TYPE                    0x8B4F
+#define GL_DELETE_STATUS                  0x8B80
+#define GL_LINK_STATUS                    0x8B82
+#define GL_VALIDATE_STATUS                0x8B83
+#define GL_ATTACHED_SHADERS               0x8B85
+#define GL_ACTIVE_UNIFORMS                0x8B86
+#define GL_ACTIVE_UNIFORM_MAX_LENGTH      0x8B87
+#define GL_ACTIVE_ATTRIBUTES              0x8B89
+#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH    0x8B8A
+#define GL_SHADING_LANGUAGE_VERSION       0x8B8C
+#define GL_CURRENT_PROGRAM                0x8B8D
+#define GL_NEVER                          0x0200
+#define GL_LESS                           0x0201
+#define GL_EQUAL                          0x0202
+#define GL_LEQUAL                         0x0203
+#define GL_GREATER                        0x0204
+#define GL_NOTEQUAL                       0x0205
+#define GL_GEQUAL                         0x0206
+#define GL_ALWAYS                         0x0207
+#define GL_KEEP                           0x1E00
+#define GL_REPLACE                        0x1E01
+#define GL_INCR                           0x1E02
+#define GL_DECR                           0x1E03
+#define GL_INVERT                         0x150A
+#define GL_INCR_WRAP                      0x8507
+#define GL_DECR_WRAP                      0x8508
+#define GL_VENDOR                         0x1F00
+#define GL_RENDERER                       0x1F01
+#define GL_VERSION                        0x1F02
+#define GL_EXTENSIONS                     0x1F03
+#define GL_NEAREST                        0x2600
+#define GL_LINEAR                         0x2601
+#define GL_NEAREST_MIPMAP_NEAREST         0x2700
+#define GL_LINEAR_MIPMAP_NEAREST          0x2701
+#define GL_NEAREST_MIPMAP_LINEAR          0x2702
+#define GL_LINEAR_MIPMAP_LINEAR           0x2703
+#define GL_TEXTURE_MAG_FILTER             0x2800
+#define GL_TEXTURE_MIN_FILTER             0x2801
+#define GL_TEXTURE_WRAP_S                 0x2802
+#define GL_TEXTURE_WRAP_T                 0x2803
+#define GL_TEXTURE                        0x1702
+#define GL_TEXTURE_CUBE_MAP               0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP       0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X    0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X    0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y    0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y    0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z    0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z    0x851A
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE      0x851C
+#define GL_TEXTURE0                       0x84C0
+#define GL_TEXTURE1                       0x84C1
+#define GL_TEXTURE2                       0x84C2
+#define GL_TEXTURE3                       0x84C3
+#define GL_TEXTURE4                       0x84C4
+#define GL_TEXTURE5                       0x84C5
+#define GL_TEXTURE6                       0x84C6
+#define GL_TEXTURE7                       0x84C7
+#define GL_TEXTURE8                       0x84C8
+#define GL_TEXTURE9                       0x84C9
+#define GL_TEXTURE10                      0x84CA
+#define GL_TEXTURE11                      0x84CB
+#define GL_TEXTURE12                      0x84CC
+#define GL_TEXTURE13                      0x84CD
+#define GL_TEXTURE14                      0x84CE
+#define GL_TEXTURE15                      0x84CF
+#define GL_TEXTURE16                      0x84D0
+#define GL_TEXTURE17                      0x84D1
+#define GL_TEXTURE18                      0x84D2
+#define GL_TEXTURE19                      0x84D3
+#define GL_TEXTURE20                      0x84D4
+#define GL_TEXTURE21                      0x84D5
+#define GL_TEXTURE22                      0x84D6
+#define GL_TEXTURE23                      0x84D7
+#define GL_TEXTURE24                      0x84D8
+#define GL_TEXTURE25                      0x84D9
+#define GL_TEXTURE26                      0x84DA
+#define GL_TEXTURE27                      0x84DB
+#define GL_TEXTURE28                      0x84DC
+#define GL_TEXTURE29                      0x84DD
+#define GL_TEXTURE30                      0x84DE
+#define GL_TEXTURE31                      0x84DF
+#define GL_ACTIVE_TEXTURE                 0x84E0
+#define GL_REPEAT                         0x2901
+#define GL_CLAMP_TO_EDGE                  0x812F
+#define GL_MIRRORED_REPEAT                0x8370
+#define GL_FLOAT_VEC2                     0x8B50
+#define GL_FLOAT_VEC3                     0x8B51
+#define GL_FLOAT_VEC4                     0x8B52
+#define GL_INT_VEC2                       0x8B53
+#define GL_INT_VEC3                       0x8B54
+#define GL_INT_VEC4                       0x8B55
+#define GL_BOOL                           0x8B56
+#define GL_BOOL_VEC2                      0x8B57
+#define GL_BOOL_VEC3                      0x8B58
+#define GL_BOOL_VEC4                      0x8B59
+#define GL_FLOAT_MAT2                     0x8B5A
+#define GL_FLOAT_MAT3                     0x8B5B
+#define GL_FLOAT_MAT4                     0x8B5C
+#define GL_SAMPLER_2D                     0x8B5E
+#define GL_SAMPLER_CUBE                   0x8B60
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED    0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE       0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE     0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE       0x8625
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER    0x8645
+#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
+#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
+#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
+#define GL_COMPILE_STATUS                 0x8B81
+#define GL_INFO_LOG_LENGTH                0x8B84
+#define GL_SHADER_SOURCE_LENGTH           0x8B88
+#define GL_SHADER_COMPILER                0x8DFA
+#define GL_SHADER_BINARY_FORMATS          0x8DF8
+#define GL_NUM_SHADER_BINARY_FORMATS      0x8DF9
+#define GL_LOW_FLOAT                      0x8DF0
+#define GL_MEDIUM_FLOAT                   0x8DF1
+#define GL_HIGH_FLOAT                     0x8DF2
+#define GL_LOW_INT                        0x8DF3
+#define GL_MEDIUM_INT                     0x8DF4
+#define GL_HIGH_INT                       0x8DF5
+#define GL_FRAMEBUFFER                    0x8D40
+#define GL_RENDERBUFFER                   0x8D41
+#define GL_RGBA4                          0x8056
+#define GL_RGB5_A1                        0x8057
+#define GL_RGB565                         0x8D62
+#define GL_DEPTH_COMPONENT16              0x81A5
+#define GL_STENCIL_INDEX8                 0x8D48
+#define GL_RENDERBUFFER_WIDTH             0x8D42
+#define GL_RENDERBUFFER_HEIGHT            0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT   0x8D44
+#define GL_RENDERBUFFER_RED_SIZE          0x8D50
+#define GL_RENDERBUFFER_GREEN_SIZE        0x8D51
+#define GL_RENDERBUFFER_BLUE_SIZE         0x8D52
+#define GL_RENDERBUFFER_ALPHA_SIZE        0x8D53
+#define GL_RENDERBUFFER_DEPTH_SIZE        0x8D54
+#define GL_RENDERBUFFER_STENCIL_SIZE      0x8D55
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
+#define GL_COLOR_ATTACHMENT0              0x8CE0
+#define GL_DEPTH_ATTACHMENT               0x8D00
+#define GL_STENCIL_ATTACHMENT             0x8D20
+#define GL_NONE                           0
+#define GL_FRAMEBUFFER_COMPLETE           0x8CD5
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
+#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
+#define GL_FRAMEBUFFER_UNSUPPORTED        0x8CDD
+#define GL_FRAMEBUFFER_BINDING            0x8CA6
+#define GL_RENDERBUFFER_BINDING           0x8CA7
+#define GL_MAX_RENDERBUFFER_SIZE          0x84E8
+#define GL_INVALID_FRAMEBUFFER_OPERATION  0x0506
+typedef void (GL_APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
+typedef void (GL_APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
+typedef void (GL_APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name);
+typedef void (GL_APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
+typedef void (GL_APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer);
+typedef void (GL_APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer);
+typedef void (GL_APIENTRYP PFNGLBINDTEXTUREPROC) (GLenum target, GLuint texture);
+typedef void (GL_APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
+typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);
+typedef void (GL_APIENTRYP PFNGLBLENDFUNCPROC) (GLenum sfactor, GLenum dfactor);
+typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+typedef void (GL_APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
+typedef void (GL_APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
+typedef GLenum (GL_APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);
+typedef void (GL_APIENTRYP PFNGLCLEARPROC) (GLbitfield mask);
+typedef void (GL_APIENTRYP PFNGLCLEARCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+typedef void (GL_APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d);
+typedef void (GL_APIENTRYP PFNGLCLEARSTENCILPROC) (GLint s);
+typedef void (GL_APIENTRYP PFNGLCOLORMASKPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+typedef void (GL_APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);
+typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
+typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
+typedef void (GL_APIENTRYP PFNGLCOPYTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef GLuint (GL_APIENTRYP PFNGLCREATEPROGRAMPROC) (void);
+typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);
+typedef void (GL_APIENTRYP PFNGLCULLFACEPROC) (GLenum mode);
+typedef void (GL_APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
+typedef void (GL_APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers);
+typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);
+typedef void (GL_APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers);
+typedef void (GL_APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);
+typedef void (GL_APIENTRYP PFNGLDELETETEXTURESPROC) (GLsizei n, const GLuint *textures);
+typedef void (GL_APIENTRYP PFNGLDEPTHFUNCPROC) (GLenum func);
+typedef void (GL_APIENTRYP PFNGLDEPTHMASKPROC) (GLboolean flag);
+typedef void (GL_APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f);
+typedef void (GL_APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
+typedef void (GL_APIENTRYP PFNGLDISABLEPROC) (GLenum cap);
+typedef void (GL_APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+typedef void (GL_APIENTRYP PFNGLDRAWARRAYSPROC) (GLenum mode, GLint first, GLsizei count);
+typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices);
+typedef void (GL_APIENTRYP PFNGLENABLEPROC) (GLenum cap);
+typedef void (GL_APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+typedef void (GL_APIENTRYP PFNGLFINISHPROC) (void);
+typedef void (GL_APIENTRYP PFNGLFLUSHPROC) (void);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (GL_APIENTRYP PFNGLFRONTFACEPROC) (GLenum mode);
+typedef void (GL_APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
+typedef void (GL_APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target);
+typedef void (GL_APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers);
+typedef void (GL_APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers);
+typedef void (GL_APIENTRYP PFNGLGENTEXTURESPROC) (GLsizei n, GLuint *textures);
+typedef void (GL_APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+typedef void (GL_APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
+typedef GLint (GL_APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (GL_APIENTRYP PFNGLGETBOOLEANVPROC) (GLenum pname, GLboolean *data);
+typedef void (GL_APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef GLenum (GL_APIENTRYP PFNGLGETERRORPROC) (void);
+typedef void (GL_APIENTRYP PFNGLGETFLOATVPROC) (GLenum pname, GLfloat *data);
+typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETINTEGERVPROC) (GLenum pname, GLint *data);
+typedef void (GL_APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (GL_APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (GL_APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
+typedef void (GL_APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+typedef const GLubyte *(GL_APIENTRYP PFNGLGETSTRINGPROC) (GLenum name);
+typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params);
+typedef GLint (GL_APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void **pointer);
+typedef void (GL_APIENTRYP PFNGLHINTPROC) (GLenum target, GLenum mode);
+typedef GLboolean (GL_APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer);
+typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDPROC) (GLenum cap);
+typedef GLboolean (GL_APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer);
+typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPROC) (GLuint program);
+typedef GLboolean (GL_APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer);
+typedef GLboolean (GL_APIENTRYP PFNGLISSHADERPROC) (GLuint shader);
+typedef GLboolean (GL_APIENTRYP PFNGLISTEXTUREPROC) (GLuint texture);
+typedef void (GL_APIENTRYP PFNGLLINEWIDTHPROC) (GLfloat width);
+typedef void (GL_APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
+typedef void (GL_APIENTRYP PFNGLPIXELSTOREIPROC) (GLenum pname, GLint param);
+typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETPROC) (GLfloat factor, GLfloat units);
+typedef void (GL_APIENTRYP PFNGLREADPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
+typedef void (GL_APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void);
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert);
+typedef void (GL_APIENTRYP PFNGLSCISSORPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length);
+typedef void (GL_APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
+typedef void (GL_APIENTRYP PFNGLSTENCILFUNCPROC) (GLenum func, GLint ref, GLuint mask);
+typedef void (GL_APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask);
+typedef void (GL_APIENTRYP PFNGLSTENCILMASKPROC) (GLuint mask);
+typedef void (GL_APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask);
+typedef void (GL_APIENTRYP PFNGLSTENCILOPPROC) (GLenum fail, GLenum zfail, GLenum zpass);
+typedef void (GL_APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+typedef void (GL_APIENTRYP PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
+typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat param);
+typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
+typedef void (GL_APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
+typedef void (GL_APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
+typedef void (GL_APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
+typedef void (GL_APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
+typedef void (GL_APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (GL_APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (GL_APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (GL_APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (GL_APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
+typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
+typedef void (GL_APIENTRYP PFNGLVIEWPORTPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
+#if GL_GLES_PROTOTYPES
+GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
+GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
+GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name);
+GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
+GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
+GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
+GL_APICALL void GL_APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+GL_APICALL void GL_APIENTRY glBlendEquation (GLenum mode);
+GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
+GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
+GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
+GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
+GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
+GL_APICALL void GL_APIENTRY glClear (GLbitfield mask);
+GL_APICALL void GL_APIENTRY glClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+GL_APICALL void GL_APIENTRY glClearDepthf (GLfloat d);
+GL_APICALL void GL_APIENTRY glClearStencil (GLint s);
+GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
+GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
+GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
+GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
+GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type);
+GL_APICALL void GL_APIENTRY glCullFace (GLenum mode);
+GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
+GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers);
+GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers);
+GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader);
+GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
+GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func);
+GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag);
+GL_APICALL void GL_APIENTRY glDepthRangef (GLfloat n, GLfloat f);
+GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
+GL_APICALL void GL_APIENTRY glDisable (GLenum cap);
+GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index);
+GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
+GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices);
+GL_APICALL void GL_APIENTRY glEnable (GLenum cap);
+GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index);
+GL_APICALL void GL_APIENTRY glFinish (void);
+GL_APICALL void GL_APIENTRY glFlush (void);
+GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode);
+GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
+GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target);
+GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers);
+GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers);
+GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures);
+GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
+GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar *name);
+GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *data);
+GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_APICALL GLenum GL_APIENTRY glGetError (void);
+GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *data);
+GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *data);
+GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
+GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+GL_APICALL const GLubyte *GL_APIENTRY glGetString (GLenum name);
+GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params);
+GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar *name);
+GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer);
+GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode);
+GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
+GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
+GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
+GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program);
+GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
+GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader);
+GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture);
+GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width);
+GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
+GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
+GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
+GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert);
+GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length);
+GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
+GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
+GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
+GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
+GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
+GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
+GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
+GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat v0);
+GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint v0);
+GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1);
+GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint v0, GLint v1);
+GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2);
+GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUseProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint index, GLfloat x);
+GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y);
+GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
+GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
+#endif
+#endif /* GL_ES_VERSION_2_0 */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/system/include/GLES2/gl2ext.h b/system/include/GLES2/gl2ext.h
new file mode 100644
index 0000000..3b8c2fd
--- /dev/null
+++ b/system/include/GLES2/gl2ext.h
@@ -0,0 +1,3985 @@
+#ifndef __gles2_gl2ext_h_
+#define __gles2_gl2ext_h_ 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** Copyright 2013-2020 The Khronos Group Inc.
+** SPDX-License-Identifier: MIT
+**
+** This header is generated from the Khronos OpenGL / OpenGL ES XML
+** API Registry. The current version of the Registry, generator scripts
+** used to make the header, and the header can be found at
+**   https://github.com/KhronosGroup/OpenGL-Registry
+*/
+
+#ifndef GL_APIENTRYP
+#define GL_APIENTRYP GL_APIENTRY*
+#endif
+
+/* Generated on date 20211115 */
+
+/* Generated C header for:
+ * API: gles2
+ * Profile: common
+ * Versions considered: 2\.[0-9]
+ * Versions emitted: _nomatch_^
+ * Default extensions included: gles2
+ * Additional extensions included: _nomatch_^
+ * Extensions removed: _nomatch_^
+ */
+
+#ifndef GL_KHR_blend_equation_advanced
+#define GL_KHR_blend_equation_advanced 1
+#define GL_MULTIPLY_KHR                   0x9294
+#define GL_SCREEN_KHR                     0x9295
+#define GL_OVERLAY_KHR                    0x9296
+#define GL_DARKEN_KHR                     0x9297
+#define GL_LIGHTEN_KHR                    0x9298
+#define GL_COLORDODGE_KHR                 0x9299
+#define GL_COLORBURN_KHR                  0x929A
+#define GL_HARDLIGHT_KHR                  0x929B
+#define GL_SOFTLIGHT_KHR                  0x929C
+#define GL_DIFFERENCE_KHR                 0x929E
+#define GL_EXCLUSION_KHR                  0x92A0
+#define GL_HSL_HUE_KHR                    0x92AD
+#define GL_HSL_SATURATION_KHR             0x92AE
+#define GL_HSL_COLOR_KHR                  0x92AF
+#define GL_HSL_LUMINOSITY_KHR             0x92B0
+typedef void (GL_APIENTRYP PFNGLBLENDBARRIERKHRPROC) (void);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glBlendBarrierKHR (void);
+#endif
+#endif /* GL_KHR_blend_equation_advanced */
+
+#ifndef GL_KHR_blend_equation_advanced_coherent
+#define GL_KHR_blend_equation_advanced_coherent 1
+#define GL_BLEND_ADVANCED_COHERENT_KHR    0x9285
+#endif /* GL_KHR_blend_equation_advanced_coherent */
+
+#ifndef GL_KHR_context_flush_control
+#define GL_KHR_context_flush_control 1
+#define GL_CONTEXT_RELEASE_BEHAVIOR_KHR   0x82FB
+#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR 0x82FC
+#endif /* GL_KHR_context_flush_control */
+
+#ifndef GL_KHR_debug
+#define GL_KHR_debug 1
+typedef void (GL_APIENTRY  *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
+#define GL_SAMPLER                        0x82E6
+#define GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR   0x8242
+#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_KHR 0x8243
+#define GL_DEBUG_CALLBACK_FUNCTION_KHR    0x8244
+#define GL_DEBUG_CALLBACK_USER_PARAM_KHR  0x8245
+#define GL_DEBUG_SOURCE_API_KHR           0x8246
+#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_KHR 0x8247
+#define GL_DEBUG_SOURCE_SHADER_COMPILER_KHR 0x8248
+#define GL_DEBUG_SOURCE_THIRD_PARTY_KHR   0x8249
+#define GL_DEBUG_SOURCE_APPLICATION_KHR   0x824A
+#define GL_DEBUG_SOURCE_OTHER_KHR         0x824B
+#define GL_DEBUG_TYPE_ERROR_KHR           0x824C
+#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR 0x824D
+#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR 0x824E
+#define GL_DEBUG_TYPE_PORTABILITY_KHR     0x824F
+#define GL_DEBUG_TYPE_PERFORMANCE_KHR     0x8250
+#define GL_DEBUG_TYPE_OTHER_KHR           0x8251
+#define GL_DEBUG_TYPE_MARKER_KHR          0x8268
+#define GL_DEBUG_TYPE_PUSH_GROUP_KHR      0x8269
+#define GL_DEBUG_TYPE_POP_GROUP_KHR       0x826A
+#define GL_DEBUG_SEVERITY_NOTIFICATION_KHR 0x826B
+#define GL_MAX_DEBUG_GROUP_STACK_DEPTH_KHR 0x826C
+#define GL_DEBUG_GROUP_STACK_DEPTH_KHR    0x826D
+#define GL_BUFFER_KHR                     0x82E0
+#define GL_SHADER_KHR                     0x82E1
+#define GL_PROGRAM_KHR                    0x82E2
+#define GL_VERTEX_ARRAY_KHR               0x8074
+#define GL_QUERY_KHR                      0x82E3
+#define GL_PROGRAM_PIPELINE_KHR           0x82E4
+#define GL_SAMPLER_KHR                    0x82E6
+#define GL_MAX_LABEL_LENGTH_KHR           0x82E8
+#define GL_MAX_DEBUG_MESSAGE_LENGTH_KHR   0x9143
+#define GL_MAX_DEBUG_LOGGED_MESSAGES_KHR  0x9144
+#define GL_DEBUG_LOGGED_MESSAGES_KHR      0x9145
+#define GL_DEBUG_SEVERITY_HIGH_KHR        0x9146
+#define GL_DEBUG_SEVERITY_MEDIUM_KHR      0x9147
+#define GL_DEBUG_SEVERITY_LOW_KHR         0x9148
+#define GL_DEBUG_OUTPUT_KHR               0x92E0
+#define GL_CONTEXT_FLAG_DEBUG_BIT_KHR     0x00000002
+#define GL_STACK_OVERFLOW_KHR             0x0503
+#define GL_STACK_UNDERFLOW_KHR            0x0504
+typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECONTROLKHRPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
+typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGEINSERTKHRPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
+typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECALLBACKKHRPROC) (GLDEBUGPROCKHR callback, const void *userParam);
+typedef GLuint (GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGKHRPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
+typedef void (GL_APIENTRYP PFNGLPUSHDEBUGGROUPKHRPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message);
+typedef void (GL_APIENTRYP PFNGLPOPDEBUGGROUPKHRPROC) (void);
+typedef void (GL_APIENTRYP PFNGLOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
+typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);
+typedef void (GL_APIENTRYP PFNGLOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei length, const GLchar *label);
+typedef void (GL_APIENTRYP PFNGLGETOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);
+typedef void (GL_APIENTRYP PFNGLGETPOINTERVKHRPROC) (GLenum pname, void **params);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDebugMessageControlKHR (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
+GL_APICALL void GL_APIENTRY glDebugMessageInsertKHR (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
+GL_APICALL void GL_APIENTRY glDebugMessageCallbackKHR (GLDEBUGPROCKHR callback, const void *userParam);
+GL_APICALL GLuint GL_APIENTRY glGetDebugMessageLogKHR (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
+GL_APICALL void GL_APIENTRY glPushDebugGroupKHR (GLenum source, GLuint id, GLsizei length, const GLchar *message);
+GL_APICALL void GL_APIENTRY glPopDebugGroupKHR (void);
+GL_APICALL void GL_APIENTRY glObjectLabelKHR (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
+GL_APICALL void GL_APIENTRY glGetObjectLabelKHR (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);
+GL_APICALL void GL_APIENTRY glObjectPtrLabelKHR (const void *ptr, GLsizei length, const GLchar *label);
+GL_APICALL void GL_APIENTRY glGetObjectPtrLabelKHR (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);
+GL_APICALL void GL_APIENTRY glGetPointervKHR (GLenum pname, void **params);
+#endif
+#endif /* GL_KHR_debug */
+
+#ifndef GL_KHR_no_error
+#define GL_KHR_no_error 1
+#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR  0x00000008
+#endif /* GL_KHR_no_error */
+
+#ifndef GL_KHR_parallel_shader_compile
+#define GL_KHR_parallel_shader_compile 1
+#define GL_MAX_SHADER_COMPILER_THREADS_KHR 0x91B0
+#define GL_COMPLETION_STATUS_KHR          0x91B1
+typedef void (GL_APIENTRYP PFNGLMAXSHADERCOMPILERTHREADSKHRPROC) (GLuint count);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glMaxShaderCompilerThreadsKHR (GLuint count);
+#endif
+#endif /* GL_KHR_parallel_shader_compile */
+
+#ifndef GL_KHR_robust_buffer_access_behavior
+#define GL_KHR_robust_buffer_access_behavior 1
+#endif /* GL_KHR_robust_buffer_access_behavior */
+
+#ifndef GL_KHR_robustness
+#define GL_KHR_robustness 1
+#define GL_CONTEXT_ROBUST_ACCESS_KHR      0x90F3
+#define GL_LOSE_CONTEXT_ON_RESET_KHR      0x8252
+#define GL_GUILTY_CONTEXT_RESET_KHR       0x8253
+#define GL_INNOCENT_CONTEXT_RESET_KHR     0x8254
+#define GL_UNKNOWN_CONTEXT_RESET_KHR      0x8255
+#define GL_RESET_NOTIFICATION_STRATEGY_KHR 0x8256
+#define GL_NO_RESET_NOTIFICATION_KHR      0x8261
+#define GL_CONTEXT_LOST_KHR               0x0507
+typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSKHRPROC) (void);
+typedef void (GL_APIENTRYP PFNGLREADNPIXELSKHRPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVKHRPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVKHRPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETNUNIFORMUIVKHRPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusKHR (void);
+GL_APICALL void GL_APIENTRY glReadnPixelsKHR (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+GL_APICALL void GL_APIENTRY glGetnUniformfvKHR (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetnUniformivKHR (GLuint program, GLint location, GLsizei bufSize, GLint *params);
+GL_APICALL void GL_APIENTRY glGetnUniformuivKHR (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
+#endif
+#endif /* GL_KHR_robustness */
+
+#ifndef GL_KHR_shader_subgroup
+#define GL_KHR_shader_subgroup 1
+#define GL_SUBGROUP_SIZE_KHR              0x9532
+#define GL_SUBGROUP_SUPPORTED_STAGES_KHR  0x9533
+#define GL_SUBGROUP_SUPPORTED_FEATURES_KHR 0x9534
+#define GL_SUBGROUP_QUAD_ALL_STAGES_KHR   0x9535
+#define GL_SUBGROUP_FEATURE_BASIC_BIT_KHR 0x00000001
+#define GL_SUBGROUP_FEATURE_VOTE_BIT_KHR  0x00000002
+#define GL_SUBGROUP_FEATURE_ARITHMETIC_BIT_KHR 0x00000004
+#define GL_SUBGROUP_FEATURE_BALLOT_BIT_KHR 0x00000008
+#define GL_SUBGROUP_FEATURE_SHUFFLE_BIT_KHR 0x00000010
+#define GL_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT_KHR 0x00000020
+#define GL_SUBGROUP_FEATURE_CLUSTERED_BIT_KHR 0x00000040
+#define GL_SUBGROUP_FEATURE_QUAD_BIT_KHR  0x00000080
+#endif /* GL_KHR_shader_subgroup */
+
+#ifndef GL_KHR_texture_compression_astc_hdr
+#define GL_KHR_texture_compression_astc_hdr 1
+#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR   0x93B0
+#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR   0x93B1
+#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR   0x93B2
+#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR   0x93B3
+#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR   0x93B4
+#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR   0x93B5
+#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR   0x93B6
+#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR   0x93B7
+#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR  0x93B8
+#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR  0x93B9
+#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR  0x93BA
+#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB
+#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC
+#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD
+#endif /* GL_KHR_texture_compression_astc_hdr */
+
+#ifndef GL_KHR_texture_compression_astc_ldr
+#define GL_KHR_texture_compression_astc_ldr 1
+#endif /* GL_KHR_texture_compression_astc_ldr */
+
+#ifndef GL_KHR_texture_compression_astc_sliced_3d
+#define GL_KHR_texture_compression_astc_sliced_3d 1
+#endif /* GL_KHR_texture_compression_astc_sliced_3d */
+
+#ifndef GL_OES_EGL_image
+#define GL_OES_EGL_image 1
+typedef void *GLeglImageOES;
+typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
+typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image);
+GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image);
+#endif
+#endif /* GL_OES_EGL_image */
+
+#ifndef GL_OES_EGL_image_external
+#define GL_OES_EGL_image_external 1
+#define GL_TEXTURE_EXTERNAL_OES           0x8D65
+#define GL_TEXTURE_BINDING_EXTERNAL_OES   0x8D67
+#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68
+#define GL_SAMPLER_EXTERNAL_OES           0x8D66
+#endif /* GL_OES_EGL_image_external */
+
+#ifndef GL_OES_EGL_image_external_essl3
+#define GL_OES_EGL_image_external_essl3 1
+#endif /* GL_OES_EGL_image_external_essl3 */
+
+#ifndef GL_OES_compressed_ETC1_RGB8_sub_texture
+#define GL_OES_compressed_ETC1_RGB8_sub_texture 1
+#endif /* GL_OES_compressed_ETC1_RGB8_sub_texture */
+
+#ifndef GL_OES_compressed_ETC1_RGB8_texture
+#define GL_OES_compressed_ETC1_RGB8_texture 1
+#define GL_ETC1_RGB8_OES                  0x8D64
+#endif /* GL_OES_compressed_ETC1_RGB8_texture */
+
+#ifndef GL_OES_compressed_paletted_texture
+#define GL_OES_compressed_paletted_texture 1
+#define GL_PALETTE4_RGB8_OES              0x8B90
+#define GL_PALETTE4_RGBA8_OES             0x8B91
+#define GL_PALETTE4_R5_G6_B5_OES          0x8B92
+#define GL_PALETTE4_RGBA4_OES             0x8B93
+#define GL_PALETTE4_RGB5_A1_OES           0x8B94
+#define GL_PALETTE8_RGB8_OES              0x8B95
+#define GL_PALETTE8_RGBA8_OES             0x8B96
+#define GL_PALETTE8_R5_G6_B5_OES          0x8B97
+#define GL_PALETTE8_RGBA4_OES             0x8B98
+#define GL_PALETTE8_RGB5_A1_OES           0x8B99
+#endif /* GL_OES_compressed_paletted_texture */
+
+#ifndef GL_OES_copy_image
+#define GL_OES_copy_image 1
+typedef void (GL_APIENTRYP PFNGLCOPYIMAGESUBDATAOESPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glCopyImageSubDataOES (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
+#endif
+#endif /* GL_OES_copy_image */
+
+#ifndef GL_OES_depth24
+#define GL_OES_depth24 1
+#define GL_DEPTH_COMPONENT24_OES          0x81A6
+#endif /* GL_OES_depth24 */
+
+#ifndef GL_OES_depth32
+#define GL_OES_depth32 1
+#define GL_DEPTH_COMPONENT32_OES          0x81A7
+#endif /* GL_OES_depth32 */
+
+#ifndef GL_OES_depth_texture
+#define GL_OES_depth_texture 1
+#endif /* GL_OES_depth_texture */
+
+#ifndef GL_OES_draw_buffers_indexed
+#define GL_OES_draw_buffers_indexed 1
+#define GL_MIN                            0x8007
+#define GL_MAX                            0x8008
+typedef void (GL_APIENTRYP PFNGLENABLEIOESPROC) (GLenum target, GLuint index);
+typedef void (GL_APIENTRYP PFNGLDISABLEIOESPROC) (GLenum target, GLuint index);
+typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONIOESPROC) (GLuint buf, GLenum mode);
+typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEIOESPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+typedef void (GL_APIENTRYP PFNGLBLENDFUNCIOESPROC) (GLuint buf, GLenum src, GLenum dst);
+typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEIOESPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+typedef void (GL_APIENTRYP PFNGLCOLORMASKIOESPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDIOESPROC) (GLenum target, GLuint index);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glEnableiOES (GLenum target, GLuint index);
+GL_APICALL void GL_APIENTRY glDisableiOES (GLenum target, GLuint index);
+GL_APICALL void GL_APIENTRY glBlendEquationiOES (GLuint buf, GLenum mode);
+GL_APICALL void GL_APIENTRY glBlendEquationSeparateiOES (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+GL_APICALL void GL_APIENTRY glBlendFunciOES (GLuint buf, GLenum src, GLenum dst);
+GL_APICALL void GL_APIENTRY glBlendFuncSeparateiOES (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+GL_APICALL void GL_APIENTRY glColorMaskiOES (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+GL_APICALL GLboolean GL_APIENTRY glIsEnablediOES (GLenum target, GLuint index);
+#endif
+#endif /* GL_OES_draw_buffers_indexed */
+
+#ifndef GL_OES_draw_elements_base_vertex
+#define GL_OES_draw_elements_base_vertex 1
+typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXOESPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
+typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXOESPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
+typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXOESPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
+typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDrawElementsBaseVertexOES (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
+GL_APICALL void GL_APIENTRY glDrawRangeElementsBaseVertexOES (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
+GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexOES (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
+GL_APICALL void GL_APIENTRY glMultiDrawElementsBaseVertexEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex);
+#endif
+#endif /* GL_OES_draw_elements_base_vertex */
+
+#ifndef GL_OES_element_index_uint
+#define GL_OES_element_index_uint 1
+#endif /* GL_OES_element_index_uint */
+
+#ifndef GL_OES_fbo_render_mipmap
+#define GL_OES_fbo_render_mipmap 1
+#endif /* GL_OES_fbo_render_mipmap */
+
+#ifndef GL_OES_fragment_precision_high
+#define GL_OES_fragment_precision_high 1
+#endif /* GL_OES_fragment_precision_high */
+
+#ifndef GL_OES_geometry_point_size
+#define GL_OES_geometry_point_size 1
+#endif /* GL_OES_geometry_point_size */
+
+#ifndef GL_OES_geometry_shader
+#define GL_OES_geometry_shader 1
+#define GL_GEOMETRY_SHADER_OES            0x8DD9
+#define GL_GEOMETRY_SHADER_BIT_OES        0x00000004
+#define GL_GEOMETRY_LINKED_VERTICES_OUT_OES 0x8916
+#define GL_GEOMETRY_LINKED_INPUT_TYPE_OES 0x8917
+#define GL_GEOMETRY_LINKED_OUTPUT_TYPE_OES 0x8918
+#define GL_GEOMETRY_SHADER_INVOCATIONS_OES 0x887F
+#define GL_LAYER_PROVOKING_VERTEX_OES     0x825E
+#define GL_LINES_ADJACENCY_OES            0x000A
+#define GL_LINE_STRIP_ADJACENCY_OES       0x000B
+#define GL_TRIANGLES_ADJACENCY_OES        0x000C
+#define GL_TRIANGLE_STRIP_ADJACENCY_OES   0x000D
+#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_OES 0x8DDF
+#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS_OES 0x8A2C
+#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_OES 0x8A32
+#define GL_MAX_GEOMETRY_INPUT_COMPONENTS_OES 0x9123
+#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_OES 0x9124
+#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_OES 0x8DE0
+#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_OES 0x8DE1
+#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS_OES 0x8E5A
+#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_OES 0x8C29
+#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_OES 0x92CF
+#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS_OES 0x92D5
+#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS_OES 0x90CD
+#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_OES 0x90D7
+#define GL_FIRST_VERTEX_CONVENTION_OES    0x8E4D
+#define GL_LAST_VERTEX_CONVENTION_OES     0x8E4E
+#define GL_UNDEFINED_VERTEX_OES           0x8260
+#define GL_PRIMITIVES_GENERATED_OES       0x8C87
+#define GL_FRAMEBUFFER_DEFAULT_LAYERS_OES 0x9312
+#define GL_MAX_FRAMEBUFFER_LAYERS_OES     0x9317
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_OES 0x8DA8
+#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_OES 0x8DA7
+#define GL_REFERENCED_BY_GEOMETRY_SHADER_OES 0x9309
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREOESPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glFramebufferTextureOES (GLenum target, GLenum attachment, GLuint texture, GLint level);
+#endif
+#endif /* GL_OES_geometry_shader */
+
+#ifndef GL_OES_get_program_binary
+#define GL_OES_get_program_binary 1
+#define GL_PROGRAM_BINARY_LENGTH_OES      0x8741
+#define GL_NUM_PROGRAM_BINARY_FORMATS_OES 0x87FE
+#define GL_PROGRAM_BINARY_FORMATS_OES     0x87FF
+typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYOESPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
+typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLint length);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glGetProgramBinaryOES (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
+GL_APICALL void GL_APIENTRY glProgramBinaryOES (GLuint program, GLenum binaryFormat, const void *binary, GLint length);
+#endif
+#endif /* GL_OES_get_program_binary */
+
+#ifndef GL_OES_gpu_shader5
+#define GL_OES_gpu_shader5 1
+#endif /* GL_OES_gpu_shader5 */
+
+#ifndef GL_OES_mapbuffer
+#define GL_OES_mapbuffer 1
+#define GL_WRITE_ONLY_OES                 0x88B9
+#define GL_BUFFER_ACCESS_OES              0x88BB
+#define GL_BUFFER_MAPPED_OES              0x88BC
+#define GL_BUFFER_MAP_POINTER_OES         0x88BD
+typedef void *(GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access);
+typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target);
+typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, void **params);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void *GL_APIENTRY glMapBufferOES (GLenum target, GLenum access);
+GL_APICALL GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target);
+GL_APICALL void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, void **params);
+#endif
+#endif /* GL_OES_mapbuffer */
+
+#ifndef GL_OES_packed_depth_stencil
+#define GL_OES_packed_depth_stencil 1
+#define GL_DEPTH_STENCIL_OES              0x84F9
+#define GL_UNSIGNED_INT_24_8_OES          0x84FA
+#define GL_DEPTH24_STENCIL8_OES           0x88F0
+#endif /* GL_OES_packed_depth_stencil */
+
+#ifndef GL_OES_primitive_bounding_box
+#define GL_OES_primitive_bounding_box 1
+#define GL_PRIMITIVE_BOUNDING_BOX_OES     0x92BE
+typedef void (GL_APIENTRYP PFNGLPRIMITIVEBOUNDINGBOXOESPROC) (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glPrimitiveBoundingBoxOES (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW);
+#endif
+#endif /* GL_OES_primitive_bounding_box */
+
+#ifndef GL_OES_required_internalformat
+#define GL_OES_required_internalformat 1
+#define GL_ALPHA8_OES                     0x803C
+#define GL_DEPTH_COMPONENT16_OES          0x81A5
+#define GL_LUMINANCE4_ALPHA4_OES          0x8043
+#define GL_LUMINANCE8_ALPHA8_OES          0x8045
+#define GL_LUMINANCE8_OES                 0x8040
+#define GL_RGBA4_OES                      0x8056
+#define GL_RGB5_A1_OES                    0x8057
+#define GL_RGB565_OES                     0x8D62
+#define GL_RGB8_OES                       0x8051
+#define GL_RGBA8_OES                      0x8058
+#define GL_RGB10_EXT                      0x8052
+#define GL_RGB10_A2_EXT                   0x8059
+#endif /* GL_OES_required_internalformat */
+
+#ifndef GL_OES_rgb8_rgba8
+#define GL_OES_rgb8_rgba8 1
+#endif /* GL_OES_rgb8_rgba8 */
+
+#ifndef GL_OES_sample_shading
+#define GL_OES_sample_shading 1
+#define GL_SAMPLE_SHADING_OES             0x8C36
+#define GL_MIN_SAMPLE_SHADING_VALUE_OES   0x8C37
+typedef void (GL_APIENTRYP PFNGLMINSAMPLESHADINGOESPROC) (GLfloat value);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glMinSampleShadingOES (GLfloat value);
+#endif
+#endif /* GL_OES_sample_shading */
+
+#ifndef GL_OES_sample_variables
+#define GL_OES_sample_variables 1
+#endif /* GL_OES_sample_variables */
+
+#ifndef GL_OES_shader_image_atomic
+#define GL_OES_shader_image_atomic 1
+#endif /* GL_OES_shader_image_atomic */
+
+#ifndef GL_OES_shader_io_blocks
+#define GL_OES_shader_io_blocks 1
+#endif /* GL_OES_shader_io_blocks */
+
+#ifndef GL_OES_shader_multisample_interpolation
+#define GL_OES_shader_multisample_interpolation 1
+#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_OES 0x8E5B
+#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_OES 0x8E5C
+#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS_OES 0x8E5D
+#endif /* GL_OES_shader_multisample_interpolation */
+
+#ifndef GL_OES_standard_derivatives
+#define GL_OES_standard_derivatives 1
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES 0x8B8B
+#endif /* GL_OES_standard_derivatives */
+
+#ifndef GL_OES_stencil1
+#define GL_OES_stencil1 1
+#define GL_STENCIL_INDEX1_OES             0x8D46
+#endif /* GL_OES_stencil1 */
+
+#ifndef GL_OES_stencil4
+#define GL_OES_stencil4 1
+#define GL_STENCIL_INDEX4_OES             0x8D47
+#endif /* GL_OES_stencil4 */
+
+#ifndef GL_OES_surfaceless_context
+#define GL_OES_surfaceless_context 1
+#define GL_FRAMEBUFFER_UNDEFINED_OES      0x8219
+#endif /* GL_OES_surfaceless_context */
+
+#ifndef GL_OES_tessellation_point_size
+#define GL_OES_tessellation_point_size 1
+#endif /* GL_OES_tessellation_point_size */
+
+#ifndef GL_OES_tessellation_shader
+#define GL_OES_tessellation_shader 1
+#define GL_PATCHES_OES                    0x000E
+#define GL_PATCH_VERTICES_OES             0x8E72
+#define GL_TESS_CONTROL_OUTPUT_VERTICES_OES 0x8E75
+#define GL_TESS_GEN_MODE_OES              0x8E76
+#define GL_TESS_GEN_SPACING_OES           0x8E77
+#define GL_TESS_GEN_VERTEX_ORDER_OES      0x8E78
+#define GL_TESS_GEN_POINT_MODE_OES        0x8E79
+#define GL_ISOLINES_OES                   0x8E7A
+#define GL_QUADS_OES                      0x0007
+#define GL_FRACTIONAL_ODD_OES             0x8E7B
+#define GL_FRACTIONAL_EVEN_OES            0x8E7C
+#define GL_MAX_PATCH_VERTICES_OES         0x8E7D
+#define GL_MAX_TESS_GEN_LEVEL_OES         0x8E7E
+#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS_OES 0x8E7F
+#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS_OES 0x8E80
+#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS_OES 0x8E81
+#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS_OES 0x8E82
+#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS_OES 0x8E83
+#define GL_MAX_TESS_PATCH_COMPONENTS_OES  0x8E84
+#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS_OES 0x8E85
+#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS_OES 0x8E86
+#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS_OES 0x8E89
+#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS_OES 0x8E8A
+#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS_OES 0x886C
+#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS_OES 0x886D
+#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS_OES 0x8E1E
+#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS_OES 0x8E1F
+#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS_OES 0x92CD
+#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS_OES 0x92CE
+#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS_OES 0x92D3
+#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS_OES 0x92D4
+#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS_OES 0x90CB
+#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS_OES 0x90CC
+#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS_OES 0x90D8
+#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS_OES 0x90D9
+#define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED_OES 0x8221
+#define GL_IS_PER_PATCH_OES               0x92E7
+#define GL_REFERENCED_BY_TESS_CONTROL_SHADER_OES 0x9307
+#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER_OES 0x9308
+#define GL_TESS_CONTROL_SHADER_OES        0x8E88
+#define GL_TESS_EVALUATION_SHADER_OES     0x8E87
+#define GL_TESS_CONTROL_SHADER_BIT_OES    0x00000008
+#define GL_TESS_EVALUATION_SHADER_BIT_OES 0x00000010
+typedef void (GL_APIENTRYP PFNGLPATCHPARAMETERIOESPROC) (GLenum pname, GLint value);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glPatchParameteriOES (GLenum pname, GLint value);
+#endif
+#endif /* GL_OES_tessellation_shader */
+
+#ifndef GL_OES_texture_3D
+#define GL_OES_texture_3D 1
+#define GL_TEXTURE_WRAP_R_OES             0x8072
+#define GL_TEXTURE_3D_OES                 0x806F
+#define GL_TEXTURE_BINDING_3D_OES         0x806A
+#define GL_MAX_3D_TEXTURE_SIZE_OES        0x8073
+#define GL_SAMPLER_3D_OES                 0x8B5F
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES 0x8CD4
+typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
+typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
+typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
+typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOESPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
+GL_APICALL void GL_APIENTRY glTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
+GL_APICALL void GL_APIENTRY glCopyTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glCompressedTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
+GL_APICALL void GL_APIENTRY glCompressedTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
+GL_APICALL void GL_APIENTRY glFramebufferTexture3DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+#endif
+#endif /* GL_OES_texture_3D */
+
+#ifndef GL_OES_texture_border_clamp
+#define GL_OES_texture_border_clamp 1
+#define GL_TEXTURE_BORDER_COLOR_OES       0x1004
+#define GL_CLAMP_TO_BORDER_OES            0x812D
+typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIIVOESPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIUIVOESPROC) (GLenum target, GLenum pname, const GLuint *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIIVOESPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIUIVOESPROC) (GLenum target, GLenum pname, GLuint *params);
+typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIIVOESPROC) (GLuint sampler, GLenum pname, const GLint *param);
+typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIUIVOESPROC) (GLuint sampler, GLenum pname, const GLuint *param);
+typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIIVOESPROC) (GLuint sampler, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVOESPROC) (GLuint sampler, GLenum pname, GLuint *params);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glTexParameterIivOES (GLenum target, GLenum pname, const GLint *params);
+GL_APICALL void GL_APIENTRY glTexParameterIuivOES (GLenum target, GLenum pname, const GLuint *params);
+GL_APICALL void GL_APIENTRY glGetTexParameterIivOES (GLenum target, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetTexParameterIuivOES (GLenum target, GLenum pname, GLuint *params);
+GL_APICALL void GL_APIENTRY glSamplerParameterIivOES (GLuint sampler, GLenum pname, const GLint *param);
+GL_APICALL void GL_APIENTRY glSamplerParameterIuivOES (GLuint sampler, GLenum pname, const GLuint *param);
+GL_APICALL void GL_APIENTRY glGetSamplerParameterIivOES (GLuint sampler, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetSamplerParameterIuivOES (GLuint sampler, GLenum pname, GLuint *params);
+#endif
+#endif /* GL_OES_texture_border_clamp */
+
+#ifndef GL_OES_texture_buffer
+#define GL_OES_texture_buffer 1
+#define GL_TEXTURE_BUFFER_OES             0x8C2A
+#define GL_TEXTURE_BUFFER_BINDING_OES     0x8C2A
+#define GL_MAX_TEXTURE_BUFFER_SIZE_OES    0x8C2B
+#define GL_TEXTURE_BINDING_BUFFER_OES     0x8C2C
+#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_OES 0x8C2D
+#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT_OES 0x919F
+#define GL_SAMPLER_BUFFER_OES             0x8DC2
+#define GL_INT_SAMPLER_BUFFER_OES         0x8DD0
+#define GL_UNSIGNED_INT_SAMPLER_BUFFER_OES 0x8DD8
+#define GL_IMAGE_BUFFER_OES               0x9051
+#define GL_INT_IMAGE_BUFFER_OES           0x905C
+#define GL_UNSIGNED_INT_IMAGE_BUFFER_OES  0x9067
+#define GL_TEXTURE_BUFFER_OFFSET_OES      0x919D
+#define GL_TEXTURE_BUFFER_SIZE_OES        0x919E
+typedef void (GL_APIENTRYP PFNGLTEXBUFFEROESPROC) (GLenum target, GLenum internalformat, GLuint buffer);
+typedef void (GL_APIENTRYP PFNGLTEXBUFFERRANGEOESPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glTexBufferOES (GLenum target, GLenum internalformat, GLuint buffer);
+GL_APICALL void GL_APIENTRY glTexBufferRangeOES (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
+#endif
+#endif /* GL_OES_texture_buffer */
+
+#ifndef GL_OES_texture_compression_astc
+#define GL_OES_texture_compression_astc 1
+#define GL_COMPRESSED_RGBA_ASTC_3x3x3_OES 0x93C0
+#define GL_COMPRESSED_RGBA_ASTC_4x3x3_OES 0x93C1
+#define GL_COMPRESSED_RGBA_ASTC_4x4x3_OES 0x93C2
+#define GL_COMPRESSED_RGBA_ASTC_4x4x4_OES 0x93C3
+#define GL_COMPRESSED_RGBA_ASTC_5x4x4_OES 0x93C4
+#define GL_COMPRESSED_RGBA_ASTC_5x5x4_OES 0x93C5
+#define GL_COMPRESSED_RGBA_ASTC_5x5x5_OES 0x93C6
+#define GL_COMPRESSED_RGBA_ASTC_6x5x5_OES 0x93C7
+#define GL_COMPRESSED_RGBA_ASTC_6x6x5_OES 0x93C8
+#define GL_COMPRESSED_RGBA_ASTC_6x6x6_OES 0x93C9
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES 0x93E0
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES 0x93E1
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES 0x93E2
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES 0x93E3
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES 0x93E4
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES 0x93E5
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES 0x93E6
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES 0x93E7
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES 0x93E8
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES 0x93E9
+#endif /* GL_OES_texture_compression_astc */
+
+#ifndef GL_OES_texture_cube_map_array
+#define GL_OES_texture_cube_map_array 1
+#define GL_TEXTURE_CUBE_MAP_ARRAY_OES     0x9009
+#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_OES 0x900A
+#define GL_SAMPLER_CUBE_MAP_ARRAY_OES     0x900C
+#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_OES 0x900D
+#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_OES 0x900E
+#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_OES 0x900F
+#define GL_IMAGE_CUBE_MAP_ARRAY_OES       0x9054
+#define GL_INT_IMAGE_CUBE_MAP_ARRAY_OES   0x905F
+#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_OES 0x906A
+#endif /* GL_OES_texture_cube_map_array */
+
+#ifndef GL_OES_texture_float
+#define GL_OES_texture_float 1
+#endif /* GL_OES_texture_float */
+
+#ifndef GL_OES_texture_float_linear
+#define GL_OES_texture_float_linear 1
+#endif /* GL_OES_texture_float_linear */
+
+#ifndef GL_OES_texture_half_float
+#define GL_OES_texture_half_float 1
+#define GL_HALF_FLOAT_OES                 0x8D61
+#endif /* GL_OES_texture_half_float */
+
+#ifndef GL_OES_texture_half_float_linear
+#define GL_OES_texture_half_float_linear 1
+#endif /* GL_OES_texture_half_float_linear */
+
+#ifndef GL_OES_texture_npot
+#define GL_OES_texture_npot 1
+#endif /* GL_OES_texture_npot */
+
+#ifndef GL_OES_texture_stencil8
+#define GL_OES_texture_stencil8 1
+#define GL_STENCIL_INDEX_OES              0x1901
+#define GL_STENCIL_INDEX8_OES             0x8D48
+#endif /* GL_OES_texture_stencil8 */
+
+#ifndef GL_OES_texture_storage_multisample_2d_array
+#define GL_OES_texture_storage_multisample_2d_array 1
+#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY_OES 0x9102
+#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY_OES 0x9105
+#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY_OES 0x910B
+#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY_OES 0x910C
+#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY_OES 0x910D
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLEOESPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glTexStorage3DMultisampleOES (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
+#endif
+#endif /* GL_OES_texture_storage_multisample_2d_array */
+
+#ifndef GL_OES_texture_view
+#define GL_OES_texture_view 1
+#define GL_TEXTURE_VIEW_MIN_LEVEL_OES     0x82DB
+#define GL_TEXTURE_VIEW_NUM_LEVELS_OES    0x82DC
+#define GL_TEXTURE_VIEW_MIN_LAYER_OES     0x82DD
+#define GL_TEXTURE_VIEW_NUM_LAYERS_OES    0x82DE
+#define GL_TEXTURE_IMMUTABLE_LEVELS       0x82DF
+typedef void (GL_APIENTRYP PFNGLTEXTUREVIEWOESPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glTextureViewOES (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers);
+#endif
+#endif /* GL_OES_texture_view */
+
+#ifndef GL_OES_vertex_array_object
+#define GL_OES_vertex_array_object 1
+#define GL_VERTEX_ARRAY_BINDING_OES       0x85B5
+typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array);
+typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays);
+typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays);
+typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glBindVertexArrayOES (GLuint array);
+GL_APICALL void GL_APIENTRY glDeleteVertexArraysOES (GLsizei n, const GLuint *arrays);
+GL_APICALL void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays);
+GL_APICALL GLboolean GL_APIENTRY glIsVertexArrayOES (GLuint array);
+#endif
+#endif /* GL_OES_vertex_array_object */
+
+#ifndef GL_OES_vertex_half_float
+#define GL_OES_vertex_half_float 1
+#endif /* GL_OES_vertex_half_float */
+
+#ifndef GL_OES_vertex_type_10_10_10_2
+#define GL_OES_vertex_type_10_10_10_2 1
+#define GL_UNSIGNED_INT_10_10_10_2_OES    0x8DF6
+#define GL_INT_10_10_10_2_OES             0x8DF7
+#endif /* GL_OES_vertex_type_10_10_10_2 */
+
+#ifndef GL_OES_viewport_array
+#define GL_OES_viewport_array 1
+#define GL_MAX_VIEWPORTS_OES              0x825B
+#define GL_VIEWPORT_SUBPIXEL_BITS_OES     0x825C
+#define GL_VIEWPORT_BOUNDS_RANGE_OES      0x825D
+#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX_OES 0x825F
+typedef void (GL_APIENTRYP PFNGLVIEWPORTARRAYVOESPROC) (GLuint first, GLsizei count, const GLfloat *v);
+typedef void (GL_APIENTRYP PFNGLVIEWPORTINDEXEDFOESPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);
+typedef void (GL_APIENTRYP PFNGLVIEWPORTINDEXEDFVOESPROC) (GLuint index, const GLfloat *v);
+typedef void (GL_APIENTRYP PFNGLSCISSORARRAYVOESPROC) (GLuint first, GLsizei count, const GLint *v);
+typedef void (GL_APIENTRYP PFNGLSCISSORINDEXEDOESPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLSCISSORINDEXEDVOESPROC) (GLuint index, const GLint *v);
+typedef void (GL_APIENTRYP PFNGLDEPTHRANGEARRAYFVOESPROC) (GLuint first, GLsizei count, const GLfloat *v);
+typedef void (GL_APIENTRYP PFNGLDEPTHRANGEINDEXEDFOESPROC) (GLuint index, GLfloat n, GLfloat f);
+typedef void (GL_APIENTRYP PFNGLGETFLOATI_VOESPROC) (GLenum target, GLuint index, GLfloat *data);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glViewportArrayvOES (GLuint first, GLsizei count, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glViewportIndexedfOES (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);
+GL_APICALL void GL_APIENTRY glViewportIndexedfvOES (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glScissorArrayvOES (GLuint first, GLsizei count, const GLint *v);
+GL_APICALL void GL_APIENTRY glScissorIndexedOES (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glScissorIndexedvOES (GLuint index, const GLint *v);
+GL_APICALL void GL_APIENTRY glDepthRangeArrayfvOES (GLuint first, GLsizei count, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glDepthRangeIndexedfOES (GLuint index, GLfloat n, GLfloat f);
+GL_APICALL void GL_APIENTRY glGetFloati_vOES (GLenum target, GLuint index, GLfloat *data);
+#endif
+#endif /* GL_OES_viewport_array */
+
+#ifndef GL_AMD_compressed_3DC_texture
+#define GL_AMD_compressed_3DC_texture 1
+#define GL_3DC_X_AMD                      0x87F9
+#define GL_3DC_XY_AMD                     0x87FA
+#endif /* GL_AMD_compressed_3DC_texture */
+
+#ifndef GL_AMD_compressed_ATC_texture
+#define GL_AMD_compressed_ATC_texture 1
+#define GL_ATC_RGB_AMD                    0x8C92
+#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD    0x8C93
+#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE
+#endif /* GL_AMD_compressed_ATC_texture */
+
+#ifndef GL_AMD_framebuffer_multisample_advanced
+#define GL_AMD_framebuffer_multisample_advanced 1
+#define GL_RENDERBUFFER_STORAGE_SAMPLES_AMD 0x91B2
+#define GL_MAX_COLOR_FRAMEBUFFER_SAMPLES_AMD 0x91B3
+#define GL_MAX_COLOR_FRAMEBUFFER_STORAGE_SAMPLES_AMD 0x91B4
+#define GL_MAX_DEPTH_STENCIL_FRAMEBUFFER_SAMPLES_AMD 0x91B5
+#define GL_NUM_SUPPORTED_MULTISAMPLE_MODES_AMD 0x91B6
+#define GL_SUPPORTED_MULTISAMPLE_MODES_AMD 0x91B7
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMDPROC) (GLenum target, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMDPROC) (GLuint renderbuffer, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleAdvancedAMD (GLenum target, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glNamedRenderbufferStorageMultisampleAdvancedAMD (GLuint renderbuffer, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif
+#endif /* GL_AMD_framebuffer_multisample_advanced */
+
+#ifndef GL_AMD_performance_monitor
+#define GL_AMD_performance_monitor 1
+#define GL_COUNTER_TYPE_AMD               0x8BC0
+#define GL_COUNTER_RANGE_AMD              0x8BC1
+#define GL_UNSIGNED_INT64_AMD             0x8BC2
+#define GL_PERCENTAGE_AMD                 0x8BC3
+#define GL_PERFMON_RESULT_AVAILABLE_AMD   0x8BC4
+#define GL_PERFMON_RESULT_SIZE_AMD        0x8BC5
+#define GL_PERFMON_RESULT_AMD             0x8BC6
+typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
+typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
+typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
+typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
+typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data);
+typedef void (GL_APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
+typedef void (GL_APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
+typedef void (GL_APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList);
+typedef void (GL_APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor);
+typedef void (GL_APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor);
+typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
+GL_APICALL void GL_APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
+GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
+GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
+GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, void *data);
+GL_APICALL void GL_APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors);
+GL_APICALL void GL_APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors);
+GL_APICALL void GL_APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList);
+GL_APICALL void GL_APIENTRY glBeginPerfMonitorAMD (GLuint monitor);
+GL_APICALL void GL_APIENTRY glEndPerfMonitorAMD (GLuint monitor);
+GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
+#endif
+#endif /* GL_AMD_performance_monitor */
+
+#ifndef GL_AMD_program_binary_Z400
+#define GL_AMD_program_binary_Z400 1
+#define GL_Z400_BINARY_AMD                0x8740
+#endif /* GL_AMD_program_binary_Z400 */
+
+#ifndef GL_ANDROID_extension_pack_es31a
+#define GL_ANDROID_extension_pack_es31a 1
+#endif /* GL_ANDROID_extension_pack_es31a */
+
+#ifndef GL_ANGLE_depth_texture
+#define GL_ANGLE_depth_texture 1
+#endif /* GL_ANGLE_depth_texture */
+
+#ifndef GL_ANGLE_framebuffer_blit
+#define GL_ANGLE_framebuffer_blit 1
+#define GL_READ_FRAMEBUFFER_ANGLE         0x8CA8
+#define GL_DRAW_FRAMEBUFFER_ANGLE         0x8CA9
+#define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6
+#define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA
+typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glBlitFramebufferANGLE (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#endif
+#endif /* GL_ANGLE_framebuffer_blit */
+
+#ifndef GL_ANGLE_framebuffer_multisample
+#define GL_ANGLE_framebuffer_multisample 1
+#define GL_RENDERBUFFER_SAMPLES_ANGLE     0x8CAB
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56
+#define GL_MAX_SAMPLES_ANGLE              0x8D57
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleANGLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif
+#endif /* GL_ANGLE_framebuffer_multisample */
+
+#ifndef GL_ANGLE_instanced_arrays
+#define GL_ANGLE_instanced_arrays 1
+#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE
+typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDrawArraysInstancedANGLE (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+GL_APICALL void GL_APIENTRY glDrawElementsInstancedANGLE (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
+GL_APICALL void GL_APIENTRY glVertexAttribDivisorANGLE (GLuint index, GLuint divisor);
+#endif
+#endif /* GL_ANGLE_instanced_arrays */
+
+#ifndef GL_ANGLE_pack_reverse_row_order
+#define GL_ANGLE_pack_reverse_row_order 1
+#define GL_PACK_REVERSE_ROW_ORDER_ANGLE   0x93A4
+#endif /* GL_ANGLE_pack_reverse_row_order */
+
+#ifndef GL_ANGLE_program_binary
+#define GL_ANGLE_program_binary 1
+#define GL_PROGRAM_BINARY_ANGLE           0x93A6
+#endif /* GL_ANGLE_program_binary */
+
+#ifndef GL_ANGLE_texture_compression_dxt3
+#define GL_ANGLE_texture_compression_dxt3 1
+#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2
+#endif /* GL_ANGLE_texture_compression_dxt3 */
+
+#ifndef GL_ANGLE_texture_compression_dxt5
+#define GL_ANGLE_texture_compression_dxt5 1
+#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3
+#endif /* GL_ANGLE_texture_compression_dxt5 */
+
+#ifndef GL_ANGLE_texture_usage
+#define GL_ANGLE_texture_usage 1
+#define GL_TEXTURE_USAGE_ANGLE            0x93A2
+#define GL_FRAMEBUFFER_ATTACHMENT_ANGLE   0x93A3
+#endif /* GL_ANGLE_texture_usage */
+
+#ifndef GL_ANGLE_translated_shader_source
+#define GL_ANGLE_translated_shader_source 1
+#define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0
+typedef void (GL_APIENTRYP PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glGetTranslatedShaderSourceANGLE (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+#endif
+#endif /* GL_ANGLE_translated_shader_source */
+
+#ifndef GL_APPLE_clip_distance
+#define GL_APPLE_clip_distance 1
+#define GL_MAX_CLIP_DISTANCES_APPLE       0x0D32
+#define GL_CLIP_DISTANCE0_APPLE           0x3000
+#define GL_CLIP_DISTANCE1_APPLE           0x3001
+#define GL_CLIP_DISTANCE2_APPLE           0x3002
+#define GL_CLIP_DISTANCE3_APPLE           0x3003
+#define GL_CLIP_DISTANCE4_APPLE           0x3004
+#define GL_CLIP_DISTANCE5_APPLE           0x3005
+#define GL_CLIP_DISTANCE6_APPLE           0x3006
+#define GL_CLIP_DISTANCE7_APPLE           0x3007
+#endif /* GL_APPLE_clip_distance */
+
+#ifndef GL_APPLE_color_buffer_packed_float
+#define GL_APPLE_color_buffer_packed_float 1
+#endif /* GL_APPLE_color_buffer_packed_float */
+
+#ifndef GL_APPLE_copy_texture_levels
+#define GL_APPLE_copy_texture_levels 1
+typedef void (GL_APIENTRYP PFNGLCOPYTEXTURELEVELSAPPLEPROC) (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glCopyTextureLevelsAPPLE (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount);
+#endif
+#endif /* GL_APPLE_copy_texture_levels */
+
+#ifndef GL_APPLE_framebuffer_multisample
+#define GL_APPLE_framebuffer_multisample 1
+#define GL_RENDERBUFFER_SAMPLES_APPLE     0x8CAB
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56
+#define GL_MAX_SAMPLES_APPLE              0x8D57
+#define GL_READ_FRAMEBUFFER_APPLE         0x8CA8
+#define GL_DRAW_FRAMEBUFFER_APPLE         0x8CA9
+#define GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6
+#define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleAPPLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glResolveMultisampleFramebufferAPPLE (void);
+#endif
+#endif /* GL_APPLE_framebuffer_multisample */
+
+#ifndef GL_APPLE_rgb_422
+#define GL_APPLE_rgb_422 1
+#define GL_RGB_422_APPLE                  0x8A1F
+#define GL_UNSIGNED_SHORT_8_8_APPLE       0x85BA
+#define GL_UNSIGNED_SHORT_8_8_REV_APPLE   0x85BB
+#define GL_RGB_RAW_422_APPLE              0x8A51
+#endif /* GL_APPLE_rgb_422 */
+
+#ifndef GL_APPLE_sync
+#define GL_APPLE_sync 1
+#define GL_SYNC_OBJECT_APPLE              0x8A53
+#define GL_MAX_SERVER_WAIT_TIMEOUT_APPLE  0x9111
+#define GL_OBJECT_TYPE_APPLE              0x9112
+#define GL_SYNC_CONDITION_APPLE           0x9113
+#define GL_SYNC_STATUS_APPLE              0x9114
+#define GL_SYNC_FLAGS_APPLE               0x9115
+#define GL_SYNC_FENCE_APPLE               0x9116
+#define GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE 0x9117
+#define GL_UNSIGNALED_APPLE               0x9118
+#define GL_SIGNALED_APPLE                 0x9119
+#define GL_ALREADY_SIGNALED_APPLE         0x911A
+#define GL_TIMEOUT_EXPIRED_APPLE          0x911B
+#define GL_CONDITION_SATISFIED_APPLE      0x911C
+#define GL_WAIT_FAILED_APPLE              0x911D
+#define GL_SYNC_FLUSH_COMMANDS_BIT_APPLE  0x00000001
+#define GL_TIMEOUT_IGNORED_APPLE          0xFFFFFFFFFFFFFFFFull
+typedef GLsync (GL_APIENTRYP PFNGLFENCESYNCAPPLEPROC) (GLenum condition, GLbitfield flags);
+typedef GLboolean (GL_APIENTRYP PFNGLISSYNCAPPLEPROC) (GLsync sync);
+typedef void (GL_APIENTRYP PFNGLDELETESYNCAPPLEPROC) (GLsync sync);
+typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
+typedef void (GL_APIENTRYP PFNGLWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
+typedef void (GL_APIENTRYP PFNGLGETINTEGER64VAPPLEPROC) (GLenum pname, GLint64 *params);
+typedef void (GL_APIENTRYP PFNGLGETSYNCIVAPPLEPROC) (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL GLsync GL_APIENTRY glFenceSyncAPPLE (GLenum condition, GLbitfield flags);
+GL_APICALL GLboolean GL_APIENTRY glIsSyncAPPLE (GLsync sync);
+GL_APICALL void GL_APIENTRY glDeleteSyncAPPLE (GLsync sync);
+GL_APICALL GLenum GL_APIENTRY glClientWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout);
+GL_APICALL void GL_APIENTRY glWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout);
+GL_APICALL void GL_APIENTRY glGetInteger64vAPPLE (GLenum pname, GLint64 *params);
+GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values);
+#endif
+#endif /* GL_APPLE_sync */
+
+#ifndef GL_APPLE_texture_format_BGRA8888
+#define GL_APPLE_texture_format_BGRA8888 1
+#define GL_BGRA_EXT                       0x80E1
+#define GL_BGRA8_EXT                      0x93A1
+#endif /* GL_APPLE_texture_format_BGRA8888 */
+
+#ifndef GL_APPLE_texture_max_level
+#define GL_APPLE_texture_max_level 1
+#define GL_TEXTURE_MAX_LEVEL_APPLE        0x813D
+#endif /* GL_APPLE_texture_max_level */
+
+#ifndef GL_APPLE_texture_packed_float
+#define GL_APPLE_texture_packed_float 1
+#define GL_UNSIGNED_INT_10F_11F_11F_REV_APPLE 0x8C3B
+#define GL_UNSIGNED_INT_5_9_9_9_REV_APPLE 0x8C3E
+#define GL_R11F_G11F_B10F_APPLE           0x8C3A
+#define GL_RGB9_E5_APPLE                  0x8C3D
+#endif /* GL_APPLE_texture_packed_float */
+
+#ifndef GL_ARM_mali_program_binary
+#define GL_ARM_mali_program_binary 1
+#define GL_MALI_PROGRAM_BINARY_ARM        0x8F61
+#endif /* GL_ARM_mali_program_binary */
+
+#ifndef GL_ARM_mali_shader_binary
+#define GL_ARM_mali_shader_binary 1
+#define GL_MALI_SHADER_BINARY_ARM         0x8F60
+#endif /* GL_ARM_mali_shader_binary */
+
+#ifndef GL_ARM_rgba8
+#define GL_ARM_rgba8 1
+#endif /* GL_ARM_rgba8 */
+
+#ifndef GL_ARM_shader_framebuffer_fetch
+#define GL_ARM_shader_framebuffer_fetch 1
+#define GL_FETCH_PER_SAMPLE_ARM           0x8F65
+#define GL_FRAGMENT_SHADER_FRAMEBUFFER_FETCH_MRT_ARM 0x8F66
+#endif /* GL_ARM_shader_framebuffer_fetch */
+
+#ifndef GL_ARM_shader_framebuffer_fetch_depth_stencil
+#define GL_ARM_shader_framebuffer_fetch_depth_stencil 1
+#endif /* GL_ARM_shader_framebuffer_fetch_depth_stencil */
+
+#ifndef GL_ARM_texture_unnormalized_coordinates
+#define GL_ARM_texture_unnormalized_coordinates 1
+#define GL_TEXTURE_UNNORMALIZED_COORDINATES_ARM 0x8F6A
+#endif /* GL_ARM_texture_unnormalized_coordinates */
+
+#ifndef GL_DMP_program_binary
+#define GL_DMP_program_binary 1
+#define GL_SMAPHS30_PROGRAM_BINARY_DMP    0x9251
+#define GL_SMAPHS_PROGRAM_BINARY_DMP      0x9252
+#define GL_DMP_PROGRAM_BINARY_DMP         0x9253
+#endif /* GL_DMP_program_binary */
+
+#ifndef GL_DMP_shader_binary
+#define GL_DMP_shader_binary 1
+#define GL_SHADER_BINARY_DMP              0x9250
+#endif /* GL_DMP_shader_binary */
+
+#ifndef GL_EXT_EGL_image_array
+#define GL_EXT_EGL_image_array 1
+#endif /* GL_EXT_EGL_image_array */
+
+#ifndef GL_EXT_EGL_image_storage
+#define GL_EXT_EGL_image_storage 1
+typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXSTORAGEEXTPROC) (GLenum target, GLeglImageOES image, const GLint* attrib_list);
+typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURESTORAGEEXTPROC) (GLuint texture, GLeglImageOES image, const GLint* attrib_list);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glEGLImageTargetTexStorageEXT (GLenum target, GLeglImageOES image, const GLint* attrib_list);
+GL_APICALL void GL_APIENTRY glEGLImageTargetTextureStorageEXT (GLuint texture, GLeglImageOES image, const GLint* attrib_list);
+#endif
+#endif /* GL_EXT_EGL_image_storage */
+
+#ifndef GL_EXT_EGL_image_storage_compression
+#define GL_EXT_EGL_image_storage_compression 1
+#define GL_SURFACE_COMPRESSION_EXT        0x96C0
+#define GL_SURFACE_COMPRESSION_FIXED_RATE_NONE_EXT 0x96C1
+#define GL_SURFACE_COMPRESSION_FIXED_RATE_DEFAULT_EXT 0x96C2
+#endif /* GL_EXT_EGL_image_storage_compression */
+
+#ifndef GL_EXT_YUV_target
+#define GL_EXT_YUV_target 1
+#define GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT    0x8BE7
+#endif /* GL_EXT_YUV_target */
+
+#ifndef GL_EXT_base_instance
+#define GL_EXT_base_instance 1
+typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEEXTPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance);
+typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance);
+typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDrawArraysInstancedBaseInstanceEXT (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance);
+GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseInstanceEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance);
+GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexBaseInstanceEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance);
+#endif
+#endif /* GL_EXT_base_instance */
+
+#ifndef GL_EXT_blend_func_extended
+#define GL_EXT_blend_func_extended 1
+#define GL_SRC1_COLOR_EXT                 0x88F9
+#define GL_SRC1_ALPHA_EXT                 0x8589
+#define GL_ONE_MINUS_SRC1_COLOR_EXT       0x88FA
+#define GL_ONE_MINUS_SRC1_ALPHA_EXT       0x88FB
+#define GL_SRC_ALPHA_SATURATE_EXT         0x0308
+#define GL_LOCATION_INDEX_EXT             0x930F
+#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS_EXT 0x88FC
+typedef void (GL_APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDEXTPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name);
+typedef void (GL_APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name);
+typedef GLint (GL_APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXEXTPROC) (GLuint program, GLenum programInterface, const GLchar *name);
+typedef GLint (GL_APIENTRYP PFNGLGETFRAGDATAINDEXEXTPROC) (GLuint program, const GLchar *name);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glBindFragDataLocationIndexedEXT (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name);
+GL_APICALL void GL_APIENTRY glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name);
+GL_APICALL GLint GL_APIENTRY glGetProgramResourceLocationIndexEXT (GLuint program, GLenum programInterface, const GLchar *name);
+GL_APICALL GLint GL_APIENTRY glGetFragDataIndexEXT (GLuint program, const GLchar *name);
+#endif
+#endif /* GL_EXT_blend_func_extended */
+
+#ifndef GL_EXT_blend_minmax
+#define GL_EXT_blend_minmax 1
+#define GL_MIN_EXT                        0x8007
+#define GL_MAX_EXT                        0x8008
+#endif /* GL_EXT_blend_minmax */
+
+#ifndef GL_EXT_buffer_storage
+#define GL_EXT_buffer_storage 1
+#define GL_MAP_READ_BIT                   0x0001
+#define GL_MAP_WRITE_BIT                  0x0002
+#define GL_MAP_PERSISTENT_BIT_EXT         0x0040
+#define GL_MAP_COHERENT_BIT_EXT           0x0080
+#define GL_DYNAMIC_STORAGE_BIT_EXT        0x0100
+#define GL_CLIENT_STORAGE_BIT_EXT         0x0200
+#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT_EXT 0x00004000
+#define GL_BUFFER_IMMUTABLE_STORAGE_EXT   0x821F
+#define GL_BUFFER_STORAGE_FLAGS_EXT       0x8220
+typedef void (GL_APIENTRYP PFNGLBUFFERSTORAGEEXTPROC) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glBufferStorageEXT (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags);
+#endif
+#endif /* GL_EXT_buffer_storage */
+
+#ifndef GL_EXT_clear_texture
+#define GL_EXT_clear_texture 1
+typedef void (GL_APIENTRYP PFNGLCLEARTEXIMAGEEXTPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const void *data);
+typedef void (GL_APIENTRYP PFNGLCLEARTEXSUBIMAGEEXTPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glClearTexImageEXT (GLuint texture, GLint level, GLenum format, GLenum type, const void *data);
+GL_APICALL void GL_APIENTRY glClearTexSubImageEXT (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data);
+#endif
+#endif /* GL_EXT_clear_texture */
+
+#ifndef GL_EXT_clip_control
+#define GL_EXT_clip_control 1
+#define GL_LOWER_LEFT_EXT                 0x8CA1
+#define GL_UPPER_LEFT_EXT                 0x8CA2
+#define GL_NEGATIVE_ONE_TO_ONE_EXT        0x935E
+#define GL_ZERO_TO_ONE_EXT                0x935F
+#define GL_CLIP_ORIGIN_EXT                0x935C
+#define GL_CLIP_DEPTH_MODE_EXT            0x935D
+typedef void (GL_APIENTRYP PFNGLCLIPCONTROLEXTPROC) (GLenum origin, GLenum depth);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glClipControlEXT (GLenum origin, GLenum depth);
+#endif
+#endif /* GL_EXT_clip_control */
+
+#ifndef GL_EXT_clip_cull_distance
+#define GL_EXT_clip_cull_distance 1
+#define GL_MAX_CLIP_DISTANCES_EXT         0x0D32
+#define GL_MAX_CULL_DISTANCES_EXT         0x82F9
+#define GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES_EXT 0x82FA
+#define GL_CLIP_DISTANCE0_EXT             0x3000
+#define GL_CLIP_DISTANCE1_EXT             0x3001
+#define GL_CLIP_DISTANCE2_EXT             0x3002
+#define GL_CLIP_DISTANCE3_EXT             0x3003
+#define GL_CLIP_DISTANCE4_EXT             0x3004
+#define GL_CLIP_DISTANCE5_EXT             0x3005
+#define GL_CLIP_DISTANCE6_EXT             0x3006
+#define GL_CLIP_DISTANCE7_EXT             0x3007
+#endif /* GL_EXT_clip_cull_distance */
+
+#ifndef GL_EXT_color_buffer_float
+#define GL_EXT_color_buffer_float 1
+#endif /* GL_EXT_color_buffer_float */
+
+#ifndef GL_EXT_color_buffer_half_float
+#define GL_EXT_color_buffer_half_float 1
+#define GL_RGBA16F_EXT                    0x881A
+#define GL_RGB16F_EXT                     0x881B
+#define GL_RG16F_EXT                      0x822F
+#define GL_R16F_EXT                       0x822D
+#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT 0x8211
+#define GL_UNSIGNED_NORMALIZED_EXT        0x8C17
+#endif /* GL_EXT_color_buffer_half_float */
+
+#ifndef GL_EXT_conservative_depth
+#define GL_EXT_conservative_depth 1
+#endif /* GL_EXT_conservative_depth */
+
+#ifndef GL_EXT_copy_image
+#define GL_EXT_copy_image 1
+typedef void (GL_APIENTRYP PFNGLCOPYIMAGESUBDATAEXTPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glCopyImageSubDataEXT (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
+#endif
+#endif /* GL_EXT_copy_image */
+
+#ifndef GL_EXT_debug_label
+#define GL_EXT_debug_label 1
+#define GL_PROGRAM_PIPELINE_OBJECT_EXT    0x8A4F
+#define GL_PROGRAM_OBJECT_EXT             0x8B40
+#define GL_SHADER_OBJECT_EXT              0x8B48
+#define GL_BUFFER_OBJECT_EXT              0x9151
+#define GL_QUERY_OBJECT_EXT               0x9153
+#define GL_VERTEX_ARRAY_OBJECT_EXT        0x9154
+#define GL_TRANSFORM_FEEDBACK             0x8E22
+typedef void (GL_APIENTRYP PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label);
+typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glLabelObjectEXT (GLenum type, GLuint object, GLsizei length, const GLchar *label);
+GL_APICALL void GL_APIENTRY glGetObjectLabelEXT (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
+#endif
+#endif /* GL_EXT_debug_label */
+
+#ifndef GL_EXT_debug_marker
+#define GL_EXT_debug_marker 1
+typedef void (GL_APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker);
+typedef void (GL_APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker);
+typedef void (GL_APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker);
+GL_APICALL void GL_APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker);
+GL_APICALL void GL_APIENTRY glPopGroupMarkerEXT (void);
+#endif
+#endif /* GL_EXT_debug_marker */
+
+#ifndef GL_EXT_depth_clamp
+#define GL_EXT_depth_clamp 1
+#define GL_DEPTH_CLAMP_EXT                0x864F
+#endif /* GL_EXT_depth_clamp */
+
+#ifndef GL_EXT_discard_framebuffer
+#define GL_EXT_discard_framebuffer 1
+#define GL_COLOR_EXT                      0x1800
+#define GL_DEPTH_EXT                      0x1801
+#define GL_STENCIL_EXT                    0x1802
+typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments);
+#endif
+#endif /* GL_EXT_discard_framebuffer */
+
+#ifndef GL_EXT_disjoint_timer_query
+#define GL_EXT_disjoint_timer_query 1
+#define GL_QUERY_COUNTER_BITS_EXT         0x8864
+#define GL_CURRENT_QUERY_EXT              0x8865
+#define GL_QUERY_RESULT_EXT               0x8866
+#define GL_QUERY_RESULT_AVAILABLE_EXT     0x8867
+#define GL_TIME_ELAPSED_EXT               0x88BF
+#define GL_TIMESTAMP_EXT                  0x8E28
+#define GL_GPU_DISJOINT_EXT               0x8FBB
+typedef void (GL_APIENTRYP PFNGLGENQUERIESEXTPROC) (GLsizei n, GLuint *ids);
+typedef void (GL_APIENTRYP PFNGLDELETEQUERIESEXTPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (GL_APIENTRYP PFNGLISQUERYEXTPROC) (GLuint id);
+typedef void (GL_APIENTRYP PFNGLBEGINQUERYEXTPROC) (GLenum target, GLuint id);
+typedef void (GL_APIENTRYP PFNGLENDQUERYEXTPROC) (GLenum target);
+typedef void (GL_APIENTRYP PFNGLQUERYCOUNTEREXTPROC) (GLuint id, GLenum target);
+typedef void (GL_APIENTRYP PFNGLGETQUERYIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTIVEXTPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVEXTPROC) (GLuint id, GLenum pname, GLuint *params);
+typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64 *params);
+typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64 *params);
+typedef void (GL_APIENTRYP PFNGLGETINTEGER64VEXTPROC) (GLenum pname, GLint64 *data);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glGenQueriesEXT (GLsizei n, GLuint *ids);
+GL_APICALL void GL_APIENTRY glDeleteQueriesEXT (GLsizei n, const GLuint *ids);
+GL_APICALL GLboolean GL_APIENTRY glIsQueryEXT (GLuint id);
+GL_APICALL void GL_APIENTRY glBeginQueryEXT (GLenum target, GLuint id);
+GL_APICALL void GL_APIENTRY glEndQueryEXT (GLenum target);
+GL_APICALL void GL_APIENTRY glQueryCounterEXT (GLuint id, GLenum target);
+GL_APICALL void GL_APIENTRY glGetQueryivEXT (GLenum target, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetQueryObjectivEXT (GLuint id, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetQueryObjectuivEXT (GLuint id, GLenum pname, GLuint *params);
+GL_APICALL void GL_APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64 *params);
+GL_APICALL void GL_APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64 *params);
+GL_APICALL void GL_APIENTRY glGetInteger64vEXT (GLenum pname, GLint64 *data);
+#endif
+#endif /* GL_EXT_disjoint_timer_query */
+
+#ifndef GL_EXT_draw_buffers
+#define GL_EXT_draw_buffers 1
+#define GL_MAX_COLOR_ATTACHMENTS_EXT      0x8CDF
+#define GL_MAX_DRAW_BUFFERS_EXT           0x8824
+#define GL_DRAW_BUFFER0_EXT               0x8825
+#define GL_DRAW_BUFFER1_EXT               0x8826
+#define GL_DRAW_BUFFER2_EXT               0x8827
+#define GL_DRAW_BUFFER3_EXT               0x8828
+#define GL_DRAW_BUFFER4_EXT               0x8829
+#define GL_DRAW_BUFFER5_EXT               0x882A
+#define GL_DRAW_BUFFER6_EXT               0x882B
+#define GL_DRAW_BUFFER7_EXT               0x882C
+#define GL_DRAW_BUFFER8_EXT               0x882D
+#define GL_DRAW_BUFFER9_EXT               0x882E
+#define GL_DRAW_BUFFER10_EXT              0x882F
+#define GL_DRAW_BUFFER11_EXT              0x8830
+#define GL_DRAW_BUFFER12_EXT              0x8831
+#define GL_DRAW_BUFFER13_EXT              0x8832
+#define GL_DRAW_BUFFER14_EXT              0x8833
+#define GL_DRAW_BUFFER15_EXT              0x8834
+#define GL_COLOR_ATTACHMENT0_EXT          0x8CE0
+#define GL_COLOR_ATTACHMENT1_EXT          0x8CE1
+#define GL_COLOR_ATTACHMENT2_EXT          0x8CE2
+#define GL_COLOR_ATTACHMENT3_EXT          0x8CE3
+#define GL_COLOR_ATTACHMENT4_EXT          0x8CE4
+#define GL_COLOR_ATTACHMENT5_EXT          0x8CE5
+#define GL_COLOR_ATTACHMENT6_EXT          0x8CE6
+#define GL_COLOR_ATTACHMENT7_EXT          0x8CE7
+#define GL_COLOR_ATTACHMENT8_EXT          0x8CE8
+#define GL_COLOR_ATTACHMENT9_EXT          0x8CE9
+#define GL_COLOR_ATTACHMENT10_EXT         0x8CEA
+#define GL_COLOR_ATTACHMENT11_EXT         0x8CEB
+#define GL_COLOR_ATTACHMENT12_EXT         0x8CEC
+#define GL_COLOR_ATTACHMENT13_EXT         0x8CED
+#define GL_COLOR_ATTACHMENT14_EXT         0x8CEE
+#define GL_COLOR_ATTACHMENT15_EXT         0x8CEF
+typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSEXTPROC) (GLsizei n, const GLenum *bufs);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDrawBuffersEXT (GLsizei n, const GLenum *bufs);
+#endif
+#endif /* GL_EXT_draw_buffers */
+
+#ifndef GL_EXT_draw_buffers_indexed
+#define GL_EXT_draw_buffers_indexed 1
+typedef void (GL_APIENTRYP PFNGLENABLEIEXTPROC) (GLenum target, GLuint index);
+typedef void (GL_APIENTRYP PFNGLDISABLEIEXTPROC) (GLenum target, GLuint index);
+typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONIEXTPROC) (GLuint buf, GLenum mode);
+typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEIEXTPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+typedef void (GL_APIENTRYP PFNGLBLENDFUNCIEXTPROC) (GLuint buf, GLenum src, GLenum dst);
+typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEIEXTPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+typedef void (GL_APIENTRYP PFNGLCOLORMASKIEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDIEXTPROC) (GLenum target, GLuint index);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glEnableiEXT (GLenum target, GLuint index);
+GL_APICALL void GL_APIENTRY glDisableiEXT (GLenum target, GLuint index);
+GL_APICALL void GL_APIENTRY glBlendEquationiEXT (GLuint buf, GLenum mode);
+GL_APICALL void GL_APIENTRY glBlendEquationSeparateiEXT (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+GL_APICALL void GL_APIENTRY glBlendFunciEXT (GLuint buf, GLenum src, GLenum dst);
+GL_APICALL void GL_APIENTRY glBlendFuncSeparateiEXT (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+GL_APICALL void GL_APIENTRY glColorMaskiEXT (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+GL_APICALL GLboolean GL_APIENTRY glIsEnablediEXT (GLenum target, GLuint index);
+#endif
+#endif /* GL_EXT_draw_buffers_indexed */
+
+#ifndef GL_EXT_draw_elements_base_vertex
+#define GL_EXT_draw_elements_base_vertex 1
+typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
+typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
+typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDrawElementsBaseVertexEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
+GL_APICALL void GL_APIENTRY glDrawRangeElementsBaseVertexEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
+GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
+#endif
+#endif /* GL_EXT_draw_elements_base_vertex */
+
+#ifndef GL_EXT_draw_instanced
+#define GL_EXT_draw_instanced 1
+typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
+typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
+GL_APICALL void GL_APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
+#endif
+#endif /* GL_EXT_draw_instanced */
+
+#ifndef GL_EXT_draw_transform_feedback
+#define GL_EXT_draw_transform_feedback 1
+typedef void (GL_APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKEXTPROC) (GLenum mode, GLuint id);
+typedef void (GL_APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDEXTPROC) (GLenum mode, GLuint id, GLsizei instancecount);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDrawTransformFeedbackEXT (GLenum mode, GLuint id);
+GL_APICALL void GL_APIENTRY glDrawTransformFeedbackInstancedEXT (GLenum mode, GLuint id, GLsizei instancecount);
+#endif
+#endif /* GL_EXT_draw_transform_feedback */
+
+#ifndef GL_EXT_external_buffer
+#define GL_EXT_external_buffer 1
+typedef void *GLeglClientBufferEXT;
+typedef void (GL_APIENTRYP PFNGLBUFFERSTORAGEEXTERNALEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags);
+typedef void (GL_APIENTRYP PFNGLNAMEDBUFFERSTORAGEEXTERNALEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glBufferStorageExternalEXT (GLenum target, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags);
+GL_APICALL void GL_APIENTRY glNamedBufferStorageExternalEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags);
+#endif
+#endif /* GL_EXT_external_buffer */
+
+#ifndef GL_EXT_float_blend
+#define GL_EXT_float_blend 1
+#endif /* GL_EXT_float_blend */
+
+#ifndef GL_EXT_geometry_point_size
+#define GL_EXT_geometry_point_size 1
+#endif /* GL_EXT_geometry_point_size */
+
+#ifndef GL_EXT_geometry_shader
+#define GL_EXT_geometry_shader 1
+#define GL_GEOMETRY_SHADER_EXT            0x8DD9
+#define GL_GEOMETRY_SHADER_BIT_EXT        0x00000004
+#define GL_GEOMETRY_LINKED_VERTICES_OUT_EXT 0x8916
+#define GL_GEOMETRY_LINKED_INPUT_TYPE_EXT 0x8917
+#define GL_GEOMETRY_LINKED_OUTPUT_TYPE_EXT 0x8918
+#define GL_GEOMETRY_SHADER_INVOCATIONS_EXT 0x887F
+#define GL_LAYER_PROVOKING_VERTEX_EXT     0x825E
+#define GL_LINES_ADJACENCY_EXT            0x000A
+#define GL_LINE_STRIP_ADJACENCY_EXT       0x000B
+#define GL_TRIANGLES_ADJACENCY_EXT        0x000C
+#define GL_TRIANGLE_STRIP_ADJACENCY_EXT   0x000D
+#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF
+#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS_EXT 0x8A2C
+#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8A32
+#define GL_MAX_GEOMETRY_INPUT_COMPONENTS_EXT 0x9123
+#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_EXT 0x9124
+#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0
+#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1
+#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS_EXT 0x8E5A
+#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29
+#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_EXT 0x92CF
+#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS_EXT 0x92D5
+#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS_EXT 0x90CD
+#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_EXT 0x90D7
+#define GL_FIRST_VERTEX_CONVENTION_EXT    0x8E4D
+#define GL_LAST_VERTEX_CONVENTION_EXT     0x8E4E
+#define GL_UNDEFINED_VERTEX_EXT           0x8260
+#define GL_PRIMITIVES_GENERATED_EXT       0x8C87
+#define GL_FRAMEBUFFER_DEFAULT_LAYERS_EXT 0x9312
+#define GL_MAX_FRAMEBUFFER_LAYERS_EXT     0x9317
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8
+#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7
+#define GL_REFERENCED_BY_GEOMETRY_SHADER_EXT 0x9309
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level);
+#endif
+#endif /* GL_EXT_geometry_shader */
+
+#ifndef GL_EXT_gpu_shader5
+#define GL_EXT_gpu_shader5 1
+#endif /* GL_EXT_gpu_shader5 */
+
+#ifndef GL_EXT_instanced_arrays
+#define GL_EXT_instanced_arrays 1
+#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_EXT 0x88FE
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISOREXTPROC) (GLuint index, GLuint divisor);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glVertexAttribDivisorEXT (GLuint index, GLuint divisor);
+#endif
+#endif /* GL_EXT_instanced_arrays */
+
+#ifndef GL_EXT_map_buffer_range
+#define GL_EXT_map_buffer_range 1
+#define GL_MAP_READ_BIT_EXT               0x0001
+#define GL_MAP_WRITE_BIT_EXT              0x0002
+#define GL_MAP_INVALIDATE_RANGE_BIT_EXT   0x0004
+#define GL_MAP_INVALIDATE_BUFFER_BIT_EXT  0x0008
+#define GL_MAP_FLUSH_EXPLICIT_BIT_EXT     0x0010
+#define GL_MAP_UNSYNCHRONIZED_BIT_EXT     0x0020
+typedef void *(GL_APIENTRYP PFNGLMAPBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+typedef void (GL_APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void *GL_APIENTRY glMapBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+GL_APICALL void GL_APIENTRY glFlushMappedBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length);
+#endif
+#endif /* GL_EXT_map_buffer_range */
+
+#ifndef GL_EXT_memory_object
+#define GL_EXT_memory_object 1
+#define GL_TEXTURE_TILING_EXT             0x9580
+#define GL_DEDICATED_MEMORY_OBJECT_EXT    0x9581
+#define GL_PROTECTED_MEMORY_OBJECT_EXT    0x959B
+#define GL_NUM_TILING_TYPES_EXT           0x9582
+#define GL_TILING_TYPES_EXT               0x9583
+#define GL_OPTIMAL_TILING_EXT             0x9584
+#define GL_LINEAR_TILING_EXT              0x9585
+#define GL_NUM_DEVICE_UUIDS_EXT           0x9596
+#define GL_DEVICE_UUID_EXT                0x9597
+#define GL_DRIVER_UUID_EXT                0x9598
+#define GL_UUID_SIZE_EXT                  16
+typedef void (GL_APIENTRYP PFNGLGETUNSIGNEDBYTEVEXTPROC) (GLenum pname, GLubyte *data);
+typedef void (GL_APIENTRYP PFNGLGETUNSIGNEDBYTEI_VEXTPROC) (GLenum target, GLuint index, GLubyte *data);
+typedef void (GL_APIENTRYP PFNGLDELETEMEMORYOBJECTSEXTPROC) (GLsizei n, const GLuint *memoryObjects);
+typedef GLboolean (GL_APIENTRYP PFNGLISMEMORYOBJECTEXTPROC) (GLuint memoryObject);
+typedef void (GL_APIENTRYP PFNGLCREATEMEMORYOBJECTSEXTPROC) (GLsizei n, GLuint *memoryObjects);
+typedef void (GL_APIENTRYP PFNGLMEMORYOBJECTPARAMETERIVEXTPROC) (GLuint memoryObject, GLenum pname, const GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETMEMORYOBJECTPARAMETERIVEXTPROC) (GLuint memoryObject, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEM2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset);
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEM2DMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset);
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEM3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset);
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEM3DMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset);
+typedef void (GL_APIENTRYP PFNGLBUFFERSTORAGEMEMEXTPROC) (GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset);
+typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGEMEM2DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset);
+typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGEMEM2DMULTISAMPLEEXTPROC) (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset);
+typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGEMEM3DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset);
+typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGEMEM3DMULTISAMPLEEXTPROC) (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset);
+typedef void (GL_APIENTRYP PFNGLNAMEDBUFFERSTORAGEMEMEXTPROC) (GLuint buffer, GLsizeiptr size, GLuint memory, GLuint64 offset);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glGetUnsignedBytevEXT (GLenum pname, GLubyte *data);
+GL_APICALL void GL_APIENTRY glGetUnsignedBytei_vEXT (GLenum target, GLuint index, GLubyte *data);
+GL_APICALL void GL_APIENTRY glDeleteMemoryObjectsEXT (GLsizei n, const GLuint *memoryObjects);
+GL_APICALL GLboolean GL_APIENTRY glIsMemoryObjectEXT (GLuint memoryObject);
+GL_APICALL void GL_APIENTRY glCreateMemoryObjectsEXT (GLsizei n, GLuint *memoryObjects);
+GL_APICALL void GL_APIENTRY glMemoryObjectParameterivEXT (GLuint memoryObject, GLenum pname, const GLint *params);
+GL_APICALL void GL_APIENTRY glGetMemoryObjectParameterivEXT (GLuint memoryObject, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glTexStorageMem2DEXT (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset);
+GL_APICALL void GL_APIENTRY glTexStorageMem2DMultisampleEXT (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset);
+GL_APICALL void GL_APIENTRY glTexStorageMem3DEXT (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset);
+GL_APICALL void GL_APIENTRY glTexStorageMem3DMultisampleEXT (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset);
+GL_APICALL void GL_APIENTRY glBufferStorageMemEXT (GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset);
+GL_APICALL void GL_APIENTRY glTextureStorageMem2DEXT (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset);
+GL_APICALL void GL_APIENTRY glTextureStorageMem2DMultisampleEXT (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset);
+GL_APICALL void GL_APIENTRY glTextureStorageMem3DEXT (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset);
+GL_APICALL void GL_APIENTRY glTextureStorageMem3DMultisampleEXT (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset);
+GL_APICALL void GL_APIENTRY glNamedBufferStorageMemEXT (GLuint buffer, GLsizeiptr size, GLuint memory, GLuint64 offset);
+#endif
+#endif /* GL_EXT_memory_object */
+
+#ifndef GL_EXT_memory_object_fd
+#define GL_EXT_memory_object_fd 1
+#define GL_HANDLE_TYPE_OPAQUE_FD_EXT      0x9586
+typedef void (GL_APIENTRYP PFNGLIMPORTMEMORYFDEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, GLint fd);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glImportMemoryFdEXT (GLuint memory, GLuint64 size, GLenum handleType, GLint fd);
+#endif
+#endif /* GL_EXT_memory_object_fd */
+
+#ifndef GL_EXT_memory_object_win32
+#define GL_EXT_memory_object_win32 1
+#define GL_HANDLE_TYPE_OPAQUE_WIN32_EXT   0x9587
+#define GL_HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT 0x9588
+#define GL_DEVICE_LUID_EXT                0x9599
+#define GL_DEVICE_NODE_MASK_EXT           0x959A
+#define GL_LUID_SIZE_EXT                  8
+#define GL_HANDLE_TYPE_D3D12_TILEPOOL_EXT 0x9589
+#define GL_HANDLE_TYPE_D3D12_RESOURCE_EXT 0x958A
+#define GL_HANDLE_TYPE_D3D11_IMAGE_EXT    0x958B
+#define GL_HANDLE_TYPE_D3D11_IMAGE_KMT_EXT 0x958C
+typedef void (GL_APIENTRYP PFNGLIMPORTMEMORYWIN32HANDLEEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, void *handle);
+typedef void (GL_APIENTRYP PFNGLIMPORTMEMORYWIN32NAMEEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, const void *name);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glImportMemoryWin32HandleEXT (GLuint memory, GLuint64 size, GLenum handleType, void *handle);
+GL_APICALL void GL_APIENTRY glImportMemoryWin32NameEXT (GLuint memory, GLuint64 size, GLenum handleType, const void *name);
+#endif
+#endif /* GL_EXT_memory_object_win32 */
+
+#ifndef GL_EXT_multi_draw_arrays
+#define GL_EXT_multi_draw_arrays 1
+typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+GL_APICALL void GL_APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount);
+#endif
+#endif /* GL_EXT_multi_draw_arrays */
+
+#ifndef GL_EXT_multi_draw_indirect
+#define GL_EXT_multi_draw_indirect 1
+typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTEXTPROC) (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride);
+typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTEXTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glMultiDrawArraysIndirectEXT (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride);
+GL_APICALL void GL_APIENTRY glMultiDrawElementsIndirectEXT (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride);
+#endif
+#endif /* GL_EXT_multi_draw_indirect */
+
+#ifndef GL_EXT_multisampled_compatibility
+#define GL_EXT_multisampled_compatibility 1
+#define GL_MULTISAMPLE_EXT                0x809D
+#define GL_SAMPLE_ALPHA_TO_ONE_EXT        0x809F
+#endif /* GL_EXT_multisampled_compatibility */
+
+#ifndef GL_EXT_multisampled_render_to_texture
+#define GL_EXT_multisampled_render_to_texture 1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C
+#define GL_RENDERBUFFER_SAMPLES_EXT       0x8CAB
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
+#define GL_MAX_SAMPLES_EXT                0x8D57
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+#endif
+#endif /* GL_EXT_multisampled_render_to_texture */
+
+#ifndef GL_EXT_multisampled_render_to_texture2
+#define GL_EXT_multisampled_render_to_texture2 1
+#endif /* GL_EXT_multisampled_render_to_texture2 */
+
+#ifndef GL_EXT_multiview_draw_buffers
+#define GL_EXT_multiview_draw_buffers 1
+#define GL_COLOR_ATTACHMENT_EXT           0x90F0
+#define GL_MULTIVIEW_EXT                  0x90F1
+#define GL_DRAW_BUFFER_EXT                0x0C01
+#define GL_READ_BUFFER_EXT                0x0C02
+#define GL_MAX_MULTIVIEW_BUFFERS_EXT      0x90F2
+typedef void (GL_APIENTRYP PFNGLREADBUFFERINDEXEDEXTPROC) (GLenum src, GLint index);
+typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSINDEXEDEXTPROC) (GLint n, const GLenum *location, const GLint *indices);
+typedef void (GL_APIENTRYP PFNGLGETINTEGERI_VEXTPROC) (GLenum target, GLuint index, GLint *data);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glReadBufferIndexedEXT (GLenum src, GLint index);
+GL_APICALL void GL_APIENTRY glDrawBuffersIndexedEXT (GLint n, const GLenum *location, const GLint *indices);
+GL_APICALL void GL_APIENTRY glGetIntegeri_vEXT (GLenum target, GLuint index, GLint *data);
+#endif
+#endif /* GL_EXT_multiview_draw_buffers */
+
+#ifndef GL_EXT_multiview_tessellation_geometry_shader
+#define GL_EXT_multiview_tessellation_geometry_shader 1
+#endif /* GL_EXT_multiview_tessellation_geometry_shader */
+
+#ifndef GL_EXT_multiview_texture_multisample
+#define GL_EXT_multiview_texture_multisample 1
+#endif /* GL_EXT_multiview_texture_multisample */
+
+#ifndef GL_EXT_multiview_timer_query
+#define GL_EXT_multiview_timer_query 1
+#endif /* GL_EXT_multiview_timer_query */
+
+#ifndef GL_EXT_occlusion_query_boolean
+#define GL_EXT_occlusion_query_boolean 1
+#define GL_ANY_SAMPLES_PASSED_EXT         0x8C2F
+#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT 0x8D6A
+#endif /* GL_EXT_occlusion_query_boolean */
+
+#ifndef GL_EXT_polygon_offset_clamp
+#define GL_EXT_polygon_offset_clamp 1
+#define GL_POLYGON_OFFSET_CLAMP_EXT       0x8E1B
+typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETCLAMPEXTPROC) (GLfloat factor, GLfloat units, GLfloat clamp);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glPolygonOffsetClampEXT (GLfloat factor, GLfloat units, GLfloat clamp);
+#endif
+#endif /* GL_EXT_polygon_offset_clamp */
+
+#ifndef GL_EXT_post_depth_coverage
+#define GL_EXT_post_depth_coverage 1
+#endif /* GL_EXT_post_depth_coverage */
+
+#ifndef GL_EXT_primitive_bounding_box
+#define GL_EXT_primitive_bounding_box 1
+#define GL_PRIMITIVE_BOUNDING_BOX_EXT     0x92BE
+typedef void (GL_APIENTRYP PFNGLPRIMITIVEBOUNDINGBOXEXTPROC) (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glPrimitiveBoundingBoxEXT (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW);
+#endif
+#endif /* GL_EXT_primitive_bounding_box */
+
+#ifndef GL_EXT_protected_textures
+#define GL_EXT_protected_textures 1
+#define GL_CONTEXT_FLAG_PROTECTED_CONTENT_BIT_EXT 0x00000010
+#define GL_TEXTURE_PROTECTED_EXT          0x8BFA
+#endif /* GL_EXT_protected_textures */
+
+#ifndef GL_EXT_pvrtc_sRGB
+#define GL_EXT_pvrtc_sRGB 1
+#define GL_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT 0x8A54
+#define GL_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT 0x8A55
+#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT 0x8A56
+#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT 0x8A57
+#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV2_IMG 0x93F0
+#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV2_IMG 0x93F1
+#endif /* GL_EXT_pvrtc_sRGB */
+
+#ifndef GL_EXT_raster_multisample
+#define GL_EXT_raster_multisample 1
+#define GL_RASTER_MULTISAMPLE_EXT         0x9327
+#define GL_RASTER_SAMPLES_EXT             0x9328
+#define GL_MAX_RASTER_SAMPLES_EXT         0x9329
+#define GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT 0x932A
+#define GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT 0x932B
+#define GL_EFFECTIVE_RASTER_SAMPLES_EXT   0x932C
+typedef void (GL_APIENTRYP PFNGLRASTERSAMPLESEXTPROC) (GLuint samples, GLboolean fixedsamplelocations);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glRasterSamplesEXT (GLuint samples, GLboolean fixedsamplelocations);
+#endif
+#endif /* GL_EXT_raster_multisample */
+
+#ifndef GL_EXT_read_format_bgra
+#define GL_EXT_read_format_bgra 1
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365
+#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366
+#endif /* GL_EXT_read_format_bgra */
+
+#ifndef GL_EXT_render_snorm
+#define GL_EXT_render_snorm 1
+#define GL_R8_SNORM                       0x8F94
+#define GL_RG8_SNORM                      0x8F95
+#define GL_RGBA8_SNORM                    0x8F97
+#define GL_R16_SNORM_EXT                  0x8F98
+#define GL_RG16_SNORM_EXT                 0x8F99
+#define GL_RGBA16_SNORM_EXT               0x8F9B
+#endif /* GL_EXT_render_snorm */
+
+#ifndef GL_EXT_robustness
+#define GL_EXT_robustness 1
+#define GL_GUILTY_CONTEXT_RESET_EXT       0x8253
+#define GL_INNOCENT_CONTEXT_RESET_EXT     0x8254
+#define GL_UNKNOWN_CONTEXT_RESET_EXT      0x8255
+#define GL_CONTEXT_ROBUST_ACCESS_EXT      0x90F3
+#define GL_RESET_NOTIFICATION_STRATEGY_EXT 0x8256
+#define GL_LOSE_CONTEXT_ON_RESET_EXT      0x8252
+#define GL_NO_RESET_NOTIFICATION_EXT      0x8261
+typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSEXTPROC) (void);
+typedef void (GL_APIENTRYP PFNGLREADNPIXELSEXTPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusEXT (void);
+GL_APICALL void GL_APIENTRY glReadnPixelsEXT (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+GL_APICALL void GL_APIENTRY glGetnUniformfvEXT (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetnUniformivEXT (GLuint program, GLint location, GLsizei bufSize, GLint *params);
+#endif
+#endif /* GL_EXT_robustness */
+
+#ifndef GL_EXT_sRGB
+#define GL_EXT_sRGB 1
+#define GL_SRGB_EXT                       0x8C40
+#define GL_SRGB_ALPHA_EXT                 0x8C42
+#define GL_SRGB8_ALPHA8_EXT               0x8C43
+#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT 0x8210
+#endif /* GL_EXT_sRGB */
+
+#ifndef GL_EXT_sRGB_write_control
+#define GL_EXT_sRGB_write_control 1
+#define GL_FRAMEBUFFER_SRGB_EXT           0x8DB9
+#endif /* GL_EXT_sRGB_write_control */
+
+#ifndef GL_EXT_semaphore
+#define GL_EXT_semaphore 1
+#define GL_LAYOUT_GENERAL_EXT             0x958D
+#define GL_LAYOUT_COLOR_ATTACHMENT_EXT    0x958E
+#define GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT 0x958F
+#define GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT 0x9590
+#define GL_LAYOUT_SHADER_READ_ONLY_EXT    0x9591
+#define GL_LAYOUT_TRANSFER_SRC_EXT        0x9592
+#define GL_LAYOUT_TRANSFER_DST_EXT        0x9593
+#define GL_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT 0x9530
+#define GL_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT 0x9531
+typedef void (GL_APIENTRYP PFNGLGENSEMAPHORESEXTPROC) (GLsizei n, GLuint *semaphores);
+typedef void (GL_APIENTRYP PFNGLDELETESEMAPHORESEXTPROC) (GLsizei n, const GLuint *semaphores);
+typedef GLboolean (GL_APIENTRYP PFNGLISSEMAPHOREEXTPROC) (GLuint semaphore);
+typedef void (GL_APIENTRYP PFNGLSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, const GLuint64 *params);
+typedef void (GL_APIENTRYP PFNGLGETSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, GLuint64 *params);
+typedef void (GL_APIENTRYP PFNGLWAITSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *srcLayouts);
+typedef void (GL_APIENTRYP PFNGLSIGNALSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *dstLayouts);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glGenSemaphoresEXT (GLsizei n, GLuint *semaphores);
+GL_APICALL void GL_APIENTRY glDeleteSemaphoresEXT (GLsizei n, const GLuint *semaphores);
+GL_APICALL GLboolean GL_APIENTRY glIsSemaphoreEXT (GLuint semaphore);
+GL_APICALL void GL_APIENTRY glSemaphoreParameterui64vEXT (GLuint semaphore, GLenum pname, const GLuint64 *params);
+GL_APICALL void GL_APIENTRY glGetSemaphoreParameterui64vEXT (GLuint semaphore, GLenum pname, GLuint64 *params);
+GL_APICALL void GL_APIENTRY glWaitSemaphoreEXT (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *srcLayouts);
+GL_APICALL void GL_APIENTRY glSignalSemaphoreEXT (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *dstLayouts);
+#endif
+#endif /* GL_EXT_semaphore */
+
+#ifndef GL_EXT_semaphore_fd
+#define GL_EXT_semaphore_fd 1
+typedef void (GL_APIENTRYP PFNGLIMPORTSEMAPHOREFDEXTPROC) (GLuint semaphore, GLenum handleType, GLint fd);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glImportSemaphoreFdEXT (GLuint semaphore, GLenum handleType, GLint fd);
+#endif
+#endif /* GL_EXT_semaphore_fd */
+
+#ifndef GL_EXT_semaphore_win32
+#define GL_EXT_semaphore_win32 1
+#define GL_HANDLE_TYPE_D3D12_FENCE_EXT    0x9594
+#define GL_D3D12_FENCE_VALUE_EXT          0x9595
+typedef void (GL_APIENTRYP PFNGLIMPORTSEMAPHOREWIN32HANDLEEXTPROC) (GLuint semaphore, GLenum handleType, void *handle);
+typedef void (GL_APIENTRYP PFNGLIMPORTSEMAPHOREWIN32NAMEEXTPROC) (GLuint semaphore, GLenum handleType, const void *name);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glImportSemaphoreWin32HandleEXT (GLuint semaphore, GLenum handleType, void *handle);
+GL_APICALL void GL_APIENTRY glImportSemaphoreWin32NameEXT (GLuint semaphore, GLenum handleType, const void *name);
+#endif
+#endif /* GL_EXT_semaphore_win32 */
+
+#ifndef GL_EXT_separate_shader_objects
+#define GL_EXT_separate_shader_objects 1
+#define GL_ACTIVE_PROGRAM_EXT             0x8259
+#define GL_VERTEX_SHADER_BIT_EXT          0x00000001
+#define GL_FRAGMENT_SHADER_BIT_EXT        0x00000002
+#define GL_ALL_SHADER_BITS_EXT            0xFFFFFFFF
+#define GL_PROGRAM_SEPARABLE_EXT          0x8258
+#define GL_PROGRAM_PIPELINE_BINDING_EXT   0x825A
+typedef void (GL_APIENTRYP PFNGLACTIVESHADERPROGRAMEXTPROC) (GLuint pipeline, GLuint program);
+typedef void (GL_APIENTRYP PFNGLBINDPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
+typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROGRAMVEXTPROC) (GLenum type, GLsizei count, const GLchar **strings);
+typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPIPELINESEXTPROC) (GLsizei n, const GLuint *pipelines);
+typedef void (GL_APIENTRYP PFNGLGENPROGRAMPIPELINESEXTPROC) (GLsizei n, GLuint *pipelines);
+typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEIVEXTPROC) (GLuint pipeline, GLenum pname, GLint *params);
+typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
+typedef void (GL_APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUSEPROGRAMSTAGESEXTPROC) (GLuint pipeline, GLbitfield stages, GLuint program);
+typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glActiveShaderProgramEXT (GLuint pipeline, GLuint program);
+GL_APICALL void GL_APIENTRY glBindProgramPipelineEXT (GLuint pipeline);
+GL_APICALL GLuint GL_APIENTRY glCreateShaderProgramvEXT (GLenum type, GLsizei count, const GLchar **strings);
+GL_APICALL void GL_APIENTRY glDeleteProgramPipelinesEXT (GLsizei n, const GLuint *pipelines);
+GL_APICALL void GL_APIENTRY glGenProgramPipelinesEXT (GLsizei n, GLuint *pipelines);
+GL_APICALL void GL_APIENTRY glGetProgramPipelineInfoLogEXT (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GL_APICALL void GL_APIENTRY glGetProgramPipelineivEXT (GLuint pipeline, GLenum pname, GLint *params);
+GL_APICALL GLboolean GL_APIENTRY glIsProgramPipelineEXT (GLuint pipeline);
+GL_APICALL void GL_APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value);
+GL_APICALL void GL_APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat v0);
+GL_APICALL void GL_APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint v0);
+GL_APICALL void GL_APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1);
+GL_APICALL void GL_APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint v0, GLint v1);
+GL_APICALL void GL_APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GL_APICALL void GL_APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+GL_APICALL void GL_APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GL_APICALL void GL_APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GL_APICALL void GL_APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUseProgramStagesEXT (GLuint pipeline, GLbitfield stages, GLuint program);
+GL_APICALL void GL_APIENTRY glValidateProgramPipelineEXT (GLuint pipeline);
+GL_APICALL void GL_APIENTRY glProgramUniform1uiEXT (GLuint program, GLint location, GLuint v0);
+GL_APICALL void GL_APIENTRY glProgramUniform2uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1);
+GL_APICALL void GL_APIENTRY glProgramUniform3uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+GL_APICALL void GL_APIENTRY glProgramUniform4uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+GL_APICALL void GL_APIENTRY glProgramUniform1uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform2uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform3uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform4uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+#endif
+#endif /* GL_EXT_separate_shader_objects */
+
+#ifndef GL_EXT_shader_framebuffer_fetch
+#define GL_EXT_shader_framebuffer_fetch 1
+#define GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT 0x8A52
+#endif /* GL_EXT_shader_framebuffer_fetch */
+
+#ifndef GL_EXT_shader_framebuffer_fetch_non_coherent
+#define GL_EXT_shader_framebuffer_fetch_non_coherent 1
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERFETCHBARRIEREXTPROC) (void);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glFramebufferFetchBarrierEXT (void);
+#endif
+#endif /* GL_EXT_shader_framebuffer_fetch_non_coherent */
+
+#ifndef GL_EXT_shader_group_vote
+#define GL_EXT_shader_group_vote 1
+#endif /* GL_EXT_shader_group_vote */
+
+#ifndef GL_EXT_shader_implicit_conversions
+#define GL_EXT_shader_implicit_conversions 1
+#endif /* GL_EXT_shader_implicit_conversions */
+
+#ifndef GL_EXT_shader_integer_mix
+#define GL_EXT_shader_integer_mix 1
+#endif /* GL_EXT_shader_integer_mix */
+
+#ifndef GL_EXT_shader_io_blocks
+#define GL_EXT_shader_io_blocks 1
+#endif /* GL_EXT_shader_io_blocks */
+
+#ifndef GL_EXT_shader_non_constant_global_initializers
+#define GL_EXT_shader_non_constant_global_initializers 1
+#endif /* GL_EXT_shader_non_constant_global_initializers */
+
+#ifndef GL_EXT_shader_pixel_local_storage
+#define GL_EXT_shader_pixel_local_storage 1
+#define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_FAST_SIZE_EXT 0x8F63
+#define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_SIZE_EXT 0x8F67
+#define GL_SHADER_PIXEL_LOCAL_STORAGE_EXT 0x8F64
+#endif /* GL_EXT_shader_pixel_local_storage */
+
+#ifndef GL_EXT_shader_pixel_local_storage2
+#define GL_EXT_shader_pixel_local_storage2 1
+#define GL_MAX_SHADER_COMBINED_LOCAL_STORAGE_FAST_SIZE_EXT 0x9650
+#define GL_MAX_SHADER_COMBINED_LOCAL_STORAGE_SIZE_EXT 0x9651
+#define GL_FRAMEBUFFER_INCOMPLETE_INSUFFICIENT_SHADER_COMBINED_LOCAL_STORAGE_EXT 0x9652
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC) (GLuint target, GLsizei size);
+typedef GLsizei (GL_APIENTRYP PFNGLGETFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC) (GLuint target);
+typedef void (GL_APIENTRYP PFNGLCLEARPIXELLOCALSTORAGEUIEXTPROC) (GLsizei offset, GLsizei n, const GLuint *values);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glFramebufferPixelLocalStorageSizeEXT (GLuint target, GLsizei size);
+GL_APICALL GLsizei GL_APIENTRY glGetFramebufferPixelLocalStorageSizeEXT (GLuint target);
+GL_APICALL void GL_APIENTRY glClearPixelLocalStorageuiEXT (GLsizei offset, GLsizei n, const GLuint *values);
+#endif
+#endif /* GL_EXT_shader_pixel_local_storage2 */
+
+#ifndef GL_EXT_shader_texture_lod
+#define GL_EXT_shader_texture_lod 1
+#endif /* GL_EXT_shader_texture_lod */
+
+#ifndef GL_EXT_shadow_samplers
+#define GL_EXT_shadow_samplers 1
+#define GL_TEXTURE_COMPARE_MODE_EXT       0x884C
+#define GL_TEXTURE_COMPARE_FUNC_EXT       0x884D
+#define GL_COMPARE_REF_TO_TEXTURE_EXT     0x884E
+#define GL_SAMPLER_2D_SHADOW_EXT          0x8B62
+#endif /* GL_EXT_shadow_samplers */
+
+#ifndef GL_EXT_sparse_texture
+#define GL_EXT_sparse_texture 1
+#define GL_TEXTURE_SPARSE_EXT             0x91A6
+#define GL_VIRTUAL_PAGE_SIZE_INDEX_EXT    0x91A7
+#define GL_NUM_SPARSE_LEVELS_EXT          0x91AA
+#define GL_NUM_VIRTUAL_PAGE_SIZES_EXT     0x91A8
+#define GL_VIRTUAL_PAGE_SIZE_X_EXT        0x9195
+#define GL_VIRTUAL_PAGE_SIZE_Y_EXT        0x9196
+#define GL_VIRTUAL_PAGE_SIZE_Z_EXT        0x9197
+#define GL_TEXTURE_2D_ARRAY               0x8C1A
+#define GL_TEXTURE_3D                     0x806F
+#define GL_MAX_SPARSE_TEXTURE_SIZE_EXT    0x9198
+#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_EXT 0x9199
+#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_EXT 0x919A
+#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_EXT 0x91A9
+typedef void (GL_APIENTRYP PFNGLTEXPAGECOMMITMENTEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glTexPageCommitmentEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit);
+#endif
+#endif /* GL_EXT_sparse_texture */
+
+#ifndef GL_EXT_sparse_texture2
+#define GL_EXT_sparse_texture2 1
+#endif /* GL_EXT_sparse_texture2 */
+
+#ifndef GL_EXT_tessellation_point_size
+#define GL_EXT_tessellation_point_size 1
+#endif /* GL_EXT_tessellation_point_size */
+
+#ifndef GL_EXT_tessellation_shader
+#define GL_EXT_tessellation_shader 1
+#define GL_PATCHES_EXT                    0x000E
+#define GL_PATCH_VERTICES_EXT             0x8E72
+#define GL_TESS_CONTROL_OUTPUT_VERTICES_EXT 0x8E75
+#define GL_TESS_GEN_MODE_EXT              0x8E76
+#define GL_TESS_GEN_SPACING_EXT           0x8E77
+#define GL_TESS_GEN_VERTEX_ORDER_EXT      0x8E78
+#define GL_TESS_GEN_POINT_MODE_EXT        0x8E79
+#define GL_ISOLINES_EXT                   0x8E7A
+#define GL_QUADS_EXT                      0x0007
+#define GL_FRACTIONAL_ODD_EXT             0x8E7B
+#define GL_FRACTIONAL_EVEN_EXT            0x8E7C
+#define GL_MAX_PATCH_VERTICES_EXT         0x8E7D
+#define GL_MAX_TESS_GEN_LEVEL_EXT         0x8E7E
+#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS_EXT 0x8E7F
+#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT 0x8E80
+#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS_EXT 0x8E81
+#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS_EXT 0x8E82
+#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS_EXT 0x8E83
+#define GL_MAX_TESS_PATCH_COMPONENTS_EXT  0x8E84
+#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS_EXT 0x8E85
+#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS_EXT 0x8E86
+#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS_EXT 0x8E89
+#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS_EXT 0x8E8A
+#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS_EXT 0x886C
+#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS_EXT 0x886D
+#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS_EXT 0x8E1E
+#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT 0x8E1F
+#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS_EXT 0x92CD
+#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS_EXT 0x92CE
+#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS_EXT 0x92D3
+#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS_EXT 0x92D4
+#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS_EXT 0x90CB
+#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS_EXT 0x90CC
+#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS_EXT 0x90D8
+#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS_EXT 0x90D9
+#define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED 0x8221
+#define GL_IS_PER_PATCH_EXT               0x92E7
+#define GL_REFERENCED_BY_TESS_CONTROL_SHADER_EXT 0x9307
+#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER_EXT 0x9308
+#define GL_TESS_CONTROL_SHADER_EXT        0x8E88
+#define GL_TESS_EVALUATION_SHADER_EXT     0x8E87
+#define GL_TESS_CONTROL_SHADER_BIT_EXT    0x00000008
+#define GL_TESS_EVALUATION_SHADER_BIT_EXT 0x00000010
+typedef void (GL_APIENTRYP PFNGLPATCHPARAMETERIEXTPROC) (GLenum pname, GLint value);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glPatchParameteriEXT (GLenum pname, GLint value);
+#endif
+#endif /* GL_EXT_tessellation_shader */
+
+#ifndef GL_EXT_texture_border_clamp
+#define GL_EXT_texture_border_clamp 1
+#define GL_TEXTURE_BORDER_COLOR_EXT       0x1004
+#define GL_CLAMP_TO_BORDER_EXT            0x812D
+typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params);
+typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIIVEXTPROC) (GLuint sampler, GLenum pname, const GLint *param);
+typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIUIVEXTPROC) (GLuint sampler, GLenum pname, const GLuint *param);
+typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIIVEXTPROC) (GLuint sampler, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVEXTPROC) (GLuint sampler, GLenum pname, GLuint *params);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params);
+GL_APICALL void GL_APIENTRY glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params);
+GL_APICALL void GL_APIENTRY glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params);
+GL_APICALL void GL_APIENTRY glSamplerParameterIivEXT (GLuint sampler, GLenum pname, const GLint *param);
+GL_APICALL void GL_APIENTRY glSamplerParameterIuivEXT (GLuint sampler, GLenum pname, const GLuint *param);
+GL_APICALL void GL_APIENTRY glGetSamplerParameterIivEXT (GLuint sampler, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetSamplerParameterIuivEXT (GLuint sampler, GLenum pname, GLuint *params);
+#endif
+#endif /* GL_EXT_texture_border_clamp */
+
+#ifndef GL_EXT_texture_buffer
+#define GL_EXT_texture_buffer 1
+#define GL_TEXTURE_BUFFER_EXT             0x8C2A
+#define GL_TEXTURE_BUFFER_BINDING_EXT     0x8C2A
+#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT    0x8C2B
+#define GL_TEXTURE_BINDING_BUFFER_EXT     0x8C2C
+#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D
+#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT_EXT 0x919F
+#define GL_SAMPLER_BUFFER_EXT             0x8DC2
+#define GL_INT_SAMPLER_BUFFER_EXT         0x8DD0
+#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8
+#define GL_IMAGE_BUFFER_EXT               0x9051
+#define GL_INT_IMAGE_BUFFER_EXT           0x905C
+#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT  0x9067
+#define GL_TEXTURE_BUFFER_OFFSET_EXT      0x919D
+#define GL_TEXTURE_BUFFER_SIZE_EXT        0x919E
+typedef void (GL_APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer);
+typedef void (GL_APIENTRYP PFNGLTEXBUFFERRANGEEXTPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer);
+GL_APICALL void GL_APIENTRY glTexBufferRangeEXT (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
+#endif
+#endif /* GL_EXT_texture_buffer */
+
+#ifndef GL_EXT_texture_compression_astc_decode_mode
+#define GL_EXT_texture_compression_astc_decode_mode 1
+#define GL_TEXTURE_ASTC_DECODE_PRECISION_EXT 0x8F69
+#endif /* GL_EXT_texture_compression_astc_decode_mode */
+
+#ifndef GL_EXT_texture_compression_bptc
+#define GL_EXT_texture_compression_bptc 1
+#define GL_COMPRESSED_RGBA_BPTC_UNORM_EXT 0x8E8C
+#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT 0x8E8D
+#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT 0x8E8E
+#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT 0x8E8F
+#endif /* GL_EXT_texture_compression_bptc */
+
+#ifndef GL_EXT_texture_compression_dxt1
+#define GL_EXT_texture_compression_dxt1 1
+#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT   0x83F0
+#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT  0x83F1
+#endif /* GL_EXT_texture_compression_dxt1 */
+
+#ifndef GL_EXT_texture_compression_rgtc
+#define GL_EXT_texture_compression_rgtc 1
+#define GL_COMPRESSED_RED_RGTC1_EXT       0x8DBB
+#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC
+#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD
+#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE
+#endif /* GL_EXT_texture_compression_rgtc */
+
+#ifndef GL_EXT_texture_compression_s3tc
+#define GL_EXT_texture_compression_s3tc 1
+#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT  0x83F2
+#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT  0x83F3
+#endif /* GL_EXT_texture_compression_s3tc */
+
+#ifndef GL_EXT_texture_compression_s3tc_srgb
+#define GL_EXT_texture_compression_s3tc_srgb 1
+#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT  0x8C4C
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
+#endif /* GL_EXT_texture_compression_s3tc_srgb */
+
+#ifndef GL_EXT_texture_cube_map_array
+#define GL_EXT_texture_cube_map_array 1
+#define GL_TEXTURE_CUBE_MAP_ARRAY_EXT     0x9009
+#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_EXT 0x900A
+#define GL_SAMPLER_CUBE_MAP_ARRAY_EXT     0x900C
+#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_EXT 0x900D
+#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900E
+#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900F
+#define GL_IMAGE_CUBE_MAP_ARRAY_EXT       0x9054
+#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT   0x905F
+#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A
+#endif /* GL_EXT_texture_cube_map_array */
+
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_EXT_texture_filter_anisotropic 1
+#define GL_TEXTURE_MAX_ANISOTROPY_EXT     0x84FE
+#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
+#endif /* GL_EXT_texture_filter_anisotropic */
+
+#ifndef GL_EXT_texture_filter_minmax
+#define GL_EXT_texture_filter_minmax 1
+#define GL_TEXTURE_REDUCTION_MODE_EXT     0x9366
+#define GL_WEIGHTED_AVERAGE_EXT           0x9367
+#endif /* GL_EXT_texture_filter_minmax */
+
+#ifndef GL_EXT_texture_format_BGRA8888
+#define GL_EXT_texture_format_BGRA8888 1
+#endif /* GL_EXT_texture_format_BGRA8888 */
+
+#ifndef GL_EXT_texture_format_sRGB_override
+#define GL_EXT_texture_format_sRGB_override 1
+#define GL_TEXTURE_FORMAT_SRGB_OVERRIDE_EXT 0x8FBF
+#endif /* GL_EXT_texture_format_sRGB_override */
+
+#ifndef GL_EXT_texture_mirror_clamp_to_edge
+#define GL_EXT_texture_mirror_clamp_to_edge 1
+#define GL_MIRROR_CLAMP_TO_EDGE_EXT       0x8743
+#endif /* GL_EXT_texture_mirror_clamp_to_edge */
+
+#ifndef GL_EXT_texture_norm16
+#define GL_EXT_texture_norm16 1
+#define GL_R16_EXT                        0x822A
+#define GL_RG16_EXT                       0x822C
+#define GL_RGBA16_EXT                     0x805B
+#define GL_RGB16_EXT                      0x8054
+#define GL_RGB16_SNORM_EXT                0x8F9A
+#endif /* GL_EXT_texture_norm16 */
+
+#ifndef GL_EXT_texture_query_lod
+#define GL_EXT_texture_query_lod 1
+#endif /* GL_EXT_texture_query_lod */
+
+#ifndef GL_EXT_texture_rg
+#define GL_EXT_texture_rg 1
+#define GL_RED_EXT                        0x1903
+#define GL_RG_EXT                         0x8227
+#define GL_R8_EXT                         0x8229
+#define GL_RG8_EXT                        0x822B
+#endif /* GL_EXT_texture_rg */
+
+#ifndef GL_EXT_texture_sRGB_R8
+#define GL_EXT_texture_sRGB_R8 1
+#define GL_SR8_EXT                        0x8FBD
+#endif /* GL_EXT_texture_sRGB_R8 */
+
+#ifndef GL_EXT_texture_sRGB_RG8
+#define GL_EXT_texture_sRGB_RG8 1
+#define GL_SRG8_EXT                       0x8FBE
+#endif /* GL_EXT_texture_sRGB_RG8 */
+
+#ifndef GL_EXT_texture_sRGB_decode
+#define GL_EXT_texture_sRGB_decode 1
+#define GL_TEXTURE_SRGB_DECODE_EXT        0x8A48
+#define GL_DECODE_EXT                     0x8A49
+#define GL_SKIP_DECODE_EXT                0x8A4A
+#endif /* GL_EXT_texture_sRGB_decode */
+
+#ifndef GL_EXT_texture_shadow_lod
+#define GL_EXT_texture_shadow_lod 1
+#endif /* GL_EXT_texture_shadow_lod */
+
+#ifndef GL_EXT_texture_storage
+#define GL_EXT_texture_storage 1
+#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT   0x912F
+#define GL_ALPHA8_EXT                     0x803C
+#define GL_LUMINANCE8_EXT                 0x8040
+#define GL_LUMINANCE8_ALPHA8_EXT          0x8045
+#define GL_RGBA32F_EXT                    0x8814
+#define GL_RGB32F_EXT                     0x8815
+#define GL_ALPHA32F_EXT                   0x8816
+#define GL_LUMINANCE32F_EXT               0x8818
+#define GL_LUMINANCE_ALPHA32F_EXT         0x8819
+#define GL_ALPHA16F_EXT                   0x881C
+#define GL_LUMINANCE16F_EXT               0x881E
+#define GL_LUMINANCE_ALPHA16F_EXT         0x881F
+#define GL_R32F_EXT                       0x822E
+#define GL_RG32F_EXT                      0x8230
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+GL_APICALL void GL_APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+GL_APICALL void GL_APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+GL_APICALL void GL_APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+#endif
+#endif /* GL_EXT_texture_storage */
+
+#ifndef GL_EXT_texture_storage_compression
+#define GL_EXT_texture_storage_compression 1
+#define GL_NUM_SURFACE_COMPRESSION_FIXED_RATES_EXT 0x8F6E
+#define GL_SURFACE_COMPRESSION_FIXED_RATE_1BPC_EXT 0x96C4
+#define GL_SURFACE_COMPRESSION_FIXED_RATE_2BPC_EXT 0x96C5
+#define GL_SURFACE_COMPRESSION_FIXED_RATE_3BPC_EXT 0x96C6
+#define GL_SURFACE_COMPRESSION_FIXED_RATE_4BPC_EXT 0x96C7
+#define GL_SURFACE_COMPRESSION_FIXED_RATE_5BPC_EXT 0x96C8
+#define GL_SURFACE_COMPRESSION_FIXED_RATE_6BPC_EXT 0x96C9
+#define GL_SURFACE_COMPRESSION_FIXED_RATE_7BPC_EXT 0x96CA
+#define GL_SURFACE_COMPRESSION_FIXED_RATE_8BPC_EXT 0x96CB
+#define GL_SURFACE_COMPRESSION_FIXED_RATE_9BPC_EXT 0x96CC
+#define GL_SURFACE_COMPRESSION_FIXED_RATE_10BPC_EXT 0x96CD
+#define GL_SURFACE_COMPRESSION_FIXED_RATE_11BPC_EXT 0x96CE
+#define GL_SURFACE_COMPRESSION_FIXED_RATE_12BPC_EXT 0x96CF
+typedef void (GL_APIENTRYP PFNTEXSTORAGEATTRIBS2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, const int *attrib_list);
+typedef void (GL_APIENTRYP PFNTEXSTORAGEATTRIBS3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, const int *attrib_list);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY TexStorageAttribs2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, const int *attrib_list);
+GL_APICALL void GL_APIENTRY TexStorageAttribs3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, const int *attrib_list);
+#endif
+#endif /* GL_EXT_texture_storage_compression */
+
+#ifndef GL_EXT_texture_type_2_10_10_10_REV
+#define GL_EXT_texture_type_2_10_10_10_REV 1
+#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368
+#endif /* GL_EXT_texture_type_2_10_10_10_REV */
+
+#ifndef GL_EXT_texture_view
+#define GL_EXT_texture_view 1
+#define GL_TEXTURE_VIEW_MIN_LEVEL_EXT     0x82DB
+#define GL_TEXTURE_VIEW_NUM_LEVELS_EXT    0x82DC
+#define GL_TEXTURE_VIEW_MIN_LAYER_EXT     0x82DD
+#define GL_TEXTURE_VIEW_NUM_LAYERS_EXT    0x82DE
+typedef void (GL_APIENTRYP PFNGLTEXTUREVIEWEXTPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glTextureViewEXT (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers);
+#endif
+#endif /* GL_EXT_texture_view */
+
+#ifndef GL_EXT_unpack_subimage
+#define GL_EXT_unpack_subimage 1
+#define GL_UNPACK_ROW_LENGTH_EXT          0x0CF2
+#define GL_UNPACK_SKIP_ROWS_EXT           0x0CF3
+#define GL_UNPACK_SKIP_PIXELS_EXT         0x0CF4
+#endif /* GL_EXT_unpack_subimage */
+
+#ifndef GL_EXT_win32_keyed_mutex
+#define GL_EXT_win32_keyed_mutex 1
+typedef GLboolean (GL_APIENTRYP PFNGLACQUIREKEYEDMUTEXWIN32EXTPROC) (GLuint memory, GLuint64 key, GLuint timeout);
+typedef GLboolean (GL_APIENTRYP PFNGLRELEASEKEYEDMUTEXWIN32EXTPROC) (GLuint memory, GLuint64 key);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL GLboolean GL_APIENTRY glAcquireKeyedMutexWin32EXT (GLuint memory, GLuint64 key, GLuint timeout);
+GL_APICALL GLboolean GL_APIENTRY glReleaseKeyedMutexWin32EXT (GLuint memory, GLuint64 key);
+#endif
+#endif /* GL_EXT_win32_keyed_mutex */
+
+#ifndef GL_EXT_window_rectangles
+#define GL_EXT_window_rectangles 1
+#define GL_INCLUSIVE_EXT                  0x8F10
+#define GL_EXCLUSIVE_EXT                  0x8F11
+#define GL_WINDOW_RECTANGLE_EXT           0x8F12
+#define GL_WINDOW_RECTANGLE_MODE_EXT      0x8F13
+#define GL_MAX_WINDOW_RECTANGLES_EXT      0x8F14
+#define GL_NUM_WINDOW_RECTANGLES_EXT      0x8F15
+typedef void (GL_APIENTRYP PFNGLWINDOWRECTANGLESEXTPROC) (GLenum mode, GLsizei count, const GLint *box);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glWindowRectanglesEXT (GLenum mode, GLsizei count, const GLint *box);
+#endif
+#endif /* GL_EXT_window_rectangles */
+
+#ifndef GL_FJ_shader_binary_GCCSO
+#define GL_FJ_shader_binary_GCCSO 1
+#define GL_GCCSO_SHADER_BINARY_FJ         0x9260
+#endif /* GL_FJ_shader_binary_GCCSO */
+
+#ifndef GL_IMG_bindless_texture
+#define GL_IMG_bindless_texture 1
+typedef GLuint64 (GL_APIENTRYP PFNGLGETTEXTUREHANDLEIMGPROC) (GLuint texture);
+typedef GLuint64 (GL_APIENTRYP PFNGLGETTEXTURESAMPLERHANDLEIMGPROC) (GLuint texture, GLuint sampler);
+typedef void (GL_APIENTRYP PFNGLUNIFORMHANDLEUI64IMGPROC) (GLint location, GLuint64 value);
+typedef void (GL_APIENTRYP PFNGLUNIFORMHANDLEUI64VIMGPROC) (GLint location, GLsizei count, const GLuint64 *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64IMGPROC) (GLuint program, GLint location, GLuint64 value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VIMGPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL GLuint64 GL_APIENTRY glGetTextureHandleIMG (GLuint texture);
+GL_APICALL GLuint64 GL_APIENTRY glGetTextureSamplerHandleIMG (GLuint texture, GLuint sampler);
+GL_APICALL void GL_APIENTRY glUniformHandleui64IMG (GLint location, GLuint64 value);
+GL_APICALL void GL_APIENTRY glUniformHandleui64vIMG (GLint location, GLsizei count, const GLuint64 *value);
+GL_APICALL void GL_APIENTRY glProgramUniformHandleui64IMG (GLuint program, GLint location, GLuint64 value);
+GL_APICALL void GL_APIENTRY glProgramUniformHandleui64vIMG (GLuint program, GLint location, GLsizei count, const GLuint64 *values);
+#endif
+#endif /* GL_IMG_bindless_texture */
+
+#ifndef GL_IMG_framebuffer_downsample
+#define GL_IMG_framebuffer_downsample 1
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_AND_DOWNSAMPLE_IMG 0x913C
+#define GL_NUM_DOWNSAMPLE_SCALES_IMG      0x913D
+#define GL_DOWNSAMPLE_SCALES_IMG          0x913E
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SCALE_IMG 0x913F
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DDOWNSAMPLEIMGPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint xscale, GLint yscale);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERDOWNSAMPLEIMGPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer, GLint xscale, GLint yscale);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glFramebufferTexture2DDownsampleIMG (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint xscale, GLint yscale);
+GL_APICALL void GL_APIENTRY glFramebufferTextureLayerDownsampleIMG (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer, GLint xscale, GLint yscale);
+#endif
+#endif /* GL_IMG_framebuffer_downsample */
+
+#ifndef GL_IMG_multisampled_render_to_texture
+#define GL_IMG_multisampled_render_to_texture 1
+#define GL_RENDERBUFFER_SAMPLES_IMG       0x9133
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134
+#define GL_MAX_SAMPLES_IMG                0x9135
+#define GL_TEXTURE_SAMPLES_IMG            0x9136
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMGPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+#endif
+#endif /* GL_IMG_multisampled_render_to_texture */
+
+#ifndef GL_IMG_program_binary
+#define GL_IMG_program_binary 1
+#define GL_SGX_PROGRAM_BINARY_IMG         0x9130
+#endif /* GL_IMG_program_binary */
+
+#ifndef GL_IMG_read_format
+#define GL_IMG_read_format 1
+#define GL_BGRA_IMG                       0x80E1
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365
+#endif /* GL_IMG_read_format */
+
+#ifndef GL_IMG_shader_binary
+#define GL_IMG_shader_binary 1
+#define GL_SGX_BINARY_IMG                 0x8C0A
+#endif /* GL_IMG_shader_binary */
+
+#ifndef GL_IMG_texture_compression_pvrtc
+#define GL_IMG_texture_compression_pvrtc 1
+#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00
+#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01
+#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02
+#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03
+#endif /* GL_IMG_texture_compression_pvrtc */
+
+#ifndef GL_IMG_texture_compression_pvrtc2
+#define GL_IMG_texture_compression_pvrtc2 1
+#define GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG 0x9137
+#define GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG 0x9138
+#endif /* GL_IMG_texture_compression_pvrtc2 */
+
+#ifndef GL_IMG_texture_filter_cubic
+#define GL_IMG_texture_filter_cubic 1
+#define GL_CUBIC_IMG                      0x9139
+#define GL_CUBIC_MIPMAP_NEAREST_IMG       0x913A
+#define GL_CUBIC_MIPMAP_LINEAR_IMG        0x913B
+#endif /* GL_IMG_texture_filter_cubic */
+
+#ifndef GL_INTEL_blackhole_render
+#define GL_INTEL_blackhole_render 1
+#define GL_BLACKHOLE_RENDER_INTEL         0x83FC
+#endif /* GL_INTEL_blackhole_render */
+
+#ifndef GL_INTEL_conservative_rasterization
+#define GL_INTEL_conservative_rasterization 1
+#define GL_CONSERVATIVE_RASTERIZATION_INTEL 0x83FE
+#endif /* GL_INTEL_conservative_rasterization */
+
+#ifndef GL_INTEL_framebuffer_CMAA
+#define GL_INTEL_framebuffer_CMAA 1
+typedef void (GL_APIENTRYP PFNGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTELPROC) (void);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glApplyFramebufferAttachmentCMAAINTEL (void);
+#endif
+#endif /* GL_INTEL_framebuffer_CMAA */
+
+#ifndef GL_INTEL_performance_query
+#define GL_INTEL_performance_query 1
+#define GL_PERFQUERY_SINGLE_CONTEXT_INTEL 0x00000000
+#define GL_PERFQUERY_GLOBAL_CONTEXT_INTEL 0x00000001
+#define GL_PERFQUERY_WAIT_INTEL           0x83FB
+#define GL_PERFQUERY_FLUSH_INTEL          0x83FA
+#define GL_PERFQUERY_DONOT_FLUSH_INTEL    0x83F9
+#define GL_PERFQUERY_COUNTER_EVENT_INTEL  0x94F0
+#define GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL 0x94F1
+#define GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL 0x94F2
+#define GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL 0x94F3
+#define GL_PERFQUERY_COUNTER_RAW_INTEL    0x94F4
+#define GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL 0x94F5
+#define GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL 0x94F8
+#define GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL 0x94F9
+#define GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL 0x94FA
+#define GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL 0x94FB
+#define GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL 0x94FC
+#define GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL 0x94FD
+#define GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL 0x94FE
+#define GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL 0x94FF
+#define GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL 0x9500
+typedef void (GL_APIENTRYP PFNGLBEGINPERFQUERYINTELPROC) (GLuint queryHandle);
+typedef void (GL_APIENTRYP PFNGLCREATEPERFQUERYINTELPROC) (GLuint queryId, GLuint *queryHandle);
+typedef void (GL_APIENTRYP PFNGLDELETEPERFQUERYINTELPROC) (GLuint queryHandle);
+typedef void (GL_APIENTRYP PFNGLENDPERFQUERYINTELPROC) (GLuint queryHandle);
+typedef void (GL_APIENTRYP PFNGLGETFIRSTPERFQUERYIDINTELPROC) (GLuint *queryId);
+typedef void (GL_APIENTRYP PFNGLGETNEXTPERFQUERYIDINTELPROC) (GLuint queryId, GLuint *nextQueryId);
+typedef void (GL_APIENTRYP PFNGLGETPERFCOUNTERINFOINTELPROC) (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue);
+typedef void (GL_APIENTRYP PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, void *data, GLuint *bytesWritten);
+typedef void (GL_APIENTRYP PFNGLGETPERFQUERYIDBYNAMEINTELPROC) (GLchar *queryName, GLuint *queryId);
+typedef void (GL_APIENTRYP PFNGLGETPERFQUERYINFOINTELPROC) (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glBeginPerfQueryINTEL (GLuint queryHandle);
+GL_APICALL void GL_APIENTRY glCreatePerfQueryINTEL (GLuint queryId, GLuint *queryHandle);
+GL_APICALL void GL_APIENTRY glDeletePerfQueryINTEL (GLuint queryHandle);
+GL_APICALL void GL_APIENTRY glEndPerfQueryINTEL (GLuint queryHandle);
+GL_APICALL void GL_APIENTRY glGetFirstPerfQueryIdINTEL (GLuint *queryId);
+GL_APICALL void GL_APIENTRY glGetNextPerfQueryIdINTEL (GLuint queryId, GLuint *nextQueryId);
+GL_APICALL void GL_APIENTRY glGetPerfCounterInfoINTEL (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue);
+GL_APICALL void GL_APIENTRY glGetPerfQueryDataINTEL (GLuint queryHandle, GLuint flags, GLsizei dataSize, void *data, GLuint *bytesWritten);
+GL_APICALL void GL_APIENTRY glGetPerfQueryIdByNameINTEL (GLchar *queryName, GLuint *queryId);
+GL_APICALL void GL_APIENTRY glGetPerfQueryInfoINTEL (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask);
+#endif
+#endif /* GL_INTEL_performance_query */
+
+#ifndef GL_MESA_bgra
+#define GL_MESA_bgra 1
+#define GL_BGR_EXT                        0x80E0
+#endif /* GL_MESA_bgra */
+
+#ifndef GL_MESA_framebuffer_flip_x
+#define GL_MESA_framebuffer_flip_x 1
+#define GL_FRAMEBUFFER_FLIP_X_MESA        0x8BBC
+#endif /* GL_MESA_framebuffer_flip_x */
+
+#ifndef GL_MESA_framebuffer_flip_y
+#define GL_MESA_framebuffer_flip_y 1
+#define GL_FRAMEBUFFER_FLIP_Y_MESA        0x8BBB
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERPARAMETERIMESAPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVMESAPROC) (GLenum target, GLenum pname, GLint *params);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glFramebufferParameteriMESA (GLenum target, GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glGetFramebufferParameterivMESA (GLenum target, GLenum pname, GLint *params);
+#endif
+#endif /* GL_MESA_framebuffer_flip_y */
+
+#ifndef GL_MESA_framebuffer_swap_xy
+#define GL_MESA_framebuffer_swap_xy 1
+#define GL_FRAMEBUFFER_SWAP_XY_MESA       0x8BBD
+#endif /* GL_MESA_framebuffer_swap_xy */
+
+#ifndef GL_MESA_program_binary_formats
+#define GL_MESA_program_binary_formats 1
+#define GL_PROGRAM_BINARY_FORMAT_MESA     0x875F
+#endif /* GL_MESA_program_binary_formats */
+
+#ifndef GL_MESA_shader_integer_functions
+#define GL_MESA_shader_integer_functions 1
+#endif /* GL_MESA_shader_integer_functions */
+
+#ifndef GL_NVX_blend_equation_advanced_multi_draw_buffers
+#define GL_NVX_blend_equation_advanced_multi_draw_buffers 1
+#endif /* GL_NVX_blend_equation_advanced_multi_draw_buffers */
+
+#ifndef GL_NV_bindless_texture
+#define GL_NV_bindless_texture 1
+typedef GLuint64 (GL_APIENTRYP PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture);
+typedef GLuint64 (GL_APIENTRYP PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler);
+typedef void (GL_APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle);
+typedef void (GL_APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle);
+typedef GLuint64 (GL_APIENTRYP PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format);
+typedef void (GL_APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access);
+typedef void (GL_APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle);
+typedef void (GL_APIENTRYP PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value);
+typedef void (GL_APIENTRYP PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64 *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values);
+typedef GLboolean (GL_APIENTRYP PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle);
+typedef GLboolean (GL_APIENTRYP PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL GLuint64 GL_APIENTRY glGetTextureHandleNV (GLuint texture);
+GL_APICALL GLuint64 GL_APIENTRY glGetTextureSamplerHandleNV (GLuint texture, GLuint sampler);
+GL_APICALL void GL_APIENTRY glMakeTextureHandleResidentNV (GLuint64 handle);
+GL_APICALL void GL_APIENTRY glMakeTextureHandleNonResidentNV (GLuint64 handle);
+GL_APICALL GLuint64 GL_APIENTRY glGetImageHandleNV (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format);
+GL_APICALL void GL_APIENTRY glMakeImageHandleResidentNV (GLuint64 handle, GLenum access);
+GL_APICALL void GL_APIENTRY glMakeImageHandleNonResidentNV (GLuint64 handle);
+GL_APICALL void GL_APIENTRY glUniformHandleui64NV (GLint location, GLuint64 value);
+GL_APICALL void GL_APIENTRY glUniformHandleui64vNV (GLint location, GLsizei count, const GLuint64 *value);
+GL_APICALL void GL_APIENTRY glProgramUniformHandleui64NV (GLuint program, GLint location, GLuint64 value);
+GL_APICALL void GL_APIENTRY glProgramUniformHandleui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64 *values);
+GL_APICALL GLboolean GL_APIENTRY glIsTextureHandleResidentNV (GLuint64 handle);
+GL_APICALL GLboolean GL_APIENTRY glIsImageHandleResidentNV (GLuint64 handle);
+#endif
+#endif /* GL_NV_bindless_texture */
+
+#ifndef GL_NV_blend_equation_advanced
+#define GL_NV_blend_equation_advanced 1
+#define GL_BLEND_OVERLAP_NV               0x9281
+#define GL_BLEND_PREMULTIPLIED_SRC_NV     0x9280
+#define GL_BLUE_NV                        0x1905
+#define GL_COLORBURN_NV                   0x929A
+#define GL_COLORDODGE_NV                  0x9299
+#define GL_CONJOINT_NV                    0x9284
+#define GL_CONTRAST_NV                    0x92A1
+#define GL_DARKEN_NV                      0x9297
+#define GL_DIFFERENCE_NV                  0x929E
+#define GL_DISJOINT_NV                    0x9283
+#define GL_DST_ATOP_NV                    0x928F
+#define GL_DST_IN_NV                      0x928B
+#define GL_DST_NV                         0x9287
+#define GL_DST_OUT_NV                     0x928D
+#define GL_DST_OVER_NV                    0x9289
+#define GL_EXCLUSION_NV                   0x92A0
+#define GL_GREEN_NV                       0x1904
+#define GL_HARDLIGHT_NV                   0x929B
+#define GL_HARDMIX_NV                     0x92A9
+#define GL_HSL_COLOR_NV                   0x92AF
+#define GL_HSL_HUE_NV                     0x92AD
+#define GL_HSL_LUMINOSITY_NV              0x92B0
+#define GL_HSL_SATURATION_NV              0x92AE
+#define GL_INVERT_OVG_NV                  0x92B4
+#define GL_INVERT_RGB_NV                  0x92A3
+#define GL_LIGHTEN_NV                     0x9298
+#define GL_LINEARBURN_NV                  0x92A5
+#define GL_LINEARDODGE_NV                 0x92A4
+#define GL_LINEARLIGHT_NV                 0x92A7
+#define GL_MINUS_CLAMPED_NV               0x92B3
+#define GL_MINUS_NV                       0x929F
+#define GL_MULTIPLY_NV                    0x9294
+#define GL_OVERLAY_NV                     0x9296
+#define GL_PINLIGHT_NV                    0x92A8
+#define GL_PLUS_CLAMPED_ALPHA_NV          0x92B2
+#define GL_PLUS_CLAMPED_NV                0x92B1
+#define GL_PLUS_DARKER_NV                 0x9292
+#define GL_PLUS_NV                        0x9291
+#define GL_RED_NV                         0x1903
+#define GL_SCREEN_NV                      0x9295
+#define GL_SOFTLIGHT_NV                   0x929C
+#define GL_SRC_ATOP_NV                    0x928E
+#define GL_SRC_IN_NV                      0x928A
+#define GL_SRC_NV                         0x9286
+#define GL_SRC_OUT_NV                     0x928C
+#define GL_SRC_OVER_NV                    0x9288
+#define GL_UNCORRELATED_NV                0x9282
+#define GL_VIVIDLIGHT_NV                  0x92A6
+#define GL_XOR_NV                         0x1506
+typedef void (GL_APIENTRYP PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value);
+typedef void (GL_APIENTRYP PFNGLBLENDBARRIERNVPROC) (void);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glBlendParameteriNV (GLenum pname, GLint value);
+GL_APICALL void GL_APIENTRY glBlendBarrierNV (void);
+#endif
+#endif /* GL_NV_blend_equation_advanced */
+
+#ifndef GL_NV_blend_equation_advanced_coherent
+#define GL_NV_blend_equation_advanced_coherent 1
+#define GL_BLEND_ADVANCED_COHERENT_NV     0x9285
+#endif /* GL_NV_blend_equation_advanced_coherent */
+
+#ifndef GL_NV_blend_minmax_factor
+#define GL_NV_blend_minmax_factor 1
+#define GL_FACTOR_MIN_AMD                 0x901C
+#define GL_FACTOR_MAX_AMD                 0x901D
+#endif /* GL_NV_blend_minmax_factor */
+
+#ifndef GL_NV_clip_space_w_scaling
+#define GL_NV_clip_space_w_scaling 1
+#define GL_VIEWPORT_POSITION_W_SCALE_NV   0x937C
+#define GL_VIEWPORT_POSITION_W_SCALE_X_COEFF_NV 0x937D
+#define GL_VIEWPORT_POSITION_W_SCALE_Y_COEFF_NV 0x937E
+typedef void (GL_APIENTRYP PFNGLVIEWPORTPOSITIONWSCALENVPROC) (GLuint index, GLfloat xcoeff, GLfloat ycoeff);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glViewportPositionWScaleNV (GLuint index, GLfloat xcoeff, GLfloat ycoeff);
+#endif
+#endif /* GL_NV_clip_space_w_scaling */
+
+#ifndef GL_NV_compute_shader_derivatives
+#define GL_NV_compute_shader_derivatives 1
+#endif /* GL_NV_compute_shader_derivatives */
+
+#ifndef GL_NV_conditional_render
+#define GL_NV_conditional_render 1
+#define GL_QUERY_WAIT_NV                  0x8E13
+#define GL_QUERY_NO_WAIT_NV               0x8E14
+#define GL_QUERY_BY_REGION_WAIT_NV        0x8E15
+#define GL_QUERY_BY_REGION_NO_WAIT_NV     0x8E16
+typedef void (GL_APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode);
+typedef void (GL_APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glBeginConditionalRenderNV (GLuint id, GLenum mode);
+GL_APICALL void GL_APIENTRY glEndConditionalRenderNV (void);
+#endif
+#endif /* GL_NV_conditional_render */
+
+#ifndef GL_NV_conservative_raster
+#define GL_NV_conservative_raster 1
+#define GL_CONSERVATIVE_RASTERIZATION_NV  0x9346
+#define GL_SUBPIXEL_PRECISION_BIAS_X_BITS_NV 0x9347
+#define GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV 0x9348
+#define GL_MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV 0x9349
+typedef void (GL_APIENTRYP PFNGLSUBPIXELPRECISIONBIASNVPROC) (GLuint xbits, GLuint ybits);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glSubpixelPrecisionBiasNV (GLuint xbits, GLuint ybits);
+#endif
+#endif /* GL_NV_conservative_raster */
+
+#ifndef GL_NV_conservative_raster_pre_snap
+#define GL_NV_conservative_raster_pre_snap 1
+#define GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_NV 0x9550
+#endif /* GL_NV_conservative_raster_pre_snap */
+
+#ifndef GL_NV_conservative_raster_pre_snap_triangles
+#define GL_NV_conservative_raster_pre_snap_triangles 1
+#define GL_CONSERVATIVE_RASTER_MODE_NV    0x954D
+#define GL_CONSERVATIVE_RASTER_MODE_POST_SNAP_NV 0x954E
+#define GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV 0x954F
+typedef void (GL_APIENTRYP PFNGLCONSERVATIVERASTERPARAMETERINVPROC) (GLenum pname, GLint param);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glConservativeRasterParameteriNV (GLenum pname, GLint param);
+#endif
+#endif /* GL_NV_conservative_raster_pre_snap_triangles */
+
+#ifndef GL_NV_copy_buffer
+#define GL_NV_copy_buffer 1
+#define GL_COPY_READ_BUFFER_NV            0x8F36
+#define GL_COPY_WRITE_BUFFER_NV           0x8F37
+typedef void (GL_APIENTRYP PFNGLCOPYBUFFERSUBDATANVPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glCopyBufferSubDataNV (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+#endif
+#endif /* GL_NV_copy_buffer */
+
+#ifndef GL_NV_coverage_sample
+#define GL_NV_coverage_sample 1
+#define GL_COVERAGE_COMPONENT_NV          0x8ED0
+#define GL_COVERAGE_COMPONENT4_NV         0x8ED1
+#define GL_COVERAGE_ATTACHMENT_NV         0x8ED2
+#define GL_COVERAGE_BUFFERS_NV            0x8ED3
+#define GL_COVERAGE_SAMPLES_NV            0x8ED4
+#define GL_COVERAGE_ALL_FRAGMENTS_NV      0x8ED5
+#define GL_COVERAGE_EDGE_FRAGMENTS_NV     0x8ED6
+#define GL_COVERAGE_AUTOMATIC_NV          0x8ED7
+#define GL_COVERAGE_BUFFER_BIT_NV         0x00008000
+typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask);
+typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask);
+GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation);
+#endif
+#endif /* GL_NV_coverage_sample */
+
+#ifndef GL_NV_depth_nonlinear
+#define GL_NV_depth_nonlinear 1
+#define GL_DEPTH_COMPONENT16_NONLINEAR_NV 0x8E2C
+#endif /* GL_NV_depth_nonlinear */
+
+#ifndef GL_NV_draw_buffers
+#define GL_NV_draw_buffers 1
+#define GL_MAX_DRAW_BUFFERS_NV            0x8824
+#define GL_DRAW_BUFFER0_NV                0x8825
+#define GL_DRAW_BUFFER1_NV                0x8826
+#define GL_DRAW_BUFFER2_NV                0x8827
+#define GL_DRAW_BUFFER3_NV                0x8828
+#define GL_DRAW_BUFFER4_NV                0x8829
+#define GL_DRAW_BUFFER5_NV                0x882A
+#define GL_DRAW_BUFFER6_NV                0x882B
+#define GL_DRAW_BUFFER7_NV                0x882C
+#define GL_DRAW_BUFFER8_NV                0x882D
+#define GL_DRAW_BUFFER9_NV                0x882E
+#define GL_DRAW_BUFFER10_NV               0x882F
+#define GL_DRAW_BUFFER11_NV               0x8830
+#define GL_DRAW_BUFFER12_NV               0x8831
+#define GL_DRAW_BUFFER13_NV               0x8832
+#define GL_DRAW_BUFFER14_NV               0x8833
+#define GL_DRAW_BUFFER15_NV               0x8834
+#define GL_COLOR_ATTACHMENT0_NV           0x8CE0
+#define GL_COLOR_ATTACHMENT1_NV           0x8CE1
+#define GL_COLOR_ATTACHMENT2_NV           0x8CE2
+#define GL_COLOR_ATTACHMENT3_NV           0x8CE3
+#define GL_COLOR_ATTACHMENT4_NV           0x8CE4
+#define GL_COLOR_ATTACHMENT5_NV           0x8CE5
+#define GL_COLOR_ATTACHMENT6_NV           0x8CE6
+#define GL_COLOR_ATTACHMENT7_NV           0x8CE7
+#define GL_COLOR_ATTACHMENT8_NV           0x8CE8
+#define GL_COLOR_ATTACHMENT9_NV           0x8CE9
+#define GL_COLOR_ATTACHMENT10_NV          0x8CEA
+#define GL_COLOR_ATTACHMENT11_NV          0x8CEB
+#define GL_COLOR_ATTACHMENT12_NV          0x8CEC
+#define GL_COLOR_ATTACHMENT13_NV          0x8CED
+#define GL_COLOR_ATTACHMENT14_NV          0x8CEE
+#define GL_COLOR_ATTACHMENT15_NV          0x8CEF
+typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSNVPROC) (GLsizei n, const GLenum *bufs);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDrawBuffersNV (GLsizei n, const GLenum *bufs);
+#endif
+#endif /* GL_NV_draw_buffers */
+
+#ifndef GL_NV_draw_instanced
+#define GL_NV_draw_instanced 1
+typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDNVPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDNVPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDrawArraysInstancedNV (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+GL_APICALL void GL_APIENTRY glDrawElementsInstancedNV (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
+#endif
+#endif /* GL_NV_draw_instanced */
+
+#ifndef GL_NV_draw_vulkan_image
+#define GL_NV_draw_vulkan_image 1
+typedef void (GL_APIENTRY  *GLVULKANPROCNV)(void);
+typedef void (GL_APIENTRYP PFNGLDRAWVKIMAGENVPROC) (GLuint64 vkImage, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1);
+typedef GLVULKANPROCNV (GL_APIENTRYP PFNGLGETVKPROCADDRNVPROC) (const GLchar *name);
+typedef void (GL_APIENTRYP PFNGLWAITVKSEMAPHORENVPROC) (GLuint64 vkSemaphore);
+typedef void (GL_APIENTRYP PFNGLSIGNALVKSEMAPHORENVPROC) (GLuint64 vkSemaphore);
+typedef void (GL_APIENTRYP PFNGLSIGNALVKFENCENVPROC) (GLuint64 vkFence);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDrawVkImageNV (GLuint64 vkImage, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1);
+GL_APICALL GLVULKANPROCNV GL_APIENTRY glGetVkProcAddrNV (const GLchar *name);
+GL_APICALL void GL_APIENTRY glWaitVkSemaphoreNV (GLuint64 vkSemaphore);
+GL_APICALL void GL_APIENTRY glSignalVkSemaphoreNV (GLuint64 vkSemaphore);
+GL_APICALL void GL_APIENTRY glSignalVkFenceNV (GLuint64 vkFence);
+#endif
+#endif /* GL_NV_draw_vulkan_image */
+
+#ifndef GL_NV_explicit_attrib_location
+#define GL_NV_explicit_attrib_location 1
+#endif /* GL_NV_explicit_attrib_location */
+
+#ifndef GL_NV_fbo_color_attachments
+#define GL_NV_fbo_color_attachments 1
+#define GL_MAX_COLOR_ATTACHMENTS_NV       0x8CDF
+#endif /* GL_NV_fbo_color_attachments */
+
+#ifndef GL_NV_fence
+#define GL_NV_fence 1
+#define GL_ALL_COMPLETED_NV               0x84F2
+#define GL_FENCE_STATUS_NV                0x84F3
+#define GL_FENCE_CONDITION_NV             0x84F4
+typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
+typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
+typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
+typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
+typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
+typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences);
+GL_APICALL void GL_APIENTRY glGenFencesNV (GLsizei n, GLuint *fences);
+GL_APICALL GLboolean GL_APIENTRY glIsFenceNV (GLuint fence);
+GL_APICALL GLboolean GL_APIENTRY glTestFenceNV (GLuint fence);
+GL_APICALL void GL_APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glFinishFenceNV (GLuint fence);
+GL_APICALL void GL_APIENTRY glSetFenceNV (GLuint fence, GLenum condition);
+#endif
+#endif /* GL_NV_fence */
+
+#ifndef GL_NV_fill_rectangle
+#define GL_NV_fill_rectangle 1
+#define GL_FILL_RECTANGLE_NV              0x933C
+#endif /* GL_NV_fill_rectangle */
+
+#ifndef GL_NV_fragment_coverage_to_color
+#define GL_NV_fragment_coverage_to_color 1
+#define GL_FRAGMENT_COVERAGE_TO_COLOR_NV  0x92DD
+#define GL_FRAGMENT_COVERAGE_COLOR_NV     0x92DE
+typedef void (GL_APIENTRYP PFNGLFRAGMENTCOVERAGECOLORNVPROC) (GLuint color);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glFragmentCoverageColorNV (GLuint color);
+#endif
+#endif /* GL_NV_fragment_coverage_to_color */
+
+#ifndef GL_NV_fragment_shader_barycentric
+#define GL_NV_fragment_shader_barycentric 1
+#endif /* GL_NV_fragment_shader_barycentric */
+
+#ifndef GL_NV_fragment_shader_interlock
+#define GL_NV_fragment_shader_interlock 1
+#endif /* GL_NV_fragment_shader_interlock */
+
+#ifndef GL_NV_framebuffer_blit
+#define GL_NV_framebuffer_blit 1
+#define GL_READ_FRAMEBUFFER_NV            0x8CA8
+#define GL_DRAW_FRAMEBUFFER_NV            0x8CA9
+#define GL_DRAW_FRAMEBUFFER_BINDING_NV    0x8CA6
+#define GL_READ_FRAMEBUFFER_BINDING_NV    0x8CAA
+typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERNVPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glBlitFramebufferNV (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#endif
+#endif /* GL_NV_framebuffer_blit */
+
+#ifndef GL_NV_framebuffer_mixed_samples
+#define GL_NV_framebuffer_mixed_samples 1
+#define GL_COVERAGE_MODULATION_TABLE_NV   0x9331
+#define GL_COLOR_SAMPLES_NV               0x8E20
+#define GL_DEPTH_SAMPLES_NV               0x932D
+#define GL_STENCIL_SAMPLES_NV             0x932E
+#define GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV 0x932F
+#define GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV 0x9330
+#define GL_COVERAGE_MODULATION_NV         0x9332
+#define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333
+typedef void (GL_APIENTRYP PFNGLCOVERAGEMODULATIONTABLENVPROC) (GLsizei n, const GLfloat *v);
+typedef void (GL_APIENTRYP PFNGLGETCOVERAGEMODULATIONTABLENVPROC) (GLsizei bufSize, GLfloat *v);
+typedef void (GL_APIENTRYP PFNGLCOVERAGEMODULATIONNVPROC) (GLenum components);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glCoverageModulationTableNV (GLsizei n, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glGetCoverageModulationTableNV (GLsizei bufSize, GLfloat *v);
+GL_APICALL void GL_APIENTRY glCoverageModulationNV (GLenum components);
+#endif
+#endif /* GL_NV_framebuffer_mixed_samples */
+
+#ifndef GL_NV_framebuffer_multisample
+#define GL_NV_framebuffer_multisample 1
+#define GL_RENDERBUFFER_SAMPLES_NV        0x8CAB
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_NV 0x8D56
+#define GL_MAX_SAMPLES_NV                 0x8D57
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleNV (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif
+#endif /* GL_NV_framebuffer_multisample */
+
+#ifndef GL_NV_generate_mipmap_sRGB
+#define GL_NV_generate_mipmap_sRGB 1
+#endif /* GL_NV_generate_mipmap_sRGB */
+
+#ifndef GL_NV_geometry_shader_passthrough
+#define GL_NV_geometry_shader_passthrough 1
+#endif /* GL_NV_geometry_shader_passthrough */
+
+#ifndef GL_NV_gpu_shader5
+#define GL_NV_gpu_shader5 1
+typedef khronos_int64_t GLint64EXT;
+typedef khronos_uint64_t GLuint64EXT;
+#define GL_INT64_NV                       0x140E
+#define GL_UNSIGNED_INT64_NV              0x140F
+#define GL_INT8_NV                        0x8FE0
+#define GL_INT8_VEC2_NV                   0x8FE1
+#define GL_INT8_VEC3_NV                   0x8FE2
+#define GL_INT8_VEC4_NV                   0x8FE3
+#define GL_INT16_NV                       0x8FE4
+#define GL_INT16_VEC2_NV                  0x8FE5
+#define GL_INT16_VEC3_NV                  0x8FE6
+#define GL_INT16_VEC4_NV                  0x8FE7
+#define GL_INT64_VEC2_NV                  0x8FE9
+#define GL_INT64_VEC3_NV                  0x8FEA
+#define GL_INT64_VEC4_NV                  0x8FEB
+#define GL_UNSIGNED_INT8_NV               0x8FEC
+#define GL_UNSIGNED_INT8_VEC2_NV          0x8FED
+#define GL_UNSIGNED_INT8_VEC3_NV          0x8FEE
+#define GL_UNSIGNED_INT8_VEC4_NV          0x8FEF
+#define GL_UNSIGNED_INT16_NV              0x8FF0
+#define GL_UNSIGNED_INT16_VEC2_NV         0x8FF1
+#define GL_UNSIGNED_INT16_VEC3_NV         0x8FF2
+#define GL_UNSIGNED_INT16_VEC4_NV         0x8FF3
+#define GL_UNSIGNED_INT64_VEC2_NV         0x8FF5
+#define GL_UNSIGNED_INT64_VEC3_NV         0x8FF6
+#define GL_UNSIGNED_INT64_VEC4_NV         0x8FF7
+#define GL_FLOAT16_NV                     0x8FF8
+#define GL_FLOAT16_VEC2_NV                0x8FF9
+#define GL_FLOAT16_VEC3_NV                0x8FFA
+#define GL_FLOAT16_VEC4_NV                0x8FFB
+#define GL_PATCHES                        0x000E
+typedef void (GL_APIENTRYP PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x);
+typedef void (GL_APIENTRYP PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y);
+typedef void (GL_APIENTRYP PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+typedef void (GL_APIENTRYP PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+typedef void (GL_APIENTRYP PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x);
+typedef void (GL_APIENTRYP PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y);
+typedef void (GL_APIENTRYP PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+typedef void (GL_APIENTRYP PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+typedef void (GL_APIENTRYP PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (GL_APIENTRYP PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT *params);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glUniform1i64NV (GLint location, GLint64EXT x);
+GL_APICALL void GL_APIENTRY glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y);
+GL_APICALL void GL_APIENTRY glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+GL_APICALL void GL_APIENTRY glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+GL_APICALL void GL_APIENTRY glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
+GL_APICALL void GL_APIENTRY glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
+GL_APICALL void GL_APIENTRY glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
+GL_APICALL void GL_APIENTRY glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
+GL_APICALL void GL_APIENTRY glUniform1ui64NV (GLint location, GLuint64EXT x);
+GL_APICALL void GL_APIENTRY glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y);
+GL_APICALL void GL_APIENTRY glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+GL_APICALL void GL_APIENTRY glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+GL_APICALL void GL_APIENTRY glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
+GL_APICALL void GL_APIENTRY glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
+GL_APICALL void GL_APIENTRY glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
+GL_APICALL void GL_APIENTRY glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
+GL_APICALL void GL_APIENTRY glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT *params);
+GL_APICALL void GL_APIENTRY glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x);
+GL_APICALL void GL_APIENTRY glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y);
+GL_APICALL void GL_APIENTRY glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+GL_APICALL void GL_APIENTRY glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+GL_APICALL void GL_APIENTRY glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+GL_APICALL void GL_APIENTRY glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+GL_APICALL void GL_APIENTRY glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+GL_APICALL void GL_APIENTRY glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+GL_APICALL void GL_APIENTRY glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x);
+GL_APICALL void GL_APIENTRY glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y);
+GL_APICALL void GL_APIENTRY glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+GL_APICALL void GL_APIENTRY glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+GL_APICALL void GL_APIENTRY glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+GL_APICALL void GL_APIENTRY glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+GL_APICALL void GL_APIENTRY glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+GL_APICALL void GL_APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+#endif
+#endif /* GL_NV_gpu_shader5 */
+
+#ifndef GL_NV_image_formats
+#define GL_NV_image_formats 1
+#endif /* GL_NV_image_formats */
+
+#ifndef GL_NV_instanced_arrays
+#define GL_NV_instanced_arrays 1
+#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_NV 0x88FE
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORNVPROC) (GLuint index, GLuint divisor);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glVertexAttribDivisorNV (GLuint index, GLuint divisor);
+#endif
+#endif /* GL_NV_instanced_arrays */
+
+#ifndef GL_NV_internalformat_sample_query
+#define GL_NV_internalformat_sample_query 1
+#define GL_TEXTURE_2D_MULTISAMPLE         0x9100
+#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY   0x9102
+#define GL_MULTISAMPLES_NV                0x9371
+#define GL_SUPERSAMPLE_SCALE_X_NV         0x9372
+#define GL_SUPERSAMPLE_SCALE_Y_NV         0x9373
+#define GL_CONFORMANT_NV                  0x9374
+typedef void (GL_APIENTRYP PFNGLGETINTERNALFORMATSAMPLEIVNVPROC) (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei count, GLint *params);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glGetInternalformatSampleivNV (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei count, GLint *params);
+#endif
+#endif /* GL_NV_internalformat_sample_query */
+
+#ifndef GL_NV_memory_attachment
+#define GL_NV_memory_attachment 1
+#define GL_ATTACHED_MEMORY_OBJECT_NV      0x95A4
+#define GL_ATTACHED_MEMORY_OFFSET_NV      0x95A5
+#define GL_MEMORY_ATTACHABLE_ALIGNMENT_NV 0x95A6
+#define GL_MEMORY_ATTACHABLE_SIZE_NV      0x95A7
+#define GL_MEMORY_ATTACHABLE_NV           0x95A8
+#define GL_DETACHED_MEMORY_INCARNATION_NV 0x95A9
+#define GL_DETACHED_TEXTURES_NV           0x95AA
+#define GL_DETACHED_BUFFERS_NV            0x95AB
+#define GL_MAX_DETACHED_TEXTURES_NV       0x95AC
+#define GL_MAX_DETACHED_BUFFERS_NV        0x95AD
+typedef void (GL_APIENTRYP PFNGLGETMEMORYOBJECTDETACHEDRESOURCESUIVNVPROC) (GLuint memory, GLenum pname, GLint first, GLsizei count, GLuint *params);
+typedef void (GL_APIENTRYP PFNGLRESETMEMORYOBJECTPARAMETERNVPROC) (GLuint memory, GLenum pname);
+typedef void (GL_APIENTRYP PFNGLTEXATTACHMEMORYNVPROC) (GLenum target, GLuint memory, GLuint64 offset);
+typedef void (GL_APIENTRYP PFNGLBUFFERATTACHMEMORYNVPROC) (GLenum target, GLuint memory, GLuint64 offset);
+typedef void (GL_APIENTRYP PFNGLTEXTUREATTACHMEMORYNVPROC) (GLuint texture, GLuint memory, GLuint64 offset);
+typedef void (GL_APIENTRYP PFNGLNAMEDBUFFERATTACHMEMORYNVPROC) (GLuint buffer, GLuint memory, GLuint64 offset);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glGetMemoryObjectDetachedResourcesuivNV (GLuint memory, GLenum pname, GLint first, GLsizei count, GLuint *params);
+GL_APICALL void GL_APIENTRY glResetMemoryObjectParameterNV (GLuint memory, GLenum pname);
+GL_APICALL void GL_APIENTRY glTexAttachMemoryNV (GLenum target, GLuint memory, GLuint64 offset);
+GL_APICALL void GL_APIENTRY glBufferAttachMemoryNV (GLenum target, GLuint memory, GLuint64 offset);
+GL_APICALL void GL_APIENTRY glTextureAttachMemoryNV (GLuint texture, GLuint memory, GLuint64 offset);
+GL_APICALL void GL_APIENTRY glNamedBufferAttachMemoryNV (GLuint buffer, GLuint memory, GLuint64 offset);
+#endif
+#endif /* GL_NV_memory_attachment */
+
+#ifndef GL_NV_memory_object_sparse
+#define GL_NV_memory_object_sparse 1
+typedef void (GL_APIENTRYP PFNGLBUFFERPAGECOMMITMENTMEMNVPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit);
+typedef void (GL_APIENTRYP PFNGLTEXPAGECOMMITMENTMEMNVPROC) (GLenum target, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit);
+typedef void (GL_APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTMEMNVPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit);
+typedef void (GL_APIENTRYP PFNGLTEXTUREPAGECOMMITMENTMEMNVPROC) (GLuint texture, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glBufferPageCommitmentMemNV (GLenum target, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit);
+GL_APICALL void GL_APIENTRY glTexPageCommitmentMemNV (GLenum target, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit);
+GL_APICALL void GL_APIENTRY glNamedBufferPageCommitmentMemNV (GLuint buffer, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit);
+GL_APICALL void GL_APIENTRY glTexturePageCommitmentMemNV (GLuint texture, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit);
+#endif
+#endif /* GL_NV_memory_object_sparse */
+
+#ifndef GL_NV_mesh_shader
+#define GL_NV_mesh_shader 1
+#define GL_MESH_SHADER_NV                 0x9559
+#define GL_TASK_SHADER_NV                 0x955A
+#define GL_MAX_MESH_UNIFORM_BLOCKS_NV     0x8E60
+#define GL_MAX_MESH_TEXTURE_IMAGE_UNITS_NV 0x8E61
+#define GL_MAX_MESH_IMAGE_UNIFORMS_NV     0x8E62
+#define GL_MAX_MESH_UNIFORM_COMPONENTS_NV 0x8E63
+#define GL_MAX_MESH_ATOMIC_COUNTER_BUFFERS_NV 0x8E64
+#define GL_MAX_MESH_ATOMIC_COUNTERS_NV    0x8E65
+#define GL_MAX_MESH_SHADER_STORAGE_BLOCKS_NV 0x8E66
+#define GL_MAX_COMBINED_MESH_UNIFORM_COMPONENTS_NV 0x8E67
+#define GL_MAX_TASK_UNIFORM_BLOCKS_NV     0x8E68
+#define GL_MAX_TASK_TEXTURE_IMAGE_UNITS_NV 0x8E69
+#define GL_MAX_TASK_IMAGE_UNIFORMS_NV     0x8E6A
+#define GL_MAX_TASK_UNIFORM_COMPONENTS_NV 0x8E6B
+#define GL_MAX_TASK_ATOMIC_COUNTER_BUFFERS_NV 0x8E6C
+#define GL_MAX_TASK_ATOMIC_COUNTERS_NV    0x8E6D
+#define GL_MAX_TASK_SHADER_STORAGE_BLOCKS_NV 0x8E6E
+#define GL_MAX_COMBINED_TASK_UNIFORM_COMPONENTS_NV 0x8E6F
+#define GL_MAX_MESH_WORK_GROUP_INVOCATIONS_NV 0x95A2
+#define GL_MAX_TASK_WORK_GROUP_INVOCATIONS_NV 0x95A3
+#define GL_MAX_MESH_TOTAL_MEMORY_SIZE_NV  0x9536
+#define GL_MAX_TASK_TOTAL_MEMORY_SIZE_NV  0x9537
+#define GL_MAX_MESH_OUTPUT_VERTICES_NV    0x9538
+#define GL_MAX_MESH_OUTPUT_PRIMITIVES_NV  0x9539
+#define GL_MAX_TASK_OUTPUT_COUNT_NV       0x953A
+#define GL_MAX_DRAW_MESH_TASKS_COUNT_NV   0x953D
+#define GL_MAX_MESH_VIEWS_NV              0x9557
+#define GL_MESH_OUTPUT_PER_VERTEX_GRANULARITY_NV 0x92DF
+#define GL_MESH_OUTPUT_PER_PRIMITIVE_GRANULARITY_NV 0x9543
+#define GL_MAX_MESH_WORK_GROUP_SIZE_NV    0x953B
+#define GL_MAX_TASK_WORK_GROUP_SIZE_NV    0x953C
+#define GL_MESH_WORK_GROUP_SIZE_NV        0x953E
+#define GL_TASK_WORK_GROUP_SIZE_NV        0x953F
+#define GL_MESH_VERTICES_OUT_NV           0x9579
+#define GL_MESH_PRIMITIVES_OUT_NV         0x957A
+#define GL_MESH_OUTPUT_TYPE_NV            0x957B
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_MESH_SHADER_NV 0x959C
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_TASK_SHADER_NV 0x959D
+#define GL_REFERENCED_BY_MESH_SHADER_NV   0x95A0
+#define GL_REFERENCED_BY_TASK_SHADER_NV   0x95A1
+#define GL_MESH_SHADER_BIT_NV             0x00000040
+#define GL_TASK_SHADER_BIT_NV             0x00000080
+#define GL_MESH_SUBROUTINE_NV             0x957C
+#define GL_TASK_SUBROUTINE_NV             0x957D
+#define GL_MESH_SUBROUTINE_UNIFORM_NV     0x957E
+#define GL_TASK_SUBROUTINE_UNIFORM_NV     0x957F
+#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_NV 0x959E
+#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_NV 0x959F
+typedef void (GL_APIENTRYP PFNGLDRAWMESHTASKSNVPROC) (GLuint first, GLuint count);
+typedef void (GL_APIENTRYP PFNGLDRAWMESHTASKSINDIRECTNVPROC) (GLintptr indirect);
+typedef void (GL_APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTNVPROC) (GLintptr indirect, GLsizei drawcount, GLsizei stride);
+typedef void (GL_APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTCOUNTNVPROC) (GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDrawMeshTasksNV (GLuint first, GLuint count);
+GL_APICALL void GL_APIENTRY glDrawMeshTasksIndirectNV (GLintptr indirect);
+GL_APICALL void GL_APIENTRY glMultiDrawMeshTasksIndirectNV (GLintptr indirect, GLsizei drawcount, GLsizei stride);
+GL_APICALL void GL_APIENTRY glMultiDrawMeshTasksIndirectCountNV (GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
+#endif
+#endif /* GL_NV_mesh_shader */
+
+#ifndef GL_NV_non_square_matrices
+#define GL_NV_non_square_matrices 1
+#define GL_FLOAT_MAT2x3_NV                0x8B65
+#define GL_FLOAT_MAT2x4_NV                0x8B66
+#define GL_FLOAT_MAT3x2_NV                0x8B67
+#define GL_FLOAT_MAT3x4_NV                0x8B68
+#define GL_FLOAT_MAT4x2_NV                0x8B69
+#define GL_FLOAT_MAT4x3_NV                0x8B6A
+typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2X3FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3X2FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2X4FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4X2FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3X4FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4X3FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glUniformMatrix2x3fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix3x2fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix2x4fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix4x2fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix3x4fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix4x3fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+#endif
+#endif /* GL_NV_non_square_matrices */
+
+#ifndef GL_NV_path_rendering
+#define GL_NV_path_rendering 1
+typedef double GLdouble;
+#define GL_PATH_FORMAT_SVG_NV             0x9070
+#define GL_PATH_FORMAT_PS_NV              0x9071
+#define GL_STANDARD_FONT_NAME_NV          0x9072
+#define GL_SYSTEM_FONT_NAME_NV            0x9073
+#define GL_FILE_NAME_NV                   0x9074
+#define GL_PATH_STROKE_WIDTH_NV           0x9075
+#define GL_PATH_END_CAPS_NV               0x9076
+#define GL_PATH_INITIAL_END_CAP_NV        0x9077
+#define GL_PATH_TERMINAL_END_CAP_NV       0x9078
+#define GL_PATH_JOIN_STYLE_NV             0x9079
+#define GL_PATH_MITER_LIMIT_NV            0x907A
+#define GL_PATH_DASH_CAPS_NV              0x907B
+#define GL_PATH_INITIAL_DASH_CAP_NV       0x907C
+#define GL_PATH_TERMINAL_DASH_CAP_NV      0x907D
+#define GL_PATH_DASH_OFFSET_NV            0x907E
+#define GL_PATH_CLIENT_LENGTH_NV          0x907F
+#define GL_PATH_FILL_MODE_NV              0x9080
+#define GL_PATH_FILL_MASK_NV              0x9081
+#define GL_PATH_FILL_COVER_MODE_NV        0x9082
+#define GL_PATH_STROKE_COVER_MODE_NV      0x9083
+#define GL_PATH_STROKE_MASK_NV            0x9084
+#define GL_COUNT_UP_NV                    0x9088
+#define GL_COUNT_DOWN_NV                  0x9089
+#define GL_PATH_OBJECT_BOUNDING_BOX_NV    0x908A
+#define GL_CONVEX_HULL_NV                 0x908B
+#define GL_BOUNDING_BOX_NV                0x908D
+#define GL_TRANSLATE_X_NV                 0x908E
+#define GL_TRANSLATE_Y_NV                 0x908F
+#define GL_TRANSLATE_2D_NV                0x9090
+#define GL_TRANSLATE_3D_NV                0x9091
+#define GL_AFFINE_2D_NV                   0x9092
+#define GL_AFFINE_3D_NV                   0x9094
+#define GL_TRANSPOSE_AFFINE_2D_NV         0x9096
+#define GL_TRANSPOSE_AFFINE_3D_NV         0x9098
+#define GL_UTF8_NV                        0x909A
+#define GL_UTF16_NV                       0x909B
+#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C
+#define GL_PATH_COMMAND_COUNT_NV          0x909D
+#define GL_PATH_COORD_COUNT_NV            0x909E
+#define GL_PATH_DASH_ARRAY_COUNT_NV       0x909F
+#define GL_PATH_COMPUTED_LENGTH_NV        0x90A0
+#define GL_PATH_FILL_BOUNDING_BOX_NV      0x90A1
+#define GL_PATH_STROKE_BOUNDING_BOX_NV    0x90A2
+#define GL_SQUARE_NV                      0x90A3
+#define GL_ROUND_NV                       0x90A4
+#define GL_TRIANGULAR_NV                  0x90A5
+#define GL_BEVEL_NV                       0x90A6
+#define GL_MITER_REVERT_NV                0x90A7
+#define GL_MITER_TRUNCATE_NV              0x90A8
+#define GL_SKIP_MISSING_GLYPH_NV          0x90A9
+#define GL_USE_MISSING_GLYPH_NV           0x90AA
+#define GL_PATH_ERROR_POSITION_NV         0x90AB
+#define GL_ACCUM_ADJACENT_PAIRS_NV        0x90AD
+#define GL_ADJACENT_PAIRS_NV              0x90AE
+#define GL_FIRST_TO_REST_NV               0x90AF
+#define GL_PATH_GEN_MODE_NV               0x90B0
+#define GL_PATH_GEN_COEFF_NV              0x90B1
+#define GL_PATH_GEN_COMPONENTS_NV         0x90B3
+#define GL_PATH_STENCIL_FUNC_NV           0x90B7
+#define GL_PATH_STENCIL_REF_NV            0x90B8
+#define GL_PATH_STENCIL_VALUE_MASK_NV     0x90B9
+#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD
+#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE
+#define GL_PATH_COVER_DEPTH_FUNC_NV       0x90BF
+#define GL_PATH_DASH_OFFSET_RESET_NV      0x90B4
+#define GL_MOVE_TO_RESETS_NV              0x90B5
+#define GL_MOVE_TO_CONTINUES_NV           0x90B6
+#define GL_CLOSE_PATH_NV                  0x00
+#define GL_MOVE_TO_NV                     0x02
+#define GL_RELATIVE_MOVE_TO_NV            0x03
+#define GL_LINE_TO_NV                     0x04
+#define GL_RELATIVE_LINE_TO_NV            0x05
+#define GL_HORIZONTAL_LINE_TO_NV          0x06
+#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07
+#define GL_VERTICAL_LINE_TO_NV            0x08
+#define GL_RELATIVE_VERTICAL_LINE_TO_NV   0x09
+#define GL_QUADRATIC_CURVE_TO_NV          0x0A
+#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B
+#define GL_CUBIC_CURVE_TO_NV              0x0C
+#define GL_RELATIVE_CUBIC_CURVE_TO_NV     0x0D
+#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV   0x0E
+#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F
+#define GL_SMOOTH_CUBIC_CURVE_TO_NV       0x10
+#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11
+#define GL_SMALL_CCW_ARC_TO_NV            0x12
+#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV   0x13
+#define GL_SMALL_CW_ARC_TO_NV             0x14
+#define GL_RELATIVE_SMALL_CW_ARC_TO_NV    0x15
+#define GL_LARGE_CCW_ARC_TO_NV            0x16
+#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV   0x17
+#define GL_LARGE_CW_ARC_TO_NV             0x18
+#define GL_RELATIVE_LARGE_CW_ARC_TO_NV    0x19
+#define GL_RESTART_PATH_NV                0xF0
+#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV    0xF2
+#define GL_DUP_LAST_CUBIC_CURVE_TO_NV     0xF4
+#define GL_RECT_NV                        0xF6
+#define GL_CIRCULAR_CCW_ARC_TO_NV         0xF8
+#define GL_CIRCULAR_CW_ARC_TO_NV          0xFA
+#define GL_CIRCULAR_TANGENT_ARC_TO_NV     0xFC
+#define GL_ARC_TO_NV                      0xFE
+#define GL_RELATIVE_ARC_TO_NV             0xFF
+#define GL_BOLD_BIT_NV                    0x01
+#define GL_ITALIC_BIT_NV                  0x02
+#define GL_GLYPH_WIDTH_BIT_NV             0x01
+#define GL_GLYPH_HEIGHT_BIT_NV            0x02
+#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04
+#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08
+#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10
+#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20
+#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40
+#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80
+#define GL_GLYPH_HAS_KERNING_BIT_NV       0x100
+#define GL_FONT_X_MIN_BOUNDS_BIT_NV       0x00010000
+#define GL_FONT_Y_MIN_BOUNDS_BIT_NV       0x00020000
+#define GL_FONT_X_MAX_BOUNDS_BIT_NV       0x00040000
+#define GL_FONT_Y_MAX_BOUNDS_BIT_NV       0x00080000
+#define GL_FONT_UNITS_PER_EM_BIT_NV       0x00100000
+#define GL_FONT_ASCENDER_BIT_NV           0x00200000
+#define GL_FONT_DESCENDER_BIT_NV          0x00400000
+#define GL_FONT_HEIGHT_BIT_NV             0x00800000
+#define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV  0x01000000
+#define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000
+#define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000
+#define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000
+#define GL_FONT_HAS_KERNING_BIT_NV        0x10000000
+#define GL_ROUNDED_RECT_NV                0xE8
+#define GL_RELATIVE_ROUNDED_RECT_NV       0xE9
+#define GL_ROUNDED_RECT2_NV               0xEA
+#define GL_RELATIVE_ROUNDED_RECT2_NV      0xEB
+#define GL_ROUNDED_RECT4_NV               0xEC
+#define GL_RELATIVE_ROUNDED_RECT4_NV      0xED
+#define GL_ROUNDED_RECT8_NV               0xEE
+#define GL_RELATIVE_ROUNDED_RECT8_NV      0xEF
+#define GL_RELATIVE_RECT_NV               0xF7
+#define GL_FONT_GLYPHS_AVAILABLE_NV       0x9368
+#define GL_FONT_TARGET_UNAVAILABLE_NV     0x9369
+#define GL_FONT_UNAVAILABLE_NV            0x936A
+#define GL_FONT_UNINTELLIGIBLE_NV         0x936B
+#define GL_CONIC_CURVE_TO_NV              0x1A
+#define GL_RELATIVE_CONIC_CURVE_TO_NV     0x1B
+#define GL_FONT_NUM_GLYPH_INDICES_BIT_NV  0x20000000
+#define GL_STANDARD_FONT_FORMAT_NV        0x936C
+#define GL_PATH_PROJECTION_NV             0x1701
+#define GL_PATH_MODELVIEW_NV              0x1700
+#define GL_PATH_MODELVIEW_STACK_DEPTH_NV  0x0BA3
+#define GL_PATH_MODELVIEW_MATRIX_NV       0x0BA6
+#define GL_PATH_MAX_MODELVIEW_STACK_DEPTH_NV 0x0D36
+#define GL_PATH_TRANSPOSE_MODELVIEW_MATRIX_NV 0x84E3
+#define GL_PATH_PROJECTION_STACK_DEPTH_NV 0x0BA4
+#define GL_PATH_PROJECTION_MATRIX_NV      0x0BA7
+#define GL_PATH_MAX_PROJECTION_STACK_DEPTH_NV 0x0D38
+#define GL_PATH_TRANSPOSE_PROJECTION_MATRIX_NV 0x84E4
+#define GL_FRAGMENT_INPUT_NV              0x936D
+typedef GLuint (GL_APIENTRYP PFNGLGENPATHSNVPROC) (GLsizei range);
+typedef void (GL_APIENTRYP PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range);
+typedef GLboolean (GL_APIENTRYP PFNGLISPATHNVPROC) (GLuint path);
+typedef void (GL_APIENTRYP PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords);
+typedef void (GL_APIENTRYP PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords);
+typedef void (GL_APIENTRYP PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords);
+typedef void (GL_APIENTRYP PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords);
+typedef void (GL_APIENTRYP PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void *pathString);
+typedef void (GL_APIENTRYP PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
+typedef void (GL_APIENTRYP PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
+typedef void (GL_APIENTRYP PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights);
+typedef void (GL_APIENTRYP PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath);
+typedef void (GL_APIENTRYP PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight);
+typedef void (GL_APIENTRYP PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues);
+typedef void (GL_APIENTRYP PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value);
+typedef void (GL_APIENTRYP PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value);
+typedef void (GL_APIENTRYP PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat *dashArray);
+typedef void (GL_APIENTRYP PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask);
+typedef void (GL_APIENTRYP PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units);
+typedef void (GL_APIENTRYP PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask);
+typedef void (GL_APIENTRYP PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask);
+typedef void (GL_APIENTRYP PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues);
+typedef void (GL_APIENTRYP PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues);
+typedef void (GL_APIENTRYP PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum func);
+typedef void (GL_APIENTRYP PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode);
+typedef void (GL_APIENTRYP PFNGLCOVERSTROKEPATHNVPROC) (GLuint path, GLenum coverMode);
+typedef void (GL_APIENTRYP PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
+typedef void (GL_APIENTRYP PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
+typedef void (GL_APIENTRYP PFNGLGETPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, GLint *value);
+typedef void (GL_APIENTRYP PFNGLGETPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLGETPATHCOMMANDSNVPROC) (GLuint path, GLubyte *commands);
+typedef void (GL_APIENTRYP PFNGLGETPATHCOORDSNVPROC) (GLuint path, GLfloat *coords);
+typedef void (GL_APIENTRYP PFNGLGETPATHDASHARRAYNVPROC) (GLuint path, GLfloat *dashArray);
+typedef void (GL_APIENTRYP PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics);
+typedef void (GL_APIENTRYP PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics);
+typedef void (GL_APIENTRYP PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing);
+typedef GLboolean (GL_APIENTRYP PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y);
+typedef GLboolean (GL_APIENTRYP PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y);
+typedef GLfloat (GL_APIENTRYP PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments);
+typedef GLboolean (GL_APIENTRYP PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY);
+typedef void (GL_APIENTRYP PFNGLMATRIXLOAD3X2FNVPROC) (GLenum matrixMode, const GLfloat *m);
+typedef void (GL_APIENTRYP PFNGLMATRIXLOAD3X3FNVPROC) (GLenum matrixMode, const GLfloat *m);
+typedef void (GL_APIENTRYP PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat *m);
+typedef void (GL_APIENTRYP PFNGLMATRIXMULT3X2FNVPROC) (GLenum matrixMode, const GLfloat *m);
+typedef void (GL_APIENTRYP PFNGLMATRIXMULT3X3FNVPROC) (GLenum matrixMode, const GLfloat *m);
+typedef void (GL_APIENTRYP PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat *m);
+typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode);
+typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask, GLenum coverMode);
+typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
+typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
+typedef GLenum (GL_APIENTRYP PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint *baseAndCount);
+typedef GLenum (GL_APIENTRYP PFNGLPATHGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
+typedef GLenum (GL_APIENTRYP PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
+typedef void (GL_APIENTRYP PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC) (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs);
+typedef void (GL_APIENTRYP PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+typedef void (GL_APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode);
+typedef void (GL_APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m);
+typedef void (GL_APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m);
+typedef void (GL_APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat *m);
+typedef void (GL_APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble *m);
+typedef void (GL_APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m);
+typedef void (GL_APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m);
+typedef void (GL_APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat *m);
+typedef void (GL_APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble *m);
+typedef void (GL_APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+typedef void (GL_APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode);
+typedef void (GL_APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode);
+typedef void (GL_APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+typedef void (GL_APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
+typedef void (GL_APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
+typedef void (GL_APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
+typedef void (GL_APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
+typedef void (GL_APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL GLuint GL_APIENTRY glGenPathsNV (GLsizei range);
+GL_APICALL void GL_APIENTRY glDeletePathsNV (GLuint path, GLsizei range);
+GL_APICALL GLboolean GL_APIENTRY glIsPathNV (GLuint path);
+GL_APICALL void GL_APIENTRY glPathCommandsNV (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords);
+GL_APICALL void GL_APIENTRY glPathCoordsNV (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords);
+GL_APICALL void GL_APIENTRY glPathSubCommandsNV (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords);
+GL_APICALL void GL_APIENTRY glPathSubCoordsNV (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords);
+GL_APICALL void GL_APIENTRY glPathStringNV (GLuint path, GLenum format, GLsizei length, const void *pathString);
+GL_APICALL void GL_APIENTRY glPathGlyphsNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
+GL_APICALL void GL_APIENTRY glPathGlyphRangeNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
+GL_APICALL void GL_APIENTRY glWeightPathsNV (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights);
+GL_APICALL void GL_APIENTRY glCopyPathNV (GLuint resultPath, GLuint srcPath);
+GL_APICALL void GL_APIENTRY glInterpolatePathsNV (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight);
+GL_APICALL void GL_APIENTRY glTransformPathNV (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues);
+GL_APICALL void GL_APIENTRY glPathParameterivNV (GLuint path, GLenum pname, const GLint *value);
+GL_APICALL void GL_APIENTRY glPathParameteriNV (GLuint path, GLenum pname, GLint value);
+GL_APICALL void GL_APIENTRY glPathParameterfvNV (GLuint path, GLenum pname, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glPathParameterfNV (GLuint path, GLenum pname, GLfloat value);
+GL_APICALL void GL_APIENTRY glPathDashArrayNV (GLuint path, GLsizei dashCount, const GLfloat *dashArray);
+GL_APICALL void GL_APIENTRY glPathStencilFuncNV (GLenum func, GLint ref, GLuint mask);
+GL_APICALL void GL_APIENTRY glPathStencilDepthOffsetNV (GLfloat factor, GLfloat units);
+GL_APICALL void GL_APIENTRY glStencilFillPathNV (GLuint path, GLenum fillMode, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilStrokePathNV (GLuint path, GLint reference, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues);
+GL_APICALL void GL_APIENTRY glStencilStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues);
+GL_APICALL void GL_APIENTRY glPathCoverDepthFuncNV (GLenum func);
+GL_APICALL void GL_APIENTRY glCoverFillPathNV (GLuint path, GLenum coverMode);
+GL_APICALL void GL_APIENTRY glCoverStrokePathNV (GLuint path, GLenum coverMode);
+GL_APICALL void GL_APIENTRY glCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
+GL_APICALL void GL_APIENTRY glCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
+GL_APICALL void GL_APIENTRY glGetPathParameterivNV (GLuint path, GLenum pname, GLint *value);
+GL_APICALL void GL_APIENTRY glGetPathParameterfvNV (GLuint path, GLenum pname, GLfloat *value);
+GL_APICALL void GL_APIENTRY glGetPathCommandsNV (GLuint path, GLubyte *commands);
+GL_APICALL void GL_APIENTRY glGetPathCoordsNV (GLuint path, GLfloat *coords);
+GL_APICALL void GL_APIENTRY glGetPathDashArrayNV (GLuint path, GLfloat *dashArray);
+GL_APICALL void GL_APIENTRY glGetPathMetricsNV (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics);
+GL_APICALL void GL_APIENTRY glGetPathMetricRangeNV (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics);
+GL_APICALL void GL_APIENTRY glGetPathSpacingNV (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing);
+GL_APICALL GLboolean GL_APIENTRY glIsPointInFillPathNV (GLuint path, GLuint mask, GLfloat x, GLfloat y);
+GL_APICALL GLboolean GL_APIENTRY glIsPointInStrokePathNV (GLuint path, GLfloat x, GLfloat y);
+GL_APICALL GLfloat GL_APIENTRY glGetPathLengthNV (GLuint path, GLsizei startSegment, GLsizei numSegments);
+GL_APICALL GLboolean GL_APIENTRY glPointAlongPathNV (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY);
+GL_APICALL void GL_APIENTRY glMatrixLoad3x2fNV (GLenum matrixMode, const GLfloat *m);
+GL_APICALL void GL_APIENTRY glMatrixLoad3x3fNV (GLenum matrixMode, const GLfloat *m);
+GL_APICALL void GL_APIENTRY glMatrixLoadTranspose3x3fNV (GLenum matrixMode, const GLfloat *m);
+GL_APICALL void GL_APIENTRY glMatrixMult3x2fNV (GLenum matrixMode, const GLfloat *m);
+GL_APICALL void GL_APIENTRY glMatrixMult3x3fNV (GLenum matrixMode, const GLfloat *m);
+GL_APICALL void GL_APIENTRY glMatrixMultTranspose3x3fNV (GLenum matrixMode, const GLfloat *m);
+GL_APICALL void GL_APIENTRY glStencilThenCoverFillPathNV (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode);
+GL_APICALL void GL_APIENTRY glStencilThenCoverStrokePathNV (GLuint path, GLint reference, GLuint mask, GLenum coverMode);
+GL_APICALL void GL_APIENTRY glStencilThenCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
+GL_APICALL void GL_APIENTRY glStencilThenCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
+GL_APICALL GLenum GL_APIENTRY glPathGlyphIndexRangeNV (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint *baseAndCount);
+GL_APICALL GLenum GL_APIENTRY glPathGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
+GL_APICALL GLenum GL_APIENTRY glPathMemoryGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
+GL_APICALL void GL_APIENTRY glProgramPathFragmentInputGenNV (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs);
+GL_APICALL void GL_APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLfloat *params);
+GL_APICALL void GL_APIENTRY glMatrixFrustumEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+GL_APICALL void GL_APIENTRY glMatrixLoadIdentityEXT (GLenum mode);
+GL_APICALL void GL_APIENTRY glMatrixLoadTransposefEXT (GLenum mode, const GLfloat *m);
+GL_APICALL void GL_APIENTRY glMatrixLoadTransposedEXT (GLenum mode, const GLdouble *m);
+GL_APICALL void GL_APIENTRY glMatrixLoadfEXT (GLenum mode, const GLfloat *m);
+GL_APICALL void GL_APIENTRY glMatrixLoaddEXT (GLenum mode, const GLdouble *m);
+GL_APICALL void GL_APIENTRY glMatrixMultTransposefEXT (GLenum mode, const GLfloat *m);
+GL_APICALL void GL_APIENTRY glMatrixMultTransposedEXT (GLenum mode, const GLdouble *m);
+GL_APICALL void GL_APIENTRY glMatrixMultfEXT (GLenum mode, const GLfloat *m);
+GL_APICALL void GL_APIENTRY glMatrixMultdEXT (GLenum mode, const GLdouble *m);
+GL_APICALL void GL_APIENTRY glMatrixOrthoEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+GL_APICALL void GL_APIENTRY glMatrixPopEXT (GLenum mode);
+GL_APICALL void GL_APIENTRY glMatrixPushEXT (GLenum mode);
+GL_APICALL void GL_APIENTRY glMatrixRotatefEXT (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+GL_APICALL void GL_APIENTRY glMatrixRotatedEXT (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
+GL_APICALL void GL_APIENTRY glMatrixScalefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
+GL_APICALL void GL_APIENTRY glMatrixScaledEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
+GL_APICALL void GL_APIENTRY glMatrixTranslatefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
+GL_APICALL void GL_APIENTRY glMatrixTranslatedEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
+#endif
+#endif /* GL_NV_path_rendering */
+
+#ifndef GL_NV_path_rendering_shared_edge
+#define GL_NV_path_rendering_shared_edge 1
+#define GL_SHARED_EDGE_NV                 0xC0
+#endif /* GL_NV_path_rendering_shared_edge */
+
+#ifndef GL_NV_pixel_buffer_object
+#define GL_NV_pixel_buffer_object 1
+#define GL_PIXEL_PACK_BUFFER_NV           0x88EB
+#define GL_PIXEL_UNPACK_BUFFER_NV         0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING_NV   0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING_NV 0x88EF
+#endif /* GL_NV_pixel_buffer_object */
+
+#ifndef GL_NV_polygon_mode
+#define GL_NV_polygon_mode 1
+#define GL_POLYGON_MODE_NV                0x0B40
+#define GL_POLYGON_OFFSET_POINT_NV        0x2A01
+#define GL_POLYGON_OFFSET_LINE_NV         0x2A02
+#define GL_POINT_NV                       0x1B00
+#define GL_LINE_NV                        0x1B01
+#define GL_FILL_NV                        0x1B02
+typedef void (GL_APIENTRYP PFNGLPOLYGONMODENVPROC) (GLenum face, GLenum mode);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glPolygonModeNV (GLenum face, GLenum mode);
+#endif
+#endif /* GL_NV_polygon_mode */
+
+#ifndef GL_NV_primitive_shading_rate
+#define GL_NV_primitive_shading_rate 1
+#define GL_SHADING_RATE_IMAGE_PER_PRIMITIVE_NV 0x95B1
+#define GL_SHADING_RATE_IMAGE_PALETTE_COUNT_NV 0x95B2
+#endif /* GL_NV_primitive_shading_rate */
+
+#ifndef GL_NV_read_buffer
+#define GL_NV_read_buffer 1
+#define GL_READ_BUFFER_NV                 0x0C02
+typedef void (GL_APIENTRYP PFNGLREADBUFFERNVPROC) (GLenum mode);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glReadBufferNV (GLenum mode);
+#endif
+#endif /* GL_NV_read_buffer */
+
+#ifndef GL_NV_read_buffer_front
+#define GL_NV_read_buffer_front 1
+#endif /* GL_NV_read_buffer_front */
+
+#ifndef GL_NV_read_depth
+#define GL_NV_read_depth 1
+#endif /* GL_NV_read_depth */
+
+#ifndef GL_NV_read_depth_stencil
+#define GL_NV_read_depth_stencil 1
+#endif /* GL_NV_read_depth_stencil */
+
+#ifndef GL_NV_read_stencil
+#define GL_NV_read_stencil 1
+#endif /* GL_NV_read_stencil */
+
+#ifndef GL_NV_representative_fragment_test
+#define GL_NV_representative_fragment_test 1
+#define GL_REPRESENTATIVE_FRAGMENT_TEST_NV 0x937F
+#endif /* GL_NV_representative_fragment_test */
+
+#ifndef GL_NV_sRGB_formats
+#define GL_NV_sRGB_formats 1
+#define GL_SLUMINANCE_NV                  0x8C46
+#define GL_SLUMINANCE_ALPHA_NV            0x8C44
+#define GL_SRGB8_NV                       0x8C41
+#define GL_SLUMINANCE8_NV                 0x8C47
+#define GL_SLUMINANCE8_ALPHA8_NV          0x8C45
+#define GL_COMPRESSED_SRGB_S3TC_DXT1_NV   0x8C4C
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV 0x8C4D
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV 0x8C4E
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV 0x8C4F
+#define GL_ETC1_SRGB8_NV                  0x88EE
+#endif /* GL_NV_sRGB_formats */
+
+#ifndef GL_NV_sample_locations
+#define GL_NV_sample_locations 1
+#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV 0x933D
+#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV 0x933E
+#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV 0x933F
+#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV 0x9340
+#define GL_SAMPLE_LOCATION_NV             0x8E50
+#define GL_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9341
+#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV 0x9342
+#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV 0x9343
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLenum target, GLuint start, GLsizei count, const GLfloat *v);
+typedef void (GL_APIENTRYP PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v);
+typedef void (GL_APIENTRYP PFNGLRESOLVEDEPTHVALUESNVPROC) (void);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glFramebufferSampleLocationsfvNV (GLenum target, GLuint start, GLsizei count, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glNamedFramebufferSampleLocationsfvNV (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glResolveDepthValuesNV (void);
+#endif
+#endif /* GL_NV_sample_locations */
+
+#ifndef GL_NV_sample_mask_override_coverage
+#define GL_NV_sample_mask_override_coverage 1
+#endif /* GL_NV_sample_mask_override_coverage */
+
+#ifndef GL_NV_scissor_exclusive
+#define GL_NV_scissor_exclusive 1
+#define GL_SCISSOR_TEST_EXCLUSIVE_NV      0x9555
+#define GL_SCISSOR_BOX_EXCLUSIVE_NV       0x9556
+typedef void (GL_APIENTRYP PFNGLSCISSOREXCLUSIVENVPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLSCISSOREXCLUSIVEARRAYVNVPROC) (GLuint first, GLsizei count, const GLint *v);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glScissorExclusiveNV (GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glScissorExclusiveArrayvNV (GLuint first, GLsizei count, const GLint *v);
+#endif
+#endif /* GL_NV_scissor_exclusive */
+
+#ifndef GL_NV_shader_atomic_fp16_vector
+#define GL_NV_shader_atomic_fp16_vector 1
+#endif /* GL_NV_shader_atomic_fp16_vector */
+
+#ifndef GL_NV_shader_noperspective_interpolation
+#define GL_NV_shader_noperspective_interpolation 1
+#endif /* GL_NV_shader_noperspective_interpolation */
+
+#ifndef GL_NV_shader_subgroup_partitioned
+#define GL_NV_shader_subgroup_partitioned 1
+#define GL_SUBGROUP_FEATURE_PARTITIONED_BIT_NV 0x00000100
+#endif /* GL_NV_shader_subgroup_partitioned */
+
+#ifndef GL_NV_shader_texture_footprint
+#define GL_NV_shader_texture_footprint 1
+#endif /* GL_NV_shader_texture_footprint */
+
+#ifndef GL_NV_shading_rate_image
+#define GL_NV_shading_rate_image 1
+#define GL_SHADING_RATE_IMAGE_NV          0x9563
+#define GL_SHADING_RATE_NO_INVOCATIONS_NV 0x9564
+#define GL_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV 0x9565
+#define GL_SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV 0x9566
+#define GL_SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV 0x9567
+#define GL_SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV 0x9568
+#define GL_SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV 0x9569
+#define GL_SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV 0x956A
+#define GL_SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV 0x956B
+#define GL_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV 0x956C
+#define GL_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV 0x956D
+#define GL_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV 0x956E
+#define GL_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV 0x956F
+#define GL_SHADING_RATE_IMAGE_BINDING_NV  0x955B
+#define GL_SHADING_RATE_IMAGE_TEXEL_WIDTH_NV 0x955C
+#define GL_SHADING_RATE_IMAGE_TEXEL_HEIGHT_NV 0x955D
+#define GL_SHADING_RATE_IMAGE_PALETTE_SIZE_NV 0x955E
+#define GL_MAX_COARSE_FRAGMENT_SAMPLES_NV 0x955F
+#define GL_SHADING_RATE_SAMPLE_ORDER_DEFAULT_NV 0x95AE
+#define GL_SHADING_RATE_SAMPLE_ORDER_PIXEL_MAJOR_NV 0x95AF
+#define GL_SHADING_RATE_SAMPLE_ORDER_SAMPLE_MAJOR_NV 0x95B0
+typedef void (GL_APIENTRYP PFNGLBINDSHADINGRATEIMAGENVPROC) (GLuint texture);
+typedef void (GL_APIENTRYP PFNGLGETSHADINGRATEIMAGEPALETTENVPROC) (GLuint viewport, GLuint entry, GLenum *rate);
+typedef void (GL_APIENTRYP PFNGLGETSHADINGRATESAMPLELOCATIONIVNVPROC) (GLenum rate, GLuint samples, GLuint index, GLint *location);
+typedef void (GL_APIENTRYP PFNGLSHADINGRATEIMAGEBARRIERNVPROC) (GLboolean synchronize);
+typedef void (GL_APIENTRYP PFNGLSHADINGRATEIMAGEPALETTENVPROC) (GLuint viewport, GLuint first, GLsizei count, const GLenum *rates);
+typedef void (GL_APIENTRYP PFNGLSHADINGRATESAMPLEORDERNVPROC) (GLenum order);
+typedef void (GL_APIENTRYP PFNGLSHADINGRATESAMPLEORDERCUSTOMNVPROC) (GLenum rate, GLuint samples, const GLint *locations);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glBindShadingRateImageNV (GLuint texture);
+GL_APICALL void GL_APIENTRY glGetShadingRateImagePaletteNV (GLuint viewport, GLuint entry, GLenum *rate);
+GL_APICALL void GL_APIENTRY glGetShadingRateSampleLocationivNV (GLenum rate, GLuint samples, GLuint index, GLint *location);
+GL_APICALL void GL_APIENTRY glShadingRateImageBarrierNV (GLboolean synchronize);
+GL_APICALL void GL_APIENTRY glShadingRateImagePaletteNV (GLuint viewport, GLuint first, GLsizei count, const GLenum *rates);
+GL_APICALL void GL_APIENTRY glShadingRateSampleOrderNV (GLenum order);
+GL_APICALL void GL_APIENTRY glShadingRateSampleOrderCustomNV (GLenum rate, GLuint samples, const GLint *locations);
+#endif
+#endif /* GL_NV_shading_rate_image */
+
+#ifndef GL_NV_shadow_samplers_array
+#define GL_NV_shadow_samplers_array 1
+#define GL_SAMPLER_2D_ARRAY_SHADOW_NV     0x8DC4
+#endif /* GL_NV_shadow_samplers_array */
+
+#ifndef GL_NV_shadow_samplers_cube
+#define GL_NV_shadow_samplers_cube 1
+#define GL_SAMPLER_CUBE_SHADOW_NV         0x8DC5
+#endif /* GL_NV_shadow_samplers_cube */
+
+#ifndef GL_NV_stereo_view_rendering
+#define GL_NV_stereo_view_rendering 1
+#endif /* GL_NV_stereo_view_rendering */
+
+#ifndef GL_NV_texture_border_clamp
+#define GL_NV_texture_border_clamp 1
+#define GL_TEXTURE_BORDER_COLOR_NV        0x1004
+#define GL_CLAMP_TO_BORDER_NV             0x812D
+#endif /* GL_NV_texture_border_clamp */
+
+#ifndef GL_NV_texture_compression_s3tc_update
+#define GL_NV_texture_compression_s3tc_update 1
+#endif /* GL_NV_texture_compression_s3tc_update */
+
+#ifndef GL_NV_texture_npot_2D_mipmap
+#define GL_NV_texture_npot_2D_mipmap 1
+#endif /* GL_NV_texture_npot_2D_mipmap */
+
+#ifndef GL_NV_timeline_semaphore
+#define GL_NV_timeline_semaphore 1
+#define GL_TIMELINE_SEMAPHORE_VALUE_NV    0x9595
+#define GL_SEMAPHORE_TYPE_NV              0x95B3
+#define GL_SEMAPHORE_TYPE_BINARY_NV       0x95B4
+#define GL_SEMAPHORE_TYPE_TIMELINE_NV     0x95B5
+#define GL_MAX_TIMELINE_SEMAPHORE_VALUE_DIFFERENCE_NV 0x95B6
+typedef void (GL_APIENTRYP PFNGLCREATESEMAPHORESNVPROC) (GLsizei n, GLuint *semaphores);
+typedef void (GL_APIENTRYP PFNGLSEMAPHOREPARAMETERIVNVPROC) (GLuint semaphore, GLenum pname, const GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETSEMAPHOREPARAMETERIVNVPROC) (GLuint semaphore, GLenum pname, GLint *params);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glCreateSemaphoresNV (GLsizei n, GLuint *semaphores);
+GL_APICALL void GL_APIENTRY glSemaphoreParameterivNV (GLuint semaphore, GLenum pname, const GLint *params);
+GL_APICALL void GL_APIENTRY glGetSemaphoreParameterivNV (GLuint semaphore, GLenum pname, GLint *params);
+#endif
+#endif /* GL_NV_timeline_semaphore */
+
+#ifndef GL_NV_viewport_array
+#define GL_NV_viewport_array 1
+#define GL_MAX_VIEWPORTS_NV               0x825B
+#define GL_VIEWPORT_SUBPIXEL_BITS_NV      0x825C
+#define GL_VIEWPORT_BOUNDS_RANGE_NV       0x825D
+#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX_NV 0x825F
+typedef void (GL_APIENTRYP PFNGLVIEWPORTARRAYVNVPROC) (GLuint first, GLsizei count, const GLfloat *v);
+typedef void (GL_APIENTRYP PFNGLVIEWPORTINDEXEDFNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);
+typedef void (GL_APIENTRYP PFNGLVIEWPORTINDEXEDFVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (GL_APIENTRYP PFNGLSCISSORARRAYVNVPROC) (GLuint first, GLsizei count, const GLint *v);
+typedef void (GL_APIENTRYP PFNGLSCISSORINDEXEDNVPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLSCISSORINDEXEDVNVPROC) (GLuint index, const GLint *v);
+typedef void (GL_APIENTRYP PFNGLDEPTHRANGEARRAYFVNVPROC) (GLuint first, GLsizei count, const GLfloat *v);
+typedef void (GL_APIENTRYP PFNGLDEPTHRANGEINDEXEDFNVPROC) (GLuint index, GLfloat n, GLfloat f);
+typedef void (GL_APIENTRYP PFNGLGETFLOATI_VNVPROC) (GLenum target, GLuint index, GLfloat *data);
+typedef void (GL_APIENTRYP PFNGLENABLEINVPROC) (GLenum target, GLuint index);
+typedef void (GL_APIENTRYP PFNGLDISABLEINVPROC) (GLenum target, GLuint index);
+typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDINVPROC) (GLenum target, GLuint index);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glViewportArrayvNV (GLuint first, GLsizei count, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glViewportIndexedfNV (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);
+GL_APICALL void GL_APIENTRY glViewportIndexedfvNV (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glScissorArrayvNV (GLuint first, GLsizei count, const GLint *v);
+GL_APICALL void GL_APIENTRY glScissorIndexedNV (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glScissorIndexedvNV (GLuint index, const GLint *v);
+GL_APICALL void GL_APIENTRY glDepthRangeArrayfvNV (GLuint first, GLsizei count, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glDepthRangeIndexedfNV (GLuint index, GLfloat n, GLfloat f);
+GL_APICALL void GL_APIENTRY glGetFloati_vNV (GLenum target, GLuint index, GLfloat *data);
+GL_APICALL void GL_APIENTRY glEnableiNV (GLenum target, GLuint index);
+GL_APICALL void GL_APIENTRY glDisableiNV (GLenum target, GLuint index);
+GL_APICALL GLboolean GL_APIENTRY glIsEnablediNV (GLenum target, GLuint index);
+#endif
+#endif /* GL_NV_viewport_array */
+
+#ifndef GL_NV_viewport_array2
+#define GL_NV_viewport_array2 1
+#endif /* GL_NV_viewport_array2 */
+
+#ifndef GL_NV_viewport_swizzle
+#define GL_NV_viewport_swizzle 1
+#define GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV 0x9350
+#define GL_VIEWPORT_SWIZZLE_NEGATIVE_X_NV 0x9351
+#define GL_VIEWPORT_SWIZZLE_POSITIVE_Y_NV 0x9352
+#define GL_VIEWPORT_SWIZZLE_NEGATIVE_Y_NV 0x9353
+#define GL_VIEWPORT_SWIZZLE_POSITIVE_Z_NV 0x9354
+#define GL_VIEWPORT_SWIZZLE_NEGATIVE_Z_NV 0x9355
+#define GL_VIEWPORT_SWIZZLE_POSITIVE_W_NV 0x9356
+#define GL_VIEWPORT_SWIZZLE_NEGATIVE_W_NV 0x9357
+#define GL_VIEWPORT_SWIZZLE_X_NV          0x9358
+#define GL_VIEWPORT_SWIZZLE_Y_NV          0x9359
+#define GL_VIEWPORT_SWIZZLE_Z_NV          0x935A
+#define GL_VIEWPORT_SWIZZLE_W_NV          0x935B
+typedef void (GL_APIENTRYP PFNGLVIEWPORTSWIZZLENVPROC) (GLuint index, GLenum swizzlex, GLenum swizzley, GLenum swizzlez, GLenum swizzlew);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glViewportSwizzleNV (GLuint index, GLenum swizzlex, GLenum swizzley, GLenum swizzlez, GLenum swizzlew);
+#endif
+#endif /* GL_NV_viewport_swizzle */
+
+#ifndef GL_OVR_multiview
+#define GL_OVR_multiview 1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR 0x9630
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR 0x9632
+#define GL_MAX_VIEWS_OVR                  0x9631
+#define GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR 0x9633
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glFramebufferTextureMultiviewOVR (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews);
+#endif
+#endif /* GL_OVR_multiview */
+
+#ifndef GL_OVR_multiview2
+#define GL_OVR_multiview2 1
+#endif /* GL_OVR_multiview2 */
+
+#ifndef GL_OVR_multiview_multisampled_render_to_texture
+#define GL_OVR_multiview_multisampled_render_to_texture 1
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVRPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLsizei samples, GLint baseViewIndex, GLsizei numViews);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glFramebufferTextureMultisampleMultiviewOVR (GLenum target, GLenum attachment, GLuint texture, GLint level, GLsizei samples, GLint baseViewIndex, GLsizei numViews);
+#endif
+#endif /* GL_OVR_multiview_multisampled_render_to_texture */
+
+#ifndef GL_QCOM_YUV_texture_gather
+#define GL_QCOM_YUV_texture_gather 1
+#endif /* GL_QCOM_YUV_texture_gather */
+
+#ifndef GL_QCOM_alpha_test
+#define GL_QCOM_alpha_test 1
+#define GL_ALPHA_TEST_QCOM                0x0BC0
+#define GL_ALPHA_TEST_FUNC_QCOM           0x0BC1
+#define GL_ALPHA_TEST_REF_QCOM            0x0BC2
+typedef void (GL_APIENTRYP PFNGLALPHAFUNCQCOMPROC) (GLenum func, GLclampf ref);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glAlphaFuncQCOM (GLenum func, GLclampf ref);
+#endif
+#endif /* GL_QCOM_alpha_test */
+
+#ifndef GL_QCOM_binning_control
+#define GL_QCOM_binning_control 1
+#define GL_BINNING_CONTROL_HINT_QCOM      0x8FB0
+#define GL_CPU_OPTIMIZED_QCOM             0x8FB1
+#define GL_GPU_OPTIMIZED_QCOM             0x8FB2
+#define GL_RENDER_DIRECT_TO_FRAMEBUFFER_QCOM 0x8FB3
+#endif /* GL_QCOM_binning_control */
+
+#ifndef GL_QCOM_driver_control
+#define GL_QCOM_driver_control 1
+typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls);
+typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
+typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
+typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls);
+GL_APICALL void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
+GL_APICALL void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl);
+GL_APICALL void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl);
+#endif
+#endif /* GL_QCOM_driver_control */
+
+#ifndef GL_QCOM_extended_get
+#define GL_QCOM_extended_get 1
+#define GL_TEXTURE_WIDTH_QCOM             0x8BD2
+#define GL_TEXTURE_HEIGHT_QCOM            0x8BD3
+#define GL_TEXTURE_DEPTH_QCOM             0x8BD4
+#define GL_TEXTURE_INTERNAL_FORMAT_QCOM   0x8BD5
+#define GL_TEXTURE_FORMAT_QCOM            0x8BD6
+#define GL_TEXTURE_TYPE_QCOM              0x8BD7
+#define GL_TEXTURE_IMAGE_VALID_QCOM       0x8BD8
+#define GL_TEXTURE_NUM_LEVELS_QCOM        0x8BD9
+#define GL_TEXTURE_TARGET_QCOM            0x8BDA
+#define GL_TEXTURE_OBJECT_VALID_QCOM      0x8BDB
+#define GL_STATE_RESTORE                  0x8BDC
+typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures);
+typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
+typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
+typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
+typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void *texels);
+typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, void **params);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glExtGetTexturesQCOM (GLuint *textures, GLint maxTextures, GLint *numTextures);
+GL_APICALL void GL_APIENTRY glExtGetBuffersQCOM (GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
+GL_APICALL void GL_APIENTRY glExtGetRenderbuffersQCOM (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
+GL_APICALL void GL_APIENTRY glExtGetFramebuffersQCOM (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
+GL_APICALL void GL_APIENTRY glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void *texels);
+GL_APICALL void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, void **params);
+#endif
+#endif /* GL_QCOM_extended_get */
+
+#ifndef GL_QCOM_extended_get2
+#define GL_QCOM_extended_get2 1
+typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders);
+typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms);
+typedef GLboolean (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program);
+typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint maxShaders, GLint *numShaders);
+GL_APICALL void GL_APIENTRY glExtGetProgramsQCOM (GLuint *programs, GLint maxPrograms, GLint *numPrograms);
+GL_APICALL GLboolean GL_APIENTRY glExtIsProgramBinaryQCOM (GLuint program);
+GL_APICALL void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, GLchar *source, GLint *length);
+#endif
+#endif /* GL_QCOM_extended_get2 */
+
+#ifndef GL_QCOM_frame_extrapolation
+#define GL_QCOM_frame_extrapolation 1
+typedef void (GL_APIENTRYP PFNGLEXTRAPOLATETEX2DQCOMPROC) (GLuint src1, GLuint src2, GLuint output, GLfloat scaleFactor);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glExtrapolateTex2DQCOM (GLuint src1, GLuint src2, GLuint output, GLfloat scaleFactor);
+#endif
+#endif /* GL_QCOM_frame_extrapolation */
+
+#ifndef GL_QCOM_framebuffer_foveated
+#define GL_QCOM_framebuffer_foveated 1
+#define GL_FOVEATION_ENABLE_BIT_QCOM      0x00000001
+#define GL_FOVEATION_SCALED_BIN_METHOD_BIT_QCOM 0x00000002
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERFOVEATIONCONFIGQCOMPROC) (GLuint framebuffer, GLuint numLayers, GLuint focalPointsPerLayer, GLuint requestedFeatures, GLuint *providedFeatures);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERFOVEATIONPARAMETERSQCOMPROC) (GLuint framebuffer, GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY, GLfloat gainX, GLfloat gainY, GLfloat foveaArea);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glFramebufferFoveationConfigQCOM (GLuint framebuffer, GLuint numLayers, GLuint focalPointsPerLayer, GLuint requestedFeatures, GLuint *providedFeatures);
+GL_APICALL void GL_APIENTRY glFramebufferFoveationParametersQCOM (GLuint framebuffer, GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY, GLfloat gainX, GLfloat gainY, GLfloat foveaArea);
+#endif
+#endif /* GL_QCOM_framebuffer_foveated */
+
+#ifndef GL_QCOM_motion_estimation
+#define GL_QCOM_motion_estimation 1
+#define GL_MOTION_ESTIMATION_SEARCH_BLOCK_X_QCOM 0x8C90
+#define GL_MOTION_ESTIMATION_SEARCH_BLOCK_Y_QCOM 0x8C91
+typedef void (GL_APIENTRYP PFNGLTEXESTIMATEMOTIONQCOMPROC) (GLuint ref, GLuint target, GLuint output);
+typedef void (GL_APIENTRYP PFNGLTEXESTIMATEMOTIONREGIONSQCOMPROC) (GLuint ref, GLuint target, GLuint output, GLuint mask);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glTexEstimateMotionQCOM (GLuint ref, GLuint target, GLuint output);
+GL_APICALL void GL_APIENTRY glTexEstimateMotionRegionsQCOM (GLuint ref, GLuint target, GLuint output, GLuint mask);
+#endif
+#endif /* GL_QCOM_motion_estimation */
+
+#ifndef GL_QCOM_perfmon_global_mode
+#define GL_QCOM_perfmon_global_mode 1
+#define GL_PERFMON_GLOBAL_MODE_QCOM       0x8FA0
+#endif /* GL_QCOM_perfmon_global_mode */
+
+#ifndef GL_QCOM_render_shared_exponent
+#define GL_QCOM_render_shared_exponent 1
+#endif /* GL_QCOM_render_shared_exponent */
+
+#ifndef GL_QCOM_shader_framebuffer_fetch_noncoherent
+#define GL_QCOM_shader_framebuffer_fetch_noncoherent 1
+#define GL_FRAMEBUFFER_FETCH_NONCOHERENT_QCOM 0x96A2
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERFETCHBARRIERQCOMPROC) (void);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glFramebufferFetchBarrierQCOM (void);
+#endif
+#endif /* GL_QCOM_shader_framebuffer_fetch_noncoherent */
+
+#ifndef GL_QCOM_shader_framebuffer_fetch_rate
+#define GL_QCOM_shader_framebuffer_fetch_rate 1
+#endif /* GL_QCOM_shader_framebuffer_fetch_rate */
+
+#ifndef GL_QCOM_shading_rate
+#define GL_QCOM_shading_rate 1
+#define GL_SHADING_RATE_QCOM              0x96A4
+#define GL_SHADING_RATE_PRESERVE_ASPECT_RATIO_QCOM 0x96A5
+#define GL_SHADING_RATE_1X1_PIXELS_QCOM   0x96A6
+#define GL_SHADING_RATE_1X2_PIXELS_QCOM   0x96A7
+#define GL_SHADING_RATE_2X1_PIXELS_QCOM   0x96A8
+#define GL_SHADING_RATE_2X2_PIXELS_QCOM   0x96A9
+#define GL_SHADING_RATE_4X2_PIXELS_QCOM   0x96AC
+#define GL_SHADING_RATE_4X4_PIXELS_QCOM   0x96AE
+typedef void (GL_APIENTRYP PFNGLSHADINGRATEQCOMPROC) (GLenum rate);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glShadingRateQCOM (GLenum rate);
+#endif
+#endif /* GL_QCOM_shading_rate */
+
+#ifndef GL_QCOM_texture_foveated
+#define GL_QCOM_texture_foveated 1
+#define GL_TEXTURE_FOVEATED_FEATURE_BITS_QCOM 0x8BFB
+#define GL_TEXTURE_FOVEATED_MIN_PIXEL_DENSITY_QCOM 0x8BFC
+#define GL_TEXTURE_FOVEATED_FEATURE_QUERY_QCOM 0x8BFD
+#define GL_TEXTURE_FOVEATED_NUM_FOCAL_POINTS_QUERY_QCOM 0x8BFE
+#define GL_FRAMEBUFFER_INCOMPLETE_FOVEATION_QCOM 0x8BFF
+typedef void (GL_APIENTRYP PFNGLTEXTUREFOVEATIONPARAMETERSQCOMPROC) (GLuint texture, GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY, GLfloat gainX, GLfloat gainY, GLfloat foveaArea);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glTextureFoveationParametersQCOM (GLuint texture, GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY, GLfloat gainX, GLfloat gainY, GLfloat foveaArea);
+#endif
+#endif /* GL_QCOM_texture_foveated */
+
+#ifndef GL_QCOM_texture_foveated2
+#define GL_QCOM_texture_foveated2 1
+#define GL_TEXTURE_FOVEATED_CUTOFF_DENSITY_QCOM 0x96A0
+#endif /* GL_QCOM_texture_foveated2 */
+
+#ifndef GL_QCOM_texture_foveated_subsampled_layout
+#define GL_QCOM_texture_foveated_subsampled_layout 1
+#define GL_FOVEATION_SUBSAMPLED_LAYOUT_METHOD_BIT_QCOM 0x00000004
+#define GL_MAX_SHADER_SUBSAMPLED_IMAGE_UNITS_QCOM 0x8FA1
+#endif /* GL_QCOM_texture_foveated_subsampled_layout */
+
+#ifndef GL_QCOM_tiled_rendering
+#define GL_QCOM_tiled_rendering 1
+#define GL_COLOR_BUFFER_BIT0_QCOM         0x00000001
+#define GL_COLOR_BUFFER_BIT1_QCOM         0x00000002
+#define GL_COLOR_BUFFER_BIT2_QCOM         0x00000004
+#define GL_COLOR_BUFFER_BIT3_QCOM         0x00000008
+#define GL_COLOR_BUFFER_BIT4_QCOM         0x00000010
+#define GL_COLOR_BUFFER_BIT5_QCOM         0x00000020
+#define GL_COLOR_BUFFER_BIT6_QCOM         0x00000040
+#define GL_COLOR_BUFFER_BIT7_QCOM         0x00000080
+#define GL_DEPTH_BUFFER_BIT0_QCOM         0x00000100
+#define GL_DEPTH_BUFFER_BIT1_QCOM         0x00000200
+#define GL_DEPTH_BUFFER_BIT2_QCOM         0x00000400
+#define GL_DEPTH_BUFFER_BIT3_QCOM         0x00000800
+#define GL_DEPTH_BUFFER_BIT4_QCOM         0x00001000
+#define GL_DEPTH_BUFFER_BIT5_QCOM         0x00002000
+#define GL_DEPTH_BUFFER_BIT6_QCOM         0x00004000
+#define GL_DEPTH_BUFFER_BIT7_QCOM         0x00008000
+#define GL_STENCIL_BUFFER_BIT0_QCOM       0x00010000
+#define GL_STENCIL_BUFFER_BIT1_QCOM       0x00020000
+#define GL_STENCIL_BUFFER_BIT2_QCOM       0x00040000
+#define GL_STENCIL_BUFFER_BIT3_QCOM       0x00080000
+#define GL_STENCIL_BUFFER_BIT4_QCOM       0x00100000
+#define GL_STENCIL_BUFFER_BIT5_QCOM       0x00200000
+#define GL_STENCIL_BUFFER_BIT6_QCOM       0x00400000
+#define GL_STENCIL_BUFFER_BIT7_QCOM       0x00800000
+#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM   0x01000000
+#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM   0x02000000
+#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM   0x04000000
+#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM   0x08000000
+#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM   0x10000000
+#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM   0x20000000
+#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM   0x40000000
+#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM   0x80000000
+typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
+typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glStartTilingQCOM (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
+GL_APICALL void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask);
+#endif
+#endif /* GL_QCOM_tiled_rendering */
+
+#ifndef GL_QCOM_writeonly_rendering
+#define GL_QCOM_writeonly_rendering 1
+#define GL_WRITEONLY_RENDERING_QCOM       0x8823
+#endif /* GL_QCOM_writeonly_rendering */
+
+#ifndef GL_VIV_shader_binary
+#define GL_VIV_shader_binary 1
+#define GL_SHADER_BINARY_VIV              0x8FC4
+#endif /* GL_VIV_shader_binary */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/system/include/GLES2/gl2platform.h b/system/include/GLES2/gl2platform.h
new file mode 100644
index 0000000..5bcce6d
--- /dev/null
+++ b/system/include/GLES2/gl2platform.h
@@ -0,0 +1,27 @@
+#ifndef __gl2platform_h_
+#define __gl2platform_h_
+
+/*
+** Copyright 2017-2020 The Khronos Group Inc.
+** SPDX-License-Identifier: Apache-2.0
+*/
+
+/* Platform-specific types and definitions for OpenGL ES 2.X  gl2.h
+ *
+ * Adopters may modify khrplatform.h and this file to suit their platform.
+ * Please contribute modifications back to Khronos as pull requests on the
+ * public github repository:
+ *      https://github.com/KhronosGroup/OpenGL-Registry
+ */
+
+#include <KHR/khrplatform.h>
+
+#ifndef GL_APICALL
+#define GL_APICALL  KHRONOS_APICALL
+#endif
+
+#ifndef GL_APIENTRY
+#define GL_APIENTRY KHRONOS_APIENTRY
+#endif
+
+#endif /* __gl2platform_h_ */
diff --git a/system/include/GLES3/gl3.h b/system/include/GLES3/gl3.h
new file mode 100644
index 0000000..c9a3175
--- /dev/null
+++ b/system/include/GLES3/gl3.h
@@ -0,0 +1,939 @@
+#ifndef __gl3_h_
+#define __gl3_h_ 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** Copyright (c) 2013-2014 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+/*
+** This header is generated from the Khronos OpenGL / OpenGL ES XML
+** API Registry. The current version of the Registry, generator scripts
+** used to make the header, and the header can be found at
+**   http://www.opengl.org/registry/
+**
+** Khronos $Revision: 26696 $ on $Date: 2014-05-17 14:48:55 -0700 (Sat, 17 May 2014) $
+*/
+
+#include <GLES3/gl3platform.h>
+
+/* Generated on date 20140517 */
+
+/* Generated C header for:
+ * API: gles2
+ * Profile: common
+ * Versions considered: 2\.[0-9]|3.0
+ * Versions emitted: .*
+ * Default extensions included: None
+ * Additional extensions included: _nomatch_^
+ * Extensions removed: _nomatch_^
+ */
+
+#ifndef GL_ES_VERSION_2_0
+#define GL_ES_VERSION_2_0 1
+#include <KHR/khrplatform.h>
+typedef khronos_int8_t GLbyte;
+typedef khronos_float_t GLclampf;
+typedef khronos_int32_t GLfixed;
+typedef short GLshort;
+typedef unsigned short GLushort;
+typedef void GLvoid;
+typedef struct __GLsync *GLsync;
+typedef khronos_int64_t GLint64;
+typedef khronos_uint64_t GLuint64;
+typedef unsigned int GLenum;
+typedef unsigned int GLuint;
+typedef char GLchar;
+typedef khronos_float_t GLfloat;
+typedef khronos_ssize_t GLsizeiptr;
+typedef khronos_intptr_t GLintptr;
+typedef unsigned int GLbitfield;
+typedef int GLint;
+typedef unsigned char GLboolean;
+typedef int GLsizei;
+typedef khronos_uint8_t GLubyte;
+#define GL_DEPTH_BUFFER_BIT               0x00000100
+#define GL_STENCIL_BUFFER_BIT             0x00000400
+#define GL_COLOR_BUFFER_BIT               0x00004000
+#define GL_FALSE                          0
+#define GL_TRUE                           1
+#define GL_POINTS                         0x0000
+#define GL_LINES                          0x0001
+#define GL_LINE_LOOP                      0x0002
+#define GL_LINE_STRIP                     0x0003
+#define GL_TRIANGLES                      0x0004
+#define GL_TRIANGLE_STRIP                 0x0005
+#define GL_TRIANGLE_FAN                   0x0006
+#define GL_ZERO                           0
+#define GL_ONE                            1
+#define GL_SRC_COLOR                      0x0300
+#define GL_ONE_MINUS_SRC_COLOR            0x0301
+#define GL_SRC_ALPHA                      0x0302
+#define GL_ONE_MINUS_SRC_ALPHA            0x0303
+#define GL_DST_ALPHA                      0x0304
+#define GL_ONE_MINUS_DST_ALPHA            0x0305
+#define GL_DST_COLOR                      0x0306
+#define GL_ONE_MINUS_DST_COLOR            0x0307
+#define GL_SRC_ALPHA_SATURATE             0x0308
+#define GL_FUNC_ADD                       0x8006
+#define GL_BLEND_EQUATION                 0x8009
+#define GL_BLEND_EQUATION_RGB             0x8009
+#define GL_BLEND_EQUATION_ALPHA           0x883D
+#define GL_FUNC_SUBTRACT                  0x800A
+#define GL_FUNC_REVERSE_SUBTRACT          0x800B
+#define GL_BLEND_DST_RGB                  0x80C8
+#define GL_BLEND_SRC_RGB                  0x80C9
+#define GL_BLEND_DST_ALPHA                0x80CA
+#define GL_BLEND_SRC_ALPHA                0x80CB
+#define GL_CONSTANT_COLOR                 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR       0x8002
+#define GL_CONSTANT_ALPHA                 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA       0x8004
+#define GL_BLEND_COLOR                    0x8005
+#define GL_ARRAY_BUFFER                   0x8892
+#define GL_ELEMENT_ARRAY_BUFFER           0x8893
+#define GL_ARRAY_BUFFER_BINDING           0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING   0x8895
+#define GL_STREAM_DRAW                    0x88E0
+#define GL_STATIC_DRAW                    0x88E4
+#define GL_DYNAMIC_DRAW                   0x88E8
+#define GL_BUFFER_SIZE                    0x8764
+#define GL_BUFFER_USAGE                   0x8765
+#define GL_CURRENT_VERTEX_ATTRIB          0x8626
+#define GL_FRONT                          0x0404
+#define GL_BACK                           0x0405
+#define GL_FRONT_AND_BACK                 0x0408
+#define GL_TEXTURE_2D                     0x0DE1
+#define GL_CULL_FACE                      0x0B44
+#define GL_BLEND                          0x0BE2
+#define GL_DITHER                         0x0BD0
+#define GL_STENCIL_TEST                   0x0B90
+#define GL_DEPTH_TEST                     0x0B71
+#define GL_SCISSOR_TEST                   0x0C11
+#define GL_POLYGON_OFFSET_FILL            0x8037
+#define GL_SAMPLE_ALPHA_TO_COVERAGE       0x809E
+#define GL_SAMPLE_COVERAGE                0x80A0
+#define GL_NO_ERROR                       0
+#define GL_INVALID_ENUM                   0x0500
+#define GL_INVALID_VALUE                  0x0501
+#define GL_INVALID_OPERATION              0x0502
+#define GL_OUT_OF_MEMORY                  0x0505
+#define GL_CW                             0x0900
+#define GL_CCW                            0x0901
+#define GL_LINE_WIDTH                     0x0B21
+#define GL_ALIASED_POINT_SIZE_RANGE       0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE       0x846E
+#define GL_CULL_FACE_MODE                 0x0B45
+#define GL_FRONT_FACE                     0x0B46
+#define GL_DEPTH_RANGE                    0x0B70
+#define GL_DEPTH_WRITEMASK                0x0B72
+#define GL_DEPTH_CLEAR_VALUE              0x0B73
+#define GL_DEPTH_FUNC                     0x0B74
+#define GL_STENCIL_CLEAR_VALUE            0x0B91
+#define GL_STENCIL_FUNC                   0x0B92
+#define GL_STENCIL_FAIL                   0x0B94
+#define GL_STENCIL_PASS_DEPTH_FAIL        0x0B95
+#define GL_STENCIL_PASS_DEPTH_PASS        0x0B96
+#define GL_STENCIL_REF                    0x0B97
+#define GL_STENCIL_VALUE_MASK             0x0B93
+#define GL_STENCIL_WRITEMASK              0x0B98
+#define GL_STENCIL_BACK_FUNC              0x8800
+#define GL_STENCIL_BACK_FAIL              0x8801
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL   0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS   0x8803
+#define GL_STENCIL_BACK_REF               0x8CA3
+#define GL_STENCIL_BACK_VALUE_MASK        0x8CA4
+#define GL_STENCIL_BACK_WRITEMASK         0x8CA5
+#define GL_VIEWPORT                       0x0BA2
+#define GL_SCISSOR_BOX                    0x0C10
+#define GL_COLOR_CLEAR_VALUE              0x0C22
+#define GL_COLOR_WRITEMASK                0x0C23
+#define GL_UNPACK_ALIGNMENT               0x0CF5
+#define GL_PACK_ALIGNMENT                 0x0D05
+#define GL_MAX_TEXTURE_SIZE               0x0D33
+#define GL_MAX_VIEWPORT_DIMS              0x0D3A
+#define GL_SUBPIXEL_BITS                  0x0D50
+#define GL_RED_BITS                       0x0D52
+#define GL_GREEN_BITS                     0x0D53
+#define GL_BLUE_BITS                      0x0D54
+#define GL_ALPHA_BITS                     0x0D55
+#define GL_DEPTH_BITS                     0x0D56
+#define GL_STENCIL_BITS                   0x0D57
+#define GL_POLYGON_OFFSET_UNITS           0x2A00
+#define GL_POLYGON_OFFSET_FACTOR          0x8038
+#define GL_TEXTURE_BINDING_2D             0x8069
+#define GL_SAMPLE_BUFFERS                 0x80A8
+#define GL_SAMPLES                        0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE          0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT         0x80AB
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS     0x86A3
+#define GL_DONT_CARE                      0x1100
+#define GL_FASTEST                        0x1101
+#define GL_NICEST                         0x1102
+#define GL_GENERATE_MIPMAP_HINT           0x8192
+#define GL_BYTE                           0x1400
+#define GL_UNSIGNED_BYTE                  0x1401
+#define GL_SHORT                          0x1402
+#define GL_UNSIGNED_SHORT                 0x1403
+#define GL_INT                            0x1404
+#define GL_UNSIGNED_INT                   0x1405
+#define GL_FLOAT                          0x1406
+#define GL_FIXED                          0x140C
+#define GL_DEPTH_COMPONENT                0x1902
+#define GL_ALPHA                          0x1906
+#define GL_RGB                            0x1907
+#define GL_RGBA                           0x1908
+#define GL_LUMINANCE                      0x1909
+#define GL_LUMINANCE_ALPHA                0x190A
+#define GL_UNSIGNED_SHORT_4_4_4_4         0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1         0x8034
+#define GL_UNSIGNED_SHORT_5_6_5           0x8363
+#define GL_FRAGMENT_SHADER                0x8B30
+#define GL_VERTEX_SHADER                  0x8B31
+#define GL_MAX_VERTEX_ATTRIBS             0x8869
+#define GL_MAX_VERTEX_UNIFORM_VECTORS     0x8DFB
+#define GL_MAX_VARYING_VECTORS            0x8DFC
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
+#define GL_MAX_TEXTURE_IMAGE_UNITS        0x8872
+#define GL_MAX_FRAGMENT_UNIFORM_VECTORS   0x8DFD
+#define GL_SHADER_TYPE                    0x8B4F
+#define GL_DELETE_STATUS                  0x8B80
+#define GL_LINK_STATUS                    0x8B82
+#define GL_VALIDATE_STATUS                0x8B83
+#define GL_ATTACHED_SHADERS               0x8B85
+#define GL_ACTIVE_UNIFORMS                0x8B86
+#define GL_ACTIVE_UNIFORM_MAX_LENGTH      0x8B87
+#define GL_ACTIVE_ATTRIBUTES              0x8B89
+#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH    0x8B8A
+#define GL_SHADING_LANGUAGE_VERSION       0x8B8C
+#define GL_CURRENT_PROGRAM                0x8B8D
+#define GL_NEVER                          0x0200
+#define GL_LESS                           0x0201
+#define GL_EQUAL                          0x0202
+#define GL_LEQUAL                         0x0203
+#define GL_GREATER                        0x0204
+#define GL_NOTEQUAL                       0x0205
+#define GL_GEQUAL                         0x0206
+#define GL_ALWAYS                         0x0207
+#define GL_KEEP                           0x1E00
+#define GL_REPLACE                        0x1E01
+#define GL_INCR                           0x1E02
+#define GL_DECR                           0x1E03
+#define GL_INVERT                         0x150A
+#define GL_INCR_WRAP                      0x8507
+#define GL_DECR_WRAP                      0x8508
+#define GL_VENDOR                         0x1F00
+#define GL_RENDERER                       0x1F01
+#define GL_VERSION                        0x1F02
+#define GL_EXTENSIONS                     0x1F03
+#define GL_NEAREST                        0x2600
+#define GL_LINEAR                         0x2601
+#define GL_NEAREST_MIPMAP_NEAREST         0x2700
+#define GL_LINEAR_MIPMAP_NEAREST          0x2701
+#define GL_NEAREST_MIPMAP_LINEAR          0x2702
+#define GL_LINEAR_MIPMAP_LINEAR           0x2703
+#define GL_TEXTURE_MAG_FILTER             0x2800
+#define GL_TEXTURE_MIN_FILTER             0x2801
+#define GL_TEXTURE_WRAP_S                 0x2802
+#define GL_TEXTURE_WRAP_T                 0x2803
+#define GL_TEXTURE                        0x1702
+#define GL_TEXTURE_CUBE_MAP               0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP       0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X    0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X    0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y    0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y    0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z    0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z    0x851A
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE      0x851C
+#define GL_TEXTURE0                       0x84C0
+#define GL_TEXTURE1                       0x84C1
+#define GL_TEXTURE2                       0x84C2
+#define GL_TEXTURE3                       0x84C3
+#define GL_TEXTURE4                       0x84C4
+#define GL_TEXTURE5                       0x84C5
+#define GL_TEXTURE6                       0x84C6
+#define GL_TEXTURE7                       0x84C7
+#define GL_TEXTURE8                       0x84C8
+#define GL_TEXTURE9                       0x84C9
+#define GL_TEXTURE10                      0x84CA
+#define GL_TEXTURE11                      0x84CB
+#define GL_TEXTURE12                      0x84CC
+#define GL_TEXTURE13                      0x84CD
+#define GL_TEXTURE14                      0x84CE
+#define GL_TEXTURE15                      0x84CF
+#define GL_TEXTURE16                      0x84D0
+#define GL_TEXTURE17                      0x84D1
+#define GL_TEXTURE18                      0x84D2
+#define GL_TEXTURE19                      0x84D3
+#define GL_TEXTURE20                      0x84D4
+#define GL_TEXTURE21                      0x84D5
+#define GL_TEXTURE22                      0x84D6
+#define GL_TEXTURE23                      0x84D7
+#define GL_TEXTURE24                      0x84D8
+#define GL_TEXTURE25                      0x84D9
+#define GL_TEXTURE26                      0x84DA
+#define GL_TEXTURE27                      0x84DB
+#define GL_TEXTURE28                      0x84DC
+#define GL_TEXTURE29                      0x84DD
+#define GL_TEXTURE30                      0x84DE
+#define GL_TEXTURE31                      0x84DF
+#define GL_ACTIVE_TEXTURE                 0x84E0
+#define GL_REPEAT                         0x2901
+#define GL_CLAMP_TO_EDGE                  0x812F
+#define GL_MIRRORED_REPEAT                0x8370
+#define GL_FLOAT_VEC2                     0x8B50
+#define GL_FLOAT_VEC3                     0x8B51
+#define GL_FLOAT_VEC4                     0x8B52
+#define GL_INT_VEC2                       0x8B53
+#define GL_INT_VEC3                       0x8B54
+#define GL_INT_VEC4                       0x8B55
+#define GL_BOOL                           0x8B56
+#define GL_BOOL_VEC2                      0x8B57
+#define GL_BOOL_VEC3                      0x8B58
+#define GL_BOOL_VEC4                      0x8B59
+#define GL_FLOAT_MAT2                     0x8B5A
+#define GL_FLOAT_MAT3                     0x8B5B
+#define GL_FLOAT_MAT4                     0x8B5C
+#define GL_SAMPLER_2D                     0x8B5E
+#define GL_SAMPLER_CUBE                   0x8B60
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED    0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE       0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE     0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE       0x8625
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER    0x8645
+#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
+#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
+#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
+#define GL_COMPILE_STATUS                 0x8B81
+#define GL_INFO_LOG_LENGTH                0x8B84
+#define GL_SHADER_SOURCE_LENGTH           0x8B88
+#define GL_SHADER_COMPILER                0x8DFA
+#define GL_SHADER_BINARY_FORMATS          0x8DF8
+#define GL_NUM_SHADER_BINARY_FORMATS      0x8DF9
+#define GL_LOW_FLOAT                      0x8DF0
+#define GL_MEDIUM_FLOAT                   0x8DF1
+#define GL_HIGH_FLOAT                     0x8DF2
+#define GL_LOW_INT                        0x8DF3
+#define GL_MEDIUM_INT                     0x8DF4
+#define GL_HIGH_INT                       0x8DF5
+#define GL_FRAMEBUFFER                    0x8D40
+#define GL_RENDERBUFFER                   0x8D41
+#define GL_RGBA4                          0x8056
+#define GL_RGB5_A1                        0x8057
+#define GL_RGB565                         0x8D62
+#define GL_DEPTH_COMPONENT16              0x81A5
+#define GL_STENCIL_INDEX8                 0x8D48
+#define GL_RENDERBUFFER_WIDTH             0x8D42
+#define GL_RENDERBUFFER_HEIGHT            0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT   0x8D44
+#define GL_RENDERBUFFER_RED_SIZE          0x8D50
+#define GL_RENDERBUFFER_GREEN_SIZE        0x8D51
+#define GL_RENDERBUFFER_BLUE_SIZE         0x8D52
+#define GL_RENDERBUFFER_ALPHA_SIZE        0x8D53
+#define GL_RENDERBUFFER_DEPTH_SIZE        0x8D54
+#define GL_RENDERBUFFER_STENCIL_SIZE      0x8D55
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
+#define GL_COLOR_ATTACHMENT0              0x8CE0
+#define GL_DEPTH_ATTACHMENT               0x8D00
+#define GL_STENCIL_ATTACHMENT             0x8D20
+#define GL_NONE                           0
+#define GL_FRAMEBUFFER_COMPLETE           0x8CD5
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
+#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
+#define GL_FRAMEBUFFER_UNSUPPORTED        0x8CDD
+#define GL_FRAMEBUFFER_BINDING            0x8CA6
+#define GL_RENDERBUFFER_BINDING           0x8CA7
+#define GL_MAX_RENDERBUFFER_SIZE          0x84E8
+#define GL_INVALID_FRAMEBUFFER_OPERATION  0x0506
+GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
+GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
+GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name);
+GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
+GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
+GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
+GL_APICALL void GL_APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+GL_APICALL void GL_APIENTRY glBlendEquation (GLenum mode);
+GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
+GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
+GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
+GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
+GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
+GL_APICALL void GL_APIENTRY glClear (GLbitfield mask);
+GL_APICALL void GL_APIENTRY glClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+GL_APICALL void GL_APIENTRY glClearDepthf (GLfloat d);
+GL_APICALL void GL_APIENTRY glClearStencil (GLint s);
+GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
+GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
+GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
+GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
+GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type);
+GL_APICALL void GL_APIENTRY glCullFace (GLenum mode);
+GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
+GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers);
+GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers);
+GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader);
+GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
+GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func);
+GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag);
+GL_APICALL void GL_APIENTRY glDepthRangef (GLfloat n, GLfloat f);
+GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
+GL_APICALL void GL_APIENTRY glDisable (GLenum cap);
+GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index);
+GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
+GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices);
+GL_APICALL void GL_APIENTRY glEnable (GLenum cap);
+GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index);
+GL_APICALL void GL_APIENTRY glFinish (void);
+GL_APICALL void GL_APIENTRY glFlush (void);
+GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode);
+GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
+GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target);
+GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers);
+GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers);
+GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures);
+GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
+GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar *name);
+GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *data);
+GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_APICALL GLenum GL_APIENTRY glGetError (void);
+GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *data);
+GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *data);
+GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
+GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+GL_APICALL const GLubyte *GL_APIENTRY glGetString (GLenum name);
+GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params);
+GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar *name);
+GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer);
+GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode);
+GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
+GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
+GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
+GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program);
+GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
+GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader);
+GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture);
+GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width);
+GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
+GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
+GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
+GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert);
+GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
+GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
+GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
+GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
+GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
+GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
+GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
+GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
+GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat v0);
+GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint v0);
+GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1);
+GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint v0, GLint v1);
+GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2);
+GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUseProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint index, GLfloat x);
+GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y);
+GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
+GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
+#endif /* GL_ES_VERSION_2_0 */
+
+#ifndef GL_ES_VERSION_3_0
+#define GL_ES_VERSION_3_0 1
+typedef unsigned short GLhalf;
+#define GL_READ_BUFFER                    0x0C02
+#define GL_UNPACK_ROW_LENGTH              0x0CF2
+#define GL_UNPACK_SKIP_ROWS               0x0CF3
+#define GL_UNPACK_SKIP_PIXELS             0x0CF4
+#define GL_PACK_ROW_LENGTH                0x0D02
+#define GL_PACK_SKIP_ROWS                 0x0D03
+#define GL_PACK_SKIP_PIXELS               0x0D04
+#define GL_COLOR                          0x1800
+#define GL_DEPTH                          0x1801
+#define GL_STENCIL                        0x1802
+#define GL_RED                            0x1903
+#define GL_RGB8                           0x8051
+#define GL_RGBA8                          0x8058
+#define GL_RGB10_A2                       0x8059
+#define GL_TEXTURE_BINDING_3D             0x806A
+#define GL_UNPACK_SKIP_IMAGES             0x806D
+#define GL_UNPACK_IMAGE_HEIGHT            0x806E
+#define GL_TEXTURE_3D                     0x806F
+#define GL_TEXTURE_WRAP_R                 0x8072
+#define GL_MAX_3D_TEXTURE_SIZE            0x8073
+#define GL_UNSIGNED_INT_2_10_10_10_REV    0x8368
+#define GL_MAX_ELEMENTS_VERTICES          0x80E8
+#define GL_MAX_ELEMENTS_INDICES           0x80E9
+#define GL_TEXTURE_MIN_LOD                0x813A
+#define GL_TEXTURE_MAX_LOD                0x813B
+#define GL_TEXTURE_BASE_LEVEL             0x813C
+#define GL_TEXTURE_MAX_LEVEL              0x813D
+#define GL_MIN                            0x8007
+#define GL_MAX                            0x8008
+#define GL_DEPTH_COMPONENT24              0x81A6
+#define GL_MAX_TEXTURE_LOD_BIAS           0x84FD
+#define GL_TEXTURE_COMPARE_MODE           0x884C
+#define GL_TEXTURE_COMPARE_FUNC           0x884D
+#define GL_CURRENT_QUERY                  0x8865
+#define GL_QUERY_RESULT                   0x8866
+#define GL_QUERY_RESULT_AVAILABLE         0x8867
+#define GL_BUFFER_MAPPED                  0x88BC
+#define GL_BUFFER_MAP_POINTER             0x88BD
+#define GL_STREAM_READ                    0x88E1
+#define GL_STREAM_COPY                    0x88E2
+#define GL_STATIC_READ                    0x88E5
+#define GL_STATIC_COPY                    0x88E6
+#define GL_DYNAMIC_READ                   0x88E9
+#define GL_DYNAMIC_COPY                   0x88EA
+#define GL_MAX_DRAW_BUFFERS               0x8824
+#define GL_DRAW_BUFFER0                   0x8825
+#define GL_DRAW_BUFFER1                   0x8826
+#define GL_DRAW_BUFFER2                   0x8827
+#define GL_DRAW_BUFFER3                   0x8828
+#define GL_DRAW_BUFFER4                   0x8829
+#define GL_DRAW_BUFFER5                   0x882A
+#define GL_DRAW_BUFFER6                   0x882B
+#define GL_DRAW_BUFFER7                   0x882C
+#define GL_DRAW_BUFFER8                   0x882D
+#define GL_DRAW_BUFFER9                   0x882E
+#define GL_DRAW_BUFFER10                  0x882F
+#define GL_DRAW_BUFFER11                  0x8830
+#define GL_DRAW_BUFFER12                  0x8831
+#define GL_DRAW_BUFFER13                  0x8832
+#define GL_DRAW_BUFFER14                  0x8833
+#define GL_DRAW_BUFFER15                  0x8834
+#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
+#define GL_MAX_VERTEX_UNIFORM_COMPONENTS  0x8B4A
+#define GL_SAMPLER_3D                     0x8B5F
+#define GL_SAMPLER_2D_SHADOW              0x8B62
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
+#define GL_PIXEL_PACK_BUFFER              0x88EB
+#define GL_PIXEL_UNPACK_BUFFER            0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING      0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING    0x88EF
+#define GL_FLOAT_MAT2x3                   0x8B65
+#define GL_FLOAT_MAT2x4                   0x8B66
+#define GL_FLOAT_MAT3x2                   0x8B67
+#define GL_FLOAT_MAT3x4                   0x8B68
+#define GL_FLOAT_MAT4x2                   0x8B69
+#define GL_FLOAT_MAT4x3                   0x8B6A
+#define GL_SRGB                           0x8C40
+#define GL_SRGB8                          0x8C41
+#define GL_SRGB8_ALPHA8                   0x8C43
+#define GL_COMPARE_REF_TO_TEXTURE         0x884E
+#define GL_MAJOR_VERSION                  0x821B
+#define GL_MINOR_VERSION                  0x821C
+#define GL_NUM_EXTENSIONS                 0x821D
+#define GL_RGBA32F                        0x8814
+#define GL_RGB32F                         0x8815
+#define GL_RGBA16F                        0x881A
+#define GL_RGB16F                         0x881B
+#define GL_VERTEX_ATTRIB_ARRAY_INTEGER    0x88FD
+#define GL_MAX_ARRAY_TEXTURE_LAYERS       0x88FF
+#define GL_MIN_PROGRAM_TEXEL_OFFSET       0x8904
+#define GL_MAX_PROGRAM_TEXEL_OFFSET       0x8905
+#define GL_MAX_VARYING_COMPONENTS         0x8B4B
+#define GL_TEXTURE_2D_ARRAY               0x8C1A
+#define GL_TEXTURE_BINDING_2D_ARRAY       0x8C1D
+#define GL_R11F_G11F_B10F                 0x8C3A
+#define GL_UNSIGNED_INT_10F_11F_11F_REV   0x8C3B
+#define GL_RGB9_E5                        0x8C3D
+#define GL_UNSIGNED_INT_5_9_9_9_REV       0x8C3E
+#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76
+#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80
+#define GL_TRANSFORM_FEEDBACK_VARYINGS    0x8C83
+#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84
+#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85
+#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88
+#define GL_RASTERIZER_DISCARD             0x8C89
+#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B
+#define GL_INTERLEAVED_ATTRIBS            0x8C8C
+#define GL_SEPARATE_ATTRIBS               0x8C8D
+#define GL_TRANSFORM_FEEDBACK_BUFFER      0x8C8E
+#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F
+#define GL_RGBA32UI                       0x8D70
+#define GL_RGB32UI                        0x8D71
+#define GL_RGBA16UI                       0x8D76
+#define GL_RGB16UI                        0x8D77
+#define GL_RGBA8UI                        0x8D7C
+#define GL_RGB8UI                         0x8D7D
+#define GL_RGBA32I                        0x8D82
+#define GL_RGB32I                         0x8D83
+#define GL_RGBA16I                        0x8D88
+#define GL_RGB16I                         0x8D89
+#define GL_RGBA8I                         0x8D8E
+#define GL_RGB8I                          0x8D8F
+#define GL_RED_INTEGER                    0x8D94
+#define GL_RGB_INTEGER                    0x8D98
+#define GL_RGBA_INTEGER                   0x8D99
+#define GL_SAMPLER_2D_ARRAY               0x8DC1
+#define GL_SAMPLER_2D_ARRAY_SHADOW        0x8DC4
+#define GL_SAMPLER_CUBE_SHADOW            0x8DC5
+#define GL_UNSIGNED_INT_VEC2              0x8DC6
+#define GL_UNSIGNED_INT_VEC3              0x8DC7
+#define GL_UNSIGNED_INT_VEC4              0x8DC8
+#define GL_INT_SAMPLER_2D                 0x8DCA
+#define GL_INT_SAMPLER_3D                 0x8DCB
+#define GL_INT_SAMPLER_CUBE               0x8DCC
+#define GL_INT_SAMPLER_2D_ARRAY           0x8DCF
+#define GL_UNSIGNED_INT_SAMPLER_2D        0x8DD2
+#define GL_UNSIGNED_INT_SAMPLER_3D        0x8DD3
+#define GL_UNSIGNED_INT_SAMPLER_CUBE      0x8DD4
+#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY  0x8DD7
+#define GL_BUFFER_ACCESS_FLAGS            0x911F
+#define GL_BUFFER_MAP_LENGTH              0x9120
+#define GL_BUFFER_MAP_OFFSET              0x9121
+#define GL_DEPTH_COMPONENT32F             0x8CAC
+#define GL_DEPTH32F_STENCIL8              0x8CAD
+#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD
+#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
+#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
+#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212
+#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213
+#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214
+#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215
+#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216
+#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217
+#define GL_FRAMEBUFFER_DEFAULT            0x8218
+#define GL_FRAMEBUFFER_UNDEFINED          0x8219
+#define GL_DEPTH_STENCIL_ATTACHMENT       0x821A
+#define GL_DEPTH_STENCIL                  0x84F9
+#define GL_UNSIGNED_INT_24_8              0x84FA
+#define GL_DEPTH24_STENCIL8               0x88F0
+#define GL_UNSIGNED_NORMALIZED            0x8C17
+#define GL_DRAW_FRAMEBUFFER_BINDING       0x8CA6
+#define GL_READ_FRAMEBUFFER               0x8CA8
+#define GL_DRAW_FRAMEBUFFER               0x8CA9
+#define GL_READ_FRAMEBUFFER_BINDING       0x8CAA
+#define GL_RENDERBUFFER_SAMPLES           0x8CAB
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
+#define GL_MAX_COLOR_ATTACHMENTS          0x8CDF
+#define GL_COLOR_ATTACHMENT1              0x8CE1
+#define GL_COLOR_ATTACHMENT2              0x8CE2
+#define GL_COLOR_ATTACHMENT3              0x8CE3
+#define GL_COLOR_ATTACHMENT4              0x8CE4
+#define GL_COLOR_ATTACHMENT5              0x8CE5
+#define GL_COLOR_ATTACHMENT6              0x8CE6
+#define GL_COLOR_ATTACHMENT7              0x8CE7
+#define GL_COLOR_ATTACHMENT8              0x8CE8
+#define GL_COLOR_ATTACHMENT9              0x8CE9
+#define GL_COLOR_ATTACHMENT10             0x8CEA
+#define GL_COLOR_ATTACHMENT11             0x8CEB
+#define GL_COLOR_ATTACHMENT12             0x8CEC
+#define GL_COLOR_ATTACHMENT13             0x8CED
+#define GL_COLOR_ATTACHMENT14             0x8CEE
+#define GL_COLOR_ATTACHMENT15             0x8CEF
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
+#define GL_MAX_SAMPLES                    0x8D57
+#define GL_HALF_FLOAT                     0x140B
+#define GL_MAP_READ_BIT                   0x0001
+#define GL_MAP_WRITE_BIT                  0x0002
+#define GL_MAP_INVALIDATE_RANGE_BIT       0x0004
+#define GL_MAP_INVALIDATE_BUFFER_BIT      0x0008
+#define GL_MAP_FLUSH_EXPLICIT_BIT         0x0010
+#define GL_MAP_UNSYNCHRONIZED_BIT         0x0020
+#define GL_RG                             0x8227
+#define GL_RG_INTEGER                     0x8228
+#define GL_R8                             0x8229
+#define GL_RG8                            0x822B
+#define GL_R16F                           0x822D
+#define GL_R32F                           0x822E
+#define GL_RG16F                          0x822F
+#define GL_RG32F                          0x8230
+#define GL_R8I                            0x8231
+#define GL_R8UI                           0x8232
+#define GL_R16I                           0x8233
+#define GL_R16UI                          0x8234
+#define GL_R32I                           0x8235
+#define GL_R32UI                          0x8236
+#define GL_RG8I                           0x8237
+#define GL_RG8UI                          0x8238
+#define GL_RG16I                          0x8239
+#define GL_RG16UI                         0x823A
+#define GL_RG32I                          0x823B
+#define GL_RG32UI                         0x823C
+#define GL_VERTEX_ARRAY_BINDING           0x85B5
+#define GL_R8_SNORM                       0x8F94
+#define GL_RG8_SNORM                      0x8F95
+#define GL_RGB8_SNORM                     0x8F96
+#define GL_RGBA8_SNORM                    0x8F97
+#define GL_SIGNED_NORMALIZED              0x8F9C
+#define GL_PRIMITIVE_RESTART_FIXED_INDEX  0x8D69
+#define GL_COPY_READ_BUFFER               0x8F36
+#define GL_COPY_WRITE_BUFFER              0x8F37
+#define GL_COPY_READ_BUFFER_BINDING       0x8F36
+#define GL_COPY_WRITE_BUFFER_BINDING      0x8F37
+#define GL_UNIFORM_BUFFER                 0x8A11
+#define GL_UNIFORM_BUFFER_BINDING         0x8A28
+#define GL_UNIFORM_BUFFER_START           0x8A29
+#define GL_UNIFORM_BUFFER_SIZE            0x8A2A
+#define GL_MAX_VERTEX_UNIFORM_BLOCKS      0x8A2B
+#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS    0x8A2D
+#define GL_MAX_COMBINED_UNIFORM_BLOCKS    0x8A2E
+#define GL_MAX_UNIFORM_BUFFER_BINDINGS    0x8A2F
+#define GL_MAX_UNIFORM_BLOCK_SIZE         0x8A30
+#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31
+#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33
+#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34
+#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35
+#define GL_ACTIVE_UNIFORM_BLOCKS          0x8A36
+#define GL_UNIFORM_TYPE                   0x8A37
+#define GL_UNIFORM_SIZE                   0x8A38
+#define GL_UNIFORM_NAME_LENGTH            0x8A39
+#define GL_UNIFORM_BLOCK_INDEX            0x8A3A
+#define GL_UNIFORM_OFFSET                 0x8A3B
+#define GL_UNIFORM_ARRAY_STRIDE           0x8A3C
+#define GL_UNIFORM_MATRIX_STRIDE          0x8A3D
+#define GL_UNIFORM_IS_ROW_MAJOR           0x8A3E
+#define GL_UNIFORM_BLOCK_BINDING          0x8A3F
+#define GL_UNIFORM_BLOCK_DATA_SIZE        0x8A40
+#define GL_UNIFORM_BLOCK_NAME_LENGTH      0x8A41
+#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS  0x8A42
+#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46
+#define GL_INVALID_INDEX                  0xFFFFFFFFu
+#define GL_MAX_VERTEX_OUTPUT_COMPONENTS   0x9122
+#define GL_MAX_FRAGMENT_INPUT_COMPONENTS  0x9125
+#define GL_MAX_SERVER_WAIT_TIMEOUT        0x9111
+#define GL_OBJECT_TYPE                    0x9112
+#define GL_SYNC_CONDITION                 0x9113
+#define GL_SYNC_STATUS                    0x9114
+#define GL_SYNC_FLAGS                     0x9115
+#define GL_SYNC_FENCE                     0x9116
+#define GL_SYNC_GPU_COMMANDS_COMPLETE     0x9117
+#define GL_UNSIGNALED                     0x9118
+#define GL_SIGNALED                       0x9119
+#define GL_ALREADY_SIGNALED               0x911A
+#define GL_TIMEOUT_EXPIRED                0x911B
+#define GL_CONDITION_SATISFIED            0x911C
+#define GL_WAIT_FAILED                    0x911D
+#define GL_SYNC_FLUSH_COMMANDS_BIT        0x00000001
+#define GL_TIMEOUT_IGNORED                0xFFFFFFFFFFFFFFFFull
+#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR    0x88FE
+#define GL_ANY_SAMPLES_PASSED             0x8C2F
+#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A
+#define GL_SAMPLER_BINDING                0x8919
+#define GL_RGB10_A2UI                     0x906F
+#define GL_TEXTURE_SWIZZLE_R              0x8E42
+#define GL_TEXTURE_SWIZZLE_G              0x8E43
+#define GL_TEXTURE_SWIZZLE_B              0x8E44
+#define GL_TEXTURE_SWIZZLE_A              0x8E45
+#define GL_GREEN                          0x1904
+#define GL_BLUE                           0x1905
+#define GL_INT_2_10_10_10_REV             0x8D9F
+#define GL_TRANSFORM_FEEDBACK             0x8E22
+#define GL_TRANSFORM_FEEDBACK_PAUSED      0x8E23
+#define GL_TRANSFORM_FEEDBACK_ACTIVE      0x8E24
+#define GL_TRANSFORM_FEEDBACK_BINDING     0x8E25
+#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257
+#define GL_PROGRAM_BINARY_LENGTH          0x8741
+#define GL_NUM_PROGRAM_BINARY_FORMATS     0x87FE
+#define GL_PROGRAM_BINARY_FORMATS         0x87FF
+#define GL_COMPRESSED_R11_EAC             0x9270
+#define GL_COMPRESSED_SIGNED_R11_EAC      0x9271
+#define GL_COMPRESSED_RG11_EAC            0x9272
+#define GL_COMPRESSED_SIGNED_RG11_EAC     0x9273
+#define GL_COMPRESSED_RGB8_ETC2           0x9274
+#define GL_COMPRESSED_SRGB8_ETC2          0x9275
+#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276
+#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277
+#define GL_COMPRESSED_RGBA8_ETC2_EAC      0x9278
+#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279
+#define GL_TEXTURE_IMMUTABLE_FORMAT       0x912F
+#define GL_MAX_ELEMENT_INDEX              0x8D6B
+#define GL_NUM_SAMPLE_COUNTS              0x9380
+#define GL_TEXTURE_IMMUTABLE_LEVELS       0x82DF
+GL_APICALL void GL_APIENTRY glReadBuffer (GLenum mode);
+GL_APICALL void GL_APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices);
+GL_APICALL void GL_APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
+GL_APICALL void GL_APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
+GL_APICALL void GL_APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
+GL_APICALL void GL_APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
+GL_APICALL void GL_APIENTRY glGenQueries (GLsizei n, GLuint *ids);
+GL_APICALL void GL_APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids);
+GL_APICALL GLboolean GL_APIENTRY glIsQuery (GLuint id);
+GL_APICALL void GL_APIENTRY glBeginQuery (GLenum target, GLuint id);
+GL_APICALL void GL_APIENTRY glEndQuery (GLenum target);
+GL_APICALL void GL_APIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params);
+GL_APICALL GLboolean GL_APIENTRY glUnmapBuffer (GLenum target);
+GL_APICALL void GL_APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, void **params);
+GL_APICALL void GL_APIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs);
+GL_APICALL void GL_APIENTRY glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+GL_APICALL void *GL_APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+GL_APICALL void GL_APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length);
+GL_APICALL void GL_APIENTRY glBindVertexArray (GLuint array);
+GL_APICALL void GL_APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays);
+GL_APICALL void GL_APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays);
+GL_APICALL GLboolean GL_APIENTRY glIsVertexArray (GLuint array);
+GL_APICALL void GL_APIENTRY glGetIntegeri_v (GLenum target, GLuint index, GLint *data);
+GL_APICALL void GL_APIENTRY glBeginTransformFeedback (GLenum primitiveMode);
+GL_APICALL void GL_APIENTRY glEndTransformFeedback (void);
+GL_APICALL void GL_APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+GL_APICALL void GL_APIENTRY glBindBufferBase (GLenum target, GLuint index, GLuint buffer);
+GL_APICALL void GL_APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode);
+GL_APICALL void GL_APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+GL_APICALL void GL_APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
+GL_APICALL void GL_APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params);
+GL_APICALL void GL_APIENTRY glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w);
+GL_APICALL void GL_APIENTRY glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+GL_APICALL void GL_APIENTRY glVertexAttribI4iv (GLuint index, const GLint *v);
+GL_APICALL void GL_APIENTRY glVertexAttribI4uiv (GLuint index, const GLuint *v);
+GL_APICALL void GL_APIENTRY glGetUniformuiv (GLuint program, GLint location, GLuint *params);
+GL_APICALL GLint GL_APIENTRY glGetFragDataLocation (GLuint program, const GLchar *name);
+GL_APICALL void GL_APIENTRY glUniform1ui (GLint location, GLuint v0);
+GL_APICALL void GL_APIENTRY glUniform2ui (GLint location, GLuint v0, GLuint v1);
+GL_APICALL void GL_APIENTRY glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2);
+GL_APICALL void GL_APIENTRY glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+GL_APICALL void GL_APIENTRY glUniform1uiv (GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glUniform2uiv (GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glUniform3uiv (GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glUniform4uiv (GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value);
+GL_APICALL void GL_APIENTRY glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value);
+GL_APICALL void GL_APIENTRY glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
+GL_APICALL const GLubyte *GL_APIENTRY glGetStringi (GLenum name, GLuint index);
+GL_APICALL void GL_APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+GL_APICALL void GL_APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices);
+GL_APICALL void GL_APIENTRY glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
+GL_APICALL GLuint GL_APIENTRY glGetUniformBlockIndex (GLuint program, const GLchar *uniformBlockName);
+GL_APICALL void GL_APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
+GL_APICALL void GL_APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
+GL_APICALL void GL_APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
+GL_APICALL void GL_APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount);
+GL_APICALL GLsync GL_APIENTRY glFenceSync (GLenum condition, GLbitfield flags);
+GL_APICALL GLboolean GL_APIENTRY glIsSync (GLsync sync);
+GL_APICALL void GL_APIENTRY glDeleteSync (GLsync sync);
+GL_APICALL GLenum GL_APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
+GL_APICALL void GL_APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
+GL_APICALL void GL_APIENTRY glGetInteger64v (GLenum pname, GLint64 *data);
+GL_APICALL void GL_APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+GL_APICALL void GL_APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data);
+GL_APICALL void GL_APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params);
+GL_APICALL void GL_APIENTRY glGenSamplers (GLsizei count, GLuint *samplers);
+GL_APICALL void GL_APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers);
+GL_APICALL GLboolean GL_APIENTRY glIsSampler (GLuint sampler);
+GL_APICALL void GL_APIENTRY glBindSampler (GLuint unit, GLuint sampler);
+GL_APICALL void GL_APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param);
+GL_APICALL void GL_APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param);
+GL_APICALL void GL_APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param);
+GL_APICALL void GL_APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params);
+GL_APICALL void GL_APIENTRY glVertexAttribDivisor (GLuint index, GLuint divisor);
+GL_APICALL void GL_APIENTRY glBindTransformFeedback (GLenum target, GLuint id);
+GL_APICALL void GL_APIENTRY glDeleteTransformFeedbacks (GLsizei n, const GLuint *ids);
+GL_APICALL void GL_APIENTRY glGenTransformFeedbacks (GLsizei n, GLuint *ids);
+GL_APICALL GLboolean GL_APIENTRY glIsTransformFeedback (GLuint id);
+GL_APICALL void GL_APIENTRY glPauseTransformFeedback (void);
+GL_APICALL void GL_APIENTRY glResumeTransformFeedback (void);
+GL_APICALL void GL_APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
+GL_APICALL void GL_APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length);
+GL_APICALL void GL_APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value);
+GL_APICALL void GL_APIENTRY glInvalidateFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments);
+GL_APICALL void GL_APIENTRY glInvalidateSubFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+GL_APICALL void GL_APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
+#endif /* GL_ES_VERSION_3_0 */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/system/include/GLES3/gl31.h b/system/include/GLES3/gl31.h
new file mode 100644
index 0000000..cfb9069
--- /dev/null
+++ b/system/include/GLES3/gl31.h
@@ -0,0 +1,1184 @@
+#ifndef __gl31_h_
+#define __gl31_h_ 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** Copyright (c) 2013-2014 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+/*
+** This header is generated from the Khronos OpenGL / OpenGL ES XML
+** API Registry. The current version of the Registry, generator scripts
+** used to make the header, and the header can be found at
+**   http://www.opengl.org/registry/
+**
+** Khronos $Revision$ on $Date$
+*/
+
+#include <GLES3/gl3platform.h>
+
+/* Generated on date 20140517 */
+
+/* Generated C header for:
+ * API: gles2
+ * Profile: common
+ * Versions considered: 2.[0-9]|3.[01]
+ * Versions emitted: .*
+ * Default extensions included: None
+ * Additional extensions included: _nomatch_^
+ * Extensions removed: _nomatch_^
+ */
+
+#ifndef GL_ES_VERSION_2_0
+#define GL_ES_VERSION_2_0 1
+#include <KHR/khrplatform.h>
+typedef khronos_int8_t GLbyte;
+typedef khronos_float_t GLclampf;
+typedef khronos_int32_t GLfixed;
+typedef short GLshort;
+typedef unsigned short GLushort;
+typedef void GLvoid;
+typedef struct __GLsync *GLsync;
+typedef khronos_int64_t GLint64;
+typedef khronos_uint64_t GLuint64;
+typedef unsigned int GLenum;
+typedef unsigned int GLuint;
+typedef char GLchar;
+typedef khronos_float_t GLfloat;
+typedef khronos_ssize_t GLsizeiptr;
+typedef khronos_intptr_t GLintptr;
+typedef unsigned int GLbitfield;
+typedef int GLint;
+typedef unsigned char GLboolean;
+typedef int GLsizei;
+typedef khronos_uint8_t GLubyte;
+#define GL_DEPTH_BUFFER_BIT               0x00000100
+#define GL_STENCIL_BUFFER_BIT             0x00000400
+#define GL_COLOR_BUFFER_BIT               0x00004000
+#define GL_FALSE                          0
+#define GL_TRUE                           1
+#define GL_POINTS                         0x0000
+#define GL_LINES                          0x0001
+#define GL_LINE_LOOP                      0x0002
+#define GL_LINE_STRIP                     0x0003
+#define GL_TRIANGLES                      0x0004
+#define GL_TRIANGLE_STRIP                 0x0005
+#define GL_TRIANGLE_FAN                   0x0006
+#define GL_ZERO                           0
+#define GL_ONE                            1
+#define GL_SRC_COLOR                      0x0300
+#define GL_ONE_MINUS_SRC_COLOR            0x0301
+#define GL_SRC_ALPHA                      0x0302
+#define GL_ONE_MINUS_SRC_ALPHA            0x0303
+#define GL_DST_ALPHA                      0x0304
+#define GL_ONE_MINUS_DST_ALPHA            0x0305
+#define GL_DST_COLOR                      0x0306
+#define GL_ONE_MINUS_DST_COLOR            0x0307
+#define GL_SRC_ALPHA_SATURATE             0x0308
+#define GL_FUNC_ADD                       0x8006
+#define GL_BLEND_EQUATION                 0x8009
+#define GL_BLEND_EQUATION_RGB             0x8009
+#define GL_BLEND_EQUATION_ALPHA           0x883D
+#define GL_FUNC_SUBTRACT                  0x800A
+#define GL_FUNC_REVERSE_SUBTRACT          0x800B
+#define GL_BLEND_DST_RGB                  0x80C8
+#define GL_BLEND_SRC_RGB                  0x80C9
+#define GL_BLEND_DST_ALPHA                0x80CA
+#define GL_BLEND_SRC_ALPHA                0x80CB
+#define GL_CONSTANT_COLOR                 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR       0x8002
+#define GL_CONSTANT_ALPHA                 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA       0x8004
+#define GL_BLEND_COLOR                    0x8005
+#define GL_ARRAY_BUFFER                   0x8892
+#define GL_ELEMENT_ARRAY_BUFFER           0x8893
+#define GL_ARRAY_BUFFER_BINDING           0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING   0x8895
+#define GL_STREAM_DRAW                    0x88E0
+#define GL_STATIC_DRAW                    0x88E4
+#define GL_DYNAMIC_DRAW                   0x88E8
+#define GL_BUFFER_SIZE                    0x8764
+#define GL_BUFFER_USAGE                   0x8765
+#define GL_CURRENT_VERTEX_ATTRIB          0x8626
+#define GL_FRONT                          0x0404
+#define GL_BACK                           0x0405
+#define GL_FRONT_AND_BACK                 0x0408
+#define GL_TEXTURE_2D                     0x0DE1
+#define GL_CULL_FACE                      0x0B44
+#define GL_BLEND                          0x0BE2
+#define GL_DITHER                         0x0BD0
+#define GL_STENCIL_TEST                   0x0B90
+#define GL_DEPTH_TEST                     0x0B71
+#define GL_SCISSOR_TEST                   0x0C11
+#define GL_POLYGON_OFFSET_FILL            0x8037
+#define GL_SAMPLE_ALPHA_TO_COVERAGE       0x809E
+#define GL_SAMPLE_COVERAGE                0x80A0
+#define GL_NO_ERROR                       0
+#define GL_INVALID_ENUM                   0x0500
+#define GL_INVALID_VALUE                  0x0501
+#define GL_INVALID_OPERATION              0x0502
+#define GL_OUT_OF_MEMORY                  0x0505
+#define GL_CW                             0x0900
+#define GL_CCW                            0x0901
+#define GL_LINE_WIDTH                     0x0B21
+#define GL_ALIASED_POINT_SIZE_RANGE       0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE       0x846E
+#define GL_CULL_FACE_MODE                 0x0B45
+#define GL_FRONT_FACE                     0x0B46
+#define GL_DEPTH_RANGE                    0x0B70
+#define GL_DEPTH_WRITEMASK                0x0B72
+#define GL_DEPTH_CLEAR_VALUE              0x0B73
+#define GL_DEPTH_FUNC                     0x0B74
+#define GL_STENCIL_CLEAR_VALUE            0x0B91
+#define GL_STENCIL_FUNC                   0x0B92
+#define GL_STENCIL_FAIL                   0x0B94
+#define GL_STENCIL_PASS_DEPTH_FAIL        0x0B95
+#define GL_STENCIL_PASS_DEPTH_PASS        0x0B96
+#define GL_STENCIL_REF                    0x0B97
+#define GL_STENCIL_VALUE_MASK             0x0B93
+#define GL_STENCIL_WRITEMASK              0x0B98
+#define GL_STENCIL_BACK_FUNC              0x8800
+#define GL_STENCIL_BACK_FAIL              0x8801
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL   0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS   0x8803
+#define GL_STENCIL_BACK_REF               0x8CA3
+#define GL_STENCIL_BACK_VALUE_MASK        0x8CA4
+#define GL_STENCIL_BACK_WRITEMASK         0x8CA5
+#define GL_VIEWPORT                       0x0BA2
+#define GL_SCISSOR_BOX                    0x0C10
+#define GL_COLOR_CLEAR_VALUE              0x0C22
+#define GL_COLOR_WRITEMASK                0x0C23
+#define GL_UNPACK_ALIGNMENT               0x0CF5
+#define GL_PACK_ALIGNMENT                 0x0D05
+#define GL_MAX_TEXTURE_SIZE               0x0D33
+#define GL_MAX_VIEWPORT_DIMS              0x0D3A
+#define GL_SUBPIXEL_BITS                  0x0D50
+#define GL_RED_BITS                       0x0D52
+#define GL_GREEN_BITS                     0x0D53
+#define GL_BLUE_BITS                      0x0D54
+#define GL_ALPHA_BITS                     0x0D55
+#define GL_DEPTH_BITS                     0x0D56
+#define GL_STENCIL_BITS                   0x0D57
+#define GL_POLYGON_OFFSET_UNITS           0x2A00
+#define GL_POLYGON_OFFSET_FACTOR          0x8038
+#define GL_TEXTURE_BINDING_2D             0x8069
+#define GL_SAMPLE_BUFFERS                 0x80A8
+#define GL_SAMPLES                        0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE          0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT         0x80AB
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS     0x86A3
+#define GL_DONT_CARE                      0x1100
+#define GL_FASTEST                        0x1101
+#define GL_NICEST                         0x1102
+#define GL_GENERATE_MIPMAP_HINT           0x8192
+#define GL_BYTE                           0x1400
+#define GL_UNSIGNED_BYTE                  0x1401
+#define GL_SHORT                          0x1402
+#define GL_UNSIGNED_SHORT                 0x1403
+#define GL_INT                            0x1404
+#define GL_UNSIGNED_INT                   0x1405
+#define GL_FLOAT                          0x1406
+#define GL_FIXED                          0x140C
+#define GL_DEPTH_COMPONENT                0x1902
+#define GL_ALPHA                          0x1906
+#define GL_RGB                            0x1907
+#define GL_RGBA                           0x1908
+#define GL_LUMINANCE                      0x1909
+#define GL_LUMINANCE_ALPHA                0x190A
+#define GL_UNSIGNED_SHORT_4_4_4_4         0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1         0x8034
+#define GL_UNSIGNED_SHORT_5_6_5           0x8363
+#define GL_FRAGMENT_SHADER                0x8B30
+#define GL_VERTEX_SHADER                  0x8B31
+#define GL_MAX_VERTEX_ATTRIBS             0x8869
+#define GL_MAX_VERTEX_UNIFORM_VECTORS     0x8DFB
+#define GL_MAX_VARYING_VECTORS            0x8DFC
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
+#define GL_MAX_TEXTURE_IMAGE_UNITS        0x8872
+#define GL_MAX_FRAGMENT_UNIFORM_VECTORS   0x8DFD
+#define GL_SHADER_TYPE                    0x8B4F
+#define GL_DELETE_STATUS                  0x8B80
+#define GL_LINK_STATUS                    0x8B82
+#define GL_VALIDATE_STATUS                0x8B83
+#define GL_ATTACHED_SHADERS               0x8B85
+#define GL_ACTIVE_UNIFORMS                0x8B86
+#define GL_ACTIVE_UNIFORM_MAX_LENGTH      0x8B87
+#define GL_ACTIVE_ATTRIBUTES              0x8B89
+#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH    0x8B8A
+#define GL_SHADING_LANGUAGE_VERSION       0x8B8C
+#define GL_CURRENT_PROGRAM                0x8B8D
+#define GL_NEVER                          0x0200
+#define GL_LESS                           0x0201
+#define GL_EQUAL                          0x0202
+#define GL_LEQUAL                         0x0203
+#define GL_GREATER                        0x0204
+#define GL_NOTEQUAL                       0x0205
+#define GL_GEQUAL                         0x0206
+#define GL_ALWAYS                         0x0207
+#define GL_KEEP                           0x1E00
+#define GL_REPLACE                        0x1E01
+#define GL_INCR                           0x1E02
+#define GL_DECR                           0x1E03
+#define GL_INVERT                         0x150A
+#define GL_INCR_WRAP                      0x8507
+#define GL_DECR_WRAP                      0x8508
+#define GL_VENDOR                         0x1F00
+#define GL_RENDERER                       0x1F01
+#define GL_VERSION                        0x1F02
+#define GL_EXTENSIONS                     0x1F03
+#define GL_NEAREST                        0x2600
+#define GL_LINEAR                         0x2601
+#define GL_NEAREST_MIPMAP_NEAREST         0x2700
+#define GL_LINEAR_MIPMAP_NEAREST          0x2701
+#define GL_NEAREST_MIPMAP_LINEAR          0x2702
+#define GL_LINEAR_MIPMAP_LINEAR           0x2703
+#define GL_TEXTURE_MAG_FILTER             0x2800
+#define GL_TEXTURE_MIN_FILTER             0x2801
+#define GL_TEXTURE_WRAP_S                 0x2802
+#define GL_TEXTURE_WRAP_T                 0x2803
+#define GL_TEXTURE                        0x1702
+#define GL_TEXTURE_CUBE_MAP               0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP       0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X    0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X    0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y    0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y    0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z    0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z    0x851A
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE      0x851C
+#define GL_TEXTURE0                       0x84C0
+#define GL_TEXTURE1                       0x84C1
+#define GL_TEXTURE2                       0x84C2
+#define GL_TEXTURE3                       0x84C3
+#define GL_TEXTURE4                       0x84C4
+#define GL_TEXTURE5                       0x84C5
+#define GL_TEXTURE6                       0x84C6
+#define GL_TEXTURE7                       0x84C7
+#define GL_TEXTURE8                       0x84C8
+#define GL_TEXTURE9                       0x84C9
+#define GL_TEXTURE10                      0x84CA
+#define GL_TEXTURE11                      0x84CB
+#define GL_TEXTURE12                      0x84CC
+#define GL_TEXTURE13                      0x84CD
+#define GL_TEXTURE14                      0x84CE
+#define GL_TEXTURE15                      0x84CF
+#define GL_TEXTURE16                      0x84D0
+#define GL_TEXTURE17                      0x84D1
+#define GL_TEXTURE18                      0x84D2
+#define GL_TEXTURE19                      0x84D3
+#define GL_TEXTURE20                      0x84D4
+#define GL_TEXTURE21                      0x84D5
+#define GL_TEXTURE22                      0x84D6
+#define GL_TEXTURE23                      0x84D7
+#define GL_TEXTURE24                      0x84D8
+#define GL_TEXTURE25                      0x84D9
+#define GL_TEXTURE26                      0x84DA
+#define GL_TEXTURE27                      0x84DB
+#define GL_TEXTURE28                      0x84DC
+#define GL_TEXTURE29                      0x84DD
+#define GL_TEXTURE30                      0x84DE
+#define GL_TEXTURE31                      0x84DF
+#define GL_ACTIVE_TEXTURE                 0x84E0
+#define GL_REPEAT                         0x2901
+#define GL_CLAMP_TO_EDGE                  0x812F
+#define GL_MIRRORED_REPEAT                0x8370
+#define GL_FLOAT_VEC2                     0x8B50
+#define GL_FLOAT_VEC3                     0x8B51
+#define GL_FLOAT_VEC4                     0x8B52
+#define GL_INT_VEC2                       0x8B53
+#define GL_INT_VEC3                       0x8B54
+#define GL_INT_VEC4                       0x8B55
+#define GL_BOOL                           0x8B56
+#define GL_BOOL_VEC2                      0x8B57
+#define GL_BOOL_VEC3                      0x8B58
+#define GL_BOOL_VEC4                      0x8B59
+#define GL_FLOAT_MAT2                     0x8B5A
+#define GL_FLOAT_MAT3                     0x8B5B
+#define GL_FLOAT_MAT4                     0x8B5C
+#define GL_SAMPLER_2D                     0x8B5E
+#define GL_SAMPLER_CUBE                   0x8B60
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED    0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE       0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE     0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE       0x8625
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER    0x8645
+#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
+#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
+#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
+#define GL_COMPILE_STATUS                 0x8B81
+#define GL_INFO_LOG_LENGTH                0x8B84
+#define GL_SHADER_SOURCE_LENGTH           0x8B88
+#define GL_SHADER_COMPILER                0x8DFA
+#define GL_SHADER_BINARY_FORMATS          0x8DF8
+#define GL_NUM_SHADER_BINARY_FORMATS      0x8DF9
+#define GL_LOW_FLOAT                      0x8DF0
+#define GL_MEDIUM_FLOAT                   0x8DF1
+#define GL_HIGH_FLOAT                     0x8DF2
+#define GL_LOW_INT                        0x8DF3
+#define GL_MEDIUM_INT                     0x8DF4
+#define GL_HIGH_INT                       0x8DF5
+#define GL_FRAMEBUFFER                    0x8D40
+#define GL_RENDERBUFFER                   0x8D41
+#define GL_RGBA4                          0x8056
+#define GL_RGB5_A1                        0x8057
+#define GL_RGB565                         0x8D62
+#define GL_DEPTH_COMPONENT16              0x81A5
+#define GL_STENCIL_INDEX8                 0x8D48
+#define GL_RENDERBUFFER_WIDTH             0x8D42
+#define GL_RENDERBUFFER_HEIGHT            0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT   0x8D44
+#define GL_RENDERBUFFER_RED_SIZE          0x8D50
+#define GL_RENDERBUFFER_GREEN_SIZE        0x8D51
+#define GL_RENDERBUFFER_BLUE_SIZE         0x8D52
+#define GL_RENDERBUFFER_ALPHA_SIZE        0x8D53
+#define GL_RENDERBUFFER_DEPTH_SIZE        0x8D54
+#define GL_RENDERBUFFER_STENCIL_SIZE      0x8D55
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
+#define GL_COLOR_ATTACHMENT0              0x8CE0
+#define GL_DEPTH_ATTACHMENT               0x8D00
+#define GL_STENCIL_ATTACHMENT             0x8D20
+#define GL_NONE                           0
+#define GL_FRAMEBUFFER_COMPLETE           0x8CD5
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
+#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
+#define GL_FRAMEBUFFER_UNSUPPORTED        0x8CDD
+#define GL_FRAMEBUFFER_BINDING            0x8CA6
+#define GL_RENDERBUFFER_BINDING           0x8CA7
+#define GL_MAX_RENDERBUFFER_SIZE          0x84E8
+#define GL_INVALID_FRAMEBUFFER_OPERATION  0x0506
+GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
+GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
+GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name);
+GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
+GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
+GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
+GL_APICALL void GL_APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+GL_APICALL void GL_APIENTRY glBlendEquation (GLenum mode);
+GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
+GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
+GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
+GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
+GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
+GL_APICALL void GL_APIENTRY glClear (GLbitfield mask);
+GL_APICALL void GL_APIENTRY glClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+GL_APICALL void GL_APIENTRY glClearDepthf (GLfloat d);
+GL_APICALL void GL_APIENTRY glClearStencil (GLint s);
+GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
+GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
+GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
+GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
+GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type);
+GL_APICALL void GL_APIENTRY glCullFace (GLenum mode);
+GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
+GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers);
+GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers);
+GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader);
+GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
+GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func);
+GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag);
+GL_APICALL void GL_APIENTRY glDepthRangef (GLfloat n, GLfloat f);
+GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
+GL_APICALL void GL_APIENTRY glDisable (GLenum cap);
+GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index);
+GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
+GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices);
+GL_APICALL void GL_APIENTRY glEnable (GLenum cap);
+GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index);
+GL_APICALL void GL_APIENTRY glFinish (void);
+GL_APICALL void GL_APIENTRY glFlush (void);
+GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode);
+GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
+GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target);
+GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers);
+GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers);
+GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures);
+GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
+GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar *name);
+GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *data);
+GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_APICALL GLenum GL_APIENTRY glGetError (void);
+GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *data);
+GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *data);
+GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
+GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+GL_APICALL const GLubyte *GL_APIENTRY glGetString (GLenum name);
+GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params);
+GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar *name);
+GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer);
+GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode);
+GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
+GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
+GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
+GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program);
+GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
+GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader);
+GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture);
+GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width);
+GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
+GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
+GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
+GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert);
+GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
+GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
+GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
+GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
+GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
+GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
+GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
+GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
+GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat v0);
+GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint v0);
+GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1);
+GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint v0, GLint v1);
+GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2);
+GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUseProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint index, GLfloat x);
+GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y);
+GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
+GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
+#endif /* GL_ES_VERSION_2_0 */
+
+#ifndef GL_ES_VERSION_3_0
+#define GL_ES_VERSION_3_0 1
+typedef unsigned short GLhalf;
+#define GL_READ_BUFFER                    0x0C02
+#define GL_UNPACK_ROW_LENGTH              0x0CF2
+#define GL_UNPACK_SKIP_ROWS               0x0CF3
+#define GL_UNPACK_SKIP_PIXELS             0x0CF4
+#define GL_PACK_ROW_LENGTH                0x0D02
+#define GL_PACK_SKIP_ROWS                 0x0D03
+#define GL_PACK_SKIP_PIXELS               0x0D04
+#define GL_COLOR                          0x1800
+#define GL_DEPTH                          0x1801
+#define GL_STENCIL                        0x1802
+#define GL_RED                            0x1903
+#define GL_RGB8                           0x8051
+#define GL_RGBA8                          0x8058
+#define GL_RGB10_A2                       0x8059
+#define GL_TEXTURE_BINDING_3D             0x806A
+#define GL_UNPACK_SKIP_IMAGES             0x806D
+#define GL_UNPACK_IMAGE_HEIGHT            0x806E
+#define GL_TEXTURE_3D                     0x806F
+#define GL_TEXTURE_WRAP_R                 0x8072
+#define GL_MAX_3D_TEXTURE_SIZE            0x8073
+#define GL_UNSIGNED_INT_2_10_10_10_REV    0x8368
+#define GL_MAX_ELEMENTS_VERTICES          0x80E8
+#define GL_MAX_ELEMENTS_INDICES           0x80E9
+#define GL_TEXTURE_MIN_LOD                0x813A
+#define GL_TEXTURE_MAX_LOD                0x813B
+#define GL_TEXTURE_BASE_LEVEL             0x813C
+#define GL_TEXTURE_MAX_LEVEL              0x813D
+#define GL_MIN                            0x8007
+#define GL_MAX                            0x8008
+#define GL_DEPTH_COMPONENT24              0x81A6
+#define GL_MAX_TEXTURE_LOD_BIAS           0x84FD
+#define GL_TEXTURE_COMPARE_MODE           0x884C
+#define GL_TEXTURE_COMPARE_FUNC           0x884D
+#define GL_CURRENT_QUERY                  0x8865
+#define GL_QUERY_RESULT                   0x8866
+#define GL_QUERY_RESULT_AVAILABLE         0x8867
+#define GL_BUFFER_MAPPED                  0x88BC
+#define GL_BUFFER_MAP_POINTER             0x88BD
+#define GL_STREAM_READ                    0x88E1
+#define GL_STREAM_COPY                    0x88E2
+#define GL_STATIC_READ                    0x88E5
+#define GL_STATIC_COPY                    0x88E6
+#define GL_DYNAMIC_READ                   0x88E9
+#define GL_DYNAMIC_COPY                   0x88EA
+#define GL_MAX_DRAW_BUFFERS               0x8824
+#define GL_DRAW_BUFFER0                   0x8825
+#define GL_DRAW_BUFFER1                   0x8826
+#define GL_DRAW_BUFFER2                   0x8827
+#define GL_DRAW_BUFFER3                   0x8828
+#define GL_DRAW_BUFFER4                   0x8829
+#define GL_DRAW_BUFFER5                   0x882A
+#define GL_DRAW_BUFFER6                   0x882B
+#define GL_DRAW_BUFFER7                   0x882C
+#define GL_DRAW_BUFFER8                   0x882D
+#define GL_DRAW_BUFFER9                   0x882E
+#define GL_DRAW_BUFFER10                  0x882F
+#define GL_DRAW_BUFFER11                  0x8830
+#define GL_DRAW_BUFFER12                  0x8831
+#define GL_DRAW_BUFFER13                  0x8832
+#define GL_DRAW_BUFFER14                  0x8833
+#define GL_DRAW_BUFFER15                  0x8834
+#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
+#define GL_MAX_VERTEX_UNIFORM_COMPONENTS  0x8B4A
+#define GL_SAMPLER_3D                     0x8B5F
+#define GL_SAMPLER_2D_SHADOW              0x8B62
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
+#define GL_PIXEL_PACK_BUFFER              0x88EB
+#define GL_PIXEL_UNPACK_BUFFER            0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING      0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING    0x88EF
+#define GL_FLOAT_MAT2x3                   0x8B65
+#define GL_FLOAT_MAT2x4                   0x8B66
+#define GL_FLOAT_MAT3x2                   0x8B67
+#define GL_FLOAT_MAT3x4                   0x8B68
+#define GL_FLOAT_MAT4x2                   0x8B69
+#define GL_FLOAT_MAT4x3                   0x8B6A
+#define GL_SRGB                           0x8C40
+#define GL_SRGB8                          0x8C41
+#define GL_SRGB8_ALPHA8                   0x8C43
+#define GL_COMPARE_REF_TO_TEXTURE         0x884E
+#define GL_MAJOR_VERSION                  0x821B
+#define GL_MINOR_VERSION                  0x821C
+#define GL_NUM_EXTENSIONS                 0x821D
+#define GL_RGBA32F                        0x8814
+#define GL_RGB32F                         0x8815
+#define GL_RGBA16F                        0x881A
+#define GL_RGB16F                         0x881B
+#define GL_VERTEX_ATTRIB_ARRAY_INTEGER    0x88FD
+#define GL_MAX_ARRAY_TEXTURE_LAYERS       0x88FF
+#define GL_MIN_PROGRAM_TEXEL_OFFSET       0x8904
+#define GL_MAX_PROGRAM_TEXEL_OFFSET       0x8905
+#define GL_MAX_VARYING_COMPONENTS         0x8B4B
+#define GL_TEXTURE_2D_ARRAY               0x8C1A
+#define GL_TEXTURE_BINDING_2D_ARRAY       0x8C1D
+#define GL_R11F_G11F_B10F                 0x8C3A
+#define GL_UNSIGNED_INT_10F_11F_11F_REV   0x8C3B
+#define GL_RGB9_E5                        0x8C3D
+#define GL_UNSIGNED_INT_5_9_9_9_REV       0x8C3E
+#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76
+#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80
+#define GL_TRANSFORM_FEEDBACK_VARYINGS    0x8C83
+#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84
+#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85
+#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88
+#define GL_RASTERIZER_DISCARD             0x8C89
+#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B
+#define GL_INTERLEAVED_ATTRIBS            0x8C8C
+#define GL_SEPARATE_ATTRIBS               0x8C8D
+#define GL_TRANSFORM_FEEDBACK_BUFFER      0x8C8E
+#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F
+#define GL_RGBA32UI                       0x8D70
+#define GL_RGB32UI                        0x8D71
+#define GL_RGBA16UI                       0x8D76
+#define GL_RGB16UI                        0x8D77
+#define GL_RGBA8UI                        0x8D7C
+#define GL_RGB8UI                         0x8D7D
+#define GL_RGBA32I                        0x8D82
+#define GL_RGB32I                         0x8D83
+#define GL_RGBA16I                        0x8D88
+#define GL_RGB16I                         0x8D89
+#define GL_RGBA8I                         0x8D8E
+#define GL_RGB8I                          0x8D8F
+#define GL_RED_INTEGER                    0x8D94
+#define GL_RGB_INTEGER                    0x8D98
+#define GL_RGBA_INTEGER                   0x8D99
+#define GL_SAMPLER_2D_ARRAY               0x8DC1
+#define GL_SAMPLER_2D_ARRAY_SHADOW        0x8DC4
+#define GL_SAMPLER_CUBE_SHADOW            0x8DC5
+#define GL_UNSIGNED_INT_VEC2              0x8DC6
+#define GL_UNSIGNED_INT_VEC3              0x8DC7
+#define GL_UNSIGNED_INT_VEC4              0x8DC8
+#define GL_INT_SAMPLER_2D                 0x8DCA
+#define GL_INT_SAMPLER_3D                 0x8DCB
+#define GL_INT_SAMPLER_CUBE               0x8DCC
+#define GL_INT_SAMPLER_2D_ARRAY           0x8DCF
+#define GL_UNSIGNED_INT_SAMPLER_2D        0x8DD2
+#define GL_UNSIGNED_INT_SAMPLER_3D        0x8DD3
+#define GL_UNSIGNED_INT_SAMPLER_CUBE      0x8DD4
+#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY  0x8DD7
+#define GL_BUFFER_ACCESS_FLAGS            0x911F
+#define GL_BUFFER_MAP_LENGTH              0x9120
+#define GL_BUFFER_MAP_OFFSET              0x9121
+#define GL_DEPTH_COMPONENT32F             0x8CAC
+#define GL_DEPTH32F_STENCIL8              0x8CAD
+#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD
+#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
+#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
+#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212
+#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213
+#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214
+#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215
+#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216
+#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217
+#define GL_FRAMEBUFFER_DEFAULT            0x8218
+#define GL_FRAMEBUFFER_UNDEFINED          0x8219
+#define GL_DEPTH_STENCIL_ATTACHMENT       0x821A
+#define GL_DEPTH_STENCIL                  0x84F9
+#define GL_UNSIGNED_INT_24_8              0x84FA
+#define GL_DEPTH24_STENCIL8               0x88F0
+#define GL_UNSIGNED_NORMALIZED            0x8C17
+#define GL_DRAW_FRAMEBUFFER_BINDING       0x8CA6
+#define GL_READ_FRAMEBUFFER               0x8CA8
+#define GL_DRAW_FRAMEBUFFER               0x8CA9
+#define GL_READ_FRAMEBUFFER_BINDING       0x8CAA
+#define GL_RENDERBUFFER_SAMPLES           0x8CAB
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
+#define GL_MAX_COLOR_ATTACHMENTS          0x8CDF
+#define GL_COLOR_ATTACHMENT1              0x8CE1
+#define GL_COLOR_ATTACHMENT2              0x8CE2
+#define GL_COLOR_ATTACHMENT3              0x8CE3
+#define GL_COLOR_ATTACHMENT4              0x8CE4
+#define GL_COLOR_ATTACHMENT5              0x8CE5
+#define GL_COLOR_ATTACHMENT6              0x8CE6
+#define GL_COLOR_ATTACHMENT7              0x8CE7
+#define GL_COLOR_ATTACHMENT8              0x8CE8
+#define GL_COLOR_ATTACHMENT9              0x8CE9
+#define GL_COLOR_ATTACHMENT10             0x8CEA
+#define GL_COLOR_ATTACHMENT11             0x8CEB
+#define GL_COLOR_ATTACHMENT12             0x8CEC
+#define GL_COLOR_ATTACHMENT13             0x8CED
+#define GL_COLOR_ATTACHMENT14             0x8CEE
+#define GL_COLOR_ATTACHMENT15             0x8CEF
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
+#define GL_MAX_SAMPLES                    0x8D57
+#define GL_HALF_FLOAT                     0x140B
+#define GL_MAP_READ_BIT                   0x0001
+#define GL_MAP_WRITE_BIT                  0x0002
+#define GL_MAP_INVALIDATE_RANGE_BIT       0x0004
+#define GL_MAP_INVALIDATE_BUFFER_BIT      0x0008
+#define GL_MAP_FLUSH_EXPLICIT_BIT         0x0010
+#define GL_MAP_UNSYNCHRONIZED_BIT         0x0020
+#define GL_RG                             0x8227
+#define GL_RG_INTEGER                     0x8228
+#define GL_R8                             0x8229
+#define GL_RG8                            0x822B
+#define GL_R16F                           0x822D
+#define GL_R32F                           0x822E
+#define GL_RG16F                          0x822F
+#define GL_RG32F                          0x8230
+#define GL_R8I                            0x8231
+#define GL_R8UI                           0x8232
+#define GL_R16I                           0x8233
+#define GL_R16UI                          0x8234
+#define GL_R32I                           0x8235
+#define GL_R32UI                          0x8236
+#define GL_RG8I                           0x8237
+#define GL_RG8UI                          0x8238
+#define GL_RG16I                          0x8239
+#define GL_RG16UI                         0x823A
+#define GL_RG32I                          0x823B
+#define GL_RG32UI                         0x823C
+#define GL_VERTEX_ARRAY_BINDING           0x85B5
+#define GL_R8_SNORM                       0x8F94
+#define GL_RG8_SNORM                      0x8F95
+#define GL_RGB8_SNORM                     0x8F96
+#define GL_RGBA8_SNORM                    0x8F97
+#define GL_SIGNED_NORMALIZED              0x8F9C
+#define GL_PRIMITIVE_RESTART_FIXED_INDEX  0x8D69
+#define GL_COPY_READ_BUFFER               0x8F36
+#define GL_COPY_WRITE_BUFFER              0x8F37
+#define GL_COPY_READ_BUFFER_BINDING       0x8F36
+#define GL_COPY_WRITE_BUFFER_BINDING      0x8F37
+#define GL_UNIFORM_BUFFER                 0x8A11
+#define GL_UNIFORM_BUFFER_BINDING         0x8A28
+#define GL_UNIFORM_BUFFER_START           0x8A29
+#define GL_UNIFORM_BUFFER_SIZE            0x8A2A
+#define GL_MAX_VERTEX_UNIFORM_BLOCKS      0x8A2B
+#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS    0x8A2D
+#define GL_MAX_COMBINED_UNIFORM_BLOCKS    0x8A2E
+#define GL_MAX_UNIFORM_BUFFER_BINDINGS    0x8A2F
+#define GL_MAX_UNIFORM_BLOCK_SIZE         0x8A30
+#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31
+#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33
+#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34
+#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35
+#define GL_ACTIVE_UNIFORM_BLOCKS          0x8A36
+#define GL_UNIFORM_TYPE                   0x8A37
+#define GL_UNIFORM_SIZE                   0x8A38
+#define GL_UNIFORM_NAME_LENGTH            0x8A39
+#define GL_UNIFORM_BLOCK_INDEX            0x8A3A
+#define GL_UNIFORM_OFFSET                 0x8A3B
+#define GL_UNIFORM_ARRAY_STRIDE           0x8A3C
+#define GL_UNIFORM_MATRIX_STRIDE          0x8A3D
+#define GL_UNIFORM_IS_ROW_MAJOR           0x8A3E
+#define GL_UNIFORM_BLOCK_BINDING          0x8A3F
+#define GL_UNIFORM_BLOCK_DATA_SIZE        0x8A40
+#define GL_UNIFORM_BLOCK_NAME_LENGTH      0x8A41
+#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS  0x8A42
+#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46
+#define GL_INVALID_INDEX                  0xFFFFFFFFu
+#define GL_MAX_VERTEX_OUTPUT_COMPONENTS   0x9122
+#define GL_MAX_FRAGMENT_INPUT_COMPONENTS  0x9125
+#define GL_MAX_SERVER_WAIT_TIMEOUT        0x9111
+#define GL_OBJECT_TYPE                    0x9112
+#define GL_SYNC_CONDITION                 0x9113
+#define GL_SYNC_STATUS                    0x9114
+#define GL_SYNC_FLAGS                     0x9115
+#define GL_SYNC_FENCE                     0x9116
+#define GL_SYNC_GPU_COMMANDS_COMPLETE     0x9117
+#define GL_UNSIGNALED                     0x9118
+#define GL_SIGNALED                       0x9119
+#define GL_ALREADY_SIGNALED               0x911A
+#define GL_TIMEOUT_EXPIRED                0x911B
+#define GL_CONDITION_SATISFIED            0x911C
+#define GL_WAIT_FAILED                    0x911D
+#define GL_SYNC_FLUSH_COMMANDS_BIT        0x00000001
+#define GL_TIMEOUT_IGNORED                0xFFFFFFFFFFFFFFFFull
+#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR    0x88FE
+#define GL_ANY_SAMPLES_PASSED             0x8C2F
+#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A
+#define GL_SAMPLER_BINDING                0x8919
+#define GL_RGB10_A2UI                     0x906F
+#define GL_TEXTURE_SWIZZLE_R              0x8E42
+#define GL_TEXTURE_SWIZZLE_G              0x8E43
+#define GL_TEXTURE_SWIZZLE_B              0x8E44
+#define GL_TEXTURE_SWIZZLE_A              0x8E45
+#define GL_GREEN                          0x1904
+#define GL_BLUE                           0x1905
+#define GL_INT_2_10_10_10_REV             0x8D9F
+#define GL_TRANSFORM_FEEDBACK             0x8E22
+#define GL_TRANSFORM_FEEDBACK_PAUSED      0x8E23
+#define GL_TRANSFORM_FEEDBACK_ACTIVE      0x8E24
+#define GL_TRANSFORM_FEEDBACK_BINDING     0x8E25
+#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257
+#define GL_PROGRAM_BINARY_LENGTH          0x8741
+#define GL_NUM_PROGRAM_BINARY_FORMATS     0x87FE
+#define GL_PROGRAM_BINARY_FORMATS         0x87FF
+#define GL_COMPRESSED_R11_EAC             0x9270
+#define GL_COMPRESSED_SIGNED_R11_EAC      0x9271
+#define GL_COMPRESSED_RG11_EAC            0x9272
+#define GL_COMPRESSED_SIGNED_RG11_EAC     0x9273
+#define GL_COMPRESSED_RGB8_ETC2           0x9274
+#define GL_COMPRESSED_SRGB8_ETC2          0x9275
+#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276
+#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277
+#define GL_COMPRESSED_RGBA8_ETC2_EAC      0x9278
+#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279
+#define GL_TEXTURE_IMMUTABLE_FORMAT       0x912F
+#define GL_MAX_ELEMENT_INDEX              0x8D6B
+#define GL_NUM_SAMPLE_COUNTS              0x9380
+#define GL_TEXTURE_IMMUTABLE_LEVELS       0x82DF
+GL_APICALL void GL_APIENTRY glReadBuffer (GLenum mode);
+GL_APICALL void GL_APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices);
+GL_APICALL void GL_APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
+GL_APICALL void GL_APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
+GL_APICALL void GL_APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
+GL_APICALL void GL_APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
+GL_APICALL void GL_APIENTRY glGenQueries (GLsizei n, GLuint *ids);
+GL_APICALL void GL_APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids);
+GL_APICALL GLboolean GL_APIENTRY glIsQuery (GLuint id);
+GL_APICALL void GL_APIENTRY glBeginQuery (GLenum target, GLuint id);
+GL_APICALL void GL_APIENTRY glEndQuery (GLenum target);
+GL_APICALL void GL_APIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params);
+GL_APICALL GLboolean GL_APIENTRY glUnmapBuffer (GLenum target);
+GL_APICALL void GL_APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, void **params);
+GL_APICALL void GL_APIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs);
+GL_APICALL void GL_APIENTRY glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+GL_APICALL void *GL_APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+GL_APICALL void GL_APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length);
+GL_APICALL void GL_APIENTRY glBindVertexArray (GLuint array);
+GL_APICALL void GL_APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays);
+GL_APICALL void GL_APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays);
+GL_APICALL GLboolean GL_APIENTRY glIsVertexArray (GLuint array);
+GL_APICALL void GL_APIENTRY glGetIntegeri_v (GLenum target, GLuint index, GLint *data);
+GL_APICALL void GL_APIENTRY glBeginTransformFeedback (GLenum primitiveMode);
+GL_APICALL void GL_APIENTRY glEndTransformFeedback (void);
+GL_APICALL void GL_APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+GL_APICALL void GL_APIENTRY glBindBufferBase (GLenum target, GLuint index, GLuint buffer);
+GL_APICALL void GL_APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode);
+GL_APICALL void GL_APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+GL_APICALL void GL_APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
+GL_APICALL void GL_APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params);
+GL_APICALL void GL_APIENTRY glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w);
+GL_APICALL void GL_APIENTRY glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+GL_APICALL void GL_APIENTRY glVertexAttribI4iv (GLuint index, const GLint *v);
+GL_APICALL void GL_APIENTRY glVertexAttribI4uiv (GLuint index, const GLuint *v);
+GL_APICALL void GL_APIENTRY glGetUniformuiv (GLuint program, GLint location, GLuint *params);
+GL_APICALL GLint GL_APIENTRY glGetFragDataLocation (GLuint program, const GLchar *name);
+GL_APICALL void GL_APIENTRY glUniform1ui (GLint location, GLuint v0);
+GL_APICALL void GL_APIENTRY glUniform2ui (GLint location, GLuint v0, GLuint v1);
+GL_APICALL void GL_APIENTRY glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2);
+GL_APICALL void GL_APIENTRY glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+GL_APICALL void GL_APIENTRY glUniform1uiv (GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glUniform2uiv (GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glUniform3uiv (GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glUniform4uiv (GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value);
+GL_APICALL void GL_APIENTRY glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value);
+GL_APICALL void GL_APIENTRY glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
+GL_APICALL const GLubyte *GL_APIENTRY glGetStringi (GLenum name, GLuint index);
+GL_APICALL void GL_APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+GL_APICALL void GL_APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices);
+GL_APICALL void GL_APIENTRY glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
+GL_APICALL GLuint GL_APIENTRY glGetUniformBlockIndex (GLuint program, const GLchar *uniformBlockName);
+GL_APICALL void GL_APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
+GL_APICALL void GL_APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
+GL_APICALL void GL_APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
+GL_APICALL void GL_APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount);
+GL_APICALL GLsync GL_APIENTRY glFenceSync (GLenum condition, GLbitfield flags);
+GL_APICALL GLboolean GL_APIENTRY glIsSync (GLsync sync);
+GL_APICALL void GL_APIENTRY glDeleteSync (GLsync sync);
+GL_APICALL GLenum GL_APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
+GL_APICALL void GL_APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
+GL_APICALL void GL_APIENTRY glGetInteger64v (GLenum pname, GLint64 *data);
+GL_APICALL void GL_APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+GL_APICALL void GL_APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data);
+GL_APICALL void GL_APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params);
+GL_APICALL void GL_APIENTRY glGenSamplers (GLsizei count, GLuint *samplers);
+GL_APICALL void GL_APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers);
+GL_APICALL GLboolean GL_APIENTRY glIsSampler (GLuint sampler);
+GL_APICALL void GL_APIENTRY glBindSampler (GLuint unit, GLuint sampler);
+GL_APICALL void GL_APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param);
+GL_APICALL void GL_APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param);
+GL_APICALL void GL_APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param);
+GL_APICALL void GL_APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params);
+GL_APICALL void GL_APIENTRY glVertexAttribDivisor (GLuint index, GLuint divisor);
+GL_APICALL void GL_APIENTRY glBindTransformFeedback (GLenum target, GLuint id);
+GL_APICALL void GL_APIENTRY glDeleteTransformFeedbacks (GLsizei n, const GLuint *ids);
+GL_APICALL void GL_APIENTRY glGenTransformFeedbacks (GLsizei n, GLuint *ids);
+GL_APICALL GLboolean GL_APIENTRY glIsTransformFeedback (GLuint id);
+GL_APICALL void GL_APIENTRY glPauseTransformFeedback (void);
+GL_APICALL void GL_APIENTRY glResumeTransformFeedback (void);
+GL_APICALL void GL_APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
+GL_APICALL void GL_APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length);
+GL_APICALL void GL_APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value);
+GL_APICALL void GL_APIENTRY glInvalidateFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments);
+GL_APICALL void GL_APIENTRY glInvalidateSubFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+GL_APICALL void GL_APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
+#endif /* GL_ES_VERSION_3_0 */
+
+#ifndef GL_ES_VERSION_3_1
+#define GL_ES_VERSION_3_1 1
+#define GL_COMPUTE_SHADER                 0x91B9
+#define GL_MAX_COMPUTE_UNIFORM_BLOCKS     0x91BB
+#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC
+#define GL_MAX_COMPUTE_IMAGE_UNIFORMS     0x91BD
+#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262
+#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263
+#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264
+#define GL_MAX_COMPUTE_ATOMIC_COUNTERS    0x8265
+#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266
+#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB
+#define GL_MAX_COMPUTE_WORK_GROUP_COUNT   0x91BE
+#define GL_MAX_COMPUTE_WORK_GROUP_SIZE    0x91BF
+#define GL_COMPUTE_WORK_GROUP_SIZE        0x8267
+#define GL_DISPATCH_INDIRECT_BUFFER       0x90EE
+#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF
+#define GL_COMPUTE_SHADER_BIT             0x00000020
+#define GL_DRAW_INDIRECT_BUFFER           0x8F3F
+#define GL_DRAW_INDIRECT_BUFFER_BINDING   0x8F43
+#define GL_MAX_UNIFORM_LOCATIONS          0x826E
+#define GL_FRAMEBUFFER_DEFAULT_WIDTH      0x9310
+#define GL_FRAMEBUFFER_DEFAULT_HEIGHT     0x9311
+#define GL_FRAMEBUFFER_DEFAULT_SAMPLES    0x9313
+#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314
+#define GL_MAX_FRAMEBUFFER_WIDTH          0x9315
+#define GL_MAX_FRAMEBUFFER_HEIGHT         0x9316
+#define GL_MAX_FRAMEBUFFER_SAMPLES        0x9318
+#define GL_UNIFORM                        0x92E1
+#define GL_UNIFORM_BLOCK                  0x92E2
+#define GL_PROGRAM_INPUT                  0x92E3
+#define GL_PROGRAM_OUTPUT                 0x92E4
+#define GL_BUFFER_VARIABLE                0x92E5
+#define GL_SHADER_STORAGE_BLOCK           0x92E6
+#define GL_ATOMIC_COUNTER_BUFFER          0x92C0
+#define GL_TRANSFORM_FEEDBACK_VARYING     0x92F4
+#define GL_ACTIVE_RESOURCES               0x92F5
+#define GL_MAX_NAME_LENGTH                0x92F6
+#define GL_MAX_NUM_ACTIVE_VARIABLES       0x92F7
+#define GL_NAME_LENGTH                    0x92F9
+#define GL_TYPE                           0x92FA
+#define GL_ARRAY_SIZE                     0x92FB
+#define GL_OFFSET                         0x92FC
+#define GL_BLOCK_INDEX                    0x92FD
+#define GL_ARRAY_STRIDE                   0x92FE
+#define GL_MATRIX_STRIDE                  0x92FF
+#define GL_IS_ROW_MAJOR                   0x9300
+#define GL_ATOMIC_COUNTER_BUFFER_INDEX    0x9301
+#define GL_BUFFER_BINDING                 0x9302
+#define GL_BUFFER_DATA_SIZE               0x9303
+#define GL_NUM_ACTIVE_VARIABLES           0x9304
+#define GL_ACTIVE_VARIABLES               0x9305
+#define GL_REFERENCED_BY_VERTEX_SHADER    0x9306
+#define GL_REFERENCED_BY_FRAGMENT_SHADER  0x930A
+#define GL_REFERENCED_BY_COMPUTE_SHADER   0x930B
+#define GL_TOP_LEVEL_ARRAY_SIZE           0x930C
+#define GL_TOP_LEVEL_ARRAY_STRIDE         0x930D
+#define GL_LOCATION                       0x930E
+#define GL_VERTEX_SHADER_BIT              0x00000001
+#define GL_FRAGMENT_SHADER_BIT            0x00000002
+#define GL_ALL_SHADER_BITS                0xFFFFFFFF
+#define GL_PROGRAM_SEPARABLE              0x8258
+#define GL_ACTIVE_PROGRAM                 0x8259
+#define GL_PROGRAM_PIPELINE_BINDING       0x825A
+#define GL_ATOMIC_COUNTER_BUFFER_BINDING  0x92C1
+#define GL_ATOMIC_COUNTER_BUFFER_START    0x92C2
+#define GL_ATOMIC_COUNTER_BUFFER_SIZE     0x92C3
+#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC
+#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0
+#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1
+#define GL_MAX_VERTEX_ATOMIC_COUNTERS     0x92D2
+#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS   0x92D6
+#define GL_MAX_COMBINED_ATOMIC_COUNTERS   0x92D7
+#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8
+#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC
+#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS  0x92D9
+#define GL_UNSIGNED_INT_ATOMIC_COUNTER    0x92DB
+#define GL_MAX_IMAGE_UNITS                0x8F38
+#define GL_MAX_VERTEX_IMAGE_UNIFORMS      0x90CA
+#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS    0x90CE
+#define GL_MAX_COMBINED_IMAGE_UNIFORMS    0x90CF
+#define GL_IMAGE_BINDING_NAME             0x8F3A
+#define GL_IMAGE_BINDING_LEVEL            0x8F3B
+#define GL_IMAGE_BINDING_LAYERED          0x8F3C
+#define GL_IMAGE_BINDING_LAYER            0x8F3D
+#define GL_IMAGE_BINDING_ACCESS           0x8F3E
+#define GL_IMAGE_BINDING_FORMAT           0x906E
+#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001
+#define GL_ELEMENT_ARRAY_BARRIER_BIT      0x00000002
+#define GL_UNIFORM_BARRIER_BIT            0x00000004
+#define GL_TEXTURE_FETCH_BARRIER_BIT      0x00000008
+#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020
+#define GL_COMMAND_BARRIER_BIT            0x00000040
+#define GL_PIXEL_BUFFER_BARRIER_BIT       0x00000080
+#define GL_TEXTURE_UPDATE_BARRIER_BIT     0x00000100
+#define GL_BUFFER_UPDATE_BARRIER_BIT      0x00000200
+#define GL_FRAMEBUFFER_BARRIER_BIT        0x00000400
+#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800
+#define GL_ATOMIC_COUNTER_BARRIER_BIT     0x00001000
+#define GL_ALL_BARRIER_BITS               0xFFFFFFFF
+#define GL_IMAGE_2D                       0x904D
+#define GL_IMAGE_3D                       0x904E
+#define GL_IMAGE_CUBE                     0x9050
+#define GL_IMAGE_2D_ARRAY                 0x9053
+#define GL_INT_IMAGE_2D                   0x9058
+#define GL_INT_IMAGE_3D                   0x9059
+#define GL_INT_IMAGE_CUBE                 0x905B
+#define GL_INT_IMAGE_2D_ARRAY             0x905E
+#define GL_UNSIGNED_INT_IMAGE_2D          0x9063
+#define GL_UNSIGNED_INT_IMAGE_3D          0x9064
+#define GL_UNSIGNED_INT_IMAGE_CUBE        0x9066
+#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY    0x9069
+#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7
+#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8
+#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9
+#define GL_READ_ONLY                      0x88B8
+#define GL_WRITE_ONLY                     0x88B9
+#define GL_READ_WRITE                     0x88BA
+#define GL_SHADER_STORAGE_BUFFER          0x90D2
+#define GL_SHADER_STORAGE_BUFFER_BINDING  0x90D3
+#define GL_SHADER_STORAGE_BUFFER_START    0x90D4
+#define GL_SHADER_STORAGE_BUFFER_SIZE     0x90D5
+#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6
+#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA
+#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB
+#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC
+#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD
+#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE  0x90DE
+#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF
+#define GL_SHADER_STORAGE_BARRIER_BIT     0x00002000
+#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39
+#define GL_DEPTH_STENCIL_TEXTURE_MODE     0x90EA
+#define GL_STENCIL_INDEX                  0x1901
+#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E
+#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F
+#define GL_SAMPLE_POSITION                0x8E50
+#define GL_SAMPLE_MASK                    0x8E51
+#define GL_SAMPLE_MASK_VALUE              0x8E52
+#define GL_TEXTURE_2D_MULTISAMPLE         0x9100
+#define GL_MAX_SAMPLE_MASK_WORDS          0x8E59
+#define GL_MAX_COLOR_TEXTURE_SAMPLES      0x910E
+#define GL_MAX_DEPTH_TEXTURE_SAMPLES      0x910F
+#define GL_MAX_INTEGER_SAMPLES            0x9110
+#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104
+#define GL_TEXTURE_SAMPLES                0x9106
+#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107
+#define GL_TEXTURE_WIDTH                  0x1000
+#define GL_TEXTURE_HEIGHT                 0x1001
+#define GL_TEXTURE_DEPTH                  0x8071
+#define GL_TEXTURE_INTERNAL_FORMAT        0x1003
+#define GL_TEXTURE_RED_SIZE               0x805C
+#define GL_TEXTURE_GREEN_SIZE             0x805D
+#define GL_TEXTURE_BLUE_SIZE              0x805E
+#define GL_TEXTURE_ALPHA_SIZE             0x805F
+#define GL_TEXTURE_DEPTH_SIZE             0x884A
+#define GL_TEXTURE_STENCIL_SIZE           0x88F1
+#define GL_TEXTURE_SHARED_SIZE            0x8C3F
+#define GL_TEXTURE_RED_TYPE               0x8C10
+#define GL_TEXTURE_GREEN_TYPE             0x8C11
+#define GL_TEXTURE_BLUE_TYPE              0x8C12
+#define GL_TEXTURE_ALPHA_TYPE             0x8C13
+#define GL_TEXTURE_DEPTH_TYPE             0x8C16
+#define GL_TEXTURE_COMPRESSED             0x86A1
+#define GL_SAMPLER_2D_MULTISAMPLE         0x9108
+#define GL_INT_SAMPLER_2D_MULTISAMPLE     0x9109
+#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A
+#define GL_VERTEX_ATTRIB_BINDING          0x82D4
+#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET  0x82D5
+#define GL_VERTEX_BINDING_DIVISOR         0x82D6
+#define GL_VERTEX_BINDING_OFFSET          0x82D7
+#define GL_VERTEX_BINDING_STRIDE          0x82D8
+#define GL_VERTEX_BINDING_BUFFER          0x8F4F
+#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9
+#define GL_MAX_VERTEX_ATTRIB_BINDINGS     0x82DA
+#define GL_MAX_VERTEX_ATTRIB_STRIDE       0x82E5
+GL_APICALL void GL_APIENTRY glDispatchCompute (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
+GL_APICALL void GL_APIENTRY glDispatchComputeIndirect (GLintptr indirect);
+GL_APICALL void GL_APIENTRY glDrawArraysIndirect (GLenum mode, const void *indirect);
+GL_APICALL void GL_APIENTRY glDrawElementsIndirect (GLenum mode, GLenum type, const void *indirect);
+GL_APICALL void GL_APIENTRY glFramebufferParameteri (GLenum target, GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glGetFramebufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetProgramInterfaceiv (GLuint program, GLenum programInterface, GLenum pname, GLint *params);
+GL_APICALL GLuint GL_APIENTRY glGetProgramResourceIndex (GLuint program, GLenum programInterface, const GLchar *name);
+GL_APICALL void GL_APIENTRY glGetProgramResourceName (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
+GL_APICALL void GL_APIENTRY glGetProgramResourceiv (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);
+GL_APICALL GLint GL_APIENTRY glGetProgramResourceLocation (GLuint program, GLenum programInterface, const GLchar *name);
+GL_APICALL void GL_APIENTRY glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program);
+GL_APICALL void GL_APIENTRY glActiveShaderProgram (GLuint pipeline, GLuint program);
+GL_APICALL GLuint GL_APIENTRY glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar *const*strings);
+GL_APICALL void GL_APIENTRY glBindProgramPipeline (GLuint pipeline);
+GL_APICALL void GL_APIENTRY glDeleteProgramPipelines (GLsizei n, const GLuint *pipelines);
+GL_APICALL void GL_APIENTRY glGenProgramPipelines (GLsizei n, GLuint *pipelines);
+GL_APICALL GLboolean GL_APIENTRY glIsProgramPipeline (GLuint pipeline);
+GL_APICALL void GL_APIENTRY glGetProgramPipelineiv (GLuint pipeline, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glProgramUniform1i (GLuint program, GLint location, GLint v0);
+GL_APICALL void GL_APIENTRY glProgramUniform2i (GLuint program, GLint location, GLint v0, GLint v1);
+GL_APICALL void GL_APIENTRY glProgramUniform3i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+GL_APICALL void GL_APIENTRY glProgramUniform4i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GL_APICALL void GL_APIENTRY glProgramUniform1ui (GLuint program, GLint location, GLuint v0);
+GL_APICALL void GL_APIENTRY glProgramUniform2ui (GLuint program, GLint location, GLuint v0, GLuint v1);
+GL_APICALL void GL_APIENTRY glProgramUniform3ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+GL_APICALL void GL_APIENTRY glProgramUniform4ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+GL_APICALL void GL_APIENTRY glProgramUniform1f (GLuint program, GLint location, GLfloat v0);
+GL_APICALL void GL_APIENTRY glProgramUniform2f (GLuint program, GLint location, GLfloat v0, GLfloat v1);
+GL_APICALL void GL_APIENTRY glProgramUniform3f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GL_APICALL void GL_APIENTRY glProgramUniform4f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GL_APICALL void GL_APIENTRY glProgramUniform1iv (GLuint program, GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform2iv (GLuint program, GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform3iv (GLuint program, GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform4iv (GLuint program, GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform1uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform2uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform3uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform4uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform1fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniform2fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniform3fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniform4fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix2x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix3x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix2x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix3x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glValidateProgramPipeline (GLuint pipeline);
+GL_APICALL void GL_APIENTRY glGetProgramPipelineInfoLog (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GL_APICALL void GL_APIENTRY glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
+GL_APICALL void GL_APIENTRY glGetBooleani_v (GLenum target, GLuint index, GLboolean *data);
+GL_APICALL void GL_APIENTRY glMemoryBarrier (GLbitfield barriers);
+GL_APICALL void GL_APIENTRY glMemoryBarrierByRegion (GLbitfield barriers);
+GL_APICALL void GL_APIENTRY glTexStorage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+GL_APICALL void GL_APIENTRY glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val);
+GL_APICALL void GL_APIENTRY glSampleMaski (GLuint maskNumber, GLbitfield mask);
+GL_APICALL void GL_APIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params);
+GL_APICALL void GL_APIENTRY glBindVertexBuffer (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
+GL_APICALL void GL_APIENTRY glVertexAttribFormat (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
+GL_APICALL void GL_APIENTRY glVertexAttribIFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+GL_APICALL void GL_APIENTRY glVertexAttribBinding (GLuint attribindex, GLuint bindingindex);
+GL_APICALL void GL_APIENTRY glVertexBindingDivisor (GLuint bindingindex, GLuint divisor);
+#endif /* GL_ES_VERSION_3_1 */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/system/include/GLES3/gl3ext.h b/system/include/GLES3/gl3ext.h
new file mode 100644
index 0000000..4d4ea96
--- /dev/null
+++ b/system/include/GLES3/gl3ext.h
@@ -0,0 +1,24 @@
+#ifndef __gl3ext_h_
+#define __gl3ext_h_
+
+/* $Revision: 17809 $ on $Date:: 2012-05-14 08:03:36 -0700 #$ */
+
+/*
+ * This document is licensed under the SGI Free Software B License Version
+ * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
+ */
+
+/* OpenGL ES 3 Extensions
+ *
+ * After an OES extension's interactions with OpenGl ES 3.0 have been documented,
+ * its tokens and function definitions should be added to this file in a manner
+ * that does not conflict with gl2ext.h or gl3.h.
+ *
+ * Tokens and function definitions for extensions that have become standard
+ * features in OpenGL ES 3.0 will not be added to this file.
+ *
+ * Applications using OpenGL-ES-2-only extensions should include gl2ext.h
+ */
+
+#endif /* __gl3ext_h_ */
+
diff --git a/system/include/GLES3/gl3platform.h b/system/include/GLES3/gl3platform.h
new file mode 100644
index 0000000..1bd1a85
--- /dev/null
+++ b/system/include/GLES3/gl3platform.h
@@ -0,0 +1,30 @@
+#ifndef __gl3platform_h_
+#define __gl3platform_h_
+
+/* $Revision: 18437 $ on $Date:: 2012-07-08 23:31:39 -0700 #$ */
+
+/*
+ * This document is licensed under the SGI Free Software B License Version
+ * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
+ */
+
+/* Platform-specific types and definitions for OpenGL ES 3.X  gl3.h
+ *
+ * Adopters may modify khrplatform.h and this file to suit their platform.
+ * You are encouraged to submit all modifications to the Khronos group so that
+ * they can be included in future versions of this file.  Please submit changes
+ * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
+ * by filing a bug against product "OpenGL-ES" component "Registry".
+ */
+
+#include <KHR/khrplatform.h>
+
+#ifndef GL_APICALL
+#define GL_APICALL  KHRONOS_APICALL
+#endif
+
+#ifndef GL_APIENTRY
+#define GL_APIENTRY KHRONOS_APIENTRY
+#endif
+
+#endif /* __gl3platform_h_ */
diff --git a/system/include/KHR/khrplatform.h b/system/include/KHR/khrplatform.h
new file mode 100644
index 0000000..153bbbd
--- /dev/null
+++ b/system/include/KHR/khrplatform.h
@@ -0,0 +1,271 @@
+#ifndef __khrplatform_h_
+#define __khrplatform_h_
+
+/*
+** Copyright (c) 2008-2009 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+/* Khronos platform-specific types and definitions.
+ *
+ * $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $
+ *
+ * Adopters may modify this file to suit their platform. Adopters are
+ * encouraged to submit platform specific modifications to the Khronos
+ * group so that they can be included in future versions of this file.
+ * Please submit changes by sending them to the public Khronos Bugzilla
+ * (http://khronos.org/bugzilla) by filing a bug against product
+ * "Khronos (general)" component "Registry".
+ *
+ * A predefined template which fills in some of the bug fields can be
+ * reached using http://tinyurl.com/khrplatform-h-bugreport, but you
+ * must create a Bugzilla login first.
+ *
+ *
+ * See the Implementer's Guidelines for information about where this file
+ * should be located on your system and for more details of its use:
+ *    http://www.khronos.org/registry/implementers_guide.pdf
+ *
+ * This file should be included as
+ *        #include <KHR/khrplatform.h>
+ * by Khronos client API header files that use its types and defines.
+ *
+ * The types in khrplatform.h should only be used to define API-specific types.
+ *
+ * Types defined in khrplatform.h:
+ *    khronos_int8_t              signed   8  bit
+ *    khronos_uint8_t             unsigned 8  bit
+ *    khronos_int16_t             signed   16 bit
+ *    khronos_uint16_t            unsigned 16 bit
+ *    khronos_int32_t             signed   32 bit
+ *    khronos_uint32_t            unsigned 32 bit
+ *    khronos_int64_t             signed   64 bit
+ *    khronos_uint64_t            unsigned 64 bit
+ *    khronos_intptr_t            signed   same number of bits as a pointer
+ *    khronos_uintptr_t           unsigned same number of bits as a pointer
+ *    khronos_ssize_t             signed   size
+ *    khronos_usize_t             unsigned size
+ *    khronos_float_t             signed   32 bit floating point
+ *    khronos_time_ns_t           unsigned 64 bit time in nanoseconds
+ *    khronos_utime_nanoseconds_t unsigned time interval or absolute time in
+ *                                         nanoseconds
+ *    khronos_stime_nanoseconds_t signed time interval in nanoseconds
+ *    khronos_boolean_enum_t      enumerated boolean type. This should
+ *      only be used as a base type when a client API's boolean type is
+ *      an enum. Client APIs which use an integer or other type for
+ *      booleans cannot use this as the base type for their boolean.
+ *
+ * Tokens defined in khrplatform.h:
+ *
+ *    KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
+ *
+ *    KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
+ *    KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
+ *
+ * Calling convention macros defined in this file:
+ *    KHRONOS_APICALL
+ *    KHRONOS_APIENTRY
+ *    KHRONOS_APIATTRIBUTES
+ *
+ * These may be used in function prototypes as:
+ *
+ *      KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
+ *                                  int arg1,
+ *                                  int arg2) KHRONOS_APIATTRIBUTES;
+ */
+
+/*-------------------------------------------------------------------------
+ * Definition of KHRONOS_APICALL
+ *-------------------------------------------------------------------------
+ * This precedes the return type of the function in the function prototype.
+ */
+#if defined(_WIN32) && !defined(__SCITECH_SNAP__)
+#   define KHRONOS_APICALL __declspec(dllimport)
+#elif defined (__SYMBIAN32__)
+#   define KHRONOS_APICALL IMPORT_C
+#elif defined(ANDROID)
+#   define KHRONOS_APICALL __attribute__((visibility("default")))
+#else
+#   define KHRONOS_APICALL
+#endif
+
+/*-------------------------------------------------------------------------
+ * Definition of KHRONOS_APIENTRY
+ *-------------------------------------------------------------------------
+ * This follows the return type of the function  and precedes the function
+ * name in the function prototype.
+ */
+#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
+    /* Win32 but not WinCE */
+#   define KHRONOS_APIENTRY __stdcall
+#else
+#   define KHRONOS_APIENTRY
+#endif
+
+/*-------------------------------------------------------------------------
+ * Definition of KHRONOS_APIATTRIBUTES
+ *-------------------------------------------------------------------------
+ * This follows the closing parenthesis of the function prototype arguments.
+ */
+#if defined (__ARMCC_2__)
+#define KHRONOS_APIATTRIBUTES __softfp
+#else
+#define KHRONOS_APIATTRIBUTES
+#endif
+
+/*-------------------------------------------------------------------------
+ * basic type definitions
+ *-----------------------------------------------------------------------*/
+#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
+
+
+/*
+ * Using <stdint.h>
+ */
+#include <stdint.h>
+typedef int32_t                 khronos_int32_t;
+typedef uint32_t                khronos_uint32_t;
+typedef int64_t                 khronos_int64_t;
+typedef uint64_t                khronos_uint64_t;
+#define KHRONOS_SUPPORT_INT64   1
+#define KHRONOS_SUPPORT_FLOAT   1
+
+#elif defined(__VMS ) || defined(__sgi)
+
+/*
+ * Using <inttypes.h>
+ */
+#include <inttypes.h>
+typedef int32_t                 khronos_int32_t;
+typedef uint32_t                khronos_uint32_t;
+typedef int64_t                 khronos_int64_t;
+typedef uint64_t                khronos_uint64_t;
+#define KHRONOS_SUPPORT_INT64   1
+#define KHRONOS_SUPPORT_FLOAT   1
+
+#elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
+
+/*
+ * Win32
+ */
+typedef __int32                 khronos_int32_t;
+typedef unsigned __int32        khronos_uint32_t;
+typedef __int64                 khronos_int64_t;
+typedef unsigned __int64        khronos_uint64_t;
+#define KHRONOS_SUPPORT_INT64   1
+#define KHRONOS_SUPPORT_FLOAT   1
+
+#elif defined(__sun__) || defined(__digital__)
+
+/*
+ * Sun or Digital
+ */
+typedef int                     khronos_int32_t;
+typedef unsigned int            khronos_uint32_t;
+#if defined(__arch64__) || defined(_LP64)
+typedef long int                khronos_int64_t;
+typedef unsigned long int       khronos_uint64_t;
+#else
+typedef long long int           khronos_int64_t;
+typedef unsigned long long int  khronos_uint64_t;
+#endif /* __arch64__ */
+#define KHRONOS_SUPPORT_INT64   1
+#define KHRONOS_SUPPORT_FLOAT   1
+
+#elif 0
+
+/*
+ * Hypothetical platform with no float or int64 support
+ */
+typedef int                     khronos_int32_t;
+typedef unsigned int            khronos_uint32_t;
+#define KHRONOS_SUPPORT_INT64   0
+#define KHRONOS_SUPPORT_FLOAT   0
+
+#else
+
+/*
+ * Generic fallback
+ */
+#include <stdint.h>
+typedef int32_t                 khronos_int32_t;
+typedef uint32_t                khronos_uint32_t;
+typedef int64_t                 khronos_int64_t;
+typedef uint64_t                khronos_uint64_t;
+#define KHRONOS_SUPPORT_INT64   1
+#define KHRONOS_SUPPORT_FLOAT   1
+
+#endif
+
+
+/*
+ * Types that are (so far) the same on all platforms
+ */
+typedef signed   char          khronos_int8_t;
+typedef unsigned char          khronos_uint8_t;
+typedef signed   short int     khronos_int16_t;
+typedef unsigned short int     khronos_uint16_t;
+typedef signed   long  int     khronos_intptr_t;
+typedef unsigned long  int     khronos_uintptr_t;
+typedef signed   long  int     khronos_ssize_t;
+typedef unsigned long  int     khronos_usize_t;
+
+#if KHRONOS_SUPPORT_FLOAT
+/*
+ * Float type
+ */
+typedef          float         khronos_float_t;
+#endif
+
+#if KHRONOS_SUPPORT_INT64
+/* Time types
+ *
+ * These types can be used to represent a time interval in nanoseconds or
+ * an absolute Unadjusted System Time.  Unadjusted System Time is the number
+ * of nanoseconds since some arbitrary system event (e.g. since the last
+ * time the system booted).  The Unadjusted System Time is an unsigned
+ * 64 bit value that wraps back to 0 every 584 years.  Time intervals
+ * may be either signed or unsigned.
+ */
+typedef khronos_uint64_t       khronos_utime_nanoseconds_t;
+typedef khronos_int64_t        khronos_stime_nanoseconds_t;
+#endif
+
+/*
+ * Dummy value used to pad enum types to 32 bits.
+ */
+#ifndef KHRONOS_MAX_ENUM
+#define KHRONOS_MAX_ENUM 0x7FFFFFFF
+#endif
+
+/*
+ * Enumerated boolean type
+ *
+ * Values other than zero should be considered to be true.  Therefore
+ * comparisons should not be made against KHRONOS_TRUE.
+ */
+typedef enum {
+    KHRONOS_FALSE = 0,
+    KHRONOS_TRUE  = 1,
+    KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
+} khronos_boolean_enum_t;
+
+#endif /* __khrplatform_h_ */
diff --git a/system/include/MODULE_LICENSE_MIT b/system/include/MODULE_LICENSE_MIT
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/system/include/MODULE_LICENSE_MIT
diff --git a/system/include/virtgpu_drm.h b/system/include/virtgpu_drm.h
new file mode 100644
index 0000000..a13e20c
--- /dev/null
+++ b/system/include/virtgpu_drm.h
@@ -0,0 +1,246 @@
+/*
+ * Copyright 2013 Red Hat
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+#ifndef VIRTGPU_DRM_H
+#define VIRTGPU_DRM_H
+
+#include "drm.h"
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/* Please note that modifications to all structs defined here are
+ * subject to backwards-compatibility constraints.
+ *
+ * Do not use pointers, use __u64 instead for 32 bit / 64 bit user/kernel
+ * compatibility Keep fields aligned to their size
+ */
+
+#define DRM_VIRTGPU_MAP         0x01
+#define DRM_VIRTGPU_EXECBUFFER  0x02
+#define DRM_VIRTGPU_GETPARAM    0x03
+#define DRM_VIRTGPU_RESOURCE_CREATE 0x04
+#define DRM_VIRTGPU_RESOURCE_INFO     0x05
+#define DRM_VIRTGPU_TRANSFER_FROM_HOST 0x06
+#define DRM_VIRTGPU_TRANSFER_TO_HOST 0x07
+#define DRM_VIRTGPU_WAIT     0x08
+#define DRM_VIRTGPU_GET_CAPS  0x09
+#define DRM_VIRTGPU_RESOURCE_CREATE_BLOB 0x0a
+#define DRM_VIRTGPU_CONTEXT_INIT 0x0b
+
+#define VIRTGPU_EXECBUF_FENCE_FD_IN	0x01
+#define VIRTGPU_EXECBUF_FENCE_FD_OUT	0x02
+#define VIRTGPU_EXECBUF_RING_IDX	0x04
+#define VIRTGPU_EXECBUF_FLAGS  (\
+		VIRTGPU_EXECBUF_FENCE_FD_IN |\
+		VIRTGPU_EXECBUF_FENCE_FD_OUT |\
+		VIRTGPU_EXECBUF_RING_IDX |\
+		0)
+
+struct drm_virtgpu_map {
+	__u64 offset; /* use for mmap system call */
+	__u32 handle;
+	__u32 pad;
+};
+
+struct drm_virtgpu_execbuffer {
+	__u32 flags;
+	__u32 size;
+	__u64 command; /* void* */
+	__u64 bo_handles;
+	__u32 num_bo_handles;
+	__s32 fence_fd; /* in/out fence fd (see VIRTGPU_EXECBUF_FENCE_FD_IN/OUT) */
+	__u32 ring_idx; /* command ring index (see VIRTGPU_EXECBUF_RING_IDX) */
+	__u32 pad;
+};
+
+#define VIRTGPU_PARAM_3D_FEATURES 1 /* do we have 3D features in the hw */
+#define VIRTGPU_PARAM_CAPSET_QUERY_FIX 2 /* do we have the capset fix */
+#define VIRTGPU_PARAM_RESOURCE_BLOB 3 /* DRM_VIRTGPU_RESOURCE_CREATE_BLOB */
+#define VIRTGPU_PARAM_HOST_VISIBLE 4 /* Host blob resources are mappable */
+#define VIRTGPU_PARAM_CROSS_DEVICE 5 /* Cross virtio-device resource sharing  */
+#define VIRTGPU_PARAM_CONTEXT_INIT 6 /* DRM_VIRTGPU_CONTEXT_INIT */
+#define VIRTGPU_PARAM_SUPPORTED_CAPSET_IDs 7 /* Bitmask of supported capability set ids */
+
+struct drm_virtgpu_getparam {
+	__u64 param;
+	__u64 value;
+};
+
+/* NO_BO flags? NO resource flag? */
+/* resource flag for y_0_top */
+struct drm_virtgpu_resource_create {
+	__u32 target;
+	__u32 format;
+	__u32 bind;
+	__u32 width;
+	__u32 height;
+	__u32 depth;
+	__u32 array_size;
+	__u32 last_level;
+	__u32 nr_samples;
+	__u32 flags;
+	__u32 bo_handle; /* if this is set - recreate a new resource attached to this bo ? */
+	__u32 res_handle;  /* returned by kernel */
+	__u32 size;        /* validate transfer in the host */
+	__u32 stride;      /* validate transfer in the host */
+};
+
+struct drm_virtgpu_resource_info {
+	__u32 bo_handle;
+	__u32 res_handle;
+	__u32 size;
+	__u32 blob_mem;
+};
+
+struct drm_virtgpu_3d_box {
+	__u32 x;
+	__u32 y;
+	__u32 z;
+	__u32 w;
+	__u32 h;
+	__u32 d;
+};
+
+struct drm_virtgpu_3d_transfer_to_host {
+	__u32 bo_handle;
+	struct drm_virtgpu_3d_box box;
+	__u32 level;
+	__u32 offset;
+	__u32 stride;
+	__u32 layer_stride;
+};
+
+struct drm_virtgpu_3d_transfer_from_host {
+	__u32 bo_handle;
+	struct drm_virtgpu_3d_box box;
+	__u32 level;
+	__u32 offset;
+	__u32 stride;
+	__u32 layer_stride;
+};
+
+#define VIRTGPU_WAIT_NOWAIT 1 /* like it */
+struct drm_virtgpu_3d_wait {
+	__u32 handle; /* 0 is an invalid handle */
+	__u32 flags;
+};
+
+struct drm_virtgpu_get_caps {
+	__u32 cap_set_id;
+	__u32 cap_set_ver;
+	__u64 addr;
+	__u32 size;
+	__u32 pad;
+};
+
+struct drm_virtgpu_resource_create_blob {
+#define VIRTGPU_BLOB_MEM_GUEST             0x0001
+#define VIRTGPU_BLOB_MEM_HOST3D            0x0002
+#define VIRTGPU_BLOB_MEM_HOST3D_GUEST      0x0003
+
+#define VIRTGPU_BLOB_FLAG_USE_MAPPABLE     0x0001
+#define VIRTGPU_BLOB_FLAG_USE_SHAREABLE    0x0002
+#define VIRTGPU_BLOB_FLAG_USE_CROSS_DEVICE 0x0004
+	/* zero is invalid blob_mem */
+	__u32 blob_mem;
+	__u32 blob_flags;
+	__u32 bo_handle;
+	__u32 res_handle;
+	__u64 size;
+
+	/*
+	 * for 3D contexts with VIRTGPU_BLOB_MEM_HOST3D_GUEST and
+	 * VIRTGPU_BLOB_MEM_HOST3D otherwise, must be zero.
+	 */
+	__u32 pad;
+	__u32 cmd_size;
+	__u64 cmd;
+	__u64 blob_id;
+};
+
+#define VIRTGPU_CONTEXT_PARAM_CAPSET_ID       0x0001
+#define VIRTGPU_CONTEXT_PARAM_NUM_RINGS       0x0002
+#define VIRTGPU_CONTEXT_PARAM_POLL_RINGS_MASK 0x0003
+struct drm_virtgpu_context_set_param {
+	__u64 param;
+	__u64 value;
+};
+
+struct drm_virtgpu_context_init {
+	__u32 num_params;
+	__u32 pad;
+
+	/* pointer to drm_virtgpu_context_set_param array */
+	__u64 ctx_set_params;
+};
+
+#define DRM_IOCTL_VIRTGPU_MAP \
+	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_MAP, struct drm_virtgpu_map)
+
+#define DRM_IOCTL_VIRTGPU_EXECBUFFER \
+	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_EXECBUFFER,\
+		struct drm_virtgpu_execbuffer)
+
+#define DRM_IOCTL_VIRTGPU_GETPARAM \
+	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_GETPARAM,\
+		struct drm_virtgpu_getparam)
+
+#define DRM_IOCTL_VIRTGPU_RESOURCE_CREATE			\
+	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_RESOURCE_CREATE,	\
+		struct drm_virtgpu_resource_create)
+
+#define DRM_IOCTL_VIRTGPU_RESOURCE_INFO \
+	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_RESOURCE_INFO, \
+		 struct drm_virtgpu_resource_info)
+
+#define DRM_IOCTL_VIRTGPU_TRANSFER_FROM_HOST \
+	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_TRANSFER_FROM_HOST,	\
+		struct drm_virtgpu_3d_transfer_from_host)
+
+#define DRM_IOCTL_VIRTGPU_TRANSFER_TO_HOST \
+	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_TRANSFER_TO_HOST,	\
+		struct drm_virtgpu_3d_transfer_to_host)
+
+#define DRM_IOCTL_VIRTGPU_WAIT				\
+	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_WAIT,	\
+		struct drm_virtgpu_3d_wait)
+
+#define DRM_IOCTL_VIRTGPU_GET_CAPS \
+	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_GET_CAPS, \
+	struct drm_virtgpu_get_caps)
+
+#define DRM_IOCTL_VIRTGPU_RESOURCE_CREATE_BLOB				\
+	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_RESOURCE_CREATE_BLOB,	\
+		struct drm_virtgpu_resource_create_blob)
+
+#define DRM_IOCTL_VIRTGPU_CONTEXT_INIT					\
+	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_CONTEXT_INIT,		\
+		struct drm_virtgpu_context_init)
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif
diff --git a/system/magma/magma.cpp b/system/magma/magma.cpp
new file mode 100644
index 0000000..3b6efd4
--- /dev/null
+++ b/system/magma/magma.cpp
@@ -0,0 +1,362 @@
+// Copyright (C) 2023 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <assert.h>
+#include <fcntl.h>
+#include <lib/magma/magma_common_defs.h>
+#include <stdarg.h>
+#include <stdint.h>
+#include <string.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <virtgpu_drm.h>
+#include <xf86drm.h>
+
+#include <limits>
+#include <mutex>
+#include <thread>
+#include <unordered_map>
+
+#include "AddressSpaceStream.h"
+#include "EncoderDebug.h"
+#include "magma_enc.h"
+
+static uint64_t get_ns_monotonic(bool raw) {
+    struct timespec time;
+    int ret = clock_gettime(raw ? CLOCK_MONOTONIC_RAW : CLOCK_MONOTONIC, &time);
+    if (ret < 0) return 0;
+    return static_cast<uint64_t>(time.tv_sec) * 1000000000ULL + time.tv_nsec;
+}
+
+class MagmaClientContext : public magma_encoder_context_t {
+   public:
+    MagmaClientContext(AddressSpaceStream* stream);
+
+    AddressSpaceStream* stream() {
+        return reinterpret_cast<AddressSpaceStream*>(magma_encoder_context_t::m_stream);
+    }
+
+    magma_status_t get_fd_for_buffer(magma_buffer_t buffer, int* fd_out);
+
+    std::mutex& mutex() { return m_mutex_; }
+
+    static magma_status_t magma_device_import(void* self, magma_handle_t device_channel,
+                                              magma_device_t* device_out);
+    static magma_status_t magma_device_query(void* self, magma_device_t device, uint64_t id,
+                                             magma_handle_t* handle_out, uint64_t* value_out);
+    static magma_status_t magma_buffer_export(void* self, magma_buffer_t buffer,
+                                              magma_handle_t* handle_out);
+    static magma_status_t magma_poll(void* self, magma_poll_item_t* items, uint32_t count,
+                                     uint64_t timeout_ns);
+    static magma_status_t magma_connection_create_buffer(void* self, magma_connection_t connection,
+                                                         uint64_t size, uint64_t* size_out,
+                                                         magma_buffer_t* buffer_out,
+                                                         magma_buffer_id_t* id_out);
+    static void magma_connection_release_buffer(void* self, magma_connection_t connection,
+                                                magma_buffer_t buffer);
+
+    static void set_thread_local_context_lock(std::unique_lock<std::mutex>* lock) { t_lock = lock; }
+
+    static std::unique_lock<std::mutex>* get_thread_local_context_lock() { return t_lock; }
+
+    magma_device_import_client_proc_t magma_device_import_enc_;
+    magma_device_query_client_proc_t magma_device_query_enc_;
+    magma_poll_client_proc_t magma_poll_enc_;
+    magma_connection_create_buffer_client_proc_t magma_connection_create_buffer_enc_;
+    magma_connection_release_buffer_client_proc_t magma_connection_release_buffer_enc_;
+
+    int render_node_fd_;
+
+    // Stores buffer info upon creation.
+    struct BufferInfo {
+        magma_connection_t connection;  // Owning connection.
+        uint64_t size;                  // Actual size.
+        magma_buffer_id_t id;           // Id.
+    };
+    std::unordered_map<magma_buffer_t, BufferInfo> buffer_info_;
+
+    std::mutex m_mutex_;
+    static thread_local std::unique_lock<std::mutex>* t_lock;
+};
+
+// This makes the mutex lock available to decoding methods that can take time
+// (eg magma_poll), to prevent one thread from locking out others.
+class ContextLock {
+   public:
+    ContextLock(MagmaClientContext* context) : m_context_(context), m_lock_(context->mutex()) {
+        m_context_->set_thread_local_context_lock(&m_lock_);
+    }
+
+    ~ContextLock() { m_context_->set_thread_local_context_lock(nullptr); }
+
+   private:
+    MagmaClientContext* m_context_;
+    std::unique_lock<std::mutex> m_lock_;
+};
+
+// static
+thread_local std::unique_lock<std::mutex>* MagmaClientContext::t_lock;
+
+MagmaClientContext::MagmaClientContext(AddressSpaceStream* stream)
+    : magma_encoder_context_t(stream, new ChecksumCalculator) {
+    magma_device_import_enc_ = magma_client_context_t::magma_device_import;
+    magma_device_query_enc_ = magma_client_context_t::magma_device_query;
+    magma_poll_enc_ = magma_client_context_t::magma_poll;
+    magma_connection_create_buffer_enc_ = magma_client_context_t::magma_connection_create_buffer;
+
+    magma_client_context_t::magma_device_import = &MagmaClientContext::magma_device_import;
+    magma_client_context_t::magma_device_query = &MagmaClientContext::magma_device_query;
+    magma_client_context_t::magma_buffer_export = &MagmaClientContext::magma_buffer_export;
+    magma_client_context_t::magma_poll = &MagmaClientContext::magma_poll;
+    magma_client_context_t::magma_connection_create_buffer =
+        &MagmaClientContext::magma_connection_create_buffer;
+    magma_client_context_t::magma_connection_release_buffer =
+        &MagmaClientContext::magma_connection_release_buffer;
+}
+
+// static
+magma_status_t MagmaClientContext::magma_device_import(void* self, magma_handle_t device_channel,
+                                                       magma_device_t* device_out) {
+    auto context = reinterpret_cast<MagmaClientContext*>(self);
+
+    magma_handle_t placeholder = 0xacbd1234;  // not used
+
+    magma_status_t status = context->magma_device_import_enc_(self, placeholder, device_out);
+
+    // The local fd isn't needed, just close it.
+    int fd = device_channel;
+    close(fd);
+
+    return status;
+}
+
+magma_status_t MagmaClientContext::get_fd_for_buffer(magma_buffer_t buffer, int* fd_out) {
+    *fd_out = -1;
+
+    auto it = buffer_info_.find(buffer);
+    if (it == buffer_info_.end()) {
+        ALOGE("%s: buffer (%lu) not found in map", __func__, buffer);
+        return MAGMA_STATUS_INVALID_ARGS;
+    }
+    auto& info = it->second;
+
+    // TODO(fxbug.dev/122604): Evaluate deferred guest resource creation.
+    auto blob = VirtGpuDevice::getInstance(VirtGpuCapset::kCapsetGfxStream)
+                    .createBlob({.size = info.size,
+                                 .flags = kBlobFlagMappable | kBlobFlagShareable,
+                                 .blobMem = kBlobMemHost3d,
+                                 .blobId = info.id});
+    if (!blob) {
+        return MAGMA_STATUS_INTERNAL_ERROR;
+    }
+
+    VirtGpuExternalHandle handle{};
+    int result = blob->exportBlob(handle);
+    if (result != 0 || handle.osHandle < 0) {
+        return MAGMA_STATUS_INTERNAL_ERROR;
+    }
+
+    *fd_out = handle.osHandle;
+
+    return MAGMA_STATUS_OK;
+}
+
+magma_status_t MagmaClientContext::magma_device_query(void* self, magma_device_t device,
+                                                      uint64_t id, magma_handle_t* handle_out,
+                                                      uint64_t* value_out) {
+    auto context = reinterpret_cast<MagmaClientContext*>(self);
+
+    magma_buffer_t buffer = 0;
+    uint64_t value = 0;
+    {
+        magma_handle_t handle;
+        magma_status_t status = context->magma_device_query_enc_(self, device, id, &handle, &value);
+        if (status != MAGMA_STATUS_OK) {
+            ALOGE("magma_device_query_enc failed: %d\n", status);
+            return status;
+        }
+        // magma_buffer_t and magma_handle_t are both gem_handles on the server.
+        buffer = handle;
+    }
+
+    if (!buffer) {
+        if (!value_out) return MAGMA_STATUS_INVALID_ARGS;
+
+        *value_out = value;
+
+        if (handle_out) {
+            *handle_out = -1;
+        }
+
+        return MAGMA_STATUS_OK;
+    }
+
+    if (!handle_out) return MAGMA_STATUS_INVALID_ARGS;
+
+    int fd;
+    magma_status_t status = context->get_fd_for_buffer(buffer, &fd);
+    if (status != MAGMA_STATUS_OK) return status;
+
+    *handle_out = fd;
+
+    return MAGMA_STATUS_OK;
+}
+
+magma_status_t MagmaClientContext::magma_buffer_export(void* self, magma_buffer_t buffer,
+                                                       magma_handle_t* handle_out) {
+    auto context = reinterpret_cast<MagmaClientContext*>(self);
+
+    int fd;
+    magma_status_t status = context->get_fd_for_buffer(buffer, &fd);
+    if (status != MAGMA_STATUS_OK) return status;
+
+    *handle_out = fd;
+
+    return MAGMA_STATUS_OK;
+}
+
+// We can't pass a non-zero timeout to the server, as that would block the server from handling
+// requests from other threads. So we busy wait here, which isn't ideal; however if the server did
+// block, gfxstream would busy wait for the response anyway.
+magma_status_t MagmaClientContext::magma_poll(void* self, magma_poll_item_t* items, uint32_t count,
+                                              uint64_t timeout_ns) {
+    auto context = reinterpret_cast<MagmaClientContext*>(self);
+
+    int64_t time_start = static_cast<int64_t>(get_ns_monotonic(false));
+
+    int64_t abs_timeout_ns = time_start + timeout_ns;
+
+    if (abs_timeout_ns < time_start) {
+        abs_timeout_ns = std::numeric_limits<int64_t>::max();
+    }
+
+    bool warned_for_long_poll = false;
+
+    while (true) {
+        magma_status_t status = context->magma_poll_enc_(self, items, count, 0);
+
+        if (status != MAGMA_STATUS_TIMED_OUT) return status;
+
+        // Not ready, allow other threads to work in with us
+        get_thread_local_context_lock()->unlock();
+
+        std::this_thread::yield();
+
+        int64_t time_now = static_cast<int64_t>(get_ns_monotonic(false));
+
+        // TODO(fxb/122604): Add back-off to the busy loop, ideally based on recent sleep
+        // patterns (e.g. start polling shortly before next expected burst).
+        if (!warned_for_long_poll && time_now - time_start > 5000000000) {
+            ALOGE("magma_poll: long poll detected (%lu us)", (time_now - time_start) / 1000);
+            warned_for_long_poll = true;
+        }
+
+        if (time_now >= abs_timeout_ns) break;
+
+        get_thread_local_context_lock()->lock();
+    }
+
+    return MAGMA_STATUS_TIMED_OUT;
+}
+
+// Magma 1.0 no longer tracks buffer size and id on behalf of the client, so we mirror it here.
+magma_status_t MagmaClientContext::magma_connection_create_buffer(void* self,
+                                                                  magma_connection_t connection,
+                                                                  uint64_t size, uint64_t* size_out,
+                                                                  magma_buffer_t* buffer_out,
+                                                                  magma_buffer_id_t* id_out) {
+    auto context = reinterpret_cast<MagmaClientContext*>(self);
+
+    // TODO(b/277219980): support guest-allocated buffers
+    magma_status_t status = context->magma_connection_create_buffer_enc_(
+        self, connection, size, size_out, buffer_out, id_out);
+    if (status != MAGMA_STATUS_OK) return status;
+
+    auto [_, inserted] = context->buffer_info_.emplace(
+        *buffer_out, BufferInfo{.connection = connection, .size = *size_out, .id = *id_out});
+    if (!inserted) {
+        ALOGE("magma_connection_create_buffer: duplicate entry in buffer info map");
+        return MAGMA_STATUS_INTERNAL_ERROR;
+    }
+
+    return MAGMA_STATUS_OK;
+}
+
+void MagmaClientContext::magma_connection_release_buffer(void* self, magma_connection_t connection,
+                                                         magma_buffer_t buffer) {
+    auto context = reinterpret_cast<MagmaClientContext*>(self);
+
+    context->magma_connection_release_buffer_enc_(self, connection, buffer);
+
+    // Invalid buffer or connection is treated as no-op by magma, so only log as verbose.
+    auto it = context->buffer_info_.find(buffer);
+    if (it == context->buffer_info_.end()) {
+        ALOGV("magma_connection_release_buffer: buffer (%lu) not found in map", buffer);
+        return;
+    }
+    if (it->second.connection != connection) {
+        ALOGV(
+            "magma_connection_release_buffer: buffer (%lu) attempted release using wrong "
+            "connection (expected %lu, received %lu)",
+            buffer, it->second.connection, connection);
+        return;
+    }
+    context->buffer_info_.erase(it);
+}
+
+template <typename T, typename U>
+static T SafeCast(const U& value) {
+    if (value > std::numeric_limits<T>::max() || value < std::numeric_limits<T>::min()) {
+        abort();
+    }
+    return static_cast<T>(value);
+}
+
+// We have a singleton client context for all threads.  We want all client
+// threads served by a single server RenderThread.
+MagmaClientContext* GetMagmaContext() {
+    static MagmaClientContext* s_context;
+    static std::once_flag once_flag;
+
+    std::call_once(once_flag, []() {
+        auto stream = createVirtioGpuAddressSpaceStream(nullptr);
+        assert(stream);
+
+        // RenderThread expects flags: send zero 'clientFlags' to the host.
+        {
+            auto pClientFlags =
+                reinterpret_cast<unsigned int*>(stream->allocBuffer(sizeof(unsigned int)));
+            *pClientFlags = 0;
+            stream->commitBuffer(sizeof(unsigned int));
+        }
+
+        s_context = new MagmaClientContext(stream);
+        auto render_node_fd =
+            VirtGpuDevice::getInstance(VirtGpuCapset::kCapsetGfxStream).getDeviceHandle();
+        s_context->render_node_fd_ = SafeCast<int>(render_node_fd);
+
+        ALOGE("Created new context\n");
+        fflush(stdout);
+    });
+
+    return s_context;
+}
+
+// Used in magma_entry.cpp
+// Always lock around the encoding methods because we have a singleton context.
+#define GET_CONTEXT                              \
+    MagmaClientContext* ctx = GetMagmaContext(); \
+    ContextLock lock(ctx)
+
+#include "magma_entry.cpp"
diff --git a/system/magma/magma_enc/magma_client_context.cpp b/system/magma/magma_enc/magma_client_context.cpp
new file mode 100644
index 0000000..298c11f
--- /dev/null
+++ b/system/magma/magma_enc/magma_client_context.cpp
@@ -0,0 +1,64 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+
+
+#include <string.h>
+#include "magma_client_context.h"
+
+
+#include <stdio.h>
+
+int magma_client_context_t::initDispatchByName(void *(*getProc)(const char *, void *userData), void *userData)
+{
+	magma_device_import = (magma_device_import_client_proc_t) getProc("magma_device_import", userData);
+	magma_device_release = (magma_device_release_client_proc_t) getProc("magma_device_release", userData);
+	magma_device_query = (magma_device_query_client_proc_t) getProc("magma_device_query", userData);
+	magma_device_create_connection = (magma_device_create_connection_client_proc_t) getProc("magma_device_create_connection", userData);
+	magma_connection_release = (magma_connection_release_client_proc_t) getProc("magma_connection_release", userData);
+	magma_connection_get_error = (magma_connection_get_error_client_proc_t) getProc("magma_connection_get_error", userData);
+	magma_connection_create_context = (magma_connection_create_context_client_proc_t) getProc("magma_connection_create_context", userData);
+	magma_connection_release_context = (magma_connection_release_context_client_proc_t) getProc("magma_connection_release_context", userData);
+	magma_connection_create_buffer = (magma_connection_create_buffer_client_proc_t) getProc("magma_connection_create_buffer", userData);
+	magma_connection_release_buffer = (magma_connection_release_buffer_client_proc_t) getProc("magma_connection_release_buffer", userData);
+	magma_connection_import_buffer = (magma_connection_import_buffer_client_proc_t) getProc("magma_connection_import_buffer", userData);
+	magma_connection_create_semaphore = (magma_connection_create_semaphore_client_proc_t) getProc("magma_connection_create_semaphore", userData);
+	magma_connection_release_semaphore = (magma_connection_release_semaphore_client_proc_t) getProc("magma_connection_release_semaphore", userData);
+	magma_connection_import_semaphore = (magma_connection_import_semaphore_client_proc_t) getProc("magma_connection_import_semaphore", userData);
+	magma_connection_perform_buffer_op = (magma_connection_perform_buffer_op_client_proc_t) getProc("magma_connection_perform_buffer_op", userData);
+	magma_connection_map_buffer = (magma_connection_map_buffer_client_proc_t) getProc("magma_connection_map_buffer", userData);
+	magma_connection_unmap_buffer = (magma_connection_unmap_buffer_client_proc_t) getProc("magma_connection_unmap_buffer", userData);
+	magma_connection_execute_command = (magma_connection_execute_command_client_proc_t) getProc("magma_connection_execute_command", userData);
+	magma_connection_execute_command_fudge = (magma_connection_execute_command_fudge_client_proc_t) getProc("magma_connection_execute_command_fudge", userData);
+	magma_connection_execute_immediate_commands = (magma_connection_execute_immediate_commands_client_proc_t) getProc("magma_connection_execute_immediate_commands", userData);
+	magma_connection_execute_immediate_commands_fudge = (magma_connection_execute_immediate_commands_fudge_client_proc_t) getProc("magma_connection_execute_immediate_commands_fudge", userData);
+	magma_connection_flush = (magma_connection_flush_client_proc_t) getProc("magma_connection_flush", userData);
+	magma_connection_get_notification_channel_handle = (magma_connection_get_notification_channel_handle_client_proc_t) getProc("magma_connection_get_notification_channel_handle", userData);
+	magma_connection_read_notification_channel = (magma_connection_read_notification_channel_client_proc_t) getProc("magma_connection_read_notification_channel", userData);
+	magma_buffer_clean_cache = (magma_buffer_clean_cache_client_proc_t) getProc("magma_buffer_clean_cache", userData);
+	magma_buffer_set_cache_policy = (magma_buffer_set_cache_policy_client_proc_t) getProc("magma_buffer_set_cache_policy", userData);
+	magma_buffer_get_cache_policy = (magma_buffer_get_cache_policy_client_proc_t) getProc("magma_buffer_get_cache_policy", userData);
+	magma_buffer_set_name = (magma_buffer_set_name_client_proc_t) getProc("magma_buffer_set_name", userData);
+	magma_buffer_set_name_fudge = (magma_buffer_set_name_fudge_client_proc_t) getProc("magma_buffer_set_name_fudge", userData);
+	magma_buffer_get_info = (magma_buffer_get_info_client_proc_t) getProc("magma_buffer_get_info", userData);
+	magma_buffer_get_handle = (magma_buffer_get_handle_client_proc_t) getProc("magma_buffer_get_handle", userData);
+	magma_buffer_export = (magma_buffer_export_client_proc_t) getProc("magma_buffer_export", userData);
+	magma_semaphore_signal = (magma_semaphore_signal_client_proc_t) getProc("magma_semaphore_signal", userData);
+	magma_semaphore_reset = (magma_semaphore_reset_client_proc_t) getProc("magma_semaphore_reset", userData);
+	magma_semaphore_export = (magma_semaphore_export_client_proc_t) getProc("magma_semaphore_export", userData);
+	magma_poll = (magma_poll_client_proc_t) getProc("magma_poll", userData);
+	magma_initialize_tracing = (magma_initialize_tracing_client_proc_t) getProc("magma_initialize_tracing", userData);
+	magma_initialize_logging = (magma_initialize_logging_client_proc_t) getProc("magma_initialize_logging", userData);
+	magma_connection_enable_performance_counter_access = (magma_connection_enable_performance_counter_access_client_proc_t) getProc("magma_connection_enable_performance_counter_access", userData);
+	magma_connection_enable_performance_counters = (magma_connection_enable_performance_counters_client_proc_t) getProc("magma_connection_enable_performance_counters", userData);
+	magma_connection_create_performance_counter_buffer_pool = (magma_connection_create_performance_counter_buffer_pool_client_proc_t) getProc("magma_connection_create_performance_counter_buffer_pool", userData);
+	magma_connection_release_performance_counter_buffer_pool = (magma_connection_release_performance_counter_buffer_pool_client_proc_t) getProc("magma_connection_release_performance_counter_buffer_pool", userData);
+	magma_connection_add_performance_counter_buffer_offsets_to_pool = (magma_connection_add_performance_counter_buffer_offsets_to_pool_client_proc_t) getProc("magma_connection_add_performance_counter_buffer_offsets_to_pool", userData);
+	magma_connection_remove_performance_counter_buffer_from_pool = (magma_connection_remove_performance_counter_buffer_from_pool_client_proc_t) getProc("magma_connection_remove_performance_counter_buffer_from_pool", userData);
+	magma_connection_dump_performance_counters = (magma_connection_dump_performance_counters_client_proc_t) getProc("magma_connection_dump_performance_counters", userData);
+	magma_connection_clear_performance_counters = (magma_connection_clear_performance_counters_client_proc_t) getProc("magma_connection_clear_performance_counters", userData);
+	magma_connection_read_performance_counter_completion = (magma_connection_read_performance_counter_completion_client_proc_t) getProc("magma_connection_read_performance_counter_completion", userData);
+	magma_virt_connection_create_image = (magma_virt_connection_create_image_client_proc_t) getProc("magma_virt_connection_create_image", userData);
+	magma_virt_connection_get_image_info = (magma_virt_connection_get_image_info_client_proc_t) getProc("magma_virt_connection_get_image_info", userData);
+	return 0;
+}
+
diff --git a/system/magma/magma_enc/magma_client_context.h b/system/magma/magma_enc/magma_client_context.h
new file mode 100644
index 0000000..7502894
--- /dev/null
+++ b/system/magma/magma_enc/magma_client_context.h
@@ -0,0 +1,71 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+#ifndef __magma_client_context_t_h
+#define __magma_client_context_t_h
+
+#include "magma_client_proc.h"
+
+#include "magma_types.h"
+
+
+struct magma_client_context_t {
+
+	magma_device_import_client_proc_t magma_device_import;
+	magma_device_release_client_proc_t magma_device_release;
+	magma_device_query_client_proc_t magma_device_query;
+	magma_device_create_connection_client_proc_t magma_device_create_connection;
+	magma_connection_release_client_proc_t magma_connection_release;
+	magma_connection_get_error_client_proc_t magma_connection_get_error;
+	magma_connection_create_context_client_proc_t magma_connection_create_context;
+	magma_connection_release_context_client_proc_t magma_connection_release_context;
+	magma_connection_create_buffer_client_proc_t magma_connection_create_buffer;
+	magma_connection_release_buffer_client_proc_t magma_connection_release_buffer;
+	magma_connection_import_buffer_client_proc_t magma_connection_import_buffer;
+	magma_connection_create_semaphore_client_proc_t magma_connection_create_semaphore;
+	magma_connection_release_semaphore_client_proc_t magma_connection_release_semaphore;
+	magma_connection_import_semaphore_client_proc_t magma_connection_import_semaphore;
+	magma_connection_perform_buffer_op_client_proc_t magma_connection_perform_buffer_op;
+	magma_connection_map_buffer_client_proc_t magma_connection_map_buffer;
+	magma_connection_unmap_buffer_client_proc_t magma_connection_unmap_buffer;
+	magma_connection_execute_command_client_proc_t magma_connection_execute_command;
+	magma_connection_execute_command_fudge_client_proc_t magma_connection_execute_command_fudge;
+	magma_connection_execute_immediate_commands_client_proc_t magma_connection_execute_immediate_commands;
+	magma_connection_execute_immediate_commands_fudge_client_proc_t magma_connection_execute_immediate_commands_fudge;
+	magma_connection_flush_client_proc_t magma_connection_flush;
+	magma_connection_get_notification_channel_handle_client_proc_t magma_connection_get_notification_channel_handle;
+	magma_connection_read_notification_channel_client_proc_t magma_connection_read_notification_channel;
+	magma_buffer_clean_cache_client_proc_t magma_buffer_clean_cache;
+	magma_buffer_set_cache_policy_client_proc_t magma_buffer_set_cache_policy;
+	magma_buffer_get_cache_policy_client_proc_t magma_buffer_get_cache_policy;
+	magma_buffer_set_name_client_proc_t magma_buffer_set_name;
+	magma_buffer_set_name_fudge_client_proc_t magma_buffer_set_name_fudge;
+	magma_buffer_get_info_client_proc_t magma_buffer_get_info;
+	magma_buffer_get_handle_client_proc_t magma_buffer_get_handle;
+	magma_buffer_export_client_proc_t magma_buffer_export;
+	magma_semaphore_signal_client_proc_t magma_semaphore_signal;
+	magma_semaphore_reset_client_proc_t magma_semaphore_reset;
+	magma_semaphore_export_client_proc_t magma_semaphore_export;
+	magma_poll_client_proc_t magma_poll;
+	magma_initialize_tracing_client_proc_t magma_initialize_tracing;
+	magma_initialize_logging_client_proc_t magma_initialize_logging;
+	magma_connection_enable_performance_counter_access_client_proc_t magma_connection_enable_performance_counter_access;
+	magma_connection_enable_performance_counters_client_proc_t magma_connection_enable_performance_counters;
+	magma_connection_create_performance_counter_buffer_pool_client_proc_t magma_connection_create_performance_counter_buffer_pool;
+	magma_connection_release_performance_counter_buffer_pool_client_proc_t magma_connection_release_performance_counter_buffer_pool;
+	magma_connection_add_performance_counter_buffer_offsets_to_pool_client_proc_t magma_connection_add_performance_counter_buffer_offsets_to_pool;
+	magma_connection_remove_performance_counter_buffer_from_pool_client_proc_t magma_connection_remove_performance_counter_buffer_from_pool;
+	magma_connection_dump_performance_counters_client_proc_t magma_connection_dump_performance_counters;
+	magma_connection_clear_performance_counters_client_proc_t magma_connection_clear_performance_counters;
+	magma_connection_read_performance_counter_completion_client_proc_t magma_connection_read_performance_counter_completion;
+	magma_virt_connection_create_image_client_proc_t magma_virt_connection_create_image;
+	magma_virt_connection_get_image_info_client_proc_t magma_virt_connection_get_image_info;
+	virtual ~magma_client_context_t() {}
+
+	typedef magma_client_context_t *CONTEXT_ACCESSOR_TYPE(void);
+	static void setContextAccessor(CONTEXT_ACCESSOR_TYPE *f);
+	int initDispatchByName( void *(*getProc)(const char *name, void *userData), void *userData);
+	virtual void setError(unsigned int  error){ (void)error; }
+	virtual unsigned int getError(){ return 0; }
+};
+
+#endif
diff --git a/system/magma/magma_enc/magma_client_proc.h b/system/magma/magma_enc/magma_client_proc.h
new file mode 100644
index 0000000..8d68f36
--- /dev/null
+++ b/system/magma/magma_enc/magma_client_proc.h
@@ -0,0 +1,66 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+#ifndef __magma_client_proc_t_h
+#define __magma_client_proc_t_h
+
+
+
+#include "magma_types.h"
+#ifdef _MSC_VER
+#include <stdint.h>
+#endif
+#ifndef magma_APIENTRY
+#define magma_APIENTRY 
+#endif
+typedef magma_status_t (magma_APIENTRY *magma_device_import_client_proc_t) (void * ctx, magma_handle_t, magma_device_t*);
+typedef void (magma_APIENTRY *magma_device_release_client_proc_t) (void * ctx, magma_device_t);
+typedef magma_status_t (magma_APIENTRY *magma_device_query_client_proc_t) (void * ctx, magma_device_t, uint64_t, magma_handle_t*, uint64_t*);
+typedef magma_status_t (magma_APIENTRY *magma_device_create_connection_client_proc_t) (void * ctx, magma_device_t, magma_connection_t*);
+typedef void (magma_APIENTRY *magma_connection_release_client_proc_t) (void * ctx, magma_connection_t);
+typedef magma_status_t (magma_APIENTRY *magma_connection_get_error_client_proc_t) (void * ctx, magma_connection_t);
+typedef magma_status_t (magma_APIENTRY *magma_connection_create_context_client_proc_t) (void * ctx, magma_connection_t, uint32_t*);
+typedef void (magma_APIENTRY *magma_connection_release_context_client_proc_t) (void * ctx, magma_connection_t, uint32_t);
+typedef magma_status_t (magma_APIENTRY *magma_connection_create_buffer_client_proc_t) (void * ctx, magma_connection_t, uint64_t, uint64_t*, magma_buffer_t*, magma_buffer_id_t*);
+typedef void (magma_APIENTRY *magma_connection_release_buffer_client_proc_t) (void * ctx, magma_connection_t, magma_buffer_t);
+typedef magma_status_t (magma_APIENTRY *magma_connection_import_buffer_client_proc_t) (void * ctx, magma_connection_t, magma_handle_t, uint64_t*, magma_buffer_t*, magma_buffer_id_t*);
+typedef magma_status_t (magma_APIENTRY *magma_connection_create_semaphore_client_proc_t) (void * ctx, magma_connection_t, magma_semaphore_t*, magma_semaphore_id_t*);
+typedef void (magma_APIENTRY *magma_connection_release_semaphore_client_proc_t) (void * ctx, magma_connection_t, magma_semaphore_t);
+typedef magma_status_t (magma_APIENTRY *magma_connection_import_semaphore_client_proc_t) (void * ctx, magma_connection_t, magma_handle_t, magma_semaphore_t*, magma_semaphore_id_t*);
+typedef magma_status_t (magma_APIENTRY *magma_connection_perform_buffer_op_client_proc_t) (void * ctx, magma_connection_t, magma_buffer_t, uint32_t, uint64_t, uint64_t);
+typedef magma_status_t (magma_APIENTRY *magma_connection_map_buffer_client_proc_t) (void * ctx, magma_connection_t, uint64_t, magma_buffer_t, uint64_t, uint64_t, uint64_t);
+typedef void (magma_APIENTRY *magma_connection_unmap_buffer_client_proc_t) (void * ctx, magma_connection_t, uint64_t, magma_buffer_t);
+typedef magma_status_t (magma_APIENTRY *magma_connection_execute_command_client_proc_t) (void * ctx, magma_connection_t, uint32_t, magma_command_descriptor_t*);
+typedef magma_status_t (magma_APIENTRY *magma_connection_execute_command_fudge_client_proc_t) (void * ctx, magma_connection_t, uint32_t, void*, uint64_t);
+typedef magma_status_t (magma_APIENTRY *magma_connection_execute_immediate_commands_client_proc_t) (void * ctx, magma_connection_t, uint32_t, uint64_t, magma_inline_command_buffer_t*);
+typedef magma_status_t (magma_APIENTRY *magma_connection_execute_immediate_commands_fudge_client_proc_t) (void * ctx, magma_connection_t, uint32_t, uint64_t, void*, uint64_t, uint64_t*);
+typedef magma_status_t (magma_APIENTRY *magma_connection_flush_client_proc_t) (void * ctx, magma_connection_t);
+typedef magma_handle_t (magma_APIENTRY *magma_connection_get_notification_channel_handle_client_proc_t) (void * ctx, magma_connection_t);
+typedef magma_status_t (magma_APIENTRY *magma_connection_read_notification_channel_client_proc_t) (void * ctx, magma_connection_t, void*, uint64_t, uint64_t*, magma_bool_t*);
+typedef magma_status_t (magma_APIENTRY *magma_buffer_clean_cache_client_proc_t) (void * ctx, magma_buffer_t, uint64_t, uint64_t, magma_cache_operation_t);
+typedef magma_status_t (magma_APIENTRY *magma_buffer_set_cache_policy_client_proc_t) (void * ctx, magma_buffer_t, magma_cache_policy_t);
+typedef magma_status_t (magma_APIENTRY *magma_buffer_get_cache_policy_client_proc_t) (void * ctx, magma_buffer_t, magma_cache_policy_t*);
+typedef magma_status_t (magma_APIENTRY *magma_buffer_set_name_client_proc_t) (void * ctx, magma_buffer_t, const char*);
+typedef magma_status_t (magma_APIENTRY *magma_buffer_set_name_fudge_client_proc_t) (void * ctx, magma_buffer_t, void*, uint64_t);
+typedef magma_status_t (magma_APIENTRY *magma_buffer_get_info_client_proc_t) (void * ctx, magma_buffer_t, magma_buffer_info_t*);
+typedef magma_status_t (magma_APIENTRY *magma_buffer_get_handle_client_proc_t) (void * ctx, magma_buffer_t, magma_handle_t*);
+typedef magma_status_t (magma_APIENTRY *magma_buffer_export_client_proc_t) (void * ctx, magma_buffer_t, magma_handle_t*);
+typedef void (magma_APIENTRY *magma_semaphore_signal_client_proc_t) (void * ctx, magma_semaphore_t);
+typedef void (magma_APIENTRY *magma_semaphore_reset_client_proc_t) (void * ctx, magma_semaphore_t);
+typedef magma_status_t (magma_APIENTRY *magma_semaphore_export_client_proc_t) (void * ctx, magma_semaphore_t, magma_handle_t*);
+typedef magma_status_t (magma_APIENTRY *magma_poll_client_proc_t) (void * ctx, magma_poll_item_t*, uint32_t, uint64_t);
+typedef magma_status_t (magma_APIENTRY *magma_initialize_tracing_client_proc_t) (void * ctx, magma_handle_t);
+typedef magma_status_t (magma_APIENTRY *magma_initialize_logging_client_proc_t) (void * ctx, magma_handle_t);
+typedef magma_status_t (magma_APIENTRY *magma_connection_enable_performance_counter_access_client_proc_t) (void * ctx, magma_connection_t, magma_handle_t);
+typedef magma_status_t (magma_APIENTRY *magma_connection_enable_performance_counters_client_proc_t) (void * ctx, magma_connection_t, uint64_t*, uint64_t);
+typedef magma_status_t (magma_APIENTRY *magma_connection_create_performance_counter_buffer_pool_client_proc_t) (void * ctx, magma_connection_t, magma_perf_count_pool_t*, magma_handle_t*);
+typedef magma_status_t (magma_APIENTRY *magma_connection_release_performance_counter_buffer_pool_client_proc_t) (void * ctx, magma_connection_t, magma_perf_count_pool_t);
+typedef magma_status_t (magma_APIENTRY *magma_connection_add_performance_counter_buffer_offsets_to_pool_client_proc_t) (void * ctx, magma_connection_t, magma_perf_count_pool_t, const magma_buffer_offset_t*, uint64_t);
+typedef magma_status_t (magma_APIENTRY *magma_connection_remove_performance_counter_buffer_from_pool_client_proc_t) (void * ctx, magma_connection_t, magma_perf_count_pool_t, magma_buffer_t);
+typedef magma_status_t (magma_APIENTRY *magma_connection_dump_performance_counters_client_proc_t) (void * ctx, magma_connection_t, magma_perf_count_pool_t, uint32_t);
+typedef magma_status_t (magma_APIENTRY *magma_connection_clear_performance_counters_client_proc_t) (void * ctx, magma_connection_t, uint64_t*, uint64_t);
+typedef magma_status_t (magma_APIENTRY *magma_connection_read_performance_counter_completion_client_proc_t) (void * ctx, magma_connection_t, magma_perf_count_pool_t, uint32_t*, uint64_t*, uint32_t*, uint64_t*, uint32_t*);
+typedef magma_status_t (magma_APIENTRY *magma_virt_connection_create_image_client_proc_t) (void * ctx, magma_connection_t, magma_image_create_info_t*, uint64_t*, magma_buffer_t*, magma_buffer_id_t*);
+typedef magma_status_t (magma_APIENTRY *magma_virt_connection_get_image_info_client_proc_t) (void * ctx, magma_connection_t, magma_buffer_t, magma_image_info_t*);
+
+
+#endif
diff --git a/system/magma/magma_enc/magma_enc.cpp b/system/magma/magma_enc/magma_enc.cpp
new file mode 100644
index 0000000..4b41c12
--- /dev/null
+++ b/system/magma/magma_enc/magma_enc.cpp
@@ -0,0 +1,2244 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+
+
+#include <string.h>
+#include "magma_opcodes.h"
+
+#include "magma_enc.h"
+
+
+#include <vector>
+
+#include <stdio.h>
+
+// TODO(fxbug.dev/122605): Why is modification needed for these two includes?
+#include "aemu/base/Tracing.h"
+#include "cutils/log.h"
+
+#include "EncoderDebug.h"
+
+using gfxstream::IOStream;
+
+namespace {
+
+void enc_unsupported()
+{
+	ALOGE("Function is unsupported\n");
+}
+
+magma_status_t magma_device_import_enc(void *self , magma_handle_t device_channel, magma_device_t* device_out)
+{
+	ENCODER_DEBUG_LOG("magma_device_import(device_channel:%u, device_out:%p)", device_channel, device_out);
+	AEMU_SCOPED_TRACE("magma_device_import encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_device_out =  sizeof(magma_device_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_device_import;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &device_channel, 4); ptr += 4;
+	memcpy(ptr, &__size_device_out, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(device_out, __size_device_out);
+	if (useChecksum) checksumCalculator->addBuffer(device_out, __size_device_out);
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_device_import: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void magma_device_release_enc(void *self , magma_device_t device)
+{
+	ENCODER_DEBUG_LOG("magma_device_release(device:%lu)", device);
+	AEMU_SCOPED_TRACE("magma_device_release encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_device_release;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &device, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+magma_status_t magma_device_query_enc(void *self , magma_device_t device, uint64_t id, magma_handle_t* result_buffer_out, uint64_t* result_out)
+{
+	ENCODER_DEBUG_LOG("magma_device_query(device:%lu, id:%lu, result_buffer_out:%p, result_out:%p)", device, id, result_buffer_out, result_out);
+	AEMU_SCOPED_TRACE("magma_device_query encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_result_buffer_out =  sizeof(magma_handle_t);
+	const unsigned int __size_result_out =  sizeof(uint64_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 8 + 0 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_device_query;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &device, 8); ptr += 8;
+		memcpy(ptr, &id, 8); ptr += 8;
+	memcpy(ptr, &__size_result_buffer_out, 4); ptr += 4;
+	memcpy(ptr, &__size_result_out, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(result_buffer_out, __size_result_buffer_out);
+	if (useChecksum) checksumCalculator->addBuffer(result_buffer_out, __size_result_buffer_out);
+	stream->readback(result_out, __size_result_out);
+	if (useChecksum) checksumCalculator->addBuffer(result_out, __size_result_out);
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_device_query: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_device_create_connection_enc(void *self , magma_device_t device, magma_connection_t* connection_out)
+{
+	ENCODER_DEBUG_LOG("magma_device_create_connection(device:%lu, connection_out:%p)", device, connection_out);
+	AEMU_SCOPED_TRACE("magma_device_create_connection encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_connection_out =  sizeof(magma_connection_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_device_create_connection;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &device, 8); ptr += 8;
+	memcpy(ptr, &__size_connection_out, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(connection_out, __size_connection_out);
+	if (useChecksum) checksumCalculator->addBuffer(connection_out, __size_connection_out);
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_device_create_connection: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void magma_connection_release_enc(void *self , magma_connection_t connection)
+{
+	ENCODER_DEBUG_LOG("magma_connection_release(connection:%lu)", connection);
+	AEMU_SCOPED_TRACE("magma_connection_release encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_connection_release;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+magma_status_t magma_connection_get_error_enc(void *self , magma_connection_t connection)
+{
+	ENCODER_DEBUG_LOG("magma_connection_get_error(connection:%lu)", connection);
+	AEMU_SCOPED_TRACE("magma_connection_get_error encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_connection_get_error;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_connection_get_error: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_connection_create_context_enc(void *self , magma_connection_t connection, uint32_t* context_id_out)
+{
+	ENCODER_DEBUG_LOG("magma_connection_create_context(connection:%lu, context_id_out:%p)", connection, context_id_out);
+	AEMU_SCOPED_TRACE("magma_connection_create_context encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_context_id_out =  sizeof(uint32_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_connection_create_context;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+	memcpy(ptr, &__size_context_id_out, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(context_id_out, __size_context_id_out);
+	if (useChecksum) checksumCalculator->addBuffer(context_id_out, __size_context_id_out);
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_connection_create_context: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void magma_connection_release_context_enc(void *self , magma_connection_t connection, uint32_t context_id)
+{
+	ENCODER_DEBUG_LOG("magma_connection_release_context(connection:%lu, context_id:%u)", connection, context_id);
+	AEMU_SCOPED_TRACE("magma_connection_release_context encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_connection_release_context;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+		memcpy(ptr, &context_id, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+magma_status_t magma_connection_create_buffer_enc(void *self , magma_connection_t connection, uint64_t size, uint64_t* size_out, magma_buffer_t* buffer_out, magma_buffer_id_t* id_out)
+{
+	ENCODER_DEBUG_LOG("magma_connection_create_buffer(connection:%lu, size:%lu, size_out:%p, buffer_out:%p, id_out:%p)", connection, size, size_out, buffer_out, id_out);
+	AEMU_SCOPED_TRACE("magma_connection_create_buffer encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_size_out =  sizeof(uint64_t);
+	const unsigned int __size_buffer_out =  sizeof(magma_buffer_t);
+	const unsigned int __size_id_out =  sizeof(magma_buffer_id_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 8 + 0 + 0 + 0 + 3*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_connection_create_buffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+		memcpy(ptr, &size, 8); ptr += 8;
+	memcpy(ptr, &__size_size_out, 4); ptr += 4;
+	memcpy(ptr, &__size_buffer_out, 4); ptr += 4;
+	memcpy(ptr, &__size_id_out, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(size_out, __size_size_out);
+	if (useChecksum) checksumCalculator->addBuffer(size_out, __size_size_out);
+	stream->readback(buffer_out, __size_buffer_out);
+	if (useChecksum) checksumCalculator->addBuffer(buffer_out, __size_buffer_out);
+	stream->readback(id_out, __size_id_out);
+	if (useChecksum) checksumCalculator->addBuffer(id_out, __size_id_out);
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_connection_create_buffer: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void magma_connection_release_buffer_enc(void *self , magma_connection_t connection, magma_buffer_t buffer)
+{
+	ENCODER_DEBUG_LOG("magma_connection_release_buffer(connection:%lu, buffer:%lu)", connection, buffer);
+	AEMU_SCOPED_TRACE("magma_connection_release_buffer encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_connection_release_buffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+		memcpy(ptr, &buffer, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+magma_status_t magma_connection_import_buffer_enc(void *self , magma_connection_t connection, magma_handle_t buffer_handle, uint64_t* size_out, magma_buffer_t* buffer_out, magma_buffer_id_t* id_out)
+{
+	ENCODER_DEBUG_LOG("magma_connection_import_buffer(connection:%lu, buffer_handle:%u, size_out:%p, buffer_out:%p, id_out:%p)", connection, buffer_handle, size_out, buffer_out, id_out);
+	AEMU_SCOPED_TRACE("magma_connection_import_buffer encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_size_out =  sizeof(uint64_t);
+	const unsigned int __size_buffer_out =  sizeof(magma_buffer_t);
+	const unsigned int __size_id_out =  sizeof(magma_buffer_id_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 4 + 0 + 0 + 0 + 3*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_connection_import_buffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+		memcpy(ptr, &buffer_handle, 4); ptr += 4;
+	memcpy(ptr, &__size_size_out, 4); ptr += 4;
+	memcpy(ptr, &__size_buffer_out, 4); ptr += 4;
+	memcpy(ptr, &__size_id_out, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(size_out, __size_size_out);
+	if (useChecksum) checksumCalculator->addBuffer(size_out, __size_size_out);
+	stream->readback(buffer_out, __size_buffer_out);
+	if (useChecksum) checksumCalculator->addBuffer(buffer_out, __size_buffer_out);
+	stream->readback(id_out, __size_id_out);
+	if (useChecksum) checksumCalculator->addBuffer(id_out, __size_id_out);
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_connection_import_buffer: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_connection_create_semaphore_enc(void *self , magma_connection_t connection, magma_semaphore_t* semaphore_out, magma_semaphore_id_t* id_out)
+{
+	ENCODER_DEBUG_LOG("magma_connection_create_semaphore(connection:%lu, semaphore_out:%p, id_out:%p)", connection, semaphore_out, id_out);
+	AEMU_SCOPED_TRACE("magma_connection_create_semaphore encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_semaphore_out =  sizeof(magma_semaphore_t);
+	const unsigned int __size_id_out =  sizeof(magma_semaphore_id_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 0 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_connection_create_semaphore;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+	memcpy(ptr, &__size_semaphore_out, 4); ptr += 4;
+	memcpy(ptr, &__size_id_out, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(semaphore_out, __size_semaphore_out);
+	if (useChecksum) checksumCalculator->addBuffer(semaphore_out, __size_semaphore_out);
+	stream->readback(id_out, __size_id_out);
+	if (useChecksum) checksumCalculator->addBuffer(id_out, __size_id_out);
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_connection_create_semaphore: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void magma_connection_release_semaphore_enc(void *self , magma_connection_t connection, magma_semaphore_t semaphore)
+{
+	ENCODER_DEBUG_LOG("magma_connection_release_semaphore(connection:%lu, semaphore:%lu)", connection, semaphore);
+	AEMU_SCOPED_TRACE("magma_connection_release_semaphore encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_connection_release_semaphore;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+		memcpy(ptr, &semaphore, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+magma_status_t magma_connection_import_semaphore_enc(void *self , magma_connection_t connection, magma_handle_t semaphore_handle, magma_semaphore_t* semaphore_out, magma_semaphore_id_t* id_out)
+{
+	ENCODER_DEBUG_LOG("magma_connection_import_semaphore(connection:%lu, semaphore_handle:%u, semaphore_out:%p, id_out:%p)", connection, semaphore_handle, semaphore_out, id_out);
+	AEMU_SCOPED_TRACE("magma_connection_import_semaphore encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_semaphore_out =  sizeof(magma_semaphore_t);
+	const unsigned int __size_id_out =  sizeof(magma_semaphore_id_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 4 + 0 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_connection_import_semaphore;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+		memcpy(ptr, &semaphore_handle, 4); ptr += 4;
+	memcpy(ptr, &__size_semaphore_out, 4); ptr += 4;
+	memcpy(ptr, &__size_id_out, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(semaphore_out, __size_semaphore_out);
+	if (useChecksum) checksumCalculator->addBuffer(semaphore_out, __size_semaphore_out);
+	stream->readback(id_out, __size_id_out);
+	if (useChecksum) checksumCalculator->addBuffer(id_out, __size_id_out);
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_connection_import_semaphore: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_connection_perform_buffer_op_enc(void *self , magma_connection_t connection, magma_buffer_t buffer, uint32_t options, uint64_t start_offset, uint64_t length)
+{
+	ENCODER_DEBUG_LOG("magma_connection_perform_buffer_op(connection:%lu, buffer:%lu, options:%u, start_offset:%lu, length:%lu)", connection, buffer, options, start_offset, length);
+	AEMU_SCOPED_TRACE("magma_connection_perform_buffer_op encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 8 + 4 + 8 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_connection_perform_buffer_op;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+		memcpy(ptr, &buffer, 8); ptr += 8;
+		memcpy(ptr, &options, 4); ptr += 4;
+		memcpy(ptr, &start_offset, 8); ptr += 8;
+		memcpy(ptr, &length, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_connection_perform_buffer_op: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_connection_map_buffer_enc(void *self , magma_connection_t connection, uint64_t hw_va, magma_buffer_t buffer, uint64_t offset, uint64_t length, uint64_t map_flags)
+{
+	ENCODER_DEBUG_LOG("magma_connection_map_buffer(connection:%lu, hw_va:%lu, buffer:%lu, offset:%lu, length:%lu, map_flags:%lu)", connection, hw_va, buffer, offset, length, map_flags);
+	AEMU_SCOPED_TRACE("magma_connection_map_buffer encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 8 + 8 + 8 + 8 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_connection_map_buffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+		memcpy(ptr, &hw_va, 8); ptr += 8;
+		memcpy(ptr, &buffer, 8); ptr += 8;
+		memcpy(ptr, &offset, 8); ptr += 8;
+		memcpy(ptr, &length, 8); ptr += 8;
+		memcpy(ptr, &map_flags, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_connection_map_buffer: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void magma_connection_unmap_buffer_enc(void *self , magma_connection_t connection, uint64_t hw_va, magma_buffer_t buffer)
+{
+	ENCODER_DEBUG_LOG("magma_connection_unmap_buffer(connection:%lu, hw_va:%lu, buffer:%lu)", connection, hw_va, buffer);
+	AEMU_SCOPED_TRACE("magma_connection_unmap_buffer encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 8 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_connection_unmap_buffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+		memcpy(ptr, &hw_va, 8); ptr += 8;
+		memcpy(ptr, &buffer, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+magma_status_t magma_connection_execute_command_enc(void *self , magma_connection_t connection, uint32_t context_id, magma_command_descriptor_t* descriptor)
+{
+	ENCODER_DEBUG_LOG("magma_connection_execute_command(connection:%lu, context_id:%u, descriptor:%p)", connection, context_id, descriptor);
+	AEMU_SCOPED_TRACE("magma_connection_execute_command encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_descriptor =  sizeof(magma_command_descriptor_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 4 + __size_descriptor + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_connection_execute_command;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+		memcpy(ptr, &context_id, 4); ptr += 4;
+	memcpy(ptr, &__size_descriptor, 4); ptr += 4;
+	memcpy(ptr, descriptor, __size_descriptor);ptr += __size_descriptor;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_connection_execute_command: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_connection_execute_command_fudge_enc(void *self , magma_connection_t connection, uint32_t context_id, void* descriptor, uint64_t descriptor_size)
+{
+	ENCODER_DEBUG_LOG("magma_connection_execute_command_fudge(connection:%lu, context_id:%u, descriptor:%p, descriptor_size:%lu)", connection, context_id, descriptor, descriptor_size);
+	AEMU_SCOPED_TRACE("magma_connection_execute_command_fudge encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_descriptor =  descriptor_size;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 4 + __size_descriptor + 8 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_connection_execute_command_fudge;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+		memcpy(ptr, &context_id, 4); ptr += 4;
+	memcpy(ptr, &__size_descriptor, 4); ptr += 4;
+	memcpy(ptr, descriptor, __size_descriptor);ptr += __size_descriptor;
+		memcpy(ptr, &descriptor_size, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_connection_execute_command_fudge: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_connection_execute_immediate_commands_enc(void *self , magma_connection_t connection, uint32_t context_id, uint64_t command_count, magma_inline_command_buffer_t* command_buffers)
+{
+	ENCODER_DEBUG_LOG("magma_connection_execute_immediate_commands(connection:%lu, context_id:%u, command_count:%lu, command_buffers:%p)", connection, context_id, command_count, command_buffers);
+	AEMU_SCOPED_TRACE("magma_connection_execute_immediate_commands encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_command_buffers =  command_count * sizeof(magma_inline_command_buffer_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 4 + 8 + __size_command_buffers + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_connection_execute_immediate_commands;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+		memcpy(ptr, &context_id, 4); ptr += 4;
+		memcpy(ptr, &command_count, 8); ptr += 8;
+	memcpy(ptr, &__size_command_buffers, 4); ptr += 4;
+	memcpy(ptr, command_buffers, __size_command_buffers);ptr += __size_command_buffers;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_connection_execute_immediate_commands: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_connection_execute_immediate_commands_fudge_enc(void *self , magma_connection_t connection, uint32_t context_id, uint64_t command_count, void* command_buffers, uint64_t command_buffers_size, uint64_t* command_buffer_offsets)
+{
+	ENCODER_DEBUG_LOG("magma_connection_execute_immediate_commands_fudge(connection:%lu, context_id:%u, command_count:%lu, command_buffers:%p, command_buffers_size:%lu, command_buffer_offsets:%p)", connection, context_id, command_count, command_buffers, command_buffers_size, command_buffer_offsets);
+	AEMU_SCOPED_TRACE("magma_connection_execute_immediate_commands_fudge encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_command_buffers =  command_buffers_size;
+	const unsigned int __size_command_buffer_offsets =  command_count * sizeof(uint64_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 4 + 8 + __size_command_buffers + 8 + __size_command_buffer_offsets + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_connection_execute_immediate_commands_fudge;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+		memcpy(ptr, &context_id, 4); ptr += 4;
+		memcpy(ptr, &command_count, 8); ptr += 8;
+	memcpy(ptr, &__size_command_buffers, 4); ptr += 4;
+	memcpy(ptr, command_buffers, __size_command_buffers);ptr += __size_command_buffers;
+		memcpy(ptr, &command_buffers_size, 8); ptr += 8;
+	memcpy(ptr, &__size_command_buffer_offsets, 4); ptr += 4;
+	memcpy(ptr, command_buffer_offsets, __size_command_buffer_offsets);ptr += __size_command_buffer_offsets;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_connection_execute_immediate_commands_fudge: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_connection_flush_enc(void *self , magma_connection_t connection)
+{
+	ENCODER_DEBUG_LOG("magma_connection_flush(connection:%lu)", connection);
+	AEMU_SCOPED_TRACE("magma_connection_flush encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_connection_flush;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_connection_flush: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_handle_t magma_connection_get_notification_channel_handle_enc(void *self , magma_connection_t connection)
+{
+	ENCODER_DEBUG_LOG("magma_connection_get_notification_channel_handle(connection:%lu)", connection);
+	AEMU_SCOPED_TRACE("magma_connection_get_notification_channel_handle encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_connection_get_notification_channel_handle;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	magma_handle_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_connection_get_notification_channel_handle: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_connection_read_notification_channel_enc(void *self , magma_connection_t connection, void* buffer, uint64_t buffer_size, uint64_t* buffer_size_out, magma_bool_t* more_data_out)
+{
+	ENCODER_DEBUG_LOG("magma_connection_read_notification_channel(connection:%lu, buffer:%p, buffer_size:%lu, buffer_size_out:%p, more_data_out:%p)", connection, buffer, buffer_size, buffer_size_out, more_data_out);
+	AEMU_SCOPED_TRACE("magma_connection_read_notification_channel encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_buffer =  buffer_size;
+	const unsigned int __size_buffer_size_out =  sizeof(uint64_t);
+	const unsigned int __size_more_data_out =  sizeof(magma_bool_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 0 + 8 + 0 + 0 + 3*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_connection_read_notification_channel;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+	memcpy(ptr, &__size_buffer, 4); ptr += 4;
+		memcpy(ptr, &buffer_size, 8); ptr += 8;
+	memcpy(ptr, &__size_buffer_size_out, 4); ptr += 4;
+	memcpy(ptr, &__size_more_data_out, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(buffer, __size_buffer);
+	if (useChecksum) checksumCalculator->addBuffer(buffer, __size_buffer);
+	stream->readback(buffer_size_out, __size_buffer_size_out);
+	if (useChecksum) checksumCalculator->addBuffer(buffer_size_out, __size_buffer_size_out);
+	stream->readback(more_data_out, __size_more_data_out);
+	if (useChecksum) checksumCalculator->addBuffer(more_data_out, __size_more_data_out);
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_connection_read_notification_channel: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_buffer_clean_cache_enc(void *self , magma_buffer_t buffer, uint64_t offset, uint64_t size, magma_cache_operation_t operation)
+{
+	ENCODER_DEBUG_LOG("magma_buffer_clean_cache(buffer:%lu, offset:%lu, size:%lu, operation:%u)", buffer, offset, size, operation);
+	AEMU_SCOPED_TRACE("magma_buffer_clean_cache encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 8 + 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_buffer_clean_cache;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &buffer, 8); ptr += 8;
+		memcpy(ptr, &offset, 8); ptr += 8;
+		memcpy(ptr, &size, 8); ptr += 8;
+		memcpy(ptr, &operation, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_buffer_clean_cache: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_buffer_set_cache_policy_enc(void *self , magma_buffer_t buffer, magma_cache_policy_t policy)
+{
+	ENCODER_DEBUG_LOG("magma_buffer_set_cache_policy(buffer:%lu, policy:%u)", buffer, policy);
+	AEMU_SCOPED_TRACE("magma_buffer_set_cache_policy encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_buffer_set_cache_policy;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &buffer, 8); ptr += 8;
+		memcpy(ptr, &policy, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_buffer_set_cache_policy: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_buffer_get_cache_policy_enc(void *self , magma_buffer_t buffer, magma_cache_policy_t* cache_policy_out)
+{
+	ENCODER_DEBUG_LOG("magma_buffer_get_cache_policy(buffer:%lu, cache_policy_out:%p)", buffer, cache_policy_out);
+	AEMU_SCOPED_TRACE("magma_buffer_get_cache_policy encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_cache_policy_out =  sizeof(magma_cache_policy_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_buffer_get_cache_policy;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &buffer, 8); ptr += 8;
+	memcpy(ptr, &__size_cache_policy_out, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(cache_policy_out, __size_cache_policy_out);
+	if (useChecksum) checksumCalculator->addBuffer(cache_policy_out, __size_cache_policy_out);
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_buffer_get_cache_policy: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_buffer_set_name_enc(void *self , magma_buffer_t buffer, const char* name)
+{
+	ENCODER_DEBUG_LOG("magma_buffer_set_name(buffer:%lu, name:%p)", buffer, name);
+	AEMU_SCOPED_TRACE("magma_buffer_set_name encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_name =  1;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + __size_name + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_buffer_set_name;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &buffer, 8); ptr += 8;
+	memcpy(ptr, &__size_name, 4); ptr += 4;
+	memcpy(ptr, name, __size_name);ptr += __size_name;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_buffer_set_name: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_buffer_set_name_fudge_enc(void *self , magma_buffer_t buffer, void* name, uint64_t name_size)
+{
+	ENCODER_DEBUG_LOG("magma_buffer_set_name_fudge(buffer:%lu, name:%p, name_size:%lu)", buffer, name, name_size);
+	AEMU_SCOPED_TRACE("magma_buffer_set_name_fudge encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_name =  name_size;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + __size_name + 8 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_buffer_set_name_fudge;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &buffer, 8); ptr += 8;
+	memcpy(ptr, &__size_name, 4); ptr += 4;
+	memcpy(ptr, name, __size_name);ptr += __size_name;
+		memcpy(ptr, &name_size, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_buffer_set_name_fudge: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_buffer_get_info_enc(void *self , magma_buffer_t buffer, magma_buffer_info_t* info_out)
+{
+	ENCODER_DEBUG_LOG("magma_buffer_get_info(buffer:%lu, info_out:%p)", buffer, info_out);
+	AEMU_SCOPED_TRACE("magma_buffer_get_info encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_info_out =  sizeof(magma_buffer_info);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_buffer_get_info;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &buffer, 8); ptr += 8;
+	memcpy(ptr, &__size_info_out, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(info_out, __size_info_out);
+	if (useChecksum) checksumCalculator->addBuffer(info_out, __size_info_out);
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_buffer_get_info: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_buffer_get_handle_enc(void *self , magma_buffer_t buffer, magma_handle_t* handle_out)
+{
+	ENCODER_DEBUG_LOG("magma_buffer_get_handle(buffer:%lu, handle_out:%p)", buffer, handle_out);
+	AEMU_SCOPED_TRACE("magma_buffer_get_handle encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_handle_out =  sizeof(magma_handle_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_buffer_get_handle;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &buffer, 8); ptr += 8;
+	memcpy(ptr, &__size_handle_out, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(handle_out, __size_handle_out);
+	if (useChecksum) checksumCalculator->addBuffer(handle_out, __size_handle_out);
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_buffer_get_handle: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_buffer_export_enc(void *self , magma_buffer_t buffer, magma_handle_t* buffer_handle_out)
+{
+	ENCODER_DEBUG_LOG("magma_buffer_export(buffer:%lu, buffer_handle_out:%p)", buffer, buffer_handle_out);
+	AEMU_SCOPED_TRACE("magma_buffer_export encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_buffer_handle_out =  sizeof(magma_handle_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_buffer_export;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &buffer, 8); ptr += 8;
+	memcpy(ptr, &__size_buffer_handle_out, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(buffer_handle_out, __size_buffer_handle_out);
+	if (useChecksum) checksumCalculator->addBuffer(buffer_handle_out, __size_buffer_handle_out);
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_buffer_export: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void magma_semaphore_signal_enc(void *self , magma_semaphore_t semaphore)
+{
+	ENCODER_DEBUG_LOG("magma_semaphore_signal(semaphore:%lu)", semaphore);
+	AEMU_SCOPED_TRACE("magma_semaphore_signal encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_semaphore_signal;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &semaphore, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void magma_semaphore_reset_enc(void *self , magma_semaphore_t semaphore)
+{
+	ENCODER_DEBUG_LOG("magma_semaphore_reset(semaphore:%lu)", semaphore);
+	AEMU_SCOPED_TRACE("magma_semaphore_reset encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_semaphore_reset;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &semaphore, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+magma_status_t magma_semaphore_export_enc(void *self , magma_semaphore_t semaphore, magma_handle_t* semaphore_handle_out)
+{
+	ENCODER_DEBUG_LOG("magma_semaphore_export(semaphore:%lu, semaphore_handle_out:%p)", semaphore, semaphore_handle_out);
+	AEMU_SCOPED_TRACE("magma_semaphore_export encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_semaphore_handle_out =  sizeof(magma_handle_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_semaphore_export;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &semaphore, 8); ptr += 8;
+	memcpy(ptr, &__size_semaphore_handle_out, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(semaphore_handle_out, __size_semaphore_handle_out);
+	if (useChecksum) checksumCalculator->addBuffer(semaphore_handle_out, __size_semaphore_handle_out);
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_semaphore_export: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_poll_enc(void *self , magma_poll_item_t* items, uint32_t count, uint64_t timeout_ns)
+{
+	ENCODER_DEBUG_LOG("magma_poll(items:%p, count:%u, timeout_ns:%lu)", items, count, timeout_ns);
+	AEMU_SCOPED_TRACE("magma_poll encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_items =  count * sizeof(magma_poll_item_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + __size_items + 4 + 8 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_poll;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+	memcpy(ptr, &__size_items, 4); ptr += 4;
+	memcpy(ptr, items, __size_items);ptr += __size_items;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &timeout_ns, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(items, __size_items);
+	if (useChecksum) checksumCalculator->addBuffer(items, __size_items);
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_poll: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_initialize_tracing_enc(void *self , magma_handle_t channel)
+{
+	ENCODER_DEBUG_LOG("magma_initialize_tracing(channel:%u)", channel);
+	AEMU_SCOPED_TRACE("magma_initialize_tracing encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_initialize_tracing;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &channel, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_initialize_tracing: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_initialize_logging_enc(void *self , magma_handle_t channel)
+{
+	ENCODER_DEBUG_LOG("magma_initialize_logging(channel:%u)", channel);
+	AEMU_SCOPED_TRACE("magma_initialize_logging encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_initialize_logging;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &channel, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_initialize_logging: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_connection_enable_performance_counter_access_enc(void *self , magma_connection_t connection, magma_handle_t channel)
+{
+	ENCODER_DEBUG_LOG("magma_connection_enable_performance_counter_access(connection:%lu, channel:%u)", connection, channel);
+	AEMU_SCOPED_TRACE("magma_connection_enable_performance_counter_access encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_connection_enable_performance_counter_access;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+		memcpy(ptr, &channel, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_connection_enable_performance_counter_access: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_connection_enable_performance_counters_enc(void *self , magma_connection_t connection, uint64_t* counters, uint64_t counters_count)
+{
+	ENCODER_DEBUG_LOG("magma_connection_enable_performance_counters(connection:%lu, counters:%p, counters_count:%lu)", connection, counters, counters_count);
+	AEMU_SCOPED_TRACE("magma_connection_enable_performance_counters encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_counters =  counters_count * sizeof(uint64_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + __size_counters + 8 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_connection_enable_performance_counters;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+	memcpy(ptr, &__size_counters, 4); ptr += 4;
+	memcpy(ptr, counters, __size_counters);ptr += __size_counters;
+		memcpy(ptr, &counters_count, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_connection_enable_performance_counters: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_connection_create_performance_counter_buffer_pool_enc(void *self , magma_connection_t connection, magma_perf_count_pool_t* pool_id_out, magma_handle_t* notification_handle_out)
+{
+	ENCODER_DEBUG_LOG("magma_connection_create_performance_counter_buffer_pool(connection:%lu, pool_id_out:%p, notification_handle_out:%p)", connection, pool_id_out, notification_handle_out);
+	AEMU_SCOPED_TRACE("magma_connection_create_performance_counter_buffer_pool encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_pool_id_out =  sizeof(magma_perf_count_pool_t);
+	const unsigned int __size_notification_handle_out =  sizeof(magma_handle_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 0 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_connection_create_performance_counter_buffer_pool;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+	memcpy(ptr, &__size_pool_id_out, 4); ptr += 4;
+	memcpy(ptr, &__size_notification_handle_out, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(pool_id_out, __size_pool_id_out);
+	if (useChecksum) checksumCalculator->addBuffer(pool_id_out, __size_pool_id_out);
+	stream->readback(notification_handle_out, __size_notification_handle_out);
+	if (useChecksum) checksumCalculator->addBuffer(notification_handle_out, __size_notification_handle_out);
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_connection_create_performance_counter_buffer_pool: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_connection_release_performance_counter_buffer_pool_enc(void *self , magma_connection_t connection, magma_perf_count_pool_t pool_id)
+{
+	ENCODER_DEBUG_LOG("magma_connection_release_performance_counter_buffer_pool(connection:%lu, pool_id:%lu)", connection, pool_id);
+	AEMU_SCOPED_TRACE("magma_connection_release_performance_counter_buffer_pool encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_connection_release_performance_counter_buffer_pool;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+		memcpy(ptr, &pool_id, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_connection_release_performance_counter_buffer_pool: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_connection_add_performance_counter_buffer_offsets_to_pool_enc(void *self , magma_connection_t connection, magma_perf_count_pool_t pool_id, const magma_buffer_offset_t* offsets, uint64_t offsets_count)
+{
+	ENCODER_DEBUG_LOG("magma_connection_add_performance_counter_buffer_offsets_to_pool(connection:%lu, pool_id:%lu, offsets:%p, offsets_count:%lu)", connection, pool_id, offsets, offsets_count);
+	AEMU_SCOPED_TRACE("magma_connection_add_performance_counter_buffer_offsets_to_pool encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_offsets =  offsets_count * sizeof(magma_buffer_offset_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 8 + __size_offsets + 8 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_connection_add_performance_counter_buffer_offsets_to_pool;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+		memcpy(ptr, &pool_id, 8); ptr += 8;
+	memcpy(ptr, &__size_offsets, 4); ptr += 4;
+	memcpy(ptr, offsets, __size_offsets);ptr += __size_offsets;
+		memcpy(ptr, &offsets_count, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_connection_add_performance_counter_buffer_offsets_to_pool: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_connection_remove_performance_counter_buffer_from_pool_enc(void *self , magma_connection_t connection, magma_perf_count_pool_t pool_id, magma_buffer_t buffer)
+{
+	ENCODER_DEBUG_LOG("magma_connection_remove_performance_counter_buffer_from_pool(connection:%lu, pool_id:%lu, buffer:%lu)", connection, pool_id, buffer);
+	AEMU_SCOPED_TRACE("magma_connection_remove_performance_counter_buffer_from_pool encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 8 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_connection_remove_performance_counter_buffer_from_pool;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+		memcpy(ptr, &pool_id, 8); ptr += 8;
+		memcpy(ptr, &buffer, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_connection_remove_performance_counter_buffer_from_pool: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_connection_dump_performance_counters_enc(void *self , magma_connection_t connection, magma_perf_count_pool_t pool_id, uint32_t trigger_id)
+{
+	ENCODER_DEBUG_LOG("magma_connection_dump_performance_counters(connection:%lu, pool_id:%lu, trigger_id:%u)", connection, pool_id, trigger_id);
+	AEMU_SCOPED_TRACE("magma_connection_dump_performance_counters encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_connection_dump_performance_counters;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+		memcpy(ptr, &pool_id, 8); ptr += 8;
+		memcpy(ptr, &trigger_id, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_connection_dump_performance_counters: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_connection_clear_performance_counters_enc(void *self , magma_connection_t connection, uint64_t* counters, uint64_t counters_count)
+{
+	ENCODER_DEBUG_LOG("magma_connection_clear_performance_counters(connection:%lu, counters:%p, counters_count:%lu)", connection, counters, counters_count);
+	AEMU_SCOPED_TRACE("magma_connection_clear_performance_counters encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_counters =  counters_count * sizeof(uint64_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + __size_counters + 8 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_connection_clear_performance_counters;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+	memcpy(ptr, &__size_counters, 4); ptr += 4;
+	memcpy(ptr, counters, __size_counters);ptr += __size_counters;
+		memcpy(ptr, &counters_count, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_connection_clear_performance_counters: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_connection_read_performance_counter_completion_enc(void *self , magma_connection_t connection, magma_perf_count_pool_t pool_id, uint32_t* trigger_id_out, uint64_t* buffer_id_out, uint32_t* buffer_offset_out, uint64_t* time_out, uint32_t* result_flags_out)
+{
+	ENCODER_DEBUG_LOG("magma_connection_read_performance_counter_completion(connection:%lu, pool_id:%lu, trigger_id_out:%p, buffer_id_out:%p, buffer_offset_out:%p, time_out:%p, result_flags_out:%p)", connection, pool_id, trigger_id_out, buffer_id_out, buffer_offset_out, time_out, result_flags_out);
+	AEMU_SCOPED_TRACE("magma_connection_read_performance_counter_completion encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_trigger_id_out =  sizeof(uint32_t);
+	const unsigned int __size_buffer_id_out =  sizeof(uint64_t);
+	const unsigned int __size_buffer_offset_out =  sizeof(uint32_t);
+	const unsigned int __size_time_out =  sizeof(uint64_t);
+	const unsigned int __size_result_flags_out =  sizeof(uint32_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 8 + 0 + 0 + 0 + 0 + 0 + 5*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_connection_read_performance_counter_completion;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+		memcpy(ptr, &pool_id, 8); ptr += 8;
+	memcpy(ptr, &__size_trigger_id_out, 4); ptr += 4;
+	memcpy(ptr, &__size_buffer_id_out, 4); ptr += 4;
+	memcpy(ptr, &__size_buffer_offset_out, 4); ptr += 4;
+	memcpy(ptr, &__size_time_out, 4); ptr += 4;
+	memcpy(ptr, &__size_result_flags_out, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(trigger_id_out, __size_trigger_id_out);
+	if (useChecksum) checksumCalculator->addBuffer(trigger_id_out, __size_trigger_id_out);
+	stream->readback(buffer_id_out, __size_buffer_id_out);
+	if (useChecksum) checksumCalculator->addBuffer(buffer_id_out, __size_buffer_id_out);
+	stream->readback(buffer_offset_out, __size_buffer_offset_out);
+	if (useChecksum) checksumCalculator->addBuffer(buffer_offset_out, __size_buffer_offset_out);
+	stream->readback(time_out, __size_time_out);
+	if (useChecksum) checksumCalculator->addBuffer(time_out, __size_time_out);
+	stream->readback(result_flags_out, __size_result_flags_out);
+	if (useChecksum) checksumCalculator->addBuffer(result_flags_out, __size_result_flags_out);
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_connection_read_performance_counter_completion: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_virt_connection_create_image_enc(void *self , magma_connection_t connection, magma_image_create_info_t* create_info, uint64_t* size_out, magma_buffer_t* image_out, magma_buffer_id_t* buffer_id_out)
+{
+	ENCODER_DEBUG_LOG("magma_virt_connection_create_image(connection:%lu, create_info:%p, size_out:%p, image_out:%p, buffer_id_out:%p)", connection, create_info, size_out, image_out, buffer_id_out);
+	AEMU_SCOPED_TRACE("magma_virt_connection_create_image encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_create_info =  sizeof(magma_image_create_info_t);
+	const unsigned int __size_size_out =  sizeof(uint64_t);
+	const unsigned int __size_image_out =  sizeof(magma_buffer_t);
+	const unsigned int __size_buffer_id_out =  sizeof(magma_buffer_id_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + __size_create_info + 0 + 0 + 0 + 4*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_virt_connection_create_image;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+	memcpy(ptr, &__size_create_info, 4); ptr += 4;
+	memcpy(ptr, create_info, __size_create_info);ptr += __size_create_info;
+	memcpy(ptr, &__size_size_out, 4); ptr += 4;
+	memcpy(ptr, &__size_image_out, 4); ptr += 4;
+	memcpy(ptr, &__size_buffer_id_out, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(size_out, __size_size_out);
+	if (useChecksum) checksumCalculator->addBuffer(size_out, __size_size_out);
+	stream->readback(image_out, __size_image_out);
+	if (useChecksum) checksumCalculator->addBuffer(image_out, __size_image_out);
+	stream->readback(buffer_id_out, __size_buffer_id_out);
+	if (useChecksum) checksumCalculator->addBuffer(buffer_id_out, __size_buffer_id_out);
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_virt_connection_create_image: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+magma_status_t magma_virt_connection_get_image_info_enc(void *self , magma_connection_t connection, magma_buffer_t image, magma_image_info_t* image_info_out)
+{
+	ENCODER_DEBUG_LOG("magma_virt_connection_get_image_info(connection:%lu, image:%lu, image_info_out:%p)", connection, image, image_info_out);
+	AEMU_SCOPED_TRACE("magma_virt_connection_get_image_info encode");
+
+	magma_encoder_context_t *ctx = (magma_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_image_info_out =  sizeof(magma_image_info_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 8 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_magma_virt_connection_get_image_info;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &connection, 8); ptr += 8;
+		memcpy(ptr, &image, 8); ptr += 8;
+	memcpy(ptr, &__size_image_info_out, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(image_info_out, __size_image_info_out);
+	if (useChecksum) checksumCalculator->addBuffer(image_info_out, __size_image_info_out);
+
+	magma_status_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("magma_virt_connection_get_image_info: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+}  // namespace
+
+magma_encoder_context_t::magma_encoder_context_t(IOStream *stream, ChecksumCalculator *checksumCalculator)
+{
+	m_stream = stream;
+	m_checksumCalculator = checksumCalculator;
+
+	this->magma_device_import = &magma_device_import_enc;
+	this->magma_device_release = &magma_device_release_enc;
+	this->magma_device_query = &magma_device_query_enc;
+	this->magma_device_create_connection = &magma_device_create_connection_enc;
+	this->magma_connection_release = &magma_connection_release_enc;
+	this->magma_connection_get_error = &magma_connection_get_error_enc;
+	this->magma_connection_create_context = &magma_connection_create_context_enc;
+	this->magma_connection_release_context = &magma_connection_release_context_enc;
+	this->magma_connection_create_buffer = &magma_connection_create_buffer_enc;
+	this->magma_connection_release_buffer = &magma_connection_release_buffer_enc;
+	this->magma_connection_import_buffer = &magma_connection_import_buffer_enc;
+	this->magma_connection_create_semaphore = &magma_connection_create_semaphore_enc;
+	this->magma_connection_release_semaphore = &magma_connection_release_semaphore_enc;
+	this->magma_connection_import_semaphore = &magma_connection_import_semaphore_enc;
+	this->magma_connection_perform_buffer_op = &magma_connection_perform_buffer_op_enc;
+	this->magma_connection_map_buffer = &magma_connection_map_buffer_enc;
+	this->magma_connection_unmap_buffer = &magma_connection_unmap_buffer_enc;
+	this->magma_connection_execute_command = &magma_connection_execute_command_enc;
+	this->magma_connection_execute_command_fudge = &magma_connection_execute_command_fudge_enc;
+	this->magma_connection_execute_immediate_commands = &magma_connection_execute_immediate_commands_enc;
+	this->magma_connection_execute_immediate_commands_fudge = &magma_connection_execute_immediate_commands_fudge_enc;
+	this->magma_connection_flush = &magma_connection_flush_enc;
+	this->magma_connection_get_notification_channel_handle = &magma_connection_get_notification_channel_handle_enc;
+	this->magma_connection_read_notification_channel = &magma_connection_read_notification_channel_enc;
+	this->magma_buffer_clean_cache = &magma_buffer_clean_cache_enc;
+	this->magma_buffer_set_cache_policy = &magma_buffer_set_cache_policy_enc;
+	this->magma_buffer_get_cache_policy = &magma_buffer_get_cache_policy_enc;
+	this->magma_buffer_set_name = &magma_buffer_set_name_enc;
+	this->magma_buffer_set_name_fudge = &magma_buffer_set_name_fudge_enc;
+	this->magma_buffer_get_info = &magma_buffer_get_info_enc;
+	this->magma_buffer_get_handle = &magma_buffer_get_handle_enc;
+	this->magma_buffer_export = &magma_buffer_export_enc;
+	this->magma_semaphore_signal = &magma_semaphore_signal_enc;
+	this->magma_semaphore_reset = &magma_semaphore_reset_enc;
+	this->magma_semaphore_export = &magma_semaphore_export_enc;
+	this->magma_poll = &magma_poll_enc;
+	this->magma_initialize_tracing = &magma_initialize_tracing_enc;
+	this->magma_initialize_logging = &magma_initialize_logging_enc;
+	this->magma_connection_enable_performance_counter_access = &magma_connection_enable_performance_counter_access_enc;
+	this->magma_connection_enable_performance_counters = &magma_connection_enable_performance_counters_enc;
+	this->magma_connection_create_performance_counter_buffer_pool = &magma_connection_create_performance_counter_buffer_pool_enc;
+	this->magma_connection_release_performance_counter_buffer_pool = &magma_connection_release_performance_counter_buffer_pool_enc;
+	this->magma_connection_add_performance_counter_buffer_offsets_to_pool = &magma_connection_add_performance_counter_buffer_offsets_to_pool_enc;
+	this->magma_connection_remove_performance_counter_buffer_from_pool = &magma_connection_remove_performance_counter_buffer_from_pool_enc;
+	this->magma_connection_dump_performance_counters = &magma_connection_dump_performance_counters_enc;
+	this->magma_connection_clear_performance_counters = &magma_connection_clear_performance_counters_enc;
+	this->magma_connection_read_performance_counter_completion = &magma_connection_read_performance_counter_completion_enc;
+	this->magma_virt_connection_create_image = &magma_virt_connection_create_image_enc;
+	this->magma_virt_connection_get_image_info = &magma_virt_connection_get_image_info_enc;
+}
+
diff --git a/system/magma/magma_enc/magma_enc.h b/system/magma/magma_enc/magma_enc.h
new file mode 100644
index 0000000..4c270ad
--- /dev/null
+++ b/system/magma/magma_enc/magma_enc.h
@@ -0,0 +1,23 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+
+#ifndef GUARD_magma_encoder_context_t
+#define GUARD_magma_encoder_context_t
+
+#include "IOStream.h"
+#include "ChecksumCalculator.h"
+#include "magma_client_context.h"
+
+
+#include <stdint.h>
+
+struct magma_encoder_context_t : public magma_client_context_t {
+
+	gfxstream::IOStream *m_stream;
+	ChecksumCalculator *m_checksumCalculator;
+
+	magma_encoder_context_t(gfxstream::IOStream *stream, ChecksumCalculator *checksumCalculator);
+	virtual uint64_t lockAndWriteDma(void*, uint32_t) { return 0; }
+};
+
+#endif  // GUARD_magma_encoder_context_t
diff --git a/system/magma/magma_enc/magma_entry.cpp b/system/magma/magma_enc/magma_entry.cpp
new file mode 100644
index 0000000..f34c10e
--- /dev/null
+++ b/system/magma/magma_enc/magma_entry.cpp
@@ -0,0 +1,358 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+#include <stdio.h>
+#include <stdlib.h>
+#include "magma_client_context.h"
+
+extern "C" {
+	magma_status_t magma_device_import(magma_handle_t device_channel, magma_device_t* device_out);
+	void magma_device_release(magma_device_t device);
+	magma_status_t magma_device_query(magma_device_t device, uint64_t id, magma_handle_t* result_buffer_out, uint64_t* result_out);
+	magma_status_t magma_device_create_connection(magma_device_t device, magma_connection_t* connection_out);
+	void magma_connection_release(magma_connection_t connection);
+	magma_status_t magma_connection_get_error(magma_connection_t connection);
+	magma_status_t magma_connection_create_context(magma_connection_t connection, uint32_t* context_id_out);
+	void magma_connection_release_context(magma_connection_t connection, uint32_t context_id);
+	magma_status_t magma_connection_create_buffer(magma_connection_t connection, uint64_t size, uint64_t* size_out, magma_buffer_t* buffer_out, magma_buffer_id_t* id_out);
+	void magma_connection_release_buffer(magma_connection_t connection, magma_buffer_t buffer);
+	magma_status_t magma_connection_import_buffer(magma_connection_t connection, magma_handle_t buffer_handle, uint64_t* size_out, magma_buffer_t* buffer_out, magma_buffer_id_t* id_out);
+	magma_status_t magma_connection_create_semaphore(magma_connection_t connection, magma_semaphore_t* semaphore_out, magma_semaphore_id_t* id_out);
+	void magma_connection_release_semaphore(magma_connection_t connection, magma_semaphore_t semaphore);
+	magma_status_t magma_connection_import_semaphore(magma_connection_t connection, magma_handle_t semaphore_handle, magma_semaphore_t* semaphore_out, magma_semaphore_id_t* id_out);
+	magma_status_t magma_connection_perform_buffer_op(magma_connection_t connection, magma_buffer_t buffer, uint32_t options, uint64_t start_offset, uint64_t length);
+	magma_status_t magma_connection_map_buffer(magma_connection_t connection, uint64_t hw_va, magma_buffer_t buffer, uint64_t offset, uint64_t length, uint64_t map_flags);
+	void magma_connection_unmap_buffer(magma_connection_t connection, uint64_t hw_va, magma_buffer_t buffer);
+	magma_status_t magma_connection_execute_command(magma_connection_t connection, uint32_t context_id, magma_command_descriptor_t* descriptor);
+	magma_status_t magma_connection_execute_command_fudge(magma_connection_t connection, uint32_t context_id, void* descriptor, uint64_t descriptor_size);
+	magma_status_t magma_connection_execute_immediate_commands(magma_connection_t connection, uint32_t context_id, uint64_t command_count, magma_inline_command_buffer_t* command_buffers);
+	magma_status_t magma_connection_execute_immediate_commands_fudge(magma_connection_t connection, uint32_t context_id, uint64_t command_count, void* command_buffers, uint64_t command_buffers_size, uint64_t* command_buffer_offsets);
+	magma_status_t magma_connection_flush(magma_connection_t connection);
+	magma_handle_t magma_connection_get_notification_channel_handle(magma_connection_t connection);
+	magma_status_t magma_connection_read_notification_channel(magma_connection_t connection, void* buffer, uint64_t buffer_size, uint64_t* buffer_size_out, magma_bool_t* more_data_out);
+	magma_status_t magma_buffer_clean_cache(magma_buffer_t buffer, uint64_t offset, uint64_t size, magma_cache_operation_t operation);
+	magma_status_t magma_buffer_set_cache_policy(magma_buffer_t buffer, magma_cache_policy_t policy);
+	magma_status_t magma_buffer_get_cache_policy(magma_buffer_t buffer, magma_cache_policy_t* cache_policy_out);
+	magma_status_t magma_buffer_set_name(magma_buffer_t buffer, const char* name);
+	magma_status_t magma_buffer_set_name_fudge(magma_buffer_t buffer, void* name, uint64_t name_size);
+	magma_status_t magma_buffer_get_info(magma_buffer_t buffer, magma_buffer_info_t* info_out);
+	magma_status_t magma_buffer_get_handle(magma_buffer_t buffer, magma_handle_t* handle_out);
+	magma_status_t magma_buffer_export(magma_buffer_t buffer, magma_handle_t* buffer_handle_out);
+	void magma_semaphore_signal(magma_semaphore_t semaphore);
+	void magma_semaphore_reset(magma_semaphore_t semaphore);
+	magma_status_t magma_semaphore_export(magma_semaphore_t semaphore, magma_handle_t* semaphore_handle_out);
+	magma_status_t magma_poll(magma_poll_item_t* items, uint32_t count, uint64_t timeout_ns);
+	magma_status_t magma_initialize_tracing(magma_handle_t channel);
+	magma_status_t magma_initialize_logging(magma_handle_t channel);
+	magma_status_t magma_connection_enable_performance_counter_access(magma_connection_t connection, magma_handle_t channel);
+	magma_status_t magma_connection_enable_performance_counters(magma_connection_t connection, uint64_t* counters, uint64_t counters_count);
+	magma_status_t magma_connection_create_performance_counter_buffer_pool(magma_connection_t connection, magma_perf_count_pool_t* pool_id_out, magma_handle_t* notification_handle_out);
+	magma_status_t magma_connection_release_performance_counter_buffer_pool(magma_connection_t connection, magma_perf_count_pool_t pool_id);
+	magma_status_t magma_connection_add_performance_counter_buffer_offsets_to_pool(magma_connection_t connection, magma_perf_count_pool_t pool_id, const magma_buffer_offset_t* offsets, uint64_t offsets_count);
+	magma_status_t magma_connection_remove_performance_counter_buffer_from_pool(magma_connection_t connection, magma_perf_count_pool_t pool_id, magma_buffer_t buffer);
+	magma_status_t magma_connection_dump_performance_counters(magma_connection_t connection, magma_perf_count_pool_t pool_id, uint32_t trigger_id);
+	magma_status_t magma_connection_clear_performance_counters(magma_connection_t connection, uint64_t* counters, uint64_t counters_count);
+	magma_status_t magma_connection_read_performance_counter_completion(magma_connection_t connection, magma_perf_count_pool_t pool_id, uint32_t* trigger_id_out, uint64_t* buffer_id_out, uint32_t* buffer_offset_out, uint64_t* time_out, uint32_t* result_flags_out);
+	magma_status_t magma_virt_connection_create_image(magma_connection_t connection, magma_image_create_info_t* create_info, uint64_t* size_out, magma_buffer_t* image_out, magma_buffer_id_t* buffer_id_out);
+	magma_status_t magma_virt_connection_get_image_info(magma_connection_t connection, magma_buffer_t image, magma_image_info_t* image_info_out);
+};
+
+#ifndef GET_CONTEXT
+static magma_client_context_t::CONTEXT_ACCESSOR_TYPE *getCurrentContext = NULL;
+void magma_client_context_t::setContextAccessor(CONTEXT_ACCESSOR_TYPE *f) { getCurrentContext = f; }
+#define GET_CONTEXT magma_client_context_t * ctx = getCurrentContext()
+#endif
+
+magma_status_t magma_device_import(magma_handle_t device_channel, magma_device_t* device_out)
+{
+	GET_CONTEXT;
+	return ctx->magma_device_import(ctx, device_channel, device_out);
+}
+
+void magma_device_release(magma_device_t device)
+{
+	GET_CONTEXT;
+	ctx->magma_device_release(ctx, device);
+}
+
+magma_status_t magma_device_query(magma_device_t device, uint64_t id, magma_handle_t* result_buffer_out, uint64_t* result_out)
+{
+	GET_CONTEXT;
+	return ctx->magma_device_query(ctx, device, id, result_buffer_out, result_out);
+}
+
+magma_status_t magma_device_create_connection(magma_device_t device, magma_connection_t* connection_out)
+{
+	GET_CONTEXT;
+	return ctx->magma_device_create_connection(ctx, device, connection_out);
+}
+
+void magma_connection_release(magma_connection_t connection)
+{
+	GET_CONTEXT;
+	ctx->magma_connection_release(ctx, connection);
+}
+
+magma_status_t magma_connection_get_error(magma_connection_t connection)
+{
+	GET_CONTEXT;
+	return ctx->magma_connection_get_error(ctx, connection);
+}
+
+magma_status_t magma_connection_create_context(magma_connection_t connection, uint32_t* context_id_out)
+{
+	GET_CONTEXT;
+	return ctx->magma_connection_create_context(ctx, connection, context_id_out);
+}
+
+void magma_connection_release_context(magma_connection_t connection, uint32_t context_id)
+{
+	GET_CONTEXT;
+	ctx->magma_connection_release_context(ctx, connection, context_id);
+}
+
+magma_status_t magma_connection_create_buffer(magma_connection_t connection, uint64_t size, uint64_t* size_out, magma_buffer_t* buffer_out, magma_buffer_id_t* id_out)
+{
+	GET_CONTEXT;
+	return ctx->magma_connection_create_buffer(ctx, connection, size, size_out, buffer_out, id_out);
+}
+
+void magma_connection_release_buffer(magma_connection_t connection, magma_buffer_t buffer)
+{
+	GET_CONTEXT;
+	ctx->magma_connection_release_buffer(ctx, connection, buffer);
+}
+
+magma_status_t magma_connection_import_buffer(magma_connection_t connection, magma_handle_t buffer_handle, uint64_t* size_out, magma_buffer_t* buffer_out, magma_buffer_id_t* id_out)
+{
+	GET_CONTEXT;
+	return ctx->magma_connection_import_buffer(ctx, connection, buffer_handle, size_out, buffer_out, id_out);
+}
+
+magma_status_t magma_connection_create_semaphore(magma_connection_t connection, magma_semaphore_t* semaphore_out, magma_semaphore_id_t* id_out)
+{
+	GET_CONTEXT;
+	return ctx->magma_connection_create_semaphore(ctx, connection, semaphore_out, id_out);
+}
+
+void magma_connection_release_semaphore(magma_connection_t connection, magma_semaphore_t semaphore)
+{
+	GET_CONTEXT;
+	ctx->magma_connection_release_semaphore(ctx, connection, semaphore);
+}
+
+magma_status_t magma_connection_import_semaphore(magma_connection_t connection, magma_handle_t semaphore_handle, magma_semaphore_t* semaphore_out, magma_semaphore_id_t* id_out)
+{
+	GET_CONTEXT;
+	return ctx->magma_connection_import_semaphore(ctx, connection, semaphore_handle, semaphore_out, id_out);
+}
+
+magma_status_t magma_connection_perform_buffer_op(magma_connection_t connection, magma_buffer_t buffer, uint32_t options, uint64_t start_offset, uint64_t length)
+{
+	GET_CONTEXT;
+	return ctx->magma_connection_perform_buffer_op(ctx, connection, buffer, options, start_offset, length);
+}
+
+magma_status_t magma_connection_map_buffer(magma_connection_t connection, uint64_t hw_va, magma_buffer_t buffer, uint64_t offset, uint64_t length, uint64_t map_flags)
+{
+	GET_CONTEXT;
+	return ctx->magma_connection_map_buffer(ctx, connection, hw_va, buffer, offset, length, map_flags);
+}
+
+void magma_connection_unmap_buffer(magma_connection_t connection, uint64_t hw_va, magma_buffer_t buffer)
+{
+	GET_CONTEXT;
+	ctx->magma_connection_unmap_buffer(ctx, connection, hw_va, buffer);
+}
+
+magma_status_t magma_connection_execute_command(magma_connection_t connection, uint32_t context_id, magma_command_descriptor_t* descriptor)
+{
+	GET_CONTEXT;
+	return ctx->magma_connection_execute_command(ctx, connection, context_id, descriptor);
+}
+
+magma_status_t magma_connection_execute_command_fudge(magma_connection_t connection, uint32_t context_id, void* descriptor, uint64_t descriptor_size)
+{
+	GET_CONTEXT;
+	return ctx->magma_connection_execute_command_fudge(ctx, connection, context_id, descriptor, descriptor_size);
+}
+
+magma_status_t magma_connection_execute_immediate_commands(magma_connection_t connection, uint32_t context_id, uint64_t command_count, magma_inline_command_buffer_t* command_buffers)
+{
+	GET_CONTEXT;
+	return ctx->magma_connection_execute_immediate_commands(ctx, connection, context_id, command_count, command_buffers);
+}
+
+magma_status_t magma_connection_execute_immediate_commands_fudge(magma_connection_t connection, uint32_t context_id, uint64_t command_count, void* command_buffers, uint64_t command_buffers_size, uint64_t* command_buffer_offsets)
+{
+	GET_CONTEXT;
+	return ctx->magma_connection_execute_immediate_commands_fudge(ctx, connection, context_id, command_count, command_buffers, command_buffers_size, command_buffer_offsets);
+}
+
+magma_status_t magma_connection_flush(magma_connection_t connection)
+{
+	GET_CONTEXT;
+	return ctx->magma_connection_flush(ctx, connection);
+}
+
+magma_handle_t magma_connection_get_notification_channel_handle(magma_connection_t connection)
+{
+	GET_CONTEXT;
+	return ctx->magma_connection_get_notification_channel_handle(ctx, connection);
+}
+
+magma_status_t magma_connection_read_notification_channel(magma_connection_t connection, void* buffer, uint64_t buffer_size, uint64_t* buffer_size_out, magma_bool_t* more_data_out)
+{
+	GET_CONTEXT;
+	return ctx->magma_connection_read_notification_channel(ctx, connection, buffer, buffer_size, buffer_size_out, more_data_out);
+}
+
+magma_status_t magma_buffer_clean_cache(magma_buffer_t buffer, uint64_t offset, uint64_t size, magma_cache_operation_t operation)
+{
+	GET_CONTEXT;
+	return ctx->magma_buffer_clean_cache(ctx, buffer, offset, size, operation);
+}
+
+magma_status_t magma_buffer_set_cache_policy(magma_buffer_t buffer, magma_cache_policy_t policy)
+{
+	GET_CONTEXT;
+	return ctx->magma_buffer_set_cache_policy(ctx, buffer, policy);
+}
+
+magma_status_t magma_buffer_get_cache_policy(magma_buffer_t buffer, magma_cache_policy_t* cache_policy_out)
+{
+	GET_CONTEXT;
+	return ctx->magma_buffer_get_cache_policy(ctx, buffer, cache_policy_out);
+}
+
+magma_status_t magma_buffer_set_name(magma_buffer_t buffer, const char* name)
+{
+	GET_CONTEXT;
+	return ctx->magma_buffer_set_name(ctx, buffer, name);
+}
+
+magma_status_t magma_buffer_set_name_fudge(magma_buffer_t buffer, void* name, uint64_t name_size)
+{
+	GET_CONTEXT;
+	return ctx->magma_buffer_set_name_fudge(ctx, buffer, name, name_size);
+}
+
+magma_status_t magma_buffer_get_info(magma_buffer_t buffer, magma_buffer_info_t* info_out)
+{
+	GET_CONTEXT;
+	return ctx->magma_buffer_get_info(ctx, buffer, info_out);
+}
+
+magma_status_t magma_buffer_get_handle(magma_buffer_t buffer, magma_handle_t* handle_out)
+{
+	GET_CONTEXT;
+	return ctx->magma_buffer_get_handle(ctx, buffer, handle_out);
+}
+
+magma_status_t magma_buffer_export(magma_buffer_t buffer, magma_handle_t* buffer_handle_out)
+{
+	GET_CONTEXT;
+	return ctx->magma_buffer_export(ctx, buffer, buffer_handle_out);
+}
+
+void magma_semaphore_signal(magma_semaphore_t semaphore)
+{
+	GET_CONTEXT;
+	ctx->magma_semaphore_signal(ctx, semaphore);
+}
+
+void magma_semaphore_reset(magma_semaphore_t semaphore)
+{
+	GET_CONTEXT;
+	ctx->magma_semaphore_reset(ctx, semaphore);
+}
+
+magma_status_t magma_semaphore_export(magma_semaphore_t semaphore, magma_handle_t* semaphore_handle_out)
+{
+	GET_CONTEXT;
+	return ctx->magma_semaphore_export(ctx, semaphore, semaphore_handle_out);
+}
+
+magma_status_t magma_poll(magma_poll_item_t* items, uint32_t count, uint64_t timeout_ns)
+{
+	GET_CONTEXT;
+	return ctx->magma_poll(ctx, items, count, timeout_ns);
+}
+
+magma_status_t magma_initialize_tracing(magma_handle_t channel)
+{
+	GET_CONTEXT;
+	return ctx->magma_initialize_tracing(ctx, channel);
+}
+
+magma_status_t magma_initialize_logging(magma_handle_t channel)
+{
+	GET_CONTEXT;
+	return ctx->magma_initialize_logging(ctx, channel);
+}
+
+magma_status_t magma_connection_enable_performance_counter_access(magma_connection_t connection, magma_handle_t channel)
+{
+	GET_CONTEXT;
+	return ctx->magma_connection_enable_performance_counter_access(ctx, connection, channel);
+}
+
+magma_status_t magma_connection_enable_performance_counters(magma_connection_t connection, uint64_t* counters, uint64_t counters_count)
+{
+	GET_CONTEXT;
+	return ctx->magma_connection_enable_performance_counters(ctx, connection, counters, counters_count);
+}
+
+magma_status_t magma_connection_create_performance_counter_buffer_pool(magma_connection_t connection, magma_perf_count_pool_t* pool_id_out, magma_handle_t* notification_handle_out)
+{
+	GET_CONTEXT;
+	return ctx->magma_connection_create_performance_counter_buffer_pool(ctx, connection, pool_id_out, notification_handle_out);
+}
+
+magma_status_t magma_connection_release_performance_counter_buffer_pool(magma_connection_t connection, magma_perf_count_pool_t pool_id)
+{
+	GET_CONTEXT;
+	return ctx->magma_connection_release_performance_counter_buffer_pool(ctx, connection, pool_id);
+}
+
+magma_status_t magma_connection_add_performance_counter_buffer_offsets_to_pool(magma_connection_t connection, magma_perf_count_pool_t pool_id, const magma_buffer_offset_t* offsets, uint64_t offsets_count)
+{
+	GET_CONTEXT;
+	return ctx->magma_connection_add_performance_counter_buffer_offsets_to_pool(ctx, connection, pool_id, offsets, offsets_count);
+}
+
+magma_status_t magma_connection_remove_performance_counter_buffer_from_pool(magma_connection_t connection, magma_perf_count_pool_t pool_id, magma_buffer_t buffer)
+{
+	GET_CONTEXT;
+	return ctx->magma_connection_remove_performance_counter_buffer_from_pool(ctx, connection, pool_id, buffer);
+}
+
+magma_status_t magma_connection_dump_performance_counters(magma_connection_t connection, magma_perf_count_pool_t pool_id, uint32_t trigger_id)
+{
+	GET_CONTEXT;
+	return ctx->magma_connection_dump_performance_counters(ctx, connection, pool_id, trigger_id);
+}
+
+magma_status_t magma_connection_clear_performance_counters(magma_connection_t connection, uint64_t* counters, uint64_t counters_count)
+{
+	GET_CONTEXT;
+	return ctx->magma_connection_clear_performance_counters(ctx, connection, counters, counters_count);
+}
+
+magma_status_t magma_connection_read_performance_counter_completion(magma_connection_t connection, magma_perf_count_pool_t pool_id, uint32_t* trigger_id_out, uint64_t* buffer_id_out, uint32_t* buffer_offset_out, uint64_t* time_out, uint32_t* result_flags_out)
+{
+	GET_CONTEXT;
+	return ctx->magma_connection_read_performance_counter_completion(ctx, connection, pool_id, trigger_id_out, buffer_id_out, buffer_offset_out, time_out, result_flags_out);
+}
+
+magma_status_t magma_virt_connection_create_image(magma_connection_t connection, magma_image_create_info_t* create_info, uint64_t* size_out, magma_buffer_t* image_out, magma_buffer_id_t* buffer_id_out)
+{
+	GET_CONTEXT;
+	return ctx->magma_virt_connection_create_image(ctx, connection, create_info, size_out, image_out, buffer_id_out);
+}
+
+magma_status_t magma_virt_connection_get_image_info(magma_connection_t connection, magma_buffer_t image, magma_image_info_t* image_info_out)
+{
+	GET_CONTEXT;
+	return ctx->magma_virt_connection_get_image_info(ctx, connection, image, image_info_out);
+}
+
diff --git a/system/magma/magma_enc/magma_ftable.h b/system/magma/magma_enc/magma_ftable.h
new file mode 100644
index 0000000..03bc1b5
--- /dev/null
+++ b/system/magma/magma_enc/magma_ftable.h
@@ -0,0 +1,64 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+#ifndef __magma_client_ftable_t_h
+#define __magma_client_ftable_t_h
+
+
+static const struct _magma_funcs_by_name {
+	const char *name;
+	void *proc;
+} magma_funcs_by_name[] = {
+	{"magma_device_import", (void*)magma_device_import},
+	{"magma_device_release", (void*)magma_device_release},
+	{"magma_device_query", (void*)magma_device_query},
+	{"magma_device_create_connection", (void*)magma_device_create_connection},
+	{"magma_connection_release", (void*)magma_connection_release},
+	{"magma_connection_get_error", (void*)magma_connection_get_error},
+	{"magma_connection_create_context", (void*)magma_connection_create_context},
+	{"magma_connection_release_context", (void*)magma_connection_release_context},
+	{"magma_connection_create_buffer", (void*)magma_connection_create_buffer},
+	{"magma_connection_release_buffer", (void*)magma_connection_release_buffer},
+	{"magma_connection_import_buffer", (void*)magma_connection_import_buffer},
+	{"magma_connection_create_semaphore", (void*)magma_connection_create_semaphore},
+	{"magma_connection_release_semaphore", (void*)magma_connection_release_semaphore},
+	{"magma_connection_import_semaphore", (void*)magma_connection_import_semaphore},
+	{"magma_connection_perform_buffer_op", (void*)magma_connection_perform_buffer_op},
+	{"magma_connection_map_buffer", (void*)magma_connection_map_buffer},
+	{"magma_connection_unmap_buffer", (void*)magma_connection_unmap_buffer},
+	{"magma_connection_execute_command", (void*)magma_connection_execute_command},
+	{"magma_connection_execute_command_fudge", (void*)magma_connection_execute_command_fudge},
+	{"magma_connection_execute_immediate_commands", (void*)magma_connection_execute_immediate_commands},
+	{"magma_connection_execute_immediate_commands_fudge", (void*)magma_connection_execute_immediate_commands_fudge},
+	{"magma_connection_flush", (void*)magma_connection_flush},
+	{"magma_connection_get_notification_channel_handle", (void*)magma_connection_get_notification_channel_handle},
+	{"magma_connection_read_notification_channel", (void*)magma_connection_read_notification_channel},
+	{"magma_buffer_clean_cache", (void*)magma_buffer_clean_cache},
+	{"magma_buffer_set_cache_policy", (void*)magma_buffer_set_cache_policy},
+	{"magma_buffer_get_cache_policy", (void*)magma_buffer_get_cache_policy},
+	{"magma_buffer_set_name", (void*)magma_buffer_set_name},
+	{"magma_buffer_set_name_fudge", (void*)magma_buffer_set_name_fudge},
+	{"magma_buffer_get_info", (void*)magma_buffer_get_info},
+	{"magma_buffer_get_handle", (void*)magma_buffer_get_handle},
+	{"magma_buffer_export", (void*)magma_buffer_export},
+	{"magma_semaphore_signal", (void*)magma_semaphore_signal},
+	{"magma_semaphore_reset", (void*)magma_semaphore_reset},
+	{"magma_semaphore_export", (void*)magma_semaphore_export},
+	{"magma_poll", (void*)magma_poll},
+	{"magma_initialize_tracing", (void*)magma_initialize_tracing},
+	{"magma_initialize_logging", (void*)magma_initialize_logging},
+	{"magma_connection_enable_performance_counter_access", (void*)magma_connection_enable_performance_counter_access},
+	{"magma_connection_enable_performance_counters", (void*)magma_connection_enable_performance_counters},
+	{"magma_connection_create_performance_counter_buffer_pool", (void*)magma_connection_create_performance_counter_buffer_pool},
+	{"magma_connection_release_performance_counter_buffer_pool", (void*)magma_connection_release_performance_counter_buffer_pool},
+	{"magma_connection_add_performance_counter_buffer_offsets_to_pool", (void*)magma_connection_add_performance_counter_buffer_offsets_to_pool},
+	{"magma_connection_remove_performance_counter_buffer_from_pool", (void*)magma_connection_remove_performance_counter_buffer_from_pool},
+	{"magma_connection_dump_performance_counters", (void*)magma_connection_dump_performance_counters},
+	{"magma_connection_clear_performance_counters", (void*)magma_connection_clear_performance_counters},
+	{"magma_connection_read_performance_counter_completion", (void*)magma_connection_read_performance_counter_completion},
+	{"magma_virt_connection_create_image", (void*)magma_virt_connection_create_image},
+	{"magma_virt_connection_get_image_info", (void*)magma_virt_connection_get_image_info},
+};
+static const int magma_num_funcs = sizeof(magma_funcs_by_name) / sizeof(struct _magma_funcs_by_name);
+
+
+#endif
diff --git a/system/magma/magma_enc/magma_opcodes.h b/system/magma/magma_enc/magma_opcodes.h
new file mode 100644
index 0000000..f1b6a10
--- /dev/null
+++ b/system/magma/magma_enc/magma_opcodes.h
@@ -0,0 +1,58 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+#ifndef __GUARD_magma_opcodes_h_
+#define __GUARD_magma_opcodes_h_
+
+#define OP_magma_device_import 					100000
+#define OP_magma_device_release 					100001
+#define OP_magma_device_query 					100002
+#define OP_magma_device_create_connection 					100003
+#define OP_magma_connection_release 					100004
+#define OP_magma_connection_get_error 					100005
+#define OP_magma_connection_create_context 					100006
+#define OP_magma_connection_release_context 					100007
+#define OP_magma_connection_create_buffer 					100008
+#define OP_magma_connection_release_buffer 					100009
+#define OP_magma_connection_import_buffer 					100010
+#define OP_magma_connection_create_semaphore 					100011
+#define OP_magma_connection_release_semaphore 					100012
+#define OP_magma_connection_import_semaphore 					100013
+#define OP_magma_connection_perform_buffer_op 					100014
+#define OP_magma_connection_map_buffer 					100015
+#define OP_magma_connection_unmap_buffer 					100016
+#define OP_magma_connection_execute_command 					100017
+#define OP_magma_connection_execute_command_fudge 					100018
+#define OP_magma_connection_execute_immediate_commands 					100019
+#define OP_magma_connection_execute_immediate_commands_fudge 					100020
+#define OP_magma_connection_flush 					100021
+#define OP_magma_connection_get_notification_channel_handle 					100022
+#define OP_magma_connection_read_notification_channel 					100023
+#define OP_magma_buffer_clean_cache 					100024
+#define OP_magma_buffer_set_cache_policy 					100025
+#define OP_magma_buffer_get_cache_policy 					100026
+#define OP_magma_buffer_set_name 					100027
+#define OP_magma_buffer_set_name_fudge 					100028
+#define OP_magma_buffer_get_info 					100029
+#define OP_magma_buffer_get_handle 					100030
+#define OP_magma_buffer_export 					100031
+#define OP_magma_semaphore_signal 					100032
+#define OP_magma_semaphore_reset 					100033
+#define OP_magma_semaphore_export 					100034
+#define OP_magma_poll 					100035
+#define OP_magma_initialize_tracing 					100036
+#define OP_magma_initialize_logging 					100037
+#define OP_magma_connection_enable_performance_counter_access 					100038
+#define OP_magma_connection_enable_performance_counters 					100039
+#define OP_magma_connection_create_performance_counter_buffer_pool 					100040
+#define OP_magma_connection_release_performance_counter_buffer_pool 					100041
+#define OP_magma_connection_add_performance_counter_buffer_offsets_to_pool 					100042
+#define OP_magma_connection_remove_performance_counter_buffer_from_pool 					100043
+#define OP_magma_connection_dump_performance_counters 					100044
+#define OP_magma_connection_clear_performance_counters 					100045
+#define OP_magma_connection_read_performance_counter_completion 					100046
+#define OP_magma_virt_connection_create_image 					100047
+#define OP_magma_virt_connection_get_image_info 					100048
+#define OP_last 					100049
+
+
+#endif
diff --git a/system/magma/magma_enc_util.cpp b/system/magma/magma_enc_util.cpp
new file mode 100644
index 0000000..2980625
--- /dev/null
+++ b/system/magma/magma_enc_util.cpp
@@ -0,0 +1,58 @@
+// Copyright (C) 2023 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "magma_enc_util.h"
+
+#include <cstring>
+
+namespace magma_enc_util {
+
+size_t size_command_descriptor(magma_command_descriptor* descriptor) {
+    uint64_t size = sizeof(magma_command_descriptor);
+    size += sizeof(magma_exec_resource) * descriptor->resource_count;
+    size += sizeof(magma_exec_command_buffer) * descriptor->command_buffer_count;
+    size +=
+        sizeof(uint64_t) * (descriptor->wait_semaphore_count + descriptor->signal_semaphore_count);
+    return size;
+}
+
+void pack_command_descriptor(void* void_ptr, magma_connection_t connection, uint32_t context_id,
+                             magma_command_descriptor* descriptor) {
+    magma_exec_resource* resources = descriptor->resources;
+    magma_exec_command_buffer* command_buffers = descriptor->command_buffers;
+    uint64_t* semaphore_ids = descriptor->semaphore_ids;
+
+    magma_command_descriptor desc_copy = *descriptor;
+    desc_copy.resources = 0;
+    desc_copy.command_buffers = 0;
+    desc_copy.semaphore_ids = 0;
+
+    auto ptr = reinterpret_cast<uint8_t*>(void_ptr);
+
+    memcpy(ptr, &desc_copy, sizeof(magma_command_descriptor));
+    ptr += sizeof(magma_command_descriptor);
+
+    memcpy(ptr, resources, sizeof(magma_exec_resource) * descriptor->resource_count);
+    ptr += sizeof(magma_exec_resource) * descriptor->resource_count;
+
+    memcpy(ptr, command_buffers,
+           sizeof(magma_exec_command_buffer) * descriptor->command_buffer_count);
+    ptr += sizeof(magma_exec_command_buffer) * descriptor->command_buffer_count;
+
+    memcpy(
+        ptr, semaphore_ids,
+        sizeof(uint64_t) * (descriptor->wait_semaphore_count + descriptor->signal_semaphore_count));
+}
+
+}  // namespace magma_enc_util
diff --git a/system/magma/magma_enc_util.h b/system/magma/magma_enc_util.h
new file mode 100644
index 0000000..8d0097b
--- /dev/null
+++ b/system/magma/magma_enc_util.h
@@ -0,0 +1,27 @@
+// Copyright (C) 2023 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include <log/log.h>
+#include <lib/magma/magma_common_defs.h>
+#include <stddef.h>
+
+namespace magma_enc_util {
+
+size_t size_command_descriptor(magma_command_descriptor* descriptor);
+void pack_command_descriptor(void* ptr, magma_connection_t connection, uint32_t context_id,
+                             magma_command_descriptor* descriptor);
+
+}  // namespace magma_enc_util
diff --git a/system/magma/magma_types.h b/system/magma/magma_types.h
new file mode 100644
index 0000000..4dd3ff5
--- /dev/null
+++ b/system/magma/magma_types.h
@@ -0,0 +1,15 @@
+// Copyright (C) 2023 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <lib/magma/magma_common_defs.h>
diff --git a/system/magma/meson.build b/system/magma/meson.build
new file mode 100644
index 0000000..44aa7ba
--- /dev/null
+++ b/system/magma/meson.build
@@ -0,0 +1,43 @@
+# Copyright 2023 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+files_lib_magma_enc = files(
+    'magma.cpp',
+    'magma_enc_util.cpp',
+    'magma_enc/magma_enc.cpp',
+    'magma_enc/magma_entry.cpp',
+    'magma_enc/magma_client_context.cpp',
+  )
+
+inc_magma_enc = include_directories('magma_enc')
+
+lib_magma_enc = static_library(
+   'magma',
+   files_lib_magma_enc,
+   cpp_args: cpp_args + [
+      '-Wno-misleading-indentation',
+      '-Wno-unused-function',
+   ],
+   include_directories: [inc_magma, inc_magma_enc, inc_android_emu, inc_host, inc_android_compat,
+                         inc_opengl_codec, inc_opengl_system, inc_render_enc, inc_system,
+                         inc_goldfish_address_space, inc_platform],
+   link_with: [
+      lib_platform,
+      lib_stream, # for ASG
+      lib_codec_common, # for checksums
+      lib_emu_android_base, # for tracing
+      lib_android_compat # for logging
+   ],
+   dependencies: [
+    fuchsia_magma_dep,
+    dependency('libdrm')
+   ],
+)
+
+lib_magma_gfxstream_dep = declare_dependency(
+   include_directories: [
+      inc_fuchsia_magma,
+      inc_fuchsia_magma_nolib
+   ],
+   link_with: [lib_magma_enc],
+)
diff --git a/system/meson.build b/system/meson.build
new file mode 100644
index 0000000..af8f8e9
--- /dev/null
+++ b/system/meson.build
@@ -0,0 +1,13 @@
+# Copyright 2022 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+inc_magma = include_directories('magma')
+inc_opengl_system = include_directories('OpenglSystemCommon')
+inc_render_enc = include_directories('renderControl_enc')
+inc_vulkan_enc = include_directories('vulkan_enc')
+
+subdir('vulkan_enc')
+subdir('renderControl_enc')
+subdir('OpenglSystemCommon')
+subdir('vulkan')
+subdir('magma')
diff --git a/system/profiler/Android.mk b/system/profiler/Android.mk
new file mode 100644
index 0000000..3383c0d
--- /dev/null
+++ b/system/profiler/Android.mk
@@ -0,0 +1,25 @@
+LOCAL_PATH := $(call my-dir)
+
+### profiler ###########################################
+$(call emugl-begin-shared-library,libGoldfishProfiler)
+
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 30 && echo isApi30OrHigher),isApi30OrHigher)
+    LOCAL_CFLAGS += -DLOG_TAG=\"emuglProfiler\"
+
+    LOCAL_SHARED_LIBRARIES := liblog \
+        libbase
+
+    LOCAL_SRC_FILES := \
+        profiler.cpp \
+        perfetto.cpp
+
+    LOCAL_TIDY_DISABLED_SRCS := perfetto.cpp
+else
+    LOCAL_SRC_FILES := \
+        profiler_stub.cpp
+
+endif
+
+$(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
+
+$(call emugl-end-module)
\ No newline at end of file
diff --git a/system/profiler/CMakeLists.txt b/system/profiler/CMakeLists.txt
new file mode 100644
index 0000000..28035ce
--- /dev/null
+++ b/system/profiler/CMakeLists.txt
@@ -0,0 +1,10 @@
+# This is an autogenerated file! Do not edit!
+# instead run make from .../device/generic/goldfish-opengl
+# which will re-generate this file.
+android_validate_sha256("${GOLDFISH_DEVICE_ROOT}/system/profiler/Android.mk" "bbad89e505575aa9b7fe672e89c3bb581310a931cdb4849415b7085141dce536")
+set(GoldfishProfiler_src profiler_stub.cpp)
+android_add_library(TARGET GoldfishProfiler SHARED LICENSE Apache-2.0 SRC profiler_stub.cpp)
+target_include_directories(GoldfishProfiler PRIVATE ${GOLDFISH_DEVICE_ROOT}/system/profiler ${GOLDFISH_DEVICE_ROOT}/./host/include/libOpenglRender ${GOLDFISH_DEVICE_ROOT}/./system/include ${GOLDFISH_DEVICE_ROOT}/./../../../external/qemu/android/android-emugl/guest)
+target_compile_definitions(GoldfishProfiler PRIVATE "-DPLATFORM_SDK_VERSION=29" "-DGOLDFISH_HIDL_GRALLOC" "-DHOST_BUILD" "-DANDROID" "-DGL_GLEXT_PROTOTYPES" "-DPAGE_SIZE=4096" "-DGFXSTREAM" "-DENABLE_ANDROID_HEALTH_MONITOR")
+target_compile_options(GoldfishProfiler PRIVATE "-fvisibility=default" "-Wno-unused-parameter")
+target_link_libraries(GoldfishProfiler PRIVATE android-emu-shared vulkan_enc gui log _renderControl_enc GLESv2_enc GLESv1_enc OpenglCodecCommon_host cutils utils androidemu PRIVATE gralloc_cb_host GoldfishAddressSpace_host platform_host qemupipe_host)
\ No newline at end of file
diff --git a/system/profiler/perfetto.cpp b/system/profiler/perfetto.cpp
new file mode 100644
index 0000000..dd401e1
--- /dev/null
+++ b/system/profiler/perfetto.cpp
@@ -0,0 +1,69071 @@
+// Copyright (C) 2019 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// This file is automatically generated by gen_amalgamated. Do not edit.
+
+// gen_amalgamated: predefined macros
+#if !defined(PERFETTO_IMPLEMENTATION)
+#define PERFETTO_IMPLEMENTATION
+#endif
+#if !defined(GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER)
+#define GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+#endif
+#if !defined(GOOGLE_PROTOBUF_NO_RTTI)
+#define GOOGLE_PROTOBUF_NO_RTTI
+#endif
+#include "perfetto.h"
+// gen_amalgamated begin source: src/base/ctrl_c_handler.cc
+// gen_amalgamated begin header: include/perfetto/ext/base/ctrl_c_handler.h
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_CTRL_C_HANDLER_H_
+#define INCLUDE_PERFETTO_EXT_BASE_CTRL_C_HANDLER_H_
+
+namespace perfetto {
+namespace base {
+
+// On Linux/Android/Mac: installs SIGINT + SIGTERM signal handlers.
+// On Windows: installs a SetConsoleCtrlHandler() handler.
+// The passed handler must be async safe.
+using CtrlCHandlerFunction = void (*)();
+void InstallCtrCHandler(CtrlCHandlerFunction);
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_CTRL_C_HANDLER_H_
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/ctrl_c_handler.h"
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+// gen_amalgamated expanded: #include "perfetto/base/compiler.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+#include <Windows.h>
+#include <io.h>
+#else
+#include <signal.h>
+#include <unistd.h>
+#endif
+
+namespace perfetto {
+namespace base {
+
+namespace {
+CtrlCHandlerFunction g_handler = nullptr;
+}
+
+void InstallCtrCHandler(CtrlCHandlerFunction handler) {
+  PERFETTO_CHECK(g_handler == nullptr);
+  g_handler = handler;
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  auto trampoline = [](DWORD type) -> int {
+    if (type == CTRL_C_EVENT) {
+      g_handler();
+      return true;
+    }
+    return false;
+  };
+  ::SetConsoleCtrlHandler(trampoline, true);
+#elif PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+  // Setup signal handler.
+  struct sigaction sa {};
+
+// Glibc headers for sa_sigaction trigger this.
+#pragma GCC diagnostic push
+#if defined(__clang__)
+#pragma GCC diagnostic ignored "-Wdisabled-macro-expansion"
+#endif
+  sa.sa_handler = [](int) { g_handler(); };
+  sa.sa_flags = static_cast<decltype(sa.sa_flags)>(SA_RESETHAND | SA_RESTART);
+#pragma GCC diagnostic pop
+  sigaction(SIGINT, &sa, nullptr);
+  sigaction(SIGTERM, &sa, nullptr);
+#else
+  // Do nothing on NaCL and Fuchsia.
+  ignore_result(handler);
+#endif
+}
+
+}  // namespace base
+}  // namespace perfetto
+// gen_amalgamated begin source: src/base/event_fd.cc
+// gen_amalgamated begin header: include/perfetto/ext/base/event_fd.h
+// gen_amalgamated begin header: include/perfetto/base/platform_handle.h
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_BASE_PLATFORM_HANDLE_H_
+#define INCLUDE_PERFETTO_BASE_PLATFORM_HANDLE_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+
+namespace perfetto {
+namespace base {
+
+// PlatformHandle should be used only for types that are HANDLE(s) in Windows.
+// It should NOT be used to blanket-replace "int fd" in the codebase.
+// Windows has two types of "handles", which, in UNIX-land, both map to int:
+// 1. File handles returned by the posix-compatibility API like _open().
+//    These are just int(s) and should stay such, because all the posix-like API
+//    in Windows.h take an int, not a HANDLE.
+// 2. Handles returned by old-school WINAPI like CreateFile, CreateEvent etc.
+//    These are proper HANDLE(s). PlatformHandle should be used here.
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+// Windows.h typedefs HANDLE to void*. We use void* here to avoid leaking
+// Windows.h through our headers.
+using PlatformHandle = void*;
+
+// On Windows both nullptr and 0xffff... (INVALID_HANDLE_VALUE) are invalid.
+struct PlatformHandleChecker {
+  static inline bool IsValid(PlatformHandle h) {
+    return h && h != reinterpret_cast<PlatformHandle>(-1);
+  }
+};
+#else
+using PlatformHandle = int;
+struct PlatformHandleChecker {
+  static inline bool IsValid(PlatformHandle h) { return h >= 0; }
+};
+#endif
+
+// The definition of this lives in base/file_utils.cc (to avoid creating an
+// extra build edge for a one liner). This is really an alias for close() (UNIX)
+// CloseHandle() (Windows). THe indirection layer is just to avoid leaking
+// system headers like Windows.h through perfetto headers.
+// Thre return value is always UNIX-style: 0 on success, -1 on failure.
+int ClosePlatformHandle(PlatformHandle);
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_BASE_PLATFORM_HANDLE_H_
+// gen_amalgamated begin header: include/perfetto/ext/base/scoped_file.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_SCOPED_FILE_H_
+#define INCLUDE_PERFETTO_EXT_BASE_SCOPED_FILE_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+
+#include <stdio.h>
+
+#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+#include <dirent.h>  // For DIR* / opendir().
+#endif
+
+#include <string>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/base/platform_handle.h"
+
+namespace perfetto {
+namespace base {
+
+namespace internal {
+// Used for the most common cases of ScopedResource where there is only one
+// invalid value.
+template <typename T, T InvalidValue>
+struct DefaultValidityChecker {
+  static bool IsValid(T t) { return t != InvalidValue; }
+};
+}  // namespace internal
+
+// RAII classes for auto-releasing fds and dirs.
+// if T is a pointer type, InvalidValue must be nullptr. Doing otherwise
+// causes weird unexpected behaviors (See https://godbolt.org/z/5nGMW4).
+template <typename T,
+          int (*CloseFunction)(T),
+          T InvalidValue,
+          bool CheckClose = true,
+          class Checker = internal::DefaultValidityChecker<T, InvalidValue>>
+class PERFETTO_EXPORT ScopedResource {
+ public:
+  using ValidityChecker = Checker;
+  static constexpr T kInvalid = InvalidValue;
+
+  explicit ScopedResource(T t = InvalidValue) : t_(t) {}
+  ScopedResource(ScopedResource&& other) noexcept {
+    t_ = other.t_;
+    other.t_ = InvalidValue;
+  }
+  ScopedResource& operator=(ScopedResource&& other) {
+    reset(other.t_);
+    other.t_ = InvalidValue;
+    return *this;
+  }
+  T get() const { return t_; }
+  T operator*() const { return t_; }
+  explicit operator bool() const { return Checker::IsValid(t_); }
+  void reset(T r = InvalidValue) {
+    if (Checker::IsValid(t_)) {
+      int res = CloseFunction(t_);
+      if (CheckClose)
+        PERFETTO_CHECK(res == 0);
+    }
+    t_ = r;
+  }
+  T release() {
+    T t = t_;
+    t_ = InvalidValue;
+    return t;
+  }
+  ~ScopedResource() { reset(InvalidValue); }
+
+ private:
+  ScopedResource(const ScopedResource&) = delete;
+  ScopedResource& operator=(const ScopedResource&) = delete;
+  T t_;
+};
+
+// Declared in file_utils.h. Forward declared to avoid #include cycles.
+int PERFETTO_EXPORT CloseFile(int fd);
+
+// Use this for file resources obtained via open() and similar APIs.
+using ScopedFile = ScopedResource<int, CloseFile, -1>;
+using ScopedFstream = ScopedResource<FILE*, fclose, nullptr>;
+
+// Use this for resources that are HANDLE on Windows. See comments in
+// platform_handle.h
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+using ScopedPlatformHandle = ScopedResource<PlatformHandle,
+                                            ClosePlatformHandle,
+                                            /*InvalidValue=*/nullptr,
+                                            /*CheckClose=*/true,
+                                            PlatformHandleChecker>;
+#else
+// On non-windows systems we alias ScopedPlatformHandle to ScopedFile because
+// they are really the same. This is to allow assignments between the two in
+// Linux-specific code paths that predate ScopedPlatformHandle.
+static_assert(std::is_same<int, PlatformHandle>::value, "");
+using ScopedPlatformHandle = ScopedFile;
+
+// DIR* does not exist on Windows.
+using ScopedDir = ScopedResource<DIR*, closedir, nullptr>;
+#endif
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_SCOPED_FILE_H_
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_EVENT_FD_H_
+#define INCLUDE_PERFETTO_EXT_BASE_EVENT_FD_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+// gen_amalgamated expanded: #include "perfetto/base/platform_handle.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/scoped_file.h"
+
+namespace perfetto {
+namespace base {
+
+// A waitable event that can be used with poll/select.
+// This is really a wrapper around eventfd_create with a pipe-based fallback
+// for other platforms where eventfd is not supported.
+class EventFd {
+ public:
+  EventFd();
+  ~EventFd();
+  EventFd(EventFd&&) noexcept = default;
+  EventFd& operator=(EventFd&&) = default;
+
+  // The non-blocking file descriptor that can be polled to wait for the event.
+  PlatformHandle fd() const { return event_handle_.get(); }
+
+  // Can be called from any thread.
+  void Notify();
+
+  // Can be called from any thread. If more Notify() are queued a Clear() call
+  // can clear all of them (up to 16 per call).
+  void Clear();
+
+ private:
+  // The eventfd, when eventfd is supported, otherwise this is the read end of
+  // the pipe for fallback mode.
+  ScopedPlatformHandle event_handle_;
+
+#if !PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) &&   \
+    !PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) && \
+    !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  // On Mac and other non-Linux UNIX platforms a pipe-based fallback is used.
+  // The write end of the wakeup pipe.
+  ScopedFile write_fd_;
+#endif
+};
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_EVENT_FD_H_
+// gen_amalgamated begin header: include/perfetto/ext/base/pipe.h
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_PIPE_H_
+#define INCLUDE_PERFETTO_EXT_BASE_PIPE_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/platform_handle.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/scoped_file.h"
+
+namespace perfetto {
+namespace base {
+
+class Pipe {
+ public:
+  enum Flags {
+    kBothBlock = 0,
+#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+    kBothNonBlock,
+    kRdNonBlock,
+    kWrNonBlock,
+#endif
+  };
+
+  static Pipe Create(Flags = kBothBlock);
+
+  Pipe();
+  Pipe(Pipe&&) noexcept;
+  Pipe& operator=(Pipe&&);
+
+  ScopedPlatformHandle rd;
+  ScopedPlatformHandle wr;
+};
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_PIPE_H_
+// gen_amalgamated begin header: include/perfetto/ext/base/utils.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_UTILS_H_
+#define INCLUDE_PERFETTO_EXT_BASE_UTILS_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+// gen_amalgamated expanded: #include "perfetto/base/compiler.h"
+
+#include <errno.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <sys/types.h>
+
+#include <atomic>
+#include <string>
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+// Even if Windows has errno.h, the all syscall-restart behavior does not apply.
+// Trying to handle EINTR can cause more harm than good if errno is left stale.
+// Chromium does the same.
+#define PERFETTO_EINTR(x) (x)
+#else
+#define PERFETTO_EINTR(x)                                   \
+  ([&] {                                                    \
+    decltype(x) eintr_wrapper_result;                       \
+    do {                                                    \
+      eintr_wrapper_result = (x);                           \
+    } while (eintr_wrapper_result == -1 && errno == EINTR); \
+    return eintr_wrapper_result;                            \
+  }())
+#endif
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+using uid_t = unsigned int;
+#if !PERFETTO_BUILDFLAG(PERFETTO_COMPILER_GCC)
+using pid_t = unsigned int;
+#endif
+#if defined(_WIN64)
+using ssize_t = int64_t;
+#else
+using ssize_t = long;
+#endif
+#endif
+
+namespace perfetto {
+namespace base {
+
+constexpr uid_t kInvalidUid = static_cast<uid_t>(-1);
+constexpr pid_t kInvalidPid = static_cast<pid_t>(-1);
+
+// Do not add new usages of kPageSize, consider using GetSysPageSize() below.
+// TODO(primiano): over time the semantic of kPageSize became too ambiguous.
+// Strictly speaking, this constant is incorrect on some new devices where the
+// page size can be 16K (e.g., crbug.com/1116576). Unfortunately too much code
+// ended up depending on kPageSize for purposes that are not strictly related
+// with the kernel's mm subsystem.
+constexpr size_t kPageSize = 4096;
+
+// Returns the system's page size. Use this when dealing with mmap, madvise and
+// similar mm-related syscalls.
+uint32_t GetSysPageSize();
+
+template <typename T>
+constexpr size_t ArraySize(const T& array) {
+  return sizeof(array) / sizeof(array[0]);
+}
+
+// Function object which invokes 'free' on its parameter, which must be
+// a pointer. Can be used to store malloc-allocated pointers in std::unique_ptr:
+//
+// std::unique_ptr<int, base::FreeDeleter> foo_ptr(
+//     static_cast<int*>(malloc(sizeof(int))));
+struct FreeDeleter {
+  inline void operator()(void* ptr) const { free(ptr); }
+};
+
+template <typename T>
+constexpr T AssumeLittleEndian(T value) {
+#if !PERFETTO_IS_LITTLE_ENDIAN()
+  static_assert(false, "Unimplemented on big-endian archs");
+#endif
+  return value;
+}
+
+// Round up |size| to a multiple of |alignment| (must be a power of two).
+template <size_t alignment>
+constexpr size_t AlignUp(size_t size) {
+  static_assert((alignment & (alignment - 1)) == 0, "alignment must be a pow2");
+  return (size + alignment - 1) & ~(alignment - 1);
+}
+
+inline bool IsAgain(int err) {
+  return err == EAGAIN || err == EWOULDBLOCK;
+}
+
+// setenv(2)-equivalent. Deals with Windows vs Posix discrepancies.
+void SetEnv(const std::string& key, const std::string& value);
+
+// Calls mallopt(M_PURGE, 0) on Android. Does nothing on other platforms.
+// This forces the allocator to release freed memory. This is used to work
+// around various Scudo inefficiencies. See b/170217718.
+void MaybeReleaseAllocatorMemToOS();
+
+// geteuid() on POSIX OSes, returns 0 on Windows (See comment in utils.cc).
+uid_t GetCurrentUserId();
+
+// Forks the process.
+// Parent: prints the PID of the child and exit(0).
+// Child: redirects stdio onto /dev/null and chdirs into .
+void Daemonize();
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_UTILS_H_
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+
+#include <errno.h>
+#include <stdint.h>
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+#include <Windows.h>
+#include <synchapi.h>
+#elif PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+#include <sys/eventfd.h>
+#include <unistd.h>
+#else  // Mac, Fuchsia and other non-Linux UNIXes
+#include <unistd.h>
+#endif
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/event_fd.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/pipe.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+
+namespace perfetto {
+namespace base {
+
+EventFd::~EventFd() = default;
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+EventFd::EventFd() {
+  event_handle_.reset(
+      CreateEventA(/*lpEventAttributes=*/nullptr, /*bManualReset=*/true,
+                   /*bInitialState=*/false, /*bInitialState=*/nullptr));
+}
+
+void EventFd::Notify() {
+  if (!SetEvent(event_handle_.get()))  // 0: fail, !0: success, unlike UNIX.
+    PERFETTO_DFATAL("EventFd::Notify()");
+}
+
+void EventFd::Clear() {
+  if (!ResetEvent(event_handle_.get()))  // 0: fail, !0: success, unlike UNIX.
+    PERFETTO_DFATAL("EventFd::Clear()");
+}
+
+#elif PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+
+EventFd::EventFd() {
+  event_handle_.reset(eventfd(/*initval=*/0, EFD_CLOEXEC | EFD_NONBLOCK));
+  PERFETTO_CHECK(event_handle_);
+}
+
+void EventFd::Notify() {
+  const uint64_t value = 1;
+  ssize_t ret = write(event_handle_.get(), &value, sizeof(value));
+  if (ret <= 0 && errno != EAGAIN)
+    PERFETTO_DFATAL("EventFd::Notify()");
+}
+
+void EventFd::Clear() {
+  uint64_t value;
+  ssize_t ret = read(event_handle_.get(), &value, sizeof(value));
+  if (ret <= 0 && errno != EAGAIN)
+    PERFETTO_DFATAL("EventFd::Clear()");
+}
+
+#else
+
+EventFd::EventFd() {
+  // Make the pipe non-blocking so that we never block the waking thread (either
+  // the main thread or another one) when scheduling a wake-up.
+  Pipe pipe = Pipe::Create(Pipe::kBothNonBlock);
+  event_handle_ = ScopedPlatformHandle(std::move(pipe.rd).release());
+  write_fd_ = std::move(pipe.wr);
+}
+
+void EventFd::Notify() {
+  const uint64_t value = 1;
+  ssize_t ret = write(write_fd_.get(), &value, sizeof(uint8_t));
+  if (ret <= 0 && errno != EAGAIN)
+    PERFETTO_DFATAL("EventFd::Notify()");
+}
+
+void EventFd::Clear() {
+  // Drain the byte(s) written to the wake-up pipe. We can potentially read
+  // more than one byte if several wake-ups have been scheduled.
+  char buffer[16];
+  ssize_t ret = read(event_handle_.get(), &buffer[0], sizeof(buffer));
+  if (ret <= 0 && errno != EAGAIN)
+    PERFETTO_DFATAL("EventFd::Clear()");
+}
+#endif
+
+}  // namespace base
+}  // namespace perfetto
+// gen_amalgamated begin source: src/base/file_utils.cc
+// gen_amalgamated begin header: include/perfetto/ext/base/file_utils.h
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_FILE_UTILS_H_
+#define INCLUDE_PERFETTO_EXT_BASE_FILE_UTILS_H_
+
+#include <fcntl.h>  // For mode_t & O_RDONLY/RDWR. Exists also on Windows.
+#include <stddef.h>
+
+#include <string>
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/scoped_file.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+
+namespace perfetto {
+namespace base {
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+using FileOpenMode = int;
+#else
+using FileOpenMode = mode_t;
+#endif
+
+constexpr FileOpenMode kFileModeInvalid = static_cast<FileOpenMode>(-1);
+
+bool ReadPlatformHandle(PlatformHandle, std::string* out);
+bool ReadFileDescriptor(int fd, std::string* out);
+bool ReadFileStream(FILE* f, std::string* out);
+bool ReadFile(const std::string& path, std::string* out);
+
+// A wrapper around read(2). It deals with Linux vs Windows includes. It also
+// deals with handling EINTR. Has the same semantics of UNIX's read(2).
+ssize_t Read(int fd, void* dst, size_t dst_size);
+
+// Call write until all data is written or an error is detected.
+//
+// man 2 write:
+//   If a write() is interrupted by a signal handler before any bytes are
+//   written, then the call fails with the error EINTR; if it is
+//   interrupted after at least one byte has been written, the call
+//   succeeds, and returns the number of bytes written.
+ssize_t WriteAll(int fd, const void* buf, size_t count);
+
+ssize_t WriteAllHandle(PlatformHandle, const void* buf, size_t count);
+
+ScopedFile OpenFile(const std::string& path,
+                    int flags,
+                    FileOpenMode = kFileModeInvalid);
+
+// This is an alias for close(). It's to avoid leaking Windows.h in headers.
+// Exported because ScopedFile is used in the /include/ext API by Chromium
+// component builds.
+int PERFETTO_EXPORT CloseFile(int fd);
+
+bool FlushFile(int fd);
+
+// Returns true if mkdir succeeds, false if it fails (see errno in that case).
+bool Mkdir(const std::string& path);
+
+// Calls rmdir() on UNIX, _rmdir() on Windows.
+bool Rmdir(const std::string& path);
+
+// Wrapper around access(path, F_OK).
+bool FileExists(const std::string& path);
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_FILE_UTILS_H_
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/file_utils.h"
+
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include <algorithm>
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/base/platform_handle.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/scoped_file.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+#include <Windows.h>
+#include <direct.h>
+#include <io.h>
+#else
+#include <dirent.h>
+#include <unistd.h>
+#endif
+
+namespace perfetto {
+namespace base {
+namespace {
+constexpr size_t kBufSize = 2048;
+}
+
+ssize_t Read(int fd, void* dst, size_t dst_size) {
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  return _read(fd, dst, static_cast<unsigned>(dst_size));
+#else
+  return PERFETTO_EINTR(read(fd, dst, dst_size));
+#endif
+}
+
+bool ReadFileDescriptor(int fd, std::string* out) {
+  // Do not override existing data in string.
+  size_t i = out->size();
+
+  struct stat buf {};
+  if (fstat(fd, &buf) != -1) {
+    if (buf.st_size > 0)
+      out->resize(i + static_cast<size_t>(buf.st_size));
+  }
+
+  ssize_t bytes_read;
+  for (;;) {
+    if (out->size() < i + kBufSize)
+      out->resize(out->size() + kBufSize);
+
+    bytes_read = Read(fd, &((*out)[i]), kBufSize);
+    if (bytes_read > 0) {
+      i += static_cast<size_t>(bytes_read);
+    } else {
+      out->resize(i);
+      return bytes_read == 0;
+    }
+  }
+}
+
+bool ReadPlatformHandle(PlatformHandle h, std::string* out) {
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  // Do not override existing data in string.
+  size_t i = out->size();
+
+  for (;;) {
+    if (out->size() < i + kBufSize)
+      out->resize(out->size() + kBufSize);
+    DWORD bytes_read = 0;
+    auto res = ::ReadFile(h, &((*out)[i]), kBufSize, &bytes_read, nullptr);
+    if (res && bytes_read > 0) {
+      i += static_cast<size_t>(bytes_read);
+    } else {
+      out->resize(i);
+      const bool is_eof = res && bytes_read == 0;
+      auto err = res ? 0 : GetLastError();
+      // The "Broken pipe" error on Windows is slighly different than Unix:
+      // On Unix: a "broken pipe" error can happen only on the writer side. On
+      // the reader there is no broken pipe, just a EOF.
+      // On windows: the reader also sees a broken pipe error.
+      // Here we normalize on the Unix behavior, treating broken pipe as EOF.
+      return is_eof || err == ERROR_BROKEN_PIPE;
+    }
+  }
+#else
+  return ReadFileDescriptor(h, out);
+#endif
+}
+
+bool ReadFileStream(FILE* f, std::string* out) {
+  return ReadFileDescriptor(fileno(f), out);
+}
+
+bool ReadFile(const std::string& path, std::string* out) {
+  base::ScopedFile fd = base::OpenFile(path, O_RDONLY);
+  if (!fd)
+    return false;
+
+  return ReadFileDescriptor(*fd, out);
+}
+
+ssize_t WriteAll(int fd, const void* buf, size_t count) {
+  size_t written = 0;
+  while (written < count) {
+    // write() on windows takes an unsigned int size.
+    uint32_t bytes_left = static_cast<uint32_t>(
+        std::min(count - written, static_cast<size_t>(UINT32_MAX)));
+    ssize_t wr = PERFETTO_EINTR(
+        write(fd, static_cast<const char*>(buf) + written, bytes_left));
+    if (wr == 0)
+      break;
+    if (wr < 0)
+      return wr;
+    written += static_cast<size_t>(wr);
+  }
+  return static_cast<ssize_t>(written);
+}
+
+ssize_t WriteAllHandle(PlatformHandle h, const void* buf, size_t count) {
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  DWORD wsize = 0;
+  if (::WriteFile(h, buf, static_cast<DWORD>(count), &wsize, nullptr)) {
+    return wsize;
+  } else {
+    return -1;
+  }
+#else
+  return WriteAll(h, buf, count);
+#endif
+}
+
+bool FlushFile(int fd) {
+  PERFETTO_DCHECK(fd != 0);
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+  return !PERFETTO_EINTR(fdatasync(fd));
+#elif PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  return !PERFETTO_EINTR(_commit(fd));
+#else
+  return !PERFETTO_EINTR(fsync(fd));
+#endif
+}
+
+bool Mkdir(const std::string& path) {
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  return _mkdir(path.c_str()) == 0;
+#else
+  return mkdir(path.c_str(), 0755) == 0;
+#endif
+}
+
+bool Rmdir(const std::string& path) {
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  return _rmdir(path.c_str()) == 0;
+#else
+  return rmdir(path.c_str()) == 0;
+#endif
+}
+
+int CloseFile(int fd) {
+  return close(fd);
+}
+
+ScopedFile OpenFile(const std::string& path, int flags, FileOpenMode mode) {
+  PERFETTO_DCHECK((flags & O_CREAT) == 0 || mode != kFileModeInvalid);
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  // Always use O_BINARY on Windows, to avoid silly EOL translations.
+  ScopedFile fd(_open(path.c_str(), flags | O_BINARY, mode));
+#else
+  // Always open a ScopedFile with O_CLOEXEC so we can safely fork and exec.
+  ScopedFile fd(open(path.c_str(), flags | O_CLOEXEC, mode));
+#endif
+  return fd;
+}
+
+bool FileExists(const std::string& path) {
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  return _access(path.c_str(), 0) == 0;
+#else
+  return access(path.c_str(), F_OK) == 0;
+#endif
+}
+
+// Declared in base/platform_handle.h.
+int ClosePlatformHandle(PlatformHandle handle) {
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  // Make the return value UNIX-style.
+  return CloseHandle(handle) ? 0 : -1;
+#else
+  return close(handle);
+#endif
+}
+
+}  // namespace base
+}  // namespace perfetto
+// gen_amalgamated begin source: src/base/getopt_compat.cc
+// gen_amalgamated begin header: include/perfetto/ext/base/getopt_compat.h
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_GETOPT_COMPAT_H_
+#define INCLUDE_PERFETTO_EXT_BASE_GETOPT_COMPAT_H_
+
+#include <cstddef>  // For std::nullptr_t
+
+// No translation units other than base/getopt.h and getopt_compat_unittest.cc
+// should directly include this file. Use base/getopt.h instead.
+
+namespace perfetto {
+namespace base {
+namespace getopt_compat {
+
+// A tiny getopt() replacement for Windows, which doesn't have <getopt.h>.
+// This implementation is based on the subset of features that we use in the
+// Perfetto codebase. It doesn't even try to deal with the full surface of GNU's
+// getopt().
+// Limitations:
+// - getopt_long_only() is not supported.
+// - optional_argument is not supported. That is extremely subtle and caused us
+//   problems in the past with GNU's getopt.
+// - It does not reorder non-option arguments. It behaves like MacOS getopt, or
+//   GNU's when POSIXLY_CORRECT=1.
+// - Doesn't expose optopt or opterr.
+// - option.flag and longindex are not supported and must be nullptr.
+
+enum {
+  no_argument = 0,
+  required_argument = 1,
+};
+
+struct option {
+  const char* name;
+  int has_arg;
+  std::nullptr_t flag;  // Only nullptr is supported.
+  int val;
+};
+
+extern char* optarg;
+extern int optind;
+
+int getopt_long(int argc,
+                char** argv,
+                const char* shortopts,
+                const option* longopts,
+                std::nullptr_t /*longindex is not supported*/);
+
+int getopt(int argc, char** argv, const char* shortopts);
+
+}  // namespace getopt_compat
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_GETOPT_COMPAT_H_
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/getopt_compat.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <vector>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+
+namespace perfetto {
+namespace base {
+namespace getopt_compat {
+
+char* optarg = nullptr;
+int optind = 0;
+
+namespace {
+
+char* nextchar = nullptr;
+
+const option* LookupLongOpt(const std::vector<option>& opts,
+                            const char* name,
+                            size_t len) {
+  for (const option& opt : opts) {
+    if (strncmp(opt.name, name, len) == 0 && strlen(opt.name) == len)
+      return &opt;
+  }
+  return nullptr;
+}
+
+const option* LookupShortOpt(const std::vector<option>& opts, char c) {
+  for (const option& opt : opts) {
+    if (opt.name == nullptr && opt.val == c)
+      return &opt;
+  }
+  return nullptr;
+}
+
+bool ParseOpts(const char* shortopts,
+               const option* longopts,
+               std::vector<option>* res) {
+  // Parse long options first.
+  for (const option* lopt = longopts; lopt && lopt->name; lopt++) {
+    PERFETTO_CHECK(lopt->flag == nullptr);
+    PERFETTO_CHECK(lopt->has_arg == no_argument ||
+                   lopt->has_arg == required_argument);
+    res->emplace_back(*lopt);
+  }
+
+  // Merge short options.
+  for (const char* sopt = shortopts; sopt && *sopt;) {
+    const size_t idx = static_cast<size_t>(sopt - shortopts);
+    char c = *sopt++;
+    bool valid = (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ||
+                 (c >= '0' && c <= '9');
+    if (!valid) {
+      fprintf(stderr,
+              "Error parsing shortopts. Unexpected char '%c' at offset %zu\n",
+              c, idx);
+      return false;
+    }
+    res->emplace_back();
+    option& opt = res->back();
+    opt.val = c;
+    opt.has_arg = no_argument;
+    if (*sopt == ':') {
+      opt.has_arg = required_argument;
+      ++sopt;
+    }
+  }
+  return true;
+}
+
+}  // namespace
+
+int getopt_long(int argc,
+                char** argv,
+                const char* shortopts,
+                const option* longopts,
+                std::nullptr_t /*longind*/) {
+  std::vector<option> opts;
+  optarg = nullptr;
+
+  if (optind == 0)
+    optind = 1;
+
+  if (optind >= argc)
+    return -1;
+
+  if (!ParseOpts(shortopts, longopts, &opts))
+    return '?';
+
+  char* arg = argv[optind];
+
+  if (!nextchar) {
+    // If |nextchar| is null we are NOT in the middle of a short option and we
+    // should parse the next argv.
+    if (strncmp(arg, "--", 2) == 0 && strlen(arg) > 2) {
+      // A --long option.
+      arg += 2;
+      char* sep = strchr(arg, '=');
+      optind++;
+
+      size_t len = sep ? static_cast<size_t>(sep - arg) : strlen(arg);
+      const option* opt = LookupLongOpt(opts, arg, len);
+      if (!opt) {
+        fprintf(stderr, "unrecognized option '--%s'\n", arg);
+        return '?';
+      }
+
+      if (opt->has_arg == no_argument) {
+        if (sep) {
+          fprintf(stderr, "option '--%s' doesn't allow an argument\n", arg);
+          return '?';
+        } else {
+          return opt->val;
+        }
+      } else if (opt->has_arg == required_argument) {
+        if (sep) {
+          optarg = sep + 1;
+          return opt->val;
+        } else if (optind >= argc) {
+          fprintf(stderr, "option '--%s' requires an argument\n", arg);
+          return '?';
+        } else {
+          optarg = argv[optind++];
+          return opt->val;
+        }
+      }
+      // has_arg must be either |no_argument| or |required_argument|. We
+      // shoulnd't get here unless the check in ParseOpts() has a bug.
+      PERFETTO_CHECK(false);
+    }  // if (arg ~= "--*").
+
+    if (strlen(arg) > 1 && arg[0] == '-' && arg[1] != '-') {
+      // A sequence of short options. Parsing logic continues below.
+      nextchar = &arg[1];
+    }
+  }  // if(!nextchar)
+
+  if (nextchar) {
+    // At this point either:
+    // 1. This is the first char of a sequence of short options, and we fell
+    //    through here from the lines above.
+    // 2. This is the N (>1) char of a sequence of short options, and we got
+    //    here from a new getopt() call to getopt().
+    const char cur_char = *nextchar;
+    PERFETTO_CHECK(cur_char != '\0');
+
+    // Advance the option char in any case, before we start reasoning on them.
+    // if we got to the end of the "-abc" sequence, increment optind so the next
+    // getopt() call resumes from the next argv argument.
+    if (*(++nextchar) == '\0') {
+      nextchar = nullptr;
+      ++optind;
+    }
+
+    const option* opt = LookupShortOpt(opts, cur_char);
+    if (!opt) {
+      fprintf(stderr, "invalid option -- '%c'\n", cur_char);
+      return '?';
+    }
+    if (opt->has_arg == no_argument) {
+      return cur_char;
+    } else if (opt->has_arg == required_argument) {
+      // This is a subtle getopt behavior. Say you call `tar -fx`, there are
+      // two cases:
+      // 1. If 'f' is no_argument then 'x' (and anything else after) is
+      //    interpreted as an independent argument (like `tar -f -x`).
+      // 2. If 'f' is required_argument, than everything else after the 'f'
+      //    is interpreted as the option argument (like `tar -f x`)
+      if (!nextchar) {
+        // Case 1.
+        if (optind >= argc) {
+          fprintf(stderr, "option requires an argument -- '%c'\n", cur_char);
+          return '?';
+        } else {
+          optarg = argv[optind++];
+          return cur_char;
+        }
+      } else {
+        // Case 2.
+        optarg = nextchar;
+        nextchar = nullptr;
+        optind++;
+        return cur_char;
+      }
+    }
+    PERFETTO_CHECK(false);
+  }  // if (nextchar)
+
+  // If we get here, we found the first non-option argument. Stop here.
+
+  if (strcmp(arg, "--") == 0)
+    optind++;
+
+  return -1;
+}
+
+int getopt(int argc, char** argv, const char* shortopts) {
+  return getopt_long(argc, argv, shortopts, nullptr, nullptr);
+}
+
+}  // namespace getopt_compat
+}  // namespace base
+}  // namespace perfetto
+// gen_amalgamated begin source: src/base/logging.cc
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+
+#include <stdarg.h>
+#include <stdio.h>
+
+#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+#include <unistd.h>  // For isatty()
+#endif
+
+#include <atomic>
+#include <memory>
+
+// gen_amalgamated expanded: #include "perfetto/base/time.h"
+
+namespace perfetto {
+namespace base {
+
+namespace {
+const char kReset[] = "\x1b[0m";
+const char kDefault[] = "\x1b[39m";
+const char kDim[] = "\x1b[2m";
+const char kRed[] = "\x1b[31m";
+const char kBoldGreen[] = "\x1b[1m\x1b[32m";
+const char kLightGray[] = "\x1b[90m";
+
+std::atomic<LogMessageCallback> g_log_callback{};
+
+}  // namespace
+
+void SetLogMessageCallback(LogMessageCallback callback) {
+  g_log_callback.store(callback, std::memory_order_relaxed);
+}
+
+void LogMessage(LogLev level,
+                const char* fname,
+                int line,
+                const char* fmt,
+                ...) {
+  char stack_buf[512];
+  std::unique_ptr<char[]> large_buf;
+  char* log_msg = &stack_buf[0];
+
+  // By default use a stack allocated buffer because most log messages are quite
+  // short. In rare cases they can be larger (e.g. --help). In those cases we
+  // pay the cost of allocating the buffer on the heap.
+  for (size_t max_len = sizeof(stack_buf);;) {
+    va_list args;
+    va_start(args, fmt);
+    int res = vsnprintf(log_msg, max_len, fmt, args);
+    va_end(args);
+
+    // If for any reason the print fails, overwrite the message but still print
+    // it. The code below will attach the filename and line, which is still
+    // useful.
+    if (res < 0) {
+      strncpy(log_msg, "[printf format error]", max_len);
+      break;
+    }
+
+    // if res == max_len, vsnprintf saturated the input buffer. Retry with a
+    // larger buffer in that case (within reasonable limits).
+    if (res < static_cast<int>(max_len) || max_len >= 128 * 1024)
+      break;
+    max_len *= 4;
+    large_buf.reset(new char[max_len]);
+    log_msg = &large_buf[0];
+  }
+
+  LogMessageCallback cb = g_log_callback.load(std::memory_order_relaxed);
+  if (cb) {
+    cb({level, line, fname, log_msg});
+    return;
+  }
+
+  const char* color = kDefault;
+  switch (level) {
+    case kLogDebug:
+      color = kDim;
+      break;
+    case kLogInfo:
+      color = kDefault;
+      break;
+    case kLogImportant:
+      color = kBoldGreen;
+      break;
+    case kLogError:
+      color = kRed;
+      break;
+  }
+
+#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) && \
+    !PERFETTO_BUILDFLAG(PERFETTO_OS_WASM)
+  static const bool use_colors = isatty(STDERR_FILENO);
+#else
+  static const bool use_colors = false;
+#endif
+
+  // Formats file.cc:line as a space-padded fixed width string. If the file name
+  // |fname| is too long, truncate it on the left-hand side.
+  char line_str[10];
+  size_t line_len =
+      static_cast<size_t>(snprintf(line_str, sizeof(line_str), "%d", line));
+
+  // 24 will be the width of the file.cc:line column in the log event.
+  char file_and_line[24];
+  size_t fname_len = strlen(fname);
+  size_t fname_max = sizeof(file_and_line) - line_len - 2;  // 2 = ':' + '\0'.
+  size_t fname_offset = fname_len <= fname_max ? 0 : fname_len - fname_max;
+  int len = snprintf(file_and_line, sizeof(file_and_line), "%s:%s",
+                     fname + fname_offset, line_str);
+  memset(&file_and_line[len], ' ', sizeof(file_and_line) - size_t(len));
+  file_and_line[sizeof(file_and_line) - 1] = '\0';
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+  // Logcat has already timestamping, don't re-emit it.
+  __android_log_print(ANDROID_LOG_DEBUG + level, "perfetto", "%s %s",
+                      file_and_line, log_msg);
+#endif
+
+  // When printing on stderr, print also the timestamp. We don't really care
+  // about the actual time. We just need some reference clock that can be used
+  // to correlated events across differrent processses (e.g. traced and
+  // traced_probes). The wall time % 1000 is good enough.
+  char timestamp[32];
+  uint32_t t_ms = static_cast<uint32_t>(GetWallTimeMs().count());
+  uint32_t t_sec = t_ms / 1000;
+  t_ms -= t_sec * 1000;
+  t_sec = t_sec % 1000;
+  snprintf(timestamp, sizeof(timestamp), "[%03u.%03u] ", t_sec, t_ms);
+
+  if (use_colors) {
+    fprintf(stderr, "%s%s%s%s %s%s%s\n", kLightGray, timestamp, file_and_line,
+            kReset, color, log_msg, kReset);
+  } else {
+    fprintf(stderr, "%s%s %s\n", timestamp, file_and_line, log_msg);
+  }
+}
+
+}  // namespace base
+}  // namespace perfetto
+// gen_amalgamated begin source: src/base/metatrace.cc
+// gen_amalgamated begin header: include/perfetto/ext/base/metatrace.h
+// gen_amalgamated begin header: include/perfetto/ext/base/metatrace_events.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_METATRACE_EVENTS_H_
+#define INCLUDE_PERFETTO_EXT_BASE_METATRACE_EVENTS_H_
+
+#include <stdint.h>
+
+namespace perfetto {
+namespace metatrace {
+
+enum Tags : uint32_t {
+  TAG_NONE = 0,
+  TAG_ANY = uint32_t(-1),
+  TAG_FTRACE = 1 << 0,
+  TAG_PROC_POLLERS = 1 << 1,
+  TAG_TRACE_WRITER = 1 << 2,
+  TAG_TRACE_SERVICE = 1 << 3,
+  TAG_PRODUCER = 1 << 4,
+};
+
+// The macros below generate matching enums and arrays of string literals.
+// This is to avoid maintaining string maps manually.
+
+// clang-format off
+
+// DO NOT remove or reshuffle items in this list, only append. The ID of these
+// events are an ABI, the trace processor relies on these to open old traces.
+#define PERFETTO_METATRACE_EVENTS(F) \
+  F(EVENT_ZERO_UNUSED), \
+  F(FTRACE_CPU_READER_READ), /*unused*/ \
+  F(FTRACE_DRAIN_CPUS), /*unused*/ \
+  F(FTRACE_UNBLOCK_READERS), /*unused*/ \
+  F(FTRACE_CPU_READ_NONBLOCK), /*unused*/ \
+  F(FTRACE_CPU_READ_BLOCK), /*unused*/ \
+  F(FTRACE_CPU_SPLICE_NONBLOCK), /*unused*/ \
+  F(FTRACE_CPU_SPLICE_BLOCK), /*unused*/ \
+  F(FTRACE_CPU_WAIT_CMD), /*unused*/ \
+  F(FTRACE_CPU_RUN_CYCLE), /*unused*/ \
+  F(FTRACE_CPU_FLUSH), \
+  F(FTRACE_CPU_DRAIN), /*unused*/ \
+  F(READ_SYS_STATS), \
+  F(PS_WRITE_ALL_PROCESSES), \
+  F(PS_ON_PIDS), \
+  F(PS_ON_RENAME_PIDS), \
+  F(PS_WRITE_ALL_PROCESS_STATS), \
+  F(TRACE_WRITER_COMMIT_STARTUP_WRITER_BATCH), \
+  F(FTRACE_READ_TICK), \
+  F(FTRACE_CPU_READ_CYCLE), \
+  F(FTRACE_CPU_READ_BATCH), \
+  F(KALLSYMS_PARSE), \
+  F(PROFILER_READ_TICK), \
+  F(PROFILER_READ_CPU), \
+  F(PROFILER_UNWIND_TICK), \
+  F(PROFILER_UNWIND_SAMPLE), \
+  F(PROFILER_UNWIND_INITIAL_ATTEMPT), \
+  F(PROFILER_UNWIND_ATTEMPT), \
+  F(PROFILER_MAPS_PARSE), \
+  F(PROFILER_MAPS_REPARSE), \
+  F(PROFILER_UNWIND_CACHE_CLEAR)
+
+// Append only, see above.
+//
+// Values that aren't used as counters:
+// * FTRACE_SERVICE_COMMIT_DATA is a bit-packed representation of an event, see
+//   tracing_service_impl.cc for the format.
+// * PROFILER_UNWIND_CURRENT_PID represents the PID that is being unwound.
+//
+#define PERFETTO_METATRACE_COUNTERS(F) \
+  F(COUNTER_ZERO_UNUSED),\
+  F(FTRACE_PAGES_DRAINED), \
+  F(PS_PIDS_SCANNED), \
+  F(TRACE_SERVICE_COMMIT_DATA), \
+  F(PROFILER_UNWIND_QUEUE_SZ), \
+  F(PROFILER_UNWIND_CURRENT_PID)
+
+// clang-format on
+
+#define PERFETTO_METATRACE_IDENTITY(name) name
+#define PERFETTO_METATRACE_TOSTRING(name) #name
+
+enum Events : uint16_t {
+  PERFETTO_METATRACE_EVENTS(PERFETTO_METATRACE_IDENTITY),
+  EVENTS_MAX
+};
+constexpr char const* kEventNames[] = {
+    PERFETTO_METATRACE_EVENTS(PERFETTO_METATRACE_TOSTRING)};
+
+enum Counters : uint16_t {
+  PERFETTO_METATRACE_COUNTERS(PERFETTO_METATRACE_IDENTITY),
+  COUNTERS_MAX
+};
+constexpr char const* kCounterNames[] = {
+    PERFETTO_METATRACE_COUNTERS(PERFETTO_METATRACE_TOSTRING)};
+
+inline void SuppressUnusedVarsInAmalgamatedBuild() {
+  (void)kCounterNames;
+  (void)kEventNames;
+}
+
+}  // namespace metatrace
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_METATRACE_EVENTS_H_
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_METATRACE_H_
+#define INCLUDE_PERFETTO_EXT_BASE_METATRACE_H_
+
+#include <array>
+#include <atomic>
+#include <functional>
+#include <string>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/base/thread_utils.h"
+// gen_amalgamated expanded: #include "perfetto/base/time.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/metatrace_events.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+
+// A facility to trace execution of the perfetto codebase itself.
+// The meta-tracing framework is organized into three layers:
+//
+// 1. A static ring-buffer in base/ (this file) that supports concurrent writes
+//    and a single reader.
+//    The responsibility of this layer is to store events and counters as
+//    efficiently as possible without re-entering any tracing code.
+//    This is really a static-storage-based ring-buffer based on a POD array.
+//    This layer does NOT deal with serializing the meta-trace buffer.
+//    It posts a task when it's half full and expects something outside of
+//    base/ to drain the ring-buffer and serialize it, eventually writing it
+//    into the trace itself, before it gets 100% full.
+//
+// 2. A class in tracing/core which takes care of serializing the meta-trace
+//    buffer into the trace using a TraceWriter. See metatrace_writer.h .
+//
+// 3. A data source in traced_probes that, when be enabled via the trace config,
+//    injects metatrace events into the trace. See metatrace_data_source.h .
+//
+// The available events and tags are defined in metatrace_events.h .
+
+namespace perfetto {
+
+namespace base {
+class TaskRunner;
+}  // namespace base
+
+namespace metatrace {
+
+// Meta-tracing is organized in "tags" that can be selectively enabled. This is
+// to enable meta-tracing only of one sub-system. This word has one "enabled"
+// bit for each tag. 0 -> meta-tracing off.
+extern std::atomic<uint32_t> g_enabled_tags;
+
+// Time of the Enable() call. Used as a reference for keeping delta timestmaps
+// in Record.
+extern std::atomic<uint64_t> g_enabled_timestamp;
+
+// Enables meta-tracing for one or more tags. Once enabled it will discard any
+// further Enable() calls and return false until disabled,
+// |read_task| is a closure that will be called enqueued |task_runner| when the
+// meta-tracing ring buffer is half full. The task is expected to read the ring
+// buffer using RingBuffer::GetReadIterator() and serialize the contents onto a
+// file or into the trace itself.
+// Must be called on the |task_runner| passed.
+// |task_runner| must have static lifetime.
+bool Enable(std::function<void()> read_task, base::TaskRunner*, uint32_t tags);
+
+// Disables meta-tracing.
+// Must be called on the same |task_runner| as Enable().
+void Disable();
+
+inline uint64_t TraceTimeNowNs() {
+  return static_cast<uint64_t>(base::GetBootTimeNs().count());
+}
+
+// Returns a relaxed view of whether metatracing is enabled for the given tag.
+// Useful for skipping unnecessary argument computation if metatracing is off.
+inline bool IsEnabled(uint32_t tag) {
+  auto enabled_tags = g_enabled_tags.load(std::memory_order_relaxed);
+  return PERFETTO_UNLIKELY((enabled_tags & tag) != 0);
+}
+
+// Holds the data for a metatrace event or counter.
+struct Record {
+  static constexpr uint16_t kTypeMask = 0x8000;
+  static constexpr uint16_t kTypeCounter = 0x8000;
+  static constexpr uint16_t kTypeEvent = 0;
+
+  uint64_t timestamp_ns() const {
+    auto base_ns = g_enabled_timestamp.load(std::memory_order_relaxed);
+    PERFETTO_DCHECK(base_ns);
+    return base_ns + ((static_cast<uint64_t>(timestamp_ns_high) << 32) |
+                      timestamp_ns_low);
+  }
+
+  void set_timestamp(uint64_t ts) {
+    auto t_start = g_enabled_timestamp.load(std::memory_order_relaxed);
+    uint64_t diff = ts - t_start;
+    PERFETTO_DCHECK(diff < (1ull << 48));
+    timestamp_ns_low = static_cast<uint32_t>(diff);
+    timestamp_ns_high = static_cast<uint16_t>(diff >> 32);
+  }
+
+  // We can't just memset() this class because on MSVC std::atomic<> is not
+  // trivially constructible anymore. Also std::atomic<> has a deleted copy
+  // constructor so we cant just do "*this = Record()" either.
+  // See http://bit.ly/339Jlzd .
+  void clear() {
+    this->~Record();
+    new (this) Record();
+  }
+
+  // This field holds the type (counter vs event) in the MSB and event ID (as
+  // defined in metatrace_events.h) in the lowest 15 bits. It is also used also
+  // as a linearization point: this is always written after all the other
+  // fields with a release-store. This is so the reader can determine whether it
+  // can safely process the other event fields after a load-acquire.
+  std::atomic<uint16_t> type_and_id{};
+
+  // Timestamp is stored as a 48-bits value diffed against g_enabled_timestamp.
+  // This gives us 78 hours from Enabled().
+  uint16_t timestamp_ns_high = 0;
+  uint32_t timestamp_ns_low = 0;
+
+  uint32_t thread_id = 0;
+
+  union {
+    // Only one of the two elements can be zero initialized, clang complains
+    // about "initializing multiple members of union" otherwise.
+    uint32_t duration_ns = 0;  // If type == event.
+    int32_t counter_value;     // If type == counter.
+  };
+};
+
+// Hold the meta-tracing data into a statically allocated array.
+// This class uses static storage (as opposite to being a singleton) to:
+// - Have the guarantee of always valid storage, so that meta-tracing can be
+//   safely used in any part of the codebase, including base/ itself.
+// - Avoid barriers that thread-safe static locals would require.
+class RingBuffer {
+ public:
+  static constexpr size_t kCapacity = 4096;  // 4096 * 16 bytes = 64K.
+
+  // This iterator is not idempotent and will bump the read index in the buffer
+  // at the end of the reads. There can be only one reader at any time.
+  // Usage: for (auto it = RingBuffer::GetReadIterator(); it; ++it) { it->... }
+  class ReadIterator {
+   public:
+    ReadIterator(ReadIterator&& other) {
+      PERFETTO_DCHECK(other.valid_);
+      cur_ = other.cur_;
+      end_ = other.end_;
+      valid_ = other.valid_;
+      other.valid_ = false;
+    }
+
+    ~ReadIterator() {
+      if (!valid_)
+        return;
+      PERFETTO_DCHECK(cur_ >= RingBuffer::rd_index_);
+      PERFETTO_DCHECK(cur_ <= RingBuffer::wr_index_);
+      RingBuffer::rd_index_.store(cur_, std::memory_order_release);
+    }
+
+    explicit operator bool() const { return cur_ < end_; }
+    const Record* operator->() const { return RingBuffer::At(cur_); }
+    const Record& operator*() const { return *operator->(); }
+
+    // This is for ++it. it++ is deliberately not supported.
+    ReadIterator& operator++() {
+      PERFETTO_DCHECK(cur_ < end_);
+      // Once a record has been read, mark it as free clearing its type_and_id,
+      // so if we encounter it in another read iteration while being written
+      // we know it's not fully written yet.
+      // The memory_order_relaxed below is enough because:
+      // - The reader is single-threaded and doesn't re-read the same records.
+      // - Before starting a read batch, the reader has an acquire barrier on
+      //   |rd_index_|.
+      // - After terminating a read batch, the ~ReadIterator dtor updates the
+      //   |rd_index_| with a release-store.
+      // - Reader and writer are typically kCapacity/2 apart. So unless an
+      //   overrun happens a writer won't reuse a newly released record any time
+      //   soon. If an overrun happens, everything is busted regardless.
+      At(cur_)->type_and_id.store(0, std::memory_order_relaxed);
+      ++cur_;
+      return *this;
+    }
+
+   private:
+    friend class RingBuffer;
+    ReadIterator(uint64_t begin, uint64_t end)
+        : cur_(begin), end_(end), valid_(true) {}
+    ReadIterator& operator=(const ReadIterator&) = delete;
+    ReadIterator(const ReadIterator&) = delete;
+
+    uint64_t cur_;
+    uint64_t end_;
+    bool valid_;
+  };
+
+  static Record* At(uint64_t index) {
+    // Doesn't really have to be pow2, but if not the compiler will emit
+    // arithmetic operations to compute the modulo instead of a bitwise AND.
+    static_assert(!(kCapacity & (kCapacity - 1)), "kCapacity must be pow2");
+    PERFETTO_DCHECK(index >= rd_index_);
+    PERFETTO_DCHECK(index <= wr_index_);
+    return &records_[index % kCapacity];
+  }
+
+  // Must be called on the same task runner passed to Enable()
+  static ReadIterator GetReadIterator() {
+    PERFETTO_DCHECK(RingBuffer::IsOnValidTaskRunner());
+    return ReadIterator(rd_index_.load(std::memory_order_acquire),
+                        wr_index_.load(std::memory_order_acquire));
+  }
+
+  static Record* AppendNewRecord();
+  static void Reset();
+
+  static bool has_overruns() {
+    return has_overruns_.load(std::memory_order_acquire);
+  }
+
+  // Can temporarily return a value >= kCapacity but is eventually consistent.
+  // This would happen in case of overruns until threads hit the --wr_index_
+  // in AppendNewRecord().
+  static uint64_t GetSizeForTesting() {
+    auto wr_index = wr_index_.load(std::memory_order_relaxed);
+    auto rd_index = rd_index_.load(std::memory_order_relaxed);
+    PERFETTO_DCHECK(wr_index >= rd_index);
+    return wr_index - rd_index;
+  }
+
+ private:
+  friend class ReadIterator;
+
+  // Returns true if the caller is on the task runner passed to Enable().
+  // Used only for DCHECKs.
+  static bool IsOnValidTaskRunner();
+
+  static std::array<Record, kCapacity> records_;
+  static std::atomic<bool> read_task_queued_;
+  static std::atomic<uint64_t> wr_index_;
+  static std::atomic<uint64_t> rd_index_;
+  static std::atomic<bool> has_overruns_;
+  static Record bankruptcy_record_;  // Used in case of overruns.
+};
+
+inline void TraceCounter(uint32_t tag, uint16_t id, int32_t value) {
+  // memory_order_relaxed is okay because the storage has static lifetime.
+  // It is safe to accidentally log an event soon after disabling.
+  auto enabled_tags = g_enabled_tags.load(std::memory_order_relaxed);
+  if (PERFETTO_LIKELY((enabled_tags & tag) == 0))
+    return;
+  Record* record = RingBuffer::AppendNewRecord();
+  record->thread_id = static_cast<uint32_t>(base::GetThreadId());
+  record->set_timestamp(TraceTimeNowNs());
+  record->counter_value = value;
+  record->type_and_id.store(Record::kTypeCounter | id,
+                            std::memory_order_release);
+}
+
+class ScopedEvent {
+ public:
+  ScopedEvent(uint32_t tag, uint16_t event_id) {
+    auto enabled_tags = g_enabled_tags.load(std::memory_order_relaxed);
+    if (PERFETTO_LIKELY((enabled_tags & tag) == 0))
+      return;
+    event_id_ = event_id;
+    record_ = RingBuffer::AppendNewRecord();
+    record_->thread_id = static_cast<uint32_t>(base::GetThreadId());
+    record_->set_timestamp(TraceTimeNowNs());
+  }
+
+  ~ScopedEvent() {
+    if (PERFETTO_LIKELY(!record_))
+      return;
+    auto now = TraceTimeNowNs();
+    record_->duration_ns = static_cast<uint32_t>(now - record_->timestamp_ns());
+    record_->type_and_id.store(Record::kTypeEvent | event_id_,
+                               std::memory_order_release);
+  }
+
+ private:
+  Record* record_ = nullptr;
+  uint16_t event_id_ = 0;
+  ScopedEvent(const ScopedEvent&) = delete;
+  ScopedEvent& operator=(const ScopedEvent&) = delete;
+};
+
+// Boilerplate to derive a unique variable name for the event.
+#define PERFETTO_METATRACE_UID2(a, b) a##b
+#define PERFETTO_METATRACE_UID(x) PERFETTO_METATRACE_UID2(metatrace_, x)
+
+#define PERFETTO_METATRACE_SCOPED(TAG, ID)                                \
+  ::perfetto::metatrace::ScopedEvent PERFETTO_METATRACE_UID(__COUNTER__)( \
+      ::perfetto::metatrace::TAG, ::perfetto::metatrace::ID)
+
+#define PERFETTO_METATRACE_COUNTER(TAG, ID, VALUE)                \
+  ::perfetto::metatrace::TraceCounter(::perfetto::metatrace::TAG, \
+                                      ::perfetto::metatrace::ID,  \
+                                      static_cast<int32_t>(VALUE))
+
+}  // namespace metatrace
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_METATRACE_H_
+// gen_amalgamated begin header: include/perfetto/base/task_runner.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_BASE_TASK_RUNNER_H_
+#define INCLUDE_PERFETTO_BASE_TASK_RUNNER_H_
+
+#include <stdint.h>
+
+#include <functional>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/base/platform_handle.h"
+
+namespace perfetto {
+namespace base {
+
+// A generic interface to allow the library clients to interleave the execution
+// of the tracing internals in their runtime environment.
+// The expectation is that all tasks, which are queued either via PostTask() or
+// AddFileDescriptorWatch(), are executed on the same sequence (either on the
+// same thread, or on a thread pool that gives sequencing guarantees).
+//
+// Tasks are never executed synchronously inside PostTask and there is a full
+// memory barrier between tasks.
+//
+// All methods of this interface can be called from any thread.
+class PERFETTO_EXPORT TaskRunner {
+ public:
+  virtual ~TaskRunner();
+
+  // Schedule a task for immediate execution. Immediate tasks are always
+  // executed in the order they are posted. Can be called from any thread.
+  virtual void PostTask(std::function<void()>) = 0;
+
+  // Schedule a task for execution after |delay_ms|. Note that there is no
+  // strict ordering guarantee between immediate and delayed tasks. Can be
+  // called from any thread.
+  virtual void PostDelayedTask(std::function<void()>, uint32_t delay_ms) = 0;
+
+  // Schedule a task to run when the handle becomes readable. The same handle
+  // can only be monitored by one function. Note that this function only needs
+  // to be implemented on platforms where the built-in ipc framework is used.
+  // Can be called from any thread.
+  // TODO(skyostil): Refactor this out of the shared interface.
+  virtual void AddFileDescriptorWatch(PlatformHandle,
+                                      std::function<void()>) = 0;
+
+  // Remove a previously scheduled watch for the handle. If this is run on the
+  // target thread of this TaskRunner, guarantees that the task registered to
+  // this handle will not be executed after this function call.
+  // Can be called from any thread.
+  virtual void RemoveFileDescriptorWatch(PlatformHandle) = 0;
+
+  // Checks if the current thread is the same thread where the TaskRunner's task
+  // run. This allows single threaded task runners (like the ones used in
+  // perfetto) to inform the caller that anything posted will run on the same
+  // thread/sequence. This can allow some callers to skip PostTask and instead
+  // directly execute the code. Can be called from any thread.
+  virtual bool RunsTasksOnCurrentThread() const = 0;
+};
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_BASE_TASK_RUNNER_H_
+// gen_amalgamated begin header: include/perfetto/ext/base/thread_annotations.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_THREAD_ANNOTATIONS_H_
+#define INCLUDE_PERFETTO_EXT_BASE_THREAD_ANNOTATIONS_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+
+// Windows TSAN doesn't currently support these annotations.
+#if defined(THREAD_SANITIZER) && !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+extern "C" {
+void AnnotateBenignRaceSized(const char* file,
+                             int line,
+                             unsigned long address,
+                             unsigned long size,
+                             const char* description);
+}
+
+#define PERFETTO_ANNOTATE_BENIGN_RACE_SIZED(pointer, size, description)   \
+  AnnotateBenignRaceSized(__FILE__, __LINE__,                             \
+                          reinterpret_cast<unsigned long>(pointer), size, \
+                          description);
+#else  // defined(ADDRESS_SANITIZER)
+#define PERFETTO_ANNOTATE_BENIGN_RACE_SIZED(pointer, size, description)
+#endif  // defined(ADDRESS_SANITIZER)
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_THREAD_ANNOTATIONS_H_
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/metatrace.h"
+
+// gen_amalgamated expanded: #include "perfetto/base/compiler.h"
+// gen_amalgamated expanded: #include "perfetto/base/task_runner.h"
+// gen_amalgamated expanded: #include "perfetto/base/time.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/file_utils.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/thread_annotations.h"
+
+namespace perfetto {
+namespace metatrace {
+
+std::atomic<uint32_t> g_enabled_tags{0};
+std::atomic<uint64_t> g_enabled_timestamp{0};
+
+// static members
+constexpr size_t RingBuffer::kCapacity;
+std::array<Record, RingBuffer::kCapacity> RingBuffer::records_;
+std::atomic<bool> RingBuffer::read_task_queued_;
+std::atomic<uint64_t> RingBuffer::wr_index_;
+std::atomic<uint64_t> RingBuffer::rd_index_;
+std::atomic<bool> RingBuffer::has_overruns_;
+Record RingBuffer::bankruptcy_record_;
+
+constexpr uint16_t Record::kTypeMask;
+constexpr uint16_t Record::kTypeCounter;
+constexpr uint16_t Record::kTypeEvent;
+
+namespace {
+
+// std::function<> is not trivially de/constructible. This struct wraps it in a
+// heap-allocated struct to avoid static initializers.
+struct Delegate {
+  static Delegate* GetInstance() {
+    static Delegate* instance = new Delegate();
+    return instance;
+  }
+
+  base::TaskRunner* task_runner = nullptr;
+  std::function<void()> read_task;
+};
+
+}  // namespace
+
+bool Enable(std::function<void()> read_task,
+            base::TaskRunner* task_runner,
+            uint32_t tags) {
+  PERFETTO_DCHECK(read_task);
+  PERFETTO_DCHECK(task_runner->RunsTasksOnCurrentThread());
+  if (g_enabled_tags.load(std::memory_order_acquire))
+    return false;
+
+  Delegate* dg = Delegate::GetInstance();
+  dg->task_runner = task_runner;
+  dg->read_task = std::move(read_task);
+  RingBuffer::Reset();
+  g_enabled_timestamp.store(TraceTimeNowNs(), std::memory_order_relaxed);
+  g_enabled_tags.store(tags, std::memory_order_release);
+  return true;
+}
+
+void Disable() {
+  g_enabled_tags.store(0, std::memory_order_release);
+  Delegate* dg = Delegate::GetInstance();
+  PERFETTO_DCHECK(!dg->task_runner ||
+                  dg->task_runner->RunsTasksOnCurrentThread());
+  dg->task_runner = nullptr;
+  dg->read_task = nullptr;
+}
+
+// static
+void RingBuffer::Reset() {
+  bankruptcy_record_.clear();
+  for (Record& record : records_)
+    record.clear();
+  wr_index_ = 0;
+  rd_index_ = 0;
+  has_overruns_ = false;
+  read_task_queued_ = false;
+}
+
+// static
+Record* RingBuffer::AppendNewRecord() {
+  auto wr_index = wr_index_.fetch_add(1, std::memory_order_acq_rel);
+
+  // rd_index can only monotonically increase, we don't care if we read an
+  // older value, we'll just hit the slow-path a bit earlier if it happens.
+  auto rd_index = rd_index_.load(std::memory_order_relaxed);
+
+  PERFETTO_DCHECK(wr_index >= rd_index);
+  auto size = wr_index - rd_index;
+  if (PERFETTO_LIKELY(size < kCapacity / 2))
+    return At(wr_index);
+
+  // Slow-path: Enqueue the read task and handle overruns.
+  bool expected = false;
+  if (RingBuffer::read_task_queued_.compare_exchange_strong(expected, true)) {
+    Delegate* dg = Delegate::GetInstance();
+    if (dg->task_runner) {
+      dg->task_runner->PostTask([] {
+        // Meta-tracing might have been disabled in the meantime.
+        auto read_task = Delegate::GetInstance()->read_task;
+        if (read_task)
+          read_task();
+        RingBuffer::read_task_queued_ = false;
+      });
+    }
+  }
+
+  if (PERFETTO_LIKELY(size < kCapacity))
+    return At(wr_index);
+
+  has_overruns_.store(true, std::memory_order_release);
+  wr_index_.fetch_sub(1, std::memory_order_acq_rel);
+
+  // In the case of overflows, threads will race writing on the same memory
+  // location and TSan will rightly complain. This is fine though because nobody
+  // will read the bankruptcy record and it's designed to contain garbage.
+  PERFETTO_ANNOTATE_BENIGN_RACE_SIZED(&bankruptcy_record_, sizeof(Record),
+                                      "nothing reads bankruptcy_record_")
+  return &bankruptcy_record_;
+}
+
+// static
+bool RingBuffer::IsOnValidTaskRunner() {
+  auto* task_runner = Delegate::GetInstance()->task_runner;
+  return task_runner && task_runner->RunsTasksOnCurrentThread();
+}
+
+}  // namespace metatrace
+}  // namespace perfetto
+// gen_amalgamated begin source: src/base/paged_memory.cc
+// gen_amalgamated begin header: include/perfetto/ext/base/paged_memory.h
+// gen_amalgamated begin header: include/perfetto/ext/base/container_annotations.h
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_CONTAINER_ANNOTATIONS_H_
+#define INCLUDE_PERFETTO_EXT_BASE_CONTAINER_ANNOTATIONS_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+
+// Windows ASAN doesn't currently support these annotations.
+#if defined(ADDRESS_SANITIZER) && !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) && \
+    !defined(ADDRESS_SANITIZER_WITHOUT_INSTRUMENTATION)
+
+#define ANNOTATE_NEW_BUFFER(buffer, capacity, new_size)                      \
+  if (buffer) {                                                              \
+    __sanitizer_annotate_contiguous_container(buffer, (buffer) + (capacity), \
+                                              (buffer) + (capacity),         \
+                                              (buffer) + (new_size));        \
+  }
+#define ANNOTATE_DELETE_BUFFER(buffer, capacity, old_size)                   \
+  if (buffer) {                                                              \
+    __sanitizer_annotate_contiguous_container(buffer, (buffer) + (capacity), \
+                                              (buffer) + (old_size),         \
+                                              (buffer) + (capacity));        \
+  }
+#define ANNOTATE_CHANGE_SIZE(buffer, capacity, old_size, new_size)           \
+  if (buffer) {                                                              \
+    __sanitizer_annotate_contiguous_container(buffer, (buffer) + (capacity), \
+                                              (buffer) + (old_size),         \
+                                              (buffer) + (new_size));        \
+  }
+#define ANNOTATE_CHANGE_CAPACITY(buffer, old_capacity, buffer_size, \
+                                 new_capacity)                      \
+  ANNOTATE_DELETE_BUFFER(buffer, old_capacity, buffer_size);        \
+  ANNOTATE_NEW_BUFFER(buffer, new_capacity, buffer_size);
+// Annotations require buffers to begin on an 8-byte boundary.
+#else  // defined(ADDRESS_SANITIZER)
+#define ANNOTATE_NEW_BUFFER(buffer, capacity, new_size)
+#define ANNOTATE_DELETE_BUFFER(buffer, capacity, old_size)
+#define ANNOTATE_CHANGE_SIZE(buffer, capacity, old_size, new_size)
+#define ANNOTATE_CHANGE_CAPACITY(buffer, old_capacity, buffer_size, \
+                                 new_capacity)
+#endif  // defined(ADDRESS_SANITIZER)
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_CONTAINER_ANNOTATIONS_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_PAGED_MEMORY_H_
+#define INCLUDE_PERFETTO_EXT_BASE_PAGED_MEMORY_H_
+
+#include <memory>
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/container_annotations.h"
+
+// We need to track the committed size on windows and when ASAN is enabled.
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) || defined(ADDRESS_SANITIZER)
+#define TRACK_COMMITTED_SIZE() 1
+#else
+#define TRACK_COMMITTED_SIZE() 0
+#endif
+
+namespace perfetto {
+namespace base {
+
+class PagedMemory {
+ public:
+  // Initializes an invalid PagedMemory pointing to nullptr.
+  PagedMemory();
+
+  ~PagedMemory();
+
+  PagedMemory(PagedMemory&& other) noexcept;
+  PagedMemory& operator=(PagedMemory&& other);
+
+  enum AllocationFlags {
+    // By default, Allocate() crashes if the underlying mmap fails (e.g., if out
+    // of virtual address space). When this flag is provided, an invalid
+    // PagedMemory pointing to nullptr is returned in this case instead.
+    kMayFail = 1 << 0,
+
+    // By default, Allocate() commits the allocated memory immediately. When
+    // this flag is provided, the memory virtual address space may only be
+    // reserved and the user should call EnsureCommitted() before writing to
+    // memory addresses.
+    kDontCommit = 1 << 1,
+  };
+
+  // Allocates |size| bytes using mmap(MAP_ANONYMOUS). The returned memory is
+  // guaranteed to be page-aligned and guaranteed to be zeroed.
+  // For |flags|, see the AllocationFlags enum above.
+  static PagedMemory Allocate(size_t size, int flags = 0);
+
+  // Hint to the OS that the memory range is not needed and can be discarded.
+  // The memory remains accessible and its contents may be retained, or they
+  // may be zeroed. This function may be a NOP on some platforms. Returns true
+  // if implemented.
+  bool AdviseDontNeed(void* p, size_t size);
+
+  // Ensures that at least the first |committed_size| bytes of the allocated
+  // memory region are committed. The implementation may commit memory in larger
+  // chunks above |committed_size|. Crashes if the memory couldn't be committed.
+#if TRACK_COMMITTED_SIZE()
+  void EnsureCommitted(size_t committed_size);
+#else   // TRACK_COMMITTED_SIZE()
+  void EnsureCommitted(size_t /*committed_size*/) {}
+#endif  // TRACK_COMMITTED_SIZE()
+
+  inline void* Get() const noexcept { return p_; }
+  inline bool IsValid() const noexcept { return !!p_; }
+  inline size_t size() const noexcept { return size_; }
+
+ private:
+  PagedMemory(char* p, size_t size);
+
+  PagedMemory(const PagedMemory&) = delete;
+  // Defaulted for implementation of move constructor + assignment.
+  PagedMemory& operator=(const PagedMemory&) = default;
+
+  char* p_ = nullptr;
+
+  // The size originally passed to Allocate(). The actual virtual memory
+  // reservation will be larger due to: (i) guard pages; (ii) rounding up to
+  // the system page size.
+  size_t size_ = 0;
+
+#if TRACK_COMMITTED_SIZE()
+  size_t committed_size_ = 0u;
+#endif  // TRACK_COMMITTED_SIZE()
+};
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_PAGED_MEMORY_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/paged_memory.h"
+
+#include <algorithm>
+#include <cmath>
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+#include <Windows.h>
+#else  // PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+#include <sys/mman.h>
+#endif  // PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/container_annotations.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+
+namespace perfetto {
+namespace base {
+
+namespace {
+
+#if TRACK_COMMITTED_SIZE()
+constexpr size_t kCommitChunkSize = 4 * 1024 * 1024;  // 4MB
+#endif
+
+size_t RoundUpToSysPageSize(size_t req_size) {
+  const size_t page_size = GetSysPageSize();
+  return (req_size + page_size - 1) & ~(page_size - 1);
+}
+
+size_t GuardSize() {
+  return GetSysPageSize();
+}
+
+}  // namespace
+
+// static
+PagedMemory PagedMemory::Allocate(size_t req_size, int flags) {
+  size_t rounded_up_size = RoundUpToSysPageSize(req_size);
+  PERFETTO_CHECK(rounded_up_size >= req_size);
+  size_t outer_size = rounded_up_size + GuardSize() * 2;
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  void* ptr = VirtualAlloc(nullptr, outer_size, MEM_RESERVE, PAGE_NOACCESS);
+  if (!ptr && (flags & kMayFail))
+    return PagedMemory();
+  PERFETTO_CHECK(ptr);
+  char* usable_region = reinterpret_cast<char*>(ptr) + GuardSize();
+#else   // PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  void* ptr = mmap(nullptr, outer_size, PROT_READ | PROT_WRITE,
+                   MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+  if (ptr == MAP_FAILED && (flags & kMayFail))
+    return PagedMemory();
+  PERFETTO_CHECK(ptr && ptr != MAP_FAILED);
+  char* usable_region = reinterpret_cast<char*>(ptr) + GuardSize();
+  int res = mprotect(ptr, GuardSize(), PROT_NONE);
+  res |= mprotect(usable_region + rounded_up_size, GuardSize(), PROT_NONE);
+  PERFETTO_CHECK(res == 0);
+#endif  // PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+
+  auto memory = PagedMemory(usable_region, req_size);
+#if TRACK_COMMITTED_SIZE()
+  size_t initial_commit = req_size;
+  if (flags & kDontCommit)
+    initial_commit = std::min(initial_commit, kCommitChunkSize);
+  memory.EnsureCommitted(initial_commit);
+#endif  // TRACK_COMMITTED_SIZE()
+  return memory;
+}
+
+PagedMemory::PagedMemory() {}
+
+// clang-format off
+PagedMemory::PagedMemory(char* p, size_t size) : p_(p), size_(size) {
+  ANNOTATE_NEW_BUFFER(p_, size_, committed_size_)
+}
+
+PagedMemory::PagedMemory(PagedMemory&& other) noexcept {
+  *this = other;
+  other.p_ = nullptr;
+}
+// clang-format on
+
+PagedMemory& PagedMemory::operator=(PagedMemory&& other) {
+  this->~PagedMemory();
+  new (this) PagedMemory(std::move(other));
+  return *this;
+}
+
+PagedMemory::~PagedMemory() {
+  if (!p_)
+    return;
+  PERFETTO_CHECK(size_);
+  char* start = p_ - GuardSize();
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  BOOL res = VirtualFree(start, 0, MEM_RELEASE);
+  PERFETTO_CHECK(res != 0);
+#else   // PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  const size_t outer_size = RoundUpToSysPageSize(size_) + GuardSize() * 2;
+  int res = munmap(start, outer_size);
+  PERFETTO_CHECK(res == 0);
+#endif  // PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  ANNOTATE_DELETE_BUFFER(p_, size_, committed_size_)
+}
+
+bool PagedMemory::AdviseDontNeed(void* p, size_t size) {
+  PERFETTO_DCHECK(p_);
+  PERFETTO_DCHECK(p >= p_);
+  PERFETTO_DCHECK(static_cast<char*>(p) + size <= p_ + size_);
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) || PERFETTO_BUILDFLAG(PERFETTO_OS_NACL)
+  // Discarding pages on Windows has more CPU cost than is justified for the
+  // possible memory savings.
+  return false;
+#else   // PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) ||
+        // PERFETTO_BUILDFLAG(PERFETTO_OS_NACL)
+  // http://man7.org/linux/man-pages/man2/madvise.2.html
+  int res = madvise(p, size, MADV_DONTNEED);
+  PERFETTO_DCHECK(res == 0);
+  return true;
+#endif  // PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) ||
+        // PERFETTO_BUILDFLAG(PERFETTO_OS_NACL)
+}
+
+#if TRACK_COMMITTED_SIZE()
+void PagedMemory::EnsureCommitted(size_t committed_size) {
+  PERFETTO_DCHECK(committed_size > 0u);
+  PERFETTO_DCHECK(committed_size <= size_);
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  if (committed_size_ >= committed_size)
+    return;
+  // Rounding up.
+  size_t delta = committed_size - committed_size_;
+  size_t num_additional_chunks =
+      (delta + kCommitChunkSize - 1) / kCommitChunkSize;
+  PERFETTO_DCHECK(num_additional_chunks * kCommitChunkSize >= delta);
+  // Don't commit more than the total size.
+  size_t commit_size = std::min(num_additional_chunks * kCommitChunkSize,
+                                size_ - committed_size_);
+  void* res = VirtualAlloc(p_ + committed_size_, commit_size, MEM_COMMIT,
+                           PAGE_READWRITE);
+  PERFETTO_CHECK(res);
+  ANNOTATE_CHANGE_SIZE(p_, size_, committed_size_,
+                       committed_size_ + commit_size)
+  committed_size_ += commit_size;
+#else   // PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  // mmap commits automatically as needed, so we only track here for ASAN.
+  committed_size = std::max(committed_size_, committed_size);
+  ANNOTATE_CHANGE_SIZE(p_, size_, committed_size_, committed_size)
+  committed_size_ = committed_size;
+#endif  // PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+}
+#endif  // TRACK_COMMITTED_SIZE()
+
+}  // namespace base
+}  // namespace perfetto
+// gen_amalgamated begin source: src/base/periodic_task.cc
+// gen_amalgamated begin header: include/perfetto/ext/base/periodic_task.h
+// gen_amalgamated begin header: include/perfetto/ext/base/thread_checker.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_THREAD_CHECKER_H_
+#define INCLUDE_PERFETTO_EXT_BASE_THREAD_CHECKER_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+
+#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+#include <pthread.h>
+#endif
+#include <atomic>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+
+namespace perfetto {
+namespace base {
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+using ThreadID = unsigned long;
+#else
+using ThreadID = pthread_t;
+#endif
+
+class PERFETTO_EXPORT ThreadChecker {
+ public:
+  ThreadChecker();
+  ~ThreadChecker();
+  ThreadChecker(const ThreadChecker&);
+  ThreadChecker& operator=(const ThreadChecker&);
+  bool CalledOnValidThread() const PERFETTO_WARN_UNUSED_RESULT;
+  void DetachFromThread();
+
+ private:
+  mutable std::atomic<ThreadID> thread_id_;
+};
+
+#if PERFETTO_DCHECK_IS_ON() && !PERFETTO_BUILDFLAG(PERFETTO_CHROMIUM_BUILD)
+// TODO(primiano) Use Chromium's thread checker in Chromium.
+#define PERFETTO_THREAD_CHECKER(name) base::ThreadChecker name;
+#define PERFETTO_DCHECK_THREAD(name) \
+  PERFETTO_DCHECK((name).CalledOnValidThread())
+#define PERFETTO_DETACH_FROM_THREAD(name) (name).DetachFromThread()
+#else
+#define PERFETTO_THREAD_CHECKER(name)
+#define PERFETTO_DCHECK_THREAD(name)
+#define PERFETTO_DETACH_FROM_THREAD(name)
+#endif  // PERFETTO_DCHECK_IS_ON()
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_THREAD_CHECKER_H_
+// gen_amalgamated begin header: include/perfetto/ext/base/weak_ptr.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_WEAK_PTR_H_
+#define INCLUDE_PERFETTO_EXT_BASE_WEAK_PTR_H_
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/thread_checker.h"
+
+#include <memory>
+
+namespace perfetto {
+namespace base {
+
+// A simple WeakPtr for single-threaded cases.
+// Generally keep the WeakPtrFactory as last fields in classes: it makes the
+// WeakPtr(s) invalidate as first thing in the class dtor.
+// Usage:
+// class MyClass {
+//  MyClass() : weak_factory_(this) {}
+//  WeakPtr<MyClass> GetWeakPtr() { return weak_factory_.GetWeakPtr(); }
+//
+// private:
+//  WeakPtrFactory<MyClass> weak_factory_;
+// }
+//
+// int main() {
+//  std::unique_ptr<MyClass> foo(new MyClass);
+//  auto wptr = foo.GetWeakPtr();
+//  ASSERT_TRUE(wptr);
+//  ASSERT_EQ(foo.get(), wptr->get());
+//  foo.reset();
+//  ASSERT_FALSE(wptr);
+//  ASSERT_EQ(nullptr, wptr->get());
+// }
+
+template <typename T>
+class WeakPtrFactory;  // Forward declaration, defined below.
+
+template <typename T>
+class WeakPtr {
+ public:
+  WeakPtr() {}
+  WeakPtr(const WeakPtr&) = default;
+  WeakPtr& operator=(const WeakPtr&) = default;
+  WeakPtr(WeakPtr&&) = default;
+  WeakPtr& operator=(WeakPtr&&) = default;
+
+  T* get() const {
+    PERFETTO_DCHECK_THREAD(thread_checker);
+    return handle_ ? *handle_.get() : nullptr;
+  }
+  T* operator->() const { return get(); }
+  T& operator*() const { return *get(); }
+
+  explicit operator bool() const { return !!get(); }
+
+ private:
+  friend class WeakPtrFactory<T>;
+  explicit WeakPtr(const std::shared_ptr<T*>& handle) : handle_(handle) {}
+
+  std::shared_ptr<T*> handle_;
+  PERFETTO_THREAD_CHECKER(thread_checker)
+};
+
+template <typename T>
+class WeakPtrFactory {
+ public:
+  explicit WeakPtrFactory(T* owner)
+      : weak_ptr_(std::shared_ptr<T*>(new T* {owner})) {
+    PERFETTO_DCHECK_THREAD(thread_checker);
+  }
+
+  ~WeakPtrFactory() {
+    PERFETTO_DCHECK_THREAD(thread_checker);
+    *(weak_ptr_.handle_.get()) = nullptr;
+  }
+
+  // Can be safely called on any thread, since it simply copies |weak_ptr_|.
+  // Note that any accesses to the returned pointer need to be made on the
+  // thread that created/reset the factory.
+  WeakPtr<T> GetWeakPtr() const { return weak_ptr_; }
+
+  // Reset the factory to a new owner & thread. May only be called before any
+  // weak pointers were passed out. Future weak pointers will be valid on the
+  // calling thread.
+  void Reset(T* owner) {
+    // Reset thread checker to current thread.
+    PERFETTO_DETACH_FROM_THREAD(thread_checker);
+    PERFETTO_DCHECK_THREAD(thread_checker);
+
+    // We should not have passed out any weak pointers yet at this point.
+    PERFETTO_DCHECK(weak_ptr_.handle_.use_count() == 1);
+
+    weak_ptr_ = WeakPtr<T>(std::shared_ptr<T*>(new T* {owner}));
+  }
+
+ private:
+  WeakPtrFactory(const WeakPtrFactory&) = delete;
+  WeakPtrFactory& operator=(const WeakPtrFactory&) = delete;
+
+  WeakPtr<T> weak_ptr_;
+  PERFETTO_THREAD_CHECKER(thread_checker)
+};
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_WEAK_PTR_H_
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_PERIODIC_TASK_H_
+#define INCLUDE_PERFETTO_EXT_BASE_PERIODIC_TASK_H_
+
+#include <functional>
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/scoped_file.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/thread_checker.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/weak_ptr.h"
+
+namespace perfetto {
+namespace base {
+
+class TaskRunner;
+
+// A periodic task utility class. It wraps the logic necessary to do periodic
+// tasks using a TaskRunner, taking care of subtleties like ensuring that
+// outstanding tasks are cancelled after reset/dtor.
+// Tasks are aligned on wall time, this is to ensure that when using multiple
+// periodic tasks, they happen at the same time, minimizing wakeups.
+// On Linux/Android it also supports suspend-aware mode (via timerfd). On other
+// operating systems it falls back to PostDelayedTask, which is not
+// suspend-aware.
+// TODO(primiano): this should probably become a periodic timer scheduler, so we
+// can use one FD for everything rather than one FD per task. For now we take
+// the hit of a FD-per-task to keep this low-risk.
+class PeriodicTask {
+ public:
+  explicit PeriodicTask(base::TaskRunner*);
+  ~PeriodicTask();  // Calls Reset().
+
+  struct Args {
+    uint32_t period_ms = 0;
+    std::function<void()> task = nullptr;
+    bool start_first_task_immediately = false;
+    bool use_suspend_aware_timer = false;
+  };
+
+  void Start(Args);
+
+  // Safe to be called multiple times, even without calling Start():
+  void Reset();
+
+  // No copy or move. WeakPtr-wrapped pointers to |this| are posted on the
+  // task runner, this class is not easily movable.
+  PeriodicTask(const PeriodicTask&) = delete;
+  PeriodicTask& operator=(const PeriodicTask&) = delete;
+  PeriodicTask(PeriodicTask&&) = delete;
+  PeriodicTask& operator=(PeriodicTask&&) = delete;
+
+  base::PlatformHandle timer_fd_for_testing() { return *timer_fd_; }
+
+ private:
+  static void RunTaskAndPostNext(base::WeakPtr<PeriodicTask>,
+                                 uint32_t generation);
+  void PostNextTask();
+  void ResetTimerFd();
+
+  base::TaskRunner* const task_runner_;
+  Args args_;
+  uint32_t generation_ = 0;
+  base::ScopedPlatformHandle timer_fd_;
+
+  PERFETTO_THREAD_CHECKER(thread_checker_)
+  base::WeakPtrFactory<PeriodicTask> weak_ptr_factory_;  // Keep last.
+};
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_PERIODIC_TASK_H_
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/periodic_task.h"
+
+#include <limits>
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/base/task_runner.h"
+// gen_amalgamated expanded: #include "perfetto/base/time.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/file_utils.h"
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+    (PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) && __ANDROID_API__ >= 19)
+#include <sys/timerfd.h>
+#endif
+
+namespace perfetto {
+namespace base {
+
+namespace {
+base::ScopedPlatformHandle CreateTimerFd(uint32_t period_ms) {
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+    (PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) && __ANDROID_API__ >= 19)
+  base::ScopedPlatformHandle tfd(
+      timerfd_create(CLOCK_BOOTTIME, TFD_CLOEXEC | TFD_NONBLOCK));
+  // The initial phase, aligned on wall clock.
+  uint32_t phase_ms =
+      period_ms -
+      static_cast<uint32_t>(base::GetBootTimeNs().count() % period_ms);
+  struct itimerspec its {};
+  // The "1 +" is to make sure that we never pass a zero it_value in the
+  // unlikely case of phase_ms being 0. That would cause the timer to be
+  // considered disarmed by timerfd_settime.
+  its.it_value.tv_sec = static_cast<time_t>(phase_ms / 1000u);
+  its.it_value.tv_nsec = 1 + static_cast<long>((phase_ms % 1000u) * 1000000u);
+  its.it_interval.tv_sec = static_cast<time_t>(period_ms / 1000u);
+  its.it_interval.tv_nsec = static_cast<long>((period_ms % 1000u) * 1000000u);
+  if (timerfd_settime(*tfd, 0, &its, nullptr) < 0)
+    return base::ScopedPlatformHandle();
+  return tfd;
+#else
+  base::ignore_result(period_ms);
+  return base::ScopedPlatformHandle();
+#endif
+}
+}  // namespace
+
+PeriodicTask::PeriodicTask(base::TaskRunner* task_runner)
+    : task_runner_(task_runner), weak_ptr_factory_(this) {}
+
+PeriodicTask::~PeriodicTask() {
+  Reset();
+}
+
+void PeriodicTask::Start(Args args) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  Reset();
+  if (args.period_ms == 0 || !args.task) {
+    PERFETTO_DCHECK(args.period_ms > 0);
+    PERFETTO_DCHECK(args.task);
+    return;
+  }
+  args_ = std::move(args);
+  if (args_.use_suspend_aware_timer) {
+    timer_fd_ = CreateTimerFd(args_.period_ms);
+    if (timer_fd_) {
+      auto weak_this = weak_ptr_factory_.GetWeakPtr();
+      task_runner_->AddFileDescriptorWatch(
+          *timer_fd_,
+          std::bind(PeriodicTask::RunTaskAndPostNext, weak_this, generation_));
+    } else {
+      PERFETTO_DPLOG("timerfd not supported, falling back on PostDelayedTask");
+    }
+  }  // if (use_suspend_aware_timer).
+
+  if (!timer_fd_)
+    PostNextTask();
+
+  if (args_.start_first_task_immediately)
+    args_.task();
+}
+
+void PeriodicTask::PostNextTask() {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  PERFETTO_DCHECK(args_.period_ms > 0);
+  PERFETTO_DCHECK(!timer_fd_);
+  uint32_t delay_ms =
+      args_.period_ms -
+      static_cast<uint32_t>(base::GetWallTimeMs().count() % args_.period_ms);
+  auto weak_this = weak_ptr_factory_.GetWeakPtr();
+  task_runner_->PostDelayedTask(
+      std::bind(PeriodicTask::RunTaskAndPostNext, weak_this, generation_),
+      delay_ms);
+}
+
+// static
+// This function can be called in two ways (both from the TaskRunner):
+// 1. When using a timerfd, this task is registered as a FD watch.
+// 2. When using PostDelayedTask, this is the task posted on the TaskRunner.
+void PeriodicTask::RunTaskAndPostNext(base::WeakPtr<PeriodicTask> thiz,
+                                      uint32_t generation) {
+  if (!thiz || !thiz->args_.task || generation != thiz->generation_)
+    return;  // Destroyed or Reset() in the meanwhile.
+  PERFETTO_DCHECK_THREAD(thiz->thread_checker_);
+  if (thiz->timer_fd_) {
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+    PERFETTO_FATAL("timerfd for periodic tasks unsupported on Windows");
+#else
+    // If we are using a timerfd there is no need to repeatedly call
+    // PostDelayedTask(). The kernel will wakeup the timer fd periodically. We
+    // just need to read() it.
+    uint64_t ignored = 0;
+    errno = 0;
+    auto rsize = base::Read(*thiz->timer_fd_, &ignored, sizeof(&ignored));
+    if (rsize != sizeof(uint64_t)) {
+      if (errno == EAGAIN)
+        return;  // A spurious wakeup. Rare, but can happen, just ignore.
+      PERFETTO_PLOG("read(timerfd) failed, falling back on PostDelayedTask");
+      thiz->ResetTimerFd();
+    }
+#endif
+  }
+  // The repetition of the if() is to deal with the ResetTimerFd() case above.
+  if (!thiz->timer_fd_) {
+    thiz->PostNextTask();
+  }
+  // Create a copy of the task in the unlikely event that the task ends up
+  // up destroying the PeriodicTask object or calling Reset() on it. That would
+  // cause a reset of the args_.task itself, which would invalidate the task
+  // bind state while we are invoking it.
+  auto task = thiz->args_.task;
+  task();
+}
+
+void PeriodicTask::Reset() {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  ++generation_;
+  args_ = Args();
+  PERFETTO_DCHECK(!args_.task);
+  ResetTimerFd();
+}
+
+void PeriodicTask::ResetTimerFd() {
+  if (!timer_fd_)
+    return;
+  task_runner_->RemoveFileDescriptorWatch(*timer_fd_);
+  timer_fd_.reset();
+}
+
+}  // namespace base
+}  // namespace perfetto
+// gen_amalgamated begin source: src/base/pipe.cc
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/pipe.h"
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+
+#include <fcntl.h>  // For O_BINARY (Windows) and F_SETxx (UNIX)
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+#include <Windows.h>
+#include <namedpipeapi.h>
+#else
+#include <sys/types.h>
+#include <unistd.h>
+#endif
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+
+namespace perfetto {
+namespace base {
+
+Pipe::Pipe() = default;
+Pipe::Pipe(Pipe&&) noexcept = default;
+Pipe& Pipe::operator=(Pipe&&) = default;
+
+Pipe Pipe::Create(Flags flags) {
+  PlatformHandle fds[2];
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  PERFETTO_CHECK(::CreatePipe(&fds[0], &fds[1], /*lpPipeAttributes=*/nullptr,
+                              0 /*default size*/));
+#else
+  PERFETTO_CHECK(pipe(fds) == 0);
+  PERFETTO_CHECK(fcntl(fds[0], F_SETFD, FD_CLOEXEC) == 0);
+  PERFETTO_CHECK(fcntl(fds[1], F_SETFD, FD_CLOEXEC) == 0);
+#endif
+  Pipe p;
+  p.rd.reset(fds[0]);
+  p.wr.reset(fds[1]);
+
+#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  if (flags == kBothNonBlock || flags == kRdNonBlock) {
+    int cur_flags = fcntl(*p.rd, F_GETFL, 0);
+    PERFETTO_CHECK(cur_flags >= 0);
+    PERFETTO_CHECK(fcntl(*p.rd, F_SETFL, cur_flags | O_NONBLOCK) == 0);
+  }
+
+  if (flags == kBothNonBlock || flags == kWrNonBlock) {
+    int cur_flags = fcntl(*p.wr, F_GETFL, 0);
+    PERFETTO_CHECK(cur_flags >= 0);
+    PERFETTO_CHECK(fcntl(*p.wr, F_SETFL, cur_flags | O_NONBLOCK) == 0);
+  }
+#else
+  PERFETTO_CHECK(flags == kBothBlock);
+#endif
+  return p;
+}
+
+}  // namespace base
+}  // namespace perfetto
+// gen_amalgamated begin source: src/base/status.cc
+// gen_amalgamated begin header: include/perfetto/base/status.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_BASE_STATUS_H_
+#define INCLUDE_PERFETTO_BASE_STATUS_H_
+
+#include <string>
+
+// gen_amalgamated expanded: #include "perfetto/base/compiler.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+
+namespace perfetto {
+namespace base {
+
+// Represents either the success or the failure message of a function.
+// This can used as the return type of functions which would usually return an
+// bool for success or int for errno but also wants to add some string context
+// (ususally for logging).
+class PERFETTO_EXPORT Status {
+ public:
+  Status() : ok_(true) {}
+  explicit Status(std::string msg) : ok_(false), message_(std::move(msg)) {
+    PERFETTO_CHECK(!message_.empty());
+  }
+
+  // Copy operations.
+  Status(const Status&) = default;
+  Status& operator=(const Status&) = default;
+
+  // Move operations. The moved-from state is valid but unspecified.
+  Status(Status&&) noexcept = default;
+  Status& operator=(Status&&) = default;
+
+  bool ok() const { return ok_; }
+
+  // When ok() is false this returns the error message. Returns the empty string
+  // otherwise.
+  const std::string& message() const { return message_; }
+  const char* c_message() const { return message_.c_str(); }
+
+ private:
+  bool ok_ = false;
+  std::string message_;
+};
+
+// Returns a status object which represents the Ok status.
+inline Status OkStatus() {
+  return Status();
+}
+
+PERFETTO_PRINTF_FORMAT(1, 2) Status ErrStatus(const char* format, ...);
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_BASE_STATUS_H_
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/base/status.h"
+
+#include <stdarg.h>
+
+namespace perfetto {
+namespace base {
+
+Status ErrStatus(const char* format, ...) {
+  char buffer[1024];
+  va_list ap;
+  va_start(ap, format);
+  vsnprintf(buffer, sizeof(buffer), format, ap);
+  va_end(ap);
+  Status status(buffer);
+  return status;
+}
+
+}  // namespace base
+}  // namespace perfetto
+// gen_amalgamated begin source: src/base/string_splitter.cc
+// gen_amalgamated begin header: include/perfetto/ext/base/string_splitter.h
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_STRING_SPLITTER_H_
+#define INCLUDE_PERFETTO_EXT_BASE_STRING_SPLITTER_H_
+
+#include <string>
+
+namespace perfetto {
+namespace base {
+
+// C++ version of strtok(). Splits a string without making copies or any heap
+// allocations. Destructs the original string passed in input.
+// Supports the special case of using \0 as a delimiter.
+// The token returned in output are valid as long as the input string is valid.
+class StringSplitter {
+ public:
+  // Can take ownership of the string if passed via std::move(), e.g.:
+  // StringSplitter(std::move(str), '\n');
+  StringSplitter(std::string, char delimiter);
+
+  // Splits a C-string. The input string will be forcefully null-terminated (so
+  // str[size - 1] should be == '\0' or the last char will be truncated).
+  StringSplitter(char* str, size_t size, char delimiter);
+
+  // Splits the current token from an outer StringSplitter instance. This is to
+  // chain splitters as follows:
+  // for (base::StringSplitter lines(x, '\n'); ss.Next();)
+  //   for (base::StringSplitter words(&lines, ' '); words.Next();)
+  StringSplitter(StringSplitter*, char delimiter);
+
+  // Returns true if a token is found (in which case it will be stored in
+  // cur_token()), false if no more tokens are found.
+  bool Next();
+
+  // Returns the current token iff last call to Next() returned true. In this
+  // case it guarantees that the returned string is always null terminated.
+  // In all other cases (before the 1st call to Next() and after Next() returns
+  // false) returns nullptr.
+  char* cur_token() { return cur_; }
+
+  // Returns the length of the current token (excluding the null terminator).
+  size_t cur_token_size() const { return cur_size_; }
+
+ private:
+  StringSplitter(const StringSplitter&) = delete;
+  StringSplitter& operator=(const StringSplitter&) = delete;
+  void Initialize(char* str, size_t size);
+
+  std::string str_;
+  char* cur_;
+  size_t cur_size_;
+  char* next_;
+  char* end_;  // STL-style, points one past the last char.
+  const char delimiter_;
+};
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_STRING_SPLITTER_H_
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/string_splitter.h"
+
+#include <utility>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+
+namespace perfetto {
+namespace base {
+
+StringSplitter::StringSplitter(std::string str, char delimiter)
+    : str_(std::move(str)), delimiter_(delimiter) {
+  // It's legal to access str[str.size()] in C++11 (it always returns \0),
+  // hence the +1 (which becomes just size() after the -1 in Initialize()).
+  Initialize(&str_[0], str_.size() + 1);
+}
+
+StringSplitter::StringSplitter(char* str, size_t size, char delimiter)
+    : delimiter_(delimiter) {
+  Initialize(str, size);
+}
+
+StringSplitter::StringSplitter(StringSplitter* outer, char delimiter)
+    : delimiter_(delimiter) {
+  Initialize(outer->cur_token(), outer->cur_token_size() + 1);
+}
+
+void StringSplitter::Initialize(char* str, size_t size) {
+  PERFETTO_DCHECK(!size || str);
+  next_ = str;
+  end_ = str + size;
+  cur_ = nullptr;
+  cur_size_ = 0;
+  if (size)
+    next_[size - 1] = '\0';
+}
+
+bool StringSplitter::Next() {
+  for (; next_ < end_; next_++) {
+    if (*next_ == delimiter_)
+      continue;
+    cur_ = next_;
+    for (;; next_++) {
+      if (*next_ == delimiter_) {
+        cur_size_ = static_cast<size_t>(next_ - cur_);
+        *(next_++) = '\0';
+        break;
+      }
+      if (*next_ == '\0') {
+        cur_size_ = static_cast<size_t>(next_ - cur_);
+        next_ = end_;
+        break;
+      }
+    }
+    if (*cur_)
+      return true;
+    break;
+  }
+  cur_ = nullptr;
+  cur_size_ = 0;
+  return false;
+}
+
+}  // namespace base
+}  // namespace perfetto
+// gen_amalgamated begin source: src/base/string_utils.cc
+// gen_amalgamated begin header: include/perfetto/ext/base/string_utils.h
+// gen_amalgamated begin header: include/perfetto/ext/base/optional.h
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_OPTIONAL_H_
+#define INCLUDE_PERFETTO_EXT_BASE_OPTIONAL_H_
+
+#include <functional>
+#include <type_traits>
+#include <utility>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+
+namespace perfetto {
+namespace base {
+
+// Specification:
+// http://en.cppreference.com/w/cpp/utility/optional/in_place_t
+struct in_place_t {};
+
+// Specification:
+// http://en.cppreference.com/w/cpp/utility/optional/nullopt_t
+struct nullopt_t {
+  constexpr explicit nullopt_t(int) {}
+};
+
+// Specification:
+// http://en.cppreference.com/w/cpp/utility/optional/in_place
+constexpr in_place_t in_place = {};
+
+// Specification:
+// http://en.cppreference.com/w/cpp/utility/optional/nullopt
+constexpr nullopt_t nullopt(0);
+
+// Forward declaration, which is referred by following helpers.
+template <typename T>
+class Optional;
+
+namespace internal {
+
+template <typename T, bool = std::is_trivially_destructible<T>::value>
+struct OptionalStorageBase {
+  // Initializing |empty_| here instead of using default member initializing
+  // to avoid errors in g++ 4.8.
+  constexpr OptionalStorageBase() : empty_('\0') {}
+
+  template <class... Args>
+  constexpr explicit OptionalStorageBase(in_place_t, Args&&... args)
+      : is_populated_(true), value_(std::forward<Args>(args)...) {}
+
+  // When T is not trivially destructible we must call its
+  // destructor before deallocating its memory.
+  // Note that this hides the (implicitly declared) move constructor, which
+  // would be used for constexpr move constructor in OptionalStorage<T>.
+  // It is needed iff T is trivially move constructible. However, the current
+  // is_trivially_{copy,move}_constructible implementation requires
+  // is_trivially_destructible (which looks a bug, cf:
+  // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51452 and
+  // http://cplusplus.github.io/LWG/lwg-active.html#2116), so it is not
+  // necessary for this case at the moment. Please see also the destructor
+  // comment in "is_trivially_destructible = true" specialization below.
+  ~OptionalStorageBase() {
+    if (is_populated_)
+      value_.~T();
+  }
+
+  template <class... Args>
+  void Init(Args&&... args) {
+    PERFETTO_DCHECK(!is_populated_);
+    ::new (&value_) T(std::forward<Args>(args)...);
+    is_populated_ = true;
+  }
+
+  bool is_populated_ = false;
+  union {
+    // |empty_| exists so that the union will always be initialized, even when
+    // it doesn't contain a value. Union members must be initialized for the
+    // constructor to be 'constexpr'.
+    char empty_;
+    T value_;
+  };
+};
+
+template <typename T>
+struct OptionalStorageBase<T, true /* trivially destructible */> {
+  // Initializing |empty_| here instead of using default member initializing
+  // to avoid errors in g++ 4.8.
+  constexpr OptionalStorageBase() : empty_('\0') {}
+
+  template <class... Args>
+  constexpr explicit OptionalStorageBase(in_place_t, Args&&... args)
+      : is_populated_(true), value_(std::forward<Args>(args)...) {}
+
+  // When T is trivially destructible (i.e. its destructor does nothing) there
+  // is no need to call it. Implicitly defined destructor is trivial, because
+  // both members (bool and union containing only variants which are trivially
+  // destructible) are trivially destructible.
+  // Explicitly-defaulted destructor is also trivial, but do not use it here,
+  // because it hides the implicit move constructor. It is needed to implement
+  // constexpr move constructor in OptionalStorage iff T is trivially move
+  // constructible. Note that, if T is trivially move constructible, the move
+  // constructor of OptionalStorageBase<T> is also implicitly defined and it is
+  // trivially move constructor. If T is not trivially move constructible,
+  // "not declaring move constructor without destructor declaration" here means
+  // "delete move constructor", which works because any move constructor of
+  // OptionalStorage will not refer to it in that case.
+
+  template <class... Args>
+  void Init(Args&&... args) {
+    PERFETTO_DCHECK(!is_populated_);
+    ::new (&value_) T(std::forward<Args>(args)...);
+    is_populated_ = true;
+  }
+
+  bool is_populated_ = false;
+  union {
+    // |empty_| exists so that the union will always be initialized, even when
+    // it doesn't contain a value. Union members must be initialized for the
+    // constructor to be 'constexpr'.
+    char empty_;
+    T value_;
+  };
+};
+
+// Implement conditional constexpr copy and move constructors. These are
+// constexpr if is_trivially_{copy,move}_constructible<T>::value is true
+// respectively. If each is true, the corresponding constructor is defined as
+// "= default;", which generates a constexpr constructor (In this case,
+// the condition of constexpr-ness is satisfied because the base class also has
+// compiler generated constexpr {copy,move} constructors). Note that
+// placement-new is prohibited in constexpr.
+template <typename T, bool = std::is_trivially_copy_constructible<T>::value>
+struct OptionalStorage : OptionalStorageBase<T> {
+  // This is no trivially {copy,move} constructible case. Other cases are
+  // defined below as specializations.
+
+  // Accessing the members of template base class requires explicit
+  // declaration.
+  using OptionalStorageBase<T>::is_populated_;
+  using OptionalStorageBase<T>::value_;
+  using OptionalStorageBase<T>::Init;
+
+  // Inherit constructors (specifically, the in_place constructor).
+  using OptionalStorageBase<T>::OptionalStorageBase;
+
+  // User defined constructor deletes the default constructor.
+  // Define it explicitly.
+  OptionalStorage() = default;
+
+  OptionalStorage(const OptionalStorage& other) : OptionalStorageBase<T>() {
+    if (other.is_populated_)
+      Init(other.value_);
+  }
+
+  OptionalStorage(OptionalStorage&& other) noexcept(
+      std::is_nothrow_move_constructible<T>::value) {
+    if (other.is_populated_)
+      Init(std::move(other.value_));
+  }
+};
+
+template <typename T>
+struct OptionalStorage<T, true /* trivially copy constructible */>
+    : OptionalStorageBase<T> {
+  using OptionalStorageBase<T>::is_populated_;
+  using OptionalStorageBase<T>::value_;
+  using OptionalStorageBase<T>::Init;
+  using OptionalStorageBase<T>::OptionalStorageBase;
+
+  OptionalStorage() = default;
+  OptionalStorage(const OptionalStorage& other) = default;
+
+  OptionalStorage(OptionalStorage&& other) noexcept(
+      std::is_nothrow_move_constructible<T>::value) {
+    if (other.is_populated_)
+      Init(std::move(other.value_));
+  }
+};
+
+// Base class to support conditionally usable copy-/move- constructors
+// and assign operators.
+template <typename T>
+class OptionalBase {
+  // This class provides implementation rather than public API, so everything
+  // should be hidden. Often we use composition, but we cannot in this case
+  // because of C++ language restriction.
+ protected:
+  constexpr OptionalBase() = default;
+  constexpr OptionalBase(const OptionalBase& other) = default;
+  constexpr OptionalBase(OptionalBase&& other) = default;
+
+  template <class... Args>
+  constexpr explicit OptionalBase(in_place_t, Args&&... args)
+      : storage_(in_place, std::forward<Args>(args)...) {}
+
+  // Implementation of converting constructors.
+  template <typename U>
+  explicit OptionalBase(const OptionalBase<U>& other) {
+    if (other.storage_.is_populated_)
+      storage_.Init(other.storage_.value_);
+  }
+
+  template <typename U>
+  explicit OptionalBase(OptionalBase<U>&& other) {
+    if (other.storage_.is_populated_)
+      storage_.Init(std::move(other.storage_.value_));
+  }
+
+  ~OptionalBase() = default;
+
+  OptionalBase& operator=(const OptionalBase& other) {
+    CopyAssign(other);
+    return *this;
+  }
+
+  OptionalBase& operator=(OptionalBase&& other) noexcept(
+      std::is_nothrow_move_assignable<T>::value&&
+          std::is_nothrow_move_constructible<T>::value) {
+    MoveAssign(std::move(other));
+    return *this;
+  }
+
+  template <typename U>
+  void CopyAssign(const OptionalBase<U>& other) {
+    if (other.storage_.is_populated_)
+      InitOrAssign(other.storage_.value_);
+    else
+      FreeIfNeeded();
+  }
+
+  template <typename U>
+  void MoveAssign(OptionalBase<U>&& other) {
+    if (other.storage_.is_populated_)
+      InitOrAssign(std::move(other.storage_.value_));
+    else
+      FreeIfNeeded();
+  }
+
+  template <typename U>
+  void InitOrAssign(U&& value) {
+    if (storage_.is_populated_)
+      storage_.value_ = std::forward<U>(value);
+    else
+      storage_.Init(std::forward<U>(value));
+  }
+
+  void FreeIfNeeded() {
+    if (!storage_.is_populated_)
+      return;
+    storage_.value_.~T();
+    storage_.is_populated_ = false;
+  }
+
+  // For implementing conversion, allow access to other typed OptionalBase
+  // class.
+  template <typename U>
+  friend class OptionalBase;
+
+  OptionalStorage<T> storage_;
+};
+
+// The following {Copy,Move}{Constructible,Assignable} structs are helpers to
+// implement constructor/assign-operator overloading. Specifically, if T is
+// is not movable but copyable, Optional<T>'s move constructor should not
+// participate in overload resolution. This inheritance trick implements that.
+template <bool is_copy_constructible>
+struct CopyConstructible {};
+
+template <>
+struct CopyConstructible<false> {
+  constexpr CopyConstructible() = default;
+  constexpr CopyConstructible(const CopyConstructible&) = delete;
+  constexpr CopyConstructible(CopyConstructible&&) = default;
+  CopyConstructible& operator=(const CopyConstructible&) = default;
+  CopyConstructible& operator=(CopyConstructible&&) = default;
+};
+
+template <bool is_move_constructible>
+struct MoveConstructible {};
+
+template <>
+struct MoveConstructible<false> {
+  constexpr MoveConstructible() = default;
+  constexpr MoveConstructible(const MoveConstructible&) = default;
+  constexpr MoveConstructible(MoveConstructible&&) = delete;
+  MoveConstructible& operator=(const MoveConstructible&) = default;
+  MoveConstructible& operator=(MoveConstructible&&) = default;
+};
+
+template <bool is_copy_assignable>
+struct CopyAssignable {};
+
+template <>
+struct CopyAssignable<false> {
+  constexpr CopyAssignable() = default;
+  constexpr CopyAssignable(const CopyAssignable&) = default;
+  constexpr CopyAssignable(CopyAssignable&&) = default;
+  CopyAssignable& operator=(const CopyAssignable&) = delete;
+  CopyAssignable& operator=(CopyAssignable&&) = default;
+};
+
+template <bool is_move_assignable>
+struct MoveAssignable {};
+
+template <>
+struct MoveAssignable<false> {
+  constexpr MoveAssignable() = default;
+  constexpr MoveAssignable(const MoveAssignable&) = default;
+  constexpr MoveAssignable(MoveAssignable&&) = default;
+  MoveAssignable& operator=(const MoveAssignable&) = default;
+  MoveAssignable& operator=(MoveAssignable&&) = delete;
+};
+
+// Helper to conditionally enable converting constructors and assign operators.
+template <typename T, typename U>
+struct IsConvertibleFromOptional
+    : std::integral_constant<
+          bool,
+          std::is_constructible<T, Optional<U>&>::value ||
+              std::is_constructible<T, const Optional<U>&>::value ||
+              std::is_constructible<T, Optional<U>&&>::value ||
+              std::is_constructible<T, const Optional<U>&&>::value ||
+              std::is_convertible<Optional<U>&, T>::value ||
+              std::is_convertible<const Optional<U>&, T>::value ||
+              std::is_convertible<Optional<U>&&, T>::value ||
+              std::is_convertible<const Optional<U>&&, T>::value> {};
+
+template <typename T, typename U>
+struct IsAssignableFromOptional
+    : std::integral_constant<
+          bool,
+          IsConvertibleFromOptional<T, U>::value ||
+              std::is_assignable<T&, Optional<U>&>::value ||
+              std::is_assignable<T&, const Optional<U>&>::value ||
+              std::is_assignable<T&, Optional<U>&&>::value ||
+              std::is_assignable<T&, const Optional<U>&&>::value> {};
+
+// Forward compatibility for C++17.
+// Introduce one more deeper nested namespace to avoid leaking using std::swap.
+namespace swappable_impl {
+using std::swap;
+
+struct IsSwappableImpl {
+  // Tests if swap can be called. Check<T&>(0) returns true_type iff swap is
+  // available for T. Otherwise, Check's overload resolution falls back to
+  // Check(...) declared below thanks to SFINAE, so returns false_type.
+  template <typename T>
+  static auto Check(int)
+      -> decltype(swap(std::declval<T>(), std::declval<T>()), std::true_type());
+
+  template <typename T>
+  static std::false_type Check(...);
+};
+}  // namespace swappable_impl
+
+template <typename T>
+struct IsSwappable : decltype(swappable_impl::IsSwappableImpl::Check<T&>(0)) {};
+
+// Forward compatibility for C++20.
+template <typename T>
+using RemoveCvRefT =
+    typename std::remove_cv<typename std::remove_reference<T>::type>::type;
+
+}  // namespace internal
+
+// On Windows, by default, empty-base class optimization does not work,
+// which means even if the base class is empty struct, it still consumes one
+// byte for its body. __declspec(empty_bases) enables the optimization.
+// cf)
+// https://blogs.msdn.microsoft.com/vcblog/2016/03/30/optimizing-the-layout-of-empty-base-classes-in-vs2015-update-2-3/
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) && \
+    !PERFETTO_BUILDFLAG(PERFETTO_COMPILER_GCC)
+#define OPTIONAL_DECLSPEC_EMPTY_BASES __declspec(empty_bases)
+#else
+#define OPTIONAL_DECLSPEC_EMPTY_BASES
+#endif
+
+// base::Optional is a Chromium version of the C++17 optional class:
+// std::optional documentation:
+// http://en.cppreference.com/w/cpp/utility/optional
+// Chromium documentation:
+// https://chromium.googlesource.com/chromium/src/+/master/docs/optional.md
+//
+// These are the differences between the specification and the implementation:
+// - Constructors do not use 'constexpr' as it is a C++14 extension.
+// - 'constexpr' might be missing in some places for reasons specified locally.
+// - No exceptions are thrown, because they are banned from Chromium.
+//   Marked noexcept for only move constructor and move assign operators.
+// - All the non-members are in the 'base' namespace instead of 'std'.
+//
+// Note that T cannot have a constructor T(Optional<T>) etc. Optional<T>
+// PERFETTO_CHECKs T's constructor (specifically via IsConvertibleFromOptional),
+// and in the PERFETTO_CHECK whether T can be constructible from Optional<T>,
+// which is recursive so it does not work. As of Feb 2018, std::optional C++17
+// implementation in both clang and gcc has same limitation. MSVC SFINAE looks
+// to have different behavior, but anyway it reports an error, too.
+//
+// This file is a modified version of optional.h from Chromium at revision
+// 5e71bd454e60511c1293c0c686544aaa76094424. The changes remove C++14/C++17
+// specific code and replace with C++11 counterparts.
+template <typename T>
+class OPTIONAL_DECLSPEC_EMPTY_BASES Optional
+    : public internal::OptionalBase<T>,
+      public internal::CopyConstructible<std::is_copy_constructible<T>::value>,
+      public internal::MoveConstructible<std::is_move_constructible<T>::value>,
+      public internal::CopyAssignable<std::is_copy_constructible<T>::value &&
+                                      std::is_copy_assignable<T>::value>,
+      public internal::MoveAssignable<std::is_move_constructible<T>::value &&
+                                      std::is_move_assignable<T>::value> {
+ public:
+#undef OPTIONAL_DECLSPEC_EMPTY_BASES
+  using value_type = T;
+
+  // Defer default/copy/move constructor implementation to OptionalBase.
+  constexpr Optional() = default;
+  constexpr Optional(const Optional& other) = default;
+  constexpr Optional(Optional&& other) noexcept(
+      std::is_nothrow_move_constructible<T>::value) = default;
+
+  constexpr Optional(nullopt_t) {}  // NOLINT(runtime/explicit)
+
+  // Converting copy constructor. "explicit" only if
+  // std::is_convertible<const U&, T>::value is false. It is implemented by
+  // declaring two almost same constructors, but that condition in enable_if_t
+  // is different, so that either one is chosen, thanks to SFINAE.
+  template <typename U,
+            typename std::enable_if<
+                std::is_constructible<T, const U&>::value &&
+                    !internal::IsConvertibleFromOptional<T, U>::value &&
+                    std::is_convertible<const U&, T>::value,
+                bool>::type = false>
+  Optional(const Optional<U>& other) : internal::OptionalBase<T>(other) {}
+
+  template <typename U,
+            typename std::enable_if<
+                std::is_constructible<T, const U&>::value &&
+                    !internal::IsConvertibleFromOptional<T, U>::value &&
+                    !std::is_convertible<const U&, T>::value,
+                bool>::type = false>
+  explicit Optional(const Optional<U>& other)
+      : internal::OptionalBase<T>(other) {}
+
+  // Converting move constructor. Similar to converting copy constructor,
+  // declaring two (explicit and non-explicit) constructors.
+  template <typename U,
+            typename std::enable_if<
+                std::is_constructible<T, U&&>::value &&
+                    !internal::IsConvertibleFromOptional<T, U>::value &&
+                    std::is_convertible<U&&, T>::value,
+                bool>::type = false>
+  Optional(Optional<U>&& other) : internal::OptionalBase<T>(std::move(other)) {}
+
+  template <typename U,
+            typename std::enable_if<
+                std::is_constructible<T, U&&>::value &&
+                    !internal::IsConvertibleFromOptional<T, U>::value &&
+                    !std::is_convertible<U&&, T>::value,
+                bool>::type = false>
+  explicit Optional(Optional<U>&& other)
+      : internal::OptionalBase<T>(std::move(other)) {}
+
+  template <class... Args>
+  constexpr explicit Optional(in_place_t, Args&&... args)
+      : internal::OptionalBase<T>(in_place, std::forward<Args>(args)...) {}
+
+  template <class U,
+            class... Args,
+            class = typename std::enable_if<
+                std::is_constructible<value_type,
+                                      std::initializer_list<U>&,
+                                      Args...>::value>::type>
+  constexpr explicit Optional(in_place_t,
+                              std::initializer_list<U> il,
+                              Args&&... args)
+      : internal::OptionalBase<T>(in_place, il, std::forward<Args>(args)...) {}
+
+  // Forward value constructor. Similar to converting constructors,
+  // conditionally explicit.
+  template <
+      typename U = value_type,
+      typename std::enable_if<
+          std::is_constructible<T, U&&>::value &&
+              !std::is_same<internal::RemoveCvRefT<U>, in_place_t>::value &&
+              !std::is_same<internal::RemoveCvRefT<U>, Optional<T>>::value &&
+              std::is_convertible<U&&, T>::value,
+          bool>::type = false>
+  constexpr Optional(U&& value)
+      : internal::OptionalBase<T>(in_place, std::forward<U>(value)) {}
+
+  template <
+      typename U = value_type,
+      typename std::enable_if<
+          std::is_constructible<T, U&&>::value &&
+              !std::is_same<internal::RemoveCvRefT<U>, in_place_t>::value &&
+              !std::is_same<internal::RemoveCvRefT<U>, Optional<T>>::value &&
+              !std::is_convertible<U&&, T>::value,
+          bool>::type = false>
+  constexpr explicit Optional(U&& value)
+      : internal::OptionalBase<T>(in_place, std::forward<U>(value)) {}
+
+  ~Optional() = default;
+
+  // Defer copy-/move- assign operator implementation to OptionalBase.
+  Optional& operator=(const Optional& other) = default;
+  Optional& operator=(Optional&& other) noexcept(
+      std::is_nothrow_move_assignable<T>::value&&
+          std::is_nothrow_move_constructible<T>::value) = default;
+
+  Optional& operator=(nullopt_t) {
+    FreeIfNeeded();
+    return *this;
+  }
+
+  // Perfect-forwarded assignment.
+  template <typename U>
+  typename std::enable_if<
+      !std::is_same<internal::RemoveCvRefT<U>, Optional<T>>::value &&
+          std::is_constructible<T, U>::value &&
+          std::is_assignable<T&, U>::value &&
+          (!std::is_scalar<T>::value ||
+           !std::is_same<typename std::decay<U>::type, T>::value),
+      Optional&>::type
+  operator=(U&& value) {
+    InitOrAssign(std::forward<U>(value));
+    return *this;
+  }
+
+  // Copy assign the state of other.
+  template <typename U>
+  typename std::enable_if<!internal::IsAssignableFromOptional<T, U>::value &&
+                              std::is_constructible<T, const U&>::value &&
+                              std::is_assignable<T&, const U&>::value,
+                          Optional&>::type
+  operator=(const Optional<U>& other) {
+    CopyAssign(other);
+    return *this;
+  }
+
+  // Move assign the state of other.
+  template <typename U>
+  typename std::enable_if<!internal::IsAssignableFromOptional<T, U>::value &&
+                              std::is_constructible<T, U>::value &&
+                              std::is_assignable<T&, U>::value,
+                          Optional&>::type
+  operator=(Optional<U>&& other) {
+    MoveAssign(std::move(other));
+    return *this;
+  }
+
+  const T* operator->() const {
+    PERFETTO_DCHECK(storage_.is_populated_);
+    return &storage_.value_;
+  }
+
+  T* operator->() {
+    PERFETTO_DCHECK(storage_.is_populated_);
+    return &storage_.value_;
+  }
+
+  const T& operator*() const& {
+    PERFETTO_DCHECK(storage_.is_populated_);
+    return storage_.value_;
+  }
+
+  T& operator*() & {
+    PERFETTO_DCHECK(storage_.is_populated_);
+    return storage_.value_;
+  }
+
+  const T&& operator*() const&& {
+    PERFETTO_DCHECK(storage_.is_populated_);
+    return std::move(storage_.value_);
+  }
+
+  T&& operator*() && {
+    PERFETTO_DCHECK(storage_.is_populated_);
+    return std::move(storage_.value_);
+  }
+
+  constexpr explicit operator bool() const { return storage_.is_populated_; }
+
+  constexpr bool has_value() const { return storage_.is_populated_; }
+
+  T& value() & {
+    PERFETTO_CHECK(storage_.is_populated_);
+    return storage_.value_;
+  }
+
+  const T& value() const& {
+    PERFETTO_CHECK(storage_.is_populated_);
+    return storage_.value_;
+  }
+
+  T&& value() && {
+    PERFETTO_CHECK(storage_.is_populated_);
+    return std::move(storage_.value_);
+  }
+
+  const T&& value() const&& {
+    PERFETTO_CHECK(storage_.is_populated_);
+    return std::move(storage_.value_);
+  }
+
+  template <class U>
+  constexpr T value_or(U&& default_value) const& {
+    static_assert(std::is_convertible<U, T>::value,
+                  "U must be convertible to T");
+    return storage_.is_populated_
+               ? storage_.value_
+               : static_cast<T>(std::forward<U>(default_value));
+  }
+
+  template <class U>
+  T value_or(U&& default_value) && {
+    static_assert(std::is_convertible<U, T>::value,
+                  "U must be convertible to T");
+    return storage_.is_populated_
+               ? std::move(storage_.value_)
+               : static_cast<T>(std::forward<U>(default_value));
+  }
+
+  void swap(Optional& other) {
+    if (!storage_.is_populated_ && !other.storage_.is_populated_)
+      return;
+
+    if (storage_.is_populated_ != other.storage_.is_populated_) {
+      if (storage_.is_populated_) {
+        other.storage_.Init(std::move(storage_.value_));
+        FreeIfNeeded();
+      } else {
+        storage_.Init(std::move(other.storage_.value_));
+        other.FreeIfNeeded();
+      }
+      return;
+    }
+
+    PERFETTO_DCHECK(storage_.is_populated_ && other.storage_.is_populated_);
+    using std::swap;
+    swap(**this, *other);
+  }
+
+  void reset() { FreeIfNeeded(); }
+
+  template <class... Args>
+  T& emplace(Args&&... args) {
+    FreeIfNeeded();
+    storage_.Init(std::forward<Args>(args)...);
+    return storage_.value_;
+  }
+
+  template <class U, class... Args>
+  typename std::enable_if<
+      std::is_constructible<T, std::initializer_list<U>&, Args&&...>::value,
+      T&>::type
+  emplace(std::initializer_list<U> il, Args&&... args) {
+    FreeIfNeeded();
+    storage_.Init(il, std::forward<Args>(args)...);
+    return storage_.value_;
+  }
+
+ private:
+  // Accessing template base class's protected member needs explicit
+  // declaration to do so.
+  using internal::OptionalBase<T>::CopyAssign;
+  using internal::OptionalBase<T>::FreeIfNeeded;
+  using internal::OptionalBase<T>::InitOrAssign;
+  using internal::OptionalBase<T>::MoveAssign;
+  using internal::OptionalBase<T>::storage_;
+};
+
+// Here after defines comparation operators. The definition follows
+// http://en.cppreference.com/w/cpp/utility/optional/operator_cmp
+// while bool() casting is replaced by has_value() to meet the chromium
+// style guide.
+template <class T, class U>
+bool operator==(const Optional<T>& lhs, const Optional<U>& rhs) {
+  if (lhs.has_value() != rhs.has_value())
+    return false;
+  if (!lhs.has_value())
+    return true;
+  return *lhs == *rhs;
+}
+
+template <class T, class U>
+bool operator!=(const Optional<T>& lhs, const Optional<U>& rhs) {
+  if (lhs.has_value() != rhs.has_value())
+    return true;
+  if (!lhs.has_value())
+    return false;
+  return *lhs != *rhs;
+}
+
+template <class T, class U>
+bool operator<(const Optional<T>& lhs, const Optional<U>& rhs) {
+  if (!rhs.has_value())
+    return false;
+  if (!lhs.has_value())
+    return true;
+  return *lhs < *rhs;
+}
+
+template <class T, class U>
+bool operator<=(const Optional<T>& lhs, const Optional<U>& rhs) {
+  if (!lhs.has_value())
+    return true;
+  if (!rhs.has_value())
+    return false;
+  return *lhs <= *rhs;
+}
+
+template <class T, class U>
+bool operator>(const Optional<T>& lhs, const Optional<U>& rhs) {
+  if (!lhs.has_value())
+    return false;
+  if (!rhs.has_value())
+    return true;
+  return *lhs > *rhs;
+}
+
+template <class T, class U>
+bool operator>=(const Optional<T>& lhs, const Optional<U>& rhs) {
+  if (!rhs.has_value())
+    return true;
+  if (!lhs.has_value())
+    return false;
+  return *lhs >= *rhs;
+}
+
+template <class T>
+constexpr bool operator==(const Optional<T>& opt, nullopt_t) {
+  return !opt;
+}
+
+template <class T>
+constexpr bool operator==(nullopt_t, const Optional<T>& opt) {
+  return !opt;
+}
+
+template <class T>
+constexpr bool operator!=(const Optional<T>& opt, nullopt_t) {
+  return opt.has_value();
+}
+
+template <class T>
+constexpr bool operator!=(nullopt_t, const Optional<T>& opt) {
+  return opt.has_value();
+}
+
+template <class T>
+constexpr bool operator<(const Optional<T>&, nullopt_t) {
+  return false;
+}
+
+template <class T>
+constexpr bool operator<(nullopt_t, const Optional<T>& opt) {
+  return opt.has_value();
+}
+
+template <class T>
+constexpr bool operator<=(const Optional<T>& opt, nullopt_t) {
+  return !opt;
+}
+
+template <class T>
+constexpr bool operator<=(nullopt_t, const Optional<T>&) {
+  return true;
+}
+
+template <class T>
+constexpr bool operator>(const Optional<T>& opt, nullopt_t) {
+  return opt.has_value();
+}
+
+template <class T>
+constexpr bool operator>(nullopt_t, const Optional<T>&) {
+  return false;
+}
+
+template <class T>
+constexpr bool operator>=(const Optional<T>&, nullopt_t) {
+  return true;
+}
+
+template <class T>
+constexpr bool operator>=(nullopt_t, const Optional<T>& opt) {
+  return !opt;
+}
+
+template <class T, class U>
+constexpr bool operator==(const Optional<T>& opt, const U& value) {
+  return opt.has_value() ? *opt == value : false;
+}
+
+template <class T, class U>
+constexpr bool operator==(const U& value, const Optional<T>& opt) {
+  return opt.has_value() ? value == *opt : false;
+}
+
+template <class T, class U>
+constexpr bool operator!=(const Optional<T>& opt, const U& value) {
+  return opt.has_value() ? *opt != value : true;
+}
+
+template <class T, class U>
+constexpr bool operator!=(const U& value, const Optional<T>& opt) {
+  return opt.has_value() ? value != *opt : true;
+}
+
+template <class T, class U>
+constexpr bool operator<(const Optional<T>& opt, const U& value) {
+  return opt.has_value() ? *opt < value : true;
+}
+
+template <class T, class U>
+constexpr bool operator<(const U& value, const Optional<T>& opt) {
+  return opt.has_value() ? value < *opt : false;
+}
+
+template <class T, class U>
+constexpr bool operator<=(const Optional<T>& opt, const U& value) {
+  return opt.has_value() ? *opt <= value : true;
+}
+
+template <class T, class U>
+constexpr bool operator<=(const U& value, const Optional<T>& opt) {
+  return opt.has_value() ? value <= *opt : false;
+}
+
+template <class T, class U>
+constexpr bool operator>(const Optional<T>& opt, const U& value) {
+  return opt.has_value() ? *opt > value : false;
+}
+
+template <class T, class U>
+constexpr bool operator>(const U& value, const Optional<T>& opt) {
+  return opt.has_value() ? value > *opt : true;
+}
+
+template <class T, class U>
+constexpr bool operator>=(const Optional<T>& opt, const U& value) {
+  return opt.has_value() ? *opt >= value : false;
+}
+
+template <class T, class U>
+constexpr bool operator>=(const U& value, const Optional<T>& opt) {
+  return opt.has_value() ? value >= *opt : true;
+}
+
+template <class T>
+constexpr Optional<typename std::decay<T>::type> make_optional(T&& value) {
+  return Optional<typename std::decay<T>::type>(std::forward<T>(value));
+}
+
+template <class T, class... Args>
+constexpr Optional<T> make_optional(Args&&... args) {
+  return Optional<T>(in_place, std::forward<Args>(args)...);
+}
+
+template <class T, class U, class... Args>
+constexpr Optional<T> make_optional(std::initializer_list<U> il,
+                                    Args&&... args) {
+  return Optional<T>(in_place, il, std::forward<Args>(args)...);
+}
+
+// Partial specialization for a function template is not allowed. Also, it is
+// not allowed to add overload function to std namespace, while it is allowed
+// to specialize the template in std. Thus, swap() (kind of) overloading is
+// defined in base namespace, instead.
+template <class T>
+typename std::enable_if<std::is_move_constructible<T>::value &&
+                        internal::IsSwappable<T>::value>::type
+swap(Optional<T>& lhs, Optional<T>& rhs) {
+  lhs.swap(rhs);
+}
+
+}  // namespace base
+}  // namespace perfetto
+
+template <class T>
+struct std::hash<perfetto::base::Optional<T>> {
+  size_t operator()(const perfetto::base::Optional<T>& opt) const {
+    return opt == perfetto::base::nullopt ? 0 : std::hash<T>()(*opt);
+  }
+};
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_OPTIONAL_H_
+// gen_amalgamated begin header: include/perfetto/ext/base/string_view.h
+// gen_amalgamated begin header: include/perfetto/ext/base/hash.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_HASH_H_
+#define INCLUDE_PERFETTO_EXT_BASE_HASH_H_
+
+#include <stddef.h>
+#include <stdint.h>
+#include <type_traits>
+
+namespace perfetto {
+namespace base {
+
+// A helper class which computes a 64-bit hash of the input data.
+// The algorithm used is FNV-1a as it is fast and easy to implement and has
+// relatively few collisions.
+// WARNING: This hash function should not be used for any cryptographic purpose.
+class Hash {
+ public:
+  // Creates an empty hash object
+  Hash() {}
+
+  // Hashes a numeric value.
+  template <
+      typename T,
+      typename std::enable_if<std::is_arithmetic<T>::value, bool>::type = true>
+  void Update(T data) {
+    Update(reinterpret_cast<const char*>(&data), sizeof(data));
+  }
+
+  // Hashes a byte array.
+  void Update(const char* data, size_t size) {
+    for (size_t i = 0; i < size; i++) {
+      result_ ^= static_cast<uint8_t>(data[i]);
+      result_ *= kFnv1a64Prime;
+    }
+  }
+
+  uint64_t digest() { return result_; }
+
+ private:
+  static constexpr uint64_t kFnv1a64OffsetBasis = 0xcbf29ce484222325;
+  static constexpr uint64_t kFnv1a64Prime = 0x100000001b3;
+
+  uint64_t result_ = kFnv1a64OffsetBasis;
+};
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_HASH_H_
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_STRING_VIEW_H_
+#define INCLUDE_PERFETTO_EXT_BASE_STRING_VIEW_H_
+
+#include <string.h>
+
+#include <algorithm>
+#include <string>
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/hash.h"
+
+namespace perfetto {
+namespace base {
+
+// A string-like object that refers to a non-owned piece of memory.
+// Strings are internally NOT null terminated.
+class StringView {
+ public:
+  static constexpr size_t npos = static_cast<size_t>(-1);
+
+  StringView() : data_(nullptr), size_(0) {}
+  StringView(const StringView&) = default;
+  StringView& operator=(const StringView&) = default;
+  StringView(const char* data, size_t size) : data_(data), size_(size) {
+    PERFETTO_DCHECK(size == 0 || data != nullptr);
+  }
+
+  // Allow implicit conversion from any class that has a |data| and |size| field
+  // and has the kConvertibleToStringView trait (e.g., protozero::ConstChars).
+  template <typename T, typename = std::enable_if<T::kConvertibleToStringView>>
+  StringView(const T& x) : StringView(x.data, x.size) {
+    PERFETTO_DCHECK(x.size == 0 || x.data != nullptr);
+  }
+
+  // Creates a StringView from a null-terminated C string.
+  // Deliberately not "explicit".
+  StringView(const char* cstr) : data_(cstr), size_(strlen(cstr)) {
+    PERFETTO_DCHECK(cstr != nullptr);
+  }
+
+  // This instead has to be explicit, as creating a StringView out of a
+  // std::string can be subtle.
+  explicit StringView(const std::string& str)
+      : data_(str.data()), size_(str.size()) {}
+
+  bool empty() const { return size_ == 0; }
+  size_t size() const { return size_; }
+  const char* data() const { return data_; }
+  const char* begin() const { return data_; }
+  const char* end() const { return data_ + size_; }
+
+  char at(size_t pos) const {
+    PERFETTO_DCHECK(pos < size_);
+    return data_[pos];
+  }
+
+  size_t find(char c, size_t start_pos = 0) const {
+    for (size_t i = start_pos; i < size_; ++i) {
+      if (data_[i] == c)
+        return i;
+    }
+    return npos;
+  }
+
+  size_t find(const StringView& str, size_t start_pos = 0) const {
+    if (start_pos > size())
+      return npos;
+    auto it = std::search(begin() + start_pos, end(), str.begin(), str.end());
+    size_t pos = static_cast<size_t>(it - begin());
+    return pos + str.size() <= size() ? pos : npos;
+  }
+
+  size_t find(const char* str, size_t start_pos = 0) const {
+    return find(StringView(str), start_pos);
+  }
+
+  size_t rfind(char c) const {
+    for (size_t i = size_; i > 0; --i) {
+      if (data_[i - 1] == c)
+        return i - 1;
+    }
+    return npos;
+  }
+
+  StringView substr(size_t pos, size_t count = npos) const {
+    if (pos >= size_)
+      return StringView("", 0);
+    size_t rcount = std::min(count, size_ - pos);
+    return StringView(data_ + pos, rcount);
+  }
+
+  bool CaseInsensitiveEq(const StringView& other) {
+    if (size() != other.size())
+      return false;
+    if (size() == 0)
+      return true;
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+    return _strnicmp(data(), other.data(), size()) == 0;
+#else
+    return strncasecmp(data(), other.data(), size()) == 0;
+#endif
+  }
+
+  std::string ToStdString() const {
+    return data_ == nullptr ? "" : std::string(data_, size_);
+  }
+
+  uint64_t Hash() const {
+    base::Hash hasher;
+    hasher.Update(data_, size_);
+    return hasher.digest();
+  }
+
+ private:
+  const char* data_ = nullptr;
+  size_t size_ = 0;
+};
+
+inline bool operator==(const StringView& x, const StringView& y) {
+  if (x.size() != y.size())
+    return false;
+  if (x.size() == 0)
+    return true;
+  return memcmp(x.data(), y.data(), x.size()) == 0;
+}
+
+inline bool operator!=(const StringView& x, const StringView& y) {
+  return !(x == y);
+}
+
+inline bool operator<(const StringView& x, const StringView& y) {
+  auto size = std::min(x.size(), y.size());
+  if (size == 0)
+    return x.size() < y.size();
+  int result = memcmp(x.data(), y.data(), size);
+  return result < 0 || (result == 0 && x.size() < y.size());
+}
+
+inline bool operator>=(const StringView& x, const StringView& y) {
+  return !(x < y);
+}
+
+inline bool operator>(const StringView& x, const StringView& y) {
+  return y < x;
+}
+
+inline bool operator<=(const StringView& x, const StringView& y) {
+  return !(y < x);
+}
+
+}  // namespace base
+}  // namespace perfetto
+
+template <>
+struct std::hash<::perfetto::base::StringView> {
+  size_t operator()(const ::perfetto::base::StringView& sv) const {
+    return static_cast<size_t>(sv.Hash());
+  }
+};
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_STRING_VIEW_H_
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_STRING_UTILS_H_
+#define INCLUDE_PERFETTO_EXT_BASE_STRING_UTILS_H_
+
+#include <string>
+#include <vector>
+
+#include <inttypes.h>
+#include <stdlib.h>
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/optional.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/string_view.h"
+
+namespace perfetto {
+namespace base {
+
+std::string QuoteAndEscapeControlCodes(const std::string& raw);
+
+inline char Lowercase(char c) {
+  return ('A' <= c && c <= 'Z') ? static_cast<char>(c - ('A' - 'a')) : c;
+}
+
+inline char Uppercase(char c) {
+  return ('a' <= c && c <= 'z') ? static_cast<char>(c + ('A' - 'a')) : c;
+}
+
+inline Optional<uint32_t> CStringToUInt32(const char* s, int base = 10) {
+  char* endptr = nullptr;
+  auto value = static_cast<uint32_t>(strtoul(s, &endptr, base));
+  return (*s && !*endptr) ? base::make_optional(value) : base::nullopt;
+}
+
+inline Optional<int32_t> CStringToInt32(const char* s, int base = 10) {
+  char* endptr = nullptr;
+  auto value = static_cast<int32_t>(strtol(s, &endptr, base));
+  return (*s && !*endptr) ? base::make_optional(value) : base::nullopt;
+}
+
+// Note: it saturates to 7fffffffffffffff if parsing a hex number >= 0x8000...
+inline Optional<int64_t> CStringToInt64(const char* s, int base = 10) {
+  char* endptr = nullptr;
+  auto value = static_cast<int64_t>(strtoll(s, &endptr, base));
+  return (*s && !*endptr) ? base::make_optional(value) : base::nullopt;
+}
+
+inline Optional<uint64_t> CStringToUInt64(const char* s, int base = 10) {
+  char* endptr = nullptr;
+  auto value = static_cast<uint64_t>(strtoull(s, &endptr, base));
+  return (*s && !*endptr) ? base::make_optional(value) : base::nullopt;
+}
+
+double StrToD(const char* nptr, char** endptr);
+
+inline Optional<double> CStringToDouble(const char* s) {
+  char* endptr = nullptr;
+  double value = StrToD(s, &endptr);
+  Optional<double> result(base::nullopt);
+  if (*s != '\0' && *endptr == '\0')
+    result = value;
+  return result;
+}
+
+inline Optional<uint32_t> StringToUInt32(const std::string& s, int base = 10) {
+  return CStringToUInt32(s.c_str(), base);
+}
+
+inline Optional<int32_t> StringToInt32(const std::string& s, int base = 10) {
+  return CStringToInt32(s.c_str(), base);
+}
+
+inline Optional<uint64_t> StringToUInt64(const std::string& s, int base = 10) {
+  return CStringToUInt64(s.c_str(), base);
+}
+
+inline Optional<int64_t> StringToInt64(const std::string& s, int base = 10) {
+  return CStringToInt64(s.c_str(), base);
+}
+
+inline Optional<double> StringToDouble(const std::string& s) {
+  return CStringToDouble(s.c_str());
+}
+
+bool StartsWith(const std::string& str, const std::string& prefix);
+bool EndsWith(const std::string& str, const std::string& suffix);
+bool Contains(const std::string& haystack, const std::string& needle);
+bool Contains(const std::string& haystack, char needle);
+size_t Find(const StringView& needle, const StringView& haystack);
+bool CaseInsensitiveEqual(const std::string& first, const std::string& second);
+std::string Join(const std::vector<std::string>& parts,
+                 const std::string& delim);
+std::vector<std::string> SplitString(const std::string& text,
+                                     const std::string& delimiter);
+std::string StripPrefix(const std::string& str, const std::string& prefix);
+std::string StripSuffix(const std::string& str, const std::string& suffix);
+std::string ToLower(const std::string& str);
+std::string ToUpper(const std::string& str);
+std::string StripChars(const std::string& str,
+                       const std::string& chars,
+                       char replacement);
+std::string ToHex(const char* data, size_t size);
+inline std::string ToHex(const std::string& s) {
+  return ToHex(s.c_str(), s.size());
+}
+std::string IntToHexString(uint32_t number);
+std::string Uint64ToHexString(uint64_t number);
+std::string Uint64ToHexStringNoPrefix(uint64_t number);
+std::string ReplaceAll(std::string str,
+                       const std::string& to_replace,
+                       const std::string& replacement);
+std::string TrimLeading(const std::string& str);
+std::string Base64Encode(const void* raw, size_t size);
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_STRING_UTILS_H_
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/string_utils.h"
+
+#include <inttypes.h>
+#include <locale.h>
+#include <string.h>
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+#include <xlocale.h>
+#endif
+
+#include <algorithm>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+
+namespace perfetto {
+namespace base {
+namespace {
+constexpr char kBase64Table[] =
+    "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+    "abcdefghijklmnopqrstuvwxyz0123456789+/";
+}
+
+// Locale-independant as possible version of strtod.
+double StrToD(const char* nptr, char** endptr) {
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) ||   \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+  static auto c_locale = newlocale(LC_ALL, "C", nullptr);
+  return strtod_l(nptr, endptr, c_locale);
+#else
+  return strtod(nptr, endptr);
+#endif
+}
+
+std::string QuoteAndEscapeControlCodes(const std::string& raw) {
+  std::string ret;
+  for (auto it = raw.cbegin(); it != raw.cend(); it++) {
+    switch (*it) {
+      case '\\':
+        ret += "\\\\";
+        break;
+      case '"':
+        ret += "\\\"";
+        break;
+      case '/':
+        ret += "\\/";
+        break;
+      case '\b':
+        ret += "\\b";
+        break;
+      case '\f':
+        ret += "\\f";
+        break;
+      case '\n':
+        ret += "\\n";
+        break;
+      case '\r':
+        ret += "\\r";
+        break;
+      case '\t':
+        ret += "\\t";
+        break;
+      default:
+        ret += *it;
+        break;
+    }
+  }
+  return '"' + ret + '"';
+}
+
+bool StartsWith(const std::string& str, const std::string& prefix) {
+  return str.compare(0, prefix.length(), prefix) == 0;
+}
+
+bool EndsWith(const std::string& str, const std::string& suffix) {
+  if (suffix.size() > str.size())
+    return false;
+  return str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0;
+}
+
+bool Contains(const std::string& haystack, const std::string& needle) {
+  return haystack.find(needle) != std::string::npos;
+}
+
+bool Contains(const std::string& haystack, const char needle) {
+  return haystack.find(needle) != std::string::npos;
+}
+
+size_t Find(const StringView& needle, const StringView& haystack) {
+  if (needle.empty())
+    return 0;
+  if (needle.size() > haystack.size())
+    return std::string::npos;
+  for (size_t i = 0; i < haystack.size() - (needle.size() - 1); ++i) {
+    if (strncmp(haystack.data() + i, needle.data(), needle.size()) == 0)
+      return i;
+  }
+  return std::string::npos;
+}
+
+bool CaseInsensitiveEqual(const std::string& first, const std::string& second) {
+  return first.size() == second.size() &&
+         std::equal(
+             first.begin(), first.end(), second.begin(),
+             [](char a, char b) { return Lowercase(a) == Lowercase(b); });
+}
+
+std::string Join(const std::vector<std::string>& parts,
+                 const std::string& delim) {
+  std::string acc;
+  for (size_t i = 0; i < parts.size(); ++i) {
+    acc += parts[i];
+    if (i + 1 != parts.size()) {
+      acc += delim;
+    }
+  }
+  return acc;
+}
+
+std::vector<std::string> SplitString(const std::string& text,
+                                     const std::string& delimiter) {
+  PERFETTO_CHECK(!delimiter.empty());
+
+  std::vector<std::string> output;
+  size_t start = 0;
+  size_t next;
+  for (;;) {
+    next = std::min(text.find(delimiter, start), text.size());
+    if (next > start)
+      output.emplace_back(&text[start], next - start);
+    start = next + delimiter.size();
+    if (start >= text.size())
+      break;
+  }
+  return output;
+}
+
+std::string StripPrefix(const std::string& str, const std::string& prefix) {
+  return StartsWith(str, prefix) ? str.substr(prefix.size()) : str;
+}
+
+std::string StripSuffix(const std::string& str, const std::string& suffix) {
+  return EndsWith(str, suffix) ? str.substr(0, str.size() - suffix.size())
+                               : str;
+}
+
+std::string ToUpper(const std::string& str) {
+  // Don't use toupper(), it depends on the locale.
+  std::string res(str);
+  auto end = res.end();
+  for (auto c = res.begin(); c != end; ++c)
+    *c = Uppercase(*c);
+  return res;
+}
+
+std::string ToLower(const std::string& str) {
+  // Don't use tolower(), it depends on the locale.
+  std::string res(str);
+  auto end = res.end();
+  for (auto c = res.begin(); c != end; ++c)
+    *c = Lowercase(*c);
+  return res;
+}
+
+std::string ToHex(const char* data, size_t size) {
+  std::string hex(2 * size + 1, 'x');
+  for (size_t i = 0; i < size; ++i) {
+    // snprintf prints 3 characters, the two hex digits and a null byte. As we
+    // write left to right, we keep overwriting the nullbytes, except for the
+    // last call to snprintf.
+    snprintf(&(hex[2 * i]), 3, "%02hhx", data[i]);
+  }
+  // Remove the trailing nullbyte produced by the last snprintf.
+  hex.resize(2 * size);
+  return hex;
+}
+
+std::string IntToHexString(uint32_t number) {
+  size_t max_size = 11;  // Max uint32 is 0xFFFFFFFF + 1 for null byte.
+  std::string buf;
+  buf.resize(max_size);
+  auto final_size = snprintf(&buf[0], max_size, "0x%02x", number);
+  PERFETTO_DCHECK(final_size >= 0);
+  buf.resize(static_cast<size_t>(final_size));  // Cuts off the final null byte.
+  return buf;
+}
+
+std::string Uint64ToHexString(uint64_t number) {
+  return "0x" + Uint64ToHexStringNoPrefix(number);
+}
+
+std::string Uint64ToHexStringNoPrefix(uint64_t number) {
+  size_t max_size = 17;  // Max uint64 is FFFFFFFFFFFFFFFF + 1 for null byte.
+  std::string buf;
+  buf.resize(max_size);
+  auto final_size = snprintf(&buf[0], max_size, "%" PRIx64 "", number);
+  PERFETTO_DCHECK(final_size >= 0);
+  buf.resize(static_cast<size_t>(final_size));  // Cuts off the final null byte.
+  return buf;
+}
+
+std::string StripChars(const std::string& str,
+                       const std::string& chars,
+                       char replacement) {
+  std::string res(str);
+  const char* start = res.c_str();
+  const char* remove = chars.c_str();
+  for (const char* c = strpbrk(start, remove); c; c = strpbrk(c + 1, remove))
+    res[static_cast<uintptr_t>(c - start)] = replacement;
+  return res;
+}
+
+std::string ReplaceAll(std::string str,
+                       const std::string& to_replace,
+                       const std::string& replacement) {
+  PERFETTO_CHECK(!to_replace.empty());
+  size_t pos = 0;
+  while ((pos = str.find(to_replace, pos)) != std::string::npos) {
+    str.replace(pos, to_replace.length(), replacement);
+    pos += replacement.length();
+  }
+  return str;
+}
+
+std::string TrimLeading(const std::string& str) {
+  size_t idx = str.find_first_not_of(' ');
+  return idx == std::string::npos ? str : str.substr(idx);
+}
+
+std::string Base64Encode(const void* raw, size_t size) {
+  // The following three cases are based on the tables in the example
+  // section in https://en.wikipedia.org/wiki/Base64. We process three
+  // input bytes at a time, emitting 4 output bytes at a time.
+  const uint8_t* ptr = static_cast<const uint8_t*>(raw);
+  size_t ii = 0;
+
+  std::string out;
+  out.reserve((size + 2) * 4 / 3);
+
+  // While possible, process three input bytes.
+  for (; ii + 3 <= size; ii += 3) {
+    uint32_t twentyfour_bits =
+        (uint32_t(ptr[ii]) << 16) | (uint32_t(ptr[ii + 1]) << 8) | ptr[ii + 2];
+    out.push_back(kBase64Table[(twentyfour_bits >> 18)]);
+    out.push_back(kBase64Table[(twentyfour_bits >> 12) & 0x3f]);
+    out.push_back(kBase64Table[(twentyfour_bits >> 6) & 0x3f]);
+    out.push_back(kBase64Table[twentyfour_bits & 0x3f]);
+  }
+  if (ii + 2 <= size) {  // Process two input bytes.
+    uint32_t twentyfour_bits =
+        (uint32_t(ptr[ii]) << 16) | (uint32_t(ptr[ii + 1]) << 8);
+    out.push_back(kBase64Table[(twentyfour_bits >> 18)]);
+    out.push_back(kBase64Table[(twentyfour_bits >> 12) & 0x3f]);
+    out.push_back(kBase64Table[(twentyfour_bits >> 6) & 0x3f]);
+    out.push_back('=');  // Emit padding.
+    return out;
+  }
+  if (ii + 1 <= size) {  // Process a single input byte.
+    uint32_t twentyfour_bits = (uint32_t(ptr[ii]) << 16);
+    out.push_back(kBase64Table[(twentyfour_bits >> 18)]);
+    out.push_back(kBase64Table[(twentyfour_bits >> 12) & 0x3f]);
+    out.push_back('=');  // Emit padding.
+    out.push_back('=');  // Emit padding.
+  }
+  return out;
+}
+
+}  // namespace base
+}  // namespace perfetto
+// gen_amalgamated begin source: src/base/string_view.cc
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/string_view.h"
+
+namespace perfetto {
+namespace base {
+
+// static
+constexpr size_t StringView::npos;
+
+}  // namespace base
+}  // namespace perfetto
+// gen_amalgamated begin source: src/base/temp_file.cc
+// gen_amalgamated begin header: include/perfetto/ext/base/temp_file.h
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_TEMP_FILE_H_
+#define INCLUDE_PERFETTO_EXT_BASE_TEMP_FILE_H_
+
+#include <string>
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/scoped_file.h"
+
+namespace perfetto {
+namespace base {
+
+std::string GetSysTempDir();
+
+class TempFile {
+ public:
+  static TempFile CreateUnlinked();
+  static TempFile Create();
+
+  TempFile(TempFile&&) noexcept;
+  TempFile& operator=(TempFile&&);
+  ~TempFile();
+
+  const std::string& path() const { return path_; }
+  int fd() const { return *fd_; }
+  int operator*() const { return *fd_; }
+
+  // Unlinks the file from the filesystem but keeps the fd() open.
+  // It is safe to call this multiple times.
+  void Unlink();
+
+  // Releases the underlying file descriptor. Will unlink the file from the
+  // filesystem if it was created via CreateUnlinked().
+  ScopedFile ReleaseFD();
+
+ private:
+  TempFile();
+  TempFile(const TempFile&) = delete;
+  TempFile& operator=(const TempFile&) = delete;
+
+  ScopedFile fd_;
+  std::string path_;
+};
+
+class TempDir {
+ public:
+  static TempDir Create();
+
+  TempDir(TempDir&&) noexcept;
+  TempDir& operator=(TempDir&&);
+  ~TempDir();
+
+  const std::string& path() const { return path_; }
+
+ private:
+  TempDir();
+  TempDir(const TempDir&) = delete;
+  TempDir& operator=(const TempDir&) = delete;
+
+  std::string path_;
+};
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_TEMP_FILE_H_
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/temp_file.h"
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+#include <Windows.h>
+#include <direct.h>
+#include <fileapi.h>
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/file_utils.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/string_utils.h"
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+namespace {
+std::string GetTempName() {
+  char name[] = "perfetto-XXXXXX";
+  PERFETTO_CHECK(_mktemp_s(name, sizeof(name)) == 0);
+  return name;
+}
+}  // namespace
+#endif
+
+namespace perfetto {
+namespace base {
+
+std::string GetSysTempDir() {
+  const char* tmpdir = nullptr;
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  if ((tmpdir = getenv("TMP")))
+    return tmpdir;
+  if ((tmpdir = getenv("TEMP")))
+    return tmpdir;
+  return "C:\\TEMP";
+#else
+  if ((tmpdir = getenv("TMPDIR")))
+    return base::StripSuffix(tmpdir, "/");
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+  return "/data/local/tmp";
+#else
+  return "/tmp";
+#endif  // !OS_ANDROID
+#endif  // !OS_WIN
+}
+
+// static
+TempFile TempFile::Create() {
+  TempFile temp_file;
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  temp_file.path_ = GetSysTempDir() + "\\" + GetTempName();
+  // Several tests want to read-back the temp file while still open. On Windows,
+  // that requires FILE_SHARE_READ. FILE_SHARE_READ is NOT settable when using
+  // the POSIX-compat equivalent function _open(). Hence the CreateFileA +
+  // _open_osfhandle dance here.
+  HANDLE h =
+      ::CreateFileA(temp_file.path_.c_str(), GENERIC_READ | GENERIC_WRITE,
+                    FILE_SHARE_DELETE | FILE_SHARE_READ, nullptr, CREATE_ALWAYS,
+                    FILE_ATTRIBUTE_TEMPORARY, nullptr);
+  PERFETTO_CHECK(PlatformHandleChecker::IsValid(h));
+  // According to MSDN, when using _open_osfhandle the caller must not call
+  // CloseHandle(). Ownership is moved to the file descriptor, which then needs
+  // to be closed with just with _close().
+  temp_file.fd_.reset(_open_osfhandle(reinterpret_cast<intptr_t>(h), 0));
+#else
+  temp_file.path_ = GetSysTempDir() + "/perfetto-XXXXXXXX";
+  temp_file.fd_.reset(mkstemp(&temp_file.path_[0]));
+#endif
+  if (PERFETTO_UNLIKELY(!temp_file.fd_)) {
+    PERFETTO_FATAL("Could not create temp file %s", temp_file.path_.c_str());
+  }
+  return temp_file;
+}
+
+// static
+TempFile TempFile::CreateUnlinked() {
+  TempFile temp_file = TempFile::Create();
+  temp_file.Unlink();
+  return temp_file;
+}
+
+TempFile::TempFile() = default;
+
+TempFile::~TempFile() {
+  Unlink();
+}
+
+ScopedFile TempFile::ReleaseFD() {
+  Unlink();
+  return std::move(fd_);
+}
+
+void TempFile::Unlink() {
+  if (path_.empty())
+    return;
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  // If the FD is still open DeleteFile will mark the file as pending deletion
+  // and delete it only when the process exists.
+  PERFETTO_CHECK(DeleteFileA(path_.c_str()));
+#else
+  PERFETTO_CHECK(unlink(path_.c_str()) == 0);
+#endif
+  path_.clear();
+}
+
+TempFile::TempFile(TempFile&&) noexcept = default;
+TempFile& TempFile::operator=(TempFile&&) = default;
+
+// static
+TempDir TempDir::Create() {
+  TempDir temp_dir;
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  temp_dir.path_ = GetSysTempDir() + "\\" + GetTempName();
+  PERFETTO_CHECK(_mkdir(temp_dir.path_.c_str()) == 0);
+#else
+  temp_dir.path_ = GetSysTempDir() + "/perfetto-XXXXXXXX";
+  PERFETTO_CHECK(mkdtemp(&temp_dir.path_[0]));
+#endif
+  return temp_dir;
+}
+
+TempDir::TempDir() = default;
+TempDir::TempDir(TempDir&&) noexcept = default;
+TempDir& TempDir::operator=(TempDir&&) = default;
+
+TempDir::~TempDir() {
+  if (path_.empty())
+    return;  // For objects that get std::move()d.
+  PERFETTO_CHECK(Rmdir(path_));
+}
+
+}  // namespace base
+}  // namespace perfetto
+// gen_amalgamated begin source: src/base/thread_checker.cc
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/thread_checker.h"
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+#include <Windows.h>
+#endif
+
+namespace perfetto {
+namespace base {
+
+namespace {
+constexpr ThreadID kDetached{};
+
+ThreadID CurrentThreadId() {
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  return ::GetCurrentThreadId();
+#else
+  return pthread_self();
+#endif
+}
+}  // namespace
+
+ThreadChecker::ThreadChecker() {
+  thread_id_.store(CurrentThreadId());
+}
+
+ThreadChecker::~ThreadChecker() = default;
+
+ThreadChecker::ThreadChecker(const ThreadChecker& other) {
+  thread_id_ = other.thread_id_.load();
+}
+
+ThreadChecker& ThreadChecker::operator=(const ThreadChecker& other) {
+  thread_id_ = other.thread_id_.load();
+  return *this;
+}
+
+bool ThreadChecker::CalledOnValidThread() const {
+  auto self = CurrentThreadId();
+
+  // Will re-attach if previously detached using DetachFromThread().
+  auto prev_value = kDetached;
+  if (thread_id_.compare_exchange_strong(prev_value, self))
+    return true;
+  return prev_value == self;
+}
+
+void ThreadChecker::DetachFromThread() {
+  thread_id_.store(kDetached);
+}
+
+}  // namespace base
+}  // namespace perfetto
+// gen_amalgamated begin source: src/base/time.cc
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/base/time.h"
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+#include <Windows.h>
+#else
+#include <unistd.h>
+#endif
+
+namespace perfetto {
+namespace base {
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+
+TimeNanos GetWallTimeNs() {
+  LARGE_INTEGER freq;
+  ::QueryPerformanceFrequency(&freq);
+  LARGE_INTEGER counter;
+  ::QueryPerformanceCounter(&counter);
+  double elapsed_nanoseconds = (1e9 * static_cast<double>(counter.QuadPart)) /
+                               static_cast<double>(freq.QuadPart);
+  return TimeNanos(static_cast<uint64_t>(elapsed_nanoseconds));
+}
+
+TimeNanos GetThreadCPUTimeNs() {
+  FILETIME dummy, kernel_ftime, user_ftime;
+  ::GetThreadTimes(GetCurrentThread(), &dummy, &dummy, &kernel_ftime,
+                   &user_ftime);
+  uint64_t kernel_time = kernel_ftime.dwHighDateTime * 0x100000000 +
+                         kernel_ftime.dwLowDateTime;
+  uint64_t user_time = user_ftime.dwHighDateTime * 0x100000000 +
+                       user_ftime.dwLowDateTime;
+
+  return TimeNanos((kernel_time + user_time) * 100);
+}
+
+void SleepMicroseconds(unsigned interval_us) {
+  // The Windows Sleep function takes a millisecond count. Round up so that
+  // short sleeps don't turn into a busy wait. Note that the sleep granularity
+  // on Windows can dynamically vary from 1 ms to ~16 ms, so don't count on this
+  // being a short sleep.
+  ::Sleep(static_cast<DWORD>((interval_us + 999) / 1000));
+}
+
+#else  // PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+
+void SleepMicroseconds(unsigned interval_us) {
+  ::usleep(static_cast<useconds_t>(interval_us));
+}
+
+#endif  // PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+
+std::string GetTimeFmt(const std::string& fmt) {
+  time_t raw_time;
+  time(&raw_time);
+  struct tm* local_tm;
+  local_tm = localtime(&raw_time);
+  char buf[128];
+  PERFETTO_CHECK(strftime(buf, 80, fmt.c_str(), local_tm) > 0);
+  return buf;
+}
+
+}  // namespace base
+}  // namespace perfetto
+// gen_amalgamated begin source: src/base/utils.cc
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/file_utils.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) ||   \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+#include <unistd.h>  // For getpagesize() and geteuid() & fork()
+#endif
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+#include <mach/vm_page_size.h>
+#endif
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+#include <dlfcn.h>
+#include <malloc.h>
+
+#ifdef M_PURGE
+#define PERFETTO_M_PURGE M_PURGE
+#else
+// Only available in in-tree builds and on newer SDKs.
+#define PERFETTO_M_PURGE -101
+#endif
+
+namespace {
+extern "C" {
+using MalloptType = void (*)(int, int);
+}
+}  // namespace
+#endif  // OS_ANDROID
+
+namespace perfetto {
+namespace base {
+
+void MaybeReleaseAllocatorMemToOS() {
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+  // mallopt() on Android requires SDK level 26. Many targets and embedders
+  // still depend on a lower SDK level. Given mallopt() is a quite simple API,
+  // use reflection to do this rather than bumping the SDK level for all
+  // embedders. This keeps the behavior of standalone builds aligned with
+  // in-tree builds.
+  static MalloptType mallopt_fn =
+      reinterpret_cast<MalloptType>(dlsym(RTLD_DEFAULT, "mallopt"));
+  if (!mallopt_fn)
+    return;
+  mallopt_fn(PERFETTO_M_PURGE, 0);
+#endif
+}
+
+uint32_t GetSysPageSize() {
+  ignore_result(kPageSize);  // Just to keep the amalgamated build happy.
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+  static std::atomic<uint32_t> page_size{0};
+  // This function might be called in hot paths. Avoid calling getpagesize() all
+  // the times, in many implementations getpagesize() calls sysconf() which is
+  // not cheap.
+  uint32_t cached_value = page_size.load(std::memory_order_relaxed);
+  if (PERFETTO_UNLIKELY(cached_value == 0)) {
+    cached_value = static_cast<uint32_t>(getpagesize());
+    page_size.store(cached_value, std::memory_order_relaxed);
+  }
+  return cached_value;
+#elif PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+  return static_cast<uint32_t>(vm_page_size);
+#else
+  return 4096;
+#endif
+}
+
+uid_t GetCurrentUserId() {
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) ||   \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+  return geteuid();
+#else
+  // TODO(primiano): On Windows we could hash the current user SID and derive a
+  // numeric user id [1]. It is not clear whether we need that. Right now that
+  // would not bring any benefit. Returning 0 unil we can prove we need it.
+  // [1]:https://android-review.googlesource.com/c/platform/external/perfetto/+/1513879/25/src/base/utils.cc
+  return 0;
+#endif
+}
+
+void SetEnv(const std::string& key, const std::string& value) {
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  PERFETTO_CHECK(::_putenv_s(key.c_str(), value.c_str()) == 0);
+#else
+  PERFETTO_CHECK(::setenv(key.c_str(), value.c_str(), /*overwrite=*/true) == 0);
+#endif
+}
+
+void Daemonize() {
+   #if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) ||   \
+       PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
+       PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+      pid_t pid;
+      switch (pid = fork()) {
+        case -1:
+          PERFETTO_FATAL("fork");
+        case 0: {
+          PERFETTO_CHECK(setsid() != -1);
+          base::ignore_result(chdir("/"));
+          base::ScopedFile null = base::OpenFile("/dev/null", O_RDONLY);
+          PERFETTO_CHECK(null);
+          PERFETTO_CHECK(dup2(*null, STDIN_FILENO) != -1);
+          PERFETTO_CHECK(dup2(*null, STDOUT_FILENO) != -1);
+          PERFETTO_CHECK(dup2(*null, STDERR_FILENO) != -1);
+          // Do not accidentally close stdin/stdout/stderr.
+          if (*null <= 2)
+            null.release();
+          break;
+        }
+        default:
+          printf("%d\n", pid);
+          exit(0);
+      }
+  #else
+    // Avoid -Wunreachable warnings.
+    if (reinterpret_cast<intptr_t>(&Daemonize) != 16)
+      PERFETTO_FATAL("--background is only supported on Linux/Android/Mac");
+  #endif  // OS_WIN
+}
+
+}  // namespace base
+}  // namespace perfetto
+// gen_amalgamated begin source: src/base/uuid.cc
+// gen_amalgamated begin header: include/perfetto/ext/base/uuid.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_UUID_H_
+#define INCLUDE_PERFETTO_EXT_BASE_UUID_H_
+
+#include <array>
+#include <string>
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/optional.h"
+
+namespace perfetto {
+namespace base {
+
+class Uuid {
+ public:
+  explicit Uuid(const std::string& s);
+  explicit Uuid(int64_t lsb, int64_t msb);
+  Uuid();
+
+  std::array<uint8_t, 16>* data() { return &data_; }
+  const std::array<uint8_t, 16>* data() const { return &data_; }
+
+  bool operator==(const Uuid& other) const { return data_ == other.data_; }
+
+  bool operator!=(const Uuid& other) const { return !(*this == other); }
+
+  int64_t msb() const {
+    int64_t result;
+    memcpy(&result, data_.data() + 8, 8);
+    return result;
+  }
+
+  int64_t lsb() const {
+    int64_t result;
+    memcpy(&result, data_.data(), 8);
+    return result;
+  }
+
+  void set_lsb_msb(int64_t lsb, int64_t msb) {
+    set_lsb(lsb);
+    set_msb(msb);
+  }
+  void set_msb(int64_t msb) { memcpy(data_.data() + 8, &msb, 8); }
+  void set_lsb(int64_t lsb) { memcpy(data_.data(), &lsb, 8); }
+
+  std::string ToString() const;
+  std::string ToPrettyString() const;
+
+ private:
+  std::array<uint8_t, 16> data_{};
+};
+
+Uuid Uuidv4();
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_UUID_H_
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/uuid.h"
+
+#include <random>
+
+// gen_amalgamated expanded: #include "perfetto/base/time.h"
+
+namespace perfetto {
+namespace base {
+namespace {
+
+constexpr char kHexmap[] = {'0', '1', '2', '3', '4', '5', '6', '7',
+                            '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
+}  // namespace
+
+// See https://www.ietf.org/rfc/rfc4122.txt
+Uuid Uuidv4() {
+  static std::minstd_rand rng(static_cast<uint32_t>(GetBootTimeNs().count()));
+  Uuid uuid;
+  auto& data = *uuid.data();
+
+  for (size_t i = 0; i < 16; ++i)
+    data[i] = static_cast<uint8_t>(rng());
+
+  // version:
+  data[6] = (data[6] & 0x0f) | 0x40;
+  // clock_seq_hi_and_reserved:
+  data[8] = (data[8] & 0x3f) | 0x80;
+
+  return uuid;
+}
+
+Uuid::Uuid() {}
+
+Uuid::Uuid(const std::string& s) {
+  PERFETTO_CHECK(s.size() == data_.size());
+  memcpy(data_.data(), s.data(), s.size());
+}
+
+Uuid::Uuid(int64_t lsb, int64_t msb) {
+  set_lsb_msb(lsb, msb);
+}
+
+std::string Uuid::ToString() const {
+  return std::string(reinterpret_cast<const char*>(data_.data()), data_.size());
+}
+
+std::string Uuid::ToPrettyString() const {
+  std::string s(data_.size() * 2 + 4, '-');
+  // Format is 123e4567-e89b-12d3-a456-426655443322.
+  size_t j = 0;
+  for (size_t i = 0; i < data_.size(); ++i) {
+    if (i == 4 || i == 6 || i == 8 || i == 10)
+      j++;
+    s[2 * i + j] = kHexmap[(data_[data_.size() - i - 1] & 0xf0) >> 4];
+    s[2 * i + 1 + j] = kHexmap[(data_[data_.size() - i - 1] & 0x0f)];
+  }
+  return s;
+}
+
+}  // namespace base
+}  // namespace perfetto
+// gen_amalgamated begin source: src/base/version.cc
+// gen_amalgamated begin header: include/perfetto/ext/base/version.h
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_VERSION_H_
+#define INCLUDE_PERFETTO_EXT_BASE_VERSION_H_
+
+namespace perfetto {
+namespace base {
+
+// The returned pointer is a static string is safe to pass around.
+const char* GetVersionString();
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_VERSION_H_
+// gen_amalgamated begin header: gen/perfetto_version.gen.h
+// Generated by write_version_header.py
+
+#ifndef GEN_PERFETTO_VERSION_GEN_H_
+#define GEN_PERFETTO_VERSION_GEN_H_
+
+#define PERFETTO_VERSION_STRING() "v15.0"
+#define PERFETTO_VERSION_SCM_REVISION() "f69a7701253a1c934595a31c581465a1acb0af80"
+
+#endif  // GEN_PERFETTO_VERSION_GEN_H_
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/version.h"
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+
+#include <stdio.h>
+
+#if PERFETTO_BUILDFLAG(PERFETTO_VERSION_GEN)
+// gen_amalgamated expanded: #include "perfetto_version.gen.h"
+#else
+#define PERFETTO_VERSION_STRING() "v0.0"
+#define PERFETTO_VERSION_SCM_REVISION() "unknown"
+#endif
+
+namespace perfetto {
+namespace base {
+
+const char* GetVersionString() {
+  static const char* version_str = [] {
+    static constexpr size_t kMaxLen = 256;
+    char* version = new char[kMaxLen + 1];
+    snprintf(version, kMaxLen, "Perfetto %s (%s)", PERFETTO_VERSION_STRING(),
+             PERFETTO_VERSION_SCM_REVISION());
+    return version;
+  }();
+  return version_str;
+}
+
+}  // namespace base
+}  // namespace perfetto
+// gen_amalgamated begin source: src/base/virtual_destructors.cc
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/base/task_runner.h"
+
+// This translation unit contains the definitions for the destructor of pure
+// virtual interfaces for the current build target. The alternative would be
+// introducing a one-liner .cc file for each pure virtual interface, which is
+// overkill. This is for compliance with -Wweak-vtables.
+
+namespace perfetto {
+namespace base {
+
+TaskRunner::~TaskRunner() = default;
+
+}  // namespace base
+}  // namespace perfetto
+// gen_amalgamated begin source: src/base/waitable_event.cc
+// gen_amalgamated begin header: include/perfetto/ext/base/waitable_event.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_WAITABLE_EVENT_H_
+#define INCLUDE_PERFETTO_EXT_BASE_WAITABLE_EVENT_H_
+
+#include <condition_variable>
+#include <mutex>
+
+namespace perfetto {
+namespace base {
+
+// A waitable event for cross-thread synchronization.
+// All methods on this class can be called from any thread.
+class WaitableEvent {
+ public:
+  WaitableEvent();
+  ~WaitableEvent();
+  WaitableEvent(const WaitableEvent&) = delete;
+  WaitableEvent operator=(const WaitableEvent&) = delete;
+
+  // Synchronously block until the event is notified.
+  void Wait();
+
+  // Signal the event, waking up blocked waiters.
+  void Notify();
+
+ private:
+  std::mutex mutex_;
+  std::condition_variable event_;
+  bool notified_ = false;
+};
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_WAITABLE_EVENT_H_
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/waitable_event.h"
+
+namespace perfetto {
+namespace base {
+
+WaitableEvent::WaitableEvent() = default;
+WaitableEvent::~WaitableEvent() = default;
+
+void WaitableEvent::Wait() {
+  std::unique_lock<std::mutex> lock(mutex_);
+  return event_.wait(lock, [this] { return notified_; });
+}
+
+void WaitableEvent::Notify() {
+  std::unique_lock<std::mutex> lock(mutex_);
+  notified_ = true;
+  event_.notify_all();
+}
+
+}  // namespace base
+}  // namespace perfetto
+// gen_amalgamated begin source: src/base/watchdog_posix.cc
+// gen_amalgamated begin header: include/perfetto/ext/base/watchdog.h
+// gen_amalgamated begin header: include/perfetto/ext/base/watchdog_noop.h
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_WATCHDOG_NOOP_H_
+#define INCLUDE_PERFETTO_EXT_BASE_WATCHDOG_NOOP_H_
+
+#include <stdint.h>
+
+namespace perfetto {
+namespace base {
+
+class Watchdog {
+ public:
+  class Timer {
+   public:
+    // Define an empty dtor to avoid "unused variable" errors on the call site.
+    Timer() {}
+    Timer(const Timer&) {}
+    ~Timer() {}
+  };
+  static Watchdog* GetInstance() {
+    static Watchdog* watchdog = new Watchdog();
+    return watchdog;
+  }
+  Timer CreateFatalTimer(uint32_t /*ms*/) { return Timer(); }
+  void Start() {}
+  void SetMemoryLimit(uint64_t /*bytes*/, uint32_t /*window_ms*/) {}
+  void SetCpuLimit(uint32_t /*percentage*/, uint32_t /*window_ms*/) {}
+};
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_WATCHDOG_NOOP_H_
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_WATCHDOG_H_
+#define INCLUDE_PERFETTO_EXT_BASE_WATCHDOG_H_
+
+#include <functional>
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+
+// The POSIX watchdog is only supported on Linux and Android in non-embedder
+// builds.
+#if PERFETTO_BUILDFLAG(PERFETTO_WATCHDOG)
+// gen_amalgamated expanded: #include "perfetto/ext/base/watchdog_posix.h"
+#else
+// gen_amalgamated expanded: #include "perfetto/ext/base/watchdog_noop.h"
+#endif
+
+namespace perfetto {
+namespace base {
+
+// Make the limits more relaxed on desktop, where multi-GB traces are likely.
+// Multi-GB traces can take bursts of cpu time to write into disk at the end of
+// the trace.
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+constexpr uint32_t kWatchdogDefaultCpuLimit = 75;
+constexpr uint32_t kWatchdogDefaultCpuWindow = 5 * 60 * 1000;  // 5 minutes.
+#else
+constexpr uint32_t kWatchdogDefaultCpuLimit = 90;
+constexpr uint32_t kWatchdogDefaultCpuWindow = 10 * 60 * 1000;  // 10 minutes.
+#endif
+
+// The default memory margin we give to our processes. This is used as as a
+// constant to put on top of the trace buffers.
+constexpr uint64_t kWatchdogDefaultMemorySlack = 32 * 1024 * 1024;  // 32 MiB.
+constexpr uint32_t kWatchdogDefaultMemoryWindow = 30 * 1000;  // 30 seconds.
+
+inline void RunTaskWithWatchdogGuard(const std::function<void()>& task) {
+  // Maximum time a single task can take in a TaskRunner before the
+  // program suicides.
+  constexpr int64_t kWatchdogMillis = 30000;  // 30s
+
+  Watchdog::Timer handle =
+      base::Watchdog::GetInstance()->CreateFatalTimer(kWatchdogMillis);
+  task();
+
+  // Suppress unused variable warnings in the client library amalgamated build.
+  (void)kWatchdogDefaultCpuLimit;
+  (void)kWatchdogDefaultCpuWindow;
+  (void)kWatchdogDefaultMemorySlack;
+  (void)kWatchdogDefaultMemoryWindow;
+}
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_WATCHDOG_H_
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/watchdog.h"
+
+#if PERFETTO_BUILDFLAG(PERFETTO_WATCHDOG)
+
+#include <fcntl.h>
+#include <inttypes.h>
+#include <signal.h>
+#include <stdint.h>
+
+#include <fstream>
+#include <thread>
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/base/thread_utils.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/file_utils.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/scoped_file.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+
+namespace perfetto {
+namespace base {
+
+namespace {
+
+constexpr uint32_t kDefaultPollingInterval = 30 * 1000;
+
+bool IsMultipleOf(uint32_t number, uint32_t divisor) {
+  return number >= divisor && number % divisor == 0;
+}
+
+double MeanForArray(const uint64_t array[], size_t size) {
+  uint64_t total = 0;
+  for (size_t i = 0; i < size; i++) {
+    total += array[i];
+  }
+  return static_cast<double>(total / size);
+
+}
+
+}  //  namespace
+
+bool ReadProcStat(int fd, ProcStat* out) {
+  char c[512];
+  size_t c_pos = 0;
+  while (c_pos < sizeof(c) - 1) {
+    ssize_t rd = PERFETTO_EINTR(read(fd, c + c_pos, sizeof(c) - c_pos));
+    if (rd < 0) {
+      PERFETTO_ELOG("Failed to read stat file to enforce resource limits.");
+      return false;
+    }
+    if (rd == 0)
+      break;
+    c_pos += static_cast<size_t>(rd);
+  }
+  PERFETTO_CHECK(c_pos < sizeof(c));
+  c[c_pos] = '\0';
+
+  if (sscanf(c,
+             "%*d %*s %*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u %lu "
+             "%lu %*d %*d %*d %*d %*d %*d %*u %*u %ld",
+             &out->utime, &out->stime, &out->rss_pages) != 3) {
+    PERFETTO_ELOG("Invalid stat format: %s", c);
+    return false;
+  }
+  return true;
+}
+
+Watchdog::Watchdog(uint32_t polling_interval_ms)
+    : polling_interval_ms_(polling_interval_ms) {}
+
+Watchdog::~Watchdog() {
+  if (!thread_.joinable()) {
+    PERFETTO_DCHECK(!enabled_);
+    return;
+  }
+  PERFETTO_DCHECK(enabled_);
+  enabled_ = false;
+  exit_signal_.notify_one();
+  thread_.join();
+}
+
+Watchdog* Watchdog::GetInstance() {
+  static Watchdog* watchdog = new Watchdog(kDefaultPollingInterval);
+  return watchdog;
+}
+
+Watchdog::Timer Watchdog::CreateFatalTimer(uint32_t ms) {
+  if (!enabled_.load(std::memory_order_relaxed))
+    return Watchdog::Timer(0);
+
+  return Watchdog::Timer(ms);
+}
+
+void Watchdog::Start() {
+  std::lock_guard<std::mutex> guard(mutex_);
+  if (thread_.joinable()) {
+    PERFETTO_DCHECK(enabled_);
+  } else {
+    PERFETTO_DCHECK(!enabled_);
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+    // Kick the thread to start running but only on Android or Linux.
+    enabled_ = true;
+    thread_ = std::thread(&Watchdog::ThreadMain, this);
+#endif
+  }
+}
+
+void Watchdog::SetMemoryLimit(uint64_t bytes, uint32_t window_ms) {
+  // Update the fields under the lock.
+  std::lock_guard<std::mutex> guard(mutex_);
+
+  PERFETTO_CHECK(IsMultipleOf(window_ms, polling_interval_ms_) || bytes == 0);
+
+  size_t size = bytes == 0 ? 0 : window_ms / polling_interval_ms_ + 1;
+  memory_window_bytes_.Reset(size);
+  memory_limit_bytes_ = bytes;
+}
+
+void Watchdog::SetCpuLimit(uint32_t percentage, uint32_t window_ms) {
+  std::lock_guard<std::mutex> guard(mutex_);
+
+  PERFETTO_CHECK(percentage <= 100);
+  PERFETTO_CHECK(IsMultipleOf(window_ms, polling_interval_ms_) ||
+                 percentage == 0);
+
+  size_t size = percentage == 0 ? 0 : window_ms / polling_interval_ms_ + 1;
+  cpu_window_time_ticks_.Reset(size);
+  cpu_limit_percentage_ = percentage;
+}
+
+void Watchdog::ThreadMain() {
+  base::ScopedFile stat_fd(base::OpenFile("/proc/self/stat", O_RDONLY));
+  if (!stat_fd) {
+    PERFETTO_ELOG("Failed to open stat file to enforce resource limits.");
+    return;
+  }
+
+  std::unique_lock<std::mutex> guard(mutex_);
+  for (;;) {
+    exit_signal_.wait_for(guard,
+                          std::chrono::milliseconds(polling_interval_ms_));
+    if (!enabled_)
+      return;
+
+    lseek(stat_fd.get(), 0, SEEK_SET);
+
+    ProcStat stat;
+    if (!ReadProcStat(stat_fd.get(), &stat)) {
+      return;
+    }
+
+    uint64_t cpu_time = stat.utime + stat.stime;
+    uint64_t rss_bytes =
+        static_cast<uint64_t>(stat.rss_pages) * base::GetSysPageSize();
+
+    CheckMemory(rss_bytes);
+    CheckCpu(cpu_time);
+  }
+}
+
+void Watchdog::CheckMemory(uint64_t rss_bytes) {
+  if (memory_limit_bytes_ == 0)
+    return;
+
+  // Add the current stat value to the ring buffer and check that the mean
+  // remains under our threshold.
+  if (memory_window_bytes_.Push(rss_bytes)) {
+    if (memory_window_bytes_.Mean() > static_cast<double>(memory_limit_bytes_)) {
+      PERFETTO_ELOG(
+          "Memory watchdog trigger. Memory window of %f bytes is above the "
+          "%" PRIu64 " bytes limit.",
+          memory_window_bytes_.Mean(), memory_limit_bytes_);
+      kill(getpid(), SIGABRT);
+    }
+  }
+}
+
+void Watchdog::CheckCpu(uint64_t cpu_time) {
+  if (cpu_limit_percentage_ == 0)
+    return;
+
+  // Add the cpu time to the ring buffer.
+  if (cpu_window_time_ticks_.Push(cpu_time)) {
+    // Compute the percentage over the whole window and check that it remains
+    // under the threshold.
+    uint64_t difference_ticks = cpu_window_time_ticks_.NewestWhenFull() -
+                                cpu_window_time_ticks_.OldestWhenFull();
+    double window_interval_ticks =
+        (static_cast<double>(WindowTimeForRingBuffer(cpu_window_time_ticks_)) /
+         1000.0) *
+        static_cast<double>(sysconf(_SC_CLK_TCK));
+    double percentage = static_cast<double>(difference_ticks) /
+                        static_cast<double>(window_interval_ticks) * 100;
+    if (percentage > cpu_limit_percentage_) {
+      PERFETTO_ELOG("CPU watchdog trigger. %f%% CPU use is above the %" PRIu32
+                    "%% CPU limit.",
+                    percentage, cpu_limit_percentage_);
+      kill(getpid(), SIGABRT);
+    }
+  }
+}
+
+uint32_t Watchdog::WindowTimeForRingBuffer(const WindowedInterval& window) {
+  return static_cast<uint32_t>(window.size() - 1) * polling_interval_ms_;
+}
+
+bool Watchdog::WindowedInterval::Push(uint64_t sample) {
+  // Add the sample to the current position in the ring buffer.
+  buffer_[position_] = sample;
+
+  // Update the position with next one circularily.
+  position_ = (position_ + 1) % size_;
+
+  // Set the filled flag the first time we wrap.
+  filled_ = filled_ || position_ == 0;
+  return filled_;
+}
+
+double Watchdog::WindowedInterval::Mean() const {
+  return MeanForArray(buffer_.get(), size_);
+}
+
+void Watchdog::WindowedInterval::Clear() {
+  position_ = 0;
+  buffer_.reset(new uint64_t[size_]());
+}
+
+void Watchdog::WindowedInterval::Reset(size_t new_size) {
+  position_ = 0;
+  size_ = new_size;
+  buffer_.reset(new_size == 0 ? nullptr : new uint64_t[new_size]());
+}
+
+Watchdog::Timer::Timer(uint32_t ms) {
+  if (!ms)
+    return;  // No-op timer created when the watchdog is disabled.
+
+  struct sigevent sev = {};
+  timer_t timerid;
+  sev.sigev_notify = SIGEV_THREAD_ID;
+  sev._sigev_un._tid = base::GetThreadId();
+  sev.sigev_signo = SIGABRT;
+  PERFETTO_CHECK(timer_create(CLOCK_MONOTONIC, &sev, &timerid) != -1);
+  timerid_ = base::make_optional(timerid);
+  struct itimerspec its = {};
+  its.it_value.tv_sec = ms / 1000;
+  its.it_value.tv_nsec = 1000000L * (ms % 1000);
+  PERFETTO_CHECK(timer_settime(timerid_.value(), 0, &its, nullptr) != -1);
+}
+
+Watchdog::Timer::~Timer() {
+  if (timerid_) {
+    timer_delete(timerid_.value());
+  }
+}
+
+Watchdog::Timer::Timer(Timer&& other) noexcept {
+  timerid_ = std::move(other.timerid_);
+  other.timerid_ = base::nullopt;
+}
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // PERFETTO_BUILDFLAG(PERFETTO_WATCHDOG)
+// gen_amalgamated begin source: src/base/thread_task_runner.cc
+// gen_amalgamated begin header: include/perfetto/ext/base/thread_task_runner.h
+// gen_amalgamated begin header: include/perfetto/ext/base/unix_task_runner.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_UNIX_TASK_RUNNER_H_
+#define INCLUDE_PERFETTO_EXT_BASE_UNIX_TASK_RUNNER_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+// gen_amalgamated expanded: #include "perfetto/base/task_runner.h"
+// gen_amalgamated expanded: #include "perfetto/base/thread_utils.h"
+// gen_amalgamated expanded: #include "perfetto/base/time.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/event_fd.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/scoped_file.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/thread_checker.h"
+
+#include <chrono>
+#include <deque>
+#include <map>
+#include <mutex>
+#include <vector>
+
+#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+#include <poll.h>
+#endif
+
+namespace perfetto {
+namespace base {
+
+// Runs a task runner on the current thread.
+//
+// Implementation note: we currently assume (and enforce in debug builds) that
+// Run() is called from the thread that constructed the UnixTaskRunner. This is
+// not strictly necessary, and we could instead track the thread that invokes
+// Run(). However, a related property that *might* be important to enforce is
+// that the destructor runs on the task-running thread. Otherwise, if there are
+// still-pending tasks at the time of destruction, we would destroy those
+// outside of the task thread (which might be unexpected to the caller). On the
+// other hand, the std::function task interface discourages use of any
+// resource-owning tasks (as the callable needs to be copyable), so this might
+// not be important in practice.
+//
+// TODO(rsavitski): consider adding a thread-check in the destructor, after
+// auditing existing usages.
+// TODO(primiano): rename this to TaskRunnerImpl. The "Unix" part is misleading
+// now as it supports also Windows.
+class UnixTaskRunner : public TaskRunner {
+ public:
+  UnixTaskRunner();
+  ~UnixTaskRunner() override;
+
+  // Start executing tasks. Doesn't return until Quit() is called. Run() may be
+  // called multiple times on the same task runner.
+  void Run();
+  void Quit();
+
+  // Checks whether there are any pending immediate tasks to run. Note that
+  // delayed tasks don't count even if they are due to run.
+  bool IsIdleForTesting();
+
+  // TaskRunner implementation:
+  void PostTask(std::function<void()>) override;
+  void PostDelayedTask(std::function<void()>, uint32_t delay_ms) override;
+  void AddFileDescriptorWatch(PlatformHandle, std::function<void()>) override;
+  void RemoveFileDescriptorWatch(PlatformHandle) override;
+  bool RunsTasksOnCurrentThread() const override;
+
+  // Returns true if the task runner is quitting, or has quit and hasn't been
+  // restarted since. Exposed primarily for ThreadTaskRunner, not necessary for
+  // normal use of this class.
+  bool QuitCalled();
+
+ private:
+  void WakeUp();
+  void UpdateWatchTasksLocked();
+  int GetDelayMsToNextTaskLocked() const;
+  void RunImmediateAndDelayedTask();
+  void PostFileDescriptorWatches(uint64_t windows_wait_result);
+  void RunFileDescriptorWatch(PlatformHandle);
+
+  ThreadChecker thread_checker_;
+  PlatformThreadId created_thread_id_ = GetThreadId();
+
+  EventFd event_;
+
+// The array of fds/handles passed to poll(2) / WaitForMultipleObjects().
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  std::vector<PlatformHandle> poll_fds_;
+#else
+  std::vector<struct pollfd> poll_fds_;
+#endif
+
+  // --- Begin lock-protected members ---
+
+  std::mutex lock_;
+
+  std::deque<std::function<void()>> immediate_tasks_;
+  std::multimap<TimeMillis, std::function<void()>> delayed_tasks_;
+  bool quit_ = false;
+
+  struct WatchTask {
+    std::function<void()> callback;
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+    // On UNIX systems we make the FD number negative in |poll_fds_| to avoid
+    // polling it again until the queued task runs. On Windows we can't do that.
+    // Instead we keep track of its state here.
+    bool pending = false;
+#else
+    size_t poll_fd_index;  // Index into |poll_fds_|.
+#endif
+  };
+
+  std::map<PlatformHandle, WatchTask> watch_tasks_;
+  bool watch_tasks_changed_ = false;
+
+  // --- End lock-protected members ---
+};
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_UNIX_TASK_RUNNER_H_
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_THREAD_TASK_RUNNER_H_
+#define INCLUDE_PERFETTO_EXT_BASE_THREAD_TASK_RUNNER_H_
+
+#include <functional>
+#include <thread>
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/unix_task_runner.h"
+
+namespace perfetto {
+namespace base {
+
+// A UnixTaskRunner backed by a dedicated task thread. Shuts down the runner and
+// joins the thread upon destruction. Can be moved to transfer ownership.
+//
+// Guarantees that:
+// * the UnixTaskRunner will be constructed and destructed on the task thread.
+// * the task thread will live for the lifetime of the UnixTaskRunner.
+//
+class PERFETTO_EXPORT ThreadTaskRunner : public TaskRunner {
+ public:
+  static ThreadTaskRunner CreateAndStart(const std::string& name = "") {
+    return ThreadTaskRunner(name);
+  }
+
+  ThreadTaskRunner(const ThreadTaskRunner&) = delete;
+  ThreadTaskRunner& operator=(const ThreadTaskRunner&) = delete;
+
+  ThreadTaskRunner(ThreadTaskRunner&&) noexcept;
+  ThreadTaskRunner& operator=(ThreadTaskRunner&&);
+  ~ThreadTaskRunner() override;
+
+  // Executes the given function on the task runner thread and blocks the caller
+  // thread until the function has run.
+  void PostTaskAndWaitForTesting(std::function<void()>);
+
+  // Can be called from another thread to get the CPU time of the thread the
+  // task-runner is executing on.
+  uint64_t GetThreadCPUTimeNsForTesting();
+
+  // Returns a pointer to the UnixTaskRunner, which is valid for the lifetime of
+  // this ThreadTaskRunner object (unless this object is moved-from, in which
+  // case the pointer remains valid for the lifetime of the new owning
+  // ThreadTaskRunner).
+  //
+  // Warning: do not call Quit() on the returned runner pointer, the termination
+  // should be handled exclusively by this class' destructor.
+  UnixTaskRunner* get() const { return task_runner_; }
+
+  // TaskRunner implementation.
+  // These methods just proxy to the underlying task_runner_.
+  void PostTask(std::function<void()>) override;
+  void PostDelayedTask(std::function<void()>, uint32_t delay_ms) override;
+  void AddFileDescriptorWatch(PlatformHandle, std::function<void()>) override;
+  void RemoveFileDescriptorWatch(PlatformHandle) override;
+  bool RunsTasksOnCurrentThread() const override;
+
+ private:
+  explicit ThreadTaskRunner(const std::string& name);
+  void RunTaskThread(std::function<void(UnixTaskRunner*)> initializer);
+
+  std::thread thread_;
+  std::string name_;
+  UnixTaskRunner* task_runner_ = nullptr;
+};
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_THREAD_TASK_RUNNER_H_
+// gen_amalgamated begin header: include/perfetto/ext/base/thread_utils.h
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_THREAD_UTILS_H_
+#define INCLUDE_PERFETTO_EXT_BASE_THREAD_UTILS_H_
+
+#include <string>
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) ||   \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+#include <pthread.h>
+#include <string.h>
+#include <algorithm>
+#endif
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+#include <sys/prctl.h>
+#endif
+
+// Internal implementation utils that aren't as widely useful/supported as
+// base/thread_utils.h.
+
+namespace perfetto {
+namespace base {
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) ||   \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+// Sets the "comm" of the calling thread to the first 15 chars of the given
+// string.
+inline bool MaybeSetThreadName(const std::string& name) {
+  char buf[16] = {};
+  size_t sz = std::min(name.size(), static_cast<size_t>(15));
+  strncpy(buf, name.c_str(), sz);
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+  return pthread_setname_np(buf) == 0;
+#else
+  return pthread_setname_np(pthread_self(), buf) == 0;
+#endif
+}
+
+inline bool GetThreadName(std::string& out_result) {
+  char buf[16] = {};
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+  if (prctl(PR_GET_NAME, buf) != 0)
+    return false;
+#else
+  if (pthread_getname_np(pthread_self(), buf, sizeof(buf)) != 0)
+    return false;
+#endif
+  out_result = std::string(buf);
+  return true;
+}
+
+#else
+inline bool MaybeSetThreadName(const std::string&) {
+  return false;
+}
+inline bool GetThreadName(std::string&) {
+  return false;
+}
+#endif
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_THREAD_UTILS_H_
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/thread_task_runner.h"
+
+#include <condition_variable>
+#include <functional>
+#include <mutex>
+#include <thread>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/thread_utils.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/unix_task_runner.h"
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+#include <sys/prctl.h>
+#endif
+
+namespace perfetto {
+namespace base {
+
+ThreadTaskRunner::ThreadTaskRunner(ThreadTaskRunner&& other) noexcept
+    : thread_(std::move(other.thread_)), task_runner_(other.task_runner_) {
+  other.task_runner_ = nullptr;
+}
+
+ThreadTaskRunner& ThreadTaskRunner::operator=(ThreadTaskRunner&& other) {
+  this->~ThreadTaskRunner();
+  new (this) ThreadTaskRunner(std::move(other));
+  return *this;
+}
+
+ThreadTaskRunner::~ThreadTaskRunner() {
+  if (task_runner_) {
+    PERFETTO_CHECK(!task_runner_->QuitCalled());
+    task_runner_->Quit();
+
+    PERFETTO_DCHECK(thread_.joinable());
+  }
+  if (thread_.joinable())
+    thread_.join();
+}
+
+ThreadTaskRunner::ThreadTaskRunner(const std::string& name) : name_(name) {
+  std::mutex init_lock;
+  std::condition_variable init_cv;
+
+  std::function<void(UnixTaskRunner*)> initializer =
+      [this, &init_lock, &init_cv](UnixTaskRunner* task_runner) {
+        std::lock_guard<std::mutex> lock(init_lock);
+        task_runner_ = task_runner;
+        // Notify while still holding the lock, as init_cv ceases to exist as
+        // soon as the main thread observes a non-null task_runner_, and it can
+        // wake up spuriously (i.e. before the notify if we had unlocked before
+        // notifying).
+        init_cv.notify_one();
+      };
+
+  thread_ = std::thread(&ThreadTaskRunner::RunTaskThread, this,
+                        std::move(initializer));
+
+  std::unique_lock<std::mutex> lock(init_lock);
+  init_cv.wait(lock, [this] { return !!task_runner_; });
+}
+
+void ThreadTaskRunner::RunTaskThread(
+    std::function<void(UnixTaskRunner*)> initializer) {
+  if (!name_.empty()) {
+    base::MaybeSetThreadName(name_);
+  }
+
+  UnixTaskRunner task_runner;
+  task_runner.PostTask(std::bind(std::move(initializer), &task_runner));
+  task_runner.Run();
+}
+
+void ThreadTaskRunner::PostTaskAndWaitForTesting(std::function<void()> fn) {
+  std::mutex mutex;
+  std::condition_variable cv;
+
+  std::unique_lock<std::mutex> lock(mutex);
+  bool done = false;
+  task_runner_->PostTask([&mutex, &cv, &done, &fn] {
+    fn();
+
+    std::lock_guard<std::mutex> inner_lock(mutex);
+    done = true;
+    cv.notify_one();
+  });
+  cv.wait(lock, [&done] { return done; });
+}
+
+uint64_t ThreadTaskRunner::GetThreadCPUTimeNsForTesting() {
+  uint64_t thread_time_ns = 0;
+  PostTaskAndWaitForTesting([&thread_time_ns] {
+    thread_time_ns = static_cast<uint64_t>(base::GetThreadCPUTimeNs().count());
+  });
+  return thread_time_ns;
+}
+
+void ThreadTaskRunner::PostTask(std::function<void()> task) {
+  task_runner_->PostTask(std::move(task));
+}
+
+void ThreadTaskRunner::PostDelayedTask(std::function<void()> task,
+                                       uint32_t delay_ms) {
+  task_runner_->PostDelayedTask(std::move(task), delay_ms);
+}
+
+void ThreadTaskRunner::AddFileDescriptorWatch(
+    PlatformHandle handle,
+    std::function<void()> watch_task) {
+  task_runner_->AddFileDescriptorWatch(handle, std::move(watch_task));
+}
+
+void ThreadTaskRunner::RemoveFileDescriptorWatch(PlatformHandle handle) {
+  task_runner_->RemoveFileDescriptorWatch(handle);
+}
+
+bool ThreadTaskRunner::RunsTasksOnCurrentThread() const {
+  return task_runner_->RunsTasksOnCurrentThread();
+}
+
+}  // namespace base
+}  // namespace perfetto
+// gen_amalgamated begin source: src/base/unix_task_runner.cc
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/unix_task_runner.h"
+
+#include <errno.h>
+#include <stdlib.h>
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+#include <Windows.h>
+#include <synchapi.h>
+#else
+#include <unistd.h>
+#endif
+
+#include <algorithm>
+#include <limits>
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/watchdog.h"
+
+namespace perfetto {
+namespace base {
+
+UnixTaskRunner::UnixTaskRunner() {
+  AddFileDescriptorWatch(event_.fd(), [] {
+    // Not reached -- see PostFileDescriptorWatches().
+    PERFETTO_DFATAL("Should be unreachable.");
+  });
+}
+
+UnixTaskRunner::~UnixTaskRunner() = default;
+
+void UnixTaskRunner::WakeUp() {
+  event_.Notify();
+}
+
+void UnixTaskRunner::Run() {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  created_thread_id_ = GetThreadId();
+  quit_ = false;
+  for (;;) {
+    int poll_timeout_ms;
+    {
+      std::lock_guard<std::mutex> lock(lock_);
+      if (quit_)
+        return;
+      poll_timeout_ms = GetDelayMsToNextTaskLocked();
+      UpdateWatchTasksLocked();
+    }
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+    DWORD timeout =
+        poll_timeout_ms >= 0 ? static_cast<DWORD>(poll_timeout_ms) : INFINITE;
+    DWORD ret =
+        WaitForMultipleObjects(static_cast<DWORD>(poll_fds_.size()),
+                               &poll_fds_[0], /*bWaitAll=*/false, timeout);
+    // Unlike poll(2), WaitForMultipleObjects() returns only *one* handle in the
+    // set, even when >1 is signalled. In order to avoid starvation,
+    // PostFileDescriptorWatches() will WaitForSingleObject() each other handle
+    // to ensure fairness. |ret| here is passed just to avoid an extra
+    // WaitForSingleObject() for the one handle that WaitForMultipleObject()
+    // returned.
+    PostFileDescriptorWatches(ret);
+#else
+    int ret = PERFETTO_EINTR(poll(
+        &poll_fds_[0], static_cast<nfds_t>(poll_fds_.size()), poll_timeout_ms));
+    PERFETTO_CHECK(ret >= 0);
+    PostFileDescriptorWatches(0 /*ignored*/);
+#endif
+
+    // To avoid starvation we always interleave all types of tasks -- immediate,
+    // delayed and file descriptor watches.
+    RunImmediateAndDelayedTask();
+  }
+}
+
+void UnixTaskRunner::Quit() {
+  std::lock_guard<std::mutex> lock(lock_);
+  quit_ = true;
+  WakeUp();
+}
+
+bool UnixTaskRunner::QuitCalled() {
+  std::lock_guard<std::mutex> lock(lock_);
+  return quit_;
+}
+
+bool UnixTaskRunner::IsIdleForTesting() {
+  std::lock_guard<std::mutex> lock(lock_);
+  return immediate_tasks_.empty();
+}
+
+void UnixTaskRunner::UpdateWatchTasksLocked() {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  if (!watch_tasks_changed_)
+    return;
+  watch_tasks_changed_ = false;
+#endif
+  poll_fds_.clear();
+  for (auto& it : watch_tasks_) {
+    PlatformHandle handle = it.first;
+    WatchTask& watch_task = it.second;
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+    if (!watch_task.pending)
+      poll_fds_.push_back(handle);
+#else
+    watch_task.poll_fd_index = poll_fds_.size();
+    poll_fds_.push_back({handle, POLLIN | POLLHUP, 0});
+#endif
+  }
+}
+
+void UnixTaskRunner::RunImmediateAndDelayedTask() {
+  // If locking overhead becomes an issue, add a separate work queue.
+  std::function<void()> immediate_task;
+  std::function<void()> delayed_task;
+  TimeMillis now = GetWallTimeMs();
+  {
+    std::lock_guard<std::mutex> lock(lock_);
+    if (!immediate_tasks_.empty()) {
+      immediate_task = std::move(immediate_tasks_.front());
+      immediate_tasks_.pop_front();
+    }
+    if (!delayed_tasks_.empty()) {
+      auto it = delayed_tasks_.begin();
+      if (now >= it->first) {
+        delayed_task = std::move(it->second);
+        delayed_tasks_.erase(it);
+      }
+    }
+  }
+
+  errno = 0;
+  if (immediate_task)
+    RunTaskWithWatchdogGuard(immediate_task);
+  errno = 0;
+  if (delayed_task)
+    RunTaskWithWatchdogGuard(delayed_task);
+}
+
+void UnixTaskRunner::PostFileDescriptorWatches(uint64_t windows_wait_result) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  for (size_t i = 0; i < poll_fds_.size(); i++) {
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+    const PlatformHandle handle = poll_fds_[i];
+    // |windows_wait_result| is the result of WaitForMultipleObjects() call. If
+    // one of the objects was signalled, it will have a value between
+    // [0, poll_fds_.size()].
+    if (i != windows_wait_result &&
+        WaitForSingleObject(handle, 0) != WAIT_OBJECT_0) {
+      continue;
+    }
+#else
+    base::ignore_result(windows_wait_result);
+    const PlatformHandle handle = poll_fds_[i].fd;
+    if (!(poll_fds_[i].revents & (POLLIN | POLLHUP)))
+      continue;
+    poll_fds_[i].revents = 0;
+#endif
+
+    // The wake-up event is handled inline to avoid an infinite recursion of
+    // posted tasks.
+    if (handle == event_.fd()) {
+      event_.Clear();
+      continue;
+    }
+
+    // Binding to |this| is safe since we are the only object executing the
+    // task.
+    PostTask(std::bind(&UnixTaskRunner::RunFileDescriptorWatch, this, handle));
+
+    // Flag the task as pending.
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+    // On Windows this is done by marking the WatchTask entry as pending. This
+    // is more expensive than Linux as requires rebuilding the |poll_fds_|
+    // vector on each call. There doesn't seem to be a good alternative though.
+    auto it = watch_tasks_.find(handle);
+    PERFETTO_CHECK(it != watch_tasks_.end());
+    PERFETTO_DCHECK(!it->second.pending);
+    it->second.pending = true;
+#else
+    // On UNIX systems instead, we just make the fd negative while its task is
+    // pending. This makes poll(2) ignore the fd.
+    PERFETTO_DCHECK(poll_fds_[i].fd >= 0);
+    poll_fds_[i].fd = -poll_fds_[i].fd;
+#endif
+  }
+}
+
+void UnixTaskRunner::RunFileDescriptorWatch(PlatformHandle fd) {
+  std::function<void()> task;
+  {
+    std::lock_guard<std::mutex> lock(lock_);
+    auto it = watch_tasks_.find(fd);
+    if (it == watch_tasks_.end())
+      return;
+    WatchTask& watch_task = it->second;
+
+    // Make poll(2) pay attention to the fd again. Since another thread may have
+    // updated this watch we need to refresh the set first.
+    UpdateWatchTasksLocked();
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+    // On Windows we manually track the presence of outstanding tasks for the
+    // watch. The UpdateWatchTasksLocked() in the Run() loop will re-add the
+    // task to the |poll_fds_| vector.
+    PERFETTO_DCHECK(watch_task.pending);
+    watch_task.pending = false;
+#else
+    size_t fd_index = watch_task.poll_fd_index;
+    PERFETTO_DCHECK(fd_index < poll_fds_.size());
+    PERFETTO_DCHECK(::abs(poll_fds_[fd_index].fd) == fd);
+    poll_fds_[fd_index].fd = fd;
+#endif
+    task = watch_task.callback;
+  }
+  errno = 0;
+  RunTaskWithWatchdogGuard(task);
+}
+
+int UnixTaskRunner::GetDelayMsToNextTaskLocked() const {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  if (!immediate_tasks_.empty())
+    return 0;
+  if (!delayed_tasks_.empty()) {
+    TimeMillis diff = delayed_tasks_.begin()->first - GetWallTimeMs();
+    return std::max(0, static_cast<int>(diff.count()));
+  }
+  return -1;
+}
+
+void UnixTaskRunner::PostTask(std::function<void()> task) {
+  bool was_empty;
+  {
+    std::lock_guard<std::mutex> lock(lock_);
+    was_empty = immediate_tasks_.empty();
+    immediate_tasks_.push_back(std::move(task));
+  }
+  if (was_empty)
+    WakeUp();
+}
+
+void UnixTaskRunner::PostDelayedTask(std::function<void()> task,
+                                     uint32_t delay_ms) {
+  TimeMillis runtime = GetWallTimeMs() + TimeMillis(delay_ms);
+  {
+    std::lock_guard<std::mutex> lock(lock_);
+    delayed_tasks_.insert(std::make_pair(runtime, std::move(task)));
+  }
+  WakeUp();
+}
+
+void UnixTaskRunner::AddFileDescriptorWatch(PlatformHandle fd,
+                                            std::function<void()> task) {
+  PERFETTO_DCHECK(PlatformHandleChecker::IsValid(fd));
+  {
+    std::lock_guard<std::mutex> lock(lock_);
+    PERFETTO_DCHECK(!watch_tasks_.count(fd));
+    WatchTask& watch_task = watch_tasks_[fd];
+    watch_task.callback = std::move(task);
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+    watch_task.pending = false;
+#else
+    watch_task.poll_fd_index = SIZE_MAX;
+#endif
+    watch_tasks_changed_ = true;
+  }
+  WakeUp();
+}
+
+void UnixTaskRunner::RemoveFileDescriptorWatch(PlatformHandle fd) {
+  PERFETTO_DCHECK(PlatformHandleChecker::IsValid(fd));
+  {
+    std::lock_guard<std::mutex> lock(lock_);
+    PERFETTO_DCHECK(watch_tasks_.count(fd));
+    watch_tasks_.erase(fd);
+    watch_tasks_changed_ = true;
+  }
+  // No need to schedule a wake-up for this.
+}
+
+bool UnixTaskRunner::RunsTasksOnCurrentThread() const {
+  return GetThreadId() == created_thread_id_;
+}
+
+}  // namespace base
+}  // namespace perfetto
+// gen_amalgamated begin source: src/base/subprocess.cc
+// gen_amalgamated begin header: include/perfetto/ext/base/subprocess.h
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_SUBPROCESS_H_
+#define INCLUDE_PERFETTO_EXT_BASE_SUBPROCESS_H_
+
+#include <condition_variable>
+#include <functional>
+#include <initializer_list>
+#include <mutex>
+#include <string>
+#include <thread>
+#include <vector>
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/base/platform_handle.h"
+// gen_amalgamated expanded: #include "perfetto/base/proc_utils.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/event_fd.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/pipe.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/scoped_file.h"
+
+namespace perfetto {
+namespace base {
+
+// Handles creation and lifecycle management of subprocesses, taking care of
+// all subtleties involved in handling processes on UNIX.
+// This class allows to deal with macro two use-cases:
+// 1) fork() + exec() equivalent: for spawning a brand new process image.
+//    This happens when |args.exec_cmd| is not empty.
+//    This is safe to use even in a multi-threaded environment.
+// 2) fork(): for spawning a process and running a function.
+//    This happens when |args.posix_entrypoint_for_testing| is not empty.
+//    This is intended only for tests as it is extremely subtle.
+//    This mode must be used with extreme care. Before the entrypoint is
+//    invoked all file descriptors other than stdin/out/err and the ones
+//    specified in |args.preserve_fds| will be closed, to avoid each process
+//    retaining a dupe of other subprocesses pipes. This however means that
+//    any non trivial calls (including logging) must be avoided as they might
+//    refer to FDs that are now closed. The entrypoint should really be used
+//    just to signal a pipe or similar for synchronizing sequencing in tests.
+
+//
+// This class allows to control stdin/out/err pipe redirection and takes care
+// of keeping all the pipes pumped (stdin) / drained (stdout/err), in a similar
+// fashion of python's subprocess.Communicate()
+// stdin: is always piped and closed once the |args.input| buffer is written.
+// stdout/err can be either:
+//   - dup()ed onto the parent process stdout/err.
+//   - redirected onto /dev/null.
+//   - piped onto a buffer (see output() method). There is only one output
+//     buffer in total. If both stdout and stderr are set to kBuffer mode, they
+//     will be merged onto the same. There doesn't seem any use case where they
+//     are needed distinctly.
+//
+// Some caveats worth mentioning:
+// - It always waitpid()s, to avoid leaving zombies around. If the process is
+//   not terminated by the time the destructor is reached, the dtor will
+//   send a SIGKILL and wait for the termination.
+// - After fork()-ing it will close all file descriptors, preserving only
+//   stdin/out/err and the fds listed in |args.preserve_fds|.
+// - On Linux/Android, the child process will be SIGKILL-ed if the calling
+//   thread exists, even if the Subprocess is std::move()-d onto another thread.
+//   This happens by virtue PR_SET_PDEATHSIG, which is used to avoid that
+//   child processes are leaked in the case of a crash of the parent (frequent
+//   in tests). However, the child process might still be leaked if execing
+//   a setuid/setgid binary (see man 2 prctl).
+//
+// Usage:
+// base::Subprocess p({"/bin/cat", "-"});
+// (or equivalently:
+//     base::Subprocess p;
+//     p.args.exec_cmd.push_back("/bin/cat");
+//     p.args.exec_cmd.push_back("-");
+//  )
+// p.args.stdout_mode = base::Subprocess::kBuffer;
+// p.args.stderr_mode = base::Subprocess::kInherit;
+// p.args.input = "stdin contents";
+// p.Call();
+// (or equivalently:
+//     p.Start();
+//     p.Wait();
+// )
+// EXPECT_EQ(p.status(), base::Subprocess::kTerminated);
+// EXPECT_EQ(p.returncode(), 0);
+class Subprocess {
+ public:
+  enum Status {
+    kNotStarted = 0,  // Before calling Start() or Call().
+    kRunning,         // After calling Start(), before Wait().
+    kTerminated,      // The subprocess terminated, either successfully or not.
+                      // This includes crashes or other signals on UNIX.
+  };
+
+  enum OutputMode {
+    kInherit = 0,  // Inherit's the caller process stdout/stderr.
+    kDevNull,      // dup() onto /dev/null
+    kBuffer,       // dup() onto a pipe and move it into the output() buffer.
+    kFd,           // dup() onto the passed args.fd.
+  };
+
+  // Input arguments for configuring the subprocess behavior.
+  struct Args {
+    Args(std::initializer_list<std::string> _cmd = {}) : exec_cmd(_cmd) {}
+    Args(Args&&) noexcept;
+    Args& operator=(Args&&);
+    // If non-empty this will cause an exec() when Start()/Call() are called.
+    std::vector<std::string> exec_cmd;
+
+#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+    // If non-empty, it changes the argv[0] argument passed to exec. If
+    // unset, argv[0] == exec_cmd[0]. This is to handle cases like:
+    // exec_cmd = {"/proc/self/exec"}, argv0: "my_custom_test_override".
+    std::string posix_argv0_override_for_testing;
+
+    // If non-empty this will be invoked on the fork()-ed child process, after
+    // stdin/out/err has been redirected and all other file descriptor are
+    // closed. It is valid to specify both |exec_cmd| AND
+    // |posix_entrypoint_for_testing|. In this case the latter will be invoked
+    // just before the exec() call, but after having closed all fds % stdin/o/e.
+    // This is for synchronization barriers in tests.
+    std::function<void()> posix_entrypoint_for_testing;
+#endif
+
+    // If non-empty, replaces the environment passed to exec().
+    std::vector<std::string> env;
+
+    // The file descriptors in this list will not be closed.
+    std::vector<int> preserve_fds;
+
+    // The data to push in the child process stdin.
+    std::string input;
+
+    OutputMode stdout_mode = kInherit;
+    OutputMode stderr_mode = kInherit;
+
+    base::ScopedPlatformHandle out_fd;
+
+    // Returns " ".join(exec_cmd), quoting arguments.
+    std::string GetCmdString() const;
+  };
+
+  struct ResourceUsage {
+    uint32_t cpu_utime_ms = 0;
+    uint32_t cpu_stime_ms = 0;
+    uint32_t max_rss_kb = 0;
+    uint32_t min_page_faults = 0;
+    uint32_t maj_page_faults = 0;
+    uint32_t vol_ctx_switch = 0;
+    uint32_t invol_ctx_switch = 0;
+
+    uint32_t cpu_time_ms() const { return cpu_utime_ms + cpu_stime_ms; }
+  };
+
+  explicit Subprocess(std::initializer_list<std::string> exec_cmd = {});
+  Subprocess(Subprocess&&) noexcept;
+  Subprocess& operator=(Subprocess&&);
+  ~Subprocess();  // It will KillAndWaitForTermination() if still alive.
+
+  // Starts the subprocess but doesn't wait for its termination. The caller
+  // is expected to either call Wait() or Poll() after this call.
+  void Start();
+
+  // Wait for process termination. Can be called more than once.
+  // Args:
+  //   |timeout_ms| = 0: wait indefinitely.
+  //   |timeout_ms| > 0: wait for at most |timeout_ms|.
+  // Returns:
+  //  True: The process terminated. See status() and returncode().
+  //  False: Timeout reached, the process is still running. In this case the
+  //         process will be left in the kRunning state.
+  bool Wait(int timeout_ms = 0);
+
+  // Equivalent of Start() + Wait();
+  // Returns true if the process exited cleanly with return code 0. False in
+  // any othe case.
+  bool Call(int timeout_ms = 0);
+
+  Status Poll();
+
+  // Sends a signal (SIGKILL if not specified) and wait for process termination.
+  void KillAndWaitForTermination(int sig_num = 0);
+
+  PlatformProcessId pid() const { return s_->pid; }
+
+  // The accessors below are updated only after a call to Poll(), Wait() or
+  // KillAndWaitForTermination().
+  // In most cases you want to call Poll() rather than these accessors.
+
+  Status status() const { return s_->status; }
+  int returncode() const { return s_->returncode; }
+  bool timed_out() const { return s_->timed_out; }
+
+  // This contains both stdout and stderr (if the corresponding _mode ==
+  // kBuffer). It's non-const so the caller can std::move() it.
+  std::string& output() { return s_->output; }
+  const std::string& output() const { return s_->output; }
+
+  const ResourceUsage& posix_rusage() const { return *s_->rusage; }
+
+  Args args;
+
+ private:
+  // The signal/exit code used when killing the process in case of a timeout.
+  static const int kTimeoutSignal;
+
+  Subprocess(const Subprocess&) = delete;
+  Subprocess& operator=(const Subprocess&) = delete;
+
+  // This is to deal robustly with the move operators, without having to
+  // manually maintain member-wise move instructions.
+  struct MovableState {
+    base::Pipe stdin_pipe;
+    base::Pipe stdouterr_pipe;
+    PlatformProcessId pid;
+    Status status = kNotStarted;
+    int returncode = -1;
+    std::string output;  // Stdin+stderr. Only when kBuffer.
+    std::unique_ptr<ResourceUsage> rusage{new ResourceUsage()};
+    bool timed_out = false;
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+    std::thread stdouterr_thread;
+    std::thread stdin_thread;
+    ScopedPlatformHandle win_proc_handle;
+    ScopedPlatformHandle win_thread_handle;
+
+    base::EventFd stdouterr_done_event;
+    std::mutex mutex;  // Protects locked_outerr_buf and the two pipes.
+    std::string locked_outerr_buf;
+#else
+    base::Pipe exit_status_pipe;
+    size_t input_written = 0;
+    std::thread waitpid_thread;
+#endif
+  };
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  static void StdinThread(MovableState*, std::string input);
+  static void StdoutErrThread(MovableState*);
+#else
+  void TryPushStdin();
+  void TryReadStdoutAndErr();
+  void TryReadExitStatus();
+  void KillAtMostOnce();
+  bool PollInternal(int poll_timeout_ms);
+#endif
+
+  std::unique_ptr<MovableState> s_;
+};
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_SUBPROCESS_H_
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/subprocess.h"
+
+#include <tuple>
+
+// This file contains only the common bits (ctors / dtors / move operators).
+// The rest lives in subprocess_posix.cc and subprocess_windows.cc.
+
+namespace perfetto {
+namespace base {
+
+Subprocess::Args::Args(Args&&) noexcept = default;
+Subprocess::Args& Subprocess::Args::operator=(Args&&) = default;
+
+Subprocess::Subprocess(std::initializer_list<std::string> a)
+    : args(a), s_(new MovableState()) {}
+
+Subprocess::Subprocess(Subprocess&& other) noexcept {
+  static_assert(sizeof(Subprocess) ==
+                    sizeof(std::tuple<std::unique_ptr<MovableState>, Args>),
+                "base::Subprocess' move ctor needs updating");
+  s_ = std::move(other.s_);
+  args = std::move(other.args);
+
+  // Reset the state of the moved-from object.
+  other.s_.reset(new MovableState());
+  other.~Subprocess();
+  new (&other) Subprocess();
+}
+
+Subprocess& Subprocess::operator=(Subprocess&& other) {
+  this->~Subprocess();
+  new (this) Subprocess(std::move(other));
+  return *this;
+}
+
+Subprocess::~Subprocess() {
+  if (s_->status == kRunning)
+    KillAndWaitForTermination();
+}
+
+bool Subprocess::Call(int timeout_ms) {
+  PERFETTO_CHECK(s_->status == kNotStarted);
+  Start();
+
+  if (!Wait(timeout_ms)) {
+    s_->timed_out = true;
+    KillAndWaitForTermination(kTimeoutSignal);
+  }
+  PERFETTO_DCHECK(s_->status != kRunning);
+  return s_->status == kTerminated && s_->returncode == 0;
+}
+
+std::string Subprocess::Args::GetCmdString() const {
+  std::string str;
+  for (size_t i = 0; i < exec_cmd.size(); i++) {
+    str += i > 0 ? " \"" : "";
+    str += exec_cmd[i];
+    str += i > 0 ? "\"" : "";
+  }
+  return str;
+}
+
+}  // namespace base
+}  // namespace perfetto
+// gen_amalgamated begin source: src/base/subprocess_posix.cc
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/subprocess.h"
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) ||   \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+
+#include <fcntl.h>
+#include <poll.h>
+#include <signal.h>
+#include <stdio.h>
+#include <sys/resource.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <unistd.h>
+
+#include <algorithm>
+#include <thread>
+#include <tuple>
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+#include <sys/prctl.h>
+#endif
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/base/time.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+
+// In MacOS this is not defined in any header.
+extern "C" char** environ;
+
+namespace perfetto {
+namespace base {
+
+namespace {
+
+struct ChildProcessArgs {
+  Subprocess::Args* create_args;
+  const char* exec_cmd = nullptr;
+  std::vector<char*> argv;
+  std::vector<char*> env;
+  int stdin_pipe_rd = -1;
+  int stdouterr_pipe_wr = -1;
+};
+
+// Don't add any dynamic allocation in this function. This will be invoked
+// under a fork(), potentially in a state where the allocator lock is held.
+void __attribute__((noreturn)) ChildProcess(ChildProcessArgs* args) {
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+  // In no case we want a child process to outlive its parent process. This is
+  // relevant for tests, so that a test failure/crash doesn't leave child
+  // processes around that get reparented to init.
+  prctl(PR_SET_PDEATHSIG, SIGKILL);
+#endif
+
+  auto die = [args](const char* err) __attribute__((noreturn)) {
+    base::ignore_result(write(args->stdouterr_pipe_wr, err, strlen(err)));
+    base::ignore_result(write(args->stdouterr_pipe_wr, "\n", 1));
+    // From https://www.gnu.org/software/libc/manual/html_node/Exit-Status.html
+    // "In particular, the value 128 is used to indicate failure to execute
+    // another program in a subprocess. This convention is not universally
+    // obeyed, but it is a good idea to follow it in your programs."
+    _exit(128);
+  };
+
+  auto set_fd_close_on_exec = [&die](int fd, bool close_on_exec) {
+    int flags = fcntl(fd, F_GETFD, 0);
+    if (flags < 0)
+      die("fcntl(F_GETFD) failed");
+    flags = close_on_exec ? (flags | FD_CLOEXEC) : (flags & ~FD_CLOEXEC);
+    if (fcntl(fd, F_SETFD, flags) < 0)
+      die("fcntl(F_SETFD) failed");
+  };
+
+  if (getppid() == 1)
+    die("terminating because parent process died");
+
+  if (dup2(args->stdin_pipe_rd, STDIN_FILENO) == -1)
+    die("Failed to dup2(STDIN)");
+  close(args->stdin_pipe_rd);
+
+  switch (args->create_args->stdout_mode) {
+    case Subprocess::kInherit:
+      break;
+    case Subprocess::kDevNull: {
+      if (dup2(open("/dev/null", O_RDWR), STDOUT_FILENO) == -1)
+        die("Failed to dup2(STDOUT)");
+      break;
+    }
+    case Subprocess::kBuffer:
+      if (dup2(args->stdouterr_pipe_wr, STDOUT_FILENO) == -1)
+        die("Failed to dup2(STDOUT)");
+      break;
+    case Subprocess::kFd:
+      if (dup2(*args->create_args->out_fd, STDOUT_FILENO) == -1)
+        die("Failed to dup2(STDOUT)");
+      break;
+  }
+
+  switch (args->create_args->stderr_mode) {
+    case Subprocess::kInherit:
+      break;
+    case Subprocess::kDevNull: {
+      if (dup2(open("/dev/null", O_RDWR), STDERR_FILENO) == -1)
+        die("Failed to dup2(STDERR)");
+      break;
+    }
+    case Subprocess::kBuffer:
+      if (dup2(args->stdouterr_pipe_wr, STDERR_FILENO) == -1)
+        die("Failed to dup2(STDERR)");
+      break;
+    case Subprocess::kFd:
+      if (dup2(*args->create_args->out_fd, STDERR_FILENO) == -1)
+        die("Failed to dup2(STDERR)");
+      break;
+  }
+
+  // Close all FDs % stdin/out/err and the ones that the client explicitly
+  // asked to retain. The reason for this is twofold:
+  // 1. For exec-only (i.e. entrypoint == empty) cases: it avoids leaking FDs
+  //    that didn't get marked as O_CLOEXEC by accident.
+  // 2. In fork() mode (entrypoint not empty) avoids retaining a dup of eventfds
+  //    that would prevent the parent process to receive EOFs (tests usually use
+  //    pipes as a synchronization mechanism between subprocesses).
+  const auto& preserve_fds = args->create_args->preserve_fds;
+  for (int i = 0; i < 512; i++) {
+    if (i != STDIN_FILENO && i != STDERR_FILENO && i != STDOUT_FILENO &&
+        i != args->stdouterr_pipe_wr &&
+        !std::count(preserve_fds.begin(), preserve_fds.end(), i)) {
+      close(i);
+    }
+  }
+
+  // Clears O_CLOEXEC from stdin/out/err. These are the only FDs that we want
+  // to be preserved after the exec().
+  set_fd_close_on_exec(STDIN_FILENO, false);
+  set_fd_close_on_exec(STDOUT_FILENO, false);
+  set_fd_close_on_exec(STDERR_FILENO, false);
+
+  // If the caller specified a std::function entrypoint, run that first.
+  if (args->create_args->posix_entrypoint_for_testing)
+    args->create_args->posix_entrypoint_for_testing();
+
+  // If the caller specified only an entrypoint, without any args, exit now.
+  // Otherwise proceed with the exec() below.
+  if (!args->exec_cmd)
+    _exit(0);
+
+  // If |args[0]| is a path use execv() (which takes a path), othewise use
+  // exevp(), which uses the shell and follows PATH.
+  if (strchr(args->exec_cmd, '/')) {
+    char** env = args->env.empty() ? environ : args->env.data();
+    execve(args->exec_cmd, args->argv.data(), env);
+  } else {
+    // There is no execvpe() on Mac.
+    if (!args->env.empty())
+      die("A full path is required for |exec_cmd| when setting |env|");
+    execvp(args->exec_cmd, args->argv.data());
+  }
+
+  // Reached only if execv fails.
+  die("execve() failed");
+}
+
+}  // namespace
+
+// static
+const int Subprocess::kTimeoutSignal = SIGKILL;
+
+void Subprocess::Start() {
+  ChildProcessArgs proc_args;
+  proc_args.create_args = &args;
+
+  // Setup argv.
+  if (!args.exec_cmd.empty()) {
+    proc_args.exec_cmd = args.exec_cmd[0].c_str();
+    for (const std::string& arg : args.exec_cmd)
+      proc_args.argv.push_back(const_cast<char*>(arg.c_str()));
+    proc_args.argv.push_back(nullptr);
+
+    if (!args.posix_argv0_override_for_testing.empty()) {
+      proc_args.argv[0] =
+          const_cast<char*>(args.posix_argv0_override_for_testing.c_str());
+    }
+  }
+
+  // Setup env.
+  if (!args.env.empty()) {
+    for (const std::string& str : args.env)
+      proc_args.env.push_back(const_cast<char*>(str.c_str()));
+    proc_args.env.push_back(nullptr);
+  }
+
+  // Setup the pipes for stdin/err redirection.
+  s_->stdin_pipe = base::Pipe::Create(base::Pipe::kWrNonBlock);
+  proc_args.stdin_pipe_rd = *s_->stdin_pipe.rd;
+  s_->stdouterr_pipe = base::Pipe::Create(base::Pipe::kRdNonBlock);
+  proc_args.stdouterr_pipe_wr = *s_->stdouterr_pipe.wr;
+
+  // Spawn the child process that will exec().
+  s_->pid = fork();
+  PERFETTO_CHECK(s_->pid >= 0);
+  if (s_->pid == 0) {
+    // Close the parent-ends of the pipes.
+    s_->stdin_pipe.wr.reset();
+    s_->stdouterr_pipe.rd.reset();
+    ChildProcess(&proc_args);
+    // ChildProcess() doesn't return, not even in case of failures.
+    PERFETTO_FATAL("not reached");
+  }
+
+  s_->status = kRunning;
+
+  // Close the child-end of the pipes.
+  // Deliberately NOT closing the s_->stdin_pipe.rd. This is to avoid crashing
+  // with a SIGPIPE if the process exits without consuming its stdin, while
+  // the parent tries to write() on the other end of the stdin pipe.
+  s_->stdouterr_pipe.wr.reset();
+  proc_args.create_args->out_fd.reset();
+
+  // Spawn a thread that is blocked on waitpid() and writes the termination
+  // status onto a pipe. The problem here is that waipid() doesn't have a
+  // timeout option and can't be passed to poll(). The alternative would be
+  // using a SIGCHLD handler, but anecdotally signal handlers introduce more
+  // problems than what they solve.
+  s_->exit_status_pipe = base::Pipe::Create(base::Pipe::kRdNonBlock);
+
+  // Both ends of the pipe are closed after the thread.join().
+  int pid = s_->pid;
+  int exit_status_pipe_wr = s_->exit_status_pipe.wr.release();
+  auto* rusage = s_->rusage.get();
+  s_->waitpid_thread = std::thread([pid, exit_status_pipe_wr, rusage] {
+    int pid_stat = -1;
+    struct rusage usg {};
+    int wait_res = PERFETTO_EINTR(wait4(pid, &pid_stat, 0, &usg));
+    PERFETTO_CHECK(wait_res == pid);
+
+    auto tv_to_ms = [](const struct timeval& tv) {
+      return static_cast<uint32_t>(tv.tv_sec * 1000 + tv.tv_usec / 1000);
+    };
+    rusage->cpu_utime_ms = tv_to_ms(usg.ru_utime);
+    rusage->cpu_stime_ms = tv_to_ms(usg.ru_stime);
+    rusage->max_rss_kb = static_cast<uint32_t>(usg.ru_maxrss) / 1000;
+    rusage->min_page_faults = static_cast<uint32_t>(usg.ru_minflt);
+    rusage->maj_page_faults = static_cast<uint32_t>(usg.ru_majflt);
+    rusage->vol_ctx_switch = static_cast<uint32_t>(usg.ru_nvcsw);
+    rusage->invol_ctx_switch = static_cast<uint32_t>(usg.ru_nivcsw);
+
+    base::ignore_result(PERFETTO_EINTR(
+        write(exit_status_pipe_wr, &pid_stat, sizeof(pid_stat))));
+    PERFETTO_CHECK(close(exit_status_pipe_wr) == 0 || errno == EINTR);
+  });
+}
+
+Subprocess::Status Subprocess::Poll() {
+  if (s_->status != kRunning)
+    return s_->status;  // Nothing to poll.
+  while (PollInternal(0 /* don't block*/)) {
+  }
+  return s_->status;
+}
+
+// |timeout_ms| semantic:
+//   -1: Block indefinitely.
+//    0: Don't block, return immediately.
+//   >0: Block for at most X ms.
+// Returns:
+//  True: Read at least one fd (so there might be more queued).
+//  False: if all fds reached quiescent (no data to read/write).
+bool Subprocess::PollInternal(int poll_timeout_ms) {
+  struct pollfd fds[3]{};
+  size_t num_fds = 0;
+  if (s_->exit_status_pipe.rd) {
+    fds[num_fds].fd = *s_->exit_status_pipe.rd;
+    fds[num_fds].events = POLLIN;
+    num_fds++;
+  }
+  if (s_->stdouterr_pipe.rd) {
+    fds[num_fds].fd = *s_->stdouterr_pipe.rd;
+    fds[num_fds].events = POLLIN;
+    num_fds++;
+  }
+  if (s_->stdin_pipe.wr) {
+    fds[num_fds].fd = *s_->stdin_pipe.wr;
+    fds[num_fds].events = POLLOUT;
+    num_fds++;
+  }
+
+  if (num_fds == 0)
+    return false;
+
+  auto nfds = static_cast<nfds_t>(num_fds);
+  int poll_res = PERFETTO_EINTR(poll(fds, nfds, poll_timeout_ms));
+  PERFETTO_CHECK(poll_res >= 0);
+
+  TryReadStdoutAndErr();
+  TryPushStdin();
+  TryReadExitStatus();
+
+  return poll_res > 0;
+}
+
+bool Subprocess::Wait(int timeout_ms) {
+  PERFETTO_CHECK(s_->status != kNotStarted);
+
+  // Break out of the loop only after both conditions are satisfied:
+  // - All stdout/stderr data has been read (if kBuffer).
+  // - The process exited.
+  // Note that the two events can happen arbitrary order. After the process
+  // exits, there might be still data in the pipe buffer, which we want to
+  // read fully.
+  //
+  // Instead, don't wait on the stdin to be fully written. The child process
+  // might exit prematurely (or crash). If that happens, we can end up in a
+  // state where the write(stdin_pipe_.wr) will never unblock.
+
+  const int64_t t_start = base::GetWallTimeMs().count();
+  while (s_->exit_status_pipe.rd || s_->stdouterr_pipe.rd) {
+    int poll_timeout_ms = -1;  // Block until a FD is ready.
+    if (timeout_ms > 0) {
+      const int64_t now = GetWallTimeMs().count();
+      poll_timeout_ms = timeout_ms - static_cast<int>(now - t_start);
+      if (poll_timeout_ms <= 0)
+        return false;
+    }
+    PollInternal(poll_timeout_ms);
+  }  // while(...)
+  return true;
+}
+
+void Subprocess::TryReadExitStatus() {
+  if (!s_->exit_status_pipe.rd)
+    return;
+
+  int pid_stat = -1;
+  int64_t rsize = PERFETTO_EINTR(
+      read(*s_->exit_status_pipe.rd, &pid_stat, sizeof(pid_stat)));
+  if (rsize < 0 && errno == EAGAIN)
+    return;
+
+  if (rsize > 0) {
+    PERFETTO_CHECK(rsize == sizeof(pid_stat));
+  } else if (rsize < 0) {
+    PERFETTO_PLOG("Subprocess read(s_->exit_status_pipe) failed");
+  }
+  s_->waitpid_thread.join();
+  s_->exit_status_pipe.rd.reset();
+
+  s_->status = kTerminated;
+  if (WIFEXITED(pid_stat)) {
+    s_->returncode = WEXITSTATUS(pid_stat);
+  } else if (WIFSIGNALED(pid_stat)) {
+    s_->returncode = 128 + WTERMSIG(pid_stat);  // Follow bash convention.
+  } else {
+    PERFETTO_FATAL("waitpid() returned an unexpected value (0x%x)", pid_stat);
+  }
+}
+
+// If the stidn pipe is still open, push input data and close it at the end.
+void Subprocess::TryPushStdin() {
+  if (!s_->stdin_pipe.wr)
+    return;
+
+  PERFETTO_DCHECK(args.input.empty() || s_->input_written < args.input.size());
+  if (!args.input.empty()) {
+    int64_t wsize =
+        PERFETTO_EINTR(write(*s_->stdin_pipe.wr, &args.input[s_->input_written],
+                             args.input.size() - s_->input_written));
+    if (wsize < 0 && errno == EAGAIN)
+      return;
+
+    if (wsize >= 0) {
+      // Whether write() can return 0 is one of the greatest mysteries of UNIX.
+      // Just ignore it.
+      s_->input_written += static_cast<size_t>(wsize);
+    } else {
+      PERFETTO_PLOG("Subprocess write(stdin) failed");
+      s_->stdin_pipe.wr.reset();
+    }
+  }
+  PERFETTO_DCHECK(s_->input_written <= args.input.size());
+  if (s_->input_written == args.input.size())
+    s_->stdin_pipe.wr.reset();  // Close stdin.
+}
+
+void Subprocess::TryReadStdoutAndErr() {
+  if (!s_->stdouterr_pipe.rd)
+    return;
+  char buf[4096];
+  int64_t rsize =
+      PERFETTO_EINTR(read(*s_->stdouterr_pipe.rd, buf, sizeof(buf)));
+  if (rsize < 0 && errno == EAGAIN)
+    return;
+
+  if (rsize > 0) {
+    s_->output.append(buf, static_cast<size_t>(rsize));
+  } else if (rsize == 0 /* EOF */) {
+    s_->stdouterr_pipe.rd.reset();
+  } else {
+    PERFETTO_PLOG("Subprocess read(stdout/err) failed");
+    s_->stdouterr_pipe.rd.reset();
+  }
+}
+
+void Subprocess::KillAndWaitForTermination(int sig_num) {
+  kill(s_->pid, sig_num ? sig_num : SIGKILL);
+  Wait();
+  // TryReadExitStatus must have joined the thread.
+  PERFETTO_DCHECK(!s_->waitpid_thread.joinable());
+}
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // PERFETTO_OS_LINUX || PERFETTO_OS_ANDROID || PERFETTO_OS_APPLE
+// gen_amalgamated begin source: src/base/subprocess_windows.cc
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/subprocess.h"
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+
+#include <stdio.h>
+
+#include <algorithm>
+#include <mutex>
+#include <tuple>
+
+#include <Windows.h>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/base/time.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/pipe.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+
+namespace perfetto {
+namespace base {
+
+// static
+const int Subprocess::kTimeoutSignal = static_cast<int>(STATUS_TIMEOUT);
+
+void Subprocess::Start() {
+  if (args.exec_cmd.empty()) {
+    PERFETTO_ELOG("Subprocess.exec_cmd cannot be empty on Windows");
+    return;
+  }
+
+  // Quote arguments but only when ambiguous. When quoting, CreateProcess()
+  // assumes that the command is an absolute path and does not search in the
+  // %PATH%. If non quoted, instead, CreateProcess() tries both. This is to
+  // allow Subprocess("cmd.exe", "/c", "shell command").
+  std::string cmd;
+  for (const auto& part : args.exec_cmd) {
+    if (part.find(" ") != std::string::npos) {
+      cmd += "\"" + part + "\" ";
+    } else {
+      cmd += part + " ";
+    }
+  }
+  // Remove trailing space.
+  if (!cmd.empty())
+    cmd.resize(cmd.size() - 1);
+
+  s_->stdin_pipe = Pipe::Create();
+  // Allow the child process to inherit the other end of the pipe.
+  PERFETTO_CHECK(
+      ::SetHandleInformation(*s_->stdin_pipe.rd, HANDLE_FLAG_INHERIT, 1));
+
+  if (args.stderr_mode == kBuffer || args.stdout_mode == kBuffer) {
+    s_->stdouterr_pipe = Pipe::Create();
+    PERFETTO_CHECK(
+        ::SetHandleInformation(*s_->stdouterr_pipe.wr, HANDLE_FLAG_INHERIT, 1));
+  }
+
+  ScopedPlatformHandle nul_handle;
+  if (args.stderr_mode == kDevNull || args.stdout_mode == kDevNull) {
+    nul_handle.reset(::CreateFileA("NUL", GENERIC_WRITE, FILE_SHARE_WRITE,
+                                   nullptr, OPEN_EXISTING,
+                                   FILE_ATTRIBUTE_NORMAL, nullptr));
+    PERFETTO_CHECK(::SetHandleInformation(*nul_handle, HANDLE_FLAG_INHERIT, 1));
+  }
+
+  PROCESS_INFORMATION proc_info{};
+  STARTUPINFOA start_info{};
+  start_info.cb = sizeof(STARTUPINFOA);
+
+  if (args.stderr_mode == kInherit) {
+    start_info.hStdError = ::GetStdHandle(STD_ERROR_HANDLE);
+  } else if (args.stderr_mode == kBuffer) {
+    start_info.hStdError = *s_->stdouterr_pipe.wr;
+  } else if (args.stderr_mode == kDevNull) {
+    start_info.hStdError = *nul_handle;
+  } else if (args.stderr_mode == kFd) {
+    PERFETTO_CHECK(
+        ::SetHandleInformation(*args.out_fd, HANDLE_FLAG_INHERIT, 1));
+    start_info.hStdError = *args.out_fd;
+  } else {
+    PERFETTO_CHECK(false);
+  }
+
+  if (args.stdout_mode == kInherit) {
+    start_info.hStdOutput = ::GetStdHandle(STD_OUTPUT_HANDLE);
+  } else if (args.stdout_mode == kBuffer) {
+    start_info.hStdOutput = *s_->stdouterr_pipe.wr;
+  } else if (args.stdout_mode == kDevNull) {
+    start_info.hStdOutput = *nul_handle;
+  } else if (args.stdout_mode == kFd) {
+    PERFETTO_CHECK(
+        ::SetHandleInformation(*args.out_fd, HANDLE_FLAG_INHERIT, 1));
+    start_info.hStdOutput = *args.out_fd;
+  } else {
+    PERFETTO_CHECK(false);
+  }
+
+  start_info.hStdInput = *s_->stdin_pipe.rd;
+  start_info.dwFlags |= STARTF_USESTDHANDLES;
+
+  // Create the child process.
+  bool success =
+      ::CreateProcessA(nullptr,      // App name. Needs to be null to use PATH.
+                       &cmd[0],      // Command line.
+                       nullptr,      // Process security attributes.
+                       nullptr,      // Primary thread security attributes.
+                       true,         // Handles are inherited.
+                       0,            // Flags.
+                       nullptr,      // Use parent's environment.
+                       nullptr,      // Use parent's current directory.
+                       &start_info,  // STARTUPINFO pointer.
+                       &proc_info);  // Receives PROCESS_INFORMATION.
+
+  // Close on our side the pipe ends that we passed to the child process.
+  s_->stdin_pipe.rd.reset();
+  s_->stdouterr_pipe.wr.reset();
+  args.out_fd.reset();
+
+  if (!success) {
+    s_->returncode = ERROR_FILE_NOT_FOUND;
+    s_->status = kTerminated;
+    s_->stdin_pipe.wr.reset();
+    s_->stdouterr_pipe.rd.reset();
+    PERFETTO_ELOG("CreateProcess failed: %lx, cmd: %s", GetLastError(),
+                  &cmd[0]);
+    return;
+  }
+
+  s_->pid = proc_info.dwProcessId;
+  s_->win_proc_handle = ScopedPlatformHandle(proc_info.hProcess);
+  s_->win_thread_handle = ScopedPlatformHandle(proc_info.hThread);
+  s_->status = kRunning;
+
+  MovableState* s = s_.get();
+  s_->stdin_thread = std::thread(&Subprocess::StdinThread, s, args.input);
+
+  if (args.stderr_mode == kBuffer || args.stdout_mode == kBuffer) {
+    PERFETTO_DCHECK(s_->stdouterr_pipe.rd);
+    s_->stdouterr_thread = std::thread(&Subprocess::StdoutErrThread, s);
+  }
+}
+
+// static
+void Subprocess::StdinThread(MovableState* s, std::string input) {
+  size_t input_written = 0;
+  while (input_written < input.size()) {
+    DWORD wsize = 0;
+    if (::WriteFile(*s->stdin_pipe.wr, input.data() + input_written,
+                    static_cast<DWORD>(input.size() - input_written), &wsize,
+                    nullptr)) {
+      input_written += wsize;
+    } else {
+      // ERROR_BROKEN_PIPE is WAI when the child just closes stdin and stops
+      // accepting input.
+      auto err = ::GetLastError();
+      if (err != ERROR_BROKEN_PIPE)
+        PERFETTO_PLOG("Subprocess WriteFile(stdin) failed %lx", err);
+      break;
+    }
+  }  // while(...)
+  std::unique_lock<std::mutex> lock(s->mutex);
+  s->stdin_pipe.wr.reset();
+}
+
+// static
+void Subprocess::StdoutErrThread(MovableState* s) {
+  char buf[4096];
+  for (;;) {
+    DWORD rsize = 0;
+    bool res =
+        ::ReadFile(*s->stdouterr_pipe.rd, buf, sizeof(buf), &rsize, nullptr);
+    if (!res) {
+      auto err = GetLastError();
+      if (err != ERROR_BROKEN_PIPE)
+        PERFETTO_PLOG("Subprocess ReadFile(stdouterr) failed %ld", err);
+    }
+
+    if (rsize > 0) {
+      std::unique_lock<std::mutex> lock(s->mutex);
+      s->locked_outerr_buf.append(buf, static_cast<size_t>(rsize));
+    } else {  // EOF or some error.
+      break;
+    }
+  }  // For(..)
+
+  // Close the stdouterr_pipe. The main loop looks at the pipe closure to
+  // determine whether the stdout/err thread has completed.
+  {
+    std::unique_lock<std::mutex> lock(s->mutex);
+    s->stdouterr_pipe.rd.reset();
+  }
+  s->stdouterr_done_event.Notify();
+}
+
+Subprocess::Status Subprocess::Poll() {
+  if (s_->status != kRunning)
+    return s_->status;  // Nothing to poll.
+  Wait(1 /*ms*/);
+  return s_->status;
+}
+
+bool Subprocess::Wait(int timeout_ms) {
+  PERFETTO_CHECK(s_->status != kNotStarted);
+  const bool wait_forever = timeout_ms == 0;
+  const int64_t wait_start_ms = base::GetWallTimeMs().count();
+
+  // Break out of the loop only after both conditions are satisfied:
+  // - All stdout/stderr data has been read (if kBuffer).
+  // - The process exited.
+  // Note that the two events can happen arbitrary order. After the process
+  // exits, there might be still data in the pipe buffer, which we want to
+  // read fully.
+  // Note also that stdout/err might be "complete" before starting, if neither
+  // is operating in kBuffer mode. In that case we just want to wait for the
+  // process termination.
+  //
+  // Instead, don't wait on the stdin to be fully written. The child process
+  // might exit prematurely (or crash). If that happens, we can end up in a
+  // state where the write(stdin_pipe_.wr) will never unblock.
+  bool stdouterr_complete = false;
+  for (;;) {
+    HANDLE wait_handles[2]{};
+    DWORD num_handles = 0;
+
+    // Check if the process exited.
+    bool process_exited = !s_->win_proc_handle;
+    if (!process_exited) {
+      DWORD exit_code = STILL_ACTIVE;
+      PERFETTO_CHECK(::GetExitCodeProcess(*s_->win_proc_handle, &exit_code));
+      if (exit_code != STILL_ACTIVE) {
+        s_->returncode = static_cast<int>(exit_code);
+        s_->status = kTerminated;
+        s_->win_proc_handle.reset();
+        s_->win_thread_handle.reset();
+        process_exited = true;
+      }
+    } else {
+      PERFETTO_DCHECK(s_->status != kRunning);
+    }
+    if (!process_exited) {
+      wait_handles[num_handles++] = *s_->win_proc_handle;
+    }
+
+    // Check if there is more output and if the stdout/err pipe has been closed.
+    {
+      std::unique_lock<std::mutex> lock(s_->mutex);
+      // Move the output from the internal buffer shared with the
+      // stdouterr_thread to the final buffer exposed to the client.
+      if (!s_->locked_outerr_buf.empty()) {
+        s_->output.append(std::move(s_->locked_outerr_buf));
+        s_->locked_outerr_buf.clear();
+      }
+      stdouterr_complete = !s_->stdouterr_pipe.rd;
+      if (!stdouterr_complete) {
+        wait_handles[num_handles++] = s_->stdouterr_done_event.fd();
+      }
+    }  // lock(s_->mutex)
+
+    if (num_handles == 0) {
+      PERFETTO_DCHECK(process_exited && stdouterr_complete);
+      break;
+    }
+
+    DWORD wait_ms;  // Note: DWORD is unsigned.
+    if (wait_forever) {
+      wait_ms = INFINITE;
+    } else {
+      const int64_t now = GetWallTimeMs().count();
+      const int64_t wait_left_ms = timeout_ms - (now - wait_start_ms);
+      if (wait_left_ms <= 0)
+        return false;  // Timed out
+      wait_ms = static_cast<DWORD>(wait_left_ms);
+    }
+
+    auto wait_res =
+        ::WaitForMultipleObjects(num_handles, wait_handles, false, wait_ms);
+    PERFETTO_CHECK(wait_res != WAIT_FAILED);
+  }
+
+  PERFETTO_DCHECK(!s_->win_proc_handle);
+  PERFETTO_DCHECK(!s_->win_thread_handle);
+
+  if (s_->stdin_thread.joinable())  // Might not exist if CreateProcess failed.
+    s_->stdin_thread.join();
+  if (s_->stdouterr_thread.joinable())
+    s_->stdouterr_thread.join();
+
+  // The stdin pipe is closed by the dedicated stdin thread. However if that is
+  // not started (e.g. because of no redirection) force close it now. Needs to
+  // happen after the join() to be thread safe.
+  s_->stdin_pipe.wr.reset();
+  s_->stdouterr_pipe.rd.reset();
+
+  return true;
+}
+
+void Subprocess::KillAndWaitForTermination(int exit_code) {
+  auto code = exit_code ? static_cast<DWORD>(exit_code) : STATUS_CONTROL_C_EXIT;
+  ::TerminateProcess(*s_->win_proc_handle, code);
+  Wait();
+  // TryReadExitStatus must have joined the threads.
+  PERFETTO_DCHECK(!s_->stdin_thread.joinable());
+  PERFETTO_DCHECK(!s_->stdouterr_thread.joinable());
+}
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // PERFETTO_OS_WIN
+// gen_amalgamated begin source: src/protozero/field.cc
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field.h"
+
+// gen_amalgamated expanded: #include "perfetto/base/compiler.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+
+#if !PERFETTO_IS_LITTLE_ENDIAN()
+// The memcpy() for fixed32/64 below needs to be adjusted if we want to
+// support big endian CPUs. There doesn't seem to be a compelling need today.
+#error Unimplemented for big endian archs.
+#endif
+
+namespace protozero {
+
+template <typename Container>
+void Field::SerializeAndAppendToInternal(Container* dst) const {
+  namespace pu = proto_utils;
+  size_t initial_size = dst->size();
+  dst->resize(initial_size + pu::kMaxSimpleFieldEncodedSize + size_);
+  uint8_t* start = reinterpret_cast<uint8_t*>(&(*dst)[initial_size]);
+  uint8_t* wptr = start;
+  switch (type_) {
+    case static_cast<int>(pu::ProtoWireType::kVarInt): {
+      wptr = pu::WriteVarInt(pu::MakeTagVarInt(id_), wptr);
+      wptr = pu::WriteVarInt(int_value_, wptr);
+      break;
+    }
+    case static_cast<int>(pu::ProtoWireType::kFixed32): {
+      wptr = pu::WriteVarInt(pu::MakeTagFixed<uint32_t>(id_), wptr);
+      uint32_t value32 = static_cast<uint32_t>(int_value_);
+      memcpy(wptr, &value32, sizeof(value32));
+      wptr += sizeof(uint32_t);
+      break;
+    }
+    case static_cast<int>(pu::ProtoWireType::kFixed64): {
+      wptr = pu::WriteVarInt(pu::MakeTagFixed<uint64_t>(id_), wptr);
+      memcpy(wptr, &int_value_, sizeof(int_value_));
+      wptr += sizeof(uint64_t);
+      break;
+    }
+    case static_cast<int>(pu::ProtoWireType::kLengthDelimited): {
+      ConstBytes payload = as_bytes();
+      wptr = pu::WriteVarInt(pu::MakeTagLengthDelimited(id_), wptr);
+      wptr = pu::WriteVarInt(payload.size, wptr);
+      memcpy(wptr, payload.data, payload.size);
+      wptr += payload.size;
+      break;
+    }
+    default:
+      PERFETTO_FATAL("Unknown field type %u", type_);
+  }
+  size_t written_size = static_cast<size_t>(wptr - start);
+  PERFETTO_DCHECK(written_size > 0 && written_size < pu::kMaxMessageLength);
+  PERFETTO_DCHECK(initial_size + written_size <= dst->size());
+  dst->resize(initial_size + written_size);
+}
+
+void Field::SerializeAndAppendTo(std::string* dst) const {
+  SerializeAndAppendToInternal(dst);
+}
+
+void Field::SerializeAndAppendTo(std::vector<uint8_t>* dst) const {
+  SerializeAndAppendToInternal(dst);
+}
+
+}  // namespace protozero
+// gen_amalgamated begin source: src/protozero/message.cc
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+
+#include <atomic>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/base/compiler.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message_arena.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message_handle.h"
+
+#if !PERFETTO_IS_LITTLE_ENDIAN()
+// The memcpy() for float and double below needs to be adjusted if we want to
+// support big endian CPUs. There doesn't seem to be a compelling need today.
+#error Unimplemented for big endian archs.
+#endif
+
+namespace protozero {
+
+namespace {
+
+#if PERFETTO_DCHECK_IS_ON()
+std::atomic<uint32_t> g_generation;
+#endif
+
+}  // namespace
+
+// Do NOT put any code in the constructor or use default initialization.
+// Use the Reset() method below instead.
+
+// This method is called to initialize both root and nested messages.
+void Message::Reset(ScatteredStreamWriter* stream_writer, MessageArena* arena) {
+// Older versions of libstdcxx don't have is_trivially_constructible.
+#if !defined(__GLIBCXX__) || __GLIBCXX__ >= 20170516
+  static_assert(std::is_trivially_constructible<Message>::value,
+                "Message must be trivially constructible");
+#endif
+
+  static_assert(std::is_trivially_destructible<Message>::value,
+                "Message must be trivially destructible");
+  stream_writer_ = stream_writer;
+  arena_ = arena;
+  size_ = 0;
+  size_field_ = nullptr;
+  size_already_written_ = 0;
+  nested_message_ = nullptr;
+  finalized_ = false;
+#if PERFETTO_DCHECK_IS_ON()
+  handle_ = nullptr;
+  generation_ = g_generation.fetch_add(1, std::memory_order_relaxed);
+#endif
+}
+
+void Message::AppendString(uint32_t field_id, const char* str) {
+  AppendBytes(field_id, str, strlen(str));
+}
+
+void Message::AppendBytes(uint32_t field_id, const void* src, size_t size) {
+  if (nested_message_)
+    EndNestedMessage();
+
+  PERFETTO_DCHECK(size < proto_utils::kMaxMessageLength);
+  // Write the proto preamble (field id, type and length of the field).
+  uint8_t buffer[proto_utils::kMaxSimpleFieldEncodedSize];
+  uint8_t* pos = buffer;
+  pos = proto_utils::WriteVarInt(proto_utils::MakeTagLengthDelimited(field_id),
+                                 pos);
+  pos = proto_utils::WriteVarInt(static_cast<uint32_t>(size), pos);
+  WriteToStream(buffer, pos);
+
+  const uint8_t* src_u8 = reinterpret_cast<const uint8_t*>(src);
+  WriteToStream(src_u8, src_u8 + size);
+}
+
+size_t Message::AppendScatteredBytes(uint32_t field_id,
+                                     ContiguousMemoryRange* ranges,
+                                     size_t num_ranges) {
+  size_t size = 0;
+  for (size_t i = 0; i < num_ranges; ++i) {
+    size += ranges[i].size();
+  }
+
+  PERFETTO_DCHECK(size < proto_utils::kMaxMessageLength);
+
+  uint8_t buffer[proto_utils::kMaxSimpleFieldEncodedSize];
+  uint8_t* pos = buffer;
+  pos = proto_utils::WriteVarInt(proto_utils::MakeTagLengthDelimited(field_id),
+                                 pos);
+  pos = proto_utils::WriteVarInt(static_cast<uint32_t>(size), pos);
+  WriteToStream(buffer, pos);
+
+  for (size_t i = 0; i < num_ranges; ++i) {
+    auto& range = ranges[i];
+    WriteToStream(range.begin, range.end);
+  }
+
+  return size;
+}
+
+uint32_t Message::Finalize() {
+  if (finalized_)
+    return size_;
+
+  if (nested_message_)
+    EndNestedMessage();
+
+  // Write the length of the nested message a posteriori, using a leading-zero
+  // redundant varint encoding.
+  if (size_field_) {
+    PERFETTO_DCHECK(!finalized_);
+    PERFETTO_DCHECK(size_ < proto_utils::kMaxMessageLength);
+    PERFETTO_DCHECK(size_ >= size_already_written_);
+    proto_utils::WriteRedundantVarInt(size_ - size_already_written_,
+                                      size_field_);
+    size_field_ = nullptr;
+  }
+
+  finalized_ = true;
+#if PERFETTO_DCHECK_IS_ON()
+  if (handle_)
+    handle_->reset_message();
+#endif
+
+  return size_;
+}
+
+Message* Message::BeginNestedMessageInternal(uint32_t field_id) {
+  if (nested_message_)
+    EndNestedMessage();
+
+  // Write the proto preamble for the nested message.
+  uint8_t data[proto_utils::kMaxTagEncodedSize];
+  uint8_t* data_end = proto_utils::WriteVarInt(
+      proto_utils::MakeTagLengthDelimited(field_id), data);
+  WriteToStream(data, data_end);
+
+  Message* message = arena_->NewMessage();
+  message->Reset(stream_writer_, arena_);
+
+  // The length of the nested message cannot be known upfront. So right now
+  // just reserve the bytes to encode the size after the nested message is done.
+  message->set_size_field(
+      stream_writer_->ReserveBytes(proto_utils::kMessageLengthFieldSize));
+  size_ += proto_utils::kMessageLengthFieldSize;
+
+  nested_message_ = message;
+  return message;
+}
+
+void Message::EndNestedMessage() {
+  size_ += nested_message_->Finalize();
+  arena_->DeleteLastMessage(nested_message_);
+  nested_message_ = nullptr;
+}
+
+}  // namespace protozero
+// gen_amalgamated begin source: src/protozero/message_arena.cc
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/protozero/message_arena.h"
+
+#include <atomic>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message_handle.h"
+
+namespace protozero {
+
+MessageArena::MessageArena() {
+  // The code below assumes that there is always at least one block.
+  blocks_.emplace_front();
+  static_assert(std::alignment_of<decltype(blocks_.back().storage[0])>::value >=
+                    alignof(Message),
+                "MessageArea's storage is not properly aligned");
+}
+
+MessageArena::~MessageArena() = default;
+
+Message* MessageArena::NewMessage() {
+  PERFETTO_DCHECK(!blocks_.empty());  // Should never become empty.
+
+  Block* block = &blocks_.back();
+  if (PERFETTO_UNLIKELY(block->entries >= Block::kCapacity)) {
+    blocks_.emplace_back();
+    block = &blocks_.back();
+  }
+  const auto idx = block->entries++;
+  void* storage = &block->storage[idx];
+  PERFETTO_ASAN_UNPOISON(storage, sizeof(Message));
+  return new (storage) Message();
+}
+
+void MessageArena::DeleteLastMessageInternal() {
+  PERFETTO_DCHECK(!blocks_.empty());  // Should never be empty, see below.
+  Block* block = &blocks_.back();
+  PERFETTO_DCHECK(block->entries > 0);
+
+  // This is the reason why there is no ~Message() call here.
+  // MessageArea::Reset() (see header) also relies on dtor being trivial.
+  static_assert(std::is_trivially_destructible<Message>::value,
+                "Message must be trivially destructible");
+
+  --block->entries;
+  PERFETTO_ASAN_POISON(&block->storage[block->entries], sizeof(Message));
+
+  // Don't remove the first block to avoid malloc/free calls when the root
+  // message is reset. Hitting the allocator all the times is a waste of time.
+  if (block->entries == 0 && blocks_.size() > 1) {
+    blocks_.pop_back();
+  }
+}
+
+}  // namespace protozero
+// gen_amalgamated begin source: src/protozero/message_handle.cc
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/protozero/message_handle.h"
+
+#include <utility>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+
+namespace protozero {
+
+MessageHandleBase::MessageHandleBase(Message* message) : message_(message) {
+#if PERFETTO_DCHECK_IS_ON()
+  generation_ = message_ ? message->generation_ : 0;
+  if (message_)
+    message_->set_handle(this);
+#endif
+}
+
+MessageHandleBase::~MessageHandleBase() {
+  if (message_) {
+#if PERFETTO_DCHECK_IS_ON()
+    PERFETTO_DCHECK(generation_ == message_->generation_);
+#endif
+    FinalizeMessage();
+  }
+}
+
+MessageHandleBase::MessageHandleBase(MessageHandleBase&& other) noexcept {
+  Move(std::move(other));
+}
+
+MessageHandleBase& MessageHandleBase::operator=(MessageHandleBase&& other) {
+  // If the current handle was pointing to a message and is being reset to a new
+  // one, finalize the old message. However, if the other message is the same as
+  // the one we point to, don't finalize.
+  if (message_ && message_ != other.message_)
+    FinalizeMessage();
+  Move(std::move(other));
+  return *this;
+}
+
+void MessageHandleBase::Move(MessageHandleBase&& other) {
+  message_ = other.message_;
+  other.message_ = nullptr;
+#if PERFETTO_DCHECK_IS_ON()
+  if (message_) {
+    generation_ = message_->generation_;
+    message_->set_handle(this);
+  }
+#endif
+}
+
+}  // namespace protozero
+// gen_amalgamated begin source: src/protozero/packed_repeated_fields.cc
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+
+namespace protozero {
+
+// static
+constexpr size_t PackedBufferBase::kOnStackStorageSize;
+
+void PackedBufferBase::GrowSlowpath() {
+  size_t write_off = static_cast<size_t>(write_ptr_ - storage_begin_);
+  size_t old_size = static_cast<size_t>(storage_end_ - storage_begin_);
+  size_t new_size = old_size < 65536 ? (old_size * 2) : (old_size * 3 / 2);
+  new_size = perfetto::base::AlignUp<4096>(new_size);
+  std::unique_ptr<uint8_t[]> new_buf(new uint8_t[new_size]);
+  memcpy(new_buf.get(), storage_begin_, old_size);
+  heap_buf_ = std::move(new_buf);
+  storage_begin_ = heap_buf_.get();
+  storage_end_ = storage_begin_ + new_size;
+  write_ptr_ = storage_begin_ + write_off;
+}
+
+void PackedBufferBase::Reset() {
+  heap_buf_.reset();
+  storage_begin_ = reinterpret_cast<uint8_t*>(&stack_buf_[0]);
+  storage_end_ = reinterpret_cast<uint8_t*>(&stack_buf_[kOnStackStorageSize]);
+  write_ptr_ = storage_begin_;
+}
+
+}  // namespace protozero
+// gen_amalgamated begin source: src/protozero/proto_decoder.cc
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+
+#include <string.h>
+#include <limits>
+
+// gen_amalgamated expanded: #include "perfetto/base/compiler.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace protozero {
+
+using namespace proto_utils;
+
+#if !PERFETTO_IS_LITTLE_ENDIAN()
+#error Unimplemented for big endian archs.
+#endif
+
+namespace {
+
+struct ParseFieldResult {
+  enum ParseResult { kAbort, kSkip, kOk };
+  ParseResult parse_res;
+  const uint8_t* next;
+  Field field;
+};
+
+// Parses one field and returns the field itself and a pointer to the next
+// field to parse. If parsing fails, the returned |next| == |buffer|.
+PERFETTO_ALWAYS_INLINE ParseFieldResult
+ParseOneField(const uint8_t* const buffer, const uint8_t* const end) {
+  ParseFieldResult res{ParseFieldResult::kAbort, buffer, Field{}};
+
+  // The first byte of a proto field is structured as follows:
+  // The least 3 significant bits determine the field type.
+  // The most 5 significant bits determine the field id. If MSB == 1, the
+  // field id continues on the next bytes following the VarInt encoding.
+  const uint8_t kFieldTypeNumBits = 3;
+  const uint64_t kFieldTypeMask = (1 << kFieldTypeNumBits) - 1;  // 0000 0111;
+  const uint8_t* pos = buffer;
+
+  // If we've already hit the end, just return an invalid field.
+  if (PERFETTO_UNLIKELY(pos >= end))
+    return res;
+
+  uint64_t preamble = 0;
+  if (PERFETTO_LIKELY(*pos < 0x80)) {  // Fastpath for fields with ID < 16.
+    preamble = *(pos++);
+  } else {
+    const uint8_t* next = ParseVarInt(pos, end, &preamble);
+    if (PERFETTO_UNLIKELY(pos == next))
+      return res;
+    pos = next;
+  }
+
+  uint32_t field_id = static_cast<uint32_t>(preamble >> kFieldTypeNumBits);
+  if (field_id == 0 || pos >= end)
+    return res;
+
+  auto field_type = static_cast<uint8_t>(preamble & kFieldTypeMask);
+  const uint8_t* new_pos = pos;
+  uint64_t int_value = 0;
+  uint64_t size = 0;
+
+  switch (field_type) {
+    case static_cast<uint8_t>(ProtoWireType::kVarInt): {
+      new_pos = ParseVarInt(pos, end, &int_value);
+
+      // new_pos not being greater than pos means ParseVarInt could not fully
+      // parse the number. This is because we are out of space in the buffer.
+      // Set the id to zero and return but don't update the offset so a future
+      // read can read this field.
+      if (PERFETTO_UNLIKELY(new_pos == pos))
+        return res;
+
+      break;
+    }
+
+    case static_cast<uint8_t>(ProtoWireType::kLengthDelimited): {
+      uint64_t payload_length;
+      new_pos = ParseVarInt(pos, end, &payload_length);
+      if (PERFETTO_UNLIKELY(new_pos == pos))
+        return res;
+
+      // ParseVarInt guarantees that |new_pos| <= |end| when it succeeds;
+      if (payload_length > static_cast<uint64_t>(end - new_pos))
+        return res;
+
+      const uintptr_t payload_start = reinterpret_cast<uintptr_t>(new_pos);
+      int_value = payload_start;
+      size = payload_length;
+      new_pos += payload_length;
+      break;
+    }
+
+    case static_cast<uint8_t>(ProtoWireType::kFixed64): {
+      new_pos = pos + sizeof(uint64_t);
+      if (PERFETTO_UNLIKELY(new_pos > end))
+        return res;
+      memcpy(&int_value, pos, sizeof(uint64_t));
+      break;
+    }
+
+    case static_cast<uint8_t>(ProtoWireType::kFixed32): {
+      new_pos = pos + sizeof(uint32_t);
+      if (PERFETTO_UNLIKELY(new_pos > end))
+        return res;
+      memcpy(&int_value, pos, sizeof(uint32_t));
+      break;
+    }
+
+    default:
+      PERFETTO_DLOG("Invalid proto field type: %u", field_type);
+      return res;
+  }
+
+  res.next = new_pos;
+
+  if (PERFETTO_UNLIKELY(field_id > std::numeric_limits<uint16_t>::max())) {
+    PERFETTO_DLOG("Skipping field %" PRIu32 " because its id > 0xFFFF",
+                  field_id);
+    res.parse_res = ParseFieldResult::kSkip;
+    return res;
+  }
+
+  if (PERFETTO_UNLIKELY(size > proto_utils::kMaxMessageLength)) {
+    PERFETTO_DLOG("Skipping field %" PRIu32 " because it's too big (%" PRIu64
+                  " KB)",
+                  field_id, size / 1024);
+    res.parse_res = ParseFieldResult::kSkip;
+    return res;
+  }
+
+  res.parse_res = ParseFieldResult::kOk;
+  res.field.initialize(static_cast<uint16_t>(field_id), field_type, int_value,
+                       static_cast<uint32_t>(size));
+  return res;
+}
+
+}  // namespace
+
+Field ProtoDecoder::FindField(uint32_t field_id) {
+  Field res{};
+  auto old_position = read_ptr_;
+  read_ptr_ = begin_;
+  for (auto f = ReadField(); f.valid(); f = ReadField()) {
+    if (f.id() == field_id) {
+      res = f;
+      break;
+    }
+  }
+  read_ptr_ = old_position;
+  return res;
+}
+
+PERFETTO_ALWAYS_INLINE
+Field ProtoDecoder::ReadField() {
+  ParseFieldResult res;
+  do {
+    res = ParseOneField(read_ptr_, end_);
+    read_ptr_ = res.next;
+  } while (PERFETTO_UNLIKELY(res.parse_res == ParseFieldResult::kSkip));
+  return res.field;
+}
+
+void TypedProtoDecoderBase::ParseAllFields() {
+  const uint8_t* cur = begin_;
+  ParseFieldResult res;
+  for (;;) {
+    res = ParseOneField(cur, end_);
+    PERFETTO_DCHECK(res.parse_res != ParseFieldResult::kOk || res.next != cur);
+    cur = res.next;
+    if (PERFETTO_UNLIKELY(res.parse_res == ParseFieldResult::kSkip)) {
+      continue;
+    } else if (PERFETTO_UNLIKELY(res.parse_res == ParseFieldResult::kAbort)) {
+      break;
+    }
+    PERFETTO_DCHECK(res.parse_res == ParseFieldResult::kOk);
+    PERFETTO_DCHECK(res.field.valid());
+    auto field_id = res.field.id();
+    if (PERFETTO_UNLIKELY(field_id >= num_fields_))
+      continue;
+
+    Field* fld = &fields_[field_id];
+    if (PERFETTO_LIKELY(!fld->valid())) {
+      // This is the first time we see this field.
+      *fld = std::move(res.field);
+    } else {
+      // Repeated field case.
+      // In this case we need to:
+      // 1. Append the last value of the field to end of the repeated field
+      //    storage.
+      // 2. Replace the default instance at offset |field_id| with the current
+      //    value. This is because in case of repeated field a call to Get(X) is
+      //    supposed to return the last value of X, not the first one.
+      // This is so that the RepeatedFieldIterator will iterate in the right
+      // order, see comments on RepeatedFieldIterator.
+      if (PERFETTO_UNLIKELY(size_ >= capacity_)) {
+        ExpandHeapStorage();
+        // ExpandHeapStorage moves fields_ so we need to update the ptr to fld:
+        fld = &fields_[field_id];
+        PERFETTO_DCHECK(size_ < capacity_);
+      }
+      fields_[size_++] = *fld;
+      *fld = std::move(res.field);
+    }
+  }
+  read_ptr_ = res.next;
+}
+
+void TypedProtoDecoderBase::ExpandHeapStorage() {
+  uint32_t new_capacity = capacity_ * 2;
+  PERFETTO_CHECK(new_capacity > size_);
+  std::unique_ptr<Field[]> new_storage(new Field[new_capacity]);
+
+  static_assert(std::is_trivially_copyable<Field>::value,
+                "Field must be trivially copyable");
+  memcpy(&new_storage[0], fields_, sizeof(Field) * size_);
+
+  heap_storage_ = std::move(new_storage);
+  fields_ = &heap_storage_[0];
+  capacity_ = new_capacity;
+}
+
+}  // namespace protozero
+// gen_amalgamated begin source: src/protozero/scattered_heap_buffer.cc
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+
+#include <algorithm>
+
+namespace protozero {
+
+ScatteredHeapBuffer::Slice::Slice()
+    : buffer_(nullptr), size_(0u), unused_bytes_(0u) {}
+
+ScatteredHeapBuffer::Slice::Slice(size_t size)
+    : buffer_(std::unique_ptr<uint8_t[]>(new uint8_t[size])),
+      size_(size),
+      unused_bytes_(size) {
+  PERFETTO_DCHECK(size);
+  Clear();
+}
+
+ScatteredHeapBuffer::Slice::Slice(Slice&& slice) noexcept = default;
+
+ScatteredHeapBuffer::Slice::~Slice() = default;
+
+ScatteredHeapBuffer::Slice& ScatteredHeapBuffer::Slice::operator=(Slice&&) =
+    default;
+
+void ScatteredHeapBuffer::Slice::Clear() {
+  unused_bytes_ = size_;
+#if PERFETTO_DCHECK_IS_ON()
+  memset(start(), 0xff, size_);
+#endif  // PERFETTO_DCHECK_IS_ON()
+}
+
+ScatteredHeapBuffer::ScatteredHeapBuffer(size_t initial_slice_size_bytes,
+                                         size_t maximum_slice_size_bytes)
+    : next_slice_size_(initial_slice_size_bytes),
+      maximum_slice_size_(maximum_slice_size_bytes) {
+  PERFETTO_DCHECK(next_slice_size_ && maximum_slice_size_);
+  PERFETTO_DCHECK(maximum_slice_size_ >= initial_slice_size_bytes);
+}
+
+ScatteredHeapBuffer::~ScatteredHeapBuffer() = default;
+
+protozero::ContiguousMemoryRange ScatteredHeapBuffer::GetNewBuffer() {
+  PERFETTO_CHECK(writer_);
+  AdjustUsedSizeOfCurrentSlice();
+
+  if (cached_slice_.start()) {
+    slices_.push_back(std::move(cached_slice_));
+    PERFETTO_DCHECK(!cached_slice_.start());
+  } else {
+    slices_.emplace_back(next_slice_size_);
+  }
+  next_slice_size_ = std::min(maximum_slice_size_, next_slice_size_ * 2);
+  return slices_.back().GetTotalRange();
+}
+
+const std::vector<ScatteredHeapBuffer::Slice>&
+ScatteredHeapBuffer::GetSlices() {
+  AdjustUsedSizeOfCurrentSlice();
+  return slices_;
+}
+
+std::vector<uint8_t> ScatteredHeapBuffer::StitchSlices() {
+  size_t stitched_size = 0u;
+  const auto& slices = GetSlices();
+  for (const auto& slice : slices)
+    stitched_size += slice.size() - slice.unused_bytes();
+
+  std::vector<uint8_t> buffer;
+  buffer.reserve(stitched_size);
+  for (const auto& slice : slices) {
+    auto used_range = slice.GetUsedRange();
+    buffer.insert(buffer.end(), used_range.begin, used_range.end);
+  }
+  return buffer;
+}
+
+std::vector<protozero::ContiguousMemoryRange> ScatteredHeapBuffer::GetRanges() {
+  std::vector<protozero::ContiguousMemoryRange> ranges;
+  for (const auto& slice : GetSlices())
+    ranges.push_back(slice.GetUsedRange());
+  return ranges;
+}
+
+void ScatteredHeapBuffer::AdjustUsedSizeOfCurrentSlice() {
+  if (!slices_.empty())
+    slices_.back().set_unused_bytes(writer_->bytes_available());
+}
+
+size_t ScatteredHeapBuffer::GetTotalSize() {
+  size_t total_size = 0;
+  for (auto& slice : slices_) {
+    total_size += slice.size();
+  }
+  return total_size;
+}
+
+void ScatteredHeapBuffer::Reset() {
+  if (slices_.empty())
+    return;
+  cached_slice_ = std::move(slices_.front());
+  cached_slice_.Clear();
+  slices_.clear();
+}
+
+}  // namespace protozero
+// gen_amalgamated begin source: src/protozero/scattered_stream_null_delegate.cc
+// gen_amalgamated begin header: include/perfetto/protozero/scattered_stream_null_delegate.h
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_SCATTERED_STREAM_NULL_DELEGATE_H_
+#define INCLUDE_PERFETTO_PROTOZERO_SCATTERED_STREAM_NULL_DELEGATE_H_
+
+#include <memory>
+#include <vector>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/contiguous_memory_range.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_stream_writer.h"
+
+namespace protozero {
+
+class PERFETTO_EXPORT ScatteredStreamWriterNullDelegate
+    : public ScatteredStreamWriter::Delegate {
+ public:
+  explicit ScatteredStreamWriterNullDelegate(size_t chunk_size);
+  ~ScatteredStreamWriterNullDelegate() override;
+
+  // protozero::ScatteredStreamWriter::Delegate implementation.
+  ContiguousMemoryRange GetNewBuffer() override;
+
+ private:
+  const size_t chunk_size_;
+  std::unique_ptr<uint8_t[]> chunk_;
+};
+
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_SCATTERED_STREAM_NULL_DELEGATE_H_
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_stream_null_delegate.h"
+
+namespace protozero {
+
+// An implementation of ScatteredStreamWriter::Delegate which always returns
+// the same piece of memory.
+// This is used when we need to no-op the writers (e.g. during teardown or in
+// case of resource exhaustion), avoiding that the clients have to deal with
+// nullptr checks.
+ScatteredStreamWriterNullDelegate::ScatteredStreamWriterNullDelegate(
+    size_t chunk_size)
+    : chunk_size_(chunk_size),
+      chunk_(std::unique_ptr<uint8_t[]>(new uint8_t[chunk_size_])) {}
+
+ScatteredStreamWriterNullDelegate::~ScatteredStreamWriterNullDelegate() {}
+
+ContiguousMemoryRange ScatteredStreamWriterNullDelegate::GetNewBuffer() {
+  return {chunk_.get(), chunk_.get() + chunk_size_};
+}
+
+}  // namespace protozero
+// gen_amalgamated begin source: src/protozero/scattered_stream_writer.cc
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_stream_writer.h"
+
+#include <algorithm>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+
+namespace protozero {
+
+ScatteredStreamWriter::Delegate::~Delegate() {}
+
+ScatteredStreamWriter::ScatteredStreamWriter(Delegate* delegate)
+    : delegate_(delegate),
+      cur_range_({nullptr, nullptr}),
+      write_ptr_(nullptr) {}
+
+ScatteredStreamWriter::~ScatteredStreamWriter() {}
+
+void ScatteredStreamWriter::Reset(ContiguousMemoryRange range) {
+  written_previously_ += static_cast<uint64_t>(write_ptr_ - cur_range_.begin);
+  cur_range_ = range;
+  write_ptr_ = range.begin;
+  PERFETTO_DCHECK(!write_ptr_ || write_ptr_ < cur_range_.end);
+}
+
+void ScatteredStreamWriter::Extend() {
+  Reset(delegate_->GetNewBuffer());
+}
+
+void ScatteredStreamWriter::WriteBytesSlowPath(const uint8_t* src,
+                                               size_t size) {
+  size_t bytes_left = size;
+  while (bytes_left > 0) {
+    if (write_ptr_ >= cur_range_.end)
+      Extend();
+    const size_t burst_size = std::min(bytes_available(), bytes_left);
+    WriteBytesUnsafe(src, burst_size);
+    bytes_left -= burst_size;
+    src += burst_size;
+  }
+}
+
+// TODO(primiano): perf optimization: I suspect that at the end this will always
+// be called with |size| == 4, in which case we might just hardcode it.
+uint8_t* ScatteredStreamWriter::ReserveBytes(size_t size) {
+  if (write_ptr_ + size > cur_range_.end) {
+    // Assume the reservations are always < Delegate::GetNewBuffer().size(),
+    // so that one single call to Extend() will definitely give enough headroom.
+    Extend();
+    PERFETTO_DCHECK(write_ptr_ + size <= cur_range_.end);
+  }
+  uint8_t* begin = write_ptr_;
+  write_ptr_ += size;
+#if PERFETTO_DCHECK_IS_ON()
+  memset(begin, 0, size);
+#endif
+  return begin;
+}
+
+}  // namespace protozero
+// gen_amalgamated begin source: src/protozero/static_buffer.cc
+// gen_amalgamated begin header: include/perfetto/protozero/static_buffer.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_STATIC_BUFFER_H_
+#define INCLUDE_PERFETTO_PROTOZERO_STATIC_BUFFER_H_
+
+#include <memory>
+#include <string>
+#include <vector>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/root_message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_stream_writer.h"
+
+namespace protozero {
+
+class Message;
+
+// A simple implementation of ScatteredStreamWriter::Delegate backed by a
+// fixed-size buffer. It doesn't support expansion. The caller needs to ensure
+// to never write more than the size of the buffer. Will CHECK() otherwise.
+class PERFETTO_EXPORT StaticBufferDelegate
+    : public ScatteredStreamWriter::Delegate {
+ public:
+  StaticBufferDelegate(uint8_t* buf, size_t len) : range_{buf, buf + len} {}
+  ~StaticBufferDelegate() override;
+
+  // ScatteredStreamWriter::Delegate implementation.
+  ContiguousMemoryRange GetNewBuffer() override;
+
+  ContiguousMemoryRange const range_;
+  bool get_new_buffer_called_once_ = false;
+};
+
+// Helper function to create protozero messages backed by a fixed-size buffer
+// in one line. You can write:
+//   protozero::Static<protozero::MyMessage> msg(buf.data(), buf.size());
+//   msg->set_stuff(...);
+//   size_t bytes_encoded = msg.Finalize();
+template <typename T /* protozero::Message */>
+class StaticBuffered {
+ public:
+  StaticBuffered(void* buf, size_t len)
+      : delegate_(reinterpret_cast<uint8_t*>(buf), len), writer_(&delegate_) {
+    msg_.Reset(&writer_);
+  }
+
+  // This can't be neither copied nor moved because Message hands out pointers
+  // to itself when creating submessages.
+  StaticBuffered(const StaticBuffered&) = delete;
+  StaticBuffered& operator=(const StaticBuffered&) = delete;
+  StaticBuffered(StaticBuffered&&) = delete;
+  StaticBuffered& operator=(StaticBuffered&&) = delete;
+
+  T* get() { return &msg_; }
+  T* operator->() { return &msg_; }
+
+  // The lack of a size() method is deliberate. It's to prevent that one
+  // accidentally calls size() before Finalize().
+
+  // Returns the number of encoded bytes (<= the size passed in the ctor).
+  size_t Finalize() {
+    msg_.Finalize();
+    return static_cast<size_t>(writer_.write_ptr() - delegate_.range_.begin);
+  }
+
+ private:
+  StaticBufferDelegate delegate_;
+  ScatteredStreamWriter writer_;
+  RootMessage<T> msg_;
+};
+
+// Helper function to create stack-based protozero messages in one line.
+// You can write:
+//   protozero::StackBuffered<protozero::MyMessage, 16> msg;
+//   msg->set_stuff(...);
+//   size_t bytes_encoded = msg.Finalize();
+template <typename T /* protozero::Message */, size_t N>
+class StackBuffered : public StaticBuffered<T> {
+ public:
+  StackBuffered() : StaticBuffered<T>(&buf_[0], N) {}
+
+ private:
+  uint8_t buf_[N];  // Deliberately not initialized.
+};
+
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_STATIC_BUFFER_H_
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/protozero/static_buffer.h"
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+
+namespace protozero {
+
+StaticBufferDelegate::~StaticBufferDelegate() = default;
+
+ContiguousMemoryRange StaticBufferDelegate::GetNewBuffer() {
+  if (get_new_buffer_called_once_) {
+    // This is the 2nd time GetNewBuffer is called. The estimate is wrong. We
+    // shouldn't try to grow the buffer after the initial call.
+    PERFETTO_FATAL("Static buffer too small");
+  }
+  get_new_buffer_called_once_ = true;
+  return range_;
+}
+
+}  // namespace protozero
+// gen_amalgamated begin source: src/protozero/virtual_destructors.cc
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+
+namespace protozero {
+
+CppMessageObj::~CppMessageObj() = default;
+
+}  // namespace protozero
+// gen_amalgamated begin source: gen/protos/perfetto/common/android_energy_consumer_descriptor.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/common/android_energy_consumer_descriptor.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_ANDROID_ENERGY_CONSUMER_DESCRIPTOR_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_ANDROID_ENERGY_CONSUMER_DESCRIPTOR_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class AndroidEnergyConsumerDescriptor;
+class AndroidEnergyConsumer;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT AndroidEnergyConsumerDescriptor : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kEnergyConsumersFieldNumber = 1,
+  };
+
+  AndroidEnergyConsumerDescriptor();
+  ~AndroidEnergyConsumerDescriptor() override;
+  AndroidEnergyConsumerDescriptor(AndroidEnergyConsumerDescriptor&&) noexcept;
+  AndroidEnergyConsumerDescriptor& operator=(AndroidEnergyConsumerDescriptor&&);
+  AndroidEnergyConsumerDescriptor(const AndroidEnergyConsumerDescriptor&);
+  AndroidEnergyConsumerDescriptor& operator=(const AndroidEnergyConsumerDescriptor&);
+  bool operator==(const AndroidEnergyConsumerDescriptor&) const;
+  bool operator!=(const AndroidEnergyConsumerDescriptor& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<AndroidEnergyConsumer>& energy_consumers() const { return energy_consumers_; }
+  std::vector<AndroidEnergyConsumer>* mutable_energy_consumers() { return &energy_consumers_; }
+  int energy_consumers_size() const;
+  void clear_energy_consumers();
+  AndroidEnergyConsumer* add_energy_consumers();
+
+ private:
+  std::vector<AndroidEnergyConsumer> energy_consumers_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT AndroidEnergyConsumer : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kEnergyConsumerIdFieldNumber = 1,
+    kOrdinalFieldNumber = 2,
+    kTypeFieldNumber = 3,
+    kNameFieldNumber = 4,
+  };
+
+  AndroidEnergyConsumer();
+  ~AndroidEnergyConsumer() override;
+  AndroidEnergyConsumer(AndroidEnergyConsumer&&) noexcept;
+  AndroidEnergyConsumer& operator=(AndroidEnergyConsumer&&);
+  AndroidEnergyConsumer(const AndroidEnergyConsumer&);
+  AndroidEnergyConsumer& operator=(const AndroidEnergyConsumer&);
+  bool operator==(const AndroidEnergyConsumer&) const;
+  bool operator!=(const AndroidEnergyConsumer& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_energy_consumer_id() const { return _has_field_[1]; }
+  int32_t energy_consumer_id() const { return energy_consumer_id_; }
+  void set_energy_consumer_id(int32_t value) { energy_consumer_id_ = value; _has_field_.set(1); }
+
+  bool has_ordinal() const { return _has_field_[2]; }
+  int32_t ordinal() const { return ordinal_; }
+  void set_ordinal(int32_t value) { ordinal_ = value; _has_field_.set(2); }
+
+  bool has_type() const { return _has_field_[3]; }
+  const std::string& type() const { return type_; }
+  void set_type(const std::string& value) { type_ = value; _has_field_.set(3); }
+
+  bool has_name() const { return _has_field_[4]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(4); }
+
+ private:
+  int32_t energy_consumer_id_{};
+  int32_t ordinal_{};
+  std::string type_{};
+  std::string name_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<5> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_ANDROID_ENERGY_CONSUMER_DESCRIPTOR_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/common/android_energy_consumer_descriptor.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+AndroidEnergyConsumerDescriptor::AndroidEnergyConsumerDescriptor() = default;
+AndroidEnergyConsumerDescriptor::~AndroidEnergyConsumerDescriptor() = default;
+AndroidEnergyConsumerDescriptor::AndroidEnergyConsumerDescriptor(const AndroidEnergyConsumerDescriptor&) = default;
+AndroidEnergyConsumerDescriptor& AndroidEnergyConsumerDescriptor::operator=(const AndroidEnergyConsumerDescriptor&) = default;
+AndroidEnergyConsumerDescriptor::AndroidEnergyConsumerDescriptor(AndroidEnergyConsumerDescriptor&&) noexcept = default;
+AndroidEnergyConsumerDescriptor& AndroidEnergyConsumerDescriptor::operator=(AndroidEnergyConsumerDescriptor&&) = default;
+
+bool AndroidEnergyConsumerDescriptor::operator==(const AndroidEnergyConsumerDescriptor& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && energy_consumers_ == other.energy_consumers_;
+}
+
+int AndroidEnergyConsumerDescriptor::energy_consumers_size() const { return static_cast<int>(energy_consumers_.size()); }
+void AndroidEnergyConsumerDescriptor::clear_energy_consumers() { energy_consumers_.clear(); }
+AndroidEnergyConsumer* AndroidEnergyConsumerDescriptor::add_energy_consumers() { energy_consumers_.emplace_back(); return &energy_consumers_.back(); }
+bool AndroidEnergyConsumerDescriptor::ParseFromArray(const void* raw, size_t size) {
+  energy_consumers_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* energy_consumers */:
+        energy_consumers_.emplace_back();
+        energy_consumers_.back().ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string AndroidEnergyConsumerDescriptor::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> AndroidEnergyConsumerDescriptor::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void AndroidEnergyConsumerDescriptor::Serialize(::protozero::Message* msg) const {
+  // Field 1: energy_consumers
+  for (auto& it : energy_consumers_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(1));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+AndroidEnergyConsumer::AndroidEnergyConsumer() = default;
+AndroidEnergyConsumer::~AndroidEnergyConsumer() = default;
+AndroidEnergyConsumer::AndroidEnergyConsumer(const AndroidEnergyConsumer&) = default;
+AndroidEnergyConsumer& AndroidEnergyConsumer::operator=(const AndroidEnergyConsumer&) = default;
+AndroidEnergyConsumer::AndroidEnergyConsumer(AndroidEnergyConsumer&&) noexcept = default;
+AndroidEnergyConsumer& AndroidEnergyConsumer::operator=(AndroidEnergyConsumer&&) = default;
+
+bool AndroidEnergyConsumer::operator==(const AndroidEnergyConsumer& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && energy_consumer_id_ == other.energy_consumer_id_
+   && ordinal_ == other.ordinal_
+   && type_ == other.type_
+   && name_ == other.name_;
+}
+
+bool AndroidEnergyConsumer::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* energy_consumer_id */:
+        field.get(&energy_consumer_id_);
+        break;
+      case 2 /* ordinal */:
+        field.get(&ordinal_);
+        break;
+      case 3 /* type */:
+        field.get(&type_);
+        break;
+      case 4 /* name */:
+        field.get(&name_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string AndroidEnergyConsumer::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> AndroidEnergyConsumer::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void AndroidEnergyConsumer::Serialize(::protozero::Message* msg) const {
+  // Field 1: energy_consumer_id
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, energy_consumer_id_);
+  }
+
+  // Field 2: ordinal
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, ordinal_);
+  }
+
+  // Field 3: type
+  if (_has_field_[3]) {
+    msg->AppendString(3, type_);
+  }
+
+  // Field 4: name
+  if (_has_field_[4]) {
+    msg->AppendString(4, name_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/common/android_log_constants.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/common/android_log_constants.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_ANDROID_LOG_CONSTANTS_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_ANDROID_LOG_CONSTANTS_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum AndroidLogId : int;
+enum AndroidLogPriority : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum AndroidLogId : int {
+  LID_DEFAULT = 0,
+  LID_RADIO = 1,
+  LID_EVENTS = 2,
+  LID_SYSTEM = 3,
+  LID_CRASH = 4,
+  LID_STATS = 5,
+  LID_SECURITY = 6,
+  LID_KERNEL = 7,
+};
+enum AndroidLogPriority : int {
+  PRIO_UNSPECIFIED = 0,
+  PRIO_UNUSED = 1,
+  PRIO_VERBOSE = 2,
+  PRIO_DEBUG = 3,
+  PRIO_INFO = 4,
+  PRIO_WARN = 5,
+  PRIO_ERROR = 6,
+  PRIO_FATAL = 7,
+};
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_ANDROID_LOG_CONSTANTS_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/common/android_log_constants.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/common/builtin_clock.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/common/builtin_clock.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_BUILTIN_CLOCK_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_BUILTIN_CLOCK_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum BuiltinClock : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum BuiltinClock : int {
+  BUILTIN_CLOCK_UNKNOWN = 0,
+  BUILTIN_CLOCK_REALTIME = 1,
+  BUILTIN_CLOCK_REALTIME_COARSE = 2,
+  BUILTIN_CLOCK_MONOTONIC = 3,
+  BUILTIN_CLOCK_MONOTONIC_COARSE = 4,
+  BUILTIN_CLOCK_MONOTONIC_RAW = 5,
+  BUILTIN_CLOCK_BOOTTIME = 6,
+  BUILTIN_CLOCK_MAX_ID = 63,
+};
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_BUILTIN_CLOCK_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/common/builtin_clock.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/common/commit_data_request.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/common/commit_data_request.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_COMMIT_DATA_REQUEST_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_COMMIT_DATA_REQUEST_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class CommitDataRequest;
+class CommitDataRequest_ChunkToPatch;
+class CommitDataRequest_ChunkToPatch_Patch;
+class CommitDataRequest_ChunksToMove;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT CommitDataRequest : public ::protozero::CppMessageObj {
+ public:
+  using ChunksToMove = CommitDataRequest_ChunksToMove;
+  using ChunkToPatch = CommitDataRequest_ChunkToPatch;
+  enum FieldNumbers {
+    kChunksToMoveFieldNumber = 1,
+    kChunksToPatchFieldNumber = 2,
+    kFlushRequestIdFieldNumber = 3,
+  };
+
+  CommitDataRequest();
+  ~CommitDataRequest() override;
+  CommitDataRequest(CommitDataRequest&&) noexcept;
+  CommitDataRequest& operator=(CommitDataRequest&&);
+  CommitDataRequest(const CommitDataRequest&);
+  CommitDataRequest& operator=(const CommitDataRequest&);
+  bool operator==(const CommitDataRequest&) const;
+  bool operator!=(const CommitDataRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<CommitDataRequest_ChunksToMove>& chunks_to_move() const { return chunks_to_move_; }
+  std::vector<CommitDataRequest_ChunksToMove>* mutable_chunks_to_move() { return &chunks_to_move_; }
+  int chunks_to_move_size() const;
+  void clear_chunks_to_move();
+  CommitDataRequest_ChunksToMove* add_chunks_to_move();
+
+  const std::vector<CommitDataRequest_ChunkToPatch>& chunks_to_patch() const { return chunks_to_patch_; }
+  std::vector<CommitDataRequest_ChunkToPatch>* mutable_chunks_to_patch() { return &chunks_to_patch_; }
+  int chunks_to_patch_size() const;
+  void clear_chunks_to_patch();
+  CommitDataRequest_ChunkToPatch* add_chunks_to_patch();
+
+  bool has_flush_request_id() const { return _has_field_[3]; }
+  uint64_t flush_request_id() const { return flush_request_id_; }
+  void set_flush_request_id(uint64_t value) { flush_request_id_ = value; _has_field_.set(3); }
+
+ private:
+  std::vector<CommitDataRequest_ChunksToMove> chunks_to_move_;
+  std::vector<CommitDataRequest_ChunkToPatch> chunks_to_patch_;
+  uint64_t flush_request_id_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<4> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT CommitDataRequest_ChunkToPatch : public ::protozero::CppMessageObj {
+ public:
+  using Patch = CommitDataRequest_ChunkToPatch_Patch;
+  enum FieldNumbers {
+    kTargetBufferFieldNumber = 1,
+    kWriterIdFieldNumber = 2,
+    kChunkIdFieldNumber = 3,
+    kPatchesFieldNumber = 4,
+    kHasMorePatchesFieldNumber = 5,
+  };
+
+  CommitDataRequest_ChunkToPatch();
+  ~CommitDataRequest_ChunkToPatch() override;
+  CommitDataRequest_ChunkToPatch(CommitDataRequest_ChunkToPatch&&) noexcept;
+  CommitDataRequest_ChunkToPatch& operator=(CommitDataRequest_ChunkToPatch&&);
+  CommitDataRequest_ChunkToPatch(const CommitDataRequest_ChunkToPatch&);
+  CommitDataRequest_ChunkToPatch& operator=(const CommitDataRequest_ChunkToPatch&);
+  bool operator==(const CommitDataRequest_ChunkToPatch&) const;
+  bool operator!=(const CommitDataRequest_ChunkToPatch& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_target_buffer() const { return _has_field_[1]; }
+  uint32_t target_buffer() const { return target_buffer_; }
+  void set_target_buffer(uint32_t value) { target_buffer_ = value; _has_field_.set(1); }
+
+  bool has_writer_id() const { return _has_field_[2]; }
+  uint32_t writer_id() const { return writer_id_; }
+  void set_writer_id(uint32_t value) { writer_id_ = value; _has_field_.set(2); }
+
+  bool has_chunk_id() const { return _has_field_[3]; }
+  uint32_t chunk_id() const { return chunk_id_; }
+  void set_chunk_id(uint32_t value) { chunk_id_ = value; _has_field_.set(3); }
+
+  const std::vector<CommitDataRequest_ChunkToPatch_Patch>& patches() const { return patches_; }
+  std::vector<CommitDataRequest_ChunkToPatch_Patch>* mutable_patches() { return &patches_; }
+  int patches_size() const;
+  void clear_patches();
+  CommitDataRequest_ChunkToPatch_Patch* add_patches();
+
+  bool has_has_more_patches() const { return _has_field_[5]; }
+  bool has_more_patches() const { return has_more_patches_; }
+  void set_has_more_patches(bool value) { has_more_patches_ = value; _has_field_.set(5); }
+
+ private:
+  uint32_t target_buffer_{};
+  uint32_t writer_id_{};
+  uint32_t chunk_id_{};
+  std::vector<CommitDataRequest_ChunkToPatch_Patch> patches_;
+  bool has_more_patches_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<6> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT CommitDataRequest_ChunkToPatch_Patch : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kOffsetFieldNumber = 1,
+    kDataFieldNumber = 2,
+  };
+
+  CommitDataRequest_ChunkToPatch_Patch();
+  ~CommitDataRequest_ChunkToPatch_Patch() override;
+  CommitDataRequest_ChunkToPatch_Patch(CommitDataRequest_ChunkToPatch_Patch&&) noexcept;
+  CommitDataRequest_ChunkToPatch_Patch& operator=(CommitDataRequest_ChunkToPatch_Patch&&);
+  CommitDataRequest_ChunkToPatch_Patch(const CommitDataRequest_ChunkToPatch_Patch&);
+  CommitDataRequest_ChunkToPatch_Patch& operator=(const CommitDataRequest_ChunkToPatch_Patch&);
+  bool operator==(const CommitDataRequest_ChunkToPatch_Patch&) const;
+  bool operator!=(const CommitDataRequest_ChunkToPatch_Patch& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_offset() const { return _has_field_[1]; }
+  uint32_t offset() const { return offset_; }
+  void set_offset(uint32_t value) { offset_ = value; _has_field_.set(1); }
+
+  bool has_data() const { return _has_field_[2]; }
+  const std::string& data() const { return data_; }
+  void set_data(const std::string& value) { data_ = value; _has_field_.set(2); }
+  void set_data(const void* p, size_t s) { data_.assign(reinterpret_cast<const char*>(p), s); _has_field_.set(2); }
+
+ private:
+  uint32_t offset_{};
+  std::string data_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT CommitDataRequest_ChunksToMove : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kPageFieldNumber = 1,
+    kChunkFieldNumber = 2,
+    kTargetBufferFieldNumber = 3,
+  };
+
+  CommitDataRequest_ChunksToMove();
+  ~CommitDataRequest_ChunksToMove() override;
+  CommitDataRequest_ChunksToMove(CommitDataRequest_ChunksToMove&&) noexcept;
+  CommitDataRequest_ChunksToMove& operator=(CommitDataRequest_ChunksToMove&&);
+  CommitDataRequest_ChunksToMove(const CommitDataRequest_ChunksToMove&);
+  CommitDataRequest_ChunksToMove& operator=(const CommitDataRequest_ChunksToMove&);
+  bool operator==(const CommitDataRequest_ChunksToMove&) const;
+  bool operator!=(const CommitDataRequest_ChunksToMove& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_page() const { return _has_field_[1]; }
+  uint32_t page() const { return page_; }
+  void set_page(uint32_t value) { page_ = value; _has_field_.set(1); }
+
+  bool has_chunk() const { return _has_field_[2]; }
+  uint32_t chunk() const { return chunk_; }
+  void set_chunk(uint32_t value) { chunk_ = value; _has_field_.set(2); }
+
+  bool has_target_buffer() const { return _has_field_[3]; }
+  uint32_t target_buffer() const { return target_buffer_; }
+  void set_target_buffer(uint32_t value) { target_buffer_ = value; _has_field_.set(3); }
+
+ private:
+  uint32_t page_{};
+  uint32_t chunk_{};
+  uint32_t target_buffer_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<4> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_COMMIT_DATA_REQUEST_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/common/commit_data_request.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+CommitDataRequest::CommitDataRequest() = default;
+CommitDataRequest::~CommitDataRequest() = default;
+CommitDataRequest::CommitDataRequest(const CommitDataRequest&) = default;
+CommitDataRequest& CommitDataRequest::operator=(const CommitDataRequest&) = default;
+CommitDataRequest::CommitDataRequest(CommitDataRequest&&) noexcept = default;
+CommitDataRequest& CommitDataRequest::operator=(CommitDataRequest&&) = default;
+
+bool CommitDataRequest::operator==(const CommitDataRequest& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && chunks_to_move_ == other.chunks_to_move_
+   && chunks_to_patch_ == other.chunks_to_patch_
+   && flush_request_id_ == other.flush_request_id_;
+}
+
+int CommitDataRequest::chunks_to_move_size() const { return static_cast<int>(chunks_to_move_.size()); }
+void CommitDataRequest::clear_chunks_to_move() { chunks_to_move_.clear(); }
+CommitDataRequest_ChunksToMove* CommitDataRequest::add_chunks_to_move() { chunks_to_move_.emplace_back(); return &chunks_to_move_.back(); }
+int CommitDataRequest::chunks_to_patch_size() const { return static_cast<int>(chunks_to_patch_.size()); }
+void CommitDataRequest::clear_chunks_to_patch() { chunks_to_patch_.clear(); }
+CommitDataRequest_ChunkToPatch* CommitDataRequest::add_chunks_to_patch() { chunks_to_patch_.emplace_back(); return &chunks_to_patch_.back(); }
+bool CommitDataRequest::ParseFromArray(const void* raw, size_t size) {
+  chunks_to_move_.clear();
+  chunks_to_patch_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* chunks_to_move */:
+        chunks_to_move_.emplace_back();
+        chunks_to_move_.back().ParseFromArray(field.data(), field.size());
+        break;
+      case 2 /* chunks_to_patch */:
+        chunks_to_patch_.emplace_back();
+        chunks_to_patch_.back().ParseFromArray(field.data(), field.size());
+        break;
+      case 3 /* flush_request_id */:
+        field.get(&flush_request_id_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string CommitDataRequest::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> CommitDataRequest::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void CommitDataRequest::Serialize(::protozero::Message* msg) const {
+  // Field 1: chunks_to_move
+  for (auto& it : chunks_to_move_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(1));
+  }
+
+  // Field 2: chunks_to_patch
+  for (auto& it : chunks_to_patch_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(2));
+  }
+
+  // Field 3: flush_request_id
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, flush_request_id_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+CommitDataRequest_ChunkToPatch::CommitDataRequest_ChunkToPatch() = default;
+CommitDataRequest_ChunkToPatch::~CommitDataRequest_ChunkToPatch() = default;
+CommitDataRequest_ChunkToPatch::CommitDataRequest_ChunkToPatch(const CommitDataRequest_ChunkToPatch&) = default;
+CommitDataRequest_ChunkToPatch& CommitDataRequest_ChunkToPatch::operator=(const CommitDataRequest_ChunkToPatch&) = default;
+CommitDataRequest_ChunkToPatch::CommitDataRequest_ChunkToPatch(CommitDataRequest_ChunkToPatch&&) noexcept = default;
+CommitDataRequest_ChunkToPatch& CommitDataRequest_ChunkToPatch::operator=(CommitDataRequest_ChunkToPatch&&) = default;
+
+bool CommitDataRequest_ChunkToPatch::operator==(const CommitDataRequest_ChunkToPatch& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && target_buffer_ == other.target_buffer_
+   && writer_id_ == other.writer_id_
+   && chunk_id_ == other.chunk_id_
+   && patches_ == other.patches_
+   && has_more_patches_ == other.has_more_patches_;
+}
+
+int CommitDataRequest_ChunkToPatch::patches_size() const { return static_cast<int>(patches_.size()); }
+void CommitDataRequest_ChunkToPatch::clear_patches() { patches_.clear(); }
+CommitDataRequest_ChunkToPatch_Patch* CommitDataRequest_ChunkToPatch::add_patches() { patches_.emplace_back(); return &patches_.back(); }
+bool CommitDataRequest_ChunkToPatch::ParseFromArray(const void* raw, size_t size) {
+  patches_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* target_buffer */:
+        field.get(&target_buffer_);
+        break;
+      case 2 /* writer_id */:
+        field.get(&writer_id_);
+        break;
+      case 3 /* chunk_id */:
+        field.get(&chunk_id_);
+        break;
+      case 4 /* patches */:
+        patches_.emplace_back();
+        patches_.back().ParseFromArray(field.data(), field.size());
+        break;
+      case 5 /* has_more_patches */:
+        field.get(&has_more_patches_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string CommitDataRequest_ChunkToPatch::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> CommitDataRequest_ChunkToPatch::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void CommitDataRequest_ChunkToPatch::Serialize(::protozero::Message* msg) const {
+  // Field 1: target_buffer
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, target_buffer_);
+  }
+
+  // Field 2: writer_id
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, writer_id_);
+  }
+
+  // Field 3: chunk_id
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, chunk_id_);
+  }
+
+  // Field 4: patches
+  for (auto& it : patches_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(4));
+  }
+
+  // Field 5: has_more_patches
+  if (_has_field_[5]) {
+    msg->AppendTinyVarInt(5, has_more_patches_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+CommitDataRequest_ChunkToPatch_Patch::CommitDataRequest_ChunkToPatch_Patch() = default;
+CommitDataRequest_ChunkToPatch_Patch::~CommitDataRequest_ChunkToPatch_Patch() = default;
+CommitDataRequest_ChunkToPatch_Patch::CommitDataRequest_ChunkToPatch_Patch(const CommitDataRequest_ChunkToPatch_Patch&) = default;
+CommitDataRequest_ChunkToPatch_Patch& CommitDataRequest_ChunkToPatch_Patch::operator=(const CommitDataRequest_ChunkToPatch_Patch&) = default;
+CommitDataRequest_ChunkToPatch_Patch::CommitDataRequest_ChunkToPatch_Patch(CommitDataRequest_ChunkToPatch_Patch&&) noexcept = default;
+CommitDataRequest_ChunkToPatch_Patch& CommitDataRequest_ChunkToPatch_Patch::operator=(CommitDataRequest_ChunkToPatch_Patch&&) = default;
+
+bool CommitDataRequest_ChunkToPatch_Patch::operator==(const CommitDataRequest_ChunkToPatch_Patch& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && offset_ == other.offset_
+   && data_ == other.data_;
+}
+
+bool CommitDataRequest_ChunkToPatch_Patch::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* offset */:
+        field.get(&offset_);
+        break;
+      case 2 /* data */:
+        field.get(&data_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string CommitDataRequest_ChunkToPatch_Patch::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> CommitDataRequest_ChunkToPatch_Patch::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void CommitDataRequest_ChunkToPatch_Patch::Serialize(::protozero::Message* msg) const {
+  // Field 1: offset
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, offset_);
+  }
+
+  // Field 2: data
+  if (_has_field_[2]) {
+    msg->AppendString(2, data_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+CommitDataRequest_ChunksToMove::CommitDataRequest_ChunksToMove() = default;
+CommitDataRequest_ChunksToMove::~CommitDataRequest_ChunksToMove() = default;
+CommitDataRequest_ChunksToMove::CommitDataRequest_ChunksToMove(const CommitDataRequest_ChunksToMove&) = default;
+CommitDataRequest_ChunksToMove& CommitDataRequest_ChunksToMove::operator=(const CommitDataRequest_ChunksToMove&) = default;
+CommitDataRequest_ChunksToMove::CommitDataRequest_ChunksToMove(CommitDataRequest_ChunksToMove&&) noexcept = default;
+CommitDataRequest_ChunksToMove& CommitDataRequest_ChunksToMove::operator=(CommitDataRequest_ChunksToMove&&) = default;
+
+bool CommitDataRequest_ChunksToMove::operator==(const CommitDataRequest_ChunksToMove& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && page_ == other.page_
+   && chunk_ == other.chunk_
+   && target_buffer_ == other.target_buffer_;
+}
+
+bool CommitDataRequest_ChunksToMove::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* page */:
+        field.get(&page_);
+        break;
+      case 2 /* chunk */:
+        field.get(&chunk_);
+        break;
+      case 3 /* target_buffer */:
+        field.get(&target_buffer_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string CommitDataRequest_ChunksToMove::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> CommitDataRequest_ChunksToMove::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void CommitDataRequest_ChunksToMove::Serialize(::protozero::Message* msg) const {
+  // Field 1: page
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, page_);
+  }
+
+  // Field 2: chunk
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, chunk_);
+  }
+
+  // Field 3: target_buffer
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, target_buffer_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/common/data_source_descriptor.gen.cc
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/common/data_source_descriptor.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+DataSourceDescriptor::DataSourceDescriptor() = default;
+DataSourceDescriptor::~DataSourceDescriptor() = default;
+DataSourceDescriptor::DataSourceDescriptor(const DataSourceDescriptor&) = default;
+DataSourceDescriptor& DataSourceDescriptor::operator=(const DataSourceDescriptor&) = default;
+DataSourceDescriptor::DataSourceDescriptor(DataSourceDescriptor&&) noexcept = default;
+DataSourceDescriptor& DataSourceDescriptor::operator=(DataSourceDescriptor&&) = default;
+
+bool DataSourceDescriptor::operator==(const DataSourceDescriptor& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && name_ == other.name_
+   && will_notify_on_stop_ == other.will_notify_on_stop_
+   && will_notify_on_start_ == other.will_notify_on_start_
+   && handles_incremental_state_clear_ == other.handles_incremental_state_clear_
+   && gpu_counter_descriptor_ == other.gpu_counter_descriptor_
+   && track_event_descriptor_ == other.track_event_descriptor_;
+}
+
+bool DataSourceDescriptor::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* name */:
+        field.get(&name_);
+        break;
+      case 2 /* will_notify_on_stop */:
+        field.get(&will_notify_on_stop_);
+        break;
+      case 3 /* will_notify_on_start */:
+        field.get(&will_notify_on_start_);
+        break;
+      case 4 /* handles_incremental_state_clear */:
+        field.get(&handles_incremental_state_clear_);
+        break;
+      case 5 /* gpu_counter_descriptor */:
+        gpu_counter_descriptor_ = field.as_std_string();
+        break;
+      case 6 /* track_event_descriptor */:
+        track_event_descriptor_ = field.as_std_string();
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string DataSourceDescriptor::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> DataSourceDescriptor::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void DataSourceDescriptor::Serialize(::protozero::Message* msg) const {
+  // Field 1: name
+  if (_has_field_[1]) {
+    msg->AppendString(1, name_);
+  }
+
+  // Field 2: will_notify_on_stop
+  if (_has_field_[2]) {
+    msg->AppendTinyVarInt(2, will_notify_on_stop_);
+  }
+
+  // Field 3: will_notify_on_start
+  if (_has_field_[3]) {
+    msg->AppendTinyVarInt(3, will_notify_on_start_);
+  }
+
+  // Field 4: handles_incremental_state_clear
+  if (_has_field_[4]) {
+    msg->AppendTinyVarInt(4, handles_incremental_state_clear_);
+  }
+
+  // Field 5: gpu_counter_descriptor
+  if (_has_field_[5]) {
+    msg->AppendString(5, gpu_counter_descriptor_);
+  }
+
+  // Field 6: track_event_descriptor
+  if (_has_field_[6]) {
+    msg->AppendString(6, track_event_descriptor_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/common/descriptor.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/common/descriptor.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DESCRIPTOR_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DESCRIPTOR_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class OneofOptions;
+class EnumValueDescriptorProto;
+class EnumDescriptorProto;
+class OneofDescriptorProto;
+class FieldDescriptorProto;
+class DescriptorProto;
+class DescriptorProto_ReservedRange;
+class FileDescriptorProto;
+class FileDescriptorSet;
+enum FieldDescriptorProto_Type : int;
+enum FieldDescriptorProto_Label : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum FieldDescriptorProto_Type : int {
+  FieldDescriptorProto_Type_TYPE_DOUBLE = 1,
+  FieldDescriptorProto_Type_TYPE_FLOAT = 2,
+  FieldDescriptorProto_Type_TYPE_INT64 = 3,
+  FieldDescriptorProto_Type_TYPE_UINT64 = 4,
+  FieldDescriptorProto_Type_TYPE_INT32 = 5,
+  FieldDescriptorProto_Type_TYPE_FIXED64 = 6,
+  FieldDescriptorProto_Type_TYPE_FIXED32 = 7,
+  FieldDescriptorProto_Type_TYPE_BOOL = 8,
+  FieldDescriptorProto_Type_TYPE_STRING = 9,
+  FieldDescriptorProto_Type_TYPE_GROUP = 10,
+  FieldDescriptorProto_Type_TYPE_MESSAGE = 11,
+  FieldDescriptorProto_Type_TYPE_BYTES = 12,
+  FieldDescriptorProto_Type_TYPE_UINT32 = 13,
+  FieldDescriptorProto_Type_TYPE_ENUM = 14,
+  FieldDescriptorProto_Type_TYPE_SFIXED32 = 15,
+  FieldDescriptorProto_Type_TYPE_SFIXED64 = 16,
+  FieldDescriptorProto_Type_TYPE_SINT32 = 17,
+  FieldDescriptorProto_Type_TYPE_SINT64 = 18,
+};
+enum FieldDescriptorProto_Label : int {
+  FieldDescriptorProto_Label_LABEL_OPTIONAL = 1,
+  FieldDescriptorProto_Label_LABEL_REQUIRED = 2,
+  FieldDescriptorProto_Label_LABEL_REPEATED = 3,
+};
+
+class PERFETTO_EXPORT OneofOptions : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  OneofOptions();
+  ~OneofOptions() override;
+  OneofOptions(OneofOptions&&) noexcept;
+  OneofOptions& operator=(OneofOptions&&);
+  OneofOptions(const OneofOptions&);
+  OneofOptions& operator=(const OneofOptions&);
+  bool operator==(const OneofOptions&) const;
+  bool operator!=(const OneofOptions& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT EnumValueDescriptorProto : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNameFieldNumber = 1,
+    kNumberFieldNumber = 2,
+  };
+
+  EnumValueDescriptorProto();
+  ~EnumValueDescriptorProto() override;
+  EnumValueDescriptorProto(EnumValueDescriptorProto&&) noexcept;
+  EnumValueDescriptorProto& operator=(EnumValueDescriptorProto&&);
+  EnumValueDescriptorProto(const EnumValueDescriptorProto&);
+  EnumValueDescriptorProto& operator=(const EnumValueDescriptorProto&);
+  bool operator==(const EnumValueDescriptorProto&) const;
+  bool operator!=(const EnumValueDescriptorProto& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name() const { return _has_field_[1]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
+
+  bool has_number() const { return _has_field_[2]; }
+  int32_t number() const { return number_; }
+  void set_number(int32_t value) { number_ = value; _has_field_.set(2); }
+
+ private:
+  std::string name_{};
+  int32_t number_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT EnumDescriptorProto : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNameFieldNumber = 1,
+    kValueFieldNumber = 2,
+    kReservedNameFieldNumber = 5,
+  };
+
+  EnumDescriptorProto();
+  ~EnumDescriptorProto() override;
+  EnumDescriptorProto(EnumDescriptorProto&&) noexcept;
+  EnumDescriptorProto& operator=(EnumDescriptorProto&&);
+  EnumDescriptorProto(const EnumDescriptorProto&);
+  EnumDescriptorProto& operator=(const EnumDescriptorProto&);
+  bool operator==(const EnumDescriptorProto&) const;
+  bool operator!=(const EnumDescriptorProto& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name() const { return _has_field_[1]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
+
+  const std::vector<EnumValueDescriptorProto>& value() const { return value_; }
+  std::vector<EnumValueDescriptorProto>* mutable_value() { return &value_; }
+  int value_size() const;
+  void clear_value();
+  EnumValueDescriptorProto* add_value();
+
+  const std::vector<std::string>& reserved_name() const { return reserved_name_; }
+  std::vector<std::string>* mutable_reserved_name() { return &reserved_name_; }
+  int reserved_name_size() const { return static_cast<int>(reserved_name_.size()); }
+  void clear_reserved_name() { reserved_name_.clear(); }
+  void add_reserved_name(std::string value) { reserved_name_.emplace_back(value); }
+  std::string* add_reserved_name() { reserved_name_.emplace_back(); return &reserved_name_.back(); }
+
+ private:
+  std::string name_{};
+  std::vector<EnumValueDescriptorProto> value_;
+  std::vector<std::string> reserved_name_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<6> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT OneofDescriptorProto : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNameFieldNumber = 1,
+    kOptionsFieldNumber = 2,
+  };
+
+  OneofDescriptorProto();
+  ~OneofDescriptorProto() override;
+  OneofDescriptorProto(OneofDescriptorProto&&) noexcept;
+  OneofDescriptorProto& operator=(OneofDescriptorProto&&);
+  OneofDescriptorProto(const OneofDescriptorProto&);
+  OneofDescriptorProto& operator=(const OneofDescriptorProto&);
+  bool operator==(const OneofDescriptorProto&) const;
+  bool operator!=(const OneofDescriptorProto& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name() const { return _has_field_[1]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
+
+  bool has_options() const { return _has_field_[2]; }
+  const OneofOptions& options() const { return *options_; }
+  OneofOptions* mutable_options() { _has_field_.set(2); return options_.get(); }
+
+ private:
+  std::string name_{};
+  ::protozero::CopyablePtr<OneofOptions> options_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT FieldDescriptorProto : public ::protozero::CppMessageObj {
+ public:
+  using Type = FieldDescriptorProto_Type;
+  static constexpr auto TYPE_DOUBLE = FieldDescriptorProto_Type_TYPE_DOUBLE;
+  static constexpr auto TYPE_FLOAT = FieldDescriptorProto_Type_TYPE_FLOAT;
+  static constexpr auto TYPE_INT64 = FieldDescriptorProto_Type_TYPE_INT64;
+  static constexpr auto TYPE_UINT64 = FieldDescriptorProto_Type_TYPE_UINT64;
+  static constexpr auto TYPE_INT32 = FieldDescriptorProto_Type_TYPE_INT32;
+  static constexpr auto TYPE_FIXED64 = FieldDescriptorProto_Type_TYPE_FIXED64;
+  static constexpr auto TYPE_FIXED32 = FieldDescriptorProto_Type_TYPE_FIXED32;
+  static constexpr auto TYPE_BOOL = FieldDescriptorProto_Type_TYPE_BOOL;
+  static constexpr auto TYPE_STRING = FieldDescriptorProto_Type_TYPE_STRING;
+  static constexpr auto TYPE_GROUP = FieldDescriptorProto_Type_TYPE_GROUP;
+  static constexpr auto TYPE_MESSAGE = FieldDescriptorProto_Type_TYPE_MESSAGE;
+  static constexpr auto TYPE_BYTES = FieldDescriptorProto_Type_TYPE_BYTES;
+  static constexpr auto TYPE_UINT32 = FieldDescriptorProto_Type_TYPE_UINT32;
+  static constexpr auto TYPE_ENUM = FieldDescriptorProto_Type_TYPE_ENUM;
+  static constexpr auto TYPE_SFIXED32 = FieldDescriptorProto_Type_TYPE_SFIXED32;
+  static constexpr auto TYPE_SFIXED64 = FieldDescriptorProto_Type_TYPE_SFIXED64;
+  static constexpr auto TYPE_SINT32 = FieldDescriptorProto_Type_TYPE_SINT32;
+  static constexpr auto TYPE_SINT64 = FieldDescriptorProto_Type_TYPE_SINT64;
+  static constexpr auto Type_MIN = FieldDescriptorProto_Type_TYPE_DOUBLE;
+  static constexpr auto Type_MAX = FieldDescriptorProto_Type_TYPE_SINT64;
+  using Label = FieldDescriptorProto_Label;
+  static constexpr auto LABEL_OPTIONAL = FieldDescriptorProto_Label_LABEL_OPTIONAL;
+  static constexpr auto LABEL_REQUIRED = FieldDescriptorProto_Label_LABEL_REQUIRED;
+  static constexpr auto LABEL_REPEATED = FieldDescriptorProto_Label_LABEL_REPEATED;
+  static constexpr auto Label_MIN = FieldDescriptorProto_Label_LABEL_OPTIONAL;
+  static constexpr auto Label_MAX = FieldDescriptorProto_Label_LABEL_REPEATED;
+  enum FieldNumbers {
+    kNameFieldNumber = 1,
+    kNumberFieldNumber = 3,
+    kLabelFieldNumber = 4,
+    kTypeFieldNumber = 5,
+    kTypeNameFieldNumber = 6,
+    kExtendeeFieldNumber = 2,
+    kDefaultValueFieldNumber = 7,
+    kOneofIndexFieldNumber = 9,
+  };
+
+  FieldDescriptorProto();
+  ~FieldDescriptorProto() override;
+  FieldDescriptorProto(FieldDescriptorProto&&) noexcept;
+  FieldDescriptorProto& operator=(FieldDescriptorProto&&);
+  FieldDescriptorProto(const FieldDescriptorProto&);
+  FieldDescriptorProto& operator=(const FieldDescriptorProto&);
+  bool operator==(const FieldDescriptorProto&) const;
+  bool operator!=(const FieldDescriptorProto& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name() const { return _has_field_[1]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
+
+  bool has_number() const { return _has_field_[3]; }
+  int32_t number() const { return number_; }
+  void set_number(int32_t value) { number_ = value; _has_field_.set(3); }
+
+  bool has_label() const { return _has_field_[4]; }
+  FieldDescriptorProto_Label label() const { return label_; }
+  void set_label(FieldDescriptorProto_Label value) { label_ = value; _has_field_.set(4); }
+
+  bool has_type() const { return _has_field_[5]; }
+  FieldDescriptorProto_Type type() const { return type_; }
+  void set_type(FieldDescriptorProto_Type value) { type_ = value; _has_field_.set(5); }
+
+  bool has_type_name() const { return _has_field_[6]; }
+  const std::string& type_name() const { return type_name_; }
+  void set_type_name(const std::string& value) { type_name_ = value; _has_field_.set(6); }
+
+  bool has_extendee() const { return _has_field_[2]; }
+  const std::string& extendee() const { return extendee_; }
+  void set_extendee(const std::string& value) { extendee_ = value; _has_field_.set(2); }
+
+  bool has_default_value() const { return _has_field_[7]; }
+  const std::string& default_value() const { return default_value_; }
+  void set_default_value(const std::string& value) { default_value_ = value; _has_field_.set(7); }
+
+  bool has_oneof_index() const { return _has_field_[9]; }
+  int32_t oneof_index() const { return oneof_index_; }
+  void set_oneof_index(int32_t value) { oneof_index_ = value; _has_field_.set(9); }
+
+ private:
+  std::string name_{};
+  int32_t number_{};
+  FieldDescriptorProto_Label label_{};
+  FieldDescriptorProto_Type type_{};
+  std::string type_name_{};
+  std::string extendee_{};
+  std::string default_value_{};
+  int32_t oneof_index_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<10> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT DescriptorProto : public ::protozero::CppMessageObj {
+ public:
+  using ReservedRange = DescriptorProto_ReservedRange;
+  enum FieldNumbers {
+    kNameFieldNumber = 1,
+    kFieldFieldNumber = 2,
+    kExtensionFieldNumber = 6,
+    kNestedTypeFieldNumber = 3,
+    kEnumTypeFieldNumber = 4,
+    kOneofDeclFieldNumber = 8,
+    kReservedRangeFieldNumber = 9,
+    kReservedNameFieldNumber = 10,
+  };
+
+  DescriptorProto();
+  ~DescriptorProto() override;
+  DescriptorProto(DescriptorProto&&) noexcept;
+  DescriptorProto& operator=(DescriptorProto&&);
+  DescriptorProto(const DescriptorProto&);
+  DescriptorProto& operator=(const DescriptorProto&);
+  bool operator==(const DescriptorProto&) const;
+  bool operator!=(const DescriptorProto& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name() const { return _has_field_[1]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
+
+  const std::vector<FieldDescriptorProto>& field() const { return field_; }
+  std::vector<FieldDescriptorProto>* mutable_field() { return &field_; }
+  int field_size() const;
+  void clear_field();
+  FieldDescriptorProto* add_field();
+
+  const std::vector<FieldDescriptorProto>& extension() const { return extension_; }
+  std::vector<FieldDescriptorProto>* mutable_extension() { return &extension_; }
+  int extension_size() const;
+  void clear_extension();
+  FieldDescriptorProto* add_extension();
+
+  const std::vector<DescriptorProto>& nested_type() const { return nested_type_; }
+  std::vector<DescriptorProto>* mutable_nested_type() { return &nested_type_; }
+  int nested_type_size() const;
+  void clear_nested_type();
+  DescriptorProto* add_nested_type();
+
+  const std::vector<EnumDescriptorProto>& enum_type() const { return enum_type_; }
+  std::vector<EnumDescriptorProto>* mutable_enum_type() { return &enum_type_; }
+  int enum_type_size() const;
+  void clear_enum_type();
+  EnumDescriptorProto* add_enum_type();
+
+  const std::vector<OneofDescriptorProto>& oneof_decl() const { return oneof_decl_; }
+  std::vector<OneofDescriptorProto>* mutable_oneof_decl() { return &oneof_decl_; }
+  int oneof_decl_size() const;
+  void clear_oneof_decl();
+  OneofDescriptorProto* add_oneof_decl();
+
+  const std::vector<DescriptorProto_ReservedRange>& reserved_range() const { return reserved_range_; }
+  std::vector<DescriptorProto_ReservedRange>* mutable_reserved_range() { return &reserved_range_; }
+  int reserved_range_size() const;
+  void clear_reserved_range();
+  DescriptorProto_ReservedRange* add_reserved_range();
+
+  const std::vector<std::string>& reserved_name() const { return reserved_name_; }
+  std::vector<std::string>* mutable_reserved_name() { return &reserved_name_; }
+  int reserved_name_size() const { return static_cast<int>(reserved_name_.size()); }
+  void clear_reserved_name() { reserved_name_.clear(); }
+  void add_reserved_name(std::string value) { reserved_name_.emplace_back(value); }
+  std::string* add_reserved_name() { reserved_name_.emplace_back(); return &reserved_name_.back(); }
+
+ private:
+  std::string name_{};
+  std::vector<FieldDescriptorProto> field_;
+  std::vector<FieldDescriptorProto> extension_;
+  std::vector<DescriptorProto> nested_type_;
+  std::vector<EnumDescriptorProto> enum_type_;
+  std::vector<OneofDescriptorProto> oneof_decl_;
+  std::vector<DescriptorProto_ReservedRange> reserved_range_;
+  std::vector<std::string> reserved_name_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<11> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT DescriptorProto_ReservedRange : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kStartFieldNumber = 1,
+    kEndFieldNumber = 2,
+  };
+
+  DescriptorProto_ReservedRange();
+  ~DescriptorProto_ReservedRange() override;
+  DescriptorProto_ReservedRange(DescriptorProto_ReservedRange&&) noexcept;
+  DescriptorProto_ReservedRange& operator=(DescriptorProto_ReservedRange&&);
+  DescriptorProto_ReservedRange(const DescriptorProto_ReservedRange&);
+  DescriptorProto_ReservedRange& operator=(const DescriptorProto_ReservedRange&);
+  bool operator==(const DescriptorProto_ReservedRange&) const;
+  bool operator!=(const DescriptorProto_ReservedRange& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_start() const { return _has_field_[1]; }
+  int32_t start() const { return start_; }
+  void set_start(int32_t value) { start_ = value; _has_field_.set(1); }
+
+  bool has_end() const { return _has_field_[2]; }
+  int32_t end() const { return end_; }
+  void set_end(int32_t value) { end_ = value; _has_field_.set(2); }
+
+ private:
+  int32_t start_{};
+  int32_t end_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT FileDescriptorProto : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNameFieldNumber = 1,
+    kPackageFieldNumber = 2,
+    kDependencyFieldNumber = 3,
+    kPublicDependencyFieldNumber = 10,
+    kWeakDependencyFieldNumber = 11,
+    kMessageTypeFieldNumber = 4,
+    kEnumTypeFieldNumber = 5,
+    kExtensionFieldNumber = 7,
+  };
+
+  FileDescriptorProto();
+  ~FileDescriptorProto() override;
+  FileDescriptorProto(FileDescriptorProto&&) noexcept;
+  FileDescriptorProto& operator=(FileDescriptorProto&&);
+  FileDescriptorProto(const FileDescriptorProto&);
+  FileDescriptorProto& operator=(const FileDescriptorProto&);
+  bool operator==(const FileDescriptorProto&) const;
+  bool operator!=(const FileDescriptorProto& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name() const { return _has_field_[1]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
+
+  bool has_package() const { return _has_field_[2]; }
+  const std::string& package() const { return package_; }
+  void set_package(const std::string& value) { package_ = value; _has_field_.set(2); }
+
+  const std::vector<std::string>& dependency() const { return dependency_; }
+  std::vector<std::string>* mutable_dependency() { return &dependency_; }
+  int dependency_size() const { return static_cast<int>(dependency_.size()); }
+  void clear_dependency() { dependency_.clear(); }
+  void add_dependency(std::string value) { dependency_.emplace_back(value); }
+  std::string* add_dependency() { dependency_.emplace_back(); return &dependency_.back(); }
+
+  const std::vector<int32_t>& public_dependency() const { return public_dependency_; }
+  std::vector<int32_t>* mutable_public_dependency() { return &public_dependency_; }
+  int public_dependency_size() const { return static_cast<int>(public_dependency_.size()); }
+  void clear_public_dependency() { public_dependency_.clear(); }
+  void add_public_dependency(int32_t value) { public_dependency_.emplace_back(value); }
+  int32_t* add_public_dependency() { public_dependency_.emplace_back(); return &public_dependency_.back(); }
+
+  const std::vector<int32_t>& weak_dependency() const { return weak_dependency_; }
+  std::vector<int32_t>* mutable_weak_dependency() { return &weak_dependency_; }
+  int weak_dependency_size() const { return static_cast<int>(weak_dependency_.size()); }
+  void clear_weak_dependency() { weak_dependency_.clear(); }
+  void add_weak_dependency(int32_t value) { weak_dependency_.emplace_back(value); }
+  int32_t* add_weak_dependency() { weak_dependency_.emplace_back(); return &weak_dependency_.back(); }
+
+  const std::vector<DescriptorProto>& message_type() const { return message_type_; }
+  std::vector<DescriptorProto>* mutable_message_type() { return &message_type_; }
+  int message_type_size() const;
+  void clear_message_type();
+  DescriptorProto* add_message_type();
+
+  const std::vector<EnumDescriptorProto>& enum_type() const { return enum_type_; }
+  std::vector<EnumDescriptorProto>* mutable_enum_type() { return &enum_type_; }
+  int enum_type_size() const;
+  void clear_enum_type();
+  EnumDescriptorProto* add_enum_type();
+
+  const std::vector<FieldDescriptorProto>& extension() const { return extension_; }
+  std::vector<FieldDescriptorProto>* mutable_extension() { return &extension_; }
+  int extension_size() const;
+  void clear_extension();
+  FieldDescriptorProto* add_extension();
+
+ private:
+  std::string name_{};
+  std::string package_{};
+  std::vector<std::string> dependency_;
+  std::vector<int32_t> public_dependency_;
+  std::vector<int32_t> weak_dependency_;
+  std::vector<DescriptorProto> message_type_;
+  std::vector<EnumDescriptorProto> enum_type_;
+  std::vector<FieldDescriptorProto> extension_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<12> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT FileDescriptorSet : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kFileFieldNumber = 1,
+  };
+
+  FileDescriptorSet();
+  ~FileDescriptorSet() override;
+  FileDescriptorSet(FileDescriptorSet&&) noexcept;
+  FileDescriptorSet& operator=(FileDescriptorSet&&);
+  FileDescriptorSet(const FileDescriptorSet&);
+  FileDescriptorSet& operator=(const FileDescriptorSet&);
+  bool operator==(const FileDescriptorSet&) const;
+  bool operator!=(const FileDescriptorSet& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<FileDescriptorProto>& file() const { return file_; }
+  std::vector<FileDescriptorProto>* mutable_file() { return &file_; }
+  int file_size() const;
+  void clear_file();
+  FileDescriptorProto* add_file();
+
+ private:
+  std::vector<FileDescriptorProto> file_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DESCRIPTOR_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/common/descriptor.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+OneofOptions::OneofOptions() = default;
+OneofOptions::~OneofOptions() = default;
+OneofOptions::OneofOptions(const OneofOptions&) = default;
+OneofOptions& OneofOptions::operator=(const OneofOptions&) = default;
+OneofOptions::OneofOptions(OneofOptions&&) noexcept = default;
+OneofOptions& OneofOptions::operator=(OneofOptions&&) = default;
+
+bool OneofOptions::operator==(const OneofOptions& other) const {
+  return unknown_fields_ == other.unknown_fields_;
+}
+
+bool OneofOptions::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string OneofOptions::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> OneofOptions::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void OneofOptions::Serialize(::protozero::Message* msg) const {
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+EnumValueDescriptorProto::EnumValueDescriptorProto() = default;
+EnumValueDescriptorProto::~EnumValueDescriptorProto() = default;
+EnumValueDescriptorProto::EnumValueDescriptorProto(const EnumValueDescriptorProto&) = default;
+EnumValueDescriptorProto& EnumValueDescriptorProto::operator=(const EnumValueDescriptorProto&) = default;
+EnumValueDescriptorProto::EnumValueDescriptorProto(EnumValueDescriptorProto&&) noexcept = default;
+EnumValueDescriptorProto& EnumValueDescriptorProto::operator=(EnumValueDescriptorProto&&) = default;
+
+bool EnumValueDescriptorProto::operator==(const EnumValueDescriptorProto& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && name_ == other.name_
+   && number_ == other.number_;
+}
+
+bool EnumValueDescriptorProto::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* name */:
+        field.get(&name_);
+        break;
+      case 2 /* number */:
+        field.get(&number_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string EnumValueDescriptorProto::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> EnumValueDescriptorProto::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void EnumValueDescriptorProto::Serialize(::protozero::Message* msg) const {
+  // Field 1: name
+  if (_has_field_[1]) {
+    msg->AppendString(1, name_);
+  }
+
+  // Field 2: number
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, number_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+EnumDescriptorProto::EnumDescriptorProto() = default;
+EnumDescriptorProto::~EnumDescriptorProto() = default;
+EnumDescriptorProto::EnumDescriptorProto(const EnumDescriptorProto&) = default;
+EnumDescriptorProto& EnumDescriptorProto::operator=(const EnumDescriptorProto&) = default;
+EnumDescriptorProto::EnumDescriptorProto(EnumDescriptorProto&&) noexcept = default;
+EnumDescriptorProto& EnumDescriptorProto::operator=(EnumDescriptorProto&&) = default;
+
+bool EnumDescriptorProto::operator==(const EnumDescriptorProto& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && name_ == other.name_
+   && value_ == other.value_
+   && reserved_name_ == other.reserved_name_;
+}
+
+int EnumDescriptorProto::value_size() const { return static_cast<int>(value_.size()); }
+void EnumDescriptorProto::clear_value() { value_.clear(); }
+EnumValueDescriptorProto* EnumDescriptorProto::add_value() { value_.emplace_back(); return &value_.back(); }
+bool EnumDescriptorProto::ParseFromArray(const void* raw, size_t size) {
+  value_.clear();
+  reserved_name_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* name */:
+        field.get(&name_);
+        break;
+      case 2 /* value */:
+        value_.emplace_back();
+        value_.back().ParseFromArray(field.data(), field.size());
+        break;
+      case 5 /* reserved_name */:
+        reserved_name_.emplace_back();
+        field.get(&reserved_name_.back());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string EnumDescriptorProto::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> EnumDescriptorProto::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void EnumDescriptorProto::Serialize(::protozero::Message* msg) const {
+  // Field 1: name
+  if (_has_field_[1]) {
+    msg->AppendString(1, name_);
+  }
+
+  // Field 2: value
+  for (auto& it : value_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(2));
+  }
+
+  // Field 5: reserved_name
+  for (auto& it : reserved_name_) {
+    msg->AppendString(5, it);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+OneofDescriptorProto::OneofDescriptorProto() = default;
+OneofDescriptorProto::~OneofDescriptorProto() = default;
+OneofDescriptorProto::OneofDescriptorProto(const OneofDescriptorProto&) = default;
+OneofDescriptorProto& OneofDescriptorProto::operator=(const OneofDescriptorProto&) = default;
+OneofDescriptorProto::OneofDescriptorProto(OneofDescriptorProto&&) noexcept = default;
+OneofDescriptorProto& OneofDescriptorProto::operator=(OneofDescriptorProto&&) = default;
+
+bool OneofDescriptorProto::operator==(const OneofDescriptorProto& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && name_ == other.name_
+   && options_ == other.options_;
+}
+
+bool OneofDescriptorProto::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* name */:
+        field.get(&name_);
+        break;
+      case 2 /* options */:
+        (*options_).ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string OneofDescriptorProto::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> OneofDescriptorProto::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void OneofDescriptorProto::Serialize(::protozero::Message* msg) const {
+  // Field 1: name
+  if (_has_field_[1]) {
+    msg->AppendString(1, name_);
+  }
+
+  // Field 2: options
+  if (_has_field_[2]) {
+    (*options_).Serialize(msg->BeginNestedMessage<::protozero::Message>(2));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+FieldDescriptorProto::FieldDescriptorProto() = default;
+FieldDescriptorProto::~FieldDescriptorProto() = default;
+FieldDescriptorProto::FieldDescriptorProto(const FieldDescriptorProto&) = default;
+FieldDescriptorProto& FieldDescriptorProto::operator=(const FieldDescriptorProto&) = default;
+FieldDescriptorProto::FieldDescriptorProto(FieldDescriptorProto&&) noexcept = default;
+FieldDescriptorProto& FieldDescriptorProto::operator=(FieldDescriptorProto&&) = default;
+
+bool FieldDescriptorProto::operator==(const FieldDescriptorProto& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && name_ == other.name_
+   && number_ == other.number_
+   && label_ == other.label_
+   && type_ == other.type_
+   && type_name_ == other.type_name_
+   && extendee_ == other.extendee_
+   && default_value_ == other.default_value_
+   && oneof_index_ == other.oneof_index_;
+}
+
+bool FieldDescriptorProto::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* name */:
+        field.get(&name_);
+        break;
+      case 3 /* number */:
+        field.get(&number_);
+        break;
+      case 4 /* label */:
+        field.get(&label_);
+        break;
+      case 5 /* type */:
+        field.get(&type_);
+        break;
+      case 6 /* type_name */:
+        field.get(&type_name_);
+        break;
+      case 2 /* extendee */:
+        field.get(&extendee_);
+        break;
+      case 7 /* default_value */:
+        field.get(&default_value_);
+        break;
+      case 9 /* oneof_index */:
+        field.get(&oneof_index_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string FieldDescriptorProto::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> FieldDescriptorProto::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void FieldDescriptorProto::Serialize(::protozero::Message* msg) const {
+  // Field 1: name
+  if (_has_field_[1]) {
+    msg->AppendString(1, name_);
+  }
+
+  // Field 3: number
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, number_);
+  }
+
+  // Field 4: label
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, label_);
+  }
+
+  // Field 5: type
+  if (_has_field_[5]) {
+    msg->AppendVarInt(5, type_);
+  }
+
+  // Field 6: type_name
+  if (_has_field_[6]) {
+    msg->AppendString(6, type_name_);
+  }
+
+  // Field 2: extendee
+  if (_has_field_[2]) {
+    msg->AppendString(2, extendee_);
+  }
+
+  // Field 7: default_value
+  if (_has_field_[7]) {
+    msg->AppendString(7, default_value_);
+  }
+
+  // Field 9: oneof_index
+  if (_has_field_[9]) {
+    msg->AppendVarInt(9, oneof_index_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+DescriptorProto::DescriptorProto() = default;
+DescriptorProto::~DescriptorProto() = default;
+DescriptorProto::DescriptorProto(const DescriptorProto&) = default;
+DescriptorProto& DescriptorProto::operator=(const DescriptorProto&) = default;
+DescriptorProto::DescriptorProto(DescriptorProto&&) noexcept = default;
+DescriptorProto& DescriptorProto::operator=(DescriptorProto&&) = default;
+
+bool DescriptorProto::operator==(const DescriptorProto& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && name_ == other.name_
+   && field_ == other.field_
+   && extension_ == other.extension_
+   && nested_type_ == other.nested_type_
+   && enum_type_ == other.enum_type_
+   && oneof_decl_ == other.oneof_decl_
+   && reserved_range_ == other.reserved_range_
+   && reserved_name_ == other.reserved_name_;
+}
+
+int DescriptorProto::field_size() const { return static_cast<int>(field_.size()); }
+void DescriptorProto::clear_field() { field_.clear(); }
+FieldDescriptorProto* DescriptorProto::add_field() { field_.emplace_back(); return &field_.back(); }
+int DescriptorProto::extension_size() const { return static_cast<int>(extension_.size()); }
+void DescriptorProto::clear_extension() { extension_.clear(); }
+FieldDescriptorProto* DescriptorProto::add_extension() { extension_.emplace_back(); return &extension_.back(); }
+int DescriptorProto::nested_type_size() const { return static_cast<int>(nested_type_.size()); }
+void DescriptorProto::clear_nested_type() { nested_type_.clear(); }
+DescriptorProto* DescriptorProto::add_nested_type() { nested_type_.emplace_back(); return &nested_type_.back(); }
+int DescriptorProto::enum_type_size() const { return static_cast<int>(enum_type_.size()); }
+void DescriptorProto::clear_enum_type() { enum_type_.clear(); }
+EnumDescriptorProto* DescriptorProto::add_enum_type() { enum_type_.emplace_back(); return &enum_type_.back(); }
+int DescriptorProto::oneof_decl_size() const { return static_cast<int>(oneof_decl_.size()); }
+void DescriptorProto::clear_oneof_decl() { oneof_decl_.clear(); }
+OneofDescriptorProto* DescriptorProto::add_oneof_decl() { oneof_decl_.emplace_back(); return &oneof_decl_.back(); }
+int DescriptorProto::reserved_range_size() const { return static_cast<int>(reserved_range_.size()); }
+void DescriptorProto::clear_reserved_range() { reserved_range_.clear(); }
+DescriptorProto_ReservedRange* DescriptorProto::add_reserved_range() { reserved_range_.emplace_back(); return &reserved_range_.back(); }
+bool DescriptorProto::ParseFromArray(const void* raw, size_t size) {
+  field_.clear();
+  extension_.clear();
+  nested_type_.clear();
+  enum_type_.clear();
+  oneof_decl_.clear();
+  reserved_range_.clear();
+  reserved_name_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* name */:
+        field.get(&name_);
+        break;
+      case 2 /* field */:
+        field_.emplace_back();
+        field_.back().ParseFromArray(field.data(), field.size());
+        break;
+      case 6 /* extension */:
+        extension_.emplace_back();
+        extension_.back().ParseFromArray(field.data(), field.size());
+        break;
+      case 3 /* nested_type */:
+        nested_type_.emplace_back();
+        nested_type_.back().ParseFromArray(field.data(), field.size());
+        break;
+      case 4 /* enum_type */:
+        enum_type_.emplace_back();
+        enum_type_.back().ParseFromArray(field.data(), field.size());
+        break;
+      case 8 /* oneof_decl */:
+        oneof_decl_.emplace_back();
+        oneof_decl_.back().ParseFromArray(field.data(), field.size());
+        break;
+      case 9 /* reserved_range */:
+        reserved_range_.emplace_back();
+        reserved_range_.back().ParseFromArray(field.data(), field.size());
+        break;
+      case 10 /* reserved_name */:
+        reserved_name_.emplace_back();
+        field.get(&reserved_name_.back());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string DescriptorProto::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> DescriptorProto::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void DescriptorProto::Serialize(::protozero::Message* msg) const {
+  // Field 1: name
+  if (_has_field_[1]) {
+    msg->AppendString(1, name_);
+  }
+
+  // Field 2: field
+  for (auto& it : field_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(2));
+  }
+
+  // Field 6: extension
+  for (auto& it : extension_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(6));
+  }
+
+  // Field 3: nested_type
+  for (auto& it : nested_type_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(3));
+  }
+
+  // Field 4: enum_type
+  for (auto& it : enum_type_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(4));
+  }
+
+  // Field 8: oneof_decl
+  for (auto& it : oneof_decl_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(8));
+  }
+
+  // Field 9: reserved_range
+  for (auto& it : reserved_range_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(9));
+  }
+
+  // Field 10: reserved_name
+  for (auto& it : reserved_name_) {
+    msg->AppendString(10, it);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+DescriptorProto_ReservedRange::DescriptorProto_ReservedRange() = default;
+DescriptorProto_ReservedRange::~DescriptorProto_ReservedRange() = default;
+DescriptorProto_ReservedRange::DescriptorProto_ReservedRange(const DescriptorProto_ReservedRange&) = default;
+DescriptorProto_ReservedRange& DescriptorProto_ReservedRange::operator=(const DescriptorProto_ReservedRange&) = default;
+DescriptorProto_ReservedRange::DescriptorProto_ReservedRange(DescriptorProto_ReservedRange&&) noexcept = default;
+DescriptorProto_ReservedRange& DescriptorProto_ReservedRange::operator=(DescriptorProto_ReservedRange&&) = default;
+
+bool DescriptorProto_ReservedRange::operator==(const DescriptorProto_ReservedRange& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && start_ == other.start_
+   && end_ == other.end_;
+}
+
+bool DescriptorProto_ReservedRange::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* start */:
+        field.get(&start_);
+        break;
+      case 2 /* end */:
+        field.get(&end_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string DescriptorProto_ReservedRange::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> DescriptorProto_ReservedRange::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void DescriptorProto_ReservedRange::Serialize(::protozero::Message* msg) const {
+  // Field 1: start
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, start_);
+  }
+
+  // Field 2: end
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, end_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+FileDescriptorProto::FileDescriptorProto() = default;
+FileDescriptorProto::~FileDescriptorProto() = default;
+FileDescriptorProto::FileDescriptorProto(const FileDescriptorProto&) = default;
+FileDescriptorProto& FileDescriptorProto::operator=(const FileDescriptorProto&) = default;
+FileDescriptorProto::FileDescriptorProto(FileDescriptorProto&&) noexcept = default;
+FileDescriptorProto& FileDescriptorProto::operator=(FileDescriptorProto&&) = default;
+
+bool FileDescriptorProto::operator==(const FileDescriptorProto& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && name_ == other.name_
+   && package_ == other.package_
+   && dependency_ == other.dependency_
+   && public_dependency_ == other.public_dependency_
+   && weak_dependency_ == other.weak_dependency_
+   && message_type_ == other.message_type_
+   && enum_type_ == other.enum_type_
+   && extension_ == other.extension_;
+}
+
+int FileDescriptorProto::message_type_size() const { return static_cast<int>(message_type_.size()); }
+void FileDescriptorProto::clear_message_type() { message_type_.clear(); }
+DescriptorProto* FileDescriptorProto::add_message_type() { message_type_.emplace_back(); return &message_type_.back(); }
+int FileDescriptorProto::enum_type_size() const { return static_cast<int>(enum_type_.size()); }
+void FileDescriptorProto::clear_enum_type() { enum_type_.clear(); }
+EnumDescriptorProto* FileDescriptorProto::add_enum_type() { enum_type_.emplace_back(); return &enum_type_.back(); }
+int FileDescriptorProto::extension_size() const { return static_cast<int>(extension_.size()); }
+void FileDescriptorProto::clear_extension() { extension_.clear(); }
+FieldDescriptorProto* FileDescriptorProto::add_extension() { extension_.emplace_back(); return &extension_.back(); }
+bool FileDescriptorProto::ParseFromArray(const void* raw, size_t size) {
+  dependency_.clear();
+  public_dependency_.clear();
+  weak_dependency_.clear();
+  message_type_.clear();
+  enum_type_.clear();
+  extension_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* name */:
+        field.get(&name_);
+        break;
+      case 2 /* package */:
+        field.get(&package_);
+        break;
+      case 3 /* dependency */:
+        dependency_.emplace_back();
+        field.get(&dependency_.back());
+        break;
+      case 10 /* public_dependency */:
+        public_dependency_.emplace_back();
+        field.get(&public_dependency_.back());
+        break;
+      case 11 /* weak_dependency */:
+        weak_dependency_.emplace_back();
+        field.get(&weak_dependency_.back());
+        break;
+      case 4 /* message_type */:
+        message_type_.emplace_back();
+        message_type_.back().ParseFromArray(field.data(), field.size());
+        break;
+      case 5 /* enum_type */:
+        enum_type_.emplace_back();
+        enum_type_.back().ParseFromArray(field.data(), field.size());
+        break;
+      case 7 /* extension */:
+        extension_.emplace_back();
+        extension_.back().ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string FileDescriptorProto::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> FileDescriptorProto::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void FileDescriptorProto::Serialize(::protozero::Message* msg) const {
+  // Field 1: name
+  if (_has_field_[1]) {
+    msg->AppendString(1, name_);
+  }
+
+  // Field 2: package
+  if (_has_field_[2]) {
+    msg->AppendString(2, package_);
+  }
+
+  // Field 3: dependency
+  for (auto& it : dependency_) {
+    msg->AppendString(3, it);
+  }
+
+  // Field 10: public_dependency
+  for (auto& it : public_dependency_) {
+    msg->AppendVarInt(10, it);
+  }
+
+  // Field 11: weak_dependency
+  for (auto& it : weak_dependency_) {
+    msg->AppendVarInt(11, it);
+  }
+
+  // Field 4: message_type
+  for (auto& it : message_type_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(4));
+  }
+
+  // Field 5: enum_type
+  for (auto& it : enum_type_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(5));
+  }
+
+  // Field 7: extension
+  for (auto& it : extension_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(7));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+FileDescriptorSet::FileDescriptorSet() = default;
+FileDescriptorSet::~FileDescriptorSet() = default;
+FileDescriptorSet::FileDescriptorSet(const FileDescriptorSet&) = default;
+FileDescriptorSet& FileDescriptorSet::operator=(const FileDescriptorSet&) = default;
+FileDescriptorSet::FileDescriptorSet(FileDescriptorSet&&) noexcept = default;
+FileDescriptorSet& FileDescriptorSet::operator=(FileDescriptorSet&&) = default;
+
+bool FileDescriptorSet::operator==(const FileDescriptorSet& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && file_ == other.file_;
+}
+
+int FileDescriptorSet::file_size() const { return static_cast<int>(file_.size()); }
+void FileDescriptorSet::clear_file() { file_.clear(); }
+FileDescriptorProto* FileDescriptorSet::add_file() { file_.emplace_back(); return &file_.back(); }
+bool FileDescriptorSet::ParseFromArray(const void* raw, size_t size) {
+  file_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* file */:
+        file_.emplace_back();
+        file_.back().ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string FileDescriptorSet::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> FileDescriptorSet::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void FileDescriptorSet::Serialize(::protozero::Message* msg) const {
+  // Field 1: file
+  for (auto& it : file_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(1));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/common/gpu_counter_descriptor.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/common/gpu_counter_descriptor.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_GPU_COUNTER_DESCRIPTOR_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_GPU_COUNTER_DESCRIPTOR_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class GpuCounterDescriptor;
+class GpuCounterDescriptor_GpuCounterBlock;
+class GpuCounterDescriptor_GpuCounterSpec;
+enum GpuCounterDescriptor_GpuCounterGroup : int;
+enum GpuCounterDescriptor_MeasureUnit : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum GpuCounterDescriptor_GpuCounterGroup : int {
+  GpuCounterDescriptor_GpuCounterGroup_UNCLASSIFIED = 0,
+  GpuCounterDescriptor_GpuCounterGroup_SYSTEM = 1,
+  GpuCounterDescriptor_GpuCounterGroup_VERTICES = 2,
+  GpuCounterDescriptor_GpuCounterGroup_FRAGMENTS = 3,
+  GpuCounterDescriptor_GpuCounterGroup_PRIMITIVES = 4,
+  GpuCounterDescriptor_GpuCounterGroup_MEMORY = 5,
+  GpuCounterDescriptor_GpuCounterGroup_COMPUTE = 6,
+};
+enum GpuCounterDescriptor_MeasureUnit : int {
+  GpuCounterDescriptor_MeasureUnit_NONE = 0,
+  GpuCounterDescriptor_MeasureUnit_BIT = 1,
+  GpuCounterDescriptor_MeasureUnit_KILOBIT = 2,
+  GpuCounterDescriptor_MeasureUnit_MEGABIT = 3,
+  GpuCounterDescriptor_MeasureUnit_GIGABIT = 4,
+  GpuCounterDescriptor_MeasureUnit_TERABIT = 5,
+  GpuCounterDescriptor_MeasureUnit_PETABIT = 6,
+  GpuCounterDescriptor_MeasureUnit_BYTE = 7,
+  GpuCounterDescriptor_MeasureUnit_KILOBYTE = 8,
+  GpuCounterDescriptor_MeasureUnit_MEGABYTE = 9,
+  GpuCounterDescriptor_MeasureUnit_GIGABYTE = 10,
+  GpuCounterDescriptor_MeasureUnit_TERABYTE = 11,
+  GpuCounterDescriptor_MeasureUnit_PETABYTE = 12,
+  GpuCounterDescriptor_MeasureUnit_HERTZ = 13,
+  GpuCounterDescriptor_MeasureUnit_KILOHERTZ = 14,
+  GpuCounterDescriptor_MeasureUnit_MEGAHERTZ = 15,
+  GpuCounterDescriptor_MeasureUnit_GIGAHERTZ = 16,
+  GpuCounterDescriptor_MeasureUnit_TERAHERTZ = 17,
+  GpuCounterDescriptor_MeasureUnit_PETAHERTZ = 18,
+  GpuCounterDescriptor_MeasureUnit_NANOSECOND = 19,
+  GpuCounterDescriptor_MeasureUnit_MICROSECOND = 20,
+  GpuCounterDescriptor_MeasureUnit_MILLISECOND = 21,
+  GpuCounterDescriptor_MeasureUnit_SECOND = 22,
+  GpuCounterDescriptor_MeasureUnit_MINUTE = 23,
+  GpuCounterDescriptor_MeasureUnit_HOUR = 24,
+  GpuCounterDescriptor_MeasureUnit_VERTEX = 25,
+  GpuCounterDescriptor_MeasureUnit_PIXEL = 26,
+  GpuCounterDescriptor_MeasureUnit_TRIANGLE = 27,
+  GpuCounterDescriptor_MeasureUnit_PRIMITIVE = 38,
+  GpuCounterDescriptor_MeasureUnit_FRAGMENT = 39,
+  GpuCounterDescriptor_MeasureUnit_MILLIWATT = 28,
+  GpuCounterDescriptor_MeasureUnit_WATT = 29,
+  GpuCounterDescriptor_MeasureUnit_KILOWATT = 30,
+  GpuCounterDescriptor_MeasureUnit_JOULE = 31,
+  GpuCounterDescriptor_MeasureUnit_VOLT = 32,
+  GpuCounterDescriptor_MeasureUnit_AMPERE = 33,
+  GpuCounterDescriptor_MeasureUnit_CELSIUS = 34,
+  GpuCounterDescriptor_MeasureUnit_FAHRENHEIT = 35,
+  GpuCounterDescriptor_MeasureUnit_KELVIN = 36,
+  GpuCounterDescriptor_MeasureUnit_PERCENT = 37,
+  GpuCounterDescriptor_MeasureUnit_INSTRUCTION = 40,
+};
+
+class PERFETTO_EXPORT GpuCounterDescriptor : public ::protozero::CppMessageObj {
+ public:
+  using GpuCounterSpec = GpuCounterDescriptor_GpuCounterSpec;
+  using GpuCounterBlock = GpuCounterDescriptor_GpuCounterBlock;
+  using GpuCounterGroup = GpuCounterDescriptor_GpuCounterGroup;
+  static constexpr auto UNCLASSIFIED = GpuCounterDescriptor_GpuCounterGroup_UNCLASSIFIED;
+  static constexpr auto SYSTEM = GpuCounterDescriptor_GpuCounterGroup_SYSTEM;
+  static constexpr auto VERTICES = GpuCounterDescriptor_GpuCounterGroup_VERTICES;
+  static constexpr auto FRAGMENTS = GpuCounterDescriptor_GpuCounterGroup_FRAGMENTS;
+  static constexpr auto PRIMITIVES = GpuCounterDescriptor_GpuCounterGroup_PRIMITIVES;
+  static constexpr auto MEMORY = GpuCounterDescriptor_GpuCounterGroup_MEMORY;
+  static constexpr auto COMPUTE = GpuCounterDescriptor_GpuCounterGroup_COMPUTE;
+  static constexpr auto GpuCounterGroup_MIN = GpuCounterDescriptor_GpuCounterGroup_UNCLASSIFIED;
+  static constexpr auto GpuCounterGroup_MAX = GpuCounterDescriptor_GpuCounterGroup_COMPUTE;
+  using MeasureUnit = GpuCounterDescriptor_MeasureUnit;
+  static constexpr auto NONE = GpuCounterDescriptor_MeasureUnit_NONE;
+  static constexpr auto BIT = GpuCounterDescriptor_MeasureUnit_BIT;
+  static constexpr auto KILOBIT = GpuCounterDescriptor_MeasureUnit_KILOBIT;
+  static constexpr auto MEGABIT = GpuCounterDescriptor_MeasureUnit_MEGABIT;
+  static constexpr auto GIGABIT = GpuCounterDescriptor_MeasureUnit_GIGABIT;
+  static constexpr auto TERABIT = GpuCounterDescriptor_MeasureUnit_TERABIT;
+  static constexpr auto PETABIT = GpuCounterDescriptor_MeasureUnit_PETABIT;
+  static constexpr auto BYTE = GpuCounterDescriptor_MeasureUnit_BYTE;
+  static constexpr auto KILOBYTE = GpuCounterDescriptor_MeasureUnit_KILOBYTE;
+  static constexpr auto MEGABYTE = GpuCounterDescriptor_MeasureUnit_MEGABYTE;
+  static constexpr auto GIGABYTE = GpuCounterDescriptor_MeasureUnit_GIGABYTE;
+  static constexpr auto TERABYTE = GpuCounterDescriptor_MeasureUnit_TERABYTE;
+  static constexpr auto PETABYTE = GpuCounterDescriptor_MeasureUnit_PETABYTE;
+  static constexpr auto HERTZ = GpuCounterDescriptor_MeasureUnit_HERTZ;
+  static constexpr auto KILOHERTZ = GpuCounterDescriptor_MeasureUnit_KILOHERTZ;
+  static constexpr auto MEGAHERTZ = GpuCounterDescriptor_MeasureUnit_MEGAHERTZ;
+  static constexpr auto GIGAHERTZ = GpuCounterDescriptor_MeasureUnit_GIGAHERTZ;
+  static constexpr auto TERAHERTZ = GpuCounterDescriptor_MeasureUnit_TERAHERTZ;
+  static constexpr auto PETAHERTZ = GpuCounterDescriptor_MeasureUnit_PETAHERTZ;
+  static constexpr auto NANOSECOND = GpuCounterDescriptor_MeasureUnit_NANOSECOND;
+  static constexpr auto MICROSECOND = GpuCounterDescriptor_MeasureUnit_MICROSECOND;
+  static constexpr auto MILLISECOND = GpuCounterDescriptor_MeasureUnit_MILLISECOND;
+  static constexpr auto SECOND = GpuCounterDescriptor_MeasureUnit_SECOND;
+  static constexpr auto MINUTE = GpuCounterDescriptor_MeasureUnit_MINUTE;
+  static constexpr auto HOUR = GpuCounterDescriptor_MeasureUnit_HOUR;
+  static constexpr auto VERTEX = GpuCounterDescriptor_MeasureUnit_VERTEX;
+  static constexpr auto PIXEL = GpuCounterDescriptor_MeasureUnit_PIXEL;
+  static constexpr auto TRIANGLE = GpuCounterDescriptor_MeasureUnit_TRIANGLE;
+  static constexpr auto PRIMITIVE = GpuCounterDescriptor_MeasureUnit_PRIMITIVE;
+  static constexpr auto FRAGMENT = GpuCounterDescriptor_MeasureUnit_FRAGMENT;
+  static constexpr auto MILLIWATT = GpuCounterDescriptor_MeasureUnit_MILLIWATT;
+  static constexpr auto WATT = GpuCounterDescriptor_MeasureUnit_WATT;
+  static constexpr auto KILOWATT = GpuCounterDescriptor_MeasureUnit_KILOWATT;
+  static constexpr auto JOULE = GpuCounterDescriptor_MeasureUnit_JOULE;
+  static constexpr auto VOLT = GpuCounterDescriptor_MeasureUnit_VOLT;
+  static constexpr auto AMPERE = GpuCounterDescriptor_MeasureUnit_AMPERE;
+  static constexpr auto CELSIUS = GpuCounterDescriptor_MeasureUnit_CELSIUS;
+  static constexpr auto FAHRENHEIT = GpuCounterDescriptor_MeasureUnit_FAHRENHEIT;
+  static constexpr auto KELVIN = GpuCounterDescriptor_MeasureUnit_KELVIN;
+  static constexpr auto PERCENT = GpuCounterDescriptor_MeasureUnit_PERCENT;
+  static constexpr auto INSTRUCTION = GpuCounterDescriptor_MeasureUnit_INSTRUCTION;
+  static constexpr auto MeasureUnit_MIN = GpuCounterDescriptor_MeasureUnit_NONE;
+  static constexpr auto MeasureUnit_MAX = GpuCounterDescriptor_MeasureUnit_INSTRUCTION;
+  enum FieldNumbers {
+    kSpecsFieldNumber = 1,
+    kBlocksFieldNumber = 2,
+    kMinSamplingPeriodNsFieldNumber = 3,
+    kMaxSamplingPeriodNsFieldNumber = 4,
+    kSupportsInstrumentedSamplingFieldNumber = 5,
+  };
+
+  GpuCounterDescriptor();
+  ~GpuCounterDescriptor() override;
+  GpuCounterDescriptor(GpuCounterDescriptor&&) noexcept;
+  GpuCounterDescriptor& operator=(GpuCounterDescriptor&&);
+  GpuCounterDescriptor(const GpuCounterDescriptor&);
+  GpuCounterDescriptor& operator=(const GpuCounterDescriptor&);
+  bool operator==(const GpuCounterDescriptor&) const;
+  bool operator!=(const GpuCounterDescriptor& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<GpuCounterDescriptor_GpuCounterSpec>& specs() const { return specs_; }
+  std::vector<GpuCounterDescriptor_GpuCounterSpec>* mutable_specs() { return &specs_; }
+  int specs_size() const;
+  void clear_specs();
+  GpuCounterDescriptor_GpuCounterSpec* add_specs();
+
+  const std::vector<GpuCounterDescriptor_GpuCounterBlock>& blocks() const { return blocks_; }
+  std::vector<GpuCounterDescriptor_GpuCounterBlock>* mutable_blocks() { return &blocks_; }
+  int blocks_size() const;
+  void clear_blocks();
+  GpuCounterDescriptor_GpuCounterBlock* add_blocks();
+
+  bool has_min_sampling_period_ns() const { return _has_field_[3]; }
+  uint64_t min_sampling_period_ns() const { return min_sampling_period_ns_; }
+  void set_min_sampling_period_ns(uint64_t value) { min_sampling_period_ns_ = value; _has_field_.set(3); }
+
+  bool has_max_sampling_period_ns() const { return _has_field_[4]; }
+  uint64_t max_sampling_period_ns() const { return max_sampling_period_ns_; }
+  void set_max_sampling_period_ns(uint64_t value) { max_sampling_period_ns_ = value; _has_field_.set(4); }
+
+  bool has_supports_instrumented_sampling() const { return _has_field_[5]; }
+  bool supports_instrumented_sampling() const { return supports_instrumented_sampling_; }
+  void set_supports_instrumented_sampling(bool value) { supports_instrumented_sampling_ = value; _has_field_.set(5); }
+
+ private:
+  std::vector<GpuCounterDescriptor_GpuCounterSpec> specs_;
+  std::vector<GpuCounterDescriptor_GpuCounterBlock> blocks_;
+  uint64_t min_sampling_period_ns_{};
+  uint64_t max_sampling_period_ns_{};
+  bool supports_instrumented_sampling_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<6> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT GpuCounterDescriptor_GpuCounterBlock : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kBlockIdFieldNumber = 1,
+    kBlockCapacityFieldNumber = 2,
+    kNameFieldNumber = 3,
+    kDescriptionFieldNumber = 4,
+    kCounterIdsFieldNumber = 5,
+  };
+
+  GpuCounterDescriptor_GpuCounterBlock();
+  ~GpuCounterDescriptor_GpuCounterBlock() override;
+  GpuCounterDescriptor_GpuCounterBlock(GpuCounterDescriptor_GpuCounterBlock&&) noexcept;
+  GpuCounterDescriptor_GpuCounterBlock& operator=(GpuCounterDescriptor_GpuCounterBlock&&);
+  GpuCounterDescriptor_GpuCounterBlock(const GpuCounterDescriptor_GpuCounterBlock&);
+  GpuCounterDescriptor_GpuCounterBlock& operator=(const GpuCounterDescriptor_GpuCounterBlock&);
+  bool operator==(const GpuCounterDescriptor_GpuCounterBlock&) const;
+  bool operator!=(const GpuCounterDescriptor_GpuCounterBlock& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_block_id() const { return _has_field_[1]; }
+  uint32_t block_id() const { return block_id_; }
+  void set_block_id(uint32_t value) { block_id_ = value; _has_field_.set(1); }
+
+  bool has_block_capacity() const { return _has_field_[2]; }
+  uint32_t block_capacity() const { return block_capacity_; }
+  void set_block_capacity(uint32_t value) { block_capacity_ = value; _has_field_.set(2); }
+
+  bool has_name() const { return _has_field_[3]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(3); }
+
+  bool has_description() const { return _has_field_[4]; }
+  const std::string& description() const { return description_; }
+  void set_description(const std::string& value) { description_ = value; _has_field_.set(4); }
+
+  const std::vector<uint32_t>& counter_ids() const { return counter_ids_; }
+  std::vector<uint32_t>* mutable_counter_ids() { return &counter_ids_; }
+  int counter_ids_size() const { return static_cast<int>(counter_ids_.size()); }
+  void clear_counter_ids() { counter_ids_.clear(); }
+  void add_counter_ids(uint32_t value) { counter_ids_.emplace_back(value); }
+  uint32_t* add_counter_ids() { counter_ids_.emplace_back(); return &counter_ids_.back(); }
+
+ private:
+  uint32_t block_id_{};
+  uint32_t block_capacity_{};
+  std::string name_{};
+  std::string description_{};
+  std::vector<uint32_t> counter_ids_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<6> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT GpuCounterDescriptor_GpuCounterSpec : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kCounterIdFieldNumber = 1,
+    kNameFieldNumber = 2,
+    kDescriptionFieldNumber = 3,
+    kIntPeakValueFieldNumber = 5,
+    kDoublePeakValueFieldNumber = 6,
+    kNumeratorUnitsFieldNumber = 7,
+    kDenominatorUnitsFieldNumber = 8,
+    kSelectByDefaultFieldNumber = 9,
+    kGroupsFieldNumber = 10,
+  };
+
+  GpuCounterDescriptor_GpuCounterSpec();
+  ~GpuCounterDescriptor_GpuCounterSpec() override;
+  GpuCounterDescriptor_GpuCounterSpec(GpuCounterDescriptor_GpuCounterSpec&&) noexcept;
+  GpuCounterDescriptor_GpuCounterSpec& operator=(GpuCounterDescriptor_GpuCounterSpec&&);
+  GpuCounterDescriptor_GpuCounterSpec(const GpuCounterDescriptor_GpuCounterSpec&);
+  GpuCounterDescriptor_GpuCounterSpec& operator=(const GpuCounterDescriptor_GpuCounterSpec&);
+  bool operator==(const GpuCounterDescriptor_GpuCounterSpec&) const;
+  bool operator!=(const GpuCounterDescriptor_GpuCounterSpec& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_counter_id() const { return _has_field_[1]; }
+  uint32_t counter_id() const { return counter_id_; }
+  void set_counter_id(uint32_t value) { counter_id_ = value; _has_field_.set(1); }
+
+  bool has_name() const { return _has_field_[2]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(2); }
+
+  bool has_description() const { return _has_field_[3]; }
+  const std::string& description() const { return description_; }
+  void set_description(const std::string& value) { description_ = value; _has_field_.set(3); }
+
+  bool has_int_peak_value() const { return _has_field_[5]; }
+  int64_t int_peak_value() const { return int_peak_value_; }
+  void set_int_peak_value(int64_t value) { int_peak_value_ = value; _has_field_.set(5); }
+
+  bool has_double_peak_value() const { return _has_field_[6]; }
+  double double_peak_value() const { return double_peak_value_; }
+  void set_double_peak_value(double value) { double_peak_value_ = value; _has_field_.set(6); }
+
+  const std::vector<GpuCounterDescriptor_MeasureUnit>& numerator_units() const { return numerator_units_; }
+  std::vector<GpuCounterDescriptor_MeasureUnit>* mutable_numerator_units() { return &numerator_units_; }
+  int numerator_units_size() const { return static_cast<int>(numerator_units_.size()); }
+  void clear_numerator_units() { numerator_units_.clear(); }
+  void add_numerator_units(GpuCounterDescriptor_MeasureUnit value) { numerator_units_.emplace_back(value); }
+  GpuCounterDescriptor_MeasureUnit* add_numerator_units() { numerator_units_.emplace_back(); return &numerator_units_.back(); }
+
+  const std::vector<GpuCounterDescriptor_MeasureUnit>& denominator_units() const { return denominator_units_; }
+  std::vector<GpuCounterDescriptor_MeasureUnit>* mutable_denominator_units() { return &denominator_units_; }
+  int denominator_units_size() const { return static_cast<int>(denominator_units_.size()); }
+  void clear_denominator_units() { denominator_units_.clear(); }
+  void add_denominator_units(GpuCounterDescriptor_MeasureUnit value) { denominator_units_.emplace_back(value); }
+  GpuCounterDescriptor_MeasureUnit* add_denominator_units() { denominator_units_.emplace_back(); return &denominator_units_.back(); }
+
+  bool has_select_by_default() const { return _has_field_[9]; }
+  bool select_by_default() const { return select_by_default_; }
+  void set_select_by_default(bool value) { select_by_default_ = value; _has_field_.set(9); }
+
+  const std::vector<GpuCounterDescriptor_GpuCounterGroup>& groups() const { return groups_; }
+  std::vector<GpuCounterDescriptor_GpuCounterGroup>* mutable_groups() { return &groups_; }
+  int groups_size() const { return static_cast<int>(groups_.size()); }
+  void clear_groups() { groups_.clear(); }
+  void add_groups(GpuCounterDescriptor_GpuCounterGroup value) { groups_.emplace_back(value); }
+  GpuCounterDescriptor_GpuCounterGroup* add_groups() { groups_.emplace_back(); return &groups_.back(); }
+
+ private:
+  uint32_t counter_id_{};
+  std::string name_{};
+  std::string description_{};
+  int64_t int_peak_value_{};
+  double double_peak_value_{};
+  std::vector<GpuCounterDescriptor_MeasureUnit> numerator_units_;
+  std::vector<GpuCounterDescriptor_MeasureUnit> denominator_units_;
+  bool select_by_default_{};
+  std::vector<GpuCounterDescriptor_GpuCounterGroup> groups_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<11> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_GPU_COUNTER_DESCRIPTOR_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/common/gpu_counter_descriptor.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+GpuCounterDescriptor::GpuCounterDescriptor() = default;
+GpuCounterDescriptor::~GpuCounterDescriptor() = default;
+GpuCounterDescriptor::GpuCounterDescriptor(const GpuCounterDescriptor&) = default;
+GpuCounterDescriptor& GpuCounterDescriptor::operator=(const GpuCounterDescriptor&) = default;
+GpuCounterDescriptor::GpuCounterDescriptor(GpuCounterDescriptor&&) noexcept = default;
+GpuCounterDescriptor& GpuCounterDescriptor::operator=(GpuCounterDescriptor&&) = default;
+
+bool GpuCounterDescriptor::operator==(const GpuCounterDescriptor& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && specs_ == other.specs_
+   && blocks_ == other.blocks_
+   && min_sampling_period_ns_ == other.min_sampling_period_ns_
+   && max_sampling_period_ns_ == other.max_sampling_period_ns_
+   && supports_instrumented_sampling_ == other.supports_instrumented_sampling_;
+}
+
+int GpuCounterDescriptor::specs_size() const { return static_cast<int>(specs_.size()); }
+void GpuCounterDescriptor::clear_specs() { specs_.clear(); }
+GpuCounterDescriptor_GpuCounterSpec* GpuCounterDescriptor::add_specs() { specs_.emplace_back(); return &specs_.back(); }
+int GpuCounterDescriptor::blocks_size() const { return static_cast<int>(blocks_.size()); }
+void GpuCounterDescriptor::clear_blocks() { blocks_.clear(); }
+GpuCounterDescriptor_GpuCounterBlock* GpuCounterDescriptor::add_blocks() { blocks_.emplace_back(); return &blocks_.back(); }
+bool GpuCounterDescriptor::ParseFromArray(const void* raw, size_t size) {
+  specs_.clear();
+  blocks_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* specs */:
+        specs_.emplace_back();
+        specs_.back().ParseFromArray(field.data(), field.size());
+        break;
+      case 2 /* blocks */:
+        blocks_.emplace_back();
+        blocks_.back().ParseFromArray(field.data(), field.size());
+        break;
+      case 3 /* min_sampling_period_ns */:
+        field.get(&min_sampling_period_ns_);
+        break;
+      case 4 /* max_sampling_period_ns */:
+        field.get(&max_sampling_period_ns_);
+        break;
+      case 5 /* supports_instrumented_sampling */:
+        field.get(&supports_instrumented_sampling_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string GpuCounterDescriptor::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> GpuCounterDescriptor::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void GpuCounterDescriptor::Serialize(::protozero::Message* msg) const {
+  // Field 1: specs
+  for (auto& it : specs_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(1));
+  }
+
+  // Field 2: blocks
+  for (auto& it : blocks_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(2));
+  }
+
+  // Field 3: min_sampling_period_ns
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, min_sampling_period_ns_);
+  }
+
+  // Field 4: max_sampling_period_ns
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, max_sampling_period_ns_);
+  }
+
+  // Field 5: supports_instrumented_sampling
+  if (_has_field_[5]) {
+    msg->AppendTinyVarInt(5, supports_instrumented_sampling_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+GpuCounterDescriptor_GpuCounterBlock::GpuCounterDescriptor_GpuCounterBlock() = default;
+GpuCounterDescriptor_GpuCounterBlock::~GpuCounterDescriptor_GpuCounterBlock() = default;
+GpuCounterDescriptor_GpuCounterBlock::GpuCounterDescriptor_GpuCounterBlock(const GpuCounterDescriptor_GpuCounterBlock&) = default;
+GpuCounterDescriptor_GpuCounterBlock& GpuCounterDescriptor_GpuCounterBlock::operator=(const GpuCounterDescriptor_GpuCounterBlock&) = default;
+GpuCounterDescriptor_GpuCounterBlock::GpuCounterDescriptor_GpuCounterBlock(GpuCounterDescriptor_GpuCounterBlock&&) noexcept = default;
+GpuCounterDescriptor_GpuCounterBlock& GpuCounterDescriptor_GpuCounterBlock::operator=(GpuCounterDescriptor_GpuCounterBlock&&) = default;
+
+bool GpuCounterDescriptor_GpuCounterBlock::operator==(const GpuCounterDescriptor_GpuCounterBlock& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && block_id_ == other.block_id_
+   && block_capacity_ == other.block_capacity_
+   && name_ == other.name_
+   && description_ == other.description_
+   && counter_ids_ == other.counter_ids_;
+}
+
+bool GpuCounterDescriptor_GpuCounterBlock::ParseFromArray(const void* raw, size_t size) {
+  counter_ids_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* block_id */:
+        field.get(&block_id_);
+        break;
+      case 2 /* block_capacity */:
+        field.get(&block_capacity_);
+        break;
+      case 3 /* name */:
+        field.get(&name_);
+        break;
+      case 4 /* description */:
+        field.get(&description_);
+        break;
+      case 5 /* counter_ids */:
+        counter_ids_.emplace_back();
+        field.get(&counter_ids_.back());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string GpuCounterDescriptor_GpuCounterBlock::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> GpuCounterDescriptor_GpuCounterBlock::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void GpuCounterDescriptor_GpuCounterBlock::Serialize(::protozero::Message* msg) const {
+  // Field 1: block_id
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, block_id_);
+  }
+
+  // Field 2: block_capacity
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, block_capacity_);
+  }
+
+  // Field 3: name
+  if (_has_field_[3]) {
+    msg->AppendString(3, name_);
+  }
+
+  // Field 4: description
+  if (_has_field_[4]) {
+    msg->AppendString(4, description_);
+  }
+
+  // Field 5: counter_ids
+  for (auto& it : counter_ids_) {
+    msg->AppendVarInt(5, it);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+GpuCounterDescriptor_GpuCounterSpec::GpuCounterDescriptor_GpuCounterSpec() = default;
+GpuCounterDescriptor_GpuCounterSpec::~GpuCounterDescriptor_GpuCounterSpec() = default;
+GpuCounterDescriptor_GpuCounterSpec::GpuCounterDescriptor_GpuCounterSpec(const GpuCounterDescriptor_GpuCounterSpec&) = default;
+GpuCounterDescriptor_GpuCounterSpec& GpuCounterDescriptor_GpuCounterSpec::operator=(const GpuCounterDescriptor_GpuCounterSpec&) = default;
+GpuCounterDescriptor_GpuCounterSpec::GpuCounterDescriptor_GpuCounterSpec(GpuCounterDescriptor_GpuCounterSpec&&) noexcept = default;
+GpuCounterDescriptor_GpuCounterSpec& GpuCounterDescriptor_GpuCounterSpec::operator=(GpuCounterDescriptor_GpuCounterSpec&&) = default;
+
+bool GpuCounterDescriptor_GpuCounterSpec::operator==(const GpuCounterDescriptor_GpuCounterSpec& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && counter_id_ == other.counter_id_
+   && name_ == other.name_
+   && description_ == other.description_
+   && int_peak_value_ == other.int_peak_value_
+   && double_peak_value_ == other.double_peak_value_
+   && numerator_units_ == other.numerator_units_
+   && denominator_units_ == other.denominator_units_
+   && select_by_default_ == other.select_by_default_
+   && groups_ == other.groups_;
+}
+
+bool GpuCounterDescriptor_GpuCounterSpec::ParseFromArray(const void* raw, size_t size) {
+  numerator_units_.clear();
+  denominator_units_.clear();
+  groups_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* counter_id */:
+        field.get(&counter_id_);
+        break;
+      case 2 /* name */:
+        field.get(&name_);
+        break;
+      case 3 /* description */:
+        field.get(&description_);
+        break;
+      case 5 /* int_peak_value */:
+        field.get(&int_peak_value_);
+        break;
+      case 6 /* double_peak_value */:
+        field.get(&double_peak_value_);
+        break;
+      case 7 /* numerator_units */:
+        numerator_units_.emplace_back();
+        field.get(&numerator_units_.back());
+        break;
+      case 8 /* denominator_units */:
+        denominator_units_.emplace_back();
+        field.get(&denominator_units_.back());
+        break;
+      case 9 /* select_by_default */:
+        field.get(&select_by_default_);
+        break;
+      case 10 /* groups */:
+        groups_.emplace_back();
+        field.get(&groups_.back());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string GpuCounterDescriptor_GpuCounterSpec::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> GpuCounterDescriptor_GpuCounterSpec::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void GpuCounterDescriptor_GpuCounterSpec::Serialize(::protozero::Message* msg) const {
+  // Field 1: counter_id
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, counter_id_);
+  }
+
+  // Field 2: name
+  if (_has_field_[2]) {
+    msg->AppendString(2, name_);
+  }
+
+  // Field 3: description
+  if (_has_field_[3]) {
+    msg->AppendString(3, description_);
+  }
+
+  // Field 5: int_peak_value
+  if (_has_field_[5]) {
+    msg->AppendVarInt(5, int_peak_value_);
+  }
+
+  // Field 6: double_peak_value
+  if (_has_field_[6]) {
+    msg->AppendFixed(6, double_peak_value_);
+  }
+
+  // Field 7: numerator_units
+  for (auto& it : numerator_units_) {
+    msg->AppendVarInt(7, it);
+  }
+
+  // Field 8: denominator_units
+  for (auto& it : denominator_units_) {
+    msg->AppendVarInt(8, it);
+  }
+
+  // Field 9: select_by_default
+  if (_has_field_[9]) {
+    msg->AppendTinyVarInt(9, select_by_default_);
+  }
+
+  // Field 10: groups
+  for (auto& it : groups_) {
+    msg->AppendVarInt(10, it);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/common/interceptor_descriptor.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/common/interceptor_descriptor.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_INTERCEPTOR_DESCRIPTOR_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_INTERCEPTOR_DESCRIPTOR_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class InterceptorDescriptor;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT InterceptorDescriptor : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNameFieldNumber = 1,
+  };
+
+  InterceptorDescriptor();
+  ~InterceptorDescriptor() override;
+  InterceptorDescriptor(InterceptorDescriptor&&) noexcept;
+  InterceptorDescriptor& operator=(InterceptorDescriptor&&);
+  InterceptorDescriptor(const InterceptorDescriptor&);
+  InterceptorDescriptor& operator=(const InterceptorDescriptor&);
+  bool operator==(const InterceptorDescriptor&) const;
+  bool operator!=(const InterceptorDescriptor& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name() const { return _has_field_[1]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
+
+ private:
+  std::string name_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_INTERCEPTOR_DESCRIPTOR_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/common/interceptor_descriptor.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+InterceptorDescriptor::InterceptorDescriptor() = default;
+InterceptorDescriptor::~InterceptorDescriptor() = default;
+InterceptorDescriptor::InterceptorDescriptor(const InterceptorDescriptor&) = default;
+InterceptorDescriptor& InterceptorDescriptor::operator=(const InterceptorDescriptor&) = default;
+InterceptorDescriptor::InterceptorDescriptor(InterceptorDescriptor&&) noexcept = default;
+InterceptorDescriptor& InterceptorDescriptor::operator=(InterceptorDescriptor&&) = default;
+
+bool InterceptorDescriptor::operator==(const InterceptorDescriptor& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && name_ == other.name_;
+}
+
+bool InterceptorDescriptor::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* name */:
+        field.get(&name_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string InterceptorDescriptor::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> InterceptorDescriptor::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void InterceptorDescriptor::Serialize(::protozero::Message* msg) const {
+  // Field 1: name
+  if (_has_field_[1]) {
+    msg->AppendString(1, name_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/common/observable_events.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/common/observable_events.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_OBSERVABLE_EVENTS_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_OBSERVABLE_EVENTS_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ObservableEvents;
+class ObservableEvents_DataSourceInstanceStateChange;
+enum ObservableEvents_Type : int;
+enum ObservableEvents_DataSourceInstanceState : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum ObservableEvents_Type : int {
+  ObservableEvents_Type_TYPE_UNSPECIFIED = 0,
+  ObservableEvents_Type_TYPE_DATA_SOURCES_INSTANCES = 1,
+  ObservableEvents_Type_TYPE_ALL_DATA_SOURCES_STARTED = 2,
+};
+enum ObservableEvents_DataSourceInstanceState : int {
+  ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STOPPED = 1,
+  ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STARTED = 2,
+};
+
+class PERFETTO_EXPORT ObservableEvents : public ::protozero::CppMessageObj {
+ public:
+  using DataSourceInstanceStateChange = ObservableEvents_DataSourceInstanceStateChange;
+  using Type = ObservableEvents_Type;
+  static constexpr auto TYPE_UNSPECIFIED = ObservableEvents_Type_TYPE_UNSPECIFIED;
+  static constexpr auto TYPE_DATA_SOURCES_INSTANCES = ObservableEvents_Type_TYPE_DATA_SOURCES_INSTANCES;
+  static constexpr auto TYPE_ALL_DATA_SOURCES_STARTED = ObservableEvents_Type_TYPE_ALL_DATA_SOURCES_STARTED;
+  static constexpr auto Type_MIN = ObservableEvents_Type_TYPE_UNSPECIFIED;
+  static constexpr auto Type_MAX = ObservableEvents_Type_TYPE_ALL_DATA_SOURCES_STARTED;
+  using DataSourceInstanceState = ObservableEvents_DataSourceInstanceState;
+  static constexpr auto DATA_SOURCE_INSTANCE_STATE_STOPPED = ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STOPPED;
+  static constexpr auto DATA_SOURCE_INSTANCE_STATE_STARTED = ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STARTED;
+  static constexpr auto DataSourceInstanceState_MIN = ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STOPPED;
+  static constexpr auto DataSourceInstanceState_MAX = ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STARTED;
+  enum FieldNumbers {
+    kInstanceStateChangesFieldNumber = 1,
+    kAllDataSourcesStartedFieldNumber = 2,
+  };
+
+  ObservableEvents();
+  ~ObservableEvents() override;
+  ObservableEvents(ObservableEvents&&) noexcept;
+  ObservableEvents& operator=(ObservableEvents&&);
+  ObservableEvents(const ObservableEvents&);
+  ObservableEvents& operator=(const ObservableEvents&);
+  bool operator==(const ObservableEvents&) const;
+  bool operator!=(const ObservableEvents& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<ObservableEvents_DataSourceInstanceStateChange>& instance_state_changes() const { return instance_state_changes_; }
+  std::vector<ObservableEvents_DataSourceInstanceStateChange>* mutable_instance_state_changes() { return &instance_state_changes_; }
+  int instance_state_changes_size() const;
+  void clear_instance_state_changes();
+  ObservableEvents_DataSourceInstanceStateChange* add_instance_state_changes();
+
+  bool has_all_data_sources_started() const { return _has_field_[2]; }
+  bool all_data_sources_started() const { return all_data_sources_started_; }
+  void set_all_data_sources_started(bool value) { all_data_sources_started_ = value; _has_field_.set(2); }
+
+ private:
+  std::vector<ObservableEvents_DataSourceInstanceStateChange> instance_state_changes_;
+  bool all_data_sources_started_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ObservableEvents_DataSourceInstanceStateChange : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kProducerNameFieldNumber = 1,
+    kDataSourceNameFieldNumber = 2,
+    kStateFieldNumber = 3,
+  };
+
+  ObservableEvents_DataSourceInstanceStateChange();
+  ~ObservableEvents_DataSourceInstanceStateChange() override;
+  ObservableEvents_DataSourceInstanceStateChange(ObservableEvents_DataSourceInstanceStateChange&&) noexcept;
+  ObservableEvents_DataSourceInstanceStateChange& operator=(ObservableEvents_DataSourceInstanceStateChange&&);
+  ObservableEvents_DataSourceInstanceStateChange(const ObservableEvents_DataSourceInstanceStateChange&);
+  ObservableEvents_DataSourceInstanceStateChange& operator=(const ObservableEvents_DataSourceInstanceStateChange&);
+  bool operator==(const ObservableEvents_DataSourceInstanceStateChange&) const;
+  bool operator!=(const ObservableEvents_DataSourceInstanceStateChange& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_producer_name() const { return _has_field_[1]; }
+  const std::string& producer_name() const { return producer_name_; }
+  void set_producer_name(const std::string& value) { producer_name_ = value; _has_field_.set(1); }
+
+  bool has_data_source_name() const { return _has_field_[2]; }
+  const std::string& data_source_name() const { return data_source_name_; }
+  void set_data_source_name(const std::string& value) { data_source_name_ = value; _has_field_.set(2); }
+
+  bool has_state() const { return _has_field_[3]; }
+  ObservableEvents_DataSourceInstanceState state() const { return state_; }
+  void set_state(ObservableEvents_DataSourceInstanceState value) { state_ = value; _has_field_.set(3); }
+
+ private:
+  std::string producer_name_{};
+  std::string data_source_name_{};
+  ObservableEvents_DataSourceInstanceState state_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<4> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_OBSERVABLE_EVENTS_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/common/observable_events.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+ObservableEvents::ObservableEvents() = default;
+ObservableEvents::~ObservableEvents() = default;
+ObservableEvents::ObservableEvents(const ObservableEvents&) = default;
+ObservableEvents& ObservableEvents::operator=(const ObservableEvents&) = default;
+ObservableEvents::ObservableEvents(ObservableEvents&&) noexcept = default;
+ObservableEvents& ObservableEvents::operator=(ObservableEvents&&) = default;
+
+bool ObservableEvents::operator==(const ObservableEvents& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && instance_state_changes_ == other.instance_state_changes_
+   && all_data_sources_started_ == other.all_data_sources_started_;
+}
+
+int ObservableEvents::instance_state_changes_size() const { return static_cast<int>(instance_state_changes_.size()); }
+void ObservableEvents::clear_instance_state_changes() { instance_state_changes_.clear(); }
+ObservableEvents_DataSourceInstanceStateChange* ObservableEvents::add_instance_state_changes() { instance_state_changes_.emplace_back(); return &instance_state_changes_.back(); }
+bool ObservableEvents::ParseFromArray(const void* raw, size_t size) {
+  instance_state_changes_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* instance_state_changes */:
+        instance_state_changes_.emplace_back();
+        instance_state_changes_.back().ParseFromArray(field.data(), field.size());
+        break;
+      case 2 /* all_data_sources_started */:
+        field.get(&all_data_sources_started_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ObservableEvents::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ObservableEvents::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ObservableEvents::Serialize(::protozero::Message* msg) const {
+  // Field 1: instance_state_changes
+  for (auto& it : instance_state_changes_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(1));
+  }
+
+  // Field 2: all_data_sources_started
+  if (_has_field_[2]) {
+    msg->AppendTinyVarInt(2, all_data_sources_started_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+ObservableEvents_DataSourceInstanceStateChange::ObservableEvents_DataSourceInstanceStateChange() = default;
+ObservableEvents_DataSourceInstanceStateChange::~ObservableEvents_DataSourceInstanceStateChange() = default;
+ObservableEvents_DataSourceInstanceStateChange::ObservableEvents_DataSourceInstanceStateChange(const ObservableEvents_DataSourceInstanceStateChange&) = default;
+ObservableEvents_DataSourceInstanceStateChange& ObservableEvents_DataSourceInstanceStateChange::operator=(const ObservableEvents_DataSourceInstanceStateChange&) = default;
+ObservableEvents_DataSourceInstanceStateChange::ObservableEvents_DataSourceInstanceStateChange(ObservableEvents_DataSourceInstanceStateChange&&) noexcept = default;
+ObservableEvents_DataSourceInstanceStateChange& ObservableEvents_DataSourceInstanceStateChange::operator=(ObservableEvents_DataSourceInstanceStateChange&&) = default;
+
+bool ObservableEvents_DataSourceInstanceStateChange::operator==(const ObservableEvents_DataSourceInstanceStateChange& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && producer_name_ == other.producer_name_
+   && data_source_name_ == other.data_source_name_
+   && state_ == other.state_;
+}
+
+bool ObservableEvents_DataSourceInstanceStateChange::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* producer_name */:
+        field.get(&producer_name_);
+        break;
+      case 2 /* data_source_name */:
+        field.get(&data_source_name_);
+        break;
+      case 3 /* state */:
+        field.get(&state_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ObservableEvents_DataSourceInstanceStateChange::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ObservableEvents_DataSourceInstanceStateChange::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ObservableEvents_DataSourceInstanceStateChange::Serialize(::protozero::Message* msg) const {
+  // Field 1: producer_name
+  if (_has_field_[1]) {
+    msg->AppendString(1, producer_name_);
+  }
+
+  // Field 2: data_source_name
+  if (_has_field_[2]) {
+    msg->AppendString(2, data_source_name_);
+  }
+
+  // Field 3: state
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, state_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/common/perf_events.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/common/perf_events.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_PERF_EVENTS_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_PERF_EVENTS_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class PerfEvents;
+class PerfEvents_Tracepoint;
+class PerfEvents_Timebase;
+enum PerfEvents_Counter : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum PerfEvents_Counter : int {
+  PerfEvents_Counter_UNKNOWN_COUNTER = 0,
+  PerfEvents_Counter_SW_CPU_CLOCK = 1,
+  PerfEvents_Counter_SW_PAGE_FAULTS = 2,
+  PerfEvents_Counter_HW_CPU_CYCLES = 10,
+  PerfEvents_Counter_HW_INSTRUCTIONS = 11,
+};
+
+class PERFETTO_EXPORT PerfEvents : public ::protozero::CppMessageObj {
+ public:
+  using Timebase = PerfEvents_Timebase;
+  using Tracepoint = PerfEvents_Tracepoint;
+  using Counter = PerfEvents_Counter;
+  static constexpr auto UNKNOWN_COUNTER = PerfEvents_Counter_UNKNOWN_COUNTER;
+  static constexpr auto SW_CPU_CLOCK = PerfEvents_Counter_SW_CPU_CLOCK;
+  static constexpr auto SW_PAGE_FAULTS = PerfEvents_Counter_SW_PAGE_FAULTS;
+  static constexpr auto HW_CPU_CYCLES = PerfEvents_Counter_HW_CPU_CYCLES;
+  static constexpr auto HW_INSTRUCTIONS = PerfEvents_Counter_HW_INSTRUCTIONS;
+  static constexpr auto Counter_MIN = PerfEvents_Counter_UNKNOWN_COUNTER;
+  static constexpr auto Counter_MAX = PerfEvents_Counter_HW_INSTRUCTIONS;
+  enum FieldNumbers {
+  };
+
+  PerfEvents();
+  ~PerfEvents() override;
+  PerfEvents(PerfEvents&&) noexcept;
+  PerfEvents& operator=(PerfEvents&&);
+  PerfEvents(const PerfEvents&);
+  PerfEvents& operator=(const PerfEvents&);
+  bool operator==(const PerfEvents&) const;
+  bool operator!=(const PerfEvents& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT PerfEvents_Tracepoint : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNameFieldNumber = 1,
+    kFilterFieldNumber = 2,
+  };
+
+  PerfEvents_Tracepoint();
+  ~PerfEvents_Tracepoint() override;
+  PerfEvents_Tracepoint(PerfEvents_Tracepoint&&) noexcept;
+  PerfEvents_Tracepoint& operator=(PerfEvents_Tracepoint&&);
+  PerfEvents_Tracepoint(const PerfEvents_Tracepoint&);
+  PerfEvents_Tracepoint& operator=(const PerfEvents_Tracepoint&);
+  bool operator==(const PerfEvents_Tracepoint&) const;
+  bool operator!=(const PerfEvents_Tracepoint& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name() const { return _has_field_[1]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
+
+  bool has_filter() const { return _has_field_[2]; }
+  const std::string& filter() const { return filter_; }
+  void set_filter(const std::string& value) { filter_ = value; _has_field_.set(2); }
+
+ private:
+  std::string name_{};
+  std::string filter_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT PerfEvents_Timebase : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kFrequencyFieldNumber = 2,
+    kPeriodFieldNumber = 1,
+    kCounterFieldNumber = 4,
+    kTracepointFieldNumber = 3,
+  };
+
+  PerfEvents_Timebase();
+  ~PerfEvents_Timebase() override;
+  PerfEvents_Timebase(PerfEvents_Timebase&&) noexcept;
+  PerfEvents_Timebase& operator=(PerfEvents_Timebase&&);
+  PerfEvents_Timebase(const PerfEvents_Timebase&);
+  PerfEvents_Timebase& operator=(const PerfEvents_Timebase&);
+  bool operator==(const PerfEvents_Timebase&) const;
+  bool operator!=(const PerfEvents_Timebase& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_frequency() const { return _has_field_[2]; }
+  uint64_t frequency() const { return frequency_; }
+  void set_frequency(uint64_t value) { frequency_ = value; _has_field_.set(2); }
+
+  bool has_period() const { return _has_field_[1]; }
+  uint64_t period() const { return period_; }
+  void set_period(uint64_t value) { period_ = value; _has_field_.set(1); }
+
+  bool has_counter() const { return _has_field_[4]; }
+  PerfEvents_Counter counter() const { return counter_; }
+  void set_counter(PerfEvents_Counter value) { counter_ = value; _has_field_.set(4); }
+
+  bool has_tracepoint() const { return _has_field_[3]; }
+  const PerfEvents_Tracepoint& tracepoint() const { return *tracepoint_; }
+  PerfEvents_Tracepoint* mutable_tracepoint() { _has_field_.set(3); return tracepoint_.get(); }
+
+ private:
+  uint64_t frequency_{};
+  uint64_t period_{};
+  PerfEvents_Counter counter_{};
+  ::protozero::CopyablePtr<PerfEvents_Tracepoint> tracepoint_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<5> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_PERF_EVENTS_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/common/perf_events.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+PerfEvents::PerfEvents() = default;
+PerfEvents::~PerfEvents() = default;
+PerfEvents::PerfEvents(const PerfEvents&) = default;
+PerfEvents& PerfEvents::operator=(const PerfEvents&) = default;
+PerfEvents::PerfEvents(PerfEvents&&) noexcept = default;
+PerfEvents& PerfEvents::operator=(PerfEvents&&) = default;
+
+bool PerfEvents::operator==(const PerfEvents& other) const {
+  return unknown_fields_ == other.unknown_fields_;
+}
+
+bool PerfEvents::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string PerfEvents::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> PerfEvents::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void PerfEvents::Serialize(::protozero::Message* msg) const {
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+PerfEvents_Tracepoint::PerfEvents_Tracepoint() = default;
+PerfEvents_Tracepoint::~PerfEvents_Tracepoint() = default;
+PerfEvents_Tracepoint::PerfEvents_Tracepoint(const PerfEvents_Tracepoint&) = default;
+PerfEvents_Tracepoint& PerfEvents_Tracepoint::operator=(const PerfEvents_Tracepoint&) = default;
+PerfEvents_Tracepoint::PerfEvents_Tracepoint(PerfEvents_Tracepoint&&) noexcept = default;
+PerfEvents_Tracepoint& PerfEvents_Tracepoint::operator=(PerfEvents_Tracepoint&&) = default;
+
+bool PerfEvents_Tracepoint::operator==(const PerfEvents_Tracepoint& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && name_ == other.name_
+   && filter_ == other.filter_;
+}
+
+bool PerfEvents_Tracepoint::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* name */:
+        field.get(&name_);
+        break;
+      case 2 /* filter */:
+        field.get(&filter_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string PerfEvents_Tracepoint::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> PerfEvents_Tracepoint::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void PerfEvents_Tracepoint::Serialize(::protozero::Message* msg) const {
+  // Field 1: name
+  if (_has_field_[1]) {
+    msg->AppendString(1, name_);
+  }
+
+  // Field 2: filter
+  if (_has_field_[2]) {
+    msg->AppendString(2, filter_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+PerfEvents_Timebase::PerfEvents_Timebase() = default;
+PerfEvents_Timebase::~PerfEvents_Timebase() = default;
+PerfEvents_Timebase::PerfEvents_Timebase(const PerfEvents_Timebase&) = default;
+PerfEvents_Timebase& PerfEvents_Timebase::operator=(const PerfEvents_Timebase&) = default;
+PerfEvents_Timebase::PerfEvents_Timebase(PerfEvents_Timebase&&) noexcept = default;
+PerfEvents_Timebase& PerfEvents_Timebase::operator=(PerfEvents_Timebase&&) = default;
+
+bool PerfEvents_Timebase::operator==(const PerfEvents_Timebase& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && frequency_ == other.frequency_
+   && period_ == other.period_
+   && counter_ == other.counter_
+   && tracepoint_ == other.tracepoint_;
+}
+
+bool PerfEvents_Timebase::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 2 /* frequency */:
+        field.get(&frequency_);
+        break;
+      case 1 /* period */:
+        field.get(&period_);
+        break;
+      case 4 /* counter */:
+        field.get(&counter_);
+        break;
+      case 3 /* tracepoint */:
+        (*tracepoint_).ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string PerfEvents_Timebase::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> PerfEvents_Timebase::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void PerfEvents_Timebase::Serialize(::protozero::Message* msg) const {
+  // Field 2: frequency
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, frequency_);
+  }
+
+  // Field 1: period
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, period_);
+  }
+
+  // Field 4: counter
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, counter_);
+  }
+
+  // Field 3: tracepoint
+  if (_has_field_[3]) {
+    (*tracepoint_).Serialize(msg->BeginNestedMessage<::protozero::Message>(3));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/common/sys_stats_counters.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/common/sys_stats_counters.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_SYS_STATS_COUNTERS_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_SYS_STATS_COUNTERS_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum MeminfoCounters : int;
+enum VmstatCounters : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum MeminfoCounters : int {
+  MEMINFO_UNSPECIFIED = 0,
+  MEMINFO_MEM_TOTAL = 1,
+  MEMINFO_MEM_FREE = 2,
+  MEMINFO_MEM_AVAILABLE = 3,
+  MEMINFO_BUFFERS = 4,
+  MEMINFO_CACHED = 5,
+  MEMINFO_SWAP_CACHED = 6,
+  MEMINFO_ACTIVE = 7,
+  MEMINFO_INACTIVE = 8,
+  MEMINFO_ACTIVE_ANON = 9,
+  MEMINFO_INACTIVE_ANON = 10,
+  MEMINFO_ACTIVE_FILE = 11,
+  MEMINFO_INACTIVE_FILE = 12,
+  MEMINFO_UNEVICTABLE = 13,
+  MEMINFO_MLOCKED = 14,
+  MEMINFO_SWAP_TOTAL = 15,
+  MEMINFO_SWAP_FREE = 16,
+  MEMINFO_DIRTY = 17,
+  MEMINFO_WRITEBACK = 18,
+  MEMINFO_ANON_PAGES = 19,
+  MEMINFO_MAPPED = 20,
+  MEMINFO_SHMEM = 21,
+  MEMINFO_SLAB = 22,
+  MEMINFO_SLAB_RECLAIMABLE = 23,
+  MEMINFO_SLAB_UNRECLAIMABLE = 24,
+  MEMINFO_KERNEL_STACK = 25,
+  MEMINFO_PAGE_TABLES = 26,
+  MEMINFO_COMMIT_LIMIT = 27,
+  MEMINFO_COMMITED_AS = 28,
+  MEMINFO_VMALLOC_TOTAL = 29,
+  MEMINFO_VMALLOC_USED = 30,
+  MEMINFO_VMALLOC_CHUNK = 31,
+  MEMINFO_CMA_TOTAL = 32,
+  MEMINFO_CMA_FREE = 33,
+};
+enum VmstatCounters : int {
+  VMSTAT_UNSPECIFIED = 0,
+  VMSTAT_NR_FREE_PAGES = 1,
+  VMSTAT_NR_ALLOC_BATCH = 2,
+  VMSTAT_NR_INACTIVE_ANON = 3,
+  VMSTAT_NR_ACTIVE_ANON = 4,
+  VMSTAT_NR_INACTIVE_FILE = 5,
+  VMSTAT_NR_ACTIVE_FILE = 6,
+  VMSTAT_NR_UNEVICTABLE = 7,
+  VMSTAT_NR_MLOCK = 8,
+  VMSTAT_NR_ANON_PAGES = 9,
+  VMSTAT_NR_MAPPED = 10,
+  VMSTAT_NR_FILE_PAGES = 11,
+  VMSTAT_NR_DIRTY = 12,
+  VMSTAT_NR_WRITEBACK = 13,
+  VMSTAT_NR_SLAB_RECLAIMABLE = 14,
+  VMSTAT_NR_SLAB_UNRECLAIMABLE = 15,
+  VMSTAT_NR_PAGE_TABLE_PAGES = 16,
+  VMSTAT_NR_KERNEL_STACK = 17,
+  VMSTAT_NR_OVERHEAD = 18,
+  VMSTAT_NR_UNSTABLE = 19,
+  VMSTAT_NR_BOUNCE = 20,
+  VMSTAT_NR_VMSCAN_WRITE = 21,
+  VMSTAT_NR_VMSCAN_IMMEDIATE_RECLAIM = 22,
+  VMSTAT_NR_WRITEBACK_TEMP = 23,
+  VMSTAT_NR_ISOLATED_ANON = 24,
+  VMSTAT_NR_ISOLATED_FILE = 25,
+  VMSTAT_NR_SHMEM = 26,
+  VMSTAT_NR_DIRTIED = 27,
+  VMSTAT_NR_WRITTEN = 28,
+  VMSTAT_NR_PAGES_SCANNED = 29,
+  VMSTAT_WORKINGSET_REFAULT = 30,
+  VMSTAT_WORKINGSET_ACTIVATE = 31,
+  VMSTAT_WORKINGSET_NODERECLAIM = 32,
+  VMSTAT_NR_ANON_TRANSPARENT_HUGEPAGES = 33,
+  VMSTAT_NR_FREE_CMA = 34,
+  VMSTAT_NR_SWAPCACHE = 35,
+  VMSTAT_NR_DIRTY_THRESHOLD = 36,
+  VMSTAT_NR_DIRTY_BACKGROUND_THRESHOLD = 37,
+  VMSTAT_PGPGIN = 38,
+  VMSTAT_PGPGOUT = 39,
+  VMSTAT_PGPGOUTCLEAN = 40,
+  VMSTAT_PSWPIN = 41,
+  VMSTAT_PSWPOUT = 42,
+  VMSTAT_PGALLOC_DMA = 43,
+  VMSTAT_PGALLOC_NORMAL = 44,
+  VMSTAT_PGALLOC_MOVABLE = 45,
+  VMSTAT_PGFREE = 46,
+  VMSTAT_PGACTIVATE = 47,
+  VMSTAT_PGDEACTIVATE = 48,
+  VMSTAT_PGFAULT = 49,
+  VMSTAT_PGMAJFAULT = 50,
+  VMSTAT_PGREFILL_DMA = 51,
+  VMSTAT_PGREFILL_NORMAL = 52,
+  VMSTAT_PGREFILL_MOVABLE = 53,
+  VMSTAT_PGSTEAL_KSWAPD_DMA = 54,
+  VMSTAT_PGSTEAL_KSWAPD_NORMAL = 55,
+  VMSTAT_PGSTEAL_KSWAPD_MOVABLE = 56,
+  VMSTAT_PGSTEAL_DIRECT_DMA = 57,
+  VMSTAT_PGSTEAL_DIRECT_NORMAL = 58,
+  VMSTAT_PGSTEAL_DIRECT_MOVABLE = 59,
+  VMSTAT_PGSCAN_KSWAPD_DMA = 60,
+  VMSTAT_PGSCAN_KSWAPD_NORMAL = 61,
+  VMSTAT_PGSCAN_KSWAPD_MOVABLE = 62,
+  VMSTAT_PGSCAN_DIRECT_DMA = 63,
+  VMSTAT_PGSCAN_DIRECT_NORMAL = 64,
+  VMSTAT_PGSCAN_DIRECT_MOVABLE = 65,
+  VMSTAT_PGSCAN_DIRECT_THROTTLE = 66,
+  VMSTAT_PGINODESTEAL = 67,
+  VMSTAT_SLABS_SCANNED = 68,
+  VMSTAT_KSWAPD_INODESTEAL = 69,
+  VMSTAT_KSWAPD_LOW_WMARK_HIT_QUICKLY = 70,
+  VMSTAT_KSWAPD_HIGH_WMARK_HIT_QUICKLY = 71,
+  VMSTAT_PAGEOUTRUN = 72,
+  VMSTAT_ALLOCSTALL = 73,
+  VMSTAT_PGROTATED = 74,
+  VMSTAT_DROP_PAGECACHE = 75,
+  VMSTAT_DROP_SLAB = 76,
+  VMSTAT_PGMIGRATE_SUCCESS = 77,
+  VMSTAT_PGMIGRATE_FAIL = 78,
+  VMSTAT_COMPACT_MIGRATE_SCANNED = 79,
+  VMSTAT_COMPACT_FREE_SCANNED = 80,
+  VMSTAT_COMPACT_ISOLATED = 81,
+  VMSTAT_COMPACT_STALL = 82,
+  VMSTAT_COMPACT_FAIL = 83,
+  VMSTAT_COMPACT_SUCCESS = 84,
+  VMSTAT_COMPACT_DAEMON_WAKE = 85,
+  VMSTAT_UNEVICTABLE_PGS_CULLED = 86,
+  VMSTAT_UNEVICTABLE_PGS_SCANNED = 87,
+  VMSTAT_UNEVICTABLE_PGS_RESCUED = 88,
+  VMSTAT_UNEVICTABLE_PGS_MLOCKED = 89,
+  VMSTAT_UNEVICTABLE_PGS_MUNLOCKED = 90,
+  VMSTAT_UNEVICTABLE_PGS_CLEARED = 91,
+  VMSTAT_UNEVICTABLE_PGS_STRANDED = 92,
+  VMSTAT_NR_ZSPAGES = 93,
+  VMSTAT_NR_ION_HEAP = 94,
+  VMSTAT_NR_GPU_HEAP = 95,
+  VMSTAT_ALLOCSTALL_DMA = 96,
+  VMSTAT_ALLOCSTALL_MOVABLE = 97,
+  VMSTAT_ALLOCSTALL_NORMAL = 98,
+  VMSTAT_COMPACT_DAEMON_FREE_SCANNED = 99,
+  VMSTAT_COMPACT_DAEMON_MIGRATE_SCANNED = 100,
+  VMSTAT_NR_FASTRPC = 101,
+  VMSTAT_NR_INDIRECTLY_RECLAIMABLE = 102,
+  VMSTAT_NR_ION_HEAP_POOL = 103,
+  VMSTAT_NR_KERNEL_MISC_RECLAIMABLE = 104,
+  VMSTAT_NR_SHADOW_CALL_STACK_BYTES = 105,
+  VMSTAT_NR_SHMEM_HUGEPAGES = 106,
+  VMSTAT_NR_SHMEM_PMDMAPPED = 107,
+  VMSTAT_NR_UNRECLAIMABLE_PAGES = 108,
+  VMSTAT_NR_ZONE_ACTIVE_ANON = 109,
+  VMSTAT_NR_ZONE_ACTIVE_FILE = 110,
+  VMSTAT_NR_ZONE_INACTIVE_ANON = 111,
+  VMSTAT_NR_ZONE_INACTIVE_FILE = 112,
+  VMSTAT_NR_ZONE_UNEVICTABLE = 113,
+  VMSTAT_NR_ZONE_WRITE_PENDING = 114,
+  VMSTAT_OOM_KILL = 115,
+  VMSTAT_PGLAZYFREE = 116,
+  VMSTAT_PGLAZYFREED = 117,
+  VMSTAT_PGREFILL = 118,
+  VMSTAT_PGSCAN_DIRECT = 119,
+  VMSTAT_PGSCAN_KSWAPD = 120,
+  VMSTAT_PGSKIP_DMA = 121,
+  VMSTAT_PGSKIP_MOVABLE = 122,
+  VMSTAT_PGSKIP_NORMAL = 123,
+  VMSTAT_PGSTEAL_DIRECT = 124,
+  VMSTAT_PGSTEAL_KSWAPD = 125,
+  VMSTAT_SWAP_RA = 126,
+  VMSTAT_SWAP_RA_HIT = 127,
+  VMSTAT_WORKINGSET_RESTORE = 128,
+};
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_SYS_STATS_COUNTERS_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/common/sys_stats_counters.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/common/trace_stats.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/common/trace_stats.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACE_STATS_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACE_STATS_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class TraceStats;
+class TraceStats_FilterStats;
+class TraceStats_BufferStats;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT TraceStats : public ::protozero::CppMessageObj {
+ public:
+  using BufferStats = TraceStats_BufferStats;
+  using FilterStats = TraceStats_FilterStats;
+  enum FieldNumbers {
+    kBufferStatsFieldNumber = 1,
+    kProducersConnectedFieldNumber = 2,
+    kProducersSeenFieldNumber = 3,
+    kDataSourcesRegisteredFieldNumber = 4,
+    kDataSourcesSeenFieldNumber = 5,
+    kTracingSessionsFieldNumber = 6,
+    kTotalBuffersFieldNumber = 7,
+    kChunksDiscardedFieldNumber = 8,
+    kPatchesDiscardedFieldNumber = 9,
+    kInvalidPacketsFieldNumber = 10,
+    kFilterStatsFieldNumber = 11,
+  };
+
+  TraceStats();
+  ~TraceStats() override;
+  TraceStats(TraceStats&&) noexcept;
+  TraceStats& operator=(TraceStats&&);
+  TraceStats(const TraceStats&);
+  TraceStats& operator=(const TraceStats&);
+  bool operator==(const TraceStats&) const;
+  bool operator!=(const TraceStats& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<TraceStats_BufferStats>& buffer_stats() const { return buffer_stats_; }
+  std::vector<TraceStats_BufferStats>* mutable_buffer_stats() { return &buffer_stats_; }
+  int buffer_stats_size() const;
+  void clear_buffer_stats();
+  TraceStats_BufferStats* add_buffer_stats();
+
+  bool has_producers_connected() const { return _has_field_[2]; }
+  uint32_t producers_connected() const { return producers_connected_; }
+  void set_producers_connected(uint32_t value) { producers_connected_ = value; _has_field_.set(2); }
+
+  bool has_producers_seen() const { return _has_field_[3]; }
+  uint64_t producers_seen() const { return producers_seen_; }
+  void set_producers_seen(uint64_t value) { producers_seen_ = value; _has_field_.set(3); }
+
+  bool has_data_sources_registered() const { return _has_field_[4]; }
+  uint32_t data_sources_registered() const { return data_sources_registered_; }
+  void set_data_sources_registered(uint32_t value) { data_sources_registered_ = value; _has_field_.set(4); }
+
+  bool has_data_sources_seen() const { return _has_field_[5]; }
+  uint64_t data_sources_seen() const { return data_sources_seen_; }
+  void set_data_sources_seen(uint64_t value) { data_sources_seen_ = value; _has_field_.set(5); }
+
+  bool has_tracing_sessions() const { return _has_field_[6]; }
+  uint32_t tracing_sessions() const { return tracing_sessions_; }
+  void set_tracing_sessions(uint32_t value) { tracing_sessions_ = value; _has_field_.set(6); }
+
+  bool has_total_buffers() const { return _has_field_[7]; }
+  uint32_t total_buffers() const { return total_buffers_; }
+  void set_total_buffers(uint32_t value) { total_buffers_ = value; _has_field_.set(7); }
+
+  bool has_chunks_discarded() const { return _has_field_[8]; }
+  uint64_t chunks_discarded() const { return chunks_discarded_; }
+  void set_chunks_discarded(uint64_t value) { chunks_discarded_ = value; _has_field_.set(8); }
+
+  bool has_patches_discarded() const { return _has_field_[9]; }
+  uint64_t patches_discarded() const { return patches_discarded_; }
+  void set_patches_discarded(uint64_t value) { patches_discarded_ = value; _has_field_.set(9); }
+
+  bool has_invalid_packets() const { return _has_field_[10]; }
+  uint64_t invalid_packets() const { return invalid_packets_; }
+  void set_invalid_packets(uint64_t value) { invalid_packets_ = value; _has_field_.set(10); }
+
+  bool has_filter_stats() const { return _has_field_[11]; }
+  const TraceStats_FilterStats& filter_stats() const { return *filter_stats_; }
+  TraceStats_FilterStats* mutable_filter_stats() { _has_field_.set(11); return filter_stats_.get(); }
+
+ private:
+  std::vector<TraceStats_BufferStats> buffer_stats_;
+  uint32_t producers_connected_{};
+  uint64_t producers_seen_{};
+  uint32_t data_sources_registered_{};
+  uint64_t data_sources_seen_{};
+  uint32_t tracing_sessions_{};
+  uint32_t total_buffers_{};
+  uint64_t chunks_discarded_{};
+  uint64_t patches_discarded_{};
+  uint64_t invalid_packets_{};
+  ::protozero::CopyablePtr<TraceStats_FilterStats> filter_stats_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<12> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TraceStats_FilterStats : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kInputPacketsFieldNumber = 1,
+    kInputBytesFieldNumber = 2,
+    kOutputBytesFieldNumber = 3,
+    kErrorsFieldNumber = 4,
+  };
+
+  TraceStats_FilterStats();
+  ~TraceStats_FilterStats() override;
+  TraceStats_FilterStats(TraceStats_FilterStats&&) noexcept;
+  TraceStats_FilterStats& operator=(TraceStats_FilterStats&&);
+  TraceStats_FilterStats(const TraceStats_FilterStats&);
+  TraceStats_FilterStats& operator=(const TraceStats_FilterStats&);
+  bool operator==(const TraceStats_FilterStats&) const;
+  bool operator!=(const TraceStats_FilterStats& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_input_packets() const { return _has_field_[1]; }
+  uint64_t input_packets() const { return input_packets_; }
+  void set_input_packets(uint64_t value) { input_packets_ = value; _has_field_.set(1); }
+
+  bool has_input_bytes() const { return _has_field_[2]; }
+  uint64_t input_bytes() const { return input_bytes_; }
+  void set_input_bytes(uint64_t value) { input_bytes_ = value; _has_field_.set(2); }
+
+  bool has_output_bytes() const { return _has_field_[3]; }
+  uint64_t output_bytes() const { return output_bytes_; }
+  void set_output_bytes(uint64_t value) { output_bytes_ = value; _has_field_.set(3); }
+
+  bool has_errors() const { return _has_field_[4]; }
+  uint64_t errors() const { return errors_; }
+  void set_errors(uint64_t value) { errors_ = value; _has_field_.set(4); }
+
+ private:
+  uint64_t input_packets_{};
+  uint64_t input_bytes_{};
+  uint64_t output_bytes_{};
+  uint64_t errors_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<5> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TraceStats_BufferStats : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kBufferSizeFieldNumber = 12,
+    kBytesWrittenFieldNumber = 1,
+    kBytesOverwrittenFieldNumber = 13,
+    kBytesReadFieldNumber = 14,
+    kPaddingBytesWrittenFieldNumber = 15,
+    kPaddingBytesClearedFieldNumber = 16,
+    kChunksWrittenFieldNumber = 2,
+    kChunksRewrittenFieldNumber = 10,
+    kChunksOverwrittenFieldNumber = 3,
+    kChunksDiscardedFieldNumber = 18,
+    kChunksReadFieldNumber = 17,
+    kChunksCommittedOutOfOrderFieldNumber = 11,
+    kWriteWrapCountFieldNumber = 4,
+    kPatchesSucceededFieldNumber = 5,
+    kPatchesFailedFieldNumber = 6,
+    kReadaheadsSucceededFieldNumber = 7,
+    kReadaheadsFailedFieldNumber = 8,
+    kAbiViolationsFieldNumber = 9,
+    kTraceWriterPacketLossFieldNumber = 19,
+  };
+
+  TraceStats_BufferStats();
+  ~TraceStats_BufferStats() override;
+  TraceStats_BufferStats(TraceStats_BufferStats&&) noexcept;
+  TraceStats_BufferStats& operator=(TraceStats_BufferStats&&);
+  TraceStats_BufferStats(const TraceStats_BufferStats&);
+  TraceStats_BufferStats& operator=(const TraceStats_BufferStats&);
+  bool operator==(const TraceStats_BufferStats&) const;
+  bool operator!=(const TraceStats_BufferStats& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_buffer_size() const { return _has_field_[12]; }
+  uint64_t buffer_size() const { return buffer_size_; }
+  void set_buffer_size(uint64_t value) { buffer_size_ = value; _has_field_.set(12); }
+
+  bool has_bytes_written() const { return _has_field_[1]; }
+  uint64_t bytes_written() const { return bytes_written_; }
+  void set_bytes_written(uint64_t value) { bytes_written_ = value; _has_field_.set(1); }
+
+  bool has_bytes_overwritten() const { return _has_field_[13]; }
+  uint64_t bytes_overwritten() const { return bytes_overwritten_; }
+  void set_bytes_overwritten(uint64_t value) { bytes_overwritten_ = value; _has_field_.set(13); }
+
+  bool has_bytes_read() const { return _has_field_[14]; }
+  uint64_t bytes_read() const { return bytes_read_; }
+  void set_bytes_read(uint64_t value) { bytes_read_ = value; _has_field_.set(14); }
+
+  bool has_padding_bytes_written() const { return _has_field_[15]; }
+  uint64_t padding_bytes_written() const { return padding_bytes_written_; }
+  void set_padding_bytes_written(uint64_t value) { padding_bytes_written_ = value; _has_field_.set(15); }
+
+  bool has_padding_bytes_cleared() const { return _has_field_[16]; }
+  uint64_t padding_bytes_cleared() const { return padding_bytes_cleared_; }
+  void set_padding_bytes_cleared(uint64_t value) { padding_bytes_cleared_ = value; _has_field_.set(16); }
+
+  bool has_chunks_written() const { return _has_field_[2]; }
+  uint64_t chunks_written() const { return chunks_written_; }
+  void set_chunks_written(uint64_t value) { chunks_written_ = value; _has_field_.set(2); }
+
+  bool has_chunks_rewritten() const { return _has_field_[10]; }
+  uint64_t chunks_rewritten() const { return chunks_rewritten_; }
+  void set_chunks_rewritten(uint64_t value) { chunks_rewritten_ = value; _has_field_.set(10); }
+
+  bool has_chunks_overwritten() const { return _has_field_[3]; }
+  uint64_t chunks_overwritten() const { return chunks_overwritten_; }
+  void set_chunks_overwritten(uint64_t value) { chunks_overwritten_ = value; _has_field_.set(3); }
+
+  bool has_chunks_discarded() const { return _has_field_[18]; }
+  uint64_t chunks_discarded() const { return chunks_discarded_; }
+  void set_chunks_discarded(uint64_t value) { chunks_discarded_ = value; _has_field_.set(18); }
+
+  bool has_chunks_read() const { return _has_field_[17]; }
+  uint64_t chunks_read() const { return chunks_read_; }
+  void set_chunks_read(uint64_t value) { chunks_read_ = value; _has_field_.set(17); }
+
+  bool has_chunks_committed_out_of_order() const { return _has_field_[11]; }
+  uint64_t chunks_committed_out_of_order() const { return chunks_committed_out_of_order_; }
+  void set_chunks_committed_out_of_order(uint64_t value) { chunks_committed_out_of_order_ = value; _has_field_.set(11); }
+
+  bool has_write_wrap_count() const { return _has_field_[4]; }
+  uint64_t write_wrap_count() const { return write_wrap_count_; }
+  void set_write_wrap_count(uint64_t value) { write_wrap_count_ = value; _has_field_.set(4); }
+
+  bool has_patches_succeeded() const { return _has_field_[5]; }
+  uint64_t patches_succeeded() const { return patches_succeeded_; }
+  void set_patches_succeeded(uint64_t value) { patches_succeeded_ = value; _has_field_.set(5); }
+
+  bool has_patches_failed() const { return _has_field_[6]; }
+  uint64_t patches_failed() const { return patches_failed_; }
+  void set_patches_failed(uint64_t value) { patches_failed_ = value; _has_field_.set(6); }
+
+  bool has_readaheads_succeeded() const { return _has_field_[7]; }
+  uint64_t readaheads_succeeded() const { return readaheads_succeeded_; }
+  void set_readaheads_succeeded(uint64_t value) { readaheads_succeeded_ = value; _has_field_.set(7); }
+
+  bool has_readaheads_failed() const { return _has_field_[8]; }
+  uint64_t readaheads_failed() const { return readaheads_failed_; }
+  void set_readaheads_failed(uint64_t value) { readaheads_failed_ = value; _has_field_.set(8); }
+
+  bool has_abi_violations() const { return _has_field_[9]; }
+  uint64_t abi_violations() const { return abi_violations_; }
+  void set_abi_violations(uint64_t value) { abi_violations_ = value; _has_field_.set(9); }
+
+  bool has_trace_writer_packet_loss() const { return _has_field_[19]; }
+  uint64_t trace_writer_packet_loss() const { return trace_writer_packet_loss_; }
+  void set_trace_writer_packet_loss(uint64_t value) { trace_writer_packet_loss_ = value; _has_field_.set(19); }
+
+ private:
+  uint64_t buffer_size_{};
+  uint64_t bytes_written_{};
+  uint64_t bytes_overwritten_{};
+  uint64_t bytes_read_{};
+  uint64_t padding_bytes_written_{};
+  uint64_t padding_bytes_cleared_{};
+  uint64_t chunks_written_{};
+  uint64_t chunks_rewritten_{};
+  uint64_t chunks_overwritten_{};
+  uint64_t chunks_discarded_{};
+  uint64_t chunks_read_{};
+  uint64_t chunks_committed_out_of_order_{};
+  uint64_t write_wrap_count_{};
+  uint64_t patches_succeeded_{};
+  uint64_t patches_failed_{};
+  uint64_t readaheads_succeeded_{};
+  uint64_t readaheads_failed_{};
+  uint64_t abi_violations_{};
+  uint64_t trace_writer_packet_loss_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<20> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACE_STATS_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/common/trace_stats.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+TraceStats::TraceStats() = default;
+TraceStats::~TraceStats() = default;
+TraceStats::TraceStats(const TraceStats&) = default;
+TraceStats& TraceStats::operator=(const TraceStats&) = default;
+TraceStats::TraceStats(TraceStats&&) noexcept = default;
+TraceStats& TraceStats::operator=(TraceStats&&) = default;
+
+bool TraceStats::operator==(const TraceStats& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && buffer_stats_ == other.buffer_stats_
+   && producers_connected_ == other.producers_connected_
+   && producers_seen_ == other.producers_seen_
+   && data_sources_registered_ == other.data_sources_registered_
+   && data_sources_seen_ == other.data_sources_seen_
+   && tracing_sessions_ == other.tracing_sessions_
+   && total_buffers_ == other.total_buffers_
+   && chunks_discarded_ == other.chunks_discarded_
+   && patches_discarded_ == other.patches_discarded_
+   && invalid_packets_ == other.invalid_packets_
+   && filter_stats_ == other.filter_stats_;
+}
+
+int TraceStats::buffer_stats_size() const { return static_cast<int>(buffer_stats_.size()); }
+void TraceStats::clear_buffer_stats() { buffer_stats_.clear(); }
+TraceStats_BufferStats* TraceStats::add_buffer_stats() { buffer_stats_.emplace_back(); return &buffer_stats_.back(); }
+bool TraceStats::ParseFromArray(const void* raw, size_t size) {
+  buffer_stats_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* buffer_stats */:
+        buffer_stats_.emplace_back();
+        buffer_stats_.back().ParseFromArray(field.data(), field.size());
+        break;
+      case 2 /* producers_connected */:
+        field.get(&producers_connected_);
+        break;
+      case 3 /* producers_seen */:
+        field.get(&producers_seen_);
+        break;
+      case 4 /* data_sources_registered */:
+        field.get(&data_sources_registered_);
+        break;
+      case 5 /* data_sources_seen */:
+        field.get(&data_sources_seen_);
+        break;
+      case 6 /* tracing_sessions */:
+        field.get(&tracing_sessions_);
+        break;
+      case 7 /* total_buffers */:
+        field.get(&total_buffers_);
+        break;
+      case 8 /* chunks_discarded */:
+        field.get(&chunks_discarded_);
+        break;
+      case 9 /* patches_discarded */:
+        field.get(&patches_discarded_);
+        break;
+      case 10 /* invalid_packets */:
+        field.get(&invalid_packets_);
+        break;
+      case 11 /* filter_stats */:
+        (*filter_stats_).ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string TraceStats::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> TraceStats::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void TraceStats::Serialize(::protozero::Message* msg) const {
+  // Field 1: buffer_stats
+  for (auto& it : buffer_stats_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(1));
+  }
+
+  // Field 2: producers_connected
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, producers_connected_);
+  }
+
+  // Field 3: producers_seen
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, producers_seen_);
+  }
+
+  // Field 4: data_sources_registered
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, data_sources_registered_);
+  }
+
+  // Field 5: data_sources_seen
+  if (_has_field_[5]) {
+    msg->AppendVarInt(5, data_sources_seen_);
+  }
+
+  // Field 6: tracing_sessions
+  if (_has_field_[6]) {
+    msg->AppendVarInt(6, tracing_sessions_);
+  }
+
+  // Field 7: total_buffers
+  if (_has_field_[7]) {
+    msg->AppendVarInt(7, total_buffers_);
+  }
+
+  // Field 8: chunks_discarded
+  if (_has_field_[8]) {
+    msg->AppendVarInt(8, chunks_discarded_);
+  }
+
+  // Field 9: patches_discarded
+  if (_has_field_[9]) {
+    msg->AppendVarInt(9, patches_discarded_);
+  }
+
+  // Field 10: invalid_packets
+  if (_has_field_[10]) {
+    msg->AppendVarInt(10, invalid_packets_);
+  }
+
+  // Field 11: filter_stats
+  if (_has_field_[11]) {
+    (*filter_stats_).Serialize(msg->BeginNestedMessage<::protozero::Message>(11));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+TraceStats_FilterStats::TraceStats_FilterStats() = default;
+TraceStats_FilterStats::~TraceStats_FilterStats() = default;
+TraceStats_FilterStats::TraceStats_FilterStats(const TraceStats_FilterStats&) = default;
+TraceStats_FilterStats& TraceStats_FilterStats::operator=(const TraceStats_FilterStats&) = default;
+TraceStats_FilterStats::TraceStats_FilterStats(TraceStats_FilterStats&&) noexcept = default;
+TraceStats_FilterStats& TraceStats_FilterStats::operator=(TraceStats_FilterStats&&) = default;
+
+bool TraceStats_FilterStats::operator==(const TraceStats_FilterStats& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && input_packets_ == other.input_packets_
+   && input_bytes_ == other.input_bytes_
+   && output_bytes_ == other.output_bytes_
+   && errors_ == other.errors_;
+}
+
+bool TraceStats_FilterStats::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* input_packets */:
+        field.get(&input_packets_);
+        break;
+      case 2 /* input_bytes */:
+        field.get(&input_bytes_);
+        break;
+      case 3 /* output_bytes */:
+        field.get(&output_bytes_);
+        break;
+      case 4 /* errors */:
+        field.get(&errors_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string TraceStats_FilterStats::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> TraceStats_FilterStats::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void TraceStats_FilterStats::Serialize(::protozero::Message* msg) const {
+  // Field 1: input_packets
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, input_packets_);
+  }
+
+  // Field 2: input_bytes
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, input_bytes_);
+  }
+
+  // Field 3: output_bytes
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, output_bytes_);
+  }
+
+  // Field 4: errors
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, errors_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+TraceStats_BufferStats::TraceStats_BufferStats() = default;
+TraceStats_BufferStats::~TraceStats_BufferStats() = default;
+TraceStats_BufferStats::TraceStats_BufferStats(const TraceStats_BufferStats&) = default;
+TraceStats_BufferStats& TraceStats_BufferStats::operator=(const TraceStats_BufferStats&) = default;
+TraceStats_BufferStats::TraceStats_BufferStats(TraceStats_BufferStats&&) noexcept = default;
+TraceStats_BufferStats& TraceStats_BufferStats::operator=(TraceStats_BufferStats&&) = default;
+
+bool TraceStats_BufferStats::operator==(const TraceStats_BufferStats& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && buffer_size_ == other.buffer_size_
+   && bytes_written_ == other.bytes_written_
+   && bytes_overwritten_ == other.bytes_overwritten_
+   && bytes_read_ == other.bytes_read_
+   && padding_bytes_written_ == other.padding_bytes_written_
+   && padding_bytes_cleared_ == other.padding_bytes_cleared_
+   && chunks_written_ == other.chunks_written_
+   && chunks_rewritten_ == other.chunks_rewritten_
+   && chunks_overwritten_ == other.chunks_overwritten_
+   && chunks_discarded_ == other.chunks_discarded_
+   && chunks_read_ == other.chunks_read_
+   && chunks_committed_out_of_order_ == other.chunks_committed_out_of_order_
+   && write_wrap_count_ == other.write_wrap_count_
+   && patches_succeeded_ == other.patches_succeeded_
+   && patches_failed_ == other.patches_failed_
+   && readaheads_succeeded_ == other.readaheads_succeeded_
+   && readaheads_failed_ == other.readaheads_failed_
+   && abi_violations_ == other.abi_violations_
+   && trace_writer_packet_loss_ == other.trace_writer_packet_loss_;
+}
+
+bool TraceStats_BufferStats::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 12 /* buffer_size */:
+        field.get(&buffer_size_);
+        break;
+      case 1 /* bytes_written */:
+        field.get(&bytes_written_);
+        break;
+      case 13 /* bytes_overwritten */:
+        field.get(&bytes_overwritten_);
+        break;
+      case 14 /* bytes_read */:
+        field.get(&bytes_read_);
+        break;
+      case 15 /* padding_bytes_written */:
+        field.get(&padding_bytes_written_);
+        break;
+      case 16 /* padding_bytes_cleared */:
+        field.get(&padding_bytes_cleared_);
+        break;
+      case 2 /* chunks_written */:
+        field.get(&chunks_written_);
+        break;
+      case 10 /* chunks_rewritten */:
+        field.get(&chunks_rewritten_);
+        break;
+      case 3 /* chunks_overwritten */:
+        field.get(&chunks_overwritten_);
+        break;
+      case 18 /* chunks_discarded */:
+        field.get(&chunks_discarded_);
+        break;
+      case 17 /* chunks_read */:
+        field.get(&chunks_read_);
+        break;
+      case 11 /* chunks_committed_out_of_order */:
+        field.get(&chunks_committed_out_of_order_);
+        break;
+      case 4 /* write_wrap_count */:
+        field.get(&write_wrap_count_);
+        break;
+      case 5 /* patches_succeeded */:
+        field.get(&patches_succeeded_);
+        break;
+      case 6 /* patches_failed */:
+        field.get(&patches_failed_);
+        break;
+      case 7 /* readaheads_succeeded */:
+        field.get(&readaheads_succeeded_);
+        break;
+      case 8 /* readaheads_failed */:
+        field.get(&readaheads_failed_);
+        break;
+      case 9 /* abi_violations */:
+        field.get(&abi_violations_);
+        break;
+      case 19 /* trace_writer_packet_loss */:
+        field.get(&trace_writer_packet_loss_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string TraceStats_BufferStats::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> TraceStats_BufferStats::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void TraceStats_BufferStats::Serialize(::protozero::Message* msg) const {
+  // Field 12: buffer_size
+  if (_has_field_[12]) {
+    msg->AppendVarInt(12, buffer_size_);
+  }
+
+  // Field 1: bytes_written
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, bytes_written_);
+  }
+
+  // Field 13: bytes_overwritten
+  if (_has_field_[13]) {
+    msg->AppendVarInt(13, bytes_overwritten_);
+  }
+
+  // Field 14: bytes_read
+  if (_has_field_[14]) {
+    msg->AppendVarInt(14, bytes_read_);
+  }
+
+  // Field 15: padding_bytes_written
+  if (_has_field_[15]) {
+    msg->AppendVarInt(15, padding_bytes_written_);
+  }
+
+  // Field 16: padding_bytes_cleared
+  if (_has_field_[16]) {
+    msg->AppendVarInt(16, padding_bytes_cleared_);
+  }
+
+  // Field 2: chunks_written
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, chunks_written_);
+  }
+
+  // Field 10: chunks_rewritten
+  if (_has_field_[10]) {
+    msg->AppendVarInt(10, chunks_rewritten_);
+  }
+
+  // Field 3: chunks_overwritten
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, chunks_overwritten_);
+  }
+
+  // Field 18: chunks_discarded
+  if (_has_field_[18]) {
+    msg->AppendVarInt(18, chunks_discarded_);
+  }
+
+  // Field 17: chunks_read
+  if (_has_field_[17]) {
+    msg->AppendVarInt(17, chunks_read_);
+  }
+
+  // Field 11: chunks_committed_out_of_order
+  if (_has_field_[11]) {
+    msg->AppendVarInt(11, chunks_committed_out_of_order_);
+  }
+
+  // Field 4: write_wrap_count
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, write_wrap_count_);
+  }
+
+  // Field 5: patches_succeeded
+  if (_has_field_[5]) {
+    msg->AppendVarInt(5, patches_succeeded_);
+  }
+
+  // Field 6: patches_failed
+  if (_has_field_[6]) {
+    msg->AppendVarInt(6, patches_failed_);
+  }
+
+  // Field 7: readaheads_succeeded
+  if (_has_field_[7]) {
+    msg->AppendVarInt(7, readaheads_succeeded_);
+  }
+
+  // Field 8: readaheads_failed
+  if (_has_field_[8]) {
+    msg->AppendVarInt(8, readaheads_failed_);
+  }
+
+  // Field 9: abi_violations
+  if (_has_field_[9]) {
+    msg->AppendVarInt(9, abi_violations_);
+  }
+
+  // Field 19: trace_writer_packet_loss
+  if (_has_field_[19]) {
+    msg->AppendVarInt(19, trace_writer_packet_loss_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/common/tracing_service_capabilities.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/common/tracing_service_capabilities.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACING_SERVICE_CAPABILITIES_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACING_SERVICE_CAPABILITIES_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class TracingServiceCapabilities;
+enum ObservableEvents_Type : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT TracingServiceCapabilities : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kHasQueryCapabilitiesFieldNumber = 1,
+    kObservableEventsFieldNumber = 2,
+    kHasTraceConfigOutputPathFieldNumber = 3,
+  };
+
+  TracingServiceCapabilities();
+  ~TracingServiceCapabilities() override;
+  TracingServiceCapabilities(TracingServiceCapabilities&&) noexcept;
+  TracingServiceCapabilities& operator=(TracingServiceCapabilities&&);
+  TracingServiceCapabilities(const TracingServiceCapabilities&);
+  TracingServiceCapabilities& operator=(const TracingServiceCapabilities&);
+  bool operator==(const TracingServiceCapabilities&) const;
+  bool operator!=(const TracingServiceCapabilities& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_has_query_capabilities() const { return _has_field_[1]; }
+  bool has_query_capabilities() const { return has_query_capabilities_; }
+  void set_has_query_capabilities(bool value) { has_query_capabilities_ = value; _has_field_.set(1); }
+
+  const std::vector<ObservableEvents_Type>& observable_events() const { return observable_events_; }
+  std::vector<ObservableEvents_Type>* mutable_observable_events() { return &observable_events_; }
+  int observable_events_size() const { return static_cast<int>(observable_events_.size()); }
+  void clear_observable_events() { observable_events_.clear(); }
+  void add_observable_events(ObservableEvents_Type value) { observable_events_.emplace_back(value); }
+  ObservableEvents_Type* add_observable_events() { observable_events_.emplace_back(); return &observable_events_.back(); }
+
+  bool has_has_trace_config_output_path() const { return _has_field_[3]; }
+  bool has_trace_config_output_path() const { return has_trace_config_output_path_; }
+  void set_has_trace_config_output_path(bool value) { has_trace_config_output_path_ = value; _has_field_.set(3); }
+
+ private:
+  bool has_query_capabilities_{};
+  std::vector<ObservableEvents_Type> observable_events_;
+  bool has_trace_config_output_path_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<4> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACING_SERVICE_CAPABILITIES_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/common/tracing_service_capabilities.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/observable_events.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+TracingServiceCapabilities::TracingServiceCapabilities() = default;
+TracingServiceCapabilities::~TracingServiceCapabilities() = default;
+TracingServiceCapabilities::TracingServiceCapabilities(const TracingServiceCapabilities&) = default;
+TracingServiceCapabilities& TracingServiceCapabilities::operator=(const TracingServiceCapabilities&) = default;
+TracingServiceCapabilities::TracingServiceCapabilities(TracingServiceCapabilities&&) noexcept = default;
+TracingServiceCapabilities& TracingServiceCapabilities::operator=(TracingServiceCapabilities&&) = default;
+
+bool TracingServiceCapabilities::operator==(const TracingServiceCapabilities& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && has_query_capabilities_ == other.has_query_capabilities_
+   && observable_events_ == other.observable_events_
+   && has_trace_config_output_path_ == other.has_trace_config_output_path_;
+}
+
+bool TracingServiceCapabilities::ParseFromArray(const void* raw, size_t size) {
+  observable_events_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* has_query_capabilities */:
+        field.get(&has_query_capabilities_);
+        break;
+      case 2 /* observable_events */:
+        observable_events_.emplace_back();
+        field.get(&observable_events_.back());
+        break;
+      case 3 /* has_trace_config_output_path */:
+        field.get(&has_trace_config_output_path_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string TracingServiceCapabilities::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> TracingServiceCapabilities::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void TracingServiceCapabilities::Serialize(::protozero::Message* msg) const {
+  // Field 1: has_query_capabilities
+  if (_has_field_[1]) {
+    msg->AppendTinyVarInt(1, has_query_capabilities_);
+  }
+
+  // Field 2: observable_events
+  for (auto& it : observable_events_) {
+    msg->AppendVarInt(2, it);
+  }
+
+  // Field 3: has_trace_config_output_path
+  if (_has_field_[3]) {
+    msg->AppendTinyVarInt(3, has_trace_config_output_path_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/common/tracing_service_state.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/common/tracing_service_state.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACING_SERVICE_STATE_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACING_SERVICE_STATE_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class TracingServiceState;
+class TracingServiceState_DataSource;
+class DataSourceDescriptor;
+class TracingServiceState_Producer;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT TracingServiceState : public ::protozero::CppMessageObj {
+ public:
+  using Producer = TracingServiceState_Producer;
+  using DataSource = TracingServiceState_DataSource;
+  enum FieldNumbers {
+    kProducersFieldNumber = 1,
+    kDataSourcesFieldNumber = 2,
+    kNumSessionsFieldNumber = 3,
+    kNumSessionsStartedFieldNumber = 4,
+    kTracingServiceVersionFieldNumber = 5,
+  };
+
+  TracingServiceState();
+  ~TracingServiceState() override;
+  TracingServiceState(TracingServiceState&&) noexcept;
+  TracingServiceState& operator=(TracingServiceState&&);
+  TracingServiceState(const TracingServiceState&);
+  TracingServiceState& operator=(const TracingServiceState&);
+  bool operator==(const TracingServiceState&) const;
+  bool operator!=(const TracingServiceState& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<TracingServiceState_Producer>& producers() const { return producers_; }
+  std::vector<TracingServiceState_Producer>* mutable_producers() { return &producers_; }
+  int producers_size() const;
+  void clear_producers();
+  TracingServiceState_Producer* add_producers();
+
+  const std::vector<TracingServiceState_DataSource>& data_sources() const { return data_sources_; }
+  std::vector<TracingServiceState_DataSource>* mutable_data_sources() { return &data_sources_; }
+  int data_sources_size() const;
+  void clear_data_sources();
+  TracingServiceState_DataSource* add_data_sources();
+
+  bool has_num_sessions() const { return _has_field_[3]; }
+  int32_t num_sessions() const { return num_sessions_; }
+  void set_num_sessions(int32_t value) { num_sessions_ = value; _has_field_.set(3); }
+
+  bool has_num_sessions_started() const { return _has_field_[4]; }
+  int32_t num_sessions_started() const { return num_sessions_started_; }
+  void set_num_sessions_started(int32_t value) { num_sessions_started_ = value; _has_field_.set(4); }
+
+  bool has_tracing_service_version() const { return _has_field_[5]; }
+  const std::string& tracing_service_version() const { return tracing_service_version_; }
+  void set_tracing_service_version(const std::string& value) { tracing_service_version_ = value; _has_field_.set(5); }
+
+ private:
+  std::vector<TracingServiceState_Producer> producers_;
+  std::vector<TracingServiceState_DataSource> data_sources_;
+  int32_t num_sessions_{};
+  int32_t num_sessions_started_{};
+  std::string tracing_service_version_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<6> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TracingServiceState_DataSource : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDsDescriptorFieldNumber = 1,
+    kProducerIdFieldNumber = 2,
+  };
+
+  TracingServiceState_DataSource();
+  ~TracingServiceState_DataSource() override;
+  TracingServiceState_DataSource(TracingServiceState_DataSource&&) noexcept;
+  TracingServiceState_DataSource& operator=(TracingServiceState_DataSource&&);
+  TracingServiceState_DataSource(const TracingServiceState_DataSource&);
+  TracingServiceState_DataSource& operator=(const TracingServiceState_DataSource&);
+  bool operator==(const TracingServiceState_DataSource&) const;
+  bool operator!=(const TracingServiceState_DataSource& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_ds_descriptor() const { return _has_field_[1]; }
+  const DataSourceDescriptor& ds_descriptor() const { return *ds_descriptor_; }
+  DataSourceDescriptor* mutable_ds_descriptor() { _has_field_.set(1); return ds_descriptor_.get(); }
+
+  bool has_producer_id() const { return _has_field_[2]; }
+  int32_t producer_id() const { return producer_id_; }
+  void set_producer_id(int32_t value) { producer_id_ = value; _has_field_.set(2); }
+
+ private:
+  ::protozero::CopyablePtr<DataSourceDescriptor> ds_descriptor_;
+  int32_t producer_id_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TracingServiceState_Producer : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kIdFieldNumber = 1,
+    kNameFieldNumber = 2,
+    kUidFieldNumber = 3,
+    kSdkVersionFieldNumber = 4,
+  };
+
+  TracingServiceState_Producer();
+  ~TracingServiceState_Producer() override;
+  TracingServiceState_Producer(TracingServiceState_Producer&&) noexcept;
+  TracingServiceState_Producer& operator=(TracingServiceState_Producer&&);
+  TracingServiceState_Producer(const TracingServiceState_Producer&);
+  TracingServiceState_Producer& operator=(const TracingServiceState_Producer&);
+  bool operator==(const TracingServiceState_Producer&) const;
+  bool operator!=(const TracingServiceState_Producer& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_id() const { return _has_field_[1]; }
+  int32_t id() const { return id_; }
+  void set_id(int32_t value) { id_ = value; _has_field_.set(1); }
+
+  bool has_name() const { return _has_field_[2]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(2); }
+
+  bool has_uid() const { return _has_field_[3]; }
+  int32_t uid() const { return uid_; }
+  void set_uid(int32_t value) { uid_ = value; _has_field_.set(3); }
+
+  bool has_sdk_version() const { return _has_field_[4]; }
+  const std::string& sdk_version() const { return sdk_version_; }
+  void set_sdk_version(const std::string& value) { sdk_version_ = value; _has_field_.set(4); }
+
+ private:
+  int32_t id_{};
+  std::string name_{};
+  int32_t uid_{};
+  std::string sdk_version_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<5> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACING_SERVICE_STATE_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/common/track_event_descriptor.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACK_EVENT_DESCRIPTOR_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACK_EVENT_DESCRIPTOR_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class TrackEventDescriptor;
+class TrackEventCategory;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT TrackEventDescriptor : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kAvailableCategoriesFieldNumber = 1,
+  };
+
+  TrackEventDescriptor();
+  ~TrackEventDescriptor() override;
+  TrackEventDescriptor(TrackEventDescriptor&&) noexcept;
+  TrackEventDescriptor& operator=(TrackEventDescriptor&&);
+  TrackEventDescriptor(const TrackEventDescriptor&);
+  TrackEventDescriptor& operator=(const TrackEventDescriptor&);
+  bool operator==(const TrackEventDescriptor&) const;
+  bool operator!=(const TrackEventDescriptor& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<TrackEventCategory>& available_categories() const { return available_categories_; }
+  std::vector<TrackEventCategory>* mutable_available_categories() { return &available_categories_; }
+  int available_categories_size() const;
+  void clear_available_categories();
+  TrackEventCategory* add_available_categories();
+
+ private:
+  std::vector<TrackEventCategory> available_categories_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TrackEventCategory : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNameFieldNumber = 1,
+    kDescriptionFieldNumber = 2,
+    kTagsFieldNumber = 3,
+  };
+
+  TrackEventCategory();
+  ~TrackEventCategory() override;
+  TrackEventCategory(TrackEventCategory&&) noexcept;
+  TrackEventCategory& operator=(TrackEventCategory&&);
+  TrackEventCategory(const TrackEventCategory&);
+  TrackEventCategory& operator=(const TrackEventCategory&);
+  bool operator==(const TrackEventCategory&) const;
+  bool operator!=(const TrackEventCategory& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name() const { return _has_field_[1]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
+
+  bool has_description() const { return _has_field_[2]; }
+  const std::string& description() const { return description_; }
+  void set_description(const std::string& value) { description_ = value; _has_field_.set(2); }
+
+  const std::vector<std::string>& tags() const { return tags_; }
+  std::vector<std::string>* mutable_tags() { return &tags_; }
+  int tags_size() const { return static_cast<int>(tags_.size()); }
+  void clear_tags() { tags_.clear(); }
+  void add_tags(std::string value) { tags_.emplace_back(value); }
+  std::string* add_tags() { tags_.emplace_back(); return &tags_.back(); }
+
+ private:
+  std::string name_{};
+  std::string description_{};
+  std::vector<std::string> tags_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<4> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACK_EVENT_DESCRIPTOR_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/common/tracing_service_state.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/data_source_descriptor.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/track_event_descriptor.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/gpu_counter_descriptor.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+TracingServiceState::TracingServiceState() = default;
+TracingServiceState::~TracingServiceState() = default;
+TracingServiceState::TracingServiceState(const TracingServiceState&) = default;
+TracingServiceState& TracingServiceState::operator=(const TracingServiceState&) = default;
+TracingServiceState::TracingServiceState(TracingServiceState&&) noexcept = default;
+TracingServiceState& TracingServiceState::operator=(TracingServiceState&&) = default;
+
+bool TracingServiceState::operator==(const TracingServiceState& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && producers_ == other.producers_
+   && data_sources_ == other.data_sources_
+   && num_sessions_ == other.num_sessions_
+   && num_sessions_started_ == other.num_sessions_started_
+   && tracing_service_version_ == other.tracing_service_version_;
+}
+
+int TracingServiceState::producers_size() const { return static_cast<int>(producers_.size()); }
+void TracingServiceState::clear_producers() { producers_.clear(); }
+TracingServiceState_Producer* TracingServiceState::add_producers() { producers_.emplace_back(); return &producers_.back(); }
+int TracingServiceState::data_sources_size() const { return static_cast<int>(data_sources_.size()); }
+void TracingServiceState::clear_data_sources() { data_sources_.clear(); }
+TracingServiceState_DataSource* TracingServiceState::add_data_sources() { data_sources_.emplace_back(); return &data_sources_.back(); }
+bool TracingServiceState::ParseFromArray(const void* raw, size_t size) {
+  producers_.clear();
+  data_sources_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* producers */:
+        producers_.emplace_back();
+        producers_.back().ParseFromArray(field.data(), field.size());
+        break;
+      case 2 /* data_sources */:
+        data_sources_.emplace_back();
+        data_sources_.back().ParseFromArray(field.data(), field.size());
+        break;
+      case 3 /* num_sessions */:
+        field.get(&num_sessions_);
+        break;
+      case 4 /* num_sessions_started */:
+        field.get(&num_sessions_started_);
+        break;
+      case 5 /* tracing_service_version */:
+        field.get(&tracing_service_version_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string TracingServiceState::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> TracingServiceState::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void TracingServiceState::Serialize(::protozero::Message* msg) const {
+  // Field 1: producers
+  for (auto& it : producers_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(1));
+  }
+
+  // Field 2: data_sources
+  for (auto& it : data_sources_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(2));
+  }
+
+  // Field 3: num_sessions
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, num_sessions_);
+  }
+
+  // Field 4: num_sessions_started
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, num_sessions_started_);
+  }
+
+  // Field 5: tracing_service_version
+  if (_has_field_[5]) {
+    msg->AppendString(5, tracing_service_version_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+TracingServiceState_DataSource::TracingServiceState_DataSource() = default;
+TracingServiceState_DataSource::~TracingServiceState_DataSource() = default;
+TracingServiceState_DataSource::TracingServiceState_DataSource(const TracingServiceState_DataSource&) = default;
+TracingServiceState_DataSource& TracingServiceState_DataSource::operator=(const TracingServiceState_DataSource&) = default;
+TracingServiceState_DataSource::TracingServiceState_DataSource(TracingServiceState_DataSource&&) noexcept = default;
+TracingServiceState_DataSource& TracingServiceState_DataSource::operator=(TracingServiceState_DataSource&&) = default;
+
+bool TracingServiceState_DataSource::operator==(const TracingServiceState_DataSource& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && ds_descriptor_ == other.ds_descriptor_
+   && producer_id_ == other.producer_id_;
+}
+
+bool TracingServiceState_DataSource::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* ds_descriptor */:
+        (*ds_descriptor_).ParseFromArray(field.data(), field.size());
+        break;
+      case 2 /* producer_id */:
+        field.get(&producer_id_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string TracingServiceState_DataSource::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> TracingServiceState_DataSource::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void TracingServiceState_DataSource::Serialize(::protozero::Message* msg) const {
+  // Field 1: ds_descriptor
+  if (_has_field_[1]) {
+    (*ds_descriptor_).Serialize(msg->BeginNestedMessage<::protozero::Message>(1));
+  }
+
+  // Field 2: producer_id
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, producer_id_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+TracingServiceState_Producer::TracingServiceState_Producer() = default;
+TracingServiceState_Producer::~TracingServiceState_Producer() = default;
+TracingServiceState_Producer::TracingServiceState_Producer(const TracingServiceState_Producer&) = default;
+TracingServiceState_Producer& TracingServiceState_Producer::operator=(const TracingServiceState_Producer&) = default;
+TracingServiceState_Producer::TracingServiceState_Producer(TracingServiceState_Producer&&) noexcept = default;
+TracingServiceState_Producer& TracingServiceState_Producer::operator=(TracingServiceState_Producer&&) = default;
+
+bool TracingServiceState_Producer::operator==(const TracingServiceState_Producer& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && id_ == other.id_
+   && name_ == other.name_
+   && uid_ == other.uid_
+   && sdk_version_ == other.sdk_version_;
+}
+
+bool TracingServiceState_Producer::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* id */:
+        field.get(&id_);
+        break;
+      case 2 /* name */:
+        field.get(&name_);
+        break;
+      case 3 /* uid */:
+        field.get(&uid_);
+        break;
+      case 4 /* sdk_version */:
+        field.get(&sdk_version_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string TracingServiceState_Producer::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> TracingServiceState_Producer::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void TracingServiceState_Producer::Serialize(::protozero::Message* msg) const {
+  // Field 1: id
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, id_);
+  }
+
+  // Field 2: name
+  if (_has_field_[2]) {
+    msg->AppendString(2, name_);
+  }
+
+  // Field 3: uid
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, uid_);
+  }
+
+  // Field 4: sdk_version
+  if (_has_field_[4]) {
+    msg->AppendString(4, sdk_version_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/common/track_event_descriptor.gen.cc
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/common/track_event_descriptor.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+TrackEventDescriptor::TrackEventDescriptor() = default;
+TrackEventDescriptor::~TrackEventDescriptor() = default;
+TrackEventDescriptor::TrackEventDescriptor(const TrackEventDescriptor&) = default;
+TrackEventDescriptor& TrackEventDescriptor::operator=(const TrackEventDescriptor&) = default;
+TrackEventDescriptor::TrackEventDescriptor(TrackEventDescriptor&&) noexcept = default;
+TrackEventDescriptor& TrackEventDescriptor::operator=(TrackEventDescriptor&&) = default;
+
+bool TrackEventDescriptor::operator==(const TrackEventDescriptor& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && available_categories_ == other.available_categories_;
+}
+
+int TrackEventDescriptor::available_categories_size() const { return static_cast<int>(available_categories_.size()); }
+void TrackEventDescriptor::clear_available_categories() { available_categories_.clear(); }
+TrackEventCategory* TrackEventDescriptor::add_available_categories() { available_categories_.emplace_back(); return &available_categories_.back(); }
+bool TrackEventDescriptor::ParseFromArray(const void* raw, size_t size) {
+  available_categories_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* available_categories */:
+        available_categories_.emplace_back();
+        available_categories_.back().ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string TrackEventDescriptor::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> TrackEventDescriptor::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void TrackEventDescriptor::Serialize(::protozero::Message* msg) const {
+  // Field 1: available_categories
+  for (auto& it : available_categories_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(1));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+TrackEventCategory::TrackEventCategory() = default;
+TrackEventCategory::~TrackEventCategory() = default;
+TrackEventCategory::TrackEventCategory(const TrackEventCategory&) = default;
+TrackEventCategory& TrackEventCategory::operator=(const TrackEventCategory&) = default;
+TrackEventCategory::TrackEventCategory(TrackEventCategory&&) noexcept = default;
+TrackEventCategory& TrackEventCategory::operator=(TrackEventCategory&&) = default;
+
+bool TrackEventCategory::operator==(const TrackEventCategory& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && name_ == other.name_
+   && description_ == other.description_
+   && tags_ == other.tags_;
+}
+
+bool TrackEventCategory::ParseFromArray(const void* raw, size_t size) {
+  tags_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* name */:
+        field.get(&name_);
+        break;
+      case 2 /* description */:
+        field.get(&description_);
+        break;
+      case 3 /* tags */:
+        tags_.emplace_back();
+        field.get(&tags_.back());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string TrackEventCategory::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> TrackEventCategory::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void TrackEventCategory::Serialize(::protozero::Message* msg) const {
+  // Field 1: name
+  if (_has_field_[1]) {
+    msg->AppendString(1, name_);
+  }
+
+  // Field 2: description
+  if (_has_field_[2]) {
+    msg->AppendString(2, description_);
+  }
+
+  // Field 3: tags
+  for (auto& it : tags_) {
+    msg->AppendString(3, it);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/config/android/android_log_config.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/config/android/android_log_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_ANDROID_LOG_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_ANDROID_LOG_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class AndroidLogConfig;
+enum AndroidLogId : int;
+enum AndroidLogPriority : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT AndroidLogConfig : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kLogIdsFieldNumber = 1,
+    kMinPrioFieldNumber = 3,
+    kFilterTagsFieldNumber = 4,
+  };
+
+  AndroidLogConfig();
+  ~AndroidLogConfig() override;
+  AndroidLogConfig(AndroidLogConfig&&) noexcept;
+  AndroidLogConfig& operator=(AndroidLogConfig&&);
+  AndroidLogConfig(const AndroidLogConfig&);
+  AndroidLogConfig& operator=(const AndroidLogConfig&);
+  bool operator==(const AndroidLogConfig&) const;
+  bool operator!=(const AndroidLogConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<AndroidLogId>& log_ids() const { return log_ids_; }
+  std::vector<AndroidLogId>* mutable_log_ids() { return &log_ids_; }
+  int log_ids_size() const { return static_cast<int>(log_ids_.size()); }
+  void clear_log_ids() { log_ids_.clear(); }
+  void add_log_ids(AndroidLogId value) { log_ids_.emplace_back(value); }
+  AndroidLogId* add_log_ids() { log_ids_.emplace_back(); return &log_ids_.back(); }
+
+  bool has_min_prio() const { return _has_field_[3]; }
+  AndroidLogPriority min_prio() const { return min_prio_; }
+  void set_min_prio(AndroidLogPriority value) { min_prio_ = value; _has_field_.set(3); }
+
+  const std::vector<std::string>& filter_tags() const { return filter_tags_; }
+  std::vector<std::string>* mutable_filter_tags() { return &filter_tags_; }
+  int filter_tags_size() const { return static_cast<int>(filter_tags_.size()); }
+  void clear_filter_tags() { filter_tags_.clear(); }
+  void add_filter_tags(std::string value) { filter_tags_.emplace_back(value); }
+  std::string* add_filter_tags() { filter_tags_.emplace_back(); return &filter_tags_.back(); }
+
+ private:
+  std::vector<AndroidLogId> log_ids_;
+  AndroidLogPriority min_prio_{};
+  std::vector<std::string> filter_tags_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<5> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_ANDROID_LOG_CONFIG_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/config/android/android_log_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/android_log_constants.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+AndroidLogConfig::AndroidLogConfig() = default;
+AndroidLogConfig::~AndroidLogConfig() = default;
+AndroidLogConfig::AndroidLogConfig(const AndroidLogConfig&) = default;
+AndroidLogConfig& AndroidLogConfig::operator=(const AndroidLogConfig&) = default;
+AndroidLogConfig::AndroidLogConfig(AndroidLogConfig&&) noexcept = default;
+AndroidLogConfig& AndroidLogConfig::operator=(AndroidLogConfig&&) = default;
+
+bool AndroidLogConfig::operator==(const AndroidLogConfig& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && log_ids_ == other.log_ids_
+   && min_prio_ == other.min_prio_
+   && filter_tags_ == other.filter_tags_;
+}
+
+bool AndroidLogConfig::ParseFromArray(const void* raw, size_t size) {
+  log_ids_.clear();
+  filter_tags_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* log_ids */:
+        log_ids_.emplace_back();
+        field.get(&log_ids_.back());
+        break;
+      case 3 /* min_prio */:
+        field.get(&min_prio_);
+        break;
+      case 4 /* filter_tags */:
+        filter_tags_.emplace_back();
+        field.get(&filter_tags_.back());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string AndroidLogConfig::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> AndroidLogConfig::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void AndroidLogConfig::Serialize(::protozero::Message* msg) const {
+  // Field 1: log_ids
+  for (auto& it : log_ids_) {
+    msg->AppendVarInt(1, it);
+  }
+
+  // Field 3: min_prio
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, min_prio_);
+  }
+
+  // Field 4: filter_tags
+  for (auto& it : filter_tags_) {
+    msg->AppendString(4, it);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/config/android/android_polled_state_config.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/config/android/android_polled_state_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_ANDROID_POLLED_STATE_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_ANDROID_POLLED_STATE_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class AndroidPolledStateConfig;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT AndroidPolledStateConfig : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kPollMsFieldNumber = 1,
+  };
+
+  AndroidPolledStateConfig();
+  ~AndroidPolledStateConfig() override;
+  AndroidPolledStateConfig(AndroidPolledStateConfig&&) noexcept;
+  AndroidPolledStateConfig& operator=(AndroidPolledStateConfig&&);
+  AndroidPolledStateConfig(const AndroidPolledStateConfig&);
+  AndroidPolledStateConfig& operator=(const AndroidPolledStateConfig&);
+  bool operator==(const AndroidPolledStateConfig&) const;
+  bool operator!=(const AndroidPolledStateConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_poll_ms() const { return _has_field_[1]; }
+  uint32_t poll_ms() const { return poll_ms_; }
+  void set_poll_ms(uint32_t value) { poll_ms_ = value; _has_field_.set(1); }
+
+ private:
+  uint32_t poll_ms_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_ANDROID_POLLED_STATE_CONFIG_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/config/android/android_polled_state_config.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+AndroidPolledStateConfig::AndroidPolledStateConfig() = default;
+AndroidPolledStateConfig::~AndroidPolledStateConfig() = default;
+AndroidPolledStateConfig::AndroidPolledStateConfig(const AndroidPolledStateConfig&) = default;
+AndroidPolledStateConfig& AndroidPolledStateConfig::operator=(const AndroidPolledStateConfig&) = default;
+AndroidPolledStateConfig::AndroidPolledStateConfig(AndroidPolledStateConfig&&) noexcept = default;
+AndroidPolledStateConfig& AndroidPolledStateConfig::operator=(AndroidPolledStateConfig&&) = default;
+
+bool AndroidPolledStateConfig::operator==(const AndroidPolledStateConfig& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && poll_ms_ == other.poll_ms_;
+}
+
+bool AndroidPolledStateConfig::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* poll_ms */:
+        field.get(&poll_ms_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string AndroidPolledStateConfig::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> AndroidPolledStateConfig::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void AndroidPolledStateConfig::Serialize(::protozero::Message* msg) const {
+  // Field 1: poll_ms
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, poll_ms_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/config/android/packages_list_config.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/config/android/packages_list_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_PACKAGES_LIST_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_PACKAGES_LIST_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class PackagesListConfig;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT PackagesListConfig : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kPackageNameFilterFieldNumber = 1,
+  };
+
+  PackagesListConfig();
+  ~PackagesListConfig() override;
+  PackagesListConfig(PackagesListConfig&&) noexcept;
+  PackagesListConfig& operator=(PackagesListConfig&&);
+  PackagesListConfig(const PackagesListConfig&);
+  PackagesListConfig& operator=(const PackagesListConfig&);
+  bool operator==(const PackagesListConfig&) const;
+  bool operator!=(const PackagesListConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<std::string>& package_name_filter() const { return package_name_filter_; }
+  std::vector<std::string>* mutable_package_name_filter() { return &package_name_filter_; }
+  int package_name_filter_size() const { return static_cast<int>(package_name_filter_.size()); }
+  void clear_package_name_filter() { package_name_filter_.clear(); }
+  void add_package_name_filter(std::string value) { package_name_filter_.emplace_back(value); }
+  std::string* add_package_name_filter() { package_name_filter_.emplace_back(); return &package_name_filter_.back(); }
+
+ private:
+  std::vector<std::string> package_name_filter_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_PACKAGES_LIST_CONFIG_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/config/android/packages_list_config.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+PackagesListConfig::PackagesListConfig() = default;
+PackagesListConfig::~PackagesListConfig() = default;
+PackagesListConfig::PackagesListConfig(const PackagesListConfig&) = default;
+PackagesListConfig& PackagesListConfig::operator=(const PackagesListConfig&) = default;
+PackagesListConfig::PackagesListConfig(PackagesListConfig&&) noexcept = default;
+PackagesListConfig& PackagesListConfig::operator=(PackagesListConfig&&) = default;
+
+bool PackagesListConfig::operator==(const PackagesListConfig& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && package_name_filter_ == other.package_name_filter_;
+}
+
+bool PackagesListConfig::ParseFromArray(const void* raw, size_t size) {
+  package_name_filter_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* package_name_filter */:
+        package_name_filter_.emplace_back();
+        field.get(&package_name_filter_.back());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string PackagesListConfig::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> PackagesListConfig::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void PackagesListConfig::Serialize(::protozero::Message* msg) const {
+  // Field 1: package_name_filter
+  for (auto& it : package_name_filter_) {
+    msg->AppendString(1, it);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/config/ftrace/ftrace_config.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/config/ftrace/ftrace_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_FTRACE_FTRACE_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_FTRACE_FTRACE_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class FtraceConfig;
+class FtraceConfig_CompactSchedConfig;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT FtraceConfig : public ::protozero::CppMessageObj {
+ public:
+  using CompactSchedConfig = FtraceConfig_CompactSchedConfig;
+  enum FieldNumbers {
+    kFtraceEventsFieldNumber = 1,
+    kAtraceCategoriesFieldNumber = 2,
+    kAtraceAppsFieldNumber = 3,
+    kBufferSizeKbFieldNumber = 10,
+    kDrainPeriodMsFieldNumber = 11,
+    kCompactSchedFieldNumber = 12,
+    kSymbolizeKsymsFieldNumber = 13,
+    kInitializeKsymsSynchronouslyForTestingFieldNumber = 14,
+  };
+
+  FtraceConfig();
+  ~FtraceConfig() override;
+  FtraceConfig(FtraceConfig&&) noexcept;
+  FtraceConfig& operator=(FtraceConfig&&);
+  FtraceConfig(const FtraceConfig&);
+  FtraceConfig& operator=(const FtraceConfig&);
+  bool operator==(const FtraceConfig&) const;
+  bool operator!=(const FtraceConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<std::string>& ftrace_events() const { return ftrace_events_; }
+  std::vector<std::string>* mutable_ftrace_events() { return &ftrace_events_; }
+  int ftrace_events_size() const { return static_cast<int>(ftrace_events_.size()); }
+  void clear_ftrace_events() { ftrace_events_.clear(); }
+  void add_ftrace_events(std::string value) { ftrace_events_.emplace_back(value); }
+  std::string* add_ftrace_events() { ftrace_events_.emplace_back(); return &ftrace_events_.back(); }
+
+  const std::vector<std::string>& atrace_categories() const { return atrace_categories_; }
+  std::vector<std::string>* mutable_atrace_categories() { return &atrace_categories_; }
+  int atrace_categories_size() const { return static_cast<int>(atrace_categories_.size()); }
+  void clear_atrace_categories() { atrace_categories_.clear(); }
+  void add_atrace_categories(std::string value) { atrace_categories_.emplace_back(value); }
+  std::string* add_atrace_categories() { atrace_categories_.emplace_back(); return &atrace_categories_.back(); }
+
+  const std::vector<std::string>& atrace_apps() const { return atrace_apps_; }
+  std::vector<std::string>* mutable_atrace_apps() { return &atrace_apps_; }
+  int atrace_apps_size() const { return static_cast<int>(atrace_apps_.size()); }
+  void clear_atrace_apps() { atrace_apps_.clear(); }
+  void add_atrace_apps(std::string value) { atrace_apps_.emplace_back(value); }
+  std::string* add_atrace_apps() { atrace_apps_.emplace_back(); return &atrace_apps_.back(); }
+
+  bool has_buffer_size_kb() const { return _has_field_[10]; }
+  uint32_t buffer_size_kb() const { return buffer_size_kb_; }
+  void set_buffer_size_kb(uint32_t value) { buffer_size_kb_ = value; _has_field_.set(10); }
+
+  bool has_drain_period_ms() const { return _has_field_[11]; }
+  uint32_t drain_period_ms() const { return drain_period_ms_; }
+  void set_drain_period_ms(uint32_t value) { drain_period_ms_ = value; _has_field_.set(11); }
+
+  bool has_compact_sched() const { return _has_field_[12]; }
+  const FtraceConfig_CompactSchedConfig& compact_sched() const { return *compact_sched_; }
+  FtraceConfig_CompactSchedConfig* mutable_compact_sched() { _has_field_.set(12); return compact_sched_.get(); }
+
+  bool has_symbolize_ksyms() const { return _has_field_[13]; }
+  bool symbolize_ksyms() const { return symbolize_ksyms_; }
+  void set_symbolize_ksyms(bool value) { symbolize_ksyms_ = value; _has_field_.set(13); }
+
+  bool has_initialize_ksyms_synchronously_for_testing() const { return _has_field_[14]; }
+  bool initialize_ksyms_synchronously_for_testing() const { return initialize_ksyms_synchronously_for_testing_; }
+  void set_initialize_ksyms_synchronously_for_testing(bool value) { initialize_ksyms_synchronously_for_testing_ = value; _has_field_.set(14); }
+
+ private:
+  std::vector<std::string> ftrace_events_;
+  std::vector<std::string> atrace_categories_;
+  std::vector<std::string> atrace_apps_;
+  uint32_t buffer_size_kb_{};
+  uint32_t drain_period_ms_{};
+  ::protozero::CopyablePtr<FtraceConfig_CompactSchedConfig> compact_sched_;
+  bool symbolize_ksyms_{};
+  bool initialize_ksyms_synchronously_for_testing_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<15> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT FtraceConfig_CompactSchedConfig : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kEnabledFieldNumber = 1,
+  };
+
+  FtraceConfig_CompactSchedConfig();
+  ~FtraceConfig_CompactSchedConfig() override;
+  FtraceConfig_CompactSchedConfig(FtraceConfig_CompactSchedConfig&&) noexcept;
+  FtraceConfig_CompactSchedConfig& operator=(FtraceConfig_CompactSchedConfig&&);
+  FtraceConfig_CompactSchedConfig(const FtraceConfig_CompactSchedConfig&);
+  FtraceConfig_CompactSchedConfig& operator=(const FtraceConfig_CompactSchedConfig&);
+  bool operator==(const FtraceConfig_CompactSchedConfig&) const;
+  bool operator!=(const FtraceConfig_CompactSchedConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_enabled() const { return _has_field_[1]; }
+  bool enabled() const { return enabled_; }
+  void set_enabled(bool value) { enabled_ = value; _has_field_.set(1); }
+
+ private:
+  bool enabled_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_FTRACE_FTRACE_CONFIG_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/config/ftrace/ftrace_config.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+FtraceConfig::FtraceConfig() = default;
+FtraceConfig::~FtraceConfig() = default;
+FtraceConfig::FtraceConfig(const FtraceConfig&) = default;
+FtraceConfig& FtraceConfig::operator=(const FtraceConfig&) = default;
+FtraceConfig::FtraceConfig(FtraceConfig&&) noexcept = default;
+FtraceConfig& FtraceConfig::operator=(FtraceConfig&&) = default;
+
+bool FtraceConfig::operator==(const FtraceConfig& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && ftrace_events_ == other.ftrace_events_
+   && atrace_categories_ == other.atrace_categories_
+   && atrace_apps_ == other.atrace_apps_
+   && buffer_size_kb_ == other.buffer_size_kb_
+   && drain_period_ms_ == other.drain_period_ms_
+   && compact_sched_ == other.compact_sched_
+   && symbolize_ksyms_ == other.symbolize_ksyms_
+   && initialize_ksyms_synchronously_for_testing_ == other.initialize_ksyms_synchronously_for_testing_;
+}
+
+bool FtraceConfig::ParseFromArray(const void* raw, size_t size) {
+  ftrace_events_.clear();
+  atrace_categories_.clear();
+  atrace_apps_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* ftrace_events */:
+        ftrace_events_.emplace_back();
+        field.get(&ftrace_events_.back());
+        break;
+      case 2 /* atrace_categories */:
+        atrace_categories_.emplace_back();
+        field.get(&atrace_categories_.back());
+        break;
+      case 3 /* atrace_apps */:
+        atrace_apps_.emplace_back();
+        field.get(&atrace_apps_.back());
+        break;
+      case 10 /* buffer_size_kb */:
+        field.get(&buffer_size_kb_);
+        break;
+      case 11 /* drain_period_ms */:
+        field.get(&drain_period_ms_);
+        break;
+      case 12 /* compact_sched */:
+        (*compact_sched_).ParseFromArray(field.data(), field.size());
+        break;
+      case 13 /* symbolize_ksyms */:
+        field.get(&symbolize_ksyms_);
+        break;
+      case 14 /* initialize_ksyms_synchronously_for_testing */:
+        field.get(&initialize_ksyms_synchronously_for_testing_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string FtraceConfig::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> FtraceConfig::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void FtraceConfig::Serialize(::protozero::Message* msg) const {
+  // Field 1: ftrace_events
+  for (auto& it : ftrace_events_) {
+    msg->AppendString(1, it);
+  }
+
+  // Field 2: atrace_categories
+  for (auto& it : atrace_categories_) {
+    msg->AppendString(2, it);
+  }
+
+  // Field 3: atrace_apps
+  for (auto& it : atrace_apps_) {
+    msg->AppendString(3, it);
+  }
+
+  // Field 10: buffer_size_kb
+  if (_has_field_[10]) {
+    msg->AppendVarInt(10, buffer_size_kb_);
+  }
+
+  // Field 11: drain_period_ms
+  if (_has_field_[11]) {
+    msg->AppendVarInt(11, drain_period_ms_);
+  }
+
+  // Field 12: compact_sched
+  if (_has_field_[12]) {
+    (*compact_sched_).Serialize(msg->BeginNestedMessage<::protozero::Message>(12));
+  }
+
+  // Field 13: symbolize_ksyms
+  if (_has_field_[13]) {
+    msg->AppendTinyVarInt(13, symbolize_ksyms_);
+  }
+
+  // Field 14: initialize_ksyms_synchronously_for_testing
+  if (_has_field_[14]) {
+    msg->AppendTinyVarInt(14, initialize_ksyms_synchronously_for_testing_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+FtraceConfig_CompactSchedConfig::FtraceConfig_CompactSchedConfig() = default;
+FtraceConfig_CompactSchedConfig::~FtraceConfig_CompactSchedConfig() = default;
+FtraceConfig_CompactSchedConfig::FtraceConfig_CompactSchedConfig(const FtraceConfig_CompactSchedConfig&) = default;
+FtraceConfig_CompactSchedConfig& FtraceConfig_CompactSchedConfig::operator=(const FtraceConfig_CompactSchedConfig&) = default;
+FtraceConfig_CompactSchedConfig::FtraceConfig_CompactSchedConfig(FtraceConfig_CompactSchedConfig&&) noexcept = default;
+FtraceConfig_CompactSchedConfig& FtraceConfig_CompactSchedConfig::operator=(FtraceConfig_CompactSchedConfig&&) = default;
+
+bool FtraceConfig_CompactSchedConfig::operator==(const FtraceConfig_CompactSchedConfig& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && enabled_ == other.enabled_;
+}
+
+bool FtraceConfig_CompactSchedConfig::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* enabled */:
+        field.get(&enabled_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string FtraceConfig_CompactSchedConfig::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> FtraceConfig_CompactSchedConfig::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void FtraceConfig_CompactSchedConfig::Serialize(::protozero::Message* msg) const {
+  // Field 1: enabled
+  if (_has_field_[1]) {
+    msg->AppendTinyVarInt(1, enabled_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/config/gpu/gpu_counter_config.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/config/gpu/gpu_counter_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_GPU_GPU_COUNTER_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_GPU_GPU_COUNTER_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class GpuCounterConfig;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT GpuCounterConfig : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kCounterPeriodNsFieldNumber = 1,
+    kCounterIdsFieldNumber = 2,
+    kInstrumentedSamplingFieldNumber = 3,
+    kFixGpuClockFieldNumber = 4,
+  };
+
+  GpuCounterConfig();
+  ~GpuCounterConfig() override;
+  GpuCounterConfig(GpuCounterConfig&&) noexcept;
+  GpuCounterConfig& operator=(GpuCounterConfig&&);
+  GpuCounterConfig(const GpuCounterConfig&);
+  GpuCounterConfig& operator=(const GpuCounterConfig&);
+  bool operator==(const GpuCounterConfig&) const;
+  bool operator!=(const GpuCounterConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_counter_period_ns() const { return _has_field_[1]; }
+  uint64_t counter_period_ns() const { return counter_period_ns_; }
+  void set_counter_period_ns(uint64_t value) { counter_period_ns_ = value; _has_field_.set(1); }
+
+  const std::vector<uint32_t>& counter_ids() const { return counter_ids_; }
+  std::vector<uint32_t>* mutable_counter_ids() { return &counter_ids_; }
+  int counter_ids_size() const { return static_cast<int>(counter_ids_.size()); }
+  void clear_counter_ids() { counter_ids_.clear(); }
+  void add_counter_ids(uint32_t value) { counter_ids_.emplace_back(value); }
+  uint32_t* add_counter_ids() { counter_ids_.emplace_back(); return &counter_ids_.back(); }
+
+  bool has_instrumented_sampling() const { return _has_field_[3]; }
+  bool instrumented_sampling() const { return instrumented_sampling_; }
+  void set_instrumented_sampling(bool value) { instrumented_sampling_ = value; _has_field_.set(3); }
+
+  bool has_fix_gpu_clock() const { return _has_field_[4]; }
+  bool fix_gpu_clock() const { return fix_gpu_clock_; }
+  void set_fix_gpu_clock(bool value) { fix_gpu_clock_ = value; _has_field_.set(4); }
+
+ private:
+  uint64_t counter_period_ns_{};
+  std::vector<uint32_t> counter_ids_;
+  bool instrumented_sampling_{};
+  bool fix_gpu_clock_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<5> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_GPU_GPU_COUNTER_CONFIG_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/config/gpu/gpu_counter_config.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+GpuCounterConfig::GpuCounterConfig() = default;
+GpuCounterConfig::~GpuCounterConfig() = default;
+GpuCounterConfig::GpuCounterConfig(const GpuCounterConfig&) = default;
+GpuCounterConfig& GpuCounterConfig::operator=(const GpuCounterConfig&) = default;
+GpuCounterConfig::GpuCounterConfig(GpuCounterConfig&&) noexcept = default;
+GpuCounterConfig& GpuCounterConfig::operator=(GpuCounterConfig&&) = default;
+
+bool GpuCounterConfig::operator==(const GpuCounterConfig& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && counter_period_ns_ == other.counter_period_ns_
+   && counter_ids_ == other.counter_ids_
+   && instrumented_sampling_ == other.instrumented_sampling_
+   && fix_gpu_clock_ == other.fix_gpu_clock_;
+}
+
+bool GpuCounterConfig::ParseFromArray(const void* raw, size_t size) {
+  counter_ids_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* counter_period_ns */:
+        field.get(&counter_period_ns_);
+        break;
+      case 2 /* counter_ids */:
+        counter_ids_.emplace_back();
+        field.get(&counter_ids_.back());
+        break;
+      case 3 /* instrumented_sampling */:
+        field.get(&instrumented_sampling_);
+        break;
+      case 4 /* fix_gpu_clock */:
+        field.get(&fix_gpu_clock_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string GpuCounterConfig::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> GpuCounterConfig::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void GpuCounterConfig::Serialize(::protozero::Message* msg) const {
+  // Field 1: counter_period_ns
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, counter_period_ns_);
+  }
+
+  // Field 2: counter_ids
+  for (auto& it : counter_ids_) {
+    msg->AppendVarInt(2, it);
+  }
+
+  // Field 3: instrumented_sampling
+  if (_has_field_[3]) {
+    msg->AppendTinyVarInt(3, instrumented_sampling_);
+  }
+
+  // Field 4: fix_gpu_clock
+  if (_has_field_[4]) {
+    msg->AppendTinyVarInt(4, fix_gpu_clock_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/config/gpu/vulkan_memory_config.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/config/gpu/vulkan_memory_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_GPU_VULKAN_MEMORY_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_GPU_VULKAN_MEMORY_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class VulkanMemoryConfig;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT VulkanMemoryConfig : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kTrackDriverMemoryUsageFieldNumber = 1,
+    kTrackDeviceMemoryUsageFieldNumber = 2,
+  };
+
+  VulkanMemoryConfig();
+  ~VulkanMemoryConfig() override;
+  VulkanMemoryConfig(VulkanMemoryConfig&&) noexcept;
+  VulkanMemoryConfig& operator=(VulkanMemoryConfig&&);
+  VulkanMemoryConfig(const VulkanMemoryConfig&);
+  VulkanMemoryConfig& operator=(const VulkanMemoryConfig&);
+  bool operator==(const VulkanMemoryConfig&) const;
+  bool operator!=(const VulkanMemoryConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_track_driver_memory_usage() const { return _has_field_[1]; }
+  bool track_driver_memory_usage() const { return track_driver_memory_usage_; }
+  void set_track_driver_memory_usage(bool value) { track_driver_memory_usage_ = value; _has_field_.set(1); }
+
+  bool has_track_device_memory_usage() const { return _has_field_[2]; }
+  bool track_device_memory_usage() const { return track_device_memory_usage_; }
+  void set_track_device_memory_usage(bool value) { track_device_memory_usage_ = value; _has_field_.set(2); }
+
+ private:
+  bool track_driver_memory_usage_{};
+  bool track_device_memory_usage_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_GPU_VULKAN_MEMORY_CONFIG_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/config/gpu/vulkan_memory_config.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+VulkanMemoryConfig::VulkanMemoryConfig() = default;
+VulkanMemoryConfig::~VulkanMemoryConfig() = default;
+VulkanMemoryConfig::VulkanMemoryConfig(const VulkanMemoryConfig&) = default;
+VulkanMemoryConfig& VulkanMemoryConfig::operator=(const VulkanMemoryConfig&) = default;
+VulkanMemoryConfig::VulkanMemoryConfig(VulkanMemoryConfig&&) noexcept = default;
+VulkanMemoryConfig& VulkanMemoryConfig::operator=(VulkanMemoryConfig&&) = default;
+
+bool VulkanMemoryConfig::operator==(const VulkanMemoryConfig& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && track_driver_memory_usage_ == other.track_driver_memory_usage_
+   && track_device_memory_usage_ == other.track_device_memory_usage_;
+}
+
+bool VulkanMemoryConfig::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* track_driver_memory_usage */:
+        field.get(&track_driver_memory_usage_);
+        break;
+      case 2 /* track_device_memory_usage */:
+        field.get(&track_device_memory_usage_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string VulkanMemoryConfig::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> VulkanMemoryConfig::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void VulkanMemoryConfig::Serialize(::protozero::Message* msg) const {
+  // Field 1: track_driver_memory_usage
+  if (_has_field_[1]) {
+    msg->AppendTinyVarInt(1, track_driver_memory_usage_);
+  }
+
+  // Field 2: track_device_memory_usage
+  if (_has_field_[2]) {
+    msg->AppendTinyVarInt(2, track_device_memory_usage_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/config/inode_file/inode_file_config.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/config/inode_file/inode_file_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INODE_FILE_INODE_FILE_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INODE_FILE_INODE_FILE_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class InodeFileConfig;
+class InodeFileConfig_MountPointMappingEntry;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT InodeFileConfig : public ::protozero::CppMessageObj {
+ public:
+  using MountPointMappingEntry = InodeFileConfig_MountPointMappingEntry;
+  enum FieldNumbers {
+    kScanIntervalMsFieldNumber = 1,
+    kScanDelayMsFieldNumber = 2,
+    kScanBatchSizeFieldNumber = 3,
+    kDoNotScanFieldNumber = 4,
+    kScanMountPointsFieldNumber = 5,
+    kMountPointMappingFieldNumber = 6,
+  };
+
+  InodeFileConfig();
+  ~InodeFileConfig() override;
+  InodeFileConfig(InodeFileConfig&&) noexcept;
+  InodeFileConfig& operator=(InodeFileConfig&&);
+  InodeFileConfig(const InodeFileConfig&);
+  InodeFileConfig& operator=(const InodeFileConfig&);
+  bool operator==(const InodeFileConfig&) const;
+  bool operator!=(const InodeFileConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_scan_interval_ms() const { return _has_field_[1]; }
+  uint32_t scan_interval_ms() const { return scan_interval_ms_; }
+  void set_scan_interval_ms(uint32_t value) { scan_interval_ms_ = value; _has_field_.set(1); }
+
+  bool has_scan_delay_ms() const { return _has_field_[2]; }
+  uint32_t scan_delay_ms() const { return scan_delay_ms_; }
+  void set_scan_delay_ms(uint32_t value) { scan_delay_ms_ = value; _has_field_.set(2); }
+
+  bool has_scan_batch_size() const { return _has_field_[3]; }
+  uint32_t scan_batch_size() const { return scan_batch_size_; }
+  void set_scan_batch_size(uint32_t value) { scan_batch_size_ = value; _has_field_.set(3); }
+
+  bool has_do_not_scan() const { return _has_field_[4]; }
+  bool do_not_scan() const { return do_not_scan_; }
+  void set_do_not_scan(bool value) { do_not_scan_ = value; _has_field_.set(4); }
+
+  const std::vector<std::string>& scan_mount_points() const { return scan_mount_points_; }
+  std::vector<std::string>* mutable_scan_mount_points() { return &scan_mount_points_; }
+  int scan_mount_points_size() const { return static_cast<int>(scan_mount_points_.size()); }
+  void clear_scan_mount_points() { scan_mount_points_.clear(); }
+  void add_scan_mount_points(std::string value) { scan_mount_points_.emplace_back(value); }
+  std::string* add_scan_mount_points() { scan_mount_points_.emplace_back(); return &scan_mount_points_.back(); }
+
+  const std::vector<InodeFileConfig_MountPointMappingEntry>& mount_point_mapping() const { return mount_point_mapping_; }
+  std::vector<InodeFileConfig_MountPointMappingEntry>* mutable_mount_point_mapping() { return &mount_point_mapping_; }
+  int mount_point_mapping_size() const;
+  void clear_mount_point_mapping();
+  InodeFileConfig_MountPointMappingEntry* add_mount_point_mapping();
+
+ private:
+  uint32_t scan_interval_ms_{};
+  uint32_t scan_delay_ms_{};
+  uint32_t scan_batch_size_{};
+  bool do_not_scan_{};
+  std::vector<std::string> scan_mount_points_;
+  std::vector<InodeFileConfig_MountPointMappingEntry> mount_point_mapping_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<7> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT InodeFileConfig_MountPointMappingEntry : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kMountpointFieldNumber = 1,
+    kScanRootsFieldNumber = 2,
+  };
+
+  InodeFileConfig_MountPointMappingEntry();
+  ~InodeFileConfig_MountPointMappingEntry() override;
+  InodeFileConfig_MountPointMappingEntry(InodeFileConfig_MountPointMappingEntry&&) noexcept;
+  InodeFileConfig_MountPointMappingEntry& operator=(InodeFileConfig_MountPointMappingEntry&&);
+  InodeFileConfig_MountPointMappingEntry(const InodeFileConfig_MountPointMappingEntry&);
+  InodeFileConfig_MountPointMappingEntry& operator=(const InodeFileConfig_MountPointMappingEntry&);
+  bool operator==(const InodeFileConfig_MountPointMappingEntry&) const;
+  bool operator!=(const InodeFileConfig_MountPointMappingEntry& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_mountpoint() const { return _has_field_[1]; }
+  const std::string& mountpoint() const { return mountpoint_; }
+  void set_mountpoint(const std::string& value) { mountpoint_ = value; _has_field_.set(1); }
+
+  const std::vector<std::string>& scan_roots() const { return scan_roots_; }
+  std::vector<std::string>* mutable_scan_roots() { return &scan_roots_; }
+  int scan_roots_size() const { return static_cast<int>(scan_roots_.size()); }
+  void clear_scan_roots() { scan_roots_.clear(); }
+  void add_scan_roots(std::string value) { scan_roots_.emplace_back(value); }
+  std::string* add_scan_roots() { scan_roots_.emplace_back(); return &scan_roots_.back(); }
+
+ private:
+  std::string mountpoint_{};
+  std::vector<std::string> scan_roots_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INODE_FILE_INODE_FILE_CONFIG_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/config/inode_file/inode_file_config.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+InodeFileConfig::InodeFileConfig() = default;
+InodeFileConfig::~InodeFileConfig() = default;
+InodeFileConfig::InodeFileConfig(const InodeFileConfig&) = default;
+InodeFileConfig& InodeFileConfig::operator=(const InodeFileConfig&) = default;
+InodeFileConfig::InodeFileConfig(InodeFileConfig&&) noexcept = default;
+InodeFileConfig& InodeFileConfig::operator=(InodeFileConfig&&) = default;
+
+bool InodeFileConfig::operator==(const InodeFileConfig& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && scan_interval_ms_ == other.scan_interval_ms_
+   && scan_delay_ms_ == other.scan_delay_ms_
+   && scan_batch_size_ == other.scan_batch_size_
+   && do_not_scan_ == other.do_not_scan_
+   && scan_mount_points_ == other.scan_mount_points_
+   && mount_point_mapping_ == other.mount_point_mapping_;
+}
+
+int InodeFileConfig::mount_point_mapping_size() const { return static_cast<int>(mount_point_mapping_.size()); }
+void InodeFileConfig::clear_mount_point_mapping() { mount_point_mapping_.clear(); }
+InodeFileConfig_MountPointMappingEntry* InodeFileConfig::add_mount_point_mapping() { mount_point_mapping_.emplace_back(); return &mount_point_mapping_.back(); }
+bool InodeFileConfig::ParseFromArray(const void* raw, size_t size) {
+  scan_mount_points_.clear();
+  mount_point_mapping_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* scan_interval_ms */:
+        field.get(&scan_interval_ms_);
+        break;
+      case 2 /* scan_delay_ms */:
+        field.get(&scan_delay_ms_);
+        break;
+      case 3 /* scan_batch_size */:
+        field.get(&scan_batch_size_);
+        break;
+      case 4 /* do_not_scan */:
+        field.get(&do_not_scan_);
+        break;
+      case 5 /* scan_mount_points */:
+        scan_mount_points_.emplace_back();
+        field.get(&scan_mount_points_.back());
+        break;
+      case 6 /* mount_point_mapping */:
+        mount_point_mapping_.emplace_back();
+        mount_point_mapping_.back().ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string InodeFileConfig::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> InodeFileConfig::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void InodeFileConfig::Serialize(::protozero::Message* msg) const {
+  // Field 1: scan_interval_ms
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, scan_interval_ms_);
+  }
+
+  // Field 2: scan_delay_ms
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, scan_delay_ms_);
+  }
+
+  // Field 3: scan_batch_size
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, scan_batch_size_);
+  }
+
+  // Field 4: do_not_scan
+  if (_has_field_[4]) {
+    msg->AppendTinyVarInt(4, do_not_scan_);
+  }
+
+  // Field 5: scan_mount_points
+  for (auto& it : scan_mount_points_) {
+    msg->AppendString(5, it);
+  }
+
+  // Field 6: mount_point_mapping
+  for (auto& it : mount_point_mapping_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(6));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+InodeFileConfig_MountPointMappingEntry::InodeFileConfig_MountPointMappingEntry() = default;
+InodeFileConfig_MountPointMappingEntry::~InodeFileConfig_MountPointMappingEntry() = default;
+InodeFileConfig_MountPointMappingEntry::InodeFileConfig_MountPointMappingEntry(const InodeFileConfig_MountPointMappingEntry&) = default;
+InodeFileConfig_MountPointMappingEntry& InodeFileConfig_MountPointMappingEntry::operator=(const InodeFileConfig_MountPointMappingEntry&) = default;
+InodeFileConfig_MountPointMappingEntry::InodeFileConfig_MountPointMappingEntry(InodeFileConfig_MountPointMappingEntry&&) noexcept = default;
+InodeFileConfig_MountPointMappingEntry& InodeFileConfig_MountPointMappingEntry::operator=(InodeFileConfig_MountPointMappingEntry&&) = default;
+
+bool InodeFileConfig_MountPointMappingEntry::operator==(const InodeFileConfig_MountPointMappingEntry& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && mountpoint_ == other.mountpoint_
+   && scan_roots_ == other.scan_roots_;
+}
+
+bool InodeFileConfig_MountPointMappingEntry::ParseFromArray(const void* raw, size_t size) {
+  scan_roots_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* mountpoint */:
+        field.get(&mountpoint_);
+        break;
+      case 2 /* scan_roots */:
+        scan_roots_.emplace_back();
+        field.get(&scan_roots_.back());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string InodeFileConfig_MountPointMappingEntry::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> InodeFileConfig_MountPointMappingEntry::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void InodeFileConfig_MountPointMappingEntry::Serialize(::protozero::Message* msg) const {
+  // Field 1: mountpoint
+  if (_has_field_[1]) {
+    msg->AppendString(1, mountpoint_);
+  }
+
+  // Field 2: scan_roots
+  for (auto& it : scan_roots_) {
+    msg->AppendString(2, it);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/config/interceptors/console_config.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/config/interceptors/console_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INTERCEPTORS_CONSOLE_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INTERCEPTORS_CONSOLE_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ConsoleConfig;
+enum ConsoleConfig_Output : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum ConsoleConfig_Output : int {
+  ConsoleConfig_Output_OUTPUT_UNSPECIFIED = 0,
+  ConsoleConfig_Output_OUTPUT_STDOUT = 1,
+  ConsoleConfig_Output_OUTPUT_STDERR = 2,
+};
+
+class PERFETTO_EXPORT ConsoleConfig : public ::protozero::CppMessageObj {
+ public:
+  using Output = ConsoleConfig_Output;
+  static constexpr auto OUTPUT_UNSPECIFIED = ConsoleConfig_Output_OUTPUT_UNSPECIFIED;
+  static constexpr auto OUTPUT_STDOUT = ConsoleConfig_Output_OUTPUT_STDOUT;
+  static constexpr auto OUTPUT_STDERR = ConsoleConfig_Output_OUTPUT_STDERR;
+  static constexpr auto Output_MIN = ConsoleConfig_Output_OUTPUT_UNSPECIFIED;
+  static constexpr auto Output_MAX = ConsoleConfig_Output_OUTPUT_STDERR;
+  enum FieldNumbers {
+    kOutputFieldNumber = 1,
+    kEnableColorsFieldNumber = 2,
+  };
+
+  ConsoleConfig();
+  ~ConsoleConfig() override;
+  ConsoleConfig(ConsoleConfig&&) noexcept;
+  ConsoleConfig& operator=(ConsoleConfig&&);
+  ConsoleConfig(const ConsoleConfig&);
+  ConsoleConfig& operator=(const ConsoleConfig&);
+  bool operator==(const ConsoleConfig&) const;
+  bool operator!=(const ConsoleConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_output() const { return _has_field_[1]; }
+  ConsoleConfig_Output output() const { return output_; }
+  void set_output(ConsoleConfig_Output value) { output_ = value; _has_field_.set(1); }
+
+  bool has_enable_colors() const { return _has_field_[2]; }
+  bool enable_colors() const { return enable_colors_; }
+  void set_enable_colors(bool value) { enable_colors_ = value; _has_field_.set(2); }
+
+ private:
+  ConsoleConfig_Output output_{};
+  bool enable_colors_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INTERCEPTORS_CONSOLE_CONFIG_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/config/interceptors/console_config.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+ConsoleConfig::ConsoleConfig() = default;
+ConsoleConfig::~ConsoleConfig() = default;
+ConsoleConfig::ConsoleConfig(const ConsoleConfig&) = default;
+ConsoleConfig& ConsoleConfig::operator=(const ConsoleConfig&) = default;
+ConsoleConfig::ConsoleConfig(ConsoleConfig&&) noexcept = default;
+ConsoleConfig& ConsoleConfig::operator=(ConsoleConfig&&) = default;
+
+bool ConsoleConfig::operator==(const ConsoleConfig& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && output_ == other.output_
+   && enable_colors_ == other.enable_colors_;
+}
+
+bool ConsoleConfig::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* output */:
+        field.get(&output_);
+        break;
+      case 2 /* enable_colors */:
+        field.get(&enable_colors_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ConsoleConfig::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ConsoleConfig::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ConsoleConfig::Serialize(::protozero::Message* msg) const {
+  // Field 1: output
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, output_);
+  }
+
+  // Field 2: enable_colors
+  if (_has_field_[2]) {
+    msg->AppendTinyVarInt(2, enable_colors_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/config/power/android_power_config.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/config/power/android_power_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_POWER_ANDROID_POWER_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_POWER_ANDROID_POWER_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class AndroidPowerConfig;
+enum AndroidPowerConfig_BatteryCounters : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum AndroidPowerConfig_BatteryCounters : int {
+  AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_UNSPECIFIED = 0,
+  AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CHARGE = 1,
+  AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CAPACITY_PERCENT = 2,
+  AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CURRENT = 3,
+  AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CURRENT_AVG = 4,
+};
+
+class PERFETTO_EXPORT AndroidPowerConfig : public ::protozero::CppMessageObj {
+ public:
+  using BatteryCounters = AndroidPowerConfig_BatteryCounters;
+  static constexpr auto BATTERY_COUNTER_UNSPECIFIED = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_UNSPECIFIED;
+  static constexpr auto BATTERY_COUNTER_CHARGE = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CHARGE;
+  static constexpr auto BATTERY_COUNTER_CAPACITY_PERCENT = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CAPACITY_PERCENT;
+  static constexpr auto BATTERY_COUNTER_CURRENT = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CURRENT;
+  static constexpr auto BATTERY_COUNTER_CURRENT_AVG = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CURRENT_AVG;
+  static constexpr auto BatteryCounters_MIN = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_UNSPECIFIED;
+  static constexpr auto BatteryCounters_MAX = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CURRENT_AVG;
+  enum FieldNumbers {
+    kBatteryPollMsFieldNumber = 1,
+    kBatteryCountersFieldNumber = 2,
+    kCollectPowerRailsFieldNumber = 3,
+    kCollectEnergyEstimationBreakdownFieldNumber = 4,
+  };
+
+  AndroidPowerConfig();
+  ~AndroidPowerConfig() override;
+  AndroidPowerConfig(AndroidPowerConfig&&) noexcept;
+  AndroidPowerConfig& operator=(AndroidPowerConfig&&);
+  AndroidPowerConfig(const AndroidPowerConfig&);
+  AndroidPowerConfig& operator=(const AndroidPowerConfig&);
+  bool operator==(const AndroidPowerConfig&) const;
+  bool operator!=(const AndroidPowerConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_battery_poll_ms() const { return _has_field_[1]; }
+  uint32_t battery_poll_ms() const { return battery_poll_ms_; }
+  void set_battery_poll_ms(uint32_t value) { battery_poll_ms_ = value; _has_field_.set(1); }
+
+  const std::vector<AndroidPowerConfig_BatteryCounters>& battery_counters() const { return battery_counters_; }
+  std::vector<AndroidPowerConfig_BatteryCounters>* mutable_battery_counters() { return &battery_counters_; }
+  int battery_counters_size() const { return static_cast<int>(battery_counters_.size()); }
+  void clear_battery_counters() { battery_counters_.clear(); }
+  void add_battery_counters(AndroidPowerConfig_BatteryCounters value) { battery_counters_.emplace_back(value); }
+  AndroidPowerConfig_BatteryCounters* add_battery_counters() { battery_counters_.emplace_back(); return &battery_counters_.back(); }
+
+  bool has_collect_power_rails() const { return _has_field_[3]; }
+  bool collect_power_rails() const { return collect_power_rails_; }
+  void set_collect_power_rails(bool value) { collect_power_rails_ = value; _has_field_.set(3); }
+
+  bool has_collect_energy_estimation_breakdown() const { return _has_field_[4]; }
+  bool collect_energy_estimation_breakdown() const { return collect_energy_estimation_breakdown_; }
+  void set_collect_energy_estimation_breakdown(bool value) { collect_energy_estimation_breakdown_ = value; _has_field_.set(4); }
+
+ private:
+  uint32_t battery_poll_ms_{};
+  std::vector<AndroidPowerConfig_BatteryCounters> battery_counters_;
+  bool collect_power_rails_{};
+  bool collect_energy_estimation_breakdown_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<5> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_POWER_ANDROID_POWER_CONFIG_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/config/power/android_power_config.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+AndroidPowerConfig::AndroidPowerConfig() = default;
+AndroidPowerConfig::~AndroidPowerConfig() = default;
+AndroidPowerConfig::AndroidPowerConfig(const AndroidPowerConfig&) = default;
+AndroidPowerConfig& AndroidPowerConfig::operator=(const AndroidPowerConfig&) = default;
+AndroidPowerConfig::AndroidPowerConfig(AndroidPowerConfig&&) noexcept = default;
+AndroidPowerConfig& AndroidPowerConfig::operator=(AndroidPowerConfig&&) = default;
+
+bool AndroidPowerConfig::operator==(const AndroidPowerConfig& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && battery_poll_ms_ == other.battery_poll_ms_
+   && battery_counters_ == other.battery_counters_
+   && collect_power_rails_ == other.collect_power_rails_
+   && collect_energy_estimation_breakdown_ == other.collect_energy_estimation_breakdown_;
+}
+
+bool AndroidPowerConfig::ParseFromArray(const void* raw, size_t size) {
+  battery_counters_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* battery_poll_ms */:
+        field.get(&battery_poll_ms_);
+        break;
+      case 2 /* battery_counters */:
+        battery_counters_.emplace_back();
+        field.get(&battery_counters_.back());
+        break;
+      case 3 /* collect_power_rails */:
+        field.get(&collect_power_rails_);
+        break;
+      case 4 /* collect_energy_estimation_breakdown */:
+        field.get(&collect_energy_estimation_breakdown_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string AndroidPowerConfig::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> AndroidPowerConfig::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void AndroidPowerConfig::Serialize(::protozero::Message* msg) const {
+  // Field 1: battery_poll_ms
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, battery_poll_ms_);
+  }
+
+  // Field 2: battery_counters
+  for (auto& it : battery_counters_) {
+    msg->AppendVarInt(2, it);
+  }
+
+  // Field 3: collect_power_rails
+  if (_has_field_[3]) {
+    msg->AppendTinyVarInt(3, collect_power_rails_);
+  }
+
+  // Field 4: collect_energy_estimation_breakdown
+  if (_has_field_[4]) {
+    msg->AppendTinyVarInt(4, collect_energy_estimation_breakdown_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/config/process_stats/process_stats_config.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/config/process_stats/process_stats_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROCESS_STATS_PROCESS_STATS_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROCESS_STATS_PROCESS_STATS_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ProcessStatsConfig;
+enum ProcessStatsConfig_Quirks : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum ProcessStatsConfig_Quirks : int {
+  ProcessStatsConfig_Quirks_QUIRKS_UNSPECIFIED = 0,
+  ProcessStatsConfig_Quirks_DISABLE_INITIAL_DUMP = 1,
+  ProcessStatsConfig_Quirks_DISABLE_ON_DEMAND = 2,
+};
+
+class PERFETTO_EXPORT ProcessStatsConfig : public ::protozero::CppMessageObj {
+ public:
+  using Quirks = ProcessStatsConfig_Quirks;
+  static constexpr auto QUIRKS_UNSPECIFIED = ProcessStatsConfig_Quirks_QUIRKS_UNSPECIFIED;
+  static constexpr auto DISABLE_INITIAL_DUMP = ProcessStatsConfig_Quirks_DISABLE_INITIAL_DUMP;
+  static constexpr auto DISABLE_ON_DEMAND = ProcessStatsConfig_Quirks_DISABLE_ON_DEMAND;
+  static constexpr auto Quirks_MIN = ProcessStatsConfig_Quirks_QUIRKS_UNSPECIFIED;
+  static constexpr auto Quirks_MAX = ProcessStatsConfig_Quirks_DISABLE_ON_DEMAND;
+  enum FieldNumbers {
+    kQuirksFieldNumber = 1,
+    kScanAllProcessesOnStartFieldNumber = 2,
+    kRecordThreadNamesFieldNumber = 3,
+    kProcStatsPollMsFieldNumber = 4,
+    kProcStatsCacheTtlMsFieldNumber = 6,
+    kRecordThreadTimeInStateFieldNumber = 7,
+    kThreadTimeInStateCacheSizeFieldNumber = 8,
+  };
+
+  ProcessStatsConfig();
+  ~ProcessStatsConfig() override;
+  ProcessStatsConfig(ProcessStatsConfig&&) noexcept;
+  ProcessStatsConfig& operator=(ProcessStatsConfig&&);
+  ProcessStatsConfig(const ProcessStatsConfig&);
+  ProcessStatsConfig& operator=(const ProcessStatsConfig&);
+  bool operator==(const ProcessStatsConfig&) const;
+  bool operator!=(const ProcessStatsConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<ProcessStatsConfig_Quirks>& quirks() const { return quirks_; }
+  std::vector<ProcessStatsConfig_Quirks>* mutable_quirks() { return &quirks_; }
+  int quirks_size() const { return static_cast<int>(quirks_.size()); }
+  void clear_quirks() { quirks_.clear(); }
+  void add_quirks(ProcessStatsConfig_Quirks value) { quirks_.emplace_back(value); }
+  ProcessStatsConfig_Quirks* add_quirks() { quirks_.emplace_back(); return &quirks_.back(); }
+
+  bool has_scan_all_processes_on_start() const { return _has_field_[2]; }
+  bool scan_all_processes_on_start() const { return scan_all_processes_on_start_; }
+  void set_scan_all_processes_on_start(bool value) { scan_all_processes_on_start_ = value; _has_field_.set(2); }
+
+  bool has_record_thread_names() const { return _has_field_[3]; }
+  bool record_thread_names() const { return record_thread_names_; }
+  void set_record_thread_names(bool value) { record_thread_names_ = value; _has_field_.set(3); }
+
+  bool has_proc_stats_poll_ms() const { return _has_field_[4]; }
+  uint32_t proc_stats_poll_ms() const { return proc_stats_poll_ms_; }
+  void set_proc_stats_poll_ms(uint32_t value) { proc_stats_poll_ms_ = value; _has_field_.set(4); }
+
+  bool has_proc_stats_cache_ttl_ms() const { return _has_field_[6]; }
+  uint32_t proc_stats_cache_ttl_ms() const { return proc_stats_cache_ttl_ms_; }
+  void set_proc_stats_cache_ttl_ms(uint32_t value) { proc_stats_cache_ttl_ms_ = value; _has_field_.set(6); }
+
+  bool has_record_thread_time_in_state() const { return _has_field_[7]; }
+  bool record_thread_time_in_state() const { return record_thread_time_in_state_; }
+  void set_record_thread_time_in_state(bool value) { record_thread_time_in_state_ = value; _has_field_.set(7); }
+
+  bool has_thread_time_in_state_cache_size() const { return _has_field_[8]; }
+  uint32_t thread_time_in_state_cache_size() const { return thread_time_in_state_cache_size_; }
+  void set_thread_time_in_state_cache_size(uint32_t value) { thread_time_in_state_cache_size_ = value; _has_field_.set(8); }
+
+ private:
+  std::vector<ProcessStatsConfig_Quirks> quirks_;
+  bool scan_all_processes_on_start_{};
+  bool record_thread_names_{};
+  uint32_t proc_stats_poll_ms_{};
+  uint32_t proc_stats_cache_ttl_ms_{};
+  bool record_thread_time_in_state_{};
+  uint32_t thread_time_in_state_cache_size_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<9> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROCESS_STATS_PROCESS_STATS_CONFIG_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/config/process_stats/process_stats_config.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+ProcessStatsConfig::ProcessStatsConfig() = default;
+ProcessStatsConfig::~ProcessStatsConfig() = default;
+ProcessStatsConfig::ProcessStatsConfig(const ProcessStatsConfig&) = default;
+ProcessStatsConfig& ProcessStatsConfig::operator=(const ProcessStatsConfig&) = default;
+ProcessStatsConfig::ProcessStatsConfig(ProcessStatsConfig&&) noexcept = default;
+ProcessStatsConfig& ProcessStatsConfig::operator=(ProcessStatsConfig&&) = default;
+
+bool ProcessStatsConfig::operator==(const ProcessStatsConfig& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && quirks_ == other.quirks_
+   && scan_all_processes_on_start_ == other.scan_all_processes_on_start_
+   && record_thread_names_ == other.record_thread_names_
+   && proc_stats_poll_ms_ == other.proc_stats_poll_ms_
+   && proc_stats_cache_ttl_ms_ == other.proc_stats_cache_ttl_ms_
+   && record_thread_time_in_state_ == other.record_thread_time_in_state_
+   && thread_time_in_state_cache_size_ == other.thread_time_in_state_cache_size_;
+}
+
+bool ProcessStatsConfig::ParseFromArray(const void* raw, size_t size) {
+  quirks_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* quirks */:
+        quirks_.emplace_back();
+        field.get(&quirks_.back());
+        break;
+      case 2 /* scan_all_processes_on_start */:
+        field.get(&scan_all_processes_on_start_);
+        break;
+      case 3 /* record_thread_names */:
+        field.get(&record_thread_names_);
+        break;
+      case 4 /* proc_stats_poll_ms */:
+        field.get(&proc_stats_poll_ms_);
+        break;
+      case 6 /* proc_stats_cache_ttl_ms */:
+        field.get(&proc_stats_cache_ttl_ms_);
+        break;
+      case 7 /* record_thread_time_in_state */:
+        field.get(&record_thread_time_in_state_);
+        break;
+      case 8 /* thread_time_in_state_cache_size */:
+        field.get(&thread_time_in_state_cache_size_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ProcessStatsConfig::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ProcessStatsConfig::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ProcessStatsConfig::Serialize(::protozero::Message* msg) const {
+  // Field 1: quirks
+  for (auto& it : quirks_) {
+    msg->AppendVarInt(1, it);
+  }
+
+  // Field 2: scan_all_processes_on_start
+  if (_has_field_[2]) {
+    msg->AppendTinyVarInt(2, scan_all_processes_on_start_);
+  }
+
+  // Field 3: record_thread_names
+  if (_has_field_[3]) {
+    msg->AppendTinyVarInt(3, record_thread_names_);
+  }
+
+  // Field 4: proc_stats_poll_ms
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, proc_stats_poll_ms_);
+  }
+
+  // Field 6: proc_stats_cache_ttl_ms
+  if (_has_field_[6]) {
+    msg->AppendVarInt(6, proc_stats_cache_ttl_ms_);
+  }
+
+  // Field 7: record_thread_time_in_state
+  if (_has_field_[7]) {
+    msg->AppendTinyVarInt(7, record_thread_time_in_state_);
+  }
+
+  // Field 8: thread_time_in_state_cache_size
+  if (_has_field_[8]) {
+    msg->AppendVarInt(8, thread_time_in_state_cache_size_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/config/profiling/heapprofd_config.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/config/profiling/heapprofd_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_HEAPPROFD_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_HEAPPROFD_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class HeapprofdConfig;
+class HeapprofdConfig_ContinuousDumpConfig;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT HeapprofdConfig : public ::protozero::CppMessageObj {
+ public:
+  using ContinuousDumpConfig = HeapprofdConfig_ContinuousDumpConfig;
+  enum FieldNumbers {
+    kSamplingIntervalBytesFieldNumber = 1,
+    kAdaptiveSamplingShmemThresholdFieldNumber = 24,
+    kAdaptiveSamplingMaxSamplingIntervalBytesFieldNumber = 25,
+    kProcessCmdlineFieldNumber = 2,
+    kPidFieldNumber = 4,
+    kTargetInstalledByFieldNumber = 26,
+    kHeapsFieldNumber = 20,
+    kExcludeHeapsFieldNumber = 27,
+    kStreamAllocationsFieldNumber = 23,
+    kHeapSamplingIntervalsFieldNumber = 22,
+    kAllHeapsFieldNumber = 21,
+    kAllFieldNumber = 5,
+    kMinAnonymousMemoryKbFieldNumber = 15,
+    kMaxHeapprofdMemoryKbFieldNumber = 16,
+    kMaxHeapprofdCpuSecsFieldNumber = 17,
+    kSkipSymbolPrefixFieldNumber = 7,
+    kContinuousDumpConfigFieldNumber = 6,
+    kShmemSizeBytesFieldNumber = 8,
+    kBlockClientFieldNumber = 9,
+    kBlockClientTimeoutUsFieldNumber = 14,
+    kNoStartupFieldNumber = 10,
+    kNoRunningFieldNumber = 11,
+    kDumpAtMaxFieldNumber = 13,
+    kDisableForkTeardownFieldNumber = 18,
+    kDisableVforkDetectionFieldNumber = 19,
+  };
+
+  HeapprofdConfig();
+  ~HeapprofdConfig() override;
+  HeapprofdConfig(HeapprofdConfig&&) noexcept;
+  HeapprofdConfig& operator=(HeapprofdConfig&&);
+  HeapprofdConfig(const HeapprofdConfig&);
+  HeapprofdConfig& operator=(const HeapprofdConfig&);
+  bool operator==(const HeapprofdConfig&) const;
+  bool operator!=(const HeapprofdConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_sampling_interval_bytes() const { return _has_field_[1]; }
+  uint64_t sampling_interval_bytes() const { return sampling_interval_bytes_; }
+  void set_sampling_interval_bytes(uint64_t value) { sampling_interval_bytes_ = value; _has_field_.set(1); }
+
+  bool has_adaptive_sampling_shmem_threshold() const { return _has_field_[24]; }
+  uint64_t adaptive_sampling_shmem_threshold() const { return adaptive_sampling_shmem_threshold_; }
+  void set_adaptive_sampling_shmem_threshold(uint64_t value) { adaptive_sampling_shmem_threshold_ = value; _has_field_.set(24); }
+
+  bool has_adaptive_sampling_max_sampling_interval_bytes() const { return _has_field_[25]; }
+  uint64_t adaptive_sampling_max_sampling_interval_bytes() const { return adaptive_sampling_max_sampling_interval_bytes_; }
+  void set_adaptive_sampling_max_sampling_interval_bytes(uint64_t value) { adaptive_sampling_max_sampling_interval_bytes_ = value; _has_field_.set(25); }
+
+  const std::vector<std::string>& process_cmdline() const { return process_cmdline_; }
+  std::vector<std::string>* mutable_process_cmdline() { return &process_cmdline_; }
+  int process_cmdline_size() const { return static_cast<int>(process_cmdline_.size()); }
+  void clear_process_cmdline() { process_cmdline_.clear(); }
+  void add_process_cmdline(std::string value) { process_cmdline_.emplace_back(value); }
+  std::string* add_process_cmdline() { process_cmdline_.emplace_back(); return &process_cmdline_.back(); }
+
+  const std::vector<uint64_t>& pid() const { return pid_; }
+  std::vector<uint64_t>* mutable_pid() { return &pid_; }
+  int pid_size() const { return static_cast<int>(pid_.size()); }
+  void clear_pid() { pid_.clear(); }
+  void add_pid(uint64_t value) { pid_.emplace_back(value); }
+  uint64_t* add_pid() { pid_.emplace_back(); return &pid_.back(); }
+
+  const std::vector<std::string>& target_installed_by() const { return target_installed_by_; }
+  std::vector<std::string>* mutable_target_installed_by() { return &target_installed_by_; }
+  int target_installed_by_size() const { return static_cast<int>(target_installed_by_.size()); }
+  void clear_target_installed_by() { target_installed_by_.clear(); }
+  void add_target_installed_by(std::string value) { target_installed_by_.emplace_back(value); }
+  std::string* add_target_installed_by() { target_installed_by_.emplace_back(); return &target_installed_by_.back(); }
+
+  const std::vector<std::string>& heaps() const { return heaps_; }
+  std::vector<std::string>* mutable_heaps() { return &heaps_; }
+  int heaps_size() const { return static_cast<int>(heaps_.size()); }
+  void clear_heaps() { heaps_.clear(); }
+  void add_heaps(std::string value) { heaps_.emplace_back(value); }
+  std::string* add_heaps() { heaps_.emplace_back(); return &heaps_.back(); }
+
+  const std::vector<std::string>& exclude_heaps() const { return exclude_heaps_; }
+  std::vector<std::string>* mutable_exclude_heaps() { return &exclude_heaps_; }
+  int exclude_heaps_size() const { return static_cast<int>(exclude_heaps_.size()); }
+  void clear_exclude_heaps() { exclude_heaps_.clear(); }
+  void add_exclude_heaps(std::string value) { exclude_heaps_.emplace_back(value); }
+  std::string* add_exclude_heaps() { exclude_heaps_.emplace_back(); return &exclude_heaps_.back(); }
+
+  bool has_stream_allocations() const { return _has_field_[23]; }
+  bool stream_allocations() const { return stream_allocations_; }
+  void set_stream_allocations(bool value) { stream_allocations_ = value; _has_field_.set(23); }
+
+  const std::vector<uint64_t>& heap_sampling_intervals() const { return heap_sampling_intervals_; }
+  std::vector<uint64_t>* mutable_heap_sampling_intervals() { return &heap_sampling_intervals_; }
+  int heap_sampling_intervals_size() const { return static_cast<int>(heap_sampling_intervals_.size()); }
+  void clear_heap_sampling_intervals() { heap_sampling_intervals_.clear(); }
+  void add_heap_sampling_intervals(uint64_t value) { heap_sampling_intervals_.emplace_back(value); }
+  uint64_t* add_heap_sampling_intervals() { heap_sampling_intervals_.emplace_back(); return &heap_sampling_intervals_.back(); }
+
+  bool has_all_heaps() const { return _has_field_[21]; }
+  bool all_heaps() const { return all_heaps_; }
+  void set_all_heaps(bool value) { all_heaps_ = value; _has_field_.set(21); }
+
+  bool has_all() const { return _has_field_[5]; }
+  bool all() const { return all_; }
+  void set_all(bool value) { all_ = value; _has_field_.set(5); }
+
+  bool has_min_anonymous_memory_kb() const { return _has_field_[15]; }
+  uint32_t min_anonymous_memory_kb() const { return min_anonymous_memory_kb_; }
+  void set_min_anonymous_memory_kb(uint32_t value) { min_anonymous_memory_kb_ = value; _has_field_.set(15); }
+
+  bool has_max_heapprofd_memory_kb() const { return _has_field_[16]; }
+  uint32_t max_heapprofd_memory_kb() const { return max_heapprofd_memory_kb_; }
+  void set_max_heapprofd_memory_kb(uint32_t value) { max_heapprofd_memory_kb_ = value; _has_field_.set(16); }
+
+  bool has_max_heapprofd_cpu_secs() const { return _has_field_[17]; }
+  uint64_t max_heapprofd_cpu_secs() const { return max_heapprofd_cpu_secs_; }
+  void set_max_heapprofd_cpu_secs(uint64_t value) { max_heapprofd_cpu_secs_ = value; _has_field_.set(17); }
+
+  const std::vector<std::string>& skip_symbol_prefix() const { return skip_symbol_prefix_; }
+  std::vector<std::string>* mutable_skip_symbol_prefix() { return &skip_symbol_prefix_; }
+  int skip_symbol_prefix_size() const { return static_cast<int>(skip_symbol_prefix_.size()); }
+  void clear_skip_symbol_prefix() { skip_symbol_prefix_.clear(); }
+  void add_skip_symbol_prefix(std::string value) { skip_symbol_prefix_.emplace_back(value); }
+  std::string* add_skip_symbol_prefix() { skip_symbol_prefix_.emplace_back(); return &skip_symbol_prefix_.back(); }
+
+  bool has_continuous_dump_config() const { return _has_field_[6]; }
+  const HeapprofdConfig_ContinuousDumpConfig& continuous_dump_config() const { return *continuous_dump_config_; }
+  HeapprofdConfig_ContinuousDumpConfig* mutable_continuous_dump_config() { _has_field_.set(6); return continuous_dump_config_.get(); }
+
+  bool has_shmem_size_bytes() const { return _has_field_[8]; }
+  uint64_t shmem_size_bytes() const { return shmem_size_bytes_; }
+  void set_shmem_size_bytes(uint64_t value) { shmem_size_bytes_ = value; _has_field_.set(8); }
+
+  bool has_block_client() const { return _has_field_[9]; }
+  bool block_client() const { return block_client_; }
+  void set_block_client(bool value) { block_client_ = value; _has_field_.set(9); }
+
+  bool has_block_client_timeout_us() const { return _has_field_[14]; }
+  uint32_t block_client_timeout_us() const { return block_client_timeout_us_; }
+  void set_block_client_timeout_us(uint32_t value) { block_client_timeout_us_ = value; _has_field_.set(14); }
+
+  bool has_no_startup() const { return _has_field_[10]; }
+  bool no_startup() const { return no_startup_; }
+  void set_no_startup(bool value) { no_startup_ = value; _has_field_.set(10); }
+
+  bool has_no_running() const { return _has_field_[11]; }
+  bool no_running() const { return no_running_; }
+  void set_no_running(bool value) { no_running_ = value; _has_field_.set(11); }
+
+  bool has_dump_at_max() const { return _has_field_[13]; }
+  bool dump_at_max() const { return dump_at_max_; }
+  void set_dump_at_max(bool value) { dump_at_max_ = value; _has_field_.set(13); }
+
+  bool has_disable_fork_teardown() const { return _has_field_[18]; }
+  bool disable_fork_teardown() const { return disable_fork_teardown_; }
+  void set_disable_fork_teardown(bool value) { disable_fork_teardown_ = value; _has_field_.set(18); }
+
+  bool has_disable_vfork_detection() const { return _has_field_[19]; }
+  bool disable_vfork_detection() const { return disable_vfork_detection_; }
+  void set_disable_vfork_detection(bool value) { disable_vfork_detection_ = value; _has_field_.set(19); }
+
+ private:
+  uint64_t sampling_interval_bytes_{};
+  uint64_t adaptive_sampling_shmem_threshold_{};
+  uint64_t adaptive_sampling_max_sampling_interval_bytes_{};
+  std::vector<std::string> process_cmdline_;
+  std::vector<uint64_t> pid_;
+  std::vector<std::string> target_installed_by_;
+  std::vector<std::string> heaps_;
+  std::vector<std::string> exclude_heaps_;
+  bool stream_allocations_{};
+  std::vector<uint64_t> heap_sampling_intervals_;
+  bool all_heaps_{};
+  bool all_{};
+  uint32_t min_anonymous_memory_kb_{};
+  uint32_t max_heapprofd_memory_kb_{};
+  uint64_t max_heapprofd_cpu_secs_{};
+  std::vector<std::string> skip_symbol_prefix_;
+  ::protozero::CopyablePtr<HeapprofdConfig_ContinuousDumpConfig> continuous_dump_config_;
+  uint64_t shmem_size_bytes_{};
+  bool block_client_{};
+  uint32_t block_client_timeout_us_{};
+  bool no_startup_{};
+  bool no_running_{};
+  bool dump_at_max_{};
+  bool disable_fork_teardown_{};
+  bool disable_vfork_detection_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<28> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT HeapprofdConfig_ContinuousDumpConfig : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDumpPhaseMsFieldNumber = 5,
+    kDumpIntervalMsFieldNumber = 6,
+  };
+
+  HeapprofdConfig_ContinuousDumpConfig();
+  ~HeapprofdConfig_ContinuousDumpConfig() override;
+  HeapprofdConfig_ContinuousDumpConfig(HeapprofdConfig_ContinuousDumpConfig&&) noexcept;
+  HeapprofdConfig_ContinuousDumpConfig& operator=(HeapprofdConfig_ContinuousDumpConfig&&);
+  HeapprofdConfig_ContinuousDumpConfig(const HeapprofdConfig_ContinuousDumpConfig&);
+  HeapprofdConfig_ContinuousDumpConfig& operator=(const HeapprofdConfig_ContinuousDumpConfig&);
+  bool operator==(const HeapprofdConfig_ContinuousDumpConfig&) const;
+  bool operator!=(const HeapprofdConfig_ContinuousDumpConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_dump_phase_ms() const { return _has_field_[5]; }
+  uint32_t dump_phase_ms() const { return dump_phase_ms_; }
+  void set_dump_phase_ms(uint32_t value) { dump_phase_ms_ = value; _has_field_.set(5); }
+
+  bool has_dump_interval_ms() const { return _has_field_[6]; }
+  uint32_t dump_interval_ms() const { return dump_interval_ms_; }
+  void set_dump_interval_ms(uint32_t value) { dump_interval_ms_ = value; _has_field_.set(6); }
+
+ private:
+  uint32_t dump_phase_ms_{};
+  uint32_t dump_interval_ms_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<7> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_HEAPPROFD_CONFIG_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/config/profiling/heapprofd_config.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+HeapprofdConfig::HeapprofdConfig() = default;
+HeapprofdConfig::~HeapprofdConfig() = default;
+HeapprofdConfig::HeapprofdConfig(const HeapprofdConfig&) = default;
+HeapprofdConfig& HeapprofdConfig::operator=(const HeapprofdConfig&) = default;
+HeapprofdConfig::HeapprofdConfig(HeapprofdConfig&&) noexcept = default;
+HeapprofdConfig& HeapprofdConfig::operator=(HeapprofdConfig&&) = default;
+
+bool HeapprofdConfig::operator==(const HeapprofdConfig& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && sampling_interval_bytes_ == other.sampling_interval_bytes_
+   && adaptive_sampling_shmem_threshold_ == other.adaptive_sampling_shmem_threshold_
+   && adaptive_sampling_max_sampling_interval_bytes_ == other.adaptive_sampling_max_sampling_interval_bytes_
+   && process_cmdline_ == other.process_cmdline_
+   && pid_ == other.pid_
+   && target_installed_by_ == other.target_installed_by_
+   && heaps_ == other.heaps_
+   && exclude_heaps_ == other.exclude_heaps_
+   && stream_allocations_ == other.stream_allocations_
+   && heap_sampling_intervals_ == other.heap_sampling_intervals_
+   && all_heaps_ == other.all_heaps_
+   && all_ == other.all_
+   && min_anonymous_memory_kb_ == other.min_anonymous_memory_kb_
+   && max_heapprofd_memory_kb_ == other.max_heapprofd_memory_kb_
+   && max_heapprofd_cpu_secs_ == other.max_heapprofd_cpu_secs_
+   && skip_symbol_prefix_ == other.skip_symbol_prefix_
+   && continuous_dump_config_ == other.continuous_dump_config_
+   && shmem_size_bytes_ == other.shmem_size_bytes_
+   && block_client_ == other.block_client_
+   && block_client_timeout_us_ == other.block_client_timeout_us_
+   && no_startup_ == other.no_startup_
+   && no_running_ == other.no_running_
+   && dump_at_max_ == other.dump_at_max_
+   && disable_fork_teardown_ == other.disable_fork_teardown_
+   && disable_vfork_detection_ == other.disable_vfork_detection_;
+}
+
+bool HeapprofdConfig::ParseFromArray(const void* raw, size_t size) {
+  process_cmdline_.clear();
+  pid_.clear();
+  target_installed_by_.clear();
+  heaps_.clear();
+  exclude_heaps_.clear();
+  heap_sampling_intervals_.clear();
+  skip_symbol_prefix_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* sampling_interval_bytes */:
+        field.get(&sampling_interval_bytes_);
+        break;
+      case 24 /* adaptive_sampling_shmem_threshold */:
+        field.get(&adaptive_sampling_shmem_threshold_);
+        break;
+      case 25 /* adaptive_sampling_max_sampling_interval_bytes */:
+        field.get(&adaptive_sampling_max_sampling_interval_bytes_);
+        break;
+      case 2 /* process_cmdline */:
+        process_cmdline_.emplace_back();
+        field.get(&process_cmdline_.back());
+        break;
+      case 4 /* pid */:
+        pid_.emplace_back();
+        field.get(&pid_.back());
+        break;
+      case 26 /* target_installed_by */:
+        target_installed_by_.emplace_back();
+        field.get(&target_installed_by_.back());
+        break;
+      case 20 /* heaps */:
+        heaps_.emplace_back();
+        field.get(&heaps_.back());
+        break;
+      case 27 /* exclude_heaps */:
+        exclude_heaps_.emplace_back();
+        field.get(&exclude_heaps_.back());
+        break;
+      case 23 /* stream_allocations */:
+        field.get(&stream_allocations_);
+        break;
+      case 22 /* heap_sampling_intervals */:
+        heap_sampling_intervals_.emplace_back();
+        field.get(&heap_sampling_intervals_.back());
+        break;
+      case 21 /* all_heaps */:
+        field.get(&all_heaps_);
+        break;
+      case 5 /* all */:
+        field.get(&all_);
+        break;
+      case 15 /* min_anonymous_memory_kb */:
+        field.get(&min_anonymous_memory_kb_);
+        break;
+      case 16 /* max_heapprofd_memory_kb */:
+        field.get(&max_heapprofd_memory_kb_);
+        break;
+      case 17 /* max_heapprofd_cpu_secs */:
+        field.get(&max_heapprofd_cpu_secs_);
+        break;
+      case 7 /* skip_symbol_prefix */:
+        skip_symbol_prefix_.emplace_back();
+        field.get(&skip_symbol_prefix_.back());
+        break;
+      case 6 /* continuous_dump_config */:
+        (*continuous_dump_config_).ParseFromArray(field.data(), field.size());
+        break;
+      case 8 /* shmem_size_bytes */:
+        field.get(&shmem_size_bytes_);
+        break;
+      case 9 /* block_client */:
+        field.get(&block_client_);
+        break;
+      case 14 /* block_client_timeout_us */:
+        field.get(&block_client_timeout_us_);
+        break;
+      case 10 /* no_startup */:
+        field.get(&no_startup_);
+        break;
+      case 11 /* no_running */:
+        field.get(&no_running_);
+        break;
+      case 13 /* dump_at_max */:
+        field.get(&dump_at_max_);
+        break;
+      case 18 /* disable_fork_teardown */:
+        field.get(&disable_fork_teardown_);
+        break;
+      case 19 /* disable_vfork_detection */:
+        field.get(&disable_vfork_detection_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string HeapprofdConfig::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> HeapprofdConfig::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void HeapprofdConfig::Serialize(::protozero::Message* msg) const {
+  // Field 1: sampling_interval_bytes
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, sampling_interval_bytes_);
+  }
+
+  // Field 24: adaptive_sampling_shmem_threshold
+  if (_has_field_[24]) {
+    msg->AppendVarInt(24, adaptive_sampling_shmem_threshold_);
+  }
+
+  // Field 25: adaptive_sampling_max_sampling_interval_bytes
+  if (_has_field_[25]) {
+    msg->AppendVarInt(25, adaptive_sampling_max_sampling_interval_bytes_);
+  }
+
+  // Field 2: process_cmdline
+  for (auto& it : process_cmdline_) {
+    msg->AppendString(2, it);
+  }
+
+  // Field 4: pid
+  for (auto& it : pid_) {
+    msg->AppendVarInt(4, it);
+  }
+
+  // Field 26: target_installed_by
+  for (auto& it : target_installed_by_) {
+    msg->AppendString(26, it);
+  }
+
+  // Field 20: heaps
+  for (auto& it : heaps_) {
+    msg->AppendString(20, it);
+  }
+
+  // Field 27: exclude_heaps
+  for (auto& it : exclude_heaps_) {
+    msg->AppendString(27, it);
+  }
+
+  // Field 23: stream_allocations
+  if (_has_field_[23]) {
+    msg->AppendTinyVarInt(23, stream_allocations_);
+  }
+
+  // Field 22: heap_sampling_intervals
+  for (auto& it : heap_sampling_intervals_) {
+    msg->AppendVarInt(22, it);
+  }
+
+  // Field 21: all_heaps
+  if (_has_field_[21]) {
+    msg->AppendTinyVarInt(21, all_heaps_);
+  }
+
+  // Field 5: all
+  if (_has_field_[5]) {
+    msg->AppendTinyVarInt(5, all_);
+  }
+
+  // Field 15: min_anonymous_memory_kb
+  if (_has_field_[15]) {
+    msg->AppendVarInt(15, min_anonymous_memory_kb_);
+  }
+
+  // Field 16: max_heapprofd_memory_kb
+  if (_has_field_[16]) {
+    msg->AppendVarInt(16, max_heapprofd_memory_kb_);
+  }
+
+  // Field 17: max_heapprofd_cpu_secs
+  if (_has_field_[17]) {
+    msg->AppendVarInt(17, max_heapprofd_cpu_secs_);
+  }
+
+  // Field 7: skip_symbol_prefix
+  for (auto& it : skip_symbol_prefix_) {
+    msg->AppendString(7, it);
+  }
+
+  // Field 6: continuous_dump_config
+  if (_has_field_[6]) {
+    (*continuous_dump_config_).Serialize(msg->BeginNestedMessage<::protozero::Message>(6));
+  }
+
+  // Field 8: shmem_size_bytes
+  if (_has_field_[8]) {
+    msg->AppendVarInt(8, shmem_size_bytes_);
+  }
+
+  // Field 9: block_client
+  if (_has_field_[9]) {
+    msg->AppendTinyVarInt(9, block_client_);
+  }
+
+  // Field 14: block_client_timeout_us
+  if (_has_field_[14]) {
+    msg->AppendVarInt(14, block_client_timeout_us_);
+  }
+
+  // Field 10: no_startup
+  if (_has_field_[10]) {
+    msg->AppendTinyVarInt(10, no_startup_);
+  }
+
+  // Field 11: no_running
+  if (_has_field_[11]) {
+    msg->AppendTinyVarInt(11, no_running_);
+  }
+
+  // Field 13: dump_at_max
+  if (_has_field_[13]) {
+    msg->AppendTinyVarInt(13, dump_at_max_);
+  }
+
+  // Field 18: disable_fork_teardown
+  if (_has_field_[18]) {
+    msg->AppendTinyVarInt(18, disable_fork_teardown_);
+  }
+
+  // Field 19: disable_vfork_detection
+  if (_has_field_[19]) {
+    msg->AppendTinyVarInt(19, disable_vfork_detection_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+HeapprofdConfig_ContinuousDumpConfig::HeapprofdConfig_ContinuousDumpConfig() = default;
+HeapprofdConfig_ContinuousDumpConfig::~HeapprofdConfig_ContinuousDumpConfig() = default;
+HeapprofdConfig_ContinuousDumpConfig::HeapprofdConfig_ContinuousDumpConfig(const HeapprofdConfig_ContinuousDumpConfig&) = default;
+HeapprofdConfig_ContinuousDumpConfig& HeapprofdConfig_ContinuousDumpConfig::operator=(const HeapprofdConfig_ContinuousDumpConfig&) = default;
+HeapprofdConfig_ContinuousDumpConfig::HeapprofdConfig_ContinuousDumpConfig(HeapprofdConfig_ContinuousDumpConfig&&) noexcept = default;
+HeapprofdConfig_ContinuousDumpConfig& HeapprofdConfig_ContinuousDumpConfig::operator=(HeapprofdConfig_ContinuousDumpConfig&&) = default;
+
+bool HeapprofdConfig_ContinuousDumpConfig::operator==(const HeapprofdConfig_ContinuousDumpConfig& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && dump_phase_ms_ == other.dump_phase_ms_
+   && dump_interval_ms_ == other.dump_interval_ms_;
+}
+
+bool HeapprofdConfig_ContinuousDumpConfig::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 5 /* dump_phase_ms */:
+        field.get(&dump_phase_ms_);
+        break;
+      case 6 /* dump_interval_ms */:
+        field.get(&dump_interval_ms_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string HeapprofdConfig_ContinuousDumpConfig::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> HeapprofdConfig_ContinuousDumpConfig::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void HeapprofdConfig_ContinuousDumpConfig::Serialize(::protozero::Message* msg) const {
+  // Field 5: dump_phase_ms
+  if (_has_field_[5]) {
+    msg->AppendVarInt(5, dump_phase_ms_);
+  }
+
+  // Field 6: dump_interval_ms
+  if (_has_field_[6]) {
+    msg->AppendVarInt(6, dump_interval_ms_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/config/profiling/java_hprof_config.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/config/profiling/java_hprof_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_JAVA_HPROF_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_JAVA_HPROF_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class JavaHprofConfig;
+class JavaHprofConfig_ContinuousDumpConfig;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT JavaHprofConfig : public ::protozero::CppMessageObj {
+ public:
+  using ContinuousDumpConfig = JavaHprofConfig_ContinuousDumpConfig;
+  enum FieldNumbers {
+    kProcessCmdlineFieldNumber = 1,
+    kPidFieldNumber = 2,
+    kTargetInstalledByFieldNumber = 7,
+    kContinuousDumpConfigFieldNumber = 3,
+    kMinAnonymousMemoryKbFieldNumber = 4,
+    kDumpSmapsFieldNumber = 5,
+    kIgnoredTypesFieldNumber = 6,
+  };
+
+  JavaHprofConfig();
+  ~JavaHprofConfig() override;
+  JavaHprofConfig(JavaHprofConfig&&) noexcept;
+  JavaHprofConfig& operator=(JavaHprofConfig&&);
+  JavaHprofConfig(const JavaHprofConfig&);
+  JavaHprofConfig& operator=(const JavaHprofConfig&);
+  bool operator==(const JavaHprofConfig&) const;
+  bool operator!=(const JavaHprofConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<std::string>& process_cmdline() const { return process_cmdline_; }
+  std::vector<std::string>* mutable_process_cmdline() { return &process_cmdline_; }
+  int process_cmdline_size() const { return static_cast<int>(process_cmdline_.size()); }
+  void clear_process_cmdline() { process_cmdline_.clear(); }
+  void add_process_cmdline(std::string value) { process_cmdline_.emplace_back(value); }
+  std::string* add_process_cmdline() { process_cmdline_.emplace_back(); return &process_cmdline_.back(); }
+
+  const std::vector<uint64_t>& pid() const { return pid_; }
+  std::vector<uint64_t>* mutable_pid() { return &pid_; }
+  int pid_size() const { return static_cast<int>(pid_.size()); }
+  void clear_pid() { pid_.clear(); }
+  void add_pid(uint64_t value) { pid_.emplace_back(value); }
+  uint64_t* add_pid() { pid_.emplace_back(); return &pid_.back(); }
+
+  const std::vector<std::string>& target_installed_by() const { return target_installed_by_; }
+  std::vector<std::string>* mutable_target_installed_by() { return &target_installed_by_; }
+  int target_installed_by_size() const { return static_cast<int>(target_installed_by_.size()); }
+  void clear_target_installed_by() { target_installed_by_.clear(); }
+  void add_target_installed_by(std::string value) { target_installed_by_.emplace_back(value); }
+  std::string* add_target_installed_by() { target_installed_by_.emplace_back(); return &target_installed_by_.back(); }
+
+  bool has_continuous_dump_config() const { return _has_field_[3]; }
+  const JavaHprofConfig_ContinuousDumpConfig& continuous_dump_config() const { return *continuous_dump_config_; }
+  JavaHprofConfig_ContinuousDumpConfig* mutable_continuous_dump_config() { _has_field_.set(3); return continuous_dump_config_.get(); }
+
+  bool has_min_anonymous_memory_kb() const { return _has_field_[4]; }
+  uint32_t min_anonymous_memory_kb() const { return min_anonymous_memory_kb_; }
+  void set_min_anonymous_memory_kb(uint32_t value) { min_anonymous_memory_kb_ = value; _has_field_.set(4); }
+
+  bool has_dump_smaps() const { return _has_field_[5]; }
+  bool dump_smaps() const { return dump_smaps_; }
+  void set_dump_smaps(bool value) { dump_smaps_ = value; _has_field_.set(5); }
+
+  const std::vector<std::string>& ignored_types() const { return ignored_types_; }
+  std::vector<std::string>* mutable_ignored_types() { return &ignored_types_; }
+  int ignored_types_size() const { return static_cast<int>(ignored_types_.size()); }
+  void clear_ignored_types() { ignored_types_.clear(); }
+  void add_ignored_types(std::string value) { ignored_types_.emplace_back(value); }
+  std::string* add_ignored_types() { ignored_types_.emplace_back(); return &ignored_types_.back(); }
+
+ private:
+  std::vector<std::string> process_cmdline_;
+  std::vector<uint64_t> pid_;
+  std::vector<std::string> target_installed_by_;
+  ::protozero::CopyablePtr<JavaHprofConfig_ContinuousDumpConfig> continuous_dump_config_;
+  uint32_t min_anonymous_memory_kb_{};
+  bool dump_smaps_{};
+  std::vector<std::string> ignored_types_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<8> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT JavaHprofConfig_ContinuousDumpConfig : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDumpPhaseMsFieldNumber = 1,
+    kDumpIntervalMsFieldNumber = 2,
+  };
+
+  JavaHprofConfig_ContinuousDumpConfig();
+  ~JavaHprofConfig_ContinuousDumpConfig() override;
+  JavaHprofConfig_ContinuousDumpConfig(JavaHprofConfig_ContinuousDumpConfig&&) noexcept;
+  JavaHprofConfig_ContinuousDumpConfig& operator=(JavaHprofConfig_ContinuousDumpConfig&&);
+  JavaHprofConfig_ContinuousDumpConfig(const JavaHprofConfig_ContinuousDumpConfig&);
+  JavaHprofConfig_ContinuousDumpConfig& operator=(const JavaHprofConfig_ContinuousDumpConfig&);
+  bool operator==(const JavaHprofConfig_ContinuousDumpConfig&) const;
+  bool operator!=(const JavaHprofConfig_ContinuousDumpConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_dump_phase_ms() const { return _has_field_[1]; }
+  uint32_t dump_phase_ms() const { return dump_phase_ms_; }
+  void set_dump_phase_ms(uint32_t value) { dump_phase_ms_ = value; _has_field_.set(1); }
+
+  bool has_dump_interval_ms() const { return _has_field_[2]; }
+  uint32_t dump_interval_ms() const { return dump_interval_ms_; }
+  void set_dump_interval_ms(uint32_t value) { dump_interval_ms_ = value; _has_field_.set(2); }
+
+ private:
+  uint32_t dump_phase_ms_{};
+  uint32_t dump_interval_ms_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_JAVA_HPROF_CONFIG_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/config/profiling/java_hprof_config.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+JavaHprofConfig::JavaHprofConfig() = default;
+JavaHprofConfig::~JavaHprofConfig() = default;
+JavaHprofConfig::JavaHprofConfig(const JavaHprofConfig&) = default;
+JavaHprofConfig& JavaHprofConfig::operator=(const JavaHprofConfig&) = default;
+JavaHprofConfig::JavaHprofConfig(JavaHprofConfig&&) noexcept = default;
+JavaHprofConfig& JavaHprofConfig::operator=(JavaHprofConfig&&) = default;
+
+bool JavaHprofConfig::operator==(const JavaHprofConfig& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && process_cmdline_ == other.process_cmdline_
+   && pid_ == other.pid_
+   && target_installed_by_ == other.target_installed_by_
+   && continuous_dump_config_ == other.continuous_dump_config_
+   && min_anonymous_memory_kb_ == other.min_anonymous_memory_kb_
+   && dump_smaps_ == other.dump_smaps_
+   && ignored_types_ == other.ignored_types_;
+}
+
+bool JavaHprofConfig::ParseFromArray(const void* raw, size_t size) {
+  process_cmdline_.clear();
+  pid_.clear();
+  target_installed_by_.clear();
+  ignored_types_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* process_cmdline */:
+        process_cmdline_.emplace_back();
+        field.get(&process_cmdline_.back());
+        break;
+      case 2 /* pid */:
+        pid_.emplace_back();
+        field.get(&pid_.back());
+        break;
+      case 7 /* target_installed_by */:
+        target_installed_by_.emplace_back();
+        field.get(&target_installed_by_.back());
+        break;
+      case 3 /* continuous_dump_config */:
+        (*continuous_dump_config_).ParseFromArray(field.data(), field.size());
+        break;
+      case 4 /* min_anonymous_memory_kb */:
+        field.get(&min_anonymous_memory_kb_);
+        break;
+      case 5 /* dump_smaps */:
+        field.get(&dump_smaps_);
+        break;
+      case 6 /* ignored_types */:
+        ignored_types_.emplace_back();
+        field.get(&ignored_types_.back());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string JavaHprofConfig::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> JavaHprofConfig::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void JavaHprofConfig::Serialize(::protozero::Message* msg) const {
+  // Field 1: process_cmdline
+  for (auto& it : process_cmdline_) {
+    msg->AppendString(1, it);
+  }
+
+  // Field 2: pid
+  for (auto& it : pid_) {
+    msg->AppendVarInt(2, it);
+  }
+
+  // Field 7: target_installed_by
+  for (auto& it : target_installed_by_) {
+    msg->AppendString(7, it);
+  }
+
+  // Field 3: continuous_dump_config
+  if (_has_field_[3]) {
+    (*continuous_dump_config_).Serialize(msg->BeginNestedMessage<::protozero::Message>(3));
+  }
+
+  // Field 4: min_anonymous_memory_kb
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, min_anonymous_memory_kb_);
+  }
+
+  // Field 5: dump_smaps
+  if (_has_field_[5]) {
+    msg->AppendTinyVarInt(5, dump_smaps_);
+  }
+
+  // Field 6: ignored_types
+  for (auto& it : ignored_types_) {
+    msg->AppendString(6, it);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+JavaHprofConfig_ContinuousDumpConfig::JavaHprofConfig_ContinuousDumpConfig() = default;
+JavaHprofConfig_ContinuousDumpConfig::~JavaHprofConfig_ContinuousDumpConfig() = default;
+JavaHprofConfig_ContinuousDumpConfig::JavaHprofConfig_ContinuousDumpConfig(const JavaHprofConfig_ContinuousDumpConfig&) = default;
+JavaHprofConfig_ContinuousDumpConfig& JavaHprofConfig_ContinuousDumpConfig::operator=(const JavaHprofConfig_ContinuousDumpConfig&) = default;
+JavaHprofConfig_ContinuousDumpConfig::JavaHprofConfig_ContinuousDumpConfig(JavaHprofConfig_ContinuousDumpConfig&&) noexcept = default;
+JavaHprofConfig_ContinuousDumpConfig& JavaHprofConfig_ContinuousDumpConfig::operator=(JavaHprofConfig_ContinuousDumpConfig&&) = default;
+
+bool JavaHprofConfig_ContinuousDumpConfig::operator==(const JavaHprofConfig_ContinuousDumpConfig& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && dump_phase_ms_ == other.dump_phase_ms_
+   && dump_interval_ms_ == other.dump_interval_ms_;
+}
+
+bool JavaHprofConfig_ContinuousDumpConfig::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* dump_phase_ms */:
+        field.get(&dump_phase_ms_);
+        break;
+      case 2 /* dump_interval_ms */:
+        field.get(&dump_interval_ms_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string JavaHprofConfig_ContinuousDumpConfig::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> JavaHprofConfig_ContinuousDumpConfig::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void JavaHprofConfig_ContinuousDumpConfig::Serialize(::protozero::Message* msg) const {
+  // Field 1: dump_phase_ms
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, dump_phase_ms_);
+  }
+
+  // Field 2: dump_interval_ms
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, dump_interval_ms_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/config/profiling/perf_event_config.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/config/profiling/perf_event_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_PERF_EVENT_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_PERF_EVENT_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class PerfEventConfig;
+class PerfEventConfig_CallstackSampling;
+class PerfEventConfig_Scope;
+class PerfEvents_Timebase;
+class PerfEvents_Tracepoint;
+enum PerfEvents_Counter : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT PerfEventConfig : public ::protozero::CppMessageObj {
+ public:
+  using CallstackSampling = PerfEventConfig_CallstackSampling;
+  using Scope = PerfEventConfig_Scope;
+  enum FieldNumbers {
+    kTimebaseFieldNumber = 15,
+    kCallstackSamplingFieldNumber = 16,
+    kRingBufferReadPeriodMsFieldNumber = 8,
+    kRingBufferPagesFieldNumber = 3,
+    kMaxEnqueuedFootprintKbFieldNumber = 17,
+    kMaxDaemonMemoryKbFieldNumber = 13,
+    kRemoteDescriptorTimeoutMsFieldNumber = 9,
+    kUnwindStateClearPeriodMsFieldNumber = 10,
+    kAllCpusFieldNumber = 1,
+    kSamplingFrequencyFieldNumber = 2,
+    kKernelFramesFieldNumber = 12,
+    kTargetPidFieldNumber = 4,
+    kTargetCmdlineFieldNumber = 5,
+    kTargetInstalledByFieldNumber = 18,
+    kExcludePidFieldNumber = 6,
+    kExcludeCmdlineFieldNumber = 7,
+    kAdditionalCmdlineCountFieldNumber = 11,
+  };
+
+  PerfEventConfig();
+  ~PerfEventConfig() override;
+  PerfEventConfig(PerfEventConfig&&) noexcept;
+  PerfEventConfig& operator=(PerfEventConfig&&);
+  PerfEventConfig(const PerfEventConfig&);
+  PerfEventConfig& operator=(const PerfEventConfig&);
+  bool operator==(const PerfEventConfig&) const;
+  bool operator!=(const PerfEventConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_timebase() const { return _has_field_[15]; }
+  const PerfEvents_Timebase& timebase() const { return *timebase_; }
+  PerfEvents_Timebase* mutable_timebase() { _has_field_.set(15); return timebase_.get(); }
+
+  bool has_callstack_sampling() const { return _has_field_[16]; }
+  const PerfEventConfig_CallstackSampling& callstack_sampling() const { return *callstack_sampling_; }
+  PerfEventConfig_CallstackSampling* mutable_callstack_sampling() { _has_field_.set(16); return callstack_sampling_.get(); }
+
+  bool has_ring_buffer_read_period_ms() const { return _has_field_[8]; }
+  uint32_t ring_buffer_read_period_ms() const { return ring_buffer_read_period_ms_; }
+  void set_ring_buffer_read_period_ms(uint32_t value) { ring_buffer_read_period_ms_ = value; _has_field_.set(8); }
+
+  bool has_ring_buffer_pages() const { return _has_field_[3]; }
+  uint32_t ring_buffer_pages() const { return ring_buffer_pages_; }
+  void set_ring_buffer_pages(uint32_t value) { ring_buffer_pages_ = value; _has_field_.set(3); }
+
+  bool has_max_enqueued_footprint_kb() const { return _has_field_[17]; }
+  uint64_t max_enqueued_footprint_kb() const { return max_enqueued_footprint_kb_; }
+  void set_max_enqueued_footprint_kb(uint64_t value) { max_enqueued_footprint_kb_ = value; _has_field_.set(17); }
+
+  bool has_max_daemon_memory_kb() const { return _has_field_[13]; }
+  uint32_t max_daemon_memory_kb() const { return max_daemon_memory_kb_; }
+  void set_max_daemon_memory_kb(uint32_t value) { max_daemon_memory_kb_ = value; _has_field_.set(13); }
+
+  bool has_remote_descriptor_timeout_ms() const { return _has_field_[9]; }
+  uint32_t remote_descriptor_timeout_ms() const { return remote_descriptor_timeout_ms_; }
+  void set_remote_descriptor_timeout_ms(uint32_t value) { remote_descriptor_timeout_ms_ = value; _has_field_.set(9); }
+
+  bool has_unwind_state_clear_period_ms() const { return _has_field_[10]; }
+  uint32_t unwind_state_clear_period_ms() const { return unwind_state_clear_period_ms_; }
+  void set_unwind_state_clear_period_ms(uint32_t value) { unwind_state_clear_period_ms_ = value; _has_field_.set(10); }
+
+  bool has_all_cpus() const { return _has_field_[1]; }
+  bool all_cpus() const { return all_cpus_; }
+  void set_all_cpus(bool value) { all_cpus_ = value; _has_field_.set(1); }
+
+  bool has_sampling_frequency() const { return _has_field_[2]; }
+  uint32_t sampling_frequency() const { return sampling_frequency_; }
+  void set_sampling_frequency(uint32_t value) { sampling_frequency_ = value; _has_field_.set(2); }
+
+  bool has_kernel_frames() const { return _has_field_[12]; }
+  bool kernel_frames() const { return kernel_frames_; }
+  void set_kernel_frames(bool value) { kernel_frames_ = value; _has_field_.set(12); }
+
+  const std::vector<int32_t>& target_pid() const { return target_pid_; }
+  std::vector<int32_t>* mutable_target_pid() { return &target_pid_; }
+  int target_pid_size() const { return static_cast<int>(target_pid_.size()); }
+  void clear_target_pid() { target_pid_.clear(); }
+  void add_target_pid(int32_t value) { target_pid_.emplace_back(value); }
+  int32_t* add_target_pid() { target_pid_.emplace_back(); return &target_pid_.back(); }
+
+  const std::vector<std::string>& target_cmdline() const { return target_cmdline_; }
+  std::vector<std::string>* mutable_target_cmdline() { return &target_cmdline_; }
+  int target_cmdline_size() const { return static_cast<int>(target_cmdline_.size()); }
+  void clear_target_cmdline() { target_cmdline_.clear(); }
+  void add_target_cmdline(std::string value) { target_cmdline_.emplace_back(value); }
+  std::string* add_target_cmdline() { target_cmdline_.emplace_back(); return &target_cmdline_.back(); }
+
+  const std::vector<std::string>& target_installed_by() const { return target_installed_by_; }
+  std::vector<std::string>* mutable_target_installed_by() { return &target_installed_by_; }
+  int target_installed_by_size() const { return static_cast<int>(target_installed_by_.size()); }
+  void clear_target_installed_by() { target_installed_by_.clear(); }
+  void add_target_installed_by(std::string value) { target_installed_by_.emplace_back(value); }
+  std::string* add_target_installed_by() { target_installed_by_.emplace_back(); return &target_installed_by_.back(); }
+
+  const std::vector<int32_t>& exclude_pid() const { return exclude_pid_; }
+  std::vector<int32_t>* mutable_exclude_pid() { return &exclude_pid_; }
+  int exclude_pid_size() const { return static_cast<int>(exclude_pid_.size()); }
+  void clear_exclude_pid() { exclude_pid_.clear(); }
+  void add_exclude_pid(int32_t value) { exclude_pid_.emplace_back(value); }
+  int32_t* add_exclude_pid() { exclude_pid_.emplace_back(); return &exclude_pid_.back(); }
+
+  const std::vector<std::string>& exclude_cmdline() const { return exclude_cmdline_; }
+  std::vector<std::string>* mutable_exclude_cmdline() { return &exclude_cmdline_; }
+  int exclude_cmdline_size() const { return static_cast<int>(exclude_cmdline_.size()); }
+  void clear_exclude_cmdline() { exclude_cmdline_.clear(); }
+  void add_exclude_cmdline(std::string value) { exclude_cmdline_.emplace_back(value); }
+  std::string* add_exclude_cmdline() { exclude_cmdline_.emplace_back(); return &exclude_cmdline_.back(); }
+
+  bool has_additional_cmdline_count() const { return _has_field_[11]; }
+  uint32_t additional_cmdline_count() const { return additional_cmdline_count_; }
+  void set_additional_cmdline_count(uint32_t value) { additional_cmdline_count_ = value; _has_field_.set(11); }
+
+ private:
+  ::protozero::CopyablePtr<PerfEvents_Timebase> timebase_;
+  ::protozero::CopyablePtr<PerfEventConfig_CallstackSampling> callstack_sampling_;
+  uint32_t ring_buffer_read_period_ms_{};
+  uint32_t ring_buffer_pages_{};
+  uint64_t max_enqueued_footprint_kb_{};
+  uint32_t max_daemon_memory_kb_{};
+  uint32_t remote_descriptor_timeout_ms_{};
+  uint32_t unwind_state_clear_period_ms_{};
+  bool all_cpus_{};
+  uint32_t sampling_frequency_{};
+  bool kernel_frames_{};
+  std::vector<int32_t> target_pid_;
+  std::vector<std::string> target_cmdline_;
+  std::vector<std::string> target_installed_by_;
+  std::vector<int32_t> exclude_pid_;
+  std::vector<std::string> exclude_cmdline_;
+  uint32_t additional_cmdline_count_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<19> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT PerfEventConfig_CallstackSampling : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kScopeFieldNumber = 1,
+    kKernelFramesFieldNumber = 2,
+  };
+
+  PerfEventConfig_CallstackSampling();
+  ~PerfEventConfig_CallstackSampling() override;
+  PerfEventConfig_CallstackSampling(PerfEventConfig_CallstackSampling&&) noexcept;
+  PerfEventConfig_CallstackSampling& operator=(PerfEventConfig_CallstackSampling&&);
+  PerfEventConfig_CallstackSampling(const PerfEventConfig_CallstackSampling&);
+  PerfEventConfig_CallstackSampling& operator=(const PerfEventConfig_CallstackSampling&);
+  bool operator==(const PerfEventConfig_CallstackSampling&) const;
+  bool operator!=(const PerfEventConfig_CallstackSampling& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_scope() const { return _has_field_[1]; }
+  const PerfEventConfig_Scope& scope() const { return *scope_; }
+  PerfEventConfig_Scope* mutable_scope() { _has_field_.set(1); return scope_.get(); }
+
+  bool has_kernel_frames() const { return _has_field_[2]; }
+  bool kernel_frames() const { return kernel_frames_; }
+  void set_kernel_frames(bool value) { kernel_frames_ = value; _has_field_.set(2); }
+
+ private:
+  ::protozero::CopyablePtr<PerfEventConfig_Scope> scope_;
+  bool kernel_frames_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT PerfEventConfig_Scope : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kTargetPidFieldNumber = 1,
+    kTargetCmdlineFieldNumber = 2,
+    kExcludePidFieldNumber = 3,
+    kExcludeCmdlineFieldNumber = 4,
+    kAdditionalCmdlineCountFieldNumber = 5,
+  };
+
+  PerfEventConfig_Scope();
+  ~PerfEventConfig_Scope() override;
+  PerfEventConfig_Scope(PerfEventConfig_Scope&&) noexcept;
+  PerfEventConfig_Scope& operator=(PerfEventConfig_Scope&&);
+  PerfEventConfig_Scope(const PerfEventConfig_Scope&);
+  PerfEventConfig_Scope& operator=(const PerfEventConfig_Scope&);
+  bool operator==(const PerfEventConfig_Scope&) const;
+  bool operator!=(const PerfEventConfig_Scope& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<int32_t>& target_pid() const { return target_pid_; }
+  std::vector<int32_t>* mutable_target_pid() { return &target_pid_; }
+  int target_pid_size() const { return static_cast<int>(target_pid_.size()); }
+  void clear_target_pid() { target_pid_.clear(); }
+  void add_target_pid(int32_t value) { target_pid_.emplace_back(value); }
+  int32_t* add_target_pid() { target_pid_.emplace_back(); return &target_pid_.back(); }
+
+  const std::vector<std::string>& target_cmdline() const { return target_cmdline_; }
+  std::vector<std::string>* mutable_target_cmdline() { return &target_cmdline_; }
+  int target_cmdline_size() const { return static_cast<int>(target_cmdline_.size()); }
+  void clear_target_cmdline() { target_cmdline_.clear(); }
+  void add_target_cmdline(std::string value) { target_cmdline_.emplace_back(value); }
+  std::string* add_target_cmdline() { target_cmdline_.emplace_back(); return &target_cmdline_.back(); }
+
+  const std::vector<int32_t>& exclude_pid() const { return exclude_pid_; }
+  std::vector<int32_t>* mutable_exclude_pid() { return &exclude_pid_; }
+  int exclude_pid_size() const { return static_cast<int>(exclude_pid_.size()); }
+  void clear_exclude_pid() { exclude_pid_.clear(); }
+  void add_exclude_pid(int32_t value) { exclude_pid_.emplace_back(value); }
+  int32_t* add_exclude_pid() { exclude_pid_.emplace_back(); return &exclude_pid_.back(); }
+
+  const std::vector<std::string>& exclude_cmdline() const { return exclude_cmdline_; }
+  std::vector<std::string>* mutable_exclude_cmdline() { return &exclude_cmdline_; }
+  int exclude_cmdline_size() const { return static_cast<int>(exclude_cmdline_.size()); }
+  void clear_exclude_cmdline() { exclude_cmdline_.clear(); }
+  void add_exclude_cmdline(std::string value) { exclude_cmdline_.emplace_back(value); }
+  std::string* add_exclude_cmdline() { exclude_cmdline_.emplace_back(); return &exclude_cmdline_.back(); }
+
+  bool has_additional_cmdline_count() const { return _has_field_[5]; }
+  uint32_t additional_cmdline_count() const { return additional_cmdline_count_; }
+  void set_additional_cmdline_count(uint32_t value) { additional_cmdline_count_ = value; _has_field_.set(5); }
+
+ private:
+  std::vector<int32_t> target_pid_;
+  std::vector<std::string> target_cmdline_;
+  std::vector<int32_t> exclude_pid_;
+  std::vector<std::string> exclude_cmdline_;
+  uint32_t additional_cmdline_count_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<6> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_PERF_EVENT_CONFIG_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/config/profiling/perf_event_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/perf_events.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+PerfEventConfig::PerfEventConfig() = default;
+PerfEventConfig::~PerfEventConfig() = default;
+PerfEventConfig::PerfEventConfig(const PerfEventConfig&) = default;
+PerfEventConfig& PerfEventConfig::operator=(const PerfEventConfig&) = default;
+PerfEventConfig::PerfEventConfig(PerfEventConfig&&) noexcept = default;
+PerfEventConfig& PerfEventConfig::operator=(PerfEventConfig&&) = default;
+
+bool PerfEventConfig::operator==(const PerfEventConfig& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && timebase_ == other.timebase_
+   && callstack_sampling_ == other.callstack_sampling_
+   && ring_buffer_read_period_ms_ == other.ring_buffer_read_period_ms_
+   && ring_buffer_pages_ == other.ring_buffer_pages_
+   && max_enqueued_footprint_kb_ == other.max_enqueued_footprint_kb_
+   && max_daemon_memory_kb_ == other.max_daemon_memory_kb_
+   && remote_descriptor_timeout_ms_ == other.remote_descriptor_timeout_ms_
+   && unwind_state_clear_period_ms_ == other.unwind_state_clear_period_ms_
+   && all_cpus_ == other.all_cpus_
+   && sampling_frequency_ == other.sampling_frequency_
+   && kernel_frames_ == other.kernel_frames_
+   && target_pid_ == other.target_pid_
+   && target_cmdline_ == other.target_cmdline_
+   && target_installed_by_ == other.target_installed_by_
+   && exclude_pid_ == other.exclude_pid_
+   && exclude_cmdline_ == other.exclude_cmdline_
+   && additional_cmdline_count_ == other.additional_cmdline_count_;
+}
+
+bool PerfEventConfig::ParseFromArray(const void* raw, size_t size) {
+  target_pid_.clear();
+  target_cmdline_.clear();
+  target_installed_by_.clear();
+  exclude_pid_.clear();
+  exclude_cmdline_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 15 /* timebase */:
+        (*timebase_).ParseFromArray(field.data(), field.size());
+        break;
+      case 16 /* callstack_sampling */:
+        (*callstack_sampling_).ParseFromArray(field.data(), field.size());
+        break;
+      case 8 /* ring_buffer_read_period_ms */:
+        field.get(&ring_buffer_read_period_ms_);
+        break;
+      case 3 /* ring_buffer_pages */:
+        field.get(&ring_buffer_pages_);
+        break;
+      case 17 /* max_enqueued_footprint_kb */:
+        field.get(&max_enqueued_footprint_kb_);
+        break;
+      case 13 /* max_daemon_memory_kb */:
+        field.get(&max_daemon_memory_kb_);
+        break;
+      case 9 /* remote_descriptor_timeout_ms */:
+        field.get(&remote_descriptor_timeout_ms_);
+        break;
+      case 10 /* unwind_state_clear_period_ms */:
+        field.get(&unwind_state_clear_period_ms_);
+        break;
+      case 1 /* all_cpus */:
+        field.get(&all_cpus_);
+        break;
+      case 2 /* sampling_frequency */:
+        field.get(&sampling_frequency_);
+        break;
+      case 12 /* kernel_frames */:
+        field.get(&kernel_frames_);
+        break;
+      case 4 /* target_pid */:
+        target_pid_.emplace_back();
+        field.get(&target_pid_.back());
+        break;
+      case 5 /* target_cmdline */:
+        target_cmdline_.emplace_back();
+        field.get(&target_cmdline_.back());
+        break;
+      case 18 /* target_installed_by */:
+        target_installed_by_.emplace_back();
+        field.get(&target_installed_by_.back());
+        break;
+      case 6 /* exclude_pid */:
+        exclude_pid_.emplace_back();
+        field.get(&exclude_pid_.back());
+        break;
+      case 7 /* exclude_cmdline */:
+        exclude_cmdline_.emplace_back();
+        field.get(&exclude_cmdline_.back());
+        break;
+      case 11 /* additional_cmdline_count */:
+        field.get(&additional_cmdline_count_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string PerfEventConfig::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> PerfEventConfig::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void PerfEventConfig::Serialize(::protozero::Message* msg) const {
+  // Field 15: timebase
+  if (_has_field_[15]) {
+    (*timebase_).Serialize(msg->BeginNestedMessage<::protozero::Message>(15));
+  }
+
+  // Field 16: callstack_sampling
+  if (_has_field_[16]) {
+    (*callstack_sampling_).Serialize(msg->BeginNestedMessage<::protozero::Message>(16));
+  }
+
+  // Field 8: ring_buffer_read_period_ms
+  if (_has_field_[8]) {
+    msg->AppendVarInt(8, ring_buffer_read_period_ms_);
+  }
+
+  // Field 3: ring_buffer_pages
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, ring_buffer_pages_);
+  }
+
+  // Field 17: max_enqueued_footprint_kb
+  if (_has_field_[17]) {
+    msg->AppendVarInt(17, max_enqueued_footprint_kb_);
+  }
+
+  // Field 13: max_daemon_memory_kb
+  if (_has_field_[13]) {
+    msg->AppendVarInt(13, max_daemon_memory_kb_);
+  }
+
+  // Field 9: remote_descriptor_timeout_ms
+  if (_has_field_[9]) {
+    msg->AppendVarInt(9, remote_descriptor_timeout_ms_);
+  }
+
+  // Field 10: unwind_state_clear_period_ms
+  if (_has_field_[10]) {
+    msg->AppendVarInt(10, unwind_state_clear_period_ms_);
+  }
+
+  // Field 1: all_cpus
+  if (_has_field_[1]) {
+    msg->AppendTinyVarInt(1, all_cpus_);
+  }
+
+  // Field 2: sampling_frequency
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, sampling_frequency_);
+  }
+
+  // Field 12: kernel_frames
+  if (_has_field_[12]) {
+    msg->AppendTinyVarInt(12, kernel_frames_);
+  }
+
+  // Field 4: target_pid
+  for (auto& it : target_pid_) {
+    msg->AppendVarInt(4, it);
+  }
+
+  // Field 5: target_cmdline
+  for (auto& it : target_cmdline_) {
+    msg->AppendString(5, it);
+  }
+
+  // Field 18: target_installed_by
+  for (auto& it : target_installed_by_) {
+    msg->AppendString(18, it);
+  }
+
+  // Field 6: exclude_pid
+  for (auto& it : exclude_pid_) {
+    msg->AppendVarInt(6, it);
+  }
+
+  // Field 7: exclude_cmdline
+  for (auto& it : exclude_cmdline_) {
+    msg->AppendString(7, it);
+  }
+
+  // Field 11: additional_cmdline_count
+  if (_has_field_[11]) {
+    msg->AppendVarInt(11, additional_cmdline_count_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+PerfEventConfig_CallstackSampling::PerfEventConfig_CallstackSampling() = default;
+PerfEventConfig_CallstackSampling::~PerfEventConfig_CallstackSampling() = default;
+PerfEventConfig_CallstackSampling::PerfEventConfig_CallstackSampling(const PerfEventConfig_CallstackSampling&) = default;
+PerfEventConfig_CallstackSampling& PerfEventConfig_CallstackSampling::operator=(const PerfEventConfig_CallstackSampling&) = default;
+PerfEventConfig_CallstackSampling::PerfEventConfig_CallstackSampling(PerfEventConfig_CallstackSampling&&) noexcept = default;
+PerfEventConfig_CallstackSampling& PerfEventConfig_CallstackSampling::operator=(PerfEventConfig_CallstackSampling&&) = default;
+
+bool PerfEventConfig_CallstackSampling::operator==(const PerfEventConfig_CallstackSampling& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && scope_ == other.scope_
+   && kernel_frames_ == other.kernel_frames_;
+}
+
+bool PerfEventConfig_CallstackSampling::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* scope */:
+        (*scope_).ParseFromArray(field.data(), field.size());
+        break;
+      case 2 /* kernel_frames */:
+        field.get(&kernel_frames_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string PerfEventConfig_CallstackSampling::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> PerfEventConfig_CallstackSampling::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void PerfEventConfig_CallstackSampling::Serialize(::protozero::Message* msg) const {
+  // Field 1: scope
+  if (_has_field_[1]) {
+    (*scope_).Serialize(msg->BeginNestedMessage<::protozero::Message>(1));
+  }
+
+  // Field 2: kernel_frames
+  if (_has_field_[2]) {
+    msg->AppendTinyVarInt(2, kernel_frames_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+PerfEventConfig_Scope::PerfEventConfig_Scope() = default;
+PerfEventConfig_Scope::~PerfEventConfig_Scope() = default;
+PerfEventConfig_Scope::PerfEventConfig_Scope(const PerfEventConfig_Scope&) = default;
+PerfEventConfig_Scope& PerfEventConfig_Scope::operator=(const PerfEventConfig_Scope&) = default;
+PerfEventConfig_Scope::PerfEventConfig_Scope(PerfEventConfig_Scope&&) noexcept = default;
+PerfEventConfig_Scope& PerfEventConfig_Scope::operator=(PerfEventConfig_Scope&&) = default;
+
+bool PerfEventConfig_Scope::operator==(const PerfEventConfig_Scope& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && target_pid_ == other.target_pid_
+   && target_cmdline_ == other.target_cmdline_
+   && exclude_pid_ == other.exclude_pid_
+   && exclude_cmdline_ == other.exclude_cmdline_
+   && additional_cmdline_count_ == other.additional_cmdline_count_;
+}
+
+bool PerfEventConfig_Scope::ParseFromArray(const void* raw, size_t size) {
+  target_pid_.clear();
+  target_cmdline_.clear();
+  exclude_pid_.clear();
+  exclude_cmdline_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* target_pid */:
+        target_pid_.emplace_back();
+        field.get(&target_pid_.back());
+        break;
+      case 2 /* target_cmdline */:
+        target_cmdline_.emplace_back();
+        field.get(&target_cmdline_.back());
+        break;
+      case 3 /* exclude_pid */:
+        exclude_pid_.emplace_back();
+        field.get(&exclude_pid_.back());
+        break;
+      case 4 /* exclude_cmdline */:
+        exclude_cmdline_.emplace_back();
+        field.get(&exclude_cmdline_.back());
+        break;
+      case 5 /* additional_cmdline_count */:
+        field.get(&additional_cmdline_count_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string PerfEventConfig_Scope::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> PerfEventConfig_Scope::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void PerfEventConfig_Scope::Serialize(::protozero::Message* msg) const {
+  // Field 1: target_pid
+  for (auto& it : target_pid_) {
+    msg->AppendVarInt(1, it);
+  }
+
+  // Field 2: target_cmdline
+  for (auto& it : target_cmdline_) {
+    msg->AppendString(2, it);
+  }
+
+  // Field 3: exclude_pid
+  for (auto& it : exclude_pid_) {
+    msg->AppendVarInt(3, it);
+  }
+
+  // Field 4: exclude_cmdline
+  for (auto& it : exclude_cmdline_) {
+    msg->AppendString(4, it);
+  }
+
+  // Field 5: additional_cmdline_count
+  if (_has_field_[5]) {
+    msg->AppendVarInt(5, additional_cmdline_count_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/config/sys_stats/sys_stats_config.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/config/sys_stats/sys_stats_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_SYS_STATS_SYS_STATS_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_SYS_STATS_SYS_STATS_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class SysStatsConfig;
+enum SysStatsConfig_StatCounters : int;
+enum MeminfoCounters : int;
+enum VmstatCounters : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum SysStatsConfig_StatCounters : int {
+  SysStatsConfig_StatCounters_STAT_UNSPECIFIED = 0,
+  SysStatsConfig_StatCounters_STAT_CPU_TIMES = 1,
+  SysStatsConfig_StatCounters_STAT_IRQ_COUNTS = 2,
+  SysStatsConfig_StatCounters_STAT_SOFTIRQ_COUNTS = 3,
+  SysStatsConfig_StatCounters_STAT_FORK_COUNT = 4,
+};
+
+class PERFETTO_EXPORT SysStatsConfig : public ::protozero::CppMessageObj {
+ public:
+  using StatCounters = SysStatsConfig_StatCounters;
+  static constexpr auto STAT_UNSPECIFIED = SysStatsConfig_StatCounters_STAT_UNSPECIFIED;
+  static constexpr auto STAT_CPU_TIMES = SysStatsConfig_StatCounters_STAT_CPU_TIMES;
+  static constexpr auto STAT_IRQ_COUNTS = SysStatsConfig_StatCounters_STAT_IRQ_COUNTS;
+  static constexpr auto STAT_SOFTIRQ_COUNTS = SysStatsConfig_StatCounters_STAT_SOFTIRQ_COUNTS;
+  static constexpr auto STAT_FORK_COUNT = SysStatsConfig_StatCounters_STAT_FORK_COUNT;
+  static constexpr auto StatCounters_MIN = SysStatsConfig_StatCounters_STAT_UNSPECIFIED;
+  static constexpr auto StatCounters_MAX = SysStatsConfig_StatCounters_STAT_FORK_COUNT;
+  enum FieldNumbers {
+    kMeminfoPeriodMsFieldNumber = 1,
+    kMeminfoCountersFieldNumber = 2,
+    kVmstatPeriodMsFieldNumber = 3,
+    kVmstatCountersFieldNumber = 4,
+    kStatPeriodMsFieldNumber = 5,
+    kStatCountersFieldNumber = 6,
+    kDevfreqPeriodMsFieldNumber = 7,
+  };
+
+  SysStatsConfig();
+  ~SysStatsConfig() override;
+  SysStatsConfig(SysStatsConfig&&) noexcept;
+  SysStatsConfig& operator=(SysStatsConfig&&);
+  SysStatsConfig(const SysStatsConfig&);
+  SysStatsConfig& operator=(const SysStatsConfig&);
+  bool operator==(const SysStatsConfig&) const;
+  bool operator!=(const SysStatsConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_meminfo_period_ms() const { return _has_field_[1]; }
+  uint32_t meminfo_period_ms() const { return meminfo_period_ms_; }
+  void set_meminfo_period_ms(uint32_t value) { meminfo_period_ms_ = value; _has_field_.set(1); }
+
+  const std::vector<MeminfoCounters>& meminfo_counters() const { return meminfo_counters_; }
+  std::vector<MeminfoCounters>* mutable_meminfo_counters() { return &meminfo_counters_; }
+  int meminfo_counters_size() const { return static_cast<int>(meminfo_counters_.size()); }
+  void clear_meminfo_counters() { meminfo_counters_.clear(); }
+  void add_meminfo_counters(MeminfoCounters value) { meminfo_counters_.emplace_back(value); }
+  MeminfoCounters* add_meminfo_counters() { meminfo_counters_.emplace_back(); return &meminfo_counters_.back(); }
+
+  bool has_vmstat_period_ms() const { return _has_field_[3]; }
+  uint32_t vmstat_period_ms() const { return vmstat_period_ms_; }
+  void set_vmstat_period_ms(uint32_t value) { vmstat_period_ms_ = value; _has_field_.set(3); }
+
+  const std::vector<VmstatCounters>& vmstat_counters() const { return vmstat_counters_; }
+  std::vector<VmstatCounters>* mutable_vmstat_counters() { return &vmstat_counters_; }
+  int vmstat_counters_size() const { return static_cast<int>(vmstat_counters_.size()); }
+  void clear_vmstat_counters() { vmstat_counters_.clear(); }
+  void add_vmstat_counters(VmstatCounters value) { vmstat_counters_.emplace_back(value); }
+  VmstatCounters* add_vmstat_counters() { vmstat_counters_.emplace_back(); return &vmstat_counters_.back(); }
+
+  bool has_stat_period_ms() const { return _has_field_[5]; }
+  uint32_t stat_period_ms() const { return stat_period_ms_; }
+  void set_stat_period_ms(uint32_t value) { stat_period_ms_ = value; _has_field_.set(5); }
+
+  const std::vector<SysStatsConfig_StatCounters>& stat_counters() const { return stat_counters_; }
+  std::vector<SysStatsConfig_StatCounters>* mutable_stat_counters() { return &stat_counters_; }
+  int stat_counters_size() const { return static_cast<int>(stat_counters_.size()); }
+  void clear_stat_counters() { stat_counters_.clear(); }
+  void add_stat_counters(SysStatsConfig_StatCounters value) { stat_counters_.emplace_back(value); }
+  SysStatsConfig_StatCounters* add_stat_counters() { stat_counters_.emplace_back(); return &stat_counters_.back(); }
+
+  bool has_devfreq_period_ms() const { return _has_field_[7]; }
+  uint32_t devfreq_period_ms() const { return devfreq_period_ms_; }
+  void set_devfreq_period_ms(uint32_t value) { devfreq_period_ms_ = value; _has_field_.set(7); }
+
+ private:
+  uint32_t meminfo_period_ms_{};
+  std::vector<MeminfoCounters> meminfo_counters_;
+  uint32_t vmstat_period_ms_{};
+  std::vector<VmstatCounters> vmstat_counters_;
+  uint32_t stat_period_ms_{};
+  std::vector<SysStatsConfig_StatCounters> stat_counters_;
+  uint32_t devfreq_period_ms_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<8> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_SYS_STATS_SYS_STATS_CONFIG_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/config/sys_stats/sys_stats_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/sys_stats_counters.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+SysStatsConfig::SysStatsConfig() = default;
+SysStatsConfig::~SysStatsConfig() = default;
+SysStatsConfig::SysStatsConfig(const SysStatsConfig&) = default;
+SysStatsConfig& SysStatsConfig::operator=(const SysStatsConfig&) = default;
+SysStatsConfig::SysStatsConfig(SysStatsConfig&&) noexcept = default;
+SysStatsConfig& SysStatsConfig::operator=(SysStatsConfig&&) = default;
+
+bool SysStatsConfig::operator==(const SysStatsConfig& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && meminfo_period_ms_ == other.meminfo_period_ms_
+   && meminfo_counters_ == other.meminfo_counters_
+   && vmstat_period_ms_ == other.vmstat_period_ms_
+   && vmstat_counters_ == other.vmstat_counters_
+   && stat_period_ms_ == other.stat_period_ms_
+   && stat_counters_ == other.stat_counters_
+   && devfreq_period_ms_ == other.devfreq_period_ms_;
+}
+
+bool SysStatsConfig::ParseFromArray(const void* raw, size_t size) {
+  meminfo_counters_.clear();
+  vmstat_counters_.clear();
+  stat_counters_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* meminfo_period_ms */:
+        field.get(&meminfo_period_ms_);
+        break;
+      case 2 /* meminfo_counters */:
+        meminfo_counters_.emplace_back();
+        field.get(&meminfo_counters_.back());
+        break;
+      case 3 /* vmstat_period_ms */:
+        field.get(&vmstat_period_ms_);
+        break;
+      case 4 /* vmstat_counters */:
+        vmstat_counters_.emplace_back();
+        field.get(&vmstat_counters_.back());
+        break;
+      case 5 /* stat_period_ms */:
+        field.get(&stat_period_ms_);
+        break;
+      case 6 /* stat_counters */:
+        stat_counters_.emplace_back();
+        field.get(&stat_counters_.back());
+        break;
+      case 7 /* devfreq_period_ms */:
+        field.get(&devfreq_period_ms_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string SysStatsConfig::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> SysStatsConfig::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void SysStatsConfig::Serialize(::protozero::Message* msg) const {
+  // Field 1: meminfo_period_ms
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, meminfo_period_ms_);
+  }
+
+  // Field 2: meminfo_counters
+  for (auto& it : meminfo_counters_) {
+    msg->AppendVarInt(2, it);
+  }
+
+  // Field 3: vmstat_period_ms
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, vmstat_period_ms_);
+  }
+
+  // Field 4: vmstat_counters
+  for (auto& it : vmstat_counters_) {
+    msg->AppendVarInt(4, it);
+  }
+
+  // Field 5: stat_period_ms
+  if (_has_field_[5]) {
+    msg->AppendVarInt(5, stat_period_ms_);
+  }
+
+  // Field 6: stat_counters
+  for (auto& it : stat_counters_) {
+    msg->AppendVarInt(6, it);
+  }
+
+  // Field 7: devfreq_period_ms
+  if (_has_field_[7]) {
+    msg->AppendVarInt(7, devfreq_period_ms_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/config/track_event/track_event_config.gen.cc
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/config/track_event/track_event_config.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+TrackEventConfig::TrackEventConfig() = default;
+TrackEventConfig::~TrackEventConfig() = default;
+TrackEventConfig::TrackEventConfig(const TrackEventConfig&) = default;
+TrackEventConfig& TrackEventConfig::operator=(const TrackEventConfig&) = default;
+TrackEventConfig::TrackEventConfig(TrackEventConfig&&) noexcept = default;
+TrackEventConfig& TrackEventConfig::operator=(TrackEventConfig&&) = default;
+
+bool TrackEventConfig::operator==(const TrackEventConfig& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && disabled_categories_ == other.disabled_categories_
+   && enabled_categories_ == other.enabled_categories_
+   && disabled_tags_ == other.disabled_tags_
+   && enabled_tags_ == other.enabled_tags_;
+}
+
+bool TrackEventConfig::ParseFromArray(const void* raw, size_t size) {
+  disabled_categories_.clear();
+  enabled_categories_.clear();
+  disabled_tags_.clear();
+  enabled_tags_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* disabled_categories */:
+        disabled_categories_.emplace_back();
+        field.get(&disabled_categories_.back());
+        break;
+      case 2 /* enabled_categories */:
+        enabled_categories_.emplace_back();
+        field.get(&enabled_categories_.back());
+        break;
+      case 3 /* disabled_tags */:
+        disabled_tags_.emplace_back();
+        field.get(&disabled_tags_.back());
+        break;
+      case 4 /* enabled_tags */:
+        enabled_tags_.emplace_back();
+        field.get(&enabled_tags_.back());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string TrackEventConfig::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> TrackEventConfig::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void TrackEventConfig::Serialize(::protozero::Message* msg) const {
+  // Field 1: disabled_categories
+  for (auto& it : disabled_categories_) {
+    msg->AppendString(1, it);
+  }
+
+  // Field 2: enabled_categories
+  for (auto& it : enabled_categories_) {
+    msg->AppendString(2, it);
+  }
+
+  // Field 3: disabled_tags
+  for (auto& it : disabled_tags_) {
+    msg->AppendString(3, it);
+  }
+
+  // Field 4: enabled_tags
+  for (auto& it : enabled_tags_) {
+    msg->AppendString(4, it);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/config/chrome/chrome_config.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/config/chrome/chrome_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_CHROME_CHROME_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_CHROME_CHROME_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeConfig;
+enum ChromeConfig_ClientPriority : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum ChromeConfig_ClientPriority : int {
+  ChromeConfig_ClientPriority_UNKNOWN = 0,
+  ChromeConfig_ClientPriority_BACKGROUND = 1,
+  ChromeConfig_ClientPriority_USER_INITIATED = 2,
+};
+
+class PERFETTO_EXPORT ChromeConfig : public ::protozero::CppMessageObj {
+ public:
+  using ClientPriority = ChromeConfig_ClientPriority;
+  static constexpr auto UNKNOWN = ChromeConfig_ClientPriority_UNKNOWN;
+  static constexpr auto BACKGROUND = ChromeConfig_ClientPriority_BACKGROUND;
+  static constexpr auto USER_INITIATED = ChromeConfig_ClientPriority_USER_INITIATED;
+  static constexpr auto ClientPriority_MIN = ChromeConfig_ClientPriority_UNKNOWN;
+  static constexpr auto ClientPriority_MAX = ChromeConfig_ClientPriority_USER_INITIATED;
+  enum FieldNumbers {
+    kTraceConfigFieldNumber = 1,
+    kPrivacyFilteringEnabledFieldNumber = 2,
+    kConvertToLegacyJsonFieldNumber = 3,
+    kClientPriorityFieldNumber = 4,
+    kJsonAgentLabelFilterFieldNumber = 5,
+  };
+
+  ChromeConfig();
+  ~ChromeConfig() override;
+  ChromeConfig(ChromeConfig&&) noexcept;
+  ChromeConfig& operator=(ChromeConfig&&);
+  ChromeConfig(const ChromeConfig&);
+  ChromeConfig& operator=(const ChromeConfig&);
+  bool operator==(const ChromeConfig&) const;
+  bool operator!=(const ChromeConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_trace_config() const { return _has_field_[1]; }
+  const std::string& trace_config() const { return trace_config_; }
+  void set_trace_config(const std::string& value) { trace_config_ = value; _has_field_.set(1); }
+
+  bool has_privacy_filtering_enabled() const { return _has_field_[2]; }
+  bool privacy_filtering_enabled() const { return privacy_filtering_enabled_; }
+  void set_privacy_filtering_enabled(bool value) { privacy_filtering_enabled_ = value; _has_field_.set(2); }
+
+  bool has_convert_to_legacy_json() const { return _has_field_[3]; }
+  bool convert_to_legacy_json() const { return convert_to_legacy_json_; }
+  void set_convert_to_legacy_json(bool value) { convert_to_legacy_json_ = value; _has_field_.set(3); }
+
+  bool has_client_priority() const { return _has_field_[4]; }
+  ChromeConfig_ClientPriority client_priority() const { return client_priority_; }
+  void set_client_priority(ChromeConfig_ClientPriority value) { client_priority_ = value; _has_field_.set(4); }
+
+  bool has_json_agent_label_filter() const { return _has_field_[5]; }
+  const std::string& json_agent_label_filter() const { return json_agent_label_filter_; }
+  void set_json_agent_label_filter(const std::string& value) { json_agent_label_filter_ = value; _has_field_.set(5); }
+
+ private:
+  std::string trace_config_{};
+  bool privacy_filtering_enabled_{};
+  bool convert_to_legacy_json_{};
+  ChromeConfig_ClientPriority client_priority_{};
+  std::string json_agent_label_filter_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<6> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_CHROME_CHROME_CONFIG_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/config/chrome/chrome_config.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+ChromeConfig::ChromeConfig() = default;
+ChromeConfig::~ChromeConfig() = default;
+ChromeConfig::ChromeConfig(const ChromeConfig&) = default;
+ChromeConfig& ChromeConfig::operator=(const ChromeConfig&) = default;
+ChromeConfig::ChromeConfig(ChromeConfig&&) noexcept = default;
+ChromeConfig& ChromeConfig::operator=(ChromeConfig&&) = default;
+
+bool ChromeConfig::operator==(const ChromeConfig& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && trace_config_ == other.trace_config_
+   && privacy_filtering_enabled_ == other.privacy_filtering_enabled_
+   && convert_to_legacy_json_ == other.convert_to_legacy_json_
+   && client_priority_ == other.client_priority_
+   && json_agent_label_filter_ == other.json_agent_label_filter_;
+}
+
+bool ChromeConfig::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* trace_config */:
+        field.get(&trace_config_);
+        break;
+      case 2 /* privacy_filtering_enabled */:
+        field.get(&privacy_filtering_enabled_);
+        break;
+      case 3 /* convert_to_legacy_json */:
+        field.get(&convert_to_legacy_json_);
+        break;
+      case 4 /* client_priority */:
+        field.get(&client_priority_);
+        break;
+      case 5 /* json_agent_label_filter */:
+        field.get(&json_agent_label_filter_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ChromeConfig::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ChromeConfig::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ChromeConfig::Serialize(::protozero::Message* msg) const {
+  // Field 1: trace_config
+  if (_has_field_[1]) {
+    msg->AppendString(1, trace_config_);
+  }
+
+  // Field 2: privacy_filtering_enabled
+  if (_has_field_[2]) {
+    msg->AppendTinyVarInt(2, privacy_filtering_enabled_);
+  }
+
+  // Field 3: convert_to_legacy_json
+  if (_has_field_[3]) {
+    msg->AppendTinyVarInt(3, convert_to_legacy_json_);
+  }
+
+  // Field 4: client_priority
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, client_priority_);
+  }
+
+  // Field 5: json_agent_label_filter
+  if (_has_field_[5]) {
+    msg->AppendString(5, json_agent_label_filter_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/config/data_source_config.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/config/test_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TEST_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TEST_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class TestConfig;
+class TestConfig_DummyFields;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT TestConfig : public ::protozero::CppMessageObj {
+ public:
+  using DummyFields = TestConfig_DummyFields;
+  enum FieldNumbers {
+    kMessageCountFieldNumber = 1,
+    kMaxMessagesPerSecondFieldNumber = 2,
+    kSeedFieldNumber = 3,
+    kMessageSizeFieldNumber = 4,
+    kSendBatchOnRegisterFieldNumber = 5,
+    kDummyFieldsFieldNumber = 6,
+  };
+
+  TestConfig();
+  ~TestConfig() override;
+  TestConfig(TestConfig&&) noexcept;
+  TestConfig& operator=(TestConfig&&);
+  TestConfig(const TestConfig&);
+  TestConfig& operator=(const TestConfig&);
+  bool operator==(const TestConfig&) const;
+  bool operator!=(const TestConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_message_count() const { return _has_field_[1]; }
+  uint32_t message_count() const { return message_count_; }
+  void set_message_count(uint32_t value) { message_count_ = value; _has_field_.set(1); }
+
+  bool has_max_messages_per_second() const { return _has_field_[2]; }
+  uint32_t max_messages_per_second() const { return max_messages_per_second_; }
+  void set_max_messages_per_second(uint32_t value) { max_messages_per_second_ = value; _has_field_.set(2); }
+
+  bool has_seed() const { return _has_field_[3]; }
+  uint32_t seed() const { return seed_; }
+  void set_seed(uint32_t value) { seed_ = value; _has_field_.set(3); }
+
+  bool has_message_size() const { return _has_field_[4]; }
+  uint32_t message_size() const { return message_size_; }
+  void set_message_size(uint32_t value) { message_size_ = value; _has_field_.set(4); }
+
+  bool has_send_batch_on_register() const { return _has_field_[5]; }
+  bool send_batch_on_register() const { return send_batch_on_register_; }
+  void set_send_batch_on_register(bool value) { send_batch_on_register_ = value; _has_field_.set(5); }
+
+  bool has_dummy_fields() const { return _has_field_[6]; }
+  const TestConfig_DummyFields& dummy_fields() const { return *dummy_fields_; }
+  TestConfig_DummyFields* mutable_dummy_fields() { _has_field_.set(6); return dummy_fields_.get(); }
+
+ private:
+  uint32_t message_count_{};
+  uint32_t max_messages_per_second_{};
+  uint32_t seed_{};
+  uint32_t message_size_{};
+  bool send_batch_on_register_{};
+  ::protozero::CopyablePtr<TestConfig_DummyFields> dummy_fields_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<7> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TestConfig_DummyFields : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kFieldUint32FieldNumber = 1,
+    kFieldInt32FieldNumber = 2,
+    kFieldUint64FieldNumber = 3,
+    kFieldInt64FieldNumber = 4,
+    kFieldFixed64FieldNumber = 5,
+    kFieldSfixed64FieldNumber = 6,
+    kFieldFixed32FieldNumber = 7,
+    kFieldSfixed32FieldNumber = 8,
+    kFieldDoubleFieldNumber = 9,
+    kFieldFloatFieldNumber = 10,
+    kFieldSint64FieldNumber = 11,
+    kFieldSint32FieldNumber = 12,
+    kFieldStringFieldNumber = 13,
+    kFieldBytesFieldNumber = 14,
+  };
+
+  TestConfig_DummyFields();
+  ~TestConfig_DummyFields() override;
+  TestConfig_DummyFields(TestConfig_DummyFields&&) noexcept;
+  TestConfig_DummyFields& operator=(TestConfig_DummyFields&&);
+  TestConfig_DummyFields(const TestConfig_DummyFields&);
+  TestConfig_DummyFields& operator=(const TestConfig_DummyFields&);
+  bool operator==(const TestConfig_DummyFields&) const;
+  bool operator!=(const TestConfig_DummyFields& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_field_uint32() const { return _has_field_[1]; }
+  uint32_t field_uint32() const { return field_uint32_; }
+  void set_field_uint32(uint32_t value) { field_uint32_ = value; _has_field_.set(1); }
+
+  bool has_field_int32() const { return _has_field_[2]; }
+  int32_t field_int32() const { return field_int32_; }
+  void set_field_int32(int32_t value) { field_int32_ = value; _has_field_.set(2); }
+
+  bool has_field_uint64() const { return _has_field_[3]; }
+  uint64_t field_uint64() const { return field_uint64_; }
+  void set_field_uint64(uint64_t value) { field_uint64_ = value; _has_field_.set(3); }
+
+  bool has_field_int64() const { return _has_field_[4]; }
+  int64_t field_int64() const { return field_int64_; }
+  void set_field_int64(int64_t value) { field_int64_ = value; _has_field_.set(4); }
+
+  bool has_field_fixed64() const { return _has_field_[5]; }
+  uint64_t field_fixed64() const { return field_fixed64_; }
+  void set_field_fixed64(uint64_t value) { field_fixed64_ = value; _has_field_.set(5); }
+
+  bool has_field_sfixed64() const { return _has_field_[6]; }
+  int64_t field_sfixed64() const { return field_sfixed64_; }
+  void set_field_sfixed64(int64_t value) { field_sfixed64_ = value; _has_field_.set(6); }
+
+  bool has_field_fixed32() const { return _has_field_[7]; }
+  uint32_t field_fixed32() const { return field_fixed32_; }
+  void set_field_fixed32(uint32_t value) { field_fixed32_ = value; _has_field_.set(7); }
+
+  bool has_field_sfixed32() const { return _has_field_[8]; }
+  int32_t field_sfixed32() const { return field_sfixed32_; }
+  void set_field_sfixed32(int32_t value) { field_sfixed32_ = value; _has_field_.set(8); }
+
+  bool has_field_double() const { return _has_field_[9]; }
+  double field_double() const { return field_double_; }
+  void set_field_double(double value) { field_double_ = value; _has_field_.set(9); }
+
+  bool has_field_float() const { return _has_field_[10]; }
+  float field_float() const { return field_float_; }
+  void set_field_float(float value) { field_float_ = value; _has_field_.set(10); }
+
+  bool has_field_sint64() const { return _has_field_[11]; }
+  int64_t field_sint64() const { return field_sint64_; }
+  void set_field_sint64(int64_t value) { field_sint64_ = value; _has_field_.set(11); }
+
+  bool has_field_sint32() const { return _has_field_[12]; }
+  int32_t field_sint32() const { return field_sint32_; }
+  void set_field_sint32(int32_t value) { field_sint32_ = value; _has_field_.set(12); }
+
+  bool has_field_string() const { return _has_field_[13]; }
+  const std::string& field_string() const { return field_string_; }
+  void set_field_string(const std::string& value) { field_string_ = value; _has_field_.set(13); }
+
+  bool has_field_bytes() const { return _has_field_[14]; }
+  const std::string& field_bytes() const { return field_bytes_; }
+  void set_field_bytes(const std::string& value) { field_bytes_ = value; _has_field_.set(14); }
+  void set_field_bytes(const void* p, size_t s) { field_bytes_.assign(reinterpret_cast<const char*>(p), s); _has_field_.set(14); }
+
+ private:
+  uint32_t field_uint32_{};
+  int32_t field_int32_{};
+  uint64_t field_uint64_{};
+  int64_t field_int64_{};
+  uint64_t field_fixed64_{};
+  int64_t field_sfixed64_{};
+  uint32_t field_fixed32_{};
+  int32_t field_sfixed32_{};
+  double field_double_{};
+  float field_float_{};
+  int64_t field_sint64_{};
+  int32_t field_sint32_{};
+  std::string field_string_{};
+  std::string field_bytes_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<15> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TEST_CONFIG_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/config/interceptor_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INTERCEPTOR_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INTERCEPTOR_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class InterceptorConfig;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT InterceptorConfig : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNameFieldNumber = 1,
+    kConsoleConfigFieldNumber = 100,
+  };
+
+  InterceptorConfig();
+  ~InterceptorConfig() override;
+  InterceptorConfig(InterceptorConfig&&) noexcept;
+  InterceptorConfig& operator=(InterceptorConfig&&);
+  InterceptorConfig(const InterceptorConfig&);
+  InterceptorConfig& operator=(const InterceptorConfig&);
+  bool operator==(const InterceptorConfig&) const;
+  bool operator!=(const InterceptorConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name() const { return _has_field_[1]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
+
+  const std::string& console_config_raw() const { return console_config_; }
+  void set_console_config_raw(const std::string& raw) { console_config_ = raw; _has_field_.set(100); }
+
+ private:
+  std::string name_{};
+  std::string console_config_;  // [lazy=true]
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<101> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INTERCEPTOR_CONFIG_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/config/data_source_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/test_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/interceptor_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/interceptors/console_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/chrome/chrome_config.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+DataSourceConfig::DataSourceConfig() = default;
+DataSourceConfig::~DataSourceConfig() = default;
+DataSourceConfig::DataSourceConfig(const DataSourceConfig&) = default;
+DataSourceConfig& DataSourceConfig::operator=(const DataSourceConfig&) = default;
+DataSourceConfig::DataSourceConfig(DataSourceConfig&&) noexcept = default;
+DataSourceConfig& DataSourceConfig::operator=(DataSourceConfig&&) = default;
+
+bool DataSourceConfig::operator==(const DataSourceConfig& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && name_ == other.name_
+   && target_buffer_ == other.target_buffer_
+   && trace_duration_ms_ == other.trace_duration_ms_
+   && stop_timeout_ms_ == other.stop_timeout_ms_
+   && enable_extra_guardrails_ == other.enable_extra_guardrails_
+   && session_initiator_ == other.session_initiator_
+   && tracing_session_id_ == other.tracing_session_id_
+   && ftrace_config_ == other.ftrace_config_
+   && inode_file_config_ == other.inode_file_config_
+   && process_stats_config_ == other.process_stats_config_
+   && sys_stats_config_ == other.sys_stats_config_
+   && heapprofd_config_ == other.heapprofd_config_
+   && java_hprof_config_ == other.java_hprof_config_
+   && android_power_config_ == other.android_power_config_
+   && android_log_config_ == other.android_log_config_
+   && gpu_counter_config_ == other.gpu_counter_config_
+   && packages_list_config_ == other.packages_list_config_
+   && perf_event_config_ == other.perf_event_config_
+   && vulkan_memory_config_ == other.vulkan_memory_config_
+   && track_event_config_ == other.track_event_config_
+   && android_polled_state_config_ == other.android_polled_state_config_
+   && chrome_config_ == other.chrome_config_
+   && interceptor_config_ == other.interceptor_config_
+   && legacy_config_ == other.legacy_config_
+   && for_testing_ == other.for_testing_;
+}
+
+bool DataSourceConfig::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* name */:
+        field.get(&name_);
+        break;
+      case 2 /* target_buffer */:
+        field.get(&target_buffer_);
+        break;
+      case 3 /* trace_duration_ms */:
+        field.get(&trace_duration_ms_);
+        break;
+      case 7 /* stop_timeout_ms */:
+        field.get(&stop_timeout_ms_);
+        break;
+      case 6 /* enable_extra_guardrails */:
+        field.get(&enable_extra_guardrails_);
+        break;
+      case 8 /* session_initiator */:
+        field.get(&session_initiator_);
+        break;
+      case 4 /* tracing_session_id */:
+        field.get(&tracing_session_id_);
+        break;
+      case 100 /* ftrace_config */:
+        ftrace_config_ = field.as_std_string();
+        break;
+      case 102 /* inode_file_config */:
+        inode_file_config_ = field.as_std_string();
+        break;
+      case 103 /* process_stats_config */:
+        process_stats_config_ = field.as_std_string();
+        break;
+      case 104 /* sys_stats_config */:
+        sys_stats_config_ = field.as_std_string();
+        break;
+      case 105 /* heapprofd_config */:
+        heapprofd_config_ = field.as_std_string();
+        break;
+      case 110 /* java_hprof_config */:
+        java_hprof_config_ = field.as_std_string();
+        break;
+      case 106 /* android_power_config */:
+        android_power_config_ = field.as_std_string();
+        break;
+      case 107 /* android_log_config */:
+        android_log_config_ = field.as_std_string();
+        break;
+      case 108 /* gpu_counter_config */:
+        gpu_counter_config_ = field.as_std_string();
+        break;
+      case 109 /* packages_list_config */:
+        packages_list_config_ = field.as_std_string();
+        break;
+      case 111 /* perf_event_config */:
+        perf_event_config_ = field.as_std_string();
+        break;
+      case 112 /* vulkan_memory_config */:
+        vulkan_memory_config_ = field.as_std_string();
+        break;
+      case 113 /* track_event_config */:
+        track_event_config_ = field.as_std_string();
+        break;
+      case 114 /* android_polled_state_config */:
+        android_polled_state_config_ = field.as_std_string();
+        break;
+      case 101 /* chrome_config */:
+        (*chrome_config_).ParseFromArray(field.data(), field.size());
+        break;
+      case 115 /* interceptor_config */:
+        (*interceptor_config_).ParseFromArray(field.data(), field.size());
+        break;
+      case 1000 /* legacy_config */:
+        field.get(&legacy_config_);
+        break;
+      case 1001 /* for_testing */:
+        (*for_testing_).ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string DataSourceConfig::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> DataSourceConfig::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void DataSourceConfig::Serialize(::protozero::Message* msg) const {
+  // Field 1: name
+  if (_has_field_[1]) {
+    msg->AppendString(1, name_);
+  }
+
+  // Field 2: target_buffer
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, target_buffer_);
+  }
+
+  // Field 3: trace_duration_ms
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, trace_duration_ms_);
+  }
+
+  // Field 7: stop_timeout_ms
+  if (_has_field_[7]) {
+    msg->AppendVarInt(7, stop_timeout_ms_);
+  }
+
+  // Field 6: enable_extra_guardrails
+  if (_has_field_[6]) {
+    msg->AppendTinyVarInt(6, enable_extra_guardrails_);
+  }
+
+  // Field 8: session_initiator
+  if (_has_field_[8]) {
+    msg->AppendVarInt(8, session_initiator_);
+  }
+
+  // Field 4: tracing_session_id
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, tracing_session_id_);
+  }
+
+  // Field 100: ftrace_config
+  if (_has_field_[100]) {
+    msg->AppendString(100, ftrace_config_);
+  }
+
+  // Field 102: inode_file_config
+  if (_has_field_[102]) {
+    msg->AppendString(102, inode_file_config_);
+  }
+
+  // Field 103: process_stats_config
+  if (_has_field_[103]) {
+    msg->AppendString(103, process_stats_config_);
+  }
+
+  // Field 104: sys_stats_config
+  if (_has_field_[104]) {
+    msg->AppendString(104, sys_stats_config_);
+  }
+
+  // Field 105: heapprofd_config
+  if (_has_field_[105]) {
+    msg->AppendString(105, heapprofd_config_);
+  }
+
+  // Field 110: java_hprof_config
+  if (_has_field_[110]) {
+    msg->AppendString(110, java_hprof_config_);
+  }
+
+  // Field 106: android_power_config
+  if (_has_field_[106]) {
+    msg->AppendString(106, android_power_config_);
+  }
+
+  // Field 107: android_log_config
+  if (_has_field_[107]) {
+    msg->AppendString(107, android_log_config_);
+  }
+
+  // Field 108: gpu_counter_config
+  if (_has_field_[108]) {
+    msg->AppendString(108, gpu_counter_config_);
+  }
+
+  // Field 109: packages_list_config
+  if (_has_field_[109]) {
+    msg->AppendString(109, packages_list_config_);
+  }
+
+  // Field 111: perf_event_config
+  if (_has_field_[111]) {
+    msg->AppendString(111, perf_event_config_);
+  }
+
+  // Field 112: vulkan_memory_config
+  if (_has_field_[112]) {
+    msg->AppendString(112, vulkan_memory_config_);
+  }
+
+  // Field 113: track_event_config
+  if (_has_field_[113]) {
+    msg->AppendString(113, track_event_config_);
+  }
+
+  // Field 114: android_polled_state_config
+  if (_has_field_[114]) {
+    msg->AppendString(114, android_polled_state_config_);
+  }
+
+  // Field 101: chrome_config
+  if (_has_field_[101]) {
+    (*chrome_config_).Serialize(msg->BeginNestedMessage<::protozero::Message>(101));
+  }
+
+  // Field 115: interceptor_config
+  if (_has_field_[115]) {
+    (*interceptor_config_).Serialize(msg->BeginNestedMessage<::protozero::Message>(115));
+  }
+
+  // Field 1000: legacy_config
+  if (_has_field_[1000]) {
+    msg->AppendString(1000, legacy_config_);
+  }
+
+  // Field 1001: for_testing
+  if (_has_field_[1001]) {
+    (*for_testing_).Serialize(msg->BeginNestedMessage<::protozero::Message>(1001));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/config/interceptor_config.gen.cc
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/config/interceptor_config.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+InterceptorConfig::InterceptorConfig() = default;
+InterceptorConfig::~InterceptorConfig() = default;
+InterceptorConfig::InterceptorConfig(const InterceptorConfig&) = default;
+InterceptorConfig& InterceptorConfig::operator=(const InterceptorConfig&) = default;
+InterceptorConfig::InterceptorConfig(InterceptorConfig&&) noexcept = default;
+InterceptorConfig& InterceptorConfig::operator=(InterceptorConfig&&) = default;
+
+bool InterceptorConfig::operator==(const InterceptorConfig& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && name_ == other.name_
+   && console_config_ == other.console_config_;
+}
+
+bool InterceptorConfig::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* name */:
+        field.get(&name_);
+        break;
+      case 100 /* console_config */:
+        console_config_ = field.as_std_string();
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string InterceptorConfig::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> InterceptorConfig::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void InterceptorConfig::Serialize(::protozero::Message* msg) const {
+  // Field 1: name
+  if (_has_field_[1]) {
+    msg->AppendString(1, name_);
+  }
+
+  // Field 100: console_config
+  if (_has_field_[100]) {
+    msg->AppendString(100, console_config_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/config/stress_test_config.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/config/stress_test_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_STRESS_TEST_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_STRESS_TEST_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class StressTestConfig;
+class StressTestConfig_WriterTiming;
+class TraceConfig;
+class TraceConfig_TraceFilter;
+class TraceConfig_IncidentReportConfig;
+class TraceConfig_IncrementalStateConfig;
+class TraceConfig_TriggerConfig;
+class TraceConfig_TriggerConfig_Trigger;
+class TraceConfig_GuardrailOverrides;
+class TraceConfig_StatsdMetadata;
+class TraceConfig_ProducerConfig;
+class TraceConfig_BuiltinDataSource;
+class TraceConfig_DataSource;
+class DataSourceConfig;
+class TestConfig;
+class TestConfig_DummyFields;
+class InterceptorConfig;
+class ChromeConfig;
+class TraceConfig_BufferConfig;
+enum TraceConfig_LockdownModeOperation : int;
+enum TraceConfig_CompressionType : int;
+enum TraceConfig_StatsdLogging : int;
+enum TraceConfig_TriggerConfig_TriggerMode : int;
+enum BuiltinClock : int;
+enum DataSourceConfig_SessionInitiator : int;
+enum ChromeConfig_ClientPriority : int;
+enum TraceConfig_BufferConfig_FillPolicy : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT StressTestConfig : public ::protozero::CppMessageObj {
+ public:
+  using WriterTiming = StressTestConfig_WriterTiming;
+  enum FieldNumbers {
+    kTraceConfigFieldNumber = 1,
+    kShmemSizeKbFieldNumber = 2,
+    kShmemPageSizeKbFieldNumber = 3,
+    kNumProcessesFieldNumber = 4,
+    kNumThreadsFieldNumber = 5,
+    kMaxEventsFieldNumber = 6,
+    kNestingFieldNumber = 7,
+    kSteadyStateTimingsFieldNumber = 8,
+    kBurstPeriodMsFieldNumber = 9,
+    kBurstDurationMsFieldNumber = 10,
+    kBurstTimingsFieldNumber = 11,
+  };
+
+  StressTestConfig();
+  ~StressTestConfig() override;
+  StressTestConfig(StressTestConfig&&) noexcept;
+  StressTestConfig& operator=(StressTestConfig&&);
+  StressTestConfig(const StressTestConfig&);
+  StressTestConfig& operator=(const StressTestConfig&);
+  bool operator==(const StressTestConfig&) const;
+  bool operator!=(const StressTestConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_trace_config() const { return _has_field_[1]; }
+  const TraceConfig& trace_config() const { return *trace_config_; }
+  TraceConfig* mutable_trace_config() { _has_field_.set(1); return trace_config_.get(); }
+
+  bool has_shmem_size_kb() const { return _has_field_[2]; }
+  uint32_t shmem_size_kb() const { return shmem_size_kb_; }
+  void set_shmem_size_kb(uint32_t value) { shmem_size_kb_ = value; _has_field_.set(2); }
+
+  bool has_shmem_page_size_kb() const { return _has_field_[3]; }
+  uint32_t shmem_page_size_kb() const { return shmem_page_size_kb_; }
+  void set_shmem_page_size_kb(uint32_t value) { shmem_page_size_kb_ = value; _has_field_.set(3); }
+
+  bool has_num_processes() const { return _has_field_[4]; }
+  uint32_t num_processes() const { return num_processes_; }
+  void set_num_processes(uint32_t value) { num_processes_ = value; _has_field_.set(4); }
+
+  bool has_num_threads() const { return _has_field_[5]; }
+  uint32_t num_threads() const { return num_threads_; }
+  void set_num_threads(uint32_t value) { num_threads_ = value; _has_field_.set(5); }
+
+  bool has_max_events() const { return _has_field_[6]; }
+  uint32_t max_events() const { return max_events_; }
+  void set_max_events(uint32_t value) { max_events_ = value; _has_field_.set(6); }
+
+  bool has_nesting() const { return _has_field_[7]; }
+  uint32_t nesting() const { return nesting_; }
+  void set_nesting(uint32_t value) { nesting_ = value; _has_field_.set(7); }
+
+  bool has_steady_state_timings() const { return _has_field_[8]; }
+  const StressTestConfig_WriterTiming& steady_state_timings() const { return *steady_state_timings_; }
+  StressTestConfig_WriterTiming* mutable_steady_state_timings() { _has_field_.set(8); return steady_state_timings_.get(); }
+
+  bool has_burst_period_ms() const { return _has_field_[9]; }
+  uint32_t burst_period_ms() const { return burst_period_ms_; }
+  void set_burst_period_ms(uint32_t value) { burst_period_ms_ = value; _has_field_.set(9); }
+
+  bool has_burst_duration_ms() const { return _has_field_[10]; }
+  uint32_t burst_duration_ms() const { return burst_duration_ms_; }
+  void set_burst_duration_ms(uint32_t value) { burst_duration_ms_ = value; _has_field_.set(10); }
+
+  bool has_burst_timings() const { return _has_field_[11]; }
+  const StressTestConfig_WriterTiming& burst_timings() const { return *burst_timings_; }
+  StressTestConfig_WriterTiming* mutable_burst_timings() { _has_field_.set(11); return burst_timings_.get(); }
+
+ private:
+  ::protozero::CopyablePtr<TraceConfig> trace_config_;
+  uint32_t shmem_size_kb_{};
+  uint32_t shmem_page_size_kb_{};
+  uint32_t num_processes_{};
+  uint32_t num_threads_{};
+  uint32_t max_events_{};
+  uint32_t nesting_{};
+  ::protozero::CopyablePtr<StressTestConfig_WriterTiming> steady_state_timings_;
+  uint32_t burst_period_ms_{};
+  uint32_t burst_duration_ms_{};
+  ::protozero::CopyablePtr<StressTestConfig_WriterTiming> burst_timings_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<12> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT StressTestConfig_WriterTiming : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kPayloadMeanFieldNumber = 1,
+    kPayloadStddevFieldNumber = 2,
+    kRateMeanFieldNumber = 3,
+    kRateStddevFieldNumber = 4,
+    kPayloadWriteTimeMsFieldNumber = 5,
+  };
+
+  StressTestConfig_WriterTiming();
+  ~StressTestConfig_WriterTiming() override;
+  StressTestConfig_WriterTiming(StressTestConfig_WriterTiming&&) noexcept;
+  StressTestConfig_WriterTiming& operator=(StressTestConfig_WriterTiming&&);
+  StressTestConfig_WriterTiming(const StressTestConfig_WriterTiming&);
+  StressTestConfig_WriterTiming& operator=(const StressTestConfig_WriterTiming&);
+  bool operator==(const StressTestConfig_WriterTiming&) const;
+  bool operator!=(const StressTestConfig_WriterTiming& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_payload_mean() const { return _has_field_[1]; }
+  double payload_mean() const { return payload_mean_; }
+  void set_payload_mean(double value) { payload_mean_ = value; _has_field_.set(1); }
+
+  bool has_payload_stddev() const { return _has_field_[2]; }
+  double payload_stddev() const { return payload_stddev_; }
+  void set_payload_stddev(double value) { payload_stddev_ = value; _has_field_.set(2); }
+
+  bool has_rate_mean() const { return _has_field_[3]; }
+  double rate_mean() const { return rate_mean_; }
+  void set_rate_mean(double value) { rate_mean_ = value; _has_field_.set(3); }
+
+  bool has_rate_stddev() const { return _has_field_[4]; }
+  double rate_stddev() const { return rate_stddev_; }
+  void set_rate_stddev(double value) { rate_stddev_ = value; _has_field_.set(4); }
+
+  bool has_payload_write_time_ms() const { return _has_field_[5]; }
+  uint32_t payload_write_time_ms() const { return payload_write_time_ms_; }
+  void set_payload_write_time_ms(uint32_t value) { payload_write_time_ms_ = value; _has_field_.set(5); }
+
+ private:
+  double payload_mean_{};
+  double payload_stddev_{};
+  double rate_mean_{};
+  double rate_stddev_{};
+  uint32_t payload_write_time_ms_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<6> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_STRESS_TEST_CONFIG_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/config/stress_test_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/trace_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/builtin_clock.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/data_source_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/track_event/track_event_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/test_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/sys_stats/sys_stats_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/sys_stats_counters.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/profiling/perf_event_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/perf_events.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/profiling/java_hprof_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/profiling/heapprofd_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/process_stats/process_stats_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/power/android_power_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/interceptor_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/interceptors/console_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/inode_file/inode_file_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/gpu/vulkan_memory_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/gpu/gpu_counter_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/ftrace/ftrace_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/chrome/chrome_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/android/packages_list_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/android/android_polled_state_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/android/android_log_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/android_log_constants.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+StressTestConfig::StressTestConfig() = default;
+StressTestConfig::~StressTestConfig() = default;
+StressTestConfig::StressTestConfig(const StressTestConfig&) = default;
+StressTestConfig& StressTestConfig::operator=(const StressTestConfig&) = default;
+StressTestConfig::StressTestConfig(StressTestConfig&&) noexcept = default;
+StressTestConfig& StressTestConfig::operator=(StressTestConfig&&) = default;
+
+bool StressTestConfig::operator==(const StressTestConfig& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && trace_config_ == other.trace_config_
+   && shmem_size_kb_ == other.shmem_size_kb_
+   && shmem_page_size_kb_ == other.shmem_page_size_kb_
+   && num_processes_ == other.num_processes_
+   && num_threads_ == other.num_threads_
+   && max_events_ == other.max_events_
+   && nesting_ == other.nesting_
+   && steady_state_timings_ == other.steady_state_timings_
+   && burst_period_ms_ == other.burst_period_ms_
+   && burst_duration_ms_ == other.burst_duration_ms_
+   && burst_timings_ == other.burst_timings_;
+}
+
+bool StressTestConfig::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* trace_config */:
+        (*trace_config_).ParseFromArray(field.data(), field.size());
+        break;
+      case 2 /* shmem_size_kb */:
+        field.get(&shmem_size_kb_);
+        break;
+      case 3 /* shmem_page_size_kb */:
+        field.get(&shmem_page_size_kb_);
+        break;
+      case 4 /* num_processes */:
+        field.get(&num_processes_);
+        break;
+      case 5 /* num_threads */:
+        field.get(&num_threads_);
+        break;
+      case 6 /* max_events */:
+        field.get(&max_events_);
+        break;
+      case 7 /* nesting */:
+        field.get(&nesting_);
+        break;
+      case 8 /* steady_state_timings */:
+        (*steady_state_timings_).ParseFromArray(field.data(), field.size());
+        break;
+      case 9 /* burst_period_ms */:
+        field.get(&burst_period_ms_);
+        break;
+      case 10 /* burst_duration_ms */:
+        field.get(&burst_duration_ms_);
+        break;
+      case 11 /* burst_timings */:
+        (*burst_timings_).ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string StressTestConfig::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> StressTestConfig::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void StressTestConfig::Serialize(::protozero::Message* msg) const {
+  // Field 1: trace_config
+  if (_has_field_[1]) {
+    (*trace_config_).Serialize(msg->BeginNestedMessage<::protozero::Message>(1));
+  }
+
+  // Field 2: shmem_size_kb
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, shmem_size_kb_);
+  }
+
+  // Field 3: shmem_page_size_kb
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, shmem_page_size_kb_);
+  }
+
+  // Field 4: num_processes
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, num_processes_);
+  }
+
+  // Field 5: num_threads
+  if (_has_field_[5]) {
+    msg->AppendVarInt(5, num_threads_);
+  }
+
+  // Field 6: max_events
+  if (_has_field_[6]) {
+    msg->AppendVarInt(6, max_events_);
+  }
+
+  // Field 7: nesting
+  if (_has_field_[7]) {
+    msg->AppendVarInt(7, nesting_);
+  }
+
+  // Field 8: steady_state_timings
+  if (_has_field_[8]) {
+    (*steady_state_timings_).Serialize(msg->BeginNestedMessage<::protozero::Message>(8));
+  }
+
+  // Field 9: burst_period_ms
+  if (_has_field_[9]) {
+    msg->AppendVarInt(9, burst_period_ms_);
+  }
+
+  // Field 10: burst_duration_ms
+  if (_has_field_[10]) {
+    msg->AppendVarInt(10, burst_duration_ms_);
+  }
+
+  // Field 11: burst_timings
+  if (_has_field_[11]) {
+    (*burst_timings_).Serialize(msg->BeginNestedMessage<::protozero::Message>(11));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+StressTestConfig_WriterTiming::StressTestConfig_WriterTiming() = default;
+StressTestConfig_WriterTiming::~StressTestConfig_WriterTiming() = default;
+StressTestConfig_WriterTiming::StressTestConfig_WriterTiming(const StressTestConfig_WriterTiming&) = default;
+StressTestConfig_WriterTiming& StressTestConfig_WriterTiming::operator=(const StressTestConfig_WriterTiming&) = default;
+StressTestConfig_WriterTiming::StressTestConfig_WriterTiming(StressTestConfig_WriterTiming&&) noexcept = default;
+StressTestConfig_WriterTiming& StressTestConfig_WriterTiming::operator=(StressTestConfig_WriterTiming&&) = default;
+
+bool StressTestConfig_WriterTiming::operator==(const StressTestConfig_WriterTiming& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && payload_mean_ == other.payload_mean_
+   && payload_stddev_ == other.payload_stddev_
+   && rate_mean_ == other.rate_mean_
+   && rate_stddev_ == other.rate_stddev_
+   && payload_write_time_ms_ == other.payload_write_time_ms_;
+}
+
+bool StressTestConfig_WriterTiming::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* payload_mean */:
+        field.get(&payload_mean_);
+        break;
+      case 2 /* payload_stddev */:
+        field.get(&payload_stddev_);
+        break;
+      case 3 /* rate_mean */:
+        field.get(&rate_mean_);
+        break;
+      case 4 /* rate_stddev */:
+        field.get(&rate_stddev_);
+        break;
+      case 5 /* payload_write_time_ms */:
+        field.get(&payload_write_time_ms_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string StressTestConfig_WriterTiming::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> StressTestConfig_WriterTiming::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void StressTestConfig_WriterTiming::Serialize(::protozero::Message* msg) const {
+  // Field 1: payload_mean
+  if (_has_field_[1]) {
+    msg->AppendFixed(1, payload_mean_);
+  }
+
+  // Field 2: payload_stddev
+  if (_has_field_[2]) {
+    msg->AppendFixed(2, payload_stddev_);
+  }
+
+  // Field 3: rate_mean
+  if (_has_field_[3]) {
+    msg->AppendFixed(3, rate_mean_);
+  }
+
+  // Field 4: rate_stddev
+  if (_has_field_[4]) {
+    msg->AppendFixed(4, rate_stddev_);
+  }
+
+  // Field 5: payload_write_time_ms
+  if (_has_field_[5]) {
+    msg->AppendVarInt(5, payload_write_time_ms_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/config/test_config.gen.cc
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/config/test_config.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+TestConfig::TestConfig() = default;
+TestConfig::~TestConfig() = default;
+TestConfig::TestConfig(const TestConfig&) = default;
+TestConfig& TestConfig::operator=(const TestConfig&) = default;
+TestConfig::TestConfig(TestConfig&&) noexcept = default;
+TestConfig& TestConfig::operator=(TestConfig&&) = default;
+
+bool TestConfig::operator==(const TestConfig& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && message_count_ == other.message_count_
+   && max_messages_per_second_ == other.max_messages_per_second_
+   && seed_ == other.seed_
+   && message_size_ == other.message_size_
+   && send_batch_on_register_ == other.send_batch_on_register_
+   && dummy_fields_ == other.dummy_fields_;
+}
+
+bool TestConfig::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* message_count */:
+        field.get(&message_count_);
+        break;
+      case 2 /* max_messages_per_second */:
+        field.get(&max_messages_per_second_);
+        break;
+      case 3 /* seed */:
+        field.get(&seed_);
+        break;
+      case 4 /* message_size */:
+        field.get(&message_size_);
+        break;
+      case 5 /* send_batch_on_register */:
+        field.get(&send_batch_on_register_);
+        break;
+      case 6 /* dummy_fields */:
+        (*dummy_fields_).ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string TestConfig::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> TestConfig::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void TestConfig::Serialize(::protozero::Message* msg) const {
+  // Field 1: message_count
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, message_count_);
+  }
+
+  // Field 2: max_messages_per_second
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, max_messages_per_second_);
+  }
+
+  // Field 3: seed
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, seed_);
+  }
+
+  // Field 4: message_size
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, message_size_);
+  }
+
+  // Field 5: send_batch_on_register
+  if (_has_field_[5]) {
+    msg->AppendTinyVarInt(5, send_batch_on_register_);
+  }
+
+  // Field 6: dummy_fields
+  if (_has_field_[6]) {
+    (*dummy_fields_).Serialize(msg->BeginNestedMessage<::protozero::Message>(6));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+TestConfig_DummyFields::TestConfig_DummyFields() = default;
+TestConfig_DummyFields::~TestConfig_DummyFields() = default;
+TestConfig_DummyFields::TestConfig_DummyFields(const TestConfig_DummyFields&) = default;
+TestConfig_DummyFields& TestConfig_DummyFields::operator=(const TestConfig_DummyFields&) = default;
+TestConfig_DummyFields::TestConfig_DummyFields(TestConfig_DummyFields&&) noexcept = default;
+TestConfig_DummyFields& TestConfig_DummyFields::operator=(TestConfig_DummyFields&&) = default;
+
+bool TestConfig_DummyFields::operator==(const TestConfig_DummyFields& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && field_uint32_ == other.field_uint32_
+   && field_int32_ == other.field_int32_
+   && field_uint64_ == other.field_uint64_
+   && field_int64_ == other.field_int64_
+   && field_fixed64_ == other.field_fixed64_
+   && field_sfixed64_ == other.field_sfixed64_
+   && field_fixed32_ == other.field_fixed32_
+   && field_sfixed32_ == other.field_sfixed32_
+   && field_double_ == other.field_double_
+   && field_float_ == other.field_float_
+   && field_sint64_ == other.field_sint64_
+   && field_sint32_ == other.field_sint32_
+   && field_string_ == other.field_string_
+   && field_bytes_ == other.field_bytes_;
+}
+
+bool TestConfig_DummyFields::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* field_uint32 */:
+        field.get(&field_uint32_);
+        break;
+      case 2 /* field_int32 */:
+        field.get(&field_int32_);
+        break;
+      case 3 /* field_uint64 */:
+        field.get(&field_uint64_);
+        break;
+      case 4 /* field_int64 */:
+        field.get(&field_int64_);
+        break;
+      case 5 /* field_fixed64 */:
+        field.get(&field_fixed64_);
+        break;
+      case 6 /* field_sfixed64 */:
+        field.get(&field_sfixed64_);
+        break;
+      case 7 /* field_fixed32 */:
+        field.get(&field_fixed32_);
+        break;
+      case 8 /* field_sfixed32 */:
+        field.get(&field_sfixed32_);
+        break;
+      case 9 /* field_double */:
+        field.get(&field_double_);
+        break;
+      case 10 /* field_float */:
+        field.get(&field_float_);
+        break;
+      case 11 /* field_sint64 */:
+        field.get_signed(&field_sint64_);
+        break;
+      case 12 /* field_sint32 */:
+        field.get_signed(&field_sint32_);
+        break;
+      case 13 /* field_string */:
+        field.get(&field_string_);
+        break;
+      case 14 /* field_bytes */:
+        field.get(&field_bytes_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string TestConfig_DummyFields::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> TestConfig_DummyFields::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void TestConfig_DummyFields::Serialize(::protozero::Message* msg) const {
+  // Field 1: field_uint32
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, field_uint32_);
+  }
+
+  // Field 2: field_int32
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, field_int32_);
+  }
+
+  // Field 3: field_uint64
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, field_uint64_);
+  }
+
+  // Field 4: field_int64
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, field_int64_);
+  }
+
+  // Field 5: field_fixed64
+  if (_has_field_[5]) {
+    msg->AppendFixed(5, field_fixed64_);
+  }
+
+  // Field 6: field_sfixed64
+  if (_has_field_[6]) {
+    msg->AppendFixed(6, field_sfixed64_);
+  }
+
+  // Field 7: field_fixed32
+  if (_has_field_[7]) {
+    msg->AppendFixed(7, field_fixed32_);
+  }
+
+  // Field 8: field_sfixed32
+  if (_has_field_[8]) {
+    msg->AppendFixed(8, field_sfixed32_);
+  }
+
+  // Field 9: field_double
+  if (_has_field_[9]) {
+    msg->AppendFixed(9, field_double_);
+  }
+
+  // Field 10: field_float
+  if (_has_field_[10]) {
+    msg->AppendFixed(10, field_float_);
+  }
+
+  // Field 11: field_sint64
+  if (_has_field_[11]) {
+    msg->AppendSignedVarInt(11, field_sint64_);
+  }
+
+  // Field 12: field_sint32
+  if (_has_field_[12]) {
+    msg->AppendSignedVarInt(12, field_sint32_);
+  }
+
+  // Field 13: field_string
+  if (_has_field_[13]) {
+    msg->AppendString(13, field_string_);
+  }
+
+  // Field 14: field_bytes
+  if (_has_field_[14]) {
+    msg->AppendString(14, field_bytes_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/config/trace_config.gen.cc
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/config/trace_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/builtin_clock.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/data_source_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/track_event/track_event_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/test_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/sys_stats/sys_stats_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/sys_stats_counters.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/profiling/perf_event_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/perf_events.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/profiling/java_hprof_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/profiling/heapprofd_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/process_stats/process_stats_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/power/android_power_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/interceptor_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/interceptors/console_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/inode_file/inode_file_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/gpu/vulkan_memory_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/gpu/gpu_counter_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/ftrace/ftrace_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/chrome/chrome_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/android/packages_list_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/android/android_polled_state_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/android/android_log_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/android_log_constants.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+TraceConfig::TraceConfig() = default;
+TraceConfig::~TraceConfig() = default;
+TraceConfig::TraceConfig(const TraceConfig&) = default;
+TraceConfig& TraceConfig::operator=(const TraceConfig&) = default;
+TraceConfig::TraceConfig(TraceConfig&&) noexcept = default;
+TraceConfig& TraceConfig::operator=(TraceConfig&&) = default;
+
+bool TraceConfig::operator==(const TraceConfig& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && buffers_ == other.buffers_
+   && data_sources_ == other.data_sources_
+   && builtin_data_sources_ == other.builtin_data_sources_
+   && duration_ms_ == other.duration_ms_
+   && enable_extra_guardrails_ == other.enable_extra_guardrails_
+   && lockdown_mode_ == other.lockdown_mode_
+   && producers_ == other.producers_
+   && statsd_metadata_ == other.statsd_metadata_
+   && write_into_file_ == other.write_into_file_
+   && output_path_ == other.output_path_
+   && file_write_period_ms_ == other.file_write_period_ms_
+   && max_file_size_bytes_ == other.max_file_size_bytes_
+   && guardrail_overrides_ == other.guardrail_overrides_
+   && deferred_start_ == other.deferred_start_
+   && flush_period_ms_ == other.flush_period_ms_
+   && flush_timeout_ms_ == other.flush_timeout_ms_
+   && data_source_stop_timeout_ms_ == other.data_source_stop_timeout_ms_
+   && notify_traceur_ == other.notify_traceur_
+   && bugreport_score_ == other.bugreport_score_
+   && trigger_config_ == other.trigger_config_
+   && activate_triggers_ == other.activate_triggers_
+   && incremental_state_config_ == other.incremental_state_config_
+   && allow_user_build_tracing_ == other.allow_user_build_tracing_
+   && unique_session_name_ == other.unique_session_name_
+   && compression_type_ == other.compression_type_
+   && incident_report_config_ == other.incident_report_config_
+   && statsd_logging_ == other.statsd_logging_
+   && trace_uuid_msb_ == other.trace_uuid_msb_
+   && trace_uuid_lsb_ == other.trace_uuid_lsb_
+   && trace_filter_ == other.trace_filter_;
+}
+
+int TraceConfig::buffers_size() const { return static_cast<int>(buffers_.size()); }
+void TraceConfig::clear_buffers() { buffers_.clear(); }
+TraceConfig_BufferConfig* TraceConfig::add_buffers() { buffers_.emplace_back(); return &buffers_.back(); }
+int TraceConfig::data_sources_size() const { return static_cast<int>(data_sources_.size()); }
+void TraceConfig::clear_data_sources() { data_sources_.clear(); }
+TraceConfig_DataSource* TraceConfig::add_data_sources() { data_sources_.emplace_back(); return &data_sources_.back(); }
+int TraceConfig::producers_size() const { return static_cast<int>(producers_.size()); }
+void TraceConfig::clear_producers() { producers_.clear(); }
+TraceConfig_ProducerConfig* TraceConfig::add_producers() { producers_.emplace_back(); return &producers_.back(); }
+bool TraceConfig::ParseFromArray(const void* raw, size_t size) {
+  buffers_.clear();
+  data_sources_.clear();
+  producers_.clear();
+  activate_triggers_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* buffers */:
+        buffers_.emplace_back();
+        buffers_.back().ParseFromArray(field.data(), field.size());
+        break;
+      case 2 /* data_sources */:
+        data_sources_.emplace_back();
+        data_sources_.back().ParseFromArray(field.data(), field.size());
+        break;
+      case 20 /* builtin_data_sources */:
+        (*builtin_data_sources_).ParseFromArray(field.data(), field.size());
+        break;
+      case 3 /* duration_ms */:
+        field.get(&duration_ms_);
+        break;
+      case 4 /* enable_extra_guardrails */:
+        field.get(&enable_extra_guardrails_);
+        break;
+      case 5 /* lockdown_mode */:
+        field.get(&lockdown_mode_);
+        break;
+      case 6 /* producers */:
+        producers_.emplace_back();
+        producers_.back().ParseFromArray(field.data(), field.size());
+        break;
+      case 7 /* statsd_metadata */:
+        (*statsd_metadata_).ParseFromArray(field.data(), field.size());
+        break;
+      case 8 /* write_into_file */:
+        field.get(&write_into_file_);
+        break;
+      case 29 /* output_path */:
+        field.get(&output_path_);
+        break;
+      case 9 /* file_write_period_ms */:
+        field.get(&file_write_period_ms_);
+        break;
+      case 10 /* max_file_size_bytes */:
+        field.get(&max_file_size_bytes_);
+        break;
+      case 11 /* guardrail_overrides */:
+        (*guardrail_overrides_).ParseFromArray(field.data(), field.size());
+        break;
+      case 12 /* deferred_start */:
+        field.get(&deferred_start_);
+        break;
+      case 13 /* flush_period_ms */:
+        field.get(&flush_period_ms_);
+        break;
+      case 14 /* flush_timeout_ms */:
+        field.get(&flush_timeout_ms_);
+        break;
+      case 23 /* data_source_stop_timeout_ms */:
+        field.get(&data_source_stop_timeout_ms_);
+        break;
+      case 16 /* notify_traceur */:
+        field.get(&notify_traceur_);
+        break;
+      case 30 /* bugreport_score */:
+        field.get(&bugreport_score_);
+        break;
+      case 17 /* trigger_config */:
+        (*trigger_config_).ParseFromArray(field.data(), field.size());
+        break;
+      case 18 /* activate_triggers */:
+        activate_triggers_.emplace_back();
+        field.get(&activate_triggers_.back());
+        break;
+      case 21 /* incremental_state_config */:
+        (*incremental_state_config_).ParseFromArray(field.data(), field.size());
+        break;
+      case 19 /* allow_user_build_tracing */:
+        field.get(&allow_user_build_tracing_);
+        break;
+      case 22 /* unique_session_name */:
+        field.get(&unique_session_name_);
+        break;
+      case 24 /* compression_type */:
+        field.get(&compression_type_);
+        break;
+      case 25 /* incident_report_config */:
+        (*incident_report_config_).ParseFromArray(field.data(), field.size());
+        break;
+      case 31 /* statsd_logging */:
+        field.get(&statsd_logging_);
+        break;
+      case 27 /* trace_uuid_msb */:
+        field.get(&trace_uuid_msb_);
+        break;
+      case 28 /* trace_uuid_lsb */:
+        field.get(&trace_uuid_lsb_);
+        break;
+      case 32 /* trace_filter */:
+        (*trace_filter_).ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string TraceConfig::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> TraceConfig::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void TraceConfig::Serialize(::protozero::Message* msg) const {
+  // Field 1: buffers
+  for (auto& it : buffers_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(1));
+  }
+
+  // Field 2: data_sources
+  for (auto& it : data_sources_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(2));
+  }
+
+  // Field 20: builtin_data_sources
+  if (_has_field_[20]) {
+    (*builtin_data_sources_).Serialize(msg->BeginNestedMessage<::protozero::Message>(20));
+  }
+
+  // Field 3: duration_ms
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, duration_ms_);
+  }
+
+  // Field 4: enable_extra_guardrails
+  if (_has_field_[4]) {
+    msg->AppendTinyVarInt(4, enable_extra_guardrails_);
+  }
+
+  // Field 5: lockdown_mode
+  if (_has_field_[5]) {
+    msg->AppendVarInt(5, lockdown_mode_);
+  }
+
+  // Field 6: producers
+  for (auto& it : producers_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(6));
+  }
+
+  // Field 7: statsd_metadata
+  if (_has_field_[7]) {
+    (*statsd_metadata_).Serialize(msg->BeginNestedMessage<::protozero::Message>(7));
+  }
+
+  // Field 8: write_into_file
+  if (_has_field_[8]) {
+    msg->AppendTinyVarInt(8, write_into_file_);
+  }
+
+  // Field 29: output_path
+  if (_has_field_[29]) {
+    msg->AppendString(29, output_path_);
+  }
+
+  // Field 9: file_write_period_ms
+  if (_has_field_[9]) {
+    msg->AppendVarInt(9, file_write_period_ms_);
+  }
+
+  // Field 10: max_file_size_bytes
+  if (_has_field_[10]) {
+    msg->AppendVarInt(10, max_file_size_bytes_);
+  }
+
+  // Field 11: guardrail_overrides
+  if (_has_field_[11]) {
+    (*guardrail_overrides_).Serialize(msg->BeginNestedMessage<::protozero::Message>(11));
+  }
+
+  // Field 12: deferred_start
+  if (_has_field_[12]) {
+    msg->AppendTinyVarInt(12, deferred_start_);
+  }
+
+  // Field 13: flush_period_ms
+  if (_has_field_[13]) {
+    msg->AppendVarInt(13, flush_period_ms_);
+  }
+
+  // Field 14: flush_timeout_ms
+  if (_has_field_[14]) {
+    msg->AppendVarInt(14, flush_timeout_ms_);
+  }
+
+  // Field 23: data_source_stop_timeout_ms
+  if (_has_field_[23]) {
+    msg->AppendVarInt(23, data_source_stop_timeout_ms_);
+  }
+
+  // Field 16: notify_traceur
+  if (_has_field_[16]) {
+    msg->AppendTinyVarInt(16, notify_traceur_);
+  }
+
+  // Field 30: bugreport_score
+  if (_has_field_[30]) {
+    msg->AppendVarInt(30, bugreport_score_);
+  }
+
+  // Field 17: trigger_config
+  if (_has_field_[17]) {
+    (*trigger_config_).Serialize(msg->BeginNestedMessage<::protozero::Message>(17));
+  }
+
+  // Field 18: activate_triggers
+  for (auto& it : activate_triggers_) {
+    msg->AppendString(18, it);
+  }
+
+  // Field 21: incremental_state_config
+  if (_has_field_[21]) {
+    (*incremental_state_config_).Serialize(msg->BeginNestedMessage<::protozero::Message>(21));
+  }
+
+  // Field 19: allow_user_build_tracing
+  if (_has_field_[19]) {
+    msg->AppendTinyVarInt(19, allow_user_build_tracing_);
+  }
+
+  // Field 22: unique_session_name
+  if (_has_field_[22]) {
+    msg->AppendString(22, unique_session_name_);
+  }
+
+  // Field 24: compression_type
+  if (_has_field_[24]) {
+    msg->AppendVarInt(24, compression_type_);
+  }
+
+  // Field 25: incident_report_config
+  if (_has_field_[25]) {
+    (*incident_report_config_).Serialize(msg->BeginNestedMessage<::protozero::Message>(25));
+  }
+
+  // Field 31: statsd_logging
+  if (_has_field_[31]) {
+    msg->AppendVarInt(31, statsd_logging_);
+  }
+
+  // Field 27: trace_uuid_msb
+  if (_has_field_[27]) {
+    msg->AppendVarInt(27, trace_uuid_msb_);
+  }
+
+  // Field 28: trace_uuid_lsb
+  if (_has_field_[28]) {
+    msg->AppendVarInt(28, trace_uuid_lsb_);
+  }
+
+  // Field 32: trace_filter
+  if (_has_field_[32]) {
+    (*trace_filter_).Serialize(msg->BeginNestedMessage<::protozero::Message>(32));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+TraceConfig_TraceFilter::TraceConfig_TraceFilter() = default;
+TraceConfig_TraceFilter::~TraceConfig_TraceFilter() = default;
+TraceConfig_TraceFilter::TraceConfig_TraceFilter(const TraceConfig_TraceFilter&) = default;
+TraceConfig_TraceFilter& TraceConfig_TraceFilter::operator=(const TraceConfig_TraceFilter&) = default;
+TraceConfig_TraceFilter::TraceConfig_TraceFilter(TraceConfig_TraceFilter&&) noexcept = default;
+TraceConfig_TraceFilter& TraceConfig_TraceFilter::operator=(TraceConfig_TraceFilter&&) = default;
+
+bool TraceConfig_TraceFilter::operator==(const TraceConfig_TraceFilter& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && bytecode_ == other.bytecode_;
+}
+
+bool TraceConfig_TraceFilter::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* bytecode */:
+        field.get(&bytecode_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string TraceConfig_TraceFilter::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> TraceConfig_TraceFilter::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void TraceConfig_TraceFilter::Serialize(::protozero::Message* msg) const {
+  // Field 1: bytecode
+  if (_has_field_[1]) {
+    msg->AppendString(1, bytecode_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+TraceConfig_IncidentReportConfig::TraceConfig_IncidentReportConfig() = default;
+TraceConfig_IncidentReportConfig::~TraceConfig_IncidentReportConfig() = default;
+TraceConfig_IncidentReportConfig::TraceConfig_IncidentReportConfig(const TraceConfig_IncidentReportConfig&) = default;
+TraceConfig_IncidentReportConfig& TraceConfig_IncidentReportConfig::operator=(const TraceConfig_IncidentReportConfig&) = default;
+TraceConfig_IncidentReportConfig::TraceConfig_IncidentReportConfig(TraceConfig_IncidentReportConfig&&) noexcept = default;
+TraceConfig_IncidentReportConfig& TraceConfig_IncidentReportConfig::operator=(TraceConfig_IncidentReportConfig&&) = default;
+
+bool TraceConfig_IncidentReportConfig::operator==(const TraceConfig_IncidentReportConfig& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && destination_package_ == other.destination_package_
+   && destination_class_ == other.destination_class_
+   && privacy_level_ == other.privacy_level_
+   && skip_incidentd_ == other.skip_incidentd_
+   && skip_dropbox_ == other.skip_dropbox_;
+}
+
+bool TraceConfig_IncidentReportConfig::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* destination_package */:
+        field.get(&destination_package_);
+        break;
+      case 2 /* destination_class */:
+        field.get(&destination_class_);
+        break;
+      case 3 /* privacy_level */:
+        field.get(&privacy_level_);
+        break;
+      case 5 /* skip_incidentd */:
+        field.get(&skip_incidentd_);
+        break;
+      case 4 /* skip_dropbox */:
+        field.get(&skip_dropbox_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string TraceConfig_IncidentReportConfig::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> TraceConfig_IncidentReportConfig::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void TraceConfig_IncidentReportConfig::Serialize(::protozero::Message* msg) const {
+  // Field 1: destination_package
+  if (_has_field_[1]) {
+    msg->AppendString(1, destination_package_);
+  }
+
+  // Field 2: destination_class
+  if (_has_field_[2]) {
+    msg->AppendString(2, destination_class_);
+  }
+
+  // Field 3: privacy_level
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, privacy_level_);
+  }
+
+  // Field 5: skip_incidentd
+  if (_has_field_[5]) {
+    msg->AppendTinyVarInt(5, skip_incidentd_);
+  }
+
+  // Field 4: skip_dropbox
+  if (_has_field_[4]) {
+    msg->AppendTinyVarInt(4, skip_dropbox_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+TraceConfig_IncrementalStateConfig::TraceConfig_IncrementalStateConfig() = default;
+TraceConfig_IncrementalStateConfig::~TraceConfig_IncrementalStateConfig() = default;
+TraceConfig_IncrementalStateConfig::TraceConfig_IncrementalStateConfig(const TraceConfig_IncrementalStateConfig&) = default;
+TraceConfig_IncrementalStateConfig& TraceConfig_IncrementalStateConfig::operator=(const TraceConfig_IncrementalStateConfig&) = default;
+TraceConfig_IncrementalStateConfig::TraceConfig_IncrementalStateConfig(TraceConfig_IncrementalStateConfig&&) noexcept = default;
+TraceConfig_IncrementalStateConfig& TraceConfig_IncrementalStateConfig::operator=(TraceConfig_IncrementalStateConfig&&) = default;
+
+bool TraceConfig_IncrementalStateConfig::operator==(const TraceConfig_IncrementalStateConfig& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && clear_period_ms_ == other.clear_period_ms_;
+}
+
+bool TraceConfig_IncrementalStateConfig::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* clear_period_ms */:
+        field.get(&clear_period_ms_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string TraceConfig_IncrementalStateConfig::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> TraceConfig_IncrementalStateConfig::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void TraceConfig_IncrementalStateConfig::Serialize(::protozero::Message* msg) const {
+  // Field 1: clear_period_ms
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, clear_period_ms_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+TraceConfig_TriggerConfig::TraceConfig_TriggerConfig() = default;
+TraceConfig_TriggerConfig::~TraceConfig_TriggerConfig() = default;
+TraceConfig_TriggerConfig::TraceConfig_TriggerConfig(const TraceConfig_TriggerConfig&) = default;
+TraceConfig_TriggerConfig& TraceConfig_TriggerConfig::operator=(const TraceConfig_TriggerConfig&) = default;
+TraceConfig_TriggerConfig::TraceConfig_TriggerConfig(TraceConfig_TriggerConfig&&) noexcept = default;
+TraceConfig_TriggerConfig& TraceConfig_TriggerConfig::operator=(TraceConfig_TriggerConfig&&) = default;
+
+bool TraceConfig_TriggerConfig::operator==(const TraceConfig_TriggerConfig& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && trigger_mode_ == other.trigger_mode_
+   && triggers_ == other.triggers_
+   && trigger_timeout_ms_ == other.trigger_timeout_ms_;
+}
+
+int TraceConfig_TriggerConfig::triggers_size() const { return static_cast<int>(triggers_.size()); }
+void TraceConfig_TriggerConfig::clear_triggers() { triggers_.clear(); }
+TraceConfig_TriggerConfig_Trigger* TraceConfig_TriggerConfig::add_triggers() { triggers_.emplace_back(); return &triggers_.back(); }
+bool TraceConfig_TriggerConfig::ParseFromArray(const void* raw, size_t size) {
+  triggers_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* trigger_mode */:
+        field.get(&trigger_mode_);
+        break;
+      case 2 /* triggers */:
+        triggers_.emplace_back();
+        triggers_.back().ParseFromArray(field.data(), field.size());
+        break;
+      case 3 /* trigger_timeout_ms */:
+        field.get(&trigger_timeout_ms_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string TraceConfig_TriggerConfig::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> TraceConfig_TriggerConfig::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void TraceConfig_TriggerConfig::Serialize(::protozero::Message* msg) const {
+  // Field 1: trigger_mode
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, trigger_mode_);
+  }
+
+  // Field 2: triggers
+  for (auto& it : triggers_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(2));
+  }
+
+  // Field 3: trigger_timeout_ms
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, trigger_timeout_ms_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+TraceConfig_TriggerConfig_Trigger::TraceConfig_TriggerConfig_Trigger() = default;
+TraceConfig_TriggerConfig_Trigger::~TraceConfig_TriggerConfig_Trigger() = default;
+TraceConfig_TriggerConfig_Trigger::TraceConfig_TriggerConfig_Trigger(const TraceConfig_TriggerConfig_Trigger&) = default;
+TraceConfig_TriggerConfig_Trigger& TraceConfig_TriggerConfig_Trigger::operator=(const TraceConfig_TriggerConfig_Trigger&) = default;
+TraceConfig_TriggerConfig_Trigger::TraceConfig_TriggerConfig_Trigger(TraceConfig_TriggerConfig_Trigger&&) noexcept = default;
+TraceConfig_TriggerConfig_Trigger& TraceConfig_TriggerConfig_Trigger::operator=(TraceConfig_TriggerConfig_Trigger&&) = default;
+
+bool TraceConfig_TriggerConfig_Trigger::operator==(const TraceConfig_TriggerConfig_Trigger& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && name_ == other.name_
+   && producer_name_regex_ == other.producer_name_regex_
+   && stop_delay_ms_ == other.stop_delay_ms_
+   && max_per_24_h_ == other.max_per_24_h_
+   && skip_probability_ == other.skip_probability_;
+}
+
+bool TraceConfig_TriggerConfig_Trigger::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* name */:
+        field.get(&name_);
+        break;
+      case 2 /* producer_name_regex */:
+        field.get(&producer_name_regex_);
+        break;
+      case 3 /* stop_delay_ms */:
+        field.get(&stop_delay_ms_);
+        break;
+      case 4 /* max_per_24_h */:
+        field.get(&max_per_24_h_);
+        break;
+      case 5 /* skip_probability */:
+        field.get(&skip_probability_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string TraceConfig_TriggerConfig_Trigger::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> TraceConfig_TriggerConfig_Trigger::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void TraceConfig_TriggerConfig_Trigger::Serialize(::protozero::Message* msg) const {
+  // Field 1: name
+  if (_has_field_[1]) {
+    msg->AppendString(1, name_);
+  }
+
+  // Field 2: producer_name_regex
+  if (_has_field_[2]) {
+    msg->AppendString(2, producer_name_regex_);
+  }
+
+  // Field 3: stop_delay_ms
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, stop_delay_ms_);
+  }
+
+  // Field 4: max_per_24_h
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, max_per_24_h_);
+  }
+
+  // Field 5: skip_probability
+  if (_has_field_[5]) {
+    msg->AppendFixed(5, skip_probability_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+TraceConfig_GuardrailOverrides::TraceConfig_GuardrailOverrides() = default;
+TraceConfig_GuardrailOverrides::~TraceConfig_GuardrailOverrides() = default;
+TraceConfig_GuardrailOverrides::TraceConfig_GuardrailOverrides(const TraceConfig_GuardrailOverrides&) = default;
+TraceConfig_GuardrailOverrides& TraceConfig_GuardrailOverrides::operator=(const TraceConfig_GuardrailOverrides&) = default;
+TraceConfig_GuardrailOverrides::TraceConfig_GuardrailOverrides(TraceConfig_GuardrailOverrides&&) noexcept = default;
+TraceConfig_GuardrailOverrides& TraceConfig_GuardrailOverrides::operator=(TraceConfig_GuardrailOverrides&&) = default;
+
+bool TraceConfig_GuardrailOverrides::operator==(const TraceConfig_GuardrailOverrides& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && max_upload_per_day_bytes_ == other.max_upload_per_day_bytes_;
+}
+
+bool TraceConfig_GuardrailOverrides::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* max_upload_per_day_bytes */:
+        field.get(&max_upload_per_day_bytes_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string TraceConfig_GuardrailOverrides::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> TraceConfig_GuardrailOverrides::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void TraceConfig_GuardrailOverrides::Serialize(::protozero::Message* msg) const {
+  // Field 1: max_upload_per_day_bytes
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, max_upload_per_day_bytes_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+TraceConfig_StatsdMetadata::TraceConfig_StatsdMetadata() = default;
+TraceConfig_StatsdMetadata::~TraceConfig_StatsdMetadata() = default;
+TraceConfig_StatsdMetadata::TraceConfig_StatsdMetadata(const TraceConfig_StatsdMetadata&) = default;
+TraceConfig_StatsdMetadata& TraceConfig_StatsdMetadata::operator=(const TraceConfig_StatsdMetadata&) = default;
+TraceConfig_StatsdMetadata::TraceConfig_StatsdMetadata(TraceConfig_StatsdMetadata&&) noexcept = default;
+TraceConfig_StatsdMetadata& TraceConfig_StatsdMetadata::operator=(TraceConfig_StatsdMetadata&&) = default;
+
+bool TraceConfig_StatsdMetadata::operator==(const TraceConfig_StatsdMetadata& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && triggering_alert_id_ == other.triggering_alert_id_
+   && triggering_config_uid_ == other.triggering_config_uid_
+   && triggering_config_id_ == other.triggering_config_id_
+   && triggering_subscription_id_ == other.triggering_subscription_id_;
+}
+
+bool TraceConfig_StatsdMetadata::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* triggering_alert_id */:
+        field.get(&triggering_alert_id_);
+        break;
+      case 2 /* triggering_config_uid */:
+        field.get(&triggering_config_uid_);
+        break;
+      case 3 /* triggering_config_id */:
+        field.get(&triggering_config_id_);
+        break;
+      case 4 /* triggering_subscription_id */:
+        field.get(&triggering_subscription_id_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string TraceConfig_StatsdMetadata::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> TraceConfig_StatsdMetadata::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void TraceConfig_StatsdMetadata::Serialize(::protozero::Message* msg) const {
+  // Field 1: triggering_alert_id
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, triggering_alert_id_);
+  }
+
+  // Field 2: triggering_config_uid
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, triggering_config_uid_);
+  }
+
+  // Field 3: triggering_config_id
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, triggering_config_id_);
+  }
+
+  // Field 4: triggering_subscription_id
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, triggering_subscription_id_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+TraceConfig_ProducerConfig::TraceConfig_ProducerConfig() = default;
+TraceConfig_ProducerConfig::~TraceConfig_ProducerConfig() = default;
+TraceConfig_ProducerConfig::TraceConfig_ProducerConfig(const TraceConfig_ProducerConfig&) = default;
+TraceConfig_ProducerConfig& TraceConfig_ProducerConfig::operator=(const TraceConfig_ProducerConfig&) = default;
+TraceConfig_ProducerConfig::TraceConfig_ProducerConfig(TraceConfig_ProducerConfig&&) noexcept = default;
+TraceConfig_ProducerConfig& TraceConfig_ProducerConfig::operator=(TraceConfig_ProducerConfig&&) = default;
+
+bool TraceConfig_ProducerConfig::operator==(const TraceConfig_ProducerConfig& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && producer_name_ == other.producer_name_
+   && shm_size_kb_ == other.shm_size_kb_
+   && page_size_kb_ == other.page_size_kb_;
+}
+
+bool TraceConfig_ProducerConfig::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* producer_name */:
+        field.get(&producer_name_);
+        break;
+      case 2 /* shm_size_kb */:
+        field.get(&shm_size_kb_);
+        break;
+      case 3 /* page_size_kb */:
+        field.get(&page_size_kb_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string TraceConfig_ProducerConfig::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> TraceConfig_ProducerConfig::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void TraceConfig_ProducerConfig::Serialize(::protozero::Message* msg) const {
+  // Field 1: producer_name
+  if (_has_field_[1]) {
+    msg->AppendString(1, producer_name_);
+  }
+
+  // Field 2: shm_size_kb
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, shm_size_kb_);
+  }
+
+  // Field 3: page_size_kb
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, page_size_kb_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+TraceConfig_BuiltinDataSource::TraceConfig_BuiltinDataSource() = default;
+TraceConfig_BuiltinDataSource::~TraceConfig_BuiltinDataSource() = default;
+TraceConfig_BuiltinDataSource::TraceConfig_BuiltinDataSource(const TraceConfig_BuiltinDataSource&) = default;
+TraceConfig_BuiltinDataSource& TraceConfig_BuiltinDataSource::operator=(const TraceConfig_BuiltinDataSource&) = default;
+TraceConfig_BuiltinDataSource::TraceConfig_BuiltinDataSource(TraceConfig_BuiltinDataSource&&) noexcept = default;
+TraceConfig_BuiltinDataSource& TraceConfig_BuiltinDataSource::operator=(TraceConfig_BuiltinDataSource&&) = default;
+
+bool TraceConfig_BuiltinDataSource::operator==(const TraceConfig_BuiltinDataSource& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && disable_clock_snapshotting_ == other.disable_clock_snapshotting_
+   && disable_trace_config_ == other.disable_trace_config_
+   && disable_system_info_ == other.disable_system_info_
+   && disable_service_events_ == other.disable_service_events_
+   && primary_trace_clock_ == other.primary_trace_clock_
+   && snapshot_interval_ms_ == other.snapshot_interval_ms_
+   && prefer_suspend_clock_for_snapshot_ == other.prefer_suspend_clock_for_snapshot_;
+}
+
+bool TraceConfig_BuiltinDataSource::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* disable_clock_snapshotting */:
+        field.get(&disable_clock_snapshotting_);
+        break;
+      case 2 /* disable_trace_config */:
+        field.get(&disable_trace_config_);
+        break;
+      case 3 /* disable_system_info */:
+        field.get(&disable_system_info_);
+        break;
+      case 4 /* disable_service_events */:
+        field.get(&disable_service_events_);
+        break;
+      case 5 /* primary_trace_clock */:
+        field.get(&primary_trace_clock_);
+        break;
+      case 6 /* snapshot_interval_ms */:
+        field.get(&snapshot_interval_ms_);
+        break;
+      case 7 /* prefer_suspend_clock_for_snapshot */:
+        field.get(&prefer_suspend_clock_for_snapshot_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string TraceConfig_BuiltinDataSource::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> TraceConfig_BuiltinDataSource::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void TraceConfig_BuiltinDataSource::Serialize(::protozero::Message* msg) const {
+  // Field 1: disable_clock_snapshotting
+  if (_has_field_[1]) {
+    msg->AppendTinyVarInt(1, disable_clock_snapshotting_);
+  }
+
+  // Field 2: disable_trace_config
+  if (_has_field_[2]) {
+    msg->AppendTinyVarInt(2, disable_trace_config_);
+  }
+
+  // Field 3: disable_system_info
+  if (_has_field_[3]) {
+    msg->AppendTinyVarInt(3, disable_system_info_);
+  }
+
+  // Field 4: disable_service_events
+  if (_has_field_[4]) {
+    msg->AppendTinyVarInt(4, disable_service_events_);
+  }
+
+  // Field 5: primary_trace_clock
+  if (_has_field_[5]) {
+    msg->AppendVarInt(5, primary_trace_clock_);
+  }
+
+  // Field 6: snapshot_interval_ms
+  if (_has_field_[6]) {
+    msg->AppendVarInt(6, snapshot_interval_ms_);
+  }
+
+  // Field 7: prefer_suspend_clock_for_snapshot
+  if (_has_field_[7]) {
+    msg->AppendTinyVarInt(7, prefer_suspend_clock_for_snapshot_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+TraceConfig_DataSource::TraceConfig_DataSource() = default;
+TraceConfig_DataSource::~TraceConfig_DataSource() = default;
+TraceConfig_DataSource::TraceConfig_DataSource(const TraceConfig_DataSource&) = default;
+TraceConfig_DataSource& TraceConfig_DataSource::operator=(const TraceConfig_DataSource&) = default;
+TraceConfig_DataSource::TraceConfig_DataSource(TraceConfig_DataSource&&) noexcept = default;
+TraceConfig_DataSource& TraceConfig_DataSource::operator=(TraceConfig_DataSource&&) = default;
+
+bool TraceConfig_DataSource::operator==(const TraceConfig_DataSource& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && config_ == other.config_
+   && producer_name_filter_ == other.producer_name_filter_
+   && producer_name_regex_filter_ == other.producer_name_regex_filter_;
+}
+
+bool TraceConfig_DataSource::ParseFromArray(const void* raw, size_t size) {
+  producer_name_filter_.clear();
+  producer_name_regex_filter_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* config */:
+        (*config_).ParseFromArray(field.data(), field.size());
+        break;
+      case 2 /* producer_name_filter */:
+        producer_name_filter_.emplace_back();
+        field.get(&producer_name_filter_.back());
+        break;
+      case 3 /* producer_name_regex_filter */:
+        producer_name_regex_filter_.emplace_back();
+        field.get(&producer_name_regex_filter_.back());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string TraceConfig_DataSource::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> TraceConfig_DataSource::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void TraceConfig_DataSource::Serialize(::protozero::Message* msg) const {
+  // Field 1: config
+  if (_has_field_[1]) {
+    (*config_).Serialize(msg->BeginNestedMessage<::protozero::Message>(1));
+  }
+
+  // Field 2: producer_name_filter
+  for (auto& it : producer_name_filter_) {
+    msg->AppendString(2, it);
+  }
+
+  // Field 3: producer_name_regex_filter
+  for (auto& it : producer_name_regex_filter_) {
+    msg->AppendString(3, it);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+TraceConfig_BufferConfig::TraceConfig_BufferConfig() = default;
+TraceConfig_BufferConfig::~TraceConfig_BufferConfig() = default;
+TraceConfig_BufferConfig::TraceConfig_BufferConfig(const TraceConfig_BufferConfig&) = default;
+TraceConfig_BufferConfig& TraceConfig_BufferConfig::operator=(const TraceConfig_BufferConfig&) = default;
+TraceConfig_BufferConfig::TraceConfig_BufferConfig(TraceConfig_BufferConfig&&) noexcept = default;
+TraceConfig_BufferConfig& TraceConfig_BufferConfig::operator=(TraceConfig_BufferConfig&&) = default;
+
+bool TraceConfig_BufferConfig::operator==(const TraceConfig_BufferConfig& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && size_kb_ == other.size_kb_
+   && fill_policy_ == other.fill_policy_;
+}
+
+bool TraceConfig_BufferConfig::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* size_kb */:
+        field.get(&size_kb_);
+        break;
+      case 4 /* fill_policy */:
+        field.get(&fill_policy_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string TraceConfig_BufferConfig::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> TraceConfig_BufferConfig::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void TraceConfig_BufferConfig::Serialize(::protozero::Message* msg) const {
+  // Field 1: size_kb
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, size_kb_);
+  }
+
+  // Field 4: fill_policy
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, fill_policy_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/common/android_energy_consumer_descriptor.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/common/android_log_constants.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/common/builtin_clock.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/common/commit_data_request.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/common/data_source_descriptor.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/common/descriptor.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/common/gpu_counter_descriptor.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/common/interceptor_descriptor.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/common/observable_events.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/common/perf_events.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/common/sys_stats_counters.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/common/trace_stats.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/common/tracing_service_capabilities.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/common/tracing_service_state.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/common/track_event_descriptor.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/gpu/gpu_counter_event.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/gpu/gpu_log.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/gpu/gpu_render_stage_event.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/gpu/vulkan_api_event.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/gpu/vulkan_memory_event.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/profiling/deobfuscation.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/profiling/heap_graph.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/profiling/profile_common.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/profiling/profile_packet.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/profiling/smaps.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_application_state_info.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_compositor_scheduler_state.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_content_settings_event_info.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_frame_reporter.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_histogram_sample.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_keyed_service.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_latency_info.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_legacy_ipc.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_message_pump.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_mojo_event_info.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_process_descriptor.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_renderer_scheduler_state.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_thread_descriptor.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_user_event.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_window_handle_event_info.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/counter_descriptor.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/debug_annotation.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/log_message.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/process_descriptor.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/source_location.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/task_execution.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/thread_descriptor.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/track_descriptor.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/track_event.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/interned_data/interned_data.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_application_state_info.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_application_state_info.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_APPLICATION_STATE_INFO_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_APPLICATION_STATE_INFO_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeApplicationStateInfo;
+enum ChromeApplicationStateInfo_ChromeApplicationState : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum ChromeApplicationStateInfo_ChromeApplicationState : int {
+  ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_UNKNOWN = 0,
+  ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_HAS_RUNNING_ACTIVITIES = 1,
+  ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_HAS_PAUSED_ACTIVITIES = 2,
+  ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_HAS_STOPPED_ACTIVITIES = 3,
+  ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_HAS_DESTROYED_ACTIVITIES = 4,
+};
+
+class PERFETTO_EXPORT ChromeApplicationStateInfo : public ::protozero::CppMessageObj {
+ public:
+  using ChromeApplicationState = ChromeApplicationStateInfo_ChromeApplicationState;
+  static constexpr auto APPLICATION_STATE_UNKNOWN = ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_UNKNOWN;
+  static constexpr auto APPLICATION_STATE_HAS_RUNNING_ACTIVITIES = ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_HAS_RUNNING_ACTIVITIES;
+  static constexpr auto APPLICATION_STATE_HAS_PAUSED_ACTIVITIES = ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_HAS_PAUSED_ACTIVITIES;
+  static constexpr auto APPLICATION_STATE_HAS_STOPPED_ACTIVITIES = ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_HAS_STOPPED_ACTIVITIES;
+  static constexpr auto APPLICATION_STATE_HAS_DESTROYED_ACTIVITIES = ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_HAS_DESTROYED_ACTIVITIES;
+  static constexpr auto ChromeApplicationState_MIN = ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_UNKNOWN;
+  static constexpr auto ChromeApplicationState_MAX = ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_HAS_DESTROYED_ACTIVITIES;
+  enum FieldNumbers {
+    kApplicationStateFieldNumber = 1,
+  };
+
+  ChromeApplicationStateInfo();
+  ~ChromeApplicationStateInfo() override;
+  ChromeApplicationStateInfo(ChromeApplicationStateInfo&&) noexcept;
+  ChromeApplicationStateInfo& operator=(ChromeApplicationStateInfo&&);
+  ChromeApplicationStateInfo(const ChromeApplicationStateInfo&);
+  ChromeApplicationStateInfo& operator=(const ChromeApplicationStateInfo&);
+  bool operator==(const ChromeApplicationStateInfo&) const;
+  bool operator!=(const ChromeApplicationStateInfo& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_application_state() const { return _has_field_[1]; }
+  ChromeApplicationStateInfo_ChromeApplicationState application_state() const { return application_state_; }
+  void set_application_state(ChromeApplicationStateInfo_ChromeApplicationState value) { application_state_ = value; _has_field_.set(1); }
+
+ private:
+  ChromeApplicationStateInfo_ChromeApplicationState application_state_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_APPLICATION_STATE_INFO_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_application_state_info.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+ChromeApplicationStateInfo::ChromeApplicationStateInfo() = default;
+ChromeApplicationStateInfo::~ChromeApplicationStateInfo() = default;
+ChromeApplicationStateInfo::ChromeApplicationStateInfo(const ChromeApplicationStateInfo&) = default;
+ChromeApplicationStateInfo& ChromeApplicationStateInfo::operator=(const ChromeApplicationStateInfo&) = default;
+ChromeApplicationStateInfo::ChromeApplicationStateInfo(ChromeApplicationStateInfo&&) noexcept = default;
+ChromeApplicationStateInfo& ChromeApplicationStateInfo::operator=(ChromeApplicationStateInfo&&) = default;
+
+bool ChromeApplicationStateInfo::operator==(const ChromeApplicationStateInfo& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && application_state_ == other.application_state_;
+}
+
+bool ChromeApplicationStateInfo::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* application_state */:
+        field.get(&application_state_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ChromeApplicationStateInfo::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ChromeApplicationStateInfo::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ChromeApplicationStateInfo::Serialize(::protozero::Message* msg) const {
+  // Field 1: application_state
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, application_state_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_compositor_scheduler_state.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_compositor_scheduler_state.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_COMPOSITOR_SCHEDULER_STATE_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_COMPOSITOR_SCHEDULER_STATE_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class CompositorTimingHistory;
+class BeginFrameSourceState;
+class BeginFrameArgs;
+class SourceLocation;
+class BeginFrameObserverState;
+class BeginImplFrameArgs;
+class BeginImplFrameArgs_TimestampsInUs;
+class ChromeCompositorStateMachine;
+class ChromeCompositorStateMachine_MinorState;
+class ChromeCompositorStateMachine_MajorState;
+class ChromeCompositorSchedulerState;
+enum ChromeCompositorSchedulerAction : int;
+enum BeginFrameArgs_BeginFrameArgsType : int;
+enum BeginImplFrameArgs_State : int;
+enum ChromeCompositorStateMachine_MinorState_TreePriority : int;
+enum ChromeCompositorStateMachine_MinorState_ScrollHandlerState : int;
+enum ChromeCompositorStateMachine_MajorState_BeginImplFrameState : int;
+enum ChromeCompositorStateMachine_MajorState_BeginMainFrameState : int;
+enum ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState : int;
+enum ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState : int;
+enum ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum ChromeCompositorSchedulerAction : int {
+  CC_SCHEDULER_ACTION_UNSPECIFIED = 0,
+  CC_SCHEDULER_ACTION_NONE = 1,
+  CC_SCHEDULER_ACTION_SEND_BEGIN_MAIN_FRAME = 2,
+  CC_SCHEDULER_ACTION_COMMIT = 3,
+  CC_SCHEDULER_ACTION_ACTIVATE_SYNC_TREE = 4,
+  CC_SCHEDULER_ACTION_DRAW_IF_POSSIBLE = 5,
+  CC_SCHEDULER_ACTION_DRAW_FORCED = 6,
+  CC_SCHEDULER_ACTION_DRAW_ABORT = 7,
+  CC_SCHEDULER_ACTION_BEGIN_LAYER_TREE_FRAME_SINK_CREATION = 8,
+  CC_SCHEDULER_ACTION_PREPARE_TILES = 9,
+  CC_SCHEDULER_ACTION_INVALIDATE_LAYER_TREE_FRAME_SINK = 10,
+  CC_SCHEDULER_ACTION_PERFORM_IMPL_SIDE_INVALIDATION = 11,
+  CC_SCHEDULER_ACTION_NOTIFY_BEGIN_MAIN_FRAME_NOT_EXPECTED_UNTIL = 12,
+  CC_SCHEDULER_ACTION_NOTIFY_BEGIN_MAIN_FRAME_NOT_EXPECTED_SOON = 13,
+};
+enum BeginFrameArgs_BeginFrameArgsType : int {
+  BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_UNSPECIFIED = 0,
+  BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_INVALID = 1,
+  BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_NORMAL = 2,
+  BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_MISSED = 3,
+};
+enum BeginImplFrameArgs_State : int {
+  BeginImplFrameArgs_State_BEGIN_FRAME_FINISHED = 0,
+  BeginImplFrameArgs_State_BEGIN_FRAME_USING = 1,
+};
+enum ChromeCompositorStateMachine_MinorState_TreePriority : int {
+  ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_UNSPECIFIED = 0,
+  ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_SAME_PRIORITY_FOR_BOTH_TREES = 1,
+  ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_SMOOTHNESS_TAKES_PRIORITY = 2,
+  ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_NEW_CONTENT_TAKES_PRIORITY = 3,
+};
+enum ChromeCompositorStateMachine_MinorState_ScrollHandlerState : int {
+  ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_HANDLER_UNSPECIFIED = 0,
+  ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_AFFECTS_SCROLL_HANDLER = 1,
+  ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_DOES_NOT_AFFECT_SCROLL_HANDLER = 2,
+};
+enum ChromeCompositorStateMachine_MajorState_BeginImplFrameState : int {
+  ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_UNSPECIFIED = 0,
+  ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_IDLE = 1,
+  ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_INSIDE_BEGIN_FRAME = 2,
+  ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_INSIDE_DEADLINE = 3,
+};
+enum ChromeCompositorStateMachine_MajorState_BeginMainFrameState : int {
+  ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_UNSPECIFIED = 0,
+  ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_IDLE = 1,
+  ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_SENT = 2,
+  ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_READY_TO_COMMIT = 3,
+};
+enum ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState : int {
+  ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_UNSPECIFIED = 0,
+  ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_NONE = 1,
+  ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_ACTIVE = 2,
+  ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_CREATING = 3,
+  ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_WAITING_FOR_FIRST_COMMIT = 4,
+  ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_WAITING_FOR_FIRST_ACTIVATION = 5,
+};
+enum ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState : int {
+  ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_UNSPECIFIED = 0,
+  ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_IDLE = 1,
+  ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_COMMIT = 2,
+  ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_ACTIVATION = 3,
+  ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_DRAW = 4,
+};
+enum ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode : int {
+  ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_UNSPECIFIED = 0,
+  ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_NONE = 1,
+  ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_IMMEDIATE = 2,
+  ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_REGULAR = 3,
+  ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_LATE = 4,
+  ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_BLOCKED = 5,
+};
+
+class PERFETTO_EXPORT CompositorTimingHistory : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kBeginMainFrameQueueCriticalEstimateDeltaUsFieldNumber = 1,
+    kBeginMainFrameQueueNotCriticalEstimateDeltaUsFieldNumber = 2,
+    kBeginMainFrameStartToReadyToCommitEstimateDeltaUsFieldNumber = 3,
+    kCommitToReadyToActivateEstimateDeltaUsFieldNumber = 4,
+    kPrepareTilesEstimateDeltaUsFieldNumber = 5,
+    kActivateEstimateDeltaUsFieldNumber = 6,
+    kDrawEstimateDeltaUsFieldNumber = 7,
+  };
+
+  CompositorTimingHistory();
+  ~CompositorTimingHistory() override;
+  CompositorTimingHistory(CompositorTimingHistory&&) noexcept;
+  CompositorTimingHistory& operator=(CompositorTimingHistory&&);
+  CompositorTimingHistory(const CompositorTimingHistory&);
+  CompositorTimingHistory& operator=(const CompositorTimingHistory&);
+  bool operator==(const CompositorTimingHistory&) const;
+  bool operator!=(const CompositorTimingHistory& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_begin_main_frame_queue_critical_estimate_delta_us() const { return _has_field_[1]; }
+  int64_t begin_main_frame_queue_critical_estimate_delta_us() const { return begin_main_frame_queue_critical_estimate_delta_us_; }
+  void set_begin_main_frame_queue_critical_estimate_delta_us(int64_t value) { begin_main_frame_queue_critical_estimate_delta_us_ = value; _has_field_.set(1); }
+
+  bool has_begin_main_frame_queue_not_critical_estimate_delta_us() const { return _has_field_[2]; }
+  int64_t begin_main_frame_queue_not_critical_estimate_delta_us() const { return begin_main_frame_queue_not_critical_estimate_delta_us_; }
+  void set_begin_main_frame_queue_not_critical_estimate_delta_us(int64_t value) { begin_main_frame_queue_not_critical_estimate_delta_us_ = value; _has_field_.set(2); }
+
+  bool has_begin_main_frame_start_to_ready_to_commit_estimate_delta_us() const { return _has_field_[3]; }
+  int64_t begin_main_frame_start_to_ready_to_commit_estimate_delta_us() const { return begin_main_frame_start_to_ready_to_commit_estimate_delta_us_; }
+  void set_begin_main_frame_start_to_ready_to_commit_estimate_delta_us(int64_t value) { begin_main_frame_start_to_ready_to_commit_estimate_delta_us_ = value; _has_field_.set(3); }
+
+  bool has_commit_to_ready_to_activate_estimate_delta_us() const { return _has_field_[4]; }
+  int64_t commit_to_ready_to_activate_estimate_delta_us() const { return commit_to_ready_to_activate_estimate_delta_us_; }
+  void set_commit_to_ready_to_activate_estimate_delta_us(int64_t value) { commit_to_ready_to_activate_estimate_delta_us_ = value; _has_field_.set(4); }
+
+  bool has_prepare_tiles_estimate_delta_us() const { return _has_field_[5]; }
+  int64_t prepare_tiles_estimate_delta_us() const { return prepare_tiles_estimate_delta_us_; }
+  void set_prepare_tiles_estimate_delta_us(int64_t value) { prepare_tiles_estimate_delta_us_ = value; _has_field_.set(5); }
+
+  bool has_activate_estimate_delta_us() const { return _has_field_[6]; }
+  int64_t activate_estimate_delta_us() const { return activate_estimate_delta_us_; }
+  void set_activate_estimate_delta_us(int64_t value) { activate_estimate_delta_us_ = value; _has_field_.set(6); }
+
+  bool has_draw_estimate_delta_us() const { return _has_field_[7]; }
+  int64_t draw_estimate_delta_us() const { return draw_estimate_delta_us_; }
+  void set_draw_estimate_delta_us(int64_t value) { draw_estimate_delta_us_ = value; _has_field_.set(7); }
+
+ private:
+  int64_t begin_main_frame_queue_critical_estimate_delta_us_{};
+  int64_t begin_main_frame_queue_not_critical_estimate_delta_us_{};
+  int64_t begin_main_frame_start_to_ready_to_commit_estimate_delta_us_{};
+  int64_t commit_to_ready_to_activate_estimate_delta_us_{};
+  int64_t prepare_tiles_estimate_delta_us_{};
+  int64_t activate_estimate_delta_us_{};
+  int64_t draw_estimate_delta_us_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<8> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT BeginFrameSourceState : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kSourceIdFieldNumber = 1,
+    kPausedFieldNumber = 2,
+    kNumObserversFieldNumber = 3,
+    kLastBeginFrameArgsFieldNumber = 4,
+  };
+
+  BeginFrameSourceState();
+  ~BeginFrameSourceState() override;
+  BeginFrameSourceState(BeginFrameSourceState&&) noexcept;
+  BeginFrameSourceState& operator=(BeginFrameSourceState&&);
+  BeginFrameSourceState(const BeginFrameSourceState&);
+  BeginFrameSourceState& operator=(const BeginFrameSourceState&);
+  bool operator==(const BeginFrameSourceState&) const;
+  bool operator!=(const BeginFrameSourceState& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_source_id() const { return _has_field_[1]; }
+  uint32_t source_id() const { return source_id_; }
+  void set_source_id(uint32_t value) { source_id_ = value; _has_field_.set(1); }
+
+  bool has_paused() const { return _has_field_[2]; }
+  bool paused() const { return paused_; }
+  void set_paused(bool value) { paused_ = value; _has_field_.set(2); }
+
+  bool has_num_observers() const { return _has_field_[3]; }
+  uint32_t num_observers() const { return num_observers_; }
+  void set_num_observers(uint32_t value) { num_observers_ = value; _has_field_.set(3); }
+
+  bool has_last_begin_frame_args() const { return _has_field_[4]; }
+  const BeginFrameArgs& last_begin_frame_args() const { return *last_begin_frame_args_; }
+  BeginFrameArgs* mutable_last_begin_frame_args() { _has_field_.set(4); return last_begin_frame_args_.get(); }
+
+ private:
+  uint32_t source_id_{};
+  bool paused_{};
+  uint32_t num_observers_{};
+  ::protozero::CopyablePtr<BeginFrameArgs> last_begin_frame_args_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<5> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT BeginFrameArgs : public ::protozero::CppMessageObj {
+ public:
+  using BeginFrameArgsType = BeginFrameArgs_BeginFrameArgsType;
+  static constexpr auto BEGIN_FRAME_ARGS_TYPE_UNSPECIFIED = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_UNSPECIFIED;
+  static constexpr auto BEGIN_FRAME_ARGS_TYPE_INVALID = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_INVALID;
+  static constexpr auto BEGIN_FRAME_ARGS_TYPE_NORMAL = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_NORMAL;
+  static constexpr auto BEGIN_FRAME_ARGS_TYPE_MISSED = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_MISSED;
+  static constexpr auto BeginFrameArgsType_MIN = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_UNSPECIFIED;
+  static constexpr auto BeginFrameArgsType_MAX = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_MISSED;
+  enum FieldNumbers {
+    kTypeFieldNumber = 1,
+    kSourceIdFieldNumber = 2,
+    kSequenceNumberFieldNumber = 3,
+    kFrameTimeUsFieldNumber = 4,
+    kDeadlineUsFieldNumber = 5,
+    kIntervalDeltaUsFieldNumber = 6,
+    kOnCriticalPathFieldNumber = 7,
+    kAnimateOnlyFieldNumber = 8,
+    kSourceLocationIidFieldNumber = 9,
+    kSourceLocationFieldNumber = 10,
+  };
+
+  BeginFrameArgs();
+  ~BeginFrameArgs() override;
+  BeginFrameArgs(BeginFrameArgs&&) noexcept;
+  BeginFrameArgs& operator=(BeginFrameArgs&&);
+  BeginFrameArgs(const BeginFrameArgs&);
+  BeginFrameArgs& operator=(const BeginFrameArgs&);
+  bool operator==(const BeginFrameArgs&) const;
+  bool operator!=(const BeginFrameArgs& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_type() const { return _has_field_[1]; }
+  BeginFrameArgs_BeginFrameArgsType type() const { return type_; }
+  void set_type(BeginFrameArgs_BeginFrameArgsType value) { type_ = value; _has_field_.set(1); }
+
+  bool has_source_id() const { return _has_field_[2]; }
+  uint64_t source_id() const { return source_id_; }
+  void set_source_id(uint64_t value) { source_id_ = value; _has_field_.set(2); }
+
+  bool has_sequence_number() const { return _has_field_[3]; }
+  uint64_t sequence_number() const { return sequence_number_; }
+  void set_sequence_number(uint64_t value) { sequence_number_ = value; _has_field_.set(3); }
+
+  bool has_frame_time_us() const { return _has_field_[4]; }
+  int64_t frame_time_us() const { return frame_time_us_; }
+  void set_frame_time_us(int64_t value) { frame_time_us_ = value; _has_field_.set(4); }
+
+  bool has_deadline_us() const { return _has_field_[5]; }
+  int64_t deadline_us() const { return deadline_us_; }
+  void set_deadline_us(int64_t value) { deadline_us_ = value; _has_field_.set(5); }
+
+  bool has_interval_delta_us() const { return _has_field_[6]; }
+  int64_t interval_delta_us() const { return interval_delta_us_; }
+  void set_interval_delta_us(int64_t value) { interval_delta_us_ = value; _has_field_.set(6); }
+
+  bool has_on_critical_path() const { return _has_field_[7]; }
+  bool on_critical_path() const { return on_critical_path_; }
+  void set_on_critical_path(bool value) { on_critical_path_ = value; _has_field_.set(7); }
+
+  bool has_animate_only() const { return _has_field_[8]; }
+  bool animate_only() const { return animate_only_; }
+  void set_animate_only(bool value) { animate_only_ = value; _has_field_.set(8); }
+
+  bool has_source_location_iid() const { return _has_field_[9]; }
+  uint64_t source_location_iid() const { return source_location_iid_; }
+  void set_source_location_iid(uint64_t value) { source_location_iid_ = value; _has_field_.set(9); }
+
+  bool has_source_location() const { return _has_field_[10]; }
+  const SourceLocation& source_location() const { return *source_location_; }
+  SourceLocation* mutable_source_location() { _has_field_.set(10); return source_location_.get(); }
+
+ private:
+  BeginFrameArgs_BeginFrameArgsType type_{};
+  uint64_t source_id_{};
+  uint64_t sequence_number_{};
+  int64_t frame_time_us_{};
+  int64_t deadline_us_{};
+  int64_t interval_delta_us_{};
+  bool on_critical_path_{};
+  bool animate_only_{};
+  uint64_t source_location_iid_{};
+  ::protozero::CopyablePtr<SourceLocation> source_location_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<11> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT BeginFrameObserverState : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDroppedBeginFrameArgsFieldNumber = 1,
+    kLastBeginFrameArgsFieldNumber = 2,
+  };
+
+  BeginFrameObserverState();
+  ~BeginFrameObserverState() override;
+  BeginFrameObserverState(BeginFrameObserverState&&) noexcept;
+  BeginFrameObserverState& operator=(BeginFrameObserverState&&);
+  BeginFrameObserverState(const BeginFrameObserverState&);
+  BeginFrameObserverState& operator=(const BeginFrameObserverState&);
+  bool operator==(const BeginFrameObserverState&) const;
+  bool operator!=(const BeginFrameObserverState& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_dropped_begin_frame_args() const { return _has_field_[1]; }
+  int64_t dropped_begin_frame_args() const { return dropped_begin_frame_args_; }
+  void set_dropped_begin_frame_args(int64_t value) { dropped_begin_frame_args_ = value; _has_field_.set(1); }
+
+  bool has_last_begin_frame_args() const { return _has_field_[2]; }
+  const BeginFrameArgs& last_begin_frame_args() const { return *last_begin_frame_args_; }
+  BeginFrameArgs* mutable_last_begin_frame_args() { _has_field_.set(2); return last_begin_frame_args_.get(); }
+
+ private:
+  int64_t dropped_begin_frame_args_{};
+  ::protozero::CopyablePtr<BeginFrameArgs> last_begin_frame_args_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT BeginImplFrameArgs : public ::protozero::CppMessageObj {
+ public:
+  using TimestampsInUs = BeginImplFrameArgs_TimestampsInUs;
+  using State = BeginImplFrameArgs_State;
+  static constexpr auto BEGIN_FRAME_FINISHED = BeginImplFrameArgs_State_BEGIN_FRAME_FINISHED;
+  static constexpr auto BEGIN_FRAME_USING = BeginImplFrameArgs_State_BEGIN_FRAME_USING;
+  static constexpr auto State_MIN = BeginImplFrameArgs_State_BEGIN_FRAME_FINISHED;
+  static constexpr auto State_MAX = BeginImplFrameArgs_State_BEGIN_FRAME_USING;
+  enum FieldNumbers {
+    kUpdatedAtUsFieldNumber = 1,
+    kFinishedAtUsFieldNumber = 2,
+    kStateFieldNumber = 3,
+    kCurrentArgsFieldNumber = 4,
+    kLastArgsFieldNumber = 5,
+    kTimestampsInUsFieldNumber = 6,
+  };
+
+  BeginImplFrameArgs();
+  ~BeginImplFrameArgs() override;
+  BeginImplFrameArgs(BeginImplFrameArgs&&) noexcept;
+  BeginImplFrameArgs& operator=(BeginImplFrameArgs&&);
+  BeginImplFrameArgs(const BeginImplFrameArgs&);
+  BeginImplFrameArgs& operator=(const BeginImplFrameArgs&);
+  bool operator==(const BeginImplFrameArgs&) const;
+  bool operator!=(const BeginImplFrameArgs& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_updated_at_us() const { return _has_field_[1]; }
+  int64_t updated_at_us() const { return updated_at_us_; }
+  void set_updated_at_us(int64_t value) { updated_at_us_ = value; _has_field_.set(1); }
+
+  bool has_finished_at_us() const { return _has_field_[2]; }
+  int64_t finished_at_us() const { return finished_at_us_; }
+  void set_finished_at_us(int64_t value) { finished_at_us_ = value; _has_field_.set(2); }
+
+  bool has_state() const { return _has_field_[3]; }
+  BeginImplFrameArgs_State state() const { return state_; }
+  void set_state(BeginImplFrameArgs_State value) { state_ = value; _has_field_.set(3); }
+
+  bool has_current_args() const { return _has_field_[4]; }
+  const BeginFrameArgs& current_args() const { return *current_args_; }
+  BeginFrameArgs* mutable_current_args() { _has_field_.set(4); return current_args_.get(); }
+
+  bool has_last_args() const { return _has_field_[5]; }
+  const BeginFrameArgs& last_args() const { return *last_args_; }
+  BeginFrameArgs* mutable_last_args() { _has_field_.set(5); return last_args_.get(); }
+
+  bool has_timestamps_in_us() const { return _has_field_[6]; }
+  const BeginImplFrameArgs_TimestampsInUs& timestamps_in_us() const { return *timestamps_in_us_; }
+  BeginImplFrameArgs_TimestampsInUs* mutable_timestamps_in_us() { _has_field_.set(6); return timestamps_in_us_.get(); }
+
+ private:
+  int64_t updated_at_us_{};
+  int64_t finished_at_us_{};
+  BeginImplFrameArgs_State state_{};
+  ::protozero::CopyablePtr<BeginFrameArgs> current_args_;
+  ::protozero::CopyablePtr<BeginFrameArgs> last_args_;
+  ::protozero::CopyablePtr<BeginImplFrameArgs_TimestampsInUs> timestamps_in_us_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<7> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT BeginImplFrameArgs_TimestampsInUs : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kIntervalDeltaFieldNumber = 1,
+    kNowToDeadlineDeltaFieldNumber = 2,
+    kFrameTimeToNowDeltaFieldNumber = 3,
+    kFrameTimeToDeadlineDeltaFieldNumber = 4,
+    kNowFieldNumber = 5,
+    kFrameTimeFieldNumber = 6,
+    kDeadlineFieldNumber = 7,
+  };
+
+  BeginImplFrameArgs_TimestampsInUs();
+  ~BeginImplFrameArgs_TimestampsInUs() override;
+  BeginImplFrameArgs_TimestampsInUs(BeginImplFrameArgs_TimestampsInUs&&) noexcept;
+  BeginImplFrameArgs_TimestampsInUs& operator=(BeginImplFrameArgs_TimestampsInUs&&);
+  BeginImplFrameArgs_TimestampsInUs(const BeginImplFrameArgs_TimestampsInUs&);
+  BeginImplFrameArgs_TimestampsInUs& operator=(const BeginImplFrameArgs_TimestampsInUs&);
+  bool operator==(const BeginImplFrameArgs_TimestampsInUs&) const;
+  bool operator!=(const BeginImplFrameArgs_TimestampsInUs& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_interval_delta() const { return _has_field_[1]; }
+  int64_t interval_delta() const { return interval_delta_; }
+  void set_interval_delta(int64_t value) { interval_delta_ = value; _has_field_.set(1); }
+
+  bool has_now_to_deadline_delta() const { return _has_field_[2]; }
+  int64_t now_to_deadline_delta() const { return now_to_deadline_delta_; }
+  void set_now_to_deadline_delta(int64_t value) { now_to_deadline_delta_ = value; _has_field_.set(2); }
+
+  bool has_frame_time_to_now_delta() const { return _has_field_[3]; }
+  int64_t frame_time_to_now_delta() const { return frame_time_to_now_delta_; }
+  void set_frame_time_to_now_delta(int64_t value) { frame_time_to_now_delta_ = value; _has_field_.set(3); }
+
+  bool has_frame_time_to_deadline_delta() const { return _has_field_[4]; }
+  int64_t frame_time_to_deadline_delta() const { return frame_time_to_deadline_delta_; }
+  void set_frame_time_to_deadline_delta(int64_t value) { frame_time_to_deadline_delta_ = value; _has_field_.set(4); }
+
+  bool has_now() const { return _has_field_[5]; }
+  int64_t now() const { return now_; }
+  void set_now(int64_t value) { now_ = value; _has_field_.set(5); }
+
+  bool has_frame_time() const { return _has_field_[6]; }
+  int64_t frame_time() const { return frame_time_; }
+  void set_frame_time(int64_t value) { frame_time_ = value; _has_field_.set(6); }
+
+  bool has_deadline() const { return _has_field_[7]; }
+  int64_t deadline() const { return deadline_; }
+  void set_deadline(int64_t value) { deadline_ = value; _has_field_.set(7); }
+
+ private:
+  int64_t interval_delta_{};
+  int64_t now_to_deadline_delta_{};
+  int64_t frame_time_to_now_delta_{};
+  int64_t frame_time_to_deadline_delta_{};
+  int64_t now_{};
+  int64_t frame_time_{};
+  int64_t deadline_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<8> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ChromeCompositorStateMachine : public ::protozero::CppMessageObj {
+ public:
+  using MajorState = ChromeCompositorStateMachine_MajorState;
+  using MinorState = ChromeCompositorStateMachine_MinorState;
+  enum FieldNumbers {
+    kMajorStateFieldNumber = 1,
+    kMinorStateFieldNumber = 2,
+  };
+
+  ChromeCompositorStateMachine();
+  ~ChromeCompositorStateMachine() override;
+  ChromeCompositorStateMachine(ChromeCompositorStateMachine&&) noexcept;
+  ChromeCompositorStateMachine& operator=(ChromeCompositorStateMachine&&);
+  ChromeCompositorStateMachine(const ChromeCompositorStateMachine&);
+  ChromeCompositorStateMachine& operator=(const ChromeCompositorStateMachine&);
+  bool operator==(const ChromeCompositorStateMachine&) const;
+  bool operator!=(const ChromeCompositorStateMachine& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_major_state() const { return _has_field_[1]; }
+  const ChromeCompositorStateMachine_MajorState& major_state() const { return *major_state_; }
+  ChromeCompositorStateMachine_MajorState* mutable_major_state() { _has_field_.set(1); return major_state_.get(); }
+
+  bool has_minor_state() const { return _has_field_[2]; }
+  const ChromeCompositorStateMachine_MinorState& minor_state() const { return *minor_state_; }
+  ChromeCompositorStateMachine_MinorState* mutable_minor_state() { _has_field_.set(2); return minor_state_.get(); }
+
+ private:
+  ::protozero::CopyablePtr<ChromeCompositorStateMachine_MajorState> major_state_;
+  ::protozero::CopyablePtr<ChromeCompositorStateMachine_MinorState> minor_state_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ChromeCompositorStateMachine_MinorState : public ::protozero::CppMessageObj {
+ public:
+  using TreePriority = ChromeCompositorStateMachine_MinorState_TreePriority;
+  static constexpr auto TREE_PRIORITY_UNSPECIFIED = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_UNSPECIFIED;
+  static constexpr auto TREE_PRIORITY_SAME_PRIORITY_FOR_BOTH_TREES = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_SAME_PRIORITY_FOR_BOTH_TREES;
+  static constexpr auto TREE_PRIORITY_SMOOTHNESS_TAKES_PRIORITY = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_SMOOTHNESS_TAKES_PRIORITY;
+  static constexpr auto TREE_PRIORITY_NEW_CONTENT_TAKES_PRIORITY = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_NEW_CONTENT_TAKES_PRIORITY;
+  static constexpr auto TreePriority_MIN = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_UNSPECIFIED;
+  static constexpr auto TreePriority_MAX = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_NEW_CONTENT_TAKES_PRIORITY;
+  using ScrollHandlerState = ChromeCompositorStateMachine_MinorState_ScrollHandlerState;
+  static constexpr auto SCROLL_HANDLER_UNSPECIFIED = ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_HANDLER_UNSPECIFIED;
+  static constexpr auto SCROLL_AFFECTS_SCROLL_HANDLER = ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_AFFECTS_SCROLL_HANDLER;
+  static constexpr auto SCROLL_DOES_NOT_AFFECT_SCROLL_HANDLER = ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_DOES_NOT_AFFECT_SCROLL_HANDLER;
+  static constexpr auto ScrollHandlerState_MIN = ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_HANDLER_UNSPECIFIED;
+  static constexpr auto ScrollHandlerState_MAX = ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_DOES_NOT_AFFECT_SCROLL_HANDLER;
+  enum FieldNumbers {
+    kCommitCountFieldNumber = 1,
+    kCurrentFrameNumberFieldNumber = 2,
+    kLastFrameNumberSubmitPerformedFieldNumber = 3,
+    kLastFrameNumberDrawPerformedFieldNumber = 4,
+    kLastFrameNumberBeginMainFrameSentFieldNumber = 5,
+    kDidDrawFieldNumber = 6,
+    kDidSendBeginMainFrameForCurrentFrameFieldNumber = 7,
+    kDidNotifyBeginMainFrameNotExpectedUntilFieldNumber = 8,
+    kDidNotifyBeginMainFrameNotExpectedSoonFieldNumber = 9,
+    kWantsBeginMainFrameNotExpectedFieldNumber = 10,
+    kDidCommitDuringFrameFieldNumber = 11,
+    kDidInvalidateLayerTreeFrameSinkFieldNumber = 12,
+    kDidPerformImplSideInvalidaionFieldNumber = 13,
+    kDidPrepareTilesFieldNumber = 14,
+    kConsecutiveCheckerboardAnimationsFieldNumber = 15,
+    kPendingSubmitFramesFieldNumber = 16,
+    kSubmitFramesWithCurrentLayerTreeFrameSinkFieldNumber = 17,
+    kNeedsRedrawFieldNumber = 18,
+    kNeedsPrepareTilesFieldNumber = 19,
+    kNeedsBeginMainFrameFieldNumber = 20,
+    kNeedsOneBeginImplFrameFieldNumber = 21,
+    kVisibleFieldNumber = 22,
+    kBeginFrameSourcePausedFieldNumber = 23,
+    kCanDrawFieldNumber = 24,
+    kResourcelessDrawFieldNumber = 25,
+    kHasPendingTreeFieldNumber = 26,
+    kPendingTreeIsReadyForActivationFieldNumber = 27,
+    kActiveTreeNeedsFirstDrawFieldNumber = 28,
+    kActiveTreeIsReadyToDrawFieldNumber = 29,
+    kDidCreateAndInitializeFirstLayerTreeFrameSinkFieldNumber = 30,
+    kTreePriorityFieldNumber = 31,
+    kScrollHandlerStateFieldNumber = 32,
+    kCriticalBeginMainFrameToActivateIsFastFieldNumber = 33,
+    kMainThreadMissedLastDeadlineFieldNumber = 34,
+    kSkipNextBeginMainFrameToReduceLatencyFieldNumber = 35,
+    kVideoNeedsBeginFramesFieldNumber = 36,
+    kDeferBeginMainFrameFieldNumber = 37,
+    kLastCommitHadNoUpdatesFieldNumber = 38,
+    kDidDrawInLastFrameFieldNumber = 39,
+    kDidSubmitInLastFrameFieldNumber = 40,
+    kNeedsImplSideInvalidationFieldNumber = 41,
+    kCurrentPendingTreeIsImplSideFieldNumber = 42,
+    kPreviousPendingTreeWasImplSideFieldNumber = 43,
+    kProcessingAnimationWorkletsForActiveTreeFieldNumber = 44,
+    kProcessingAnimationWorkletsForPendingTreeFieldNumber = 45,
+    kProcessingPaintWorkletsForPendingTreeFieldNumber = 46,
+  };
+
+  ChromeCompositorStateMachine_MinorState();
+  ~ChromeCompositorStateMachine_MinorState() override;
+  ChromeCompositorStateMachine_MinorState(ChromeCompositorStateMachine_MinorState&&) noexcept;
+  ChromeCompositorStateMachine_MinorState& operator=(ChromeCompositorStateMachine_MinorState&&);
+  ChromeCompositorStateMachine_MinorState(const ChromeCompositorStateMachine_MinorState&);
+  ChromeCompositorStateMachine_MinorState& operator=(const ChromeCompositorStateMachine_MinorState&);
+  bool operator==(const ChromeCompositorStateMachine_MinorState&) const;
+  bool operator!=(const ChromeCompositorStateMachine_MinorState& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_commit_count() const { return _has_field_[1]; }
+  int32_t commit_count() const { return commit_count_; }
+  void set_commit_count(int32_t value) { commit_count_ = value; _has_field_.set(1); }
+
+  bool has_current_frame_number() const { return _has_field_[2]; }
+  int32_t current_frame_number() const { return current_frame_number_; }
+  void set_current_frame_number(int32_t value) { current_frame_number_ = value; _has_field_.set(2); }
+
+  bool has_last_frame_number_submit_performed() const { return _has_field_[3]; }
+  int32_t last_frame_number_submit_performed() const { return last_frame_number_submit_performed_; }
+  void set_last_frame_number_submit_performed(int32_t value) { last_frame_number_submit_performed_ = value; _has_field_.set(3); }
+
+  bool has_last_frame_number_draw_performed() const { return _has_field_[4]; }
+  int32_t last_frame_number_draw_performed() const { return last_frame_number_draw_performed_; }
+  void set_last_frame_number_draw_performed(int32_t value) { last_frame_number_draw_performed_ = value; _has_field_.set(4); }
+
+  bool has_last_frame_number_begin_main_frame_sent() const { return _has_field_[5]; }
+  int32_t last_frame_number_begin_main_frame_sent() const { return last_frame_number_begin_main_frame_sent_; }
+  void set_last_frame_number_begin_main_frame_sent(int32_t value) { last_frame_number_begin_main_frame_sent_ = value; _has_field_.set(5); }
+
+  bool has_did_draw() const { return _has_field_[6]; }
+  bool did_draw() const { return did_draw_; }
+  void set_did_draw(bool value) { did_draw_ = value; _has_field_.set(6); }
+
+  bool has_did_send_begin_main_frame_for_current_frame() const { return _has_field_[7]; }
+  bool did_send_begin_main_frame_for_current_frame() const { return did_send_begin_main_frame_for_current_frame_; }
+  void set_did_send_begin_main_frame_for_current_frame(bool value) { did_send_begin_main_frame_for_current_frame_ = value; _has_field_.set(7); }
+
+  bool has_did_notify_begin_main_frame_not_expected_until() const { return _has_field_[8]; }
+  bool did_notify_begin_main_frame_not_expected_until() const { return did_notify_begin_main_frame_not_expected_until_; }
+  void set_did_notify_begin_main_frame_not_expected_until(bool value) { did_notify_begin_main_frame_not_expected_until_ = value; _has_field_.set(8); }
+
+  bool has_did_notify_begin_main_frame_not_expected_soon() const { return _has_field_[9]; }
+  bool did_notify_begin_main_frame_not_expected_soon() const { return did_notify_begin_main_frame_not_expected_soon_; }
+  void set_did_notify_begin_main_frame_not_expected_soon(bool value) { did_notify_begin_main_frame_not_expected_soon_ = value; _has_field_.set(9); }
+
+  bool has_wants_begin_main_frame_not_expected() const { return _has_field_[10]; }
+  bool wants_begin_main_frame_not_expected() const { return wants_begin_main_frame_not_expected_; }
+  void set_wants_begin_main_frame_not_expected(bool value) { wants_begin_main_frame_not_expected_ = value; _has_field_.set(10); }
+
+  bool has_did_commit_during_frame() const { return _has_field_[11]; }
+  bool did_commit_during_frame() const { return did_commit_during_frame_; }
+  void set_did_commit_during_frame(bool value) { did_commit_during_frame_ = value; _has_field_.set(11); }
+
+  bool has_did_invalidate_layer_tree_frame_sink() const { return _has_field_[12]; }
+  bool did_invalidate_layer_tree_frame_sink() const { return did_invalidate_layer_tree_frame_sink_; }
+  void set_did_invalidate_layer_tree_frame_sink(bool value) { did_invalidate_layer_tree_frame_sink_ = value; _has_field_.set(12); }
+
+  bool has_did_perform_impl_side_invalidaion() const { return _has_field_[13]; }
+  bool did_perform_impl_side_invalidaion() const { return did_perform_impl_side_invalidaion_; }
+  void set_did_perform_impl_side_invalidaion(bool value) { did_perform_impl_side_invalidaion_ = value; _has_field_.set(13); }
+
+  bool has_did_prepare_tiles() const { return _has_field_[14]; }
+  bool did_prepare_tiles() const { return did_prepare_tiles_; }
+  void set_did_prepare_tiles(bool value) { did_prepare_tiles_ = value; _has_field_.set(14); }
+
+  bool has_consecutive_checkerboard_animations() const { return _has_field_[15]; }
+  int32_t consecutive_checkerboard_animations() const { return consecutive_checkerboard_animations_; }
+  void set_consecutive_checkerboard_animations(int32_t value) { consecutive_checkerboard_animations_ = value; _has_field_.set(15); }
+
+  bool has_pending_submit_frames() const { return _has_field_[16]; }
+  int32_t pending_submit_frames() const { return pending_submit_frames_; }
+  void set_pending_submit_frames(int32_t value) { pending_submit_frames_ = value; _has_field_.set(16); }
+
+  bool has_submit_frames_with_current_layer_tree_frame_sink() const { return _has_field_[17]; }
+  int32_t submit_frames_with_current_layer_tree_frame_sink() const { return submit_frames_with_current_layer_tree_frame_sink_; }
+  void set_submit_frames_with_current_layer_tree_frame_sink(int32_t value) { submit_frames_with_current_layer_tree_frame_sink_ = value; _has_field_.set(17); }
+
+  bool has_needs_redraw() const { return _has_field_[18]; }
+  bool needs_redraw() const { return needs_redraw_; }
+  void set_needs_redraw(bool value) { needs_redraw_ = value; _has_field_.set(18); }
+
+  bool has_needs_prepare_tiles() const { return _has_field_[19]; }
+  bool needs_prepare_tiles() const { return needs_prepare_tiles_; }
+  void set_needs_prepare_tiles(bool value) { needs_prepare_tiles_ = value; _has_field_.set(19); }
+
+  bool has_needs_begin_main_frame() const { return _has_field_[20]; }
+  bool needs_begin_main_frame() const { return needs_begin_main_frame_; }
+  void set_needs_begin_main_frame(bool value) { needs_begin_main_frame_ = value; _has_field_.set(20); }
+
+  bool has_needs_one_begin_impl_frame() const { return _has_field_[21]; }
+  bool needs_one_begin_impl_frame() const { return needs_one_begin_impl_frame_; }
+  void set_needs_one_begin_impl_frame(bool value) { needs_one_begin_impl_frame_ = value; _has_field_.set(21); }
+
+  bool has_visible() const { return _has_field_[22]; }
+  bool visible() const { return visible_; }
+  void set_visible(bool value) { visible_ = value; _has_field_.set(22); }
+
+  bool has_begin_frame_source_paused() const { return _has_field_[23]; }
+  bool begin_frame_source_paused() const { return begin_frame_source_paused_; }
+  void set_begin_frame_source_paused(bool value) { begin_frame_source_paused_ = value; _has_field_.set(23); }
+
+  bool has_can_draw() const { return _has_field_[24]; }
+  bool can_draw() const { return can_draw_; }
+  void set_can_draw(bool value) { can_draw_ = value; _has_field_.set(24); }
+
+  bool has_resourceless_draw() const { return _has_field_[25]; }
+  bool resourceless_draw() const { return resourceless_draw_; }
+  void set_resourceless_draw(bool value) { resourceless_draw_ = value; _has_field_.set(25); }
+
+  bool has_has_pending_tree() const { return _has_field_[26]; }
+  bool has_pending_tree() const { return has_pending_tree_; }
+  void set_has_pending_tree(bool value) { has_pending_tree_ = value; _has_field_.set(26); }
+
+  bool has_pending_tree_is_ready_for_activation() const { return _has_field_[27]; }
+  bool pending_tree_is_ready_for_activation() const { return pending_tree_is_ready_for_activation_; }
+  void set_pending_tree_is_ready_for_activation(bool value) { pending_tree_is_ready_for_activation_ = value; _has_field_.set(27); }
+
+  bool has_active_tree_needs_first_draw() const { return _has_field_[28]; }
+  bool active_tree_needs_first_draw() const { return active_tree_needs_first_draw_; }
+  void set_active_tree_needs_first_draw(bool value) { active_tree_needs_first_draw_ = value; _has_field_.set(28); }
+
+  bool has_active_tree_is_ready_to_draw() const { return _has_field_[29]; }
+  bool active_tree_is_ready_to_draw() const { return active_tree_is_ready_to_draw_; }
+  void set_active_tree_is_ready_to_draw(bool value) { active_tree_is_ready_to_draw_ = value; _has_field_.set(29); }
+
+  bool has_did_create_and_initialize_first_layer_tree_frame_sink() const { return _has_field_[30]; }
+  bool did_create_and_initialize_first_layer_tree_frame_sink() const { return did_create_and_initialize_first_layer_tree_frame_sink_; }
+  void set_did_create_and_initialize_first_layer_tree_frame_sink(bool value) { did_create_and_initialize_first_layer_tree_frame_sink_ = value; _has_field_.set(30); }
+
+  bool has_tree_priority() const { return _has_field_[31]; }
+  ChromeCompositorStateMachine_MinorState_TreePriority tree_priority() const { return tree_priority_; }
+  void set_tree_priority(ChromeCompositorStateMachine_MinorState_TreePriority value) { tree_priority_ = value; _has_field_.set(31); }
+
+  bool has_scroll_handler_state() const { return _has_field_[32]; }
+  ChromeCompositorStateMachine_MinorState_ScrollHandlerState scroll_handler_state() const { return scroll_handler_state_; }
+  void set_scroll_handler_state(ChromeCompositorStateMachine_MinorState_ScrollHandlerState value) { scroll_handler_state_ = value; _has_field_.set(32); }
+
+  bool has_critical_begin_main_frame_to_activate_is_fast() const { return _has_field_[33]; }
+  bool critical_begin_main_frame_to_activate_is_fast() const { return critical_begin_main_frame_to_activate_is_fast_; }
+  void set_critical_begin_main_frame_to_activate_is_fast(bool value) { critical_begin_main_frame_to_activate_is_fast_ = value; _has_field_.set(33); }
+
+  bool has_main_thread_missed_last_deadline() const { return _has_field_[34]; }
+  bool main_thread_missed_last_deadline() const { return main_thread_missed_last_deadline_; }
+  void set_main_thread_missed_last_deadline(bool value) { main_thread_missed_last_deadline_ = value; _has_field_.set(34); }
+
+  bool has_skip_next_begin_main_frame_to_reduce_latency() const { return _has_field_[35]; }
+  bool skip_next_begin_main_frame_to_reduce_latency() const { return skip_next_begin_main_frame_to_reduce_latency_; }
+  void set_skip_next_begin_main_frame_to_reduce_latency(bool value) { skip_next_begin_main_frame_to_reduce_latency_ = value; _has_field_.set(35); }
+
+  bool has_video_needs_begin_frames() const { return _has_field_[36]; }
+  bool video_needs_begin_frames() const { return video_needs_begin_frames_; }
+  void set_video_needs_begin_frames(bool value) { video_needs_begin_frames_ = value; _has_field_.set(36); }
+
+  bool has_defer_begin_main_frame() const { return _has_field_[37]; }
+  bool defer_begin_main_frame() const { return defer_begin_main_frame_; }
+  void set_defer_begin_main_frame(bool value) { defer_begin_main_frame_ = value; _has_field_.set(37); }
+
+  bool has_last_commit_had_no_updates() const { return _has_field_[38]; }
+  bool last_commit_had_no_updates() const { return last_commit_had_no_updates_; }
+  void set_last_commit_had_no_updates(bool value) { last_commit_had_no_updates_ = value; _has_field_.set(38); }
+
+  bool has_did_draw_in_last_frame() const { return _has_field_[39]; }
+  bool did_draw_in_last_frame() const { return did_draw_in_last_frame_; }
+  void set_did_draw_in_last_frame(bool value) { did_draw_in_last_frame_ = value; _has_field_.set(39); }
+
+  bool has_did_submit_in_last_frame() const { return _has_field_[40]; }
+  bool did_submit_in_last_frame() const { return did_submit_in_last_frame_; }
+  void set_did_submit_in_last_frame(bool value) { did_submit_in_last_frame_ = value; _has_field_.set(40); }
+
+  bool has_needs_impl_side_invalidation() const { return _has_field_[41]; }
+  bool needs_impl_side_invalidation() const { return needs_impl_side_invalidation_; }
+  void set_needs_impl_side_invalidation(bool value) { needs_impl_side_invalidation_ = value; _has_field_.set(41); }
+
+  bool has_current_pending_tree_is_impl_side() const { return _has_field_[42]; }
+  bool current_pending_tree_is_impl_side() const { return current_pending_tree_is_impl_side_; }
+  void set_current_pending_tree_is_impl_side(bool value) { current_pending_tree_is_impl_side_ = value; _has_field_.set(42); }
+
+  bool has_previous_pending_tree_was_impl_side() const { return _has_field_[43]; }
+  bool previous_pending_tree_was_impl_side() const { return previous_pending_tree_was_impl_side_; }
+  void set_previous_pending_tree_was_impl_side(bool value) { previous_pending_tree_was_impl_side_ = value; _has_field_.set(43); }
+
+  bool has_processing_animation_worklets_for_active_tree() const { return _has_field_[44]; }
+  bool processing_animation_worklets_for_active_tree() const { return processing_animation_worklets_for_active_tree_; }
+  void set_processing_animation_worklets_for_active_tree(bool value) { processing_animation_worklets_for_active_tree_ = value; _has_field_.set(44); }
+
+  bool has_processing_animation_worklets_for_pending_tree() const { return _has_field_[45]; }
+  bool processing_animation_worklets_for_pending_tree() const { return processing_animation_worklets_for_pending_tree_; }
+  void set_processing_animation_worklets_for_pending_tree(bool value) { processing_animation_worklets_for_pending_tree_ = value; _has_field_.set(45); }
+
+  bool has_processing_paint_worklets_for_pending_tree() const { return _has_field_[46]; }
+  bool processing_paint_worklets_for_pending_tree() const { return processing_paint_worklets_for_pending_tree_; }
+  void set_processing_paint_worklets_for_pending_tree(bool value) { processing_paint_worklets_for_pending_tree_ = value; _has_field_.set(46); }
+
+ private:
+  int32_t commit_count_{};
+  int32_t current_frame_number_{};
+  int32_t last_frame_number_submit_performed_{};
+  int32_t last_frame_number_draw_performed_{};
+  int32_t last_frame_number_begin_main_frame_sent_{};
+  bool did_draw_{};
+  bool did_send_begin_main_frame_for_current_frame_{};
+  bool did_notify_begin_main_frame_not_expected_until_{};
+  bool did_notify_begin_main_frame_not_expected_soon_{};
+  bool wants_begin_main_frame_not_expected_{};
+  bool did_commit_during_frame_{};
+  bool did_invalidate_layer_tree_frame_sink_{};
+  bool did_perform_impl_side_invalidaion_{};
+  bool did_prepare_tiles_{};
+  int32_t consecutive_checkerboard_animations_{};
+  int32_t pending_submit_frames_{};
+  int32_t submit_frames_with_current_layer_tree_frame_sink_{};
+  bool needs_redraw_{};
+  bool needs_prepare_tiles_{};
+  bool needs_begin_main_frame_{};
+  bool needs_one_begin_impl_frame_{};
+  bool visible_{};
+  bool begin_frame_source_paused_{};
+  bool can_draw_{};
+  bool resourceless_draw_{};
+  bool has_pending_tree_{};
+  bool pending_tree_is_ready_for_activation_{};
+  bool active_tree_needs_first_draw_{};
+  bool active_tree_is_ready_to_draw_{};
+  bool did_create_and_initialize_first_layer_tree_frame_sink_{};
+  ChromeCompositorStateMachine_MinorState_TreePriority tree_priority_{};
+  ChromeCompositorStateMachine_MinorState_ScrollHandlerState scroll_handler_state_{};
+  bool critical_begin_main_frame_to_activate_is_fast_{};
+  bool main_thread_missed_last_deadline_{};
+  bool skip_next_begin_main_frame_to_reduce_latency_{};
+  bool video_needs_begin_frames_{};
+  bool defer_begin_main_frame_{};
+  bool last_commit_had_no_updates_{};
+  bool did_draw_in_last_frame_{};
+  bool did_submit_in_last_frame_{};
+  bool needs_impl_side_invalidation_{};
+  bool current_pending_tree_is_impl_side_{};
+  bool previous_pending_tree_was_impl_side_{};
+  bool processing_animation_worklets_for_active_tree_{};
+  bool processing_animation_worklets_for_pending_tree_{};
+  bool processing_paint_worklets_for_pending_tree_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<47> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ChromeCompositorStateMachine_MajorState : public ::protozero::CppMessageObj {
+ public:
+  using BeginImplFrameState = ChromeCompositorStateMachine_MajorState_BeginImplFrameState;
+  static constexpr auto BEGIN_IMPL_FRAME_UNSPECIFIED = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_UNSPECIFIED;
+  static constexpr auto BEGIN_IMPL_FRAME_IDLE = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_IDLE;
+  static constexpr auto BEGIN_IMPL_FRAME_INSIDE_BEGIN_FRAME = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_INSIDE_BEGIN_FRAME;
+  static constexpr auto BEGIN_IMPL_FRAME_INSIDE_DEADLINE = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_INSIDE_DEADLINE;
+  static constexpr auto BeginImplFrameState_MIN = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_UNSPECIFIED;
+  static constexpr auto BeginImplFrameState_MAX = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_INSIDE_DEADLINE;
+  using BeginMainFrameState = ChromeCompositorStateMachine_MajorState_BeginMainFrameState;
+  static constexpr auto BEGIN_MAIN_FRAME_UNSPECIFIED = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_UNSPECIFIED;
+  static constexpr auto BEGIN_MAIN_FRAME_IDLE = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_IDLE;
+  static constexpr auto BEGIN_MAIN_FRAME_SENT = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_SENT;
+  static constexpr auto BEGIN_MAIN_FRAME_READY_TO_COMMIT = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_READY_TO_COMMIT;
+  static constexpr auto BeginMainFrameState_MIN = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_UNSPECIFIED;
+  static constexpr auto BeginMainFrameState_MAX = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_READY_TO_COMMIT;
+  using LayerTreeFrameSinkState = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState;
+  static constexpr auto LAYER_TREE_FRAME_UNSPECIFIED = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_UNSPECIFIED;
+  static constexpr auto LAYER_TREE_FRAME_NONE = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_NONE;
+  static constexpr auto LAYER_TREE_FRAME_ACTIVE = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_ACTIVE;
+  static constexpr auto LAYER_TREE_FRAME_CREATING = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_CREATING;
+  static constexpr auto LAYER_TREE_FRAME_WAITING_FOR_FIRST_COMMIT = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_WAITING_FOR_FIRST_COMMIT;
+  static constexpr auto LAYER_TREE_FRAME_WAITING_FOR_FIRST_ACTIVATION = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_WAITING_FOR_FIRST_ACTIVATION;
+  static constexpr auto LayerTreeFrameSinkState_MIN = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_UNSPECIFIED;
+  static constexpr auto LayerTreeFrameSinkState_MAX = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_WAITING_FOR_FIRST_ACTIVATION;
+  using ForcedRedrawOnTimeoutState = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState;
+  static constexpr auto FORCED_REDRAW_UNSPECIFIED = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_UNSPECIFIED;
+  static constexpr auto FORCED_REDRAW_IDLE = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_IDLE;
+  static constexpr auto FORCED_REDRAW_WAITING_FOR_COMMIT = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_COMMIT;
+  static constexpr auto FORCED_REDRAW_WAITING_FOR_ACTIVATION = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_ACTIVATION;
+  static constexpr auto FORCED_REDRAW_WAITING_FOR_DRAW = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_DRAW;
+  static constexpr auto ForcedRedrawOnTimeoutState_MIN = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_UNSPECIFIED;
+  static constexpr auto ForcedRedrawOnTimeoutState_MAX = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_DRAW;
+  enum FieldNumbers {
+    kNextActionFieldNumber = 1,
+    kBeginImplFrameStateFieldNumber = 2,
+    kBeginMainFrameStateFieldNumber = 3,
+    kLayerTreeFrameSinkStateFieldNumber = 4,
+    kForcedRedrawStateFieldNumber = 5,
+  };
+
+  ChromeCompositorStateMachine_MajorState();
+  ~ChromeCompositorStateMachine_MajorState() override;
+  ChromeCompositorStateMachine_MajorState(ChromeCompositorStateMachine_MajorState&&) noexcept;
+  ChromeCompositorStateMachine_MajorState& operator=(ChromeCompositorStateMachine_MajorState&&);
+  ChromeCompositorStateMachine_MajorState(const ChromeCompositorStateMachine_MajorState&);
+  ChromeCompositorStateMachine_MajorState& operator=(const ChromeCompositorStateMachine_MajorState&);
+  bool operator==(const ChromeCompositorStateMachine_MajorState&) const;
+  bool operator!=(const ChromeCompositorStateMachine_MajorState& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_next_action() const { return _has_field_[1]; }
+  ChromeCompositorSchedulerAction next_action() const { return next_action_; }
+  void set_next_action(ChromeCompositorSchedulerAction value) { next_action_ = value; _has_field_.set(1); }
+
+  bool has_begin_impl_frame_state() const { return _has_field_[2]; }
+  ChromeCompositorStateMachine_MajorState_BeginImplFrameState begin_impl_frame_state() const { return begin_impl_frame_state_; }
+  void set_begin_impl_frame_state(ChromeCompositorStateMachine_MajorState_BeginImplFrameState value) { begin_impl_frame_state_ = value; _has_field_.set(2); }
+
+  bool has_begin_main_frame_state() const { return _has_field_[3]; }
+  ChromeCompositorStateMachine_MajorState_BeginMainFrameState begin_main_frame_state() const { return begin_main_frame_state_; }
+  void set_begin_main_frame_state(ChromeCompositorStateMachine_MajorState_BeginMainFrameState value) { begin_main_frame_state_ = value; _has_field_.set(3); }
+
+  bool has_layer_tree_frame_sink_state() const { return _has_field_[4]; }
+  ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState layer_tree_frame_sink_state() const { return layer_tree_frame_sink_state_; }
+  void set_layer_tree_frame_sink_state(ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState value) { layer_tree_frame_sink_state_ = value; _has_field_.set(4); }
+
+  bool has_forced_redraw_state() const { return _has_field_[5]; }
+  ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState forced_redraw_state() const { return forced_redraw_state_; }
+  void set_forced_redraw_state(ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState value) { forced_redraw_state_ = value; _has_field_.set(5); }
+
+ private:
+  ChromeCompositorSchedulerAction next_action_{};
+  ChromeCompositorStateMachine_MajorState_BeginImplFrameState begin_impl_frame_state_{};
+  ChromeCompositorStateMachine_MajorState_BeginMainFrameState begin_main_frame_state_{};
+  ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState layer_tree_frame_sink_state_{};
+  ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState forced_redraw_state_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<6> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ChromeCompositorSchedulerState : public ::protozero::CppMessageObj {
+ public:
+  using BeginImplFrameDeadlineMode = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode;
+  static constexpr auto DEADLINE_MODE_UNSPECIFIED = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_UNSPECIFIED;
+  static constexpr auto DEADLINE_MODE_NONE = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_NONE;
+  static constexpr auto DEADLINE_MODE_IMMEDIATE = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_IMMEDIATE;
+  static constexpr auto DEADLINE_MODE_REGULAR = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_REGULAR;
+  static constexpr auto DEADLINE_MODE_LATE = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_LATE;
+  static constexpr auto DEADLINE_MODE_BLOCKED = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_BLOCKED;
+  static constexpr auto BeginImplFrameDeadlineMode_MIN = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_UNSPECIFIED;
+  static constexpr auto BeginImplFrameDeadlineMode_MAX = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_BLOCKED;
+  enum FieldNumbers {
+    kStateMachineFieldNumber = 1,
+    kObservingBeginFrameSourceFieldNumber = 2,
+    kBeginImplFrameDeadlineTaskFieldNumber = 3,
+    kPendingBeginFrameTaskFieldNumber = 4,
+    kSkippedLastFrameMissedExceededDeadlineFieldNumber = 5,
+    kSkippedLastFrameToReduceLatencyFieldNumber = 6,
+    kInsideActionFieldNumber = 7,
+    kDeadlineModeFieldNumber = 8,
+    kDeadlineUsFieldNumber = 9,
+    kDeadlineScheduledAtUsFieldNumber = 10,
+    kNowUsFieldNumber = 11,
+    kNowToDeadlineDeltaUsFieldNumber = 12,
+    kNowToDeadlineScheduledAtDeltaUsFieldNumber = 13,
+    kBeginImplFrameArgsFieldNumber = 14,
+    kBeginFrameObserverStateFieldNumber = 15,
+    kBeginFrameSourceStateFieldNumber = 16,
+    kCompositorTimingHistoryFieldNumber = 17,
+  };
+
+  ChromeCompositorSchedulerState();
+  ~ChromeCompositorSchedulerState() override;
+  ChromeCompositorSchedulerState(ChromeCompositorSchedulerState&&) noexcept;
+  ChromeCompositorSchedulerState& operator=(ChromeCompositorSchedulerState&&);
+  ChromeCompositorSchedulerState(const ChromeCompositorSchedulerState&);
+  ChromeCompositorSchedulerState& operator=(const ChromeCompositorSchedulerState&);
+  bool operator==(const ChromeCompositorSchedulerState&) const;
+  bool operator!=(const ChromeCompositorSchedulerState& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_state_machine() const { return _has_field_[1]; }
+  const ChromeCompositorStateMachine& state_machine() const { return *state_machine_; }
+  ChromeCompositorStateMachine* mutable_state_machine() { _has_field_.set(1); return state_machine_.get(); }
+
+  bool has_observing_begin_frame_source() const { return _has_field_[2]; }
+  bool observing_begin_frame_source() const { return observing_begin_frame_source_; }
+  void set_observing_begin_frame_source(bool value) { observing_begin_frame_source_ = value; _has_field_.set(2); }
+
+  bool has_begin_impl_frame_deadline_task() const { return _has_field_[3]; }
+  bool begin_impl_frame_deadline_task() const { return begin_impl_frame_deadline_task_; }
+  void set_begin_impl_frame_deadline_task(bool value) { begin_impl_frame_deadline_task_ = value; _has_field_.set(3); }
+
+  bool has_pending_begin_frame_task() const { return _has_field_[4]; }
+  bool pending_begin_frame_task() const { return pending_begin_frame_task_; }
+  void set_pending_begin_frame_task(bool value) { pending_begin_frame_task_ = value; _has_field_.set(4); }
+
+  bool has_skipped_last_frame_missed_exceeded_deadline() const { return _has_field_[5]; }
+  bool skipped_last_frame_missed_exceeded_deadline() const { return skipped_last_frame_missed_exceeded_deadline_; }
+  void set_skipped_last_frame_missed_exceeded_deadline(bool value) { skipped_last_frame_missed_exceeded_deadline_ = value; _has_field_.set(5); }
+
+  bool has_skipped_last_frame_to_reduce_latency() const { return _has_field_[6]; }
+  bool skipped_last_frame_to_reduce_latency() const { return skipped_last_frame_to_reduce_latency_; }
+  void set_skipped_last_frame_to_reduce_latency(bool value) { skipped_last_frame_to_reduce_latency_ = value; _has_field_.set(6); }
+
+  bool has_inside_action() const { return _has_field_[7]; }
+  ChromeCompositorSchedulerAction inside_action() const { return inside_action_; }
+  void set_inside_action(ChromeCompositorSchedulerAction value) { inside_action_ = value; _has_field_.set(7); }
+
+  bool has_deadline_mode() const { return _has_field_[8]; }
+  ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode deadline_mode() const { return deadline_mode_; }
+  void set_deadline_mode(ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode value) { deadline_mode_ = value; _has_field_.set(8); }
+
+  bool has_deadline_us() const { return _has_field_[9]; }
+  int64_t deadline_us() const { return deadline_us_; }
+  void set_deadline_us(int64_t value) { deadline_us_ = value; _has_field_.set(9); }
+
+  bool has_deadline_scheduled_at_us() const { return _has_field_[10]; }
+  int64_t deadline_scheduled_at_us() const { return deadline_scheduled_at_us_; }
+  void set_deadline_scheduled_at_us(int64_t value) { deadline_scheduled_at_us_ = value; _has_field_.set(10); }
+
+  bool has_now_us() const { return _has_field_[11]; }
+  int64_t now_us() const { return now_us_; }
+  void set_now_us(int64_t value) { now_us_ = value; _has_field_.set(11); }
+
+  bool has_now_to_deadline_delta_us() const { return _has_field_[12]; }
+  int64_t now_to_deadline_delta_us() const { return now_to_deadline_delta_us_; }
+  void set_now_to_deadline_delta_us(int64_t value) { now_to_deadline_delta_us_ = value; _has_field_.set(12); }
+
+  bool has_now_to_deadline_scheduled_at_delta_us() const { return _has_field_[13]; }
+  int64_t now_to_deadline_scheduled_at_delta_us() const { return now_to_deadline_scheduled_at_delta_us_; }
+  void set_now_to_deadline_scheduled_at_delta_us(int64_t value) { now_to_deadline_scheduled_at_delta_us_ = value; _has_field_.set(13); }
+
+  bool has_begin_impl_frame_args() const { return _has_field_[14]; }
+  const BeginImplFrameArgs& begin_impl_frame_args() const { return *begin_impl_frame_args_; }
+  BeginImplFrameArgs* mutable_begin_impl_frame_args() { _has_field_.set(14); return begin_impl_frame_args_.get(); }
+
+  bool has_begin_frame_observer_state() const { return _has_field_[15]; }
+  const BeginFrameObserverState& begin_frame_observer_state() const { return *begin_frame_observer_state_; }
+  BeginFrameObserverState* mutable_begin_frame_observer_state() { _has_field_.set(15); return begin_frame_observer_state_.get(); }
+
+  bool has_begin_frame_source_state() const { return _has_field_[16]; }
+  const BeginFrameSourceState& begin_frame_source_state() const { return *begin_frame_source_state_; }
+  BeginFrameSourceState* mutable_begin_frame_source_state() { _has_field_.set(16); return begin_frame_source_state_.get(); }
+
+  bool has_compositor_timing_history() const { return _has_field_[17]; }
+  const CompositorTimingHistory& compositor_timing_history() const { return *compositor_timing_history_; }
+  CompositorTimingHistory* mutable_compositor_timing_history() { _has_field_.set(17); return compositor_timing_history_.get(); }
+
+ private:
+  ::protozero::CopyablePtr<ChromeCompositorStateMachine> state_machine_;
+  bool observing_begin_frame_source_{};
+  bool begin_impl_frame_deadline_task_{};
+  bool pending_begin_frame_task_{};
+  bool skipped_last_frame_missed_exceeded_deadline_{};
+  bool skipped_last_frame_to_reduce_latency_{};
+  ChromeCompositorSchedulerAction inside_action_{};
+  ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode deadline_mode_{};
+  int64_t deadline_us_{};
+  int64_t deadline_scheduled_at_us_{};
+  int64_t now_us_{};
+  int64_t now_to_deadline_delta_us_{};
+  int64_t now_to_deadline_scheduled_at_delta_us_{};
+  ::protozero::CopyablePtr<BeginImplFrameArgs> begin_impl_frame_args_;
+  ::protozero::CopyablePtr<BeginFrameObserverState> begin_frame_observer_state_;
+  ::protozero::CopyablePtr<BeginFrameSourceState> begin_frame_source_state_;
+  ::protozero::CopyablePtr<CompositorTimingHistory> compositor_timing_history_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<18> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_COMPOSITOR_SCHEDULER_STATE_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/source_location.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_SOURCE_LOCATION_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_SOURCE_LOCATION_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class SourceLocation;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT SourceLocation : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kIidFieldNumber = 1,
+    kFileNameFieldNumber = 2,
+    kFunctionNameFieldNumber = 3,
+    kLineNumberFieldNumber = 4,
+  };
+
+  SourceLocation();
+  ~SourceLocation() override;
+  SourceLocation(SourceLocation&&) noexcept;
+  SourceLocation& operator=(SourceLocation&&);
+  SourceLocation(const SourceLocation&);
+  SourceLocation& operator=(const SourceLocation&);
+  bool operator==(const SourceLocation&) const;
+  bool operator!=(const SourceLocation& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_iid() const { return _has_field_[1]; }
+  uint64_t iid() const { return iid_; }
+  void set_iid(uint64_t value) { iid_ = value; _has_field_.set(1); }
+
+  bool has_file_name() const { return _has_field_[2]; }
+  const std::string& file_name() const { return file_name_; }
+  void set_file_name(const std::string& value) { file_name_ = value; _has_field_.set(2); }
+
+  bool has_function_name() const { return _has_field_[3]; }
+  const std::string& function_name() const { return function_name_; }
+  void set_function_name(const std::string& value) { function_name_ = value; _has_field_.set(3); }
+
+  bool has_line_number() const { return _has_field_[4]; }
+  uint32_t line_number() const { return line_number_; }
+  void set_line_number(uint32_t value) { line_number_ = value; _has_field_.set(4); }
+
+ private:
+  uint64_t iid_{};
+  std::string file_name_{};
+  std::string function_name_{};
+  uint32_t line_number_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<5> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_SOURCE_LOCATION_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_compositor_scheduler_state.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/source_location.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+CompositorTimingHistory::CompositorTimingHistory() = default;
+CompositorTimingHistory::~CompositorTimingHistory() = default;
+CompositorTimingHistory::CompositorTimingHistory(const CompositorTimingHistory&) = default;
+CompositorTimingHistory& CompositorTimingHistory::operator=(const CompositorTimingHistory&) = default;
+CompositorTimingHistory::CompositorTimingHistory(CompositorTimingHistory&&) noexcept = default;
+CompositorTimingHistory& CompositorTimingHistory::operator=(CompositorTimingHistory&&) = default;
+
+bool CompositorTimingHistory::operator==(const CompositorTimingHistory& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && begin_main_frame_queue_critical_estimate_delta_us_ == other.begin_main_frame_queue_critical_estimate_delta_us_
+   && begin_main_frame_queue_not_critical_estimate_delta_us_ == other.begin_main_frame_queue_not_critical_estimate_delta_us_
+   && begin_main_frame_start_to_ready_to_commit_estimate_delta_us_ == other.begin_main_frame_start_to_ready_to_commit_estimate_delta_us_
+   && commit_to_ready_to_activate_estimate_delta_us_ == other.commit_to_ready_to_activate_estimate_delta_us_
+   && prepare_tiles_estimate_delta_us_ == other.prepare_tiles_estimate_delta_us_
+   && activate_estimate_delta_us_ == other.activate_estimate_delta_us_
+   && draw_estimate_delta_us_ == other.draw_estimate_delta_us_;
+}
+
+bool CompositorTimingHistory::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* begin_main_frame_queue_critical_estimate_delta_us */:
+        field.get(&begin_main_frame_queue_critical_estimate_delta_us_);
+        break;
+      case 2 /* begin_main_frame_queue_not_critical_estimate_delta_us */:
+        field.get(&begin_main_frame_queue_not_critical_estimate_delta_us_);
+        break;
+      case 3 /* begin_main_frame_start_to_ready_to_commit_estimate_delta_us */:
+        field.get(&begin_main_frame_start_to_ready_to_commit_estimate_delta_us_);
+        break;
+      case 4 /* commit_to_ready_to_activate_estimate_delta_us */:
+        field.get(&commit_to_ready_to_activate_estimate_delta_us_);
+        break;
+      case 5 /* prepare_tiles_estimate_delta_us */:
+        field.get(&prepare_tiles_estimate_delta_us_);
+        break;
+      case 6 /* activate_estimate_delta_us */:
+        field.get(&activate_estimate_delta_us_);
+        break;
+      case 7 /* draw_estimate_delta_us */:
+        field.get(&draw_estimate_delta_us_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string CompositorTimingHistory::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> CompositorTimingHistory::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void CompositorTimingHistory::Serialize(::protozero::Message* msg) const {
+  // Field 1: begin_main_frame_queue_critical_estimate_delta_us
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, begin_main_frame_queue_critical_estimate_delta_us_);
+  }
+
+  // Field 2: begin_main_frame_queue_not_critical_estimate_delta_us
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, begin_main_frame_queue_not_critical_estimate_delta_us_);
+  }
+
+  // Field 3: begin_main_frame_start_to_ready_to_commit_estimate_delta_us
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, begin_main_frame_start_to_ready_to_commit_estimate_delta_us_);
+  }
+
+  // Field 4: commit_to_ready_to_activate_estimate_delta_us
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, commit_to_ready_to_activate_estimate_delta_us_);
+  }
+
+  // Field 5: prepare_tiles_estimate_delta_us
+  if (_has_field_[5]) {
+    msg->AppendVarInt(5, prepare_tiles_estimate_delta_us_);
+  }
+
+  // Field 6: activate_estimate_delta_us
+  if (_has_field_[6]) {
+    msg->AppendVarInt(6, activate_estimate_delta_us_);
+  }
+
+  // Field 7: draw_estimate_delta_us
+  if (_has_field_[7]) {
+    msg->AppendVarInt(7, draw_estimate_delta_us_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+BeginFrameSourceState::BeginFrameSourceState() = default;
+BeginFrameSourceState::~BeginFrameSourceState() = default;
+BeginFrameSourceState::BeginFrameSourceState(const BeginFrameSourceState&) = default;
+BeginFrameSourceState& BeginFrameSourceState::operator=(const BeginFrameSourceState&) = default;
+BeginFrameSourceState::BeginFrameSourceState(BeginFrameSourceState&&) noexcept = default;
+BeginFrameSourceState& BeginFrameSourceState::operator=(BeginFrameSourceState&&) = default;
+
+bool BeginFrameSourceState::operator==(const BeginFrameSourceState& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && source_id_ == other.source_id_
+   && paused_ == other.paused_
+   && num_observers_ == other.num_observers_
+   && last_begin_frame_args_ == other.last_begin_frame_args_;
+}
+
+bool BeginFrameSourceState::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* source_id */:
+        field.get(&source_id_);
+        break;
+      case 2 /* paused */:
+        field.get(&paused_);
+        break;
+      case 3 /* num_observers */:
+        field.get(&num_observers_);
+        break;
+      case 4 /* last_begin_frame_args */:
+        (*last_begin_frame_args_).ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string BeginFrameSourceState::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> BeginFrameSourceState::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void BeginFrameSourceState::Serialize(::protozero::Message* msg) const {
+  // Field 1: source_id
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, source_id_);
+  }
+
+  // Field 2: paused
+  if (_has_field_[2]) {
+    msg->AppendTinyVarInt(2, paused_);
+  }
+
+  // Field 3: num_observers
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, num_observers_);
+  }
+
+  // Field 4: last_begin_frame_args
+  if (_has_field_[4]) {
+    (*last_begin_frame_args_).Serialize(msg->BeginNestedMessage<::protozero::Message>(4));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+BeginFrameArgs::BeginFrameArgs() = default;
+BeginFrameArgs::~BeginFrameArgs() = default;
+BeginFrameArgs::BeginFrameArgs(const BeginFrameArgs&) = default;
+BeginFrameArgs& BeginFrameArgs::operator=(const BeginFrameArgs&) = default;
+BeginFrameArgs::BeginFrameArgs(BeginFrameArgs&&) noexcept = default;
+BeginFrameArgs& BeginFrameArgs::operator=(BeginFrameArgs&&) = default;
+
+bool BeginFrameArgs::operator==(const BeginFrameArgs& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && type_ == other.type_
+   && source_id_ == other.source_id_
+   && sequence_number_ == other.sequence_number_
+   && frame_time_us_ == other.frame_time_us_
+   && deadline_us_ == other.deadline_us_
+   && interval_delta_us_ == other.interval_delta_us_
+   && on_critical_path_ == other.on_critical_path_
+   && animate_only_ == other.animate_only_
+   && source_location_iid_ == other.source_location_iid_
+   && source_location_ == other.source_location_;
+}
+
+bool BeginFrameArgs::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* type */:
+        field.get(&type_);
+        break;
+      case 2 /* source_id */:
+        field.get(&source_id_);
+        break;
+      case 3 /* sequence_number */:
+        field.get(&sequence_number_);
+        break;
+      case 4 /* frame_time_us */:
+        field.get(&frame_time_us_);
+        break;
+      case 5 /* deadline_us */:
+        field.get(&deadline_us_);
+        break;
+      case 6 /* interval_delta_us */:
+        field.get(&interval_delta_us_);
+        break;
+      case 7 /* on_critical_path */:
+        field.get(&on_critical_path_);
+        break;
+      case 8 /* animate_only */:
+        field.get(&animate_only_);
+        break;
+      case 9 /* source_location_iid */:
+        field.get(&source_location_iid_);
+        break;
+      case 10 /* source_location */:
+        (*source_location_).ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string BeginFrameArgs::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> BeginFrameArgs::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void BeginFrameArgs::Serialize(::protozero::Message* msg) const {
+  // Field 1: type
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, type_);
+  }
+
+  // Field 2: source_id
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, source_id_);
+  }
+
+  // Field 3: sequence_number
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, sequence_number_);
+  }
+
+  // Field 4: frame_time_us
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, frame_time_us_);
+  }
+
+  // Field 5: deadline_us
+  if (_has_field_[5]) {
+    msg->AppendVarInt(5, deadline_us_);
+  }
+
+  // Field 6: interval_delta_us
+  if (_has_field_[6]) {
+    msg->AppendVarInt(6, interval_delta_us_);
+  }
+
+  // Field 7: on_critical_path
+  if (_has_field_[7]) {
+    msg->AppendTinyVarInt(7, on_critical_path_);
+  }
+
+  // Field 8: animate_only
+  if (_has_field_[8]) {
+    msg->AppendTinyVarInt(8, animate_only_);
+  }
+
+  // Field 9: source_location_iid
+  if (_has_field_[9]) {
+    msg->AppendVarInt(9, source_location_iid_);
+  }
+
+  // Field 10: source_location
+  if (_has_field_[10]) {
+    (*source_location_).Serialize(msg->BeginNestedMessage<::protozero::Message>(10));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+BeginFrameObserverState::BeginFrameObserverState() = default;
+BeginFrameObserverState::~BeginFrameObserverState() = default;
+BeginFrameObserverState::BeginFrameObserverState(const BeginFrameObserverState&) = default;
+BeginFrameObserverState& BeginFrameObserverState::operator=(const BeginFrameObserverState&) = default;
+BeginFrameObserverState::BeginFrameObserverState(BeginFrameObserverState&&) noexcept = default;
+BeginFrameObserverState& BeginFrameObserverState::operator=(BeginFrameObserverState&&) = default;
+
+bool BeginFrameObserverState::operator==(const BeginFrameObserverState& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && dropped_begin_frame_args_ == other.dropped_begin_frame_args_
+   && last_begin_frame_args_ == other.last_begin_frame_args_;
+}
+
+bool BeginFrameObserverState::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* dropped_begin_frame_args */:
+        field.get(&dropped_begin_frame_args_);
+        break;
+      case 2 /* last_begin_frame_args */:
+        (*last_begin_frame_args_).ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string BeginFrameObserverState::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> BeginFrameObserverState::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void BeginFrameObserverState::Serialize(::protozero::Message* msg) const {
+  // Field 1: dropped_begin_frame_args
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, dropped_begin_frame_args_);
+  }
+
+  // Field 2: last_begin_frame_args
+  if (_has_field_[2]) {
+    (*last_begin_frame_args_).Serialize(msg->BeginNestedMessage<::protozero::Message>(2));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+BeginImplFrameArgs::BeginImplFrameArgs() = default;
+BeginImplFrameArgs::~BeginImplFrameArgs() = default;
+BeginImplFrameArgs::BeginImplFrameArgs(const BeginImplFrameArgs&) = default;
+BeginImplFrameArgs& BeginImplFrameArgs::operator=(const BeginImplFrameArgs&) = default;
+BeginImplFrameArgs::BeginImplFrameArgs(BeginImplFrameArgs&&) noexcept = default;
+BeginImplFrameArgs& BeginImplFrameArgs::operator=(BeginImplFrameArgs&&) = default;
+
+bool BeginImplFrameArgs::operator==(const BeginImplFrameArgs& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && updated_at_us_ == other.updated_at_us_
+   && finished_at_us_ == other.finished_at_us_
+   && state_ == other.state_
+   && current_args_ == other.current_args_
+   && last_args_ == other.last_args_
+   && timestamps_in_us_ == other.timestamps_in_us_;
+}
+
+bool BeginImplFrameArgs::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* updated_at_us */:
+        field.get(&updated_at_us_);
+        break;
+      case 2 /* finished_at_us */:
+        field.get(&finished_at_us_);
+        break;
+      case 3 /* state */:
+        field.get(&state_);
+        break;
+      case 4 /* current_args */:
+        (*current_args_).ParseFromArray(field.data(), field.size());
+        break;
+      case 5 /* last_args */:
+        (*last_args_).ParseFromArray(field.data(), field.size());
+        break;
+      case 6 /* timestamps_in_us */:
+        (*timestamps_in_us_).ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string BeginImplFrameArgs::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> BeginImplFrameArgs::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void BeginImplFrameArgs::Serialize(::protozero::Message* msg) const {
+  // Field 1: updated_at_us
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, updated_at_us_);
+  }
+
+  // Field 2: finished_at_us
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, finished_at_us_);
+  }
+
+  // Field 3: state
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, state_);
+  }
+
+  // Field 4: current_args
+  if (_has_field_[4]) {
+    (*current_args_).Serialize(msg->BeginNestedMessage<::protozero::Message>(4));
+  }
+
+  // Field 5: last_args
+  if (_has_field_[5]) {
+    (*last_args_).Serialize(msg->BeginNestedMessage<::protozero::Message>(5));
+  }
+
+  // Field 6: timestamps_in_us
+  if (_has_field_[6]) {
+    (*timestamps_in_us_).Serialize(msg->BeginNestedMessage<::protozero::Message>(6));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+BeginImplFrameArgs_TimestampsInUs::BeginImplFrameArgs_TimestampsInUs() = default;
+BeginImplFrameArgs_TimestampsInUs::~BeginImplFrameArgs_TimestampsInUs() = default;
+BeginImplFrameArgs_TimestampsInUs::BeginImplFrameArgs_TimestampsInUs(const BeginImplFrameArgs_TimestampsInUs&) = default;
+BeginImplFrameArgs_TimestampsInUs& BeginImplFrameArgs_TimestampsInUs::operator=(const BeginImplFrameArgs_TimestampsInUs&) = default;
+BeginImplFrameArgs_TimestampsInUs::BeginImplFrameArgs_TimestampsInUs(BeginImplFrameArgs_TimestampsInUs&&) noexcept = default;
+BeginImplFrameArgs_TimestampsInUs& BeginImplFrameArgs_TimestampsInUs::operator=(BeginImplFrameArgs_TimestampsInUs&&) = default;
+
+bool BeginImplFrameArgs_TimestampsInUs::operator==(const BeginImplFrameArgs_TimestampsInUs& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && interval_delta_ == other.interval_delta_
+   && now_to_deadline_delta_ == other.now_to_deadline_delta_
+   && frame_time_to_now_delta_ == other.frame_time_to_now_delta_
+   && frame_time_to_deadline_delta_ == other.frame_time_to_deadline_delta_
+   && now_ == other.now_
+   && frame_time_ == other.frame_time_
+   && deadline_ == other.deadline_;
+}
+
+bool BeginImplFrameArgs_TimestampsInUs::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* interval_delta */:
+        field.get(&interval_delta_);
+        break;
+      case 2 /* now_to_deadline_delta */:
+        field.get(&now_to_deadline_delta_);
+        break;
+      case 3 /* frame_time_to_now_delta */:
+        field.get(&frame_time_to_now_delta_);
+        break;
+      case 4 /* frame_time_to_deadline_delta */:
+        field.get(&frame_time_to_deadline_delta_);
+        break;
+      case 5 /* now */:
+        field.get(&now_);
+        break;
+      case 6 /* frame_time */:
+        field.get(&frame_time_);
+        break;
+      case 7 /* deadline */:
+        field.get(&deadline_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string BeginImplFrameArgs_TimestampsInUs::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> BeginImplFrameArgs_TimestampsInUs::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void BeginImplFrameArgs_TimestampsInUs::Serialize(::protozero::Message* msg) const {
+  // Field 1: interval_delta
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, interval_delta_);
+  }
+
+  // Field 2: now_to_deadline_delta
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, now_to_deadline_delta_);
+  }
+
+  // Field 3: frame_time_to_now_delta
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, frame_time_to_now_delta_);
+  }
+
+  // Field 4: frame_time_to_deadline_delta
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, frame_time_to_deadline_delta_);
+  }
+
+  // Field 5: now
+  if (_has_field_[5]) {
+    msg->AppendVarInt(5, now_);
+  }
+
+  // Field 6: frame_time
+  if (_has_field_[6]) {
+    msg->AppendVarInt(6, frame_time_);
+  }
+
+  // Field 7: deadline
+  if (_has_field_[7]) {
+    msg->AppendVarInt(7, deadline_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+ChromeCompositorStateMachine::ChromeCompositorStateMachine() = default;
+ChromeCompositorStateMachine::~ChromeCompositorStateMachine() = default;
+ChromeCompositorStateMachine::ChromeCompositorStateMachine(const ChromeCompositorStateMachine&) = default;
+ChromeCompositorStateMachine& ChromeCompositorStateMachine::operator=(const ChromeCompositorStateMachine&) = default;
+ChromeCompositorStateMachine::ChromeCompositorStateMachine(ChromeCompositorStateMachine&&) noexcept = default;
+ChromeCompositorStateMachine& ChromeCompositorStateMachine::operator=(ChromeCompositorStateMachine&&) = default;
+
+bool ChromeCompositorStateMachine::operator==(const ChromeCompositorStateMachine& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && major_state_ == other.major_state_
+   && minor_state_ == other.minor_state_;
+}
+
+bool ChromeCompositorStateMachine::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* major_state */:
+        (*major_state_).ParseFromArray(field.data(), field.size());
+        break;
+      case 2 /* minor_state */:
+        (*minor_state_).ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ChromeCompositorStateMachine::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ChromeCompositorStateMachine::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ChromeCompositorStateMachine::Serialize(::protozero::Message* msg) const {
+  // Field 1: major_state
+  if (_has_field_[1]) {
+    (*major_state_).Serialize(msg->BeginNestedMessage<::protozero::Message>(1));
+  }
+
+  // Field 2: minor_state
+  if (_has_field_[2]) {
+    (*minor_state_).Serialize(msg->BeginNestedMessage<::protozero::Message>(2));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+ChromeCompositorStateMachine_MinorState::ChromeCompositorStateMachine_MinorState() = default;
+ChromeCompositorStateMachine_MinorState::~ChromeCompositorStateMachine_MinorState() = default;
+ChromeCompositorStateMachine_MinorState::ChromeCompositorStateMachine_MinorState(const ChromeCompositorStateMachine_MinorState&) = default;
+ChromeCompositorStateMachine_MinorState& ChromeCompositorStateMachine_MinorState::operator=(const ChromeCompositorStateMachine_MinorState&) = default;
+ChromeCompositorStateMachine_MinorState::ChromeCompositorStateMachine_MinorState(ChromeCompositorStateMachine_MinorState&&) noexcept = default;
+ChromeCompositorStateMachine_MinorState& ChromeCompositorStateMachine_MinorState::operator=(ChromeCompositorStateMachine_MinorState&&) = default;
+
+bool ChromeCompositorStateMachine_MinorState::operator==(const ChromeCompositorStateMachine_MinorState& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && commit_count_ == other.commit_count_
+   && current_frame_number_ == other.current_frame_number_
+   && last_frame_number_submit_performed_ == other.last_frame_number_submit_performed_
+   && last_frame_number_draw_performed_ == other.last_frame_number_draw_performed_
+   && last_frame_number_begin_main_frame_sent_ == other.last_frame_number_begin_main_frame_sent_
+   && did_draw_ == other.did_draw_
+   && did_send_begin_main_frame_for_current_frame_ == other.did_send_begin_main_frame_for_current_frame_
+   && did_notify_begin_main_frame_not_expected_until_ == other.did_notify_begin_main_frame_not_expected_until_
+   && did_notify_begin_main_frame_not_expected_soon_ == other.did_notify_begin_main_frame_not_expected_soon_
+   && wants_begin_main_frame_not_expected_ == other.wants_begin_main_frame_not_expected_
+   && did_commit_during_frame_ == other.did_commit_during_frame_
+   && did_invalidate_layer_tree_frame_sink_ == other.did_invalidate_layer_tree_frame_sink_
+   && did_perform_impl_side_invalidaion_ == other.did_perform_impl_side_invalidaion_
+   && did_prepare_tiles_ == other.did_prepare_tiles_
+   && consecutive_checkerboard_animations_ == other.consecutive_checkerboard_animations_
+   && pending_submit_frames_ == other.pending_submit_frames_
+   && submit_frames_with_current_layer_tree_frame_sink_ == other.submit_frames_with_current_layer_tree_frame_sink_
+   && needs_redraw_ == other.needs_redraw_
+   && needs_prepare_tiles_ == other.needs_prepare_tiles_
+   && needs_begin_main_frame_ == other.needs_begin_main_frame_
+   && needs_one_begin_impl_frame_ == other.needs_one_begin_impl_frame_
+   && visible_ == other.visible_
+   && begin_frame_source_paused_ == other.begin_frame_source_paused_
+   && can_draw_ == other.can_draw_
+   && resourceless_draw_ == other.resourceless_draw_
+   && has_pending_tree_ == other.has_pending_tree_
+   && pending_tree_is_ready_for_activation_ == other.pending_tree_is_ready_for_activation_
+   && active_tree_needs_first_draw_ == other.active_tree_needs_first_draw_
+   && active_tree_is_ready_to_draw_ == other.active_tree_is_ready_to_draw_
+   && did_create_and_initialize_first_layer_tree_frame_sink_ == other.did_create_and_initialize_first_layer_tree_frame_sink_
+   && tree_priority_ == other.tree_priority_
+   && scroll_handler_state_ == other.scroll_handler_state_
+   && critical_begin_main_frame_to_activate_is_fast_ == other.critical_begin_main_frame_to_activate_is_fast_
+   && main_thread_missed_last_deadline_ == other.main_thread_missed_last_deadline_
+   && skip_next_begin_main_frame_to_reduce_latency_ == other.skip_next_begin_main_frame_to_reduce_latency_
+   && video_needs_begin_frames_ == other.video_needs_begin_frames_
+   && defer_begin_main_frame_ == other.defer_begin_main_frame_
+   && last_commit_had_no_updates_ == other.last_commit_had_no_updates_
+   && did_draw_in_last_frame_ == other.did_draw_in_last_frame_
+   && did_submit_in_last_frame_ == other.did_submit_in_last_frame_
+   && needs_impl_side_invalidation_ == other.needs_impl_side_invalidation_
+   && current_pending_tree_is_impl_side_ == other.current_pending_tree_is_impl_side_
+   && previous_pending_tree_was_impl_side_ == other.previous_pending_tree_was_impl_side_
+   && processing_animation_worklets_for_active_tree_ == other.processing_animation_worklets_for_active_tree_
+   && processing_animation_worklets_for_pending_tree_ == other.processing_animation_worklets_for_pending_tree_
+   && processing_paint_worklets_for_pending_tree_ == other.processing_paint_worklets_for_pending_tree_;
+}
+
+bool ChromeCompositorStateMachine_MinorState::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* commit_count */:
+        field.get(&commit_count_);
+        break;
+      case 2 /* current_frame_number */:
+        field.get(&current_frame_number_);
+        break;
+      case 3 /* last_frame_number_submit_performed */:
+        field.get(&last_frame_number_submit_performed_);
+        break;
+      case 4 /* last_frame_number_draw_performed */:
+        field.get(&last_frame_number_draw_performed_);
+        break;
+      case 5 /* last_frame_number_begin_main_frame_sent */:
+        field.get(&last_frame_number_begin_main_frame_sent_);
+        break;
+      case 6 /* did_draw */:
+        field.get(&did_draw_);
+        break;
+      case 7 /* did_send_begin_main_frame_for_current_frame */:
+        field.get(&did_send_begin_main_frame_for_current_frame_);
+        break;
+      case 8 /* did_notify_begin_main_frame_not_expected_until */:
+        field.get(&did_notify_begin_main_frame_not_expected_until_);
+        break;
+      case 9 /* did_notify_begin_main_frame_not_expected_soon */:
+        field.get(&did_notify_begin_main_frame_not_expected_soon_);
+        break;
+      case 10 /* wants_begin_main_frame_not_expected */:
+        field.get(&wants_begin_main_frame_not_expected_);
+        break;
+      case 11 /* did_commit_during_frame */:
+        field.get(&did_commit_during_frame_);
+        break;
+      case 12 /* did_invalidate_layer_tree_frame_sink */:
+        field.get(&did_invalidate_layer_tree_frame_sink_);
+        break;
+      case 13 /* did_perform_impl_side_invalidaion */:
+        field.get(&did_perform_impl_side_invalidaion_);
+        break;
+      case 14 /* did_prepare_tiles */:
+        field.get(&did_prepare_tiles_);
+        break;
+      case 15 /* consecutive_checkerboard_animations */:
+        field.get(&consecutive_checkerboard_animations_);
+        break;
+      case 16 /* pending_submit_frames */:
+        field.get(&pending_submit_frames_);
+        break;
+      case 17 /* submit_frames_with_current_layer_tree_frame_sink */:
+        field.get(&submit_frames_with_current_layer_tree_frame_sink_);
+        break;
+      case 18 /* needs_redraw */:
+        field.get(&needs_redraw_);
+        break;
+      case 19 /* needs_prepare_tiles */:
+        field.get(&needs_prepare_tiles_);
+        break;
+      case 20 /* needs_begin_main_frame */:
+        field.get(&needs_begin_main_frame_);
+        break;
+      case 21 /* needs_one_begin_impl_frame */:
+        field.get(&needs_one_begin_impl_frame_);
+        break;
+      case 22 /* visible */:
+        field.get(&visible_);
+        break;
+      case 23 /* begin_frame_source_paused */:
+        field.get(&begin_frame_source_paused_);
+        break;
+      case 24 /* can_draw */:
+        field.get(&can_draw_);
+        break;
+      case 25 /* resourceless_draw */:
+        field.get(&resourceless_draw_);
+        break;
+      case 26 /* has_pending_tree */:
+        field.get(&has_pending_tree_);
+        break;
+      case 27 /* pending_tree_is_ready_for_activation */:
+        field.get(&pending_tree_is_ready_for_activation_);
+        break;
+      case 28 /* active_tree_needs_first_draw */:
+        field.get(&active_tree_needs_first_draw_);
+        break;
+      case 29 /* active_tree_is_ready_to_draw */:
+        field.get(&active_tree_is_ready_to_draw_);
+        break;
+      case 30 /* did_create_and_initialize_first_layer_tree_frame_sink */:
+        field.get(&did_create_and_initialize_first_layer_tree_frame_sink_);
+        break;
+      case 31 /* tree_priority */:
+        field.get(&tree_priority_);
+        break;
+      case 32 /* scroll_handler_state */:
+        field.get(&scroll_handler_state_);
+        break;
+      case 33 /* critical_begin_main_frame_to_activate_is_fast */:
+        field.get(&critical_begin_main_frame_to_activate_is_fast_);
+        break;
+      case 34 /* main_thread_missed_last_deadline */:
+        field.get(&main_thread_missed_last_deadline_);
+        break;
+      case 35 /* skip_next_begin_main_frame_to_reduce_latency */:
+        field.get(&skip_next_begin_main_frame_to_reduce_latency_);
+        break;
+      case 36 /* video_needs_begin_frames */:
+        field.get(&video_needs_begin_frames_);
+        break;
+      case 37 /* defer_begin_main_frame */:
+        field.get(&defer_begin_main_frame_);
+        break;
+      case 38 /* last_commit_had_no_updates */:
+        field.get(&last_commit_had_no_updates_);
+        break;
+      case 39 /* did_draw_in_last_frame */:
+        field.get(&did_draw_in_last_frame_);
+        break;
+      case 40 /* did_submit_in_last_frame */:
+        field.get(&did_submit_in_last_frame_);
+        break;
+      case 41 /* needs_impl_side_invalidation */:
+        field.get(&needs_impl_side_invalidation_);
+        break;
+      case 42 /* current_pending_tree_is_impl_side */:
+        field.get(&current_pending_tree_is_impl_side_);
+        break;
+      case 43 /* previous_pending_tree_was_impl_side */:
+        field.get(&previous_pending_tree_was_impl_side_);
+        break;
+      case 44 /* processing_animation_worklets_for_active_tree */:
+        field.get(&processing_animation_worklets_for_active_tree_);
+        break;
+      case 45 /* processing_animation_worklets_for_pending_tree */:
+        field.get(&processing_animation_worklets_for_pending_tree_);
+        break;
+      case 46 /* processing_paint_worklets_for_pending_tree */:
+        field.get(&processing_paint_worklets_for_pending_tree_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ChromeCompositorStateMachine_MinorState::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ChromeCompositorStateMachine_MinorState::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ChromeCompositorStateMachine_MinorState::Serialize(::protozero::Message* msg) const {
+  // Field 1: commit_count
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, commit_count_);
+  }
+
+  // Field 2: current_frame_number
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, current_frame_number_);
+  }
+
+  // Field 3: last_frame_number_submit_performed
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, last_frame_number_submit_performed_);
+  }
+
+  // Field 4: last_frame_number_draw_performed
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, last_frame_number_draw_performed_);
+  }
+
+  // Field 5: last_frame_number_begin_main_frame_sent
+  if (_has_field_[5]) {
+    msg->AppendVarInt(5, last_frame_number_begin_main_frame_sent_);
+  }
+
+  // Field 6: did_draw
+  if (_has_field_[6]) {
+    msg->AppendTinyVarInt(6, did_draw_);
+  }
+
+  // Field 7: did_send_begin_main_frame_for_current_frame
+  if (_has_field_[7]) {
+    msg->AppendTinyVarInt(7, did_send_begin_main_frame_for_current_frame_);
+  }
+
+  // Field 8: did_notify_begin_main_frame_not_expected_until
+  if (_has_field_[8]) {
+    msg->AppendTinyVarInt(8, did_notify_begin_main_frame_not_expected_until_);
+  }
+
+  // Field 9: did_notify_begin_main_frame_not_expected_soon
+  if (_has_field_[9]) {
+    msg->AppendTinyVarInt(9, did_notify_begin_main_frame_not_expected_soon_);
+  }
+
+  // Field 10: wants_begin_main_frame_not_expected
+  if (_has_field_[10]) {
+    msg->AppendTinyVarInt(10, wants_begin_main_frame_not_expected_);
+  }
+
+  // Field 11: did_commit_during_frame
+  if (_has_field_[11]) {
+    msg->AppendTinyVarInt(11, did_commit_during_frame_);
+  }
+
+  // Field 12: did_invalidate_layer_tree_frame_sink
+  if (_has_field_[12]) {
+    msg->AppendTinyVarInt(12, did_invalidate_layer_tree_frame_sink_);
+  }
+
+  // Field 13: did_perform_impl_side_invalidaion
+  if (_has_field_[13]) {
+    msg->AppendTinyVarInt(13, did_perform_impl_side_invalidaion_);
+  }
+
+  // Field 14: did_prepare_tiles
+  if (_has_field_[14]) {
+    msg->AppendTinyVarInt(14, did_prepare_tiles_);
+  }
+
+  // Field 15: consecutive_checkerboard_animations
+  if (_has_field_[15]) {
+    msg->AppendVarInt(15, consecutive_checkerboard_animations_);
+  }
+
+  // Field 16: pending_submit_frames
+  if (_has_field_[16]) {
+    msg->AppendVarInt(16, pending_submit_frames_);
+  }
+
+  // Field 17: submit_frames_with_current_layer_tree_frame_sink
+  if (_has_field_[17]) {
+    msg->AppendVarInt(17, submit_frames_with_current_layer_tree_frame_sink_);
+  }
+
+  // Field 18: needs_redraw
+  if (_has_field_[18]) {
+    msg->AppendTinyVarInt(18, needs_redraw_);
+  }
+
+  // Field 19: needs_prepare_tiles
+  if (_has_field_[19]) {
+    msg->AppendTinyVarInt(19, needs_prepare_tiles_);
+  }
+
+  // Field 20: needs_begin_main_frame
+  if (_has_field_[20]) {
+    msg->AppendTinyVarInt(20, needs_begin_main_frame_);
+  }
+
+  // Field 21: needs_one_begin_impl_frame
+  if (_has_field_[21]) {
+    msg->AppendTinyVarInt(21, needs_one_begin_impl_frame_);
+  }
+
+  // Field 22: visible
+  if (_has_field_[22]) {
+    msg->AppendTinyVarInt(22, visible_);
+  }
+
+  // Field 23: begin_frame_source_paused
+  if (_has_field_[23]) {
+    msg->AppendTinyVarInt(23, begin_frame_source_paused_);
+  }
+
+  // Field 24: can_draw
+  if (_has_field_[24]) {
+    msg->AppendTinyVarInt(24, can_draw_);
+  }
+
+  // Field 25: resourceless_draw
+  if (_has_field_[25]) {
+    msg->AppendTinyVarInt(25, resourceless_draw_);
+  }
+
+  // Field 26: has_pending_tree
+  if (_has_field_[26]) {
+    msg->AppendTinyVarInt(26, has_pending_tree_);
+  }
+
+  // Field 27: pending_tree_is_ready_for_activation
+  if (_has_field_[27]) {
+    msg->AppendTinyVarInt(27, pending_tree_is_ready_for_activation_);
+  }
+
+  // Field 28: active_tree_needs_first_draw
+  if (_has_field_[28]) {
+    msg->AppendTinyVarInt(28, active_tree_needs_first_draw_);
+  }
+
+  // Field 29: active_tree_is_ready_to_draw
+  if (_has_field_[29]) {
+    msg->AppendTinyVarInt(29, active_tree_is_ready_to_draw_);
+  }
+
+  // Field 30: did_create_and_initialize_first_layer_tree_frame_sink
+  if (_has_field_[30]) {
+    msg->AppendTinyVarInt(30, did_create_and_initialize_first_layer_tree_frame_sink_);
+  }
+
+  // Field 31: tree_priority
+  if (_has_field_[31]) {
+    msg->AppendVarInt(31, tree_priority_);
+  }
+
+  // Field 32: scroll_handler_state
+  if (_has_field_[32]) {
+    msg->AppendVarInt(32, scroll_handler_state_);
+  }
+
+  // Field 33: critical_begin_main_frame_to_activate_is_fast
+  if (_has_field_[33]) {
+    msg->AppendTinyVarInt(33, critical_begin_main_frame_to_activate_is_fast_);
+  }
+
+  // Field 34: main_thread_missed_last_deadline
+  if (_has_field_[34]) {
+    msg->AppendTinyVarInt(34, main_thread_missed_last_deadline_);
+  }
+
+  // Field 35: skip_next_begin_main_frame_to_reduce_latency
+  if (_has_field_[35]) {
+    msg->AppendTinyVarInt(35, skip_next_begin_main_frame_to_reduce_latency_);
+  }
+
+  // Field 36: video_needs_begin_frames
+  if (_has_field_[36]) {
+    msg->AppendTinyVarInt(36, video_needs_begin_frames_);
+  }
+
+  // Field 37: defer_begin_main_frame
+  if (_has_field_[37]) {
+    msg->AppendTinyVarInt(37, defer_begin_main_frame_);
+  }
+
+  // Field 38: last_commit_had_no_updates
+  if (_has_field_[38]) {
+    msg->AppendTinyVarInt(38, last_commit_had_no_updates_);
+  }
+
+  // Field 39: did_draw_in_last_frame
+  if (_has_field_[39]) {
+    msg->AppendTinyVarInt(39, did_draw_in_last_frame_);
+  }
+
+  // Field 40: did_submit_in_last_frame
+  if (_has_field_[40]) {
+    msg->AppendTinyVarInt(40, did_submit_in_last_frame_);
+  }
+
+  // Field 41: needs_impl_side_invalidation
+  if (_has_field_[41]) {
+    msg->AppendTinyVarInt(41, needs_impl_side_invalidation_);
+  }
+
+  // Field 42: current_pending_tree_is_impl_side
+  if (_has_field_[42]) {
+    msg->AppendTinyVarInt(42, current_pending_tree_is_impl_side_);
+  }
+
+  // Field 43: previous_pending_tree_was_impl_side
+  if (_has_field_[43]) {
+    msg->AppendTinyVarInt(43, previous_pending_tree_was_impl_side_);
+  }
+
+  // Field 44: processing_animation_worklets_for_active_tree
+  if (_has_field_[44]) {
+    msg->AppendTinyVarInt(44, processing_animation_worklets_for_active_tree_);
+  }
+
+  // Field 45: processing_animation_worklets_for_pending_tree
+  if (_has_field_[45]) {
+    msg->AppendTinyVarInt(45, processing_animation_worklets_for_pending_tree_);
+  }
+
+  // Field 46: processing_paint_worklets_for_pending_tree
+  if (_has_field_[46]) {
+    msg->AppendTinyVarInt(46, processing_paint_worklets_for_pending_tree_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+ChromeCompositorStateMachine_MajorState::ChromeCompositorStateMachine_MajorState() = default;
+ChromeCompositorStateMachine_MajorState::~ChromeCompositorStateMachine_MajorState() = default;
+ChromeCompositorStateMachine_MajorState::ChromeCompositorStateMachine_MajorState(const ChromeCompositorStateMachine_MajorState&) = default;
+ChromeCompositorStateMachine_MajorState& ChromeCompositorStateMachine_MajorState::operator=(const ChromeCompositorStateMachine_MajorState&) = default;
+ChromeCompositorStateMachine_MajorState::ChromeCompositorStateMachine_MajorState(ChromeCompositorStateMachine_MajorState&&) noexcept = default;
+ChromeCompositorStateMachine_MajorState& ChromeCompositorStateMachine_MajorState::operator=(ChromeCompositorStateMachine_MajorState&&) = default;
+
+bool ChromeCompositorStateMachine_MajorState::operator==(const ChromeCompositorStateMachine_MajorState& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && next_action_ == other.next_action_
+   && begin_impl_frame_state_ == other.begin_impl_frame_state_
+   && begin_main_frame_state_ == other.begin_main_frame_state_
+   && layer_tree_frame_sink_state_ == other.layer_tree_frame_sink_state_
+   && forced_redraw_state_ == other.forced_redraw_state_;
+}
+
+bool ChromeCompositorStateMachine_MajorState::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* next_action */:
+        field.get(&next_action_);
+        break;
+      case 2 /* begin_impl_frame_state */:
+        field.get(&begin_impl_frame_state_);
+        break;
+      case 3 /* begin_main_frame_state */:
+        field.get(&begin_main_frame_state_);
+        break;
+      case 4 /* layer_tree_frame_sink_state */:
+        field.get(&layer_tree_frame_sink_state_);
+        break;
+      case 5 /* forced_redraw_state */:
+        field.get(&forced_redraw_state_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ChromeCompositorStateMachine_MajorState::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ChromeCompositorStateMachine_MajorState::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ChromeCompositorStateMachine_MajorState::Serialize(::protozero::Message* msg) const {
+  // Field 1: next_action
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, next_action_);
+  }
+
+  // Field 2: begin_impl_frame_state
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, begin_impl_frame_state_);
+  }
+
+  // Field 3: begin_main_frame_state
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, begin_main_frame_state_);
+  }
+
+  // Field 4: layer_tree_frame_sink_state
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, layer_tree_frame_sink_state_);
+  }
+
+  // Field 5: forced_redraw_state
+  if (_has_field_[5]) {
+    msg->AppendVarInt(5, forced_redraw_state_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+ChromeCompositorSchedulerState::ChromeCompositorSchedulerState() = default;
+ChromeCompositorSchedulerState::~ChromeCompositorSchedulerState() = default;
+ChromeCompositorSchedulerState::ChromeCompositorSchedulerState(const ChromeCompositorSchedulerState&) = default;
+ChromeCompositorSchedulerState& ChromeCompositorSchedulerState::operator=(const ChromeCompositorSchedulerState&) = default;
+ChromeCompositorSchedulerState::ChromeCompositorSchedulerState(ChromeCompositorSchedulerState&&) noexcept = default;
+ChromeCompositorSchedulerState& ChromeCompositorSchedulerState::operator=(ChromeCompositorSchedulerState&&) = default;
+
+bool ChromeCompositorSchedulerState::operator==(const ChromeCompositorSchedulerState& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && state_machine_ == other.state_machine_
+   && observing_begin_frame_source_ == other.observing_begin_frame_source_
+   && begin_impl_frame_deadline_task_ == other.begin_impl_frame_deadline_task_
+   && pending_begin_frame_task_ == other.pending_begin_frame_task_
+   && skipped_last_frame_missed_exceeded_deadline_ == other.skipped_last_frame_missed_exceeded_deadline_
+   && skipped_last_frame_to_reduce_latency_ == other.skipped_last_frame_to_reduce_latency_
+   && inside_action_ == other.inside_action_
+   && deadline_mode_ == other.deadline_mode_
+   && deadline_us_ == other.deadline_us_
+   && deadline_scheduled_at_us_ == other.deadline_scheduled_at_us_
+   && now_us_ == other.now_us_
+   && now_to_deadline_delta_us_ == other.now_to_deadline_delta_us_
+   && now_to_deadline_scheduled_at_delta_us_ == other.now_to_deadline_scheduled_at_delta_us_
+   && begin_impl_frame_args_ == other.begin_impl_frame_args_
+   && begin_frame_observer_state_ == other.begin_frame_observer_state_
+   && begin_frame_source_state_ == other.begin_frame_source_state_
+   && compositor_timing_history_ == other.compositor_timing_history_;
+}
+
+bool ChromeCompositorSchedulerState::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* state_machine */:
+        (*state_machine_).ParseFromArray(field.data(), field.size());
+        break;
+      case 2 /* observing_begin_frame_source */:
+        field.get(&observing_begin_frame_source_);
+        break;
+      case 3 /* begin_impl_frame_deadline_task */:
+        field.get(&begin_impl_frame_deadline_task_);
+        break;
+      case 4 /* pending_begin_frame_task */:
+        field.get(&pending_begin_frame_task_);
+        break;
+      case 5 /* skipped_last_frame_missed_exceeded_deadline */:
+        field.get(&skipped_last_frame_missed_exceeded_deadline_);
+        break;
+      case 6 /* skipped_last_frame_to_reduce_latency */:
+        field.get(&skipped_last_frame_to_reduce_latency_);
+        break;
+      case 7 /* inside_action */:
+        field.get(&inside_action_);
+        break;
+      case 8 /* deadline_mode */:
+        field.get(&deadline_mode_);
+        break;
+      case 9 /* deadline_us */:
+        field.get(&deadline_us_);
+        break;
+      case 10 /* deadline_scheduled_at_us */:
+        field.get(&deadline_scheduled_at_us_);
+        break;
+      case 11 /* now_us */:
+        field.get(&now_us_);
+        break;
+      case 12 /* now_to_deadline_delta_us */:
+        field.get(&now_to_deadline_delta_us_);
+        break;
+      case 13 /* now_to_deadline_scheduled_at_delta_us */:
+        field.get(&now_to_deadline_scheduled_at_delta_us_);
+        break;
+      case 14 /* begin_impl_frame_args */:
+        (*begin_impl_frame_args_).ParseFromArray(field.data(), field.size());
+        break;
+      case 15 /* begin_frame_observer_state */:
+        (*begin_frame_observer_state_).ParseFromArray(field.data(), field.size());
+        break;
+      case 16 /* begin_frame_source_state */:
+        (*begin_frame_source_state_).ParseFromArray(field.data(), field.size());
+        break;
+      case 17 /* compositor_timing_history */:
+        (*compositor_timing_history_).ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ChromeCompositorSchedulerState::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ChromeCompositorSchedulerState::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ChromeCompositorSchedulerState::Serialize(::protozero::Message* msg) const {
+  // Field 1: state_machine
+  if (_has_field_[1]) {
+    (*state_machine_).Serialize(msg->BeginNestedMessage<::protozero::Message>(1));
+  }
+
+  // Field 2: observing_begin_frame_source
+  if (_has_field_[2]) {
+    msg->AppendTinyVarInt(2, observing_begin_frame_source_);
+  }
+
+  // Field 3: begin_impl_frame_deadline_task
+  if (_has_field_[3]) {
+    msg->AppendTinyVarInt(3, begin_impl_frame_deadline_task_);
+  }
+
+  // Field 4: pending_begin_frame_task
+  if (_has_field_[4]) {
+    msg->AppendTinyVarInt(4, pending_begin_frame_task_);
+  }
+
+  // Field 5: skipped_last_frame_missed_exceeded_deadline
+  if (_has_field_[5]) {
+    msg->AppendTinyVarInt(5, skipped_last_frame_missed_exceeded_deadline_);
+  }
+
+  // Field 6: skipped_last_frame_to_reduce_latency
+  if (_has_field_[6]) {
+    msg->AppendTinyVarInt(6, skipped_last_frame_to_reduce_latency_);
+  }
+
+  // Field 7: inside_action
+  if (_has_field_[7]) {
+    msg->AppendVarInt(7, inside_action_);
+  }
+
+  // Field 8: deadline_mode
+  if (_has_field_[8]) {
+    msg->AppendVarInt(8, deadline_mode_);
+  }
+
+  // Field 9: deadline_us
+  if (_has_field_[9]) {
+    msg->AppendVarInt(9, deadline_us_);
+  }
+
+  // Field 10: deadline_scheduled_at_us
+  if (_has_field_[10]) {
+    msg->AppendVarInt(10, deadline_scheduled_at_us_);
+  }
+
+  // Field 11: now_us
+  if (_has_field_[11]) {
+    msg->AppendVarInt(11, now_us_);
+  }
+
+  // Field 12: now_to_deadline_delta_us
+  if (_has_field_[12]) {
+    msg->AppendVarInt(12, now_to_deadline_delta_us_);
+  }
+
+  // Field 13: now_to_deadline_scheduled_at_delta_us
+  if (_has_field_[13]) {
+    msg->AppendVarInt(13, now_to_deadline_scheduled_at_delta_us_);
+  }
+
+  // Field 14: begin_impl_frame_args
+  if (_has_field_[14]) {
+    (*begin_impl_frame_args_).Serialize(msg->BeginNestedMessage<::protozero::Message>(14));
+  }
+
+  // Field 15: begin_frame_observer_state
+  if (_has_field_[15]) {
+    (*begin_frame_observer_state_).Serialize(msg->BeginNestedMessage<::protozero::Message>(15));
+  }
+
+  // Field 16: begin_frame_source_state
+  if (_has_field_[16]) {
+    (*begin_frame_source_state_).Serialize(msg->BeginNestedMessage<::protozero::Message>(16));
+  }
+
+  // Field 17: compositor_timing_history
+  if (_has_field_[17]) {
+    (*compositor_timing_history_).Serialize(msg->BeginNestedMessage<::protozero::Message>(17));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_content_settings_event_info.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_content_settings_event_info.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_CONTENT_SETTINGS_EVENT_INFO_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_CONTENT_SETTINGS_EVENT_INFO_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeContentSettingsEventInfo;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT ChromeContentSettingsEventInfo : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNumberOfExceptionsFieldNumber = 1,
+  };
+
+  ChromeContentSettingsEventInfo();
+  ~ChromeContentSettingsEventInfo() override;
+  ChromeContentSettingsEventInfo(ChromeContentSettingsEventInfo&&) noexcept;
+  ChromeContentSettingsEventInfo& operator=(ChromeContentSettingsEventInfo&&);
+  ChromeContentSettingsEventInfo(const ChromeContentSettingsEventInfo&);
+  ChromeContentSettingsEventInfo& operator=(const ChromeContentSettingsEventInfo&);
+  bool operator==(const ChromeContentSettingsEventInfo&) const;
+  bool operator!=(const ChromeContentSettingsEventInfo& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_number_of_exceptions() const { return _has_field_[1]; }
+  uint32_t number_of_exceptions() const { return number_of_exceptions_; }
+  void set_number_of_exceptions(uint32_t value) { number_of_exceptions_ = value; _has_field_.set(1); }
+
+ private:
+  uint32_t number_of_exceptions_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_CONTENT_SETTINGS_EVENT_INFO_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_content_settings_event_info.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+ChromeContentSettingsEventInfo::ChromeContentSettingsEventInfo() = default;
+ChromeContentSettingsEventInfo::~ChromeContentSettingsEventInfo() = default;
+ChromeContentSettingsEventInfo::ChromeContentSettingsEventInfo(const ChromeContentSettingsEventInfo&) = default;
+ChromeContentSettingsEventInfo& ChromeContentSettingsEventInfo::operator=(const ChromeContentSettingsEventInfo&) = default;
+ChromeContentSettingsEventInfo::ChromeContentSettingsEventInfo(ChromeContentSettingsEventInfo&&) noexcept = default;
+ChromeContentSettingsEventInfo& ChromeContentSettingsEventInfo::operator=(ChromeContentSettingsEventInfo&&) = default;
+
+bool ChromeContentSettingsEventInfo::operator==(const ChromeContentSettingsEventInfo& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && number_of_exceptions_ == other.number_of_exceptions_;
+}
+
+bool ChromeContentSettingsEventInfo::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* number_of_exceptions */:
+        field.get(&number_of_exceptions_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ChromeContentSettingsEventInfo::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ChromeContentSettingsEventInfo::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ChromeContentSettingsEventInfo::Serialize(::protozero::Message* msg) const {
+  // Field 1: number_of_exceptions
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, number_of_exceptions_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_frame_reporter.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_frame_reporter.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_FRAME_REPORTER_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_FRAME_REPORTER_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeFrameReporter;
+enum ChromeFrameReporter_State : int;
+enum ChromeFrameReporter_FrameDropReason : int;
+enum ChromeFrameReporter_ScrollState : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum ChromeFrameReporter_State : int {
+  ChromeFrameReporter_State_STATE_NO_UPDATE_DESIRED = 0,
+  ChromeFrameReporter_State_STATE_PRESENTED_ALL = 1,
+  ChromeFrameReporter_State_STATE_PRESENTED_PARTIAL = 2,
+  ChromeFrameReporter_State_STATE_DROPPED = 3,
+};
+enum ChromeFrameReporter_FrameDropReason : int {
+  ChromeFrameReporter_FrameDropReason_REASON_UNSPECIFIED = 0,
+  ChromeFrameReporter_FrameDropReason_REASON_DISPLAY_COMPOSITOR = 1,
+  ChromeFrameReporter_FrameDropReason_REASON_MAIN_THREAD = 2,
+  ChromeFrameReporter_FrameDropReason_REASON_CLIENT_COMPOSITOR = 3,
+};
+enum ChromeFrameReporter_ScrollState : int {
+  ChromeFrameReporter_ScrollState_SCROLL_NONE = 0,
+  ChromeFrameReporter_ScrollState_SCROLL_MAIN_THREAD = 1,
+  ChromeFrameReporter_ScrollState_SCROLL_COMPOSITOR_THREAD = 2,
+  ChromeFrameReporter_ScrollState_SCROLL_UNKNOWN = 3,
+};
+
+class PERFETTO_EXPORT ChromeFrameReporter : public ::protozero::CppMessageObj {
+ public:
+  using State = ChromeFrameReporter_State;
+  static constexpr auto STATE_NO_UPDATE_DESIRED = ChromeFrameReporter_State_STATE_NO_UPDATE_DESIRED;
+  static constexpr auto STATE_PRESENTED_ALL = ChromeFrameReporter_State_STATE_PRESENTED_ALL;
+  static constexpr auto STATE_PRESENTED_PARTIAL = ChromeFrameReporter_State_STATE_PRESENTED_PARTIAL;
+  static constexpr auto STATE_DROPPED = ChromeFrameReporter_State_STATE_DROPPED;
+  static constexpr auto State_MIN = ChromeFrameReporter_State_STATE_NO_UPDATE_DESIRED;
+  static constexpr auto State_MAX = ChromeFrameReporter_State_STATE_DROPPED;
+  using FrameDropReason = ChromeFrameReporter_FrameDropReason;
+  static constexpr auto REASON_UNSPECIFIED = ChromeFrameReporter_FrameDropReason_REASON_UNSPECIFIED;
+  static constexpr auto REASON_DISPLAY_COMPOSITOR = ChromeFrameReporter_FrameDropReason_REASON_DISPLAY_COMPOSITOR;
+  static constexpr auto REASON_MAIN_THREAD = ChromeFrameReporter_FrameDropReason_REASON_MAIN_THREAD;
+  static constexpr auto REASON_CLIENT_COMPOSITOR = ChromeFrameReporter_FrameDropReason_REASON_CLIENT_COMPOSITOR;
+  static constexpr auto FrameDropReason_MIN = ChromeFrameReporter_FrameDropReason_REASON_UNSPECIFIED;
+  static constexpr auto FrameDropReason_MAX = ChromeFrameReporter_FrameDropReason_REASON_CLIENT_COMPOSITOR;
+  using ScrollState = ChromeFrameReporter_ScrollState;
+  static constexpr auto SCROLL_NONE = ChromeFrameReporter_ScrollState_SCROLL_NONE;
+  static constexpr auto SCROLL_MAIN_THREAD = ChromeFrameReporter_ScrollState_SCROLL_MAIN_THREAD;
+  static constexpr auto SCROLL_COMPOSITOR_THREAD = ChromeFrameReporter_ScrollState_SCROLL_COMPOSITOR_THREAD;
+  static constexpr auto SCROLL_UNKNOWN = ChromeFrameReporter_ScrollState_SCROLL_UNKNOWN;
+  static constexpr auto ScrollState_MIN = ChromeFrameReporter_ScrollState_SCROLL_NONE;
+  static constexpr auto ScrollState_MAX = ChromeFrameReporter_ScrollState_SCROLL_UNKNOWN;
+  enum FieldNumbers {
+    kStateFieldNumber = 1,
+    kReasonFieldNumber = 2,
+    kFrameSourceFieldNumber = 3,
+    kFrameSequenceFieldNumber = 4,
+    kAffectsSmoothnessFieldNumber = 5,
+    kScrollStateFieldNumber = 6,
+    kHasMainAnimationFieldNumber = 7,
+    kHasCompositorAnimationFieldNumber = 8,
+    kHasSmoothInputMainFieldNumber = 9,
+    kHasMissingContentFieldNumber = 10,
+    kLayerTreeHostIdFieldNumber = 11,
+  };
+
+  ChromeFrameReporter();
+  ~ChromeFrameReporter() override;
+  ChromeFrameReporter(ChromeFrameReporter&&) noexcept;
+  ChromeFrameReporter& operator=(ChromeFrameReporter&&);
+  ChromeFrameReporter(const ChromeFrameReporter&);
+  ChromeFrameReporter& operator=(const ChromeFrameReporter&);
+  bool operator==(const ChromeFrameReporter&) const;
+  bool operator!=(const ChromeFrameReporter& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_state() const { return _has_field_[1]; }
+  ChromeFrameReporter_State state() const { return state_; }
+  void set_state(ChromeFrameReporter_State value) { state_ = value; _has_field_.set(1); }
+
+  bool has_reason() const { return _has_field_[2]; }
+  ChromeFrameReporter_FrameDropReason reason() const { return reason_; }
+  void set_reason(ChromeFrameReporter_FrameDropReason value) { reason_ = value; _has_field_.set(2); }
+
+  bool has_frame_source() const { return _has_field_[3]; }
+  uint64_t frame_source() const { return frame_source_; }
+  void set_frame_source(uint64_t value) { frame_source_ = value; _has_field_.set(3); }
+
+  bool has_frame_sequence() const { return _has_field_[4]; }
+  uint64_t frame_sequence() const { return frame_sequence_; }
+  void set_frame_sequence(uint64_t value) { frame_sequence_ = value; _has_field_.set(4); }
+
+  bool has_affects_smoothness() const { return _has_field_[5]; }
+  bool affects_smoothness() const { return affects_smoothness_; }
+  void set_affects_smoothness(bool value) { affects_smoothness_ = value; _has_field_.set(5); }
+
+  bool has_scroll_state() const { return _has_field_[6]; }
+  ChromeFrameReporter_ScrollState scroll_state() const { return scroll_state_; }
+  void set_scroll_state(ChromeFrameReporter_ScrollState value) { scroll_state_ = value; _has_field_.set(6); }
+
+  bool has_has_main_animation() const { return _has_field_[7]; }
+  bool has_main_animation() const { return has_main_animation_; }
+  void set_has_main_animation(bool value) { has_main_animation_ = value; _has_field_.set(7); }
+
+  bool has_has_compositor_animation() const { return _has_field_[8]; }
+  bool has_compositor_animation() const { return has_compositor_animation_; }
+  void set_has_compositor_animation(bool value) { has_compositor_animation_ = value; _has_field_.set(8); }
+
+  bool has_has_smooth_input_main() const { return _has_field_[9]; }
+  bool has_smooth_input_main() const { return has_smooth_input_main_; }
+  void set_has_smooth_input_main(bool value) { has_smooth_input_main_ = value; _has_field_.set(9); }
+
+  bool has_has_missing_content() const { return _has_field_[10]; }
+  bool has_missing_content() const { return has_missing_content_; }
+  void set_has_missing_content(bool value) { has_missing_content_ = value; _has_field_.set(10); }
+
+  bool has_layer_tree_host_id() const { return _has_field_[11]; }
+  uint64_t layer_tree_host_id() const { return layer_tree_host_id_; }
+  void set_layer_tree_host_id(uint64_t value) { layer_tree_host_id_ = value; _has_field_.set(11); }
+
+ private:
+  ChromeFrameReporter_State state_{};
+  ChromeFrameReporter_FrameDropReason reason_{};
+  uint64_t frame_source_{};
+  uint64_t frame_sequence_{};
+  bool affects_smoothness_{};
+  ChromeFrameReporter_ScrollState scroll_state_{};
+  bool has_main_animation_{};
+  bool has_compositor_animation_{};
+  bool has_smooth_input_main_{};
+  bool has_missing_content_{};
+  uint64_t layer_tree_host_id_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<12> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_FRAME_REPORTER_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_frame_reporter.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+ChromeFrameReporter::ChromeFrameReporter() = default;
+ChromeFrameReporter::~ChromeFrameReporter() = default;
+ChromeFrameReporter::ChromeFrameReporter(const ChromeFrameReporter&) = default;
+ChromeFrameReporter& ChromeFrameReporter::operator=(const ChromeFrameReporter&) = default;
+ChromeFrameReporter::ChromeFrameReporter(ChromeFrameReporter&&) noexcept = default;
+ChromeFrameReporter& ChromeFrameReporter::operator=(ChromeFrameReporter&&) = default;
+
+bool ChromeFrameReporter::operator==(const ChromeFrameReporter& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && state_ == other.state_
+   && reason_ == other.reason_
+   && frame_source_ == other.frame_source_
+   && frame_sequence_ == other.frame_sequence_
+   && affects_smoothness_ == other.affects_smoothness_
+   && scroll_state_ == other.scroll_state_
+   && has_main_animation_ == other.has_main_animation_
+   && has_compositor_animation_ == other.has_compositor_animation_
+   && has_smooth_input_main_ == other.has_smooth_input_main_
+   && has_missing_content_ == other.has_missing_content_
+   && layer_tree_host_id_ == other.layer_tree_host_id_;
+}
+
+bool ChromeFrameReporter::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* state */:
+        field.get(&state_);
+        break;
+      case 2 /* reason */:
+        field.get(&reason_);
+        break;
+      case 3 /* frame_source */:
+        field.get(&frame_source_);
+        break;
+      case 4 /* frame_sequence */:
+        field.get(&frame_sequence_);
+        break;
+      case 5 /* affects_smoothness */:
+        field.get(&affects_smoothness_);
+        break;
+      case 6 /* scroll_state */:
+        field.get(&scroll_state_);
+        break;
+      case 7 /* has_main_animation */:
+        field.get(&has_main_animation_);
+        break;
+      case 8 /* has_compositor_animation */:
+        field.get(&has_compositor_animation_);
+        break;
+      case 9 /* has_smooth_input_main */:
+        field.get(&has_smooth_input_main_);
+        break;
+      case 10 /* has_missing_content */:
+        field.get(&has_missing_content_);
+        break;
+      case 11 /* layer_tree_host_id */:
+        field.get(&layer_tree_host_id_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ChromeFrameReporter::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ChromeFrameReporter::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ChromeFrameReporter::Serialize(::protozero::Message* msg) const {
+  // Field 1: state
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, state_);
+  }
+
+  // Field 2: reason
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, reason_);
+  }
+
+  // Field 3: frame_source
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, frame_source_);
+  }
+
+  // Field 4: frame_sequence
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, frame_sequence_);
+  }
+
+  // Field 5: affects_smoothness
+  if (_has_field_[5]) {
+    msg->AppendTinyVarInt(5, affects_smoothness_);
+  }
+
+  // Field 6: scroll_state
+  if (_has_field_[6]) {
+    msg->AppendVarInt(6, scroll_state_);
+  }
+
+  // Field 7: has_main_animation
+  if (_has_field_[7]) {
+    msg->AppendTinyVarInt(7, has_main_animation_);
+  }
+
+  // Field 8: has_compositor_animation
+  if (_has_field_[8]) {
+    msg->AppendTinyVarInt(8, has_compositor_animation_);
+  }
+
+  // Field 9: has_smooth_input_main
+  if (_has_field_[9]) {
+    msg->AppendTinyVarInt(9, has_smooth_input_main_);
+  }
+
+  // Field 10: has_missing_content
+  if (_has_field_[10]) {
+    msg->AppendTinyVarInt(10, has_missing_content_);
+  }
+
+  // Field 11: layer_tree_host_id
+  if (_has_field_[11]) {
+    msg->AppendVarInt(11, layer_tree_host_id_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_histogram_sample.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_histogram_sample.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_HISTOGRAM_SAMPLE_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_HISTOGRAM_SAMPLE_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeHistogramSample;
+class HistogramName;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT ChromeHistogramSample : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNameHashFieldNumber = 1,
+    kNameFieldNumber = 2,
+    kSampleFieldNumber = 3,
+    kNameIidFieldNumber = 4,
+  };
+
+  ChromeHistogramSample();
+  ~ChromeHistogramSample() override;
+  ChromeHistogramSample(ChromeHistogramSample&&) noexcept;
+  ChromeHistogramSample& operator=(ChromeHistogramSample&&);
+  ChromeHistogramSample(const ChromeHistogramSample&);
+  ChromeHistogramSample& operator=(const ChromeHistogramSample&);
+  bool operator==(const ChromeHistogramSample&) const;
+  bool operator!=(const ChromeHistogramSample& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name_hash() const { return _has_field_[1]; }
+  uint64_t name_hash() const { return name_hash_; }
+  void set_name_hash(uint64_t value) { name_hash_ = value; _has_field_.set(1); }
+
+  bool has_name() const { return _has_field_[2]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(2); }
+
+  bool has_sample() const { return _has_field_[3]; }
+  int64_t sample() const { return sample_; }
+  void set_sample(int64_t value) { sample_ = value; _has_field_.set(3); }
+
+  bool has_name_iid() const { return _has_field_[4]; }
+  uint64_t name_iid() const { return name_iid_; }
+  void set_name_iid(uint64_t value) { name_iid_ = value; _has_field_.set(4); }
+
+ private:
+  uint64_t name_hash_{};
+  std::string name_{};
+  int64_t sample_{};
+  uint64_t name_iid_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<5> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT HistogramName : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kIidFieldNumber = 1,
+    kNameFieldNumber = 2,
+  };
+
+  HistogramName();
+  ~HistogramName() override;
+  HistogramName(HistogramName&&) noexcept;
+  HistogramName& operator=(HistogramName&&);
+  HistogramName(const HistogramName&);
+  HistogramName& operator=(const HistogramName&);
+  bool operator==(const HistogramName&) const;
+  bool operator!=(const HistogramName& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_iid() const { return _has_field_[1]; }
+  uint64_t iid() const { return iid_; }
+  void set_iid(uint64_t value) { iid_ = value; _has_field_.set(1); }
+
+  bool has_name() const { return _has_field_[2]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(2); }
+
+ private:
+  uint64_t iid_{};
+  std::string name_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_HISTOGRAM_SAMPLE_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_histogram_sample.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+ChromeHistogramSample::ChromeHistogramSample() = default;
+ChromeHistogramSample::~ChromeHistogramSample() = default;
+ChromeHistogramSample::ChromeHistogramSample(const ChromeHistogramSample&) = default;
+ChromeHistogramSample& ChromeHistogramSample::operator=(const ChromeHistogramSample&) = default;
+ChromeHistogramSample::ChromeHistogramSample(ChromeHistogramSample&&) noexcept = default;
+ChromeHistogramSample& ChromeHistogramSample::operator=(ChromeHistogramSample&&) = default;
+
+bool ChromeHistogramSample::operator==(const ChromeHistogramSample& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && name_hash_ == other.name_hash_
+   && name_ == other.name_
+   && sample_ == other.sample_
+   && name_iid_ == other.name_iid_;
+}
+
+bool ChromeHistogramSample::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* name_hash */:
+        field.get(&name_hash_);
+        break;
+      case 2 /* name */:
+        field.get(&name_);
+        break;
+      case 3 /* sample */:
+        field.get(&sample_);
+        break;
+      case 4 /* name_iid */:
+        field.get(&name_iid_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ChromeHistogramSample::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ChromeHistogramSample::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ChromeHistogramSample::Serialize(::protozero::Message* msg) const {
+  // Field 1: name_hash
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, name_hash_);
+  }
+
+  // Field 2: name
+  if (_has_field_[2]) {
+    msg->AppendString(2, name_);
+  }
+
+  // Field 3: sample
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, sample_);
+  }
+
+  // Field 4: name_iid
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, name_iid_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+HistogramName::HistogramName() = default;
+HistogramName::~HistogramName() = default;
+HistogramName::HistogramName(const HistogramName&) = default;
+HistogramName& HistogramName::operator=(const HistogramName&) = default;
+HistogramName::HistogramName(HistogramName&&) noexcept = default;
+HistogramName& HistogramName::operator=(HistogramName&&) = default;
+
+bool HistogramName::operator==(const HistogramName& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && iid_ == other.iid_
+   && name_ == other.name_;
+}
+
+bool HistogramName::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* iid */:
+        field.get(&iid_);
+        break;
+      case 2 /* name */:
+        field.get(&name_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string HistogramName::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> HistogramName::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void HistogramName::Serialize(::protozero::Message* msg) const {
+  // Field 1: iid
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, iid_);
+  }
+
+  // Field 2: name
+  if (_has_field_[2]) {
+    msg->AppendString(2, name_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_keyed_service.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_keyed_service.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_KEYED_SERVICE_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_KEYED_SERVICE_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeKeyedService;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT ChromeKeyedService : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNameFieldNumber = 1,
+  };
+
+  ChromeKeyedService();
+  ~ChromeKeyedService() override;
+  ChromeKeyedService(ChromeKeyedService&&) noexcept;
+  ChromeKeyedService& operator=(ChromeKeyedService&&);
+  ChromeKeyedService(const ChromeKeyedService&);
+  ChromeKeyedService& operator=(const ChromeKeyedService&);
+  bool operator==(const ChromeKeyedService&) const;
+  bool operator!=(const ChromeKeyedService& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name() const { return _has_field_[1]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
+
+ private:
+  std::string name_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_KEYED_SERVICE_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_keyed_service.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+ChromeKeyedService::ChromeKeyedService() = default;
+ChromeKeyedService::~ChromeKeyedService() = default;
+ChromeKeyedService::ChromeKeyedService(const ChromeKeyedService&) = default;
+ChromeKeyedService& ChromeKeyedService::operator=(const ChromeKeyedService&) = default;
+ChromeKeyedService::ChromeKeyedService(ChromeKeyedService&&) noexcept = default;
+ChromeKeyedService& ChromeKeyedService::operator=(ChromeKeyedService&&) = default;
+
+bool ChromeKeyedService::operator==(const ChromeKeyedService& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && name_ == other.name_;
+}
+
+bool ChromeKeyedService::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* name */:
+        field.get(&name_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ChromeKeyedService::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ChromeKeyedService::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ChromeKeyedService::Serialize(::protozero::Message* msg) const {
+  // Field 1: name
+  if (_has_field_[1]) {
+    msg->AppendString(1, name_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_latency_info.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_latency_info.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_LATENCY_INFO_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_LATENCY_INFO_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeLatencyInfo;
+class ChromeLatencyInfo_ComponentInfo;
+enum ChromeLatencyInfo_Step : int;
+enum ChromeLatencyInfo_LatencyComponentType : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum ChromeLatencyInfo_Step : int {
+  ChromeLatencyInfo_Step_STEP_UNSPECIFIED = 0,
+  ChromeLatencyInfo_Step_STEP_SEND_INPUT_EVENT_UI = 3,
+  ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_IMPL = 5,
+  ChromeLatencyInfo_Step_STEP_DID_HANDLE_INPUT_AND_OVERSCROLL = 8,
+  ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_MAIN = 4,
+  ChromeLatencyInfo_Step_STEP_MAIN_THREAD_SCROLL_UPDATE = 2,
+  ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_MAIN_COMMIT = 1,
+  ChromeLatencyInfo_Step_STEP_HANDLED_INPUT_EVENT_MAIN_OR_IMPL = 9,
+  ChromeLatencyInfo_Step_STEP_HANDLED_INPUT_EVENT_IMPL = 10,
+  ChromeLatencyInfo_Step_STEP_SWAP_BUFFERS = 6,
+  ChromeLatencyInfo_Step_STEP_DRAW_AND_SWAP = 7,
+  ChromeLatencyInfo_Step_STEP_FINISHED_SWAP_BUFFERS = 11,
+};
+enum ChromeLatencyInfo_LatencyComponentType : int {
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_UNSPECIFIED = 0,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_BEGIN_RWH = 1,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL = 2,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL = 3,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_ORIGINAL = 4,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_UI = 5,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERER_MAIN = 6,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN = 7,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL = 8,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_LAST_EVENT = 9,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_ACK_RWH = 10,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERER_SWAP = 11,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_DISPLAY_COMPOSITOR_RECEIVED_FRAME = 12,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_GPU_SWAP_BUFFER = 13,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_FRAME_SWAP = 14,
+};
+
+class PERFETTO_EXPORT ChromeLatencyInfo : public ::protozero::CppMessageObj {
+ public:
+  using ComponentInfo = ChromeLatencyInfo_ComponentInfo;
+  using Step = ChromeLatencyInfo_Step;
+  static constexpr auto STEP_UNSPECIFIED = ChromeLatencyInfo_Step_STEP_UNSPECIFIED;
+  static constexpr auto STEP_SEND_INPUT_EVENT_UI = ChromeLatencyInfo_Step_STEP_SEND_INPUT_EVENT_UI;
+  static constexpr auto STEP_HANDLE_INPUT_EVENT_IMPL = ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_IMPL;
+  static constexpr auto STEP_DID_HANDLE_INPUT_AND_OVERSCROLL = ChromeLatencyInfo_Step_STEP_DID_HANDLE_INPUT_AND_OVERSCROLL;
+  static constexpr auto STEP_HANDLE_INPUT_EVENT_MAIN = ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_MAIN;
+  static constexpr auto STEP_MAIN_THREAD_SCROLL_UPDATE = ChromeLatencyInfo_Step_STEP_MAIN_THREAD_SCROLL_UPDATE;
+  static constexpr auto STEP_HANDLE_INPUT_EVENT_MAIN_COMMIT = ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_MAIN_COMMIT;
+  static constexpr auto STEP_HANDLED_INPUT_EVENT_MAIN_OR_IMPL = ChromeLatencyInfo_Step_STEP_HANDLED_INPUT_EVENT_MAIN_OR_IMPL;
+  static constexpr auto STEP_HANDLED_INPUT_EVENT_IMPL = ChromeLatencyInfo_Step_STEP_HANDLED_INPUT_EVENT_IMPL;
+  static constexpr auto STEP_SWAP_BUFFERS = ChromeLatencyInfo_Step_STEP_SWAP_BUFFERS;
+  static constexpr auto STEP_DRAW_AND_SWAP = ChromeLatencyInfo_Step_STEP_DRAW_AND_SWAP;
+  static constexpr auto STEP_FINISHED_SWAP_BUFFERS = ChromeLatencyInfo_Step_STEP_FINISHED_SWAP_BUFFERS;
+  static constexpr auto Step_MIN = ChromeLatencyInfo_Step_STEP_UNSPECIFIED;
+  static constexpr auto Step_MAX = ChromeLatencyInfo_Step_STEP_FINISHED_SWAP_BUFFERS;
+  using LatencyComponentType = ChromeLatencyInfo_LatencyComponentType;
+  static constexpr auto COMPONENT_UNSPECIFIED = ChromeLatencyInfo_LatencyComponentType_COMPONENT_UNSPECIFIED;
+  static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_BEGIN_RWH = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_BEGIN_RWH;
+  static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL;
+  static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL;
+  static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_ORIGINAL = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_ORIGINAL;
+  static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_UI = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_UI;
+  static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_RENDERER_MAIN = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERER_MAIN;
+  static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN;
+  static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL;
+  static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_LAST_EVENT = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_LAST_EVENT;
+  static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_ACK_RWH = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_ACK_RWH;
+  static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_RENDERER_SWAP = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERER_SWAP;
+  static constexpr auto COMPONENT_DISPLAY_COMPOSITOR_RECEIVED_FRAME = ChromeLatencyInfo_LatencyComponentType_COMPONENT_DISPLAY_COMPOSITOR_RECEIVED_FRAME;
+  static constexpr auto COMPONENT_INPUT_EVENT_GPU_SWAP_BUFFER = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_GPU_SWAP_BUFFER;
+  static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_FRAME_SWAP = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_FRAME_SWAP;
+  static constexpr auto LatencyComponentType_MIN = ChromeLatencyInfo_LatencyComponentType_COMPONENT_UNSPECIFIED;
+  static constexpr auto LatencyComponentType_MAX = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_FRAME_SWAP;
+  enum FieldNumbers {
+    kTraceIdFieldNumber = 1,
+    kStepFieldNumber = 2,
+    kFrameTreeNodeIdFieldNumber = 3,
+    kComponentInfoFieldNumber = 4,
+    kIsCoalescedFieldNumber = 5,
+    kGestureScrollIdFieldNumber = 6,
+  };
+
+  ChromeLatencyInfo();
+  ~ChromeLatencyInfo() override;
+  ChromeLatencyInfo(ChromeLatencyInfo&&) noexcept;
+  ChromeLatencyInfo& operator=(ChromeLatencyInfo&&);
+  ChromeLatencyInfo(const ChromeLatencyInfo&);
+  ChromeLatencyInfo& operator=(const ChromeLatencyInfo&);
+  bool operator==(const ChromeLatencyInfo&) const;
+  bool operator!=(const ChromeLatencyInfo& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_trace_id() const { return _has_field_[1]; }
+  int64_t trace_id() const { return trace_id_; }
+  void set_trace_id(int64_t value) { trace_id_ = value; _has_field_.set(1); }
+
+  bool has_step() const { return _has_field_[2]; }
+  ChromeLatencyInfo_Step step() const { return step_; }
+  void set_step(ChromeLatencyInfo_Step value) { step_ = value; _has_field_.set(2); }
+
+  bool has_frame_tree_node_id() const { return _has_field_[3]; }
+  int32_t frame_tree_node_id() const { return frame_tree_node_id_; }
+  void set_frame_tree_node_id(int32_t value) { frame_tree_node_id_ = value; _has_field_.set(3); }
+
+  const std::vector<ChromeLatencyInfo_ComponentInfo>& component_info() const { return component_info_; }
+  std::vector<ChromeLatencyInfo_ComponentInfo>* mutable_component_info() { return &component_info_; }
+  int component_info_size() const;
+  void clear_component_info();
+  ChromeLatencyInfo_ComponentInfo* add_component_info();
+
+  bool has_is_coalesced() const { return _has_field_[5]; }
+  bool is_coalesced() const { return is_coalesced_; }
+  void set_is_coalesced(bool value) { is_coalesced_ = value; _has_field_.set(5); }
+
+  bool has_gesture_scroll_id() const { return _has_field_[6]; }
+  int64_t gesture_scroll_id() const { return gesture_scroll_id_; }
+  void set_gesture_scroll_id(int64_t value) { gesture_scroll_id_ = value; _has_field_.set(6); }
+
+ private:
+  int64_t trace_id_{};
+  ChromeLatencyInfo_Step step_{};
+  int32_t frame_tree_node_id_{};
+  std::vector<ChromeLatencyInfo_ComponentInfo> component_info_;
+  bool is_coalesced_{};
+  int64_t gesture_scroll_id_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<7> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ChromeLatencyInfo_ComponentInfo : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kComponentTypeFieldNumber = 1,
+    kTimeUsFieldNumber = 2,
+  };
+
+  ChromeLatencyInfo_ComponentInfo();
+  ~ChromeLatencyInfo_ComponentInfo() override;
+  ChromeLatencyInfo_ComponentInfo(ChromeLatencyInfo_ComponentInfo&&) noexcept;
+  ChromeLatencyInfo_ComponentInfo& operator=(ChromeLatencyInfo_ComponentInfo&&);
+  ChromeLatencyInfo_ComponentInfo(const ChromeLatencyInfo_ComponentInfo&);
+  ChromeLatencyInfo_ComponentInfo& operator=(const ChromeLatencyInfo_ComponentInfo&);
+  bool operator==(const ChromeLatencyInfo_ComponentInfo&) const;
+  bool operator!=(const ChromeLatencyInfo_ComponentInfo& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_component_type() const { return _has_field_[1]; }
+  ChromeLatencyInfo_LatencyComponentType component_type() const { return component_type_; }
+  void set_component_type(ChromeLatencyInfo_LatencyComponentType value) { component_type_ = value; _has_field_.set(1); }
+
+  bool has_time_us() const { return _has_field_[2]; }
+  uint64_t time_us() const { return time_us_; }
+  void set_time_us(uint64_t value) { time_us_ = value; _has_field_.set(2); }
+
+ private:
+  ChromeLatencyInfo_LatencyComponentType component_type_{};
+  uint64_t time_us_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_LATENCY_INFO_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_latency_info.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+ChromeLatencyInfo::ChromeLatencyInfo() = default;
+ChromeLatencyInfo::~ChromeLatencyInfo() = default;
+ChromeLatencyInfo::ChromeLatencyInfo(const ChromeLatencyInfo&) = default;
+ChromeLatencyInfo& ChromeLatencyInfo::operator=(const ChromeLatencyInfo&) = default;
+ChromeLatencyInfo::ChromeLatencyInfo(ChromeLatencyInfo&&) noexcept = default;
+ChromeLatencyInfo& ChromeLatencyInfo::operator=(ChromeLatencyInfo&&) = default;
+
+bool ChromeLatencyInfo::operator==(const ChromeLatencyInfo& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && trace_id_ == other.trace_id_
+   && step_ == other.step_
+   && frame_tree_node_id_ == other.frame_tree_node_id_
+   && component_info_ == other.component_info_
+   && is_coalesced_ == other.is_coalesced_
+   && gesture_scroll_id_ == other.gesture_scroll_id_;
+}
+
+int ChromeLatencyInfo::component_info_size() const { return static_cast<int>(component_info_.size()); }
+void ChromeLatencyInfo::clear_component_info() { component_info_.clear(); }
+ChromeLatencyInfo_ComponentInfo* ChromeLatencyInfo::add_component_info() { component_info_.emplace_back(); return &component_info_.back(); }
+bool ChromeLatencyInfo::ParseFromArray(const void* raw, size_t size) {
+  component_info_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* trace_id */:
+        field.get(&trace_id_);
+        break;
+      case 2 /* step */:
+        field.get(&step_);
+        break;
+      case 3 /* frame_tree_node_id */:
+        field.get(&frame_tree_node_id_);
+        break;
+      case 4 /* component_info */:
+        component_info_.emplace_back();
+        component_info_.back().ParseFromArray(field.data(), field.size());
+        break;
+      case 5 /* is_coalesced */:
+        field.get(&is_coalesced_);
+        break;
+      case 6 /* gesture_scroll_id */:
+        field.get(&gesture_scroll_id_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ChromeLatencyInfo::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ChromeLatencyInfo::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ChromeLatencyInfo::Serialize(::protozero::Message* msg) const {
+  // Field 1: trace_id
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, trace_id_);
+  }
+
+  // Field 2: step
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, step_);
+  }
+
+  // Field 3: frame_tree_node_id
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, frame_tree_node_id_);
+  }
+
+  // Field 4: component_info
+  for (auto& it : component_info_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(4));
+  }
+
+  // Field 5: is_coalesced
+  if (_has_field_[5]) {
+    msg->AppendTinyVarInt(5, is_coalesced_);
+  }
+
+  // Field 6: gesture_scroll_id
+  if (_has_field_[6]) {
+    msg->AppendVarInt(6, gesture_scroll_id_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+ChromeLatencyInfo_ComponentInfo::ChromeLatencyInfo_ComponentInfo() = default;
+ChromeLatencyInfo_ComponentInfo::~ChromeLatencyInfo_ComponentInfo() = default;
+ChromeLatencyInfo_ComponentInfo::ChromeLatencyInfo_ComponentInfo(const ChromeLatencyInfo_ComponentInfo&) = default;
+ChromeLatencyInfo_ComponentInfo& ChromeLatencyInfo_ComponentInfo::operator=(const ChromeLatencyInfo_ComponentInfo&) = default;
+ChromeLatencyInfo_ComponentInfo::ChromeLatencyInfo_ComponentInfo(ChromeLatencyInfo_ComponentInfo&&) noexcept = default;
+ChromeLatencyInfo_ComponentInfo& ChromeLatencyInfo_ComponentInfo::operator=(ChromeLatencyInfo_ComponentInfo&&) = default;
+
+bool ChromeLatencyInfo_ComponentInfo::operator==(const ChromeLatencyInfo_ComponentInfo& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && component_type_ == other.component_type_
+   && time_us_ == other.time_us_;
+}
+
+bool ChromeLatencyInfo_ComponentInfo::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* component_type */:
+        field.get(&component_type_);
+        break;
+      case 2 /* time_us */:
+        field.get(&time_us_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ChromeLatencyInfo_ComponentInfo::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ChromeLatencyInfo_ComponentInfo::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ChromeLatencyInfo_ComponentInfo::Serialize(::protozero::Message* msg) const {
+  // Field 1: component_type
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, component_type_);
+  }
+
+  // Field 2: time_us
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, time_us_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_legacy_ipc.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_legacy_ipc.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_LEGACY_IPC_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_LEGACY_IPC_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeLegacyIpc;
+enum ChromeLegacyIpc_MessageClass : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum ChromeLegacyIpc_MessageClass : int {
+  ChromeLegacyIpc_MessageClass_CLASS_UNSPECIFIED = 0,
+  ChromeLegacyIpc_MessageClass_CLASS_AUTOMATION = 1,
+  ChromeLegacyIpc_MessageClass_CLASS_FRAME = 2,
+  ChromeLegacyIpc_MessageClass_CLASS_PAGE = 3,
+  ChromeLegacyIpc_MessageClass_CLASS_VIEW = 4,
+  ChromeLegacyIpc_MessageClass_CLASS_WIDGET = 5,
+  ChromeLegacyIpc_MessageClass_CLASS_INPUT = 6,
+  ChromeLegacyIpc_MessageClass_CLASS_TEST = 7,
+  ChromeLegacyIpc_MessageClass_CLASS_WORKER = 8,
+  ChromeLegacyIpc_MessageClass_CLASS_NACL = 9,
+  ChromeLegacyIpc_MessageClass_CLASS_GPU_CHANNEL = 10,
+  ChromeLegacyIpc_MessageClass_CLASS_MEDIA = 11,
+  ChromeLegacyIpc_MessageClass_CLASS_PPAPI = 12,
+  ChromeLegacyIpc_MessageClass_CLASS_CHROME = 13,
+  ChromeLegacyIpc_MessageClass_CLASS_DRAG = 14,
+  ChromeLegacyIpc_MessageClass_CLASS_PRINT = 15,
+  ChromeLegacyIpc_MessageClass_CLASS_EXTENSION = 16,
+  ChromeLegacyIpc_MessageClass_CLASS_TEXT_INPUT_CLIENT = 17,
+  ChromeLegacyIpc_MessageClass_CLASS_BLINK_TEST = 18,
+  ChromeLegacyIpc_MessageClass_CLASS_ACCESSIBILITY = 19,
+  ChromeLegacyIpc_MessageClass_CLASS_PRERENDER = 20,
+  ChromeLegacyIpc_MessageClass_CLASS_CHROMOTING = 21,
+  ChromeLegacyIpc_MessageClass_CLASS_BROWSER_PLUGIN = 22,
+  ChromeLegacyIpc_MessageClass_CLASS_ANDROID_WEB_VIEW = 23,
+  ChromeLegacyIpc_MessageClass_CLASS_NACL_HOST = 24,
+  ChromeLegacyIpc_MessageClass_CLASS_ENCRYPTED_MEDIA = 25,
+  ChromeLegacyIpc_MessageClass_CLASS_CAST = 26,
+  ChromeLegacyIpc_MessageClass_CLASS_GIN_JAVA_BRIDGE = 27,
+  ChromeLegacyIpc_MessageClass_CLASS_CHROME_UTILITY_PRINTING = 28,
+  ChromeLegacyIpc_MessageClass_CLASS_OZONE_GPU = 29,
+  ChromeLegacyIpc_MessageClass_CLASS_WEB_TEST = 30,
+  ChromeLegacyIpc_MessageClass_CLASS_NETWORK_HINTS = 31,
+  ChromeLegacyIpc_MessageClass_CLASS_EXTENSIONS_GUEST_VIEW = 32,
+  ChromeLegacyIpc_MessageClass_CLASS_GUEST_VIEW = 33,
+  ChromeLegacyIpc_MessageClass_CLASS_MEDIA_PLAYER_DELEGATE = 34,
+  ChromeLegacyIpc_MessageClass_CLASS_EXTENSION_WORKER = 35,
+  ChromeLegacyIpc_MessageClass_CLASS_SUBRESOURCE_FILTER = 36,
+  ChromeLegacyIpc_MessageClass_CLASS_UNFREEZABLE_FRAME = 37,
+};
+
+class PERFETTO_EXPORT ChromeLegacyIpc : public ::protozero::CppMessageObj {
+ public:
+  using MessageClass = ChromeLegacyIpc_MessageClass;
+  static constexpr auto CLASS_UNSPECIFIED = ChromeLegacyIpc_MessageClass_CLASS_UNSPECIFIED;
+  static constexpr auto CLASS_AUTOMATION = ChromeLegacyIpc_MessageClass_CLASS_AUTOMATION;
+  static constexpr auto CLASS_FRAME = ChromeLegacyIpc_MessageClass_CLASS_FRAME;
+  static constexpr auto CLASS_PAGE = ChromeLegacyIpc_MessageClass_CLASS_PAGE;
+  static constexpr auto CLASS_VIEW = ChromeLegacyIpc_MessageClass_CLASS_VIEW;
+  static constexpr auto CLASS_WIDGET = ChromeLegacyIpc_MessageClass_CLASS_WIDGET;
+  static constexpr auto CLASS_INPUT = ChromeLegacyIpc_MessageClass_CLASS_INPUT;
+  static constexpr auto CLASS_TEST = ChromeLegacyIpc_MessageClass_CLASS_TEST;
+  static constexpr auto CLASS_WORKER = ChromeLegacyIpc_MessageClass_CLASS_WORKER;
+  static constexpr auto CLASS_NACL = ChromeLegacyIpc_MessageClass_CLASS_NACL;
+  static constexpr auto CLASS_GPU_CHANNEL = ChromeLegacyIpc_MessageClass_CLASS_GPU_CHANNEL;
+  static constexpr auto CLASS_MEDIA = ChromeLegacyIpc_MessageClass_CLASS_MEDIA;
+  static constexpr auto CLASS_PPAPI = ChromeLegacyIpc_MessageClass_CLASS_PPAPI;
+  static constexpr auto CLASS_CHROME = ChromeLegacyIpc_MessageClass_CLASS_CHROME;
+  static constexpr auto CLASS_DRAG = ChromeLegacyIpc_MessageClass_CLASS_DRAG;
+  static constexpr auto CLASS_PRINT = ChromeLegacyIpc_MessageClass_CLASS_PRINT;
+  static constexpr auto CLASS_EXTENSION = ChromeLegacyIpc_MessageClass_CLASS_EXTENSION;
+  static constexpr auto CLASS_TEXT_INPUT_CLIENT = ChromeLegacyIpc_MessageClass_CLASS_TEXT_INPUT_CLIENT;
+  static constexpr auto CLASS_BLINK_TEST = ChromeLegacyIpc_MessageClass_CLASS_BLINK_TEST;
+  static constexpr auto CLASS_ACCESSIBILITY = ChromeLegacyIpc_MessageClass_CLASS_ACCESSIBILITY;
+  static constexpr auto CLASS_PRERENDER = ChromeLegacyIpc_MessageClass_CLASS_PRERENDER;
+  static constexpr auto CLASS_CHROMOTING = ChromeLegacyIpc_MessageClass_CLASS_CHROMOTING;
+  static constexpr auto CLASS_BROWSER_PLUGIN = ChromeLegacyIpc_MessageClass_CLASS_BROWSER_PLUGIN;
+  static constexpr auto CLASS_ANDROID_WEB_VIEW = ChromeLegacyIpc_MessageClass_CLASS_ANDROID_WEB_VIEW;
+  static constexpr auto CLASS_NACL_HOST = ChromeLegacyIpc_MessageClass_CLASS_NACL_HOST;
+  static constexpr auto CLASS_ENCRYPTED_MEDIA = ChromeLegacyIpc_MessageClass_CLASS_ENCRYPTED_MEDIA;
+  static constexpr auto CLASS_CAST = ChromeLegacyIpc_MessageClass_CLASS_CAST;
+  static constexpr auto CLASS_GIN_JAVA_BRIDGE = ChromeLegacyIpc_MessageClass_CLASS_GIN_JAVA_BRIDGE;
+  static constexpr auto CLASS_CHROME_UTILITY_PRINTING = ChromeLegacyIpc_MessageClass_CLASS_CHROME_UTILITY_PRINTING;
+  static constexpr auto CLASS_OZONE_GPU = ChromeLegacyIpc_MessageClass_CLASS_OZONE_GPU;
+  static constexpr auto CLASS_WEB_TEST = ChromeLegacyIpc_MessageClass_CLASS_WEB_TEST;
+  static constexpr auto CLASS_NETWORK_HINTS = ChromeLegacyIpc_MessageClass_CLASS_NETWORK_HINTS;
+  static constexpr auto CLASS_EXTENSIONS_GUEST_VIEW = ChromeLegacyIpc_MessageClass_CLASS_EXTENSIONS_GUEST_VIEW;
+  static constexpr auto CLASS_GUEST_VIEW = ChromeLegacyIpc_MessageClass_CLASS_GUEST_VIEW;
+  static constexpr auto CLASS_MEDIA_PLAYER_DELEGATE = ChromeLegacyIpc_MessageClass_CLASS_MEDIA_PLAYER_DELEGATE;
+  static constexpr auto CLASS_EXTENSION_WORKER = ChromeLegacyIpc_MessageClass_CLASS_EXTENSION_WORKER;
+  static constexpr auto CLASS_SUBRESOURCE_FILTER = ChromeLegacyIpc_MessageClass_CLASS_SUBRESOURCE_FILTER;
+  static constexpr auto CLASS_UNFREEZABLE_FRAME = ChromeLegacyIpc_MessageClass_CLASS_UNFREEZABLE_FRAME;
+  static constexpr auto MessageClass_MIN = ChromeLegacyIpc_MessageClass_CLASS_UNSPECIFIED;
+  static constexpr auto MessageClass_MAX = ChromeLegacyIpc_MessageClass_CLASS_UNFREEZABLE_FRAME;
+  enum FieldNumbers {
+    kMessageClassFieldNumber = 1,
+    kMessageLineFieldNumber = 2,
+  };
+
+  ChromeLegacyIpc();
+  ~ChromeLegacyIpc() override;
+  ChromeLegacyIpc(ChromeLegacyIpc&&) noexcept;
+  ChromeLegacyIpc& operator=(ChromeLegacyIpc&&);
+  ChromeLegacyIpc(const ChromeLegacyIpc&);
+  ChromeLegacyIpc& operator=(const ChromeLegacyIpc&);
+  bool operator==(const ChromeLegacyIpc&) const;
+  bool operator!=(const ChromeLegacyIpc& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_message_class() const { return _has_field_[1]; }
+  ChromeLegacyIpc_MessageClass message_class() const { return message_class_; }
+  void set_message_class(ChromeLegacyIpc_MessageClass value) { message_class_ = value; _has_field_.set(1); }
+
+  bool has_message_line() const { return _has_field_[2]; }
+  uint32_t message_line() const { return message_line_; }
+  void set_message_line(uint32_t value) { message_line_ = value; _has_field_.set(2); }
+
+ private:
+  ChromeLegacyIpc_MessageClass message_class_{};
+  uint32_t message_line_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_LEGACY_IPC_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_legacy_ipc.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+ChromeLegacyIpc::ChromeLegacyIpc() = default;
+ChromeLegacyIpc::~ChromeLegacyIpc() = default;
+ChromeLegacyIpc::ChromeLegacyIpc(const ChromeLegacyIpc&) = default;
+ChromeLegacyIpc& ChromeLegacyIpc::operator=(const ChromeLegacyIpc&) = default;
+ChromeLegacyIpc::ChromeLegacyIpc(ChromeLegacyIpc&&) noexcept = default;
+ChromeLegacyIpc& ChromeLegacyIpc::operator=(ChromeLegacyIpc&&) = default;
+
+bool ChromeLegacyIpc::operator==(const ChromeLegacyIpc& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && message_class_ == other.message_class_
+   && message_line_ == other.message_line_;
+}
+
+bool ChromeLegacyIpc::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* message_class */:
+        field.get(&message_class_);
+        break;
+      case 2 /* message_line */:
+        field.get(&message_line_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ChromeLegacyIpc::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ChromeLegacyIpc::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ChromeLegacyIpc::Serialize(::protozero::Message* msg) const {
+  // Field 1: message_class
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, message_class_);
+  }
+
+  // Field 2: message_line
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, message_line_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_message_pump.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_message_pump.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_MESSAGE_PUMP_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_MESSAGE_PUMP_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeMessagePump;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT ChromeMessagePump : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kSentMessagesInQueueFieldNumber = 1,
+    kIoHandlerLocationIidFieldNumber = 2,
+  };
+
+  ChromeMessagePump();
+  ~ChromeMessagePump() override;
+  ChromeMessagePump(ChromeMessagePump&&) noexcept;
+  ChromeMessagePump& operator=(ChromeMessagePump&&);
+  ChromeMessagePump(const ChromeMessagePump&);
+  ChromeMessagePump& operator=(const ChromeMessagePump&);
+  bool operator==(const ChromeMessagePump&) const;
+  bool operator!=(const ChromeMessagePump& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_sent_messages_in_queue() const { return _has_field_[1]; }
+  bool sent_messages_in_queue() const { return sent_messages_in_queue_; }
+  void set_sent_messages_in_queue(bool value) { sent_messages_in_queue_ = value; _has_field_.set(1); }
+
+  bool has_io_handler_location_iid() const { return _has_field_[2]; }
+  uint64_t io_handler_location_iid() const { return io_handler_location_iid_; }
+  void set_io_handler_location_iid(uint64_t value) { io_handler_location_iid_ = value; _has_field_.set(2); }
+
+ private:
+  bool sent_messages_in_queue_{};
+  uint64_t io_handler_location_iid_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_MESSAGE_PUMP_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_message_pump.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+ChromeMessagePump::ChromeMessagePump() = default;
+ChromeMessagePump::~ChromeMessagePump() = default;
+ChromeMessagePump::ChromeMessagePump(const ChromeMessagePump&) = default;
+ChromeMessagePump& ChromeMessagePump::operator=(const ChromeMessagePump&) = default;
+ChromeMessagePump::ChromeMessagePump(ChromeMessagePump&&) noexcept = default;
+ChromeMessagePump& ChromeMessagePump::operator=(ChromeMessagePump&&) = default;
+
+bool ChromeMessagePump::operator==(const ChromeMessagePump& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && sent_messages_in_queue_ == other.sent_messages_in_queue_
+   && io_handler_location_iid_ == other.io_handler_location_iid_;
+}
+
+bool ChromeMessagePump::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* sent_messages_in_queue */:
+        field.get(&sent_messages_in_queue_);
+        break;
+      case 2 /* io_handler_location_iid */:
+        field.get(&io_handler_location_iid_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ChromeMessagePump::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ChromeMessagePump::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ChromeMessagePump::Serialize(::protozero::Message* msg) const {
+  // Field 1: sent_messages_in_queue
+  if (_has_field_[1]) {
+    msg->AppendTinyVarInt(1, sent_messages_in_queue_);
+  }
+
+  // Field 2: io_handler_location_iid
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, io_handler_location_iid_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_mojo_event_info.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_mojo_event_info.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_MOJO_EVENT_INFO_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_MOJO_EVENT_INFO_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeMojoEventInfo;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT ChromeMojoEventInfo : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kWatcherNotifyInterfaceTagFieldNumber = 1,
+    kIpcHashFieldNumber = 2,
+    kMojoInterfaceTagFieldNumber = 3,
+  };
+
+  ChromeMojoEventInfo();
+  ~ChromeMojoEventInfo() override;
+  ChromeMojoEventInfo(ChromeMojoEventInfo&&) noexcept;
+  ChromeMojoEventInfo& operator=(ChromeMojoEventInfo&&);
+  ChromeMojoEventInfo(const ChromeMojoEventInfo&);
+  ChromeMojoEventInfo& operator=(const ChromeMojoEventInfo&);
+  bool operator==(const ChromeMojoEventInfo&) const;
+  bool operator!=(const ChromeMojoEventInfo& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_watcher_notify_interface_tag() const { return _has_field_[1]; }
+  const std::string& watcher_notify_interface_tag() const { return watcher_notify_interface_tag_; }
+  void set_watcher_notify_interface_tag(const std::string& value) { watcher_notify_interface_tag_ = value; _has_field_.set(1); }
+
+  bool has_ipc_hash() const { return _has_field_[2]; }
+  uint32_t ipc_hash() const { return ipc_hash_; }
+  void set_ipc_hash(uint32_t value) { ipc_hash_ = value; _has_field_.set(2); }
+
+  bool has_mojo_interface_tag() const { return _has_field_[3]; }
+  const std::string& mojo_interface_tag() const { return mojo_interface_tag_; }
+  void set_mojo_interface_tag(const std::string& value) { mojo_interface_tag_ = value; _has_field_.set(3); }
+
+ private:
+  std::string watcher_notify_interface_tag_{};
+  uint32_t ipc_hash_{};
+  std::string mojo_interface_tag_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<4> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_MOJO_EVENT_INFO_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_mojo_event_info.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+ChromeMojoEventInfo::ChromeMojoEventInfo() = default;
+ChromeMojoEventInfo::~ChromeMojoEventInfo() = default;
+ChromeMojoEventInfo::ChromeMojoEventInfo(const ChromeMojoEventInfo&) = default;
+ChromeMojoEventInfo& ChromeMojoEventInfo::operator=(const ChromeMojoEventInfo&) = default;
+ChromeMojoEventInfo::ChromeMojoEventInfo(ChromeMojoEventInfo&&) noexcept = default;
+ChromeMojoEventInfo& ChromeMojoEventInfo::operator=(ChromeMojoEventInfo&&) = default;
+
+bool ChromeMojoEventInfo::operator==(const ChromeMojoEventInfo& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && watcher_notify_interface_tag_ == other.watcher_notify_interface_tag_
+   && ipc_hash_ == other.ipc_hash_
+   && mojo_interface_tag_ == other.mojo_interface_tag_;
+}
+
+bool ChromeMojoEventInfo::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* watcher_notify_interface_tag */:
+        field.get(&watcher_notify_interface_tag_);
+        break;
+      case 2 /* ipc_hash */:
+        field.get(&ipc_hash_);
+        break;
+      case 3 /* mojo_interface_tag */:
+        field.get(&mojo_interface_tag_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ChromeMojoEventInfo::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ChromeMojoEventInfo::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ChromeMojoEventInfo::Serialize(::protozero::Message* msg) const {
+  // Field 1: watcher_notify_interface_tag
+  if (_has_field_[1]) {
+    msg->AppendString(1, watcher_notify_interface_tag_);
+  }
+
+  // Field 2: ipc_hash
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, ipc_hash_);
+  }
+
+  // Field 3: mojo_interface_tag
+  if (_has_field_[3]) {
+    msg->AppendString(3, mojo_interface_tag_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_process_descriptor.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_process_descriptor.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_PROCESS_DESCRIPTOR_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_PROCESS_DESCRIPTOR_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeProcessDescriptor;
+enum ChromeProcessDescriptor_ProcessType : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum ChromeProcessDescriptor_ProcessType : int {
+  ChromeProcessDescriptor_ProcessType_PROCESS_UNSPECIFIED = 0,
+  ChromeProcessDescriptor_ProcessType_PROCESS_BROWSER = 1,
+  ChromeProcessDescriptor_ProcessType_PROCESS_RENDERER = 2,
+  ChromeProcessDescriptor_ProcessType_PROCESS_UTILITY = 3,
+  ChromeProcessDescriptor_ProcessType_PROCESS_ZYGOTE = 4,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SANDBOX_HELPER = 5,
+  ChromeProcessDescriptor_ProcessType_PROCESS_GPU = 6,
+  ChromeProcessDescriptor_ProcessType_PROCESS_PPAPI_PLUGIN = 7,
+  ChromeProcessDescriptor_ProcessType_PROCESS_PPAPI_BROKER = 8,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_NETWORK = 9,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_TRACING = 10,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_STORAGE = 11,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_AUDIO = 12,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_DATA_DECODER = 13,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_UTIL_WIN = 14,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PROXY_RESOLVER = 15,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_CDM = 16,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_VIDEO_CAPTURE = 17,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_UNZIPPER = 18,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_MIRRORING = 19,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_FILEPATCHER = 20,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_TTS = 21,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PRINTING = 22,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_QUARANTINE = 23,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_CROS_LOCALSEARCH = 24,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_CROS_ASSISTANT_AUDIO_DECODER = 25,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_FILEUTIL = 26,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PRINTCOMPOSITOR = 27,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PAINTPREVIEW = 28,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_SPEECHRECOGNITION = 29,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_XRDEVICE = 30,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_READICON = 31,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_LANGUAGEDETECTION = 32,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_SHARING = 33,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_MEDIAPARSER = 34,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_QRCODEGENERATOR = 35,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PROFILEIMPORT = 36,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_IME = 37,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_RECORDING = 38,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_SHAPEDETECTION = 39,
+};
+
+class PERFETTO_EXPORT ChromeProcessDescriptor : public ::protozero::CppMessageObj {
+ public:
+  using ProcessType = ChromeProcessDescriptor_ProcessType;
+  static constexpr auto PROCESS_UNSPECIFIED = ChromeProcessDescriptor_ProcessType_PROCESS_UNSPECIFIED;
+  static constexpr auto PROCESS_BROWSER = ChromeProcessDescriptor_ProcessType_PROCESS_BROWSER;
+  static constexpr auto PROCESS_RENDERER = ChromeProcessDescriptor_ProcessType_PROCESS_RENDERER;
+  static constexpr auto PROCESS_UTILITY = ChromeProcessDescriptor_ProcessType_PROCESS_UTILITY;
+  static constexpr auto PROCESS_ZYGOTE = ChromeProcessDescriptor_ProcessType_PROCESS_ZYGOTE;
+  static constexpr auto PROCESS_SANDBOX_HELPER = ChromeProcessDescriptor_ProcessType_PROCESS_SANDBOX_HELPER;
+  static constexpr auto PROCESS_GPU = ChromeProcessDescriptor_ProcessType_PROCESS_GPU;
+  static constexpr auto PROCESS_PPAPI_PLUGIN = ChromeProcessDescriptor_ProcessType_PROCESS_PPAPI_PLUGIN;
+  static constexpr auto PROCESS_PPAPI_BROKER = ChromeProcessDescriptor_ProcessType_PROCESS_PPAPI_BROKER;
+  static constexpr auto PROCESS_SERVICE_NETWORK = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_NETWORK;
+  static constexpr auto PROCESS_SERVICE_TRACING = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_TRACING;
+  static constexpr auto PROCESS_SERVICE_STORAGE = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_STORAGE;
+  static constexpr auto PROCESS_SERVICE_AUDIO = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_AUDIO;
+  static constexpr auto PROCESS_SERVICE_DATA_DECODER = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_DATA_DECODER;
+  static constexpr auto PROCESS_SERVICE_UTIL_WIN = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_UTIL_WIN;
+  static constexpr auto PROCESS_SERVICE_PROXY_RESOLVER = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PROXY_RESOLVER;
+  static constexpr auto PROCESS_SERVICE_CDM = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_CDM;
+  static constexpr auto PROCESS_SERVICE_VIDEO_CAPTURE = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_VIDEO_CAPTURE;
+  static constexpr auto PROCESS_SERVICE_UNZIPPER = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_UNZIPPER;
+  static constexpr auto PROCESS_SERVICE_MIRRORING = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_MIRRORING;
+  static constexpr auto PROCESS_SERVICE_FILEPATCHER = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_FILEPATCHER;
+  static constexpr auto PROCESS_SERVICE_TTS = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_TTS;
+  static constexpr auto PROCESS_SERVICE_PRINTING = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PRINTING;
+  static constexpr auto PROCESS_SERVICE_QUARANTINE = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_QUARANTINE;
+  static constexpr auto PROCESS_SERVICE_CROS_LOCALSEARCH = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_CROS_LOCALSEARCH;
+  static constexpr auto PROCESS_SERVICE_CROS_ASSISTANT_AUDIO_DECODER = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_CROS_ASSISTANT_AUDIO_DECODER;
+  static constexpr auto PROCESS_SERVICE_FILEUTIL = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_FILEUTIL;
+  static constexpr auto PROCESS_SERVICE_PRINTCOMPOSITOR = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PRINTCOMPOSITOR;
+  static constexpr auto PROCESS_SERVICE_PAINTPREVIEW = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PAINTPREVIEW;
+  static constexpr auto PROCESS_SERVICE_SPEECHRECOGNITION = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_SPEECHRECOGNITION;
+  static constexpr auto PROCESS_SERVICE_XRDEVICE = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_XRDEVICE;
+  static constexpr auto PROCESS_SERVICE_READICON = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_READICON;
+  static constexpr auto PROCESS_SERVICE_LANGUAGEDETECTION = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_LANGUAGEDETECTION;
+  static constexpr auto PROCESS_SERVICE_SHARING = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_SHARING;
+  static constexpr auto PROCESS_SERVICE_MEDIAPARSER = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_MEDIAPARSER;
+  static constexpr auto PROCESS_SERVICE_QRCODEGENERATOR = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_QRCODEGENERATOR;
+  static constexpr auto PROCESS_SERVICE_PROFILEIMPORT = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PROFILEIMPORT;
+  static constexpr auto PROCESS_SERVICE_IME = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_IME;
+  static constexpr auto PROCESS_SERVICE_RECORDING = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_RECORDING;
+  static constexpr auto PROCESS_SERVICE_SHAPEDETECTION = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_SHAPEDETECTION;
+  static constexpr auto ProcessType_MIN = ChromeProcessDescriptor_ProcessType_PROCESS_UNSPECIFIED;
+  static constexpr auto ProcessType_MAX = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_SHAPEDETECTION;
+  enum FieldNumbers {
+    kProcessTypeFieldNumber = 1,
+    kProcessPriorityFieldNumber = 2,
+    kLegacySortIndexFieldNumber = 3,
+    kHostAppPackageNameFieldNumber = 4,
+    kCrashTraceIdFieldNumber = 5,
+  };
+
+  ChromeProcessDescriptor();
+  ~ChromeProcessDescriptor() override;
+  ChromeProcessDescriptor(ChromeProcessDescriptor&&) noexcept;
+  ChromeProcessDescriptor& operator=(ChromeProcessDescriptor&&);
+  ChromeProcessDescriptor(const ChromeProcessDescriptor&);
+  ChromeProcessDescriptor& operator=(const ChromeProcessDescriptor&);
+  bool operator==(const ChromeProcessDescriptor&) const;
+  bool operator!=(const ChromeProcessDescriptor& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_process_type() const { return _has_field_[1]; }
+  ChromeProcessDescriptor_ProcessType process_type() const { return process_type_; }
+  void set_process_type(ChromeProcessDescriptor_ProcessType value) { process_type_ = value; _has_field_.set(1); }
+
+  bool has_process_priority() const { return _has_field_[2]; }
+  int32_t process_priority() const { return process_priority_; }
+  void set_process_priority(int32_t value) { process_priority_ = value; _has_field_.set(2); }
+
+  bool has_legacy_sort_index() const { return _has_field_[3]; }
+  int32_t legacy_sort_index() const { return legacy_sort_index_; }
+  void set_legacy_sort_index(int32_t value) { legacy_sort_index_ = value; _has_field_.set(3); }
+
+  bool has_host_app_package_name() const { return _has_field_[4]; }
+  const std::string& host_app_package_name() const { return host_app_package_name_; }
+  void set_host_app_package_name(const std::string& value) { host_app_package_name_ = value; _has_field_.set(4); }
+
+  bool has_crash_trace_id() const { return _has_field_[5]; }
+  uint64_t crash_trace_id() const { return crash_trace_id_; }
+  void set_crash_trace_id(uint64_t value) { crash_trace_id_ = value; _has_field_.set(5); }
+
+ private:
+  ChromeProcessDescriptor_ProcessType process_type_{};
+  int32_t process_priority_{};
+  int32_t legacy_sort_index_{};
+  std::string host_app_package_name_{};
+  uint64_t crash_trace_id_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<6> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_PROCESS_DESCRIPTOR_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_process_descriptor.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+ChromeProcessDescriptor::ChromeProcessDescriptor() = default;
+ChromeProcessDescriptor::~ChromeProcessDescriptor() = default;
+ChromeProcessDescriptor::ChromeProcessDescriptor(const ChromeProcessDescriptor&) = default;
+ChromeProcessDescriptor& ChromeProcessDescriptor::operator=(const ChromeProcessDescriptor&) = default;
+ChromeProcessDescriptor::ChromeProcessDescriptor(ChromeProcessDescriptor&&) noexcept = default;
+ChromeProcessDescriptor& ChromeProcessDescriptor::operator=(ChromeProcessDescriptor&&) = default;
+
+bool ChromeProcessDescriptor::operator==(const ChromeProcessDescriptor& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && process_type_ == other.process_type_
+   && process_priority_ == other.process_priority_
+   && legacy_sort_index_ == other.legacy_sort_index_
+   && host_app_package_name_ == other.host_app_package_name_
+   && crash_trace_id_ == other.crash_trace_id_;
+}
+
+bool ChromeProcessDescriptor::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* process_type */:
+        field.get(&process_type_);
+        break;
+      case 2 /* process_priority */:
+        field.get(&process_priority_);
+        break;
+      case 3 /* legacy_sort_index */:
+        field.get(&legacy_sort_index_);
+        break;
+      case 4 /* host_app_package_name */:
+        field.get(&host_app_package_name_);
+        break;
+      case 5 /* crash_trace_id */:
+        field.get(&crash_trace_id_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ChromeProcessDescriptor::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ChromeProcessDescriptor::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ChromeProcessDescriptor::Serialize(::protozero::Message* msg) const {
+  // Field 1: process_type
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, process_type_);
+  }
+
+  // Field 2: process_priority
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, process_priority_);
+  }
+
+  // Field 3: legacy_sort_index
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, legacy_sort_index_);
+  }
+
+  // Field 4: host_app_package_name
+  if (_has_field_[4]) {
+    msg->AppendString(4, host_app_package_name_);
+  }
+
+  // Field 5: crash_trace_id
+  if (_has_field_[5]) {
+    msg->AppendVarInt(5, crash_trace_id_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_renderer_scheduler_state.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_renderer_scheduler_state.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_RENDERER_SCHEDULER_STATE_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_RENDERER_SCHEDULER_STATE_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeRendererSchedulerState;
+enum ChromeRAILMode : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum ChromeRAILMode : int {
+  RAIL_MODE_NONE = 0,
+  RAIL_MODE_RESPONSE = 1,
+  RAIL_MODE_ANIMATION = 2,
+  RAIL_MODE_IDLE = 3,
+  RAIL_MODE_LOAD = 4,
+};
+
+class PERFETTO_EXPORT ChromeRendererSchedulerState : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kRailModeFieldNumber = 1,
+  };
+
+  ChromeRendererSchedulerState();
+  ~ChromeRendererSchedulerState() override;
+  ChromeRendererSchedulerState(ChromeRendererSchedulerState&&) noexcept;
+  ChromeRendererSchedulerState& operator=(ChromeRendererSchedulerState&&);
+  ChromeRendererSchedulerState(const ChromeRendererSchedulerState&);
+  ChromeRendererSchedulerState& operator=(const ChromeRendererSchedulerState&);
+  bool operator==(const ChromeRendererSchedulerState&) const;
+  bool operator!=(const ChromeRendererSchedulerState& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_rail_mode() const { return _has_field_[1]; }
+  ChromeRAILMode rail_mode() const { return rail_mode_; }
+  void set_rail_mode(ChromeRAILMode value) { rail_mode_ = value; _has_field_.set(1); }
+
+ private:
+  ChromeRAILMode rail_mode_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_RENDERER_SCHEDULER_STATE_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_renderer_scheduler_state.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+ChromeRendererSchedulerState::ChromeRendererSchedulerState() = default;
+ChromeRendererSchedulerState::~ChromeRendererSchedulerState() = default;
+ChromeRendererSchedulerState::ChromeRendererSchedulerState(const ChromeRendererSchedulerState&) = default;
+ChromeRendererSchedulerState& ChromeRendererSchedulerState::operator=(const ChromeRendererSchedulerState&) = default;
+ChromeRendererSchedulerState::ChromeRendererSchedulerState(ChromeRendererSchedulerState&&) noexcept = default;
+ChromeRendererSchedulerState& ChromeRendererSchedulerState::operator=(ChromeRendererSchedulerState&&) = default;
+
+bool ChromeRendererSchedulerState::operator==(const ChromeRendererSchedulerState& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && rail_mode_ == other.rail_mode_;
+}
+
+bool ChromeRendererSchedulerState::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* rail_mode */:
+        field.get(&rail_mode_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ChromeRendererSchedulerState::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ChromeRendererSchedulerState::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ChromeRendererSchedulerState::Serialize(::protozero::Message* msg) const {
+  // Field 1: rail_mode
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, rail_mode_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_thread_descriptor.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_thread_descriptor.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_THREAD_DESCRIPTOR_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_THREAD_DESCRIPTOR_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeThreadDescriptor;
+enum ChromeThreadDescriptor_ThreadType : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum ChromeThreadDescriptor_ThreadType : int {
+  ChromeThreadDescriptor_ThreadType_THREAD_UNSPECIFIED = 0,
+  ChromeThreadDescriptor_ThreadType_THREAD_MAIN = 1,
+  ChromeThreadDescriptor_ThreadType_THREAD_IO = 2,
+  ChromeThreadDescriptor_ThreadType_THREAD_POOL_BG_WORKER = 3,
+  ChromeThreadDescriptor_ThreadType_THREAD_POOL_FG_WORKER = 4,
+  ChromeThreadDescriptor_ThreadType_THREAD_POOL_FG_BLOCKING = 5,
+  ChromeThreadDescriptor_ThreadType_THREAD_POOL_BG_BLOCKING = 6,
+  ChromeThreadDescriptor_ThreadType_THREAD_POOL_SERVICE = 7,
+  ChromeThreadDescriptor_ThreadType_THREAD_COMPOSITOR = 8,
+  ChromeThreadDescriptor_ThreadType_THREAD_VIZ_COMPOSITOR = 9,
+  ChromeThreadDescriptor_ThreadType_THREAD_COMPOSITOR_WORKER = 10,
+  ChromeThreadDescriptor_ThreadType_THREAD_SERVICE_WORKER = 11,
+  ChromeThreadDescriptor_ThreadType_THREAD_NETWORK_SERVICE = 12,
+  ChromeThreadDescriptor_ThreadType_THREAD_CHILD_IO = 13,
+  ChromeThreadDescriptor_ThreadType_THREAD_BROWSER_IO = 14,
+  ChromeThreadDescriptor_ThreadType_THREAD_BROWSER_MAIN = 15,
+  ChromeThreadDescriptor_ThreadType_THREAD_RENDERER_MAIN = 16,
+  ChromeThreadDescriptor_ThreadType_THREAD_UTILITY_MAIN = 17,
+  ChromeThreadDescriptor_ThreadType_THREAD_GPU_MAIN = 18,
+  ChromeThreadDescriptor_ThreadType_THREAD_CACHE_BLOCKFILE = 19,
+  ChromeThreadDescriptor_ThreadType_THREAD_MEDIA = 20,
+  ChromeThreadDescriptor_ThreadType_THREAD_AUDIO_OUTPUTDEVICE = 21,
+  ChromeThreadDescriptor_ThreadType_THREAD_AUDIO_INPUTDEVICE = 22,
+  ChromeThreadDescriptor_ThreadType_THREAD_GPU_MEMORY = 23,
+  ChromeThreadDescriptor_ThreadType_THREAD_GPU_VSYNC = 24,
+  ChromeThreadDescriptor_ThreadType_THREAD_DXA_VIDEODECODER = 25,
+  ChromeThreadDescriptor_ThreadType_THREAD_BROWSER_WATCHDOG = 26,
+  ChromeThreadDescriptor_ThreadType_THREAD_WEBRTC_NETWORK = 27,
+  ChromeThreadDescriptor_ThreadType_THREAD_WINDOW_OWNER = 28,
+  ChromeThreadDescriptor_ThreadType_THREAD_WEBRTC_SIGNALING = 29,
+  ChromeThreadDescriptor_ThreadType_THREAD_WEBRTC_WORKER = 30,
+  ChromeThreadDescriptor_ThreadType_THREAD_PPAPI_MAIN = 31,
+  ChromeThreadDescriptor_ThreadType_THREAD_GPU_WATCHDOG = 32,
+  ChromeThreadDescriptor_ThreadType_THREAD_SWAPPER = 33,
+  ChromeThreadDescriptor_ThreadType_THREAD_GAMEPAD_POLLING = 34,
+  ChromeThreadDescriptor_ThreadType_THREAD_WEBCRYPTO = 35,
+  ChromeThreadDescriptor_ThreadType_THREAD_DATABASE = 36,
+  ChromeThreadDescriptor_ThreadType_THREAD_PROXYRESOLVER = 37,
+  ChromeThreadDescriptor_ThreadType_THREAD_DEVTOOLSADB = 38,
+  ChromeThreadDescriptor_ThreadType_THREAD_NETWORKCONFIGWATCHER = 39,
+  ChromeThreadDescriptor_ThreadType_THREAD_WASAPI_RENDER = 40,
+  ChromeThreadDescriptor_ThreadType_THREAD_MEMORY_INFRA = 50,
+  ChromeThreadDescriptor_ThreadType_THREAD_SAMPLING_PROFILER = 51,
+};
+
+class PERFETTO_EXPORT ChromeThreadDescriptor : public ::protozero::CppMessageObj {
+ public:
+  using ThreadType = ChromeThreadDescriptor_ThreadType;
+  static constexpr auto THREAD_UNSPECIFIED = ChromeThreadDescriptor_ThreadType_THREAD_UNSPECIFIED;
+  static constexpr auto THREAD_MAIN = ChromeThreadDescriptor_ThreadType_THREAD_MAIN;
+  static constexpr auto THREAD_IO = ChromeThreadDescriptor_ThreadType_THREAD_IO;
+  static constexpr auto THREAD_POOL_BG_WORKER = ChromeThreadDescriptor_ThreadType_THREAD_POOL_BG_WORKER;
+  static constexpr auto THREAD_POOL_FG_WORKER = ChromeThreadDescriptor_ThreadType_THREAD_POOL_FG_WORKER;
+  static constexpr auto THREAD_POOL_FG_BLOCKING = ChromeThreadDescriptor_ThreadType_THREAD_POOL_FG_BLOCKING;
+  static constexpr auto THREAD_POOL_BG_BLOCKING = ChromeThreadDescriptor_ThreadType_THREAD_POOL_BG_BLOCKING;
+  static constexpr auto THREAD_POOL_SERVICE = ChromeThreadDescriptor_ThreadType_THREAD_POOL_SERVICE;
+  static constexpr auto THREAD_COMPOSITOR = ChromeThreadDescriptor_ThreadType_THREAD_COMPOSITOR;
+  static constexpr auto THREAD_VIZ_COMPOSITOR = ChromeThreadDescriptor_ThreadType_THREAD_VIZ_COMPOSITOR;
+  static constexpr auto THREAD_COMPOSITOR_WORKER = ChromeThreadDescriptor_ThreadType_THREAD_COMPOSITOR_WORKER;
+  static constexpr auto THREAD_SERVICE_WORKER = ChromeThreadDescriptor_ThreadType_THREAD_SERVICE_WORKER;
+  static constexpr auto THREAD_NETWORK_SERVICE = ChromeThreadDescriptor_ThreadType_THREAD_NETWORK_SERVICE;
+  static constexpr auto THREAD_CHILD_IO = ChromeThreadDescriptor_ThreadType_THREAD_CHILD_IO;
+  static constexpr auto THREAD_BROWSER_IO = ChromeThreadDescriptor_ThreadType_THREAD_BROWSER_IO;
+  static constexpr auto THREAD_BROWSER_MAIN = ChromeThreadDescriptor_ThreadType_THREAD_BROWSER_MAIN;
+  static constexpr auto THREAD_RENDERER_MAIN = ChromeThreadDescriptor_ThreadType_THREAD_RENDERER_MAIN;
+  static constexpr auto THREAD_UTILITY_MAIN = ChromeThreadDescriptor_ThreadType_THREAD_UTILITY_MAIN;
+  static constexpr auto THREAD_GPU_MAIN = ChromeThreadDescriptor_ThreadType_THREAD_GPU_MAIN;
+  static constexpr auto THREAD_CACHE_BLOCKFILE = ChromeThreadDescriptor_ThreadType_THREAD_CACHE_BLOCKFILE;
+  static constexpr auto THREAD_MEDIA = ChromeThreadDescriptor_ThreadType_THREAD_MEDIA;
+  static constexpr auto THREAD_AUDIO_OUTPUTDEVICE = ChromeThreadDescriptor_ThreadType_THREAD_AUDIO_OUTPUTDEVICE;
+  static constexpr auto THREAD_AUDIO_INPUTDEVICE = ChromeThreadDescriptor_ThreadType_THREAD_AUDIO_INPUTDEVICE;
+  static constexpr auto THREAD_GPU_MEMORY = ChromeThreadDescriptor_ThreadType_THREAD_GPU_MEMORY;
+  static constexpr auto THREAD_GPU_VSYNC = ChromeThreadDescriptor_ThreadType_THREAD_GPU_VSYNC;
+  static constexpr auto THREAD_DXA_VIDEODECODER = ChromeThreadDescriptor_ThreadType_THREAD_DXA_VIDEODECODER;
+  static constexpr auto THREAD_BROWSER_WATCHDOG = ChromeThreadDescriptor_ThreadType_THREAD_BROWSER_WATCHDOG;
+  static constexpr auto THREAD_WEBRTC_NETWORK = ChromeThreadDescriptor_ThreadType_THREAD_WEBRTC_NETWORK;
+  static constexpr auto THREAD_WINDOW_OWNER = ChromeThreadDescriptor_ThreadType_THREAD_WINDOW_OWNER;
+  static constexpr auto THREAD_WEBRTC_SIGNALING = ChromeThreadDescriptor_ThreadType_THREAD_WEBRTC_SIGNALING;
+  static constexpr auto THREAD_WEBRTC_WORKER = ChromeThreadDescriptor_ThreadType_THREAD_WEBRTC_WORKER;
+  static constexpr auto THREAD_PPAPI_MAIN = ChromeThreadDescriptor_ThreadType_THREAD_PPAPI_MAIN;
+  static constexpr auto THREAD_GPU_WATCHDOG = ChromeThreadDescriptor_ThreadType_THREAD_GPU_WATCHDOG;
+  static constexpr auto THREAD_SWAPPER = ChromeThreadDescriptor_ThreadType_THREAD_SWAPPER;
+  static constexpr auto THREAD_GAMEPAD_POLLING = ChromeThreadDescriptor_ThreadType_THREAD_GAMEPAD_POLLING;
+  static constexpr auto THREAD_WEBCRYPTO = ChromeThreadDescriptor_ThreadType_THREAD_WEBCRYPTO;
+  static constexpr auto THREAD_DATABASE = ChromeThreadDescriptor_ThreadType_THREAD_DATABASE;
+  static constexpr auto THREAD_PROXYRESOLVER = ChromeThreadDescriptor_ThreadType_THREAD_PROXYRESOLVER;
+  static constexpr auto THREAD_DEVTOOLSADB = ChromeThreadDescriptor_ThreadType_THREAD_DEVTOOLSADB;
+  static constexpr auto THREAD_NETWORKCONFIGWATCHER = ChromeThreadDescriptor_ThreadType_THREAD_NETWORKCONFIGWATCHER;
+  static constexpr auto THREAD_WASAPI_RENDER = ChromeThreadDescriptor_ThreadType_THREAD_WASAPI_RENDER;
+  static constexpr auto THREAD_MEMORY_INFRA = ChromeThreadDescriptor_ThreadType_THREAD_MEMORY_INFRA;
+  static constexpr auto THREAD_SAMPLING_PROFILER = ChromeThreadDescriptor_ThreadType_THREAD_SAMPLING_PROFILER;
+  static constexpr auto ThreadType_MIN = ChromeThreadDescriptor_ThreadType_THREAD_UNSPECIFIED;
+  static constexpr auto ThreadType_MAX = ChromeThreadDescriptor_ThreadType_THREAD_SAMPLING_PROFILER;
+  enum FieldNumbers {
+    kThreadTypeFieldNumber = 1,
+    kLegacySortIndexFieldNumber = 2,
+  };
+
+  ChromeThreadDescriptor();
+  ~ChromeThreadDescriptor() override;
+  ChromeThreadDescriptor(ChromeThreadDescriptor&&) noexcept;
+  ChromeThreadDescriptor& operator=(ChromeThreadDescriptor&&);
+  ChromeThreadDescriptor(const ChromeThreadDescriptor&);
+  ChromeThreadDescriptor& operator=(const ChromeThreadDescriptor&);
+  bool operator==(const ChromeThreadDescriptor&) const;
+  bool operator!=(const ChromeThreadDescriptor& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_thread_type() const { return _has_field_[1]; }
+  ChromeThreadDescriptor_ThreadType thread_type() const { return thread_type_; }
+  void set_thread_type(ChromeThreadDescriptor_ThreadType value) { thread_type_ = value; _has_field_.set(1); }
+
+  bool has_legacy_sort_index() const { return _has_field_[2]; }
+  int32_t legacy_sort_index() const { return legacy_sort_index_; }
+  void set_legacy_sort_index(int32_t value) { legacy_sort_index_ = value; _has_field_.set(2); }
+
+ private:
+  ChromeThreadDescriptor_ThreadType thread_type_{};
+  int32_t legacy_sort_index_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_THREAD_DESCRIPTOR_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_thread_descriptor.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+ChromeThreadDescriptor::ChromeThreadDescriptor() = default;
+ChromeThreadDescriptor::~ChromeThreadDescriptor() = default;
+ChromeThreadDescriptor::ChromeThreadDescriptor(const ChromeThreadDescriptor&) = default;
+ChromeThreadDescriptor& ChromeThreadDescriptor::operator=(const ChromeThreadDescriptor&) = default;
+ChromeThreadDescriptor::ChromeThreadDescriptor(ChromeThreadDescriptor&&) noexcept = default;
+ChromeThreadDescriptor& ChromeThreadDescriptor::operator=(ChromeThreadDescriptor&&) = default;
+
+bool ChromeThreadDescriptor::operator==(const ChromeThreadDescriptor& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && thread_type_ == other.thread_type_
+   && legacy_sort_index_ == other.legacy_sort_index_;
+}
+
+bool ChromeThreadDescriptor::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* thread_type */:
+        field.get(&thread_type_);
+        break;
+      case 2 /* legacy_sort_index */:
+        field.get(&legacy_sort_index_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ChromeThreadDescriptor::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ChromeThreadDescriptor::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ChromeThreadDescriptor::Serialize(::protozero::Message* msg) const {
+  // Field 1: thread_type
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, thread_type_);
+  }
+
+  // Field 2: legacy_sort_index
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, legacy_sort_index_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_user_event.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_user_event.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_USER_EVENT_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_USER_EVENT_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeUserEvent;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT ChromeUserEvent : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kActionFieldNumber = 1,
+    kActionHashFieldNumber = 2,
+  };
+
+  ChromeUserEvent();
+  ~ChromeUserEvent() override;
+  ChromeUserEvent(ChromeUserEvent&&) noexcept;
+  ChromeUserEvent& operator=(ChromeUserEvent&&);
+  ChromeUserEvent(const ChromeUserEvent&);
+  ChromeUserEvent& operator=(const ChromeUserEvent&);
+  bool operator==(const ChromeUserEvent&) const;
+  bool operator!=(const ChromeUserEvent& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_action() const { return _has_field_[1]; }
+  const std::string& action() const { return action_; }
+  void set_action(const std::string& value) { action_ = value; _has_field_.set(1); }
+
+  bool has_action_hash() const { return _has_field_[2]; }
+  uint64_t action_hash() const { return action_hash_; }
+  void set_action_hash(uint64_t value) { action_hash_ = value; _has_field_.set(2); }
+
+ private:
+  std::string action_{};
+  uint64_t action_hash_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_USER_EVENT_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_user_event.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+ChromeUserEvent::ChromeUserEvent() = default;
+ChromeUserEvent::~ChromeUserEvent() = default;
+ChromeUserEvent::ChromeUserEvent(const ChromeUserEvent&) = default;
+ChromeUserEvent& ChromeUserEvent::operator=(const ChromeUserEvent&) = default;
+ChromeUserEvent::ChromeUserEvent(ChromeUserEvent&&) noexcept = default;
+ChromeUserEvent& ChromeUserEvent::operator=(ChromeUserEvent&&) = default;
+
+bool ChromeUserEvent::operator==(const ChromeUserEvent& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && action_ == other.action_
+   && action_hash_ == other.action_hash_;
+}
+
+bool ChromeUserEvent::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* action */:
+        field.get(&action_);
+        break;
+      case 2 /* action_hash */:
+        field.get(&action_hash_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ChromeUserEvent::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ChromeUserEvent::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ChromeUserEvent::Serialize(::protozero::Message* msg) const {
+  // Field 1: action
+  if (_has_field_[1]) {
+    msg->AppendString(1, action_);
+  }
+
+  // Field 2: action_hash
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, action_hash_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/chrome_window_handle_event_info.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_window_handle_event_info.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_WINDOW_HANDLE_EVENT_INFO_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_WINDOW_HANDLE_EVENT_INFO_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeWindowHandleEventInfo;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT ChromeWindowHandleEventInfo : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDpiFieldNumber = 1,
+    kMessageIdFieldNumber = 2,
+    kHwndPtrFieldNumber = 3,
+  };
+
+  ChromeWindowHandleEventInfo();
+  ~ChromeWindowHandleEventInfo() override;
+  ChromeWindowHandleEventInfo(ChromeWindowHandleEventInfo&&) noexcept;
+  ChromeWindowHandleEventInfo& operator=(ChromeWindowHandleEventInfo&&);
+  ChromeWindowHandleEventInfo(const ChromeWindowHandleEventInfo&);
+  ChromeWindowHandleEventInfo& operator=(const ChromeWindowHandleEventInfo&);
+  bool operator==(const ChromeWindowHandleEventInfo&) const;
+  bool operator!=(const ChromeWindowHandleEventInfo& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_dpi() const { return _has_field_[1]; }
+  uint32_t dpi() const { return dpi_; }
+  void set_dpi(uint32_t value) { dpi_ = value; _has_field_.set(1); }
+
+  bool has_message_id() const { return _has_field_[2]; }
+  uint32_t message_id() const { return message_id_; }
+  void set_message_id(uint32_t value) { message_id_ = value; _has_field_.set(2); }
+
+  bool has_hwnd_ptr() const { return _has_field_[3]; }
+  uint64_t hwnd_ptr() const { return hwnd_ptr_; }
+  void set_hwnd_ptr(uint64_t value) { hwnd_ptr_ = value; _has_field_.set(3); }
+
+ private:
+  uint32_t dpi_{};
+  uint32_t message_id_{};
+  uint64_t hwnd_ptr_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<4> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_WINDOW_HANDLE_EVENT_INFO_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_window_handle_event_info.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+ChromeWindowHandleEventInfo::ChromeWindowHandleEventInfo() = default;
+ChromeWindowHandleEventInfo::~ChromeWindowHandleEventInfo() = default;
+ChromeWindowHandleEventInfo::ChromeWindowHandleEventInfo(const ChromeWindowHandleEventInfo&) = default;
+ChromeWindowHandleEventInfo& ChromeWindowHandleEventInfo::operator=(const ChromeWindowHandleEventInfo&) = default;
+ChromeWindowHandleEventInfo::ChromeWindowHandleEventInfo(ChromeWindowHandleEventInfo&&) noexcept = default;
+ChromeWindowHandleEventInfo& ChromeWindowHandleEventInfo::operator=(ChromeWindowHandleEventInfo&&) = default;
+
+bool ChromeWindowHandleEventInfo::operator==(const ChromeWindowHandleEventInfo& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && dpi_ == other.dpi_
+   && message_id_ == other.message_id_
+   && hwnd_ptr_ == other.hwnd_ptr_;
+}
+
+bool ChromeWindowHandleEventInfo::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* dpi */:
+        field.get(&dpi_);
+        break;
+      case 2 /* message_id */:
+        field.get(&message_id_);
+        break;
+      case 3 /* hwnd_ptr */:
+        field.get(&hwnd_ptr_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ChromeWindowHandleEventInfo::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ChromeWindowHandleEventInfo::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ChromeWindowHandleEventInfo::Serialize(::protozero::Message* msg) const {
+  // Field 1: dpi
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, dpi_);
+  }
+
+  // Field 2: message_id
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, message_id_);
+  }
+
+  // Field 3: hwnd_ptr
+  if (_has_field_[3]) {
+    msg->AppendFixed(3, hwnd_ptr_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/counter_descriptor.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/counter_descriptor.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_COUNTER_DESCRIPTOR_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_COUNTER_DESCRIPTOR_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class CounterDescriptor;
+enum CounterDescriptor_BuiltinCounterType : int;
+enum CounterDescriptor_Unit : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum CounterDescriptor_BuiltinCounterType : int {
+  CounterDescriptor_BuiltinCounterType_COUNTER_UNSPECIFIED = 0,
+  CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_TIME_NS = 1,
+  CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_INSTRUCTION_COUNT = 2,
+};
+enum CounterDescriptor_Unit : int {
+  CounterDescriptor_Unit_UNIT_UNSPECIFIED = 0,
+  CounterDescriptor_Unit_UNIT_TIME_NS = 1,
+  CounterDescriptor_Unit_UNIT_COUNT = 2,
+  CounterDescriptor_Unit_UNIT_SIZE_BYTES = 3,
+};
+
+class PERFETTO_EXPORT CounterDescriptor : public ::protozero::CppMessageObj {
+ public:
+  using BuiltinCounterType = CounterDescriptor_BuiltinCounterType;
+  static constexpr auto COUNTER_UNSPECIFIED = CounterDescriptor_BuiltinCounterType_COUNTER_UNSPECIFIED;
+  static constexpr auto COUNTER_THREAD_TIME_NS = CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_TIME_NS;
+  static constexpr auto COUNTER_THREAD_INSTRUCTION_COUNT = CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_INSTRUCTION_COUNT;
+  static constexpr auto BuiltinCounterType_MIN = CounterDescriptor_BuiltinCounterType_COUNTER_UNSPECIFIED;
+  static constexpr auto BuiltinCounterType_MAX = CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_INSTRUCTION_COUNT;
+  using Unit = CounterDescriptor_Unit;
+  static constexpr auto UNIT_UNSPECIFIED = CounterDescriptor_Unit_UNIT_UNSPECIFIED;
+  static constexpr auto UNIT_TIME_NS = CounterDescriptor_Unit_UNIT_TIME_NS;
+  static constexpr auto UNIT_COUNT = CounterDescriptor_Unit_UNIT_COUNT;
+  static constexpr auto UNIT_SIZE_BYTES = CounterDescriptor_Unit_UNIT_SIZE_BYTES;
+  static constexpr auto Unit_MIN = CounterDescriptor_Unit_UNIT_UNSPECIFIED;
+  static constexpr auto Unit_MAX = CounterDescriptor_Unit_UNIT_SIZE_BYTES;
+  enum FieldNumbers {
+    kTypeFieldNumber = 1,
+    kCategoriesFieldNumber = 2,
+    kUnitFieldNumber = 3,
+    kUnitNameFieldNumber = 6,
+    kUnitMultiplierFieldNumber = 4,
+    kIsIncrementalFieldNumber = 5,
+  };
+
+  CounterDescriptor();
+  ~CounterDescriptor() override;
+  CounterDescriptor(CounterDescriptor&&) noexcept;
+  CounterDescriptor& operator=(CounterDescriptor&&);
+  CounterDescriptor(const CounterDescriptor&);
+  CounterDescriptor& operator=(const CounterDescriptor&);
+  bool operator==(const CounterDescriptor&) const;
+  bool operator!=(const CounterDescriptor& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_type() const { return _has_field_[1]; }
+  CounterDescriptor_BuiltinCounterType type() const { return type_; }
+  void set_type(CounterDescriptor_BuiltinCounterType value) { type_ = value; _has_field_.set(1); }
+
+  const std::vector<std::string>& categories() const { return categories_; }
+  std::vector<std::string>* mutable_categories() { return &categories_; }
+  int categories_size() const { return static_cast<int>(categories_.size()); }
+  void clear_categories() { categories_.clear(); }
+  void add_categories(std::string value) { categories_.emplace_back(value); }
+  std::string* add_categories() { categories_.emplace_back(); return &categories_.back(); }
+
+  bool has_unit() const { return _has_field_[3]; }
+  CounterDescriptor_Unit unit() const { return unit_; }
+  void set_unit(CounterDescriptor_Unit value) { unit_ = value; _has_field_.set(3); }
+
+  bool has_unit_name() const { return _has_field_[6]; }
+  const std::string& unit_name() const { return unit_name_; }
+  void set_unit_name(const std::string& value) { unit_name_ = value; _has_field_.set(6); }
+
+  bool has_unit_multiplier() const { return _has_field_[4]; }
+  int64_t unit_multiplier() const { return unit_multiplier_; }
+  void set_unit_multiplier(int64_t value) { unit_multiplier_ = value; _has_field_.set(4); }
+
+  bool has_is_incremental() const { return _has_field_[5]; }
+  bool is_incremental() const { return is_incremental_; }
+  void set_is_incremental(bool value) { is_incremental_ = value; _has_field_.set(5); }
+
+ private:
+  CounterDescriptor_BuiltinCounterType type_{};
+  std::vector<std::string> categories_;
+  CounterDescriptor_Unit unit_{};
+  std::string unit_name_{};
+  int64_t unit_multiplier_{};
+  bool is_incremental_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<7> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_COUNTER_DESCRIPTOR_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/counter_descriptor.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+CounterDescriptor::CounterDescriptor() = default;
+CounterDescriptor::~CounterDescriptor() = default;
+CounterDescriptor::CounterDescriptor(const CounterDescriptor&) = default;
+CounterDescriptor& CounterDescriptor::operator=(const CounterDescriptor&) = default;
+CounterDescriptor::CounterDescriptor(CounterDescriptor&&) noexcept = default;
+CounterDescriptor& CounterDescriptor::operator=(CounterDescriptor&&) = default;
+
+bool CounterDescriptor::operator==(const CounterDescriptor& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && type_ == other.type_
+   && categories_ == other.categories_
+   && unit_ == other.unit_
+   && unit_name_ == other.unit_name_
+   && unit_multiplier_ == other.unit_multiplier_
+   && is_incremental_ == other.is_incremental_;
+}
+
+bool CounterDescriptor::ParseFromArray(const void* raw, size_t size) {
+  categories_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* type */:
+        field.get(&type_);
+        break;
+      case 2 /* categories */:
+        categories_.emplace_back();
+        field.get(&categories_.back());
+        break;
+      case 3 /* unit */:
+        field.get(&unit_);
+        break;
+      case 6 /* unit_name */:
+        field.get(&unit_name_);
+        break;
+      case 4 /* unit_multiplier */:
+        field.get(&unit_multiplier_);
+        break;
+      case 5 /* is_incremental */:
+        field.get(&is_incremental_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string CounterDescriptor::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> CounterDescriptor::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void CounterDescriptor::Serialize(::protozero::Message* msg) const {
+  // Field 1: type
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, type_);
+  }
+
+  // Field 2: categories
+  for (auto& it : categories_) {
+    msg->AppendString(2, it);
+  }
+
+  // Field 3: unit
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, unit_);
+  }
+
+  // Field 6: unit_name
+  if (_has_field_[6]) {
+    msg->AppendString(6, unit_name_);
+  }
+
+  // Field 4: unit_multiplier
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, unit_multiplier_);
+  }
+
+  // Field 5: is_incremental
+  if (_has_field_[5]) {
+    msg->AppendTinyVarInt(5, is_incremental_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/debug_annotation.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/debug_annotation.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_DEBUG_ANNOTATION_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_DEBUG_ANNOTATION_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class DebugAnnotationName;
+class DebugAnnotation;
+class DebugAnnotation_NestedValue;
+enum DebugAnnotation_NestedValue_NestedType : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum DebugAnnotation_NestedValue_NestedType : int {
+  DebugAnnotation_NestedValue_NestedType_UNSPECIFIED = 0,
+  DebugAnnotation_NestedValue_NestedType_DICT = 1,
+  DebugAnnotation_NestedValue_NestedType_ARRAY = 2,
+};
+
+class PERFETTO_EXPORT DebugAnnotationName : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kIidFieldNumber = 1,
+    kNameFieldNumber = 2,
+  };
+
+  DebugAnnotationName();
+  ~DebugAnnotationName() override;
+  DebugAnnotationName(DebugAnnotationName&&) noexcept;
+  DebugAnnotationName& operator=(DebugAnnotationName&&);
+  DebugAnnotationName(const DebugAnnotationName&);
+  DebugAnnotationName& operator=(const DebugAnnotationName&);
+  bool operator==(const DebugAnnotationName&) const;
+  bool operator!=(const DebugAnnotationName& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_iid() const { return _has_field_[1]; }
+  uint64_t iid() const { return iid_; }
+  void set_iid(uint64_t value) { iid_ = value; _has_field_.set(1); }
+
+  bool has_name() const { return _has_field_[2]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(2); }
+
+ private:
+  uint64_t iid_{};
+  std::string name_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT DebugAnnotation : public ::protozero::CppMessageObj {
+ public:
+  using NestedValue = DebugAnnotation_NestedValue;
+  enum FieldNumbers {
+    kNameIidFieldNumber = 1,
+    kNameFieldNumber = 10,
+    kBoolValueFieldNumber = 2,
+    kUintValueFieldNumber = 3,
+    kIntValueFieldNumber = 4,
+    kDoubleValueFieldNumber = 5,
+    kStringValueFieldNumber = 6,
+    kPointerValueFieldNumber = 7,
+    kNestedValueFieldNumber = 8,
+    kLegacyJsonValueFieldNumber = 9,
+    kDictEntriesFieldNumber = 11,
+    kArrayValuesFieldNumber = 12,
+  };
+
+  DebugAnnotation();
+  ~DebugAnnotation() override;
+  DebugAnnotation(DebugAnnotation&&) noexcept;
+  DebugAnnotation& operator=(DebugAnnotation&&);
+  DebugAnnotation(const DebugAnnotation&);
+  DebugAnnotation& operator=(const DebugAnnotation&);
+  bool operator==(const DebugAnnotation&) const;
+  bool operator!=(const DebugAnnotation& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name_iid() const { return _has_field_[1]; }
+  uint64_t name_iid() const { return name_iid_; }
+  void set_name_iid(uint64_t value) { name_iid_ = value; _has_field_.set(1); }
+
+  bool has_name() const { return _has_field_[10]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(10); }
+
+  bool has_bool_value() const { return _has_field_[2]; }
+  bool bool_value() const { return bool_value_; }
+  void set_bool_value(bool value) { bool_value_ = value; _has_field_.set(2); }
+
+  bool has_uint_value() const { return _has_field_[3]; }
+  uint64_t uint_value() const { return uint_value_; }
+  void set_uint_value(uint64_t value) { uint_value_ = value; _has_field_.set(3); }
+
+  bool has_int_value() const { return _has_field_[4]; }
+  int64_t int_value() const { return int_value_; }
+  void set_int_value(int64_t value) { int_value_ = value; _has_field_.set(4); }
+
+  bool has_double_value() const { return _has_field_[5]; }
+  double double_value() const { return double_value_; }
+  void set_double_value(double value) { double_value_ = value; _has_field_.set(5); }
+
+  bool has_string_value() const { return _has_field_[6]; }
+  const std::string& string_value() const { return string_value_; }
+  void set_string_value(const std::string& value) { string_value_ = value; _has_field_.set(6); }
+
+  bool has_pointer_value() const { return _has_field_[7]; }
+  uint64_t pointer_value() const { return pointer_value_; }
+  void set_pointer_value(uint64_t value) { pointer_value_ = value; _has_field_.set(7); }
+
+  bool has_nested_value() const { return _has_field_[8]; }
+  const DebugAnnotation_NestedValue& nested_value() const { return *nested_value_; }
+  DebugAnnotation_NestedValue* mutable_nested_value() { _has_field_.set(8); return nested_value_.get(); }
+
+  bool has_legacy_json_value() const { return _has_field_[9]; }
+  const std::string& legacy_json_value() const { return legacy_json_value_; }
+  void set_legacy_json_value(const std::string& value) { legacy_json_value_ = value; _has_field_.set(9); }
+
+  const std::vector<DebugAnnotation>& dict_entries() const { return dict_entries_; }
+  std::vector<DebugAnnotation>* mutable_dict_entries() { return &dict_entries_; }
+  int dict_entries_size() const;
+  void clear_dict_entries();
+  DebugAnnotation* add_dict_entries();
+
+  const std::vector<DebugAnnotation>& array_values() const { return array_values_; }
+  std::vector<DebugAnnotation>* mutable_array_values() { return &array_values_; }
+  int array_values_size() const;
+  void clear_array_values();
+  DebugAnnotation* add_array_values();
+
+ private:
+  uint64_t name_iid_{};
+  std::string name_{};
+  bool bool_value_{};
+  uint64_t uint_value_{};
+  int64_t int_value_{};
+  double double_value_{};
+  std::string string_value_{};
+  uint64_t pointer_value_{};
+  ::protozero::CopyablePtr<DebugAnnotation_NestedValue> nested_value_;
+  std::string legacy_json_value_{};
+  std::vector<DebugAnnotation> dict_entries_;
+  std::vector<DebugAnnotation> array_values_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<13> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT DebugAnnotation_NestedValue : public ::protozero::CppMessageObj {
+ public:
+  using NestedType = DebugAnnotation_NestedValue_NestedType;
+  static constexpr auto UNSPECIFIED = DebugAnnotation_NestedValue_NestedType_UNSPECIFIED;
+  static constexpr auto DICT = DebugAnnotation_NestedValue_NestedType_DICT;
+  static constexpr auto ARRAY = DebugAnnotation_NestedValue_NestedType_ARRAY;
+  static constexpr auto NestedType_MIN = DebugAnnotation_NestedValue_NestedType_UNSPECIFIED;
+  static constexpr auto NestedType_MAX = DebugAnnotation_NestedValue_NestedType_ARRAY;
+  enum FieldNumbers {
+    kNestedTypeFieldNumber = 1,
+    kDictKeysFieldNumber = 2,
+    kDictValuesFieldNumber = 3,
+    kArrayValuesFieldNumber = 4,
+    kIntValueFieldNumber = 5,
+    kDoubleValueFieldNumber = 6,
+    kBoolValueFieldNumber = 7,
+    kStringValueFieldNumber = 8,
+  };
+
+  DebugAnnotation_NestedValue();
+  ~DebugAnnotation_NestedValue() override;
+  DebugAnnotation_NestedValue(DebugAnnotation_NestedValue&&) noexcept;
+  DebugAnnotation_NestedValue& operator=(DebugAnnotation_NestedValue&&);
+  DebugAnnotation_NestedValue(const DebugAnnotation_NestedValue&);
+  DebugAnnotation_NestedValue& operator=(const DebugAnnotation_NestedValue&);
+  bool operator==(const DebugAnnotation_NestedValue&) const;
+  bool operator!=(const DebugAnnotation_NestedValue& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_nested_type() const { return _has_field_[1]; }
+  DebugAnnotation_NestedValue_NestedType nested_type() const { return nested_type_; }
+  void set_nested_type(DebugAnnotation_NestedValue_NestedType value) { nested_type_ = value; _has_field_.set(1); }
+
+  const std::vector<std::string>& dict_keys() const { return dict_keys_; }
+  std::vector<std::string>* mutable_dict_keys() { return &dict_keys_; }
+  int dict_keys_size() const { return static_cast<int>(dict_keys_.size()); }
+  void clear_dict_keys() { dict_keys_.clear(); }
+  void add_dict_keys(std::string value) { dict_keys_.emplace_back(value); }
+  std::string* add_dict_keys() { dict_keys_.emplace_back(); return &dict_keys_.back(); }
+
+  const std::vector<DebugAnnotation_NestedValue>& dict_values() const { return dict_values_; }
+  std::vector<DebugAnnotation_NestedValue>* mutable_dict_values() { return &dict_values_; }
+  int dict_values_size() const;
+  void clear_dict_values();
+  DebugAnnotation_NestedValue* add_dict_values();
+
+  const std::vector<DebugAnnotation_NestedValue>& array_values() const { return array_values_; }
+  std::vector<DebugAnnotation_NestedValue>* mutable_array_values() { return &array_values_; }
+  int array_values_size() const;
+  void clear_array_values();
+  DebugAnnotation_NestedValue* add_array_values();
+
+  bool has_int_value() const { return _has_field_[5]; }
+  int64_t int_value() const { return int_value_; }
+  void set_int_value(int64_t value) { int_value_ = value; _has_field_.set(5); }
+
+  bool has_double_value() const { return _has_field_[6]; }
+  double double_value() const { return double_value_; }
+  void set_double_value(double value) { double_value_ = value; _has_field_.set(6); }
+
+  bool has_bool_value() const { return _has_field_[7]; }
+  bool bool_value() const { return bool_value_; }
+  void set_bool_value(bool value) { bool_value_ = value; _has_field_.set(7); }
+
+  bool has_string_value() const { return _has_field_[8]; }
+  const std::string& string_value() const { return string_value_; }
+  void set_string_value(const std::string& value) { string_value_ = value; _has_field_.set(8); }
+
+ private:
+  DebugAnnotation_NestedValue_NestedType nested_type_{};
+  std::vector<std::string> dict_keys_;
+  std::vector<DebugAnnotation_NestedValue> dict_values_;
+  std::vector<DebugAnnotation_NestedValue> array_values_;
+  int64_t int_value_{};
+  double double_value_{};
+  bool bool_value_{};
+  std::string string_value_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<9> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_DEBUG_ANNOTATION_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/debug_annotation.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+DebugAnnotationName::DebugAnnotationName() = default;
+DebugAnnotationName::~DebugAnnotationName() = default;
+DebugAnnotationName::DebugAnnotationName(const DebugAnnotationName&) = default;
+DebugAnnotationName& DebugAnnotationName::operator=(const DebugAnnotationName&) = default;
+DebugAnnotationName::DebugAnnotationName(DebugAnnotationName&&) noexcept = default;
+DebugAnnotationName& DebugAnnotationName::operator=(DebugAnnotationName&&) = default;
+
+bool DebugAnnotationName::operator==(const DebugAnnotationName& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && iid_ == other.iid_
+   && name_ == other.name_;
+}
+
+bool DebugAnnotationName::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* iid */:
+        field.get(&iid_);
+        break;
+      case 2 /* name */:
+        field.get(&name_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string DebugAnnotationName::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> DebugAnnotationName::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void DebugAnnotationName::Serialize(::protozero::Message* msg) const {
+  // Field 1: iid
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, iid_);
+  }
+
+  // Field 2: name
+  if (_has_field_[2]) {
+    msg->AppendString(2, name_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+DebugAnnotation::DebugAnnotation() = default;
+DebugAnnotation::~DebugAnnotation() = default;
+DebugAnnotation::DebugAnnotation(const DebugAnnotation&) = default;
+DebugAnnotation& DebugAnnotation::operator=(const DebugAnnotation&) = default;
+DebugAnnotation::DebugAnnotation(DebugAnnotation&&) noexcept = default;
+DebugAnnotation& DebugAnnotation::operator=(DebugAnnotation&&) = default;
+
+bool DebugAnnotation::operator==(const DebugAnnotation& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && name_iid_ == other.name_iid_
+   && name_ == other.name_
+   && bool_value_ == other.bool_value_
+   && uint_value_ == other.uint_value_
+   && int_value_ == other.int_value_
+   && double_value_ == other.double_value_
+   && string_value_ == other.string_value_
+   && pointer_value_ == other.pointer_value_
+   && nested_value_ == other.nested_value_
+   && legacy_json_value_ == other.legacy_json_value_
+   && dict_entries_ == other.dict_entries_
+   && array_values_ == other.array_values_;
+}
+
+int DebugAnnotation::dict_entries_size() const { return static_cast<int>(dict_entries_.size()); }
+void DebugAnnotation::clear_dict_entries() { dict_entries_.clear(); }
+DebugAnnotation* DebugAnnotation::add_dict_entries() { dict_entries_.emplace_back(); return &dict_entries_.back(); }
+int DebugAnnotation::array_values_size() const { return static_cast<int>(array_values_.size()); }
+void DebugAnnotation::clear_array_values() { array_values_.clear(); }
+DebugAnnotation* DebugAnnotation::add_array_values() { array_values_.emplace_back(); return &array_values_.back(); }
+bool DebugAnnotation::ParseFromArray(const void* raw, size_t size) {
+  dict_entries_.clear();
+  array_values_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* name_iid */:
+        field.get(&name_iid_);
+        break;
+      case 10 /* name */:
+        field.get(&name_);
+        break;
+      case 2 /* bool_value */:
+        field.get(&bool_value_);
+        break;
+      case 3 /* uint_value */:
+        field.get(&uint_value_);
+        break;
+      case 4 /* int_value */:
+        field.get(&int_value_);
+        break;
+      case 5 /* double_value */:
+        field.get(&double_value_);
+        break;
+      case 6 /* string_value */:
+        field.get(&string_value_);
+        break;
+      case 7 /* pointer_value */:
+        field.get(&pointer_value_);
+        break;
+      case 8 /* nested_value */:
+        (*nested_value_).ParseFromArray(field.data(), field.size());
+        break;
+      case 9 /* legacy_json_value */:
+        field.get(&legacy_json_value_);
+        break;
+      case 11 /* dict_entries */:
+        dict_entries_.emplace_back();
+        dict_entries_.back().ParseFromArray(field.data(), field.size());
+        break;
+      case 12 /* array_values */:
+        array_values_.emplace_back();
+        array_values_.back().ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string DebugAnnotation::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> DebugAnnotation::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void DebugAnnotation::Serialize(::protozero::Message* msg) const {
+  // Field 1: name_iid
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, name_iid_);
+  }
+
+  // Field 10: name
+  if (_has_field_[10]) {
+    msg->AppendString(10, name_);
+  }
+
+  // Field 2: bool_value
+  if (_has_field_[2]) {
+    msg->AppendTinyVarInt(2, bool_value_);
+  }
+
+  // Field 3: uint_value
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, uint_value_);
+  }
+
+  // Field 4: int_value
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, int_value_);
+  }
+
+  // Field 5: double_value
+  if (_has_field_[5]) {
+    msg->AppendFixed(5, double_value_);
+  }
+
+  // Field 6: string_value
+  if (_has_field_[6]) {
+    msg->AppendString(6, string_value_);
+  }
+
+  // Field 7: pointer_value
+  if (_has_field_[7]) {
+    msg->AppendVarInt(7, pointer_value_);
+  }
+
+  // Field 8: nested_value
+  if (_has_field_[8]) {
+    (*nested_value_).Serialize(msg->BeginNestedMessage<::protozero::Message>(8));
+  }
+
+  // Field 9: legacy_json_value
+  if (_has_field_[9]) {
+    msg->AppendString(9, legacy_json_value_);
+  }
+
+  // Field 11: dict_entries
+  for (auto& it : dict_entries_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(11));
+  }
+
+  // Field 12: array_values
+  for (auto& it : array_values_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(12));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+DebugAnnotation_NestedValue::DebugAnnotation_NestedValue() = default;
+DebugAnnotation_NestedValue::~DebugAnnotation_NestedValue() = default;
+DebugAnnotation_NestedValue::DebugAnnotation_NestedValue(const DebugAnnotation_NestedValue&) = default;
+DebugAnnotation_NestedValue& DebugAnnotation_NestedValue::operator=(const DebugAnnotation_NestedValue&) = default;
+DebugAnnotation_NestedValue::DebugAnnotation_NestedValue(DebugAnnotation_NestedValue&&) noexcept = default;
+DebugAnnotation_NestedValue& DebugAnnotation_NestedValue::operator=(DebugAnnotation_NestedValue&&) = default;
+
+bool DebugAnnotation_NestedValue::operator==(const DebugAnnotation_NestedValue& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && nested_type_ == other.nested_type_
+   && dict_keys_ == other.dict_keys_
+   && dict_values_ == other.dict_values_
+   && array_values_ == other.array_values_
+   && int_value_ == other.int_value_
+   && double_value_ == other.double_value_
+   && bool_value_ == other.bool_value_
+   && string_value_ == other.string_value_;
+}
+
+int DebugAnnotation_NestedValue::dict_values_size() const { return static_cast<int>(dict_values_.size()); }
+void DebugAnnotation_NestedValue::clear_dict_values() { dict_values_.clear(); }
+DebugAnnotation_NestedValue* DebugAnnotation_NestedValue::add_dict_values() { dict_values_.emplace_back(); return &dict_values_.back(); }
+int DebugAnnotation_NestedValue::array_values_size() const { return static_cast<int>(array_values_.size()); }
+void DebugAnnotation_NestedValue::clear_array_values() { array_values_.clear(); }
+DebugAnnotation_NestedValue* DebugAnnotation_NestedValue::add_array_values() { array_values_.emplace_back(); return &array_values_.back(); }
+bool DebugAnnotation_NestedValue::ParseFromArray(const void* raw, size_t size) {
+  dict_keys_.clear();
+  dict_values_.clear();
+  array_values_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* nested_type */:
+        field.get(&nested_type_);
+        break;
+      case 2 /* dict_keys */:
+        dict_keys_.emplace_back();
+        field.get(&dict_keys_.back());
+        break;
+      case 3 /* dict_values */:
+        dict_values_.emplace_back();
+        dict_values_.back().ParseFromArray(field.data(), field.size());
+        break;
+      case 4 /* array_values */:
+        array_values_.emplace_back();
+        array_values_.back().ParseFromArray(field.data(), field.size());
+        break;
+      case 5 /* int_value */:
+        field.get(&int_value_);
+        break;
+      case 6 /* double_value */:
+        field.get(&double_value_);
+        break;
+      case 7 /* bool_value */:
+        field.get(&bool_value_);
+        break;
+      case 8 /* string_value */:
+        field.get(&string_value_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string DebugAnnotation_NestedValue::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> DebugAnnotation_NestedValue::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void DebugAnnotation_NestedValue::Serialize(::protozero::Message* msg) const {
+  // Field 1: nested_type
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, nested_type_);
+  }
+
+  // Field 2: dict_keys
+  for (auto& it : dict_keys_) {
+    msg->AppendString(2, it);
+  }
+
+  // Field 3: dict_values
+  for (auto& it : dict_values_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(3));
+  }
+
+  // Field 4: array_values
+  for (auto& it : array_values_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(4));
+  }
+
+  // Field 5: int_value
+  if (_has_field_[5]) {
+    msg->AppendVarInt(5, int_value_);
+  }
+
+  // Field 6: double_value
+  if (_has_field_[6]) {
+    msg->AppendFixed(6, double_value_);
+  }
+
+  // Field 7: bool_value
+  if (_has_field_[7]) {
+    msg->AppendTinyVarInt(7, bool_value_);
+  }
+
+  // Field 8: string_value
+  if (_has_field_[8]) {
+    msg->AppendString(8, string_value_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/log_message.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/log_message.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_LOG_MESSAGE_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_LOG_MESSAGE_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class LogMessageBody;
+class LogMessage;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT LogMessageBody : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kIidFieldNumber = 1,
+    kBodyFieldNumber = 2,
+  };
+
+  LogMessageBody();
+  ~LogMessageBody() override;
+  LogMessageBody(LogMessageBody&&) noexcept;
+  LogMessageBody& operator=(LogMessageBody&&);
+  LogMessageBody(const LogMessageBody&);
+  LogMessageBody& operator=(const LogMessageBody&);
+  bool operator==(const LogMessageBody&) const;
+  bool operator!=(const LogMessageBody& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_iid() const { return _has_field_[1]; }
+  uint64_t iid() const { return iid_; }
+  void set_iid(uint64_t value) { iid_ = value; _has_field_.set(1); }
+
+  bool has_body() const { return _has_field_[2]; }
+  const std::string& body() const { return body_; }
+  void set_body(const std::string& value) { body_ = value; _has_field_.set(2); }
+
+ private:
+  uint64_t iid_{};
+  std::string body_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT LogMessage : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kSourceLocationIidFieldNumber = 1,
+    kBodyIidFieldNumber = 2,
+  };
+
+  LogMessage();
+  ~LogMessage() override;
+  LogMessage(LogMessage&&) noexcept;
+  LogMessage& operator=(LogMessage&&);
+  LogMessage(const LogMessage&);
+  LogMessage& operator=(const LogMessage&);
+  bool operator==(const LogMessage&) const;
+  bool operator!=(const LogMessage& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_source_location_iid() const { return _has_field_[1]; }
+  uint64_t source_location_iid() const { return source_location_iid_; }
+  void set_source_location_iid(uint64_t value) { source_location_iid_ = value; _has_field_.set(1); }
+
+  bool has_body_iid() const { return _has_field_[2]; }
+  uint64_t body_iid() const { return body_iid_; }
+  void set_body_iid(uint64_t value) { body_iid_ = value; _has_field_.set(2); }
+
+ private:
+  uint64_t source_location_iid_{};
+  uint64_t body_iid_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_LOG_MESSAGE_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/log_message.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+LogMessageBody::LogMessageBody() = default;
+LogMessageBody::~LogMessageBody() = default;
+LogMessageBody::LogMessageBody(const LogMessageBody&) = default;
+LogMessageBody& LogMessageBody::operator=(const LogMessageBody&) = default;
+LogMessageBody::LogMessageBody(LogMessageBody&&) noexcept = default;
+LogMessageBody& LogMessageBody::operator=(LogMessageBody&&) = default;
+
+bool LogMessageBody::operator==(const LogMessageBody& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && iid_ == other.iid_
+   && body_ == other.body_;
+}
+
+bool LogMessageBody::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* iid */:
+        field.get(&iid_);
+        break;
+      case 2 /* body */:
+        field.get(&body_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string LogMessageBody::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> LogMessageBody::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void LogMessageBody::Serialize(::protozero::Message* msg) const {
+  // Field 1: iid
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, iid_);
+  }
+
+  // Field 2: body
+  if (_has_field_[2]) {
+    msg->AppendString(2, body_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+LogMessage::LogMessage() = default;
+LogMessage::~LogMessage() = default;
+LogMessage::LogMessage(const LogMessage&) = default;
+LogMessage& LogMessage::operator=(const LogMessage&) = default;
+LogMessage::LogMessage(LogMessage&&) noexcept = default;
+LogMessage& LogMessage::operator=(LogMessage&&) = default;
+
+bool LogMessage::operator==(const LogMessage& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && source_location_iid_ == other.source_location_iid_
+   && body_iid_ == other.body_iid_;
+}
+
+bool LogMessage::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* source_location_iid */:
+        field.get(&source_location_iid_);
+        break;
+      case 2 /* body_iid */:
+        field.get(&body_iid_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string LogMessage::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> LogMessage::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void LogMessage::Serialize(::protozero::Message* msg) const {
+  // Field 1: source_location_iid
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, source_location_iid_);
+  }
+
+  // Field 2: body_iid
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, body_iid_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/process_descriptor.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/process_descriptor.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_PROCESS_DESCRIPTOR_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_PROCESS_DESCRIPTOR_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ProcessDescriptor;
+enum ProcessDescriptor_ChromeProcessType : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum ProcessDescriptor_ChromeProcessType : int {
+  ProcessDescriptor_ChromeProcessType_PROCESS_UNSPECIFIED = 0,
+  ProcessDescriptor_ChromeProcessType_PROCESS_BROWSER = 1,
+  ProcessDescriptor_ChromeProcessType_PROCESS_RENDERER = 2,
+  ProcessDescriptor_ChromeProcessType_PROCESS_UTILITY = 3,
+  ProcessDescriptor_ChromeProcessType_PROCESS_ZYGOTE = 4,
+  ProcessDescriptor_ChromeProcessType_PROCESS_SANDBOX_HELPER = 5,
+  ProcessDescriptor_ChromeProcessType_PROCESS_GPU = 6,
+  ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_PLUGIN = 7,
+  ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_BROKER = 8,
+};
+
+class PERFETTO_EXPORT ProcessDescriptor : public ::protozero::CppMessageObj {
+ public:
+  using ChromeProcessType = ProcessDescriptor_ChromeProcessType;
+  static constexpr auto PROCESS_UNSPECIFIED = ProcessDescriptor_ChromeProcessType_PROCESS_UNSPECIFIED;
+  static constexpr auto PROCESS_BROWSER = ProcessDescriptor_ChromeProcessType_PROCESS_BROWSER;
+  static constexpr auto PROCESS_RENDERER = ProcessDescriptor_ChromeProcessType_PROCESS_RENDERER;
+  static constexpr auto PROCESS_UTILITY = ProcessDescriptor_ChromeProcessType_PROCESS_UTILITY;
+  static constexpr auto PROCESS_ZYGOTE = ProcessDescriptor_ChromeProcessType_PROCESS_ZYGOTE;
+  static constexpr auto PROCESS_SANDBOX_HELPER = ProcessDescriptor_ChromeProcessType_PROCESS_SANDBOX_HELPER;
+  static constexpr auto PROCESS_GPU = ProcessDescriptor_ChromeProcessType_PROCESS_GPU;
+  static constexpr auto PROCESS_PPAPI_PLUGIN = ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_PLUGIN;
+  static constexpr auto PROCESS_PPAPI_BROKER = ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_BROKER;
+  static constexpr auto ChromeProcessType_MIN = ProcessDescriptor_ChromeProcessType_PROCESS_UNSPECIFIED;
+  static constexpr auto ChromeProcessType_MAX = ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_BROKER;
+  enum FieldNumbers {
+    kPidFieldNumber = 1,
+    kCmdlineFieldNumber = 2,
+    kProcessNameFieldNumber = 6,
+    kProcessPriorityFieldNumber = 5,
+    kStartTimestampNsFieldNumber = 7,
+    kChromeProcessTypeFieldNumber = 4,
+    kLegacySortIndexFieldNumber = 3,
+  };
+
+  ProcessDescriptor();
+  ~ProcessDescriptor() override;
+  ProcessDescriptor(ProcessDescriptor&&) noexcept;
+  ProcessDescriptor& operator=(ProcessDescriptor&&);
+  ProcessDescriptor(const ProcessDescriptor&);
+  ProcessDescriptor& operator=(const ProcessDescriptor&);
+  bool operator==(const ProcessDescriptor&) const;
+  bool operator!=(const ProcessDescriptor& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_pid() const { return _has_field_[1]; }
+  int32_t pid() const { return pid_; }
+  void set_pid(int32_t value) { pid_ = value; _has_field_.set(1); }
+
+  const std::vector<std::string>& cmdline() const { return cmdline_; }
+  std::vector<std::string>* mutable_cmdline() { return &cmdline_; }
+  int cmdline_size() const { return static_cast<int>(cmdline_.size()); }
+  void clear_cmdline() { cmdline_.clear(); }
+  void add_cmdline(std::string value) { cmdline_.emplace_back(value); }
+  std::string* add_cmdline() { cmdline_.emplace_back(); return &cmdline_.back(); }
+
+  bool has_process_name() const { return _has_field_[6]; }
+  const std::string& process_name() const { return process_name_; }
+  void set_process_name(const std::string& value) { process_name_ = value; _has_field_.set(6); }
+
+  bool has_process_priority() const { return _has_field_[5]; }
+  int32_t process_priority() const { return process_priority_; }
+  void set_process_priority(int32_t value) { process_priority_ = value; _has_field_.set(5); }
+
+  bool has_start_timestamp_ns() const { return _has_field_[7]; }
+  int64_t start_timestamp_ns() const { return start_timestamp_ns_; }
+  void set_start_timestamp_ns(int64_t value) { start_timestamp_ns_ = value; _has_field_.set(7); }
+
+  bool has_chrome_process_type() const { return _has_field_[4]; }
+  ProcessDescriptor_ChromeProcessType chrome_process_type() const { return chrome_process_type_; }
+  void set_chrome_process_type(ProcessDescriptor_ChromeProcessType value) { chrome_process_type_ = value; _has_field_.set(4); }
+
+  bool has_legacy_sort_index() const { return _has_field_[3]; }
+  int32_t legacy_sort_index() const { return legacy_sort_index_; }
+  void set_legacy_sort_index(int32_t value) { legacy_sort_index_ = value; _has_field_.set(3); }
+
+ private:
+  int32_t pid_{};
+  std::vector<std::string> cmdline_;
+  std::string process_name_{};
+  int32_t process_priority_{};
+  int64_t start_timestamp_ns_{};
+  ProcessDescriptor_ChromeProcessType chrome_process_type_{};
+  int32_t legacy_sort_index_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<8> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_PROCESS_DESCRIPTOR_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/process_descriptor.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+ProcessDescriptor::ProcessDescriptor() = default;
+ProcessDescriptor::~ProcessDescriptor() = default;
+ProcessDescriptor::ProcessDescriptor(const ProcessDescriptor&) = default;
+ProcessDescriptor& ProcessDescriptor::operator=(const ProcessDescriptor&) = default;
+ProcessDescriptor::ProcessDescriptor(ProcessDescriptor&&) noexcept = default;
+ProcessDescriptor& ProcessDescriptor::operator=(ProcessDescriptor&&) = default;
+
+bool ProcessDescriptor::operator==(const ProcessDescriptor& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && pid_ == other.pid_
+   && cmdline_ == other.cmdline_
+   && process_name_ == other.process_name_
+   && process_priority_ == other.process_priority_
+   && start_timestamp_ns_ == other.start_timestamp_ns_
+   && chrome_process_type_ == other.chrome_process_type_
+   && legacy_sort_index_ == other.legacy_sort_index_;
+}
+
+bool ProcessDescriptor::ParseFromArray(const void* raw, size_t size) {
+  cmdline_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* pid */:
+        field.get(&pid_);
+        break;
+      case 2 /* cmdline */:
+        cmdline_.emplace_back();
+        field.get(&cmdline_.back());
+        break;
+      case 6 /* process_name */:
+        field.get(&process_name_);
+        break;
+      case 5 /* process_priority */:
+        field.get(&process_priority_);
+        break;
+      case 7 /* start_timestamp_ns */:
+        field.get(&start_timestamp_ns_);
+        break;
+      case 4 /* chrome_process_type */:
+        field.get(&chrome_process_type_);
+        break;
+      case 3 /* legacy_sort_index */:
+        field.get(&legacy_sort_index_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ProcessDescriptor::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ProcessDescriptor::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ProcessDescriptor::Serialize(::protozero::Message* msg) const {
+  // Field 1: pid
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, pid_);
+  }
+
+  // Field 2: cmdline
+  for (auto& it : cmdline_) {
+    msg->AppendString(2, it);
+  }
+
+  // Field 6: process_name
+  if (_has_field_[6]) {
+    msg->AppendString(6, process_name_);
+  }
+
+  // Field 5: process_priority
+  if (_has_field_[5]) {
+    msg->AppendVarInt(5, process_priority_);
+  }
+
+  // Field 7: start_timestamp_ns
+  if (_has_field_[7]) {
+    msg->AppendVarInt(7, start_timestamp_ns_);
+  }
+
+  // Field 4: chrome_process_type
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, chrome_process_type_);
+  }
+
+  // Field 3: legacy_sort_index
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, legacy_sort_index_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/source_location.gen.cc
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/source_location.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+SourceLocation::SourceLocation() = default;
+SourceLocation::~SourceLocation() = default;
+SourceLocation::SourceLocation(const SourceLocation&) = default;
+SourceLocation& SourceLocation::operator=(const SourceLocation&) = default;
+SourceLocation::SourceLocation(SourceLocation&&) noexcept = default;
+SourceLocation& SourceLocation::operator=(SourceLocation&&) = default;
+
+bool SourceLocation::operator==(const SourceLocation& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && iid_ == other.iid_
+   && file_name_ == other.file_name_
+   && function_name_ == other.function_name_
+   && line_number_ == other.line_number_;
+}
+
+bool SourceLocation::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* iid */:
+        field.get(&iid_);
+        break;
+      case 2 /* file_name */:
+        field.get(&file_name_);
+        break;
+      case 3 /* function_name */:
+        field.get(&function_name_);
+        break;
+      case 4 /* line_number */:
+        field.get(&line_number_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string SourceLocation::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> SourceLocation::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void SourceLocation::Serialize(::protozero::Message* msg) const {
+  // Field 1: iid
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, iid_);
+  }
+
+  // Field 2: file_name
+  if (_has_field_[2]) {
+    msg->AppendString(2, file_name_);
+  }
+
+  // Field 3: function_name
+  if (_has_field_[3]) {
+    msg->AppendString(3, function_name_);
+  }
+
+  // Field 4: line_number
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, line_number_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/task_execution.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/task_execution.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TASK_EXECUTION_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TASK_EXECUTION_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class TaskExecution;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT TaskExecution : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kPostedFromIidFieldNumber = 1,
+  };
+
+  TaskExecution();
+  ~TaskExecution() override;
+  TaskExecution(TaskExecution&&) noexcept;
+  TaskExecution& operator=(TaskExecution&&);
+  TaskExecution(const TaskExecution&);
+  TaskExecution& operator=(const TaskExecution&);
+  bool operator==(const TaskExecution&) const;
+  bool operator!=(const TaskExecution& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_posted_from_iid() const { return _has_field_[1]; }
+  uint64_t posted_from_iid() const { return posted_from_iid_; }
+  void set_posted_from_iid(uint64_t value) { posted_from_iid_ = value; _has_field_.set(1); }
+
+ private:
+  uint64_t posted_from_iid_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TASK_EXECUTION_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/task_execution.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+TaskExecution::TaskExecution() = default;
+TaskExecution::~TaskExecution() = default;
+TaskExecution::TaskExecution(const TaskExecution&) = default;
+TaskExecution& TaskExecution::operator=(const TaskExecution&) = default;
+TaskExecution::TaskExecution(TaskExecution&&) noexcept = default;
+TaskExecution& TaskExecution::operator=(TaskExecution&&) = default;
+
+bool TaskExecution::operator==(const TaskExecution& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && posted_from_iid_ == other.posted_from_iid_;
+}
+
+bool TaskExecution::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* posted_from_iid */:
+        field.get(&posted_from_iid_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string TaskExecution::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> TaskExecution::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void TaskExecution::Serialize(::protozero::Message* msg) const {
+  // Field 1: posted_from_iid
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, posted_from_iid_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/thread_descriptor.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/thread_descriptor.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_THREAD_DESCRIPTOR_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_THREAD_DESCRIPTOR_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ThreadDescriptor;
+enum ThreadDescriptor_ChromeThreadType : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum ThreadDescriptor_ChromeThreadType : int {
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_UNSPECIFIED = 0,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_MAIN = 1,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_IO = 2,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_BG_WORKER = 3,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_FG_WORKER = 4,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_FB_BLOCKING = 5,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_BG_BLOCKING = 6,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_SERVICE = 7,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_COMPOSITOR = 8,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_VIZ_COMPOSITOR = 9,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_COMPOSITOR_WORKER = 10,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SERVICE_WORKER = 11,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_MEMORY_INFRA = 50,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SAMPLING_PROFILER = 51,
+};
+
+class PERFETTO_EXPORT ThreadDescriptor : public ::protozero::CppMessageObj {
+ public:
+  using ChromeThreadType = ThreadDescriptor_ChromeThreadType;
+  static constexpr auto CHROME_THREAD_UNSPECIFIED = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_UNSPECIFIED;
+  static constexpr auto CHROME_THREAD_MAIN = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_MAIN;
+  static constexpr auto CHROME_THREAD_IO = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_IO;
+  static constexpr auto CHROME_THREAD_POOL_BG_WORKER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_BG_WORKER;
+  static constexpr auto CHROME_THREAD_POOL_FG_WORKER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_FG_WORKER;
+  static constexpr auto CHROME_THREAD_POOL_FB_BLOCKING = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_FB_BLOCKING;
+  static constexpr auto CHROME_THREAD_POOL_BG_BLOCKING = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_BG_BLOCKING;
+  static constexpr auto CHROME_THREAD_POOL_SERVICE = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_SERVICE;
+  static constexpr auto CHROME_THREAD_COMPOSITOR = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_COMPOSITOR;
+  static constexpr auto CHROME_THREAD_VIZ_COMPOSITOR = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_VIZ_COMPOSITOR;
+  static constexpr auto CHROME_THREAD_COMPOSITOR_WORKER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_COMPOSITOR_WORKER;
+  static constexpr auto CHROME_THREAD_SERVICE_WORKER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SERVICE_WORKER;
+  static constexpr auto CHROME_THREAD_MEMORY_INFRA = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_MEMORY_INFRA;
+  static constexpr auto CHROME_THREAD_SAMPLING_PROFILER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SAMPLING_PROFILER;
+  static constexpr auto ChromeThreadType_MIN = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_UNSPECIFIED;
+  static constexpr auto ChromeThreadType_MAX = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SAMPLING_PROFILER;
+  enum FieldNumbers {
+    kPidFieldNumber = 1,
+    kTidFieldNumber = 2,
+    kThreadNameFieldNumber = 5,
+    kChromeThreadTypeFieldNumber = 4,
+    kReferenceTimestampUsFieldNumber = 6,
+    kReferenceThreadTimeUsFieldNumber = 7,
+    kReferenceThreadInstructionCountFieldNumber = 8,
+    kLegacySortIndexFieldNumber = 3,
+  };
+
+  ThreadDescriptor();
+  ~ThreadDescriptor() override;
+  ThreadDescriptor(ThreadDescriptor&&) noexcept;
+  ThreadDescriptor& operator=(ThreadDescriptor&&);
+  ThreadDescriptor(const ThreadDescriptor&);
+  ThreadDescriptor& operator=(const ThreadDescriptor&);
+  bool operator==(const ThreadDescriptor&) const;
+  bool operator!=(const ThreadDescriptor& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_pid() const { return _has_field_[1]; }
+  int32_t pid() const { return pid_; }
+  void set_pid(int32_t value) { pid_ = value; _has_field_.set(1); }
+
+  bool has_tid() const { return _has_field_[2]; }
+  int32_t tid() const { return tid_; }
+  void set_tid(int32_t value) { tid_ = value; _has_field_.set(2); }
+
+  bool has_thread_name() const { return _has_field_[5]; }
+  const std::string& thread_name() const { return thread_name_; }
+  void set_thread_name(const std::string& value) { thread_name_ = value; _has_field_.set(5); }
+
+  bool has_chrome_thread_type() const { return _has_field_[4]; }
+  ThreadDescriptor_ChromeThreadType chrome_thread_type() const { return chrome_thread_type_; }
+  void set_chrome_thread_type(ThreadDescriptor_ChromeThreadType value) { chrome_thread_type_ = value; _has_field_.set(4); }
+
+  bool has_reference_timestamp_us() const { return _has_field_[6]; }
+  int64_t reference_timestamp_us() const { return reference_timestamp_us_; }
+  void set_reference_timestamp_us(int64_t value) { reference_timestamp_us_ = value; _has_field_.set(6); }
+
+  bool has_reference_thread_time_us() const { return _has_field_[7]; }
+  int64_t reference_thread_time_us() const { return reference_thread_time_us_; }
+  void set_reference_thread_time_us(int64_t value) { reference_thread_time_us_ = value; _has_field_.set(7); }
+
+  bool has_reference_thread_instruction_count() const { return _has_field_[8]; }
+  int64_t reference_thread_instruction_count() const { return reference_thread_instruction_count_; }
+  void set_reference_thread_instruction_count(int64_t value) { reference_thread_instruction_count_ = value; _has_field_.set(8); }
+
+  bool has_legacy_sort_index() const { return _has_field_[3]; }
+  int32_t legacy_sort_index() const { return legacy_sort_index_; }
+  void set_legacy_sort_index(int32_t value) { legacy_sort_index_ = value; _has_field_.set(3); }
+
+ private:
+  int32_t pid_{};
+  int32_t tid_{};
+  std::string thread_name_{};
+  ThreadDescriptor_ChromeThreadType chrome_thread_type_{};
+  int64_t reference_timestamp_us_{};
+  int64_t reference_thread_time_us_{};
+  int64_t reference_thread_instruction_count_{};
+  int32_t legacy_sort_index_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<9> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_THREAD_DESCRIPTOR_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/thread_descriptor.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+ThreadDescriptor::ThreadDescriptor() = default;
+ThreadDescriptor::~ThreadDescriptor() = default;
+ThreadDescriptor::ThreadDescriptor(const ThreadDescriptor&) = default;
+ThreadDescriptor& ThreadDescriptor::operator=(const ThreadDescriptor&) = default;
+ThreadDescriptor::ThreadDescriptor(ThreadDescriptor&&) noexcept = default;
+ThreadDescriptor& ThreadDescriptor::operator=(ThreadDescriptor&&) = default;
+
+bool ThreadDescriptor::operator==(const ThreadDescriptor& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && pid_ == other.pid_
+   && tid_ == other.tid_
+   && thread_name_ == other.thread_name_
+   && chrome_thread_type_ == other.chrome_thread_type_
+   && reference_timestamp_us_ == other.reference_timestamp_us_
+   && reference_thread_time_us_ == other.reference_thread_time_us_
+   && reference_thread_instruction_count_ == other.reference_thread_instruction_count_
+   && legacy_sort_index_ == other.legacy_sort_index_;
+}
+
+bool ThreadDescriptor::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* pid */:
+        field.get(&pid_);
+        break;
+      case 2 /* tid */:
+        field.get(&tid_);
+        break;
+      case 5 /* thread_name */:
+        field.get(&thread_name_);
+        break;
+      case 4 /* chrome_thread_type */:
+        field.get(&chrome_thread_type_);
+        break;
+      case 6 /* reference_timestamp_us */:
+        field.get(&reference_timestamp_us_);
+        break;
+      case 7 /* reference_thread_time_us */:
+        field.get(&reference_thread_time_us_);
+        break;
+      case 8 /* reference_thread_instruction_count */:
+        field.get(&reference_thread_instruction_count_);
+        break;
+      case 3 /* legacy_sort_index */:
+        field.get(&legacy_sort_index_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ThreadDescriptor::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ThreadDescriptor::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ThreadDescriptor::Serialize(::protozero::Message* msg) const {
+  // Field 1: pid
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, pid_);
+  }
+
+  // Field 2: tid
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, tid_);
+  }
+
+  // Field 5: thread_name
+  if (_has_field_[5]) {
+    msg->AppendString(5, thread_name_);
+  }
+
+  // Field 4: chrome_thread_type
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, chrome_thread_type_);
+  }
+
+  // Field 6: reference_timestamp_us
+  if (_has_field_[6]) {
+    msg->AppendVarInt(6, reference_timestamp_us_);
+  }
+
+  // Field 7: reference_thread_time_us
+  if (_has_field_[7]) {
+    msg->AppendVarInt(7, reference_thread_time_us_);
+  }
+
+  // Field 8: reference_thread_instruction_count
+  if (_has_field_[8]) {
+    msg->AppendVarInt(8, reference_thread_instruction_count_);
+  }
+
+  // Field 3: legacy_sort_index
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, legacy_sort_index_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/track_descriptor.gen.cc
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/track_descriptor.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/counter_descriptor.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/thread_descriptor.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/process_descriptor.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_thread_descriptor.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_process_descriptor.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+TrackDescriptor::TrackDescriptor() = default;
+TrackDescriptor::~TrackDescriptor() = default;
+TrackDescriptor::TrackDescriptor(const TrackDescriptor&) = default;
+TrackDescriptor& TrackDescriptor::operator=(const TrackDescriptor&) = default;
+TrackDescriptor::TrackDescriptor(TrackDescriptor&&) noexcept = default;
+TrackDescriptor& TrackDescriptor::operator=(TrackDescriptor&&) = default;
+
+bool TrackDescriptor::operator==(const TrackDescriptor& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && uuid_ == other.uuid_
+   && parent_uuid_ == other.parent_uuid_
+   && name_ == other.name_
+   && process_ == other.process_
+   && chrome_process_ == other.chrome_process_
+   && thread_ == other.thread_
+   && chrome_thread_ == other.chrome_thread_
+   && counter_ == other.counter_;
+}
+
+bool TrackDescriptor::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* uuid */:
+        field.get(&uuid_);
+        break;
+      case 5 /* parent_uuid */:
+        field.get(&parent_uuid_);
+        break;
+      case 2 /* name */:
+        field.get(&name_);
+        break;
+      case 3 /* process */:
+        (*process_).ParseFromArray(field.data(), field.size());
+        break;
+      case 6 /* chrome_process */:
+        (*chrome_process_).ParseFromArray(field.data(), field.size());
+        break;
+      case 4 /* thread */:
+        (*thread_).ParseFromArray(field.data(), field.size());
+        break;
+      case 7 /* chrome_thread */:
+        (*chrome_thread_).ParseFromArray(field.data(), field.size());
+        break;
+      case 8 /* counter */:
+        (*counter_).ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string TrackDescriptor::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> TrackDescriptor::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void TrackDescriptor::Serialize(::protozero::Message* msg) const {
+  // Field 1: uuid
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, uuid_);
+  }
+
+  // Field 5: parent_uuid
+  if (_has_field_[5]) {
+    msg->AppendVarInt(5, parent_uuid_);
+  }
+
+  // Field 2: name
+  if (_has_field_[2]) {
+    msg->AppendString(2, name_);
+  }
+
+  // Field 3: process
+  if (_has_field_[3]) {
+    (*process_).Serialize(msg->BeginNestedMessage<::protozero::Message>(3));
+  }
+
+  // Field 6: chrome_process
+  if (_has_field_[6]) {
+    (*chrome_process_).Serialize(msg->BeginNestedMessage<::protozero::Message>(6));
+  }
+
+  // Field 4: thread
+  if (_has_field_[4]) {
+    (*thread_).Serialize(msg->BeginNestedMessage<::protozero::Message>(4));
+  }
+
+  // Field 7: chrome_thread
+  if (_has_field_[7]) {
+    (*chrome_thread_).Serialize(msg->BeginNestedMessage<::protozero::Message>(7));
+  }
+
+  // Field 8: counter
+  if (_has_field_[8]) {
+    (*counter_).Serialize(msg->BeginNestedMessage<::protozero::Message>(8));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/trace/track_event/track_event.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/track_event.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_EVENT_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_EVENT_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class EventName;
+class EventCategory;
+class TrackEventDefaults;
+class TrackEvent;
+class TrackEvent_LegacyEvent;
+class ChromeMojoEventInfo;
+class ChromeMessagePump;
+class SourceLocation;
+class ChromeContentSettingsEventInfo;
+class ChromeWindowHandleEventInfo;
+class ChromeRendererSchedulerState;
+class ChromeApplicationStateInfo;
+class ChromeFrameReporter;
+class ChromeLatencyInfo;
+class ChromeLatencyInfo_ComponentInfo;
+class ChromeHistogramSample;
+class ChromeLegacyIpc;
+class ChromeKeyedService;
+class ChromeUserEvent;
+class ChromeCompositorSchedulerState;
+class CompositorTimingHistory;
+class BeginFrameSourceState;
+class BeginFrameArgs;
+class BeginFrameObserverState;
+class BeginImplFrameArgs;
+class BeginImplFrameArgs_TimestampsInUs;
+class ChromeCompositorStateMachine;
+class ChromeCompositorStateMachine_MinorState;
+class ChromeCompositorStateMachine_MajorState;
+class LogMessage;
+class TaskExecution;
+class DebugAnnotation;
+class DebugAnnotation_NestedValue;
+enum TrackEvent_Type : int;
+enum TrackEvent_LegacyEvent_FlowDirection : int;
+enum TrackEvent_LegacyEvent_InstantEventScope : int;
+enum ChromeRAILMode : int;
+enum ChromeApplicationStateInfo_ChromeApplicationState : int;
+enum ChromeFrameReporter_State : int;
+enum ChromeFrameReporter_FrameDropReason : int;
+enum ChromeFrameReporter_ScrollState : int;
+enum ChromeLatencyInfo_Step : int;
+enum ChromeLatencyInfo_LatencyComponentType : int;
+enum ChromeLegacyIpc_MessageClass : int;
+enum ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode : int;
+enum ChromeCompositorSchedulerAction : int;
+enum BeginFrameArgs_BeginFrameArgsType : int;
+enum BeginImplFrameArgs_State : int;
+enum ChromeCompositorStateMachine_MinorState_TreePriority : int;
+enum ChromeCompositorStateMachine_MinorState_ScrollHandlerState : int;
+enum ChromeCompositorStateMachine_MajorState_BeginImplFrameState : int;
+enum ChromeCompositorStateMachine_MajorState_BeginMainFrameState : int;
+enum ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState : int;
+enum ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState : int;
+enum DebugAnnotation_NestedValue_NestedType : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum TrackEvent_Type : int {
+  TrackEvent_Type_TYPE_UNSPECIFIED = 0,
+  TrackEvent_Type_TYPE_SLICE_BEGIN = 1,
+  TrackEvent_Type_TYPE_SLICE_END = 2,
+  TrackEvent_Type_TYPE_INSTANT = 3,
+  TrackEvent_Type_TYPE_COUNTER = 4,
+};
+enum TrackEvent_LegacyEvent_FlowDirection : int {
+  TrackEvent_LegacyEvent_FlowDirection_FLOW_UNSPECIFIED = 0,
+  TrackEvent_LegacyEvent_FlowDirection_FLOW_IN = 1,
+  TrackEvent_LegacyEvent_FlowDirection_FLOW_OUT = 2,
+  TrackEvent_LegacyEvent_FlowDirection_FLOW_INOUT = 3,
+};
+enum TrackEvent_LegacyEvent_InstantEventScope : int {
+  TrackEvent_LegacyEvent_InstantEventScope_SCOPE_UNSPECIFIED = 0,
+  TrackEvent_LegacyEvent_InstantEventScope_SCOPE_GLOBAL = 1,
+  TrackEvent_LegacyEvent_InstantEventScope_SCOPE_PROCESS = 2,
+  TrackEvent_LegacyEvent_InstantEventScope_SCOPE_THREAD = 3,
+};
+
+class PERFETTO_EXPORT EventName : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kIidFieldNumber = 1,
+    kNameFieldNumber = 2,
+  };
+
+  EventName();
+  ~EventName() override;
+  EventName(EventName&&) noexcept;
+  EventName& operator=(EventName&&);
+  EventName(const EventName&);
+  EventName& operator=(const EventName&);
+  bool operator==(const EventName&) const;
+  bool operator!=(const EventName& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_iid() const { return _has_field_[1]; }
+  uint64_t iid() const { return iid_; }
+  void set_iid(uint64_t value) { iid_ = value; _has_field_.set(1); }
+
+  bool has_name() const { return _has_field_[2]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(2); }
+
+ private:
+  uint64_t iid_{};
+  std::string name_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT EventCategory : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kIidFieldNumber = 1,
+    kNameFieldNumber = 2,
+  };
+
+  EventCategory();
+  ~EventCategory() override;
+  EventCategory(EventCategory&&) noexcept;
+  EventCategory& operator=(EventCategory&&);
+  EventCategory(const EventCategory&);
+  EventCategory& operator=(const EventCategory&);
+  bool operator==(const EventCategory&) const;
+  bool operator!=(const EventCategory& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_iid() const { return _has_field_[1]; }
+  uint64_t iid() const { return iid_; }
+  void set_iid(uint64_t value) { iid_ = value; _has_field_.set(1); }
+
+  bool has_name() const { return _has_field_[2]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(2); }
+
+ private:
+  uint64_t iid_{};
+  std::string name_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TrackEventDefaults : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kTrackUuidFieldNumber = 11,
+    kExtraCounterTrackUuidsFieldNumber = 31,
+    kExtraDoubleCounterTrackUuidsFieldNumber = 45,
+  };
+
+  TrackEventDefaults();
+  ~TrackEventDefaults() override;
+  TrackEventDefaults(TrackEventDefaults&&) noexcept;
+  TrackEventDefaults& operator=(TrackEventDefaults&&);
+  TrackEventDefaults(const TrackEventDefaults&);
+  TrackEventDefaults& operator=(const TrackEventDefaults&);
+  bool operator==(const TrackEventDefaults&) const;
+  bool operator!=(const TrackEventDefaults& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_track_uuid() const { return _has_field_[11]; }
+  uint64_t track_uuid() const { return track_uuid_; }
+  void set_track_uuid(uint64_t value) { track_uuid_ = value; _has_field_.set(11); }
+
+  const std::vector<uint64_t>& extra_counter_track_uuids() const { return extra_counter_track_uuids_; }
+  std::vector<uint64_t>* mutable_extra_counter_track_uuids() { return &extra_counter_track_uuids_; }
+  int extra_counter_track_uuids_size() const { return static_cast<int>(extra_counter_track_uuids_.size()); }
+  void clear_extra_counter_track_uuids() { extra_counter_track_uuids_.clear(); }
+  void add_extra_counter_track_uuids(uint64_t value) { extra_counter_track_uuids_.emplace_back(value); }
+  uint64_t* add_extra_counter_track_uuids() { extra_counter_track_uuids_.emplace_back(); return &extra_counter_track_uuids_.back(); }
+
+  const std::vector<uint64_t>& extra_double_counter_track_uuids() const { return extra_double_counter_track_uuids_; }
+  std::vector<uint64_t>* mutable_extra_double_counter_track_uuids() { return &extra_double_counter_track_uuids_; }
+  int extra_double_counter_track_uuids_size() const { return static_cast<int>(extra_double_counter_track_uuids_.size()); }
+  void clear_extra_double_counter_track_uuids() { extra_double_counter_track_uuids_.clear(); }
+  void add_extra_double_counter_track_uuids(uint64_t value) { extra_double_counter_track_uuids_.emplace_back(value); }
+  uint64_t* add_extra_double_counter_track_uuids() { extra_double_counter_track_uuids_.emplace_back(); return &extra_double_counter_track_uuids_.back(); }
+
+ private:
+  uint64_t track_uuid_{};
+  std::vector<uint64_t> extra_counter_track_uuids_;
+  std::vector<uint64_t> extra_double_counter_track_uuids_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<46> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TrackEvent : public ::protozero::CppMessageObj {
+ public:
+  using LegacyEvent = TrackEvent_LegacyEvent;
+  using Type = TrackEvent_Type;
+  static constexpr auto TYPE_UNSPECIFIED = TrackEvent_Type_TYPE_UNSPECIFIED;
+  static constexpr auto TYPE_SLICE_BEGIN = TrackEvent_Type_TYPE_SLICE_BEGIN;
+  static constexpr auto TYPE_SLICE_END = TrackEvent_Type_TYPE_SLICE_END;
+  static constexpr auto TYPE_INSTANT = TrackEvent_Type_TYPE_INSTANT;
+  static constexpr auto TYPE_COUNTER = TrackEvent_Type_TYPE_COUNTER;
+  static constexpr auto Type_MIN = TrackEvent_Type_TYPE_UNSPECIFIED;
+  static constexpr auto Type_MAX = TrackEvent_Type_TYPE_COUNTER;
+  enum FieldNumbers {
+    kCategoryIidsFieldNumber = 3,
+    kCategoriesFieldNumber = 22,
+    kNameIidFieldNumber = 10,
+    kNameFieldNumber = 23,
+    kTypeFieldNumber = 9,
+    kTrackUuidFieldNumber = 11,
+    kCounterValueFieldNumber = 30,
+    kDoubleCounterValueFieldNumber = 44,
+    kExtraCounterTrackUuidsFieldNumber = 31,
+    kExtraCounterValuesFieldNumber = 12,
+    kExtraDoubleCounterTrackUuidsFieldNumber = 45,
+    kExtraDoubleCounterValuesFieldNumber = 46,
+    kFlowIdsFieldNumber = 36,
+    kTerminatingFlowIdsFieldNumber = 42,
+    kDebugAnnotationsFieldNumber = 4,
+    kTaskExecutionFieldNumber = 5,
+    kLogMessageFieldNumber = 21,
+    kCcSchedulerStateFieldNumber = 24,
+    kChromeUserEventFieldNumber = 25,
+    kChromeKeyedServiceFieldNumber = 26,
+    kChromeLegacyIpcFieldNumber = 27,
+    kChromeHistogramSampleFieldNumber = 28,
+    kChromeLatencyInfoFieldNumber = 29,
+    kChromeFrameReporterFieldNumber = 32,
+    kChromeApplicationStateInfoFieldNumber = 39,
+    kChromeRendererSchedulerStateFieldNumber = 40,
+    kChromeWindowHandleEventInfoFieldNumber = 41,
+    kChromeContentSettingsEventInfoFieldNumber = 43,
+    kSourceLocationFieldNumber = 33,
+    kSourceLocationIidFieldNumber = 34,
+    kChromeMessagePumpFieldNumber = 35,
+    kChromeMojoEventInfoFieldNumber = 38,
+    kTimestampDeltaUsFieldNumber = 1,
+    kTimestampAbsoluteUsFieldNumber = 16,
+    kThreadTimeDeltaUsFieldNumber = 2,
+    kThreadTimeAbsoluteUsFieldNumber = 17,
+    kThreadInstructionCountDeltaFieldNumber = 8,
+    kThreadInstructionCountAbsoluteFieldNumber = 20,
+    kLegacyEventFieldNumber = 6,
+  };
+
+  TrackEvent();
+  ~TrackEvent() override;
+  TrackEvent(TrackEvent&&) noexcept;
+  TrackEvent& operator=(TrackEvent&&);
+  TrackEvent(const TrackEvent&);
+  TrackEvent& operator=(const TrackEvent&);
+  bool operator==(const TrackEvent&) const;
+  bool operator!=(const TrackEvent& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<uint64_t>& category_iids() const { return category_iids_; }
+  std::vector<uint64_t>* mutable_category_iids() { return &category_iids_; }
+  int category_iids_size() const { return static_cast<int>(category_iids_.size()); }
+  void clear_category_iids() { category_iids_.clear(); }
+  void add_category_iids(uint64_t value) { category_iids_.emplace_back(value); }
+  uint64_t* add_category_iids() { category_iids_.emplace_back(); return &category_iids_.back(); }
+
+  const std::vector<std::string>& categories() const { return categories_; }
+  std::vector<std::string>* mutable_categories() { return &categories_; }
+  int categories_size() const { return static_cast<int>(categories_.size()); }
+  void clear_categories() { categories_.clear(); }
+  void add_categories(std::string value) { categories_.emplace_back(value); }
+  std::string* add_categories() { categories_.emplace_back(); return &categories_.back(); }
+
+  bool has_name_iid() const { return _has_field_[10]; }
+  uint64_t name_iid() const { return name_iid_; }
+  void set_name_iid(uint64_t value) { name_iid_ = value; _has_field_.set(10); }
+
+  bool has_name() const { return _has_field_[23]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(23); }
+
+  bool has_type() const { return _has_field_[9]; }
+  TrackEvent_Type type() const { return type_; }
+  void set_type(TrackEvent_Type value) { type_ = value; _has_field_.set(9); }
+
+  bool has_track_uuid() const { return _has_field_[11]; }
+  uint64_t track_uuid() const { return track_uuid_; }
+  void set_track_uuid(uint64_t value) { track_uuid_ = value; _has_field_.set(11); }
+
+  bool has_counter_value() const { return _has_field_[30]; }
+  int64_t counter_value() const { return counter_value_; }
+  void set_counter_value(int64_t value) { counter_value_ = value; _has_field_.set(30); }
+
+  bool has_double_counter_value() const { return _has_field_[44]; }
+  double double_counter_value() const { return double_counter_value_; }
+  void set_double_counter_value(double value) { double_counter_value_ = value; _has_field_.set(44); }
+
+  const std::vector<uint64_t>& extra_counter_track_uuids() const { return extra_counter_track_uuids_; }
+  std::vector<uint64_t>* mutable_extra_counter_track_uuids() { return &extra_counter_track_uuids_; }
+  int extra_counter_track_uuids_size() const { return static_cast<int>(extra_counter_track_uuids_.size()); }
+  void clear_extra_counter_track_uuids() { extra_counter_track_uuids_.clear(); }
+  void add_extra_counter_track_uuids(uint64_t value) { extra_counter_track_uuids_.emplace_back(value); }
+  uint64_t* add_extra_counter_track_uuids() { extra_counter_track_uuids_.emplace_back(); return &extra_counter_track_uuids_.back(); }
+
+  const std::vector<int64_t>& extra_counter_values() const { return extra_counter_values_; }
+  std::vector<int64_t>* mutable_extra_counter_values() { return &extra_counter_values_; }
+  int extra_counter_values_size() const { return static_cast<int>(extra_counter_values_.size()); }
+  void clear_extra_counter_values() { extra_counter_values_.clear(); }
+  void add_extra_counter_values(int64_t value) { extra_counter_values_.emplace_back(value); }
+  int64_t* add_extra_counter_values() { extra_counter_values_.emplace_back(); return &extra_counter_values_.back(); }
+
+  const std::vector<uint64_t>& extra_double_counter_track_uuids() const { return extra_double_counter_track_uuids_; }
+  std::vector<uint64_t>* mutable_extra_double_counter_track_uuids() { return &extra_double_counter_track_uuids_; }
+  int extra_double_counter_track_uuids_size() const { return static_cast<int>(extra_double_counter_track_uuids_.size()); }
+  void clear_extra_double_counter_track_uuids() { extra_double_counter_track_uuids_.clear(); }
+  void add_extra_double_counter_track_uuids(uint64_t value) { extra_double_counter_track_uuids_.emplace_back(value); }
+  uint64_t* add_extra_double_counter_track_uuids() { extra_double_counter_track_uuids_.emplace_back(); return &extra_double_counter_track_uuids_.back(); }
+
+  const std::vector<double>& extra_double_counter_values() const { return extra_double_counter_values_; }
+  std::vector<double>* mutable_extra_double_counter_values() { return &extra_double_counter_values_; }
+  int extra_double_counter_values_size() const { return static_cast<int>(extra_double_counter_values_.size()); }
+  void clear_extra_double_counter_values() { extra_double_counter_values_.clear(); }
+  void add_extra_double_counter_values(double value) { extra_double_counter_values_.emplace_back(value); }
+  double* add_extra_double_counter_values() { extra_double_counter_values_.emplace_back(); return &extra_double_counter_values_.back(); }
+
+  const std::vector<uint64_t>& flow_ids() const { return flow_ids_; }
+  std::vector<uint64_t>* mutable_flow_ids() { return &flow_ids_; }
+  int flow_ids_size() const { return static_cast<int>(flow_ids_.size()); }
+  void clear_flow_ids() { flow_ids_.clear(); }
+  void add_flow_ids(uint64_t value) { flow_ids_.emplace_back(value); }
+  uint64_t* add_flow_ids() { flow_ids_.emplace_back(); return &flow_ids_.back(); }
+
+  const std::vector<uint64_t>& terminating_flow_ids() const { return terminating_flow_ids_; }
+  std::vector<uint64_t>* mutable_terminating_flow_ids() { return &terminating_flow_ids_; }
+  int terminating_flow_ids_size() const { return static_cast<int>(terminating_flow_ids_.size()); }
+  void clear_terminating_flow_ids() { terminating_flow_ids_.clear(); }
+  void add_terminating_flow_ids(uint64_t value) { terminating_flow_ids_.emplace_back(value); }
+  uint64_t* add_terminating_flow_ids() { terminating_flow_ids_.emplace_back(); return &terminating_flow_ids_.back(); }
+
+  const std::vector<DebugAnnotation>& debug_annotations() const { return debug_annotations_; }
+  std::vector<DebugAnnotation>* mutable_debug_annotations() { return &debug_annotations_; }
+  int debug_annotations_size() const;
+  void clear_debug_annotations();
+  DebugAnnotation* add_debug_annotations();
+
+  bool has_task_execution() const { return _has_field_[5]; }
+  const TaskExecution& task_execution() const { return *task_execution_; }
+  TaskExecution* mutable_task_execution() { _has_field_.set(5); return task_execution_.get(); }
+
+  bool has_log_message() const { return _has_field_[21]; }
+  const LogMessage& log_message() const { return *log_message_; }
+  LogMessage* mutable_log_message() { _has_field_.set(21); return log_message_.get(); }
+
+  bool has_cc_scheduler_state() const { return _has_field_[24]; }
+  const ChromeCompositorSchedulerState& cc_scheduler_state() const { return *cc_scheduler_state_; }
+  ChromeCompositorSchedulerState* mutable_cc_scheduler_state() { _has_field_.set(24); return cc_scheduler_state_.get(); }
+
+  bool has_chrome_user_event() const { return _has_field_[25]; }
+  const ChromeUserEvent& chrome_user_event() const { return *chrome_user_event_; }
+  ChromeUserEvent* mutable_chrome_user_event() { _has_field_.set(25); return chrome_user_event_.get(); }
+
+  bool has_chrome_keyed_service() const { return _has_field_[26]; }
+  const ChromeKeyedService& chrome_keyed_service() const { return *chrome_keyed_service_; }
+  ChromeKeyedService* mutable_chrome_keyed_service() { _has_field_.set(26); return chrome_keyed_service_.get(); }
+
+  bool has_chrome_legacy_ipc() const { return _has_field_[27]; }
+  const ChromeLegacyIpc& chrome_legacy_ipc() const { return *chrome_legacy_ipc_; }
+  ChromeLegacyIpc* mutable_chrome_legacy_ipc() { _has_field_.set(27); return chrome_legacy_ipc_.get(); }
+
+  bool has_chrome_histogram_sample() const { return _has_field_[28]; }
+  const ChromeHistogramSample& chrome_histogram_sample() const { return *chrome_histogram_sample_; }
+  ChromeHistogramSample* mutable_chrome_histogram_sample() { _has_field_.set(28); return chrome_histogram_sample_.get(); }
+
+  bool has_chrome_latency_info() const { return _has_field_[29]; }
+  const ChromeLatencyInfo& chrome_latency_info() const { return *chrome_latency_info_; }
+  ChromeLatencyInfo* mutable_chrome_latency_info() { _has_field_.set(29); return chrome_latency_info_.get(); }
+
+  bool has_chrome_frame_reporter() const { return _has_field_[32]; }
+  const ChromeFrameReporter& chrome_frame_reporter() const { return *chrome_frame_reporter_; }
+  ChromeFrameReporter* mutable_chrome_frame_reporter() { _has_field_.set(32); return chrome_frame_reporter_.get(); }
+
+  bool has_chrome_application_state_info() const { return _has_field_[39]; }
+  const ChromeApplicationStateInfo& chrome_application_state_info() const { return *chrome_application_state_info_; }
+  ChromeApplicationStateInfo* mutable_chrome_application_state_info() { _has_field_.set(39); return chrome_application_state_info_.get(); }
+
+  bool has_chrome_renderer_scheduler_state() const { return _has_field_[40]; }
+  const ChromeRendererSchedulerState& chrome_renderer_scheduler_state() const { return *chrome_renderer_scheduler_state_; }
+  ChromeRendererSchedulerState* mutable_chrome_renderer_scheduler_state() { _has_field_.set(40); return chrome_renderer_scheduler_state_.get(); }
+
+  bool has_chrome_window_handle_event_info() const { return _has_field_[41]; }
+  const ChromeWindowHandleEventInfo& chrome_window_handle_event_info() const { return *chrome_window_handle_event_info_; }
+  ChromeWindowHandleEventInfo* mutable_chrome_window_handle_event_info() { _has_field_.set(41); return chrome_window_handle_event_info_.get(); }
+
+  bool has_chrome_content_settings_event_info() const { return _has_field_[43]; }
+  const ChromeContentSettingsEventInfo& chrome_content_settings_event_info() const { return *chrome_content_settings_event_info_; }
+  ChromeContentSettingsEventInfo* mutable_chrome_content_settings_event_info() { _has_field_.set(43); return chrome_content_settings_event_info_.get(); }
+
+  bool has_source_location() const { return _has_field_[33]; }
+  const SourceLocation& source_location() const { return *source_location_; }
+  SourceLocation* mutable_source_location() { _has_field_.set(33); return source_location_.get(); }
+
+  bool has_source_location_iid() const { return _has_field_[34]; }
+  uint64_t source_location_iid() const { return source_location_iid_; }
+  void set_source_location_iid(uint64_t value) { source_location_iid_ = value; _has_field_.set(34); }
+
+  bool has_chrome_message_pump() const { return _has_field_[35]; }
+  const ChromeMessagePump& chrome_message_pump() const { return *chrome_message_pump_; }
+  ChromeMessagePump* mutable_chrome_message_pump() { _has_field_.set(35); return chrome_message_pump_.get(); }
+
+  bool has_chrome_mojo_event_info() const { return _has_field_[38]; }
+  const ChromeMojoEventInfo& chrome_mojo_event_info() const { return *chrome_mojo_event_info_; }
+  ChromeMojoEventInfo* mutable_chrome_mojo_event_info() { _has_field_.set(38); return chrome_mojo_event_info_.get(); }
+
+  bool has_timestamp_delta_us() const { return _has_field_[1]; }
+  int64_t timestamp_delta_us() const { return timestamp_delta_us_; }
+  void set_timestamp_delta_us(int64_t value) { timestamp_delta_us_ = value; _has_field_.set(1); }
+
+  bool has_timestamp_absolute_us() const { return _has_field_[16]; }
+  int64_t timestamp_absolute_us() const { return timestamp_absolute_us_; }
+  void set_timestamp_absolute_us(int64_t value) { timestamp_absolute_us_ = value; _has_field_.set(16); }
+
+  bool has_thread_time_delta_us() const { return _has_field_[2]; }
+  int64_t thread_time_delta_us() const { return thread_time_delta_us_; }
+  void set_thread_time_delta_us(int64_t value) { thread_time_delta_us_ = value; _has_field_.set(2); }
+
+  bool has_thread_time_absolute_us() const { return _has_field_[17]; }
+  int64_t thread_time_absolute_us() const { return thread_time_absolute_us_; }
+  void set_thread_time_absolute_us(int64_t value) { thread_time_absolute_us_ = value; _has_field_.set(17); }
+
+  bool has_thread_instruction_count_delta() const { return _has_field_[8]; }
+  int64_t thread_instruction_count_delta() const { return thread_instruction_count_delta_; }
+  void set_thread_instruction_count_delta(int64_t value) { thread_instruction_count_delta_ = value; _has_field_.set(8); }
+
+  bool has_thread_instruction_count_absolute() const { return _has_field_[20]; }
+  int64_t thread_instruction_count_absolute() const { return thread_instruction_count_absolute_; }
+  void set_thread_instruction_count_absolute(int64_t value) { thread_instruction_count_absolute_ = value; _has_field_.set(20); }
+
+  bool has_legacy_event() const { return _has_field_[6]; }
+  const TrackEvent_LegacyEvent& legacy_event() const { return *legacy_event_; }
+  TrackEvent_LegacyEvent* mutable_legacy_event() { _has_field_.set(6); return legacy_event_.get(); }
+
+ private:
+  std::vector<uint64_t> category_iids_;
+  std::vector<std::string> categories_;
+  uint64_t name_iid_{};
+  std::string name_{};
+  TrackEvent_Type type_{};
+  uint64_t track_uuid_{};
+  int64_t counter_value_{};
+  double double_counter_value_{};
+  std::vector<uint64_t> extra_counter_track_uuids_;
+  std::vector<int64_t> extra_counter_values_;
+  std::vector<uint64_t> extra_double_counter_track_uuids_;
+  std::vector<double> extra_double_counter_values_;
+  std::vector<uint64_t> flow_ids_;
+  std::vector<uint64_t> terminating_flow_ids_;
+  std::vector<DebugAnnotation> debug_annotations_;
+  ::protozero::CopyablePtr<TaskExecution> task_execution_;
+  ::protozero::CopyablePtr<LogMessage> log_message_;
+  ::protozero::CopyablePtr<ChromeCompositorSchedulerState> cc_scheduler_state_;
+  ::protozero::CopyablePtr<ChromeUserEvent> chrome_user_event_;
+  ::protozero::CopyablePtr<ChromeKeyedService> chrome_keyed_service_;
+  ::protozero::CopyablePtr<ChromeLegacyIpc> chrome_legacy_ipc_;
+  ::protozero::CopyablePtr<ChromeHistogramSample> chrome_histogram_sample_;
+  ::protozero::CopyablePtr<ChromeLatencyInfo> chrome_latency_info_;
+  ::protozero::CopyablePtr<ChromeFrameReporter> chrome_frame_reporter_;
+  ::protozero::CopyablePtr<ChromeApplicationStateInfo> chrome_application_state_info_;
+  ::protozero::CopyablePtr<ChromeRendererSchedulerState> chrome_renderer_scheduler_state_;
+  ::protozero::CopyablePtr<ChromeWindowHandleEventInfo> chrome_window_handle_event_info_;
+  ::protozero::CopyablePtr<ChromeContentSettingsEventInfo> chrome_content_settings_event_info_;
+  ::protozero::CopyablePtr<SourceLocation> source_location_;
+  uint64_t source_location_iid_{};
+  ::protozero::CopyablePtr<ChromeMessagePump> chrome_message_pump_;
+  ::protozero::CopyablePtr<ChromeMojoEventInfo> chrome_mojo_event_info_;
+  int64_t timestamp_delta_us_{};
+  int64_t timestamp_absolute_us_{};
+  int64_t thread_time_delta_us_{};
+  int64_t thread_time_absolute_us_{};
+  int64_t thread_instruction_count_delta_{};
+  int64_t thread_instruction_count_absolute_{};
+  ::protozero::CopyablePtr<TrackEvent_LegacyEvent> legacy_event_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<47> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TrackEvent_LegacyEvent : public ::protozero::CppMessageObj {
+ public:
+  using FlowDirection = TrackEvent_LegacyEvent_FlowDirection;
+  static constexpr auto FLOW_UNSPECIFIED = TrackEvent_LegacyEvent_FlowDirection_FLOW_UNSPECIFIED;
+  static constexpr auto FLOW_IN = TrackEvent_LegacyEvent_FlowDirection_FLOW_IN;
+  static constexpr auto FLOW_OUT = TrackEvent_LegacyEvent_FlowDirection_FLOW_OUT;
+  static constexpr auto FLOW_INOUT = TrackEvent_LegacyEvent_FlowDirection_FLOW_INOUT;
+  static constexpr auto FlowDirection_MIN = TrackEvent_LegacyEvent_FlowDirection_FLOW_UNSPECIFIED;
+  static constexpr auto FlowDirection_MAX = TrackEvent_LegacyEvent_FlowDirection_FLOW_INOUT;
+  using InstantEventScope = TrackEvent_LegacyEvent_InstantEventScope;
+  static constexpr auto SCOPE_UNSPECIFIED = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_UNSPECIFIED;
+  static constexpr auto SCOPE_GLOBAL = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_GLOBAL;
+  static constexpr auto SCOPE_PROCESS = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_PROCESS;
+  static constexpr auto SCOPE_THREAD = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_THREAD;
+  static constexpr auto InstantEventScope_MIN = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_UNSPECIFIED;
+  static constexpr auto InstantEventScope_MAX = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_THREAD;
+  enum FieldNumbers {
+    kNameIidFieldNumber = 1,
+    kPhaseFieldNumber = 2,
+    kDurationUsFieldNumber = 3,
+    kThreadDurationUsFieldNumber = 4,
+    kThreadInstructionDeltaFieldNumber = 15,
+    kUnscopedIdFieldNumber = 6,
+    kLocalIdFieldNumber = 10,
+    kGlobalIdFieldNumber = 11,
+    kIdScopeFieldNumber = 7,
+    kUseAsyncTtsFieldNumber = 9,
+    kBindIdFieldNumber = 8,
+    kBindToEnclosingFieldNumber = 12,
+    kFlowDirectionFieldNumber = 13,
+    kInstantEventScopeFieldNumber = 14,
+    kPidOverrideFieldNumber = 18,
+    kTidOverrideFieldNumber = 19,
+  };
+
+  TrackEvent_LegacyEvent();
+  ~TrackEvent_LegacyEvent() override;
+  TrackEvent_LegacyEvent(TrackEvent_LegacyEvent&&) noexcept;
+  TrackEvent_LegacyEvent& operator=(TrackEvent_LegacyEvent&&);
+  TrackEvent_LegacyEvent(const TrackEvent_LegacyEvent&);
+  TrackEvent_LegacyEvent& operator=(const TrackEvent_LegacyEvent&);
+  bool operator==(const TrackEvent_LegacyEvent&) const;
+  bool operator!=(const TrackEvent_LegacyEvent& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name_iid() const { return _has_field_[1]; }
+  uint64_t name_iid() const { return name_iid_; }
+  void set_name_iid(uint64_t value) { name_iid_ = value; _has_field_.set(1); }
+
+  bool has_phase() const { return _has_field_[2]; }
+  int32_t phase() const { return phase_; }
+  void set_phase(int32_t value) { phase_ = value; _has_field_.set(2); }
+
+  bool has_duration_us() const { return _has_field_[3]; }
+  int64_t duration_us() const { return duration_us_; }
+  void set_duration_us(int64_t value) { duration_us_ = value; _has_field_.set(3); }
+
+  bool has_thread_duration_us() const { return _has_field_[4]; }
+  int64_t thread_duration_us() const { return thread_duration_us_; }
+  void set_thread_duration_us(int64_t value) { thread_duration_us_ = value; _has_field_.set(4); }
+
+  bool has_thread_instruction_delta() const { return _has_field_[15]; }
+  int64_t thread_instruction_delta() const { return thread_instruction_delta_; }
+  void set_thread_instruction_delta(int64_t value) { thread_instruction_delta_ = value; _has_field_.set(15); }
+
+  bool has_unscoped_id() const { return _has_field_[6]; }
+  uint64_t unscoped_id() const { return unscoped_id_; }
+  void set_unscoped_id(uint64_t value) { unscoped_id_ = value; _has_field_.set(6); }
+
+  bool has_local_id() const { return _has_field_[10]; }
+  uint64_t local_id() const { return local_id_; }
+  void set_local_id(uint64_t value) { local_id_ = value; _has_field_.set(10); }
+
+  bool has_global_id() const { return _has_field_[11]; }
+  uint64_t global_id() const { return global_id_; }
+  void set_global_id(uint64_t value) { global_id_ = value; _has_field_.set(11); }
+
+  bool has_id_scope() const { return _has_field_[7]; }
+  const std::string& id_scope() const { return id_scope_; }
+  void set_id_scope(const std::string& value) { id_scope_ = value; _has_field_.set(7); }
+
+  bool has_use_async_tts() const { return _has_field_[9]; }
+  bool use_async_tts() const { return use_async_tts_; }
+  void set_use_async_tts(bool value) { use_async_tts_ = value; _has_field_.set(9); }
+
+  bool has_bind_id() const { return _has_field_[8]; }
+  uint64_t bind_id() const { return bind_id_; }
+  void set_bind_id(uint64_t value) { bind_id_ = value; _has_field_.set(8); }
+
+  bool has_bind_to_enclosing() const { return _has_field_[12]; }
+  bool bind_to_enclosing() const { return bind_to_enclosing_; }
+  void set_bind_to_enclosing(bool value) { bind_to_enclosing_ = value; _has_field_.set(12); }
+
+  bool has_flow_direction() const { return _has_field_[13]; }
+  TrackEvent_LegacyEvent_FlowDirection flow_direction() const { return flow_direction_; }
+  void set_flow_direction(TrackEvent_LegacyEvent_FlowDirection value) { flow_direction_ = value; _has_field_.set(13); }
+
+  bool has_instant_event_scope() const { return _has_field_[14]; }
+  TrackEvent_LegacyEvent_InstantEventScope instant_event_scope() const { return instant_event_scope_; }
+  void set_instant_event_scope(TrackEvent_LegacyEvent_InstantEventScope value) { instant_event_scope_ = value; _has_field_.set(14); }
+
+  bool has_pid_override() const { return _has_field_[18]; }
+  int32_t pid_override() const { return pid_override_; }
+  void set_pid_override(int32_t value) { pid_override_ = value; _has_field_.set(18); }
+
+  bool has_tid_override() const { return _has_field_[19]; }
+  int32_t tid_override() const { return tid_override_; }
+  void set_tid_override(int32_t value) { tid_override_ = value; _has_field_.set(19); }
+
+ private:
+  uint64_t name_iid_{};
+  int32_t phase_{};
+  int64_t duration_us_{};
+  int64_t thread_duration_us_{};
+  int64_t thread_instruction_delta_{};
+  uint64_t unscoped_id_{};
+  uint64_t local_id_{};
+  uint64_t global_id_{};
+  std::string id_scope_{};
+  bool use_async_tts_{};
+  uint64_t bind_id_{};
+  bool bind_to_enclosing_{};
+  TrackEvent_LegacyEvent_FlowDirection flow_direction_{};
+  TrackEvent_LegacyEvent_InstantEventScope instant_event_scope_{};
+  int32_t pid_override_{};
+  int32_t tid_override_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<20> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_EVENT_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/track_event.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/source_location.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_window_handle_event_info.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_user_event.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_renderer_scheduler_state.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_mojo_event_info.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_message_pump.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_legacy_ipc.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_latency_info.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_keyed_service.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_histogram_sample.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_frame_reporter.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_content_settings_event_info.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_compositor_scheduler_state.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/chrome_application_state_info.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/task_execution.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/log_message.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/debug_annotation.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+EventName::EventName() = default;
+EventName::~EventName() = default;
+EventName::EventName(const EventName&) = default;
+EventName& EventName::operator=(const EventName&) = default;
+EventName::EventName(EventName&&) noexcept = default;
+EventName& EventName::operator=(EventName&&) = default;
+
+bool EventName::operator==(const EventName& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && iid_ == other.iid_
+   && name_ == other.name_;
+}
+
+bool EventName::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* iid */:
+        field.get(&iid_);
+        break;
+      case 2 /* name */:
+        field.get(&name_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string EventName::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> EventName::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void EventName::Serialize(::protozero::Message* msg) const {
+  // Field 1: iid
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, iid_);
+  }
+
+  // Field 2: name
+  if (_has_field_[2]) {
+    msg->AppendString(2, name_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+EventCategory::EventCategory() = default;
+EventCategory::~EventCategory() = default;
+EventCategory::EventCategory(const EventCategory&) = default;
+EventCategory& EventCategory::operator=(const EventCategory&) = default;
+EventCategory::EventCategory(EventCategory&&) noexcept = default;
+EventCategory& EventCategory::operator=(EventCategory&&) = default;
+
+bool EventCategory::operator==(const EventCategory& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && iid_ == other.iid_
+   && name_ == other.name_;
+}
+
+bool EventCategory::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* iid */:
+        field.get(&iid_);
+        break;
+      case 2 /* name */:
+        field.get(&name_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string EventCategory::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> EventCategory::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void EventCategory::Serialize(::protozero::Message* msg) const {
+  // Field 1: iid
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, iid_);
+  }
+
+  // Field 2: name
+  if (_has_field_[2]) {
+    msg->AppendString(2, name_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+TrackEventDefaults::TrackEventDefaults() = default;
+TrackEventDefaults::~TrackEventDefaults() = default;
+TrackEventDefaults::TrackEventDefaults(const TrackEventDefaults&) = default;
+TrackEventDefaults& TrackEventDefaults::operator=(const TrackEventDefaults&) = default;
+TrackEventDefaults::TrackEventDefaults(TrackEventDefaults&&) noexcept = default;
+TrackEventDefaults& TrackEventDefaults::operator=(TrackEventDefaults&&) = default;
+
+bool TrackEventDefaults::operator==(const TrackEventDefaults& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && track_uuid_ == other.track_uuid_
+   && extra_counter_track_uuids_ == other.extra_counter_track_uuids_
+   && extra_double_counter_track_uuids_ == other.extra_double_counter_track_uuids_;
+}
+
+bool TrackEventDefaults::ParseFromArray(const void* raw, size_t size) {
+  extra_counter_track_uuids_.clear();
+  extra_double_counter_track_uuids_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 11 /* track_uuid */:
+        field.get(&track_uuid_);
+        break;
+      case 31 /* extra_counter_track_uuids */:
+        extra_counter_track_uuids_.emplace_back();
+        field.get(&extra_counter_track_uuids_.back());
+        break;
+      case 45 /* extra_double_counter_track_uuids */:
+        extra_double_counter_track_uuids_.emplace_back();
+        field.get(&extra_double_counter_track_uuids_.back());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string TrackEventDefaults::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> TrackEventDefaults::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void TrackEventDefaults::Serialize(::protozero::Message* msg) const {
+  // Field 11: track_uuid
+  if (_has_field_[11]) {
+    msg->AppendVarInt(11, track_uuid_);
+  }
+
+  // Field 31: extra_counter_track_uuids
+  for (auto& it : extra_counter_track_uuids_) {
+    msg->AppendVarInt(31, it);
+  }
+
+  // Field 45: extra_double_counter_track_uuids
+  for (auto& it : extra_double_counter_track_uuids_) {
+    msg->AppendVarInt(45, it);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+TrackEvent::TrackEvent() = default;
+TrackEvent::~TrackEvent() = default;
+TrackEvent::TrackEvent(const TrackEvent&) = default;
+TrackEvent& TrackEvent::operator=(const TrackEvent&) = default;
+TrackEvent::TrackEvent(TrackEvent&&) noexcept = default;
+TrackEvent& TrackEvent::operator=(TrackEvent&&) = default;
+
+bool TrackEvent::operator==(const TrackEvent& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && category_iids_ == other.category_iids_
+   && categories_ == other.categories_
+   && name_iid_ == other.name_iid_
+   && name_ == other.name_
+   && type_ == other.type_
+   && track_uuid_ == other.track_uuid_
+   && counter_value_ == other.counter_value_
+   && double_counter_value_ == other.double_counter_value_
+   && extra_counter_track_uuids_ == other.extra_counter_track_uuids_
+   && extra_counter_values_ == other.extra_counter_values_
+   && extra_double_counter_track_uuids_ == other.extra_double_counter_track_uuids_
+   && extra_double_counter_values_ == other.extra_double_counter_values_
+   && flow_ids_ == other.flow_ids_
+   && terminating_flow_ids_ == other.terminating_flow_ids_
+   && debug_annotations_ == other.debug_annotations_
+   && task_execution_ == other.task_execution_
+   && log_message_ == other.log_message_
+   && cc_scheduler_state_ == other.cc_scheduler_state_
+   && chrome_user_event_ == other.chrome_user_event_
+   && chrome_keyed_service_ == other.chrome_keyed_service_
+   && chrome_legacy_ipc_ == other.chrome_legacy_ipc_
+   && chrome_histogram_sample_ == other.chrome_histogram_sample_
+   && chrome_latency_info_ == other.chrome_latency_info_
+   && chrome_frame_reporter_ == other.chrome_frame_reporter_
+   && chrome_application_state_info_ == other.chrome_application_state_info_
+   && chrome_renderer_scheduler_state_ == other.chrome_renderer_scheduler_state_
+   && chrome_window_handle_event_info_ == other.chrome_window_handle_event_info_
+   && chrome_content_settings_event_info_ == other.chrome_content_settings_event_info_
+   && source_location_ == other.source_location_
+   && source_location_iid_ == other.source_location_iid_
+   && chrome_message_pump_ == other.chrome_message_pump_
+   && chrome_mojo_event_info_ == other.chrome_mojo_event_info_
+   && timestamp_delta_us_ == other.timestamp_delta_us_
+   && timestamp_absolute_us_ == other.timestamp_absolute_us_
+   && thread_time_delta_us_ == other.thread_time_delta_us_
+   && thread_time_absolute_us_ == other.thread_time_absolute_us_
+   && thread_instruction_count_delta_ == other.thread_instruction_count_delta_
+   && thread_instruction_count_absolute_ == other.thread_instruction_count_absolute_
+   && legacy_event_ == other.legacy_event_;
+}
+
+int TrackEvent::debug_annotations_size() const { return static_cast<int>(debug_annotations_.size()); }
+void TrackEvent::clear_debug_annotations() { debug_annotations_.clear(); }
+DebugAnnotation* TrackEvent::add_debug_annotations() { debug_annotations_.emplace_back(); return &debug_annotations_.back(); }
+bool TrackEvent::ParseFromArray(const void* raw, size_t size) {
+  category_iids_.clear();
+  categories_.clear();
+  extra_counter_track_uuids_.clear();
+  extra_counter_values_.clear();
+  extra_double_counter_track_uuids_.clear();
+  extra_double_counter_values_.clear();
+  flow_ids_.clear();
+  terminating_flow_ids_.clear();
+  debug_annotations_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 3 /* category_iids */:
+        category_iids_.emplace_back();
+        field.get(&category_iids_.back());
+        break;
+      case 22 /* categories */:
+        categories_.emplace_back();
+        field.get(&categories_.back());
+        break;
+      case 10 /* name_iid */:
+        field.get(&name_iid_);
+        break;
+      case 23 /* name */:
+        field.get(&name_);
+        break;
+      case 9 /* type */:
+        field.get(&type_);
+        break;
+      case 11 /* track_uuid */:
+        field.get(&track_uuid_);
+        break;
+      case 30 /* counter_value */:
+        field.get(&counter_value_);
+        break;
+      case 44 /* double_counter_value */:
+        field.get(&double_counter_value_);
+        break;
+      case 31 /* extra_counter_track_uuids */:
+        extra_counter_track_uuids_.emplace_back();
+        field.get(&extra_counter_track_uuids_.back());
+        break;
+      case 12 /* extra_counter_values */:
+        extra_counter_values_.emplace_back();
+        field.get(&extra_counter_values_.back());
+        break;
+      case 45 /* extra_double_counter_track_uuids */:
+        extra_double_counter_track_uuids_.emplace_back();
+        field.get(&extra_double_counter_track_uuids_.back());
+        break;
+      case 46 /* extra_double_counter_values */:
+        extra_double_counter_values_.emplace_back();
+        field.get(&extra_double_counter_values_.back());
+        break;
+      case 36 /* flow_ids */:
+        flow_ids_.emplace_back();
+        field.get(&flow_ids_.back());
+        break;
+      case 42 /* terminating_flow_ids */:
+        terminating_flow_ids_.emplace_back();
+        field.get(&terminating_flow_ids_.back());
+        break;
+      case 4 /* debug_annotations */:
+        debug_annotations_.emplace_back();
+        debug_annotations_.back().ParseFromArray(field.data(), field.size());
+        break;
+      case 5 /* task_execution */:
+        (*task_execution_).ParseFromArray(field.data(), field.size());
+        break;
+      case 21 /* log_message */:
+        (*log_message_).ParseFromArray(field.data(), field.size());
+        break;
+      case 24 /* cc_scheduler_state */:
+        (*cc_scheduler_state_).ParseFromArray(field.data(), field.size());
+        break;
+      case 25 /* chrome_user_event */:
+        (*chrome_user_event_).ParseFromArray(field.data(), field.size());
+        break;
+      case 26 /* chrome_keyed_service */:
+        (*chrome_keyed_service_).ParseFromArray(field.data(), field.size());
+        break;
+      case 27 /* chrome_legacy_ipc */:
+        (*chrome_legacy_ipc_).ParseFromArray(field.data(), field.size());
+        break;
+      case 28 /* chrome_histogram_sample */:
+        (*chrome_histogram_sample_).ParseFromArray(field.data(), field.size());
+        break;
+      case 29 /* chrome_latency_info */:
+        (*chrome_latency_info_).ParseFromArray(field.data(), field.size());
+        break;
+      case 32 /* chrome_frame_reporter */:
+        (*chrome_frame_reporter_).ParseFromArray(field.data(), field.size());
+        break;
+      case 39 /* chrome_application_state_info */:
+        (*chrome_application_state_info_).ParseFromArray(field.data(), field.size());
+        break;
+      case 40 /* chrome_renderer_scheduler_state */:
+        (*chrome_renderer_scheduler_state_).ParseFromArray(field.data(), field.size());
+        break;
+      case 41 /* chrome_window_handle_event_info */:
+        (*chrome_window_handle_event_info_).ParseFromArray(field.data(), field.size());
+        break;
+      case 43 /* chrome_content_settings_event_info */:
+        (*chrome_content_settings_event_info_).ParseFromArray(field.data(), field.size());
+        break;
+      case 33 /* source_location */:
+        (*source_location_).ParseFromArray(field.data(), field.size());
+        break;
+      case 34 /* source_location_iid */:
+        field.get(&source_location_iid_);
+        break;
+      case 35 /* chrome_message_pump */:
+        (*chrome_message_pump_).ParseFromArray(field.data(), field.size());
+        break;
+      case 38 /* chrome_mojo_event_info */:
+        (*chrome_mojo_event_info_).ParseFromArray(field.data(), field.size());
+        break;
+      case 1 /* timestamp_delta_us */:
+        field.get(&timestamp_delta_us_);
+        break;
+      case 16 /* timestamp_absolute_us */:
+        field.get(&timestamp_absolute_us_);
+        break;
+      case 2 /* thread_time_delta_us */:
+        field.get(&thread_time_delta_us_);
+        break;
+      case 17 /* thread_time_absolute_us */:
+        field.get(&thread_time_absolute_us_);
+        break;
+      case 8 /* thread_instruction_count_delta */:
+        field.get(&thread_instruction_count_delta_);
+        break;
+      case 20 /* thread_instruction_count_absolute */:
+        field.get(&thread_instruction_count_absolute_);
+        break;
+      case 6 /* legacy_event */:
+        (*legacy_event_).ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string TrackEvent::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> TrackEvent::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void TrackEvent::Serialize(::protozero::Message* msg) const {
+  // Field 3: category_iids
+  for (auto& it : category_iids_) {
+    msg->AppendVarInt(3, it);
+  }
+
+  // Field 22: categories
+  for (auto& it : categories_) {
+    msg->AppendString(22, it);
+  }
+
+  // Field 10: name_iid
+  if (_has_field_[10]) {
+    msg->AppendVarInt(10, name_iid_);
+  }
+
+  // Field 23: name
+  if (_has_field_[23]) {
+    msg->AppendString(23, name_);
+  }
+
+  // Field 9: type
+  if (_has_field_[9]) {
+    msg->AppendVarInt(9, type_);
+  }
+
+  // Field 11: track_uuid
+  if (_has_field_[11]) {
+    msg->AppendVarInt(11, track_uuid_);
+  }
+
+  // Field 30: counter_value
+  if (_has_field_[30]) {
+    msg->AppendVarInt(30, counter_value_);
+  }
+
+  // Field 44: double_counter_value
+  if (_has_field_[44]) {
+    msg->AppendFixed(44, double_counter_value_);
+  }
+
+  // Field 31: extra_counter_track_uuids
+  for (auto& it : extra_counter_track_uuids_) {
+    msg->AppendVarInt(31, it);
+  }
+
+  // Field 12: extra_counter_values
+  for (auto& it : extra_counter_values_) {
+    msg->AppendVarInt(12, it);
+  }
+
+  // Field 45: extra_double_counter_track_uuids
+  for (auto& it : extra_double_counter_track_uuids_) {
+    msg->AppendVarInt(45, it);
+  }
+
+  // Field 46: extra_double_counter_values
+  for (auto& it : extra_double_counter_values_) {
+    msg->AppendFixed(46, it);
+  }
+
+  // Field 36: flow_ids
+  for (auto& it : flow_ids_) {
+    msg->AppendVarInt(36, it);
+  }
+
+  // Field 42: terminating_flow_ids
+  for (auto& it : terminating_flow_ids_) {
+    msg->AppendVarInt(42, it);
+  }
+
+  // Field 4: debug_annotations
+  for (auto& it : debug_annotations_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(4));
+  }
+
+  // Field 5: task_execution
+  if (_has_field_[5]) {
+    (*task_execution_).Serialize(msg->BeginNestedMessage<::protozero::Message>(5));
+  }
+
+  // Field 21: log_message
+  if (_has_field_[21]) {
+    (*log_message_).Serialize(msg->BeginNestedMessage<::protozero::Message>(21));
+  }
+
+  // Field 24: cc_scheduler_state
+  if (_has_field_[24]) {
+    (*cc_scheduler_state_).Serialize(msg->BeginNestedMessage<::protozero::Message>(24));
+  }
+
+  // Field 25: chrome_user_event
+  if (_has_field_[25]) {
+    (*chrome_user_event_).Serialize(msg->BeginNestedMessage<::protozero::Message>(25));
+  }
+
+  // Field 26: chrome_keyed_service
+  if (_has_field_[26]) {
+    (*chrome_keyed_service_).Serialize(msg->BeginNestedMessage<::protozero::Message>(26));
+  }
+
+  // Field 27: chrome_legacy_ipc
+  if (_has_field_[27]) {
+    (*chrome_legacy_ipc_).Serialize(msg->BeginNestedMessage<::protozero::Message>(27));
+  }
+
+  // Field 28: chrome_histogram_sample
+  if (_has_field_[28]) {
+    (*chrome_histogram_sample_).Serialize(msg->BeginNestedMessage<::protozero::Message>(28));
+  }
+
+  // Field 29: chrome_latency_info
+  if (_has_field_[29]) {
+    (*chrome_latency_info_).Serialize(msg->BeginNestedMessage<::protozero::Message>(29));
+  }
+
+  // Field 32: chrome_frame_reporter
+  if (_has_field_[32]) {
+    (*chrome_frame_reporter_).Serialize(msg->BeginNestedMessage<::protozero::Message>(32));
+  }
+
+  // Field 39: chrome_application_state_info
+  if (_has_field_[39]) {
+    (*chrome_application_state_info_).Serialize(msg->BeginNestedMessage<::protozero::Message>(39));
+  }
+
+  // Field 40: chrome_renderer_scheduler_state
+  if (_has_field_[40]) {
+    (*chrome_renderer_scheduler_state_).Serialize(msg->BeginNestedMessage<::protozero::Message>(40));
+  }
+
+  // Field 41: chrome_window_handle_event_info
+  if (_has_field_[41]) {
+    (*chrome_window_handle_event_info_).Serialize(msg->BeginNestedMessage<::protozero::Message>(41));
+  }
+
+  // Field 43: chrome_content_settings_event_info
+  if (_has_field_[43]) {
+    (*chrome_content_settings_event_info_).Serialize(msg->BeginNestedMessage<::protozero::Message>(43));
+  }
+
+  // Field 33: source_location
+  if (_has_field_[33]) {
+    (*source_location_).Serialize(msg->BeginNestedMessage<::protozero::Message>(33));
+  }
+
+  // Field 34: source_location_iid
+  if (_has_field_[34]) {
+    msg->AppendVarInt(34, source_location_iid_);
+  }
+
+  // Field 35: chrome_message_pump
+  if (_has_field_[35]) {
+    (*chrome_message_pump_).Serialize(msg->BeginNestedMessage<::protozero::Message>(35));
+  }
+
+  // Field 38: chrome_mojo_event_info
+  if (_has_field_[38]) {
+    (*chrome_mojo_event_info_).Serialize(msg->BeginNestedMessage<::protozero::Message>(38));
+  }
+
+  // Field 1: timestamp_delta_us
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, timestamp_delta_us_);
+  }
+
+  // Field 16: timestamp_absolute_us
+  if (_has_field_[16]) {
+    msg->AppendVarInt(16, timestamp_absolute_us_);
+  }
+
+  // Field 2: thread_time_delta_us
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, thread_time_delta_us_);
+  }
+
+  // Field 17: thread_time_absolute_us
+  if (_has_field_[17]) {
+    msg->AppendVarInt(17, thread_time_absolute_us_);
+  }
+
+  // Field 8: thread_instruction_count_delta
+  if (_has_field_[8]) {
+    msg->AppendVarInt(8, thread_instruction_count_delta_);
+  }
+
+  // Field 20: thread_instruction_count_absolute
+  if (_has_field_[20]) {
+    msg->AppendVarInt(20, thread_instruction_count_absolute_);
+  }
+
+  // Field 6: legacy_event
+  if (_has_field_[6]) {
+    (*legacy_event_).Serialize(msg->BeginNestedMessage<::protozero::Message>(6));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+TrackEvent_LegacyEvent::TrackEvent_LegacyEvent() = default;
+TrackEvent_LegacyEvent::~TrackEvent_LegacyEvent() = default;
+TrackEvent_LegacyEvent::TrackEvent_LegacyEvent(const TrackEvent_LegacyEvent&) = default;
+TrackEvent_LegacyEvent& TrackEvent_LegacyEvent::operator=(const TrackEvent_LegacyEvent&) = default;
+TrackEvent_LegacyEvent::TrackEvent_LegacyEvent(TrackEvent_LegacyEvent&&) noexcept = default;
+TrackEvent_LegacyEvent& TrackEvent_LegacyEvent::operator=(TrackEvent_LegacyEvent&&) = default;
+
+bool TrackEvent_LegacyEvent::operator==(const TrackEvent_LegacyEvent& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && name_iid_ == other.name_iid_
+   && phase_ == other.phase_
+   && duration_us_ == other.duration_us_
+   && thread_duration_us_ == other.thread_duration_us_
+   && thread_instruction_delta_ == other.thread_instruction_delta_
+   && unscoped_id_ == other.unscoped_id_
+   && local_id_ == other.local_id_
+   && global_id_ == other.global_id_
+   && id_scope_ == other.id_scope_
+   && use_async_tts_ == other.use_async_tts_
+   && bind_id_ == other.bind_id_
+   && bind_to_enclosing_ == other.bind_to_enclosing_
+   && flow_direction_ == other.flow_direction_
+   && instant_event_scope_ == other.instant_event_scope_
+   && pid_override_ == other.pid_override_
+   && tid_override_ == other.tid_override_;
+}
+
+bool TrackEvent_LegacyEvent::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* name_iid */:
+        field.get(&name_iid_);
+        break;
+      case 2 /* phase */:
+        field.get(&phase_);
+        break;
+      case 3 /* duration_us */:
+        field.get(&duration_us_);
+        break;
+      case 4 /* thread_duration_us */:
+        field.get(&thread_duration_us_);
+        break;
+      case 15 /* thread_instruction_delta */:
+        field.get(&thread_instruction_delta_);
+        break;
+      case 6 /* unscoped_id */:
+        field.get(&unscoped_id_);
+        break;
+      case 10 /* local_id */:
+        field.get(&local_id_);
+        break;
+      case 11 /* global_id */:
+        field.get(&global_id_);
+        break;
+      case 7 /* id_scope */:
+        field.get(&id_scope_);
+        break;
+      case 9 /* use_async_tts */:
+        field.get(&use_async_tts_);
+        break;
+      case 8 /* bind_id */:
+        field.get(&bind_id_);
+        break;
+      case 12 /* bind_to_enclosing */:
+        field.get(&bind_to_enclosing_);
+        break;
+      case 13 /* flow_direction */:
+        field.get(&flow_direction_);
+        break;
+      case 14 /* instant_event_scope */:
+        field.get(&instant_event_scope_);
+        break;
+      case 18 /* pid_override */:
+        field.get(&pid_override_);
+        break;
+      case 19 /* tid_override */:
+        field.get(&tid_override_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string TrackEvent_LegacyEvent::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> TrackEvent_LegacyEvent::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void TrackEvent_LegacyEvent::Serialize(::protozero::Message* msg) const {
+  // Field 1: name_iid
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, name_iid_);
+  }
+
+  // Field 2: phase
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, phase_);
+  }
+
+  // Field 3: duration_us
+  if (_has_field_[3]) {
+    msg->AppendVarInt(3, duration_us_);
+  }
+
+  // Field 4: thread_duration_us
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, thread_duration_us_);
+  }
+
+  // Field 15: thread_instruction_delta
+  if (_has_field_[15]) {
+    msg->AppendVarInt(15, thread_instruction_delta_);
+  }
+
+  // Field 6: unscoped_id
+  if (_has_field_[6]) {
+    msg->AppendVarInt(6, unscoped_id_);
+  }
+
+  // Field 10: local_id
+  if (_has_field_[10]) {
+    msg->AppendVarInt(10, local_id_);
+  }
+
+  // Field 11: global_id
+  if (_has_field_[11]) {
+    msg->AppendVarInt(11, global_id_);
+  }
+
+  // Field 7: id_scope
+  if (_has_field_[7]) {
+    msg->AppendString(7, id_scope_);
+  }
+
+  // Field 9: use_async_tts
+  if (_has_field_[9]) {
+    msg->AppendTinyVarInt(9, use_async_tts_);
+  }
+
+  // Field 8: bind_id
+  if (_has_field_[8]) {
+    msg->AppendVarInt(8, bind_id_);
+  }
+
+  // Field 12: bind_to_enclosing
+  if (_has_field_[12]) {
+    msg->AppendTinyVarInt(12, bind_to_enclosing_);
+  }
+
+  // Field 13: flow_direction
+  if (_has_field_[13]) {
+    msg->AppendVarInt(13, flow_direction_);
+  }
+
+  // Field 14: instant_event_scope
+  if (_has_field_[14]) {
+    msg->AppendVarInt(14, instant_event_scope_);
+  }
+
+  // Field 18: pid_override
+  if (_has_field_[18]) {
+    msg->AppendVarInt(18, pid_override_);
+  }
+
+  // Field 19: tid_override
+  if (_has_field_[19]) {
+    msg->AppendVarInt(19, tid_override_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/config/android/android_log_config.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/config/android/android_polled_state_config.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/config/android/packages_list_config.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/config/ftrace/ftrace_config.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/config/gpu/gpu_counter_config.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/config/gpu/vulkan_memory_config.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/config/inode_file/inode_file_config.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/config/interceptors/console_config.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/config/power/android_power_config.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/config/process_stats/process_stats_config.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/config/profiling/heapprofd_config.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/config/profiling/java_hprof_config.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/config/profiling/perf_event_config.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/config/sys_stats/sys_stats_config.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/config/track_event/track_event_config.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/config/chrome/chrome_config.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/config/data_source_config.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/config/interceptor_config.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/config/stress_test_config.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/config/test_config.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/config/trace_config.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/clock_snapshot.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/trigger.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/system_info.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/android/android_log.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/android/frame_timeline_event.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/android/gpu_mem_event.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/android/graphics_frame_event.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/android/initial_display_state.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/android/packages_list.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/chrome/chrome_benchmark_metadata.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/chrome/chrome_metadata.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/chrome/chrome_trace_event.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/filesystem/inode_file_map.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/ftrace_event.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/ftrace_event_bundle.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/ftrace_stats.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/test_bundle_wrapper.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/generic.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/binder.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/block.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/cgroup.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/clk.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/compaction.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/cpuhp.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/dmabuf_heap.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/dpu.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/ext4.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/f2fs.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/fastrpc.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/fence.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/filemap.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/ftrace.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/g2d.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/gpu_mem.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/i2c.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/ion.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/ipi.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/irq.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/kmem.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/lowmemorykiller.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/mali.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/mdss.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/mm_event.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/oom.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/power.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/raw_syscalls.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/regulator.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/sched.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/scm.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/sde.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/signal.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/sync.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/systrace.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/task.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/thermal.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/vmscan.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ftrace/workqueue.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/perfetto/perfetto_metatrace.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/perfetto/tracing_service_event.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/power/android_energy_estimation_breakdown.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/power/battery_counters.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/power/power_rails.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ps/process_stats.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ps/process_tree.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/sys_stats/sys_stats.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/system_info/cpu_info.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/trace_packet_defaults.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/test_event.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/test_extensions.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/trace_packet.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/trace.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/extension_descriptor.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/memory_graph.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: gen/protos/perfetto/trace/ui_state.pbzero.cc
+// Intentionally empty (crbug.com/998165)
+// gen_amalgamated begin source: src/tracing/trace_writer_base.cc
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/tracing/trace_writer_base.h"
+
+namespace perfetto {
+
+// This destructor needs to be defined in a dedicated translation unit and
+// cannot be merged together with the other ones in virtual_destructors.cc.
+// This is because trace_writer_base.h/cc  is part of a separate target
+// (src/public:common) that is linked also by other part of the codebase.
+
+TraceWriterBase::~TraceWriterBase() = default;
+
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/core/id_allocator.cc
+// gen_amalgamated begin header: src/tracing/core/id_allocator.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SRC_TRACING_CORE_ID_ALLOCATOR_H_
+#define SRC_TRACING_CORE_ID_ALLOCATOR_H_
+
+#include <stdint.h>
+
+#include <type_traits>
+#include <vector>
+
+namespace perfetto {
+
+// Handles assigment of IDs (int types) from a fixed-size pool.
+// Zero is not considered a valid ID.
+// The base class takes always a uint32_t and the derived class casts and checks
+// bounds at compile time. This is to avoid bloating code with different
+// instances of the main class for each size.
+class IdAllocatorGeneric {
+ public:
+  // |max_id| is inclusive.
+  explicit IdAllocatorGeneric(uint32_t max_id);
+  ~IdAllocatorGeneric();
+
+  // Returns an ID in the range [1, max_id] or 0 if no more ids are available.
+  uint32_t AllocateGeneric();
+  void FreeGeneric(uint32_t);
+
+  bool IsEmpty() const;
+
+ private:
+  IdAllocatorGeneric(const IdAllocatorGeneric&) = delete;
+  IdAllocatorGeneric& operator=(const IdAllocatorGeneric&) = delete;
+
+  const uint32_t max_id_;
+  uint32_t last_id_ = 0;
+  std::vector<bool> ids_;
+};
+
+template <typename T = uint32_t>
+class IdAllocator : public IdAllocatorGeneric {
+ public:
+  explicit IdAllocator(T end) : IdAllocatorGeneric(end) {
+    static_assert(std::is_integral<T>::value && std::is_unsigned<T>::value,
+                  "T must be an unsigned integer");
+    static_assert(sizeof(T) <= sizeof(uint32_t), "T is too big");
+  }
+
+  T Allocate() { return static_cast<T>(AllocateGeneric()); }
+  void Free(T id) { FreeGeneric(id); }
+};
+
+}  // namespace perfetto
+
+#endif  // SRC_TRACING_CORE_ID_ALLOCATOR_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "src/tracing/core/id_allocator.h"
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+
+namespace perfetto {
+
+IdAllocatorGeneric::IdAllocatorGeneric(uint32_t max_id) : max_id_(max_id) {
+  PERFETTO_DCHECK(max_id > 1);
+}
+
+IdAllocatorGeneric::~IdAllocatorGeneric() = default;
+
+uint32_t IdAllocatorGeneric::AllocateGeneric() {
+  for (uint32_t ignored = 1; ignored <= max_id_; ignored++) {
+    last_id_ = last_id_ < max_id_ ? last_id_ + 1 : 1;
+    const auto id = last_id_;
+
+    // 0 is never a valid ID. So if we are looking for |id| == N and there are
+    // N or less elements in the vector, they must necessarily be all < N.
+    // e.g. if |id| == 4 and size() == 4, the vector will contain IDs 0,1,2,3.
+    if (id >= ids_.size()) {
+      ids_.resize(id + 1);
+      ids_[id] = true;
+      return id;
+    }
+
+    if (!ids_[id]) {
+      ids_[id] = true;
+      return id;
+    }
+  }
+  return 0;
+}
+
+void IdAllocatorGeneric::FreeGeneric(uint32_t id) {
+  if (id == 0 || id >= ids_.size() || !ids_[id]) {
+    PERFETTO_DFATAL("Invalid id.");
+    return;
+  }
+  ids_[id] = false;
+}
+
+bool IdAllocatorGeneric::IsEmpty() const {
+  for (const auto id : ids_) {
+    if (id)
+      return false;
+  }
+  return true;
+}
+
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/core/null_trace_writer.cc
+// gen_amalgamated begin header: src/tracing/core/null_trace_writer.h
+// gen_amalgamated begin header: include/perfetto/ext/tracing/core/trace_writer.h
+// gen_amalgamated begin header: include/perfetto/ext/tracing/core/basic_types.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_TRACING_CORE_BASIC_TYPES_H_
+#define INCLUDE_PERFETTO_EXT_TRACING_CORE_BASIC_TYPES_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+
+#include <stddef.h>
+#include <stdint.h>
+#include <sys/types.h>
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+using uid_t = unsigned int;
+#endif
+
+namespace perfetto {
+
+// Unique within the scope of the tracing service.
+using TracingSessionID = uint64_t;
+
+// Unique within the scope of the tracing service.
+using ProducerID = uint16_t;
+
+// Unique within the scope of the tracing service.
+using DataSourceInstanceID = uint64_t;
+
+// Unique within the scope of a Producer.
+using WriterID = uint16_t;
+
+// Unique within the scope of the tracing service.
+using FlushRequestID = uint64_t;
+
+// We need one FD per producer and we are not going to be able to keep > 64k FDs
+// open in the service.
+static constexpr ProducerID kMaxProducerID = static_cast<ProducerID>(-1);
+
+// 1024 Writers per producer seems a resonable bound. This reduces the ability
+// to memory-DoS the service by having to keep track of too many writer IDs.
+static constexpr WriterID kMaxWriterID = static_cast<WriterID>((1 << 10) - 1);
+
+// Unique within the scope of a {ProducerID, WriterID} tuple.
+using ChunkID = uint32_t;
+static constexpr ChunkID kMaxChunkID = static_cast<ChunkID>(-1);
+
+// Unique within the scope of the tracing service.
+using BufferID = uint16_t;
+
+// Target buffer ID for SharedMemoryArbiter. Values up to max uint16_t are
+// equivalent to a bound BufferID. Values above max uint16_t are reservation IDs
+// for the target buffer of a startup trace writer. Reservation IDs will be
+// translated to actual BufferIDs after they are bound by
+// SharedMemoryArbiter::BindStartupTargetBuffer().
+using MaybeUnboundBufferID = uint32_t;
+
+// Keep this in sync with SharedMemoryABI::PageHeader::target_buffer.
+static constexpr BufferID kMaxTraceBufferID = static_cast<BufferID>(-1);
+
+// Unique within the scope of a tracing session.
+using PacketSequenceID = uint32_t;
+// Used for extra packets emitted by the service, such as statistics.
+static constexpr PacketSequenceID kServicePacketSequenceID = 1;
+static constexpr PacketSequenceID kMaxPacketSequenceID =
+    static_cast<PacketSequenceID>(-1);
+
+constexpr uid_t kInvalidUid = static_cast<uid_t>(-1);
+
+constexpr uint32_t kDefaultFlushTimeoutMs = 5000;
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_TRACING_CORE_BASIC_TYPES_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_TRACING_CORE_TRACE_WRITER_H_
+#define INCLUDE_PERFETTO_EXT_TRACING_CORE_TRACE_WRITER_H_
+
+#include <functional>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/basic_types.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message_handle.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/trace_writer_base.h"
+
+namespace perfetto {
+
+namespace protos {
+namespace pbzero {
+class TracePacket;
+}  // namespace pbzero
+}  // namespace protos
+
+// This is a single-thread write interface that allows to write protobufs
+// directly into the tracing shared buffer without making any copies.
+// It takes care of acquiring and releasing chunks from the
+// SharedMemoryArbiter and splitting protos over chunks.
+// The idea is that each data source creates one (or more) TraceWriter for each
+// thread it wants to write from. Each TraceWriter will get its own dedicated
+// chunk and will write into the shared buffer without any locking most of the
+// time. Locking will happen only when a chunk is exhausted and a new one is
+// acquired from the arbiter.
+
+// TODO: TraceWriter needs to keep the shared memory buffer alive (refcount?).
+// Otherwise if the shared memory buffer goes away (e.g. the Service crashes)
+// the TraceWriter will keep writing into unmapped memory.
+
+class PERFETTO_EXPORT TraceWriter : public TraceWriterBase {
+ public:
+  using TracePacketHandle =
+      protozero::MessageHandle<protos::pbzero::TracePacket>;
+
+  TraceWriter();
+  ~TraceWriter() override;
+
+  // Returns a handle to the root proto message for the trace. The message will
+  // be finalized either by calling directly handle.Finalize() or by letting the
+  // handle go out of scope. The returned handle can be std::move()'d but cannot
+  // be used after either: (i) the TraceWriter instance is destroyed, (ii) a
+  // subsequence NewTracePacket() call is made on the same TraceWriter instance.
+  // The returned packet handle is always valid, but note that, when using
+  // BufferExhaustedPolicy::kDrop and the SMB is exhausted, it may be assigned
+  // a garbage chunk and any trace data written into it will be lost. For more
+  // details on buffer size choices: https://perfetto.dev/docs/concepts/buffers.
+  TracePacketHandle NewTracePacket() override = 0;
+
+  // Commits the data pending for the current chunk into the shared memory
+  // buffer and sends a CommitDataRequest() to the service. This can be called
+  // only if the handle returned by NewTracePacket() has been destroyed (i.e. we
+  // cannot Flush() while writing a TracePacket).
+  // Note: Flush() also happens implicitly when destroying the TraceWriter.
+  // |callback| is an optional callback. When non-null it will request the
+  // service to ACK the flush and will be invoked after the service has
+  // acknowledged it. The callback might be NEVER INVOKED if the service crashes
+  // or the IPC connection is dropped. The callback should be used only by tests
+  // and best-effort features (logging).
+  // TODO(primiano): right now the |callback| will be called on the IPC thread.
+  // This is fine in the current single-thread scenario, but long-term
+  // trace_writer_impl.cc should be smarter and post it on the right thread.
+  void Flush(std::function<void()> callback = {}) override = 0;
+
+  virtual WriterID writer_id() const = 0;
+
+  // Bytes written since creation. Is not reset when new chunks are acquired.
+  virtual uint64_t written() const override = 0;
+
+ private:
+  TraceWriter(const TraceWriter&) = delete;
+  TraceWriter& operator=(const TraceWriter&) = delete;
+};
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_TRACING_CORE_TRACE_WRITER_H_
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SRC_TRACING_CORE_NULL_TRACE_WRITER_H_
+#define SRC_TRACING_CORE_NULL_TRACE_WRITER_H_
+
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/trace_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message_handle.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/root_message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_stream_null_delegate.h"
+
+namespace perfetto {
+
+// A specialization of TraceWriter which no-ops all the writes routing them
+// into a fixed region of memory
+// See //include/perfetto/tracing/core/trace_writer.h for docs.
+class NullTraceWriter : public TraceWriter {
+ public:
+  NullTraceWriter();
+  ~NullTraceWriter() override;
+
+  // TraceWriter implementation. See documentation in trace_writer.h.
+  // TracePacketHandle is defined in trace_writer.h
+  TracePacketHandle NewTracePacket() override;
+  void Flush(std::function<void()> callback = {}) override;
+  WriterID writer_id() const override;
+  uint64_t written() const override;
+
+ private:
+  NullTraceWriter(const NullTraceWriter&) = delete;
+  NullTraceWriter& operator=(const NullTraceWriter&) = delete;
+
+  protozero::ScatteredStreamWriterNullDelegate delegate_;
+  protozero::ScatteredStreamWriter stream_;
+
+  // The packet returned via NewTracePacket(). Its owned by this class,
+  // TracePacketHandle has just a pointer to it.
+  std::unique_ptr<protozero::RootMessage<protos::pbzero::TracePacket>>
+      cur_packet_;
+};
+
+}  // namespace perfetto
+
+#endif  // SRC_TRACING_CORE_NULL_TRACE_WRITER_H_
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "src/tracing/core/null_trace_writer.h"
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+
+// gen_amalgamated expanded: #include "protos/perfetto/trace/trace_packet.pbzero.h"
+
+namespace perfetto {
+
+NullTraceWriter::NullTraceWriter() : delegate_(4096), stream_(&delegate_) {
+  cur_packet_.reset(new protozero::RootMessage<protos::pbzero::TracePacket>());
+  cur_packet_->Finalize();  // To avoid the DCHECK in NewTracePacket().
+}
+
+NullTraceWriter::~NullTraceWriter() {}
+
+void NullTraceWriter::Flush(std::function<void()> callback) {
+  // Flush() cannot be called in the middle of a TracePacket.
+  PERFETTO_CHECK(cur_packet_->is_finalized());
+
+  if (callback)
+    callback();
+}
+
+NullTraceWriter::TracePacketHandle NullTraceWriter::NewTracePacket() {
+  // If we hit this, the caller is calling NewTracePacket() without having
+  // finalized the previous packet.
+  PERFETTO_DCHECK(cur_packet_->is_finalized());
+  cur_packet_->Reset(&stream_);
+  return TraceWriter::TracePacketHandle(cur_packet_.get());
+}
+
+WriterID NullTraceWriter::writer_id() const {
+  return 0;
+}
+
+uint64_t NullTraceWriter::written() const {
+  return 0;
+}
+
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/core/shared_memory_abi.cc
+// gen_amalgamated begin header: include/perfetto/ext/tracing/core/shared_memory_abi.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_TRACING_CORE_SHARED_MEMORY_ABI_H_
+#define INCLUDE_PERFETTO_EXT_TRACING_CORE_SHARED_MEMORY_ABI_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include <array>
+#include <atomic>
+#include <bitset>
+#include <thread>
+#include <type_traits>
+#include <utility>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+
+// This file defines the binary interface of the memory buffers shared between
+// Producer and Service. This is a long-term stable ABI and has to be backwards
+// compatible to deal with mismatching Producer and Service versions.
+//
+// Overview
+// --------
+// SMB := "Shared Memory Buffer".
+// In the most typical case of a multi-process architecture (i.e. Producer and
+// Service are hosted by different processes), a Producer means almost always
+// a "client process producing data" (almost: in some cases a process might host
+// > 1 Producer, if it links two libraries, independent of each other, that both
+// use Perfetto tracing).
+// The Service has one SMB for each Producer.
+// A producer has one or (typically) more data sources. They all share the same
+// SMB.
+// The SMB is a staging area to decouple data sources living in the Producer
+// and allow them to do non-blocking async writes.
+// The SMB is *not* the ultimate logging buffer seen by the Consumer. That one
+// is larger (~MBs) and not shared with Producers.
+// Each SMB is small, typically few KB. Its size is configurable by the producer
+// within a max limit of ~MB (see kMaxShmSize in tracing_service_impl.cc).
+// The SMB is partitioned into fixed-size Page(s). The size of the Pages are
+// determined by each Producer at connection time and cannot be changed.
+// Hence, different producers can have SMB(s) that have a different Page size
+// from each other, but the page size will be constant throughout all the
+// lifetime of the SMB.
+// Page(s) are partitioned by the Producer into variable size Chunk(s):
+//
+// +------------+      +--------------------------+
+// | Producer 1 |  <-> |      SMB 1 [~32K - 1MB]  |
+// +------------+      +--------+--------+--------+
+//                     |  Page  |  Page  |  Page  |
+//                     +--------+--------+--------+
+//                     | Chunk  |        | Chunk  |
+//                     +--------+  Chunk +--------+ <----+
+//                     | Chunk  |        | Chunk  |      |
+//                     +--------+--------+--------+      +---------------------+
+//                                                       |       Service       |
+// +------------+      +--------------------------+      +---------------------+
+// | Producer 2 |  <-> |      SMB 2 [~32K - 1MB]  |     /| large ring buffers  |
+// +------------+      +--------+--------+--------+ <--+ | (100K - several MB) |
+//                     |  Page  |  Page  |  Page  |      +---------------------+
+//                     +--------+--------+--------+
+//                     | Chunk  |        | Chunk  |
+//                     +--------+  Chunk +--------+
+//                     | Chunk  |        | Chunk  |
+//                     +--------+--------+--------+
+//
+// * Sizes of both SMB and ring buffers are purely indicative and decided at
+// configuration time by the Producer (for SMB sizes) and the Consumer (for the
+// final ring buffer size).
+
+// Page
+// ----
+// A page is a portion of the shared memory buffer and defines the granularity
+// of the interaction between the Producer and tracing Service. When scanning
+// the shared memory buffer to determine if something should be moved to the
+// central logging buffers, the Service most of the times looks at and moves
+// whole pages. Similarly, the Producer sends an IPC to invite the Service to
+// drain the shared memory buffer only when a whole page is filled.
+// Having fixed the total SMB size (hence the total memory overhead), the page
+// size is a triangular tradeoff between:
+// 1) IPC traffic: smaller pages -> more IPCs.
+// 2) Producer lock freedom: larger pages -> larger chunks -> data sources can
+//    write more data without needing to swap chunks and synchronize.
+// 3) Risk of write-starving the SMB: larger pages -> higher chance that the
+//    Service won't manage to drain them and the SMB remains full.
+// The page size, on the other side, has no implications on wasted memory due to
+// fragmentations (see Chunk below).
+// The size of the page is chosen by the Service at connection time and stays
+// fixed throughout all the lifetime of the Producer. Different producers (i.e.
+// ~ different client processes) can use different page sizes.
+// The page size must be an integer multiple of 4k (this is to allow VM page
+// stealing optimizations) and obviously has to be an integer divisor of the
+// total SMB size.
+
+// Chunk
+// -----
+// A chunk is a portion of a Page which is written and handled by a Producer.
+// A chunk contains a linear sequence of TracePacket(s) (the root proto).
+// A chunk cannot be written concurrently by two data sources. Protobufs must be
+// encoded as contiguous byte streams and cannot be interleaved. Therefore, on
+// the Producer side, a chunk is almost always owned exclusively by one thread
+// (% extremely peculiar slow-path cases).
+// Chunks are essentially single-writer single-thread lock-free arenas. Locking
+// happens only when a Chunk is full and a new one needs to be acquired.
+// Locking happens only within the scope of a Producer process. There is no
+// inter-process locking. The Producer cannot lock the Service and viceversa.
+// In the worst case, any of the two can starve the SMB, by marking all chunks
+// as either being read or written. But that has the only side effect of
+// losing the trace data.
+// The Producer can decide to partition each page into a number of limited
+// configurations (e.g., 1 page == 1 chunk, 1 page == 2 chunks and so on).
+
+// TracePacket
+// -----------
+// Is the atom of tracing. Putting aside pages and chunks a trace is merely a
+// sequence of TracePacket(s). TracePacket is the root protobuf message.
+// A TracePacket can span across several chunks (hence even across several
+// pages). A TracePacket can therefore be >> chunk size, >> page size and even
+// >> SMB size. The Chunk header carries metadata to deal with the TracePacket
+// splitting case.
+
+// Use only explicitly-sized types below. DO NOT use size_t or any architecture
+// dependent size (e.g. size_t) in the struct fields. This buffer will be read
+// and written by processes that have a different bitness in the same OS.
+// Instead it's fine to assume little-endianess. Big-endian is a dream we are
+// not currently pursuing.
+
+class SharedMemoryABI {
+ public:
+  static constexpr size_t kMinPageSize = 4 * 1024;
+
+  // This is due to Chunk::size being 16 bits.
+  static constexpr size_t kMaxPageSize = 64 * 1024;
+
+  // "14" is the max number that can be encoded in a 32 bit atomic word using
+  // 2 state bits per Chunk and leaving 4 bits for the page layout.
+  // See PageLayout below.
+  static constexpr size_t kMaxChunksPerPage = 14;
+
+  // Each TracePacket in the Chunk is prefixed by a 4 bytes redundant VarInt
+  // (see proto_utils.h) stating its size.
+  static constexpr size_t kPacketHeaderSize = 4;
+
+  // TraceWriter specifies this invalid packet/fragment size to signal to the
+  // service that a packet should be discarded, because the TraceWriter couldn't
+  // write its remaining fragments (e.g. because the SMB was exhausted).
+  static constexpr size_t kPacketSizeDropPacket =
+      protozero::proto_utils::kMaxMessageLength;
+
+  // Chunk states and transitions:
+  //    kChunkFree  <----------------+
+  //         |  (Producer)           |
+  //         V                       |
+  //  kChunkBeingWritten             |
+  //         |  (Producer)           |
+  //         V                       |
+  //  kChunkComplete                 |
+  //         |  (Service)            |
+  //         V                       |
+  //  kChunkBeingRead                |
+  //        |   (Service)            |
+  //        +------------------------+
+  enum ChunkState : uint32_t {
+    // The Chunk is free. The Service shall never touch it, the Producer can
+    // acquire it and transition it into kChunkBeingWritten.
+    kChunkFree = 0,
+
+    // The Chunk is being used by the Producer and is not complete yet.
+    // The Service shall never touch kChunkBeingWritten pages.
+    kChunkBeingWritten = 1,
+
+    // The Service is moving the page into its non-shared ring buffer. The
+    // Producer shall never touch kChunkBeingRead pages.
+    kChunkBeingRead = 2,
+
+    // The Producer is done writing the page and won't touch it again. The
+    // Service can now move it to its non-shared ring buffer.
+    // kAllChunksComplete relies on this being == 3.
+    kChunkComplete = 3,
+  };
+  static constexpr const char* kChunkStateStr[] = {"Free", "BeingWritten",
+                                                   "BeingRead", "Complete"};
+
+  enum PageLayout : uint32_t {
+    // The page is fully free and has not been partitioned yet.
+    kPageNotPartitioned = 0,
+
+    // TODO(primiano): Aligning a chunk @ 16 bytes could allow to use faster
+    // intrinsics based on quad-word moves. Do the math and check what is the
+    // fragmentation loss.
+
+    // align4(X) := the largest integer N s.t. (N % 4) == 0 && N <= X.
+    // 8 == sizeof(PageHeader).
+    kPageDiv1 = 1,   // Only one chunk of size: PAGE_SIZE - 8.
+    kPageDiv2 = 2,   // Two chunks of size: align4((PAGE_SIZE - 8) / 2).
+    kPageDiv4 = 3,   // Four chunks of size: align4((PAGE_SIZE - 8) / 4).
+    kPageDiv7 = 4,   // Seven chunks of size: align4((PAGE_SIZE - 8) / 7).
+    kPageDiv14 = 5,  // Fourteen chunks of size: align4((PAGE_SIZE - 8) / 14).
+
+    // The rationale for 7 and 14 above is to maximize the page usage for the
+    // likely case of |page_size| == 4096:
+    // (((4096 - 8) / 14) % 4) == 0, while (((4096 - 8) / 16 % 4)) == 3. So
+    // Div16 would waste 3 * 16 = 48 bytes per page for chunk alignment gaps.
+
+    kPageDivReserved1 = 6,
+    kPageDivReserved2 = 7,
+    kNumPageLayouts = 8,
+  };
+
+  // Keep this consistent with the PageLayout enum above.
+  static constexpr uint32_t kNumChunksForLayout[] = {0, 1, 2, 4, 7, 14, 0, 0};
+
+  // Layout of a Page.
+  // +===================================================+
+  // | Page header [8 bytes]                             |
+  // | Tells how many chunks there are, how big they are |
+  // | and their state (free, read, write, complete).    |
+  // +===================================================+
+  // +***************************************************+
+  // | Chunk #0 header [8 bytes]                         |
+  // | Tells how many packets there are and whether the  |
+  // | whether the 1st and last ones are fragmented.     |
+  // | Also has a chunk id to reassemble fragments.    |
+  // +***************************************************+
+  // +---------------------------------------------------+
+  // | Packet #0 size [varint, up to 4 bytes]            |
+  // + - - - - - - - - - - - - - - - - - - - - - - - - - +
+  // | Packet #0 payload                                 |
+  // | A TracePacket protobuf message                    |
+  // +---------------------------------------------------+
+  //                         ...
+  // + . . . . . . . . . . . . . . . . . . . . . . . . . +
+  // |      Optional padding to maintain aligment        |
+  // + . . . . . . . . . . . . . . . . . . . . . . . . . +
+  // +---------------------------------------------------+
+  // | Packet #N size [varint, up to 4 bytes]            |
+  // + - - - - - - - - - - - - - - - - - - - - - - - - - +
+  // | Packet #N payload                                 |
+  // | A TracePacket protobuf message                    |
+  // +---------------------------------------------------+
+  //                         ...
+  // +***************************************************+
+  // | Chunk #M header [8 bytes]                         |
+  //                         ...
+
+  // Alignment applies to start offset only. The Chunk size is *not* aligned.
+  static constexpr uint32_t kChunkAlignment = 4;
+  static constexpr uint32_t kChunkShift = 2;
+  static constexpr uint32_t kChunkMask = 0x3;
+  static constexpr uint32_t kLayoutMask = 0x70000000;
+  static constexpr uint32_t kLayoutShift = 28;
+  static constexpr uint32_t kAllChunksMask = 0x0FFFFFFF;
+
+  // This assumes that kChunkComplete == 3.
+  static constexpr uint32_t kAllChunksComplete = 0x0FFFFFFF;
+  static constexpr uint32_t kAllChunksFree = 0;
+  static constexpr size_t kInvalidPageIdx = static_cast<size_t>(-1);
+
+  // There is one page header per page, at the beginning of the page.
+  struct PageHeader {
+    // |layout| bits:
+    // [31] [30:28] [27:26] ... [1:0]
+    //  |      |       |     |    |
+    //  |      |       |     |    +---------- ChunkState[0]
+    //  |      |       |     +--------------- ChunkState[12..1]
+    //  |      |       +--------------------- ChunkState[13]
+    //  |      +----------------------------- PageLayout (0 == page fully free)
+    //  +------------------------------------ Reserved for future use
+    std::atomic<uint32_t> layout;
+
+    // If we'll ever going to use this in the future it might come handy
+    // reviving the kPageBeingPartitioned logic (look in git log, it was there
+    // at some point in the past).
+    uint32_t reserved;
+  };
+
+  // There is one Chunk header per chunk (hence PageLayout per page) at the
+  // beginning of each chunk.
+  struct ChunkHeader {
+    enum Flags : uint8_t {
+      // If set, the first TracePacket in the chunk is partial and continues
+      // from |chunk_id| - 1 (within the same |writer_id|).
+      kFirstPacketContinuesFromPrevChunk = 1 << 0,
+
+      // If set, the last TracePacket in the chunk is partial and continues on
+      // |chunk_id| + 1 (within the same |writer_id|).
+      kLastPacketContinuesOnNextChunk = 1 << 1,
+
+      // If set, the last (fragmented) TracePacket in the chunk has holes (even
+      // if the chunk is marked as kChunkComplete) that need to be patched
+      // out-of-band before the chunk can be read.
+      kChunkNeedsPatching = 1 << 2,
+    };
+
+    struct Packets {
+      // Number of valid TracePacket protobuf messages contained in the chunk.
+      // Each TracePacket is prefixed by its own size. This field is
+      // monotonically updated by the Producer with release store semantic when
+      // the packet at position |count| is started. This last packet may not be
+      // considered complete until |count| is incremented for the subsequent
+      // packet or the chunk is completed.
+      uint16_t count : 10;
+      static constexpr size_t kMaxCount = (1 << 10) - 1;
+
+      // See Flags above.
+      uint16_t flags : 6;
+    };
+
+    // A monotonic counter of the chunk within the scoped of a |writer_id|.
+    // The tuple (ProducerID, WriterID, ChunkID) allows to figure out if two
+    // chunks are contiguous (and hence a trace packets spanning across them can
+    // be glued) or we had some holes due to the ring buffer wrapping.
+    // This is set only when transitioning from kChunkFree to kChunkBeingWritten
+    // and remains unchanged throughout the remaining lifetime of the chunk.
+    std::atomic<uint32_t> chunk_id;
+
+    // ID of the writer, unique within the producer.
+    // Like |chunk_id|, this is set only when transitioning from kChunkFree to
+    // kChunkBeingWritten.
+    std::atomic<uint16_t> writer_id;
+
+    // There is no ProducerID here. The service figures that out from the IPC
+    // channel, which is unspoofable.
+
+    // Updated with release-store semantics.
+    std::atomic<Packets> packets;
+  };
+
+  class Chunk {
+   public:
+    Chunk();  // Constructs an invalid chunk.
+
+    // Chunk is move-only, to document the scope of the Acquire/Release
+    // TryLock operations below.
+    Chunk(const Chunk&) = delete;
+    Chunk operator=(const Chunk&) = delete;
+    Chunk(Chunk&&) noexcept;
+    Chunk& operator=(Chunk&&);
+
+    uint8_t* begin() const { return begin_; }
+    uint8_t* end() const { return begin_ + size_; }
+
+    // Size, including Chunk header.
+    size_t size() const { return size_; }
+
+    // Begin of the first packet (or packet fragment).
+    uint8_t* payload_begin() const { return begin_ + sizeof(ChunkHeader); }
+    size_t payload_size() const {
+      PERFETTO_DCHECK(size_ >= sizeof(ChunkHeader));
+      return size_ - sizeof(ChunkHeader);
+    }
+
+    bool is_valid() const { return begin_ && size_; }
+
+    // Index of the chunk within the page [0..13] (13 comes from kPageDiv14).
+    uint8_t chunk_idx() const { return chunk_idx_; }
+
+    ChunkHeader* header() { return reinterpret_cast<ChunkHeader*>(begin_); }
+
+    uint16_t writer_id() {
+      return header()->writer_id.load(std::memory_order_relaxed);
+    }
+
+    // Returns the count of packets and the flags with acquire-load semantics.
+    std::pair<uint16_t, uint8_t> GetPacketCountAndFlags() {
+      auto packets = header()->packets.load(std::memory_order_acquire);
+      const uint16_t packets_count = packets.count;
+      const uint8_t packets_flags = packets.flags;
+      return std::make_pair(packets_count, packets_flags);
+    }
+
+    // Increases |packets.count| with release semantics (note, however, that the
+    // packet count is incremented *before* starting writing a packet). Returns
+    // the new packet count. The increment is atomic but NOT race-free (i.e. no
+    // CAS). Only the Producer is supposed to perform this increment, and it's
+    // supposed to do that in a thread-safe way (holding a lock). A Chunk cannot
+    // be shared by multiple Producer threads without locking. The packet count
+    // is cleared by TryAcquireChunk(), when passing the new header for the
+    // chunk.
+    uint16_t IncrementPacketCount() {
+      ChunkHeader* chunk_header = header();
+      auto packets = chunk_header->packets.load(std::memory_order_relaxed);
+      packets.count++;
+      chunk_header->packets.store(packets, std::memory_order_release);
+      return packets.count;
+    }
+
+    // Increases |packets.count| to the given |packet_count|, but only if
+    // |packet_count| is larger than the current value of |packets.count|.
+    // Returns the new packet count. Same atomicity guarantees as
+    // IncrementPacketCount().
+    uint16_t IncreasePacketCountTo(uint16_t packet_count) {
+      ChunkHeader* chunk_header = header();
+      auto packets = chunk_header->packets.load(std::memory_order_relaxed);
+      if (packets.count < packet_count)
+        packets.count = packet_count;
+      chunk_header->packets.store(packets, std::memory_order_release);
+      return packets.count;
+    }
+
+    // Flags are cleared by TryAcquireChunk(), by passing the new header for
+    // the chunk, or through ClearNeedsPatchingFlag.
+    void SetFlag(ChunkHeader::Flags flag) {
+      ChunkHeader* chunk_header = header();
+      auto packets = chunk_header->packets.load(std::memory_order_relaxed);
+      packets.flags |= flag;
+      chunk_header->packets.store(packets, std::memory_order_release);
+    }
+
+    // This flag can only be cleared by the producer while it is still holding
+    // on to the chunk - i.e. while the chunk is still in state
+    // ChunkState::kChunkBeingWritten and hasn't been transitioned to
+    // ChunkState::kChunkComplete. This is ok, because the service is oblivious
+    // to the needs patching flag before the chunk is released as complete.
+    void ClearNeedsPatchingFlag() {
+      ChunkHeader* chunk_header = header();
+      auto packets = chunk_header->packets.load(std::memory_order_relaxed);
+      packets.flags &= ~ChunkHeader::kChunkNeedsPatching;
+      chunk_header->packets.store(packets, std::memory_order_release);
+    }
+
+   private:
+    friend class SharedMemoryABI;
+    Chunk(uint8_t* begin, uint16_t size, uint8_t chunk_idx);
+
+    // Don't add extra fields, keep the move operator fast.
+    uint8_t* begin_ = nullptr;
+    uint16_t size_ = 0;
+    uint8_t chunk_idx_ = 0;
+  };
+
+  // Construct an instance from an existing shared memory buffer.
+  SharedMemoryABI(uint8_t* start, size_t size, size_t page_size);
+  SharedMemoryABI();
+
+  void Initialize(uint8_t* start, size_t size, size_t page_size);
+
+  uint8_t* start() const { return start_; }
+  uint8_t* end() const { return start_ + size_; }
+  size_t size() const { return size_; }
+  size_t page_size() const { return page_size_; }
+  size_t num_pages() const { return num_pages_; }
+  bool is_valid() { return num_pages() > 0; }
+
+  uint8_t* page_start(size_t page_idx) {
+    PERFETTO_DCHECK(page_idx < num_pages_);
+    return start_ + page_size_ * page_idx;
+  }
+
+  PageHeader* page_header(size_t page_idx) {
+    return reinterpret_cast<PageHeader*>(page_start(page_idx));
+  }
+
+  // Returns true if the page is fully clear and has not been partitioned yet.
+  // The state of the page can change at any point after this returns (or even
+  // before). The Producer should use this only as a hint to decide out whether
+  // it should TryPartitionPage() or acquire an individual chunk.
+  bool is_page_free(size_t page_idx) {
+    return page_header(page_idx)->layout.load(std::memory_order_relaxed) == 0;
+  }
+
+  // Returns true if all chunks in the page are kChunkComplete. As above, this
+  // is advisory only. The Service is supposed to use this only to decide
+  // whether to TryAcquireAllChunksForReading() or not.
+  bool is_page_complete(size_t page_idx) {
+    auto layout = page_header(page_idx)->layout.load(std::memory_order_relaxed);
+    const uint32_t num_chunks = GetNumChunksForLayout(layout);
+    if (num_chunks == 0)
+      return false;  // Non partitioned pages cannot be complete.
+    return (layout & kAllChunksMask) ==
+           (kAllChunksComplete & ((1 << (num_chunks * kChunkShift)) - 1));
+  }
+
+  // For testing / debugging only.
+  std::string page_header_dbg(size_t page_idx) {
+    uint32_t x = page_header(page_idx)->layout.load(std::memory_order_relaxed);
+    return std::bitset<32>(x).to_string();
+  }
+
+  // Returns the page layout, which is a bitmap that specifies the chunking
+  // layout of the page and each chunk's current state. Reads with an
+  // acquire-load semantic to ensure a producer's writes corresponding to an
+  // update of the layout (e.g. clearing a chunk's header) are observed
+  // consistently.
+  uint32_t GetPageLayout(size_t page_idx) {
+    return page_header(page_idx)->layout.load(std::memory_order_acquire);
+  }
+
+  // Returns a bitmap in which each bit is set if the corresponding Chunk exists
+  // in the page (according to the page layout) and is free. If the page is not
+  // partitioned it returns 0 (as if the page had no free chunks).
+  uint32_t GetFreeChunks(size_t page_idx);
+
+  // Tries to atomically partition a page with the given |layout|. Returns true
+  // if the page was free and has been partitioned with the given |layout|,
+  // false if the page wasn't free anymore by the time we got there.
+  // If succeeds all the chunks are atomically set in the kChunkFree state.
+  bool TryPartitionPage(size_t page_idx, PageLayout layout);
+
+  // Tries to atomically mark a single chunk within the page as
+  // kChunkBeingWritten. Returns an invalid chunk if the page is not partitioned
+  // or the chunk is not in the kChunkFree state. If succeeds sets the chunk
+  // header to |header|.
+  Chunk TryAcquireChunkForWriting(size_t page_idx,
+                                  size_t chunk_idx,
+                                  const ChunkHeader* header) {
+    return TryAcquireChunk(page_idx, chunk_idx, kChunkBeingWritten, header);
+  }
+
+  // Similar to TryAcquireChunkForWriting. Fails if the chunk isn't in the
+  // kChunkComplete state.
+  Chunk TryAcquireChunkForReading(size_t page_idx, size_t chunk_idx) {
+    return TryAcquireChunk(page_idx, chunk_idx, kChunkBeingRead, nullptr);
+  }
+
+  // The caller must have successfully TryAcquireAllChunksForReading() or it
+  // needs to guarantee that the chunk is already in the kChunkBeingWritten
+  // state.
+  Chunk GetChunkUnchecked(size_t page_idx,
+                          uint32_t page_layout,
+                          size_t chunk_idx);
+
+  // Puts a chunk into the kChunkComplete state. Returns the page index.
+  size_t ReleaseChunkAsComplete(Chunk chunk) {
+    return ReleaseChunk(std::move(chunk), kChunkComplete);
+  }
+
+  // Puts a chunk into the kChunkFree state. Returns the page index.
+  size_t ReleaseChunkAsFree(Chunk chunk) {
+    return ReleaseChunk(std::move(chunk), kChunkFree);
+  }
+
+  ChunkState GetChunkState(size_t page_idx, size_t chunk_idx) {
+    PageHeader* phdr = page_header(page_idx);
+    uint32_t layout = phdr->layout.load(std::memory_order_relaxed);
+    return GetChunkStateFromLayout(layout, chunk_idx);
+  }
+
+  std::pair<size_t, size_t> GetPageAndChunkIndex(const Chunk& chunk);
+
+  uint16_t GetChunkSizeForLayout(uint32_t page_layout) const {
+    return chunk_sizes_[(page_layout & kLayoutMask) >> kLayoutShift];
+  }
+
+  static ChunkState GetChunkStateFromLayout(uint32_t page_layout,
+                                            size_t chunk_idx) {
+    return static_cast<ChunkState>((page_layout >> (chunk_idx * kChunkShift)) &
+                                   kChunkMask);
+  }
+
+  static constexpr uint32_t GetNumChunksForLayout(uint32_t page_layout) {
+    return kNumChunksForLayout[(page_layout & kLayoutMask) >> kLayoutShift];
+  }
+
+  // Returns a bitmap in which each bit is set if the corresponding Chunk exists
+  // in the page (according to the page layout) and is not free. If the page is
+  // not partitioned it returns 0 (as if the page had no used chunks). Bit N
+  // corresponds to Chunk N.
+  static uint32_t GetUsedChunks(uint32_t page_layout) {
+    const uint32_t num_chunks = GetNumChunksForLayout(page_layout);
+    uint32_t res = 0;
+    for (uint32_t i = 0; i < num_chunks; i++) {
+      res |= ((page_layout & kChunkMask) != kChunkFree) ? (1 << i) : 0;
+      page_layout >>= kChunkShift;
+    }
+    return res;
+  }
+
+ private:
+  SharedMemoryABI(const SharedMemoryABI&) = delete;
+  SharedMemoryABI& operator=(const SharedMemoryABI&) = delete;
+
+  Chunk TryAcquireChunk(size_t page_idx,
+                        size_t chunk_idx,
+                        ChunkState,
+                        const ChunkHeader*);
+  size_t ReleaseChunk(Chunk chunk, ChunkState);
+
+  uint8_t* start_ = nullptr;
+  size_t size_ = 0;
+  size_t page_size_ = 0;
+  size_t num_pages_ = 0;
+  std::array<uint16_t, kNumPageLayouts> chunk_sizes_;
+};
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_TRACING_CORE_SHARED_MEMORY_ABI_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an "AS
+ * IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
+ */
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/shared_memory_abi.h"
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+// gen_amalgamated expanded: #include "perfetto/base/time.h"
+
+#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+#include <sys/mman.h>
+#endif
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/basic_types.h"
+
+namespace perfetto {
+
+namespace {
+
+constexpr int kRetryAttempts = 64;
+
+inline void WaitBeforeNextAttempt(int attempt) {
+  if (attempt < kRetryAttempts / 2) {
+    std::this_thread::yield();
+  } else {
+    base::SleepMicroseconds((unsigned(attempt) / 10) * 1000);
+  }
+}
+
+// Returns the largest 4-bytes aligned chunk size <= |page_size| / |divider|
+// for each divider in PageLayout.
+constexpr size_t GetChunkSize(size_t page_size, size_t divider) {
+  return ((page_size - sizeof(SharedMemoryABI::PageHeader)) / divider) & ~3UL;
+}
+
+// Initializer for the const |chunk_sizes_| array.
+std::array<uint16_t, SharedMemoryABI::kNumPageLayouts> InitChunkSizes(
+    size_t page_size) {
+  static_assert(SharedMemoryABI::kNumPageLayouts ==
+                    base::ArraySize(SharedMemoryABI::kNumChunksForLayout),
+                "kNumPageLayouts out of date");
+  std::array<uint16_t, SharedMemoryABI::kNumPageLayouts> res = {};
+  for (size_t i = 0; i < SharedMemoryABI::kNumPageLayouts; i++) {
+    size_t num_chunks = SharedMemoryABI::kNumChunksForLayout[i];
+    size_t size = num_chunks == 0 ? 0 : GetChunkSize(page_size, num_chunks);
+    PERFETTO_CHECK(size <= std::numeric_limits<uint16_t>::max());
+    res[i] = static_cast<uint16_t>(size);
+  }
+  return res;
+}
+
+inline void ClearChunkHeader(SharedMemoryABI::ChunkHeader* header) {
+  header->writer_id.store(0u, std::memory_order_relaxed);
+  header->chunk_id.store(0u, std::memory_order_relaxed);
+  header->packets.store({}, std::memory_order_release);
+}
+
+}  // namespace
+
+// static
+constexpr uint32_t SharedMemoryABI::kNumChunksForLayout[];
+constexpr const char* SharedMemoryABI::kChunkStateStr[];
+constexpr const size_t SharedMemoryABI::kInvalidPageIdx;
+constexpr const size_t SharedMemoryABI::kMinPageSize;
+constexpr const size_t SharedMemoryABI::kMaxPageSize;
+constexpr const size_t SharedMemoryABI::kPacketSizeDropPacket;
+
+SharedMemoryABI::SharedMemoryABI() = default;
+
+SharedMemoryABI::SharedMemoryABI(uint8_t* start,
+                                 size_t size,
+                                 size_t page_size) {
+  Initialize(start, size, page_size);
+}
+
+void SharedMemoryABI::Initialize(uint8_t* start,
+                                 size_t size,
+                                 size_t page_size) {
+  start_ = start;
+  size_ = size;
+  page_size_ = page_size;
+  num_pages_ = size / page_size;
+  chunk_sizes_ = InitChunkSizes(page_size);
+  static_assert(sizeof(PageHeader) == 8, "PageHeader size");
+  static_assert(sizeof(ChunkHeader) == 8, "ChunkHeader size");
+  static_assert(sizeof(ChunkHeader::chunk_id) == sizeof(ChunkID),
+                "ChunkID size");
+
+  static_assert(sizeof(ChunkHeader::Packets) == 2, "ChunkHeader::Packets size");
+  static_assert(alignof(ChunkHeader) == kChunkAlignment,
+                "ChunkHeader alignment");
+
+  // In theory std::atomic does not guarantee that the underlying type
+  // consists only of the actual atomic word. Theoretically it could have
+  // locks or other state. In practice most implementations just implement
+  // them without extra state. The code below overlays the atomic into the
+  // SMB, hence relies on this implementation detail. This should be fine
+  // pragmatically (Chrome's base makes the same assumption), but let's have a
+  // check for this.
+  static_assert(sizeof(std::atomic<uint32_t>) == sizeof(uint32_t) &&
+                    sizeof(std::atomic<uint16_t>) == sizeof(uint16_t),
+                "Incompatible STL <atomic> implementation");
+
+  // Chec that the kAllChunks(Complete,Free) are consistent with the
+  // ChunkState enum values.
+
+  // These must be zero because rely on zero-initialized memory being
+  // interpreted as "free".
+  static_assert(kChunkFree == 0 && kAllChunksFree == 0,
+                "kChunkFree/kAllChunksFree and must be 0");
+
+  static_assert((kAllChunksComplete & kChunkMask) == kChunkComplete,
+                "kAllChunksComplete out of sync with kChunkComplete");
+
+  // Check the consistency of the kMax... constants.
+  static_assert(sizeof(ChunkHeader::writer_id) == sizeof(WriterID),
+                "WriterID size");
+  ChunkHeader chunk_header{};
+  chunk_header.chunk_id.store(static_cast<uint32_t>(-1));
+  PERFETTO_CHECK(chunk_header.chunk_id.load() == kMaxChunkID);
+
+  chunk_header.writer_id.store(static_cast<uint16_t>(-1));
+  PERFETTO_CHECK(kMaxWriterID <= chunk_header.writer_id.load());
+
+  PERFETTO_CHECK(page_size >= kMinPageSize);
+  PERFETTO_CHECK(page_size <= kMaxPageSize);
+  PERFETTO_CHECK(page_size % kMinPageSize == 0);
+  PERFETTO_CHECK(reinterpret_cast<uintptr_t>(start) % kMinPageSize == 0);
+  PERFETTO_CHECK(size % page_size == 0);
+}
+
+SharedMemoryABI::Chunk SharedMemoryABI::GetChunkUnchecked(size_t page_idx,
+                                                          uint32_t page_layout,
+                                                          size_t chunk_idx) {
+  const size_t num_chunks = GetNumChunksForLayout(page_layout);
+  PERFETTO_DCHECK(chunk_idx < num_chunks);
+  // Compute the chunk virtual address and write it into |chunk|.
+  const uint16_t chunk_size = GetChunkSizeForLayout(page_layout);
+  size_t chunk_offset_in_page = sizeof(PageHeader) + chunk_idx * chunk_size;
+
+  Chunk chunk(page_start(page_idx) + chunk_offset_in_page, chunk_size,
+              static_cast<uint8_t>(chunk_idx));
+  PERFETTO_DCHECK(chunk.end() <= end());
+  return chunk;
+}
+
+SharedMemoryABI::Chunk SharedMemoryABI::TryAcquireChunk(
+    size_t page_idx,
+    size_t chunk_idx,
+    ChunkState desired_chunk_state,
+    const ChunkHeader* header) {
+  PERFETTO_DCHECK(desired_chunk_state == kChunkBeingRead ||
+                  desired_chunk_state == kChunkBeingWritten);
+  PageHeader* phdr = page_header(page_idx);
+  for (int attempt = 0; attempt < kRetryAttempts; attempt++) {
+    uint32_t layout = phdr->layout.load(std::memory_order_acquire);
+    const size_t num_chunks = GetNumChunksForLayout(layout);
+
+    // The page layout has changed (or the page is free).
+    if (chunk_idx >= num_chunks)
+      return Chunk();
+
+    // Verify that the chunk is still in a state that allows the transition to
+    // |desired_chunk_state|. The only allowed transitions are:
+    // 1. kChunkFree -> kChunkBeingWritten (Producer).
+    // 2. kChunkComplete -> kChunkBeingRead (Service).
+    ChunkState expected_chunk_state =
+        desired_chunk_state == kChunkBeingWritten ? kChunkFree : kChunkComplete;
+    auto cur_chunk_state = (layout >> (chunk_idx * kChunkShift)) & kChunkMask;
+    if (cur_chunk_state != expected_chunk_state)
+      return Chunk();
+
+    uint32_t next_layout = layout;
+    next_layout &= ~(kChunkMask << (chunk_idx * kChunkShift));
+    next_layout |= (desired_chunk_state << (chunk_idx * kChunkShift));
+    if (phdr->layout.compare_exchange_strong(layout, next_layout,
+                                             std::memory_order_acq_rel)) {
+      // Compute the chunk virtual address and write it into |chunk|.
+      Chunk chunk = GetChunkUnchecked(page_idx, layout, chunk_idx);
+      if (desired_chunk_state == kChunkBeingWritten) {
+        PERFETTO_DCHECK(header);
+        ChunkHeader* new_header = chunk.header();
+        new_header->writer_id.store(header->writer_id,
+                                    std::memory_order_relaxed);
+        new_header->chunk_id.store(header->chunk_id, std::memory_order_relaxed);
+        new_header->packets.store(header->packets, std::memory_order_release);
+      }
+      return chunk;
+    }
+    WaitBeforeNextAttempt(attempt);
+  }
+  return Chunk();  // All our attempts failed.
+}
+
+bool SharedMemoryABI::TryPartitionPage(size_t page_idx, PageLayout layout) {
+  PERFETTO_DCHECK(layout >= kPageDiv1 && layout <= kPageDiv14);
+  uint32_t expected_layout = 0;  // Free page.
+  uint32_t next_layout = (layout << kLayoutShift) & kLayoutMask;
+  PageHeader* phdr = page_header(page_idx);
+  if (!phdr->layout.compare_exchange_strong(expected_layout, next_layout,
+                                            std::memory_order_acq_rel)) {
+    return false;
+  }
+  return true;
+}
+
+uint32_t SharedMemoryABI::GetFreeChunks(size_t page_idx) {
+  uint32_t layout =
+      page_header(page_idx)->layout.load(std::memory_order_relaxed);
+  const uint32_t num_chunks = GetNumChunksForLayout(layout);
+  uint32_t res = 0;
+  for (uint32_t i = 0; i < num_chunks; i++) {
+    res |= ((layout & kChunkMask) == kChunkFree) ? (1 << i) : 0;
+    layout >>= kChunkShift;
+  }
+  return res;
+}
+
+size_t SharedMemoryABI::ReleaseChunk(Chunk chunk,
+                                     ChunkState desired_chunk_state) {
+  PERFETTO_DCHECK(desired_chunk_state == kChunkComplete ||
+                  desired_chunk_state == kChunkFree);
+
+  size_t page_idx;
+  size_t chunk_idx;
+  std::tie(page_idx, chunk_idx) = GetPageAndChunkIndex(chunk);
+
+  // Reset header fields, so that the service can identify when the chunk's
+  // header has been initialized by the producer.
+  if (desired_chunk_state == kChunkFree)
+    ClearChunkHeader(chunk.header());
+
+  for (int attempt = 0; attempt < kRetryAttempts; attempt++) {
+    PageHeader* phdr = page_header(page_idx);
+    uint32_t layout = phdr->layout.load(std::memory_order_relaxed);
+    const size_t page_chunk_size = GetChunkSizeForLayout(layout);
+
+    // TODO(primiano): this should not be a CHECK, because a malicious producer
+    // could crash us by putting the chunk in an invalid state. This should
+    // gracefully fail. Keep a CHECK until then.
+    PERFETTO_CHECK(chunk.size() == page_chunk_size);
+    const uint32_t chunk_state =
+        ((layout >> (chunk_idx * kChunkShift)) & kChunkMask);
+
+    // Verify that the chunk is still in a state that allows the transition to
+    // |desired_chunk_state|. The only allowed transitions are:
+    // 1. kChunkBeingWritten -> kChunkComplete (Producer).
+    // 2. kChunkBeingRead -> kChunkFree (Service).
+    ChunkState expected_chunk_state;
+    if (desired_chunk_state == kChunkComplete) {
+      expected_chunk_state = kChunkBeingWritten;
+    } else {
+      expected_chunk_state = kChunkBeingRead;
+    }
+
+    // TODO(primiano): should not be a CHECK (same rationale of comment above).
+    PERFETTO_CHECK(chunk_state == expected_chunk_state);
+    uint32_t next_layout = layout;
+    next_layout &= ~(kChunkMask << (chunk_idx * kChunkShift));
+    next_layout |= (desired_chunk_state << (chunk_idx * kChunkShift));
+
+    // If we are freeing a chunk and all the other chunks in the page are free
+    // we should de-partition the page and mark it as clear.
+    if ((next_layout & kAllChunksMask) == kAllChunksFree)
+      next_layout = 0;
+
+    if (phdr->layout.compare_exchange_strong(layout, next_layout,
+                                             std::memory_order_acq_rel)) {
+      return page_idx;
+    }
+    WaitBeforeNextAttempt(attempt);
+  }
+  // Too much contention on this page. Give up. This page will be left pending
+  // forever but there isn't much more we can do at this point.
+  PERFETTO_DFATAL("Too much contention on page.");
+  return kInvalidPageIdx;
+}
+
+SharedMemoryABI::Chunk::Chunk() = default;
+
+SharedMemoryABI::Chunk::Chunk(uint8_t* begin, uint16_t size, uint8_t chunk_idx)
+    : begin_(begin), size_(size), chunk_idx_(chunk_idx) {
+  PERFETTO_CHECK(reinterpret_cast<uintptr_t>(begin) % kChunkAlignment == 0);
+  PERFETTO_CHECK(size > 0);
+}
+
+SharedMemoryABI::Chunk::Chunk(Chunk&& o) noexcept {
+  *this = std::move(o);
+}
+
+SharedMemoryABI::Chunk& SharedMemoryABI::Chunk::operator=(Chunk&& o) {
+  begin_ = o.begin_;
+  size_ = o.size_;
+  chunk_idx_ = o.chunk_idx_;
+  o.begin_ = nullptr;
+  o.size_ = 0;
+  o.chunk_idx_ = 0;
+  return *this;
+}
+
+std::pair<size_t, size_t> SharedMemoryABI::GetPageAndChunkIndex(
+    const Chunk& chunk) {
+  PERFETTO_DCHECK(chunk.is_valid());
+  PERFETTO_DCHECK(chunk.begin() >= start_);
+  PERFETTO_DCHECK(chunk.end() <= start_ + size_);
+
+  // TODO(primiano): The divisions below could be avoided if we cached
+  // |page_shift_|.
+  const uintptr_t rel_addr = static_cast<uintptr_t>(chunk.begin() - start_);
+  const size_t page_idx = rel_addr / page_size_;
+  const size_t offset = rel_addr % page_size_;
+  PERFETTO_DCHECK(offset >= sizeof(PageHeader));
+  PERFETTO_DCHECK(offset % kChunkAlignment == 0);
+  PERFETTO_DCHECK((offset - sizeof(PageHeader)) % chunk.size() == 0);
+  const size_t chunk_idx = (offset - sizeof(PageHeader)) / chunk.size();
+  PERFETTO_DCHECK(chunk_idx < kMaxChunksPerPage);
+  PERFETTO_DCHECK(chunk_idx < GetNumChunksForLayout(GetPageLayout(page_idx)));
+  return std::make_pair(page_idx, chunk_idx);
+}
+
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/core/shared_memory_arbiter_impl.cc
+// gen_amalgamated begin header: src/tracing/core/shared_memory_arbiter_impl.h
+// gen_amalgamated begin header: include/perfetto/ext/tracing/core/shared_memory_arbiter.h
+// gen_amalgamated begin header: include/perfetto/ext/tracing/core/tracing_service.h
+// gen_amalgamated begin header: include/perfetto/ext/tracing/core/shared_memory.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_TRACING_CORE_SHARED_MEMORY_H_
+#define INCLUDE_PERFETTO_EXT_TRACING_CORE_SHARED_MEMORY_H_
+
+#include <stddef.h>
+
+#include <memory>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/base/platform_handle.h"
+
+namespace perfetto {
+
+// An abstract interface that models the shared memory region shared between
+// Service and Producer. The concrete implementation of this is up to the
+// transport layer. This can be as simple as a malloc()-ed buffer, if both
+// Producer and Service are hosted in the same process, or some posix shared
+// memory for the out-of-process case (see src/unix_rpc).
+// Both this class and the Factory are subclassed by the transport layer, which
+// will attach platform specific fields to it (e.g., a unix file descriptor).
+class PERFETTO_EXPORT SharedMemory {
+ public:
+  class PERFETTO_EXPORT Factory {
+   public:
+    virtual ~Factory();
+    virtual std::unique_ptr<SharedMemory> CreateSharedMemory(size_t) = 0;
+  };
+
+  // The transport layer is expected to tear down the resource associated to
+  // this object region when destroyed.
+  virtual ~SharedMemory();
+
+  virtual void* start() const = 0;
+  virtual size_t size() const = 0;
+};
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_TRACING_CORE_SHARED_MEMORY_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_TRACING_CORE_TRACING_SERVICE_H_
+#define INCLUDE_PERFETTO_EXT_TRACING_CORE_TRACING_SERVICE_H_
+
+#include <stdint.h>
+
+#include <functional>
+#include <memory>
+#include <vector>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/scoped_file.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/basic_types.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/shared_memory.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/buffer_exhausted_policy.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/forward_decls.h"
+
+namespace perfetto {
+
+namespace base {
+class TaskRunner;
+}  // namespace base
+
+class Consumer;
+class Producer;
+class SharedMemoryArbiter;
+class TraceWriter;
+
+// Exposed for testing.
+std::string GetBugreportPath();
+
+// TODO: for the moment this assumes that all the calls happen on the same
+// thread/sequence. Not sure this will be the case long term in Chrome.
+
+// The API for the Producer port of the Service.
+// Subclassed by:
+// 1. The tracing_service_impl.cc business logic when returning it in response
+//    to the ConnectProducer() method.
+// 2. The transport layer (e.g., src/ipc) when the producer and
+//    the service don't talk locally but via some IPC mechanism.
+class PERFETTO_EXPORT ProducerEndpoint {
+ public:
+  virtual ~ProducerEndpoint();
+
+  // Called by the Producer to (un)register data sources. Data sources are
+  // identified by their name (i.e. DataSourceDescriptor.name)
+  virtual void RegisterDataSource(const DataSourceDescriptor&) = 0;
+  virtual void UnregisterDataSource(const std::string& name) = 0;
+
+  // Associate the trace writer with the given |writer_id| with
+  // |target_buffer|. The service may use this information to retrieve and
+  // copy uncommitted chunks written by the trace writer into its associated
+  // buffer, e.g. when a producer process crashes or when a flush is
+  // necessary.
+  virtual void RegisterTraceWriter(uint32_t writer_id,
+                                   uint32_t target_buffer) = 0;
+
+  // Remove the association of the trace writer previously created via
+  // RegisterTraceWriter.
+  virtual void UnregisterTraceWriter(uint32_t writer_id) = 0;
+
+  // Called by the Producer to signal that some pages in the shared memory
+  // buffer (shared between Service and Producer) have changed.
+  // When the Producer and the Service are hosted in the same process and
+  // hence potentially live on the same task runner, This method must call
+  // TracingServiceImpl's CommitData synchronously, without any PostTask()s,
+  // if on the same thread. This is to avoid a deadlock where the Producer
+  // exhausts its SMB and stalls waiting for the service to catch up with
+  // reads, but the Service never gets to that because it lives on the same
+  // thread.
+  using CommitDataCallback = std::function<void()>;
+  virtual void CommitData(const CommitDataRequest&,
+                          CommitDataCallback callback = {}) = 0;
+
+  virtual SharedMemory* shared_memory() const = 0;
+
+  // Size of shared memory buffer pages. It's always a multiple of 4K.
+  // See shared_memory_abi.h
+  virtual size_t shared_buffer_page_size_kb() const = 0;
+
+  // Creates a trace writer, which allows to create events, handling the
+  // underying shared memory buffer and signalling to the Service. This method
+  // is thread-safe but the returned object is not. A TraceWriter should be
+  // used only from a single thread, or the caller has to handle sequencing
+  // via a mutex or equivalent. This method can only be called if
+  // TracingService::ConnectProducer was called with |in_process=true|.
+  // Args:
+  // |target_buffer| is the target buffer ID where the data produced by the
+  // writer should be stored by the tracing service. This value is passed
+  // upon creation of the data source (StartDataSource()) in the
+  // DataSourceConfig.target_buffer().
+  virtual std::unique_ptr<TraceWriter> CreateTraceWriter(
+      BufferID target_buffer,
+      BufferExhaustedPolicy buffer_exhausted_policy =
+          BufferExhaustedPolicy::kDefault) = 0;
+
+  // TODO(eseckler): Also expose CreateStartupTraceWriter() ?
+
+  // In some cases you can access the producer's SharedMemoryArbiter (for
+  // example if TracingService::ConnectProducer is called with
+  // |in_process=true|). The SharedMemoryArbiter can be used to create
+  // TraceWriters which is able to directly commit chunks. For the
+  // |in_process=true| case this can be done without going through an IPC layer.
+  virtual SharedMemoryArbiter* MaybeSharedMemoryArbiter() = 0;
+
+  // Whether the service accepted a shared memory buffer provided by the
+  // producer.
+  virtual bool IsShmemProvidedByProducer() const = 0;
+
+  // Called in response to a Producer::Flush(request_id) call after all data
+  // for the flush request has been committed.
+  virtual void NotifyFlushComplete(FlushRequestID) = 0;
+
+  // Called in response to one or more Producer::StartDataSource(),
+  // if the data source registered setting the flag
+  // DataSourceDescriptor.will_notify_on_start.
+  virtual void NotifyDataSourceStarted(DataSourceInstanceID) = 0;
+
+  // Called in response to one or more Producer::StopDataSource(),
+  // if the data source registered setting the flag
+  // DataSourceDescriptor.will_notify_on_stop.
+  virtual void NotifyDataSourceStopped(DataSourceInstanceID) = 0;
+
+  // This informs the service to activate any of these triggers if any tracing
+  // session was waiting for them.
+  virtual void ActivateTriggers(const std::vector<std::string>&) = 0;
+
+  // Emits a synchronization barrier to linearize with the service. When
+  // |callback| is invoked, the caller has the guarantee that the service has
+  // seen and processed all the requests sent by this producer prior to the
+  // Sync() call. Used mainly in tests.
+  virtual void Sync(std::function<void()> callback) = 0;
+};  // class ProducerEndpoint.
+
+// The API for the Consumer port of the Service.
+// Subclassed by:
+// 1. The tracing_service_impl.cc business logic when returning it in response
+// to
+//    the ConnectConsumer() method.
+// 2. The transport layer (e.g., src/ipc) when the consumer and
+//    the service don't talk locally but via some IPC mechanism.
+class PERFETTO_EXPORT ConsumerEndpoint {
+ public:
+  virtual ~ConsumerEndpoint();
+
+  // Enables tracing with the given TraceConfig. The ScopedFile argument is
+  // used only when TraceConfig.write_into_file == true.
+  // If TraceConfig.deferred_start == true data sources are configured via
+  // SetupDataSource() but are not started until StartTracing() is called.
+  // This is to support pre-initialization and fast triggering of traces.
+  // The ScopedFile argument is used only when TraceConfig.write_into_file
+  // == true.
+  virtual void EnableTracing(const TraceConfig&,
+                             base::ScopedFile = base::ScopedFile()) = 0;
+
+  // Update the trace config of an existing tracing session; only a subset
+  // of options can be changed mid-session. Currently the only
+  // supported functionality is expanding the list of producer_name_filters()
+  // (or removing the filter entirely) for existing data sources.
+  virtual void ChangeTraceConfig(const TraceConfig&) = 0;
+
+  // Starts all data sources configured in the trace config. This is used only
+  // after calling EnableTracing() with TraceConfig.deferred_start=true.
+  // It's a no-op if called after a regular EnableTracing(), without setting
+  // deferred_start.
+  virtual void StartTracing() = 0;
+
+  virtual void DisableTracing() = 0;
+
+  // Requests all data sources to flush their data immediately and invokes the
+  // passed callback once all of them have acked the flush (in which case
+  // the callback argument |success| will be true) or |timeout_ms| are elapsed
+  // (in which case |success| will be false).
+  // If |timeout_ms| is 0 the TraceConfig's flush_timeout_ms is used, or,
+  // if that one is not set (or is set to 0), kDefaultFlushTimeoutMs (5s) is
+  // used.
+  using FlushCallback = std::function<void(bool /*success*/)>;
+  virtual void Flush(uint32_t timeout_ms, FlushCallback) = 0;
+
+  // Tracing data will be delivered invoking Consumer::OnTraceData().
+  virtual void ReadBuffers() = 0;
+
+  virtual void FreeBuffers() = 0;
+
+  // Will call OnDetach().
+  virtual void Detach(const std::string& key) = 0;
+
+  // Will call OnAttach().
+  virtual void Attach(const std::string& key) = 0;
+
+  // Will call OnTraceStats().
+  virtual void GetTraceStats() = 0;
+
+  // Start or stop observing events of selected types. |events_mask| specifies
+  // the types of events to observe in a bitmask of ObservableEvents::Type.
+  // To disable observing, pass 0.
+  // Will call OnObservableEvents() repeatedly whenever an event of an enabled
+  // ObservableEventType occurs.
+  // TODO(eseckler): Extend this to support producers & data sources.
+  virtual void ObserveEvents(uint32_t events_mask) = 0;
+
+  // Used to obtain the list of connected data sources and other info about
+  // the tracing service.
+  using QueryServiceStateCallback =
+      std::function<void(bool success, const TracingServiceState&)>;
+  virtual void QueryServiceState(QueryServiceStateCallback) = 0;
+
+  // Used for feature detection. Makes sense only when the consumer and the
+  // service talk over IPC and can be from different versions.
+  using QueryCapabilitiesCallback =
+      std::function<void(const TracingServiceCapabilities&)>;
+  virtual void QueryCapabilities(QueryCapabilitiesCallback) = 0;
+
+  // If any tracing session with TraceConfig.bugreport_score > 0 is running,
+  // this will pick the highest-score one, stop it and save it into a fixed
+  // path (See kBugreportTracePath).
+  // The callback is invoked when the file has been saved, in case of success,
+  // or whenever an error occurs.
+  // Args:
+  // - success: if true, an eligible trace was found and saved into file.
+  //            If false, either there was no eligible trace running or
+  //            something else failed (See |msg|).
+  // - msg: human readable diagnostic messages to debug failures.
+  using SaveTraceForBugreportCallback =
+      std::function<void(bool /*success*/, const std::string& /*msg*/)>;
+  virtual void SaveTraceForBugreport(SaveTraceForBugreportCallback) = 0;
+};  // class ConsumerEndpoint.
+
+// The public API of the tracing Service business logic.
+//
+// Exposed to:
+// 1. The transport layer (e.g., src/unix_rpc/unix_service_host.cc),
+//    which forwards commands received from a remote producer or consumer to
+//    the actual service implementation.
+// 2. Tests.
+//
+// Subclassed by:
+//   The service business logic in src/core/tracing_service_impl.cc.
+class PERFETTO_EXPORT TracingService {
+ public:
+  using ProducerEndpoint = perfetto::ProducerEndpoint;
+  using ConsumerEndpoint = perfetto::ConsumerEndpoint;
+
+  enum class ProducerSMBScrapingMode {
+    // Use service's default setting for SMB scraping. Currently, the default
+    // mode is to disable SMB scraping, but this may change in the future.
+    kDefault,
+
+    // Enable scraping of uncommitted chunks in producers' shared memory
+    // buffers.
+    kEnabled,
+
+    // Disable scraping of uncommitted chunks in producers' shared memory
+    // buffers.
+    kDisabled
+  };
+
+  // Implemented in src/core/tracing_service_impl.cc .
+  static std::unique_ptr<TracingService> CreateInstance(
+      std::unique_ptr<SharedMemory::Factory>,
+      base::TaskRunner*);
+
+  virtual ~TracingService();
+
+  // Connects a Producer instance and obtains a ProducerEndpoint, which is
+  // essentially a 1:1 channel between one Producer and the Service.
+  //
+  // The caller has to guarantee that the passed Producer will be alive as long
+  // as the returned ProducerEndpoint is alive. Both the passed Producer and the
+  // returned ProducerEndpoint must live on the same task runner of the service,
+  // specifically:
+  // 1) The Service will call Producer::* methods on the Service's task runner.
+  // 2) The Producer should call ProducerEndpoint::* methods only on the
+  //    service's task runner, except for ProducerEndpoint::CreateTraceWriter(),
+  //    which can be called on any thread. To disconnect just destroy the
+  //    returned ProducerEndpoint object. It is safe to destroy the Producer
+  //    once the Producer::OnDisconnect() has been invoked.
+  //
+  // |uid| is the trusted user id of the producer process, used by the consumers
+  // for validating the origin of trace data. |shared_memory_size_hint_bytes|
+  // and |shared_memory_page_size_hint_bytes| are optional hints on the size of
+  // the shared memory buffer and its pages. The service can ignore the hints
+  // (e.g., if the hints are unreasonably large or other sizes were configured
+  // in a tracing session's config). |in_process| enables the ProducerEndpoint
+  // to manage its own shared memory and enables use of
+  // |ProducerEndpoint::CreateTraceWriter|.
+  //
+  // The producer can optionally provide a non-null |shm|, which the service
+  // will adopt for the connection to the producer, provided it is correctly
+  // sized. In this case, |shared_memory_page_size_hint_bytes| indicates the
+  // page size used in this SMB. The producer can use this mechanism to record
+  // tracing data to an SMB even before the tracing session is started by the
+  // service. This is used in Chrome to implement startup tracing. If the buffer
+  // is incorrectly sized, the service will discard the SMB and allocate a new
+  // one, provided to the producer via ProducerEndpoint::shared_memory() after
+  // OnTracingSetup(). To verify that the service accepted the SMB, the producer
+  // may check via ProducerEndpoint::IsShmemProvidedByProducer(). If the service
+  // accepted the SMB, the producer can then commit any data that is already in
+  // the SMB after the tracing session was started by the service via
+  // Producer::StartDataSource(). The |shm| will also be rejected when
+  // connecting to a service that is too old (pre Android-11).
+  //
+  // Can return null in the unlikely event that service has too many producers
+  // connected.
+  virtual std::unique_ptr<ProducerEndpoint> ConnectProducer(
+      Producer*,
+      uid_t uid,
+      const std::string& name,
+      size_t shared_memory_size_hint_bytes = 0,
+      bool in_process = false,
+      ProducerSMBScrapingMode smb_scraping_mode =
+          ProducerSMBScrapingMode::kDefault,
+      size_t shared_memory_page_size_hint_bytes = 0,
+      std::unique_ptr<SharedMemory> shm = nullptr,
+      const std::string& sdk_version = {}) = 0;
+
+  // Connects a Consumer instance and obtains a ConsumerEndpoint, which is
+  // essentially a 1:1 channel between one Consumer and the Service.
+  // The caller has to guarantee that the passed Consumer will be alive as long
+  // as the returned ConsumerEndpoint is alive.
+  // To disconnect just destroy the returned ConsumerEndpoint object. It is safe
+  // to destroy the Consumer once the Consumer::OnDisconnect() has been invoked.
+  virtual std::unique_ptr<ConsumerEndpoint> ConnectConsumer(Consumer*,
+                                                            uid_t) = 0;
+
+  // Enable/disable scraping of chunks in the shared memory buffer. If enabled,
+  // the service will copy uncommitted but non-empty chunks from the SMB when
+  // flushing (e.g. to handle unresponsive producers or producers unable to
+  // flush their active chunks), on producer disconnect (e.g. to recover data
+  // from crashed producers), and after disabling a tracing session (e.g. to
+  // gather data from producers that didn't stop their data sources in time).
+  //
+  // This feature is currently used by Chrome.
+  virtual void SetSMBScrapingEnabled(bool enabled) = 0;
+};
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_TRACING_CORE_TRACING_SERVICE_H_
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_TRACING_CORE_SHARED_MEMORY_ARBITER_H_
+#define INCLUDE_PERFETTO_EXT_TRACING_CORE_SHARED_MEMORY_ARBITER_H_
+
+#include <stddef.h>
+
+#include <functional>
+#include <memory>
+#include <vector>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/basic_types.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/tracing_service.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/buffer_exhausted_policy.h"
+
+namespace perfetto {
+
+namespace base {
+class TaskRunner;
+}
+
+class SharedMemory;
+class TraceWriter;
+
+// Used by the Producer-side of the transport layer to vend TraceWriters
+// from the SharedMemory it receives from the Service-side.
+class PERFETTO_EXPORT SharedMemoryArbiter {
+ public:
+  virtual ~SharedMemoryArbiter();
+
+  // Creates a new TraceWriter and assigns it a new WriterID. The WriterID is
+  // written in each chunk header owned by a given TraceWriter and is used by
+  // the Service to reconstruct TracePackets written by the same TraceWriter.
+  // Returns null impl of TraceWriter if all WriterID slots are exhausted. The
+  // writer will commit to the provided |target_buffer|. If the arbiter was
+  // created via CreateUnbound(), only BufferExhaustedPolicy::kDrop is
+  // supported.
+  virtual std::unique_ptr<TraceWriter> CreateTraceWriter(
+      BufferID target_buffer,
+      BufferExhaustedPolicy buffer_exhausted_policy =
+          BufferExhaustedPolicy::kDefault) = 0;
+
+  // Creates a TraceWriter that will commit to the target buffer with the given
+  // reservation ID (creating a new reservation for this ID if none exists yet).
+  // The buffer reservation should be bound to an actual BufferID via
+  // BindStartupTargetBuffer() once the actual BufferID is known. Only supported
+  // if the arbiter was created using CreateUnbound(), and may be called while
+  // the arbiter is unbound.
+  //
+  // While any unbound buffer reservation exists, all commits will be buffered
+  // until all reservations were bound. Thus, until all reservations are bound,
+  // the data written to the SMB will not be consumed by the service - the SMB
+  // size should be chosen with this in mind. Startup writers always use
+  // BufferExhaustedPolicy::kDrop, as we cannot feasibly stall while not
+  // flushing to the service.
+  //
+  // The |target_buffer_reservation_id| should be greater than 0 but can
+  // otherwise be freely chosen by the producer and is only used to translate
+  // packets into the actual buffer id once
+  // BindStartupTargetBuffer(reservation_id) is called. For example, Chrome uses
+  // startup tracing not only for the first, but also subsequent tracing
+  // sessions (to enable tracing in the browser process before it instructs the
+  // tracing service to start tracing asynchronously, minimizing trace data loss
+  // in the meantime), and increments the reservation ID between sessions.
+  // Similarly, if more than a single target buffer per session is required
+  // (e.g. for two different data sources), different reservation IDs should be
+  // chosen for different targets buffers.
+  virtual std::unique_ptr<TraceWriter> CreateStartupTraceWriter(
+      uint16_t target_buffer_reservation_id) = 0;
+
+  // Should only be called on unbound SharedMemoryArbiters. Binds the arbiter to
+  // the provided ProducerEndpoint and TaskRunner. Should be called only once
+  // and on the provided |TaskRunner|. Usually called by the producer (i.e., no
+  // specific data source) once it connects to the service. Both the endpoint
+  // and task runner should remain valid for the remainder of the arbiter's
+  // lifetime.
+  virtual void BindToProducerEndpoint(TracingService::ProducerEndpoint*,
+                                      base::TaskRunner*) = 0;
+
+  // Binds commits from TraceWriters created via CreateStartupTraceWriter() with
+  // the given |target_buffer_reservation_id| to |target_buffer_id|. May only be
+  // called once per |target_buffer_reservation_id|. Should be called on the
+  // arbiter's TaskRunner, and after BindToProducerEndpoint() was called.
+  // Usually, it is called by a specific data source, after it received its
+  // configuration (including the target buffer ID) from the service.
+  virtual void BindStartupTargetBuffer(uint16_t target_buffer_reservation_id,
+                                       BufferID target_buffer_id) = 0;
+
+  // Treat the reservation as resolved to an invalid buffer. Commits for this
+  // reservation will be flushed to the service ASAP. The service will free
+  // committed chunks but otherwise ignore them. The producer can call this
+  // method, for example, if connection to the tracing service failed or the
+  // session was stopped concurrently before the connection was established.
+  virtual void AbortStartupTracingForReservation(
+      uint16_t target_buffer_reservation_id) = 0;
+
+  // Notifies the service that all data for the given FlushRequestID has been
+  // committed in the shared memory buffer. Should only be called while bound.
+  virtual void NotifyFlushComplete(FlushRequestID) = 0;
+
+  // Sets the duration during which commits are batched. Args:
+  // |batch_commits_duration_ms|: The length of the period, during which commits
+  // by all trace writers are accumulated, before being sent to the service.
+  // When the period ends, all accumulated commits are flushed. On the first
+  // commit after the last flush, another delayed flush is scheduled to run in
+  // |batch_commits_duration_ms|. If an immediate flush occurs (via
+  // FlushPendingCommitDataRequests()) during a batching period, any
+  // accumulated commits up to that point will be sent to the service
+  // immediately. And when the batching period ends, the commits that occurred
+  // after the immediate flush will also be sent to the service.
+  //
+  // If the duration has already been set to a non-zero value before this method
+  // is called, and there is already a scheduled flush with the previously-set
+  // duration, the new duration will take effect after the scheduled flush
+  // occurs.
+  //
+  // If |batch_commits_duration_ms| is non-zero, batched data that hasn't been
+  // sent could be lost at the end of a tracing session. To avoid this,
+  // producers should make sure that FlushPendingCommitDataRequests is called
+  // after the last TraceWriter write and before the service has stopped
+  // listening for commits from the tracing session's data sources (i.e.
+  // data sources should stop asynchronously, see
+  // DataSourceDescriptor.will_notify_on_stop=true).
+  virtual void SetBatchCommitsDuration(uint32_t batch_commits_duration_ms) = 0;
+
+  // Called to enable direct producer-side patching of chunks that have not yet
+  // been committed to the service. The return value indicates whether direct
+  // patching was successfully enabled. It will be true if
+  // SharedMemoryArbiter::SetDirectSMBPatchingSupportedByService has been called
+  // and false otherwise.
+  virtual bool EnableDirectSMBPatching() = 0;
+
+  // When the producer and service live in separate processes, this method
+  // should be called if the producer receives an
+  // InitializeConnectionResponse.direct_smb_patching_supported set to true by
+  // the service (see producer_port.proto) .
+  //
+  // In the in-process case, the service will always support direct SMB patching
+  // and this method should always be called.
+  virtual void SetDirectSMBPatchingSupportedByService() = 0;
+
+  // Forces an immediate commit of the completed packets, without waiting for
+  // the next task or for a batching period to end. Should only be called while
+  // bound.
+  virtual void FlushPendingCommitDataRequests(
+      std::function<void()> callback = {}) = 0;
+
+  // Attempts to shut down this arbiter. This function prevents new trace
+  // writers from being created for this this arbiter, but if there are any
+  // existing trace writers, the shutdown cannot proceed and this funtion
+  // returns false. The caller should not delete the arbiter before all of its
+  // associated trace writers have been destroyed and this function returns
+  // true.
+  virtual bool TryShutdown() = 0;
+
+  // Create a bound arbiter instance. Args:
+  // |SharedMemory|: the shared memory buffer to use.
+  // |page_size|: a multiple of 4KB that defines the granularity of tracing
+  // pages. See tradeoff considerations in shared_memory_abi.h.
+  // |ProducerEndpoint|: The service's producer endpoint used e.g. to commit
+  // chunks and register trace writers.
+  // |TaskRunner|: Task runner for perfetto's main thread, which executes the
+  // OnPagesCompleteCallback and IPC calls to the |ProducerEndpoint|.
+  //
+  // Implemented in src/core/shared_memory_arbiter_impl.cc.
+  static std::unique_ptr<SharedMemoryArbiter> CreateInstance(
+      SharedMemory*,
+      size_t page_size,
+      TracingService::ProducerEndpoint*,
+      base::TaskRunner*);
+
+  // Create an unbound arbiter instance, which should later be bound to a
+  // ProducerEndpoint and TaskRunner by calling BindToProducerEndpoint(). The
+  // returned arbiter will ONLY support trace writers with
+  // BufferExhaustedPolicy::kDrop.
+  //
+  // An unbound SharedMemoryArbiter can be used to write to a producer-created
+  // SharedMemory buffer before the producer connects to the tracing service.
+  // The producer can then pass this SMB to the service when it connects (see
+  // TracingService::ConnectProducer).
+  //
+  // To trace into the SMB before the service starts the tracing session, trace
+  // writers can be obtained via CreateStartupTraceWriter() and later associated
+  // with a target buffer via BindStartupTargetBuffer(), once the target buffer
+  // is known.
+  //
+  // Implemented in src/core/shared_memory_arbiter_impl.cc. See CreateInstance()
+  // for comments about the arguments.
+  static std::unique_ptr<SharedMemoryArbiter> CreateUnboundInstance(
+      SharedMemory*,
+      size_t page_size);
+};
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_TRACING_CORE_SHARED_MEMORY_ARBITER_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SRC_TRACING_CORE_SHARED_MEMORY_ARBITER_IMPL_H_
+#define SRC_TRACING_CORE_SHARED_MEMORY_ARBITER_IMPL_H_
+
+#include <stdint.h>
+
+#include <functional>
+#include <map>
+#include <memory>
+#include <mutex>
+#include <vector>
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/weak_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/basic_types.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/shared_memory_abi.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/shared_memory_arbiter.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/forward_decls.h"
+// gen_amalgamated expanded: #include "src/tracing/core/id_allocator.h"
+
+namespace perfetto {
+
+class PatchList;
+class Patch;
+class TraceWriter;
+class TraceWriterImpl;
+
+namespace base {
+class TaskRunner;
+}  // namespace base
+
+// This class handles the shared memory buffer on the producer side. It is used
+// to obtain thread-local chunks and to partition pages from several threads.
+// There is one arbiter instance per Producer.
+// This class is thread-safe and uses locks to do so. Data sources are supposed
+// to interact with this sporadically, only when they run out of space on their
+// current thread-local chunk.
+//
+// When the arbiter is created using CreateUnboundInstance(), the following
+// state transitions are possible:
+//
+//   [ !fully_bound_, !endpoint_, 0 unbound buffer reservations ]
+//       |     |
+//       |     | CreateStartupTraceWriter(buf)
+//       |     |  buffer reservations += buf
+//       |     |
+//       |     |             ----
+//       |     |            |    | CreateStartupTraceWriter(buf)
+//       |     |            |    |  buffer reservations += buf
+//       |     V            |    V
+//       |   [ !fully_bound_, !endpoint_, >=1 unbound buffer reservations ]
+//       |                                                |
+//       |                       BindToProducerEndpoint() |
+//       |                                                |
+//       | BindToProducerEndpoint()                       |
+//       |                                                V
+//       |   [ !fully_bound_, endpoint_, >=1 unbound buffer reservations ]
+//       |   A    |    A                               |     A
+//       |   |    |    |                               |     |
+//       |   |     ----                                |     |
+//       |   |    CreateStartupTraceWriter(buf)        |     |
+//       |   |     buffer reservations += buf          |     |
+//       |   |                                         |     |
+//       |   | CreateStartupTraceWriter(buf)           |     |
+//       |   |  where buf is not yet bound             |     |
+//       |   |  buffer reservations += buf             |     | (yes)
+//       |   |                                         |     |
+//       |   |        BindStartupTargetBuffer(buf, id) |-----
+//       |   |           buffer reservations -= buf    | reservations > 0?
+//       |   |                                         |
+//       |   |                                         | (no)
+//       V   |                                         V
+//       [ fully_bound_, endpoint_, 0 unbound buffer reservations ]
+//          |    A
+//          |    | CreateStartupTraceWriter(buf)
+//          |    |  where buf is already bound
+//           ----
+class SharedMemoryArbiterImpl : public SharedMemoryArbiter {
+ public:
+  // See SharedMemoryArbiter::CreateInstance(). |start|, |size| define the
+  // boundaries of the shared memory buffer. ProducerEndpoint and TaskRunner may
+  // be |nullptr| if created unbound, see
+  // SharedMemoryArbiter::CreateUnboundInstance().
+  SharedMemoryArbiterImpl(void* start,
+                          size_t size,
+                          size_t page_size,
+                          TracingService::ProducerEndpoint*,
+                          base::TaskRunner*);
+
+  // Returns a new Chunk to write tracing data. Depending on the provided
+  // BufferExhaustedPolicy, this may return an invalid chunk if no valid free
+  // chunk could be found in the SMB.
+  SharedMemoryABI::Chunk GetNewChunk(const SharedMemoryABI::ChunkHeader&,
+                                     BufferExhaustedPolicy,
+                                     size_t size_hint = 0);
+
+  // Puts back a Chunk that has been completed and sends a request to the
+  // service to move it to the central tracing buffer. |target_buffer| is the
+  // absolute trace buffer ID where the service should move the chunk onto (the
+  // producer is just to copy back the same number received in the
+  // DataSourceConfig upon the StartDataSource() reques).
+  // PatchList is a pointer to the list of patches for previous chunks. The
+  // first patched entries will be removed from the patched list and sent over
+  // to the service in the same CommitData() IPC request.
+  void ReturnCompletedChunk(SharedMemoryABI::Chunk,
+                            MaybeUnboundBufferID target_buffer,
+                            PatchList*);
+
+  // Send a request to the service to apply completed patches from |patch_list|.
+  // |writer_id| is the ID of the TraceWriter that calls this method,
+  // |target_buffer| is the global trace buffer ID of its target buffer.
+  void SendPatches(WriterID writer_id,
+                   MaybeUnboundBufferID target_buffer,
+                   PatchList* patch_list);
+
+  SharedMemoryABI* shmem_abi_for_testing() { return &shmem_abi_; }
+
+  static void set_default_layout_for_testing(SharedMemoryABI::PageLayout l) {
+    default_page_layout = l;
+  }
+
+  // SharedMemoryArbiter implementation.
+  // See include/perfetto/tracing/core/shared_memory_arbiter.h for comments.
+  std::unique_ptr<TraceWriter> CreateTraceWriter(
+      BufferID target_buffer,
+      BufferExhaustedPolicy = BufferExhaustedPolicy::kDefault) override;
+  std::unique_ptr<TraceWriter> CreateStartupTraceWriter(
+      uint16_t target_buffer_reservation_id) override;
+  void BindToProducerEndpoint(TracingService::ProducerEndpoint*,
+                              base::TaskRunner*) override;
+  void BindStartupTargetBuffer(uint16_t target_buffer_reservation_id,
+                               BufferID target_buffer_id) override;
+  void AbortStartupTracingForReservation(
+      uint16_t target_buffer_reservation_id) override;
+  void NotifyFlushComplete(FlushRequestID) override;
+
+  void SetBatchCommitsDuration(uint32_t batch_commits_duration_ms) override;
+
+  bool EnableDirectSMBPatching() override;
+
+  void SetDirectSMBPatchingSupportedByService() override;
+
+  void FlushPendingCommitDataRequests(
+      std::function<void()> callback = {}) override;
+  bool TryShutdown() override;
+
+  base::TaskRunner* task_runner() const { return task_runner_; }
+  size_t page_size() const { return shmem_abi_.page_size(); }
+  size_t num_pages() const { return shmem_abi_.num_pages(); }
+
+  base::WeakPtr<SharedMemoryArbiterImpl> GetWeakPtr() const {
+    return weak_ptr_factory_.GetWeakPtr();
+  }
+
+ private:
+  friend class TraceWriterImpl;
+  friend class StartupTraceWriterTest;
+  friend class SharedMemoryArbiterImplTest;
+
+  struct TargetBufferReservation {
+    bool resolved = false;
+    BufferID target_buffer = kInvalidBufferId;
+  };
+
+  // Placeholder for the actual target buffer ID of a startup target buffer
+  // reservation ID in |target_buffer_reservations_|.
+  static constexpr BufferID kInvalidBufferId = 0;
+
+  static SharedMemoryABI::PageLayout default_page_layout;
+
+  SharedMemoryArbiterImpl(const SharedMemoryArbiterImpl&) = delete;
+  SharedMemoryArbiterImpl& operator=(const SharedMemoryArbiterImpl&) = delete;
+
+  void UpdateCommitDataRequest(SharedMemoryABI::Chunk chunk,
+                               WriterID writer_id,
+                               MaybeUnboundBufferID target_buffer,
+                               PatchList* patch_list);
+
+  // Search the chunks that are being batched in |commit_data_req_| for a chunk
+  // that needs patching and that matches the provided |writer_id| and
+  // |patch.chunk_id|. If found, apply |patch| to that chunk, and if
+  // |chunk_needs_more_patching| is true, clear the needs patching flag of the
+  // chunk and mark it as complete - to allow the service to read it (and other
+  // chunks after it) during scraping. Returns true if the patch was applied,
+  // false otherwise.
+  //
+  // Note: the caller must be holding |lock_| for the duration of the call.
+  bool TryDirectPatchLocked(WriterID writer_id,
+                            const Patch& patch,
+                            bool chunk_needs_more_patching);
+  std::unique_ptr<TraceWriter> CreateTraceWriterInternal(
+      MaybeUnboundBufferID target_buffer,
+      BufferExhaustedPolicy);
+
+  // Called by the TraceWriter destructor.
+  void ReleaseWriterID(WriterID);
+
+  void BindStartupTargetBufferImpl(std::unique_lock<std::mutex> scoped_lock,
+                                   uint16_t target_buffer_reservation_id,
+                                   BufferID target_buffer_id);
+
+  // If any flush callbacks were queued up while the arbiter or any target
+  // buffer reservation was unbound, this wraps the pending callbacks into a new
+  // std::function and returns it. Otherwise returns an invalid std::function.
+  std::function<void()> TakePendingFlushCallbacksLocked();
+
+  // Replace occurrences of target buffer reservation IDs in |commit_data_req_|
+  // with their respective actual BufferIDs if they were already bound. Returns
+  // true iff all occurrences were replaced.
+  bool ReplaceCommitPlaceholderBufferIdsLocked();
+
+  // Update and return |fully_bound_| based on the arbiter's |pending_writers_|
+  // state.
+  bool UpdateFullyBoundLocked();
+
+  const bool initially_bound_;
+
+  // Only accessed on |task_runner_| after the producer endpoint was bound.
+  TracingService::ProducerEndpoint* producer_endpoint_ = nullptr;
+
+  // --- Begin lock-protected members ---
+
+  std::mutex lock_;
+
+  base::TaskRunner* task_runner_ = nullptr;
+  SharedMemoryABI shmem_abi_;
+  size_t page_idx_ = 0;
+  std::unique_ptr<CommitDataRequest> commit_data_req_;
+  size_t bytes_pending_commit_ = 0;  // SUM(chunk.size() : commit_data_req_).
+  IdAllocator<WriterID> active_writer_ids_;
+  bool did_shutdown_ = false;
+
+  // Whether the arbiter itself and all startup target buffer reservations are
+  // bound. Note that this can become false again later if a new target buffer
+  // reservation is created by calling CreateStartupTraceWriter() with a new
+  // reservation id.
+  bool fully_bound_;
+
+  // IDs of writers and their assigned target buffers that should be registered
+  // with the service after the arbiter and/or their startup target buffer is
+  // bound.
+  std::map<WriterID, MaybeUnboundBufferID> pending_writers_;
+
+  // Callbacks for flush requests issued while the arbiter or a target buffer
+  // reservation was unbound.
+  std::vector<std::function<void()>> pending_flush_callbacks_;
+
+  // See SharedMemoryArbiter::SetBatchCommitsDuration.
+  uint32_t batch_commits_duration_ms_ = 0;
+
+  // See SharedMemoryArbiter::EnableDirectSMBPatching.
+  bool direct_patching_enabled_ = false;
+
+  // See SharedMemoryArbiter::SetDirectSMBPatchingSupportedByService.
+  bool direct_patching_supported_by_service_ = false;
+
+  // Indicates whether we have already scheduled a delayed flush for the
+  // purposes of batching. Set to true at the beginning of a batching period and
+  // cleared at the end of the period. Immediate flushes that happen during a
+  // batching period will empty the |commit_data_req| (triggering an immediate
+  // IPC to the service), but will not clear this flag and the
+  // previously-scheduled delayed flush will still occur at the end of the
+  // batching period.
+  bool delayed_flush_scheduled_ = false;
+
+  // Stores target buffer reservations for writers created via
+  // CreateStartupTraceWriter(). A bound reservation sets
+  // TargetBufferReservation::resolved to true and is associated with the actual
+  // BufferID supplied in BindStartupTargetBuffer().
+  //
+  // TODO(eseckler): Clean up entries from this map. This would probably require
+  // a method in SharedMemoryArbiter that allows a producer to invalidate a
+  // reservation ID.
+  std::map<MaybeUnboundBufferID, TargetBufferReservation>
+      target_buffer_reservations_;
+
+  // --- End lock-protected members ---
+
+  // Keep at the end.
+  base::WeakPtrFactory<SharedMemoryArbiterImpl> weak_ptr_factory_;
+};
+
+}  // namespace perfetto
+
+#endif  // SRC_TRACING_CORE_SHARED_MEMORY_ARBITER_IMPL_H_
+// gen_amalgamated begin header: include/perfetto/ext/tracing/core/commit_data_request.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_TRACING_CORE_COMMIT_DATA_REQUEST_H_
+#define INCLUDE_PERFETTO_EXT_TRACING_CORE_COMMIT_DATA_REQUEST_H_
+
+// Creates the aliases in the ::perfetto namespace, doing things like:
+// using ::perfetto::Foo = ::perfetto::protos::gen::Foo.
+// See comments in forward_decls.h for the historical reasons of this
+// indirection layer.
+// gen_amalgamated expanded: #include "perfetto/tracing/core/forward_decls.h"
+
+// gen_amalgamated expanded: #include "protos/perfetto/common/commit_data_request.gen.h"
+
+#endif  // INCLUDE_PERFETTO_EXT_TRACING_CORE_COMMIT_DATA_REQUEST_H_
+// gen_amalgamated begin header: src/tracing/core/trace_writer_impl.h
+// gen_amalgamated begin header: src/tracing/core/patch_list.h
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SRC_TRACING_CORE_PATCH_LIST_H_
+#define SRC_TRACING_CORE_PATCH_LIST_H_
+
+#include <array>
+#include <forward_list>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/basic_types.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/shared_memory_abi.h"
+
+namespace perfetto {
+
+// Used to handle the backfilling of the headers (the |size_field|) of nested
+// messages when a proto is fragmented over several chunks. These patches are
+// sent out-of-band to the tracing service, after having returned the initial
+// chunks of the fragment.
+// TODO(crbug.com/904477): Re-disable the move constructors when all usses of
+// this class have been fixed.
+class Patch {
+ public:
+  using PatchContent = std::array<uint8_t, SharedMemoryABI::kPacketHeaderSize>;
+  Patch(ChunkID c, uint16_t o) : chunk_id(c), offset(o) {}
+  Patch(const Patch&) = default;  // For tests.
+
+  const ChunkID chunk_id;
+  const uint16_t offset;
+  PatchContent size_field{};
+
+  // |size_field| contains a varint. Any varint must start with != 0. Even in
+  // the case we want to encode a size == 0, protozero will write a redundant
+  // varint for that, that is [0x80, 0x80, 0x80, 0x00]. So the first byte is 0
+  // iff we never wrote any varint into that.
+  bool is_patched() const { return size_field[0] != 0; }
+
+  // For tests.
+  bool operator==(const Patch& o) const {
+    return chunk_id == o.chunk_id && offset == o.offset &&
+           size_field == o.size_field;
+  }
+
+ private:
+  Patch& operator=(const Patch&) = delete;
+};
+
+// Note: the protozero::Message(s) will take pointers to the |size_field| of
+// these entries. This container must guarantee that the Patch objects are never
+// moved around (i.e. cannot be a vector because of reallocations can change
+// addresses of pre-existing entries).
+class PatchList {
+ public:
+  using ListType = std::forward_list<Patch>;
+  using value_type = ListType::value_type;          // For gtest.
+  using const_iterator = ListType::const_iterator;  // For gtest.
+
+  PatchList() : last_(list_.before_begin()) {}
+
+  Patch* emplace_back(ChunkID chunk_id, uint16_t offset) {
+    PERFETTO_DCHECK(empty() || last_->chunk_id != chunk_id ||
+                    offset >= last_->offset + sizeof(Patch::PatchContent));
+    last_ = list_.emplace_after(last_, chunk_id, offset);
+    return &*last_;
+  }
+
+  void pop_front() {
+    PERFETTO_DCHECK(!list_.empty());
+    list_.pop_front();
+    if (empty())
+      last_ = list_.before_begin();
+  }
+
+  const Patch& front() const {
+    PERFETTO_DCHECK(!list_.empty());
+    return list_.front();
+  }
+
+  const Patch& back() const {
+    PERFETTO_DCHECK(!list_.empty());
+    return *last_;
+  }
+
+  ListType::const_iterator begin() const { return list_.begin(); }
+  ListType::const_iterator end() const { return list_.end(); }
+  bool empty() const { return list_.empty(); }
+
+ private:
+  ListType list_;
+  ListType::iterator last_;
+};
+
+}  // namespace perfetto
+
+#endif  // SRC_TRACING_CORE_PATCH_LIST_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SRC_TRACING_CORE_TRACE_WRITER_IMPL_H_
+#define SRC_TRACING_CORE_TRACE_WRITER_IMPL_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/proc_utils.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/basic_types.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/shared_memory_abi.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/shared_memory_arbiter.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/trace_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message_handle.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/root_message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_stream_writer.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/buffer_exhausted_policy.h"
+// gen_amalgamated expanded: #include "src/tracing/core/patch_list.h"
+
+namespace perfetto {
+
+class SharedMemoryArbiterImpl;
+
+// See //include/perfetto/tracing/core/trace_writer.h for docs.
+class TraceWriterImpl : public TraceWriter,
+                        public protozero::ScatteredStreamWriter::Delegate {
+ public:
+  // TracePacketHandle is defined in trace_writer.h
+  TraceWriterImpl(SharedMemoryArbiterImpl*,
+                  WriterID,
+                  MaybeUnboundBufferID buffer_id,
+                  BufferExhaustedPolicy);
+  ~TraceWriterImpl() override;
+
+  // TraceWriter implementation. See documentation in trace_writer.h.
+  TracePacketHandle NewTracePacket() override;
+  void Flush(std::function<void()> callback = {}) override;
+  WriterID writer_id() const override;
+  uint64_t written() const override {
+    return protobuf_stream_writer_.written();
+  }
+
+  void ResetChunkForTesting() { cur_chunk_ = SharedMemoryABI::Chunk(); }
+  bool drop_packets_for_testing() const { return drop_packets_; }
+
+ private:
+  TraceWriterImpl(const TraceWriterImpl&) = delete;
+  TraceWriterImpl& operator=(const TraceWriterImpl&) = delete;
+
+  // ScatteredStreamWriter::Delegate implementation.
+  protozero::ContiguousMemoryRange GetNewBuffer() override;
+
+  // The per-producer arbiter that coordinates access to the shared memory
+  // buffer from several threads.
+  SharedMemoryArbiterImpl* const shmem_arbiter_;
+
+  // ID of the current writer.
+  const WriterID id_;
+
+  // This is copied into the commit request by SharedMemoryArbiter. See comments
+  // in data_source_config.proto for |target_buffer|. If this is a reservation
+  // for a buffer ID in case of a startup trace writer, SharedMemoryArbiterImpl
+  // will also translate the reservation ID to the actual buffer ID.
+  const MaybeUnboundBufferID target_buffer_;
+
+  // Whether GetNewChunk() should stall or return an invalid chunk if the SMB is
+  // exhausted.
+  const BufferExhaustedPolicy buffer_exhausted_policy_;
+
+  // Monotonic (% wrapping) sequence id of the chunk. Together with the WriterID
+  // this allows the Service to reconstruct the linear sequence of packets.
+  ChunkID next_chunk_id_ = 0;
+
+  // The chunk we are holding onto (if any).
+  SharedMemoryABI::Chunk cur_chunk_;
+
+  // Passed to protozero message to write directly into |cur_chunk_|. It
+  // keeps track of the write pointer. It calls us back (GetNewBuffer()) when
+  // |cur_chunk_| is filled.
+  protozero::ScatteredStreamWriter protobuf_stream_writer_;
+
+  // The packet returned via NewTracePacket(). Its owned by this class,
+  // TracePacketHandle has just a pointer to it.
+  std::unique_ptr<protozero::RootMessage<protos::pbzero::TracePacket>>
+      cur_packet_;
+
+  // The start address of |cur_packet_| within |cur_chunk_|. Used to figure out
+  // fragments sizes when a TracePacket write is interrupted by GetNewBuffer().
+  uint8_t* cur_fragment_start_ = nullptr;
+
+  // true if we received a call to GetNewBuffer() after NewTracePacket(),
+  // false if GetNewBuffer() happened during NewTracePacket() prologue, while
+  // starting the TracePacket header.
+  bool fragmenting_packet_ = false;
+
+  // Set to |true| when the current chunk contains the maximum number of packets
+  // a chunk can contain. When this is |true|, the next packet requires starting
+  // a new chunk.
+  bool reached_max_packets_per_chunk_ = false;
+
+  // If we fail to acquire a new chunk when the arbiter operates in
+  // SharedMemory::BufferExhaustedPolicy::kDrop mode, the trace writer enters a
+  // mode in which data is written to a local garbage chunk and dropped.
+  bool drop_packets_ = false;
+
+  // Whether the trace writer should try to acquire a new chunk from the SMB
+  // when the next TracePacket is started because it filled the garbage chunk at
+  // least once since the last attempt.
+  bool retry_new_chunk_after_packet_ = false;
+
+  // Points to the size field of the last packet we wrote to the current chunk.
+  // If the chunk was already returned, this is reset to |nullptr|.
+  uint8_t* last_packet_size_field_ = nullptr;
+
+  // When a packet is fragmented across different chunks, the |size_field| of
+  // the outstanding nested protobuf messages is redirected onto Patch entries
+  // in this list at the time the Chunk is returned (because at that point we
+  // have to release the ownership of the current Chunk). This list will be
+  // later sent out-of-band to the tracing service, who will patch the required
+  // chunks, if they are still around.
+  PatchList patch_list_;
+
+  // PID of the process that created the trace writer. Used for a DCHECK that
+  // aims to detect unsupported process forks while tracing.
+  const base::PlatformProcessId process_id_;
+};
+
+}  // namespace perfetto
+
+#endif  // SRC_TRACING_CORE_TRACE_WRITER_IMPL_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "src/tracing/core/shared_memory_arbiter_impl.h"
+
+#include <algorithm>
+#include <limits>
+#include <utility>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/base/task_runner.h"
+// gen_amalgamated expanded: #include "perfetto/base/time.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/commit_data_request.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/shared_memory.h"
+// gen_amalgamated expanded: #include "src/tracing/core/null_trace_writer.h"
+// gen_amalgamated expanded: #include "src/tracing/core/trace_writer_impl.h"
+
+namespace perfetto {
+
+using Chunk = SharedMemoryABI::Chunk;
+
+namespace {
+static_assert(sizeof(BufferID) == sizeof(uint16_t),
+              "The MaybeUnboundBufferID logic requires BufferID not to grow "
+              "above uint16_t.");
+
+MaybeUnboundBufferID MakeTargetBufferIdForReservation(uint16_t reservation_id) {
+  // Reservation IDs are stored in the upper bits.
+  PERFETTO_CHECK(reservation_id > 0);
+  return static_cast<MaybeUnboundBufferID>(reservation_id) << 16;
+}
+
+bool IsReservationTargetBufferId(MaybeUnboundBufferID buffer_id) {
+  return (buffer_id >> 16) > 0;
+}
+}  // namespace
+
+// static
+SharedMemoryABI::PageLayout SharedMemoryArbiterImpl::default_page_layout =
+    SharedMemoryABI::PageLayout::kPageDiv1;
+
+// static
+constexpr BufferID SharedMemoryArbiterImpl::kInvalidBufferId;
+
+// static
+std::unique_ptr<SharedMemoryArbiter> SharedMemoryArbiter::CreateInstance(
+    SharedMemory* shared_memory,
+    size_t page_size,
+    TracingService::ProducerEndpoint* producer_endpoint,
+    base::TaskRunner* task_runner) {
+  return std::unique_ptr<SharedMemoryArbiterImpl>(
+      new SharedMemoryArbiterImpl(shared_memory->start(), shared_memory->size(),
+                                  page_size, producer_endpoint, task_runner));
+}
+
+// static
+std::unique_ptr<SharedMemoryArbiter> SharedMemoryArbiter::CreateUnboundInstance(
+    SharedMemory* shared_memory,
+    size_t page_size) {
+  return std::unique_ptr<SharedMemoryArbiterImpl>(new SharedMemoryArbiterImpl(
+      shared_memory->start(), shared_memory->size(), page_size,
+      /*producer_endpoint=*/nullptr, /*task_runner=*/nullptr));
+}
+
+SharedMemoryArbiterImpl::SharedMemoryArbiterImpl(
+    void* start,
+    size_t size,
+    size_t page_size,
+    TracingService::ProducerEndpoint* producer_endpoint,
+    base::TaskRunner* task_runner)
+    : initially_bound_(task_runner && producer_endpoint),
+      producer_endpoint_(producer_endpoint),
+      task_runner_(task_runner),
+      shmem_abi_(reinterpret_cast<uint8_t*>(start), size, page_size),
+      active_writer_ids_(kMaxWriterID),
+      fully_bound_(initially_bound_),
+      weak_ptr_factory_(this) {}
+
+Chunk SharedMemoryArbiterImpl::GetNewChunk(
+    const SharedMemoryABI::ChunkHeader& header,
+    BufferExhaustedPolicy buffer_exhausted_policy,
+    size_t size_hint) {
+  PERFETTO_DCHECK(size_hint == 0);  // Not implemented yet.
+  // If initially unbound, we do not support stalling. In theory, we could
+  // support stalling for TraceWriters created after the arbiter and startup
+  // buffer reservations were bound, but to avoid raciness between the creation
+  // of startup writers and binding, we categorically forbid kStall mode.
+  PERFETTO_DCHECK(initially_bound_ ||
+                  buffer_exhausted_policy == BufferExhaustedPolicy::kDrop);
+
+  int stall_count = 0;
+  unsigned stall_interval_us = 0;
+  bool task_runner_runs_on_current_thread = false;
+  static const unsigned kMaxStallIntervalUs = 100000;
+  static const int kLogAfterNStalls = 3;
+  static const int kFlushCommitsAfterEveryNStalls = 2;
+  static const int kAssertAtNStalls = 100;
+
+  for (;;) {
+    // TODO(primiano): Probably this lock is not really required and this code
+    // could be rewritten leveraging only the Try* atomic operations in
+    // SharedMemoryABI. But let's not be too adventurous for the moment.
+    {
+      std::unique_lock<std::mutex> scoped_lock(lock_);
+
+      task_runner_runs_on_current_thread =
+          task_runner_ && task_runner_->RunsTasksOnCurrentThread();
+
+      // If more than half of the SMB.size() is filled with completed chunks for
+      // which we haven't notified the service yet (i.e. they are still enqueued
+      // in |commit_data_req_|), force a synchronous CommitDataRequest() even if
+      // we acquire a chunk, to reduce the likeliness of stalling the writer.
+      //
+      // We can only do this if we're writing on the same thread that we access
+      // the producer endpoint on, since we cannot notify the producer endpoint
+      // to commit synchronously on a different thread. Attempting to flush
+      // synchronously on another thread will lead to subtle bugs caused by
+      // out-of-order commit requests (crbug.com/919187#c28).
+      bool should_commit_synchronously =
+          task_runner_runs_on_current_thread &&
+          buffer_exhausted_policy == BufferExhaustedPolicy::kStall &&
+          commit_data_req_ && bytes_pending_commit_ >= shmem_abi_.size() / 2;
+
+      const size_t initial_page_idx = page_idx_;
+      for (size_t i = 0; i < shmem_abi_.num_pages(); i++) {
+        page_idx_ = (initial_page_idx + i) % shmem_abi_.num_pages();
+        bool is_new_page = false;
+
+        // TODO(primiano): make the page layout dynamic.
+        auto layout = SharedMemoryArbiterImpl::default_page_layout;
+
+        if (shmem_abi_.is_page_free(page_idx_)) {
+          // TODO(primiano): Use the |size_hint| here to decide the layout.
+          is_new_page = shmem_abi_.TryPartitionPage(page_idx_, layout);
+        }
+        uint32_t free_chunks;
+        if (is_new_page) {
+          free_chunks = (1 << SharedMemoryABI::kNumChunksForLayout[layout]) - 1;
+        } else {
+          free_chunks = shmem_abi_.GetFreeChunks(page_idx_);
+        }
+
+        for (uint32_t chunk_idx = 0; free_chunks;
+             chunk_idx++, free_chunks >>= 1) {
+          if (!(free_chunks & 1))
+            continue;
+          // We found a free chunk.
+          Chunk chunk = shmem_abi_.TryAcquireChunkForWriting(
+              page_idx_, chunk_idx, &header);
+          if (!chunk.is_valid())
+            continue;
+          if (stall_count > kLogAfterNStalls) {
+            PERFETTO_LOG("Recovered from stall after %d iterations",
+                         stall_count);
+          }
+
+          if (should_commit_synchronously) {
+            // We can't flush while holding the lock.
+            scoped_lock.unlock();
+            FlushPendingCommitDataRequests();
+            return chunk;
+          } else {
+            return chunk;
+          }
+        }
+      }
+    }  // scoped_lock
+
+    if (buffer_exhausted_policy == BufferExhaustedPolicy::kDrop) {
+      PERFETTO_DLOG("Shared memory buffer exhaused, returning invalid Chunk!");
+      return Chunk();
+    }
+
+    PERFETTO_DCHECK(initially_bound_);
+
+    // All chunks are taken (either kBeingWritten by us or kBeingRead by the
+    // Service).
+    if (stall_count++ == kLogAfterNStalls) {
+      PERFETTO_LOG("Shared memory buffer overrun! Stalling");
+    }
+
+    if (stall_count == kAssertAtNStalls) {
+      PERFETTO_FATAL(
+          "Shared memory buffer max stall count exceeded; possible deadlock");
+    }
+
+    // If the IPC thread itself is stalled because the current process has
+    // filled up the SMB, we need to make sure that the service can process and
+    // purge the chunks written by our process, by flushing any pending commit
+    // requests. Because other threads in our process can continue to
+    // concurrently grab, fill and commit any chunks purged by the service, it
+    // is possible that the SMB remains full and the IPC thread remains stalled,
+    // needing to flush the concurrently queued up commits again. This is
+    // particularly likely with in-process perfetto service where the IPC thread
+    // is the service thread. To avoid remaining stalled forever in such a
+    // situation, we attempt to flush periodically after every N stalls.
+    if (stall_count % kFlushCommitsAfterEveryNStalls == 0 &&
+        task_runner_runs_on_current_thread) {
+      // TODO(primiano): sending the IPC synchronously is a temporary workaround
+      // until the backpressure logic in probes_producer is sorted out. Until
+      // then the risk is that we stall the message loop waiting for the tracing
+      // service to consume the shared memory buffer (SMB) and, for this reason,
+      // never run the task that tells the service to purge the SMB. This must
+      // happen iff we are on the IPC thread, not doing this will cause
+      // deadlocks, doing this on the wrong thread causes out-of-order data
+      // commits (crbug.com/919187#c28).
+      FlushPendingCommitDataRequests();
+    } else {
+      base::SleepMicroseconds(stall_interval_us);
+      stall_interval_us =
+          std::min(kMaxStallIntervalUs, (stall_interval_us + 1) * 8);
+    }
+  }
+}
+
+void SharedMemoryArbiterImpl::ReturnCompletedChunk(
+    Chunk chunk,
+    MaybeUnboundBufferID target_buffer,
+    PatchList* patch_list) {
+  PERFETTO_DCHECK(chunk.is_valid());
+  const WriterID writer_id = chunk.writer_id();
+  UpdateCommitDataRequest(std::move(chunk), writer_id, target_buffer,
+                          patch_list);
+}
+
+void SharedMemoryArbiterImpl::SendPatches(WriterID writer_id,
+                                          MaybeUnboundBufferID target_buffer,
+                                          PatchList* patch_list) {
+  PERFETTO_DCHECK(!patch_list->empty() && patch_list->front().is_patched());
+  UpdateCommitDataRequest(Chunk(), writer_id, target_buffer, patch_list);
+}
+
+void SharedMemoryArbiterImpl::UpdateCommitDataRequest(
+    Chunk chunk,
+    WriterID writer_id,
+    MaybeUnboundBufferID target_buffer,
+    PatchList* patch_list) {
+  // Note: chunk will be invalid if the call came from SendPatches().
+  base::TaskRunner* task_runner_to_post_delayed_callback_on = nullptr;
+  // The delay with which the flush will be posted.
+  uint32_t flush_delay_ms = 0;
+  base::WeakPtr<SharedMemoryArbiterImpl> weak_this;
+  {
+    std::lock_guard<std::mutex> scoped_lock(lock_);
+
+    if (!commit_data_req_) {
+      commit_data_req_.reset(new CommitDataRequest());
+
+      // Flushing the commit is only supported while we're |fully_bound_|. If we
+      // aren't, we'll flush when |fully_bound_| is updated.
+      if (fully_bound_ && !delayed_flush_scheduled_) {
+        weak_this = weak_ptr_factory_.GetWeakPtr();
+        task_runner_to_post_delayed_callback_on = task_runner_;
+        flush_delay_ms = batch_commits_duration_ms_;
+        delayed_flush_scheduled_ = true;
+      }
+    }
+
+    // If a valid chunk is specified, return it and attach it to the request.
+    if (chunk.is_valid()) {
+      PERFETTO_DCHECK(chunk.writer_id() == writer_id);
+      uint8_t chunk_idx = chunk.chunk_idx();
+      bytes_pending_commit_ += chunk.size();
+      size_t page_idx;
+      // If the chunk needs patching, it should not be marked as complete yet,
+      // because this would indicate to the service that the producer will not
+      // be writing to it anymore, while the producer might still apply patches
+      // to the chunk later on. In particular, when re-reading (e.g. because of
+      // periodic scraping) a completed chunk, the service expects the flags of
+      // that chunk not to be removed between reads. So, let's say the producer
+      // marked the chunk as complete here and the service then read it for the
+      // first time. If the producer then fully patched the chunk, thus removing
+      // the kChunkNeedsPatching flag, and the service re-read the chunk after
+      // the patching, the service would be thrown off by the removed flag.
+      if (direct_patching_enabled_ &&
+          (chunk.GetPacketCountAndFlags().second &
+           SharedMemoryABI::ChunkHeader::kChunkNeedsPatching)) {
+        page_idx = shmem_abi_.GetPageAndChunkIndex(std::move(chunk)).first;
+      } else {
+        // If the chunk doesn't need patching, we can mark it as complete
+        // immediately. This allows the service to read it in full while
+        // scraping, which would not be the case if the chunk was left in a
+        // kChunkBeingWritten state.
+        page_idx = shmem_abi_.ReleaseChunkAsComplete(std::move(chunk));
+      }
+
+      // DO NOT access |chunk| after this point, it has been std::move()-d
+      // above.
+      CommitDataRequest::ChunksToMove* ctm =
+          commit_data_req_->add_chunks_to_move();
+      ctm->set_page(static_cast<uint32_t>(page_idx));
+      ctm->set_chunk(chunk_idx);
+      ctm->set_target_buffer(target_buffer);
+    }
+
+    // Process the completed patches for previous chunks from the |patch_list|.
+    CommitDataRequest::ChunkToPatch* last_patch_req = nullptr;
+    while (!patch_list->empty() && patch_list->front().is_patched()) {
+      Patch curr_patch = patch_list->front();
+      patch_list->pop_front();
+      // Patches for the same chunk are contiguous in the |patch_list|. So, to
+      // determine if there are any other patches that apply to the chunk that
+      // is being patched, check if the next patch in the |patch_list| applies
+      // to the same chunk.
+      bool chunk_needs_more_patching =
+          !patch_list->empty() &&
+          patch_list->front().chunk_id == curr_patch.chunk_id;
+
+      if (direct_patching_enabled_ &&
+          TryDirectPatchLocked(writer_id, curr_patch,
+                               chunk_needs_more_patching)) {
+        continue;
+      }
+
+      // The chunk that this patch applies to has already been released to the
+      // service, so it cannot be patches here. Add the patch to the commit data
+      // request, so that it can be sent to the service and applied there.
+      if (!last_patch_req ||
+          last_patch_req->chunk_id() != curr_patch.chunk_id) {
+        last_patch_req = commit_data_req_->add_chunks_to_patch();
+        last_patch_req->set_writer_id(writer_id);
+        last_patch_req->set_chunk_id(curr_patch.chunk_id);
+        last_patch_req->set_target_buffer(target_buffer);
+      }
+      auto* patch = last_patch_req->add_patches();
+      patch->set_offset(curr_patch.offset);
+      patch->set_data(&curr_patch.size_field[0], curr_patch.size_field.size());
+    }
+
+    // Patches are enqueued in the |patch_list| in order and are notified to
+    // the service when the chunk is returned. The only case when the current
+    // patch list is incomplete is if there is an unpatched entry at the head of
+    // the |patch_list| that belongs to the same ChunkID as the last one we are
+    // about to send to the service.
+    if (last_patch_req && !patch_list->empty() &&
+        patch_list->front().chunk_id == last_patch_req->chunk_id()) {
+      last_patch_req->set_has_more_patches(true);
+    }
+
+    // If the buffer is filling up or if we are given a patch for a chunk
+    // that was already sent to the service, we don't want to wait for the next
+    // delayed flush to happen and we flush immediately. Otherwise, if we
+    // accumulate the patch and a crash occurs before the patch is sent, the
+    // service will not know of the patch and won't be able to reconstruct the
+    // trace.
+    if (fully_bound_ &&
+        (last_patch_req || bytes_pending_commit_ >= shmem_abi_.size() / 2)) {
+      weak_this = weak_ptr_factory_.GetWeakPtr();
+      task_runner_to_post_delayed_callback_on = task_runner_;
+      flush_delay_ms = 0;
+    }
+  }  // scoped_lock(lock_)
+
+  // We shouldn't post tasks while locked.
+  // |task_runner_to_post_delayed_callback_on| remains valid after unlocking,
+  // because |task_runner_| is never reset.
+  if (task_runner_to_post_delayed_callback_on) {
+    task_runner_to_post_delayed_callback_on->PostDelayedTask(
+        [weak_this] {
+          if (!weak_this)
+            return;
+          {
+            std::lock_guard<std::mutex> scoped_lock(weak_this->lock_);
+            // Clear |delayed_flush_scheduled_|, allowing the next call to
+            // UpdateCommitDataRequest to start another batching period.
+            weak_this->delayed_flush_scheduled_ = false;
+          }
+          weak_this->FlushPendingCommitDataRequests();
+        },
+        flush_delay_ms);
+  }
+}
+
+bool SharedMemoryArbiterImpl::TryDirectPatchLocked(
+    WriterID writer_id,
+    const Patch& patch,
+    bool chunk_needs_more_patching) {
+  // Search the chunks that are being batched in |commit_data_req_| for a chunk
+  // that needs patching and that matches the provided |writer_id| and
+  // |patch.chunk_id|. Iterate |commit_data_req_| in reverse, since
+  // |commit_data_req_| is appended to at the end with newly-returned chunks,
+  // and patches are more likely to apply to chunks that have been returned
+  // recently.
+  SharedMemoryABI::Chunk chunk;
+  bool chunk_found = false;
+  auto& chunks_to_move = commit_data_req_->chunks_to_move();
+  for (auto ctm_it = chunks_to_move.rbegin(); ctm_it != chunks_to_move.rend();
+       ++ctm_it) {
+    uint32_t layout = shmem_abi_.GetPageLayout(ctm_it->page());
+    auto chunk_state =
+        shmem_abi_.GetChunkStateFromLayout(layout, ctm_it->chunk());
+    // Note: the subset of |commit_data_req_| chunks that still need patching is
+    // also the subset of chunks that are still being written to. The rest of
+    // the chunks in |commit_data_req_| do not need patching and have already
+    // been marked as complete.
+    if (chunk_state != SharedMemoryABI::kChunkBeingWritten)
+      continue;
+
+    chunk =
+        shmem_abi_.GetChunkUnchecked(ctm_it->page(), layout, ctm_it->chunk());
+    if (chunk.writer_id() == writer_id &&
+        chunk.header()->chunk_id.load(std::memory_order_relaxed) ==
+            patch.chunk_id) {
+      chunk_found = true;
+      break;
+    }
+  }
+
+  if (!chunk_found) {
+    // The chunk has already been committed to the service and the patch cannot
+    // be applied in the producer.
+    return false;
+  }
+
+  // Apply the patch.
+  size_t page_idx;
+  uint8_t chunk_idx;
+  std::tie(page_idx, chunk_idx) = shmem_abi_.GetPageAndChunkIndex(chunk);
+  PERFETTO_DCHECK(shmem_abi_.GetChunkState(page_idx, chunk_idx) ==
+                  SharedMemoryABI::ChunkState::kChunkBeingWritten);
+  auto chunk_begin = chunk.payload_begin();
+  uint8_t* ptr = chunk_begin + patch.offset;
+  PERFETTO_CHECK(ptr <= chunk.end() - SharedMemoryABI::kPacketHeaderSize);
+  // DCHECK that we are writing into a zero-filled size field and not into
+  // valid data. It relies on ScatteredStreamWriter::ReserveBytes() to
+  // zero-fill reservations in debug builds.
+  const char zero[SharedMemoryABI::kPacketHeaderSize]{};
+  PERFETTO_DCHECK(memcmp(ptr, &zero, SharedMemoryABI::kPacketHeaderSize) == 0);
+
+  memcpy(ptr, &patch.size_field[0], SharedMemoryABI::kPacketHeaderSize);
+
+  if (!chunk_needs_more_patching) {
+    // Mark that the chunk doesn't need more patching and mark it as complete,
+    // as the producer will not write to it anymore. This allows the service to
+    // read the chunk in full while scraping, which would not be the case if the
+    // chunk was left in a kChunkBeingWritten state.
+    chunk.ClearNeedsPatchingFlag();
+    shmem_abi_.ReleaseChunkAsComplete(std::move(chunk));
+  }
+
+  return true;
+}
+
+void SharedMemoryArbiterImpl::SetBatchCommitsDuration(
+    uint32_t batch_commits_duration_ms) {
+  std::lock_guard<std::mutex> scoped_lock(lock_);
+  batch_commits_duration_ms_ = batch_commits_duration_ms;
+}
+
+bool SharedMemoryArbiterImpl::EnableDirectSMBPatching() {
+  std::lock_guard<std::mutex> scoped_lock(lock_);
+  if (!direct_patching_supported_by_service_) {
+    return false;
+  }
+
+  return direct_patching_enabled_ = true;
+}
+
+void SharedMemoryArbiterImpl::SetDirectSMBPatchingSupportedByService() {
+  std::lock_guard<std::mutex> scoped_lock(lock_);
+  direct_patching_supported_by_service_ = true;
+}
+
+// This function is quite subtle. When making changes keep in mind these two
+// challenges:
+// 1) If the producer stalls and we happen to be on the |task_runner_| IPC
+//    thread (or, for in-process cases, on the same thread where
+//    TracingServiceImpl lives), the CommitData() call must be synchronous and
+//    not posted, to avoid deadlocks.
+// 2) When different threads hit this function, we must guarantee that we don't
+//    accidentally make commits out of order. See commit 4e4fe8f56ef and
+//    crbug.com/919187 for more context.
+void SharedMemoryArbiterImpl::FlushPendingCommitDataRequests(
+    std::function<void()> callback) {
+  std::unique_ptr<CommitDataRequest> req;
+  {
+    std::unique_lock<std::mutex> scoped_lock(lock_);
+
+    // Flushing is only supported while |fully_bound_|, and there may still be
+    // unbound startup trace writers. If so, skip the commit for now - it'll be
+    // done when |fully_bound_| is updated.
+    if (!fully_bound_) {
+      if (callback)
+        pending_flush_callbacks_.push_back(callback);
+      return;
+    }
+
+    // May be called by TraceWriterImpl on any thread.
+    base::TaskRunner* task_runner = task_runner_;
+    if (!task_runner->RunsTasksOnCurrentThread()) {
+      // We shouldn't post a task while holding a lock. |task_runner| remains
+      // valid after unlocking, because |task_runner_| is never reset.
+      scoped_lock.unlock();
+
+      auto weak_this = weak_ptr_factory_.GetWeakPtr();
+      task_runner->PostTask([weak_this, callback] {
+        if (weak_this)
+          weak_this->FlushPendingCommitDataRequests(std::move(callback));
+      });
+      return;
+    }
+
+    // |commit_data_req_| could have become a nullptr, for example when a forced
+    // sync flush happens in GetNewChunk().
+    if (commit_data_req_) {
+      // Make sure any placeholder buffer IDs from StartupWriters are replaced
+      // before sending the request.
+      bool all_placeholders_replaced =
+          ReplaceCommitPlaceholderBufferIdsLocked();
+      // We're |fully_bound_|, thus all writers are bound and all placeholders
+      // should have been replaced.
+      PERFETTO_DCHECK(all_placeholders_replaced);
+
+      // In order to allow patching in the producer we delay the kChunkComplete
+      // transition and keep batched chunks in the kChunkBeingWritten state.
+      // Since we are about to notify the service of all batched chunks, it will
+      // not be possible to apply any more patches to them and we need to move
+      // them to kChunkComplete - otherwise the service won't look at them.
+      for (auto& ctm : commit_data_req_->chunks_to_move()) {
+        uint32_t layout = shmem_abi_.GetPageLayout(ctm.page());
+        auto chunk_state =
+            shmem_abi_.GetChunkStateFromLayout(layout, ctm.chunk());
+        // Note: the subset of |commit_data_req_| chunks that still need
+        // patching is also the subset of chunks that are still being written
+        // to. The rest of the chunks in |commit_data_req_| do not need patching
+        // and have already been marked as complete.
+        if (chunk_state != SharedMemoryABI::kChunkBeingWritten)
+          continue;
+
+        SharedMemoryABI::Chunk chunk =
+            shmem_abi_.GetChunkUnchecked(ctm.page(), layout, ctm.chunk());
+        shmem_abi_.ReleaseChunkAsComplete(std::move(chunk));
+      }
+
+      req = std::move(commit_data_req_);
+      bytes_pending_commit_ = 0;
+    }
+  }  // scoped_lock
+
+  if (req) {
+    producer_endpoint_->CommitData(*req, callback);
+  } else if (callback) {
+    // If |req| was nullptr, it means that an enqueued deferred commit was
+    // executed just before this. At this point send an empty commit request
+    // to the service, just to linearize with it and give the guarantee to the
+    // caller that the data has been flushed into the service.
+    producer_endpoint_->CommitData(CommitDataRequest(), std::move(callback));
+  }
+}
+
+bool SharedMemoryArbiterImpl::TryShutdown() {
+  std::lock_guard<std::mutex> scoped_lock(lock_);
+  did_shutdown_ = true;
+  // Shutdown is safe if there are no active trace writers for this arbiter.
+  return active_writer_ids_.IsEmpty();
+}
+
+std::unique_ptr<TraceWriter> SharedMemoryArbiterImpl::CreateTraceWriter(
+    BufferID target_buffer,
+    BufferExhaustedPolicy buffer_exhausted_policy) {
+  PERFETTO_CHECK(target_buffer > 0);
+  return CreateTraceWriterInternal(target_buffer, buffer_exhausted_policy);
+}
+
+std::unique_ptr<TraceWriter> SharedMemoryArbiterImpl::CreateStartupTraceWriter(
+    uint16_t target_buffer_reservation_id) {
+  PERFETTO_CHECK(!initially_bound_);
+  return CreateTraceWriterInternal(
+      MakeTargetBufferIdForReservation(target_buffer_reservation_id),
+      BufferExhaustedPolicy::kDrop);
+}
+
+void SharedMemoryArbiterImpl::BindToProducerEndpoint(
+    TracingService::ProducerEndpoint* producer_endpoint,
+    base::TaskRunner* task_runner) {
+  PERFETTO_DCHECK(producer_endpoint && task_runner);
+  PERFETTO_DCHECK(task_runner->RunsTasksOnCurrentThread());
+  PERFETTO_CHECK(!initially_bound_);
+
+  bool should_flush = false;
+  std::function<void()> flush_callback;
+  {
+    std::lock_guard<std::mutex> scoped_lock(lock_);
+    PERFETTO_CHECK(!fully_bound_);
+    PERFETTO_CHECK(!producer_endpoint_ && !task_runner_);
+
+    producer_endpoint_ = producer_endpoint;
+    task_runner_ = task_runner;
+
+    // Now that we're bound to a task runner, also reset the WeakPtrFactory to
+    // it. Because this code runs on the task runner, the factory's weak
+    // pointers will be valid on it.
+    weak_ptr_factory_.Reset(this);
+
+    // All writers registered so far should be startup trace writers, since
+    // the producer cannot feasibly know the target buffer for any future
+    // session yet.
+    for (const auto& entry : pending_writers_) {
+      PERFETTO_CHECK(IsReservationTargetBufferId(entry.second));
+    }
+
+    // If all buffer reservations are bound, we can flush pending commits.
+    if (UpdateFullyBoundLocked()) {
+      should_flush = true;
+      flush_callback = TakePendingFlushCallbacksLocked();
+    }
+  }  // scoped_lock
+
+  // Attempt to flush any pending commits (and run pending flush callbacks). If
+  // there are none, this will have no effect. If we ended up in a race that
+  // changed |fully_bound_| back to false, the commit will happen once we become
+  // |fully_bound_| again.
+  if (should_flush)
+    FlushPendingCommitDataRequests(flush_callback);
+}
+
+void SharedMemoryArbiterImpl::BindStartupTargetBuffer(
+    uint16_t target_buffer_reservation_id,
+    BufferID target_buffer_id) {
+  PERFETTO_DCHECK(target_buffer_id > 0);
+  PERFETTO_CHECK(!initially_bound_);
+
+  std::unique_lock<std::mutex> scoped_lock(lock_);
+
+  // We should already be bound to an endpoint, but not fully bound.
+  PERFETTO_CHECK(!fully_bound_);
+  PERFETTO_CHECK(producer_endpoint_);
+  PERFETTO_CHECK(task_runner_);
+  PERFETTO_CHECK(task_runner_->RunsTasksOnCurrentThread());
+
+  BindStartupTargetBufferImpl(std::move(scoped_lock),
+                              target_buffer_reservation_id, target_buffer_id);
+}
+
+void SharedMemoryArbiterImpl::AbortStartupTracingForReservation(
+    uint16_t target_buffer_reservation_id) {
+  PERFETTO_CHECK(!initially_bound_);
+
+  std::unique_lock<std::mutex> scoped_lock(lock_);
+
+  // If we are already bound to an arbiter, we may need to flush after aborting
+  // the session, and thus should be running on the arbiter's task runner.
+  if (task_runner_ && !task_runner_->RunsTasksOnCurrentThread()) {
+    // We shouldn't post tasks while locked.
+    auto* task_runner = task_runner_;
+    scoped_lock.unlock();
+
+    auto weak_this = weak_ptr_factory_.GetWeakPtr();
+    task_runner->PostTask([weak_this, target_buffer_reservation_id]() {
+      if (!weak_this)
+        return;
+      weak_this->AbortStartupTracingForReservation(
+          target_buffer_reservation_id);
+    });
+    return;
+  }
+
+  PERFETTO_CHECK(!fully_bound_);
+
+  // Bind the target buffer reservation to an invalid buffer (ID 0), so that
+  // existing commits, as well as future commits (of currently acquired chunks),
+  // will be released as free free by the service but otherwise ignored (i.e.
+  // not copied into any valid target buffer).
+  BindStartupTargetBufferImpl(std::move(scoped_lock),
+                              target_buffer_reservation_id,
+                              /*target_buffer_id=*/kInvalidBufferId);
+}
+
+void SharedMemoryArbiterImpl::BindStartupTargetBufferImpl(
+    std::unique_lock<std::mutex> scoped_lock,
+    uint16_t target_buffer_reservation_id,
+    BufferID target_buffer_id) {
+  // We should already be bound to an endpoint if the target buffer is valid.
+  PERFETTO_DCHECK((producer_endpoint_ && task_runner_) ||
+                  target_buffer_id == kInvalidBufferId);
+
+  MaybeUnboundBufferID reserved_id =
+      MakeTargetBufferIdForReservation(target_buffer_reservation_id);
+
+  bool should_flush = false;
+  std::function<void()> flush_callback;
+  std::vector<std::pair<WriterID, BufferID>> writers_to_register;
+
+  TargetBufferReservation& reservation =
+      target_buffer_reservations_[reserved_id];
+  PERFETTO_CHECK(!reservation.resolved);
+  reservation.resolved = true;
+  reservation.target_buffer = target_buffer_id;
+
+  // Collect trace writers associated with the reservation.
+  for (auto it = pending_writers_.begin(); it != pending_writers_.end();) {
+    if (it->second == reserved_id) {
+      // No need to register writers that have an invalid target buffer.
+      if (target_buffer_id != kInvalidBufferId) {
+        writers_to_register.push_back(
+            std::make_pair(it->first, target_buffer_id));
+      }
+      it = pending_writers_.erase(it);
+    } else {
+      it++;
+    }
+  }
+
+  // If all buffer reservations are bound, we can flush pending commits.
+  if (UpdateFullyBoundLocked()) {
+    should_flush = true;
+    flush_callback = TakePendingFlushCallbacksLocked();
+  }
+
+  scoped_lock.unlock();
+
+  // Register any newly bound trace writers with the service.
+  for (const auto& writer_and_target_buffer : writers_to_register) {
+    producer_endpoint_->RegisterTraceWriter(writer_and_target_buffer.first,
+                                            writer_and_target_buffer.second);
+  }
+
+  // Attempt to flush any pending commits (and run pending flush callbacks). If
+  // there are none, this will have no effect. If we ended up in a race that
+  // changed |fully_bound_| back to false, the commit will happen once we become
+  // |fully_bound_| again.
+  if (should_flush)
+    FlushPendingCommitDataRequests(flush_callback);
+}
+
+std::function<void()>
+SharedMemoryArbiterImpl::TakePendingFlushCallbacksLocked() {
+  if (pending_flush_callbacks_.empty())
+    return std::function<void()>();
+
+  std::vector<std::function<void()>> pending_flush_callbacks;
+  pending_flush_callbacks.swap(pending_flush_callbacks_);
+  // Capture the callback list into the lambda by copy.
+  return [pending_flush_callbacks]() {
+    for (auto& callback : pending_flush_callbacks)
+      callback();
+  };
+}
+
+void SharedMemoryArbiterImpl::NotifyFlushComplete(FlushRequestID req_id) {
+  base::TaskRunner* task_runner_to_commit_on = nullptr;
+
+  {
+    std::lock_guard<std::mutex> scoped_lock(lock_);
+    // If a commit_data_req_ exists it means that somebody else already posted a
+    // FlushPendingCommitDataRequests() task.
+    if (!commit_data_req_) {
+      commit_data_req_.reset(new CommitDataRequest());
+
+      // Flushing the commit is only supported while we're |fully_bound_|. If we
+      // aren't, we'll flush when |fully_bound_| is updated.
+      if (fully_bound_)
+        task_runner_to_commit_on = task_runner_;
+    } else {
+      // If there is another request queued and that also contains is a reply
+      // to a flush request, reply with the highest id.
+      req_id = std::max(req_id, commit_data_req_->flush_request_id());
+    }
+    commit_data_req_->set_flush_request_id(req_id);
+  }  // scoped_lock
+
+  // We shouldn't post tasks while locked. |task_runner_to_commit_on|
+  // remains valid after unlocking, because |task_runner_| is never reset.
+  if (task_runner_to_commit_on) {
+    auto weak_this = weak_ptr_factory_.GetWeakPtr();
+    task_runner_to_commit_on->PostTask([weak_this] {
+      if (weak_this)
+        weak_this->FlushPendingCommitDataRequests();
+    });
+  }
+}
+
+std::unique_ptr<TraceWriter> SharedMemoryArbiterImpl::CreateTraceWriterInternal(
+    MaybeUnboundBufferID target_buffer,
+    BufferExhaustedPolicy buffer_exhausted_policy) {
+  WriterID id;
+  base::TaskRunner* task_runner_to_register_on = nullptr;
+
+  {
+    std::lock_guard<std::mutex> scoped_lock(lock_);
+    if (did_shutdown_)
+      return std::unique_ptr<TraceWriter>(new NullTraceWriter());
+
+    id = active_writer_ids_.Allocate();
+    if (!id)
+      return std::unique_ptr<TraceWriter>(new NullTraceWriter());
+
+    PERFETTO_DCHECK(!pending_writers_.count(id));
+
+    if (IsReservationTargetBufferId(target_buffer)) {
+      // If the reservation is new, mark it as unbound in
+      // |target_buffer_reservations_|. Otherwise, if the reservation was
+      // already bound, choose the bound buffer ID now.
+      auto it_and_inserted = target_buffer_reservations_.insert(
+          {target_buffer, TargetBufferReservation()});
+      if (it_and_inserted.first->second.resolved)
+        target_buffer = it_and_inserted.first->second.target_buffer;
+    }
+
+    if (IsReservationTargetBufferId(target_buffer)) {
+      // The arbiter and/or startup buffer reservations are not bound yet, so
+      // buffer the registration of the writer until after we're bound.
+      pending_writers_[id] = target_buffer;
+
+      // Mark the arbiter as not fully bound, since we now have at least one
+      // unbound trace writer / target buffer reservation.
+      fully_bound_ = false;
+    } else if (target_buffer != kInvalidBufferId) {
+      // Trace writer is bound, so arbiter should be bound to an endpoint, too.
+      PERFETTO_CHECK(producer_endpoint_ && task_runner_);
+      task_runner_to_register_on = task_runner_;
+    }
+  }  // scoped_lock
+
+  // We shouldn't post tasks while locked. |task_runner_to_register_on|
+  // remains valid after unlocking, because |task_runner_| is never reset.
+  if (task_runner_to_register_on) {
+    auto weak_this = weak_ptr_factory_.GetWeakPtr();
+    task_runner_to_register_on->PostTask([weak_this, id, target_buffer] {
+      if (weak_this)
+        weak_this->producer_endpoint_->RegisterTraceWriter(id, target_buffer);
+    });
+  }
+
+  return std::unique_ptr<TraceWriter>(
+      new TraceWriterImpl(this, id, target_buffer, buffer_exhausted_policy));
+}
+
+void SharedMemoryArbiterImpl::ReleaseWriterID(WriterID id) {
+  base::TaskRunner* task_runner = nullptr;
+  {
+    std::lock_guard<std::mutex> scoped_lock(lock_);
+    active_writer_ids_.Free(id);
+
+    auto it = pending_writers_.find(id);
+    if (it != pending_writers_.end()) {
+      // Writer hasn't been bound yet and thus also not yet registered with the
+      // service.
+      pending_writers_.erase(it);
+      return;
+    }
+
+    // A trace writer from an aborted session may be destroyed before the
+    // arbiter is bound to a task runner. In that case, it was never registered
+    // with the service.
+    if (!task_runner_)
+      return;
+
+    task_runner = task_runner_;
+  }  // scoped_lock
+
+  // We shouldn't post tasks while locked. |task_runner| remains valid after
+  // unlocking, because |task_runner_| is never reset.
+  auto weak_this = weak_ptr_factory_.GetWeakPtr();
+  task_runner->PostTask([weak_this, id] {
+    if (weak_this)
+      weak_this->producer_endpoint_->UnregisterTraceWriter(id);
+  });
+}
+
+bool SharedMemoryArbiterImpl::ReplaceCommitPlaceholderBufferIdsLocked() {
+  if (!commit_data_req_)
+    return true;
+
+  bool all_placeholders_replaced = true;
+  for (auto& chunk : *commit_data_req_->mutable_chunks_to_move()) {
+    if (!IsReservationTargetBufferId(chunk.target_buffer()))
+      continue;
+    const auto it = target_buffer_reservations_.find(chunk.target_buffer());
+    PERFETTO_DCHECK(it != target_buffer_reservations_.end());
+    if (!it->second.resolved) {
+      all_placeholders_replaced = false;
+      continue;
+    }
+    chunk.set_target_buffer(it->second.target_buffer);
+  }
+  for (auto& chunk : *commit_data_req_->mutable_chunks_to_patch()) {
+    if (!IsReservationTargetBufferId(chunk.target_buffer()))
+      continue;
+    const auto it = target_buffer_reservations_.find(chunk.target_buffer());
+    PERFETTO_DCHECK(it != target_buffer_reservations_.end());
+    if (!it->second.resolved) {
+      all_placeholders_replaced = false;
+      continue;
+    }
+    chunk.set_target_buffer(it->second.target_buffer);
+  }
+  return all_placeholders_replaced;
+}
+
+bool SharedMemoryArbiterImpl::UpdateFullyBoundLocked() {
+  if (!producer_endpoint_) {
+    PERFETTO_DCHECK(!fully_bound_);
+    return false;
+  }
+  // We're fully bound if all target buffer reservations have a valid associated
+  // BufferID.
+  fully_bound_ = std::none_of(
+      target_buffer_reservations_.begin(), target_buffer_reservations_.end(),
+      [](std::pair<MaybeUnboundBufferID, TargetBufferReservation> entry) {
+        return !entry.second.resolved;
+      });
+  return fully_bound_;
+}
+
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/core/trace_packet.cc
+// gen_amalgamated begin header: include/perfetto/ext/tracing/core/trace_packet.h
+// gen_amalgamated begin header: include/perfetto/ext/tracing/core/slice.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_TRACING_CORE_SLICE_H_
+#define INCLUDE_PERFETTO_EXT_TRACING_CORE_SLICE_H_
+
+#include <stddef.h>
+#include <string.h>
+
+#include <memory>
+#include <string>
+#include <vector>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+
+namespace perfetto {
+
+// A simple wrapper around a virtually contiguous memory range that contains a
+// TracePacket, or just a portion of it.
+struct Slice {
+  Slice() : start(nullptr), size(0) {}
+  Slice(const void* st, size_t sz) : start(st), size(sz) {}
+  Slice(Slice&& other) noexcept = default;
+
+  // Create a Slice which owns |size| bytes of memory.
+  static Slice Allocate(size_t size) {
+    Slice slice;
+    slice.own_data_.reset(new uint8_t[size]);
+    slice.start = &slice.own_data_[0];
+    slice.size = size;
+    return slice;
+  }
+
+  static Slice TakeOwnership(std::unique_ptr<uint8_t[]> buf, size_t size) {
+    Slice slice;
+    slice.own_data_ = std::move(buf);
+    slice.start = &slice.own_data_[0];
+    slice.size = size;
+    return slice;
+  }
+
+  uint8_t* own_data() {
+    PERFETTO_DCHECK(own_data_);
+    return own_data_.get();
+  }
+
+  const void* start;
+  size_t size;
+
+ private:
+  Slice(const Slice&) = delete;
+  void operator=(const Slice&) = delete;
+
+  std::unique_ptr<uint8_t[]> own_data_;
+};
+
+// TODO(primiano): most TracePacket(s) fit in a slice or two. We need something
+// a bit more clever here that has inline capacity for 2 slices and then uses a
+// std::forward_list or a std::vector for the less likely cases.
+using Slices = std::vector<Slice>;
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_TRACING_CORE_SLICE_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_TRACING_CORE_TRACE_PACKET_H_
+#define INCLUDE_PERFETTO_EXT_TRACING_CORE_TRACE_PACKET_H_
+
+#include <stddef.h>
+#include <memory>
+#include <tuple>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/slice.h"
+
+namespace perfetto {
+
+// A wrapper around a byte buffer that contains a protobuf-encoded TracePacket
+// (see trace_packet.proto). The TracePacket is decoded only if the Consumer
+// requests that. This is to allow Consumer(s) to just stream the packet over
+// the network or save it to a file without wasting time decoding it and without
+// needing to depend on libprotobuf or the trace_packet.pb.h header.
+// If the packets are saved / streamed and not just consumed locally, consumers
+// should ensure to preserve the unknown fields in the proto. A consumer, in
+// fact, might have an older version .proto which is newer on the producer.
+class PERFETTO_EXPORT TracePacket {
+ public:
+  using const_iterator = Slices::const_iterator;
+
+  // The field id of protos::Trace::packet, static_assert()-ed in the unittest.
+  static constexpr uint32_t kPacketFieldNumber = 1;
+
+  // Maximum size of the preamble returned by GetProtoPreamble().
+  static constexpr size_t kMaxPreambleBytes = 8;
+
+  TracePacket();
+  ~TracePacket();
+  TracePacket(TracePacket&&) noexcept;
+  TracePacket& operator=(TracePacket&&);
+
+  // Accesses all the raw slices in the packet, for saving them to file/network.
+  const Slices& slices() const { return slices_; }
+
+  // Mutator, used only by the service and tests.
+  void AddSlice(Slice);
+
+  // Does not copy / take ownership of the memory of the slice. The TracePacket
+  // will be valid only as long as the original buffer is valid.
+  void AddSlice(const void* start, size_t size);
+
+  // Total size of all slices.
+  size_t size() const { return size_; }
+
+  // Generates a protobuf preamble suitable to represent this packet as a
+  // repeated field within a root trace.proto message.
+  // Returns a pointer to a buffer, owned by this class, containing the preamble
+  // and its size.
+  std::tuple<char*, size_t> GetProtoPreamble();
+
+  // Returns the raw protobuf bytes of the slices, all stitched together into
+  // a string. Only for testing.
+  std::string GetRawBytesForTesting();
+
+ private:
+  TracePacket(const TracePacket&) = delete;
+  TracePacket& operator=(const TracePacket&) = delete;
+
+  Slices slices_;     // Not owned.
+  size_t size_ = 0;   // SUM(slice.size for slice in slices_).
+  char preamble_[kMaxPreambleBytes];  // Deliberately not initialized.
+
+  // Remember to update the move operators and their unittest if adding new
+  // fields. ConsumerIPCClientImpl::OnReadBuffersResponse() relies on
+  // std::move(TracePacket) to clear up the moved-from instance.
+};
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_TRACING_CORE_TRACE_PACKET_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/trace_packet.h"
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+
+TracePacket::TracePacket() = default;
+TracePacket::~TracePacket() = default;
+
+TracePacket::TracePacket(TracePacket&& other) noexcept {
+  *this = std::move(other);
+}
+
+TracePacket& TracePacket::operator=(TracePacket&& other) {
+  slices_ = std::move(other.slices_);
+  other.slices_.clear();
+  size_ = other.size_;
+  other.size_ = 0;
+  return *this;
+}
+
+void TracePacket::AddSlice(Slice slice) {
+  size_ += slice.size;
+  slices_.push_back(std::move(slice));
+}
+
+void TracePacket::AddSlice(const void* start, size_t size) {
+  size_ += size;
+  slices_.emplace_back(start, size);
+}
+
+std::tuple<char*, size_t> TracePacket::GetProtoPreamble() {
+  using protozero::proto_utils::MakeTagLengthDelimited;
+  using protozero::proto_utils::WriteVarInt;
+  uint8_t* ptr = reinterpret_cast<uint8_t*>(&preamble_[0]);
+
+  constexpr uint8_t tag = MakeTagLengthDelimited(kPacketFieldNumber);
+  static_assert(tag < 0x80, "TracePacket tag should fit in one byte");
+  *(ptr++) = tag;
+
+  ptr = WriteVarInt(size(), ptr);
+  size_t preamble_size = reinterpret_cast<uintptr_t>(ptr) -
+                         reinterpret_cast<uintptr_t>(&preamble_[0]);
+  PERFETTO_DCHECK(preamble_size <= sizeof(preamble_));
+  return std::make_tuple(&preamble_[0], preamble_size);
+}
+
+std::string TracePacket::GetRawBytesForTesting() {
+  std::string data;
+  data.resize(size());
+  size_t pos = 0;
+  for (const Slice& slice : slices()) {
+    PERFETTO_CHECK(pos + slice.size <= data.size());
+    memcpy(&data[pos], slice.start, slice.size);
+    pos += slice.size;
+  }
+  return data;
+}
+
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/core/trace_writer_impl.cc
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "src/tracing/core/trace_writer_impl.h"
+
+#include <string.h>
+
+#include <algorithm>
+#include <type_traits>
+#include <utility>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/thread_annotations.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/root_message.h"
+// gen_amalgamated expanded: #include "src/tracing/core/shared_memory_arbiter_impl.h"
+
+// gen_amalgamated expanded: #include "protos/perfetto/trace/trace_packet.pbzero.h"
+
+using protozero::proto_utils::kMessageLengthFieldSize;
+using protozero::proto_utils::WriteRedundantVarInt;
+using ChunkHeader = perfetto::SharedMemoryABI::ChunkHeader;
+
+namespace perfetto {
+
+namespace {
+constexpr size_t kPacketHeaderSize = SharedMemoryABI::kPacketHeaderSize;
+uint8_t g_garbage_chunk[1024];
+}  // namespace
+
+TraceWriterImpl::TraceWriterImpl(SharedMemoryArbiterImpl* shmem_arbiter,
+                                 WriterID id,
+                                 MaybeUnboundBufferID target_buffer,
+                                 BufferExhaustedPolicy buffer_exhausted_policy)
+    : shmem_arbiter_(shmem_arbiter),
+      id_(id),
+      target_buffer_(target_buffer),
+      buffer_exhausted_policy_(buffer_exhausted_policy),
+      protobuf_stream_writer_(this),
+      process_id_(base::GetProcessId()) {
+  // TODO(primiano): we could handle the case of running out of TraceWriterID(s)
+  // more gracefully and always return a no-op TracePacket in NewTracePacket().
+  PERFETTO_CHECK(id_ != 0);
+
+  cur_packet_.reset(new protozero::RootMessage<protos::pbzero::TracePacket>());
+  cur_packet_->Finalize();  // To avoid the DCHECK in NewTracePacket().
+}
+
+TraceWriterImpl::~TraceWriterImpl() {
+  if (cur_chunk_.is_valid()) {
+    cur_packet_->Finalize();
+    Flush();
+  }
+  // This call may cause the shared memory arbiter (and the underlying memory)
+  // to get asynchronously deleted if this was the last trace writer targeting
+  // the arbiter and the arbiter was marked for shutdown.
+  shmem_arbiter_->ReleaseWriterID(id_);
+}
+
+void TraceWriterImpl::Flush(std::function<void()> callback) {
+  // Flush() cannot be called in the middle of a TracePacket.
+  PERFETTO_CHECK(cur_packet_->is_finalized());
+
+  if (cur_chunk_.is_valid()) {
+    shmem_arbiter_->ReturnCompletedChunk(std::move(cur_chunk_), target_buffer_,
+                                         &patch_list_);
+  } else {
+    // When in stall mode, all patches should have been returned with the last
+    // chunk, since the last packet was completed. In drop_packets_ mode, this
+    // may not be the case because the packet may have been fragmenting when
+    // SMB exhaustion occurred and |cur_chunk_| became invalid. In this case,
+    // drop_packets_ should be true.
+    PERFETTO_DCHECK(patch_list_.empty() || drop_packets_);
+  }
+
+  // Always issue the Flush request, even if there is nothing to flush, just
+  // for the sake of getting the callback posted back.
+  shmem_arbiter_->FlushPendingCommitDataRequests(callback);
+  protobuf_stream_writer_.Reset({nullptr, nullptr});
+
+  // |last_packet_size_field_| might have pointed into the chunk we returned.
+  last_packet_size_field_ = nullptr;
+}
+
+TraceWriterImpl::TracePacketHandle TraceWriterImpl::NewTracePacket() {
+  // If we hit this, the caller is calling NewTracePacket() without having
+  // finalized the previous packet.
+  PERFETTO_CHECK(cur_packet_->is_finalized());
+  // If we hit this, this trace writer was created in a different process. This
+  // likely means that the process forked while tracing was active, and the
+  // forked child process tried to emit a trace event. This is not supported, as
+  // it would lead to two processes writing to the same tracing SMB.
+  PERFETTO_DCHECK(process_id_ == base::GetProcessId());
+
+  fragmenting_packet_ = false;
+
+  // Reserve space for the size of the message. Note: this call might re-enter
+  // into this class invoking GetNewBuffer() if there isn't enough space or if
+  // this is the very first call to NewTracePacket().
+  static_assert(kPacketHeaderSize == kMessageLengthFieldSize,
+                "The packet header must match the Message header size");
+
+  bool was_dropping_packets = drop_packets_;
+
+  // It doesn't make sense to begin a packet that is going to fragment
+  // immediately after (8 is just an arbitrary estimation on the minimum size of
+  // a realistic packet).
+  bool chunk_too_full =
+      protobuf_stream_writer_.bytes_available() < kPacketHeaderSize + 8;
+  if (chunk_too_full || reached_max_packets_per_chunk_ ||
+      retry_new_chunk_after_packet_) {
+    protobuf_stream_writer_.Reset(GetNewBuffer());
+  }
+
+  // Send any completed patches to the service to facilitate trace data
+  // recovery by the service. This should only happen when we're completing
+  // the first packet in a chunk which was a continuation from the previous
+  // chunk, i.e. at most once per chunk.
+  if (!patch_list_.empty() && patch_list_.front().is_patched()) {
+    shmem_arbiter_->SendPatches(id_, target_buffer_, &patch_list_);
+  }
+
+  cur_packet_->Reset(&protobuf_stream_writer_);
+  uint8_t* header = protobuf_stream_writer_.ReserveBytes(kPacketHeaderSize);
+  memset(header, 0, kPacketHeaderSize);
+  cur_packet_->set_size_field(header);
+  last_packet_size_field_ = header;
+
+  TracePacketHandle handle(cur_packet_.get());
+  cur_fragment_start_ = protobuf_stream_writer_.write_ptr();
+  fragmenting_packet_ = true;
+
+  if (PERFETTO_LIKELY(!drop_packets_)) {
+    uint16_t new_packet_count = cur_chunk_.IncrementPacketCount();
+    reached_max_packets_per_chunk_ =
+        new_packet_count == ChunkHeader::Packets::kMaxCount;
+
+    if (PERFETTO_UNLIKELY(was_dropping_packets)) {
+      // We've succeeded to get a new chunk from the SMB after we entered
+      // drop_packets_ mode. Record a marker into the new packet to indicate the
+      // data loss.
+      cur_packet_->set_previous_packet_dropped(true);
+    }
+  }
+
+  return handle;
+}
+
+// Called by the Message. We can get here in two cases:
+// 1. In the middle of writing a Message,
+// when |fragmenting_packet_| == true. In this case we want to update the
+// chunk header with a partial packet and start a new partial packet in the
+// new chunk.
+// 2. While calling ReserveBytes() for the packet header in NewTracePacket().
+// In this case |fragmenting_packet_| == false and we just want a new chunk
+// without creating any fragments.
+protozero::ContiguousMemoryRange TraceWriterImpl::GetNewBuffer() {
+  if (fragmenting_packet_ && drop_packets_) {
+    // We can't write the remaining data of the fragmenting packet to a new
+    // chunk, because we have already lost some of its data in the garbage
+    // chunk. Thus, we will wrap around in the garbage chunk, wait until the
+    // current packet was completed, and then attempt to get a new chunk from
+    // the SMB again. Instead, if |drop_packets_| is true and
+    // |fragmenting_packet_| is false, we try to acquire a valid chunk because
+    // the SMB exhaustion might be resolved.
+    retry_new_chunk_after_packet_ = true;
+    return protozero::ContiguousMemoryRange{
+        &g_garbage_chunk[0], &g_garbage_chunk[0] + sizeof(g_garbage_chunk)};
+  }
+
+  // Attempt to grab the next chunk before finalizing the current one, so that
+  // we know whether we need to start dropping packets before writing the
+  // current packet fragment's header.
+  ChunkHeader::Packets packets = {};
+  if (fragmenting_packet_) {
+    packets.count = 1;
+    packets.flags = ChunkHeader::kFirstPacketContinuesFromPrevChunk;
+  }
+
+  // The memory order of the stores below doesn't really matter. This |header|
+  // is just a local temporary object. The GetNewChunk() call below will copy it
+  // into the shared buffer with the proper barriers.
+  ChunkHeader header = {};
+  header.writer_id.store(id_, std::memory_order_relaxed);
+  header.chunk_id.store(next_chunk_id_, std::memory_order_relaxed);
+  header.packets.store(packets, std::memory_order_relaxed);
+
+  SharedMemoryABI::Chunk new_chunk =
+      shmem_arbiter_->GetNewChunk(header, buffer_exhausted_policy_);
+  if (!new_chunk.is_valid()) {
+    // Shared memory buffer exhausted, switch into |drop_packets_| mode. We'll
+    // drop data until the garbage chunk has been filled once and then retry.
+
+    // If we started a packet in one of the previous (valid) chunks, we need to
+    // tell the service to discard it.
+    if (fragmenting_packet_) {
+      // We can only end up here if the previous chunk was a valid chunk,
+      // because we never try to acquire a new chunk in |drop_packets_| mode
+      // while fragmenting.
+      PERFETTO_DCHECK(!drop_packets_);
+
+      // Backfill the last fragment's header with an invalid size (too large),
+      // so that the service's TraceBuffer throws out the incomplete packet.
+      // It'll restart reading from the next chunk we submit.
+      WriteRedundantVarInt(SharedMemoryABI::kPacketSizeDropPacket,
+                           cur_packet_->size_field());
+
+      // Reset the size field, since we should not write the current packet's
+      // size anymore after this.
+      cur_packet_->set_size_field(nullptr);
+
+      // We don't set kLastPacketContinuesOnNextChunk or kChunkNeedsPatching on
+      // the last chunk, because its last fragment will be discarded anyway.
+      // However, the current packet fragment points to a valid |cur_chunk_| and
+      // may have non-finalized nested messages which will continue in the
+      // garbage chunk and currently still point into |cur_chunk_|. As we are
+      // about to return |cur_chunk_|, we need to invalidate the size fields of
+      // those nested messages. Normally we move them in the |patch_list_| (see
+      // below) but in this case, it doesn't make sense to send patches for a
+      // fragment that will be discarded for sure. Thus, we clean up any size
+      // field references into |cur_chunk_|.
+      for (auto* nested_msg = cur_packet_->nested_message(); nested_msg;
+           nested_msg = nested_msg->nested_message()) {
+        uint8_t* const cur_hdr = nested_msg->size_field();
+
+        // If this is false the protozero Message has already been instructed to
+        // write, upon Finalize(), its size into the patch list.
+        bool size_field_points_within_chunk =
+            cur_hdr >= cur_chunk_.payload_begin() &&
+            cur_hdr + kMessageLengthFieldSize <= cur_chunk_.end();
+
+        if (size_field_points_within_chunk)
+          nested_msg->set_size_field(nullptr);
+      }
+    } else if (!drop_packets_ && last_packet_size_field_) {
+      // If we weren't dropping packets before, we should indicate to the
+      // service that we're about to lose data. We do this by invalidating the
+      // size of the last packet in |cur_chunk_|. The service will record
+      // statistics about packets with kPacketSizeDropPacket size.
+      PERFETTO_DCHECK(cur_packet_->is_finalized());
+      PERFETTO_DCHECK(cur_chunk_.is_valid());
+
+      // |last_packet_size_field_| should point within |cur_chunk_|'s payload.
+      PERFETTO_DCHECK(last_packet_size_field_ >= cur_chunk_.payload_begin() &&
+                      last_packet_size_field_ + kMessageLengthFieldSize <=
+                          cur_chunk_.end());
+
+      WriteRedundantVarInt(SharedMemoryABI::kPacketSizeDropPacket,
+                           last_packet_size_field_);
+    }
+
+    if (cur_chunk_.is_valid()) {
+      shmem_arbiter_->ReturnCompletedChunk(std::move(cur_chunk_),
+                                           target_buffer_, &patch_list_);
+    }
+
+    drop_packets_ = true;
+    cur_chunk_ = SharedMemoryABI::Chunk();  // Reset to an invalid chunk.
+    reached_max_packets_per_chunk_ = false;
+    retry_new_chunk_after_packet_ = false;
+    last_packet_size_field_ = nullptr;
+
+    PERFETTO_ANNOTATE_BENIGN_RACE_SIZED(&g_garbage_chunk,
+                                        sizeof(g_garbage_chunk),
+                                        "nobody reads the garbage chunk")
+    return protozero::ContiguousMemoryRange{
+        &g_garbage_chunk[0], &g_garbage_chunk[0] + sizeof(g_garbage_chunk)};
+  }  // if (!new_chunk.is_valid())
+
+  PERFETTO_DCHECK(new_chunk.is_valid());
+
+  if (fragmenting_packet_) {
+    // We should not be fragmenting a packet after we exited drop_packets_ mode,
+    // because we only retry to get a new chunk when a fresh packet is started.
+    PERFETTO_DCHECK(!drop_packets_);
+
+    uint8_t* const wptr = protobuf_stream_writer_.write_ptr();
+    PERFETTO_DCHECK(wptr >= cur_fragment_start_);
+    uint32_t partial_size = static_cast<uint32_t>(wptr - cur_fragment_start_);
+    PERFETTO_DCHECK(partial_size < cur_chunk_.size());
+
+    // Backfill the packet header with the fragment size.
+    PERFETTO_DCHECK(partial_size > 0);
+    cur_packet_->inc_size_already_written(partial_size);
+    cur_chunk_.SetFlag(ChunkHeader::kLastPacketContinuesOnNextChunk);
+    WriteRedundantVarInt(partial_size, cur_packet_->size_field());
+
+    // Descend in the stack of non-finalized nested submessages (if any) and
+    // detour their |size_field| into the |patch_list_|. At this point we have
+    // to release the chunk and they cannot write anymore into that.
+    // TODO(primiano): add tests to cover this logic.
+    bool chunk_needs_patching = false;
+    for (auto* nested_msg = cur_packet_->nested_message(); nested_msg;
+         nested_msg = nested_msg->nested_message()) {
+      uint8_t* const cur_hdr = nested_msg->size_field();
+
+      // If this is false the protozero Message has already been instructed to
+      // write, upon Finalize(), its size into the patch list.
+      bool size_field_points_within_chunk =
+          cur_hdr >= cur_chunk_.payload_begin() &&
+          cur_hdr + kMessageLengthFieldSize <= cur_chunk_.end();
+
+      if (size_field_points_within_chunk) {
+        auto offset =
+            static_cast<uint16_t>(cur_hdr - cur_chunk_.payload_begin());
+        const ChunkID cur_chunk_id =
+            cur_chunk_.header()->chunk_id.load(std::memory_order_relaxed);
+        Patch* patch = patch_list_.emplace_back(cur_chunk_id, offset);
+        nested_msg->set_size_field(&patch->size_field[0]);
+        chunk_needs_patching = true;
+      } else {
+#if PERFETTO_DCHECK_IS_ON()
+        // Ensure that the size field of the message points to an element of the
+        // patch list.
+        auto patch_it = std::find_if(
+            patch_list_.begin(), patch_list_.end(),
+            [cur_hdr](const Patch& p) { return &p.size_field[0] == cur_hdr; });
+        PERFETTO_DCHECK(patch_it != patch_list_.end());
+#endif
+      }
+    }  // for(nested_msg
+
+    if (chunk_needs_patching)
+      cur_chunk_.SetFlag(ChunkHeader::kChunkNeedsPatching);
+  }  // if(fragmenting_packet)
+
+  if (cur_chunk_.is_valid()) {
+    // ReturnCompletedChunk will consume the first patched entries from
+    // |patch_list_| and shrink it.
+    shmem_arbiter_->ReturnCompletedChunk(std::move(cur_chunk_), target_buffer_,
+                                         &patch_list_);
+  }
+
+  // Switch to the new chunk.
+  drop_packets_ = false;
+  reached_max_packets_per_chunk_ = false;
+  retry_new_chunk_after_packet_ = false;
+  next_chunk_id_++;
+  cur_chunk_ = std::move(new_chunk);
+  last_packet_size_field_ = nullptr;
+
+  uint8_t* payload_begin = cur_chunk_.payload_begin();
+  if (fragmenting_packet_) {
+    cur_packet_->set_size_field(payload_begin);
+    last_packet_size_field_ = payload_begin;
+    memset(payload_begin, 0, kPacketHeaderSize);
+    payload_begin += kPacketHeaderSize;
+    cur_fragment_start_ = payload_begin;
+  }
+
+  return protozero::ContiguousMemoryRange{payload_begin, cur_chunk_.end()};
+}
+
+WriterID TraceWriterImpl::writer_id() const {
+  return id_;
+}
+
+// Base class definitions.
+TraceWriter::TraceWriter() = default;
+TraceWriter::~TraceWriter() = default;
+
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/core/virtual_destructors.cc
+// gen_amalgamated begin header: include/perfetto/ext/tracing/core/consumer.h
+// gen_amalgamated begin header: include/perfetto/ext/tracing/core/observable_events.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_TRACING_CORE_OBSERVABLE_EVENTS_H_
+#define INCLUDE_PERFETTO_EXT_TRACING_CORE_OBSERVABLE_EVENTS_H_
+
+// Creates the aliases in the ::perfetto namespace, doing things like:
+// using ::perfetto::Foo = ::perfetto::protos::gen::Foo.
+// See comments in forward_decls.h for the historical reasons of this
+// indirection layer.
+// gen_amalgamated expanded: #include "perfetto/tracing/core/forward_decls.h"
+
+// gen_amalgamated expanded: #include "protos/perfetto/common/observable_events.gen.h"
+
+#endif  // INCLUDE_PERFETTO_EXT_TRACING_CORE_OBSERVABLE_EVENTS_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_TRACING_CORE_CONSUMER_H_
+#define INCLUDE_PERFETTO_EXT_TRACING_CORE_CONSUMER_H_
+
+#include <vector>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/basic_types.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/observable_events.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/forward_decls.h"
+namespace perfetto {
+
+class TracePacket;
+
+class PERFETTO_EXPORT Consumer {
+ public:
+  virtual ~Consumer();
+
+  // Called by Service (or more typically by the transport layer, on behalf of
+  // the remote Service), once the Consumer <> Service connection has been
+  // established.
+  virtual void OnConnect() = 0;
+
+  // Called by the Service or by the transport layer if the connection with the
+  // service drops, either voluntarily (e.g., by destroying the ConsumerEndpoint
+  // obtained through Service::ConnectConsumer()) or involuntarily (e.g., if the
+  // Service process crashes).
+  virtual void OnDisconnect() = 0;
+
+  // Called by the Service after the tracing session has ended. This can happen
+  // for a variety of reasons:
+  // - The consumer explicitly called DisableTracing()
+  // - The TraceConfig's |duration_ms| has been reached.
+  // - The TraceConfig's |max_file_size_bytes| has been reached.
+  // - An error occurred while trying to enable tracing. In this case |error|
+  //   is non-empty.
+  virtual void OnTracingDisabled(const std::string& error) = 0;
+
+  // Called back by the Service (or transport layer) after invoking
+  // TracingService::ConsumerEndpoint::ReadBuffers(). This function can be
+  // called more than once. Each invocation can carry one or more
+  // TracePacket(s). Upon the last call, |has_more| is set to true (i.e.
+  // |has_more| is a !EOF).
+  virtual void OnTraceData(std::vector<TracePacket>, bool has_more) = 0;
+
+  // Called back by the Service (or transport layer) after invoking
+  // TracingService::ConsumerEndpoint::Detach().
+  // The consumer can disconnect at this point and the trace session will keep
+  // on going. A new consumer can later re-attach passing back the same |key|
+  // passed to Detach(), but only if the two requests come from the same uid.
+  virtual void OnDetach(bool success) = 0;
+
+  // Called back by the Service (or transport layer) after invoking
+  // TracingService::ConsumerEndpoint::Attach().
+  virtual void OnAttach(bool success, const TraceConfig&) = 0;
+
+  // Called back by the Service (or transport layer) after invoking
+  // TracingService::ConsumerEndpoint::GetTraceStats().
+  virtual void OnTraceStats(bool success, const TraceStats&) = 0;
+
+  // Called back by the Service (or transport layer) after invoking
+  // TracingService::ConsumerEndpoint::ObserveEvents() whenever one or more
+  // ObservableEvents of enabled event types occur.
+  virtual void OnObservableEvents(const ObservableEvents&) = 0;
+};
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_TRACING_CORE_CONSUMER_H_
+// gen_amalgamated begin header: include/perfetto/ext/tracing/core/producer.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_TRACING_CORE_PRODUCER_H_
+#define INCLUDE_PERFETTO_EXT_TRACING_CORE_PRODUCER_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/basic_types.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/forward_decls.h"
+namespace perfetto {
+
+class SharedMemory;
+
+// A Producer is an entity that connects to the write-only port of the Service
+// and exposes the ability to produce performance data on-demand. The lifecycle
+// of a Producer is as follows:
+// 1. The producer connects to the service and advertises its data sources
+//    (e.g., the ability to get kernel ftraces, to list process stats).
+// 2. The service acknowledges the connection and sends over the SharedMemory
+//    region that will be used to exchange data (together with the signalling
+//    API TracingService::ProducerEndpoint::OnPageAcquired()/OnPageReleased()).
+// 3. At some point later on, the Service asks the Producer to turn on some of
+//    the previously registered data sources, together with some configuration
+//    parameters. This happens via the StartDataSource() callback.
+// 4. In response to that the Producer will spawn an instance of the given data
+//    source and inject its data into the shared memory buffer (obtained during
+//    OnConnect).
+// This interface is subclassed by:
+//  1. The actual producer code in the clients e.g., the ftrace reader process.
+//  2. The transport layer when interposing RPC between service and producers.
+class PERFETTO_EXPORT Producer {
+ public:
+  virtual ~Producer();
+
+  // Called by Service (or more typically by the transport layer, on behalf of
+  // the remote Service), once the Producer <> Service connection has been
+  // established.
+  virtual void OnConnect() = 0;
+
+  // Called by the Service or by the transport layer if the connection with the
+  // service drops, either voluntarily (e.g., by destroying the ProducerEndpoint
+  // obtained through Service::ConnectProducer()) or involuntarily (e.g., if the
+  // Service process crashes).
+  // The Producer is expected to tear down all its data sources if this happens.
+  // Once this call returns it is possible to safely destroy the Producer
+  // instance.
+  virtual void OnDisconnect() = 0;
+
+  // Called by the Service after OnConnect but before the first DataSource is
+  // created. Can be used for any setup required before tracing begins.
+  virtual void OnTracingSetup() = 0;
+
+  // The lifecycle methods below are always called in the following sequence:
+  // SetupDataSource  -> StartDataSource -> StopDataSource.
+  // Or, in the edge case where a trace is aborted immediately:
+  // SetupDataSource  -> StopDataSource.
+  // The Setup+Start call sequence is always guaranateed, regardless of the
+  // TraceConfig.deferred_start flags.
+  // Called by the Service to configure one of the data sources previously
+  // registered through TracingService::ProducerEndpoint::RegisterDataSource().
+  // This method is always called before StartDataSource. There is always a
+  // SetupDataSource() call before each StartDataSource() call.
+  // Args:
+  // - DataSourceInstanceID is an identifier chosen by the Service that should
+  //   be assigned to the newly created data source instance. It is used to
+  //   match the StopDataSource() request below.
+  // - DataSourceConfig is the configuration for the new data source (e.g.,
+  //   tells which trace categories to enable).
+  virtual void SetupDataSource(DataSourceInstanceID,
+                               const DataSourceConfig&) = 0;
+
+  // Called by the Service to turn on one of the data sources previously
+  // registered through TracingService::ProducerEndpoint::RegisterDataSource()
+  // and initialized through SetupDataSource().
+  // Both arguments are guaranteed to be identical to the ones passed to the
+  // prior SetupDataSource() call.
+  virtual void StartDataSource(DataSourceInstanceID,
+                               const DataSourceConfig&) = 0;
+
+  // Called by the Service to shut down an existing data source instance.
+  virtual void StopDataSource(DataSourceInstanceID) = 0;
+
+  // Called by the service to request the Producer to commit the data of the
+  // given data sources and return their chunks into the shared memory buffer.
+  // The Producer is expected to invoke NotifyFlushComplete(FlushRequestID) on
+  // the Service after the data has been committed. The producer has to either
+  // reply to the flush requests in order, or can just reply to the latest one
+  // Upon seeing a NotifyFlushComplete(N), the service will assume that all
+  // flushes < N have also been committed.
+  virtual void Flush(FlushRequestID,
+                     const DataSourceInstanceID* data_source_ids,
+                     size_t num_data_sources) = 0;
+
+  // Called by the service to instruct the given data sources to stop referring
+  // to any trace contents emitted so far. The intent is that after processing
+  // this call, the rest of the trace should be parsable even if all of the
+  // packets emitted so far have been lost (for example due to ring buffer
+  // overwrites).
+  //
+  // Called only for Producers with active data sources that have opted in by
+  // setting |handles_incremental_state_clear| in their DataSourceDescriptor.
+  //
+  // The way this call is handled is up to the individual Producer
+  // implementation. Some might wish to emit invalidation markers in the trace
+  // (see TracePacket.incremental_state_cleared for an existing field), and
+  // handle them when parsing the trace.
+  virtual void ClearIncrementalState(
+      const DataSourceInstanceID* data_source_ids,
+      size_t num_data_sources) = 0;
+};
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_TRACING_CORE_PRODUCER_H_
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/consumer.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/producer.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/shared_memory.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/shared_memory_arbiter.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/tracing_service.h"
+
+// This translation unit contains the definitions for the destructor of pure
+// virtual interfaces for the current build target. The alternative would be
+// introducing a one-liner .cc file for each pure virtual interface, which is
+// overkill. This is for compliance with -Wweak-vtables.
+
+namespace perfetto {
+
+Consumer::~Consumer() = default;
+Producer::~Producer() = default;
+TracingService::~TracingService() = default;
+ConsumerEndpoint::~ConsumerEndpoint() = default;
+ProducerEndpoint::~ProducerEndpoint() = default;
+SharedMemory::~SharedMemory() = default;
+SharedMemory::Factory::~Factory() = default;
+SharedMemoryArbiter::~SharedMemoryArbiter() = default;
+
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/console_interceptor.cc
+// gen_amalgamated begin header: gen/protos/perfetto/config/interceptors/console_config.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INTERCEPTORS_CONSOLE_CONFIG_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INTERCEPTORS_CONSOLE_CONFIG_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+enum ConsoleConfig_Output : int32_t;
+
+enum ConsoleConfig_Output : int32_t {
+  ConsoleConfig_Output_OUTPUT_UNSPECIFIED = 0,
+  ConsoleConfig_Output_OUTPUT_STDOUT = 1,
+  ConsoleConfig_Output_OUTPUT_STDERR = 2,
+};
+
+const ConsoleConfig_Output ConsoleConfig_Output_MIN = ConsoleConfig_Output_OUTPUT_UNSPECIFIED;
+const ConsoleConfig_Output ConsoleConfig_Output_MAX = ConsoleConfig_Output_OUTPUT_STDERR;
+
+class ConsoleConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ConsoleConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ConsoleConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ConsoleConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_output() const { return at<1>().valid(); }
+  int32_t output() const { return at<1>().as_int32(); }
+  bool has_enable_colors() const { return at<2>().valid(); }
+  bool enable_colors() const { return at<2>().as_bool(); }
+};
+
+class ConsoleConfig : public ::protozero::Message {
+ public:
+  using Decoder = ConsoleConfig_Decoder;
+  enum : int32_t {
+    kOutputFieldNumber = 1,
+    kEnableColorsFieldNumber = 2,
+  };
+  using Output = ::perfetto::protos::pbzero::ConsoleConfig_Output;
+  static const Output OUTPUT_UNSPECIFIED = ConsoleConfig_Output_OUTPUT_UNSPECIFIED;
+  static const Output OUTPUT_STDOUT = ConsoleConfig_Output_OUTPUT_STDOUT;
+  static const Output OUTPUT_STDERR = ConsoleConfig_Output_OUTPUT_STDERR;
+
+  using FieldMetadata_Output =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ConsoleConfig_Output,
+      ConsoleConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Output kOutput() { return {}; }
+  void set_output(::perfetto::protos::pbzero::ConsoleConfig_Output value) {
+    static constexpr uint32_t field_id = FieldMetadata_Output::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_EnableColors =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ConsoleConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EnableColors kEnableColors() { return {}; }
+  void set_enable_colors(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_EnableColors::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/trace_packet_defaults.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACE_PACKET_DEFAULTS_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACE_PACKET_DEFAULTS_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class PerfSampleDefaults;
+class TrackEventDefaults;
+
+class TracePacketDefaults_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/58, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TracePacketDefaults_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TracePacketDefaults_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TracePacketDefaults_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_timestamp_clock_id() const { return at<58>().valid(); }
+  uint32_t timestamp_clock_id() const { return at<58>().as_uint32(); }
+  bool has_track_event_defaults() const { return at<11>().valid(); }
+  ::protozero::ConstBytes track_event_defaults() const { return at<11>().as_bytes(); }
+  bool has_perf_sample_defaults() const { return at<12>().valid(); }
+  ::protozero::ConstBytes perf_sample_defaults() const { return at<12>().as_bytes(); }
+};
+
+class TracePacketDefaults : public ::protozero::Message {
+ public:
+  using Decoder = TracePacketDefaults_Decoder;
+  enum : int32_t {
+    kTimestampClockIdFieldNumber = 58,
+    kTrackEventDefaultsFieldNumber = 11,
+    kPerfSampleDefaultsFieldNumber = 12,
+  };
+
+  using FieldMetadata_TimestampClockId =
+    ::protozero::proto_utils::FieldMetadata<
+      58,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TracePacketDefaults>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TimestampClockId kTimestampClockId() { return {}; }
+  void set_timestamp_clock_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TimestampClockId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TrackEventDefaults =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TrackEventDefaults,
+      TracePacketDefaults>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TrackEventDefaults kTrackEventDefaults() { return {}; }
+  template <typename T = TrackEventDefaults> T* set_track_event_defaults() {
+    return BeginNestedMessage<T>(11);
+  }
+
+
+  using FieldMetadata_PerfSampleDefaults =
+    ::protozero::proto_utils::FieldMetadata<
+      12,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      PerfSampleDefaults,
+      TracePacketDefaults>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PerfSampleDefaults kPerfSampleDefaults() { return {}; }
+  template <typename T = PerfSampleDefaults> T* set_perf_sample_defaults() {
+    return BeginNestedMessage<T>(12);
+  }
+
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/process_descriptor.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_PROCESS_DESCRIPTOR_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_PROCESS_DESCRIPTOR_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+enum ProcessDescriptor_ChromeProcessType : int32_t;
+
+enum ProcessDescriptor_ChromeProcessType : int32_t {
+  ProcessDescriptor_ChromeProcessType_PROCESS_UNSPECIFIED = 0,
+  ProcessDescriptor_ChromeProcessType_PROCESS_BROWSER = 1,
+  ProcessDescriptor_ChromeProcessType_PROCESS_RENDERER = 2,
+  ProcessDescriptor_ChromeProcessType_PROCESS_UTILITY = 3,
+  ProcessDescriptor_ChromeProcessType_PROCESS_ZYGOTE = 4,
+  ProcessDescriptor_ChromeProcessType_PROCESS_SANDBOX_HELPER = 5,
+  ProcessDescriptor_ChromeProcessType_PROCESS_GPU = 6,
+  ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_PLUGIN = 7,
+  ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_BROKER = 8,
+};
+
+const ProcessDescriptor_ChromeProcessType ProcessDescriptor_ChromeProcessType_MIN = ProcessDescriptor_ChromeProcessType_PROCESS_UNSPECIFIED;
+const ProcessDescriptor_ChromeProcessType ProcessDescriptor_ChromeProcessType_MAX = ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_BROKER;
+
+class ProcessDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  ProcessDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ProcessDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ProcessDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_pid() const { return at<1>().valid(); }
+  int32_t pid() const { return at<1>().as_int32(); }
+  bool has_cmdline() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> cmdline() const { return GetRepeated<::protozero::ConstChars>(2); }
+  bool has_process_name() const { return at<6>().valid(); }
+  ::protozero::ConstChars process_name() const { return at<6>().as_string(); }
+  bool has_process_priority() const { return at<5>().valid(); }
+  int32_t process_priority() const { return at<5>().as_int32(); }
+  bool has_start_timestamp_ns() const { return at<7>().valid(); }
+  int64_t start_timestamp_ns() const { return at<7>().as_int64(); }
+  bool has_chrome_process_type() const { return at<4>().valid(); }
+  int32_t chrome_process_type() const { return at<4>().as_int32(); }
+  bool has_legacy_sort_index() const { return at<3>().valid(); }
+  int32_t legacy_sort_index() const { return at<3>().as_int32(); }
+};
+
+class ProcessDescriptor : public ::protozero::Message {
+ public:
+  using Decoder = ProcessDescriptor_Decoder;
+  enum : int32_t {
+    kPidFieldNumber = 1,
+    kCmdlineFieldNumber = 2,
+    kProcessNameFieldNumber = 6,
+    kProcessPriorityFieldNumber = 5,
+    kStartTimestampNsFieldNumber = 7,
+    kChromeProcessTypeFieldNumber = 4,
+    kLegacySortIndexFieldNumber = 3,
+  };
+  using ChromeProcessType = ::perfetto::protos::pbzero::ProcessDescriptor_ChromeProcessType;
+  static const ChromeProcessType PROCESS_UNSPECIFIED = ProcessDescriptor_ChromeProcessType_PROCESS_UNSPECIFIED;
+  static const ChromeProcessType PROCESS_BROWSER = ProcessDescriptor_ChromeProcessType_PROCESS_BROWSER;
+  static const ChromeProcessType PROCESS_RENDERER = ProcessDescriptor_ChromeProcessType_PROCESS_RENDERER;
+  static const ChromeProcessType PROCESS_UTILITY = ProcessDescriptor_ChromeProcessType_PROCESS_UTILITY;
+  static const ChromeProcessType PROCESS_ZYGOTE = ProcessDescriptor_ChromeProcessType_PROCESS_ZYGOTE;
+  static const ChromeProcessType PROCESS_SANDBOX_HELPER = ProcessDescriptor_ChromeProcessType_PROCESS_SANDBOX_HELPER;
+  static const ChromeProcessType PROCESS_GPU = ProcessDescriptor_ChromeProcessType_PROCESS_GPU;
+  static const ChromeProcessType PROCESS_PPAPI_PLUGIN = ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_PLUGIN;
+  static const ChromeProcessType PROCESS_PPAPI_BROKER = ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_BROKER;
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ProcessDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Cmdline =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ProcessDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cmdline kCmdline() { return {}; }
+  void add_cmdline(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Cmdline::kFieldId, data, size);
+  }
+  void add_cmdline(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cmdline::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ProcessName =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ProcessDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProcessName kProcessName() { return {}; }
+  void set_process_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ProcessName::kFieldId, data, size);
+  }
+  void set_process_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProcessName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ProcessPriority =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ProcessDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProcessPriority kProcessPriority() { return {}; }
+  void set_process_priority(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProcessPriority::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_StartTimestampNs =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      ProcessDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StartTimestampNs kStartTimestampNs() { return {}; }
+  void set_start_timestamp_ns(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_StartTimestampNs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ChromeProcessType =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ProcessDescriptor_ChromeProcessType,
+      ProcessDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeProcessType kChromeProcessType() { return {}; }
+  void set_chrome_process_type(::perfetto::protos::pbzero::ProcessDescriptor_ChromeProcessType value) {
+    static constexpr uint32_t field_id = FieldMetadata_ChromeProcessType::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LegacySortIndex =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ProcessDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LegacySortIndex kLegacySortIndex() { return {}; }
+  void set_legacy_sort_index(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_LegacySortIndex::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/thread_descriptor.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_THREAD_DESCRIPTOR_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_THREAD_DESCRIPTOR_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+enum ThreadDescriptor_ChromeThreadType : int32_t;
+
+enum ThreadDescriptor_ChromeThreadType : int32_t {
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_UNSPECIFIED = 0,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_MAIN = 1,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_IO = 2,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_BG_WORKER = 3,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_FG_WORKER = 4,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_FB_BLOCKING = 5,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_BG_BLOCKING = 6,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_SERVICE = 7,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_COMPOSITOR = 8,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_VIZ_COMPOSITOR = 9,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_COMPOSITOR_WORKER = 10,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SERVICE_WORKER = 11,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_MEMORY_INFRA = 50,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SAMPLING_PROFILER = 51,
+};
+
+const ThreadDescriptor_ChromeThreadType ThreadDescriptor_ChromeThreadType_MIN = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_UNSPECIFIED;
+const ThreadDescriptor_ChromeThreadType ThreadDescriptor_ChromeThreadType_MAX = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SAMPLING_PROFILER;
+
+class ThreadDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ThreadDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ThreadDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ThreadDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_pid() const { return at<1>().valid(); }
+  int32_t pid() const { return at<1>().as_int32(); }
+  bool has_tid() const { return at<2>().valid(); }
+  int32_t tid() const { return at<2>().as_int32(); }
+  bool has_thread_name() const { return at<5>().valid(); }
+  ::protozero::ConstChars thread_name() const { return at<5>().as_string(); }
+  bool has_chrome_thread_type() const { return at<4>().valid(); }
+  int32_t chrome_thread_type() const { return at<4>().as_int32(); }
+  bool has_reference_timestamp_us() const { return at<6>().valid(); }
+  int64_t reference_timestamp_us() const { return at<6>().as_int64(); }
+  bool has_reference_thread_time_us() const { return at<7>().valid(); }
+  int64_t reference_thread_time_us() const { return at<7>().as_int64(); }
+  bool has_reference_thread_instruction_count() const { return at<8>().valid(); }
+  int64_t reference_thread_instruction_count() const { return at<8>().as_int64(); }
+  bool has_legacy_sort_index() const { return at<3>().valid(); }
+  int32_t legacy_sort_index() const { return at<3>().as_int32(); }
+};
+
+class ThreadDescriptor : public ::protozero::Message {
+ public:
+  using Decoder = ThreadDescriptor_Decoder;
+  enum : int32_t {
+    kPidFieldNumber = 1,
+    kTidFieldNumber = 2,
+    kThreadNameFieldNumber = 5,
+    kChromeThreadTypeFieldNumber = 4,
+    kReferenceTimestampUsFieldNumber = 6,
+    kReferenceThreadTimeUsFieldNumber = 7,
+    kReferenceThreadInstructionCountFieldNumber = 8,
+    kLegacySortIndexFieldNumber = 3,
+  };
+  using ChromeThreadType = ::perfetto::protos::pbzero::ThreadDescriptor_ChromeThreadType;
+  static const ChromeThreadType CHROME_THREAD_UNSPECIFIED = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_UNSPECIFIED;
+  static const ChromeThreadType CHROME_THREAD_MAIN = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_MAIN;
+  static const ChromeThreadType CHROME_THREAD_IO = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_IO;
+  static const ChromeThreadType CHROME_THREAD_POOL_BG_WORKER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_BG_WORKER;
+  static const ChromeThreadType CHROME_THREAD_POOL_FG_WORKER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_FG_WORKER;
+  static const ChromeThreadType CHROME_THREAD_POOL_FB_BLOCKING = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_FB_BLOCKING;
+  static const ChromeThreadType CHROME_THREAD_POOL_BG_BLOCKING = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_BG_BLOCKING;
+  static const ChromeThreadType CHROME_THREAD_POOL_SERVICE = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_SERVICE;
+  static const ChromeThreadType CHROME_THREAD_COMPOSITOR = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_COMPOSITOR;
+  static const ChromeThreadType CHROME_THREAD_VIZ_COMPOSITOR = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_VIZ_COMPOSITOR;
+  static const ChromeThreadType CHROME_THREAD_COMPOSITOR_WORKER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_COMPOSITOR_WORKER;
+  static const ChromeThreadType CHROME_THREAD_SERVICE_WORKER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SERVICE_WORKER;
+  static const ChromeThreadType CHROME_THREAD_MEMORY_INFRA = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_MEMORY_INFRA;
+  static const ChromeThreadType CHROME_THREAD_SAMPLING_PROFILER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SAMPLING_PROFILER;
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ThreadDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Tid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ThreadDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Tid kTid() { return {}; }
+  void set_tid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Tid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ThreadName =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ThreadDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ThreadName kThreadName() { return {}; }
+  void set_thread_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ThreadName::kFieldId, data, size);
+  }
+  void set_thread_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ThreadName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ChromeThreadType =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ThreadDescriptor_ChromeThreadType,
+      ThreadDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeThreadType kChromeThreadType() { return {}; }
+  void set_chrome_thread_type(::perfetto::protos::pbzero::ThreadDescriptor_ChromeThreadType value) {
+    static constexpr uint32_t field_id = FieldMetadata_ChromeThreadType::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ReferenceTimestampUs =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      ThreadDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ReferenceTimestampUs kReferenceTimestampUs() { return {}; }
+  void set_reference_timestamp_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ReferenceTimestampUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ReferenceThreadTimeUs =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      ThreadDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ReferenceThreadTimeUs kReferenceThreadTimeUs() { return {}; }
+  void set_reference_thread_time_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ReferenceThreadTimeUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ReferenceThreadInstructionCount =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      ThreadDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ReferenceThreadInstructionCount kReferenceThreadInstructionCount() { return {}; }
+  void set_reference_thread_instruction_count(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ReferenceThreadInstructionCount::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LegacySortIndex =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ThreadDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LegacySortIndex kLegacySortIndex() { return {}; }
+  void set_legacy_sort_index(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_LegacySortIndex::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/tracing/console_interceptor.h"
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/file_utils.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/hash.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/optional.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/scoped_file.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/track_event_internal.h"
+
+// gen_amalgamated expanded: #include "protos/perfetto/common/interceptor_descriptor.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/data_source_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/interceptor_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/interceptors/console_config.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/interned_data/interned_data.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/trace_packet.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/trace_packet_defaults.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/process_descriptor.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/thread_descriptor.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/track_descriptor.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/track_event.pbzero.h"
+
+#include <algorithm>
+#include <cmath>
+#include <tuple>
+
+namespace perfetto {
+
+// sRGB color.
+struct ConsoleColor {
+  uint8_t r;
+  uint8_t g;
+  uint8_t b;
+};
+
+namespace {
+
+int g_output_fd_for_testing;
+
+// Google Turbo colormap.
+constexpr std::array<ConsoleColor, 16> kTurboColors = {{
+    ConsoleColor{0x30, 0x12, 0x3b},
+    ConsoleColor{0x40, 0x40, 0xa1},
+    ConsoleColor{0x46, 0x6b, 0xe3},
+    ConsoleColor{0x41, 0x93, 0xfe},
+    ConsoleColor{0x28, 0xbb, 0xeb},
+    ConsoleColor{0x17, 0xdc, 0xc2},
+    ConsoleColor{0x32, 0xf1, 0x97},
+    ConsoleColor{0x6d, 0xfd, 0x62},
+    ConsoleColor{0xa4, 0xfc, 0x3b},
+    ConsoleColor{0xcd, 0xeb, 0x34},
+    ConsoleColor{0xed, 0xcf, 0x39},
+    ConsoleColor{0xfd, 0xab, 0x33},
+    ConsoleColor{0xfa, 0x7d, 0x20},
+    ConsoleColor{0xea, 0x50, 0x0d},
+    ConsoleColor{0xd0, 0x2f, 0x04},
+    ConsoleColor{0xa9, 0x15, 0x01},
+}};
+
+constexpr size_t kHueBits = 4;
+constexpr uint32_t kMaxHue = kTurboColors.size() << kHueBits;
+constexpr uint8_t kLightness = 128u;
+constexpr ConsoleColor kWhiteColor{0xff, 0xff, 0xff};
+
+const char kDim[] = "\x1b[90m";
+const char kDefault[] = "\x1b[39m";
+const char kReset[] = "\x1b[0m";
+
+#define FMT_RGB_SET "\x1b[38;2;%d;%d;%dm"
+#define FMT_RGB_SET_BG "\x1b[48;2;%d;%d;%dm"
+
+ConsoleColor Mix(ConsoleColor a, ConsoleColor b, uint8_t ratio) {
+  return {
+      static_cast<uint8_t>(a.r + (((b.r - a.r) * ratio) >> 8)),
+      static_cast<uint8_t>(a.g + (((b.g - a.g) * ratio) >> 8)),
+      static_cast<uint8_t>(a.b + (((b.b - a.b) * ratio) >> 8)),
+  };
+}
+
+ConsoleColor HueToRGB(uint32_t hue) {
+  PERFETTO_DCHECK(hue < kMaxHue);
+  uint32_t c1 = hue >> kHueBits;
+  uint32_t c2 =
+      std::min(static_cast<uint32_t>(kTurboColors.size() - 1), c1 + 1u);
+  uint32_t ratio = hue & ((1 << kHueBits) - 1);
+  return Mix(kTurboColors[c1], kTurboColors[c2],
+             static_cast<uint8_t>(ratio | (ratio << kHueBits)));
+}
+
+uint32_t CounterToHue(uint32_t counter) {
+  // We split the hue space into 8 segments, reversing the order of bits so
+  // successive counter values will be far from each other.
+  uint32_t reversed =
+      ((counter & 0x7) >> 2) | ((counter & 0x3)) | ((counter & 0x1) << 2);
+  return reversed * kMaxHue / 8;
+}
+
+}  // namespace
+
+class ConsoleInterceptor::Delegate : public TrackEventStateTracker::Delegate {
+ public:
+  explicit Delegate(InterceptorContext&);
+  ~Delegate() override;
+
+  TrackEventStateTracker::SessionState* GetSessionState() override;
+  void OnTrackUpdated(TrackEventStateTracker::Track&) override;
+  void OnTrackEvent(const TrackEventStateTracker::Track&,
+                    const TrackEventStateTracker::ParsedTrackEvent&) override;
+
+ private:
+  using SelfHandle = LockedHandle<ConsoleInterceptor>;
+
+  InterceptorContext& context_;
+  base::Optional<SelfHandle> locked_self_;
+};
+
+ConsoleInterceptor::~ConsoleInterceptor() = default;
+
+ConsoleInterceptor::ThreadLocalState::ThreadLocalState(
+    ThreadLocalStateArgs& args) {
+  if (auto self = args.GetInterceptorLocked()) {
+    start_time_ns = self->start_time_ns_;
+    use_colors = self->use_colors_;
+    fd = self->fd_;
+  }
+}
+
+ConsoleInterceptor::ThreadLocalState::~ThreadLocalState() = default;
+
+ConsoleInterceptor::Delegate::Delegate(InterceptorContext& context)
+    : context_(context) {}
+ConsoleInterceptor::Delegate::~Delegate() = default;
+
+TrackEventStateTracker::SessionState*
+ConsoleInterceptor::Delegate::GetSessionState() {
+  // When the session state is retrieved for the first time, it is cached (and
+  // kept locked) until we return from OnTracePacket. This avoids having to lock
+  // and unlock the instance multiple times per invocation.
+  if (locked_self_.has_value())
+    return &locked_self_.value()->session_state_;
+  locked_self_ =
+      base::make_optional<SelfHandle>(context_.GetInterceptorLocked());
+  return &locked_self_.value()->session_state_;
+}
+
+void ConsoleInterceptor::Delegate::OnTrackUpdated(
+    TrackEventStateTracker::Track& track) {
+  auto track_color = HueToRGB(CounterToHue(track.index));
+  std::array<char, 16> title;
+  if (!track.name.empty()) {
+    snprintf(title.data(), title.size(), "%s", track.name.c_str());
+  } else if (track.pid && track.tid) {
+    snprintf(title.data(), title.size(), "%u:%u",
+             static_cast<uint32_t>(track.pid),
+             static_cast<uint32_t>(track.tid));
+  } else if (track.pid) {
+    snprintf(title.data(), title.size(), "%" PRId64, track.pid);
+  } else {
+    snprintf(title.data(), title.size(), "%" PRIu64, track.uuid);
+  }
+  int title_width = static_cast<int>(title.size());
+
+  auto& tls = context_.GetThreadLocalState();
+  std::array<char, 128> message_prefix{};
+  ssize_t written = 0;
+  if (tls.use_colors) {
+    written = snprintf(message_prefix.data(), message_prefix.size(),
+                       FMT_RGB_SET_BG " %s%s %-*.*s", track_color.r,
+                       track_color.g, track_color.b, kReset, kDim, title_width,
+                       title_width, title.data());
+  } else {
+    written = snprintf(message_prefix.data(), message_prefix.size(), "%-*.*s",
+                       title_width + 2, title_width, title.data());
+  }
+  if (written < 0)
+    written = message_prefix.size();
+  track.user_data.assign(message_prefix.begin(),
+                         message_prefix.begin() + written);
+}
+
+void ConsoleInterceptor::Delegate::OnTrackEvent(
+    const TrackEventStateTracker::Track& track,
+    const TrackEventStateTracker::ParsedTrackEvent& event) {
+  // Start printing.
+  auto& tls = context_.GetThreadLocalState();
+  tls.buffer_pos = 0;
+
+  // Print timestamp and track identifier.
+  SetColor(context_, kDim);
+  Printf(context_, "[%7.3lf] %.*s",
+         static_cast<double>(event.timestamp_ns - tls.start_time_ns) / 1e9,
+         static_cast<int>(track.user_data.size()), track.user_data.data());
+
+  // Print category.
+  Printf(context_, "%-5.*s ",
+         std::min(5, static_cast<int>(event.category.size)),
+         event.category.data);
+
+  // Print stack depth.
+  for (size_t i = 0; i < event.stack_depth; i++) {
+    Printf(context_, "-  ");
+  }
+
+  // Print slice name.
+  auto slice_color = HueToRGB(event.name_hash % kMaxHue);
+  auto highlight_color = Mix(slice_color, kWhiteColor, kLightness);
+  if (event.track_event.type() == protos::pbzero::TrackEvent::TYPE_SLICE_END) {
+    SetColor(context_, kDefault);
+    Printf(context_, "} ");
+  }
+  SetColor(context_, highlight_color);
+  Printf(context_, "%.*s", static_cast<int>(event.name.size), event.name.data);
+  SetColor(context_, kReset);
+  if (event.track_event.type() ==
+      protos::pbzero::TrackEvent::TYPE_SLICE_BEGIN) {
+    SetColor(context_, kDefault);
+    Printf(context_, " {");
+  }
+
+  // Print annotations.
+  if (event.track_event.has_debug_annotations()) {
+    PrintDebugAnnotations(context_, event.track_event, slice_color,
+                          highlight_color);
+  }
+
+  // TODO(skyostil): Print typed arguments.
+
+  // Print duration for longer events.
+  constexpr uint64_t kNsPerMillisecond = 1000000u;
+  if (event.duration_ns >= 10 * kNsPerMillisecond) {
+    SetColor(context_, kDim);
+    Printf(context_, " +%" PRIu64 "ms", event.duration_ns / kNsPerMillisecond);
+  }
+  SetColor(context_, kReset);
+  Printf(context_, "\n");
+}
+
+// static
+void ConsoleInterceptor::Register() {
+  perfetto::protos::gen::InterceptorDescriptor desc;
+  desc.set_name("console");
+  Interceptor<ConsoleInterceptor>::Register(desc);
+}
+
+// static
+void ConsoleInterceptor::SetOutputFdForTesting(int fd) {
+  g_output_fd_for_testing = fd;
+}
+
+void ConsoleInterceptor::OnSetup(const SetupArgs& args) {
+  int fd = STDOUT_FILENO;
+  if (g_output_fd_for_testing)
+    fd = g_output_fd_for_testing;
+#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) && \
+    !PERFETTO_BUILDFLAG(PERFETTO_OS_WASM)
+  bool use_colors = isatty(fd);
+#else
+  bool use_colors = false;
+#endif
+  protos::pbzero::ConsoleConfig::Decoder config(
+      args.config.interceptor_config().console_config_raw());
+  if (config.has_enable_colors())
+    use_colors = config.enable_colors();
+  if (config.output() == protos::pbzero::ConsoleConfig::OUTPUT_STDOUT) {
+    fd = STDOUT_FILENO;
+  } else if (config.output() == protos::pbzero::ConsoleConfig::OUTPUT_STDERR) {
+    fd = STDERR_FILENO;
+  }
+  fd_ = fd;
+  use_colors_ = use_colors;
+}
+
+void ConsoleInterceptor::OnStart(const StartArgs&) {
+  start_time_ns_ = internal::TrackEventInternal::GetTimeNs();
+}
+
+void ConsoleInterceptor::OnStop(const StopArgs&) {}
+
+// static
+void ConsoleInterceptor::OnTracePacket(InterceptorContext context) {
+  {
+    auto& tls = context.GetThreadLocalState();
+    Delegate delegate(context);
+    perfetto::protos::pbzero::TracePacket::Decoder packet(
+        context.packet_data.data, context.packet_data.size);
+    TrackEventStateTracker::ProcessTracePacket(delegate, tls.sequence_state,
+                                               packet);
+  }  // (Potential) lock scope for session state.
+  Flush(context);
+}
+
+// static
+void ConsoleInterceptor::Printf(InterceptorContext& context,
+                                const char* format,
+                                ...) {
+  auto& tls = context.GetThreadLocalState();
+  ssize_t remaining = static_cast<ssize_t>(tls.message_buffer.size()) -
+                      static_cast<ssize_t>(tls.buffer_pos);
+  int written = 0;
+  if (remaining > 0) {
+    va_list args;
+    va_start(args, format);
+    written = vsnprintf(&tls.message_buffer[tls.buffer_pos],
+                        static_cast<size_t>(remaining), format, args);
+    PERFETTO_DCHECK(written >= 0);
+    va_end(args);
+  }
+
+  // In case of buffer overflow, flush to the fd and write the latest message to
+  // it directly instead.
+  if (remaining <= 0 || written > remaining) {
+    FILE* output = (tls.fd == STDOUT_FILENO) ? stdout : stderr;
+    if (g_output_fd_for_testing) {
+      output = fdopen(dup(g_output_fd_for_testing), "w");
+    }
+    Flush(context);
+    va_list args;
+    va_start(args, format);
+    vfprintf(output, format, args);
+    va_end(args);
+    if (g_output_fd_for_testing) {
+      fclose(output);
+    }
+  } else if (written > 0) {
+    tls.buffer_pos += static_cast<size_t>(written);
+  }
+}
+
+// static
+void ConsoleInterceptor::Flush(InterceptorContext& context) {
+  auto& tls = context.GetThreadLocalState();
+  ssize_t res = base::WriteAll(tls.fd, &tls.message_buffer[0], tls.buffer_pos);
+  PERFETTO_DCHECK(res == static_cast<ssize_t>(tls.buffer_pos));
+  tls.buffer_pos = 0;
+}
+
+// static
+void ConsoleInterceptor::SetColor(InterceptorContext& context,
+                                  const ConsoleColor& color) {
+  auto& tls = context.GetThreadLocalState();
+  if (!tls.use_colors)
+    return;
+  Printf(context, FMT_RGB_SET, color.r, color.g, color.b);
+}
+
+// static
+void ConsoleInterceptor::SetColor(InterceptorContext& context,
+                                  const char* color) {
+  auto& tls = context.GetThreadLocalState();
+  if (!tls.use_colors)
+    return;
+  Printf(context, "%s", color);
+}
+
+// static
+void ConsoleInterceptor::PrintDebugAnnotations(
+    InterceptorContext& context,
+    const protos::pbzero::TrackEvent_Decoder& track_event,
+    const ConsoleColor& slice_color,
+    const ConsoleColor& highlight_color) {
+  SetColor(context, slice_color);
+  Printf(context, "(");
+
+  bool is_first = true;
+  for (auto it = track_event.debug_annotations(); it; it++) {
+    perfetto::protos::pbzero::DebugAnnotation::Decoder annotation(*it);
+    SetColor(context, slice_color);
+    if (!is_first)
+      Printf(context, ", ");
+
+    PrintDebugAnnotationName(context, annotation);
+    Printf(context, ":");
+
+    SetColor(context, highlight_color);
+    PrintDebugAnnotationValue(context, annotation);
+
+    is_first = false;
+  }
+  SetColor(context, slice_color);
+  Printf(context, ")");
+}
+
+// static
+void ConsoleInterceptor::PrintDebugAnnotationName(
+    InterceptorContext& context,
+    const perfetto::protos::pbzero::DebugAnnotation::Decoder& annotation) {
+  auto& tls = context.GetThreadLocalState();
+  protozero::ConstChars name{};
+  if (annotation.name_iid()) {
+    name.data =
+        tls.sequence_state.debug_annotation_names[annotation.name_iid()].data();
+    name.size =
+        tls.sequence_state.debug_annotation_names[annotation.name_iid()].size();
+  } else if (annotation.has_name()) {
+    name.data = annotation.name().data;
+    name.size = annotation.name().size;
+  }
+  Printf(context, "%.*s", static_cast<int>(name.size), name.data);
+}
+
+// static
+void ConsoleInterceptor::PrintDebugAnnotationValue(
+    InterceptorContext& context,
+    const perfetto::protos::pbzero::DebugAnnotation::Decoder& annotation) {
+  if (annotation.has_bool_value()) {
+    Printf(context, "%s", annotation.bool_value() ? "true" : "false");
+  } else if (annotation.has_uint_value()) {
+    Printf(context, "%" PRIu64, annotation.uint_value());
+  } else if (annotation.has_int_value()) {
+    Printf(context, "%" PRId64, annotation.int_value());
+  } else if (annotation.has_double_value()) {
+    Printf(context, "%f", annotation.double_value());
+  } else if (annotation.has_string_value()) {
+    Printf(context, "%.*s", static_cast<int>(annotation.string_value().size),
+           annotation.string_value().data);
+  } else if (annotation.has_pointer_value()) {
+    Printf(context, "%p", reinterpret_cast<void*>(annotation.pointer_value()));
+  } else if (annotation.has_legacy_json_value()) {
+    Printf(context, "%.*s",
+           static_cast<int>(annotation.legacy_json_value().size),
+           annotation.legacy_json_value().data);
+  } else if (annotation.has_dict_entries()) {
+    Printf(context, "{");
+    bool is_first = true;
+    for (auto it = annotation.dict_entries(); it; ++it) {
+      if (!is_first)
+        Printf(context, ", ");
+      perfetto::protos::pbzero::DebugAnnotation::Decoder key_value(*it);
+      PrintDebugAnnotationName(context, key_value);
+      Printf(context, ":");
+      PrintDebugAnnotationValue(context, key_value);
+      is_first = false;
+    }
+    Printf(context, "}");
+  } else if (annotation.has_array_values()) {
+    Printf(context, "[");
+    bool is_first = true;
+    for (auto it = annotation.array_values(); it; ++it) {
+      if (!is_first)
+        Printf(context, ", ");
+      perfetto::protos::pbzero::DebugAnnotation::Decoder key_value(*it);
+      PrintDebugAnnotationValue(context, key_value);
+      is_first = false;
+    }
+    Printf(context, "]");
+  } else {
+    Printf(context, "{}");
+  }
+}
+
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/data_source.cc
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/tracing/data_source.h"
+
+namespace perfetto {
+
+DataSourceBase::StopArgs::~StopArgs() = default;
+DataSourceBase::~DataSourceBase() = default;
+void DataSourceBase::OnSetup(const SetupArgs&) {}
+void DataSourceBase::OnStart(const StartArgs&) {}
+void DataSourceBase::OnStop(const StopArgs&) {}
+
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/debug_annotation.cc
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/tracing/debug_annotation.h"
+
+// gen_amalgamated expanded: #include "perfetto/tracing/traced_value.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/debug_annotation.pbzero.h"
+
+namespace perfetto {
+
+DebugAnnotation::~DebugAnnotation() = default;
+
+void DebugAnnotation::WriteIntoTracedValue(TracedValue context) const {
+  Add(context.context_);
+}
+
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/event_context.cc
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/tracing/event_context.h"
+
+// gen_amalgamated expanded: #include "protos/perfetto/trace/interned_data/interned_data.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/track_event.pbzero.h"
+
+namespace perfetto {
+
+EventContext::EventContext(
+    EventContext::TracePacketHandle trace_packet,
+    internal::TrackEventIncrementalState* incremental_state)
+    : trace_packet_(std::move(trace_packet)),
+      event_(trace_packet_->set_track_event()),
+      incremental_state_(incremental_state) {}
+
+EventContext::~EventContext() {
+  if (!trace_packet_)
+    return;
+
+  // When the track event is finalized (i.e., the context is destroyed), we
+  // should flush any newly seen interned data to the trace. The data has
+  // earlier been written to a heap allocated protobuf message
+  // (|serialized_interned_data|). Here we just need to flush it to the main
+  // trace.
+  auto& serialized_interned_data = incremental_state_->serialized_interned_data;
+  if (PERFETTO_LIKELY(serialized_interned_data.empty()))
+    return;
+
+  auto ranges = serialized_interned_data.GetRanges();
+  trace_packet_->AppendScatteredBytes(
+      perfetto::protos::pbzero::TracePacket::kInternedDataFieldNumber,
+      &ranges[0], ranges.size());
+
+  // Reset the message but keep one buffer allocated for future use.
+  serialized_interned_data.Reset();
+}
+
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/interceptor.cc
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/tracing/interceptor.h"
+
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/tracing_muxer.h"
+
+namespace perfetto {
+
+InterceptorBase::~InterceptorBase() = default;
+InterceptorBase::ThreadLocalState::~ThreadLocalState() = default;
+
+// static
+void InterceptorBase::RegisterImpl(
+    const InterceptorDescriptor& descriptor,
+    std::function<std::unique_ptr<InterceptorBase>()> factory,
+    InterceptorBase::TLSFactory tls_factory,
+    InterceptorBase::TracePacketCallback on_trace_packet) {
+  auto* tracing_impl = internal::TracingMuxer::Get();
+  tracing_impl->RegisterInterceptor(descriptor, factory, tls_factory,
+                                    on_trace_packet);
+}
+
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/internal/checked_scope.cc
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/checked_scope.h"
+
+#include <utility>
+
+namespace perfetto {
+namespace internal {
+
+#if PERFETTO_DCHECK_IS_ON()
+CheckedScope::CheckedScope(CheckedScope* parent_scope)
+    : parent_scope_(parent_scope) {
+  if (parent_scope_) {
+    PERFETTO_DCHECK(parent_scope_->is_active());
+    parent_scope_->set_is_active(false);
+  }
+}
+
+CheckedScope::~CheckedScope() {
+  Reset();
+}
+
+void CheckedScope::Reset() {
+  if (!is_active_) {
+    // The only case when inactive scope could be destroyed is when Reset() was
+    // called explicitly or the contents of the object were moved away.
+    PERFETTO_DCHECK(deleted_);
+    return;
+  }
+  is_active_ = false;
+  deleted_ = true;
+  if (parent_scope_)
+    parent_scope_->set_is_active(true);
+}
+
+CheckedScope::CheckedScope(CheckedScope&& other) {
+  *this = std::move(other);
+}
+
+CheckedScope& CheckedScope::operator=(CheckedScope&& other) {
+  is_active_ = other.is_active_;
+  parent_scope_ = other.parent_scope_;
+  deleted_ = other.deleted_;
+
+  other.is_active_ = false;
+  other.parent_scope_ = nullptr;
+  other.deleted_ = true;
+
+  return *this;
+}
+#endif
+
+}  // namespace internal
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/internal/interceptor_trace_writer.cc
+// gen_amalgamated begin header: include/perfetto/tracing/internal/interceptor_trace_writer.h
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_INTERNAL_INTERCEPTOR_TRACE_WRITER_H_
+#define INCLUDE_PERFETTO_TRACING_INTERNAL_INTERCEPTOR_TRACE_WRITER_H_
+
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/interceptor.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/basic_types.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/trace_writer_base.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/trace_packet.pbzero.h"
+
+namespace perfetto {
+namespace internal {
+
+// A heap-backed trace writer used to reroute trace packets to an interceptor.
+class InterceptorTraceWriter : public TraceWriterBase {
+ public:
+  InterceptorTraceWriter(std::unique_ptr<InterceptorBase::ThreadLocalState> tls,
+                         InterceptorBase::TracePacketCallback packet_callback,
+                         DataSourceStaticState* static_state,
+                         uint32_t instance_index);
+  ~InterceptorTraceWriter() override;
+
+  // TraceWriterBase implementation.
+  protozero::MessageHandle<protos::pbzero::TracePacket> NewTracePacket()
+      override;
+  void Flush(std::function<void()> callback = {}) override;
+  uint64_t written() const override;
+
+ private:
+  std::unique_ptr<InterceptorBase::ThreadLocalState> tls_;
+  InterceptorBase::TracePacketCallback packet_callback_;
+
+  protozero::HeapBuffered<protos::pbzero::TracePacket> cur_packet_;
+  uint64_t bytes_written_ = 0;
+
+  // Static state of the data source we are intercepting.
+  DataSourceStaticState* const static_state_;
+
+  // Index of the data source tracing session which we are intercepting
+  // (0...kMaxDataSourceInstances - 1). Used to look up this interceptor's
+  // session state (i.e., the Interceptor class instance) in the
+  // DataSourceStaticState::instances array.
+  const uint32_t instance_index_;
+
+  const uint32_t sequence_id_;
+
+  static std::atomic<uint32_t> next_sequence_id_;
+};
+
+}  // namespace internal
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_INTERNAL_INTERCEPTOR_TRACE_WRITER_H_
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/interceptor_trace_writer.h"
+
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/trace_writer.h"
+
+namespace perfetto {
+namespace internal {
+
+// static
+std::atomic<uint32_t> InterceptorTraceWriter::next_sequence_id_{};
+
+InterceptorTraceWriter::InterceptorTraceWriter(
+    std::unique_ptr<InterceptorBase::ThreadLocalState> tls,
+    InterceptorBase::TracePacketCallback packet_callback,
+    DataSourceStaticState* static_state,
+    uint32_t instance_index)
+    : tls_(std::move(tls)),
+      packet_callback_(std::move(packet_callback)),
+      static_state_(static_state),
+      instance_index_(instance_index),
+      sequence_id_(++next_sequence_id_) {}
+
+InterceptorTraceWriter::~InterceptorTraceWriter() = default;
+
+protozero::MessageHandle<protos::pbzero::TracePacket>
+InterceptorTraceWriter::NewTracePacket() {
+  Flush();
+  auto packet = TraceWriter::TracePacketHandle(cur_packet_.get());
+  packet->set_trusted_packet_sequence_id(sequence_id_);
+  return packet;
+}
+
+void InterceptorTraceWriter::Flush(std::function<void()> callback) {
+  if (!cur_packet_.empty()) {
+    InterceptorBase::TracePacketCallbackArgs args{};
+    args.static_state = static_state_;
+    args.instance_index = instance_index_;
+    args.tls = tls_.get();
+
+    const auto& slices = cur_packet_.GetSlices();
+    if (slices.size() == 1) {
+      // Fast path: the current packet fits into a single slice.
+      auto slice_range = slices.begin()->GetUsedRange();
+      args.packet_data = protozero::ConstBytes{
+          slice_range.begin,
+          static_cast<size_t>(slice_range.end - slice_range.begin)};
+      bytes_written_ += static_cast<uint64_t>(args.packet_data.size);
+      packet_callback_(std::move(args));
+    } else {
+      // Fallback: stitch together multiple slices.
+      auto stitched_data = cur_packet_.SerializeAsArray();
+      args.packet_data =
+          protozero::ConstBytes{stitched_data.data(), stitched_data.size()};
+      bytes_written_ += static_cast<uint64_t>(stitched_data.size());
+      packet_callback_(std::move(args));
+    }
+    cur_packet_.Reset();
+  }
+  if (callback)
+    callback();
+}
+
+uint64_t InterceptorTraceWriter::written() const {
+  return bytes_written_;
+}
+
+}  // namespace internal
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/internal/tracing_backend_fake.cc
+// gen_amalgamated begin header: include/perfetto/tracing/internal/tracing_backend_fake.h
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_INTERNAL_TRACING_BACKEND_FAKE_H_
+#define INCLUDE_PERFETTO_TRACING_INTERNAL_TRACING_BACKEND_FAKE_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/tracing_backend.h"
+
+namespace perfetto {
+namespace internal {
+
+// A built-in implementation of TracingBackend that fails any attempt to create
+// a tracing session.
+class PERFETTO_EXPORT TracingBackendFake : public TracingBackend {
+ public:
+  static TracingBackend* GetInstance();
+
+  // TracingBackend implementation.
+  std::unique_ptr<ProducerEndpoint> ConnectProducer(
+      const ConnectProducerArgs&) override;
+  std::unique_ptr<ConsumerEndpoint> ConnectConsumer(
+      const ConnectConsumerArgs&) override;
+
+ private:
+  TracingBackendFake();
+};
+
+}  // namespace internal
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_INTERNAL_TRACING_BACKEND_FAKE_H_
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/tracing_backend_fake.h"
+
+// gen_amalgamated expanded: #include "perfetto/base/task_runner.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/weak_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/consumer.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/producer.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/trace_writer.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/tracing_service.h"
+
+namespace perfetto {
+namespace internal {
+
+namespace {
+
+class UnsupportedProducerEndpoint : public ProducerEndpoint {
+ public:
+  UnsupportedProducerEndpoint(Producer* producer, base::TaskRunner* task_runner)
+      : producer_(producer), task_runner_(task_runner) {
+    // The SDK will attempt to reconnect the producer, so instead we allow it
+    // to connect successfully, but never start any sessions.
+    auto weak_ptr = weak_ptr_factory_.GetWeakPtr();
+    task_runner_->PostTask([weak_ptr] {
+      if (weak_ptr)
+        weak_ptr->producer_->OnConnect();
+    });
+  }
+  ~UnsupportedProducerEndpoint() override { producer_->OnDisconnect(); }
+
+  void RegisterDataSource(const DataSourceDescriptor&) override {}
+  void UnregisterDataSource(const std::string& /*name*/) override {}
+
+  void RegisterTraceWriter(uint32_t /*writer_id*/,
+                           uint32_t /*target_buffer*/) override {}
+  void UnregisterTraceWriter(uint32_t /*writer_id*/) override {}
+
+  void CommitData(const CommitDataRequest&,
+                  CommitDataCallback callback = {}) override {
+    callback();
+  }
+
+  SharedMemory* shared_memory() const override { return nullptr; }
+  size_t shared_buffer_page_size_kb() const override { return 0; }
+
+  std::unique_ptr<TraceWriter> CreateTraceWriter(
+      BufferID /*target_buffer*/,
+      BufferExhaustedPolicy = BufferExhaustedPolicy::kDefault) override {
+    return nullptr;
+  }
+
+  SharedMemoryArbiter* MaybeSharedMemoryArbiter() override { return nullptr; }
+  bool IsShmemProvidedByProducer() const override { return false; }
+
+  void NotifyFlushComplete(FlushRequestID) override {}
+  void NotifyDataSourceStarted(DataSourceInstanceID) override {}
+  void NotifyDataSourceStopped(DataSourceInstanceID) override {}
+  void ActivateTriggers(const std::vector<std::string>&) override {}
+
+  void Sync(std::function<void()> callback) override { callback(); }
+
+ private:
+  Producer* const producer_;
+  base::TaskRunner* const task_runner_;
+  base::WeakPtrFactory<UnsupportedProducerEndpoint> weak_ptr_factory_{
+      this};  // Keep last.
+};
+
+class UnsupportedConsumerEndpoint : public ConsumerEndpoint {
+ public:
+  UnsupportedConsumerEndpoint(Consumer* consumer, base::TaskRunner* task_runner)
+      : consumer_(consumer), task_runner_(task_runner) {
+    // The SDK will not to reconnect the consumer, so we just disconnect it
+    // immediately, which will cancel the tracing session.
+    auto weak_this = weak_ptr_factory_.GetWeakPtr();
+    task_runner_->PostTask([weak_this] {
+      if (weak_this)
+        weak_this->consumer_->OnDisconnect();
+    });
+  }
+  ~UnsupportedConsumerEndpoint() override = default;
+
+  void EnableTracing(const TraceConfig&,
+                     base::ScopedFile = base::ScopedFile()) override {}
+  void ChangeTraceConfig(const TraceConfig&) override {}
+
+  void StartTracing() override {}
+  void DisableTracing() override {}
+
+  void Flush(uint32_t /*timeout_ms*/, FlushCallback callback) override {
+    callback(/*success=*/false);
+  }
+
+  void ReadBuffers() override {}
+  void FreeBuffers() override {}
+
+  void Detach(const std::string& /*key*/) override {}
+  void Attach(const std::string& /*key*/) override {}
+
+  void GetTraceStats() override {}
+  void ObserveEvents(uint32_t /*events_mask*/) override {}
+  void QueryServiceState(QueryServiceStateCallback) override {}
+  void QueryCapabilities(QueryCapabilitiesCallback) override {}
+
+  void SaveTraceForBugreport(SaveTraceForBugreportCallback) override {}
+
+ private:
+  Consumer* const consumer_;
+  base::TaskRunner* const task_runner_;
+  base::WeakPtrFactory<UnsupportedConsumerEndpoint> weak_ptr_factory_{
+      this};  // Keep last.
+};
+
+}  // namespace
+
+// static
+TracingBackend* TracingBackendFake::GetInstance() {
+  static auto* instance = new TracingBackendFake();
+  return instance;
+}
+
+TracingBackendFake::TracingBackendFake() = default;
+
+std::unique_ptr<ProducerEndpoint> TracingBackendFake::ConnectProducer(
+    const ConnectProducerArgs& args) {
+  return std::unique_ptr<ProducerEndpoint>(
+      new UnsupportedProducerEndpoint(args.producer, args.task_runner));
+}
+
+std::unique_ptr<ConsumerEndpoint> TracingBackendFake::ConnectConsumer(
+    const ConnectConsumerArgs& args) {
+  return std::unique_ptr<ConsumerEndpoint>(
+      new UnsupportedConsumerEndpoint(args.consumer, args.task_runner));
+}
+
+}  // namespace internal
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/internal/tracing_muxer_fake.cc
+// gen_amalgamated begin header: src/tracing/internal/tracing_muxer_fake.h
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SRC_TRACING_INTERNAL_TRACING_MUXER_FAKE_H_
+#define SRC_TRACING_INTERNAL_TRACING_MUXER_FAKE_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/compiler.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/tracing_muxer.h"
+
+namespace perfetto {
+namespace internal {
+
+// An always-fail implementation of TracingMuxer. Before tracing has been
+// initialiazed, all muxer operations will route here and fail with a helpful
+// error message. This is to avoid introducing null checks in
+// performance-critical parts of the codebase.
+class TracingMuxerFake : public TracingMuxer {
+  class FakePlatform : public Platform {
+   public:
+    ~FakePlatform() override;
+    ThreadLocalObject* GetOrCreateThreadLocalObject() override;
+    std::unique_ptr<base::TaskRunner> CreateTaskRunner(
+        const CreateTaskRunnerArgs&) override;
+    std::string GetCurrentProcessName() override;
+
+    static FakePlatform instance;
+  };
+
+ public:
+  TracingMuxerFake() : TracingMuxer(&FakePlatform::instance) {}
+
+  static constexpr TracingMuxerFake* Get() {
+#if PERFETTO_HAS_NO_DESTROY()
+    return &instance;
+#else
+    return nullptr;
+#endif
+  }
+
+  // TracingMuxer implementation.
+  bool RegisterDataSource(const DataSourceDescriptor&,
+                          DataSourceFactory,
+                          DataSourceStaticState*) override;
+  std::unique_ptr<TraceWriterBase> CreateTraceWriter(
+      DataSourceStaticState*,
+      uint32_t data_source_instance_index,
+      DataSourceState*,
+      BufferExhaustedPolicy buffer_exhausted_policy) override;
+  void DestroyStoppedTraceWritersForCurrentThread() override;
+  void RegisterInterceptor(const InterceptorDescriptor&,
+                           InterceptorFactory,
+                           InterceptorBase::TLSFactory,
+                           InterceptorBase::TracePacketCallback) override;
+
+ private:
+  static TracingMuxerFake instance;
+};
+
+}  // namespace internal
+}  // namespace perfetto
+
+#endif  // SRC_TRACING_INTERNAL_TRACING_MUXER_FAKE_H_
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "src/tracing/internal/tracing_muxer_fake.h"
+
+namespace perfetto {
+namespace internal {
+namespace {
+
+PERFETTO_NORETURN void FailUninitialized() {
+  PERFETTO_FATAL(
+      "Tracing not initialized. Call perfetto::Tracing::Initialize() first.");
+}
+
+}  // namespace
+
+#if PERFETTO_HAS_NO_DESTROY()
+// static
+PERFETTO_NO_DESTROY TracingMuxerFake::FakePlatform
+    TracingMuxerFake::FakePlatform::instance{};
+// static
+PERFETTO_NO_DESTROY TracingMuxerFake TracingMuxerFake::instance{};
+#endif  // PERFETTO_HAS_NO_DESTROY()
+
+TracingMuxerFake::FakePlatform::~FakePlatform() = default;
+
+Platform::ThreadLocalObject*
+TracingMuxerFake::FakePlatform::GetOrCreateThreadLocalObject() {
+  FailUninitialized();
+}
+
+std::unique_ptr<base::TaskRunner>
+TracingMuxerFake::FakePlatform::CreateTaskRunner(const CreateTaskRunnerArgs&) {
+  FailUninitialized();
+}
+
+std::string TracingMuxerFake::FakePlatform::GetCurrentProcessName() {
+  FailUninitialized();
+}
+
+bool TracingMuxerFake::RegisterDataSource(const DataSourceDescriptor&,
+                                          DataSourceFactory,
+                                          DataSourceStaticState*) {
+  FailUninitialized();
+}
+
+std::unique_ptr<TraceWriterBase> TracingMuxerFake::CreateTraceWriter(
+    DataSourceStaticState*,
+    uint32_t,
+    DataSourceState*,
+    BufferExhaustedPolicy) {
+  FailUninitialized();
+}
+
+void TracingMuxerFake::DestroyStoppedTraceWritersForCurrentThread() {
+  FailUninitialized();
+}
+
+void TracingMuxerFake::RegisterInterceptor(
+    const InterceptorDescriptor&,
+    InterceptorFactory,
+    InterceptorBase::TLSFactory,
+    InterceptorBase::TracePacketCallback) {
+  FailUninitialized();
+}
+
+}  // namespace internal
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/internal/tracing_muxer_impl.cc
+// gen_amalgamated begin header: src/tracing/internal/tracing_muxer_impl.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SRC_TRACING_INTERNAL_TRACING_MUXER_IMPL_H_
+#define SRC_TRACING_INTERNAL_TRACING_MUXER_IMPL_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include <array>
+#include <atomic>
+#include <bitset>
+#include <list>
+#include <map>
+#include <memory>
+#include <vector>
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/scoped_file.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/thread_checker.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/basic_types.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/consumer.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/producer.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/data_source_descriptor.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/forward_decls.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/trace_config.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/basic_types.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/tracing_muxer.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/tracing.h"
+
+// gen_amalgamated expanded: #include "protos/perfetto/common/interceptor_descriptor.gen.h"
+
+namespace perfetto {
+
+class ConsumerEndpoint;
+class DataSourceBase;
+class ProducerEndpoint;
+class TraceWriterBase;
+class TracingBackend;
+class TracingSession;
+struct TracingInitArgs;
+
+namespace base {
+class TaskRunner;
+}
+
+namespace internal {
+
+struct DataSourceStaticState;
+
+// This class acts as a bridge between the public API and the TracingBackend(s).
+// It exposes a simplified view of the world to the API methods handling all the
+// bookkeeping to map data source instances and trace writers to the various
+// backends. It deals with N data sources, M backends (1 backend == 1 tracing
+// service == 1 producer connection) and T concurrent tracing sessions.
+//
+// Handing data source registration and start/stop flows [producer side]:
+// ----------------------------------------------------------------------
+// 1. The API client subclasses perfetto::DataSource and calls
+//    DataSource::Register<MyDataSource>(). In turn this calls into the
+//    TracingMuxer.
+// 2. The tracing muxer iterates through all the backends (1 backend == 1
+//    service == 1 producer connection) and registers the data source on each
+//    backend.
+// 3. When any (services behind a) backend starts tracing and requests to start
+//    that specific data source, the TracingMuxerImpl constructs a new instance
+//    of MyDataSource and calls the OnStart() method.
+//
+// Controlling trace and retrieving trace data [consumer side]:
+// ------------------------------------------------------------
+// 1. The API client calls Tracing::NewTrace(), returns a RAII TracingSession
+//    object.
+// 2. NewTrace() calls into internal::TracingMuxer(Impl). TracingMuxer
+//    subclasses the TracingSession object (TracingSessionImpl) and returns it.
+// 3. The tracing muxer identifies the backend (according to the args passed to
+//    NewTrace), creates a new Consumer and connects to it.
+// 4. When the API client calls Start()/Stop()/ReadTrace() methods, the
+//    TracingMuxer forwards them to the consumer associated to the
+//    TracingSession. Likewise for callbacks coming from the consumer-side of
+//    the service.
+class TracingMuxerImpl : public TracingMuxer {
+ public:
+  // This is different than TracingSessionID because it's global across all
+  // backends. TracingSessionID is global only within the scope of one service.
+  using TracingSessionGlobalID = uint64_t;
+
+  static void InitializeInstance(const TracingInitArgs&);
+
+  // TracingMuxer implementation.
+  bool RegisterDataSource(const DataSourceDescriptor&,
+                          DataSourceFactory,
+                          DataSourceStaticState*) override;
+  std::unique_ptr<TraceWriterBase> CreateTraceWriter(
+      DataSourceStaticState*,
+      uint32_t data_source_instance_index,
+      DataSourceState*,
+      BufferExhaustedPolicy buffer_exhausted_policy) override;
+  void DestroyStoppedTraceWritersForCurrentThread() override;
+  void RegisterInterceptor(const InterceptorDescriptor&,
+                           InterceptorFactory,
+                           InterceptorBase::TLSFactory,
+                           InterceptorBase::TracePacketCallback) override;
+
+  std::unique_ptr<TracingSession> CreateTracingSession(BackendType);
+
+  // Producer-side bookkeeping methods.
+  void UpdateDataSourcesOnAllBackends();
+  void SetupDataSource(TracingBackendId,
+                       uint32_t backend_connection_id,
+                       DataSourceInstanceID,
+                       const DataSourceConfig&);
+  void StartDataSource(TracingBackendId, DataSourceInstanceID);
+  void StopDataSource_AsyncBegin(TracingBackendId, DataSourceInstanceID);
+  void StopDataSource_AsyncEnd(TracingBackendId, DataSourceInstanceID);
+  void ClearDataSourceIncrementalState(TracingBackendId, DataSourceInstanceID);
+  void SyncProducersForTesting();
+
+  // Consumer-side bookkeeping methods.
+  void SetupTracingSession(TracingSessionGlobalID,
+                           const std::shared_ptr<TraceConfig>&,
+                           base::ScopedFile trace_fd = base::ScopedFile());
+  void StartTracingSession(TracingSessionGlobalID);
+  void ChangeTracingSessionConfig(TracingSessionGlobalID, const TraceConfig&);
+  void StopTracingSession(TracingSessionGlobalID);
+  void DestroyTracingSession(TracingSessionGlobalID);
+  void FlushTracingSession(TracingSessionGlobalID,
+                           uint32_t,
+                           std::function<void(bool)>);
+  void ReadTracingSessionData(
+      TracingSessionGlobalID,
+      std::function<void(TracingSession::ReadTraceCallbackArgs)>);
+  void GetTraceStats(TracingSessionGlobalID,
+                     TracingSession::GetTraceStatsCallback);
+  void QueryServiceState(TracingSessionGlobalID,
+                         TracingSession::QueryServiceStateCallback);
+
+  // Sets the batching period to |batch_commits_duration_ms| on the backends
+  // with type |backend_type|.
+  void SetBatchCommitsDurationForTesting(uint32_t batch_commits_duration_ms,
+                                         BackendType backend_type);
+
+  // Enables direct SMB patching on the backends with type |backend_type| (see
+  // SharedMemoryArbiter::EnableDirectSMBPatching). Returns true if the
+  // operation succeeded for all backends with type |backend_type|, false
+  // otherwise.
+  bool EnableDirectSMBPatchingForTesting(BackendType backend_type);
+
+  void SetMaxProducerReconnectionsForTesting(uint32_t count);
+
+ private:
+  // For each TracingBackend we create and register one ProducerImpl instance.
+  // This talks to the producer-side of the service, gets start/stop requests
+  // from it and routes them to the registered data sources.
+  // One ProducerImpl == one backend == one tracing service.
+  // This class is needed to disambiguate callbacks coming from different
+  // services. TracingMuxerImpl can't directly implement the Producer interface
+  // because the Producer virtual methods don't allow to identify the service.
+  class ProducerImpl : public Producer {
+   public:
+    ProducerImpl(TracingMuxerImpl*,
+                 TracingBackendId,
+                 uint32_t shmem_batch_commits_duration_ms);
+    ~ProducerImpl() override;
+
+    void Initialize(std::unique_ptr<ProducerEndpoint> endpoint);
+    void RegisterDataSource(const DataSourceDescriptor&,
+                            DataSourceFactory,
+                            DataSourceStaticState*);
+
+    // perfetto::Producer implementation.
+    void OnConnect() override;
+    void OnDisconnect() override;
+    void OnTracingSetup() override;
+    void SetupDataSource(DataSourceInstanceID,
+                         const DataSourceConfig&) override;
+    void StartDataSource(DataSourceInstanceID,
+                         const DataSourceConfig&) override;
+    void StopDataSource(DataSourceInstanceID) override;
+    void Flush(FlushRequestID, const DataSourceInstanceID*, size_t) override;
+    void ClearIncrementalState(const DataSourceInstanceID*, size_t) override;
+
+    void SweepDeadServices();
+
+    PERFETTO_THREAD_CHECKER(thread_checker_)
+    TracingMuxerImpl* const muxer_;
+    TracingBackendId const backend_id_;
+    bool connected_ = false;
+    uint32_t connection_id_ = 0;
+
+    const uint32_t shmem_batch_commits_duration_ms_ = 0;
+
+    // Set of data sources that have been actually registered on this producer.
+    // This can be a subset of the global |data_sources_|, because data sources
+    // can register before the producer is fully connected.
+    std::bitset<kMaxDataSources> registered_data_sources_{};
+
+    // A collection of disconnected service endpoints. Since trace writers on
+    // arbitrary threads might continue writing data to disconnected services,
+    // we keep the old services around and periodically try to clean up ones
+    // that no longer have any writers (see SweepDeadServices).
+    std::list<std::shared_ptr<ProducerEndpoint>> dead_services_;
+
+    // The currently active service endpoint is maintained as an atomic shared
+    // pointer so it won't get deleted from underneath threads that are creating
+    // trace writers. At any given time one endpoint can be shared (and thus
+    // kept alive) by the |service_| pointer, an entry in |dead_services_| and
+    // as a pointer on the stack in CreateTraceWriter() (on an arbitrary
+    // thread). The endpoint is never shared outside ProducerImpl itself.
+    //
+    // WARNING: Any *write* access to this variable or any *read* access from a
+    // non-muxer thread must be done through std::atomic_{load,store} to avoid
+    // data races.
+    std::shared_ptr<ProducerEndpoint> service_;  // Keep last.
+  };
+
+  // For each TracingSession created by the API client (Tracing::NewTrace() we
+  // create and register one ConsumerImpl instance.
+  // This talks to the consumer-side of the service, gets end-of-trace and
+  // on-trace-data callbacks and routes them to the API client callbacks.
+  // This class is needed to disambiguate callbacks coming from different
+  // tracing sessions.
+  class ConsumerImpl : public Consumer {
+   public:
+    ConsumerImpl(TracingMuxerImpl*,
+                 BackendType,
+                 TracingBackendId,
+                 TracingSessionGlobalID);
+    ~ConsumerImpl() override;
+
+    void Initialize(std::unique_ptr<ConsumerEndpoint> endpoint);
+
+    // perfetto::Consumer implementation.
+    void OnConnect() override;
+    void OnDisconnect() override;
+    void OnTracingDisabled(const std::string& error) override;
+    void OnTraceData(std::vector<TracePacket>, bool has_more) override;
+    void OnDetach(bool success) override;
+    void OnAttach(bool success, const TraceConfig&) override;
+    void OnTraceStats(bool success, const TraceStats&) override;
+    void OnObservableEvents(const ObservableEvents&) override;
+
+    void NotifyStartComplete();
+    void NotifyError(const TracingError&);
+    void NotifyStopComplete();
+
+    // Will eventually inform the |muxer_| when it is safe to remove |this|.
+    void Disconnect();
+
+    TracingMuxerImpl* const muxer_;
+    BackendType const backend_type_;
+    TracingBackendId const backend_id_;
+    TracingSessionGlobalID const session_id_;
+    bool connected_ = false;
+
+    // This is to handle the case where the Setup call from the API client
+    // arrives before the consumer has connected. In this case we keep around
+    // the config and check if we have it after connection.
+    bool start_pending_ = false;
+
+    // Similarly if the session is stopped before the consumer was connected, we
+    // need to wait until the session has started before stopping it.
+    bool stop_pending_ = false;
+
+    // Similarly we need to buffer a call to get trace statistics if the
+    // consumer wasn't connected yet.
+    bool get_trace_stats_pending_ = false;
+
+    // Whether this session was already stopped. This will happen in response to
+    // Stop{,Blocking}, but also if the service stops the session for us
+    // automatically (e.g., when there are no data sources).
+    bool stopped_ = false;
+
+    // shared_ptr because it's posted across threads. This is to avoid copying
+    // it more than once.
+    std::shared_ptr<TraceConfig> trace_config_;
+    base::ScopedFile trace_fd_;
+
+    // If the API client passes a callback to start, we should invoke this when
+    // NotifyStartComplete() is invoked.
+    std::function<void()> start_complete_callback_;
+
+    // An internal callback used to implement StartBlocking().
+    std::function<void()> blocking_start_complete_callback_;
+
+    // If the API client passes a callback to get notification about the
+    // errors, we should invoke this when NotifyError() is invoked.
+    std::function<void(TracingError)> error_callback_;
+
+    // If the API client passes a callback to stop, we should invoke this when
+    // OnTracingDisabled() is invoked.
+    std::function<void()> stop_complete_callback_;
+
+    // An internal callback used to implement StopBlocking().
+    std::function<void()> blocking_stop_complete_callback_;
+
+    // Callback passed to ReadTrace().
+    std::function<void(TracingSession::ReadTraceCallbackArgs)>
+        read_trace_callback_;
+
+    // Callback passed to GetTraceStats().
+    TracingSession::GetTraceStatsCallback get_trace_stats_callback_;
+
+    // Callback for a pending call to QueryServiceState().
+    TracingSession::QueryServiceStateCallback query_service_state_callback_;
+
+    // The states of all data sources in this tracing session. |true| means the
+    // data source has started tracing.
+    using DataSourceHandle = std::pair<std::string, std::string>;
+    std::map<DataSourceHandle, bool> data_source_states_;
+
+    std::unique_ptr<ConsumerEndpoint> service_;  // Keep before last.
+    PERFETTO_THREAD_CHECKER(thread_checker_)     // Keep last.
+  };
+
+  // This object is returned to API clients when they call
+  // Tracing::CreateTracingSession().
+  class TracingSessionImpl : public TracingSession {
+   public:
+    TracingSessionImpl(TracingMuxerImpl*, TracingSessionGlobalID, BackendType);
+    ~TracingSessionImpl() override;
+    void Setup(const TraceConfig&, int fd) override;
+    void Start() override;
+    void StartBlocking() override;
+    void SetOnStartCallback(std::function<void()>) override;
+    void SetOnErrorCallback(std::function<void(TracingError)>) override;
+    void Stop() override;
+    void StopBlocking() override;
+    void Flush(std::function<void(bool)>, uint32_t timeout_ms) override;
+    void ReadTrace(ReadTraceCallback) override;
+    void SetOnStopCallback(std::function<void()>) override;
+    void GetTraceStats(GetTraceStatsCallback) override;
+    void QueryServiceState(QueryServiceStateCallback) override;
+    void ChangeTraceConfig(const TraceConfig&) override;
+
+   private:
+    TracingMuxerImpl* const muxer_;
+    TracingSessionGlobalID const session_id_;
+    BackendType const backend_type_;
+  };
+
+  struct RegisteredDataSource {
+    DataSourceDescriptor descriptor;
+    DataSourceFactory factory{};
+    DataSourceStaticState* static_state = nullptr;
+  };
+
+  struct RegisteredInterceptor {
+    protos::gen::InterceptorDescriptor descriptor;
+    InterceptorFactory factory{};
+    InterceptorBase::TLSFactory tls_factory{};
+    InterceptorBase::TracePacketCallback packet_callback{};
+  };
+
+  struct RegisteredBackend {
+    // Backends are supposed to have static lifetime.
+    TracingBackend* backend = nullptr;
+    TracingBackendId id = 0;
+    BackendType type{};
+
+    TracingBackend::ConnectProducerArgs producer_conn_args;
+    std::unique_ptr<ProducerImpl> producer;
+
+    // The calling code can request more than one concurrently active tracing
+    // session for the same backend. We need to create one consumer per session.
+    std::vector<std::unique_ptr<ConsumerImpl>> consumers;
+  };
+
+  explicit TracingMuxerImpl(const TracingInitArgs&);
+  void Initialize(const TracingInitArgs& args);
+  ConsumerImpl* FindConsumer(TracingSessionGlobalID session_id);
+  void InitializeConsumer(TracingSessionGlobalID session_id);
+  void OnConsumerDisconnected(ConsumerImpl* consumer);
+  void OnProducerDisconnected(ProducerImpl* producer);
+
+  struct FindDataSourceRes {
+    FindDataSourceRes() = default;
+    FindDataSourceRes(DataSourceStaticState* a, DataSourceState* b, uint32_t c)
+        : static_state(a), internal_state(b), instance_idx(c) {}
+    explicit operator bool() const { return !!internal_state; }
+
+    DataSourceStaticState* static_state = nullptr;
+    DataSourceState* internal_state = nullptr;
+    uint32_t instance_idx = 0;
+  };
+  FindDataSourceRes FindDataSource(TracingBackendId, DataSourceInstanceID);
+
+  std::unique_ptr<base::TaskRunner> task_runner_;
+  std::vector<RegisteredDataSource> data_sources_;
+  std::vector<RegisteredBackend> backends_;
+  std::vector<RegisteredInterceptor> interceptors_;
+  TracingPolicy* policy_ = nullptr;
+
+  std::atomic<TracingSessionGlobalID> next_tracing_session_id_{};
+
+  // Maximum number of times we will try to reconnect producer backend.
+  // Should only be modified for testing purposes.
+  std::atomic<uint32_t> max_producer_reconnections_{100u};
+
+  PERFETTO_THREAD_CHECKER(thread_checker_)
+};
+
+}  // namespace internal
+}  // namespace perfetto
+
+#endif  // SRC_TRACING_INTERNAL_TRACING_MUXER_IMPL_H_
+// gen_amalgamated begin header: include/perfetto/ext/tracing/core/trace_stats.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_TRACING_CORE_TRACE_STATS_H_
+#define INCLUDE_PERFETTO_EXT_TRACING_CORE_TRACE_STATS_H_
+
+// Creates the aliases in the ::perfetto namespace, doing things like:
+// using ::perfetto::Foo = ::perfetto::protos::gen::Foo.
+// See comments in forward_decls.h for the historical reasons of this
+// indirection layer.
+// gen_amalgamated expanded: #include "perfetto/tracing/core/forward_decls.h"
+
+// gen_amalgamated expanded: #include "protos/perfetto/common/trace_stats.gen.h"
+
+#endif  // INCLUDE_PERFETTO_EXT_TRACING_CORE_TRACE_STATS_H_
+// gen_amalgamated begin header: include/perfetto/tracing/core/tracing_service_state.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef INCLUDE_PERFETTO_TRACING_CORE_TRACING_SERVICE_STATE_H_
+#define INCLUDE_PERFETTO_TRACING_CORE_TRACING_SERVICE_STATE_H_
+
+// Creates the aliases in the ::perfetto namespace, doing things like:
+// using ::perfetto::Foo = ::perfetto::protos::gen::Foo.
+// See comments in forward_decls.h for the historical reasons of this
+// indirection layer.
+// gen_amalgamated expanded: #include "perfetto/tracing/core/forward_decls.h"
+
+// gen_amalgamated expanded: #include "protos/perfetto/common/tracing_service_state.gen.h"
+
+#endif  // INCLUDE_PERFETTO_TRACING_CORE_TRACING_SERVICE_STATE_H_
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "src/tracing/internal/tracing_muxer_impl.h"
+
+#include <algorithm>
+#include <atomic>
+#include <mutex>
+#include <vector>
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/base/task_runner.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/hash.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/thread_checker.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/waitable_event.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/shared_memory_arbiter.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/trace_packet.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/trace_stats.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/trace_writer.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/tracing_service.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/buffer_exhausted_policy.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/data_source_config.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/tracing_service_state.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/data_source.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/data_source_internal.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/interceptor_trace_writer.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/tracing_backend_fake.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/trace_writer_base.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/tracing.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/tracing_backend.h"
+
+// gen_amalgamated expanded: #include "protos/perfetto/config/interceptor_config.gen.h"
+
+// gen_amalgamated expanded: #include "src/tracing/internal/tracing_muxer_fake.h"
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+#include <io.h>  // For dup()
+#else
+#include <unistd.h>  // For dup()
+#endif
+
+namespace perfetto {
+namespace internal {
+
+namespace {
+
+// A task runner which prevents calls to DataSource::Trace() while an operation
+// is in progress. Used to guard against unexpected re-entrancy where the
+// user-provided task runner implementation tries to enter a trace point under
+// the hood.
+class NonReentrantTaskRunner : public base::TaskRunner {
+ public:
+  NonReentrantTaskRunner(TracingMuxer* muxer,
+                         std::unique_ptr<base::TaskRunner> task_runner)
+      : muxer_(muxer), task_runner_(std::move(task_runner)) {}
+
+  // base::TaskRunner implementation.
+  void PostTask(std::function<void()> task) override {
+    CallWithGuard([&] { task_runner_->PostTask(std::move(task)); });
+  }
+
+  void PostDelayedTask(std::function<void()> task, uint32_t delay_ms) override {
+    CallWithGuard(
+        [&] { task_runner_->PostDelayedTask(std::move(task), delay_ms); });
+  }
+
+  void AddFileDescriptorWatch(base::PlatformHandle fd,
+                              std::function<void()> callback) override {
+    CallWithGuard(
+        [&] { task_runner_->AddFileDescriptorWatch(fd, std::move(callback)); });
+  }
+
+  void RemoveFileDescriptorWatch(base::PlatformHandle fd) override {
+    CallWithGuard([&] { task_runner_->RemoveFileDescriptorWatch(fd); });
+  }
+
+  bool RunsTasksOnCurrentThread() const override {
+    bool result;
+    CallWithGuard([&] { result = task_runner_->RunsTasksOnCurrentThread(); });
+    return result;
+  }
+
+ private:
+  template <typename T>
+  void CallWithGuard(T lambda) const {
+    auto* root_tls = muxer_->GetOrCreateTracingTLS();
+    if (PERFETTO_UNLIKELY(root_tls->is_in_trace_point)) {
+      lambda();
+      return;
+    }
+    ScopedReentrancyAnnotator scoped_annotator(*root_tls);
+    lambda();
+  }
+
+  TracingMuxer* const muxer_;
+  std::unique_ptr<base::TaskRunner> task_runner_;
+};
+
+class StopArgsImpl : public DataSourceBase::StopArgs {
+ public:
+  std::function<void()> HandleStopAsynchronously() const override {
+    auto closure = std::move(async_stop_closure);
+    async_stop_closure = std::function<void()>();
+    return closure;
+  }
+
+  mutable std::function<void()> async_stop_closure;
+};
+
+uint64_t ComputeConfigHash(const DataSourceConfig& config) {
+  base::Hash hasher;
+  std::string config_bytes = config.SerializeAsString();
+  hasher.Update(config_bytes.data(), config_bytes.size());
+  return hasher.digest();
+}
+
+}  // namespace
+
+// ----- Begin of TracingMuxerImpl::ProducerImpl
+TracingMuxerImpl::ProducerImpl::ProducerImpl(
+    TracingMuxerImpl* muxer,
+    TracingBackendId backend_id,
+    uint32_t shmem_batch_commits_duration_ms)
+    : muxer_(muxer),
+      backend_id_(backend_id),
+      shmem_batch_commits_duration_ms_(shmem_batch_commits_duration_ms) {}
+
+TracingMuxerImpl::ProducerImpl::~ProducerImpl() = default;
+
+void TracingMuxerImpl::ProducerImpl::Initialize(
+    std::unique_ptr<ProducerEndpoint> endpoint) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  PERFETTO_DCHECK(!connected_);
+  connection_id_++;
+
+  // Adopt the endpoint into a shared pointer so that we can safely share it
+  // across threads that create trace writers. The custom deleter function
+  // ensures that the endpoint is always destroyed on the muxer's thread. (Note
+  // that |task_runner| is assumed to outlive tracing sessions on all threads.)
+  auto* task_runner = muxer_->task_runner_.get();
+  auto deleter = [task_runner](ProducerEndpoint* e) {
+    task_runner->PostTask([e] { delete e; });
+  };
+  std::shared_ptr<ProducerEndpoint> service(endpoint.release(), deleter);
+  // This atomic store is needed because another thread might be concurrently
+  // creating a trace writer using the previous (disconnected) |service_|. See
+  // CreateTraceWriter().
+  std::atomic_store(&service_, std::move(service));
+  // Don't try to use the service here since it may not have connected yet. See
+  // OnConnect().
+}
+
+void TracingMuxerImpl::ProducerImpl::OnConnect() {
+  PERFETTO_DLOG("Producer connected");
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  PERFETTO_DCHECK(!connected_);
+  connected_ = true;
+  muxer_->UpdateDataSourcesOnAllBackends();
+}
+
+void TracingMuxerImpl::ProducerImpl::OnDisconnect() {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  connected_ = false;
+  // Active data sources for this producer will be stopped by
+  // DestroyStoppedTraceWritersForCurrentThread() since the reconnected producer
+  // will have a different connection id (even before it has finished
+  // connecting).
+  registered_data_sources_.reset();
+  // Keep the old service around as a dead connection in case it has active
+  // trace writers. We can't clear |service_| here because other threads may be
+  // concurrently creating new trace writers. The reconnection below will
+  // atomically swap the new service in place of the old one.
+  dead_services_.push_back(service_);
+  // Try reconnecting the producer.
+  muxer_->OnProducerDisconnected(this);
+}
+
+void TracingMuxerImpl::ProducerImpl::OnTracingSetup() {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  service_->MaybeSharedMemoryArbiter()->SetBatchCommitsDuration(
+      shmem_batch_commits_duration_ms_);
+}
+
+void TracingMuxerImpl::ProducerImpl::SetupDataSource(
+    DataSourceInstanceID id,
+    const DataSourceConfig& cfg) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  muxer_->SetupDataSource(backend_id_, connection_id_, id, cfg);
+}
+
+void TracingMuxerImpl::ProducerImpl::StartDataSource(DataSourceInstanceID id,
+                                                     const DataSourceConfig&) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  muxer_->StartDataSource(backend_id_, id);
+  service_->NotifyDataSourceStarted(id);
+}
+
+void TracingMuxerImpl::ProducerImpl::StopDataSource(DataSourceInstanceID id) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  muxer_->StopDataSource_AsyncBegin(backend_id_, id);
+}
+
+void TracingMuxerImpl::ProducerImpl::Flush(FlushRequestID flush_id,
+                                           const DataSourceInstanceID*,
+                                           size_t) {
+  // Flush is not plumbed for now, we just ack straight away.
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  service_->NotifyFlushComplete(flush_id);
+}
+
+void TracingMuxerImpl::ProducerImpl::ClearIncrementalState(
+    const DataSourceInstanceID* instances,
+    size_t instance_count) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  for (size_t inst_idx = 0; inst_idx < instance_count; inst_idx++) {
+    muxer_->ClearDataSourceIncrementalState(backend_id_, instances[inst_idx]);
+  }
+}
+
+void TracingMuxerImpl::ProducerImpl::SweepDeadServices() {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  auto is_unused = [](const std::shared_ptr<ProducerEndpoint>& endpoint) {
+    auto* arbiter = endpoint->MaybeSharedMemoryArbiter();
+    return !arbiter || arbiter->TryShutdown();
+  };
+  for (auto it = dead_services_.begin(); it != dead_services_.end();) {
+    auto next_it = it;
+    next_it++;
+    if (is_unused(*it)) {
+      dead_services_.erase(it);
+    }
+    it = next_it;
+  }
+}
+
+// ----- End of TracingMuxerImpl::ProducerImpl methods.
+
+// ----- Begin of TracingMuxerImpl::ConsumerImpl
+TracingMuxerImpl::ConsumerImpl::ConsumerImpl(TracingMuxerImpl* muxer,
+                                             BackendType backend_type,
+                                             TracingBackendId backend_id,
+                                             TracingSessionGlobalID session_id)
+    : muxer_(muxer),
+      backend_type_(backend_type),
+      backend_id_(backend_id),
+      session_id_(session_id) {}
+
+TracingMuxerImpl::ConsumerImpl::~ConsumerImpl() = default;
+
+void TracingMuxerImpl::ConsumerImpl::Initialize(
+    std::unique_ptr<ConsumerEndpoint> endpoint) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  service_ = std::move(endpoint);
+  // Don't try to use the service here since it may not have connected yet. See
+  // OnConnect().
+}
+
+void TracingMuxerImpl::ConsumerImpl::OnConnect() {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  PERFETTO_DCHECK(!connected_);
+  connected_ = true;
+
+  // Observe data source instance events so we get notified when tracing starts.
+  service_->ObserveEvents(ObservableEvents::TYPE_DATA_SOURCES_INSTANCES |
+                          ObservableEvents::TYPE_ALL_DATA_SOURCES_STARTED);
+
+  // If the API client configured and started tracing before we connected,
+  // tell the backend about it now.
+  if (trace_config_)
+    muxer_->SetupTracingSession(session_id_, trace_config_);
+  if (start_pending_)
+    muxer_->StartTracingSession(session_id_);
+  if (get_trace_stats_pending_) {
+    auto callback = std::move(get_trace_stats_callback_);
+    get_trace_stats_callback_ = nullptr;
+    muxer_->GetTraceStats(session_id_, std::move(callback));
+  }
+  if (query_service_state_callback_) {
+    auto callback = std::move(query_service_state_callback_);
+    query_service_state_callback_ = nullptr;
+    muxer_->QueryServiceState(session_id_, std::move(callback));
+  }
+  if (stop_pending_)
+    muxer_->StopTracingSession(session_id_);
+}
+
+void TracingMuxerImpl::ConsumerImpl::OnDisconnect() {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+  if (!connected_ && backend_type_ == kSystemBackend) {
+    PERFETTO_ELOG(
+        "Unable to connect to the system tracing service as a consumer. On "
+        "Android, use the \"perfetto\" command line tool instead to start "
+        "system-wide tracing sessions");
+  }
+#endif  // PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+
+  // Notify the client about disconnection.
+  NotifyError(TracingError{TracingError::kDisconnected, "Peer disconnected"});
+
+  // Make sure the client doesn't hang in a blocking start/stop because of the
+  // disconnection.
+  NotifyStartComplete();
+  NotifyStopComplete();
+
+  // It shouldn't be necessary to call StopTracingSession. If we get this call
+  // it means that the service did shutdown before us, so there is no point
+  // trying it to ask it to stop the session. We should just remember to cleanup
+  // the consumer vector.
+  connected_ = false;
+
+  // Notify the muxer that it is safe to destroy |this|. This is needed because
+  // the ConsumerEndpoint stored in |service_| requires that |this| be safe to
+  // access until OnDisconnect() is called.
+  muxer_->OnConsumerDisconnected(this);
+}
+
+void TracingMuxerImpl::ConsumerImpl::Disconnect() {
+  // This is weird and deserves a comment.
+  //
+  // When we called the ConnectConsumer method on the service it returns
+  // us a ConsumerEndpoint which we stored in |service_|, however this
+  // ConsumerEndpoint holds a pointer to the ConsumerImpl pointed to by
+  // |this|. Part of the API contract to TracingService::ConnectConsumer is that
+  // the ConsumerImpl pointer has to be valid until the
+  // ConsumerImpl::OnDisconnect method is called. Therefore we reset the
+  // ConsumerEndpoint |service_|. Eventually this will call
+  // ConsumerImpl::OnDisconnect and we will inform the muxer it is safe to
+  // call the destructor of |this|.
+  service_.reset();
+}
+
+void TracingMuxerImpl::ConsumerImpl::OnTracingDisabled(
+    const std::string& error) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  PERFETTO_DCHECK(!stopped_);
+  stopped_ = true;
+
+  if (!error.empty())
+    NotifyError(TracingError{TracingError::kTracingFailed, error});
+
+  // If we're still waiting for the start event, fire it now. This may happen if
+  // there are no active data sources in the session.
+  NotifyStartComplete();
+  NotifyStopComplete();
+}
+
+void TracingMuxerImpl::ConsumerImpl::NotifyStartComplete() {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  if (start_complete_callback_) {
+    muxer_->task_runner_->PostTask(std::move(start_complete_callback_));
+    start_complete_callback_ = nullptr;
+  }
+  if (blocking_start_complete_callback_) {
+    muxer_->task_runner_->PostTask(
+        std::move(blocking_start_complete_callback_));
+    blocking_start_complete_callback_ = nullptr;
+  }
+}
+
+void TracingMuxerImpl::ConsumerImpl::NotifyError(const TracingError& error) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  if (error_callback_) {
+    muxer_->task_runner_->PostTask(
+        std::bind(std::move(error_callback_), error));
+  }
+}
+
+void TracingMuxerImpl::ConsumerImpl::NotifyStopComplete() {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  if (stop_complete_callback_) {
+    muxer_->task_runner_->PostTask(std::move(stop_complete_callback_));
+    stop_complete_callback_ = nullptr;
+  }
+  if (blocking_stop_complete_callback_) {
+    muxer_->task_runner_->PostTask(std::move(blocking_stop_complete_callback_));
+    blocking_stop_complete_callback_ = nullptr;
+  }
+}
+
+void TracingMuxerImpl::ConsumerImpl::OnTraceData(
+    std::vector<TracePacket> packets,
+    bool has_more) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  if (!read_trace_callback_)
+    return;
+
+  size_t capacity = 0;
+  for (const auto& packet : packets) {
+    // 16 is an over-estimation of the proto preamble size
+    capacity += packet.size() + 16;
+  }
+
+  // The shared_ptr is to avoid making a copy of the buffer when PostTask-ing.
+  std::shared_ptr<std::vector<char>> buf(new std::vector<char>());
+  buf->reserve(capacity);
+  for (auto& packet : packets) {
+    char* start;
+    size_t size;
+    std::tie(start, size) = packet.GetProtoPreamble();
+    buf->insert(buf->end(), start, start + size);
+    for (auto& slice : packet.slices()) {
+      const auto* slice_data = reinterpret_cast<const char*>(slice.start);
+      buf->insert(buf->end(), slice_data, slice_data + slice.size);
+    }
+  }
+
+  auto callback = read_trace_callback_;
+  muxer_->task_runner_->PostTask([callback, buf, has_more] {
+    TracingSession::ReadTraceCallbackArgs callback_arg{};
+    callback_arg.data = buf->empty() ? nullptr : &(*buf)[0];
+    callback_arg.size = buf->size();
+    callback_arg.has_more = has_more;
+    callback(callback_arg);
+  });
+
+  if (!has_more)
+    read_trace_callback_ = nullptr;
+}
+
+void TracingMuxerImpl::ConsumerImpl::OnObservableEvents(
+    const ObservableEvents& events) {
+  if (events.instance_state_changes_size()) {
+    for (const auto& state_change : events.instance_state_changes()) {
+      DataSourceHandle handle{state_change.producer_name(),
+                              state_change.data_source_name()};
+      data_source_states_[handle] =
+          state_change.state() ==
+          ObservableEvents::DATA_SOURCE_INSTANCE_STATE_STARTED;
+    }
+  }
+
+  if (events.instance_state_changes_size() ||
+      events.all_data_sources_started()) {
+    // Data sources are first reported as being stopped before starting, so once
+    // all the data sources we know about have started we can declare tracing
+    // begun. In the case where there are no matching data sources for the
+    // session, the service will report the all_data_sources_started() event
+    // without adding any instances (only since Android S / Perfetto v10.0).
+    if (start_complete_callback_ || blocking_start_complete_callback_) {
+      bool all_data_sources_started = std::all_of(
+          data_source_states_.cbegin(), data_source_states_.cend(),
+          [](std::pair<DataSourceHandle, bool> state) { return state.second; });
+      if (all_data_sources_started)
+        NotifyStartComplete();
+    }
+  }
+}
+
+void TracingMuxerImpl::ConsumerImpl::OnTraceStats(
+    bool success,
+    const TraceStats& trace_stats) {
+  if (!get_trace_stats_callback_)
+    return;
+  TracingSession::GetTraceStatsCallbackArgs callback_arg{};
+  callback_arg.success = success;
+  callback_arg.trace_stats_data = trace_stats.SerializeAsArray();
+  muxer_->task_runner_->PostTask(
+      std::bind(std::move(get_trace_stats_callback_), std::move(callback_arg)));
+  get_trace_stats_callback_ = nullptr;
+}
+
+// The callbacks below are not used.
+void TracingMuxerImpl::ConsumerImpl::OnDetach(bool) {}
+void TracingMuxerImpl::ConsumerImpl::OnAttach(bool, const TraceConfig&) {}
+// ----- End of TracingMuxerImpl::ConsumerImpl
+
+// ----- Begin of TracingMuxerImpl::TracingSessionImpl
+
+// TracingSessionImpl is the RAII object returned to API clients when they
+// invoke Tracing::CreateTracingSession. They use it for starting/stopping
+// tracing.
+
+TracingMuxerImpl::TracingSessionImpl::TracingSessionImpl(
+    TracingMuxerImpl* muxer,
+    TracingSessionGlobalID session_id,
+    BackendType backend_type)
+    : muxer_(muxer), session_id_(session_id), backend_type_(backend_type) {}
+
+// Can be destroyed from any thread.
+TracingMuxerImpl::TracingSessionImpl::~TracingSessionImpl() {
+  auto* muxer = muxer_;
+  auto session_id = session_id_;
+  muxer->task_runner_->PostTask(
+      [muxer, session_id] { muxer->DestroyTracingSession(session_id); });
+}
+
+// Can be called from any thread.
+void TracingMuxerImpl::TracingSessionImpl::Setup(const TraceConfig& cfg,
+                                                 int fd) {
+  auto* muxer = muxer_;
+  auto session_id = session_id_;
+  std::shared_ptr<TraceConfig> trace_config(new TraceConfig(cfg));
+  if (fd >= 0) {
+    base::ignore_result(backend_type_);  // For -Wunused in the amalgamation.
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+    if (backend_type_ != kInProcessBackend) {
+      PERFETTO_FATAL(
+          "Passing a file descriptor to TracingSession::Setup() is only "
+          "supported with the kInProcessBackend on Windows. Use "
+          "TracingSession::ReadTrace() instead");
+    }
+#endif
+    trace_config->set_write_into_file(true);
+    fd = dup(fd);
+  }
+  muxer->task_runner_->PostTask([muxer, session_id, trace_config, fd] {
+    muxer->SetupTracingSession(session_id, trace_config, base::ScopedFile(fd));
+  });
+}
+
+// Can be called from any thread.
+void TracingMuxerImpl::TracingSessionImpl::Start() {
+  auto* muxer = muxer_;
+  auto session_id = session_id_;
+  muxer->task_runner_->PostTask(
+      [muxer, session_id] { muxer->StartTracingSession(session_id); });
+}
+
+// Can be called from any thread.
+void TracingMuxerImpl::TracingSessionImpl::ChangeTraceConfig(
+    const TraceConfig& cfg) {
+  auto* muxer = muxer_;
+  auto session_id = session_id_;
+  muxer->task_runner_->PostTask([muxer, session_id, cfg] {
+    muxer->ChangeTracingSessionConfig(session_id, cfg);
+  });
+}
+
+// Can be called from any thread except the service thread.
+void TracingMuxerImpl::TracingSessionImpl::StartBlocking() {
+  PERFETTO_DCHECK(!muxer_->task_runner_->RunsTasksOnCurrentThread());
+  auto* muxer = muxer_;
+  auto session_id = session_id_;
+  base::WaitableEvent tracing_started;
+  muxer->task_runner_->PostTask([muxer, session_id, &tracing_started] {
+    auto* consumer = muxer->FindConsumer(session_id);
+    if (!consumer) {
+      // TODO(skyostil): Signal an error to the user.
+      tracing_started.Notify();
+      return;
+    }
+    PERFETTO_DCHECK(!consumer->blocking_start_complete_callback_);
+    consumer->blocking_start_complete_callback_ = [&] {
+      tracing_started.Notify();
+    };
+    muxer->StartTracingSession(session_id);
+  });
+  tracing_started.Wait();
+}
+
+// Can be called from any thread.
+void TracingMuxerImpl::TracingSessionImpl::Flush(
+    std::function<void(bool)> user_callback,
+    uint32_t timeout_ms) {
+  auto* muxer = muxer_;
+  auto session_id = session_id_;
+  muxer->task_runner_->PostTask([muxer, session_id, timeout_ms, user_callback] {
+    auto* consumer = muxer->FindConsumer(session_id);
+    if (!consumer) {
+      std::move(user_callback)(false);
+      return;
+    }
+    muxer->FlushTracingSession(session_id, timeout_ms,
+                               std::move(user_callback));
+  });
+}
+
+// Can be called from any thread.
+void TracingMuxerImpl::TracingSessionImpl::Stop() {
+  auto* muxer = muxer_;
+  auto session_id = session_id_;
+  muxer->task_runner_->PostTask(
+      [muxer, session_id] { muxer->StopTracingSession(session_id); });
+}
+
+// Can be called from any thread except the service thread.
+void TracingMuxerImpl::TracingSessionImpl::StopBlocking() {
+  PERFETTO_DCHECK(!muxer_->task_runner_->RunsTasksOnCurrentThread());
+  auto* muxer = muxer_;
+  auto session_id = session_id_;
+  base::WaitableEvent tracing_stopped;
+  muxer->task_runner_->PostTask([muxer, session_id, &tracing_stopped] {
+    auto* consumer = muxer->FindConsumer(session_id);
+    if (!consumer) {
+      // TODO(skyostil): Signal an error to the user.
+      tracing_stopped.Notify();
+      return;
+    }
+    PERFETTO_DCHECK(!consumer->blocking_stop_complete_callback_);
+    consumer->blocking_stop_complete_callback_ = [&] {
+      tracing_stopped.Notify();
+    };
+    muxer->StopTracingSession(session_id);
+  });
+  tracing_stopped.Wait();
+}
+
+// Can be called from any thread.
+void TracingMuxerImpl::TracingSessionImpl::ReadTrace(ReadTraceCallback cb) {
+  auto* muxer = muxer_;
+  auto session_id = session_id_;
+  muxer->task_runner_->PostTask([muxer, session_id, cb] {
+    muxer->ReadTracingSessionData(session_id, std::move(cb));
+  });
+}
+
+// Can be called from any thread.
+void TracingMuxerImpl::TracingSessionImpl::SetOnStartCallback(
+    std::function<void()> cb) {
+  auto* muxer = muxer_;
+  auto session_id = session_id_;
+  muxer->task_runner_->PostTask([muxer, session_id, cb] {
+    auto* consumer = muxer->FindConsumer(session_id);
+    if (!consumer)
+      return;
+    consumer->start_complete_callback_ = cb;
+  });
+}
+
+// Can be called from any thread
+void TracingMuxerImpl::TracingSessionImpl::SetOnErrorCallback(
+    std::function<void(TracingError)> cb) {
+  auto* muxer = muxer_;
+  auto session_id = session_id_;
+  muxer->task_runner_->PostTask([muxer, session_id, cb] {
+    auto* consumer = muxer->FindConsumer(session_id);
+    if (!consumer) {
+      // Notify the client about concurrent disconnection of the session.
+      if (cb)
+        cb(TracingError{TracingError::kDisconnected, "Peer disconnected"});
+      return;
+    }
+    consumer->error_callback_ = cb;
+  });
+}
+
+// Can be called from any thread.
+void TracingMuxerImpl::TracingSessionImpl::SetOnStopCallback(
+    std::function<void()> cb) {
+  auto* muxer = muxer_;
+  auto session_id = session_id_;
+  muxer->task_runner_->PostTask([muxer, session_id, cb] {
+    auto* consumer = muxer->FindConsumer(session_id);
+    if (!consumer)
+      return;
+    consumer->stop_complete_callback_ = cb;
+  });
+}
+
+// Can be called from any thread.
+void TracingMuxerImpl::TracingSessionImpl::GetTraceStats(
+    GetTraceStatsCallback cb) {
+  auto* muxer = muxer_;
+  auto session_id = session_id_;
+  muxer->task_runner_->PostTask([muxer, session_id, cb] {
+    muxer->GetTraceStats(session_id, std::move(cb));
+  });
+}
+
+// Can be called from any thread.
+void TracingMuxerImpl::TracingSessionImpl::QueryServiceState(
+    QueryServiceStateCallback cb) {
+  auto* muxer = muxer_;
+  auto session_id = session_id_;
+  muxer->task_runner_->PostTask([muxer, session_id, cb] {
+    muxer->QueryServiceState(session_id, std::move(cb));
+  });
+}
+
+// ----- End of TracingMuxerImpl::TracingSessionImpl
+
+// static
+TracingMuxer* TracingMuxer::instance_ = TracingMuxerFake::Get();
+
+// This is called by perfetto::Tracing::Initialize().
+// Can be called on any thread. Typically, but not necessarily, that will be
+// the embedder's main thread.
+TracingMuxerImpl::TracingMuxerImpl(const TracingInitArgs& args)
+    : TracingMuxer(args.platform ? args.platform
+                                 : Platform::GetDefaultPlatform()) {
+  PERFETTO_DETACH_FROM_THREAD(thread_checker_);
+  instance_ = this;
+
+  // Create the thread where muxer, producers and service will live.
+  task_runner_.reset(
+      new NonReentrantTaskRunner(this, platform_->CreateTaskRunner({})));
+
+  // Run the initializer on that thread.
+  task_runner_->PostTask([this, args] { Initialize(args); });
+}
+
+void TracingMuxerImpl::Initialize(const TracingInitArgs& args) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);  // Rebind the thread checker.
+
+  policy_ = args.tracing_policy;
+
+  auto add_backend = [this, &args](TracingBackend* backend, BackendType type) {
+    if (!backend) {
+      // We skip the log in release builds because the *_backend_fake.cc code
+      // has already an ELOG before returning a nullptr.
+      PERFETTO_DLOG("Backend creation failed, type %d", static_cast<int>(type));
+      return;
+    }
+    TracingBackendId backend_id = backends_.size();
+    backends_.emplace_back();
+    RegisteredBackend& rb = backends_.back();
+    rb.backend = backend;
+    rb.id = backend_id;
+    rb.type = type;
+    rb.producer.reset(new ProducerImpl(this, backend_id,
+                                       args.shmem_batch_commits_duration_ms));
+    rb.producer_conn_args.producer = rb.producer.get();
+    rb.producer_conn_args.producer_name = platform_->GetCurrentProcessName();
+    rb.producer_conn_args.task_runner = task_runner_.get();
+    rb.producer_conn_args.shmem_size_hint_bytes =
+        args.shmem_size_hint_kb * 1024;
+    rb.producer_conn_args.shmem_page_size_hint_bytes =
+        args.shmem_page_size_hint_kb * 1024;
+    rb.producer->Initialize(rb.backend->ConnectProducer(rb.producer_conn_args));
+  };
+
+  if (args.backends & kSystemBackend) {
+    PERFETTO_CHECK(args.system_backend_factory_);
+    add_backend(args.system_backend_factory_(), kSystemBackend);
+  }
+
+  if (args.backends & kInProcessBackend) {
+    PERFETTO_CHECK(args.in_process_backend_factory_);
+    add_backend(args.in_process_backend_factory_(), kInProcessBackend);
+  }
+
+  if (args.backends & kCustomBackend) {
+    PERFETTO_CHECK(args.custom_backend);
+    add_backend(args.custom_backend, kCustomBackend);
+  }
+
+  if (args.backends & ~(kSystemBackend | kInProcessBackend | kCustomBackend)) {
+    PERFETTO_FATAL("Unsupported tracing backend type");
+  }
+
+  // Fallback backend for consumer creation for an unsupported backend type.
+  // This backend simply fails any attempt to start a tracing session.
+  // NOTE: This backend instance has to be added last.
+  add_backend(internal::TracingBackendFake::GetInstance(),
+              BackendType::kUnspecifiedBackend);
+}
+
+// Can be called from any thread (but not concurrently).
+bool TracingMuxerImpl::RegisterDataSource(
+    const DataSourceDescriptor& descriptor,
+    DataSourceFactory factory,
+    DataSourceStaticState* static_state) {
+  // Ignore repeated registrations.
+  if (static_state->index != kMaxDataSources)
+    return true;
+
+  static std::atomic<uint32_t> last_id{};
+  uint32_t new_index = last_id++;
+  if (new_index >= kMaxDataSources) {
+    PERFETTO_DLOG(
+        "RegisterDataSource failed: too many data sources already registered");
+    return false;
+  }
+
+  // Initialize the static state.
+  static_assert(sizeof(static_state->instances[0]) >= sizeof(DataSourceState),
+                "instances[] size mismatch");
+  for (size_t i = 0; i < static_state->instances.size(); i++)
+    new (&static_state->instances[i]) DataSourceState{};
+
+  static_state->index = new_index;
+
+  task_runner_->PostTask([this, descriptor, factory, static_state] {
+    data_sources_.emplace_back();
+    RegisteredDataSource& rds = data_sources_.back();
+    rds.descriptor = descriptor;
+    rds.factory = factory;
+    rds.static_state = static_state;
+    UpdateDataSourcesOnAllBackends();
+  });
+  return true;
+}
+
+// Can be called from any thread (but not concurrently).
+void TracingMuxerImpl::RegisterInterceptor(
+    const InterceptorDescriptor& descriptor,
+    InterceptorFactory factory,
+    InterceptorBase::TLSFactory tls_factory,
+    InterceptorBase::TracePacketCallback packet_callback) {
+  task_runner_->PostTask(
+      [this, descriptor, factory, tls_factory, packet_callback] {
+        // Ignore repeated registrations.
+        for (const auto& interceptor : interceptors_) {
+          if (interceptor.descriptor.name() == descriptor.name()) {
+            PERFETTO_DCHECK(interceptor.tls_factory == tls_factory);
+            PERFETTO_DCHECK(interceptor.packet_callback == packet_callback);
+            return;
+          }
+        }
+        // Only allow certain interceptors for now.
+        if (descriptor.name() != "test_interceptor" &&
+            descriptor.name() != "console") {
+          PERFETTO_ELOG(
+              "Interceptors are experimental. If you want to use them, please "
+              "get in touch with the project maintainers "
+              "(https://perfetto.dev/docs/contributing/"
+              "getting-started#community).");
+          return;
+        }
+        interceptors_.emplace_back();
+        RegisteredInterceptor& interceptor = interceptors_.back();
+        interceptor.descriptor = descriptor;
+        interceptor.factory = factory;
+        interceptor.tls_factory = tls_factory;
+        interceptor.packet_callback = packet_callback;
+      });
+}
+
+// Called by the service of one of the backends.
+void TracingMuxerImpl::SetupDataSource(TracingBackendId backend_id,
+                                       uint32_t backend_connection_id,
+                                       DataSourceInstanceID instance_id,
+                                       const DataSourceConfig& cfg) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  PERFETTO_DLOG("Setting up data source %" PRIu64 " %s", instance_id,
+                cfg.name().c_str());
+  uint64_t config_hash = ComputeConfigHash(cfg);
+
+  for (const auto& rds : data_sources_) {
+    if (rds.descriptor.name() != cfg.name())
+      continue;
+    DataSourceStaticState& static_state = *rds.static_state;
+
+    // If this data source is already active for this exact config, don't start
+    // another instance. This happens when we have several data sources with the
+    // same name, in which case the service sends one SetupDataSource event for
+    // each one. Since we can't map which event maps to which data source, we
+    // ensure each event only starts one data source instance.
+    // TODO(skyostil): Register a unique id with each data source to the service
+    // to disambiguate.
+    bool active_for_config = false;
+    for (uint32_t i = 0; i < kMaxDataSourceInstances; i++) {
+      if (!static_state.TryGet(i))
+        continue;
+      auto* internal_state =
+          reinterpret_cast<DataSourceState*>(&static_state.instances[i]);
+      if (internal_state->backend_id == backend_id &&
+          internal_state->config_hash == config_hash) {
+        active_for_config = true;
+        break;
+      }
+    }
+    if (active_for_config) {
+      PERFETTO_DLOG(
+          "Data source %s is already active with this config, skipping",
+          cfg.name().c_str());
+      continue;
+    }
+
+    for (uint32_t i = 0; i < kMaxDataSourceInstances; i++) {
+      // Find a free slot.
+      if (static_state.TryGet(i))
+        continue;
+
+      auto* internal_state =
+          reinterpret_cast<DataSourceState*>(&static_state.instances[i]);
+      std::lock_guard<std::recursive_mutex> guard(internal_state->lock);
+      static_assert(
+          std::is_same<decltype(internal_state->data_source_instance_id),
+                       DataSourceInstanceID>::value,
+          "data_source_instance_id type mismatch");
+      internal_state->backend_id = backend_id;
+      internal_state->backend_connection_id = backend_connection_id;
+      internal_state->data_source_instance_id = instance_id;
+      internal_state->buffer_id =
+          static_cast<internal::BufferId>(cfg.target_buffer());
+      internal_state->config_hash = config_hash;
+      internal_state->data_source = rds.factory();
+      internal_state->interceptor = nullptr;
+      internal_state->interceptor_id = 0;
+
+      if (cfg.has_interceptor_config()) {
+        for (size_t j = 0; j < interceptors_.size(); j++) {
+          if (cfg.interceptor_config().name() ==
+              interceptors_[j].descriptor.name()) {
+            PERFETTO_DLOG("Intercepting data source %" PRIu64
+                          " \"%s\" into \"%s\"",
+                          instance_id, cfg.name().c_str(),
+                          cfg.interceptor_config().name().c_str());
+            internal_state->interceptor_id = static_cast<uint32_t>(j + 1);
+            internal_state->interceptor = interceptors_[j].factory();
+            internal_state->interceptor->OnSetup({cfg});
+            break;
+          }
+        }
+        if (!internal_state->interceptor_id) {
+          PERFETTO_ELOG("Unknown interceptor configured for data source: %s",
+                        cfg.interceptor_config().name().c_str());
+        }
+      }
+
+      // This must be made at the end. See matching acquire-load in
+      // DataSource::Trace().
+      static_state.valid_instances.fetch_or(1 << i, std::memory_order_release);
+
+      DataSourceBase::SetupArgs setup_args;
+      setup_args.config = &cfg;
+      setup_args.internal_instance_index = i;
+      internal_state->data_source->OnSetup(setup_args);
+      return;
+    }
+    PERFETTO_ELOG(
+        "Maximum number of data source instances exhausted. "
+        "Dropping data source %" PRIu64,
+        instance_id);
+    break;
+  }
+}
+
+// Called by the service of one of the backends.
+void TracingMuxerImpl::StartDataSource(TracingBackendId backend_id,
+                                       DataSourceInstanceID instance_id) {
+  PERFETTO_DLOG("Starting data source %" PRIu64, instance_id);
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+
+  auto ds = FindDataSource(backend_id, instance_id);
+  if (!ds) {
+    PERFETTO_ELOG("Could not find data source to start");
+    return;
+  }
+
+  DataSourceBase::StartArgs start_args{};
+  start_args.internal_instance_index = ds.instance_idx;
+
+  std::lock_guard<std::recursive_mutex> guard(ds.internal_state->lock);
+  if (ds.internal_state->interceptor)
+    ds.internal_state->interceptor->OnStart({});
+  ds.internal_state->trace_lambda_enabled = true;
+  ds.internal_state->data_source->OnStart(start_args);
+}
+
+// Called by the service of one of the backends.
+void TracingMuxerImpl::StopDataSource_AsyncBegin(
+    TracingBackendId backend_id,
+    DataSourceInstanceID instance_id) {
+  PERFETTO_DLOG("Stopping data source %" PRIu64, instance_id);
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+
+  auto ds = FindDataSource(backend_id, instance_id);
+  if (!ds) {
+    PERFETTO_ELOG("Could not find data source to stop");
+    return;
+  }
+
+  StopArgsImpl stop_args{};
+  stop_args.internal_instance_index = ds.instance_idx;
+  stop_args.async_stop_closure = [this, backend_id, instance_id] {
+    // TracingMuxerImpl is long lived, capturing |this| is okay.
+    // The notification closure can be moved out of the StopArgs by the
+    // embedder to handle stop asynchronously. The embedder might then
+    // call the closure on a different thread than the current one, hence
+    // this nested PostTask().
+    task_runner_->PostTask([this, backend_id, instance_id] {
+      StopDataSource_AsyncEnd(backend_id, instance_id);
+    });
+  };
+
+  {
+    std::lock_guard<std::recursive_mutex> guard(ds.internal_state->lock);
+    if (ds.internal_state->interceptor)
+      ds.internal_state->interceptor->OnStop({});
+    ds.internal_state->data_source->OnStop(stop_args);
+  }
+
+  // If the embedder hasn't called StopArgs.HandleStopAsynchronously() run the
+  // async closure here. In theory we could avoid the PostTask and call
+  // straight into CompleteDataSourceAsyncStop(). We keep that to reduce
+  // divergencies between the deferred-stop vs non-deferred-stop code paths.
+  if (stop_args.async_stop_closure)
+    std::move(stop_args.async_stop_closure)();
+}
+
+void TracingMuxerImpl::StopDataSource_AsyncEnd(
+    TracingBackendId backend_id,
+    DataSourceInstanceID instance_id) {
+  PERFETTO_DLOG("Ending async stop of data source %" PRIu64, instance_id);
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+
+  auto ds = FindDataSource(backend_id, instance_id);
+  if (!ds) {
+    PERFETTO_ELOG(
+        "Async stop of data source %" PRIu64
+        " failed. This might be due to calling the async_stop_closure twice.",
+        instance_id);
+    return;
+  }
+
+  const uint32_t mask = ~(1 << ds.instance_idx);
+  ds.static_state->valid_instances.fetch_and(mask, std::memory_order_acq_rel);
+
+  // Take the mutex to prevent that the data source is in the middle of
+  // a Trace() execution where it called GetDataSourceLocked() while we
+  // destroy it.
+  {
+    std::lock_guard<std::recursive_mutex> guard(ds.internal_state->lock);
+    ds.internal_state->trace_lambda_enabled = false;
+    ds.internal_state->data_source.reset();
+  }
+
+  // The other fields of internal_state are deliberately *not* cleared.
+  // See races-related comments of DataSource::Trace().
+
+  TracingMuxer::generation_++;
+
+  // |backends_| is append-only, Backend instances are always valid.
+  PERFETTO_CHECK(backend_id < backends_.size());
+  ProducerImpl* producer = backends_[backend_id].producer.get();
+  if (!producer)
+    return;
+  if (producer->connected_) {
+    // Flush any commits that might have been batched by SharedMemoryArbiter.
+    producer->service_->MaybeSharedMemoryArbiter()
+        ->FlushPendingCommitDataRequests();
+    producer->service_->NotifyDataSourceStopped(instance_id);
+  }
+  producer->SweepDeadServices();
+}
+
+void TracingMuxerImpl::ClearDataSourceIncrementalState(
+    TracingBackendId backend_id,
+    DataSourceInstanceID instance_id) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  PERFETTO_DLOG("Clearing incremental state for data source %" PRIu64,
+                instance_id);
+  auto ds = FindDataSource(backend_id, instance_id);
+  if (!ds) {
+    PERFETTO_ELOG("Could not find data source to clear incremental state for");
+    return;
+  }
+  // Make DataSource::TraceContext::GetIncrementalState() eventually notice that
+  // the incremental state should be cleared.
+  ds.static_state->incremental_state_generation.fetch_add(
+      1, std::memory_order_relaxed);
+}
+
+void TracingMuxerImpl::SyncProducersForTesting() {
+  std::mutex mutex;
+  std::condition_variable cv;
+
+  // IPC-based producers don't report connection errors explicitly for each
+  // command, but instead with an asynchronous callback
+  // (ProducerImpl::OnDisconnected). This means that the sync command below
+  // may have completed but failed to reach the service because of a
+  // disconnection, but we can't tell until the disconnection message comes
+  // through. To guard against this, we run two whole rounds of sync round-trips
+  // before returning; the first one will detect any disconnected producers and
+  // the second one will ensure any reconnections have completed and all data
+  // sources are registered in the service again.
+  for (size_t i = 0; i < 2; i++) {
+    size_t countdown = std::numeric_limits<size_t>::max();
+    task_runner_->PostTask([this, &mutex, &cv, &countdown] {
+      {
+        std::unique_lock<std::mutex> countdown_lock(mutex);
+        countdown = backends_.size();
+      }
+      for (auto& backend : backends_) {
+        auto* producer = backend.producer.get();
+        producer->service_->Sync([&mutex, &cv, &countdown] {
+          std::unique_lock<std::mutex> countdown_lock(mutex);
+          countdown--;
+          cv.notify_one();
+        });
+      }
+    });
+
+    {
+      std::unique_lock<std::mutex> countdown_lock(mutex);
+      cv.wait(countdown_lock, [&countdown] { return !countdown; });
+    }
+  }
+
+  // Check that all producers are indeed connected.
+  bool done = false;
+  bool all_producers_connected = true;
+  task_runner_->PostTask([this, &mutex, &cv, &done, &all_producers_connected] {
+    for (auto& backend : backends_)
+      all_producers_connected &= backend.producer->connected_;
+    std::unique_lock<std::mutex> lock(mutex);
+    done = true;
+    cv.notify_one();
+  });
+
+  {
+    std::unique_lock<std::mutex> lock(mutex);
+    cv.wait(lock, [&done] { return done; });
+  }
+  PERFETTO_DCHECK(all_producers_connected);
+}
+
+void TracingMuxerImpl::DestroyStoppedTraceWritersForCurrentThread() {
+  // Iterate across all possible data source types.
+  auto cur_generation = generation_.load(std::memory_order_acquire);
+  auto* root_tls = GetOrCreateTracingTLS();
+
+  auto destroy_stopped_instances = [](DataSourceThreadLocalState& tls) {
+    // |tls| has a vector of per-data-source-instance thread-local state.
+    DataSourceStaticState* static_state = tls.static_state;
+    if (!static_state)
+      return;  // Slot not used.
+
+    // Iterate across all possible instances for this data source.
+    for (uint32_t inst = 0; inst < kMaxDataSourceInstances; inst++) {
+      DataSourceInstanceThreadLocalState& ds_tls = tls.per_instance[inst];
+      if (!ds_tls.trace_writer)
+        continue;
+
+      DataSourceState* ds_state = static_state->TryGet(inst);
+      if (ds_state && ds_state->backend_id == ds_tls.backend_id &&
+          ds_state->backend_connection_id == ds_tls.backend_connection_id &&
+          ds_state->buffer_id == ds_tls.buffer_id &&
+          ds_state->data_source_instance_id == ds_tls.data_source_instance_id) {
+        continue;
+      }
+
+      // The DataSource instance has been destroyed or recycled.
+      ds_tls.Reset();  // Will also destroy the |ds_tls.trace_writer|.
+    }
+  };
+
+  for (size_t ds_idx = 0; ds_idx < kMaxDataSources; ds_idx++) {
+    // |tls| has a vector of per-data-source-instance thread-local state.
+    DataSourceThreadLocalState& tls = root_tls->data_sources_tls[ds_idx];
+    destroy_stopped_instances(tls);
+  }
+  destroy_stopped_instances(root_tls->track_event_tls);
+  root_tls->generation = cur_generation;
+}
+
+// Called both when a new data source is registered or when a new backend
+// connects. In both cases we want to be sure we reflected the data source
+// registrations on the backends.
+void TracingMuxerImpl::UpdateDataSourcesOnAllBackends() {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  for (RegisteredDataSource& rds : data_sources_) {
+    for (RegisteredBackend& backend : backends_) {
+      // We cannot call RegisterDataSource on the backend before it connects.
+      if (!backend.producer->connected_)
+        continue;
+
+      PERFETTO_DCHECK(rds.static_state->index < kMaxDataSources);
+      if (backend.producer->registered_data_sources_.test(
+              rds.static_state->index))
+        continue;
+
+      rds.descriptor.set_will_notify_on_start(true);
+      rds.descriptor.set_will_notify_on_stop(true);
+      rds.descriptor.set_handles_incremental_state_clear(true);
+      backend.producer->service_->RegisterDataSource(rds.descriptor);
+      backend.producer->registered_data_sources_.set(rds.static_state->index);
+    }
+  }
+}
+
+void TracingMuxerImpl::SetupTracingSession(
+    TracingSessionGlobalID session_id,
+    const std::shared_ptr<TraceConfig>& trace_config,
+    base::ScopedFile trace_fd) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  PERFETTO_CHECK(!trace_fd || trace_config->write_into_file());
+
+  auto* consumer = FindConsumer(session_id);
+  if (!consumer)
+    return;
+
+  consumer->trace_config_ = trace_config;
+  if (trace_fd)
+    consumer->trace_fd_ = std::move(trace_fd);
+
+  if (!consumer->connected_)
+    return;
+
+  // Only used in the deferred start mode.
+  if (trace_config->deferred_start()) {
+    consumer->service_->EnableTracing(*trace_config,
+                                      std::move(consumer->trace_fd_));
+  }
+}
+
+void TracingMuxerImpl::StartTracingSession(TracingSessionGlobalID session_id) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+
+  auto* consumer = FindConsumer(session_id);
+
+  if (!consumer)
+    return;
+
+  if (!consumer->trace_config_) {
+    PERFETTO_ELOG("Must call Setup(config) first");
+    return;
+  }
+
+  if (!consumer->connected_) {
+    consumer->start_pending_ = true;
+    return;
+  }
+
+  consumer->start_pending_ = false;
+  if (consumer->trace_config_->deferred_start()) {
+    consumer->service_->StartTracing();
+  } else {
+    consumer->service_->EnableTracing(*consumer->trace_config_,
+                                      std::move(consumer->trace_fd_));
+  }
+
+  // TODO implement support for the deferred-start + fast-triggering case.
+}
+
+void TracingMuxerImpl::ChangeTracingSessionConfig(
+    TracingSessionGlobalID session_id,
+    const TraceConfig& trace_config) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+
+  auto* consumer = FindConsumer(session_id);
+
+  if (!consumer)
+    return;
+
+  if (!consumer->trace_config_) {
+    // Changing the config is only supported for started sessions.
+    PERFETTO_ELOG("Must call Setup(config) and Start() first");
+    return;
+  }
+
+  consumer->trace_config_ = std::make_shared<TraceConfig>(trace_config);
+  if (consumer->connected_)
+    consumer->service_->ChangeTraceConfig(trace_config);
+}
+
+void TracingMuxerImpl::FlushTracingSession(TracingSessionGlobalID session_id,
+                                           uint32_t timeout_ms,
+                                           std::function<void(bool)> callback) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  auto* consumer = FindConsumer(session_id);
+  if (!consumer || consumer->start_pending_ || consumer->stop_pending_ ||
+      !consumer->trace_config_) {
+    PERFETTO_ELOG("Flush() can be called only after Start() and before Stop()");
+    std::move(callback)(false);
+    return;
+  }
+
+  consumer->service_->Flush(timeout_ms, std::move(callback));
+}
+
+void TracingMuxerImpl::StopTracingSession(TracingSessionGlobalID session_id) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  auto* consumer = FindConsumer(session_id);
+  if (!consumer)
+    return;
+
+  if (consumer->start_pending_) {
+    // If the session hasn't started yet, wait until it does before stopping.
+    consumer->stop_pending_ = true;
+    return;
+  }
+
+  consumer->stop_pending_ = false;
+  if (consumer->stopped_) {
+    // If the session was already stopped (e.g., it failed to start), don't try
+    // stopping again.
+    consumer->NotifyStopComplete();
+  } else if (!consumer->trace_config_) {
+    PERFETTO_ELOG("Must call Setup(config) and Start() first");
+    return;
+  } else {
+    consumer->service_->DisableTracing();
+  }
+
+  consumer->trace_config_.reset();
+}
+
+void TracingMuxerImpl::DestroyTracingSession(
+    TracingSessionGlobalID session_id) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  for (RegisteredBackend& backend : backends_) {
+    // We need to find the consumer (if any) and call Disconnect as we destroy
+    // the tracing session. We can't call Disconnect() inside this for loop
+    // because in the in-process case this will end up to a synchronous call to
+    // OnConsumerDisconnect which will invalidate all the iterators to
+    // |backend.consumers|.
+    ConsumerImpl* consumer = nullptr;
+    for (auto& con : backend.consumers) {
+      if (con->session_id_ == session_id) {
+        consumer = con.get();
+        break;
+      }
+    }
+    if (consumer) {
+      // We broke out of the loop above on the assumption that each backend will
+      // only have a single consumer per session. This DCHECK ensures that
+      // this is the case.
+      PERFETTO_DCHECK(
+          std::count_if(backend.consumers.begin(), backend.consumers.end(),
+                        [session_id](const std::unique_ptr<ConsumerImpl>& con) {
+                          return con->session_id_ == session_id;
+                        }) == 1u);
+      consumer->Disconnect();
+    }
+  }
+}
+
+void TracingMuxerImpl::ReadTracingSessionData(
+    TracingSessionGlobalID session_id,
+    std::function<void(TracingSession::ReadTraceCallbackArgs)> callback) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  auto* consumer = FindConsumer(session_id);
+  if (!consumer) {
+    // TODO(skyostil): Signal an error to the user.
+    TracingSession::ReadTraceCallbackArgs callback_arg{};
+    callback(callback_arg);
+    return;
+  }
+  PERFETTO_DCHECK(!consumer->read_trace_callback_);
+  consumer->read_trace_callback_ = std::move(callback);
+  consumer->service_->ReadBuffers();
+}
+
+void TracingMuxerImpl::GetTraceStats(
+    TracingSessionGlobalID session_id,
+    TracingSession::GetTraceStatsCallback callback) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  auto* consumer = FindConsumer(session_id);
+  if (!consumer) {
+    TracingSession::GetTraceStatsCallbackArgs callback_arg{};
+    callback_arg.success = false;
+    callback(std::move(callback_arg));
+    return;
+  }
+  PERFETTO_DCHECK(!consumer->get_trace_stats_callback_);
+  consumer->get_trace_stats_callback_ = std::move(callback);
+  if (!consumer->connected_) {
+    consumer->get_trace_stats_pending_ = true;
+    return;
+  }
+  consumer->get_trace_stats_pending_ = false;
+  consumer->service_->GetTraceStats();
+}
+
+void TracingMuxerImpl::QueryServiceState(
+    TracingSessionGlobalID session_id,
+    TracingSession::QueryServiceStateCallback callback) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  auto* consumer = FindConsumer(session_id);
+  if (!consumer) {
+    TracingSession::QueryServiceStateCallbackArgs callback_arg{};
+    callback_arg.success = false;
+    callback(std::move(callback_arg));
+    return;
+  }
+  PERFETTO_DCHECK(!consumer->query_service_state_callback_);
+  if (!consumer->connected_) {
+    consumer->query_service_state_callback_ = std::move(callback);
+    return;
+  }
+  auto callback_wrapper = [callback](bool success,
+                                     protos::gen::TracingServiceState state) {
+    TracingSession::QueryServiceStateCallbackArgs callback_arg{};
+    callback_arg.success = success;
+    callback_arg.service_state_data = state.SerializeAsArray();
+    callback(std::move(callback_arg));
+  };
+  consumer->service_->QueryServiceState(std::move(callback_wrapper));
+}
+
+void TracingMuxerImpl::SetBatchCommitsDurationForTesting(
+    uint32_t batch_commits_duration_ms,
+    BackendType backend_type) {
+  for (RegisteredBackend& backend : backends_) {
+    if (backend.producer && backend.producer->connected_ &&
+        backend.type == backend_type) {
+      backend.producer->service_->MaybeSharedMemoryArbiter()
+          ->SetBatchCommitsDuration(batch_commits_duration_ms);
+    }
+  }
+}
+
+bool TracingMuxerImpl::EnableDirectSMBPatchingForTesting(
+    BackendType backend_type) {
+  for (RegisteredBackend& backend : backends_) {
+    if (backend.producer && backend.producer->connected_ &&
+        backend.type == backend_type &&
+        !backend.producer->service_->MaybeSharedMemoryArbiter()
+             ->EnableDirectSMBPatching()) {
+      return false;
+    }
+  }
+  return true;
+}
+
+TracingMuxerImpl::ConsumerImpl* TracingMuxerImpl::FindConsumer(
+    TracingSessionGlobalID session_id) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  for (RegisteredBackend& backend : backends_) {
+    for (auto& consumer : backend.consumers) {
+      if (consumer->session_id_ == session_id) {
+        return consumer.get();
+      }
+    }
+  }
+  return nullptr;
+}
+
+void TracingMuxerImpl::InitializeConsumer(TracingSessionGlobalID session_id) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+
+  auto* consumer = FindConsumer(session_id);
+  if (!consumer)
+    return;
+
+  TracingBackendId backend_id = consumer->backend_id_;
+  // |backends_| is append-only, Backend instances are always valid.
+  PERFETTO_CHECK(backend_id < backends_.size());
+  RegisteredBackend& backend = backends_[backend_id];
+
+  TracingBackend::ConnectConsumerArgs conn_args;
+  conn_args.consumer = consumer;
+  conn_args.task_runner = task_runner_.get();
+  consumer->Initialize(backend.backend->ConnectConsumer(conn_args));
+}
+
+void TracingMuxerImpl::OnConsumerDisconnected(ConsumerImpl* consumer) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  for (RegisteredBackend& backend : backends_) {
+    auto pred = [consumer](const std::unique_ptr<ConsumerImpl>& con) {
+      return con.get() == consumer;
+    };
+    backend.consumers.erase(std::remove_if(backend.consumers.begin(),
+                                           backend.consumers.end(), pred),
+                            backend.consumers.end());
+  }
+}
+
+void TracingMuxerImpl::SetMaxProducerReconnectionsForTesting(uint32_t count) {
+  max_producer_reconnections_.store(count);
+}
+
+void TracingMuxerImpl::OnProducerDisconnected(ProducerImpl* producer) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  for (RegisteredBackend& backend : backends_) {
+    if (backend.producer.get() != producer)
+      continue;
+    // Try reconnecting the disconnected producer. If the connection succeeds,
+    // all the data sources will be automatically re-registered.
+    if (producer->connection_id_ > max_producer_reconnections_.load()) {
+      // Avoid reconnecting a failing producer too many times. Instead we just
+      // leak the producer instead of trying to avoid further complicating
+      // cross-thread trace writer creation.
+      PERFETTO_ELOG("Producer disconnected too many times; not reconnecting");
+      continue;
+    }
+    backend.producer->Initialize(
+        backend.backend->ConnectProducer(backend.producer_conn_args));
+  }
+
+  // Increment the generation counter to atomically ensure that:
+  // 1. Old trace writers from the severed connection eventually get cleaned up
+  //    by DestroyStoppedTraceWritersForCurrentThread().
+  // 2. No new trace writers can be created for the SharedMemoryArbiter from the
+  //    old connection.
+  TracingMuxer::generation_++;
+}
+
+TracingMuxerImpl::FindDataSourceRes TracingMuxerImpl::FindDataSource(
+    TracingBackendId backend_id,
+    DataSourceInstanceID instance_id) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  for (const auto& rds : data_sources_) {
+    DataSourceStaticState* static_state = rds.static_state;
+    for (uint32_t i = 0; i < kMaxDataSourceInstances; i++) {
+      auto* internal_state = static_state->TryGet(i);
+      if (internal_state && internal_state->backend_id == backend_id &&
+          internal_state->data_source_instance_id == instance_id) {
+        return FindDataSourceRes(static_state, internal_state, i);
+      }
+    }
+  }
+  return FindDataSourceRes();
+}
+
+// Can be called from any thread.
+std::unique_ptr<TraceWriterBase> TracingMuxerImpl::CreateTraceWriter(
+    DataSourceStaticState* static_state,
+    uint32_t data_source_instance_index,
+    DataSourceState* data_source,
+    BufferExhaustedPolicy buffer_exhausted_policy) {
+  if (PERFETTO_UNLIKELY(data_source->interceptor_id)) {
+    // If the session is being intercepted, return a heap-backed trace writer
+    // instead. This is safe because all the data given to the interceptor is
+    // either thread-local (|instance_index|), statically allocated
+    // (|static_state|) or constant after initialization (|interceptor|). Access
+    // to the interceptor instance itself through |data_source| is protected by
+    // a statically allocated lock (similarly to the data source instance).
+    auto& interceptor = interceptors_[data_source->interceptor_id - 1];
+    return std::unique_ptr<TraceWriterBase>(new InterceptorTraceWriter(
+        interceptor.tls_factory(static_state, data_source_instance_index),
+        interceptor.packet_callback, static_state, data_source_instance_index));
+  }
+  ProducerImpl* producer = backends_[data_source->backend_id].producer.get();
+  // Atomically load the current service endpoint. We keep the pointer as a
+  // shared pointer on the stack to guard against it from being concurrently
+  // modified on the thread by ProducerImpl::Initialize() swapping in a
+  // reconnected service on the muxer task runner thread.
+  //
+  // The endpoint may also be concurrently modified by SweepDeadServices()
+  // clearing out old disconnected services. We guard against that by
+  // SharedMemoryArbiter keeping track of any outstanding trace writers. After
+  // shutdown has started, the trace writer created below will be a null one
+  // which will drop any written data. See SharedMemoryArbiter::TryShutdown().
+  //
+  // We use an atomic pointer instead of holding a lock because
+  // CreateTraceWriter posts tasks under the hood.
+  std::shared_ptr<ProducerEndpoint> service =
+      std::atomic_load(&producer->service_);
+  return service->CreateTraceWriter(data_source->buffer_id,
+                                    buffer_exhausted_policy);
+}
+
+// This is called via the public API Tracing::NewTrace().
+// Can be called from any thread.
+std::unique_ptr<TracingSession> TracingMuxerImpl::CreateTracingSession(
+    BackendType requested_backend_type) {
+  TracingSessionGlobalID session_id = ++next_tracing_session_id_;
+
+  // |backend_type| can only specify one backend, not an OR-ed mask.
+  PERFETTO_CHECK((requested_backend_type & (requested_backend_type - 1)) == 0);
+
+  // Capturing |this| is fine because the TracingMuxer is a leaky singleton.
+  task_runner_->PostTask([this, requested_backend_type, session_id] {
+    for (RegisteredBackend& backend : backends_) {
+      if (requested_backend_type && backend.type &&
+          backend.type != requested_backend_type) {
+        continue;
+      }
+
+      TracingBackendId backend_id = backend.id;
+
+      // Create the consumer now, even if we have to ask the embedder below, so
+      // that any other tasks executing after this one can find the consumer and
+      // change its pending attributes.
+      backend.consumers.emplace_back(
+          new ConsumerImpl(this, backend.type, backend.id, session_id));
+
+      // The last registered backend in |backends_| is the unsupported backend
+      // without a valid type.
+      if (!backend.type) {
+        PERFETTO_ELOG(
+            "No tracing backend ready for type=%d, consumer will disconnect",
+            requested_backend_type);
+        InitializeConsumer(session_id);
+        return;
+      }
+
+      // Check if the embedder wants to be asked for permission before
+      // connecting the consumer.
+      if (!policy_) {
+        InitializeConsumer(session_id);
+        return;
+      }
+
+      TracingPolicy::ShouldAllowConsumerSessionArgs args;
+      args.backend_type = backend.type;
+      args.result_callback = [this, backend_id, session_id](bool allow) {
+        task_runner_->PostTask([this, backend_id, session_id, allow] {
+          if (allow) {
+            InitializeConsumer(session_id);
+            return;
+          }
+
+          PERFETTO_ELOG(
+              "Consumer session for backend type type=%d forbidden, "
+              "consumer will disconnect",
+              backends_[backend_id].type);
+
+          auto* consumer = FindConsumer(session_id);
+          if (!consumer)
+            return;
+
+          consumer->OnDisconnect();
+        });
+      };
+      policy_->ShouldAllowConsumerSession(args);
+      return;
+    }
+    PERFETTO_DFATAL("Not reached");
+  });
+
+  return std::unique_ptr<TracingSession>(
+      new TracingSessionImpl(this, session_id, requested_backend_type));
+}
+
+void TracingMuxerImpl::InitializeInstance(const TracingInitArgs& args) {
+  if (instance_ != TracingMuxerFake::Get())
+    PERFETTO_FATAL("Tracing already initialized");
+  new TracingMuxerImpl(args);
+}
+
+TracingMuxer::~TracingMuxer() = default;
+
+static_assert(std::is_same<internal::BufferId, BufferID>::value,
+              "public's BufferId and tracing/core's BufferID diverged");
+
+}  // namespace internal
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/internal/track_event_internal.cc
+// gen_amalgamated begin header: include/perfetto/tracing/internal/track_event_interned_fields.h
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/track_event_interned_data_index.h"
+
+#ifndef INCLUDE_PERFETTO_TRACING_INTERNAL_TRACK_EVENT_INTERNED_FIELDS_H_
+#define INCLUDE_PERFETTO_TRACING_INTERNAL_TRACK_EVENT_INTERNED_FIELDS_H_
+
+namespace perfetto {
+namespace internal {
+
+// These helpers are exposed here to allow Chromium-without-client library
+// to share the interning buffers with Perfetto internals (e.g.
+// perfetto::TracedValue implementation).
+
+struct PERFETTO_EXPORT InternedEventCategory
+    : public TrackEventInternedDataIndex<
+          InternedEventCategory,
+          perfetto::protos::pbzero::InternedData::kEventCategoriesFieldNumber,
+          const char*,
+          SmallInternedDataTraits> {
+  ~InternedEventCategory() override;
+
+  static void Add(protos::pbzero::InternedData* interned_data,
+                  size_t iid,
+                  const char* value,
+                  size_t length);
+};
+
+struct PERFETTO_EXPORT InternedEventName
+    : public TrackEventInternedDataIndex<
+          InternedEventName,
+          perfetto::protos::pbzero::InternedData::kEventNamesFieldNumber,
+          const char*,
+          SmallInternedDataTraits> {
+  ~InternedEventName() override;
+
+  static void Add(protos::pbzero::InternedData* interned_data,
+                  size_t iid,
+                  const char* value);
+};
+
+struct PERFETTO_EXPORT InternedDebugAnnotationName
+    : public TrackEventInternedDataIndex<
+          InternedDebugAnnotationName,
+          perfetto::protos::pbzero::InternedData::
+              kDebugAnnotationNamesFieldNumber,
+          const char*,
+          SmallInternedDataTraits> {
+  ~InternedDebugAnnotationName() override;
+
+  static void Add(protos::pbzero::InternedData* interned_data,
+                  size_t iid,
+                  const char* value);
+};
+
+}  // namespace internal
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_INTERNAL_TRACK_EVENT_INTERNED_FIELDS_H_
+// gen_amalgamated begin header: gen/protos/perfetto/common/track_event_descriptor.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACK_EVENT_DESCRIPTOR_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACK_EVENT_DESCRIPTOR_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class TrackEventCategory;
+
+class TrackEventDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  TrackEventDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TrackEventDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TrackEventDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_available_categories() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> available_categories() const { return GetRepeated<::protozero::ConstBytes>(1); }
+};
+
+class TrackEventDescriptor : public ::protozero::Message {
+ public:
+  using Decoder = TrackEventDescriptor_Decoder;
+  enum : int32_t {
+    kAvailableCategoriesFieldNumber = 1,
+  };
+
+  using FieldMetadata_AvailableCategories =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TrackEventCategory,
+      TrackEventDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AvailableCategories kAvailableCategories() { return {}; }
+  template <typename T = TrackEventCategory> T* add_available_categories() {
+    return BeginNestedMessage<T>(1);
+  }
+
+};
+
+class TrackEventCategory_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  TrackEventCategory_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TrackEventCategory_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TrackEventCategory_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_description() const { return at<2>().valid(); }
+  ::protozero::ConstChars description() const { return at<2>().as_string(); }
+  bool has_tags() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> tags() const { return GetRepeated<::protozero::ConstChars>(3); }
+};
+
+class TrackEventCategory : public ::protozero::Message {
+ public:
+  using Decoder = TrackEventCategory_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kDescriptionFieldNumber = 2,
+    kTagsFieldNumber = 3,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TrackEventCategory>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Description =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TrackEventCategory>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Description kDescription() { return {}; }
+  void set_description(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Description::kFieldId, data, size);
+  }
+  void set_description(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Description::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Tags =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TrackEventCategory>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Tags kTags() { return {}; }
+  void add_tags(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Tags::kFieldId, data, size);
+  }
+  void add_tags(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Tags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/track_event_internal.h"
+
+// gen_amalgamated expanded: #include "perfetto/base/proc_utils.h"
+// gen_amalgamated expanded: #include "perfetto/base/thread_utils.h"
+// gen_amalgamated expanded: #include "perfetto/base/time.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/data_source_config.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/track_event_interned_fields.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/track_event.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/track_event_category_registry.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/track_event_interned_data_index.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/data_source_descriptor.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/track_event_descriptor.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/interned_data/interned_data.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/trace_packet_defaults.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/debug_annotation.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/track_descriptor.pbzero.h"
+
+namespace perfetto {
+
+TrackEventSessionObserver::~TrackEventSessionObserver() = default;
+void TrackEventSessionObserver::OnSetup(const DataSourceBase::SetupArgs&) {}
+void TrackEventSessionObserver::OnStart(const DataSourceBase::StartArgs&) {}
+void TrackEventSessionObserver::OnStop(const DataSourceBase::StopArgs&) {}
+
+namespace internal {
+
+BaseTrackEventInternedDataIndex::~BaseTrackEventInternedDataIndex() = default;
+
+namespace {
+
+std::atomic<perfetto::base::PlatformThreadId> g_main_thread;
+static constexpr const char kLegacySlowPrefix[] = "disabled-by-default-";
+static constexpr const char kSlowTag[] = "slow";
+static constexpr const char kDebugTag[] = "debug";
+
+void ForEachObserver(
+    std::function<bool(TrackEventSessionObserver*&)> callback) {
+  // Session observers, shared by all track event data source instances.
+  static constexpr int kMaxObservers = 8;
+  static std::recursive_mutex* mutex = new std::recursive_mutex{};  // Leaked.
+  static std::array<TrackEventSessionObserver*, kMaxObservers> observers{};
+  std::unique_lock<std::recursive_mutex> lock(*mutex);
+  for (auto& o : observers) {
+    if (!callback(o))
+      break;
+  }
+}
+
+enum class MatchType { kExact, kPattern };
+
+bool NameMatchesPattern(const std::string& pattern,
+                        const std::string& name,
+                        MatchType match_type) {
+  // To avoid pulling in all of std::regex, for now we only support a single "*"
+  // wildcard at the end of the pattern.
+  size_t i = pattern.find('*');
+  if (i != std::string::npos) {
+    PERFETTO_DCHECK(i == pattern.size() - 1);
+    if (match_type != MatchType::kPattern)
+      return false;
+    return name.substr(0, i) == pattern.substr(0, i);
+  }
+  return name == pattern;
+}
+
+bool NameMatchesPatternList(const std::vector<std::string>& patterns,
+                            const std::string& name,
+                            MatchType match_type) {
+  for (const auto& pattern : patterns) {
+    if (NameMatchesPattern(pattern, name, match_type))
+      return true;
+  }
+  return false;
+}
+
+}  // namespace
+
+// static
+const Track TrackEventInternal::kDefaultTrack{};
+
+// static
+std::atomic<int> TrackEventInternal::session_count_{};
+
+// static
+bool TrackEventInternal::Initialize(
+    const TrackEventCategoryRegistry& registry,
+    bool (*register_data_source)(const DataSourceDescriptor&)) {
+  if (!g_main_thread)
+    g_main_thread = perfetto::base::GetThreadId();
+
+  DataSourceDescriptor dsd;
+  dsd.set_name("track_event");
+
+  protozero::HeapBuffered<protos::pbzero::TrackEventDescriptor> ted;
+  for (size_t i = 0; i < registry.category_count(); i++) {
+    auto category = registry.GetCategory(i);
+    // Don't register group categories.
+    if (category->IsGroup())
+      continue;
+    auto cat = ted->add_available_categories();
+    cat->set_name(category->name);
+    if (category->description)
+      cat->set_description(category->description);
+    for (const auto& tag : category->tags) {
+      if (tag)
+        cat->add_tags(tag);
+    }
+    // Disabled-by-default categories get a "slow" tag.
+    if (!strncmp(category->name, kLegacySlowPrefix, strlen(kLegacySlowPrefix)))
+      cat->add_tags(kSlowTag);
+  }
+  dsd.set_track_event_descriptor_raw(ted.SerializeAsString());
+
+  return register_data_source(dsd);
+}
+
+// static
+bool TrackEventInternal::AddSessionObserver(
+    TrackEventSessionObserver* observer) {
+  bool result = false;
+  ForEachObserver([&](TrackEventSessionObserver*& o) {
+    if (!o) {
+      o = observer;
+      result = true;
+      return false;
+    }
+    return true;
+  });
+  return result;
+}
+
+// static
+void TrackEventInternal::RemoveSessionObserver(
+    TrackEventSessionObserver* observer) {
+  ForEachObserver([&](TrackEventSessionObserver*& o) {
+    if (o == observer) {
+      o = nullptr;
+      return false;
+    }
+    return true;
+  });
+}
+
+// static
+void TrackEventInternal::EnableTracing(
+    const TrackEventCategoryRegistry& registry,
+    const protos::gen::TrackEventConfig& config,
+    const DataSourceBase::SetupArgs& args) {
+  for (size_t i = 0; i < registry.category_count(); i++) {
+    if (IsCategoryEnabled(registry, config, *registry.GetCategory(i)))
+      registry.EnableCategoryForInstance(i, args.internal_instance_index);
+  }
+  ForEachObserver([&](TrackEventSessionObserver*& o) {
+    if (o)
+      o->OnSetup(args);
+    return true;
+  });
+}
+
+// static
+void TrackEventInternal::OnStart(const DataSourceBase::StartArgs& args) {
+  session_count_.fetch_add(1);
+  ForEachObserver([&](TrackEventSessionObserver*& o) {
+    if (o)
+      o->OnStart(args);
+    return true;
+  });
+}
+
+// static
+void TrackEventInternal::DisableTracing(
+    const TrackEventCategoryRegistry& registry,
+    const DataSourceBase::StopArgs& args) {
+  ForEachObserver([&](TrackEventSessionObserver*& o) {
+    if (o)
+      o->OnStop(args);
+    return true;
+  });
+  for (size_t i = 0; i < registry.category_count(); i++)
+    registry.DisableCategoryForInstance(i, args.internal_instance_index);
+}
+
+// static
+bool TrackEventInternal::IsCategoryEnabled(
+    const TrackEventCategoryRegistry& registry,
+    const protos::gen::TrackEventConfig& config,
+    const Category& category) {
+  // If this is a group category, check if any of its constituent categories are
+  // enabled. If so, then this one is enabled too.
+  if (category.IsGroup()) {
+    bool result = false;
+    category.ForEachGroupMember([&](const char* member_name, size_t name_size) {
+      for (size_t i = 0; i < registry.category_count(); i++) {
+        const auto ref_category = registry.GetCategory(i);
+        // Groups can't refer to other groups.
+        if (ref_category->IsGroup())
+          continue;
+        // Require an exact match.
+        if (ref_category->name_size() != name_size ||
+            strncmp(ref_category->name, member_name, name_size)) {
+          continue;
+        }
+        if (IsCategoryEnabled(registry, config, *ref_category)) {
+          result = true;
+          // Break ForEachGroupMember() loop.
+          return false;
+        }
+        break;
+      }
+      // No match? Must be a dynamic category.
+      DynamicCategory dyn_category(std::string(member_name, name_size));
+      Category ref_category{Category::FromDynamicCategory(dyn_category)};
+      if (IsCategoryEnabled(registry, config, ref_category)) {
+        result = true;
+        // Break ForEachGroupMember() loop.
+        return false;
+      }
+      // No match found => keep iterating.
+      return true;
+    });
+    return result;
+  }
+
+  auto has_matching_tag = [&](std::function<bool(const char*)> matcher) {
+    for (const auto& tag : category.tags) {
+      if (!tag)
+        break;
+      if (matcher(tag))
+        return true;
+    }
+    // Legacy "disabled-by-default" categories automatically get the "slow" tag.
+    if (!strncmp(category.name, kLegacySlowPrefix, strlen(kLegacySlowPrefix)) &&
+        matcher(kSlowTag)) {
+      return true;
+    }
+    return false;
+  };
+
+  // First try exact matches, then pattern matches.
+  const std::array<MatchType, 2> match_types = {
+      {MatchType::kExact, MatchType::kPattern}};
+  for (auto match_type : match_types) {
+    // 1. Enabled categories.
+    if (NameMatchesPatternList(config.enabled_categories(), category.name,
+                               match_type)) {
+      return true;
+    }
+
+    // 2. Enabled tags.
+    if (has_matching_tag([&](const char* tag) {
+          return NameMatchesPatternList(config.enabled_tags(), tag, match_type);
+        })) {
+      return true;
+    }
+
+    // 3. Disabled categories.
+    if (NameMatchesPatternList(config.disabled_categories(), category.name,
+                               match_type)) {
+      return false;
+    }
+
+    // 4. Disabled tags.
+    if (has_matching_tag([&](const char* tag) {
+          if (config.disabled_tags_size()) {
+            return NameMatchesPatternList(config.disabled_tags(), tag,
+                                          match_type);
+          } else {
+            // The "slow" and "debug" tags are disabled by default.
+            return NameMatchesPattern(kSlowTag, tag, match_type) ||
+                   NameMatchesPattern(kDebugTag, tag, match_type);
+          }
+        })) {
+      return false;
+    }
+  }
+
+  // If nothing matched, enable the category by default.
+  return true;
+}
+
+// static
+uint64_t TrackEventInternal::GetTimeNs() {
+  if (GetClockId() == protos::pbzero::BUILTIN_CLOCK_BOOTTIME)
+    return static_cast<uint64_t>(perfetto::base::GetBootTimeNs().count());
+  PERFETTO_DCHECK(GetClockId() == protos::pbzero::BUILTIN_CLOCK_MONOTONIC);
+  return static_cast<uint64_t>(perfetto::base::GetWallTimeNs().count());
+}
+
+// static
+int TrackEventInternal::GetSessionCount() {
+  return session_count_.load();
+}
+
+// static
+void TrackEventInternal::ResetIncrementalState(TraceWriterBase* trace_writer,
+                                               uint64_t timestamp) {
+  auto default_track = ThreadTrack::Current();
+  {
+    // Mark any incremental state before this point invalid. Also set up
+    // defaults so that we don't need to repeat constant data for each packet.
+    auto packet = NewTracePacket(
+        trace_writer, timestamp,
+        protos::pbzero::TracePacket::SEQ_INCREMENTAL_STATE_CLEARED);
+    auto defaults = packet->set_trace_packet_defaults();
+    defaults->set_timestamp_clock_id(GetClockId());
+
+    // Establish the default track for this event sequence.
+    auto track_defaults = defaults->set_track_event_defaults();
+    track_defaults->set_track_uuid(default_track.uuid);
+  }
+
+  // Every thread should write a descriptor for its default track, because most
+  // trace points won't explicitly reference it.
+  WriteTrackDescriptor(default_track, trace_writer);
+
+  // Additionally the main thread should dump the process descriptor.
+  if (perfetto::base::GetThreadId() == g_main_thread)
+    WriteTrackDescriptor(ProcessTrack::Current(), trace_writer);
+}
+
+// static
+protozero::MessageHandle<protos::pbzero::TracePacket>
+TrackEventInternal::NewTracePacket(TraceWriterBase* trace_writer,
+                                   uint64_t timestamp,
+                                   uint32_t seq_flags) {
+  auto packet = trace_writer->NewTracePacket();
+  packet->set_timestamp(timestamp);
+  // TODO(skyostil): Stop emitting this for every event once the trace
+  // processor understands trace packet defaults.
+  if (GetClockId() != protos::pbzero::BUILTIN_CLOCK_BOOTTIME)
+    packet->set_timestamp_clock_id(GetClockId());
+  packet->set_sequence_flags(seq_flags);
+  return packet;
+}
+
+// static
+EventContext TrackEventInternal::WriteEvent(
+    TraceWriterBase* trace_writer,
+    TrackEventIncrementalState* incr_state,
+    const Category* category,
+    const char* name,
+    perfetto::protos::pbzero::TrackEvent::Type type,
+    uint64_t timestamp) {
+  PERFETTO_DCHECK(g_main_thread);
+  PERFETTO_DCHECK(!incr_state->was_cleared);
+
+  auto packet = NewTracePacket(trace_writer, timestamp);
+  EventContext ctx(std::move(packet), incr_state);
+
+  auto track_event = ctx.event();
+  if (type != protos::pbzero::TrackEvent::TYPE_UNSPECIFIED)
+    track_event->set_type(type);
+
+  // We assume that |category| and |name| point to strings with static lifetime.
+  // This means we can use their addresses as interning keys.
+  // TODO(skyostil): Intern categories at compile time.
+  if (category && type != protos::pbzero::TrackEvent::TYPE_SLICE_END &&
+      type != protos::pbzero::TrackEvent::TYPE_COUNTER) {
+    category->ForEachGroupMember(
+        [&](const char* member_name, size_t name_size) {
+          size_t category_iid =
+              InternedEventCategory::Get(&ctx, member_name, name_size);
+          track_event->add_category_iids(category_iid);
+          return true;
+        });
+  }
+  if (name && type != protos::pbzero::TrackEvent::TYPE_SLICE_END) {
+    size_t name_iid = InternedEventName::Get(&ctx, name);
+    track_event->set_name_iid(name_iid);
+  }
+  return ctx;
+}
+
+// static
+protos::pbzero::DebugAnnotation* TrackEventInternal::AddDebugAnnotation(
+    perfetto::EventContext* event_ctx,
+    const char* name) {
+  auto annotation = event_ctx->event()->add_debug_annotations();
+  annotation->set_name_iid(InternedDebugAnnotationName::Get(event_ctx, name));
+  return annotation;
+}
+
+}  // namespace internal
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/internal/track_event_interned_fields.cc
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/track_event_interned_fields.h"
+
+namespace perfetto {
+namespace internal {
+
+InternedEventCategory::~InternedEventCategory() = default;
+
+// static
+void InternedEventCategory::Add(protos::pbzero::InternedData* interned_data,
+                                size_t iid,
+                                const char* value,
+                                size_t length) {
+  auto category = interned_data->add_event_categories();
+  category->set_iid(iid);
+  category->set_name(value, length);
+}
+
+InternedEventName::~InternedEventName() = default;
+
+// static
+void InternedEventName::Add(protos::pbzero::InternedData* interned_data,
+                            size_t iid,
+                            const char* value) {
+  auto name = interned_data->add_event_names();
+  name->set_iid(iid);
+  name->set_name(value);
+}
+
+InternedDebugAnnotationName::~InternedDebugAnnotationName() = default;
+
+// static
+void InternedDebugAnnotationName::Add(
+    protos::pbzero::InternedData* interned_data,
+    size_t iid,
+    const char* value) {
+  auto name = interned_data->add_debug_annotation_names();
+  name->set_iid(iid);
+  name->set_name(value);
+}
+
+}  // namespace internal
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/platform.cc
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/tracing/platform.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/tracing_tls.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/trace_writer_base.h"
+
+namespace perfetto {
+
+PlatformThreadLocalObject::~PlatformThreadLocalObject() = default;
+Platform::~Platform() = default;
+
+// static
+std::unique_ptr<PlatformThreadLocalObject>
+PlatformThreadLocalObject::CreateInstance() {
+  return std::unique_ptr<PlatformThreadLocalObject>(new internal::TracingTLS());
+}
+
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/traced_value.cc
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/tracing/traced_value.h"
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/debug_annotation.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/debug_annotation.pbzero.h"
+
+namespace perfetto {
+
+namespace internal {
+
+TracedValue CreateTracedValueFromProto(
+    protos::pbzero::DebugAnnotation* context) {
+  return TracedValue::CreateFromProto(context);
+}
+
+}  // namespace internal
+
+// static
+TracedValue TracedValue::CreateFromProto(
+    protos::pbzero::DebugAnnotation* context) {
+  return TracedValue(context, nullptr);
+}
+
+void TracedValue::WriteInt64(int64_t value) && {
+  PERFETTO_DCHECK(checked_scope_.is_active());
+  context_->set_int_value(value);
+}
+
+void TracedValue::WriteUInt64(uint64_t value) && {
+  PERFETTO_DCHECK(checked_scope_.is_active());
+  context_->set_uint_value(value);
+}
+
+void TracedValue::WriteDouble(double value) && {
+  PERFETTO_DCHECK(checked_scope_.is_active());
+  context_->set_double_value(value);
+}
+
+void TracedValue::WriteBoolean(bool value) && {
+  PERFETTO_DCHECK(checked_scope_.is_active());
+  context_->set_bool_value(value);
+}
+
+void TracedValue::WriteString(const char* value) && {
+  PERFETTO_DCHECK(checked_scope_.is_active());
+  context_->set_string_value(value);
+}
+
+void TracedValue::WriteString(const char* value, size_t len) && {
+  PERFETTO_DCHECK(checked_scope_.is_active());
+  context_->set_string_value(value, len);
+}
+
+void TracedValue::WriteString(const std::string& value) && {
+  PERFETTO_DCHECK(checked_scope_.is_active());
+  context_->set_string_value(value);
+}
+
+void TracedValue::WritePointer(const void* value) && {
+  PERFETTO_DCHECK(checked_scope_.is_active());
+  context_->set_pointer_value(reinterpret_cast<uint64_t>(value));
+}
+
+TracedDictionary TracedValue::WriteDictionary() && {
+  // Note: this passes |checked_scope_.is_active_| bit to the parent to be
+  // picked up later by the new TracedDictionary.
+  PERFETTO_DCHECK(checked_scope_.is_active());
+  checked_scope_.Reset();
+
+  PERFETTO_DCHECK(!context_->is_finalized());
+  return TracedDictionary(context_, checked_scope_.parent_scope());
+}
+
+TracedArray TracedValue::WriteArray() && {
+  // Note: this passes |checked_scope_.is_active_| bit to the parent to be
+  // picked up later by the new TracedDictionary.
+  PERFETTO_DCHECK(checked_scope_.is_active());
+  checked_scope_.Reset();
+
+  PERFETTO_DCHECK(!context_->is_finalized());
+  return TracedArray(context_, checked_scope_.parent_scope());
+}
+
+TracedValue TracedArray::AppendItem() {
+  PERFETTO_DCHECK(checked_scope_.is_active());
+  return TracedValue(context_->add_array_values(), &checked_scope_);
+}
+
+TracedDictionary TracedArray::AppendDictionary() {
+  PERFETTO_DCHECK(checked_scope_.is_active());
+  return AppendItem().WriteDictionary();
+}
+
+TracedArray TracedArray::AppendArray() {
+  PERFETTO_DCHECK(checked_scope_.is_active());
+  return AppendItem().WriteArray();
+}
+
+TracedValue TracedDictionary::AddItem(StaticString key) {
+  PERFETTO_DCHECK(checked_scope_.is_active());
+  protos::pbzero::DebugAnnotation* item = context_->add_dict_entries();
+  item->set_name(key.value);
+  return TracedValue(item, &checked_scope_);
+}
+
+TracedValue TracedDictionary::AddItem(DynamicString key) {
+  PERFETTO_DCHECK(checked_scope_.is_active());
+  protos::pbzero::DebugAnnotation* item = context_->add_dict_entries();
+  item->set_name(key.value);
+  return TracedValue(item, &checked_scope_);
+}
+
+TracedDictionary TracedDictionary::AddDictionary(StaticString key) {
+  PERFETTO_DCHECK(checked_scope_.is_active());
+  return AddItem(key).WriteDictionary();
+}
+
+TracedDictionary TracedDictionary::AddDictionary(DynamicString key) {
+  PERFETTO_DCHECK(checked_scope_.is_active());
+  return AddItem(key).WriteDictionary();
+}
+
+TracedArray TracedDictionary::AddArray(StaticString key) {
+  PERFETTO_DCHECK(checked_scope_.is_active());
+  return AddItem(key).WriteArray();
+}
+
+TracedArray TracedDictionary::AddArray(DynamicString key) {
+  PERFETTO_DCHECK(checked_scope_.is_active());
+  return AddItem(key).WriteArray();
+}
+
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/tracing.cc
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/tracing/tracing.h"
+
+#include <atomic>
+#include <condition_variable>
+#include <mutex>
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/waitable_event.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/track_event_internal.h"
+// gen_amalgamated expanded: #include "src/tracing/internal/tracing_muxer_impl.h"
+
+namespace perfetto {
+namespace {
+bool g_was_initialized = false;
+}
+
+// static
+void Tracing::InitializeInternal(const TracingInitArgs& args) {
+  static TracingInitArgs init_args;
+  if (g_was_initialized) {
+    if (!(init_args == args)) {
+      PERFETTO_ELOG(
+          "Tracing::Initialize() called more than once with different args. "
+          "This is not supported, only the first call will have effect.");
+      PERFETTO_DCHECK(false);
+    }
+    return;
+  }
+
+  // Make sure the headers and implementation files agree on the build config.
+  PERFETTO_CHECK(args.dcheck_is_on_ == PERFETTO_DCHECK_IS_ON());
+  if (args.log_message_callback) {
+    SetLogMessageCallback(args.log_message_callback);
+  }
+  internal::TracingMuxerImpl::InitializeInstance(args);
+  internal::TrackRegistry::InitializeInstance();
+  g_was_initialized = true;
+  init_args = args;
+}
+
+// static
+bool Tracing::IsInitialized() {
+  return g_was_initialized;
+}
+
+//  static
+std::unique_ptr<TracingSession> Tracing::NewTrace(BackendType backend) {
+  return static_cast<internal::TracingMuxerImpl*>(internal::TracingMuxer::Get())
+      ->CreateTracingSession(backend);
+}
+
+// Can be called from any thread.
+bool TracingSession::FlushBlocking(uint32_t timeout_ms) {
+  std::atomic<bool> flush_result;
+  base::WaitableEvent flush_ack;
+
+  // The non blocking Flush() can be called on any thread. It does the PostTask
+  // internally.
+  Flush(
+      [&flush_ack, &flush_result](bool res) {
+        flush_result = res;
+        flush_ack.Notify();
+      },
+      timeout_ms);
+  flush_ack.Wait();
+  return flush_result;
+}
+
+std::vector<char> TracingSession::ReadTraceBlocking() {
+  std::vector<char> raw_trace;
+  std::mutex mutex;
+  std::condition_variable cv;
+
+  bool all_read = false;
+
+  ReadTrace([&mutex, &raw_trace, &all_read, &cv](ReadTraceCallbackArgs cb) {
+    raw_trace.insert(raw_trace.end(), cb.data, cb.data + cb.size);
+    std::unique_lock<std::mutex> lock(mutex);
+    all_read = !cb.has_more;
+    if (all_read)
+      cv.notify_one();
+  });
+
+  {
+    std::unique_lock<std::mutex> lock(mutex);
+    cv.wait(lock, [&all_read] { return all_read; });
+  }
+  return raw_trace;
+}
+
+TracingSession::GetTraceStatsCallbackArgs
+TracingSession::GetTraceStatsBlocking() {
+  std::mutex mutex;
+  std::condition_variable cv;
+  GetTraceStatsCallbackArgs result;
+  bool stats_read = false;
+
+  GetTraceStats(
+      [&mutex, &result, &stats_read, &cv](GetTraceStatsCallbackArgs args) {
+        result = std::move(args);
+        std::unique_lock<std::mutex> lock(mutex);
+        stats_read = true;
+        cv.notify_one();
+      });
+
+  {
+    std::unique_lock<std::mutex> lock(mutex);
+    cv.wait(lock, [&stats_read] { return stats_read; });
+  }
+  return result;
+}
+
+TracingSession::QueryServiceStateCallbackArgs
+TracingSession::QueryServiceStateBlocking() {
+  std::mutex mutex;
+  std::condition_variable cv;
+  QueryServiceStateCallbackArgs result;
+  bool status_read = false;
+
+  QueryServiceState(
+      [&mutex, &result, &status_read, &cv](QueryServiceStateCallbackArgs args) {
+        result = std::move(args);
+        std::unique_lock<std::mutex> lock(mutex);
+        status_read = true;
+        cv.notify_one();
+      });
+
+  {
+    std::unique_lock<std::mutex> lock(mutex);
+    cv.wait(lock, [&status_read] { return status_read; });
+  }
+  return result;
+}
+
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/tracing_policy.cc
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/tracing/tracing_policy.h"
+
+namespace perfetto {
+
+TracingPolicy::~TracingPolicy() = default;
+
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/track.cc
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/tracing/track.h"
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/file_utils.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/hash.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/scoped_file.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/string_splitter.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/string_utils.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/thread_utils.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/uuid.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/track_event_data_source.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/counter_descriptor.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/process_descriptor.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/process_descriptor.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/thread_descriptor.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/thread_descriptor.pbzero.h"
+
+namespace perfetto {
+
+// static
+uint64_t Track::process_uuid;
+
+protos::gen::TrackDescriptor Track::Serialize() const {
+  protos::gen::TrackDescriptor desc;
+  desc.set_uuid(uuid);
+  if (parent_uuid)
+    desc.set_parent_uuid(parent_uuid);
+  return desc;
+}
+
+void Track::Serialize(protos::pbzero::TrackDescriptor* desc) const {
+  auto bytes = Serialize().SerializeAsString();
+  desc->AppendRawProtoBytes(bytes.data(), bytes.size());
+}
+
+protos::gen::TrackDescriptor ProcessTrack::Serialize() const {
+  auto desc = Track::Serialize();
+  auto pd = desc.mutable_process();
+  pd->set_pid(static_cast<int32_t>(pid));
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+  std::string cmdline;
+  if (base::ReadFile("/proc/self/cmdline", &cmdline)) {
+    // Since cmdline is a zero-terminated list of arguments, this ends up
+    // writing just the first element, i.e., the process name, into the process
+    // name field.
+    pd->set_process_name(cmdline.c_str());
+    base::StringSplitter splitter(std::move(cmdline), '\0');
+    while (splitter.Next()) {
+      pd->add_cmdline(
+          std::string(splitter.cur_token(), splitter.cur_token_size()));
+    }
+  }
+  // TODO(skyostil): Record command line on Windows and Mac.
+#endif
+  return desc;
+}
+
+void ProcessTrack::Serialize(protos::pbzero::TrackDescriptor* desc) const {
+  auto bytes = Serialize().SerializeAsString();
+  desc->AppendRawProtoBytes(bytes.data(), bytes.size());
+}
+
+protos::gen::TrackDescriptor ThreadTrack::Serialize() const {
+  auto desc = Track::Serialize();
+  auto td = desc.mutable_thread();
+  td->set_pid(static_cast<int32_t>(pid));
+  td->set_tid(static_cast<int32_t>(tid));
+  std::string thread_name;
+  if (base::GetThreadName(thread_name))
+    td->set_thread_name(thread_name);
+  return desc;
+}
+
+void ThreadTrack::Serialize(protos::pbzero::TrackDescriptor* desc) const {
+  auto bytes = Serialize().SerializeAsString();
+  desc->AppendRawProtoBytes(bytes.data(), bytes.size());
+}
+
+protos::gen::TrackDescriptor CounterTrack::Serialize() const {
+  auto desc = Track::Serialize();
+  desc.set_name(name_);
+  auto* counter = desc.mutable_counter();
+  if (category_)
+    counter->add_categories(category_);
+  if (unit_ != perfetto::protos::pbzero::CounterDescriptor::UNIT_UNSPECIFIED)
+    counter->set_unit(static_cast<protos::gen::CounterDescriptor_Unit>(unit_));
+  if (unit_name_)
+    counter->set_unit_name(unit_name_);
+  if (unit_multiplier_ != 1)
+    counter->set_unit_multiplier(unit_multiplier_);
+  if (is_incremental_)
+    counter->set_is_incremental(is_incremental_);
+  return desc;
+}
+
+void CounterTrack::Serialize(protos::pbzero::TrackDescriptor* desc) const {
+  auto bytes = Serialize().SerializeAsString();
+  desc->AppendRawProtoBytes(bytes.data(), bytes.size());
+}
+
+namespace internal {
+namespace {
+
+uint64_t GetProcessStartTime() {
+#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  std::string stat;
+  if (!base::ReadFile("/proc/self/stat", &stat))
+    return 0u;
+  // The stat file is a single line split into space-separated fields as "pid
+  // (comm) state ppid ...". However because the command name can contain any
+  // characters (including parentheses and spaces), we need to skip past it
+  // before parsing the rest of the fields. To do that, we look for the last
+  // instance of ") " (parentheses followed by space) and parse forward from
+  // that point.
+  size_t comm_end = stat.rfind(") ");
+  if (comm_end == std::string::npos)
+    return 0u;
+  stat = stat.substr(comm_end + strlen(") "));
+  base::StringSplitter splitter(stat, ' ');
+  for (size_t skip = 0; skip < 20; skip++) {
+    if (!splitter.Next())
+      return 0u;
+  }
+  return base::CStringToUInt64(splitter.cur_token()).value_or(0u);
+#else
+  return 0;
+#endif  // !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+}
+
+}  // namespace
+
+// static
+TrackRegistry* TrackRegistry::instance_;
+
+TrackRegistry::TrackRegistry() = default;
+TrackRegistry::~TrackRegistry() = default;
+
+// static
+void TrackRegistry::InitializeInstance() {
+  // TODO(eseckler): Chrome may call this more than once. Once Chrome doesn't
+  // call this directly anymore, bring back DCHECK(!instance_) instead.
+  if (instance_)
+    return;
+  instance_ = new TrackRegistry();
+
+  // Use the process start time + pid as the unique identifier for this process.
+  // This ensures that if there are two independent copies of the Perfetto SDK
+  // in the same process (e.g., one in the app and another in a system
+  // framework), events emitted by each will be consistently interleaved on
+  // common thread and process tracks.
+  if (uint64_t start_time = GetProcessStartTime()) {
+    base::Hash hash;
+    hash.Update(start_time);
+    hash.Update(base::GetProcessId());
+    Track::process_uuid = hash.digest();
+  } else {
+    // Fall back to a randomly generated identifier.
+    Track::process_uuid = static_cast<uint64_t>(base::Uuidv4().lsb());
+  }
+}
+
+void TrackRegistry::UpdateTrack(Track track,
+                                const std::string& serialized_desc) {
+  std::lock_guard<std::mutex> lock(mutex_);
+  tracks_[track.uuid] = std::move(serialized_desc);
+}
+
+void TrackRegistry::UpdateTrackImpl(
+    Track track,
+    std::function<void(protos::pbzero::TrackDescriptor*)> fill_function) {
+  constexpr size_t kInitialSliceSize = 32;
+  constexpr size_t kMaximumSliceSize = 4096;
+  protozero::HeapBuffered<protos::pbzero::TrackDescriptor> new_descriptor(
+      kInitialSliceSize, kMaximumSliceSize);
+  fill_function(new_descriptor.get());
+  auto serialized_desc = new_descriptor.SerializeAsString();
+  UpdateTrack(track, serialized_desc);
+}
+
+void TrackRegistry::EraseTrack(Track track) {
+  std::lock_guard<std::mutex> lock(mutex_);
+  tracks_.erase(track.uuid);
+}
+
+// static
+void TrackRegistry::WriteTrackDescriptor(
+    const SerializedTrackDescriptor& desc,
+    protozero::MessageHandle<protos::pbzero::TracePacket> packet) {
+  packet->AppendString(
+      perfetto::protos::pbzero::TracePacket::kTrackDescriptorFieldNumber, desc);
+}
+
+}  // namespace internal
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/track_event_category_registry.cc
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/tracing/track_event_category_registry.h"
+
+namespace perfetto {
+
+// static
+Category Category::FromDynamicCategory(const char* name) {
+  if (GetNthNameSize(1, name, name)) {
+    Category group(Group(name));
+    PERFETTO_DCHECK(group.name);
+    return group;
+  }
+  Category category(name);
+  PERFETTO_DCHECK(category.name);
+  return category;
+}
+
+Category Category::FromDynamicCategory(
+    const DynamicCategory& dynamic_category) {
+  return FromDynamicCategory(dynamic_category.name.c_str());
+}
+
+namespace internal {
+
+perfetto::DynamicCategory NullCategory(const perfetto::DynamicCategory&) {
+  return perfetto::DynamicCategory{};
+}
+
+void TrackEventCategoryRegistry::EnableCategoryForInstance(
+    size_t category_index,
+    uint32_t instance_index) const {
+  PERFETTO_DCHECK(instance_index < kMaxDataSourceInstances);
+  PERFETTO_DCHECK(category_index < category_count_);
+  // Matches the acquire_load in DataSource::Trace().
+  state_storage_[category_index].fetch_or(
+      static_cast<uint8_t>(1u << instance_index), std::memory_order_release);
+}
+
+void TrackEventCategoryRegistry::DisableCategoryForInstance(
+    size_t category_index,
+    uint32_t instance_index) const {
+  PERFETTO_DCHECK(instance_index < kMaxDataSourceInstances);
+  PERFETTO_DCHECK(category_index < category_count_);
+  // Matches the acquire_load in DataSource::Trace().
+  state_storage_[category_index].fetch_and(
+      static_cast<uint8_t>(~(1u << instance_index)), std::memory_order_release);
+}
+
+}  // namespace internal
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/track_event_legacy.cc
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/tracing/track_event_legacy.h"
+
+// gen_amalgamated expanded: #include "perfetto/tracing/track.h"
+
+namespace perfetto {
+namespace legacy {
+
+template <>
+ThreadTrack ConvertThreadId(const PerfettoLegacyCurrentThreadId&) {
+  // Because of the short-circuit in PERFETTO_INTERNAL_LEGACY_EVENT, we should
+  // never get here.
+  PERFETTO_DCHECK(false);
+  return ThreadTrack::Current();
+}
+
+}  // namespace legacy
+
+namespace internal {
+
+void LegacyTraceId::Write(protos::pbzero::TrackEvent::LegacyEvent* event,
+                          uint32_t event_flags) const {
+  // Legacy flow events always use bind_id.
+  if (event_flags &
+      (legacy::kTraceEventFlagFlowOut | legacy::kTraceEventFlagFlowIn)) {
+    // Flow bind_ids don't have scopes, so we need to mangle in-process ones to
+    // avoid collisions.
+    if (id_flags_ & legacy::kTraceEventFlagHasLocalId) {
+      event->set_bind_id(raw_id_ ^ ProcessTrack::Current().uuid);
+    } else {
+      event->set_bind_id(raw_id_);
+    }
+    return;
+  }
+
+  uint32_t scope_flags = id_flags_ & (legacy::kTraceEventFlagHasId |
+                                      legacy::kTraceEventFlagHasLocalId |
+                                      legacy::kTraceEventFlagHasGlobalId);
+  switch (scope_flags) {
+    case legacy::kTraceEventFlagHasId:
+      event->set_unscoped_id(raw_id_);
+      break;
+    case legacy::kTraceEventFlagHasLocalId:
+      event->set_local_id(raw_id_);
+      break;
+    case legacy::kTraceEventFlagHasGlobalId:
+      event->set_global_id(raw_id_);
+      break;
+  }
+  if (scope_)
+    event->set_id_scope(scope_);
+}
+
+}  // namespace internal
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/track_event_state_tracker.cc
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/tracing/track_event_state_tracker.h"
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/hash.h"
+
+// gen_amalgamated expanded: #include "protos/perfetto/common/interceptor_descriptor.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/interned_data/interned_data.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/trace_packet.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/trace_packet_defaults.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/debug_annotation.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/process_descriptor.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/thread_descriptor.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/track_descriptor.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/track_event.pbzero.h"
+
+namespace perfetto {
+
+TrackEventStateTracker::~TrackEventStateTracker() = default;
+TrackEventStateTracker::Delegate::~Delegate() = default;
+
+// static
+void TrackEventStateTracker::ProcessTracePacket(
+    Delegate& delegate,
+    SequenceState& sequence_state,
+    const protos::pbzero::TracePacket_Decoder& packet) {
+  UpdateIncrementalState(delegate, sequence_state, packet);
+
+  if (!packet.has_track_event())
+    return;
+  perfetto::protos::pbzero::TrackEvent::Decoder track_event(
+      packet.track_event());
+
+  // TODO(skyostil): Support incremental timestamps.
+  uint64_t timestamp = packet.timestamp();
+
+  Track* track = &sequence_state.track;
+  if (track_event.has_track_uuid()) {
+    auto* session_state = delegate.GetSessionState();
+    if (!session_state)
+      return;  // Tracing must have ended.
+    track = &session_state->tracks[track_event.track_uuid()];
+  }
+
+  // We only log the first category of each event.
+  protozero::ConstChars category{};
+  uint64_t category_iid = 0;
+  if (auto iid_it = track_event.category_iids()) {
+    category_iid = *iid_it;
+    category.data = sequence_state.event_categories[category_iid].data();
+    category.size = sequence_state.event_categories[category_iid].size();
+  } else if (auto cat_it = track_event.categories()) {
+    category.data = reinterpret_cast<const char*>(cat_it->data());
+    category.size = cat_it->size();
+  }
+
+  protozero::ConstChars name{};
+  uint64_t name_iid = track_event.name_iid();
+  uint64_t name_hash = 0;
+  uint64_t duration = 0;
+  if (name_iid) {
+    name.data = sequence_state.event_names[name_iid].data();
+    name.size = sequence_state.event_names[name_iid].size();
+  } else if (track_event.has_name()) {
+    name.data = track_event.name().data;
+    name.size = track_event.name().size;
+  }
+
+  if (name.data) {
+    base::Hash hash;
+    hash.Update(name.data, name.size);
+    name_hash = hash.digest();
+  }
+
+  size_t depth = track->stack.size();
+  switch (track_event.type()) {
+    case protos::pbzero::TrackEvent::TYPE_SLICE_BEGIN: {
+      StackFrame frame;
+      frame.timestamp = timestamp;
+      frame.name_hash = name_hash;
+      if (track_event.has_track_uuid()) {
+        frame.name = name.ToStdString();
+        frame.category = category.ToStdString();
+      } else {
+        frame.name_iid = name_iid;
+        frame.category_iid = category_iid;
+      }
+      track->stack.push_back(std::move(frame));
+      break;
+    }
+    case protos::pbzero::TrackEvent::TYPE_SLICE_END:
+      if (!track->stack.empty()) {
+        const auto& prev_frame = track->stack.back();
+        if (prev_frame.name_iid) {
+          name.data = sequence_state.event_names[prev_frame.name_iid].data();
+          name.size = sequence_state.event_names[prev_frame.name_iid].size();
+        } else {
+          name.data = prev_frame.name.data();
+          name.size = prev_frame.name.size();
+        }
+        name_hash = prev_frame.name_hash;
+        if (prev_frame.category_iid) {
+          category.data =
+              sequence_state.event_categories[prev_frame.category_iid].data();
+          category.size =
+              sequence_state.event_categories[prev_frame.category_iid].size();
+        } else {
+          category.data = prev_frame.category.data();
+          category.size = prev_frame.category.size();
+        }
+        duration = timestamp - prev_frame.timestamp;
+        depth--;
+      }
+      break;
+    case protos::pbzero::TrackEvent::TYPE_INSTANT:
+      break;
+    case protos::pbzero::TrackEvent::TYPE_COUNTER:
+    case protos::pbzero::TrackEvent::TYPE_UNSPECIFIED:
+      // TODO(skyostil): Support counters.
+      return;
+  }
+
+  ParsedTrackEvent parsed_event{track_event};
+  parsed_event.timestamp_ns = timestamp;
+  parsed_event.duration_ns = duration;
+  parsed_event.stack_depth = depth;
+  parsed_event.category = category;
+  parsed_event.name = name;
+  parsed_event.name_hash = name_hash;
+  delegate.OnTrackEvent(*track, parsed_event);
+
+  if (track_event.type() == protos::pbzero::TrackEvent::TYPE_SLICE_END &&
+      !track->stack.empty()) {
+    track->stack.pop_back();
+  }
+}
+
+// static
+void TrackEventStateTracker::UpdateIncrementalState(
+    Delegate& delegate,
+    SequenceState& sequence_state,
+    const protos::pbzero::TracePacket_Decoder& packet) {
+#if PERFETTO_DCHECK_IS_ON()
+  if (!sequence_state.sequence_id) {
+    sequence_state.sequence_id = packet.trusted_packet_sequence_id();
+  } else {
+    PERFETTO_DCHECK(sequence_state.sequence_id ==
+                    packet.trusted_packet_sequence_id());
+  }
+#endif
+
+  if (packet.sequence_flags() &
+      perfetto::protos::pbzero::TracePacket::SEQ_INCREMENTAL_STATE_CLEARED) {
+    // Convert any existing event names and categories on the stack to
+    // non-interned strings so we can look up their names even after the
+    // incremental state is gone.
+    for (auto& frame : sequence_state.track.stack) {
+      if (frame.name_iid) {
+        frame.name = sequence_state.event_names[frame.name_iid];
+        frame.name_iid = 0u;
+      }
+      if (frame.category_iid) {
+        frame.category = sequence_state.event_categories[frame.category_iid];
+        frame.category_iid = 0u;
+      }
+    }
+    sequence_state.event_names.clear();
+    sequence_state.event_categories.clear();
+    sequence_state.debug_annotation_names.clear();
+    sequence_state.track.uuid = 0u;
+    sequence_state.track.index = 0u;
+  }
+  if (packet.has_interned_data()) {
+    perfetto::protos::pbzero::InternedData::Decoder interned_data(
+        packet.interned_data());
+    for (auto it = interned_data.event_names(); it; it++) {
+      perfetto::protos::pbzero::EventName::Decoder entry(*it);
+      sequence_state.event_names[entry.iid()] = entry.name().ToStdString();
+    }
+    for (auto it = interned_data.event_categories(); it; it++) {
+      perfetto::protos::pbzero::EventCategory::Decoder entry(*it);
+      sequence_state.event_categories[entry.iid()] = entry.name().ToStdString();
+    }
+    for (auto it = interned_data.debug_annotation_names(); it; it++) {
+      perfetto::protos::pbzero::DebugAnnotationName::Decoder entry(*it);
+      sequence_state.debug_annotation_names[entry.iid()] =
+          entry.name().ToStdString();
+    }
+  }
+  if (packet.has_trace_packet_defaults()) {
+    perfetto::protos::pbzero::TracePacketDefaults::Decoder defaults(
+        packet.trace_packet_defaults());
+    if (defaults.has_track_event_defaults()) {
+      perfetto::protos::pbzero::TrackEventDefaults::Decoder
+          track_event_defaults(defaults.track_event_defaults());
+      sequence_state.track.uuid = track_event_defaults.track_uuid();
+    }
+  }
+  if (packet.has_track_descriptor()) {
+    perfetto::protos::pbzero::TrackDescriptor::Decoder track_descriptor(
+        packet.track_descriptor());
+    auto* session_state = delegate.GetSessionState();
+    auto& track = session_state->tracks[track_descriptor.uuid()];
+    if (!track.index)
+      track.index = static_cast<uint32_t>(session_state->tracks.size() + 1);
+    track.uuid = track_descriptor.uuid();
+
+    track.name = track_descriptor.name().ToStdString();
+    track.pid = 0;
+    track.tid = 0;
+    if (track_descriptor.has_process()) {
+      perfetto::protos::pbzero::ProcessDescriptor::Decoder process(
+          track_descriptor.process());
+      track.pid = process.pid();
+      if (track.name.empty())
+        track.name = process.process_name().ToStdString();
+    } else if (track_descriptor.has_thread()) {
+      perfetto::protos::pbzero::ThreadDescriptor::Decoder thread(
+          track_descriptor.thread());
+      track.pid = thread.pid();
+      track.tid = thread.tid();
+      if (track.name.empty())
+        track.name = thread.thread_name().ToStdString();
+    }
+    delegate.OnTrackUpdated(track);
+
+    // Mirror properties to the default track of the sequence. Note that
+    // this does not catch updates to the default track written through other
+    // sequences.
+    if (track.uuid == sequence_state.track.uuid) {
+      sequence_state.track.index = track.index;
+      sequence_state.track.name = track.name;
+      sequence_state.track.pid = track.pid;
+      sequence_state.track.tid = track.tid;
+      sequence_state.track.user_data = track.user_data;
+    }
+  }
+}
+
+TrackEventStateTracker::ParsedTrackEvent::ParsedTrackEvent(
+    const perfetto::protos::pbzero::TrackEvent::Decoder& track_event_)
+    : track_event(track_event_) {}
+
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/virtual_destructors.cc
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/tracing_tls.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/tracing.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/tracing_backend.h"
+
+// This translation unit contains the definitions for the destructor of pure
+// virtual interfaces for the src/public:public target. The alternative would be
+// introducing a one-liner .cc file for each pure virtual interface, which is
+// overkill. This is for compliance with -Wweak-vtables.
+
+namespace perfetto {
+namespace internal {
+
+TracingTLS::~TracingTLS() {
+  // Avoid entering trace points while the thread is being torn down.
+  is_in_trace_point = true;
+}
+
+}  // namespace internal
+
+TracingBackend::~TracingBackend() = default;
+TracingSession::~TracingSession() = default;
+
+}  // namespace perfetto
+// gen_amalgamated begin source: src/android_stats/statsd_logging_helper.cc
+// gen_amalgamated begin header: src/android_stats/statsd_logging_helper.h
+// gen_amalgamated begin header: src/android_stats/perfetto_atoms.h
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SRC_ANDROID_STATS_PERFETTO_ATOMS_H_
+#define SRC_ANDROID_STATS_PERFETTO_ATOMS_H_
+
+namespace perfetto {
+
+// This must match the values of the PerfettoUploadEvent enum in:
+// frameworks/proto_logging/stats/atoms.proto
+enum class PerfettoStatsdAtom {
+  kUndefined = 0,
+
+  // Checkpoints inside perfetto_cmd before tracing is finished.
+  kTraceBegin = 1,
+  kBackgroundTraceBegin = 2,
+  kOnConnect = 3,
+
+  // Guardrails inside perfetto_cmd before tracing is finished.
+  kOnTimeout = 16,
+  kCmdUserBuildTracingNotAllowed = 43,
+  kCmdFailedToInitGuardrailState = 44,
+  kCmdInvalidGuardrailState = 45,
+  kCmdHitUploadLimit = 46,
+
+  // Checkpoints inside traced.
+  kTracedEnableTracing = 37,
+  kTracedStartTracing = 38,
+  kTracedDisableTracing = 39,
+  kTracedNotifyTracingDisabled = 40,
+
+  // Trigger checkpoints inside traced.
+  // These atoms are special because, along with the UUID,
+  // they log the trigger name.
+  kTracedTriggerStartTracing = 41,
+  kTracedTriggerStopTracing = 42,
+
+  // Guardrails inside traced.
+  kTracedEnableTracingExistingTraceSession = 18,
+  kTracedEnableTracingTooLongTrace = 19,
+  kTracedEnableTracingInvalidTriggerTimeout = 20,
+  kTracedEnableTracingDurationWithTrigger = 21,
+  kTracedEnableTracingStopTracingWriteIntoFile = 22,
+  kTracedEnableTracingDuplicateTriggerName = 23,
+  kTracedEnableTracingInvalidDeferredStart = 24,
+  kTracedEnableTracingInvalidBufferSize = 25,
+  kTracedEnableTracingBufferSizeTooLarge = 26,
+  kTracedEnableTracingTooManyBuffers = 27,
+  kTracedEnableTracingDuplicateSessionName = 28,
+  kTracedEnableTracingSessionNameTooRecent = 29,
+  kTracedEnableTracingTooManySessionsForUid = 30,
+  kTracedEnableTracingTooManyConcurrentSessions = 31,
+  kTracedEnableTracingInvalidFdOutputFile = 32,
+  kTracedEnableTracingFailedToCreateFile = 33,
+  kTracedEnableTracingOom = 34,
+  kTracedEnableTracingUnknown = 35,
+  kTracedStartTracingInvalidSessionState = 36,
+  kTracedEnableTracingInvalidFilter = 47,
+
+  // Checkpoints inside perfetto_cmd after tracing has finished.
+  kOnTracingDisabled = 4,
+  kUploadIncidentBegin = 8,
+  kFinalizeTraceAndExit = 11,
+  kNotUploadingEmptyTrace = 17,
+
+  // Guardrails inside perfetto_cmd after tracing has finished.
+  kUploadIncidentFailure = 10,
+
+  // Deprecated as "success" is misleading; it simply means we were
+  // able to communicate with incidentd. Will be removed once
+  // incidentd is properly instrumented.
+  kUploadIncidentSuccess = 9,
+
+  // Deprecated as has the potential to be too spammy. Will be
+  // replaced with a whole new atom proto which uses a count metric
+  // instead of the event metric used for this proto.
+  kTriggerBegin = 12,
+  kTriggerSuccess = 13,
+  kTriggerFailure = 14,
+
+  // Deprecated as too coarse grained to be useful. Will be replaced
+  // with better broken down atoms as we do with traced.
+  kHitGuardrails = 15,
+
+  // Contained status of Dropbox uploads. Removed as Perfetto no
+  // longer supports uploading traces using Dropbox.
+  // reserved 5, 6, 7;
+};
+
+// This must match the values of the PerfettoTrigger::TriggerType enum in:
+// frameworks/base/cmds/statsd/src/atoms.proto
+enum PerfettoTriggerAtom {
+  kUndefined = 0,
+
+  kCmdTrigger = 1,
+  kCmdTriggerFail = 2,
+
+  kTriggerPerfettoTrigger = 3,
+  kTriggerPerfettoTriggerFail = 4,
+
+  kTracedLimitProbability = 5,
+  kTracedLimitMaxPer24h = 6,
+
+  kProbesProducerTrigger = 7,
+  kProbesProducerTriggerFail = 8,
+};
+
+}  // namespace perfetto
+
+#endif  // SRC_ANDROID_STATS_PERFETTO_ATOMS_H_
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SRC_ANDROID_STATS_STATSD_LOGGING_HELPER_H_
+#define SRC_ANDROID_STATS_STATSD_LOGGING_HELPER_H_
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+
+// gen_amalgamated expanded: #include "src/android_stats/perfetto_atoms.h"
+
+namespace perfetto {
+namespace android_stats {
+
+// Functions in this file are only active on built in the Android
+// tree. On other platforms (including Android standalone and Chromium
+// on Android) these functions are a noop.
+
+// Logs the upload event to statsd if built in the Android tree.
+void MaybeLogUploadEvent(PerfettoStatsdAtom atom,
+                         int64_t uuid_lsb,
+                         int64_t uuid_msb,
+                         const std::string& trigger_name = "");
+
+// Logs the trigger events to statsd if built in the Android tree.
+void MaybeLogTriggerEvent(PerfettoTriggerAtom atom, const std::string& trigger);
+
+// Logs the trigger events to statsd if built in the Android tree.
+void MaybeLogTriggerEvents(PerfettoTriggerAtom atom,
+                           const std::vector<std::string>& triggers);
+
+}  // namespace android_stats
+}  // namespace perfetto
+
+#endif  // SRC_ANDROID_STATS_STATSD_LOGGING_HELPER_H_
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "src/android_stats/statsd_logging_helper.h"
+
+#include <string>
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+// gen_amalgamated expanded: #include "perfetto/base/compiler.h"
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) && \
+    PERFETTO_BUILDFLAG(PERFETTO_ANDROID_BUILD)
+// gen_amalgamated expanded: #include "src/android_internal/lazy_library_loader.h"  // nogncheck
+// gen_amalgamated expanded: #include "src/android_internal/statsd_logging.h"       // nogncheck
+#endif
+
+namespace perfetto {
+namespace android_stats {
+
+// Make sure we don't accidentally log on non-Android tree build. Note that even
+// removing this ifdef still doesn't make uploads work on OS_ANDROID.
+// PERFETTO_LAZY_LOAD will return a nullptr on non-Android and non-in-tree
+// builds as libperfetto_android_internal will not be available.
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) && \
+    PERFETTO_BUILDFLAG(PERFETTO_ANDROID_BUILD)
+
+void MaybeLogUploadEvent(PerfettoStatsdAtom atom,
+                         int64_t uuid_lsb,
+                         int64_t uuid_msb,
+                         const std::string& trigger_name) {
+  PERFETTO_LAZY_LOAD(android_internal::StatsdLogUploadEvent, log_event_fn);
+  if (log_event_fn) {
+    log_event_fn(atom, uuid_lsb, uuid_msb, trigger_name.c_str());
+  }
+}
+
+void MaybeLogTriggerEvent(PerfettoTriggerAtom atom,
+                          const std::string& trigger_name) {
+  PERFETTO_LAZY_LOAD(android_internal::StatsdLogTriggerEvent, log_event_fn);
+  if (log_event_fn) {
+    log_event_fn(atom, trigger_name.c_str());
+  }
+}
+
+void MaybeLogTriggerEvents(PerfettoTriggerAtom atom,
+                           const std::vector<std::string>& triggers) {
+  PERFETTO_LAZY_LOAD(android_internal::StatsdLogTriggerEvent, log_event_fn);
+  if (log_event_fn) {
+    for (const std::string& trigger_name : triggers) {
+      log_event_fn(atom, trigger_name.c_str());
+    }
+  }
+}
+
+#else
+void MaybeLogUploadEvent(PerfettoStatsdAtom,
+                         int64_t,
+                         int64_t,
+                         const std::string&) {}
+void MaybeLogTriggerEvent(PerfettoTriggerAtom, const std::string&) {}
+void MaybeLogTriggerEvents(PerfettoTriggerAtom,
+                           const std::vector<std::string>&) {}
+#endif
+
+}  // namespace android_stats
+}  // namespace perfetto
+// gen_amalgamated begin source: src/protozero/filtering/filter_bytecode_parser.cc
+// gen_amalgamated begin header: src/protozero/filtering/filter_bytecode_parser.h
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SRC_PROTOZERO_FILTERING_FILTER_BYTECODE_PARSER_H_
+#define SRC_PROTOZERO_FILTERING_FILTER_BYTECODE_PARSER_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include <vector>
+
+namespace protozero {
+
+// Loads the proto-encoded bytecode in memory and allows fast lookups for tuples
+// (msg_index, field_id) to tell if a given field should be allowed or not and,
+// in the case of nested fields, what is the next message index to recurse into.
+// This class does two things:
+// 1. Expands the array of varint from the proto into a vector<uint32_t>. This
+//    is to avoid performing varint decoding on every lookup, at the cost of
+//    some extra memory (2KB-4KB). Note that the expanded vector is not just a
+//    1:1 copy of the proto one (more below). This is to avoid O(Fields) linear
+//    lookup complexity.
+// 2. Creates an index of offsets to remember the start word for each message.
+//    This is so we can jump to O(1) to the N-th message when recursing into a
+//    nested fields, without having to scan and find the (N-1)-th END_OF_MESSAGE
+//    marker.
+// Overall lookups are O(1) for field ids < 128 (kDirectlyIndexLimit) and O(N),
+// with N being the number of allowed field ranges for other fields.
+// See comments around |word_| below for the structure of the word vector.
+class FilterBytecodeParser {
+ public:
+  // Result of a Query() operation
+  struct QueryResult {
+    bool allowed;  // Whether the field is allowed at all or no.
+
+    // If |allowed|==true && simple_field()==false, this tells the message index
+    // of the nested field that should be used when recursing in the parser.
+    uint32_t nested_msg_index;
+
+    // If |allowed|==true, specifies if the field is of a simple type (varint,
+    // fixed32/64, string or byte) or a nested field that needs recursion.
+    // In the latter case the caller is expected to use |nested_msg_index| for
+    // the next Query() calls.
+    bool simple_field() const { return nested_msg_index == kSimpleField; }
+  };
+
+  // Loads a filter. The filter data consists of a sequence of varints which
+  // contains the filter opcodes and a final checksum.
+  bool Load(const void* filter_data, size_t len);
+
+  // Checks wheter a given field is allowed or not.
+  // msg_index = 0 is the index of the root message, where all queries should
+  // start from (typically perfetto.protos.Trace).
+  QueryResult Query(uint32_t msg_index, uint32_t field_id);
+
+  void Reset();
+  void set_suppress_logs_for_fuzzer(bool x) { suppress_logs_for_fuzzer_ = x; }
+
+ private:
+  static constexpr uint32_t kDirectlyIndexLimit = 128;
+  static constexpr uint32_t kAllowed = 1u << 31u;
+  static constexpr uint32_t kSimpleField = 0x7fffffff;
+
+  bool LoadInternal(const uint8_t* filter_data, size_t len);
+
+  // The state of all fields for all messages is stored in one contiguous array.
+  // This is to avoid memory fragmentation and allocator overhead.
+  // We expect a high number of messages (hundreds), but each message is small.
+  // For each message we store two sets of uint32:
+  // 1. A set of "directly indexed" fields, for field ids < 128.
+  // 2. The remainder is a set of ranges.
+  // So each message descriptor consists of a sequence of words as follows:
+  //
+  // [0] -> how many directly indexed fields are stored next (up to 128)
+  //
+  // [1..N] -> One word per field id (See "field state" below).
+  //
+  // [N + 1] -> Start of field id range 1
+  // [N + 2] -> End of field id range 1 (exclusive, STL-style).
+  // [N + 3] -> Field state for fields in range 1 (below)
+  //
+  // [N + 4] -> Start of field id range 2
+  // [N + 5] -> End of field id range 2 (exclusive, STL-style).
+  // [N + 6] -> Field state for fields in range 2 (below)
+
+  // The "field state" word is as follows:
+  // Bit 31: 0 if the field is disallowed, 1 if allowed.
+  //         Only directly indexed fields can be 0 (it doesn't make sense to add
+  //         a range and then say "btw it's NOT allowed".. don't add it then.
+  //         0 is only used for filling gaps in the directly indexed bucket.
+  // Bits [30..0] (only when MSB == allowed):
+  //  0x7fffffff: The field is "simple" (varint, fixed32/64, string, bytes) and
+  //      can be directly passed through in output. No recursion is needed.
+  //  [0, 7ffffffe]: The field is a nested submessage. The value is the index
+  //     that must be passed as first argument to the next Query() calls.
+  //     Note that the message index is purely a monotonic counter in the
+  //     filter bytecode, has no proto-equivalent match (unlike field ids).
+  std::vector<uint32_t> words_;
+
+  // One entry for each message index stored in the filter plus a sentinel at
+  // the end. Maps each message index to the offset in |words_| where the the
+  // Nth message start.
+  // message_offset_.size() - 2 == the max message id that can be parsed.
+  std::vector<uint32_t> message_offset_;
+
+  bool suppress_logs_for_fuzzer_ = false;
+};
+
+}  // namespace protozero
+
+#endif  // SRC_PROTOZERO_FILTERING_FILTER_BYTECODE_PARSER_H_
+// gen_amalgamated begin header: src/protozero/filtering/filter_bytecode_common.h
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SRC_PROTOZERO_FILTERING_FILTER_BYTECODE_COMMON_H_
+#define SRC_PROTOZERO_FILTERING_FILTER_BYTECODE_COMMON_H_
+
+#include <stdint.h>
+
+namespace protozero {
+
+enum FilterOpcode : uint32_t {
+  // The immediate value is 0 in this case.
+  kFilterOpcode_EndOfMessage = 0,
+
+  // The immediate value is the id of the allowed field.
+  kFilterOpcode_SimpleField = 1,
+
+  // The immediate value is the start of the range. The next word (without
+  // any shifting) is the length of the range.
+  kFilterOpcode_SimpleFieldRange = 2,
+
+  // The immediate value is the id of the allowed field. The next word
+  // (without any shifting) is the index of the filter that should be used to
+  // recurse into the nested message.
+  kFilterOpcode_NestedField = 3,
+};
+}  // namespace protozero
+
+#endif  // SRC_PROTOZERO_FILTERING_FILTER_BYTECODE_COMMON_H_
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "src/protozero/filtering/filter_bytecode_parser.h"
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/hash.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+// gen_amalgamated expanded: #include "src/protozero/filtering/filter_bytecode_common.h"
+
+namespace protozero {
+
+void FilterBytecodeParser::Reset() {
+  bool suppress = suppress_logs_for_fuzzer_;
+  *this = FilterBytecodeParser();
+  suppress_logs_for_fuzzer_ = suppress;
+}
+
+bool FilterBytecodeParser::Load(const void* filter_data, size_t len) {
+  Reset();
+  bool res = LoadInternal(static_cast<const uint8_t*>(filter_data), len);
+  // If load fails, don't leave the parser in a half broken state.
+  if (!res)
+    Reset();
+  return res;
+}
+
+bool FilterBytecodeParser::LoadInternal(const uint8_t* bytecode_data,
+                                        size_t len) {
+  // First unpack the varints into a plain uint32 vector, so it's easy to
+  // iterate through them and look ahead.
+  std::vector<uint32_t> words;
+  bool packed_parse_err = false;
+  words.reserve(len);  // An overestimation, but avoids reallocations.
+  using BytecodeDecoder =
+      PackedRepeatedFieldIterator<proto_utils::ProtoWireType::kVarInt,
+                                  uint32_t>;
+  for (BytecodeDecoder it(bytecode_data, len, &packed_parse_err); it; ++it)
+    words.emplace_back(*it);
+
+  if (packed_parse_err || words.empty())
+    return false;
+
+  perfetto::base::Hash hasher;
+  for (size_t i = 0; i < words.size() - 1; ++i)
+    hasher.Update(words[i]);
+
+  uint32_t expected_csum = static_cast<uint32_t>(hasher.digest());
+  if (expected_csum != words.back()) {
+    if (!suppress_logs_for_fuzzer_) {
+      PERFETTO_ELOG("Filter bytecode checksum failed. Expected: %x, actual: %x",
+                    expected_csum, words.back());
+    }
+    return false;
+  }
+
+  words.pop_back();  // Pop the checksum.
+
+  // Temporay storage for each message. Cleared on every END_OF_MESSAGE.
+  std::vector<uint32_t> direct_indexed_fields;
+  std::vector<uint32_t> ranges;
+  uint32_t max_msg_index = 0;
+
+  auto add_directly_indexed_field = [&](uint32_t field_id, uint32_t msg_id) {
+    PERFETTO_DCHECK(field_id > 0 && field_id < kDirectlyIndexLimit);
+    direct_indexed_fields.resize(std::max(direct_indexed_fields.size(),
+                                          static_cast<size_t>(field_id) + 1));
+    direct_indexed_fields[field_id] = kAllowed | msg_id;
+  };
+
+  auto add_range = [&](uint32_t id_start, uint32_t id_end, uint32_t msg_id) {
+    PERFETTO_DCHECK(id_end > id_start);
+    PERFETTO_DCHECK(id_start >= kDirectlyIndexLimit);
+    ranges.emplace_back(id_start);
+    ranges.emplace_back(id_end);
+    ranges.emplace_back(kAllowed | msg_id);
+  };
+
+  for (size_t i = 0; i < words.size(); ++i) {
+    const uint32_t word = words[i];
+    const bool has_next_word = i < words.size() - 1;
+    const uint32_t opcode = word & 0x7u;
+    const uint32_t field_id = word >> 3;
+
+    if (field_id == 0 && opcode != kFilterOpcode_EndOfMessage) {
+      PERFETTO_DLOG("bytecode error @ word %zu, invalid field id (0)", i);
+      return false;
+    }
+
+    if (opcode == kFilterOpcode_SimpleField ||
+        opcode == kFilterOpcode_NestedField) {
+      // Field words are organized as follow:
+      // MSB: 1 if allowed, 0 if not allowed.
+      // Remaining bits:
+      //   Message index in the case of nested (non-simple) messages.
+      //   0x7f..f in the case of simple messages.
+      uint32_t msg_id;
+      if (opcode == kFilterOpcode_SimpleField) {
+        msg_id = kSimpleField;
+      } else {  // FILTER_OPCODE_NESTED_FIELD
+        // The next word in the bytecode contains the message index.
+        if (!has_next_word) {
+          PERFETTO_DLOG("bytecode error @ word %zu: unterminated nested field",
+                        i);
+          return false;
+        }
+        msg_id = words[++i];
+        max_msg_index = std::max(max_msg_index, msg_id);
+      }
+
+      if (field_id < kDirectlyIndexLimit) {
+        add_directly_indexed_field(field_id, msg_id);
+      } else {
+        // In the case of a large field id (rare) we waste an extra word and
+        // represent it as a range. Doesn't make sense to introduce extra
+        // complexity to deal with rare cases like this.
+        add_range(field_id, field_id + 1, msg_id);
+      }
+    } else if (opcode == kFilterOpcode_SimpleFieldRange) {
+      if (!has_next_word) {
+        PERFETTO_DLOG("bytecode error @ word %zu: unterminated range", i);
+        return false;
+      }
+      const uint32_t range_len = words[++i];
+      const uint32_t range_end = field_id + range_len;  // STL-style, excl.
+      uint32_t id = field_id;
+
+      // Here's the subtle complexity: at the bytecode level, we don't know
+      // anything about the kDirectlyIndexLimit. It is legit to define a range
+      // that spans across the direct-indexing threshold (e.g. 126-132). In that
+      // case we want to add all the elements < the indexing to the O(1) bucket
+      // and add only the remaining range as a non-indexed range.
+      for (; id < range_end && id < kDirectlyIndexLimit; ++id)
+        add_directly_indexed_field(id, kAllowed | kSimpleField);
+      PERFETTO_DCHECK(id >= kDirectlyIndexLimit || id == range_end);
+      if (id < range_end)
+        add_range(id, range_end, kSimpleField);
+    } else if (opcode == kFilterOpcode_EndOfMessage) {
+      // For each message append:
+      // 1. The "header" word telling how many directly indexed fields there
+      //    are.
+      // 2. The words for the directly indexed fields (id < 128).
+      // 3. The rest of the fields, encoded as ranges.
+      // Also update the |message_offset_| index to remember the word offset for
+      // the current message.
+      message_offset_.emplace_back(static_cast<uint32_t>(words_.size()));
+      words_.emplace_back(static_cast<uint32_t>(direct_indexed_fields.size()));
+      words_.insert(words_.end(), direct_indexed_fields.begin(),
+                    direct_indexed_fields.end());
+      words_.insert(words_.end(), ranges.begin(), ranges.end());
+      direct_indexed_fields.clear();
+      ranges.clear();
+    } else {
+      PERFETTO_DLOG("bytecode error @ word %zu: invalid opcode (%x)", i, word);
+      return false;
+    }
+  }  // (for word in bytecode).
+
+  if (max_msg_index > 0 && max_msg_index >= message_offset_.size()) {
+    PERFETTO_DLOG(
+        "bytecode error: a message index (%u) is out of range "
+        "(num_messages=%zu)",
+        max_msg_index, message_offset_.size());
+    return false;
+  }
+
+  // Add a final entry to |message_offset_| so we can tell where the last
+  // message ends without an extra branch in the Query() hotpath.
+  message_offset_.emplace_back(static_cast<uint32_t>(words_.size()));
+
+  return true;
+}
+
+FilterBytecodeParser::QueryResult FilterBytecodeParser::Query(
+    uint32_t msg_index,
+    uint32_t field_id) {
+  FilterBytecodeParser::QueryResult res{false, 0u};
+  if (static_cast<uint64_t>(msg_index) + 1 >=
+      static_cast<uint64_t>(message_offset_.size())) {
+    return res;
+  }
+  const uint32_t start_offset = message_offset_[msg_index];
+  // These are DCHECKs and not just CHECKS because the |words_| is populated
+  // by the LoadInternal call above. These cannot be violated with a malformed
+  // bytecode.
+  PERFETTO_DCHECK(start_offset < words_.size());
+  const uint32_t* word = &words_[start_offset];
+  const uint32_t end_off = message_offset_[msg_index + 1];
+  const uint32_t* const end = words_.data() + end_off;
+  PERFETTO_DCHECK(end > word && end <= words_.data() + words_.size());
+  const uint32_t num_directly_indexed = *(word++);
+  PERFETTO_DCHECK(num_directly_indexed <= kDirectlyIndexLimit);
+  PERFETTO_DCHECK(word + num_directly_indexed <= end);
+  uint32_t field_state = 0;
+  if (PERFETTO_LIKELY(field_id < num_directly_indexed)) {
+    PERFETTO_DCHECK(&word[field_id] < end);
+    field_state = word[field_id];
+  } else {
+    for (word = word + num_directly_indexed; word + 2 < end;) {
+      const uint32_t range_start = *(word++);
+      const uint32_t range_end = *(word++);
+      const uint32_t range_state = *(word++);
+      if (field_id >= range_start && field_id < range_end) {
+        field_state = range_state;
+        break;
+      }
+    }  // for (word in ranges)
+  }    // if (field_id >= num_directly_indexed)
+
+  res.allowed = (field_state & kAllowed) != 0;
+  res.nested_msg_index = field_state & ~kAllowed;
+  PERFETTO_DCHECK(res.simple_field() ||
+                  res.nested_msg_index < message_offset_.size() - 1);
+  return res;
+}
+
+}  // namespace protozero
+// gen_amalgamated begin source: src/protozero/filtering/message_filter.cc
+// gen_amalgamated begin header: src/protozero/filtering/message_filter.h
+// gen_amalgamated begin header: src/protozero/filtering/message_tokenizer.h
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SRC_PROTOZERO_FILTERING_MESSAGE_TOKENIZER_H_
+#define SRC_PROTOZERO_FILTERING_MESSAGE_TOKENIZER_H_
+
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/base/compiler.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace protozero {
+
+// A helper class for schema-less tokenizing of protobuf messages.
+// This class takes a stream of proto-encoded bytes, pushed one by one in input
+// via Push(octet), and returns a stream of tokens (each Push() call can return
+// 0 or 1 token).
+// A "token" contains metadata about a field, specifically: its ID, its wire
+// type and:
+//  - For varint and fixed32/64 fields: its payload.
+//  - For string and bytes fields: the length of its payload.
+//    In this case the caller is supposed to "eat" those N bytes before calling
+//    Push() again.
+// Note that this class cannot differentiate between a string/bytes field or
+// a submessage, because they are encoded in the same way. The caller is
+// supposed to know whether a field can be recursed into by just keep calling
+// Push() or is a string that should be skipped.
+// This is inline to allow the compiler to see through the Push method and
+// avoid a function call for each byte.
+class MessageTokenizer {
+ public:
+  struct Token {
+    uint32_t field_id;  // 0 == not valid.
+    proto_utils::ProtoWireType type;
+
+    // For kLengthDelimited, |value| represent the length of the payload.
+    uint64_t value;
+
+    inline bool valid() const { return field_id != 0; }
+    bool operator==(const Token& o) const {
+      return field_id == o.field_id && type == o.type && value == o.value;
+    }
+  };
+
+  // Pushes a byte in input and returns a token, only when getting to the last
+  // byte of each field. Specifically:
+  // - For varint and fixed32 fields, the Token is returned after the last byte
+  //   of the numeric payload is pushed.
+  // - For length-delimited fields, this returns after the last byte of the
+  //   length is pushed (i.e. right before the payload starts). The caller is
+  //   expected to either skip the next |value| bytes (in the case of a string
+  //   or bytes fields) or keep calling Push, in the case of a submessage.
+  inline Token Push(uint8_t octet) {
+    using protozero::proto_utils::ProtoWireType;
+
+    // Parsing a fixed32/64 field is the only case where we don't have to do
+    // any varint decoding. This is why this block is before the remaining
+    // switch statement below (all the rest is a varint).
+    if (PERFETTO_UNLIKELY(state_ == kFixedIntValue)) {
+      PERFETTO_DCHECK(fixed_int_bits_ == 32 || fixed_int_bits_ == 64);
+      fixed_int_value_ |= static_cast<uint64_t>(octet) << fixed_int_shift_;
+      fixed_int_shift_ += 8;
+      if (fixed_int_shift_ < fixed_int_bits_)
+        return Token{};  // Intermediate byte of a fixed32/64.
+      auto wire_type = fixed_int_bits_ == 32 ? ProtoWireType::kFixed32
+                                             : ProtoWireType::kFixed64;
+      uint64_t fixed_int_value = fixed_int_value_;
+      fixed_int_value_ = fixed_int_shift_ = fixed_int_bits_ = 0;
+      state_ = kFieldPreamble;
+      return Token{field_id_, wire_type, fixed_int_value};
+    }
+
+    // At this point either we are: (i) parsing a field preamble; (ii) parsing a
+    // varint field paylod; (iii) parsing the length of a length-delimited
+    // field. In all cases, we need to decode a varint before proceeding.
+    varint_ |= static_cast<uint64_t>(octet & 0x7F) << varint_shift_;
+    if (octet & 0x80) {
+      varint_shift_ += 7;
+      if (PERFETTO_UNLIKELY(varint_shift_ >= 64)) {
+        varint_shift_ = 0;
+        state_ = kInvalidVarInt;
+      }
+      return Token{};  // Still parsing a varint.
+    }
+
+    uint64_t varint = varint_;
+    varint_ = 0;
+    varint_shift_ = 0;
+
+    switch (state_) {
+      case kFieldPreamble: {
+        auto field_type = static_cast<uint32_t>(varint & 7u);  // 7 = 0..0111
+        field_id_ = static_cast<uint32_t>(varint >> 3);
+
+        // The field type is legit, now check it's well formed and within
+        // boundaries.
+        if (field_type == static_cast<uint32_t>(ProtoWireType::kVarInt)) {
+          state_ = kVarIntValue;
+        } else if (field_type ==
+                       static_cast<uint32_t>(ProtoWireType::kFixed32) ||
+                   field_type ==
+                       static_cast<uint32_t>(ProtoWireType::kFixed64)) {
+          state_ = kFixedIntValue;
+          fixed_int_shift_ = 0;
+          fixed_int_value_ = 0;
+          fixed_int_bits_ =
+              field_type == static_cast<uint32_t>(ProtoWireType::kFixed32) ? 32
+                                                                           : 64;
+        } else if (field_type ==
+                   static_cast<uint32_t>(ProtoWireType::kLengthDelimited)) {
+          state_ = kLenDelimited;
+        } else {
+          state_ = kInvalidFieldType;
+        }
+        return Token{};
+      }
+
+      case kVarIntValue: {
+        // Return the varint field payload and go back to the next field.
+        state_ = kFieldPreamble;
+        return Token{field_id_, ProtoWireType::kVarInt, varint};
+      }
+
+      case kLenDelimited: {
+        const auto payload_len = varint;
+        if (payload_len > protozero::proto_utils::kMaxMessageLength) {
+          state_ = kMessageTooBig;
+          return Token{};
+        }
+        state_ = kFieldPreamble;
+        // At this point the caller is expected to consume the next
+        // |payload_len| bytes.
+        return Token{field_id_, ProtoWireType::kLengthDelimited, payload_len};
+      }
+
+      case kFixedIntValue:
+        // Unreacheable because of the if before the switch.
+        PERFETTO_DCHECK(false);
+        break;
+
+      // Unrecoverable error states.
+      case kInvalidFieldType:
+      case kMessageTooBig:
+      case kInvalidVarInt:
+        break;
+    }  // switch(state_)
+
+    return Token{};  // Keep GCC happy.
+  }
+
+  // Returns true if the tokenizer FSM has reached quiescence (i.e. if we are
+  // NOT in the middle of parsing a field).
+  bool idle() const {
+    return state_ == kFieldPreamble && varint_shift_ == 0 &&
+           fixed_int_shift_ == 0;
+  }
+
+  // Only for reporting parser errors in the trace.
+  uint32_t state() const { return static_cast<uint32_t>(state_); }
+
+ private:
+  enum State {
+    kFieldPreamble = 0,  // Parsing the varint for the field preamble.
+    kVarIntValue = 1,    // Parsing the payload of a varint field.
+    kFixedIntValue = 2,  // Parsing the payload of a fixed32/64 field.
+    kLenDelimited = 3,   // Parsing the length of a length-delimited field.
+
+    // Unrecoverable error states:
+    kInvalidFieldType = 4,  // Encountered an invalid field type.
+    kMessageTooBig = 5,     // Size of the length delimited message was too big.
+    kInvalidVarInt = 6,     // Varint larger than 64 bits.
+  };
+
+  State state_ = kFieldPreamble;
+  uint32_t field_id_ = 0;
+  uint64_t varint_ = 0;
+  uint32_t varint_shift_ = 0;
+  uint32_t fixed_int_shift_ = 0;
+  uint32_t fixed_int_bits_ = 0;
+  uint64_t fixed_int_value_ = 0;
+};
+
+}  // namespace protozero
+
+#endif  // SRC_PROTOZERO_FILTERING_MESSAGE_TOKENIZER_H_
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SRC_PROTOZERO_FILTERING_MESSAGE_FILTER_H_
+#define SRC_PROTOZERO_FILTERING_MESSAGE_FILTER_H_
+
+#include <stdint.h>
+
+#include <memory>
+#include <string>
+#include <unordered_map>
+
+// gen_amalgamated expanded: #include "src/protozero/filtering/filter_bytecode_parser.h"
+// gen_amalgamated expanded: #include "src/protozero/filtering/message_tokenizer.h"
+
+namespace protozero {
+
+// A class to filter binary-encoded proto messages using an allow-list of field
+// ids, also known as "filter bytecode". The filter determines which fields are
+// allowed to be passed through in output and strips all the other fields.
+// See go/trace-filtering for full design.
+// This class takes in input:
+// 1) The filter bytecode, loaded once via the LoadFilterBytecode() method.
+// 2) A proto-encoded binary message. The message doesn't have to be contiguous,
+//    it can be passed as an array of arbitrarily chunked fragments.
+// The FilterMessage*() method returns in output a proto message, stripping out
+// all unknown fields. If the input is malformed (e.g., unknown proto field wire
+// types, lengths out of bound) the whole filtering failed and the |error| flag
+// of the FilteredMessage object is set to true.
+// The filtering operation is based on rewriting a copy of the message into a
+// self-allocated buffer, which is then returned in the output. The input buffer
+// is NOT altered.
+// Note also that the process of rewriting the protos gets rid of most redundant
+// varint encoding (if present). So even if all fields are allow-listed, the
+// output might NOT be bitwise identical to the input (but it will be
+// semantically equivalent).
+// Furthermore the enable_field_usage_tracking() method allows to keep track of
+// a histogram of allowed / denied fields. It slows down filtering and is
+// intended only on host tools.
+class MessageFilter {
+ public:
+  MessageFilter();
+  ~MessageFilter();
+
+  struct InputSlice {
+    const void* data;
+    size_t len;
+  };
+
+  struct FilteredMessage {
+    FilteredMessage(std::unique_ptr<uint8_t[]> d, size_t s)
+        : data(std::move(d)), size(s) {}
+    std::unique_ptr<uint8_t[]> data;
+    size_t size;  // The used bytes in |data|. This is <= sizeof(data).
+    bool error = false;
+  };
+
+  // Loads the filter bytecode that will be used to filter any subsequent
+  // message. Must be called before the first call to FilterMessage*().
+  // |filter_data| must point to a byte buffer for a proto-encoded ProtoFilter
+  // message (see proto_filter.proto).
+  bool LoadFilterBytecode(const void* filter_data, size_t len);
+
+  // This affects the filter starting point of the subsequent FilterMessage*()
+  // calls. By default the filtering process starts from the message @ index 0,
+  // the root message passed to proto_filter when generating the bytecode
+  // (in typical tracing use-cases, this is perfetto.protos.Trace). However, the
+  // caller (TracingServiceImpl) might want to filter packets from the 2nd level
+  // (perfetto.protos.TracePacket) because the root level is pre-pended after
+  // the fact. This call allows to change the root message for the filter.
+  // The argument |field_ids| is an array of proto field ids and determines the
+  // path to the new root. For instance, in the case of [1,2,3] SetFilterRoot
+  // will identify the sub-message for the field "root.1.2.3" and use that.
+  // In order for this to succeed all the fields in the path must be allowed
+  // in the filter and must be a nested message type.
+  bool SetFilterRoot(const uint32_t* field_ids, size_t num_fields);
+
+  // Takes an input message, fragmented in arbitrary slices, and returns a
+  // filtered message in output.
+  FilteredMessage FilterMessageFragments(const InputSlice*, size_t num_slices);
+
+  // Helper for tests, where the input is a contiguous buffer.
+  FilteredMessage FilterMessage(const void* data, size_t len) {
+    InputSlice slice{data, len};
+    return FilterMessageFragments(&slice, 1);
+  }
+
+  // When enabled returns a map of "field path" to "usage counter".
+  // The key (std::string) is a binary buffer (i.e. NOT an ASCII/UTF-8 string)
+  // which contains a varint for each field. Consider the following:
+  // message Root { Sub1 f1 = 1; };
+  // message Sub1 { Sub2 f2 = 7;}
+  // message Sub2 { string f3 = 5; }
+  // The field .f1.f2.f3 will be encoded as \x01\0x07\x05.
+  // The value is the number of times that field has been encountered. If the
+  // field is not allow-listed in the bytecode (the field is stripped in output)
+  // the count will be negative.
+  void enable_field_usage_tracking(bool x) { track_field_usage_ = x; }
+  const std::unordered_map<std::string, int32_t>& field_usage() const {
+    return field_usage_;
+  }
+
+  // Exposed only for DCHECKS in TracingServiceImpl.
+  uint32_t root_msg_index() { return root_msg_index_; }
+
+ private:
+  // This is called by FilterMessageFragments().
+  // Inlining allows the compiler turn the per-byte call/return into a for loop,
+  // while, at the same time, keeping the code easy to read and reason about.
+  // It gives a 20-25% speedup (265ms vs 215ms for a 25MB trace).
+  void FilterOneByte(uint8_t octet) PERFETTO_ALWAYS_INLINE;
+
+  // No-inline because this is a slowpath (only when usage tracking is enabled).
+  void IncrementCurrentFieldUsage(uint32_t field_id,
+                                  bool allowed) PERFETTO_NO_INLINE;
+
+  // Gets into an error state which swallows all the input and emits no output.
+  void SetUnrecoverableErrorState();
+
+  // We keep track of the the nest of messages in a stack. Each StackState
+  // object corresponds to a level of nesting in the proto message structure.
+  // Every time a new field of type len-delimited that has a corresponding
+  // sub-message in the bytecode is encountered, a new StackState is pushed in
+  // |stack_|. stack_[0] is a sentinel to prevent over-popping without adding
+  // extra branches in the fastpath.
+  // |stack_|. stack_[1] is the state of the root message.
+  struct StackState {
+    uint32_t in_bytes = 0;  // Number of input bytes processed.
+
+    // When |in_bytes| reaches this value, the current state should be popped.
+    // This is set when recursing into nested submessages. This is 0 only for
+    // stack_[0] (we don't know the size of the root message upfront).
+    uint32_t in_bytes_limit = 0;
+
+    // This is set when a len-delimited message is encountered, either a string
+    // or a nested submessage that is NOT allow-listed in the bytecode.
+    // This causes input bytes to be consumed without being parsed from the
+    // input stream. If |passthrough_eaten_bytes| == true, they will be copied
+    // as-is in output (e.g. in the case of an allowed string/bytes field).
+    uint32_t eat_next_bytes = 0;
+
+    // Keeps tracks of the stream_writer output counter (out_.written()) then
+    // the StackState is pushed. This is used to work out, when popping, how
+    // many bytes have been written for the current submessage.
+    uint32_t out_bytes_written_at_start = 0;
+
+    uint32_t field_id = 0;   // The proto field id for the current message.
+    uint32_t msg_index = 0;  // The index of the message filter in the bytecode.
+
+    // This is a pointer to the proto preamble for the current submessage
+    // (it's nullptr for stack_[0] and non-null elsewhere). This will be filled
+    // with the actual size of the message (out_.written() -
+    // |out_bytes_written_at_start|) when finishing (popping) the message.
+    // This must be filled using WriteRedundantVarint(). Note that the
+    // |size_field_len| is variable and depends on the actual length of the
+    // input message. If the output message has roughly the same size of the
+    // input message, the length will not be redundant.
+    // In other words: the length of the field is reserved when the submessage
+    // starts. At that point we know the upper-bound for the output message
+    // (a filtered submessage can be <= the original one, but not >). So we
+    // reserve as many bytes it takes to write the input length in varint.
+    // Then, when the message is finalized and we know the actual output size
+    // we backfill the field.
+    // Consider the example of a submessage where the input size = 130 (>127,
+    // 2 varint bytes) and the output is 120 bytes. The length will be 2 bytes
+    // wide even though could have been encoded with just one byte.
+    uint8_t* size_field = nullptr;
+    uint32_t size_field_len = 0;
+
+    // When true the next |eat_next_bytes| are copied as-is in output.
+    // It seems that keeping this field at the end rather than next to
+    // |eat_next_bytes| makes the filter a little (but measurably) faster.
+    // (likely something related with struct layout vs cache sizes).
+    bool passthrough_eaten_bytes = false;
+  };
+
+  uint32_t out_written() { return static_cast<uint32_t>(out_ - &out_buf_[0]); }
+
+  std::unique_ptr<uint8_t[]> out_buf_;
+  uint8_t* out_ = nullptr;
+  uint8_t* out_end_ = nullptr;
+  uint32_t root_msg_index_ = 0;
+
+  FilterBytecodeParser filter_;
+  MessageTokenizer tokenizer_;
+  std::vector<StackState> stack_;
+
+  bool error_ = false;
+  bool track_field_usage_ = false;
+  std::unordered_map<std::string, int32_t> field_usage_;
+};
+
+}  // namespace protozero
+
+#endif  // SRC_PROTOZERO_FILTERING_MESSAGE_FILTER_H_
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "src/protozero/filtering/message_filter.h"
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace protozero {
+
+namespace {
+
+// Inline helpers to append proto fields in output. They are the equivalent of
+// the protozero::Message::AppendXXX() fields but don't require building and
+// maintaining a full protozero::Message object or dealing with scattered
+// output slices.
+// All these functions assume there is enough space in the output buffer, which
+// should be always the case assuming that we don't end up generating more
+// output than input.
+
+inline void AppendVarInt(uint32_t field_id, uint64_t value, uint8_t** out) {
+  *out = proto_utils::WriteVarInt(proto_utils::MakeTagVarInt(field_id), *out);
+  *out = proto_utils::WriteVarInt(value, *out);
+}
+
+// For fixed32 / fixed64.
+template <typename INT_T /* uint32_t | uint64_t*/>
+inline void AppendFixed(uint32_t field_id, INT_T value, uint8_t** out) {
+  *out = proto_utils::WriteVarInt(proto_utils::MakeTagFixed<INT_T>(field_id),
+                                  *out);
+  memcpy(*out, &value, sizeof(value));
+  *out += sizeof(value);
+}
+
+// For length-delimited (string, bytes) fields. Note: this function appends only
+// the proto preamble and the varint field that states the length of the payload
+// not the payload itself.
+// In the case of submessages, the caller needs to re-write the length at the
+// end in the in the returned memory area.
+// The problem here is that, because of filtering, the length of a submessage
+// might be < original length (the original length is still an upper-bound).
+// Returns a pair with: (1) the pointer where the final length should be written
+// into, (2) the length of the size field.
+// The caller must write a redundant varint to match the original size (i.e.
+// needs to use WriteRedundantVarInt()).
+inline std::pair<uint8_t*, uint32_t> AppendLenDelim(uint32_t field_id,
+                                                    uint32_t len,
+                                                    uint8_t** out) {
+  *out = proto_utils::WriteVarInt(proto_utils::MakeTagLengthDelimited(field_id),
+                                  *out);
+  uint8_t* size_field_start = *out;
+  *out = proto_utils::WriteVarInt(len, *out);
+  const size_t size_field_len = static_cast<size_t>(*out - size_field_start);
+  return std::make_pair(size_field_start, size_field_len);
+}
+}  // namespace
+
+MessageFilter::MessageFilter() {
+  // Push a state on the stack for the implicit root message.
+  stack_.emplace_back();
+}
+
+MessageFilter::~MessageFilter() = default;
+
+bool MessageFilter::LoadFilterBytecode(const void* filter_data, size_t len) {
+  return filter_.Load(filter_data, len);
+}
+
+bool MessageFilter::SetFilterRoot(const uint32_t* field_ids,
+                                  size_t num_fields) {
+  uint32_t root_msg_idx = 0;
+  for (const uint32_t* it = field_ids; it < field_ids + num_fields; ++it) {
+    uint32_t field_id = *it;
+    auto res = filter_.Query(root_msg_idx, field_id);
+    if (!res.allowed || res.simple_field())
+      return false;
+    root_msg_idx = res.nested_msg_index;
+  }
+  root_msg_index_ = root_msg_idx;
+  return true;
+}
+
+MessageFilter::FilteredMessage MessageFilter::FilterMessageFragments(
+    const InputSlice* slices,
+    size_t num_slices) {
+  // First compute the upper bound for the output. The filtered message cannot
+  // be > the original message.
+  uint32_t total_len = 0;
+  for (size_t i = 0; i < num_slices; ++i)
+    total_len += slices[i].len;
+  out_buf_.reset(new uint8_t[total_len]);
+  out_ = out_buf_.get();
+  out_end_ = out_ + total_len;
+
+  // Reset the parser state.
+  tokenizer_ = MessageTokenizer();
+  error_ = false;
+  stack_.clear();
+  stack_.resize(2);
+  // stack_[0] is a sentinel and should never be hit in nominal cases. If we
+  // end up there we will just keep consuming the input stream and detecting
+  // at the end, without hurting the fastpath.
+  stack_[0].in_bytes_limit = UINT32_MAX;
+  stack_[0].eat_next_bytes = UINT32_MAX;
+  // stack_[1] is the actual root message.
+  stack_[1].in_bytes_limit = total_len;
+  stack_[1].msg_index = root_msg_index_;
+
+  // Process the input data and write the output.
+  for (size_t slice_idx = 0; slice_idx < num_slices; ++slice_idx) {
+    const InputSlice& slice = slices[slice_idx];
+    const uint8_t* data = static_cast<const uint8_t*>(slice.data);
+    for (size_t i = 0; i < slice.len; ++i)
+      FilterOneByte(data[i]);
+  }
+
+  // Construct the output object.
+  PERFETTO_CHECK(out_ >= out_buf_.get() && out_ <= out_end_);
+  auto used_size = static_cast<size_t>(out_ - out_buf_.get());
+  FilteredMessage res{std::move(out_buf_), used_size};
+  res.error = error_;
+  if (stack_.size() != 1 || !tokenizer_.idle() ||
+      stack_[0].in_bytes != total_len) {
+    res.error = true;
+  }
+  return res;
+}
+
+void MessageFilter::FilterOneByte(uint8_t octet) {
+  PERFETTO_DCHECK(!stack_.empty());
+
+  auto* state = &stack_.back();
+  StackState next_state{};
+  bool push_next_state = false;
+
+  if (state->eat_next_bytes > 0) {
+    // This is the case where the previous tokenizer_.Push() call returned a
+    // length delimited message which is NOT a submessage (a string or a bytes
+    // field). We just want to consume it, and pass it through in output
+    // if the field was allowed.
+    --state->eat_next_bytes;
+    if (state->passthrough_eaten_bytes)
+      *(out_++) = octet;
+  } else {
+    MessageTokenizer::Token token = tokenizer_.Push(octet);
+    // |token| will not be valid() in most cases and this is WAI. When pushing
+    // a varint field, only the last byte yields a token, all the other bytes
+    // return an invalid token, they just update the internal tokenizer state.
+    if (token.valid()) {
+      auto filter = filter_.Query(state->msg_index, token.field_id);
+      switch (token.type) {
+        case proto_utils::ProtoWireType::kVarInt:
+          if (filter.allowed && filter.simple_field())
+            AppendVarInt(token.field_id, token.value, &out_);
+          break;
+        case proto_utils::ProtoWireType::kFixed32:
+          if (filter.allowed && filter.simple_field())
+            AppendFixed(token.field_id, static_cast<uint32_t>(token.value),
+                        &out_);
+          break;
+        case proto_utils::ProtoWireType::kFixed64:
+          if (filter.allowed && filter.simple_field())
+            AppendFixed(token.field_id, static_cast<uint64_t>(token.value),
+                        &out_);
+          break;
+        case proto_utils::ProtoWireType::kLengthDelimited:
+          // Here we have two cases:
+          // A. A simple string/bytes field: we just want to consume the next
+          //    bytes (the string payload), optionally passing them through in
+          //    output if the field is allowed.
+          // B. This is a nested submessage. In this case we want to recurse and
+          //    push a new state on the stack.
+          // Note that we can't tell the difference between a
+          // "non-allowed string" and a "non-allowed submessage". But it doesn't
+          // matter because in both cases we just want to skip the next N bytes.
+          const auto submessage_len = static_cast<uint32_t>(token.value);
+          auto in_bytes_left = state->in_bytes_limit - state->in_bytes - 1;
+          if (PERFETTO_UNLIKELY(submessage_len > in_bytes_left)) {
+            // This is a malicious / malformed string/bytes/submessage that
+            // claims to be larger than the outer message that contains it.
+            return SetUnrecoverableErrorState();
+          }
+
+          if (filter.allowed && !filter.simple_field() && submessage_len > 0) {
+            // submessage_len == 0 is the edge case of a message with a 0-len
+            // (but present) submessage. In this case, if allowed, we don't want
+            // to push any further state (doing so would desync the FSM) but we
+            // still want to emit it.
+            // At this point |submessage_len| is only an upper bound. The
+            // final message written in output can be <= the one in input,
+            // only some of its fields might be allowed (also remember that
+            // this class implicitly removes redundancy varint encoding of
+            // len-delimited field lengths). The final length varint (the
+            // return value of AppendLenDelim()) will be filled when popping
+            // from |stack_|.
+            auto size_field =
+                AppendLenDelim(token.field_id, submessage_len, &out_);
+            push_next_state = true;
+            next_state.field_id = token.field_id;
+            next_state.msg_index = filter.nested_msg_index;
+            next_state.in_bytes_limit = submessage_len;
+            next_state.size_field = size_field.first;
+            next_state.size_field_len = size_field.second;
+            next_state.out_bytes_written_at_start = out_written();
+          } else {
+            // A string or bytes field, or a 0 length submessage.
+            state->eat_next_bytes = submessage_len;
+            state->passthrough_eaten_bytes = filter.allowed;
+            if (filter.allowed)
+              AppendLenDelim(token.field_id, submessage_len, &out_);
+          }
+          break;
+      }  // switch(type)
+
+      if (PERFETTO_UNLIKELY(track_field_usage_)) {
+        IncrementCurrentFieldUsage(token.field_id, filter.allowed);
+      }
+    }  // if (token.valid)
+  }    // if (eat_next_bytes == 0)
+
+  ++state->in_bytes;
+  while (state->in_bytes >= state->in_bytes_limit) {
+    PERFETTO_DCHECK(state->in_bytes == state->in_bytes_limit);
+    push_next_state = false;
+
+    // We can't possibly write more than we read.
+    const uint32_t msg_bytes_written = static_cast<uint32_t>(
+        out_written() - state->out_bytes_written_at_start);
+    PERFETTO_DCHECK(msg_bytes_written <= state->in_bytes_limit);
+
+    // Backfill the length field of the
+    proto_utils::WriteRedundantVarInt(msg_bytes_written, state->size_field,
+                                      state->size_field_len);
+
+    const uint32_t in_bytes_processes_for_last_msg = state->in_bytes;
+    stack_.pop_back();
+    PERFETTO_CHECK(!stack_.empty());
+    state = &stack_.back();
+    state->in_bytes += in_bytes_processes_for_last_msg;
+    if (PERFETTO_UNLIKELY(!tokenizer_.idle())) {
+      // If we hit this case, it means that we got to the end of a submessage
+      // while decoding a field. We can't recover from this and we don't want to
+      // propagate a broken sub-message.
+      return SetUnrecoverableErrorState();
+    }
+  }
+
+  if (push_next_state) {
+    PERFETTO_DCHECK(tokenizer_.idle());
+    stack_.emplace_back(std::move(next_state));
+    state = &stack_.back();
+  }
+}
+
+void MessageFilter::SetUnrecoverableErrorState() {
+  error_ = true;
+  stack_.clear();
+  stack_.resize(1);
+  auto& state = stack_[0];
+  state.eat_next_bytes = UINT32_MAX;
+  state.in_bytes_limit = UINT32_MAX;
+  state.passthrough_eaten_bytes = false;
+  out_ = out_buf_.get();  // Reset the write pointer.
+}
+
+void MessageFilter::IncrementCurrentFieldUsage(uint32_t field_id,
+                                               bool allowed) {
+  // Slowpath. Used mainly in offline tools and tests to workout used fields in
+  // a proto.
+  PERFETTO_DCHECK(track_field_usage_);
+
+  // Field path contains a concatenation of varints, one for each nesting level.
+  // e.g. y in message Root { Sub x = 2; }; message Sub { SubSub y = 7; }
+  // is encoded as [varint(2) + varint(7)].
+  // We use varint to take the most out of SSO (small string opt). In most cases
+  // the path will fit in the on-stack 22 bytes, requiring no heap.
+  std::string field_path;
+
+  auto append_field_id = [&field_path](uint32_t id) {
+    uint8_t buf[10];
+    uint8_t* end = proto_utils::WriteVarInt(id, buf);
+    field_path.append(reinterpret_cast<char*>(buf),
+                      static_cast<size_t>(end - buf));
+  };
+
+  // Append all the ancestors IDs from the state stack.
+  // The first entry of the stack has always ID 0 and we skip it (we don't know
+  // the ID of the root message itself).
+  PERFETTO_DCHECK(stack_.size() >= 2 && stack_[1].field_id == 0);
+  for (size_t i = 2; i < stack_.size(); ++i)
+    append_field_id(stack_[i].field_id);
+  // Append the id of the field in the current message.
+  append_field_id(field_id);
+  field_usage_[field_path] += allowed ? 1 : -1;
+}
+
+}  // namespace protozero
+// gen_amalgamated begin source: src/tracing/core/metatrace_writer.cc
+// gen_amalgamated begin header: src/tracing/core/metatrace_writer.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SRC_TRACING_CORE_METATRACE_WRITER_H_
+#define SRC_TRACING_CORE_METATRACE_WRITER_H_
+
+#include <functional>
+#include <memory>
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/metatrace.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/thread_checker.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/weak_ptr.h"
+
+namespace perfetto {
+
+namespace base {
+class TaskRunner;
+}
+
+class TraceWriter;
+
+// Complements the base::metatrace infrastructure.
+// It hooks a callback to metatrace::Enable() and writes metatrace events into
+// a TraceWriter whenever the metatrace ring buffer is half full.
+// It is safe to create and attempt to start multiple instances of this class,
+// however only the first one will succeed because the metatrace framework
+// doesn't support multiple instances.
+// This class is defined here (instead of directly in src/probes/) so it can
+// be reused by other components (e.g. heapprofd).
+class MetatraceWriter {
+ public:
+  static constexpr char kDataSourceName[] = "perfetto.metatrace";
+
+  MetatraceWriter();
+  ~MetatraceWriter();
+
+  MetatraceWriter(const MetatraceWriter&) = delete;
+  MetatraceWriter& operator=(const MetatraceWriter&) = delete;
+  MetatraceWriter(MetatraceWriter&&) = delete;
+  MetatraceWriter& operator=(MetatraceWriter&&) = delete;
+
+  void Enable(base::TaskRunner*, std::unique_ptr<TraceWriter>, uint32_t tags);
+  void Disable();
+  void WriteAllAndFlushTraceWriter(std::function<void()> callback);
+
+ private:
+  void WriteAllAvailableEvents();
+
+  bool started_ = false;
+  base::TaskRunner* task_runner_ = nullptr;
+  std::unique_ptr<TraceWriter> trace_writer_;
+  PERFETTO_THREAD_CHECKER(thread_checker_)
+  base::WeakPtrFactory<MetatraceWriter> weak_ptr_factory_;  // Keep last.
+};
+
+}  // namespace perfetto
+
+#endif  // SRC_TRACING_CORE_METATRACE_WRITER_H_
+// gen_amalgamated begin header: gen/protos/perfetto/trace/perfetto/perfetto_metatrace.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PERFETTO_PERFETTO_METATRACE_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PERFETTO_PERFETTO_METATRACE_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class PerfettoMetatrace_Arg;
+
+class PerfettoMetatrace_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/9, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  PerfettoMetatrace_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit PerfettoMetatrace_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit PerfettoMetatrace_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_event_id() const { return at<1>().valid(); }
+  uint32_t event_id() const { return at<1>().as_uint32(); }
+  bool has_counter_id() const { return at<2>().valid(); }
+  uint32_t counter_id() const { return at<2>().as_uint32(); }
+  bool has_event_name() const { return at<8>().valid(); }
+  ::protozero::ConstChars event_name() const { return at<8>().as_string(); }
+  bool has_counter_name() const { return at<9>().valid(); }
+  ::protozero::ConstChars counter_name() const { return at<9>().as_string(); }
+  bool has_event_duration_ns() const { return at<3>().valid(); }
+  uint32_t event_duration_ns() const { return at<3>().as_uint32(); }
+  bool has_counter_value() const { return at<4>().valid(); }
+  int32_t counter_value() const { return at<4>().as_int32(); }
+  bool has_thread_id() const { return at<5>().valid(); }
+  uint32_t thread_id() const { return at<5>().as_uint32(); }
+  bool has_has_overruns() const { return at<6>().valid(); }
+  bool has_overruns() const { return at<6>().as_bool(); }
+  bool has_args() const { return at<7>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> args() const { return GetRepeated<::protozero::ConstBytes>(7); }
+};
+
+class PerfettoMetatrace : public ::protozero::Message {
+ public:
+  using Decoder = PerfettoMetatrace_Decoder;
+  enum : int32_t {
+    kEventIdFieldNumber = 1,
+    kCounterIdFieldNumber = 2,
+    kEventNameFieldNumber = 8,
+    kCounterNameFieldNumber = 9,
+    kEventDurationNsFieldNumber = 3,
+    kCounterValueFieldNumber = 4,
+    kThreadIdFieldNumber = 5,
+    kHasOverrunsFieldNumber = 6,
+    kArgsFieldNumber = 7,
+  };
+  using Arg = ::perfetto::protos::pbzero::PerfettoMetatrace_Arg;
+
+  using FieldMetadata_EventId =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      PerfettoMetatrace>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EventId kEventId() { return {}; }
+  void set_event_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_EventId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CounterId =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      PerfettoMetatrace>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CounterId kCounterId() { return {}; }
+  void set_counter_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CounterId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_EventName =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      PerfettoMetatrace>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EventName kEventName() { return {}; }
+  void set_event_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_EventName::kFieldId, data, size);
+  }
+  void set_event_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_EventName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CounterName =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      PerfettoMetatrace>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CounterName kCounterName() { return {}; }
+  void set_counter_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_CounterName::kFieldId, data, size);
+  }
+  void set_counter_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_CounterName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_EventDurationNs =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      PerfettoMetatrace>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EventDurationNs kEventDurationNs() { return {}; }
+  void set_event_duration_ns(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_EventDurationNs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CounterValue =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      PerfettoMetatrace>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CounterValue kCounterValue() { return {}; }
+  void set_counter_value(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CounterValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ThreadId =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      PerfettoMetatrace>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ThreadId kThreadId() { return {}; }
+  void set_thread_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ThreadId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HasOverruns =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      PerfettoMetatrace>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HasOverruns kHasOverruns() { return {}; }
+  void set_has_overruns(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_HasOverruns::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Args =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      PerfettoMetatrace_Arg,
+      PerfettoMetatrace>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Args kArgs() { return {}; }
+  template <typename T = PerfettoMetatrace_Arg> T* add_args() {
+    return BeginNestedMessage<T>(7);
+  }
+
+};
+
+class PerfettoMetatrace_Arg_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  PerfettoMetatrace_Arg_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit PerfettoMetatrace_Arg_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit PerfettoMetatrace_Arg_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_key() const { return at<1>().valid(); }
+  ::protozero::ConstChars key() const { return at<1>().as_string(); }
+  bool has_value() const { return at<2>().valid(); }
+  ::protozero::ConstChars value() const { return at<2>().as_string(); }
+};
+
+class PerfettoMetatrace_Arg : public ::protozero::Message {
+ public:
+  using Decoder = PerfettoMetatrace_Arg_Decoder;
+  enum : int32_t {
+    kKeyFieldNumber = 1,
+    kValueFieldNumber = 2,
+  };
+
+  using FieldMetadata_Key =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      PerfettoMetatrace_Arg>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Key kKey() { return {}; }
+  void set_key(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Key::kFieldId, data, size);
+  }
+  void set_key(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Key::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Value =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      PerfettoMetatrace_Arg>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Value kValue() { return {}; }
+  void set_value(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Value::kFieldId, data, size);
+  }
+  void set_value(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Value::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "src/tracing/core/metatrace_writer.h"
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/base/task_runner.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/trace_writer.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/data_source_descriptor.h"
+
+// gen_amalgamated expanded: #include "protos/perfetto/trace/perfetto/perfetto_metatrace.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/trace_packet.pbzero.h"
+
+namespace perfetto {
+
+// static
+constexpr char MetatraceWriter::kDataSourceName[];
+
+MetatraceWriter::MetatraceWriter() : weak_ptr_factory_(this) {}
+
+MetatraceWriter::~MetatraceWriter() {
+  Disable();
+}
+
+void MetatraceWriter::Enable(base::TaskRunner* task_runner,
+                             std::unique_ptr<TraceWriter> trace_writer,
+                             uint32_t tags) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  if (started_) {
+    PERFETTO_DFATAL_OR_ELOG("Metatrace already started from this instance");
+    return;
+  }
+  task_runner_ = task_runner;
+  trace_writer_ = std::move(trace_writer);
+  auto weak_ptr = weak_ptr_factory_.GetWeakPtr();
+  bool enabled = metatrace::Enable(
+      [weak_ptr] {
+        if (weak_ptr)
+          weak_ptr->WriteAllAvailableEvents();
+      },
+      task_runner, tags);
+  if (!enabled)
+    return;
+  started_ = true;
+}
+
+void MetatraceWriter::Disable() {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  if (!started_)
+    return;
+  metatrace::Disable();
+  started_ = false;
+  trace_writer_.reset();
+}
+
+void MetatraceWriter::WriteAllAvailableEvents() {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  if (!started_)
+    return;
+  for (auto it = metatrace::RingBuffer::GetReadIterator(); it; ++it) {
+    auto type_and_id = it->type_and_id.load(std::memory_order_acquire);
+    if (type_and_id == 0)
+      break;  // Stop at the first incomplete event.
+
+    auto packet = trace_writer_->NewTracePacket();
+    packet->set_timestamp(it->timestamp_ns());
+    auto* evt = packet->set_perfetto_metatrace();
+    uint16_t type = type_and_id & metatrace::Record::kTypeMask;
+    uint16_t id = type_and_id & ~metatrace::Record::kTypeMask;
+    if (type == metatrace::Record::kTypeCounter) {
+      evt->set_counter_id(id);
+      evt->set_counter_value(it->counter_value);
+    } else {
+      evt->set_event_id(id);
+      evt->set_event_duration_ns(it->duration_ns);
+    }
+
+    evt->set_thread_id(static_cast<uint32_t>(it->thread_id));
+
+    if (metatrace::RingBuffer::has_overruns())
+      evt->set_has_overruns(true);
+  }
+  // The |it| destructor will automatically update the read index position in
+  // the meta-trace ring buffer.
+}
+
+void MetatraceWriter::WriteAllAndFlushTraceWriter(
+    std::function<void()> callback) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  if (!started_)
+    return;
+  WriteAllAvailableEvents();
+  trace_writer_->Flush(std::move(callback));
+}
+
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/core/packet_stream_validator.cc
+// gen_amalgamated begin header: src/tracing/core/packet_stream_validator.h
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SRC_TRACING_CORE_PACKET_STREAM_VALIDATOR_H_
+#define SRC_TRACING_CORE_PACKET_STREAM_VALIDATOR_H_
+
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/slice.h"
+
+namespace perfetto {
+
+// Checks that the stream of trace packets sent by the producer is well formed.
+// This includes:
+//
+// - Checking that the packets are not truncated.
+// - There are no dangling bytes left over in the packets.
+// - Any trusted fields (e.g., uid) are not set.
+//
+// Note that we only validate top-level fields in the trace proto; sub-messages
+// are simply skipped.
+class PacketStreamValidator {
+ public:
+  PacketStreamValidator() = delete;
+
+  static bool Validate(const Slices&);
+};
+
+}  // namespace perfetto
+
+#endif  // SRC_TRACING_CORE_PACKET_STREAM_VALIDATOR_H_
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "src/tracing/core/packet_stream_validator.h"
+
+#include <inttypes.h>
+#include <stddef.h>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+// gen_amalgamated expanded: #include "protos/perfetto/trace/trace_packet.pbzero.h"
+
+namespace perfetto {
+
+namespace {
+
+using protozero::proto_utils::ProtoWireType;
+
+const uint32_t kReservedFieldIds[] = {
+    protos::pbzero::TracePacket::kTrustedUidFieldNumber,
+    protos::pbzero::TracePacket::kTrustedPacketSequenceIdFieldNumber,
+    protos::pbzero::TracePacket::kTraceConfigFieldNumber,
+    protos::pbzero::TracePacket::kTraceStatsFieldNumber,
+    protos::pbzero::TracePacket::kCompressedPacketsFieldNumber,
+    protos::pbzero::TracePacket::kSynchronizationMarkerFieldNumber,
+};
+
+// This translation unit is quite subtle and perf-sensitive. Remember to check
+// BM_PacketStreamValidator in perfetto_benchmarks when making changes.
+
+// Checks that a packet, spread over several slices, is well-formed and doesn't
+// contain reserved top-level fields.
+// The checking logic is based on a state-machine that skips the fields' payload
+// and operates as follows:
+//              +-------------------------------+ <-------------------------+
+// +----------> | Read field preamble (varint)  | <----------------------+  |
+// |            +-------------------------------+                        |  |
+// |              |              |            |                          |  |
+// |       <Varint>        <Fixed 32/64>     <Length-delimited field>    |  |
+// |          V                  |                      V                |  |
+// |  +------------------+       |               +--------------+        |  |
+// |  | Read field value |       |               | Read length  |        |  |
+// |  | (another varint) |       |               |   (varint)   |        |  |
+// |  +------------------+       |               +--------------+        |  |
+// |           |                 V                      V                |  |
+// +-----------+        +----------------+     +-----------------+       |  |
+//                      | Skip 4/8 Bytes |     | Skip $len Bytes |-------+  |
+//                      +----------------+     +-----------------+          |
+//                               |                                          |
+//                               +------------------------------------------+
+class ProtoFieldParserFSM {
+ public:
+  // This method effectively continuously parses varints (either for the field
+  // preamble or the payload or the submessage length) and tells the caller
+  // (the Validate() method) how many bytes to skip until the next field.
+  size_t Push(uint8_t octet) {
+    varint_ |= static_cast<uint64_t>(octet & 0x7F) << varint_shift_;
+    if (octet & 0x80) {
+      varint_shift_ += 7;
+      if (varint_shift_ >= 64) {
+        // Do not invoke UB on next call.
+        varint_shift_ = 0;
+        state_ = kInvalidVarInt;
+      }
+      return 0;
+    }
+    uint64_t varint = varint_;
+    varint_ = 0;
+    varint_shift_ = 0;
+
+    switch (state_) {
+      case kFieldPreamble: {
+        uint64_t field_type = varint & 7;  // 7 = 0..0111
+        auto field_id = static_cast<uint32_t>(varint >> 3);
+        // Check if the field id is reserved, go into an error state if it is.
+        for (size_t i = 0; i < base::ArraySize(kReservedFieldIds); ++i) {
+          if (field_id == kReservedFieldIds[i]) {
+            state_ = kWroteReservedField;
+            return 0;
+          }
+        }
+        // The field type is legit, now check it's well formed and within
+        // boundaries.
+        if (field_type == static_cast<uint64_t>(ProtoWireType::kVarInt)) {
+          state_ = kVarIntValue;
+        } else if (field_type ==
+                   static_cast<uint64_t>(ProtoWireType::kFixed32)) {
+          return 4;
+        } else if (field_type ==
+                   static_cast<uint64_t>(ProtoWireType::kFixed64)) {
+          return 8;
+        } else if (field_type ==
+                   static_cast<uint64_t>(ProtoWireType::kLengthDelimited)) {
+          state_ = kLenDelimitedLen;
+        } else {
+          state_ = kUnknownFieldType;
+        }
+        return 0;
+      }
+
+      case kVarIntValue: {
+        // Consume the int field payload and go back to the next field.
+        state_ = kFieldPreamble;
+        return 0;
+      }
+
+      case kLenDelimitedLen: {
+        if (varint > protozero::proto_utils::kMaxMessageLength) {
+          state_ = kMessageTooBig;
+          return 0;
+        }
+        state_ = kFieldPreamble;
+        return static_cast<size_t>(varint);
+      }
+
+      case kWroteReservedField:
+      case kUnknownFieldType:
+      case kMessageTooBig:
+      case kInvalidVarInt:
+        // Persistent error states.
+        return 0;
+
+    }          // switch(state_)
+    return 0;  // To keep GCC happy.
+  }
+
+  // Queried at the end of the all payload. A message is well-formed only
+  // if the FSM is back to the state where it should parse the next field and
+  // hasn't started parsing any preamble.
+  bool valid() const { return state_ == kFieldPreamble && varint_shift_ == 0; }
+  int state() const { return static_cast<int>(state_); }
+
+ private:
+  enum State {
+    kFieldPreamble = 0,  // Parsing the varint for the field preamble.
+    kVarIntValue,        // Parsing the varint value for the field payload.
+    kLenDelimitedLen,    // Parsing the length of the length-delimited field.
+
+    // Error states:
+    kWroteReservedField,  // Tried to set a reserved field id.
+    kUnknownFieldType,    // Encountered an invalid field type.
+    kMessageTooBig,       // Size of the length delimited message was too big.
+    kInvalidVarInt,       // VarInt larger than 64 bits.
+  };
+
+  State state_ = kFieldPreamble;
+  uint64_t varint_ = 0;
+  uint32_t varint_shift_ = 0;
+};
+
+}  // namespace
+
+// static
+bool PacketStreamValidator::Validate(const Slices& slices) {
+  ProtoFieldParserFSM parser;
+  size_t skip_bytes = 0;
+  for (const Slice& slice : slices) {
+    for (size_t i = 0; i < slice.size;) {
+      const size_t skip_bytes_cur_slice = std::min(skip_bytes, slice.size - i);
+      if (skip_bytes_cur_slice > 0) {
+        i += skip_bytes_cur_slice;
+        skip_bytes -= skip_bytes_cur_slice;
+      } else {
+        uint8_t octet = *(reinterpret_cast<const uint8_t*>(slice.start) + i);
+        skip_bytes = parser.Push(octet);
+        i++;
+      }
+    }
+  }
+  if (skip_bytes == 0 && parser.valid())
+    return true;
+
+  PERFETTO_DLOG("Packet validation error (state %d, skip = %zu)",
+                parser.state(), skip_bytes);
+  return false;
+}
+
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/core/trace_buffer.cc
+// gen_amalgamated begin header: src/tracing/core/trace_buffer.h
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SRC_TRACING_CORE_TRACE_BUFFER_H_
+#define SRC_TRACING_CORE_TRACE_BUFFER_H_
+
+#include <stdint.h>
+#include <string.h>
+
+#include <array>
+#include <limits>
+#include <map>
+#include <tuple>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/paged_memory.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/thread_annotations.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/basic_types.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/slice.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/trace_stats.h"
+
+namespace perfetto {
+
+class TracePacket;
+
+// The main buffer, owned by the tracing service, where all the trace data is
+// ultimately stored into. The service will own several instances of this class,
+// at least one per active consumer (as defined in the |buffers| section of
+// trace_config.proto) and will copy chunks from the producer's shared memory
+// buffers into here when a CommitData IPC is received.
+//
+// Writing into the buffer
+// -----------------------
+// Data is copied from the SMB(s) using CopyChunkUntrusted(). The buffer will
+// hence contain data coming from different producers and different writer
+// sequences, more specifically:
+// - The service receives data by several producer(s), identified by their ID.
+// - Each producer writes several sequences identified by the same WriterID.
+//   (they correspond to TraceWriter instances in the producer).
+// - Each Writer writes, in order, several chunks.
+// - Each chunk contains zero, one, or more TracePacket(s), or even just
+//   fragments of packets (when they span across several chunks).
+//
+// So at any point in time, the buffer will contain a variable number of logical
+// sequences identified by the {ProducerID, WriterID} tuple. Any given chunk
+// will only contain packets (or fragments) belonging to the same sequence.
+//
+// The buffer operates by default as a ring buffer.
+// It has two overwrite policies:
+//  1. kOverwrite (default): if the write pointer reaches the read pointer, old
+//     unread chunks will be overwritten by new chunks.
+//  2. kDiscard: if the write pointer reaches the read pointer, unread chunks
+//     are preserved and the new chunks are discarded. Any future write becomes
+//     a no-op, even if the reader manages to fully catch up. This is because
+//     once a chunk is discarded, the sequence of packets is broken and trying
+//     to recover would be too hard (also due to the fact that, at the same
+//     time, we allow out-of-order commits and chunk re-writes).
+//
+// Chunks are (over)written in the same order of the CopyChunkUntrusted() calls.
+// When overwriting old content, entire chunks are overwritten or clobbered.
+// The buffer never leaves a partial chunk around. Chunks' payload is copied
+// as-is, but their header is not and is repacked in order to keep the
+// ProducerID around.
+//
+// Chunks are stored in the buffer next to each other. Each chunk is prefixed by
+// an inline header (ChunkRecord), which contains most of the fields of the
+// SharedMemoryABI ChunkHeader + the ProducerID + the size of the payload.
+// It's a conventional binary object stream essentially, where each ChunkRecord
+// tells where it ends and hence where to find the next one, like this:
+//
+//          .-------------------------. 16 byte boundary
+//          | ChunkRecord:   16 bytes |
+//          | - chunk id:     4 bytes |
+//          | - producer id:  2 bytes |
+//          | - writer id:    2 bytes |
+//          | - #fragments:   2 bytes |
+//    +-----+ - record size:  2 bytes |
+//    |     | - flags+pad:    4 bytes |
+//    |     +-------------------------+
+//    |     |                         |
+//    |     :     Chunk payload       :
+//    |     |                         |
+//    |     +-------------------------+
+//    |     |    Optional padding     |
+//    +---> +-------------------------+ 16 byte boundary
+//          |      ChunkRecord        |
+//          :                         :
+// Chunks stored in the buffer are always rounded up to 16 bytes (that is
+// sizeof(ChunkRecord)), in order to avoid further inner fragmentation.
+// Special "padding" chunks can be put in the buffer, e.g. in the case when we
+// try to write a chunk of size N while the write pointer is at the end of the
+// buffer, but the write pointer is < N bytes from the end (and hence needs to
+// wrap over).
+// Because of this, the buffer is self-describing: the contents of the buffer
+// can be reconstructed by just looking at the buffer content (this will be
+// quite useful in future to recover the buffer from crash reports).
+//
+// However, in order to keep some operations (patching and reading) fast, a
+// lookaside index is maintained (in |index_|), keeping each chunk in the buffer
+// indexed by their {ProducerID, WriterID, ChunkID} tuple.
+//
+// Patching data out-of-band
+// -------------------------
+// This buffer also supports patching chunks' payload out-of-band, after they
+// have been stored. This is to allow producers to backfill the "size" fields
+// of the protos that spawn across several chunks, when the previous chunks are
+// returned to the service. The MaybePatchChunkContents() deals with the fact
+// that a chunk might have been lost (because of wrapping) by the time the OOB
+// IPC comes.
+//
+// Reading from the buffer
+// -----------------------
+// This class supports one reader only (the consumer). Reads are NOT idempotent
+// as they move the read cursors around. Reading back the buffer is the most
+// conceptually complex part. The ReadNextTracePacket() method operates with
+// whole packet granularity. Packets are returned only when all their fragments
+// are available.
+// This class takes care of:
+// - Gluing packets within the same sequence, even if they are not stored
+//   adjacently in the buffer.
+// - Re-ordering chunks within a sequence (using the ChunkID, which wraps).
+// - Detecting holes in packet fragments (because of loss of chunks).
+// Reads guarantee that packets for the same sequence are read in FIFO order
+// (according to their ChunkID), but don't give any guarantee about the read
+// order of packets from different sequences, see comments in
+// ReadNextTracePacket() below.
+class TraceBuffer {
+ public:
+  static const size_t InlineChunkHeaderSize;  // For test/fake_packet.{cc,h}.
+
+  // See comment in the header above.
+  enum OverwritePolicy { kOverwrite, kDiscard };
+
+  // Argument for out-of-band patches applied through TryPatchChunkContents().
+  struct Patch {
+    // From SharedMemoryABI::kPacketHeaderSize.
+    static constexpr size_t kSize = 4;
+
+    size_t offset_untrusted;
+    std::array<uint8_t, kSize> data;
+  };
+
+  // Identifiers that are constant for a packet sequence.
+  struct PacketSequenceProperties {
+    ProducerID producer_id_trusted;
+    uid_t producer_uid_trusted;
+    WriterID writer_id;
+  };
+
+  // Can return nullptr if the memory allocation fails.
+  static std::unique_ptr<TraceBuffer> Create(size_t size_in_bytes,
+                                             OverwritePolicy = kOverwrite);
+
+  ~TraceBuffer();
+
+  // Copies a Chunk from a producer Shared Memory Buffer into the trace buffer.
+  // |src| points to the first packet in the SharedMemoryABI's chunk shared with
+  // an untrusted producer. "untrusted" here means: the producer might be
+  // malicious and might change |src| concurrently while we read it (internally
+  // this method memcpy()-s first the chunk before processing it). None of the
+  // arguments should be trusted, unless otherwise stated. We can trust that
+  // |src| points to a valid memory area, but not its contents.
+  //
+  // This method may be called multiple times for the same chunk. In this case,
+  // the original chunk's payload will be overridden and its number of fragments
+  // and flags adjusted to match |num_fragments| and |chunk_flags|. The service
+  // may use this to insert partial chunks (|chunk_complete = false|) before the
+  // producer has committed them.
+  //
+  // If |chunk_complete| is |false|, the TraceBuffer will only consider the
+  // first |num_fragments - 1| packets to be complete, since the producer may
+  // not have finished writing the latest packet. Reading from a sequence will
+  // also not progress past any incomplete chunks until they were rewritten with
+  // |chunk_complete = true|, e.g. after a producer's commit.
+  //
+  // TODO(eseckler): Pass in a PacketStreamProperties instead of individual IDs.
+  void CopyChunkUntrusted(ProducerID producer_id_trusted,
+                          uid_t producer_uid_trusted,
+                          WriterID writer_id,
+                          ChunkID chunk_id,
+                          uint16_t num_fragments,
+                          uint8_t chunk_flags,
+                          bool chunk_complete,
+                          const uint8_t* src,
+                          size_t size);
+  // Applies a batch of |patches| to the given chunk, if the given chunk is
+  // still in the buffer. Does nothing if the given ChunkID is gone.
+  // Returns true if the chunk has been found and patched, false otherwise.
+  // |other_patches_pending| is used to determine whether this is the only
+  // batch of patches for the chunk or there is more.
+  // If |other_patches_pending| == false, the chunk is marked as ready to be
+  // consumed. If true, the state of the chunk is not altered.
+  //
+  // Note: If the producer is batching commits (see shared_memory_arbiter.h), it
+  // will also attempt to do patching locally. Namely, if nested messages are
+  // completed while the chunk on which they started is being batched (i.e.
+  // before it has been committed to the service), the producer will apply the
+  // respective patches to the batched chunk. These patches will not be sent to
+  // the service - i.e. only the patches that the producer did not manage to
+  // apply before committing the chunk will be applied here.
+  bool TryPatchChunkContents(ProducerID,
+                             WriterID,
+                             ChunkID,
+                             const Patch* patches,
+                             size_t patches_size,
+                             bool other_patches_pending);
+
+  // To read the contents of the buffer the caller needs to:
+  //   BeginRead()
+  //   while (ReadNextTracePacket(packet_fragments)) { ... }
+  // No other calls to any other method should be interleaved between
+  // BeginRead() and ReadNextTracePacket().
+  // Reads in the TraceBuffer are NOT idempotent.
+  void BeginRead();
+
+  // Returns the next packet in the buffer, if any, and the producer_id,
+  // producer_uid, and writer_id of the producer/writer that wrote it (as passed
+  // in the CopyChunkUntrusted() call). Returns false if no packets can be read
+  // at this point. If a packet was read successfully,
+  // |previous_packet_on_sequence_dropped| is set to |true| if the previous
+  // packet on the sequence was dropped from the buffer before it could be read
+  // (e.g. because its chunk was overridden due to the ring buffer wrapping or
+  // due to an ABI violation), and to |false| otherwise.
+  //
+  // This function returns only complete packets. Specifically:
+  // When there is at least one complete packet in the buffer, this function
+  // returns true and populates the TracePacket argument with the boundaries of
+  // each fragment for one packet.
+  // TracePacket will have at least one slice when this function returns true.
+  // When there are no whole packets eligible to read (e.g. we are still missing
+  // fragments) this function returns false.
+  // This function guarantees also that packets for a given
+  // {ProducerID, WriterID} are read in FIFO order.
+  // This function does not guarantee any ordering w.r.t. packets belonging to
+  // different WriterID(s). For instance, given the following packets copied
+  // into the buffer:
+  //   {ProducerID: 1, WriterID: 1}: P1 P2 P3
+  //   {ProducerID: 1, WriterID: 2}: P4 P5 P6
+  //   {ProducerID: 2, WriterID: 1}: P7 P8 P9
+  // The following read sequence is possible:
+  //   P1, P4, P7, P2, P3, P5, P8, P9, P6
+  // But the following is guaranteed to NOT happen:
+  //   P1, P5, P7, P4 (P4 cannot come after P5)
+  bool ReadNextTracePacket(TracePacket*,
+                           PacketSequenceProperties* sequence_properties,
+                           bool* previous_packet_on_sequence_dropped);
+
+  const TraceStats::BufferStats& stats() const { return stats_; }
+  size_t size() const { return size_; }
+
+ private:
+  friend class TraceBufferTest;
+
+  // ChunkRecord is a Chunk header stored inline in the |data_| buffer, before
+  // the chunk payload (the packets' data). The |data_| buffer looks like this:
+  // +---------------+------------------++---------------+-----------------+
+  // | ChunkRecord 1 | Chunk payload 1  || ChunkRecord 2 | Chunk payload 2 | ...
+  // +---------------+------------------++---------------+-----------------+
+  // Most of the ChunkRecord fields are copied from SharedMemoryABI::ChunkHeader
+  // (the chunk header used in the shared memory buffers).
+  // A ChunkRecord can be a special "padding" record. In this case its payload
+  // should be ignored and the record should be just skipped.
+  //
+  // Full page move optimization:
+  // This struct has to be exactly (sizeof(PageHeader) + sizeof(ChunkHeader))
+  // (from shared_memory_abi.h) to allow full page move optimizations
+  // (TODO(primiano): not implemented yet). In the special case of moving a full
+  // 4k page that contains only one chunk, in fact, we can just ask the kernel
+  // to move the full SHM page (see SPLICE_F_{GIFT,MOVE}) and overlay the
+  // ChunkRecord on top of the moved SMB's header (page + chunk header).
+  // This special requirement is covered by static_assert(s) in the .cc file.
+  struct ChunkRecord {
+    explicit ChunkRecord(size_t sz) : flags{0}, is_padding{0} {
+      PERFETTO_DCHECK(sz >= sizeof(ChunkRecord) &&
+                      sz % sizeof(ChunkRecord) == 0 && sz <= kMaxSize);
+      size = static_cast<decltype(size)>(sz);
+    }
+
+    bool is_valid() const { return size != 0; }
+
+    // Keep this structure packed and exactly 16 bytes (128 bits) big.
+
+    // [32 bits] Monotonic counter within the same writer_id.
+    ChunkID chunk_id = 0;
+
+    // [16 bits] ID of the Producer from which the Chunk was copied from.
+    ProducerID producer_id = 0;
+
+    // [16 bits] Unique per Producer (but not within the service).
+    // If writer_id == kWriterIdPadding the record should just be skipped.
+    WriterID writer_id = 0;
+
+    // Number of fragments contained in the chunk.
+    uint16_t num_fragments = 0;
+
+    // Size in bytes, including sizeof(ChunkRecord) itself.
+    uint16_t size;
+
+    uint8_t flags : 6;  // See SharedMemoryABI::ChunkHeader::flags.
+    uint8_t is_padding : 1;
+    uint8_t unused_flag : 1;
+
+    // Not strictly needed, can be reused for more fields in the future. But
+    // right now helps to spot chunks in hex dumps.
+    char unused[3] = {'C', 'H', 'U'};
+
+    static constexpr size_t kMaxSize =
+        std::numeric_limits<decltype(size)>::max();
+  };
+
+  // Lookaside index entry. This serves two purposes:
+  // 1) Allow a fast lookup of ChunkRecord by their ID (the tuple
+  //   {ProducerID, WriterID, ChunkID}). This is used when applying out-of-band
+  //   patches to the contents of the chunks after they have been copied into
+  //   the TraceBuffer.
+  // 2) keep the chunks ordered by their ID. This is used when reading back.
+  // 3) Keep metadata about the status of the chunk, e.g. whether the contents
+  //    have been read already and should be skipped in a future read pass.
+  // This struct should not have any field that is essential for reconstructing
+  // the contents of the buffer from a crash dump.
+  struct ChunkMeta {
+    // Key used for sorting in the map.
+    struct Key {
+      Key(ProducerID p, WriterID w, ChunkID c)
+          : producer_id{p}, writer_id{w}, chunk_id{c} {}
+
+      explicit Key(const ChunkRecord& cr)
+          : Key(cr.producer_id, cr.writer_id, cr.chunk_id) {}
+
+      // Note that this sorting doesn't keep into account the fact that ChunkID
+      // will wrap over at some point. The extra logic in SequenceIterator deals
+      // with that.
+      bool operator<(const Key& other) const {
+        return std::tie(producer_id, writer_id, chunk_id) <
+               std::tie(other.producer_id, other.writer_id, other.chunk_id);
+      }
+
+      bool operator==(const Key& other) const {
+        return std::tie(producer_id, writer_id, chunk_id) ==
+               std::tie(other.producer_id, other.writer_id, other.chunk_id);
+      }
+
+      bool operator!=(const Key& other) const { return !(*this == other); }
+
+      // These fields should match at all times the corresponding fields in
+      // the |chunk_record|. They are copied here purely for efficiency to avoid
+      // dereferencing the buffer all the time.
+      ProducerID producer_id;
+      WriterID writer_id;
+      ChunkID chunk_id;
+    };
+
+    enum IndexFlags : uint8_t {
+      // If set, the chunk state was kChunkComplete at the time it was copied.
+      // If unset, the chunk was still kChunkBeingWritten while copied. When
+      // reading from the chunk's sequence, the sequence will not advance past
+      // this chunk until this flag is set.
+      kComplete = 1 << 0,
+
+      // If set, we skipped the last packet that we read from this chunk e.g.
+      // because we it was a continuation from a previous chunk that was dropped
+      // or due to an ABI violation.
+      kLastReadPacketSkipped = 1 << 1
+    };
+
+    ChunkMeta(ChunkRecord* r, uint16_t p, bool complete, uint8_t f, uid_t u)
+        : chunk_record{r}, trusted_uid{u}, flags{f}, num_fragments{p} {
+      if (complete)
+        index_flags = kComplete;
+    }
+
+    bool is_complete() const { return index_flags & kComplete; }
+
+    void set_complete(bool complete) {
+      if (complete) {
+        index_flags |= kComplete;
+      } else {
+        index_flags &= ~kComplete;
+      }
+    }
+
+    bool last_read_packet_skipped() const {
+      return index_flags & kLastReadPacketSkipped;
+    }
+
+    void set_last_read_packet_skipped(bool skipped) {
+      if (skipped) {
+        index_flags |= kLastReadPacketSkipped;
+      } else {
+        index_flags &= ~kLastReadPacketSkipped;
+      }
+    }
+
+    ChunkRecord* const chunk_record;  // Addr of ChunkRecord within |data_|.
+    const uid_t trusted_uid;          // uid of the producer.
+
+    // Flags set by TraceBuffer to track the state of the chunk in the index.
+    uint8_t index_flags = 0;
+
+    // Correspond to |chunk_record->flags| and |chunk_record->num_fragments|.
+    // Copied here for performance reasons (avoids having to dereference
+    // |chunk_record| while iterating over ChunkMeta) and to aid debugging in
+    // case the buffer gets corrupted.
+    uint8_t flags = 0;           // See SharedMemoryABI::ChunkHeader::flags.
+    uint16_t num_fragments = 0;  // Total number of packet fragments.
+
+    uint16_t num_fragments_read = 0;  // Number of fragments already read.
+
+    // The start offset of the next fragment (the |num_fragments_read|-th) to be
+    // read. This is the offset in bytes from the beginning of the ChunkRecord's
+    // payload (the 1st fragment starts at |chunk_record| +
+    // sizeof(ChunkRecord)).
+    uint16_t cur_fragment_offset = 0;
+  };
+
+  using ChunkMap = std::map<ChunkMeta::Key, ChunkMeta>;
+
+  // Allows to iterate over a sub-sequence of |index_| for all keys belonging to
+  // the same {ProducerID,WriterID}. Furthermore takes into account the wrapping
+  // of ChunkID. Instances are valid only as long as the |index_| is not altered
+  // (can be used safely only between adjacent ReadNextTracePacket() calls).
+  // The order of the iteration will proceed in the following order:
+  // |wrapping_id| + 1 -> |seq_end|, |seq_begin| -> |wrapping_id|.
+  // Practical example:
+  // - Assume that kMaxChunkID == 7
+  // - Assume that we have all 8 chunks in the range (0..7).
+  // - Hence, |seq_begin| == c0, |seq_end| == c7
+  // - Assume |wrapping_id| = 4 (c4 is the last chunk copied over
+  //   through a CopyChunkUntrusted()).
+  // The resulting iteration order will be: c5, c6, c7, c0, c1, c2, c3, c4.
+  struct SequenceIterator {
+    // Points to the 1st key (the one with the numerically min ChunkID).
+    ChunkMap::iterator seq_begin;
+
+    // Points one past the last key (the one with the numerically max ChunkID).
+    ChunkMap::iterator seq_end;
+
+    // Current iterator, always >= seq_begin && <= seq_end.
+    ChunkMap::iterator cur;
+
+    // The latest ChunkID written. Determines the start/end of the sequence.
+    ChunkID wrapping_id;
+
+    bool is_valid() const { return cur != seq_end; }
+
+    ProducerID producer_id() const {
+      PERFETTO_DCHECK(is_valid());
+      return cur->first.producer_id;
+    }
+
+    WriterID writer_id() const {
+      PERFETTO_DCHECK(is_valid());
+      return cur->first.writer_id;
+    }
+
+    ChunkID chunk_id() const {
+      PERFETTO_DCHECK(is_valid());
+      return cur->first.chunk_id;
+    }
+
+    ChunkMeta& operator*() {
+      PERFETTO_DCHECK(is_valid());
+      return cur->second;
+    }
+
+    // Moves |cur| to the next chunk in the index.
+    // is_valid() will become false after calling this, if this was the last
+    // entry of the sequence.
+    void MoveNext();
+
+    void MoveToEnd() { cur = seq_end; }
+  };
+
+  enum class ReadAheadResult {
+    kSucceededReturnSlices,
+    kFailedMoveToNextSequence,
+    kFailedStayOnSameSequence,
+  };
+
+  enum class ReadPacketResult {
+    kSucceeded,
+    kFailedInvalidPacket,
+    kFailedEmptyPacket,
+  };
+
+  explicit TraceBuffer(OverwritePolicy);
+  TraceBuffer(const TraceBuffer&) = delete;
+  TraceBuffer& operator=(const TraceBuffer&) = delete;
+
+  bool Initialize(size_t size);
+
+  // Returns an object that allows to iterate over chunks in the |index_| that
+  // have the same {ProducerID, WriterID} of
+  // |seq_begin.first.{producer,writer}_id|. |seq_begin| must be an iterator to
+  // the first entry in the |index_| that has a different {ProducerID, WriterID}
+  // from the previous one. It is valid for |seq_begin| to be == index_.end()
+  // (i.e. if the index is empty). The iteration takes care of ChunkID wrapping,
+  // by using |last_chunk_id_|.
+  SequenceIterator GetReadIterForSequence(ChunkMap::iterator seq_begin);
+
+  // Used as a last resort when a buffer corruption is detected.
+  void ClearContentsAndResetRWCursors();
+
+  // Adds a padding record of the given size (must be a multiple of
+  // sizeof(ChunkRecord)).
+  void AddPaddingRecord(size_t);
+
+  // Look for contiguous fragment of the same packet starting from |read_iter_|.
+  // If a contiguous packet is found, all the fragments are pushed into
+  // TracePacket and the function returns kSucceededReturnSlices. If not, the
+  // function returns either kFailedMoveToNextSequence or
+  // kFailedStayOnSameSequence, telling the caller to continue looking for
+  // packets.
+  ReadAheadResult ReadAhead(TracePacket*);
+
+  // Deletes (by marking the record invalid and removing form the index) all
+  // chunks from |wptr_| to |wptr_| + |bytes_to_clear|.
+  // Returns:
+  //   * The size of the gap left between the next valid Chunk and the end of
+  //     the deletion range.
+  //   * 0 if no next valid chunk exists (if the buffer is still zeroed).
+  //   * -1 if the buffer |overwrite_policy_| == kDiscard and the deletion would
+  //     cause unread chunks to be overwritten. In this case the buffer is left
+  //     untouched.
+  // Graphically, assume the initial situation is the following (|wptr_| = 10).
+  // |0        |10 (wptr_)       |30       |40                 |60
+  // +---------+-----------------+---------+-------------------+---------+
+  // | Chunk 1 | Chunk 2         | Chunk 3 | Chunk 4           | Chunk 5 |
+  // +---------+-----------------+---------+-------------------+---------+
+  //           |_________Deletion range_______|~~return value~~|
+  //
+  // A call to DeleteNextChunksFor(32) will remove chunks 2,3,4 and return 18
+  // (60 - 42), the distance between chunk 5 and the end of the deletion range.
+  ssize_t DeleteNextChunksFor(size_t bytes_to_clear);
+
+  // Decodes the boundaries of the next packet (or a fragment) pointed by
+  // ChunkMeta and pushes that into |TracePacket|. It also increments the
+  // |num_fragments_read| counter.
+  // TracePacket can be nullptr, in which case the read state is still advanced.
+  // When TracePacket is not nullptr, ProducerID must also be not null and will
+  // be updated with the ProducerID that originally wrote the chunk.
+  ReadPacketResult ReadNextPacketInChunk(ChunkMeta*, TracePacket*);
+
+  void DcheckIsAlignedAndWithinBounds(const uint8_t* ptr) const {
+    PERFETTO_DCHECK(ptr >= begin() && ptr <= end() - sizeof(ChunkRecord));
+    PERFETTO_DCHECK(
+        (reinterpret_cast<uintptr_t>(ptr) & (alignof(ChunkRecord) - 1)) == 0);
+  }
+
+  ChunkRecord* GetChunkRecordAt(uint8_t* ptr) {
+    DcheckIsAlignedAndWithinBounds(ptr);
+    // We may be accessing a new (empty) record.
+    data_.EnsureCommitted(
+        static_cast<size_t>(ptr + sizeof(ChunkRecord) - begin()));
+    return reinterpret_cast<ChunkRecord*>(ptr);
+  }
+
+  void DiscardWrite();
+
+  // |src| can be nullptr (in which case |size| must be ==
+  // record.size - sizeof(ChunkRecord)), for the case of writing a padding
+  // record. |wptr_| is NOT advanced by this function, the caller must do that.
+  void WriteChunkRecord(uint8_t* wptr,
+                        const ChunkRecord& record,
+                        const uint8_t* src,
+                        size_t size) {
+    // Note: |record.size| will be slightly bigger than |size| because of the
+    // ChunkRecord header and rounding, to ensure that all ChunkRecord(s) are
+    // multiple of sizeof(ChunkRecord). The invariant is:
+    // record.size >= |size| + sizeof(ChunkRecord) (== if no rounding).
+    PERFETTO_DCHECK(size <= ChunkRecord::kMaxSize);
+    PERFETTO_DCHECK(record.size >= sizeof(record));
+    PERFETTO_DCHECK(record.size % sizeof(record) == 0);
+    PERFETTO_DCHECK(record.size >= size + sizeof(record));
+    PERFETTO_CHECK(record.size <= size_to_end());
+    DcheckIsAlignedAndWithinBounds(wptr);
+
+    // We may be writing to this area for the first time.
+    data_.EnsureCommitted(static_cast<size_t>(wptr + record.size - begin()));
+
+    // Deliberately not a *D*CHECK.
+    PERFETTO_CHECK(wptr + sizeof(record) + size <= end());
+    memcpy(wptr, &record, sizeof(record));
+    if (PERFETTO_LIKELY(src)) {
+      // If the producer modifies the data in the shared memory buffer while we
+      // are copying it to the central buffer, TSAN will (rightfully) flag that
+      // as a race. However the entire purpose of copying the data into the
+      // central buffer is that we can validate it without worrying that the
+      // producer changes it from under our feet, so this race is benign. The
+      // alternative would be to try computing which part of the buffer is safe
+      // to read (assuming a well-behaving client), but the risk of introducing
+      // a bug that way outweighs the benefit.
+      PERFETTO_ANNOTATE_BENIGN_RACE_SIZED(
+          src, size, "Benign race when copying chunk from shared memory.")
+      memcpy(wptr + sizeof(record), src, size);
+    } else {
+      PERFETTO_DCHECK(size == record.size - sizeof(record));
+    }
+    const size_t rounding_size = record.size - sizeof(record) - size;
+    memset(wptr + sizeof(record) + size, 0, rounding_size);
+  }
+
+  uint8_t* begin() const { return reinterpret_cast<uint8_t*>(data_.Get()); }
+  uint8_t* end() const { return begin() + size_; }
+  size_t size_to_end() const { return static_cast<size_t>(end() - wptr_); }
+
+  base::PagedMemory data_;
+  size_t size_ = 0;            // Size in bytes of |data_|.
+  size_t max_chunk_size_ = 0;  // Max size in bytes allowed for a chunk.
+  uint8_t* wptr_ = nullptr;    // Write pointer.
+
+  // An index that keeps track of the positions and metadata of each
+  // ChunkRecord.
+  ChunkMap index_;
+
+  // Read iterator used for ReadNext(). It is reset by calling BeginRead().
+  // It becomes invalid after any call to methods that alters the |index_|.
+  SequenceIterator read_iter_;
+
+  // See comments at the top of the file.
+  OverwritePolicy overwrite_policy_ = kOverwrite;
+
+  // Only used when |overwrite_policy_ == kDiscard|. This is set the first time
+  // a write fails because it would overwrite unread chunks.
+  bool discard_writes_ = false;
+
+  // Keeps track of the highest ChunkID written for a given sequence, taking
+  // into account a potential overflow of ChunkIDs. In the case of overflow,
+  // stores the highest ChunkID written since the overflow.
+  //
+  // TODO(primiano): should clean up keys from this map. Right now it grows
+  // without bounds (although realistically is not a problem unless we have too
+  // many producers/writers within the same trace session).
+  std::map<std::pair<ProducerID, WriterID>, ChunkID> last_chunk_id_written_;
+
+  // Statistics about buffer usage.
+  TraceStats::BufferStats stats_;
+
+#if PERFETTO_DCHECK_IS_ON()
+  bool changed_since_last_read_ = false;
+#endif
+
+  // When true disable some DCHECKs that have been put in place to detect
+  // bugs in the producers. This is for tests that feed malicious inputs and
+  // hence mimic a buggy producer.
+  bool suppress_client_dchecks_for_testing_ = false;
+};
+
+}  // namespace perfetto
+
+#endif  // SRC_TRACING_CORE_TRACE_BUFFER_H_
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "src/tracing/core/trace_buffer.h"
+
+#include <limits>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/shared_memory_abi.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/trace_packet.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+#define TRACE_BUFFER_VERBOSE_LOGGING() 0  // Set to 1 when debugging unittests.
+#if TRACE_BUFFER_VERBOSE_LOGGING()
+#define TRACE_BUFFER_DLOG PERFETTO_DLOG
+namespace {
+constexpr char kHexDigits[] = "0123456789abcdef";
+std::string HexDump(const uint8_t* src, size_t size) {
+  std::string buf;
+  buf.reserve(4096 * 4);
+  char line[64];
+  char* c = line;
+  for (size_t i = 0; i < size; i++) {
+    *c++ = kHexDigits[(src[i] >> 4) & 0x0f];
+    *c++ = kHexDigits[(src[i] >> 0) & 0x0f];
+    if (i % 16 == 15) {
+      buf.append("\n");
+      buf.append(line);
+      c = line;
+    }
+  }
+  return buf;
+}
+}  // namespace
+#else
+#define TRACE_BUFFER_DLOG(...) void()
+#endif
+
+namespace perfetto {
+
+namespace {
+constexpr uint8_t kFirstPacketContinuesFromPrevChunk =
+    SharedMemoryABI::ChunkHeader::kFirstPacketContinuesFromPrevChunk;
+constexpr uint8_t kLastPacketContinuesOnNextChunk =
+    SharedMemoryABI::ChunkHeader::kLastPacketContinuesOnNextChunk;
+constexpr uint8_t kChunkNeedsPatching =
+    SharedMemoryABI::ChunkHeader::kChunkNeedsPatching;
+}  // namespace.
+
+constexpr size_t TraceBuffer::ChunkRecord::kMaxSize;
+constexpr size_t TraceBuffer::InlineChunkHeaderSize = sizeof(ChunkRecord);
+
+// static
+std::unique_ptr<TraceBuffer> TraceBuffer::Create(size_t size_in_bytes,
+                                                 OverwritePolicy pol) {
+  std::unique_ptr<TraceBuffer> trace_buffer(new TraceBuffer(pol));
+  if (!trace_buffer->Initialize(size_in_bytes))
+    return nullptr;
+  return trace_buffer;
+}
+
+TraceBuffer::TraceBuffer(OverwritePolicy pol) : overwrite_policy_(pol) {
+  // See comments in ChunkRecord for the rationale of this.
+  static_assert(sizeof(ChunkRecord) == sizeof(SharedMemoryABI::PageHeader) +
+                                           sizeof(SharedMemoryABI::ChunkHeader),
+                "ChunkRecord out of sync with the layout of SharedMemoryABI");
+}
+
+TraceBuffer::~TraceBuffer() = default;
+
+bool TraceBuffer::Initialize(size_t size) {
+  static_assert(
+      SharedMemoryABI::kMinPageSize % sizeof(ChunkRecord) == 0,
+      "sizeof(ChunkRecord) must be an integer divider of a page size");
+  data_ = base::PagedMemory::Allocate(
+      size, base::PagedMemory::kMayFail | base::PagedMemory::kDontCommit);
+  if (!data_.IsValid()) {
+    PERFETTO_ELOG("Trace buffer allocation failed (size: %zu)", size);
+    return false;
+  }
+  size_ = size;
+  stats_.set_buffer_size(size);
+  max_chunk_size_ = std::min(size, ChunkRecord::kMaxSize);
+  wptr_ = begin();
+  index_.clear();
+  last_chunk_id_written_.clear();
+  read_iter_ = GetReadIterForSequence(index_.end());
+  return true;
+}
+
+// Note: |src| points to a shmem region that is shared with the producer. Assume
+// that the producer is malicious and will change the content of |src|
+// while we execute here. Don't do any processing on it other than memcpy().
+void TraceBuffer::CopyChunkUntrusted(ProducerID producer_id_trusted,
+                                     uid_t producer_uid_trusted,
+                                     WriterID writer_id,
+                                     ChunkID chunk_id,
+                                     uint16_t num_fragments,
+                                     uint8_t chunk_flags,
+                                     bool chunk_complete,
+                                     const uint8_t* src,
+                                     size_t size) {
+  // |record_size| = |size| + sizeof(ChunkRecord), rounded up to avoid to end
+  // up in a fragmented state where size_to_end() < sizeof(ChunkRecord).
+  const size_t record_size =
+      base::AlignUp<sizeof(ChunkRecord)>(size + sizeof(ChunkRecord));
+  if (PERFETTO_UNLIKELY(record_size > max_chunk_size_)) {
+    stats_.set_abi_violations(stats_.abi_violations() + 1);
+    PERFETTO_DCHECK(suppress_client_dchecks_for_testing_);
+    return;
+  }
+
+  TRACE_BUFFER_DLOG("CopyChunk @ %lu, size=%zu", wptr_ - begin(), record_size);
+
+#if PERFETTO_DCHECK_IS_ON()
+  changed_since_last_read_ = true;
+#endif
+
+  // If the chunk hasn't been completed, we should only consider the first
+  // |num_fragments - 1| packets complete. For simplicity, we simply disregard
+  // the last one when we copy the chunk.
+  if (PERFETTO_UNLIKELY(!chunk_complete)) {
+    if (num_fragments > 0) {
+      num_fragments--;
+      // These flags should only affect the last packet in the chunk. We clear
+      // them, so that TraceBuffer is able to look at the remaining packets in
+      // this chunk.
+      chunk_flags &= ~kLastPacketContinuesOnNextChunk;
+      chunk_flags &= ~kChunkNeedsPatching;
+    }
+  }
+
+  ChunkRecord record(record_size);
+  record.producer_id = producer_id_trusted;
+  record.chunk_id = chunk_id;
+  record.writer_id = writer_id;
+  record.num_fragments = num_fragments;
+  record.flags = chunk_flags;
+  ChunkMeta::Key key(record);
+
+  // Check whether we have already copied the same chunk previously. This may
+  // happen if the service scrapes chunks in a potentially incomplete state
+  // before receiving commit requests for them from the producer. Note that the
+  // service may scrape and thus override chunks in arbitrary order since the
+  // chunks aren't ordered in the SMB.
+  const auto it = index_.find(key);
+  if (PERFETTO_UNLIKELY(it != index_.end())) {
+    ChunkMeta* record_meta = &it->second;
+    ChunkRecord* prev = record_meta->chunk_record;
+
+    // Verify that the old chunk's metadata corresponds to the new one.
+    // Overridden chunks should never change size, since the page layout is
+    // fixed per writer. The number of fragments should also never decrease and
+    // flags should not be removed.
+    if (PERFETTO_UNLIKELY(ChunkMeta::Key(*prev) != key ||
+                          prev->size != record_size ||
+                          prev->num_fragments > num_fragments ||
+                          (prev->flags & chunk_flags) != prev->flags)) {
+      stats_.set_abi_violations(stats_.abi_violations() + 1);
+      PERFETTO_DCHECK(suppress_client_dchecks_for_testing_);
+      return;
+    }
+
+    // If this chunk was previously copied with the same number of fragments and
+    // the number didn't change, there's no need to copy it again. If the
+    // previous chunk was complete already, this should always be the case.
+    PERFETTO_DCHECK(suppress_client_dchecks_for_testing_ ||
+                    !record_meta->is_complete() ||
+                    (chunk_complete && prev->num_fragments == num_fragments));
+    if (prev->num_fragments == num_fragments) {
+      TRACE_BUFFER_DLOG("  skipping recommit of identical chunk");
+      return;
+    }
+
+    // If we've already started reading from chunk N+1 following this chunk N,
+    // don't override chunk N. Otherwise we may end up reading a packet from
+    // chunk N after having read from chunk N+1, thereby violating sequential
+    // read of packets. This shouldn't happen if the producer is well-behaved,
+    // because it shouldn't start chunk N+1 before completing chunk N.
+    ChunkMeta::Key subsequent_key = key;
+    static_assert(std::numeric_limits<ChunkID>::max() == kMaxChunkID,
+                  "ChunkID wraps");
+    subsequent_key.chunk_id++;
+    const auto subsequent_it = index_.find(subsequent_key);
+    if (subsequent_it != index_.end() &&
+        subsequent_it->second.num_fragments_read > 0) {
+      stats_.set_abi_violations(stats_.abi_violations() + 1);
+      PERFETTO_DCHECK(suppress_client_dchecks_for_testing_);
+      return;
+    }
+
+    // We should not have read past the last packet.
+    if (record_meta->num_fragments_read > prev->num_fragments) {
+      PERFETTO_ELOG(
+          "TraceBuffer read too many fragments from an incomplete chunk");
+      PERFETTO_DCHECK(suppress_client_dchecks_for_testing_);
+      return;
+    }
+
+    uint8_t* wptr = reinterpret_cast<uint8_t*>(prev);
+    TRACE_BUFFER_DLOG("  overriding chunk @ %lu, size=%zu", wptr - begin(),
+                      record_size);
+
+    // Update chunk meta data stored in the index, as it may have changed.
+    record_meta->num_fragments = num_fragments;
+    record_meta->flags = chunk_flags;
+    record_meta->set_complete(chunk_complete);
+
+    // Override the ChunkRecord contents at the original |wptr|.
+    TRACE_BUFFER_DLOG("  copying @ [%lu - %lu] %zu", wptr - begin(),
+                      uintptr_t(wptr - begin()) + record_size, record_size);
+    WriteChunkRecord(wptr, record, src, size);
+    TRACE_BUFFER_DLOG("Chunk raw: %s", HexDump(wptr, record_size).c_str());
+    stats_.set_chunks_rewritten(stats_.chunks_rewritten() + 1);
+    return;
+  }
+
+  if (PERFETTO_UNLIKELY(discard_writes_))
+    return DiscardWrite();
+
+  // If there isn't enough room from the given write position. Write a padding
+  // record to clear the end of the buffer and wrap back.
+  const size_t cached_size_to_end = size_to_end();
+  if (PERFETTO_UNLIKELY(record_size > cached_size_to_end)) {
+    ssize_t res = DeleteNextChunksFor(cached_size_to_end);
+    if (res == -1)
+      return DiscardWrite();
+    PERFETTO_DCHECK(static_cast<size_t>(res) <= cached_size_to_end);
+    AddPaddingRecord(cached_size_to_end);
+    wptr_ = begin();
+    stats_.set_write_wrap_count(stats_.write_wrap_count() + 1);
+    PERFETTO_DCHECK(size_to_end() >= record_size);
+  }
+
+  // At this point either |wptr_| points to an untouched part of the buffer
+  // (i.e. *wptr_ == 0) or we are about to overwrite one or more ChunkRecord(s).
+  // In the latter case we need to first figure out where the next valid
+  // ChunkRecord is (if it exists) and add padding between the new record.
+  // Example ((w) == write cursor):
+  //
+  // Initial state (wtpr_ == 0):
+  // |0 (w)    |10               |30                  |50
+  // +---------+-----------------+--------------------+--------------------+
+  // | Chunk 1 | Chunk 2         | Chunk 3            | Chunk 4            |
+  // +---------+-----------------+--------------------+--------------------+
+  //
+  // Let's assume we now want now write a 5th Chunk of size == 35. The final
+  // state should look like this:
+  // |0                                |35 (w)         |50
+  // +---------------------------------+---------------+--------------------+
+  // | Chunk 5                         | Padding Chunk | Chunk 4            |
+  // +---------------------------------+---------------+--------------------+
+
+  // Deletes all chunks from |wptr_| to |wptr_| + |record_size|.
+  ssize_t del_res = DeleteNextChunksFor(record_size);
+  if (del_res == -1)
+    return DiscardWrite();
+  size_t padding_size = static_cast<size_t>(del_res);
+
+  // Now first insert the new chunk. At the end, if necessary, add the padding.
+  stats_.set_chunks_written(stats_.chunks_written() + 1);
+  stats_.set_bytes_written(stats_.bytes_written() + record_size);
+  auto it_and_inserted = index_.emplace(
+      key, ChunkMeta(GetChunkRecordAt(wptr_), num_fragments, chunk_complete,
+                     chunk_flags, producer_uid_trusted));
+  PERFETTO_DCHECK(it_and_inserted.second);
+  TRACE_BUFFER_DLOG("  copying @ [%lu - %lu] %zu", wptr_ - begin(),
+                    uintptr_t(wptr_ - begin()) + record_size, record_size);
+  WriteChunkRecord(wptr_, record, src, size);
+  TRACE_BUFFER_DLOG("Chunk raw: %s", HexDump(wptr_, record_size).c_str());
+  wptr_ += record_size;
+  if (wptr_ >= end()) {
+    PERFETTO_DCHECK(padding_size == 0);
+    wptr_ = begin();
+    stats_.set_write_wrap_count(stats_.write_wrap_count() + 1);
+  }
+  DcheckIsAlignedAndWithinBounds(wptr_);
+
+  // Chunks may be received out of order, so only update last_chunk_id if the
+  // new chunk_id is larger. But take into account overflows by only selecting
+  // the new ID if its distance to the latest ID is smaller than half the number
+  // space.
+  //
+  // This accounts for both the case where the new ID has just overflown and
+  // last_chunk_id be updated even though it's smaller (e.g. |chunk_id| = 1 and
+  // |last_chunk_id| = kMaxChunkId; chunk_id - last_chunk_id = 0) and the case
+  // where the new ID is an out-of-order ID right after an overflow and
+  // last_chunk_id shouldn't be updated even though it's larger (e.g. |chunk_id|
+  // = kMaxChunkId and |last_chunk_id| = 1; chunk_id - last_chunk_id =
+  // kMaxChunkId - 1).
+  auto producer_and_writer_id = std::make_pair(producer_id_trusted, writer_id);
+  ChunkID& last_chunk_id = last_chunk_id_written_[producer_and_writer_id];
+  static_assert(std::numeric_limits<ChunkID>::max() == kMaxChunkID,
+                "This code assumes that ChunkID wraps at kMaxChunkID");
+  if (chunk_id - last_chunk_id < kMaxChunkID / 2) {
+    last_chunk_id = chunk_id;
+  } else {
+    stats_.set_chunks_committed_out_of_order(
+        stats_.chunks_committed_out_of_order() + 1);
+  }
+
+  if (padding_size)
+    AddPaddingRecord(padding_size);
+}
+
+ssize_t TraceBuffer::DeleteNextChunksFor(size_t bytes_to_clear) {
+  PERFETTO_CHECK(!discard_writes_);
+
+  // Find the position of the first chunk which begins at or after
+  // (|wptr_| + |bytes|). Note that such a chunk might not exist and we might
+  // either reach the end of the buffer or a zeroed region of the buffer.
+  uint8_t* next_chunk_ptr = wptr_;
+  uint8_t* search_end = wptr_ + bytes_to_clear;
+  TRACE_BUFFER_DLOG("Delete [%zu %zu]", wptr_ - begin(), search_end - begin());
+  DcheckIsAlignedAndWithinBounds(wptr_);
+  PERFETTO_DCHECK(search_end <= end());
+  std::vector<ChunkMap::iterator> index_delete;
+  uint64_t chunks_overwritten = stats_.chunks_overwritten();
+  uint64_t bytes_overwritten = stats_.bytes_overwritten();
+  uint64_t padding_bytes_cleared = stats_.padding_bytes_cleared();
+  while (next_chunk_ptr < search_end) {
+    const ChunkRecord& next_chunk = *GetChunkRecordAt(next_chunk_ptr);
+    TRACE_BUFFER_DLOG(
+        "  scanning chunk [%zu %zu] (valid=%d)", next_chunk_ptr - begin(),
+        next_chunk_ptr - begin() + next_chunk.size, next_chunk.is_valid());
+
+    // We just reached the untouched part of the buffer, it's going to be all
+    // zeroes from here to end().
+    // Optimization: if during Initialize() we fill the buffer with padding
+    // records we could get rid of this branch.
+    if (PERFETTO_UNLIKELY(!next_chunk.is_valid())) {
+      // This should happen only at the first iteration. The zeroed area can
+      // only begin precisely at the |wptr_|, not after. Otherwise it means that
+      // we wrapped but screwed up the ChunkRecord chain.
+      PERFETTO_DCHECK(next_chunk_ptr == wptr_);
+      return 0;
+    }
+
+    // Remove |next_chunk| from the index, unless it's a padding record (padding
+    // records are not part of the index).
+    if (PERFETTO_LIKELY(!next_chunk.is_padding)) {
+      ChunkMeta::Key key(next_chunk);
+      auto it = index_.find(key);
+      bool will_remove = false;
+      if (PERFETTO_LIKELY(it != index_.end())) {
+        const ChunkMeta& meta = it->second;
+        if (PERFETTO_UNLIKELY(meta.num_fragments_read < meta.num_fragments)) {
+          if (overwrite_policy_ == kDiscard)
+            return -1;
+          chunks_overwritten++;
+          bytes_overwritten += next_chunk.size;
+        }
+        index_delete.push_back(it);
+        will_remove = true;
+      }
+      TRACE_BUFFER_DLOG(
+          "  del index {%" PRIu32 ",%" PRIu32 ",%u} @ [%lu - %lu] %d",
+          key.producer_id, key.writer_id, key.chunk_id,
+          next_chunk_ptr - begin(), next_chunk_ptr - begin() + next_chunk.size,
+          will_remove);
+      PERFETTO_DCHECK(will_remove);
+    } else {
+      padding_bytes_cleared += next_chunk.size;
+    }
+
+    next_chunk_ptr += next_chunk.size;
+
+    // We should never hit this, unless we managed to screw up while writing
+    // to the buffer and breaking the ChunkRecord(s) chain.
+    // TODO(primiano): Write more meaningful logging with the status of the
+    // buffer, to get more actionable bugs in case we hit this.
+    PERFETTO_CHECK(next_chunk_ptr <= end());
+  }
+
+  // Remove from the index.
+  for (auto it : index_delete) {
+    index_.erase(it);
+  }
+  stats_.set_chunks_overwritten(chunks_overwritten);
+  stats_.set_bytes_overwritten(bytes_overwritten);
+  stats_.set_padding_bytes_cleared(padding_bytes_cleared);
+
+  PERFETTO_DCHECK(next_chunk_ptr >= search_end && next_chunk_ptr <= end());
+  return static_cast<ssize_t>(next_chunk_ptr - search_end);
+}
+
+void TraceBuffer::AddPaddingRecord(size_t size) {
+  PERFETTO_DCHECK(size >= sizeof(ChunkRecord) && size <= ChunkRecord::kMaxSize);
+  ChunkRecord record(size);
+  record.is_padding = 1;
+  TRACE_BUFFER_DLOG("AddPaddingRecord @ [%lu - %lu] %zu", wptr_ - begin(),
+                    uintptr_t(wptr_ - begin()) + size, size);
+  WriteChunkRecord(wptr_, record, nullptr, size - sizeof(ChunkRecord));
+  stats_.set_padding_bytes_written(stats_.padding_bytes_written() + size);
+  // |wptr_| is deliberately not advanced when writing a padding record.
+}
+
+bool TraceBuffer::TryPatchChunkContents(ProducerID producer_id,
+                                        WriterID writer_id,
+                                        ChunkID chunk_id,
+                                        const Patch* patches,
+                                        size_t patches_size,
+                                        bool other_patches_pending) {
+  ChunkMeta::Key key(producer_id, writer_id, chunk_id);
+  auto it = index_.find(key);
+  if (it == index_.end()) {
+    stats_.set_patches_failed(stats_.patches_failed() + 1);
+    return false;
+  }
+  ChunkMeta& chunk_meta = it->second;
+
+  // Check that the index is consistent with the actual ProducerID/WriterID
+  // stored in the ChunkRecord.
+  PERFETTO_DCHECK(ChunkMeta::Key(*chunk_meta.chunk_record) == key);
+  uint8_t* chunk_begin = reinterpret_cast<uint8_t*>(chunk_meta.chunk_record);
+  PERFETTO_DCHECK(chunk_begin >= begin());
+  uint8_t* chunk_end = chunk_begin + chunk_meta.chunk_record->size;
+  PERFETTO_DCHECK(chunk_end <= end());
+
+  static_assert(Patch::kSize == SharedMemoryABI::kPacketHeaderSize,
+                "Patch::kSize out of sync with SharedMemoryABI");
+
+  for (size_t i = 0; i < patches_size; i++) {
+    uint8_t* ptr =
+        chunk_begin + sizeof(ChunkRecord) + patches[i].offset_untrusted;
+    TRACE_BUFFER_DLOG("PatchChunk {%" PRIu32 ",%" PRIu32
+                      ",%u} size=%zu @ %zu with {%02x %02x %02x %02x} cur "
+                      "{%02x %02x %02x %02x}",
+                      producer_id, writer_id, chunk_id, chunk_end - chunk_begin,
+                      patches[i].offset_untrusted, patches[i].data[0],
+                      patches[i].data[1], patches[i].data[2],
+                      patches[i].data[3], ptr[0], ptr[1], ptr[2], ptr[3]);
+    if (ptr < chunk_begin + sizeof(ChunkRecord) ||
+        ptr > chunk_end - Patch::kSize) {
+      // Either the IPC was so slow and in the meantime the writer managed to
+      // wrap over |chunk_id| or the producer sent a malicious IPC.
+      stats_.set_patches_failed(stats_.patches_failed() + 1);
+      return false;
+    }
+
+    // DCHECK that we are writing into a zero-filled size field and not into
+    // valid data. It relies on ScatteredStreamWriter::ReserveBytes() to
+    // zero-fill reservations in debug builds.
+    char zero[Patch::kSize]{};
+    PERFETTO_DCHECK(memcmp(ptr, &zero, Patch::kSize) == 0);
+
+    memcpy(ptr, &patches[i].data[0], Patch::kSize);
+  }
+  TRACE_BUFFER_DLOG(
+      "Chunk raw (after patch): %s",
+      HexDump(chunk_begin, chunk_meta.chunk_record->size).c_str());
+
+  stats_.set_patches_succeeded(stats_.patches_succeeded() + patches_size);
+  if (!other_patches_pending) {
+    chunk_meta.flags &= ~kChunkNeedsPatching;
+    chunk_meta.chunk_record->flags = chunk_meta.flags;
+  }
+  return true;
+}
+
+void TraceBuffer::BeginRead() {
+  read_iter_ = GetReadIterForSequence(index_.begin());
+#if PERFETTO_DCHECK_IS_ON()
+  changed_since_last_read_ = false;
+#endif
+}
+
+TraceBuffer::SequenceIterator TraceBuffer::GetReadIterForSequence(
+    ChunkMap::iterator seq_begin) {
+  SequenceIterator iter;
+  iter.seq_begin = seq_begin;
+  if (seq_begin == index_.end()) {
+    iter.cur = iter.seq_end = index_.end();
+    return iter;
+  }
+
+#if PERFETTO_DCHECK_IS_ON()
+  // Either |seq_begin| is == index_.begin() or the item immediately before must
+  // belong to a different {ProducerID, WriterID} sequence.
+  if (seq_begin != index_.begin() && seq_begin != index_.end()) {
+    auto prev_it = seq_begin;
+    prev_it--;
+    PERFETTO_DCHECK(
+        seq_begin == index_.begin() ||
+        std::tie(prev_it->first.producer_id, prev_it->first.writer_id) <
+            std::tie(seq_begin->first.producer_id, seq_begin->first.writer_id));
+  }
+#endif
+
+  // Find the first entry that has a greater {ProducerID, WriterID} (or just
+  // index_.end() if we reached the end).
+  ChunkMeta::Key key = seq_begin->first;  // Deliberate copy.
+  key.chunk_id = kMaxChunkID;
+  iter.seq_end = index_.upper_bound(key);
+  PERFETTO_DCHECK(iter.seq_begin != iter.seq_end);
+
+  // Now find the first entry between [seq_begin, seq_end) that is
+  // > last_chunk_id_written_. This is where we the sequence will start (see
+  // notes about wrapping of IDs in the header).
+  auto producer_and_writer_id = std::make_pair(key.producer_id, key.writer_id);
+  PERFETTO_DCHECK(last_chunk_id_written_.count(producer_and_writer_id));
+  iter.wrapping_id = last_chunk_id_written_[producer_and_writer_id];
+  key.chunk_id = iter.wrapping_id;
+  iter.cur = index_.upper_bound(key);
+  if (iter.cur == iter.seq_end)
+    iter.cur = iter.seq_begin;
+  return iter;
+}
+
+void TraceBuffer::SequenceIterator::MoveNext() {
+  // Stop iterating when we reach the end of the sequence.
+  // Note: |seq_begin| might be == |seq_end|.
+  if (cur == seq_end || cur->first.chunk_id == wrapping_id) {
+    cur = seq_end;
+    return;
+  }
+
+  // If the current chunk wasn't completed yet, we shouldn't advance past it as
+  // it may be rewritten with additional packets.
+  if (!cur->second.is_complete()) {
+    cur = seq_end;
+    return;
+  }
+
+  ChunkID last_chunk_id = cur->first.chunk_id;
+  if (++cur == seq_end)
+    cur = seq_begin;
+
+  // There may be a missing chunk in the sequence of chunks, in which case the
+  // next chunk's ID won't follow the last one's. If so, skip the rest of the
+  // sequence. We'll return to it later once the hole is filled.
+  if (last_chunk_id + 1 != cur->first.chunk_id)
+    cur = seq_end;
+}
+
+bool TraceBuffer::ReadNextTracePacket(
+    TracePacket* packet,
+    PacketSequenceProperties* sequence_properties,
+    bool* previous_packet_on_sequence_dropped) {
+  // Note: MoveNext() moves only within the next chunk within the same
+  // {ProducerID, WriterID} sequence. Here we want to:
+  // - return the next patched+complete packet in the current sequence, if any.
+  // - return the first patched+complete packet in the next sequence, if any.
+  // - return false if none of the above is found.
+  TRACE_BUFFER_DLOG("ReadNextTracePacket()");
+
+  // Just in case we forget to initialize these below.
+  *sequence_properties = {0, kInvalidUid, 0};
+  *previous_packet_on_sequence_dropped = false;
+
+  // At the start of each sequence iteration, we consider the last read packet
+  // dropped. While iterating over the chunks in the sequence, we update this
+  // flag based on our knowledge about the last packet that was read from each
+  // chunk (|last_read_packet_skipped| in ChunkMeta).
+  bool previous_packet_dropped = true;
+
+#if PERFETTO_DCHECK_IS_ON()
+  PERFETTO_DCHECK(!changed_since_last_read_);
+#endif
+  for (;; read_iter_.MoveNext()) {
+    if (PERFETTO_UNLIKELY(!read_iter_.is_valid())) {
+      // We ran out of chunks in the current {ProducerID, WriterID} sequence or
+      // we just reached the index_.end().
+
+      if (PERFETTO_UNLIKELY(read_iter_.seq_end == index_.end()))
+        return false;
+
+      // We reached the end of sequence, move to the next one.
+      // Note: ++read_iter_.seq_end might become index_.end(), but
+      // GetReadIterForSequence() knows how to deal with that.
+      read_iter_ = GetReadIterForSequence(read_iter_.seq_end);
+      PERFETTO_DCHECK(read_iter_.is_valid() && read_iter_.cur != index_.end());
+      previous_packet_dropped = true;
+    }
+
+    ChunkMeta* chunk_meta = &*read_iter_;
+
+    // If the chunk has holes that are awaiting to be patched out-of-band,
+    // skip the current sequence and move to the next one.
+    if (chunk_meta->flags & kChunkNeedsPatching) {
+      read_iter_.MoveToEnd();
+      continue;
+    }
+
+    const ProducerID trusted_producer_id = read_iter_.producer_id();
+    const WriterID writer_id = read_iter_.writer_id();
+    const uid_t trusted_uid = chunk_meta->trusted_uid;
+
+    // At this point we have a chunk in |chunk_meta| that has not been fully
+    // read. We don't know yet whether we have enough data to read the full
+    // packet (in the case it's fragmented over several chunks) and we are about
+    // to find that out. Specifically:
+    // A) If the first fragment is unread and is a fragment continuing from a
+    //    previous chunk, it means we have missed the previous ChunkID. In
+    //    fact, if this wasn't the case, a previous call to ReadNext() shouldn't
+    //    have moved the cursor to this chunk.
+    // B) Any fragment > 0 && < last is always readable. By definition an inner
+    //    packet is never fragmented and hence doesn't require neither stitching
+    //    nor any out-of-band patching. The same applies to the last packet
+    //    iff it doesn't continue on the next chunk.
+    // C) If the last packet (which might be also the only packet in the chunk)
+    //    is a fragment and continues on the next chunk, we peek at the next
+    //    chunks and, if we have all of them, mark as read and move the cursor.
+    //
+    // +---------------+   +-------------------+  +---------------+
+    // | ChunkID: 1    |   | ChunkID: 2        |  | ChunkID: 3    |
+    // |---------------+   +-------------------+  +---------------+
+    // | Packet 1      |   |                   |  | ... Packet 3  |
+    // | Packet 2      |   | ... Packet 3  ... |  | Packet 4      |
+    // | Packet 3  ... |   |                   |  | Packet 5 ...  |
+    // +---------------+   +-------------------+  +---------------+
+
+    PERFETTO_DCHECK(chunk_meta->num_fragments_read <=
+                    chunk_meta->num_fragments);
+
+    // If we didn't read any packets from this chunk, the last packet was from
+    // the previous chunk we iterated over; so don't update
+    // |previous_packet_dropped| in this case.
+    if (chunk_meta->num_fragments_read > 0)
+      previous_packet_dropped = chunk_meta->last_read_packet_skipped();
+
+    while (chunk_meta->num_fragments_read < chunk_meta->num_fragments) {
+      enum { kSkip = 0, kReadOnePacket, kTryReadAhead } action;
+      if (chunk_meta->num_fragments_read == 0) {
+        if (chunk_meta->flags & kFirstPacketContinuesFromPrevChunk) {
+          action = kSkip;  // Case A.
+        } else if (chunk_meta->num_fragments == 1 &&
+                   (chunk_meta->flags & kLastPacketContinuesOnNextChunk)) {
+          action = kTryReadAhead;  // Case C.
+        } else {
+          action = kReadOnePacket;  // Case B.
+        }
+      } else if (chunk_meta->num_fragments_read <
+                     chunk_meta->num_fragments - 1 ||
+                 !(chunk_meta->flags & kLastPacketContinuesOnNextChunk)) {
+        action = kReadOnePacket;  // Case B.
+      } else {
+        action = kTryReadAhead;  // Case C.
+      }
+
+      TRACE_BUFFER_DLOG("  chunk %u, packet %hu of %hu, action=%d",
+                        read_iter_.chunk_id(), chunk_meta->num_fragments_read,
+                        chunk_meta->num_fragments, action);
+
+      if (action == kSkip) {
+        // This fragment will be skipped forever, not just in this ReadPacket()
+        // iteration. This happens by virtue of ReadNextPacketInChunk()
+        // incrementing the |num_fragments_read| and marking the fragment as
+        // read even if we didn't really.
+        ReadNextPacketInChunk(chunk_meta, nullptr);
+        chunk_meta->set_last_read_packet_skipped(true);
+        previous_packet_dropped = true;
+        continue;
+      }
+
+      if (action == kReadOnePacket) {
+        // The easy peasy case B.
+        ReadPacketResult result = ReadNextPacketInChunk(chunk_meta, packet);
+
+        if (PERFETTO_LIKELY(result == ReadPacketResult::kSucceeded)) {
+          *sequence_properties = {trusted_producer_id, trusted_uid, writer_id};
+          *previous_packet_on_sequence_dropped = previous_packet_dropped;
+          return true;
+        } else if (result == ReadPacketResult::kFailedEmptyPacket) {
+          // We can ignore and skip empty packets.
+          PERFETTO_DCHECK(packet->slices().empty());
+          continue;
+        }
+
+        // In extremely rare cases (producer bugged / malicious) the chunk might
+        // contain an invalid fragment. In such case we don't want to stall the
+        // sequence but just skip the chunk and move on. ReadNextPacketInChunk()
+        // marks the chunk as fully read, so we don't attempt to read from it
+        // again in a future call to ReadBuffers(). It also already records an
+        // abi violation for this.
+        PERFETTO_DCHECK(result == ReadPacketResult::kFailedInvalidPacket);
+        chunk_meta->set_last_read_packet_skipped(true);
+        previous_packet_dropped = true;
+        break;
+      }
+
+      PERFETTO_DCHECK(action == kTryReadAhead);
+      ReadAheadResult ra_res = ReadAhead(packet);
+      if (ra_res == ReadAheadResult::kSucceededReturnSlices) {
+        stats_.set_readaheads_succeeded(stats_.readaheads_succeeded() + 1);
+        *sequence_properties = {trusted_producer_id, trusted_uid, writer_id};
+        *previous_packet_on_sequence_dropped = previous_packet_dropped;
+        return true;
+      }
+
+      if (ra_res == ReadAheadResult::kFailedMoveToNextSequence) {
+        // readahead didn't find a contiguous packet sequence. We'll try again
+        // on the next ReadPacket() call.
+        stats_.set_readaheads_failed(stats_.readaheads_failed() + 1);
+
+        // TODO(primiano): optimization: this MoveToEnd() is the reason why
+        // MoveNext() (that is called in the outer for(;;MoveNext)) needs to
+        // deal gracefully with the case of |cur|==|seq_end|. Maybe we can do
+        // something to avoid that check by reshuffling the code here?
+        read_iter_.MoveToEnd();
+
+        // This break will go back to beginning of the for(;;MoveNext()). That
+        // will move to the next sequence because we set the read iterator to
+        // its end.
+        break;
+      }
+
+      PERFETTO_DCHECK(ra_res == ReadAheadResult::kFailedStayOnSameSequence);
+
+      // In this case ReadAhead() might advance |read_iter_|, so we need to
+      // re-cache the |chunk_meta| pointer to point to the current chunk.
+      chunk_meta = &*read_iter_;
+      chunk_meta->set_last_read_packet_skipped(true);
+      previous_packet_dropped = true;
+    }  // while(...)  [iterate over packet fragments for the current chunk].
+  }    // for(;;MoveNext()) [iterate over chunks].
+}
+
+TraceBuffer::ReadAheadResult TraceBuffer::ReadAhead(TracePacket* packet) {
+  static_assert(static_cast<ChunkID>(kMaxChunkID + 1) == 0,
+                "relying on kMaxChunkID to wrap naturally");
+  TRACE_BUFFER_DLOG(" readahead start @ chunk %u", read_iter_.chunk_id());
+  ChunkID next_chunk_id = read_iter_.chunk_id() + 1;
+  SequenceIterator it = read_iter_;
+  for (it.MoveNext(); it.is_valid(); it.MoveNext(), next_chunk_id++) {
+    // We should stay within the same sequence while iterating here.
+    PERFETTO_DCHECK(it.producer_id() == read_iter_.producer_id() &&
+                    it.writer_id() == read_iter_.writer_id());
+
+    TRACE_BUFFER_DLOG("   expected chunk ID: %u, actual ID: %u", next_chunk_id,
+                      it.chunk_id());
+
+    if (PERFETTO_UNLIKELY((*it).num_fragments == 0))
+      continue;
+
+    // If we miss the next chunk, stop looking in the current sequence and
+    // try another sequence. This chunk might come in the near future.
+    // The second condition is the edge case of a buggy/malicious
+    // producer. The ChunkID is contiguous but its flags don't make sense.
+    if (it.chunk_id() != next_chunk_id ||
+        PERFETTO_UNLIKELY(
+            !((*it).flags & kFirstPacketContinuesFromPrevChunk))) {
+      return ReadAheadResult::kFailedMoveToNextSequence;
+    }
+
+    // If the chunk is contiguous but has not been patched yet move to the next
+    // sequence and try coming back here on the next ReadNextTracePacket() call.
+    // TODO(primiano): add a test to cover this, it's a subtle case.
+    if ((*it).flags & kChunkNeedsPatching)
+      return ReadAheadResult::kFailedMoveToNextSequence;
+
+    // This is the case of an intermediate chunk which contains only one
+    // fragment which continues on the next chunk. This is the case for large
+    // packets, e.g.: [Packet0, Packet1(0)] [Packet1(1)] [Packet1(2), ...]
+    // (Packet1(X) := fragment X of Packet1).
+    if ((*it).num_fragments == 1 &&
+        ((*it).flags & kLastPacketContinuesOnNextChunk)) {
+      continue;
+    }
+
+    // We made it! We got all fragments for the packet without holes.
+    TRACE_BUFFER_DLOG("  readahead success @ chunk %u", it.chunk_id());
+    PERFETTO_DCHECK(((*it).num_fragments == 1 &&
+                     !((*it).flags & kLastPacketContinuesOnNextChunk)) ||
+                    (*it).num_fragments > 1);
+
+    // Now let's re-iterate over the [read_iter_, it] sequence and mark
+    // all the fragments as read.
+    bool packet_corruption = false;
+    for (;;) {
+      PERFETTO_DCHECK(read_iter_.is_valid());
+      TRACE_BUFFER_DLOG("    commit chunk %u", read_iter_.chunk_id());
+      if (PERFETTO_LIKELY((*read_iter_).num_fragments > 0)) {
+        // In the unlikely case of a corrupted packet (corrupted or empty
+        // fragment), invalidate the all stitching and move on to the next chunk
+        // in the same sequence, if any.
+        packet_corruption |= ReadNextPacketInChunk(&*read_iter_, packet) ==
+                             ReadPacketResult::kFailedInvalidPacket;
+      }
+      if (read_iter_.cur == it.cur)
+        break;
+      read_iter_.MoveNext();
+    }  // for(;;)
+    PERFETTO_DCHECK(read_iter_.cur == it.cur);
+
+    if (PERFETTO_UNLIKELY(packet_corruption)) {
+      // ReadNextPacketInChunk() already records an abi violation for this case.
+      *packet = TracePacket();  // clear.
+      return ReadAheadResult::kFailedStayOnSameSequence;
+    }
+
+    return ReadAheadResult::kSucceededReturnSlices;
+  }  // for(it...)  [readahead loop]
+  return ReadAheadResult::kFailedMoveToNextSequence;
+}
+
+TraceBuffer::ReadPacketResult TraceBuffer::ReadNextPacketInChunk(
+    ChunkMeta* chunk_meta,
+    TracePacket* packet) {
+  PERFETTO_DCHECK(chunk_meta->num_fragments_read < chunk_meta->num_fragments);
+  PERFETTO_DCHECK(!(chunk_meta->flags & kChunkNeedsPatching));
+
+  const uint8_t* record_begin =
+      reinterpret_cast<const uint8_t*>(chunk_meta->chunk_record);
+  const uint8_t* record_end = record_begin + chunk_meta->chunk_record->size;
+  const uint8_t* packets_begin = record_begin + sizeof(ChunkRecord);
+  const uint8_t* packet_begin = packets_begin + chunk_meta->cur_fragment_offset;
+
+  if (PERFETTO_UNLIKELY(packet_begin < packets_begin ||
+                        packet_begin >= record_end)) {
+    // The producer has a bug or is malicious and did declare that the chunk
+    // contains more packets beyond its boundaries.
+    stats_.set_abi_violations(stats_.abi_violations() + 1);
+    PERFETTO_DCHECK(suppress_client_dchecks_for_testing_);
+    chunk_meta->cur_fragment_offset = 0;
+    chunk_meta->num_fragments_read = chunk_meta->num_fragments;
+    if (PERFETTO_LIKELY(chunk_meta->is_complete())) {
+      stats_.set_chunks_read(stats_.chunks_read() + 1);
+      stats_.set_bytes_read(stats_.bytes_read() +
+                            chunk_meta->chunk_record->size);
+    }
+    return ReadPacketResult::kFailedInvalidPacket;
+  }
+
+  // A packet (or a fragment) starts with a varint stating its size, followed
+  // by its content. The varint shouldn't be larger than 4 bytes (just in case
+  // the producer is using a redundant encoding)
+  uint64_t packet_size = 0;
+  const uint8_t* header_end =
+      std::min(packet_begin + protozero::proto_utils::kMessageLengthFieldSize,
+               record_end);
+  const uint8_t* packet_data = protozero::proto_utils::ParseVarInt(
+      packet_begin, header_end, &packet_size);
+
+  const uint8_t* next_packet = packet_data + packet_size;
+  if (PERFETTO_UNLIKELY(next_packet <= packet_begin ||
+                        next_packet > record_end)) {
+    // In BufferExhaustedPolicy::kDrop mode, TraceWriter may abort a fragmented
+    // packet by writing an invalid size in the last fragment's header. We
+    // should handle this case without recording an ABI violation (since Android
+    // R).
+    if (packet_size != SharedMemoryABI::kPacketSizeDropPacket) {
+      stats_.set_abi_violations(stats_.abi_violations() + 1);
+      PERFETTO_DCHECK(suppress_client_dchecks_for_testing_);
+    } else {
+      stats_.set_trace_writer_packet_loss(stats_.trace_writer_packet_loss() +
+                                          1);
+    }
+    chunk_meta->cur_fragment_offset = 0;
+    chunk_meta->num_fragments_read = chunk_meta->num_fragments;
+    if (PERFETTO_LIKELY(chunk_meta->is_complete())) {
+      stats_.set_chunks_read(stats_.chunks_read() + 1);
+      stats_.set_bytes_read(stats_.bytes_read() +
+                            chunk_meta->chunk_record->size);
+    }
+    return ReadPacketResult::kFailedInvalidPacket;
+  }
+
+  chunk_meta->cur_fragment_offset =
+      static_cast<uint16_t>(next_packet - packets_begin);
+  chunk_meta->num_fragments_read++;
+
+  if (PERFETTO_UNLIKELY(chunk_meta->num_fragments_read ==
+                            chunk_meta->num_fragments &&
+                        chunk_meta->is_complete())) {
+    stats_.set_chunks_read(stats_.chunks_read() + 1);
+    stats_.set_bytes_read(stats_.bytes_read() + chunk_meta->chunk_record->size);
+  } else {
+    // We have at least one more packet to parse. It should be within the chunk.
+    if (chunk_meta->cur_fragment_offset + sizeof(ChunkRecord) >=
+        chunk_meta->chunk_record->size) {
+      PERFETTO_DCHECK(suppress_client_dchecks_for_testing_);
+    }
+  }
+
+  chunk_meta->set_last_read_packet_skipped(false);
+
+  if (PERFETTO_UNLIKELY(packet_size == 0))
+    return ReadPacketResult::kFailedEmptyPacket;
+
+  if (PERFETTO_LIKELY(packet))
+    packet->AddSlice(packet_data, static_cast<size_t>(packet_size));
+
+  return ReadPacketResult::kSucceeded;
+}
+
+void TraceBuffer::DiscardWrite() {
+  PERFETTO_DCHECK(overwrite_policy_ == kDiscard);
+  discard_writes_ = true;
+  stats_.set_chunks_discarded(stats_.chunks_discarded() + 1);
+  TRACE_BUFFER_DLOG("  discarding write");
+}
+
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/core/tracing_service_impl.cc
+// gen_amalgamated begin header: src/tracing/core/tracing_service_impl.h
+// gen_amalgamated begin header: include/perfetto/ext/base/circular_queue.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_CIRCULAR_QUEUE_H_
+#define INCLUDE_PERFETTO_EXT_BASE_CIRCULAR_QUEUE_H_
+
+#include <stdint.h>
+#include <iterator>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+
+namespace perfetto {
+namespace base {
+
+// CircularQueue is a push-back-only / pop-front-only queue with the following
+// characteristics:
+// - The storage is based on a flat circular buffer. Beginning and end wrap
+//   as necessary, to keep pushes and pops O(1) as long as capacity expansion is
+//   not required.
+// - Capacity is automatically expanded like in a std::vector. Expansion has a
+//   O(N) cost.
+// - It allows random access, allowing in-place std::sort.
+// - Iterators are not stable. Mutating the container invalidates all iterators.
+// - It doesn't bother with const-correctness.
+//
+// Implementation details:
+// Internally, |begin|, |end| and iterators use 64-bit monotonic indexes, which
+// are incremented as if the queue was backed by unlimited storage.
+// Even assuming that elements are inserted and removed every nanosecond, 64 bit
+// is enough for 584 years.
+// Wrapping happens only when addressing elements in the underlying circular
+// storage. This limits the complexity and avoiding dealing with modular
+// arithmetic all over the places.
+template <class T>
+class CircularQueue {
+ public:
+  class Iterator {
+   public:
+    using difference_type = ptrdiff_t;
+    using value_type = T;
+    using pointer = T*;
+    using reference = T&;
+    using iterator_category = std::random_access_iterator_tag;
+
+    Iterator(CircularQueue* queue, uint64_t pos, uint32_t generation)
+        : queue_(queue),
+          pos_(pos)
+#if PERFETTO_DCHECK_IS_ON()
+          ,
+          generation_(generation)
+#endif
+    {
+      ignore_result(generation);
+    }
+
+    Iterator(const Iterator&) noexcept = default;
+    Iterator& operator=(const Iterator&) noexcept = default;
+    Iterator(Iterator&&) noexcept = default;
+    Iterator& operator=(Iterator&&) noexcept = default;
+
+    T* operator->() const {
+#if PERFETTO_DCHECK_IS_ON()
+      PERFETTO_DCHECK(generation_ == queue_->generation());
+#endif
+      return queue_->Get(pos_);
+    }
+
+    T& operator*() const { return *(operator->()); }
+
+    value_type& operator[](difference_type i) { return *(*this + i); }
+
+    Iterator& operator++() {
+      Add(1);
+      return *this;
+    }
+
+    Iterator operator++(int) {
+      Iterator ret = *this;
+      Add(1);
+      return ret;
+    }
+
+    Iterator& operator--() {
+      Add(-1);
+      return *this;
+    }
+
+    Iterator operator--(int) {
+      Iterator ret = *this;
+      Add(-1);
+      return ret;
+    }
+
+    friend Iterator operator+(const Iterator& iter, difference_type offset) {
+      Iterator ret = iter;
+      ret.Add(offset);
+      return ret;
+    }
+
+    Iterator& operator+=(difference_type offset) {
+      Add(offset);
+      return *this;
+    }
+
+    friend Iterator operator-(const Iterator& iter, difference_type offset) {
+      Iterator ret = iter;
+      ret.Add(-offset);
+      return ret;
+    }
+
+    Iterator& operator-=(difference_type offset) {
+      Add(-offset);
+      return *this;
+    }
+
+    friend ptrdiff_t operator-(const Iterator& lhs, const Iterator& rhs) {
+      return static_cast<ptrdiff_t>(lhs.pos_) -
+             static_cast<ptrdiff_t>(rhs.pos_);
+    }
+
+    friend bool operator==(const Iterator& lhs, const Iterator& rhs) {
+      return lhs.pos_ == rhs.pos_;
+    }
+
+    friend bool operator!=(const Iterator& lhs, const Iterator& rhs) {
+      return lhs.pos_ != rhs.pos_;
+    }
+
+    friend bool operator<(const Iterator& lhs, const Iterator& rhs) {
+      return lhs.pos_ < rhs.pos_;
+    }
+
+    friend bool operator<=(const Iterator& lhs, const Iterator& rhs) {
+      return lhs.pos_ <= rhs.pos_;
+    }
+
+    friend bool operator>(const Iterator& lhs, const Iterator& rhs) {
+      return lhs.pos_ > rhs.pos_;
+    }
+
+    friend bool operator>=(const Iterator& lhs, const Iterator& rhs) {
+      return lhs.pos_ >= rhs.pos_;
+    }
+
+   private:
+    inline void Add(difference_type offset) {
+      pos_ = static_cast<uint64_t>(static_cast<difference_type>(pos_) + offset);
+      PERFETTO_DCHECK(pos_ <= queue_->end_);
+    }
+
+    CircularQueue* queue_;
+    uint64_t pos_;
+
+#if PERFETTO_DCHECK_IS_ON()
+    uint32_t generation_;
+#endif
+  };
+
+  CircularQueue(size_t initial_capacity = 1024) { Grow(initial_capacity); }
+
+  CircularQueue(CircularQueue&& other) noexcept {
+    // Copy all fields using the (private) default copy assignment operator.
+    *this = other;
+    increment_generation();
+    new (&other) CircularQueue();  // Reset the old queue so it's still usable.
+  }
+
+  CircularQueue& operator=(CircularQueue&& other) {
+    this->~CircularQueue();                      // Destroy the current state.
+    new (this) CircularQueue(std::move(other));  // Use the move ctor above.
+    return *this;
+  }
+
+  ~CircularQueue() {
+    if (!entries_) {
+      PERFETTO_DCHECK(empty());
+      return;
+    }
+    clear();  // Invoke destructors on all alive entries.
+    PERFETTO_DCHECK(empty());
+    free(entries_);
+  }
+
+  template <typename... Args>
+  void emplace_back(Args&&... args) {
+    increment_generation();
+    if (PERFETTO_UNLIKELY(size() >= capacity_))
+      Grow();
+    T* slot = Get(end_++);
+    new (slot) T(std::forward<Args>(args)...);
+  }
+
+  void erase_front(size_t n) {
+    increment_generation();
+    for (; n && (begin_ < end_); --n) {
+      Get(begin_)->~T();
+      begin_++;  // This needs to be its own statement, Get() checks begin_.
+    }
+  }
+
+  void pop_front() { erase_front(1); }
+
+  void clear() { erase_front(size()); }
+
+  T& at(size_t idx) {
+    PERFETTO_DCHECK(idx < size());
+    return *Get(begin_ + idx);
+  }
+
+  Iterator begin() { return Iterator(this, begin_, generation()); }
+  Iterator end() { return Iterator(this, end_, generation()); }
+  T& front() { return *begin(); }
+  T& back() { return *(end() - 1); }
+
+  bool empty() const { return size() == 0; }
+
+  size_t size() const {
+    PERFETTO_DCHECK(end_ - begin_ <= capacity_);
+    return static_cast<size_t>(end_ - begin_);
+  }
+
+  size_t capacity() const { return capacity_; }
+
+#if PERFETTO_DCHECK_IS_ON()
+  uint32_t generation() const { return generation_; }
+  void increment_generation() { ++generation_; }
+#else
+  uint32_t generation() const { return 0; }
+  void increment_generation() {}
+#endif
+
+ private:
+  CircularQueue(const CircularQueue&) = delete;
+  CircularQueue& operator=(const CircularQueue&) = default;
+
+  void Grow(size_t new_capacity = 0) {
+    // Capacity must be always a power of two. This allows Get() to use a simple
+    // bitwise-AND for handling the wrapping instead of a full division.
+    new_capacity = new_capacity ? new_capacity : capacity_ * 2;
+    PERFETTO_CHECK((new_capacity & (new_capacity - 1)) == 0);  // Must be pow2.
+
+    // On 32-bit systems this might hit the 4GB wall and overflow. We can't do
+    // anything other than crash in this case.
+    PERFETTO_CHECK(new_capacity > capacity_);
+    size_t malloc_size = new_capacity * sizeof(T);
+    PERFETTO_CHECK(malloc_size > new_capacity);
+    auto* new_vec = static_cast<T*>(malloc(malloc_size));
+
+    // Move all elements in the expanded array.
+    size_t new_size = 0;
+    for (uint64_t i = begin_; i < end_; i++)
+      new (&new_vec[new_size++]) T(std::move(*Get(i)));  // Placement move ctor.
+
+    // Even if all the elements are std::move()-d and likely empty, we are still
+    // required to call the dtor for them.
+    for (uint64_t i = begin_; i < end_; i++)
+      Get(i)->~T();
+    free(entries_);  // It's fine to free(nullptr) (for the ctor call case).
+
+    begin_ = 0;
+    end_ = new_size;
+    capacity_ = new_capacity;
+    entries_ = new_vec;
+  }
+
+  inline T* Get(uint64_t pos) {
+    PERFETTO_DCHECK(pos >= begin_ && pos < end_);
+    PERFETTO_DCHECK((capacity_ & (capacity_ - 1)) == 0);  // Must be a pow2.
+    auto index = static_cast<size_t>(pos & (capacity_ - 1));
+    return &entries_[index];
+  }
+
+  // Underlying storage. It's raw malloc-ed rather than being a unique_ptr<T[]>
+  // to allow having uninitialized entries inside it.
+  T* entries_ = nullptr;
+  size_t capacity_ = 0;  // Number of allocated slots (NOT bytes) in |entries_|.
+
+  // The |begin_| and |end_| indexes are monotonic and never wrap. Modular arith
+  // is used only when dereferencing entries in the vector.
+  uint64_t begin_ = 0;
+  uint64_t end_ = 0;
+
+// Generation is used in debug builds only for checking iterator validity.
+#if PERFETTO_DCHECK_IS_ON()
+  uint32_t generation_ = 0;
+#endif
+};
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_CIRCULAR_QUEUE_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SRC_TRACING_CORE_TRACING_SERVICE_IMPL_H_
+#define SRC_TRACING_CORE_TRACING_SERVICE_IMPL_H_
+
+#include <algorithm>
+#include <functional>
+#include <map>
+#include <memory>
+#include <mutex>
+#include <random>
+#include <set>
+#include <utility>
+#include <vector>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/base/status.h"
+// gen_amalgamated expanded: #include "perfetto/base/time.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/circular_queue.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/optional.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/periodic_task.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/weak_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/basic_types.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/commit_data_request.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/observable_events.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/shared_memory_abi.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/trace_stats.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/tracing_service.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/data_source_config.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/data_source_descriptor.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/forward_decls.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/trace_config.h"
+// gen_amalgamated expanded: #include "src/android_stats/perfetto_atoms.h"
+// gen_amalgamated expanded: #include "src/tracing/core/id_allocator.h"
+
+namespace protozero {
+class MessageFilter;
+}
+
+namespace perfetto {
+
+namespace base {
+class TaskRunner;
+}  // namespace base
+
+class Consumer;
+class Producer;
+class SharedMemory;
+class SharedMemoryArbiterImpl;
+class TraceBuffer;
+class TracePacket;
+
+// The tracing service business logic.
+class TracingServiceImpl : public TracingService {
+ private:
+  struct DataSourceInstance;
+
+ public:
+  static constexpr size_t kDefaultShmPageSize = 4096ul;
+  static constexpr size_t kDefaultShmSize = 256 * 1024ul;
+  static constexpr size_t kMaxShmSize = 32 * 1024 * 1024ul;
+  static constexpr uint32_t kDataSourceStopTimeoutMs = 5000;
+  static constexpr uint8_t kSyncMarker[] = {0x82, 0x47, 0x7a, 0x76, 0xb2, 0x8d,
+                                            0x42, 0xba, 0x81, 0xdc, 0x33, 0x32,
+                                            0x6d, 0x57, 0xa0, 0x79};
+
+  // The implementation behind the service endpoint exposed to each producer.
+  class ProducerEndpointImpl : public TracingService::ProducerEndpoint {
+   public:
+    ProducerEndpointImpl(ProducerID,
+                         uid_t uid,
+                         TracingServiceImpl*,
+                         base::TaskRunner*,
+                         Producer*,
+                         const std::string& producer_name,
+                         const std::string& sdk_version,
+                         bool in_process,
+                         bool smb_scraping_enabled);
+    ~ProducerEndpointImpl() override;
+
+    // TracingService::ProducerEndpoint implementation.
+    void RegisterDataSource(const DataSourceDescriptor&) override;
+    void UnregisterDataSource(const std::string& name) override;
+    void RegisterTraceWriter(uint32_t writer_id,
+                             uint32_t target_buffer) override;
+    void UnregisterTraceWriter(uint32_t writer_id) override;
+    void CommitData(const CommitDataRequest&, CommitDataCallback) override;
+    void SetupSharedMemory(std::unique_ptr<SharedMemory>,
+                           size_t page_size_bytes,
+                           bool provided_by_producer);
+    std::unique_ptr<TraceWriter> CreateTraceWriter(
+        BufferID,
+        BufferExhaustedPolicy) override;
+    SharedMemoryArbiter* MaybeSharedMemoryArbiter() override;
+    bool IsShmemProvidedByProducer() const override;
+    void NotifyFlushComplete(FlushRequestID) override;
+    void NotifyDataSourceStarted(DataSourceInstanceID) override;
+    void NotifyDataSourceStopped(DataSourceInstanceID) override;
+    SharedMemory* shared_memory() const override;
+    size_t shared_buffer_page_size_kb() const override;
+    void ActivateTriggers(const std::vector<std::string>&) override;
+    void Sync(std::function<void()> callback) override;
+
+    void OnTracingSetup();
+    void SetupDataSource(DataSourceInstanceID, const DataSourceConfig&);
+    void StartDataSource(DataSourceInstanceID, const DataSourceConfig&);
+    void StopDataSource(DataSourceInstanceID);
+    void Flush(FlushRequestID, const std::vector<DataSourceInstanceID>&);
+    void OnFreeBuffers(const std::vector<BufferID>& target_buffers);
+    void ClearIncrementalState(const std::vector<DataSourceInstanceID>&);
+
+    bool is_allowed_target_buffer(BufferID buffer_id) const {
+      return allowed_target_buffers_.count(buffer_id);
+    }
+
+    base::Optional<BufferID> buffer_id_for_writer(WriterID writer_id) const {
+      const auto it = writers_.find(writer_id);
+      if (it != writers_.end())
+        return it->second;
+      return base::nullopt;
+    }
+
+    uid_t uid() const { return uid_; }
+
+   private:
+    friend class TracingServiceImpl;
+    friend class TracingServiceImplTest;
+    friend class TracingIntegrationTest;
+    ProducerEndpointImpl(const ProducerEndpointImpl&) = delete;
+    ProducerEndpointImpl& operator=(const ProducerEndpointImpl&) = delete;
+
+    ProducerID const id_;
+    const uid_t uid_;
+    TracingServiceImpl* const service_;
+    base::TaskRunner* const task_runner_;
+    Producer* producer_;
+    std::unique_ptr<SharedMemory> shared_memory_;
+    size_t shared_buffer_page_size_kb_ = 0;
+    SharedMemoryABI shmem_abi_;
+    size_t shmem_size_hint_bytes_ = 0;
+    size_t shmem_page_size_hint_bytes_ = 0;
+    bool is_shmem_provided_by_producer_ = false;
+    const std::string name_;
+    std::string sdk_version_;
+    bool in_process_;
+    bool smb_scraping_enabled_;
+
+    // Set of the global target_buffer IDs that the producer is configured to
+    // write into in any active tracing session.
+    std::set<BufferID> allowed_target_buffers_;
+
+    // Maps registered TraceWriter IDs to their target buffers as registered by
+    // the producer. Note that producers aren't required to register their
+    // writers, so we may see commits of chunks with WriterIDs that aren't
+    // contained in this map. However, if a producer does register a writer, the
+    // service will prevent the writer from writing into any other buffer than
+    // the one associated with it here. The BufferIDs stored in this map are
+    // untrusted, so need to be verified against |allowed_target_buffers_|
+    // before use.
+    std::map<WriterID, BufferID> writers_;
+
+    // This is used only in in-process configurations.
+    // SharedMemoryArbiterImpl methods themselves are thread-safe.
+    std::unique_ptr<SharedMemoryArbiterImpl> inproc_shmem_arbiter_;
+
+    PERFETTO_THREAD_CHECKER(thread_checker_)
+    base::WeakPtrFactory<ProducerEndpointImpl> weak_ptr_factory_;  // Keep last.
+  };
+
+  // The implementation behind the service endpoint exposed to each consumer.
+  class ConsumerEndpointImpl : public TracingService::ConsumerEndpoint {
+   public:
+    ConsumerEndpointImpl(TracingServiceImpl*,
+                         base::TaskRunner*,
+                         Consumer*,
+                         uid_t uid);
+    ~ConsumerEndpointImpl() override;
+
+    void NotifyOnTracingDisabled(const std::string& error);
+
+    // TracingService::ConsumerEndpoint implementation.
+    void EnableTracing(const TraceConfig&, base::ScopedFile) override;
+    void ChangeTraceConfig(const TraceConfig& cfg) override;
+    void StartTracing() override;
+    void DisableTracing() override;
+    void ReadBuffers() override;
+    void FreeBuffers() override;
+    void Flush(uint32_t timeout_ms, FlushCallback) override;
+    void Detach(const std::string& key) override;
+    void Attach(const std::string& key) override;
+    void GetTraceStats() override;
+    void ObserveEvents(uint32_t enabled_event_types) override;
+    void QueryServiceState(QueryServiceStateCallback) override;
+    void QueryCapabilities(QueryCapabilitiesCallback) override;
+    void SaveTraceForBugreport(SaveTraceForBugreportCallback) override;
+
+    // Will queue a task to notify the consumer about the state change.
+    void OnDataSourceInstanceStateChange(const ProducerEndpointImpl&,
+                                         const DataSourceInstance&);
+    void OnAllDataSourcesStarted();
+
+   private:
+    friend class TracingServiceImpl;
+    ConsumerEndpointImpl(const ConsumerEndpointImpl&) = delete;
+    ConsumerEndpointImpl& operator=(const ConsumerEndpointImpl&) = delete;
+
+    // Returns a pointer to an ObservableEvents object that the caller can fill
+    // and schedules a task to send the ObservableEvents to the consumer.
+    ObservableEvents* AddObservableEvents();
+
+    base::TaskRunner* const task_runner_;
+    TracingServiceImpl* const service_;
+    Consumer* const consumer_;
+    uid_t const uid_;
+    TracingSessionID tracing_session_id_ = 0;
+
+    // Whether the consumer is interested in DataSourceInstance state change
+    // events.
+    uint32_t observable_events_mask_ = 0;
+
+    // ObservableEvents that will be sent to the consumer. If set, a task to
+    // flush the events to the consumer has been queued.
+    std::unique_ptr<ObservableEvents> observable_events_;
+
+    PERFETTO_THREAD_CHECKER(thread_checker_)
+    base::WeakPtrFactory<ConsumerEndpointImpl> weak_ptr_factory_;  // Keep last.
+  };
+
+  explicit TracingServiceImpl(std::unique_ptr<SharedMemory::Factory>,
+                              base::TaskRunner*);
+  ~TracingServiceImpl() override;
+
+  // Called by ProducerEndpointImpl.
+  void DisconnectProducer(ProducerID);
+  void RegisterDataSource(ProducerID, const DataSourceDescriptor&);
+  void UnregisterDataSource(ProducerID, const std::string& name);
+  void CopyProducerPageIntoLogBuffer(ProducerID,
+                                     uid_t,
+                                     WriterID,
+                                     ChunkID,
+                                     BufferID,
+                                     uint16_t num_fragments,
+                                     uint8_t chunk_flags,
+                                     bool chunk_complete,
+                                     const uint8_t* src,
+                                     size_t size);
+  void ApplyChunkPatches(ProducerID,
+                         const std::vector<CommitDataRequest::ChunkToPatch>&);
+  void NotifyFlushDoneForProducer(ProducerID, FlushRequestID);
+  void NotifyDataSourceStarted(ProducerID, const DataSourceInstanceID);
+  void NotifyDataSourceStopped(ProducerID, const DataSourceInstanceID);
+  void ActivateTriggers(ProducerID, const std::vector<std::string>& triggers);
+
+  // Called by ConsumerEndpointImpl.
+  bool DetachConsumer(ConsumerEndpointImpl*, const std::string& key);
+  bool AttachConsumer(ConsumerEndpointImpl*, const std::string& key);
+  void DisconnectConsumer(ConsumerEndpointImpl*);
+  base::Status EnableTracing(ConsumerEndpointImpl*,
+                             const TraceConfig&,
+                             base::ScopedFile);
+  void ChangeTraceConfig(ConsumerEndpointImpl*, const TraceConfig&);
+
+  base::Status StartTracing(TracingSessionID);
+  void DisableTracing(TracingSessionID, bool disable_immediately = false);
+  void Flush(TracingSessionID tsid,
+             uint32_t timeout_ms,
+             ConsumerEndpoint::FlushCallback);
+  void FlushAndDisableTracing(TracingSessionID);
+  bool ReadBuffers(TracingSessionID, ConsumerEndpointImpl*);
+  void FreeBuffers(TracingSessionID);
+
+  // Service implementation.
+  std::unique_ptr<TracingService::ProducerEndpoint> ConnectProducer(
+      Producer*,
+      uid_t uid,
+      const std::string& producer_name,
+      size_t shared_memory_size_hint_bytes = 0,
+      bool in_process = false,
+      ProducerSMBScrapingMode smb_scraping_mode =
+          ProducerSMBScrapingMode::kDefault,
+      size_t shared_memory_page_size_hint_bytes = 0,
+      std::unique_ptr<SharedMemory> shm = nullptr,
+      const std::string& sdk_version = {}) override;
+
+  std::unique_ptr<TracingService::ConsumerEndpoint> ConnectConsumer(
+      Consumer*,
+      uid_t) override;
+
+  // Set whether SMB scraping should be enabled by default or not. Producers can
+  // override this setting for their own SMBs.
+  void SetSMBScrapingEnabled(bool enabled) override {
+    smb_scraping_enabled_ = enabled;
+  }
+
+  // Exposed mainly for testing.
+  size_t num_producers() const { return producers_.size(); }
+  ProducerEndpointImpl* GetProducer(ProducerID) const;
+
+ private:
+  friend class TracingServiceImplTest;
+  friend class TracingIntegrationTest;
+
+  static constexpr int64_t kOneDayInNs = 24ll * 60 * 60 * 1000 * 1000 * 1000;
+
+  struct TriggerHistory {
+    int64_t timestamp_ns;
+    uint64_t name_hash;
+
+    bool operator<(const TriggerHistory& other) const {
+      return timestamp_ns < other.timestamp_ns;
+    }
+  };
+
+  struct RegisteredDataSource {
+    ProducerID producer_id;
+    DataSourceDescriptor descriptor;
+  };
+
+  // Represents an active data source for a tracing session.
+  struct DataSourceInstance {
+    DataSourceInstance(DataSourceInstanceID id,
+                       const DataSourceConfig& cfg,
+                       const std::string& ds_name,
+                       bool notify_on_start,
+                       bool notify_on_stop,
+                       bool handles_incremental_state_invalidation)
+        : instance_id(id),
+          config(cfg),
+          data_source_name(ds_name),
+          will_notify_on_start(notify_on_start),
+          will_notify_on_stop(notify_on_stop),
+          handles_incremental_state_clear(
+              handles_incremental_state_invalidation) {}
+    DataSourceInstance(const DataSourceInstance&) = delete;
+    DataSourceInstance& operator=(const DataSourceInstance&) = delete;
+
+    DataSourceInstanceID instance_id;
+    DataSourceConfig config;
+    std::string data_source_name;
+    bool will_notify_on_start;
+    bool will_notify_on_stop;
+    bool handles_incremental_state_clear;
+
+    enum DataSourceInstanceState {
+      CONFIGURED,
+      STARTING,
+      STARTED,
+      STOPPING,
+      STOPPED
+    };
+    DataSourceInstanceState state = CONFIGURED;
+  };
+
+  struct PendingFlush {
+    std::set<ProducerID> producers;
+    ConsumerEndpoint::FlushCallback callback;
+    explicit PendingFlush(decltype(callback) cb) : callback(std::move(cb)) {}
+  };
+
+  // Holds the state of a tracing session. A tracing session is uniquely bound
+  // a specific Consumer. Each Consumer can own one or more sessions.
+  struct TracingSession {
+    enum State {
+      DISABLED = 0,
+      CONFIGURED,
+      STARTED,
+      DISABLING_WAITING_STOP_ACKS
+    };
+
+    TracingSession(TracingSessionID,
+                   ConsumerEndpointImpl*,
+                   const TraceConfig&,
+                   base::TaskRunner*);
+    TracingSession(TracingSession&&) = delete;
+    TracingSession& operator=(TracingSession&&) = delete;
+
+    size_t num_buffers() const { return buffers_index.size(); }
+
+    uint32_t delay_to_next_write_period_ms() const {
+      PERFETTO_DCHECK(write_period_ms > 0);
+      return write_period_ms -
+             static_cast<uint32_t>(base::GetWallTimeMs().count() %
+                                   write_period_ms);
+    }
+
+    uint32_t flush_timeout_ms() {
+      uint32_t timeout_ms = config.flush_timeout_ms();
+      return timeout_ms ? timeout_ms : kDefaultFlushTimeoutMs;
+    }
+
+    uint32_t data_source_stop_timeout_ms() {
+      uint32_t timeout_ms = config.data_source_stop_timeout_ms();
+      return timeout_ms ? timeout_ms : kDataSourceStopTimeoutMs;
+    }
+
+    PacketSequenceID GetPacketSequenceID(ProducerID producer_id,
+                                         WriterID writer_id) {
+      auto key = std::make_pair(producer_id, writer_id);
+      auto it = packet_sequence_ids.find(key);
+      if (it != packet_sequence_ids.end())
+        return it->second;
+      // We shouldn't run out of sequence IDs (producer ID is 16 bit, writer IDs
+      // are limited to 1024).
+      static_assert(kMaxPacketSequenceID > kMaxProducerID * kMaxWriterID,
+                    "PacketSequenceID value space doesn't cover service "
+                    "sequence ID and all producer/writer ID combinations!");
+      PERFETTO_DCHECK(last_packet_sequence_id < kMaxPacketSequenceID);
+      PacketSequenceID sequence_id = ++last_packet_sequence_id;
+      packet_sequence_ids[key] = sequence_id;
+      return sequence_id;
+    }
+
+    DataSourceInstance* GetDataSourceInstance(
+        ProducerID producer_id,
+        DataSourceInstanceID instance_id) {
+      for (auto& inst_kv : data_source_instances) {
+        if (inst_kv.first != producer_id ||
+            inst_kv.second.instance_id != instance_id) {
+          continue;
+        }
+        return &inst_kv.second;
+      }
+      return nullptr;
+    }
+
+    bool AllDataSourceInstancesStarted() {
+      return std::all_of(
+          data_source_instances.begin(), data_source_instances.end(),
+          [](decltype(data_source_instances)::const_reference x) {
+            return x.second.state == DataSourceInstance::STARTED;
+          });
+    }
+
+    bool AllDataSourceInstancesStopped() {
+      return std::all_of(
+          data_source_instances.begin(), data_source_instances.end(),
+          [](decltype(data_source_instances)::const_reference x) {
+            return x.second.state == DataSourceInstance::STOPPED;
+          });
+    }
+
+    const TracingSessionID id;
+
+    // The consumer that started the session.
+    // Can be nullptr if the consumer detached from the session.
+    ConsumerEndpointImpl* consumer_maybe_null;
+
+    // Unix uid of the consumer. This is valid even after the consumer detaches
+    // and does not change for the entire duration of the session. It is used to
+    // prevent that a consumer re-attaches to a session from a different uid.
+    uid_t const consumer_uid;
+
+    // The list of triggers this session received while alive and the time they
+    // were received at. This is used to insert 'fake' packets back to the
+    // consumer so they can tell when some event happened. The order matches the
+    // order they were received.
+    struct TriggerInfo {
+      uint64_t boot_time_ns;
+      std::string trigger_name;
+      std::string producer_name;
+      uid_t producer_uid;
+    };
+    std::vector<TriggerInfo> received_triggers;
+
+    // The trace config provided by the Consumer when calling
+    // EnableTracing(), plus any updates performed by ChangeTraceConfig.
+    TraceConfig config;
+
+    // List of data source instances that have been enabled on the various
+    // producers for this tracing session.
+    // TODO(rsavitski): at the time of writing, the map structure is unused
+    // (even when the calling code has a key). This is also an opportunity to
+    // consider an alternative data type, e.g. a map of vectors.
+    std::multimap<ProducerID, DataSourceInstance> data_source_instances;
+
+    // For each Flush(N) request, keeps track of the set of producers for which
+    // we are still awaiting a NotifyFlushComplete(N) ack.
+    std::map<FlushRequestID, PendingFlush> pending_flushes;
+
+    // Maps a per-trace-session buffer index into the corresponding global
+    // BufferID (shared namespace amongst all consumers). This vector has as
+    // many entries as |config.buffers_size()|.
+    std::vector<BufferID> buffers_index;
+
+    std::map<std::pair<ProducerID, WriterID>, PacketSequenceID>
+        packet_sequence_ids;
+    PacketSequenceID last_packet_sequence_id = kServicePacketSequenceID;
+
+    // Whether we should emit the trace stats next time we reach EOF while
+    // performing ReadBuffers.
+    bool should_emit_stats = false;
+
+    // Whether we should emit the sync marker the next time ReadBuffers() is
+    // called.
+    bool should_emit_sync_marker = false;
+
+    // Whether we mirrored the trace config back to the trace output yet.
+    bool did_emit_config = false;
+
+    // Whether we put the system info into the trace output yet.
+    bool did_emit_system_info = false;
+
+    // The number of received triggers we've emitted into the trace output.
+    size_t num_triggers_emitted_into_trace = 0;
+
+    // Packets that failed validation of the TrustedPacket.
+    uint64_t invalid_packets = 0;
+
+    // Set to true on the first call to MaybeNotifyAllDataSourcesStarted().
+    bool did_notify_all_data_source_started = false;
+
+    // Stores all lifecycle events of a particular type (i.e. associated with a
+    // single field id in the TracingServiceEvent proto).
+    struct LifecycleEvent {
+      LifecycleEvent(uint32_t f_id, uint32_t m_size = 1)
+          : field_id(f_id), max_size(m_size), timestamps(m_size) {}
+
+      // The field id of the event in the TracingServiceEvent proto.
+      uint32_t field_id;
+
+      // Stores the max size of |timestamps|. Set to 1 by default (in
+      // the constructor) but can be overriden in TraceSession constructor
+      // if a larger size is required.
+      uint32_t max_size;
+
+      // Stores the timestamps emitted for each event type (in nanoseconds).
+      // Emitted into the trace and cleared when the consumer next calls
+      // ReadBuffers.
+      base::CircularQueue<int64_t> timestamps;
+    };
+    std::vector<LifecycleEvent> lifecycle_events;
+
+    using ClockSnapshotData =
+        std::vector<std::pair<uint32_t /*clock_id*/, uint64_t /*ts*/>>;
+
+    // Initial clock snapshot, captured at trace start time (when state goes to
+    // TracingSession::STARTED). Emitted into the trace when the consumer first
+    // calls ReadBuffers().
+    ClockSnapshotData initial_clock_snapshot;
+
+    // Stores clock snapshots to emit into the trace as a ring buffer. This
+    // buffer is populated both periodically and when lifecycle events happen
+    // but only when significant clock drift is detected. Emitted into the trace
+    // and cleared when the consumer next calls ReadBuffers().
+    base::CircularQueue<ClockSnapshotData> clock_snapshot_ring_buffer;
+
+    State state = DISABLED;
+
+    // If the consumer detached the session, this variable defines the key used
+    // for identifying the session later when reattaching.
+    std::string detach_key;
+
+    // This is set when the Consumer calls sets |write_into_file| == true in the
+    // TraceConfig. In this case this represents the file we should stream the
+    // trace packets into, rather than returning it to the consumer via
+    // OnTraceData().
+    base::ScopedFile write_into_file;
+    uint32_t write_period_ms = 0;
+    uint64_t max_file_size_bytes = 0;
+    uint64_t bytes_written_into_file = 0;
+
+    // Set when using SaveTraceForBugreport(). This callback will be called
+    // when the tracing session ends and the data has been saved into the file.
+    std::function<void()> on_disable_callback_for_bugreport;
+    bool seized_for_bugreport = false;
+
+    // Periodic task for snapshotting service events (e.g. clocks, sync markers
+    // etc)
+    base::PeriodicTask snapshot_periodic_task;
+
+    // When non-NULL the packets should be post-processed using the filter.
+    std::unique_ptr<protozero::MessageFilter> trace_filter;
+    uint64_t filter_input_packets = 0;
+    uint64_t filter_input_bytes = 0;
+    uint64_t filter_output_bytes = 0;
+    uint64_t filter_errors = 0;
+  };
+
+  TracingServiceImpl(const TracingServiceImpl&) = delete;
+  TracingServiceImpl& operator=(const TracingServiceImpl&) = delete;
+
+  DataSourceInstance* SetupDataSource(const TraceConfig::DataSource&,
+                                      const TraceConfig::ProducerConfig&,
+                                      const RegisteredDataSource&,
+                                      TracingSession*);
+
+  // Returns the next available ProducerID that is not in |producers_|.
+  ProducerID GetNextProducerID();
+
+  // Returns a pointer to the |tracing_sessions_| entry or nullptr if the
+  // session doesn't exists.
+  TracingSession* GetTracingSession(TracingSessionID);
+
+  // Returns a pointer to the |tracing_sessions_| entry, matching the given
+  // uid and detach key, or nullptr if no such session exists.
+  TracingSession* GetDetachedSession(uid_t, const std::string& key);
+
+  // Update the memory guard rail by using the latest information from the
+  // shared memory and trace buffers.
+  void UpdateMemoryGuardrail();
+
+  void StartDataSourceInstance(ProducerEndpointImpl*,
+                               TracingSession*,
+                               DataSourceInstance*);
+  void StopDataSourceInstance(ProducerEndpointImpl*,
+                              TracingSession*,
+                              DataSourceInstance*,
+                              bool disable_immediately);
+  void PeriodicSnapshotTask(TracingSessionID);
+  void MaybeSnapshotClocksIntoRingBuffer(TracingSession*);
+  bool SnapshotClocks(TracingSession::ClockSnapshotData*);
+  void SnapshotLifecyleEvent(TracingSession*,
+                             uint32_t field_id,
+                             bool snapshot_clocks);
+  void EmitClockSnapshot(TracingSession*,
+                         TracingSession::ClockSnapshotData,
+                         std::vector<TracePacket>*);
+  void EmitSyncMarker(std::vector<TracePacket>*);
+  void EmitStats(TracingSession*, std::vector<TracePacket>*);
+  TraceStats GetTraceStats(TracingSession*);
+  void EmitLifecycleEvents(TracingSession*, std::vector<TracePacket>*);
+  void EmitSeizedForBugreportLifecycleEvent(std::vector<TracePacket>*);
+  void MaybeEmitTraceConfig(TracingSession*, std::vector<TracePacket>*);
+  void MaybeEmitSystemInfo(TracingSession*, std::vector<TracePacket>*);
+  void MaybeEmitReceivedTriggers(TracingSession*, std::vector<TracePacket>*);
+  void MaybeNotifyAllDataSourcesStarted(TracingSession*);
+  bool MaybeSaveTraceForBugreport(std::function<void()> callback);
+  void OnFlushTimeout(TracingSessionID, FlushRequestID);
+  void OnDisableTracingTimeout(TracingSessionID);
+  void DisableTracingNotifyConsumerAndFlushFile(TracingSession*);
+  void PeriodicFlushTask(TracingSessionID, bool post_next_only);
+  void CompleteFlush(TracingSessionID tsid,
+                     ConsumerEndpoint::FlushCallback callback,
+                     bool success);
+  void ScrapeSharedMemoryBuffers(TracingSession*, ProducerEndpointImpl*);
+  void PeriodicClearIncrementalStateTask(TracingSessionID, bool post_next_only);
+  TraceBuffer* GetBufferByID(BufferID);
+  void OnStartTriggersTimeout(TracingSessionID tsid);
+  void MaybeLogUploadEvent(const TraceConfig&,
+                           PerfettoStatsdAtom atom,
+                           const std::string& trigger_name = "");
+  void MaybeLogTriggerEvent(const TraceConfig&,
+                            PerfettoTriggerAtom atom,
+                            const std::string& trigger_name);
+  size_t PurgeExpiredAndCountTriggerInWindow(int64_t now_ns,
+                                             uint64_t trigger_name_hash);
+
+  base::TaskRunner* const task_runner_;
+  std::unique_ptr<SharedMemory::Factory> shm_factory_;
+  ProducerID last_producer_id_ = 0;
+  DataSourceInstanceID last_data_source_instance_id_ = 0;
+  TracingSessionID last_tracing_session_id_ = 0;
+  FlushRequestID last_flush_request_id_ = 0;
+  uid_t uid_ = 0;
+
+  // Buffer IDs are global across all consumers (because a Producer can produce
+  // data for more than one trace session, hence more than one consumer).
+  IdAllocator<BufferID> buffer_ids_;
+
+  std::multimap<std::string /*name*/, RegisteredDataSource> data_sources_;
+  std::map<ProducerID, ProducerEndpointImpl*> producers_;
+  std::set<ConsumerEndpointImpl*> consumers_;
+  std::map<TracingSessionID, TracingSession> tracing_sessions_;
+  std::map<BufferID, std::unique_ptr<TraceBuffer>> buffers_;
+  std::map<std::string, int64_t> session_to_last_trace_s_;
+
+  // Contains timestamps of triggers.
+  // The queue is sorted by timestamp and invocations older than
+  // |trigger_window_ns_| are purged when a trigger happens.
+  base::CircularQueue<TriggerHistory> trigger_history_;
+
+  bool smb_scraping_enabled_ = false;
+  bool lockdown_mode_ = false;
+  uint32_t min_write_period_ms_ = 100;       // Overridable for testing.
+  int64_t trigger_window_ns_ = kOneDayInNs;  // Overridable for testing.
+
+  std::minstd_rand trigger_probability_rand_;
+  std::uniform_real_distribution<> trigger_probability_dist_;
+  double trigger_rnd_override_for_testing_ = 0;  // Overridable for testing.
+
+  uint8_t sync_marker_packet_[32];  // Lazily initialized.
+  size_t sync_marker_packet_size_ = 0;
+
+  // Stats.
+  uint64_t chunks_discarded_ = 0;
+  uint64_t patches_discarded_ = 0;
+
+  PERFETTO_THREAD_CHECKER(thread_checker_)
+
+  base::WeakPtrFactory<TracingServiceImpl>
+      weak_ptr_factory_;  // Keep at the end.
+};
+
+}  // namespace perfetto
+
+#endif  // SRC_TRACING_CORE_TRACING_SERVICE_IMPL_H_
+// gen_amalgamated begin header: include/perfetto/tracing/core/tracing_service_capabilities.h
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_CORE_TRACING_SERVICE_CAPABILITIES_H_
+#define INCLUDE_PERFETTO_TRACING_CORE_TRACING_SERVICE_CAPABILITIES_H_
+
+// Creates the aliases in the ::perfetto namespace, doing things like:
+// using ::perfetto::Foo = ::perfetto::protos::gen::Foo.
+// See comments in forward_decls.h for the historical reasons of this
+// indirection layer.
+// gen_amalgamated expanded: #include "perfetto/tracing/core/forward_decls.h"
+
+// gen_amalgamated expanded: #include "protos/perfetto/common/tracing_service_capabilities.gen.h"
+
+#endif  // INCLUDE_PERFETTO_TRACING_CORE_TRACING_SERVICE_CAPABILITIES_H_
+// gen_amalgamated begin header: gen/protos/perfetto/common/trace_stats.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACE_STATS_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACE_STATS_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class TraceStats_BufferStats;
+class TraceStats_FilterStats;
+
+class TraceStats_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/11, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  TraceStats_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceStats_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceStats_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_buffer_stats() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> buffer_stats() const { return GetRepeated<::protozero::ConstBytes>(1); }
+  bool has_producers_connected() const { return at<2>().valid(); }
+  uint32_t producers_connected() const { return at<2>().as_uint32(); }
+  bool has_producers_seen() const { return at<3>().valid(); }
+  uint64_t producers_seen() const { return at<3>().as_uint64(); }
+  bool has_data_sources_registered() const { return at<4>().valid(); }
+  uint32_t data_sources_registered() const { return at<4>().as_uint32(); }
+  bool has_data_sources_seen() const { return at<5>().valid(); }
+  uint64_t data_sources_seen() const { return at<5>().as_uint64(); }
+  bool has_tracing_sessions() const { return at<6>().valid(); }
+  uint32_t tracing_sessions() const { return at<6>().as_uint32(); }
+  bool has_total_buffers() const { return at<7>().valid(); }
+  uint32_t total_buffers() const { return at<7>().as_uint32(); }
+  bool has_chunks_discarded() const { return at<8>().valid(); }
+  uint64_t chunks_discarded() const { return at<8>().as_uint64(); }
+  bool has_patches_discarded() const { return at<9>().valid(); }
+  uint64_t patches_discarded() const { return at<9>().as_uint64(); }
+  bool has_invalid_packets() const { return at<10>().valid(); }
+  uint64_t invalid_packets() const { return at<10>().as_uint64(); }
+  bool has_filter_stats() const { return at<11>().valid(); }
+  ::protozero::ConstBytes filter_stats() const { return at<11>().as_bytes(); }
+};
+
+class TraceStats : public ::protozero::Message {
+ public:
+  using Decoder = TraceStats_Decoder;
+  enum : int32_t {
+    kBufferStatsFieldNumber = 1,
+    kProducersConnectedFieldNumber = 2,
+    kProducersSeenFieldNumber = 3,
+    kDataSourcesRegisteredFieldNumber = 4,
+    kDataSourcesSeenFieldNumber = 5,
+    kTracingSessionsFieldNumber = 6,
+    kTotalBuffersFieldNumber = 7,
+    kChunksDiscardedFieldNumber = 8,
+    kPatchesDiscardedFieldNumber = 9,
+    kInvalidPacketsFieldNumber = 10,
+    kFilterStatsFieldNumber = 11,
+  };
+  using BufferStats = ::perfetto::protos::pbzero::TraceStats_BufferStats;
+  using FilterStats = ::perfetto::protos::pbzero::TraceStats_FilterStats;
+
+  using FieldMetadata_BufferStats =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceStats_BufferStats,
+      TraceStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BufferStats kBufferStats() { return {}; }
+  template <typename T = TraceStats_BufferStats> T* add_buffer_stats() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_ProducersConnected =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProducersConnected kProducersConnected() { return {}; }
+  void set_producers_connected(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProducersConnected::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ProducersSeen =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProducersSeen kProducersSeen() { return {}; }
+  void set_producers_seen(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProducersSeen::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DataSourcesRegistered =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DataSourcesRegistered kDataSourcesRegistered() { return {}; }
+  void set_data_sources_registered(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DataSourcesRegistered::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DataSourcesSeen =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DataSourcesSeen kDataSourcesSeen() { return {}; }
+  void set_data_sources_seen(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DataSourcesSeen::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TracingSessions =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TracingSessions kTracingSessions() { return {}; }
+  void set_tracing_sessions(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TracingSessions::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TotalBuffers =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TotalBuffers kTotalBuffers() { return {}; }
+  void set_total_buffers(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TotalBuffers::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ChunksDiscarded =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChunksDiscarded kChunksDiscarded() { return {}; }
+  void set_chunks_discarded(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ChunksDiscarded::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PatchesDiscarded =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PatchesDiscarded kPatchesDiscarded() { return {}; }
+  void set_patches_discarded(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PatchesDiscarded::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_InvalidPackets =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_InvalidPackets kInvalidPackets() { return {}; }
+  void set_invalid_packets(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_InvalidPackets::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FilterStats =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceStats_FilterStats,
+      TraceStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FilterStats kFilterStats() { return {}; }
+  template <typename T = TraceStats_FilterStats> T* set_filter_stats() {
+    return BeginNestedMessage<T>(11);
+  }
+
+};
+
+class TraceStats_FilterStats_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TraceStats_FilterStats_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceStats_FilterStats_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceStats_FilterStats_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_input_packets() const { return at<1>().valid(); }
+  uint64_t input_packets() const { return at<1>().as_uint64(); }
+  bool has_input_bytes() const { return at<2>().valid(); }
+  uint64_t input_bytes() const { return at<2>().as_uint64(); }
+  bool has_output_bytes() const { return at<3>().valid(); }
+  uint64_t output_bytes() const { return at<3>().as_uint64(); }
+  bool has_errors() const { return at<4>().valid(); }
+  uint64_t errors() const { return at<4>().as_uint64(); }
+};
+
+class TraceStats_FilterStats : public ::protozero::Message {
+ public:
+  using Decoder = TraceStats_FilterStats_Decoder;
+  enum : int32_t {
+    kInputPacketsFieldNumber = 1,
+    kInputBytesFieldNumber = 2,
+    kOutputBytesFieldNumber = 3,
+    kErrorsFieldNumber = 4,
+  };
+
+  using FieldMetadata_InputPackets =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_FilterStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_InputPackets kInputPackets() { return {}; }
+  void set_input_packets(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_InputPackets::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_InputBytes =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_FilterStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_InputBytes kInputBytes() { return {}; }
+  void set_input_bytes(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_InputBytes::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OutputBytes =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_FilterStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OutputBytes kOutputBytes() { return {}; }
+  void set_output_bytes(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OutputBytes::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Errors =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_FilterStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Errors kErrors() { return {}; }
+  void set_errors(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Errors::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TraceStats_BufferStats_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/19, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TraceStats_BufferStats_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceStats_BufferStats_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceStats_BufferStats_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_buffer_size() const { return at<12>().valid(); }
+  uint64_t buffer_size() const { return at<12>().as_uint64(); }
+  bool has_bytes_written() const { return at<1>().valid(); }
+  uint64_t bytes_written() const { return at<1>().as_uint64(); }
+  bool has_bytes_overwritten() const { return at<13>().valid(); }
+  uint64_t bytes_overwritten() const { return at<13>().as_uint64(); }
+  bool has_bytes_read() const { return at<14>().valid(); }
+  uint64_t bytes_read() const { return at<14>().as_uint64(); }
+  bool has_padding_bytes_written() const { return at<15>().valid(); }
+  uint64_t padding_bytes_written() const { return at<15>().as_uint64(); }
+  bool has_padding_bytes_cleared() const { return at<16>().valid(); }
+  uint64_t padding_bytes_cleared() const { return at<16>().as_uint64(); }
+  bool has_chunks_written() const { return at<2>().valid(); }
+  uint64_t chunks_written() const { return at<2>().as_uint64(); }
+  bool has_chunks_rewritten() const { return at<10>().valid(); }
+  uint64_t chunks_rewritten() const { return at<10>().as_uint64(); }
+  bool has_chunks_overwritten() const { return at<3>().valid(); }
+  uint64_t chunks_overwritten() const { return at<3>().as_uint64(); }
+  bool has_chunks_discarded() const { return at<18>().valid(); }
+  uint64_t chunks_discarded() const { return at<18>().as_uint64(); }
+  bool has_chunks_read() const { return at<17>().valid(); }
+  uint64_t chunks_read() const { return at<17>().as_uint64(); }
+  bool has_chunks_committed_out_of_order() const { return at<11>().valid(); }
+  uint64_t chunks_committed_out_of_order() const { return at<11>().as_uint64(); }
+  bool has_write_wrap_count() const { return at<4>().valid(); }
+  uint64_t write_wrap_count() const { return at<4>().as_uint64(); }
+  bool has_patches_succeeded() const { return at<5>().valid(); }
+  uint64_t patches_succeeded() const { return at<5>().as_uint64(); }
+  bool has_patches_failed() const { return at<6>().valid(); }
+  uint64_t patches_failed() const { return at<6>().as_uint64(); }
+  bool has_readaheads_succeeded() const { return at<7>().valid(); }
+  uint64_t readaheads_succeeded() const { return at<7>().as_uint64(); }
+  bool has_readaheads_failed() const { return at<8>().valid(); }
+  uint64_t readaheads_failed() const { return at<8>().as_uint64(); }
+  bool has_abi_violations() const { return at<9>().valid(); }
+  uint64_t abi_violations() const { return at<9>().as_uint64(); }
+  bool has_trace_writer_packet_loss() const { return at<19>().valid(); }
+  uint64_t trace_writer_packet_loss() const { return at<19>().as_uint64(); }
+};
+
+class TraceStats_BufferStats : public ::protozero::Message {
+ public:
+  using Decoder = TraceStats_BufferStats_Decoder;
+  enum : int32_t {
+    kBufferSizeFieldNumber = 12,
+    kBytesWrittenFieldNumber = 1,
+    kBytesOverwrittenFieldNumber = 13,
+    kBytesReadFieldNumber = 14,
+    kPaddingBytesWrittenFieldNumber = 15,
+    kPaddingBytesClearedFieldNumber = 16,
+    kChunksWrittenFieldNumber = 2,
+    kChunksRewrittenFieldNumber = 10,
+    kChunksOverwrittenFieldNumber = 3,
+    kChunksDiscardedFieldNumber = 18,
+    kChunksReadFieldNumber = 17,
+    kChunksCommittedOutOfOrderFieldNumber = 11,
+    kWriteWrapCountFieldNumber = 4,
+    kPatchesSucceededFieldNumber = 5,
+    kPatchesFailedFieldNumber = 6,
+    kReadaheadsSucceededFieldNumber = 7,
+    kReadaheadsFailedFieldNumber = 8,
+    kAbiViolationsFieldNumber = 9,
+    kTraceWriterPacketLossFieldNumber = 19,
+  };
+
+  using FieldMetadata_BufferSize =
+    ::protozero::proto_utils::FieldMetadata<
+      12,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BufferSize kBufferSize() { return {}; }
+  void set_buffer_size(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BufferSize::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BytesWritten =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BytesWritten kBytesWritten() { return {}; }
+  void set_bytes_written(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BytesWritten::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BytesOverwritten =
+    ::protozero::proto_utils::FieldMetadata<
+      13,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BytesOverwritten kBytesOverwritten() { return {}; }
+  void set_bytes_overwritten(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BytesOverwritten::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BytesRead =
+    ::protozero::proto_utils::FieldMetadata<
+      14,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BytesRead kBytesRead() { return {}; }
+  void set_bytes_read(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BytesRead::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PaddingBytesWritten =
+    ::protozero::proto_utils::FieldMetadata<
+      15,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PaddingBytesWritten kPaddingBytesWritten() { return {}; }
+  void set_padding_bytes_written(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PaddingBytesWritten::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PaddingBytesCleared =
+    ::protozero::proto_utils::FieldMetadata<
+      16,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PaddingBytesCleared kPaddingBytesCleared() { return {}; }
+  void set_padding_bytes_cleared(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PaddingBytesCleared::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ChunksWritten =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChunksWritten kChunksWritten() { return {}; }
+  void set_chunks_written(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ChunksWritten::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ChunksRewritten =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChunksRewritten kChunksRewritten() { return {}; }
+  void set_chunks_rewritten(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ChunksRewritten::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ChunksOverwritten =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChunksOverwritten kChunksOverwritten() { return {}; }
+  void set_chunks_overwritten(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ChunksOverwritten::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ChunksDiscarded =
+    ::protozero::proto_utils::FieldMetadata<
+      18,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChunksDiscarded kChunksDiscarded() { return {}; }
+  void set_chunks_discarded(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ChunksDiscarded::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ChunksRead =
+    ::protozero::proto_utils::FieldMetadata<
+      17,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChunksRead kChunksRead() { return {}; }
+  void set_chunks_read(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ChunksRead::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ChunksCommittedOutOfOrder =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChunksCommittedOutOfOrder kChunksCommittedOutOfOrder() { return {}; }
+  void set_chunks_committed_out_of_order(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ChunksCommittedOutOfOrder::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_WriteWrapCount =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_WriteWrapCount kWriteWrapCount() { return {}; }
+  void set_write_wrap_count(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_WriteWrapCount::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PatchesSucceeded =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PatchesSucceeded kPatchesSucceeded() { return {}; }
+  void set_patches_succeeded(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PatchesSucceeded::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PatchesFailed =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PatchesFailed kPatchesFailed() { return {}; }
+  void set_patches_failed(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PatchesFailed::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ReadaheadsSucceeded =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ReadaheadsSucceeded kReadaheadsSucceeded() { return {}; }
+  void set_readaheads_succeeded(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ReadaheadsSucceeded::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ReadaheadsFailed =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ReadaheadsFailed kReadaheadsFailed() { return {}; }
+  void set_readaheads_failed(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ReadaheadsFailed::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_AbiViolations =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AbiViolations kAbiViolations() { return {}; }
+  void set_abi_violations(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_AbiViolations::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TraceWriterPacketLoss =
+    ::protozero::proto_utils::FieldMetadata<
+      19,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TraceWriterPacketLoss kTraceWriterPacketLoss() { return {}; }
+  void set_trace_writer_packet_loss(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TraceWriterPacketLoss::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/config/trace_config.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACE_CONFIG_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACE_CONFIG_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class DataSourceConfig;
+class TraceConfig_BufferConfig;
+class TraceConfig_BuiltinDataSource;
+class TraceConfig_DataSource;
+class TraceConfig_GuardrailOverrides;
+class TraceConfig_IncidentReportConfig;
+class TraceConfig_IncrementalStateConfig;
+class TraceConfig_ProducerConfig;
+class TraceConfig_StatsdMetadata;
+class TraceConfig_TraceFilter;
+class TraceConfig_TriggerConfig;
+class TraceConfig_TriggerConfig_Trigger;
+enum BuiltinClock : int32_t;
+enum TraceConfig_BufferConfig_FillPolicy : int32_t;
+enum TraceConfig_CompressionType : int32_t;
+enum TraceConfig_LockdownModeOperation : int32_t;
+enum TraceConfig_StatsdLogging : int32_t;
+enum TraceConfig_TriggerConfig_TriggerMode : int32_t;
+
+enum TraceConfig_LockdownModeOperation : int32_t {
+  TraceConfig_LockdownModeOperation_LOCKDOWN_UNCHANGED = 0,
+  TraceConfig_LockdownModeOperation_LOCKDOWN_CLEAR = 1,
+  TraceConfig_LockdownModeOperation_LOCKDOWN_SET = 2,
+};
+
+const TraceConfig_LockdownModeOperation TraceConfig_LockdownModeOperation_MIN = TraceConfig_LockdownModeOperation_LOCKDOWN_UNCHANGED;
+const TraceConfig_LockdownModeOperation TraceConfig_LockdownModeOperation_MAX = TraceConfig_LockdownModeOperation_LOCKDOWN_SET;
+
+enum TraceConfig_CompressionType : int32_t {
+  TraceConfig_CompressionType_COMPRESSION_TYPE_UNSPECIFIED = 0,
+  TraceConfig_CompressionType_COMPRESSION_TYPE_DEFLATE = 1,
+};
+
+const TraceConfig_CompressionType TraceConfig_CompressionType_MIN = TraceConfig_CompressionType_COMPRESSION_TYPE_UNSPECIFIED;
+const TraceConfig_CompressionType TraceConfig_CompressionType_MAX = TraceConfig_CompressionType_COMPRESSION_TYPE_DEFLATE;
+
+enum TraceConfig_StatsdLogging : int32_t {
+  TraceConfig_StatsdLogging_STATSD_LOGGING_UNSPECIFIED = 0,
+  TraceConfig_StatsdLogging_STATSD_LOGGING_ENABLED = 1,
+  TraceConfig_StatsdLogging_STATSD_LOGGING_DISABLED = 2,
+};
+
+const TraceConfig_StatsdLogging TraceConfig_StatsdLogging_MIN = TraceConfig_StatsdLogging_STATSD_LOGGING_UNSPECIFIED;
+const TraceConfig_StatsdLogging TraceConfig_StatsdLogging_MAX = TraceConfig_StatsdLogging_STATSD_LOGGING_DISABLED;
+
+enum TraceConfig_TriggerConfig_TriggerMode : int32_t {
+  TraceConfig_TriggerConfig_TriggerMode_UNSPECIFIED = 0,
+  TraceConfig_TriggerConfig_TriggerMode_START_TRACING = 1,
+  TraceConfig_TriggerConfig_TriggerMode_STOP_TRACING = 2,
+};
+
+const TraceConfig_TriggerConfig_TriggerMode TraceConfig_TriggerConfig_TriggerMode_MIN = TraceConfig_TriggerConfig_TriggerMode_UNSPECIFIED;
+const TraceConfig_TriggerConfig_TriggerMode TraceConfig_TriggerConfig_TriggerMode_MAX = TraceConfig_TriggerConfig_TriggerMode_STOP_TRACING;
+
+enum TraceConfig_BufferConfig_FillPolicy : int32_t {
+  TraceConfig_BufferConfig_FillPolicy_UNSPECIFIED = 0,
+  TraceConfig_BufferConfig_FillPolicy_RING_BUFFER = 1,
+  TraceConfig_BufferConfig_FillPolicy_DISCARD = 2,
+};
+
+const TraceConfig_BufferConfig_FillPolicy TraceConfig_BufferConfig_FillPolicy_MIN = TraceConfig_BufferConfig_FillPolicy_UNSPECIFIED;
+const TraceConfig_BufferConfig_FillPolicy TraceConfig_BufferConfig_FillPolicy_MAX = TraceConfig_BufferConfig_FillPolicy_DISCARD;
+
+class TraceConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/32, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  TraceConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_buffers() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> buffers() const { return GetRepeated<::protozero::ConstBytes>(1); }
+  bool has_data_sources() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> data_sources() const { return GetRepeated<::protozero::ConstBytes>(2); }
+  bool has_builtin_data_sources() const { return at<20>().valid(); }
+  ::protozero::ConstBytes builtin_data_sources() const { return at<20>().as_bytes(); }
+  bool has_duration_ms() const { return at<3>().valid(); }
+  uint32_t duration_ms() const { return at<3>().as_uint32(); }
+  bool has_enable_extra_guardrails() const { return at<4>().valid(); }
+  bool enable_extra_guardrails() const { return at<4>().as_bool(); }
+  bool has_lockdown_mode() const { return at<5>().valid(); }
+  int32_t lockdown_mode() const { return at<5>().as_int32(); }
+  bool has_producers() const { return at<6>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> producers() const { return GetRepeated<::protozero::ConstBytes>(6); }
+  bool has_statsd_metadata() const { return at<7>().valid(); }
+  ::protozero::ConstBytes statsd_metadata() const { return at<7>().as_bytes(); }
+  bool has_write_into_file() const { return at<8>().valid(); }
+  bool write_into_file() const { return at<8>().as_bool(); }
+  bool has_output_path() const { return at<29>().valid(); }
+  ::protozero::ConstChars output_path() const { return at<29>().as_string(); }
+  bool has_file_write_period_ms() const { return at<9>().valid(); }
+  uint32_t file_write_period_ms() const { return at<9>().as_uint32(); }
+  bool has_max_file_size_bytes() const { return at<10>().valid(); }
+  uint64_t max_file_size_bytes() const { return at<10>().as_uint64(); }
+  bool has_guardrail_overrides() const { return at<11>().valid(); }
+  ::protozero::ConstBytes guardrail_overrides() const { return at<11>().as_bytes(); }
+  bool has_deferred_start() const { return at<12>().valid(); }
+  bool deferred_start() const { return at<12>().as_bool(); }
+  bool has_flush_period_ms() const { return at<13>().valid(); }
+  uint32_t flush_period_ms() const { return at<13>().as_uint32(); }
+  bool has_flush_timeout_ms() const { return at<14>().valid(); }
+  uint32_t flush_timeout_ms() const { return at<14>().as_uint32(); }
+  bool has_data_source_stop_timeout_ms() const { return at<23>().valid(); }
+  uint32_t data_source_stop_timeout_ms() const { return at<23>().as_uint32(); }
+  bool has_notify_traceur() const { return at<16>().valid(); }
+  bool notify_traceur() const { return at<16>().as_bool(); }
+  bool has_bugreport_score() const { return at<30>().valid(); }
+  int32_t bugreport_score() const { return at<30>().as_int32(); }
+  bool has_trigger_config() const { return at<17>().valid(); }
+  ::protozero::ConstBytes trigger_config() const { return at<17>().as_bytes(); }
+  bool has_activate_triggers() const { return at<18>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> activate_triggers() const { return GetRepeated<::protozero::ConstChars>(18); }
+  bool has_incremental_state_config() const { return at<21>().valid(); }
+  ::protozero::ConstBytes incremental_state_config() const { return at<21>().as_bytes(); }
+  bool has_allow_user_build_tracing() const { return at<19>().valid(); }
+  bool allow_user_build_tracing() const { return at<19>().as_bool(); }
+  bool has_unique_session_name() const { return at<22>().valid(); }
+  ::protozero::ConstChars unique_session_name() const { return at<22>().as_string(); }
+  bool has_compression_type() const { return at<24>().valid(); }
+  int32_t compression_type() const { return at<24>().as_int32(); }
+  bool has_incident_report_config() const { return at<25>().valid(); }
+  ::protozero::ConstBytes incident_report_config() const { return at<25>().as_bytes(); }
+  bool has_statsd_logging() const { return at<31>().valid(); }
+  int32_t statsd_logging() const { return at<31>().as_int32(); }
+  bool has_trace_uuid_msb() const { return at<27>().valid(); }
+  int64_t trace_uuid_msb() const { return at<27>().as_int64(); }
+  bool has_trace_uuid_lsb() const { return at<28>().valid(); }
+  int64_t trace_uuid_lsb() const { return at<28>().as_int64(); }
+  bool has_trace_filter() const { return at<32>().valid(); }
+  ::protozero::ConstBytes trace_filter() const { return at<32>().as_bytes(); }
+};
+
+class TraceConfig : public ::protozero::Message {
+ public:
+  using Decoder = TraceConfig_Decoder;
+  enum : int32_t {
+    kBuffersFieldNumber = 1,
+    kDataSourcesFieldNumber = 2,
+    kBuiltinDataSourcesFieldNumber = 20,
+    kDurationMsFieldNumber = 3,
+    kEnableExtraGuardrailsFieldNumber = 4,
+    kLockdownModeFieldNumber = 5,
+    kProducersFieldNumber = 6,
+    kStatsdMetadataFieldNumber = 7,
+    kWriteIntoFileFieldNumber = 8,
+    kOutputPathFieldNumber = 29,
+    kFileWritePeriodMsFieldNumber = 9,
+    kMaxFileSizeBytesFieldNumber = 10,
+    kGuardrailOverridesFieldNumber = 11,
+    kDeferredStartFieldNumber = 12,
+    kFlushPeriodMsFieldNumber = 13,
+    kFlushTimeoutMsFieldNumber = 14,
+    kDataSourceStopTimeoutMsFieldNumber = 23,
+    kNotifyTraceurFieldNumber = 16,
+    kBugreportScoreFieldNumber = 30,
+    kTriggerConfigFieldNumber = 17,
+    kActivateTriggersFieldNumber = 18,
+    kIncrementalStateConfigFieldNumber = 21,
+    kAllowUserBuildTracingFieldNumber = 19,
+    kUniqueSessionNameFieldNumber = 22,
+    kCompressionTypeFieldNumber = 24,
+    kIncidentReportConfigFieldNumber = 25,
+    kStatsdLoggingFieldNumber = 31,
+    kTraceUuidMsbFieldNumber = 27,
+    kTraceUuidLsbFieldNumber = 28,
+    kTraceFilterFieldNumber = 32,
+  };
+  using BufferConfig = ::perfetto::protos::pbzero::TraceConfig_BufferConfig;
+  using DataSource = ::perfetto::protos::pbzero::TraceConfig_DataSource;
+  using BuiltinDataSource = ::perfetto::protos::pbzero::TraceConfig_BuiltinDataSource;
+  using ProducerConfig = ::perfetto::protos::pbzero::TraceConfig_ProducerConfig;
+  using StatsdMetadata = ::perfetto::protos::pbzero::TraceConfig_StatsdMetadata;
+  using GuardrailOverrides = ::perfetto::protos::pbzero::TraceConfig_GuardrailOverrides;
+  using TriggerConfig = ::perfetto::protos::pbzero::TraceConfig_TriggerConfig;
+  using IncrementalStateConfig = ::perfetto::protos::pbzero::TraceConfig_IncrementalStateConfig;
+  using IncidentReportConfig = ::perfetto::protos::pbzero::TraceConfig_IncidentReportConfig;
+  using TraceFilter = ::perfetto::protos::pbzero::TraceConfig_TraceFilter;
+  using LockdownModeOperation = ::perfetto::protos::pbzero::TraceConfig_LockdownModeOperation;
+  using CompressionType = ::perfetto::protos::pbzero::TraceConfig_CompressionType;
+  using StatsdLogging = ::perfetto::protos::pbzero::TraceConfig_StatsdLogging;
+  static const LockdownModeOperation LOCKDOWN_UNCHANGED = TraceConfig_LockdownModeOperation_LOCKDOWN_UNCHANGED;
+  static const LockdownModeOperation LOCKDOWN_CLEAR = TraceConfig_LockdownModeOperation_LOCKDOWN_CLEAR;
+  static const LockdownModeOperation LOCKDOWN_SET = TraceConfig_LockdownModeOperation_LOCKDOWN_SET;
+  static const CompressionType COMPRESSION_TYPE_UNSPECIFIED = TraceConfig_CompressionType_COMPRESSION_TYPE_UNSPECIFIED;
+  static const CompressionType COMPRESSION_TYPE_DEFLATE = TraceConfig_CompressionType_COMPRESSION_TYPE_DEFLATE;
+  static const StatsdLogging STATSD_LOGGING_UNSPECIFIED = TraceConfig_StatsdLogging_STATSD_LOGGING_UNSPECIFIED;
+  static const StatsdLogging STATSD_LOGGING_ENABLED = TraceConfig_StatsdLogging_STATSD_LOGGING_ENABLED;
+  static const StatsdLogging STATSD_LOGGING_DISABLED = TraceConfig_StatsdLogging_STATSD_LOGGING_DISABLED;
+
+  using FieldMetadata_Buffers =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceConfig_BufferConfig,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Buffers kBuffers() { return {}; }
+  template <typename T = TraceConfig_BufferConfig> T* add_buffers() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_DataSources =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceConfig_DataSource,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DataSources kDataSources() { return {}; }
+  template <typename T = TraceConfig_DataSource> T* add_data_sources() {
+    return BeginNestedMessage<T>(2);
+  }
+
+
+  using FieldMetadata_BuiltinDataSources =
+    ::protozero::proto_utils::FieldMetadata<
+      20,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceConfig_BuiltinDataSource,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BuiltinDataSources kBuiltinDataSources() { return {}; }
+  template <typename T = TraceConfig_BuiltinDataSource> T* set_builtin_data_sources() {
+    return BeginNestedMessage<T>(20);
+  }
+
+
+  using FieldMetadata_DurationMs =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DurationMs kDurationMs() { return {}; }
+  void set_duration_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DurationMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_EnableExtraGuardrails =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EnableExtraGuardrails kEnableExtraGuardrails() { return {}; }
+  void set_enable_extra_guardrails(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_EnableExtraGuardrails::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LockdownMode =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::TraceConfig_LockdownModeOperation,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LockdownMode kLockdownMode() { return {}; }
+  void set_lockdown_mode(::perfetto::protos::pbzero::TraceConfig_LockdownModeOperation value) {
+    static constexpr uint32_t field_id = FieldMetadata_LockdownMode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Producers =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceConfig_ProducerConfig,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Producers kProducers() { return {}; }
+  template <typename T = TraceConfig_ProducerConfig> T* add_producers() {
+    return BeginNestedMessage<T>(6);
+  }
+
+
+  using FieldMetadata_StatsdMetadata =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceConfig_StatsdMetadata,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StatsdMetadata kStatsdMetadata() { return {}; }
+  template <typename T = TraceConfig_StatsdMetadata> T* set_statsd_metadata() {
+    return BeginNestedMessage<T>(7);
+  }
+
+
+  using FieldMetadata_WriteIntoFile =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_WriteIntoFile kWriteIntoFile() { return {}; }
+  void set_write_into_file(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_WriteIntoFile::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OutputPath =
+    ::protozero::proto_utils::FieldMetadata<
+      29,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OutputPath kOutputPath() { return {}; }
+  void set_output_path(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_OutputPath::kFieldId, data, size);
+  }
+  void set_output_path(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_OutputPath::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FileWritePeriodMs =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FileWritePeriodMs kFileWritePeriodMs() { return {}; }
+  void set_file_write_period_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FileWritePeriodMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MaxFileSizeBytes =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MaxFileSizeBytes kMaxFileSizeBytes() { return {}; }
+  void set_max_file_size_bytes(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MaxFileSizeBytes::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_GuardrailOverrides =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceConfig_GuardrailOverrides,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GuardrailOverrides kGuardrailOverrides() { return {}; }
+  template <typename T = TraceConfig_GuardrailOverrides> T* set_guardrail_overrides() {
+    return BeginNestedMessage<T>(11);
+  }
+
+
+  using FieldMetadata_DeferredStart =
+    ::protozero::proto_utils::FieldMetadata<
+      12,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DeferredStart kDeferredStart() { return {}; }
+  void set_deferred_start(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_DeferredStart::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FlushPeriodMs =
+    ::protozero::proto_utils::FieldMetadata<
+      13,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FlushPeriodMs kFlushPeriodMs() { return {}; }
+  void set_flush_period_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FlushPeriodMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FlushTimeoutMs =
+    ::protozero::proto_utils::FieldMetadata<
+      14,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FlushTimeoutMs kFlushTimeoutMs() { return {}; }
+  void set_flush_timeout_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FlushTimeoutMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DataSourceStopTimeoutMs =
+    ::protozero::proto_utils::FieldMetadata<
+      23,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DataSourceStopTimeoutMs kDataSourceStopTimeoutMs() { return {}; }
+  void set_data_source_stop_timeout_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DataSourceStopTimeoutMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NotifyTraceur =
+    ::protozero::proto_utils::FieldMetadata<
+      16,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NotifyTraceur kNotifyTraceur() { return {}; }
+  void set_notify_traceur(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_NotifyTraceur::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BugreportScore =
+    ::protozero::proto_utils::FieldMetadata<
+      30,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BugreportScore kBugreportScore() { return {}; }
+  void set_bugreport_score(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BugreportScore::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TriggerConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      17,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceConfig_TriggerConfig,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TriggerConfig kTriggerConfig() { return {}; }
+  template <typename T = TraceConfig_TriggerConfig> T* set_trigger_config() {
+    return BeginNestedMessage<T>(17);
+  }
+
+
+  using FieldMetadata_ActivateTriggers =
+    ::protozero::proto_utils::FieldMetadata<
+      18,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ActivateTriggers kActivateTriggers() { return {}; }
+  void add_activate_triggers(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ActivateTriggers::kFieldId, data, size);
+  }
+  void add_activate_triggers(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ActivateTriggers::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IncrementalStateConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      21,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceConfig_IncrementalStateConfig,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IncrementalStateConfig kIncrementalStateConfig() { return {}; }
+  template <typename T = TraceConfig_IncrementalStateConfig> T* set_incremental_state_config() {
+    return BeginNestedMessage<T>(21);
+  }
+
+
+  using FieldMetadata_AllowUserBuildTracing =
+    ::protozero::proto_utils::FieldMetadata<
+      19,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AllowUserBuildTracing kAllowUserBuildTracing() { return {}; }
+  void set_allow_user_build_tracing(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_AllowUserBuildTracing::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_UniqueSessionName =
+    ::protozero::proto_utils::FieldMetadata<
+      22,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UniqueSessionName kUniqueSessionName() { return {}; }
+  void set_unique_session_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_UniqueSessionName::kFieldId, data, size);
+  }
+  void set_unique_session_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_UniqueSessionName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CompressionType =
+    ::protozero::proto_utils::FieldMetadata<
+      24,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::TraceConfig_CompressionType,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CompressionType kCompressionType() { return {}; }
+  void set_compression_type(::perfetto::protos::pbzero::TraceConfig_CompressionType value) {
+    static constexpr uint32_t field_id = FieldMetadata_CompressionType::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IncidentReportConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      25,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceConfig_IncidentReportConfig,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IncidentReportConfig kIncidentReportConfig() { return {}; }
+  template <typename T = TraceConfig_IncidentReportConfig> T* set_incident_report_config() {
+    return BeginNestedMessage<T>(25);
+  }
+
+
+  using FieldMetadata_StatsdLogging =
+    ::protozero::proto_utils::FieldMetadata<
+      31,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::TraceConfig_StatsdLogging,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StatsdLogging kStatsdLogging() { return {}; }
+  void set_statsd_logging(::perfetto::protos::pbzero::TraceConfig_StatsdLogging value) {
+    static constexpr uint32_t field_id = FieldMetadata_StatsdLogging::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TraceUuidMsb =
+    ::protozero::proto_utils::FieldMetadata<
+      27,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TraceUuidMsb kTraceUuidMsb() { return {}; }
+  void set_trace_uuid_msb(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TraceUuidMsb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TraceUuidLsb =
+    ::protozero::proto_utils::FieldMetadata<
+      28,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TraceUuidLsb kTraceUuidLsb() { return {}; }
+  void set_trace_uuid_lsb(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TraceUuidLsb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TraceFilter =
+    ::protozero::proto_utils::FieldMetadata<
+      32,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceConfig_TraceFilter,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TraceFilter kTraceFilter() { return {}; }
+  template <typename T = TraceConfig_TraceFilter> T* set_trace_filter() {
+    return BeginNestedMessage<T>(32);
+  }
+
+};
+
+class TraceConfig_TraceFilter_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TraceConfig_TraceFilter_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceConfig_TraceFilter_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceConfig_TraceFilter_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_bytecode() const { return at<1>().valid(); }
+  ::protozero::ConstBytes bytecode() const { return at<1>().as_bytes(); }
+};
+
+class TraceConfig_TraceFilter : public ::protozero::Message {
+ public:
+  using Decoder = TraceConfig_TraceFilter_Decoder;
+  enum : int32_t {
+    kBytecodeFieldNumber = 1,
+  };
+
+  using FieldMetadata_Bytecode =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBytes,
+      std::string,
+      TraceConfig_TraceFilter>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Bytecode kBytecode() { return {}; }
+  void set_bytecode(const uint8_t* data, size_t size) {
+    AppendBytes(FieldMetadata_Bytecode::kFieldId, data, size);
+  }
+  void set_bytecode(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Bytecode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBytes>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TraceConfig_IncidentReportConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TraceConfig_IncidentReportConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceConfig_IncidentReportConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceConfig_IncidentReportConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_destination_package() const { return at<1>().valid(); }
+  ::protozero::ConstChars destination_package() const { return at<1>().as_string(); }
+  bool has_destination_class() const { return at<2>().valid(); }
+  ::protozero::ConstChars destination_class() const { return at<2>().as_string(); }
+  bool has_privacy_level() const { return at<3>().valid(); }
+  int32_t privacy_level() const { return at<3>().as_int32(); }
+  bool has_skip_incidentd() const { return at<5>().valid(); }
+  bool skip_incidentd() const { return at<5>().as_bool(); }
+  bool has_skip_dropbox() const { return at<4>().valid(); }
+  bool skip_dropbox() const { return at<4>().as_bool(); }
+};
+
+class TraceConfig_IncidentReportConfig : public ::protozero::Message {
+ public:
+  using Decoder = TraceConfig_IncidentReportConfig_Decoder;
+  enum : int32_t {
+    kDestinationPackageFieldNumber = 1,
+    kDestinationClassFieldNumber = 2,
+    kPrivacyLevelFieldNumber = 3,
+    kSkipIncidentdFieldNumber = 5,
+    kSkipDropboxFieldNumber = 4,
+  };
+
+  using FieldMetadata_DestinationPackage =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TraceConfig_IncidentReportConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DestinationPackage kDestinationPackage() { return {}; }
+  void set_destination_package(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_DestinationPackage::kFieldId, data, size);
+  }
+  void set_destination_package(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_DestinationPackage::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DestinationClass =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TraceConfig_IncidentReportConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DestinationClass kDestinationClass() { return {}; }
+  void set_destination_class(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_DestinationClass::kFieldId, data, size);
+  }
+  void set_destination_class(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_DestinationClass::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PrivacyLevel =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      TraceConfig_IncidentReportConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PrivacyLevel kPrivacyLevel() { return {}; }
+  void set_privacy_level(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PrivacyLevel::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SkipIncidentd =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TraceConfig_IncidentReportConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SkipIncidentd kSkipIncidentd() { return {}; }
+  void set_skip_incidentd(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_SkipIncidentd::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SkipDropbox =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TraceConfig_IncidentReportConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SkipDropbox kSkipDropbox() { return {}; }
+  void set_skip_dropbox(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_SkipDropbox::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TraceConfig_IncrementalStateConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TraceConfig_IncrementalStateConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceConfig_IncrementalStateConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceConfig_IncrementalStateConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_clear_period_ms() const { return at<1>().valid(); }
+  uint32_t clear_period_ms() const { return at<1>().as_uint32(); }
+};
+
+class TraceConfig_IncrementalStateConfig : public ::protozero::Message {
+ public:
+  using Decoder = TraceConfig_IncrementalStateConfig_Decoder;
+  enum : int32_t {
+    kClearPeriodMsFieldNumber = 1,
+  };
+
+  using FieldMetadata_ClearPeriodMs =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceConfig_IncrementalStateConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ClearPeriodMs kClearPeriodMs() { return {}; }
+  void set_clear_period_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ClearPeriodMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TraceConfig_TriggerConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  TraceConfig_TriggerConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceConfig_TriggerConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceConfig_TriggerConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_trigger_mode() const { return at<1>().valid(); }
+  int32_t trigger_mode() const { return at<1>().as_int32(); }
+  bool has_triggers() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> triggers() const { return GetRepeated<::protozero::ConstBytes>(2); }
+  bool has_trigger_timeout_ms() const { return at<3>().valid(); }
+  uint32_t trigger_timeout_ms() const { return at<3>().as_uint32(); }
+};
+
+class TraceConfig_TriggerConfig : public ::protozero::Message {
+ public:
+  using Decoder = TraceConfig_TriggerConfig_Decoder;
+  enum : int32_t {
+    kTriggerModeFieldNumber = 1,
+    kTriggersFieldNumber = 2,
+    kTriggerTimeoutMsFieldNumber = 3,
+  };
+  using Trigger = ::perfetto::protos::pbzero::TraceConfig_TriggerConfig_Trigger;
+  using TriggerMode = ::perfetto::protos::pbzero::TraceConfig_TriggerConfig_TriggerMode;
+  static const TriggerMode UNSPECIFIED = TraceConfig_TriggerConfig_TriggerMode_UNSPECIFIED;
+  static const TriggerMode START_TRACING = TraceConfig_TriggerConfig_TriggerMode_START_TRACING;
+  static const TriggerMode STOP_TRACING = TraceConfig_TriggerConfig_TriggerMode_STOP_TRACING;
+
+  using FieldMetadata_TriggerMode =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::TraceConfig_TriggerConfig_TriggerMode,
+      TraceConfig_TriggerConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TriggerMode kTriggerMode() { return {}; }
+  void set_trigger_mode(::perfetto::protos::pbzero::TraceConfig_TriggerConfig_TriggerMode value) {
+    static constexpr uint32_t field_id = FieldMetadata_TriggerMode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Triggers =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceConfig_TriggerConfig_Trigger,
+      TraceConfig_TriggerConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Triggers kTriggers() { return {}; }
+  template <typename T = TraceConfig_TriggerConfig_Trigger> T* add_triggers() {
+    return BeginNestedMessage<T>(2);
+  }
+
+
+  using FieldMetadata_TriggerTimeoutMs =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceConfig_TriggerConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TriggerTimeoutMs kTriggerTimeoutMs() { return {}; }
+  void set_trigger_timeout_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TriggerTimeoutMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TraceConfig_TriggerConfig_Trigger_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TraceConfig_TriggerConfig_Trigger_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceConfig_TriggerConfig_Trigger_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceConfig_TriggerConfig_Trigger_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_producer_name_regex() const { return at<2>().valid(); }
+  ::protozero::ConstChars producer_name_regex() const { return at<2>().as_string(); }
+  bool has_stop_delay_ms() const { return at<3>().valid(); }
+  uint32_t stop_delay_ms() const { return at<3>().as_uint32(); }
+  bool has_max_per_24_h() const { return at<4>().valid(); }
+  uint32_t max_per_24_h() const { return at<4>().as_uint32(); }
+  bool has_skip_probability() const { return at<5>().valid(); }
+  double skip_probability() const { return at<5>().as_double(); }
+};
+
+class TraceConfig_TriggerConfig_Trigger : public ::protozero::Message {
+ public:
+  using Decoder = TraceConfig_TriggerConfig_Trigger_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kProducerNameRegexFieldNumber = 2,
+    kStopDelayMsFieldNumber = 3,
+    kMaxPer24HFieldNumber = 4,
+    kSkipProbabilityFieldNumber = 5,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TraceConfig_TriggerConfig_Trigger>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ProducerNameRegex =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TraceConfig_TriggerConfig_Trigger>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProducerNameRegex kProducerNameRegex() { return {}; }
+  void set_producer_name_regex(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ProducerNameRegex::kFieldId, data, size);
+  }
+  void set_producer_name_regex(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProducerNameRegex::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_StopDelayMs =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceConfig_TriggerConfig_Trigger>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StopDelayMs kStopDelayMs() { return {}; }
+  void set_stop_delay_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_StopDelayMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MaxPer24H =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceConfig_TriggerConfig_Trigger>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MaxPer24H kMaxPer24H() { return {}; }
+  void set_max_per_24_h(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MaxPer24H::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SkipProbability =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kDouble,
+      double,
+      TraceConfig_TriggerConfig_Trigger>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SkipProbability kSkipProbability() { return {}; }
+  void set_skip_probability(double value) {
+    static constexpr uint32_t field_id = FieldMetadata_SkipProbability::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kDouble>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TraceConfig_GuardrailOverrides_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TraceConfig_GuardrailOverrides_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceConfig_GuardrailOverrides_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceConfig_GuardrailOverrides_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_max_upload_per_day_bytes() const { return at<1>().valid(); }
+  uint64_t max_upload_per_day_bytes() const { return at<1>().as_uint64(); }
+};
+
+class TraceConfig_GuardrailOverrides : public ::protozero::Message {
+ public:
+  using Decoder = TraceConfig_GuardrailOverrides_Decoder;
+  enum : int32_t {
+    kMaxUploadPerDayBytesFieldNumber = 1,
+  };
+
+  using FieldMetadata_MaxUploadPerDayBytes =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceConfig_GuardrailOverrides>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MaxUploadPerDayBytes kMaxUploadPerDayBytes() { return {}; }
+  void set_max_upload_per_day_bytes(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MaxUploadPerDayBytes::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TraceConfig_StatsdMetadata_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TraceConfig_StatsdMetadata_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceConfig_StatsdMetadata_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceConfig_StatsdMetadata_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_triggering_alert_id() const { return at<1>().valid(); }
+  int64_t triggering_alert_id() const { return at<1>().as_int64(); }
+  bool has_triggering_config_uid() const { return at<2>().valid(); }
+  int32_t triggering_config_uid() const { return at<2>().as_int32(); }
+  bool has_triggering_config_id() const { return at<3>().valid(); }
+  int64_t triggering_config_id() const { return at<3>().as_int64(); }
+  bool has_triggering_subscription_id() const { return at<4>().valid(); }
+  int64_t triggering_subscription_id() const { return at<4>().as_int64(); }
+};
+
+class TraceConfig_StatsdMetadata : public ::protozero::Message {
+ public:
+  using Decoder = TraceConfig_StatsdMetadata_Decoder;
+  enum : int32_t {
+    kTriggeringAlertIdFieldNumber = 1,
+    kTriggeringConfigUidFieldNumber = 2,
+    kTriggeringConfigIdFieldNumber = 3,
+    kTriggeringSubscriptionIdFieldNumber = 4,
+  };
+
+  using FieldMetadata_TriggeringAlertId =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TraceConfig_StatsdMetadata>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TriggeringAlertId kTriggeringAlertId() { return {}; }
+  void set_triggering_alert_id(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TriggeringAlertId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TriggeringConfigUid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      TraceConfig_StatsdMetadata>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TriggeringConfigUid kTriggeringConfigUid() { return {}; }
+  void set_triggering_config_uid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TriggeringConfigUid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TriggeringConfigId =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TraceConfig_StatsdMetadata>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TriggeringConfigId kTriggeringConfigId() { return {}; }
+  void set_triggering_config_id(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TriggeringConfigId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TriggeringSubscriptionId =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TraceConfig_StatsdMetadata>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TriggeringSubscriptionId kTriggeringSubscriptionId() { return {}; }
+  void set_triggering_subscription_id(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TriggeringSubscriptionId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TraceConfig_ProducerConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TraceConfig_ProducerConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceConfig_ProducerConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceConfig_ProducerConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_producer_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars producer_name() const { return at<1>().as_string(); }
+  bool has_shm_size_kb() const { return at<2>().valid(); }
+  uint32_t shm_size_kb() const { return at<2>().as_uint32(); }
+  bool has_page_size_kb() const { return at<3>().valid(); }
+  uint32_t page_size_kb() const { return at<3>().as_uint32(); }
+};
+
+class TraceConfig_ProducerConfig : public ::protozero::Message {
+ public:
+  using Decoder = TraceConfig_ProducerConfig_Decoder;
+  enum : int32_t {
+    kProducerNameFieldNumber = 1,
+    kShmSizeKbFieldNumber = 2,
+    kPageSizeKbFieldNumber = 3,
+  };
+
+  using FieldMetadata_ProducerName =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TraceConfig_ProducerConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProducerName kProducerName() { return {}; }
+  void set_producer_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ProducerName::kFieldId, data, size);
+  }
+  void set_producer_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProducerName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ShmSizeKb =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceConfig_ProducerConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ShmSizeKb kShmSizeKb() { return {}; }
+  void set_shm_size_kb(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ShmSizeKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PageSizeKb =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceConfig_ProducerConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PageSizeKb kPageSizeKb() { return {}; }
+  void set_page_size_kb(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PageSizeKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TraceConfig_BuiltinDataSource_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TraceConfig_BuiltinDataSource_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceConfig_BuiltinDataSource_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceConfig_BuiltinDataSource_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_disable_clock_snapshotting() const { return at<1>().valid(); }
+  bool disable_clock_snapshotting() const { return at<1>().as_bool(); }
+  bool has_disable_trace_config() const { return at<2>().valid(); }
+  bool disable_trace_config() const { return at<2>().as_bool(); }
+  bool has_disable_system_info() const { return at<3>().valid(); }
+  bool disable_system_info() const { return at<3>().as_bool(); }
+  bool has_disable_service_events() const { return at<4>().valid(); }
+  bool disable_service_events() const { return at<4>().as_bool(); }
+  bool has_primary_trace_clock() const { return at<5>().valid(); }
+  int32_t primary_trace_clock() const { return at<5>().as_int32(); }
+  bool has_snapshot_interval_ms() const { return at<6>().valid(); }
+  uint32_t snapshot_interval_ms() const { return at<6>().as_uint32(); }
+  bool has_prefer_suspend_clock_for_snapshot() const { return at<7>().valid(); }
+  bool prefer_suspend_clock_for_snapshot() const { return at<7>().as_bool(); }
+};
+
+class TraceConfig_BuiltinDataSource : public ::protozero::Message {
+ public:
+  using Decoder = TraceConfig_BuiltinDataSource_Decoder;
+  enum : int32_t {
+    kDisableClockSnapshottingFieldNumber = 1,
+    kDisableTraceConfigFieldNumber = 2,
+    kDisableSystemInfoFieldNumber = 3,
+    kDisableServiceEventsFieldNumber = 4,
+    kPrimaryTraceClockFieldNumber = 5,
+    kSnapshotIntervalMsFieldNumber = 6,
+    kPreferSuspendClockForSnapshotFieldNumber = 7,
+  };
+
+  using FieldMetadata_DisableClockSnapshotting =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TraceConfig_BuiltinDataSource>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DisableClockSnapshotting kDisableClockSnapshotting() { return {}; }
+  void set_disable_clock_snapshotting(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_DisableClockSnapshotting::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DisableTraceConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TraceConfig_BuiltinDataSource>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DisableTraceConfig kDisableTraceConfig() { return {}; }
+  void set_disable_trace_config(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_DisableTraceConfig::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DisableSystemInfo =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TraceConfig_BuiltinDataSource>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DisableSystemInfo kDisableSystemInfo() { return {}; }
+  void set_disable_system_info(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_DisableSystemInfo::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DisableServiceEvents =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TraceConfig_BuiltinDataSource>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DisableServiceEvents kDisableServiceEvents() { return {}; }
+  void set_disable_service_events(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_DisableServiceEvents::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PrimaryTraceClock =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::BuiltinClock,
+      TraceConfig_BuiltinDataSource>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PrimaryTraceClock kPrimaryTraceClock() { return {}; }
+  void set_primary_trace_clock(::perfetto::protos::pbzero::BuiltinClock value) {
+    static constexpr uint32_t field_id = FieldMetadata_PrimaryTraceClock::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SnapshotIntervalMs =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceConfig_BuiltinDataSource>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SnapshotIntervalMs kSnapshotIntervalMs() { return {}; }
+  void set_snapshot_interval_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SnapshotIntervalMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PreferSuspendClockForSnapshot =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TraceConfig_BuiltinDataSource>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PreferSuspendClockForSnapshot kPreferSuspendClockForSnapshot() { return {}; }
+  void set_prefer_suspend_clock_for_snapshot(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_PreferSuspendClockForSnapshot::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TraceConfig_DataSource_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  TraceConfig_DataSource_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceConfig_DataSource_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceConfig_DataSource_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_config() const { return at<1>().valid(); }
+  ::protozero::ConstBytes config() const { return at<1>().as_bytes(); }
+  bool has_producer_name_filter() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> producer_name_filter() const { return GetRepeated<::protozero::ConstChars>(2); }
+  bool has_producer_name_regex_filter() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> producer_name_regex_filter() const { return GetRepeated<::protozero::ConstChars>(3); }
+};
+
+class TraceConfig_DataSource : public ::protozero::Message {
+ public:
+  using Decoder = TraceConfig_DataSource_Decoder;
+  enum : int32_t {
+    kConfigFieldNumber = 1,
+    kProducerNameFilterFieldNumber = 2,
+    kProducerNameRegexFilterFieldNumber = 3,
+  };
+
+  using FieldMetadata_Config =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      DataSourceConfig,
+      TraceConfig_DataSource>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Config kConfig() { return {}; }
+  template <typename T = DataSourceConfig> T* set_config() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_ProducerNameFilter =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TraceConfig_DataSource>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProducerNameFilter kProducerNameFilter() { return {}; }
+  void add_producer_name_filter(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ProducerNameFilter::kFieldId, data, size);
+  }
+  void add_producer_name_filter(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProducerNameFilter::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ProducerNameRegexFilter =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TraceConfig_DataSource>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProducerNameRegexFilter kProducerNameRegexFilter() { return {}; }
+  void add_producer_name_regex_filter(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ProducerNameRegexFilter::kFieldId, data, size);
+  }
+  void add_producer_name_regex_filter(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProducerNameRegexFilter::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TraceConfig_BufferConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TraceConfig_BufferConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceConfig_BufferConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceConfig_BufferConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_size_kb() const { return at<1>().valid(); }
+  uint32_t size_kb() const { return at<1>().as_uint32(); }
+  bool has_fill_policy() const { return at<4>().valid(); }
+  int32_t fill_policy() const { return at<4>().as_int32(); }
+};
+
+class TraceConfig_BufferConfig : public ::protozero::Message {
+ public:
+  using Decoder = TraceConfig_BufferConfig_Decoder;
+  enum : int32_t {
+    kSizeKbFieldNumber = 1,
+    kFillPolicyFieldNumber = 4,
+  };
+  using FillPolicy = ::perfetto::protos::pbzero::TraceConfig_BufferConfig_FillPolicy;
+  static const FillPolicy UNSPECIFIED = TraceConfig_BufferConfig_FillPolicy_UNSPECIFIED;
+  static const FillPolicy RING_BUFFER = TraceConfig_BufferConfig_FillPolicy_RING_BUFFER;
+  static const FillPolicy DISCARD = TraceConfig_BufferConfig_FillPolicy_DISCARD;
+
+  using FieldMetadata_SizeKb =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceConfig_BufferConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SizeKb kSizeKb() { return {}; }
+  void set_size_kb(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SizeKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FillPolicy =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::TraceConfig_BufferConfig_FillPolicy,
+      TraceConfig_BufferConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FillPolicy kFillPolicy() { return {}; }
+  void set_fill_policy(::perfetto::protos::pbzero::TraceConfig_BufferConfig_FillPolicy value) {
+    static constexpr uint32_t field_id = FieldMetadata_FillPolicy::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/clock_snapshot.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_CLOCK_SNAPSHOT_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_CLOCK_SNAPSHOT_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class ClockSnapshot_Clock;
+enum BuiltinClock : int32_t;
+
+enum ClockSnapshot_Clock_BuiltinClocks : int32_t {
+  ClockSnapshot_Clock_BuiltinClocks_UNKNOWN = 0,
+  ClockSnapshot_Clock_BuiltinClocks_REALTIME = 1,
+  ClockSnapshot_Clock_BuiltinClocks_REALTIME_COARSE = 2,
+  ClockSnapshot_Clock_BuiltinClocks_MONOTONIC = 3,
+  ClockSnapshot_Clock_BuiltinClocks_MONOTONIC_COARSE = 4,
+  ClockSnapshot_Clock_BuiltinClocks_MONOTONIC_RAW = 5,
+  ClockSnapshot_Clock_BuiltinClocks_BOOTTIME = 6,
+  ClockSnapshot_Clock_BuiltinClocks_BUILTIN_CLOCK_MAX_ID = 63,
+};
+
+const ClockSnapshot_Clock_BuiltinClocks ClockSnapshot_Clock_BuiltinClocks_MIN = ClockSnapshot_Clock_BuiltinClocks_UNKNOWN;
+const ClockSnapshot_Clock_BuiltinClocks ClockSnapshot_Clock_BuiltinClocks_MAX = ClockSnapshot_Clock_BuiltinClocks_BUILTIN_CLOCK_MAX_ID;
+
+class ClockSnapshot_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  ClockSnapshot_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ClockSnapshot_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ClockSnapshot_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_clocks() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> clocks() const { return GetRepeated<::protozero::ConstBytes>(1); }
+  bool has_primary_trace_clock() const { return at<2>().valid(); }
+  int32_t primary_trace_clock() const { return at<2>().as_int32(); }
+};
+
+class ClockSnapshot : public ::protozero::Message {
+ public:
+  using Decoder = ClockSnapshot_Decoder;
+  enum : int32_t {
+    kClocksFieldNumber = 1,
+    kPrimaryTraceClockFieldNumber = 2,
+  };
+  using Clock = ::perfetto::protos::pbzero::ClockSnapshot_Clock;
+
+  using FieldMetadata_Clocks =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ClockSnapshot_Clock,
+      ClockSnapshot>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Clocks kClocks() { return {}; }
+  template <typename T = ClockSnapshot_Clock> T* add_clocks() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_PrimaryTraceClock =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::BuiltinClock,
+      ClockSnapshot>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PrimaryTraceClock kPrimaryTraceClock() { return {}; }
+  void set_primary_trace_clock(::perfetto::protos::pbzero::BuiltinClock value) {
+    static constexpr uint32_t field_id = FieldMetadata_PrimaryTraceClock::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class ClockSnapshot_Clock_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ClockSnapshot_Clock_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ClockSnapshot_Clock_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ClockSnapshot_Clock_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_clock_id() const { return at<1>().valid(); }
+  uint32_t clock_id() const { return at<1>().as_uint32(); }
+  bool has_timestamp() const { return at<2>().valid(); }
+  uint64_t timestamp() const { return at<2>().as_uint64(); }
+  bool has_is_incremental() const { return at<3>().valid(); }
+  bool is_incremental() const { return at<3>().as_bool(); }
+  bool has_unit_multiplier_ns() const { return at<4>().valid(); }
+  uint64_t unit_multiplier_ns() const { return at<4>().as_uint64(); }
+};
+
+class ClockSnapshot_Clock : public ::protozero::Message {
+ public:
+  using Decoder = ClockSnapshot_Clock_Decoder;
+  enum : int32_t {
+    kClockIdFieldNumber = 1,
+    kTimestampFieldNumber = 2,
+    kIsIncrementalFieldNumber = 3,
+    kUnitMultiplierNsFieldNumber = 4,
+  };
+  using BuiltinClocks = ::perfetto::protos::pbzero::ClockSnapshot_Clock_BuiltinClocks;
+  static const BuiltinClocks UNKNOWN = ClockSnapshot_Clock_BuiltinClocks_UNKNOWN;
+  static const BuiltinClocks REALTIME = ClockSnapshot_Clock_BuiltinClocks_REALTIME;
+  static const BuiltinClocks REALTIME_COARSE = ClockSnapshot_Clock_BuiltinClocks_REALTIME_COARSE;
+  static const BuiltinClocks MONOTONIC = ClockSnapshot_Clock_BuiltinClocks_MONOTONIC;
+  static const BuiltinClocks MONOTONIC_COARSE = ClockSnapshot_Clock_BuiltinClocks_MONOTONIC_COARSE;
+  static const BuiltinClocks MONOTONIC_RAW = ClockSnapshot_Clock_BuiltinClocks_MONOTONIC_RAW;
+  static const BuiltinClocks BOOTTIME = ClockSnapshot_Clock_BuiltinClocks_BOOTTIME;
+  static const BuiltinClocks BUILTIN_CLOCK_MAX_ID = ClockSnapshot_Clock_BuiltinClocks_BUILTIN_CLOCK_MAX_ID;
+
+  using FieldMetadata_ClockId =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      ClockSnapshot_Clock>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ClockId kClockId() { return {}; }
+  void set_clock_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ClockId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Timestamp =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ClockSnapshot_Clock>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Timestamp kTimestamp() { return {}; }
+  void set_timestamp(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Timestamp::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IsIncremental =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ClockSnapshot_Clock>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IsIncremental kIsIncremental() { return {}; }
+  void set_is_incremental(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_IsIncremental::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_UnitMultiplierNs =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ClockSnapshot_Clock>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UnitMultiplierNs kUnitMultiplierNs() { return {}; }
+  void set_unit_multiplier_ns(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_UnitMultiplierNs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/perfetto/tracing_service_event.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PERFETTO_TRACING_SERVICE_EVENT_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PERFETTO_TRACING_SERVICE_EVENT_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class TracingServiceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TracingServiceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TracingServiceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TracingServiceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_tracing_started() const { return at<2>().valid(); }
+  bool tracing_started() const { return at<2>().as_bool(); }
+  bool has_all_data_sources_started() const { return at<1>().valid(); }
+  bool all_data_sources_started() const { return at<1>().as_bool(); }
+  bool has_all_data_sources_flushed() const { return at<3>().valid(); }
+  bool all_data_sources_flushed() const { return at<3>().as_bool(); }
+  bool has_read_tracing_buffers_completed() const { return at<4>().valid(); }
+  bool read_tracing_buffers_completed() const { return at<4>().as_bool(); }
+  bool has_tracing_disabled() const { return at<5>().valid(); }
+  bool tracing_disabled() const { return at<5>().as_bool(); }
+  bool has_seized_for_bugreport() const { return at<6>().valid(); }
+  bool seized_for_bugreport() const { return at<6>().as_bool(); }
+};
+
+class TracingServiceEvent : public ::protozero::Message {
+ public:
+  using Decoder = TracingServiceEvent_Decoder;
+  enum : int32_t {
+    kTracingStartedFieldNumber = 2,
+    kAllDataSourcesStartedFieldNumber = 1,
+    kAllDataSourcesFlushedFieldNumber = 3,
+    kReadTracingBuffersCompletedFieldNumber = 4,
+    kTracingDisabledFieldNumber = 5,
+    kSeizedForBugreportFieldNumber = 6,
+  };
+
+  using FieldMetadata_TracingStarted =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TracingServiceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TracingStarted kTracingStarted() { return {}; }
+  void set_tracing_started(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_TracingStarted::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_AllDataSourcesStarted =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TracingServiceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AllDataSourcesStarted kAllDataSourcesStarted() { return {}; }
+  void set_all_data_sources_started(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_AllDataSourcesStarted::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_AllDataSourcesFlushed =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TracingServiceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AllDataSourcesFlushed kAllDataSourcesFlushed() { return {}; }
+  void set_all_data_sources_flushed(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_AllDataSourcesFlushed::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ReadTracingBuffersCompleted =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TracingServiceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ReadTracingBuffersCompleted kReadTracingBuffersCompleted() { return {}; }
+  void set_read_tracing_buffers_completed(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_ReadTracingBuffersCompleted::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TracingDisabled =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TracingServiceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TracingDisabled kTracingDisabled() { return {}; }
+  void set_tracing_disabled(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_TracingDisabled::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SeizedForBugreport =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TracingServiceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SeizedForBugreport kSeizedForBugreport() { return {}; }
+  void set_seized_for_bugreport(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_SeizedForBugreport::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/system_info.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_SYSTEM_INFO_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_SYSTEM_INFO_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class Utsname;
+
+class SystemInfo_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SystemInfo_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SystemInfo_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SystemInfo_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_utsname() const { return at<1>().valid(); }
+  ::protozero::ConstBytes utsname() const { return at<1>().as_bytes(); }
+  bool has_android_build_fingerprint() const { return at<2>().valid(); }
+  ::protozero::ConstChars android_build_fingerprint() const { return at<2>().as_string(); }
+  bool has_hz() const { return at<3>().valid(); }
+  int64_t hz() const { return at<3>().as_int64(); }
+  bool has_tracing_service_version() const { return at<4>().valid(); }
+  ::protozero::ConstChars tracing_service_version() const { return at<4>().as_string(); }
+};
+
+class SystemInfo : public ::protozero::Message {
+ public:
+  using Decoder = SystemInfo_Decoder;
+  enum : int32_t {
+    kUtsnameFieldNumber = 1,
+    kAndroidBuildFingerprintFieldNumber = 2,
+    kHzFieldNumber = 3,
+    kTracingServiceVersionFieldNumber = 4,
+  };
+
+  using FieldMetadata_Utsname =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Utsname,
+      SystemInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Utsname kUtsname() { return {}; }
+  template <typename T = Utsname> T* set_utsname() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_AndroidBuildFingerprint =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SystemInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AndroidBuildFingerprint kAndroidBuildFingerprint() { return {}; }
+  void set_android_build_fingerprint(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_AndroidBuildFingerprint::kFieldId, data, size);
+  }
+  void set_android_build_fingerprint(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_AndroidBuildFingerprint::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Hz =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      SystemInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Hz kHz() { return {}; }
+  void set_hz(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Hz::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TracingServiceVersion =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SystemInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TracingServiceVersion kTracingServiceVersion() { return {}; }
+  void set_tracing_service_version(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_TracingServiceVersion::kFieldId, data, size);
+  }
+  void set_tracing_service_version(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_TracingServiceVersion::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Utsname_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Utsname_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Utsname_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Utsname_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_sysname() const { return at<1>().valid(); }
+  ::protozero::ConstChars sysname() const { return at<1>().as_string(); }
+  bool has_version() const { return at<2>().valid(); }
+  ::protozero::ConstChars version() const { return at<2>().as_string(); }
+  bool has_release() const { return at<3>().valid(); }
+  ::protozero::ConstChars release() const { return at<3>().as_string(); }
+  bool has_machine() const { return at<4>().valid(); }
+  ::protozero::ConstChars machine() const { return at<4>().as_string(); }
+};
+
+class Utsname : public ::protozero::Message {
+ public:
+  using Decoder = Utsname_Decoder;
+  enum : int32_t {
+    kSysnameFieldNumber = 1,
+    kVersionFieldNumber = 2,
+    kReleaseFieldNumber = 3,
+    kMachineFieldNumber = 4,
+  };
+
+  using FieldMetadata_Sysname =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      Utsname>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Sysname kSysname() { return {}; }
+  void set_sysname(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Sysname::kFieldId, data, size);
+  }
+  void set_sysname(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Sysname::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Version =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      Utsname>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Version kVersion() { return {}; }
+  void set_version(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Version::kFieldId, data, size);
+  }
+  void set_version(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Version::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Release =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      Utsname>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Release kRelease() { return {}; }
+  void set_release(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Release::kFieldId, data, size);
+  }
+  void set_release(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Release::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Machine =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      Utsname>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Machine kMachine() { return {}; }
+  void set_machine(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Machine::kFieldId, data, size);
+  }
+  void set_machine(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Machine::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/trigger.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRIGGER_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRIGGER_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class Trigger_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Trigger_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Trigger_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Trigger_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_trigger_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars trigger_name() const { return at<1>().as_string(); }
+  bool has_producer_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars producer_name() const { return at<2>().as_string(); }
+  bool has_trusted_producer_uid() const { return at<3>().valid(); }
+  int32_t trusted_producer_uid() const { return at<3>().as_int32(); }
+};
+
+class Trigger : public ::protozero::Message {
+ public:
+  using Decoder = Trigger_Decoder;
+  enum : int32_t {
+    kTriggerNameFieldNumber = 1,
+    kProducerNameFieldNumber = 2,
+    kTrustedProducerUidFieldNumber = 3,
+  };
+
+  using FieldMetadata_TriggerName =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      Trigger>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TriggerName kTriggerName() { return {}; }
+  void set_trigger_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_TriggerName::kFieldId, data, size);
+  }
+  void set_trigger_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_TriggerName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ProducerName =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      Trigger>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProducerName kProducerName() { return {}; }
+  void set_producer_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ProducerName::kFieldId, data, size);
+  }
+  void set_producer_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProducerName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TrustedProducerUid =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Trigger>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TrustedProducerUid kTrustedProducerUid() { return {}; }
+  void set_trusted_producer_uid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TrustedProducerUid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "src/tracing/core/tracing_service_impl.h"
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/forward_decls.h"
+
+#include <errno.h>
+#include <inttypes.h>
+#include <limits.h>
+#include <string.h>
+#include <regex>
+#include <unordered_set>
+
+#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) && \
+    !PERFETTO_BUILDFLAG(PERFETTO_OS_NACL)
+#include <sys/uio.h>
+#include <sys/utsname.h>
+#include <unistd.h>
+#endif
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+#include <sys/system_properties.h>
+#if PERFETTO_BUILDFLAG(PERFETTO_ANDROID_BUILD)
+// gen_amalgamated expanded: #include "src/android_internal/lazy_library_loader.h"    // nogncheck
+// gen_amalgamated expanded: #include "src/android_internal/tracing_service_proxy.h"  // nogncheck
+#endif  // PERFETTO_ANDROID_BUILD
+#endif  // PERFETTO_OS_ANDROID
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) ||   \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+#define PERFETTO_HAS_CHMOD
+#include <sys/stat.h>
+#endif
+
+#include <algorithm>
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+// gen_amalgamated expanded: #include "perfetto/base/status.h"
+// gen_amalgamated expanded: #include "perfetto/base/task_runner.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/file_utils.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/metatrace.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/string_utils.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/temp_file.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/version.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/watchdog.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/basic_types.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/consumer.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/observable_events.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/producer.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/shared_memory.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/shared_memory_abi.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/trace_packet.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/trace_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/static_buffer.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/data_source_descriptor.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/tracing_service_capabilities.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/tracing_service_state.h"
+// gen_amalgamated expanded: #include "src/android_stats/statsd_logging_helper.h"
+// gen_amalgamated expanded: #include "src/protozero/filtering/message_filter.h"
+// gen_amalgamated expanded: #include "src/tracing/core/packet_stream_validator.h"
+// gen_amalgamated expanded: #include "src/tracing/core/shared_memory_arbiter_impl.h"
+// gen_amalgamated expanded: #include "src/tracing/core/trace_buffer.h"
+
+// gen_amalgamated expanded: #include "protos/perfetto/common/builtin_clock.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/builtin_clock.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/trace_stats.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/trace_config.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/clock_snapshot.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/perfetto/tracing_service_event.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/system_info.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/trace_packet.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/trigger.pbzero.h"
+
+// General note: this class must assume that Producers are malicious and will
+// try to crash / exploit this class. We can trust pointers because they come
+// from the IPC layer, but we should never assume that that the producer calls
+// come in the right order or their arguments are sane / within bounds.
+
+// This is a macro because we want the call-site line number for the ELOG.
+#define PERFETTO_SVC_ERR(...) \
+  (PERFETTO_ELOG(__VA_ARGS__), ::perfetto::base::ErrStatus(__VA_ARGS__))
+
+namespace perfetto {
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) && \
+    PERFETTO_BUILDFLAG(PERFETTO_ANDROID_BUILD)
+// These are the only SELinux approved dir for trace files that are created
+// directly by traced.
+const char* kTraceDirBasePath = "/data/misc/perfetto-traces/";
+const char* kAndroidProductionBugreportTracePath =
+    "/data/misc/perfetto-traces/bugreport/systrace.pftrace";
+#endif
+
+namespace {
+constexpr int kMaxBuffersPerConsumer = 128;
+constexpr uint32_t kDefaultSnapshotsIntervalMs = 10 * 1000;
+constexpr int kDefaultWriteIntoFilePeriodMs = 5000;
+constexpr int kMaxConcurrentTracingSessions = 15;
+constexpr int kMaxConcurrentTracingSessionsPerUid = 5;
+constexpr int kMaxConcurrentTracingSessionsForStatsdUid = 10;
+constexpr int64_t kMinSecondsBetweenTracesGuardrail = 5 * 60;
+
+constexpr uint32_t kMillisPerHour = 3600000;
+constexpr uint32_t kMillisPerDay = kMillisPerHour * 24;
+constexpr uint32_t kMaxTracingDurationMillis = 7 * 24 * kMillisPerHour;
+
+// These apply only if enable_extra_guardrails is true.
+constexpr uint32_t kGuardrailsMaxTracingBufferSizeKb = 128 * 1024;
+constexpr uint32_t kGuardrailsMaxTracingDurationMillis = 24 * kMillisPerHour;
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) || PERFETTO_BUILDFLAG(PERFETTO_OS_NACL)
+struct iovec {
+  void* iov_base;  // Address
+  size_t iov_len;  // Block size
+};
+
+// Simple implementation of writev. Note that this does not give the atomicity
+// guarantees of a real writev, but we don't depend on these (we aren't writing
+// to the same file from another thread).
+ssize_t writev(int fd, const struct iovec* iov, int iovcnt) {
+  ssize_t total_size = 0;
+  for (int i = 0; i < iovcnt; ++i) {
+    ssize_t current_size = base::WriteAll(fd, iov[i].iov_base, iov[i].iov_len);
+    if (current_size != static_cast<ssize_t>(iov[i].iov_len))
+      return -1;
+    total_size += current_size;
+  }
+  return total_size;
+}
+
+#define IOV_MAX 1024  // Linux compatible limit.
+
+#endif  // PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) ||
+        // PERFETTO_BUILDFLAG(PERFETTO_OS_NACL)
+
+// Partially encodes a CommitDataRequest in an int32 for the purposes of
+// metatracing. Note that it encodes only the bottom 10 bits of the producer id
+// (which is technically 16 bits wide).
+//
+// Format (by bit range):
+// [   31 ][         30 ][             29:20 ][            19:10 ][        9:0]
+// [unused][has flush id][num chunks to patch][num chunks to move][producer id]
+static int32_t EncodeCommitDataRequest(ProducerID producer_id,
+                                       const CommitDataRequest& req_untrusted) {
+  uint32_t cmov = static_cast<uint32_t>(req_untrusted.chunks_to_move_size());
+  uint32_t cpatch = static_cast<uint32_t>(req_untrusted.chunks_to_patch_size());
+  uint32_t has_flush_id = req_untrusted.flush_request_id() != 0;
+
+  uint32_t mask = (1 << 10) - 1;
+  uint32_t acc = 0;
+  acc |= has_flush_id << 30;
+  acc |= (cpatch & mask) << 20;
+  acc |= (cmov & mask) << 10;
+  acc |= (producer_id & mask);
+  return static_cast<int32_t>(acc);
+}
+
+void SerializeAndAppendPacket(std::vector<TracePacket>* packets,
+                              std::vector<uint8_t> packet) {
+  Slice slice = Slice::Allocate(packet.size());
+  memcpy(slice.own_data(), packet.data(), packet.size());
+  packets->emplace_back();
+  packets->back().AddSlice(std::move(slice));
+}
+
+std::tuple<size_t /*shm_size*/, size_t /*page_size*/> EnsureValidShmSizes(
+    size_t shm_size,
+    size_t page_size) {
+  // Theoretically the max page size supported by the ABI is 64KB.
+  // However, the current implementation of TraceBuffer (the non-shared
+  // userspace buffer where the service copies data) supports at most
+  // 32K. Setting 64K "works" from the producer<>consumer viewpoint
+  // but then causes the data to be discarded when copying it into
+  // TraceBuffer.
+  constexpr size_t kMaxPageSize = 32 * 1024;
+  static_assert(kMaxPageSize <= SharedMemoryABI::kMaxPageSize, "");
+
+  if (page_size == 0)
+    page_size = TracingServiceImpl::kDefaultShmPageSize;
+  if (shm_size == 0)
+    shm_size = TracingServiceImpl::kDefaultShmSize;
+
+  page_size = std::min<size_t>(page_size, kMaxPageSize);
+  shm_size = std::min<size_t>(shm_size, TracingServiceImpl::kMaxShmSize);
+
+  // The tracing page size has to be multiple of 4K. On some systems (e.g. Mac
+  // on Arm64) the system page size can be larger (e.g., 16K). That doesn't
+  // matter here, because the tracing page size is just a logical partitioning
+  // and does not have any dependencies on kernel mm syscalls (read: it's fine
+  // to have trace page sizes of 4K on a system where the kernel page size is
+  // 16K).
+  bool page_size_is_valid = page_size >= SharedMemoryABI::kMinPageSize;
+  page_size_is_valid &= page_size % SharedMemoryABI::kMinPageSize == 0;
+
+  // Only allow power of two numbers of pages, i.e. 1, 2, 4, 8 pages.
+  size_t num_pages = page_size / SharedMemoryABI::kMinPageSize;
+  page_size_is_valid &= (num_pages & (num_pages - 1)) == 0;
+
+  if (!page_size_is_valid || shm_size < page_size ||
+      shm_size % page_size != 0) {
+    return std::make_tuple(TracingServiceImpl::kDefaultShmSize,
+                           TracingServiceImpl::kDefaultShmPageSize);
+  }
+  return std::make_tuple(shm_size, page_size);
+}
+
+bool NameMatchesFilter(const std::string& name,
+                       const std::vector<std::string>& name_filter,
+                       const std::vector<std::string>& name_regex_filter) {
+  bool filter_is_set = !name_filter.empty() || !name_regex_filter.empty();
+  if (!filter_is_set)
+    return true;
+  bool filter_matches = std::find(name_filter.begin(), name_filter.end(),
+                                  name) != name_filter.end();
+  bool filter_regex_matches =
+      std::find_if(name_regex_filter.begin(), name_regex_filter.end(),
+                   [&](const std::string& regex) {
+                     return std::regex_match(
+                         name, std::regex(regex, std::regex::extended));
+                   }) != name_regex_filter.end();
+  return filter_matches || filter_regex_matches;
+}
+
+// Used when:
+// 1. TraceConfig.write_into_file == true and output_path is not empty.
+// 2. Calling SaveTraceForBugreport(), from perfetto --save-for-bugreport.
+base::ScopedFile CreateTraceFile(const std::string& path, bool overwrite) {
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) && \
+    PERFETTO_BUILDFLAG(PERFETTO_ANDROID_BUILD)
+  // This is NOT trying to preserve any security property, SELinux does that.
+  // It just improves the actionability of the error when people try to save the
+  // trace in a location that is not SELinux-allowed (a generic "permission
+  // denied" vs "don't put it here, put it there").
+  if (!base::StartsWith(path, kTraceDirBasePath)) {
+    PERFETTO_ELOG("Invalid output_path %s. On Android it must be within %s.",
+                  path.c_str(), kTraceDirBasePath);
+    return base::ScopedFile();
+  }
+#endif
+  // O_CREAT | O_EXCL will fail if the file exists already.
+  const int flags = O_RDWR | O_CREAT | (overwrite ? O_TRUNC : O_EXCL);
+  auto fd = base::OpenFile(path, flags, 0600);
+  if (fd) {
+#if defined(PERFETTO_HAS_CHMOD)
+    // Passing 0644 directly above won't work because of umask.
+    PERFETTO_CHECK(fchmod(*fd, 0644) == 0);
+#endif
+  } else {
+    PERFETTO_PLOG("Failed to create %s", path.c_str());
+  }
+  return fd;
+}
+
+std::string GetBugreportTmpPath() {
+  return GetBugreportPath() + ".tmp";
+}
+
+bool ShouldLogEvent(const TraceConfig& cfg) {
+  switch (cfg.statsd_logging()) {
+    case TraceConfig::STATSD_LOGGING_ENABLED:
+      return true;
+    case TraceConfig::STATSD_LOGGING_DISABLED:
+      return false;
+    case TraceConfig::STATSD_LOGGING_UNSPECIFIED:
+      // For backward compatibility with older versions of perfetto_cmd.
+      return cfg.enable_extra_guardrails();
+  }
+  PERFETTO_FATAL("For GCC");
+}
+
+}  // namespace
+
+// These constants instead are defined in the header because are used by tests.
+constexpr size_t TracingServiceImpl::kDefaultShmSize;
+constexpr size_t TracingServiceImpl::kDefaultShmPageSize;
+
+constexpr size_t TracingServiceImpl::kMaxShmSize;
+constexpr uint32_t TracingServiceImpl::kDataSourceStopTimeoutMs;
+constexpr uint8_t TracingServiceImpl::kSyncMarker[];
+
+std::string GetBugreportPath() {
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) && \
+    PERFETTO_BUILDFLAG(PERFETTO_ANDROID_BUILD)
+  return kAndroidProductionBugreportTracePath;
+#else
+  // Only for tests, SaveTraceForBugreport is not used on other OSes.
+  return base::GetSysTempDir() + "/bugreport.pftrace";
+#endif
+}
+
+// static
+std::unique_ptr<TracingService> TracingService::CreateInstance(
+    std::unique_ptr<SharedMemory::Factory> shm_factory,
+    base::TaskRunner* task_runner) {
+  return std::unique_ptr<TracingService>(
+      new TracingServiceImpl(std::move(shm_factory), task_runner));
+}
+
+TracingServiceImpl::TracingServiceImpl(
+    std::unique_ptr<SharedMemory::Factory> shm_factory,
+    base::TaskRunner* task_runner)
+    : task_runner_(task_runner),
+      shm_factory_(std::move(shm_factory)),
+      uid_(base::GetCurrentUserId()),
+      buffer_ids_(kMaxTraceBufferID),
+      trigger_probability_rand_(
+          static_cast<uint32_t>(base::GetWallTimeNs().count())),
+      weak_ptr_factory_(this) {
+  PERFETTO_DCHECK(task_runner_);
+}
+
+TracingServiceImpl::~TracingServiceImpl() {
+  // TODO(fmayer): handle teardown of all Producer.
+}
+
+std::unique_ptr<TracingService::ProducerEndpoint>
+TracingServiceImpl::ConnectProducer(Producer* producer,
+                                    uid_t uid,
+                                    const std::string& producer_name,
+                                    size_t shared_memory_size_hint_bytes,
+                                    bool in_process,
+                                    ProducerSMBScrapingMode smb_scraping_mode,
+                                    size_t shared_memory_page_size_hint_bytes,
+                                    std::unique_ptr<SharedMemory> shm,
+                                    const std::string& sdk_version) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+
+  if (lockdown_mode_ && uid != base::GetCurrentUserId()) {
+    PERFETTO_DLOG("Lockdown mode. Rejecting producer with UID %ld",
+                  static_cast<unsigned long>(uid));
+    return nullptr;
+  }
+
+  if (producers_.size() >= kMaxProducerID) {
+    PERFETTO_DFATAL("Too many producers.");
+    return nullptr;
+  }
+  const ProducerID id = GetNextProducerID();
+  PERFETTO_DLOG("Producer %" PRIu16 " connected", id);
+
+  bool smb_scraping_enabled = smb_scraping_enabled_;
+  switch (smb_scraping_mode) {
+    case ProducerSMBScrapingMode::kDefault:
+      break;
+    case ProducerSMBScrapingMode::kEnabled:
+      smb_scraping_enabled = true;
+      break;
+    case ProducerSMBScrapingMode::kDisabled:
+      smb_scraping_enabled = false;
+      break;
+  }
+
+  std::unique_ptr<ProducerEndpointImpl> endpoint(new ProducerEndpointImpl(
+      id, uid, this, task_runner_, producer, producer_name, sdk_version,
+      in_process, smb_scraping_enabled));
+  auto it_and_inserted = producers_.emplace(id, endpoint.get());
+  PERFETTO_DCHECK(it_and_inserted.second);
+  endpoint->shmem_size_hint_bytes_ = shared_memory_size_hint_bytes;
+  endpoint->shmem_page_size_hint_bytes_ = shared_memory_page_size_hint_bytes;
+
+  // Producer::OnConnect() should run before Producer::OnTracingSetup(). The
+  // latter may be posted by SetupSharedMemory() below, so post OnConnect() now.
+  auto weak_ptr = endpoint->weak_ptr_factory_.GetWeakPtr();
+  task_runner_->PostTask([weak_ptr] {
+    if (weak_ptr)
+      weak_ptr->producer_->OnConnect();
+  });
+
+  if (shm) {
+    // The producer supplied an SMB. This is used only by Chrome; in the most
+    // common cases the SMB is created by the service and passed via
+    // OnTracingSetup(). Verify that it is correctly sized before we attempt to
+    // use it. The transport layer has to verify the integrity of the SMB (e.g.
+    // ensure that the producer can't resize if after the fact).
+    size_t shm_size, page_size;
+    std::tie(shm_size, page_size) =
+        EnsureValidShmSizes(shm->size(), endpoint->shmem_page_size_hint_bytes_);
+    if (shm_size == shm->size() &&
+        page_size == endpoint->shmem_page_size_hint_bytes_) {
+      PERFETTO_DLOG(
+          "Adopting producer-provided SMB of %zu kB for producer \"%s\"",
+          shm_size / 1024, endpoint->name_.c_str());
+      endpoint->SetupSharedMemory(std::move(shm), page_size,
+                                  /*provided_by_producer=*/true);
+    } else {
+      PERFETTO_LOG(
+          "Discarding incorrectly sized producer-provided SMB for producer "
+          "\"%s\", falling back to service-provided SMB. Requested sizes: %zu "
+          "B total, %zu B page size; suggested corrected sizes: %zu B total, "
+          "%zu B page size",
+          endpoint->name_.c_str(), shm->size(),
+          endpoint->shmem_page_size_hint_bytes_, shm_size, page_size);
+      shm.reset();
+    }
+  }
+
+  return std::unique_ptr<ProducerEndpoint>(std::move(endpoint));
+}
+
+void TracingServiceImpl::DisconnectProducer(ProducerID id) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  PERFETTO_DLOG("Producer %" PRIu16 " disconnected", id);
+  PERFETTO_DCHECK(producers_.count(id));
+
+  // Scrape remaining chunks for this producer to ensure we don't lose data.
+  if (auto* producer = GetProducer(id)) {
+    for (auto& session_id_and_session : tracing_sessions_)
+      ScrapeSharedMemoryBuffers(&session_id_and_session.second, producer);
+  }
+
+  for (auto it = data_sources_.begin(); it != data_sources_.end();) {
+    auto next = it;
+    next++;
+    if (it->second.producer_id == id)
+      UnregisterDataSource(id, it->second.descriptor.name());
+    it = next;
+  }
+
+  producers_.erase(id);
+  UpdateMemoryGuardrail();
+}
+
+TracingServiceImpl::ProducerEndpointImpl* TracingServiceImpl::GetProducer(
+    ProducerID id) const {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  auto it = producers_.find(id);
+  if (it == producers_.end())
+    return nullptr;
+  return it->second;
+}
+
+std::unique_ptr<TracingService::ConsumerEndpoint>
+TracingServiceImpl::ConnectConsumer(Consumer* consumer, uid_t uid) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  PERFETTO_DLOG("Consumer %p connected from UID %" PRIu64,
+                reinterpret_cast<void*>(consumer), static_cast<uint64_t>(uid));
+  std::unique_ptr<ConsumerEndpointImpl> endpoint(
+      new ConsumerEndpointImpl(this, task_runner_, consumer, uid));
+  auto it_and_inserted = consumers_.emplace(endpoint.get());
+  PERFETTO_DCHECK(it_and_inserted.second);
+  // Consumer might go away before we're able to send the connect notification,
+  // if that is the case just bail out.
+  auto weak_ptr = endpoint->weak_ptr_factory_.GetWeakPtr();
+  task_runner_->PostTask([weak_ptr] {
+    if (weak_ptr)
+      weak_ptr->consumer_->OnConnect();
+  });
+  return std::unique_ptr<ConsumerEndpoint>(std::move(endpoint));
+}
+
+void TracingServiceImpl::DisconnectConsumer(ConsumerEndpointImpl* consumer) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  PERFETTO_DLOG("Consumer %p disconnected", reinterpret_cast<void*>(consumer));
+  PERFETTO_DCHECK(consumers_.count(consumer));
+
+  // TODO(primiano) : Check that this is safe (what happens if there are
+  // ReadBuffers() calls posted in the meantime? They need to become noop).
+  if (consumer->tracing_session_id_)
+    FreeBuffers(consumer->tracing_session_id_);  // Will also DisableTracing().
+  consumers_.erase(consumer);
+
+  // At this point no more pointers to |consumer| should be around.
+  PERFETTO_DCHECK(!std::any_of(
+      tracing_sessions_.begin(), tracing_sessions_.end(),
+      [consumer](const std::pair<const TracingSessionID, TracingSession>& kv) {
+        return kv.second.consumer_maybe_null == consumer;
+      }));
+}
+
+bool TracingServiceImpl::DetachConsumer(ConsumerEndpointImpl* consumer,
+                                        const std::string& key) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  PERFETTO_DLOG("Consumer %p detached", reinterpret_cast<void*>(consumer));
+  PERFETTO_DCHECK(consumers_.count(consumer));
+
+  TracingSessionID tsid = consumer->tracing_session_id_;
+  TracingSession* tracing_session;
+  if (!tsid || !(tracing_session = GetTracingSession(tsid)))
+    return false;
+
+  if (GetDetachedSession(consumer->uid_, key)) {
+    PERFETTO_ELOG("Another session has been detached with the same key \"%s\"",
+                  key.c_str());
+    return false;
+  }
+
+  PERFETTO_DCHECK(tracing_session->consumer_maybe_null == consumer);
+  tracing_session->consumer_maybe_null = nullptr;
+  tracing_session->detach_key = key;
+  consumer->tracing_session_id_ = 0;
+  return true;
+}
+
+bool TracingServiceImpl::AttachConsumer(ConsumerEndpointImpl* consumer,
+                                        const std::string& key) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  PERFETTO_DLOG("Consumer %p attaching to session %s",
+                reinterpret_cast<void*>(consumer), key.c_str());
+  PERFETTO_DCHECK(consumers_.count(consumer));
+
+  if (consumer->tracing_session_id_) {
+    PERFETTO_ELOG(
+        "Cannot reattach consumer to session %s"
+        " while it already attached tracing session ID %" PRIu64,
+        key.c_str(), consumer->tracing_session_id_);
+    return false;
+  }
+
+  auto* tracing_session = GetDetachedSession(consumer->uid_, key);
+  if (!tracing_session) {
+    PERFETTO_ELOG(
+        "Failed to attach consumer, session '%s' not found for uid %d",
+        key.c_str(), static_cast<int>(consumer->uid_));
+    return false;
+  }
+
+  consumer->tracing_session_id_ = tracing_session->id;
+  tracing_session->consumer_maybe_null = consumer;
+  tracing_session->detach_key.clear();
+  return true;
+}
+
+base::Status TracingServiceImpl::EnableTracing(ConsumerEndpointImpl* consumer,
+                                               const TraceConfig& cfg,
+                                               base::ScopedFile fd) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  PERFETTO_DLOG("Enabling tracing for consumer %p",
+                reinterpret_cast<void*>(consumer));
+  MaybeLogUploadEvent(cfg, PerfettoStatsdAtom::kTracedEnableTracing);
+  if (cfg.lockdown_mode() == TraceConfig::LOCKDOWN_SET)
+    lockdown_mode_ = true;
+  if (cfg.lockdown_mode() == TraceConfig::LOCKDOWN_CLEAR)
+    lockdown_mode_ = false;
+
+  // Scope |tracing_session| to this block to prevent accidental use of a null
+  // pointer later in this function.
+  {
+    TracingSession* tracing_session =
+        GetTracingSession(consumer->tracing_session_id_);
+    if (tracing_session) {
+      MaybeLogUploadEvent(
+          cfg, PerfettoStatsdAtom::kTracedEnableTracingExistingTraceSession);
+      return PERFETTO_SVC_ERR(
+          "A Consumer is trying to EnableTracing() but another tracing "
+          "session is already active (forgot a call to FreeBuffers() ?)");
+    }
+  }
+
+  const uint32_t max_duration_ms = cfg.enable_extra_guardrails()
+                                       ? kGuardrailsMaxTracingDurationMillis
+                                       : kMaxTracingDurationMillis;
+  if (cfg.duration_ms() > max_duration_ms) {
+    MaybeLogUploadEvent(cfg,
+                        PerfettoStatsdAtom::kTracedEnableTracingTooLongTrace);
+    return PERFETTO_SVC_ERR("Requested too long trace (%" PRIu32
+                            "ms  > %" PRIu32 " ms)",
+                            cfg.duration_ms(), max_duration_ms);
+  }
+
+  const bool has_trigger_config = cfg.trigger_config().trigger_mode() !=
+                                  TraceConfig::TriggerConfig::UNSPECIFIED;
+  if (has_trigger_config && (cfg.trigger_config().trigger_timeout_ms() == 0 ||
+                             cfg.trigger_config().trigger_timeout_ms() >
+                                 kGuardrailsMaxTracingDurationMillis)) {
+    MaybeLogUploadEvent(
+        cfg, PerfettoStatsdAtom::kTracedEnableTracingInvalidTriggerTimeout);
+    return PERFETTO_SVC_ERR(
+        "Traces with START_TRACING triggers must provide a positive "
+        "trigger_timeout_ms < 7 days (received %" PRIu32 "ms)",
+        cfg.trigger_config().trigger_timeout_ms());
+  }
+
+  if (has_trigger_config && cfg.duration_ms() != 0) {
+    MaybeLogUploadEvent(
+        cfg, PerfettoStatsdAtom::kTracedEnableTracingDurationWithTrigger);
+    return PERFETTO_SVC_ERR(
+        "duration_ms was set, this must not be set for traces with triggers.");
+  }
+
+  if (cfg.trigger_config().trigger_mode() ==
+          TraceConfig::TriggerConfig::STOP_TRACING &&
+      cfg.write_into_file()) {
+    // We don't support this usecase because there are subtle assumptions which
+    // break around TracingServiceEvents and windowed sorting (i.e. if we don't
+    // drain the events in ReadBuffers because we are waiting for STOP_TRACING,
+    // we can end up queueing up a lot of TracingServiceEvents and emitting them
+    // wildy out of order breaking windowed sorting in trace processor).
+    MaybeLogUploadEvent(
+        cfg, PerfettoStatsdAtom::kTracedEnableTracingStopTracingWriteIntoFile);
+    return PERFETTO_SVC_ERR(
+        "Specifying trigger mode STOP_TRACING and write_into_file together is "
+        "unsupported");
+  }
+
+  std::unordered_set<std::string> triggers;
+  for (const auto& trigger : cfg.trigger_config().triggers()) {
+    if (!triggers.insert(trigger.name()).second) {
+      MaybeLogUploadEvent(
+          cfg, PerfettoStatsdAtom::kTracedEnableTracingDuplicateTriggerName);
+      return PERFETTO_SVC_ERR("Duplicate trigger name: %s",
+                              trigger.name().c_str());
+    }
+  }
+
+  if (cfg.enable_extra_guardrails()) {
+    if (cfg.deferred_start()) {
+      MaybeLogUploadEvent(
+          cfg, PerfettoStatsdAtom::kTracedEnableTracingInvalidDeferredStart);
+      return PERFETTO_SVC_ERR(
+          "deferred_start=true is not supported in unsupervised traces");
+    }
+    uint64_t buf_size_sum = 0;
+    for (const auto& buf : cfg.buffers()) {
+      if (buf.size_kb() % 4 != 0) {
+        MaybeLogUploadEvent(
+            cfg, PerfettoStatsdAtom::kTracedEnableTracingInvalidBufferSize);
+        return PERFETTO_SVC_ERR(
+            "buffers.size_kb must be a multiple of 4, got %" PRIu32,
+            buf.size_kb());
+      }
+      buf_size_sum += buf.size_kb();
+    }
+    if (buf_size_sum > kGuardrailsMaxTracingBufferSizeKb) {
+      MaybeLogUploadEvent(
+          cfg, PerfettoStatsdAtom::kTracedEnableTracingBufferSizeTooLarge);
+      return PERFETTO_SVC_ERR("Requested too large trace buffer (%" PRIu64
+                              "kB  > %" PRIu32 " kB)",
+                              buf_size_sum, kGuardrailsMaxTracingBufferSizeKb);
+    }
+  }
+
+  if (cfg.buffers_size() > kMaxBuffersPerConsumer) {
+    MaybeLogUploadEvent(cfg,
+                        PerfettoStatsdAtom::kTracedEnableTracingTooManyBuffers);
+    return PERFETTO_SVC_ERR("Too many buffers configured (%d)",
+                            cfg.buffers_size());
+  }
+
+  if (!cfg.unique_session_name().empty()) {
+    const std::string& name = cfg.unique_session_name();
+    for (auto& kv : tracing_sessions_) {
+      if (kv.second.config.unique_session_name() == name) {
+        MaybeLogUploadEvent(
+            cfg, PerfettoStatsdAtom::kTracedEnableTracingDuplicateSessionName);
+        static const char fmt[] =
+            "A trace with this unique session name (%s) already exists";
+        // This happens frequently, don't make it an "E"LOG.
+        PERFETTO_LOG(fmt, name.c_str());
+        return base::ErrStatus(fmt, name.c_str());
+      }
+    }
+  }
+
+  if (cfg.enable_extra_guardrails()) {
+    // unique_session_name can be empty
+    const std::string& name = cfg.unique_session_name();
+    int64_t now_s = base::GetBootTimeS().count();
+
+    // Remove any entries where the time limit has passed so this map doesn't
+    // grow indefinitely:
+    std::map<std::string, int64_t>& sessions = session_to_last_trace_s_;
+    for (auto it = sessions.cbegin(); it != sessions.cend();) {
+      if (now_s - it->second > kMinSecondsBetweenTracesGuardrail) {
+        it = sessions.erase(it);
+      } else {
+        ++it;
+      }
+    }
+
+    int64_t& previous_s = session_to_last_trace_s_[name];
+    if (previous_s == 0) {
+      previous_s = now_s;
+    } else {
+      MaybeLogUploadEvent(
+          cfg, PerfettoStatsdAtom::kTracedEnableTracingSessionNameTooRecent);
+      return PERFETTO_SVC_ERR(
+          "A trace with unique session name \"%s\" began less than %" PRId64
+          "s ago (%" PRId64 "s)",
+          name.c_str(), kMinSecondsBetweenTracesGuardrail, now_s - previous_s);
+    }
+  }
+
+  const int sessions_for_uid = static_cast<int>(std::count_if(
+      tracing_sessions_.begin(), tracing_sessions_.end(),
+      [consumer](const decltype(tracing_sessions_)::value_type& s) {
+        return s.second.consumer_uid == consumer->uid_;
+      }));
+
+  int per_uid_limit = kMaxConcurrentTracingSessionsPerUid;
+  if (consumer->uid_ == 1066 /* AID_STATSD*/) {
+    per_uid_limit = kMaxConcurrentTracingSessionsForStatsdUid;
+  }
+  if (sessions_for_uid >= per_uid_limit) {
+    MaybeLogUploadEvent(
+        cfg, PerfettoStatsdAtom::kTracedEnableTracingTooManySessionsForUid);
+    return PERFETTO_SVC_ERR(
+        "Too many concurrent tracing sesions (%d) for uid %d limit is %d",
+        sessions_for_uid, static_cast<int>(consumer->uid_), per_uid_limit);
+  }
+
+  // TODO(primiano): This is a workaround to prevent that a producer gets stuck
+  // in a state where it stalls by design by having more TraceWriterImpl
+  // instances than free pages in the buffer. This is really a bug in
+  // trace_probes and the way it handles stalls in the shmem buffer.
+  if (tracing_sessions_.size() >= kMaxConcurrentTracingSessions) {
+    MaybeLogUploadEvent(
+        cfg, PerfettoStatsdAtom::kTracedEnableTracingTooManyConcurrentSessions);
+    return PERFETTO_SVC_ERR("Too many concurrent tracing sesions (%zu)",
+                            tracing_sessions_.size());
+  }
+
+  // If the trace config provides a filter bytecode, setup the filter now.
+  // If the filter loading fails, abort the tracing session rather than running
+  // unfiltered.
+  std::unique_ptr<protozero::MessageFilter> trace_filter;
+  if (cfg.has_trace_filter()) {
+    const auto& filt = cfg.trace_filter();
+    const std::string& bytecode = filt.bytecode();
+    trace_filter.reset(new protozero::MessageFilter());
+    if (!trace_filter->LoadFilterBytecode(bytecode.data(), bytecode.size())) {
+      MaybeLogUploadEvent(
+          cfg, PerfettoStatsdAtom::kTracedEnableTracingInvalidFilter);
+      return PERFETTO_SVC_ERR("Trace filter bytecode invalid, aborting");
+    }
+    // The filter is created using perfetto.protos.Trace as root message
+    // (because that makes it possible to play around with the `proto_filter`
+    // tool on actual traces). Here in the service, however, we deal with
+    // perfetto.protos.TracePacket(s), which are one level down (Trace.packet).
+    // The IPC client (or the write_into_filte logic in here) are responsible
+    // for pre-pending the packet preamble (See GetProtoPreamble() calls), but
+    // the preamble is not there at ReadBuffer time. Hence we change the root of
+    // the filtering to start at the Trace.packet level.
+    uint32_t packet_field_id = TracePacket::kPacketFieldNumber;
+    if (!trace_filter->SetFilterRoot(&packet_field_id, 1)) {
+      MaybeLogUploadEvent(
+          cfg, PerfettoStatsdAtom::kTracedEnableTracingInvalidFilter);
+      return PERFETTO_SVC_ERR("Failed to set filter root.");
+    }
+  }
+
+  const TracingSessionID tsid = ++last_tracing_session_id_;
+  TracingSession* tracing_session =
+      &tracing_sessions_
+           .emplace(std::piecewise_construct, std::forward_as_tuple(tsid),
+                    std::forward_as_tuple(tsid, consumer, cfg, task_runner_))
+           .first->second;
+
+  if (trace_filter)
+    tracing_session->trace_filter = std::move(trace_filter);
+
+  if (cfg.write_into_file()) {
+    if (!fd ^ !cfg.output_path().empty()) {
+      tracing_sessions_.erase(tsid);
+      MaybeLogUploadEvent(
+          tracing_session->config,
+          PerfettoStatsdAtom::kTracedEnableTracingInvalidFdOutputFile);
+      return PERFETTO_SVC_ERR(
+          "When write_into_file==true either a FD needs to be passed or "
+          "output_path must be populated (but not both)");
+    }
+    if (!cfg.output_path().empty()) {
+      fd = CreateTraceFile(cfg.output_path(), /*overwrite=*/false);
+      if (!fd) {
+        MaybeLogUploadEvent(
+            tracing_session->config,
+            PerfettoStatsdAtom::kTracedEnableTracingFailedToCreateFile);
+        tracing_sessions_.erase(tsid);
+        return PERFETTO_SVC_ERR("Failed to create the trace file %s",
+                                cfg.output_path().c_str());
+      }
+    }
+    tracing_session->write_into_file = std::move(fd);
+    uint32_t write_period_ms = cfg.file_write_period_ms();
+    if (write_period_ms == 0)
+      write_period_ms = kDefaultWriteIntoFilePeriodMs;
+    if (write_period_ms < min_write_period_ms_)
+      write_period_ms = min_write_period_ms_;
+    tracing_session->write_period_ms = write_period_ms;
+    tracing_session->max_file_size_bytes = cfg.max_file_size_bytes();
+    tracing_session->bytes_written_into_file = 0;
+  }
+
+  // Initialize the log buffers.
+  bool did_allocate_all_buffers = true;
+
+  // Allocate the trace buffers. Also create a map to translate a consumer
+  // relative index (TraceConfig.DataSourceConfig.target_buffer) into the
+  // corresponding BufferID, which is a global ID namespace for the service and
+  // all producers.
+  size_t total_buf_size_kb = 0;
+  const size_t num_buffers = static_cast<size_t>(cfg.buffers_size());
+  tracing_session->buffers_index.reserve(num_buffers);
+  for (size_t i = 0; i < num_buffers; i++) {
+    const TraceConfig::BufferConfig& buffer_cfg = cfg.buffers()[i];
+    BufferID global_id = buffer_ids_.Allocate();
+    if (!global_id) {
+      did_allocate_all_buffers = false;  // We ran out of IDs.
+      break;
+    }
+    tracing_session->buffers_index.push_back(global_id);
+    const size_t buf_size_bytes = buffer_cfg.size_kb() * 1024u;
+    total_buf_size_kb += buffer_cfg.size_kb();
+    TraceBuffer::OverwritePolicy policy =
+        buffer_cfg.fill_policy() == TraceConfig::BufferConfig::DISCARD
+            ? TraceBuffer::kDiscard
+            : TraceBuffer::kOverwrite;
+    auto it_and_inserted = buffers_.emplace(
+        global_id, TraceBuffer::Create(buf_size_bytes, policy));
+    PERFETTO_DCHECK(it_and_inserted.second);  // buffers_.count(global_id) == 0.
+    std::unique_ptr<TraceBuffer>& trace_buffer = it_and_inserted.first->second;
+    if (!trace_buffer) {
+      did_allocate_all_buffers = false;
+      break;
+    }
+  }
+
+  UpdateMemoryGuardrail();
+
+  // This can happen if either:
+  // - All the kMaxTraceBufferID slots are taken.
+  // - OOM, or, more relistically, we exhausted virtual memory.
+  // In any case, free all the previously allocated buffers and abort.
+  // TODO(fmayer): add a test to cover this case, this is quite subtle.
+  if (!did_allocate_all_buffers) {
+    for (BufferID global_id : tracing_session->buffers_index) {
+      buffer_ids_.Free(global_id);
+      buffers_.erase(global_id);
+    }
+    tracing_sessions_.erase(tsid);
+    MaybeLogUploadEvent(tracing_session->config,
+                        PerfettoStatsdAtom::kTracedEnableTracingOom);
+    return PERFETTO_SVC_ERR(
+        "Failed to allocate tracing buffers: OOM or too many buffers");
+  }
+
+  consumer->tracing_session_id_ = tsid;
+
+  // Setup the data sources on the producers without starting them.
+  for (const TraceConfig::DataSource& cfg_data_source : cfg.data_sources()) {
+    // Scan all the registered data sources with a matching name.
+    auto range = data_sources_.equal_range(cfg_data_source.config().name());
+    for (auto it = range.first; it != range.second; it++) {
+      TraceConfig::ProducerConfig producer_config;
+      for (auto& config : cfg.producers()) {
+        if (GetProducer(it->second.producer_id)->name_ ==
+            config.producer_name()) {
+          producer_config = config;
+          break;
+        }
+      }
+      SetupDataSource(cfg_data_source, producer_config, it->second,
+                      tracing_session);
+    }
+  }
+
+  bool has_start_trigger = false;
+  auto weak_this = weak_ptr_factory_.GetWeakPtr();
+  switch (cfg.trigger_config().trigger_mode()) {
+    case TraceConfig::TriggerConfig::UNSPECIFIED:
+      // no triggers are specified so this isn't a trace that is using triggers.
+      PERFETTO_DCHECK(!has_trigger_config);
+      break;
+    case TraceConfig::TriggerConfig::START_TRACING:
+      // For traces which use START_TRACE triggers we need to ensure that the
+      // tracing session will be cleaned up when it times out.
+      has_start_trigger = true;
+      task_runner_->PostDelayedTask(
+          [weak_this, tsid]() {
+            if (weak_this)
+              weak_this->OnStartTriggersTimeout(tsid);
+          },
+          cfg.trigger_config().trigger_timeout_ms());
+      break;
+    case TraceConfig::TriggerConfig::STOP_TRACING:
+      // Update the tracing_session's duration_ms to ensure that if no trigger
+      // is received the session will end and be cleaned up equal to the
+      // timeout.
+      //
+      // TODO(nuskos): Refactor this so that rather then modifying the config we
+      // have a field we look at on the tracing_session.
+      tracing_session->config.set_duration_ms(
+          cfg.trigger_config().trigger_timeout_ms());
+      break;
+  }
+
+  tracing_session->state = TracingSession::CONFIGURED;
+  PERFETTO_LOG(
+      "Configured tracing session %" PRIu64
+      ", #sources:%zu, duration:%d ms, #buffers:%d, total "
+      "buffer size:%zu KB, total sessions:%zu, uid:%d session name: \"%s\"",
+      tsid, cfg.data_sources().size(), tracing_session->config.duration_ms(),
+      cfg.buffers_size(), total_buf_size_kb, tracing_sessions_.size(),
+      static_cast<unsigned int>(consumer->uid_),
+      cfg.unique_session_name().c_str());
+
+  // Start the data sources, unless this is a case of early setup + fast
+  // triggering, either through TraceConfig.deferred_start or
+  // TraceConfig.trigger_config(). If both are specified which ever one occurs
+  // first will initiate the trace.
+  if (!cfg.deferred_start() && !has_start_trigger)
+    return StartTracing(tsid);
+
+  return base::OkStatus();
+}
+
+void TracingServiceImpl::ChangeTraceConfig(ConsumerEndpointImpl* consumer,
+                                           const TraceConfig& updated_cfg) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  TracingSession* tracing_session =
+      GetTracingSession(consumer->tracing_session_id_);
+  PERFETTO_DCHECK(tracing_session);
+
+  if ((tracing_session->state != TracingSession::STARTED) &&
+      (tracing_session->state != TracingSession::CONFIGURED)) {
+    PERFETTO_ELOG(
+        "ChangeTraceConfig() was called for a tracing session which isn't "
+        "running.");
+    return;
+  }
+
+  // We only support updating producer_name_{,regex}_filter (and pass-through
+  // configs) for now; null out any changeable fields and make sure the rest are
+  // identical.
+  TraceConfig new_config_copy(updated_cfg);
+  for (auto& ds_cfg : *new_config_copy.mutable_data_sources()) {
+    ds_cfg.clear_producer_name_filter();
+    ds_cfg.clear_producer_name_regex_filter();
+  }
+
+  TraceConfig current_config_copy(tracing_session->config);
+  for (auto& ds_cfg : *current_config_copy.mutable_data_sources()) {
+    ds_cfg.clear_producer_name_filter();
+    ds_cfg.clear_producer_name_regex_filter();
+  }
+
+  if (new_config_copy != current_config_copy) {
+    PERFETTO_LOG(
+        "ChangeTraceConfig() was called with a config containing unsupported "
+        "changes; only adding to the producer_name_{,regex}_filter is "
+        "currently supported and will have an effect.");
+  }
+
+  for (TraceConfig::DataSource& cfg_data_source :
+       *tracing_session->config.mutable_data_sources()) {
+    // Find the updated producer_filter in the new config.
+    std::vector<std::string> new_producer_name_filter;
+    std::vector<std::string> new_producer_name_regex_filter;
+    bool found_data_source = false;
+    for (const auto& it : updated_cfg.data_sources()) {
+      if (cfg_data_source.config().name() == it.config().name()) {
+        new_producer_name_filter = it.producer_name_filter();
+        new_producer_name_regex_filter = it.producer_name_regex_filter();
+        found_data_source = true;
+        break;
+      }
+    }
+
+    // Bail out if data source not present in the new config.
+    if (!found_data_source) {
+      PERFETTO_ELOG(
+          "ChangeTraceConfig() called without a current data source also "
+          "present in the new config: %s",
+          cfg_data_source.config().name().c_str());
+      continue;
+    }
+
+    // TODO(oysteine): Just replacing the filter means that if
+    // there are any filter entries which were present in the original config,
+    // but removed from the config passed to ChangeTraceConfig, any matching
+    // producers will keep producing but newly added producers after this
+    // point will never start.
+    *cfg_data_source.mutable_producer_name_filter() = new_producer_name_filter;
+    *cfg_data_source.mutable_producer_name_regex_filter() =
+        new_producer_name_regex_filter;
+
+    // Scan all the registered data sources with a matching name.
+    auto range = data_sources_.equal_range(cfg_data_source.config().name());
+    for (auto it = range.first; it != range.second; it++) {
+      ProducerEndpointImpl* producer = GetProducer(it->second.producer_id);
+      PERFETTO_DCHECK(producer);
+
+      // Check if the producer name of this data source is present
+      // in the name filters. We currently only support new filters, not
+      // removing old ones.
+      if (!NameMatchesFilter(producer->name_, new_producer_name_filter,
+                             new_producer_name_regex_filter)) {
+        continue;
+      }
+
+      bool already_setup = false;
+      auto& ds_instances = tracing_session->data_source_instances;
+      for (auto instance_it = ds_instances.begin();
+           instance_it != ds_instances.end(); ++instance_it) {
+        if (instance_it->first == it->second.producer_id &&
+            instance_it->second.data_source_name ==
+                cfg_data_source.config().name()) {
+          already_setup = true;
+          break;
+        }
+      }
+
+      if (already_setup)
+        continue;
+
+      // If it wasn't previously setup, set it up now.
+      // (The per-producer config is optional).
+      TraceConfig::ProducerConfig producer_config;
+      for (auto& config : tracing_session->config.producers()) {
+        if (producer->name_ == config.producer_name()) {
+          producer_config = config;
+          break;
+        }
+      }
+
+      DataSourceInstance* ds_inst = SetupDataSource(
+          cfg_data_source, producer_config, it->second, tracing_session);
+
+      if (ds_inst && tracing_session->state == TracingSession::STARTED)
+        StartDataSourceInstance(producer, tracing_session, ds_inst);
+    }
+  }
+}
+
+base::Status TracingServiceImpl::StartTracing(TracingSessionID tsid) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+
+  auto weak_this = weak_ptr_factory_.GetWeakPtr();
+  TracingSession* tracing_session = GetTracingSession(tsid);
+  if (!tracing_session) {
+    return PERFETTO_SVC_ERR(
+        "StartTracing() failed, invalid session ID %" PRIu64, tsid);
+  }
+
+  MaybeLogUploadEvent(tracing_session->config,
+                      PerfettoStatsdAtom::kTracedStartTracing);
+
+  if (tracing_session->state != TracingSession::CONFIGURED) {
+    MaybeLogUploadEvent(
+        tracing_session->config,
+        PerfettoStatsdAtom::kTracedStartTracingInvalidSessionState);
+    return PERFETTO_SVC_ERR("StartTracing() failed, invalid session state: %d",
+                            tracing_session->state);
+  }
+
+  tracing_session->state = TracingSession::STARTED;
+
+  // We store the start of trace snapshot separately as it's important to make
+  // sure we can interpret all the data in the trace and storing it in the ring
+  // buffer means it could be overwritten by a later snapshot.
+  if (!tracing_session->config.builtin_data_sources()
+           .disable_clock_snapshotting()) {
+    SnapshotClocks(&tracing_session->initial_clock_snapshot);
+  }
+
+  // We don't snapshot the clocks here because we just did this above.
+  SnapshotLifecyleEvent(
+      tracing_session,
+      protos::pbzero::TracingServiceEvent::kTracingStartedFieldNumber,
+      false /* snapshot_clocks */);
+
+  // Periodically snapshot clocks, stats, sync markers while the trace is
+  // active. The snapshots are emitted on the future ReadBuffers() calls, which
+  // means that:
+  //  (a) If we're streaming to a file (or to a consumer) while tracing, we
+  //      write snapshots periodically into the trace.
+  //  (b) If ReadBuffers() is only called after tracing ends, we emit the latest
+  //      snapshot into the trace. For clock snapshots, we keep track of the
+  //      snapshot recorded at the beginning of the session
+  //      (initial_clock_snapshot above), as well as the most recent sampled
+  //      snapshots that showed significant new drift between different clocks.
+  //      The latter clock snapshots are sampled periodically and at lifecycle
+  //      events.
+  base::PeriodicTask::Args snapshot_task_args;
+  snapshot_task_args.start_first_task_immediately = true;
+  snapshot_task_args.use_suspend_aware_timer =
+      tracing_session->config.builtin_data_sources()
+          .prefer_suspend_clock_for_snapshot();
+  snapshot_task_args.task = [weak_this, tsid] {
+    if (weak_this)
+      weak_this->PeriodicSnapshotTask(tsid);
+  };
+  snapshot_task_args.period_ms =
+      tracing_session->config.builtin_data_sources().snapshot_interval_ms();
+  if (!snapshot_task_args.period_ms)
+    snapshot_task_args.period_ms = kDefaultSnapshotsIntervalMs;
+  tracing_session->snapshot_periodic_task.Start(snapshot_task_args);
+
+  // Trigger delayed task if the trace is time limited.
+  const uint32_t trace_duration_ms = tracing_session->config.duration_ms();
+  if (trace_duration_ms > 0) {
+    task_runner_->PostDelayedTask(
+        [weak_this, tsid] {
+          // Skip entirely the flush if the trace session doesn't exist anymore.
+          // This is to prevent misleading error messages to be logged.
+          if (!weak_this)
+            return;
+          auto* tracing_session_ptr = weak_this->GetTracingSession(tsid);
+          if (!tracing_session_ptr)
+            return;
+          // If this trace was using STOP_TRACING triggers and we've seen
+          // one, then the trigger overrides the normal timeout. In this
+          // case we just return and let the other task clean up this trace.
+          if (tracing_session_ptr->config.trigger_config().trigger_mode() ==
+                  TraceConfig::TriggerConfig::STOP_TRACING &&
+              !tracing_session_ptr->received_triggers.empty())
+            return;
+          // In all other cases (START_TRACING or no triggers) we flush
+          // after |trace_duration_ms| unconditionally.
+          weak_this->FlushAndDisableTracing(tsid);
+        },
+        trace_duration_ms);
+  }
+
+  // Start the periodic drain tasks if we should to save the trace into a file.
+  if (tracing_session->config.write_into_file()) {
+    task_runner_->PostDelayedTask(
+        [weak_this, tsid] {
+          if (weak_this)
+            weak_this->ReadBuffers(tsid, nullptr);
+        },
+        tracing_session->delay_to_next_write_period_ms());
+  }
+
+  // Start the periodic flush tasks if the config specified a flush period.
+  if (tracing_session->config.flush_period_ms())
+    PeriodicFlushTask(tsid, /*post_next_only=*/true);
+
+  // Start the periodic incremental state clear tasks if the config specified a
+  // period.
+  if (tracing_session->config.incremental_state_config().clear_period_ms()) {
+    PeriodicClearIncrementalStateTask(tsid, /*post_next_only=*/true);
+  }
+
+  for (auto& kv : tracing_session->data_source_instances) {
+    ProducerID producer_id = kv.first;
+    DataSourceInstance& data_source = kv.second;
+    ProducerEndpointImpl* producer = GetProducer(producer_id);
+    if (!producer) {
+      PERFETTO_DFATAL("Producer does not exist.");
+      continue;
+    }
+    StartDataSourceInstance(producer, tracing_session, &data_source);
+  }
+
+  MaybeNotifyAllDataSourcesStarted(tracing_session);
+  return base::OkStatus();
+}
+
+void TracingServiceImpl::StartDataSourceInstance(
+    ProducerEndpointImpl* producer,
+    TracingSession* tracing_session,
+    TracingServiceImpl::DataSourceInstance* instance) {
+  PERFETTO_DCHECK(instance->state == DataSourceInstance::CONFIGURED);
+  if (instance->will_notify_on_start) {
+    instance->state = DataSourceInstance::STARTING;
+  } else {
+    instance->state = DataSourceInstance::STARTED;
+  }
+  if (tracing_session->consumer_maybe_null) {
+    tracing_session->consumer_maybe_null->OnDataSourceInstanceStateChange(
+        *producer, *instance);
+  }
+  producer->StartDataSource(instance->instance_id, instance->config);
+
+  // If all data sources are started, notify the consumer.
+  if (instance->state == DataSourceInstance::STARTED)
+    MaybeNotifyAllDataSourcesStarted(tracing_session);
+}
+
+// DisableTracing just stops the data sources but doesn't free up any buffer.
+// This is to allow the consumer to freeze the buffers (by stopping the trace)
+// and then drain the buffers. The actual teardown of the TracingSession happens
+// in FreeBuffers().
+void TracingServiceImpl::DisableTracing(TracingSessionID tsid,
+                                        bool disable_immediately) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  TracingSession* tracing_session = GetTracingSession(tsid);
+  if (!tracing_session) {
+    // Can happen if the consumer calls this before EnableTracing() or after
+    // FreeBuffers().
+    PERFETTO_DLOG("DisableTracing() failed, invalid session ID %" PRIu64, tsid);
+    return;
+  }
+
+  MaybeLogUploadEvent(tracing_session->config,
+                      PerfettoStatsdAtom::kTracedDisableTracing);
+
+  switch (tracing_session->state) {
+    // Spurious call to DisableTracing() while already disabled, nothing to do.
+    case TracingSession::DISABLED:
+      PERFETTO_DCHECK(tracing_session->AllDataSourceInstancesStopped());
+      return;
+
+    // This is either:
+    // A) The case of a graceful DisableTracing() call followed by a call to
+    //    FreeBuffers(), iff |disable_immediately| == true. In this case we want
+    //    to forcefully transition in the disabled state without waiting for the
+    //    outstanding acks because the buffers are going to be destroyed soon.
+    // B) A spurious call, iff |disable_immediately| == false, in which case
+    //    there is nothing to do.
+    case TracingSession::DISABLING_WAITING_STOP_ACKS:
+      PERFETTO_DCHECK(!tracing_session->AllDataSourceInstancesStopped());
+      if (disable_immediately)
+        DisableTracingNotifyConsumerAndFlushFile(tracing_session);
+      return;
+
+    // Continues below.
+    case TracingSession::CONFIGURED:
+      // If the session didn't even start there is no need to orchestrate a
+      // graceful stop of data sources.
+      disable_immediately = true;
+      break;
+
+    // This is the nominal case, continues below.
+    case TracingSession::STARTED:
+      break;
+  }
+
+  for (auto& data_source_inst : tracing_session->data_source_instances) {
+    const ProducerID producer_id = data_source_inst.first;
+    DataSourceInstance& instance = data_source_inst.second;
+    ProducerEndpointImpl* producer = GetProducer(producer_id);
+    PERFETTO_DCHECK(producer);
+    PERFETTO_DCHECK(instance.state == DataSourceInstance::CONFIGURED ||
+                    instance.state == DataSourceInstance::STARTING ||
+                    instance.state == DataSourceInstance::STARTED);
+    StopDataSourceInstance(producer, tracing_session, &instance,
+                           disable_immediately);
+  }
+
+  // If the periodic task is running, we can stop the periodic snapshot timer
+  // here instead of waiting until FreeBuffers to prevent useless snapshots
+  // which won't be read.
+  tracing_session->snapshot_periodic_task.Reset();
+
+  // Either this request is flagged with |disable_immediately| or there are no
+  // data sources that are requesting a final handshake. In both cases just mark
+  // the session as disabled immediately, notify the consumer and flush the
+  // trace file (if used).
+  if (tracing_session->AllDataSourceInstancesStopped())
+    return DisableTracingNotifyConsumerAndFlushFile(tracing_session);
+
+  tracing_session->state = TracingSession::DISABLING_WAITING_STOP_ACKS;
+  auto weak_this = weak_ptr_factory_.GetWeakPtr();
+  task_runner_->PostDelayedTask(
+      [weak_this, tsid] {
+        if (weak_this)
+          weak_this->OnDisableTracingTimeout(tsid);
+      },
+      tracing_session->data_source_stop_timeout_ms());
+
+  // Deliberately NOT removing the session from |tracing_session_|, it's still
+  // needed to call ReadBuffers(). FreeBuffers() will erase() the session.
+}
+
+void TracingServiceImpl::NotifyDataSourceStarted(
+    ProducerID producer_id,
+    DataSourceInstanceID instance_id) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  for (auto& kv : tracing_sessions_) {
+    TracingSession& tracing_session = kv.second;
+    DataSourceInstance* instance =
+        tracing_session.GetDataSourceInstance(producer_id, instance_id);
+
+    if (!instance)
+      continue;
+
+    // If the tracing session was already stopped, ignore this notification.
+    if (tracing_session.state != TracingSession::STARTED)
+      continue;
+
+    if (instance->state != DataSourceInstance::STARTING) {
+      PERFETTO_ELOG("Started data source instance in incorrect state: %d",
+                    instance->state);
+      continue;
+    }
+
+    instance->state = DataSourceInstance::STARTED;
+
+    ProducerEndpointImpl* producer = GetProducer(producer_id);
+    PERFETTO_DCHECK(producer);
+    if (tracing_session.consumer_maybe_null) {
+      tracing_session.consumer_maybe_null->OnDataSourceInstanceStateChange(
+          *producer, *instance);
+    }
+
+    // If all data sources are started, notify the consumer.
+    MaybeNotifyAllDataSourcesStarted(&tracing_session);
+  }  // for (tracing_session)
+}
+
+void TracingServiceImpl::MaybeNotifyAllDataSourcesStarted(
+    TracingSession* tracing_session) {
+  if (!tracing_session->consumer_maybe_null)
+    return;
+
+  if (!tracing_session->AllDataSourceInstancesStarted())
+    return;
+
+  // In some rare cases, we can get in this state more than once. Consider the
+  // following scenario: 3 data sources are registered -> trace starts ->
+  // all 3 data sources ack -> OnAllDataSourcesStarted() is called.
+  // Imagine now that a 4th data source registers while the trace is ongoing.
+  // This would hit the AllDataSourceInstancesStarted() condition again.
+  // In this case, however, we don't want to re-notify the consumer again.
+  // That would be unexpected (even if, perhaps, technically correct) and
+  // trigger bugs in the consumer.
+  if (tracing_session->did_notify_all_data_source_started)
+    return;
+
+  PERFETTO_DLOG("All data sources started");
+
+  SnapshotLifecyleEvent(
+      tracing_session,
+      protos::pbzero::TracingServiceEvent::kAllDataSourcesStartedFieldNumber,
+      true /* snapshot_clocks */);
+
+  tracing_session->did_notify_all_data_source_started = true;
+  tracing_session->consumer_maybe_null->OnAllDataSourcesStarted();
+}
+
+void TracingServiceImpl::NotifyDataSourceStopped(
+    ProducerID producer_id,
+    DataSourceInstanceID instance_id) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  for (auto& kv : tracing_sessions_) {
+    TracingSession& tracing_session = kv.second;
+    DataSourceInstance* instance =
+        tracing_session.GetDataSourceInstance(producer_id, instance_id);
+
+    if (!instance)
+      continue;
+
+    if (instance->state != DataSourceInstance::STOPPING) {
+      PERFETTO_ELOG("Stopped data source instance in incorrect state: %d",
+                    instance->state);
+      continue;
+    }
+
+    instance->state = DataSourceInstance::STOPPED;
+
+    ProducerEndpointImpl* producer = GetProducer(producer_id);
+    PERFETTO_DCHECK(producer);
+    if (tracing_session.consumer_maybe_null) {
+      tracing_session.consumer_maybe_null->OnDataSourceInstanceStateChange(
+          *producer, *instance);
+    }
+
+    if (!tracing_session.AllDataSourceInstancesStopped())
+      continue;
+
+    if (tracing_session.state != TracingSession::DISABLING_WAITING_STOP_ACKS)
+      continue;
+
+    // All data sources acked the termination.
+    DisableTracingNotifyConsumerAndFlushFile(&tracing_session);
+  }  // for (tracing_session)
+}
+
+void TracingServiceImpl::ActivateTriggers(
+    ProducerID producer_id,
+    const std::vector<std::string>& triggers) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  auto* producer = GetProducer(producer_id);
+  PERFETTO_DCHECK(producer);
+
+  int64_t now_ns = base::GetBootTimeNs().count();
+  for (const auto& trigger_name : triggers) {
+    PERFETTO_DLOG("Received ActivateTriggers request for \"%s\"",
+                  trigger_name.c_str());
+    base::Hash hash;
+    hash.Update(trigger_name.c_str(), trigger_name.size());
+
+    uint64_t trigger_name_hash = hash.digest();
+    size_t count_in_window =
+        PurgeExpiredAndCountTriggerInWindow(now_ns, trigger_name_hash);
+
+    bool trigger_applied = false;
+    for (auto& id_and_tracing_session : tracing_sessions_) {
+      auto& tracing_session = id_and_tracing_session.second;
+      TracingSessionID tsid = id_and_tracing_session.first;
+      auto iter = std::find_if(
+          tracing_session.config.trigger_config().triggers().begin(),
+          tracing_session.config.trigger_config().triggers().end(),
+          [&trigger_name](const TraceConfig::TriggerConfig::Trigger& trigger) {
+            return trigger.name() == trigger_name;
+          });
+      if (iter == tracing_session.config.trigger_config().triggers().end()) {
+        continue;
+      }
+
+      // If this trigger requires a certain producer to have sent it
+      // (non-empty producer_name()) ensure the producer who sent this trigger
+      // matches.
+      if (!iter->producer_name_regex().empty() &&
+          !std::regex_match(
+              producer->name_,
+              std::regex(iter->producer_name_regex(), std::regex::extended))) {
+        continue;
+      }
+
+      // Use a random number between 0 and 1 to check if we should allow this
+      // trigger through or not.
+      double trigger_rnd =
+          trigger_rnd_override_for_testing_ > 0
+              ? trigger_rnd_override_for_testing_
+              : trigger_probability_dist_(trigger_probability_rand_);
+      PERFETTO_DCHECK(trigger_rnd >= 0 && trigger_rnd < 1);
+      if (trigger_rnd < iter->skip_probability()) {
+        MaybeLogTriggerEvent(tracing_session.config,
+                             PerfettoTriggerAtom::kTracedLimitProbability,
+                             trigger_name);
+        continue;
+      }
+
+      // If we already triggered more times than the limit, silently ignore
+      // this trigger.
+      if (iter->max_per_24_h() > 0 && count_in_window >= iter->max_per_24_h()) {
+        MaybeLogTriggerEvent(tracing_session.config,
+                             PerfettoTriggerAtom::kTracedLimitMaxPer24h,
+                             trigger_name);
+        continue;
+      }
+      trigger_applied = true;
+
+      const bool triggers_already_received =
+          !tracing_session.received_triggers.empty();
+      tracing_session.received_triggers.push_back(
+          {static_cast<uint64_t>(now_ns), iter->name(), producer->name_,
+           producer->uid_});
+      auto weak_this = weak_ptr_factory_.GetWeakPtr();
+      switch (tracing_session.config.trigger_config().trigger_mode()) {
+        case TraceConfig::TriggerConfig::START_TRACING:
+          // If the session has already been triggered and moved past
+          // CONFIGURED then we don't need to repeat StartTracing. This would
+          // work fine (StartTracing would return false) but would add error
+          // logs.
+          if (tracing_session.state != TracingSession::CONFIGURED)
+            break;
+
+          PERFETTO_DLOG("Triggering '%s' on tracing session %" PRIu64
+                        " with duration of %" PRIu32 "ms.",
+                        iter->name().c_str(), tsid, iter->stop_delay_ms());
+          MaybeLogUploadEvent(tracing_session.config,
+                              PerfettoStatsdAtom::kTracedTriggerStartTracing,
+                              iter->name());
+
+          // We override the trace duration to be the trigger's requested
+          // value, this ensures that the trace will end after this amount
+          // of time has passed.
+          tracing_session.config.set_duration_ms(iter->stop_delay_ms());
+          StartTracing(tsid);
+          break;
+        case TraceConfig::TriggerConfig::STOP_TRACING:
+          // Only stop the trace once to avoid confusing log messages. I.E.
+          // when we've already hit the first trigger we've already Posted the
+          // task to FlushAndDisable. So all future triggers will just break
+          // out.
+          if (triggers_already_received)
+            break;
+
+          PERFETTO_DLOG("Triggering '%s' on tracing session %" PRIu64
+                        " with duration of %" PRIu32 "ms.",
+                        iter->name().c_str(), tsid, iter->stop_delay_ms());
+          MaybeLogUploadEvent(tracing_session.config,
+                              PerfettoStatsdAtom::kTracedTriggerStopTracing,
+                              iter->name());
+
+          // Now that we've seen a trigger we need to stop, flush, and disable
+          // this session after the configured |stop_delay_ms|.
+          task_runner_->PostDelayedTask(
+              [weak_this, tsid] {
+                // Skip entirely the flush if the trace session doesn't exist
+                // anymore. This is to prevent misleading error messages to be
+                // logged.
+                if (weak_this && weak_this->GetTracingSession(tsid))
+                  weak_this->FlushAndDisableTracing(tsid);
+              },
+              // If this trigger is zero this will immediately executable and
+              // will happen shortly.
+              iter->stop_delay_ms());
+          break;
+        case TraceConfig::TriggerConfig::UNSPECIFIED:
+          PERFETTO_ELOG("Trigger activated but trigger mode unspecified.");
+          break;
+      }
+    }  // for (.. : tracing_sessions_)
+
+    if (trigger_applied) {
+      trigger_history_.emplace_back(TriggerHistory{now_ns, trigger_name_hash});
+    }
+  }
+}
+
+// Always invoked kDataSourceStopTimeoutMs after DisableTracing(). In nominal
+// conditions all data sources should have acked the stop and this will early
+// out.
+void TracingServiceImpl::OnDisableTracingTimeout(TracingSessionID tsid) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  TracingSession* tracing_session = GetTracingSession(tsid);
+  if (!tracing_session ||
+      tracing_session->state != TracingSession::DISABLING_WAITING_STOP_ACKS) {
+    return;  // Tracing session was successfully disabled.
+  }
+
+  PERFETTO_ILOG("Timeout while waiting for ACKs for tracing session %" PRIu64,
+                tsid);
+  PERFETTO_DCHECK(!tracing_session->AllDataSourceInstancesStopped());
+  DisableTracingNotifyConsumerAndFlushFile(tracing_session);
+}
+
+void TracingServiceImpl::DisableTracingNotifyConsumerAndFlushFile(
+    TracingSession* tracing_session) {
+  PERFETTO_DCHECK(tracing_session->state != TracingSession::DISABLED);
+  for (auto& inst_kv : tracing_session->data_source_instances) {
+    if (inst_kv.second.state == DataSourceInstance::STOPPED)
+      continue;
+    inst_kv.second.state = DataSourceInstance::STOPPED;
+    ProducerEndpointImpl* producer = GetProducer(inst_kv.first);
+    PERFETTO_DCHECK(producer);
+    if (tracing_session->consumer_maybe_null) {
+      tracing_session->consumer_maybe_null->OnDataSourceInstanceStateChange(
+          *producer, inst_kv.second);
+    }
+  }
+  tracing_session->state = TracingSession::DISABLED;
+
+  // Scrape any remaining chunks that weren't flushed by the producers.
+  for (auto& producer_id_and_producer : producers_)
+    ScrapeSharedMemoryBuffers(tracing_session, producer_id_and_producer.second);
+
+  SnapshotLifecyleEvent(
+      tracing_session,
+      protos::pbzero::TracingServiceEvent::kTracingDisabledFieldNumber,
+      true /* snapshot_clocks */);
+
+  if (tracing_session->write_into_file) {
+    tracing_session->write_period_ms = 0;
+    ReadBuffers(tracing_session->id, nullptr);
+  }
+
+  if (tracing_session->on_disable_callback_for_bugreport) {
+    std::move(tracing_session->on_disable_callback_for_bugreport)();
+    tracing_session->on_disable_callback_for_bugreport = nullptr;
+  }
+
+  MaybeLogUploadEvent(tracing_session->config,
+                      PerfettoStatsdAtom::kTracedNotifyTracingDisabled);
+
+  if (tracing_session->consumer_maybe_null)
+    tracing_session->consumer_maybe_null->NotifyOnTracingDisabled("");
+}
+
+void TracingServiceImpl::Flush(TracingSessionID tsid,
+                               uint32_t timeout_ms,
+                               ConsumerEndpoint::FlushCallback callback) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  TracingSession* tracing_session = GetTracingSession(tsid);
+  if (!tracing_session) {
+    PERFETTO_DLOG("Flush() failed, invalid session ID %" PRIu64, tsid);
+    return;
+  }
+
+  if (!timeout_ms)
+    timeout_ms = tracing_session->flush_timeout_ms();
+
+  if (tracing_session->pending_flushes.size() > 1000) {
+    PERFETTO_ELOG("Too many flushes (%zu) pending for the tracing session",
+                  tracing_session->pending_flushes.size());
+    callback(false);
+    return;
+  }
+
+  FlushRequestID flush_request_id = ++last_flush_request_id_;
+  PendingFlush& pending_flush =
+      tracing_session->pending_flushes
+          .emplace_hint(tracing_session->pending_flushes.end(),
+                        flush_request_id, PendingFlush(std::move(callback)))
+          ->second;
+
+  // Send a flush request to each producer involved in the tracing session. In
+  // order to issue a flush request we have to build a map of all data source
+  // instance ids enabled for each producer.
+  std::map<ProducerID, std::vector<DataSourceInstanceID>> flush_map;
+  for (const auto& data_source_inst : tracing_session->data_source_instances) {
+    const ProducerID producer_id = data_source_inst.first;
+    const DataSourceInstanceID ds_inst_id = data_source_inst.second.instance_id;
+    flush_map[producer_id].push_back(ds_inst_id);
+  }
+
+  for (const auto& kv : flush_map) {
+    ProducerID producer_id = kv.first;
+    ProducerEndpointImpl* producer = GetProducer(producer_id);
+    const std::vector<DataSourceInstanceID>& data_sources = kv.second;
+    producer->Flush(flush_request_id, data_sources);
+    pending_flush.producers.insert(producer_id);
+  }
+
+  // If there are no producers to flush (realistically this happens only in
+  // some tests) fire OnFlushTimeout() straight away, without waiting.
+  if (flush_map.empty())
+    timeout_ms = 0;
+
+  auto weak_this = weak_ptr_factory_.GetWeakPtr();
+  task_runner_->PostDelayedTask(
+      [weak_this, tsid, flush_request_id] {
+        if (weak_this)
+          weak_this->OnFlushTimeout(tsid, flush_request_id);
+      },
+      timeout_ms);
+}
+
+void TracingServiceImpl::NotifyFlushDoneForProducer(
+    ProducerID producer_id,
+    FlushRequestID flush_request_id) {
+  for (auto& kv : tracing_sessions_) {
+    // Remove all pending flushes <= |flush_request_id| for |producer_id|.
+    auto& pending_flushes = kv.second.pending_flushes;
+    auto end_it = pending_flushes.upper_bound(flush_request_id);
+    for (auto it = pending_flushes.begin(); it != end_it;) {
+      PendingFlush& pending_flush = it->second;
+      pending_flush.producers.erase(producer_id);
+      if (pending_flush.producers.empty()) {
+        auto weak_this = weak_ptr_factory_.GetWeakPtr();
+        TracingSessionID tsid = kv.first;
+        auto callback = std::move(pending_flush.callback);
+        task_runner_->PostTask([weak_this, tsid, callback]() {
+          if (weak_this) {
+            weak_this->CompleteFlush(tsid, std::move(callback),
+                                     /*success=*/true);
+          }
+        });
+        it = pending_flushes.erase(it);
+      } else {
+        it++;
+      }
+    }  // for (pending_flushes)
+  }    // for (tracing_session)
+}
+
+void TracingServiceImpl::OnFlushTimeout(TracingSessionID tsid,
+                                        FlushRequestID flush_request_id) {
+  TracingSession* tracing_session = GetTracingSession(tsid);
+  if (!tracing_session)
+    return;
+  auto it = tracing_session->pending_flushes.find(flush_request_id);
+  if (it == tracing_session->pending_flushes.end())
+    return;  // Nominal case: flush was completed and acked on time.
+
+  // If there were no producers to flush, consider it a success.
+  bool success = it->second.producers.empty();
+
+  auto callback = std::move(it->second.callback);
+  tracing_session->pending_flushes.erase(it);
+  CompleteFlush(tsid, std::move(callback), success);
+}
+
+void TracingServiceImpl::CompleteFlush(TracingSessionID tsid,
+                                       ConsumerEndpoint::FlushCallback callback,
+                                       bool success) {
+  TracingSession* tracing_session = GetTracingSession(tsid);
+  if (!tracing_session) {
+    callback(false);
+    return;
+  }
+  // Producers may not have been able to flush all their data, even if they
+  // indicated flush completion. If possible, also collect uncommitted chunks
+  // to make sure we have everything they wrote so far.
+  for (auto& producer_id_and_producer : producers_) {
+    ScrapeSharedMemoryBuffers(tracing_session, producer_id_and_producer.second);
+  }
+  SnapshotLifecyleEvent(
+      tracing_session,
+      protos::pbzero::TracingServiceEvent::kAllDataSourcesFlushedFieldNumber,
+      true /* snapshot_clocks */);
+  callback(success);
+}
+
+void TracingServiceImpl::ScrapeSharedMemoryBuffers(
+    TracingSession* tracing_session,
+    ProducerEndpointImpl* producer) {
+  if (!producer->smb_scraping_enabled_)
+    return;
+
+  // Can't copy chunks if we don't know about any trace writers.
+  if (producer->writers_.empty())
+    return;
+
+  // Performance optimization: On flush or session disconnect, this method is
+  // called for each producer. If the producer doesn't participate in the
+  // session, there's no need to scape its chunks right now. We can tell if a
+  // producer participates in the session by checking if the producer is allowed
+  // to write into the session's log buffers.
+  const auto& session_buffers = tracing_session->buffers_index;
+  bool producer_in_session =
+      std::any_of(session_buffers.begin(), session_buffers.end(),
+                  [producer](BufferID buffer_id) {
+                    return producer->allowed_target_buffers_.count(buffer_id);
+                  });
+  if (!producer_in_session)
+    return;
+
+  PERFETTO_DLOG("Scraping SMB for producer %" PRIu16, producer->id_);
+
+  // Find and copy any uncommitted chunks from the SMB.
+  //
+  // In nominal conditions, the page layout of the used SMB pages should never
+  // change because the service is the only one who is supposed to modify used
+  // pages (to make them free again).
+  //
+  // However, the code here needs to deal with the case of a malicious producer
+  // altering the SMB in unpredictable ways. Thankfully the SMB size is
+  // immutable, so a chunk will always point to some valid memory, even if the
+  // producer alters the intended layout and chunk header concurrently.
+  // Ultimately a malicious producer altering the SMB's chunk layout while we
+  // are iterating in this function is not any different from the case of a
+  // malicious producer asking to commit a chunk made of random data, which is
+  // something this class has to deal with regardless.
+  //
+  // The only legitimate mutations that can happen from sane producers,
+  // concurrently to this function, are:
+  //   A. free pages being partitioned,
+  //   B. free chunks being migrated to kChunkBeingWritten,
+  //   C. kChunkBeingWritten chunks being migrated to kChunkCompleted.
+
+  SharedMemoryABI* abi = &producer->shmem_abi_;
+  // num_pages() is immutable after the SMB is initialized and cannot be changed
+  // even by a producer even if malicious.
+  for (size_t page_idx = 0; page_idx < abi->num_pages(); page_idx++) {
+    uint32_t layout = abi->GetPageLayout(page_idx);
+
+    uint32_t used_chunks = abi->GetUsedChunks(layout);  // Returns a bitmap.
+    // Skip empty pages.
+    if (used_chunks == 0)
+      continue;
+
+    // Scrape the chunks that are currently used. These should be either in
+    // state kChunkBeingWritten or kChunkComplete.
+    for (uint32_t chunk_idx = 0; used_chunks; chunk_idx++, used_chunks >>= 1) {
+      if (!(used_chunks & 1))
+        continue;
+
+      SharedMemoryABI::ChunkState state =
+          SharedMemoryABI::GetChunkStateFromLayout(layout, chunk_idx);
+      PERFETTO_DCHECK(state == SharedMemoryABI::kChunkBeingWritten ||
+                      state == SharedMemoryABI::kChunkComplete);
+      bool chunk_complete = state == SharedMemoryABI::kChunkComplete;
+
+      SharedMemoryABI::Chunk chunk =
+          abi->GetChunkUnchecked(page_idx, layout, chunk_idx);
+
+      uint16_t packet_count;
+      uint8_t flags;
+      // GetPacketCountAndFlags has acquire_load semantics.
+      std::tie(packet_count, flags) = chunk.GetPacketCountAndFlags();
+
+      // It only makes sense to copy an incomplete chunk if there's at least
+      // one full packet available. (The producer may not have completed the
+      // last packet in it yet, so we need at least 2.)
+      if (!chunk_complete && packet_count < 2)
+        continue;
+
+      // At this point, it is safe to access the remaining header fields of
+      // the chunk. Even if the chunk was only just transferred from
+      // kChunkFree into kChunkBeingWritten state, the header should be
+      // written completely once the packet count increased above 1 (it was
+      // reset to 0 by the service when the chunk was freed).
+
+      WriterID writer_id = chunk.writer_id();
+      base::Optional<BufferID> target_buffer_id =
+          producer->buffer_id_for_writer(writer_id);
+
+      // We can only scrape this chunk if we know which log buffer to copy it
+      // into.
+      if (!target_buffer_id)
+        continue;
+
+      // Skip chunks that don't belong to the requested tracing session.
+      bool target_buffer_belongs_to_session =
+          std::find(session_buffers.begin(), session_buffers.end(),
+                    *target_buffer_id) != session_buffers.end();
+      if (!target_buffer_belongs_to_session)
+        continue;
+
+      uint32_t chunk_id =
+          chunk.header()->chunk_id.load(std::memory_order_relaxed);
+
+      CopyProducerPageIntoLogBuffer(
+          producer->id_, producer->uid_, writer_id, chunk_id, *target_buffer_id,
+          packet_count, flags, chunk_complete, chunk.payload_begin(),
+          chunk.payload_size());
+    }
+  }
+}
+
+void TracingServiceImpl::FlushAndDisableTracing(TracingSessionID tsid) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  PERFETTO_DLOG("Triggering final flush for %" PRIu64, tsid);
+  auto weak_this = weak_ptr_factory_.GetWeakPtr();
+  Flush(tsid, 0, [weak_this, tsid](bool success) {
+    // This was a DLOG up to Jun 2021 (v16, Android S).
+    PERFETTO_LOG("FlushAndDisableTracing(%" PRIu64 ") done, success=%d", tsid,
+                 success);
+    if (!weak_this)
+      return;
+    TracingSession* session = weak_this->GetTracingSession(tsid);
+    if (session->consumer_maybe_null) {
+      // If the consumer is still attached, just disable the session but give it
+      // a chance to read the contents.
+      weak_this->DisableTracing(tsid);
+    } else {
+      // If the consumer detached, destroy the session. If the consumer did
+      // start the session in long-tracing mode, the service will have saved
+      // the contents to the passed file. If not, the contents will be
+      // destroyed.
+      weak_this->FreeBuffers(tsid);
+    }
+  });
+}
+
+void TracingServiceImpl::PeriodicFlushTask(TracingSessionID tsid,
+                                           bool post_next_only) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  TracingSession* tracing_session = GetTracingSession(tsid);
+  if (!tracing_session || tracing_session->state != TracingSession::STARTED)
+    return;
+
+  uint32_t flush_period_ms = tracing_session->config.flush_period_ms();
+  auto weak_this = weak_ptr_factory_.GetWeakPtr();
+  task_runner_->PostDelayedTask(
+      [weak_this, tsid] {
+        if (weak_this)
+          weak_this->PeriodicFlushTask(tsid, /*post_next_only=*/false);
+      },
+      flush_period_ms - static_cast<uint32_t>(base::GetWallTimeMs().count() %
+                                              flush_period_ms));
+
+  if (post_next_only)
+    return;
+
+  PERFETTO_DLOG("Triggering periodic flush for trace session %" PRIu64, tsid);
+  Flush(tsid, 0, [](bool success) {
+    if (!success)
+      PERFETTO_ELOG("Periodic flush timed out");
+  });
+}
+
+void TracingServiceImpl::PeriodicClearIncrementalStateTask(
+    TracingSessionID tsid,
+    bool post_next_only) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  TracingSession* tracing_session = GetTracingSession(tsid);
+  if (!tracing_session || tracing_session->state != TracingSession::STARTED)
+    return;
+
+  uint32_t clear_period_ms =
+      tracing_session->config.incremental_state_config().clear_period_ms();
+  auto weak_this = weak_ptr_factory_.GetWeakPtr();
+  task_runner_->PostDelayedTask(
+      [weak_this, tsid] {
+        if (weak_this)
+          weak_this->PeriodicClearIncrementalStateTask(
+              tsid, /*post_next_only=*/false);
+      },
+      clear_period_ms - static_cast<uint32_t>(base::GetWallTimeMs().count() %
+                                              clear_period_ms));
+
+  if (post_next_only)
+    return;
+
+  PERFETTO_DLOG(
+      "Performing periodic incremental state clear for trace session %" PRIu64,
+      tsid);
+
+  // Queue the IPCs to producers with active data sources that opted in.
+  std::map<ProducerID, std::vector<DataSourceInstanceID>> clear_map;
+  for (const auto& kv : tracing_session->data_source_instances) {
+    ProducerID producer_id = kv.first;
+    const DataSourceInstance& data_source = kv.second;
+    if (data_source.handles_incremental_state_clear)
+      clear_map[producer_id].push_back(data_source.instance_id);
+  }
+
+  for (const auto& kv : clear_map) {
+    ProducerID producer_id = kv.first;
+    const std::vector<DataSourceInstanceID>& data_sources = kv.second;
+    ProducerEndpointImpl* producer = GetProducer(producer_id);
+    if (!producer) {
+      PERFETTO_DFATAL("Producer does not exist.");
+      continue;
+    }
+    producer->ClearIncrementalState(data_sources);
+  }
+}
+
+// Note: when this is called to write into a file passed when starting tracing
+// |consumer| will be == nullptr (as opposite to the case of a consumer asking
+// to send the trace data back over IPC).
+bool TracingServiceImpl::ReadBuffers(TracingSessionID tsid,
+                                     ConsumerEndpointImpl* consumer) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  TracingSession* tracing_session = GetTracingSession(tsid);
+  if (!tracing_session) {
+    // This will be hit systematically from the PostDelayedTask when directly
+    // writing into the file (in which case consumer == nullptr). Suppress the
+    // log in this case as it's just spam.
+    if (consumer) {
+      PERFETTO_DLOG("Cannot ReadBuffers(): no tracing session is active");
+    }
+    return false;
+  }
+
+  // When a tracing session is waiting for a trigger it is considered empty. If
+  // a tracing session finishes and moves into DISABLED without ever receiving a
+  // trigger the trace should never return any data. This includes the synthetic
+  // packets like TraceConfig and Clock snapshots. So we bail out early and let
+  // the consumer know there is no data.
+  if (!tracing_session->config.trigger_config().triggers().empty() &&
+      tracing_session->received_triggers.empty() &&
+      !tracing_session->seized_for_bugreport) {
+    PERFETTO_DLOG(
+        "ReadBuffers(): tracing session has not received a trigger yet.");
+    return false;
+  }
+
+  // This can happen if the file is closed by a previous task because it reaches
+  // |max_file_size_bytes|.
+  if (!tracing_session->write_into_file && !consumer)
+    return false;
+
+  if (tracing_session->write_into_file && consumer) {
+    // If the consumer enabled tracing and asked to save the contents into the
+    // passed file makes little sense to also try to read the buffers over IPC,
+    // as that would just steal data from the periodic draining task.
+    PERFETTO_ELOG("Consumer trying to read from write_into_file session.");
+    return false;
+  }
+
+  std::vector<TracePacket> packets;
+  packets.reserve(1024);  // Just an educated guess to avoid trivial expansions.
+
+  // If a bugreport request happened and the trace was stolen for that, give
+  // an empty trace with a clear signal to the consumer. This deals only with
+  // the case of readback-from-IPC. A similar code-path deals with the
+  // write_into_file case in MaybeSaveTraceForBugreport().
+  if (tracing_session->seized_for_bugreport && consumer) {
+    if (!tracing_session->config.builtin_data_sources()
+             .disable_service_events()) {
+      EmitSeizedForBugreportLifecycleEvent(&packets);
+    }
+    EmitLifecycleEvents(tracing_session, &packets);
+    consumer->consumer_->OnTraceData(std::move(packets), /*has_more=*/false);
+    return true;
+  }
+
+  if (!tracing_session->initial_clock_snapshot.empty()) {
+    EmitClockSnapshot(tracing_session,
+                      std::move(tracing_session->initial_clock_snapshot),
+                      &packets);
+  }
+
+  for (auto& snapshot : tracing_session->clock_snapshot_ring_buffer) {
+    PERFETTO_DCHECK(!snapshot.empty());
+    EmitClockSnapshot(tracing_session, std::move(snapshot), &packets);
+  }
+  tracing_session->clock_snapshot_ring_buffer.clear();
+
+  if (tracing_session->should_emit_sync_marker) {
+    EmitSyncMarker(&packets);
+    tracing_session->should_emit_sync_marker = false;
+  }
+
+  if (!tracing_session->config.builtin_data_sources().disable_trace_config()) {
+    MaybeEmitTraceConfig(tracing_session, &packets);
+    MaybeEmitReceivedTriggers(tracing_session, &packets);
+  }
+  if (!tracing_session->config.builtin_data_sources().disable_system_info())
+    MaybeEmitSystemInfo(tracing_session, &packets);
+
+  // Note that in the proto comment, we guarantee that the tracing_started
+  // lifecycle event will be emitted before any data packets so make sure to
+  // keep this before reading the tracing buffers.
+  if (!tracing_session->config.builtin_data_sources().disable_service_events())
+    EmitLifecycleEvents(tracing_session, &packets);
+
+  size_t packets_bytes = 0;  // SUM(slice.size() for each slice in |packets|).
+  size_t total_slices = 0;   // SUM(#slices in |packets|).
+
+  // Add up size for packets added by the Maybe* calls above.
+  for (const TracePacket& packet : packets) {
+    packets_bytes += packet.size();
+    total_slices += packet.slices().size();
+  }
+
+  // This is a rough threshold to determine how much to read from the buffer in
+  // each task. This is to avoid executing a single huge sending task for too
+  // long and risk to hit the watchdog. This is *not* an upper bound: we just
+  // stop accumulating new packets and PostTask *after* we cross this threshold.
+  // This constant essentially balances the PostTask and IPC overhead vs the
+  // responsiveness of the service. An extremely small value will cause one IPC
+  // and one PostTask for each slice but will keep the service extremely
+  // responsive. An extremely large value will batch the send for the full
+  // buffer in one large task, will hit the blocking send() once the socket
+  // buffers are full and hang the service for a bit (until the consumer
+  // catches up).
+  static constexpr size_t kApproxBytesPerTask = 32768;
+  bool did_hit_threshold = false;
+
+  // TODO(primiano): Extend the ReadBuffers API to allow reading only some
+  // buffers, not all of them in one go.
+  for (size_t buf_idx = 0;
+       buf_idx < tracing_session->num_buffers() && !did_hit_threshold;
+       buf_idx++) {
+    auto tbuf_iter = buffers_.find(tracing_session->buffers_index[buf_idx]);
+    if (tbuf_iter == buffers_.end()) {
+      PERFETTO_DFATAL("Buffer not found.");
+      continue;
+    }
+    TraceBuffer& tbuf = *tbuf_iter->second;
+    tbuf.BeginRead();
+    while (!did_hit_threshold) {
+      TracePacket packet;
+      TraceBuffer::PacketSequenceProperties sequence_properties{};
+      bool previous_packet_dropped;
+      if (!tbuf.ReadNextTracePacket(&packet, &sequence_properties,
+                                    &previous_packet_dropped)) {
+        break;
+      }
+      PERFETTO_DCHECK(sequence_properties.producer_id_trusted != 0);
+      PERFETTO_DCHECK(sequence_properties.writer_id != 0);
+      PERFETTO_DCHECK(sequence_properties.producer_uid_trusted != kInvalidUid);
+      PERFETTO_DCHECK(packet.size() > 0);
+      if (!PacketStreamValidator::Validate(packet.slices())) {
+        tracing_session->invalid_packets++;
+        PERFETTO_DLOG("Dropping invalid packet");
+        continue;
+      }
+
+      // Append a slice with the trusted field data. This can't be spoofed
+      // because above we validated that the existing slices don't contain any
+      // trusted fields. For added safety we append instead of prepending
+      // because according to protobuf semantics, if the same field is
+      // encountered multiple times the last instance takes priority. Note that
+      // truncated packets are also rejected, so the producer can't give us a
+      // partial packet (e.g., a truncated string) which only becomes valid when
+      // the trusted data is appended here.
+      Slice slice = Slice::Allocate(32);
+      protozero::StaticBuffered<protos::pbzero::TracePacket> trusted_packet(
+          slice.own_data(), slice.size);
+      trusted_packet->set_trusted_uid(
+          static_cast<int32_t>(sequence_properties.producer_uid_trusted));
+      trusted_packet->set_trusted_packet_sequence_id(
+          tracing_session->GetPacketSequenceID(
+              sequence_properties.producer_id_trusted,
+              sequence_properties.writer_id));
+      if (previous_packet_dropped)
+        trusted_packet->set_previous_packet_dropped(previous_packet_dropped);
+      slice.size = trusted_packet.Finalize();
+      packet.AddSlice(std::move(slice));
+
+      // Append the packet (inclusive of the trusted uid) to |packets|.
+      packets_bytes += packet.size();
+      total_slices += packet.slices().size();
+      did_hit_threshold = packets_bytes >= kApproxBytesPerTask &&
+                          !tracing_session->write_into_file;
+      packets.emplace_back(std::move(packet));
+    }  // for(packets...)
+  }    // for(buffers...)
+
+  const bool has_more = did_hit_threshold;
+
+  size_t prev_packets_size = packets.size();
+  if (!tracing_session->config.builtin_data_sources()
+           .disable_service_events()) {
+    // We don't bother snapshotting clocks here because we wouldn't be able to
+    // emit it and we shouldn't have significant drift from the last snapshot in
+    // any case.
+    SnapshotLifecyleEvent(tracing_session,
+                          protos::pbzero::TracingServiceEvent::
+                              kReadTracingBuffersCompletedFieldNumber,
+                          false /* snapshot_clocks */);
+    EmitLifecycleEvents(tracing_session, &packets);
+  }
+
+  // Only emit the stats when there is no more trace data is available to read.
+  // That way, any problems that occur while reading from the buffers are
+  // reflected in the emitted stats. This is particularly important for use
+  // cases where ReadBuffers is only ever called after the tracing session is
+  // stopped.
+  if (!has_more && tracing_session->should_emit_stats) {
+    EmitStats(tracing_session, &packets);
+    tracing_session->should_emit_stats = false;
+  }
+
+  // Add sizes of packets emitted by the EmitLifecycleEvents + EmitStats.
+  for (size_t i = prev_packets_size; i < packets.size(); ++i) {
+    packets_bytes += packets[i].size();
+    total_slices += packets[i].slices().size();
+  }
+
+  // +-------------------------------------------------------------------------+
+  // | NO MORE CHANGES TO |packets| AFTER THIS POINT.                          |
+  // +-------------------------------------------------------------------------+
+
+  // If the tracing session specified a filter, run all packets through the
+  // filter and replace them with the filter results.
+  // The process below mantains the cardinality of input packets. Even if an
+  // entire packet is filtered out, we emit a zero-sized TracePacket proto. That
+  // makes debugging and reasoning about the trace stats easier.
+  // This place swaps the contents of each |packets| entry in place.
+  if (tracing_session->trace_filter) {
+    auto& trace_filter = *tracing_session->trace_filter;
+    // The filter root shoud be reset from protos.Trace to protos.TracePacket
+    // by the earlier call to SetFilterRoot() in EnableTracing().
+    PERFETTO_DCHECK(trace_filter.root_msg_index() != 0);
+    std::vector<protozero::MessageFilter::InputSlice> filter_input;
+    for (auto it = packets.begin(); it != packets.end(); ++it) {
+      const auto& packet_slices = it->slices();
+      filter_input.clear();
+      filter_input.resize(packet_slices.size());
+      ++tracing_session->filter_input_packets;
+      tracing_session->filter_input_bytes += it->size();
+      for (size_t i = 0; i < packet_slices.size(); ++i)
+        filter_input[i] = {packet_slices[i].start, packet_slices[i].size};
+      auto filtered_packet = trace_filter.FilterMessageFragments(
+          &filter_input[0], filter_input.size());
+
+      // Replace the packet in-place with the filtered one (unless failed).
+      *it = TracePacket();
+      if (filtered_packet.error) {
+        ++tracing_session->filter_errors;
+        PERFETTO_DLOG("Trace packet filtering failed @ packet %" PRIu64,
+                      tracing_session->filter_input_packets);
+        continue;
+      }
+      tracing_session->filter_output_bytes += filtered_packet.size;
+      it->AddSlice(Slice::TakeOwnership(std::move(filtered_packet.data),
+                                        filtered_packet.size));
+
+    }  // for (packet)
+  }    // if (trace_filter)
+
+  // If the caller asked us to write into a file by setting
+  // |write_into_file| == true in the trace config, drain the packets read
+  // (if any) into the given file descriptor.
+  if (tracing_session->write_into_file) {
+    const uint64_t max_size = tracing_session->max_file_size_bytes
+                                  ? tracing_session->max_file_size_bytes
+                                  : std::numeric_limits<size_t>::max();
+
+    // When writing into a file, the file should look like a root trace.proto
+    // message. Each packet should be prepended with a proto preamble stating
+    // its field id (within trace.proto) and size. Hence the addition below.
+    const size_t max_iovecs = total_slices + packets.size();
+
+    size_t num_iovecs = 0;
+    bool stop_writing_into_file = tracing_session->write_period_ms == 0;
+    std::unique_ptr<struct iovec[]> iovecs(new struct iovec[max_iovecs]);
+    size_t num_iovecs_at_last_packet = 0;
+    uint64_t bytes_about_to_be_written = 0;
+    for (TracePacket& packet : packets) {
+      std::tie(iovecs[num_iovecs].iov_base, iovecs[num_iovecs].iov_len) =
+          packet.GetProtoPreamble();
+      bytes_about_to_be_written += iovecs[num_iovecs].iov_len;
+      num_iovecs++;
+      for (const Slice& slice : packet.slices()) {
+        // writev() doesn't change the passed pointer. However, struct iovec
+        // take a non-const ptr because it's the same struct used by readv().
+        // Hence the const_cast here.
+        char* start = static_cast<char*>(const_cast<void*>(slice.start));
+        bytes_about_to_be_written += slice.size;
+        iovecs[num_iovecs++] = {start, slice.size};
+      }
+
+      if (tracing_session->bytes_written_into_file +
+              bytes_about_to_be_written >=
+          max_size) {
+        stop_writing_into_file = true;
+        num_iovecs = num_iovecs_at_last_packet;
+        break;
+      }
+
+      num_iovecs_at_last_packet = num_iovecs;
+    }
+    PERFETTO_DCHECK(num_iovecs <= max_iovecs);
+    int fd = *tracing_session->write_into_file;
+
+    uint64_t total_wr_size = 0;
+
+    // writev() can take at most IOV_MAX entries per call. Batch them.
+    constexpr size_t kIOVMax = IOV_MAX;
+    for (size_t i = 0; i < num_iovecs; i += kIOVMax) {
+      int iov_batch_size = static_cast<int>(std::min(num_iovecs - i, kIOVMax));
+      ssize_t wr_size = PERFETTO_EINTR(writev(fd, &iovecs[i], iov_batch_size));
+      if (wr_size <= 0) {
+        PERFETTO_PLOG("writev() failed");
+        stop_writing_into_file = true;
+        break;
+      }
+      total_wr_size += static_cast<size_t>(wr_size);
+    }
+
+    tracing_session->bytes_written_into_file += total_wr_size;
+
+    PERFETTO_DLOG("Draining into file, written: %" PRIu64 " KB, stop: %d",
+                  (total_wr_size + 1023) / 1024, stop_writing_into_file);
+    if (stop_writing_into_file) {
+      // Ensure all data was written to the file before we close it.
+      base::FlushFile(fd);
+      tracing_session->write_into_file.reset();
+      tracing_session->write_period_ms = 0;
+      if (tracing_session->state == TracingSession::STARTED)
+        DisableTracing(tsid);
+      return true;
+    }
+
+    auto weak_this = weak_ptr_factory_.GetWeakPtr();
+    task_runner_->PostDelayedTask(
+        [weak_this, tsid] {
+          if (weak_this)
+            weak_this->ReadBuffers(tsid, nullptr);
+        },
+        tracing_session->delay_to_next_write_period_ms());
+    return true;
+  }  // if (tracing_session->write_into_file)
+
+  if (has_more) {
+    auto weak_consumer = consumer->weak_ptr_factory_.GetWeakPtr();
+    auto weak_this = weak_ptr_factory_.GetWeakPtr();
+    task_runner_->PostTask([weak_this, weak_consumer, tsid] {
+      if (!weak_this || !weak_consumer)
+        return;
+      weak_this->ReadBuffers(tsid, weak_consumer.get());
+    });
+  }
+
+  // Keep this as tail call, just in case the consumer re-enters.
+  consumer->consumer_->OnTraceData(std::move(packets), has_more);
+  return true;
+}
+
+void TracingServiceImpl::FreeBuffers(TracingSessionID tsid) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  PERFETTO_DLOG("Freeing buffers for session %" PRIu64, tsid);
+  TracingSession* tracing_session = GetTracingSession(tsid);
+  if (!tracing_session) {
+    PERFETTO_DLOG("FreeBuffers() failed, invalid session ID %" PRIu64, tsid);
+    return;  // TODO(primiano): signal failure?
+  }
+  DisableTracing(tsid, /*disable_immediately=*/true);
+
+  PERFETTO_DCHECK(tracing_session->AllDataSourceInstancesStopped());
+  tracing_session->data_source_instances.clear();
+
+  for (auto& producer_entry : producers_) {
+    ProducerEndpointImpl* producer = producer_entry.second;
+    producer->OnFreeBuffers(tracing_session->buffers_index);
+  }
+
+  for (BufferID buffer_id : tracing_session->buffers_index) {
+    buffer_ids_.Free(buffer_id);
+    PERFETTO_DCHECK(buffers_.count(buffer_id) == 1);
+    buffers_.erase(buffer_id);
+  }
+  bool notify_traceur = tracing_session->config.notify_traceur();
+  bool is_long_trace =
+      (tracing_session->config.write_into_file() &&
+       tracing_session->config.file_write_period_ms() < kMillisPerDay);
+  bool seized_for_bugreport = tracing_session->seized_for_bugreport;
+  tracing_sessions_.erase(tsid);
+  tracing_session = nullptr;
+  UpdateMemoryGuardrail();
+
+  PERFETTO_LOG("Tracing session %" PRIu64 " ended, total sessions:%zu", tsid,
+               tracing_sessions_.size());
+
+#if PERFETTO_BUILDFLAG(PERFETTO_ANDROID_BUILD) && \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+  if (notify_traceur && (seized_for_bugreport || is_long_trace)) {
+    PERFETTO_LAZY_LOAD(android_internal::NotifyTraceSessionEnded, notify_fn);
+    if (!notify_fn || !notify_fn(seized_for_bugreport))
+      PERFETTO_ELOG("Failed to notify Traceur long tracing has ended");
+  }
+#else
+  base::ignore_result(notify_traceur);
+  base::ignore_result(is_long_trace);
+  base::ignore_result(seized_for_bugreport);
+#endif
+}
+
+void TracingServiceImpl::RegisterDataSource(ProducerID producer_id,
+                                            const DataSourceDescriptor& desc) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  PERFETTO_DLOG("Producer %" PRIu16 " registered data source \"%s\"",
+                producer_id, desc.name().c_str());
+
+  PERFETTO_DCHECK(!desc.name().empty());
+  auto reg_ds = data_sources_.emplace(desc.name(),
+                                      RegisteredDataSource{producer_id, desc});
+
+  // If there are existing tracing sessions, we need to check if the new
+  // data source is enabled by any of them.
+  if (tracing_sessions_.empty())
+    return;
+
+  ProducerEndpointImpl* producer = GetProducer(producer_id);
+  if (!producer) {
+    PERFETTO_DFATAL("Producer not found.");
+    return;
+  }
+
+  for (auto& iter : tracing_sessions_) {
+    TracingSession& tracing_session = iter.second;
+    if (tracing_session.state != TracingSession::STARTED &&
+        tracing_session.state != TracingSession::CONFIGURED) {
+      continue;
+    }
+
+    TraceConfig::ProducerConfig producer_config;
+    for (auto& config : tracing_session.config.producers()) {
+      if (producer->name_ == config.producer_name()) {
+        producer_config = config;
+        break;
+      }
+    }
+    for (const TraceConfig::DataSource& cfg_data_source :
+         tracing_session.config.data_sources()) {
+      if (cfg_data_source.config().name() != desc.name())
+        continue;
+      DataSourceInstance* ds_inst = SetupDataSource(
+          cfg_data_source, producer_config, reg_ds->second, &tracing_session);
+      if (ds_inst && tracing_session.state == TracingSession::STARTED)
+        StartDataSourceInstance(producer, &tracing_session, ds_inst);
+    }
+  }
+}
+
+void TracingServiceImpl::StopDataSourceInstance(ProducerEndpointImpl* producer,
+                                                TracingSession* tracing_session,
+                                                DataSourceInstance* instance,
+                                                bool disable_immediately) {
+  const DataSourceInstanceID ds_inst_id = instance->instance_id;
+  if (instance->will_notify_on_stop && !disable_immediately) {
+    instance->state = DataSourceInstance::STOPPING;
+  } else {
+    instance->state = DataSourceInstance::STOPPED;
+  }
+  if (tracing_session->consumer_maybe_null) {
+    tracing_session->consumer_maybe_null->OnDataSourceInstanceStateChange(
+        *producer, *instance);
+  }
+  producer->StopDataSource(ds_inst_id);
+}
+
+void TracingServiceImpl::UnregisterDataSource(ProducerID producer_id,
+                                              const std::string& name) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  PERFETTO_DLOG("Producer %" PRIu16 " unregistered data source \"%s\"",
+                producer_id, name.c_str());
+  PERFETTO_CHECK(producer_id);
+  ProducerEndpointImpl* producer = GetProducer(producer_id);
+  PERFETTO_DCHECK(producer);
+  for (auto& kv : tracing_sessions_) {
+    auto& ds_instances = kv.second.data_source_instances;
+    bool removed = false;
+    for (auto it = ds_instances.begin(); it != ds_instances.end();) {
+      if (it->first == producer_id && it->second.data_source_name == name) {
+        DataSourceInstanceID ds_inst_id = it->second.instance_id;
+        if (it->second.state != DataSourceInstance::STOPPED) {
+          if (it->second.state != DataSourceInstance::STOPPING) {
+            StopDataSourceInstance(producer, &kv.second, &it->second,
+                                   /* disable_immediately = */ false);
+          }
+
+          // Mark the instance as stopped immediately, since we are
+          // unregistering it below.
+          //
+          //  The StopDataSourceInstance above might have set the state to
+          //  STOPPING so this condition isn't an else.
+          if (it->second.state == DataSourceInstance::STOPPING)
+            NotifyDataSourceStopped(producer_id, ds_inst_id);
+        }
+        it = ds_instances.erase(it);
+        removed = true;
+      } else {
+        ++it;
+      }
+    }  // for (data_source_instances)
+    if (removed)
+      MaybeNotifyAllDataSourcesStarted(&kv.second);
+  }  // for (tracing_session)
+
+  for (auto it = data_sources_.begin(); it != data_sources_.end(); ++it) {
+    if (it->second.producer_id == producer_id &&
+        it->second.descriptor.name() == name) {
+      data_sources_.erase(it);
+      return;
+    }
+  }
+
+  PERFETTO_DFATAL(
+      "Tried to unregister a non-existent data source \"%s\" for "
+      "producer %" PRIu16,
+      name.c_str(), producer_id);
+}
+
+TracingServiceImpl::DataSourceInstance* TracingServiceImpl::SetupDataSource(
+    const TraceConfig::DataSource& cfg_data_source,
+    const TraceConfig::ProducerConfig& producer_config,
+    const RegisteredDataSource& data_source,
+    TracingSession* tracing_session) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  ProducerEndpointImpl* producer = GetProducer(data_source.producer_id);
+  PERFETTO_DCHECK(producer);
+  // An existing producer that is not ftrace could have registered itself as
+  // ftrace, we must not enable it in that case.
+  if (lockdown_mode_ && producer->uid_ != uid_) {
+    PERFETTO_DLOG("Lockdown mode: not enabling producer %hu", producer->id_);
+    return nullptr;
+  }
+  // TODO(primiano): Add tests for registration ordering (data sources vs
+  // consumers).
+  if (!NameMatchesFilter(producer->name_,
+                         cfg_data_source.producer_name_filter(),
+                         cfg_data_source.producer_name_regex_filter())) {
+    PERFETTO_DLOG("Data source: %s is filtered out for producer: %s",
+                  cfg_data_source.config().name().c_str(),
+                  producer->name_.c_str());
+    return nullptr;
+  }
+
+  auto relative_buffer_id = cfg_data_source.config().target_buffer();
+  if (relative_buffer_id >= tracing_session->num_buffers()) {
+    PERFETTO_LOG(
+        "The TraceConfig for DataSource %s specified a target_buffer out of "
+        "bound (%d). Skipping it.",
+        cfg_data_source.config().name().c_str(), relative_buffer_id);
+    return nullptr;
+  }
+
+  // Create a copy of the DataSourceConfig specified in the trace config. This
+  // will be passed to the producer after translating the |target_buffer| id.
+  // The |target_buffer| parameter passed by the consumer in the trace config is
+  // relative to the buffers declared in the same trace config. This has to be
+  // translated to the global BufferID before passing it to the producers, which
+  // don't know anything about tracing sessions and consumers.
+
+  DataSourceInstanceID inst_id = ++last_data_source_instance_id_;
+  auto insert_iter = tracing_session->data_source_instances.emplace(
+      std::piecewise_construct,  //
+      std::forward_as_tuple(producer->id_),
+      std::forward_as_tuple(
+          inst_id,
+          cfg_data_source.config(),  //  Deliberate copy.
+          data_source.descriptor.name(),
+          data_source.descriptor.will_notify_on_start(),
+          data_source.descriptor.will_notify_on_stop(),
+          data_source.descriptor.handles_incremental_state_clear()));
+  DataSourceInstance* ds_instance = &insert_iter->second;
+
+  // New data source instance starts out in CONFIGURED state.
+  if (tracing_session->consumer_maybe_null) {
+    tracing_session->consumer_maybe_null->OnDataSourceInstanceStateChange(
+        *producer, *ds_instance);
+  }
+
+  DataSourceConfig& ds_config = ds_instance->config;
+  ds_config.set_trace_duration_ms(tracing_session->config.duration_ms());
+  ds_config.set_stop_timeout_ms(tracing_session->data_source_stop_timeout_ms());
+  ds_config.set_enable_extra_guardrails(
+      tracing_session->config.enable_extra_guardrails());
+  if (tracing_session->consumer_uid == 1066 /* AID_STATSD */ &&
+      tracing_session->config.statsd_metadata().triggering_config_uid() !=
+          2000 /* AID_SHELL */
+      && tracing_session->config.statsd_metadata().triggering_config_uid() !=
+             0 /* AID_ROOT */) {
+    // StatsD can be triggered either by shell, root or an app that has DUMP and
+    // USAGE_STATS permission. When triggered by shell or root, we do not want
+    // to consider the trace a trusted system trace, as it was initiated by the
+    // user. Otherwise, it has to come from an app with DUMP and
+    // PACKAGE_USAGE_STATS, which has to be preinstalled and trusted by the
+    // system.
+    // Check for shell / root: https://bit.ly/3b7oZNi
+    // Check for DUMP or PACKAGE_USAGE_STATS: https://bit.ly/3ep0NrR
+    ds_config.set_session_initiator(
+        DataSourceConfig::SESSION_INITIATOR_TRUSTED_SYSTEM);
+  } else {
+    // Unset in case the consumer set it.
+    // We need to be able to trust this field.
+    ds_config.set_session_initiator(
+        DataSourceConfig::SESSION_INITIATOR_UNSPECIFIED);
+  }
+  ds_config.set_tracing_session_id(tracing_session->id);
+  BufferID global_id = tracing_session->buffers_index[relative_buffer_id];
+  PERFETTO_DCHECK(global_id);
+  ds_config.set_target_buffer(global_id);
+
+  PERFETTO_DLOG("Setting up data source %s with target buffer %" PRIu16,
+                ds_config.name().c_str(), global_id);
+  if (!producer->shared_memory()) {
+    // Determine the SMB page size. Must be an integer multiple of 4k.
+    // As for the SMB size below, the decision tree is as follows:
+    // 1. Give priority to what is defined in the trace config.
+    // 2. If unset give priority to the hint passed by the producer.
+    // 3. Keep within bounds and ensure it's a multiple of 4k.
+    size_t page_size = producer_config.page_size_kb() * 1024;
+    if (page_size == 0)
+      page_size = producer->shmem_page_size_hint_bytes_;
+
+    // Determine the SMB size. Must be an integer multiple of the SMB page size.
+    // The decision tree is as follows:
+    // 1. Give priority to what defined in the trace config.
+    // 2. If unset give priority to the hint passed by the producer.
+    // 3. Keep within bounds and ensure it's a multiple of the page size.
+    size_t shm_size = producer_config.shm_size_kb() * 1024;
+    if (shm_size == 0)
+      shm_size = producer->shmem_size_hint_bytes_;
+
+    auto valid_sizes = EnsureValidShmSizes(shm_size, page_size);
+    if (valid_sizes != std::tie(shm_size, page_size)) {
+      PERFETTO_DLOG(
+          "Invalid configured SMB sizes: shm_size %zu page_size %zu. Falling "
+          "back to shm_size %zu page_size %zu.",
+          shm_size, page_size, std::get<0>(valid_sizes),
+          std::get<1>(valid_sizes));
+    }
+    std::tie(shm_size, page_size) = valid_sizes;
+
+    // TODO(primiano): right now Create() will suicide in case of OOM if the
+    // mmap fails. We should instead gracefully fail the request and tell the
+    // client to go away.
+    PERFETTO_DLOG("Creating SMB of %zu KB for producer \"%s\"", shm_size / 1024,
+                  producer->name_.c_str());
+    auto shared_memory = shm_factory_->CreateSharedMemory(shm_size);
+    producer->SetupSharedMemory(std::move(shared_memory), page_size,
+                                /*provided_by_producer=*/false);
+  }
+  producer->SetupDataSource(inst_id, ds_config);
+  return ds_instance;
+}
+
+// Note: all the fields % *_trusted ones are untrusted, as in, the Producer
+// might be lying / returning garbage contents. |src| and |size| can be trusted
+// in terms of being a valid pointer, but not the contents.
+void TracingServiceImpl::CopyProducerPageIntoLogBuffer(
+    ProducerID producer_id_trusted,
+    uid_t producer_uid_trusted,
+    WriterID writer_id,
+    ChunkID chunk_id,
+    BufferID buffer_id,
+    uint16_t num_fragments,
+    uint8_t chunk_flags,
+    bool chunk_complete,
+    const uint8_t* src,
+    size_t size) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+
+  ProducerEndpointImpl* producer = GetProducer(producer_id_trusted);
+  if (!producer) {
+    PERFETTO_DFATAL("Producer not found.");
+    chunks_discarded_++;
+    return;
+  }
+
+  TraceBuffer* buf = GetBufferByID(buffer_id);
+  if (!buf) {
+    PERFETTO_DLOG("Could not find target buffer %" PRIu16
+                  " for producer %" PRIu16,
+                  buffer_id, producer_id_trusted);
+    chunks_discarded_++;
+    return;
+  }
+
+  // Verify that the producer is actually allowed to write into the target
+  // buffer specified in the request. This prevents a malicious producer from
+  // injecting data into a log buffer that belongs to a tracing session the
+  // producer is not part of.
+  if (!producer->is_allowed_target_buffer(buffer_id)) {
+    PERFETTO_ELOG("Producer %" PRIu16
+                  " tried to write into forbidden target buffer %" PRIu16,
+                  producer_id_trusted, buffer_id);
+    PERFETTO_DFATAL("Forbidden target buffer");
+    chunks_discarded_++;
+    return;
+  }
+
+  // If the writer was registered by the producer, it should only write into the
+  // buffer it was registered with.
+  base::Optional<BufferID> associated_buffer =
+      producer->buffer_id_for_writer(writer_id);
+  if (associated_buffer && *associated_buffer != buffer_id) {
+    PERFETTO_ELOG("Writer %" PRIu16 " of producer %" PRIu16
+                  " was registered to write into target buffer %" PRIu16
+                  ", but tried to write into buffer %" PRIu16,
+                  writer_id, producer_id_trusted, *associated_buffer,
+                  buffer_id);
+    PERFETTO_DFATAL("Wrong target buffer");
+    chunks_discarded_++;
+    return;
+  }
+
+  buf->CopyChunkUntrusted(producer_id_trusted, producer_uid_trusted, writer_id,
+                          chunk_id, num_fragments, chunk_flags, chunk_complete,
+                          src, size);
+}
+
+void TracingServiceImpl::ApplyChunkPatches(
+    ProducerID producer_id_trusted,
+    const std::vector<CommitDataRequest::ChunkToPatch>& chunks_to_patch) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+
+  for (const auto& chunk : chunks_to_patch) {
+    const ChunkID chunk_id = static_cast<ChunkID>(chunk.chunk_id());
+    const WriterID writer_id = static_cast<WriterID>(chunk.writer_id());
+    TraceBuffer* buf =
+        GetBufferByID(static_cast<BufferID>(chunk.target_buffer()));
+    static_assert(std::numeric_limits<ChunkID>::max() == kMaxChunkID,
+                  "Add a '|| chunk_id > kMaxChunkID' below if this fails");
+    if (!writer_id || writer_id > kMaxWriterID || !buf) {
+      // This can genuinely happen when the trace is stopped. The producers
+      // might see the stop signal with some delay and try to keep sending
+      // patches left soon after.
+      PERFETTO_DLOG(
+          "Received invalid chunks_to_patch request from Producer: %" PRIu16
+          ", BufferID: %" PRIu32 " ChunkdID: %" PRIu32 " WriterID: %" PRIu16,
+          producer_id_trusted, chunk.target_buffer(), chunk_id, writer_id);
+      patches_discarded_ += static_cast<uint64_t>(chunk.patches_size());
+      continue;
+    }
+
+    // Note, there's no need to validate that the producer is allowed to write
+    // to the specified buffer ID (or that it's the correct buffer ID for a
+    // registered TraceWriter). That's because TraceBuffer uses the producer ID
+    // and writer ID to look up the chunk to patch. If the producer specifies an
+    // incorrect buffer, this lookup will fail and TraceBuffer will ignore the
+    // patches. Because the producer ID is trusted, there's also no way for a
+    // malicious producer to patch another producer's data.
+
+    // Speculate on the fact that there are going to be a limited amount of
+    // patches per request, so we can allocate the |patches| array on the stack.
+    std::array<TraceBuffer::Patch, 1024> patches;  // Uninitialized.
+    if (chunk.patches().size() > patches.size()) {
+      PERFETTO_ELOG("Too many patches (%zu) batched in the same request",
+                    patches.size());
+      PERFETTO_DFATAL("Too many patches");
+      patches_discarded_ += static_cast<uint64_t>(chunk.patches_size());
+      continue;
+    }
+
+    size_t i = 0;
+    for (const auto& patch : chunk.patches()) {
+      const std::string& patch_data = patch.data();
+      if (patch_data.size() != patches[i].data.size()) {
+        PERFETTO_ELOG("Received patch from producer: %" PRIu16
+                      " of unexpected size %zu",
+                      producer_id_trusted, patch_data.size());
+        patches_discarded_++;
+        continue;
+      }
+      patches[i].offset_untrusted = patch.offset();
+      memcpy(&patches[i].data[0], patch_data.data(), patches[i].data.size());
+      i++;
+    }
+    buf->TryPatchChunkContents(producer_id_trusted, writer_id, chunk_id,
+                               &patches[0], i, chunk.has_more_patches());
+  }
+}
+
+TracingServiceImpl::TracingSession* TracingServiceImpl::GetDetachedSession(
+    uid_t uid,
+    const std::string& key) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  for (auto& kv : tracing_sessions_) {
+    TracingSession* session = &kv.second;
+    if (session->consumer_uid == uid && session->detach_key == key) {
+      PERFETTO_DCHECK(session->consumer_maybe_null == nullptr);
+      return session;
+    }
+  }
+  return nullptr;
+}
+
+TracingServiceImpl::TracingSession* TracingServiceImpl::GetTracingSession(
+    TracingSessionID tsid) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  auto it = tsid ? tracing_sessions_.find(tsid) : tracing_sessions_.end();
+  if (it == tracing_sessions_.end())
+    return nullptr;
+  return &it->second;
+}
+
+ProducerID TracingServiceImpl::GetNextProducerID() {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  PERFETTO_CHECK(producers_.size() < kMaxProducerID);
+  do {
+    ++last_producer_id_;
+  } while (producers_.count(last_producer_id_) || last_producer_id_ == 0);
+  PERFETTO_DCHECK(last_producer_id_ > 0 && last_producer_id_ <= kMaxProducerID);
+  return last_producer_id_;
+}
+
+TraceBuffer* TracingServiceImpl::GetBufferByID(BufferID buffer_id) {
+  auto buf_iter = buffers_.find(buffer_id);
+  if (buf_iter == buffers_.end())
+    return nullptr;
+  return &*buf_iter->second;
+}
+
+void TracingServiceImpl::OnStartTriggersTimeout(TracingSessionID tsid) {
+  // Skip entirely the flush if the trace session doesn't exist anymore.
+  // This is to prevent misleading error messages to be logged.
+  //
+  // if the trace has started from the trigger we rely on
+  // the |stop_delay_ms| from the trigger so don't flush and
+  // disable if we've moved beyond a CONFIGURED state
+  auto* tracing_session_ptr = GetTracingSession(tsid);
+  if (tracing_session_ptr &&
+      tracing_session_ptr->state == TracingSession::CONFIGURED) {
+    PERFETTO_DLOG("Disabling TracingSession %" PRIu64
+                  " since no triggers activated.",
+                  tsid);
+    // No data should be returned from ReadBuffers() regardless of if we
+    // call FreeBuffers() or DisableTracing(). This is because in
+    // STOP_TRACING we need this promise in either case, and using
+    // DisableTracing() allows a graceful shutdown. Consumers can follow
+    // their normal path and check the buffers through ReadBuffers() and
+    // the code won't hang because the tracing session will still be
+    // alive just disabled.
+    DisableTracing(tsid);
+  }
+}
+
+void TracingServiceImpl::UpdateMemoryGuardrail() {
+#if PERFETTO_BUILDFLAG(PERFETTO_WATCHDOG)
+  uint64_t total_buffer_bytes = 0;
+
+  // Sum up all the shared memory buffers.
+  for (const auto& id_to_producer : producers_) {
+    if (id_to_producer.second->shared_memory())
+      total_buffer_bytes += id_to_producer.second->shared_memory()->size();
+  }
+
+  // Sum up all the trace buffers.
+  for (const auto& id_to_buffer : buffers_) {
+    total_buffer_bytes += id_to_buffer.second->size();
+  }
+
+  // Set the guard rail to 32MB + the sum of all the buffers over a 30 second
+  // interval.
+  uint64_t guardrail = base::kWatchdogDefaultMemorySlack + total_buffer_bytes;
+  base::Watchdog::GetInstance()->SetMemoryLimit(guardrail, 30 * 1000);
+#endif
+}
+
+void TracingServiceImpl::PeriodicSnapshotTask(TracingSessionID tsid) {
+  auto* tracing_session = GetTracingSession(tsid);
+  if (!tracing_session)
+    return;
+  if (tracing_session->state != TracingSession::STARTED)
+    return;
+  tracing_session->should_emit_sync_marker = true;
+  tracing_session->should_emit_stats = true;
+  MaybeSnapshotClocksIntoRingBuffer(tracing_session);
+}
+
+void TracingServiceImpl::SnapshotLifecyleEvent(TracingSession* tracing_session,
+                                               uint32_t field_id,
+                                               bool snapshot_clocks) {
+  // field_id should be an id of a field in TracingServiceEvent.
+  auto& lifecycle_events = tracing_session->lifecycle_events;
+  auto event_it =
+      std::find_if(lifecycle_events.begin(), lifecycle_events.end(),
+                   [field_id](const TracingSession::LifecycleEvent& event) {
+                     return event.field_id == field_id;
+                   });
+
+  TracingSession::LifecycleEvent* event;
+  if (event_it == lifecycle_events.end()) {
+    lifecycle_events.emplace_back(field_id);
+    event = &lifecycle_events.back();
+  } else {
+    event = &*event_it;
+  }
+
+  // Snapshot the clocks before capturing the timestamp for the event so we can
+  // use this snapshot to resolve the event timestamp if necessary.
+  if (snapshot_clocks)
+    MaybeSnapshotClocksIntoRingBuffer(tracing_session);
+
+  // Erase before emplacing to prevent a unncessary doubling of memory if
+  // not needed.
+  if (event->timestamps.size() >= event->max_size) {
+    event->timestamps.erase_front(1 + event->timestamps.size() -
+                                  event->max_size);
+  }
+  event->timestamps.emplace_back(base::GetBootTimeNs().count());
+}
+
+void TracingServiceImpl::MaybeSnapshotClocksIntoRingBuffer(
+    TracingSession* tracing_session) {
+  if (tracing_session->config.builtin_data_sources()
+          .disable_clock_snapshotting()) {
+    return;
+  }
+
+  // We are making an explicit copy of the latest snapshot (if it exists)
+  // because SnapshotClocks reads this data and computes the drift based on its
+  // content. If the clock drift is high enough, it will update the contents of
+  // |snapshot| and return true. Otherwise, it will return false.
+  TracingSession::ClockSnapshotData snapshot =
+      tracing_session->clock_snapshot_ring_buffer.empty()
+          ? TracingSession::ClockSnapshotData()
+          : tracing_session->clock_snapshot_ring_buffer.back();
+  bool did_update = SnapshotClocks(&snapshot);
+  if (did_update) {
+    // This means clocks drifted enough since last snapshot. See the comment
+    // in SnapshotClocks.
+    auto* snapshot_buffer = &tracing_session->clock_snapshot_ring_buffer;
+
+    // Erase before emplacing to prevent a unncessary doubling of memory if
+    // not needed.
+    static constexpr uint32_t kClockSnapshotRingBufferSize = 16;
+    if (snapshot_buffer->size() >= kClockSnapshotRingBufferSize) {
+      snapshot_buffer->erase_front(1 + snapshot_buffer->size() -
+                                   kClockSnapshotRingBufferSize);
+    }
+    snapshot_buffer->emplace_back(std::move(snapshot));
+  }
+}
+
+// Returns true when the data in |snapshot_data| is updated with the new state
+// of the clocks and false otherwise.
+bool TracingServiceImpl::SnapshotClocks(
+    TracingSession::ClockSnapshotData* snapshot_data) {
+  // Minimum drift that justifies replacing a prior clock snapshot that hasn't
+  // been emitted into the trace yet (see comment below).
+  static constexpr int64_t kSignificantDriftNs = 10 * 1000 * 1000;  // 10 ms
+
+  TracingSession::ClockSnapshotData new_snapshot_data;
+
+#if !PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE) && \
+    !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) &&   \
+    !PERFETTO_BUILDFLAG(PERFETTO_OS_NACL)
+  struct {
+    clockid_t id;
+    protos::pbzero::BuiltinClock type;
+    struct timespec ts;
+  } clocks[] = {
+      {CLOCK_BOOTTIME, protos::pbzero::BUILTIN_CLOCK_BOOTTIME, {0, 0}},
+      {CLOCK_REALTIME_COARSE,
+       protos::pbzero::BUILTIN_CLOCK_REALTIME_COARSE,
+       {0, 0}},
+      {CLOCK_MONOTONIC_COARSE,
+       protos::pbzero::BUILTIN_CLOCK_MONOTONIC_COARSE,
+       {0, 0}},
+      {CLOCK_REALTIME, protos::pbzero::BUILTIN_CLOCK_REALTIME, {0, 0}},
+      {CLOCK_MONOTONIC, protos::pbzero::BUILTIN_CLOCK_MONOTONIC, {0, 0}},
+      {CLOCK_MONOTONIC_RAW,
+       protos::pbzero::BUILTIN_CLOCK_MONOTONIC_RAW,
+       {0, 0}},
+  };
+  // First snapshot all the clocks as atomically as we can.
+  for (auto& clock : clocks) {
+    if (clock_gettime(clock.id, &clock.ts) == -1)
+      PERFETTO_DLOG("clock_gettime failed for clock %d", clock.id);
+  }
+  for (auto& clock : clocks) {
+    new_snapshot_data.push_back(std::make_pair(
+        static_cast<uint32_t>(clock.type),
+        static_cast<uint64_t>(base::FromPosixTimespec(clock.ts).count())));
+  }
+#else  // OS_APPLE || OS_WIN && OS_NACL
+  auto wall_time_ns = static_cast<uint64_t>(base::GetWallTimeNs().count());
+  // The default trace clock is boot time, so we always need to emit a path to
+  // it. However since we don't actually have a boot time source on these
+  // platforms, pretend that wall time equals boot time.
+  new_snapshot_data.push_back(
+      std::make_pair(protos::pbzero::BUILTIN_CLOCK_BOOTTIME, wall_time_ns));
+  new_snapshot_data.push_back(
+      std::make_pair(protos::pbzero::BUILTIN_CLOCK_MONOTONIC, wall_time_ns));
+#endif
+
+  // If we're about to update a session's latest clock snapshot that hasn't been
+  // emitted into the trace yet, check whether the clocks have drifted enough to
+  // warrant overriding the current snapshot values. The older snapshot would be
+  // valid for a larger part of the currently buffered trace data because the
+  // clock sync protocol in trace processor uses the latest clock <= timestamp
+  // to translate times (see https://perfetto.dev/docs/concepts/clock-sync), so
+  // we try to keep it if we can.
+  if (!snapshot_data->empty()) {
+    PERFETTO_DCHECK(snapshot_data->size() == new_snapshot_data.size());
+    PERFETTO_DCHECK((*snapshot_data)[0].first ==
+                    protos::gen::BUILTIN_CLOCK_BOOTTIME);
+
+    bool update_snapshot = false;
+    uint64_t old_boot_ns = (*snapshot_data)[0].second;
+    uint64_t new_boot_ns = new_snapshot_data[0].second;
+    int64_t boot_diff =
+        static_cast<int64_t>(new_boot_ns) - static_cast<int64_t>(old_boot_ns);
+
+    for (size_t i = 1; i < snapshot_data->size(); i++) {
+      uint64_t old_ns = (*snapshot_data)[i].second;
+      uint64_t new_ns = new_snapshot_data[i].second;
+
+      int64_t diff =
+          static_cast<int64_t>(new_ns) - static_cast<int64_t>(old_ns);
+
+      // Compare the boottime delta against the delta of this clock.
+      if (std::abs(boot_diff - diff) >= kSignificantDriftNs) {
+        update_snapshot = true;
+        break;
+      }
+    }
+    if (!update_snapshot)
+      return false;
+    snapshot_data->clear();
+  }
+
+  *snapshot_data = std::move(new_snapshot_data);
+  return true;
+}
+
+void TracingServiceImpl::EmitClockSnapshot(
+    TracingSession* tracing_session,
+    TracingSession::ClockSnapshotData snapshot_data,
+    std::vector<TracePacket>* packets) {
+  PERFETTO_DCHECK(!tracing_session->config.builtin_data_sources()
+                       .disable_clock_snapshotting());
+
+  protozero::HeapBuffered<protos::pbzero::TracePacket> packet;
+  auto* snapshot = packet->set_clock_snapshot();
+
+  protos::gen::BuiltinClock trace_clock =
+      tracing_session->config.builtin_data_sources().primary_trace_clock();
+  if (!trace_clock)
+    trace_clock = protos::gen::BUILTIN_CLOCK_BOOTTIME;
+  snapshot->set_primary_trace_clock(
+      static_cast<protos::pbzero::BuiltinClock>(trace_clock));
+
+  for (auto& clock_id_and_ts : snapshot_data) {
+    auto* c = snapshot->add_clocks();
+    c->set_clock_id(clock_id_and_ts.first);
+    c->set_timestamp(clock_id_and_ts.second);
+  }
+
+  packet->set_trusted_uid(static_cast<int32_t>(uid_));
+  packet->set_trusted_packet_sequence_id(kServicePacketSequenceID);
+  SerializeAndAppendPacket(packets, packet.SerializeAsArray());
+}
+
+void TracingServiceImpl::EmitSyncMarker(std::vector<TracePacket>* packets) {
+  // The sync marks are used to tokenize large traces efficiently.
+  // See description in trace_packet.proto.
+  if (sync_marker_packet_size_ == 0) {
+    // The marker ABI expects that the marker is written after the uid.
+    // Protozero guarantees that fields are written in the same order of the
+    // calls. The ResynchronizeTraceStreamUsingSyncMarker test verifies the ABI.
+    protozero::StaticBuffered<protos::pbzero::TracePacket> packet(
+        &sync_marker_packet_[0], sizeof(sync_marker_packet_));
+    packet->set_trusted_uid(static_cast<int32_t>(uid_));
+    packet->set_trusted_packet_sequence_id(kServicePacketSequenceID);
+
+    // Keep this last.
+    packet->set_synchronization_marker(kSyncMarker, sizeof(kSyncMarker));
+    sync_marker_packet_size_ = packet.Finalize();
+  }
+  packets->emplace_back();
+  packets->back().AddSlice(&sync_marker_packet_[0], sync_marker_packet_size_);
+}
+
+void TracingServiceImpl::EmitStats(TracingSession* tracing_session,
+                                   std::vector<TracePacket>* packets) {
+  protozero::HeapBuffered<protos::pbzero::TracePacket> packet;
+  packet->set_trusted_uid(static_cast<int32_t>(uid_));
+  packet->set_trusted_packet_sequence_id(kServicePacketSequenceID);
+  GetTraceStats(tracing_session).Serialize(packet->set_trace_stats());
+  SerializeAndAppendPacket(packets, packet.SerializeAsArray());
+}
+
+TraceStats TracingServiceImpl::GetTraceStats(TracingSession* tracing_session) {
+  TraceStats trace_stats;
+  trace_stats.set_producers_connected(static_cast<uint32_t>(producers_.size()));
+  trace_stats.set_producers_seen(last_producer_id_);
+  trace_stats.set_data_sources_registered(
+      static_cast<uint32_t>(data_sources_.size()));
+  trace_stats.set_data_sources_seen(last_data_source_instance_id_);
+  trace_stats.set_tracing_sessions(
+      static_cast<uint32_t>(tracing_sessions_.size()));
+  trace_stats.set_total_buffers(static_cast<uint32_t>(buffers_.size()));
+  trace_stats.set_chunks_discarded(chunks_discarded_);
+  trace_stats.set_patches_discarded(patches_discarded_);
+  trace_stats.set_invalid_packets(tracing_session->invalid_packets);
+
+  if (tracing_session->trace_filter) {
+    auto* filt_stats = trace_stats.mutable_filter_stats();
+    filt_stats->set_input_packets(tracing_session->filter_input_packets);
+    filt_stats->set_input_bytes(tracing_session->filter_input_bytes);
+    filt_stats->set_output_bytes(tracing_session->filter_output_bytes);
+    filt_stats->set_errors(tracing_session->filter_errors);
+  }
+
+  for (BufferID buf_id : tracing_session->buffers_index) {
+    TraceBuffer* buf = GetBufferByID(buf_id);
+    if (!buf) {
+      PERFETTO_DFATAL("Buffer not found.");
+      continue;
+    }
+    *trace_stats.add_buffer_stats() = buf->stats();
+  }  // for (buf in session).
+  return trace_stats;
+}
+
+void TracingServiceImpl::MaybeEmitTraceConfig(
+    TracingSession* tracing_session,
+    std::vector<TracePacket>* packets) {
+  if (tracing_session->did_emit_config)
+    return;
+  tracing_session->did_emit_config = true;
+  protozero::HeapBuffered<protos::pbzero::TracePacket> packet;
+  packet->set_trusted_uid(static_cast<int32_t>(uid_));
+  packet->set_trusted_packet_sequence_id(kServicePacketSequenceID);
+  tracing_session->config.Serialize(packet->set_trace_config());
+  SerializeAndAppendPacket(packets, packet.SerializeAsArray());
+}
+
+void TracingServiceImpl::MaybeEmitSystemInfo(
+    TracingSession* tracing_session,
+    std::vector<TracePacket>* packets) {
+  if (tracing_session->did_emit_system_info)
+    return;
+  tracing_session->did_emit_system_info = true;
+  protozero::HeapBuffered<protos::pbzero::TracePacket> packet;
+  auto* info = packet->set_system_info();
+  info->set_tracing_service_version(base::GetVersionString());
+#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) && \
+    !PERFETTO_BUILDFLAG(PERFETTO_OS_NACL)
+  struct utsname uname_info;
+  if (uname(&uname_info) == 0) {
+    auto* utsname_info = info->set_utsname();
+    utsname_info->set_sysname(uname_info.sysname);
+    utsname_info->set_version(uname_info.version);
+    utsname_info->set_machine(uname_info.machine);
+    utsname_info->set_release(uname_info.release);
+  }
+#endif  // !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+  char value[PROP_VALUE_MAX];
+  if (__system_property_get("ro.build.fingerprint", value)) {
+    info->set_android_build_fingerprint(value);
+  } else {
+    PERFETTO_ELOG("Unable to read ro.build.fingerprint");
+  }
+  info->set_hz(sysconf(_SC_CLK_TCK));
+#endif  // PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+  packet->set_trusted_uid(static_cast<int32_t>(uid_));
+  packet->set_trusted_packet_sequence_id(kServicePacketSequenceID);
+  SerializeAndAppendPacket(packets, packet.SerializeAsArray());
+}
+
+void TracingServiceImpl::EmitLifecycleEvents(
+    TracingSession* tracing_session,
+    std::vector<TracePacket>* packets) {
+  using TimestampedPacket =
+      std::pair<int64_t /* ts */, std::vector<uint8_t> /* serialized packet */>;
+
+  std::vector<TimestampedPacket> timestamped_packets;
+  for (auto& event : tracing_session->lifecycle_events) {
+    for (int64_t ts : event.timestamps) {
+      protozero::HeapBuffered<protos::pbzero::TracePacket> packet;
+      packet->set_timestamp(static_cast<uint64_t>(ts));
+      packet->set_trusted_uid(static_cast<int32_t>(uid_));
+      packet->set_trusted_packet_sequence_id(kServicePacketSequenceID);
+
+      auto* service_event = packet->set_service_event();
+      service_event->AppendVarInt(event.field_id, 1);
+      timestamped_packets.emplace_back(ts, packet.SerializeAsArray());
+    }
+    event.timestamps.clear();
+  }
+
+  // We sort by timestamp here to ensure that the "sequence" of lifecycle
+  // packets has monotonic timestamps like other sequences in the trace.
+  // Note that these events could still be out of order with respect to other
+  // events on the service packet sequence (e.g. trigger received packets).
+  std::sort(timestamped_packets.begin(), timestamped_packets.end(),
+            [](const TimestampedPacket& a, const TimestampedPacket& b) {
+              return a.first < b.first;
+            });
+
+  for (const auto& pair : timestamped_packets)
+    SerializeAndAppendPacket(packets, std::move(pair.second));
+}
+
+void TracingServiceImpl::EmitSeizedForBugreportLifecycleEvent(
+    std::vector<TracePacket>* packets) {
+  protozero::HeapBuffered<protos::pbzero::TracePacket> packet;
+  packet->set_timestamp(static_cast<uint64_t>(base::GetBootTimeNs().count()));
+  packet->set_trusted_uid(static_cast<int32_t>(uid_));
+  packet->set_trusted_packet_sequence_id(kServicePacketSequenceID);
+  auto* service_event = packet->set_service_event();
+  service_event->AppendVarInt(
+      protos::pbzero::TracingServiceEvent::kSeizedForBugreportFieldNumber, 1);
+  SerializeAndAppendPacket(packets, packet.SerializeAsArray());
+}
+
+void TracingServiceImpl::MaybeEmitReceivedTriggers(
+    TracingSession* tracing_session,
+    std::vector<TracePacket>* packets) {
+  PERFETTO_DCHECK(tracing_session->num_triggers_emitted_into_trace <=
+                  tracing_session->received_triggers.size());
+  for (size_t i = tracing_session->num_triggers_emitted_into_trace;
+       i < tracing_session->received_triggers.size(); ++i) {
+    const auto& info = tracing_session->received_triggers[i];
+    protozero::HeapBuffered<protos::pbzero::TracePacket> packet;
+    auto* trigger = packet->set_trigger();
+    trigger->set_trigger_name(info.trigger_name);
+    trigger->set_producer_name(info.producer_name);
+    trigger->set_trusted_producer_uid(static_cast<int32_t>(info.producer_uid));
+
+    packet->set_timestamp(info.boot_time_ns);
+    packet->set_trusted_uid(static_cast<int32_t>(uid_));
+    packet->set_trusted_packet_sequence_id(kServicePacketSequenceID);
+    SerializeAndAppendPacket(packets, packet.SerializeAsArray());
+    ++tracing_session->num_triggers_emitted_into_trace;
+  }
+}
+
+bool TracingServiceImpl::MaybeSaveTraceForBugreport(
+    std::function<void()> callback) {
+  TracingSession* max_session = nullptr;
+  TracingSessionID max_tsid = 0;
+  for (auto& session_id_and_session : tracing_sessions_) {
+    auto& session = session_id_and_session.second;
+    const int32_t score = session.config.bugreport_score();
+    // Exclude sessions with 0 (or below) score. By default tracing sessions
+    // should NOT be eligible to be attached to bugreports.
+    if (score <= 0 || session.state != TracingSession::STARTED)
+      continue;
+
+    // Also don't try to steal long traces with write_into_file if their content
+    // has been already partially written into a file, as we would get partial
+    // traces on both sides. We can't just copy the original file into the
+    // bugreport because the file could be too big (GBs) for bugreports.
+    // The only case where it's legit to steal traces with write_into_file, is
+    // when the consumer specified a very large write_period_ms (e.g. 24h),
+    // meaning that this is effectively a ring-buffer trace. Traceur (the
+    // Android System Tracing app), which uses --detach, does this to have a
+    // consistent invocation path for long-traces and ring-buffer-mode traces.
+    if (session.write_into_file && session.bytes_written_into_file > 0)
+      continue;
+
+    // If we are already in the process of finalizing another trace for
+    // bugreport, don't even start another one, as they would try to write onto
+    // the same file.
+    if (session.on_disable_callback_for_bugreport)
+      return false;
+
+    if (!max_session || score > max_session->config.bugreport_score()) {
+      max_session = &session;
+      max_tsid = session_id_and_session.first;
+    }
+  }
+
+  // No eligible trace found.
+  if (!max_session)
+    return false;
+
+  PERFETTO_LOG("Seizing trace for bugreport. tsid:%" PRIu64
+               " state:%d wf:%d score:%d name:\"%s\"",
+               max_tsid, max_session->state, !!max_session->write_into_file,
+               max_session->config.bugreport_score(),
+               max_session->config.unique_session_name().c_str());
+
+  auto br_fd = CreateTraceFile(GetBugreportTmpPath(), /*overwrite=*/true);
+  if (!br_fd)
+    return false;
+
+  if (max_session->write_into_file) {
+    auto fd = *max_session->write_into_file;
+    // If we are stealing a write_into_file session, add a marker that explains
+    // why the trace has been stolen rather than creating an empty file. This is
+    // only for write_into_file traces. A similar code path deals with the case
+    // of reading-back a seized trace from IPC in ReadBuffers().
+    if (!max_session->config.builtin_data_sources().disable_service_events()) {
+      std::vector<TracePacket> packets;
+      EmitSeizedForBugreportLifecycleEvent(&packets);
+      for (auto& packet : packets) {
+        char* preamble;
+        size_t preamble_size = 0;
+        std::tie(preamble, preamble_size) = packet.GetProtoPreamble();
+        base::WriteAll(fd, preamble, preamble_size);
+        for (const Slice& slice : packet.slices()) {
+          base::WriteAll(fd, slice.start, slice.size);
+        }
+      }  // for (packets)
+    }    // if (!disable_service_events())
+  }      // if (max_session->write_into_file)
+  max_session->write_into_file = std::move(br_fd);
+  max_session->on_disable_callback_for_bugreport = std::move(callback);
+  max_session->seized_for_bugreport = true;
+
+  // Post a task to avoid that early FlushAndDisableTracing() failures invoke
+  // the callback before we return. That would re-enter in a weird way the
+  // callstack of the calling ConsumerEndpointImpl::SaveTraceForBugreport().
+  auto weak_this = weak_ptr_factory_.GetWeakPtr();
+  task_runner_->PostTask([weak_this, max_tsid] {
+    if (weak_this)
+      weak_this->FlushAndDisableTracing(max_tsid);
+  });
+  return true;
+}
+
+void TracingServiceImpl::MaybeLogUploadEvent(const TraceConfig& cfg,
+                                             PerfettoStatsdAtom atom,
+                                             const std::string& trigger_name) {
+  if (!ShouldLogEvent(cfg))
+    return;
+
+  // If the UUID is not set for some reason, don't log anything.
+  if (cfg.trace_uuid_lsb() == 0 && cfg.trace_uuid_msb() == 0)
+    return;
+
+  android_stats::MaybeLogUploadEvent(atom, cfg.trace_uuid_lsb(),
+                                     cfg.trace_uuid_msb(), trigger_name);
+}
+
+void TracingServiceImpl::MaybeLogTriggerEvent(const TraceConfig& cfg,
+                                              PerfettoTriggerAtom atom,
+                                              const std::string& trigger_name) {
+  if (!ShouldLogEvent(cfg))
+    return;
+  android_stats::MaybeLogTriggerEvent(atom, trigger_name);
+}
+
+size_t TracingServiceImpl::PurgeExpiredAndCountTriggerInWindow(
+    int64_t now_ns,
+    uint64_t trigger_name_hash) {
+  PERFETTO_DCHECK(
+      std::is_sorted(trigger_history_.begin(), trigger_history_.end()));
+  size_t remove_count = 0;
+  size_t trigger_count = 0;
+  for (const TriggerHistory& h : trigger_history_) {
+    if (h.timestamp_ns < now_ns - trigger_window_ns_) {
+      remove_count++;
+    } else if (h.name_hash == trigger_name_hash) {
+      trigger_count++;
+    }
+  }
+  trigger_history_.erase_front(remove_count);
+  return trigger_count;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// TracingServiceImpl::ConsumerEndpointImpl implementation
+////////////////////////////////////////////////////////////////////////////////
+
+TracingServiceImpl::ConsumerEndpointImpl::ConsumerEndpointImpl(
+    TracingServiceImpl* service,
+    base::TaskRunner* task_runner,
+    Consumer* consumer,
+    uid_t uid)
+    : task_runner_(task_runner),
+      service_(service),
+      consumer_(consumer),
+      uid_(uid),
+      weak_ptr_factory_(this) {}
+
+TracingServiceImpl::ConsumerEndpointImpl::~ConsumerEndpointImpl() {
+  service_->DisconnectConsumer(this);
+  consumer_->OnDisconnect();
+}
+
+void TracingServiceImpl::ConsumerEndpointImpl::NotifyOnTracingDisabled(
+    const std::string& error) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  auto weak_this = weak_ptr_factory_.GetWeakPtr();
+  task_runner_->PostTask([weak_this, error /* deliberate copy */] {
+    if (weak_this)
+      weak_this->consumer_->OnTracingDisabled(error);
+  });
+}
+
+void TracingServiceImpl::ConsumerEndpointImpl::EnableTracing(
+    const TraceConfig& cfg,
+    base::ScopedFile fd) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  auto status = service_->EnableTracing(this, cfg, std::move(fd));
+  if (!status.ok())
+    NotifyOnTracingDisabled(status.message());
+}
+
+void TracingServiceImpl::ConsumerEndpointImpl::ChangeTraceConfig(
+    const TraceConfig& cfg) {
+  if (!tracing_session_id_) {
+    PERFETTO_LOG(
+        "Consumer called ChangeTraceConfig() but tracing was "
+        "not active");
+    return;
+  }
+  service_->ChangeTraceConfig(this, cfg);
+}
+
+void TracingServiceImpl::ConsumerEndpointImpl::StartTracing() {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  if (!tracing_session_id_) {
+    PERFETTO_LOG("Consumer called StartTracing() but tracing was not active");
+    return;
+  }
+  service_->StartTracing(tracing_session_id_);
+}
+
+void TracingServiceImpl::ConsumerEndpointImpl::DisableTracing() {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  if (!tracing_session_id_) {
+    PERFETTO_LOG("Consumer called DisableTracing() but tracing was not active");
+    return;
+  }
+  service_->DisableTracing(tracing_session_id_);
+}
+
+void TracingServiceImpl::ConsumerEndpointImpl::ReadBuffers() {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  if (!tracing_session_id_) {
+    PERFETTO_LOG("Consumer called ReadBuffers() but tracing was not active");
+    consumer_->OnTraceData({}, /* has_more = */ false);
+    return;
+  }
+  if (!service_->ReadBuffers(tracing_session_id_, this)) {
+    consumer_->OnTraceData({}, /* has_more = */ false);
+  }
+}
+
+void TracingServiceImpl::ConsumerEndpointImpl::FreeBuffers() {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  if (!tracing_session_id_) {
+    PERFETTO_LOG("Consumer called FreeBuffers() but tracing was not active");
+    return;
+  }
+  service_->FreeBuffers(tracing_session_id_);
+  tracing_session_id_ = 0;
+}
+
+void TracingServiceImpl::ConsumerEndpointImpl::Flush(uint32_t timeout_ms,
+                                                     FlushCallback callback) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  if (!tracing_session_id_) {
+    PERFETTO_LOG("Consumer called Flush() but tracing was not active");
+    return;
+  }
+  service_->Flush(tracing_session_id_, timeout_ms, callback);
+}
+
+void TracingServiceImpl::ConsumerEndpointImpl::Detach(const std::string& key) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  bool success = service_->DetachConsumer(this, key);
+  auto weak_this = weak_ptr_factory_.GetWeakPtr();
+  task_runner_->PostTask([weak_this, success] {
+    if (weak_this)
+      weak_this->consumer_->OnDetach(success);
+  });
+}
+
+void TracingServiceImpl::ConsumerEndpointImpl::Attach(const std::string& key) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  bool success = service_->AttachConsumer(this, key);
+  auto weak_this = weak_ptr_factory_.GetWeakPtr();
+  task_runner_->PostTask([weak_this, success] {
+    if (!weak_this)
+      return;
+    Consumer* consumer = weak_this->consumer_;
+    TracingSession* session =
+        weak_this->service_->GetTracingSession(weak_this->tracing_session_id_);
+    if (!session) {
+      consumer->OnAttach(false, TraceConfig());
+      return;
+    }
+    consumer->OnAttach(success, session->config);
+  });
+}
+
+void TracingServiceImpl::ConsumerEndpointImpl::GetTraceStats() {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  bool success = false;
+  TraceStats stats;
+  TracingSession* session = service_->GetTracingSession(tracing_session_id_);
+  if (session) {
+    success = true;
+    stats = service_->GetTraceStats(session);
+  }
+  auto weak_this = weak_ptr_factory_.GetWeakPtr();
+  task_runner_->PostTask([weak_this, success, stats] {
+    if (weak_this)
+      weak_this->consumer_->OnTraceStats(success, stats);
+  });
+}
+
+void TracingServiceImpl::ConsumerEndpointImpl::ObserveEvents(
+    uint32_t events_mask) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  observable_events_mask_ = events_mask;
+  TracingSession* session = service_->GetTracingSession(tracing_session_id_);
+  if (!session)
+    return;
+
+  if (observable_events_mask_ & ObservableEvents::TYPE_DATA_SOURCES_INSTANCES) {
+    // Issue initial states.
+    for (const auto& kv : session->data_source_instances) {
+      ProducerEndpointImpl* producer = service_->GetProducer(kv.first);
+      PERFETTO_DCHECK(producer);
+      OnDataSourceInstanceStateChange(*producer, kv.second);
+    }
+  }
+
+  // If the ObserveEvents() call happens after data sources have acked already
+  // notify immediately.
+  if (observable_events_mask_ &
+      ObservableEvents::TYPE_ALL_DATA_SOURCES_STARTED) {
+    service_->MaybeNotifyAllDataSourcesStarted(session);
+  }
+}
+
+void TracingServiceImpl::ConsumerEndpointImpl::OnDataSourceInstanceStateChange(
+    const ProducerEndpointImpl& producer,
+    const DataSourceInstance& instance) {
+  if (!(observable_events_mask_ &
+        ObservableEvents::TYPE_DATA_SOURCES_INSTANCES)) {
+    return;
+  }
+
+  if (instance.state != DataSourceInstance::CONFIGURED &&
+      instance.state != DataSourceInstance::STARTED &&
+      instance.state != DataSourceInstance::STOPPED) {
+    return;
+  }
+
+  auto* observable_events = AddObservableEvents();
+  auto* change = observable_events->add_instance_state_changes();
+  change->set_producer_name(producer.name_);
+  change->set_data_source_name(instance.data_source_name);
+  if (instance.state == DataSourceInstance::STARTED) {
+    change->set_state(ObservableEvents::DATA_SOURCE_INSTANCE_STATE_STARTED);
+  } else {
+    change->set_state(ObservableEvents::DATA_SOURCE_INSTANCE_STATE_STOPPED);
+  }
+}
+
+void TracingServiceImpl::ConsumerEndpointImpl::OnAllDataSourcesStarted() {
+  if (!(observable_events_mask_ &
+        ObservableEvents::TYPE_ALL_DATA_SOURCES_STARTED)) {
+    return;
+  }
+  auto* observable_events = AddObservableEvents();
+  observable_events->set_all_data_sources_started(true);
+}
+
+ObservableEvents*
+TracingServiceImpl::ConsumerEndpointImpl::AddObservableEvents() {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  if (!observable_events_) {
+    observable_events_.reset(new ObservableEvents());
+    auto weak_this = weak_ptr_factory_.GetWeakPtr();
+    task_runner_->PostTask([weak_this] {
+      if (!weak_this)
+        return;
+
+      // Move into a temporary to allow reentrancy in OnObservableEvents.
+      auto observable_events = std::move(weak_this->observable_events_);
+      weak_this->consumer_->OnObservableEvents(*observable_events);
+    });
+  }
+  return observable_events_.get();
+}
+
+void TracingServiceImpl::ConsumerEndpointImpl::QueryServiceState(
+    QueryServiceStateCallback callback) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  TracingServiceState svc_state;
+
+  const auto& sessions = service_->tracing_sessions_;
+  svc_state.set_tracing_service_version(base::GetVersionString());
+  svc_state.set_num_sessions(static_cast<int>(sessions.size()));
+
+  int num_started = 0;
+  for (const auto& kv : sessions)
+    num_started += kv.second.state == TracingSession::State::STARTED ? 1 : 0;
+  svc_state.set_num_sessions_started(static_cast<int>(num_started));
+
+  for (const auto& kv : service_->producers_) {
+    auto* producer = svc_state.add_producers();
+    producer->set_id(static_cast<int>(kv.first));
+    producer->set_name(kv.second->name_);
+    producer->set_sdk_version(kv.second->sdk_version_);
+    producer->set_uid(static_cast<int32_t>(producer->uid()));
+  }
+
+  for (const auto& kv : service_->data_sources_) {
+    const auto& registered_data_source = kv.second;
+    auto* data_source = svc_state.add_data_sources();
+    *data_source->mutable_ds_descriptor() = registered_data_source.descriptor;
+    data_source->set_producer_id(
+        static_cast<int>(registered_data_source.producer_id));
+  }
+  callback(/*success=*/true, svc_state);
+}
+
+void TracingServiceImpl::ConsumerEndpointImpl::QueryCapabilities(
+    QueryCapabilitiesCallback callback) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  TracingServiceCapabilities caps;
+  caps.set_has_query_capabilities(true);
+  caps.set_has_trace_config_output_path(true);
+  caps.add_observable_events(ObservableEvents::TYPE_DATA_SOURCES_INSTANCES);
+  caps.add_observable_events(ObservableEvents::TYPE_ALL_DATA_SOURCES_STARTED);
+  static_assert(ObservableEvents::Type_MAX ==
+                    ObservableEvents::TYPE_ALL_DATA_SOURCES_STARTED,
+                "");
+  callback(caps);
+}
+
+void TracingServiceImpl::ConsumerEndpointImpl::SaveTraceForBugreport(
+    SaveTraceForBugreportCallback consumer_callback) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  auto on_complete_callback = [consumer_callback] {
+    if (rename(GetBugreportTmpPath().c_str(), GetBugreportPath().c_str())) {
+      consumer_callback(false, "rename(" + GetBugreportTmpPath() + ", " +
+                                   GetBugreportPath() + ") failed (" +
+                                   strerror(errno) + ")");
+    } else {
+      consumer_callback(true, GetBugreportPath());
+    }
+  };
+  if (!service_->MaybeSaveTraceForBugreport(std::move(on_complete_callback))) {
+    consumer_callback(false,
+                      "No trace with TraceConfig.bugreport_score > 0 eligible "
+                      "for bug reporting was found");
+  }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// TracingServiceImpl::ProducerEndpointImpl implementation
+////////////////////////////////////////////////////////////////////////////////
+
+TracingServiceImpl::ProducerEndpointImpl::ProducerEndpointImpl(
+    ProducerID id,
+    uid_t uid,
+    TracingServiceImpl* service,
+    base::TaskRunner* task_runner,
+    Producer* producer,
+    const std::string& producer_name,
+    const std::string& sdk_version,
+    bool in_process,
+    bool smb_scraping_enabled)
+    : id_(id),
+      uid_(uid),
+      service_(service),
+      task_runner_(task_runner),
+      producer_(producer),
+      name_(producer_name),
+      sdk_version_(sdk_version),
+      in_process_(in_process),
+      smb_scraping_enabled_(smb_scraping_enabled),
+      weak_ptr_factory_(this) {}
+
+TracingServiceImpl::ProducerEndpointImpl::~ProducerEndpointImpl() {
+  service_->DisconnectProducer(id_);
+  producer_->OnDisconnect();
+}
+
+void TracingServiceImpl::ProducerEndpointImpl::RegisterDataSource(
+    const DataSourceDescriptor& desc) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  if (desc.name().empty()) {
+    PERFETTO_DLOG("Received RegisterDataSource() with empty name");
+    return;
+  }
+
+  service_->RegisterDataSource(id_, desc);
+}
+
+void TracingServiceImpl::ProducerEndpointImpl::UnregisterDataSource(
+    const std::string& name) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  service_->UnregisterDataSource(id_, name);
+}
+
+void TracingServiceImpl::ProducerEndpointImpl::RegisterTraceWriter(
+    uint32_t writer_id,
+    uint32_t target_buffer) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  writers_[static_cast<WriterID>(writer_id)] =
+      static_cast<BufferID>(target_buffer);
+}
+
+void TracingServiceImpl::ProducerEndpointImpl::UnregisterTraceWriter(
+    uint32_t writer_id) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  writers_.erase(static_cast<WriterID>(writer_id));
+}
+
+void TracingServiceImpl::ProducerEndpointImpl::CommitData(
+    const CommitDataRequest& req_untrusted,
+    CommitDataCallback callback) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+
+  if (metatrace::IsEnabled(metatrace::TAG_TRACE_SERVICE)) {
+    PERFETTO_METATRACE_COUNTER(TAG_TRACE_SERVICE, TRACE_SERVICE_COMMIT_DATA,
+                               EncodeCommitDataRequest(id_, req_untrusted));
+  }
+
+  if (!shared_memory_) {
+    PERFETTO_DLOG(
+        "Attempted to commit data before the shared memory was allocated.");
+    return;
+  }
+  PERFETTO_DCHECK(shmem_abi_.is_valid());
+  for (const auto& entry : req_untrusted.chunks_to_move()) {
+    const uint32_t page_idx = entry.page();
+    if (page_idx >= shmem_abi_.num_pages())
+      continue;  // A buggy or malicious producer.
+
+    SharedMemoryABI::Chunk chunk =
+        shmem_abi_.TryAcquireChunkForReading(page_idx, entry.chunk());
+    if (!chunk.is_valid()) {
+      PERFETTO_DLOG("Asked to move chunk %d:%d, but it's not complete",
+                    entry.page(), entry.chunk());
+      continue;
+    }
+
+    // TryAcquireChunkForReading() has load-acquire semantics. Once acquired,
+    // the ABI contract expects the producer to not touch the chunk anymore
+    // (until the service marks that as free). This is why all the reads below
+    // are just memory_order_relaxed. Also, the code here assumes that all this
+    // data can be malicious and just gives up if anything is malformed.
+    BufferID buffer_id = static_cast<BufferID>(entry.target_buffer());
+    const SharedMemoryABI::ChunkHeader& chunk_header = *chunk.header();
+    WriterID writer_id = chunk_header.writer_id.load(std::memory_order_relaxed);
+    ChunkID chunk_id = chunk_header.chunk_id.load(std::memory_order_relaxed);
+    auto packets = chunk_header.packets.load(std::memory_order_relaxed);
+    uint16_t num_fragments = packets.count;
+    uint8_t chunk_flags = packets.flags;
+
+    service_->CopyProducerPageIntoLogBuffer(
+        id_, uid_, writer_id, chunk_id, buffer_id, num_fragments, chunk_flags,
+        /*chunk_complete=*/true, chunk.payload_begin(), chunk.payload_size());
+
+    // This one has release-store semantics.
+    shmem_abi_.ReleaseChunkAsFree(std::move(chunk));
+  }  // for(chunks_to_move)
+
+  service_->ApplyChunkPatches(id_, req_untrusted.chunks_to_patch());
+
+  if (req_untrusted.flush_request_id()) {
+    service_->NotifyFlushDoneForProducer(id_, req_untrusted.flush_request_id());
+  }
+
+  // Keep this invocation last. ProducerIPCService::CommitData() relies on this
+  // callback being invoked within the same callstack and not posted. If this
+  // changes, the code there needs to be changed accordingly.
+  if (callback)
+    callback();
+}
+
+void TracingServiceImpl::ProducerEndpointImpl::SetupSharedMemory(
+    std::unique_ptr<SharedMemory> shared_memory,
+    size_t page_size_bytes,
+    bool provided_by_producer) {
+  PERFETTO_DCHECK(!shared_memory_ && !shmem_abi_.is_valid());
+  PERFETTO_DCHECK(page_size_bytes % 1024 == 0);
+
+  shared_memory_ = std::move(shared_memory);
+  shared_buffer_page_size_kb_ = page_size_bytes / 1024;
+  is_shmem_provided_by_producer_ = provided_by_producer;
+
+  shmem_abi_.Initialize(reinterpret_cast<uint8_t*>(shared_memory_->start()),
+                        shared_memory_->size(),
+                        shared_buffer_page_size_kb() * 1024);
+  if (in_process_) {
+    inproc_shmem_arbiter_.reset(new SharedMemoryArbiterImpl(
+        shared_memory_->start(), shared_memory_->size(),
+        shared_buffer_page_size_kb_ * 1024, this, task_runner_));
+    inproc_shmem_arbiter_->SetDirectSMBPatchingSupportedByService();
+  }
+
+  OnTracingSetup();
+  service_->UpdateMemoryGuardrail();
+}
+
+SharedMemory* TracingServiceImpl::ProducerEndpointImpl::shared_memory() const {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  return shared_memory_.get();
+}
+
+size_t TracingServiceImpl::ProducerEndpointImpl::shared_buffer_page_size_kb()
+    const {
+  return shared_buffer_page_size_kb_;
+}
+
+void TracingServiceImpl::ProducerEndpointImpl::ActivateTriggers(
+    const std::vector<std::string>& triggers) {
+  service_->ActivateTriggers(id_, triggers);
+}
+
+void TracingServiceImpl::ProducerEndpointImpl::StopDataSource(
+    DataSourceInstanceID ds_inst_id) {
+  // TODO(primiano): When we'll support tearing down the SMB, at this point we
+  // should send the Producer a TearDownTracing if all its data sources have
+  // been disabled (see b/77532839 and aosp/655179 PS1).
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  auto weak_this = weak_ptr_factory_.GetWeakPtr();
+  task_runner_->PostTask([weak_this, ds_inst_id] {
+    if (weak_this)
+      weak_this->producer_->StopDataSource(ds_inst_id);
+  });
+}
+
+SharedMemoryArbiter*
+TracingServiceImpl::ProducerEndpointImpl::MaybeSharedMemoryArbiter() {
+  if (!inproc_shmem_arbiter_) {
+    PERFETTO_FATAL(
+        "The in-process SharedMemoryArbiter can only be used when "
+        "CreateProducer has been called with in_process=true and after tracing "
+        "has started.");
+  }
+
+  PERFETTO_DCHECK(in_process_);
+  return inproc_shmem_arbiter_.get();
+}
+
+bool TracingServiceImpl::ProducerEndpointImpl::IsShmemProvidedByProducer()
+    const {
+  return is_shmem_provided_by_producer_;
+}
+
+// Can be called on any thread.
+std::unique_ptr<TraceWriter>
+TracingServiceImpl::ProducerEndpointImpl::CreateTraceWriter(
+    BufferID buf_id,
+    BufferExhaustedPolicy buffer_exhausted_policy) {
+  PERFETTO_DCHECK(MaybeSharedMemoryArbiter());
+  return MaybeSharedMemoryArbiter()->CreateTraceWriter(buf_id,
+                                                       buffer_exhausted_policy);
+}
+
+void TracingServiceImpl::ProducerEndpointImpl::NotifyFlushComplete(
+    FlushRequestID id) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  PERFETTO_DCHECK(MaybeSharedMemoryArbiter());
+  return MaybeSharedMemoryArbiter()->NotifyFlushComplete(id);
+}
+
+void TracingServiceImpl::ProducerEndpointImpl::OnTracingSetup() {
+  auto weak_this = weak_ptr_factory_.GetWeakPtr();
+  task_runner_->PostTask([weak_this] {
+    if (weak_this)
+      weak_this->producer_->OnTracingSetup();
+  });
+}
+
+void TracingServiceImpl::ProducerEndpointImpl::Flush(
+    FlushRequestID flush_request_id,
+    const std::vector<DataSourceInstanceID>& data_sources) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  auto weak_this = weak_ptr_factory_.GetWeakPtr();
+  task_runner_->PostTask([weak_this, flush_request_id, data_sources] {
+    if (weak_this) {
+      weak_this->producer_->Flush(flush_request_id, data_sources.data(),
+                                  data_sources.size());
+    }
+  });
+}
+
+void TracingServiceImpl::ProducerEndpointImpl::SetupDataSource(
+    DataSourceInstanceID ds_id,
+    const DataSourceConfig& config) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  allowed_target_buffers_.insert(static_cast<BufferID>(config.target_buffer()));
+  auto weak_this = weak_ptr_factory_.GetWeakPtr();
+  task_runner_->PostTask([weak_this, ds_id, config] {
+    if (weak_this)
+      weak_this->producer_->SetupDataSource(ds_id, std::move(config));
+  });
+}
+
+void TracingServiceImpl::ProducerEndpointImpl::StartDataSource(
+    DataSourceInstanceID ds_id,
+    const DataSourceConfig& config) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  auto weak_this = weak_ptr_factory_.GetWeakPtr();
+  task_runner_->PostTask([weak_this, ds_id, config] {
+    if (weak_this)
+      weak_this->producer_->StartDataSource(ds_id, std::move(config));
+  });
+}
+
+void TracingServiceImpl::ProducerEndpointImpl::NotifyDataSourceStarted(
+    DataSourceInstanceID data_source_id) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  service_->NotifyDataSourceStarted(id_, data_source_id);
+}
+
+void TracingServiceImpl::ProducerEndpointImpl::NotifyDataSourceStopped(
+    DataSourceInstanceID data_source_id) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  service_->NotifyDataSourceStopped(id_, data_source_id);
+}
+
+void TracingServiceImpl::ProducerEndpointImpl::OnFreeBuffers(
+    const std::vector<BufferID>& target_buffers) {
+  if (allowed_target_buffers_.empty())
+    return;
+  for (BufferID buffer : target_buffers)
+    allowed_target_buffers_.erase(buffer);
+}
+
+void TracingServiceImpl::ProducerEndpointImpl::ClearIncrementalState(
+    const std::vector<DataSourceInstanceID>& data_sources) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  auto weak_this = weak_ptr_factory_.GetWeakPtr();
+  task_runner_->PostTask([weak_this, data_sources] {
+    if (weak_this) {
+      weak_this->producer_->ClearIncrementalState(data_sources.data(),
+                                                  data_sources.size());
+    }
+  });
+}
+
+void TracingServiceImpl::ProducerEndpointImpl::Sync(
+    std::function<void()> callback) {
+  task_runner_->PostTask(callback);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// TracingServiceImpl::TracingSession implementation
+////////////////////////////////////////////////////////////////////////////////
+
+TracingServiceImpl::TracingSession::TracingSession(
+    TracingSessionID session_id,
+    ConsumerEndpointImpl* consumer,
+    const TraceConfig& new_config,
+    base::TaskRunner* task_runner)
+    : id(session_id),
+      consumer_maybe_null(consumer),
+      consumer_uid(consumer->uid_),
+      config(new_config),
+      snapshot_periodic_task(task_runner) {
+  // all_data_sources_flushed is special because we store up to 64 events of
+  // this type. Other events will go through the default case in
+  // SnapshotLifecycleEvent() where they will be given a max history of 1.
+  lifecycle_events.emplace_back(
+      protos::pbzero::TracingServiceEvent::kAllDataSourcesFlushedFieldNumber,
+      64 /* max_size */);
+}
+
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/internal/in_process_tracing_backend.cc
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/in_process_tracing_backend.h"
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/base/task_runner.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/paged_memory.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/shared_memory.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/tracing_service.h"
+
+// TODO(primiano): When the in-process backend is used, we should never end up
+// in a situation where the thread where the TracingService and Producer live
+// writes a packet and hence can get into the GetNewChunk() stall.
+// This would happen only if the API client code calls Trace() from one of the
+// callbacks it receives (e.g. OnStart(), OnStop()). We should either cause a
+// hard crash or ignore traces from that thread if that happens, because it
+// will deadlock (the Service will never free up the SMB because won't ever get
+// to run the task).
+
+namespace perfetto {
+namespace internal {
+
+namespace {
+
+class InProcessShm : public SharedMemory {
+ public:
+  explicit InProcessShm(size_t size);
+  ~InProcessShm() override;
+  void* start() const override;
+  size_t size() const override;
+
+ private:
+  base::PagedMemory mem_;
+};
+
+class InProcessShmFactory : public SharedMemory::Factory {
+ public:
+  ~InProcessShmFactory() override;
+  std::unique_ptr<SharedMemory> CreateSharedMemory(size_t) override;
+};
+
+InProcessShm::~InProcessShm() = default;
+
+InProcessShm::InProcessShm(size_t size)
+    : mem_(base::PagedMemory::Allocate(size)) {}
+
+void* InProcessShm::start() const {
+  return mem_.Get();
+}
+
+size_t InProcessShm::size() const {
+  return mem_.size();
+}
+
+InProcessShmFactory::~InProcessShmFactory() = default;
+std::unique_ptr<SharedMemory> InProcessShmFactory::CreateSharedMemory(
+    size_t size) {
+  return std::unique_ptr<SharedMemory>(new InProcessShm(size));
+}
+
+}  // namespace
+
+// static
+TracingBackend* InProcessTracingBackend::GetInstance() {
+  static auto* instance = new InProcessTracingBackend();
+  return instance;
+}
+
+InProcessTracingBackend::InProcessTracingBackend() {}
+
+std::unique_ptr<ProducerEndpoint> InProcessTracingBackend::ConnectProducer(
+    const ConnectProducerArgs& args) {
+  PERFETTO_DCHECK(args.task_runner->RunsTasksOnCurrentThread());
+
+  // This should never happen as we can have at most one in-process backend.
+  if (service_)
+    PERFETTO_FATAL("InProcessTracingBackend initialized twice");
+
+  return GetOrCreateService(args.task_runner)
+      ->ConnectProducer(args.producer, /*uid=*/0, args.producer_name,
+                        args.shmem_size_hint_bytes,
+                        /*in_process=*/true,
+                        TracingService::ProducerSMBScrapingMode::kEnabled,
+                        args.shmem_page_size_hint_bytes);
+}
+
+std::unique_ptr<ConsumerEndpoint> InProcessTracingBackend::ConnectConsumer(
+    const ConnectConsumerArgs& args) {
+  return GetOrCreateService(args.task_runner)
+      ->ConnectConsumer(args.consumer, /*uid=*/0);
+}
+
+TracingService* InProcessTracingBackend::GetOrCreateService(
+    base::TaskRunner* task_runner) {
+  if (!service_) {
+    std::unique_ptr<InProcessShmFactory> shm(new InProcessShmFactory());
+    service_ = TracingService::CreateInstance(std::move(shm), task_runner);
+    service_->SetSMBScrapingEnabled(true);
+  }
+  return service_.get();
+}
+
+}  // namespace internal
+}  // namespace perfetto
+// gen_amalgamated begin source: gen/protos/perfetto/ipc/consumer_port.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/ipc/consumer_port.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_CONSUMER_PORT_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_CONSUMER_PORT_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class SaveTraceForBugreportResponse;
+class SaveTraceForBugreportRequest;
+class QueryCapabilitiesResponse;
+class TracingServiceCapabilities;
+class QueryCapabilitiesRequest;
+class QueryServiceStateResponse;
+class TracingServiceState;
+class TracingServiceState_DataSource;
+class DataSourceDescriptor;
+class TracingServiceState_Producer;
+class QueryServiceStateRequest;
+class ObserveEventsResponse;
+class ObservableEvents;
+class ObservableEvents_DataSourceInstanceStateChange;
+class ObserveEventsRequest;
+class GetTraceStatsResponse;
+class TraceStats;
+class TraceStats_FilterStats;
+class TraceStats_BufferStats;
+class GetTraceStatsRequest;
+class AttachResponse;
+class TraceConfig;
+class TraceConfig_TraceFilter;
+class TraceConfig_IncidentReportConfig;
+class TraceConfig_IncrementalStateConfig;
+class TraceConfig_TriggerConfig;
+class TraceConfig_TriggerConfig_Trigger;
+class TraceConfig_GuardrailOverrides;
+class TraceConfig_StatsdMetadata;
+class TraceConfig_ProducerConfig;
+class TraceConfig_BuiltinDataSource;
+class TraceConfig_DataSource;
+class DataSourceConfig;
+class TestConfig;
+class TestConfig_DummyFields;
+class InterceptorConfig;
+class ChromeConfig;
+class TraceConfig_BufferConfig;
+class AttachRequest;
+class DetachResponse;
+class DetachRequest;
+class FlushResponse;
+class FlushRequest;
+class FreeBuffersResponse;
+class FreeBuffersRequest;
+class ReadBuffersResponse;
+class ReadBuffersResponse_Slice;
+class ReadBuffersRequest;
+class DisableTracingResponse;
+class DisableTracingRequest;
+class ChangeTraceConfigResponse;
+class ChangeTraceConfigRequest;
+class StartTracingResponse;
+class StartTracingRequest;
+class EnableTracingResponse;
+class EnableTracingRequest;
+enum ObservableEvents_Type : int;
+enum ObservableEvents_DataSourceInstanceState : int;
+enum TraceConfig_LockdownModeOperation : int;
+enum TraceConfig_CompressionType : int;
+enum TraceConfig_StatsdLogging : int;
+enum TraceConfig_TriggerConfig_TriggerMode : int;
+enum BuiltinClock : int;
+enum DataSourceConfig_SessionInitiator : int;
+enum ChromeConfig_ClientPriority : int;
+enum TraceConfig_BufferConfig_FillPolicy : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT SaveTraceForBugreportResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kSuccessFieldNumber = 1,
+    kMsgFieldNumber = 2,
+  };
+
+  SaveTraceForBugreportResponse();
+  ~SaveTraceForBugreportResponse() override;
+  SaveTraceForBugreportResponse(SaveTraceForBugreportResponse&&) noexcept;
+  SaveTraceForBugreportResponse& operator=(SaveTraceForBugreportResponse&&);
+  SaveTraceForBugreportResponse(const SaveTraceForBugreportResponse&);
+  SaveTraceForBugreportResponse& operator=(const SaveTraceForBugreportResponse&);
+  bool operator==(const SaveTraceForBugreportResponse&) const;
+  bool operator!=(const SaveTraceForBugreportResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_success() const { return _has_field_[1]; }
+  bool success() const { return success_; }
+  void set_success(bool value) { success_ = value; _has_field_.set(1); }
+
+  bool has_msg() const { return _has_field_[2]; }
+  const std::string& msg() const { return msg_; }
+  void set_msg(const std::string& value) { msg_ = value; _has_field_.set(2); }
+
+ private:
+  bool success_{};
+  std::string msg_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT SaveTraceForBugreportRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  SaveTraceForBugreportRequest();
+  ~SaveTraceForBugreportRequest() override;
+  SaveTraceForBugreportRequest(SaveTraceForBugreportRequest&&) noexcept;
+  SaveTraceForBugreportRequest& operator=(SaveTraceForBugreportRequest&&);
+  SaveTraceForBugreportRequest(const SaveTraceForBugreportRequest&);
+  SaveTraceForBugreportRequest& operator=(const SaveTraceForBugreportRequest&);
+  bool operator==(const SaveTraceForBugreportRequest&) const;
+  bool operator!=(const SaveTraceForBugreportRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT QueryCapabilitiesResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kCapabilitiesFieldNumber = 1,
+  };
+
+  QueryCapabilitiesResponse();
+  ~QueryCapabilitiesResponse() override;
+  QueryCapabilitiesResponse(QueryCapabilitiesResponse&&) noexcept;
+  QueryCapabilitiesResponse& operator=(QueryCapabilitiesResponse&&);
+  QueryCapabilitiesResponse(const QueryCapabilitiesResponse&);
+  QueryCapabilitiesResponse& operator=(const QueryCapabilitiesResponse&);
+  bool operator==(const QueryCapabilitiesResponse&) const;
+  bool operator!=(const QueryCapabilitiesResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_capabilities() const { return _has_field_[1]; }
+  const TracingServiceCapabilities& capabilities() const { return *capabilities_; }
+  TracingServiceCapabilities* mutable_capabilities() { _has_field_.set(1); return capabilities_.get(); }
+
+ private:
+  ::protozero::CopyablePtr<TracingServiceCapabilities> capabilities_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT QueryCapabilitiesRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  QueryCapabilitiesRequest();
+  ~QueryCapabilitiesRequest() override;
+  QueryCapabilitiesRequest(QueryCapabilitiesRequest&&) noexcept;
+  QueryCapabilitiesRequest& operator=(QueryCapabilitiesRequest&&);
+  QueryCapabilitiesRequest(const QueryCapabilitiesRequest&);
+  QueryCapabilitiesRequest& operator=(const QueryCapabilitiesRequest&);
+  bool operator==(const QueryCapabilitiesRequest&) const;
+  bool operator!=(const QueryCapabilitiesRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT QueryServiceStateResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kServiceStateFieldNumber = 1,
+  };
+
+  QueryServiceStateResponse();
+  ~QueryServiceStateResponse() override;
+  QueryServiceStateResponse(QueryServiceStateResponse&&) noexcept;
+  QueryServiceStateResponse& operator=(QueryServiceStateResponse&&);
+  QueryServiceStateResponse(const QueryServiceStateResponse&);
+  QueryServiceStateResponse& operator=(const QueryServiceStateResponse&);
+  bool operator==(const QueryServiceStateResponse&) const;
+  bool operator!=(const QueryServiceStateResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_service_state() const { return _has_field_[1]; }
+  const TracingServiceState& service_state() const { return *service_state_; }
+  TracingServiceState* mutable_service_state() { _has_field_.set(1); return service_state_.get(); }
+
+ private:
+  ::protozero::CopyablePtr<TracingServiceState> service_state_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT QueryServiceStateRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  QueryServiceStateRequest();
+  ~QueryServiceStateRequest() override;
+  QueryServiceStateRequest(QueryServiceStateRequest&&) noexcept;
+  QueryServiceStateRequest& operator=(QueryServiceStateRequest&&);
+  QueryServiceStateRequest(const QueryServiceStateRequest&);
+  QueryServiceStateRequest& operator=(const QueryServiceStateRequest&);
+  bool operator==(const QueryServiceStateRequest&) const;
+  bool operator!=(const QueryServiceStateRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ObserveEventsResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kEventsFieldNumber = 1,
+  };
+
+  ObserveEventsResponse();
+  ~ObserveEventsResponse() override;
+  ObserveEventsResponse(ObserveEventsResponse&&) noexcept;
+  ObserveEventsResponse& operator=(ObserveEventsResponse&&);
+  ObserveEventsResponse(const ObserveEventsResponse&);
+  ObserveEventsResponse& operator=(const ObserveEventsResponse&);
+  bool operator==(const ObserveEventsResponse&) const;
+  bool operator!=(const ObserveEventsResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_events() const { return _has_field_[1]; }
+  const ObservableEvents& events() const { return *events_; }
+  ObservableEvents* mutable_events() { _has_field_.set(1); return events_.get(); }
+
+ private:
+  ::protozero::CopyablePtr<ObservableEvents> events_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ObserveEventsRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kEventsToObserveFieldNumber = 1,
+  };
+
+  ObserveEventsRequest();
+  ~ObserveEventsRequest() override;
+  ObserveEventsRequest(ObserveEventsRequest&&) noexcept;
+  ObserveEventsRequest& operator=(ObserveEventsRequest&&);
+  ObserveEventsRequest(const ObserveEventsRequest&);
+  ObserveEventsRequest& operator=(const ObserveEventsRequest&);
+  bool operator==(const ObserveEventsRequest&) const;
+  bool operator!=(const ObserveEventsRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<ObservableEvents_Type>& events_to_observe() const { return events_to_observe_; }
+  std::vector<ObservableEvents_Type>* mutable_events_to_observe() { return &events_to_observe_; }
+  int events_to_observe_size() const { return static_cast<int>(events_to_observe_.size()); }
+  void clear_events_to_observe() { events_to_observe_.clear(); }
+  void add_events_to_observe(ObservableEvents_Type value) { events_to_observe_.emplace_back(value); }
+  ObservableEvents_Type* add_events_to_observe() { events_to_observe_.emplace_back(); return &events_to_observe_.back(); }
+
+ private:
+  std::vector<ObservableEvents_Type> events_to_observe_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT GetTraceStatsResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kTraceStatsFieldNumber = 1,
+  };
+
+  GetTraceStatsResponse();
+  ~GetTraceStatsResponse() override;
+  GetTraceStatsResponse(GetTraceStatsResponse&&) noexcept;
+  GetTraceStatsResponse& operator=(GetTraceStatsResponse&&);
+  GetTraceStatsResponse(const GetTraceStatsResponse&);
+  GetTraceStatsResponse& operator=(const GetTraceStatsResponse&);
+  bool operator==(const GetTraceStatsResponse&) const;
+  bool operator!=(const GetTraceStatsResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_trace_stats() const { return _has_field_[1]; }
+  const TraceStats& trace_stats() const { return *trace_stats_; }
+  TraceStats* mutable_trace_stats() { _has_field_.set(1); return trace_stats_.get(); }
+
+ private:
+  ::protozero::CopyablePtr<TraceStats> trace_stats_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT GetTraceStatsRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  GetTraceStatsRequest();
+  ~GetTraceStatsRequest() override;
+  GetTraceStatsRequest(GetTraceStatsRequest&&) noexcept;
+  GetTraceStatsRequest& operator=(GetTraceStatsRequest&&);
+  GetTraceStatsRequest(const GetTraceStatsRequest&);
+  GetTraceStatsRequest& operator=(const GetTraceStatsRequest&);
+  bool operator==(const GetTraceStatsRequest&) const;
+  bool operator!=(const GetTraceStatsRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT AttachResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kTraceConfigFieldNumber = 1,
+  };
+
+  AttachResponse();
+  ~AttachResponse() override;
+  AttachResponse(AttachResponse&&) noexcept;
+  AttachResponse& operator=(AttachResponse&&);
+  AttachResponse(const AttachResponse&);
+  AttachResponse& operator=(const AttachResponse&);
+  bool operator==(const AttachResponse&) const;
+  bool operator!=(const AttachResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_trace_config() const { return _has_field_[1]; }
+  const TraceConfig& trace_config() const { return *trace_config_; }
+  TraceConfig* mutable_trace_config() { _has_field_.set(1); return trace_config_.get(); }
+
+ private:
+  ::protozero::CopyablePtr<TraceConfig> trace_config_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT AttachRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kKeyFieldNumber = 1,
+  };
+
+  AttachRequest();
+  ~AttachRequest() override;
+  AttachRequest(AttachRequest&&) noexcept;
+  AttachRequest& operator=(AttachRequest&&);
+  AttachRequest(const AttachRequest&);
+  AttachRequest& operator=(const AttachRequest&);
+  bool operator==(const AttachRequest&) const;
+  bool operator!=(const AttachRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_key() const { return _has_field_[1]; }
+  const std::string& key() const { return key_; }
+  void set_key(const std::string& value) { key_ = value; _has_field_.set(1); }
+
+ private:
+  std::string key_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT DetachResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  DetachResponse();
+  ~DetachResponse() override;
+  DetachResponse(DetachResponse&&) noexcept;
+  DetachResponse& operator=(DetachResponse&&);
+  DetachResponse(const DetachResponse&);
+  DetachResponse& operator=(const DetachResponse&);
+  bool operator==(const DetachResponse&) const;
+  bool operator!=(const DetachResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT DetachRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kKeyFieldNumber = 1,
+  };
+
+  DetachRequest();
+  ~DetachRequest() override;
+  DetachRequest(DetachRequest&&) noexcept;
+  DetachRequest& operator=(DetachRequest&&);
+  DetachRequest(const DetachRequest&);
+  DetachRequest& operator=(const DetachRequest&);
+  bool operator==(const DetachRequest&) const;
+  bool operator!=(const DetachRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_key() const { return _has_field_[1]; }
+  const std::string& key() const { return key_; }
+  void set_key(const std::string& value) { key_ = value; _has_field_.set(1); }
+
+ private:
+  std::string key_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT FlushResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  FlushResponse();
+  ~FlushResponse() override;
+  FlushResponse(FlushResponse&&) noexcept;
+  FlushResponse& operator=(FlushResponse&&);
+  FlushResponse(const FlushResponse&);
+  FlushResponse& operator=(const FlushResponse&);
+  bool operator==(const FlushResponse&) const;
+  bool operator!=(const FlushResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT FlushRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kTimeoutMsFieldNumber = 1,
+  };
+
+  FlushRequest();
+  ~FlushRequest() override;
+  FlushRequest(FlushRequest&&) noexcept;
+  FlushRequest& operator=(FlushRequest&&);
+  FlushRequest(const FlushRequest&);
+  FlushRequest& operator=(const FlushRequest&);
+  bool operator==(const FlushRequest&) const;
+  bool operator!=(const FlushRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_timeout_ms() const { return _has_field_[1]; }
+  uint32_t timeout_ms() const { return timeout_ms_; }
+  void set_timeout_ms(uint32_t value) { timeout_ms_ = value; _has_field_.set(1); }
+
+ private:
+  uint32_t timeout_ms_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT FreeBuffersResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  FreeBuffersResponse();
+  ~FreeBuffersResponse() override;
+  FreeBuffersResponse(FreeBuffersResponse&&) noexcept;
+  FreeBuffersResponse& operator=(FreeBuffersResponse&&);
+  FreeBuffersResponse(const FreeBuffersResponse&);
+  FreeBuffersResponse& operator=(const FreeBuffersResponse&);
+  bool operator==(const FreeBuffersResponse&) const;
+  bool operator!=(const FreeBuffersResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT FreeBuffersRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kBufferIdsFieldNumber = 1,
+  };
+
+  FreeBuffersRequest();
+  ~FreeBuffersRequest() override;
+  FreeBuffersRequest(FreeBuffersRequest&&) noexcept;
+  FreeBuffersRequest& operator=(FreeBuffersRequest&&);
+  FreeBuffersRequest(const FreeBuffersRequest&);
+  FreeBuffersRequest& operator=(const FreeBuffersRequest&);
+  bool operator==(const FreeBuffersRequest&) const;
+  bool operator!=(const FreeBuffersRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<uint32_t>& buffer_ids() const { return buffer_ids_; }
+  std::vector<uint32_t>* mutable_buffer_ids() { return &buffer_ids_; }
+  int buffer_ids_size() const { return static_cast<int>(buffer_ids_.size()); }
+  void clear_buffer_ids() { buffer_ids_.clear(); }
+  void add_buffer_ids(uint32_t value) { buffer_ids_.emplace_back(value); }
+  uint32_t* add_buffer_ids() { buffer_ids_.emplace_back(); return &buffer_ids_.back(); }
+
+ private:
+  std::vector<uint32_t> buffer_ids_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ReadBuffersResponse : public ::protozero::CppMessageObj {
+ public:
+  using Slice = ReadBuffersResponse_Slice;
+  enum FieldNumbers {
+    kSlicesFieldNumber = 2,
+  };
+
+  ReadBuffersResponse();
+  ~ReadBuffersResponse() override;
+  ReadBuffersResponse(ReadBuffersResponse&&) noexcept;
+  ReadBuffersResponse& operator=(ReadBuffersResponse&&);
+  ReadBuffersResponse(const ReadBuffersResponse&);
+  ReadBuffersResponse& operator=(const ReadBuffersResponse&);
+  bool operator==(const ReadBuffersResponse&) const;
+  bool operator!=(const ReadBuffersResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<ReadBuffersResponse_Slice>& slices() const { return slices_; }
+  std::vector<ReadBuffersResponse_Slice>* mutable_slices() { return &slices_; }
+  int slices_size() const;
+  void clear_slices();
+  ReadBuffersResponse_Slice* add_slices();
+
+ private:
+  std::vector<ReadBuffersResponse_Slice> slices_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ReadBuffersResponse_Slice : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDataFieldNumber = 1,
+    kLastSliceForPacketFieldNumber = 2,
+  };
+
+  ReadBuffersResponse_Slice();
+  ~ReadBuffersResponse_Slice() override;
+  ReadBuffersResponse_Slice(ReadBuffersResponse_Slice&&) noexcept;
+  ReadBuffersResponse_Slice& operator=(ReadBuffersResponse_Slice&&);
+  ReadBuffersResponse_Slice(const ReadBuffersResponse_Slice&);
+  ReadBuffersResponse_Slice& operator=(const ReadBuffersResponse_Slice&);
+  bool operator==(const ReadBuffersResponse_Slice&) const;
+  bool operator!=(const ReadBuffersResponse_Slice& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_data() const { return _has_field_[1]; }
+  const std::string& data() const { return data_; }
+  void set_data(const std::string& value) { data_ = value; _has_field_.set(1); }
+  void set_data(const void* p, size_t s) { data_.assign(reinterpret_cast<const char*>(p), s); _has_field_.set(1); }
+
+  bool has_last_slice_for_packet() const { return _has_field_[2]; }
+  bool last_slice_for_packet() const { return last_slice_for_packet_; }
+  void set_last_slice_for_packet(bool value) { last_slice_for_packet_ = value; _has_field_.set(2); }
+
+ private:
+  std::string data_{};
+  bool last_slice_for_packet_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ReadBuffersRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  ReadBuffersRequest();
+  ~ReadBuffersRequest() override;
+  ReadBuffersRequest(ReadBuffersRequest&&) noexcept;
+  ReadBuffersRequest& operator=(ReadBuffersRequest&&);
+  ReadBuffersRequest(const ReadBuffersRequest&);
+  ReadBuffersRequest& operator=(const ReadBuffersRequest&);
+  bool operator==(const ReadBuffersRequest&) const;
+  bool operator!=(const ReadBuffersRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT DisableTracingResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  DisableTracingResponse();
+  ~DisableTracingResponse() override;
+  DisableTracingResponse(DisableTracingResponse&&) noexcept;
+  DisableTracingResponse& operator=(DisableTracingResponse&&);
+  DisableTracingResponse(const DisableTracingResponse&);
+  DisableTracingResponse& operator=(const DisableTracingResponse&);
+  bool operator==(const DisableTracingResponse&) const;
+  bool operator!=(const DisableTracingResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT DisableTracingRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  DisableTracingRequest();
+  ~DisableTracingRequest() override;
+  DisableTracingRequest(DisableTracingRequest&&) noexcept;
+  DisableTracingRequest& operator=(DisableTracingRequest&&);
+  DisableTracingRequest(const DisableTracingRequest&);
+  DisableTracingRequest& operator=(const DisableTracingRequest&);
+  bool operator==(const DisableTracingRequest&) const;
+  bool operator!=(const DisableTracingRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ChangeTraceConfigResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  ChangeTraceConfigResponse();
+  ~ChangeTraceConfigResponse() override;
+  ChangeTraceConfigResponse(ChangeTraceConfigResponse&&) noexcept;
+  ChangeTraceConfigResponse& operator=(ChangeTraceConfigResponse&&);
+  ChangeTraceConfigResponse(const ChangeTraceConfigResponse&);
+  ChangeTraceConfigResponse& operator=(const ChangeTraceConfigResponse&);
+  bool operator==(const ChangeTraceConfigResponse&) const;
+  bool operator!=(const ChangeTraceConfigResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ChangeTraceConfigRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kTraceConfigFieldNumber = 1,
+  };
+
+  ChangeTraceConfigRequest();
+  ~ChangeTraceConfigRequest() override;
+  ChangeTraceConfigRequest(ChangeTraceConfigRequest&&) noexcept;
+  ChangeTraceConfigRequest& operator=(ChangeTraceConfigRequest&&);
+  ChangeTraceConfigRequest(const ChangeTraceConfigRequest&);
+  ChangeTraceConfigRequest& operator=(const ChangeTraceConfigRequest&);
+  bool operator==(const ChangeTraceConfigRequest&) const;
+  bool operator!=(const ChangeTraceConfigRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_trace_config() const { return _has_field_[1]; }
+  const TraceConfig& trace_config() const { return *trace_config_; }
+  TraceConfig* mutable_trace_config() { _has_field_.set(1); return trace_config_.get(); }
+
+ private:
+  ::protozero::CopyablePtr<TraceConfig> trace_config_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT StartTracingResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  StartTracingResponse();
+  ~StartTracingResponse() override;
+  StartTracingResponse(StartTracingResponse&&) noexcept;
+  StartTracingResponse& operator=(StartTracingResponse&&);
+  StartTracingResponse(const StartTracingResponse&);
+  StartTracingResponse& operator=(const StartTracingResponse&);
+  bool operator==(const StartTracingResponse&) const;
+  bool operator!=(const StartTracingResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT StartTracingRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  StartTracingRequest();
+  ~StartTracingRequest() override;
+  StartTracingRequest(StartTracingRequest&&) noexcept;
+  StartTracingRequest& operator=(StartTracingRequest&&);
+  StartTracingRequest(const StartTracingRequest&);
+  StartTracingRequest& operator=(const StartTracingRequest&);
+  bool operator==(const StartTracingRequest&) const;
+  bool operator!=(const StartTracingRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT EnableTracingResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDisabledFieldNumber = 1,
+    kErrorFieldNumber = 3,
+  };
+
+  EnableTracingResponse();
+  ~EnableTracingResponse() override;
+  EnableTracingResponse(EnableTracingResponse&&) noexcept;
+  EnableTracingResponse& operator=(EnableTracingResponse&&);
+  EnableTracingResponse(const EnableTracingResponse&);
+  EnableTracingResponse& operator=(const EnableTracingResponse&);
+  bool operator==(const EnableTracingResponse&) const;
+  bool operator!=(const EnableTracingResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_disabled() const { return _has_field_[1]; }
+  bool disabled() const { return disabled_; }
+  void set_disabled(bool value) { disabled_ = value; _has_field_.set(1); }
+
+  bool has_error() const { return _has_field_[3]; }
+  const std::string& error() const { return error_; }
+  void set_error(const std::string& value) { error_ = value; _has_field_.set(3); }
+
+ private:
+  bool disabled_{};
+  std::string error_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<4> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT EnableTracingRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kTraceConfigFieldNumber = 1,
+    kAttachNotificationOnlyFieldNumber = 2,
+  };
+
+  EnableTracingRequest();
+  ~EnableTracingRequest() override;
+  EnableTracingRequest(EnableTracingRequest&&) noexcept;
+  EnableTracingRequest& operator=(EnableTracingRequest&&);
+  EnableTracingRequest(const EnableTracingRequest&);
+  EnableTracingRequest& operator=(const EnableTracingRequest&);
+  bool operator==(const EnableTracingRequest&) const;
+  bool operator!=(const EnableTracingRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_trace_config() const { return _has_field_[1]; }
+  const TraceConfig& trace_config() const { return *trace_config_; }
+  TraceConfig* mutable_trace_config() { _has_field_.set(1); return trace_config_.get(); }
+
+  bool has_attach_notification_only() const { return _has_field_[2]; }
+  bool attach_notification_only() const { return attach_notification_only_; }
+  void set_attach_notification_only(bool value) { attach_notification_only_ = value; _has_field_.set(2); }
+
+ private:
+  ::protozero::CopyablePtr<TraceConfig> trace_config_;
+  bool attach_notification_only_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_CONSUMER_PORT_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/ipc/consumer_port.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/trace_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/builtin_clock.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/data_source_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/track_event/track_event_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/test_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/sys_stats/sys_stats_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/sys_stats_counters.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/profiling/perf_event_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/perf_events.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/profiling/java_hprof_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/profiling/heapprofd_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/process_stats/process_stats_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/power/android_power_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/interceptor_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/interceptors/console_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/inode_file/inode_file_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/gpu/vulkan_memory_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/gpu/gpu_counter_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/ftrace/ftrace_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/chrome/chrome_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/android/packages_list_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/android/android_polled_state_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/android/android_log_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/android_log_constants.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/trace_stats.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/tracing_service_capabilities.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/observable_events.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/tracing_service_state.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/data_source_descriptor.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/track_event_descriptor.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/gpu_counter_descriptor.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/observable_events.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+SaveTraceForBugreportResponse::SaveTraceForBugreportResponse() = default;
+SaveTraceForBugreportResponse::~SaveTraceForBugreportResponse() = default;
+SaveTraceForBugreportResponse::SaveTraceForBugreportResponse(const SaveTraceForBugreportResponse&) = default;
+SaveTraceForBugreportResponse& SaveTraceForBugreportResponse::operator=(const SaveTraceForBugreportResponse&) = default;
+SaveTraceForBugreportResponse::SaveTraceForBugreportResponse(SaveTraceForBugreportResponse&&) noexcept = default;
+SaveTraceForBugreportResponse& SaveTraceForBugreportResponse::operator=(SaveTraceForBugreportResponse&&) = default;
+
+bool SaveTraceForBugreportResponse::operator==(const SaveTraceForBugreportResponse& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && success_ == other.success_
+   && msg_ == other.msg_;
+}
+
+bool SaveTraceForBugreportResponse::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* success */:
+        field.get(&success_);
+        break;
+      case 2 /* msg */:
+        field.get(&msg_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string SaveTraceForBugreportResponse::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> SaveTraceForBugreportResponse::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void SaveTraceForBugreportResponse::Serialize(::protozero::Message* msg) const {
+  // Field 1: success
+  if (_has_field_[1]) {
+    msg->AppendTinyVarInt(1, success_);
+  }
+
+  // Field 2: msg
+  if (_has_field_[2]) {
+    msg->AppendString(2, msg_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+SaveTraceForBugreportRequest::SaveTraceForBugreportRequest() = default;
+SaveTraceForBugreportRequest::~SaveTraceForBugreportRequest() = default;
+SaveTraceForBugreportRequest::SaveTraceForBugreportRequest(const SaveTraceForBugreportRequest&) = default;
+SaveTraceForBugreportRequest& SaveTraceForBugreportRequest::operator=(const SaveTraceForBugreportRequest&) = default;
+SaveTraceForBugreportRequest::SaveTraceForBugreportRequest(SaveTraceForBugreportRequest&&) noexcept = default;
+SaveTraceForBugreportRequest& SaveTraceForBugreportRequest::operator=(SaveTraceForBugreportRequest&&) = default;
+
+bool SaveTraceForBugreportRequest::operator==(const SaveTraceForBugreportRequest& other) const {
+  return unknown_fields_ == other.unknown_fields_;
+}
+
+bool SaveTraceForBugreportRequest::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string SaveTraceForBugreportRequest::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> SaveTraceForBugreportRequest::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void SaveTraceForBugreportRequest::Serialize(::protozero::Message* msg) const {
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+QueryCapabilitiesResponse::QueryCapabilitiesResponse() = default;
+QueryCapabilitiesResponse::~QueryCapabilitiesResponse() = default;
+QueryCapabilitiesResponse::QueryCapabilitiesResponse(const QueryCapabilitiesResponse&) = default;
+QueryCapabilitiesResponse& QueryCapabilitiesResponse::operator=(const QueryCapabilitiesResponse&) = default;
+QueryCapabilitiesResponse::QueryCapabilitiesResponse(QueryCapabilitiesResponse&&) noexcept = default;
+QueryCapabilitiesResponse& QueryCapabilitiesResponse::operator=(QueryCapabilitiesResponse&&) = default;
+
+bool QueryCapabilitiesResponse::operator==(const QueryCapabilitiesResponse& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && capabilities_ == other.capabilities_;
+}
+
+bool QueryCapabilitiesResponse::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* capabilities */:
+        (*capabilities_).ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string QueryCapabilitiesResponse::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> QueryCapabilitiesResponse::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void QueryCapabilitiesResponse::Serialize(::protozero::Message* msg) const {
+  // Field 1: capabilities
+  if (_has_field_[1]) {
+    (*capabilities_).Serialize(msg->BeginNestedMessage<::protozero::Message>(1));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+QueryCapabilitiesRequest::QueryCapabilitiesRequest() = default;
+QueryCapabilitiesRequest::~QueryCapabilitiesRequest() = default;
+QueryCapabilitiesRequest::QueryCapabilitiesRequest(const QueryCapabilitiesRequest&) = default;
+QueryCapabilitiesRequest& QueryCapabilitiesRequest::operator=(const QueryCapabilitiesRequest&) = default;
+QueryCapabilitiesRequest::QueryCapabilitiesRequest(QueryCapabilitiesRequest&&) noexcept = default;
+QueryCapabilitiesRequest& QueryCapabilitiesRequest::operator=(QueryCapabilitiesRequest&&) = default;
+
+bool QueryCapabilitiesRequest::operator==(const QueryCapabilitiesRequest& other) const {
+  return unknown_fields_ == other.unknown_fields_;
+}
+
+bool QueryCapabilitiesRequest::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string QueryCapabilitiesRequest::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> QueryCapabilitiesRequest::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void QueryCapabilitiesRequest::Serialize(::protozero::Message* msg) const {
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+QueryServiceStateResponse::QueryServiceStateResponse() = default;
+QueryServiceStateResponse::~QueryServiceStateResponse() = default;
+QueryServiceStateResponse::QueryServiceStateResponse(const QueryServiceStateResponse&) = default;
+QueryServiceStateResponse& QueryServiceStateResponse::operator=(const QueryServiceStateResponse&) = default;
+QueryServiceStateResponse::QueryServiceStateResponse(QueryServiceStateResponse&&) noexcept = default;
+QueryServiceStateResponse& QueryServiceStateResponse::operator=(QueryServiceStateResponse&&) = default;
+
+bool QueryServiceStateResponse::operator==(const QueryServiceStateResponse& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && service_state_ == other.service_state_;
+}
+
+bool QueryServiceStateResponse::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* service_state */:
+        (*service_state_).ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string QueryServiceStateResponse::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> QueryServiceStateResponse::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void QueryServiceStateResponse::Serialize(::protozero::Message* msg) const {
+  // Field 1: service_state
+  if (_has_field_[1]) {
+    (*service_state_).Serialize(msg->BeginNestedMessage<::protozero::Message>(1));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+QueryServiceStateRequest::QueryServiceStateRequest() = default;
+QueryServiceStateRequest::~QueryServiceStateRequest() = default;
+QueryServiceStateRequest::QueryServiceStateRequest(const QueryServiceStateRequest&) = default;
+QueryServiceStateRequest& QueryServiceStateRequest::operator=(const QueryServiceStateRequest&) = default;
+QueryServiceStateRequest::QueryServiceStateRequest(QueryServiceStateRequest&&) noexcept = default;
+QueryServiceStateRequest& QueryServiceStateRequest::operator=(QueryServiceStateRequest&&) = default;
+
+bool QueryServiceStateRequest::operator==(const QueryServiceStateRequest& other) const {
+  return unknown_fields_ == other.unknown_fields_;
+}
+
+bool QueryServiceStateRequest::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string QueryServiceStateRequest::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> QueryServiceStateRequest::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void QueryServiceStateRequest::Serialize(::protozero::Message* msg) const {
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+ObserveEventsResponse::ObserveEventsResponse() = default;
+ObserveEventsResponse::~ObserveEventsResponse() = default;
+ObserveEventsResponse::ObserveEventsResponse(const ObserveEventsResponse&) = default;
+ObserveEventsResponse& ObserveEventsResponse::operator=(const ObserveEventsResponse&) = default;
+ObserveEventsResponse::ObserveEventsResponse(ObserveEventsResponse&&) noexcept = default;
+ObserveEventsResponse& ObserveEventsResponse::operator=(ObserveEventsResponse&&) = default;
+
+bool ObserveEventsResponse::operator==(const ObserveEventsResponse& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && events_ == other.events_;
+}
+
+bool ObserveEventsResponse::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* events */:
+        (*events_).ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ObserveEventsResponse::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ObserveEventsResponse::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ObserveEventsResponse::Serialize(::protozero::Message* msg) const {
+  // Field 1: events
+  if (_has_field_[1]) {
+    (*events_).Serialize(msg->BeginNestedMessage<::protozero::Message>(1));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+ObserveEventsRequest::ObserveEventsRequest() = default;
+ObserveEventsRequest::~ObserveEventsRequest() = default;
+ObserveEventsRequest::ObserveEventsRequest(const ObserveEventsRequest&) = default;
+ObserveEventsRequest& ObserveEventsRequest::operator=(const ObserveEventsRequest&) = default;
+ObserveEventsRequest::ObserveEventsRequest(ObserveEventsRequest&&) noexcept = default;
+ObserveEventsRequest& ObserveEventsRequest::operator=(ObserveEventsRequest&&) = default;
+
+bool ObserveEventsRequest::operator==(const ObserveEventsRequest& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && events_to_observe_ == other.events_to_observe_;
+}
+
+bool ObserveEventsRequest::ParseFromArray(const void* raw, size_t size) {
+  events_to_observe_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* events_to_observe */:
+        events_to_observe_.emplace_back();
+        field.get(&events_to_observe_.back());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ObserveEventsRequest::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ObserveEventsRequest::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ObserveEventsRequest::Serialize(::protozero::Message* msg) const {
+  // Field 1: events_to_observe
+  for (auto& it : events_to_observe_) {
+    msg->AppendVarInt(1, it);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+GetTraceStatsResponse::GetTraceStatsResponse() = default;
+GetTraceStatsResponse::~GetTraceStatsResponse() = default;
+GetTraceStatsResponse::GetTraceStatsResponse(const GetTraceStatsResponse&) = default;
+GetTraceStatsResponse& GetTraceStatsResponse::operator=(const GetTraceStatsResponse&) = default;
+GetTraceStatsResponse::GetTraceStatsResponse(GetTraceStatsResponse&&) noexcept = default;
+GetTraceStatsResponse& GetTraceStatsResponse::operator=(GetTraceStatsResponse&&) = default;
+
+bool GetTraceStatsResponse::operator==(const GetTraceStatsResponse& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && trace_stats_ == other.trace_stats_;
+}
+
+bool GetTraceStatsResponse::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* trace_stats */:
+        (*trace_stats_).ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string GetTraceStatsResponse::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> GetTraceStatsResponse::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void GetTraceStatsResponse::Serialize(::protozero::Message* msg) const {
+  // Field 1: trace_stats
+  if (_has_field_[1]) {
+    (*trace_stats_).Serialize(msg->BeginNestedMessage<::protozero::Message>(1));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+GetTraceStatsRequest::GetTraceStatsRequest() = default;
+GetTraceStatsRequest::~GetTraceStatsRequest() = default;
+GetTraceStatsRequest::GetTraceStatsRequest(const GetTraceStatsRequest&) = default;
+GetTraceStatsRequest& GetTraceStatsRequest::operator=(const GetTraceStatsRequest&) = default;
+GetTraceStatsRequest::GetTraceStatsRequest(GetTraceStatsRequest&&) noexcept = default;
+GetTraceStatsRequest& GetTraceStatsRequest::operator=(GetTraceStatsRequest&&) = default;
+
+bool GetTraceStatsRequest::operator==(const GetTraceStatsRequest& other) const {
+  return unknown_fields_ == other.unknown_fields_;
+}
+
+bool GetTraceStatsRequest::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string GetTraceStatsRequest::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> GetTraceStatsRequest::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void GetTraceStatsRequest::Serialize(::protozero::Message* msg) const {
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+AttachResponse::AttachResponse() = default;
+AttachResponse::~AttachResponse() = default;
+AttachResponse::AttachResponse(const AttachResponse&) = default;
+AttachResponse& AttachResponse::operator=(const AttachResponse&) = default;
+AttachResponse::AttachResponse(AttachResponse&&) noexcept = default;
+AttachResponse& AttachResponse::operator=(AttachResponse&&) = default;
+
+bool AttachResponse::operator==(const AttachResponse& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && trace_config_ == other.trace_config_;
+}
+
+bool AttachResponse::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* trace_config */:
+        (*trace_config_).ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string AttachResponse::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> AttachResponse::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void AttachResponse::Serialize(::protozero::Message* msg) const {
+  // Field 1: trace_config
+  if (_has_field_[1]) {
+    (*trace_config_).Serialize(msg->BeginNestedMessage<::protozero::Message>(1));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+AttachRequest::AttachRequest() = default;
+AttachRequest::~AttachRequest() = default;
+AttachRequest::AttachRequest(const AttachRequest&) = default;
+AttachRequest& AttachRequest::operator=(const AttachRequest&) = default;
+AttachRequest::AttachRequest(AttachRequest&&) noexcept = default;
+AttachRequest& AttachRequest::operator=(AttachRequest&&) = default;
+
+bool AttachRequest::operator==(const AttachRequest& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && key_ == other.key_;
+}
+
+bool AttachRequest::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* key */:
+        field.get(&key_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string AttachRequest::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> AttachRequest::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void AttachRequest::Serialize(::protozero::Message* msg) const {
+  // Field 1: key
+  if (_has_field_[1]) {
+    msg->AppendString(1, key_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+DetachResponse::DetachResponse() = default;
+DetachResponse::~DetachResponse() = default;
+DetachResponse::DetachResponse(const DetachResponse&) = default;
+DetachResponse& DetachResponse::operator=(const DetachResponse&) = default;
+DetachResponse::DetachResponse(DetachResponse&&) noexcept = default;
+DetachResponse& DetachResponse::operator=(DetachResponse&&) = default;
+
+bool DetachResponse::operator==(const DetachResponse& other) const {
+  return unknown_fields_ == other.unknown_fields_;
+}
+
+bool DetachResponse::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string DetachResponse::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> DetachResponse::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void DetachResponse::Serialize(::protozero::Message* msg) const {
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+DetachRequest::DetachRequest() = default;
+DetachRequest::~DetachRequest() = default;
+DetachRequest::DetachRequest(const DetachRequest&) = default;
+DetachRequest& DetachRequest::operator=(const DetachRequest&) = default;
+DetachRequest::DetachRequest(DetachRequest&&) noexcept = default;
+DetachRequest& DetachRequest::operator=(DetachRequest&&) = default;
+
+bool DetachRequest::operator==(const DetachRequest& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && key_ == other.key_;
+}
+
+bool DetachRequest::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* key */:
+        field.get(&key_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string DetachRequest::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> DetachRequest::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void DetachRequest::Serialize(::protozero::Message* msg) const {
+  // Field 1: key
+  if (_has_field_[1]) {
+    msg->AppendString(1, key_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+FlushResponse::FlushResponse() = default;
+FlushResponse::~FlushResponse() = default;
+FlushResponse::FlushResponse(const FlushResponse&) = default;
+FlushResponse& FlushResponse::operator=(const FlushResponse&) = default;
+FlushResponse::FlushResponse(FlushResponse&&) noexcept = default;
+FlushResponse& FlushResponse::operator=(FlushResponse&&) = default;
+
+bool FlushResponse::operator==(const FlushResponse& other) const {
+  return unknown_fields_ == other.unknown_fields_;
+}
+
+bool FlushResponse::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string FlushResponse::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> FlushResponse::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void FlushResponse::Serialize(::protozero::Message* msg) const {
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+FlushRequest::FlushRequest() = default;
+FlushRequest::~FlushRequest() = default;
+FlushRequest::FlushRequest(const FlushRequest&) = default;
+FlushRequest& FlushRequest::operator=(const FlushRequest&) = default;
+FlushRequest::FlushRequest(FlushRequest&&) noexcept = default;
+FlushRequest& FlushRequest::operator=(FlushRequest&&) = default;
+
+bool FlushRequest::operator==(const FlushRequest& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && timeout_ms_ == other.timeout_ms_;
+}
+
+bool FlushRequest::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* timeout_ms */:
+        field.get(&timeout_ms_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string FlushRequest::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> FlushRequest::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void FlushRequest::Serialize(::protozero::Message* msg) const {
+  // Field 1: timeout_ms
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, timeout_ms_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+FreeBuffersResponse::FreeBuffersResponse() = default;
+FreeBuffersResponse::~FreeBuffersResponse() = default;
+FreeBuffersResponse::FreeBuffersResponse(const FreeBuffersResponse&) = default;
+FreeBuffersResponse& FreeBuffersResponse::operator=(const FreeBuffersResponse&) = default;
+FreeBuffersResponse::FreeBuffersResponse(FreeBuffersResponse&&) noexcept = default;
+FreeBuffersResponse& FreeBuffersResponse::operator=(FreeBuffersResponse&&) = default;
+
+bool FreeBuffersResponse::operator==(const FreeBuffersResponse& other) const {
+  return unknown_fields_ == other.unknown_fields_;
+}
+
+bool FreeBuffersResponse::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string FreeBuffersResponse::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> FreeBuffersResponse::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void FreeBuffersResponse::Serialize(::protozero::Message* msg) const {
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+FreeBuffersRequest::FreeBuffersRequest() = default;
+FreeBuffersRequest::~FreeBuffersRequest() = default;
+FreeBuffersRequest::FreeBuffersRequest(const FreeBuffersRequest&) = default;
+FreeBuffersRequest& FreeBuffersRequest::operator=(const FreeBuffersRequest&) = default;
+FreeBuffersRequest::FreeBuffersRequest(FreeBuffersRequest&&) noexcept = default;
+FreeBuffersRequest& FreeBuffersRequest::operator=(FreeBuffersRequest&&) = default;
+
+bool FreeBuffersRequest::operator==(const FreeBuffersRequest& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && buffer_ids_ == other.buffer_ids_;
+}
+
+bool FreeBuffersRequest::ParseFromArray(const void* raw, size_t size) {
+  buffer_ids_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* buffer_ids */:
+        buffer_ids_.emplace_back();
+        field.get(&buffer_ids_.back());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string FreeBuffersRequest::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> FreeBuffersRequest::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void FreeBuffersRequest::Serialize(::protozero::Message* msg) const {
+  // Field 1: buffer_ids
+  for (auto& it : buffer_ids_) {
+    msg->AppendVarInt(1, it);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+ReadBuffersResponse::ReadBuffersResponse() = default;
+ReadBuffersResponse::~ReadBuffersResponse() = default;
+ReadBuffersResponse::ReadBuffersResponse(const ReadBuffersResponse&) = default;
+ReadBuffersResponse& ReadBuffersResponse::operator=(const ReadBuffersResponse&) = default;
+ReadBuffersResponse::ReadBuffersResponse(ReadBuffersResponse&&) noexcept = default;
+ReadBuffersResponse& ReadBuffersResponse::operator=(ReadBuffersResponse&&) = default;
+
+bool ReadBuffersResponse::operator==(const ReadBuffersResponse& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && slices_ == other.slices_;
+}
+
+int ReadBuffersResponse::slices_size() const { return static_cast<int>(slices_.size()); }
+void ReadBuffersResponse::clear_slices() { slices_.clear(); }
+ReadBuffersResponse_Slice* ReadBuffersResponse::add_slices() { slices_.emplace_back(); return &slices_.back(); }
+bool ReadBuffersResponse::ParseFromArray(const void* raw, size_t size) {
+  slices_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 2 /* slices */:
+        slices_.emplace_back();
+        slices_.back().ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ReadBuffersResponse::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ReadBuffersResponse::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ReadBuffersResponse::Serialize(::protozero::Message* msg) const {
+  // Field 2: slices
+  for (auto& it : slices_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(2));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+ReadBuffersResponse_Slice::ReadBuffersResponse_Slice() = default;
+ReadBuffersResponse_Slice::~ReadBuffersResponse_Slice() = default;
+ReadBuffersResponse_Slice::ReadBuffersResponse_Slice(const ReadBuffersResponse_Slice&) = default;
+ReadBuffersResponse_Slice& ReadBuffersResponse_Slice::operator=(const ReadBuffersResponse_Slice&) = default;
+ReadBuffersResponse_Slice::ReadBuffersResponse_Slice(ReadBuffersResponse_Slice&&) noexcept = default;
+ReadBuffersResponse_Slice& ReadBuffersResponse_Slice::operator=(ReadBuffersResponse_Slice&&) = default;
+
+bool ReadBuffersResponse_Slice::operator==(const ReadBuffersResponse_Slice& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && data_ == other.data_
+   && last_slice_for_packet_ == other.last_slice_for_packet_;
+}
+
+bool ReadBuffersResponse_Slice::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* data */:
+        field.get(&data_);
+        break;
+      case 2 /* last_slice_for_packet */:
+        field.get(&last_slice_for_packet_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ReadBuffersResponse_Slice::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ReadBuffersResponse_Slice::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ReadBuffersResponse_Slice::Serialize(::protozero::Message* msg) const {
+  // Field 1: data
+  if (_has_field_[1]) {
+    msg->AppendString(1, data_);
+  }
+
+  // Field 2: last_slice_for_packet
+  if (_has_field_[2]) {
+    msg->AppendTinyVarInt(2, last_slice_for_packet_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+ReadBuffersRequest::ReadBuffersRequest() = default;
+ReadBuffersRequest::~ReadBuffersRequest() = default;
+ReadBuffersRequest::ReadBuffersRequest(const ReadBuffersRequest&) = default;
+ReadBuffersRequest& ReadBuffersRequest::operator=(const ReadBuffersRequest&) = default;
+ReadBuffersRequest::ReadBuffersRequest(ReadBuffersRequest&&) noexcept = default;
+ReadBuffersRequest& ReadBuffersRequest::operator=(ReadBuffersRequest&&) = default;
+
+bool ReadBuffersRequest::operator==(const ReadBuffersRequest& other) const {
+  return unknown_fields_ == other.unknown_fields_;
+}
+
+bool ReadBuffersRequest::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ReadBuffersRequest::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ReadBuffersRequest::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ReadBuffersRequest::Serialize(::protozero::Message* msg) const {
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+DisableTracingResponse::DisableTracingResponse() = default;
+DisableTracingResponse::~DisableTracingResponse() = default;
+DisableTracingResponse::DisableTracingResponse(const DisableTracingResponse&) = default;
+DisableTracingResponse& DisableTracingResponse::operator=(const DisableTracingResponse&) = default;
+DisableTracingResponse::DisableTracingResponse(DisableTracingResponse&&) noexcept = default;
+DisableTracingResponse& DisableTracingResponse::operator=(DisableTracingResponse&&) = default;
+
+bool DisableTracingResponse::operator==(const DisableTracingResponse& other) const {
+  return unknown_fields_ == other.unknown_fields_;
+}
+
+bool DisableTracingResponse::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string DisableTracingResponse::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> DisableTracingResponse::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void DisableTracingResponse::Serialize(::protozero::Message* msg) const {
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+DisableTracingRequest::DisableTracingRequest() = default;
+DisableTracingRequest::~DisableTracingRequest() = default;
+DisableTracingRequest::DisableTracingRequest(const DisableTracingRequest&) = default;
+DisableTracingRequest& DisableTracingRequest::operator=(const DisableTracingRequest&) = default;
+DisableTracingRequest::DisableTracingRequest(DisableTracingRequest&&) noexcept = default;
+DisableTracingRequest& DisableTracingRequest::operator=(DisableTracingRequest&&) = default;
+
+bool DisableTracingRequest::operator==(const DisableTracingRequest& other) const {
+  return unknown_fields_ == other.unknown_fields_;
+}
+
+bool DisableTracingRequest::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string DisableTracingRequest::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> DisableTracingRequest::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void DisableTracingRequest::Serialize(::protozero::Message* msg) const {
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+ChangeTraceConfigResponse::ChangeTraceConfigResponse() = default;
+ChangeTraceConfigResponse::~ChangeTraceConfigResponse() = default;
+ChangeTraceConfigResponse::ChangeTraceConfigResponse(const ChangeTraceConfigResponse&) = default;
+ChangeTraceConfigResponse& ChangeTraceConfigResponse::operator=(const ChangeTraceConfigResponse&) = default;
+ChangeTraceConfigResponse::ChangeTraceConfigResponse(ChangeTraceConfigResponse&&) noexcept = default;
+ChangeTraceConfigResponse& ChangeTraceConfigResponse::operator=(ChangeTraceConfigResponse&&) = default;
+
+bool ChangeTraceConfigResponse::operator==(const ChangeTraceConfigResponse& other) const {
+  return unknown_fields_ == other.unknown_fields_;
+}
+
+bool ChangeTraceConfigResponse::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ChangeTraceConfigResponse::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ChangeTraceConfigResponse::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ChangeTraceConfigResponse::Serialize(::protozero::Message* msg) const {
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+ChangeTraceConfigRequest::ChangeTraceConfigRequest() = default;
+ChangeTraceConfigRequest::~ChangeTraceConfigRequest() = default;
+ChangeTraceConfigRequest::ChangeTraceConfigRequest(const ChangeTraceConfigRequest&) = default;
+ChangeTraceConfigRequest& ChangeTraceConfigRequest::operator=(const ChangeTraceConfigRequest&) = default;
+ChangeTraceConfigRequest::ChangeTraceConfigRequest(ChangeTraceConfigRequest&&) noexcept = default;
+ChangeTraceConfigRequest& ChangeTraceConfigRequest::operator=(ChangeTraceConfigRequest&&) = default;
+
+bool ChangeTraceConfigRequest::operator==(const ChangeTraceConfigRequest& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && trace_config_ == other.trace_config_;
+}
+
+bool ChangeTraceConfigRequest::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* trace_config */:
+        (*trace_config_).ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ChangeTraceConfigRequest::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ChangeTraceConfigRequest::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ChangeTraceConfigRequest::Serialize(::protozero::Message* msg) const {
+  // Field 1: trace_config
+  if (_has_field_[1]) {
+    (*trace_config_).Serialize(msg->BeginNestedMessage<::protozero::Message>(1));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+StartTracingResponse::StartTracingResponse() = default;
+StartTracingResponse::~StartTracingResponse() = default;
+StartTracingResponse::StartTracingResponse(const StartTracingResponse&) = default;
+StartTracingResponse& StartTracingResponse::operator=(const StartTracingResponse&) = default;
+StartTracingResponse::StartTracingResponse(StartTracingResponse&&) noexcept = default;
+StartTracingResponse& StartTracingResponse::operator=(StartTracingResponse&&) = default;
+
+bool StartTracingResponse::operator==(const StartTracingResponse& other) const {
+  return unknown_fields_ == other.unknown_fields_;
+}
+
+bool StartTracingResponse::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string StartTracingResponse::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> StartTracingResponse::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void StartTracingResponse::Serialize(::protozero::Message* msg) const {
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+StartTracingRequest::StartTracingRequest() = default;
+StartTracingRequest::~StartTracingRequest() = default;
+StartTracingRequest::StartTracingRequest(const StartTracingRequest&) = default;
+StartTracingRequest& StartTracingRequest::operator=(const StartTracingRequest&) = default;
+StartTracingRequest::StartTracingRequest(StartTracingRequest&&) noexcept = default;
+StartTracingRequest& StartTracingRequest::operator=(StartTracingRequest&&) = default;
+
+bool StartTracingRequest::operator==(const StartTracingRequest& other) const {
+  return unknown_fields_ == other.unknown_fields_;
+}
+
+bool StartTracingRequest::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string StartTracingRequest::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> StartTracingRequest::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void StartTracingRequest::Serialize(::protozero::Message* msg) const {
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+EnableTracingResponse::EnableTracingResponse() = default;
+EnableTracingResponse::~EnableTracingResponse() = default;
+EnableTracingResponse::EnableTracingResponse(const EnableTracingResponse&) = default;
+EnableTracingResponse& EnableTracingResponse::operator=(const EnableTracingResponse&) = default;
+EnableTracingResponse::EnableTracingResponse(EnableTracingResponse&&) noexcept = default;
+EnableTracingResponse& EnableTracingResponse::operator=(EnableTracingResponse&&) = default;
+
+bool EnableTracingResponse::operator==(const EnableTracingResponse& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && disabled_ == other.disabled_
+   && error_ == other.error_;
+}
+
+bool EnableTracingResponse::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* disabled */:
+        field.get(&disabled_);
+        break;
+      case 3 /* error */:
+        field.get(&error_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string EnableTracingResponse::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> EnableTracingResponse::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void EnableTracingResponse::Serialize(::protozero::Message* msg) const {
+  // Field 1: disabled
+  if (_has_field_[1]) {
+    msg->AppendTinyVarInt(1, disabled_);
+  }
+
+  // Field 3: error
+  if (_has_field_[3]) {
+    msg->AppendString(3, error_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+EnableTracingRequest::EnableTracingRequest() = default;
+EnableTracingRequest::~EnableTracingRequest() = default;
+EnableTracingRequest::EnableTracingRequest(const EnableTracingRequest&) = default;
+EnableTracingRequest& EnableTracingRequest::operator=(const EnableTracingRequest&) = default;
+EnableTracingRequest::EnableTracingRequest(EnableTracingRequest&&) noexcept = default;
+EnableTracingRequest& EnableTracingRequest::operator=(EnableTracingRequest&&) = default;
+
+bool EnableTracingRequest::operator==(const EnableTracingRequest& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && trace_config_ == other.trace_config_
+   && attach_notification_only_ == other.attach_notification_only_;
+}
+
+bool EnableTracingRequest::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* trace_config */:
+        (*trace_config_).ParseFromArray(field.data(), field.size());
+        break;
+      case 2 /* attach_notification_only */:
+        field.get(&attach_notification_only_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string EnableTracingRequest::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> EnableTracingRequest::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void EnableTracingRequest::Serialize(::protozero::Message* msg) const {
+  // Field 1: trace_config
+  if (_has_field_[1]) {
+    (*trace_config_).Serialize(msg->BeginNestedMessage<::protozero::Message>(1));
+  }
+
+  // Field 2: attach_notification_only
+  if (_has_field_[2]) {
+    msg->AppendTinyVarInt(2, attach_notification_only_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/ipc/producer_port.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/ipc/producer_port.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_PRODUCER_PORT_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_PRODUCER_PORT_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class SyncResponse;
+class SyncRequest;
+class GetAsyncCommandResponse;
+class GetAsyncCommandResponse_ClearIncrementalState;
+class GetAsyncCommandResponse_Flush;
+class GetAsyncCommandResponse_StopDataSource;
+class GetAsyncCommandResponse_StartDataSource;
+class DataSourceConfig;
+class TestConfig;
+class TestConfig_DummyFields;
+class InterceptorConfig;
+class ChromeConfig;
+class GetAsyncCommandResponse_SetupDataSource;
+class GetAsyncCommandResponse_SetupTracing;
+class GetAsyncCommandRequest;
+class ActivateTriggersResponse;
+class ActivateTriggersRequest;
+class NotifyDataSourceStoppedResponse;
+class NotifyDataSourceStoppedRequest;
+class NotifyDataSourceStartedResponse;
+class NotifyDataSourceStartedRequest;
+class CommitDataResponse;
+class UnregisterTraceWriterResponse;
+class UnregisterTraceWriterRequest;
+class RegisterTraceWriterResponse;
+class RegisterTraceWriterRequest;
+class UnregisterDataSourceResponse;
+class UnregisterDataSourceRequest;
+class RegisterDataSourceResponse;
+class RegisterDataSourceRequest;
+class DataSourceDescriptor;
+class InitializeConnectionResponse;
+class InitializeConnectionRequest;
+enum DataSourceConfig_SessionInitiator : int;
+enum ChromeConfig_ClientPriority : int;
+enum InitializeConnectionRequest_ProducerSMBScrapingMode : int;
+enum InitializeConnectionRequest_ProducerBuildFlags : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum InitializeConnectionRequest_ProducerSMBScrapingMode : int {
+  InitializeConnectionRequest_ProducerSMBScrapingMode_SMB_SCRAPING_UNSPECIFIED = 0,
+  InitializeConnectionRequest_ProducerSMBScrapingMode_SMB_SCRAPING_ENABLED = 1,
+  InitializeConnectionRequest_ProducerSMBScrapingMode_SMB_SCRAPING_DISABLED = 2,
+};
+enum InitializeConnectionRequest_ProducerBuildFlags : int {
+  InitializeConnectionRequest_ProducerBuildFlags_BUILD_FLAGS_UNSPECIFIED = 0,
+  InitializeConnectionRequest_ProducerBuildFlags_BUILD_FLAGS_DCHECKS_ON = 1,
+  InitializeConnectionRequest_ProducerBuildFlags_BUILD_FLAGS_DCHECKS_OFF = 2,
+};
+
+class PERFETTO_EXPORT SyncResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  SyncResponse();
+  ~SyncResponse() override;
+  SyncResponse(SyncResponse&&) noexcept;
+  SyncResponse& operator=(SyncResponse&&);
+  SyncResponse(const SyncResponse&);
+  SyncResponse& operator=(const SyncResponse&);
+  bool operator==(const SyncResponse&) const;
+  bool operator!=(const SyncResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT SyncRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  SyncRequest();
+  ~SyncRequest() override;
+  SyncRequest(SyncRequest&&) noexcept;
+  SyncRequest& operator=(SyncRequest&&);
+  SyncRequest(const SyncRequest&);
+  SyncRequest& operator=(const SyncRequest&);
+  bool operator==(const SyncRequest&) const;
+  bool operator!=(const SyncRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT GetAsyncCommandResponse : public ::protozero::CppMessageObj {
+ public:
+  using SetupDataSource = GetAsyncCommandResponse_SetupDataSource;
+  using StartDataSource = GetAsyncCommandResponse_StartDataSource;
+  using StopDataSource = GetAsyncCommandResponse_StopDataSource;
+  using SetupTracing = GetAsyncCommandResponse_SetupTracing;
+  using Flush = GetAsyncCommandResponse_Flush;
+  using ClearIncrementalState = GetAsyncCommandResponse_ClearIncrementalState;
+  enum FieldNumbers {
+    kSetupTracingFieldNumber = 3,
+    kSetupDataSourceFieldNumber = 6,
+    kStartDataSourceFieldNumber = 1,
+    kStopDataSourceFieldNumber = 2,
+    kFlushFieldNumber = 5,
+    kClearIncrementalStateFieldNumber = 7,
+  };
+
+  GetAsyncCommandResponse();
+  ~GetAsyncCommandResponse() override;
+  GetAsyncCommandResponse(GetAsyncCommandResponse&&) noexcept;
+  GetAsyncCommandResponse& operator=(GetAsyncCommandResponse&&);
+  GetAsyncCommandResponse(const GetAsyncCommandResponse&);
+  GetAsyncCommandResponse& operator=(const GetAsyncCommandResponse&);
+  bool operator==(const GetAsyncCommandResponse&) const;
+  bool operator!=(const GetAsyncCommandResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_setup_tracing() const { return _has_field_[3]; }
+  const GetAsyncCommandResponse_SetupTracing& setup_tracing() const { return *setup_tracing_; }
+  GetAsyncCommandResponse_SetupTracing* mutable_setup_tracing() { _has_field_.set(3); return setup_tracing_.get(); }
+
+  bool has_setup_data_source() const { return _has_field_[6]; }
+  const GetAsyncCommandResponse_SetupDataSource& setup_data_source() const { return *setup_data_source_; }
+  GetAsyncCommandResponse_SetupDataSource* mutable_setup_data_source() { _has_field_.set(6); return setup_data_source_.get(); }
+
+  bool has_start_data_source() const { return _has_field_[1]; }
+  const GetAsyncCommandResponse_StartDataSource& start_data_source() const { return *start_data_source_; }
+  GetAsyncCommandResponse_StartDataSource* mutable_start_data_source() { _has_field_.set(1); return start_data_source_.get(); }
+
+  bool has_stop_data_source() const { return _has_field_[2]; }
+  const GetAsyncCommandResponse_StopDataSource& stop_data_source() const { return *stop_data_source_; }
+  GetAsyncCommandResponse_StopDataSource* mutable_stop_data_source() { _has_field_.set(2); return stop_data_source_.get(); }
+
+  bool has_flush() const { return _has_field_[5]; }
+  const GetAsyncCommandResponse_Flush& flush() const { return *flush_; }
+  GetAsyncCommandResponse_Flush* mutable_flush() { _has_field_.set(5); return flush_.get(); }
+
+  bool has_clear_incremental_state() const { return _has_field_[7]; }
+  const GetAsyncCommandResponse_ClearIncrementalState& clear_incremental_state() const { return *clear_incremental_state_; }
+  GetAsyncCommandResponse_ClearIncrementalState* mutable_clear_incremental_state() { _has_field_.set(7); return clear_incremental_state_.get(); }
+
+ private:
+  ::protozero::CopyablePtr<GetAsyncCommandResponse_SetupTracing> setup_tracing_;
+  ::protozero::CopyablePtr<GetAsyncCommandResponse_SetupDataSource> setup_data_source_;
+  ::protozero::CopyablePtr<GetAsyncCommandResponse_StartDataSource> start_data_source_;
+  ::protozero::CopyablePtr<GetAsyncCommandResponse_StopDataSource> stop_data_source_;
+  ::protozero::CopyablePtr<GetAsyncCommandResponse_Flush> flush_;
+  ::protozero::CopyablePtr<GetAsyncCommandResponse_ClearIncrementalState> clear_incremental_state_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<8> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT GetAsyncCommandResponse_ClearIncrementalState : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDataSourceIdsFieldNumber = 1,
+  };
+
+  GetAsyncCommandResponse_ClearIncrementalState();
+  ~GetAsyncCommandResponse_ClearIncrementalState() override;
+  GetAsyncCommandResponse_ClearIncrementalState(GetAsyncCommandResponse_ClearIncrementalState&&) noexcept;
+  GetAsyncCommandResponse_ClearIncrementalState& operator=(GetAsyncCommandResponse_ClearIncrementalState&&);
+  GetAsyncCommandResponse_ClearIncrementalState(const GetAsyncCommandResponse_ClearIncrementalState&);
+  GetAsyncCommandResponse_ClearIncrementalState& operator=(const GetAsyncCommandResponse_ClearIncrementalState&);
+  bool operator==(const GetAsyncCommandResponse_ClearIncrementalState&) const;
+  bool operator!=(const GetAsyncCommandResponse_ClearIncrementalState& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<uint64_t>& data_source_ids() const { return data_source_ids_; }
+  std::vector<uint64_t>* mutable_data_source_ids() { return &data_source_ids_; }
+  int data_source_ids_size() const { return static_cast<int>(data_source_ids_.size()); }
+  void clear_data_source_ids() { data_source_ids_.clear(); }
+  void add_data_source_ids(uint64_t value) { data_source_ids_.emplace_back(value); }
+  uint64_t* add_data_source_ids() { data_source_ids_.emplace_back(); return &data_source_ids_.back(); }
+
+ private:
+  std::vector<uint64_t> data_source_ids_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT GetAsyncCommandResponse_Flush : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDataSourceIdsFieldNumber = 1,
+    kRequestIdFieldNumber = 2,
+  };
+
+  GetAsyncCommandResponse_Flush();
+  ~GetAsyncCommandResponse_Flush() override;
+  GetAsyncCommandResponse_Flush(GetAsyncCommandResponse_Flush&&) noexcept;
+  GetAsyncCommandResponse_Flush& operator=(GetAsyncCommandResponse_Flush&&);
+  GetAsyncCommandResponse_Flush(const GetAsyncCommandResponse_Flush&);
+  GetAsyncCommandResponse_Flush& operator=(const GetAsyncCommandResponse_Flush&);
+  bool operator==(const GetAsyncCommandResponse_Flush&) const;
+  bool operator!=(const GetAsyncCommandResponse_Flush& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<uint64_t>& data_source_ids() const { return data_source_ids_; }
+  std::vector<uint64_t>* mutable_data_source_ids() { return &data_source_ids_; }
+  int data_source_ids_size() const { return static_cast<int>(data_source_ids_.size()); }
+  void clear_data_source_ids() { data_source_ids_.clear(); }
+  void add_data_source_ids(uint64_t value) { data_source_ids_.emplace_back(value); }
+  uint64_t* add_data_source_ids() { data_source_ids_.emplace_back(); return &data_source_ids_.back(); }
+
+  bool has_request_id() const { return _has_field_[2]; }
+  uint64_t request_id() const { return request_id_; }
+  void set_request_id(uint64_t value) { request_id_ = value; _has_field_.set(2); }
+
+ private:
+  std::vector<uint64_t> data_source_ids_;
+  uint64_t request_id_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT GetAsyncCommandResponse_StopDataSource : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kInstanceIdFieldNumber = 1,
+  };
+
+  GetAsyncCommandResponse_StopDataSource();
+  ~GetAsyncCommandResponse_StopDataSource() override;
+  GetAsyncCommandResponse_StopDataSource(GetAsyncCommandResponse_StopDataSource&&) noexcept;
+  GetAsyncCommandResponse_StopDataSource& operator=(GetAsyncCommandResponse_StopDataSource&&);
+  GetAsyncCommandResponse_StopDataSource(const GetAsyncCommandResponse_StopDataSource&);
+  GetAsyncCommandResponse_StopDataSource& operator=(const GetAsyncCommandResponse_StopDataSource&);
+  bool operator==(const GetAsyncCommandResponse_StopDataSource&) const;
+  bool operator!=(const GetAsyncCommandResponse_StopDataSource& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_instance_id() const { return _has_field_[1]; }
+  uint64_t instance_id() const { return instance_id_; }
+  void set_instance_id(uint64_t value) { instance_id_ = value; _has_field_.set(1); }
+
+ private:
+  uint64_t instance_id_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT GetAsyncCommandResponse_StartDataSource : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNewInstanceIdFieldNumber = 1,
+    kConfigFieldNumber = 2,
+  };
+
+  GetAsyncCommandResponse_StartDataSource();
+  ~GetAsyncCommandResponse_StartDataSource() override;
+  GetAsyncCommandResponse_StartDataSource(GetAsyncCommandResponse_StartDataSource&&) noexcept;
+  GetAsyncCommandResponse_StartDataSource& operator=(GetAsyncCommandResponse_StartDataSource&&);
+  GetAsyncCommandResponse_StartDataSource(const GetAsyncCommandResponse_StartDataSource&);
+  GetAsyncCommandResponse_StartDataSource& operator=(const GetAsyncCommandResponse_StartDataSource&);
+  bool operator==(const GetAsyncCommandResponse_StartDataSource&) const;
+  bool operator!=(const GetAsyncCommandResponse_StartDataSource& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_new_instance_id() const { return _has_field_[1]; }
+  uint64_t new_instance_id() const { return new_instance_id_; }
+  void set_new_instance_id(uint64_t value) { new_instance_id_ = value; _has_field_.set(1); }
+
+  bool has_config() const { return _has_field_[2]; }
+  const DataSourceConfig& config() const { return *config_; }
+  DataSourceConfig* mutable_config() { _has_field_.set(2); return config_.get(); }
+
+ private:
+  uint64_t new_instance_id_{};
+  ::protozero::CopyablePtr<DataSourceConfig> config_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT GetAsyncCommandResponse_SetupDataSource : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNewInstanceIdFieldNumber = 1,
+    kConfigFieldNumber = 2,
+  };
+
+  GetAsyncCommandResponse_SetupDataSource();
+  ~GetAsyncCommandResponse_SetupDataSource() override;
+  GetAsyncCommandResponse_SetupDataSource(GetAsyncCommandResponse_SetupDataSource&&) noexcept;
+  GetAsyncCommandResponse_SetupDataSource& operator=(GetAsyncCommandResponse_SetupDataSource&&);
+  GetAsyncCommandResponse_SetupDataSource(const GetAsyncCommandResponse_SetupDataSource&);
+  GetAsyncCommandResponse_SetupDataSource& operator=(const GetAsyncCommandResponse_SetupDataSource&);
+  bool operator==(const GetAsyncCommandResponse_SetupDataSource&) const;
+  bool operator!=(const GetAsyncCommandResponse_SetupDataSource& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_new_instance_id() const { return _has_field_[1]; }
+  uint64_t new_instance_id() const { return new_instance_id_; }
+  void set_new_instance_id(uint64_t value) { new_instance_id_ = value; _has_field_.set(1); }
+
+  bool has_config() const { return _has_field_[2]; }
+  const DataSourceConfig& config() const { return *config_; }
+  DataSourceConfig* mutable_config() { _has_field_.set(2); return config_.get(); }
+
+ private:
+  uint64_t new_instance_id_{};
+  ::protozero::CopyablePtr<DataSourceConfig> config_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT GetAsyncCommandResponse_SetupTracing : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kSharedBufferPageSizeKbFieldNumber = 1,
+  };
+
+  GetAsyncCommandResponse_SetupTracing();
+  ~GetAsyncCommandResponse_SetupTracing() override;
+  GetAsyncCommandResponse_SetupTracing(GetAsyncCommandResponse_SetupTracing&&) noexcept;
+  GetAsyncCommandResponse_SetupTracing& operator=(GetAsyncCommandResponse_SetupTracing&&);
+  GetAsyncCommandResponse_SetupTracing(const GetAsyncCommandResponse_SetupTracing&);
+  GetAsyncCommandResponse_SetupTracing& operator=(const GetAsyncCommandResponse_SetupTracing&);
+  bool operator==(const GetAsyncCommandResponse_SetupTracing&) const;
+  bool operator!=(const GetAsyncCommandResponse_SetupTracing& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_shared_buffer_page_size_kb() const { return _has_field_[1]; }
+  uint32_t shared_buffer_page_size_kb() const { return shared_buffer_page_size_kb_; }
+  void set_shared_buffer_page_size_kb(uint32_t value) { shared_buffer_page_size_kb_ = value; _has_field_.set(1); }
+
+ private:
+  uint32_t shared_buffer_page_size_kb_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT GetAsyncCommandRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  GetAsyncCommandRequest();
+  ~GetAsyncCommandRequest() override;
+  GetAsyncCommandRequest(GetAsyncCommandRequest&&) noexcept;
+  GetAsyncCommandRequest& operator=(GetAsyncCommandRequest&&);
+  GetAsyncCommandRequest(const GetAsyncCommandRequest&);
+  GetAsyncCommandRequest& operator=(const GetAsyncCommandRequest&);
+  bool operator==(const GetAsyncCommandRequest&) const;
+  bool operator!=(const GetAsyncCommandRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ActivateTriggersResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  ActivateTriggersResponse();
+  ~ActivateTriggersResponse() override;
+  ActivateTriggersResponse(ActivateTriggersResponse&&) noexcept;
+  ActivateTriggersResponse& operator=(ActivateTriggersResponse&&);
+  ActivateTriggersResponse(const ActivateTriggersResponse&);
+  ActivateTriggersResponse& operator=(const ActivateTriggersResponse&);
+  bool operator==(const ActivateTriggersResponse&) const;
+  bool operator!=(const ActivateTriggersResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ActivateTriggersRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kTriggerNamesFieldNumber = 1,
+  };
+
+  ActivateTriggersRequest();
+  ~ActivateTriggersRequest() override;
+  ActivateTriggersRequest(ActivateTriggersRequest&&) noexcept;
+  ActivateTriggersRequest& operator=(ActivateTriggersRequest&&);
+  ActivateTriggersRequest(const ActivateTriggersRequest&);
+  ActivateTriggersRequest& operator=(const ActivateTriggersRequest&);
+  bool operator==(const ActivateTriggersRequest&) const;
+  bool operator!=(const ActivateTriggersRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<std::string>& trigger_names() const { return trigger_names_; }
+  std::vector<std::string>* mutable_trigger_names() { return &trigger_names_; }
+  int trigger_names_size() const { return static_cast<int>(trigger_names_.size()); }
+  void clear_trigger_names() { trigger_names_.clear(); }
+  void add_trigger_names(std::string value) { trigger_names_.emplace_back(value); }
+  std::string* add_trigger_names() { trigger_names_.emplace_back(); return &trigger_names_.back(); }
+
+ private:
+  std::vector<std::string> trigger_names_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT NotifyDataSourceStoppedResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  NotifyDataSourceStoppedResponse();
+  ~NotifyDataSourceStoppedResponse() override;
+  NotifyDataSourceStoppedResponse(NotifyDataSourceStoppedResponse&&) noexcept;
+  NotifyDataSourceStoppedResponse& operator=(NotifyDataSourceStoppedResponse&&);
+  NotifyDataSourceStoppedResponse(const NotifyDataSourceStoppedResponse&);
+  NotifyDataSourceStoppedResponse& operator=(const NotifyDataSourceStoppedResponse&);
+  bool operator==(const NotifyDataSourceStoppedResponse&) const;
+  bool operator!=(const NotifyDataSourceStoppedResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT NotifyDataSourceStoppedRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDataSourceIdFieldNumber = 1,
+  };
+
+  NotifyDataSourceStoppedRequest();
+  ~NotifyDataSourceStoppedRequest() override;
+  NotifyDataSourceStoppedRequest(NotifyDataSourceStoppedRequest&&) noexcept;
+  NotifyDataSourceStoppedRequest& operator=(NotifyDataSourceStoppedRequest&&);
+  NotifyDataSourceStoppedRequest(const NotifyDataSourceStoppedRequest&);
+  NotifyDataSourceStoppedRequest& operator=(const NotifyDataSourceStoppedRequest&);
+  bool operator==(const NotifyDataSourceStoppedRequest&) const;
+  bool operator!=(const NotifyDataSourceStoppedRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_data_source_id() const { return _has_field_[1]; }
+  uint64_t data_source_id() const { return data_source_id_; }
+  void set_data_source_id(uint64_t value) { data_source_id_ = value; _has_field_.set(1); }
+
+ private:
+  uint64_t data_source_id_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT NotifyDataSourceStartedResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  NotifyDataSourceStartedResponse();
+  ~NotifyDataSourceStartedResponse() override;
+  NotifyDataSourceStartedResponse(NotifyDataSourceStartedResponse&&) noexcept;
+  NotifyDataSourceStartedResponse& operator=(NotifyDataSourceStartedResponse&&);
+  NotifyDataSourceStartedResponse(const NotifyDataSourceStartedResponse&);
+  NotifyDataSourceStartedResponse& operator=(const NotifyDataSourceStartedResponse&);
+  bool operator==(const NotifyDataSourceStartedResponse&) const;
+  bool operator!=(const NotifyDataSourceStartedResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT NotifyDataSourceStartedRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDataSourceIdFieldNumber = 1,
+  };
+
+  NotifyDataSourceStartedRequest();
+  ~NotifyDataSourceStartedRequest() override;
+  NotifyDataSourceStartedRequest(NotifyDataSourceStartedRequest&&) noexcept;
+  NotifyDataSourceStartedRequest& operator=(NotifyDataSourceStartedRequest&&);
+  NotifyDataSourceStartedRequest(const NotifyDataSourceStartedRequest&);
+  NotifyDataSourceStartedRequest& operator=(const NotifyDataSourceStartedRequest&);
+  bool operator==(const NotifyDataSourceStartedRequest&) const;
+  bool operator!=(const NotifyDataSourceStartedRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_data_source_id() const { return _has_field_[1]; }
+  uint64_t data_source_id() const { return data_source_id_; }
+  void set_data_source_id(uint64_t value) { data_source_id_ = value; _has_field_.set(1); }
+
+ private:
+  uint64_t data_source_id_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT CommitDataResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  CommitDataResponse();
+  ~CommitDataResponse() override;
+  CommitDataResponse(CommitDataResponse&&) noexcept;
+  CommitDataResponse& operator=(CommitDataResponse&&);
+  CommitDataResponse(const CommitDataResponse&);
+  CommitDataResponse& operator=(const CommitDataResponse&);
+  bool operator==(const CommitDataResponse&) const;
+  bool operator!=(const CommitDataResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT UnregisterTraceWriterResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  UnregisterTraceWriterResponse();
+  ~UnregisterTraceWriterResponse() override;
+  UnregisterTraceWriterResponse(UnregisterTraceWriterResponse&&) noexcept;
+  UnregisterTraceWriterResponse& operator=(UnregisterTraceWriterResponse&&);
+  UnregisterTraceWriterResponse(const UnregisterTraceWriterResponse&);
+  UnregisterTraceWriterResponse& operator=(const UnregisterTraceWriterResponse&);
+  bool operator==(const UnregisterTraceWriterResponse&) const;
+  bool operator!=(const UnregisterTraceWriterResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT UnregisterTraceWriterRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kTraceWriterIdFieldNumber = 1,
+  };
+
+  UnregisterTraceWriterRequest();
+  ~UnregisterTraceWriterRequest() override;
+  UnregisterTraceWriterRequest(UnregisterTraceWriterRequest&&) noexcept;
+  UnregisterTraceWriterRequest& operator=(UnregisterTraceWriterRequest&&);
+  UnregisterTraceWriterRequest(const UnregisterTraceWriterRequest&);
+  UnregisterTraceWriterRequest& operator=(const UnregisterTraceWriterRequest&);
+  bool operator==(const UnregisterTraceWriterRequest&) const;
+  bool operator!=(const UnregisterTraceWriterRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_trace_writer_id() const { return _has_field_[1]; }
+  uint32_t trace_writer_id() const { return trace_writer_id_; }
+  void set_trace_writer_id(uint32_t value) { trace_writer_id_ = value; _has_field_.set(1); }
+
+ private:
+  uint32_t trace_writer_id_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT RegisterTraceWriterResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  RegisterTraceWriterResponse();
+  ~RegisterTraceWriterResponse() override;
+  RegisterTraceWriterResponse(RegisterTraceWriterResponse&&) noexcept;
+  RegisterTraceWriterResponse& operator=(RegisterTraceWriterResponse&&);
+  RegisterTraceWriterResponse(const RegisterTraceWriterResponse&);
+  RegisterTraceWriterResponse& operator=(const RegisterTraceWriterResponse&);
+  bool operator==(const RegisterTraceWriterResponse&) const;
+  bool operator!=(const RegisterTraceWriterResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT RegisterTraceWriterRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kTraceWriterIdFieldNumber = 1,
+    kTargetBufferFieldNumber = 2,
+  };
+
+  RegisterTraceWriterRequest();
+  ~RegisterTraceWriterRequest() override;
+  RegisterTraceWriterRequest(RegisterTraceWriterRequest&&) noexcept;
+  RegisterTraceWriterRequest& operator=(RegisterTraceWriterRequest&&);
+  RegisterTraceWriterRequest(const RegisterTraceWriterRequest&);
+  RegisterTraceWriterRequest& operator=(const RegisterTraceWriterRequest&);
+  bool operator==(const RegisterTraceWriterRequest&) const;
+  bool operator!=(const RegisterTraceWriterRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_trace_writer_id() const { return _has_field_[1]; }
+  uint32_t trace_writer_id() const { return trace_writer_id_; }
+  void set_trace_writer_id(uint32_t value) { trace_writer_id_ = value; _has_field_.set(1); }
+
+  bool has_target_buffer() const { return _has_field_[2]; }
+  uint32_t target_buffer() const { return target_buffer_; }
+  void set_target_buffer(uint32_t value) { target_buffer_ = value; _has_field_.set(2); }
+
+ private:
+  uint32_t trace_writer_id_{};
+  uint32_t target_buffer_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT UnregisterDataSourceResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  UnregisterDataSourceResponse();
+  ~UnregisterDataSourceResponse() override;
+  UnregisterDataSourceResponse(UnregisterDataSourceResponse&&) noexcept;
+  UnregisterDataSourceResponse& operator=(UnregisterDataSourceResponse&&);
+  UnregisterDataSourceResponse(const UnregisterDataSourceResponse&);
+  UnregisterDataSourceResponse& operator=(const UnregisterDataSourceResponse&);
+  bool operator==(const UnregisterDataSourceResponse&) const;
+  bool operator!=(const UnregisterDataSourceResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT UnregisterDataSourceRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDataSourceNameFieldNumber = 1,
+  };
+
+  UnregisterDataSourceRequest();
+  ~UnregisterDataSourceRequest() override;
+  UnregisterDataSourceRequest(UnregisterDataSourceRequest&&) noexcept;
+  UnregisterDataSourceRequest& operator=(UnregisterDataSourceRequest&&);
+  UnregisterDataSourceRequest(const UnregisterDataSourceRequest&);
+  UnregisterDataSourceRequest& operator=(const UnregisterDataSourceRequest&);
+  bool operator==(const UnregisterDataSourceRequest&) const;
+  bool operator!=(const UnregisterDataSourceRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_data_source_name() const { return _has_field_[1]; }
+  const std::string& data_source_name() const { return data_source_name_; }
+  void set_data_source_name(const std::string& value) { data_source_name_ = value; _has_field_.set(1); }
+
+ private:
+  std::string data_source_name_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT RegisterDataSourceResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kErrorFieldNumber = 1,
+  };
+
+  RegisterDataSourceResponse();
+  ~RegisterDataSourceResponse() override;
+  RegisterDataSourceResponse(RegisterDataSourceResponse&&) noexcept;
+  RegisterDataSourceResponse& operator=(RegisterDataSourceResponse&&);
+  RegisterDataSourceResponse(const RegisterDataSourceResponse&);
+  RegisterDataSourceResponse& operator=(const RegisterDataSourceResponse&);
+  bool operator==(const RegisterDataSourceResponse&) const;
+  bool operator!=(const RegisterDataSourceResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_error() const { return _has_field_[1]; }
+  const std::string& error() const { return error_; }
+  void set_error(const std::string& value) { error_ = value; _has_field_.set(1); }
+
+ private:
+  std::string error_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT RegisterDataSourceRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDataSourceDescriptorFieldNumber = 1,
+  };
+
+  RegisterDataSourceRequest();
+  ~RegisterDataSourceRequest() override;
+  RegisterDataSourceRequest(RegisterDataSourceRequest&&) noexcept;
+  RegisterDataSourceRequest& operator=(RegisterDataSourceRequest&&);
+  RegisterDataSourceRequest(const RegisterDataSourceRequest&);
+  RegisterDataSourceRequest& operator=(const RegisterDataSourceRequest&);
+  bool operator==(const RegisterDataSourceRequest&) const;
+  bool operator!=(const RegisterDataSourceRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_data_source_descriptor() const { return _has_field_[1]; }
+  const DataSourceDescriptor& data_source_descriptor() const { return *data_source_descriptor_; }
+  DataSourceDescriptor* mutable_data_source_descriptor() { _has_field_.set(1); return data_source_descriptor_.get(); }
+
+ private:
+  ::protozero::CopyablePtr<DataSourceDescriptor> data_source_descriptor_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT InitializeConnectionResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kUsingShmemProvidedByProducerFieldNumber = 1,
+    kDirectSmbPatchingSupportedFieldNumber = 2,
+  };
+
+  InitializeConnectionResponse();
+  ~InitializeConnectionResponse() override;
+  InitializeConnectionResponse(InitializeConnectionResponse&&) noexcept;
+  InitializeConnectionResponse& operator=(InitializeConnectionResponse&&);
+  InitializeConnectionResponse(const InitializeConnectionResponse&);
+  InitializeConnectionResponse& operator=(const InitializeConnectionResponse&);
+  bool operator==(const InitializeConnectionResponse&) const;
+  bool operator!=(const InitializeConnectionResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_using_shmem_provided_by_producer() const { return _has_field_[1]; }
+  bool using_shmem_provided_by_producer() const { return using_shmem_provided_by_producer_; }
+  void set_using_shmem_provided_by_producer(bool value) { using_shmem_provided_by_producer_ = value; _has_field_.set(1); }
+
+  bool has_direct_smb_patching_supported() const { return _has_field_[2]; }
+  bool direct_smb_patching_supported() const { return direct_smb_patching_supported_; }
+  void set_direct_smb_patching_supported(bool value) { direct_smb_patching_supported_ = value; _has_field_.set(2); }
+
+ private:
+  bool using_shmem_provided_by_producer_{};
+  bool direct_smb_patching_supported_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT InitializeConnectionRequest : public ::protozero::CppMessageObj {
+ public:
+  using ProducerSMBScrapingMode = InitializeConnectionRequest_ProducerSMBScrapingMode;
+  static constexpr auto SMB_SCRAPING_UNSPECIFIED = InitializeConnectionRequest_ProducerSMBScrapingMode_SMB_SCRAPING_UNSPECIFIED;
+  static constexpr auto SMB_SCRAPING_ENABLED = InitializeConnectionRequest_ProducerSMBScrapingMode_SMB_SCRAPING_ENABLED;
+  static constexpr auto SMB_SCRAPING_DISABLED = InitializeConnectionRequest_ProducerSMBScrapingMode_SMB_SCRAPING_DISABLED;
+  static constexpr auto ProducerSMBScrapingMode_MIN = InitializeConnectionRequest_ProducerSMBScrapingMode_SMB_SCRAPING_UNSPECIFIED;
+  static constexpr auto ProducerSMBScrapingMode_MAX = InitializeConnectionRequest_ProducerSMBScrapingMode_SMB_SCRAPING_DISABLED;
+  using ProducerBuildFlags = InitializeConnectionRequest_ProducerBuildFlags;
+  static constexpr auto BUILD_FLAGS_UNSPECIFIED = InitializeConnectionRequest_ProducerBuildFlags_BUILD_FLAGS_UNSPECIFIED;
+  static constexpr auto BUILD_FLAGS_DCHECKS_ON = InitializeConnectionRequest_ProducerBuildFlags_BUILD_FLAGS_DCHECKS_ON;
+  static constexpr auto BUILD_FLAGS_DCHECKS_OFF = InitializeConnectionRequest_ProducerBuildFlags_BUILD_FLAGS_DCHECKS_OFF;
+  static constexpr auto ProducerBuildFlags_MIN = InitializeConnectionRequest_ProducerBuildFlags_BUILD_FLAGS_UNSPECIFIED;
+  static constexpr auto ProducerBuildFlags_MAX = InitializeConnectionRequest_ProducerBuildFlags_BUILD_FLAGS_DCHECKS_OFF;
+  enum FieldNumbers {
+    kSharedMemoryPageSizeHintBytesFieldNumber = 1,
+    kSharedMemorySizeHintBytesFieldNumber = 2,
+    kProducerNameFieldNumber = 3,
+    kSmbScrapingModeFieldNumber = 4,
+    kBuildFlagsFieldNumber = 5,
+    kProducerProvidedShmemFieldNumber = 6,
+    kSdkVersionFieldNumber = 8,
+  };
+
+  InitializeConnectionRequest();
+  ~InitializeConnectionRequest() override;
+  InitializeConnectionRequest(InitializeConnectionRequest&&) noexcept;
+  InitializeConnectionRequest& operator=(InitializeConnectionRequest&&);
+  InitializeConnectionRequest(const InitializeConnectionRequest&);
+  InitializeConnectionRequest& operator=(const InitializeConnectionRequest&);
+  bool operator==(const InitializeConnectionRequest&) const;
+  bool operator!=(const InitializeConnectionRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_shared_memory_page_size_hint_bytes() const { return _has_field_[1]; }
+  uint32_t shared_memory_page_size_hint_bytes() const { return shared_memory_page_size_hint_bytes_; }
+  void set_shared_memory_page_size_hint_bytes(uint32_t value) { shared_memory_page_size_hint_bytes_ = value; _has_field_.set(1); }
+
+  bool has_shared_memory_size_hint_bytes() const { return _has_field_[2]; }
+  uint32_t shared_memory_size_hint_bytes() const { return shared_memory_size_hint_bytes_; }
+  void set_shared_memory_size_hint_bytes(uint32_t value) { shared_memory_size_hint_bytes_ = value; _has_field_.set(2); }
+
+  bool has_producer_name() const { return _has_field_[3]; }
+  const std::string& producer_name() const { return producer_name_; }
+  void set_producer_name(const std::string& value) { producer_name_ = value; _has_field_.set(3); }
+
+  bool has_smb_scraping_mode() const { return _has_field_[4]; }
+  InitializeConnectionRequest_ProducerSMBScrapingMode smb_scraping_mode() const { return smb_scraping_mode_; }
+  void set_smb_scraping_mode(InitializeConnectionRequest_ProducerSMBScrapingMode value) { smb_scraping_mode_ = value; _has_field_.set(4); }
+
+  bool has_build_flags() const { return _has_field_[5]; }
+  InitializeConnectionRequest_ProducerBuildFlags build_flags() const { return build_flags_; }
+  void set_build_flags(InitializeConnectionRequest_ProducerBuildFlags value) { build_flags_ = value; _has_field_.set(5); }
+
+  bool has_producer_provided_shmem() const { return _has_field_[6]; }
+  bool producer_provided_shmem() const { return producer_provided_shmem_; }
+  void set_producer_provided_shmem(bool value) { producer_provided_shmem_ = value; _has_field_.set(6); }
+
+  bool has_sdk_version() const { return _has_field_[8]; }
+  const std::string& sdk_version() const { return sdk_version_; }
+  void set_sdk_version(const std::string& value) { sdk_version_ = value; _has_field_.set(8); }
+
+ private:
+  uint32_t shared_memory_page_size_hint_bytes_{};
+  uint32_t shared_memory_size_hint_bytes_{};
+  std::string producer_name_{};
+  InitializeConnectionRequest_ProducerSMBScrapingMode smb_scraping_mode_{};
+  InitializeConnectionRequest_ProducerBuildFlags build_flags_{};
+  bool producer_provided_shmem_{};
+  std::string sdk_version_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<9> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_PRODUCER_PORT_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/ipc/producer_port.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/data_source_descriptor.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/track_event_descriptor.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/gpu_counter_descriptor.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/data_source_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/track_event/track_event_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/test_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/sys_stats/sys_stats_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/sys_stats_counters.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/profiling/perf_event_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/perf_events.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/profiling/java_hprof_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/profiling/heapprofd_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/process_stats/process_stats_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/power/android_power_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/interceptor_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/interceptors/console_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/inode_file/inode_file_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/gpu/vulkan_memory_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/gpu/gpu_counter_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/ftrace/ftrace_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/chrome/chrome_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/android/packages_list_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/android/android_polled_state_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/android/android_log_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/android_log_constants.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/commit_data_request.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+SyncResponse::SyncResponse() = default;
+SyncResponse::~SyncResponse() = default;
+SyncResponse::SyncResponse(const SyncResponse&) = default;
+SyncResponse& SyncResponse::operator=(const SyncResponse&) = default;
+SyncResponse::SyncResponse(SyncResponse&&) noexcept = default;
+SyncResponse& SyncResponse::operator=(SyncResponse&&) = default;
+
+bool SyncResponse::operator==(const SyncResponse& other) const {
+  return unknown_fields_ == other.unknown_fields_;
+}
+
+bool SyncResponse::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string SyncResponse::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> SyncResponse::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void SyncResponse::Serialize(::protozero::Message* msg) const {
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+SyncRequest::SyncRequest() = default;
+SyncRequest::~SyncRequest() = default;
+SyncRequest::SyncRequest(const SyncRequest&) = default;
+SyncRequest& SyncRequest::operator=(const SyncRequest&) = default;
+SyncRequest::SyncRequest(SyncRequest&&) noexcept = default;
+SyncRequest& SyncRequest::operator=(SyncRequest&&) = default;
+
+bool SyncRequest::operator==(const SyncRequest& other) const {
+  return unknown_fields_ == other.unknown_fields_;
+}
+
+bool SyncRequest::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string SyncRequest::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> SyncRequest::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void SyncRequest::Serialize(::protozero::Message* msg) const {
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+GetAsyncCommandResponse::GetAsyncCommandResponse() = default;
+GetAsyncCommandResponse::~GetAsyncCommandResponse() = default;
+GetAsyncCommandResponse::GetAsyncCommandResponse(const GetAsyncCommandResponse&) = default;
+GetAsyncCommandResponse& GetAsyncCommandResponse::operator=(const GetAsyncCommandResponse&) = default;
+GetAsyncCommandResponse::GetAsyncCommandResponse(GetAsyncCommandResponse&&) noexcept = default;
+GetAsyncCommandResponse& GetAsyncCommandResponse::operator=(GetAsyncCommandResponse&&) = default;
+
+bool GetAsyncCommandResponse::operator==(const GetAsyncCommandResponse& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && setup_tracing_ == other.setup_tracing_
+   && setup_data_source_ == other.setup_data_source_
+   && start_data_source_ == other.start_data_source_
+   && stop_data_source_ == other.stop_data_source_
+   && flush_ == other.flush_
+   && clear_incremental_state_ == other.clear_incremental_state_;
+}
+
+bool GetAsyncCommandResponse::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 3 /* setup_tracing */:
+        (*setup_tracing_).ParseFromArray(field.data(), field.size());
+        break;
+      case 6 /* setup_data_source */:
+        (*setup_data_source_).ParseFromArray(field.data(), field.size());
+        break;
+      case 1 /* start_data_source */:
+        (*start_data_source_).ParseFromArray(field.data(), field.size());
+        break;
+      case 2 /* stop_data_source */:
+        (*stop_data_source_).ParseFromArray(field.data(), field.size());
+        break;
+      case 5 /* flush */:
+        (*flush_).ParseFromArray(field.data(), field.size());
+        break;
+      case 7 /* clear_incremental_state */:
+        (*clear_incremental_state_).ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string GetAsyncCommandResponse::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> GetAsyncCommandResponse::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void GetAsyncCommandResponse::Serialize(::protozero::Message* msg) const {
+  // Field 3: setup_tracing
+  if (_has_field_[3]) {
+    (*setup_tracing_).Serialize(msg->BeginNestedMessage<::protozero::Message>(3));
+  }
+
+  // Field 6: setup_data_source
+  if (_has_field_[6]) {
+    (*setup_data_source_).Serialize(msg->BeginNestedMessage<::protozero::Message>(6));
+  }
+
+  // Field 1: start_data_source
+  if (_has_field_[1]) {
+    (*start_data_source_).Serialize(msg->BeginNestedMessage<::protozero::Message>(1));
+  }
+
+  // Field 2: stop_data_source
+  if (_has_field_[2]) {
+    (*stop_data_source_).Serialize(msg->BeginNestedMessage<::protozero::Message>(2));
+  }
+
+  // Field 5: flush
+  if (_has_field_[5]) {
+    (*flush_).Serialize(msg->BeginNestedMessage<::protozero::Message>(5));
+  }
+
+  // Field 7: clear_incremental_state
+  if (_has_field_[7]) {
+    (*clear_incremental_state_).Serialize(msg->BeginNestedMessage<::protozero::Message>(7));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+GetAsyncCommandResponse_ClearIncrementalState::GetAsyncCommandResponse_ClearIncrementalState() = default;
+GetAsyncCommandResponse_ClearIncrementalState::~GetAsyncCommandResponse_ClearIncrementalState() = default;
+GetAsyncCommandResponse_ClearIncrementalState::GetAsyncCommandResponse_ClearIncrementalState(const GetAsyncCommandResponse_ClearIncrementalState&) = default;
+GetAsyncCommandResponse_ClearIncrementalState& GetAsyncCommandResponse_ClearIncrementalState::operator=(const GetAsyncCommandResponse_ClearIncrementalState&) = default;
+GetAsyncCommandResponse_ClearIncrementalState::GetAsyncCommandResponse_ClearIncrementalState(GetAsyncCommandResponse_ClearIncrementalState&&) noexcept = default;
+GetAsyncCommandResponse_ClearIncrementalState& GetAsyncCommandResponse_ClearIncrementalState::operator=(GetAsyncCommandResponse_ClearIncrementalState&&) = default;
+
+bool GetAsyncCommandResponse_ClearIncrementalState::operator==(const GetAsyncCommandResponse_ClearIncrementalState& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && data_source_ids_ == other.data_source_ids_;
+}
+
+bool GetAsyncCommandResponse_ClearIncrementalState::ParseFromArray(const void* raw, size_t size) {
+  data_source_ids_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* data_source_ids */:
+        data_source_ids_.emplace_back();
+        field.get(&data_source_ids_.back());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string GetAsyncCommandResponse_ClearIncrementalState::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> GetAsyncCommandResponse_ClearIncrementalState::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void GetAsyncCommandResponse_ClearIncrementalState::Serialize(::protozero::Message* msg) const {
+  // Field 1: data_source_ids
+  for (auto& it : data_source_ids_) {
+    msg->AppendVarInt(1, it);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+GetAsyncCommandResponse_Flush::GetAsyncCommandResponse_Flush() = default;
+GetAsyncCommandResponse_Flush::~GetAsyncCommandResponse_Flush() = default;
+GetAsyncCommandResponse_Flush::GetAsyncCommandResponse_Flush(const GetAsyncCommandResponse_Flush&) = default;
+GetAsyncCommandResponse_Flush& GetAsyncCommandResponse_Flush::operator=(const GetAsyncCommandResponse_Flush&) = default;
+GetAsyncCommandResponse_Flush::GetAsyncCommandResponse_Flush(GetAsyncCommandResponse_Flush&&) noexcept = default;
+GetAsyncCommandResponse_Flush& GetAsyncCommandResponse_Flush::operator=(GetAsyncCommandResponse_Flush&&) = default;
+
+bool GetAsyncCommandResponse_Flush::operator==(const GetAsyncCommandResponse_Flush& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && data_source_ids_ == other.data_source_ids_
+   && request_id_ == other.request_id_;
+}
+
+bool GetAsyncCommandResponse_Flush::ParseFromArray(const void* raw, size_t size) {
+  data_source_ids_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* data_source_ids */:
+        data_source_ids_.emplace_back();
+        field.get(&data_source_ids_.back());
+        break;
+      case 2 /* request_id */:
+        field.get(&request_id_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string GetAsyncCommandResponse_Flush::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> GetAsyncCommandResponse_Flush::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void GetAsyncCommandResponse_Flush::Serialize(::protozero::Message* msg) const {
+  // Field 1: data_source_ids
+  for (auto& it : data_source_ids_) {
+    msg->AppendVarInt(1, it);
+  }
+
+  // Field 2: request_id
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, request_id_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+GetAsyncCommandResponse_StopDataSource::GetAsyncCommandResponse_StopDataSource() = default;
+GetAsyncCommandResponse_StopDataSource::~GetAsyncCommandResponse_StopDataSource() = default;
+GetAsyncCommandResponse_StopDataSource::GetAsyncCommandResponse_StopDataSource(const GetAsyncCommandResponse_StopDataSource&) = default;
+GetAsyncCommandResponse_StopDataSource& GetAsyncCommandResponse_StopDataSource::operator=(const GetAsyncCommandResponse_StopDataSource&) = default;
+GetAsyncCommandResponse_StopDataSource::GetAsyncCommandResponse_StopDataSource(GetAsyncCommandResponse_StopDataSource&&) noexcept = default;
+GetAsyncCommandResponse_StopDataSource& GetAsyncCommandResponse_StopDataSource::operator=(GetAsyncCommandResponse_StopDataSource&&) = default;
+
+bool GetAsyncCommandResponse_StopDataSource::operator==(const GetAsyncCommandResponse_StopDataSource& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && instance_id_ == other.instance_id_;
+}
+
+bool GetAsyncCommandResponse_StopDataSource::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* instance_id */:
+        field.get(&instance_id_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string GetAsyncCommandResponse_StopDataSource::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> GetAsyncCommandResponse_StopDataSource::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void GetAsyncCommandResponse_StopDataSource::Serialize(::protozero::Message* msg) const {
+  // Field 1: instance_id
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, instance_id_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+GetAsyncCommandResponse_StartDataSource::GetAsyncCommandResponse_StartDataSource() = default;
+GetAsyncCommandResponse_StartDataSource::~GetAsyncCommandResponse_StartDataSource() = default;
+GetAsyncCommandResponse_StartDataSource::GetAsyncCommandResponse_StartDataSource(const GetAsyncCommandResponse_StartDataSource&) = default;
+GetAsyncCommandResponse_StartDataSource& GetAsyncCommandResponse_StartDataSource::operator=(const GetAsyncCommandResponse_StartDataSource&) = default;
+GetAsyncCommandResponse_StartDataSource::GetAsyncCommandResponse_StartDataSource(GetAsyncCommandResponse_StartDataSource&&) noexcept = default;
+GetAsyncCommandResponse_StartDataSource& GetAsyncCommandResponse_StartDataSource::operator=(GetAsyncCommandResponse_StartDataSource&&) = default;
+
+bool GetAsyncCommandResponse_StartDataSource::operator==(const GetAsyncCommandResponse_StartDataSource& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && new_instance_id_ == other.new_instance_id_
+   && config_ == other.config_;
+}
+
+bool GetAsyncCommandResponse_StartDataSource::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* new_instance_id */:
+        field.get(&new_instance_id_);
+        break;
+      case 2 /* config */:
+        (*config_).ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string GetAsyncCommandResponse_StartDataSource::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> GetAsyncCommandResponse_StartDataSource::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void GetAsyncCommandResponse_StartDataSource::Serialize(::protozero::Message* msg) const {
+  // Field 1: new_instance_id
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, new_instance_id_);
+  }
+
+  // Field 2: config
+  if (_has_field_[2]) {
+    (*config_).Serialize(msg->BeginNestedMessage<::protozero::Message>(2));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+GetAsyncCommandResponse_SetupDataSource::GetAsyncCommandResponse_SetupDataSource() = default;
+GetAsyncCommandResponse_SetupDataSource::~GetAsyncCommandResponse_SetupDataSource() = default;
+GetAsyncCommandResponse_SetupDataSource::GetAsyncCommandResponse_SetupDataSource(const GetAsyncCommandResponse_SetupDataSource&) = default;
+GetAsyncCommandResponse_SetupDataSource& GetAsyncCommandResponse_SetupDataSource::operator=(const GetAsyncCommandResponse_SetupDataSource&) = default;
+GetAsyncCommandResponse_SetupDataSource::GetAsyncCommandResponse_SetupDataSource(GetAsyncCommandResponse_SetupDataSource&&) noexcept = default;
+GetAsyncCommandResponse_SetupDataSource& GetAsyncCommandResponse_SetupDataSource::operator=(GetAsyncCommandResponse_SetupDataSource&&) = default;
+
+bool GetAsyncCommandResponse_SetupDataSource::operator==(const GetAsyncCommandResponse_SetupDataSource& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && new_instance_id_ == other.new_instance_id_
+   && config_ == other.config_;
+}
+
+bool GetAsyncCommandResponse_SetupDataSource::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* new_instance_id */:
+        field.get(&new_instance_id_);
+        break;
+      case 2 /* config */:
+        (*config_).ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string GetAsyncCommandResponse_SetupDataSource::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> GetAsyncCommandResponse_SetupDataSource::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void GetAsyncCommandResponse_SetupDataSource::Serialize(::protozero::Message* msg) const {
+  // Field 1: new_instance_id
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, new_instance_id_);
+  }
+
+  // Field 2: config
+  if (_has_field_[2]) {
+    (*config_).Serialize(msg->BeginNestedMessage<::protozero::Message>(2));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+GetAsyncCommandResponse_SetupTracing::GetAsyncCommandResponse_SetupTracing() = default;
+GetAsyncCommandResponse_SetupTracing::~GetAsyncCommandResponse_SetupTracing() = default;
+GetAsyncCommandResponse_SetupTracing::GetAsyncCommandResponse_SetupTracing(const GetAsyncCommandResponse_SetupTracing&) = default;
+GetAsyncCommandResponse_SetupTracing& GetAsyncCommandResponse_SetupTracing::operator=(const GetAsyncCommandResponse_SetupTracing&) = default;
+GetAsyncCommandResponse_SetupTracing::GetAsyncCommandResponse_SetupTracing(GetAsyncCommandResponse_SetupTracing&&) noexcept = default;
+GetAsyncCommandResponse_SetupTracing& GetAsyncCommandResponse_SetupTracing::operator=(GetAsyncCommandResponse_SetupTracing&&) = default;
+
+bool GetAsyncCommandResponse_SetupTracing::operator==(const GetAsyncCommandResponse_SetupTracing& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && shared_buffer_page_size_kb_ == other.shared_buffer_page_size_kb_;
+}
+
+bool GetAsyncCommandResponse_SetupTracing::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* shared_buffer_page_size_kb */:
+        field.get(&shared_buffer_page_size_kb_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string GetAsyncCommandResponse_SetupTracing::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> GetAsyncCommandResponse_SetupTracing::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void GetAsyncCommandResponse_SetupTracing::Serialize(::protozero::Message* msg) const {
+  // Field 1: shared_buffer_page_size_kb
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, shared_buffer_page_size_kb_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+GetAsyncCommandRequest::GetAsyncCommandRequest() = default;
+GetAsyncCommandRequest::~GetAsyncCommandRequest() = default;
+GetAsyncCommandRequest::GetAsyncCommandRequest(const GetAsyncCommandRequest&) = default;
+GetAsyncCommandRequest& GetAsyncCommandRequest::operator=(const GetAsyncCommandRequest&) = default;
+GetAsyncCommandRequest::GetAsyncCommandRequest(GetAsyncCommandRequest&&) noexcept = default;
+GetAsyncCommandRequest& GetAsyncCommandRequest::operator=(GetAsyncCommandRequest&&) = default;
+
+bool GetAsyncCommandRequest::operator==(const GetAsyncCommandRequest& other) const {
+  return unknown_fields_ == other.unknown_fields_;
+}
+
+bool GetAsyncCommandRequest::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string GetAsyncCommandRequest::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> GetAsyncCommandRequest::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void GetAsyncCommandRequest::Serialize(::protozero::Message* msg) const {
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+ActivateTriggersResponse::ActivateTriggersResponse() = default;
+ActivateTriggersResponse::~ActivateTriggersResponse() = default;
+ActivateTriggersResponse::ActivateTriggersResponse(const ActivateTriggersResponse&) = default;
+ActivateTriggersResponse& ActivateTriggersResponse::operator=(const ActivateTriggersResponse&) = default;
+ActivateTriggersResponse::ActivateTriggersResponse(ActivateTriggersResponse&&) noexcept = default;
+ActivateTriggersResponse& ActivateTriggersResponse::operator=(ActivateTriggersResponse&&) = default;
+
+bool ActivateTriggersResponse::operator==(const ActivateTriggersResponse& other) const {
+  return unknown_fields_ == other.unknown_fields_;
+}
+
+bool ActivateTriggersResponse::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ActivateTriggersResponse::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ActivateTriggersResponse::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ActivateTriggersResponse::Serialize(::protozero::Message* msg) const {
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+ActivateTriggersRequest::ActivateTriggersRequest() = default;
+ActivateTriggersRequest::~ActivateTriggersRequest() = default;
+ActivateTriggersRequest::ActivateTriggersRequest(const ActivateTriggersRequest&) = default;
+ActivateTriggersRequest& ActivateTriggersRequest::operator=(const ActivateTriggersRequest&) = default;
+ActivateTriggersRequest::ActivateTriggersRequest(ActivateTriggersRequest&&) noexcept = default;
+ActivateTriggersRequest& ActivateTriggersRequest::operator=(ActivateTriggersRequest&&) = default;
+
+bool ActivateTriggersRequest::operator==(const ActivateTriggersRequest& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && trigger_names_ == other.trigger_names_;
+}
+
+bool ActivateTriggersRequest::ParseFromArray(const void* raw, size_t size) {
+  trigger_names_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* trigger_names */:
+        trigger_names_.emplace_back();
+        field.get(&trigger_names_.back());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string ActivateTriggersRequest::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> ActivateTriggersRequest::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void ActivateTriggersRequest::Serialize(::protozero::Message* msg) const {
+  // Field 1: trigger_names
+  for (auto& it : trigger_names_) {
+    msg->AppendString(1, it);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+NotifyDataSourceStoppedResponse::NotifyDataSourceStoppedResponse() = default;
+NotifyDataSourceStoppedResponse::~NotifyDataSourceStoppedResponse() = default;
+NotifyDataSourceStoppedResponse::NotifyDataSourceStoppedResponse(const NotifyDataSourceStoppedResponse&) = default;
+NotifyDataSourceStoppedResponse& NotifyDataSourceStoppedResponse::operator=(const NotifyDataSourceStoppedResponse&) = default;
+NotifyDataSourceStoppedResponse::NotifyDataSourceStoppedResponse(NotifyDataSourceStoppedResponse&&) noexcept = default;
+NotifyDataSourceStoppedResponse& NotifyDataSourceStoppedResponse::operator=(NotifyDataSourceStoppedResponse&&) = default;
+
+bool NotifyDataSourceStoppedResponse::operator==(const NotifyDataSourceStoppedResponse& other) const {
+  return unknown_fields_ == other.unknown_fields_;
+}
+
+bool NotifyDataSourceStoppedResponse::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string NotifyDataSourceStoppedResponse::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> NotifyDataSourceStoppedResponse::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void NotifyDataSourceStoppedResponse::Serialize(::protozero::Message* msg) const {
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+NotifyDataSourceStoppedRequest::NotifyDataSourceStoppedRequest() = default;
+NotifyDataSourceStoppedRequest::~NotifyDataSourceStoppedRequest() = default;
+NotifyDataSourceStoppedRequest::NotifyDataSourceStoppedRequest(const NotifyDataSourceStoppedRequest&) = default;
+NotifyDataSourceStoppedRequest& NotifyDataSourceStoppedRequest::operator=(const NotifyDataSourceStoppedRequest&) = default;
+NotifyDataSourceStoppedRequest::NotifyDataSourceStoppedRequest(NotifyDataSourceStoppedRequest&&) noexcept = default;
+NotifyDataSourceStoppedRequest& NotifyDataSourceStoppedRequest::operator=(NotifyDataSourceStoppedRequest&&) = default;
+
+bool NotifyDataSourceStoppedRequest::operator==(const NotifyDataSourceStoppedRequest& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && data_source_id_ == other.data_source_id_;
+}
+
+bool NotifyDataSourceStoppedRequest::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* data_source_id */:
+        field.get(&data_source_id_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string NotifyDataSourceStoppedRequest::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> NotifyDataSourceStoppedRequest::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void NotifyDataSourceStoppedRequest::Serialize(::protozero::Message* msg) const {
+  // Field 1: data_source_id
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, data_source_id_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+NotifyDataSourceStartedResponse::NotifyDataSourceStartedResponse() = default;
+NotifyDataSourceStartedResponse::~NotifyDataSourceStartedResponse() = default;
+NotifyDataSourceStartedResponse::NotifyDataSourceStartedResponse(const NotifyDataSourceStartedResponse&) = default;
+NotifyDataSourceStartedResponse& NotifyDataSourceStartedResponse::operator=(const NotifyDataSourceStartedResponse&) = default;
+NotifyDataSourceStartedResponse::NotifyDataSourceStartedResponse(NotifyDataSourceStartedResponse&&) noexcept = default;
+NotifyDataSourceStartedResponse& NotifyDataSourceStartedResponse::operator=(NotifyDataSourceStartedResponse&&) = default;
+
+bool NotifyDataSourceStartedResponse::operator==(const NotifyDataSourceStartedResponse& other) const {
+  return unknown_fields_ == other.unknown_fields_;
+}
+
+bool NotifyDataSourceStartedResponse::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string NotifyDataSourceStartedResponse::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> NotifyDataSourceStartedResponse::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void NotifyDataSourceStartedResponse::Serialize(::protozero::Message* msg) const {
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+NotifyDataSourceStartedRequest::NotifyDataSourceStartedRequest() = default;
+NotifyDataSourceStartedRequest::~NotifyDataSourceStartedRequest() = default;
+NotifyDataSourceStartedRequest::NotifyDataSourceStartedRequest(const NotifyDataSourceStartedRequest&) = default;
+NotifyDataSourceStartedRequest& NotifyDataSourceStartedRequest::operator=(const NotifyDataSourceStartedRequest&) = default;
+NotifyDataSourceStartedRequest::NotifyDataSourceStartedRequest(NotifyDataSourceStartedRequest&&) noexcept = default;
+NotifyDataSourceStartedRequest& NotifyDataSourceStartedRequest::operator=(NotifyDataSourceStartedRequest&&) = default;
+
+bool NotifyDataSourceStartedRequest::operator==(const NotifyDataSourceStartedRequest& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && data_source_id_ == other.data_source_id_;
+}
+
+bool NotifyDataSourceStartedRequest::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* data_source_id */:
+        field.get(&data_source_id_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string NotifyDataSourceStartedRequest::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> NotifyDataSourceStartedRequest::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void NotifyDataSourceStartedRequest::Serialize(::protozero::Message* msg) const {
+  // Field 1: data_source_id
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, data_source_id_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+CommitDataResponse::CommitDataResponse() = default;
+CommitDataResponse::~CommitDataResponse() = default;
+CommitDataResponse::CommitDataResponse(const CommitDataResponse&) = default;
+CommitDataResponse& CommitDataResponse::operator=(const CommitDataResponse&) = default;
+CommitDataResponse::CommitDataResponse(CommitDataResponse&&) noexcept = default;
+CommitDataResponse& CommitDataResponse::operator=(CommitDataResponse&&) = default;
+
+bool CommitDataResponse::operator==(const CommitDataResponse& other) const {
+  return unknown_fields_ == other.unknown_fields_;
+}
+
+bool CommitDataResponse::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string CommitDataResponse::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> CommitDataResponse::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void CommitDataResponse::Serialize(::protozero::Message* msg) const {
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+UnregisterTraceWriterResponse::UnregisterTraceWriterResponse() = default;
+UnregisterTraceWriterResponse::~UnregisterTraceWriterResponse() = default;
+UnregisterTraceWriterResponse::UnregisterTraceWriterResponse(const UnregisterTraceWriterResponse&) = default;
+UnregisterTraceWriterResponse& UnregisterTraceWriterResponse::operator=(const UnregisterTraceWriterResponse&) = default;
+UnregisterTraceWriterResponse::UnregisterTraceWriterResponse(UnregisterTraceWriterResponse&&) noexcept = default;
+UnregisterTraceWriterResponse& UnregisterTraceWriterResponse::operator=(UnregisterTraceWriterResponse&&) = default;
+
+bool UnregisterTraceWriterResponse::operator==(const UnregisterTraceWriterResponse& other) const {
+  return unknown_fields_ == other.unknown_fields_;
+}
+
+bool UnregisterTraceWriterResponse::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string UnregisterTraceWriterResponse::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> UnregisterTraceWriterResponse::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void UnregisterTraceWriterResponse::Serialize(::protozero::Message* msg) const {
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+UnregisterTraceWriterRequest::UnregisterTraceWriterRequest() = default;
+UnregisterTraceWriterRequest::~UnregisterTraceWriterRequest() = default;
+UnregisterTraceWriterRequest::UnregisterTraceWriterRequest(const UnregisterTraceWriterRequest&) = default;
+UnregisterTraceWriterRequest& UnregisterTraceWriterRequest::operator=(const UnregisterTraceWriterRequest&) = default;
+UnregisterTraceWriterRequest::UnregisterTraceWriterRequest(UnregisterTraceWriterRequest&&) noexcept = default;
+UnregisterTraceWriterRequest& UnregisterTraceWriterRequest::operator=(UnregisterTraceWriterRequest&&) = default;
+
+bool UnregisterTraceWriterRequest::operator==(const UnregisterTraceWriterRequest& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && trace_writer_id_ == other.trace_writer_id_;
+}
+
+bool UnregisterTraceWriterRequest::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* trace_writer_id */:
+        field.get(&trace_writer_id_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string UnregisterTraceWriterRequest::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> UnregisterTraceWriterRequest::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void UnregisterTraceWriterRequest::Serialize(::protozero::Message* msg) const {
+  // Field 1: trace_writer_id
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, trace_writer_id_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+RegisterTraceWriterResponse::RegisterTraceWriterResponse() = default;
+RegisterTraceWriterResponse::~RegisterTraceWriterResponse() = default;
+RegisterTraceWriterResponse::RegisterTraceWriterResponse(const RegisterTraceWriterResponse&) = default;
+RegisterTraceWriterResponse& RegisterTraceWriterResponse::operator=(const RegisterTraceWriterResponse&) = default;
+RegisterTraceWriterResponse::RegisterTraceWriterResponse(RegisterTraceWriterResponse&&) noexcept = default;
+RegisterTraceWriterResponse& RegisterTraceWriterResponse::operator=(RegisterTraceWriterResponse&&) = default;
+
+bool RegisterTraceWriterResponse::operator==(const RegisterTraceWriterResponse& other) const {
+  return unknown_fields_ == other.unknown_fields_;
+}
+
+bool RegisterTraceWriterResponse::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string RegisterTraceWriterResponse::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> RegisterTraceWriterResponse::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void RegisterTraceWriterResponse::Serialize(::protozero::Message* msg) const {
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+RegisterTraceWriterRequest::RegisterTraceWriterRequest() = default;
+RegisterTraceWriterRequest::~RegisterTraceWriterRequest() = default;
+RegisterTraceWriterRequest::RegisterTraceWriterRequest(const RegisterTraceWriterRequest&) = default;
+RegisterTraceWriterRequest& RegisterTraceWriterRequest::operator=(const RegisterTraceWriterRequest&) = default;
+RegisterTraceWriterRequest::RegisterTraceWriterRequest(RegisterTraceWriterRequest&&) noexcept = default;
+RegisterTraceWriterRequest& RegisterTraceWriterRequest::operator=(RegisterTraceWriterRequest&&) = default;
+
+bool RegisterTraceWriterRequest::operator==(const RegisterTraceWriterRequest& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && trace_writer_id_ == other.trace_writer_id_
+   && target_buffer_ == other.target_buffer_;
+}
+
+bool RegisterTraceWriterRequest::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* trace_writer_id */:
+        field.get(&trace_writer_id_);
+        break;
+      case 2 /* target_buffer */:
+        field.get(&target_buffer_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string RegisterTraceWriterRequest::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> RegisterTraceWriterRequest::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void RegisterTraceWriterRequest::Serialize(::protozero::Message* msg) const {
+  // Field 1: trace_writer_id
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, trace_writer_id_);
+  }
+
+  // Field 2: target_buffer
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, target_buffer_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+UnregisterDataSourceResponse::UnregisterDataSourceResponse() = default;
+UnregisterDataSourceResponse::~UnregisterDataSourceResponse() = default;
+UnregisterDataSourceResponse::UnregisterDataSourceResponse(const UnregisterDataSourceResponse&) = default;
+UnregisterDataSourceResponse& UnregisterDataSourceResponse::operator=(const UnregisterDataSourceResponse&) = default;
+UnregisterDataSourceResponse::UnregisterDataSourceResponse(UnregisterDataSourceResponse&&) noexcept = default;
+UnregisterDataSourceResponse& UnregisterDataSourceResponse::operator=(UnregisterDataSourceResponse&&) = default;
+
+bool UnregisterDataSourceResponse::operator==(const UnregisterDataSourceResponse& other) const {
+  return unknown_fields_ == other.unknown_fields_;
+}
+
+bool UnregisterDataSourceResponse::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string UnregisterDataSourceResponse::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> UnregisterDataSourceResponse::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void UnregisterDataSourceResponse::Serialize(::protozero::Message* msg) const {
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+UnregisterDataSourceRequest::UnregisterDataSourceRequest() = default;
+UnregisterDataSourceRequest::~UnregisterDataSourceRequest() = default;
+UnregisterDataSourceRequest::UnregisterDataSourceRequest(const UnregisterDataSourceRequest&) = default;
+UnregisterDataSourceRequest& UnregisterDataSourceRequest::operator=(const UnregisterDataSourceRequest&) = default;
+UnregisterDataSourceRequest::UnregisterDataSourceRequest(UnregisterDataSourceRequest&&) noexcept = default;
+UnregisterDataSourceRequest& UnregisterDataSourceRequest::operator=(UnregisterDataSourceRequest&&) = default;
+
+bool UnregisterDataSourceRequest::operator==(const UnregisterDataSourceRequest& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && data_source_name_ == other.data_source_name_;
+}
+
+bool UnregisterDataSourceRequest::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* data_source_name */:
+        field.get(&data_source_name_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string UnregisterDataSourceRequest::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> UnregisterDataSourceRequest::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void UnregisterDataSourceRequest::Serialize(::protozero::Message* msg) const {
+  // Field 1: data_source_name
+  if (_has_field_[1]) {
+    msg->AppendString(1, data_source_name_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+RegisterDataSourceResponse::RegisterDataSourceResponse() = default;
+RegisterDataSourceResponse::~RegisterDataSourceResponse() = default;
+RegisterDataSourceResponse::RegisterDataSourceResponse(const RegisterDataSourceResponse&) = default;
+RegisterDataSourceResponse& RegisterDataSourceResponse::operator=(const RegisterDataSourceResponse&) = default;
+RegisterDataSourceResponse::RegisterDataSourceResponse(RegisterDataSourceResponse&&) noexcept = default;
+RegisterDataSourceResponse& RegisterDataSourceResponse::operator=(RegisterDataSourceResponse&&) = default;
+
+bool RegisterDataSourceResponse::operator==(const RegisterDataSourceResponse& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && error_ == other.error_;
+}
+
+bool RegisterDataSourceResponse::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* error */:
+        field.get(&error_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string RegisterDataSourceResponse::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> RegisterDataSourceResponse::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void RegisterDataSourceResponse::Serialize(::protozero::Message* msg) const {
+  // Field 1: error
+  if (_has_field_[1]) {
+    msg->AppendString(1, error_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+RegisterDataSourceRequest::RegisterDataSourceRequest() = default;
+RegisterDataSourceRequest::~RegisterDataSourceRequest() = default;
+RegisterDataSourceRequest::RegisterDataSourceRequest(const RegisterDataSourceRequest&) = default;
+RegisterDataSourceRequest& RegisterDataSourceRequest::operator=(const RegisterDataSourceRequest&) = default;
+RegisterDataSourceRequest::RegisterDataSourceRequest(RegisterDataSourceRequest&&) noexcept = default;
+RegisterDataSourceRequest& RegisterDataSourceRequest::operator=(RegisterDataSourceRequest&&) = default;
+
+bool RegisterDataSourceRequest::operator==(const RegisterDataSourceRequest& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && data_source_descriptor_ == other.data_source_descriptor_;
+}
+
+bool RegisterDataSourceRequest::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* data_source_descriptor */:
+        (*data_source_descriptor_).ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string RegisterDataSourceRequest::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> RegisterDataSourceRequest::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void RegisterDataSourceRequest::Serialize(::protozero::Message* msg) const {
+  // Field 1: data_source_descriptor
+  if (_has_field_[1]) {
+    (*data_source_descriptor_).Serialize(msg->BeginNestedMessage<::protozero::Message>(1));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+InitializeConnectionResponse::InitializeConnectionResponse() = default;
+InitializeConnectionResponse::~InitializeConnectionResponse() = default;
+InitializeConnectionResponse::InitializeConnectionResponse(const InitializeConnectionResponse&) = default;
+InitializeConnectionResponse& InitializeConnectionResponse::operator=(const InitializeConnectionResponse&) = default;
+InitializeConnectionResponse::InitializeConnectionResponse(InitializeConnectionResponse&&) noexcept = default;
+InitializeConnectionResponse& InitializeConnectionResponse::operator=(InitializeConnectionResponse&&) = default;
+
+bool InitializeConnectionResponse::operator==(const InitializeConnectionResponse& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && using_shmem_provided_by_producer_ == other.using_shmem_provided_by_producer_
+   && direct_smb_patching_supported_ == other.direct_smb_patching_supported_;
+}
+
+bool InitializeConnectionResponse::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* using_shmem_provided_by_producer */:
+        field.get(&using_shmem_provided_by_producer_);
+        break;
+      case 2 /* direct_smb_patching_supported */:
+        field.get(&direct_smb_patching_supported_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string InitializeConnectionResponse::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> InitializeConnectionResponse::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void InitializeConnectionResponse::Serialize(::protozero::Message* msg) const {
+  // Field 1: using_shmem_provided_by_producer
+  if (_has_field_[1]) {
+    msg->AppendTinyVarInt(1, using_shmem_provided_by_producer_);
+  }
+
+  // Field 2: direct_smb_patching_supported
+  if (_has_field_[2]) {
+    msg->AppendTinyVarInt(2, direct_smb_patching_supported_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+InitializeConnectionRequest::InitializeConnectionRequest() = default;
+InitializeConnectionRequest::~InitializeConnectionRequest() = default;
+InitializeConnectionRequest::InitializeConnectionRequest(const InitializeConnectionRequest&) = default;
+InitializeConnectionRequest& InitializeConnectionRequest::operator=(const InitializeConnectionRequest&) = default;
+InitializeConnectionRequest::InitializeConnectionRequest(InitializeConnectionRequest&&) noexcept = default;
+InitializeConnectionRequest& InitializeConnectionRequest::operator=(InitializeConnectionRequest&&) = default;
+
+bool InitializeConnectionRequest::operator==(const InitializeConnectionRequest& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && shared_memory_page_size_hint_bytes_ == other.shared_memory_page_size_hint_bytes_
+   && shared_memory_size_hint_bytes_ == other.shared_memory_size_hint_bytes_
+   && producer_name_ == other.producer_name_
+   && smb_scraping_mode_ == other.smb_scraping_mode_
+   && build_flags_ == other.build_flags_
+   && producer_provided_shmem_ == other.producer_provided_shmem_
+   && sdk_version_ == other.sdk_version_;
+}
+
+bool InitializeConnectionRequest::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* shared_memory_page_size_hint_bytes */:
+        field.get(&shared_memory_page_size_hint_bytes_);
+        break;
+      case 2 /* shared_memory_size_hint_bytes */:
+        field.get(&shared_memory_size_hint_bytes_);
+        break;
+      case 3 /* producer_name */:
+        field.get(&producer_name_);
+        break;
+      case 4 /* smb_scraping_mode */:
+        field.get(&smb_scraping_mode_);
+        break;
+      case 5 /* build_flags */:
+        field.get(&build_flags_);
+        break;
+      case 6 /* producer_provided_shmem */:
+        field.get(&producer_provided_shmem_);
+        break;
+      case 8 /* sdk_version */:
+        field.get(&sdk_version_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string InitializeConnectionRequest::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> InitializeConnectionRequest::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void InitializeConnectionRequest::Serialize(::protozero::Message* msg) const {
+  // Field 1: shared_memory_page_size_hint_bytes
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, shared_memory_page_size_hint_bytes_);
+  }
+
+  // Field 2: shared_memory_size_hint_bytes
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, shared_memory_size_hint_bytes_);
+  }
+
+  // Field 3: producer_name
+  if (_has_field_[3]) {
+    msg->AppendString(3, producer_name_);
+  }
+
+  // Field 4: smb_scraping_mode
+  if (_has_field_[4]) {
+    msg->AppendVarInt(4, smb_scraping_mode_);
+  }
+
+  // Field 5: build_flags
+  if (_has_field_[5]) {
+    msg->AppendVarInt(5, build_flags_);
+  }
+
+  // Field 6: producer_provided_shmem
+  if (_has_field_[6]) {
+    msg->AppendTinyVarInt(6, producer_provided_shmem_);
+  }
+
+  // Field 8: sdk_version
+  if (_has_field_[8]) {
+    msg->AppendString(8, sdk_version_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: gen/protos/perfetto/ipc/wire_protocol.gen.cc
+// gen_amalgamated begin header: gen/protos/perfetto/ipc/wire_protocol.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_WIRE_PROTOCOL_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_WIRE_PROTOCOL_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class IPCFrame;
+class IPCFrame_RequestError;
+class IPCFrame_InvokeMethodReply;
+class IPCFrame_InvokeMethod;
+class IPCFrame_BindServiceReply;
+class IPCFrame_BindServiceReply_MethodInfo;
+class IPCFrame_BindService;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT IPCFrame : public ::protozero::CppMessageObj {
+ public:
+  using BindService = IPCFrame_BindService;
+  using BindServiceReply = IPCFrame_BindServiceReply;
+  using InvokeMethod = IPCFrame_InvokeMethod;
+  using InvokeMethodReply = IPCFrame_InvokeMethodReply;
+  using RequestError = IPCFrame_RequestError;
+  enum FieldNumbers {
+    kRequestIdFieldNumber = 2,
+    kMsgBindServiceFieldNumber = 3,
+    kMsgBindServiceReplyFieldNumber = 4,
+    kMsgInvokeMethodFieldNumber = 5,
+    kMsgInvokeMethodReplyFieldNumber = 6,
+    kMsgRequestErrorFieldNumber = 7,
+    kDataForTestingFieldNumber = 1,
+  };
+
+  IPCFrame();
+  ~IPCFrame() override;
+  IPCFrame(IPCFrame&&) noexcept;
+  IPCFrame& operator=(IPCFrame&&);
+  IPCFrame(const IPCFrame&);
+  IPCFrame& operator=(const IPCFrame&);
+  bool operator==(const IPCFrame&) const;
+  bool operator!=(const IPCFrame& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_request_id() const { return _has_field_[2]; }
+  uint64_t request_id() const { return request_id_; }
+  void set_request_id(uint64_t value) { request_id_ = value; _has_field_.set(2); }
+
+  bool has_msg_bind_service() const { return _has_field_[3]; }
+  const IPCFrame_BindService& msg_bind_service() const { return *msg_bind_service_; }
+  IPCFrame_BindService* mutable_msg_bind_service() { _has_field_.set(3); return msg_bind_service_.get(); }
+
+  bool has_msg_bind_service_reply() const { return _has_field_[4]; }
+  const IPCFrame_BindServiceReply& msg_bind_service_reply() const { return *msg_bind_service_reply_; }
+  IPCFrame_BindServiceReply* mutable_msg_bind_service_reply() { _has_field_.set(4); return msg_bind_service_reply_.get(); }
+
+  bool has_msg_invoke_method() const { return _has_field_[5]; }
+  const IPCFrame_InvokeMethod& msg_invoke_method() const { return *msg_invoke_method_; }
+  IPCFrame_InvokeMethod* mutable_msg_invoke_method() { _has_field_.set(5); return msg_invoke_method_.get(); }
+
+  bool has_msg_invoke_method_reply() const { return _has_field_[6]; }
+  const IPCFrame_InvokeMethodReply& msg_invoke_method_reply() const { return *msg_invoke_method_reply_; }
+  IPCFrame_InvokeMethodReply* mutable_msg_invoke_method_reply() { _has_field_.set(6); return msg_invoke_method_reply_.get(); }
+
+  bool has_msg_request_error() const { return _has_field_[7]; }
+  const IPCFrame_RequestError& msg_request_error() const { return *msg_request_error_; }
+  IPCFrame_RequestError* mutable_msg_request_error() { _has_field_.set(7); return msg_request_error_.get(); }
+
+  const std::vector<std::string>& data_for_testing() const { return data_for_testing_; }
+  std::vector<std::string>* mutable_data_for_testing() { return &data_for_testing_; }
+  int data_for_testing_size() const { return static_cast<int>(data_for_testing_.size()); }
+  void clear_data_for_testing() { data_for_testing_.clear(); }
+  void add_data_for_testing(std::string value) { data_for_testing_.emplace_back(value); }
+  std::string* add_data_for_testing() { data_for_testing_.emplace_back(); return &data_for_testing_.back(); }
+
+ private:
+  uint64_t request_id_{};
+  ::protozero::CopyablePtr<IPCFrame_BindService> msg_bind_service_;
+  ::protozero::CopyablePtr<IPCFrame_BindServiceReply> msg_bind_service_reply_;
+  ::protozero::CopyablePtr<IPCFrame_InvokeMethod> msg_invoke_method_;
+  ::protozero::CopyablePtr<IPCFrame_InvokeMethodReply> msg_invoke_method_reply_;
+  ::protozero::CopyablePtr<IPCFrame_RequestError> msg_request_error_;
+  std::vector<std::string> data_for_testing_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<8> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT IPCFrame_RequestError : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kErrorFieldNumber = 1,
+  };
+
+  IPCFrame_RequestError();
+  ~IPCFrame_RequestError() override;
+  IPCFrame_RequestError(IPCFrame_RequestError&&) noexcept;
+  IPCFrame_RequestError& operator=(IPCFrame_RequestError&&);
+  IPCFrame_RequestError(const IPCFrame_RequestError&);
+  IPCFrame_RequestError& operator=(const IPCFrame_RequestError&);
+  bool operator==(const IPCFrame_RequestError&) const;
+  bool operator!=(const IPCFrame_RequestError& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_error() const { return _has_field_[1]; }
+  const std::string& error() const { return error_; }
+  void set_error(const std::string& value) { error_ = value; _has_field_.set(1); }
+
+ private:
+  std::string error_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT IPCFrame_InvokeMethodReply : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kSuccessFieldNumber = 1,
+    kHasMoreFieldNumber = 2,
+    kReplyProtoFieldNumber = 3,
+  };
+
+  IPCFrame_InvokeMethodReply();
+  ~IPCFrame_InvokeMethodReply() override;
+  IPCFrame_InvokeMethodReply(IPCFrame_InvokeMethodReply&&) noexcept;
+  IPCFrame_InvokeMethodReply& operator=(IPCFrame_InvokeMethodReply&&);
+  IPCFrame_InvokeMethodReply(const IPCFrame_InvokeMethodReply&);
+  IPCFrame_InvokeMethodReply& operator=(const IPCFrame_InvokeMethodReply&);
+  bool operator==(const IPCFrame_InvokeMethodReply&) const;
+  bool operator!=(const IPCFrame_InvokeMethodReply& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_success() const { return _has_field_[1]; }
+  bool success() const { return success_; }
+  void set_success(bool value) { success_ = value; _has_field_.set(1); }
+
+  bool has_has_more() const { return _has_field_[2]; }
+  bool has_more() const { return has_more_; }
+  void set_has_more(bool value) { has_more_ = value; _has_field_.set(2); }
+
+  bool has_reply_proto() const { return _has_field_[3]; }
+  const std::string& reply_proto() const { return reply_proto_; }
+  void set_reply_proto(const std::string& value) { reply_proto_ = value; _has_field_.set(3); }
+  void set_reply_proto(const void* p, size_t s) { reply_proto_.assign(reinterpret_cast<const char*>(p), s); _has_field_.set(3); }
+
+ private:
+  bool success_{};
+  bool has_more_{};
+  std::string reply_proto_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<4> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT IPCFrame_InvokeMethod : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kServiceIdFieldNumber = 1,
+    kMethodIdFieldNumber = 2,
+    kArgsProtoFieldNumber = 3,
+    kDropReplyFieldNumber = 4,
+  };
+
+  IPCFrame_InvokeMethod();
+  ~IPCFrame_InvokeMethod() override;
+  IPCFrame_InvokeMethod(IPCFrame_InvokeMethod&&) noexcept;
+  IPCFrame_InvokeMethod& operator=(IPCFrame_InvokeMethod&&);
+  IPCFrame_InvokeMethod(const IPCFrame_InvokeMethod&);
+  IPCFrame_InvokeMethod& operator=(const IPCFrame_InvokeMethod&);
+  bool operator==(const IPCFrame_InvokeMethod&) const;
+  bool operator!=(const IPCFrame_InvokeMethod& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_service_id() const { return _has_field_[1]; }
+  uint32_t service_id() const { return service_id_; }
+  void set_service_id(uint32_t value) { service_id_ = value; _has_field_.set(1); }
+
+  bool has_method_id() const { return _has_field_[2]; }
+  uint32_t method_id() const { return method_id_; }
+  void set_method_id(uint32_t value) { method_id_ = value; _has_field_.set(2); }
+
+  bool has_args_proto() const { return _has_field_[3]; }
+  const std::string& args_proto() const { return args_proto_; }
+  void set_args_proto(const std::string& value) { args_proto_ = value; _has_field_.set(3); }
+  void set_args_proto(const void* p, size_t s) { args_proto_.assign(reinterpret_cast<const char*>(p), s); _has_field_.set(3); }
+
+  bool has_drop_reply() const { return _has_field_[4]; }
+  bool drop_reply() const { return drop_reply_; }
+  void set_drop_reply(bool value) { drop_reply_ = value; _has_field_.set(4); }
+
+ private:
+  uint32_t service_id_{};
+  uint32_t method_id_{};
+  std::string args_proto_{};
+  bool drop_reply_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<5> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT IPCFrame_BindServiceReply : public ::protozero::CppMessageObj {
+ public:
+  using MethodInfo = IPCFrame_BindServiceReply_MethodInfo;
+  enum FieldNumbers {
+    kSuccessFieldNumber = 1,
+    kServiceIdFieldNumber = 2,
+    kMethodsFieldNumber = 3,
+  };
+
+  IPCFrame_BindServiceReply();
+  ~IPCFrame_BindServiceReply() override;
+  IPCFrame_BindServiceReply(IPCFrame_BindServiceReply&&) noexcept;
+  IPCFrame_BindServiceReply& operator=(IPCFrame_BindServiceReply&&);
+  IPCFrame_BindServiceReply(const IPCFrame_BindServiceReply&);
+  IPCFrame_BindServiceReply& operator=(const IPCFrame_BindServiceReply&);
+  bool operator==(const IPCFrame_BindServiceReply&) const;
+  bool operator!=(const IPCFrame_BindServiceReply& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_success() const { return _has_field_[1]; }
+  bool success() const { return success_; }
+  void set_success(bool value) { success_ = value; _has_field_.set(1); }
+
+  bool has_service_id() const { return _has_field_[2]; }
+  uint32_t service_id() const { return service_id_; }
+  void set_service_id(uint32_t value) { service_id_ = value; _has_field_.set(2); }
+
+  const std::vector<IPCFrame_BindServiceReply_MethodInfo>& methods() const { return methods_; }
+  std::vector<IPCFrame_BindServiceReply_MethodInfo>* mutable_methods() { return &methods_; }
+  int methods_size() const;
+  void clear_methods();
+  IPCFrame_BindServiceReply_MethodInfo* add_methods();
+
+ private:
+  bool success_{};
+  uint32_t service_id_{};
+  std::vector<IPCFrame_BindServiceReply_MethodInfo> methods_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<4> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT IPCFrame_BindServiceReply_MethodInfo : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kIdFieldNumber = 1,
+    kNameFieldNumber = 2,
+  };
+
+  IPCFrame_BindServiceReply_MethodInfo();
+  ~IPCFrame_BindServiceReply_MethodInfo() override;
+  IPCFrame_BindServiceReply_MethodInfo(IPCFrame_BindServiceReply_MethodInfo&&) noexcept;
+  IPCFrame_BindServiceReply_MethodInfo& operator=(IPCFrame_BindServiceReply_MethodInfo&&);
+  IPCFrame_BindServiceReply_MethodInfo(const IPCFrame_BindServiceReply_MethodInfo&);
+  IPCFrame_BindServiceReply_MethodInfo& operator=(const IPCFrame_BindServiceReply_MethodInfo&);
+  bool operator==(const IPCFrame_BindServiceReply_MethodInfo&) const;
+  bool operator!=(const IPCFrame_BindServiceReply_MethodInfo& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_id() const { return _has_field_[1]; }
+  uint32_t id() const { return id_; }
+  void set_id(uint32_t value) { id_ = value; _has_field_.set(1); }
+
+  bool has_name() const { return _has_field_[2]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(2); }
+
+ private:
+  uint32_t id_{};
+  std::string name_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT IPCFrame_BindService : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kServiceNameFieldNumber = 1,
+  };
+
+  IPCFrame_BindService();
+  ~IPCFrame_BindService() override;
+  IPCFrame_BindService(IPCFrame_BindService&&) noexcept;
+  IPCFrame_BindService& operator=(IPCFrame_BindService&&);
+  IPCFrame_BindService(const IPCFrame_BindService&);
+  IPCFrame_BindService& operator=(const IPCFrame_BindService&);
+  bool operator==(const IPCFrame_BindService&) const;
+  bool operator!=(const IPCFrame_BindService& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_service_name() const { return _has_field_[1]; }
+  const std::string& service_name() const { return service_name_; }
+  void set_service_name(const std::string& value) { service_name_ = value; _has_field_.set(1); }
+
+ private:
+  std::string service_name_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_WIRE_PROTOCOL_PROTO_CPP_H_
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+// gen_amalgamated expanded: #include "protos/perfetto/ipc/wire_protocol.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+IPCFrame::IPCFrame() = default;
+IPCFrame::~IPCFrame() = default;
+IPCFrame::IPCFrame(const IPCFrame&) = default;
+IPCFrame& IPCFrame::operator=(const IPCFrame&) = default;
+IPCFrame::IPCFrame(IPCFrame&&) noexcept = default;
+IPCFrame& IPCFrame::operator=(IPCFrame&&) = default;
+
+bool IPCFrame::operator==(const IPCFrame& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && request_id_ == other.request_id_
+   && msg_bind_service_ == other.msg_bind_service_
+   && msg_bind_service_reply_ == other.msg_bind_service_reply_
+   && msg_invoke_method_ == other.msg_invoke_method_
+   && msg_invoke_method_reply_ == other.msg_invoke_method_reply_
+   && msg_request_error_ == other.msg_request_error_
+   && data_for_testing_ == other.data_for_testing_;
+}
+
+bool IPCFrame::ParseFromArray(const void* raw, size_t size) {
+  data_for_testing_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 2 /* request_id */:
+        field.get(&request_id_);
+        break;
+      case 3 /* msg_bind_service */:
+        (*msg_bind_service_).ParseFromArray(field.data(), field.size());
+        break;
+      case 4 /* msg_bind_service_reply */:
+        (*msg_bind_service_reply_).ParseFromArray(field.data(), field.size());
+        break;
+      case 5 /* msg_invoke_method */:
+        (*msg_invoke_method_).ParseFromArray(field.data(), field.size());
+        break;
+      case 6 /* msg_invoke_method_reply */:
+        (*msg_invoke_method_reply_).ParseFromArray(field.data(), field.size());
+        break;
+      case 7 /* msg_request_error */:
+        (*msg_request_error_).ParseFromArray(field.data(), field.size());
+        break;
+      case 1 /* data_for_testing */:
+        data_for_testing_.emplace_back();
+        field.get(&data_for_testing_.back());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string IPCFrame::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> IPCFrame::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void IPCFrame::Serialize(::protozero::Message* msg) const {
+  // Field 2: request_id
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, request_id_);
+  }
+
+  // Field 3: msg_bind_service
+  if (_has_field_[3]) {
+    (*msg_bind_service_).Serialize(msg->BeginNestedMessage<::protozero::Message>(3));
+  }
+
+  // Field 4: msg_bind_service_reply
+  if (_has_field_[4]) {
+    (*msg_bind_service_reply_).Serialize(msg->BeginNestedMessage<::protozero::Message>(4));
+  }
+
+  // Field 5: msg_invoke_method
+  if (_has_field_[5]) {
+    (*msg_invoke_method_).Serialize(msg->BeginNestedMessage<::protozero::Message>(5));
+  }
+
+  // Field 6: msg_invoke_method_reply
+  if (_has_field_[6]) {
+    (*msg_invoke_method_reply_).Serialize(msg->BeginNestedMessage<::protozero::Message>(6));
+  }
+
+  // Field 7: msg_request_error
+  if (_has_field_[7]) {
+    (*msg_request_error_).Serialize(msg->BeginNestedMessage<::protozero::Message>(7));
+  }
+
+  // Field 1: data_for_testing
+  for (auto& it : data_for_testing_) {
+    msg->AppendString(1, it);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+IPCFrame_RequestError::IPCFrame_RequestError() = default;
+IPCFrame_RequestError::~IPCFrame_RequestError() = default;
+IPCFrame_RequestError::IPCFrame_RequestError(const IPCFrame_RequestError&) = default;
+IPCFrame_RequestError& IPCFrame_RequestError::operator=(const IPCFrame_RequestError&) = default;
+IPCFrame_RequestError::IPCFrame_RequestError(IPCFrame_RequestError&&) noexcept = default;
+IPCFrame_RequestError& IPCFrame_RequestError::operator=(IPCFrame_RequestError&&) = default;
+
+bool IPCFrame_RequestError::operator==(const IPCFrame_RequestError& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && error_ == other.error_;
+}
+
+bool IPCFrame_RequestError::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* error */:
+        field.get(&error_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string IPCFrame_RequestError::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> IPCFrame_RequestError::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void IPCFrame_RequestError::Serialize(::protozero::Message* msg) const {
+  // Field 1: error
+  if (_has_field_[1]) {
+    msg->AppendString(1, error_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+IPCFrame_InvokeMethodReply::IPCFrame_InvokeMethodReply() = default;
+IPCFrame_InvokeMethodReply::~IPCFrame_InvokeMethodReply() = default;
+IPCFrame_InvokeMethodReply::IPCFrame_InvokeMethodReply(const IPCFrame_InvokeMethodReply&) = default;
+IPCFrame_InvokeMethodReply& IPCFrame_InvokeMethodReply::operator=(const IPCFrame_InvokeMethodReply&) = default;
+IPCFrame_InvokeMethodReply::IPCFrame_InvokeMethodReply(IPCFrame_InvokeMethodReply&&) noexcept = default;
+IPCFrame_InvokeMethodReply& IPCFrame_InvokeMethodReply::operator=(IPCFrame_InvokeMethodReply&&) = default;
+
+bool IPCFrame_InvokeMethodReply::operator==(const IPCFrame_InvokeMethodReply& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && success_ == other.success_
+   && has_more_ == other.has_more_
+   && reply_proto_ == other.reply_proto_;
+}
+
+bool IPCFrame_InvokeMethodReply::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* success */:
+        field.get(&success_);
+        break;
+      case 2 /* has_more */:
+        field.get(&has_more_);
+        break;
+      case 3 /* reply_proto */:
+        field.get(&reply_proto_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string IPCFrame_InvokeMethodReply::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> IPCFrame_InvokeMethodReply::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void IPCFrame_InvokeMethodReply::Serialize(::protozero::Message* msg) const {
+  // Field 1: success
+  if (_has_field_[1]) {
+    msg->AppendTinyVarInt(1, success_);
+  }
+
+  // Field 2: has_more
+  if (_has_field_[2]) {
+    msg->AppendTinyVarInt(2, has_more_);
+  }
+
+  // Field 3: reply_proto
+  if (_has_field_[3]) {
+    msg->AppendString(3, reply_proto_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+IPCFrame_InvokeMethod::IPCFrame_InvokeMethod() = default;
+IPCFrame_InvokeMethod::~IPCFrame_InvokeMethod() = default;
+IPCFrame_InvokeMethod::IPCFrame_InvokeMethod(const IPCFrame_InvokeMethod&) = default;
+IPCFrame_InvokeMethod& IPCFrame_InvokeMethod::operator=(const IPCFrame_InvokeMethod&) = default;
+IPCFrame_InvokeMethod::IPCFrame_InvokeMethod(IPCFrame_InvokeMethod&&) noexcept = default;
+IPCFrame_InvokeMethod& IPCFrame_InvokeMethod::operator=(IPCFrame_InvokeMethod&&) = default;
+
+bool IPCFrame_InvokeMethod::operator==(const IPCFrame_InvokeMethod& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && service_id_ == other.service_id_
+   && method_id_ == other.method_id_
+   && args_proto_ == other.args_proto_
+   && drop_reply_ == other.drop_reply_;
+}
+
+bool IPCFrame_InvokeMethod::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* service_id */:
+        field.get(&service_id_);
+        break;
+      case 2 /* method_id */:
+        field.get(&method_id_);
+        break;
+      case 3 /* args_proto */:
+        field.get(&args_proto_);
+        break;
+      case 4 /* drop_reply */:
+        field.get(&drop_reply_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string IPCFrame_InvokeMethod::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> IPCFrame_InvokeMethod::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void IPCFrame_InvokeMethod::Serialize(::protozero::Message* msg) const {
+  // Field 1: service_id
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, service_id_);
+  }
+
+  // Field 2: method_id
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, method_id_);
+  }
+
+  // Field 3: args_proto
+  if (_has_field_[3]) {
+    msg->AppendString(3, args_proto_);
+  }
+
+  // Field 4: drop_reply
+  if (_has_field_[4]) {
+    msg->AppendTinyVarInt(4, drop_reply_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+IPCFrame_BindServiceReply::IPCFrame_BindServiceReply() = default;
+IPCFrame_BindServiceReply::~IPCFrame_BindServiceReply() = default;
+IPCFrame_BindServiceReply::IPCFrame_BindServiceReply(const IPCFrame_BindServiceReply&) = default;
+IPCFrame_BindServiceReply& IPCFrame_BindServiceReply::operator=(const IPCFrame_BindServiceReply&) = default;
+IPCFrame_BindServiceReply::IPCFrame_BindServiceReply(IPCFrame_BindServiceReply&&) noexcept = default;
+IPCFrame_BindServiceReply& IPCFrame_BindServiceReply::operator=(IPCFrame_BindServiceReply&&) = default;
+
+bool IPCFrame_BindServiceReply::operator==(const IPCFrame_BindServiceReply& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && success_ == other.success_
+   && service_id_ == other.service_id_
+   && methods_ == other.methods_;
+}
+
+int IPCFrame_BindServiceReply::methods_size() const { return static_cast<int>(methods_.size()); }
+void IPCFrame_BindServiceReply::clear_methods() { methods_.clear(); }
+IPCFrame_BindServiceReply_MethodInfo* IPCFrame_BindServiceReply::add_methods() { methods_.emplace_back(); return &methods_.back(); }
+bool IPCFrame_BindServiceReply::ParseFromArray(const void* raw, size_t size) {
+  methods_.clear();
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* success */:
+        field.get(&success_);
+        break;
+      case 2 /* service_id */:
+        field.get(&service_id_);
+        break;
+      case 3 /* methods */:
+        methods_.emplace_back();
+        methods_.back().ParseFromArray(field.data(), field.size());
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string IPCFrame_BindServiceReply::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> IPCFrame_BindServiceReply::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void IPCFrame_BindServiceReply::Serialize(::protozero::Message* msg) const {
+  // Field 1: success
+  if (_has_field_[1]) {
+    msg->AppendTinyVarInt(1, success_);
+  }
+
+  // Field 2: service_id
+  if (_has_field_[2]) {
+    msg->AppendVarInt(2, service_id_);
+  }
+
+  // Field 3: methods
+  for (auto& it : methods_) {
+    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(3));
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+IPCFrame_BindServiceReply_MethodInfo::IPCFrame_BindServiceReply_MethodInfo() = default;
+IPCFrame_BindServiceReply_MethodInfo::~IPCFrame_BindServiceReply_MethodInfo() = default;
+IPCFrame_BindServiceReply_MethodInfo::IPCFrame_BindServiceReply_MethodInfo(const IPCFrame_BindServiceReply_MethodInfo&) = default;
+IPCFrame_BindServiceReply_MethodInfo& IPCFrame_BindServiceReply_MethodInfo::operator=(const IPCFrame_BindServiceReply_MethodInfo&) = default;
+IPCFrame_BindServiceReply_MethodInfo::IPCFrame_BindServiceReply_MethodInfo(IPCFrame_BindServiceReply_MethodInfo&&) noexcept = default;
+IPCFrame_BindServiceReply_MethodInfo& IPCFrame_BindServiceReply_MethodInfo::operator=(IPCFrame_BindServiceReply_MethodInfo&&) = default;
+
+bool IPCFrame_BindServiceReply_MethodInfo::operator==(const IPCFrame_BindServiceReply_MethodInfo& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && id_ == other.id_
+   && name_ == other.name_;
+}
+
+bool IPCFrame_BindServiceReply_MethodInfo::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* id */:
+        field.get(&id_);
+        break;
+      case 2 /* name */:
+        field.get(&name_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string IPCFrame_BindServiceReply_MethodInfo::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> IPCFrame_BindServiceReply_MethodInfo::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void IPCFrame_BindServiceReply_MethodInfo::Serialize(::protozero::Message* msg) const {
+  // Field 1: id
+  if (_has_field_[1]) {
+    msg->AppendVarInt(1, id_);
+  }
+
+  // Field 2: name
+  if (_has_field_[2]) {
+    msg->AppendString(2, name_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+
+IPCFrame_BindService::IPCFrame_BindService() = default;
+IPCFrame_BindService::~IPCFrame_BindService() = default;
+IPCFrame_BindService::IPCFrame_BindService(const IPCFrame_BindService&) = default;
+IPCFrame_BindService& IPCFrame_BindService::operator=(const IPCFrame_BindService&) = default;
+IPCFrame_BindService::IPCFrame_BindService(IPCFrame_BindService&&) noexcept = default;
+IPCFrame_BindService& IPCFrame_BindService::operator=(IPCFrame_BindService&&) = default;
+
+bool IPCFrame_BindService::operator==(const IPCFrame_BindService& other) const {
+  return unknown_fields_ == other.unknown_fields_
+   && service_name_ == other.service_name_;
+}
+
+bool IPCFrame_BindService::ParseFromArray(const void* raw, size_t size) {
+  unknown_fields_.clear();
+  bool packed_error = false;
+
+  ::protozero::ProtoDecoder dec(raw, size);
+  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
+    if (field.id() < _has_field_.size()) {
+      _has_field_.set(field.id());
+    }
+    switch (field.id()) {
+      case 1 /* service_name */:
+        field.get(&service_name_);
+        break;
+      default:
+        field.SerializeAndAppendTo(&unknown_fields_);
+        break;
+    }
+  }
+  return !packed_error && !dec.bytes_left();
+}
+
+std::string IPCFrame_BindService::SerializeAsString() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsString();
+}
+
+std::vector<uint8_t> IPCFrame_BindService::SerializeAsArray() const {
+  ::protozero::HeapBuffered<::protozero::Message> msg;
+  Serialize(msg.get());
+  return msg.SerializeAsArray();
+}
+
+void IPCFrame_BindService::Serialize(::protozero::Message* msg) const {
+  // Field 1: service_name
+  if (_has_field_[1]) {
+    msg->AppendString(1, service_name_);
+  }
+
+  msg->AppendRawProtoBytes(unknown_fields_.data(), unknown_fields_.size());
+}
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+// gen_amalgamated begin source: src/base/unix_socket.cc
+// gen_amalgamated begin header: include/perfetto/ext/base/unix_socket.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_BASE_UNIX_SOCKET_H_
+#define INCLUDE_PERFETTO_EXT_BASE_UNIX_SOCKET_H_
+
+#include <stdint.h>
+#include <sys/types.h>
+
+#include <memory>
+#include <string>
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/scoped_file.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/weak_ptr.h"
+
+struct msghdr;
+
+namespace perfetto {
+namespace base {
+
+// Define the SocketHandle and ScopedSocketHandle types.
+// On POSIX OSes, a SocketHandle is really just an int (a file descriptor).
+// On Windows, sockets are have their own type (SOCKET) which is neither a
+// HANDLE nor an int. However Windows SOCKET(s) can have a event HANDLE attached
+// to them (which in Perfetto is a PlatformHandle), and that can be used in
+// WaitForMultipleObjects, hence in base::TaskRunner.AddFileDescriptorWatch().
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+// uintptr_t really reads as SOCKET here (Windows headers typedef to that).
+// As usual we don't just use SOCKET here to avoid leaking Windows.h includes
+// in our headers.
+using SocketHandle = uintptr_t;  // SOCKET
+int CloseSocket(SocketHandle);   // A wrapper around ::closesocket().
+using ScopedSocketHandle =
+    ScopedResource<SocketHandle, CloseSocket, static_cast<SocketHandle>(-1)>;
+#else
+using SocketHandle = int;
+using ScopedSocketHandle = ScopedFile;
+#endif
+
+class TaskRunner;
+
+// Use arbitrarily high values to avoid that some code accidentally ends up
+// assuming that these enum values match the sysroot's SOCK_xxx defines rather
+// than using GetSockType() / GetSockFamily().
+enum class SockType { kStream = 100, kDgram, kSeqPacket };
+enum class SockFamily { kUnix = 200, kInet, kInet6 };
+
+// Controls the getsockopt(SO_PEERCRED) behavior, which allows to obtain the
+// peer credentials.
+enum class SockPeerCredMode {
+  // Obtain the peer credentials immediatley after connection and cache them.
+  kReadOnConnect = 0,
+
+  // Don't read peer credentials at all. Calls to peer_uid()/peer_pid() will
+  // hit a DCHECK and return kInvalidUid/Pid in release builds.
+  kIgnore = 1,
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  kDefault = kIgnore,
+#else
+  kDefault = kReadOnConnect,
+#endif
+};
+
+// UnixSocketRaw is a basic wrapper around sockets. It exposes wrapper
+// methods that take care of most common pitfalls (e.g., marking fd as
+// O_CLOEXEC, avoiding SIGPIPE, properly handling partial writes). It is used as
+// a building block for the more sophisticated UnixSocket class which depends
+// on base::TaskRunner.
+class UnixSocketRaw {
+ public:
+  // Creates a new unconnected unix socket.
+  static UnixSocketRaw CreateMayFail(SockFamily family, SockType type);
+
+#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  // Crates a pair of connected sockets.
+  static std::pair<UnixSocketRaw, UnixSocketRaw> CreatePairPosix(SockFamily,
+                                                                 SockType);
+#endif
+
+  // Creates an uninitialized unix socket.
+  UnixSocketRaw();
+
+  // Creates a unix socket adopting an existing file descriptor. This is
+  // typically used to inherit fds from init via environment variables.
+  UnixSocketRaw(ScopedSocketHandle, SockFamily, SockType);
+
+  ~UnixSocketRaw() = default;
+  UnixSocketRaw(UnixSocketRaw&&) noexcept = default;
+  UnixSocketRaw& operator=(UnixSocketRaw&&) = default;
+
+  bool Bind(const std::string& socket_name);
+  bool Listen();
+  bool Connect(const std::string& socket_name);
+  bool SetTxTimeout(uint32_t timeout_ms);
+  bool SetRxTimeout(uint32_t timeout_ms);
+  void Shutdown();
+  void SetBlocking(bool);
+  void DcheckIsBlocking(bool expected) const;  // No-op on release and Win.
+  void RetainOnExec();
+  SockType type() const { return type_; }
+  SockFamily family() const { return family_; }
+  SocketHandle fd() const { return *fd_; }
+  explicit operator bool() const { return !!fd_; }
+
+  // This is the handle that passed to TaskRunner.AddFileDescriptorWatch().
+  // On UNIX this is just the socket FD. On Windows, we need to create a
+  // dedicated event object.
+  PlatformHandle watch_handle() const {
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+    return *event_handle_;
+#else
+    return *fd_;
+#endif
+  }
+
+  ScopedSocketHandle ReleaseFd() { return std::move(fd_); }
+
+  // |send_fds| and |num_fds| are ignored on Windows.
+  ssize_t Send(const void* msg,
+               size_t len,
+               const int* send_fds = nullptr,
+               size_t num_fds = 0);
+
+  // |fd_vec| and |max_files| are ignored on Windows.
+  ssize_t Receive(void* msg,
+                  size_t len,
+                  ScopedFile* fd_vec = nullptr,
+                  size_t max_files = 0);
+
+#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  // UNIX-specific helpers to deal with SCM_RIGHTS.
+
+  // Re-enter sendmsg until all the data has been sent or an error occurs.
+  // TODO(fmayer): Figure out how to do timeouts here for heapprofd.
+  ssize_t SendMsgAllPosix(struct msghdr* msg);
+
+  // Exposed for testing only.
+  // Update msghdr so subsequent sendmsg will send data that remains after n
+  // bytes have already been sent.
+  static void ShiftMsgHdrPosix(size_t n, struct msghdr* msg);
+#endif
+
+ private:
+  UnixSocketRaw(SockFamily, SockType);
+
+  UnixSocketRaw(const UnixSocketRaw&) = delete;
+  UnixSocketRaw& operator=(const UnixSocketRaw&) = delete;
+
+  ScopedSocketHandle fd_;
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  ScopedPlatformHandle event_handle_;
+#endif
+  SockFamily family_ = SockFamily::kUnix;
+  SockType type_ = SockType::kStream;
+};
+
+// A non-blocking UNIX domain socket. Allows also to transfer file descriptors.
+// None of the methods in this class are blocking.
+// The main design goal is making strong guarantees on the EventListener
+// callbacks, in order to avoid ending in some undefined state.
+// In case of any error it will aggressively just shut down the socket and
+// notify the failure with OnConnect(false) or OnDisconnect() depending on the
+// state of the socket (see below).
+// EventListener callbacks stop happening as soon as the instance is destroyed.
+//
+// Lifecycle of a client socket:
+//
+//                           Connect()
+//                               |
+//            +------------------+------------------+
+//            | (success)                           | (failure or Shutdown())
+//            V                                     V
+//     OnConnect(true)                         OnConnect(false)
+//            |
+//            V
+//    OnDataAvailable()
+//            |
+//            V
+//     OnDisconnect()  (failure or shutdown)
+//
+//
+// Lifecycle of a server socket:
+//
+//                          Listen()  --> returns false in case of errors.
+//                             |
+//                             V
+//              OnNewIncomingConnection(new_socket)
+//
+//          (|new_socket| inherits the same EventListener)
+//                             |
+//                             V
+//                     OnDataAvailable()
+//                             | (failure or Shutdown())
+//                             V
+//                       OnDisconnect()
+class PERFETTO_EXPORT UnixSocket {
+ public:
+  class EventListener {
+   public:
+    virtual ~EventListener();
+
+    // After Listen().
+    virtual void OnNewIncomingConnection(
+        UnixSocket* self,
+        std::unique_ptr<UnixSocket> new_connection);
+
+    // After Connect(), whether successful or not.
+    virtual void OnConnect(UnixSocket* self, bool connected);
+
+    // After a successful Connect() or OnNewIncomingConnection(). Either the
+    // other endpoint did disconnect or some other error happened.
+    virtual void OnDisconnect(UnixSocket* self);
+
+    // Whenever there is data available to Receive(). Note that spurious FD
+    // watch events are possible, so it is possible that Receive() soon after
+    // OnDataAvailable() returns 0 (just ignore those).
+    virtual void OnDataAvailable(UnixSocket* self);
+  };
+
+  enum class State {
+    kDisconnected = 0,  // Failed connection, peer disconnection or Shutdown().
+    kConnecting,  // Soon after Connect(), before it either succeeds or fails.
+    kConnected,   // After a successful Connect().
+    kListening    // After Listen(), until Shutdown().
+  };
+
+  // Creates a socket and starts listening. If SockFamily::kUnix and
+  // |socket_name| starts with a '@', an abstract UNIX dmoain socket will be
+  // created instead of a filesystem-linked UNIX socket (Linux/Android only).
+  // If SockFamily::kInet, |socket_name| is host:port (e.g., "1.2.3.4:8000").
+  // If SockFamily::kInet6, |socket_name| is [host]:port (e.g., "[::1]:8000").
+  // Returns nullptr if the socket creation or bind fails. If listening fails,
+  // (e.g. if another socket with the same name is already listening) the
+  // returned socket will have is_listening() == false.
+  static std::unique_ptr<UnixSocket> Listen(const std::string& socket_name,
+                                            EventListener*,
+                                            TaskRunner*,
+                                            SockFamily,
+                                            SockType);
+
+  // Attaches to a pre-existing socket. The socket must have been created in
+  // SOCK_STREAM mode and the caller must have called bind() on it.
+  static std::unique_ptr<UnixSocket> Listen(ScopedSocketHandle,
+                                            EventListener*,
+                                            TaskRunner*,
+                                            SockFamily,
+                                            SockType);
+
+  // Creates a Unix domain socket and connects to the listening endpoint.
+  // Returns always an instance. EventListener::OnConnect(bool success) will
+  // be called always, whether the connection succeeded or not.
+  static std::unique_ptr<UnixSocket> Connect(
+      const std::string& socket_name,
+      EventListener*,
+      TaskRunner*,
+      SockFamily,
+      SockType,
+      SockPeerCredMode = SockPeerCredMode::kDefault);
+
+  // Constructs a UnixSocket using the given connected socket.
+  static std::unique_ptr<UnixSocket> AdoptConnected(
+      ScopedSocketHandle,
+      EventListener*,
+      TaskRunner*,
+      SockFamily,
+      SockType,
+      SockPeerCredMode = SockPeerCredMode::kDefault);
+
+  UnixSocket(const UnixSocket&) = delete;
+  UnixSocket& operator=(const UnixSocket&) = delete;
+  // Cannot be easily moved because of tasks from the FileDescriptorWatch.
+  UnixSocket(UnixSocket&&) = delete;
+  UnixSocket& operator=(UnixSocket&&) = delete;
+
+  // This class gives the hard guarantee that no callback is called on the
+  // passed EventListener immediately after the object has been destroyed.
+  // Any queued callback will be silently dropped.
+  ~UnixSocket();
+
+  // Shuts down the current connection, if any. If the socket was Listen()-ing,
+  // stops listening. The socket goes back to kNotInitialized state, so it can
+  // be reused with Listen() or Connect().
+  void Shutdown(bool notify);
+
+  void SetTxTimeout(uint32_t timeout_ms) {
+    PERFETTO_CHECK(sock_raw_.SetTxTimeout(timeout_ms));
+  }
+  void SetRxTimeout(uint32_t timeout_ms) {
+    PERFETTO_CHECK(sock_raw_.SetRxTimeout(timeout_ms));
+  }
+  // Returns true is the message was queued, false if there was no space in the
+  // output buffer, in which case the client should retry or give up.
+  // If any other error happens the socket will be shutdown and
+  // EventListener::OnDisconnect() will be called.
+  // If the socket is not connected, Send() will just return false.
+  // Does not append a null string terminator to msg in any case.
+  bool Send(const void* msg, size_t len, const int* send_fds, size_t num_fds);
+
+  inline bool Send(const void* msg, size_t len, int send_fd = -1) {
+    if (send_fd != -1)
+      return Send(msg, len, &send_fd, 1);
+    return Send(msg, len, nullptr, 0);
+  }
+
+  inline bool Send(const std::string& msg) {
+    return Send(msg.c_str(), msg.size() + 1, -1);
+  }
+
+  // Returns the number of bytes (<= |len|) written in |msg| or 0 if there
+  // is no data in the buffer to read or an error occurs (in which case a
+  // EventListener::OnDisconnect() will follow).
+  // If the ScopedFile pointer is not null and a FD is received, it moves the
+  // received FD into that. If a FD is received but the ScopedFile pointer is
+  // null, the FD will be automatically closed.
+  size_t Receive(void* msg, size_t len, ScopedFile*, size_t max_files = 1);
+
+  inline size_t Receive(void* msg, size_t len) {
+    return Receive(msg, len, nullptr, 0);
+  }
+
+  // Only for tests. This is slower than Receive() as it requires a heap
+  // allocation and a copy for the std::string. Guarantees that the returned
+  // string is null terminated even if the underlying message sent by the peer
+  // is not.
+  std::string ReceiveString(size_t max_length = 1024);
+
+  bool is_connected() const { return state_ == State::kConnected; }
+  bool is_listening() const { return state_ == State::kListening; }
+  SocketHandle fd() const { return sock_raw_.fd(); }
+
+  // User ID of the peer, as returned by the kernel. If the client disconnects
+  // and the socket goes into the kDisconnected state, it retains the uid of
+  // the last peer.
+#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  uid_t peer_uid_posix(bool skip_check_for_testing = false) const {
+    PERFETTO_DCHECK((!is_listening() && peer_uid_ != kInvalidUid) ||
+                    skip_check_for_testing);
+
+    return peer_uid_;
+  }
+#endif
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+  // Process ID of the peer, as returned by the kernel. If the client
+  // disconnects and the socket goes into the kDisconnected state, it
+  // retains the pid of the last peer.
+  //
+  // This is only available on Linux / Android.
+  pid_t peer_pid_linux(bool skip_check_for_testing = false) const {
+    PERFETTO_DCHECK((!is_listening() && peer_pid_ != kInvalidPid) ||
+                    skip_check_for_testing);
+    return peer_pid_;
+  }
+#endif
+
+  // This makes the UnixSocket unusable.
+  UnixSocketRaw ReleaseSocket();
+
+ private:
+  UnixSocket(EventListener*,
+             TaskRunner*,
+             SockFamily,
+             SockType,
+             SockPeerCredMode);
+  UnixSocket(EventListener*,
+             TaskRunner*,
+             ScopedSocketHandle,
+             State,
+             SockFamily,
+             SockType,
+             SockPeerCredMode);
+
+  // Called once by the corresponding public static factory methods.
+  void DoConnect(const std::string& socket_name);
+
+#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  void ReadPeerCredentialsPosix();
+#endif
+
+  void OnEvent();
+  void NotifyConnectionState(bool success);
+
+  UnixSocketRaw sock_raw_;
+  State state_ = State::kDisconnected;
+  SockPeerCredMode peer_cred_mode_ = SockPeerCredMode::kDefault;
+
+#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  uid_t peer_uid_ = kInvalidUid;
+#endif
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+  pid_t peer_pid_ = kInvalidPid;
+#endif
+  EventListener* const event_listener_;
+  TaskRunner* const task_runner_;
+  WeakPtrFactory<UnixSocket> weak_ptr_factory_;  // Keep last.
+};
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_BASE_UNIX_SOCKET_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/unix_socket.h"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+// gen_amalgamated expanded: #include "perfetto/base/compiler.h"
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+// The include order matters on these three Windows header groups.
+#include <Windows.h>
+
+#include <WS2tcpip.h>
+#include <WinSock2.h>
+
+#include <afunix.h>
+#else
+#include <netdb.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <unistd.h>
+#endif
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+#include <sys/ucred.h>
+#endif
+
+#include <algorithm>
+#include <memory>
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/base/task_runner.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/string_utils.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+
+namespace perfetto {
+namespace base {
+
+// The CMSG_* macros use NULL instead of nullptr.
+// Note: MSVC doesn't have #pragma GCC diagnostic, hence the if __GNUC__.
+#if defined(__GNUC__) && !PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
+#endif
+
+namespace {
+
+// MSG_NOSIGNAL is not supported on Mac OS X, but in that case the socket is
+// created with SO_NOSIGPIPE (See InitializeSocket()).
+// On Windows this does't apply as signals don't exist.
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+#elif PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+constexpr int kNoSigPipe = 0;
+#else
+constexpr int kNoSigPipe = MSG_NOSIGNAL;
+#endif
+
+// Android takes an int instead of socklen_t for the control buffer size.
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+using CBufLenType = size_t;
+#else
+using CBufLenType = socklen_t;
+#endif
+
+// A wrapper around variable-size sockaddr structs.
+// This is solving the following problem: when calling connect() or bind(), the
+// caller needs to take care to allocate the right struct (sockaddr_un for
+// AF_UNIX, sockaddr_in for AF_INET).   Those structs have different sizes and,
+// more importantly, are bigger than the base struct sockaddr.
+struct SockaddrAny {
+  SockaddrAny() : size() {}
+  SockaddrAny(const void* addr, socklen_t sz)
+      : data(new char[static_cast<size_t>(sz)]), size(sz) {
+    memcpy(data.get(), addr, static_cast<size_t>(size));
+  }
+
+  const struct sockaddr* addr() const {
+    return reinterpret_cast<const struct sockaddr*>(data.get());
+  }
+
+  std::unique_ptr<char[]> data;
+  socklen_t size;
+};
+
+inline int GetSockFamily(SockFamily family) {
+  switch (family) {
+    case SockFamily::kUnix:
+      return AF_UNIX;
+    case SockFamily::kInet:
+      return AF_INET;
+    case SockFamily::kInet6:
+      return AF_INET6;
+  }
+  PERFETTO_CHECK(false);  // For GCC.
+}
+
+inline int GetSockType(SockType type) {
+#ifdef SOCK_CLOEXEC
+  constexpr int kSockCloExec = SOCK_CLOEXEC;
+#else
+  constexpr int kSockCloExec = 0;
+#endif
+  switch (type) {
+    case SockType::kStream:
+      return SOCK_STREAM | kSockCloExec;
+    case SockType::kDgram:
+      return SOCK_DGRAM | kSockCloExec;
+    case SockType::kSeqPacket:
+      return SOCK_SEQPACKET | kSockCloExec;
+  }
+  PERFETTO_CHECK(false);  // For GCC.
+}
+
+SockaddrAny MakeSockAddr(SockFamily family, const std::string& socket_name) {
+  switch (family) {
+    case SockFamily::kUnix: {
+      struct sockaddr_un saddr {};
+      const size_t name_len = socket_name.size();
+      if (name_len >= sizeof(saddr.sun_path)) {
+        errno = ENAMETOOLONG;
+        return SockaddrAny();
+      }
+      memcpy(saddr.sun_path, socket_name.data(), name_len);
+      if (saddr.sun_path[0] == '@') {
+        saddr.sun_path[0] = '\0';
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+        // The MSDN blog claims that abstract (non-filesystem based) AF_UNIX
+        // socket are supported, but that doesn't seem true.
+        PERFETTO_ELOG(
+            "Abstract AF_UNIX sockets are not supported on Windows, see "
+            "https://github.com/microsoft/WSL/issues/4240");
+        return SockaddrAny{};
+#endif
+      }
+      saddr.sun_family = AF_UNIX;
+      auto size = static_cast<socklen_t>(
+          __builtin_offsetof(sockaddr_un, sun_path) + name_len + 1);
+      PERFETTO_CHECK(static_cast<size_t>(size) <= sizeof(saddr));
+      return SockaddrAny(&saddr, size);
+    }
+    case SockFamily::kInet: {
+      auto parts = SplitString(socket_name, ":");
+      PERFETTO_CHECK(parts.size() == 2);
+      struct addrinfo* addr_info = nullptr;
+      struct addrinfo hints {};
+      hints.ai_family = AF_INET;
+      PERFETTO_CHECK(getaddrinfo(parts[0].c_str(), parts[1].c_str(), &hints,
+                                 &addr_info) == 0);
+      PERFETTO_CHECK(addr_info->ai_family == AF_INET);
+      SockaddrAny res(addr_info->ai_addr,
+                      static_cast<socklen_t>(addr_info->ai_addrlen));
+      freeaddrinfo(addr_info);
+      return res;
+    }
+    case SockFamily::kInet6: {
+      auto parts = SplitString(socket_name, "]");
+      PERFETTO_CHECK(parts.size() == 2);
+      auto address = SplitString(parts[0], "[");
+      PERFETTO_CHECK(address.size() == 1);
+      auto port = SplitString(parts[1], ":");
+      PERFETTO_CHECK(port.size() == 1);
+      struct addrinfo* addr_info = nullptr;
+      struct addrinfo hints {};
+      hints.ai_family = AF_INET6;
+      PERFETTO_CHECK(getaddrinfo(address[0].c_str(), port[0].c_str(), &hints,
+                                 &addr_info) == 0);
+      PERFETTO_CHECK(addr_info->ai_family == AF_INET6);
+      SockaddrAny res(addr_info->ai_addr,
+                      static_cast<socklen_t>(addr_info->ai_addrlen));
+      freeaddrinfo(addr_info);
+      return res;
+    }
+  }
+  PERFETTO_CHECK(false);  // For GCC.
+}
+
+ScopedSocketHandle CreateSocketHandle(SockFamily family, SockType type) {
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  static bool init_winsock_once = [] {
+    WSADATA ignored{};
+    return WSAStartup(MAKEWORD(2, 2), &ignored) == 0;
+  }();
+  PERFETTO_CHECK(init_winsock_once);
+#endif
+  return ScopedSocketHandle(
+      socket(GetSockFamily(family), GetSockType(type), 0));
+}
+
+}  // namespace
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+int CloseSocket(SocketHandle s) {
+  return ::closesocket(s);
+}
+#endif
+
+// +-----------------------+
+// | UnixSocketRaw methods |
+// +-----------------------+
+
+#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+// static
+void UnixSocketRaw::ShiftMsgHdrPosix(size_t n, struct msghdr* msg) {
+  using LenType = decltype(msg->msg_iovlen);  // Mac and Linux don't agree.
+  for (LenType i = 0; i < msg->msg_iovlen; ++i) {
+    struct iovec* vec = &msg->msg_iov[i];
+    if (n < vec->iov_len) {
+      // We sent a part of this iovec.
+      vec->iov_base = reinterpret_cast<char*>(vec->iov_base) + n;
+      vec->iov_len -= n;
+      msg->msg_iov = vec;
+      msg->msg_iovlen -= i;
+      return;
+    }
+    // We sent the whole iovec.
+    n -= vec->iov_len;
+  }
+  // We sent all the iovecs.
+  PERFETTO_CHECK(n == 0);
+  msg->msg_iovlen = 0;
+  msg->msg_iov = nullptr;
+}
+
+// static
+std::pair<UnixSocketRaw, UnixSocketRaw> UnixSocketRaw::CreatePairPosix(
+    SockFamily family,
+    SockType type) {
+  int fds[2];
+  if (socketpair(GetSockFamily(family), GetSockType(type), 0, fds) != 0)
+    return std::make_pair(UnixSocketRaw(), UnixSocketRaw());
+
+  return std::make_pair(UnixSocketRaw(ScopedFile(fds[0]), family, type),
+                        UnixSocketRaw(ScopedFile(fds[1]), family, type));
+}
+#endif
+
+// static
+UnixSocketRaw UnixSocketRaw::CreateMayFail(SockFamily family, SockType type) {
+  auto fd = CreateSocketHandle(family, type);
+  if (!fd)
+    return UnixSocketRaw();
+  return UnixSocketRaw(std::move(fd), family, type);
+}
+
+UnixSocketRaw::UnixSocketRaw() = default;
+
+UnixSocketRaw::UnixSocketRaw(SockFamily family, SockType type)
+    : UnixSocketRaw(CreateSocketHandle(family, type), family, type) {}
+
+UnixSocketRaw::UnixSocketRaw(ScopedSocketHandle fd,
+                             SockFamily family,
+                             SockType type)
+    : fd_(std::move(fd)), family_(family), type_(type) {
+  PERFETTO_CHECK(fd_);
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+  const int no_sigpipe = 1;
+  setsockopt(*fd_, SOL_SOCKET, SO_NOSIGPIPE, &no_sigpipe, sizeof(no_sigpipe));
+#endif
+
+  if (family == SockFamily::kInet || family == SockFamily::kInet6) {
+    int flag = 1;
+    // The reinterpret_cast<const char*> is needed for Windows, where the 4th
+    // arg is a const char* (on other POSIX system is a const void*).
+    PERFETTO_CHECK(!setsockopt(*fd_, SOL_SOCKET, SO_REUSEADDR,
+                               reinterpret_cast<const char*>(&flag),
+                               sizeof(flag)));
+    flag = 1;
+    // Disable Nagle's algorithm, optimize for low-latency.
+    // See https://github.com/google/perfetto/issues/70.
+    setsockopt(*fd_, IPPROTO_TCP, TCP_NODELAY,
+               reinterpret_cast<const char*>(&flag), sizeof(flag));
+  }
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  // We use one event handle for all socket events, to stay consistent to what
+  // we do on UNIX with the base::TaskRunner's poll().
+  event_handle_.reset(WSACreateEvent());
+  PERFETTO_CHECK(event_handle_);
+#else
+  // There is no reason why a socket should outlive the process in case of
+  // exec() by default, this is just working around a broken unix design.
+  int fcntl_res = fcntl(*fd_, F_SETFD, FD_CLOEXEC);
+  PERFETTO_CHECK(fcntl_res == 0);
+#endif
+}
+
+void UnixSocketRaw::SetBlocking(bool is_blocking) {
+  PERFETTO_DCHECK(fd_);
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  unsigned long flag = is_blocking ? 0 : 1;  // FIONBIO has reverse logic.
+  if (is_blocking) {
+    // When switching between non-blocking -> blocking mode, we need to reset
+    // the event handle registration, otherwise the call will fail.
+    PERFETTO_CHECK(WSAEventSelect(*fd_, *event_handle_, 0) == 0);
+  }
+  PERFETTO_CHECK(ioctlsocket(*fd_, static_cast<long>(FIONBIO), &flag) == 0);
+  if (!is_blocking) {
+    PERFETTO_CHECK(
+        WSAEventSelect(*fd_, *event_handle_,
+                       FD_ACCEPT | FD_CONNECT | FD_READ | FD_CLOSE) == 0);
+  }
+#else
+  int flags = fcntl(*fd_, F_GETFL, 0);
+  if (!is_blocking) {
+    flags |= O_NONBLOCK;
+  } else {
+    flags &= ~static_cast<int>(O_NONBLOCK);
+  }
+  int fcntl_res = fcntl(*fd_, F_SETFL, flags);
+  PERFETTO_CHECK(fcntl_res == 0);
+#endif
+}
+
+void UnixSocketRaw::RetainOnExec() {
+#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  PERFETTO_DCHECK(fd_);
+  int flags = fcntl(*fd_, F_GETFD, 0);
+  flags &= ~static_cast<int>(FD_CLOEXEC);
+  int fcntl_res = fcntl(*fd_, F_SETFD, flags);
+  PERFETTO_CHECK(fcntl_res == 0);
+#endif
+}
+
+void UnixSocketRaw::DcheckIsBlocking(bool expected) const {
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  ignore_result(expected);
+#else
+  PERFETTO_DCHECK(fd_);
+  bool is_blocking = (fcntl(*fd_, F_GETFL, 0) & O_NONBLOCK) == 0;
+  PERFETTO_DCHECK(is_blocking == expected);
+#endif
+}
+
+bool UnixSocketRaw::Bind(const std::string& socket_name) {
+  PERFETTO_DCHECK(fd_);
+  SockaddrAny addr = MakeSockAddr(family_, socket_name);
+  if (addr.size == 0)
+    return false;
+
+  if (bind(*fd_, addr.addr(), addr.size)) {
+    PERFETTO_DPLOG("bind(%s)", socket_name.c_str());
+    return false;
+  }
+
+  return true;
+}
+
+bool UnixSocketRaw::Listen() {
+  PERFETTO_DCHECK(fd_);
+  PERFETTO_DCHECK(type_ == SockType::kStream || type_ == SockType::kSeqPacket);
+  return listen(*fd_, SOMAXCONN) == 0;
+}
+
+bool UnixSocketRaw::Connect(const std::string& socket_name) {
+  PERFETTO_DCHECK(fd_);
+  SockaddrAny addr = MakeSockAddr(family_, socket_name);
+  if (addr.size == 0)
+    return false;
+
+  int res = PERFETTO_EINTR(connect(*fd_, addr.addr(), addr.size));
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  bool continue_async = WSAGetLastError() == WSAEWOULDBLOCK;
+#else
+  bool continue_async = errno == EINPROGRESS;
+#endif
+  if (res && !continue_async)
+    return false;
+
+  return true;
+}
+
+void UnixSocketRaw::Shutdown() {
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  // Somebody felt very strongly about the naming of this constant.
+  shutdown(*fd_, SD_BOTH);
+#else
+  shutdown(*fd_, SHUT_RDWR);
+#endif
+  fd_.reset();
+}
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+
+ssize_t UnixSocketRaw::Send(const void* msg,
+                            size_t len,
+                            const int* /*send_fds*/,
+                            size_t num_fds) {
+  PERFETTO_DCHECK(num_fds == 0);
+  return sendto(*fd_, static_cast<const char*>(msg), static_cast<int>(len), 0,
+                nullptr, 0);
+}
+
+ssize_t UnixSocketRaw::Receive(void* msg,
+                               size_t len,
+                               ScopedFile* /*fd_vec*/,
+                               size_t /*max_files*/) {
+  return recv(*fd_, static_cast<char*>(msg), static_cast<int>(len), 0);
+}
+
+#else
+// For the interested reader, Linux kernel dive to verify this is not only a
+// theoretical possibility: sock_stream_sendmsg, if sock_alloc_send_pskb returns
+// NULL [1] (which it does when it gets interrupted [2]), returns early with the
+// amount of bytes already sent.
+//
+// [1]:
+// https://elixir.bootlin.com/linux/v4.18.10/source/net/unix/af_unix.c#L1872
+// [2]: https://elixir.bootlin.com/linux/v4.18.10/source/net/core/sock.c#L2101
+ssize_t UnixSocketRaw::SendMsgAllPosix(struct msghdr* msg) {
+  // This does not make sense on non-blocking sockets.
+  PERFETTO_DCHECK(fd_);
+
+  ssize_t total_sent = 0;
+  while (msg->msg_iov) {
+    ssize_t sent = PERFETTO_EINTR(sendmsg(*fd_, msg, kNoSigPipe));
+    if (sent <= 0) {
+      if (sent == -1 && IsAgain(errno))
+        return total_sent;
+      return sent;
+    }
+    total_sent += sent;
+    ShiftMsgHdrPosix(static_cast<size_t>(sent), msg);
+    // Only send the ancillary data with the first sendmsg call.
+    msg->msg_control = nullptr;
+    msg->msg_controllen = 0;
+  }
+  return total_sent;
+}
+
+ssize_t UnixSocketRaw::Send(const void* msg,
+                            size_t len,
+                            const int* send_fds,
+                            size_t num_fds) {
+  PERFETTO_DCHECK(fd_);
+  msghdr msg_hdr = {};
+  iovec iov = {const_cast<void*>(msg), len};
+  msg_hdr.msg_iov = &iov;
+  msg_hdr.msg_iovlen = 1;
+  alignas(cmsghdr) char control_buf[256];
+
+  if (num_fds > 0) {
+    const auto raw_ctl_data_sz = num_fds * sizeof(int);
+    const CBufLenType control_buf_len =
+        static_cast<CBufLenType>(CMSG_SPACE(raw_ctl_data_sz));
+    PERFETTO_CHECK(control_buf_len <= sizeof(control_buf));
+    memset(control_buf, 0, sizeof(control_buf));
+    msg_hdr.msg_control = control_buf;
+    msg_hdr.msg_controllen = control_buf_len;  // used by CMSG_FIRSTHDR
+    struct cmsghdr* cmsg = CMSG_FIRSTHDR(&msg_hdr);
+    cmsg->cmsg_level = SOL_SOCKET;
+    cmsg->cmsg_type = SCM_RIGHTS;
+    cmsg->cmsg_len = static_cast<CBufLenType>(CMSG_LEN(raw_ctl_data_sz));
+    memcpy(CMSG_DATA(cmsg), send_fds, num_fds * sizeof(int));
+    // note: if we were to send multiple cmsghdr structures, then
+    // msg_hdr.msg_controllen would need to be adjusted, see "man 3 cmsg".
+  }
+
+  return SendMsgAllPosix(&msg_hdr);
+}
+
+ssize_t UnixSocketRaw::Receive(void* msg,
+                               size_t len,
+                               ScopedFile* fd_vec,
+                               size_t max_files) {
+  PERFETTO_DCHECK(fd_);
+  msghdr msg_hdr = {};
+  iovec iov = {msg, len};
+  msg_hdr.msg_iov = &iov;
+  msg_hdr.msg_iovlen = 1;
+  alignas(cmsghdr) char control_buf[256];
+
+  if (max_files > 0) {
+    msg_hdr.msg_control = control_buf;
+    msg_hdr.msg_controllen =
+        static_cast<CBufLenType>(CMSG_SPACE(max_files * sizeof(int)));
+    PERFETTO_CHECK(msg_hdr.msg_controllen <= sizeof(control_buf));
+  }
+  const ssize_t sz = PERFETTO_EINTR(recvmsg(*fd_, &msg_hdr, 0));
+  if (sz <= 0) {
+    return sz;
+  }
+  PERFETTO_CHECK(static_cast<size_t>(sz) <= len);
+
+  int* fds = nullptr;
+  uint32_t fds_len = 0;
+
+  if (max_files > 0) {
+    for (cmsghdr* cmsg = CMSG_FIRSTHDR(&msg_hdr); cmsg;
+         cmsg = CMSG_NXTHDR(&msg_hdr, cmsg)) {
+      const size_t payload_len = cmsg->cmsg_len - CMSG_LEN(0);
+      if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS) {
+        PERFETTO_DCHECK(payload_len % sizeof(int) == 0u);
+        PERFETTO_CHECK(fds == nullptr);
+        fds = reinterpret_cast<int*>(CMSG_DATA(cmsg));
+        fds_len = static_cast<uint32_t>(payload_len / sizeof(int));
+      }
+    }
+  }
+
+  if (msg_hdr.msg_flags & MSG_TRUNC || msg_hdr.msg_flags & MSG_CTRUNC) {
+    for (size_t i = 0; fds && i < fds_len; ++i)
+      close(fds[i]);
+    PERFETTO_ELOG(
+        "Socket message truncated. This might be due to a SELinux denial on "
+        "fd:use.");
+    errno = EMSGSIZE;
+    return -1;
+  }
+
+  for (size_t i = 0; fds && i < fds_len; ++i) {
+    if (i < max_files)
+      fd_vec[i].reset(fds[i]);
+    else
+      close(fds[i]);
+  }
+
+  return sz;
+}
+#endif  // OS_WIN
+
+bool UnixSocketRaw::SetTxTimeout(uint32_t timeout_ms) {
+  PERFETTO_DCHECK(fd_);
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  DWORD timeout = timeout_ms;
+#else
+  struct timeval timeout {};
+  uint32_t timeout_sec = timeout_ms / 1000;
+  timeout.tv_sec = static_cast<decltype(timeout.tv_sec)>(timeout_sec);
+  timeout.tv_usec = static_cast<decltype(timeout.tv_usec)>(
+      (timeout_ms - (timeout_sec * 1000)) * 1000);
+#endif
+  return setsockopt(*fd_, SOL_SOCKET, SO_SNDTIMEO,
+                    reinterpret_cast<const char*>(&timeout),
+                    sizeof(timeout)) == 0;
+}
+
+bool UnixSocketRaw::SetRxTimeout(uint32_t timeout_ms) {
+  PERFETTO_DCHECK(fd_);
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  DWORD timeout = timeout_ms;
+#else
+  struct timeval timeout {};
+  uint32_t timeout_sec = timeout_ms / 1000;
+  timeout.tv_sec = static_cast<decltype(timeout.tv_sec)>(timeout_sec);
+  timeout.tv_usec = static_cast<decltype(timeout.tv_usec)>(
+      (timeout_ms - (timeout_sec * 1000)) * 1000);
+#endif
+  return setsockopt(*fd_, SOL_SOCKET, SO_RCVTIMEO,
+                    reinterpret_cast<const char*>(&timeout),
+                    sizeof(timeout)) == 0;
+}
+
+#if defined(__GNUC__) && !PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+#pragma GCC diagnostic pop
+#endif
+
+// +--------------------+
+// | UnixSocket methods |
+// +--------------------+
+
+// TODO(primiano): Add ThreadChecker to methods of this class.
+
+// static
+std::unique_ptr<UnixSocket> UnixSocket::Listen(const std::string& socket_name,
+                                               EventListener* event_listener,
+                                               TaskRunner* task_runner,
+                                               SockFamily sock_family,
+                                               SockType sock_type) {
+  auto sock_raw = UnixSocketRaw::CreateMayFail(sock_family, sock_type);
+  if (!sock_raw || !sock_raw.Bind(socket_name))
+    return nullptr;
+
+  // Forward the call to the Listen() overload below.
+  return Listen(sock_raw.ReleaseFd(), event_listener, task_runner, sock_family,
+                sock_type);
+}
+
+// static
+std::unique_ptr<UnixSocket> UnixSocket::Listen(ScopedSocketHandle fd,
+                                               EventListener* event_listener,
+                                               TaskRunner* task_runner,
+                                               SockFamily sock_family,
+                                               SockType sock_type) {
+  return std::unique_ptr<UnixSocket>(new UnixSocket(
+      event_listener, task_runner, std::move(fd), State::kListening,
+      sock_family, sock_type, SockPeerCredMode::kDefault));
+}
+
+// static
+std::unique_ptr<UnixSocket> UnixSocket::Connect(
+    const std::string& socket_name,
+    EventListener* event_listener,
+    TaskRunner* task_runner,
+    SockFamily sock_family,
+    SockType sock_type,
+    SockPeerCredMode peer_cred_mode) {
+  std::unique_ptr<UnixSocket> sock(new UnixSocket(
+      event_listener, task_runner, sock_family, sock_type, peer_cred_mode));
+  sock->DoConnect(socket_name);
+  return sock;
+}
+
+// static
+std::unique_ptr<UnixSocket> UnixSocket::AdoptConnected(
+    ScopedSocketHandle fd,
+    EventListener* event_listener,
+    TaskRunner* task_runner,
+    SockFamily sock_family,
+    SockType sock_type,
+    SockPeerCredMode peer_cred_mode) {
+  return std::unique_ptr<UnixSocket>(new UnixSocket(
+      event_listener, task_runner, std::move(fd), State::kConnected,
+      sock_family, sock_type, peer_cred_mode));
+}
+
+UnixSocket::UnixSocket(EventListener* event_listener,
+                       TaskRunner* task_runner,
+                       SockFamily sock_family,
+                       SockType sock_type,
+                       SockPeerCredMode peer_cred_mode)
+    : UnixSocket(event_listener,
+                 task_runner,
+                 ScopedSocketHandle(),
+                 State::kDisconnected,
+                 sock_family,
+                 sock_type,
+                 peer_cred_mode) {}
+
+UnixSocket::UnixSocket(EventListener* event_listener,
+                       TaskRunner* task_runner,
+                       ScopedSocketHandle adopt_fd,
+                       State adopt_state,
+                       SockFamily sock_family,
+                       SockType sock_type,
+                       SockPeerCredMode peer_cred_mode)
+    : peer_cred_mode_(peer_cred_mode),
+      event_listener_(event_listener),
+      task_runner_(task_runner),
+      weak_ptr_factory_(this) {
+  state_ = State::kDisconnected;
+  if (adopt_state == State::kDisconnected) {
+    PERFETTO_DCHECK(!adopt_fd);
+    sock_raw_ = UnixSocketRaw::CreateMayFail(sock_family, sock_type);
+    if (!sock_raw_)
+      return;
+  } else if (adopt_state == State::kConnected) {
+    PERFETTO_DCHECK(adopt_fd);
+    sock_raw_ = UnixSocketRaw(std::move(adopt_fd), sock_family, sock_type);
+    state_ = State::kConnected;
+#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+    if (peer_cred_mode_ == SockPeerCredMode::kReadOnConnect)
+      ReadPeerCredentialsPosix();
+#endif
+  } else if (adopt_state == State::kListening) {
+    // We get here from Listen().
+
+    // |adopt_fd| might genuinely be invalid if the bind() failed.
+    if (!adopt_fd)
+      return;
+
+    sock_raw_ = UnixSocketRaw(std::move(adopt_fd), sock_family, sock_type);
+    if (!sock_raw_.Listen()) {
+      PERFETTO_DPLOG("listen() failed");
+      return;
+    }
+    state_ = State::kListening;
+  } else {
+    PERFETTO_FATAL("Unexpected adopt_state");  // Unfeasible.
+  }
+
+  PERFETTO_CHECK(sock_raw_);
+
+  sock_raw_.SetBlocking(false);
+
+  WeakPtr<UnixSocket> weak_ptr = weak_ptr_factory_.GetWeakPtr();
+
+  task_runner_->AddFileDescriptorWatch(sock_raw_.watch_handle(), [weak_ptr] {
+    if (weak_ptr)
+      weak_ptr->OnEvent();
+  });
+}
+
+UnixSocket::~UnixSocket() {
+  // The implicit dtor of |weak_ptr_factory_| will no-op pending callbacks.
+  Shutdown(true);
+}
+
+UnixSocketRaw UnixSocket::ReleaseSocket() {
+  // This will invalidate any pending calls to OnEvent.
+  state_ = State::kDisconnected;
+  if (sock_raw_)
+    task_runner_->RemoveFileDescriptorWatch(sock_raw_.watch_handle());
+
+  return std::move(sock_raw_);
+}
+
+// Called only by the Connect() static constructor.
+void UnixSocket::DoConnect(const std::string& socket_name) {
+  PERFETTO_DCHECK(state_ == State::kDisconnected);
+
+  // This is the only thing that can gracefully fail in the ctor.
+  if (!sock_raw_)
+    return NotifyConnectionState(false);
+
+  if (!sock_raw_.Connect(socket_name))
+    return NotifyConnectionState(false);
+
+  // At this point either connect() succeeded or started asynchronously
+  // (errno = EINPROGRESS).
+  state_ = State::kConnecting;
+
+  // Even if the socket is non-blocking, connecting to a UNIX socket can be
+  // acknowledged straight away rather than returning EINPROGRESS.
+  // The decision here is to deal with the two cases uniformly, at the cost of
+  // delaying the straight-away-connect() case by one task, to avoid depending
+  // on implementation details of UNIX socket on the various OSes.
+  // Posting the OnEvent() below emulates a wakeup of the FD watch. OnEvent(),
+  // which knows how to deal with spurious wakeups, will poll the SO_ERROR and
+  // evolve, if necessary, the state into either kConnected or kDisconnected.
+  WeakPtr<UnixSocket> weak_ptr = weak_ptr_factory_.GetWeakPtr();
+  task_runner_->PostTask([weak_ptr] {
+    if (weak_ptr)
+      weak_ptr->OnEvent();
+  });
+}
+
+#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+void UnixSocket::ReadPeerCredentialsPosix() {
+  // Peer credentials are supported only on AF_UNIX sockets.
+  if (sock_raw_.family() != SockFamily::kUnix)
+    return;
+  PERFETTO_CHECK(peer_cred_mode_ != SockPeerCredMode::kIgnore);
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+  struct ucred user_cred;
+  socklen_t len = sizeof(user_cred);
+  int fd = sock_raw_.fd();
+  int res = getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &user_cred, &len);
+  PERFETTO_CHECK(res == 0);
+  peer_uid_ = user_cred.uid;
+  peer_pid_ = user_cred.pid;
+#elif PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+  struct xucred user_cred;
+  socklen_t len = sizeof(user_cred);
+  int res = getsockopt(sock_raw_.fd(), 0, LOCAL_PEERCRED, &user_cred, &len);
+  PERFETTO_CHECK(res == 0 && user_cred.cr_version == XUCRED_VERSION);
+  peer_uid_ = static_cast<uid_t>(user_cred.cr_uid);
+  // There is no pid in the LOCAL_PEERCREDS for MacOS / FreeBSD.
+#endif
+}
+#endif  // !OS_WIN
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+void UnixSocket::OnEvent() {
+  WSANETWORKEVENTS evts{};
+  PERFETTO_CHECK(WSAEnumNetworkEvents(sock_raw_.fd(), sock_raw_.watch_handle(),
+                                      &evts) == 0);
+  if (state_ == State::kDisconnected)
+    return;  // Some spurious event, typically queued just before Shutdown().
+
+  if (state_ == State::kConnecting && (evts.lNetworkEvents & FD_CONNECT)) {
+    PERFETTO_DCHECK(sock_raw_);
+    int err = evts.iErrorCode[FD_CONNECT_BIT];
+    if (err) {
+      PERFETTO_DPLOG("Connection error: %d", err);
+      Shutdown(false);
+      event_listener_->OnConnect(this, false /* connected */);
+      return;
+    }
+
+    // kReadOnConnect is not supported on Windows.
+    PERFETTO_DCHECK(peer_cred_mode_ != SockPeerCredMode::kReadOnConnect);
+    state_ = State::kConnected;
+    event_listener_->OnConnect(this, true /* connected */);
+  }
+
+  // This is deliberately NOT an else-if. When a client socket connects and
+  // there is already data queued, the following will happen within the same
+  // OnEvent() call:
+  // 1. The block above will transition kConnecting -> kConnected.
+  // 2. This block will cause an OnDataAvailable() call.
+  // Unlike UNIX, where poll() keeps signalling the event until the client
+  // does a recv(), Windows is more picky and stops signalling the event until
+  // the next call to recv() is made. In other words, in Windows we cannot
+  // miss an OnDataAvailable() call or the event pump will stop.
+  if (state_ == State::kConnected) {
+    if (evts.lNetworkEvents & FD_READ) {
+      event_listener_->OnDataAvailable(this);
+      // TODO(primiano): I am very conflicted here. Because of the behavior
+      // described above, if the event listener doesn't do a Recv() call in
+      // the OnDataAvailable() callback, WinSock won't notify the event ever
+      // again. On one side, I don't see any reason why a client should decide
+      // to not do a Recv() in OnDataAvailable. On the other side, the
+      // behavior here diverges from UNIX, where OnDataAvailable() would be
+      // re-posted immediately. In both cases, not doing a Recv() in
+      // OnDataAvailable, leads to something bad (getting stuck on Windows,
+      // getting in a hot loop on Linux), so doesn't feel we should worry too
+      // much about this. If we wanted to keep the behavrior consistent, here
+      // we should do something like: `if (sock_raw_)
+      // sock_raw_.SetBlocking(false)` (Note that the socket might be closed
+      // by the time we come back here, hence the if part).
+      return;
+    }
+    // Could read EOF and disconnect here.
+    if (evts.lNetworkEvents & FD_CLOSE) {
+      Shutdown(true);
+      return;
+    }
+  }
+
+  // New incoming connection.
+  if (state_ == State::kListening && (evts.lNetworkEvents & FD_ACCEPT)) {
+    // There could be more than one incoming connection behind each FD watch
+    // notification. Drain'em all.
+    for (;;) {
+      // Note: right now we don't need the remote endpoint, hence we pass
+      // nullptr to |addr| and |addrlen|. If we ever need to do so, be
+      // extremely careful. Windows' WinSock API will happily write more than
+      // |addrlen| (hence corrupt the stack) if the |addr| argument passed is
+      // not big enough (e.g. passing a struct sockaddr_in to a AF_UNIX
+      // socket, where sizeof(sockaddr_un) is >> sizef(sockaddr_in)). It seems
+      // a Windows / CRT bug in the AF_UNIX implementation.
+      ScopedSocketHandle new_fd(accept(sock_raw_.fd(), nullptr, nullptr));
+      if (!new_fd)
+        return;
+      std::unique_ptr<UnixSocket> new_sock(new UnixSocket(
+          event_listener_, task_runner_, std::move(new_fd), State::kConnected,
+          sock_raw_.family(), sock_raw_.type(), peer_cred_mode_));
+      event_listener_->OnNewIncomingConnection(this, std::move(new_sock));
+    }
+  }
+}
+#else
+void UnixSocket::OnEvent() {
+  if (state_ == State::kDisconnected)
+    return;  // Some spurious event, typically queued just before Shutdown().
+
+  if (state_ == State::kConnected)
+    return event_listener_->OnDataAvailable(this);
+
+  if (state_ == State::kConnecting) {
+    PERFETTO_DCHECK(sock_raw_);
+    int sock_err = EINVAL;
+    socklen_t err_len = sizeof(sock_err);
+    int res =
+        getsockopt(sock_raw_.fd(), SOL_SOCKET, SO_ERROR, &sock_err, &err_len);
+
+    if (res == 0 && sock_err == EINPROGRESS)
+      return;  // Not connected yet, just a spurious FD watch wakeup.
+    if (res == 0 && sock_err == 0) {
+      if (peer_cred_mode_ == SockPeerCredMode::kReadOnConnect)
+        ReadPeerCredentialsPosix();
+      state_ = State::kConnected;
+      return event_listener_->OnConnect(this, true /* connected */);
+    }
+    PERFETTO_DLOG("Connection error: %s", strerror(sock_err));
+    Shutdown(false);
+    return event_listener_->OnConnect(this, false /* connected */);
+  }
+
+  // New incoming connection.
+  if (state_ == State::kListening) {
+    // There could be more than one incoming connection behind each FD watch
+    // notification. Drain'em all.
+    for (;;) {
+      ScopedFile new_fd(
+          PERFETTO_EINTR(accept(sock_raw_.fd(), nullptr, nullptr)));
+      if (!new_fd)
+        return;
+      std::unique_ptr<UnixSocket> new_sock(new UnixSocket(
+          event_listener_, task_runner_, std::move(new_fd), State::kConnected,
+          sock_raw_.family(), sock_raw_.type(), peer_cred_mode_));
+      event_listener_->OnNewIncomingConnection(this, std::move(new_sock));
+    }
+  }
+}
+#endif
+
+bool UnixSocket::Send(const void* msg,
+                      size_t len,
+                      const int* send_fds,
+                      size_t num_fds) {
+  if (state_ != State::kConnected) {
+    errno = ENOTCONN;
+    return false;
+  }
+
+  sock_raw_.SetBlocking(true);
+  const ssize_t sz = sock_raw_.Send(msg, len, send_fds, num_fds);
+  sock_raw_.SetBlocking(false);
+
+  if (sz == static_cast<ssize_t>(len)) {
+    return true;
+  }
+
+  // If we ever decide to support non-blocking sends again, here we should
+  // watch for both EAGAIN and EWOULDBLOCK (see base::IsAgain()).
+
+  // If sendmsg() succeeds but the returned size is >= 0 and < |len| it means
+  // that the endpoint disconnected in the middle of the read, and we managed
+  // to send only a portion of the buffer.
+  // If sz < 0, either the other endpoint disconnected (ECONNRESET) or some
+  // other error happened. In both cases we should just give up.
+  PERFETTO_DPLOG("sendmsg() failed");
+  Shutdown(true);
+  return false;
+}
+
+void UnixSocket::Shutdown(bool notify) {
+  WeakPtr<UnixSocket> weak_ptr = weak_ptr_factory_.GetWeakPtr();
+  if (notify) {
+    if (state_ == State::kConnected) {
+      task_runner_->PostTask([weak_ptr] {
+        if (weak_ptr)
+          weak_ptr->event_listener_->OnDisconnect(weak_ptr.get());
+      });
+    } else if (state_ == State::kConnecting) {
+      task_runner_->PostTask([weak_ptr] {
+        if (weak_ptr)
+          weak_ptr->event_listener_->OnConnect(weak_ptr.get(), false);
+      });
+    }
+  }
+
+  if (sock_raw_) {
+    task_runner_->RemoveFileDescriptorWatch(sock_raw_.watch_handle());
+    sock_raw_.Shutdown();
+  }
+  state_ = State::kDisconnected;
+}
+
+size_t UnixSocket::Receive(void* msg,
+                           size_t len,
+                           ScopedFile* fd_vec,
+                           size_t max_files) {
+  if (state_ != State::kConnected)
+    return 0;
+
+  const ssize_t sz = sock_raw_.Receive(msg, len, fd_vec, max_files);
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  bool async_would_block = WSAGetLastError() == WSAEWOULDBLOCK;
+#else
+  bool async_would_block = IsAgain(errno);
+#endif
+  if (sz < 0 && async_would_block)
+    return 0;
+
+  if (sz <= 0) {
+    Shutdown(true);
+    return 0;
+  }
+  PERFETTO_CHECK(static_cast<size_t>(sz) <= len);
+  return static_cast<size_t>(sz);
+}
+
+std::string UnixSocket::ReceiveString(size_t max_length) {
+  std::unique_ptr<char[]> buf(new char[max_length + 1]);
+  size_t rsize = Receive(buf.get(), max_length);
+  PERFETTO_CHECK(rsize <= max_length);
+  buf[rsize] = '\0';
+  return std::string(buf.get());
+}
+
+void UnixSocket::NotifyConnectionState(bool success) {
+  if (!success)
+    Shutdown(false);
+
+  WeakPtr<UnixSocket> weak_ptr = weak_ptr_factory_.GetWeakPtr();
+  task_runner_->PostTask([weak_ptr, success] {
+    if (weak_ptr)
+      weak_ptr->event_listener_->OnConnect(weak_ptr.get(), success);
+  });
+}
+
+UnixSocket::EventListener::~EventListener() {}
+void UnixSocket::EventListener::OnNewIncomingConnection(
+    UnixSocket*,
+    std::unique_ptr<UnixSocket>) {}
+void UnixSocket::EventListener::OnConnect(UnixSocket*, bool) {}
+void UnixSocket::EventListener::OnDisconnect(UnixSocket*) {}
+void UnixSocket::EventListener::OnDataAvailable(UnixSocket*) {}
+
+}  // namespace base
+}  // namespace perfetto
+// gen_amalgamated begin source: src/ipc/buffered_frame_deserializer.cc
+// gen_amalgamated begin header: src/ipc/buffered_frame_deserializer.h
+// gen_amalgamated begin header: include/perfetto/ext/ipc/basic_types.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_IPC_BASIC_TYPES_H_
+#define INCLUDE_PERFETTO_EXT_IPC_BASIC_TYPES_H_
+
+#include <stddef.h>
+#include <stdint.h>
+#include <sys/types.h>
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+
+namespace perfetto {
+namespace ipc {
+
+using ProtoMessage = ::protozero::CppMessageObj;
+using ServiceID = uint32_t;
+using MethodID = uint32_t;
+using ClientID = uint64_t;
+using RequestID = uint64_t;
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+// AF_UNIX on Windows is supported only on Windows 10 from build 17063.
+// Also it doesn't bring major advantages compared to a TCP socket.
+// See go/perfetto-win .
+constexpr bool kUseTCPSocket = true;
+#else
+// On Android, Linux, Mac use a AF_UNIX socket.
+constexpr bool kUseTCPSocket = false;
+#endif
+
+// This determines the maximum size allowed for an IPC message. Trying to send
+// or receive a larger message will hit DCHECK(s) and auto-disconnect.
+constexpr size_t kIPCBufferSize = 128 * 1024;
+
+constexpr uid_t kInvalidUid = static_cast<uid_t>(-1);
+
+}  // namespace ipc
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_IPC_BASIC_TYPES_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SRC_IPC_BUFFERED_FRAME_DESERIALIZER_H_
+#define SRC_IPC_BUFFERED_FRAME_DESERIALIZER_H_
+
+#include <stddef.h>
+
+#include <list>
+#include <memory>
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/paged_memory.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/basic_types.h"
+
+namespace perfetto {
+
+namespace protos {
+namespace gen {
+class IPCFrame;
+}  // namespace gen
+}  // namespace protos
+
+namespace ipc {
+
+using Frame = ::perfetto::protos::gen::IPCFrame;
+
+// Deserializes incoming frames, taking care of buffering and tokenization.
+// Used by both host and client to decode incoming frames.
+//
+// Which problem does it solve?
+// ----------------------------
+// The wire protocol is as follows:
+// [32-bit frame size][proto-encoded Frame], e.g:
+// [06 00 00 00][00 11 22 33 44 55 66]
+// [02 00 00 00][AA BB]
+// [04 00 00 00][CC DD EE FF]
+// However, given that the socket works in SOCK_STREAM mode, the recv() calls
+// might see the following:
+// 06 00 00
+// 00 00 11 22 33 44 55
+// 66 02 00 00 00 ...
+// This class takes care of buffering efficiently the data received, without
+// making any assumption on how the incoming data will be chunked by the socket.
+// For instance, it is possible that a recv() doesn't produce any frame (because
+// it received only a part of the frame) or produces more than one frame.
+//
+// Usage
+// -----
+// Both host and client use this as follows:
+//
+// auto buf = rpc_frame_decoder.BeginReceive();
+// size_t rsize = socket.recv(buf.first, buf.second);
+// rpc_frame_decoder.EndReceive(rsize);
+// while (Frame frame = rpc_frame_decoder.PopNextFrame()) {
+//   ... process |frame|
+// }
+//
+// Design goals:
+// -------------
+// - Optimize for the realistic case of each recv() receiving one or more
+//   whole frames. In this case no memmove is performed.
+// - Guarantee that frames lay in a virtually contiguous memory area.
+//   This allows to use the protobuf-lite deserialization API (scattered
+//   deserialization is supported only by libprotobuf-full).
+// - Put a hard boundary to the size of the incoming buffer. This is to prevent
+//   that a malicious sends an abnormally large frame and OOMs us.
+// - Simplicity: just use a linear mmap region. No reallocations or scattering.
+//   Takes care of madvise()-ing unused memory.
+
+class BufferedFrameDeserializer {
+ public:
+  struct ReceiveBuffer {
+    char* data;
+    size_t size;
+  };
+
+  // |max_capacity| is overridable only for tests.
+  explicit BufferedFrameDeserializer(size_t max_capacity = kIPCBufferSize);
+  ~BufferedFrameDeserializer();
+
+  // This function doesn't really belong here as it does Serialization, unlike
+  // the rest of this class. However it is so small and has so many dependencies
+  // in common that doesn't justify having its own class.
+  static std::string Serialize(const Frame&);
+
+  // Returns a buffer that can be passed to recv(). The buffer is deliberately
+  // not initialized.
+  ReceiveBuffer BeginReceive();
+
+  // Must be called soon after BeginReceive().
+  // |recv_size| is the number of valid bytes that have been written into the
+  // buffer previously returned by BeginReceive() (the return value of recv()).
+  // Returns false if a header > |max_capacity| is received, in which case the
+  // caller is expected to shutdown the socket and terminate the ipc.
+  bool EndReceive(size_t recv_size) PERFETTO_WARN_UNUSED_RESULT;
+
+  // Decodes and returns the next decoded frame in the buffer if any, nullptr
+  // if no further frames have been decoded.
+  std::unique_ptr<Frame> PopNextFrame();
+
+  size_t capacity() const { return capacity_; }
+  size_t size() const { return size_; }
+
+ private:
+  BufferedFrameDeserializer(const BufferedFrameDeserializer&) = delete;
+  BufferedFrameDeserializer& operator=(const BufferedFrameDeserializer&) =
+      delete;
+
+  // If a valid frame is decoded it is added to |decoded_frames_|.
+  void DecodeFrame(const char*, size_t);
+
+  char* buf() { return reinterpret_cast<char*>(buf_.Get()); }
+
+  base::PagedMemory buf_;
+  const size_t capacity_ = 0;  // sizeof(|buf_|).
+
+  // THe number of bytes in |buf_| that contain valid data (as a result of
+  // EndReceive()). This is always <= |capacity_|.
+  size_t size_ = 0;
+
+  std::list<std::unique_ptr<Frame>> decoded_frames_;
+};
+
+}  // namespace ipc
+}  // namespace perfetto
+
+#endif  // SRC_IPC_BUFFERED_FRAME_DESERIALIZER_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "src/ipc/buffered_frame_deserializer.h"
+
+#include <inttypes.h>
+
+#include <algorithm>
+#include <type_traits>
+#include <utility>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+
+// gen_amalgamated expanded: #include "protos/perfetto/ipc/wire_protocol.gen.h"
+
+namespace perfetto {
+namespace ipc {
+
+namespace {
+
+// The header is just the number of bytes of the Frame protobuf message.
+constexpr size_t kHeaderSize = sizeof(uint32_t);
+}  // namespace
+
+BufferedFrameDeserializer::BufferedFrameDeserializer(size_t max_capacity)
+    : capacity_(max_capacity) {
+  PERFETTO_CHECK(max_capacity % base::GetSysPageSize() == 0);
+  PERFETTO_CHECK(max_capacity >= base::GetSysPageSize());
+}
+
+BufferedFrameDeserializer::~BufferedFrameDeserializer() = default;
+
+BufferedFrameDeserializer::ReceiveBuffer
+BufferedFrameDeserializer::BeginReceive() {
+  // Upon the first recv initialize the buffer to the max message size but
+  // release the physical memory for all but the first page. The kernel will
+  // automatically give us physical pages back as soon as we page-fault on them.
+  if (!buf_.IsValid()) {
+    PERFETTO_DCHECK(size_ == 0);
+    // TODO(eseckler): Don't commit all of the buffer at once on Windows.
+    buf_ = base::PagedMemory::Allocate(capacity_);
+
+    // Surely we are going to use at least the first page, but we may not need
+    // the rest for a bit.
+    const auto page_size = base::GetSysPageSize();
+    buf_.AdviseDontNeed(buf() + page_size, capacity_ - page_size);
+  }
+
+  PERFETTO_CHECK(capacity_ > size_);
+  return ReceiveBuffer{buf() + size_, capacity_ - size_};
+}
+
+bool BufferedFrameDeserializer::EndReceive(size_t recv_size) {
+  const auto page_size = base::GetSysPageSize();
+  PERFETTO_CHECK(recv_size + size_ <= capacity_);
+  size_ += recv_size;
+
+  // At this point the contents buf_ can contain:
+  // A) Only a fragment of the header (the size of the frame). E.g.,
+  //    03 00 00 (the header is 4 bytes, one is missing).
+  //
+  // B) A header and a part of the frame. E.g.,
+  //     05 00 00 00         11 22 33
+  //    [ header, size=5 ]  [ Partial frame ]
+  //
+  // C) One or more complete header+frame. E.g.,
+  //     05 00 00 00         11 22 33 44 55   03 00 00 00        AA BB CC
+  //    [ header, size=5 ]  [ Whole frame ]  [ header, size=3 ] [ Whole frame ]
+  //
+  // D) Some complete header+frame(s) and a partial header or frame (C + A/B).
+  //
+  // C Is the more likely case and the one we are optimizing for. A, B, D can
+  // happen because of the streaming nature of the socket.
+  // The invariant of this function is that, when it returns, buf_ is either
+  // empty (we drained all the complete frames) or starts with the header of the
+  // next, still incomplete, frame.
+
+  size_t consumed_size = 0;
+  for (;;) {
+    if (size_ < consumed_size + kHeaderSize)
+      break;  // Case A, not enough data to read even the header.
+
+    // Read the header into |payload_size|.
+    uint32_t payload_size = 0;
+    const char* rd_ptr = buf() + consumed_size;
+    memcpy(base::AssumeLittleEndian(&payload_size), rd_ptr, kHeaderSize);
+
+    // Saturate the |payload_size| to prevent overflows. The > capacity_ check
+    // below will abort the parsing.
+    size_t next_frame_size =
+        std::min(static_cast<size_t>(payload_size), capacity_);
+    next_frame_size += kHeaderSize;
+    rd_ptr += kHeaderSize;
+
+    if (size_ < consumed_size + next_frame_size) {
+      // Case B. We got the header but not the whole frame.
+      if (next_frame_size > capacity_) {
+        // The caller is expected to shut down the socket and give up at this
+        // point. If it doesn't do that and insists going on at some point it
+        // will hit the capacity check in BeginReceive().
+        PERFETTO_LOG("IPC Frame too large (size %zu)", next_frame_size);
+        return false;
+      }
+      break;
+    }
+
+    // Case C. We got at least one header and whole frame.
+    DecodeFrame(rd_ptr, payload_size);
+    consumed_size += next_frame_size;
+  }
+
+  PERFETTO_DCHECK(consumed_size <= size_);
+  if (consumed_size > 0) {
+    // Shift out the consumed data from the buffer. In the typical case (C)
+    // there is nothing to shift really, just setting size_ = 0 is enough.
+    // Shifting is only for the (unlikely) case D.
+    size_ -= consumed_size;
+    if (size_ > 0) {
+      // Case D. We consumed some frames but there is a leftover at the end of
+      // the buffer. Shift out the consumed bytes, so that on the next round
+      // |buf_| starts with the header of the next unconsumed frame.
+      const char* move_begin = buf() + consumed_size;
+      PERFETTO_CHECK(move_begin > buf());
+      PERFETTO_CHECK(move_begin + size_ <= buf() + capacity_);
+      memmove(buf(), move_begin, size_);
+    }
+    // If we just finished decoding a large frame that used more than one page,
+    // release the extra memory in the buffer. Large frames should be quite
+    // rare.
+    if (consumed_size > page_size) {
+      size_t size_rounded_up = (size_ / page_size + 1) * page_size;
+      if (size_rounded_up < capacity_) {
+        char* madvise_begin = buf() + size_rounded_up;
+        const size_t madvise_size = capacity_ - size_rounded_up;
+        PERFETTO_CHECK(madvise_begin > buf() + size_);
+        PERFETTO_CHECK(madvise_begin + madvise_size <= buf() + capacity_);
+        buf_.AdviseDontNeed(madvise_begin, madvise_size);
+      }
+    }
+  }
+  // At this point |size_| == 0 for case C, > 0 for cases A, B, D.
+  return true;
+}
+
+std::unique_ptr<Frame> BufferedFrameDeserializer::PopNextFrame() {
+  if (decoded_frames_.empty())
+    return nullptr;
+  std::unique_ptr<Frame> frame = std::move(decoded_frames_.front());
+  decoded_frames_.pop_front();
+  return frame;
+}
+
+void BufferedFrameDeserializer::DecodeFrame(const char* data, size_t size) {
+  if (size == 0)
+    return;
+  std::unique_ptr<Frame> frame(new Frame);
+  if (frame->ParseFromArray(data, size))
+    decoded_frames_.push_back(std::move(frame));
+}
+
+// static
+std::string BufferedFrameDeserializer::Serialize(const Frame& frame) {
+  std::vector<uint8_t> payload = frame.SerializeAsArray();
+  const uint32_t payload_size = static_cast<uint32_t>(payload.size());
+  std::string buf;
+  buf.resize(kHeaderSize + payload_size);
+  memcpy(&buf[0], base::AssumeLittleEndian(&payload_size), kHeaderSize);
+  memcpy(&buf[kHeaderSize], payload.data(), payload.size());
+  return buf;
+}
+
+}  // namespace ipc
+}  // namespace perfetto
+// gen_amalgamated begin source: src/ipc/deferred.cc
+// gen_amalgamated begin header: include/perfetto/ext/ipc/deferred.h
+// gen_amalgamated begin header: include/perfetto/ext/ipc/async_result.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_IPC_ASYNC_RESULT_H_
+#define INCLUDE_PERFETTO_EXT_IPC_ASYNC_RESULT_H_
+
+#include <memory>
+#include <type_traits>
+#include <utility>
+
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/basic_types.h"
+
+namespace perfetto {
+namespace ipc {
+
+// Wraps the result of an asynchronous invocation. This is the equivalent of a
+// std::pair<unique_ptr<T>, bool> with syntactic sugar. It is used as callback
+// argument by Deferred<T>. T is a ProtoMessage subclass (i.e. generated .pb.h).
+template <typename T>
+class AsyncResult {
+ public:
+  static AsyncResult Create() {
+    return AsyncResult(std::unique_ptr<T>(new T()));
+  }
+
+  AsyncResult(std::unique_ptr<T> msg = nullptr,
+              bool has_more = false,
+              int fd = -1)
+      : msg_(std::move(msg)), has_more_(has_more), fd_(fd) {
+    static_assert(std::is_base_of<ProtoMessage, T>::value, "T->ProtoMessage");
+  }
+  AsyncResult(AsyncResult&&) noexcept = default;
+  AsyncResult& operator=(AsyncResult&&) = default;
+
+  bool success() const { return !!msg_; }
+  explicit operator bool() const { return success(); }
+
+  bool has_more() const { return has_more_; }
+  void set_has_more(bool has_more) { has_more_ = has_more; }
+
+  void set_msg(std::unique_ptr<T> msg) { msg_ = std::move(msg); }
+  T* release_msg() { return msg_.release(); }
+  T* operator->() { return msg_.get(); }
+  T& operator*() { return *msg_; }
+
+  void set_fd(int fd) { fd_ = fd; }
+  int fd() const { return fd_; }
+
+ private:
+  std::unique_ptr<T> msg_;
+  bool has_more_ = false;
+
+  // Optional. Only for messages that convey a file descriptor, for sharing
+  // memory across processes.
+  int fd_ = -1;
+};
+
+}  // namespace ipc
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_IPC_ASYNC_RESULT_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_IPC_DEFERRED_H_
+#define INCLUDE_PERFETTO_EXT_IPC_DEFERRED_H_
+
+#include <functional>
+#include <memory>
+#include <utility>
+
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/async_result.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/basic_types.h"
+
+namespace perfetto {
+namespace ipc {
+
+// This class is a wrapper for a callback handling async results.
+// The problem this is solving is the following: For each result argument of the
+// methods generated from the .proto file:
+// - The client wants to see something on which it can Bind() a callback, which
+//   is invoked asynchronously once reply is received from the host.
+// - The host wants to expose something to user code that implements the IPC
+//   methods to allow them to provide an asynchronous reply back to the client.
+//   Eventually even more than once, for the case streaming replies.
+//
+// In both cases we want to make sure that callbacks don't get lost along the
+// way. To address this, this class will automatically reject the callbacks
+// if they are not resolved at destructor time (or the object is std::move()'d).
+//
+// The client is supposed to use this class as follows:
+//   class GreeterProxy {
+//      void SayHello(const HelloRequest&, Deferred<HelloReply> reply)
+//   }
+//  ...
+//  Deferred<HelloReply> reply;
+//  reply.Bind([] (AsyncResult<HelloReply> reply) {
+//    std::cout << reply.success() ? reply->message : "failure";
+//  });
+//  host_proxy_instance.SayHello(req, std::move(reply));
+//
+// The host instead is supposed to use this as follows:
+//   class GreeterImpl : public Greeter {
+//     void SayHello(const HelloRequest& req, Deferred<HelloReply> reply) {
+//        AsyncResult<HelloReply> reply = AsyncResult<HelloReply>::Create();
+//        reply->set_greeting("Hello " + req.name)
+//        reply.Resolve(std::move(reply));
+//     }
+//   }
+// Or for more complex cases, the deferred object can be std::move()'d outside
+// and the reply can continue asynchronously later.
+
+template <typename T>
+class Deferred;
+
+class DeferredBase {
+ public:
+  explicit DeferredBase(
+      std::function<void(AsyncResult<ProtoMessage>)> callback = nullptr);
+
+  template <typename T>
+  explicit DeferredBase(Deferred<T> other)
+      : callback_(std::move(other.callback_)) {}
+
+  ~DeferredBase();
+  DeferredBase(DeferredBase&&) noexcept;
+  DeferredBase& operator=(DeferredBase&&);
+  void Bind(std::function<void(AsyncResult<ProtoMessage>)> callback);
+  bool IsBound() const;
+  void Resolve(AsyncResult<ProtoMessage>);
+  void Reject();
+
+ protected:
+  template <typename T>
+  friend class Deferred;
+  void Move(DeferredBase&);
+
+  std::function<void(AsyncResult<ProtoMessage>)> callback_;
+};
+
+template <typename T>  // T : ProtoMessage subclass
+class Deferred : public DeferredBase {
+ public:
+  explicit Deferred(std::function<void(AsyncResult<T>)> callback = nullptr) {
+    Bind(std::move(callback));
+  }
+
+  // This move constructor (and the similar one in DeferredBase) is meant to be
+  // called only by the autogenerated code. The caller has to guarantee that the
+  // moved-from and moved-to types match. The behavior is otherwise undefined.
+  explicit Deferred(DeferredBase&& other) {
+    callback_ = std::move(other.callback_);
+    other.callback_ = nullptr;
+  }
+
+  void Bind(std::function<void(AsyncResult<T>)> callback) {
+    if (!callback)
+      return;
+
+    // Here we need a callback adapter to downcast the callback to a generic
+    // callback that takes an AsyncResult<ProtoMessage>, so that it can be
+    // stored in the base class |callback_|.
+    auto callback_adapter = [callback](
+                                AsyncResult<ProtoMessage> async_result_base) {
+      // Upcast the async_result from <ProtoMessage> -> <T : ProtoMessage>.
+      static_assert(std::is_base_of<ProtoMessage, T>::value, "T:ProtoMessage");
+      AsyncResult<T> async_result(
+          std::unique_ptr<T>(static_cast<T*>(async_result_base.release_msg())),
+          async_result_base.has_more(), async_result_base.fd());
+      callback(std::move(async_result));
+    };
+    DeferredBase::Bind(callback_adapter);
+  }
+
+  // If no more messages are expected, |callback_| is released.
+  void Resolve(AsyncResult<T> async_result) {
+    // Convert the |async_result| to the generic base one (T -> ProtoMessage).
+    AsyncResult<ProtoMessage> async_result_base(
+        std::unique_ptr<ProtoMessage>(async_result.release_msg()),
+        async_result.has_more(), async_result.fd());
+    DeferredBase::Resolve(std::move(async_result_base));
+  }
+};
+
+}  // namespace ipc
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_IPC_DEFERRED_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/deferred.h"
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+
+namespace perfetto {
+namespace ipc {
+
+DeferredBase::DeferredBase(
+    std::function<void(AsyncResult<ProtoMessage>)> callback)
+    : callback_(std::move(callback)) {}
+
+DeferredBase::~DeferredBase() {
+  if (callback_)
+    Reject();
+}
+
+// Can't just use "= default" here because the default move operator for
+// std::function doesn't necessarily swap and hence can leave a copy of the
+// bind state around, which is undesirable.
+DeferredBase::DeferredBase(DeferredBase&& other) noexcept {
+  Move(other);
+}
+
+DeferredBase& DeferredBase::operator=(DeferredBase&& other) {
+  if (callback_)
+    Reject();
+  Move(other);
+  return *this;
+}
+
+void DeferredBase::Move(DeferredBase& other) {
+  callback_ = std::move(other.callback_);
+  other.callback_ = nullptr;
+}
+
+void DeferredBase::Bind(
+    std::function<void(AsyncResult<ProtoMessage>)> callback) {
+  callback_ = std::move(callback);
+}
+
+bool DeferredBase::IsBound() const {
+  return !!callback_;
+}
+
+void DeferredBase::Resolve(AsyncResult<ProtoMessage> async_result) {
+  if (!callback_) {
+    PERFETTO_DFATAL("No callback set.");
+    return;
+  }
+  bool has_more = async_result.has_more();
+  callback_(std::move(async_result));
+  if (!has_more)
+    callback_ = nullptr;
+}
+
+// Resolves with a nullptr |msg_|, signalling failure to |callback_|.
+void DeferredBase::Reject() {
+  Resolve(AsyncResult<ProtoMessage>());
+}
+
+}  // namespace ipc
+}  // namespace perfetto
+// gen_amalgamated begin source: src/ipc/virtual_destructors.cc
+// gen_amalgamated begin header: include/perfetto/ext/ipc/client.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_IPC_CLIENT_H_
+#define INCLUDE_PERFETTO_EXT_IPC_CLIENT_H_
+
+#include <functional>
+#include <memory>
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/scoped_file.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/unix_socket.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/weak_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/basic_types.h"
+
+namespace perfetto {
+
+namespace base {
+class TaskRunner;
+}  // namespace base
+
+namespace ipc {
+class ServiceProxy;
+
+// The client-side class that talks to the host over the socket and multiplexes
+// requests coming from the various autogenerated ServiceProxy stubs.
+// This is meant to be used by the user code as follows:
+// auto client = Client::CreateInstance("socket_name", task_runner);
+// std::unique_ptr<GreeterService> svc(new GreeterService());
+// client.BindService(svc);
+// svc.OnConnect([] () {
+//    svc.SayHello(..., ...);
+// });
+class Client {
+ public:
+  // struct ConnArgs is used for creating a client in 2 connection modes:
+  // 1. Connect using a socket name with the option to retry the connection on
+  //    connection failure.
+  // 2. Adopt a connected socket.
+  struct ConnArgs {
+    ConnArgs(const char* sock_name, bool sock_retry)
+        : socket_name(sock_name), retry(sock_retry) {}
+    explicit ConnArgs(base::ScopedSocketHandle sock_fd)
+        : socket_fd(std::move(sock_fd)) {}
+
+    // Disallow copy. Only supports move.
+    ConnArgs(const ConnArgs& other) = delete;
+    ConnArgs(ConnArgs&& other) = default;
+
+    base::ScopedSocketHandle socket_fd;
+    const char* socket_name = nullptr;
+    bool retry = false;  // Only for connecting with |socket_name|.
+  };
+
+  static std::unique_ptr<Client> CreateInstance(ConnArgs, base::TaskRunner*);
+  virtual ~Client();
+
+  virtual void BindService(base::WeakPtr<ServiceProxy>) = 0;
+
+  // There is no need to call this method explicitly. Destroying the
+  // ServiceProxy instance is sufficient and will automatically unbind it. This
+  // method is exposed only for the ServiceProxy destructor.
+  virtual void UnbindService(ServiceID) = 0;
+
+  // Returns (with move semantics) the last file descriptor received on the IPC
+  // channel. No buffering is performed: if a service sends two file descriptors
+  // and the caller doesn't read them immediately, the first one will be
+  // automatically closed when the second is received (and will hit a DCHECK in
+  // debug builds).
+  virtual base::ScopedFile TakeReceivedFD() = 0;
+};
+
+}  // namespace ipc
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_IPC_CLIENT_H_
+// gen_amalgamated begin header: include/perfetto/ext/ipc/host.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_IPC_HOST_H_
+#define INCLUDE_PERFETTO_EXT_IPC_HOST_H_
+
+#include <memory>
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/scoped_file.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/unix_socket.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/basic_types.h"
+
+namespace perfetto {
+
+namespace base {
+class TaskRunner;
+}  // namespace base
+
+namespace ipc {
+
+class Service;
+
+// The host-side of the IPC layer. This class acts as a registry and request
+// dispatcher. It listen on the UnixSocket |socket_name| for incoming requests
+// (coming Client instances) and dispatches their requests to the various
+// Services exposed.
+class Host {
+ public:
+  // Creates an instance and starts listening on the given |socket_name|.
+  // Returns nullptr if listening on the socket fails.
+  static std::unique_ptr<Host> CreateInstance(const char* socket_name,
+                                              base::TaskRunner*);
+
+  // Like the above but takes a file descriptor to a pre-bound unix socket.
+  // Returns nullptr if listening on the socket fails.
+  static std::unique_ptr<Host> CreateInstance(base::ScopedSocketHandle,
+                                              base::TaskRunner*);
+
+  virtual ~Host();
+
+  // Registers a new service and makes it available to remote IPC peers.
+  // All the exposed Service instances will be destroyed when destroying the
+  // Host instance if ExposeService succeeds and returns true, or immediately
+  // after the call in case of failure.
+  // Returns true if the register has been successfully registered, false in
+  // case of errors (e.g., another service with the same name is already
+  // registered).
+  virtual bool ExposeService(std::unique_ptr<Service>) = 0;
+};
+
+}  // namespace ipc
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_IPC_HOST_H_
+// gen_amalgamated begin header: include/perfetto/ext/ipc/service.h
+// gen_amalgamated begin header: include/perfetto/ext/ipc/client_info.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_IPC_CLIENT_INFO_H_
+#define INCLUDE_PERFETTO_EXT_IPC_CLIENT_INFO_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/basic_types.h"
+
+namespace perfetto {
+namespace ipc {
+
+// Passed to Service(s) to identify remote clients.
+class ClientInfo {
+ public:
+  ClientInfo() = default;
+  ClientInfo(ClientID client_id, uid_t uid)
+      : client_id_(client_id), uid_(uid) {}
+
+  bool operator==(const ClientInfo& other) const {
+    return (client_id_ == other.client_id_ && uid_ == other.uid_);
+  }
+  bool operator!=(const ClientInfo& other) const { return !(*this == other); }
+
+  // For map<> and other sorted containers.
+  bool operator<(const ClientInfo& other) const {
+    PERFETTO_DCHECK(client_id_ != other.client_id_ || *this == other);
+    return client_id_ < other.client_id_;
+  }
+
+  bool is_valid() const { return client_id_ != 0; }
+
+  // A monotonic counter.
+  ClientID client_id() const { return client_id_; }
+
+  // Posix User ID. Comes from the kernel, can be trusted.
+  uid_t uid() const { return uid_; }
+
+ private:
+  ClientID client_id_ = 0;
+  uid_t uid_ = kInvalidUid;
+};
+
+}  // namespace ipc
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_IPC_CLIENT_INFO_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_IPC_SERVICE_H_
+#define INCLUDE_PERFETTO_EXT_IPC_SERVICE_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/scoped_file.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/client_info.h"
+
+namespace perfetto {
+namespace ipc {
+
+class ServiceDescriptor;
+
+// The base class for all the autogenerated host-side service interfaces.
+class Service {
+ public:
+  virtual ~Service();
+
+  // Overridden by the auto-generated class. Provides the list of methods and
+  // the protobuf (de)serialization functions for their arguments.
+  virtual const ServiceDescriptor& GetDescriptor() = 0;
+
+  // Invoked when a remote client disconnects. Use client_info() to obtain
+  // details about the client that disconnected.
+  virtual void OnClientDisconnected() {}
+
+  // Returns the ClientInfo for the current IPC request. Returns an invalid
+  // ClientInfo if called outside the scope of an IPC method.
+  const ClientInfo& client_info() {
+    PERFETTO_DCHECK(client_info_.is_valid());
+    return client_info_;
+  }
+
+  base::ScopedFile TakeReceivedFD() {
+    if (received_fd_)
+      return std::move(*received_fd_);
+    return base::ScopedFile();
+  }
+
+ private:
+  friend class HostImpl;
+  ClientInfo client_info_;
+  // This is a pointer because the received fd needs to remain owned by the
+  // ClientConnection, as we will provide it to all method invocations
+  // for that client until one of them calls Service::TakeReceivedFD.
+  //
+  // Different clients might have sent different FDs so this cannot be owned
+  // here.
+  //
+  // Note that this means that there can always only be one outstanding
+  // invocation per client that supplies an FD and the client needs to
+  // wait for this one to return before calling another one.
+  base::ScopedFile* received_fd_;
+};
+
+}  // namespace ipc
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_IPC_SERVICE_H_
+// gen_amalgamated begin header: include/perfetto/ext/ipc/service_proxy.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_IPC_SERVICE_PROXY_H_
+#define INCLUDE_PERFETTO_EXT_IPC_SERVICE_PROXY_H_
+
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/basic_types.h"
+
+#include <assert.h>
+
+#include <functional>
+#include <map>
+#include <memory>
+#include <string>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/weak_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/deferred.h"
+
+namespace perfetto {
+namespace ipc {
+
+class Client;
+class ServiceDescriptor;
+
+// The base class for the client-side autogenerated stubs that forward method
+// invocations to the host. All the methods of this class are meant to be called
+// only by the autogenerated code.
+class PERFETTO_EXPORT ServiceProxy {
+ public:
+  class EventListener {
+   public:
+    virtual ~EventListener();
+
+    // Called once after Client::BindService() if the ServiceProxy has been
+    // successfully bound to the host. It is possible to start sending IPC
+    // requests soon after this.
+    virtual void OnConnect() {}
+
+    // Called if the connection fails to be established or drops after having
+    // been established.
+    virtual void OnDisconnect() {}
+  };
+
+  // Guarantees that no callback will happen after this object has been
+  // destroyed. The caller has to guarantee that the |event_listener| stays
+  // alive at least as long as the ServiceProxy instance.
+  explicit ServiceProxy(EventListener*);
+  virtual ~ServiceProxy();
+
+  void InitializeBinding(base::WeakPtr<Client>,
+                         ServiceID,
+                         std::map<std::string, MethodID>);
+
+  // Called by the IPC methods in the autogenerated classes.
+  void BeginInvoke(const std::string& method_name,
+                   const ProtoMessage& request,
+                   DeferredBase reply,
+                   int fd = -1);
+
+  // Called by ClientImpl.
+  // |reply_args| == nullptr means request failure.
+  void EndInvoke(RequestID,
+                 std::unique_ptr<ProtoMessage> reply_arg,
+                 bool has_more);
+
+  // Called by ClientImpl.
+  void OnConnect(bool success);
+  void OnDisconnect();
+  bool connected() const { return service_id_ != 0; }
+
+  base::WeakPtr<ServiceProxy> GetWeakPtr() const;
+
+  // Implemented by the autogenerated class.
+  virtual const ServiceDescriptor& GetDescriptor() = 0;
+
+ private:
+  base::WeakPtr<Client> client_;
+  ServiceID service_id_ = 0;
+  std::map<std::string, MethodID> remote_method_ids_;
+  std::map<RequestID, DeferredBase> pending_callbacks_;
+  EventListener* const event_listener_;
+  base::WeakPtrFactory<ServiceProxy> weak_ptr_factory_;  // Keep last.
+};
+
+}  // namespace ipc
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_IPC_SERVICE_PROXY_H_
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/client.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/host.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/service.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/service_proxy.h"
+
+// This translation unit contains the definitions for the destructor of pure
+// virtual interfaces for the current build target. The alternative would be
+// introducing a one-liner .cc file for each pure virtual interface, which is
+// overkill. This is for compliance with -Wweak-vtables.
+
+namespace perfetto {
+namespace ipc {
+
+Client::~Client() = default;
+Host::~Host() = default;
+Service::~Service() = default;
+ServiceProxy::EventListener::~EventListener() = default;
+
+}  // namespace ipc
+}  // namespace perfetto
+// gen_amalgamated begin source: src/ipc/client_impl.cc
+// gen_amalgamated begin header: src/ipc/client_impl.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SRC_IPC_CLIENT_IMPL_H_
+#define SRC_IPC_CLIENT_IMPL_H_
+
+#include <list>
+#include <map>
+#include <memory>
+
+// gen_amalgamated expanded: #include "perfetto/base/task_runner.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/scoped_file.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/unix_socket.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/client.h"
+// gen_amalgamated expanded: #include "src/ipc/buffered_frame_deserializer.h"
+
+namespace perfetto {
+
+namespace protos {
+namespace gen {
+class IPCFrame_BindServiceReply;
+class IPCFrame_InvokeMethodReply;
+}  // namespace gen
+}  // namespace protos
+
+namespace base {
+class TaskRunner;
+}  // namespace base
+
+namespace ipc {
+
+class ServiceDescriptor;
+
+class ClientImpl : public Client, public base::UnixSocket::EventListener {
+ public:
+  ClientImpl(ConnArgs, base::TaskRunner*);
+  ~ClientImpl() override;
+
+  // Client implementation.
+  void BindService(base::WeakPtr<ServiceProxy>) override;
+  void UnbindService(ServiceID) override;
+  base::ScopedFile TakeReceivedFD() override;
+
+  // base::UnixSocket::EventListener implementation.
+  void OnConnect(base::UnixSocket*, bool connected) override;
+  void OnDisconnect(base::UnixSocket*) override;
+  void OnDataAvailable(base::UnixSocket*) override;
+
+  RequestID BeginInvoke(ServiceID,
+                        const std::string& method_name,
+                        MethodID remote_method_id,
+                        const ProtoMessage& method_args,
+                        bool drop_reply,
+                        base::WeakPtr<ServiceProxy>,
+                        int fd = -1);
+
+  base::UnixSocket* GetUnixSocketForTesting() { return sock_.get(); }
+
+ private:
+  struct QueuedRequest {
+    QueuedRequest();
+    int type = 0;  // From Frame::msg_case(), see wire_protocol.proto.
+    RequestID request_id = 0;
+    base::WeakPtr<ServiceProxy> service_proxy;
+
+    // Only for type == kMsgInvokeMethod.
+    std::string method_name;
+  };
+
+  ClientImpl(const ClientImpl&) = delete;
+  ClientImpl& operator=(const ClientImpl&) = delete;
+
+  void TryConnect();
+  bool SendFrame(const Frame&, int fd = -1);
+  void OnFrameReceived(const Frame&);
+  void OnBindServiceReply(QueuedRequest,
+                          const protos::gen::IPCFrame_BindServiceReply&);
+  void OnInvokeMethodReply(QueuedRequest,
+                           const protos::gen::IPCFrame_InvokeMethodReply&);
+
+  bool invoking_method_reply_ = false;
+  const char* socket_name_ = nullptr;
+  bool socket_retry_ = false;
+  uint32_t socket_backoff_ms_ = 0;
+  std::unique_ptr<base::UnixSocket> sock_;
+  base::TaskRunner* const task_runner_;
+  RequestID last_request_id_ = 0;
+  BufferedFrameDeserializer frame_deserializer_;
+  base::ScopedFile received_fd_;
+  std::map<RequestID, QueuedRequest> queued_requests_;
+  std::map<ServiceID, base::WeakPtr<ServiceProxy>> service_bindings_;
+
+  // Queue of calls to BindService() that happened before the socket connected.
+  std::list<base::WeakPtr<ServiceProxy>> queued_bindings_;
+
+  base::WeakPtrFactory<Client> weak_ptr_factory_;  // Keep last.
+};
+
+}  // namespace ipc
+}  // namespace perfetto
+
+#endif  // SRC_IPC_CLIENT_IMPL_H_
+// gen_amalgamated begin header: include/perfetto/ext/ipc/service_descriptor.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_IPC_SERVICE_DESCRIPTOR_H_
+#define INCLUDE_PERFETTO_EXT_IPC_SERVICE_DESCRIPTOR_H_
+
+#include <functional>
+#include <string>
+#include <utility>
+#include <vector>
+
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/basic_types.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/deferred.h"
+
+namespace perfetto {
+namespace ipc {
+
+class Service;
+
+// This is a pure data structure which holds factory methods and strings for the
+// services and their methods that get generated in the .h/.cc files.
+// Each autogenerated class has a GetDescriptor() method that returns one
+// instance of these and allows both client and hosts to map service and method
+// names to IDs and provide function pointers to the protobuf decoder fuctions.
+class ServiceDescriptor {
+ public:
+  struct Method {
+    const char* name;
+
+    // DecoderFunc is pointer to a function that takes a string in input
+    // containing protobuf encoded data and returns a decoded protobuf message.
+    using DecoderFunc = std::unique_ptr<ProtoMessage> (*)(const std::string&);
+
+    // Function pointer to decode the request argument of the method.
+    DecoderFunc request_proto_decoder;
+
+    // Function pointer to decoded the reply argument of the method.
+    DecoderFunc reply_proto_decoder;
+
+    // Function pointer that dispatches the generic request to the corresponding
+    // method implementation.
+    using InvokerFunc = void (*)(Service*,
+                                 const ProtoMessage& /* request_args */,
+                                 DeferredBase /* deferred_reply */);
+    InvokerFunc invoker;
+  };
+
+  const char* service_name = nullptr;
+
+  // Note that methods order is not stable. Client and Host might have different
+  // method indexes, depending on their versions. The Client can't just rely
+  // on the indexes and has to keep a [string -> remote index] translation map.
+  std::vector<Method> methods;
+};
+
+}  // namespace ipc
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_IPC_SERVICE_DESCRIPTOR_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "src/ipc/client_impl.h"
+
+#include <fcntl.h>
+#include <inttypes.h>
+
+#include <utility>
+
+// gen_amalgamated expanded: #include "perfetto/base/task_runner.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/unix_socket.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/service_descriptor.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/service_proxy.h"
+
+// gen_amalgamated expanded: #include "protos/perfetto/ipc/wire_protocol.gen.h"
+
+// TODO(primiano): Add ThreadChecker everywhere.
+
+// TODO(primiano): Add timeouts.
+
+namespace perfetto {
+namespace ipc {
+
+namespace {
+constexpr base::SockFamily kClientSockFamily =
+    kUseTCPSocket ? base::SockFamily::kInet : base::SockFamily::kUnix;
+}  // namespace
+
+// static
+std::unique_ptr<Client> Client::CreateInstance(ConnArgs conn_args,
+                                               base::TaskRunner* task_runner) {
+  std::unique_ptr<Client> client(
+      new ClientImpl(std::move(conn_args), task_runner));
+  return client;
+}
+
+ClientImpl::ClientImpl(ConnArgs conn_args, base::TaskRunner* task_runner)
+    : socket_name_(conn_args.socket_name),
+      socket_retry_(conn_args.retry),
+      task_runner_(task_runner),
+      weak_ptr_factory_(this) {
+  if (conn_args.socket_fd) {
+    // Create the client using a connected socket. This code path will never hit
+    // OnConnect().
+    sock_ = base::UnixSocket::AdoptConnected(
+        std::move(conn_args.socket_fd), this, task_runner_, kClientSockFamily,
+        base::SockType::kStream, base::SockPeerCredMode::kIgnore);
+  } else {
+    // Connect using the socket name.
+    TryConnect();
+  }
+}
+
+ClientImpl::~ClientImpl() {
+  // Ensure we are not destroyed in the middle of invoking a reply.
+  PERFETTO_DCHECK(!invoking_method_reply_);
+  OnDisconnect(
+      nullptr);  // The base::UnixSocket* ptr is not used in OnDisconnect().
+}
+
+void ClientImpl::TryConnect() {
+  PERFETTO_DCHECK(socket_name_);
+  sock_ = base::UnixSocket::Connect(socket_name_, this, task_runner_,
+                                    kClientSockFamily, base::SockType::kStream,
+                                    base::SockPeerCredMode::kIgnore);
+}
+
+void ClientImpl::BindService(base::WeakPtr<ServiceProxy> service_proxy) {
+  if (!service_proxy)
+    return;
+  if (!sock_->is_connected()) {
+    queued_bindings_.emplace_back(service_proxy);
+    return;
+  }
+  RequestID request_id = ++last_request_id_;
+  Frame frame;
+  frame.set_request_id(request_id);
+  Frame::BindService* req = frame.mutable_msg_bind_service();
+  const char* const service_name = service_proxy->GetDescriptor().service_name;
+  req->set_service_name(service_name);
+  if (!SendFrame(frame)) {
+    PERFETTO_DLOG("BindService(%s) failed", service_name);
+    return service_proxy->OnConnect(false /* success */);
+  }
+  QueuedRequest qr;
+  qr.type = Frame::kMsgBindServiceFieldNumber;
+  qr.request_id = request_id;
+  qr.service_proxy = service_proxy;
+  queued_requests_.emplace(request_id, std::move(qr));
+}
+
+void ClientImpl::UnbindService(ServiceID service_id) {
+  service_bindings_.erase(service_id);
+}
+
+RequestID ClientImpl::BeginInvoke(ServiceID service_id,
+                                  const std::string& method_name,
+                                  MethodID remote_method_id,
+                                  const ProtoMessage& method_args,
+                                  bool drop_reply,
+                                  base::WeakPtr<ServiceProxy> service_proxy,
+                                  int fd) {
+  RequestID request_id = ++last_request_id_;
+  Frame frame;
+  frame.set_request_id(request_id);
+  Frame::InvokeMethod* req = frame.mutable_msg_invoke_method();
+  req->set_service_id(service_id);
+  req->set_method_id(remote_method_id);
+  req->set_drop_reply(drop_reply);
+  req->set_args_proto(method_args.SerializeAsString());
+  if (!SendFrame(frame, fd)) {
+    PERFETTO_DLOG("BeginInvoke() failed while sending the frame");
+    return 0;
+  }
+  if (drop_reply)
+    return 0;
+  QueuedRequest qr;
+  qr.type = Frame::kMsgInvokeMethodFieldNumber;
+  qr.request_id = request_id;
+  qr.method_name = method_name;
+  qr.service_proxy = std::move(service_proxy);
+  queued_requests_.emplace(request_id, std::move(qr));
+  return request_id;
+}
+
+bool ClientImpl::SendFrame(const Frame& frame, int fd) {
+  // Serialize the frame into protobuf, add the size header, and send it.
+  std::string buf = BufferedFrameDeserializer::Serialize(frame);
+
+  // TODO(primiano): this should do non-blocking I/O. But then what if the
+  // socket buffer is full? We might want to either drop the request or throttle
+  // the send and PostTask the reply later? Right now we are making Send()
+  // blocking as a workaround. Propagate bakpressure to the caller instead.
+  bool res = sock_->Send(buf.data(), buf.size(), fd);
+  PERFETTO_CHECK(res || !sock_->is_connected());
+  return res;
+}
+
+void ClientImpl::OnConnect(base::UnixSocket*, bool connected) {
+  if (!connected && socket_retry_) {
+    socket_backoff_ms_ =
+        (socket_backoff_ms_ < 10000) ? socket_backoff_ms_ + 1000 : 30000;
+    PERFETTO_DLOG(
+        "Connection to traced's UNIX socket failed, retrying in %u seconds",
+        socket_backoff_ms_ / 1000);
+    auto weak_this = weak_ptr_factory_.GetWeakPtr();
+    task_runner_->PostDelayedTask(
+        [weak_this] {
+          if (weak_this)
+            static_cast<ClientImpl&>(*weak_this).TryConnect();
+        },
+        socket_backoff_ms_);
+    return;
+  }
+
+  // Drain the BindService() calls that were queued before establishing the
+  // connection with the host. Note that if we got disconnected, the call to
+  // OnConnect below might delete |this|, so move everything on the stack first.
+  auto queued_bindings = std::move(queued_bindings_);
+  queued_bindings_.clear();
+  for (base::WeakPtr<ServiceProxy>& service_proxy : queued_bindings) {
+    if (connected) {
+      BindService(service_proxy);
+    } else if (service_proxy) {
+      service_proxy->OnConnect(false /* success */);
+    }
+  }
+  // Don't access |this| below here.
+}
+
+void ClientImpl::OnDisconnect(base::UnixSocket*) {
+  for (const auto& it : service_bindings_) {
+    base::WeakPtr<ServiceProxy> service_proxy = it.second;
+    task_runner_->PostTask([service_proxy] {
+      if (service_proxy)
+        service_proxy->OnDisconnect();
+    });
+  }
+  service_bindings_.clear();
+  queued_bindings_.clear();
+}
+
+void ClientImpl::OnDataAvailable(base::UnixSocket*) {
+  size_t rsize;
+  do {
+    auto buf = frame_deserializer_.BeginReceive();
+    base::ScopedFile fd;
+    rsize = sock_->Receive(buf.data, buf.size, &fd);
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+    PERFETTO_DCHECK(!fd);
+#else
+    if (fd) {
+      PERFETTO_DCHECK(!received_fd_);
+      int res = fcntl(*fd, F_SETFD, FD_CLOEXEC);
+      PERFETTO_DCHECK(res == 0);
+      received_fd_ = std::move(fd);
+    }
+#endif
+    if (!frame_deserializer_.EndReceive(rsize)) {
+      // The endpoint tried to send a frame that is way too large.
+      return sock_->Shutdown(true);  // In turn will trigger an OnDisconnect().
+      // TODO(fmayer): check this.
+    }
+  } while (rsize > 0);
+
+  while (std::unique_ptr<Frame> frame = frame_deserializer_.PopNextFrame())
+    OnFrameReceived(*frame);
+}
+
+void ClientImpl::OnFrameReceived(const Frame& frame) {
+  auto queued_requests_it = queued_requests_.find(frame.request_id());
+  if (queued_requests_it == queued_requests_.end()) {
+    PERFETTO_DLOG("OnFrameReceived(): got invalid request_id=%" PRIu64,
+                  static_cast<uint64_t>(frame.request_id()));
+    return;
+  }
+  QueuedRequest req = std::move(queued_requests_it->second);
+  queued_requests_.erase(queued_requests_it);
+
+  if (req.type == Frame::kMsgBindServiceFieldNumber &&
+      frame.has_msg_bind_service_reply()) {
+    return OnBindServiceReply(std::move(req), frame.msg_bind_service_reply());
+  }
+  if (req.type == Frame::kMsgInvokeMethodFieldNumber &&
+      frame.has_msg_invoke_method_reply()) {
+    return OnInvokeMethodReply(std::move(req), frame.msg_invoke_method_reply());
+  }
+  if (frame.has_msg_request_error()) {
+    PERFETTO_DLOG("Host error: %s", frame.msg_request_error().error().c_str());
+    return;
+  }
+
+  PERFETTO_DLOG(
+      "OnFrameReceived() request type=%d, received unknown frame in reply to "
+      "request_id=%" PRIu64,
+      req.type, static_cast<uint64_t>(frame.request_id()));
+}
+
+void ClientImpl::OnBindServiceReply(QueuedRequest req,
+                                    const Frame::BindServiceReply& reply) {
+  base::WeakPtr<ServiceProxy>& service_proxy = req.service_proxy;
+  if (!service_proxy)
+    return;
+  const char* svc_name = service_proxy->GetDescriptor().service_name;
+  if (!reply.success()) {
+    PERFETTO_DLOG("BindService(): unknown service_name=\"%s\"", svc_name);
+    return service_proxy->OnConnect(false /* success */);
+  }
+
+  auto prev_service = service_bindings_.find(reply.service_id());
+  if (prev_service != service_bindings_.end() && prev_service->second.get()) {
+    PERFETTO_DLOG(
+        "BindService(): Trying to bind service \"%s\" but another service "
+        "named \"%s\" is already bound with the same ID.",
+        svc_name, prev_service->second->GetDescriptor().service_name);
+    return service_proxy->OnConnect(false /* success */);
+  }
+
+  // Build the method [name] -> [remote_id] map.
+  std::map<std::string, MethodID> methods;
+  for (const auto& method : reply.methods()) {
+    if (method.name().empty() || method.id() <= 0) {
+      PERFETTO_DLOG("OnBindServiceReply(): invalid method \"%s\" -> %" PRIu64,
+                    method.name().c_str(), static_cast<uint64_t>(method.id()));
+      continue;
+    }
+    methods[method.name()] = method.id();
+  }
+  service_proxy->InitializeBinding(weak_ptr_factory_.GetWeakPtr(),
+                                   reply.service_id(), std::move(methods));
+  service_bindings_[reply.service_id()] = service_proxy;
+  service_proxy->OnConnect(true /* success */);
+}
+
+void ClientImpl::OnInvokeMethodReply(QueuedRequest req,
+                                     const Frame::InvokeMethodReply& reply) {
+  base::WeakPtr<ServiceProxy> service_proxy = req.service_proxy;
+  if (!service_proxy)
+    return;
+  std::unique_ptr<ProtoMessage> decoded_reply;
+  if (reply.success()) {
+    // If this becomes a hotspot, optimize by maintaining a dedicated hashtable.
+    for (const auto& method : service_proxy->GetDescriptor().methods) {
+      if (req.method_name == method.name) {
+        decoded_reply = method.reply_proto_decoder(reply.reply_proto());
+        break;
+      }
+    }
+  }
+  const RequestID request_id = req.request_id;
+  invoking_method_reply_ = true;
+  service_proxy->EndInvoke(request_id, std::move(decoded_reply),
+                           reply.has_more());
+  invoking_method_reply_ = false;
+
+  // If this is a streaming method and future replies will be resolved, put back
+  // the |req| with the callback into the set of active requests.
+  if (reply.has_more())
+    queued_requests_.emplace(request_id, std::move(req));
+}
+
+ClientImpl::QueuedRequest::QueuedRequest() = default;
+
+base::ScopedFile ClientImpl::TakeReceivedFD() {
+  return std::move(received_fd_);
+}
+
+}  // namespace ipc
+}  // namespace perfetto
+// gen_amalgamated begin source: src/ipc/service_proxy.cc
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/service_proxy.h"
+
+#include <utility>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/weak_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/service_descriptor.h"
+// gen_amalgamated expanded: #include "src/ipc/client_impl.h"
+
+// gen_amalgamated expanded: #include "protos/perfetto/ipc/wire_protocol.gen.h"
+
+namespace perfetto {
+namespace ipc {
+
+ServiceProxy::ServiceProxy(EventListener* event_listener)
+    : event_listener_(event_listener), weak_ptr_factory_(this) {}
+
+ServiceProxy::~ServiceProxy() {
+  if (client_ && connected())
+    client_->UnbindService(service_id_);
+}
+
+void ServiceProxy::InitializeBinding(
+    base::WeakPtr<Client> client,
+    ServiceID service_id,
+    std::map<std::string, MethodID> remote_method_ids) {
+  client_ = std::move(client);
+  service_id_ = service_id;
+  remote_method_ids_ = std::move(remote_method_ids);
+}
+
+void ServiceProxy::BeginInvoke(const std::string& method_name,
+                               const ProtoMessage& request,
+                               DeferredBase reply,
+                               int fd) {
+  // |reply| will auto-resolve if it gets out of scope early.
+  if (!connected()) {
+    PERFETTO_DFATAL("Not connected.");
+    return;
+  }
+  if (!client_)
+    return;  // The Client object has been destroyed in the meantime.
+
+  auto remote_method_it = remote_method_ids_.find(method_name);
+  RequestID request_id = 0;
+  const bool drop_reply = !reply.IsBound();
+  if (remote_method_it != remote_method_ids_.end()) {
+    request_id =
+        static_cast<ClientImpl*>(client_.get())
+            ->BeginInvoke(service_id_, method_name, remote_method_it->second,
+                          request, drop_reply, weak_ptr_factory_.GetWeakPtr(),
+                          fd);
+  } else {
+    PERFETTO_DLOG("Cannot find method \"%s\" on the host", method_name.c_str());
+  }
+
+  // When passing |drop_reply| == true, the returned |request_id| should be 0.
+  PERFETTO_DCHECK(!drop_reply || !request_id);
+
+  if (!request_id)
+    return;
+  PERFETTO_DCHECK(pending_callbacks_.count(request_id) == 0);
+  pending_callbacks_.emplace(request_id, std::move(reply));
+}
+
+void ServiceProxy::EndInvoke(RequestID request_id,
+                             std::unique_ptr<ProtoMessage> result,
+                             bool has_more) {
+  auto callback_it = pending_callbacks_.find(request_id);
+  if (callback_it == pending_callbacks_.end()) {
+    // Either we are getting a reply for a method we never invoked, or we are
+    // getting a reply to a method marked drop_reply (that has been invoked
+    // without binding any callback in the Defererd response object).
+    PERFETTO_DFATAL("Unexpected reply received.");
+    return;
+  }
+  DeferredBase& reply_callback = callback_it->second;
+  AsyncResult<ProtoMessage> reply(std::move(result), has_more);
+  reply_callback.Resolve(std::move(reply));
+  if (!has_more)
+    pending_callbacks_.erase(callback_it);
+}
+
+void ServiceProxy::OnConnect(bool success) {
+  if (success) {
+    PERFETTO_DCHECK(service_id_);
+    return event_listener_->OnConnect();
+  }
+  return event_listener_->OnDisconnect();
+}
+
+void ServiceProxy::OnDisconnect() {
+  pending_callbacks_.clear();  // Will Reject() all the pending callbacks.
+  event_listener_->OnDisconnect();
+}
+
+base::WeakPtr<ServiceProxy> ServiceProxy::GetWeakPtr() const {
+  return weak_ptr_factory_.GetWeakPtr();
+}
+
+}  // namespace ipc
+}  // namespace perfetto
+// gen_amalgamated begin source: src/ipc/host_impl.cc
+// gen_amalgamated begin header: src/ipc/host_impl.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SRC_IPC_HOST_IMPL_H_
+#define SRC_IPC_HOST_IMPL_H_
+
+#include <map>
+#include <set>
+#include <string>
+#include <vector>
+
+// gen_amalgamated expanded: #include "perfetto/base/task_runner.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/thread_checker.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/unix_socket.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/deferred.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/host.h"
+// gen_amalgamated expanded: #include "src/ipc/buffered_frame_deserializer.h"
+
+namespace perfetto {
+namespace ipc {
+
+class HostImpl : public Host, public base::UnixSocket::EventListener {
+ public:
+  HostImpl(const char* socket_name, base::TaskRunner*);
+  HostImpl(base::ScopedSocketHandle, base::TaskRunner*);
+  ~HostImpl() override;
+
+  // Host implementation.
+  bool ExposeService(std::unique_ptr<Service>) override;
+
+  // base::UnixSocket::EventListener implementation.
+  void OnNewIncomingConnection(base::UnixSocket*,
+                               std::unique_ptr<base::UnixSocket>) override;
+  void OnDisconnect(base::UnixSocket*) override;
+  void OnDataAvailable(base::UnixSocket*) override;
+
+  const base::UnixSocket* sock() const { return sock_.get(); }
+
+ private:
+  // Owns the per-client receive buffer (BufferedFrameDeserializer).
+  struct ClientConnection {
+    ~ClientConnection();
+    ClientID id;
+    std::unique_ptr<base::UnixSocket> sock;
+    BufferedFrameDeserializer frame_deserializer;
+    base::ScopedFile received_fd;
+  };
+  struct ExposedService {
+    ExposedService(ServiceID, const std::string&, std::unique_ptr<Service>);
+    ~ExposedService();
+    ExposedService(ExposedService&&) noexcept;
+    ExposedService& operator=(ExposedService&&);
+
+    ServiceID id;
+    std::string name;
+    std::unique_ptr<Service> instance;
+  };
+
+  HostImpl(const HostImpl&) = delete;
+  HostImpl& operator=(const HostImpl&) = delete;
+
+  bool Initialize(const char* socket_name);
+  void OnReceivedFrame(ClientConnection*, const Frame&);
+  void OnBindService(ClientConnection*, const Frame&);
+  void OnInvokeMethod(ClientConnection*, const Frame&);
+  void ReplyToMethodInvocation(ClientID, RequestID, AsyncResult<ProtoMessage>);
+  const ExposedService* GetServiceByName(const std::string&);
+
+  static void SendFrame(ClientConnection*, const Frame&, int fd = -1);
+
+  base::TaskRunner* const task_runner_;
+  std::map<ServiceID, ExposedService> services_;
+  std::unique_ptr<base::UnixSocket> sock_;  // The listening socket.
+  std::map<ClientID, std::unique_ptr<ClientConnection>> clients_;
+  std::map<base::UnixSocket*, ClientConnection*> clients_by_socket_;
+  ServiceID last_service_id_ = 0;
+  ClientID last_client_id_ = 0;
+  PERFETTO_THREAD_CHECKER(thread_checker_)
+  base::WeakPtrFactory<HostImpl> weak_ptr_factory_;  // Keep last.
+};
+
+}  // namespace ipc
+}  // namespace perfetto
+
+#endif  // SRC_IPC_HOST_IMPL_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "src/ipc/host_impl.h"
+
+#include <inttypes.h>
+
+#include <algorithm>
+#include <utility>
+
+// gen_amalgamated expanded: #include "perfetto/base/task_runner.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/service.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/service_descriptor.h"
+
+// gen_amalgamated expanded: #include "protos/perfetto/ipc/wire_protocol.gen.h"
+
+// TODO(primiano): put limits on #connections/uid and req. queue (b/69093705).
+
+namespace perfetto {
+namespace ipc {
+
+namespace {
+
+constexpr base::SockFamily kHostSockFamily =
+    kUseTCPSocket ? base::SockFamily::kInet : base::SockFamily::kUnix;
+
+uid_t GetPosixPeerUid(base::UnixSocket* sock) {
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  base::ignore_result(sock);
+  // Unsupported. Must be != kInvalidUid or the PacketValidator will fail.
+  return 0;
+#else
+  return sock->peer_uid_posix();
+#endif
+}
+
+}  // namespace
+
+// static
+std::unique_ptr<Host> Host::CreateInstance(const char* socket_name,
+                                           base::TaskRunner* task_runner) {
+  std::unique_ptr<HostImpl> host(new HostImpl(socket_name, task_runner));
+  if (!host->sock() || !host->sock()->is_listening())
+    return nullptr;
+  return std::unique_ptr<Host>(std::move(host));
+}
+
+// static
+std::unique_ptr<Host> Host::CreateInstance(base::ScopedSocketHandle socket_fd,
+                                           base::TaskRunner* task_runner) {
+  std::unique_ptr<HostImpl> host(
+      new HostImpl(std::move(socket_fd), task_runner));
+  if (!host->sock() || !host->sock()->is_listening())
+    return nullptr;
+  return std::unique_ptr<Host>(std::move(host));
+}
+
+HostImpl::HostImpl(base::ScopedSocketHandle socket_fd,
+                   base::TaskRunner* task_runner)
+    : task_runner_(task_runner), weak_ptr_factory_(this) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  sock_ = base::UnixSocket::Listen(std::move(socket_fd), this, task_runner_,
+                                   kHostSockFamily, base::SockType::kStream);
+}
+
+HostImpl::HostImpl(const char* socket_name, base::TaskRunner* task_runner)
+    : task_runner_(task_runner), weak_ptr_factory_(this) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  sock_ = base::UnixSocket::Listen(socket_name, this, task_runner_,
+                                   kHostSockFamily, base::SockType::kStream);
+  if (!sock_) {
+    PERFETTO_PLOG("Failed to create %s", socket_name);
+  }
+}
+
+HostImpl::~HostImpl() = default;
+
+bool HostImpl::ExposeService(std::unique_ptr<Service> service) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  const std::string& service_name = service->GetDescriptor().service_name;
+  if (GetServiceByName(service_name)) {
+    PERFETTO_DLOG("Duplicate ExposeService(): %s", service_name.c_str());
+    return false;
+  }
+  ServiceID sid = ++last_service_id_;
+  ExposedService exposed_service(sid, service_name, std::move(service));
+  services_.emplace(sid, std::move(exposed_service));
+  return true;
+}
+
+void HostImpl::OnNewIncomingConnection(
+    base::UnixSocket*,
+    std::unique_ptr<base::UnixSocket> new_conn) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  std::unique_ptr<ClientConnection> client(new ClientConnection());
+  ClientID client_id = ++last_client_id_;
+  clients_by_socket_[new_conn.get()] = client.get();
+  client->id = client_id;
+  client->sock = std::move(new_conn);
+  // Watchdog is 30 seconds, so set the socket timeout to 10 seconds.
+  client->sock->SetTxTimeout(10000);
+  clients_[client_id] = std::move(client);
+}
+
+void HostImpl::OnDataAvailable(base::UnixSocket* sock) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  auto it = clients_by_socket_.find(sock);
+  if (it == clients_by_socket_.end())
+    return;
+  ClientConnection* client = it->second;
+  BufferedFrameDeserializer& frame_deserializer = client->frame_deserializer;
+
+  size_t rsize;
+  do {
+    auto buf = frame_deserializer.BeginReceive();
+    base::ScopedFile fd;
+    rsize = client->sock->Receive(buf.data, buf.size, &fd);
+    if (fd) {
+      PERFETTO_DCHECK(!client->received_fd);
+      client->received_fd = std::move(fd);
+    }
+    if (!frame_deserializer.EndReceive(rsize))
+      return OnDisconnect(client->sock.get());
+  } while (rsize > 0);
+
+  for (;;) {
+    std::unique_ptr<Frame> frame = frame_deserializer.PopNextFrame();
+    if (!frame)
+      break;
+    OnReceivedFrame(client, *frame);
+  }
+}
+
+void HostImpl::OnReceivedFrame(ClientConnection* client,
+                               const Frame& req_frame) {
+  if (req_frame.has_msg_bind_service())
+    return OnBindService(client, req_frame);
+  if (req_frame.has_msg_invoke_method())
+    return OnInvokeMethod(client, req_frame);
+
+  PERFETTO_DLOG("Received invalid RPC frame from client %" PRIu64, client->id);
+  Frame reply_frame;
+  reply_frame.set_request_id(req_frame.request_id());
+  reply_frame.mutable_msg_request_error()->set_error("unknown request");
+  SendFrame(client, reply_frame);
+}
+
+void HostImpl::OnBindService(ClientConnection* client, const Frame& req_frame) {
+  // Binding a service doesn't do anything major. It just returns back the
+  // service id and its method map.
+  const Frame::BindService& req = req_frame.msg_bind_service();
+  Frame reply_frame;
+  reply_frame.set_request_id(req_frame.request_id());
+  auto* reply = reply_frame.mutable_msg_bind_service_reply();
+  const ExposedService* service = GetServiceByName(req.service_name());
+  if (service) {
+    reply->set_success(true);
+    reply->set_service_id(service->id);
+    uint32_t method_id = 1;  // method ids start at index 1.
+    for (const auto& desc_method : service->instance->GetDescriptor().methods) {
+      Frame::BindServiceReply::MethodInfo* method_info = reply->add_methods();
+      method_info->set_name(desc_method.name);
+      method_info->set_id(method_id++);
+    }
+  }
+  SendFrame(client, reply_frame);
+}
+
+void HostImpl::OnInvokeMethod(ClientConnection* client,
+                              const Frame& req_frame) {
+  const Frame::InvokeMethod& req = req_frame.msg_invoke_method();
+  Frame reply_frame;
+  RequestID request_id = req_frame.request_id();
+  reply_frame.set_request_id(request_id);
+  reply_frame.mutable_msg_invoke_method_reply()->set_success(false);
+  auto svc_it = services_.find(req.service_id());
+  if (svc_it == services_.end())
+    return SendFrame(client, reply_frame);  // |success| == false by default.
+
+  Service* service = svc_it->second.instance.get();
+  const ServiceDescriptor& svc = service->GetDescriptor();
+  const auto& methods = svc.methods;
+  const uint32_t method_id = req.method_id();
+  if (method_id == 0 || method_id > methods.size())
+    return SendFrame(client, reply_frame);
+
+  const ServiceDescriptor::Method& method = methods[method_id - 1];
+  std::unique_ptr<ProtoMessage> decoded_req_args(
+      method.request_proto_decoder(req.args_proto()));
+  if (!decoded_req_args)
+    return SendFrame(client, reply_frame);
+
+  Deferred<ProtoMessage> deferred_reply;
+  base::WeakPtr<HostImpl> host_weak_ptr = weak_ptr_factory_.GetWeakPtr();
+  ClientID client_id = client->id;
+
+  if (!req.drop_reply()) {
+    deferred_reply.Bind([host_weak_ptr, client_id,
+                         request_id](AsyncResult<ProtoMessage> reply) {
+      if (!host_weak_ptr)
+        return;  // The reply came too late, the HostImpl has gone.
+      host_weak_ptr->ReplyToMethodInvocation(client_id, request_id,
+                                             std::move(reply));
+    });
+  }
+
+  service->client_info_ =
+      ClientInfo(client->id, GetPosixPeerUid(client->sock.get()));
+  service->received_fd_ = &client->received_fd;
+  method.invoker(service, *decoded_req_args, std::move(deferred_reply));
+  service->received_fd_ = nullptr;
+  service->client_info_ = ClientInfo();
+}
+
+void HostImpl::ReplyToMethodInvocation(ClientID client_id,
+                                       RequestID request_id,
+                                       AsyncResult<ProtoMessage> reply) {
+  auto client_iter = clients_.find(client_id);
+  if (client_iter == clients_.end())
+    return;  // client has disconnected by the time we got the async reply.
+
+  ClientConnection* client = client_iter->second.get();
+  Frame reply_frame;
+  reply_frame.set_request_id(request_id);
+
+  // TODO(fmayer): add a test to guarantee that the reply is consumed within the
+  // same call stack and not kept around. ConsumerIPCService::OnTraceData()
+  // relies on this behavior.
+  auto* reply_frame_data = reply_frame.mutable_msg_invoke_method_reply();
+  reply_frame_data->set_has_more(reply.has_more());
+  if (reply.success()) {
+    std::string reply_proto = reply->SerializeAsString();
+    reply_frame_data->set_reply_proto(reply_proto);
+    reply_frame_data->set_success(true);
+  }
+  SendFrame(client, reply_frame, reply.fd());
+}
+
+// static
+void HostImpl::SendFrame(ClientConnection* client, const Frame& frame, int fd) {
+  std::string buf = BufferedFrameDeserializer::Serialize(frame);
+
+  // When a new Client connects in OnNewClientConnection we set a timeout on
+  // Send (see call to SetTxTimeout).
+  //
+  // The old behaviour was to do a blocking I/O call, which caused crashes from
+  // misbehaving producers (see b/169051440).
+  bool res = client->sock->Send(buf.data(), buf.size(), fd);
+  // If we timeout |res| will be false, but the UnixSocket will have called
+  // UnixSocket::ShutDown() and thus |is_connected()| is false.
+  PERFETTO_CHECK(res || !client->sock->is_connected());
+}
+
+void HostImpl::OnDisconnect(base::UnixSocket* sock) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  auto it = clients_by_socket_.find(sock);
+  if (it == clients_by_socket_.end())
+    return;
+  ClientID client_id = it->second->id;
+
+  ClientInfo client_info(client_id, GetPosixPeerUid(sock));
+  clients_by_socket_.erase(it);
+  PERFETTO_DCHECK(clients_.count(client_id));
+  clients_.erase(client_id);
+
+  for (const auto& service_it : services_) {
+    Service& service = *service_it.second.instance;
+    service.client_info_ = client_info;
+    service.OnClientDisconnected();
+    service.client_info_ = ClientInfo();
+  }
+}
+
+const HostImpl::ExposedService* HostImpl::GetServiceByName(
+    const std::string& name) {
+  // This could be optimized by using another map<name,ServiceID>. However this
+  // is used only by Bind/ExposeService that are quite rare (once per client
+  // connection and once per service instance), not worth it.
+  for (const auto& it : services_) {
+    if (it.second.name == name)
+      return &it.second;
+  }
+  return nullptr;
+}
+
+HostImpl::ExposedService::ExposedService(ServiceID id_,
+                                         const std::string& name_,
+                                         std::unique_ptr<Service> instance_)
+    : id(id_), name(name_), instance(std::move(instance_)) {}
+
+HostImpl::ExposedService::ExposedService(ExposedService&&) noexcept = default;
+HostImpl::ExposedService& HostImpl::ExposedService::operator=(
+    HostImpl::ExposedService&&) = default;
+HostImpl::ExposedService::~ExposedService() = default;
+
+HostImpl::ClientConnection::~ClientConnection() = default;
+
+}  // namespace ipc
+}  // namespace perfetto
+// gen_amalgamated begin source: gen/protos/perfetto/ipc/consumer_port.ipc.cc
+// gen_amalgamated begin header: gen/protos/perfetto/ipc/consumer_port.ipc.h
+// DO NOT EDIT. Autogenerated by Perfetto IPC
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_CONSUMER_PORT_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_CONSUMER_PORT_PROTO_H_
+
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/deferred.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/service.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/service_descriptor.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/service_proxy.h"
+
+// gen_amalgamated expanded: #include "protos/perfetto/ipc/consumer_port.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/observable_events.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/tracing_service_state.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/tracing_service_capabilities.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/trace_stats.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/trace_config.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class ConsumerPort : public ::perfetto::ipc::Service {
+ private:
+  static ::perfetto::ipc::ServiceDescriptor* NewDescriptor();
+
+ public:
+  ~ConsumerPort() override;
+
+  static const ::perfetto::ipc::ServiceDescriptor& GetDescriptorStatic();
+
+  // Service implementation.
+  const ::perfetto::ipc::ServiceDescriptor& GetDescriptor() override;
+
+  // Methods from the .proto file
+  using DeferredEnableTracingResponse = ::perfetto::ipc::Deferred<EnableTracingResponse>;
+  virtual void EnableTracing(const EnableTracingRequest&, DeferredEnableTracingResponse) = 0;
+
+  using DeferredDisableTracingResponse = ::perfetto::ipc::Deferred<DisableTracingResponse>;
+  virtual void DisableTracing(const DisableTracingRequest&, DeferredDisableTracingResponse) = 0;
+
+  using DeferredReadBuffersResponse = ::perfetto::ipc::Deferred<ReadBuffersResponse>;
+  virtual void ReadBuffers(const ReadBuffersRequest&, DeferredReadBuffersResponse) = 0;
+
+  using DeferredFreeBuffersResponse = ::perfetto::ipc::Deferred<FreeBuffersResponse>;
+  virtual void FreeBuffers(const FreeBuffersRequest&, DeferredFreeBuffersResponse) = 0;
+
+  using DeferredFlushResponse = ::perfetto::ipc::Deferred<FlushResponse>;
+  virtual void Flush(const FlushRequest&, DeferredFlushResponse) = 0;
+
+  using DeferredStartTracingResponse = ::perfetto::ipc::Deferred<StartTracingResponse>;
+  virtual void StartTracing(const StartTracingRequest&, DeferredStartTracingResponse) = 0;
+
+  using DeferredChangeTraceConfigResponse = ::perfetto::ipc::Deferred<ChangeTraceConfigResponse>;
+  virtual void ChangeTraceConfig(const ChangeTraceConfigRequest&, DeferredChangeTraceConfigResponse) = 0;
+
+  using DeferredDetachResponse = ::perfetto::ipc::Deferred<DetachResponse>;
+  virtual void Detach(const DetachRequest&, DeferredDetachResponse) = 0;
+
+  using DeferredAttachResponse = ::perfetto::ipc::Deferred<AttachResponse>;
+  virtual void Attach(const AttachRequest&, DeferredAttachResponse) = 0;
+
+  using DeferredGetTraceStatsResponse = ::perfetto::ipc::Deferred<GetTraceStatsResponse>;
+  virtual void GetTraceStats(const GetTraceStatsRequest&, DeferredGetTraceStatsResponse) = 0;
+
+  using DeferredObserveEventsResponse = ::perfetto::ipc::Deferred<ObserveEventsResponse>;
+  virtual void ObserveEvents(const ObserveEventsRequest&, DeferredObserveEventsResponse) = 0;
+
+  using DeferredQueryServiceStateResponse = ::perfetto::ipc::Deferred<QueryServiceStateResponse>;
+  virtual void QueryServiceState(const QueryServiceStateRequest&, DeferredQueryServiceStateResponse) = 0;
+
+  using DeferredQueryCapabilitiesResponse = ::perfetto::ipc::Deferred<QueryCapabilitiesResponse>;
+  virtual void QueryCapabilities(const QueryCapabilitiesRequest&, DeferredQueryCapabilitiesResponse) = 0;
+
+  using DeferredSaveTraceForBugreportResponse = ::perfetto::ipc::Deferred<SaveTraceForBugreportResponse>;
+  virtual void SaveTraceForBugreport(const SaveTraceForBugreportRequest&, DeferredSaveTraceForBugreportResponse) = 0;
+
+};
+
+
+class ConsumerPortProxy : public ::perfetto::ipc::ServiceProxy {
+ public:
+   explicit ConsumerPortProxy(::perfetto::ipc::ServiceProxy::EventListener*);
+   ~ConsumerPortProxy() override;
+
+  // ServiceProxy implementation.
+  const ::perfetto::ipc::ServiceDescriptor& GetDescriptor() override;
+
+  // Methods from the .proto file
+  using DeferredEnableTracingResponse = ::perfetto::ipc::Deferred<EnableTracingResponse>;
+  void EnableTracing(const EnableTracingRequest&, DeferredEnableTracingResponse, int fd = -1);
+
+  using DeferredDisableTracingResponse = ::perfetto::ipc::Deferred<DisableTracingResponse>;
+  void DisableTracing(const DisableTracingRequest&, DeferredDisableTracingResponse, int fd = -1);
+
+  using DeferredReadBuffersResponse = ::perfetto::ipc::Deferred<ReadBuffersResponse>;
+  void ReadBuffers(const ReadBuffersRequest&, DeferredReadBuffersResponse, int fd = -1);
+
+  using DeferredFreeBuffersResponse = ::perfetto::ipc::Deferred<FreeBuffersResponse>;
+  void FreeBuffers(const FreeBuffersRequest&, DeferredFreeBuffersResponse, int fd = -1);
+
+  using DeferredFlushResponse = ::perfetto::ipc::Deferred<FlushResponse>;
+  void Flush(const FlushRequest&, DeferredFlushResponse, int fd = -1);
+
+  using DeferredStartTracingResponse = ::perfetto::ipc::Deferred<StartTracingResponse>;
+  void StartTracing(const StartTracingRequest&, DeferredStartTracingResponse, int fd = -1);
+
+  using DeferredChangeTraceConfigResponse = ::perfetto::ipc::Deferred<ChangeTraceConfigResponse>;
+  void ChangeTraceConfig(const ChangeTraceConfigRequest&, DeferredChangeTraceConfigResponse, int fd = -1);
+
+  using DeferredDetachResponse = ::perfetto::ipc::Deferred<DetachResponse>;
+  void Detach(const DetachRequest&, DeferredDetachResponse, int fd = -1);
+
+  using DeferredAttachResponse = ::perfetto::ipc::Deferred<AttachResponse>;
+  void Attach(const AttachRequest&, DeferredAttachResponse, int fd = -1);
+
+  using DeferredGetTraceStatsResponse = ::perfetto::ipc::Deferred<GetTraceStatsResponse>;
+  void GetTraceStats(const GetTraceStatsRequest&, DeferredGetTraceStatsResponse, int fd = -1);
+
+  using DeferredObserveEventsResponse = ::perfetto::ipc::Deferred<ObserveEventsResponse>;
+  void ObserveEvents(const ObserveEventsRequest&, DeferredObserveEventsResponse, int fd = -1);
+
+  using DeferredQueryServiceStateResponse = ::perfetto::ipc::Deferred<QueryServiceStateResponse>;
+  void QueryServiceState(const QueryServiceStateRequest&, DeferredQueryServiceStateResponse, int fd = -1);
+
+  using DeferredQueryCapabilitiesResponse = ::perfetto::ipc::Deferred<QueryCapabilitiesResponse>;
+  void QueryCapabilities(const QueryCapabilitiesRequest&, DeferredQueryCapabilitiesResponse, int fd = -1);
+
+  using DeferredSaveTraceForBugreportResponse = ::perfetto::ipc::Deferred<SaveTraceForBugreportResponse>;
+  void SaveTraceForBugreport(const SaveTraceForBugreportRequest&, DeferredSaveTraceForBugreportResponse, int fd = -1);
+
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_CONSUMER_PORT_PROTO_H_
+// gen_amalgamated begin header: include/perfetto/ext/ipc/codegen_helpers.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// This file is only meant to be included in autogenerated .cc files.
+
+#ifndef INCLUDE_PERFETTO_EXT_IPC_CODEGEN_HELPERS_H_
+#define INCLUDE_PERFETTO_EXT_IPC_CODEGEN_HELPERS_H_
+
+#include <memory>
+
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/basic_types.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/deferred.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/service.h"
+
+// A templated protobuf message decoder. Returns nullptr in case of failure.
+template <typename T>
+::std::unique_ptr<::perfetto::ipc::ProtoMessage> _IPC_Decoder(
+    const std::string& proto_data) {
+  ::std::unique_ptr<::perfetto::ipc::ProtoMessage> msg(new T());
+  if (msg->ParseFromString(proto_data))
+    return msg;
+  return nullptr;
+}
+
+// Templated method dispatcher. Used to obtain a function pointer to a given
+// IPC method (Method) of a given service (TSvc) that can be invoked by the
+// host-side machinery starting from a generic Service pointer and a generic
+// ProtoMessage request argument.
+template <typename TSvc,    // Type of the actual Service subclass.
+          typename TReq,    // Type of the request argument.
+          typename TReply,  // Type of the reply argument.
+          void (TSvc::*Method)(const TReq&, ::perfetto::ipc::Deferred<TReply>)>
+void _IPC_Invoker(::perfetto::ipc::Service* s,
+                  const ::perfetto::ipc::ProtoMessage& req,
+                  ::perfetto::ipc::DeferredBase reply) {
+  (*static_cast<TSvc*>(s).*Method)(
+      static_cast<const TReq&>(req),
+      ::perfetto::ipc::Deferred<TReply>(::std::move(reply)));
+}
+
+#endif  // INCLUDE_PERFETTO_EXT_IPC_CODEGEN_HELPERS_H_
+// DO NOT EDIT. Autogenerated by Perfetto IPC
+// gen_amalgamated expanded: #include "protos/perfetto/ipc/consumer_port.ipc.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/codegen_helpers.h"
+
+#include <memory>
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+::perfetto::ipc::ServiceDescriptor* ConsumerPort::NewDescriptor() {
+  auto* desc = new ::perfetto::ipc::ServiceDescriptor();
+  desc->service_name = "ConsumerPort";
+
+  desc->methods.emplace_back(::perfetto::ipc::ServiceDescriptor::Method{
+     "EnableTracing",
+     &_IPC_Decoder<EnableTracingRequest>,
+     &_IPC_Decoder<EnableTracingResponse>,
+     &_IPC_Invoker<ConsumerPort, EnableTracingRequest, EnableTracingResponse, &ConsumerPort::EnableTracing>});
+
+  desc->methods.emplace_back(::perfetto::ipc::ServiceDescriptor::Method{
+     "DisableTracing",
+     &_IPC_Decoder<DisableTracingRequest>,
+     &_IPC_Decoder<DisableTracingResponse>,
+     &_IPC_Invoker<ConsumerPort, DisableTracingRequest, DisableTracingResponse, &ConsumerPort::DisableTracing>});
+
+  desc->methods.emplace_back(::perfetto::ipc::ServiceDescriptor::Method{
+     "ReadBuffers",
+     &_IPC_Decoder<ReadBuffersRequest>,
+     &_IPC_Decoder<ReadBuffersResponse>,
+     &_IPC_Invoker<ConsumerPort, ReadBuffersRequest, ReadBuffersResponse, &ConsumerPort::ReadBuffers>});
+
+  desc->methods.emplace_back(::perfetto::ipc::ServiceDescriptor::Method{
+     "FreeBuffers",
+     &_IPC_Decoder<FreeBuffersRequest>,
+     &_IPC_Decoder<FreeBuffersResponse>,
+     &_IPC_Invoker<ConsumerPort, FreeBuffersRequest, FreeBuffersResponse, &ConsumerPort::FreeBuffers>});
+
+  desc->methods.emplace_back(::perfetto::ipc::ServiceDescriptor::Method{
+     "Flush",
+     &_IPC_Decoder<FlushRequest>,
+     &_IPC_Decoder<FlushResponse>,
+     &_IPC_Invoker<ConsumerPort, FlushRequest, FlushResponse, &ConsumerPort::Flush>});
+
+  desc->methods.emplace_back(::perfetto::ipc::ServiceDescriptor::Method{
+     "StartTracing",
+     &_IPC_Decoder<StartTracingRequest>,
+     &_IPC_Decoder<StartTracingResponse>,
+     &_IPC_Invoker<ConsumerPort, StartTracingRequest, StartTracingResponse, &ConsumerPort::StartTracing>});
+
+  desc->methods.emplace_back(::perfetto::ipc::ServiceDescriptor::Method{
+     "ChangeTraceConfig",
+     &_IPC_Decoder<ChangeTraceConfigRequest>,
+     &_IPC_Decoder<ChangeTraceConfigResponse>,
+     &_IPC_Invoker<ConsumerPort, ChangeTraceConfigRequest, ChangeTraceConfigResponse, &ConsumerPort::ChangeTraceConfig>});
+
+  desc->methods.emplace_back(::perfetto::ipc::ServiceDescriptor::Method{
+     "Detach",
+     &_IPC_Decoder<DetachRequest>,
+     &_IPC_Decoder<DetachResponse>,
+     &_IPC_Invoker<ConsumerPort, DetachRequest, DetachResponse, &ConsumerPort::Detach>});
+
+  desc->methods.emplace_back(::perfetto::ipc::ServiceDescriptor::Method{
+     "Attach",
+     &_IPC_Decoder<AttachRequest>,
+     &_IPC_Decoder<AttachResponse>,
+     &_IPC_Invoker<ConsumerPort, AttachRequest, AttachResponse, &ConsumerPort::Attach>});
+
+  desc->methods.emplace_back(::perfetto::ipc::ServiceDescriptor::Method{
+     "GetTraceStats",
+     &_IPC_Decoder<GetTraceStatsRequest>,
+     &_IPC_Decoder<GetTraceStatsResponse>,
+     &_IPC_Invoker<ConsumerPort, GetTraceStatsRequest, GetTraceStatsResponse, &ConsumerPort::GetTraceStats>});
+
+  desc->methods.emplace_back(::perfetto::ipc::ServiceDescriptor::Method{
+     "ObserveEvents",
+     &_IPC_Decoder<ObserveEventsRequest>,
+     &_IPC_Decoder<ObserveEventsResponse>,
+     &_IPC_Invoker<ConsumerPort, ObserveEventsRequest, ObserveEventsResponse, &ConsumerPort::ObserveEvents>});
+
+  desc->methods.emplace_back(::perfetto::ipc::ServiceDescriptor::Method{
+     "QueryServiceState",
+     &_IPC_Decoder<QueryServiceStateRequest>,
+     &_IPC_Decoder<QueryServiceStateResponse>,
+     &_IPC_Invoker<ConsumerPort, QueryServiceStateRequest, QueryServiceStateResponse, &ConsumerPort::QueryServiceState>});
+
+  desc->methods.emplace_back(::perfetto::ipc::ServiceDescriptor::Method{
+     "QueryCapabilities",
+     &_IPC_Decoder<QueryCapabilitiesRequest>,
+     &_IPC_Decoder<QueryCapabilitiesResponse>,
+     &_IPC_Invoker<ConsumerPort, QueryCapabilitiesRequest, QueryCapabilitiesResponse, &ConsumerPort::QueryCapabilities>});
+
+  desc->methods.emplace_back(::perfetto::ipc::ServiceDescriptor::Method{
+     "SaveTraceForBugreport",
+     &_IPC_Decoder<SaveTraceForBugreportRequest>,
+     &_IPC_Decoder<SaveTraceForBugreportResponse>,
+     &_IPC_Invoker<ConsumerPort, SaveTraceForBugreportRequest, SaveTraceForBugreportResponse, &ConsumerPort::SaveTraceForBugreport>});
+  desc->methods.shrink_to_fit();
+  return desc;
+}
+
+
+const ::perfetto::ipc::ServiceDescriptor& ConsumerPort::GetDescriptorStatic() {
+  static auto* instance = NewDescriptor();
+  return *instance;
+}
+
+// Host-side definitions.
+ConsumerPort::~ConsumerPort() = default;
+
+const ::perfetto::ipc::ServiceDescriptor& ConsumerPort::GetDescriptor() {
+  return GetDescriptorStatic();
+}
+
+// Client-side definitions.
+ConsumerPortProxy::ConsumerPortProxy(::perfetto::ipc::ServiceProxy::EventListener* event_listener)
+    : ::perfetto::ipc::ServiceProxy(event_listener) {}
+
+ConsumerPortProxy::~ConsumerPortProxy() = default;
+
+const ::perfetto::ipc::ServiceDescriptor& ConsumerPortProxy::GetDescriptor() {
+  return ConsumerPort::GetDescriptorStatic();
+}
+
+void ConsumerPortProxy::EnableTracing(const EnableTracingRequest& request, DeferredEnableTracingResponse reply, int fd) {
+  BeginInvoke("EnableTracing", request, ::perfetto::ipc::DeferredBase(std::move(reply)),
+              fd);
+}
+
+void ConsumerPortProxy::DisableTracing(const DisableTracingRequest& request, DeferredDisableTracingResponse reply, int fd) {
+  BeginInvoke("DisableTracing", request, ::perfetto::ipc::DeferredBase(std::move(reply)),
+              fd);
+}
+
+void ConsumerPortProxy::ReadBuffers(const ReadBuffersRequest& request, DeferredReadBuffersResponse reply, int fd) {
+  BeginInvoke("ReadBuffers", request, ::perfetto::ipc::DeferredBase(std::move(reply)),
+              fd);
+}
+
+void ConsumerPortProxy::FreeBuffers(const FreeBuffersRequest& request, DeferredFreeBuffersResponse reply, int fd) {
+  BeginInvoke("FreeBuffers", request, ::perfetto::ipc::DeferredBase(std::move(reply)),
+              fd);
+}
+
+void ConsumerPortProxy::Flush(const FlushRequest& request, DeferredFlushResponse reply, int fd) {
+  BeginInvoke("Flush", request, ::perfetto::ipc::DeferredBase(std::move(reply)),
+              fd);
+}
+
+void ConsumerPortProxy::StartTracing(const StartTracingRequest& request, DeferredStartTracingResponse reply, int fd) {
+  BeginInvoke("StartTracing", request, ::perfetto::ipc::DeferredBase(std::move(reply)),
+              fd);
+}
+
+void ConsumerPortProxy::ChangeTraceConfig(const ChangeTraceConfigRequest& request, DeferredChangeTraceConfigResponse reply, int fd) {
+  BeginInvoke("ChangeTraceConfig", request, ::perfetto::ipc::DeferredBase(std::move(reply)),
+              fd);
+}
+
+void ConsumerPortProxy::Detach(const DetachRequest& request, DeferredDetachResponse reply, int fd) {
+  BeginInvoke("Detach", request, ::perfetto::ipc::DeferredBase(std::move(reply)),
+              fd);
+}
+
+void ConsumerPortProxy::Attach(const AttachRequest& request, DeferredAttachResponse reply, int fd) {
+  BeginInvoke("Attach", request, ::perfetto::ipc::DeferredBase(std::move(reply)),
+              fd);
+}
+
+void ConsumerPortProxy::GetTraceStats(const GetTraceStatsRequest& request, DeferredGetTraceStatsResponse reply, int fd) {
+  BeginInvoke("GetTraceStats", request, ::perfetto::ipc::DeferredBase(std::move(reply)),
+              fd);
+}
+
+void ConsumerPortProxy::ObserveEvents(const ObserveEventsRequest& request, DeferredObserveEventsResponse reply, int fd) {
+  BeginInvoke("ObserveEvents", request, ::perfetto::ipc::DeferredBase(std::move(reply)),
+              fd);
+}
+
+void ConsumerPortProxy::QueryServiceState(const QueryServiceStateRequest& request, DeferredQueryServiceStateResponse reply, int fd) {
+  BeginInvoke("QueryServiceState", request, ::perfetto::ipc::DeferredBase(std::move(reply)),
+              fd);
+}
+
+void ConsumerPortProxy::QueryCapabilities(const QueryCapabilitiesRequest& request, DeferredQueryCapabilitiesResponse reply, int fd) {
+  BeginInvoke("QueryCapabilities", request, ::perfetto::ipc::DeferredBase(std::move(reply)),
+              fd);
+}
+
+void ConsumerPortProxy::SaveTraceForBugreport(const SaveTraceForBugreportRequest& request, DeferredSaveTraceForBugreportResponse reply, int fd) {
+  BeginInvoke("SaveTraceForBugreport", request, ::perfetto::ipc::DeferredBase(std::move(reply)),
+              fd);
+}
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+// gen_amalgamated begin source: gen/protos/perfetto/ipc/producer_port.ipc.cc
+// gen_amalgamated begin header: gen/protos/perfetto/ipc/producer_port.ipc.h
+// DO NOT EDIT. Autogenerated by Perfetto IPC
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_PRODUCER_PORT_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_PRODUCER_PORT_PROTO_H_
+
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/deferred.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/service.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/service_descriptor.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/service_proxy.h"
+
+// gen_amalgamated expanded: #include "protos/perfetto/ipc/producer_port.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/commit_data_request.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/data_source_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/data_source_descriptor.gen.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class ProducerPort : public ::perfetto::ipc::Service {
+ private:
+  static ::perfetto::ipc::ServiceDescriptor* NewDescriptor();
+
+ public:
+  ~ProducerPort() override;
+
+  static const ::perfetto::ipc::ServiceDescriptor& GetDescriptorStatic();
+
+  // Service implementation.
+  const ::perfetto::ipc::ServiceDescriptor& GetDescriptor() override;
+
+  // Methods from the .proto file
+  using DeferredInitializeConnectionResponse = ::perfetto::ipc::Deferred<InitializeConnectionResponse>;
+  virtual void InitializeConnection(const InitializeConnectionRequest&, DeferredInitializeConnectionResponse) = 0;
+
+  using DeferredRegisterDataSourceResponse = ::perfetto::ipc::Deferred<RegisterDataSourceResponse>;
+  virtual void RegisterDataSource(const RegisterDataSourceRequest&, DeferredRegisterDataSourceResponse) = 0;
+
+  using DeferredUnregisterDataSourceResponse = ::perfetto::ipc::Deferred<UnregisterDataSourceResponse>;
+  virtual void UnregisterDataSource(const UnregisterDataSourceRequest&, DeferredUnregisterDataSourceResponse) = 0;
+
+  using DeferredCommitDataResponse = ::perfetto::ipc::Deferred<CommitDataResponse>;
+  virtual void CommitData(const CommitDataRequest&, DeferredCommitDataResponse) = 0;
+
+  using DeferredGetAsyncCommandResponse = ::perfetto::ipc::Deferred<GetAsyncCommandResponse>;
+  virtual void GetAsyncCommand(const GetAsyncCommandRequest&, DeferredGetAsyncCommandResponse) = 0;
+
+  using DeferredRegisterTraceWriterResponse = ::perfetto::ipc::Deferred<RegisterTraceWriterResponse>;
+  virtual void RegisterTraceWriter(const RegisterTraceWriterRequest&, DeferredRegisterTraceWriterResponse) = 0;
+
+  using DeferredUnregisterTraceWriterResponse = ::perfetto::ipc::Deferred<UnregisterTraceWriterResponse>;
+  virtual void UnregisterTraceWriter(const UnregisterTraceWriterRequest&, DeferredUnregisterTraceWriterResponse) = 0;
+
+  using DeferredNotifyDataSourceStartedResponse = ::perfetto::ipc::Deferred<NotifyDataSourceStartedResponse>;
+  virtual void NotifyDataSourceStarted(const NotifyDataSourceStartedRequest&, DeferredNotifyDataSourceStartedResponse) = 0;
+
+  using DeferredNotifyDataSourceStoppedResponse = ::perfetto::ipc::Deferred<NotifyDataSourceStoppedResponse>;
+  virtual void NotifyDataSourceStopped(const NotifyDataSourceStoppedRequest&, DeferredNotifyDataSourceStoppedResponse) = 0;
+
+  using DeferredActivateTriggersResponse = ::perfetto::ipc::Deferred<ActivateTriggersResponse>;
+  virtual void ActivateTriggers(const ActivateTriggersRequest&, DeferredActivateTriggersResponse) = 0;
+
+  using DeferredSyncResponse = ::perfetto::ipc::Deferred<SyncResponse>;
+  virtual void Sync(const SyncRequest&, DeferredSyncResponse) = 0;
+
+};
+
+
+class ProducerPortProxy : public ::perfetto::ipc::ServiceProxy {
+ public:
+   explicit ProducerPortProxy(::perfetto::ipc::ServiceProxy::EventListener*);
+   ~ProducerPortProxy() override;
+
+  // ServiceProxy implementation.
+  const ::perfetto::ipc::ServiceDescriptor& GetDescriptor() override;
+
+  // Methods from the .proto file
+  using DeferredInitializeConnectionResponse = ::perfetto::ipc::Deferred<InitializeConnectionResponse>;
+  void InitializeConnection(const InitializeConnectionRequest&, DeferredInitializeConnectionResponse, int fd = -1);
+
+  using DeferredRegisterDataSourceResponse = ::perfetto::ipc::Deferred<RegisterDataSourceResponse>;
+  void RegisterDataSource(const RegisterDataSourceRequest&, DeferredRegisterDataSourceResponse, int fd = -1);
+
+  using DeferredUnregisterDataSourceResponse = ::perfetto::ipc::Deferred<UnregisterDataSourceResponse>;
+  void UnregisterDataSource(const UnregisterDataSourceRequest&, DeferredUnregisterDataSourceResponse, int fd = -1);
+
+  using DeferredCommitDataResponse = ::perfetto::ipc::Deferred<CommitDataResponse>;
+  void CommitData(const CommitDataRequest&, DeferredCommitDataResponse, int fd = -1);
+
+  using DeferredGetAsyncCommandResponse = ::perfetto::ipc::Deferred<GetAsyncCommandResponse>;
+  void GetAsyncCommand(const GetAsyncCommandRequest&, DeferredGetAsyncCommandResponse, int fd = -1);
+
+  using DeferredRegisterTraceWriterResponse = ::perfetto::ipc::Deferred<RegisterTraceWriterResponse>;
+  void RegisterTraceWriter(const RegisterTraceWriterRequest&, DeferredRegisterTraceWriterResponse, int fd = -1);
+
+  using DeferredUnregisterTraceWriterResponse = ::perfetto::ipc::Deferred<UnregisterTraceWriterResponse>;
+  void UnregisterTraceWriter(const UnregisterTraceWriterRequest&, DeferredUnregisterTraceWriterResponse, int fd = -1);
+
+  using DeferredNotifyDataSourceStartedResponse = ::perfetto::ipc::Deferred<NotifyDataSourceStartedResponse>;
+  void NotifyDataSourceStarted(const NotifyDataSourceStartedRequest&, DeferredNotifyDataSourceStartedResponse, int fd = -1);
+
+  using DeferredNotifyDataSourceStoppedResponse = ::perfetto::ipc::Deferred<NotifyDataSourceStoppedResponse>;
+  void NotifyDataSourceStopped(const NotifyDataSourceStoppedRequest&, DeferredNotifyDataSourceStoppedResponse, int fd = -1);
+
+  using DeferredActivateTriggersResponse = ::perfetto::ipc::Deferred<ActivateTriggersResponse>;
+  void ActivateTriggers(const ActivateTriggersRequest&, DeferredActivateTriggersResponse, int fd = -1);
+
+  using DeferredSyncResponse = ::perfetto::ipc::Deferred<SyncResponse>;
+  void Sync(const SyncRequest&, DeferredSyncResponse, int fd = -1);
+
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_PRODUCER_PORT_PROTO_H_
+// DO NOT EDIT. Autogenerated by Perfetto IPC
+// gen_amalgamated expanded: #include "protos/perfetto/ipc/producer_port.ipc.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/codegen_helpers.h"
+
+#include <memory>
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+::perfetto::ipc::ServiceDescriptor* ProducerPort::NewDescriptor() {
+  auto* desc = new ::perfetto::ipc::ServiceDescriptor();
+  desc->service_name = "ProducerPort";
+
+  desc->methods.emplace_back(::perfetto::ipc::ServiceDescriptor::Method{
+     "InitializeConnection",
+     &_IPC_Decoder<InitializeConnectionRequest>,
+     &_IPC_Decoder<InitializeConnectionResponse>,
+     &_IPC_Invoker<ProducerPort, InitializeConnectionRequest, InitializeConnectionResponse, &ProducerPort::InitializeConnection>});
+
+  desc->methods.emplace_back(::perfetto::ipc::ServiceDescriptor::Method{
+     "RegisterDataSource",
+     &_IPC_Decoder<RegisterDataSourceRequest>,
+     &_IPC_Decoder<RegisterDataSourceResponse>,
+     &_IPC_Invoker<ProducerPort, RegisterDataSourceRequest, RegisterDataSourceResponse, &ProducerPort::RegisterDataSource>});
+
+  desc->methods.emplace_back(::perfetto::ipc::ServiceDescriptor::Method{
+     "UnregisterDataSource",
+     &_IPC_Decoder<UnregisterDataSourceRequest>,
+     &_IPC_Decoder<UnregisterDataSourceResponse>,
+     &_IPC_Invoker<ProducerPort, UnregisterDataSourceRequest, UnregisterDataSourceResponse, &ProducerPort::UnregisterDataSource>});
+
+  desc->methods.emplace_back(::perfetto::ipc::ServiceDescriptor::Method{
+     "CommitData",
+     &_IPC_Decoder<CommitDataRequest>,
+     &_IPC_Decoder<CommitDataResponse>,
+     &_IPC_Invoker<ProducerPort, CommitDataRequest, CommitDataResponse, &ProducerPort::CommitData>});
+
+  desc->methods.emplace_back(::perfetto::ipc::ServiceDescriptor::Method{
+     "GetAsyncCommand",
+     &_IPC_Decoder<GetAsyncCommandRequest>,
+     &_IPC_Decoder<GetAsyncCommandResponse>,
+     &_IPC_Invoker<ProducerPort, GetAsyncCommandRequest, GetAsyncCommandResponse, &ProducerPort::GetAsyncCommand>});
+
+  desc->methods.emplace_back(::perfetto::ipc::ServiceDescriptor::Method{
+     "RegisterTraceWriter",
+     &_IPC_Decoder<RegisterTraceWriterRequest>,
+     &_IPC_Decoder<RegisterTraceWriterResponse>,
+     &_IPC_Invoker<ProducerPort, RegisterTraceWriterRequest, RegisterTraceWriterResponse, &ProducerPort::RegisterTraceWriter>});
+
+  desc->methods.emplace_back(::perfetto::ipc::ServiceDescriptor::Method{
+     "UnregisterTraceWriter",
+     &_IPC_Decoder<UnregisterTraceWriterRequest>,
+     &_IPC_Decoder<UnregisterTraceWriterResponse>,
+     &_IPC_Invoker<ProducerPort, UnregisterTraceWriterRequest, UnregisterTraceWriterResponse, &ProducerPort::UnregisterTraceWriter>});
+
+  desc->methods.emplace_back(::perfetto::ipc::ServiceDescriptor::Method{
+     "NotifyDataSourceStarted",
+     &_IPC_Decoder<NotifyDataSourceStartedRequest>,
+     &_IPC_Decoder<NotifyDataSourceStartedResponse>,
+     &_IPC_Invoker<ProducerPort, NotifyDataSourceStartedRequest, NotifyDataSourceStartedResponse, &ProducerPort::NotifyDataSourceStarted>});
+
+  desc->methods.emplace_back(::perfetto::ipc::ServiceDescriptor::Method{
+     "NotifyDataSourceStopped",
+     &_IPC_Decoder<NotifyDataSourceStoppedRequest>,
+     &_IPC_Decoder<NotifyDataSourceStoppedResponse>,
+     &_IPC_Invoker<ProducerPort, NotifyDataSourceStoppedRequest, NotifyDataSourceStoppedResponse, &ProducerPort::NotifyDataSourceStopped>});
+
+  desc->methods.emplace_back(::perfetto::ipc::ServiceDescriptor::Method{
+     "ActivateTriggers",
+     &_IPC_Decoder<ActivateTriggersRequest>,
+     &_IPC_Decoder<ActivateTriggersResponse>,
+     &_IPC_Invoker<ProducerPort, ActivateTriggersRequest, ActivateTriggersResponse, &ProducerPort::ActivateTriggers>});
+
+  desc->methods.emplace_back(::perfetto::ipc::ServiceDescriptor::Method{
+     "Sync",
+     &_IPC_Decoder<SyncRequest>,
+     &_IPC_Decoder<SyncResponse>,
+     &_IPC_Invoker<ProducerPort, SyncRequest, SyncResponse, &ProducerPort::Sync>});
+  desc->methods.shrink_to_fit();
+  return desc;
+}
+
+
+const ::perfetto::ipc::ServiceDescriptor& ProducerPort::GetDescriptorStatic() {
+  static auto* instance = NewDescriptor();
+  return *instance;
+}
+
+// Host-side definitions.
+ProducerPort::~ProducerPort() = default;
+
+const ::perfetto::ipc::ServiceDescriptor& ProducerPort::GetDescriptor() {
+  return GetDescriptorStatic();
+}
+
+// Client-side definitions.
+ProducerPortProxy::ProducerPortProxy(::perfetto::ipc::ServiceProxy::EventListener* event_listener)
+    : ::perfetto::ipc::ServiceProxy(event_listener) {}
+
+ProducerPortProxy::~ProducerPortProxy() = default;
+
+const ::perfetto::ipc::ServiceDescriptor& ProducerPortProxy::GetDescriptor() {
+  return ProducerPort::GetDescriptorStatic();
+}
+
+void ProducerPortProxy::InitializeConnection(const InitializeConnectionRequest& request, DeferredInitializeConnectionResponse reply, int fd) {
+  BeginInvoke("InitializeConnection", request, ::perfetto::ipc::DeferredBase(std::move(reply)),
+              fd);
+}
+
+void ProducerPortProxy::RegisterDataSource(const RegisterDataSourceRequest& request, DeferredRegisterDataSourceResponse reply, int fd) {
+  BeginInvoke("RegisterDataSource", request, ::perfetto::ipc::DeferredBase(std::move(reply)),
+              fd);
+}
+
+void ProducerPortProxy::UnregisterDataSource(const UnregisterDataSourceRequest& request, DeferredUnregisterDataSourceResponse reply, int fd) {
+  BeginInvoke("UnregisterDataSource", request, ::perfetto::ipc::DeferredBase(std::move(reply)),
+              fd);
+}
+
+void ProducerPortProxy::CommitData(const CommitDataRequest& request, DeferredCommitDataResponse reply, int fd) {
+  BeginInvoke("CommitData", request, ::perfetto::ipc::DeferredBase(std::move(reply)),
+              fd);
+}
+
+void ProducerPortProxy::GetAsyncCommand(const GetAsyncCommandRequest& request, DeferredGetAsyncCommandResponse reply, int fd) {
+  BeginInvoke("GetAsyncCommand", request, ::perfetto::ipc::DeferredBase(std::move(reply)),
+              fd);
+}
+
+void ProducerPortProxy::RegisterTraceWriter(const RegisterTraceWriterRequest& request, DeferredRegisterTraceWriterResponse reply, int fd) {
+  BeginInvoke("RegisterTraceWriter", request, ::perfetto::ipc::DeferredBase(std::move(reply)),
+              fd);
+}
+
+void ProducerPortProxy::UnregisterTraceWriter(const UnregisterTraceWriterRequest& request, DeferredUnregisterTraceWriterResponse reply, int fd) {
+  BeginInvoke("UnregisterTraceWriter", request, ::perfetto::ipc::DeferredBase(std::move(reply)),
+              fd);
+}
+
+void ProducerPortProxy::NotifyDataSourceStarted(const NotifyDataSourceStartedRequest& request, DeferredNotifyDataSourceStartedResponse reply, int fd) {
+  BeginInvoke("NotifyDataSourceStarted", request, ::perfetto::ipc::DeferredBase(std::move(reply)),
+              fd);
+}
+
+void ProducerPortProxy::NotifyDataSourceStopped(const NotifyDataSourceStoppedRequest& request, DeferredNotifyDataSourceStoppedResponse reply, int fd) {
+  BeginInvoke("NotifyDataSourceStopped", request, ::perfetto::ipc::DeferredBase(std::move(reply)),
+              fd);
+}
+
+void ProducerPortProxy::ActivateTriggers(const ActivateTriggersRequest& request, DeferredActivateTriggersResponse reply, int fd) {
+  BeginInvoke("ActivateTriggers", request, ::perfetto::ipc::DeferredBase(std::move(reply)),
+              fd);
+}
+
+void ProducerPortProxy::Sync(const SyncRequest& request, DeferredSyncResponse reply, int fd) {
+  BeginInvoke("Sync", request, ::perfetto::ipc::DeferredBase(std::move(reply)),
+              fd);
+}
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+// gen_amalgamated begin source: src/tracing/ipc/default_socket.cc
+// gen_amalgamated begin header: include/perfetto/ext/tracing/ipc/default_socket.h
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_TRACING_IPC_DEFAULT_SOCKET_H_
+#define INCLUDE_PERFETTO_EXT_TRACING_IPC_DEFAULT_SOCKET_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+
+PERFETTO_EXPORT const char* GetConsumerSocket();
+PERFETTO_EXPORT const char* GetProducerSocket();
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_TRACING_IPC_DEFAULT_SOCKET_H_
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/ipc/default_socket.h"
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/basic_types.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/basic_types.h"
+
+#include <stdlib.h>
+#include <unistd.h>
+
+namespace perfetto {
+#if !PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+// On non-Android platforms, check /run/perfetto/ before using /tmp/ as the
+// socket base directory.
+namespace {
+const char* kRunPerfettoBaseDir = "/run/perfetto/";
+
+bool UseRunPerfettoBaseDir() {
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) ||   \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+  // Note that the trailing / in |kRunPerfettoBaseDir| ensures we are checking
+  // against a directory, not a file.
+  int res = PERFETTO_EINTR(access(kRunPerfettoBaseDir, X_OK));
+  if (!res)
+    return true;
+
+  // If the path doesn't exist (ENOENT), fail silently to the caller. Otherwise,
+  // fail with an explicit error message.
+  if (errno != ENOENT) {
+    PERFETTO_PLOG("%s exists but cannot be accessed. Falling back on /tmp/ ",
+                  kRunPerfettoBaseDir);
+  }
+  return false;
+#else
+  return false;
+#endif
+}
+
+}  // anonymous namespace
+#endif  // !PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+
+static_assert(kInvalidUid == ipc::kInvalidUid, "kInvalidUid mismatching");
+
+const char* GetProducerSocket() {
+  const char* name = getenv("PERFETTO_PRODUCER_SOCK_NAME");
+  if (name == nullptr) {
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+    name = "127.0.0.1:32278";
+#elif PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+    name = "/dev/socket/traced_producer";
+#else
+    // Use /run/perfetto if it exists. Then fallback to /tmp.
+    static const char* producer_socket =
+        UseRunPerfettoBaseDir() ? "/run/perfetto/traced-producer.sock"
+                                : "/tmp/perfetto-producer";
+    name = producer_socket;
+#endif
+  }
+  return name;
+}
+
+const char* GetConsumerSocket() {
+  const char* name = getenv("PERFETTO_CONSUMER_SOCK_NAME");
+  if (name == nullptr) {
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+    name = "127.0.0.1:32279";
+#elif PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+    name = "/dev/socket/traced_consumer";
+#else
+    // Use /run/perfetto if it exists. Then fallback to /tmp.
+    static const char* consumer_socket =
+        UseRunPerfettoBaseDir() ? "/run/perfetto/traced-consumer.sock"
+                                : "/tmp/perfetto-consumer";
+    name = consumer_socket;
+#endif
+  }
+  return name;
+}
+
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/ipc/memfd.cc
+// gen_amalgamated begin header: src/tracing/ipc/memfd.h
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SRC_TRACING_IPC_MEMFD_H_
+#define SRC_TRACING_IPC_MEMFD_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/scoped_file.h"
+
+// Some android build bots use a sysroot that doesn't support memfd when
+// compiling for the host, so we define the flags we need ourselves.
+
+// from memfd.h
+#ifndef MFD_CLOEXEC
+#define MFD_CLOEXEC 0x0001U
+#define MFD_ALLOW_SEALING 0x0002U
+#endif
+
+// from fcntl.h
+#ifndef F_ADD_SEALS
+#define F_ADD_SEALS 1033
+#define F_GET_SEALS 1034
+#define F_SEAL_SEAL 0x0001
+#define F_SEAL_SHRINK 0x0002
+#define F_SEAL_GROW 0x0004
+#define F_SEAL_WRITE 0x0008
+#endif
+
+namespace perfetto {
+
+// Whether the operating system supports memfd.
+bool HasMemfdSupport();
+
+// Call memfd(2) if available on platform and return the fd as result. This call
+// also makes a kernel version check for safety on older kernels (b/116769556).
+// Returns an invalid ScopedFile on failure.
+base::ScopedFile CreateMemfd(const char* name, unsigned int flags);
+
+}  // namespace perfetto
+
+#endif  // SRC_TRACING_IPC_MEMFD_H_
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "src/tracing/ipc/memfd.h"
+
+#include <errno.h>
+
+#define PERFETTO_MEMFD_ENABLED()             \
+  PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
+      PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX)
+
+#if PERFETTO_MEMFD_ENABLED()
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/syscall.h>
+#include <sys/utsname.h>
+#include <unistd.h>
+
+// Some android build bots use a sysroot that doesn't support memfd when
+// compiling for the host, so we redefine it if necessary.
+#if !defined(__NR_memfd_create)
+#if defined(__x86_64__)
+#define __NR_memfd_create 319
+#elif defined(__i386__)
+#define __NR_memfd_create 356
+#elif defined(__aarch64__)
+#define __NR_memfd_create 279
+#elif defined(__arm__)
+#define __NR_memfd_create 385
+#else
+#error "unsupported sysroot without memfd support"
+#endif
+#endif  // !defined(__NR_memfd_create)
+
+namespace perfetto {
+bool HasMemfdSupport() {
+  static bool kSupportsMemfd = [] {
+    // Check kernel version supports memfd_create(). Some older kernels segfault
+    // executing memfd_create() rather than returning ENOSYS (b/116769556).
+    static constexpr int kRequiredMajor = 3;
+    static constexpr int kRequiredMinor = 17;
+    struct utsname uts;
+    int major, minor;
+    if (uname(&uts) == 0 && strcmp(uts.sysname, "Linux") == 0 &&
+        sscanf(uts.release, "%d.%d", &major, &minor) == 2 &&
+        ((major < kRequiredMajor ||
+          (major == kRequiredMajor && minor < kRequiredMinor)))) {
+      return false;
+    }
+
+    base::ScopedFile fd;
+    fd.reset(static_cast<int>(syscall(__NR_memfd_create, "perfetto_shmem",
+                                      MFD_CLOEXEC | MFD_ALLOW_SEALING)));
+    return !!fd;
+  }();
+  return kSupportsMemfd;
+}
+
+base::ScopedFile CreateMemfd(const char* name, unsigned int flags) {
+  if (!HasMemfdSupport()) {
+    errno = ENOSYS;
+    return base::ScopedFile();
+  }
+  return base::ScopedFile(
+      static_cast<int>(syscall(__NR_memfd_create, name, flags)));
+}
+}  // namespace perfetto
+
+#else  // PERFETTO_MEMFD_ENABLED()
+
+namespace perfetto {
+bool HasMemfdSupport() {
+  return false;
+}
+base::ScopedFile CreateMemfd(const char*, unsigned int) {
+  errno = ENOSYS;
+  return base::ScopedFile();
+}
+}  // namespace perfetto
+
+#endif  // PERFETTO_MEMFD_ENABLED()
+// gen_amalgamated begin source: src/tracing/ipc/posix_shared_memory.cc
+// gen_amalgamated begin header: src/tracing/ipc/posix_shared_memory.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SRC_TRACING_IPC_POSIX_SHARED_MEMORY_H_
+#define SRC_TRACING_IPC_POSIX_SHARED_MEMORY_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) ||   \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+
+#include <stddef.h>
+
+#include <memory>
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/scoped_file.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/shared_memory.h"
+
+namespace perfetto {
+
+// Implements the SharedMemory and its factory for the posix-based transport.
+class PosixSharedMemory : public SharedMemory {
+ public:
+  class Factory : public SharedMemory::Factory {
+   public:
+    ~Factory() override;
+    std::unique_ptr<SharedMemory> CreateSharedMemory(size_t) override;
+  };
+
+  // Create a brand new SHM region.
+  static std::unique_ptr<PosixSharedMemory> Create(size_t size);
+
+  // Mmaps a file descriptor to an existing SHM region. If
+  // |require_seals_if_supported| is true and the system supports
+  // memfd_create(), the FD is required to be a sealed memfd with F_SEAL_SEAL,
+  // F_SEAL_GROW, and F_SEAL_SHRINK seals set (otherwise, nullptr is returned).
+  // May also return nullptr if mapping fails for another reason (e.g. OOM).
+  static std::unique_ptr<PosixSharedMemory> AttachToFd(
+      base::ScopedFile,
+      bool require_seals_if_supported = true);
+
+  ~PosixSharedMemory() override;
+
+  int fd() const { return fd_.get(); }
+
+  // SharedMemory implementation.
+  void* start() const override { return start_; }
+  size_t size() const override { return size_; }
+
+ private:
+  static std::unique_ptr<PosixSharedMemory> MapFD(base::ScopedFile, size_t);
+
+  PosixSharedMemory(void* start, size_t size, base::ScopedFile);
+  PosixSharedMemory(const PosixSharedMemory&) = delete;
+  PosixSharedMemory& operator=(const PosixSharedMemory&) = delete;
+
+  void* const start_;
+  const size_t size_;
+  base::ScopedFile fd_;
+};
+
+}  // namespace perfetto
+
+#endif  // OS_LINUX || OS_ANDROID || OS_APPLE
+#endif  // SRC_TRACING_IPC_POSIX_SHARED_MEMORY_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "src/tracing/ipc/posix_shared_memory.h"
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) ||   \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+
+#include <fcntl.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <memory>
+#include <utility>
+
+// gen_amalgamated expanded: #include "perfetto/base/compiler.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/temp_file.h"
+// gen_amalgamated expanded: #include "src/tracing/ipc/memfd.h"
+
+namespace perfetto {
+
+namespace {
+int kFileSeals = F_SEAL_SHRINK | F_SEAL_GROW | F_SEAL_SEAL;
+}  // namespace
+
+// static
+std::unique_ptr<PosixSharedMemory> PosixSharedMemory::Create(size_t size) {
+  base::ScopedFile fd =
+      CreateMemfd("perfetto_shmem", MFD_CLOEXEC | MFD_ALLOW_SEALING);
+  bool is_memfd = !!fd;
+
+  // In-tree builds only allow mem_fd, so we can inspect the seals to verify the
+  // fd is appropriately sealed. We'll crash in the PERFETTO_CHECK(fd) below if
+  // memfd_create failed.
+#if !PERFETTO_BUILDFLAG(PERFETTO_ANDROID_BUILD)
+  if (!fd) {
+    // TODO: if this fails on Android we should fall back on ashmem.
+    PERFETTO_DPLOG("memfd_create() failed");
+    fd = base::TempFile::CreateUnlinked().ReleaseFD();
+  }
+#endif
+
+  PERFETTO_CHECK(fd);
+  int res = ftruncate(fd.get(), static_cast<off_t>(size));
+  PERFETTO_CHECK(res == 0);
+
+  if (is_memfd) {
+    // When memfd is supported, file seals should be, too.
+    res = fcntl(*fd, F_ADD_SEALS, kFileSeals);
+    PERFETTO_DCHECK(res == 0);
+  }
+
+  return MapFD(std::move(fd), size);
+}
+
+// static
+std::unique_ptr<PosixSharedMemory> PosixSharedMemory::AttachToFd(
+    base::ScopedFile fd,
+    bool require_seals_if_supported) {
+  bool requires_seals = require_seals_if_supported;
+
+#if PERFETTO_BUILDFLAG(PERFETTO_ANDROID_BUILD)
+  // In-tree kernels all support memfd.
+  PERFETTO_CHECK(HasMemfdSupport());
+#else
+  // In out-of-tree builds, we only require seals if the kernel supports memfd.
+  if (requires_seals)
+    requires_seals = HasMemfdSupport();
+#endif
+
+  if (requires_seals) {
+    // If the system supports memfd, we require a sealed memfd.
+    int res = fcntl(*fd, F_GET_SEALS);
+    if (res == -1 || (res & kFileSeals) != kFileSeals) {
+      PERFETTO_PLOG("Couldn't verify file seals on shmem FD");
+      return nullptr;
+    }
+  }
+
+  struct stat stat_buf = {};
+  int res = fstat(fd.get(), &stat_buf);
+  PERFETTO_CHECK(res == 0 && stat_buf.st_size > 0);
+  return MapFD(std::move(fd), static_cast<size_t>(stat_buf.st_size));
+}
+
+// static
+std::unique_ptr<PosixSharedMemory> PosixSharedMemory::MapFD(base::ScopedFile fd,
+                                                            size_t size) {
+  PERFETTO_DCHECK(fd);
+  PERFETTO_DCHECK(size > 0);
+  void* start =
+      mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd.get(), 0);
+  PERFETTO_CHECK(start != MAP_FAILED);
+  return std::unique_ptr<PosixSharedMemory>(
+      new PosixSharedMemory(start, size, std::move(fd)));
+}
+
+PosixSharedMemory::PosixSharedMemory(void* start,
+                                     size_t size,
+                                     base::ScopedFile fd)
+    : start_(start), size_(size), fd_(std::move(fd)) {}
+
+PosixSharedMemory::~PosixSharedMemory() {
+  munmap(start(), size());
+}
+
+PosixSharedMemory::Factory::~Factory() {}
+
+std::unique_ptr<SharedMemory> PosixSharedMemory::Factory::CreateSharedMemory(
+    size_t size) {
+  return PosixSharedMemory::Create(size);
+}
+
+}  // namespace perfetto
+
+#endif  // OS_LINUX || OS_ANDROID || OS_APPLE
+// gen_amalgamated begin source: src/tracing/ipc/consumer/consumer_ipc_client_impl.cc
+// gen_amalgamated begin header: src/tracing/ipc/consumer/consumer_ipc_client_impl.h
+// gen_amalgamated begin header: include/perfetto/ext/tracing/ipc/consumer_ipc_client.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_TRACING_IPC_CONSUMER_IPC_CLIENT_H_
+#define INCLUDE_PERFETTO_EXT_TRACING_IPC_CONSUMER_IPC_CLIENT_H_
+
+#include <memory>
+#include <string>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/tracing_service.h"
+
+namespace perfetto {
+
+class Consumer;
+
+// Allows to connect to a remote Service through a UNIX domain socket.
+// Exposed to:
+//   Consumer(s) of the tracing library.
+// Implemented in:
+//   src/tracing/ipc/consumer/consumer_ipc_client_impl.cc
+class PERFETTO_EXPORT ConsumerIPCClient {
+ public:
+  // Connects to the producer port of the Service listening on the given
+  // |service_sock_name|. If the connection is successful, the OnConnect()
+  // method will be invoked asynchronously on the passed Consumer interface.
+  // If the connection fails, OnDisconnect() will be invoked instead.
+  // The returned ConsumerEndpoint serves also to delimit the scope of the
+  // callbacks invoked on the Consumer interface: no more Consumer callbacks are
+  // invoked immediately after its destruction and any pending callback will be
+  // dropped.
+  static std::unique_ptr<TracingService::ConsumerEndpoint>
+  Connect(const char* service_sock_name, Consumer*, base::TaskRunner*);
+
+ protected:
+  ConsumerIPCClient() = delete;
+};
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_TRACING_IPC_CONSUMER_IPC_CLIENT_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SRC_TRACING_IPC_CONSUMER_CONSUMER_IPC_CLIENT_IMPL_H_
+#define SRC_TRACING_IPC_CONSUMER_CONSUMER_IPC_CLIENT_IMPL_H_
+
+#include <stdint.h>
+
+#include <list>
+#include <vector>
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/scoped_file.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/weak_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/service_proxy.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/basic_types.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/trace_packet.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/tracing_service.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/ipc/consumer_ipc_client.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/forward_decls.h"
+
+// gen_amalgamated expanded: #include "protos/perfetto/ipc/consumer_port.ipc.h"
+
+namespace perfetto {
+
+namespace base {
+class TaskRunner;
+}  // namespace base
+
+namespace ipc {
+class Client;
+}  // namespace ipc
+
+class Consumer;
+
+// Exposes a Service endpoint to Consumer(s), proxying all requests through a
+// IPC channel to the remote Service. This class is the glue layer between the
+// generic Service interface exposed to the clients of the library and the
+// actual IPC transport.
+class ConsumerIPCClientImpl : public TracingService::ConsumerEndpoint,
+                              public ipc::ServiceProxy::EventListener {
+ public:
+  ConsumerIPCClientImpl(const char* service_sock_name,
+                        Consumer*,
+                        base::TaskRunner*);
+  ~ConsumerIPCClientImpl() override;
+
+  // TracingService::ConsumerEndpoint implementation.
+  // These methods are invoked by the actual Consumer(s) code by clients of the
+  // tracing library, which know nothing about the IPC transport.
+  void EnableTracing(const TraceConfig&, base::ScopedFile) override;
+  void StartTracing() override;
+  void ChangeTraceConfig(const TraceConfig&) override;
+  void DisableTracing() override;
+  void ReadBuffers() override;
+  void FreeBuffers() override;
+  void Flush(uint32_t timeout_ms, FlushCallback) override;
+  void Detach(const std::string& key) override;
+  void Attach(const std::string& key) override;
+  void GetTraceStats() override;
+  void ObserveEvents(uint32_t enabled_event_types) override;
+  void QueryServiceState(QueryServiceStateCallback) override;
+  void QueryCapabilities(QueryCapabilitiesCallback) override;
+  void SaveTraceForBugreport(SaveTraceForBugreportCallback) override;
+
+  // ipc::ServiceProxy::EventListener implementation.
+  // These methods are invoked by the IPC layer, which knows nothing about
+  // tracing, consumers and consumers.
+  void OnConnect() override;
+  void OnDisconnect() override;
+
+ private:
+  struct PendingQueryServiceRequest {
+    QueryServiceStateCallback callback;
+
+    // All the replies will be appended here until |has_more| == false.
+    std::vector<uint8_t> merged_resp;
+  };
+
+  // List because we need stable iterators.
+  using PendingQueryServiceRequests = std::list<PendingQueryServiceRequest>;
+
+  void OnReadBuffersResponse(
+      ipc::AsyncResult<protos::gen::ReadBuffersResponse>);
+  void OnEnableTracingResponse(
+      ipc::AsyncResult<protos::gen::EnableTracingResponse>);
+  void OnQueryServiceStateResponse(
+      ipc::AsyncResult<protos::gen::QueryServiceStateResponse>,
+      PendingQueryServiceRequests::iterator);
+
+  // TODO(primiano): think to dtor order, do we rely on any specific sequence?
+  Consumer* const consumer_;
+
+  // The object that owns the client socket and takes care of IPC traffic.
+  std::unique_ptr<ipc::Client> ipc_channel_;
+
+  // The proxy interface for the consumer port of the service. It is bound
+  // to |ipc_channel_| and (de)serializes method invocations over the wire.
+  protos::gen::ConsumerPortProxy consumer_port_;
+
+  bool connected_ = false;
+
+  PendingQueryServiceRequests pending_query_svc_reqs_;
+
+  // When a packet is too big to fit into a ReadBuffersResponse IPC, the service
+  // will chunk it into several IPCs, each containing few slices of the packet
+  // (a packet's slice is always guaranteed to be << kIPCBufferSize). When
+  // chunking happens this field accumulates the slices received until the
+  // one with |last_slice_for_packet| == true is received.
+  TracePacket partial_packet_;
+
+  // Keep last.
+  base::WeakPtrFactory<ConsumerIPCClientImpl> weak_ptr_factory_;
+};
+
+}  // namespace perfetto
+
+#endif  // SRC_TRACING_IPC_CONSUMER_CONSUMER_IPC_CLIENT_IMPL_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "src/tracing/ipc/consumer/consumer_ipc_client_impl.h"
+
+#include <inttypes.h>
+#include <string.h>
+
+// gen_amalgamated expanded: #include "perfetto/base/task_runner.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/client.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/consumer.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/observable_events.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/trace_stats.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/trace_config.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/tracing_service_state.h"
+
+// TODO(fmayer): Add a test to check to what happens when ConsumerIPCClientImpl
+// gets destroyed w.r.t. the Consumer pointer. Also think to lifetime of the
+// Consumer* during the callbacks.
+
+namespace perfetto {
+
+// static. (Declared in include/tracing/ipc/consumer_ipc_client.h).
+std::unique_ptr<TracingService::ConsumerEndpoint> ConsumerIPCClient::Connect(
+    const char* service_sock_name,
+    Consumer* consumer,
+    base::TaskRunner* task_runner) {
+  return std::unique_ptr<TracingService::ConsumerEndpoint>(
+      new ConsumerIPCClientImpl(service_sock_name, consumer, task_runner));
+}
+
+ConsumerIPCClientImpl::ConsumerIPCClientImpl(const char* service_sock_name,
+                                             Consumer* consumer,
+                                             base::TaskRunner* task_runner)
+    : consumer_(consumer),
+      ipc_channel_(
+          ipc::Client::CreateInstance({service_sock_name, /*sock_retry=*/false},
+                                      task_runner)),
+      consumer_port_(this /* event_listener */),
+      weak_ptr_factory_(this) {
+  ipc_channel_->BindService(consumer_port_.GetWeakPtr());
+}
+
+ConsumerIPCClientImpl::~ConsumerIPCClientImpl() = default;
+
+// Called by the IPC layer if the BindService() succeeds.
+void ConsumerIPCClientImpl::OnConnect() {
+  connected_ = true;
+  consumer_->OnConnect();
+}
+
+void ConsumerIPCClientImpl::OnDisconnect() {
+  PERFETTO_DLOG("Tracing service connection failure");
+  connected_ = false;
+  consumer_->OnDisconnect();  // Note: may delete |this|.
+}
+
+void ConsumerIPCClientImpl::EnableTracing(const TraceConfig& trace_config,
+                                          base::ScopedFile fd) {
+  if (!connected_) {
+    PERFETTO_DLOG("Cannot EnableTracing(), not connected to tracing service");
+    return;
+  }
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+  if (fd) {
+    consumer_->OnTracingDisabled(
+        "Passing FDs for write_into_file is not supported on Windows");
+    return;
+  }
+#endif
+
+  protos::gen::EnableTracingRequest req;
+  *req.mutable_trace_config() = trace_config;
+  ipc::Deferred<protos::gen::EnableTracingResponse> async_response;
+  auto weak_this = weak_ptr_factory_.GetWeakPtr();
+  async_response.Bind(
+      [weak_this](
+          ipc::AsyncResult<protos::gen::EnableTracingResponse> response) {
+        if (weak_this)
+          weak_this->OnEnableTracingResponse(std::move(response));
+      });
+
+  // |fd| will be closed when this function returns, but it's fine because the
+  // IPC layer dup()'s it when sending the IPC.
+  consumer_port_.EnableTracing(req, std::move(async_response), *fd);
+}
+
+void ConsumerIPCClientImpl::ChangeTraceConfig(const TraceConfig& trace_config) {
+  if (!connected_) {
+    PERFETTO_DLOG(
+        "Cannot ChangeTraceConfig(), not connected to tracing service");
+    return;
+  }
+
+  ipc::Deferred<protos::gen::ChangeTraceConfigResponse> async_response;
+  async_response.Bind(
+      [](ipc::AsyncResult<protos::gen::ChangeTraceConfigResponse> response) {
+        if (!response)
+          PERFETTO_DLOG("ChangeTraceConfig() failed");
+      });
+  protos::gen::ChangeTraceConfigRequest req;
+  *req.mutable_trace_config() = trace_config;
+  consumer_port_.ChangeTraceConfig(req, std::move(async_response));
+}
+
+void ConsumerIPCClientImpl::StartTracing() {
+  if (!connected_) {
+    PERFETTO_DLOG("Cannot StartTracing(), not connected to tracing service");
+    return;
+  }
+
+  ipc::Deferred<protos::gen::StartTracingResponse> async_response;
+  async_response.Bind(
+      [](ipc::AsyncResult<protos::gen::StartTracingResponse> response) {
+        if (!response)
+          PERFETTO_DLOG("StartTracing() failed");
+      });
+  protos::gen::StartTracingRequest req;
+  consumer_port_.StartTracing(req, std::move(async_response));
+}
+
+void ConsumerIPCClientImpl::DisableTracing() {
+  if (!connected_) {
+    PERFETTO_DLOG("Cannot DisableTracing(), not connected to tracing service");
+    return;
+  }
+
+  ipc::Deferred<protos::gen::DisableTracingResponse> async_response;
+  async_response.Bind(
+      [](ipc::AsyncResult<protos::gen::DisableTracingResponse> response) {
+        if (!response)
+          PERFETTO_DLOG("DisableTracing() failed");
+      });
+  consumer_port_.DisableTracing(protos::gen::DisableTracingRequest(),
+                                std::move(async_response));
+}
+
+void ConsumerIPCClientImpl::ReadBuffers() {
+  if (!connected_) {
+    PERFETTO_DLOG("Cannot ReadBuffers(), not connected to tracing service");
+    return;
+  }
+
+  ipc::Deferred<protos::gen::ReadBuffersResponse> async_response;
+
+  // The IPC layer guarantees that callbacks are destroyed after this object
+  // is destroyed (by virtue of destroying the |consumer_port_|). In turn the
+  // contract of this class expects the caller to not destroy the Consumer class
+  // before having destroyed this class. Hence binding |this| here is safe.
+  async_response.Bind(
+      [this](ipc::AsyncResult<protos::gen::ReadBuffersResponse> response) {
+        OnReadBuffersResponse(std::move(response));
+      });
+  consumer_port_.ReadBuffers(protos::gen::ReadBuffersRequest(),
+                             std::move(async_response));
+}
+
+void ConsumerIPCClientImpl::OnReadBuffersResponse(
+    ipc::AsyncResult<protos::gen::ReadBuffersResponse> response) {
+  if (!response) {
+    PERFETTO_DLOG("ReadBuffers() failed");
+    return;
+  }
+  std::vector<TracePacket> trace_packets;
+  for (auto& resp_slice : response->slices()) {
+    const std::string& slice_data = resp_slice.data();
+    Slice slice = Slice::Allocate(slice_data.size());
+    memcpy(slice.own_data(), slice_data.data(), slice.size);
+    partial_packet_.AddSlice(std::move(slice));
+    if (resp_slice.last_slice_for_packet())
+      trace_packets.emplace_back(std::move(partial_packet_));
+  }
+  if (!trace_packets.empty() || !response.has_more())
+    consumer_->OnTraceData(std::move(trace_packets), response.has_more());
+}
+
+void ConsumerIPCClientImpl::OnEnableTracingResponse(
+    ipc::AsyncResult<protos::gen::EnableTracingResponse> response) {
+  std::string error;
+  // |response| might be empty when the request gets rejected (if the connection
+  // with the service is dropped all outstanding requests are auto-rejected).
+  if (!response) {
+    error =
+        "EnableTracing IPC request rejected. This is likely due to a loss of "
+        "the traced connection";
+  } else {
+    error = response->error();
+  }
+  if (!response || response->disabled())
+    consumer_->OnTracingDisabled(error);
+}
+
+void ConsumerIPCClientImpl::FreeBuffers() {
+  if (!connected_) {
+    PERFETTO_DLOG("Cannot FreeBuffers(), not connected to tracing service");
+    return;
+  }
+
+  protos::gen::FreeBuffersRequest req;
+  ipc::Deferred<protos::gen::FreeBuffersResponse> async_response;
+  async_response.Bind(
+      [](ipc::AsyncResult<protos::gen::FreeBuffersResponse> response) {
+        if (!response)
+          PERFETTO_DLOG("FreeBuffers() failed");
+      });
+  consumer_port_.FreeBuffers(req, std::move(async_response));
+}
+
+void ConsumerIPCClientImpl::Flush(uint32_t timeout_ms, FlushCallback callback) {
+  if (!connected_) {
+    PERFETTO_DLOG("Cannot Flush(), not connected to tracing service");
+    return callback(/*success=*/false);
+  }
+
+  protos::gen::FlushRequest req;
+  req.set_timeout_ms(static_cast<uint32_t>(timeout_ms));
+  ipc::Deferred<protos::gen::FlushResponse> async_response;
+  async_response.Bind(
+      [callback](ipc::AsyncResult<protos::gen::FlushResponse> response) {
+        callback(!!response);
+      });
+  consumer_port_.Flush(req, std::move(async_response));
+}
+
+void ConsumerIPCClientImpl::Detach(const std::string& key) {
+  if (!connected_) {
+    PERFETTO_DLOG("Cannot Detach(), not connected to tracing service");
+    return;
+  }
+
+  protos::gen::DetachRequest req;
+  req.set_key(key);
+  ipc::Deferred<protos::gen::DetachResponse> async_response;
+  auto weak_this = weak_ptr_factory_.GetWeakPtr();
+
+  async_response.Bind(
+      [weak_this](ipc::AsyncResult<protos::gen::DetachResponse> response) {
+        if (weak_this)
+          weak_this->consumer_->OnDetach(!!response);
+      });
+  consumer_port_.Detach(req, std::move(async_response));
+}
+
+void ConsumerIPCClientImpl::Attach(const std::string& key) {
+  if (!connected_) {
+    PERFETTO_DLOG("Cannot Attach(), not connected to tracing service");
+    return;
+  }
+
+  {
+    protos::gen::AttachRequest req;
+    req.set_key(key);
+    ipc::Deferred<protos::gen::AttachResponse> async_response;
+    auto weak_this = weak_ptr_factory_.GetWeakPtr();
+
+    async_response.Bind(
+        [weak_this](ipc::AsyncResult<protos::gen::AttachResponse> response) {
+          if (!weak_this)
+            return;
+          if (!response) {
+            weak_this->consumer_->OnAttach(/*success=*/false, TraceConfig());
+            return;
+          }
+          const TraceConfig& trace_config = response->trace_config();
+
+          // If attached succesfully, also attach to the end-of-trace
+          // notificaton callback, via EnableTracing(attach_notification_only).
+          protos::gen::EnableTracingRequest enable_req;
+          enable_req.set_attach_notification_only(true);
+          ipc::Deferred<protos::gen::EnableTracingResponse> enable_resp;
+          enable_resp.Bind(
+              [weak_this](
+                  ipc::AsyncResult<protos::gen::EnableTracingResponse> resp) {
+                if (weak_this)
+                  weak_this->OnEnableTracingResponse(std::move(resp));
+              });
+          weak_this->consumer_port_.EnableTracing(enable_req,
+                                                  std::move(enable_resp));
+
+          weak_this->consumer_->OnAttach(/*success=*/true, trace_config);
+        });
+    consumer_port_.Attach(req, std::move(async_response));
+  }
+}
+
+void ConsumerIPCClientImpl::GetTraceStats() {
+  if (!connected_) {
+    PERFETTO_DLOG("Cannot GetTraceStats(), not connected to tracing service");
+    return;
+  }
+
+  protos::gen::GetTraceStatsRequest req;
+  ipc::Deferred<protos::gen::GetTraceStatsResponse> async_response;
+
+  // The IPC layer guarantees that callbacks are destroyed after this object
+  // is destroyed (by virtue of destroying the |consumer_port_|). In turn the
+  // contract of this class expects the caller to not destroy the Consumer class
+  // before having destroyed this class. Hence binding |this| here is safe.
+  async_response.Bind(
+      [this](ipc::AsyncResult<protos::gen::GetTraceStatsResponse> response) {
+        if (!response) {
+          consumer_->OnTraceStats(/*success=*/false, TraceStats());
+          return;
+        }
+        consumer_->OnTraceStats(/*success=*/true, response->trace_stats());
+      });
+  consumer_port_.GetTraceStats(req, std::move(async_response));
+}
+
+void ConsumerIPCClientImpl::ObserveEvents(uint32_t enabled_event_types) {
+  if (!connected_) {
+    PERFETTO_DLOG("Cannot ObserveEvents(), not connected to tracing service");
+    return;
+  }
+
+  protos::gen::ObserveEventsRequest req;
+  for (uint32_t i = 0; i < 32; i++) {
+    const uint32_t event_id = 1u << i;
+    if (enabled_event_types & event_id)
+      req.add_events_to_observe(static_cast<ObservableEvents::Type>(event_id));
+  }
+
+  ipc::Deferred<protos::gen::ObserveEventsResponse> async_response;
+  // The IPC layer guarantees that callbacks are destroyed after this object
+  // is destroyed (by virtue of destroying the |consumer_port_|). In turn the
+  // contract of this class expects the caller to not destroy the Consumer class
+  // before having destroyed this class. Hence binding |this| here is safe.
+  async_response.Bind(
+      [this](ipc::AsyncResult<protos::gen::ObserveEventsResponse> response) {
+        // Skip empty response, which the service sends to close the stream.
+        if (!response.has_more()) {
+          PERFETTO_DCHECK(!response.success());
+          return;
+        }
+        consumer_->OnObservableEvents(response->events());
+      });
+  consumer_port_.ObserveEvents(req, std::move(async_response));
+}
+
+void ConsumerIPCClientImpl::QueryServiceState(
+    QueryServiceStateCallback callback) {
+  if (!connected_) {
+    PERFETTO_DLOG(
+        "Cannot QueryServiceState(), not connected to tracing service");
+    return;
+  }
+
+  auto it = pending_query_svc_reqs_.insert(pending_query_svc_reqs_.end(),
+                                           {std::move(callback), {}});
+  protos::gen::QueryServiceStateRequest req;
+  ipc::Deferred<protos::gen::QueryServiceStateResponse> async_response;
+  auto weak_this = weak_ptr_factory_.GetWeakPtr();
+  async_response.Bind(
+      [weak_this,
+       it](ipc::AsyncResult<protos::gen::QueryServiceStateResponse> response) {
+        if (weak_this)
+          weak_this->OnQueryServiceStateResponse(std::move(response), it);
+      });
+  consumer_port_.QueryServiceState(req, std::move(async_response));
+}
+
+void ConsumerIPCClientImpl::OnQueryServiceStateResponse(
+    ipc::AsyncResult<protos::gen::QueryServiceStateResponse> response,
+    PendingQueryServiceRequests::iterator req_it) {
+  PERFETTO_DCHECK(req_it->callback);
+
+  if (!response) {
+    auto callback = std::move(req_it->callback);
+    pending_query_svc_reqs_.erase(req_it);
+    callback(false, TracingServiceState());
+    return;
+  }
+
+  // The QueryServiceState response can be split in several chunks if the
+  // service has several data sources. The client is supposed to merge all the
+  // replies. The easiest way to achieve this is to re-serialize the partial
+  // response and then re-decode the merged result in one shot.
+  std::vector<uint8_t>& merged_resp = req_it->merged_resp;
+  std::vector<uint8_t> part = response->service_state().SerializeAsArray();
+  merged_resp.insert(merged_resp.end(), part.begin(), part.end());
+
+  if (response.has_more())
+    return;
+
+  // All replies have been received. Decode the merged result and reply to the
+  // callback.
+  protos::gen::TracingServiceState svc_state;
+  bool ok = svc_state.ParseFromArray(merged_resp.data(), merged_resp.size());
+  if (!ok)
+    PERFETTO_ELOG("Failed to decode merged QueryServiceStateResponse");
+  auto callback = std::move(req_it->callback);
+  pending_query_svc_reqs_.erase(req_it);
+  callback(ok, std::move(svc_state));
+}
+
+void ConsumerIPCClientImpl::QueryCapabilities(
+    QueryCapabilitiesCallback callback) {
+  if (!connected_) {
+    PERFETTO_DLOG(
+        "Cannot QueryCapabilities(), not connected to tracing service");
+    return;
+  }
+
+  protos::gen::QueryCapabilitiesRequest req;
+  ipc::Deferred<protos::gen::QueryCapabilitiesResponse> async_response;
+  async_response.Bind(
+      [callback](
+          ipc::AsyncResult<protos::gen::QueryCapabilitiesResponse> response) {
+        if (!response) {
+          // If the IPC fails, we are talking to an older version of the service
+          // that didn't support QueryCapabilities at all. In this case return
+          // an empty capabilities message.
+          callback(TracingServiceCapabilities());
+        } else {
+          callback(response->capabilities());
+        }
+      });
+  consumer_port_.QueryCapabilities(req, std::move(async_response));
+}
+
+void ConsumerIPCClientImpl::SaveTraceForBugreport(
+    SaveTraceForBugreportCallback callback) {
+  if (!connected_) {
+    PERFETTO_DLOG(
+        "Cannot SaveTraceForBugreport(), not connected to tracing service");
+    return;
+  }
+
+  protos::gen::SaveTraceForBugreportRequest req;
+  ipc::Deferred<protos::gen::SaveTraceForBugreportResponse> async_response;
+  async_response.Bind(
+      [callback](ipc::AsyncResult<protos::gen::SaveTraceForBugreportResponse>
+                     response) {
+        if (!response) {
+          // If the IPC fails, we are talking to an older version of the service
+          // that didn't support SaveTraceForBugreport at all.
+          callback(
+              false,
+              "The tracing service doesn't support SaveTraceForBugreport()");
+        } else {
+          callback(response->success(), response->msg());
+        }
+      });
+  consumer_port_.SaveTraceForBugreport(req, std::move(async_response));
+}
+
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/ipc/producer/producer_ipc_client_impl.cc
+// gen_amalgamated begin header: src/tracing/ipc/producer/producer_ipc_client_impl.h
+// gen_amalgamated begin header: include/perfetto/ext/tracing/ipc/producer_ipc_client.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_TRACING_IPC_PRODUCER_IPC_CLIENT_H_
+#define INCLUDE_PERFETTO_EXT_TRACING_IPC_PRODUCER_IPC_CLIENT_H_
+
+#include <memory>
+#include <string>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/client.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/shared_memory.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/shared_memory_arbiter.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/tracing_service.h"
+
+namespace perfetto {
+
+class Producer;
+
+// Allows to connect to a remote Service through a UNIX domain socket.
+// Exposed to:
+//   Producer(s) of the tracing library.
+// Implemented in:
+//   src/tracing/ipc/producer/producer_ipc_client_impl.cc
+class PERFETTO_EXPORT ProducerIPCClient {
+ public:
+  enum class ConnectionFlags {
+    // Fails immediately with OnConnect(false) if the service connection cannot
+    // be established.
+    kDefault = 0,
+
+    // Keeps retrying with exponential backoff indefinitely. The caller will
+    // never see an OnConnect(false).
+    kRetryIfUnreachable = 1,
+  };
+
+  // Connects to the producer port of the Service listening on the given
+  // |service_sock_name|. If the connection is successful, the OnConnect()
+  // method will be invoked asynchronously on the passed Producer interface. If
+  // the connection fails, OnDisconnect() will be invoked instead. The returned
+  // ProducerEndpoint serves also to delimit the scope of the callbacks invoked
+  // on the Producer interface: no more Producer callbacks are invoked
+  // immediately after its destruction and any pending callback will be dropped.
+  // To provide a producer-allocated shared memory buffer, both |shm| and
+  // |shm_arbiter| should be set. |shm_arbiter| should be an unbound
+  // SharedMemoryArbiter instance. When |shm| and |shm_arbiter| are provided,
+  // the service will attempt to adopt the provided SMB. If this fails, the
+  // ProducerEndpoint will disconnect, but the SMB and arbiter will remain valid
+  // until the client is destroyed.
+  //
+  // TODO(eseckler): Support adoption failure more gracefully.
+  // TODO(primiano): move all the existing use cases to the Connect(ConnArgs)
+  // below. Also move the functionality of ConnectionFlags into ConnArgs.
+  static std::unique_ptr<TracingService::ProducerEndpoint> Connect(
+      const char* service_sock_name,
+      Producer*,
+      const std::string& producer_name,
+      base::TaskRunner*,
+      TracingService::ProducerSMBScrapingMode smb_scraping_mode =
+          TracingService::ProducerSMBScrapingMode::kDefault,
+      size_t shared_memory_size_hint_bytes = 0,
+      size_t shared_memory_page_size_hint_bytes = 0,
+      std::unique_ptr<SharedMemory> shm = nullptr,
+      std::unique_ptr<SharedMemoryArbiter> shm_arbiter = nullptr,
+      ConnectionFlags = ConnectionFlags::kDefault);
+
+  // Overload of Connect() to support adopting a connected socket using
+  // ipc::Client::ConnArgs.
+  static std::unique_ptr<TracingService::ProducerEndpoint> Connect(
+      ipc::Client::ConnArgs,
+      Producer*,
+      const std::string& producer_name,
+      base::TaskRunner*,
+      TracingService::ProducerSMBScrapingMode smb_scraping_mode =
+          TracingService::ProducerSMBScrapingMode::kDefault,
+      size_t shared_memory_size_hint_bytes = 0,
+      size_t shared_memory_page_size_hint_bytes = 0,
+      std::unique_ptr<SharedMemory> shm = nullptr,
+      std::unique_ptr<SharedMemoryArbiter> shm_arbiter = nullptr);
+
+ protected:
+  ProducerIPCClient() = delete;
+};
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_TRACING_IPC_PRODUCER_IPC_CLIENT_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SRC_TRACING_IPC_PRODUCER_PRODUCER_IPC_CLIENT_IMPL_H_
+#define SRC_TRACING_IPC_PRODUCER_PRODUCER_IPC_CLIENT_IMPL_H_
+
+#include <stdint.h>
+
+#include <set>
+#include <vector>
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/thread_checker.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/client.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/service_proxy.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/basic_types.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/shared_memory.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/tracing_service.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/ipc/producer_ipc_client.h"
+
+// gen_amalgamated expanded: #include "protos/perfetto/ipc/producer_port.ipc.h"
+
+namespace perfetto {
+
+namespace base {
+class TaskRunner;
+}  // namespace base
+
+class Producer;
+class SharedMemoryArbiter;
+
+// Exposes a Service endpoint to Producer(s), proxying all requests through a
+// IPC channel to the remote Service. This class is the glue layer between the
+// generic Service interface exposed to the clients of the library and the
+// actual IPC transport.
+class ProducerIPCClientImpl : public TracingService::ProducerEndpoint,
+                              public ipc::ServiceProxy::EventListener {
+ public:
+  ProducerIPCClientImpl(ipc::Client::ConnArgs,
+                        Producer*,
+                        const std::string& producer_name,
+                        base::TaskRunner*,
+                        TracingService::ProducerSMBScrapingMode,
+                        size_t shared_memory_size_hint_bytes,
+                        size_t shared_memory_page_size_hint_bytes,
+                        std::unique_ptr<SharedMemory> shm,
+                        std::unique_ptr<SharedMemoryArbiter> shm_arbiter);
+  ~ProducerIPCClientImpl() override;
+
+  // TracingService::ProducerEndpoint implementation.
+  // These methods are invoked by the actual Producer(s) code by clients of the
+  // tracing library, which know nothing about the IPC transport.
+  void RegisterDataSource(const DataSourceDescriptor&) override;
+  void UnregisterDataSource(const std::string& name) override;
+  void RegisterTraceWriter(uint32_t writer_id, uint32_t target_buffer) override;
+  void UnregisterTraceWriter(uint32_t writer_id) override;
+  void CommitData(const CommitDataRequest&, CommitDataCallback) override;
+  void NotifyDataSourceStarted(DataSourceInstanceID) override;
+  void NotifyDataSourceStopped(DataSourceInstanceID) override;
+  void ActivateTriggers(const std::vector<std::string>&) override;
+  void Sync(std::function<void()> callback) override;
+
+  std::unique_ptr<TraceWriter> CreateTraceWriter(
+      BufferID target_buffer,
+      BufferExhaustedPolicy) override;
+  SharedMemoryArbiter* MaybeSharedMemoryArbiter() override;
+  bool IsShmemProvidedByProducer() const override;
+  void NotifyFlushComplete(FlushRequestID) override;
+  SharedMemory* shared_memory() const override;
+  size_t shared_buffer_page_size_kb() const override;
+
+  // ipc::ServiceProxy::EventListener implementation.
+  // These methods are invoked by the IPC layer, which knows nothing about
+  // tracing, producers and consumers.
+  void OnConnect() override;
+  void OnDisconnect() override;
+
+  ipc::Client* GetClientForTesting() { return ipc_channel_.get(); }
+
+ private:
+  // Invoked soon after having established the connection with the service.
+  void OnConnectionInitialized(bool connection_succeeded,
+                               bool using_shmem_provided_by_producer,
+                               bool direct_smb_patching_supported);
+
+  // Invoked when the remote Service sends an IPC to tell us to do something
+  // (e.g. start/stop a data source).
+  void OnServiceRequest(const protos::gen::GetAsyncCommandResponse&);
+
+  // TODO think to destruction order, do we rely on any specific dtor sequence?
+  Producer* const producer_;
+  base::TaskRunner* const task_runner_;
+
+  // The object that owns the client socket and takes care of IPC traffic.
+  std::unique_ptr<ipc::Client> ipc_channel_;
+
+  // The proxy interface for the producer port of the service. It is bound
+  // to |ipc_channel_| and (de)serializes method invocations over the wire.
+  protos::gen::ProducerPortProxy producer_port_;
+
+  std::unique_ptr<SharedMemory> shared_memory_;
+  std::unique_ptr<SharedMemoryArbiter> shared_memory_arbiter_;
+  size_t shared_buffer_page_size_kb_ = 0;
+  std::set<DataSourceInstanceID> data_sources_setup_;
+  bool connected_ = false;
+  std::string const name_;
+  size_t shared_memory_page_size_hint_bytes_ = 0;
+  size_t shared_memory_size_hint_bytes_ = 0;
+  TracingService::ProducerSMBScrapingMode const smb_scraping_mode_;
+  bool is_shmem_provided_by_producer_ = false;
+  bool direct_smb_patching_supported_ = false;
+  std::vector<std::function<void()>> pending_sync_reqs_;
+  PERFETTO_THREAD_CHECKER(thread_checker_)
+};
+
+}  // namespace perfetto
+
+#endif  // SRC_TRACING_IPC_PRODUCER_PRODUCER_IPC_CLIENT_IMPL_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "src/tracing/ipc/producer/producer_ipc_client_impl.h"
+
+#include <inttypes.h>
+#include <string.h>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/base/task_runner.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/version.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/client.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/commit_data_request.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/producer.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/shared_memory_arbiter.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/trace_writer.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/data_source_config.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/data_source_descriptor.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/trace_config.h"
+// gen_amalgamated expanded: #include "src/tracing/ipc/posix_shared_memory.h"
+
+// TODO(fmayer): think to what happens when ProducerIPCClientImpl gets destroyed
+// w.r.t. the Producer pointer. Also think to lifetime of the Producer* during
+// the callbacks.
+
+namespace perfetto {
+
+// static. (Declared in include/tracing/ipc/producer_ipc_client.h).
+std::unique_ptr<TracingService::ProducerEndpoint> ProducerIPCClient::Connect(
+    const char* service_sock_name,
+    Producer* producer,
+    const std::string& producer_name,
+    base::TaskRunner* task_runner,
+    TracingService::ProducerSMBScrapingMode smb_scraping_mode,
+    size_t shared_memory_size_hint_bytes,
+    size_t shared_memory_page_size_hint_bytes,
+    std::unique_ptr<SharedMemory> shm,
+    std::unique_ptr<SharedMemoryArbiter> shm_arbiter,
+    ConnectionFlags conn_flags) {
+  return std::unique_ptr<TracingService::ProducerEndpoint>(
+      new ProducerIPCClientImpl(
+          {service_sock_name,
+           conn_flags ==
+               ProducerIPCClient::ConnectionFlags::kRetryIfUnreachable},
+          producer, producer_name, task_runner, smb_scraping_mode,
+          shared_memory_size_hint_bytes, shared_memory_page_size_hint_bytes,
+          std::move(shm), std::move(shm_arbiter)));
+}
+
+// static. (Declared in include/tracing/ipc/producer_ipc_client.h).
+std::unique_ptr<TracingService::ProducerEndpoint> ProducerIPCClient::Connect(
+    ipc::Client::ConnArgs conn_args,
+    Producer* producer,
+    const std::string& producer_name,
+    base::TaskRunner* task_runner,
+    TracingService::ProducerSMBScrapingMode smb_scraping_mode,
+    size_t shared_memory_size_hint_bytes,
+    size_t shared_memory_page_size_hint_bytes,
+    std::unique_ptr<SharedMemory> shm,
+    std::unique_ptr<SharedMemoryArbiter> shm_arbiter) {
+  return std::unique_ptr<TracingService::ProducerEndpoint>(
+      new ProducerIPCClientImpl(std::move(conn_args), producer, producer_name,
+                                task_runner, smb_scraping_mode,
+                                shared_memory_size_hint_bytes,
+                                shared_memory_page_size_hint_bytes,
+                                std::move(shm), std::move(shm_arbiter)));
+}
+
+ProducerIPCClientImpl::ProducerIPCClientImpl(
+    ipc::Client::ConnArgs conn_args,
+    Producer* producer,
+    const std::string& producer_name,
+    base::TaskRunner* task_runner,
+    TracingService::ProducerSMBScrapingMode smb_scraping_mode,
+    size_t shared_memory_size_hint_bytes,
+    size_t shared_memory_page_size_hint_bytes,
+    std::unique_ptr<SharedMemory> shm,
+    std::unique_ptr<SharedMemoryArbiter> shm_arbiter)
+    : producer_(producer),
+      task_runner_(task_runner),
+      ipc_channel_(
+          ipc::Client::CreateInstance(std::move(conn_args), task_runner)),
+      producer_port_(this /* event_listener */),
+      shared_memory_(std::move(shm)),
+      shared_memory_arbiter_(std::move(shm_arbiter)),
+      name_(producer_name),
+      shared_memory_page_size_hint_bytes_(shared_memory_page_size_hint_bytes),
+      shared_memory_size_hint_bytes_(shared_memory_size_hint_bytes),
+      smb_scraping_mode_(smb_scraping_mode) {
+  // Check for producer-provided SMB (used by Chrome for startup tracing).
+  if (shared_memory_) {
+    // We also expect a valid (unbound) arbiter. Bind it to this endpoint now.
+    PERFETTO_CHECK(shared_memory_arbiter_);
+    shared_memory_arbiter_->BindToProducerEndpoint(this, task_runner_);
+
+    // If the service accepts our SMB, then it must match our requested page
+    // layout. The protocol doesn't allow the service to change the size and
+    // layout when the SMB is provided by the producer.
+    shared_buffer_page_size_kb_ = shared_memory_page_size_hint_bytes_ / 1024;
+  }
+
+  ipc_channel_->BindService(producer_port_.GetWeakPtr());
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+}
+
+ProducerIPCClientImpl::~ProducerIPCClientImpl() {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+}
+
+// Called by the IPC layer if the BindService() succeeds.
+void ProducerIPCClientImpl::OnConnect() {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  connected_ = true;
+
+  // The IPC layer guarantees that any outstanding callback will be dropped on
+  // the floor if producer_port_ is destroyed between the request and the reply.
+  // Binding |this| is hence safe.
+  ipc::Deferred<protos::gen::InitializeConnectionResponse> on_init;
+  on_init.Bind(
+      [this](ipc::AsyncResult<protos::gen::InitializeConnectionResponse> resp) {
+        OnConnectionInitialized(
+            resp.success(),
+            resp.success() ? resp->using_shmem_provided_by_producer() : false,
+            resp.success() ? resp->direct_smb_patching_supported() : false);
+      });
+  protos::gen::InitializeConnectionRequest req;
+  req.set_producer_name(name_);
+  req.set_shared_memory_size_hint_bytes(
+      static_cast<uint32_t>(shared_memory_size_hint_bytes_));
+  req.set_shared_memory_page_size_hint_bytes(
+      static_cast<uint32_t>(shared_memory_page_size_hint_bytes_));
+  switch (smb_scraping_mode_) {
+    case TracingService::ProducerSMBScrapingMode::kDefault:
+      // No need to set the mode, it defaults to use the service default if
+      // unspecified.
+      break;
+    case TracingService::ProducerSMBScrapingMode::kEnabled:
+      req.set_smb_scraping_mode(
+          protos::gen::InitializeConnectionRequest::SMB_SCRAPING_ENABLED);
+      break;
+    case TracingService::ProducerSMBScrapingMode::kDisabled:
+      req.set_smb_scraping_mode(
+          protos::gen::InitializeConnectionRequest::SMB_SCRAPING_DISABLED);
+      break;
+  }
+
+  int shm_fd = -1;
+  if (shared_memory_) {
+    shm_fd = static_cast<PosixSharedMemory*>(shared_memory_.get())->fd();
+    req.set_producer_provided_shmem(true);
+  }
+
+#if PERFETTO_DCHECK_IS_ON()
+  req.set_build_flags(
+      protos::gen::InitializeConnectionRequest::BUILD_FLAGS_DCHECKS_ON);
+#else
+  req.set_build_flags(
+      protos::gen::InitializeConnectionRequest::BUILD_FLAGS_DCHECKS_OFF);
+#endif
+  req.set_sdk_version(base::GetVersionString());
+  producer_port_.InitializeConnection(req, std::move(on_init), shm_fd);
+
+  // Create the back channel to receive commands from the Service.
+  ipc::Deferred<protos::gen::GetAsyncCommandResponse> on_cmd;
+  on_cmd.Bind(
+      [this](ipc::AsyncResult<protos::gen::GetAsyncCommandResponse> resp) {
+        if (!resp)
+          return;  // The IPC channel was closed and |resp| was auto-rejected.
+        OnServiceRequest(*resp);
+      });
+  producer_port_.GetAsyncCommand(protos::gen::GetAsyncCommandRequest(),
+                                 std::move(on_cmd));
+
+  // If there are pending Sync() requests, send them now.
+  for (const auto& pending_sync : pending_sync_reqs_)
+    Sync(std::move(pending_sync));
+  pending_sync_reqs_.clear();
+}
+
+void ProducerIPCClientImpl::OnDisconnect() {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  PERFETTO_DLOG("Tracing service connection failure");
+  connected_ = false;
+  data_sources_setup_.clear();
+  producer_->OnDisconnect();  // Note: may delete |this|.
+}
+
+void ProducerIPCClientImpl::OnConnectionInitialized(
+    bool connection_succeeded,
+    bool using_shmem_provided_by_producer,
+    bool direct_smb_patching_supported) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  // If connection_succeeded == false, the OnDisconnect() call will follow next
+  // and there we'll notify the |producer_|. TODO: add a test for this.
+  if (!connection_succeeded)
+    return;
+  is_shmem_provided_by_producer_ = using_shmem_provided_by_producer;
+  direct_smb_patching_supported_ = direct_smb_patching_supported;
+  producer_->OnConnect();
+
+  // Bail out if the service failed to adopt our producer-allocated SMB.
+  // TODO(eseckler): Handle adoption failure more gracefully.
+  if (shared_memory_ && !is_shmem_provided_by_producer_) {
+    PERFETTO_DLOG("Service failed adopt producer-provided SMB, disconnecting.");
+    ipc_channel_.reset();
+    return;
+  }
+}
+
+void ProducerIPCClientImpl::OnServiceRequest(
+    const protos::gen::GetAsyncCommandResponse& cmd) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+
+  // This message is sent only when connecting to a service running Android Q+.
+  // See comment below in kStartDataSource.
+  if (cmd.has_setup_data_source()) {
+    const auto& req = cmd.setup_data_source();
+    const DataSourceInstanceID dsid = req.new_instance_id();
+    data_sources_setup_.insert(dsid);
+    producer_->SetupDataSource(dsid, req.config());
+    return;
+  }
+
+  if (cmd.has_start_data_source()) {
+    const auto& req = cmd.start_data_source();
+    const DataSourceInstanceID dsid = req.new_instance_id();
+    const DataSourceConfig& cfg = req.config();
+    if (!data_sources_setup_.count(dsid)) {
+      // When connecting with an older (Android P) service, the service will not
+      // send a SetupDataSource message. We synthesize it here in that case.
+      producer_->SetupDataSource(dsid, cfg);
+    }
+    producer_->StartDataSource(dsid, cfg);
+    return;
+  }
+
+  if (cmd.has_stop_data_source()) {
+    const DataSourceInstanceID dsid = cmd.stop_data_source().instance_id();
+    producer_->StopDataSource(dsid);
+    data_sources_setup_.erase(dsid);
+    return;
+  }
+
+  if (cmd.has_setup_tracing()) {
+    base::ScopedFile shmem_fd = ipc_channel_->TakeReceivedFD();
+    if (shmem_fd) {
+      // This is the nominal case used in most configurations, where the service
+      // provides the SMB.
+      PERFETTO_CHECK(!is_shmem_provided_by_producer_ && !shared_memory_);
+      // TODO(primiano): handle mmap failure in case of OOM.
+      shared_memory_ =
+          PosixSharedMemory::AttachToFd(std::move(shmem_fd),
+                                        /*require_seals_if_supported=*/false);
+      shared_buffer_page_size_kb_ =
+          cmd.setup_tracing().shared_buffer_page_size_kb();
+      shared_memory_arbiter_ = SharedMemoryArbiter::CreateInstance(
+          shared_memory_.get(), shared_buffer_page_size_kb_ * 1024, this,
+          task_runner_);
+      if (direct_smb_patching_supported_)
+        shared_memory_arbiter_->SetDirectSMBPatchingSupportedByService();
+    } else {
+      // Producer-provided SMB (used by Chrome for startup tracing).
+      PERFETTO_CHECK(is_shmem_provided_by_producer_ && shared_memory_ &&
+                     shared_memory_arbiter_);
+    }
+    producer_->OnTracingSetup();
+    return;
+  }
+
+  if (cmd.has_flush()) {
+    // This cast boilerplate is required only because protobuf uses its own
+    // uint64 and not stdint's uint64_t. On some 64 bit archs they differ on the
+    // type (long vs long long) even though they have the same size.
+    const auto* data_source_ids = cmd.flush().data_source_ids().data();
+    static_assert(sizeof(data_source_ids[0]) == sizeof(DataSourceInstanceID),
+                  "data_source_ids should be 64-bit");
+    producer_->Flush(
+        cmd.flush().request_id(),
+        reinterpret_cast<const DataSourceInstanceID*>(data_source_ids),
+        static_cast<size_t>(cmd.flush().data_source_ids().size()));
+    return;
+  }
+
+  if (cmd.has_clear_incremental_state()) {
+    const auto* data_source_ids =
+        cmd.clear_incremental_state().data_source_ids().data();
+    static_assert(sizeof(data_source_ids[0]) == sizeof(DataSourceInstanceID),
+                  "data_source_ids should be 64-bit");
+    producer_->ClearIncrementalState(
+        reinterpret_cast<const DataSourceInstanceID*>(data_source_ids),
+        static_cast<size_t>(
+            cmd.clear_incremental_state().data_source_ids().size()));
+    return;
+  }
+
+  PERFETTO_DFATAL("Unknown async request received from tracing service");
+}
+
+void ProducerIPCClientImpl::RegisterDataSource(
+    const DataSourceDescriptor& descriptor) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  if (!connected_) {
+    PERFETTO_DLOG(
+        "Cannot RegisterDataSource(), not connected to tracing service");
+  }
+  protos::gen::RegisterDataSourceRequest req;
+  *req.mutable_data_source_descriptor() = descriptor;
+  ipc::Deferred<protos::gen::RegisterDataSourceResponse> async_response;
+  async_response.Bind(
+      [](ipc::AsyncResult<protos::gen::RegisterDataSourceResponse> response) {
+        if (!response)
+          PERFETTO_DLOG("RegisterDataSource() failed: connection reset");
+      });
+  producer_port_.RegisterDataSource(req, std::move(async_response));
+}
+
+void ProducerIPCClientImpl::UnregisterDataSource(const std::string& name) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  if (!connected_) {
+    PERFETTO_DLOG(
+        "Cannot UnregisterDataSource(), not connected to tracing service");
+    return;
+  }
+  protos::gen::UnregisterDataSourceRequest req;
+  req.set_data_source_name(name);
+  producer_port_.UnregisterDataSource(
+      req, ipc::Deferred<protos::gen::UnregisterDataSourceResponse>());
+}
+
+void ProducerIPCClientImpl::RegisterTraceWriter(uint32_t writer_id,
+                                                uint32_t target_buffer) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  if (!connected_) {
+    PERFETTO_DLOG(
+        "Cannot RegisterTraceWriter(), not connected to tracing service");
+    return;
+  }
+  protos::gen::RegisterTraceWriterRequest req;
+  req.set_trace_writer_id(writer_id);
+  req.set_target_buffer(target_buffer);
+  producer_port_.RegisterTraceWriter(
+      req, ipc::Deferred<protos::gen::RegisterTraceWriterResponse>());
+}
+
+void ProducerIPCClientImpl::UnregisterTraceWriter(uint32_t writer_id) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  if (!connected_) {
+    PERFETTO_DLOG(
+        "Cannot UnregisterTraceWriter(), not connected to tracing service");
+    return;
+  }
+  protos::gen::UnregisterTraceWriterRequest req;
+  req.set_trace_writer_id(writer_id);
+  producer_port_.UnregisterTraceWriter(
+      req, ipc::Deferred<protos::gen::UnregisterTraceWriterResponse>());
+}
+
+void ProducerIPCClientImpl::CommitData(const CommitDataRequest& req,
+                                       CommitDataCallback callback) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  if (!connected_) {
+    PERFETTO_DLOG("Cannot CommitData(), not connected to tracing service");
+    return;
+  }
+  ipc::Deferred<protos::gen::CommitDataResponse> async_response;
+  // TODO(primiano): add a test that destroys ProducerIPCClientImpl soon after
+  // this call and checks that the callback is dropped.
+  if (callback) {
+    async_response.Bind(
+        [callback](ipc::AsyncResult<protos::gen::CommitDataResponse> response) {
+          if (!response) {
+            PERFETTO_DLOG("CommitData() failed: connection reset");
+            return;
+          }
+          callback();
+        });
+  }
+  producer_port_.CommitData(req, std::move(async_response));
+}
+
+void ProducerIPCClientImpl::NotifyDataSourceStarted(DataSourceInstanceID id) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  if (!connected_) {
+    PERFETTO_DLOG(
+        "Cannot NotifyDataSourceStarted(), not connected to tracing service");
+    return;
+  }
+  protos::gen::NotifyDataSourceStartedRequest req;
+  req.set_data_source_id(id);
+  producer_port_.NotifyDataSourceStarted(
+      req, ipc::Deferred<protos::gen::NotifyDataSourceStartedResponse>());
+}
+
+void ProducerIPCClientImpl::NotifyDataSourceStopped(DataSourceInstanceID id) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  if (!connected_) {
+    PERFETTO_DLOG(
+        "Cannot NotifyDataSourceStopped(), not connected to tracing service");
+    return;
+  }
+  protos::gen::NotifyDataSourceStoppedRequest req;
+  req.set_data_source_id(id);
+  producer_port_.NotifyDataSourceStopped(
+      req, ipc::Deferred<protos::gen::NotifyDataSourceStoppedResponse>());
+}
+
+void ProducerIPCClientImpl::ActivateTriggers(
+    const std::vector<std::string>& triggers) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  if (!connected_) {
+    PERFETTO_DLOG(
+        "Cannot ActivateTriggers(), not connected to tracing service");
+    return;
+  }
+  protos::gen::ActivateTriggersRequest proto_req;
+  for (const auto& name : triggers) {
+    *proto_req.add_trigger_names() = name;
+  }
+  producer_port_.ActivateTriggers(
+      proto_req, ipc::Deferred<protos::gen::ActivateTriggersResponse>());
+}
+
+void ProducerIPCClientImpl::Sync(std::function<void()> callback) {
+  PERFETTO_DCHECK_THREAD(thread_checker_);
+  if (!connected_) {
+    pending_sync_reqs_.emplace_back(std::move(callback));
+    return;
+  }
+  ipc::Deferred<protos::gen::SyncResponse> resp;
+  resp.Bind([callback](ipc::AsyncResult<protos::gen::SyncResponse>) {
+    // Here we ACK the callback even if the service replies with a failure
+    // (i.e. the service is too old and doesn't understand Sync()). In that
+    // case the service has still seen the request, the IPC roundtrip is
+    // still a (weaker) linearization fence.
+    callback();
+  });
+  producer_port_.Sync(protos::gen::SyncRequest(), std::move(resp));
+}
+
+std::unique_ptr<TraceWriter> ProducerIPCClientImpl::CreateTraceWriter(
+    BufferID target_buffer,
+    BufferExhaustedPolicy buffer_exhausted_policy) {
+  // This method can be called by different threads. |shared_memory_arbiter_| is
+  // thread-safe but be aware of accessing any other state in this function.
+  return shared_memory_arbiter_->CreateTraceWriter(target_buffer,
+                                                   buffer_exhausted_policy);
+}
+
+SharedMemoryArbiter* ProducerIPCClientImpl::MaybeSharedMemoryArbiter() {
+  return shared_memory_arbiter_.get();
+}
+
+bool ProducerIPCClientImpl::IsShmemProvidedByProducer() const {
+  return is_shmem_provided_by_producer_;
+}
+
+void ProducerIPCClientImpl::NotifyFlushComplete(FlushRequestID req_id) {
+  return shared_memory_arbiter_->NotifyFlushComplete(req_id);
+}
+
+SharedMemory* ProducerIPCClientImpl::shared_memory() const {
+  return shared_memory_.get();
+}
+
+size_t ProducerIPCClientImpl::shared_buffer_page_size_kb() const {
+  return shared_buffer_page_size_kb_;
+}
+
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/ipc/service/consumer_ipc_service.cc
+// gen_amalgamated begin header: src/tracing/ipc/service/consumer_ipc_service.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SRC_TRACING_IPC_SERVICE_CONSUMER_IPC_SERVICE_H_
+#define SRC_TRACING_IPC_SERVICE_CONSUMER_IPC_SERVICE_H_
+
+#include <list>
+#include <map>
+#include <memory>
+#include <string>
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/weak_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/basic_types.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/consumer.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/tracing_service.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/forward_decls.h"
+// gen_amalgamated expanded: #include "protos/perfetto/ipc/consumer_port.ipc.h"
+
+namespace perfetto {
+
+namespace ipc {
+class Host;
+}  // namespace ipc
+
+// Implements the Consumer port of the IPC service. This class proxies requests
+// and responses between the core service logic (|svc_|) and remote Consumer(s)
+// on the IPC socket, through the methods overriddden from ConsumerPort.
+class ConsumerIPCService : public protos::gen::ConsumerPort {
+ public:
+  explicit ConsumerIPCService(TracingService* core_service);
+  ~ConsumerIPCService() override;
+
+  // ConsumerPort implementation (from .proto IPC definition).
+  void EnableTracing(const protos::gen::EnableTracingRequest&,
+                     DeferredEnableTracingResponse) override;
+  void StartTracing(const protos::gen::StartTracingRequest&,
+                    DeferredStartTracingResponse) override;
+  void ChangeTraceConfig(const protos::gen::ChangeTraceConfigRequest&,
+                         DeferredChangeTraceConfigResponse) override;
+  void DisableTracing(const protos::gen::DisableTracingRequest&,
+                      DeferredDisableTracingResponse) override;
+  void ReadBuffers(const protos::gen::ReadBuffersRequest&,
+                   DeferredReadBuffersResponse) override;
+  void FreeBuffers(const protos::gen::FreeBuffersRequest&,
+                   DeferredFreeBuffersResponse) override;
+  void Flush(const protos::gen::FlushRequest&, DeferredFlushResponse) override;
+  void Detach(const protos::gen::DetachRequest&,
+              DeferredDetachResponse) override;
+  void Attach(const protos::gen::AttachRequest&,
+              DeferredAttachResponse) override;
+  void GetTraceStats(const protos::gen::GetTraceStatsRequest&,
+                     DeferredGetTraceStatsResponse) override;
+  void ObserveEvents(const protos::gen::ObserveEventsRequest&,
+                     DeferredObserveEventsResponse) override;
+  void QueryServiceState(const protos::gen::QueryServiceStateRequest&,
+                         DeferredQueryServiceStateResponse) override;
+  void QueryCapabilities(const protos::gen::QueryCapabilitiesRequest&,
+                         DeferredQueryCapabilitiesResponse) override;
+  void SaveTraceForBugreport(const protos::gen::SaveTraceForBugreportRequest&,
+                             DeferredSaveTraceForBugreportResponse) override;
+  void OnClientDisconnected() override;
+
+ private:
+  // Acts like a Consumer with the core Service business logic (which doesn't
+  // know anything about the remote transport), but all it does is proxying
+  // methods to the remote Consumer on the other side of the IPC channel.
+  class RemoteConsumer : public Consumer {
+   public:
+    RemoteConsumer();
+    ~RemoteConsumer() override;
+
+    // These methods are called by the |core_service_| business logic. There is
+    // no connection here, these methods are posted straight away.
+    void OnConnect() override;
+    void OnDisconnect() override;
+    void OnTracingDisabled(const std::string& error) override;
+    void OnTraceData(std::vector<TracePacket>, bool has_more) override;
+    void OnDetach(bool) override;
+    void OnAttach(bool, const TraceConfig&) override;
+    void OnTraceStats(bool, const TraceStats&) override;
+    void OnObservableEvents(const ObservableEvents&) override;
+
+    void CloseObserveEventsResponseStream();
+
+    // The interface obtained from the core service business logic through
+    // TracingService::ConnectConsumer(this). This allows to invoke methods for
+    // a specific Consumer on the Service business logic.
+    std::unique_ptr<TracingService::ConsumerEndpoint> service_endpoint;
+
+    // After ReadBuffers() is invoked, this binds the async callback that
+    // allows to stream trace packets back to the client.
+    DeferredReadBuffersResponse read_buffers_response;
+
+    // After EnableTracing() is invoked, this binds the async callback that
+    // allows to send the OnTracingDisabled notification.
+    DeferredEnableTracingResponse enable_tracing_response;
+
+    // After Detach() is invoked, this binds the async callback that allows to
+    // send the session id to the consumer.
+    DeferredDetachResponse detach_response;
+
+    // As above, but for the Attach() case.
+    DeferredAttachResponse attach_response;
+
+    // As above, but for GetTraceStats().
+    DeferredGetTraceStatsResponse get_trace_stats_response;
+
+    // After ObserveEvents() is invoked, this binds the async callback that
+    // allows to stream ObservableEvents back to the client.
+    DeferredObserveEventsResponse observe_events_response;
+  };
+
+  // This has to be a container that doesn't invalidate iterators.
+  using PendingFlushResponses = std::list<DeferredFlushResponse>;
+  using PendingQuerySvcResponses = std::list<DeferredQueryServiceStateResponse>;
+  using PendingQueryCapabilitiesResponses =
+      std::list<DeferredQueryCapabilitiesResponse>;
+  using PendingSaveTraceForBugreportResponses =
+      std::list<DeferredSaveTraceForBugreportResponse>;
+
+  ConsumerIPCService(const ConsumerIPCService&) = delete;
+  ConsumerIPCService& operator=(const ConsumerIPCService&) = delete;
+
+  // Returns the ConsumerEndpoint in the core business logic that corresponds to
+  // the current IPC request.
+  RemoteConsumer* GetConsumerForCurrentRequest();
+
+  void OnFlushCallback(bool success, PendingFlushResponses::iterator);
+  void OnQueryServiceCallback(bool success,
+                              const TracingServiceState&,
+                              PendingQuerySvcResponses::iterator);
+  void OnQueryCapabilitiesCallback(const TracingServiceCapabilities&,
+                                   PendingQueryCapabilitiesResponses::iterator);
+  void OnSaveTraceForBugreportCallback(
+      bool success,
+      const std::string& msg,
+      PendingSaveTraceForBugreportResponses::iterator);
+
+  TracingService* const core_service_;
+
+  // Maps IPC clients to ConsumerEndpoint instances registered on the
+  // |core_service_| business logic.
+  std::map<ipc::ClientID, std::unique_ptr<RemoteConsumer>> consumers_;
+
+  PendingFlushResponses pending_flush_responses_;
+  PendingQuerySvcResponses pending_query_service_responses_;
+  PendingQueryCapabilitiesResponses pending_query_capabilities_responses_;
+  PendingSaveTraceForBugreportResponses pending_bugreport_responses_;
+
+  base::WeakPtrFactory<ConsumerIPCService> weak_ptr_factory_;  // Keep last.
+};
+
+}  // namespace perfetto
+
+#endif  // SRC_TRACING_IPC_SERVICE_CONSUMER_IPC_SERVICE_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "src/tracing/ipc/service/consumer_ipc_service.h"
+
+#include <inttypes.h>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/base/task_runner.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/scoped_file.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/basic_types.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/host.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/shared_memory_abi.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/slice.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/trace_packet.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/trace_stats.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/tracing_service.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/trace_config.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/tracing_service_capabilities.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/tracing_service_state.h"
+
+namespace perfetto {
+
+ConsumerIPCService::ConsumerIPCService(TracingService* core_service)
+    : core_service_(core_service), weak_ptr_factory_(this) {}
+
+ConsumerIPCService::~ConsumerIPCService() = default;
+
+ConsumerIPCService::RemoteConsumer*
+ConsumerIPCService::GetConsumerForCurrentRequest() {
+  const ipc::ClientID ipc_client_id = ipc::Service::client_info().client_id();
+  const uid_t uid = ipc::Service::client_info().uid();
+  PERFETTO_CHECK(ipc_client_id);
+  auto it = consumers_.find(ipc_client_id);
+  if (it == consumers_.end()) {
+    auto* remote_consumer = new RemoteConsumer();
+    consumers_[ipc_client_id].reset(remote_consumer);
+    remote_consumer->service_endpoint =
+        core_service_->ConnectConsumer(remote_consumer, uid);
+    return remote_consumer;
+  }
+  return it->second.get();
+}
+
+// Called by the IPC layer.
+void ConsumerIPCService::OnClientDisconnected() {
+  ipc::ClientID client_id = ipc::Service::client_info().client_id();
+  consumers_.erase(client_id);
+}
+
+// Called by the IPC layer.
+void ConsumerIPCService::EnableTracing(
+    const protos::gen::EnableTracingRequest& req,
+    DeferredEnableTracingResponse resp) {
+  RemoteConsumer* remote_consumer = GetConsumerForCurrentRequest();
+  if (req.attach_notification_only()) {
+    remote_consumer->enable_tracing_response = std::move(resp);
+    return;
+  }
+  const TraceConfig& trace_config = req.trace_config();
+  base::ScopedFile fd;
+  if (trace_config.write_into_file() && trace_config.output_path().empty())
+    fd = ipc::Service::TakeReceivedFD();
+  remote_consumer->service_endpoint->EnableTracing(trace_config, std::move(fd));
+  remote_consumer->enable_tracing_response = std::move(resp);
+}
+
+// Called by the IPC layer.
+void ConsumerIPCService::StartTracing(const protos::gen::StartTracingRequest&,
+                                      DeferredStartTracingResponse resp) {
+  RemoteConsumer* remote_consumer = GetConsumerForCurrentRequest();
+  remote_consumer->service_endpoint->StartTracing();
+  resp.Resolve(ipc::AsyncResult<protos::gen::StartTracingResponse>::Create());
+}
+
+// Called by the IPC layer.
+void ConsumerIPCService::ChangeTraceConfig(
+    const protos::gen::ChangeTraceConfigRequest& req,
+    DeferredChangeTraceConfigResponse resp) {
+  RemoteConsumer* remote_consumer = GetConsumerForCurrentRequest();
+  remote_consumer->service_endpoint->ChangeTraceConfig(req.trace_config());
+  resp.Resolve(
+      ipc::AsyncResult<protos::gen::ChangeTraceConfigResponse>::Create());
+}
+
+// Called by the IPC layer.
+void ConsumerIPCService::DisableTracing(
+    const protos::gen::DisableTracingRequest&,
+    DeferredDisableTracingResponse resp) {
+  GetConsumerForCurrentRequest()->service_endpoint->DisableTracing();
+  resp.Resolve(ipc::AsyncResult<protos::gen::DisableTracingResponse>::Create());
+}
+
+// Called by the IPC layer.
+void ConsumerIPCService::ReadBuffers(const protos::gen::ReadBuffersRequest&,
+                                     DeferredReadBuffersResponse resp) {
+  RemoteConsumer* remote_consumer = GetConsumerForCurrentRequest();
+  remote_consumer->read_buffers_response = std::move(resp);
+  remote_consumer->service_endpoint->ReadBuffers();
+}
+
+// Called by the IPC layer.
+void ConsumerIPCService::FreeBuffers(const protos::gen::FreeBuffersRequest&,
+                                     DeferredFreeBuffersResponse resp) {
+  GetConsumerForCurrentRequest()->service_endpoint->FreeBuffers();
+  resp.Resolve(ipc::AsyncResult<protos::gen::FreeBuffersResponse>::Create());
+}
+
+// Called by the IPC layer.
+void ConsumerIPCService::Flush(const protos::gen::FlushRequest& req,
+                               DeferredFlushResponse resp) {
+  auto it = pending_flush_responses_.insert(pending_flush_responses_.end(),
+                                            std::move(resp));
+  auto weak_this = weak_ptr_factory_.GetWeakPtr();
+  auto callback = [weak_this, it](bool success) {
+    if (weak_this)
+      weak_this->OnFlushCallback(success, std::move(it));
+  };
+  GetConsumerForCurrentRequest()->service_endpoint->Flush(req.timeout_ms(),
+                                                          std::move(callback));
+}
+
+// Called by the IPC layer.
+void ConsumerIPCService::Detach(const protos::gen::DetachRequest& req,
+                                DeferredDetachResponse resp) {
+  // OnDetach() will resolve the |detach_response|.
+  RemoteConsumer* remote_consumer = GetConsumerForCurrentRequest();
+  remote_consumer->detach_response = std::move(resp);
+  remote_consumer->service_endpoint->Detach(req.key());
+}
+
+// Called by the IPC layer.
+void ConsumerIPCService::Attach(const protos::gen::AttachRequest& req,
+                                DeferredAttachResponse resp) {
+  // OnAttach() will resolve the |attach_response|.
+  RemoteConsumer* remote_consumer = GetConsumerForCurrentRequest();
+  remote_consumer->attach_response = std::move(resp);
+  remote_consumer->service_endpoint->Attach(req.key());
+}
+
+// Called by the IPC layer.
+void ConsumerIPCService::GetTraceStats(const protos::gen::GetTraceStatsRequest&,
+                                       DeferredGetTraceStatsResponse resp) {
+  // OnTraceStats() will resolve the |get_trace_stats_response|.
+  RemoteConsumer* remote_consumer = GetConsumerForCurrentRequest();
+  remote_consumer->get_trace_stats_response = std::move(resp);
+  remote_consumer->service_endpoint->GetTraceStats();
+}
+
+// Called by the IPC layer.
+void ConsumerIPCService::ObserveEvents(
+    const protos::gen::ObserveEventsRequest& req,
+    DeferredObserveEventsResponse resp) {
+  RemoteConsumer* remote_consumer = GetConsumerForCurrentRequest();
+
+  // If there's a prior stream, close it so that client can clean it up.
+  remote_consumer->CloseObserveEventsResponseStream();
+
+  remote_consumer->observe_events_response = std::move(resp);
+
+  uint32_t events_mask = 0;
+  for (const auto& type : req.events_to_observe()) {
+    events_mask |= static_cast<uint32_t>(type);
+  }
+  remote_consumer->service_endpoint->ObserveEvents(events_mask);
+
+  // If no events are to be observed, close the stream immediately so that the
+  // client can clean up.
+  if (events_mask == 0)
+    remote_consumer->CloseObserveEventsResponseStream();
+}
+
+// Called by the IPC layer.
+void ConsumerIPCService::QueryServiceState(
+    const protos::gen::QueryServiceStateRequest&,
+    DeferredQueryServiceStateResponse resp) {
+  RemoteConsumer* remote_consumer = GetConsumerForCurrentRequest();
+  auto it = pending_query_service_responses_.insert(
+      pending_query_service_responses_.end(), std::move(resp));
+  auto weak_this = weak_ptr_factory_.GetWeakPtr();
+  auto callback = [weak_this, it](bool success,
+                                  const TracingServiceState& svc_state) {
+    if (weak_this)
+      weak_this->OnQueryServiceCallback(success, svc_state, std::move(it));
+  };
+  remote_consumer->service_endpoint->QueryServiceState(callback);
+}
+
+// Called by the service in response to service_endpoint->QueryServiceState().
+void ConsumerIPCService::OnQueryServiceCallback(
+    bool success,
+    const TracingServiceState& svc_state,
+    PendingQuerySvcResponses::iterator pending_response_it) {
+  DeferredQueryServiceStateResponse response(std::move(*pending_response_it));
+  pending_query_service_responses_.erase(pending_response_it);
+  if (!success) {
+    response.Reject();
+    return;
+  }
+
+  // The TracingServiceState object might be too big to fit into a single IPC
+  // message because it contains the DataSourceDescriptor of each data source.
+  // Here we split it in chunks to fit in the IPC limit, observing the
+  // following rule: each chunk must be invididually a valid TracingServiceState
+  // message; all the chunks concatenated together must form the original
+  // message. This is to deal with the legacy API that was just sending one
+  // whole message (failing in presence of too many data sources, b/153142114).
+  // The message is split as follows: we take the whole TracingServiceState,
+  // take out the data sources section (which is a top-level repeated field)
+  // and re-add them one-by-one. If, in the process of appending, the IPC msg
+  // size is reached, a new chunk is created. This assumes that the rest of
+  // TracingServiceState fits in one IPC message and each DataSourceDescriptor
+  // fits in the worst case in a dedicated message (which is true, because
+  // otherwise the RegisterDataSource() which passes the descriptor in the first
+  // place would fail).
+
+  std::vector<uint8_t> chunked_reply;
+
+  // Transmits the current chunk and starts a new one.
+  bool sent_eof = false;
+  auto send_chunked_reply = [&chunked_reply, &response,
+                             &sent_eof](bool has_more) {
+    PERFETTO_CHECK(!sent_eof);
+    sent_eof = !has_more;
+    auto resp =
+        ipc::AsyncResult<protos::gen::QueryServiceStateResponse>::Create();
+    resp.set_has_more(has_more);
+    PERFETTO_CHECK(resp->mutable_service_state()->ParseFromArray(
+        chunked_reply.data(), chunked_reply.size()));
+    chunked_reply.clear();
+    response.Resolve(std::move(resp));
+  };
+
+  // Create a copy of the whole response and cut away the data_sources section.
+  protos::gen::TracingServiceState svc_state_copy = svc_state;
+  auto data_sources = std::move(*svc_state_copy.mutable_data_sources());
+  chunked_reply = svc_state_copy.SerializeAsArray();
+
+  // Now re-add them fitting within the IPC message limits (- some margin for
+  // the outer IPC frame).
+  constexpr size_t kMaxMsgSize = ipc::kIPCBufferSize - 128;
+  for (const auto& data_source : data_sources) {
+    protos::gen::TracingServiceState tmp;
+    tmp.mutable_data_sources()->emplace_back(std::move(data_source));
+    std::vector<uint8_t> chunk = tmp.SerializeAsArray();
+    if (chunked_reply.size() + chunk.size() < kMaxMsgSize) {
+      chunked_reply.insert(chunked_reply.end(), chunk.begin(), chunk.end());
+    } else {
+      send_chunked_reply(/*has_more=*/true);
+      chunked_reply = std::move(chunk);
+    }
+  }
+
+  PERFETTO_DCHECK(!chunked_reply.empty());
+  send_chunked_reply(/*has_more=*/false);
+  PERFETTO_CHECK(sent_eof);
+}
+
+// Called by the service in response to a service_endpoint->Flush() request.
+void ConsumerIPCService::OnFlushCallback(
+    bool success,
+    PendingFlushResponses::iterator pending_response_it) {
+  DeferredFlushResponse response(std::move(*pending_response_it));
+  pending_flush_responses_.erase(pending_response_it);
+  if (success) {
+    response.Resolve(ipc::AsyncResult<protos::gen::FlushResponse>::Create());
+  } else {
+    response.Reject();
+  }
+}
+
+void ConsumerIPCService::QueryCapabilities(
+    const protos::gen::QueryCapabilitiesRequest&,
+    DeferredQueryCapabilitiesResponse resp) {
+  RemoteConsumer* remote_consumer = GetConsumerForCurrentRequest();
+  auto it = pending_query_capabilities_responses_.insert(
+      pending_query_capabilities_responses_.end(), std::move(resp));
+  auto weak_this = weak_ptr_factory_.GetWeakPtr();
+  auto callback = [weak_this, it](const TracingServiceCapabilities& caps) {
+    if (weak_this)
+      weak_this->OnQueryCapabilitiesCallback(caps, std::move(it));
+  };
+  remote_consumer->service_endpoint->QueryCapabilities(callback);
+}
+
+// Called by the service in response to service_endpoint->QueryCapabilities().
+void ConsumerIPCService::OnQueryCapabilitiesCallback(
+    const TracingServiceCapabilities& caps,
+    PendingQueryCapabilitiesResponses::iterator pending_response_it) {
+  DeferredQueryCapabilitiesResponse response(std::move(*pending_response_it));
+  pending_query_capabilities_responses_.erase(pending_response_it);
+  auto resp =
+      ipc::AsyncResult<protos::gen::QueryCapabilitiesResponse>::Create();
+  *resp->mutable_capabilities() = caps;
+  response.Resolve(std::move(resp));
+}
+
+void ConsumerIPCService::SaveTraceForBugreport(
+    const protos::gen::SaveTraceForBugreportRequest&,
+    DeferredSaveTraceForBugreportResponse resp) {
+  RemoteConsumer* remote_consumer = GetConsumerForCurrentRequest();
+  auto it = pending_bugreport_responses_.insert(
+      pending_bugreport_responses_.end(), std::move(resp));
+  auto weak_this = weak_ptr_factory_.GetWeakPtr();
+  auto callback = [weak_this, it](bool success, const std::string& msg) {
+    if (weak_this)
+      weak_this->OnSaveTraceForBugreportCallback(success, msg, std::move(it));
+  };
+  remote_consumer->service_endpoint->SaveTraceForBugreport(callback);
+}
+
+// Called by the service in response to
+// service_endpoint->SaveTraceForBugreport().
+void ConsumerIPCService::OnSaveTraceForBugreportCallback(
+    bool success,
+    const std::string& msg,
+    PendingSaveTraceForBugreportResponses::iterator pending_response_it) {
+  DeferredSaveTraceForBugreportResponse response(
+      std::move(*pending_response_it));
+  pending_bugreport_responses_.erase(pending_response_it);
+  auto resp =
+      ipc::AsyncResult<protos::gen::SaveTraceForBugreportResponse>::Create();
+  resp->set_success(success);
+  resp->set_msg(msg);
+  response.Resolve(std::move(resp));
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// RemoteConsumer methods
+////////////////////////////////////////////////////////////////////////////////
+
+ConsumerIPCService::RemoteConsumer::RemoteConsumer() = default;
+ConsumerIPCService::RemoteConsumer::~RemoteConsumer() = default;
+
+// Invoked by the |core_service_| business logic after the ConnectConsumer()
+// call. There is nothing to do here, we really expected the ConnectConsumer()
+// to just work in the local case.
+void ConsumerIPCService::RemoteConsumer::OnConnect() {}
+
+// Invoked by the |core_service_| business logic after we destroy the
+// |service_endpoint| (in the RemoteConsumer dtor).
+void ConsumerIPCService::RemoteConsumer::OnDisconnect() {}
+
+void ConsumerIPCService::RemoteConsumer::OnTracingDisabled(
+    const std::string& error) {
+  if (enable_tracing_response.IsBound()) {
+    auto result =
+        ipc::AsyncResult<protos::gen::EnableTracingResponse>::Create();
+    result->set_disabled(true);
+    if (!error.empty())
+      result->set_error(error);
+    enable_tracing_response.Resolve(std::move(result));
+  }
+}
+
+void ConsumerIPCService::RemoteConsumer::OnTraceData(
+    std::vector<TracePacket> trace_packets,
+    bool has_more) {
+  if (!read_buffers_response.IsBound())
+    return;
+
+  auto result = ipc::AsyncResult<protos::gen::ReadBuffersResponse>::Create();
+
+  // A TracePacket might be too big to fit into a single IPC message (max
+  // kIPCBufferSize). However a TracePacket is made of slices and each slice
+  // is way smaller than kIPCBufferSize (a slice size is effectively bounded by
+  // the max chunk size of the SharedMemoryABI). When sending a TracePacket,
+  // if its slices don't fit within one IPC, chunk them over several contiguous
+  // IPCs using the |last_slice_for_packet| for glueing on the other side.
+  static_assert(ipc::kIPCBufferSize >= SharedMemoryABI::kMaxPageSize * 2,
+                "kIPCBufferSize too small given the max possible slice size");
+
+  auto send_ipc_reply = [this, &result](bool more) {
+    result.set_has_more(more);
+    read_buffers_response.Resolve(std::move(result));
+    result = ipc::AsyncResult<protos::gen::ReadBuffersResponse>::Create();
+  };
+
+  size_t approx_reply_size = 0;
+  for (const TracePacket& trace_packet : trace_packets) {
+    size_t num_slices_left_for_packet = trace_packet.slices().size();
+    for (const Slice& slice : trace_packet.slices()) {
+      // Check if this slice would cause the IPC to overflow its max size and,
+      // if that is the case, split the IPCs. The "16" and "64" below are
+      // over-estimations of, respectively:
+      // 16: the preamble that prefixes each slice (there are 2 x size fields
+      //     in the proto + the |last_slice_for_packet| bool).
+      // 64: the overhead of the IPC InvokeMethodReply + wire_protocol's frame.
+      // If these estimations are wrong, BufferedFrameDeserializer::Serialize()
+      // will hit a DCHECK anyways.
+      const size_t approx_slice_size = slice.size + 16;
+      if (approx_reply_size + approx_slice_size > ipc::kIPCBufferSize - 64) {
+        // If we hit this CHECK we got a single slice that is > kIPCBufferSize.
+        PERFETTO_CHECK(result->slices_size() > 0);
+        send_ipc_reply(/*has_more=*/true);
+        approx_reply_size = 0;
+      }
+      approx_reply_size += approx_slice_size;
+
+      auto* res_slice = result->add_slices();
+      res_slice->set_last_slice_for_packet(--num_slices_left_for_packet == 0);
+      res_slice->set_data(slice.start, slice.size);
+    }
+  }
+  send_ipc_reply(has_more);
+}
+
+void ConsumerIPCService::RemoteConsumer::OnDetach(bool success) {
+  if (!success) {
+    std::move(detach_response).Reject();
+    return;
+  }
+  auto resp = ipc::AsyncResult<protos::gen::DetachResponse>::Create();
+  std::move(detach_response).Resolve(std::move(resp));
+}
+
+void ConsumerIPCService::RemoteConsumer::OnAttach(
+    bool success,
+    const TraceConfig& trace_config) {
+  if (!success) {
+    std::move(attach_response).Reject();
+    return;
+  }
+  auto response = ipc::AsyncResult<protos::gen::AttachResponse>::Create();
+  *response->mutable_trace_config() = trace_config;
+  std::move(attach_response).Resolve(std::move(response));
+}
+
+void ConsumerIPCService::RemoteConsumer::OnTraceStats(bool success,
+                                                      const TraceStats& stats) {
+  if (!success) {
+    std::move(get_trace_stats_response).Reject();
+    return;
+  }
+  auto response =
+      ipc::AsyncResult<protos::gen::GetTraceStatsResponse>::Create();
+  *response->mutable_trace_stats() = stats;
+  std::move(get_trace_stats_response).Resolve(std::move(response));
+}
+
+void ConsumerIPCService::RemoteConsumer::OnObservableEvents(
+    const ObservableEvents& events) {
+  if (!observe_events_response.IsBound())
+    return;
+
+  auto result = ipc::AsyncResult<protos::gen::ObserveEventsResponse>::Create();
+  result.set_has_more(true);
+  *result->mutable_events() = events;
+  observe_events_response.Resolve(std::move(result));
+}
+
+void ConsumerIPCService::RemoteConsumer::CloseObserveEventsResponseStream() {
+  if (!observe_events_response.IsBound())
+    return;
+
+  auto result = ipc::AsyncResult<protos::gen::ObserveEventsResponse>::Create();
+  result.set_has_more(false);
+  observe_events_response.Resolve(std::move(result));
+}
+
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/ipc/service/producer_ipc_service.cc
+// gen_amalgamated begin header: src/tracing/ipc/service/producer_ipc_service.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SRC_TRACING_IPC_SERVICE_PRODUCER_IPC_SERVICE_H_
+#define SRC_TRACING_IPC_SERVICE_PRODUCER_IPC_SERVICE_H_
+
+#include <list>
+#include <map>
+#include <memory>
+#include <string>
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/weak_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/basic_types.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/producer.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/tracing_service.h"
+
+// gen_amalgamated expanded: #include "protos/perfetto/ipc/producer_port.ipc.h"
+
+namespace perfetto {
+
+namespace ipc {
+class Host;
+}  // namespace ipc
+
+// Implements the Producer port of the IPC service. This class proxies requests
+// and responses between the core service logic (|svc_|) and remote Producer(s)
+// on the IPC socket, through the methods overriddden from ProducerPort.
+class ProducerIPCService : public protos::gen::ProducerPort {
+ public:
+  explicit ProducerIPCService(TracingService* core_service);
+  ~ProducerIPCService() override;
+
+  // ProducerPort implementation (from .proto IPC definition).
+  void InitializeConnection(const protos::gen::InitializeConnectionRequest&,
+                            DeferredInitializeConnectionResponse) override;
+  void RegisterDataSource(const protos::gen::RegisterDataSourceRequest&,
+                          DeferredRegisterDataSourceResponse) override;
+  void UnregisterDataSource(const protos::gen::UnregisterDataSourceRequest&,
+                            DeferredUnregisterDataSourceResponse) override;
+  void RegisterTraceWriter(const protos::gen::RegisterTraceWriterRequest&,
+                           DeferredRegisterTraceWriterResponse) override;
+  void UnregisterTraceWriter(const protos::gen::UnregisterTraceWriterRequest&,
+                             DeferredUnregisterTraceWriterResponse) override;
+  void CommitData(const protos::gen::CommitDataRequest&,
+                  DeferredCommitDataResponse) override;
+  void NotifyDataSourceStarted(
+      const protos::gen::NotifyDataSourceStartedRequest&,
+      DeferredNotifyDataSourceStartedResponse) override;
+  void NotifyDataSourceStopped(
+      const protos::gen::NotifyDataSourceStoppedRequest&,
+      DeferredNotifyDataSourceStoppedResponse) override;
+  void ActivateTriggers(const protos::gen::ActivateTriggersRequest&,
+                        DeferredActivateTriggersResponse) override;
+
+  void GetAsyncCommand(const protos::gen::GetAsyncCommandRequest&,
+                       DeferredGetAsyncCommandResponse) override;
+  void Sync(const protos::gen::SyncRequest&, DeferredSyncResponse) override;
+  void OnClientDisconnected() override;
+
+ private:
+  // Acts like a Producer with the core Service business logic (which doesn't
+  // know anything about the remote transport), but all it does is proxying
+  // methods to the remote Producer on the other side of the IPC channel.
+  class RemoteProducer : public Producer {
+   public:
+    RemoteProducer();
+    ~RemoteProducer() override;
+
+    // These methods are called by the |core_service_| business logic. There is
+    // no connection here, these methods are posted straight away.
+    void OnConnect() override;
+    void OnDisconnect() override;
+    void SetupDataSource(DataSourceInstanceID,
+                         const DataSourceConfig&) override;
+    void StartDataSource(DataSourceInstanceID,
+                         const DataSourceConfig&) override;
+    void StopDataSource(DataSourceInstanceID) override;
+    void OnTracingSetup() override;
+    void Flush(FlushRequestID,
+               const DataSourceInstanceID* data_source_ids,
+               size_t num_data_sources) override;
+
+    void ClearIncrementalState(const DataSourceInstanceID* data_source_ids,
+                               size_t num_data_sources) override;
+
+    void SendSetupTracing();
+
+    // The interface obtained from the core service business logic through
+    // Service::ConnectProducer(this). This allows to invoke methods for a
+    // specific Producer on the Service business logic.
+    std::unique_ptr<TracingService::ProducerEndpoint> service_endpoint;
+
+    // The back-channel (based on a never ending stream request) that allows us
+    // to send asynchronous commands to the remote Producer (e.g. start/stop a
+    // data source).
+    DeferredGetAsyncCommandResponse async_producer_commands;
+
+    // Set if the service calls OnTracingSetup() before the
+    // |async_producer_commands| was bound by the service. In this case, we
+    // forward the SetupTracing command when it is bound later.
+    bool send_setup_tracing_on_async_commands_bound = false;
+  };
+
+  ProducerIPCService(const ProducerIPCService&) = delete;
+  ProducerIPCService& operator=(const ProducerIPCService&) = delete;
+
+  // Returns the ProducerEndpoint in the core business logic that corresponds to
+  // the current IPC request.
+  RemoteProducer* GetProducerForCurrentRequest();
+
+  TracingService* const core_service_;
+
+  // Maps IPC clients to ProducerEndpoint instances registered on the
+  // |core_service_| business logic.
+  std::map<ipc::ClientID, std::unique_ptr<RemoteProducer>> producers_;
+
+  // List because pointers need to be stable.
+  std::list<DeferredSyncResponse> pending_syncs_;
+
+  base::WeakPtrFactory<ProducerIPCService> weak_ptr_factory_;  // Keep last.
+};
+
+}  // namespace perfetto
+
+#endif  // SRC_TRACING_IPC_SERVICE_PRODUCER_IPC_SERVICE_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "src/tracing/ipc/service/producer_ipc_service.h"
+
+#include <inttypes.h>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/base/task_runner.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/host.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/service.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/commit_data_request.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/tracing_service.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/data_source_config.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/data_source_descriptor.h"
+// gen_amalgamated expanded: #include "src/tracing/ipc/posix_shared_memory.h"
+
+// The remote Producer(s) are not trusted. All the methods from the ProducerPort
+// IPC layer (e.g. RegisterDataSource()) must assume that the remote Producer is
+// compromised.
+
+namespace perfetto {
+
+ProducerIPCService::ProducerIPCService(TracingService* core_service)
+    : core_service_(core_service), weak_ptr_factory_(this) {}
+
+ProducerIPCService::~ProducerIPCService() = default;
+
+ProducerIPCService::RemoteProducer*
+ProducerIPCService::GetProducerForCurrentRequest() {
+  const ipc::ClientID ipc_client_id = ipc::Service::client_info().client_id();
+  PERFETTO_CHECK(ipc_client_id);
+  auto it = producers_.find(ipc_client_id);
+  if (it == producers_.end())
+    return nullptr;
+  return it->second.get();
+}
+
+// Called by the remote Producer through the IPC channel soon after connecting.
+void ProducerIPCService::InitializeConnection(
+    const protos::gen::InitializeConnectionRequest& req,
+    DeferredInitializeConnectionResponse response) {
+  const auto& client_info = ipc::Service::client_info();
+  const ipc::ClientID ipc_client_id = client_info.client_id();
+  PERFETTO_CHECK(ipc_client_id);
+
+  if (producers_.count(ipc_client_id) > 0) {
+    PERFETTO_DLOG(
+        "The remote Producer is trying to re-initialize the connection");
+    return response.Reject();
+  }
+
+  // Create a new entry.
+  std::unique_ptr<RemoteProducer> producer(new RemoteProducer());
+
+  TracingService::ProducerSMBScrapingMode smb_scraping_mode =
+      TracingService::ProducerSMBScrapingMode::kDefault;
+  switch (req.smb_scraping_mode()) {
+    case protos::gen::InitializeConnectionRequest::SMB_SCRAPING_UNSPECIFIED:
+      break;
+    case protos::gen::InitializeConnectionRequest::SMB_SCRAPING_DISABLED:
+      smb_scraping_mode = TracingService::ProducerSMBScrapingMode::kDisabled;
+      break;
+    case protos::gen::InitializeConnectionRequest::SMB_SCRAPING_ENABLED:
+      smb_scraping_mode = TracingService::ProducerSMBScrapingMode::kEnabled;
+      break;
+  }
+
+#if PERFETTO_DCHECK_IS_ON()
+  if (req.build_flags() ==
+      protos::gen::InitializeConnectionRequest::BUILD_FLAGS_DCHECKS_OFF) {
+    PERFETTO_LOG(
+        "The producer is built with NDEBUG but the service binary was built "
+        "with the DEBUG flag. This will likely cause crashes.");
+    // The other way round (DEBUG producer with NDEBUG service) is expected to
+    // work.
+  }
+#endif
+
+  // If the producer provided an SMB, tell the service to attempt to adopt it.
+  std::unique_ptr<SharedMemory> shmem;
+  if (req.producer_provided_shmem()) {
+    base::ScopedFile shmem_fd = ipc::Service::TakeReceivedFD();
+    if (shmem_fd) {
+      shmem = PosixSharedMemory::AttachToFd(
+          std::move(shmem_fd), /*require_seals_if_supported=*/true);
+      if (!shmem) {
+        PERFETTO_ELOG(
+            "Couldn't map producer-provided SMB, falling back to "
+            "service-provided SMB");
+      }
+    } else {
+      PERFETTO_DLOG(
+          "InitializeConnectionRequest's producer_provided_shmem flag is set "
+          "but the producer didn't provide an FD");
+    }
+  }
+
+  // ConnectProducer will call OnConnect() on the next task.
+  producer->service_endpoint = core_service_->ConnectProducer(
+      producer.get(), client_info.uid(), req.producer_name(),
+      req.shared_memory_size_hint_bytes(),
+      /*in_process=*/false, smb_scraping_mode,
+      req.shared_memory_page_size_hint_bytes(), std::move(shmem),
+      req.sdk_version());
+
+  // Could happen if the service has too many producers connected.
+  if (!producer->service_endpoint) {
+    response.Reject();
+    return;
+  }
+
+  bool using_producer_shmem =
+      producer->service_endpoint->IsShmemProvidedByProducer();
+
+  producers_.emplace(ipc_client_id, std::move(producer));
+  // Because of the std::move() |producer| is invalid after this point.
+
+  auto async_res =
+      ipc::AsyncResult<protos::gen::InitializeConnectionResponse>::Create();
+  async_res->set_using_shmem_provided_by_producer(using_producer_shmem);
+  async_res->set_direct_smb_patching_supported(true);
+  response.Resolve(std::move(async_res));
+}
+
+// Called by the remote Producer through the IPC channel.
+void ProducerIPCService::RegisterDataSource(
+    const protos::gen::RegisterDataSourceRequest& req,
+    DeferredRegisterDataSourceResponse response) {
+  RemoteProducer* producer = GetProducerForCurrentRequest();
+  if (!producer) {
+    PERFETTO_DLOG(
+        "Producer invoked RegisterDataSource() before InitializeConnection()");
+    if (response.IsBound())
+      response.Reject();
+    return;
+  }
+
+  const DataSourceDescriptor& dsd = req.data_source_descriptor();
+  GetProducerForCurrentRequest()->service_endpoint->RegisterDataSource(dsd);
+
+  // RegisterDataSource doesn't expect any meaningful response.
+  if (response.IsBound()) {
+    response.Resolve(
+        ipc::AsyncResult<protos::gen::RegisterDataSourceResponse>::Create());
+  }
+}
+
+// Called by the IPC layer.
+void ProducerIPCService::OnClientDisconnected() {
+  ipc::ClientID client_id = ipc::Service::client_info().client_id();
+  PERFETTO_DLOG("Client %" PRIu64 " disconnected", client_id);
+  producers_.erase(client_id);
+}
+
+// TODO(fmayer): test what happens if we receive the following tasks, in order:
+// RegisterDataSource, UnregisterDataSource, OnDataSourceRegistered.
+// which essentially means that the client posted back to back a
+// ReqisterDataSource and UnregisterDataSource speculating on the next id.
+// Called by the remote Service through the IPC channel.
+void ProducerIPCService::UnregisterDataSource(
+    const protos::gen::UnregisterDataSourceRequest& req,
+    DeferredUnregisterDataSourceResponse response) {
+  RemoteProducer* producer = GetProducerForCurrentRequest();
+  if (!producer) {
+    PERFETTO_DLOG(
+        "Producer invoked UnregisterDataSource() before "
+        "InitializeConnection()");
+    if (response.IsBound())
+      response.Reject();
+    return;
+  }
+  producer->service_endpoint->UnregisterDataSource(req.data_source_name());
+
+  // UnregisterDataSource doesn't expect any meaningful response.
+  if (response.IsBound()) {
+    response.Resolve(
+        ipc::AsyncResult<protos::gen::UnregisterDataSourceResponse>::Create());
+  }
+}
+
+void ProducerIPCService::RegisterTraceWriter(
+    const protos::gen::RegisterTraceWriterRequest& req,
+    DeferredRegisterTraceWriterResponse response) {
+  RemoteProducer* producer = GetProducerForCurrentRequest();
+  if (!producer) {
+    PERFETTO_DLOG(
+        "Producer invoked RegisterTraceWriter() before "
+        "InitializeConnection()");
+    if (response.IsBound())
+      response.Reject();
+    return;
+  }
+  producer->service_endpoint->RegisterTraceWriter(req.trace_writer_id(),
+                                                  req.target_buffer());
+
+  // RegisterTraceWriter doesn't expect any meaningful response.
+  if (response.IsBound()) {
+    response.Resolve(
+        ipc::AsyncResult<protos::gen::RegisterTraceWriterResponse>::Create());
+  }
+}
+
+void ProducerIPCService::UnregisterTraceWriter(
+    const protos::gen::UnregisterTraceWriterRequest& req,
+    DeferredUnregisterTraceWriterResponse response) {
+  RemoteProducer* producer = GetProducerForCurrentRequest();
+  if (!producer) {
+    PERFETTO_DLOG(
+        "Producer invoked UnregisterTraceWriter() before "
+        "InitializeConnection()");
+    if (response.IsBound())
+      response.Reject();
+    return;
+  }
+  producer->service_endpoint->UnregisterTraceWriter(req.trace_writer_id());
+
+  // UnregisterTraceWriter doesn't expect any meaningful response.
+  if (response.IsBound()) {
+    response.Resolve(
+        ipc::AsyncResult<protos::gen::UnregisterTraceWriterResponse>::Create());
+  }
+}
+
+void ProducerIPCService::CommitData(const protos::gen::CommitDataRequest& req,
+                                    DeferredCommitDataResponse resp) {
+  RemoteProducer* producer = GetProducerForCurrentRequest();
+  if (!producer) {
+    PERFETTO_DLOG(
+        "Producer invoked CommitData() before InitializeConnection()");
+    if (resp.IsBound())
+      resp.Reject();
+    return;
+  }
+
+  // We don't want to send a response if the client didn't attach a callback to
+  // the original request. Doing so would generate unnecessary wakeups and
+  // context switches.
+  std::function<void()> callback;
+  if (resp.IsBound()) {
+    // Capturing |resp| by reference here speculates on the fact that
+    // CommitData() in tracing_service_impl.cc invokes the passed callback
+    // inline, without posting it. If that assumption changes this code needs to
+    // wrap the response in a shared_ptr (C+11 lambdas don't support move) and
+    // use a weak ptr in the caller.
+    callback = [&resp] {
+      resp.Resolve(ipc::AsyncResult<protos::gen::CommitDataResponse>::Create());
+    };
+  }
+  producer->service_endpoint->CommitData(req, callback);
+}
+
+void ProducerIPCService::NotifyDataSourceStarted(
+    const protos::gen::NotifyDataSourceStartedRequest& request,
+    DeferredNotifyDataSourceStartedResponse response) {
+  RemoteProducer* producer = GetProducerForCurrentRequest();
+  if (!producer) {
+    PERFETTO_DLOG(
+        "Producer invoked NotifyDataSourceStarted() before "
+        "InitializeConnection()");
+    if (response.IsBound())
+      response.Reject();
+    return;
+  }
+  producer->service_endpoint->NotifyDataSourceStarted(request.data_source_id());
+
+  // NotifyDataSourceStopped shouldn't expect any meaningful response, avoid
+  // a useless IPC in that case.
+  if (response.IsBound()) {
+    response.Resolve(ipc::AsyncResult<
+                     protos::gen::NotifyDataSourceStartedResponse>::Create());
+  }
+}
+
+void ProducerIPCService::NotifyDataSourceStopped(
+    const protos::gen::NotifyDataSourceStoppedRequest& request,
+    DeferredNotifyDataSourceStoppedResponse response) {
+  RemoteProducer* producer = GetProducerForCurrentRequest();
+  if (!producer) {
+    PERFETTO_DLOG(
+        "Producer invoked NotifyDataSourceStopped() before "
+        "InitializeConnection()");
+    if (response.IsBound())
+      response.Reject();
+    return;
+  }
+  producer->service_endpoint->NotifyDataSourceStopped(request.data_source_id());
+
+  // NotifyDataSourceStopped shouldn't expect any meaningful response, avoid
+  // a useless IPC in that case.
+  if (response.IsBound()) {
+    response.Resolve(ipc::AsyncResult<
+                     protos::gen::NotifyDataSourceStoppedResponse>::Create());
+  }
+}
+
+void ProducerIPCService::ActivateTriggers(
+    const protos::gen::ActivateTriggersRequest& proto_req,
+    DeferredActivateTriggersResponse resp) {
+  RemoteProducer* producer = GetProducerForCurrentRequest();
+  if (!producer) {
+    PERFETTO_DLOG(
+        "Producer invoked ActivateTriggers() before InitializeConnection()");
+    if (resp.IsBound())
+      resp.Reject();
+    return;
+  }
+  std::vector<std::string> triggers;
+  for (const auto& name : proto_req.trigger_names()) {
+    triggers.push_back(name);
+  }
+  producer->service_endpoint->ActivateTriggers(triggers);
+  // ActivateTriggers shouldn't expect any meaningful response, avoid
+  // a useless IPC in that case.
+  if (resp.IsBound()) {
+    resp.Resolve(
+        ipc::AsyncResult<protos::gen::ActivateTriggersResponse>::Create());
+  }
+}
+
+void ProducerIPCService::GetAsyncCommand(
+    const protos::gen::GetAsyncCommandRequest&,
+    DeferredGetAsyncCommandResponse response) {
+  RemoteProducer* producer = GetProducerForCurrentRequest();
+  if (!producer) {
+    PERFETTO_DLOG(
+        "Producer invoked GetAsyncCommand() before "
+        "InitializeConnection()");
+    return response.Reject();
+  }
+  // Keep the back channel open, without ever resolving the ipc::Deferred fully,
+  // to send async commands to the RemoteProducer (e.g., starting/stopping a
+  // data source).
+  producer->async_producer_commands = std::move(response);
+
+  // Service may already have issued the OnTracingSetup() event, in which case
+  // we should forward it to the producer now.
+  if (producer->send_setup_tracing_on_async_commands_bound)
+    producer->SendSetupTracing();
+}
+
+void ProducerIPCService::Sync(const protos::gen::SyncRequest&,
+                              DeferredSyncResponse resp) {
+  RemoteProducer* producer = GetProducerForCurrentRequest();
+  if (!producer) {
+    PERFETTO_DLOG("Producer invoked Sync() before InitializeConnection()");
+    return resp.Reject();
+  }
+  auto weak_this = weak_ptr_factory_.GetWeakPtr();
+  auto resp_it = pending_syncs_.insert(pending_syncs_.end(), std::move(resp));
+  auto callback = [weak_this, resp_it]() {
+    if (!weak_this)
+      return;
+    auto pending_resp = std::move(*resp_it);
+    weak_this->pending_syncs_.erase(resp_it);
+    pending_resp.Resolve(ipc::AsyncResult<protos::gen::SyncResponse>::Create());
+  };
+  producer->service_endpoint->Sync(callback);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// RemoteProducer methods
+////////////////////////////////////////////////////////////////////////////////
+
+ProducerIPCService::RemoteProducer::RemoteProducer() = default;
+ProducerIPCService::RemoteProducer::~RemoteProducer() = default;
+
+// Invoked by the |core_service_| business logic after the ConnectProducer()
+// call. There is nothing to do here, we really expected the ConnectProducer()
+// to just work in the local case.
+void ProducerIPCService::RemoteProducer::OnConnect() {}
+
+// Invoked by the |core_service_| business logic after we destroy the
+// |service_endpoint| (in the RemoteProducer dtor).
+void ProducerIPCService::RemoteProducer::OnDisconnect() {}
+
+// Invoked by the |core_service_| business logic when it wants to create a new
+// data source.
+void ProducerIPCService::RemoteProducer::SetupDataSource(
+    DataSourceInstanceID dsid,
+    const DataSourceConfig& cfg) {
+  if (!async_producer_commands.IsBound()) {
+    PERFETTO_DLOG(
+        "The Service tried to create a new data source but the remote Producer "
+        "has not yet initialized the connection");
+    return;
+  }
+  auto cmd = ipc::AsyncResult<protos::gen::GetAsyncCommandResponse>::Create();
+  cmd.set_has_more(true);
+  cmd->mutable_setup_data_source()->set_new_instance_id(dsid);
+  *cmd->mutable_setup_data_source()->mutable_config() = cfg;
+  async_producer_commands.Resolve(std::move(cmd));
+}
+
+// Invoked by the |core_service_| business logic when it wants to start a new
+// data source.
+void ProducerIPCService::RemoteProducer::StartDataSource(
+    DataSourceInstanceID dsid,
+    const DataSourceConfig& cfg) {
+  if (!async_producer_commands.IsBound()) {
+    PERFETTO_DLOG(
+        "The Service tried to start a new data source but the remote Producer "
+        "has not yet initialized the connection");
+    return;
+  }
+  auto cmd = ipc::AsyncResult<protos::gen::GetAsyncCommandResponse>::Create();
+  cmd.set_has_more(true);
+  cmd->mutable_start_data_source()->set_new_instance_id(dsid);
+  *cmd->mutable_start_data_source()->mutable_config() = cfg;
+  async_producer_commands.Resolve(std::move(cmd));
+}
+
+void ProducerIPCService::RemoteProducer::StopDataSource(
+    DataSourceInstanceID dsid) {
+  if (!async_producer_commands.IsBound()) {
+    PERFETTO_DLOG(
+        "The Service tried to stop a data source but the remote Producer "
+        "has not yet initialized the connection");
+    return;
+  }
+  auto cmd = ipc::AsyncResult<protos::gen::GetAsyncCommandResponse>::Create();
+  cmd.set_has_more(true);
+  cmd->mutable_stop_data_source()->set_instance_id(dsid);
+  async_producer_commands.Resolve(std::move(cmd));
+}
+
+void ProducerIPCService::RemoteProducer::OnTracingSetup() {
+  if (!async_producer_commands.IsBound()) {
+    // Service may call this before the producer issued GetAsyncCommand.
+    send_setup_tracing_on_async_commands_bound = true;
+    return;
+  }
+  SendSetupTracing();
+}
+
+void ProducerIPCService::RemoteProducer::SendSetupTracing() {
+  PERFETTO_CHECK(async_producer_commands.IsBound());
+  PERFETTO_CHECK(service_endpoint->shared_memory());
+  auto cmd = ipc::AsyncResult<protos::gen::GetAsyncCommandResponse>::Create();
+  cmd.set_has_more(true);
+  auto setup_tracing = cmd->mutable_setup_tracing();
+  if (!service_endpoint->IsShmemProvidedByProducer()) {
+    // Nominal case (% Chrome): service provides SMB.
+    setup_tracing->set_shared_buffer_page_size_kb(
+        static_cast<uint32_t>(service_endpoint->shared_buffer_page_size_kb()));
+    const int shm_fd =
+        static_cast<PosixSharedMemory*>(service_endpoint->shared_memory())
+            ->fd();
+    cmd.set_fd(shm_fd);
+  }
+  async_producer_commands.Resolve(std::move(cmd));
+}
+
+void ProducerIPCService::RemoteProducer::Flush(
+    FlushRequestID flush_request_id,
+    const DataSourceInstanceID* data_source_ids,
+    size_t num_data_sources) {
+  if (!async_producer_commands.IsBound()) {
+    PERFETTO_DLOG(
+        "The Service tried to request a flush but the remote Producer has not "
+        "yet initialized the connection");
+    return;
+  }
+  auto cmd = ipc::AsyncResult<protos::gen::GetAsyncCommandResponse>::Create();
+  cmd.set_has_more(true);
+  for (size_t i = 0; i < num_data_sources; i++)
+    cmd->mutable_flush()->add_data_source_ids(data_source_ids[i]);
+  cmd->mutable_flush()->set_request_id(flush_request_id);
+  async_producer_commands.Resolve(std::move(cmd));
+}
+
+void ProducerIPCService::RemoteProducer::ClearIncrementalState(
+    const DataSourceInstanceID* data_source_ids,
+    size_t num_data_sources) {
+  if (!async_producer_commands.IsBound()) {
+    PERFETTO_DLOG(
+        "The Service tried to request an incremental state invalidation, but "
+        "the remote Producer has not yet initialized the connection");
+    return;
+  }
+  auto cmd = ipc::AsyncResult<protos::gen::GetAsyncCommandResponse>::Create();
+  cmd.set_has_more(true);
+  for (size_t i = 0; i < num_data_sources; i++)
+    cmd->mutable_clear_incremental_state()->add_data_source_ids(
+        data_source_ids[i]);
+  async_producer_commands.Resolve(std::move(cmd));
+}
+
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/ipc/service/service_ipc_host_impl.cc
+// gen_amalgamated begin header: src/tracing/ipc/service/service_ipc_host_impl.h
+// gen_amalgamated begin header: include/perfetto/ext/tracing/ipc/service_ipc_host.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_EXT_TRACING_IPC_SERVICE_IPC_HOST_H_
+#define INCLUDE_PERFETTO_EXT_TRACING_IPC_SERVICE_IPC_HOST_H_
+
+#include <memory>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/scoped_file.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/unix_socket.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/basic_types.h"
+
+namespace perfetto {
+namespace base {
+class TaskRunner;
+}  // namespace base.
+
+class TracingService;
+
+// Creates an instance of the service (business logic + UNIX socket transport).
+// Exposed to:
+//   The code in the tracing client that will host the service e.g., traced.
+// Implemented in:
+//   src/tracing/ipc/service/service_ipc_host_impl.cc
+class PERFETTO_EXPORT ServiceIPCHost {
+ public:
+  static std::unique_ptr<ServiceIPCHost> CreateInstance(base::TaskRunner*);
+  virtual ~ServiceIPCHost();
+
+  // Start listening on the Producer & Consumer ports. Returns false in case of
+  // failure (e.g., something else is listening on |socket_name|).
+  virtual bool Start(const char* producer_socket_name,
+                     const char* consumer_socket_name) = 0;
+
+  // Like the above, but takes two file descriptors to already bound sockets.
+  // This is used when building as part of the Android tree, where init opens
+  // and binds the socket beore exec()-ing us.
+  virtual bool Start(base::ScopedSocketHandle producer_socket_fd,
+                     base::ScopedSocketHandle consumer_socket_fd) = 0;
+
+  virtual TracingService* service() const = 0;
+
+ protected:
+  ServiceIPCHost();
+
+ private:
+  ServiceIPCHost(const ServiceIPCHost&) = delete;
+  ServiceIPCHost& operator=(const ServiceIPCHost&) = delete;
+};
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_EXT_TRACING_IPC_SERVICE_IPC_HOST_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SRC_TRACING_IPC_SERVICE_SERVICE_IPC_HOST_IMPL_H_
+#define SRC_TRACING_IPC_SERVICE_SERVICE_IPC_HOST_IMPL_H_
+
+#include <memory>
+
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/ipc/service_ipc_host.h"
+
+namespace perfetto {
+
+namespace ipc {
+class Host;
+}
+
+// The implementation of the IPC host for the tracing service. This class does
+// very few things: it mostly initializes the IPC transport. The actual
+// implementation of the IPC <> Service business logic glue lives in
+// producer_ipc_service.cc and consumer_ipc_service.cc.
+class ServiceIPCHostImpl : public ServiceIPCHost {
+ public:
+  ServiceIPCHostImpl(base::TaskRunner*);
+  ~ServiceIPCHostImpl() override;
+
+  // ServiceIPCHost implementation.
+  bool Start(const char* producer_socket_name,
+             const char* consumer_socket_name) override;
+  bool Start(base::ScopedSocketHandle producer_socket_fd,
+             base::ScopedSocketHandle consumer_socket_fd) override;
+
+  TracingService* service() const override;
+
+ private:
+  bool DoStart();
+  void Shutdown();
+
+  base::TaskRunner* const task_runner_;
+  std::unique_ptr<TracingService> svc_;  // The service business logic.
+
+  // The IPC host that listens on the Producer socket. It owns the
+  // PosixServiceProducerPort instance which deals with all producers' IPC(s).
+  std::unique_ptr<ipc::Host> producer_ipc_port_;
+
+  // As above, but for the Consumer port.
+  std::unique_ptr<ipc::Host> consumer_ipc_port_;
+};
+
+}  // namespace perfetto
+
+#endif  // SRC_TRACING_IPC_SERVICE_SERVICE_IPC_HOST_IMPL_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "src/tracing/ipc/service/service_ipc_host_impl.h"
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/base/task_runner.h"
+// gen_amalgamated expanded: #include "perfetto/ext/ipc/host.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/tracing_service.h"
+// gen_amalgamated expanded: #include "src/tracing/ipc/posix_shared_memory.h"
+// gen_amalgamated expanded: #include "src/tracing/ipc/service/consumer_ipc_service.h"
+// gen_amalgamated expanded: #include "src/tracing/ipc/service/producer_ipc_service.h"
+
+namespace perfetto {
+
+// TODO(fmayer): implement per-uid connection limit (b/69093705).
+
+// Implements the publicly exposed factory method declared in
+// include/tracing/posix_ipc/posix_service_host.h.
+std::unique_ptr<ServiceIPCHost> ServiceIPCHost::CreateInstance(
+    base::TaskRunner* task_runner) {
+  return std::unique_ptr<ServiceIPCHost>(new ServiceIPCHostImpl(task_runner));
+}
+
+ServiceIPCHostImpl::ServiceIPCHostImpl(base::TaskRunner* task_runner)
+    : task_runner_(task_runner) {}
+
+ServiceIPCHostImpl::~ServiceIPCHostImpl() {}
+
+bool ServiceIPCHostImpl::Start(const char* producer_socket_name,
+                               const char* consumer_socket_name) {
+  PERFETTO_CHECK(!svc_);  // Check if already started.
+
+  // Initialize the IPC transport.
+  producer_ipc_port_ =
+      ipc::Host::CreateInstance(producer_socket_name, task_runner_);
+  consumer_ipc_port_ =
+      ipc::Host::CreateInstance(consumer_socket_name, task_runner_);
+  return DoStart();
+}
+
+bool ServiceIPCHostImpl::Start(base::ScopedSocketHandle producer_socket_fd,
+                               base::ScopedSocketHandle consumer_socket_fd) {
+  PERFETTO_CHECK(!svc_);  // Check if already started.
+
+  // Initialize the IPC transport.
+  producer_ipc_port_ =
+      ipc::Host::CreateInstance(std::move(producer_socket_fd), task_runner_);
+  consumer_ipc_port_ =
+      ipc::Host::CreateInstance(std::move(consumer_socket_fd), task_runner_);
+  return DoStart();
+}
+
+bool ServiceIPCHostImpl::DoStart() {
+  // Create and initialize the platform-independent tracing business logic.
+  std::unique_ptr<SharedMemory::Factory> shm_factory(
+      new PosixSharedMemory::Factory());
+  svc_ = TracingService::CreateInstance(std::move(shm_factory), task_runner_);
+
+  if (!producer_ipc_port_ || !consumer_ipc_port_) {
+    Shutdown();
+    return false;
+  }
+
+  // TODO(fmayer): add a test that destroyes the ServiceIPCHostImpl soon after
+  // Start() and checks that no spurious callbacks are issued.
+  bool producer_service_exposed = producer_ipc_port_->ExposeService(
+      std::unique_ptr<ipc::Service>(new ProducerIPCService(svc_.get())));
+  PERFETTO_CHECK(producer_service_exposed);
+
+  bool consumer_service_exposed = consumer_ipc_port_->ExposeService(
+      std::unique_ptr<ipc::Service>(new ConsumerIPCService(svc_.get())));
+  PERFETTO_CHECK(consumer_service_exposed);
+
+  return true;
+}
+
+TracingService* ServiceIPCHostImpl::service() const {
+  return svc_.get();
+}
+
+void ServiceIPCHostImpl::Shutdown() {
+  // TODO(primiano): add a test that causes the Shutdown() and checks that no
+  // spurious callbacks are issued.
+  producer_ipc_port_.reset();
+  consumer_ipc_port_.reset();
+  svc_.reset();
+}
+
+// Definitions for the base class ctor/dtor.
+ServiceIPCHost::ServiceIPCHost() = default;
+ServiceIPCHost::~ServiceIPCHost() = default;
+
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/internal/system_tracing_backend.cc
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/system_tracing_backend.h"
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/base/task_runner.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/core/tracing_service.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/ipc/consumer_ipc_client.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/ipc/default_socket.h"
+// gen_amalgamated expanded: #include "perfetto/ext/tracing/ipc/producer_ipc_client.h"
+
+namespace perfetto {
+namespace internal {
+
+// static
+TracingBackend* SystemTracingBackend::GetInstance() {
+  static auto* instance = new SystemTracingBackend();
+  return instance;
+}
+
+SystemTracingBackend::SystemTracingBackend() {}
+
+std::unique_ptr<ProducerEndpoint> SystemTracingBackend::ConnectProducer(
+    const ConnectProducerArgs& args) {
+  PERFETTO_DCHECK(args.task_runner->RunsTasksOnCurrentThread());
+
+  auto endpoint = ProducerIPCClient::Connect(
+      GetProducerSocket(), args.producer, args.producer_name, args.task_runner,
+      TracingService::ProducerSMBScrapingMode::kEnabled,
+      args.shmem_size_hint_bytes, args.shmem_page_size_hint_bytes, nullptr,
+      nullptr, ProducerIPCClient::ConnectionFlags::kRetryIfUnreachable);
+  PERFETTO_CHECK(endpoint);
+  return endpoint;
+}
+
+std::unique_ptr<ConsumerEndpoint> SystemTracingBackend::ConnectConsumer(
+    const ConnectConsumerArgs& args) {
+  auto endpoint = ConsumerIPCClient::Connect(GetConsumerSocket(), args.consumer,
+                                             args.task_runner);
+  PERFETTO_CHECK(endpoint);
+  return endpoint;
+}
+
+}  // namespace internal
+}  // namespace perfetto
+// gen_amalgamated begin source: src/tracing/platform_posix.cc
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) ||   \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+
+// gen_amalgamated expanded: #include "perfetto/ext/base/file_utils.h"
+// gen_amalgamated expanded: #include "perfetto/ext/base/thread_task_runner.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/tracing_tls.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/platform.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/trace_writer_base.h"
+
+#include <pthread.h>
+#include <stdlib.h>
+
+namespace perfetto {
+
+namespace {
+
+class PlatformPosix : public Platform {
+ public:
+  PlatformPosix();
+  ~PlatformPosix() override;
+
+  ThreadLocalObject* GetOrCreateThreadLocalObject() override;
+  std::unique_ptr<base::TaskRunner> CreateTaskRunner(
+      const CreateTaskRunnerArgs&) override;
+  std::string GetCurrentProcessName() override;
+
+ private:
+  pthread_key_t tls_key_{};
+};
+
+using ThreadLocalObject = Platform::ThreadLocalObject;
+
+PlatformPosix::PlatformPosix() {
+  auto tls_dtor = [](void* obj) {
+    delete static_cast<ThreadLocalObject*>(obj);
+  };
+  PERFETTO_CHECK(pthread_key_create(&tls_key_, tls_dtor) == 0);
+}
+
+PlatformPosix::~PlatformPosix() {
+  pthread_key_delete(tls_key_);
+}
+
+ThreadLocalObject* PlatformPosix::GetOrCreateThreadLocalObject() {
+  // In chromium this should be implemented using base::ThreadLocalStorage.
+  auto tls = static_cast<ThreadLocalObject*>(pthread_getspecific(tls_key_));
+  if (!tls) {
+    tls = ThreadLocalObject::CreateInstance().release();
+    pthread_setspecific(tls_key_, tls);
+  }
+  return tls;
+}
+
+std::unique_ptr<base::TaskRunner> PlatformPosix::CreateTaskRunner(
+    const CreateTaskRunnerArgs&) {
+  return std::unique_ptr<base::TaskRunner>(
+      new base::ThreadTaskRunner(base::ThreadTaskRunner::CreateAndStart()));
+}
+
+std::string PlatformPosix::GetCurrentProcessName() {
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+  std::string cmdline;
+  base::ReadFile("/proc/self/cmdline", &cmdline);
+  return cmdline.substr(0, cmdline.find('\0'));
+#elif PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+  return std::string(getprogname());
+#else
+  return "unknown_producer";
+#endif
+}
+
+}  // namespace
+
+// static
+Platform* Platform::GetDefaultPlatform() {
+  static PlatformPosix* instance = new PlatformPosix();
+  return instance;
+}
+
+}  // namespace perfetto
+#endif  // OS_LINUX || OS_ANDROID || OS_APPLE
+
diff --git a/system/profiler/perfetto.h b/system/profiler/perfetto.h
new file mode 100644
index 0000000..d66b3ef
--- /dev/null
+++ b/system/profiler/perfetto.h
@@ -0,0 +1,132001 @@
+// Copyright (C) 2019 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// This file is automatically generated by gen_amalgamated. Do not edit.
+
+// gen_amalgamated begin header: include/perfetto/tracing.h
+// gen_amalgamated begin header: include/perfetto/tracing/buffer_exhausted_policy.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_BUFFER_EXHAUSTED_POLICY_H_
+#define INCLUDE_PERFETTO_TRACING_BUFFER_EXHAUSTED_POLICY_H_
+
+namespace perfetto {
+
+// Determines how SharedMemoryArbiterImpl::GetNewChunk() behaves when no free
+// chunks are available.
+enum class BufferExhaustedPolicy {
+  // SharedMemoryArbiterImpl::GetNewChunk() will stall if no free SMB chunk is
+  // available and wait for the tracing service to free one. Note that this
+  // requires that messages the arbiter sends to the tracing service (from any
+  // TraceWriter thread) will be received by it, even if all TraceWriter threads
+  // are stalled.
+  kStall,
+
+  // SharedMemoryArbiterImpl::GetNewChunk() will return an invalid chunk if no
+  // free SMB chunk is available. In this case, the TraceWriter will fall back
+  // to a garbage chunk and drop written data until acquiring a future chunk
+  // succeeds again.
+  kDrop,
+
+  // TODO(eseckler): Switch to kDrop by default and change the Android code to
+  // explicitly request kStall instead.
+  kDefault = kStall
+};
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_BUFFER_EXHAUSTED_POLICY_H_
+// gen_amalgamated begin header: include/perfetto/tracing/console_interceptor.h
+// gen_amalgamated begin header: include/perfetto/base/compiler.h
+// gen_amalgamated begin header: include/perfetto/base/build_config.h
+// gen_amalgamated begin header: gen/build_config/perfetto_build_flags.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Generated by write_buildflag_header.py
+
+// fix_include_guards: off
+#ifndef GEN_BUILD_CONFIG_PERFETTO_BUILD_FLAGS_H_
+#define GEN_BUILD_CONFIG_PERFETTO_BUILD_FLAGS_H_
+
+// clang-format off
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_ANDROID_BUILD() (0)
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_CHROMIUM_BUILD() (0)
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_STANDALONE_BUILD() (0)
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_START_DAEMONS() (1)
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_IPC() (1)
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_WATCHDOG() (0)
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_COMPONENT_BUILD() (0)
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_FORCE_DLOG_ON() (0)
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_FORCE_DLOG_OFF() (0)
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_VERBOSE_LOGS() (1)
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_VERSION_GEN() (1)
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_TP_PERCENTILE() (0)
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_TP_LINENOISE() (0)
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_TP_HTTPD() (0)
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_TP_JSON() (1)
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_LOCAL_SYMBOLIZER() (0)
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_ZLIB() (1)
+
+// clang-format on
+#endif  // GEN_BUILD_CONFIG_PERFETTO_BUILD_FLAGS_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_BASE_BUILD_CONFIG_H_
+#define INCLUDE_PERFETTO_BASE_BUILD_CONFIG_H_
+
+// Allows to define build flags that give a compiler error if the header that
+// defined the flag is not included, instead of silently ignoring the #if block.
+#define PERFETTO_BUILDFLAG_CAT_INDIRECT(a, b) a##b
+#define PERFETTO_BUILDFLAG_CAT(a, b) PERFETTO_BUILDFLAG_CAT_INDIRECT(a, b)
+#define PERFETTO_BUILDFLAG(flag) \
+  (PERFETTO_BUILDFLAG_CAT(PERFETTO_BUILDFLAG_DEFINE_, flag)())
+
+#if defined(__ANDROID__)
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_ANDROID() 1
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WIN() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_APPLE() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_IOS() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WASM() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_FUCHSIA() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_NACL() 0
+#elif defined(__APPLE__)
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_ANDROID() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_APPLE() 1
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WIN() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WASM() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_FUCHSIA() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_NACL() 0
+// Include TARGET_OS_IPHONE when on __APPLE__ systems.
+#include <TargetConditionals.h>
+#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_IOS() 1
+#else
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 1
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_IOS() 0
+#endif
+#elif defined(__linux__)
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_ANDROID() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() 1
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WIN() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_APPLE() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_IOS() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WASM() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_FUCHSIA() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_NACL() 0
+#elif defined(_WIN32)
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_ANDROID() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WIN() 1
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_APPLE() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_IOS() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WASM() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_FUCHSIA() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_NACL() 0
+#elif defined(__EMSCRIPTEN__)
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_ANDROID() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WIN() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_APPLE() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_IOS() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WASM() 1
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_FUCHSIA() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_NACL() 0
+#elif defined(__Fuchsia__)
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_ANDROID() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_APPLE() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_IOS() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WIN() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WASM() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_FUCHSIA() 1
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_NACL() 0
+#elif defined(__native_client__)
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_ANDROID() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WIN() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_APPLE() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_IOS() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WASM() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_FUCHSIA() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_NACL() 1
+#else
+#error OS not supported (see build_config.h)
+#endif
+
+#if defined(__clang__)
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_COMPILER_CLANG() 1
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_COMPILER_GCC() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_COMPILER_MSVC() 0
+#elif defined(__GNUC__) // Careful: Clang also defines this!
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_COMPILER_CLANG() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_COMPILER_GCC() 1
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_COMPILER_MSVC() 0
+#elif defined(_MSC_VER)
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_COMPILER_CLANG() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_COMPILER_GCC() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_COMPILER_MSVC() 1
+#else
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_COMPILER_CLANG() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_COMPILER_GCC() 0
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_COMPILER_MSVC() 0
+#endif
+
+#if defined(PERFETTO_BUILD_WITH_ANDROID_USERDEBUG)
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_ANDROID_USERDEBUG_BUILD() 1
+#else
+#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_ANDROID_USERDEBUG_BUILD() 0
+#endif
+
+// perfetto_build_flags.h contains the tweakable build flags defined via GN.
+// - In GN builds (e.g., standalone, chromium, v8) this file is generated at
+//   build time via the gen_rule //gn/gen_buildflags.
+// - In Android in-tree builds, this file is generated by tools/gen_android_bp
+//   and checked in into include/perfetto/base/build_configs/android_tree/. The
+//   default cflags add this path to the default include path.
+// - Similarly, in bazel builds, this file is generated by tools/gen_bazel and
+//   checked in into include/perfetto/base/build_configs/bazel/.
+// - In amaglamated builds, this file is generated by tools/gen_amalgamated and
+//   added to the amalgamated headers.
+// gen_amalgamated expanded: #include "perfetto_build_flags.h"  // no-include-violation-check
+
+#endif  // INCLUDE_PERFETTO_BASE_BUILD_CONFIG_H_
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_BASE_COMPILER_H_
+#define INCLUDE_PERFETTO_BASE_COMPILER_H_
+
+#include <stddef.h>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+
+// __has_attribute is supported only by clang and recent versions of GCC.
+// Add a layer to wrap the __has_attribute macro.
+#if defined(__has_attribute)
+#define PERFETTO_HAS_ATTRIBUTE(x) __has_attribute(x)
+#else
+#define PERFETTO_HAS_ATTRIBUTE(x) 0
+#endif
+
+#if defined(__GNUC__) || defined(__clang__)
+#define PERFETTO_LIKELY(_x) __builtin_expect(!!(_x), 1)
+#define PERFETTO_UNLIKELY(_x) __builtin_expect(!!(_x), 0)
+#else
+#define PERFETTO_LIKELY(_x) (_x)
+#define PERFETTO_UNLIKELY(_x) (_x)
+#endif
+
+#if defined(__GNUC__) || defined(__clang__)
+#define PERFETTO_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
+#else
+#define PERFETTO_WARN_UNUSED_RESULT
+#endif
+
+#if defined(__clang__)
+#define PERFETTO_ALWAYS_INLINE __attribute__((__always_inline__))
+#define PERFETTO_NO_INLINE __attribute__((__noinline__))
+#else
+// GCC is too pedantic and often fails with the error:
+// "always_inline function might not be inlinable"
+#define PERFETTO_ALWAYS_INLINE
+#define PERFETTO_NO_INLINE
+#endif
+
+#if defined(__GNUC__) || defined(__clang__)
+#define PERFETTO_NORETURN __attribute__((__noreturn__))
+#else
+#define PERFETTO_NORETURN __declspec(noreturn)
+#endif
+
+#if defined(__GNUC__) || defined(__clang__)
+#define PERFETTO_DEBUG_FUNCTION_IDENTIFIER() __PRETTY_FUNCTION__
+#elif defined(_MSC_VER)
+#define PERFETTO_DEBUG_FUNCTION_IDENTIFIER() __FUNCSIG__
+#else
+#define PERFETTO_DEBUG_FUNCTION_IDENTIFIER() \
+  static_assert(false, "Not implemented for this compiler")
+#endif
+
+#if defined(__GNUC__) || defined(__clang__)
+#define PERFETTO_PRINTF_FORMAT(x, y) \
+  __attribute__((__format__(__printf__, x, y)))
+#else
+#define PERFETTO_PRINTF_FORMAT(x, y)
+#endif
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_IOS)
+// TODO(b/158814068): For iOS builds, thread_local is only supported since iOS
+// 8. We'd have to use pthread for thread local data instead here. For now, just
+// define it to nothing since we don't support running perfetto or the client
+// lib on iOS right now.
+#define PERFETTO_THREAD_LOCAL
+#else
+#define PERFETTO_THREAD_LOCAL thread_local
+#endif
+
+#if defined(__GNUC__) || defined(__clang__)
+#define PERFETTO_POPCOUNT(x) __builtin_popcountll(x)
+#else
+#include <intrin.h>
+#define PERFETTO_POPCOUNT(x) __popcnt64(x)
+#endif
+
+#if defined(__clang__)
+#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
+extern "C" void __asan_poison_memory_region(void const volatile*, size_t);
+extern "C" void __asan_unpoison_memory_region(void const volatile*, size_t);
+#define PERFETTO_ASAN_POISON(a, s) __asan_poison_memory_region((a), (s))
+#define PERFETTO_ASAN_UNPOISON(a, s) __asan_unpoison_memory_region((a), (s))
+#else
+#define PERFETTO_ASAN_POISON(addr, size)
+#define PERFETTO_ASAN_UNPOISON(addr, size)
+#endif  // __has_feature(address_sanitizer)
+#else
+#define PERFETTO_ASAN_POISON(addr, size)
+#define PERFETTO_ASAN_UNPOISON(addr, size)
+#endif  // __clang__
+
+#if defined(__GNUC__) || defined(__clang__)
+#define PERFETTO_IS_LITTLE_ENDIAN() __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+#else
+// Assume all MSVC targets are little endian.
+#define PERFETTO_IS_LITTLE_ENDIAN() 1
+#endif
+
+// This is used for exporting xxxMain() symbols (e.g., PerfettoCmdMain,
+// ProbesMain) from libperfetto.so when the GN arg monolithic_binaries = false.
+#if defined(__GNUC__) || defined(__clang__)
+#define PERFETTO_EXPORT_ENTRYPOINT __attribute__((visibility("default")))
+#else
+// TODO(primiano): on Windows this should be a pair of dllexport/dllimport. But
+// that requires a -DXXX_IMPLEMENTATION depending on whether we are on the
+// impl-site or call-site. Right now it's not worth the trouble as we
+// force-export the xxxMain() symbols only on Android, where we pack all the
+// code for N binaries into one .so to save binary size. On Windows we support
+// only monolithic binaries, as they are easier to deal with.
+#define PERFETTO_EXPORT_ENTRYPOINT
+#endif
+
+// Disables thread safety analysis for functions where the compiler can't
+// accurate figure out which locks are being held.
+#if defined(__clang__)
+#define PERFETTO_NO_THREAD_SAFETY_ANALYSIS \
+  __attribute__((no_thread_safety_analysis))
+#else
+#define PERFETTO_NO_THREAD_SAFETY_ANALYSIS
+#endif
+
+// Avoid calling the exit-time destructor on an object with static lifetime.
+#if PERFETTO_HAS_ATTRIBUTE(no_destroy)
+#define PERFETTO_HAS_NO_DESTROY() 1
+#define PERFETTO_NO_DESTROY __attribute__((no_destroy))
+#else
+#define PERFETTO_HAS_NO_DESTROY() 0
+#define PERFETTO_NO_DESTROY
+#endif
+
+namespace perfetto {
+namespace base {
+
+template <typename... T>
+inline void ignore_result(const T&...) {}
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_BASE_COMPILER_H_
+// gen_amalgamated begin header: include/perfetto/base/logging.h
+// gen_amalgamated begin header: include/perfetto/base/export.h
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_BASE_EXPORT_H_
+#define INCLUDE_PERFETTO_BASE_EXPORT_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+
+#if PERFETTO_BUILDFLAG(PERFETTO_COMPONENT_BUILD)
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+
+#if defined(PERFETTO_IMPLEMENTATION)
+#define PERFETTO_EXPORT __declspec(dllexport)
+#else
+#define PERFETTO_EXPORT __declspec(dllimport)
+#endif
+
+#else  // PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+
+#if defined(PERFETTO_IMPLEMENTATION)
+#define PERFETTO_EXPORT __attribute__((visibility("default")))
+#else
+#define PERFETTO_EXPORT
+#endif
+
+#endif  // PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+
+#else  // !PERFETTO_BUILDFLAG(PERFETTO_COMPONENT_BUILD)
+
+#define PERFETTO_EXPORT
+
+#endif  // PERFETTO_BUILDFLAG(PERFETTO_COMPONENT_BUILD)
+
+#endif  // INCLUDE_PERFETTO_BASE_EXPORT_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_BASE_LOGGING_H_
+#define INCLUDE_PERFETTO_BASE_LOGGING_H_
+
+#include <errno.h>
+#include <string.h>  // For strerror.
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+// gen_amalgamated expanded: #include "perfetto/base/compiler.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+#if defined(__GNUC__) || defined(__clang__)
+// Ignore GCC warning about a missing argument for a variadic macro parameter.
+#pragma GCC system_header
+#endif
+
+// TODO(primiano): move this to base/build_config.h, turn into
+// PERFETTO_BUILDFLAG(DCHECK_IS_ON) and update call sites to use that instead.
+#if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON)
+#define PERFETTO_DCHECK_IS_ON() 0
+#else
+#define PERFETTO_DCHECK_IS_ON() 1
+#endif
+
+#if PERFETTO_BUILDFLAG(PERFETTO_FORCE_DLOG_ON)
+#define PERFETTO_DLOG_IS_ON() 1
+#elif PERFETTO_BUILDFLAG(PERFETTO_FORCE_DLOG_OFF)
+#define PERFETTO_DLOG_IS_ON() 0
+#else
+#define PERFETTO_DLOG_IS_ON() PERFETTO_DCHECK_IS_ON()
+#endif
+
+#if defined(PERFETTO_ANDROID_ASYNC_SAFE_LOG)
+#if !PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
+    !PERFETTO_BUILDFLAG(PERFETTO_ANDROID_BUILD)
+#error "Async-safe logging is limited to Android tree builds"
+#endif
+// For binaries which need a very lightweight logging implementation.
+// Note that this header is incompatible with android/log.h.
+#include <async_safe/log.h>
+#elif PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+// Normal android logging.
+#include <android/log.h>
+#endif
+
+namespace perfetto {
+namespace base {
+
+// Constexpr functions to extract basename(__FILE__), e.g.: ../foo/f.c -> f.c .
+constexpr const char* StrEnd(const char* s) {
+  return *s ? StrEnd(s + 1) : s;
+}
+
+constexpr const char* BasenameRecursive(const char* s,
+                                        const char* begin,
+                                        const char* end) {
+  return (*s == '/' && s < end)
+             ? (s + 1)
+             : ((s > begin) ? BasenameRecursive(s - 1, begin, end) : s);
+}
+
+constexpr const char* Basename(const char* str) {
+  return BasenameRecursive(StrEnd(str), str, StrEnd(str));
+}
+
+enum LogLev { kLogDebug = 0, kLogInfo, kLogImportant, kLogError };
+
+struct LogMessageCallbackArgs {
+  LogLev level;
+  int line;
+  const char* filename;
+  const char* message;
+};
+
+using LogMessageCallback = void (*)(LogMessageCallbackArgs);
+
+// This is not thread safe and must be called before using tracing from other
+// threads.
+PERFETTO_EXPORT void SetLogMessageCallback(LogMessageCallback callback);
+
+PERFETTO_EXPORT void LogMessage(LogLev,
+                                const char* fname,
+                                int line,
+                                const char* fmt,
+                                ...) PERFETTO_PRINTF_FORMAT(4, 5);
+
+#if defined(PERFETTO_ANDROID_ASYNC_SAFE_LOG)
+#define PERFETTO_XLOG(level, fmt, ...)                                        \
+  do {                                                                        \
+    async_safe_format_log((ANDROID_LOG_DEBUG + level), "perfetto",            \
+                          "%s:%d " fmt, ::perfetto::base::Basename(__FILE__), \
+                          __LINE__, ##__VA_ARGS__);                           \
+  } while (0)
+#elif defined(PERFETTO_DISABLE_LOG)
+#define PERFETTO_XLOG(...) ::perfetto::base::ignore_result(__VA_ARGS__)
+#else
+#define PERFETTO_XLOG(level, fmt, ...)                                      \
+  ::perfetto::base::LogMessage(level, ::perfetto::base::Basename(__FILE__), \
+                               __LINE__, fmt, ##__VA_ARGS__)
+#endif
+
+#if defined(_MSC_VER)
+#define PERFETTO_IMMEDIATE_CRASH() \
+  do {                             \
+    __debugbreak();                \
+    __assume(0);                   \
+  } while (0)
+#else
+#define PERFETTO_IMMEDIATE_CRASH() \
+  do {                             \
+    __builtin_trap();              \
+    __builtin_unreachable();       \
+  } while (0)
+#endif
+
+#if PERFETTO_BUILDFLAG(PERFETTO_VERBOSE_LOGS)
+#define PERFETTO_LOG(fmt, ...) \
+  PERFETTO_XLOG(::perfetto::base::kLogInfo, fmt, ##__VA_ARGS__)
+#else  // PERFETTO_BUILDFLAG(PERFETTO_VERBOSE_LOGS)
+#define PERFETTO_LOG(...) ::perfetto::base::ignore_result(__VA_ARGS__)
+#endif  // PERFETTO_BUILDFLAG(PERFETTO_VERBOSE_LOGS)
+
+#define PERFETTO_ILOG(fmt, ...) \
+  PERFETTO_XLOG(::perfetto::base::kLogImportant, fmt, ##__VA_ARGS__)
+#define PERFETTO_ELOG(fmt, ...) \
+  PERFETTO_XLOG(::perfetto::base::kLogError, fmt, ##__VA_ARGS__)
+#define PERFETTO_FATAL(fmt, ...)       \
+  do {                                 \
+    PERFETTO_PLOG(fmt, ##__VA_ARGS__); \
+    PERFETTO_IMMEDIATE_CRASH();        \
+  } while (0)
+
+#if defined(__GNUC__) || defined(__clang__)
+#define PERFETTO_PLOG(x, ...) \
+  PERFETTO_ELOG(x " (errno: %d, %s)", ##__VA_ARGS__, errno, strerror(errno))
+#else
+// MSVC expands __VA_ARGS__ in a different order. Give up, not worth it.
+#define PERFETTO_PLOG PERFETTO_ELOG
+#endif
+
+#define PERFETTO_CHECK(x)                            \
+  do {                                               \
+    if (PERFETTO_UNLIKELY(!(x))) {                   \
+      PERFETTO_PLOG("%s", "PERFETTO_CHECK(" #x ")"); \
+      PERFETTO_IMMEDIATE_CRASH();                    \
+    }                                                \
+  } while (0)
+
+#if PERFETTO_DLOG_IS_ON()
+
+#define PERFETTO_DLOG(fmt, ...) \
+  PERFETTO_XLOG(::perfetto::base::kLogDebug, fmt, ##__VA_ARGS__)
+
+#if defined(__GNUC__) || defined(__clang__)
+#define PERFETTO_DPLOG(x, ...) \
+  PERFETTO_DLOG(x " (errno: %d, %s)", ##__VA_ARGS__, errno, strerror(errno))
+#else
+// MSVC expands __VA_ARGS__ in a different order. Give up, not worth it.
+#define PERFETTO_DPLOG PERFETTO_DLOG
+#endif
+
+#else  // PERFETTO_DLOG_IS_ON()
+
+#define PERFETTO_DLOG(...) ::perfetto::base::ignore_result(__VA_ARGS__)
+#define PERFETTO_DPLOG(...) ::perfetto::base::ignore_result(__VA_ARGS__)
+
+#endif  // PERFETTO_DLOG_IS_ON()
+
+#if PERFETTO_DCHECK_IS_ON()
+
+#define PERFETTO_DCHECK(x) PERFETTO_CHECK(x)
+#define PERFETTO_DFATAL(...) PERFETTO_FATAL(__VA_ARGS__)
+#define PERFETTO_DFATAL_OR_ELOG(...) PERFETTO_DFATAL(__VA_ARGS__)
+
+#else  // PERFETTO_DCHECK_IS_ON()
+
+#define PERFETTO_DCHECK(x) \
+  do {                     \
+  } while (false && (x))
+
+#define PERFETTO_DFATAL(...) ::perfetto::base::ignore_result(__VA_ARGS__)
+#define PERFETTO_DFATAL_OR_ELOG(...) PERFETTO_ELOG(__VA_ARGS__)
+
+#endif  // PERFETTO_DCHECK_IS_ON()
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_BASE_LOGGING_H_
+// gen_amalgamated begin header: include/perfetto/tracing/interceptor.h
+// gen_amalgamated begin header: include/perfetto/protozero/field.h
+// gen_amalgamated begin header: include/perfetto/protozero/contiguous_memory_range.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_
+#define INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_
+
+#include <assert.h>
+#include <stddef.h>
+#include <stdint.h>
+
+namespace protozero {
+
+// Keep this struct trivially constructible (no ctors, no default initializers).
+struct ContiguousMemoryRange {
+  uint8_t* begin;
+  uint8_t* end;  // STL style: one byte past the end of the buffer.
+
+  inline bool is_valid() const { return begin != nullptr; }
+  inline void reset() { begin = nullptr; }
+  inline size_t size() const { return static_cast<size_t>(end - begin); }
+};
+
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_
+// gen_amalgamated begin header: include/perfetto/protozero/proto_utils.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_PROTO_UTILS_H_
+#define INCLUDE_PERFETTO_PROTOZERO_PROTO_UTILS_H_
+
+#include <inttypes.h>
+#include <stddef.h>
+
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+
+namespace protozero {
+namespace proto_utils {
+
+// See https://developers.google.com/protocol-buffers/docs/encoding wire types.
+// This is a type encoded into the proto that provides just enough info to
+// find the length of the following value.
+enum class ProtoWireType : uint32_t {
+  kVarInt = 0,
+  kFixed64 = 1,
+  kLengthDelimited = 2,
+  kFixed32 = 5,
+};
+
+// This is the type defined in the proto for each field. This information
+// is used to decide the translation strategy when writing the trace.
+enum class ProtoSchemaType {
+  kUnknown = 0,
+  kDouble,
+  kFloat,
+  kInt64,
+  kUint64,
+  kInt32,
+  kFixed64,
+  kFixed32,
+  kBool,
+  kString,
+  kGroup,  // Deprecated (proto2 only)
+  kMessage,
+  kBytes,
+  kUint32,
+  kEnum,
+  kSfixed32,
+  kSfixed64,
+  kSint32,
+  kSint64,
+};
+
+inline const char* ProtoSchemaToString(ProtoSchemaType v) {
+  switch (v) {
+    case ProtoSchemaType::kUnknown:
+      return "unknown";
+    case ProtoSchemaType::kDouble:
+      return "double";
+    case ProtoSchemaType::kFloat:
+      return "float";
+    case ProtoSchemaType::kInt64:
+      return "int64";
+    case ProtoSchemaType::kUint64:
+      return "uint64";
+    case ProtoSchemaType::kInt32:
+      return "int32";
+    case ProtoSchemaType::kFixed64:
+      return "fixed64";
+    case ProtoSchemaType::kFixed32:
+      return "fixed32";
+    case ProtoSchemaType::kBool:
+      return "bool";
+    case ProtoSchemaType::kString:
+      return "string";
+    case ProtoSchemaType::kGroup:
+      return "group";
+    case ProtoSchemaType::kMessage:
+      return "message";
+    case ProtoSchemaType::kBytes:
+      return "bytes";
+    case ProtoSchemaType::kUint32:
+      return "uint32";
+    case ProtoSchemaType::kEnum:
+      return "enum";
+    case ProtoSchemaType::kSfixed32:
+      return "sfixed32";
+    case ProtoSchemaType::kSfixed64:
+      return "sfixed64";
+    case ProtoSchemaType::kSint32:
+      return "sint32";
+    case ProtoSchemaType::kSint64:
+      return "sint64";
+  }
+  // For gcc:
+  PERFETTO_DCHECK(false);
+  return "";
+}
+
+// Maximum message size supported: 256 MiB (4 x 7-bit due to varint encoding).
+constexpr size_t kMessageLengthFieldSize = 4;
+constexpr size_t kMaxMessageLength = (1u << (kMessageLengthFieldSize * 7)) - 1;
+
+// Field tag is encoded as 32-bit varint (5 bytes at most).
+// Largest value of simple (not length-delimited) field is 64-bit varint
+// (10 bytes at most). 15 bytes buffer is enough to store a simple field.
+constexpr size_t kMaxTagEncodedSize = 5;
+constexpr size_t kMaxSimpleFieldEncodedSize = kMaxTagEncodedSize + 10;
+
+// Proto types: (int|uint|sint)(32|64), bool, enum.
+constexpr uint32_t MakeTagVarInt(uint32_t field_id) {
+  return (field_id << 3) | static_cast<uint32_t>(ProtoWireType::kVarInt);
+}
+
+// Proto types: fixed64, sfixed64, fixed32, sfixed32, double, float.
+template <typename T>
+constexpr uint32_t MakeTagFixed(uint32_t field_id) {
+  static_assert(sizeof(T) == 8 || sizeof(T) == 4, "Value must be 4 or 8 bytes");
+  return (field_id << 3) |
+         static_cast<uint32_t>((sizeof(T) == 8 ? ProtoWireType::kFixed64
+                                               : ProtoWireType::kFixed32));
+}
+
+// Proto types: string, bytes, embedded messages.
+constexpr uint32_t MakeTagLengthDelimited(uint32_t field_id) {
+  return (field_id << 3) |
+         static_cast<uint32_t>(ProtoWireType::kLengthDelimited);
+}
+
+// Proto types: sint64, sint32.
+template <typename T>
+inline typename std::make_unsigned<T>::type ZigZagEncode(T value) {
+  using UnsignedType = typename std::make_unsigned<T>::type;
+
+  // Right-shift of negative values is implementation specific.
+  // Assert the implementation does what we expect, which is that shifting any
+  // positive value by sizeof(T) * 8 - 1 gives an all 0 bitmap, and a negative
+  // value gives and all 1 bitmap.
+  constexpr uint64_t kUnsignedZero = 0u;
+  constexpr int64_t kNegativeOne = -1;
+  constexpr int64_t kPositiveOne = 1;
+  static_assert(static_cast<uint64_t>(kNegativeOne >> 63) == ~kUnsignedZero,
+                "implementation does not support assumed rightshift");
+  static_assert(static_cast<uint64_t>(kPositiveOne >> 63) == kUnsignedZero,
+                "implementation does not support assumed rightshift");
+
+  return (static_cast<UnsignedType>(value) << 1) ^
+         static_cast<UnsignedType>(value >> (sizeof(T) * 8 - 1));
+}
+
+// Proto types: sint64, sint32.
+template <typename T>
+inline typename std::make_signed<T>::type ZigZagDecode(T value) {
+  using UnsignedType = typename std::make_unsigned<T>::type;
+  using SignedType = typename std::make_signed<T>::type;
+  auto u_value = static_cast<UnsignedType>(value);
+  auto mask = static_cast<UnsignedType>(-static_cast<SignedType>(u_value & 1));
+  return static_cast<SignedType>((u_value >> 1) ^ mask);
+}
+
+template <typename T>
+inline uint8_t* WriteVarInt(T value, uint8_t* target) {
+  // If value is <= 0 we must first sign extend to int64_t (see [1]).
+  // Finally we always cast to an unsigned value to to avoid arithmetic
+  // (sign expanding) shifts in the while loop.
+  // [1]: "If you use int32 or int64 as the type for a negative number, the
+  // resulting varint is always ten bytes long".
+  // - developers.google.com/protocol-buffers/docs/encoding
+  // So for each input type we do the following casts:
+  // uintX_t -> uintX_t -> uintX_t
+  // int8_t  -> int64_t -> uint64_t
+  // int16_t -> int64_t -> uint64_t
+  // int32_t -> int64_t -> uint64_t
+  // int64_t -> int64_t -> uint64_t
+  using MaybeExtendedType =
+      typename std::conditional<std::is_unsigned<T>::value, T, int64_t>::type;
+  using UnsignedType = typename std::make_unsigned<MaybeExtendedType>::type;
+
+  MaybeExtendedType extended_value = static_cast<MaybeExtendedType>(value);
+  UnsignedType unsigned_value = static_cast<UnsignedType>(extended_value);
+
+  while (unsigned_value >= 0x80) {
+    *target++ = static_cast<uint8_t>(unsigned_value) | 0x80;
+    unsigned_value >>= 7;
+  }
+  *target = static_cast<uint8_t>(unsigned_value);
+  return target + 1;
+}
+
+// Writes a fixed-size redundant encoding of the given |value|. This is
+// used to backfill fixed-size reservations for the length field using a
+// non-canonical varint encoding (e.g. \x81\x80\x80\x00 instead of \x01).
+// See https://github.com/google/protobuf/issues/1530.
+// This is used mainly in two cases:
+// 1) At trace writing time, when starting a nested messages. The size of a
+//    nested message is not known until all its field have been written.
+//    |kMessageLengthFieldSize| bytes are reserved to encode the size field and
+//    backfilled at the end.
+// 2) When rewriting a message at trace filtering time, in protozero/filtering.
+//    At that point we know only the upper bound of the length (a filtered
+//    message is <= the original one) and we backfill after the message has been
+//    filtered.
+inline void WriteRedundantVarInt(uint32_t value,
+                                 uint8_t* buf,
+                                 size_t size = kMessageLengthFieldSize) {
+  for (size_t i = 0; i < size; ++i) {
+    const uint8_t msb = (i < size - 1) ? 0x80 : 0;
+    buf[i] = static_cast<uint8_t>(value) | msb;
+    value >>= 7;
+  }
+}
+
+template <uint32_t field_id>
+void StaticAssertSingleBytePreamble() {
+  static_assert(field_id < 16,
+                "Proto field id too big to fit in a single byte preamble");
+}
+
+// Parses a VarInt from the encoded buffer [start, end). |end| is STL-style and
+// points one byte past the end of buffer.
+// The parsed int value is stored in the output arg |value|. Returns a pointer
+// to the next unconsumed byte (so start < retval <= end) or |start| if the
+// VarInt could not be fully parsed because there was not enough space in the
+// buffer.
+inline const uint8_t* ParseVarInt(const uint8_t* start,
+                                  const uint8_t* end,
+                                  uint64_t* out_value) {
+  const uint8_t* pos = start;
+  uint64_t value = 0;
+  for (uint32_t shift = 0; pos < end && shift < 64u; shift += 7) {
+    // Cache *pos into |cur_byte| to prevent that the compiler dereferences the
+    // pointer twice (here and in the if() below) due to char* aliasing rules.
+    uint8_t cur_byte = *pos++;
+    value |= static_cast<uint64_t>(cur_byte & 0x7f) << shift;
+    if ((cur_byte & 0x80) == 0) {
+      // In valid cases we get here.
+      *out_value = value;
+      return pos;
+    }
+  }
+  *out_value = 0;
+  return start;
+}
+
+enum class RepetitionType {
+  kNotRepeated,
+  kRepeatedPacked,
+  kRepeatedNotPacked,
+};
+
+// Provide a common base struct for all templated FieldMetadata types to allow
+// simple checks if a given type is a FieldMetadata or not.
+struct FieldMetadataBase {
+  constexpr FieldMetadataBase() = default;
+};
+
+template <uint32_t field_id,
+          RepetitionType repetition_type,
+          ProtoSchemaType proto_schema_type,
+          typename CppFieldType,
+          typename MessageType>
+struct FieldMetadata : public FieldMetadataBase {
+  constexpr FieldMetadata() = default;
+
+  static constexpr int kFieldId = field_id;
+  // Whether this field is repeated, packed (repeated [packed-true]) or not
+  // (optional).
+  static constexpr RepetitionType kRepetitionType = repetition_type;
+  // Proto type of this field (e.g. int64, fixed32 or nested message).
+  static constexpr ProtoSchemaType kProtoFieldType = proto_schema_type;
+  // C++ type of this field (for nested messages - C++ protozero class).
+  using cpp_field_type = CppFieldType;
+  // Protozero message which this field belongs to.
+  using message_type = MessageType;
+};
+
+namespace internal {
+
+// Ideally we would create variables of FieldMetadata<...> type directly,
+// but before C++17's support for constexpr inline variables arrive, we have to
+// actually use pointers to inline functions instead to avoid having to define
+// symbols in *.pbzero.cc files.
+//
+// Note: protozero bindings will generate Message::kFieldName variable and which
+// can then be passed to TRACE_EVENT macro for inline writing of typed messages.
+// The fact that the former can be passed to the latter is a part of the stable
+// API, while the particular type is not and users should not rely on it.
+template <typename T>
+using FieldMetadataHelper = T (*)(void);
+
+}  // namespace internal
+}  // namespace proto_utils
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_PROTO_UTILS_H_
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_FIELD_H_
+#define INCLUDE_PERFETTO_PROTOZERO_FIELD_H_
+
+#include <stdint.h>
+
+#include <string>
+#include <vector>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/contiguous_memory_range.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace protozero {
+
+struct ConstBytes {
+  std::string ToStdString() const {
+    return std::string(reinterpret_cast<const char*>(data), size);
+  }
+
+  const uint8_t* data;
+  size_t size;
+};
+
+struct ConstChars {
+  // Allow implicit conversion to perfetto's base::StringView without depending
+  // on perfetto/base or viceversa.
+  static constexpr bool kConvertibleToStringView = true;
+  std::string ToStdString() const { return std::string(data, size); }
+
+  const char* data;
+  size_t size;
+};
+
+// A protobuf field decoded by the protozero proto decoders. It exposes
+// convenience accessors with minimal debug checks.
+// This class is used both by the iterator-based ProtoDecoder and by the
+// one-shot TypedProtoDecoder.
+// If the field is not valid the accessors consistently return zero-integers or
+// null strings.
+class Field {
+ public:
+  bool valid() const { return id_ != 0; }
+  uint16_t id() const { return id_; }
+  explicit operator bool() const { return valid(); }
+
+  proto_utils::ProtoWireType type() const {
+    auto res = static_cast<proto_utils::ProtoWireType>(type_);
+    PERFETTO_DCHECK(res == proto_utils::ProtoWireType::kVarInt ||
+                    res == proto_utils::ProtoWireType::kLengthDelimited ||
+                    res == proto_utils::ProtoWireType::kFixed32 ||
+                    res == proto_utils::ProtoWireType::kFixed64);
+    return res;
+  }
+
+  bool as_bool() const {
+    PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kVarInt);
+    return static_cast<bool>(int_value_);
+  }
+
+  uint32_t as_uint32() const {
+    PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kVarInt ||
+                    type() == proto_utils::ProtoWireType::kFixed32);
+    return static_cast<uint32_t>(int_value_);
+  }
+
+  int32_t as_int32() const {
+    PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kVarInt ||
+                    type() == proto_utils::ProtoWireType::kFixed32);
+    return static_cast<int32_t>(int_value_);
+  }
+
+  int32_t as_sint32() const {
+    PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kVarInt);
+    return proto_utils::ZigZagDecode(static_cast<uint32_t>(int_value_));
+  }
+
+  uint64_t as_uint64() const {
+    PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kVarInt ||
+                    type() == proto_utils::ProtoWireType::kFixed32 ||
+                    type() == proto_utils::ProtoWireType::kFixed64);
+    return int_value_;
+  }
+
+  int64_t as_int64() const {
+    PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kVarInt ||
+                    type() == proto_utils::ProtoWireType::kFixed32 ||
+                    type() == proto_utils::ProtoWireType::kFixed64);
+    return static_cast<int64_t>(int_value_);
+  }
+
+  int64_t as_sint64() const {
+    PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kVarInt);
+    return proto_utils::ZigZagDecode(static_cast<uint64_t>(int_value_));
+  }
+
+  float as_float() const {
+    PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kFixed32);
+    float res;
+    uint32_t value32 = static_cast<uint32_t>(int_value_);
+    memcpy(&res, &value32, sizeof(res));
+    return res;
+  }
+
+  double as_double() const {
+    PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kFixed64);
+    double res;
+    memcpy(&res, &int_value_, sizeof(res));
+    return res;
+  }
+
+  ConstChars as_string() const {
+    PERFETTO_DCHECK(!valid() ||
+                    type() == proto_utils::ProtoWireType::kLengthDelimited);
+    return ConstChars{reinterpret_cast<const char*>(data()), size_};
+  }
+
+  std::string as_std_string() const { return as_string().ToStdString(); }
+
+  ConstBytes as_bytes() const {
+    PERFETTO_DCHECK(!valid() ||
+                    type() == proto_utils::ProtoWireType::kLengthDelimited);
+    return ConstBytes{data(), size_};
+  }
+
+  const uint8_t* data() const {
+    PERFETTO_DCHECK(!valid() ||
+                    type() == proto_utils::ProtoWireType::kLengthDelimited);
+    return reinterpret_cast<const uint8_t*>(int_value_);
+  }
+
+  size_t size() const {
+    PERFETTO_DCHECK(!valid() ||
+                    type() == proto_utils::ProtoWireType::kLengthDelimited);
+    return size_;
+  }
+
+  uint64_t raw_int_value() const { return int_value_; }
+
+  void initialize(uint16_t id,
+                  uint8_t type,
+                  uint64_t int_value,
+                  uint32_t size) {
+    id_ = id;
+    type_ = type;
+    int_value_ = int_value;
+    size_ = size;
+  }
+
+  // For use with templates. This is used by RepeatedFieldIterator::operator*().
+  void get(bool* val) const { *val = as_bool(); }
+  void get(uint32_t* val) const { *val = as_uint32(); }
+  void get(int32_t* val) const { *val = as_int32(); }
+  void get(uint64_t* val) const { *val = as_uint64(); }
+  void get(int64_t* val) const { *val = as_int64(); }
+  void get(float* val) const { *val = as_float(); }
+  void get(double* val) const { *val = as_double(); }
+  void get(std::string* val) const { *val = as_std_string(); }
+  void get(ConstChars* val) const { *val = as_string(); }
+  void get(ConstBytes* val) const { *val = as_bytes(); }
+  void get_signed(int32_t* val) const { *val = as_sint32(); }
+  void get_signed(int64_t* val) const { *val = as_sint64(); }
+
+  // For enum types.
+  template <typename T,
+            typename = typename std::enable_if<std::is_enum<T>::value, T>::type>
+  void get(T* val) const {
+    *val = static_cast<T>(as_int32());
+  }
+
+  // Serializes the field back into a proto-encoded byte stream and appends it
+  // to |dst|. |dst| is resized accordingly.
+  void SerializeAndAppendTo(std::string* dst) const;
+
+  // Serializes the field back into a proto-encoded byte stream and appends it
+  // to |dst|. |dst| is resized accordingly.
+  void SerializeAndAppendTo(std::vector<uint8_t>* dst) const;
+
+ private:
+  template <typename Container>
+  void SerializeAndAppendToInternal(Container* dst) const;
+
+  // Fields are deliberately not initialized to keep the class trivially
+  // constructible. It makes a large perf difference for ProtoDecoder.
+
+  uint64_t int_value_;  // In kLengthDelimited this contains the data() addr.
+  uint32_t size_;       // Only valid when when type == kLengthDelimited.
+  uint16_t id_;         // Proto field ordinal.
+  uint8_t type_;        // proto_utils::ProtoWireType.
+};
+
+// The Field struct is used in a lot of perf-sensitive contexts.
+static_assert(sizeof(Field) == 16, "Field struct too big");
+
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_FIELD_H_
+// gen_amalgamated begin header: include/perfetto/tracing/core/forward_decls.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_CORE_FORWARD_DECLS_H_
+#define INCLUDE_PERFETTO_TRACING_CORE_FORWARD_DECLS_H_
+
+// Forward declares classes that are generated at build-time from protos.
+// First of all, why are we forward declaring at all?
+//  1. Chromium diverges from the Google style guide on this, because forward
+//     declarations typically make build times faster, and that's a desirable
+//     property for a large and complex codebase.
+//  2. Adding #include to build-time-generated headers from headers typically
+//     creates subtle build errors that are hard to spot in GN. This is because
+//     once a standard header (say foo.h) has an #include "protos/foo.gen.h",
+//     the build target that depends on foo.h needs to depend on the genrule
+//     that generates foo.gen.h. This is achievable using public_deps in GN but
+//     is not testable / enforceable, hence too easy to get wrong.
+
+// Historically the classes below used to be generated from the corresponding
+// .proto(s) at CL *check-in* time (!= build time) in the ::perfetto namespace.
+// Nowadays we have code everywhere that assume the right class is
+// ::perfetto::TraceConfig or the like. Back then other headers could just
+// forward declared ::perfetto::TraceConfig. These days, the real class is
+// ::perfetto::protos::gen::TraceConfig and core/trace_config.h aliases that as
+// using ::perfetto::TraceConfig = ::perfetto::protos::gen::TraceConfig.
+// In C++ one cannot forward declare a type alias (but only the aliased type).
+// Hence this header, which should be used every time one wants to forward
+// declare classes like TraceConfig.
+
+// The overall plan is that, when one of the classes below is needed:
+// The .h file includes this file.
+// The .cc file includes perfetto/tracing/core/trace_config.h (or equiv). That
+// header will pull the full declaration from trace_config.gen.h and will also
+// setup the alias in the ::perfetto namespace.
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class ChromeConfig;
+class CommitDataRequest;
+class DataSourceConfig;
+class DataSourceDescriptor;
+class ObservableEvents;
+class TraceConfig;
+class TraceStats;
+class TracingServiceCapabilities;
+class TracingServiceState;
+
+}  // namespace gen
+}  // namespace protos
+
+using ChromeConfig = ::perfetto::protos::gen::ChromeConfig;
+using CommitDataRequest = ::perfetto::protos::gen::CommitDataRequest;
+using DataSourceConfig = ::perfetto::protos::gen::DataSourceConfig;
+using DataSourceDescriptor = ::perfetto::protos::gen::DataSourceDescriptor;
+using ObservableEvents = ::perfetto::protos::gen::ObservableEvents;
+using TraceConfig = ::perfetto::protos::gen::TraceConfig;
+using TraceStats = ::perfetto::protos::gen::TraceStats;
+using TracingServiceCapabilities =
+    ::perfetto::protos::gen::TracingServiceCapabilities;
+using TracingServiceState = ::perfetto::protos::gen::TracingServiceState;
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_CORE_FORWARD_DECLS_H_
+// gen_amalgamated begin header: include/perfetto/tracing/internal/basic_types.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_INTERNAL_BASIC_TYPES_H_
+#define INCLUDE_PERFETTO_TRACING_INTERNAL_BASIC_TYPES_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+namespace perfetto {
+namespace internal {
+
+// A static_assert in tracing_muxer_impl.cc guarantees that this stays in sync
+// with the definition in tracing/core/basic_types.h
+using BufferId = uint16_t;
+
+// This is a direct index in the TracingMuxer::backends_ vector.
+// Backends are only added and never removed.
+using TracingBackendId = size_t;
+
+// Max numbers of data sources that can be registered in a process.
+constexpr size_t kMaxDataSources = 32;
+
+// Max instances for each data source type. This typically matches the
+// "max number of concurrent tracing sessions". However remember that a data
+// source can be instantiated more than once within one tracing session by
+// creating two entries for it in the trace config.
+constexpr size_t kMaxDataSourceInstances = 8;
+
+}  // namespace internal
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_INTERNAL_BASIC_TYPES_H_
+// gen_amalgamated begin header: include/perfetto/tracing/internal/data_source_internal.h
+// gen_amalgamated begin header: include/perfetto/tracing/trace_writer_base.h
+// gen_amalgamated begin header: include/perfetto/protozero/message_handle.h
+// gen_amalgamated begin header: include/perfetto/protozero/message.h
+// gen_amalgamated begin header: include/perfetto/protozero/scattered_stream_writer.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_SCATTERED_STREAM_WRITER_H_
+#define INCLUDE_PERFETTO_PROTOZERO_SCATTERED_STREAM_WRITER_H_
+
+#include <assert.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <string.h>
+
+// gen_amalgamated expanded: #include "perfetto/base/compiler.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/contiguous_memory_range.h"
+
+namespace protozero {
+
+// This class deals with the following problem: append-only proto messages want
+// to write a stream of bytes, without caring about the implementation of the
+// underlying buffer (which concretely will be either the trace ring buffer
+// or a heap-allocated buffer). The main deal is: proto messages don't know in
+// advance what their size will be.
+// Due to the tracing buffer being split into fixed-size chunks, on some
+// occasions, these writes need to be spread over two (or more) non-contiguous
+// chunks of memory. Similarly, when the buffer is backed by the heap, we want
+// to avoid realloc() calls, as they might cause a full copy of the contents
+// of the buffer.
+// The purpose of this class is to abstract away the non-contiguous write logic.
+// This class knows how to deal with writes as long as they fall in the same
+// ContiguousMemoryRange and defers the chunk-chaining logic to the Delegate.
+class PERFETTO_EXPORT ScatteredStreamWriter {
+ public:
+  class PERFETTO_EXPORT Delegate {
+   public:
+    virtual ~Delegate();
+    virtual ContiguousMemoryRange GetNewBuffer() = 0;
+  };
+
+  explicit ScatteredStreamWriter(Delegate* delegate);
+  ~ScatteredStreamWriter();
+
+  inline void WriteByte(uint8_t value) {
+    if (write_ptr_ >= cur_range_.end)
+      Extend();
+    *write_ptr_++ = value;
+  }
+
+  // Assumes that the caller checked that there is enough headroom.
+  // TODO(primiano): perf optimization, this is a tracing hot path. The
+  // compiler can make strong optimization on memcpy if the size arg is a
+  // constexpr. Make a templated variant of this for fixed-size writes.
+  // TODO(primiano): restrict / noalias might also help.
+  inline void WriteBytesUnsafe(const uint8_t* src, size_t size) {
+    uint8_t* const end = write_ptr_ + size;
+    assert(end <= cur_range_.end);
+    memcpy(write_ptr_, src, size);
+    write_ptr_ = end;
+  }
+
+  inline void WriteBytes(const uint8_t* src, size_t size) {
+    uint8_t* const end = write_ptr_ + size;
+    if (PERFETTO_LIKELY(end <= cur_range_.end))
+      return WriteBytesUnsafe(src, size);
+    WriteBytesSlowPath(src, size);
+  }
+
+  void WriteBytesSlowPath(const uint8_t* src, size_t size);
+
+  // Reserves a fixed amount of bytes to be backfilled later. The reserved range
+  // is guaranteed to be contiguous and not span across chunks. |size| has to be
+  // <= than the size of a new buffer returned by the Delegate::GetNewBuffer().
+  uint8_t* ReserveBytes(size_t size);
+
+  // Fast (but unsafe) version of the above. The caller must have previously
+  // checked that there are at least |size| contiguous bytes available.
+  // Returns only the start pointer of the reservation.
+  uint8_t* ReserveBytesUnsafe(size_t size) {
+    uint8_t* begin = write_ptr_;
+    write_ptr_ += size;
+    assert(write_ptr_ <= cur_range_.end);
+    return begin;
+  }
+
+  // Resets the buffer boundaries and the write pointer to the given |range|.
+  // Subsequent WriteByte(s) will write into |range|.
+  void Reset(ContiguousMemoryRange range);
+
+  // Number of contiguous free bytes in |cur_range_| that can be written without
+  // requesting a new buffer.
+  size_t bytes_available() const {
+    return static_cast<size_t>(cur_range_.end - write_ptr_);
+  }
+
+  uint8_t* write_ptr() const { return write_ptr_; }
+
+  uint64_t written() const {
+    return written_previously_ +
+           static_cast<uint64_t>(write_ptr_ - cur_range_.begin);
+  }
+
+ private:
+  ScatteredStreamWriter(const ScatteredStreamWriter&) = delete;
+  ScatteredStreamWriter& operator=(const ScatteredStreamWriter&) = delete;
+
+  void Extend();
+
+  Delegate* const delegate_;
+  ContiguousMemoryRange cur_range_;
+  uint8_t* write_ptr_;
+  uint64_t written_previously_ = 0;
+};
+
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_SCATTERED_STREAM_WRITER_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_MESSAGE_H_
+#define INCLUDE_PERFETTO_PROTOZERO_MESSAGE_H_
+
+#include <assert.h>
+#include <stdint.h>
+#include <string.h>
+
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/contiguous_memory_range.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_stream_writer.h"
+
+namespace perfetto {
+namespace shm_fuzz {
+class FakeProducer;
+}  // namespace shm_fuzz
+}  // namespace perfetto
+
+namespace protozero {
+
+class MessageArena;
+class MessageHandleBase;
+
+// Base class extended by the proto C++ stubs generated by the ProtoZero
+// compiler. This class provides the minimal runtime required to support
+// append-only operations and is designed for performance. None of the methods
+// require any dynamic memory allocation, unless more than 16 nested messages
+// are created via BeginNestedMessage() calls.
+class PERFETTO_EXPORT Message {
+ public:
+  friend class MessageHandleBase;
+
+  // The ctor is deliberately a no-op to avoid forwarding args from all
+  // subclasses. The real initialization is performed by Reset().
+  // Nested messages are allocated via placement new by MessageArena and
+  // implictly destroyed when the RootMessage's arena goes away. This is
+  // fine as long as all the fields are PODs, which is checked by the
+  // static_assert()s in the Reset() method.
+  Message() = default;
+
+  // Clears up the state, allowing the message to be reused as a fresh one.
+  void Reset(ScatteredStreamWriter*, MessageArena*);
+
+  // Commits all the changes to the buffer (backfills the size field of this and
+  // all nested messages) and seals the message. Returns the size of the message
+  // (and all nested sub-messages), without taking into account any chunking.
+  // Finalize is idempotent and can be called several times w/o side effects.
+  uint32_t Finalize();
+
+  // Optional. If is_valid() == true, the corresponding memory region (its
+  // length == proto_utils::kMessageLengthFieldSize) is backfilled with the size
+  // of this message (minus |size_already_written| below). This is the mechanism
+  // used by messages to backfill their corresponding size field in the parent
+  // message.
+  uint8_t* size_field() const { return size_field_; }
+  void set_size_field(uint8_t* size_field) { size_field_ = size_field; }
+
+  // This is to deal with case of backfilling the size of a root (non-nested)
+  // message which is split into multiple chunks. Upon finalization only the
+  // partial size that lies in the last chunk has to be backfilled.
+  void inc_size_already_written(uint32_t sz) { size_already_written_ += sz; }
+
+  Message* nested_message() { return nested_message_; }
+
+  bool is_finalized() const { return finalized_; }
+
+#if PERFETTO_DCHECK_IS_ON()
+  void set_handle(MessageHandleBase* handle) { handle_ = handle; }
+#endif
+
+  // Proto types: uint64, uint32, int64, int32, bool, enum.
+  template <typename T>
+  void AppendVarInt(uint32_t field_id, T value) {
+    if (nested_message_)
+      EndNestedMessage();
+
+    uint8_t buffer[proto_utils::kMaxSimpleFieldEncodedSize];
+    uint8_t* pos = buffer;
+
+    pos = proto_utils::WriteVarInt(proto_utils::MakeTagVarInt(field_id), pos);
+    // WriteVarInt encodes signed values in two's complement form.
+    pos = proto_utils::WriteVarInt(value, pos);
+    WriteToStream(buffer, pos);
+  }
+
+  // Proto types: sint64, sint32.
+  template <typename T>
+  void AppendSignedVarInt(uint32_t field_id, T value) {
+    AppendVarInt(field_id, proto_utils::ZigZagEncode(value));
+  }
+
+  // Proto types: bool, enum (small).
+  // Faster version of AppendVarInt for tiny numbers.
+  void AppendTinyVarInt(uint32_t field_id, int32_t value) {
+    PERFETTO_DCHECK(0 <= value && value < 0x80);
+    if (nested_message_)
+      EndNestedMessage();
+
+    uint8_t buffer[proto_utils::kMaxSimpleFieldEncodedSize];
+    uint8_t* pos = buffer;
+    // MakeTagVarInt gets super optimized here for constexpr.
+    pos = proto_utils::WriteVarInt(proto_utils::MakeTagVarInt(field_id), pos);
+    *pos++ = static_cast<uint8_t>(value);
+    WriteToStream(buffer, pos);
+  }
+
+  // Proto types: fixed64, sfixed64, fixed32, sfixed32, double, float.
+  template <typename T>
+  void AppendFixed(uint32_t field_id, T value) {
+    if (nested_message_)
+      EndNestedMessage();
+
+    uint8_t buffer[proto_utils::kMaxSimpleFieldEncodedSize];
+    uint8_t* pos = buffer;
+
+    pos = proto_utils::WriteVarInt(proto_utils::MakeTagFixed<T>(field_id), pos);
+    memcpy(pos, &value, sizeof(T));
+    pos += sizeof(T);
+    // TODO: Optimize memcpy performance, see http://crbug.com/624311 .
+    WriteToStream(buffer, pos);
+  }
+
+  void AppendString(uint32_t field_id, const char* str);
+
+  void AppendString(uint32_t field_id, const std::string& str) {
+    AppendBytes(field_id, str.data(), str.size());
+  }
+
+  void AppendBytes(uint32_t field_id, const void* value, size_t size);
+
+  // Append raw bytes for a field, using the supplied |ranges| to
+  // copy from |num_ranges| individual buffers.
+  size_t AppendScatteredBytes(uint32_t field_id,
+                              ContiguousMemoryRange* ranges,
+                              size_t num_ranges);
+
+  // Begins a nested message. The returned object is owned by the MessageArena
+  // of the root message. The nested message ends either when Finalize() is
+  // called or when any other Append* method is called in the parent class.
+  // The template argument T is supposed to be a stub class auto generated from
+  // a .proto, hence a subclass of Message.
+  template <class T>
+  T* BeginNestedMessage(uint32_t field_id) {
+    // This is to prevent subclasses (which should be autogenerated, though), to
+    // introduce extra state fields (which wouldn't be initialized by Reset()).
+    static_assert(std::is_base_of<Message, T>::value,
+                  "T must be a subclass of Message");
+    static_assert(sizeof(T) == sizeof(Message),
+                  "Message subclasses cannot introduce extra state.");
+    return static_cast<T*>(BeginNestedMessageInternal(field_id));
+  }
+
+  // Gives read-only access to the underlying stream_writer. This is used only
+  // by few internals to query the state of the underlying buffer. It is almost
+  // always a bad idea to poke at the stream_writer() internals.
+  const ScatteredStreamWriter* stream_writer() const { return stream_writer_; }
+
+  // Appends some raw bytes to the message. The use-case for this is preserving
+  // unknown fields in the decode -> re-encode path of xxx.gen.cc classes
+  // generated by the cppgen_plugin.cc.
+  // The caller needs to guarantee that the appended data is properly
+  // proto-encoded and each field has a proto preamble.
+  void AppendRawProtoBytes(const void* data, size_t size) {
+    const uint8_t* src = reinterpret_cast<const uint8_t*>(data);
+    WriteToStream(src, src + size);
+  }
+
+ private:
+  Message(const Message&) = delete;
+  Message& operator=(const Message&) = delete;
+
+  Message* BeginNestedMessageInternal(uint32_t field_id);
+
+  // Called by Finalize and Append* methods.
+  void EndNestedMessage();
+
+  void WriteToStream(const uint8_t* src_begin, const uint8_t* src_end) {
+    PERFETTO_DCHECK(!finalized_);
+    PERFETTO_DCHECK(src_begin <= src_end);
+    const uint32_t size = static_cast<uint32_t>(src_end - src_begin);
+    stream_writer_->WriteBytes(src_begin, size);
+    size_ += size;
+  }
+
+  // Only POD fields are allowed. This class's dtor is never called.
+  // See the comment on the static_assert in the corresponding .cc file.
+
+  // The stream writer interface used for the serialization.
+  ScatteredStreamWriter* stream_writer_;
+
+  // The storage used to allocate nested Message objects.
+  // This is owned by RootMessage<T>.
+  MessageArena* arena_;
+
+  // Pointer to the last child message created through BeginNestedMessage(), if
+  // any, nullptr otherwise. There is no need to keep track of more than one
+  // message per nesting level as the proto-zero API contract mandates that
+  // nested fields can be filled only in a stacked fashion. In other words,
+  // nested messages are finalized and sealed when any other field is set in the
+  // parent message (or the parent message itself is finalized) and cannot be
+  // accessed anymore afterwards.
+  Message* nested_message_;
+
+  // [optional] Pointer to a non-aligned pre-reserved var-int slot of
+  // kMessageLengthFieldSize bytes. When set, the Finalize() method will write
+  // the size of proto-encoded message in the pointed memory region.
+  uint8_t* size_field_;
+
+  // Keeps track of the size of the current message.
+  uint32_t size_;
+
+  // See comment for inc_size_already_written().
+  uint32_t size_already_written_;
+
+  // When true, no more changes to the message are allowed. This is to DCHECK
+  // attempts of writing to a message which has been Finalize()-d.
+  bool finalized_;
+
+#if PERFETTO_DCHECK_IS_ON()
+  // Current generation of message. Incremented on Reset.
+  // Used to detect stale handles.
+  uint32_t generation_;
+
+  MessageHandleBase* handle_;
+#endif
+};
+
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_MESSAGE_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_MESSAGE_HANDLE_H_
+#define INCLUDE_PERFETTO_PROTOZERO_MESSAGE_HANDLE_H_
+
+#include <functional>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+
+namespace protozero {
+
+class Message;
+
+// MessageHandle allows to decouple the lifetime of a proto message
+// from the underlying storage. It gives the following guarantees:
+// - The underlying message is finalized (if still alive) if the handle goes
+//   out of scope.
+// - In Debug / DCHECK_ALWAYS_ON builds, the handle becomes null once the
+//   message is finalized. This is to enforce the append-only API. For instance
+//   when adding two repeated messages, the addition of the 2nd one forces
+//   the finalization of the first.
+// Think about this as a WeakPtr<Message> which calls
+// Message::Finalize() when going out of scope.
+
+class PERFETTO_EXPORT MessageHandleBase {
+ public:
+  ~MessageHandleBase();
+
+  // Move-only type.
+  MessageHandleBase(MessageHandleBase&&) noexcept;
+  MessageHandleBase& operator=(MessageHandleBase&&);
+  explicit operator bool() const {
+#if PERFETTO_DCHECK_IS_ON()
+    PERFETTO_DCHECK(!message_ || generation_ == message_->generation_);
+#endif
+    return !!message_;
+  }
+
+ protected:
+  explicit MessageHandleBase(Message* = nullptr);
+  Message* operator->() const {
+#if PERFETTO_DCHECK_IS_ON()
+    PERFETTO_DCHECK(!message_ || generation_ == message_->generation_);
+#endif
+    return message_;
+  }
+  Message& operator*() const { return *(operator->()); }
+
+ private:
+  friend class Message;
+  MessageHandleBase(const MessageHandleBase&) = delete;
+  MessageHandleBase& operator=(const MessageHandleBase&) = delete;
+
+  void reset_message() {
+    // This is called by Message::Finalize().
+    PERFETTO_DCHECK(message_->is_finalized());
+    message_ = nullptr;
+  }
+
+  void Move(MessageHandleBase&&);
+
+  void FinalizeMessage() { message_->Finalize(); }
+
+  Message* message_;
+#if PERFETTO_DCHECK_IS_ON()
+  uint32_t generation_;
+#endif
+};
+
+template <typename T>
+class MessageHandle : public MessageHandleBase {
+ public:
+  MessageHandle() : MessageHandle(nullptr) {}
+  explicit MessageHandle(T* message) : MessageHandleBase(message) {}
+
+  explicit operator bool() const { return MessageHandleBase::operator bool(); }
+
+  T& operator*() const {
+    return static_cast<T&>(MessageHandleBase::operator*());
+  }
+
+  T* operator->() const {
+    return static_cast<T*>(MessageHandleBase::operator->());
+  }
+
+  T* get() const { return static_cast<T*>(MessageHandleBase::operator->()); }
+};
+
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_MESSAGE_HANDLE_H_
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_TRACE_WRITER_BASE_H_
+#define INCLUDE_PERFETTO_TRACING_TRACE_WRITER_BASE_H_
+
+// gen_amalgamated expanded: #include "perfetto/protozero/message_handle.h"
+
+namespace perfetto {
+
+namespace protos {
+namespace pbzero {
+class TracePacket;
+}  // namespace pbzero
+}  // namespace protos
+
+// The bare-minimum subset of the TraceWriter interface that is exposed as a
+// fully public API.
+// See comments in /include/perfetto/ext/tracing/core/trace_writer.h.
+class TraceWriterBase {
+ public:
+  virtual ~TraceWriterBase();
+
+  virtual protozero::MessageHandle<protos::pbzero::TracePacket>
+  NewTracePacket() = 0;
+
+  virtual void Flush(std::function<void()> callback = {}) = 0;
+  virtual uint64_t written() const = 0;
+};
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_TRACE_WRITER_BASE_H_
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_INTERNAL_DATA_SOURCE_INTERNAL_H_
+#define INCLUDE_PERFETTO_TRACING_INTERNAL_DATA_SOURCE_INTERNAL_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include <array>
+#include <atomic>
+#include <functional>
+#include <memory>
+#include <mutex>
+
+// No perfetto headers (other than tracing/api and protozero) should be here.
+// gen_amalgamated expanded: #include "perfetto/tracing/buffer_exhausted_policy.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/basic_types.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/trace_writer_base.h"
+
+namespace perfetto {
+
+class DataSourceBase;
+class InterceptorBase;
+class TraceWriterBase;
+
+namespace internal {
+
+class TracingTLS;
+
+// This maintains the internal state of a data source instance that is used only
+// to implement the tracing mechanics and is not exposed to the API client.
+// There is one of these object per DataSource instance (up to
+// kMaxDataSourceInstances).
+struct DataSourceState {
+  // This boolean flag determines whether the DataSource::Trace() method should
+  // do something or be a no-op. This flag doesn't give the full guarantee
+  // that tracing data will be visible in the trace, it just makes it so that
+  // the client attemps writing trace data and interacting with the service.
+  // For instance, when a tracing session ends the service will reject data
+  // commits that arrive too late even if the producer hasn't received the stop
+  // IPC message.
+  // This flag is set right before calling OnStart() and cleared right before
+  // calling OnStop(), unless using HandleStopAsynchronously() (see comments
+  // in data_source.h).
+  // Keep this flag as the first field. This allows the compiler to directly
+  // dereference the DataSourceState* pointer in the trace fast-path without
+  // doing extra pointr arithmetic.
+  bool trace_lambda_enabled = false;
+
+  // The central buffer id that all TraceWriter(s) created by this data source
+  // must target.
+  BufferId buffer_id = 0;
+
+  // The index within TracingMuxerImpl.backends_. Practically it allows to
+  // lookup the Producer object, and hence the IPC channel, for this data
+  // source.
+  TracingBackendId backend_id = 0;
+
+  // Each backend may connect to the tracing service multiple times if a
+  // disconnection occurs. This counter is used to uniquely identify each
+  // connection so that trace writers don't get reused across connections.
+  uint32_t backend_connection_id = 0;
+
+  // The instance id as assigned by the tracing service. Note that because a
+  // process can be connected to >1 services, this ID is not globally unique but
+  // is only unique within the scope of its backend.
+  // Only the tuple (backend_id, data_source_instance_id) is globally unique.
+  uint64_t data_source_instance_id = 0;
+
+  // A hash of the trace config used by this instance. This is used to
+  // de-duplicate instances for data sources with identical names (e.g., track
+  // event).
+  uint64_t config_hash = 0;
+
+  // If this data source is being intercepted (see Interceptor), this field
+  // contains the non-zero id of a registered interceptor which should receive
+  // trace packets for this session. Note: interceptor id 1 refers to the first
+  // element of TracingMuxerImpl::interceptors_ with successive numbers using
+  // the following slots.
+  uint32_t interceptor_id = 0;
+
+  // This lock is not held to implement Trace() and it's used only if the trace
+  // code wants to access its own data source state.
+  // This is to prevent that accessing the data source on an arbitrary embedder
+  // thread races with the internal IPC thread destroying the data source
+  // because of a end-of-tracing notification from the service.
+  // This lock is also used to protect access to a possible interceptor for this
+  // data source session.
+  std::recursive_mutex lock;
+  std::unique_ptr<DataSourceBase> data_source;
+  std::unique_ptr<InterceptorBase> interceptor;
+};
+
+// This is to allow lazy-initialization and avoid static initializers and
+// at-exit destructors. All the entries are initialized via placement-new when
+// DataSource::Register() is called, see TracingMuxerImpl::RegisterDataSource().
+struct DataSourceStateStorage {
+  alignas(DataSourceState) char storage[sizeof(DataSourceState)]{};
+};
+
+// Per-DataSource-type global state.
+struct DataSourceStaticState {
+  // Unique index of the data source, assigned at registration time.
+  uint32_t index = kMaxDataSources;
+
+  // A bitmap that tells about the validity of each |instances| entry. When the
+  // i-th bit of the bitmap it's set, instances[i] is valid.
+  std::atomic<uint32_t> valid_instances{};
+  std::array<DataSourceStateStorage, kMaxDataSourceInstances> instances{};
+
+  // Incremented whenever incremental state should be reset for any instance of
+  // this data source.
+  std::atomic<uint32_t> incremental_state_generation{};
+
+  // Can be used with a cached |valid_instances| bitmap.
+  DataSourceState* TryGetCached(uint32_t cached_bitmap, size_t n) {
+    return cached_bitmap & (1 << n)
+               ? reinterpret_cast<DataSourceState*>(&instances[n])
+               : nullptr;
+  }
+
+  DataSourceState* TryGet(size_t n) {
+    return TryGetCached(valid_instances.load(std::memory_order_acquire), n);
+  }
+
+  void CompilerAsserts() {
+    static_assert(sizeof(valid_instances.load()) * 8 >= kMaxDataSourceInstances,
+                  "kMaxDataSourceInstances too high");
+  }
+};
+
+// Per-DataSource-instance thread-local state.
+struct DataSourceInstanceThreadLocalState {
+  using IncrementalStatePointer = std::unique_ptr<void, void (*)(void*)>;
+
+  void Reset() {
+    trace_writer.reset();
+    incremental_state.reset();
+    backend_id = 0;
+    backend_connection_id = 0;
+    buffer_id = 0;
+    data_source_instance_id = 0;
+    incremental_state_generation = 0;
+    is_intercepted = false;
+  }
+
+  std::unique_ptr<TraceWriterBase> trace_writer;
+  IncrementalStatePointer incremental_state = {nullptr, [](void*) {}};
+  uint32_t incremental_state_generation;
+  TracingBackendId backend_id;
+  uint32_t backend_connection_id;
+  BufferId buffer_id;
+  uint64_t data_source_instance_id;
+  bool is_intercepted;
+};
+
+// Per-DataSource-type thread-local state.
+struct DataSourceThreadLocalState {
+  DataSourceStaticState* static_state = nullptr;
+
+  // Pointer to the parent tls object that holds us. Used to retrieve the
+  // generation, which is per-global-TLS and not per data-source.
+  TracingTLS* root_tls = nullptr;
+
+  // One entry per each data source instance.
+  std::array<DataSourceInstanceThreadLocalState, kMaxDataSourceInstances>
+      per_instance{};
+};
+
+}  // namespace internal
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_INTERNAL_DATA_SOURCE_INTERNAL_H_
+// gen_amalgamated begin header: include/perfetto/tracing/locked_handle.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_LOCKED_HANDLE_H_
+#define INCLUDE_PERFETTO_TRACING_LOCKED_HANDLE_H_
+
+#include <mutex>
+
+namespace perfetto {
+
+// This is used for GetDataSourceLocked(), in the (rare) case where the
+// tracing code wants to access the state of its data source from the Trace()
+// method.
+template <typename T>
+class LockedHandle {
+ public:
+  LockedHandle(std::recursive_mutex* mtx, T* obj) : lock_(*mtx), obj_(obj) {}
+  LockedHandle() = default;  // For the invalid case.
+  LockedHandle(LockedHandle&&) = default;
+  LockedHandle& operator=(LockedHandle&&) = default;
+
+  bool valid() const { return obj_; }
+  explicit operator bool() const { return valid(); }
+
+  T* operator->() {
+    assert(valid());
+    return obj_;
+  }
+
+  T& operator*() { return *(this->operator->()); }
+
+ private:
+  std::unique_lock<std::recursive_mutex> lock_;
+  T* obj_ = nullptr;
+};
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_LOCKED_HANDLE_H_
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_INTERCEPTOR_H_
+#define INCLUDE_PERFETTO_TRACING_INTERCEPTOR_H_
+
+// An interceptor is used to redirect trace packets written by a data source
+// into a custom backend instead of the normal Perfetto tracing service. For
+// example, the console interceptor prints all trace packets to the console as
+// they are generated. Another potential use is exporting trace data to another
+// tracing service such as Android ATrace or Windows ETW.
+//
+// An interceptor is defined by subclassing the perfetto::Interceptor template:
+//
+// class MyInterceptor : public perfetto::Interceptor<MyInterceptor> {
+//  public:
+//   ~MyInterceptor() override = default;
+//
+//   // This function is called for each intercepted trace packet. |context|
+//   // contains information about the trace packet as well as other state
+//   // tracked by the interceptor (e.g., see ThreadLocalState).
+//   //
+//   // Intercepted trace data is provided in the form of serialized protobuf
+//   // bytes, accessed through the |context.packet_data| field.
+//   //
+//   // Warning: this function can be called on any thread at any time. See
+//   // below for how to safely access shared interceptor data from here.
+//   static void OnTracePacket(InterceptorContext context) {
+//     perfetto::protos::pbzero::TracePacket::Decoder packet(
+//         context.packet_data.data, context.packet_data.size);
+//     // ... Write |packet| to the desired destination ...
+//   }
+// };
+//
+// An interceptor should be registered before any tracing sessions are started.
+// Note that the interceptor also needs to be activated through the trace config
+// as shown below.
+//
+//   perfetto::InterceptorDescriptor desc;
+//   desc.set_name("my_interceptor");
+//   MyInterceptor::Register(desc);
+//
+// Finally, an interceptor is enabled through the trace config like this:
+//
+//   perfetto::TraceConfig cfg;
+//   auto* ds_cfg = cfg.add_data_sources()->mutable_config();
+//   ds_cfg->set_name("data_source_to_intercept");   // e.g. "track_event"
+//   ds_cfg->mutable_interceptor_config()->set_name("my_interceptor");
+//
+// Once an interceptor is enabled, all data from the affected data sources is
+// sent to the interceptor instead of the main tracing buffer.
+//
+// Interceptor state
+// =================
+//
+// Besides the serialized trace packet data, the |OnTracePacket| interceptor
+// function can access three other types of state:
+//
+// 1. Global state: this is no different from a normal static function, but care
+//    must be taken because |OnTracePacket| can be called concurrently on any
+//    thread at any time.
+//
+// 2. Per-data source instance state: since the interceptor class is
+//    automatically instantiated for each intercepted data source, its fields
+//    can be used to store per-instance data such as the trace config. This data
+//    can be maintained through the OnSetup/OnStart/OnStop callbacks:
+//
+//    class MyInterceptor : public perfetto::Interceptor<MyInterceptor> {
+//     public:
+//      void OnSetup(const SetupArgs& args) override {
+//        enable_foo_ = args.config.interceptor_config().enable_foo();
+//      }
+//
+//      bool enable_foo_{};
+//    };
+//
+//    In the interceptor function this data must be accessed through a scoped
+//    lock for safety:
+//
+//    class MyInterceptor : public perfetto::Interceptor<MyInterceptor> {
+//      ...
+//      static void OnTracePacket(InterceptorContext context) {
+//        auto my_interceptor = context.GetInterceptorLocked();
+//        if (my_interceptor) {
+//           // Access fields of MyInterceptor here.
+//           if (my_interceptor->enable_foo_) { ... }
+//        }
+//        ...
+//      }
+//    };
+//
+//    Since accessing this data involves holding a lock, it should be done
+//    sparingly.
+//
+// 3. Per-thread/TraceWriter state: many data sources use interning to avoid
+//    repeating common data in the trace. Since the interning dictionaries are
+//    typically kept individually for each TraceWriter sequence (i.e., per
+//    thread), an interceptor can declare a data structure with lifetime
+//    matching the TraceWriter:
+//
+//    class MyInterceptor : public perfetto::Interceptor<MyInterceptor> {
+//     public:
+//      struct ThreadLocalState
+//          : public perfetto::InterceptorBase::ThreadLocalState {
+//        ThreadLocalState(ThreadLocalStateArgs&) override = default;
+//        ~ThreadLocalState() override = default;
+//
+//        std::map<size_t, std::string> event_names;
+//      };
+//    };
+//
+//    This per-thread state can then be accessed and maintained in
+//    |OnTracePacket| like this:
+//
+//    class MyInterceptor : public perfetto::Interceptor<MyInterceptor> {
+//      ...
+//      static void OnTracePacket(InterceptorContext context) {
+//        // Updating interned data.
+//        auto& tls = context.GetThreadLocalState();
+//        if (parsed_packet.sequence_flags() & perfetto::protos::pbzero::
+//                TracePacket::SEQ_INCREMENTAL_STATE_CLEARED) {
+//          tls.event_names.clear();
+//        }
+//        for (const auto& entry : parsed_packet.interned_data().event_names())
+//          tls.event_names[entry.iid()] = entry.name();
+//
+//        // Looking up interned data.
+//        if (parsed_packet.has_track_event()) {
+//          size_t name_iid = parsed_packet.track_event().name_iid();
+//          const std::string& event_name = tls.event_names[name_iid];
+//        }
+//        ...
+//      }
+//    };
+//
+
+#include <functional>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/forward_decls.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/basic_types.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/data_source_internal.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/locked_handle.h"
+
+namespace {
+class MockTracingMuxer;
+}
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class DataSourceConfig;
+class InterceptorDescriptor;
+}  // namespace gen
+}  // namespace protos
+
+using protos::gen::InterceptorDescriptor;
+
+namespace internal {
+class InterceptorTraceWriter;
+class TracingMuxer;
+class TracingMuxerFake;
+class TracingMuxerImpl;
+}  // namespace internal
+
+// A virtual base class for interceptors. Users should derive from the templated
+// subclass below instead of this one.
+class PERFETTO_EXPORT InterceptorBase {
+ public:
+  virtual ~InterceptorBase();
+
+  // A virtual base class for thread-local state needed by the interceptor.
+  // To define your own state, subclass this with the same name in the
+  // interceptor class. A reference to the state can then be looked up through
+  // context.GetThreadLocalState() in the trace packet interceptor function.
+  class ThreadLocalState {
+   public:
+    virtual ~ThreadLocalState();
+  };
+
+  struct SetupArgs {
+    const DataSourceConfig& config;
+  };
+  struct StartArgs {};
+  struct StopArgs {};
+
+  // Called when an intercepted data source is set up. Both the interceptor's
+  // and the data source's configuration is available in
+  // |SetupArgs|. Called on an internal Perfetto service thread, but not
+  // concurrently.
+  virtual void OnSetup(const SetupArgs&) {}
+
+  // Called when an intercepted data source starts. Called on an internal
+  // Perfetto service thread, but not concurrently.
+  virtual void OnStart(const StartArgs&) {}
+
+  // Called when an intercepted data source stops. Called on an internal
+  // Perfetto service thread, but not concurrently.
+  virtual void OnStop(const StopArgs&) {}
+
+ private:
+  friend class internal::InterceptorTraceWriter;
+  friend class internal::TracingMuxer;
+  friend class internal::TracingMuxerFake;
+  friend class internal::TracingMuxerImpl;
+  friend MockTracingMuxer;
+  template <class T>
+  friend class Interceptor;
+
+  // Data passed from DataSource::Trace() into the interceptor.
+  struct TracePacketCallbackArgs {
+    internal::DataSourceStaticState* static_state;
+    uint32_t instance_index;
+    protozero::ConstBytes packet_data;
+    ThreadLocalState* tls;
+  };
+
+  // These callback functions are defined as stateless to avoid accidentally
+  // introducing cross-thread data races.
+  using TLSFactory = std::unique_ptr<ThreadLocalState> (*)(
+      internal::DataSourceStaticState*,
+      uint32_t data_source_instance_index);
+  using TracePacketCallback = void (*)(TracePacketCallbackArgs);
+
+  static void RegisterImpl(
+      const InterceptorDescriptor& descriptor,
+      std::function<std::unique_ptr<InterceptorBase>()> factory,
+      InterceptorBase::TLSFactory tls_factory,
+      InterceptorBase::TracePacketCallback on_trace_packet);
+};
+
+// Templated interceptor instantiation. See above for usage.
+template <class InterceptorType>
+class PERFETTO_EXPORT Interceptor : public InterceptorBase {
+ public:
+  // A context object provided to the ThreadLocalState constructor. Provides
+  // access to the per-instance interceptor object.
+  class ThreadLocalStateArgs {
+   public:
+    ~ThreadLocalStateArgs() = default;
+
+    // Return a locked reference to the interceptor session. The session object
+    // will remain valid as long as the returned handle is in scope.
+    LockedHandle<InterceptorType> GetInterceptorLocked() {
+      auto* internal_state = static_state_->TryGet(data_source_instance_index_);
+      if (!internal_state)
+        return LockedHandle<InterceptorType>();
+      return LockedHandle<InterceptorType>(
+          &internal_state->lock,
+          static_cast<InterceptorType*>(internal_state->interceptor.get()));
+    }
+
+   private:
+    friend class Interceptor<InterceptorType>;
+    friend class InterceptorContext;
+    friend class TracingMuxerImpl;
+
+    ThreadLocalStateArgs(internal::DataSourceStaticState* static_state,
+                         uint32_t data_source_instance_index)
+        : static_state_(static_state),
+          data_source_instance_index_(data_source_instance_index) {}
+
+    internal::DataSourceStaticState* const static_state_;
+    const uint32_t data_source_instance_index_;
+  };
+
+  // A context object provided to each call into |OnTracePacket|. Contains the
+  // intercepted serialized trace packet data.
+  class InterceptorContext {
+   public:
+    InterceptorContext(InterceptorContext&&) noexcept = default;
+    ~InterceptorContext() = default;
+
+    // Return a locked reference to the interceptor session. The session object
+    // will remain valid as long as the returned handle is in scope.
+    LockedHandle<InterceptorType> GetInterceptorLocked() {
+      return tls_args_.GetInterceptorLocked();
+    }
+
+    // Return the thread-local state for this interceptor. See
+    // InterceptorBase::ThreadLocalState.
+    typename InterceptorType::ThreadLocalState& GetThreadLocalState() {
+      return static_cast<typename InterceptorType::ThreadLocalState&>(*tls_);
+    }
+
+    // A buffer containing the serialized TracePacket protocol buffer message.
+    // This memory is only valid during the call to OnTracePacket.
+    protozero::ConstBytes packet_data;
+
+   private:
+    friend class Interceptor<InterceptorType>;
+    InterceptorContext(TracePacketCallbackArgs args)
+        : packet_data(args.packet_data),
+          tls_args_(args.static_state, args.instance_index),
+          tls_(args.tls) {}
+    InterceptorContext(const InterceptorContext&) = delete;
+    InterceptorContext& operator=(const InterceptorContext&) = delete;
+
+    ThreadLocalStateArgs tls_args_;
+    InterceptorBase::ThreadLocalState* const tls_;
+  };
+
+  // Register the interceptor for use in tracing sessions.
+  // The optional |constructor_args| will be passed to the interceptor when it
+  // is constructed.
+  template <class... Args>
+  static void Register(const InterceptorDescriptor& descriptor,
+                       const Args&... constructor_args) {
+    auto factory = [constructor_args...]() {
+      return std::unique_ptr<InterceptorBase>(
+          new InterceptorType(constructor_args...));
+    };
+    auto tls_factory = [](internal::DataSourceStaticState* static_state,
+                          uint32_t data_source_instance_index) {
+      // Don't bother allocating TLS state unless the interceptor is actually
+      // using it.
+      if (std::is_same<typename InterceptorType::ThreadLocalState,
+                       InterceptorBase::ThreadLocalState>::value) {
+        return std::unique_ptr<InterceptorBase::ThreadLocalState>(nullptr);
+      }
+      ThreadLocalStateArgs args(static_state, data_source_instance_index);
+      return std::unique_ptr<InterceptorBase::ThreadLocalState>(
+          new typename InterceptorType::ThreadLocalState(args));
+    };
+    auto on_trace_packet = [](TracePacketCallbackArgs args) {
+      InterceptorType::OnTracePacket(InterceptorContext(std::move(args)));
+    };
+    RegisterImpl(descriptor, std::move(factory), std::move(tls_factory),
+                 std::move(on_trace_packet));
+  }
+};
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_INTERCEPTOR_H_
+// gen_amalgamated begin header: include/perfetto/tracing/track_event_state_tracker.h
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/track_event.pbzero.h
+// gen_amalgamated begin header: include/perfetto/protozero/field_writer.h
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_FIELD_WRITER_H_
+#define INCLUDE_PERFETTO_PROTOZERO_FIELD_WRITER_H_
+
+namespace protozero {
+namespace internal {
+
+template <proto_utils::ProtoSchemaType proto_schema_type>
+struct FieldWriter {
+  static_assert(proto_schema_type != proto_utils::ProtoSchemaType::kMessage,
+                "FieldWriter can't be used with nested messages");
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kDouble> {
+  inline static void Append(Message& message, uint32_t field_id, double value) {
+    message.AppendFixed(field_id, value);
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kFloat> {
+  inline static void Append(Message& message, uint32_t field_id, float value) {
+    message.AppendFixed(field_id, value);
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kBool> {
+  inline static void Append(Message& message, uint32_t field_id, bool value) {
+    message.AppendTinyVarInt(field_id, value);
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kInt32> {
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            int32_t value) {
+    message.AppendVarInt(field_id, value);
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kInt64> {
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            int64_t value) {
+    message.AppendVarInt(field_id, value);
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kUint32> {
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            uint32_t value) {
+    message.AppendVarInt(field_id, value);
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kUint64> {
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            uint64_t value) {
+    message.AppendVarInt(field_id, value);
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kSint32> {
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            int32_t value) {
+    message.AppendSignedVarInt(field_id, value);
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kSint64> {
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            int64_t value) {
+    message.AppendSignedVarInt(field_id, value);
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kFixed32> {
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            uint32_t value) {
+    message.AppendFixed(field_id, value);
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kFixed64> {
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            uint64_t value) {
+    message.AppendFixed(field_id, value);
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kSfixed32> {
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            int32_t value) {
+    message.AppendFixed(field_id, value);
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kSfixed64> {
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            int64_t value) {
+    message.AppendFixed(field_id, value);
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kEnum> {
+  template <typename EnumType>
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            EnumType value) {
+    message.AppendVarInt(field_id, value);
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kString> {
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            const char* data,
+                            size_t size) {
+    message.AppendBytes(field_id, data, size);
+  }
+
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            const std::string& value) {
+    message.AppendBytes(field_id, value.data(), value.size());
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kBytes> {
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            const uint8_t* data,
+                            size_t size) {
+    message.AppendBytes(field_id, data, size);
+  }
+
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            const std::string& value) {
+    message.AppendBytes(field_id, value.data(), value.size());
+  }
+};
+
+}  // namespace internal
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_FIELD_WRITER_H_
+// gen_amalgamated begin header: include/perfetto/protozero/packed_repeated_fields.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_PACKED_REPEATED_FIELDS_H_
+#define INCLUDE_PERFETTO_PROTOZERO_PACKED_REPEATED_FIELDS_H_
+
+#include <stdint.h>
+
+#include <array>
+#include <memory>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace protozero {
+
+// This file contains classes used when encoding packed repeated fields.
+// To encode such a field, the caller is first expected to accumulate all of the
+// values in one of the following types (depending on the wire type of the
+// individual elements), defined below:
+// * protozero::PackedVarInt
+// * protozero::PackedFixedSizeInt</*element_type=*/ uint32_t>
+// Then that buffer is passed to the protozero-generated setters as an argument.
+// After calling the setter, the buffer can be destroyed.
+//
+// An example of encoding a packed field:
+//   protozero::HeapBuffered<protozero::Message> msg;
+//   protozero::PackedVarInt buf;
+//   buf.Append(42);
+//   buf.Append(-1);
+//   msg->set_fieldname(buf);
+//   msg.SerializeAsString();
+
+class PackedBufferBase {
+ public:
+  PackedBufferBase() { Reset(); }
+
+  // Copy or move is disabled due to pointers to stack addresses.
+  PackedBufferBase(const PackedBufferBase&) = delete;
+  PackedBufferBase(PackedBufferBase&&) = delete;
+  PackedBufferBase& operator=(const PackedBufferBase&) = delete;
+  PackedBufferBase& operator=(PackedBufferBase&&) = delete;
+
+  void Reset();
+
+  const uint8_t* data() const { return storage_begin_; }
+
+  size_t size() const {
+    return static_cast<size_t>(write_ptr_ - storage_begin_);
+  }
+
+ protected:
+  void GrowIfNeeded() {
+    PERFETTO_DCHECK(write_ptr_ >= storage_begin_ && write_ptr_ <= storage_end_);
+    if (PERFETTO_UNLIKELY(write_ptr_ + kMaxElementSize > storage_end_)) {
+      GrowSlowpath();
+    }
+  }
+
+  void GrowSlowpath();
+
+  // max(uint64_t varint encoding, biggest fixed type (uint64)).
+  static constexpr size_t kMaxElementSize = 10;
+
+  // So sizeof(this) == 8k.
+  static constexpr size_t kOnStackStorageSize = 8192 - 32;
+
+  uint8_t* storage_begin_;
+  uint8_t* storage_end_;
+  uint8_t* write_ptr_;
+  std::unique_ptr<uint8_t[]> heap_buf_;
+  alignas(uint64_t) uint8_t stack_buf_[kOnStackStorageSize];
+};
+
+class PackedVarInt : public PackedBufferBase {
+ public:
+  template <typename T>
+  void Append(T value) {
+    GrowIfNeeded();
+    write_ptr_ = proto_utils::WriteVarInt(value, write_ptr_);
+  }
+};
+
+template <typename T /* e.g. uint32_t for Fixed32 */>
+class PackedFixedSizeInt : public PackedBufferBase {
+ public:
+  void Append(T value) {
+    static_assert(sizeof(T) == 4 || sizeof(T) == 8,
+                  "PackedFixedSizeInt should be used only with 32/64-bit ints");
+    static_assert(sizeof(T) <= kMaxElementSize,
+                  "kMaxElementSize needs to be updated");
+    GrowIfNeeded();
+    PERFETTO_DCHECK(reinterpret_cast<size_t>(write_ptr_) % alignof(T) == 0);
+    memcpy(reinterpret_cast<T*>(write_ptr_), &value, sizeof(T));
+    write_ptr_ += sizeof(T);
+  }
+};
+
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_PACKED_REPEATED_FIELDS_H_
+// gen_amalgamated begin header: include/perfetto/protozero/proto_decoder.h
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_PROTO_DECODER_H_
+#define INCLUDE_PERFETTO_PROTOZERO_PROTO_DECODER_H_
+
+#include <stdint.h>
+#include <array>
+#include <memory>
+#include <vector>
+
+// gen_amalgamated expanded: #include "perfetto/base/compiler.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/field.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace protozero {
+
+// A generic protobuf decoder. Doesn't require any knowledge about the proto
+// schema. It tokenizes fields, retrieves their ID and type and exposes
+// accessors to retrieve its values.
+// It does NOT recurse in nested submessages, instead it just computes their
+// boundaries, recursion is left to the caller.
+// This class is designed to be used in perf-sensitive contexts. It does not
+// allocate and does not perform any proto semantic checks (e.g. repeated /
+// required / optional). It's supposedly safe wrt out-of-bounds memory accesses
+// (see proto_decoder_fuzzer.cc).
+// This class serves also as a building block for TypedProtoDecoder, used when
+// the schema is known at compile time.
+class PERFETTO_EXPORT ProtoDecoder {
+ public:
+  // Creates a ProtoDecoder using the given |buffer| with size |length| bytes.
+  ProtoDecoder(const void* buffer, size_t length)
+      : begin_(reinterpret_cast<const uint8_t*>(buffer)),
+        end_(begin_ + length),
+        read_ptr_(begin_) {}
+  ProtoDecoder(const std::string& str) : ProtoDecoder(str.data(), str.size()) {}
+  ProtoDecoder(const ConstBytes& cb) : ProtoDecoder(cb.data, cb.size) {}
+
+  // Reads the next field from the buffer and advances the read cursor. If a
+  // full field cannot be read, the returned Field will be invalid (i.e.
+  // field.valid() == false).
+  Field ReadField();
+
+  // Finds the first field with the given id. Doesn't affect the read cursor.
+  Field FindField(uint32_t field_id);
+
+  // Resets the read cursor to the start of the buffer.
+  void Reset() { read_ptr_ = begin_; }
+
+  // Resets the read cursor to the given position (must be within the buffer).
+  void Reset(const uint8_t* pos) {
+    PERFETTO_DCHECK(pos >= begin_ && pos < end_);
+    read_ptr_ = pos;
+  }
+
+  // Returns the position of read cursor, relative to the start of the buffer.
+  size_t read_offset() const { return static_cast<size_t>(read_ptr_ - begin_); }
+
+  size_t bytes_left() const {
+    PERFETTO_DCHECK(read_ptr_ <= end_);
+    return static_cast<size_t>(end_ - read_ptr_);
+  }
+
+  const uint8_t* begin() const { return begin_; }
+  const uint8_t* end() const { return end_; }
+
+ protected:
+  const uint8_t* const begin_;
+  const uint8_t* const end_;
+  const uint8_t* read_ptr_ = nullptr;
+};
+
+// An iterator-like class used to iterate through repeated fields. Used by
+// TypedProtoDecoder. The iteration sequence is a bit counter-intuitive due to
+// the fact that fields_[field_id] holds the *last* value of the field, not the
+// first, but the remaining storage holds repeated fields in FIFO order.
+// Assume that we push the 10,11,12 into a repeated field with ID=1.
+//
+// Decoder memory layout:  [  fields storage  ] [ repeated fields storage ]
+// 1st iteration:           10
+// 2nd iteration:           11                   10
+// 3rd iteration:           12                   10 11
+//
+// We start the iteration @ fields_[num_fields], which is the start of the
+// repeated fields storage, proceed until the end and lastly jump @ fields_[id].
+template <typename T>
+class RepeatedFieldIterator {
+ public:
+  RepeatedFieldIterator(uint32_t field_id,
+                        const Field* begin,
+                        const Field* end,
+                        const Field* last)
+      : field_id_(field_id), iter_(begin), end_(end), last_(last) {
+    FindNextMatchingId();
+  }
+
+  // Constructs an invalid iterator.
+  RepeatedFieldIterator()
+      : field_id_(0u), iter_(nullptr), end_(nullptr), last_(nullptr) {}
+
+  explicit operator bool() const { return iter_ != end_; }
+  const Field& field() const { return *iter_; }
+
+  T operator*() const {
+    T val{};
+    iter_->get(&val);
+    return val;
+  }
+  const Field* operator->() const { return iter_; }
+
+  RepeatedFieldIterator& operator++() {
+    PERFETTO_DCHECK(iter_ != end_);
+    if (iter_ == last_) {
+      iter_ = end_;
+      return *this;
+    }
+    ++iter_;
+    FindNextMatchingId();
+    return *this;
+  }
+
+  RepeatedFieldIterator operator++(int) {
+    PERFETTO_DCHECK(iter_ != end_);
+    RepeatedFieldIterator it(*this);
+    ++(*this);
+    return it;
+  }
+
+ private:
+  void FindNextMatchingId() {
+    PERFETTO_DCHECK(iter_ != last_);
+    for (; iter_ != end_; ++iter_) {
+      if (iter_->id() == field_id_)
+        return;
+    }
+    iter_ = last_->valid() ? last_ : end_;
+  }
+
+  uint32_t field_id_;
+
+  // Initially points to the beginning of the repeated field storage, then is
+  // incremented as we call operator++().
+  const Field* iter_;
+
+  // Always points to fields_[size_], i.e. past the end of the storage.
+  const Field* end_;
+
+  // Always points to fields_[field_id].
+  const Field* last_;
+};
+
+// As RepeatedFieldIterator, but allows iterating over a packed repeated field
+// (which will be initially stored as a single length-delimited field).
+// See |GetPackedRepeatedField| for details.
+//
+// Assumes little endianness, and that the input buffers are well formed -
+// containing an exact multiple of encoded elements.
+template <proto_utils::ProtoWireType wire_type, typename CppType>
+class PackedRepeatedFieldIterator {
+ public:
+  PackedRepeatedFieldIterator(const uint8_t* data_begin,
+                              size_t size,
+                              bool* parse_error_ptr)
+      : data_end_(data_begin ? data_begin + size : nullptr),
+        read_ptr_(data_begin),
+        parse_error_(parse_error_ptr) {
+    using proto_utils::ProtoWireType;
+    static_assert(wire_type == ProtoWireType::kVarInt ||
+                      wire_type == ProtoWireType::kFixed32 ||
+                      wire_type == ProtoWireType::kFixed64,
+                  "invalid type");
+
+    PERFETTO_DCHECK(parse_error_ptr);
+
+    // Either the field is unset (and there are no data pointer), or the field
+    // is set with a zero length payload. Mark the iterator as invalid in both
+    // cases.
+    if (size == 0) {
+      curr_value_valid_ = false;
+      return;
+    }
+
+    if ((wire_type == ProtoWireType::kFixed32 && (size % 4) != 0) ||
+        (wire_type == ProtoWireType::kFixed64 && (size % 8) != 0)) {
+      *parse_error_ = true;
+      curr_value_valid_ = false;
+      return;
+    }
+
+    ++(*this);
+  }
+
+  const CppType operator*() const { return curr_value_; }
+  explicit operator bool() const { return curr_value_valid_; }
+
+  PackedRepeatedFieldIterator& operator++() {
+    using proto_utils::ProtoWireType;
+
+    if (PERFETTO_UNLIKELY(!curr_value_valid_))
+      return *this;
+
+    if (PERFETTO_UNLIKELY(read_ptr_ == data_end_)) {
+      curr_value_valid_ = false;
+      return *this;
+    }
+
+    if (wire_type == ProtoWireType::kVarInt) {
+      uint64_t new_value = 0;
+      const uint8_t* new_pos =
+          proto_utils::ParseVarInt(read_ptr_, data_end_, &new_value);
+
+      if (PERFETTO_UNLIKELY(new_pos == read_ptr_)) {
+        // Failed to decode the varint (probably incomplete buffer).
+        *parse_error_ = true;
+        curr_value_valid_ = false;
+      } else {
+        read_ptr_ = new_pos;
+        curr_value_ = static_cast<CppType>(new_value);
+      }
+    } else {  // kFixed32 or kFixed64
+      constexpr size_t kStep = wire_type == ProtoWireType::kFixed32 ? 4 : 8;
+
+      // NB: the raw buffer is not guaranteed to be aligned, so neither are
+      // these copies.
+      memcpy(&curr_value_, read_ptr_, sizeof(CppType));
+      read_ptr_ += kStep;
+    }
+
+    return *this;
+  }
+
+  PackedRepeatedFieldIterator operator++(int) {
+    PackedRepeatedFieldIterator it(*this);
+    ++(*this);
+    return it;
+  }
+
+ private:
+  // Might be null if the backing proto field isn't set.
+  const uint8_t* const data_end_;
+
+  // The iterator looks ahead by an element, so |curr_value| holds the value
+  // to be returned when the caller dereferences the iterator, and |read_ptr_|
+  // points at the start of the next element to be decoded.
+  // |read_ptr_| might be null if the backing proto field isn't set.
+  const uint8_t* read_ptr_;
+  CppType curr_value_ = 0;
+
+  // Set to false once we've exhausted the iterator, or encountered an error.
+  bool curr_value_valid_ = true;
+
+  // Where to set parsing errors, supplied by the caller.
+  bool* const parse_error_;
+};
+
+// This decoder loads all fields upfront, without recursing in nested messages.
+// It is used as a base class for typed decoders generated by the pbzero plugin.
+// The split between TypedProtoDecoderBase and TypedProtoDecoder<> is to have
+// unique definition of functions like ParseAllFields() and ExpandHeapStorage().
+// The storage (either on-stack or on-heap) for this class is organized as
+// follows:
+// |-------------------------- fields_ ----------------------|
+// [ field 0 (invalid) ] [ fields 1 .. N ] [ repeated fields ]
+//                                        ^                  ^
+//                                        num_fields_        size_
+class PERFETTO_EXPORT TypedProtoDecoderBase : public ProtoDecoder {
+ public:
+  // If the field |id| is known at compile time, prefer the templated
+  // specialization at<kFieldNumber>().
+  const Field& Get(uint32_t id) const {
+    return PERFETTO_LIKELY(id < num_fields_) ? fields_[id] : fields_[0];
+  }
+
+  // Returns an object that allows to iterate over all instances of a repeated
+  // field given its id. Example usage:
+  //   for (auto it = decoder.GetRepeated<int32_t>(N); it; ++it) { ... }
+  template <typename T>
+  RepeatedFieldIterator<T> GetRepeated(uint32_t field_id) const {
+    return RepeatedFieldIterator<T>(field_id, &fields_[num_fields_],
+                                    &fields_[size_], &fields_[field_id]);
+  }
+
+  // Returns an objects that allows to iterate over all entries of a packed
+  // repeated field given its id and type. The |wire_type| is necessary for
+  // decoding the packed field, the |cpp_type| is for convenience & stronger
+  // typing.
+  //
+  // The caller must also supply a pointer to a bool that is set to true if the
+  // packed buffer is found to be malformed while iterating (so you need to
+  // exhaust the iterator if you want to check the full extent of the buffer).
+  //
+  // Note that unlike standard protobuf parsers, protozero does not allow
+  // treating of packed repeated fields as non-packed and vice-versa (therefore
+  // not making the packed option forwards and backwards compatible). So
+  // the caller needs to use the right accessor for correct results.
+  template <proto_utils::ProtoWireType wire_type, typename cpp_type>
+  PackedRepeatedFieldIterator<wire_type, cpp_type> GetPackedRepeated(
+      uint32_t field_id,
+      bool* parse_error_location) const {
+    const Field& field = Get(field_id);
+    if (field.valid()) {
+      return PackedRepeatedFieldIterator<wire_type, cpp_type>(
+          field.data(), field.size(), parse_error_location);
+    } else {
+      return PackedRepeatedFieldIterator<wire_type, cpp_type>(
+          nullptr, 0, parse_error_location);
+    }
+  }
+
+ protected:
+  TypedProtoDecoderBase(Field* storage,
+                        uint32_t num_fields,
+                        uint32_t capacity,
+                        const uint8_t* buffer,
+                        size_t length)
+      : ProtoDecoder(buffer, length),
+        fields_(storage),
+        num_fields_(num_fields),
+        size_(num_fields),
+        capacity_(capacity) {
+    // The reason why Field needs to be trivially de/constructible is to avoid
+    // implicit initializers on all the ~1000 entries. We need it to initialize
+    // only on the first |max_field_id| fields, the remaining capacity doesn't
+    // require initialization.
+    static_assert(std::is_trivially_constructible<Field>::value &&
+                      std::is_trivially_destructible<Field>::value &&
+                      std::is_trivial<Field>::value,
+                  "Field must be a trivial aggregate type");
+    memset(fields_, 0, sizeof(Field) * num_fields_);
+  }
+
+  void ParseAllFields();
+
+  // Called when the default on-stack storage is exhausted and new repeated
+  // fields need to be pushed.
+  void ExpandHeapStorage();
+
+  // Used only in presence of a large number of repeated fields, when the
+  // default on-stack storage is exhausted.
+  std::unique_ptr<Field[]> heap_storage_;
+
+  // Points to the storage, either on-stack (default, provided by the template
+  // specialization) or |heap_storage_| after ExpandHeapStorage() is called, in
+  // case of a large number of repeated fields.
+  Field* fields_;
+
+  // Number of fields without accounting repeated storage. This is equal to
+  // MAX_FIELD_ID + 1 (to account for the invalid 0th field).
+  // This value is always <= size_ (and hence <= capacity);
+  uint32_t num_fields_;
+
+  // Number of active |fields_| entries. This is initially equal to the highest
+  // number of fields for the message (num_fields_ == MAX_FIELD_ID + 1) and can
+  // grow up to |capacity_| in the case of repeated fields.
+  uint32_t size_;
+
+  // Initially equal to kFieldsCapacity of the TypedProtoDecoder
+  // specialization. Can grow when falling back on heap-based storage, in which
+  // case it represents the size (#fields with each entry of a repeated field
+  // counted individually) of the |heap_storage_| array.
+  uint32_t capacity_;
+};
+
+// Template class instantiated by the auto-generated decoder classes declared in
+// xxx.pbzero.h files.
+template <int MAX_FIELD_ID, bool HAS_NONPACKED_REPEATED_FIELDS>
+class TypedProtoDecoder : public TypedProtoDecoderBase {
+ public:
+  TypedProtoDecoder(const uint8_t* buffer, size_t length)
+      : TypedProtoDecoderBase(on_stack_storage_,
+                              /*num_fields=*/MAX_FIELD_ID + 1,
+                              kCapacity,
+                              buffer,
+                              length) {
+    static_assert(MAX_FIELD_ID <= kMaxDecoderFieldId, "Field ordinal too high");
+    TypedProtoDecoderBase::ParseAllFields();
+  }
+
+  template <uint32_t FIELD_ID>
+  const Field& at() const {
+    static_assert(FIELD_ID <= MAX_FIELD_ID, "FIELD_ID > MAX_FIELD_ID");
+    return fields_[FIELD_ID];
+  }
+
+  TypedProtoDecoder(TypedProtoDecoder&& other) noexcept
+      : TypedProtoDecoderBase(std::move(other)) {
+    // If the moved-from decoder was using on-stack storage, we need to update
+    // our pointer to point to this decoder's on-stack storage.
+    if (fields_ == other.on_stack_storage_) {
+      fields_ = on_stack_storage_;
+      memcpy(on_stack_storage_, other.on_stack_storage_,
+             sizeof(on_stack_storage_));
+    }
+  }
+
+ private:
+  // In the case of non-repeated fields, this constant defines the highest field
+  // id we are able to decode. This is to limit the on-stack storage.
+  // In the case of repeated fields, this constant defines the max number of
+  // repeated fields that we'll be able to store before falling back on the
+  // heap. Keep this value in sync with the one in protozero_generator.cc.
+  static constexpr size_t kMaxDecoderFieldId = 999;
+
+  // If we the message has no repeated fields we need at most N Field entries
+  // in the on-stack storage, where N is the highest field id.
+  // Otherwise we need some room to store repeated fields.
+  static constexpr size_t kCapacity =
+      1 + (HAS_NONPACKED_REPEATED_FIELDS ? kMaxDecoderFieldId : MAX_FIELD_ID);
+
+  Field on_stack_storage_[kCapacity];
+};
+
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_PROTO_DECODER_H_
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_EVENT_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_EVENT_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class ChromeApplicationStateInfo;
+class ChromeCompositorSchedulerState;
+class ChromeContentSettingsEventInfo;
+class ChromeFrameReporter;
+class ChromeHistogramSample;
+class ChromeKeyedService;
+class ChromeLatencyInfo;
+class ChromeLegacyIpc;
+class ChromeMessagePump;
+class ChromeMojoEventInfo;
+class ChromeRendererSchedulerState;
+class ChromeUserEvent;
+class ChromeWindowHandleEventInfo;
+class DebugAnnotation;
+class LogMessage;
+class SourceLocation;
+class TaskExecution;
+class TrackEvent_LegacyEvent;
+enum TrackEvent_LegacyEvent_FlowDirection : int32_t;
+enum TrackEvent_LegacyEvent_InstantEventScope : int32_t;
+enum TrackEvent_Type : int32_t;
+
+enum TrackEvent_Type : int32_t {
+  TrackEvent_Type_TYPE_UNSPECIFIED = 0,
+  TrackEvent_Type_TYPE_SLICE_BEGIN = 1,
+  TrackEvent_Type_TYPE_SLICE_END = 2,
+  TrackEvent_Type_TYPE_INSTANT = 3,
+  TrackEvent_Type_TYPE_COUNTER = 4,
+};
+
+const TrackEvent_Type TrackEvent_Type_MIN = TrackEvent_Type_TYPE_UNSPECIFIED;
+const TrackEvent_Type TrackEvent_Type_MAX = TrackEvent_Type_TYPE_COUNTER;
+
+enum TrackEvent_LegacyEvent_FlowDirection : int32_t {
+  TrackEvent_LegacyEvent_FlowDirection_FLOW_UNSPECIFIED = 0,
+  TrackEvent_LegacyEvent_FlowDirection_FLOW_IN = 1,
+  TrackEvent_LegacyEvent_FlowDirection_FLOW_OUT = 2,
+  TrackEvent_LegacyEvent_FlowDirection_FLOW_INOUT = 3,
+};
+
+const TrackEvent_LegacyEvent_FlowDirection TrackEvent_LegacyEvent_FlowDirection_MIN = TrackEvent_LegacyEvent_FlowDirection_FLOW_UNSPECIFIED;
+const TrackEvent_LegacyEvent_FlowDirection TrackEvent_LegacyEvent_FlowDirection_MAX = TrackEvent_LegacyEvent_FlowDirection_FLOW_INOUT;
+
+enum TrackEvent_LegacyEvent_InstantEventScope : int32_t {
+  TrackEvent_LegacyEvent_InstantEventScope_SCOPE_UNSPECIFIED = 0,
+  TrackEvent_LegacyEvent_InstantEventScope_SCOPE_GLOBAL = 1,
+  TrackEvent_LegacyEvent_InstantEventScope_SCOPE_PROCESS = 2,
+  TrackEvent_LegacyEvent_InstantEventScope_SCOPE_THREAD = 3,
+};
+
+const TrackEvent_LegacyEvent_InstantEventScope TrackEvent_LegacyEvent_InstantEventScope_MIN = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_UNSPECIFIED;
+const TrackEvent_LegacyEvent_InstantEventScope TrackEvent_LegacyEvent_InstantEventScope_MAX = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_THREAD;
+
+class EventName_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  EventName_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit EventName_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit EventName_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_iid() const { return at<1>().valid(); }
+  uint64_t iid() const { return at<1>().as_uint64(); }
+  bool has_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars name() const { return at<2>().as_string(); }
+};
+
+class EventName : public ::protozero::Message {
+ public:
+  using Decoder = EventName_Decoder;
+  enum : int32_t {
+    kIidFieldNumber = 1,
+    kNameFieldNumber = 2,
+  };
+
+  using FieldMetadata_Iid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      EventName>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Iid kIid() { return {}; }
+  void set_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Iid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      EventName>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class EventCategory_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  EventCategory_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit EventCategory_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit EventCategory_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_iid() const { return at<1>().valid(); }
+  uint64_t iid() const { return at<1>().as_uint64(); }
+  bool has_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars name() const { return at<2>().as_string(); }
+};
+
+class EventCategory : public ::protozero::Message {
+ public:
+  using Decoder = EventCategory_Decoder;
+  enum : int32_t {
+    kIidFieldNumber = 1,
+    kNameFieldNumber = 2,
+  };
+
+  using FieldMetadata_Iid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      EventCategory>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Iid kIid() { return {}; }
+  void set_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Iid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      EventCategory>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TrackEventDefaults_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/45, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  TrackEventDefaults_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TrackEventDefaults_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TrackEventDefaults_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_track_uuid() const { return at<11>().valid(); }
+  uint64_t track_uuid() const { return at<11>().as_uint64(); }
+  bool has_extra_counter_track_uuids() const { return at<31>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> extra_counter_track_uuids() const { return GetRepeated<uint64_t>(31); }
+  bool has_extra_double_counter_track_uuids() const { return at<45>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> extra_double_counter_track_uuids() const { return GetRepeated<uint64_t>(45); }
+};
+
+class TrackEventDefaults : public ::protozero::Message {
+ public:
+  using Decoder = TrackEventDefaults_Decoder;
+  enum : int32_t {
+    kTrackUuidFieldNumber = 11,
+    kExtraCounterTrackUuidsFieldNumber = 31,
+    kExtraDoubleCounterTrackUuidsFieldNumber = 45,
+  };
+
+  using FieldMetadata_TrackUuid =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEventDefaults>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TrackUuid kTrackUuid() { return {}; }
+  void set_track_uuid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TrackUuid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ExtraCounterTrackUuids =
+    ::protozero::proto_utils::FieldMetadata<
+      31,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEventDefaults>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ExtraCounterTrackUuids kExtraCounterTrackUuids() { return {}; }
+  void add_extra_counter_track_uuids(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ExtraCounterTrackUuids::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ExtraDoubleCounterTrackUuids =
+    ::protozero::proto_utils::FieldMetadata<
+      45,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEventDefaults>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ExtraDoubleCounterTrackUuids kExtraDoubleCounterTrackUuids() { return {}; }
+  void add_extra_double_counter_track_uuids(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ExtraDoubleCounterTrackUuids::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TrackEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/46, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  TrackEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TrackEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TrackEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_category_iids() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> category_iids() const { return GetRepeated<uint64_t>(3); }
+  bool has_categories() const { return at<22>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> categories() const { return GetRepeated<::protozero::ConstChars>(22); }
+  bool has_name_iid() const { return at<10>().valid(); }
+  uint64_t name_iid() const { return at<10>().as_uint64(); }
+  bool has_name() const { return at<23>().valid(); }
+  ::protozero::ConstChars name() const { return at<23>().as_string(); }
+  bool has_type() const { return at<9>().valid(); }
+  int32_t type() const { return at<9>().as_int32(); }
+  bool has_track_uuid() const { return at<11>().valid(); }
+  uint64_t track_uuid() const { return at<11>().as_uint64(); }
+  bool has_counter_value() const { return at<30>().valid(); }
+  int64_t counter_value() const { return at<30>().as_int64(); }
+  bool has_double_counter_value() const { return at<44>().valid(); }
+  double double_counter_value() const { return at<44>().as_double(); }
+  bool has_extra_counter_track_uuids() const { return at<31>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> extra_counter_track_uuids() const { return GetRepeated<uint64_t>(31); }
+  bool has_extra_counter_values() const { return at<12>().valid(); }
+  ::protozero::RepeatedFieldIterator<int64_t> extra_counter_values() const { return GetRepeated<int64_t>(12); }
+  bool has_extra_double_counter_track_uuids() const { return at<45>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> extra_double_counter_track_uuids() const { return GetRepeated<uint64_t>(45); }
+  bool has_extra_double_counter_values() const { return at<46>().valid(); }
+  ::protozero::RepeatedFieldIterator<double> extra_double_counter_values() const { return GetRepeated<double>(46); }
+  bool has_flow_ids() const { return at<36>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> flow_ids() const { return GetRepeated<uint64_t>(36); }
+  bool has_terminating_flow_ids() const { return at<42>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> terminating_flow_ids() const { return GetRepeated<uint64_t>(42); }
+  bool has_debug_annotations() const { return at<4>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> debug_annotations() const { return GetRepeated<::protozero::ConstBytes>(4); }
+  bool has_task_execution() const { return at<5>().valid(); }
+  ::protozero::ConstBytes task_execution() const { return at<5>().as_bytes(); }
+  bool has_log_message() const { return at<21>().valid(); }
+  ::protozero::ConstBytes log_message() const { return at<21>().as_bytes(); }
+  bool has_cc_scheduler_state() const { return at<24>().valid(); }
+  ::protozero::ConstBytes cc_scheduler_state() const { return at<24>().as_bytes(); }
+  bool has_chrome_user_event() const { return at<25>().valid(); }
+  ::protozero::ConstBytes chrome_user_event() const { return at<25>().as_bytes(); }
+  bool has_chrome_keyed_service() const { return at<26>().valid(); }
+  ::protozero::ConstBytes chrome_keyed_service() const { return at<26>().as_bytes(); }
+  bool has_chrome_legacy_ipc() const { return at<27>().valid(); }
+  ::protozero::ConstBytes chrome_legacy_ipc() const { return at<27>().as_bytes(); }
+  bool has_chrome_histogram_sample() const { return at<28>().valid(); }
+  ::protozero::ConstBytes chrome_histogram_sample() const { return at<28>().as_bytes(); }
+  bool has_chrome_latency_info() const { return at<29>().valid(); }
+  ::protozero::ConstBytes chrome_latency_info() const { return at<29>().as_bytes(); }
+  bool has_chrome_frame_reporter() const { return at<32>().valid(); }
+  ::protozero::ConstBytes chrome_frame_reporter() const { return at<32>().as_bytes(); }
+  bool has_chrome_application_state_info() const { return at<39>().valid(); }
+  ::protozero::ConstBytes chrome_application_state_info() const { return at<39>().as_bytes(); }
+  bool has_chrome_renderer_scheduler_state() const { return at<40>().valid(); }
+  ::protozero::ConstBytes chrome_renderer_scheduler_state() const { return at<40>().as_bytes(); }
+  bool has_chrome_window_handle_event_info() const { return at<41>().valid(); }
+  ::protozero::ConstBytes chrome_window_handle_event_info() const { return at<41>().as_bytes(); }
+  bool has_chrome_content_settings_event_info() const { return at<43>().valid(); }
+  ::protozero::ConstBytes chrome_content_settings_event_info() const { return at<43>().as_bytes(); }
+  bool has_source_location() const { return at<33>().valid(); }
+  ::protozero::ConstBytes source_location() const { return at<33>().as_bytes(); }
+  bool has_source_location_iid() const { return at<34>().valid(); }
+  uint64_t source_location_iid() const { return at<34>().as_uint64(); }
+  bool has_chrome_message_pump() const { return at<35>().valid(); }
+  ::protozero::ConstBytes chrome_message_pump() const { return at<35>().as_bytes(); }
+  bool has_chrome_mojo_event_info() const { return at<38>().valid(); }
+  ::protozero::ConstBytes chrome_mojo_event_info() const { return at<38>().as_bytes(); }
+  bool has_timestamp_delta_us() const { return at<1>().valid(); }
+  int64_t timestamp_delta_us() const { return at<1>().as_int64(); }
+  bool has_timestamp_absolute_us() const { return at<16>().valid(); }
+  int64_t timestamp_absolute_us() const { return at<16>().as_int64(); }
+  bool has_thread_time_delta_us() const { return at<2>().valid(); }
+  int64_t thread_time_delta_us() const { return at<2>().as_int64(); }
+  bool has_thread_time_absolute_us() const { return at<17>().valid(); }
+  int64_t thread_time_absolute_us() const { return at<17>().as_int64(); }
+  bool has_thread_instruction_count_delta() const { return at<8>().valid(); }
+  int64_t thread_instruction_count_delta() const { return at<8>().as_int64(); }
+  bool has_thread_instruction_count_absolute() const { return at<20>().valid(); }
+  int64_t thread_instruction_count_absolute() const { return at<20>().as_int64(); }
+  bool has_legacy_event() const { return at<6>().valid(); }
+  ::protozero::ConstBytes legacy_event() const { return at<6>().as_bytes(); }
+};
+
+class TrackEvent : public ::protozero::Message {
+ public:
+  using Decoder = TrackEvent_Decoder;
+  enum : int32_t {
+    kCategoryIidsFieldNumber = 3,
+    kCategoriesFieldNumber = 22,
+    kNameIidFieldNumber = 10,
+    kNameFieldNumber = 23,
+    kTypeFieldNumber = 9,
+    kTrackUuidFieldNumber = 11,
+    kCounterValueFieldNumber = 30,
+    kDoubleCounterValueFieldNumber = 44,
+    kExtraCounterTrackUuidsFieldNumber = 31,
+    kExtraCounterValuesFieldNumber = 12,
+    kExtraDoubleCounterTrackUuidsFieldNumber = 45,
+    kExtraDoubleCounterValuesFieldNumber = 46,
+    kFlowIdsFieldNumber = 36,
+    kTerminatingFlowIdsFieldNumber = 42,
+    kDebugAnnotationsFieldNumber = 4,
+    kTaskExecutionFieldNumber = 5,
+    kLogMessageFieldNumber = 21,
+    kCcSchedulerStateFieldNumber = 24,
+    kChromeUserEventFieldNumber = 25,
+    kChromeKeyedServiceFieldNumber = 26,
+    kChromeLegacyIpcFieldNumber = 27,
+    kChromeHistogramSampleFieldNumber = 28,
+    kChromeLatencyInfoFieldNumber = 29,
+    kChromeFrameReporterFieldNumber = 32,
+    kChromeApplicationStateInfoFieldNumber = 39,
+    kChromeRendererSchedulerStateFieldNumber = 40,
+    kChromeWindowHandleEventInfoFieldNumber = 41,
+    kChromeContentSettingsEventInfoFieldNumber = 43,
+    kSourceLocationFieldNumber = 33,
+    kSourceLocationIidFieldNumber = 34,
+    kChromeMessagePumpFieldNumber = 35,
+    kChromeMojoEventInfoFieldNumber = 38,
+    kTimestampDeltaUsFieldNumber = 1,
+    kTimestampAbsoluteUsFieldNumber = 16,
+    kThreadTimeDeltaUsFieldNumber = 2,
+    kThreadTimeAbsoluteUsFieldNumber = 17,
+    kThreadInstructionCountDeltaFieldNumber = 8,
+    kThreadInstructionCountAbsoluteFieldNumber = 20,
+    kLegacyEventFieldNumber = 6,
+  };
+  using LegacyEvent = ::perfetto::protos::pbzero::TrackEvent_LegacyEvent;
+  using Type = ::perfetto::protos::pbzero::TrackEvent_Type;
+  static const Type TYPE_UNSPECIFIED = TrackEvent_Type_TYPE_UNSPECIFIED;
+  static const Type TYPE_SLICE_BEGIN = TrackEvent_Type_TYPE_SLICE_BEGIN;
+  static const Type TYPE_SLICE_END = TrackEvent_Type_TYPE_SLICE_END;
+  static const Type TYPE_INSTANT = TrackEvent_Type_TYPE_INSTANT;
+  static const Type TYPE_COUNTER = TrackEvent_Type_TYPE_COUNTER;
+
+  using FieldMetadata_CategoryIids =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CategoryIids kCategoryIids() { return {}; }
+  void add_category_iids(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CategoryIids::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Categories =
+    ::protozero::proto_utils::FieldMetadata<
+      22,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Categories kCategories() { return {}; }
+  void add_categories(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Categories::kFieldId, data, size);
+  }
+  void add_categories(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Categories::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NameIid =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NameIid kNameIid() { return {}; }
+  void set_name_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NameIid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      23,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Type =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::TrackEvent_Type,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Type kType() { return {}; }
+  void set_type(::perfetto::protos::pbzero::TrackEvent_Type value) {
+    static constexpr uint32_t field_id = FieldMetadata_Type::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TrackUuid =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TrackUuid kTrackUuid() { return {}; }
+  void set_track_uuid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TrackUuid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CounterValue =
+    ::protozero::proto_utils::FieldMetadata<
+      30,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CounterValue kCounterValue() { return {}; }
+  void set_counter_value(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CounterValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DoubleCounterValue =
+    ::protozero::proto_utils::FieldMetadata<
+      44,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kDouble,
+      double,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DoubleCounterValue kDoubleCounterValue() { return {}; }
+  void set_double_counter_value(double value) {
+    static constexpr uint32_t field_id = FieldMetadata_DoubleCounterValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kDouble>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ExtraCounterTrackUuids =
+    ::protozero::proto_utils::FieldMetadata<
+      31,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ExtraCounterTrackUuids kExtraCounterTrackUuids() { return {}; }
+  void add_extra_counter_track_uuids(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ExtraCounterTrackUuids::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ExtraCounterValues =
+    ::protozero::proto_utils::FieldMetadata<
+      12,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ExtraCounterValues kExtraCounterValues() { return {}; }
+  void add_extra_counter_values(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ExtraCounterValues::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ExtraDoubleCounterTrackUuids =
+    ::protozero::proto_utils::FieldMetadata<
+      45,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ExtraDoubleCounterTrackUuids kExtraDoubleCounterTrackUuids() { return {}; }
+  void add_extra_double_counter_track_uuids(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ExtraDoubleCounterTrackUuids::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ExtraDoubleCounterValues =
+    ::protozero::proto_utils::FieldMetadata<
+      46,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kDouble,
+      double,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ExtraDoubleCounterValues kExtraDoubleCounterValues() { return {}; }
+  void add_extra_double_counter_values(double value) {
+    static constexpr uint32_t field_id = FieldMetadata_ExtraDoubleCounterValues::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kDouble>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FlowIds =
+    ::protozero::proto_utils::FieldMetadata<
+      36,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FlowIds kFlowIds() { return {}; }
+  void add_flow_ids(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FlowIds::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TerminatingFlowIds =
+    ::protozero::proto_utils::FieldMetadata<
+      42,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TerminatingFlowIds kTerminatingFlowIds() { return {}; }
+  void add_terminating_flow_ids(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TerminatingFlowIds::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DebugAnnotations =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      DebugAnnotation,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DebugAnnotations kDebugAnnotations() { return {}; }
+  template <typename T = DebugAnnotation> T* add_debug_annotations() {
+    return BeginNestedMessage<T>(4);
+  }
+
+
+  using FieldMetadata_TaskExecution =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TaskExecution,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TaskExecution kTaskExecution() { return {}; }
+  template <typename T = TaskExecution> T* set_task_execution() {
+    return BeginNestedMessage<T>(5);
+  }
+
+
+  using FieldMetadata_LogMessage =
+    ::protozero::proto_utils::FieldMetadata<
+      21,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      LogMessage,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LogMessage kLogMessage() { return {}; }
+  template <typename T = LogMessage> T* set_log_message() {
+    return BeginNestedMessage<T>(21);
+  }
+
+
+  using FieldMetadata_CcSchedulerState =
+    ::protozero::proto_utils::FieldMetadata<
+      24,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeCompositorSchedulerState,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CcSchedulerState kCcSchedulerState() { return {}; }
+  template <typename T = ChromeCompositorSchedulerState> T* set_cc_scheduler_state() {
+    return BeginNestedMessage<T>(24);
+  }
+
+
+  using FieldMetadata_ChromeUserEvent =
+    ::protozero::proto_utils::FieldMetadata<
+      25,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeUserEvent,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeUserEvent kChromeUserEvent() { return {}; }
+  template <typename T = ChromeUserEvent> T* set_chrome_user_event() {
+    return BeginNestedMessage<T>(25);
+  }
+
+
+  using FieldMetadata_ChromeKeyedService =
+    ::protozero::proto_utils::FieldMetadata<
+      26,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeKeyedService,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeKeyedService kChromeKeyedService() { return {}; }
+  template <typename T = ChromeKeyedService> T* set_chrome_keyed_service() {
+    return BeginNestedMessage<T>(26);
+  }
+
+
+  using FieldMetadata_ChromeLegacyIpc =
+    ::protozero::proto_utils::FieldMetadata<
+      27,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeLegacyIpc,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeLegacyIpc kChromeLegacyIpc() { return {}; }
+  template <typename T = ChromeLegacyIpc> T* set_chrome_legacy_ipc() {
+    return BeginNestedMessage<T>(27);
+  }
+
+
+  using FieldMetadata_ChromeHistogramSample =
+    ::protozero::proto_utils::FieldMetadata<
+      28,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeHistogramSample,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeHistogramSample kChromeHistogramSample() { return {}; }
+  template <typename T = ChromeHistogramSample> T* set_chrome_histogram_sample() {
+    return BeginNestedMessage<T>(28);
+  }
+
+
+  using FieldMetadata_ChromeLatencyInfo =
+    ::protozero::proto_utils::FieldMetadata<
+      29,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeLatencyInfo,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeLatencyInfo kChromeLatencyInfo() { return {}; }
+  template <typename T = ChromeLatencyInfo> T* set_chrome_latency_info() {
+    return BeginNestedMessage<T>(29);
+  }
+
+
+  using FieldMetadata_ChromeFrameReporter =
+    ::protozero::proto_utils::FieldMetadata<
+      32,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeFrameReporter,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeFrameReporter kChromeFrameReporter() { return {}; }
+  template <typename T = ChromeFrameReporter> T* set_chrome_frame_reporter() {
+    return BeginNestedMessage<T>(32);
+  }
+
+
+  using FieldMetadata_ChromeApplicationStateInfo =
+    ::protozero::proto_utils::FieldMetadata<
+      39,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeApplicationStateInfo,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeApplicationStateInfo kChromeApplicationStateInfo() { return {}; }
+  template <typename T = ChromeApplicationStateInfo> T* set_chrome_application_state_info() {
+    return BeginNestedMessage<T>(39);
+  }
+
+
+  using FieldMetadata_ChromeRendererSchedulerState =
+    ::protozero::proto_utils::FieldMetadata<
+      40,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeRendererSchedulerState,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeRendererSchedulerState kChromeRendererSchedulerState() { return {}; }
+  template <typename T = ChromeRendererSchedulerState> T* set_chrome_renderer_scheduler_state() {
+    return BeginNestedMessage<T>(40);
+  }
+
+
+  using FieldMetadata_ChromeWindowHandleEventInfo =
+    ::protozero::proto_utils::FieldMetadata<
+      41,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeWindowHandleEventInfo,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeWindowHandleEventInfo kChromeWindowHandleEventInfo() { return {}; }
+  template <typename T = ChromeWindowHandleEventInfo> T* set_chrome_window_handle_event_info() {
+    return BeginNestedMessage<T>(41);
+  }
+
+
+  using FieldMetadata_ChromeContentSettingsEventInfo =
+    ::protozero::proto_utils::FieldMetadata<
+      43,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeContentSettingsEventInfo,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeContentSettingsEventInfo kChromeContentSettingsEventInfo() { return {}; }
+  template <typename T = ChromeContentSettingsEventInfo> T* set_chrome_content_settings_event_info() {
+    return BeginNestedMessage<T>(43);
+  }
+
+
+  using FieldMetadata_SourceLocation =
+    ::protozero::proto_utils::FieldMetadata<
+      33,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SourceLocation,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SourceLocation kSourceLocation() { return {}; }
+  template <typename T = SourceLocation> T* set_source_location() {
+    return BeginNestedMessage<T>(33);
+  }
+
+
+  using FieldMetadata_SourceLocationIid =
+    ::protozero::proto_utils::FieldMetadata<
+      34,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SourceLocationIid kSourceLocationIid() { return {}; }
+  void set_source_location_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SourceLocationIid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ChromeMessagePump =
+    ::protozero::proto_utils::FieldMetadata<
+      35,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeMessagePump,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeMessagePump kChromeMessagePump() { return {}; }
+  template <typename T = ChromeMessagePump> T* set_chrome_message_pump() {
+    return BeginNestedMessage<T>(35);
+  }
+
+
+  using FieldMetadata_ChromeMojoEventInfo =
+    ::protozero::proto_utils::FieldMetadata<
+      38,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeMojoEventInfo,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeMojoEventInfo kChromeMojoEventInfo() { return {}; }
+  template <typename T = ChromeMojoEventInfo> T* set_chrome_mojo_event_info() {
+    return BeginNestedMessage<T>(38);
+  }
+
+
+  using FieldMetadata_TimestampDeltaUs =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TimestampDeltaUs kTimestampDeltaUs() { return {}; }
+  void set_timestamp_delta_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TimestampDeltaUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TimestampAbsoluteUs =
+    ::protozero::proto_utils::FieldMetadata<
+      16,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TimestampAbsoluteUs kTimestampAbsoluteUs() { return {}; }
+  void set_timestamp_absolute_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TimestampAbsoluteUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ThreadTimeDeltaUs =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ThreadTimeDeltaUs kThreadTimeDeltaUs() { return {}; }
+  void set_thread_time_delta_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ThreadTimeDeltaUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ThreadTimeAbsoluteUs =
+    ::protozero::proto_utils::FieldMetadata<
+      17,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ThreadTimeAbsoluteUs kThreadTimeAbsoluteUs() { return {}; }
+  void set_thread_time_absolute_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ThreadTimeAbsoluteUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ThreadInstructionCountDelta =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ThreadInstructionCountDelta kThreadInstructionCountDelta() { return {}; }
+  void set_thread_instruction_count_delta(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ThreadInstructionCountDelta::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ThreadInstructionCountAbsolute =
+    ::protozero::proto_utils::FieldMetadata<
+      20,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ThreadInstructionCountAbsolute kThreadInstructionCountAbsolute() { return {}; }
+  void set_thread_instruction_count_absolute(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ThreadInstructionCountAbsolute::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LegacyEvent =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TrackEvent_LegacyEvent,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LegacyEvent kLegacyEvent() { return {}; }
+  template <typename T = TrackEvent_LegacyEvent> T* set_legacy_event() {
+    return BeginNestedMessage<T>(6);
+  }
+
+};
+
+class TrackEvent_LegacyEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/19, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TrackEvent_LegacyEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TrackEvent_LegacyEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TrackEvent_LegacyEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name_iid() const { return at<1>().valid(); }
+  uint64_t name_iid() const { return at<1>().as_uint64(); }
+  bool has_phase() const { return at<2>().valid(); }
+  int32_t phase() const { return at<2>().as_int32(); }
+  bool has_duration_us() const { return at<3>().valid(); }
+  int64_t duration_us() const { return at<3>().as_int64(); }
+  bool has_thread_duration_us() const { return at<4>().valid(); }
+  int64_t thread_duration_us() const { return at<4>().as_int64(); }
+  bool has_thread_instruction_delta() const { return at<15>().valid(); }
+  int64_t thread_instruction_delta() const { return at<15>().as_int64(); }
+  bool has_unscoped_id() const { return at<6>().valid(); }
+  uint64_t unscoped_id() const { return at<6>().as_uint64(); }
+  bool has_local_id() const { return at<10>().valid(); }
+  uint64_t local_id() const { return at<10>().as_uint64(); }
+  bool has_global_id() const { return at<11>().valid(); }
+  uint64_t global_id() const { return at<11>().as_uint64(); }
+  bool has_id_scope() const { return at<7>().valid(); }
+  ::protozero::ConstChars id_scope() const { return at<7>().as_string(); }
+  bool has_use_async_tts() const { return at<9>().valid(); }
+  bool use_async_tts() const { return at<9>().as_bool(); }
+  bool has_bind_id() const { return at<8>().valid(); }
+  uint64_t bind_id() const { return at<8>().as_uint64(); }
+  bool has_bind_to_enclosing() const { return at<12>().valid(); }
+  bool bind_to_enclosing() const { return at<12>().as_bool(); }
+  bool has_flow_direction() const { return at<13>().valid(); }
+  int32_t flow_direction() const { return at<13>().as_int32(); }
+  bool has_instant_event_scope() const { return at<14>().valid(); }
+  int32_t instant_event_scope() const { return at<14>().as_int32(); }
+  bool has_pid_override() const { return at<18>().valid(); }
+  int32_t pid_override() const { return at<18>().as_int32(); }
+  bool has_tid_override() const { return at<19>().valid(); }
+  int32_t tid_override() const { return at<19>().as_int32(); }
+};
+
+class TrackEvent_LegacyEvent : public ::protozero::Message {
+ public:
+  using Decoder = TrackEvent_LegacyEvent_Decoder;
+  enum : int32_t {
+    kNameIidFieldNumber = 1,
+    kPhaseFieldNumber = 2,
+    kDurationUsFieldNumber = 3,
+    kThreadDurationUsFieldNumber = 4,
+    kThreadInstructionDeltaFieldNumber = 15,
+    kUnscopedIdFieldNumber = 6,
+    kLocalIdFieldNumber = 10,
+    kGlobalIdFieldNumber = 11,
+    kIdScopeFieldNumber = 7,
+    kUseAsyncTtsFieldNumber = 9,
+    kBindIdFieldNumber = 8,
+    kBindToEnclosingFieldNumber = 12,
+    kFlowDirectionFieldNumber = 13,
+    kInstantEventScopeFieldNumber = 14,
+    kPidOverrideFieldNumber = 18,
+    kTidOverrideFieldNumber = 19,
+  };
+  using FlowDirection = ::perfetto::protos::pbzero::TrackEvent_LegacyEvent_FlowDirection;
+  using InstantEventScope = ::perfetto::protos::pbzero::TrackEvent_LegacyEvent_InstantEventScope;
+  static const FlowDirection FLOW_UNSPECIFIED = TrackEvent_LegacyEvent_FlowDirection_FLOW_UNSPECIFIED;
+  static const FlowDirection FLOW_IN = TrackEvent_LegacyEvent_FlowDirection_FLOW_IN;
+  static const FlowDirection FLOW_OUT = TrackEvent_LegacyEvent_FlowDirection_FLOW_OUT;
+  static const FlowDirection FLOW_INOUT = TrackEvent_LegacyEvent_FlowDirection_FLOW_INOUT;
+  static const InstantEventScope SCOPE_UNSPECIFIED = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_UNSPECIFIED;
+  static const InstantEventScope SCOPE_GLOBAL = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_GLOBAL;
+  static const InstantEventScope SCOPE_PROCESS = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_PROCESS;
+  static const InstantEventScope SCOPE_THREAD = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_THREAD;
+
+  using FieldMetadata_NameIid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NameIid kNameIid() { return {}; }
+  void set_name_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NameIid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Phase =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Phase kPhase() { return {}; }
+  void set_phase(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Phase::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DurationUs =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DurationUs kDurationUs() { return {}; }
+  void set_duration_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DurationUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ThreadDurationUs =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ThreadDurationUs kThreadDurationUs() { return {}; }
+  void set_thread_duration_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ThreadDurationUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ThreadInstructionDelta =
+    ::protozero::proto_utils::FieldMetadata<
+      15,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ThreadInstructionDelta kThreadInstructionDelta() { return {}; }
+  void set_thread_instruction_delta(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ThreadInstructionDelta::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_UnscopedId =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UnscopedId kUnscopedId() { return {}; }
+  void set_unscoped_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_UnscopedId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LocalId =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LocalId kLocalId() { return {}; }
+  void set_local_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_LocalId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_GlobalId =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GlobalId kGlobalId() { return {}; }
+  void set_global_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_GlobalId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IdScope =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IdScope kIdScope() { return {}; }
+  void set_id_scope(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_IdScope::kFieldId, data, size);
+  }
+  void set_id_scope(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_IdScope::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_UseAsyncTts =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UseAsyncTts kUseAsyncTts() { return {}; }
+  void set_use_async_tts(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_UseAsyncTts::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BindId =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BindId kBindId() { return {}; }
+  void set_bind_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BindId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BindToEnclosing =
+    ::protozero::proto_utils::FieldMetadata<
+      12,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BindToEnclosing kBindToEnclosing() { return {}; }
+  void set_bind_to_enclosing(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_BindToEnclosing::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FlowDirection =
+    ::protozero::proto_utils::FieldMetadata<
+      13,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::TrackEvent_LegacyEvent_FlowDirection,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FlowDirection kFlowDirection() { return {}; }
+  void set_flow_direction(::perfetto::protos::pbzero::TrackEvent_LegacyEvent_FlowDirection value) {
+    static constexpr uint32_t field_id = FieldMetadata_FlowDirection::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_InstantEventScope =
+    ::protozero::proto_utils::FieldMetadata<
+      14,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::TrackEvent_LegacyEvent_InstantEventScope,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_InstantEventScope kInstantEventScope() { return {}; }
+  void set_instant_event_scope(::perfetto::protos::pbzero::TrackEvent_LegacyEvent_InstantEventScope value) {
+    static constexpr uint32_t field_id = FieldMetadata_InstantEventScope::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PidOverride =
+    ::protozero::proto_utils::FieldMetadata<
+      18,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PidOverride kPidOverride() { return {}; }
+  void set_pid_override(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PidOverride::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TidOverride =
+    ::protozero::proto_utils::FieldMetadata<
+      19,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TidOverride kTidOverride() { return {}; }
+  void set_tid_override(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TidOverride::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_TRACK_EVENT_STATE_TRACKER_H_
+#define INCLUDE_PERFETTO_TRACING_TRACK_EVENT_STATE_TRACKER_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/track_event.pbzero.h"
+
+#include <map>
+#include <string>
+#include <vector>
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+class TracePacket_Decoder;
+class TrackEvent;
+class TrackEvent_Decoder;
+}  // namespace pbzero
+}  // namespace protos
+
+// A helper for keeping track of incremental state when intercepting track
+// events.
+class PERFETTO_EXPORT TrackEventStateTracker {
+ public:
+  ~TrackEventStateTracker();
+
+  struct StackFrame {
+    uint64_t timestamp{};
+
+    // Only one of |name| and |name_iid| will be set.
+    std::string name;
+    uint64_t name_iid{};
+    uint64_t name_hash{};
+
+    // Only one of |category| and |category_iid| will be set.
+    std::string category;
+    uint64_t category_iid{};
+  };
+
+  struct Track {
+    uint64_t uuid{};
+    uint32_t index{};  // Ordinal number for the track in the tracing session.
+
+    std::string name;
+    int64_t pid{};
+    int64_t tid{};
+
+    // Opaque user data associated with the track.
+    std::vector<uint8_t> user_data;
+
+    // Stack of opened slices on this track.
+    std::vector<StackFrame> stack;
+  };
+
+  // State for a single trace writer sequence (typically a single thread).
+  struct SequenceState {
+    // Trace packet sequence defaults.
+    Track track;
+
+    // Interned state.
+#if PERFETTO_DCHECK_IS_ON()
+    uint32_t sequence_id{};
+#endif
+    std::map<uint64_t /*iid*/, std::string> event_names;
+    std::map<uint64_t /*iid*/, std::string> event_categories;
+    std::map<uint64_t /*iid*/, std::string> debug_annotation_names;
+  };
+
+  // State for the entire tracing session. Shared by all trace writer sequences
+  // participating in the session.
+  struct SessionState {
+    // Non-thread-bound tracks.
+    std::map<uint64_t /*uuid*/, Track> tracks;
+  };
+
+  // Represents a single decoded track event (without arguments).
+  struct ParsedTrackEvent {
+    explicit ParsedTrackEvent(
+        const perfetto::protos::pbzero::TrackEvent::Decoder&);
+
+    // Underlying event.
+    const perfetto::protos::pbzero::TrackEvent::Decoder& track_event;
+
+    // Event metadata.
+    uint64_t timestamp_ns{};
+    uint64_t duration_ns{};
+
+    size_t stack_depth{};
+
+    protozero::ConstChars category{};
+    protozero::ConstChars name{};
+    uint64_t name_hash{};
+  };
+
+  // Interface used by the tracker to access tracing session and sequence state
+  // and to report parsed track events.
+  class Delegate {
+   public:
+    virtual ~Delegate();
+
+    // Called to retrieve the session-global state shared by all sequences. The
+    // returned pointer must remain valid (locked) throughout the call to
+    // |ProcessTracePacket|.
+    virtual SessionState* GetSessionState() = 0;
+
+    // Called when the metadata (e.g., name) for a track changes. |Track| can be
+    // modified by the callback to attach user data.
+    virtual void OnTrackUpdated(Track&) = 0;
+
+    // If the packet given to |ProcessTracePacket| contains a track event, this
+    // method is called to report the properties of that event. Note that memory
+    // pointers in |TrackEvent| will only be valid during this call.
+    virtual void OnTrackEvent(const Track&, const ParsedTrackEvent&) = 0;
+  };
+
+  // Process a single trace packet, reporting any contained track event back via
+  // the delegate interface. |SequenceState| must correspond to the sequence
+  // that was used to write the packet.
+  static void ProcessTracePacket(Delegate&,
+                                 SequenceState&,
+                                 const protos::pbzero::TracePacket_Decoder&);
+
+ private:
+  static void UpdateIncrementalState(
+      Delegate&,
+      SequenceState&,
+      const protos::pbzero::TracePacket_Decoder&);
+};
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_TRACK_EVENT_STATE_TRACKER_H_
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_CONSOLE_INTERCEPTOR_H_
+#define INCLUDE_PERFETTO_TRACING_CONSOLE_INTERCEPTOR_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/compiler.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/interceptor.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/track_event_state_tracker.h"
+
+#include <stdarg.h>
+
+#include <functional>
+#include <map>
+#include <vector>
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+
+#if defined(__GNUC__) || defined(__clang__)
+#define PERFETTO_PRINTF_ATTR \
+  __attribute__((format(printf, /*format_index=*/2, /*first_to_check=*/3)))
+#else
+#define PERFETTO_PRINTF_ATTR
+#endif
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) && !defined(STDOUT_FILENO)
+#define STDOUT_FILENO 1
+#define STDERR_FILENO 2
+#endif
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+class DebugAnnotation_Decoder;
+class TracePacket_Decoder;
+class TrackEvent_Decoder;
+}  // namespace pbzero
+}  // namespace protos
+
+struct ConsoleColor;
+
+class PERFETTO_EXPORT ConsoleInterceptor
+    : public Interceptor<ConsoleInterceptor> {
+ public:
+  ~ConsoleInterceptor() override;
+
+  static void Register();
+  static void OnTracePacket(InterceptorContext context);
+
+  static void SetOutputFdForTesting(int fd);
+
+  void OnSetup(const SetupArgs&) override;
+  void OnStart(const StartArgs&) override;
+  void OnStop(const StopArgs&) override;
+
+  struct ThreadLocalState : public InterceptorBase::ThreadLocalState {
+    ThreadLocalState(ThreadLocalStateArgs&);
+    ~ThreadLocalState() override;
+
+    // Destination file. Assumed to stay valid until the program ends (i.e., is
+    // stderr or stdout).
+    int fd{};
+    bool use_colors{};
+
+    // Messages up to this length are buffered and written atomically. If a
+    // message is longer, it will be printed with multiple writes.
+    std::array<char, 1024> message_buffer{};
+    size_t buffer_pos{};
+
+    // We only support a single trace writer sequence per thread, so the
+    // sequence state is stored in TLS.
+    TrackEventStateTracker::SequenceState sequence_state;
+    uint64_t start_time_ns{};
+  };
+
+ private:
+  class Delegate;
+
+  // Appends a formatted message to |message_buffer_| or directly to the output
+  // file if the buffer is full.
+  static void Printf(InterceptorContext& context,
+                     const char* format,
+                     ...) PERFETTO_PRINTF_ATTR;
+  static void Flush(InterceptorContext& context);
+  static void SetColor(InterceptorContext& context, const ConsoleColor&);
+  static void SetColor(InterceptorContext& context, const char*);
+
+  static void PrintDebugAnnotations(InterceptorContext&,
+                                    const protos::pbzero::TrackEvent_Decoder&,
+                                    const ConsoleColor& slice_color,
+                                    const ConsoleColor& highlight_color);
+  static void PrintDebugAnnotationName(
+      InterceptorContext&,
+      const perfetto::protos::pbzero::DebugAnnotation_Decoder& annotation);
+  static void PrintDebugAnnotationValue(
+      InterceptorContext&,
+      const perfetto::protos::pbzero::DebugAnnotation_Decoder& annotation);
+
+  int fd_ = STDOUT_FILENO;
+  bool use_colors_ = true;
+
+  TrackEventStateTracker::SessionState session_state_;
+  uint64_t start_time_ns_{};
+};
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_CONSOLE_INTERCEPTOR_H_
+// gen_amalgamated begin header: include/perfetto/tracing/core/data_source_config.h
+// gen_amalgamated begin header: gen/protos/perfetto/config/data_source_config.gen.h
+// gen_amalgamated begin header: include/perfetto/protozero/cpp_message_obj.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_CPP_MESSAGE_OBJ_H_
+#define INCLUDE_PERFETTO_PROTOZERO_CPP_MESSAGE_OBJ_H_
+
+#include <stdint.h>
+
+#include <string>
+#include <vector>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace protozero {
+
+// Base class for generated .gen.h classes, which are full C++ objects that
+// support both ser and deserialization (but are not zero-copy).
+// This is only used by the "cpp" targets not the "pbzero" ones.
+class PERFETTO_EXPORT CppMessageObj {
+ public:
+  virtual ~CppMessageObj();
+  virtual std::string SerializeAsString() const = 0;
+  virtual std::vector<uint8_t> SerializeAsArray() const = 0;
+  virtual bool ParseFromArray(const void*, size_t) = 0;
+
+  bool ParseFromString(const std::string& str) {
+    return ParseFromArray(str.data(), str.size());
+  }
+};
+
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_CPP_MESSAGE_OBJ_H_
+// gen_amalgamated begin header: include/perfetto/protozero/copyable_ptr.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_COPYABLE_PTR_H_
+#define INCLUDE_PERFETTO_PROTOZERO_COPYABLE_PTR_H_
+
+#include <memory>
+
+namespace protozero {
+
+// This class is essentially a std::vector<T> of fixed size = 1.
+// It's a pointer wrapper with deep copying and deep equality comparison.
+// At all effects this wrapper behaves like the underlying T, with the exception
+// of the heap indirection.
+// Conversely to a std::unique_ptr, the pointer will be always valid, never
+// null. The problem it solves is the following: when generating C++ classes
+// from proto files, we want to keep each header hermetic (i.e. not #include
+// headers of dependent types). As such we can't directly instantiate T
+// field members but we can instead rely on pointers, so only the .cc file needs
+// to see the actual definition of T. If the generated classes were move-only we
+// could just use a unique_ptr there. But they aren't, hence this wrapper.
+// Converesely to unique_ptr, this wrapper:
+// - Default constructs the T instance in its constructor.
+// - Implements deep comparison in operator== instead of pointer comparison.
+template <typename T>
+class CopyablePtr {
+ public:
+  CopyablePtr() : ptr_(new T()) {}
+  ~CopyablePtr() = default;
+
+  // Copy operators.
+  CopyablePtr(const CopyablePtr& other) : ptr_(new T(*other.ptr_)) {}
+  CopyablePtr& operator=(const CopyablePtr& other) {
+    *ptr_ = *other.ptr_;
+    return *this;
+  }
+
+  // Move operators.
+  CopyablePtr(CopyablePtr&& other) noexcept : ptr_(std::move(other.ptr_)) {
+    other.ptr_.reset(new T());
+  }
+
+  CopyablePtr& operator=(CopyablePtr&& other) {
+    ptr_ = std::move(other.ptr_);
+    other.ptr_.reset(new T());
+    return *this;
+  }
+
+  T* get() { return ptr_.get(); }
+  const T* get() const { return ptr_.get(); }
+
+  T* operator->() { return ptr_.get(); }
+  const T* operator->() const { return ptr_.get(); }
+
+  T& operator*() { return *ptr_; }
+  const T& operator*() const { return *ptr_; }
+
+  friend bool operator==(const CopyablePtr& lhs, const CopyablePtr& rhs) {
+    return *lhs == *rhs;
+  }
+
+  friend bool operator!=(const CopyablePtr& lhs, const CopyablePtr& rhs) {
+    // In theory the underlying type might have a special operator!=
+    // implementation which is not just !(x == y). Respect that.
+    return *lhs != *rhs;
+  }
+
+ private:
+  std::unique_ptr<T> ptr_;
+};
+
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_COPYABLE_PTR_H_
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_DATA_SOURCE_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_DATA_SOURCE_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class DataSourceConfig;
+class TestConfig;
+class TestConfig_DummyFields;
+class InterceptorConfig;
+class ChromeConfig;
+enum DataSourceConfig_SessionInitiator : int;
+enum ChromeConfig_ClientPriority : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum DataSourceConfig_SessionInitiator : int {
+  DataSourceConfig_SessionInitiator_SESSION_INITIATOR_UNSPECIFIED = 0,
+  DataSourceConfig_SessionInitiator_SESSION_INITIATOR_TRUSTED_SYSTEM = 1,
+};
+
+class PERFETTO_EXPORT DataSourceConfig : public ::protozero::CppMessageObj {
+ public:
+  using SessionInitiator = DataSourceConfig_SessionInitiator;
+  static constexpr auto SESSION_INITIATOR_UNSPECIFIED = DataSourceConfig_SessionInitiator_SESSION_INITIATOR_UNSPECIFIED;
+  static constexpr auto SESSION_INITIATOR_TRUSTED_SYSTEM = DataSourceConfig_SessionInitiator_SESSION_INITIATOR_TRUSTED_SYSTEM;
+  static constexpr auto SessionInitiator_MIN = DataSourceConfig_SessionInitiator_SESSION_INITIATOR_UNSPECIFIED;
+  static constexpr auto SessionInitiator_MAX = DataSourceConfig_SessionInitiator_SESSION_INITIATOR_TRUSTED_SYSTEM;
+  enum FieldNumbers {
+    kNameFieldNumber = 1,
+    kTargetBufferFieldNumber = 2,
+    kTraceDurationMsFieldNumber = 3,
+    kStopTimeoutMsFieldNumber = 7,
+    kEnableExtraGuardrailsFieldNumber = 6,
+    kSessionInitiatorFieldNumber = 8,
+    kTracingSessionIdFieldNumber = 4,
+    kFtraceConfigFieldNumber = 100,
+    kInodeFileConfigFieldNumber = 102,
+    kProcessStatsConfigFieldNumber = 103,
+    kSysStatsConfigFieldNumber = 104,
+    kHeapprofdConfigFieldNumber = 105,
+    kJavaHprofConfigFieldNumber = 110,
+    kAndroidPowerConfigFieldNumber = 106,
+    kAndroidLogConfigFieldNumber = 107,
+    kGpuCounterConfigFieldNumber = 108,
+    kPackagesListConfigFieldNumber = 109,
+    kPerfEventConfigFieldNumber = 111,
+    kVulkanMemoryConfigFieldNumber = 112,
+    kTrackEventConfigFieldNumber = 113,
+    kAndroidPolledStateConfigFieldNumber = 114,
+    kChromeConfigFieldNumber = 101,
+    kInterceptorConfigFieldNumber = 115,
+    kLegacyConfigFieldNumber = 1000,
+    kForTestingFieldNumber = 1001,
+  };
+
+  DataSourceConfig();
+  ~DataSourceConfig() override;
+  DataSourceConfig(DataSourceConfig&&) noexcept;
+  DataSourceConfig& operator=(DataSourceConfig&&);
+  DataSourceConfig(const DataSourceConfig&);
+  DataSourceConfig& operator=(const DataSourceConfig&);
+  bool operator==(const DataSourceConfig&) const;
+  bool operator!=(const DataSourceConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name() const { return _has_field_[1]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
+
+  bool has_target_buffer() const { return _has_field_[2]; }
+  uint32_t target_buffer() const { return target_buffer_; }
+  void set_target_buffer(uint32_t value) { target_buffer_ = value; _has_field_.set(2); }
+
+  bool has_trace_duration_ms() const { return _has_field_[3]; }
+  uint32_t trace_duration_ms() const { return trace_duration_ms_; }
+  void set_trace_duration_ms(uint32_t value) { trace_duration_ms_ = value; _has_field_.set(3); }
+
+  bool has_stop_timeout_ms() const { return _has_field_[7]; }
+  uint32_t stop_timeout_ms() const { return stop_timeout_ms_; }
+  void set_stop_timeout_ms(uint32_t value) { stop_timeout_ms_ = value; _has_field_.set(7); }
+
+  bool has_enable_extra_guardrails() const { return _has_field_[6]; }
+  bool enable_extra_guardrails() const { return enable_extra_guardrails_; }
+  void set_enable_extra_guardrails(bool value) { enable_extra_guardrails_ = value; _has_field_.set(6); }
+
+  bool has_session_initiator() const { return _has_field_[8]; }
+  DataSourceConfig_SessionInitiator session_initiator() const { return session_initiator_; }
+  void set_session_initiator(DataSourceConfig_SessionInitiator value) { session_initiator_ = value; _has_field_.set(8); }
+
+  bool has_tracing_session_id() const { return _has_field_[4]; }
+  uint64_t tracing_session_id() const { return tracing_session_id_; }
+  void set_tracing_session_id(uint64_t value) { tracing_session_id_ = value; _has_field_.set(4); }
+
+  const std::string& ftrace_config_raw() const { return ftrace_config_; }
+  void set_ftrace_config_raw(const std::string& raw) { ftrace_config_ = raw; _has_field_.set(100); }
+
+  const std::string& inode_file_config_raw() const { return inode_file_config_; }
+  void set_inode_file_config_raw(const std::string& raw) { inode_file_config_ = raw; _has_field_.set(102); }
+
+  const std::string& process_stats_config_raw() const { return process_stats_config_; }
+  void set_process_stats_config_raw(const std::string& raw) { process_stats_config_ = raw; _has_field_.set(103); }
+
+  const std::string& sys_stats_config_raw() const { return sys_stats_config_; }
+  void set_sys_stats_config_raw(const std::string& raw) { sys_stats_config_ = raw; _has_field_.set(104); }
+
+  const std::string& heapprofd_config_raw() const { return heapprofd_config_; }
+  void set_heapprofd_config_raw(const std::string& raw) { heapprofd_config_ = raw; _has_field_.set(105); }
+
+  const std::string& java_hprof_config_raw() const { return java_hprof_config_; }
+  void set_java_hprof_config_raw(const std::string& raw) { java_hprof_config_ = raw; _has_field_.set(110); }
+
+  const std::string& android_power_config_raw() const { return android_power_config_; }
+  void set_android_power_config_raw(const std::string& raw) { android_power_config_ = raw; _has_field_.set(106); }
+
+  const std::string& android_log_config_raw() const { return android_log_config_; }
+  void set_android_log_config_raw(const std::string& raw) { android_log_config_ = raw; _has_field_.set(107); }
+
+  const std::string& gpu_counter_config_raw() const { return gpu_counter_config_; }
+  void set_gpu_counter_config_raw(const std::string& raw) { gpu_counter_config_ = raw; _has_field_.set(108); }
+
+  const std::string& packages_list_config_raw() const { return packages_list_config_; }
+  void set_packages_list_config_raw(const std::string& raw) { packages_list_config_ = raw; _has_field_.set(109); }
+
+  const std::string& perf_event_config_raw() const { return perf_event_config_; }
+  void set_perf_event_config_raw(const std::string& raw) { perf_event_config_ = raw; _has_field_.set(111); }
+
+  const std::string& vulkan_memory_config_raw() const { return vulkan_memory_config_; }
+  void set_vulkan_memory_config_raw(const std::string& raw) { vulkan_memory_config_ = raw; _has_field_.set(112); }
+
+  const std::string& track_event_config_raw() const { return track_event_config_; }
+  void set_track_event_config_raw(const std::string& raw) { track_event_config_ = raw; _has_field_.set(113); }
+
+  const std::string& android_polled_state_config_raw() const { return android_polled_state_config_; }
+  void set_android_polled_state_config_raw(const std::string& raw) { android_polled_state_config_ = raw; _has_field_.set(114); }
+
+  bool has_chrome_config() const { return _has_field_[101]; }
+  const ChromeConfig& chrome_config() const { return *chrome_config_; }
+  ChromeConfig* mutable_chrome_config() { _has_field_.set(101); return chrome_config_.get(); }
+
+  bool has_interceptor_config() const { return _has_field_[115]; }
+  const InterceptorConfig& interceptor_config() const { return *interceptor_config_; }
+  InterceptorConfig* mutable_interceptor_config() { _has_field_.set(115); return interceptor_config_.get(); }
+
+  bool has_legacy_config() const { return _has_field_[1000]; }
+  const std::string& legacy_config() const { return legacy_config_; }
+  void set_legacy_config(const std::string& value) { legacy_config_ = value; _has_field_.set(1000); }
+
+  bool has_for_testing() const { return _has_field_[1001]; }
+  const TestConfig& for_testing() const { return *for_testing_; }
+  TestConfig* mutable_for_testing() { _has_field_.set(1001); return for_testing_.get(); }
+
+ private:
+  std::string name_{};
+  uint32_t target_buffer_{};
+  uint32_t trace_duration_ms_{};
+  uint32_t stop_timeout_ms_{};
+  bool enable_extra_guardrails_{};
+  DataSourceConfig_SessionInitiator session_initiator_{};
+  uint64_t tracing_session_id_{};
+  std::string ftrace_config_;  // [lazy=true]
+  std::string inode_file_config_;  // [lazy=true]
+  std::string process_stats_config_;  // [lazy=true]
+  std::string sys_stats_config_;  // [lazy=true]
+  std::string heapprofd_config_;  // [lazy=true]
+  std::string java_hprof_config_;  // [lazy=true]
+  std::string android_power_config_;  // [lazy=true]
+  std::string android_log_config_;  // [lazy=true]
+  std::string gpu_counter_config_;  // [lazy=true]
+  std::string packages_list_config_;  // [lazy=true]
+  std::string perf_event_config_;  // [lazy=true]
+  std::string vulkan_memory_config_;  // [lazy=true]
+  std::string track_event_config_;  // [lazy=true]
+  std::string android_polled_state_config_;  // [lazy=true]
+  ::protozero::CopyablePtr<ChromeConfig> chrome_config_;
+  ::protozero::CopyablePtr<InterceptorConfig> interceptor_config_;
+  std::string legacy_config_{};
+  ::protozero::CopyablePtr<TestConfig> for_testing_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<1002> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_DATA_SOURCE_CONFIG_PROTO_CPP_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_CORE_DATA_SOURCE_CONFIG_H_
+#define INCLUDE_PERFETTO_TRACING_CORE_DATA_SOURCE_CONFIG_H_
+
+// Creates the aliases in the ::perfetto namespace, doing things like:
+// using ::perfetto::Foo = ::perfetto::protos::gen::Foo.
+// See comments in forward_decls.h for the historical reasons of this
+// indirection layer.
+// gen_amalgamated expanded: #include "perfetto/tracing/core/forward_decls.h"
+
+// gen_amalgamated expanded: #include "protos/perfetto/config/data_source_config.gen.h"
+
+#endif  // INCLUDE_PERFETTO_TRACING_CORE_DATA_SOURCE_CONFIG_H_
+// gen_amalgamated begin header: include/perfetto/tracing/core/data_source_descriptor.h
+// gen_amalgamated begin header: gen/protos/perfetto/common/data_source_descriptor.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DATA_SOURCE_DESCRIPTOR_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DATA_SOURCE_DESCRIPTOR_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class DataSourceDescriptor;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT DataSourceDescriptor : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNameFieldNumber = 1,
+    kWillNotifyOnStopFieldNumber = 2,
+    kWillNotifyOnStartFieldNumber = 3,
+    kHandlesIncrementalStateClearFieldNumber = 4,
+    kGpuCounterDescriptorFieldNumber = 5,
+    kTrackEventDescriptorFieldNumber = 6,
+  };
+
+  DataSourceDescriptor();
+  ~DataSourceDescriptor() override;
+  DataSourceDescriptor(DataSourceDescriptor&&) noexcept;
+  DataSourceDescriptor& operator=(DataSourceDescriptor&&);
+  DataSourceDescriptor(const DataSourceDescriptor&);
+  DataSourceDescriptor& operator=(const DataSourceDescriptor&);
+  bool operator==(const DataSourceDescriptor&) const;
+  bool operator!=(const DataSourceDescriptor& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name() const { return _has_field_[1]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
+
+  bool has_will_notify_on_stop() const { return _has_field_[2]; }
+  bool will_notify_on_stop() const { return will_notify_on_stop_; }
+  void set_will_notify_on_stop(bool value) { will_notify_on_stop_ = value; _has_field_.set(2); }
+
+  bool has_will_notify_on_start() const { return _has_field_[3]; }
+  bool will_notify_on_start() const { return will_notify_on_start_; }
+  void set_will_notify_on_start(bool value) { will_notify_on_start_ = value; _has_field_.set(3); }
+
+  bool has_handles_incremental_state_clear() const { return _has_field_[4]; }
+  bool handles_incremental_state_clear() const { return handles_incremental_state_clear_; }
+  void set_handles_incremental_state_clear(bool value) { handles_incremental_state_clear_ = value; _has_field_.set(4); }
+
+  const std::string& gpu_counter_descriptor_raw() const { return gpu_counter_descriptor_; }
+  void set_gpu_counter_descriptor_raw(const std::string& raw) { gpu_counter_descriptor_ = raw; _has_field_.set(5); }
+
+  const std::string& track_event_descriptor_raw() const { return track_event_descriptor_; }
+  void set_track_event_descriptor_raw(const std::string& raw) { track_event_descriptor_ = raw; _has_field_.set(6); }
+
+ private:
+  std::string name_{};
+  bool will_notify_on_stop_{};
+  bool will_notify_on_start_{};
+  bool handles_incremental_state_clear_{};
+  std::string gpu_counter_descriptor_;  // [lazy=true]
+  std::string track_event_descriptor_;  // [lazy=true]
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<7> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DATA_SOURCE_DESCRIPTOR_PROTO_CPP_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_CORE_DATA_SOURCE_DESCRIPTOR_H_
+#define INCLUDE_PERFETTO_TRACING_CORE_DATA_SOURCE_DESCRIPTOR_H_
+
+// Creates the aliases in the ::perfetto namespace, doing things like:
+// using ::perfetto::Foo = ::perfetto::protos::gen::Foo.
+// See comments in forward_decls.h for the historical reasons of this
+// indirection layer.
+// gen_amalgamated expanded: #include "perfetto/tracing/core/forward_decls.h"
+
+// gen_amalgamated expanded: #include "protos/perfetto/common/data_source_descriptor.gen.h"
+
+#endif  // INCLUDE_PERFETTO_TRACING_CORE_DATA_SOURCE_DESCRIPTOR_H_
+// gen_amalgamated begin header: include/perfetto/tracing/core/trace_config.h
+// gen_amalgamated begin header: gen/protos/perfetto/config/trace_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACE_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACE_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class TraceConfig;
+class TraceConfig_TraceFilter;
+class TraceConfig_IncidentReportConfig;
+class TraceConfig_IncrementalStateConfig;
+class TraceConfig_TriggerConfig;
+class TraceConfig_TriggerConfig_Trigger;
+class TraceConfig_GuardrailOverrides;
+class TraceConfig_StatsdMetadata;
+class TraceConfig_ProducerConfig;
+class TraceConfig_BuiltinDataSource;
+class TraceConfig_DataSource;
+class DataSourceConfig;
+class TestConfig;
+class TestConfig_DummyFields;
+class InterceptorConfig;
+class ChromeConfig;
+class TraceConfig_BufferConfig;
+enum TraceConfig_LockdownModeOperation : int;
+enum TraceConfig_CompressionType : int;
+enum TraceConfig_StatsdLogging : int;
+enum TraceConfig_TriggerConfig_TriggerMode : int;
+enum BuiltinClock : int;
+enum DataSourceConfig_SessionInitiator : int;
+enum ChromeConfig_ClientPriority : int;
+enum TraceConfig_BufferConfig_FillPolicy : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum TraceConfig_LockdownModeOperation : int {
+  TraceConfig_LockdownModeOperation_LOCKDOWN_UNCHANGED = 0,
+  TraceConfig_LockdownModeOperation_LOCKDOWN_CLEAR = 1,
+  TraceConfig_LockdownModeOperation_LOCKDOWN_SET = 2,
+};
+enum TraceConfig_CompressionType : int {
+  TraceConfig_CompressionType_COMPRESSION_TYPE_UNSPECIFIED = 0,
+  TraceConfig_CompressionType_COMPRESSION_TYPE_DEFLATE = 1,
+};
+enum TraceConfig_StatsdLogging : int {
+  TraceConfig_StatsdLogging_STATSD_LOGGING_UNSPECIFIED = 0,
+  TraceConfig_StatsdLogging_STATSD_LOGGING_ENABLED = 1,
+  TraceConfig_StatsdLogging_STATSD_LOGGING_DISABLED = 2,
+};
+enum TraceConfig_TriggerConfig_TriggerMode : int {
+  TraceConfig_TriggerConfig_TriggerMode_UNSPECIFIED = 0,
+  TraceConfig_TriggerConfig_TriggerMode_START_TRACING = 1,
+  TraceConfig_TriggerConfig_TriggerMode_STOP_TRACING = 2,
+};
+enum TraceConfig_BufferConfig_FillPolicy : int {
+  TraceConfig_BufferConfig_FillPolicy_UNSPECIFIED = 0,
+  TraceConfig_BufferConfig_FillPolicy_RING_BUFFER = 1,
+  TraceConfig_BufferConfig_FillPolicy_DISCARD = 2,
+};
+
+class PERFETTO_EXPORT TraceConfig : public ::protozero::CppMessageObj {
+ public:
+  using BufferConfig = TraceConfig_BufferConfig;
+  using DataSource = TraceConfig_DataSource;
+  using BuiltinDataSource = TraceConfig_BuiltinDataSource;
+  using ProducerConfig = TraceConfig_ProducerConfig;
+  using StatsdMetadata = TraceConfig_StatsdMetadata;
+  using GuardrailOverrides = TraceConfig_GuardrailOverrides;
+  using TriggerConfig = TraceConfig_TriggerConfig;
+  using IncrementalStateConfig = TraceConfig_IncrementalStateConfig;
+  using IncidentReportConfig = TraceConfig_IncidentReportConfig;
+  using TraceFilter = TraceConfig_TraceFilter;
+  using LockdownModeOperation = TraceConfig_LockdownModeOperation;
+  static constexpr auto LOCKDOWN_UNCHANGED = TraceConfig_LockdownModeOperation_LOCKDOWN_UNCHANGED;
+  static constexpr auto LOCKDOWN_CLEAR = TraceConfig_LockdownModeOperation_LOCKDOWN_CLEAR;
+  static constexpr auto LOCKDOWN_SET = TraceConfig_LockdownModeOperation_LOCKDOWN_SET;
+  static constexpr auto LockdownModeOperation_MIN = TraceConfig_LockdownModeOperation_LOCKDOWN_UNCHANGED;
+  static constexpr auto LockdownModeOperation_MAX = TraceConfig_LockdownModeOperation_LOCKDOWN_SET;
+  using CompressionType = TraceConfig_CompressionType;
+  static constexpr auto COMPRESSION_TYPE_UNSPECIFIED = TraceConfig_CompressionType_COMPRESSION_TYPE_UNSPECIFIED;
+  static constexpr auto COMPRESSION_TYPE_DEFLATE = TraceConfig_CompressionType_COMPRESSION_TYPE_DEFLATE;
+  static constexpr auto CompressionType_MIN = TraceConfig_CompressionType_COMPRESSION_TYPE_UNSPECIFIED;
+  static constexpr auto CompressionType_MAX = TraceConfig_CompressionType_COMPRESSION_TYPE_DEFLATE;
+  using StatsdLogging = TraceConfig_StatsdLogging;
+  static constexpr auto STATSD_LOGGING_UNSPECIFIED = TraceConfig_StatsdLogging_STATSD_LOGGING_UNSPECIFIED;
+  static constexpr auto STATSD_LOGGING_ENABLED = TraceConfig_StatsdLogging_STATSD_LOGGING_ENABLED;
+  static constexpr auto STATSD_LOGGING_DISABLED = TraceConfig_StatsdLogging_STATSD_LOGGING_DISABLED;
+  static constexpr auto StatsdLogging_MIN = TraceConfig_StatsdLogging_STATSD_LOGGING_UNSPECIFIED;
+  static constexpr auto StatsdLogging_MAX = TraceConfig_StatsdLogging_STATSD_LOGGING_DISABLED;
+  enum FieldNumbers {
+    kBuffersFieldNumber = 1,
+    kDataSourcesFieldNumber = 2,
+    kBuiltinDataSourcesFieldNumber = 20,
+    kDurationMsFieldNumber = 3,
+    kEnableExtraGuardrailsFieldNumber = 4,
+    kLockdownModeFieldNumber = 5,
+    kProducersFieldNumber = 6,
+    kStatsdMetadataFieldNumber = 7,
+    kWriteIntoFileFieldNumber = 8,
+    kOutputPathFieldNumber = 29,
+    kFileWritePeriodMsFieldNumber = 9,
+    kMaxFileSizeBytesFieldNumber = 10,
+    kGuardrailOverridesFieldNumber = 11,
+    kDeferredStartFieldNumber = 12,
+    kFlushPeriodMsFieldNumber = 13,
+    kFlushTimeoutMsFieldNumber = 14,
+    kDataSourceStopTimeoutMsFieldNumber = 23,
+    kNotifyTraceurFieldNumber = 16,
+    kBugreportScoreFieldNumber = 30,
+    kTriggerConfigFieldNumber = 17,
+    kActivateTriggersFieldNumber = 18,
+    kIncrementalStateConfigFieldNumber = 21,
+    kAllowUserBuildTracingFieldNumber = 19,
+    kUniqueSessionNameFieldNumber = 22,
+    kCompressionTypeFieldNumber = 24,
+    kIncidentReportConfigFieldNumber = 25,
+    kStatsdLoggingFieldNumber = 31,
+    kTraceUuidMsbFieldNumber = 27,
+    kTraceUuidLsbFieldNumber = 28,
+    kTraceFilterFieldNumber = 32,
+  };
+
+  TraceConfig();
+  ~TraceConfig() override;
+  TraceConfig(TraceConfig&&) noexcept;
+  TraceConfig& operator=(TraceConfig&&);
+  TraceConfig(const TraceConfig&);
+  TraceConfig& operator=(const TraceConfig&);
+  bool operator==(const TraceConfig&) const;
+  bool operator!=(const TraceConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<TraceConfig_BufferConfig>& buffers() const { return buffers_; }
+  std::vector<TraceConfig_BufferConfig>* mutable_buffers() { return &buffers_; }
+  int buffers_size() const;
+  void clear_buffers();
+  TraceConfig_BufferConfig* add_buffers();
+
+  const std::vector<TraceConfig_DataSource>& data_sources() const { return data_sources_; }
+  std::vector<TraceConfig_DataSource>* mutable_data_sources() { return &data_sources_; }
+  int data_sources_size() const;
+  void clear_data_sources();
+  TraceConfig_DataSource* add_data_sources();
+
+  bool has_builtin_data_sources() const { return _has_field_[20]; }
+  const TraceConfig_BuiltinDataSource& builtin_data_sources() const { return *builtin_data_sources_; }
+  TraceConfig_BuiltinDataSource* mutable_builtin_data_sources() { _has_field_.set(20); return builtin_data_sources_.get(); }
+
+  bool has_duration_ms() const { return _has_field_[3]; }
+  uint32_t duration_ms() const { return duration_ms_; }
+  void set_duration_ms(uint32_t value) { duration_ms_ = value; _has_field_.set(3); }
+
+  bool has_enable_extra_guardrails() const { return _has_field_[4]; }
+  bool enable_extra_guardrails() const { return enable_extra_guardrails_; }
+  void set_enable_extra_guardrails(bool value) { enable_extra_guardrails_ = value; _has_field_.set(4); }
+
+  bool has_lockdown_mode() const { return _has_field_[5]; }
+  TraceConfig_LockdownModeOperation lockdown_mode() const { return lockdown_mode_; }
+  void set_lockdown_mode(TraceConfig_LockdownModeOperation value) { lockdown_mode_ = value; _has_field_.set(5); }
+
+  const std::vector<TraceConfig_ProducerConfig>& producers() const { return producers_; }
+  std::vector<TraceConfig_ProducerConfig>* mutable_producers() { return &producers_; }
+  int producers_size() const;
+  void clear_producers();
+  TraceConfig_ProducerConfig* add_producers();
+
+  bool has_statsd_metadata() const { return _has_field_[7]; }
+  const TraceConfig_StatsdMetadata& statsd_metadata() const { return *statsd_metadata_; }
+  TraceConfig_StatsdMetadata* mutable_statsd_metadata() { _has_field_.set(7); return statsd_metadata_.get(); }
+
+  bool has_write_into_file() const { return _has_field_[8]; }
+  bool write_into_file() const { return write_into_file_; }
+  void set_write_into_file(bool value) { write_into_file_ = value; _has_field_.set(8); }
+
+  bool has_output_path() const { return _has_field_[29]; }
+  const std::string& output_path() const { return output_path_; }
+  void set_output_path(const std::string& value) { output_path_ = value; _has_field_.set(29); }
+
+  bool has_file_write_period_ms() const { return _has_field_[9]; }
+  uint32_t file_write_period_ms() const { return file_write_period_ms_; }
+  void set_file_write_period_ms(uint32_t value) { file_write_period_ms_ = value; _has_field_.set(9); }
+
+  bool has_max_file_size_bytes() const { return _has_field_[10]; }
+  uint64_t max_file_size_bytes() const { return max_file_size_bytes_; }
+  void set_max_file_size_bytes(uint64_t value) { max_file_size_bytes_ = value; _has_field_.set(10); }
+
+  bool has_guardrail_overrides() const { return _has_field_[11]; }
+  const TraceConfig_GuardrailOverrides& guardrail_overrides() const { return *guardrail_overrides_; }
+  TraceConfig_GuardrailOverrides* mutable_guardrail_overrides() { _has_field_.set(11); return guardrail_overrides_.get(); }
+
+  bool has_deferred_start() const { return _has_field_[12]; }
+  bool deferred_start() const { return deferred_start_; }
+  void set_deferred_start(bool value) { deferred_start_ = value; _has_field_.set(12); }
+
+  bool has_flush_period_ms() const { return _has_field_[13]; }
+  uint32_t flush_period_ms() const { return flush_period_ms_; }
+  void set_flush_period_ms(uint32_t value) { flush_period_ms_ = value; _has_field_.set(13); }
+
+  bool has_flush_timeout_ms() const { return _has_field_[14]; }
+  uint32_t flush_timeout_ms() const { return flush_timeout_ms_; }
+  void set_flush_timeout_ms(uint32_t value) { flush_timeout_ms_ = value; _has_field_.set(14); }
+
+  bool has_data_source_stop_timeout_ms() const { return _has_field_[23]; }
+  uint32_t data_source_stop_timeout_ms() const { return data_source_stop_timeout_ms_; }
+  void set_data_source_stop_timeout_ms(uint32_t value) { data_source_stop_timeout_ms_ = value; _has_field_.set(23); }
+
+  bool has_notify_traceur() const { return _has_field_[16]; }
+  bool notify_traceur() const { return notify_traceur_; }
+  void set_notify_traceur(bool value) { notify_traceur_ = value; _has_field_.set(16); }
+
+  bool has_bugreport_score() const { return _has_field_[30]; }
+  int32_t bugreport_score() const { return bugreport_score_; }
+  void set_bugreport_score(int32_t value) { bugreport_score_ = value; _has_field_.set(30); }
+
+  bool has_trigger_config() const { return _has_field_[17]; }
+  const TraceConfig_TriggerConfig& trigger_config() const { return *trigger_config_; }
+  TraceConfig_TriggerConfig* mutable_trigger_config() { _has_field_.set(17); return trigger_config_.get(); }
+
+  const std::vector<std::string>& activate_triggers() const { return activate_triggers_; }
+  std::vector<std::string>* mutable_activate_triggers() { return &activate_triggers_; }
+  int activate_triggers_size() const { return static_cast<int>(activate_triggers_.size()); }
+  void clear_activate_triggers() { activate_triggers_.clear(); }
+  void add_activate_triggers(std::string value) { activate_triggers_.emplace_back(value); }
+  std::string* add_activate_triggers() { activate_triggers_.emplace_back(); return &activate_triggers_.back(); }
+
+  bool has_incremental_state_config() const { return _has_field_[21]; }
+  const TraceConfig_IncrementalStateConfig& incremental_state_config() const { return *incremental_state_config_; }
+  TraceConfig_IncrementalStateConfig* mutable_incremental_state_config() { _has_field_.set(21); return incremental_state_config_.get(); }
+
+  bool has_allow_user_build_tracing() const { return _has_field_[19]; }
+  bool allow_user_build_tracing() const { return allow_user_build_tracing_; }
+  void set_allow_user_build_tracing(bool value) { allow_user_build_tracing_ = value; _has_field_.set(19); }
+
+  bool has_unique_session_name() const { return _has_field_[22]; }
+  const std::string& unique_session_name() const { return unique_session_name_; }
+  void set_unique_session_name(const std::string& value) { unique_session_name_ = value; _has_field_.set(22); }
+
+  bool has_compression_type() const { return _has_field_[24]; }
+  TraceConfig_CompressionType compression_type() const { return compression_type_; }
+  void set_compression_type(TraceConfig_CompressionType value) { compression_type_ = value; _has_field_.set(24); }
+
+  bool has_incident_report_config() const { return _has_field_[25]; }
+  const TraceConfig_IncidentReportConfig& incident_report_config() const { return *incident_report_config_; }
+  TraceConfig_IncidentReportConfig* mutable_incident_report_config() { _has_field_.set(25); return incident_report_config_.get(); }
+
+  bool has_statsd_logging() const { return _has_field_[31]; }
+  TraceConfig_StatsdLogging statsd_logging() const { return statsd_logging_; }
+  void set_statsd_logging(TraceConfig_StatsdLogging value) { statsd_logging_ = value; _has_field_.set(31); }
+
+  bool has_trace_uuid_msb() const { return _has_field_[27]; }
+  int64_t trace_uuid_msb() const { return trace_uuid_msb_; }
+  void set_trace_uuid_msb(int64_t value) { trace_uuid_msb_ = value; _has_field_.set(27); }
+
+  bool has_trace_uuid_lsb() const { return _has_field_[28]; }
+  int64_t trace_uuid_lsb() const { return trace_uuid_lsb_; }
+  void set_trace_uuid_lsb(int64_t value) { trace_uuid_lsb_ = value; _has_field_.set(28); }
+
+  bool has_trace_filter() const { return _has_field_[32]; }
+  const TraceConfig_TraceFilter& trace_filter() const { return *trace_filter_; }
+  TraceConfig_TraceFilter* mutable_trace_filter() { _has_field_.set(32); return trace_filter_.get(); }
+
+ private:
+  std::vector<TraceConfig_BufferConfig> buffers_;
+  std::vector<TraceConfig_DataSource> data_sources_;
+  ::protozero::CopyablePtr<TraceConfig_BuiltinDataSource> builtin_data_sources_;
+  uint32_t duration_ms_{};
+  bool enable_extra_guardrails_{};
+  TraceConfig_LockdownModeOperation lockdown_mode_{};
+  std::vector<TraceConfig_ProducerConfig> producers_;
+  ::protozero::CopyablePtr<TraceConfig_StatsdMetadata> statsd_metadata_;
+  bool write_into_file_{};
+  std::string output_path_{};
+  uint32_t file_write_period_ms_{};
+  uint64_t max_file_size_bytes_{};
+  ::protozero::CopyablePtr<TraceConfig_GuardrailOverrides> guardrail_overrides_;
+  bool deferred_start_{};
+  uint32_t flush_period_ms_{};
+  uint32_t flush_timeout_ms_{};
+  uint32_t data_source_stop_timeout_ms_{};
+  bool notify_traceur_{};
+  int32_t bugreport_score_{};
+  ::protozero::CopyablePtr<TraceConfig_TriggerConfig> trigger_config_;
+  std::vector<std::string> activate_triggers_;
+  ::protozero::CopyablePtr<TraceConfig_IncrementalStateConfig> incremental_state_config_;
+  bool allow_user_build_tracing_{};
+  std::string unique_session_name_{};
+  TraceConfig_CompressionType compression_type_{};
+  ::protozero::CopyablePtr<TraceConfig_IncidentReportConfig> incident_report_config_;
+  TraceConfig_StatsdLogging statsd_logging_{};
+  int64_t trace_uuid_msb_{};
+  int64_t trace_uuid_lsb_{};
+  ::protozero::CopyablePtr<TraceConfig_TraceFilter> trace_filter_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<33> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TraceConfig_TraceFilter : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kBytecodeFieldNumber = 1,
+  };
+
+  TraceConfig_TraceFilter();
+  ~TraceConfig_TraceFilter() override;
+  TraceConfig_TraceFilter(TraceConfig_TraceFilter&&) noexcept;
+  TraceConfig_TraceFilter& operator=(TraceConfig_TraceFilter&&);
+  TraceConfig_TraceFilter(const TraceConfig_TraceFilter&);
+  TraceConfig_TraceFilter& operator=(const TraceConfig_TraceFilter&);
+  bool operator==(const TraceConfig_TraceFilter&) const;
+  bool operator!=(const TraceConfig_TraceFilter& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_bytecode() const { return _has_field_[1]; }
+  const std::string& bytecode() const { return bytecode_; }
+  void set_bytecode(const std::string& value) { bytecode_ = value; _has_field_.set(1); }
+  void set_bytecode(const void* p, size_t s) { bytecode_.assign(reinterpret_cast<const char*>(p), s); _has_field_.set(1); }
+
+ private:
+  std::string bytecode_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TraceConfig_IncidentReportConfig : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDestinationPackageFieldNumber = 1,
+    kDestinationClassFieldNumber = 2,
+    kPrivacyLevelFieldNumber = 3,
+    kSkipIncidentdFieldNumber = 5,
+    kSkipDropboxFieldNumber = 4,
+  };
+
+  TraceConfig_IncidentReportConfig();
+  ~TraceConfig_IncidentReportConfig() override;
+  TraceConfig_IncidentReportConfig(TraceConfig_IncidentReportConfig&&) noexcept;
+  TraceConfig_IncidentReportConfig& operator=(TraceConfig_IncidentReportConfig&&);
+  TraceConfig_IncidentReportConfig(const TraceConfig_IncidentReportConfig&);
+  TraceConfig_IncidentReportConfig& operator=(const TraceConfig_IncidentReportConfig&);
+  bool operator==(const TraceConfig_IncidentReportConfig&) const;
+  bool operator!=(const TraceConfig_IncidentReportConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_destination_package() const { return _has_field_[1]; }
+  const std::string& destination_package() const { return destination_package_; }
+  void set_destination_package(const std::string& value) { destination_package_ = value; _has_field_.set(1); }
+
+  bool has_destination_class() const { return _has_field_[2]; }
+  const std::string& destination_class() const { return destination_class_; }
+  void set_destination_class(const std::string& value) { destination_class_ = value; _has_field_.set(2); }
+
+  bool has_privacy_level() const { return _has_field_[3]; }
+  int32_t privacy_level() const { return privacy_level_; }
+  void set_privacy_level(int32_t value) { privacy_level_ = value; _has_field_.set(3); }
+
+  bool has_skip_incidentd() const { return _has_field_[5]; }
+  bool skip_incidentd() const { return skip_incidentd_; }
+  void set_skip_incidentd(bool value) { skip_incidentd_ = value; _has_field_.set(5); }
+
+  bool has_skip_dropbox() const { return _has_field_[4]; }
+  bool skip_dropbox() const { return skip_dropbox_; }
+  void set_skip_dropbox(bool value) { skip_dropbox_ = value; _has_field_.set(4); }
+
+ private:
+  std::string destination_package_{};
+  std::string destination_class_{};
+  int32_t privacy_level_{};
+  bool skip_incidentd_{};
+  bool skip_dropbox_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<6> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TraceConfig_IncrementalStateConfig : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kClearPeriodMsFieldNumber = 1,
+  };
+
+  TraceConfig_IncrementalStateConfig();
+  ~TraceConfig_IncrementalStateConfig() override;
+  TraceConfig_IncrementalStateConfig(TraceConfig_IncrementalStateConfig&&) noexcept;
+  TraceConfig_IncrementalStateConfig& operator=(TraceConfig_IncrementalStateConfig&&);
+  TraceConfig_IncrementalStateConfig(const TraceConfig_IncrementalStateConfig&);
+  TraceConfig_IncrementalStateConfig& operator=(const TraceConfig_IncrementalStateConfig&);
+  bool operator==(const TraceConfig_IncrementalStateConfig&) const;
+  bool operator!=(const TraceConfig_IncrementalStateConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_clear_period_ms() const { return _has_field_[1]; }
+  uint32_t clear_period_ms() const { return clear_period_ms_; }
+  void set_clear_period_ms(uint32_t value) { clear_period_ms_ = value; _has_field_.set(1); }
+
+ private:
+  uint32_t clear_period_ms_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TraceConfig_TriggerConfig : public ::protozero::CppMessageObj {
+ public:
+  using Trigger = TraceConfig_TriggerConfig_Trigger;
+  using TriggerMode = TraceConfig_TriggerConfig_TriggerMode;
+  static constexpr auto UNSPECIFIED = TraceConfig_TriggerConfig_TriggerMode_UNSPECIFIED;
+  static constexpr auto START_TRACING = TraceConfig_TriggerConfig_TriggerMode_START_TRACING;
+  static constexpr auto STOP_TRACING = TraceConfig_TriggerConfig_TriggerMode_STOP_TRACING;
+  static constexpr auto TriggerMode_MIN = TraceConfig_TriggerConfig_TriggerMode_UNSPECIFIED;
+  static constexpr auto TriggerMode_MAX = TraceConfig_TriggerConfig_TriggerMode_STOP_TRACING;
+  enum FieldNumbers {
+    kTriggerModeFieldNumber = 1,
+    kTriggersFieldNumber = 2,
+    kTriggerTimeoutMsFieldNumber = 3,
+  };
+
+  TraceConfig_TriggerConfig();
+  ~TraceConfig_TriggerConfig() override;
+  TraceConfig_TriggerConfig(TraceConfig_TriggerConfig&&) noexcept;
+  TraceConfig_TriggerConfig& operator=(TraceConfig_TriggerConfig&&);
+  TraceConfig_TriggerConfig(const TraceConfig_TriggerConfig&);
+  TraceConfig_TriggerConfig& operator=(const TraceConfig_TriggerConfig&);
+  bool operator==(const TraceConfig_TriggerConfig&) const;
+  bool operator!=(const TraceConfig_TriggerConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_trigger_mode() const { return _has_field_[1]; }
+  TraceConfig_TriggerConfig_TriggerMode trigger_mode() const { return trigger_mode_; }
+  void set_trigger_mode(TraceConfig_TriggerConfig_TriggerMode value) { trigger_mode_ = value; _has_field_.set(1); }
+
+  const std::vector<TraceConfig_TriggerConfig_Trigger>& triggers() const { return triggers_; }
+  std::vector<TraceConfig_TriggerConfig_Trigger>* mutable_triggers() { return &triggers_; }
+  int triggers_size() const;
+  void clear_triggers();
+  TraceConfig_TriggerConfig_Trigger* add_triggers();
+
+  bool has_trigger_timeout_ms() const { return _has_field_[3]; }
+  uint32_t trigger_timeout_ms() const { return trigger_timeout_ms_; }
+  void set_trigger_timeout_ms(uint32_t value) { trigger_timeout_ms_ = value; _has_field_.set(3); }
+
+ private:
+  TraceConfig_TriggerConfig_TriggerMode trigger_mode_{};
+  std::vector<TraceConfig_TriggerConfig_Trigger> triggers_;
+  uint32_t trigger_timeout_ms_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<4> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TraceConfig_TriggerConfig_Trigger : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNameFieldNumber = 1,
+    kProducerNameRegexFieldNumber = 2,
+    kStopDelayMsFieldNumber = 3,
+    kMaxPer24HFieldNumber = 4,
+    kSkipProbabilityFieldNumber = 5,
+  };
+
+  TraceConfig_TriggerConfig_Trigger();
+  ~TraceConfig_TriggerConfig_Trigger() override;
+  TraceConfig_TriggerConfig_Trigger(TraceConfig_TriggerConfig_Trigger&&) noexcept;
+  TraceConfig_TriggerConfig_Trigger& operator=(TraceConfig_TriggerConfig_Trigger&&);
+  TraceConfig_TriggerConfig_Trigger(const TraceConfig_TriggerConfig_Trigger&);
+  TraceConfig_TriggerConfig_Trigger& operator=(const TraceConfig_TriggerConfig_Trigger&);
+  bool operator==(const TraceConfig_TriggerConfig_Trigger&) const;
+  bool operator!=(const TraceConfig_TriggerConfig_Trigger& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name() const { return _has_field_[1]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
+
+  bool has_producer_name_regex() const { return _has_field_[2]; }
+  const std::string& producer_name_regex() const { return producer_name_regex_; }
+  void set_producer_name_regex(const std::string& value) { producer_name_regex_ = value; _has_field_.set(2); }
+
+  bool has_stop_delay_ms() const { return _has_field_[3]; }
+  uint32_t stop_delay_ms() const { return stop_delay_ms_; }
+  void set_stop_delay_ms(uint32_t value) { stop_delay_ms_ = value; _has_field_.set(3); }
+
+  bool has_max_per_24_h() const { return _has_field_[4]; }
+  uint32_t max_per_24_h() const { return max_per_24_h_; }
+  void set_max_per_24_h(uint32_t value) { max_per_24_h_ = value; _has_field_.set(4); }
+
+  bool has_skip_probability() const { return _has_field_[5]; }
+  double skip_probability() const { return skip_probability_; }
+  void set_skip_probability(double value) { skip_probability_ = value; _has_field_.set(5); }
+
+ private:
+  std::string name_{};
+  std::string producer_name_regex_{};
+  uint32_t stop_delay_ms_{};
+  uint32_t max_per_24_h_{};
+  double skip_probability_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<6> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TraceConfig_GuardrailOverrides : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kMaxUploadPerDayBytesFieldNumber = 1,
+  };
+
+  TraceConfig_GuardrailOverrides();
+  ~TraceConfig_GuardrailOverrides() override;
+  TraceConfig_GuardrailOverrides(TraceConfig_GuardrailOverrides&&) noexcept;
+  TraceConfig_GuardrailOverrides& operator=(TraceConfig_GuardrailOverrides&&);
+  TraceConfig_GuardrailOverrides(const TraceConfig_GuardrailOverrides&);
+  TraceConfig_GuardrailOverrides& operator=(const TraceConfig_GuardrailOverrides&);
+  bool operator==(const TraceConfig_GuardrailOverrides&) const;
+  bool operator!=(const TraceConfig_GuardrailOverrides& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_max_upload_per_day_bytes() const { return _has_field_[1]; }
+  uint64_t max_upload_per_day_bytes() const { return max_upload_per_day_bytes_; }
+  void set_max_upload_per_day_bytes(uint64_t value) { max_upload_per_day_bytes_ = value; _has_field_.set(1); }
+
+ private:
+  uint64_t max_upload_per_day_bytes_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TraceConfig_StatsdMetadata : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kTriggeringAlertIdFieldNumber = 1,
+    kTriggeringConfigUidFieldNumber = 2,
+    kTriggeringConfigIdFieldNumber = 3,
+    kTriggeringSubscriptionIdFieldNumber = 4,
+  };
+
+  TraceConfig_StatsdMetadata();
+  ~TraceConfig_StatsdMetadata() override;
+  TraceConfig_StatsdMetadata(TraceConfig_StatsdMetadata&&) noexcept;
+  TraceConfig_StatsdMetadata& operator=(TraceConfig_StatsdMetadata&&);
+  TraceConfig_StatsdMetadata(const TraceConfig_StatsdMetadata&);
+  TraceConfig_StatsdMetadata& operator=(const TraceConfig_StatsdMetadata&);
+  bool operator==(const TraceConfig_StatsdMetadata&) const;
+  bool operator!=(const TraceConfig_StatsdMetadata& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_triggering_alert_id() const { return _has_field_[1]; }
+  int64_t triggering_alert_id() const { return triggering_alert_id_; }
+  void set_triggering_alert_id(int64_t value) { triggering_alert_id_ = value; _has_field_.set(1); }
+
+  bool has_triggering_config_uid() const { return _has_field_[2]; }
+  int32_t triggering_config_uid() const { return triggering_config_uid_; }
+  void set_triggering_config_uid(int32_t value) { triggering_config_uid_ = value; _has_field_.set(2); }
+
+  bool has_triggering_config_id() const { return _has_field_[3]; }
+  int64_t triggering_config_id() const { return triggering_config_id_; }
+  void set_triggering_config_id(int64_t value) { triggering_config_id_ = value; _has_field_.set(3); }
+
+  bool has_triggering_subscription_id() const { return _has_field_[4]; }
+  int64_t triggering_subscription_id() const { return triggering_subscription_id_; }
+  void set_triggering_subscription_id(int64_t value) { triggering_subscription_id_ = value; _has_field_.set(4); }
+
+ private:
+  int64_t triggering_alert_id_{};
+  int32_t triggering_config_uid_{};
+  int64_t triggering_config_id_{};
+  int64_t triggering_subscription_id_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<5> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TraceConfig_ProducerConfig : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kProducerNameFieldNumber = 1,
+    kShmSizeKbFieldNumber = 2,
+    kPageSizeKbFieldNumber = 3,
+  };
+
+  TraceConfig_ProducerConfig();
+  ~TraceConfig_ProducerConfig() override;
+  TraceConfig_ProducerConfig(TraceConfig_ProducerConfig&&) noexcept;
+  TraceConfig_ProducerConfig& operator=(TraceConfig_ProducerConfig&&);
+  TraceConfig_ProducerConfig(const TraceConfig_ProducerConfig&);
+  TraceConfig_ProducerConfig& operator=(const TraceConfig_ProducerConfig&);
+  bool operator==(const TraceConfig_ProducerConfig&) const;
+  bool operator!=(const TraceConfig_ProducerConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_producer_name() const { return _has_field_[1]; }
+  const std::string& producer_name() const { return producer_name_; }
+  void set_producer_name(const std::string& value) { producer_name_ = value; _has_field_.set(1); }
+
+  bool has_shm_size_kb() const { return _has_field_[2]; }
+  uint32_t shm_size_kb() const { return shm_size_kb_; }
+  void set_shm_size_kb(uint32_t value) { shm_size_kb_ = value; _has_field_.set(2); }
+
+  bool has_page_size_kb() const { return _has_field_[3]; }
+  uint32_t page_size_kb() const { return page_size_kb_; }
+  void set_page_size_kb(uint32_t value) { page_size_kb_ = value; _has_field_.set(3); }
+
+ private:
+  std::string producer_name_{};
+  uint32_t shm_size_kb_{};
+  uint32_t page_size_kb_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<4> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TraceConfig_BuiltinDataSource : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDisableClockSnapshottingFieldNumber = 1,
+    kDisableTraceConfigFieldNumber = 2,
+    kDisableSystemInfoFieldNumber = 3,
+    kDisableServiceEventsFieldNumber = 4,
+    kPrimaryTraceClockFieldNumber = 5,
+    kSnapshotIntervalMsFieldNumber = 6,
+    kPreferSuspendClockForSnapshotFieldNumber = 7,
+  };
+
+  TraceConfig_BuiltinDataSource();
+  ~TraceConfig_BuiltinDataSource() override;
+  TraceConfig_BuiltinDataSource(TraceConfig_BuiltinDataSource&&) noexcept;
+  TraceConfig_BuiltinDataSource& operator=(TraceConfig_BuiltinDataSource&&);
+  TraceConfig_BuiltinDataSource(const TraceConfig_BuiltinDataSource&);
+  TraceConfig_BuiltinDataSource& operator=(const TraceConfig_BuiltinDataSource&);
+  bool operator==(const TraceConfig_BuiltinDataSource&) const;
+  bool operator!=(const TraceConfig_BuiltinDataSource& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_disable_clock_snapshotting() const { return _has_field_[1]; }
+  bool disable_clock_snapshotting() const { return disable_clock_snapshotting_; }
+  void set_disable_clock_snapshotting(bool value) { disable_clock_snapshotting_ = value; _has_field_.set(1); }
+
+  bool has_disable_trace_config() const { return _has_field_[2]; }
+  bool disable_trace_config() const { return disable_trace_config_; }
+  void set_disable_trace_config(bool value) { disable_trace_config_ = value; _has_field_.set(2); }
+
+  bool has_disable_system_info() const { return _has_field_[3]; }
+  bool disable_system_info() const { return disable_system_info_; }
+  void set_disable_system_info(bool value) { disable_system_info_ = value; _has_field_.set(3); }
+
+  bool has_disable_service_events() const { return _has_field_[4]; }
+  bool disable_service_events() const { return disable_service_events_; }
+  void set_disable_service_events(bool value) { disable_service_events_ = value; _has_field_.set(4); }
+
+  bool has_primary_trace_clock() const { return _has_field_[5]; }
+  BuiltinClock primary_trace_clock() const { return primary_trace_clock_; }
+  void set_primary_trace_clock(BuiltinClock value) { primary_trace_clock_ = value; _has_field_.set(5); }
+
+  bool has_snapshot_interval_ms() const { return _has_field_[6]; }
+  uint32_t snapshot_interval_ms() const { return snapshot_interval_ms_; }
+  void set_snapshot_interval_ms(uint32_t value) { snapshot_interval_ms_ = value; _has_field_.set(6); }
+
+  bool has_prefer_suspend_clock_for_snapshot() const { return _has_field_[7]; }
+  bool prefer_suspend_clock_for_snapshot() const { return prefer_suspend_clock_for_snapshot_; }
+  void set_prefer_suspend_clock_for_snapshot(bool value) { prefer_suspend_clock_for_snapshot_ = value; _has_field_.set(7); }
+
+ private:
+  bool disable_clock_snapshotting_{};
+  bool disable_trace_config_{};
+  bool disable_system_info_{};
+  bool disable_service_events_{};
+  BuiltinClock primary_trace_clock_{};
+  uint32_t snapshot_interval_ms_{};
+  bool prefer_suspend_clock_for_snapshot_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<8> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TraceConfig_DataSource : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kConfigFieldNumber = 1,
+    kProducerNameFilterFieldNumber = 2,
+    kProducerNameRegexFilterFieldNumber = 3,
+  };
+
+  TraceConfig_DataSource();
+  ~TraceConfig_DataSource() override;
+  TraceConfig_DataSource(TraceConfig_DataSource&&) noexcept;
+  TraceConfig_DataSource& operator=(TraceConfig_DataSource&&);
+  TraceConfig_DataSource(const TraceConfig_DataSource&);
+  TraceConfig_DataSource& operator=(const TraceConfig_DataSource&);
+  bool operator==(const TraceConfig_DataSource&) const;
+  bool operator!=(const TraceConfig_DataSource& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_config() const { return _has_field_[1]; }
+  const DataSourceConfig& config() const { return *config_; }
+  DataSourceConfig* mutable_config() { _has_field_.set(1); return config_.get(); }
+
+  const std::vector<std::string>& producer_name_filter() const { return producer_name_filter_; }
+  std::vector<std::string>* mutable_producer_name_filter() { return &producer_name_filter_; }
+  int producer_name_filter_size() const { return static_cast<int>(producer_name_filter_.size()); }
+  void clear_producer_name_filter() { producer_name_filter_.clear(); }
+  void add_producer_name_filter(std::string value) { producer_name_filter_.emplace_back(value); }
+  std::string* add_producer_name_filter() { producer_name_filter_.emplace_back(); return &producer_name_filter_.back(); }
+
+  const std::vector<std::string>& producer_name_regex_filter() const { return producer_name_regex_filter_; }
+  std::vector<std::string>* mutable_producer_name_regex_filter() { return &producer_name_regex_filter_; }
+  int producer_name_regex_filter_size() const { return static_cast<int>(producer_name_regex_filter_.size()); }
+  void clear_producer_name_regex_filter() { producer_name_regex_filter_.clear(); }
+  void add_producer_name_regex_filter(std::string value) { producer_name_regex_filter_.emplace_back(value); }
+  std::string* add_producer_name_regex_filter() { producer_name_regex_filter_.emplace_back(); return &producer_name_regex_filter_.back(); }
+
+ private:
+  ::protozero::CopyablePtr<DataSourceConfig> config_;
+  std::vector<std::string> producer_name_filter_;
+  std::vector<std::string> producer_name_regex_filter_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<4> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TraceConfig_BufferConfig : public ::protozero::CppMessageObj {
+ public:
+  using FillPolicy = TraceConfig_BufferConfig_FillPolicy;
+  static constexpr auto UNSPECIFIED = TraceConfig_BufferConfig_FillPolicy_UNSPECIFIED;
+  static constexpr auto RING_BUFFER = TraceConfig_BufferConfig_FillPolicy_RING_BUFFER;
+  static constexpr auto DISCARD = TraceConfig_BufferConfig_FillPolicy_DISCARD;
+  static constexpr auto FillPolicy_MIN = TraceConfig_BufferConfig_FillPolicy_UNSPECIFIED;
+  static constexpr auto FillPolicy_MAX = TraceConfig_BufferConfig_FillPolicy_DISCARD;
+  enum FieldNumbers {
+    kSizeKbFieldNumber = 1,
+    kFillPolicyFieldNumber = 4,
+  };
+
+  TraceConfig_BufferConfig();
+  ~TraceConfig_BufferConfig() override;
+  TraceConfig_BufferConfig(TraceConfig_BufferConfig&&) noexcept;
+  TraceConfig_BufferConfig& operator=(TraceConfig_BufferConfig&&);
+  TraceConfig_BufferConfig(const TraceConfig_BufferConfig&);
+  TraceConfig_BufferConfig& operator=(const TraceConfig_BufferConfig&);
+  bool operator==(const TraceConfig_BufferConfig&) const;
+  bool operator!=(const TraceConfig_BufferConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_size_kb() const { return _has_field_[1]; }
+  uint32_t size_kb() const { return size_kb_; }
+  void set_size_kb(uint32_t value) { size_kb_ = value; _has_field_.set(1); }
+
+  bool has_fill_policy() const { return _has_field_[4]; }
+  TraceConfig_BufferConfig_FillPolicy fill_policy() const { return fill_policy_; }
+  void set_fill_policy(TraceConfig_BufferConfig_FillPolicy value) { fill_policy_ = value; _has_field_.set(4); }
+
+ private:
+  uint32_t size_kb_{};
+  TraceConfig_BufferConfig_FillPolicy fill_policy_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<5> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACE_CONFIG_PROTO_CPP_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_CORE_TRACE_CONFIG_H_
+#define INCLUDE_PERFETTO_TRACING_CORE_TRACE_CONFIG_H_
+
+// Creates the aliases in the ::perfetto namespace, doing things like:
+// using ::perfetto::Foo = ::perfetto::protos::gen::Foo.
+// See comments in forward_decls.h for the historical reasons of this
+// indirection layer.
+// gen_amalgamated expanded: #include "perfetto/tracing/core/forward_decls.h"
+
+// gen_amalgamated expanded: #include "protos/perfetto/config/trace_config.gen.h"
+
+#endif  // INCLUDE_PERFETTO_TRACING_CORE_TRACE_CONFIG_H_
+// gen_amalgamated begin header: include/perfetto/tracing/data_source.h
+// gen_amalgamated begin header: include/perfetto/tracing/internal/tracing_muxer.h
+// gen_amalgamated begin header: include/perfetto/tracing/internal/tracing_tls.h
+// gen_amalgamated begin header: include/perfetto/tracing/platform.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_PLATFORM_H_
+#define INCLUDE_PERFETTO_TRACING_PLATFORM_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include <functional>
+#include <memory>
+#include <string>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+
+namespace base {
+class TaskRunner;
+}  // namespace base
+
+// This abstract class is used to abstract dependencies on platform-specific
+// primitives that cannot be implemented by the perfetto codebase and must be
+// provided or overridden by the embedder.
+// This is, for instance, for cases where we want to use some particular
+// base:: class in Chrome and provide instead POSIX fallbacks for other
+// embedders.
+
+// Base class for thread-local objects. This is to get a basic object vtable and
+// delegate destruction to the embedder. See Platform::CreateThreadLocalObject.
+class PERFETTO_EXPORT PlatformThreadLocalObject {
+ public:
+  // Implemented by perfetto internal code. The embedder must call this when
+  // implementing GetOrCreateThreadLocalObject() to create an instance for the
+  // first time on each thread.
+  static std::unique_ptr<PlatformThreadLocalObject> CreateInstance();
+  virtual ~PlatformThreadLocalObject();
+};
+
+class PERFETTO_EXPORT Platform {
+ public:
+  // Embedders can use this unless they have custom needs (e.g. Chrome wanting
+  // to use its own base class for TLS).
+  static Platform* GetDefaultPlatform();
+
+  virtual ~Platform();
+
+  // Creates a thread-local object. The embedder must:
+  // - Create an instance per-thread calling ThreadLocalObject::CreateInstance.
+  // - Own the lifetime of the returned object as long as the thread is alive.
+  // - Destroy it when the thread exits.
+  // Perfetto requires only one thread-local object overall (obviously, one
+  // instance per-thread) from the embedder.
+  using ThreadLocalObject = ::perfetto::PlatformThreadLocalObject;
+  virtual ThreadLocalObject* GetOrCreateThreadLocalObject() = 0;
+
+  // Creates a sequenced task runner. The easiest implementation is to create
+  // a new thread (e.g. use base::ThreadTaskRunner) but this can also be
+  // implemented in some more clever way (e.g. using chromiums's scheduler).
+  struct CreateTaskRunnerArgs {};
+  virtual std::unique_ptr<base::TaskRunner> CreateTaskRunner(
+      const CreateTaskRunnerArgs&) = 0;
+
+  // Used to derive the producer name. Mostly relevant when using the
+  // kSystemBackend mode. It can be an arbitrary string when using the
+  // in-process mode.
+  virtual std::string GetCurrentProcessName() = 0;
+};
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_PLATFORM_H_
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_INTERNAL_TRACING_TLS_H_
+#define INCLUDE_PERFETTO_TRACING_INTERNAL_TRACING_TLS_H_
+
+#include <array>
+#include <memory>
+
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/basic_types.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/data_source_internal.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/platform.h"
+
+namespace perfetto {
+
+class TraceWriterBase;
+
+namespace internal {
+
+// Organization of the thread-local storage
+// ----------------------------------------
+// First of all, remember the cardinality of the problem: at any point in time
+// there are M data sources registered (i.e. number of subclasses of DataSource)
+// and up to N concurrent instances for each data source, so up to M * N total
+// data source instances around.
+// Each data source instance can be accessed by T threads (no upper bound).
+// We can safely put hard limits both to M and N (i.e. say that we support at
+// most 32 data source types per process and up to 8 concurrent instances).
+//
+// We want to make it so from the Platform viewpoint, we use only one global
+// TLS object, so T instances in total, one per thread, regardless of M and N.
+// This allows to deal with at-thread-exit destruction only in one place, rather
+// than N, M or M * N.
+//
+// Visually:
+//                     [    Thread 1   ] [    Thread 2   ] [    Thread T   ]
+//                     +---------------+ +---------------+ +---------------+
+// Data source Foo     |               | |               | |               |
+//  Instance 1         |     TLS       | |     TLS       | |     TLS       |
+//  Instance 2         |    Object     | |    Object     | |    Object     |
+//  Instance 3         |               | |               | |               |
+//                     |               | |               | |               |
+// Data source Bar     |               | |               | |               |
+//  Instance 1         |               | |               | |               |
+//  Instance 2         |               | |               | |               |
+//                     +---------------+ +---------------+ +---------------+
+//
+// Each TLS Object is organized as an array of M DataSourceThreadLocalState.
+// Each DSTLS itself is an array of up to N per-instance objects.
+// The only per-instance object for now is the TraceWriter.
+// So for each data source, for each instance, for each thread we keep one
+// TraceWriter.
+// The lookup is O(1): Given the TLS object, the TraceWriter is just tls[M][N].
+class TracingTLS : public Platform::ThreadLocalObject {
+ public:
+  ~TracingTLS() override;
+
+  // This is checked against TraceMuxerImpl's global generation counter to
+  // handle destruction of TraceWriter(s) that belong to data sources that
+  // have been stopped. When the two numbers diverge, a scan of all the
+  // thread-local TraceWriter(s) is issued.
+  uint32_t generation = 0;
+
+  // This flag is true while this thread is inside a trace point for any data
+  // source or in other delicate parts of the tracing machinery during which we
+  // should not try to trace. Used to prevent unexpected re-entrancy.
+  bool is_in_trace_point = false;
+
+  // By default all data source instances have independent thread-local state
+  // (see above).
+  std::array<DataSourceThreadLocalState, kMaxDataSources> data_sources_tls{};
+
+  // Track event data sources, however, share the same thread-local state in
+  // order to be able to share trace writers and interning state across all
+  // track event categories.
+  DataSourceThreadLocalState track_event_tls{};
+};
+
+struct ScopedReentrancyAnnotator {
+  ScopedReentrancyAnnotator(TracingTLS& root_tls) : root_tls_(root_tls) {
+    PERFETTO_DCHECK(!root_tls_.is_in_trace_point);
+    root_tls_.is_in_trace_point = true;
+  }
+  ~ScopedReentrancyAnnotator() { root_tls_.is_in_trace_point = false; }
+
+ private:
+  TracingTLS& root_tls_;
+};
+
+}  // namespace internal
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_INTERNAL_TRACING_TLS_H_
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_INTERNAL_TRACING_MUXER_H_
+#define INCLUDE_PERFETTO_TRACING_INTERNAL_TRACING_MUXER_H_
+
+#include <atomic>
+#include <memory>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/forward_decls.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/interceptor.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/basic_types.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/tracing_tls.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/platform.h"
+namespace perfetto {
+
+class DataSourceBase;
+class TraceWriterBase;
+struct TracingInitArgs;
+class TracingSession;
+
+namespace internal {
+
+struct DataSourceStaticState;
+
+// This class acts as a bridge between the public API methods and the
+// TracingBackend(s). It exposes a simplified view of the world to the API
+// methods, so that they don't have to care about the multiplicity of backends.
+// It handles all the bookkeeping to map data source instances and trace writers
+// to the various backends.
+// See tracing_muxer_impl.h for the full picture. This class contains only the
+// fewer fields and methods that need to be exposed to public/ headers. Fields
+// and methods that are required to implement them should go into
+// src/tracing/internal/tracing_muxer_impl.h instead: that one can pull in
+// perfetto headers outside of public, this one cannot.
+class PERFETTO_EXPORT TracingMuxer {
+ public:
+  static TracingMuxer* Get() { return instance_; }
+
+  virtual ~TracingMuxer();
+
+  TracingTLS* GetOrCreateTracingTLS() {
+    return static_cast<TracingTLS*>(platform_->GetOrCreateThreadLocalObject());
+  }
+
+  // This method can fail and return false if trying to register more than
+  // kMaxDataSources types.
+  using DataSourceFactory = std::function<std::unique_ptr<DataSourceBase>()>;
+  virtual bool RegisterDataSource(const DataSourceDescriptor&,
+                                  DataSourceFactory,
+                                  DataSourceStaticState*) = 0;
+
+  // It identifies the right backend and forwards the call to it.
+  // The returned TraceWriter must be used within the same sequence (for most
+  // projects this means "same thread"). Alternatively the client needs to take
+  // care of using synchronization primitives to prevent concurrent accesses.
+  virtual std::unique_ptr<TraceWriterBase> CreateTraceWriter(
+      DataSourceStaticState*,
+      uint32_t data_source_instance_index,
+      DataSourceState*,
+      BufferExhaustedPolicy buffer_exhausted_policy) = 0;
+
+  virtual void DestroyStoppedTraceWritersForCurrentThread() = 0;
+
+  uint32_t generation(std::memory_order ord) { return generation_.load(ord); }
+
+  using InterceptorFactory = std::function<std::unique_ptr<InterceptorBase>()>;
+  virtual void RegisterInterceptor(const InterceptorDescriptor&,
+                                   InterceptorFactory,
+                                   InterceptorBase::TLSFactory,
+                                   InterceptorBase::TracePacketCallback) = 0;
+
+ protected:
+  explicit TracingMuxer(Platform* platform) : platform_(platform) {}
+
+  static TracingMuxer* instance_;
+  Platform* const platform_ = nullptr;
+
+  // Incremented every time a data source is destroyed. See tracing_tls.h.
+  std::atomic<uint32_t> generation_{};
+};
+
+}  // namespace internal
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_INTERNAL_TRACING_MUXER_H_
+// gen_amalgamated begin header: gen/protos/perfetto/trace/trace_packet.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACE_PACKET_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACE_PACKET_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class AndroidEnergyEstimationBreakdown;
+class AndroidLogPacket;
+class BatteryCounters;
+class ChromeBenchmarkMetadata;
+class ChromeEventBundle;
+class ChromeMetadataPacket;
+class ClockSnapshot;
+class CpuInfo;
+class DeobfuscationMapping;
+class ExtensionDescriptor;
+class FrameTimelineEvent;
+class FtraceEventBundle;
+class FtraceStats;
+class GpuCounterEvent;
+class GpuLog;
+class GpuMemTotalEvent;
+class GpuRenderStageEvent;
+class GraphicsFrameEvent;
+class HeapGraph;
+class InitialDisplayState;
+class InodeFileMap;
+class InternedData;
+class MemoryTrackerSnapshot;
+class ModuleSymbols;
+class PackagesList;
+class PerfSample;
+class PerfettoMetatrace;
+class PowerRails;
+class ProcessDescriptor;
+class ProcessStats;
+class ProcessTree;
+class ProfilePacket;
+class ProfiledFrameSymbols;
+class SmapsPacket;
+class StreamingAllocation;
+class StreamingFree;
+class StreamingProfilePacket;
+class SysStats;
+class SystemInfo;
+class TestEvent;
+class ThreadDescriptor;
+class TraceConfig;
+class TracePacketDefaults;
+class TraceStats;
+class TracingServiceEvent;
+class TrackDescriptor;
+class TrackEvent;
+class Trigger;
+class UiState;
+class VulkanApiEvent;
+class VulkanMemoryEvent;
+
+enum TracePacket_SequenceFlags : int32_t {
+  TracePacket_SequenceFlags_SEQ_UNSPECIFIED = 0,
+  TracePacket_SequenceFlags_SEQ_INCREMENTAL_STATE_CLEARED = 1,
+  TracePacket_SequenceFlags_SEQ_NEEDS_INCREMENTAL_STATE = 2,
+};
+
+const TracePacket_SequenceFlags TracePacket_SequenceFlags_MIN = TracePacket_SequenceFlags_SEQ_UNSPECIFIED;
+const TracePacket_SequenceFlags TracePacket_SequenceFlags_MAX = TracePacket_SequenceFlags_SEQ_NEEDS_INCREMENTAL_STATE;
+
+class TracePacket_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/900, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TracePacket_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TracePacket_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TracePacket_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_timestamp() const { return at<8>().valid(); }
+  uint64_t timestamp() const { return at<8>().as_uint64(); }
+  bool has_timestamp_clock_id() const { return at<58>().valid(); }
+  uint32_t timestamp_clock_id() const { return at<58>().as_uint32(); }
+  bool has_process_tree() const { return at<2>().valid(); }
+  ::protozero::ConstBytes process_tree() const { return at<2>().as_bytes(); }
+  bool has_process_stats() const { return at<9>().valid(); }
+  ::protozero::ConstBytes process_stats() const { return at<9>().as_bytes(); }
+  bool has_inode_file_map() const { return at<4>().valid(); }
+  ::protozero::ConstBytes inode_file_map() const { return at<4>().as_bytes(); }
+  bool has_chrome_events() const { return at<5>().valid(); }
+  ::protozero::ConstBytes chrome_events() const { return at<5>().as_bytes(); }
+  bool has_clock_snapshot() const { return at<6>().valid(); }
+  ::protozero::ConstBytes clock_snapshot() const { return at<6>().as_bytes(); }
+  bool has_sys_stats() const { return at<7>().valid(); }
+  ::protozero::ConstBytes sys_stats() const { return at<7>().as_bytes(); }
+  bool has_track_event() const { return at<11>().valid(); }
+  ::protozero::ConstBytes track_event() const { return at<11>().as_bytes(); }
+  bool has_trace_config() const { return at<33>().valid(); }
+  ::protozero::ConstBytes trace_config() const { return at<33>().as_bytes(); }
+  bool has_ftrace_stats() const { return at<34>().valid(); }
+  ::protozero::ConstBytes ftrace_stats() const { return at<34>().as_bytes(); }
+  bool has_trace_stats() const { return at<35>().valid(); }
+  ::protozero::ConstBytes trace_stats() const { return at<35>().as_bytes(); }
+  bool has_profile_packet() const { return at<37>().valid(); }
+  ::protozero::ConstBytes profile_packet() const { return at<37>().as_bytes(); }
+  bool has_streaming_allocation() const { return at<74>().valid(); }
+  ::protozero::ConstBytes streaming_allocation() const { return at<74>().as_bytes(); }
+  bool has_streaming_free() const { return at<75>().valid(); }
+  ::protozero::ConstBytes streaming_free() const { return at<75>().as_bytes(); }
+  bool has_battery() const { return at<38>().valid(); }
+  ::protozero::ConstBytes battery() const { return at<38>().as_bytes(); }
+  bool has_power_rails() const { return at<40>().valid(); }
+  ::protozero::ConstBytes power_rails() const { return at<40>().as_bytes(); }
+  bool has_android_log() const { return at<39>().valid(); }
+  ::protozero::ConstBytes android_log() const { return at<39>().as_bytes(); }
+  bool has_system_info() const { return at<45>().valid(); }
+  ::protozero::ConstBytes system_info() const { return at<45>().as_bytes(); }
+  bool has_trigger() const { return at<46>().valid(); }
+  ::protozero::ConstBytes trigger() const { return at<46>().as_bytes(); }
+  bool has_packages_list() const { return at<47>().valid(); }
+  ::protozero::ConstBytes packages_list() const { return at<47>().as_bytes(); }
+  bool has_chrome_benchmark_metadata() const { return at<48>().valid(); }
+  ::protozero::ConstBytes chrome_benchmark_metadata() const { return at<48>().as_bytes(); }
+  bool has_perfetto_metatrace() const { return at<49>().valid(); }
+  ::protozero::ConstBytes perfetto_metatrace() const { return at<49>().as_bytes(); }
+  bool has_chrome_metadata() const { return at<51>().valid(); }
+  ::protozero::ConstBytes chrome_metadata() const { return at<51>().as_bytes(); }
+  bool has_gpu_counter_event() const { return at<52>().valid(); }
+  ::protozero::ConstBytes gpu_counter_event() const { return at<52>().as_bytes(); }
+  bool has_gpu_render_stage_event() const { return at<53>().valid(); }
+  ::protozero::ConstBytes gpu_render_stage_event() const { return at<53>().as_bytes(); }
+  bool has_streaming_profile_packet() const { return at<54>().valid(); }
+  ::protozero::ConstBytes streaming_profile_packet() const { return at<54>().as_bytes(); }
+  bool has_heap_graph() const { return at<56>().valid(); }
+  ::protozero::ConstBytes heap_graph() const { return at<56>().as_bytes(); }
+  bool has_graphics_frame_event() const { return at<57>().valid(); }
+  ::protozero::ConstBytes graphics_frame_event() const { return at<57>().as_bytes(); }
+  bool has_vulkan_memory_event() const { return at<62>().valid(); }
+  ::protozero::ConstBytes vulkan_memory_event() const { return at<62>().as_bytes(); }
+  bool has_gpu_log() const { return at<63>().valid(); }
+  ::protozero::ConstBytes gpu_log() const { return at<63>().as_bytes(); }
+  bool has_vulkan_api_event() const { return at<65>().valid(); }
+  ::protozero::ConstBytes vulkan_api_event() const { return at<65>().as_bytes(); }
+  bool has_perf_sample() const { return at<66>().valid(); }
+  ::protozero::ConstBytes perf_sample() const { return at<66>().as_bytes(); }
+  bool has_cpu_info() const { return at<67>().valid(); }
+  ::protozero::ConstBytes cpu_info() const { return at<67>().as_bytes(); }
+  bool has_smaps_packet() const { return at<68>().valid(); }
+  ::protozero::ConstBytes smaps_packet() const { return at<68>().as_bytes(); }
+  bool has_service_event() const { return at<69>().valid(); }
+  ::protozero::ConstBytes service_event() const { return at<69>().as_bytes(); }
+  bool has_initial_display_state() const { return at<70>().valid(); }
+  ::protozero::ConstBytes initial_display_state() const { return at<70>().as_bytes(); }
+  bool has_gpu_mem_total_event() const { return at<71>().valid(); }
+  ::protozero::ConstBytes gpu_mem_total_event() const { return at<71>().as_bytes(); }
+  bool has_memory_tracker_snapshot() const { return at<73>().valid(); }
+  ::protozero::ConstBytes memory_tracker_snapshot() const { return at<73>().as_bytes(); }
+  bool has_frame_timeline_event() const { return at<76>().valid(); }
+  ::protozero::ConstBytes frame_timeline_event() const { return at<76>().as_bytes(); }
+  bool has_android_energy_estimation_breakdown() const { return at<77>().valid(); }
+  ::protozero::ConstBytes android_energy_estimation_breakdown() const { return at<77>().as_bytes(); }
+  bool has_ui_state() const { return at<78>().valid(); }
+  ::protozero::ConstBytes ui_state() const { return at<78>().as_bytes(); }
+  bool has_profiled_frame_symbols() const { return at<55>().valid(); }
+  ::protozero::ConstBytes profiled_frame_symbols() const { return at<55>().as_bytes(); }
+  bool has_module_symbols() const { return at<61>().valid(); }
+  ::protozero::ConstBytes module_symbols() const { return at<61>().as_bytes(); }
+  bool has_deobfuscation_mapping() const { return at<64>().valid(); }
+  ::protozero::ConstBytes deobfuscation_mapping() const { return at<64>().as_bytes(); }
+  bool has_track_descriptor() const { return at<60>().valid(); }
+  ::protozero::ConstBytes track_descriptor() const { return at<60>().as_bytes(); }
+  bool has_process_descriptor() const { return at<43>().valid(); }
+  ::protozero::ConstBytes process_descriptor() const { return at<43>().as_bytes(); }
+  bool has_thread_descriptor() const { return at<44>().valid(); }
+  ::protozero::ConstBytes thread_descriptor() const { return at<44>().as_bytes(); }
+  bool has_ftrace_events() const { return at<1>().valid(); }
+  ::protozero::ConstBytes ftrace_events() const { return at<1>().as_bytes(); }
+  bool has_synchronization_marker() const { return at<36>().valid(); }
+  ::protozero::ConstBytes synchronization_marker() const { return at<36>().as_bytes(); }
+  bool has_compressed_packets() const { return at<50>().valid(); }
+  ::protozero::ConstBytes compressed_packets() const { return at<50>().as_bytes(); }
+  bool has_extension_descriptor() const { return at<72>().valid(); }
+  ::protozero::ConstBytes extension_descriptor() const { return at<72>().as_bytes(); }
+  bool has_for_testing() const { return at<900>().valid(); }
+  ::protozero::ConstBytes for_testing() const { return at<900>().as_bytes(); }
+  bool has_trusted_uid() const { return at<3>().valid(); }
+  int32_t trusted_uid() const { return at<3>().as_int32(); }
+  bool has_trusted_packet_sequence_id() const { return at<10>().valid(); }
+  uint32_t trusted_packet_sequence_id() const { return at<10>().as_uint32(); }
+  bool has_interned_data() const { return at<12>().valid(); }
+  ::protozero::ConstBytes interned_data() const { return at<12>().as_bytes(); }
+  bool has_sequence_flags() const { return at<13>().valid(); }
+  uint32_t sequence_flags() const { return at<13>().as_uint32(); }
+  bool has_incremental_state_cleared() const { return at<41>().valid(); }
+  bool incremental_state_cleared() const { return at<41>().as_bool(); }
+  bool has_trace_packet_defaults() const { return at<59>().valid(); }
+  ::protozero::ConstBytes trace_packet_defaults() const { return at<59>().as_bytes(); }
+  bool has_previous_packet_dropped() const { return at<42>().valid(); }
+  bool previous_packet_dropped() const { return at<42>().as_bool(); }
+};
+
+class TracePacket : public ::protozero::Message {
+ public:
+  using Decoder = TracePacket_Decoder;
+  enum : int32_t {
+    kTimestampFieldNumber = 8,
+    kTimestampClockIdFieldNumber = 58,
+    kProcessTreeFieldNumber = 2,
+    kProcessStatsFieldNumber = 9,
+    kInodeFileMapFieldNumber = 4,
+    kChromeEventsFieldNumber = 5,
+    kClockSnapshotFieldNumber = 6,
+    kSysStatsFieldNumber = 7,
+    kTrackEventFieldNumber = 11,
+    kTraceConfigFieldNumber = 33,
+    kFtraceStatsFieldNumber = 34,
+    kTraceStatsFieldNumber = 35,
+    kProfilePacketFieldNumber = 37,
+    kStreamingAllocationFieldNumber = 74,
+    kStreamingFreeFieldNumber = 75,
+    kBatteryFieldNumber = 38,
+    kPowerRailsFieldNumber = 40,
+    kAndroidLogFieldNumber = 39,
+    kSystemInfoFieldNumber = 45,
+    kTriggerFieldNumber = 46,
+    kPackagesListFieldNumber = 47,
+    kChromeBenchmarkMetadataFieldNumber = 48,
+    kPerfettoMetatraceFieldNumber = 49,
+    kChromeMetadataFieldNumber = 51,
+    kGpuCounterEventFieldNumber = 52,
+    kGpuRenderStageEventFieldNumber = 53,
+    kStreamingProfilePacketFieldNumber = 54,
+    kHeapGraphFieldNumber = 56,
+    kGraphicsFrameEventFieldNumber = 57,
+    kVulkanMemoryEventFieldNumber = 62,
+    kGpuLogFieldNumber = 63,
+    kVulkanApiEventFieldNumber = 65,
+    kPerfSampleFieldNumber = 66,
+    kCpuInfoFieldNumber = 67,
+    kSmapsPacketFieldNumber = 68,
+    kServiceEventFieldNumber = 69,
+    kInitialDisplayStateFieldNumber = 70,
+    kGpuMemTotalEventFieldNumber = 71,
+    kMemoryTrackerSnapshotFieldNumber = 73,
+    kFrameTimelineEventFieldNumber = 76,
+    kAndroidEnergyEstimationBreakdownFieldNumber = 77,
+    kUiStateFieldNumber = 78,
+    kProfiledFrameSymbolsFieldNumber = 55,
+    kModuleSymbolsFieldNumber = 61,
+    kDeobfuscationMappingFieldNumber = 64,
+    kTrackDescriptorFieldNumber = 60,
+    kProcessDescriptorFieldNumber = 43,
+    kThreadDescriptorFieldNumber = 44,
+    kFtraceEventsFieldNumber = 1,
+    kSynchronizationMarkerFieldNumber = 36,
+    kCompressedPacketsFieldNumber = 50,
+    kExtensionDescriptorFieldNumber = 72,
+    kForTestingFieldNumber = 900,
+    kTrustedUidFieldNumber = 3,
+    kTrustedPacketSequenceIdFieldNumber = 10,
+    kInternedDataFieldNumber = 12,
+    kSequenceFlagsFieldNumber = 13,
+    kIncrementalStateClearedFieldNumber = 41,
+    kTracePacketDefaultsFieldNumber = 59,
+    kPreviousPacketDroppedFieldNumber = 42,
+  };
+  using SequenceFlags = ::perfetto::protos::pbzero::TracePacket_SequenceFlags;
+  static const SequenceFlags SEQ_UNSPECIFIED = TracePacket_SequenceFlags_SEQ_UNSPECIFIED;
+  static const SequenceFlags SEQ_INCREMENTAL_STATE_CLEARED = TracePacket_SequenceFlags_SEQ_INCREMENTAL_STATE_CLEARED;
+  static const SequenceFlags SEQ_NEEDS_INCREMENTAL_STATE = TracePacket_SequenceFlags_SEQ_NEEDS_INCREMENTAL_STATE;
+
+  using FieldMetadata_Timestamp =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Timestamp kTimestamp() { return {}; }
+  void set_timestamp(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Timestamp::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TimestampClockId =
+    ::protozero::proto_utils::FieldMetadata<
+      58,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TimestampClockId kTimestampClockId() { return {}; }
+  void set_timestamp_clock_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TimestampClockId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ProcessTree =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ProcessTree,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProcessTree kProcessTree() { return {}; }
+  template <typename T = ProcessTree> T* set_process_tree() {
+    return BeginNestedMessage<T>(2);
+  }
+
+
+  using FieldMetadata_ProcessStats =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ProcessStats,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProcessStats kProcessStats() { return {}; }
+  template <typename T = ProcessStats> T* set_process_stats() {
+    return BeginNestedMessage<T>(9);
+  }
+
+
+  using FieldMetadata_InodeFileMap =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      InodeFileMap,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_InodeFileMap kInodeFileMap() { return {}; }
+  template <typename T = InodeFileMap> T* set_inode_file_map() {
+    return BeginNestedMessage<T>(4);
+  }
+
+
+  using FieldMetadata_ChromeEvents =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeEventBundle,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeEvents kChromeEvents() { return {}; }
+  template <typename T = ChromeEventBundle> T* set_chrome_events() {
+    return BeginNestedMessage<T>(5);
+  }
+
+
+  using FieldMetadata_ClockSnapshot =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ClockSnapshot,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ClockSnapshot kClockSnapshot() { return {}; }
+  template <typename T = ClockSnapshot> T* set_clock_snapshot() {
+    return BeginNestedMessage<T>(6);
+  }
+
+
+  using FieldMetadata_SysStats =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SysStats,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SysStats kSysStats() { return {}; }
+  template <typename T = SysStats> T* set_sys_stats() {
+    return BeginNestedMessage<T>(7);
+  }
+
+
+  using FieldMetadata_TrackEvent =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TrackEvent,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TrackEvent kTrackEvent() { return {}; }
+  template <typename T = TrackEvent> T* set_track_event() {
+    return BeginNestedMessage<T>(11);
+  }
+
+
+  using FieldMetadata_TraceConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      33,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceConfig,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TraceConfig kTraceConfig() { return {}; }
+  template <typename T = TraceConfig> T* set_trace_config() {
+    return BeginNestedMessage<T>(33);
+  }
+
+
+  using FieldMetadata_FtraceStats =
+    ::protozero::proto_utils::FieldMetadata<
+      34,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      FtraceStats,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FtraceStats kFtraceStats() { return {}; }
+  template <typename T = FtraceStats> T* set_ftrace_stats() {
+    return BeginNestedMessage<T>(34);
+  }
+
+
+  using FieldMetadata_TraceStats =
+    ::protozero::proto_utils::FieldMetadata<
+      35,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceStats,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TraceStats kTraceStats() { return {}; }
+  template <typename T = TraceStats> T* set_trace_stats() {
+    return BeginNestedMessage<T>(35);
+  }
+
+
+  using FieldMetadata_ProfilePacket =
+    ::protozero::proto_utils::FieldMetadata<
+      37,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ProfilePacket,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProfilePacket kProfilePacket() { return {}; }
+  template <typename T = ProfilePacket> T* set_profile_packet() {
+    return BeginNestedMessage<T>(37);
+  }
+
+
+  using FieldMetadata_StreamingAllocation =
+    ::protozero::proto_utils::FieldMetadata<
+      74,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      StreamingAllocation,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StreamingAllocation kStreamingAllocation() { return {}; }
+  template <typename T = StreamingAllocation> T* set_streaming_allocation() {
+    return BeginNestedMessage<T>(74);
+  }
+
+
+  using FieldMetadata_StreamingFree =
+    ::protozero::proto_utils::FieldMetadata<
+      75,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      StreamingFree,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StreamingFree kStreamingFree() { return {}; }
+  template <typename T = StreamingFree> T* set_streaming_free() {
+    return BeginNestedMessage<T>(75);
+  }
+
+
+  using FieldMetadata_Battery =
+    ::protozero::proto_utils::FieldMetadata<
+      38,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BatteryCounters,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Battery kBattery() { return {}; }
+  template <typename T = BatteryCounters> T* set_battery() {
+    return BeginNestedMessage<T>(38);
+  }
+
+
+  using FieldMetadata_PowerRails =
+    ::protozero::proto_utils::FieldMetadata<
+      40,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      PowerRails,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PowerRails kPowerRails() { return {}; }
+  template <typename T = PowerRails> T* set_power_rails() {
+    return BeginNestedMessage<T>(40);
+  }
+
+
+  using FieldMetadata_AndroidLog =
+    ::protozero::proto_utils::FieldMetadata<
+      39,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      AndroidLogPacket,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AndroidLog kAndroidLog() { return {}; }
+  template <typename T = AndroidLogPacket> T* set_android_log() {
+    return BeginNestedMessage<T>(39);
+  }
+
+
+  using FieldMetadata_SystemInfo =
+    ::protozero::proto_utils::FieldMetadata<
+      45,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SystemInfo,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SystemInfo kSystemInfo() { return {}; }
+  template <typename T = SystemInfo> T* set_system_info() {
+    return BeginNestedMessage<T>(45);
+  }
+
+
+  using FieldMetadata_Trigger =
+    ::protozero::proto_utils::FieldMetadata<
+      46,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Trigger,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Trigger kTrigger() { return {}; }
+  template <typename T = Trigger> T* set_trigger() {
+    return BeginNestedMessage<T>(46);
+  }
+
+
+  using FieldMetadata_PackagesList =
+    ::protozero::proto_utils::FieldMetadata<
+      47,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      PackagesList,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PackagesList kPackagesList() { return {}; }
+  template <typename T = PackagesList> T* set_packages_list() {
+    return BeginNestedMessage<T>(47);
+  }
+
+
+  using FieldMetadata_ChromeBenchmarkMetadata =
+    ::protozero::proto_utils::FieldMetadata<
+      48,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeBenchmarkMetadata,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeBenchmarkMetadata kChromeBenchmarkMetadata() { return {}; }
+  template <typename T = ChromeBenchmarkMetadata> T* set_chrome_benchmark_metadata() {
+    return BeginNestedMessage<T>(48);
+  }
+
+
+  using FieldMetadata_PerfettoMetatrace =
+    ::protozero::proto_utils::FieldMetadata<
+      49,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      PerfettoMetatrace,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PerfettoMetatrace kPerfettoMetatrace() { return {}; }
+  template <typename T = PerfettoMetatrace> T* set_perfetto_metatrace() {
+    return BeginNestedMessage<T>(49);
+  }
+
+
+  using FieldMetadata_ChromeMetadata =
+    ::protozero::proto_utils::FieldMetadata<
+      51,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeMetadataPacket,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeMetadata kChromeMetadata() { return {}; }
+  template <typename T = ChromeMetadataPacket> T* set_chrome_metadata() {
+    return BeginNestedMessage<T>(51);
+  }
+
+
+  using FieldMetadata_GpuCounterEvent =
+    ::protozero::proto_utils::FieldMetadata<
+      52,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      GpuCounterEvent,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GpuCounterEvent kGpuCounterEvent() { return {}; }
+  template <typename T = GpuCounterEvent> T* set_gpu_counter_event() {
+    return BeginNestedMessage<T>(52);
+  }
+
+
+  using FieldMetadata_GpuRenderStageEvent =
+    ::protozero::proto_utils::FieldMetadata<
+      53,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      GpuRenderStageEvent,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GpuRenderStageEvent kGpuRenderStageEvent() { return {}; }
+  template <typename T = GpuRenderStageEvent> T* set_gpu_render_stage_event() {
+    return BeginNestedMessage<T>(53);
+  }
+
+
+  using FieldMetadata_StreamingProfilePacket =
+    ::protozero::proto_utils::FieldMetadata<
+      54,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      StreamingProfilePacket,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StreamingProfilePacket kStreamingProfilePacket() { return {}; }
+  template <typename T = StreamingProfilePacket> T* set_streaming_profile_packet() {
+    return BeginNestedMessage<T>(54);
+  }
+
+
+  using FieldMetadata_HeapGraph =
+    ::protozero::proto_utils::FieldMetadata<
+      56,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      HeapGraph,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HeapGraph kHeapGraph() { return {}; }
+  template <typename T = HeapGraph> T* set_heap_graph() {
+    return BeginNestedMessage<T>(56);
+  }
+
+
+  using FieldMetadata_GraphicsFrameEvent =
+    ::protozero::proto_utils::FieldMetadata<
+      57,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      GraphicsFrameEvent,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GraphicsFrameEvent kGraphicsFrameEvent() { return {}; }
+  template <typename T = GraphicsFrameEvent> T* set_graphics_frame_event() {
+    return BeginNestedMessage<T>(57);
+  }
+
+
+  using FieldMetadata_VulkanMemoryEvent =
+    ::protozero::proto_utils::FieldMetadata<
+      62,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      VulkanMemoryEvent,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_VulkanMemoryEvent kVulkanMemoryEvent() { return {}; }
+  template <typename T = VulkanMemoryEvent> T* set_vulkan_memory_event() {
+    return BeginNestedMessage<T>(62);
+  }
+
+
+  using FieldMetadata_GpuLog =
+    ::protozero::proto_utils::FieldMetadata<
+      63,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      GpuLog,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GpuLog kGpuLog() { return {}; }
+  template <typename T = GpuLog> T* set_gpu_log() {
+    return BeginNestedMessage<T>(63);
+  }
+
+
+  using FieldMetadata_VulkanApiEvent =
+    ::protozero::proto_utils::FieldMetadata<
+      65,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      VulkanApiEvent,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_VulkanApiEvent kVulkanApiEvent() { return {}; }
+  template <typename T = VulkanApiEvent> T* set_vulkan_api_event() {
+    return BeginNestedMessage<T>(65);
+  }
+
+
+  using FieldMetadata_PerfSample =
+    ::protozero::proto_utils::FieldMetadata<
+      66,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      PerfSample,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PerfSample kPerfSample() { return {}; }
+  template <typename T = PerfSample> T* set_perf_sample() {
+    return BeginNestedMessage<T>(66);
+  }
+
+
+  using FieldMetadata_CpuInfo =
+    ::protozero::proto_utils::FieldMetadata<
+      67,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      CpuInfo,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CpuInfo kCpuInfo() { return {}; }
+  template <typename T = CpuInfo> T* set_cpu_info() {
+    return BeginNestedMessage<T>(67);
+  }
+
+
+  using FieldMetadata_SmapsPacket =
+    ::protozero::proto_utils::FieldMetadata<
+      68,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SmapsPacket,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SmapsPacket kSmapsPacket() { return {}; }
+  template <typename T = SmapsPacket> T* set_smaps_packet() {
+    return BeginNestedMessage<T>(68);
+  }
+
+
+  using FieldMetadata_ServiceEvent =
+    ::protozero::proto_utils::FieldMetadata<
+      69,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TracingServiceEvent,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ServiceEvent kServiceEvent() { return {}; }
+  template <typename T = TracingServiceEvent> T* set_service_event() {
+    return BeginNestedMessage<T>(69);
+  }
+
+
+  using FieldMetadata_InitialDisplayState =
+    ::protozero::proto_utils::FieldMetadata<
+      70,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      InitialDisplayState,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_InitialDisplayState kInitialDisplayState() { return {}; }
+  template <typename T = InitialDisplayState> T* set_initial_display_state() {
+    return BeginNestedMessage<T>(70);
+  }
+
+
+  using FieldMetadata_GpuMemTotalEvent =
+    ::protozero::proto_utils::FieldMetadata<
+      71,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      GpuMemTotalEvent,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GpuMemTotalEvent kGpuMemTotalEvent() { return {}; }
+  template <typename T = GpuMemTotalEvent> T* set_gpu_mem_total_event() {
+    return BeginNestedMessage<T>(71);
+  }
+
+
+  using FieldMetadata_MemoryTrackerSnapshot =
+    ::protozero::proto_utils::FieldMetadata<
+      73,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MemoryTrackerSnapshot,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MemoryTrackerSnapshot kMemoryTrackerSnapshot() { return {}; }
+  template <typename T = MemoryTrackerSnapshot> T* set_memory_tracker_snapshot() {
+    return BeginNestedMessage<T>(73);
+  }
+
+
+  using FieldMetadata_FrameTimelineEvent =
+    ::protozero::proto_utils::FieldMetadata<
+      76,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      FrameTimelineEvent,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FrameTimelineEvent kFrameTimelineEvent() { return {}; }
+  template <typename T = FrameTimelineEvent> T* set_frame_timeline_event() {
+    return BeginNestedMessage<T>(76);
+  }
+
+
+  using FieldMetadata_AndroidEnergyEstimationBreakdown =
+    ::protozero::proto_utils::FieldMetadata<
+      77,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      AndroidEnergyEstimationBreakdown,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AndroidEnergyEstimationBreakdown kAndroidEnergyEstimationBreakdown() { return {}; }
+  template <typename T = AndroidEnergyEstimationBreakdown> T* set_android_energy_estimation_breakdown() {
+    return BeginNestedMessage<T>(77);
+  }
+
+
+  using FieldMetadata_UiState =
+    ::protozero::proto_utils::FieldMetadata<
+      78,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      UiState,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UiState kUiState() { return {}; }
+  template <typename T = UiState> T* set_ui_state() {
+    return BeginNestedMessage<T>(78);
+  }
+
+
+  using FieldMetadata_ProfiledFrameSymbols =
+    ::protozero::proto_utils::FieldMetadata<
+      55,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ProfiledFrameSymbols,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProfiledFrameSymbols kProfiledFrameSymbols() { return {}; }
+  template <typename T = ProfiledFrameSymbols> T* set_profiled_frame_symbols() {
+    return BeginNestedMessage<T>(55);
+  }
+
+
+  using FieldMetadata_ModuleSymbols =
+    ::protozero::proto_utils::FieldMetadata<
+      61,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ModuleSymbols,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ModuleSymbols kModuleSymbols() { return {}; }
+  template <typename T = ModuleSymbols> T* set_module_symbols() {
+    return BeginNestedMessage<T>(61);
+  }
+
+
+  using FieldMetadata_DeobfuscationMapping =
+    ::protozero::proto_utils::FieldMetadata<
+      64,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      DeobfuscationMapping,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DeobfuscationMapping kDeobfuscationMapping() { return {}; }
+  template <typename T = DeobfuscationMapping> T* set_deobfuscation_mapping() {
+    return BeginNestedMessage<T>(64);
+  }
+
+
+  using FieldMetadata_TrackDescriptor =
+    ::protozero::proto_utils::FieldMetadata<
+      60,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TrackDescriptor,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TrackDescriptor kTrackDescriptor() { return {}; }
+  template <typename T = TrackDescriptor> T* set_track_descriptor() {
+    return BeginNestedMessage<T>(60);
+  }
+
+
+  using FieldMetadata_ProcessDescriptor =
+    ::protozero::proto_utils::FieldMetadata<
+      43,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ProcessDescriptor,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProcessDescriptor kProcessDescriptor() { return {}; }
+  template <typename T = ProcessDescriptor> T* set_process_descriptor() {
+    return BeginNestedMessage<T>(43);
+  }
+
+
+  using FieldMetadata_ThreadDescriptor =
+    ::protozero::proto_utils::FieldMetadata<
+      44,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ThreadDescriptor,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ThreadDescriptor kThreadDescriptor() { return {}; }
+  template <typename T = ThreadDescriptor> T* set_thread_descriptor() {
+    return BeginNestedMessage<T>(44);
+  }
+
+
+  using FieldMetadata_FtraceEvents =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      FtraceEventBundle,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FtraceEvents kFtraceEvents() { return {}; }
+  template <typename T = FtraceEventBundle> T* set_ftrace_events() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_SynchronizationMarker =
+    ::protozero::proto_utils::FieldMetadata<
+      36,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBytes,
+      std::string,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SynchronizationMarker kSynchronizationMarker() { return {}; }
+  void set_synchronization_marker(const uint8_t* data, size_t size) {
+    AppendBytes(FieldMetadata_SynchronizationMarker::kFieldId, data, size);
+  }
+  void set_synchronization_marker(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_SynchronizationMarker::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBytes>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CompressedPackets =
+    ::protozero::proto_utils::FieldMetadata<
+      50,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBytes,
+      std::string,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CompressedPackets kCompressedPackets() { return {}; }
+  void set_compressed_packets(const uint8_t* data, size_t size) {
+    AppendBytes(FieldMetadata_CompressedPackets::kFieldId, data, size);
+  }
+  void set_compressed_packets(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_CompressedPackets::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBytes>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ExtensionDescriptor =
+    ::protozero::proto_utils::FieldMetadata<
+      72,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ExtensionDescriptor,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ExtensionDescriptor kExtensionDescriptor() { return {}; }
+  template <typename T = ExtensionDescriptor> T* set_extension_descriptor() {
+    return BeginNestedMessage<T>(72);
+  }
+
+
+  using FieldMetadata_ForTesting =
+    ::protozero::proto_utils::FieldMetadata<
+      900,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TestEvent,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ForTesting kForTesting() { return {}; }
+  template <typename T = TestEvent> T* set_for_testing() {
+    return BeginNestedMessage<T>(900);
+  }
+
+
+  using FieldMetadata_TrustedUid =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TrustedUid kTrustedUid() { return {}; }
+  void set_trusted_uid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TrustedUid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TrustedPacketSequenceId =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TrustedPacketSequenceId kTrustedPacketSequenceId() { return {}; }
+  void set_trusted_packet_sequence_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TrustedPacketSequenceId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_InternedData =
+    ::protozero::proto_utils::FieldMetadata<
+      12,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      InternedData,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_InternedData kInternedData() { return {}; }
+  template <typename T = InternedData> T* set_interned_data() {
+    return BeginNestedMessage<T>(12);
+  }
+
+
+  using FieldMetadata_SequenceFlags =
+    ::protozero::proto_utils::FieldMetadata<
+      13,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SequenceFlags kSequenceFlags() { return {}; }
+  void set_sequence_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SequenceFlags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IncrementalStateCleared =
+    ::protozero::proto_utils::FieldMetadata<
+      41,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IncrementalStateCleared kIncrementalStateCleared() { return {}; }
+  void set_incremental_state_cleared(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_IncrementalStateCleared::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TracePacketDefaults =
+    ::protozero::proto_utils::FieldMetadata<
+      59,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TracePacketDefaults,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TracePacketDefaults kTracePacketDefaults() { return {}; }
+  template <typename T = TracePacketDefaults> T* set_trace_packet_defaults() {
+    return BeginNestedMessage<T>(59);
+  }
+
+
+  using FieldMetadata_PreviousPacketDropped =
+    ::protozero::proto_utils::FieldMetadata<
+      42,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PreviousPacketDropped kPreviousPacketDropped() { return {}; }
+  void set_previous_packet_dropped(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_PreviousPacketDropped::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_DATA_SOURCE_H_
+#define INCLUDE_PERFETTO_TRACING_DATA_SOURCE_H_
+
+// This header contains the key class (DataSource) that a producer app should
+// override in order to create a custom data source that gets tracing Start/Stop
+// notifications and emits tracing data.
+
+#include <assert.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include <array>
+#include <atomic>
+#include <functional>
+#include <memory>
+#include <mutex>
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+// gen_amalgamated expanded: #include "perfetto/base/compiler.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message_handle.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/buffer_exhausted_policy.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/forward_decls.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/basic_types.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/data_source_internal.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/tracing_muxer.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/locked_handle.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/trace_writer_base.h"
+
+// gen_amalgamated expanded: #include "protos/perfetto/trace/trace_packet.pbzero.h"
+
+// PERFETTO_COMPONENT_EXPORT is used to mark symbols in Perfetto's headers
+// (typically templates) that are defined by the user outside of Perfetto and
+// should be made visible outside the current module. (e.g., in Chrome's
+// component build).
+#if !defined(PERFETTO_COMPONENT_EXPORT)
+#define PERFETTO_COMPONENT_EXPORT
+#endif
+
+namespace perfetto {
+namespace internal {
+class TracingMuxerImpl;
+class TrackEventCategoryRegistry;
+template <typename, const internal::TrackEventCategoryRegistry*>
+class TrackEventDataSource;
+}  // namespace internal
+
+// Base class with the virtual methods to get start/stop notifications.
+// Embedders are supposed to derive the templated version below, not this one.
+class PERFETTO_EXPORT DataSourceBase {
+ public:
+  virtual ~DataSourceBase();
+
+  // TODO(primiano): change the const& args below to be pointers instead. It
+  // makes it more awkward to handle output arguments and require mutable(s).
+  // This requires synchronizing a breaking API change for existing embedders.
+
+  // OnSetup() is invoked when tracing is configured. In most cases this happens
+  // just before starting the trace. In the case of deferred start (see
+  // deferred_start in trace_config.proto) start might happen later.
+  class SetupArgs {
+   public:
+    // This is valid only within the scope of the OnSetup() call and must not
+    // be retained.
+    const DataSourceConfig* config = nullptr;
+
+    // The index of this data source instance (0..kMaxDataSourceInstances - 1).
+    uint32_t internal_instance_index = 0;
+  };
+  virtual void OnSetup(const SetupArgs&);
+
+  class StartArgs {
+   public:
+    // The index of this data source instance (0..kMaxDataSourceInstances - 1).
+    uint32_t internal_instance_index = 0;
+  };
+  virtual void OnStart(const StartArgs&);
+
+  class StopArgs {
+   public:
+    virtual ~StopArgs();
+
+    // HandleAsynchronously() can optionally be called to defer the tracing
+    // session stop and write tracing data just before stopping.
+    // This function returns a closure that must be invoked after the last
+    // trace events have been emitted. The returned closure can be called from
+    // any thread. The caller also needs to explicitly call TraceContext.Flush()
+    // from the last Trace() lambda invocation because no other implicit flushes
+    // will happen after the stop signal.
+    // When this function is called, the tracing service will defer the stop of
+    // the tracing session until the returned closure is invoked.
+    // However, the caller cannot hang onto this closure for too long. The
+    // tracing service will forcefully stop the tracing session without waiting
+    // for pending producers after TraceConfig.data_source_stop_timeout_ms
+    // (default: 5s, can be overridden by Consumers when starting a trace).
+    // If the closure is called after this timeout an error will be logged and
+    // the trace data emitted will not be present in the trace. No other
+    // functional side effects (e.g. crashes or corruptions) will happen. In
+    // other words, it is fine to accidentally hold onto this closure for too
+    // long but, if that happens, some tracing data will be lost.
+    virtual std::function<void()> HandleStopAsynchronously() const = 0;
+
+    // The index of this data source instance (0..kMaxDataSourceInstances - 1).
+    uint32_t internal_instance_index = 0;
+  };
+  virtual void OnStop(const StopArgs&);
+};
+
+struct DefaultDataSourceTraits {
+  // |IncrementalStateType| can optionally be used store custom per-sequence
+  // incremental data (e.g., interning tables). It should have a Clear() method
+  // for when incremental state needs to be cleared. See
+  // TraceContext::GetIncrementalState().
+  using IncrementalStateType = void;
+
+  // Allows overriding what type of thread-local state configuration the data
+  // source uses. By default every data source gets independent thread-local
+  // state, which means every instance uses separate trace writers and
+  // incremental state even on the same thread. Some data sources (most notably
+  // the track event data source) want to share trace writers and incremental
+  // state on the same thread.
+  static internal::DataSourceThreadLocalState* GetDataSourceTLS(
+      internal::DataSourceStaticState* static_state,
+      internal::TracingTLS* root_tls) {
+    auto* ds_tls = &root_tls->data_sources_tls[static_state->index];
+    // The per-type TLS is either zero-initialized or must have been initialized
+    // for this specific data source type.
+    assert(!ds_tls->static_state ||
+           ds_tls->static_state->index == static_state->index);
+    return ds_tls;
+  }
+};
+
+// Templated base class meant to be derived by embedders to create a custom data
+// source. DataSourceType must be the type of the derived class itself, e.g.:
+// class MyDataSource : public DataSourceBase<MyDataSource> {...}.
+//
+// |DataSourceTraits| allows customizing the behavior of the data source. See
+// |DefaultDataSourceTraits|.
+template <typename DataSourceType,
+          typename DataSourceTraits = DefaultDataSourceTraits>
+class DataSource : public DataSourceBase {
+  struct DefaultTracePointTraits;
+
+ public:
+  // The BufferExhaustedPolicy to use for TraceWriters of this DataSource.
+  // Override this in your DataSource class to change the default, which is to
+  // drop data on shared memory overruns.
+  constexpr static BufferExhaustedPolicy kBufferExhaustedPolicy =
+      BufferExhaustedPolicy::kDrop;
+
+  // Argument passed to the lambda function passed to Trace() (below).
+  class TraceContext {
+   public:
+    using TracePacketHandle =
+        ::protozero::MessageHandle<::perfetto::protos::pbzero::TracePacket>;
+
+    TraceContext(TraceContext&&) noexcept = default;
+    ~TraceContext() {
+      // If the data source is being intercepted, flush the trace writer after
+      // each trace point to make sure the interceptor sees the data right away.
+      if (PERFETTO_UNLIKELY(tls_inst_->is_intercepted))
+        Flush();
+    }
+
+    TracePacketHandle NewTracePacket() {
+      return tls_inst_->trace_writer->NewTracePacket();
+    }
+
+    // Forces a commit of the thread-local tracing data written so far to the
+    // service. This is almost never required (tracing data is periodically
+    // committed as trace pages are filled up) and has a non-negligible
+    // performance hit (requires an IPC + refresh of the current thread-local
+    // chunk). The only case when this should be used is when handling OnStop()
+    // asynchronously, to ensure sure that the data is committed before the
+    // Stop timeout expires.
+    // The TracePacketHandle obtained by the last NewTracePacket() call must be
+    // finalized before calling Flush() (either implicitly by going out of scope
+    // or by explicitly calling Finalize()).
+    // |cb| is an optional callback. When non-null it will request the
+    // service to ACK the flush and will be invoked on an internal thread after
+    // the service has  acknowledged it. The callback might be NEVER INVOKED if
+    // the service crashes or the IPC connection is dropped.
+    void Flush(std::function<void()> cb = {}) {
+      tls_inst_->trace_writer->Flush(cb);
+    }
+
+    // Returns the number of bytes written on the current thread by the current
+    // data-source since its creation.
+    // This can be useful for splitting protos that might grow very large.
+    uint64_t written() { return tls_inst_->trace_writer->written(); }
+
+    // Returns a RAII handle to access the data source instance, guaranteeing
+    // that it won't be deleted on another thread (because of trace stopping)
+    // while accessing it from within the Trace() lambda.
+    // The returned handle can be invalid (nullptr) if tracing is stopped
+    // immediately before calling this. The caller is supposed to check for its
+    // validity before using it. After checking, the handle is guaranteed to
+    // remain valid until the handle goes out of scope.
+    LockedHandle<DataSourceType> GetDataSourceLocked() {
+      auto* internal_state = static_state_.TryGet(instance_index_);
+      if (!internal_state)
+        return LockedHandle<DataSourceType>();
+      return LockedHandle<DataSourceType>(
+          &internal_state->lock,
+          static_cast<DataSourceType*>(internal_state->data_source.get()));
+    }
+
+    typename DataSourceTraits::IncrementalStateType* GetIncrementalState() {
+      // Recreate incremental state data if it has been reset by the service.
+      if (tls_inst_->incremental_state_generation !=
+          static_state_.incremental_state_generation.load(
+              std::memory_order_relaxed)) {
+        tls_inst_->incremental_state.reset();
+        CreateIncrementalState(tls_inst_);
+      }
+      return reinterpret_cast<typename DataSourceTraits::IncrementalStateType*>(
+          tls_inst_->incremental_state.get());
+    }
+
+   private:
+    friend class DataSource;
+    template <typename, const internal::TrackEventCategoryRegistry*>
+    friend class internal::TrackEventDataSource;
+    TraceContext(internal::DataSourceInstanceThreadLocalState* tls_inst,
+                 uint32_t instance_index)
+        : tls_inst_(tls_inst), instance_index_(instance_index) {}
+    TraceContext(const TraceContext&) = delete;
+    TraceContext& operator=(const TraceContext&) = delete;
+
+    internal::DataSourceInstanceThreadLocalState* const tls_inst_;
+    uint32_t const instance_index_;
+  };
+
+  // The main tracing method. Tracing code should call this passing a lambda as
+  // argument, with the following signature: void(TraceContext).
+  // The lambda will be called synchronously (i.e., always before Trace()
+  // returns) only if tracing is enabled and the data source has been enabled in
+  // the tracing config.
+  // The lambda can be called more than once per Trace() call, in the case of
+  // concurrent tracing sessions (or even if the data source is instantiated
+  // twice within the same trace config).
+  template <typename Lambda>
+  static void Trace(Lambda tracing_fn) {
+    CallIfEnabled<DefaultTracePointTraits>([&tracing_fn](uint32_t instances) {
+      TraceWithInstances<DefaultTracePointTraits>(instances,
+                                                  std::move(tracing_fn));
+    });
+  }
+
+  // An efficient trace point guard for checking if this data source is active.
+  // |callback| is a function which will only be called if there are active
+  // instances. It is given an instance state parameter, which should be passed
+  // to TraceWithInstances() to actually record trace data.
+  template <typename Traits = DefaultTracePointTraits, typename Callback>
+  static void CallIfEnabled(Callback callback,
+                            typename Traits::TracePointData trace_point_data =
+                                {}) PERFETTO_ALWAYS_INLINE {
+    // |instances| is a per-class bitmap that tells:
+    // 1. If the data source is enabled at all.
+    // 2. The index of the slot within |static_state_| that holds the instance
+    //    state. In turn this allows to map the data source to the tracing
+    //    session and buffers.
+    // memory_order_relaxed is okay because:
+    // - |instances| is re-read with an acquire barrier below if this succeeds.
+    // - The code between this point and the acquire-load is based on static
+    //    storage which has indefinite lifetime.
+    uint32_t instances = Traits::GetActiveInstances(trace_point_data)
+                             ->load(std::memory_order_relaxed);
+
+    // This is the tracing fast-path. Bail out immediately if tracing is not
+    // enabled (or tracing is enabled but not for this data source).
+    if (PERFETTO_LIKELY(!instances))
+      return;
+    callback(instances);
+  }
+
+  // The "lower half" of a trace point which actually performs tracing after
+  // this data source has been determined to be active.
+  // |instances| must be the instance state value retrieved through
+  // CallIfEnabled().
+  // |tracing_fn| will be called to record trace data as in Trace().
+  //
+  // |trace_point_data| is an optional parameter given to |Traits::
+  // GetActiveInstances| to make it possible to use custom storage for
+  // the data source enabled state. This is, for example, used by TrackEvent to
+  // implement per-tracing category enabled states.
+  //
+  // TODO(primiano): all the stuff below should be outlined from the trace
+  // point. Or at least we should have some compile-time traits like
+  // kOptimizeBinarySize / kOptimizeTracingLatency.
+  template <typename Traits = DefaultTracePointTraits, typename Lambda>
+  static void TraceWithInstances(
+      uint32_t instances,
+      Lambda tracing_fn,
+      typename Traits::TracePointData trace_point_data = {}) {
+    PERFETTO_DCHECK(instances);
+    constexpr auto kMaxDataSourceInstances = internal::kMaxDataSourceInstances;
+
+    // See tracing_muxer.h for the structure of the TLS.
+    auto* tracing_impl = internal::TracingMuxer::Get();
+    if (PERFETTO_UNLIKELY(!tls_state_))
+      tls_state_ = GetOrCreateDataSourceTLS(&static_state_);
+
+    // Avoid re-entering the trace point recursively.
+    if (PERFETTO_UNLIKELY(tls_state_->root_tls->is_in_trace_point))
+      return;
+    internal::ScopedReentrancyAnnotator scoped_annotator(*tls_state_->root_tls);
+
+    // TracingTLS::generation is a global monotonic counter that is incremented
+    // every time a tracing session is stopped. We use that as a signal to force
+    // a slow-path garbage collection of all the trace writers for the current
+    // thread and to destroy the ones that belong to tracing sessions that have
+    // ended. This is to avoid having too many TraceWriter instances alive, each
+    // holding onto one chunk of the shared memory buffer.
+    // Rationale why memory_order_relaxed should be fine:
+    // - The TraceWriter object that we use is always constructed and destructed
+    //   on the current thread. There is no risk of accessing a half-initialized
+    //   TraceWriter (which would be really bad).
+    // - In the worst case, in the case of a race on the generation check, we
+    //   might end up using a TraceWriter for the same data source that belongs
+    //   to a stopped session. This is not really wrong, as we don't give any
+    //   guarantee on the global atomicity of the stop. In the worst case the
+    //   service will reject the data commit if this arrives too late.
+
+    if (PERFETTO_UNLIKELY(
+            tls_state_->root_tls->generation !=
+            tracing_impl->generation(std::memory_order_relaxed))) {
+      // Will update root_tls->generation.
+      tracing_impl->DestroyStoppedTraceWritersForCurrentThread();
+    }
+
+    for (uint32_t i = 0; i < kMaxDataSourceInstances; i++) {
+      internal::DataSourceState* instance_state =
+          static_state_.TryGetCached(instances, i);
+      if (!instance_state)
+        continue;
+
+      // Even if we passed the check above, the DataSourceInstance might be
+      // still destroyed concurrently while this code runs. The code below is
+      // designed to deal with such race, as follows:
+      // - We don't access the user-defined data source instance state. The only
+      //   bits of state we use are |backend_id| and |buffer_id|.
+      // - Beyond those two integers, we access only the TraceWriter here. The
+      //   TraceWriter is always safe because it lives on the TLS.
+      // - |instance_state| is backed by static storage, so the pointer is
+      //   always valid, even after the data source instance is destroyed.
+      // - In the case of a race-on-destruction, we'll still see the latest
+      //   backend_id and buffer_id and in the worst case keep trying writing
+      //   into the tracing shared memory buffer after stopped. But this isn't
+      //   really any worse than the case of the stop IPC being delayed by the
+      //   kernel scheduler. The tracing service is robust against data commit
+      //   attemps made after tracing is stopped.
+      // There is a theoretical race that would case the wrong behavior w.r.t
+      // writing data in the wrong buffer, but it's so rare that we ignore it:
+      // if the data source is stopped and started kMaxDataSourceInstances
+      // times (so that the same id is recycled) while we are in this function,
+      // we might end up reusing the old data source's backend_id and buffer_id
+      // for the new one, because we don't see the generation change past this
+      // point. But stopping and starting tracing (even once) takes so much
+      // handshaking to make this extremely unrealistic.
+
+      auto& tls_inst = tls_state_->per_instance[i];
+      if (PERFETTO_UNLIKELY(!tls_inst.trace_writer)) {
+        // Here we need an acquire barrier, which matches the release-store made
+        // by TracingMuxerImpl::SetupDataSource(), to ensure that the backend_id
+        // and buffer_id are consistent.
+        instances = Traits::GetActiveInstances(trace_point_data)
+                        ->load(std::memory_order_acquire);
+        instance_state = static_state_.TryGetCached(instances, i);
+        if (!instance_state || !instance_state->trace_lambda_enabled)
+          continue;
+        tls_inst.backend_id = instance_state->backend_id;
+        tls_inst.backend_connection_id = instance_state->backend_connection_id;
+        tls_inst.buffer_id = instance_state->buffer_id;
+        tls_inst.data_source_instance_id =
+            instance_state->data_source_instance_id;
+        tls_inst.is_intercepted = instance_state->interceptor_id != 0;
+        tls_inst.trace_writer = tracing_impl->CreateTraceWriter(
+            &static_state_, i, instance_state,
+            DataSourceType::kBufferExhaustedPolicy);
+        CreateIncrementalState(&tls_inst);
+
+        // Even in the case of out-of-IDs, SharedMemoryArbiterImpl returns a
+        // NullTraceWriter. The returned pointer should never be null.
+        assert(tls_inst.trace_writer);
+      }
+
+      tracing_fn(TraceContext(&tls_inst, i));
+    }
+  }
+
+  // Registers the data source on all tracing backends, including ones that
+  // connect after the registration. Doing so enables the data source to receive
+  // Setup/Start/Stop notifications and makes the Trace() method work when
+  // tracing is enabled and the data source is selected.
+  // This must be called after Tracing::Initialize().
+  // Can return false to signal failure if attemping to register more than
+  // kMaxDataSources (32) data sources types or if tracing hasn't been
+  // initialized.
+  // The optional |constructor_args| will be passed to the data source when it
+  // is constructed.
+  template <class... Args>
+  static bool Register(const DataSourceDescriptor& descriptor,
+                       const Args&... constructor_args) {
+    // Silences -Wunused-variable warning in case the trace method is not used
+    // by the translation unit that declares the data source.
+    (void)static_state_;
+    (void)tls_state_;
+
+    auto factory = [constructor_args...]() {
+      return std::unique_ptr<DataSourceBase>(
+          new DataSourceType(constructor_args...));
+    };
+    auto* tracing_impl = internal::TracingMuxer::Get();
+    return tracing_impl->RegisterDataSource(descriptor, factory,
+                                            &static_state_);
+  }
+
+ private:
+  // Traits for customizing the behavior of a specific trace point.
+  struct DefaultTracePointTraits {
+    // By default, every call to DataSource::Trace() will record trace events
+    // for every active instance of that data source. A single trace point can,
+    // however, use a custom set of enable flags for more fine grained control
+    // of when that trace point is active.
+    //
+    // DANGER: when doing this, the data source must use the appropriate memory
+    // fences when changing the state of the bitmap.
+    //
+    // |TraceWithInstances| may be optionally given an additional parameter for
+    // looking up the enable flags. That parameter is passed as |TracePointData|
+    // to |GetActiveInstances|. This is, for example, used by TrackEvent to
+    // implement per-category enabled states.
+    struct TracePointData {};
+    static constexpr std::atomic<uint32_t>* GetActiveInstances(TracePointData) {
+      return &static_state_.valid_instances;
+    }
+  };
+
+  // Create the user provided incremental state in the given thread-local
+  // storage. Note: The second parameter here is used to specialize the case
+  // where there is no incremental state type.
+  template <typename T>
+  static void CreateIncrementalStateImpl(
+      internal::DataSourceInstanceThreadLocalState* tls_inst,
+      const T*) {
+    PERFETTO_DCHECK(!tls_inst->incremental_state);
+    tls_inst->incremental_state_generation =
+        static_state_.incremental_state_generation.load(
+            std::memory_order_relaxed);
+    tls_inst->incremental_state =
+        internal::DataSourceInstanceThreadLocalState::IncrementalStatePointer(
+            reinterpret_cast<void*>(new T()),
+            [](void* p) { delete reinterpret_cast<T*>(p); });
+  }
+
+  static void CreateIncrementalStateImpl(
+      internal::DataSourceInstanceThreadLocalState*,
+      const void*) {}
+
+  static void CreateIncrementalState(
+      internal::DataSourceInstanceThreadLocalState* tls_inst) {
+    CreateIncrementalStateImpl(
+        tls_inst,
+        static_cast<typename DataSourceTraits::IncrementalStateType*>(nullptr));
+  }
+
+  // Note that the returned object is one per-thread per-data-source-type, NOT
+  // per data-source *instance*.
+  static internal::DataSourceThreadLocalState* GetOrCreateDataSourceTLS(
+      internal::DataSourceStaticState* static_state) {
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_IOS)
+    PERFETTO_FATAL("Data source TLS not supported on iOS, see b/158814068");
+#endif
+    auto* tracing_impl = internal::TracingMuxer::Get();
+    internal::TracingTLS* root_tls = tracing_impl->GetOrCreateTracingTLS();
+    internal::DataSourceThreadLocalState* ds_tls =
+        DataSourceTraits::GetDataSourceTLS(static_state, root_tls);
+    // We keep re-initializing as the initialization is idempotent and not worth
+    // the code for extra checks.
+    ds_tls->static_state = static_state;
+    assert(!ds_tls->root_tls || ds_tls->root_tls == root_tls);
+    ds_tls->root_tls = root_tls;
+    return ds_tls;
+  }
+
+  // Static state. Accessed by the static Trace() method fastpaths.
+  static internal::DataSourceStaticState static_state_;
+
+  // This TLS object is a cached raw pointer and has deliberately no destructor.
+  // The Platform implementation is supposed to create and manage the lifetime
+  // of the Platform::ThreadLocalObject and take care of destroying it.
+  // This is because non-POD thread_local variables have subtleties (global
+  // destructors) that we need to defer to the embedder. In chromium's platform
+  // implementation, for instance, the tls slot is implemented using
+  // chromium's base::ThreadLocalStorage.
+  static PERFETTO_THREAD_LOCAL internal::DataSourceThreadLocalState* tls_state_;
+};
+
+// static
+template <typename T, typename D>
+internal::DataSourceStaticState DataSource<T, D>::static_state_;
+// static
+template <typename T, typename D>
+PERFETTO_THREAD_LOCAL internal::DataSourceThreadLocalState*
+    DataSource<T, D>::tls_state_;
+
+}  // namespace perfetto
+
+// If placed at the end of a macro declaration, eats the semicolon at the end of
+// the macro invocation (e.g., "MACRO(...);") to avoid warnings about extra
+// semicolons.
+#define PERFETTO_INTERNAL_SWALLOW_SEMICOLON() \
+  extern int perfetto_internal_unused
+
+// This macro must be used once for each data source next to the data source's
+// declaration.
+#define PERFETTO_DECLARE_DATA_SOURCE_STATIC_MEMBERS(...)              \
+  template <>                                                         \
+  PERFETTO_COMPONENT_EXPORT perfetto::internal::DataSourceStaticState \
+      perfetto::DataSource<__VA_ARGS__>::static_state_;               \
+  template <>                                                         \
+  PERFETTO_COMPONENT_EXPORT PERFETTO_THREAD_LOCAL                     \
+      perfetto::internal::DataSourceThreadLocalState*                 \
+          perfetto::DataSource<__VA_ARGS__>::tls_state_
+
+// MSVC has a bug where explicit template member specialization declarations
+// can't have thread_local as the storage class specifier. The generated code
+// seems correct without the specifier, so drop it until the bug gets fixed.
+// See https://developercommunity2.visualstudio.com/t/Unable-to-specialize-
+// static-thread_local/1302689.
+#if PERFETTO_BUILDFLAG(PERFETTO_COMPILER_MSVC)
+#define PERFETTO_TEMPLATE_THREAD_LOCAL
+#else
+#define PERFETTO_TEMPLATE_THREAD_LOCAL PERFETTO_THREAD_LOCAL
+#endif
+
+// This macro must be used once for each data source in one source file to
+// allocate static storage for the data source's static state.
+//
+// Note: if MSVC fails with a C2086 (redefinition) error here, use the
+// permissive- flag to enable standards-compliant mode. See
+// https://developercommunity.visualstudio.com/content/problem/319447/
+// explicit-specialization-of-static-data-member-inco.html.
+#define PERFETTO_DEFINE_DATA_SOURCE_STATIC_MEMBERS(...)               \
+  template <>                                                         \
+  PERFETTO_COMPONENT_EXPORT perfetto::internal::DataSourceStaticState \
+      perfetto::DataSource<__VA_ARGS__>::static_state_{};             \
+  template <>                                                         \
+  PERFETTO_COMPONENT_EXPORT PERFETTO_TEMPLATE_THREAD_LOCAL            \
+      perfetto::internal::DataSourceThreadLocalState*                 \
+          perfetto::DataSource<__VA_ARGS__>::tls_state_ = nullptr
+
+#endif  // INCLUDE_PERFETTO_TRACING_DATA_SOURCE_H_
+// gen_amalgamated begin header: include/perfetto/tracing/tracing.h
+// gen_amalgamated begin header: include/perfetto/tracing/backend_type.h
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_BACKEND_TYPE_H_
+#define INCLUDE_PERFETTO_TRACING_BACKEND_TYPE_H_
+
+#include <stdint.h>
+
+namespace perfetto {
+
+enum BackendType : uint32_t {
+  kUnspecifiedBackend = 0,
+
+  // Connects to a previously-initialized perfetto tracing backend for
+  // in-process. If the in-process backend has not been previously initialized
+  // it will do so and create the tracing service on a dedicated thread.
+  kInProcessBackend = 1 << 0,
+
+  // Connects to the system tracing service (e.g. on Linux/Android/Mac uses a
+  // named UNIX socket).
+  kSystemBackend = 1 << 1,
+
+  // Used to provide a custom IPC transport to connect to the service.
+  // TracingInitArgs::custom_backend must be non-null and point to an
+  // indefinitely lived instance.
+  kCustomBackend = 1 << 2,
+};
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_BACKEND_TYPE_H_
+// gen_amalgamated begin header: include/perfetto/tracing/internal/in_process_tracing_backend.h
+// gen_amalgamated begin header: include/perfetto/tracing/tracing_backend.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_TRACING_BACKEND_H_
+#define INCLUDE_PERFETTO_TRACING_TRACING_BACKEND_H_
+
+#include <memory>
+#include <string>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+// The embedder can (but doesn't have to) extend the TracingBackend class and
+// pass as an argument to Tracing::Initialize(kCustomBackend) to override the
+// way to reach the service. This is for peculiar cases where the embedder has
+// a multi-process architecture and wants to override the IPC transport. The
+// real use-case for this at the time of writing is chromium (+ Mojo IPC).
+// Extending this class requires depending on the full set of perfetto headers
+// (not just /public/). Contact the team before doing so as the non-public
+// headers are not guaranteed to be API stable.
+
+namespace perfetto {
+
+namespace base {
+class TaskRunner;
+}
+
+// These classes are declared in headers outside of /public/.
+class Consumer;
+class ConsumerEndpoint;
+class Producer;
+class ProducerEndpoint;
+
+class PERFETTO_EXPORT TracingBackend {
+ public:
+  virtual ~TracingBackend();
+
+  // Connects a Producer instance and obtains a ProducerEndpoint, which is
+  // essentially a 1:1 channel between one Producer and the Service.
+  // To disconnect just destroy the returned endpoint object. It is safe to
+  // destroy the Producer once Producer::OnDisconnect() has been invoked.
+  struct ConnectProducerArgs {
+    std::string producer_name;
+
+    // The Producer object that will receive calls like Start/StopDataSource().
+    // The caller has to guarantee that this object is valid as long as the
+    // returned ProducerEndpoint is alive.
+    Producer* producer = nullptr;
+
+    // The task runner where the Producer methods will be called onto.
+    // The caller has to guarantee that the passed TaskRunner is valid as long
+    // as the returned ProducerEndpoint is alive.
+    ::perfetto::base::TaskRunner* task_runner = nullptr;
+
+    // These get propagated from TracingInitArgs and are optionally provided by
+    // the client when calling Tracing::Initialize().
+    uint32_t shmem_size_hint_bytes = 0;
+    uint32_t shmem_page_size_hint_bytes = 0;
+  };
+
+  virtual std::unique_ptr<ProducerEndpoint> ConnectProducer(
+      const ConnectProducerArgs&) = 0;
+
+  // As above, for the Consumer-side.
+  struct ConnectConsumerArgs {
+    // The Consumer object that will receive calls like OnTracingDisabled(),
+    // OnTraceData().
+    Consumer* consumer{};
+
+    // The task runner where the Consumer methods will be called onto.
+    ::perfetto::base::TaskRunner* task_runner{};
+  };
+  virtual std::unique_ptr<ConsumerEndpoint> ConnectConsumer(
+      const ConnectConsumerArgs&) = 0;
+};
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_TRACING_BACKEND_H_
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_INTERNAL_IN_PROCESS_TRACING_BACKEND_H_
+#define INCLUDE_PERFETTO_TRACING_INTERNAL_IN_PROCESS_TRACING_BACKEND_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/tracing_backend.h"
+
+namespace perfetto {
+
+namespace base {
+class TaskRunner;
+}
+
+class Producer;
+class TracingService;
+
+namespace internal {
+
+// A built-in implementation of TracingBackend that creates a tracing service
+// instance in-process. Instantiated when the embedder calls
+// Tracing::Initialize(kInProcessBackend). Solves most in-app-only tracing
+// use-cases.
+class PERFETTO_EXPORT InProcessTracingBackend : public TracingBackend {
+ public:
+  static TracingBackend* GetInstance();
+
+  // TracingBackend implementation.
+  std::unique_ptr<ProducerEndpoint> ConnectProducer(
+      const ConnectProducerArgs&) override;
+  std::unique_ptr<ConsumerEndpoint> ConnectConsumer(
+      const ConnectConsumerArgs&) override;
+
+ private:
+  InProcessTracingBackend();
+  TracingService* GetOrCreateService(base::TaskRunner*);
+
+  std::unique_ptr<TracingService> service_;
+};
+
+}  // namespace internal
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_INTERNAL_IN_PROCESS_TRACING_BACKEND_H_
+// gen_amalgamated begin header: include/perfetto/tracing/internal/system_tracing_backend.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_INTERNAL_SYSTEM_TRACING_BACKEND_H_
+#define INCLUDE_PERFETTO_TRACING_INTERNAL_SYSTEM_TRACING_BACKEND_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/tracing_backend.h"
+
+namespace perfetto {
+
+namespace base {
+class TaskRunner;
+}
+
+class Producer;
+
+// A built-in implementation of TracingBackend that connects to the system
+// tracing daemon (traced) via a UNIX socket using the perfetto built-in
+// proto-based IPC mechanism. Instantiated when the embedder calls
+// Tracing::Initialize(kSystemBackend). It allows to get app-traces fused
+// together with system traces, useful to correlate on the timeline system
+// events (e.g. scheduling slices from the kernel) with in-app events.
+namespace internal {
+class PERFETTO_EXPORT SystemTracingBackend : public TracingBackend {
+ public:
+  static TracingBackend* GetInstance();
+
+  // TracingBackend implementation.
+  std::unique_ptr<ProducerEndpoint> ConnectProducer(
+      const ConnectProducerArgs&) override;
+  std::unique_ptr<ConsumerEndpoint> ConnectConsumer(
+      const ConnectConsumerArgs&) override;
+
+ private:
+  SystemTracingBackend();
+};
+
+}  // namespace internal
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_INTERNAL_SYSTEM_TRACING_BACKEND_H_
+// gen_amalgamated begin header: include/perfetto/tracing/tracing_policy.h
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_TRACING_POLICY_H_
+#define INCLUDE_PERFETTO_TRACING_TRACING_POLICY_H_
+
+#include <functional>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/backend_type.h"
+
+namespace perfetto {
+
+// Applies policy decisions, such as allowing or denying connections, when
+// certain tracing SDK events occur. All methods are called on an internal
+// perfetto thread.
+class PERFETTO_EXPORT TracingPolicy {
+ public:
+  virtual ~TracingPolicy();
+
+  // Called when the current process attempts to connect a new consumer to the
+  // backend of |backend_type| to check if the connection should be allowed. Its
+  // implementation should execute |result_callback| with the result of the
+  // check (synchronuosly or asynchronously on any thread). If the result is
+  // false, the consumer connection is aborted. Chrome uses this to restrict
+  // creating (system) tracing sessions based on an enterprise policy.
+  struct ShouldAllowConsumerSessionArgs {
+    BackendType backend_type;
+    std::function<void(bool /*allow*/)> result_callback;
+  };
+  virtual void ShouldAllowConsumerSession(
+      const ShouldAllowConsumerSessionArgs&) = 0;
+};
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_TRACING_POLICY_H_
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_TRACING_H_
+#define INCLUDE_PERFETTO_TRACING_TRACING_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include <functional>
+#include <memory>
+#include <string>
+#include <vector>
+
+// gen_amalgamated expanded: #include "perfetto/base/compiler.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/backend_type.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/forward_decls.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/in_process_tracing_backend.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/system_tracing_backend.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/tracing_policy.h"
+
+namespace perfetto {
+
+namespace internal {
+class TracingMuxerImpl;
+}
+
+class TracingBackend;
+class Platform;
+class TracingSession;  // Declared below.
+
+struct TracingError {
+  enum ErrorCode : uint32_t {
+    // Peer disconnection.
+    kDisconnected = 1,
+
+    // The Start() method failed. This is typically because errors in the passed
+    // TraceConfig. More details are available in |message|.
+    kTracingFailed = 2,
+  };
+
+  ErrorCode code;
+  std::string message;
+
+  TracingError(ErrorCode cd, std::string msg)
+      : code(cd), message(std::move(msg)) {
+    PERFETTO_CHECK(!message.empty());
+  }
+};
+
+using LogLev = ::perfetto::base::LogLev;
+using LogMessageCallbackArgs = ::perfetto::base::LogMessageCallbackArgs;
+using LogMessageCallback = ::perfetto::base::LogMessageCallback;
+
+struct TracingInitArgs {
+  uint32_t backends = 0;                     // One or more BackendTypes.
+  TracingBackend* custom_backend = nullptr;  // [Optional].
+
+  // [Optional] Platform implementation. It allows the embedder to take control
+  // of platform-specific bits like thread creation and TLS slot handling. If
+  // not set it will use Platform::GetDefaultPlatform().
+  Platform* platform = nullptr;
+
+  // [Optional] Tune the size of the shared memory buffer between the current
+  // process and the service backend(s). This is a trade-off between memory
+  // footprint and the ability to sustain bursts of trace writes (see comments
+  // in shared_memory_abi.h).
+  // If set, the value must be a multiple of 4KB. The value can be ignored if
+  // larger than kMaxShmSize (32MB) or not a multiple of 4KB.
+  uint32_t shmem_size_hint_kb = 0;
+
+  // [Optional] Specifies the preferred size of each page in the shmem buffer.
+  // This is a trade-off between IPC overhead and fragmentation/efficiency of
+  // the shmem buffer in presence of multiple writer threads.
+  // Must be one of [4, 8, 16, 32].
+  uint32_t shmem_page_size_hint_kb = 0;
+
+  // [Optional] The length of the period during which shared-memory-buffer
+  // chunks that have been filled with data are accumulated (batched) on the
+  // producer side, before the service is notified of them over an out-of-band
+  // IPC call. If, while this period lasts, the shared memory buffer gets too
+  // full, the IPC call will be sent immediately. The value of this parameter is
+  // a trade-off between IPC traffic overhead and the ability to sustain bursts
+  // of trace writes. The higher the value, the more chunks will be batched and
+  // the less buffer space will be available to hide the latency of the service,
+  // and vice versa. For more details, see the SetBatchCommitsDuration method in
+  // shared_memory_arbiter.h.
+  //
+  // Note: With the default value of 0ms, batching still happens but with a zero
+  // delay, i.e. commits will be sent to the service at the next opportunity.
+  uint32_t shmem_batch_commits_duration_ms = 0;
+
+  // [Optional] If set, the policy object is notified when certain SDK events
+  // occur and may apply policy decisions, such as denying connections. The
+  // embedder is responsible for ensuring the object remains alive for the
+  // lifetime of the process.
+  TracingPolicy* tracing_policy = nullptr;
+
+  // [Optional] If set, log messages generated by perfetto are passed to this
+  // callback instead of being logged directly.
+  LogMessageCallback log_message_callback = nullptr;
+
+ protected:
+  friend class Tracing;
+  friend class internal::TracingMuxerImpl;
+
+  // Used only by the DCHECK in tracing.cc, to check that the config is the
+  // same in case of re-initialization.
+  bool operator==(const TracingInitArgs& other) const {
+    return std::tie(backends, custom_backend, platform, shmem_size_hint_kb,
+                    shmem_page_size_hint_kb, in_process_backend_factory_,
+                    system_backend_factory_, dcheck_is_on_) ==
+           std::tie(other.backends, other.custom_backend, other.platform,
+                    other.shmem_size_hint_kb, other.shmem_page_size_hint_kb,
+                    other.in_process_backend_factory_,
+                    other.system_backend_factory_, other.dcheck_is_on_);
+  }
+
+  using BackendFactoryFunction = TracingBackend* (*)();
+  BackendFactoryFunction in_process_backend_factory_ = nullptr;
+  BackendFactoryFunction system_backend_factory_ = nullptr;
+  bool dcheck_is_on_ = PERFETTO_DCHECK_IS_ON();
+};
+
+// The entry-point for using perfetto.
+class PERFETTO_EXPORT Tracing {
+ public:
+  // Initializes Perfetto with the given backends in the calling process and/or
+  // with a user-provided backend. No-op if called more than once.
+  static inline void Initialize(const TracingInitArgs& args)
+      PERFETTO_ALWAYS_INLINE {
+    TracingInitArgs args_copy(args);
+    // This code is inlined to allow dead-code elimination for unused backends.
+    // This saves ~200 KB when not using the in-process backend (b/148198993).
+    // The logic behind it is the following:
+    // Nothing other than the code below references the two GetInstance()
+    // methods. From a linker-graph viewpoint, those GetInstance() pull in many
+    // other pieces of the codebase (e.g. InProcessTracingBackend pulls the
+    // whole TracingServiceImpl, SystemTracingBackend pulls the whole //ipc
+    // layer). Due to the inline, the compiler can see through the code and
+    // realize that some branches are always not taken. When that happens, no
+    // reference to the backends' GetInstance() is emitted and that allows the
+    // linker GC to get rid of the entire set of dependencies.
+    if (args.backends & kInProcessBackend) {
+      args_copy.in_process_backend_factory_ =
+          &internal::InProcessTracingBackend::GetInstance;
+    }
+    if (args.backends & kSystemBackend) {
+      args_copy.system_backend_factory_ =
+          &internal::SystemTracingBackend::GetInstance;
+    }
+    InitializeInternal(args_copy);
+  }
+
+  // Checks if tracing has been initialized by calling |Initialize|.
+  static bool IsInitialized();
+
+  // Start a new tracing session using the given tracing backend. Use
+  // |kUnspecifiedBackend| to select an available backend automatically.
+  // For the moment this can be used only when initializing tracing in
+  // kInProcess mode. For the system mode use the 'bin/perfetto' cmdline client.
+  static std::unique_ptr<TracingSession> NewTrace(
+      BackendType = kUnspecifiedBackend);
+
+ private:
+  static void InitializeInternal(const TracingInitArgs&);
+
+  Tracing() = delete;
+};
+
+class PERFETTO_EXPORT TracingSession {
+ public:
+  virtual ~TracingSession();
+
+  // Configure the session passing the trace config.
+  // If a writable file handle is given through |fd|, the trace will
+  // automatically written to that file. Otherwise you should call ReadTrace()
+  // to retrieve the trace data. This call does not take ownership of |fd|.
+  // TODO(primiano): add an error callback.
+  virtual void Setup(const TraceConfig&, int fd = -1) = 0;
+
+  // Enable tracing asynchronously. Use SetOnStartCallback() to get a
+  // notification when the session has fully started.
+  virtual void Start() = 0;
+
+  // Enable tracing and block until tracing has started. Note that if data
+  // sources are registered after this call was initiated, the call may return
+  // before the additional data sources have started. Also, if other producers
+  // (e.g., with system-wide tracing) have registered data sources without start
+  // notification support, this call may return before those data sources have
+  // started.
+  virtual void StartBlocking() = 0;
+
+  // This callback will be invoked when all data sources have acknowledged that
+  // tracing has started. This callback will be invoked on an internal perfetto
+  // thread.
+  virtual void SetOnStartCallback(std::function<void()>) = 0;
+
+  // This callback can be used to get a notification when some error occured
+  // (e.g., peer disconnection). Error type will be passed as an argument. This
+  // callback will be invoked on an internal perfetto thread.
+  virtual void SetOnErrorCallback(std::function<void(TracingError)>) = 0;
+
+  // Issues a flush request, asking all data sources to ack the request, within
+  // the specified timeout. A "flush" is a fence to ensure visibility of data in
+  // the async tracing pipeline. It guarantees that all data written before the
+  // Flush() call will be visible in the trace buffer and hence by the
+  // ReadTrace() / ReadTraceBlocking() methods.
+  // Args:
+  //  callback: will be invoked on an internal perfetto thread when all data
+  //    sources have acked, or the timeout is reached. The bool argument
+  //    will be true if all data sources acked within the timeout, false if
+  //    the timeout was hit or some other error occurred (e.g. the tracing
+  //    session wasn't started or ended).
+  //  timeout_ms: how much time the service will wait for data source acks. If
+  //    0, the global timeout specified in the TraceConfig (flush_timeout_ms)
+  //    will be used. If flush_timeout_ms is also unspecified, a default value
+  //    of 5s will be used.
+  // Known issues:
+  //    Because flushing is still based on service-side scraping, the very last
+  //    trace packet for each data source thread will not be visible. Fixing
+  //    this requires either propagating the Flush() to the data sources or
+  //    changing the order of atomic operations in the service (b/162206162).
+  //    Until then, a workaround is to make sure to call
+  //    DataSource::Trace([](TraceContext ctx) { ctx.Flush(); }) just before
+  //    stopping, on each thread where DataSource::Trace has been previously
+  //    called.
+  virtual void Flush(std::function<void(bool)>, uint32_t timeout_ms = 0) = 0;
+
+  // Blocking version of Flush(). Waits until all data sources have acked and
+  // returns the success/failure status.
+  bool FlushBlocking(uint32_t timeout_ms = 0);
+
+  // Disable tracing asynchronously.
+  // Use SetOnStopCallback() to get a notification when the tracing session is
+  // fully stopped and all data sources have acked.
+  virtual void Stop() = 0;
+
+  // Disable tracing and block until tracing has stopped.
+  virtual void StopBlocking() = 0;
+
+  // This callback will be invoked when tracing is disabled.
+  // This can happen either when explicitly calling TracingSession.Stop() or
+  // when the trace reaches its |duration_ms| time limit.
+  // This callback will be invoked on an internal perfetto thread.
+  virtual void SetOnStopCallback(std::function<void()>) = 0;
+
+  // Changes the TraceConfig for an active tracing session. The session must
+  // have been configured and started before. Note that the tracing service
+  // only supports changing a subset of TraceConfig fields,
+  // see ConsumerEndpoint::ChangeTraceConfig().
+  virtual void ChangeTraceConfig(const TraceConfig&) = 0;
+
+  // Struct passed as argument to the callback passed to ReadTrace().
+  // [data, size] is guaranteed to contain 1 or more full trace packets, which
+  // can be decoded using trace.proto. No partial or truncated packets are
+  // exposed. If the trace is empty this returns a zero-sized nullptr with
+  // |has_more| == true to signal EOF.
+  // This callback will be invoked on an internal perfetto thread.
+  struct ReadTraceCallbackArgs {
+    const char* data = nullptr;
+    size_t size = 0;
+
+    // When false, this will be the last invocation of the callback for this
+    // read cycle.
+    bool has_more = false;
+  };
+
+  // Reads back the trace data (raw protobuf-encoded bytes) asynchronously.
+  // Can be called at any point during the trace, typically but not necessarily,
+  // after stopping. If this is called before the end of the trace (i.e. before
+  // Stop() / StopBlocking()), in almost all cases you need to call
+  // Flush() / FlushBlocking() before Read(). This is to guarantee that tracing
+  // data in-flight in the data sources is committed into the tracing buffers
+  // before reading them.
+  // Reading the trace data is a destructive operation w.r.t. contents of the
+  // trace buffer and is not idempotent.
+  // A single ReadTrace() call can yield >1 callback invocations, until
+  // |has_more| is false.
+  using ReadTraceCallback = std::function<void(ReadTraceCallbackArgs)>;
+  virtual void ReadTrace(ReadTraceCallback) = 0;
+
+  // Synchronous version of ReadTrace(). It blocks the calling thread until all
+  // the trace contents are read. This is slow and inefficient (involves more
+  // copies) and is mainly intended for testing.
+  std::vector<char> ReadTraceBlocking();
+
+  // Struct passed as an argument to the callback for GetTraceStats(). Contains
+  // statistics about the tracing session.
+  struct GetTraceStatsCallbackArgs {
+    // Whether or not querying statistics succeeded.
+    bool success = false;
+    // Serialized TraceStats protobuf message. To decode:
+    //
+    //   perfetto::protos::gen::TraceStats trace_stats;
+    //   trace_stats.ParseFromArray(args.trace_stats_data.data(),
+    //                              args.trace_stats_data.size());
+    //
+    std::vector<uint8_t> trace_stats_data;
+  };
+
+  // Requests a snapshot of statistical data for this tracing session. Only one
+  // query may be active at a time. This callback will be invoked on an internal
+  // perfetto thread.
+  using GetTraceStatsCallback = std::function<void(GetTraceStatsCallbackArgs)>;
+  virtual void GetTraceStats(GetTraceStatsCallback) = 0;
+
+  // Synchronous version of GetTraceStats() for convenience.
+  GetTraceStatsCallbackArgs GetTraceStatsBlocking();
+
+  // Struct passed as an argument to the callback for QueryServiceState().
+  // Contains information about registered data sources.
+  struct QueryServiceStateCallbackArgs {
+    // Whether or not getting the service state succeeded.
+    bool success = false;
+    // Serialized TracingServiceState protobuf message. To decode:
+    //
+    //   perfetto::protos::gen::TracingServiceState state;
+    //   state.ParseFromArray(args.service_state_data.data(),
+    //                        args.service_state_data.size());
+    //
+    std::vector<uint8_t> service_state_data;
+  };
+
+  // Requests a snapshot of the tracing service state for this session. Only one
+  // request per session may be active at a time. This callback will be invoked
+  // on an internal perfetto thread.
+  using QueryServiceStateCallback =
+      std::function<void(QueryServiceStateCallbackArgs)>;
+  virtual void QueryServiceState(QueryServiceStateCallback) = 0;
+
+  // Synchronous version of QueryServiceState() for convenience.
+  QueryServiceStateCallbackArgs QueryServiceStateBlocking();
+};
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_TRACING_H_
+// gen_amalgamated begin header: include/perfetto/tracing/track_event.h
+// gen_amalgamated begin header: include/perfetto/base/time.h
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_BASE_TIME_H_
+#define INCLUDE_PERFETTO_BASE_TIME_H_
+
+#include <time.h>
+
+#include <chrono>
+#include <string>
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+#include <mach/mach_init.h>
+#include <mach/mach_port.h>
+#include <mach/mach_time.h>
+#include <mach/thread_act.h>
+#endif
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WASM)
+#include <emscripten/emscripten.h>
+#endif
+
+namespace perfetto {
+namespace base {
+
+using TimeSeconds = std::chrono::seconds;
+using TimeMillis = std::chrono::milliseconds;
+using TimeNanos = std::chrono::nanoseconds;
+
+inline TimeNanos FromPosixTimespec(const struct timespec& ts) {
+  return TimeNanos(ts.tv_sec * 1000000000LL + ts.tv_nsec);
+}
+
+void SleepMicroseconds(unsigned interval_us);
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+
+TimeNanos GetWallTimeNs();
+TimeNanos GetThreadCPUTimeNs();
+
+// TODO: Clock that counts time during suspend is not implemented on Windows.
+inline TimeNanos GetBootTimeNs() {
+  return GetWallTimeNs();
+}
+
+#elif PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+
+inline TimeNanos GetWallTimeNs() {
+  auto init_time_factor = []() -> uint64_t {
+    mach_timebase_info_data_t timebase_info;
+    mach_timebase_info(&timebase_info);
+    return timebase_info.numer / timebase_info.denom;
+  };
+
+  static uint64_t monotonic_timebase_factor = init_time_factor();
+  return TimeNanos(mach_absolute_time() * monotonic_timebase_factor);
+}
+
+// TODO: Clock that counts time during suspend is not implemented on Mac.
+inline TimeNanos GetBootTimeNs() {
+  return GetWallTimeNs();
+}
+
+inline TimeNanos GetThreadCPUTimeNs() {
+  mach_port_t this_thread = mach_thread_self();
+  mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT;
+  thread_basic_info_data_t info{};
+  kern_return_t kr =
+      thread_info(this_thread, THREAD_BASIC_INFO,
+                  reinterpret_cast<thread_info_t>(&info), &count);
+  mach_port_deallocate(mach_task_self(), this_thread);
+
+  if (kr != KERN_SUCCESS) {
+    PERFETTO_DFATAL("Failed to get CPU time.");
+    return TimeNanos(0);
+  }
+  return TimeNanos(info.user_time.seconds * 1000000000LL +
+                   info.user_time.microseconds * 1000LL +
+                   info.system_time.seconds * 1000000000LL +
+                   info.system_time.microseconds * 1000LL);
+}
+
+#elif PERFETTO_BUILDFLAG(PERFETTO_OS_WASM)
+
+inline TimeNanos GetWallTimeNs() {
+  return TimeNanos(static_cast<uint64_t>(emscripten_get_now()) * 1000000);
+}
+
+inline TimeNanos GetThreadCPUTimeNs() {
+  return TimeNanos(0);
+}
+
+// TODO: Clock that counts time during suspend is not implemented on WASM.
+inline TimeNanos GetBootTimeNs() {
+  return GetWallTimeNs();
+}
+
+#elif PERFETTO_BUILDFLAG(PERFETTO_OS_NACL)
+
+// Tracing time doesn't need to work on NaCl since its going away shortly. We
+// just need to compile on it. The only function NaCl could support is
+// GetWallTimeNs(), but to prevent false hope we leave it unimplemented.
+
+inline TimeNanos GetWallTimeNs() {
+  return TimeNanos(0);
+}
+
+inline TimeNanos GetThreadCPUTimeNs() {
+  return TimeNanos(0);
+}
+
+inline TimeNanos GetBootTimeNs() {
+  return TimeNanos(0);
+}
+
+#else  // posix
+
+constexpr clockid_t kWallTimeClockSource = CLOCK_MONOTONIC;
+
+inline TimeNanos GetTimeInternalNs(clockid_t clk_id) {
+  struct timespec ts = {};
+  PERFETTO_CHECK(clock_gettime(clk_id, &ts) == 0);
+  return FromPosixTimespec(ts);
+}
+
+// Return ns from boot. Conversely to GetWallTimeNs, this clock counts also time
+// during suspend (when supported).
+inline TimeNanos GetBootTimeNs() {
+  // Determine if CLOCK_BOOTTIME is available on the first call.
+  static const clockid_t kBootTimeClockSource = [] {
+    struct timespec ts = {};
+    int res = clock_gettime(CLOCK_BOOTTIME, &ts);
+    return res == 0 ? CLOCK_BOOTTIME : kWallTimeClockSource;
+  }();
+  return GetTimeInternalNs(kBootTimeClockSource);
+}
+
+inline TimeNanos GetWallTimeNs() {
+  return GetTimeInternalNs(kWallTimeClockSource);
+}
+
+inline TimeNanos GetThreadCPUTimeNs() {
+  return GetTimeInternalNs(CLOCK_THREAD_CPUTIME_ID);
+}
+#endif
+
+inline TimeSeconds GetBootTimeS() {
+  return std::chrono::duration_cast<TimeSeconds>(GetBootTimeNs());
+}
+
+inline TimeMillis GetWallTimeMs() {
+  return std::chrono::duration_cast<TimeMillis>(GetWallTimeNs());
+}
+
+inline TimeSeconds GetWallTimeS() {
+  return std::chrono::duration_cast<TimeSeconds>(GetWallTimeNs());
+}
+
+inline struct timespec ToPosixTimespec(TimeMillis time) {
+  struct timespec ts {};
+  const long time_s = static_cast<long>(time.count() / 1000);
+  ts.tv_sec = time_s;
+  ts.tv_nsec = (static_cast<long>(time.count()) - time_s * 1000L) * 1000000L;
+  return ts;
+}
+
+std::string GetTimeFmt(const std::string& fmt);
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_BASE_TIME_H_
+// gen_amalgamated begin header: include/perfetto/tracing/internal/track_event_data_source.h
+// gen_amalgamated begin header: include/perfetto/base/template_util.h
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_BASE_TEMPLATE_UTIL_H_
+#define INCLUDE_PERFETTO_BASE_TEMPLATE_UTIL_H_
+
+#include <cstddef>
+#include <type_traits>
+
+namespace perfetto {
+namespace base {
+
+// Helper to express preferences in an overload set. If more than one overload
+// is available for a given set of parameters the overload with the higher
+// priority will be chosen.
+template <size_t I>
+struct priority_tag : priority_tag<I - 1> {};
+
+template <>
+struct priority_tag<0> {};
+
+// enable_if_t is an implementation of std::enable_if_t from C++14.
+//
+// Specification:
+// https://en.cppreference.com/w/cpp/types/enable_if
+template <bool B, class T = void>
+using enable_if_t = typename std::enable_if<B, T>::type;
+
+// decay_t is an implementation of std::decay_t from C++14.
+//
+// Specification:
+// https://en.cppreference.com/w/cpp/types/decay
+template <class T>
+using decay_t = typename std::decay<T>::type;
+
+// remove_cvref is an implementation of std::remove_cvref from
+// C++20.
+//
+// Specification:
+// https://en.cppreference.com/w/cpp/types/remove_cvref
+
+template <class T>
+struct remove_cvref {
+  using type = typename std::remove_cv<typename std::remove_cv<
+      typename std::remove_reference<T>::type>::type>::type;
+};
+template <class T>
+using remove_cvref_t = typename remove_cvref<T>::type;
+
+// Check if a given type is a specialization of a given template:
+// is_specialization<T, std::vector>::value.
+
+template <typename Type, template <typename...> class Template>
+struct is_specialization : std::false_type {};
+
+template <template <typename...> class Ref, typename... Args>
+struct is_specialization<Ref<Args...>, Ref> : std::true_type {};
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_BASE_TEMPLATE_UTIL_H_
+// gen_amalgamated begin header: include/perfetto/tracing/event_context.h
+// gen_amalgamated begin header: include/perfetto/tracing/internal/track_event_internal.h
+// gen_amalgamated begin header: include/perfetto/base/flat_set.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_BASE_FLAT_SET_H_
+#define INCLUDE_PERFETTO_BASE_FLAT_SET_H_
+
+#include <algorithm>
+#include <vector>
+
+// A vector-based set::set-like container.
+// It's more cache friendly than std::*set and performs for cases where:
+// 1. A high number of dupes is expected (e.g. pid tracking in ftrace).
+// 2. The working set is small (hundreds of elements).
+
+// Performance characteristics (for uniformly random insertion order):
+// - For smaller insertions (up to ~500), it outperforms both std::set<int> and
+//   std::unordered_set<int> by ~3x.
+// - Up until 4k insertions, it is always faster than std::set<int>.
+// - unordered_set<int> is faster with more than 2k insertions.
+// - unordered_set, however, it's less memory efficient and has more caveats
+//   (see chromium's base/containers/README.md).
+//
+// See flat_set_benchmark.cc and the charts in go/perfetto-int-set-benchmark.
+
+namespace perfetto {
+namespace base {
+
+template <typename T>
+class FlatSet {
+ public:
+  using value_type = T;
+  using const_pointer = const T*;
+  using iterator = typename std::vector<T>::iterator;
+  using const_iterator = typename std::vector<T>::const_iterator;
+
+  FlatSet() = default;
+
+  // Mainly for tests. Deliberately not marked as "explicit".
+  FlatSet(std::initializer_list<T> initial) : entries_(initial) {
+    std::sort(entries_.begin(), entries_.end());
+    entries_.erase(std::unique(entries_.begin(), entries_.end()),
+                   entries_.end());
+  }
+
+  const_iterator find(T value) const {
+    auto entries_end = entries_.end();
+    auto it = std::lower_bound(entries_.begin(), entries_end, value);
+    return (it != entries_end && *it == value) ? it : entries_end;
+  }
+
+  size_t count(T value) const { return find(value) == entries_.end() ? 0 : 1; }
+
+  std::pair<iterator, bool> insert(T value) {
+    auto entries_end = entries_.end();
+    auto it = std::lower_bound(entries_.begin(), entries_end, value);
+    if (it != entries_end && *it == value)
+      return std::make_pair(it, false);
+    // If the value is not found |it| is either end() or the next item strictly
+    // greater than |value|. In both cases we want to insert just before that.
+    it = entries_.insert(it, std::move(value));
+    return std::make_pair(it, true);
+  }
+
+  size_t erase(T value) {
+    auto it = find(value);
+    if (it == entries_.end())
+      return 0;
+    entries_.erase(it);
+    return 1;
+  }
+
+  void clear() { entries_.clear(); }
+
+  bool empty() const { return entries_.empty(); }
+  void reserve(size_t n) { entries_.reserve(n); }
+  size_t size() const { return entries_.size(); }
+  const_iterator begin() const { return entries_.begin(); }
+  const_iterator end() const { return entries_.end(); }
+
+ private:
+  std::vector<T> entries_;
+};
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_BASE_FLAT_SET_H_
+// gen_amalgamated begin header: include/perfetto/protozero/scattered_heap_buffer.h
+// gen_amalgamated begin header: include/perfetto/protozero/root_message.h
+// gen_amalgamated begin header: include/perfetto/protozero/message_arena.h
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_MESSAGE_ARENA_H_
+#define INCLUDE_PERFETTO_PROTOZERO_MESSAGE_ARENA_H_
+
+#include <stdint.h>
+
+#include <list>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+
+namespace protozero {
+
+class Message;
+
+// Object allocator for fixed-sized protozero::Message objects.
+// It's a simple bump-pointer allocator which leverages the stack-alike
+// usage pattern of protozero nested messages. It avoids hitting the system
+// allocator in most cases, by reusing the same block, and falls back on
+// allocating new blocks only when using deeply nested messages (which are
+// extremely rare).
+// This is used by RootMessage<T> to handle the storage for root-level messages.
+class PERFETTO_EXPORT MessageArena {
+ public:
+  MessageArena();
+  ~MessageArena();
+
+  // Strictly no copies or moves as this is used to hand out pointers.
+  MessageArena(const MessageArena&) = delete;
+  MessageArena& operator=(const MessageArena&) = delete;
+  MessageArena(MessageArena&&) = delete;
+  MessageArena& operator=(MessageArena&&) = delete;
+
+  // Allocates a new Message object.
+  Message* NewMessage();
+
+  // Deletes the last message allocated. The |msg| argument is used only for
+  // DCHECKs, it MUST be the pointer obtained by the last NewMessage() call.
+  void DeleteLastMessage(Message* msg) {
+    PERFETTO_DCHECK(!blocks_.empty() && blocks_.back().entries > 0);
+    PERFETTO_DCHECK(&blocks_.back().storage[blocks_.back().entries - 1] ==
+                    static_cast<void*>(msg));
+    DeleteLastMessageInternal();
+  }
+
+  // Resets the state of the arena, clearing up all but one block. This is used
+  // to avoid leaking outstanding unfinished sub-messages while recycling the
+  // RootMessage object (this is extremely rare due to the RAII scoped handles
+  // but could happen if some client does some overly clever std::move() trick).
+  void Reset() {
+    PERFETTO_DCHECK(!blocks_.empty());
+    blocks_.resize(1);
+    auto& block = blocks_.back();
+    block.entries = 0;
+    PERFETTO_ASAN_POISON(block.storage, sizeof(block.storage));
+  }
+
+ private:
+  void DeleteLastMessageInternal();
+
+  struct Block {
+    static constexpr size_t kCapacity = 16;
+
+    Block() { PERFETTO_ASAN_POISON(storage, sizeof(storage)); }
+
+    std::aligned_storage<sizeof(Message), alignof(Message)>::type
+        storage[kCapacity];
+    uint32_t entries = 0;  // # Message entries used (<= kCapacity).
+  };
+
+  // blocks are used to hand out pointers and must not be moved. Hence why
+  // std::list rather than std::vector.
+  std::list<Block> blocks_;
+};
+
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_MESSAGE_ARENA_H_
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_ROOT_MESSAGE_H_
+#define INCLUDE_PERFETTO_PROTOZERO_ROOT_MESSAGE_H_
+
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message_arena.h"
+
+namespace protozero {
+
+// Helper class to hand out messages using the default MessageArena.
+// Usage:
+// RootMessage<perfetto::protos::zero::MyMessage> msg;
+// msg.Reset(stream_writer);
+// msg.set_foo(...);
+// auto* nested = msg.set_nested();
+template <typename T = Message>
+class RootMessage : public T {
+ public:
+  RootMessage() { T::Reset(nullptr, &root_arena_); }
+
+  // Disallow copy and move.
+  RootMessage(const RootMessage&) = delete;
+  RootMessage& operator=(const RootMessage&) = delete;
+  RootMessage(RootMessage&&) = delete;
+  RootMessage& operator=(RootMessage&&) = delete;
+
+  void Reset(ScatteredStreamWriter* writer) {
+    root_arena_.Reset();
+    Message::Reset(writer, &root_arena_);
+  }
+
+ private:
+  MessageArena root_arena_;
+};
+
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_ROOT_MESSAGE_H_
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_SCATTERED_HEAP_BUFFER_H_
+#define INCLUDE_PERFETTO_PROTOZERO_SCATTERED_HEAP_BUFFER_H_
+
+#include <memory>
+#include <string>
+#include <vector>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/root_message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_stream_writer.h"
+
+namespace protozero {
+
+class Message;
+
+class PERFETTO_EXPORT ScatteredHeapBuffer
+    : public protozero::ScatteredStreamWriter::Delegate {
+ public:
+  class PERFETTO_EXPORT Slice {
+   public:
+    Slice();
+    explicit Slice(size_t size);
+    Slice(Slice&& slice) noexcept;
+    ~Slice();
+    Slice& operator=(Slice&&);
+
+    inline protozero::ContiguousMemoryRange GetTotalRange() const {
+      return {buffer_.get(), buffer_.get() + size_};
+    }
+
+    inline protozero::ContiguousMemoryRange GetUsedRange() const {
+      return {buffer_.get(), buffer_.get() + size_ - unused_bytes_};
+    }
+
+    uint8_t* start() const { return buffer_.get(); }
+    size_t size() const { return size_; }
+    size_t unused_bytes() const { return unused_bytes_; }
+    void set_unused_bytes(size_t unused_bytes) {
+      PERFETTO_DCHECK(unused_bytes_ <= size_);
+      unused_bytes_ = unused_bytes;
+    }
+
+    void Clear();
+
+   private:
+    std::unique_ptr<uint8_t[]> buffer_;
+    size_t size_;
+    size_t unused_bytes_;
+  };
+
+  ScatteredHeapBuffer(size_t initial_slice_size_bytes = 128,
+                      size_t maximum_slice_size_bytes = 128 * 1024);
+  ~ScatteredHeapBuffer() override;
+
+  // protozero::ScatteredStreamWriter::Delegate implementation.
+  protozero::ContiguousMemoryRange GetNewBuffer() override;
+
+  // Return the slices backing this buffer, adjusted for the number of bytes the
+  // writer has written.
+  const std::vector<Slice>& GetSlices();
+
+  // Stitch all the slices into a single contiguous buffer.
+  std::vector<uint8_t> StitchSlices();
+
+  // Note that the returned ranges point back to this buffer and thus cannot
+  // outlive it.
+  std::vector<protozero::ContiguousMemoryRange> GetRanges();
+
+  // Note that size of the last slice isn't updated to reflect the number of
+  // bytes written by the trace writer.
+  const std::vector<Slice>& slices() const { return slices_; }
+
+  void set_writer(protozero::ScatteredStreamWriter* writer) {
+    writer_ = writer;
+  }
+
+  // Update unused_bytes() of the current |Slice| based on the writer's state.
+  void AdjustUsedSizeOfCurrentSlice();
+
+  // Returns the total size the slices occupy in heap memory (including unused).
+  size_t GetTotalSize();
+
+  // Reset the contents of this buffer but retain one slice allocation (if it
+  // exists) to be reused for future writes.
+  void Reset();
+
+ private:
+  size_t next_slice_size_;
+  const size_t maximum_slice_size_;
+  protozero::ScatteredStreamWriter* writer_ = nullptr;
+  std::vector<Slice> slices_;
+
+  // Used to keep an allocated slice around after this buffer is reset.
+  Slice cached_slice_;
+};
+
+// Helper function to create heap-based protozero messages in one line.
+// Useful when manually serializing a protozero message (primarily in
+// tests/utilities). So instead of the following:
+//   protozero::MyMessage msg;
+//   protozero::ScatteredHeapBuffer shb;
+//   protozero::ScatteredStreamWriter writer(&shb);
+//   shb.set_writer(&writer);
+//   msg.Reset(&writer);
+//   ...
+// You can write:
+//   protozero::HeapBuffered<protozero::MyMessage> msg;
+//   msg->set_stuff(...);
+//   msg.SerializeAsString();
+template <typename T = ::protozero::Message>
+class HeapBuffered {
+ public:
+  HeapBuffered() : HeapBuffered(4096, 4096) {}
+  HeapBuffered(size_t initial_slice_size_bytes, size_t maximum_slice_size_bytes)
+      : shb_(initial_slice_size_bytes, maximum_slice_size_bytes),
+        writer_(&shb_) {
+    shb_.set_writer(&writer_);
+    msg_.Reset(&writer_);
+  }
+
+  // This can't be neither copied nor moved because Message hands out pointers
+  // to itself when creating submessages.
+  HeapBuffered(const HeapBuffered&) = delete;
+  HeapBuffered& operator=(const HeapBuffered&) = delete;
+  HeapBuffered(HeapBuffered&&) = delete;
+  HeapBuffered& operator=(HeapBuffered&&) = delete;
+
+  T* get() { return &msg_; }
+  T* operator->() { return &msg_; }
+
+  bool empty() const { return shb_.slices().empty(); }
+
+  std::vector<uint8_t> SerializeAsArray() {
+    msg_.Finalize();
+    return shb_.StitchSlices();
+  }
+
+  std::string SerializeAsString() {
+    auto vec = SerializeAsArray();
+    return std::string(reinterpret_cast<const char*>(vec.data()), vec.size());
+  }
+
+  std::vector<protozero::ContiguousMemoryRange> GetRanges() {
+    msg_.Finalize();
+    return shb_.GetRanges();
+  }
+
+  const std::vector<ScatteredHeapBuffer::Slice>& GetSlices() {
+    msg_.Finalize();
+    return shb_.GetSlices();
+  }
+
+  void Reset() {
+    shb_.Reset();
+    writer_.Reset(protozero::ContiguousMemoryRange{});
+    msg_.Reset(&writer_);
+    PERFETTO_DCHECK(empty());
+  }
+
+ private:
+  ScatteredHeapBuffer shb_;
+  ScatteredStreamWriter writer_;
+  RootMessage<T> msg_;
+};
+
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_SCATTERED_HEAP_BUFFER_H_
+// gen_amalgamated begin header: include/perfetto/tracing/debug_annotation.h
+// gen_amalgamated begin header: include/perfetto/tracing/traced_value_forward.h
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_TRACED_VALUE_FORWARD_H_
+#define INCLUDE_PERFETTO_TRACING_TRACED_VALUE_FORWARD_H_
+
+namespace perfetto {
+
+class TracedValue;
+class TracedArray;
+class TracedDictionary;
+
+template <typename T>
+void WriteIntoTracedValue(TracedValue context, T&& value);
+
+template <typename T, class = void>
+struct TraceFormatTraits;
+
+// Write support checker to allow it to be used when matching.
+//
+// Intended to be used for types like smart pointers, who should support
+// AsTracedValueInto only iff their inner type supports being written into
+// a TracedValue.
+//
+// template <typename T>
+// class SmartPtr {
+//   ...
+//
+//   typename check_traced_value_support<T, void>::value
+//   AsTracedValueInto(perfetto::TracedValue context) const {
+//      WriteIntoTracedValue(std::move(context), *ptr_);
+//   }
+// };
+template <typename T, typename ResultType = void, class = void>
+struct check_traced_value_support;
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_TRACED_VALUE_FORWARD_H_
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/debug_annotation.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_DEBUG_ANNOTATION_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_DEBUG_ANNOTATION_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class DebugAnnotation;
+class DebugAnnotation_NestedValue;
+enum DebugAnnotation_NestedValue_NestedType : int32_t;
+
+enum DebugAnnotation_NestedValue_NestedType : int32_t {
+  DebugAnnotation_NestedValue_NestedType_UNSPECIFIED = 0,
+  DebugAnnotation_NestedValue_NestedType_DICT = 1,
+  DebugAnnotation_NestedValue_NestedType_ARRAY = 2,
+};
+
+const DebugAnnotation_NestedValue_NestedType DebugAnnotation_NestedValue_NestedType_MIN = DebugAnnotation_NestedValue_NestedType_UNSPECIFIED;
+const DebugAnnotation_NestedValue_NestedType DebugAnnotation_NestedValue_NestedType_MAX = DebugAnnotation_NestedValue_NestedType_ARRAY;
+
+class DebugAnnotationName_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  DebugAnnotationName_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit DebugAnnotationName_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit DebugAnnotationName_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_iid() const { return at<1>().valid(); }
+  uint64_t iid() const { return at<1>().as_uint64(); }
+  bool has_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars name() const { return at<2>().as_string(); }
+};
+
+class DebugAnnotationName : public ::protozero::Message {
+ public:
+  using Decoder = DebugAnnotationName_Decoder;
+  enum : int32_t {
+    kIidFieldNumber = 1,
+    kNameFieldNumber = 2,
+  };
+
+  using FieldMetadata_Iid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      DebugAnnotationName>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Iid kIid() { return {}; }
+  void set_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Iid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      DebugAnnotationName>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class DebugAnnotation_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/12, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  DebugAnnotation_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit DebugAnnotation_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit DebugAnnotation_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name_iid() const { return at<1>().valid(); }
+  uint64_t name_iid() const { return at<1>().as_uint64(); }
+  bool has_name() const { return at<10>().valid(); }
+  ::protozero::ConstChars name() const { return at<10>().as_string(); }
+  bool has_bool_value() const { return at<2>().valid(); }
+  bool bool_value() const { return at<2>().as_bool(); }
+  bool has_uint_value() const { return at<3>().valid(); }
+  uint64_t uint_value() const { return at<3>().as_uint64(); }
+  bool has_int_value() const { return at<4>().valid(); }
+  int64_t int_value() const { return at<4>().as_int64(); }
+  bool has_double_value() const { return at<5>().valid(); }
+  double double_value() const { return at<5>().as_double(); }
+  bool has_string_value() const { return at<6>().valid(); }
+  ::protozero::ConstChars string_value() const { return at<6>().as_string(); }
+  bool has_pointer_value() const { return at<7>().valid(); }
+  uint64_t pointer_value() const { return at<7>().as_uint64(); }
+  bool has_nested_value() const { return at<8>().valid(); }
+  ::protozero::ConstBytes nested_value() const { return at<8>().as_bytes(); }
+  bool has_legacy_json_value() const { return at<9>().valid(); }
+  ::protozero::ConstChars legacy_json_value() const { return at<9>().as_string(); }
+  bool has_dict_entries() const { return at<11>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> dict_entries() const { return GetRepeated<::protozero::ConstBytes>(11); }
+  bool has_array_values() const { return at<12>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> array_values() const { return GetRepeated<::protozero::ConstBytes>(12); }
+};
+
+class DebugAnnotation : public ::protozero::Message {
+ public:
+  using Decoder = DebugAnnotation_Decoder;
+  enum : int32_t {
+    kNameIidFieldNumber = 1,
+    kNameFieldNumber = 10,
+    kBoolValueFieldNumber = 2,
+    kUintValueFieldNumber = 3,
+    kIntValueFieldNumber = 4,
+    kDoubleValueFieldNumber = 5,
+    kStringValueFieldNumber = 6,
+    kPointerValueFieldNumber = 7,
+    kNestedValueFieldNumber = 8,
+    kLegacyJsonValueFieldNumber = 9,
+    kDictEntriesFieldNumber = 11,
+    kArrayValuesFieldNumber = 12,
+  };
+  using NestedValue = ::perfetto::protos::pbzero::DebugAnnotation_NestedValue;
+
+  using FieldMetadata_NameIid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      DebugAnnotation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NameIid kNameIid() { return {}; }
+  void set_name_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NameIid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      DebugAnnotation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BoolValue =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      DebugAnnotation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BoolValue kBoolValue() { return {}; }
+  void set_bool_value(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_BoolValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_UintValue =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      DebugAnnotation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UintValue kUintValue() { return {}; }
+  void set_uint_value(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_UintValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IntValue =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      DebugAnnotation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IntValue kIntValue() { return {}; }
+  void set_int_value(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IntValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DoubleValue =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kDouble,
+      double,
+      DebugAnnotation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DoubleValue kDoubleValue() { return {}; }
+  void set_double_value(double value) {
+    static constexpr uint32_t field_id = FieldMetadata_DoubleValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kDouble>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_StringValue =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      DebugAnnotation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StringValue kStringValue() { return {}; }
+  void set_string_value(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_StringValue::kFieldId, data, size);
+  }
+  void set_string_value(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_StringValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PointerValue =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      DebugAnnotation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PointerValue kPointerValue() { return {}; }
+  void set_pointer_value(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PointerValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NestedValue =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      DebugAnnotation_NestedValue,
+      DebugAnnotation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NestedValue kNestedValue() { return {}; }
+  template <typename T = DebugAnnotation_NestedValue> T* set_nested_value() {
+    return BeginNestedMessage<T>(8);
+  }
+
+
+  using FieldMetadata_LegacyJsonValue =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      DebugAnnotation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LegacyJsonValue kLegacyJsonValue() { return {}; }
+  void set_legacy_json_value(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_LegacyJsonValue::kFieldId, data, size);
+  }
+  void set_legacy_json_value(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_LegacyJsonValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DictEntries =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      DebugAnnotation,
+      DebugAnnotation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DictEntries kDictEntries() { return {}; }
+  template <typename T = DebugAnnotation> T* add_dict_entries() {
+    return BeginNestedMessage<T>(11);
+  }
+
+
+  using FieldMetadata_ArrayValues =
+    ::protozero::proto_utils::FieldMetadata<
+      12,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      DebugAnnotation,
+      DebugAnnotation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ArrayValues kArrayValues() { return {}; }
+  template <typename T = DebugAnnotation> T* add_array_values() {
+    return BeginNestedMessage<T>(12);
+  }
+
+};
+
+class DebugAnnotation_NestedValue_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  DebugAnnotation_NestedValue_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit DebugAnnotation_NestedValue_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit DebugAnnotation_NestedValue_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_nested_type() const { return at<1>().valid(); }
+  int32_t nested_type() const { return at<1>().as_int32(); }
+  bool has_dict_keys() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> dict_keys() const { return GetRepeated<::protozero::ConstChars>(2); }
+  bool has_dict_values() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> dict_values() const { return GetRepeated<::protozero::ConstBytes>(3); }
+  bool has_array_values() const { return at<4>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> array_values() const { return GetRepeated<::protozero::ConstBytes>(4); }
+  bool has_int_value() const { return at<5>().valid(); }
+  int64_t int_value() const { return at<5>().as_int64(); }
+  bool has_double_value() const { return at<6>().valid(); }
+  double double_value() const { return at<6>().as_double(); }
+  bool has_bool_value() const { return at<7>().valid(); }
+  bool bool_value() const { return at<7>().as_bool(); }
+  bool has_string_value() const { return at<8>().valid(); }
+  ::protozero::ConstChars string_value() const { return at<8>().as_string(); }
+};
+
+class DebugAnnotation_NestedValue : public ::protozero::Message {
+ public:
+  using Decoder = DebugAnnotation_NestedValue_Decoder;
+  enum : int32_t {
+    kNestedTypeFieldNumber = 1,
+    kDictKeysFieldNumber = 2,
+    kDictValuesFieldNumber = 3,
+    kArrayValuesFieldNumber = 4,
+    kIntValueFieldNumber = 5,
+    kDoubleValueFieldNumber = 6,
+    kBoolValueFieldNumber = 7,
+    kStringValueFieldNumber = 8,
+  };
+  using NestedType = ::perfetto::protos::pbzero::DebugAnnotation_NestedValue_NestedType;
+  static const NestedType UNSPECIFIED = DebugAnnotation_NestedValue_NestedType_UNSPECIFIED;
+  static const NestedType DICT = DebugAnnotation_NestedValue_NestedType_DICT;
+  static const NestedType ARRAY = DebugAnnotation_NestedValue_NestedType_ARRAY;
+
+  using FieldMetadata_NestedType =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::DebugAnnotation_NestedValue_NestedType,
+      DebugAnnotation_NestedValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NestedType kNestedType() { return {}; }
+  void set_nested_type(::perfetto::protos::pbzero::DebugAnnotation_NestedValue_NestedType value) {
+    static constexpr uint32_t field_id = FieldMetadata_NestedType::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DictKeys =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      DebugAnnotation_NestedValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DictKeys kDictKeys() { return {}; }
+  void add_dict_keys(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_DictKeys::kFieldId, data, size);
+  }
+  void add_dict_keys(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_DictKeys::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DictValues =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      DebugAnnotation_NestedValue,
+      DebugAnnotation_NestedValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DictValues kDictValues() { return {}; }
+  template <typename T = DebugAnnotation_NestedValue> T* add_dict_values() {
+    return BeginNestedMessage<T>(3);
+  }
+
+
+  using FieldMetadata_ArrayValues =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      DebugAnnotation_NestedValue,
+      DebugAnnotation_NestedValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ArrayValues kArrayValues() { return {}; }
+  template <typename T = DebugAnnotation_NestedValue> T* add_array_values() {
+    return BeginNestedMessage<T>(4);
+  }
+
+
+  using FieldMetadata_IntValue =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      DebugAnnotation_NestedValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IntValue kIntValue() { return {}; }
+  void set_int_value(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IntValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DoubleValue =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kDouble,
+      double,
+      DebugAnnotation_NestedValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DoubleValue kDoubleValue() { return {}; }
+  void set_double_value(double value) {
+    static constexpr uint32_t field_id = FieldMetadata_DoubleValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kDouble>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BoolValue =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      DebugAnnotation_NestedValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BoolValue kBoolValue() { return {}; }
+  void set_bool_value(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_BoolValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_StringValue =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      DebugAnnotation_NestedValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StringValue kStringValue() { return {}; }
+  void set_string_value(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_StringValue::kFieldId, data, size);
+  }
+  void set_string_value(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_StringValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_DEBUG_ANNOTATION_H_
+#define INCLUDE_PERFETTO_TRACING_DEBUG_ANNOTATION_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/traced_value_forward.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/debug_annotation.pbzero.h"
+
+#include <stdint.h>
+
+#include <memory>
+#include <string>
+
+namespace {
+// std::underlying_type can't be used with non-enum types, so we need this
+// indirection.
+template <typename T, bool = std::is_enum<T>::value>
+struct safe_underlying_type {
+  using type = typename std::underlying_type<T>::type;
+};
+
+template <typename T>
+struct safe_underlying_type<T, false> {
+  using type = T;
+};
+}  // namespace
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+class DebugAnnotation;
+}  // namespace pbzero
+}  // namespace protos
+
+// A base class for custom track event debug annotations.
+class PERFETTO_EXPORT DebugAnnotation {
+ public:
+  DebugAnnotation() = default;
+  virtual ~DebugAnnotation();
+
+  // Called to write the contents of the debug annotation into the trace.
+  virtual void Add(protos::pbzero::DebugAnnotation*) const = 0;
+
+  void WriteIntoTracedValue(TracedValue context) const;
+};
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_DEBUG_ANNOTATION_H_
+// gen_amalgamated begin header: include/perfetto/tracing/traced_value.h
+// gen_amalgamated begin header: include/perfetto/tracing/internal/checked_scope.h
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_INTERNAL_CHECKED_SCOPE_H_
+#define INCLUDE_PERFETTO_TRACING_INTERNAL_CHECKED_SCOPE_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+
+namespace perfetto {
+namespace internal {
+
+#if PERFETTO_DCHECK_IS_ON()
+
+// Checker to ensure that despite multiple scopes being present, only the active
+// one is being accessed. Rules:
+// - Only an active scope can create inner scopes. When this happens, it stops
+// being active and the inner scope becomes active instead.
+// - Only an active scope can be destroyed. When this happens, its parent scope
+// becomes active.
+class PERFETTO_EXPORT CheckedScope {
+ public:
+  explicit CheckedScope(CheckedScope* parent_scope);
+  ~CheckedScope();
+  CheckedScope(CheckedScope&&);
+  CheckedScope& operator=(CheckedScope&&);
+  CheckedScope(const CheckedScope&) = delete;
+  CheckedScope& operator=(const CheckedScope&) = delete;
+
+  void Reset();
+
+  CheckedScope* parent_scope() const { return parent_scope_; }
+  bool is_active() const { return is_active_; }
+
+ private:
+  void set_is_active(bool is_active) { is_active_ = is_active; }
+
+  bool is_active_ = true;
+  CheckedScope* parent_scope_;
+
+  bool deleted_ = false;
+};
+
+#else
+
+// Dummy for cases when DCHECK is not enabled. Methods are marked constexpr to
+// ensure that the compiler can inline and optimise them away.
+class CheckedScope {
+ public:
+  inline explicit CheckedScope(CheckedScope*) {}
+  inline ~CheckedScope() {}
+
+  inline void Reset() {}
+
+  inline CheckedScope* parent_scope() const { return nullptr; }
+  inline bool is_active() const { return true; }
+};
+
+#endif  // PERFETTO_DCHECK_IS_ON()
+
+}  // namespace internal
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_INTERNAL_CHECKED_SCOPE_H_
+// gen_amalgamated begin header: include/perfetto/tracing/string_helpers.h
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_STRING_HELPERS_H_
+#define INCLUDE_PERFETTO_TRACING_STRING_HELPERS_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+#include <cstddef>
+#include <string>
+
+namespace perfetto {
+
+// A wrapper for marking strings that can't be determined to be static at build
+// time, but are in fact static.
+class PERFETTO_EXPORT StaticString {
+ public:
+  // Implicit constructor for string literals.
+  template <size_t N>
+  constexpr StaticString(const char (&str)[N]) : value(str) {}
+
+  // Implicit constructor for null strings.
+  constexpr StaticString(std::nullptr_t) : value(nullptr) {}
+
+  constexpr explicit StaticString(const char* str) : value(str) {}
+
+  const char* value;
+};
+
+namespace internal {
+
+// Ensure that |string| is a static constant string.
+//
+// If you get a compiler failure here, you are most likely trying to use
+// TRACE_EVENT with a dynamic event name. There are two ways to fix this:
+//
+// 1) If the event name is actually dynamic (e.g., std::string), write it into
+//    the event manually:
+//
+//      TRACE_EVENT("category", nullptr, [&](perfetto::EventContext ctx) {
+//        ctx.event()->set_name(dynamic_name);
+//      });
+//
+// 2) If the name is static, but the pointer is computed at runtime, wrap it
+//    with perfetto::StaticString:
+//
+//      TRACE_EVENT("category", perfetto::StaticString{name});
+//
+//    DANGER: Using perfetto::StaticString with strings whose contents change
+//            dynamically can cause silent trace data corruption.
+//
+constexpr const char* GetStaticString(StaticString string) {
+  return string.value;
+}
+
+}  // namespace internal
+
+// A explicit wrapper for marking strings as dynamic to ensure that perfetto
+// doesn't try to cache the pointer value.
+class PERFETTO_EXPORT DynamicString {
+ public:
+  explicit DynamicString(const std::string& str)
+      : value(str.data()), length(str.length()) {}
+  explicit DynamicString(const char* str) : value(str), length(strlen(str)) {}
+  DynamicString(const char* str, size_t len) : value(str), length(len) {}
+
+  const char* value;
+  size_t length;
+};
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_STRING_HELPERS_H_
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_TRACED_VALUE_H_
+#define INCLUDE_PERFETTO_TRACING_TRACED_VALUE_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/compiler.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/base/template_util.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/checked_scope.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/string_helpers.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/traced_value_forward.h"
+
+#include <memory>
+#include <type_traits>
+#include <utility>
+
+namespace perfetto {
+
+namespace protos {
+namespace pbzero {
+class DebugAnnotation;
+}
+}  // namespace protos
+
+class DebugAnnotation;
+
+// These classes provide a JSON-inspired way to write structed data into traces.
+//
+// Each TracedValue can be consumed exactly once to write a value into a trace
+// using one of the Write* methods.
+//
+// Write* methods fall into two categories:
+// - Primitive types (int, string, bool, double, etc): they just write the
+//   provided value, consuming the TracedValue in the process.
+// - Complex types (arrays and dicts): they consume the TracedValue and
+//   return a corresponding scoped object (TracedArray or TracedDictionary).
+//   This scope then can be used to write multiple items into the container:
+//   TracedArray::AppendItem and TracedDictionary::AddItem return a new
+//   TracedValue which then can be used to write an element of the
+//   dictionary or array.
+//
+// To define how a custom class should be written into the trace, users should
+// define one of the two following functions:
+// - Foo::WriteIntoTrace(TracedValue) const
+//   (preferred for code which depends on perfetto directly)
+// - perfetto::TraceFormatTraits<T>::WriteIntoTrace(
+//       TracedValue, const T&);
+//   (should be used if T is defined in a library which doesn't know anything
+//   about tracing).
+//
+//
+// After definiting a conversion method, the object can be used directly as a
+// TRACE_EVENT argument:
+//
+// Foo foo;
+// TRACE_EVENT("cat", "Event", "arg", foo);
+//
+// Examples:
+//
+// TRACE_EVENT("cat", "event", "params", [&](perfetto::TracedValue context)
+// {
+//   auto dict = std::move(context).WriteDictionary();
+//   dict->Add("param1", param1);
+//   dict->Add("param2", param2);
+//   ...
+//   dict->Add("paramN", paramN);
+//
+//   {
+//     auto inner_array = dict->AddArray("inner");
+//     inner_array->Append(value1);
+//     inner_array->Append(value2);
+//   }
+// });
+//
+// template <typename T>
+// TraceFormatTraits<std::optional<T>>::WriteIntoTrace(
+//    TracedValue context, const std::optional<T>& value) {
+//  if (!value) {
+//    std::move(context).WritePointer(nullptr);
+//    return;
+//  }
+//  perfetto::WriteIntoTrace(std::move(context), *value);
+// }
+//
+// template <typename T>
+// TraceFormatTraits<std::vector<T>>::WriteIntoTrace(
+//    TracedValue context, const std::array<T>& value) {
+//  auto array = std::move(context).WriteArray();
+//  for (const auto& item: value) {
+//    array_scope.Append(item);
+//  }
+// }
+//
+// class Foo {
+//   void WriteIntoTrace(TracedValue context) const {
+//     auto dict = std::move(context).WriteDictionary();
+//     dict->Set("key", 42);
+//     dict->Set("foo", "bar");
+//     dict->Set("member", member_);
+//   }
+// }
+namespace internal {
+PERFETTO_EXPORT TracedValue
+CreateTracedValueFromProto(protos::pbzero::DebugAnnotation*);
+}
+
+class PERFETTO_EXPORT TracedValue {
+ public:
+  TracedValue(const TracedValue&) = delete;
+  TracedValue& operator=(const TracedValue&) = delete;
+  TracedValue& operator=(TracedValue&&) = delete;
+  TracedValue(TracedValue&&) = default;
+  ~TracedValue() = default;
+
+  // TracedValue represents a context into which a single value can be written
+  // (either by writing it directly for primitive types, or by creating a
+  // TracedArray or TracedDictionary for the complex types). This is enforced
+  // by allowing Write* methods to be called only on rvalue references.
+
+  void WriteInt64(int64_t value) &&;
+  void WriteUInt64(uint64_t value) &&;
+  void WriteDouble(double value) &&;
+  void WriteBoolean(bool value) &&;
+  void WriteString(const char*) &&;
+  void WriteString(const char*, size_t len) &&;
+  void WriteString(const std::string&) &&;
+  void WritePointer(const void* value) &&;
+
+  // Rules for writing nested dictionaries and arrays:
+  // - Only one scope (TracedArray, TracedDictionary or TracedValue) can be
+  // active at the same time. It's only allowed to call methods on the active
+  // scope.
+  // - When a scope creates a nested scope, the new scope becomes active.
+  // - When a scope is destroyed, it's parent scope becomes active again.
+  //
+  // Typically users will have to create a scope only at the beginning of a
+  // conversion function and this scope should be destroyed at the end of it.
+  // TracedArray::Append and TracedDictionary::Add create, write and complete
+  // inner scopes automatically.
+
+  // Scope which allows multiple values to be appended.
+  TracedArray WriteArray() && PERFETTO_WARN_UNUSED_RESULT;
+
+  // Scope which allows multiple key-value pairs to be added.
+  TracedDictionary WriteDictionary() && PERFETTO_WARN_UNUSED_RESULT;
+
+ private:
+  friend class TracedArray;
+  friend class TracedDictionary;
+  friend TracedValue internal::CreateTracedValueFromProto(
+      protos::pbzero::DebugAnnotation*);
+
+  static TracedValue CreateFromProto(protos::pbzero::DebugAnnotation*);
+
+  inline explicit TracedValue(protos::pbzero::DebugAnnotation* context,
+                              internal::CheckedScope* parent_scope)
+      : context_(context), checked_scope_(parent_scope) {}
+
+  // Temporary support for perfetto::DebugAnnotation C++ class before it's going
+  // to be replaced by TracedValue.
+  // TODO(altimin): Convert v8 to use TracedValue directly and delete it.
+  friend class DebugAnnotation;
+
+  protos::pbzero::DebugAnnotation* const context_ = nullptr;
+
+  internal::CheckedScope checked_scope_;
+};
+
+class PERFETTO_EXPORT TracedArray {
+ public:
+  TracedArray(const TracedArray&) = delete;
+  TracedArray& operator=(const TracedArray&) = delete;
+  TracedArray& operator=(TracedArray&&) = delete;
+  TracedArray(TracedArray&&) = default;
+  ~TracedArray() = default;
+
+  TracedValue AppendItem();
+
+  template <typename T>
+  void Append(T&& value) {
+    WriteIntoTracedValue(AppendItem(), std::forward<T>(value));
+  }
+
+  TracedDictionary AppendDictionary() PERFETTO_WARN_UNUSED_RESULT;
+  TracedArray AppendArray();
+
+ private:
+  friend class TracedValue;
+
+  inline explicit TracedArray(protos::pbzero::DebugAnnotation* context,
+                              internal::CheckedScope* parent_scope)
+      : context_(context), checked_scope_(parent_scope) {}
+
+  protos::pbzero::DebugAnnotation* context_;
+
+  internal::CheckedScope checked_scope_;
+};
+
+class PERFETTO_EXPORT TracedDictionary {
+ public:
+  TracedDictionary(const TracedDictionary&) = delete;
+  TracedDictionary& operator=(const TracedDictionary&) = delete;
+  TracedDictionary& operator=(TracedDictionary&&) = delete;
+  TracedDictionary(TracedDictionary&&) = default;
+  ~TracedDictionary() = default;
+
+  // There are two paths for writing dictionary keys: fast path for writing
+  // compile-time const, whose pointer is remains valid during the entire
+  // runtime of the program and the slow path for dynamic strings, which need to
+  // be copied.
+  // In the most common case, a string literal can be passed to `Add`/`AddItem`.
+  // In other cases, either StaticString or DynamicString declarations are
+  // needed.
+
+  TracedValue AddItem(StaticString key);
+  TracedValue AddItem(DynamicString key);
+
+  template <typename T>
+  void Add(StaticString key, T&& value) {
+    WriteIntoTracedValue(AddItem(key), std::forward<T>(value));
+  }
+
+  template <typename T>
+  void Add(DynamicString key, T&& value) {
+    WriteIntoTracedValue(AddItem(key), std::forward<T>(value));
+  }
+
+  TracedDictionary AddDictionary(StaticString key);
+  TracedDictionary AddDictionary(DynamicString key);
+  TracedArray AddArray(StaticString key);
+  TracedArray AddArray(DynamicString key);
+
+ private:
+  friend class TracedValue;
+
+  inline explicit TracedDictionary(protos::pbzero::DebugAnnotation* context,
+                                   internal::CheckedScope* parent_scope)
+      : context_(context), checked_scope_(parent_scope) {}
+
+  protos::pbzero::DebugAnnotation* context_;
+
+  internal::CheckedScope checked_scope_;
+};
+
+namespace internal {
+
+// SFINAE helpers for finding a right overload to convert a given class to
+// trace-friendly form, ordered from most to least preferred.
+
+constexpr int kMaxWriteImplPriority = 4;
+
+// If T has WriteIntoTracedValue member function, call it.
+template <typename T>
+decltype(std::declval<T>().WriteIntoTracedValue(std::declval<TracedValue>()),
+         void())
+WriteImpl(base::priority_tag<4>, TracedValue context, T&& value) {
+  value.WriteIntoTracedValue(std::move(context));
+}
+
+// If T has WriteIntoTrace member function, call it.
+template <typename T>
+decltype(std::declval<T>().WriteIntoTrace(std::declval<TracedValue>()), void())
+WriteImpl(base::priority_tag<4>, TracedValue context, T&& value) {
+  value.WriteIntoTrace(std::move(context));
+}
+
+// If perfetto::TraceFormatTraits<T>::WriteIntoTracedValue(TracedValue, const
+// T&) is available, use it.
+template <typename T>
+decltype(TraceFormatTraits<base::remove_cvref_t<T>>::WriteIntoTracedValue(
+             std::declval<TracedValue>(),
+             std::declval<T>()),
+         void())
+WriteImpl(base::priority_tag<3>, TracedValue context, T&& value) {
+  TraceFormatTraits<base::remove_cvref_t<T>>::WriteIntoTracedValue(
+      std::move(context), std::forward<T>(value));
+}
+
+// If perfetto::TraceFormatTraits<T>::WriteIntoTrace(TracedValue, const T&)
+// is available, use it.
+template <typename T>
+decltype(TraceFormatTraits<base::remove_cvref_t<T>>::WriteIntoTrace(
+             std::declval<TracedValue>(),
+             std::declval<T>()),
+         void())
+WriteImpl(base::priority_tag<3>, TracedValue context, T&& value) {
+  TraceFormatTraits<base::remove_cvref_t<T>>::WriteIntoTrace(
+      std::move(context), std::forward<T>(value));
+}
+
+// If T has operator(), which takes TracedValue, use it.
+// Very useful for lambda resolutions.
+template <typename T>
+decltype(std::declval<T>()(std::declval<TracedValue>()), void())
+WriteImpl(base::priority_tag<2>, TracedValue context, T&& value) {
+  std::forward<T>(value)(std::move(context));
+}
+
+// If T is a container and its elements have tracing support, use it.
+//
+// Note: a reference to T should be passed to std::begin, otherwise
+// for non-reference types const T& will be passed to std::begin, losing
+// support for non-const WriteIntoTracedValue methods.
+template <typename T>
+typename check_traced_value_support<
+    decltype(*std::begin(std::declval<T&>()))>::type
+WriteImpl(base::priority_tag<1>, TracedValue context, T&& value) {
+  auto array = std::move(context).WriteArray();
+  for (auto&& item : value) {
+    array.Append(item);
+  }
+}
+
+// std::underlying_type can't be used with non-enum types, so we need this
+// indirection.
+template <typename T, bool = std::is_enum<T>::value>
+struct safe_underlying_type {
+  using type = typename std::underlying_type<T>::type;
+};
+
+template <typename T>
+struct safe_underlying_type<T, false> {
+  using type = T;
+};
+
+template <typename T>
+struct is_incomplete_type {
+  static constexpr bool value = sizeof(T) != 0;
+};
+
+// sizeof is not available for const char[], but it's still not considered to be
+// an incomplete type for our purposes as the size can be determined at runtime
+// due to strings being null-terminated.
+template <>
+struct is_incomplete_type<const char[]> {
+  static constexpr bool value = true;
+};
+
+}  // namespace internal
+
+// Helper template to determine if a given type can be passed to
+// perfetto::WriteIntoTracedValue. These templates will fail to resolve if the
+// class does not have it support, so they are useful in SFINAE and in producing
+// helpful compiler results.
+template <typename T, class Result = void>
+using check_traced_value_support_t = decltype(
+    internal::WriteImpl(
+        std::declval<base::priority_tag<internal::kMaxWriteImplPriority>>(),
+        std::declval<TracedValue>(),
+        std::declval<T>()),
+    std::declval<Result>());
+
+// check_traced_value_support<T, V>::type is defined (and equal to V) iff T
+// supports being passed to WriteIntoTracedValue. See the comment in
+// traced_value_forward.h for more details.
+template <typename T, class Result>
+struct check_traced_value_support<T,
+                                  Result,
+                                  check_traced_value_support_t<T, Result>> {
+  static_assert(
+      internal::is_incomplete_type<T>::value,
+      "perfetto::TracedValue should not be used with incomplete types");
+
+  static constexpr bool value = true;
+  using type = Result;
+};
+
+namespace internal {
+
+// Helper class to check if a given type can be passed to
+// perfetto::WriteIntoTracedValue. This template will always resolve (with
+// |value| being set to either true or false depending on presence of the
+// support, so this macro is useful in the situation when you want to e.g. OR
+// the result with some other conditions.
+//
+// In this case, compiler will not give you the full deduction chain, so, for
+// example, use check_traced_value_support for writing positive static_asserts
+// and has_traced_value_support for writing negative.
+template <typename T>
+class has_traced_value_support {
+  using Yes = char[1];
+  using No = char[2];
+
+  template <typename V>
+  static Yes& check_support(check_traced_value_support_t<V, int>);
+  template <typename V>
+  static No& check_support(...);
+
+ public:
+  static constexpr bool value = sizeof(Yes) == sizeof(check_support<T>(0));
+};
+
+}  // namespace internal
+
+template <typename T>
+void WriteIntoTracedValue(TracedValue context, T&& value) {
+  // TODO(altimin): Add a URL to documentation and a list of common failure
+  // patterns.
+  static_assert(
+      internal::has_traced_value_support<T>::value,
+      "The provided type (passed to TRACE_EVENT argument / TracedArray::Append "
+      "/ TracedDictionary::Add) does not support being written in a trace "
+      "format. Please see the comment in traced_value.h for more details.");
+
+  // Should be kept in sync with check_traced_value_support_t!
+  internal::WriteImpl(base::priority_tag<internal::kMaxWriteImplPriority>(),
+                      std::move(context), std::forward<T>(value));
+}
+
+// Helpers to write a given value into TracedValue even if the given type
+// doesn't support conversion (in which case the provided fallback should be
+// used). Useful for automatically generating conversions for autogenerated
+// code, but otherwise shouldn't be used as non-autogenerated code is expected
+// to define WriteIntoTracedValue convertor.
+// See WriteWithFallback test in traced_value_unittest.cc for a concrete
+// example.
+template <typename T>
+typename std::enable_if<internal::has_traced_value_support<T>::value>::type
+WriteIntoTracedValueWithFallback(TracedValue context,
+                                 T&& value,
+                                 const std::string&) {
+  WriteIntoTracedValue(std::move(context), std::forward<T>(value));
+}
+
+template <typename T>
+typename std::enable_if<!internal::has_traced_value_support<T>::value>::type
+WriteIntoTracedValueWithFallback(TracedValue context,
+                                 T&&,
+                                 const std::string& fallback) {
+  std::move(context).WriteString(fallback);
+}
+
+// TraceFormatTraits implementations for primitive types.
+
+// Specialisation for signed integer types (note: it excludes enums, which have
+// their own explicit specialisation).
+template <typename T>
+struct TraceFormatTraits<
+    T,
+    typename std::enable_if<std::is_integral<T>::value &&
+                            !std::is_same<T, bool>::value &&
+                            std::is_signed<T>::value>::type> {
+  inline static void WriteIntoTrace(TracedValue context, T value) {
+    std::move(context).WriteInt64(value);
+  }
+};
+
+// Specialisation for unsigned integer types (note: it excludes enums, which
+// have their own explicit specialisation).
+template <typename T>
+struct TraceFormatTraits<
+    T,
+    typename std::enable_if<std::is_integral<T>::value &&
+                            !std::is_same<T, bool>::value &&
+                            std::is_unsigned<T>::value>::type> {
+  inline static void WriteIntoTrace(TracedValue context, T value) {
+    std::move(context).WriteUInt64(value);
+  }
+};
+
+// Specialisation for bools.
+template <>
+struct TraceFormatTraits<bool> {
+  inline static void WriteIntoTrace(TracedValue context, bool value) {
+    std::move(context).WriteBoolean(value);
+  }
+};
+
+// Specialisation for floating point values.
+template <typename T>
+struct TraceFormatTraits<
+    T,
+    typename std::enable_if<std::is_floating_point<T>::value>::type> {
+  inline static void WriteIntoTrace(TracedValue context, T value) {
+    std::move(context).WriteDouble(static_cast<double>(value));
+  }
+};
+
+// Specialisation for signed enums.
+template <typename T>
+struct TraceFormatTraits<
+    T,
+    typename std::enable_if<
+        std::is_enum<T>::value &&
+        std::is_signed<
+            typename internal::safe_underlying_type<T>::type>::value>::type> {
+  inline static void WriteIntoTrace(TracedValue context, T value) {
+    std::move(context).WriteInt64(static_cast<int64_t>(value));
+  }
+};
+
+// Specialisation for unsigned enums.
+template <typename T>
+struct TraceFormatTraits<
+    T,
+    typename std::enable_if<
+        std::is_enum<T>::value &&
+        std::is_unsigned<
+            typename internal::safe_underlying_type<T>::type>::value>::type> {
+  inline static void WriteIntoTrace(TracedValue context, T value) {
+    std::move(context).WriteUInt64(static_cast<uint64_t>(value));
+  }
+};
+
+// Specialisations for C-style strings.
+template <>
+struct TraceFormatTraits<const char*> {
+  inline static void WriteIntoTrace(TracedValue context, const char* value) {
+    std::move(context).WriteString(value);
+  }
+};
+
+template <>
+struct TraceFormatTraits<char[]> {
+  inline static void WriteIntoTrace(TracedValue context, const char value[]) {
+    std::move(context).WriteString(value);
+  }
+};
+
+template <size_t N>
+struct TraceFormatTraits<char[N]> {
+  inline static void WriteIntoTrace(TracedValue context, const char value[N]) {
+    std::move(context).WriteString(value);
+  }
+};
+
+// Specialisation for C++ strings.
+template <>
+struct TraceFormatTraits<std::string> {
+  inline static void WriteIntoTrace(TracedValue context,
+                                    const std::string& value) {
+    std::move(context).WriteString(value);
+  }
+};
+
+// Specialisation for (const) void*, which writes the pointer value.
+template <>
+struct TraceFormatTraits<void*> {
+  inline static void WriteIntoTrace(TracedValue context, void* value) {
+    std::move(context).WritePointer(value);
+  }
+};
+
+template <>
+struct TraceFormatTraits<const void*> {
+  inline static void WriteIntoTrace(TracedValue context, const void* value) {
+    std::move(context).WritePointer(value);
+  }
+};
+
+// Specialisation for std::unique_ptr<>, which writes either nullptr or the
+// object it points to.
+template <typename T>
+struct TraceFormatTraits<std::unique_ptr<T>, check_traced_value_support_t<T>> {
+  inline static void WriteIntoTrace(TracedValue context,
+                                    const std::unique_ptr<T>& value) {
+    ::perfetto::WriteIntoTracedValue(std::move(context), value.get());
+  }
+};
+
+// Specialisation for raw pointer, which writes either nullptr or the object it
+// points to.
+template <typename T>
+struct TraceFormatTraits<T*, check_traced_value_support_t<T>> {
+  inline static void WriteIntoTrace(TracedValue context, T* value) {
+    if (!value) {
+      std::move(context).WritePointer(nullptr);
+      return;
+    }
+    ::perfetto::WriteIntoTracedValue(std::move(context), *value);
+  }
+};
+
+// Specialisation for nullptr.
+template <>
+struct TraceFormatTraits<std::nullptr_t> {
+  inline static void WriteIntoTrace(TracedValue context, std::nullptr_t) {
+    std::move(context).WritePointer(nullptr);
+  }
+};
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_TRACED_VALUE_H_
+// gen_amalgamated begin header: include/perfetto/tracing/track.h
+// gen_amalgamated begin header: include/perfetto/base/proc_utils.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_BASE_PROC_UTILS_H_
+#define INCLUDE_PERFETTO_BASE_PROC_UTILS_H_
+
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+#include <Windows.h>
+#include <processthreadsapi.h>
+#elif PERFETTO_BUILDFLAG(PERFETTO_OS_FUCHSIA)
+#include <zircon/process.h>
+#include <zircon/types.h>
+#else
+#include <unistd.h>
+#endif
+
+namespace perfetto {
+namespace base {
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_FUCHSIA)
+using PlatformProcessId = zx_handle_t;
+inline PlatformProcessId GetProcessId() {
+  return zx_process_self();
+}
+#elif PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+using PlatformProcessId = uint64_t;
+inline PlatformProcessId GetProcessId() {
+  return static_cast<uint64_t>(GetCurrentProcessId());
+}
+#else
+using PlatformProcessId = pid_t;
+inline PlatformProcessId GetProcessId() {
+  return getpid();
+}
+#endif
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_BASE_PROC_UTILS_H_
+// gen_amalgamated begin header: include/perfetto/base/thread_utils.h
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_BASE_THREAD_UTILS_H_
+#define INCLUDE_PERFETTO_BASE_THREAD_UTILS_H_
+
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/base/build_config.h"
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+#include <Windows.h>
+#include <processthreadsapi.h>
+#elif PERFETTO_BUILDFLAG(PERFETTO_OS_FUCHSIA)
+#include <zircon/process.h>
+#include <zircon/types.h>
+#elif PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+#include <sys/syscall.h>
+#include <sys/types.h>
+#include <unistd.h>
+#else
+#include <pthread.h>
+#endif
+
+namespace perfetto {
+namespace base {
+
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
+using PlatformThreadId = pid_t;
+inline PlatformThreadId GetThreadId() {
+  return gettid();
+}
+#elif PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX)
+using PlatformThreadId = pid_t;
+inline PlatformThreadId GetThreadId() {
+  return static_cast<pid_t>(syscall(__NR_gettid));
+}
+#elif PERFETTO_BUILDFLAG(PERFETTO_OS_FUCHSIA)
+using PlatformThreadId = zx_handle_t;
+inline PlatformThreadId GetThreadId() {
+  return zx_thread_self();
+}
+#elif PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+using PlatformThreadId = uint64_t;
+inline PlatformThreadId GetThreadId() {
+  uint64_t tid;
+  pthread_threadid_np(nullptr, &tid);
+  return tid;
+}
+#elif PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+using PlatformThreadId = uint64_t;
+inline PlatformThreadId GetThreadId() {
+  return static_cast<uint64_t>(GetCurrentThreadId());
+}
+#elif PERFETTO_BUILDFLAG(PERFETTO_OS_NACL)
+using PlatformThreadId = pid_t;
+inline PlatformThreadId GetThreadId() {
+  return reinterpret_cast<int32_t>(pthread_self());
+}
+#else  // Default to pthreads in case no OS is set.
+using PlatformThreadId = pthread_t;
+inline PlatformThreadId GetThreadId() {
+  return pthread_self();
+}
+#endif
+
+}  // namespace base
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_BASE_THREAD_UTILS_H_
+// gen_amalgamated begin header: include/perfetto/tracing/internal/compile_time_hash.h
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_INTERNAL_COMPILE_TIME_HASH_H_
+#define INCLUDE_PERFETTO_TRACING_INTERNAL_COMPILE_TIME_HASH_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+namespace perfetto {
+namespace internal {
+
+// A helper class which computes a 64-bit hash of the input data at compile
+// time. The algorithm used is FNV-1a as it is fast and easy to implement and
+// has relatively few collisions.
+// WARNING: This hash function should not be used for any cryptographic purpose.
+class CompileTimeHash {
+ public:
+  // Creates an empty hash object
+  constexpr inline CompileTimeHash() {}
+
+  // Hashes a byte array.
+  constexpr inline CompileTimeHash Update(const char* data, size_t size) const {
+    return CompileTimeHash(HashRecursively(kFnv1a64OffsetBasis, data, size));
+  }
+
+  constexpr inline uint64_t digest() const { return result_; }
+
+ private:
+  constexpr inline CompileTimeHash(uint64_t result) : result_(result) {}
+
+  static constexpr inline uint64_t HashRecursively(uint64_t value,
+                                                   const char* data,
+                                                   size_t size) {
+    return !size ? value
+                 : HashRecursively(
+                       (value ^ static_cast<uint8_t>(*data)) * kFnv1a64Prime,
+                       data + 1, size - 1);
+  }
+
+  static constexpr uint64_t kFnv1a64OffsetBasis = 0xcbf29ce484222325;
+  static constexpr uint64_t kFnv1a64Prime = 0x100000001b3;
+
+  uint64_t result_ = kFnv1a64OffsetBasis;
+};
+
+}  // namespace internal
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_INTERNAL_COMPILE_TIME_HASH_H_
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/counter_descriptor.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_COUNTER_DESCRIPTOR_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_COUNTER_DESCRIPTOR_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+enum CounterDescriptor_BuiltinCounterType : int32_t;
+enum CounterDescriptor_Unit : int32_t;
+
+enum CounterDescriptor_BuiltinCounterType : int32_t {
+  CounterDescriptor_BuiltinCounterType_COUNTER_UNSPECIFIED = 0,
+  CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_TIME_NS = 1,
+  CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_INSTRUCTION_COUNT = 2,
+};
+
+const CounterDescriptor_BuiltinCounterType CounterDescriptor_BuiltinCounterType_MIN = CounterDescriptor_BuiltinCounterType_COUNTER_UNSPECIFIED;
+const CounterDescriptor_BuiltinCounterType CounterDescriptor_BuiltinCounterType_MAX = CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_INSTRUCTION_COUNT;
+
+enum CounterDescriptor_Unit : int32_t {
+  CounterDescriptor_Unit_UNIT_UNSPECIFIED = 0,
+  CounterDescriptor_Unit_UNIT_TIME_NS = 1,
+  CounterDescriptor_Unit_UNIT_COUNT = 2,
+  CounterDescriptor_Unit_UNIT_SIZE_BYTES = 3,
+};
+
+const CounterDescriptor_Unit CounterDescriptor_Unit_MIN = CounterDescriptor_Unit_UNIT_UNSPECIFIED;
+const CounterDescriptor_Unit CounterDescriptor_Unit_MAX = CounterDescriptor_Unit_UNIT_SIZE_BYTES;
+
+class CounterDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  CounterDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit CounterDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit CounterDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_type() const { return at<1>().valid(); }
+  int32_t type() const { return at<1>().as_int32(); }
+  bool has_categories() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> categories() const { return GetRepeated<::protozero::ConstChars>(2); }
+  bool has_unit() const { return at<3>().valid(); }
+  int32_t unit() const { return at<3>().as_int32(); }
+  bool has_unit_name() const { return at<6>().valid(); }
+  ::protozero::ConstChars unit_name() const { return at<6>().as_string(); }
+  bool has_unit_multiplier() const { return at<4>().valid(); }
+  int64_t unit_multiplier() const { return at<4>().as_int64(); }
+  bool has_is_incremental() const { return at<5>().valid(); }
+  bool is_incremental() const { return at<5>().as_bool(); }
+};
+
+class CounterDescriptor : public ::protozero::Message {
+ public:
+  using Decoder = CounterDescriptor_Decoder;
+  enum : int32_t {
+    kTypeFieldNumber = 1,
+    kCategoriesFieldNumber = 2,
+    kUnitFieldNumber = 3,
+    kUnitNameFieldNumber = 6,
+    kUnitMultiplierFieldNumber = 4,
+    kIsIncrementalFieldNumber = 5,
+  };
+  using BuiltinCounterType = ::perfetto::protos::pbzero::CounterDescriptor_BuiltinCounterType;
+  using Unit = ::perfetto::protos::pbzero::CounterDescriptor_Unit;
+  static const BuiltinCounterType COUNTER_UNSPECIFIED = CounterDescriptor_BuiltinCounterType_COUNTER_UNSPECIFIED;
+  static const BuiltinCounterType COUNTER_THREAD_TIME_NS = CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_TIME_NS;
+  static const BuiltinCounterType COUNTER_THREAD_INSTRUCTION_COUNT = CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_INSTRUCTION_COUNT;
+  static const Unit UNIT_UNSPECIFIED = CounterDescriptor_Unit_UNIT_UNSPECIFIED;
+  static const Unit UNIT_TIME_NS = CounterDescriptor_Unit_UNIT_TIME_NS;
+  static const Unit UNIT_COUNT = CounterDescriptor_Unit_UNIT_COUNT;
+  static const Unit UNIT_SIZE_BYTES = CounterDescriptor_Unit_UNIT_SIZE_BYTES;
+
+  using FieldMetadata_Type =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::CounterDescriptor_BuiltinCounterType,
+      CounterDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Type kType() { return {}; }
+  void set_type(::perfetto::protos::pbzero::CounterDescriptor_BuiltinCounterType value) {
+    static constexpr uint32_t field_id = FieldMetadata_Type::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Categories =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      CounterDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Categories kCategories() { return {}; }
+  void add_categories(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Categories::kFieldId, data, size);
+  }
+  void add_categories(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Categories::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Unit =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::CounterDescriptor_Unit,
+      CounterDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Unit kUnit() { return {}; }
+  void set_unit(::perfetto::protos::pbzero::CounterDescriptor_Unit value) {
+    static constexpr uint32_t field_id = FieldMetadata_Unit::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_UnitName =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      CounterDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UnitName kUnitName() { return {}; }
+  void set_unit_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_UnitName::kFieldId, data, size);
+  }
+  void set_unit_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_UnitName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_UnitMultiplier =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      CounterDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UnitMultiplier kUnitMultiplier() { return {}; }
+  void set_unit_multiplier(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_UnitMultiplier::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IsIncremental =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      CounterDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IsIncremental kIsIncremental() { return {}; }
+  void set_is_incremental(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_IsIncremental::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/track_descriptor.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_DESCRIPTOR_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_DESCRIPTOR_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class TrackDescriptor;
+class CounterDescriptor;
+class ChromeThreadDescriptor;
+class ThreadDescriptor;
+class ChromeProcessDescriptor;
+class ProcessDescriptor;
+enum CounterDescriptor_BuiltinCounterType : int;
+enum CounterDescriptor_Unit : int;
+enum ChromeThreadDescriptor_ThreadType : int;
+enum ThreadDescriptor_ChromeThreadType : int;
+enum ChromeProcessDescriptor_ProcessType : int;
+enum ProcessDescriptor_ChromeProcessType : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT TrackDescriptor : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kUuidFieldNumber = 1,
+    kParentUuidFieldNumber = 5,
+    kNameFieldNumber = 2,
+    kProcessFieldNumber = 3,
+    kChromeProcessFieldNumber = 6,
+    kThreadFieldNumber = 4,
+    kChromeThreadFieldNumber = 7,
+    kCounterFieldNumber = 8,
+  };
+
+  TrackDescriptor();
+  ~TrackDescriptor() override;
+  TrackDescriptor(TrackDescriptor&&) noexcept;
+  TrackDescriptor& operator=(TrackDescriptor&&);
+  TrackDescriptor(const TrackDescriptor&);
+  TrackDescriptor& operator=(const TrackDescriptor&);
+  bool operator==(const TrackDescriptor&) const;
+  bool operator!=(const TrackDescriptor& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_uuid() const { return _has_field_[1]; }
+  uint64_t uuid() const { return uuid_; }
+  void set_uuid(uint64_t value) { uuid_ = value; _has_field_.set(1); }
+
+  bool has_parent_uuid() const { return _has_field_[5]; }
+  uint64_t parent_uuid() const { return parent_uuid_; }
+  void set_parent_uuid(uint64_t value) { parent_uuid_ = value; _has_field_.set(5); }
+
+  bool has_name() const { return _has_field_[2]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(2); }
+
+  bool has_process() const { return _has_field_[3]; }
+  const ProcessDescriptor& process() const { return *process_; }
+  ProcessDescriptor* mutable_process() { _has_field_.set(3); return process_.get(); }
+
+  bool has_chrome_process() const { return _has_field_[6]; }
+  const ChromeProcessDescriptor& chrome_process() const { return *chrome_process_; }
+  ChromeProcessDescriptor* mutable_chrome_process() { _has_field_.set(6); return chrome_process_.get(); }
+
+  bool has_thread() const { return _has_field_[4]; }
+  const ThreadDescriptor& thread() const { return *thread_; }
+  ThreadDescriptor* mutable_thread() { _has_field_.set(4); return thread_.get(); }
+
+  bool has_chrome_thread() const { return _has_field_[7]; }
+  const ChromeThreadDescriptor& chrome_thread() const { return *chrome_thread_; }
+  ChromeThreadDescriptor* mutable_chrome_thread() { _has_field_.set(7); return chrome_thread_.get(); }
+
+  bool has_counter() const { return _has_field_[8]; }
+  const CounterDescriptor& counter() const { return *counter_; }
+  CounterDescriptor* mutable_counter() { _has_field_.set(8); return counter_.get(); }
+
+ private:
+  uint64_t uuid_{};
+  uint64_t parent_uuid_{};
+  std::string name_{};
+  ::protozero::CopyablePtr<ProcessDescriptor> process_;
+  ::protozero::CopyablePtr<ChromeProcessDescriptor> chrome_process_;
+  ::protozero::CopyablePtr<ThreadDescriptor> thread_;
+  ::protozero::CopyablePtr<ChromeThreadDescriptor> chrome_thread_;
+  ::protozero::CopyablePtr<CounterDescriptor> counter_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<9> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_DESCRIPTOR_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/track_descriptor.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_DESCRIPTOR_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_DESCRIPTOR_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class ChromeProcessDescriptor;
+class ChromeThreadDescriptor;
+class CounterDescriptor;
+class ProcessDescriptor;
+class ThreadDescriptor;
+
+class TrackDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TrackDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TrackDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TrackDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_uuid() const { return at<1>().valid(); }
+  uint64_t uuid() const { return at<1>().as_uint64(); }
+  bool has_parent_uuid() const { return at<5>().valid(); }
+  uint64_t parent_uuid() const { return at<5>().as_uint64(); }
+  bool has_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars name() const { return at<2>().as_string(); }
+  bool has_process() const { return at<3>().valid(); }
+  ::protozero::ConstBytes process() const { return at<3>().as_bytes(); }
+  bool has_chrome_process() const { return at<6>().valid(); }
+  ::protozero::ConstBytes chrome_process() const { return at<6>().as_bytes(); }
+  bool has_thread() const { return at<4>().valid(); }
+  ::protozero::ConstBytes thread() const { return at<4>().as_bytes(); }
+  bool has_chrome_thread() const { return at<7>().valid(); }
+  ::protozero::ConstBytes chrome_thread() const { return at<7>().as_bytes(); }
+  bool has_counter() const { return at<8>().valid(); }
+  ::protozero::ConstBytes counter() const { return at<8>().as_bytes(); }
+};
+
+class TrackDescriptor : public ::protozero::Message {
+ public:
+  using Decoder = TrackDescriptor_Decoder;
+  enum : int32_t {
+    kUuidFieldNumber = 1,
+    kParentUuidFieldNumber = 5,
+    kNameFieldNumber = 2,
+    kProcessFieldNumber = 3,
+    kChromeProcessFieldNumber = 6,
+    kThreadFieldNumber = 4,
+    kChromeThreadFieldNumber = 7,
+    kCounterFieldNumber = 8,
+  };
+
+  using FieldMetadata_Uuid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Uuid kUuid() { return {}; }
+  void set_uuid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Uuid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ParentUuid =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ParentUuid kParentUuid() { return {}; }
+  void set_parent_uuid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ParentUuid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TrackDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Process =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ProcessDescriptor,
+      TrackDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Process kProcess() { return {}; }
+  template <typename T = ProcessDescriptor> T* set_process() {
+    return BeginNestedMessage<T>(3);
+  }
+
+
+  using FieldMetadata_ChromeProcess =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeProcessDescriptor,
+      TrackDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeProcess kChromeProcess() { return {}; }
+  template <typename T = ChromeProcessDescriptor> T* set_chrome_process() {
+    return BeginNestedMessage<T>(6);
+  }
+
+
+  using FieldMetadata_Thread =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ThreadDescriptor,
+      TrackDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Thread kThread() { return {}; }
+  template <typename T = ThreadDescriptor> T* set_thread() {
+    return BeginNestedMessage<T>(4);
+  }
+
+
+  using FieldMetadata_ChromeThread =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeThreadDescriptor,
+      TrackDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeThread kChromeThread() { return {}; }
+  template <typename T = ChromeThreadDescriptor> T* set_chrome_thread() {
+    return BeginNestedMessage<T>(7);
+  }
+
+
+  using FieldMetadata_Counter =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      CounterDescriptor,
+      TrackDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Counter kCounter() { return {}; }
+  template <typename T = CounterDescriptor> T* set_counter() {
+    return BeginNestedMessage<T>(8);
+  }
+
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_TRACK_H_
+#define INCLUDE_PERFETTO_TRACING_TRACK_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/base/proc_utils.h"
+// gen_amalgamated expanded: #include "perfetto/base/thread_utils.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message_handle.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/compile_time_hash.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/trace_packet.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/counter_descriptor.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/track_descriptor.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/track_descriptor.pbzero.h"
+
+#include <stdint.h>
+#include <map>
+#include <mutex>
+
+namespace perfetto {
+namespace internal {
+class TrackRegistry;
+}
+
+// Track events are recorded on a timeline track, which maintains the relative
+// time ordering of all events on that track. Each thread has its own default
+// track (ThreadTrack), which is by default where all track events are written.
+// Thread tracks are grouped under their hosting process (ProcessTrack).
+
+// Events which aren't strictly scoped to a thread or a process, or don't
+// correspond to synchronous code execution on a thread can use a custom
+// track (Track, ThreadTrack or ProcessTrack). A Track object can also
+// optionally be parented to a thread or a process.
+//
+// A track is represented by a uuid, which must be unique across the entire
+// recorded trace.
+//
+// For example, to record an event that begins and ends on different threads,
+// use a matching id to tie the begin and end events together:
+//
+//   TRACE_EVENT_BEGIN("category", "AsyncEvent", perfetto::Track(8086));
+//   ...
+//   TRACE_EVENT_END("category", perfetto::Track(8086));
+//
+// Tracks can also be annotated with metadata:
+//
+//   auto desc = track.Serialize();
+//   desc.set_name("MyTrack");
+//   perfetto::TrackEvent::SetTrackDescriptor(track, desc);
+//
+// Threads and processes can also be named in a similar way, e.g.:
+//
+//   auto desc = perfetto::ProcessTrack::Current().Serialize();
+//   desc.mutable_process()->set_process_name("MyProcess");
+//   perfetto::TrackEvent::SetTrackDescriptor(
+//       perfetto::ProcessTrack::Current(), desc);
+//
+// The metadata remains valid between tracing sessions. To free up data for a
+// track, call EraseTrackDescriptor:
+//
+//   perfetto::TrackEvent::EraseTrackDescriptor(track);
+//
+struct PERFETTO_EXPORT Track {
+  const uint64_t uuid;
+  const uint64_t parent_uuid;
+  constexpr Track() : uuid(0), parent_uuid(0) {}
+
+  // Construct a track with identifier |id|, optionally parented under |parent|.
+  // If no parent is specified, the track's parent is the current process's
+  // track.
+  //
+  // To minimize the chances for accidental id collisions across processes, the
+  // track's effective uuid is generated by xorring |id| with a random,
+  // per-process cookie.
+  explicit constexpr Track(uint64_t id, Track parent = MakeProcessTrack())
+      : uuid(id ^ parent.uuid), parent_uuid(parent.uuid) {}
+
+  explicit operator bool() const { return uuid; }
+  void Serialize(protos::pbzero::TrackDescriptor*) const;
+  protos::gen::TrackDescriptor Serialize() const;
+
+  // Construct a global track with identifier |id|.
+  //
+  // Beware: the globally unique |id| should be chosen carefully to avoid
+  // accidental clashes with track identifiers emitted by other producers.
+  static Track Global(uint64_t id) { return Track(id, Track()); }
+
+  // Construct a track using |ptr| as identifier.
+  static Track FromPointer(const void* ptr, Track parent = MakeProcessTrack()) {
+    // Using pointers as global TrackIds isn't supported as pointers are
+    // per-proccess and the same pointer value can be used in different
+    // processes.
+    PERFETTO_DCHECK(parent.uuid != Track().uuid);
+
+    return Track(static_cast<uint64_t>(reinterpret_cast<uintptr_t>(ptr)),
+                 parent);
+  }
+
+ protected:
+  constexpr Track(uint64_t uuid_, uint64_t parent_uuid_)
+      : uuid(uuid_), parent_uuid(parent_uuid_) {}
+
+  static Track MakeThreadTrack(base::PlatformThreadId tid) {
+    // If tid were 0 here (which is an invalid tid), we would create a thread
+    // track with a uuid that conflicts with the corresponding ProcessTrack.
+    PERFETTO_DCHECK(tid != 0);
+    return Track(static_cast<uint64_t>(tid), MakeProcessTrack());
+  }
+
+  static Track MakeProcessTrack() { return Track(process_uuid, Track()); }
+
+  static constexpr inline uint64_t CompileTimeHash(const char* string) {
+    return internal::CompileTimeHash()
+        .Update(string, static_cast<size_t>(base::StrEnd(string) - string))
+        .digest();
+  }
+
+ private:
+  friend class internal::TrackRegistry;
+  static uint64_t process_uuid;
+};
+
+// A process track represents events that describe the state of the entire
+// application (e.g., counter events). Currently a ProcessTrack can only
+// represent the current process.
+struct PERFETTO_EXPORT ProcessTrack : public Track {
+  const base::PlatformProcessId pid;
+
+  static ProcessTrack Current() { return ProcessTrack(); }
+
+  void Serialize(protos::pbzero::TrackDescriptor*) const;
+  protos::gen::TrackDescriptor Serialize() const;
+
+ private:
+  ProcessTrack() : Track(MakeProcessTrack()), pid(base::GetProcessId()) {}
+};
+
+// A thread track is associated with a specific thread of execution. Currently
+// only threads in the current process can be referenced.
+struct PERFETTO_EXPORT ThreadTrack : public Track {
+  const base::PlatformProcessId pid;
+  const base::PlatformThreadId tid;
+
+  static ThreadTrack Current() { return ThreadTrack(base::GetThreadId()); }
+
+  // Represents a thread in the current process.
+  static ThreadTrack ForThread(base::PlatformThreadId tid_) {
+    return ThreadTrack(tid_);
+  }
+
+  void Serialize(protos::pbzero::TrackDescriptor*) const;
+  protos::gen::TrackDescriptor Serialize() const;
+
+ private:
+  explicit ThreadTrack(base::PlatformThreadId tid_)
+      : Track(MakeThreadTrack(tid_)),
+        pid(ProcessTrack::Current().pid),
+        tid(tid_) {}
+};
+
+// A track for recording counter values with the TRACE_COUNTER macro. Counter
+// tracks can optionally be given units and other metadata. See
+// /protos/perfetto/trace/track_event/counter_descriptor.proto for details.
+class CounterTrack : public Track {
+  // A random value mixed into counter track uuids to avoid collisions with
+  // other types of tracks.
+  static constexpr uint64_t kCounterMagic = 0xb1a4a67d7970839eul;
+
+ public:
+  using Unit = perfetto::protos::pbzero::CounterDescriptor::Unit;
+
+  // |name| must be a string with static lifetime.
+  constexpr explicit CounterTrack(const char* name,
+                                  Track parent = MakeProcessTrack())
+      : Track(CompileTimeHash(name) ^ kCounterMagic, parent),
+        name_(name),
+        category_(nullptr) {}
+
+  // |unit_name| is a free-form description of the unit used by this counter. It
+  // must have static lifetime.
+  constexpr CounterTrack(const char* name,
+                         const char* unit_name,
+                         Track parent = MakeProcessTrack())
+      : Track(CompileTimeHash(name) ^ kCounterMagic, parent),
+        name_(name),
+        category_(nullptr),
+        unit_name_(unit_name) {}
+
+  constexpr CounterTrack(const char* name,
+                         Unit unit,
+                         Track parent = MakeProcessTrack())
+      : Track(CompileTimeHash(name) ^ kCounterMagic, parent),
+        name_(name),
+        category_(nullptr),
+        unit_(unit) {}
+
+  static constexpr CounterTrack Global(const char* name,
+                                       const char* unit_name) {
+    return CounterTrack(name, unit_name, Track());
+  }
+
+  static constexpr CounterTrack Global(const char* name, Unit unit) {
+    return CounterTrack(name, unit, Track());
+  }
+
+  static constexpr CounterTrack Global(const char* name) {
+    return Global(name, nullptr);
+  }
+
+  constexpr CounterTrack set_unit(Unit unit) const {
+    return CounterTrack(uuid, parent_uuid, name_, category_, unit, unit_name_,
+                        unit_multiplier_, is_incremental_);
+  }
+
+  constexpr CounterTrack set_unit_name(const char* unit_name) const {
+    return CounterTrack(uuid, parent_uuid, name_, category_, unit_, unit_name,
+                        unit_multiplier_, is_incremental_);
+  }
+
+  constexpr CounterTrack set_unit_multiplier(int64_t unit_multiplier) const {
+    return CounterTrack(uuid, parent_uuid, name_, category_, unit_, unit_name_,
+                        unit_multiplier, is_incremental_);
+  }
+
+  constexpr CounterTrack set_category(const char* category) const {
+    return CounterTrack(uuid, parent_uuid, name_, category, unit_, unit_name_,
+                        unit_multiplier_, is_incremental_);
+  }
+
+  void Serialize(protos::pbzero::TrackDescriptor*) const;
+  protos::gen::TrackDescriptor Serialize() const;
+
+ private:
+  constexpr CounterTrack(uint64_t uuid_,
+                         uint64_t parent_uuid_,
+                         const char* name,
+                         const char* category,
+                         Unit unit,
+                         const char* unit_name,
+                         int64_t unit_multiplier,
+                         bool is_incremental)
+      : Track(uuid_, parent_uuid_),
+        name_(name),
+        category_(category),
+        unit_(unit),
+        unit_name_(unit_name),
+        unit_multiplier_(unit_multiplier),
+        is_incremental_(is_incremental) {}
+
+  // TODO(skyostil): Expose incremental counters once we decide how to manage
+  // their incremental state.
+  constexpr CounterTrack set_is_incremental(bool is_incremental = true) const {
+    return CounterTrack(uuid, parent_uuid, name_, category_, unit_, unit_name_,
+                        unit_multiplier_, is_incremental);
+  }
+
+  const char* const name_;
+  const char* const category_;
+  Unit unit_ = perfetto::protos::pbzero::CounterDescriptor::UNIT_UNSPECIFIED;
+  const char* const unit_name_ = nullptr;
+  int64_t unit_multiplier_ = 1;
+  bool is_incremental_ = false;
+};
+
+namespace internal {
+
+// Keeps a map of uuids to serialized track descriptors and provides a
+// thread-safe way to read and write them. Each trace writer keeps a TLS set of
+// the tracks it has seen (see TrackEventIncrementalState). In the common case,
+// this registry is not consulted (and no locks are taken). However when a new
+// track is seen, this registry is used to write either 1) the default
+// descriptor for that track (see *Track::Serialize) or 2) a serialized
+// descriptor stored in the registry which may have additional metadata (e.g.,
+// track name).
+// TODO(eseckler): Remove PERFETTO_EXPORT once Chromium no longer calls
+// TrackRegistry::InitializeInstance() directly.
+class PERFETTO_EXPORT TrackRegistry {
+ public:
+  using SerializedTrackDescriptor = std::string;
+
+  TrackRegistry();
+  ~TrackRegistry();
+
+  static void InitializeInstance();
+  static TrackRegistry* Get() { return instance_; }
+
+  void EraseTrack(Track);
+
+  // Store metadata for |track| in the registry. |fill_function| is called
+  // synchronously to record additional properties for the track.
+  template <typename TrackType>
+  void UpdateTrack(
+      const TrackType& track,
+      std::function<void(protos::pbzero::TrackDescriptor*)> fill_function) {
+    UpdateTrackImpl(track, [&](protos::pbzero::TrackDescriptor* desc) {
+      track.Serialize(desc);
+      fill_function(desc);
+    });
+  }
+
+  // This variant lets the user supply a serialized track descriptor directly.
+  void UpdateTrack(Track, const std::string& serialized_desc);
+
+  // If |track| exists in the registry, write out the serialized track
+  // descriptor for it into |packet|. Otherwise just the ephemeral track object
+  // is serialized without any additional metadata.
+  template <typename TrackType>
+  void SerializeTrack(
+      const TrackType& track,
+      protozero::MessageHandle<protos::pbzero::TracePacket> packet) {
+    // If the track has extra metadata (recorded with UpdateTrack), it will be
+    // found in the registry. To minimize the time the lock is held, make a copy
+    // of the data held in the registry and write it outside the lock.
+    std::string desc_copy;
+    {
+      std::lock_guard<std::mutex> lock(mutex_);
+      const auto& it = tracks_.find(track.uuid);
+      if (it != tracks_.end()) {
+        desc_copy = it->second;
+        PERFETTO_DCHECK(!desc_copy.empty());
+      }
+    }
+    if (!desc_copy.empty()) {
+      WriteTrackDescriptor(std::move(desc_copy), std::move(packet));
+    } else {
+      // Otherwise we just write the basic descriptor for this type of track
+      // (e.g., just uuid, no name).
+      track.Serialize(packet->set_track_descriptor());
+    }
+  }
+
+  static void WriteTrackDescriptor(
+      const SerializedTrackDescriptor& desc,
+      protozero::MessageHandle<protos::pbzero::TracePacket> packet);
+
+ private:
+  void UpdateTrackImpl(
+      Track,
+      std::function<void(protos::pbzero::TrackDescriptor*)> fill_function);
+
+  std::mutex mutex_;
+  std::map<uint64_t /* uuid */, SerializedTrackDescriptor> tracks_;
+
+  static TrackRegistry* instance_;
+};
+
+}  // namespace internal
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_TRACK_H_
+// gen_amalgamated begin header: gen/protos/perfetto/common/builtin_clock.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_BUILTIN_CLOCK_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_BUILTIN_CLOCK_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+enum BuiltinClock : int32_t {
+  BUILTIN_CLOCK_UNKNOWN = 0,
+  BUILTIN_CLOCK_REALTIME = 1,
+  BUILTIN_CLOCK_REALTIME_COARSE = 2,
+  BUILTIN_CLOCK_MONOTONIC = 3,
+  BUILTIN_CLOCK_MONOTONIC_COARSE = 4,
+  BUILTIN_CLOCK_MONOTONIC_RAW = 5,
+  BUILTIN_CLOCK_BOOTTIME = 6,
+  BUILTIN_CLOCK_MAX_ID = 63,
+};
+
+const BuiltinClock BuiltinClock_MIN = BUILTIN_CLOCK_UNKNOWN;
+const BuiltinClock BuiltinClock_MAX = BUILTIN_CLOCK_MAX_ID;
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/interned_data/interned_data.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_INTERNED_DATA_INTERNED_DATA_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_INTERNED_DATA_INTERNED_DATA_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class Callstack;
+class DebugAnnotationName;
+class EventCategory;
+class EventName;
+class Frame;
+class HistogramName;
+class InternedGpuRenderStageSpecification;
+class InternedGraphicsContext;
+class InternedString;
+class LogMessageBody;
+class Mapping;
+class ProfiledFrameSymbols;
+class SourceLocation;
+
+class InternedData_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/26, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  InternedData_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit InternedData_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit InternedData_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_event_categories() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> event_categories() const { return GetRepeated<::protozero::ConstBytes>(1); }
+  bool has_event_names() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> event_names() const { return GetRepeated<::protozero::ConstBytes>(2); }
+  bool has_debug_annotation_names() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> debug_annotation_names() const { return GetRepeated<::protozero::ConstBytes>(3); }
+  bool has_source_locations() const { return at<4>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> source_locations() const { return GetRepeated<::protozero::ConstBytes>(4); }
+  bool has_log_message_body() const { return at<20>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> log_message_body() const { return GetRepeated<::protozero::ConstBytes>(20); }
+  bool has_histogram_names() const { return at<25>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> histogram_names() const { return GetRepeated<::protozero::ConstBytes>(25); }
+  bool has_build_ids() const { return at<16>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> build_ids() const { return GetRepeated<::protozero::ConstBytes>(16); }
+  bool has_mapping_paths() const { return at<17>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> mapping_paths() const { return GetRepeated<::protozero::ConstBytes>(17); }
+  bool has_source_paths() const { return at<18>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> source_paths() const { return GetRepeated<::protozero::ConstBytes>(18); }
+  bool has_function_names() const { return at<5>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> function_names() const { return GetRepeated<::protozero::ConstBytes>(5); }
+  bool has_profiled_frame_symbols() const { return at<21>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> profiled_frame_symbols() const { return GetRepeated<::protozero::ConstBytes>(21); }
+  bool has_mappings() const { return at<19>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> mappings() const { return GetRepeated<::protozero::ConstBytes>(19); }
+  bool has_frames() const { return at<6>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> frames() const { return GetRepeated<::protozero::ConstBytes>(6); }
+  bool has_callstacks() const { return at<7>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> callstacks() const { return GetRepeated<::protozero::ConstBytes>(7); }
+  bool has_vulkan_memory_keys() const { return at<22>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> vulkan_memory_keys() const { return GetRepeated<::protozero::ConstBytes>(22); }
+  bool has_graphics_contexts() const { return at<23>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> graphics_contexts() const { return GetRepeated<::protozero::ConstBytes>(23); }
+  bool has_gpu_specifications() const { return at<24>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> gpu_specifications() const { return GetRepeated<::protozero::ConstBytes>(24); }
+  bool has_kernel_symbols() const { return at<26>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> kernel_symbols() const { return GetRepeated<::protozero::ConstBytes>(26); }
+};
+
+class InternedData : public ::protozero::Message {
+ public:
+  using Decoder = InternedData_Decoder;
+  enum : int32_t {
+    kEventCategoriesFieldNumber = 1,
+    kEventNamesFieldNumber = 2,
+    kDebugAnnotationNamesFieldNumber = 3,
+    kSourceLocationsFieldNumber = 4,
+    kLogMessageBodyFieldNumber = 20,
+    kHistogramNamesFieldNumber = 25,
+    kBuildIdsFieldNumber = 16,
+    kMappingPathsFieldNumber = 17,
+    kSourcePathsFieldNumber = 18,
+    kFunctionNamesFieldNumber = 5,
+    kProfiledFrameSymbolsFieldNumber = 21,
+    kMappingsFieldNumber = 19,
+    kFramesFieldNumber = 6,
+    kCallstacksFieldNumber = 7,
+    kVulkanMemoryKeysFieldNumber = 22,
+    kGraphicsContextsFieldNumber = 23,
+    kGpuSpecificationsFieldNumber = 24,
+    kKernelSymbolsFieldNumber = 26,
+  };
+
+  using FieldMetadata_EventCategories =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      EventCategory,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EventCategories kEventCategories() { return {}; }
+  template <typename T = EventCategory> T* add_event_categories() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_EventNames =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      EventName,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EventNames kEventNames() { return {}; }
+  template <typename T = EventName> T* add_event_names() {
+    return BeginNestedMessage<T>(2);
+  }
+
+
+  using FieldMetadata_DebugAnnotationNames =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      DebugAnnotationName,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DebugAnnotationNames kDebugAnnotationNames() { return {}; }
+  template <typename T = DebugAnnotationName> T* add_debug_annotation_names() {
+    return BeginNestedMessage<T>(3);
+  }
+
+
+  using FieldMetadata_SourceLocations =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SourceLocation,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SourceLocations kSourceLocations() { return {}; }
+  template <typename T = SourceLocation> T* add_source_locations() {
+    return BeginNestedMessage<T>(4);
+  }
+
+
+  using FieldMetadata_LogMessageBody =
+    ::protozero::proto_utils::FieldMetadata<
+      20,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      LogMessageBody,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LogMessageBody kLogMessageBody() { return {}; }
+  template <typename T = LogMessageBody> T* add_log_message_body() {
+    return BeginNestedMessage<T>(20);
+  }
+
+
+  using FieldMetadata_HistogramNames =
+    ::protozero::proto_utils::FieldMetadata<
+      25,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      HistogramName,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HistogramNames kHistogramNames() { return {}; }
+  template <typename T = HistogramName> T* add_histogram_names() {
+    return BeginNestedMessage<T>(25);
+  }
+
+
+  using FieldMetadata_BuildIds =
+    ::protozero::proto_utils::FieldMetadata<
+      16,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      InternedString,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BuildIds kBuildIds() { return {}; }
+  template <typename T = InternedString> T* add_build_ids() {
+    return BeginNestedMessage<T>(16);
+  }
+
+
+  using FieldMetadata_MappingPaths =
+    ::protozero::proto_utils::FieldMetadata<
+      17,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      InternedString,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MappingPaths kMappingPaths() { return {}; }
+  template <typename T = InternedString> T* add_mapping_paths() {
+    return BeginNestedMessage<T>(17);
+  }
+
+
+  using FieldMetadata_SourcePaths =
+    ::protozero::proto_utils::FieldMetadata<
+      18,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      InternedString,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SourcePaths kSourcePaths() { return {}; }
+  template <typename T = InternedString> T* add_source_paths() {
+    return BeginNestedMessage<T>(18);
+  }
+
+
+  using FieldMetadata_FunctionNames =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      InternedString,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FunctionNames kFunctionNames() { return {}; }
+  template <typename T = InternedString> T* add_function_names() {
+    return BeginNestedMessage<T>(5);
+  }
+
+
+  using FieldMetadata_ProfiledFrameSymbols =
+    ::protozero::proto_utils::FieldMetadata<
+      21,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ProfiledFrameSymbols,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProfiledFrameSymbols kProfiledFrameSymbols() { return {}; }
+  template <typename T = ProfiledFrameSymbols> T* add_profiled_frame_symbols() {
+    return BeginNestedMessage<T>(21);
+  }
+
+
+  using FieldMetadata_Mappings =
+    ::protozero::proto_utils::FieldMetadata<
+      19,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Mapping,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mappings kMappings() { return {}; }
+  template <typename T = Mapping> T* add_mappings() {
+    return BeginNestedMessage<T>(19);
+  }
+
+
+  using FieldMetadata_Frames =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Frame,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Frames kFrames() { return {}; }
+  template <typename T = Frame> T* add_frames() {
+    return BeginNestedMessage<T>(6);
+  }
+
+
+  using FieldMetadata_Callstacks =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Callstack,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Callstacks kCallstacks() { return {}; }
+  template <typename T = Callstack> T* add_callstacks() {
+    return BeginNestedMessage<T>(7);
+  }
+
+
+  using FieldMetadata_VulkanMemoryKeys =
+    ::protozero::proto_utils::FieldMetadata<
+      22,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      InternedString,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_VulkanMemoryKeys kVulkanMemoryKeys() { return {}; }
+  template <typename T = InternedString> T* add_vulkan_memory_keys() {
+    return BeginNestedMessage<T>(22);
+  }
+
+
+  using FieldMetadata_GraphicsContexts =
+    ::protozero::proto_utils::FieldMetadata<
+      23,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      InternedGraphicsContext,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GraphicsContexts kGraphicsContexts() { return {}; }
+  template <typename T = InternedGraphicsContext> T* add_graphics_contexts() {
+    return BeginNestedMessage<T>(23);
+  }
+
+
+  using FieldMetadata_GpuSpecifications =
+    ::protozero::proto_utils::FieldMetadata<
+      24,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      InternedGpuRenderStageSpecification,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GpuSpecifications kGpuSpecifications() { return {}; }
+  template <typename T = InternedGpuRenderStageSpecification> T* add_gpu_specifications() {
+    return BeginNestedMessage<T>(24);
+  }
+
+
+  using FieldMetadata_KernelSymbols =
+    ::protozero::proto_utils::FieldMetadata<
+      26,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      InternedString,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_KernelSymbols kKernelSymbols() { return {}; }
+  template <typename T = InternedString> T* add_kernel_symbols() {
+    return BeginNestedMessage<T>(26);
+  }
+
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_INTERNAL_TRACK_EVENT_INTERNAL_H_
+#define INCLUDE_PERFETTO_TRACING_INTERNAL_TRACK_EVENT_INTERNAL_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/flat_set.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/forward_decls.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/data_source.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/debug_annotation.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/trace_writer_base.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/traced_value.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/track.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/builtin_clock.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/interned_data/interned_data.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/track_event.pbzero.h"
+
+#include <unordered_map>
+
+namespace perfetto {
+class EventContext;
+class TrackEventSessionObserver;
+struct Category;
+namespace protos {
+namespace gen {
+class TrackEventConfig;
+}  // namespace gen
+namespace pbzero {
+class DebugAnnotation;
+}  // namespace pbzero
+}  // namespace protos
+
+// A callback interface for observing track event tracing sessions starting and
+// stopping. See TrackEvent::{Add,Remove}SessionObserver. Note that all methods
+// will be called on an internal Perfetto thread.
+class PERFETTO_EXPORT TrackEventSessionObserver {
+ public:
+  virtual ~TrackEventSessionObserver();
+  // Called when a track event tracing session is configured. Note tracing isn't
+  // active yet, so track events emitted here won't be recorded. See
+  // DataSourceBase::OnSetup.
+  virtual void OnSetup(const DataSourceBase::SetupArgs&);
+  // Called when a track event tracing session is started. It is possible to
+  // emit track events from this callback.
+  virtual void OnStart(const DataSourceBase::StartArgs&);
+  // Called when a track event tracing session is stopped. It is still possible
+  // to emit track events from this callback.
+  virtual void OnStop(const DataSourceBase::StopArgs&);
+};
+
+namespace internal {
+class TrackEventCategoryRegistry;
+
+class PERFETTO_EXPORT BaseTrackEventInternedDataIndex {
+ public:
+  virtual ~BaseTrackEventInternedDataIndex();
+
+#if PERFETTO_DCHECK_IS_ON()
+  const char* type_id_ = nullptr;
+  const void* add_function_ptr_ = nullptr;
+#endif  // PERFETTO_DCHECK_IS_ON()
+};
+
+struct TrackEventIncrementalState {
+  static constexpr size_t kMaxInternedDataFields = 32;
+
+  bool was_cleared = true;
+
+  // A heap-allocated message for storing newly seen interned data while we are
+  // in the middle of writing a track event. When a track event wants to write
+  // new interned data into the trace, it is first serialized into this message
+  // and then flushed to the real trace in EventContext when the packet ends.
+  // The message is cached here as a part of incremental state so that we can
+  // reuse the underlying buffer allocation for subsequently written interned
+  // data.
+  protozero::HeapBuffered<protos::pbzero::InternedData>
+      serialized_interned_data;
+
+  // In-memory indices for looking up interned data ids.
+  // For each intern-able field (up to a max of 32) we keep a dictionary of
+  // field-value -> interning-key. Depending on the type we either keep the full
+  // value or a hash of it (See track_event_interned_data_index.h)
+  using InternedDataIndex =
+      std::pair</* interned_data.proto field number */ size_t,
+                std::unique_ptr<BaseTrackEventInternedDataIndex>>;
+  std::array<InternedDataIndex, kMaxInternedDataFields> interned_data_indices =
+      {};
+
+  // Track uuids for which we have written descriptors into the trace. If a
+  // trace event uses a track which is not in this set, we'll write out a
+  // descriptor for it.
+  base::FlatSet<uint64_t> seen_tracks;
+
+  // Dynamically registered category names that have been encountered during
+  // this tracing session. The value in the map indicates whether the category
+  // is enabled or disabled.
+  std::unordered_map<std::string, bool> dynamic_categories;
+};
+
+// The backend portion of the track event trace point implemention. Outlined to
+// a separate .cc file so it can be shared by different track event category
+// namespaces.
+class PERFETTO_EXPORT TrackEventInternal {
+ public:
+  static bool Initialize(
+      const TrackEventCategoryRegistry&,
+      bool (*register_data_source)(const DataSourceDescriptor&));
+
+  static bool AddSessionObserver(TrackEventSessionObserver*);
+  static void RemoveSessionObserver(TrackEventSessionObserver*);
+
+  static void EnableTracing(const TrackEventCategoryRegistry& registry,
+                            const protos::gen::TrackEventConfig& config,
+                            const DataSourceBase::SetupArgs&);
+  static void OnStart(const DataSourceBase::StartArgs&);
+  static void DisableTracing(const TrackEventCategoryRegistry& registry,
+                             const DataSourceBase::StopArgs&);
+  static bool IsCategoryEnabled(const TrackEventCategoryRegistry& registry,
+                                const protos::gen::TrackEventConfig& config,
+                                const Category& category);
+
+  static perfetto::EventContext WriteEvent(
+      TraceWriterBase*,
+      TrackEventIncrementalState*,
+      const Category* category,
+      const char* name,
+      perfetto::protos::pbzero::TrackEvent::Type,
+      uint64_t timestamp = GetTimeNs());
+
+  static void ResetIncrementalState(TraceWriterBase*, uint64_t timestamp);
+
+  template <typename T>
+  static void AddDebugAnnotation(perfetto::EventContext* event_ctx,
+                                 const char* name,
+                                 T&& value) {
+    auto annotation = AddDebugAnnotation(event_ctx, name);
+    WriteIntoTracedValue(internal::CreateTracedValueFromProto(annotation),
+                         std::forward<T>(value));
+  }
+
+  // If the given track hasn't been seen by the trace writer yet, write a
+  // descriptor for it into the trace. Doesn't take a lock unless the track
+  // descriptor is new.
+  template <typename TrackType>
+  static void WriteTrackDescriptorIfNeeded(
+      const TrackType& track,
+      TraceWriterBase* trace_writer,
+      TrackEventIncrementalState* incr_state) {
+    auto it_and_inserted = incr_state->seen_tracks.insert(track.uuid);
+    if (PERFETTO_LIKELY(!it_and_inserted.second))
+      return;
+    WriteTrackDescriptor(track, trace_writer);
+  }
+
+  // Unconditionally write a track descriptor into the trace.
+  template <typename TrackType>
+  static void WriteTrackDescriptor(const TrackType& track,
+                                   TraceWriterBase* trace_writer) {
+    TrackRegistry::Get()->SerializeTrack(
+        track, NewTracePacket(trace_writer, GetTimeNs()));
+  }
+
+  // Get the current time in nanoseconds in the trace clock timebase.
+  static uint64_t GetTimeNs();
+
+  // Get the clock used by GetTimeNs().
+  static constexpr protos::pbzero::BuiltinClock GetClockId() {
+#if !PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE) && \
+    !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+    return protos::pbzero::BUILTIN_CLOCK_BOOTTIME;
+#else
+    return protos::pbzero::BUILTIN_CLOCK_MONOTONIC;
+#endif
+  }
+
+  static int GetSessionCount();
+
+  // Represents the default track for the calling thread.
+  static const Track kDefaultTrack;
+
+ private:
+  static protozero::MessageHandle<protos::pbzero::TracePacket> NewTracePacket(
+      TraceWriterBase*,
+      uint64_t timestamp,
+      uint32_t seq_flags =
+          protos::pbzero::TracePacket::SEQ_NEEDS_INCREMENTAL_STATE);
+  static protos::pbzero::DebugAnnotation* AddDebugAnnotation(
+      perfetto::EventContext*,
+      const char* name);
+
+  static std::atomic<int> session_count_;
+};
+
+}  // namespace internal
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_INTERNAL_TRACK_EVENT_INTERNAL_H_
+// gen_amalgamated begin header: include/perfetto/tracing/traced_proto.h
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_TRACED_PROTO_H_
+#define INCLUDE_PERFETTO_TRACING_TRACED_PROTO_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/template_util.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+class EventContext;
+
+// A Wrapper around a protozero message to allow C++ classes to specify how it
+// should be serialised into the trace:
+//
+// class Foo {
+//  public:
+//   void WriteIntoTrace(perfetto::TracedProto<pbzero::Foo> message) {
+//     message->set_int_field(int_field_);
+//   }
+// };
+//
+// This class also exposes EventContext, e.g. to enable data interning.
+//
+// NOTE: the functionality below is not ready yet.
+// TODO(altimin): Make the interop below possible.
+// TracedProto also provides a seamless integration with writing untyped
+// values via TracedValue / TracedDictionary / TracedArray:
+//
+// - TracedValue can be converted to a TracedProto, either by calling
+//   TracedValue::WriteProto<T>() or implicitly.
+// - If a proto message has a repeating DebugAnnotation debug_annotations
+//   field, it can be filled using the TracedDictionary obtained from
+//   TracedProto::WriteDebugAnnotations.
+template <typename MessageType>
+class TracedProto {
+ public:
+  TracedProto(const TracedProto&) = delete;
+  TracedProto& operator=(const TracedProto&) = delete;
+  TracedProto& operator=(TracedProto&&) = delete;
+  TracedProto(TracedProto&&) = default;
+  ~TracedProto() = default;
+
+  MessageType* operator->() const { return message_; }
+
+  MessageType* message() { return message_; }
+
+  EventContext& context() const { return context_; }
+
+ private:
+  friend class EventContext;
+
+  TracedProto(MessageType* message, EventContext& context)
+      : message_(message), context_(context) {}
+
+  MessageType* const message_;
+  EventContext& context_;
+};
+
+namespace internal {
+
+// TypedProtoWriter takes the protozero message (TracedProto<MessageType>),
+// field description (FieldMetadata) and value and writes the given value
+// into the given field of the given protozero message.
+//
+// This is primarily used for inline writing of typed messages:
+// TRACE_EVENT(..., pbzero::Message:kField, value);
+//
+// Ideally we would use a function here and not a struct, but passing template
+// arguments directly to the function (e.g. foo<void>()) isn't supported until
+// C++20, so we have to use a helper struct here.
+template <typename FieldMetadata>
+struct TypedProtoWriter {
+ private:
+  using ProtoSchemaType = protozero::proto_utils::ProtoSchemaType;
+  using RepetitionType = protozero::proto_utils::RepetitionType;
+
+  static_assert(FieldMetadata::kRepetitionType !=
+                    RepetitionType::kRepeatedPacked,
+                "writing packed fields isn't supported yet");
+
+ public:
+  // Implementation note: typename Check=void is used to ensure that SFINAE
+  // kicks in and the methods which do not match FieldMetadata do not fail
+  // to compile. std::is_same<Check,void> prevents early evaluation of the
+  // first enable_if_t argument.
+
+  // Simple non-repeated field.
+  template <typename Proto, typename ValueType, typename Check = void>
+  static typename base::enable_if_t<
+      FieldMetadata::kProtoFieldType != ProtoSchemaType::kMessage &&
+      FieldMetadata::kRepetitionType == RepetitionType::kNotRepeated &&
+      std::is_same<Check, void>::value>
+  Write(TracedProto<Proto> context, ValueType&& value) {
+    protozero::internal::FieldWriter<FieldMetadata::kProtoFieldType>::Append(
+        *context.message(), FieldMetadata::kFieldId, value);
+  }
+
+  // Simple repeated non-packed field.
+  template <typename Proto, typename ValueType, typename Check = void>
+  static typename base::enable_if_t<
+      FieldMetadata::kProtoFieldType != ProtoSchemaType::kMessage &&
+      FieldMetadata::kRepetitionType == RepetitionType::kRepeatedNotPacked &&
+      std::is_same<Check, void>::value>
+  Write(TracedProto<Proto> context, ValueType&& value) {
+    for (auto&& item : value) {
+      protozero::internal::FieldWriter<FieldMetadata::kProtoFieldType>::Append(
+          *context.message(), FieldMetadata::kFieldId, item);
+    }
+  }
+
+  // Nested non-repeated field.
+  template <typename Proto, typename ValueType, typename Check = void>
+  static typename base::enable_if_t<
+      FieldMetadata::kProtoFieldType == ProtoSchemaType::kMessage &&
+      FieldMetadata::kRepetitionType == RepetitionType::kNotRepeated &&
+      std::is_same<Check, void>::value>
+  Write(TracedProto<Proto> context, ValueType&& value) {
+    // TODO(altimin): support TraceFormatTraits here.
+    value.WriteIntoTrace(
+        context.context().Wrap(context.message()
+                                   ->template BeginNestedMessage<
+                                       typename FieldMetadata::cpp_field_type>(
+                                       FieldMetadata::kFieldId)));
+  }
+
+  // Nested repeated non-packed field.
+  template <typename Proto, typename ValueType, typename Check = void>
+  static typename base::enable_if_t<
+      FieldMetadata::kProtoFieldType == ProtoSchemaType::kMessage &&
+      FieldMetadata::kRepetitionType == RepetitionType::kRepeatedNotPacked &&
+      std::is_same<Check, void>::value>
+  Write(TracedProto<Proto> context, ValueType&& value) {
+    // TODO(altimin): support TraceFormatTraits here.
+    for (auto&& item : value) {
+      item.WriteIntoTrace(context.context().Wrap(
+          context.message()
+              ->template BeginNestedMessage<
+                  typename FieldMetadata::cpp_field_type>(
+                  FieldMetadata::kFieldId)));
+    }
+  }
+};
+
+}  // namespace internal
+
+template <typename MessageType, typename FieldMetadataType, typename ValueType>
+void WriteIntoTracedProto(
+    TracedProto<MessageType> message,
+    protozero::proto_utils::internal::FieldMetadataHelper<FieldMetadataType>,
+    ValueType&& value) {
+  static_assert(
+      std::is_base_of<protozero::proto_utils::FieldMetadataBase,
+                      FieldMetadataType>::value,
+      "Field name should be a protozero::internal::FieldMetadata<...>");
+  static_assert(
+      std::is_base_of<MessageType,
+                      typename FieldMetadataType::message_type>::value,
+      "Field's parent type should match the context.");
+
+  internal::TypedProtoWriter<FieldMetadataType>::Write(
+      std::move(message), std::forward<ValueType>(value));
+}
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_TRACED_PROTO_H_
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_EVENT_CONTEXT_H_
+#define INCLUDE_PERFETTO_TRACING_EVENT_CONTEXT_H_
+
+// gen_amalgamated expanded: #include "perfetto/protozero/message_handle.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/track_event_internal.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/traced_proto.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/trace_packet.pbzero.h"
+
+namespace perfetto {
+namespace internal {
+class TrackEventInternal;
+}
+
+// Allows adding custom arguments into track events. Example:
+//
+//   TRACE_EVENT_BEGIN("category", "Title",
+//                     [](perfetto::EventContext ctx) {
+//                       auto* dbg = ctx.event()->add_debug_annotations();
+//                       dbg->set_name("name");
+//                       dbg->set_int_value(1234);
+//                     });
+//
+class PERFETTO_EXPORT EventContext {
+ public:
+  EventContext(EventContext&&) = default;
+
+  // For Chromium during the transition phase to the client library.
+  // TODO(eseckler): Remove once Chromium has switched to client lib entirely.
+  explicit EventContext(
+      protos::pbzero::TrackEvent* event,
+      internal::TrackEventIncrementalState* incremental_state = nullptr)
+      : event_(event), incremental_state_(incremental_state) {}
+
+  ~EventContext();
+
+  // Get a TrackEvent message to write typed arguments to.
+  //
+  // event() is a template method to allow callers to specify a subclass of
+  // TrackEvent instead. Those subclasses correspond to TrackEvent message with
+  // application-specific extensions. More information in
+  // design-docs/extensions.md.
+  template <typename EventType = protos::pbzero::TrackEvent>
+  EventType* event() const {
+    // As the method does downcasting, we check that a target subclass does
+    // not add new fields.
+    static_assert(
+        sizeof(EventType) == sizeof(protos::pbzero::TrackEvent),
+        "Event type must be binary-compatible with protos::pbzero::TrackEvent");
+    return static_cast<EventType*>(event_);
+  }
+
+  // Convert a raw pointer to protozero message to TracedProto which captures
+  // the reference to this EventContext.
+  template <typename MessageType>
+  TracedProto<MessageType> Wrap(MessageType* message) {
+    static_assert(std::is_base_of<protozero::Message, MessageType>::value,
+                  "TracedProto can be used only with protozero messages");
+
+    return TracedProto<MessageType>(message, *this);
+  }
+
+ private:
+  template <typename, size_t, typename, typename>
+  friend class TrackEventInternedDataIndex;
+  friend class internal::TrackEventInternal;
+
+  using TracePacketHandle =
+      ::protozero::MessageHandle<protos::pbzero::TracePacket>;
+
+  EventContext(TracePacketHandle, internal::TrackEventIncrementalState*);
+  EventContext(const EventContext&) = delete;
+
+  TracePacketHandle trace_packet_;
+  protos::pbzero::TrackEvent* event_;
+  internal::TrackEventIncrementalState* incremental_state_;
+};
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_EVENT_CONTEXT_H_
+// gen_amalgamated begin header: include/perfetto/tracing/internal/write_track_event_args.h
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_INTERNAL_WRITE_TRACK_EVENT_ARGS_H_
+#define INCLUDE_PERFETTO_TRACING_INTERNAL_WRITE_TRACK_EVENT_ARGS_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/compiler.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/event_context.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/traced_proto.h"
+
+namespace perfetto {
+namespace internal {
+
+// Helper function handling filling provided |EventContext| from the provided
+// arguments, which include:
+// - Lambda functions,
+// - Debug annotations.
+//
+// TRACE_EVENT parameters which do not translate to directly writing something
+// into TrackEvent proto (like tracks and timestamps are _not_ covered by this
+// function).
+template <typename... Args, typename TypeCheck = void>
+void WriteTrackEventArgs(EventContext event_context, Args&&... args);
+
+// No arguments means that we don't have to write anything.
+template <>
+PERFETTO_ALWAYS_INLINE inline void WriteTrackEventArgs(EventContext) {}
+
+namespace {
+
+// A template helper for determining whether a type can be used as a track event
+// lambda, i.e., it has the signature "void(EventContext)". This is achieved by
+// checking that we can pass an EventContext value (the inner declval) into a T
+// instance (the outer declval). If this is a valid expression, the result
+// evaluates to sizeof(0), i.e., true.
+// TODO(skyostil): Replace this with std::is_convertible<std::function<...>>
+// once we have C++14.
+template <typename T>
+static constexpr bool IsValidTraceLambdaImpl(
+    typename std::enable_if<static_cast<bool>(
+        sizeof(std::declval<T>()(std::declval<EventContext>()), 0))>::type* =
+        nullptr) {
+  return true;
+}
+
+template <typename T>
+static constexpr bool IsValidTraceLambdaImpl(...) {
+  return false;
+}
+
+template <typename T>
+static constexpr bool IsValidTraceLambda() {
+  return IsValidTraceLambdaImpl<T>(nullptr);
+}
+
+}  // namespace
+
+// Write a lambda.
+// TODO(altimin): At the moment lambda takes EventContext, which is
+// non-copyable, so only one lambda is supported and it has to be the last
+// argument.
+template <typename ArgumentFunction,
+          typename ArgFunctionCheck = typename std::enable_if<
+              IsValidTraceLambda<ArgumentFunction>()>::type>
+PERFETTO_ALWAYS_INLINE void WriteTrackEventArgs(EventContext event_ctx,
+                                                ArgumentFunction arg_function) {
+  arg_function(std::move(event_ctx));
+}
+
+// Write one debug annotation and recursively write the rest of the arguments.
+template <typename ArgValue, typename... Args>
+PERFETTO_ALWAYS_INLINE void WriteTrackEventArgs(EventContext event_ctx,
+                                                const char* arg_name,
+                                                ArgValue&& arg_value,
+                                                Args&&... args) {
+  TrackEventInternal::AddDebugAnnotation(&event_ctx, arg_name,
+                                         std::forward<ArgValue>(arg_value));
+  WriteTrackEventArgs(std::move(event_ctx), std::forward<Args>(args)...);
+}
+
+// Write one typed message and recursively write the rest of the arguments.
+template <typename FieldMetadataType,
+          typename ArgValue,
+          typename... Args,
+          typename Check = base::enable_if_t<
+              std::is_base_of<protozero::proto_utils::FieldMetadataBase,
+                              FieldMetadataType>::value>>
+PERFETTO_ALWAYS_INLINE void WriteTrackEventArgs(
+    EventContext event_ctx,
+    protozero::proto_utils::internal::FieldMetadataHelper<FieldMetadataType>
+        field_name,
+    ArgValue&& arg_value,
+    Args&&... args) {
+  static_assert(
+      std::is_base_of<protos::pbzero::TrackEvent,
+                      typename FieldMetadataType::message_type>::value,
+      "Only fields of TrackEvent (and TrackEvent's extensions) can "
+      "be passed to TRACE_EVENT");
+  WriteIntoTracedProto(
+      event_ctx.Wrap(
+          event_ctx.event<typename FieldMetadataType::message_type>()),
+      field_name, std::forward<ArgValue>(arg_value));
+  WriteTrackEventArgs(std::move(event_ctx), std::forward<Args>(args)...);
+}
+
+}  // namespace internal
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_INTERNAL_WRITE_TRACK_EVENT_ARGS_H_
+// gen_amalgamated begin header: include/perfetto/tracing/track_event_category_registry.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_TRACK_EVENT_CATEGORY_REGISTRY_H_
+#define INCLUDE_PERFETTO_TRACING_TRACK_EVENT_CATEGORY_REGISTRY_H_
+
+// gen_amalgamated expanded: #include "perfetto/tracing/data_source.h"
+
+#include <stddef.h>
+
+#include <atomic>
+#include <utility>
+
+namespace perfetto {
+class DynamicCategory;
+
+// A compile-time representation of a track event category. See
+// PERFETTO_DEFINE_CATEGORIES for registering your own categories.
+struct PERFETTO_EXPORT Category {
+  using Tags = std::array<const char*, 4>;
+
+  const char* const name = nullptr;
+  const char* const description = nullptr;
+  const Tags tags = {};
+
+  constexpr Category(const Category&) = default;
+  constexpr explicit Category(const char* name_)
+      : name(CheckIsValidCategory(name_)),
+        name_sizes_(ComputeNameSizes(name_)) {}
+
+  constexpr Category SetDescription(const char* description_) const {
+    return Category(name, description_, tags, name_sizes_);
+  }
+
+  template <typename... Args>
+  constexpr Category SetTags(Args&&... args) const {
+    return Category(name, description, {std::forward<Args>(args)...},
+                    name_sizes_);
+  }
+
+  // A comma separated list of multiple categories to be used in a single trace
+  // point.
+  static constexpr Category Group(const char* names) {
+    return Category(names, AllowGroup{});
+  }
+
+  // Used for parsing dynamic category groups. Note that |name| and
+  // |DynamicCategory| must outlive the returned object because the category
+  // name isn't copied.
+  static Category FromDynamicCategory(const char* name);
+  static Category FromDynamicCategory(const DynamicCategory&);
+
+  constexpr bool IsGroup() const { return GetNameSize(1) > 0; }
+
+  // Returns the number of character in the category name. Not valid for
+  // category groups.
+  size_t name_size() const {
+    PERFETTO_DCHECK(!IsGroup());
+    return GetNameSize(0);
+  }
+
+  // Iterates over all the members of this category group, or just the name of
+  // the category itself if this isn't a category group. Return false from
+  // |callback| to stop iteration.
+  template <typename T>
+  void ForEachGroupMember(T callback) const {
+    const char* name_ptr = name;
+    size_t i = 0;
+    while (size_t name_size = GetNameSize(i++)) {
+      if (!callback(name_ptr, name_size))
+        break;
+      name_ptr += name_size + 1;
+    }
+  }
+
+ private:
+  static constexpr size_t kMaxGroupSize = 4;
+  using NameSizes = std::array<uint8_t, kMaxGroupSize>;
+
+  constexpr Category(const char* name_,
+                     const char* description_,
+                     Tags tags_,
+                     NameSizes name_sizes)
+      : name(name_),
+        description(description_),
+        tags(tags_),
+        name_sizes_(name_sizes) {}
+
+  enum AllowGroup {};
+  constexpr Category(const char* name_, AllowGroup)
+      : name(CheckIsValidCategoryGroup(name_)),
+        name_sizes_(ComputeNameSizes(name_)) {}
+
+  constexpr size_t GetNameSize(size_t i) const {
+    return i < name_sizes_.size() ? name_sizes_[i] : 0;
+  }
+
+  static constexpr NameSizes ComputeNameSizes(const char* s) {
+    static_assert(kMaxGroupSize == 4, "Unexpected maximum category group size");
+    return NameSizes{{static_cast<uint8_t>(GetNthNameSize(0, s, s)),
+                      static_cast<uint8_t>(GetNthNameSize(1, s, s)),
+                      static_cast<uint8_t>(GetNthNameSize(2, s, s)),
+                      static_cast<uint8_t>(GetNthNameSize(3, s, s))}};
+  }
+
+  static constexpr ptrdiff_t GetNthNameSize(int n,
+                                            const char* start,
+                                            const char* end,
+                                            int counter = 0) {
+    return (!*end || *end == ',')
+               ? ((!*end || counter == n)
+                      ? (counter == n ? end - start : 0)
+                      : GetNthNameSize(n, end + 1, end + 1, counter + 1))
+               : GetNthNameSize(n, start, end + 1, counter);
+  }
+
+  static constexpr const char* CheckIsValidCategory(const char* n) {
+    // We just replace invalid input with a nullptr here; it will trigger a
+    // static assert in TrackEventCategoryRegistry::ValidateCategories().
+    return GetNthNameSize(1, n, n) ? nullptr : n;
+  }
+
+  static constexpr const char* CheckIsValidCategoryGroup(const char* n) {
+    // Same as above: replace invalid input with nullptr.
+    return !GetNthNameSize(1, n, n) || GetNthNameSize(kMaxGroupSize, n, n)
+               ? nullptr
+               : n;
+  }
+
+  // An array of lengths of the different names associated with this category.
+  // If this category doesn't represent a group of multiple categories, only the
+  // first element is non-zero.
+  const NameSizes name_sizes_ = {};
+};
+
+// Dynamically constructed category names should marked as such through this
+// container type to make it less likely for trace points to accidentally start
+// using dynamic categories. Events with dynamic categories will always be
+// slightly more expensive than regular events, so use them sparingly.
+class PERFETTO_EXPORT DynamicCategory final {
+ public:
+  explicit DynamicCategory(const std::string& name_) : name(name_) {}
+  explicit DynamicCategory(const char* name_) : name(name_) {}
+  DynamicCategory() {}
+  ~DynamicCategory() = default;
+
+  const std::string name;
+};
+
+namespace internal {
+
+constexpr const char* NullCategory(const char*) {
+  return nullptr;
+}
+
+perfetto::DynamicCategory NullCategory(const perfetto::DynamicCategory&);
+
+constexpr bool StringMatchesPrefix(const char* str, const char* prefix) {
+  return !*str ? !*prefix
+               : !*prefix ? true
+                          : *str != *prefix
+                                ? false
+                                : StringMatchesPrefix(str + 1, prefix + 1);
+}
+
+constexpr bool IsStringInPrefixList(const char*) {
+  return false;
+}
+
+template <typename... Args>
+constexpr bool IsStringInPrefixList(const char* str,
+                                    const char* prefix,
+                                    Args... args) {
+  return StringMatchesPrefix(str, prefix) ||
+         IsStringInPrefixList(str, std::forward<Args>(args)...);
+}
+
+// Holds all the registered categories for one category namespace. See
+// PERFETTO_DEFINE_CATEGORIES for building the registry.
+class PERFETTO_EXPORT TrackEventCategoryRegistry {
+ public:
+  constexpr TrackEventCategoryRegistry(size_t category_count,
+                                       const Category* categories,
+                                       std::atomic<uint8_t>* state_storage)
+      : categories_(categories),
+        category_count_(category_count),
+        state_storage_(state_storage) {
+    static_assert(
+        sizeof(state_storage[0].load()) * 8 >= kMaxDataSourceInstances,
+        "The category state must have enough bits for all possible data source "
+        "instances");
+  }
+
+  size_t category_count() const { return category_count_; }
+
+  // Returns a category based on its index.
+  const Category* GetCategory(size_t index) const {
+    PERFETTO_DCHECK(index < category_count_);
+    return &categories_[index];
+  }
+
+  // Turn tracing on or off for the given category in a track event data source
+  // instance.
+  void EnableCategoryForInstance(size_t category_index,
+                                 uint32_t instance_index) const;
+  void DisableCategoryForInstance(size_t category_index,
+                                  uint32_t instance_index) const;
+
+  constexpr std::atomic<uint8_t>* GetCategoryState(
+      size_t category_index) const {
+    return &state_storage_[category_index];
+  }
+
+  // --------------------------------------------------------------------------
+  // Trace point support
+  // --------------------------------------------------------------------------
+  //
+  // (The following methods are used by the track event trace point
+  // implementation and typically don't need to be called by other code.)
+
+  // At compile time, turn a category name into an index into the registry.
+  // Returns kInvalidCategoryIndex if the category was not found, or
+  // kDynamicCategoryIndex if |is_dynamic| is true or a DynamicCategory was
+  // passed in.
+  static constexpr size_t kInvalidCategoryIndex = static_cast<size_t>(-1);
+  static constexpr size_t kDynamicCategoryIndex = static_cast<size_t>(-2);
+  constexpr size_t Find(const char* name, bool is_dynamic) const {
+    return CheckIsValidCategoryIndex(FindImpl(name, is_dynamic));
+  }
+
+  constexpr size_t Find(const DynamicCategory&, bool) const {
+    return kDynamicCategoryIndex;
+  }
+
+  constexpr bool ValidateCategories(size_t index = 0) const {
+    return (index == category_count_)
+               ? true
+               : IsValidCategoryName(categories_[index].name)
+                     ? ValidateCategories(index + 1)
+                     : false;
+  }
+
+ private:
+  // TODO(skyostil): Make the compile-time routines nicer with C++14.
+  constexpr size_t FindImpl(const char* name,
+                            bool is_dynamic,
+                            size_t index = 0) const {
+    return is_dynamic ? kDynamicCategoryIndex
+                      : (index == category_count_)
+                            ? kInvalidCategoryIndex
+                            : StringEq(categories_[index].name, name)
+                                  ? index
+                                  : FindImpl(name, false, index + 1);
+  }
+
+  // A compile time helper for checking that a category index is valid.
+  static constexpr size_t CheckIsValidCategoryIndex(size_t index) {
+    // Relies on PERFETTO_CHECK() (and the surrounding lambda) being a
+    // non-constexpr function, which will fail the build if the given |index| is
+    // invalid. The funny formatting here is so that clang shows the comment
+    // below as part of the error message.
+    // clang-format off
+    return index != kInvalidCategoryIndex ? index : \
+        /* Invalid category -- add it to PERFETTO_DEFINE_CATEGORIES(). */ [] {
+        PERFETTO_CHECK(
+            false &&
+            "A track event used an unknown category. Please add it to "
+            "PERFETTO_DEFINE_CATEGORIES().");
+        return kInvalidCategoryIndex;
+      }();
+    // clang-format on
+  }
+
+  static constexpr bool IsValidCategoryName(const char* name) {
+    return (!name || *name == '\"' || *name == '*' || *name == ' ')
+               ? false
+               : *name ? IsValidCategoryName(name + 1) : true;
+  }
+
+  static constexpr bool StringEq(const char* a, const char* b) {
+    return *a != *b ? false
+                    : (!*a || !*b) ? (*a == *b) : StringEq(a + 1, b + 1);
+  }
+
+  const Category* const categories_;
+  const size_t category_count_;
+  std::atomic<uint8_t>* const state_storage_;
+};
+
+}  // namespace internal
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_TRACK_EVENT_CATEGORY_REGISTRY_H_
+// gen_amalgamated begin header: gen/protos/perfetto/config/track_event/track_event_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACK_EVENT_TRACK_EVENT_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACK_EVENT_TRACK_EVENT_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class TrackEventConfig;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT TrackEventConfig : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDisabledCategoriesFieldNumber = 1,
+    kEnabledCategoriesFieldNumber = 2,
+    kDisabledTagsFieldNumber = 3,
+    kEnabledTagsFieldNumber = 4,
+  };
+
+  TrackEventConfig();
+  ~TrackEventConfig() override;
+  TrackEventConfig(TrackEventConfig&&) noexcept;
+  TrackEventConfig& operator=(TrackEventConfig&&);
+  TrackEventConfig(const TrackEventConfig&);
+  TrackEventConfig& operator=(const TrackEventConfig&);
+  bool operator==(const TrackEventConfig&) const;
+  bool operator!=(const TrackEventConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<std::string>& disabled_categories() const { return disabled_categories_; }
+  std::vector<std::string>* mutable_disabled_categories() { return &disabled_categories_; }
+  int disabled_categories_size() const { return static_cast<int>(disabled_categories_.size()); }
+  void clear_disabled_categories() { disabled_categories_.clear(); }
+  void add_disabled_categories(std::string value) { disabled_categories_.emplace_back(value); }
+  std::string* add_disabled_categories() { disabled_categories_.emplace_back(); return &disabled_categories_.back(); }
+
+  const std::vector<std::string>& enabled_categories() const { return enabled_categories_; }
+  std::vector<std::string>* mutable_enabled_categories() { return &enabled_categories_; }
+  int enabled_categories_size() const { return static_cast<int>(enabled_categories_.size()); }
+  void clear_enabled_categories() { enabled_categories_.clear(); }
+  void add_enabled_categories(std::string value) { enabled_categories_.emplace_back(value); }
+  std::string* add_enabled_categories() { enabled_categories_.emplace_back(); return &enabled_categories_.back(); }
+
+  const std::vector<std::string>& disabled_tags() const { return disabled_tags_; }
+  std::vector<std::string>* mutable_disabled_tags() { return &disabled_tags_; }
+  int disabled_tags_size() const { return static_cast<int>(disabled_tags_.size()); }
+  void clear_disabled_tags() { disabled_tags_.clear(); }
+  void add_disabled_tags(std::string value) { disabled_tags_.emplace_back(value); }
+  std::string* add_disabled_tags() { disabled_tags_.emplace_back(); return &disabled_tags_.back(); }
+
+  const std::vector<std::string>& enabled_tags() const { return enabled_tags_; }
+  std::vector<std::string>* mutable_enabled_tags() { return &enabled_tags_; }
+  int enabled_tags_size() const { return static_cast<int>(enabled_tags_.size()); }
+  void clear_enabled_tags() { enabled_tags_.clear(); }
+  void add_enabled_tags(std::string value) { enabled_tags_.emplace_back(value); }
+  std::string* add_enabled_tags() { enabled_tags_.emplace_back(); return &enabled_tags_.back(); }
+
+ private:
+  std::vector<std::string> disabled_categories_;
+  std::vector<std::string> enabled_categories_;
+  std::vector<std::string> disabled_tags_;
+  std::vector<std::string> enabled_tags_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<5> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACK_EVENT_TRACK_EVENT_CONFIG_PROTO_CPP_H_
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_INTERNAL_TRACK_EVENT_DATA_SOURCE_H_
+#define INCLUDE_PERFETTO_TRACING_INTERNAL_TRACK_EVENT_DATA_SOURCE_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/compiler.h"
+// gen_amalgamated expanded: #include "perfetto/base/template_util.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message_handle.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/data_source_config.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/data_source.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/event_context.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/track_event_internal.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/write_track_event_args.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/track.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/track_event_category_registry.h"
+// gen_amalgamated expanded: #include "protos/perfetto/common/builtin_clock.pbzero.h"
+// gen_amalgamated expanded: #include "protos/perfetto/config/track_event/track_event_config.gen.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/track_event.pbzero.h"
+
+#include <type_traits>
+
+namespace perfetto {
+
+struct TraceTimestamp {
+  protos::pbzero::BuiltinClock clock_id;
+  uint64_t nanoseconds;
+};
+
+// This template provides a way to convert an abstract timestamp into the trace
+// clock timebase in nanoseconds. By specialising this template and defining
+// static ConvertTimestampToTraceTimeNs function in it the user can register
+// additional timestamp types. The return value should specify the clock used by
+// the timestamp as well as its value in nanoseconds.
+//
+// The users should see the specialisation for uint64_t below as an example.
+// Note that the specialisation should be defined in perfetto namespace.
+template <typename T>
+struct TraceTimestampTraits;
+
+// A pass-through implementation for raw uint64_t nanosecond timestamps.
+template <>
+struct TraceTimestampTraits<uint64_t> {
+  static inline TraceTimestamp ConvertTimestampToTraceTimeNs(
+      const uint64_t& timestamp) {
+    return {internal::TrackEventInternal::GetClockId(), timestamp};
+  }
+};
+
+namespace internal {
+namespace {
+
+// Checks if |T| is a valid track.
+template <typename T>
+static constexpr bool IsValidTrack() {
+  return std::is_convertible<T, Track>::value;
+}
+
+// Checks if |T| is a valid non-counter track.
+template <typename T>
+static constexpr bool IsValidNormalTrack() {
+  return std::is_convertible<T, Track>::value &&
+         !std::is_convertible<T, CounterTrack>::value;
+}
+
+// Because the user can use arbitrary timestamp types, we can't compare against
+// any known base type here. Instead, we check that a track or a trace lambda
+// isn't being interpreted as a timestamp.
+template <typename T,
+          typename CanBeConvertedToNsCheck = decltype(
+              ::perfetto::TraceTimestampTraits<typename base::remove_cvref_t<
+                  T>>::ConvertTimestampToTraceTimeNs(std::declval<T>())),
+          typename NotTrackCheck =
+              typename std::enable_if<!IsValidNormalTrack<T>()>::type,
+          typename NotLambdaCheck =
+              typename std::enable_if<!IsValidTraceLambda<T>()>::type>
+static constexpr bool IsValidTimestamp() {
+  return true;
+}
+
+}  // namespace
+
+// Traits for dynamic categories.
+template <typename CategoryType>
+struct CategoryTraits {
+  static constexpr bool kIsDynamic = true;
+  static constexpr const Category* GetStaticCategory(
+      const TrackEventCategoryRegistry*,
+      const CategoryType&) {
+    return nullptr;
+  }
+  static size_t GetStaticIndex(const CategoryType&) {
+    PERFETTO_DCHECK(false);  // Not reached.
+    return TrackEventCategoryRegistry::kDynamicCategoryIndex;
+  }
+  static DynamicCategory GetDynamicCategory(const CategoryType& category) {
+    return DynamicCategory{category};
+  }
+};
+
+// Traits for static categories.
+template <>
+struct CategoryTraits<size_t> {
+  static constexpr bool kIsDynamic = false;
+  static const Category* GetStaticCategory(
+      const TrackEventCategoryRegistry* registry,
+      size_t category_index) {
+    return registry->GetCategory(category_index);
+  }
+  static constexpr size_t GetStaticIndex(size_t category_index) {
+    return category_index;
+  }
+  static DynamicCategory GetDynamicCategory(size_t) {
+    PERFETTO_DCHECK(false);  // Not reached.
+    return DynamicCategory();
+  }
+};
+
+struct TrackEventDataSourceTraits : public perfetto::DefaultDataSourceTraits {
+  using IncrementalStateType = TrackEventIncrementalState;
+
+  // Use a one shared TLS slot so that all track event data sources write into
+  // the same sequence and share interning dictionaries.
+  static DataSourceThreadLocalState* GetDataSourceTLS(DataSourceStaticState*,
+                                                      TracingTLS* root_tls) {
+    return &root_tls->track_event_tls;
+  }
+};
+
+// A generic track event data source which is instantiated once per track event
+// category namespace.
+template <typename DataSourceType, const TrackEventCategoryRegistry* Registry>
+class TrackEventDataSource
+    : public DataSource<DataSourceType, TrackEventDataSourceTraits> {
+  using Base = DataSource<DataSourceType, TrackEventDataSourceTraits>;
+
+ public:
+  // Add or remove a session observer for this track event data source. The
+  // observer will be notified about started and stopped tracing sessions.
+  // Returns |true| if the observer was succesfully added (i.e., the maximum
+  // number of observers wasn't exceeded).
+  static bool AddSessionObserver(TrackEventSessionObserver* observer) {
+    return TrackEventInternal::AddSessionObserver(observer);
+  }
+
+  static void RemoveSessionObserver(TrackEventSessionObserver* observer) {
+    TrackEventInternal::RemoveSessionObserver(observer);
+  }
+
+  // DataSource implementation.
+  void OnSetup(const DataSourceBase::SetupArgs& args) override {
+    auto config_raw = args.config->track_event_config_raw();
+    bool ok = config_.ParseFromArray(config_raw.data(), config_raw.size());
+    PERFETTO_DCHECK(ok);
+    TrackEventInternal::EnableTracing(*Registry, config_, args);
+  }
+
+  void OnStart(const DataSourceBase::StartArgs& args) override {
+    TrackEventInternal::OnStart(args);
+  }
+
+  void OnStop(const DataSourceBase::StopArgs& args) override {
+    TrackEventInternal::DisableTracing(*Registry, args);
+  }
+
+  static void Flush() {
+    Base::template Trace([](typename Base::TraceContext ctx) { ctx.Flush(); });
+  }
+
+  // Determine if *any* tracing category is enabled.
+  static bool IsEnabled() {
+    bool enabled = false;
+    Base::template CallIfEnabled(
+        [&](uint32_t /*instances*/) { enabled = true; });
+    return enabled;
+  }
+
+  // Determine if tracing for the given static category is enabled.
+  static bool IsCategoryEnabled(size_t category_index) {
+    return Registry->GetCategoryState(category_index)
+        ->load(std::memory_order_relaxed);
+  }
+
+  // Determine if tracing for the given dynamic category is enabled.
+  static bool IsDynamicCategoryEnabled(
+      const DynamicCategory& dynamic_category) {
+    bool enabled = false;
+    Base::template Trace([&](typename Base::TraceContext ctx) {
+      enabled = IsDynamicCategoryEnabled(&ctx, dynamic_category);
+    });
+    return enabled;
+  }
+
+  // This is the inlined entrypoint for all track event trace points. It tries
+  // to be as lightweight as possible in terms of instructions and aims to
+  // compile down to an unlikely conditional jump to the actual trace writing
+  // function.
+  template <typename Callback>
+  static void CallIfCategoryEnabled(size_t category_index,
+                                    Callback callback) PERFETTO_ALWAYS_INLINE {
+    Base::template CallIfEnabled<CategoryTracePointTraits>(
+        [&callback](uint32_t instances) { callback(instances); },
+        {category_index});
+  }
+
+  // Once we've determined tracing to be enabled for this category, actually
+  // write a trace event onto this thread's default track. Outlined to avoid
+  // bloating code (mostly stack depth) at the actual trace point.
+  //
+  // The following combination of parameters is supported (in the given order):
+  // - Zero or one track,
+  // - Zero or one custom timestamp,
+  // - Arbitrary number of debug annotations.
+  // - Zero or one lambda.
+
+  // Trace point which does not take a track or timestamp.
+  template <typename CategoryType, typename... Arguments>
+  static void TraceForCategory(uint32_t instances,
+                               const CategoryType& category,
+                               const char* event_name,
+                               perfetto::protos::pbzero::TrackEvent::Type type,
+                               Arguments&&... args) PERFETTO_NO_INLINE {
+    TraceForCategoryImpl(instances, category, event_name, type,
+                         TrackEventInternal::kDefaultTrack,
+                         TrackEventInternal::GetTimeNs(),
+                         std::forward<Arguments>(args)...);
+  }
+
+  // Trace point which takes a track, but not timestamp.
+  // NOTE: Here track should be captured using universal reference (TrackType&&)
+  // instead of const TrackType& to ensure that the proper overload is selected
+  // (otherwise the compiler will fail to disambiguate between adding const& and
+  // parsing track as a part of Arguments...).
+  template <typename TrackType,
+            typename CategoryType,
+            typename... Arguments,
+            typename TrackTypeCheck = typename std::enable_if<
+                std::is_convertible<TrackType, Track>::value>::type>
+  static void TraceForCategory(uint32_t instances,
+                               const CategoryType& category,
+                               const char* event_name,
+                               perfetto::protos::pbzero::TrackEvent::Type type,
+                               TrackType&& track,
+                               Arguments&&... args) PERFETTO_NO_INLINE {
+    TraceForCategoryImpl(
+        instances, category, event_name, type, std::forward<TrackType>(track),
+        TrackEventInternal::GetTimeNs(), std::forward<Arguments>(args)...);
+  }
+
+  // Trace point which takes a timestamp, but not track.
+  template <typename CategoryType,
+            typename TimestampType = uint64_t,
+            typename... Arguments,
+            typename TimestampTypeCheck = typename std::enable_if<
+                IsValidTimestamp<TimestampType>()>::type>
+  static void TraceForCategory(uint32_t instances,
+                               const CategoryType& category,
+                               const char* event_name,
+                               perfetto::protos::pbzero::TrackEvent::Type type,
+                               TimestampType&& timestamp,
+                               Arguments&&... args) PERFETTO_NO_INLINE {
+    TraceForCategoryImpl(instances, category, event_name, type,
+                         TrackEventInternal::kDefaultTrack,
+                         std::forward<TimestampType>(timestamp),
+                         std::forward<Arguments>(args)...);
+  }
+
+  // Trace point which takes a timestamp and a track.
+  template <typename TrackType,
+            typename CategoryType,
+            typename TimestampType = uint64_t,
+            typename... Arguments,
+            typename TrackTypeCheck = typename std::enable_if<
+                std::is_convertible<TrackType, Track>::value>::type,
+            typename TimestampTypeCheck = typename std::enable_if<
+                IsValidTimestamp<TimestampType>()>::type>
+  static void TraceForCategory(uint32_t instances,
+                               const CategoryType& category,
+                               const char* event_name,
+                               perfetto::protos::pbzero::TrackEvent::Type type,
+                               TrackType&& track,
+                               TimestampType&& timestamp,
+                               Arguments&&... args) PERFETTO_NO_INLINE {
+    TraceForCategoryImpl(instances, category, event_name, type,
+                         std::forward<TrackType>(track),
+                         std::forward<TimestampType>(timestamp),
+                         std::forward<Arguments>(args)...);
+  }
+
+  // Trace point with with a counter sample.
+  template <typename CategoryType, typename ValueType>
+  static void TraceForCategory(uint32_t instances,
+                               const CategoryType& category,
+                               const char*,
+                               perfetto::protos::pbzero::TrackEvent::Type type,
+                               CounterTrack track,
+                               ValueType value) PERFETTO_ALWAYS_INLINE {
+    PERFETTO_DCHECK(type == perfetto::protos::pbzero::TrackEvent::TYPE_COUNTER);
+    TraceForCategory(instances, category, /*name=*/nullptr, type, track,
+                     TrackEventInternal::GetTimeNs(), value);
+  }
+
+  // Trace point with with a timestamp and a counter sample.
+  template <typename CategoryType,
+            typename TimestampType = uint64_t,
+            typename TimestampTypeCheck = typename std::enable_if<
+                IsValidTimestamp<TimestampType>()>::type,
+            typename ValueType>
+  static void TraceForCategory(uint32_t instances,
+                               const CategoryType& category,
+                               const char*,
+                               perfetto::protos::pbzero::TrackEvent::Type type,
+                               CounterTrack track,
+                               TimestampType timestamp,
+                               ValueType value) PERFETTO_ALWAYS_INLINE {
+    PERFETTO_DCHECK(type == perfetto::protos::pbzero::TrackEvent::TYPE_COUNTER);
+    TraceForCategoryImpl(
+        instances, category, /*name=*/nullptr, type, track, timestamp,
+        [&](EventContext event_ctx) {
+          if (std::is_integral<ValueType>::value) {
+            event_ctx.event()->set_counter_value(static_cast<int64_t>(value));
+          } else {
+            event_ctx.event()->set_double_counter_value(
+                static_cast<double>(value));
+          }
+        });
+  }
+
+  // Initialize the track event library. Should be called before tracing is
+  // enabled.
+  static bool Register() {
+    // Registration is performed out-of-line so users don't need to depend on
+    // DataSourceDescriptor C++ bindings.
+    return TrackEventInternal::Initialize(
+        *Registry,
+        [](const DataSourceDescriptor& dsd) { return Base::Register(dsd); });
+  }
+
+  // Record metadata about different types of timeline tracks. See Track.
+  static void SetTrackDescriptor(const Track& track,
+                                 const protos::gen::TrackDescriptor& desc) {
+    PERFETTO_DCHECK(track.uuid == desc.uuid());
+    TrackRegistry::Get()->UpdateTrack(track, desc.SerializeAsString());
+    Base::template Trace([&](typename Base::TraceContext ctx) {
+      TrackEventInternal::WriteTrackDescriptor(
+          track, ctx.tls_inst_->trace_writer.get());
+    });
+  }
+
+  // DEPRECATED. Only kept for backwards compatibility.
+  static void SetTrackDescriptor(
+      const Track& track,
+      std::function<void(protos::pbzero::TrackDescriptor*)> callback) {
+    SetTrackDescriptorImpl(track, std::move(callback));
+  }
+
+  // DEPRECATED. Only kept for backwards compatibility.
+  static void SetProcessDescriptor(
+      std::function<void(protos::pbzero::TrackDescriptor*)> callback,
+      const ProcessTrack& track = ProcessTrack::Current()) {
+    SetTrackDescriptorImpl(std::move(track), std::move(callback));
+  }
+
+  // DEPRECATED. Only kept for backwards compatibility.
+  static void SetThreadDescriptor(
+      std::function<void(protos::pbzero::TrackDescriptor*)> callback,
+      const ThreadTrack& track = ThreadTrack::Current()) {
+    SetTrackDescriptorImpl(std::move(track), std::move(callback));
+  }
+
+  static void EraseTrackDescriptor(const Track& track) {
+    TrackRegistry::Get()->EraseTrack(track);
+  }
+
+  // Returns the current trace timestamp in nanoseconds. Note the returned
+  // timebase may vary depending on the platform, but will always match the
+  // timestamps recorded by track events (see GetTraceClockId).
+  static uint64_t GetTraceTimeNs() { return TrackEventInternal::GetTimeNs(); }
+
+  // Returns the type of clock used by GetTraceTimeNs().
+  static constexpr protos::pbzero::BuiltinClock GetTraceClockId() {
+    return TrackEventInternal::GetClockId();
+  }
+
+ private:
+  // Each category has its own enabled/disabled state, stored in the category
+  // registry.
+  struct CategoryTracePointTraits {
+    // Each trace point with a static category has an associated category index.
+    struct TracePointData {
+      size_t category_index;
+    };
+    // Called to get the enabled state bitmap of a given category.
+    // |data| is the trace point data structure given to
+    // DataSource::TraceWithInstances.
+    static constexpr std::atomic<uint8_t>* GetActiveInstances(
+        TracePointData data) {
+      return Registry->GetCategoryState(data.category_index);
+    }
+  };
+
+  template <typename CategoryType,
+            typename TrackType = Track,
+            typename TimestampType = uint64_t,
+            typename TimestampTypeCheck = typename std::enable_if<
+                IsValidTimestamp<TimestampType>()>::type,
+            typename TrackTypeCheck =
+                typename std::enable_if<IsValidTrack<TrackType>()>::type,
+            typename... Arguments>
+  static void TraceForCategoryImpl(
+      uint32_t instances,
+      const CategoryType& category,
+      const char* event_name,
+      perfetto::protos::pbzero::TrackEvent::Type type,
+      const TrackType& track,
+      const TimestampType& timestamp,
+      Arguments&&... args) PERFETTO_ALWAYS_INLINE {
+    using CatTraits = CategoryTraits<CategoryType>;
+    const Category* static_category =
+        CatTraits::GetStaticCategory(Registry, category);
+    TraceWithInstances(
+        instances, category, [&](typename Base::TraceContext ctx) {
+          // If this category is dynamic, first check whether it's enabled.
+          if (CatTraits::kIsDynamic &&
+              !IsDynamicCategoryEnabled(
+                  &ctx, CatTraits::GetDynamicCategory(category))) {
+            return;
+          }
+
+          // TODO(skyostil): Support additional clock ids.
+          TraceTimestamp trace_timestamp = ::perfetto::TraceTimestampTraits<
+              TimestampType>::ConvertTimestampToTraceTimeNs(timestamp);
+          PERFETTO_DCHECK(trace_timestamp.clock_id ==
+                          TrackEventInternal::GetClockId());
+
+          // Make sure incremental state is valid.
+          TraceWriterBase* trace_writer = ctx.tls_inst_->trace_writer.get();
+          TrackEventIncrementalState* incr_state = ctx.GetIncrementalState();
+          if (incr_state->was_cleared) {
+            incr_state->was_cleared = false;
+            TrackEventInternal::ResetIncrementalState(
+                trace_writer, trace_timestamp.nanoseconds);
+          }
+
+          // Write the track descriptor before any event on the track.
+          if (track) {
+            TrackEventInternal::WriteTrackDescriptorIfNeeded(
+                track, trace_writer, incr_state);
+          }
+
+          // Write the event itself.
+          {
+            auto event_ctx = TrackEventInternal::WriteEvent(
+                trace_writer, incr_state, static_category, event_name, type,
+                trace_timestamp.nanoseconds);
+            // Write dynamic categories (except for events that don't require
+            // categories). For counter events, the counter name (and optional
+            // category) is stored as part of the track descriptor instead being
+            // recorded with individual events.
+            if (CatTraits::kIsDynamic &&
+                type != protos::pbzero::TrackEvent::TYPE_SLICE_END &&
+                type != protos::pbzero::TrackEvent::TYPE_COUNTER) {
+              DynamicCategory dynamic_category =
+                  CatTraits::GetDynamicCategory(category);
+              Category cat = Category::FromDynamicCategory(dynamic_category);
+              cat.ForEachGroupMember(
+                  [&](const char* member_name, size_t name_size) {
+                    event_ctx.event()->add_categories(member_name, name_size);
+                    return true;
+                  });
+            }
+            if (&track != &TrackEventInternal::kDefaultTrack)
+              event_ctx.event()->set_track_uuid(track.uuid);
+            WriteTrackEventArgs(std::move(event_ctx),
+                                std::forward<Arguments>(args)...);
+          }  // event_ctx
+        });
+  }
+
+  template <typename CategoryType, typename Lambda>
+  static void TraceWithInstances(uint32_t instances,
+                                 const CategoryType& category,
+                                 Lambda lambda) PERFETTO_ALWAYS_INLINE {
+    using CatTraits = CategoryTraits<CategoryType>;
+    if (CatTraits::kIsDynamic) {
+      Base::template TraceWithInstances(instances, std::move(lambda));
+    } else {
+      Base::template TraceWithInstances<CategoryTracePointTraits>(
+          instances, std::move(lambda), {CatTraits::GetStaticIndex(category)});
+    }
+  }
+
+  // Records a track descriptor into the track descriptor registry and, if we
+  // are tracing, also mirrors the descriptor into the trace.
+  template <typename TrackType>
+  static void SetTrackDescriptorImpl(
+      const TrackType& track,
+      std::function<void(protos::pbzero::TrackDescriptor*)> callback) {
+    TrackRegistry::Get()->UpdateTrack(track, std::move(callback));
+    Base::template Trace([&](typename Base::TraceContext ctx) {
+      TrackEventInternal::WriteTrackDescriptor(
+          track, ctx.tls_inst_->trace_writer.get());
+    });
+  }
+
+  // Determines if the given dynamic category is enabled, first by checking the
+  // per-trace writer cache or by falling back to computing it based on the
+  // trace config for the given session.
+  static bool IsDynamicCategoryEnabled(
+      typename Base::TraceContext* ctx,
+      const DynamicCategory& dynamic_category) {
+    auto incr_state = ctx->GetIncrementalState();
+    auto it = incr_state->dynamic_categories.find(dynamic_category.name);
+    if (it == incr_state->dynamic_categories.end()) {
+      // We haven't seen this category before. Let's figure out if it's enabled.
+      // This requires grabbing a lock to read the session's trace config.
+      auto ds = ctx->GetDataSourceLocked();
+      Category category{Category::FromDynamicCategory(dynamic_category)};
+      bool enabled = TrackEventInternal::IsCategoryEnabled(
+          *Registry, ds->config_, category);
+      // TODO(skyostil): Cap the size of |dynamic_categories|.
+      incr_state->dynamic_categories[dynamic_category.name] = enabled;
+      return enabled;
+    }
+    return it->second;
+  }
+
+  // Config for the current tracing session.
+  protos::gen::TrackEventConfig config_;
+};
+
+}  // namespace internal
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_INTERNAL_TRACK_EVENT_DATA_SOURCE_H_
+// gen_amalgamated begin header: include/perfetto/tracing/internal/track_event_macros.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_INTERNAL_TRACK_EVENT_MACROS_H_
+#define INCLUDE_PERFETTO_TRACING_INTERNAL_TRACK_EVENT_MACROS_H_
+
+// This file contains underlying macros for the trace point track event
+// implementation. Perfetto API users typically don't need to use anything here
+// directly.
+
+// gen_amalgamated expanded: #include "perfetto/base/compiler.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/track_event_data_source.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/track_event_category_registry.h"
+
+// Ignore GCC warning about a missing argument for a variadic macro parameter.
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC system_header
+#endif
+
+// Defines data structures for backing a category registry.
+//
+// Each category has one enabled/disabled bit per possible data source instance.
+// The bits are packed, i.e., each byte holds the state for instances. To
+// improve cache locality, the bits for each instance are stored separately from
+// the names of the categories:
+//
+//   byte 0                      byte 1
+//   (inst0, inst1, ..., inst7), (inst0, inst1, ..., inst7)
+//
+#define PERFETTO_INTERNAL_DECLARE_CATEGORIES(...)                             \
+  namespace internal {                                                        \
+  constexpr ::perfetto::Category kCategories[] = {__VA_ARGS__};               \
+  constexpr size_t kCategoryCount =                                           \
+      sizeof(kCategories) / sizeof(kCategories[0]);                           \
+  /* The per-instance enable/disable state per category */                    \
+  PERFETTO_COMPONENT_EXPORT extern std::atomic<uint8_t>                       \
+      g_category_state_storage[kCategoryCount];                               \
+  /* The category registry which mediates access to the above structures. */  \
+  /* The registry is used for two purposes: */                                \
+  /**/                                                                        \
+  /*    1) For looking up categories at build (constexpr) time. */            \
+  /*    2) For declaring the per-namespace TrackEvent data source. */         \
+  /**/                                                                        \
+  /* Because usage #1 requires a constexpr type and usage #2 requires an */   \
+  /* extern type (to avoid declaring a type based on a translation-unit */    \
+  /* variable), we need two separate copies of the registry with different */ \
+  /* storage specifiers. */                                                   \
+  /**/                                                                        \
+  /* TODO(skyostil): Unify these using a C++17 inline constexpr variable. */  \
+  constexpr ::perfetto::internal::TrackEventCategoryRegistry                  \
+      kConstExprCategoryRegistry(kCategoryCount,                              \
+                                 &kCategories[0],                             \
+                                 &g_category_state_storage[0]);               \
+  PERFETTO_COMPONENT_EXPORT extern const ::perfetto::internal::               \
+      TrackEventCategoryRegistry kCategoryRegistry;                           \
+  static_assert(kConstExprCategoryRegistry.ValidateCategories(),              \
+                "Invalid category names found");                              \
+  }  // namespace internal
+
+// In a .cc file, declares storage for each category's runtime state.
+#define PERFETTO_INTERNAL_CATEGORY_STORAGE()             \
+  namespace internal {                                   \
+  PERFETTO_COMPONENT_EXPORT std::atomic<uint8_t>         \
+      g_category_state_storage[kCategoryCount];          \
+  PERFETTO_COMPONENT_EXPORT const ::perfetto::internal:: \
+      TrackEventCategoryRegistry kCategoryRegistry(      \
+          kCategoryCount,                                \
+          &kCategories[0],                               \
+          &g_category_state_storage[0]);                 \
+  }  // namespace internal
+
+// Defines the TrackEvent data source for the current track event namespace.
+#define PERFETTO_INTERNAL_DECLARE_TRACK_EVENT_DATA_SOURCE() \
+  struct PERFETTO_COMPONENT_EXPORT TrackEvent               \
+      : public ::perfetto::internal::TrackEventDataSource<  \
+            TrackEvent, &internal::kCategoryRegistry> {}
+
+// At compile time, turns a category name represented by a static string into an
+// index into the current category registry. A build error will be generated if
+// the category hasn't been registered or added to the list of allowed dynamic
+// categories. See PERFETTO_DEFINE_CATEGORIES.
+#define PERFETTO_GET_CATEGORY_INDEX(category)                                  \
+  ::PERFETTO_TRACK_EVENT_NAMESPACE::internal::kConstExprCategoryRegistry.Find( \
+      category,                                                                \
+      ::PERFETTO_TRACK_EVENT_NAMESPACE::internal::IsDynamicCategory(category))
+
+// Generate a unique variable name with a given prefix.
+#define PERFETTO_INTERNAL_CONCAT2(a, b) a##b
+#define PERFETTO_INTERNAL_CONCAT(a, b) PERFETTO_INTERNAL_CONCAT2(a, b)
+#define PERFETTO_UID(prefix) PERFETTO_INTERNAL_CONCAT(prefix, __LINE__)
+
+// Efficiently determines whether tracing is enabled for the given category, and
+// if so, emits one trace event with the given arguments.
+#define PERFETTO_INTERNAL_TRACK_EVENT(category, ...)                           \
+  do {                                                                         \
+    namespace tns = ::PERFETTO_TRACK_EVENT_NAMESPACE;                          \
+    /* Compute the category index outside the lambda to work around a */       \
+    /* GCC 7 bug */                                                            \
+    static constexpr auto PERFETTO_UID(                                        \
+        kCatIndex_ADD_TO_PERFETTO_DEFINE_CATEGORIES_IF_FAILS_) =               \
+        PERFETTO_GET_CATEGORY_INDEX(category);                                 \
+    if (tns::internal::IsDynamicCategory(category)) {                          \
+      tns::TrackEvent::CallIfEnabled(                                          \
+          [&](uint32_t instances) PERFETTO_NO_THREAD_SAFETY_ANALYSIS {         \
+            tns::TrackEvent::TraceForCategory(instances, category,             \
+                                              ##__VA_ARGS__);                  \
+          });                                                                  \
+    } else {                                                                   \
+      tns::TrackEvent::CallIfCategoryEnabled(                                  \
+          PERFETTO_UID(kCatIndex_ADD_TO_PERFETTO_DEFINE_CATEGORIES_IF_FAILS_), \
+          [&](uint32_t instances) PERFETTO_NO_THREAD_SAFETY_ANALYSIS {         \
+            tns::TrackEvent::TraceForCategory(                                 \
+                instances,                                                     \
+                PERFETTO_UID(                                                  \
+                    kCatIndex_ADD_TO_PERFETTO_DEFINE_CATEGORIES_IF_FAILS_),    \
+                ##__VA_ARGS__);                                                \
+          });                                                                  \
+    }                                                                          \
+  } while (false)
+
+#define PERFETTO_INTERNAL_SCOPED_TRACK_EVENT(category, name, ...)             \
+  struct PERFETTO_UID(ScopedEvent) {                                          \
+    struct EventFinalizer {                                                   \
+      /* The parameter is an implementation detail. It allows the          */ \
+      /* anonymous struct to use aggregate initialization to invoke the    */ \
+      /* lambda (which emits the BEGIN event and returns an integer)       */ \
+      /* with the proper reference capture for any                         */ \
+      /* TrackEventArgumentFunction in |__VA_ARGS__|. This is required so  */ \
+      /* that the scoped event is exactly ONE line and can't escape the    */ \
+      /* scope if used in a single line if statement.                      */ \
+      EventFinalizer(...) {}                                                  \
+      ~EventFinalizer() { TRACE_EVENT_END(category); }                        \
+    } finalizer;                                                              \
+  } PERFETTO_UID(scoped_event) {                                              \
+    [&]() {                                                                   \
+      TRACE_EVENT_BEGIN(category, name, ##__VA_ARGS__);                       \
+      return 0;                                                               \
+    }()                                                                       \
+  }
+
+#define PERFETTO_INTERNAL_CATEGORY_ENABLED(category)                         \
+  (::PERFETTO_TRACK_EVENT_NAMESPACE::internal::IsDynamicCategory(category)   \
+       ? ::PERFETTO_TRACK_EVENT_NAMESPACE::TrackEvent::                      \
+             IsDynamicCategoryEnabled(::perfetto::DynamicCategory(category)) \
+       : ::PERFETTO_TRACK_EVENT_NAMESPACE::TrackEvent::IsCategoryEnabled(    \
+             PERFETTO_GET_CATEGORY_INDEX(category)))
+
+#endif  // INCLUDE_PERFETTO_TRACING_INTERNAL_TRACK_EVENT_MACROS_H_
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_TRACK_EVENT_H_
+#define INCLUDE_PERFETTO_TRACING_TRACK_EVENT_H_
+
+// gen_amalgamated expanded: #include "perfetto/base/time.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/track_event_data_source.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/track_event_internal.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/track_event_macros.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/string_helpers.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/track.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/track_event_category_registry.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/track_event.pbzero.h"
+
+#include <type_traits>
+
+// This file contains a set of macros designed for instrumenting applications
+// with track event trace points. While the underlying TrackEvent API can also
+// be used directly, doing so efficiently requires some care (e.g., to avoid
+// evaluating arguments while tracing is disabled). These types of optimizations
+// are abstracted away by the macros below.
+//
+// ================
+// Quickstart guide
+// ================
+//
+//   To add track events to your application, first define your categories in,
+//   e.g., my_tracing.h:
+//
+//       PERFETTO_DEFINE_CATEGORIES(
+//           perfetto::Category("base"),
+//           perfetto::Category("v8"),
+//           perfetto::Category("cc"));
+//
+//   Then in a single .cc file, e.g., my_tracing.cc:
+//
+//       #include "my_tracing.h"
+//       PERFETTO_TRACK_EVENT_STATIC_STORAGE();
+//
+//   Finally, register track events at startup, after which you can record
+//   events with the TRACE_EVENT macros:
+//
+//       #include "my_tracing.h"
+//
+//       int main() {
+//         perfetto::TrackEvent::Register();
+//
+//         // A basic track event with just a name.
+//         TRACE_EVENT("category", "MyEvent");
+//
+//         // A track event with (up to two) debug annotations.
+//         TRACE_EVENT("category", "MyEvent", "parameter", 42);
+//
+//         // A track event with a strongly typed parameter.
+//         TRACE_EVENT("category", "MyEvent", [](perfetto::EventContext ctx) {
+//           ctx.event()->set_foo(42);
+//           ctx.event()->set_bar(.5f);
+//         });
+//       }
+//
+//  Note that track events must be nested consistently, i.e., the following is
+//  not allowed:
+//
+//    TRACE_EVENT_BEGIN("a", "bar", ...);
+//    TRACE_EVENT_BEGIN("b", "foo", ...);
+//    TRACE_EVENT_END("a");  // "foo" must be closed before "bar".
+//    TRACE_EVENT_END("b");
+//
+// ====================
+// Implementation notes
+// ====================
+//
+// The track event library consists of the following layers and components. The
+// classes the internal namespace shouldn't be considered part of the public
+// API.
+//                    .--------------------------------.
+//               .----|  TRACE_EVENT                   |----.
+//      write   |     |   - App instrumentation point  |     |  write
+//      event   |     '--------------------------------'     |  arguments
+//              V                                            V
+//  .----------------------------------.    .-----------------------------.
+//  | TrackEvent                       |    | EventContext                |
+//  |  - Registry of event categories  |    |  - One track event instance |
+//  '----------------------------------'    '-----------------------------'
+//              |                                            |
+//              |                                            | look up
+//              | is                                         | interning ids
+//              V                                            V
+//  .----------------------------------.    .-----------------------------.
+//  | internal::TrackEventDataSource   |    | TrackEventInternedDataIndex |
+//  | - Perfetto data source           |    | - Corresponds to a field in |
+//  | - Has TrackEventIncrementalState |    |   in interned_data.proto    |
+//  '----------------------------------'    '-----------------------------'
+//              |                  |                         ^
+//              |                  |       owns (1:many)     |
+//              | write event      '-------------------------'
+//              V
+//  .----------------------------------.
+//  | internal::TrackEventInternal     |
+//  | - Outlined code to serialize     |
+//  |   one track event                |
+//  '----------------------------------'
+//
+
+// Each compilation unit can be in exactly one track event namespace,
+// allowing the overall program to use multiple track event data sources and
+// category lists if necessary. Use this macro to select the namespace for the
+// current compilation unit.
+//
+// If the program uses multiple track event namespaces, category & track event
+// registration (see quickstart above) needs to happen for both namespaces
+// separately.
+#ifndef PERFETTO_TRACK_EVENT_NAMESPACE
+#define PERFETTO_TRACK_EVENT_NAMESPACE perfetto
+#endif
+
+// Deprecated; see perfetto::Category().
+#define PERFETTO_CATEGORY(name) \
+  ::perfetto::Category { #name }
+
+// Internal helpers for determining if a given category is defined at build or
+// runtime.
+namespace PERFETTO_TRACK_EVENT_NAMESPACE {
+namespace internal {
+
+// By default no statically defined categories are dynamic, but this can be
+// overridden with PERFETTO_DEFINE_TEST_CATEGORY_PREFIXES.
+template <typename... T>
+constexpr bool IsDynamicCategory(const char*) {
+  return false;
+}
+
+// Explicitly dynamic categories are always dynamic.
+constexpr bool IsDynamicCategory(const ::perfetto::DynamicCategory&) {
+  return true;
+}
+
+}  // namespace internal
+}  // namespace PERFETTO_TRACK_EVENT_NAMESPACE
+
+// Normally all categories are defined statically at build-time (see
+// PERFETTO_DEFINE_CATEGORIES). However, some categories are only used for
+// testing, and we shouldn't publish them to the tracing service or include them
+// in a production binary. Use this macro to define a list of prefixes for these
+// types of categories. Note that trace points using these categories will be
+// slightly less efficient compared to regular trace points.
+#define PERFETTO_DEFINE_TEST_CATEGORY_PREFIXES(...)                       \
+  namespace PERFETTO_TRACK_EVENT_NAMESPACE {                              \
+  namespace internal {                                                    \
+  template <>                                                             \
+  constexpr bool IsDynamicCategory(const char* name) {                    \
+    return ::perfetto::internal::IsStringInPrefixList(name, __VA_ARGS__); \
+  }                                                                       \
+  } /* namespace internal */                                              \
+  } /* namespace PERFETTO_TRACK_EVENT_NAMESPACE */                        \
+  PERFETTO_INTERNAL_SWALLOW_SEMICOLON()
+
+// Register the set of available categories by passing a list of categories to
+// this macro: PERFETTO_CATEGORY(cat1), PERFETTO_CATEGORY(cat2), ...
+#define PERFETTO_DEFINE_CATEGORIES(...)                        \
+  namespace PERFETTO_TRACK_EVENT_NAMESPACE {                   \
+  /* The list of category names */                             \
+  PERFETTO_INTERNAL_DECLARE_CATEGORIES(__VA_ARGS__)            \
+  /* The track event data source for this set of categories */ \
+  PERFETTO_INTERNAL_DECLARE_TRACK_EVENT_DATA_SOURCE();         \
+  } /* namespace PERFETTO_TRACK_EVENT_NAMESPACE */             \
+  PERFETTO_DECLARE_DATA_SOURCE_STATIC_MEMBERS(                 \
+      PERFETTO_TRACK_EVENT_NAMESPACE::TrackEvent,              \
+      perfetto::internal::TrackEventDataSourceTraits)
+
+// Allocate storage for each category by using this macro once per track event
+// namespace.
+#define PERFETTO_TRACK_EVENT_STATIC_STORAGE()      \
+  namespace PERFETTO_TRACK_EVENT_NAMESPACE {       \
+  PERFETTO_INTERNAL_CATEGORY_STORAGE()             \
+  } /* namespace PERFETTO_TRACK_EVENT_NAMESPACE */ \
+  PERFETTO_DEFINE_DATA_SOURCE_STATIC_MEMBERS(      \
+      PERFETTO_TRACK_EVENT_NAMESPACE::TrackEvent,  \
+      perfetto::internal::TrackEventDataSourceTraits)
+
+// Ignore GCC warning about a missing argument for a variadic macro parameter.
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC system_header
+#endif
+
+// Begin a slice under |category| with the title |name|. Both strings must be
+// static constants. The track event is only recorded if |category| is enabled
+// for a tracing session.
+//
+// The slice is thread-scoped (i.e., written to the default track of the current
+// thread) unless overridden with a custom track object (see Track).
+//
+// |name| must be a string with static lifetime (i.e., the same
+// address must not be used for a different event name in the future). If you
+// want to use a dynamically allocated name, do this:
+//
+//  TRACE_EVENT("category", nullptr, [&](perfetto::EventContext ctx) {
+//    ctx.event()->set_name(dynamic_name);
+//  });
+//
+// The following optional arguments can be passed to `TRACE_EVENT` to add extra
+// information to events:
+//
+// TRACE_EVENT("cat", "name"[, track][, timestamp]
+//                          [, "debug_name1", debug_value1]
+//                          [, "debug_name2", debug_value2]
+//                          ...
+//                          [, "debug_nameN", debug_valueN]
+//                          [, lambda]);
+//
+// Some examples of valid combinations:
+//
+// 1. A lambda for writing custom TrackEvent fields:
+//
+//   TRACE_EVENT("category", "Name", [&](perfetto::EventContext ctx) {
+//     ctx.event()->set_custom_value(...);
+//   });
+//
+// 2. A timestamp and a lambda:
+//
+//   TRACE_EVENT("category", "Name", time_in_nanoseconds,
+//       [&](perfetto::EventContext ctx) {
+//     ctx.event()->set_custom_value(...);
+//   });
+//
+//   |time_in_nanoseconds| should be an uint64_t by default. To support custom
+//   timestamp types,
+//   |perfetto::TraceTimestampTraits<T>::ConvertTimestampToTraceTimeNs|
+//   should be defined. See |ConvertTimestampToTraceTimeNs| for more details.
+//
+// 3. Arbitrary number of debug annotations:
+//
+//   TRACE_EVENT("category", "Name", "arg", value);
+//   TRACE_EVENT("category", "Name", "arg", value, "arg2", value2);
+//   TRACE_EVENT("category", "Name", "arg", value, "arg2", value2,
+//                                   "arg3", value3);
+//
+//   See |TracedValue| for recording custom types as debug annotations.
+//
+// 4. Arbitrary number of debug annotations and a lambda:
+//
+//   TRACE_EVENT("category", "Name", "arg", value,
+//       [&](perfetto::EventContext ctx) {
+//     ctx.event()->set_custom_value(...);
+//   });
+//
+// 5. An overridden track:
+//
+//   TRACE_EVENT("category", "Name", perfetto::Track(1234));
+//
+//   See |Track| for other types of tracks which may be used.
+//
+// 6. A track and a lambda:
+//
+//   TRACE_EVENT("category", "Name", perfetto::Track(1234),
+//       [&](perfetto::EventContext ctx) {
+//     ctx.event()->set_custom_value(...);
+//   });
+//
+// 7. A track and a timestamp:
+//
+//   TRACE_EVENT("category", "Name", perfetto::Track(1234),
+//       time_in_nanoseconds);
+//
+// 8. A track, a timestamp and a lambda:
+//
+//   TRACE_EVENT("category", "Name", perfetto::Track(1234),
+//       time_in_nanoseconds, [&](perfetto::EventContext ctx) {
+//     ctx.event()->set_custom_value(...);
+//   });
+//
+// 9. A track and an arbitrary number of debug annotions:
+//
+//   TRACE_EVENT("category", "Name", perfetto::Track(1234),
+//               "arg", value);
+//   TRACE_EVENT("category", "Name", perfetto::Track(1234),
+//               "arg", value, "arg2", value2);
+//
+#define TRACE_EVENT_BEGIN(category, name, ...)               \
+  PERFETTO_INTERNAL_TRACK_EVENT(                             \
+      category, ::perfetto::internal::GetStaticString(name), \
+      ::perfetto::protos::pbzero::TrackEvent::TYPE_SLICE_BEGIN, ##__VA_ARGS__)
+
+// End a slice under |category|.
+#define TRACE_EVENT_END(category, ...) \
+  PERFETTO_INTERNAL_TRACK_EVENT(       \
+      category, /*name=*/nullptr,      \
+      ::perfetto::protos::pbzero::TrackEvent::TYPE_SLICE_END, ##__VA_ARGS__)
+
+// Begin a slice which gets automatically closed when going out of scope.
+#define TRACE_EVENT(category, name, ...) \
+  PERFETTO_INTERNAL_SCOPED_TRACK_EVENT(category, name, ##__VA_ARGS__)
+
+// Emit a slice which has zero duration.
+#define TRACE_EVENT_INSTANT(category, name, ...)             \
+  PERFETTO_INTERNAL_TRACK_EVENT(                             \
+      category, ::perfetto::internal::GetStaticString(name), \
+      ::perfetto::protos::pbzero::TrackEvent::TYPE_INSTANT, ##__VA_ARGS__)
+
+// Efficiently determine if the given static or dynamic trace category or
+// category group is enabled for tracing.
+#define TRACE_EVENT_CATEGORY_ENABLED(category) \
+  PERFETTO_INTERNAL_CATEGORY_ENABLED(category)
+
+// Time-varying numeric data can be recorded with the TRACE_COUNTER macro:
+//
+//   TRACE_COUNTER("cat", counter_track[, timestamp], value);
+//
+// For example, to record a single value for a counter called "MyCounter":
+//
+//   TRACE_COUNTER("category", "MyCounter", 1234.5);
+//
+// This data is displayed as a counter track in the Perfetto UI.
+//
+// Both integer and floating point counter values are supported. Counters can
+// also be annotated with additional information such as units, for example, for
+// tracking the rendering framerate in terms of frames per second or "fps":
+//
+//   TRACE_COUNTER("category", perfetto::CounterTrack("Framerate", "fps"), 120);
+//
+// As another example, a memory counter that records bytes but accepts samples
+// as kilobytes (to reduce trace binary size) can be defined like this:
+//
+//   perfetto::CounterTrack memory_track = perfetto::CounterTrack("Memory")
+//       .set_unit("bytes")
+//       .set_multiplier(1024);
+//   TRACE_COUNTER("category", memory_track, 4 /* = 4096 bytes */);
+//
+// See /protos/perfetto/trace/track_event/counter_descriptor.proto
+// for the full set of attributes for a counter track.
+//
+// To record a counter value at a specific point in time (instead of the current
+// time), you can pass in a custom timestamp:
+//
+//   // First record the current time and counter value.
+//   uint64_t timestamp = perfetto::TrackEvent::GetTraceTimeNs();
+//   int64_t value = 1234;
+//
+//   // Later, emit a sample at that point in time.
+//   TRACE_COUNTER("category", "MyCounter", timestamp, value);
+//
+#define TRACE_COUNTER(category, track, ...)                 \
+  PERFETTO_INTERNAL_TRACK_EVENT(                            \
+      category, /*name=*/nullptr,                           \
+      ::perfetto::protos::pbzero::TrackEvent::TYPE_COUNTER, \
+      ::perfetto::CounterTrack(track), ##__VA_ARGS__)
+
+// TODO(skyostil): Add flow events.
+
+#endif  // INCLUDE_PERFETTO_TRACING_TRACK_EVENT_H_
+// gen_amalgamated begin header: include/perfetto/tracing/track_event_interned_data_index.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_TRACK_EVENT_INTERNED_DATA_INDEX_H_
+#define INCLUDE_PERFETTO_TRACING_TRACK_EVENT_INTERNED_DATA_INDEX_H_
+
+// gen_amalgamated expanded: #include "perfetto/tracing/internal/track_event_internal.h"
+
+// gen_amalgamated expanded: #include "perfetto/base/compiler.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/event_context.h"
+
+#include <map>
+#include <type_traits>
+#include <unordered_map>
+
+// This file has templates for defining your own interned data types to be used
+// with track event. Interned data can be useful for avoiding repeating the same
+// constant data (e.g., strings) throughout the trace.
+//
+// =============
+// Example usage
+// =============
+//
+// First define an interning index for your type. It should map to a specific
+// field of interned_data.proto and define how the interned data is written into
+// that message.
+//
+//   struct MyInternedData
+//       : public perfetto::TrackEventInternedDataIndex<
+//           MyInternedData,
+//           perfetto::protos::pbzero::InternedData::kMyInternedDataFieldNumber,
+//           const char*> {
+//     static void Add(perfetto::protos::pbzero::InternedData* interned_data,
+//                      size_t iid,
+//                      const char* value) {
+//       auto my_data = interned_data->add_my_interned_data();
+//       my_data->set_iid(iid);
+//       my_data->set_value(value);
+//     }
+//   };
+//
+// Next, use your interned data in a trace point as shown below. The interned
+// string will only be emitted the first time the trace point is hit.
+//
+//   TRACE_EVENT_BEGIN(
+//      "category", "Event", [&](perfetto::EventContext ctx) {
+//        auto my_message = ctx.event()->set_my_message();
+//        size_t iid = MyInternedData::Get(&ctx, "Some data");
+//        my_message->set_iid(iid);
+//      });
+//
+
+namespace perfetto {
+
+// By default, the interning index stores a full copy of the interned data. This
+// ensures the same data is always mapped to the same interning id, and there is
+// no danger of collisions. This comes at the cost of memory usage, however, so
+// consider using HashedInternedDataTraits if that may be an issue.
+//
+// This type of index also performs hashing on the stored data for lookups; for
+// types where this isn't necessary (e.g., raw const char*), use
+// SmallInternedDataTraits.
+struct BigInternedDataTraits {
+  template <typename ValueType>
+  class Index {
+   public:
+    bool LookUpOrInsert(size_t* iid, const ValueType& value) {
+      size_t next_id = data_.size() + 1;
+      auto it_and_inserted = data_.insert(std::make_pair(value, next_id));
+      if (!it_and_inserted.second) {
+        *iid = it_and_inserted.first->second;
+        return true;
+      }
+      *iid = next_id;
+      return false;
+    }
+
+   private:
+    std::unordered_map<ValueType, size_t> data_;
+  };
+};
+
+// This type of interning index keeps full copies of interned data without
+// hashing the values. This is a good fit for small types that can be directly
+// used as index keys.
+struct SmallInternedDataTraits {
+  template <typename ValueType>
+  class Index {
+   public:
+    bool LookUpOrInsert(size_t* iid, const ValueType& value) {
+      size_t next_id = data_.size() + 1;
+      auto it_and_inserted = data_.insert(std::make_pair(value, next_id));
+      if (!it_and_inserted.second) {
+        *iid = it_and_inserted.first->second;
+        return true;
+      }
+      *iid = next_id;
+      return false;
+    }
+
+   private:
+    std::map<ValueType, size_t> data_;
+  };
+};
+
+// This type of interning index only stores the hash of the interned values
+// instead of the values themselves. This is more efficient in terms of memory
+// usage, but assumes that there are no hash collisions. If a hash collision
+// occurs, two or more values will be mapped to the same interning id.
+//
+// Note that the given type must have a specialization for std::hash.
+struct HashedInternedDataTraits {
+  template <typename ValueType>
+  class Index {
+   public:
+    bool LookUpOrInsert(size_t* iid, const ValueType& value) {
+      auto key = std::hash<ValueType>()(value);
+      size_t next_id = data_.size() + 1;
+      auto it_and_inserted = data_.insert(std::make_pair(key, next_id));
+      if (!it_and_inserted.second) {
+        *iid = it_and_inserted.first->second;
+        return true;
+      }
+      *iid = next_id;
+      return false;
+    }
+
+   private:
+    std::map<size_t, size_t> data_;
+  };
+};
+
+// A templated base class for an interned data type which corresponds to a field
+// in interned_data.proto.
+//
+// |InternedDataType| must be the type of the subclass.
+// |FieldNumber| is the corresponding protobuf field in InternedData.
+// |ValueType| is the type which is stored in the index. It must be copyable.
+// |Traits| can be used to customize the storage and lookup mechanism.
+//
+// The subclass should define a static method with the following signature for
+// committing interned data together with the interning id |iid| into the trace:
+//
+//   static void Add(perfetto::protos::pbzero::InternedData*,
+//                   size_t iid,
+//                   const ValueType& value);
+//
+template <typename InternedDataType,
+          size_t FieldNumber,
+          typename ValueType,
+          // Avoid unnecessary hashing for pointers by default.
+          typename Traits =
+              typename std::conditional<(std::is_pointer<ValueType>::value),
+                                        SmallInternedDataTraits,
+                                        BigInternedDataTraits>::type>
+class TrackEventInternedDataIndex
+    : public internal::BaseTrackEventInternedDataIndex {
+ public:
+  // Return an interning id for |value|. The returned id can be immediately
+  // written to the trace. The optional |add_args| are passed to the Add()
+  // function.
+  template <typename... Args>
+  static size_t Get(EventContext* ctx,
+                    const ValueType& value,
+                    Args&&... add_args) {
+    // First check if the value exists in the dictionary.
+    auto index_for_field = GetOrCreateIndexForField(ctx->incremental_state_);
+    size_t iid;
+    if (PERFETTO_LIKELY(index_for_field->index_.LookUpOrInsert(&iid, value))) {
+      PERFETTO_DCHECK(iid);
+      return iid;
+    }
+
+    // If not, we need to serialize the definition of the interned value into
+    // the heap buffered message (which is committed to the trace when the
+    // packet ends).
+    PERFETTO_DCHECK(iid);
+    InternedDataType::Add(
+        ctx->incremental_state_->serialized_interned_data.get(), iid,
+        std::move(value), std::forward<Args>(add_args)...);
+    return iid;
+  }
+
+ private:
+  static InternedDataType* GetOrCreateIndexForField(
+      internal::TrackEventIncrementalState* incremental_state) {
+    // Fast path: look for matching field number.
+    for (const auto& entry : incremental_state->interned_data_indices) {
+      if (entry.first == FieldNumber) {
+#if PERFETTO_DCHECK_IS_ON()
+        if (strcmp(PERFETTO_DEBUG_FUNCTION_IDENTIFIER(),
+                   entry.second->type_id_)) {
+          PERFETTO_FATAL(
+              "Interned data accessed under different types! Previous type: "
+              "%s. New type: %s.",
+              entry.second->type_id_, PERFETTO_DEBUG_FUNCTION_IDENTIFIER());
+        }
+        // If an interned data index is defined in an anonymous namespace, we
+        // can end up with multiple copies of it in the same program. Because
+        // they will all share a memory address through TLS, this can lead to
+        // subtle data corruption if all the copies aren't exactly identical.
+        // Try to detect this by checking if the Add() function address remains
+        // constant.
+        if (reinterpret_cast<void*>(&InternedDataType::Add) !=
+            entry.second->add_function_ptr_) {
+          PERFETTO_FATAL(
+              "Inconsistent interned data index. Maybe the index was defined "
+              "in an anonymous namespace in a header or copied to multiple "
+              "files? Duplicate index definitions can lead to memory "
+              "corruption! Type id: %s",
+              entry.second->type_id_);
+        }
+#endif  // PERFETTO_DCHECK_IS_ON()
+        return reinterpret_cast<InternedDataType*>(entry.second.get());
+      }
+    }
+    // No match -- add a new entry for this field.
+    for (auto& entry : incremental_state->interned_data_indices) {
+      if (!entry.first) {
+        entry.first = FieldNumber;
+        entry.second.reset(new InternedDataType());
+#if PERFETTO_DCHECK_IS_ON()
+        entry.second->type_id_ = PERFETTO_DEBUG_FUNCTION_IDENTIFIER();
+        entry.second->add_function_ptr_ =
+            reinterpret_cast<void*>(&InternedDataType::Add);
+#endif  // PERFETTO_DCHECK_IS_ON()
+        return reinterpret_cast<InternedDataType*>(entry.second.get());
+      }
+    }
+    // Out of space in the interned data index table.
+    PERFETTO_CHECK(false);
+  }
+
+  // The actual interning dictionary for this type of interned data. The actual
+  // container type is defined by |Traits|, hence the extra layer of template
+  // indirection here.
+  typename Traits::template Index<ValueType> index_;
+};
+
+}  // namespace perfetto
+
+#endif  // INCLUDE_PERFETTO_TRACING_TRACK_EVENT_INTERNED_DATA_INDEX_H_
+// gen_amalgamated begin header: include/perfetto/tracing/track_event_legacy.h
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_TRACK_EVENT_LEGACY_H_
+#define INCLUDE_PERFETTO_TRACING_TRACK_EVENT_LEGACY_H_
+
+// This file defines a compatibility shim between legacy (Chrome, V8) trace
+// event macros and track events. To avoid accidentally introducing legacy
+// events in new code, the PERFETTO_ENABLE_LEGACY_TRACE_EVENTS macro must be set
+// to 1 activate the compatibility layer.
+
+// gen_amalgamated expanded: #include "perfetto/base/compiler.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/track_event.h"
+
+#include <stdint.h>
+
+#ifndef PERFETTO_ENABLE_LEGACY_TRACE_EVENTS
+#define PERFETTO_ENABLE_LEGACY_TRACE_EVENTS 0
+#endif
+
+// Ignore GCC warning about a missing argument for a variadic macro parameter.
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC system_header
+#endif
+
+// ----------------------------------------------------------------------------
+// Constants.
+// ----------------------------------------------------------------------------
+
+namespace perfetto {
+namespace legacy {
+
+enum TraceEventFlag {
+  kTraceEventFlagNone = 0,
+  kTraceEventFlagCopy = 1u << 0,
+  kTraceEventFlagHasId = 1u << 1,
+  kTraceEventFlagScopeOffset = 1u << 2,
+  kTraceEventFlagScopeExtra = 1u << 3,
+  kTraceEventFlagExplicitTimestamp = 1u << 4,
+  kTraceEventFlagAsyncTTS = 1u << 5,
+  kTraceEventFlagBindToEnclosing = 1u << 6,
+  kTraceEventFlagFlowIn = 1u << 7,
+  kTraceEventFlagFlowOut = 1u << 8,
+  kTraceEventFlagHasContextId = 1u << 9,
+  kTraceEventFlagHasProcessId = 1u << 10,
+  kTraceEventFlagHasLocalId = 1u << 11,
+  kTraceEventFlagHasGlobalId = 1u << 12,
+  // TODO(eseckler): Remove once we have native support for typed proto events
+  // in TRACE_EVENT macros.
+  kTraceEventFlagTypedProtoArgs = 1u << 15,
+  kTraceEventFlagJavaStringLiterals = 1u << 16,
+};
+
+enum PerfettoLegacyCurrentThreadId { kCurrentThreadId };
+
+}  // namespace legacy
+}  // namespace perfetto
+
+#if PERFETTO_ENABLE_LEGACY_TRACE_EVENTS
+// The following constants are defined in the global namespace, since they were
+// originally implemented as macros.
+
+// Event phases.
+static constexpr char TRACE_EVENT_PHASE_BEGIN = 'B';
+static constexpr char TRACE_EVENT_PHASE_END = 'E';
+static constexpr char TRACE_EVENT_PHASE_COMPLETE = 'X';
+static constexpr char TRACE_EVENT_PHASE_INSTANT = 'I';
+static constexpr char TRACE_EVENT_PHASE_ASYNC_BEGIN = 'S';
+static constexpr char TRACE_EVENT_PHASE_ASYNC_STEP_INTO = 'T';
+static constexpr char TRACE_EVENT_PHASE_ASYNC_STEP_PAST = 'p';
+static constexpr char TRACE_EVENT_PHASE_ASYNC_END = 'F';
+static constexpr char TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN = 'b';
+static constexpr char TRACE_EVENT_PHASE_NESTABLE_ASYNC_END = 'e';
+static constexpr char TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT = 'n';
+static constexpr char TRACE_EVENT_PHASE_FLOW_BEGIN = 's';
+static constexpr char TRACE_EVENT_PHASE_FLOW_STEP = 't';
+static constexpr char TRACE_EVENT_PHASE_FLOW_END = 'f';
+static constexpr char TRACE_EVENT_PHASE_METADATA = 'M';
+static constexpr char TRACE_EVENT_PHASE_COUNTER = 'C';
+static constexpr char TRACE_EVENT_PHASE_SAMPLE = 'P';
+static constexpr char TRACE_EVENT_PHASE_CREATE_OBJECT = 'N';
+static constexpr char TRACE_EVENT_PHASE_SNAPSHOT_OBJECT = 'O';
+static constexpr char TRACE_EVENT_PHASE_DELETE_OBJECT = 'D';
+static constexpr char TRACE_EVENT_PHASE_MEMORY_DUMP = 'v';
+static constexpr char TRACE_EVENT_PHASE_MARK = 'R';
+static constexpr char TRACE_EVENT_PHASE_CLOCK_SYNC = 'c';
+static constexpr char TRACE_EVENT_PHASE_ENTER_CONTEXT = '(';
+static constexpr char TRACE_EVENT_PHASE_LEAVE_CONTEXT = ')';
+
+// Flags for changing the behavior of TRACE_EVENT_API_ADD_TRACE_EVENT.
+static constexpr uint32_t TRACE_EVENT_FLAG_NONE =
+    perfetto::legacy::kTraceEventFlagNone;
+static constexpr uint32_t TRACE_EVENT_FLAG_COPY =
+    perfetto::legacy::kTraceEventFlagCopy;
+static constexpr uint32_t TRACE_EVENT_FLAG_HAS_ID =
+    perfetto::legacy::kTraceEventFlagHasId;
+static constexpr uint32_t TRACE_EVENT_FLAG_SCOPE_OFFSET =
+    perfetto::legacy::kTraceEventFlagScopeOffset;
+static constexpr uint32_t TRACE_EVENT_FLAG_SCOPE_EXTRA =
+    perfetto::legacy::kTraceEventFlagScopeExtra;
+static constexpr uint32_t TRACE_EVENT_FLAG_EXPLICIT_TIMESTAMP =
+    perfetto::legacy::kTraceEventFlagExplicitTimestamp;
+static constexpr uint32_t TRACE_EVENT_FLAG_ASYNC_TTS =
+    perfetto::legacy::kTraceEventFlagAsyncTTS;
+static constexpr uint32_t TRACE_EVENT_FLAG_BIND_TO_ENCLOSING =
+    perfetto::legacy::kTraceEventFlagBindToEnclosing;
+static constexpr uint32_t TRACE_EVENT_FLAG_FLOW_IN =
+    perfetto::legacy::kTraceEventFlagFlowIn;
+static constexpr uint32_t TRACE_EVENT_FLAG_FLOW_OUT =
+    perfetto::legacy::kTraceEventFlagFlowOut;
+static constexpr uint32_t TRACE_EVENT_FLAG_HAS_CONTEXT_ID =
+    perfetto::legacy::kTraceEventFlagHasContextId;
+static constexpr uint32_t TRACE_EVENT_FLAG_HAS_PROCESS_ID =
+    perfetto::legacy::kTraceEventFlagHasProcessId;
+static constexpr uint32_t TRACE_EVENT_FLAG_HAS_LOCAL_ID =
+    perfetto::legacy::kTraceEventFlagHasLocalId;
+static constexpr uint32_t TRACE_EVENT_FLAG_HAS_GLOBAL_ID =
+    perfetto::legacy::kTraceEventFlagHasGlobalId;
+static constexpr uint32_t TRACE_EVENT_FLAG_TYPED_PROTO_ARGS =
+    perfetto::legacy::kTraceEventFlagTypedProtoArgs;
+static constexpr uint32_t TRACE_EVENT_FLAG_JAVA_STRING_LITERALS =
+    perfetto::legacy::kTraceEventFlagJavaStringLiterals;
+
+static constexpr uint32_t TRACE_EVENT_FLAG_SCOPE_MASK =
+    TRACE_EVENT_FLAG_SCOPE_OFFSET | TRACE_EVENT_FLAG_SCOPE_EXTRA;
+
+// Type values for identifying types in the TraceValue union.
+static constexpr uint8_t TRACE_VALUE_TYPE_BOOL = 1;
+static constexpr uint8_t TRACE_VALUE_TYPE_UINT = 2;
+static constexpr uint8_t TRACE_VALUE_TYPE_INT = 3;
+static constexpr uint8_t TRACE_VALUE_TYPE_DOUBLE = 4;
+static constexpr uint8_t TRACE_VALUE_TYPE_POINTER = 5;
+static constexpr uint8_t TRACE_VALUE_TYPE_STRING = 6;
+static constexpr uint8_t TRACE_VALUE_TYPE_COPY_STRING = 7;
+static constexpr uint8_t TRACE_VALUE_TYPE_CONVERTABLE = 8;
+static constexpr uint8_t TRACE_VALUE_TYPE_PROTO = 9;
+
+// Enum reflecting the scope of an INSTANT event. Must fit within
+// TRACE_EVENT_FLAG_SCOPE_MASK.
+static constexpr uint8_t TRACE_EVENT_SCOPE_GLOBAL = 0u << 2;
+static constexpr uint8_t TRACE_EVENT_SCOPE_PROCESS = 1u << 2;
+static constexpr uint8_t TRACE_EVENT_SCOPE_THREAD = 2u << 2;
+
+static constexpr char TRACE_EVENT_SCOPE_NAME_GLOBAL = 'g';
+static constexpr char TRACE_EVENT_SCOPE_NAME_PROCESS = 'p';
+static constexpr char TRACE_EVENT_SCOPE_NAME_THREAD = 't';
+
+static constexpr auto TRACE_EVENT_API_CURRENT_THREAD_ID =
+    perfetto::legacy::kCurrentThreadId;
+
+#endif  // PERFETTO_ENABLE_LEGACY_TRACE_EVENTS
+
+// ----------------------------------------------------------------------------
+// Internal legacy trace point implementation.
+// ----------------------------------------------------------------------------
+
+namespace perfetto {
+namespace legacy {
+
+// The following user-provided adaptors are used to serialize user-defined
+// thread id and time types into track events. For full compatibility, the user
+// should also define the following macros appropriately:
+//
+//   #define TRACE_TIME_TICKS_NOW() ...
+//   #define TRACE_TIME_NOW() ...
+
+// User-provided function to convert an abstract thread id into a thread track.
+template <typename T>
+ThreadTrack ConvertThreadId(const T&);
+
+// Built-in implementation for events referring to the current thread.
+template <>
+ThreadTrack PERFETTO_EXPORT
+ConvertThreadId(const PerfettoLegacyCurrentThreadId&);
+
+}  // namespace legacy
+
+namespace internal {
+
+// LegacyTraceId encapsulates an ID that can either be an integer or pointer.
+class PERFETTO_EXPORT LegacyTraceId {
+ public:
+  // Can be combined with WithScope.
+  class LocalId {
+   public:
+    explicit LocalId(const void* raw_id)
+        : raw_id_(static_cast<uint64_t>(reinterpret_cast<uintptr_t>(raw_id))) {}
+    explicit LocalId(uint64_t raw_id) : raw_id_(raw_id) {}
+    uint64_t raw_id() const { return raw_id_; }
+
+   private:
+    uint64_t raw_id_;
+  };
+
+  // Can be combined with WithScope.
+  class GlobalId {
+   public:
+    explicit GlobalId(uint64_t raw_id) : raw_id_(raw_id) {}
+    uint64_t raw_id() const { return raw_id_; }
+
+   private:
+    uint64_t raw_id_;
+  };
+
+  class WithScope {
+   public:
+    WithScope(const char* scope, uint64_t raw_id)
+        : scope_(scope), raw_id_(raw_id) {}
+    WithScope(const char* scope, LocalId local_id)
+        : scope_(scope), raw_id_(local_id.raw_id()) {
+      id_flags_ = legacy::kTraceEventFlagHasLocalId;
+    }
+    WithScope(const char* scope, GlobalId global_id)
+        : scope_(scope), raw_id_(global_id.raw_id()) {
+      id_flags_ = legacy::kTraceEventFlagHasGlobalId;
+    }
+    WithScope(const char* scope, uint64_t prefix, uint64_t raw_id)
+        : scope_(scope), has_prefix_(true), prefix_(prefix), raw_id_(raw_id) {}
+    WithScope(const char* scope, uint64_t prefix, GlobalId global_id)
+        : scope_(scope),
+          has_prefix_(true),
+          prefix_(prefix),
+          raw_id_(global_id.raw_id()) {
+      id_flags_ = legacy::kTraceEventFlagHasGlobalId;
+    }
+    uint64_t raw_id() const { return raw_id_; }
+    const char* scope() const { return scope_; }
+    bool has_prefix() const { return has_prefix_; }
+    uint64_t prefix() const { return prefix_; }
+    uint32_t id_flags() const { return id_flags_; }
+
+   private:
+    const char* scope_ = nullptr;
+    bool has_prefix_ = false;
+    uint64_t prefix_;
+    uint64_t raw_id_;
+    uint32_t id_flags_ = legacy::kTraceEventFlagHasId;
+  };
+
+  explicit LegacyTraceId(const void* raw_id)
+      : raw_id_(static_cast<uint64_t>(reinterpret_cast<uintptr_t>(raw_id))) {
+    id_flags_ = legacy::kTraceEventFlagHasLocalId;
+  }
+  explicit LegacyTraceId(uint64_t raw_id) : raw_id_(raw_id) {}
+  explicit LegacyTraceId(uint32_t raw_id) : raw_id_(raw_id) {}
+  explicit LegacyTraceId(uint16_t raw_id) : raw_id_(raw_id) {}
+  explicit LegacyTraceId(uint8_t raw_id) : raw_id_(raw_id) {}
+  explicit LegacyTraceId(int64_t raw_id)
+      : raw_id_(static_cast<uint64_t>(raw_id)) {}
+  explicit LegacyTraceId(int32_t raw_id)
+      : raw_id_(static_cast<uint64_t>(raw_id)) {}
+  explicit LegacyTraceId(int16_t raw_id)
+      : raw_id_(static_cast<uint64_t>(raw_id)) {}
+  explicit LegacyTraceId(int8_t raw_id)
+      : raw_id_(static_cast<uint64_t>(raw_id)) {}
+  explicit LegacyTraceId(LocalId raw_id) : raw_id_(raw_id.raw_id()) {
+    id_flags_ = legacy::kTraceEventFlagHasLocalId;
+  }
+  explicit LegacyTraceId(GlobalId raw_id) : raw_id_(raw_id.raw_id()) {
+    id_flags_ = legacy::kTraceEventFlagHasGlobalId;
+  }
+  explicit LegacyTraceId(WithScope scoped_id)
+      : scope_(scoped_id.scope()),
+        has_prefix_(scoped_id.has_prefix()),
+        prefix_(scoped_id.prefix()),
+        raw_id_(scoped_id.raw_id()),
+        id_flags_(scoped_id.id_flags()) {}
+
+  uint64_t raw_id() const { return raw_id_; }
+  const char* scope() const { return scope_; }
+  bool has_prefix() const { return has_prefix_; }
+  uint64_t prefix() const { return prefix_; }
+  uint32_t id_flags() const { return id_flags_; }
+
+  void Write(protos::pbzero::TrackEvent::LegacyEvent*,
+             uint32_t event_flags) const;
+
+ private:
+  const char* scope_ = nullptr;
+  bool has_prefix_ = false;
+  uint64_t prefix_;
+  uint64_t raw_id_;
+  uint32_t id_flags_ = legacy::kTraceEventFlagHasId;
+};
+
+}  // namespace internal
+}  // namespace perfetto
+
+#if PERFETTO_ENABLE_LEGACY_TRACE_EVENTS
+
+namespace perfetto {
+namespace internal {
+
+class PERFETTO_EXPORT TrackEventLegacy {
+ public:
+  static constexpr protos::pbzero::TrackEvent::Type PhaseToType(char phase) {
+    // clang-format off
+    return (phase == TRACE_EVENT_PHASE_BEGIN) ?
+               protos::pbzero::TrackEvent::TYPE_SLICE_BEGIN :
+           (phase == TRACE_EVENT_PHASE_END) ?
+               protos::pbzero::TrackEvent::TYPE_SLICE_END :
+           (phase == TRACE_EVENT_PHASE_INSTANT) ?
+               protos::pbzero::TrackEvent::TYPE_INSTANT :
+           protos::pbzero::TrackEvent::TYPE_UNSPECIFIED;
+    // clang-format on
+  }
+
+  // Reduce binary size overhead by outlining most of the code for writing a
+  // legacy trace event.
+  template <typename... Args>
+  static void WriteLegacyEvent(EventContext ctx,
+                               char phase,
+                               uint32_t flags,
+                               Args&&... args) PERFETTO_NO_INLINE {
+    AddDebugAnnotations(&ctx, std::forward<Args>(args)...);
+    if (NeedLegacyFlags(phase, flags)) {
+      auto legacy_event = ctx.event()->set_legacy_event();
+      SetLegacyFlags(legacy_event, phase, flags);
+    }
+  }
+
+  template <typename ThreadIdType, typename... Args>
+  static void WriteLegacyEventWithIdAndTid(EventContext ctx,
+                                           char phase,
+                                           uint32_t flags,
+                                           const LegacyTraceId& id,
+                                           const ThreadIdType& thread_id,
+                                           Args&&... args) PERFETTO_NO_INLINE {
+    //
+    // Overrides to consider:
+    //
+    // 1. If we have an id, we need to write {unscoped,local,global}_id and/or
+    //    bind_id.
+    // 2. If we have a thread id, we need to write track_uuid() or
+    //    {pid,tid}_override if the id represents another process.  The
+    //    conversion from |thread_id| happens in embedder code since the type is
+    //    embedder-specified.
+    // 3. If we have a timestamp, we need to write a different timestamp in the
+    //    trace packet itself and make sure TrackEvent won't write one
+    //    internally. This is already done at the call site.
+    //
+    flags |= id.id_flags();
+    AddDebugAnnotations(&ctx, std::forward<Args>(args)...);
+    if (NeedLegacyFlags(phase, flags)) {
+      auto legacy_event = ctx.event()->set_legacy_event();
+      SetLegacyFlags(legacy_event, phase, flags);
+      if (id.id_flags())
+        id.Write(legacy_event, flags);
+      if (flags & TRACE_EVENT_FLAG_HAS_PROCESS_ID) {
+        // The thread identifier actually represents a process id. Let's set an
+        // override for it.
+        int32_t pid_override =
+            static_cast<int32_t>(legacy::ConvertThreadId(thread_id).tid);
+        legacy_event->set_pid_override(pid_override);
+        legacy_event->set_tid_override(-1);
+      }
+    }
+  }
+
+  // No arguments.
+  static void AddDebugAnnotations(EventContext*) {}
+
+  // One argument.
+  template <typename ArgType>
+  static void AddDebugAnnotations(EventContext* ctx,
+                                  const char* arg_name,
+                                  ArgType&& arg_value) {
+    TrackEventInternal::AddDebugAnnotation(ctx, arg_name, arg_value);
+  }
+
+  // Two arguments.
+  template <typename ArgType, typename ArgType2>
+  static void AddDebugAnnotations(EventContext* ctx,
+                                  const char* arg_name,
+                                  ArgType&& arg_value,
+                                  const char* arg_name2,
+                                  ArgType2&& arg_value2) {
+    TrackEventInternal::AddDebugAnnotation(ctx, arg_name, arg_value);
+    TrackEventInternal::AddDebugAnnotation(ctx, arg_name2, arg_value2);
+  }
+
+ private:
+  static bool NeedLegacyFlags(char phase, uint32_t flags) {
+    if (PhaseToType(phase) == protos::pbzero::TrackEvent::TYPE_UNSPECIFIED)
+      return true;
+    // TODO(skyostil): Implement/deprecate:
+    // - TRACE_EVENT_FLAG_EXPLICIT_TIMESTAMP
+    // - TRACE_EVENT_FLAG_HAS_CONTEXT_ID
+    // - TRACE_EVENT_FLAG_TYPED_PROTO_ARGS
+    // - TRACE_EVENT_FLAG_JAVA_STRING_LITERALS
+    return flags &
+           (TRACE_EVENT_FLAG_HAS_ID | TRACE_EVENT_FLAG_HAS_LOCAL_ID |
+            TRACE_EVENT_FLAG_HAS_GLOBAL_ID | TRACE_EVENT_FLAG_ASYNC_TTS |
+            TRACE_EVENT_FLAG_BIND_TO_ENCLOSING | TRACE_EVENT_FLAG_FLOW_IN |
+            TRACE_EVENT_FLAG_FLOW_OUT | TRACE_EVENT_FLAG_HAS_PROCESS_ID);
+  }
+
+  static void SetLegacyFlags(
+      protos::pbzero::TrackEvent::LegacyEvent* legacy_event,
+      char phase,
+      uint32_t flags) {
+    if (PhaseToType(phase) == protos::pbzero::TrackEvent::TYPE_UNSPECIFIED)
+      legacy_event->set_phase(phase);
+    if (flags & TRACE_EVENT_FLAG_ASYNC_TTS)
+      legacy_event->set_use_async_tts(true);
+    if (flags & TRACE_EVENT_FLAG_BIND_TO_ENCLOSING)
+      legacy_event->set_bind_to_enclosing(true);
+
+    const auto kFlowIn = TRACE_EVENT_FLAG_FLOW_IN;
+    const auto kFlowOut = TRACE_EVENT_FLAG_FLOW_OUT;
+    const auto kFlowInOut = kFlowIn | kFlowOut;
+    if ((flags & kFlowInOut) == kFlowInOut) {
+      legacy_event->set_flow_direction(
+          protos::pbzero::TrackEvent::LegacyEvent::FLOW_INOUT);
+    } else if (flags & kFlowIn) {
+      legacy_event->set_flow_direction(
+          protos::pbzero::TrackEvent::LegacyEvent::FLOW_IN);
+    } else if (flags & kFlowOut) {
+      legacy_event->set_flow_direction(
+          protos::pbzero::TrackEvent::LegacyEvent::FLOW_OUT);
+    }
+  }
+};
+
+}  // namespace internal
+}  // namespace perfetto
+
+// Implementations for the INTERNAL_* adapter macros used by the trace points
+// below.
+#define PERFETTO_INTERNAL_LEGACY_EVENT_ON_TRACK(phase, category, name, track, \
+                                                ...)                          \
+  PERFETTO_INTERNAL_TRACK_EVENT(                                              \
+      category,                                                               \
+      ::perfetto::internal::GetStaticString(::perfetto::StaticString{name}),  \
+      ::perfetto::internal::TrackEventLegacy::PhaseToType(phase), track,      \
+      ##__VA_ARGS__);
+
+// The main entrypoint for writing unscoped legacy events.  This macro
+// determines the right track to write the event on based on |flags| and
+// |thread_id|.
+#define PERFETTO_INTERNAL_LEGACY_EVENT(phase, category, name, flags,         \
+                                       thread_id, ...)                       \
+  [&]() {                                                                    \
+    constexpr auto& kDefaultTrack =                                          \
+        ::perfetto::internal::TrackEventInternal::kDefaultTrack;             \
+    /* First check the scope for instant events. */                          \
+    if ((phase) == TRACE_EVENT_PHASE_INSTANT) {                              \
+      /* Note: Avoids the need to set LegacyEvent::instant_event_scope. */   \
+      auto scope = (flags)&TRACE_EVENT_FLAG_SCOPE_MASK;                      \
+      switch (scope) {                                                       \
+        case TRACE_EVENT_SCOPE_GLOBAL:                                       \
+          PERFETTO_INTERNAL_LEGACY_EVENT_ON_TRACK(                           \
+              phase, category, name, ::perfetto::Track::Global(0),           \
+              ##__VA_ARGS__);                                                \
+          return;                                                            \
+        case TRACE_EVENT_SCOPE_PROCESS:                                      \
+          PERFETTO_INTERNAL_LEGACY_EVENT_ON_TRACK(                           \
+              phase, category, name, ::perfetto::ProcessTrack::Current(),    \
+              ##__VA_ARGS__);                                                \
+          return;                                                            \
+        default:                                                             \
+        case TRACE_EVENT_SCOPE_THREAD:                                       \
+          /* Fallthrough. */                                                 \
+          break;                                                             \
+      }                                                                      \
+    }                                                                        \
+    /* If an event targets the current thread or another process, write      \
+     * it on the current thread's track. The process override case is        \
+     * handled through |pid_override| in WriteLegacyEvent. */                \
+    if (std::is_same<                                                        \
+            decltype(thread_id),                                             \
+            ::perfetto::legacy::PerfettoLegacyCurrentThreadId>::value ||     \
+        ((flags)&TRACE_EVENT_FLAG_HAS_PROCESS_ID)) {                         \
+      PERFETTO_INTERNAL_LEGACY_EVENT_ON_TRACK(phase, category, name,         \
+                                              kDefaultTrack, ##__VA_ARGS__); \
+    } else {                                                                 \
+      PERFETTO_INTERNAL_LEGACY_EVENT_ON_TRACK(                               \
+          phase, category, name,                                             \
+          ::perfetto::legacy::ConvertThreadId(thread_id), ##__VA_ARGS__);    \
+    }                                                                        \
+  }()
+
+#define INTERNAL_TRACE_EVENT_ADD(phase, category, name, flags, ...)        \
+  PERFETTO_INTERNAL_LEGACY_EVENT(                                          \
+      phase, category, name, flags, ::perfetto::legacy::kCurrentThreadId,  \
+      [&](perfetto::EventContext ctx) PERFETTO_NO_THREAD_SAFETY_ANALYSIS { \
+        using ::perfetto::internal::TrackEventLegacy;                      \
+        TrackEventLegacy::WriteLegacyEvent(std::move(ctx), phase, flags,   \
+                                           ##__VA_ARGS__);                 \
+      })
+
+// PERFETTO_INTERNAL_SCOPED_TRACK_EVENT does not require GetStaticString, as it
+// uses TRACE_EVENT_BEGIN/END internally, which already have this call.
+#define INTERNAL_TRACE_EVENT_ADD_SCOPED(category, name, ...)               \
+  PERFETTO_INTERNAL_SCOPED_TRACK_EVENT(                                    \
+      category, ::perfetto::StaticString{name},                            \
+      [&](perfetto::EventContext ctx) PERFETTO_NO_THREAD_SAFETY_ANALYSIS { \
+        using ::perfetto::internal::TrackEventLegacy;                      \
+        TrackEventLegacy::AddDebugAnnotations(&ctx, ##__VA_ARGS__);        \
+      })
+
+// PERFETTO_INTERNAL_SCOPED_TRACK_EVENT does not require GetStaticString, as it
+// uses TRACE_EVENT_BEGIN/END internally, which already have this call.
+#define INTERNAL_TRACE_EVENT_ADD_SCOPED_WITH_FLOW(category, name, bind_id,   \
+                                                  flags, ...)                \
+  PERFETTO_INTERNAL_SCOPED_TRACK_EVENT(                                      \
+      category, ::perfetto::StaticString{name},                              \
+      [&](perfetto::EventContext ctx) PERFETTO_NO_THREAD_SAFETY_ANALYSIS {   \
+        using ::perfetto::internal::TrackEventLegacy;                        \
+        ::perfetto::internal::LegacyTraceId PERFETTO_UID(trace_id){bind_id}; \
+        TrackEventLegacy::WriteLegacyEventWithIdAndTid(                      \
+            std::move(ctx), TRACE_EVENT_PHASE_BEGIN, flags,                  \
+            PERFETTO_UID(trace_id), TRACE_EVENT_API_CURRENT_THREAD_ID,       \
+            ##__VA_ARGS__);                                                  \
+      })
+
+#define INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(phase, category, name,     \
+                                                timestamp, flags, ...)     \
+  PERFETTO_INTERNAL_LEGACY_EVENT(                                          \
+      phase, category, name, flags, ::perfetto::legacy::kCurrentThreadId,  \
+      timestamp,                                                           \
+      [&](perfetto::EventContext ctx) PERFETTO_NO_THREAD_SAFETY_ANALYSIS { \
+        using ::perfetto::internal::TrackEventLegacy;                      \
+        TrackEventLegacy::WriteLegacyEvent(std::move(ctx), phase, flags,   \
+                                           ##__VA_ARGS__);                 \
+      })
+
+#define INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                  \
+    phase, category, name, id, thread_id, timestamp, flags, ...)             \
+  PERFETTO_INTERNAL_LEGACY_EVENT(                                            \
+      phase, category, name, flags, thread_id, timestamp,                    \
+      [&](perfetto::EventContext ctx) PERFETTO_NO_THREAD_SAFETY_ANALYSIS {   \
+        using ::perfetto::internal::TrackEventLegacy;                        \
+        ::perfetto::internal::LegacyTraceId PERFETTO_UID(trace_id){id};      \
+        TrackEventLegacy::WriteLegacyEventWithIdAndTid(                      \
+            std::move(ctx), phase, flags, PERFETTO_UID(trace_id), thread_id, \
+            ##__VA_ARGS__);                                                  \
+      })
+
+#define INTERNAL_TRACE_EVENT_ADD_WITH_ID(phase, category, name, id, flags, \
+                                         ...)                              \
+  PERFETTO_INTERNAL_LEGACY_EVENT(                                          \
+      phase, category, name, flags, ::perfetto::legacy::kCurrentThreadId,  \
+      [&](perfetto::EventContext ctx) PERFETTO_NO_THREAD_SAFETY_ANALYSIS { \
+        using ::perfetto::internal::TrackEventLegacy;                      \
+        ::perfetto::internal::LegacyTraceId PERFETTO_UID(trace_id){id};    \
+        TrackEventLegacy::WriteLegacyEventWithIdAndTid(                    \
+            std::move(ctx), phase, flags, PERFETTO_UID(trace_id),          \
+            TRACE_EVENT_API_CURRENT_THREAD_ID, ##__VA_ARGS__);             \
+      })
+
+#define INTERNAL_TRACE_EVENT_METADATA_ADD(category, name, ...)         \
+  INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_METADATA, category, name, \
+                           TRACE_EVENT_FLAG_NONE)
+
+// ----------------------------------------------------------------------------
+// Legacy tracing common API (adapted from trace_event_common.h).
+// ----------------------------------------------------------------------------
+
+#define TRACE_DISABLED_BY_DEFAULT(name) "disabled-by-default-" name
+
+// Scoped events.
+#define TRACE_EVENT0(category_group, name) \
+  INTERNAL_TRACE_EVENT_ADD_SCOPED(category_group, name)
+#define TRACE_EVENT_WITH_FLOW0(category_group, name, bind_id, flow_flags)  \
+  INTERNAL_TRACE_EVENT_ADD_SCOPED_WITH_FLOW(category_group, name, bind_id, \
+                                            flow_flags)
+#define TRACE_EVENT1(category_group, name, arg1_name, arg1_val) \
+  INTERNAL_TRACE_EVENT_ADD_SCOPED(category_group, name, arg1_name, arg1_val)
+#define TRACE_EVENT_WITH_FLOW1(category_group, name, bind_id, flow_flags,  \
+                               arg1_name, arg1_val)                        \
+  INTERNAL_TRACE_EVENT_ADD_SCOPED_WITH_FLOW(category_group, name, bind_id, \
+                                            flow_flags, arg1_name, arg1_val)
+#define TRACE_EVENT2(category_group, name, arg1_name, arg1_val, arg2_name,   \
+                     arg2_val)                                               \
+  INTERNAL_TRACE_EVENT_ADD_SCOPED(category_group, name, arg1_name, arg1_val, \
+                                  arg2_name, arg2_val)
+#define TRACE_EVENT_WITH_FLOW2(category_group, name, bind_id, flow_flags,    \
+                               arg1_name, arg1_val, arg2_name, arg2_val)     \
+  INTERNAL_TRACE_EVENT_ADD_SCOPED_WITH_FLOW(category_group, name, bind_id,   \
+                                            flow_flags, arg1_name, arg1_val, \
+                                            arg2_name, arg2_val)
+
+// Instant events.
+#define TRACE_EVENT_INSTANT0(category_group, name, scope)                   \
+  INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name, \
+                           TRACE_EVENT_FLAG_NONE | scope)
+#define TRACE_EVENT_INSTANT1(category_group, name, scope, arg1_name, arg1_val) \
+  INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name,    \
+                           TRACE_EVENT_FLAG_NONE | scope, arg1_name, arg1_val)
+#define TRACE_EVENT_INSTANT2(category_group, name, scope, arg1_name, arg1_val, \
+                             arg2_name, arg2_val)                              \
+  INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name,    \
+                           TRACE_EVENT_FLAG_NONE | scope, arg1_name, arg1_val, \
+                           arg2_name, arg2_val)
+#define TRACE_EVENT_COPY_INSTANT0(category_group, name, scope)              \
+  INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name, \
+                           TRACE_EVENT_FLAG_COPY | scope)
+#define TRACE_EVENT_COPY_INSTANT1(category_group, name, scope, arg1_name,   \
+                                  arg1_val)                                 \
+  INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name, \
+                           TRACE_EVENT_FLAG_COPY | scope, arg1_name, arg1_val)
+#define TRACE_EVENT_COPY_INSTANT2(category_group, name, scope, arg1_name,      \
+                                  arg1_val, arg2_name, arg2_val)               \
+  INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name,    \
+                           TRACE_EVENT_FLAG_COPY | scope, arg1_name, arg1_val, \
+                           arg2_name, arg2_val)
+#define TRACE_EVENT_INSTANT_WITH_FLAGS0(category_group, name, scope_and_flags) \
+  INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name,    \
+                           scope_and_flags)
+#define TRACE_EVENT_INSTANT_WITH_FLAGS1(category_group, name, scope_and_flags, \
+                                        arg1_name, arg1_val)                   \
+  INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name,    \
+                           scope_and_flags, arg1_name, arg1_val)
+
+// Instant events with explicit timestamps.
+#define TRACE_EVENT_INSTANT_WITH_TIMESTAMP0(category_group, name, scope,   \
+                                            timestamp)                     \
+  INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(TRACE_EVENT_PHASE_INSTANT,       \
+                                          category_group, name, timestamp, \
+                                          TRACE_EVENT_FLAG_NONE | scope)
+
+#define TRACE_EVENT_INSTANT_WITH_TIMESTAMP1(category_group, name, scope,  \
+                                            timestamp, arg_name, arg_val) \
+  INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(                                \
+      TRACE_EVENT_PHASE_INSTANT, category_group, name, timestamp,         \
+      TRACE_EVENT_FLAG_NONE | scope, arg_name, arg_val)
+
+// Begin events.
+#define TRACE_EVENT_BEGIN0(category_group, name)                          \
+  INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, category_group, name, \
+                           TRACE_EVENT_FLAG_NONE)
+#define TRACE_EVENT_BEGIN1(category_group, name, arg1_name, arg1_val)     \
+  INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, category_group, name, \
+                           TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
+#define TRACE_EVENT_BEGIN2(category_group, name, arg1_name, arg1_val,     \
+                           arg2_name, arg2_val)                           \
+  INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, category_group, name, \
+                           TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val,    \
+                           arg2_name, arg2_val)
+#define TRACE_EVENT_BEGIN_WITH_FLAGS0(category_group, name, flags) \
+  INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, category_group, name, flags)
+#define TRACE_EVENT_BEGIN_WITH_FLAGS1(category_group, name, flags, arg1_name, \
+                                      arg1_val)                               \
+  INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, category_group, name,     \
+                           flags, arg1_name, arg1_val)
+#define TRACE_EVENT_COPY_BEGIN2(category_group, name, arg1_name, arg1_val, \
+                                arg2_name, arg2_val)                       \
+  INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, category_group, name,  \
+                           TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val,     \
+                           arg2_name, arg2_val)
+
+// Begin events with explicit timestamps.
+#define TRACE_EVENT_BEGIN_WITH_ID_TID_AND_TIMESTAMP0(category_group, name, id, \
+                                                     thread_id, timestamp)     \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                          \
+      TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, thread_id,      \
+      timestamp, TRACE_EVENT_FLAG_NONE)
+#define TRACE_EVENT_COPY_BEGIN_WITH_ID_TID_AND_TIMESTAMP0(                \
+    category_group, name, id, thread_id, timestamp)                       \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                     \
+      TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, thread_id, \
+      timestamp, TRACE_EVENT_FLAG_COPY)
+#define TRACE_EVENT_COPY_BEGIN_WITH_ID_TID_AND_TIMESTAMP1(                \
+    category_group, name, id, thread_id, timestamp, arg1_name, arg1_val)  \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                     \
+      TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, thread_id, \
+      timestamp, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val)
+#define TRACE_EVENT_COPY_BEGIN_WITH_ID_TID_AND_TIMESTAMP2(                \
+    category_group, name, id, thread_id, timestamp, arg1_name, arg1_val,  \
+    arg2_name, arg2_val)                                                  \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                     \
+      TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, thread_id, \
+      timestamp, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, arg2_name,   \
+      arg2_val)
+
+// End events.
+#define TRACE_EVENT_END0(category_group, name)                          \
+  INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name, \
+                           TRACE_EVENT_FLAG_NONE)
+#define TRACE_EVENT_END1(category_group, name, arg1_name, arg1_val)     \
+  INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name, \
+                           TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
+#define TRACE_EVENT_END2(category_group, name, arg1_name, arg1_val, arg2_name, \
+                         arg2_val)                                             \
+  INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name,        \
+                           TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val,         \
+                           arg2_name, arg2_val)
+#define TRACE_EVENT_END_WITH_FLAGS0(category_group, name, flags) \
+  INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name, flags)
+#define TRACE_EVENT_END_WITH_FLAGS1(category_group, name, flags, arg1_name,    \
+                                    arg1_val)                                  \
+  INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name, flags, \
+                           arg1_name, arg1_val)
+#define TRACE_EVENT_COPY_END2(category_group, name, arg1_name, arg1_val, \
+                              arg2_name, arg2_val)                       \
+  INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name,  \
+                           TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val,   \
+                           arg2_name, arg2_val)
+
+// Mark events.
+#define TRACE_EVENT_MARK_WITH_TIMESTAMP0(category_group, name, timestamp)  \
+  INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(TRACE_EVENT_PHASE_MARK,          \
+                                          category_group, name, timestamp, \
+                                          TRACE_EVENT_FLAG_NONE)
+
+#define TRACE_EVENT_MARK_WITH_TIMESTAMP1(category_group, name, timestamp, \
+                                         arg1_name, arg1_val)             \
+  INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(                                \
+      TRACE_EVENT_PHASE_MARK, category_group, name, timestamp,            \
+      TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
+
+#define TRACE_EVENT_MARK_WITH_TIMESTAMP2(                                      \
+    category_group, name, timestamp, arg1_name, arg1_val, arg2_name, arg2_val) \
+  INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(                                     \
+      TRACE_EVENT_PHASE_MARK, category_group, name, timestamp,                 \
+      TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val)
+
+#define TRACE_EVENT_COPY_MARK(category_group, name)                      \
+  INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_MARK, category_group, name, \
+                           TRACE_EVENT_FLAG_COPY)
+
+#define TRACE_EVENT_COPY_MARK1(category_group, name, arg1_name, arg1_val) \
+  INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_MARK, category_group, name,  \
+                           TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val)
+
+#define TRACE_EVENT_COPY_MARK_WITH_TIMESTAMP(category_group, name, timestamp) \
+  INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(TRACE_EVENT_PHASE_MARK,             \
+                                          category_group, name, timestamp,    \
+                                          TRACE_EVENT_FLAG_COPY)
+
+// End events with explicit thread and timestamp.
+#define TRACE_EVENT_END_WITH_ID_TID_AND_TIMESTAMP0(category_group, name, id, \
+                                                   thread_id, timestamp)     \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                        \
+      TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, thread_id,      \
+      timestamp, TRACE_EVENT_FLAG_NONE)
+#define TRACE_EVENT_COPY_END_WITH_ID_TID_AND_TIMESTAMP0(                \
+    category_group, name, id, thread_id, timestamp)                     \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                   \
+      TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, thread_id, \
+      timestamp, TRACE_EVENT_FLAG_COPY)
+#define TRACE_EVENT_COPY_END_WITH_ID_TID_AND_TIMESTAMP1(                 \
+    category_group, name, id, thread_id, timestamp, arg1_name, arg1_val) \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                    \
+      TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, thread_id,  \
+      timestamp, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val)
+#define TRACE_EVENT_COPY_END_WITH_ID_TID_AND_TIMESTAMP2(                 \
+    category_group, name, id, thread_id, timestamp, arg1_name, arg1_val, \
+    arg2_name, arg2_val)                                                 \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                    \
+      TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, thread_id,  \
+      timestamp, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, arg2_name,  \
+      arg2_val)
+
+// Counters.
+#define TRACE_COUNTER1(category_group, name, value)                         \
+  INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, category_group, name, \
+                           TRACE_EVENT_FLAG_NONE, "value",                  \
+                           static_cast<int>(value))
+#define TRACE_COUNTER_WITH_FLAG1(category_group, name, flag, value)         \
+  INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, category_group, name, \
+                           flag, "value", static_cast<int>(value))
+#define TRACE_COPY_COUNTER1(category_group, name, value)                    \
+  INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, category_group, name, \
+                           TRACE_EVENT_FLAG_COPY, "value",                  \
+                           static_cast<int>(value))
+#define TRACE_COUNTER2(category_group, name, value1_name, value1_val,       \
+                       value2_name, value2_val)                             \
+  INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, category_group, name, \
+                           TRACE_EVENT_FLAG_NONE, value1_name,              \
+                           static_cast<int>(value1_val), value2_name,       \
+                           static_cast<int>(value2_val))
+#define TRACE_COPY_COUNTER2(category_group, name, value1_name, value1_val,  \
+                            value2_name, value2_val)                        \
+  INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, category_group, name, \
+                           TRACE_EVENT_FLAG_COPY, value1_name,              \
+                           static_cast<int>(value1_val), value2_name,       \
+                           static_cast<int>(value2_val))
+
+// Counters with explicit timestamps.
+#define TRACE_COUNTER_WITH_TIMESTAMP1(category_group, name, timestamp, value) \
+  INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(                                    \
+      TRACE_EVENT_PHASE_COUNTER, category_group, name, timestamp,             \
+      TRACE_EVENT_FLAG_NONE, "value", static_cast<int>(value))
+
+#define TRACE_COUNTER_WITH_TIMESTAMP2(category_group, name, timestamp,      \
+                                      value1_name, value1_val, value2_name, \
+                                      value2_val)                           \
+  INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(                                  \
+      TRACE_EVENT_PHASE_COUNTER, category_group, name, timestamp,           \
+      TRACE_EVENT_FLAG_NONE, value1_name, static_cast<int>(value1_val),     \
+      value2_name, static_cast<int>(value2_val))
+
+// Counters with ids.
+#define TRACE_COUNTER_ID1(category_group, name, id, value)                    \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, category_group, \
+                                   name, id, TRACE_EVENT_FLAG_NONE, "value",  \
+                                   static_cast<int>(value))
+#define TRACE_COPY_COUNTER_ID1(category_group, name, id, value)               \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, category_group, \
+                                   name, id, TRACE_EVENT_FLAG_COPY, "value",  \
+                                   static_cast<int>(value))
+#define TRACE_COUNTER_ID2(category_group, name, id, value1_name, value1_val,  \
+                          value2_name, value2_val)                            \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, category_group, \
+                                   name, id, TRACE_EVENT_FLAG_NONE,           \
+                                   value1_name, static_cast<int>(value1_val), \
+                                   value2_name, static_cast<int>(value2_val))
+#define TRACE_COPY_COUNTER_ID2(category_group, name, id, value1_name,         \
+                               value1_val, value2_name, value2_val)           \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, category_group, \
+                                   name, id, TRACE_EVENT_FLAG_COPY,           \
+                                   value1_name, static_cast<int>(value1_val), \
+                                   value2_name, static_cast<int>(value2_val))
+
+// Sampling profiler events.
+#define TRACE_EVENT_SAMPLE_WITH_ID1(category_group, name, id, arg1_name,       \
+                                    arg1_val)                                  \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_SAMPLE, category_group,   \
+                                   name, id, TRACE_EVENT_FLAG_NONE, arg1_name, \
+                                   arg1_val)
+
+// Legacy async events.
+#define TRACE_EVENT_ASYNC_BEGIN0(category_group, name, id)        \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \
+                                   category_group, name, id,      \
+                                   TRACE_EVENT_FLAG_NONE)
+#define TRACE_EVENT_ASYNC_BEGIN1(category_group, name, id, arg1_name, \
+                                 arg1_val)                            \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN,     \
+                                   category_group, name, id,          \
+                                   TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
+#define TRACE_EVENT_ASYNC_BEGIN2(category_group, name, id, arg1_name, \
+                                 arg1_val, arg2_name, arg2_val)       \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(                                   \
+      TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id,        \
+      TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val)
+#define TRACE_EVENT_COPY_ASYNC_BEGIN0(category_group, name, id)   \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \
+                                   category_group, name, id,      \
+                                   TRACE_EVENT_FLAG_COPY)
+#define TRACE_EVENT_COPY_ASYNC_BEGIN1(category_group, name, id, arg1_name, \
+                                      arg1_val)                            \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN,          \
+                                   category_group, name, id,               \
+                                   TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val)
+#define TRACE_EVENT_COPY_ASYNC_BEGIN2(category_group, name, id, arg1_name, \
+                                      arg1_val, arg2_name, arg2_val)       \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(                                        \
+      TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id,             \
+      TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, arg2_name, arg2_val)
+#define TRACE_EVENT_ASYNC_BEGIN_WITH_FLAGS0(category_group, name, id, flags) \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN,            \
+                                   category_group, name, id, flags)
+
+// Legacy async events with explicit timestamps.
+#define TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP0(category_group, name, id, \
+                                                timestamp)                \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                     \
+      TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id,            \
+      TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE)
+#define TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP1(                           \
+    category_group, name, id, timestamp, arg1_name, arg1_val)              \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                      \
+      TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id,             \
+      TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE, \
+      arg1_name, arg1_val)
+#define TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP2(category_group, name, id,      \
+                                                timestamp, arg1_name,          \
+                                                arg1_val, arg2_name, arg2_val) \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                          \
+      TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id,                 \
+      TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE,     \
+      arg1_name, arg1_val, arg2_name, arg2_val)
+#define TRACE_EVENT_COPY_ASYNC_BEGIN_WITH_TIMESTAMP0(category_group, name, id, \
+                                                     timestamp)                \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                          \
+      TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id,                 \
+      TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_COPY)
+#define TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP_AND_FLAGS0(     \
+    category_group, name, id, timestamp, flags)                \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(          \
+      TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, \
+      TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, flags)
+
+// Legacy async step into events.
+#define TRACE_EVENT_ASYNC_STEP_INTO0(category_group, name, id, step)  \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP_INTO, \
+                                   category_group, name, id,          \
+                                   TRACE_EVENT_FLAG_NONE, "step", step)
+#define TRACE_EVENT_ASYNC_STEP_INTO1(category_group, name, id, step, \
+                                     arg1_name, arg1_val)            \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(                                  \
+      TRACE_EVENT_PHASE_ASYNC_STEP_INTO, category_group, name, id,   \
+      TRACE_EVENT_FLAG_NONE, "step", step, arg1_name, arg1_val)
+
+// Legacy async step into events with timestamps.
+#define TRACE_EVENT_ASYNC_STEP_INTO_WITH_TIMESTAMP0(category_group, name, id, \
+                                                    step, timestamp)          \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                         \
+      TRACE_EVENT_PHASE_ASYNC_STEP_INTO, category_group, name, id,            \
+      TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE,    \
+      "step", step)
+
+// Legacy async step past events.
+#define TRACE_EVENT_ASYNC_STEP_PAST0(category_group, name, id, step)  \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP_PAST, \
+                                   category_group, name, id,          \
+                                   TRACE_EVENT_FLAG_NONE, "step", step)
+#define TRACE_EVENT_ASYNC_STEP_PAST1(category_group, name, id, step, \
+                                     arg1_name, arg1_val)            \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(                                  \
+      TRACE_EVENT_PHASE_ASYNC_STEP_PAST, category_group, name, id,   \
+      TRACE_EVENT_FLAG_NONE, "step", step, arg1_name, arg1_val)
+
+// Legacy async end events.
+#define TRACE_EVENT_ASYNC_END0(category_group, name, id)        \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \
+                                   category_group, name, id,    \
+                                   TRACE_EVENT_FLAG_NONE)
+#define TRACE_EVENT_ASYNC_END1(category_group, name, id, arg1_name, arg1_val) \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END,               \
+                                   category_group, name, id,                  \
+                                   TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
+#define TRACE_EVENT_ASYNC_END2(category_group, name, id, arg1_name, arg1_val, \
+                               arg2_name, arg2_val)                           \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(                                           \
+      TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id,                  \
+      TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val)
+#define TRACE_EVENT_COPY_ASYNC_END0(category_group, name, id)   \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \
+                                   category_group, name, id,    \
+                                   TRACE_EVENT_FLAG_COPY)
+#define TRACE_EVENT_COPY_ASYNC_END1(category_group, name, id, arg1_name, \
+                                    arg1_val)                            \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END,          \
+                                   category_group, name, id,             \
+                                   TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val)
+#define TRACE_EVENT_COPY_ASYNC_END2(category_group, name, id, arg1_name, \
+                                    arg1_val, arg2_name, arg2_val)       \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(                                      \
+      TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id,             \
+      TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, arg2_name, arg2_val)
+#define TRACE_EVENT_ASYNC_END_WITH_FLAGS0(category_group, name, id, flags) \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END,            \
+                                   category_group, name, id, flags)
+
+// Legacy async end events with explicit timestamps.
+#define TRACE_EVENT_ASYNC_END_WITH_TIMESTAMP0(category_group, name, id, \
+                                              timestamp)                \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                   \
+      TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id,            \
+      TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE)
+#define TRACE_EVENT_ASYNC_END_WITH_TIMESTAMP1(category_group, name, id,       \
+                                              timestamp, arg1_name, arg1_val) \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                         \
+      TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id,                  \
+      TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE,    \
+      arg1_name, arg1_val)
+#define TRACE_EVENT_ASYNC_END_WITH_TIMESTAMP2(category_group, name, id,       \
+                                              timestamp, arg1_name, arg1_val, \
+                                              arg2_name, arg2_val)            \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                         \
+      TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id,                  \
+      TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE,    \
+      arg1_name, arg1_val, arg2_name, arg2_val)
+#define TRACE_EVENT_COPY_ASYNC_END_WITH_TIMESTAMP0(category_group, name, id, \
+                                                   timestamp)                \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                        \
+      TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id,                 \
+      TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_COPY)
+#define TRACE_EVENT_ASYNC_END_WITH_TIMESTAMP_AND_FLAGS0(category_group, name, \
+                                                        id, timestamp, flags) \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                         \
+      TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id,                  \
+      TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, flags)
+
+// Async events.
+#define TRACE_EVENT_NESTABLE_ASYNC_BEGIN0(category_group, name, id)        \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, \
+                                   category_group, name, id,               \
+                                   TRACE_EVENT_FLAG_NONE)
+#define TRACE_EVENT_NESTABLE_ASYNC_BEGIN1(category_group, name, id, arg1_name, \
+                                          arg1_val)                            \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN,     \
+                                   category_group, name, id,                   \
+                                   TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
+#define TRACE_EVENT_NESTABLE_ASYNC_BEGIN2(category_group, name, id, arg1_name, \
+                                          arg1_val, arg2_name, arg2_val)       \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(                                            \
+      TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, category_group, name, id,        \
+      TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val)
+#define TRACE_EVENT_NESTABLE_ASYNC_BEGIN_WITH_TIMESTAMP1(                  \
+    category_group, name, id, timestamp, arg1_name, arg1_val)              \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                      \
+      TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, category_group, name, id,    \
+      TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE, \
+      arg1_name, arg1_val)
+
+// Async end events.
+#define TRACE_EVENT_NESTABLE_ASYNC_END0(category_group, name, id)        \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, \
+                                   category_group, name, id,             \
+                                   TRACE_EVENT_FLAG_NONE)
+#define TRACE_EVENT_NESTABLE_ASYNC_END1(category_group, name, id, arg1_name, \
+                                        arg1_val)                            \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_END,     \
+                                   category_group, name, id,                 \
+                                   TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
+#define TRACE_EVENT_NESTABLE_ASYNC_END2(category_group, name, id, arg1_name, \
+                                        arg1_val, arg2_name, arg2_val)       \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(                                          \
+      TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, category_group, name, id,        \
+      TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val)
+
+// Async instant events.
+#define TRACE_EVENT_NESTABLE_ASYNC_INSTANT0(category_group, name, id)        \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT, \
+                                   category_group, name, id,                 \
+                                   TRACE_EVENT_FLAG_NONE)
+#define TRACE_EVENT_NESTABLE_ASYNC_INSTANT1(category_group, name, id,        \
+                                            arg1_name, arg1_val)             \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT, \
+                                   category_group, name, id,                 \
+                                   TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
+#define TRACE_EVENT_NESTABLE_ASYNC_INSTANT2(                              \
+    category_group, name, id, arg1_name, arg1_val, arg2_name, arg2_val)   \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(                                       \
+      TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT, category_group, name, id, \
+      TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val)
+#define TRACE_EVENT_COPY_NESTABLE_ASYNC_BEGIN_WITH_TTS2(                       \
+    category_group, name, id, arg1_name, arg1_val, arg2_name, arg2_val)        \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(                                            \
+      TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, category_group, name, id,        \
+      TRACE_EVENT_FLAG_ASYNC_TTS | TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, \
+      arg2_name, arg2_val)
+#define TRACE_EVENT_COPY_NESTABLE_ASYNC_END_WITH_TTS2(                         \
+    category_group, name, id, arg1_name, arg1_val, arg2_name, arg2_val)        \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(                                            \
+      TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, category_group, name, id,          \
+      TRACE_EVENT_FLAG_ASYNC_TTS | TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, \
+      arg2_name, arg2_val)
+
+// Async events with explicit timestamps.
+#define TRACE_EVENT_NESTABLE_ASYNC_BEGIN_WITH_TIMESTAMP0(category_group, name, \
+                                                         id, timestamp)        \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                          \
+      TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, category_group, name, id,        \
+      TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE)
+#define TRACE_EVENT_NESTABLE_ASYNC_END_WITH_TIMESTAMP0(category_group, name, \
+                                                       id, timestamp)        \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                        \
+      TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, category_group, name, id,        \
+      TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE)
+#define TRACE_EVENT_NESTABLE_ASYNC_END_WITH_TIMESTAMP1(                    \
+    category_group, name, id, timestamp, arg1_name, arg1_val)              \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                      \
+      TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, category_group, name, id,      \
+      TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE, \
+      arg1_name, arg1_val)
+#define TRACE_EVENT_NESTABLE_ASYNC_INSTANT_WITH_TIMESTAMP0(               \
+    category_group, name, id, timestamp)                                  \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                     \
+      TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT, category_group, name, id, \
+      TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE)
+#define TRACE_EVENT_COPY_NESTABLE_ASYNC_BEGIN0(category_group, name, id)   \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, \
+                                   category_group, name, id,               \
+                                   TRACE_EVENT_FLAG_COPY)
+#define TRACE_EVENT_COPY_NESTABLE_ASYNC_END0(category_group, name, id)   \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, \
+                                   category_group, name, id,             \
+                                   TRACE_EVENT_FLAG_COPY)
+#define TRACE_EVENT_COPY_NESTABLE_ASYNC_BEGIN_WITH_TIMESTAMP0(          \
+    category_group, name, id, timestamp)                                \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                   \
+      TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, category_group, name, id, \
+      TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_COPY)
+#define TRACE_EVENT_COPY_NESTABLE_ASYNC_END_WITH_TIMESTAMP0(          \
+    category_group, name, id, timestamp)                              \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                 \
+      TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, category_group, name, id, \
+      TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_COPY)
+#define TRACE_EVENT_NESTABLE_ASYNC_END_WITH_TIMESTAMP2(                    \
+    category_group, name, id, timestamp, arg1_name, arg1_val, arg2_name,   \
+    arg2_val)                                                              \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                      \
+      TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, category_group, name, id,      \
+      TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE, \
+      arg1_name, arg1_val, arg2_name, arg2_val)
+
+// Metadata events.
+#define TRACE_EVENT_METADATA1(category_group, name, arg1_name, arg1_val) \
+  INTERNAL_TRACE_EVENT_METADATA_ADD(category_group, name, arg1_name, arg1_val)
+
+// Clock sync events.
+#define TRACE_EVENT_CLOCK_SYNC_RECEIVER(sync_id)                           \
+  INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_CLOCK_SYNC, "__metadata",     \
+                           "clock_sync", TRACE_EVENT_FLAG_NONE, "sync_id", \
+                           sync_id)
+#define TRACE_EVENT_CLOCK_SYNC_ISSUER(sync_id, issue_ts, issue_end_ts)        \
+  INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(                                    \
+      TRACE_EVENT_PHASE_CLOCK_SYNC, "__metadata", "clock_sync", issue_end_ts, \
+      TRACE_EVENT_FLAG_NONE, "sync_id", sync_id, "issue_ts", issue_ts)
+
+// Object events.
+#define TRACE_EVENT_OBJECT_CREATED_WITH_ID(category_group, name, id) \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_CREATE_OBJECT,  \
+                                   category_group, name, id,         \
+                                   TRACE_EVENT_FLAG_NONE)
+
+#define TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(category_group, name, id, \
+                                            snapshot)                 \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(                                   \
+      TRACE_EVENT_PHASE_SNAPSHOT_OBJECT, category_group, name, id,    \
+      TRACE_EVENT_FLAG_NONE, "snapshot", snapshot)
+
+#define TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID_AND_TIMESTAMP(                 \
+    category_group, name, id, timestamp, snapshot)                         \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                      \
+      TRACE_EVENT_PHASE_SNAPSHOT_OBJECT, category_group, name, id,         \
+      TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE, \
+      "snapshot", snapshot)
+
+#define TRACE_EVENT_OBJECT_DELETED_WITH_ID(category_group, name, id) \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_DELETE_OBJECT,  \
+                                   category_group, name, id,         \
+                                   TRACE_EVENT_FLAG_NONE)
+
+// Context events.
+#define TRACE_EVENT_ENTER_CONTEXT(category_group, name, context)    \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ENTER_CONTEXT, \
+                                   category_group, name, context,   \
+                                   TRACE_EVENT_FLAG_NONE)
+#define TRACE_EVENT_LEAVE_CONTEXT(category_group, name, context)    \
+  INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_LEAVE_CONTEXT, \
+                                   category_group, name, context,   \
+                                   TRACE_EVENT_FLAG_NONE)
+
+// TODO(skyostil): Implement binary-efficient trace events.
+#define TRACE_EVENT_BINARY_EFFICIENT0 TRACE_EVENT0
+#define TRACE_EVENT_BINARY_EFFICIENT1 TRACE_EVENT1
+#define TRACE_EVENT_BINARY_EFFICIENT2 TRACE_EVENT2
+
+// Macro to efficiently determine if a given category group is enabled.
+#define TRACE_EVENT_CATEGORY_GROUP_ENABLED(category, ret) \
+  do {                                                    \
+    *ret = TRACE_EVENT_CATEGORY_ENABLED(category);        \
+  } while (0)
+
+// Macro to efficiently determine, through polling, if a new trace has begun.
+#define TRACE_EVENT_IS_NEW_TRACE(ret)                                \
+  do {                                                               \
+    static int PERFETTO_UID(prev) = -1;                              \
+    int PERFETTO_UID(curr) =                                         \
+        ::perfetto::internal::TrackEventInternal::GetSessionCount(); \
+    if (::PERFETTO_TRACK_EVENT_NAMESPACE::TrackEvent::IsEnabled() && \
+        (PERFETTO_UID(prev) != PERFETTO_UID(curr))) {                \
+      *(ret) = true;                                                 \
+      PERFETTO_UID(prev) = PERFETTO_UID(curr);                       \
+    } else {                                                         \
+      *(ret) = false;                                                \
+    }                                                                \
+  } while (0)
+
+// ----------------------------------------------------------------------------
+// Legacy tracing API (adapted from trace_event.h).
+// ----------------------------------------------------------------------------
+
+// We can implement the following subset of the legacy tracing API without
+// involvement from the embedder. APIs such as TRACE_EVENT_API_ADD_TRACE_EVENT
+// are still up to the embedder to define.
+
+#define TRACE_STR_COPY(str) (str)
+
+#define TRACE_ID_WITH_SCOPE(scope, ...) \
+  ::perfetto::internal::LegacyTraceId::WithScope(scope, ##__VA_ARGS__)
+
+// Use this for ids that are unique across processes. This allows different
+// processes to use the same id to refer to the same event.
+#define TRACE_ID_GLOBAL(id) ::perfetto::internal::LegacyTraceId::GlobalId(id)
+
+// Use this for ids that are unique within a single process. This allows
+// different processes to use the same id to refer to different events.
+#define TRACE_ID_LOCAL(id) ::perfetto::internal::LegacyTraceId::LocalId(id)
+
+// Returns a pointer to a uint8_t which indicates whether tracing is enabled for
+// the given category or not. A zero value means tracing is disabled and
+// non-zero indicates at least one tracing session for this category is active.
+// Note that callers should not make any assumptions at what each bit represents
+// in the status byte. Does not support dynamic categories.
+#define TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(category)                \
+  reinterpret_cast<const uint8_t*>(                                         \
+      [&] {                                                                 \
+        static_assert(                                                      \
+            !std::is_same<::perfetto::DynamicCategory,                      \
+                          decltype(category)>::value,                       \
+            "Enabled flag pointers are not supported for dynamic trace "    \
+            "categories.");                                                 \
+      },                                                                    \
+      PERFETTO_TRACK_EVENT_NAMESPACE::internal::kConstExprCategoryRegistry  \
+          .GetCategoryState(                                                \
+              ::PERFETTO_TRACK_EVENT_NAMESPACE::internal::kCategoryRegistry \
+                  .Find(category, /*is_dynamic=*/false)))
+
+// Given a pointer returned by TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED,
+// yields a pointer to the name of the corresponding category group.
+#define TRACE_EVENT_API_GET_CATEGORY_GROUP_NAME(category_enabled_ptr)       \
+  ::PERFETTO_TRACK_EVENT_NAMESPACE::internal::kConstExprCategoryRegistry    \
+      .GetCategory(                                                         \
+          category_enabled_ptr -                                            \
+          reinterpret_cast<const uint8_t*>(                                 \
+              ::PERFETTO_TRACK_EVENT_NAMESPACE::internal::kCategoryRegistry \
+                  .GetCategoryState(0u)))                                   \
+      ->name
+
+#endif  // PERFETTO_ENABLE_LEGACY_TRACE_EVENTS
+
+#endif  // INCLUDE_PERFETTO_TRACING_TRACK_EVENT_LEGACY_H_
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_TRACING_H_
+#define INCLUDE_PERFETTO_TRACING_H_
+
+// This headers wraps all the headers necessary to use the public Perfetto
+// Tracing API. Embedders should preferably use this one header to avoid having
+// to figure out the various set of header required for each class.
+// The only exception to this should be large projects where build time is a
+// concern (e.g. chromium), which migh prefer sticking to strict IWYU.
+
+// gen_amalgamated expanded: #include "perfetto/tracing/buffer_exhausted_policy.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/console_interceptor.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/data_source_config.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/data_source_descriptor.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/core/trace_config.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/data_source.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/interceptor.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/platform.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/tracing.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/tracing_backend.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/track_event.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/track_event_interned_data_index.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/track_event_legacy.h"
+// gen_amalgamated expanded: #include "perfetto/tracing/track_event_state_tracker.h"
+
+#endif  // INCLUDE_PERFETTO_TRACING_H_
+// gen_amalgamated begin header: gen/protos/perfetto/common/android_energy_consumer_descriptor.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_ANDROID_ENERGY_CONSUMER_DESCRIPTOR_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_ANDROID_ENERGY_CONSUMER_DESCRIPTOR_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class AndroidEnergyConsumerDescriptor;
+class AndroidEnergyConsumer;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT AndroidEnergyConsumerDescriptor : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kEnergyConsumersFieldNumber = 1,
+  };
+
+  AndroidEnergyConsumerDescriptor();
+  ~AndroidEnergyConsumerDescriptor() override;
+  AndroidEnergyConsumerDescriptor(AndroidEnergyConsumerDescriptor&&) noexcept;
+  AndroidEnergyConsumerDescriptor& operator=(AndroidEnergyConsumerDescriptor&&);
+  AndroidEnergyConsumerDescriptor(const AndroidEnergyConsumerDescriptor&);
+  AndroidEnergyConsumerDescriptor& operator=(const AndroidEnergyConsumerDescriptor&);
+  bool operator==(const AndroidEnergyConsumerDescriptor&) const;
+  bool operator!=(const AndroidEnergyConsumerDescriptor& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<AndroidEnergyConsumer>& energy_consumers() const { return energy_consumers_; }
+  std::vector<AndroidEnergyConsumer>* mutable_energy_consumers() { return &energy_consumers_; }
+  int energy_consumers_size() const;
+  void clear_energy_consumers();
+  AndroidEnergyConsumer* add_energy_consumers();
+
+ private:
+  std::vector<AndroidEnergyConsumer> energy_consumers_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT AndroidEnergyConsumer : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kEnergyConsumerIdFieldNumber = 1,
+    kOrdinalFieldNumber = 2,
+    kTypeFieldNumber = 3,
+    kNameFieldNumber = 4,
+  };
+
+  AndroidEnergyConsumer();
+  ~AndroidEnergyConsumer() override;
+  AndroidEnergyConsumer(AndroidEnergyConsumer&&) noexcept;
+  AndroidEnergyConsumer& operator=(AndroidEnergyConsumer&&);
+  AndroidEnergyConsumer(const AndroidEnergyConsumer&);
+  AndroidEnergyConsumer& operator=(const AndroidEnergyConsumer&);
+  bool operator==(const AndroidEnergyConsumer&) const;
+  bool operator!=(const AndroidEnergyConsumer& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_energy_consumer_id() const { return _has_field_[1]; }
+  int32_t energy_consumer_id() const { return energy_consumer_id_; }
+  void set_energy_consumer_id(int32_t value) { energy_consumer_id_ = value; _has_field_.set(1); }
+
+  bool has_ordinal() const { return _has_field_[2]; }
+  int32_t ordinal() const { return ordinal_; }
+  void set_ordinal(int32_t value) { ordinal_ = value; _has_field_.set(2); }
+
+  bool has_type() const { return _has_field_[3]; }
+  const std::string& type() const { return type_; }
+  void set_type(const std::string& value) { type_ = value; _has_field_.set(3); }
+
+  bool has_name() const { return _has_field_[4]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(4); }
+
+ private:
+  int32_t energy_consumer_id_{};
+  int32_t ordinal_{};
+  std::string type_{};
+  std::string name_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<5> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_ANDROID_ENERGY_CONSUMER_DESCRIPTOR_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/common/android_log_constants.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_ANDROID_LOG_CONSTANTS_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_ANDROID_LOG_CONSTANTS_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum AndroidLogId : int;
+enum AndroidLogPriority : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum AndroidLogId : int {
+  LID_DEFAULT = 0,
+  LID_RADIO = 1,
+  LID_EVENTS = 2,
+  LID_SYSTEM = 3,
+  LID_CRASH = 4,
+  LID_STATS = 5,
+  LID_SECURITY = 6,
+  LID_KERNEL = 7,
+};
+enum AndroidLogPriority : int {
+  PRIO_UNSPECIFIED = 0,
+  PRIO_UNUSED = 1,
+  PRIO_VERBOSE = 2,
+  PRIO_DEBUG = 3,
+  PRIO_INFO = 4,
+  PRIO_WARN = 5,
+  PRIO_ERROR = 6,
+  PRIO_FATAL = 7,
+};
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_ANDROID_LOG_CONSTANTS_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/common/builtin_clock.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_BUILTIN_CLOCK_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_BUILTIN_CLOCK_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum BuiltinClock : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum BuiltinClock : int {
+  BUILTIN_CLOCK_UNKNOWN = 0,
+  BUILTIN_CLOCK_REALTIME = 1,
+  BUILTIN_CLOCK_REALTIME_COARSE = 2,
+  BUILTIN_CLOCK_MONOTONIC = 3,
+  BUILTIN_CLOCK_MONOTONIC_COARSE = 4,
+  BUILTIN_CLOCK_MONOTONIC_RAW = 5,
+  BUILTIN_CLOCK_BOOTTIME = 6,
+  BUILTIN_CLOCK_MAX_ID = 63,
+};
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_BUILTIN_CLOCK_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/common/commit_data_request.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_COMMIT_DATA_REQUEST_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_COMMIT_DATA_REQUEST_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class CommitDataRequest;
+class CommitDataRequest_ChunkToPatch;
+class CommitDataRequest_ChunkToPatch_Patch;
+class CommitDataRequest_ChunksToMove;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT CommitDataRequest : public ::protozero::CppMessageObj {
+ public:
+  using ChunksToMove = CommitDataRequest_ChunksToMove;
+  using ChunkToPatch = CommitDataRequest_ChunkToPatch;
+  enum FieldNumbers {
+    kChunksToMoveFieldNumber = 1,
+    kChunksToPatchFieldNumber = 2,
+    kFlushRequestIdFieldNumber = 3,
+  };
+
+  CommitDataRequest();
+  ~CommitDataRequest() override;
+  CommitDataRequest(CommitDataRequest&&) noexcept;
+  CommitDataRequest& operator=(CommitDataRequest&&);
+  CommitDataRequest(const CommitDataRequest&);
+  CommitDataRequest& operator=(const CommitDataRequest&);
+  bool operator==(const CommitDataRequest&) const;
+  bool operator!=(const CommitDataRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<CommitDataRequest_ChunksToMove>& chunks_to_move() const { return chunks_to_move_; }
+  std::vector<CommitDataRequest_ChunksToMove>* mutable_chunks_to_move() { return &chunks_to_move_; }
+  int chunks_to_move_size() const;
+  void clear_chunks_to_move();
+  CommitDataRequest_ChunksToMove* add_chunks_to_move();
+
+  const std::vector<CommitDataRequest_ChunkToPatch>& chunks_to_patch() const { return chunks_to_patch_; }
+  std::vector<CommitDataRequest_ChunkToPatch>* mutable_chunks_to_patch() { return &chunks_to_patch_; }
+  int chunks_to_patch_size() const;
+  void clear_chunks_to_patch();
+  CommitDataRequest_ChunkToPatch* add_chunks_to_patch();
+
+  bool has_flush_request_id() const { return _has_field_[3]; }
+  uint64_t flush_request_id() const { return flush_request_id_; }
+  void set_flush_request_id(uint64_t value) { flush_request_id_ = value; _has_field_.set(3); }
+
+ private:
+  std::vector<CommitDataRequest_ChunksToMove> chunks_to_move_;
+  std::vector<CommitDataRequest_ChunkToPatch> chunks_to_patch_;
+  uint64_t flush_request_id_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<4> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT CommitDataRequest_ChunkToPatch : public ::protozero::CppMessageObj {
+ public:
+  using Patch = CommitDataRequest_ChunkToPatch_Patch;
+  enum FieldNumbers {
+    kTargetBufferFieldNumber = 1,
+    kWriterIdFieldNumber = 2,
+    kChunkIdFieldNumber = 3,
+    kPatchesFieldNumber = 4,
+    kHasMorePatchesFieldNumber = 5,
+  };
+
+  CommitDataRequest_ChunkToPatch();
+  ~CommitDataRequest_ChunkToPatch() override;
+  CommitDataRequest_ChunkToPatch(CommitDataRequest_ChunkToPatch&&) noexcept;
+  CommitDataRequest_ChunkToPatch& operator=(CommitDataRequest_ChunkToPatch&&);
+  CommitDataRequest_ChunkToPatch(const CommitDataRequest_ChunkToPatch&);
+  CommitDataRequest_ChunkToPatch& operator=(const CommitDataRequest_ChunkToPatch&);
+  bool operator==(const CommitDataRequest_ChunkToPatch&) const;
+  bool operator!=(const CommitDataRequest_ChunkToPatch& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_target_buffer() const { return _has_field_[1]; }
+  uint32_t target_buffer() const { return target_buffer_; }
+  void set_target_buffer(uint32_t value) { target_buffer_ = value; _has_field_.set(1); }
+
+  bool has_writer_id() const { return _has_field_[2]; }
+  uint32_t writer_id() const { return writer_id_; }
+  void set_writer_id(uint32_t value) { writer_id_ = value; _has_field_.set(2); }
+
+  bool has_chunk_id() const { return _has_field_[3]; }
+  uint32_t chunk_id() const { return chunk_id_; }
+  void set_chunk_id(uint32_t value) { chunk_id_ = value; _has_field_.set(3); }
+
+  const std::vector<CommitDataRequest_ChunkToPatch_Patch>& patches() const { return patches_; }
+  std::vector<CommitDataRequest_ChunkToPatch_Patch>* mutable_patches() { return &patches_; }
+  int patches_size() const;
+  void clear_patches();
+  CommitDataRequest_ChunkToPatch_Patch* add_patches();
+
+  bool has_has_more_patches() const { return _has_field_[5]; }
+  bool has_more_patches() const { return has_more_patches_; }
+  void set_has_more_patches(bool value) { has_more_patches_ = value; _has_field_.set(5); }
+
+ private:
+  uint32_t target_buffer_{};
+  uint32_t writer_id_{};
+  uint32_t chunk_id_{};
+  std::vector<CommitDataRequest_ChunkToPatch_Patch> patches_;
+  bool has_more_patches_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<6> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT CommitDataRequest_ChunkToPatch_Patch : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kOffsetFieldNumber = 1,
+    kDataFieldNumber = 2,
+  };
+
+  CommitDataRequest_ChunkToPatch_Patch();
+  ~CommitDataRequest_ChunkToPatch_Patch() override;
+  CommitDataRequest_ChunkToPatch_Patch(CommitDataRequest_ChunkToPatch_Patch&&) noexcept;
+  CommitDataRequest_ChunkToPatch_Patch& operator=(CommitDataRequest_ChunkToPatch_Patch&&);
+  CommitDataRequest_ChunkToPatch_Patch(const CommitDataRequest_ChunkToPatch_Patch&);
+  CommitDataRequest_ChunkToPatch_Patch& operator=(const CommitDataRequest_ChunkToPatch_Patch&);
+  bool operator==(const CommitDataRequest_ChunkToPatch_Patch&) const;
+  bool operator!=(const CommitDataRequest_ChunkToPatch_Patch& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_offset() const { return _has_field_[1]; }
+  uint32_t offset() const { return offset_; }
+  void set_offset(uint32_t value) { offset_ = value; _has_field_.set(1); }
+
+  bool has_data() const { return _has_field_[2]; }
+  const std::string& data() const { return data_; }
+  void set_data(const std::string& value) { data_ = value; _has_field_.set(2); }
+  void set_data(const void* p, size_t s) { data_.assign(reinterpret_cast<const char*>(p), s); _has_field_.set(2); }
+
+ private:
+  uint32_t offset_{};
+  std::string data_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT CommitDataRequest_ChunksToMove : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kPageFieldNumber = 1,
+    kChunkFieldNumber = 2,
+    kTargetBufferFieldNumber = 3,
+  };
+
+  CommitDataRequest_ChunksToMove();
+  ~CommitDataRequest_ChunksToMove() override;
+  CommitDataRequest_ChunksToMove(CommitDataRequest_ChunksToMove&&) noexcept;
+  CommitDataRequest_ChunksToMove& operator=(CommitDataRequest_ChunksToMove&&);
+  CommitDataRequest_ChunksToMove(const CommitDataRequest_ChunksToMove&);
+  CommitDataRequest_ChunksToMove& operator=(const CommitDataRequest_ChunksToMove&);
+  bool operator==(const CommitDataRequest_ChunksToMove&) const;
+  bool operator!=(const CommitDataRequest_ChunksToMove& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_page() const { return _has_field_[1]; }
+  uint32_t page() const { return page_; }
+  void set_page(uint32_t value) { page_ = value; _has_field_.set(1); }
+
+  bool has_chunk() const { return _has_field_[2]; }
+  uint32_t chunk() const { return chunk_; }
+  void set_chunk(uint32_t value) { chunk_ = value; _has_field_.set(2); }
+
+  bool has_target_buffer() const { return _has_field_[3]; }
+  uint32_t target_buffer() const { return target_buffer_; }
+  void set_target_buffer(uint32_t value) { target_buffer_ = value; _has_field_.set(3); }
+
+ private:
+  uint32_t page_{};
+  uint32_t chunk_{};
+  uint32_t target_buffer_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<4> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_COMMIT_DATA_REQUEST_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/common/data_source_descriptor.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DATA_SOURCE_DESCRIPTOR_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DATA_SOURCE_DESCRIPTOR_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class DataSourceDescriptor;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT DataSourceDescriptor : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNameFieldNumber = 1,
+    kWillNotifyOnStopFieldNumber = 2,
+    kWillNotifyOnStartFieldNumber = 3,
+    kHandlesIncrementalStateClearFieldNumber = 4,
+    kGpuCounterDescriptorFieldNumber = 5,
+    kTrackEventDescriptorFieldNumber = 6,
+  };
+
+  DataSourceDescriptor();
+  ~DataSourceDescriptor() override;
+  DataSourceDescriptor(DataSourceDescriptor&&) noexcept;
+  DataSourceDescriptor& operator=(DataSourceDescriptor&&);
+  DataSourceDescriptor(const DataSourceDescriptor&);
+  DataSourceDescriptor& operator=(const DataSourceDescriptor&);
+  bool operator==(const DataSourceDescriptor&) const;
+  bool operator!=(const DataSourceDescriptor& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name() const { return _has_field_[1]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
+
+  bool has_will_notify_on_stop() const { return _has_field_[2]; }
+  bool will_notify_on_stop() const { return will_notify_on_stop_; }
+  void set_will_notify_on_stop(bool value) { will_notify_on_stop_ = value; _has_field_.set(2); }
+
+  bool has_will_notify_on_start() const { return _has_field_[3]; }
+  bool will_notify_on_start() const { return will_notify_on_start_; }
+  void set_will_notify_on_start(bool value) { will_notify_on_start_ = value; _has_field_.set(3); }
+
+  bool has_handles_incremental_state_clear() const { return _has_field_[4]; }
+  bool handles_incremental_state_clear() const { return handles_incremental_state_clear_; }
+  void set_handles_incremental_state_clear(bool value) { handles_incremental_state_clear_ = value; _has_field_.set(4); }
+
+  const std::string& gpu_counter_descriptor_raw() const { return gpu_counter_descriptor_; }
+  void set_gpu_counter_descriptor_raw(const std::string& raw) { gpu_counter_descriptor_ = raw; _has_field_.set(5); }
+
+  const std::string& track_event_descriptor_raw() const { return track_event_descriptor_; }
+  void set_track_event_descriptor_raw(const std::string& raw) { track_event_descriptor_ = raw; _has_field_.set(6); }
+
+ private:
+  std::string name_{};
+  bool will_notify_on_stop_{};
+  bool will_notify_on_start_{};
+  bool handles_incremental_state_clear_{};
+  std::string gpu_counter_descriptor_;  // [lazy=true]
+  std::string track_event_descriptor_;  // [lazy=true]
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<7> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DATA_SOURCE_DESCRIPTOR_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/common/descriptor.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DESCRIPTOR_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DESCRIPTOR_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class OneofOptions;
+class EnumValueDescriptorProto;
+class EnumDescriptorProto;
+class OneofDescriptorProto;
+class FieldDescriptorProto;
+class DescriptorProto;
+class DescriptorProto_ReservedRange;
+class FileDescriptorProto;
+class FileDescriptorSet;
+enum FieldDescriptorProto_Type : int;
+enum FieldDescriptorProto_Label : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum FieldDescriptorProto_Type : int {
+  FieldDescriptorProto_Type_TYPE_DOUBLE = 1,
+  FieldDescriptorProto_Type_TYPE_FLOAT = 2,
+  FieldDescriptorProto_Type_TYPE_INT64 = 3,
+  FieldDescriptorProto_Type_TYPE_UINT64 = 4,
+  FieldDescriptorProto_Type_TYPE_INT32 = 5,
+  FieldDescriptorProto_Type_TYPE_FIXED64 = 6,
+  FieldDescriptorProto_Type_TYPE_FIXED32 = 7,
+  FieldDescriptorProto_Type_TYPE_BOOL = 8,
+  FieldDescriptorProto_Type_TYPE_STRING = 9,
+  FieldDescriptorProto_Type_TYPE_GROUP = 10,
+  FieldDescriptorProto_Type_TYPE_MESSAGE = 11,
+  FieldDescriptorProto_Type_TYPE_BYTES = 12,
+  FieldDescriptorProto_Type_TYPE_UINT32 = 13,
+  FieldDescriptorProto_Type_TYPE_ENUM = 14,
+  FieldDescriptorProto_Type_TYPE_SFIXED32 = 15,
+  FieldDescriptorProto_Type_TYPE_SFIXED64 = 16,
+  FieldDescriptorProto_Type_TYPE_SINT32 = 17,
+  FieldDescriptorProto_Type_TYPE_SINT64 = 18,
+};
+enum FieldDescriptorProto_Label : int {
+  FieldDescriptorProto_Label_LABEL_OPTIONAL = 1,
+  FieldDescriptorProto_Label_LABEL_REQUIRED = 2,
+  FieldDescriptorProto_Label_LABEL_REPEATED = 3,
+};
+
+class PERFETTO_EXPORT OneofOptions : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  OneofOptions();
+  ~OneofOptions() override;
+  OneofOptions(OneofOptions&&) noexcept;
+  OneofOptions& operator=(OneofOptions&&);
+  OneofOptions(const OneofOptions&);
+  OneofOptions& operator=(const OneofOptions&);
+  bool operator==(const OneofOptions&) const;
+  bool operator!=(const OneofOptions& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT EnumValueDescriptorProto : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNameFieldNumber = 1,
+    kNumberFieldNumber = 2,
+  };
+
+  EnumValueDescriptorProto();
+  ~EnumValueDescriptorProto() override;
+  EnumValueDescriptorProto(EnumValueDescriptorProto&&) noexcept;
+  EnumValueDescriptorProto& operator=(EnumValueDescriptorProto&&);
+  EnumValueDescriptorProto(const EnumValueDescriptorProto&);
+  EnumValueDescriptorProto& operator=(const EnumValueDescriptorProto&);
+  bool operator==(const EnumValueDescriptorProto&) const;
+  bool operator!=(const EnumValueDescriptorProto& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name() const { return _has_field_[1]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
+
+  bool has_number() const { return _has_field_[2]; }
+  int32_t number() const { return number_; }
+  void set_number(int32_t value) { number_ = value; _has_field_.set(2); }
+
+ private:
+  std::string name_{};
+  int32_t number_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT EnumDescriptorProto : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNameFieldNumber = 1,
+    kValueFieldNumber = 2,
+    kReservedNameFieldNumber = 5,
+  };
+
+  EnumDescriptorProto();
+  ~EnumDescriptorProto() override;
+  EnumDescriptorProto(EnumDescriptorProto&&) noexcept;
+  EnumDescriptorProto& operator=(EnumDescriptorProto&&);
+  EnumDescriptorProto(const EnumDescriptorProto&);
+  EnumDescriptorProto& operator=(const EnumDescriptorProto&);
+  bool operator==(const EnumDescriptorProto&) const;
+  bool operator!=(const EnumDescriptorProto& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name() const { return _has_field_[1]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
+
+  const std::vector<EnumValueDescriptorProto>& value() const { return value_; }
+  std::vector<EnumValueDescriptorProto>* mutable_value() { return &value_; }
+  int value_size() const;
+  void clear_value();
+  EnumValueDescriptorProto* add_value();
+
+  const std::vector<std::string>& reserved_name() const { return reserved_name_; }
+  std::vector<std::string>* mutable_reserved_name() { return &reserved_name_; }
+  int reserved_name_size() const { return static_cast<int>(reserved_name_.size()); }
+  void clear_reserved_name() { reserved_name_.clear(); }
+  void add_reserved_name(std::string value) { reserved_name_.emplace_back(value); }
+  std::string* add_reserved_name() { reserved_name_.emplace_back(); return &reserved_name_.back(); }
+
+ private:
+  std::string name_{};
+  std::vector<EnumValueDescriptorProto> value_;
+  std::vector<std::string> reserved_name_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<6> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT OneofDescriptorProto : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNameFieldNumber = 1,
+    kOptionsFieldNumber = 2,
+  };
+
+  OneofDescriptorProto();
+  ~OneofDescriptorProto() override;
+  OneofDescriptorProto(OneofDescriptorProto&&) noexcept;
+  OneofDescriptorProto& operator=(OneofDescriptorProto&&);
+  OneofDescriptorProto(const OneofDescriptorProto&);
+  OneofDescriptorProto& operator=(const OneofDescriptorProto&);
+  bool operator==(const OneofDescriptorProto&) const;
+  bool operator!=(const OneofDescriptorProto& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name() const { return _has_field_[1]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
+
+  bool has_options() const { return _has_field_[2]; }
+  const OneofOptions& options() const { return *options_; }
+  OneofOptions* mutable_options() { _has_field_.set(2); return options_.get(); }
+
+ private:
+  std::string name_{};
+  ::protozero::CopyablePtr<OneofOptions> options_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT FieldDescriptorProto : public ::protozero::CppMessageObj {
+ public:
+  using Type = FieldDescriptorProto_Type;
+  static constexpr auto TYPE_DOUBLE = FieldDescriptorProto_Type_TYPE_DOUBLE;
+  static constexpr auto TYPE_FLOAT = FieldDescriptorProto_Type_TYPE_FLOAT;
+  static constexpr auto TYPE_INT64 = FieldDescriptorProto_Type_TYPE_INT64;
+  static constexpr auto TYPE_UINT64 = FieldDescriptorProto_Type_TYPE_UINT64;
+  static constexpr auto TYPE_INT32 = FieldDescriptorProto_Type_TYPE_INT32;
+  static constexpr auto TYPE_FIXED64 = FieldDescriptorProto_Type_TYPE_FIXED64;
+  static constexpr auto TYPE_FIXED32 = FieldDescriptorProto_Type_TYPE_FIXED32;
+  static constexpr auto TYPE_BOOL = FieldDescriptorProto_Type_TYPE_BOOL;
+  static constexpr auto TYPE_STRING = FieldDescriptorProto_Type_TYPE_STRING;
+  static constexpr auto TYPE_GROUP = FieldDescriptorProto_Type_TYPE_GROUP;
+  static constexpr auto TYPE_MESSAGE = FieldDescriptorProto_Type_TYPE_MESSAGE;
+  static constexpr auto TYPE_BYTES = FieldDescriptorProto_Type_TYPE_BYTES;
+  static constexpr auto TYPE_UINT32 = FieldDescriptorProto_Type_TYPE_UINT32;
+  static constexpr auto TYPE_ENUM = FieldDescriptorProto_Type_TYPE_ENUM;
+  static constexpr auto TYPE_SFIXED32 = FieldDescriptorProto_Type_TYPE_SFIXED32;
+  static constexpr auto TYPE_SFIXED64 = FieldDescriptorProto_Type_TYPE_SFIXED64;
+  static constexpr auto TYPE_SINT32 = FieldDescriptorProto_Type_TYPE_SINT32;
+  static constexpr auto TYPE_SINT64 = FieldDescriptorProto_Type_TYPE_SINT64;
+  static constexpr auto Type_MIN = FieldDescriptorProto_Type_TYPE_DOUBLE;
+  static constexpr auto Type_MAX = FieldDescriptorProto_Type_TYPE_SINT64;
+  using Label = FieldDescriptorProto_Label;
+  static constexpr auto LABEL_OPTIONAL = FieldDescriptorProto_Label_LABEL_OPTIONAL;
+  static constexpr auto LABEL_REQUIRED = FieldDescriptorProto_Label_LABEL_REQUIRED;
+  static constexpr auto LABEL_REPEATED = FieldDescriptorProto_Label_LABEL_REPEATED;
+  static constexpr auto Label_MIN = FieldDescriptorProto_Label_LABEL_OPTIONAL;
+  static constexpr auto Label_MAX = FieldDescriptorProto_Label_LABEL_REPEATED;
+  enum FieldNumbers {
+    kNameFieldNumber = 1,
+    kNumberFieldNumber = 3,
+    kLabelFieldNumber = 4,
+    kTypeFieldNumber = 5,
+    kTypeNameFieldNumber = 6,
+    kExtendeeFieldNumber = 2,
+    kDefaultValueFieldNumber = 7,
+    kOneofIndexFieldNumber = 9,
+  };
+
+  FieldDescriptorProto();
+  ~FieldDescriptorProto() override;
+  FieldDescriptorProto(FieldDescriptorProto&&) noexcept;
+  FieldDescriptorProto& operator=(FieldDescriptorProto&&);
+  FieldDescriptorProto(const FieldDescriptorProto&);
+  FieldDescriptorProto& operator=(const FieldDescriptorProto&);
+  bool operator==(const FieldDescriptorProto&) const;
+  bool operator!=(const FieldDescriptorProto& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name() const { return _has_field_[1]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
+
+  bool has_number() const { return _has_field_[3]; }
+  int32_t number() const { return number_; }
+  void set_number(int32_t value) { number_ = value; _has_field_.set(3); }
+
+  bool has_label() const { return _has_field_[4]; }
+  FieldDescriptorProto_Label label() const { return label_; }
+  void set_label(FieldDescriptorProto_Label value) { label_ = value; _has_field_.set(4); }
+
+  bool has_type() const { return _has_field_[5]; }
+  FieldDescriptorProto_Type type() const { return type_; }
+  void set_type(FieldDescriptorProto_Type value) { type_ = value; _has_field_.set(5); }
+
+  bool has_type_name() const { return _has_field_[6]; }
+  const std::string& type_name() const { return type_name_; }
+  void set_type_name(const std::string& value) { type_name_ = value; _has_field_.set(6); }
+
+  bool has_extendee() const { return _has_field_[2]; }
+  const std::string& extendee() const { return extendee_; }
+  void set_extendee(const std::string& value) { extendee_ = value; _has_field_.set(2); }
+
+  bool has_default_value() const { return _has_field_[7]; }
+  const std::string& default_value() const { return default_value_; }
+  void set_default_value(const std::string& value) { default_value_ = value; _has_field_.set(7); }
+
+  bool has_oneof_index() const { return _has_field_[9]; }
+  int32_t oneof_index() const { return oneof_index_; }
+  void set_oneof_index(int32_t value) { oneof_index_ = value; _has_field_.set(9); }
+
+ private:
+  std::string name_{};
+  int32_t number_{};
+  FieldDescriptorProto_Label label_{};
+  FieldDescriptorProto_Type type_{};
+  std::string type_name_{};
+  std::string extendee_{};
+  std::string default_value_{};
+  int32_t oneof_index_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<10> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT DescriptorProto : public ::protozero::CppMessageObj {
+ public:
+  using ReservedRange = DescriptorProto_ReservedRange;
+  enum FieldNumbers {
+    kNameFieldNumber = 1,
+    kFieldFieldNumber = 2,
+    kExtensionFieldNumber = 6,
+    kNestedTypeFieldNumber = 3,
+    kEnumTypeFieldNumber = 4,
+    kOneofDeclFieldNumber = 8,
+    kReservedRangeFieldNumber = 9,
+    kReservedNameFieldNumber = 10,
+  };
+
+  DescriptorProto();
+  ~DescriptorProto() override;
+  DescriptorProto(DescriptorProto&&) noexcept;
+  DescriptorProto& operator=(DescriptorProto&&);
+  DescriptorProto(const DescriptorProto&);
+  DescriptorProto& operator=(const DescriptorProto&);
+  bool operator==(const DescriptorProto&) const;
+  bool operator!=(const DescriptorProto& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name() const { return _has_field_[1]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
+
+  const std::vector<FieldDescriptorProto>& field() const { return field_; }
+  std::vector<FieldDescriptorProto>* mutable_field() { return &field_; }
+  int field_size() const;
+  void clear_field();
+  FieldDescriptorProto* add_field();
+
+  const std::vector<FieldDescriptorProto>& extension() const { return extension_; }
+  std::vector<FieldDescriptorProto>* mutable_extension() { return &extension_; }
+  int extension_size() const;
+  void clear_extension();
+  FieldDescriptorProto* add_extension();
+
+  const std::vector<DescriptorProto>& nested_type() const { return nested_type_; }
+  std::vector<DescriptorProto>* mutable_nested_type() { return &nested_type_; }
+  int nested_type_size() const;
+  void clear_nested_type();
+  DescriptorProto* add_nested_type();
+
+  const std::vector<EnumDescriptorProto>& enum_type() const { return enum_type_; }
+  std::vector<EnumDescriptorProto>* mutable_enum_type() { return &enum_type_; }
+  int enum_type_size() const;
+  void clear_enum_type();
+  EnumDescriptorProto* add_enum_type();
+
+  const std::vector<OneofDescriptorProto>& oneof_decl() const { return oneof_decl_; }
+  std::vector<OneofDescriptorProto>* mutable_oneof_decl() { return &oneof_decl_; }
+  int oneof_decl_size() const;
+  void clear_oneof_decl();
+  OneofDescriptorProto* add_oneof_decl();
+
+  const std::vector<DescriptorProto_ReservedRange>& reserved_range() const { return reserved_range_; }
+  std::vector<DescriptorProto_ReservedRange>* mutable_reserved_range() { return &reserved_range_; }
+  int reserved_range_size() const;
+  void clear_reserved_range();
+  DescriptorProto_ReservedRange* add_reserved_range();
+
+  const std::vector<std::string>& reserved_name() const { return reserved_name_; }
+  std::vector<std::string>* mutable_reserved_name() { return &reserved_name_; }
+  int reserved_name_size() const { return static_cast<int>(reserved_name_.size()); }
+  void clear_reserved_name() { reserved_name_.clear(); }
+  void add_reserved_name(std::string value) { reserved_name_.emplace_back(value); }
+  std::string* add_reserved_name() { reserved_name_.emplace_back(); return &reserved_name_.back(); }
+
+ private:
+  std::string name_{};
+  std::vector<FieldDescriptorProto> field_;
+  std::vector<FieldDescriptorProto> extension_;
+  std::vector<DescriptorProto> nested_type_;
+  std::vector<EnumDescriptorProto> enum_type_;
+  std::vector<OneofDescriptorProto> oneof_decl_;
+  std::vector<DescriptorProto_ReservedRange> reserved_range_;
+  std::vector<std::string> reserved_name_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<11> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT DescriptorProto_ReservedRange : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kStartFieldNumber = 1,
+    kEndFieldNumber = 2,
+  };
+
+  DescriptorProto_ReservedRange();
+  ~DescriptorProto_ReservedRange() override;
+  DescriptorProto_ReservedRange(DescriptorProto_ReservedRange&&) noexcept;
+  DescriptorProto_ReservedRange& operator=(DescriptorProto_ReservedRange&&);
+  DescriptorProto_ReservedRange(const DescriptorProto_ReservedRange&);
+  DescriptorProto_ReservedRange& operator=(const DescriptorProto_ReservedRange&);
+  bool operator==(const DescriptorProto_ReservedRange&) const;
+  bool operator!=(const DescriptorProto_ReservedRange& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_start() const { return _has_field_[1]; }
+  int32_t start() const { return start_; }
+  void set_start(int32_t value) { start_ = value; _has_field_.set(1); }
+
+  bool has_end() const { return _has_field_[2]; }
+  int32_t end() const { return end_; }
+  void set_end(int32_t value) { end_ = value; _has_field_.set(2); }
+
+ private:
+  int32_t start_{};
+  int32_t end_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT FileDescriptorProto : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNameFieldNumber = 1,
+    kPackageFieldNumber = 2,
+    kDependencyFieldNumber = 3,
+    kPublicDependencyFieldNumber = 10,
+    kWeakDependencyFieldNumber = 11,
+    kMessageTypeFieldNumber = 4,
+    kEnumTypeFieldNumber = 5,
+    kExtensionFieldNumber = 7,
+  };
+
+  FileDescriptorProto();
+  ~FileDescriptorProto() override;
+  FileDescriptorProto(FileDescriptorProto&&) noexcept;
+  FileDescriptorProto& operator=(FileDescriptorProto&&);
+  FileDescriptorProto(const FileDescriptorProto&);
+  FileDescriptorProto& operator=(const FileDescriptorProto&);
+  bool operator==(const FileDescriptorProto&) const;
+  bool operator!=(const FileDescriptorProto& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name() const { return _has_field_[1]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
+
+  bool has_package() const { return _has_field_[2]; }
+  const std::string& package() const { return package_; }
+  void set_package(const std::string& value) { package_ = value; _has_field_.set(2); }
+
+  const std::vector<std::string>& dependency() const { return dependency_; }
+  std::vector<std::string>* mutable_dependency() { return &dependency_; }
+  int dependency_size() const { return static_cast<int>(dependency_.size()); }
+  void clear_dependency() { dependency_.clear(); }
+  void add_dependency(std::string value) { dependency_.emplace_back(value); }
+  std::string* add_dependency() { dependency_.emplace_back(); return &dependency_.back(); }
+
+  const std::vector<int32_t>& public_dependency() const { return public_dependency_; }
+  std::vector<int32_t>* mutable_public_dependency() { return &public_dependency_; }
+  int public_dependency_size() const { return static_cast<int>(public_dependency_.size()); }
+  void clear_public_dependency() { public_dependency_.clear(); }
+  void add_public_dependency(int32_t value) { public_dependency_.emplace_back(value); }
+  int32_t* add_public_dependency() { public_dependency_.emplace_back(); return &public_dependency_.back(); }
+
+  const std::vector<int32_t>& weak_dependency() const { return weak_dependency_; }
+  std::vector<int32_t>* mutable_weak_dependency() { return &weak_dependency_; }
+  int weak_dependency_size() const { return static_cast<int>(weak_dependency_.size()); }
+  void clear_weak_dependency() { weak_dependency_.clear(); }
+  void add_weak_dependency(int32_t value) { weak_dependency_.emplace_back(value); }
+  int32_t* add_weak_dependency() { weak_dependency_.emplace_back(); return &weak_dependency_.back(); }
+
+  const std::vector<DescriptorProto>& message_type() const { return message_type_; }
+  std::vector<DescriptorProto>* mutable_message_type() { return &message_type_; }
+  int message_type_size() const;
+  void clear_message_type();
+  DescriptorProto* add_message_type();
+
+  const std::vector<EnumDescriptorProto>& enum_type() const { return enum_type_; }
+  std::vector<EnumDescriptorProto>* mutable_enum_type() { return &enum_type_; }
+  int enum_type_size() const;
+  void clear_enum_type();
+  EnumDescriptorProto* add_enum_type();
+
+  const std::vector<FieldDescriptorProto>& extension() const { return extension_; }
+  std::vector<FieldDescriptorProto>* mutable_extension() { return &extension_; }
+  int extension_size() const;
+  void clear_extension();
+  FieldDescriptorProto* add_extension();
+
+ private:
+  std::string name_{};
+  std::string package_{};
+  std::vector<std::string> dependency_;
+  std::vector<int32_t> public_dependency_;
+  std::vector<int32_t> weak_dependency_;
+  std::vector<DescriptorProto> message_type_;
+  std::vector<EnumDescriptorProto> enum_type_;
+  std::vector<FieldDescriptorProto> extension_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<12> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT FileDescriptorSet : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kFileFieldNumber = 1,
+  };
+
+  FileDescriptorSet();
+  ~FileDescriptorSet() override;
+  FileDescriptorSet(FileDescriptorSet&&) noexcept;
+  FileDescriptorSet& operator=(FileDescriptorSet&&);
+  FileDescriptorSet(const FileDescriptorSet&);
+  FileDescriptorSet& operator=(const FileDescriptorSet&);
+  bool operator==(const FileDescriptorSet&) const;
+  bool operator!=(const FileDescriptorSet& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<FileDescriptorProto>& file() const { return file_; }
+  std::vector<FileDescriptorProto>* mutable_file() { return &file_; }
+  int file_size() const;
+  void clear_file();
+  FileDescriptorProto* add_file();
+
+ private:
+  std::vector<FileDescriptorProto> file_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DESCRIPTOR_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/common/gpu_counter_descriptor.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_GPU_COUNTER_DESCRIPTOR_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_GPU_COUNTER_DESCRIPTOR_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class GpuCounterDescriptor;
+class GpuCounterDescriptor_GpuCounterBlock;
+class GpuCounterDescriptor_GpuCounterSpec;
+enum GpuCounterDescriptor_GpuCounterGroup : int;
+enum GpuCounterDescriptor_MeasureUnit : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum GpuCounterDescriptor_GpuCounterGroup : int {
+  GpuCounterDescriptor_GpuCounterGroup_UNCLASSIFIED = 0,
+  GpuCounterDescriptor_GpuCounterGroup_SYSTEM = 1,
+  GpuCounterDescriptor_GpuCounterGroup_VERTICES = 2,
+  GpuCounterDescriptor_GpuCounterGroup_FRAGMENTS = 3,
+  GpuCounterDescriptor_GpuCounterGroup_PRIMITIVES = 4,
+  GpuCounterDescriptor_GpuCounterGroup_MEMORY = 5,
+  GpuCounterDescriptor_GpuCounterGroup_COMPUTE = 6,
+};
+enum GpuCounterDescriptor_MeasureUnit : int {
+  GpuCounterDescriptor_MeasureUnit_NONE = 0,
+  GpuCounterDescriptor_MeasureUnit_BIT = 1,
+  GpuCounterDescriptor_MeasureUnit_KILOBIT = 2,
+  GpuCounterDescriptor_MeasureUnit_MEGABIT = 3,
+  GpuCounterDescriptor_MeasureUnit_GIGABIT = 4,
+  GpuCounterDescriptor_MeasureUnit_TERABIT = 5,
+  GpuCounterDescriptor_MeasureUnit_PETABIT = 6,
+  GpuCounterDescriptor_MeasureUnit_BYTE = 7,
+  GpuCounterDescriptor_MeasureUnit_KILOBYTE = 8,
+  GpuCounterDescriptor_MeasureUnit_MEGABYTE = 9,
+  GpuCounterDescriptor_MeasureUnit_GIGABYTE = 10,
+  GpuCounterDescriptor_MeasureUnit_TERABYTE = 11,
+  GpuCounterDescriptor_MeasureUnit_PETABYTE = 12,
+  GpuCounterDescriptor_MeasureUnit_HERTZ = 13,
+  GpuCounterDescriptor_MeasureUnit_KILOHERTZ = 14,
+  GpuCounterDescriptor_MeasureUnit_MEGAHERTZ = 15,
+  GpuCounterDescriptor_MeasureUnit_GIGAHERTZ = 16,
+  GpuCounterDescriptor_MeasureUnit_TERAHERTZ = 17,
+  GpuCounterDescriptor_MeasureUnit_PETAHERTZ = 18,
+  GpuCounterDescriptor_MeasureUnit_NANOSECOND = 19,
+  GpuCounterDescriptor_MeasureUnit_MICROSECOND = 20,
+  GpuCounterDescriptor_MeasureUnit_MILLISECOND = 21,
+  GpuCounterDescriptor_MeasureUnit_SECOND = 22,
+  GpuCounterDescriptor_MeasureUnit_MINUTE = 23,
+  GpuCounterDescriptor_MeasureUnit_HOUR = 24,
+  GpuCounterDescriptor_MeasureUnit_VERTEX = 25,
+  GpuCounterDescriptor_MeasureUnit_PIXEL = 26,
+  GpuCounterDescriptor_MeasureUnit_TRIANGLE = 27,
+  GpuCounterDescriptor_MeasureUnit_PRIMITIVE = 38,
+  GpuCounterDescriptor_MeasureUnit_FRAGMENT = 39,
+  GpuCounterDescriptor_MeasureUnit_MILLIWATT = 28,
+  GpuCounterDescriptor_MeasureUnit_WATT = 29,
+  GpuCounterDescriptor_MeasureUnit_KILOWATT = 30,
+  GpuCounterDescriptor_MeasureUnit_JOULE = 31,
+  GpuCounterDescriptor_MeasureUnit_VOLT = 32,
+  GpuCounterDescriptor_MeasureUnit_AMPERE = 33,
+  GpuCounterDescriptor_MeasureUnit_CELSIUS = 34,
+  GpuCounterDescriptor_MeasureUnit_FAHRENHEIT = 35,
+  GpuCounterDescriptor_MeasureUnit_KELVIN = 36,
+  GpuCounterDescriptor_MeasureUnit_PERCENT = 37,
+  GpuCounterDescriptor_MeasureUnit_INSTRUCTION = 40,
+};
+
+class PERFETTO_EXPORT GpuCounterDescriptor : public ::protozero::CppMessageObj {
+ public:
+  using GpuCounterSpec = GpuCounterDescriptor_GpuCounterSpec;
+  using GpuCounterBlock = GpuCounterDescriptor_GpuCounterBlock;
+  using GpuCounterGroup = GpuCounterDescriptor_GpuCounterGroup;
+  static constexpr auto UNCLASSIFIED = GpuCounterDescriptor_GpuCounterGroup_UNCLASSIFIED;
+  static constexpr auto SYSTEM = GpuCounterDescriptor_GpuCounterGroup_SYSTEM;
+  static constexpr auto VERTICES = GpuCounterDescriptor_GpuCounterGroup_VERTICES;
+  static constexpr auto FRAGMENTS = GpuCounterDescriptor_GpuCounterGroup_FRAGMENTS;
+  static constexpr auto PRIMITIVES = GpuCounterDescriptor_GpuCounterGroup_PRIMITIVES;
+  static constexpr auto MEMORY = GpuCounterDescriptor_GpuCounterGroup_MEMORY;
+  static constexpr auto COMPUTE = GpuCounterDescriptor_GpuCounterGroup_COMPUTE;
+  static constexpr auto GpuCounterGroup_MIN = GpuCounterDescriptor_GpuCounterGroup_UNCLASSIFIED;
+  static constexpr auto GpuCounterGroup_MAX = GpuCounterDescriptor_GpuCounterGroup_COMPUTE;
+  using MeasureUnit = GpuCounterDescriptor_MeasureUnit;
+  static constexpr auto NONE = GpuCounterDescriptor_MeasureUnit_NONE;
+  static constexpr auto BIT = GpuCounterDescriptor_MeasureUnit_BIT;
+  static constexpr auto KILOBIT = GpuCounterDescriptor_MeasureUnit_KILOBIT;
+  static constexpr auto MEGABIT = GpuCounterDescriptor_MeasureUnit_MEGABIT;
+  static constexpr auto GIGABIT = GpuCounterDescriptor_MeasureUnit_GIGABIT;
+  static constexpr auto TERABIT = GpuCounterDescriptor_MeasureUnit_TERABIT;
+  static constexpr auto PETABIT = GpuCounterDescriptor_MeasureUnit_PETABIT;
+  static constexpr auto BYTE = GpuCounterDescriptor_MeasureUnit_BYTE;
+  static constexpr auto KILOBYTE = GpuCounterDescriptor_MeasureUnit_KILOBYTE;
+  static constexpr auto MEGABYTE = GpuCounterDescriptor_MeasureUnit_MEGABYTE;
+  static constexpr auto GIGABYTE = GpuCounterDescriptor_MeasureUnit_GIGABYTE;
+  static constexpr auto TERABYTE = GpuCounterDescriptor_MeasureUnit_TERABYTE;
+  static constexpr auto PETABYTE = GpuCounterDescriptor_MeasureUnit_PETABYTE;
+  static constexpr auto HERTZ = GpuCounterDescriptor_MeasureUnit_HERTZ;
+  static constexpr auto KILOHERTZ = GpuCounterDescriptor_MeasureUnit_KILOHERTZ;
+  static constexpr auto MEGAHERTZ = GpuCounterDescriptor_MeasureUnit_MEGAHERTZ;
+  static constexpr auto GIGAHERTZ = GpuCounterDescriptor_MeasureUnit_GIGAHERTZ;
+  static constexpr auto TERAHERTZ = GpuCounterDescriptor_MeasureUnit_TERAHERTZ;
+  static constexpr auto PETAHERTZ = GpuCounterDescriptor_MeasureUnit_PETAHERTZ;
+  static constexpr auto NANOSECOND = GpuCounterDescriptor_MeasureUnit_NANOSECOND;
+  static constexpr auto MICROSECOND = GpuCounterDescriptor_MeasureUnit_MICROSECOND;
+  static constexpr auto MILLISECOND = GpuCounterDescriptor_MeasureUnit_MILLISECOND;
+  static constexpr auto SECOND = GpuCounterDescriptor_MeasureUnit_SECOND;
+  static constexpr auto MINUTE = GpuCounterDescriptor_MeasureUnit_MINUTE;
+  static constexpr auto HOUR = GpuCounterDescriptor_MeasureUnit_HOUR;
+  static constexpr auto VERTEX = GpuCounterDescriptor_MeasureUnit_VERTEX;
+  static constexpr auto PIXEL = GpuCounterDescriptor_MeasureUnit_PIXEL;
+  static constexpr auto TRIANGLE = GpuCounterDescriptor_MeasureUnit_TRIANGLE;
+  static constexpr auto PRIMITIVE = GpuCounterDescriptor_MeasureUnit_PRIMITIVE;
+  static constexpr auto FRAGMENT = GpuCounterDescriptor_MeasureUnit_FRAGMENT;
+  static constexpr auto MILLIWATT = GpuCounterDescriptor_MeasureUnit_MILLIWATT;
+  static constexpr auto WATT = GpuCounterDescriptor_MeasureUnit_WATT;
+  static constexpr auto KILOWATT = GpuCounterDescriptor_MeasureUnit_KILOWATT;
+  static constexpr auto JOULE = GpuCounterDescriptor_MeasureUnit_JOULE;
+  static constexpr auto VOLT = GpuCounterDescriptor_MeasureUnit_VOLT;
+  static constexpr auto AMPERE = GpuCounterDescriptor_MeasureUnit_AMPERE;
+  static constexpr auto CELSIUS = GpuCounterDescriptor_MeasureUnit_CELSIUS;
+  static constexpr auto FAHRENHEIT = GpuCounterDescriptor_MeasureUnit_FAHRENHEIT;
+  static constexpr auto KELVIN = GpuCounterDescriptor_MeasureUnit_KELVIN;
+  static constexpr auto PERCENT = GpuCounterDescriptor_MeasureUnit_PERCENT;
+  static constexpr auto INSTRUCTION = GpuCounterDescriptor_MeasureUnit_INSTRUCTION;
+  static constexpr auto MeasureUnit_MIN = GpuCounterDescriptor_MeasureUnit_NONE;
+  static constexpr auto MeasureUnit_MAX = GpuCounterDescriptor_MeasureUnit_INSTRUCTION;
+  enum FieldNumbers {
+    kSpecsFieldNumber = 1,
+    kBlocksFieldNumber = 2,
+    kMinSamplingPeriodNsFieldNumber = 3,
+    kMaxSamplingPeriodNsFieldNumber = 4,
+    kSupportsInstrumentedSamplingFieldNumber = 5,
+  };
+
+  GpuCounterDescriptor();
+  ~GpuCounterDescriptor() override;
+  GpuCounterDescriptor(GpuCounterDescriptor&&) noexcept;
+  GpuCounterDescriptor& operator=(GpuCounterDescriptor&&);
+  GpuCounterDescriptor(const GpuCounterDescriptor&);
+  GpuCounterDescriptor& operator=(const GpuCounterDescriptor&);
+  bool operator==(const GpuCounterDescriptor&) const;
+  bool operator!=(const GpuCounterDescriptor& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<GpuCounterDescriptor_GpuCounterSpec>& specs() const { return specs_; }
+  std::vector<GpuCounterDescriptor_GpuCounterSpec>* mutable_specs() { return &specs_; }
+  int specs_size() const;
+  void clear_specs();
+  GpuCounterDescriptor_GpuCounterSpec* add_specs();
+
+  const std::vector<GpuCounterDescriptor_GpuCounterBlock>& blocks() const { return blocks_; }
+  std::vector<GpuCounterDescriptor_GpuCounterBlock>* mutable_blocks() { return &blocks_; }
+  int blocks_size() const;
+  void clear_blocks();
+  GpuCounterDescriptor_GpuCounterBlock* add_blocks();
+
+  bool has_min_sampling_period_ns() const { return _has_field_[3]; }
+  uint64_t min_sampling_period_ns() const { return min_sampling_period_ns_; }
+  void set_min_sampling_period_ns(uint64_t value) { min_sampling_period_ns_ = value; _has_field_.set(3); }
+
+  bool has_max_sampling_period_ns() const { return _has_field_[4]; }
+  uint64_t max_sampling_period_ns() const { return max_sampling_period_ns_; }
+  void set_max_sampling_period_ns(uint64_t value) { max_sampling_period_ns_ = value; _has_field_.set(4); }
+
+  bool has_supports_instrumented_sampling() const { return _has_field_[5]; }
+  bool supports_instrumented_sampling() const { return supports_instrumented_sampling_; }
+  void set_supports_instrumented_sampling(bool value) { supports_instrumented_sampling_ = value; _has_field_.set(5); }
+
+ private:
+  std::vector<GpuCounterDescriptor_GpuCounterSpec> specs_;
+  std::vector<GpuCounterDescriptor_GpuCounterBlock> blocks_;
+  uint64_t min_sampling_period_ns_{};
+  uint64_t max_sampling_period_ns_{};
+  bool supports_instrumented_sampling_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<6> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT GpuCounterDescriptor_GpuCounterBlock : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kBlockIdFieldNumber = 1,
+    kBlockCapacityFieldNumber = 2,
+    kNameFieldNumber = 3,
+    kDescriptionFieldNumber = 4,
+    kCounterIdsFieldNumber = 5,
+  };
+
+  GpuCounterDescriptor_GpuCounterBlock();
+  ~GpuCounterDescriptor_GpuCounterBlock() override;
+  GpuCounterDescriptor_GpuCounterBlock(GpuCounterDescriptor_GpuCounterBlock&&) noexcept;
+  GpuCounterDescriptor_GpuCounterBlock& operator=(GpuCounterDescriptor_GpuCounterBlock&&);
+  GpuCounterDescriptor_GpuCounterBlock(const GpuCounterDescriptor_GpuCounterBlock&);
+  GpuCounterDescriptor_GpuCounterBlock& operator=(const GpuCounterDescriptor_GpuCounterBlock&);
+  bool operator==(const GpuCounterDescriptor_GpuCounterBlock&) const;
+  bool operator!=(const GpuCounterDescriptor_GpuCounterBlock& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_block_id() const { return _has_field_[1]; }
+  uint32_t block_id() const { return block_id_; }
+  void set_block_id(uint32_t value) { block_id_ = value; _has_field_.set(1); }
+
+  bool has_block_capacity() const { return _has_field_[2]; }
+  uint32_t block_capacity() const { return block_capacity_; }
+  void set_block_capacity(uint32_t value) { block_capacity_ = value; _has_field_.set(2); }
+
+  bool has_name() const { return _has_field_[3]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(3); }
+
+  bool has_description() const { return _has_field_[4]; }
+  const std::string& description() const { return description_; }
+  void set_description(const std::string& value) { description_ = value; _has_field_.set(4); }
+
+  const std::vector<uint32_t>& counter_ids() const { return counter_ids_; }
+  std::vector<uint32_t>* mutable_counter_ids() { return &counter_ids_; }
+  int counter_ids_size() const { return static_cast<int>(counter_ids_.size()); }
+  void clear_counter_ids() { counter_ids_.clear(); }
+  void add_counter_ids(uint32_t value) { counter_ids_.emplace_back(value); }
+  uint32_t* add_counter_ids() { counter_ids_.emplace_back(); return &counter_ids_.back(); }
+
+ private:
+  uint32_t block_id_{};
+  uint32_t block_capacity_{};
+  std::string name_{};
+  std::string description_{};
+  std::vector<uint32_t> counter_ids_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<6> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT GpuCounterDescriptor_GpuCounterSpec : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kCounterIdFieldNumber = 1,
+    kNameFieldNumber = 2,
+    kDescriptionFieldNumber = 3,
+    kIntPeakValueFieldNumber = 5,
+    kDoublePeakValueFieldNumber = 6,
+    kNumeratorUnitsFieldNumber = 7,
+    kDenominatorUnitsFieldNumber = 8,
+    kSelectByDefaultFieldNumber = 9,
+    kGroupsFieldNumber = 10,
+  };
+
+  GpuCounterDescriptor_GpuCounterSpec();
+  ~GpuCounterDescriptor_GpuCounterSpec() override;
+  GpuCounterDescriptor_GpuCounterSpec(GpuCounterDescriptor_GpuCounterSpec&&) noexcept;
+  GpuCounterDescriptor_GpuCounterSpec& operator=(GpuCounterDescriptor_GpuCounterSpec&&);
+  GpuCounterDescriptor_GpuCounterSpec(const GpuCounterDescriptor_GpuCounterSpec&);
+  GpuCounterDescriptor_GpuCounterSpec& operator=(const GpuCounterDescriptor_GpuCounterSpec&);
+  bool operator==(const GpuCounterDescriptor_GpuCounterSpec&) const;
+  bool operator!=(const GpuCounterDescriptor_GpuCounterSpec& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_counter_id() const { return _has_field_[1]; }
+  uint32_t counter_id() const { return counter_id_; }
+  void set_counter_id(uint32_t value) { counter_id_ = value; _has_field_.set(1); }
+
+  bool has_name() const { return _has_field_[2]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(2); }
+
+  bool has_description() const { return _has_field_[3]; }
+  const std::string& description() const { return description_; }
+  void set_description(const std::string& value) { description_ = value; _has_field_.set(3); }
+
+  bool has_int_peak_value() const { return _has_field_[5]; }
+  int64_t int_peak_value() const { return int_peak_value_; }
+  void set_int_peak_value(int64_t value) { int_peak_value_ = value; _has_field_.set(5); }
+
+  bool has_double_peak_value() const { return _has_field_[6]; }
+  double double_peak_value() const { return double_peak_value_; }
+  void set_double_peak_value(double value) { double_peak_value_ = value; _has_field_.set(6); }
+
+  const std::vector<GpuCounterDescriptor_MeasureUnit>& numerator_units() const { return numerator_units_; }
+  std::vector<GpuCounterDescriptor_MeasureUnit>* mutable_numerator_units() { return &numerator_units_; }
+  int numerator_units_size() const { return static_cast<int>(numerator_units_.size()); }
+  void clear_numerator_units() { numerator_units_.clear(); }
+  void add_numerator_units(GpuCounterDescriptor_MeasureUnit value) { numerator_units_.emplace_back(value); }
+  GpuCounterDescriptor_MeasureUnit* add_numerator_units() { numerator_units_.emplace_back(); return &numerator_units_.back(); }
+
+  const std::vector<GpuCounterDescriptor_MeasureUnit>& denominator_units() const { return denominator_units_; }
+  std::vector<GpuCounterDescriptor_MeasureUnit>* mutable_denominator_units() { return &denominator_units_; }
+  int denominator_units_size() const { return static_cast<int>(denominator_units_.size()); }
+  void clear_denominator_units() { denominator_units_.clear(); }
+  void add_denominator_units(GpuCounterDescriptor_MeasureUnit value) { denominator_units_.emplace_back(value); }
+  GpuCounterDescriptor_MeasureUnit* add_denominator_units() { denominator_units_.emplace_back(); return &denominator_units_.back(); }
+
+  bool has_select_by_default() const { return _has_field_[9]; }
+  bool select_by_default() const { return select_by_default_; }
+  void set_select_by_default(bool value) { select_by_default_ = value; _has_field_.set(9); }
+
+  const std::vector<GpuCounterDescriptor_GpuCounterGroup>& groups() const { return groups_; }
+  std::vector<GpuCounterDescriptor_GpuCounterGroup>* mutable_groups() { return &groups_; }
+  int groups_size() const { return static_cast<int>(groups_.size()); }
+  void clear_groups() { groups_.clear(); }
+  void add_groups(GpuCounterDescriptor_GpuCounterGroup value) { groups_.emplace_back(value); }
+  GpuCounterDescriptor_GpuCounterGroup* add_groups() { groups_.emplace_back(); return &groups_.back(); }
+
+ private:
+  uint32_t counter_id_{};
+  std::string name_{};
+  std::string description_{};
+  int64_t int_peak_value_{};
+  double double_peak_value_{};
+  std::vector<GpuCounterDescriptor_MeasureUnit> numerator_units_;
+  std::vector<GpuCounterDescriptor_MeasureUnit> denominator_units_;
+  bool select_by_default_{};
+  std::vector<GpuCounterDescriptor_GpuCounterGroup> groups_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<11> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_GPU_COUNTER_DESCRIPTOR_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/common/interceptor_descriptor.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_INTERCEPTOR_DESCRIPTOR_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_INTERCEPTOR_DESCRIPTOR_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class InterceptorDescriptor;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT InterceptorDescriptor : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNameFieldNumber = 1,
+  };
+
+  InterceptorDescriptor();
+  ~InterceptorDescriptor() override;
+  InterceptorDescriptor(InterceptorDescriptor&&) noexcept;
+  InterceptorDescriptor& operator=(InterceptorDescriptor&&);
+  InterceptorDescriptor(const InterceptorDescriptor&);
+  InterceptorDescriptor& operator=(const InterceptorDescriptor&);
+  bool operator==(const InterceptorDescriptor&) const;
+  bool operator!=(const InterceptorDescriptor& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name() const { return _has_field_[1]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
+
+ private:
+  std::string name_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_INTERCEPTOR_DESCRIPTOR_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/common/observable_events.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_OBSERVABLE_EVENTS_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_OBSERVABLE_EVENTS_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ObservableEvents;
+class ObservableEvents_DataSourceInstanceStateChange;
+enum ObservableEvents_Type : int;
+enum ObservableEvents_DataSourceInstanceState : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum ObservableEvents_Type : int {
+  ObservableEvents_Type_TYPE_UNSPECIFIED = 0,
+  ObservableEvents_Type_TYPE_DATA_SOURCES_INSTANCES = 1,
+  ObservableEvents_Type_TYPE_ALL_DATA_SOURCES_STARTED = 2,
+};
+enum ObservableEvents_DataSourceInstanceState : int {
+  ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STOPPED = 1,
+  ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STARTED = 2,
+};
+
+class PERFETTO_EXPORT ObservableEvents : public ::protozero::CppMessageObj {
+ public:
+  using DataSourceInstanceStateChange = ObservableEvents_DataSourceInstanceStateChange;
+  using Type = ObservableEvents_Type;
+  static constexpr auto TYPE_UNSPECIFIED = ObservableEvents_Type_TYPE_UNSPECIFIED;
+  static constexpr auto TYPE_DATA_SOURCES_INSTANCES = ObservableEvents_Type_TYPE_DATA_SOURCES_INSTANCES;
+  static constexpr auto TYPE_ALL_DATA_SOURCES_STARTED = ObservableEvents_Type_TYPE_ALL_DATA_SOURCES_STARTED;
+  static constexpr auto Type_MIN = ObservableEvents_Type_TYPE_UNSPECIFIED;
+  static constexpr auto Type_MAX = ObservableEvents_Type_TYPE_ALL_DATA_SOURCES_STARTED;
+  using DataSourceInstanceState = ObservableEvents_DataSourceInstanceState;
+  static constexpr auto DATA_SOURCE_INSTANCE_STATE_STOPPED = ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STOPPED;
+  static constexpr auto DATA_SOURCE_INSTANCE_STATE_STARTED = ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STARTED;
+  static constexpr auto DataSourceInstanceState_MIN = ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STOPPED;
+  static constexpr auto DataSourceInstanceState_MAX = ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STARTED;
+  enum FieldNumbers {
+    kInstanceStateChangesFieldNumber = 1,
+    kAllDataSourcesStartedFieldNumber = 2,
+  };
+
+  ObservableEvents();
+  ~ObservableEvents() override;
+  ObservableEvents(ObservableEvents&&) noexcept;
+  ObservableEvents& operator=(ObservableEvents&&);
+  ObservableEvents(const ObservableEvents&);
+  ObservableEvents& operator=(const ObservableEvents&);
+  bool operator==(const ObservableEvents&) const;
+  bool operator!=(const ObservableEvents& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<ObservableEvents_DataSourceInstanceStateChange>& instance_state_changes() const { return instance_state_changes_; }
+  std::vector<ObservableEvents_DataSourceInstanceStateChange>* mutable_instance_state_changes() { return &instance_state_changes_; }
+  int instance_state_changes_size() const;
+  void clear_instance_state_changes();
+  ObservableEvents_DataSourceInstanceStateChange* add_instance_state_changes();
+
+  bool has_all_data_sources_started() const { return _has_field_[2]; }
+  bool all_data_sources_started() const { return all_data_sources_started_; }
+  void set_all_data_sources_started(bool value) { all_data_sources_started_ = value; _has_field_.set(2); }
+
+ private:
+  std::vector<ObservableEvents_DataSourceInstanceStateChange> instance_state_changes_;
+  bool all_data_sources_started_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ObservableEvents_DataSourceInstanceStateChange : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kProducerNameFieldNumber = 1,
+    kDataSourceNameFieldNumber = 2,
+    kStateFieldNumber = 3,
+  };
+
+  ObservableEvents_DataSourceInstanceStateChange();
+  ~ObservableEvents_DataSourceInstanceStateChange() override;
+  ObservableEvents_DataSourceInstanceStateChange(ObservableEvents_DataSourceInstanceStateChange&&) noexcept;
+  ObservableEvents_DataSourceInstanceStateChange& operator=(ObservableEvents_DataSourceInstanceStateChange&&);
+  ObservableEvents_DataSourceInstanceStateChange(const ObservableEvents_DataSourceInstanceStateChange&);
+  ObservableEvents_DataSourceInstanceStateChange& operator=(const ObservableEvents_DataSourceInstanceStateChange&);
+  bool operator==(const ObservableEvents_DataSourceInstanceStateChange&) const;
+  bool operator!=(const ObservableEvents_DataSourceInstanceStateChange& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_producer_name() const { return _has_field_[1]; }
+  const std::string& producer_name() const { return producer_name_; }
+  void set_producer_name(const std::string& value) { producer_name_ = value; _has_field_.set(1); }
+
+  bool has_data_source_name() const { return _has_field_[2]; }
+  const std::string& data_source_name() const { return data_source_name_; }
+  void set_data_source_name(const std::string& value) { data_source_name_ = value; _has_field_.set(2); }
+
+  bool has_state() const { return _has_field_[3]; }
+  ObservableEvents_DataSourceInstanceState state() const { return state_; }
+  void set_state(ObservableEvents_DataSourceInstanceState value) { state_ = value; _has_field_.set(3); }
+
+ private:
+  std::string producer_name_{};
+  std::string data_source_name_{};
+  ObservableEvents_DataSourceInstanceState state_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<4> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_OBSERVABLE_EVENTS_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/common/perf_events.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_PERF_EVENTS_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_PERF_EVENTS_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class PerfEvents;
+class PerfEvents_Tracepoint;
+class PerfEvents_Timebase;
+enum PerfEvents_Counter : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum PerfEvents_Counter : int {
+  PerfEvents_Counter_UNKNOWN_COUNTER = 0,
+  PerfEvents_Counter_SW_CPU_CLOCK = 1,
+  PerfEvents_Counter_SW_PAGE_FAULTS = 2,
+  PerfEvents_Counter_HW_CPU_CYCLES = 10,
+  PerfEvents_Counter_HW_INSTRUCTIONS = 11,
+};
+
+class PERFETTO_EXPORT PerfEvents : public ::protozero::CppMessageObj {
+ public:
+  using Timebase = PerfEvents_Timebase;
+  using Tracepoint = PerfEvents_Tracepoint;
+  using Counter = PerfEvents_Counter;
+  static constexpr auto UNKNOWN_COUNTER = PerfEvents_Counter_UNKNOWN_COUNTER;
+  static constexpr auto SW_CPU_CLOCK = PerfEvents_Counter_SW_CPU_CLOCK;
+  static constexpr auto SW_PAGE_FAULTS = PerfEvents_Counter_SW_PAGE_FAULTS;
+  static constexpr auto HW_CPU_CYCLES = PerfEvents_Counter_HW_CPU_CYCLES;
+  static constexpr auto HW_INSTRUCTIONS = PerfEvents_Counter_HW_INSTRUCTIONS;
+  static constexpr auto Counter_MIN = PerfEvents_Counter_UNKNOWN_COUNTER;
+  static constexpr auto Counter_MAX = PerfEvents_Counter_HW_INSTRUCTIONS;
+  enum FieldNumbers {
+  };
+
+  PerfEvents();
+  ~PerfEvents() override;
+  PerfEvents(PerfEvents&&) noexcept;
+  PerfEvents& operator=(PerfEvents&&);
+  PerfEvents(const PerfEvents&);
+  PerfEvents& operator=(const PerfEvents&);
+  bool operator==(const PerfEvents&) const;
+  bool operator!=(const PerfEvents& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT PerfEvents_Tracepoint : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNameFieldNumber = 1,
+    kFilterFieldNumber = 2,
+  };
+
+  PerfEvents_Tracepoint();
+  ~PerfEvents_Tracepoint() override;
+  PerfEvents_Tracepoint(PerfEvents_Tracepoint&&) noexcept;
+  PerfEvents_Tracepoint& operator=(PerfEvents_Tracepoint&&);
+  PerfEvents_Tracepoint(const PerfEvents_Tracepoint&);
+  PerfEvents_Tracepoint& operator=(const PerfEvents_Tracepoint&);
+  bool operator==(const PerfEvents_Tracepoint&) const;
+  bool operator!=(const PerfEvents_Tracepoint& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name() const { return _has_field_[1]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
+
+  bool has_filter() const { return _has_field_[2]; }
+  const std::string& filter() const { return filter_; }
+  void set_filter(const std::string& value) { filter_ = value; _has_field_.set(2); }
+
+ private:
+  std::string name_{};
+  std::string filter_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT PerfEvents_Timebase : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kFrequencyFieldNumber = 2,
+    kPeriodFieldNumber = 1,
+    kCounterFieldNumber = 4,
+    kTracepointFieldNumber = 3,
+  };
+
+  PerfEvents_Timebase();
+  ~PerfEvents_Timebase() override;
+  PerfEvents_Timebase(PerfEvents_Timebase&&) noexcept;
+  PerfEvents_Timebase& operator=(PerfEvents_Timebase&&);
+  PerfEvents_Timebase(const PerfEvents_Timebase&);
+  PerfEvents_Timebase& operator=(const PerfEvents_Timebase&);
+  bool operator==(const PerfEvents_Timebase&) const;
+  bool operator!=(const PerfEvents_Timebase& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_frequency() const { return _has_field_[2]; }
+  uint64_t frequency() const { return frequency_; }
+  void set_frequency(uint64_t value) { frequency_ = value; _has_field_.set(2); }
+
+  bool has_period() const { return _has_field_[1]; }
+  uint64_t period() const { return period_; }
+  void set_period(uint64_t value) { period_ = value; _has_field_.set(1); }
+
+  bool has_counter() const { return _has_field_[4]; }
+  PerfEvents_Counter counter() const { return counter_; }
+  void set_counter(PerfEvents_Counter value) { counter_ = value; _has_field_.set(4); }
+
+  bool has_tracepoint() const { return _has_field_[3]; }
+  const PerfEvents_Tracepoint& tracepoint() const { return *tracepoint_; }
+  PerfEvents_Tracepoint* mutable_tracepoint() { _has_field_.set(3); return tracepoint_.get(); }
+
+ private:
+  uint64_t frequency_{};
+  uint64_t period_{};
+  PerfEvents_Counter counter_{};
+  ::protozero::CopyablePtr<PerfEvents_Tracepoint> tracepoint_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<5> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_PERF_EVENTS_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/common/sys_stats_counters.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_SYS_STATS_COUNTERS_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_SYS_STATS_COUNTERS_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum MeminfoCounters : int;
+enum VmstatCounters : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum MeminfoCounters : int {
+  MEMINFO_UNSPECIFIED = 0,
+  MEMINFO_MEM_TOTAL = 1,
+  MEMINFO_MEM_FREE = 2,
+  MEMINFO_MEM_AVAILABLE = 3,
+  MEMINFO_BUFFERS = 4,
+  MEMINFO_CACHED = 5,
+  MEMINFO_SWAP_CACHED = 6,
+  MEMINFO_ACTIVE = 7,
+  MEMINFO_INACTIVE = 8,
+  MEMINFO_ACTIVE_ANON = 9,
+  MEMINFO_INACTIVE_ANON = 10,
+  MEMINFO_ACTIVE_FILE = 11,
+  MEMINFO_INACTIVE_FILE = 12,
+  MEMINFO_UNEVICTABLE = 13,
+  MEMINFO_MLOCKED = 14,
+  MEMINFO_SWAP_TOTAL = 15,
+  MEMINFO_SWAP_FREE = 16,
+  MEMINFO_DIRTY = 17,
+  MEMINFO_WRITEBACK = 18,
+  MEMINFO_ANON_PAGES = 19,
+  MEMINFO_MAPPED = 20,
+  MEMINFO_SHMEM = 21,
+  MEMINFO_SLAB = 22,
+  MEMINFO_SLAB_RECLAIMABLE = 23,
+  MEMINFO_SLAB_UNRECLAIMABLE = 24,
+  MEMINFO_KERNEL_STACK = 25,
+  MEMINFO_PAGE_TABLES = 26,
+  MEMINFO_COMMIT_LIMIT = 27,
+  MEMINFO_COMMITED_AS = 28,
+  MEMINFO_VMALLOC_TOTAL = 29,
+  MEMINFO_VMALLOC_USED = 30,
+  MEMINFO_VMALLOC_CHUNK = 31,
+  MEMINFO_CMA_TOTAL = 32,
+  MEMINFO_CMA_FREE = 33,
+};
+enum VmstatCounters : int {
+  VMSTAT_UNSPECIFIED = 0,
+  VMSTAT_NR_FREE_PAGES = 1,
+  VMSTAT_NR_ALLOC_BATCH = 2,
+  VMSTAT_NR_INACTIVE_ANON = 3,
+  VMSTAT_NR_ACTIVE_ANON = 4,
+  VMSTAT_NR_INACTIVE_FILE = 5,
+  VMSTAT_NR_ACTIVE_FILE = 6,
+  VMSTAT_NR_UNEVICTABLE = 7,
+  VMSTAT_NR_MLOCK = 8,
+  VMSTAT_NR_ANON_PAGES = 9,
+  VMSTAT_NR_MAPPED = 10,
+  VMSTAT_NR_FILE_PAGES = 11,
+  VMSTAT_NR_DIRTY = 12,
+  VMSTAT_NR_WRITEBACK = 13,
+  VMSTAT_NR_SLAB_RECLAIMABLE = 14,
+  VMSTAT_NR_SLAB_UNRECLAIMABLE = 15,
+  VMSTAT_NR_PAGE_TABLE_PAGES = 16,
+  VMSTAT_NR_KERNEL_STACK = 17,
+  VMSTAT_NR_OVERHEAD = 18,
+  VMSTAT_NR_UNSTABLE = 19,
+  VMSTAT_NR_BOUNCE = 20,
+  VMSTAT_NR_VMSCAN_WRITE = 21,
+  VMSTAT_NR_VMSCAN_IMMEDIATE_RECLAIM = 22,
+  VMSTAT_NR_WRITEBACK_TEMP = 23,
+  VMSTAT_NR_ISOLATED_ANON = 24,
+  VMSTAT_NR_ISOLATED_FILE = 25,
+  VMSTAT_NR_SHMEM = 26,
+  VMSTAT_NR_DIRTIED = 27,
+  VMSTAT_NR_WRITTEN = 28,
+  VMSTAT_NR_PAGES_SCANNED = 29,
+  VMSTAT_WORKINGSET_REFAULT = 30,
+  VMSTAT_WORKINGSET_ACTIVATE = 31,
+  VMSTAT_WORKINGSET_NODERECLAIM = 32,
+  VMSTAT_NR_ANON_TRANSPARENT_HUGEPAGES = 33,
+  VMSTAT_NR_FREE_CMA = 34,
+  VMSTAT_NR_SWAPCACHE = 35,
+  VMSTAT_NR_DIRTY_THRESHOLD = 36,
+  VMSTAT_NR_DIRTY_BACKGROUND_THRESHOLD = 37,
+  VMSTAT_PGPGIN = 38,
+  VMSTAT_PGPGOUT = 39,
+  VMSTAT_PGPGOUTCLEAN = 40,
+  VMSTAT_PSWPIN = 41,
+  VMSTAT_PSWPOUT = 42,
+  VMSTAT_PGALLOC_DMA = 43,
+  VMSTAT_PGALLOC_NORMAL = 44,
+  VMSTAT_PGALLOC_MOVABLE = 45,
+  VMSTAT_PGFREE = 46,
+  VMSTAT_PGACTIVATE = 47,
+  VMSTAT_PGDEACTIVATE = 48,
+  VMSTAT_PGFAULT = 49,
+  VMSTAT_PGMAJFAULT = 50,
+  VMSTAT_PGREFILL_DMA = 51,
+  VMSTAT_PGREFILL_NORMAL = 52,
+  VMSTAT_PGREFILL_MOVABLE = 53,
+  VMSTAT_PGSTEAL_KSWAPD_DMA = 54,
+  VMSTAT_PGSTEAL_KSWAPD_NORMAL = 55,
+  VMSTAT_PGSTEAL_KSWAPD_MOVABLE = 56,
+  VMSTAT_PGSTEAL_DIRECT_DMA = 57,
+  VMSTAT_PGSTEAL_DIRECT_NORMAL = 58,
+  VMSTAT_PGSTEAL_DIRECT_MOVABLE = 59,
+  VMSTAT_PGSCAN_KSWAPD_DMA = 60,
+  VMSTAT_PGSCAN_KSWAPD_NORMAL = 61,
+  VMSTAT_PGSCAN_KSWAPD_MOVABLE = 62,
+  VMSTAT_PGSCAN_DIRECT_DMA = 63,
+  VMSTAT_PGSCAN_DIRECT_NORMAL = 64,
+  VMSTAT_PGSCAN_DIRECT_MOVABLE = 65,
+  VMSTAT_PGSCAN_DIRECT_THROTTLE = 66,
+  VMSTAT_PGINODESTEAL = 67,
+  VMSTAT_SLABS_SCANNED = 68,
+  VMSTAT_KSWAPD_INODESTEAL = 69,
+  VMSTAT_KSWAPD_LOW_WMARK_HIT_QUICKLY = 70,
+  VMSTAT_KSWAPD_HIGH_WMARK_HIT_QUICKLY = 71,
+  VMSTAT_PAGEOUTRUN = 72,
+  VMSTAT_ALLOCSTALL = 73,
+  VMSTAT_PGROTATED = 74,
+  VMSTAT_DROP_PAGECACHE = 75,
+  VMSTAT_DROP_SLAB = 76,
+  VMSTAT_PGMIGRATE_SUCCESS = 77,
+  VMSTAT_PGMIGRATE_FAIL = 78,
+  VMSTAT_COMPACT_MIGRATE_SCANNED = 79,
+  VMSTAT_COMPACT_FREE_SCANNED = 80,
+  VMSTAT_COMPACT_ISOLATED = 81,
+  VMSTAT_COMPACT_STALL = 82,
+  VMSTAT_COMPACT_FAIL = 83,
+  VMSTAT_COMPACT_SUCCESS = 84,
+  VMSTAT_COMPACT_DAEMON_WAKE = 85,
+  VMSTAT_UNEVICTABLE_PGS_CULLED = 86,
+  VMSTAT_UNEVICTABLE_PGS_SCANNED = 87,
+  VMSTAT_UNEVICTABLE_PGS_RESCUED = 88,
+  VMSTAT_UNEVICTABLE_PGS_MLOCKED = 89,
+  VMSTAT_UNEVICTABLE_PGS_MUNLOCKED = 90,
+  VMSTAT_UNEVICTABLE_PGS_CLEARED = 91,
+  VMSTAT_UNEVICTABLE_PGS_STRANDED = 92,
+  VMSTAT_NR_ZSPAGES = 93,
+  VMSTAT_NR_ION_HEAP = 94,
+  VMSTAT_NR_GPU_HEAP = 95,
+  VMSTAT_ALLOCSTALL_DMA = 96,
+  VMSTAT_ALLOCSTALL_MOVABLE = 97,
+  VMSTAT_ALLOCSTALL_NORMAL = 98,
+  VMSTAT_COMPACT_DAEMON_FREE_SCANNED = 99,
+  VMSTAT_COMPACT_DAEMON_MIGRATE_SCANNED = 100,
+  VMSTAT_NR_FASTRPC = 101,
+  VMSTAT_NR_INDIRECTLY_RECLAIMABLE = 102,
+  VMSTAT_NR_ION_HEAP_POOL = 103,
+  VMSTAT_NR_KERNEL_MISC_RECLAIMABLE = 104,
+  VMSTAT_NR_SHADOW_CALL_STACK_BYTES = 105,
+  VMSTAT_NR_SHMEM_HUGEPAGES = 106,
+  VMSTAT_NR_SHMEM_PMDMAPPED = 107,
+  VMSTAT_NR_UNRECLAIMABLE_PAGES = 108,
+  VMSTAT_NR_ZONE_ACTIVE_ANON = 109,
+  VMSTAT_NR_ZONE_ACTIVE_FILE = 110,
+  VMSTAT_NR_ZONE_INACTIVE_ANON = 111,
+  VMSTAT_NR_ZONE_INACTIVE_FILE = 112,
+  VMSTAT_NR_ZONE_UNEVICTABLE = 113,
+  VMSTAT_NR_ZONE_WRITE_PENDING = 114,
+  VMSTAT_OOM_KILL = 115,
+  VMSTAT_PGLAZYFREE = 116,
+  VMSTAT_PGLAZYFREED = 117,
+  VMSTAT_PGREFILL = 118,
+  VMSTAT_PGSCAN_DIRECT = 119,
+  VMSTAT_PGSCAN_KSWAPD = 120,
+  VMSTAT_PGSKIP_DMA = 121,
+  VMSTAT_PGSKIP_MOVABLE = 122,
+  VMSTAT_PGSKIP_NORMAL = 123,
+  VMSTAT_PGSTEAL_DIRECT = 124,
+  VMSTAT_PGSTEAL_KSWAPD = 125,
+  VMSTAT_SWAP_RA = 126,
+  VMSTAT_SWAP_RA_HIT = 127,
+  VMSTAT_WORKINGSET_RESTORE = 128,
+};
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_SYS_STATS_COUNTERS_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/common/trace_stats.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACE_STATS_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACE_STATS_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class TraceStats;
+class TraceStats_FilterStats;
+class TraceStats_BufferStats;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT TraceStats : public ::protozero::CppMessageObj {
+ public:
+  using BufferStats = TraceStats_BufferStats;
+  using FilterStats = TraceStats_FilterStats;
+  enum FieldNumbers {
+    kBufferStatsFieldNumber = 1,
+    kProducersConnectedFieldNumber = 2,
+    kProducersSeenFieldNumber = 3,
+    kDataSourcesRegisteredFieldNumber = 4,
+    kDataSourcesSeenFieldNumber = 5,
+    kTracingSessionsFieldNumber = 6,
+    kTotalBuffersFieldNumber = 7,
+    kChunksDiscardedFieldNumber = 8,
+    kPatchesDiscardedFieldNumber = 9,
+    kInvalidPacketsFieldNumber = 10,
+    kFilterStatsFieldNumber = 11,
+  };
+
+  TraceStats();
+  ~TraceStats() override;
+  TraceStats(TraceStats&&) noexcept;
+  TraceStats& operator=(TraceStats&&);
+  TraceStats(const TraceStats&);
+  TraceStats& operator=(const TraceStats&);
+  bool operator==(const TraceStats&) const;
+  bool operator!=(const TraceStats& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<TraceStats_BufferStats>& buffer_stats() const { return buffer_stats_; }
+  std::vector<TraceStats_BufferStats>* mutable_buffer_stats() { return &buffer_stats_; }
+  int buffer_stats_size() const;
+  void clear_buffer_stats();
+  TraceStats_BufferStats* add_buffer_stats();
+
+  bool has_producers_connected() const { return _has_field_[2]; }
+  uint32_t producers_connected() const { return producers_connected_; }
+  void set_producers_connected(uint32_t value) { producers_connected_ = value; _has_field_.set(2); }
+
+  bool has_producers_seen() const { return _has_field_[3]; }
+  uint64_t producers_seen() const { return producers_seen_; }
+  void set_producers_seen(uint64_t value) { producers_seen_ = value; _has_field_.set(3); }
+
+  bool has_data_sources_registered() const { return _has_field_[4]; }
+  uint32_t data_sources_registered() const { return data_sources_registered_; }
+  void set_data_sources_registered(uint32_t value) { data_sources_registered_ = value; _has_field_.set(4); }
+
+  bool has_data_sources_seen() const { return _has_field_[5]; }
+  uint64_t data_sources_seen() const { return data_sources_seen_; }
+  void set_data_sources_seen(uint64_t value) { data_sources_seen_ = value; _has_field_.set(5); }
+
+  bool has_tracing_sessions() const { return _has_field_[6]; }
+  uint32_t tracing_sessions() const { return tracing_sessions_; }
+  void set_tracing_sessions(uint32_t value) { tracing_sessions_ = value; _has_field_.set(6); }
+
+  bool has_total_buffers() const { return _has_field_[7]; }
+  uint32_t total_buffers() const { return total_buffers_; }
+  void set_total_buffers(uint32_t value) { total_buffers_ = value; _has_field_.set(7); }
+
+  bool has_chunks_discarded() const { return _has_field_[8]; }
+  uint64_t chunks_discarded() const { return chunks_discarded_; }
+  void set_chunks_discarded(uint64_t value) { chunks_discarded_ = value; _has_field_.set(8); }
+
+  bool has_patches_discarded() const { return _has_field_[9]; }
+  uint64_t patches_discarded() const { return patches_discarded_; }
+  void set_patches_discarded(uint64_t value) { patches_discarded_ = value; _has_field_.set(9); }
+
+  bool has_invalid_packets() const { return _has_field_[10]; }
+  uint64_t invalid_packets() const { return invalid_packets_; }
+  void set_invalid_packets(uint64_t value) { invalid_packets_ = value; _has_field_.set(10); }
+
+  bool has_filter_stats() const { return _has_field_[11]; }
+  const TraceStats_FilterStats& filter_stats() const { return *filter_stats_; }
+  TraceStats_FilterStats* mutable_filter_stats() { _has_field_.set(11); return filter_stats_.get(); }
+
+ private:
+  std::vector<TraceStats_BufferStats> buffer_stats_;
+  uint32_t producers_connected_{};
+  uint64_t producers_seen_{};
+  uint32_t data_sources_registered_{};
+  uint64_t data_sources_seen_{};
+  uint32_t tracing_sessions_{};
+  uint32_t total_buffers_{};
+  uint64_t chunks_discarded_{};
+  uint64_t patches_discarded_{};
+  uint64_t invalid_packets_{};
+  ::protozero::CopyablePtr<TraceStats_FilterStats> filter_stats_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<12> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TraceStats_FilterStats : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kInputPacketsFieldNumber = 1,
+    kInputBytesFieldNumber = 2,
+    kOutputBytesFieldNumber = 3,
+    kErrorsFieldNumber = 4,
+  };
+
+  TraceStats_FilterStats();
+  ~TraceStats_FilterStats() override;
+  TraceStats_FilterStats(TraceStats_FilterStats&&) noexcept;
+  TraceStats_FilterStats& operator=(TraceStats_FilterStats&&);
+  TraceStats_FilterStats(const TraceStats_FilterStats&);
+  TraceStats_FilterStats& operator=(const TraceStats_FilterStats&);
+  bool operator==(const TraceStats_FilterStats&) const;
+  bool operator!=(const TraceStats_FilterStats& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_input_packets() const { return _has_field_[1]; }
+  uint64_t input_packets() const { return input_packets_; }
+  void set_input_packets(uint64_t value) { input_packets_ = value; _has_field_.set(1); }
+
+  bool has_input_bytes() const { return _has_field_[2]; }
+  uint64_t input_bytes() const { return input_bytes_; }
+  void set_input_bytes(uint64_t value) { input_bytes_ = value; _has_field_.set(2); }
+
+  bool has_output_bytes() const { return _has_field_[3]; }
+  uint64_t output_bytes() const { return output_bytes_; }
+  void set_output_bytes(uint64_t value) { output_bytes_ = value; _has_field_.set(3); }
+
+  bool has_errors() const { return _has_field_[4]; }
+  uint64_t errors() const { return errors_; }
+  void set_errors(uint64_t value) { errors_ = value; _has_field_.set(4); }
+
+ private:
+  uint64_t input_packets_{};
+  uint64_t input_bytes_{};
+  uint64_t output_bytes_{};
+  uint64_t errors_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<5> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TraceStats_BufferStats : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kBufferSizeFieldNumber = 12,
+    kBytesWrittenFieldNumber = 1,
+    kBytesOverwrittenFieldNumber = 13,
+    kBytesReadFieldNumber = 14,
+    kPaddingBytesWrittenFieldNumber = 15,
+    kPaddingBytesClearedFieldNumber = 16,
+    kChunksWrittenFieldNumber = 2,
+    kChunksRewrittenFieldNumber = 10,
+    kChunksOverwrittenFieldNumber = 3,
+    kChunksDiscardedFieldNumber = 18,
+    kChunksReadFieldNumber = 17,
+    kChunksCommittedOutOfOrderFieldNumber = 11,
+    kWriteWrapCountFieldNumber = 4,
+    kPatchesSucceededFieldNumber = 5,
+    kPatchesFailedFieldNumber = 6,
+    kReadaheadsSucceededFieldNumber = 7,
+    kReadaheadsFailedFieldNumber = 8,
+    kAbiViolationsFieldNumber = 9,
+    kTraceWriterPacketLossFieldNumber = 19,
+  };
+
+  TraceStats_BufferStats();
+  ~TraceStats_BufferStats() override;
+  TraceStats_BufferStats(TraceStats_BufferStats&&) noexcept;
+  TraceStats_BufferStats& operator=(TraceStats_BufferStats&&);
+  TraceStats_BufferStats(const TraceStats_BufferStats&);
+  TraceStats_BufferStats& operator=(const TraceStats_BufferStats&);
+  bool operator==(const TraceStats_BufferStats&) const;
+  bool operator!=(const TraceStats_BufferStats& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_buffer_size() const { return _has_field_[12]; }
+  uint64_t buffer_size() const { return buffer_size_; }
+  void set_buffer_size(uint64_t value) { buffer_size_ = value; _has_field_.set(12); }
+
+  bool has_bytes_written() const { return _has_field_[1]; }
+  uint64_t bytes_written() const { return bytes_written_; }
+  void set_bytes_written(uint64_t value) { bytes_written_ = value; _has_field_.set(1); }
+
+  bool has_bytes_overwritten() const { return _has_field_[13]; }
+  uint64_t bytes_overwritten() const { return bytes_overwritten_; }
+  void set_bytes_overwritten(uint64_t value) { bytes_overwritten_ = value; _has_field_.set(13); }
+
+  bool has_bytes_read() const { return _has_field_[14]; }
+  uint64_t bytes_read() const { return bytes_read_; }
+  void set_bytes_read(uint64_t value) { bytes_read_ = value; _has_field_.set(14); }
+
+  bool has_padding_bytes_written() const { return _has_field_[15]; }
+  uint64_t padding_bytes_written() const { return padding_bytes_written_; }
+  void set_padding_bytes_written(uint64_t value) { padding_bytes_written_ = value; _has_field_.set(15); }
+
+  bool has_padding_bytes_cleared() const { return _has_field_[16]; }
+  uint64_t padding_bytes_cleared() const { return padding_bytes_cleared_; }
+  void set_padding_bytes_cleared(uint64_t value) { padding_bytes_cleared_ = value; _has_field_.set(16); }
+
+  bool has_chunks_written() const { return _has_field_[2]; }
+  uint64_t chunks_written() const { return chunks_written_; }
+  void set_chunks_written(uint64_t value) { chunks_written_ = value; _has_field_.set(2); }
+
+  bool has_chunks_rewritten() const { return _has_field_[10]; }
+  uint64_t chunks_rewritten() const { return chunks_rewritten_; }
+  void set_chunks_rewritten(uint64_t value) { chunks_rewritten_ = value; _has_field_.set(10); }
+
+  bool has_chunks_overwritten() const { return _has_field_[3]; }
+  uint64_t chunks_overwritten() const { return chunks_overwritten_; }
+  void set_chunks_overwritten(uint64_t value) { chunks_overwritten_ = value; _has_field_.set(3); }
+
+  bool has_chunks_discarded() const { return _has_field_[18]; }
+  uint64_t chunks_discarded() const { return chunks_discarded_; }
+  void set_chunks_discarded(uint64_t value) { chunks_discarded_ = value; _has_field_.set(18); }
+
+  bool has_chunks_read() const { return _has_field_[17]; }
+  uint64_t chunks_read() const { return chunks_read_; }
+  void set_chunks_read(uint64_t value) { chunks_read_ = value; _has_field_.set(17); }
+
+  bool has_chunks_committed_out_of_order() const { return _has_field_[11]; }
+  uint64_t chunks_committed_out_of_order() const { return chunks_committed_out_of_order_; }
+  void set_chunks_committed_out_of_order(uint64_t value) { chunks_committed_out_of_order_ = value; _has_field_.set(11); }
+
+  bool has_write_wrap_count() const { return _has_field_[4]; }
+  uint64_t write_wrap_count() const { return write_wrap_count_; }
+  void set_write_wrap_count(uint64_t value) { write_wrap_count_ = value; _has_field_.set(4); }
+
+  bool has_patches_succeeded() const { return _has_field_[5]; }
+  uint64_t patches_succeeded() const { return patches_succeeded_; }
+  void set_patches_succeeded(uint64_t value) { patches_succeeded_ = value; _has_field_.set(5); }
+
+  bool has_patches_failed() const { return _has_field_[6]; }
+  uint64_t patches_failed() const { return patches_failed_; }
+  void set_patches_failed(uint64_t value) { patches_failed_ = value; _has_field_.set(6); }
+
+  bool has_readaheads_succeeded() const { return _has_field_[7]; }
+  uint64_t readaheads_succeeded() const { return readaheads_succeeded_; }
+  void set_readaheads_succeeded(uint64_t value) { readaheads_succeeded_ = value; _has_field_.set(7); }
+
+  bool has_readaheads_failed() const { return _has_field_[8]; }
+  uint64_t readaheads_failed() const { return readaheads_failed_; }
+  void set_readaheads_failed(uint64_t value) { readaheads_failed_ = value; _has_field_.set(8); }
+
+  bool has_abi_violations() const { return _has_field_[9]; }
+  uint64_t abi_violations() const { return abi_violations_; }
+  void set_abi_violations(uint64_t value) { abi_violations_ = value; _has_field_.set(9); }
+
+  bool has_trace_writer_packet_loss() const { return _has_field_[19]; }
+  uint64_t trace_writer_packet_loss() const { return trace_writer_packet_loss_; }
+  void set_trace_writer_packet_loss(uint64_t value) { trace_writer_packet_loss_ = value; _has_field_.set(19); }
+
+ private:
+  uint64_t buffer_size_{};
+  uint64_t bytes_written_{};
+  uint64_t bytes_overwritten_{};
+  uint64_t bytes_read_{};
+  uint64_t padding_bytes_written_{};
+  uint64_t padding_bytes_cleared_{};
+  uint64_t chunks_written_{};
+  uint64_t chunks_rewritten_{};
+  uint64_t chunks_overwritten_{};
+  uint64_t chunks_discarded_{};
+  uint64_t chunks_read_{};
+  uint64_t chunks_committed_out_of_order_{};
+  uint64_t write_wrap_count_{};
+  uint64_t patches_succeeded_{};
+  uint64_t patches_failed_{};
+  uint64_t readaheads_succeeded_{};
+  uint64_t readaheads_failed_{};
+  uint64_t abi_violations_{};
+  uint64_t trace_writer_packet_loss_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<20> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACE_STATS_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/common/tracing_service_capabilities.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACING_SERVICE_CAPABILITIES_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACING_SERVICE_CAPABILITIES_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class TracingServiceCapabilities;
+enum ObservableEvents_Type : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT TracingServiceCapabilities : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kHasQueryCapabilitiesFieldNumber = 1,
+    kObservableEventsFieldNumber = 2,
+    kHasTraceConfigOutputPathFieldNumber = 3,
+  };
+
+  TracingServiceCapabilities();
+  ~TracingServiceCapabilities() override;
+  TracingServiceCapabilities(TracingServiceCapabilities&&) noexcept;
+  TracingServiceCapabilities& operator=(TracingServiceCapabilities&&);
+  TracingServiceCapabilities(const TracingServiceCapabilities&);
+  TracingServiceCapabilities& operator=(const TracingServiceCapabilities&);
+  bool operator==(const TracingServiceCapabilities&) const;
+  bool operator!=(const TracingServiceCapabilities& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_has_query_capabilities() const { return _has_field_[1]; }
+  bool has_query_capabilities() const { return has_query_capabilities_; }
+  void set_has_query_capabilities(bool value) { has_query_capabilities_ = value; _has_field_.set(1); }
+
+  const std::vector<ObservableEvents_Type>& observable_events() const { return observable_events_; }
+  std::vector<ObservableEvents_Type>* mutable_observable_events() { return &observable_events_; }
+  int observable_events_size() const { return static_cast<int>(observable_events_.size()); }
+  void clear_observable_events() { observable_events_.clear(); }
+  void add_observable_events(ObservableEvents_Type value) { observable_events_.emplace_back(value); }
+  ObservableEvents_Type* add_observable_events() { observable_events_.emplace_back(); return &observable_events_.back(); }
+
+  bool has_has_trace_config_output_path() const { return _has_field_[3]; }
+  bool has_trace_config_output_path() const { return has_trace_config_output_path_; }
+  void set_has_trace_config_output_path(bool value) { has_trace_config_output_path_ = value; _has_field_.set(3); }
+
+ private:
+  bool has_query_capabilities_{};
+  std::vector<ObservableEvents_Type> observable_events_;
+  bool has_trace_config_output_path_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<4> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACING_SERVICE_CAPABILITIES_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/common/tracing_service_state.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACING_SERVICE_STATE_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACING_SERVICE_STATE_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class TracingServiceState;
+class TracingServiceState_DataSource;
+class DataSourceDescriptor;
+class TracingServiceState_Producer;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT TracingServiceState : public ::protozero::CppMessageObj {
+ public:
+  using Producer = TracingServiceState_Producer;
+  using DataSource = TracingServiceState_DataSource;
+  enum FieldNumbers {
+    kProducersFieldNumber = 1,
+    kDataSourcesFieldNumber = 2,
+    kNumSessionsFieldNumber = 3,
+    kNumSessionsStartedFieldNumber = 4,
+    kTracingServiceVersionFieldNumber = 5,
+  };
+
+  TracingServiceState();
+  ~TracingServiceState() override;
+  TracingServiceState(TracingServiceState&&) noexcept;
+  TracingServiceState& operator=(TracingServiceState&&);
+  TracingServiceState(const TracingServiceState&);
+  TracingServiceState& operator=(const TracingServiceState&);
+  bool operator==(const TracingServiceState&) const;
+  bool operator!=(const TracingServiceState& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<TracingServiceState_Producer>& producers() const { return producers_; }
+  std::vector<TracingServiceState_Producer>* mutable_producers() { return &producers_; }
+  int producers_size() const;
+  void clear_producers();
+  TracingServiceState_Producer* add_producers();
+
+  const std::vector<TracingServiceState_DataSource>& data_sources() const { return data_sources_; }
+  std::vector<TracingServiceState_DataSource>* mutable_data_sources() { return &data_sources_; }
+  int data_sources_size() const;
+  void clear_data_sources();
+  TracingServiceState_DataSource* add_data_sources();
+
+  bool has_num_sessions() const { return _has_field_[3]; }
+  int32_t num_sessions() const { return num_sessions_; }
+  void set_num_sessions(int32_t value) { num_sessions_ = value; _has_field_.set(3); }
+
+  bool has_num_sessions_started() const { return _has_field_[4]; }
+  int32_t num_sessions_started() const { return num_sessions_started_; }
+  void set_num_sessions_started(int32_t value) { num_sessions_started_ = value; _has_field_.set(4); }
+
+  bool has_tracing_service_version() const { return _has_field_[5]; }
+  const std::string& tracing_service_version() const { return tracing_service_version_; }
+  void set_tracing_service_version(const std::string& value) { tracing_service_version_ = value; _has_field_.set(5); }
+
+ private:
+  std::vector<TracingServiceState_Producer> producers_;
+  std::vector<TracingServiceState_DataSource> data_sources_;
+  int32_t num_sessions_{};
+  int32_t num_sessions_started_{};
+  std::string tracing_service_version_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<6> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TracingServiceState_DataSource : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDsDescriptorFieldNumber = 1,
+    kProducerIdFieldNumber = 2,
+  };
+
+  TracingServiceState_DataSource();
+  ~TracingServiceState_DataSource() override;
+  TracingServiceState_DataSource(TracingServiceState_DataSource&&) noexcept;
+  TracingServiceState_DataSource& operator=(TracingServiceState_DataSource&&);
+  TracingServiceState_DataSource(const TracingServiceState_DataSource&);
+  TracingServiceState_DataSource& operator=(const TracingServiceState_DataSource&);
+  bool operator==(const TracingServiceState_DataSource&) const;
+  bool operator!=(const TracingServiceState_DataSource& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_ds_descriptor() const { return _has_field_[1]; }
+  const DataSourceDescriptor& ds_descriptor() const { return *ds_descriptor_; }
+  DataSourceDescriptor* mutable_ds_descriptor() { _has_field_.set(1); return ds_descriptor_.get(); }
+
+  bool has_producer_id() const { return _has_field_[2]; }
+  int32_t producer_id() const { return producer_id_; }
+  void set_producer_id(int32_t value) { producer_id_ = value; _has_field_.set(2); }
+
+ private:
+  ::protozero::CopyablePtr<DataSourceDescriptor> ds_descriptor_;
+  int32_t producer_id_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TracingServiceState_Producer : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kIdFieldNumber = 1,
+    kNameFieldNumber = 2,
+    kUidFieldNumber = 3,
+    kSdkVersionFieldNumber = 4,
+  };
+
+  TracingServiceState_Producer();
+  ~TracingServiceState_Producer() override;
+  TracingServiceState_Producer(TracingServiceState_Producer&&) noexcept;
+  TracingServiceState_Producer& operator=(TracingServiceState_Producer&&);
+  TracingServiceState_Producer(const TracingServiceState_Producer&);
+  TracingServiceState_Producer& operator=(const TracingServiceState_Producer&);
+  bool operator==(const TracingServiceState_Producer&) const;
+  bool operator!=(const TracingServiceState_Producer& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_id() const { return _has_field_[1]; }
+  int32_t id() const { return id_; }
+  void set_id(int32_t value) { id_ = value; _has_field_.set(1); }
+
+  bool has_name() const { return _has_field_[2]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(2); }
+
+  bool has_uid() const { return _has_field_[3]; }
+  int32_t uid() const { return uid_; }
+  void set_uid(int32_t value) { uid_ = value; _has_field_.set(3); }
+
+  bool has_sdk_version() const { return _has_field_[4]; }
+  const std::string& sdk_version() const { return sdk_version_; }
+  void set_sdk_version(const std::string& value) { sdk_version_ = value; _has_field_.set(4); }
+
+ private:
+  int32_t id_{};
+  std::string name_{};
+  int32_t uid_{};
+  std::string sdk_version_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<5> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACING_SERVICE_STATE_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/common/track_event_descriptor.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACK_EVENT_DESCRIPTOR_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACK_EVENT_DESCRIPTOR_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class TrackEventDescriptor;
+class TrackEventCategory;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT TrackEventDescriptor : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kAvailableCategoriesFieldNumber = 1,
+  };
+
+  TrackEventDescriptor();
+  ~TrackEventDescriptor() override;
+  TrackEventDescriptor(TrackEventDescriptor&&) noexcept;
+  TrackEventDescriptor& operator=(TrackEventDescriptor&&);
+  TrackEventDescriptor(const TrackEventDescriptor&);
+  TrackEventDescriptor& operator=(const TrackEventDescriptor&);
+  bool operator==(const TrackEventDescriptor&) const;
+  bool operator!=(const TrackEventDescriptor& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<TrackEventCategory>& available_categories() const { return available_categories_; }
+  std::vector<TrackEventCategory>* mutable_available_categories() { return &available_categories_; }
+  int available_categories_size() const;
+  void clear_available_categories();
+  TrackEventCategory* add_available_categories();
+
+ private:
+  std::vector<TrackEventCategory> available_categories_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TrackEventCategory : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNameFieldNumber = 1,
+    kDescriptionFieldNumber = 2,
+    kTagsFieldNumber = 3,
+  };
+
+  TrackEventCategory();
+  ~TrackEventCategory() override;
+  TrackEventCategory(TrackEventCategory&&) noexcept;
+  TrackEventCategory& operator=(TrackEventCategory&&);
+  TrackEventCategory(const TrackEventCategory&);
+  TrackEventCategory& operator=(const TrackEventCategory&);
+  bool operator==(const TrackEventCategory&) const;
+  bool operator!=(const TrackEventCategory& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name() const { return _has_field_[1]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
+
+  bool has_description() const { return _has_field_[2]; }
+  const std::string& description() const { return description_; }
+  void set_description(const std::string& value) { description_ = value; _has_field_.set(2); }
+
+  const std::vector<std::string>& tags() const { return tags_; }
+  std::vector<std::string>* mutable_tags() { return &tags_; }
+  int tags_size() const { return static_cast<int>(tags_.size()); }
+  void clear_tags() { tags_.clear(); }
+  void add_tags(std::string value) { tags_.emplace_back(value); }
+  std::string* add_tags() { tags_.emplace_back(); return &tags_.back(); }
+
+ private:
+  std::string name_{};
+  std::string description_{};
+  std::vector<std::string> tags_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<4> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACK_EVENT_DESCRIPTOR_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/common/android_energy_consumer_descriptor.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_ANDROID_ENERGY_CONSUMER_DESCRIPTOR_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_ANDROID_ENERGY_CONSUMER_DESCRIPTOR_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class AndroidEnergyConsumer;
+
+class AndroidEnergyConsumerDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  AndroidEnergyConsumerDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit AndroidEnergyConsumerDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit AndroidEnergyConsumerDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_energy_consumers() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> energy_consumers() const { return GetRepeated<::protozero::ConstBytes>(1); }
+};
+
+class AndroidEnergyConsumerDescriptor : public ::protozero::Message {
+ public:
+  using Decoder = AndroidEnergyConsumerDescriptor_Decoder;
+  enum : int32_t {
+    kEnergyConsumersFieldNumber = 1,
+  };
+
+  using FieldMetadata_EnergyConsumers =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      AndroidEnergyConsumer,
+      AndroidEnergyConsumerDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EnergyConsumers kEnergyConsumers() { return {}; }
+  template <typename T = AndroidEnergyConsumer> T* add_energy_consumers() {
+    return BeginNestedMessage<T>(1);
+  }
+
+};
+
+class AndroidEnergyConsumer_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  AndroidEnergyConsumer_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit AndroidEnergyConsumer_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit AndroidEnergyConsumer_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_energy_consumer_id() const { return at<1>().valid(); }
+  int32_t energy_consumer_id() const { return at<1>().as_int32(); }
+  bool has_ordinal() const { return at<2>().valid(); }
+  int32_t ordinal() const { return at<2>().as_int32(); }
+  bool has_type() const { return at<3>().valid(); }
+  ::protozero::ConstChars type() const { return at<3>().as_string(); }
+  bool has_name() const { return at<4>().valid(); }
+  ::protozero::ConstChars name() const { return at<4>().as_string(); }
+};
+
+class AndroidEnergyConsumer : public ::protozero::Message {
+ public:
+  using Decoder = AndroidEnergyConsumer_Decoder;
+  enum : int32_t {
+    kEnergyConsumerIdFieldNumber = 1,
+    kOrdinalFieldNumber = 2,
+    kTypeFieldNumber = 3,
+    kNameFieldNumber = 4,
+  };
+
+  using FieldMetadata_EnergyConsumerId =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      AndroidEnergyConsumer>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EnergyConsumerId kEnergyConsumerId() { return {}; }
+  void set_energy_consumer_id(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_EnergyConsumerId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ordinal =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      AndroidEnergyConsumer>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ordinal kOrdinal() { return {}; }
+  void set_ordinal(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ordinal::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Type =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      AndroidEnergyConsumer>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Type kType() { return {}; }
+  void set_type(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Type::kFieldId, data, size);
+  }
+  void set_type(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Type::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      AndroidEnergyConsumer>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/common/android_log_constants.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_ANDROID_LOG_CONSTANTS_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_ANDROID_LOG_CONSTANTS_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+enum AndroidLogId : int32_t {
+  LID_DEFAULT = 0,
+  LID_RADIO = 1,
+  LID_EVENTS = 2,
+  LID_SYSTEM = 3,
+  LID_CRASH = 4,
+  LID_STATS = 5,
+  LID_SECURITY = 6,
+  LID_KERNEL = 7,
+};
+
+const AndroidLogId AndroidLogId_MIN = LID_DEFAULT;
+const AndroidLogId AndroidLogId_MAX = LID_KERNEL;
+
+enum AndroidLogPriority : int32_t {
+  PRIO_UNSPECIFIED = 0,
+  PRIO_UNUSED = 1,
+  PRIO_VERBOSE = 2,
+  PRIO_DEBUG = 3,
+  PRIO_INFO = 4,
+  PRIO_WARN = 5,
+  PRIO_ERROR = 6,
+  PRIO_FATAL = 7,
+};
+
+const AndroidLogPriority AndroidLogPriority_MIN = PRIO_UNSPECIFIED;
+const AndroidLogPriority AndroidLogPriority_MAX = PRIO_FATAL;
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/common/builtin_clock.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_BUILTIN_CLOCK_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_BUILTIN_CLOCK_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+enum BuiltinClock : int32_t {
+  BUILTIN_CLOCK_UNKNOWN = 0,
+  BUILTIN_CLOCK_REALTIME = 1,
+  BUILTIN_CLOCK_REALTIME_COARSE = 2,
+  BUILTIN_CLOCK_MONOTONIC = 3,
+  BUILTIN_CLOCK_MONOTONIC_COARSE = 4,
+  BUILTIN_CLOCK_MONOTONIC_RAW = 5,
+  BUILTIN_CLOCK_BOOTTIME = 6,
+  BUILTIN_CLOCK_MAX_ID = 63,
+};
+
+const BuiltinClock BuiltinClock_MIN = BUILTIN_CLOCK_UNKNOWN;
+const BuiltinClock BuiltinClock_MAX = BUILTIN_CLOCK_MAX_ID;
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/common/commit_data_request.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_COMMIT_DATA_REQUEST_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_COMMIT_DATA_REQUEST_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class CommitDataRequest_ChunkToPatch;
+class CommitDataRequest_ChunkToPatch_Patch;
+class CommitDataRequest_ChunksToMove;
+
+class CommitDataRequest_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  CommitDataRequest_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit CommitDataRequest_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit CommitDataRequest_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_chunks_to_move() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> chunks_to_move() const { return GetRepeated<::protozero::ConstBytes>(1); }
+  bool has_chunks_to_patch() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> chunks_to_patch() const { return GetRepeated<::protozero::ConstBytes>(2); }
+  bool has_flush_request_id() const { return at<3>().valid(); }
+  uint64_t flush_request_id() const { return at<3>().as_uint64(); }
+};
+
+class CommitDataRequest : public ::protozero::Message {
+ public:
+  using Decoder = CommitDataRequest_Decoder;
+  enum : int32_t {
+    kChunksToMoveFieldNumber = 1,
+    kChunksToPatchFieldNumber = 2,
+    kFlushRequestIdFieldNumber = 3,
+  };
+  using ChunksToMove = ::perfetto::protos::pbzero::CommitDataRequest_ChunksToMove;
+  using ChunkToPatch = ::perfetto::protos::pbzero::CommitDataRequest_ChunkToPatch;
+
+  using FieldMetadata_ChunksToMove =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      CommitDataRequest_ChunksToMove,
+      CommitDataRequest>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChunksToMove kChunksToMove() { return {}; }
+  template <typename T = CommitDataRequest_ChunksToMove> T* add_chunks_to_move() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_ChunksToPatch =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      CommitDataRequest_ChunkToPatch,
+      CommitDataRequest>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChunksToPatch kChunksToPatch() { return {}; }
+  template <typename T = CommitDataRequest_ChunkToPatch> T* add_chunks_to_patch() {
+    return BeginNestedMessage<T>(2);
+  }
+
+
+  using FieldMetadata_FlushRequestId =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      CommitDataRequest>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FlushRequestId kFlushRequestId() { return {}; }
+  void set_flush_request_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FlushRequestId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class CommitDataRequest_ChunkToPatch_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  CommitDataRequest_ChunkToPatch_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit CommitDataRequest_ChunkToPatch_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit CommitDataRequest_ChunkToPatch_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_target_buffer() const { return at<1>().valid(); }
+  uint32_t target_buffer() const { return at<1>().as_uint32(); }
+  bool has_writer_id() const { return at<2>().valid(); }
+  uint32_t writer_id() const { return at<2>().as_uint32(); }
+  bool has_chunk_id() const { return at<3>().valid(); }
+  uint32_t chunk_id() const { return at<3>().as_uint32(); }
+  bool has_patches() const { return at<4>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> patches() const { return GetRepeated<::protozero::ConstBytes>(4); }
+  bool has_has_more_patches() const { return at<5>().valid(); }
+  bool has_more_patches() const { return at<5>().as_bool(); }
+};
+
+class CommitDataRequest_ChunkToPatch : public ::protozero::Message {
+ public:
+  using Decoder = CommitDataRequest_ChunkToPatch_Decoder;
+  enum : int32_t {
+    kTargetBufferFieldNumber = 1,
+    kWriterIdFieldNumber = 2,
+    kChunkIdFieldNumber = 3,
+    kPatchesFieldNumber = 4,
+    kHasMorePatchesFieldNumber = 5,
+  };
+  using Patch = ::perfetto::protos::pbzero::CommitDataRequest_ChunkToPatch_Patch;
+
+  using FieldMetadata_TargetBuffer =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      CommitDataRequest_ChunkToPatch>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TargetBuffer kTargetBuffer() { return {}; }
+  void set_target_buffer(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TargetBuffer::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_WriterId =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      CommitDataRequest_ChunkToPatch>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_WriterId kWriterId() { return {}; }
+  void set_writer_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_WriterId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ChunkId =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      CommitDataRequest_ChunkToPatch>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChunkId kChunkId() { return {}; }
+  void set_chunk_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ChunkId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Patches =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      CommitDataRequest_ChunkToPatch_Patch,
+      CommitDataRequest_ChunkToPatch>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Patches kPatches() { return {}; }
+  template <typename T = CommitDataRequest_ChunkToPatch_Patch> T* add_patches() {
+    return BeginNestedMessage<T>(4);
+  }
+
+
+  using FieldMetadata_HasMorePatches =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      CommitDataRequest_ChunkToPatch>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HasMorePatches kHasMorePatches() { return {}; }
+  void set_has_more_patches(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_HasMorePatches::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class CommitDataRequest_ChunkToPatch_Patch_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  CommitDataRequest_ChunkToPatch_Patch_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit CommitDataRequest_ChunkToPatch_Patch_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit CommitDataRequest_ChunkToPatch_Patch_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_offset() const { return at<1>().valid(); }
+  uint32_t offset() const { return at<1>().as_uint32(); }
+  bool has_data() const { return at<2>().valid(); }
+  ::protozero::ConstBytes data() const { return at<2>().as_bytes(); }
+};
+
+class CommitDataRequest_ChunkToPatch_Patch : public ::protozero::Message {
+ public:
+  using Decoder = CommitDataRequest_ChunkToPatch_Patch_Decoder;
+  enum : int32_t {
+    kOffsetFieldNumber = 1,
+    kDataFieldNumber = 2,
+  };
+
+  using FieldMetadata_Offset =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      CommitDataRequest_ChunkToPatch_Patch>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Offset kOffset() { return {}; }
+  void set_offset(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Offset::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Data =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBytes,
+      std::string,
+      CommitDataRequest_ChunkToPatch_Patch>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Data kData() { return {}; }
+  void set_data(const uint8_t* data, size_t size) {
+    AppendBytes(FieldMetadata_Data::kFieldId, data, size);
+  }
+  void set_data(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Data::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBytes>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class CommitDataRequest_ChunksToMove_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  CommitDataRequest_ChunksToMove_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit CommitDataRequest_ChunksToMove_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit CommitDataRequest_ChunksToMove_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_page() const { return at<1>().valid(); }
+  uint32_t page() const { return at<1>().as_uint32(); }
+  bool has_chunk() const { return at<2>().valid(); }
+  uint32_t chunk() const { return at<2>().as_uint32(); }
+  bool has_target_buffer() const { return at<3>().valid(); }
+  uint32_t target_buffer() const { return at<3>().as_uint32(); }
+};
+
+class CommitDataRequest_ChunksToMove : public ::protozero::Message {
+ public:
+  using Decoder = CommitDataRequest_ChunksToMove_Decoder;
+  enum : int32_t {
+    kPageFieldNumber = 1,
+    kChunkFieldNumber = 2,
+    kTargetBufferFieldNumber = 3,
+  };
+
+  using FieldMetadata_Page =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      CommitDataRequest_ChunksToMove>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Page kPage() { return {}; }
+  void set_page(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Page::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Chunk =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      CommitDataRequest_ChunksToMove>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Chunk kChunk() { return {}; }
+  void set_chunk(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Chunk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TargetBuffer =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      CommitDataRequest_ChunksToMove>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TargetBuffer kTargetBuffer() { return {}; }
+  void set_target_buffer(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TargetBuffer::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/common/data_source_descriptor.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DATA_SOURCE_DESCRIPTOR_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DATA_SOURCE_DESCRIPTOR_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class GpuCounterDescriptor;
+class TrackEventDescriptor;
+
+class DataSourceDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  DataSourceDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit DataSourceDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit DataSourceDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_will_notify_on_stop() const { return at<2>().valid(); }
+  bool will_notify_on_stop() const { return at<2>().as_bool(); }
+  bool has_will_notify_on_start() const { return at<3>().valid(); }
+  bool will_notify_on_start() const { return at<3>().as_bool(); }
+  bool has_handles_incremental_state_clear() const { return at<4>().valid(); }
+  bool handles_incremental_state_clear() const { return at<4>().as_bool(); }
+  bool has_gpu_counter_descriptor() const { return at<5>().valid(); }
+  ::protozero::ConstBytes gpu_counter_descriptor() const { return at<5>().as_bytes(); }
+  bool has_track_event_descriptor() const { return at<6>().valid(); }
+  ::protozero::ConstBytes track_event_descriptor() const { return at<6>().as_bytes(); }
+};
+
+class DataSourceDescriptor : public ::protozero::Message {
+ public:
+  using Decoder = DataSourceDescriptor_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kWillNotifyOnStopFieldNumber = 2,
+    kWillNotifyOnStartFieldNumber = 3,
+    kHandlesIncrementalStateClearFieldNumber = 4,
+    kGpuCounterDescriptorFieldNumber = 5,
+    kTrackEventDescriptorFieldNumber = 6,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      DataSourceDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_WillNotifyOnStop =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      DataSourceDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_WillNotifyOnStop kWillNotifyOnStop() { return {}; }
+  void set_will_notify_on_stop(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_WillNotifyOnStop::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_WillNotifyOnStart =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      DataSourceDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_WillNotifyOnStart kWillNotifyOnStart() { return {}; }
+  void set_will_notify_on_start(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_WillNotifyOnStart::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HandlesIncrementalStateClear =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      DataSourceDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HandlesIncrementalStateClear kHandlesIncrementalStateClear() { return {}; }
+  void set_handles_incremental_state_clear(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_HandlesIncrementalStateClear::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_GpuCounterDescriptor =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      GpuCounterDescriptor,
+      DataSourceDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GpuCounterDescriptor kGpuCounterDescriptor() { return {}; }
+  template <typename T = GpuCounterDescriptor> T* set_gpu_counter_descriptor() {
+    return BeginNestedMessage<T>(5);
+  }
+
+  void set_gpu_counter_descriptor_raw(const std::string& raw) {
+    return AppendBytes(5, raw.data(), raw.size());
+  }
+
+
+  using FieldMetadata_TrackEventDescriptor =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TrackEventDescriptor,
+      DataSourceDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TrackEventDescriptor kTrackEventDescriptor() { return {}; }
+  template <typename T = TrackEventDescriptor> T* set_track_event_descriptor() {
+    return BeginNestedMessage<T>(6);
+  }
+
+  void set_track_event_descriptor_raw(const std::string& raw) {
+    return AppendBytes(6, raw.data(), raw.size());
+  }
+
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/common/descriptor.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DESCRIPTOR_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DESCRIPTOR_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class DescriptorProto;
+class DescriptorProto_ReservedRange;
+class EnumDescriptorProto;
+class EnumValueDescriptorProto;
+class FieldDescriptorProto;
+class FileDescriptorProto;
+class OneofDescriptorProto;
+class OneofOptions;
+enum FieldDescriptorProto_Label : int32_t;
+enum FieldDescriptorProto_Type : int32_t;
+
+enum FieldDescriptorProto_Type : int32_t {
+  FieldDescriptorProto_Type_TYPE_DOUBLE = 1,
+  FieldDescriptorProto_Type_TYPE_FLOAT = 2,
+  FieldDescriptorProto_Type_TYPE_INT64 = 3,
+  FieldDescriptorProto_Type_TYPE_UINT64 = 4,
+  FieldDescriptorProto_Type_TYPE_INT32 = 5,
+  FieldDescriptorProto_Type_TYPE_FIXED64 = 6,
+  FieldDescriptorProto_Type_TYPE_FIXED32 = 7,
+  FieldDescriptorProto_Type_TYPE_BOOL = 8,
+  FieldDescriptorProto_Type_TYPE_STRING = 9,
+  FieldDescriptorProto_Type_TYPE_GROUP = 10,
+  FieldDescriptorProto_Type_TYPE_MESSAGE = 11,
+  FieldDescriptorProto_Type_TYPE_BYTES = 12,
+  FieldDescriptorProto_Type_TYPE_UINT32 = 13,
+  FieldDescriptorProto_Type_TYPE_ENUM = 14,
+  FieldDescriptorProto_Type_TYPE_SFIXED32 = 15,
+  FieldDescriptorProto_Type_TYPE_SFIXED64 = 16,
+  FieldDescriptorProto_Type_TYPE_SINT32 = 17,
+  FieldDescriptorProto_Type_TYPE_SINT64 = 18,
+};
+
+const FieldDescriptorProto_Type FieldDescriptorProto_Type_MIN = FieldDescriptorProto_Type_TYPE_DOUBLE;
+const FieldDescriptorProto_Type FieldDescriptorProto_Type_MAX = FieldDescriptorProto_Type_TYPE_SINT64;
+
+enum FieldDescriptorProto_Label : int32_t {
+  FieldDescriptorProto_Label_LABEL_OPTIONAL = 1,
+  FieldDescriptorProto_Label_LABEL_REQUIRED = 2,
+  FieldDescriptorProto_Label_LABEL_REPEATED = 3,
+};
+
+const FieldDescriptorProto_Label FieldDescriptorProto_Label_MIN = FieldDescriptorProto_Label_LABEL_OPTIONAL;
+const FieldDescriptorProto_Label FieldDescriptorProto_Label_MAX = FieldDescriptorProto_Label_LABEL_REPEATED;
+
+class OneofOptions_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/0, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  OneofOptions_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit OneofOptions_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit OneofOptions_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+};
+
+class OneofOptions : public ::protozero::Message {
+ public:
+  using Decoder = OneofOptions_Decoder;
+};
+
+class EnumValueDescriptorProto_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  EnumValueDescriptorProto_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit EnumValueDescriptorProto_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit EnumValueDescriptorProto_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_number() const { return at<2>().valid(); }
+  int32_t number() const { return at<2>().as_int32(); }
+};
+
+class EnumValueDescriptorProto : public ::protozero::Message {
+ public:
+  using Decoder = EnumValueDescriptorProto_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kNumberFieldNumber = 2,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      EnumValueDescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Number =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      EnumValueDescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Number kNumber() { return {}; }
+  void set_number(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Number::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class EnumDescriptorProto_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  EnumDescriptorProto_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit EnumDescriptorProto_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit EnumDescriptorProto_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_value() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> value() const { return GetRepeated<::protozero::ConstBytes>(2); }
+  bool has_reserved_name() const { return at<5>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> reserved_name() const { return GetRepeated<::protozero::ConstChars>(5); }
+};
+
+class EnumDescriptorProto : public ::protozero::Message {
+ public:
+  using Decoder = EnumDescriptorProto_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kValueFieldNumber = 2,
+    kReservedNameFieldNumber = 5,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      EnumDescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Value =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      EnumValueDescriptorProto,
+      EnumDescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Value kValue() { return {}; }
+  template <typename T = EnumValueDescriptorProto> T* add_value() {
+    return BeginNestedMessage<T>(2);
+  }
+
+
+  using FieldMetadata_ReservedName =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      EnumDescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ReservedName kReservedName() { return {}; }
+  void add_reserved_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ReservedName::kFieldId, data, size);
+  }
+  void add_reserved_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ReservedName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class OneofDescriptorProto_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  OneofDescriptorProto_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit OneofDescriptorProto_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit OneofDescriptorProto_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_options() const { return at<2>().valid(); }
+  ::protozero::ConstBytes options() const { return at<2>().as_bytes(); }
+};
+
+class OneofDescriptorProto : public ::protozero::Message {
+ public:
+  using Decoder = OneofDescriptorProto_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kOptionsFieldNumber = 2,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      OneofDescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Options =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      OneofOptions,
+      OneofDescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Options kOptions() { return {}; }
+  template <typename T = OneofOptions> T* set_options() {
+    return BeginNestedMessage<T>(2);
+  }
+
+};
+
+class FieldDescriptorProto_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/9, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  FieldDescriptorProto_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit FieldDescriptorProto_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit FieldDescriptorProto_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_number() const { return at<3>().valid(); }
+  int32_t number() const { return at<3>().as_int32(); }
+  bool has_label() const { return at<4>().valid(); }
+  int32_t label() const { return at<4>().as_int32(); }
+  bool has_type() const { return at<5>().valid(); }
+  int32_t type() const { return at<5>().as_int32(); }
+  bool has_type_name() const { return at<6>().valid(); }
+  ::protozero::ConstChars type_name() const { return at<6>().as_string(); }
+  bool has_extendee() const { return at<2>().valid(); }
+  ::protozero::ConstChars extendee() const { return at<2>().as_string(); }
+  bool has_default_value() const { return at<7>().valid(); }
+  ::protozero::ConstChars default_value() const { return at<7>().as_string(); }
+  bool has_oneof_index() const { return at<9>().valid(); }
+  int32_t oneof_index() const { return at<9>().as_int32(); }
+};
+
+class FieldDescriptorProto : public ::protozero::Message {
+ public:
+  using Decoder = FieldDescriptorProto_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kNumberFieldNumber = 3,
+    kLabelFieldNumber = 4,
+    kTypeFieldNumber = 5,
+    kTypeNameFieldNumber = 6,
+    kExtendeeFieldNumber = 2,
+    kDefaultValueFieldNumber = 7,
+    kOneofIndexFieldNumber = 9,
+  };
+  using Type = ::perfetto::protos::pbzero::FieldDescriptorProto_Type;
+  using Label = ::perfetto::protos::pbzero::FieldDescriptorProto_Label;
+  static const Type TYPE_DOUBLE = FieldDescriptorProto_Type_TYPE_DOUBLE;
+  static const Type TYPE_FLOAT = FieldDescriptorProto_Type_TYPE_FLOAT;
+  static const Type TYPE_INT64 = FieldDescriptorProto_Type_TYPE_INT64;
+  static const Type TYPE_UINT64 = FieldDescriptorProto_Type_TYPE_UINT64;
+  static const Type TYPE_INT32 = FieldDescriptorProto_Type_TYPE_INT32;
+  static const Type TYPE_FIXED64 = FieldDescriptorProto_Type_TYPE_FIXED64;
+  static const Type TYPE_FIXED32 = FieldDescriptorProto_Type_TYPE_FIXED32;
+  static const Type TYPE_BOOL = FieldDescriptorProto_Type_TYPE_BOOL;
+  static const Type TYPE_STRING = FieldDescriptorProto_Type_TYPE_STRING;
+  static const Type TYPE_GROUP = FieldDescriptorProto_Type_TYPE_GROUP;
+  static const Type TYPE_MESSAGE = FieldDescriptorProto_Type_TYPE_MESSAGE;
+  static const Type TYPE_BYTES = FieldDescriptorProto_Type_TYPE_BYTES;
+  static const Type TYPE_UINT32 = FieldDescriptorProto_Type_TYPE_UINT32;
+  static const Type TYPE_ENUM = FieldDescriptorProto_Type_TYPE_ENUM;
+  static const Type TYPE_SFIXED32 = FieldDescriptorProto_Type_TYPE_SFIXED32;
+  static const Type TYPE_SFIXED64 = FieldDescriptorProto_Type_TYPE_SFIXED64;
+  static const Type TYPE_SINT32 = FieldDescriptorProto_Type_TYPE_SINT32;
+  static const Type TYPE_SINT64 = FieldDescriptorProto_Type_TYPE_SINT64;
+  static const Label LABEL_OPTIONAL = FieldDescriptorProto_Label_LABEL_OPTIONAL;
+  static const Label LABEL_REQUIRED = FieldDescriptorProto_Label_LABEL_REQUIRED;
+  static const Label LABEL_REPEATED = FieldDescriptorProto_Label_LABEL_REPEATED;
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      FieldDescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Number =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      FieldDescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Number kNumber() { return {}; }
+  void set_number(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Number::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Label =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::FieldDescriptorProto_Label,
+      FieldDescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Label kLabel() { return {}; }
+  void set_label(::perfetto::protos::pbzero::FieldDescriptorProto_Label value) {
+    static constexpr uint32_t field_id = FieldMetadata_Label::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Type =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::FieldDescriptorProto_Type,
+      FieldDescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Type kType() { return {}; }
+  void set_type(::perfetto::protos::pbzero::FieldDescriptorProto_Type value) {
+    static constexpr uint32_t field_id = FieldMetadata_Type::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TypeName =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      FieldDescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TypeName kTypeName() { return {}; }
+  void set_type_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_TypeName::kFieldId, data, size);
+  }
+  void set_type_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_TypeName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Extendee =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      FieldDescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Extendee kExtendee() { return {}; }
+  void set_extendee(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Extendee::kFieldId, data, size);
+  }
+  void set_extendee(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Extendee::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DefaultValue =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      FieldDescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DefaultValue kDefaultValue() { return {}; }
+  void set_default_value(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_DefaultValue::kFieldId, data, size);
+  }
+  void set_default_value(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_DefaultValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OneofIndex =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      FieldDescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OneofIndex kOneofIndex() { return {}; }
+  void set_oneof_index(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OneofIndex::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class DescriptorProto_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/10, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  DescriptorProto_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit DescriptorProto_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit DescriptorProto_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_field() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> field() const { return GetRepeated<::protozero::ConstBytes>(2); }
+  bool has_extension() const { return at<6>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> extension() const { return GetRepeated<::protozero::ConstBytes>(6); }
+  bool has_nested_type() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> nested_type() const { return GetRepeated<::protozero::ConstBytes>(3); }
+  bool has_enum_type() const { return at<4>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> enum_type() const { return GetRepeated<::protozero::ConstBytes>(4); }
+  bool has_oneof_decl() const { return at<8>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> oneof_decl() const { return GetRepeated<::protozero::ConstBytes>(8); }
+  bool has_reserved_range() const { return at<9>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> reserved_range() const { return GetRepeated<::protozero::ConstBytes>(9); }
+  bool has_reserved_name() const { return at<10>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> reserved_name() const { return GetRepeated<::protozero::ConstChars>(10); }
+};
+
+class DescriptorProto : public ::protozero::Message {
+ public:
+  using Decoder = DescriptorProto_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kFieldFieldNumber = 2,
+    kExtensionFieldNumber = 6,
+    kNestedTypeFieldNumber = 3,
+    kEnumTypeFieldNumber = 4,
+    kOneofDeclFieldNumber = 8,
+    kReservedRangeFieldNumber = 9,
+    kReservedNameFieldNumber = 10,
+  };
+  using ReservedRange = ::perfetto::protos::pbzero::DescriptorProto_ReservedRange;
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      DescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Field =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      FieldDescriptorProto,
+      DescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Field kField() { return {}; }
+  template <typename T = FieldDescriptorProto> T* add_field() {
+    return BeginNestedMessage<T>(2);
+  }
+
+
+  using FieldMetadata_Extension =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      FieldDescriptorProto,
+      DescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Extension kExtension() { return {}; }
+  template <typename T = FieldDescriptorProto> T* add_extension() {
+    return BeginNestedMessage<T>(6);
+  }
+
+
+  using FieldMetadata_NestedType =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      DescriptorProto,
+      DescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NestedType kNestedType() { return {}; }
+  template <typename T = DescriptorProto> T* add_nested_type() {
+    return BeginNestedMessage<T>(3);
+  }
+
+
+  using FieldMetadata_EnumType =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      EnumDescriptorProto,
+      DescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EnumType kEnumType() { return {}; }
+  template <typename T = EnumDescriptorProto> T* add_enum_type() {
+    return BeginNestedMessage<T>(4);
+  }
+
+
+  using FieldMetadata_OneofDecl =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      OneofDescriptorProto,
+      DescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OneofDecl kOneofDecl() { return {}; }
+  template <typename T = OneofDescriptorProto> T* add_oneof_decl() {
+    return BeginNestedMessage<T>(8);
+  }
+
+
+  using FieldMetadata_ReservedRange =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      DescriptorProto_ReservedRange,
+      DescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ReservedRange kReservedRange() { return {}; }
+  template <typename T = DescriptorProto_ReservedRange> T* add_reserved_range() {
+    return BeginNestedMessage<T>(9);
+  }
+
+
+  using FieldMetadata_ReservedName =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      DescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ReservedName kReservedName() { return {}; }
+  void add_reserved_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ReservedName::kFieldId, data, size);
+  }
+  void add_reserved_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ReservedName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class DescriptorProto_ReservedRange_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  DescriptorProto_ReservedRange_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit DescriptorProto_ReservedRange_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit DescriptorProto_ReservedRange_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_start() const { return at<1>().valid(); }
+  int32_t start() const { return at<1>().as_int32(); }
+  bool has_end() const { return at<2>().valid(); }
+  int32_t end() const { return at<2>().as_int32(); }
+};
+
+class DescriptorProto_ReservedRange : public ::protozero::Message {
+ public:
+  using Decoder = DescriptorProto_ReservedRange_Decoder;
+  enum : int32_t {
+    kStartFieldNumber = 1,
+    kEndFieldNumber = 2,
+  };
+
+  using FieldMetadata_Start =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      DescriptorProto_ReservedRange>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Start kStart() { return {}; }
+  void set_start(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Start::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_End =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      DescriptorProto_ReservedRange>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_End kEnd() { return {}; }
+  void set_end(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_End::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class FileDescriptorProto_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/11, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  FileDescriptorProto_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit FileDescriptorProto_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit FileDescriptorProto_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_package() const { return at<2>().valid(); }
+  ::protozero::ConstChars package() const { return at<2>().as_string(); }
+  bool has_dependency() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> dependency() const { return GetRepeated<::protozero::ConstChars>(3); }
+  bool has_public_dependency() const { return at<10>().valid(); }
+  ::protozero::RepeatedFieldIterator<int32_t> public_dependency() const { return GetRepeated<int32_t>(10); }
+  bool has_weak_dependency() const { return at<11>().valid(); }
+  ::protozero::RepeatedFieldIterator<int32_t> weak_dependency() const { return GetRepeated<int32_t>(11); }
+  bool has_message_type() const { return at<4>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> message_type() const { return GetRepeated<::protozero::ConstBytes>(4); }
+  bool has_enum_type() const { return at<5>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> enum_type() const { return GetRepeated<::protozero::ConstBytes>(5); }
+  bool has_extension() const { return at<7>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> extension() const { return GetRepeated<::protozero::ConstBytes>(7); }
+};
+
+class FileDescriptorProto : public ::protozero::Message {
+ public:
+  using Decoder = FileDescriptorProto_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kPackageFieldNumber = 2,
+    kDependencyFieldNumber = 3,
+    kPublicDependencyFieldNumber = 10,
+    kWeakDependencyFieldNumber = 11,
+    kMessageTypeFieldNumber = 4,
+    kEnumTypeFieldNumber = 5,
+    kExtensionFieldNumber = 7,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      FileDescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Package =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      FileDescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Package kPackage() { return {}; }
+  void set_package(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Package::kFieldId, data, size);
+  }
+  void set_package(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Package::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Dependency =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      FileDescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dependency kDependency() { return {}; }
+  void add_dependency(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Dependency::kFieldId, data, size);
+  }
+  void add_dependency(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dependency::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PublicDependency =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      FileDescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PublicDependency kPublicDependency() { return {}; }
+  void add_public_dependency(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PublicDependency::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_WeakDependency =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      FileDescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_WeakDependency kWeakDependency() { return {}; }
+  void add_weak_dependency(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_WeakDependency::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MessageType =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      DescriptorProto,
+      FileDescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MessageType kMessageType() { return {}; }
+  template <typename T = DescriptorProto> T* add_message_type() {
+    return BeginNestedMessage<T>(4);
+  }
+
+
+  using FieldMetadata_EnumType =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      EnumDescriptorProto,
+      FileDescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EnumType kEnumType() { return {}; }
+  template <typename T = EnumDescriptorProto> T* add_enum_type() {
+    return BeginNestedMessage<T>(5);
+  }
+
+
+  using FieldMetadata_Extension =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      FieldDescriptorProto,
+      FileDescriptorProto>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Extension kExtension() { return {}; }
+  template <typename T = FieldDescriptorProto> T* add_extension() {
+    return BeginNestedMessage<T>(7);
+  }
+
+};
+
+class FileDescriptorSet_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  FileDescriptorSet_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit FileDescriptorSet_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit FileDescriptorSet_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_file() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> file() const { return GetRepeated<::protozero::ConstBytes>(1); }
+};
+
+class FileDescriptorSet : public ::protozero::Message {
+ public:
+  using Decoder = FileDescriptorSet_Decoder;
+  enum : int32_t {
+    kFileFieldNumber = 1,
+  };
+
+  using FieldMetadata_File =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      FileDescriptorProto,
+      FileDescriptorSet>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_File kFile() { return {}; }
+  template <typename T = FileDescriptorProto> T* add_file() {
+    return BeginNestedMessage<T>(1);
+  }
+
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/common/gpu_counter_descriptor.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_GPU_COUNTER_DESCRIPTOR_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_GPU_COUNTER_DESCRIPTOR_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class GpuCounterDescriptor_GpuCounterBlock;
+class GpuCounterDescriptor_GpuCounterSpec;
+enum GpuCounterDescriptor_GpuCounterGroup : int32_t;
+enum GpuCounterDescriptor_MeasureUnit : int32_t;
+
+enum GpuCounterDescriptor_GpuCounterGroup : int32_t {
+  GpuCounterDescriptor_GpuCounterGroup_UNCLASSIFIED = 0,
+  GpuCounterDescriptor_GpuCounterGroup_SYSTEM = 1,
+  GpuCounterDescriptor_GpuCounterGroup_VERTICES = 2,
+  GpuCounterDescriptor_GpuCounterGroup_FRAGMENTS = 3,
+  GpuCounterDescriptor_GpuCounterGroup_PRIMITIVES = 4,
+  GpuCounterDescriptor_GpuCounterGroup_MEMORY = 5,
+  GpuCounterDescriptor_GpuCounterGroup_COMPUTE = 6,
+};
+
+const GpuCounterDescriptor_GpuCounterGroup GpuCounterDescriptor_GpuCounterGroup_MIN = GpuCounterDescriptor_GpuCounterGroup_UNCLASSIFIED;
+const GpuCounterDescriptor_GpuCounterGroup GpuCounterDescriptor_GpuCounterGroup_MAX = GpuCounterDescriptor_GpuCounterGroup_COMPUTE;
+
+enum GpuCounterDescriptor_MeasureUnit : int32_t {
+  GpuCounterDescriptor_MeasureUnit_NONE = 0,
+  GpuCounterDescriptor_MeasureUnit_BIT = 1,
+  GpuCounterDescriptor_MeasureUnit_KILOBIT = 2,
+  GpuCounterDescriptor_MeasureUnit_MEGABIT = 3,
+  GpuCounterDescriptor_MeasureUnit_GIGABIT = 4,
+  GpuCounterDescriptor_MeasureUnit_TERABIT = 5,
+  GpuCounterDescriptor_MeasureUnit_PETABIT = 6,
+  GpuCounterDescriptor_MeasureUnit_BYTE = 7,
+  GpuCounterDescriptor_MeasureUnit_KILOBYTE = 8,
+  GpuCounterDescriptor_MeasureUnit_MEGABYTE = 9,
+  GpuCounterDescriptor_MeasureUnit_GIGABYTE = 10,
+  GpuCounterDescriptor_MeasureUnit_TERABYTE = 11,
+  GpuCounterDescriptor_MeasureUnit_PETABYTE = 12,
+  GpuCounterDescriptor_MeasureUnit_HERTZ = 13,
+  GpuCounterDescriptor_MeasureUnit_KILOHERTZ = 14,
+  GpuCounterDescriptor_MeasureUnit_MEGAHERTZ = 15,
+  GpuCounterDescriptor_MeasureUnit_GIGAHERTZ = 16,
+  GpuCounterDescriptor_MeasureUnit_TERAHERTZ = 17,
+  GpuCounterDescriptor_MeasureUnit_PETAHERTZ = 18,
+  GpuCounterDescriptor_MeasureUnit_NANOSECOND = 19,
+  GpuCounterDescriptor_MeasureUnit_MICROSECOND = 20,
+  GpuCounterDescriptor_MeasureUnit_MILLISECOND = 21,
+  GpuCounterDescriptor_MeasureUnit_SECOND = 22,
+  GpuCounterDescriptor_MeasureUnit_MINUTE = 23,
+  GpuCounterDescriptor_MeasureUnit_HOUR = 24,
+  GpuCounterDescriptor_MeasureUnit_VERTEX = 25,
+  GpuCounterDescriptor_MeasureUnit_PIXEL = 26,
+  GpuCounterDescriptor_MeasureUnit_TRIANGLE = 27,
+  GpuCounterDescriptor_MeasureUnit_PRIMITIVE = 38,
+  GpuCounterDescriptor_MeasureUnit_FRAGMENT = 39,
+  GpuCounterDescriptor_MeasureUnit_MILLIWATT = 28,
+  GpuCounterDescriptor_MeasureUnit_WATT = 29,
+  GpuCounterDescriptor_MeasureUnit_KILOWATT = 30,
+  GpuCounterDescriptor_MeasureUnit_JOULE = 31,
+  GpuCounterDescriptor_MeasureUnit_VOLT = 32,
+  GpuCounterDescriptor_MeasureUnit_AMPERE = 33,
+  GpuCounterDescriptor_MeasureUnit_CELSIUS = 34,
+  GpuCounterDescriptor_MeasureUnit_FAHRENHEIT = 35,
+  GpuCounterDescriptor_MeasureUnit_KELVIN = 36,
+  GpuCounterDescriptor_MeasureUnit_PERCENT = 37,
+  GpuCounterDescriptor_MeasureUnit_INSTRUCTION = 40,
+};
+
+const GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor_MeasureUnit_MIN = GpuCounterDescriptor_MeasureUnit_NONE;
+const GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor_MeasureUnit_MAX = GpuCounterDescriptor_MeasureUnit_INSTRUCTION;
+
+class GpuCounterDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  GpuCounterDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit GpuCounterDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit GpuCounterDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_specs() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> specs() const { return GetRepeated<::protozero::ConstBytes>(1); }
+  bool has_blocks() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> blocks() const { return GetRepeated<::protozero::ConstBytes>(2); }
+  bool has_min_sampling_period_ns() const { return at<3>().valid(); }
+  uint64_t min_sampling_period_ns() const { return at<3>().as_uint64(); }
+  bool has_max_sampling_period_ns() const { return at<4>().valid(); }
+  uint64_t max_sampling_period_ns() const { return at<4>().as_uint64(); }
+  bool has_supports_instrumented_sampling() const { return at<5>().valid(); }
+  bool supports_instrumented_sampling() const { return at<5>().as_bool(); }
+};
+
+class GpuCounterDescriptor : public ::protozero::Message {
+ public:
+  using Decoder = GpuCounterDescriptor_Decoder;
+  enum : int32_t {
+    kSpecsFieldNumber = 1,
+    kBlocksFieldNumber = 2,
+    kMinSamplingPeriodNsFieldNumber = 3,
+    kMaxSamplingPeriodNsFieldNumber = 4,
+    kSupportsInstrumentedSamplingFieldNumber = 5,
+  };
+  using GpuCounterSpec = ::perfetto::protos::pbzero::GpuCounterDescriptor_GpuCounterSpec;
+  using GpuCounterBlock = ::perfetto::protos::pbzero::GpuCounterDescriptor_GpuCounterBlock;
+  using GpuCounterGroup = ::perfetto::protos::pbzero::GpuCounterDescriptor_GpuCounterGroup;
+  using MeasureUnit = ::perfetto::protos::pbzero::GpuCounterDescriptor_MeasureUnit;
+  static const GpuCounterGroup UNCLASSIFIED = GpuCounterDescriptor_GpuCounterGroup_UNCLASSIFIED;
+  static const GpuCounterGroup SYSTEM = GpuCounterDescriptor_GpuCounterGroup_SYSTEM;
+  static const GpuCounterGroup VERTICES = GpuCounterDescriptor_GpuCounterGroup_VERTICES;
+  static const GpuCounterGroup FRAGMENTS = GpuCounterDescriptor_GpuCounterGroup_FRAGMENTS;
+  static const GpuCounterGroup PRIMITIVES = GpuCounterDescriptor_GpuCounterGroup_PRIMITIVES;
+  static const GpuCounterGroup MEMORY = GpuCounterDescriptor_GpuCounterGroup_MEMORY;
+  static const GpuCounterGroup COMPUTE = GpuCounterDescriptor_GpuCounterGroup_COMPUTE;
+  static const MeasureUnit NONE = GpuCounterDescriptor_MeasureUnit_NONE;
+  static const MeasureUnit BIT = GpuCounterDescriptor_MeasureUnit_BIT;
+  static const MeasureUnit KILOBIT = GpuCounterDescriptor_MeasureUnit_KILOBIT;
+  static const MeasureUnit MEGABIT = GpuCounterDescriptor_MeasureUnit_MEGABIT;
+  static const MeasureUnit GIGABIT = GpuCounterDescriptor_MeasureUnit_GIGABIT;
+  static const MeasureUnit TERABIT = GpuCounterDescriptor_MeasureUnit_TERABIT;
+  static const MeasureUnit PETABIT = GpuCounterDescriptor_MeasureUnit_PETABIT;
+  static const MeasureUnit BYTE = GpuCounterDescriptor_MeasureUnit_BYTE;
+  static const MeasureUnit KILOBYTE = GpuCounterDescriptor_MeasureUnit_KILOBYTE;
+  static const MeasureUnit MEGABYTE = GpuCounterDescriptor_MeasureUnit_MEGABYTE;
+  static const MeasureUnit GIGABYTE = GpuCounterDescriptor_MeasureUnit_GIGABYTE;
+  static const MeasureUnit TERABYTE = GpuCounterDescriptor_MeasureUnit_TERABYTE;
+  static const MeasureUnit PETABYTE = GpuCounterDescriptor_MeasureUnit_PETABYTE;
+  static const MeasureUnit HERTZ = GpuCounterDescriptor_MeasureUnit_HERTZ;
+  static const MeasureUnit KILOHERTZ = GpuCounterDescriptor_MeasureUnit_KILOHERTZ;
+  static const MeasureUnit MEGAHERTZ = GpuCounterDescriptor_MeasureUnit_MEGAHERTZ;
+  static const MeasureUnit GIGAHERTZ = GpuCounterDescriptor_MeasureUnit_GIGAHERTZ;
+  static const MeasureUnit TERAHERTZ = GpuCounterDescriptor_MeasureUnit_TERAHERTZ;
+  static const MeasureUnit PETAHERTZ = GpuCounterDescriptor_MeasureUnit_PETAHERTZ;
+  static const MeasureUnit NANOSECOND = GpuCounterDescriptor_MeasureUnit_NANOSECOND;
+  static const MeasureUnit MICROSECOND = GpuCounterDescriptor_MeasureUnit_MICROSECOND;
+  static const MeasureUnit MILLISECOND = GpuCounterDescriptor_MeasureUnit_MILLISECOND;
+  static const MeasureUnit SECOND = GpuCounterDescriptor_MeasureUnit_SECOND;
+  static const MeasureUnit MINUTE = GpuCounterDescriptor_MeasureUnit_MINUTE;
+  static const MeasureUnit HOUR = GpuCounterDescriptor_MeasureUnit_HOUR;
+  static const MeasureUnit VERTEX = GpuCounterDescriptor_MeasureUnit_VERTEX;
+  static const MeasureUnit PIXEL = GpuCounterDescriptor_MeasureUnit_PIXEL;
+  static const MeasureUnit TRIANGLE = GpuCounterDescriptor_MeasureUnit_TRIANGLE;
+  static const MeasureUnit PRIMITIVE = GpuCounterDescriptor_MeasureUnit_PRIMITIVE;
+  static const MeasureUnit FRAGMENT = GpuCounterDescriptor_MeasureUnit_FRAGMENT;
+  static const MeasureUnit MILLIWATT = GpuCounterDescriptor_MeasureUnit_MILLIWATT;
+  static const MeasureUnit WATT = GpuCounterDescriptor_MeasureUnit_WATT;
+  static const MeasureUnit KILOWATT = GpuCounterDescriptor_MeasureUnit_KILOWATT;
+  static const MeasureUnit JOULE = GpuCounterDescriptor_MeasureUnit_JOULE;
+  static const MeasureUnit VOLT = GpuCounterDescriptor_MeasureUnit_VOLT;
+  static const MeasureUnit AMPERE = GpuCounterDescriptor_MeasureUnit_AMPERE;
+  static const MeasureUnit CELSIUS = GpuCounterDescriptor_MeasureUnit_CELSIUS;
+  static const MeasureUnit FAHRENHEIT = GpuCounterDescriptor_MeasureUnit_FAHRENHEIT;
+  static const MeasureUnit KELVIN = GpuCounterDescriptor_MeasureUnit_KELVIN;
+  static const MeasureUnit PERCENT = GpuCounterDescriptor_MeasureUnit_PERCENT;
+  static const MeasureUnit INSTRUCTION = GpuCounterDescriptor_MeasureUnit_INSTRUCTION;
+
+  using FieldMetadata_Specs =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      GpuCounterDescriptor_GpuCounterSpec,
+      GpuCounterDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Specs kSpecs() { return {}; }
+  template <typename T = GpuCounterDescriptor_GpuCounterSpec> T* add_specs() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_Blocks =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      GpuCounterDescriptor_GpuCounterBlock,
+      GpuCounterDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Blocks kBlocks() { return {}; }
+  template <typename T = GpuCounterDescriptor_GpuCounterBlock> T* add_blocks() {
+    return BeginNestedMessage<T>(2);
+  }
+
+
+  using FieldMetadata_MinSamplingPeriodNs =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      GpuCounterDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MinSamplingPeriodNs kMinSamplingPeriodNs() { return {}; }
+  void set_min_sampling_period_ns(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MinSamplingPeriodNs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MaxSamplingPeriodNs =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      GpuCounterDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MaxSamplingPeriodNs kMaxSamplingPeriodNs() { return {}; }
+  void set_max_sampling_period_ns(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MaxSamplingPeriodNs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SupportsInstrumentedSampling =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      GpuCounterDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SupportsInstrumentedSampling kSupportsInstrumentedSampling() { return {}; }
+  void set_supports_instrumented_sampling(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_SupportsInstrumentedSampling::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class GpuCounterDescriptor_GpuCounterBlock_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  GpuCounterDescriptor_GpuCounterBlock_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit GpuCounterDescriptor_GpuCounterBlock_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit GpuCounterDescriptor_GpuCounterBlock_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_block_id() const { return at<1>().valid(); }
+  uint32_t block_id() const { return at<1>().as_uint32(); }
+  bool has_block_capacity() const { return at<2>().valid(); }
+  uint32_t block_capacity() const { return at<2>().as_uint32(); }
+  bool has_name() const { return at<3>().valid(); }
+  ::protozero::ConstChars name() const { return at<3>().as_string(); }
+  bool has_description() const { return at<4>().valid(); }
+  ::protozero::ConstChars description() const { return at<4>().as_string(); }
+  bool has_counter_ids() const { return at<5>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint32_t> counter_ids() const { return GetRepeated<uint32_t>(5); }
+};
+
+class GpuCounterDescriptor_GpuCounterBlock : public ::protozero::Message {
+ public:
+  using Decoder = GpuCounterDescriptor_GpuCounterBlock_Decoder;
+  enum : int32_t {
+    kBlockIdFieldNumber = 1,
+    kBlockCapacityFieldNumber = 2,
+    kNameFieldNumber = 3,
+    kDescriptionFieldNumber = 4,
+    kCounterIdsFieldNumber = 5,
+  };
+
+  using FieldMetadata_BlockId =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      GpuCounterDescriptor_GpuCounterBlock>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BlockId kBlockId() { return {}; }
+  void set_block_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BlockId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BlockCapacity =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      GpuCounterDescriptor_GpuCounterBlock>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BlockCapacity kBlockCapacity() { return {}; }
+  void set_block_capacity(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BlockCapacity::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      GpuCounterDescriptor_GpuCounterBlock>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Description =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      GpuCounterDescriptor_GpuCounterBlock>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Description kDescription() { return {}; }
+  void set_description(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Description::kFieldId, data, size);
+  }
+  void set_description(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Description::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CounterIds =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      GpuCounterDescriptor_GpuCounterBlock>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CounterIds kCounterIds() { return {}; }
+  void add_counter_ids(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CounterIds::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class GpuCounterDescriptor_GpuCounterSpec_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/10, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  GpuCounterDescriptor_GpuCounterSpec_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit GpuCounterDescriptor_GpuCounterSpec_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit GpuCounterDescriptor_GpuCounterSpec_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_counter_id() const { return at<1>().valid(); }
+  uint32_t counter_id() const { return at<1>().as_uint32(); }
+  bool has_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars name() const { return at<2>().as_string(); }
+  bool has_description() const { return at<3>().valid(); }
+  ::protozero::ConstChars description() const { return at<3>().as_string(); }
+  bool has_int_peak_value() const { return at<5>().valid(); }
+  int64_t int_peak_value() const { return at<5>().as_int64(); }
+  bool has_double_peak_value() const { return at<6>().valid(); }
+  double double_peak_value() const { return at<6>().as_double(); }
+  bool has_numerator_units() const { return at<7>().valid(); }
+  ::protozero::RepeatedFieldIterator<int32_t> numerator_units() const { return GetRepeated<int32_t>(7); }
+  bool has_denominator_units() const { return at<8>().valid(); }
+  ::protozero::RepeatedFieldIterator<int32_t> denominator_units() const { return GetRepeated<int32_t>(8); }
+  bool has_select_by_default() const { return at<9>().valid(); }
+  bool select_by_default() const { return at<9>().as_bool(); }
+  bool has_groups() const { return at<10>().valid(); }
+  ::protozero::RepeatedFieldIterator<int32_t> groups() const { return GetRepeated<int32_t>(10); }
+};
+
+class GpuCounterDescriptor_GpuCounterSpec : public ::protozero::Message {
+ public:
+  using Decoder = GpuCounterDescriptor_GpuCounterSpec_Decoder;
+  enum : int32_t {
+    kCounterIdFieldNumber = 1,
+    kNameFieldNumber = 2,
+    kDescriptionFieldNumber = 3,
+    kIntPeakValueFieldNumber = 5,
+    kDoublePeakValueFieldNumber = 6,
+    kNumeratorUnitsFieldNumber = 7,
+    kDenominatorUnitsFieldNumber = 8,
+    kSelectByDefaultFieldNumber = 9,
+    kGroupsFieldNumber = 10,
+  };
+
+  using FieldMetadata_CounterId =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      GpuCounterDescriptor_GpuCounterSpec>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CounterId kCounterId() { return {}; }
+  void set_counter_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CounterId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      GpuCounterDescriptor_GpuCounterSpec>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Description =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      GpuCounterDescriptor_GpuCounterSpec>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Description kDescription() { return {}; }
+  void set_description(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Description::kFieldId, data, size);
+  }
+  void set_description(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Description::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IntPeakValue =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      GpuCounterDescriptor_GpuCounterSpec>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IntPeakValue kIntPeakValue() { return {}; }
+  void set_int_peak_value(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IntPeakValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DoublePeakValue =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kDouble,
+      double,
+      GpuCounterDescriptor_GpuCounterSpec>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DoublePeakValue kDoublePeakValue() { return {}; }
+  void set_double_peak_value(double value) {
+    static constexpr uint32_t field_id = FieldMetadata_DoublePeakValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kDouble>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NumeratorUnits =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::GpuCounterDescriptor_MeasureUnit,
+      GpuCounterDescriptor_GpuCounterSpec>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NumeratorUnits kNumeratorUnits() { return {}; }
+  void add_numerator_units(::perfetto::protos::pbzero::GpuCounterDescriptor_MeasureUnit value) {
+    static constexpr uint32_t field_id = FieldMetadata_NumeratorUnits::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DenominatorUnits =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::GpuCounterDescriptor_MeasureUnit,
+      GpuCounterDescriptor_GpuCounterSpec>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DenominatorUnits kDenominatorUnits() { return {}; }
+  void add_denominator_units(::perfetto::protos::pbzero::GpuCounterDescriptor_MeasureUnit value) {
+    static constexpr uint32_t field_id = FieldMetadata_DenominatorUnits::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SelectByDefault =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      GpuCounterDescriptor_GpuCounterSpec>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SelectByDefault kSelectByDefault() { return {}; }
+  void set_select_by_default(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_SelectByDefault::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Groups =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::GpuCounterDescriptor_GpuCounterGroup,
+      GpuCounterDescriptor_GpuCounterSpec>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Groups kGroups() { return {}; }
+  void add_groups(::perfetto::protos::pbzero::GpuCounterDescriptor_GpuCounterGroup value) {
+    static constexpr uint32_t field_id = FieldMetadata_Groups::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/common/interceptor_descriptor.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_INTERCEPTOR_DESCRIPTOR_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_INTERCEPTOR_DESCRIPTOR_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class InterceptorDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  InterceptorDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit InterceptorDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit InterceptorDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+};
+
+class InterceptorDescriptor : public ::protozero::Message {
+ public:
+  using Decoder = InterceptorDescriptor_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      InterceptorDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/common/observable_events.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_OBSERVABLE_EVENTS_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_OBSERVABLE_EVENTS_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class ObservableEvents_DataSourceInstanceStateChange;
+enum ObservableEvents_DataSourceInstanceState : int32_t;
+
+enum ObservableEvents_Type : int32_t {
+  ObservableEvents_Type_TYPE_UNSPECIFIED = 0,
+  ObservableEvents_Type_TYPE_DATA_SOURCES_INSTANCES = 1,
+  ObservableEvents_Type_TYPE_ALL_DATA_SOURCES_STARTED = 2,
+};
+
+const ObservableEvents_Type ObservableEvents_Type_MIN = ObservableEvents_Type_TYPE_UNSPECIFIED;
+const ObservableEvents_Type ObservableEvents_Type_MAX = ObservableEvents_Type_TYPE_ALL_DATA_SOURCES_STARTED;
+
+enum ObservableEvents_DataSourceInstanceState : int32_t {
+  ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STOPPED = 1,
+  ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STARTED = 2,
+};
+
+const ObservableEvents_DataSourceInstanceState ObservableEvents_DataSourceInstanceState_MIN = ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STOPPED;
+const ObservableEvents_DataSourceInstanceState ObservableEvents_DataSourceInstanceState_MAX = ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STARTED;
+
+class ObservableEvents_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  ObservableEvents_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ObservableEvents_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ObservableEvents_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_instance_state_changes() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> instance_state_changes() const { return GetRepeated<::protozero::ConstBytes>(1); }
+  bool has_all_data_sources_started() const { return at<2>().valid(); }
+  bool all_data_sources_started() const { return at<2>().as_bool(); }
+};
+
+class ObservableEvents : public ::protozero::Message {
+ public:
+  using Decoder = ObservableEvents_Decoder;
+  enum : int32_t {
+    kInstanceStateChangesFieldNumber = 1,
+    kAllDataSourcesStartedFieldNumber = 2,
+  };
+  using DataSourceInstanceStateChange = ::perfetto::protos::pbzero::ObservableEvents_DataSourceInstanceStateChange;
+  using Type = ::perfetto::protos::pbzero::ObservableEvents_Type;
+  using DataSourceInstanceState = ::perfetto::protos::pbzero::ObservableEvents_DataSourceInstanceState;
+  static const Type TYPE_UNSPECIFIED = ObservableEvents_Type_TYPE_UNSPECIFIED;
+  static const Type TYPE_DATA_SOURCES_INSTANCES = ObservableEvents_Type_TYPE_DATA_SOURCES_INSTANCES;
+  static const Type TYPE_ALL_DATA_SOURCES_STARTED = ObservableEvents_Type_TYPE_ALL_DATA_SOURCES_STARTED;
+  static const DataSourceInstanceState DATA_SOURCE_INSTANCE_STATE_STOPPED = ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STOPPED;
+  static const DataSourceInstanceState DATA_SOURCE_INSTANCE_STATE_STARTED = ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STARTED;
+
+  using FieldMetadata_InstanceStateChanges =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ObservableEvents_DataSourceInstanceStateChange,
+      ObservableEvents>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_InstanceStateChanges kInstanceStateChanges() { return {}; }
+  template <typename T = ObservableEvents_DataSourceInstanceStateChange> T* add_instance_state_changes() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_AllDataSourcesStarted =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ObservableEvents>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AllDataSourcesStarted kAllDataSourcesStarted() { return {}; }
+  void set_all_data_sources_started(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_AllDataSourcesStarted::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class ObservableEvents_DataSourceInstanceStateChange_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ObservableEvents_DataSourceInstanceStateChange_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ObservableEvents_DataSourceInstanceStateChange_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ObservableEvents_DataSourceInstanceStateChange_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_producer_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars producer_name() const { return at<1>().as_string(); }
+  bool has_data_source_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars data_source_name() const { return at<2>().as_string(); }
+  bool has_state() const { return at<3>().valid(); }
+  int32_t state() const { return at<3>().as_int32(); }
+};
+
+class ObservableEvents_DataSourceInstanceStateChange : public ::protozero::Message {
+ public:
+  using Decoder = ObservableEvents_DataSourceInstanceStateChange_Decoder;
+  enum : int32_t {
+    kProducerNameFieldNumber = 1,
+    kDataSourceNameFieldNumber = 2,
+    kStateFieldNumber = 3,
+  };
+
+  using FieldMetadata_ProducerName =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ObservableEvents_DataSourceInstanceStateChange>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProducerName kProducerName() { return {}; }
+  void set_producer_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ProducerName::kFieldId, data, size);
+  }
+  void set_producer_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProducerName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DataSourceName =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ObservableEvents_DataSourceInstanceStateChange>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DataSourceName kDataSourceName() { return {}; }
+  void set_data_source_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_DataSourceName::kFieldId, data, size);
+  }
+  void set_data_source_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_DataSourceName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_State =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ObservableEvents_DataSourceInstanceState,
+      ObservableEvents_DataSourceInstanceStateChange>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_State kState() { return {}; }
+  void set_state(::perfetto::protos::pbzero::ObservableEvents_DataSourceInstanceState value) {
+    static constexpr uint32_t field_id = FieldMetadata_State::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/common/perf_events.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_PERF_EVENTS_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_PERF_EVENTS_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class PerfEvents_Timebase;
+class PerfEvents_Tracepoint;
+enum PerfEvents_Counter : int32_t;
+
+enum PerfEvents_Counter : int32_t {
+  PerfEvents_Counter_UNKNOWN_COUNTER = 0,
+  PerfEvents_Counter_SW_CPU_CLOCK = 1,
+  PerfEvents_Counter_SW_PAGE_FAULTS = 2,
+  PerfEvents_Counter_HW_CPU_CYCLES = 10,
+  PerfEvents_Counter_HW_INSTRUCTIONS = 11,
+};
+
+const PerfEvents_Counter PerfEvents_Counter_MIN = PerfEvents_Counter_UNKNOWN_COUNTER;
+const PerfEvents_Counter PerfEvents_Counter_MAX = PerfEvents_Counter_HW_INSTRUCTIONS;
+
+class PerfEvents_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/0, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  PerfEvents_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit PerfEvents_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit PerfEvents_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+};
+
+class PerfEvents : public ::protozero::Message {
+ public:
+  using Decoder = PerfEvents_Decoder;
+  using Timebase = ::perfetto::protos::pbzero::PerfEvents_Timebase;
+  using Tracepoint = ::perfetto::protos::pbzero::PerfEvents_Tracepoint;
+  using Counter = ::perfetto::protos::pbzero::PerfEvents_Counter;
+  static const Counter UNKNOWN_COUNTER = PerfEvents_Counter_UNKNOWN_COUNTER;
+  static const Counter SW_CPU_CLOCK = PerfEvents_Counter_SW_CPU_CLOCK;
+  static const Counter SW_PAGE_FAULTS = PerfEvents_Counter_SW_PAGE_FAULTS;
+  static const Counter HW_CPU_CYCLES = PerfEvents_Counter_HW_CPU_CYCLES;
+  static const Counter HW_INSTRUCTIONS = PerfEvents_Counter_HW_INSTRUCTIONS;
+};
+
+class PerfEvents_Tracepoint_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  PerfEvents_Tracepoint_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit PerfEvents_Tracepoint_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit PerfEvents_Tracepoint_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_filter() const { return at<2>().valid(); }
+  ::protozero::ConstChars filter() const { return at<2>().as_string(); }
+};
+
+class PerfEvents_Tracepoint : public ::protozero::Message {
+ public:
+  using Decoder = PerfEvents_Tracepoint_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kFilterFieldNumber = 2,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      PerfEvents_Tracepoint>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Filter =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      PerfEvents_Tracepoint>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Filter kFilter() { return {}; }
+  void set_filter(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Filter::kFieldId, data, size);
+  }
+  void set_filter(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Filter::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class PerfEvents_Timebase_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  PerfEvents_Timebase_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit PerfEvents_Timebase_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit PerfEvents_Timebase_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_frequency() const { return at<2>().valid(); }
+  uint64_t frequency() const { return at<2>().as_uint64(); }
+  bool has_period() const { return at<1>().valid(); }
+  uint64_t period() const { return at<1>().as_uint64(); }
+  bool has_counter() const { return at<4>().valid(); }
+  int32_t counter() const { return at<4>().as_int32(); }
+  bool has_tracepoint() const { return at<3>().valid(); }
+  ::protozero::ConstBytes tracepoint() const { return at<3>().as_bytes(); }
+};
+
+class PerfEvents_Timebase : public ::protozero::Message {
+ public:
+  using Decoder = PerfEvents_Timebase_Decoder;
+  enum : int32_t {
+    kFrequencyFieldNumber = 2,
+    kPeriodFieldNumber = 1,
+    kCounterFieldNumber = 4,
+    kTracepointFieldNumber = 3,
+  };
+
+  using FieldMetadata_Frequency =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      PerfEvents_Timebase>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Frequency kFrequency() { return {}; }
+  void set_frequency(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Frequency::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Period =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      PerfEvents_Timebase>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Period kPeriod() { return {}; }
+  void set_period(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Period::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Counter =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::PerfEvents_Counter,
+      PerfEvents_Timebase>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Counter kCounter() { return {}; }
+  void set_counter(::perfetto::protos::pbzero::PerfEvents_Counter value) {
+    static constexpr uint32_t field_id = FieldMetadata_Counter::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Tracepoint =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      PerfEvents_Tracepoint,
+      PerfEvents_Timebase>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Tracepoint kTracepoint() { return {}; }
+  template <typename T = PerfEvents_Tracepoint> T* set_tracepoint() {
+    return BeginNestedMessage<T>(3);
+  }
+
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/common/sys_stats_counters.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_SYS_STATS_COUNTERS_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_SYS_STATS_COUNTERS_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+enum MeminfoCounters : int32_t {
+  MEMINFO_UNSPECIFIED = 0,
+  MEMINFO_MEM_TOTAL = 1,
+  MEMINFO_MEM_FREE = 2,
+  MEMINFO_MEM_AVAILABLE = 3,
+  MEMINFO_BUFFERS = 4,
+  MEMINFO_CACHED = 5,
+  MEMINFO_SWAP_CACHED = 6,
+  MEMINFO_ACTIVE = 7,
+  MEMINFO_INACTIVE = 8,
+  MEMINFO_ACTIVE_ANON = 9,
+  MEMINFO_INACTIVE_ANON = 10,
+  MEMINFO_ACTIVE_FILE = 11,
+  MEMINFO_INACTIVE_FILE = 12,
+  MEMINFO_UNEVICTABLE = 13,
+  MEMINFO_MLOCKED = 14,
+  MEMINFO_SWAP_TOTAL = 15,
+  MEMINFO_SWAP_FREE = 16,
+  MEMINFO_DIRTY = 17,
+  MEMINFO_WRITEBACK = 18,
+  MEMINFO_ANON_PAGES = 19,
+  MEMINFO_MAPPED = 20,
+  MEMINFO_SHMEM = 21,
+  MEMINFO_SLAB = 22,
+  MEMINFO_SLAB_RECLAIMABLE = 23,
+  MEMINFO_SLAB_UNRECLAIMABLE = 24,
+  MEMINFO_KERNEL_STACK = 25,
+  MEMINFO_PAGE_TABLES = 26,
+  MEMINFO_COMMIT_LIMIT = 27,
+  MEMINFO_COMMITED_AS = 28,
+  MEMINFO_VMALLOC_TOTAL = 29,
+  MEMINFO_VMALLOC_USED = 30,
+  MEMINFO_VMALLOC_CHUNK = 31,
+  MEMINFO_CMA_TOTAL = 32,
+  MEMINFO_CMA_FREE = 33,
+};
+
+const MeminfoCounters MeminfoCounters_MIN = MEMINFO_UNSPECIFIED;
+const MeminfoCounters MeminfoCounters_MAX = MEMINFO_CMA_FREE;
+
+enum VmstatCounters : int32_t {
+  VMSTAT_UNSPECIFIED = 0,
+  VMSTAT_NR_FREE_PAGES = 1,
+  VMSTAT_NR_ALLOC_BATCH = 2,
+  VMSTAT_NR_INACTIVE_ANON = 3,
+  VMSTAT_NR_ACTIVE_ANON = 4,
+  VMSTAT_NR_INACTIVE_FILE = 5,
+  VMSTAT_NR_ACTIVE_FILE = 6,
+  VMSTAT_NR_UNEVICTABLE = 7,
+  VMSTAT_NR_MLOCK = 8,
+  VMSTAT_NR_ANON_PAGES = 9,
+  VMSTAT_NR_MAPPED = 10,
+  VMSTAT_NR_FILE_PAGES = 11,
+  VMSTAT_NR_DIRTY = 12,
+  VMSTAT_NR_WRITEBACK = 13,
+  VMSTAT_NR_SLAB_RECLAIMABLE = 14,
+  VMSTAT_NR_SLAB_UNRECLAIMABLE = 15,
+  VMSTAT_NR_PAGE_TABLE_PAGES = 16,
+  VMSTAT_NR_KERNEL_STACK = 17,
+  VMSTAT_NR_OVERHEAD = 18,
+  VMSTAT_NR_UNSTABLE = 19,
+  VMSTAT_NR_BOUNCE = 20,
+  VMSTAT_NR_VMSCAN_WRITE = 21,
+  VMSTAT_NR_VMSCAN_IMMEDIATE_RECLAIM = 22,
+  VMSTAT_NR_WRITEBACK_TEMP = 23,
+  VMSTAT_NR_ISOLATED_ANON = 24,
+  VMSTAT_NR_ISOLATED_FILE = 25,
+  VMSTAT_NR_SHMEM = 26,
+  VMSTAT_NR_DIRTIED = 27,
+  VMSTAT_NR_WRITTEN = 28,
+  VMSTAT_NR_PAGES_SCANNED = 29,
+  VMSTAT_WORKINGSET_REFAULT = 30,
+  VMSTAT_WORKINGSET_ACTIVATE = 31,
+  VMSTAT_WORKINGSET_NODERECLAIM = 32,
+  VMSTAT_NR_ANON_TRANSPARENT_HUGEPAGES = 33,
+  VMSTAT_NR_FREE_CMA = 34,
+  VMSTAT_NR_SWAPCACHE = 35,
+  VMSTAT_NR_DIRTY_THRESHOLD = 36,
+  VMSTAT_NR_DIRTY_BACKGROUND_THRESHOLD = 37,
+  VMSTAT_PGPGIN = 38,
+  VMSTAT_PGPGOUT = 39,
+  VMSTAT_PGPGOUTCLEAN = 40,
+  VMSTAT_PSWPIN = 41,
+  VMSTAT_PSWPOUT = 42,
+  VMSTAT_PGALLOC_DMA = 43,
+  VMSTAT_PGALLOC_NORMAL = 44,
+  VMSTAT_PGALLOC_MOVABLE = 45,
+  VMSTAT_PGFREE = 46,
+  VMSTAT_PGACTIVATE = 47,
+  VMSTAT_PGDEACTIVATE = 48,
+  VMSTAT_PGFAULT = 49,
+  VMSTAT_PGMAJFAULT = 50,
+  VMSTAT_PGREFILL_DMA = 51,
+  VMSTAT_PGREFILL_NORMAL = 52,
+  VMSTAT_PGREFILL_MOVABLE = 53,
+  VMSTAT_PGSTEAL_KSWAPD_DMA = 54,
+  VMSTAT_PGSTEAL_KSWAPD_NORMAL = 55,
+  VMSTAT_PGSTEAL_KSWAPD_MOVABLE = 56,
+  VMSTAT_PGSTEAL_DIRECT_DMA = 57,
+  VMSTAT_PGSTEAL_DIRECT_NORMAL = 58,
+  VMSTAT_PGSTEAL_DIRECT_MOVABLE = 59,
+  VMSTAT_PGSCAN_KSWAPD_DMA = 60,
+  VMSTAT_PGSCAN_KSWAPD_NORMAL = 61,
+  VMSTAT_PGSCAN_KSWAPD_MOVABLE = 62,
+  VMSTAT_PGSCAN_DIRECT_DMA = 63,
+  VMSTAT_PGSCAN_DIRECT_NORMAL = 64,
+  VMSTAT_PGSCAN_DIRECT_MOVABLE = 65,
+  VMSTAT_PGSCAN_DIRECT_THROTTLE = 66,
+  VMSTAT_PGINODESTEAL = 67,
+  VMSTAT_SLABS_SCANNED = 68,
+  VMSTAT_KSWAPD_INODESTEAL = 69,
+  VMSTAT_KSWAPD_LOW_WMARK_HIT_QUICKLY = 70,
+  VMSTAT_KSWAPD_HIGH_WMARK_HIT_QUICKLY = 71,
+  VMSTAT_PAGEOUTRUN = 72,
+  VMSTAT_ALLOCSTALL = 73,
+  VMSTAT_PGROTATED = 74,
+  VMSTAT_DROP_PAGECACHE = 75,
+  VMSTAT_DROP_SLAB = 76,
+  VMSTAT_PGMIGRATE_SUCCESS = 77,
+  VMSTAT_PGMIGRATE_FAIL = 78,
+  VMSTAT_COMPACT_MIGRATE_SCANNED = 79,
+  VMSTAT_COMPACT_FREE_SCANNED = 80,
+  VMSTAT_COMPACT_ISOLATED = 81,
+  VMSTAT_COMPACT_STALL = 82,
+  VMSTAT_COMPACT_FAIL = 83,
+  VMSTAT_COMPACT_SUCCESS = 84,
+  VMSTAT_COMPACT_DAEMON_WAKE = 85,
+  VMSTAT_UNEVICTABLE_PGS_CULLED = 86,
+  VMSTAT_UNEVICTABLE_PGS_SCANNED = 87,
+  VMSTAT_UNEVICTABLE_PGS_RESCUED = 88,
+  VMSTAT_UNEVICTABLE_PGS_MLOCKED = 89,
+  VMSTAT_UNEVICTABLE_PGS_MUNLOCKED = 90,
+  VMSTAT_UNEVICTABLE_PGS_CLEARED = 91,
+  VMSTAT_UNEVICTABLE_PGS_STRANDED = 92,
+  VMSTAT_NR_ZSPAGES = 93,
+  VMSTAT_NR_ION_HEAP = 94,
+  VMSTAT_NR_GPU_HEAP = 95,
+  VMSTAT_ALLOCSTALL_DMA = 96,
+  VMSTAT_ALLOCSTALL_MOVABLE = 97,
+  VMSTAT_ALLOCSTALL_NORMAL = 98,
+  VMSTAT_COMPACT_DAEMON_FREE_SCANNED = 99,
+  VMSTAT_COMPACT_DAEMON_MIGRATE_SCANNED = 100,
+  VMSTAT_NR_FASTRPC = 101,
+  VMSTAT_NR_INDIRECTLY_RECLAIMABLE = 102,
+  VMSTAT_NR_ION_HEAP_POOL = 103,
+  VMSTAT_NR_KERNEL_MISC_RECLAIMABLE = 104,
+  VMSTAT_NR_SHADOW_CALL_STACK_BYTES = 105,
+  VMSTAT_NR_SHMEM_HUGEPAGES = 106,
+  VMSTAT_NR_SHMEM_PMDMAPPED = 107,
+  VMSTAT_NR_UNRECLAIMABLE_PAGES = 108,
+  VMSTAT_NR_ZONE_ACTIVE_ANON = 109,
+  VMSTAT_NR_ZONE_ACTIVE_FILE = 110,
+  VMSTAT_NR_ZONE_INACTIVE_ANON = 111,
+  VMSTAT_NR_ZONE_INACTIVE_FILE = 112,
+  VMSTAT_NR_ZONE_UNEVICTABLE = 113,
+  VMSTAT_NR_ZONE_WRITE_PENDING = 114,
+  VMSTAT_OOM_KILL = 115,
+  VMSTAT_PGLAZYFREE = 116,
+  VMSTAT_PGLAZYFREED = 117,
+  VMSTAT_PGREFILL = 118,
+  VMSTAT_PGSCAN_DIRECT = 119,
+  VMSTAT_PGSCAN_KSWAPD = 120,
+  VMSTAT_PGSKIP_DMA = 121,
+  VMSTAT_PGSKIP_MOVABLE = 122,
+  VMSTAT_PGSKIP_NORMAL = 123,
+  VMSTAT_PGSTEAL_DIRECT = 124,
+  VMSTAT_PGSTEAL_KSWAPD = 125,
+  VMSTAT_SWAP_RA = 126,
+  VMSTAT_SWAP_RA_HIT = 127,
+  VMSTAT_WORKINGSET_RESTORE = 128,
+};
+
+const VmstatCounters VmstatCounters_MIN = VMSTAT_UNSPECIFIED;
+const VmstatCounters VmstatCounters_MAX = VMSTAT_WORKINGSET_RESTORE;
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/common/trace_stats.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACE_STATS_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACE_STATS_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class TraceStats_BufferStats;
+class TraceStats_FilterStats;
+
+class TraceStats_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/11, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  TraceStats_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceStats_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceStats_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_buffer_stats() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> buffer_stats() const { return GetRepeated<::protozero::ConstBytes>(1); }
+  bool has_producers_connected() const { return at<2>().valid(); }
+  uint32_t producers_connected() const { return at<2>().as_uint32(); }
+  bool has_producers_seen() const { return at<3>().valid(); }
+  uint64_t producers_seen() const { return at<3>().as_uint64(); }
+  bool has_data_sources_registered() const { return at<4>().valid(); }
+  uint32_t data_sources_registered() const { return at<4>().as_uint32(); }
+  bool has_data_sources_seen() const { return at<5>().valid(); }
+  uint64_t data_sources_seen() const { return at<5>().as_uint64(); }
+  bool has_tracing_sessions() const { return at<6>().valid(); }
+  uint32_t tracing_sessions() const { return at<6>().as_uint32(); }
+  bool has_total_buffers() const { return at<7>().valid(); }
+  uint32_t total_buffers() const { return at<7>().as_uint32(); }
+  bool has_chunks_discarded() const { return at<8>().valid(); }
+  uint64_t chunks_discarded() const { return at<8>().as_uint64(); }
+  bool has_patches_discarded() const { return at<9>().valid(); }
+  uint64_t patches_discarded() const { return at<9>().as_uint64(); }
+  bool has_invalid_packets() const { return at<10>().valid(); }
+  uint64_t invalid_packets() const { return at<10>().as_uint64(); }
+  bool has_filter_stats() const { return at<11>().valid(); }
+  ::protozero::ConstBytes filter_stats() const { return at<11>().as_bytes(); }
+};
+
+class TraceStats : public ::protozero::Message {
+ public:
+  using Decoder = TraceStats_Decoder;
+  enum : int32_t {
+    kBufferStatsFieldNumber = 1,
+    kProducersConnectedFieldNumber = 2,
+    kProducersSeenFieldNumber = 3,
+    kDataSourcesRegisteredFieldNumber = 4,
+    kDataSourcesSeenFieldNumber = 5,
+    kTracingSessionsFieldNumber = 6,
+    kTotalBuffersFieldNumber = 7,
+    kChunksDiscardedFieldNumber = 8,
+    kPatchesDiscardedFieldNumber = 9,
+    kInvalidPacketsFieldNumber = 10,
+    kFilterStatsFieldNumber = 11,
+  };
+  using BufferStats = ::perfetto::protos::pbzero::TraceStats_BufferStats;
+  using FilterStats = ::perfetto::protos::pbzero::TraceStats_FilterStats;
+
+  using FieldMetadata_BufferStats =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceStats_BufferStats,
+      TraceStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BufferStats kBufferStats() { return {}; }
+  template <typename T = TraceStats_BufferStats> T* add_buffer_stats() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_ProducersConnected =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProducersConnected kProducersConnected() { return {}; }
+  void set_producers_connected(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProducersConnected::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ProducersSeen =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProducersSeen kProducersSeen() { return {}; }
+  void set_producers_seen(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProducersSeen::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DataSourcesRegistered =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DataSourcesRegistered kDataSourcesRegistered() { return {}; }
+  void set_data_sources_registered(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DataSourcesRegistered::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DataSourcesSeen =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DataSourcesSeen kDataSourcesSeen() { return {}; }
+  void set_data_sources_seen(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DataSourcesSeen::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TracingSessions =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TracingSessions kTracingSessions() { return {}; }
+  void set_tracing_sessions(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TracingSessions::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TotalBuffers =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TotalBuffers kTotalBuffers() { return {}; }
+  void set_total_buffers(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TotalBuffers::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ChunksDiscarded =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChunksDiscarded kChunksDiscarded() { return {}; }
+  void set_chunks_discarded(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ChunksDiscarded::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PatchesDiscarded =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PatchesDiscarded kPatchesDiscarded() { return {}; }
+  void set_patches_discarded(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PatchesDiscarded::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_InvalidPackets =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_InvalidPackets kInvalidPackets() { return {}; }
+  void set_invalid_packets(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_InvalidPackets::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FilterStats =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceStats_FilterStats,
+      TraceStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FilterStats kFilterStats() { return {}; }
+  template <typename T = TraceStats_FilterStats> T* set_filter_stats() {
+    return BeginNestedMessage<T>(11);
+  }
+
+};
+
+class TraceStats_FilterStats_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TraceStats_FilterStats_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceStats_FilterStats_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceStats_FilterStats_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_input_packets() const { return at<1>().valid(); }
+  uint64_t input_packets() const { return at<1>().as_uint64(); }
+  bool has_input_bytes() const { return at<2>().valid(); }
+  uint64_t input_bytes() const { return at<2>().as_uint64(); }
+  bool has_output_bytes() const { return at<3>().valid(); }
+  uint64_t output_bytes() const { return at<3>().as_uint64(); }
+  bool has_errors() const { return at<4>().valid(); }
+  uint64_t errors() const { return at<4>().as_uint64(); }
+};
+
+class TraceStats_FilterStats : public ::protozero::Message {
+ public:
+  using Decoder = TraceStats_FilterStats_Decoder;
+  enum : int32_t {
+    kInputPacketsFieldNumber = 1,
+    kInputBytesFieldNumber = 2,
+    kOutputBytesFieldNumber = 3,
+    kErrorsFieldNumber = 4,
+  };
+
+  using FieldMetadata_InputPackets =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_FilterStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_InputPackets kInputPackets() { return {}; }
+  void set_input_packets(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_InputPackets::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_InputBytes =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_FilterStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_InputBytes kInputBytes() { return {}; }
+  void set_input_bytes(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_InputBytes::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OutputBytes =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_FilterStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OutputBytes kOutputBytes() { return {}; }
+  void set_output_bytes(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OutputBytes::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Errors =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_FilterStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Errors kErrors() { return {}; }
+  void set_errors(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Errors::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TraceStats_BufferStats_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/19, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TraceStats_BufferStats_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceStats_BufferStats_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceStats_BufferStats_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_buffer_size() const { return at<12>().valid(); }
+  uint64_t buffer_size() const { return at<12>().as_uint64(); }
+  bool has_bytes_written() const { return at<1>().valid(); }
+  uint64_t bytes_written() const { return at<1>().as_uint64(); }
+  bool has_bytes_overwritten() const { return at<13>().valid(); }
+  uint64_t bytes_overwritten() const { return at<13>().as_uint64(); }
+  bool has_bytes_read() const { return at<14>().valid(); }
+  uint64_t bytes_read() const { return at<14>().as_uint64(); }
+  bool has_padding_bytes_written() const { return at<15>().valid(); }
+  uint64_t padding_bytes_written() const { return at<15>().as_uint64(); }
+  bool has_padding_bytes_cleared() const { return at<16>().valid(); }
+  uint64_t padding_bytes_cleared() const { return at<16>().as_uint64(); }
+  bool has_chunks_written() const { return at<2>().valid(); }
+  uint64_t chunks_written() const { return at<2>().as_uint64(); }
+  bool has_chunks_rewritten() const { return at<10>().valid(); }
+  uint64_t chunks_rewritten() const { return at<10>().as_uint64(); }
+  bool has_chunks_overwritten() const { return at<3>().valid(); }
+  uint64_t chunks_overwritten() const { return at<3>().as_uint64(); }
+  bool has_chunks_discarded() const { return at<18>().valid(); }
+  uint64_t chunks_discarded() const { return at<18>().as_uint64(); }
+  bool has_chunks_read() const { return at<17>().valid(); }
+  uint64_t chunks_read() const { return at<17>().as_uint64(); }
+  bool has_chunks_committed_out_of_order() const { return at<11>().valid(); }
+  uint64_t chunks_committed_out_of_order() const { return at<11>().as_uint64(); }
+  bool has_write_wrap_count() const { return at<4>().valid(); }
+  uint64_t write_wrap_count() const { return at<4>().as_uint64(); }
+  bool has_patches_succeeded() const { return at<5>().valid(); }
+  uint64_t patches_succeeded() const { return at<5>().as_uint64(); }
+  bool has_patches_failed() const { return at<6>().valid(); }
+  uint64_t patches_failed() const { return at<6>().as_uint64(); }
+  bool has_readaheads_succeeded() const { return at<7>().valid(); }
+  uint64_t readaheads_succeeded() const { return at<7>().as_uint64(); }
+  bool has_readaheads_failed() const { return at<8>().valid(); }
+  uint64_t readaheads_failed() const { return at<8>().as_uint64(); }
+  bool has_abi_violations() const { return at<9>().valid(); }
+  uint64_t abi_violations() const { return at<9>().as_uint64(); }
+  bool has_trace_writer_packet_loss() const { return at<19>().valid(); }
+  uint64_t trace_writer_packet_loss() const { return at<19>().as_uint64(); }
+};
+
+class TraceStats_BufferStats : public ::protozero::Message {
+ public:
+  using Decoder = TraceStats_BufferStats_Decoder;
+  enum : int32_t {
+    kBufferSizeFieldNumber = 12,
+    kBytesWrittenFieldNumber = 1,
+    kBytesOverwrittenFieldNumber = 13,
+    kBytesReadFieldNumber = 14,
+    kPaddingBytesWrittenFieldNumber = 15,
+    kPaddingBytesClearedFieldNumber = 16,
+    kChunksWrittenFieldNumber = 2,
+    kChunksRewrittenFieldNumber = 10,
+    kChunksOverwrittenFieldNumber = 3,
+    kChunksDiscardedFieldNumber = 18,
+    kChunksReadFieldNumber = 17,
+    kChunksCommittedOutOfOrderFieldNumber = 11,
+    kWriteWrapCountFieldNumber = 4,
+    kPatchesSucceededFieldNumber = 5,
+    kPatchesFailedFieldNumber = 6,
+    kReadaheadsSucceededFieldNumber = 7,
+    kReadaheadsFailedFieldNumber = 8,
+    kAbiViolationsFieldNumber = 9,
+    kTraceWriterPacketLossFieldNumber = 19,
+  };
+
+  using FieldMetadata_BufferSize =
+    ::protozero::proto_utils::FieldMetadata<
+      12,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BufferSize kBufferSize() { return {}; }
+  void set_buffer_size(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BufferSize::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BytesWritten =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BytesWritten kBytesWritten() { return {}; }
+  void set_bytes_written(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BytesWritten::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BytesOverwritten =
+    ::protozero::proto_utils::FieldMetadata<
+      13,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BytesOverwritten kBytesOverwritten() { return {}; }
+  void set_bytes_overwritten(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BytesOverwritten::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BytesRead =
+    ::protozero::proto_utils::FieldMetadata<
+      14,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BytesRead kBytesRead() { return {}; }
+  void set_bytes_read(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BytesRead::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PaddingBytesWritten =
+    ::protozero::proto_utils::FieldMetadata<
+      15,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PaddingBytesWritten kPaddingBytesWritten() { return {}; }
+  void set_padding_bytes_written(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PaddingBytesWritten::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PaddingBytesCleared =
+    ::protozero::proto_utils::FieldMetadata<
+      16,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PaddingBytesCleared kPaddingBytesCleared() { return {}; }
+  void set_padding_bytes_cleared(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PaddingBytesCleared::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ChunksWritten =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChunksWritten kChunksWritten() { return {}; }
+  void set_chunks_written(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ChunksWritten::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ChunksRewritten =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChunksRewritten kChunksRewritten() { return {}; }
+  void set_chunks_rewritten(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ChunksRewritten::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ChunksOverwritten =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChunksOverwritten kChunksOverwritten() { return {}; }
+  void set_chunks_overwritten(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ChunksOverwritten::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ChunksDiscarded =
+    ::protozero::proto_utils::FieldMetadata<
+      18,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChunksDiscarded kChunksDiscarded() { return {}; }
+  void set_chunks_discarded(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ChunksDiscarded::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ChunksRead =
+    ::protozero::proto_utils::FieldMetadata<
+      17,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChunksRead kChunksRead() { return {}; }
+  void set_chunks_read(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ChunksRead::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ChunksCommittedOutOfOrder =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChunksCommittedOutOfOrder kChunksCommittedOutOfOrder() { return {}; }
+  void set_chunks_committed_out_of_order(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ChunksCommittedOutOfOrder::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_WriteWrapCount =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_WriteWrapCount kWriteWrapCount() { return {}; }
+  void set_write_wrap_count(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_WriteWrapCount::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PatchesSucceeded =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PatchesSucceeded kPatchesSucceeded() { return {}; }
+  void set_patches_succeeded(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PatchesSucceeded::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PatchesFailed =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PatchesFailed kPatchesFailed() { return {}; }
+  void set_patches_failed(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PatchesFailed::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ReadaheadsSucceeded =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ReadaheadsSucceeded kReadaheadsSucceeded() { return {}; }
+  void set_readaheads_succeeded(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ReadaheadsSucceeded::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ReadaheadsFailed =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ReadaheadsFailed kReadaheadsFailed() { return {}; }
+  void set_readaheads_failed(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ReadaheadsFailed::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_AbiViolations =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AbiViolations kAbiViolations() { return {}; }
+  void set_abi_violations(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_AbiViolations::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TraceWriterPacketLoss =
+    ::protozero::proto_utils::FieldMetadata<
+      19,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceStats_BufferStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TraceWriterPacketLoss kTraceWriterPacketLoss() { return {}; }
+  void set_trace_writer_packet_loss(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TraceWriterPacketLoss::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/common/tracing_service_capabilities.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACING_SERVICE_CAPABILITIES_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACING_SERVICE_CAPABILITIES_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+enum ObservableEvents_Type : int32_t;
+
+class TracingServiceCapabilities_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  TracingServiceCapabilities_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TracingServiceCapabilities_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TracingServiceCapabilities_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_has_query_capabilities() const { return at<1>().valid(); }
+  bool has_query_capabilities() const { return at<1>().as_bool(); }
+  bool has_observable_events() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<int32_t> observable_events() const { return GetRepeated<int32_t>(2); }
+  bool has_has_trace_config_output_path() const { return at<3>().valid(); }
+  bool has_trace_config_output_path() const { return at<3>().as_bool(); }
+};
+
+class TracingServiceCapabilities : public ::protozero::Message {
+ public:
+  using Decoder = TracingServiceCapabilities_Decoder;
+  enum : int32_t {
+    kHasQueryCapabilitiesFieldNumber = 1,
+    kObservableEventsFieldNumber = 2,
+    kHasTraceConfigOutputPathFieldNumber = 3,
+  };
+
+  using FieldMetadata_HasQueryCapabilities =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TracingServiceCapabilities>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HasQueryCapabilities kHasQueryCapabilities() { return {}; }
+  void set_has_query_capabilities(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_HasQueryCapabilities::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ObservableEvents =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ObservableEvents_Type,
+      TracingServiceCapabilities>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ObservableEvents kObservableEvents() { return {}; }
+  void add_observable_events(::perfetto::protos::pbzero::ObservableEvents_Type value) {
+    static constexpr uint32_t field_id = FieldMetadata_ObservableEvents::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HasTraceConfigOutputPath =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TracingServiceCapabilities>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HasTraceConfigOutputPath kHasTraceConfigOutputPath() { return {}; }
+  void set_has_trace_config_output_path(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_HasTraceConfigOutputPath::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/common/tracing_service_state.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACING_SERVICE_STATE_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACING_SERVICE_STATE_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class DataSourceDescriptor;
+class TracingServiceState_DataSource;
+class TracingServiceState_Producer;
+
+class TracingServiceState_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  TracingServiceState_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TracingServiceState_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TracingServiceState_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_producers() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> producers() const { return GetRepeated<::protozero::ConstBytes>(1); }
+  bool has_data_sources() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> data_sources() const { return GetRepeated<::protozero::ConstBytes>(2); }
+  bool has_num_sessions() const { return at<3>().valid(); }
+  int32_t num_sessions() const { return at<3>().as_int32(); }
+  bool has_num_sessions_started() const { return at<4>().valid(); }
+  int32_t num_sessions_started() const { return at<4>().as_int32(); }
+  bool has_tracing_service_version() const { return at<5>().valid(); }
+  ::protozero::ConstChars tracing_service_version() const { return at<5>().as_string(); }
+};
+
+class TracingServiceState : public ::protozero::Message {
+ public:
+  using Decoder = TracingServiceState_Decoder;
+  enum : int32_t {
+    kProducersFieldNumber = 1,
+    kDataSourcesFieldNumber = 2,
+    kNumSessionsFieldNumber = 3,
+    kNumSessionsStartedFieldNumber = 4,
+    kTracingServiceVersionFieldNumber = 5,
+  };
+  using Producer = ::perfetto::protos::pbzero::TracingServiceState_Producer;
+  using DataSource = ::perfetto::protos::pbzero::TracingServiceState_DataSource;
+
+  using FieldMetadata_Producers =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TracingServiceState_Producer,
+      TracingServiceState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Producers kProducers() { return {}; }
+  template <typename T = TracingServiceState_Producer> T* add_producers() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_DataSources =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TracingServiceState_DataSource,
+      TracingServiceState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DataSources kDataSources() { return {}; }
+  template <typename T = TracingServiceState_DataSource> T* add_data_sources() {
+    return BeginNestedMessage<T>(2);
+  }
+
+
+  using FieldMetadata_NumSessions =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      TracingServiceState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NumSessions kNumSessions() { return {}; }
+  void set_num_sessions(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NumSessions::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NumSessionsStarted =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      TracingServiceState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NumSessionsStarted kNumSessionsStarted() { return {}; }
+  void set_num_sessions_started(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NumSessionsStarted::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TracingServiceVersion =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TracingServiceState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TracingServiceVersion kTracingServiceVersion() { return {}; }
+  void set_tracing_service_version(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_TracingServiceVersion::kFieldId, data, size);
+  }
+  void set_tracing_service_version(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_TracingServiceVersion::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TracingServiceState_DataSource_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TracingServiceState_DataSource_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TracingServiceState_DataSource_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TracingServiceState_DataSource_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_ds_descriptor() const { return at<1>().valid(); }
+  ::protozero::ConstBytes ds_descriptor() const { return at<1>().as_bytes(); }
+  bool has_producer_id() const { return at<2>().valid(); }
+  int32_t producer_id() const { return at<2>().as_int32(); }
+};
+
+class TracingServiceState_DataSource : public ::protozero::Message {
+ public:
+  using Decoder = TracingServiceState_DataSource_Decoder;
+  enum : int32_t {
+    kDsDescriptorFieldNumber = 1,
+    kProducerIdFieldNumber = 2,
+  };
+
+  using FieldMetadata_DsDescriptor =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      DataSourceDescriptor,
+      TracingServiceState_DataSource>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DsDescriptor kDsDescriptor() { return {}; }
+  template <typename T = DataSourceDescriptor> T* set_ds_descriptor() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_ProducerId =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      TracingServiceState_DataSource>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProducerId kProducerId() { return {}; }
+  void set_producer_id(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProducerId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TracingServiceState_Producer_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TracingServiceState_Producer_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TracingServiceState_Producer_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TracingServiceState_Producer_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_id() const { return at<1>().valid(); }
+  int32_t id() const { return at<1>().as_int32(); }
+  bool has_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars name() const { return at<2>().as_string(); }
+  bool has_uid() const { return at<3>().valid(); }
+  int32_t uid() const { return at<3>().as_int32(); }
+  bool has_sdk_version() const { return at<4>().valid(); }
+  ::protozero::ConstChars sdk_version() const { return at<4>().as_string(); }
+};
+
+class TracingServiceState_Producer : public ::protozero::Message {
+ public:
+  using Decoder = TracingServiceState_Producer_Decoder;
+  enum : int32_t {
+    kIdFieldNumber = 1,
+    kNameFieldNumber = 2,
+    kUidFieldNumber = 3,
+    kSdkVersionFieldNumber = 4,
+  };
+
+  using FieldMetadata_Id =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      TracingServiceState_Producer>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Id kId() { return {}; }
+  void set_id(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Id::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TracingServiceState_Producer>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Uid =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      TracingServiceState_Producer>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Uid kUid() { return {}; }
+  void set_uid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Uid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SdkVersion =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TracingServiceState_Producer>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SdkVersion kSdkVersion() { return {}; }
+  void set_sdk_version(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_SdkVersion::kFieldId, data, size);
+  }
+  void set_sdk_version(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_SdkVersion::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/common/track_event_descriptor.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACK_EVENT_DESCRIPTOR_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACK_EVENT_DESCRIPTOR_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class TrackEventCategory;
+
+class TrackEventDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  TrackEventDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TrackEventDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TrackEventDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_available_categories() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> available_categories() const { return GetRepeated<::protozero::ConstBytes>(1); }
+};
+
+class TrackEventDescriptor : public ::protozero::Message {
+ public:
+  using Decoder = TrackEventDescriptor_Decoder;
+  enum : int32_t {
+    kAvailableCategoriesFieldNumber = 1,
+  };
+
+  using FieldMetadata_AvailableCategories =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TrackEventCategory,
+      TrackEventDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AvailableCategories kAvailableCategories() { return {}; }
+  template <typename T = TrackEventCategory> T* add_available_categories() {
+    return BeginNestedMessage<T>(1);
+  }
+
+};
+
+class TrackEventCategory_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  TrackEventCategory_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TrackEventCategory_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TrackEventCategory_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_description() const { return at<2>().valid(); }
+  ::protozero::ConstChars description() const { return at<2>().as_string(); }
+  bool has_tags() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> tags() const { return GetRepeated<::protozero::ConstChars>(3); }
+};
+
+class TrackEventCategory : public ::protozero::Message {
+ public:
+  using Decoder = TrackEventCategory_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kDescriptionFieldNumber = 2,
+    kTagsFieldNumber = 3,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TrackEventCategory>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Description =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TrackEventCategory>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Description kDescription() { return {}; }
+  void set_description(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Description::kFieldId, data, size);
+  }
+  void set_description(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Description::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Tags =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TrackEventCategory>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Tags kTags() { return {}; }
+  void add_tags(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Tags::kFieldId, data, size);
+  }
+  void add_tags(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Tags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/config/track_event/track_event_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACK_EVENT_TRACK_EVENT_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACK_EVENT_TRACK_EVENT_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class TrackEventConfig;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT TrackEventConfig : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDisabledCategoriesFieldNumber = 1,
+    kEnabledCategoriesFieldNumber = 2,
+    kDisabledTagsFieldNumber = 3,
+    kEnabledTagsFieldNumber = 4,
+  };
+
+  TrackEventConfig();
+  ~TrackEventConfig() override;
+  TrackEventConfig(TrackEventConfig&&) noexcept;
+  TrackEventConfig& operator=(TrackEventConfig&&);
+  TrackEventConfig(const TrackEventConfig&);
+  TrackEventConfig& operator=(const TrackEventConfig&);
+  bool operator==(const TrackEventConfig&) const;
+  bool operator!=(const TrackEventConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<std::string>& disabled_categories() const { return disabled_categories_; }
+  std::vector<std::string>* mutable_disabled_categories() { return &disabled_categories_; }
+  int disabled_categories_size() const { return static_cast<int>(disabled_categories_.size()); }
+  void clear_disabled_categories() { disabled_categories_.clear(); }
+  void add_disabled_categories(std::string value) { disabled_categories_.emplace_back(value); }
+  std::string* add_disabled_categories() { disabled_categories_.emplace_back(); return &disabled_categories_.back(); }
+
+  const std::vector<std::string>& enabled_categories() const { return enabled_categories_; }
+  std::vector<std::string>* mutable_enabled_categories() { return &enabled_categories_; }
+  int enabled_categories_size() const { return static_cast<int>(enabled_categories_.size()); }
+  void clear_enabled_categories() { enabled_categories_.clear(); }
+  void add_enabled_categories(std::string value) { enabled_categories_.emplace_back(value); }
+  std::string* add_enabled_categories() { enabled_categories_.emplace_back(); return &enabled_categories_.back(); }
+
+  const std::vector<std::string>& disabled_tags() const { return disabled_tags_; }
+  std::vector<std::string>* mutable_disabled_tags() { return &disabled_tags_; }
+  int disabled_tags_size() const { return static_cast<int>(disabled_tags_.size()); }
+  void clear_disabled_tags() { disabled_tags_.clear(); }
+  void add_disabled_tags(std::string value) { disabled_tags_.emplace_back(value); }
+  std::string* add_disabled_tags() { disabled_tags_.emplace_back(); return &disabled_tags_.back(); }
+
+  const std::vector<std::string>& enabled_tags() const { return enabled_tags_; }
+  std::vector<std::string>* mutable_enabled_tags() { return &enabled_tags_; }
+  int enabled_tags_size() const { return static_cast<int>(enabled_tags_.size()); }
+  void clear_enabled_tags() { enabled_tags_.clear(); }
+  void add_enabled_tags(std::string value) { enabled_tags_.emplace_back(value); }
+  std::string* add_enabled_tags() { enabled_tags_.emplace_back(); return &enabled_tags_.back(); }
+
+ private:
+  std::vector<std::string> disabled_categories_;
+  std::vector<std::string> enabled_categories_;
+  std::vector<std::string> disabled_tags_;
+  std::vector<std::string> enabled_tags_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<5> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACK_EVENT_TRACK_EVENT_CONFIG_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/config/android/android_log_config.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_ANDROID_LOG_CONFIG_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_ANDROID_LOG_CONFIG_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+enum AndroidLogId : int32_t;
+enum AndroidLogPriority : int32_t;
+
+class AndroidLogConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  AndroidLogConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit AndroidLogConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit AndroidLogConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_log_ids() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<int32_t> log_ids() const { return GetRepeated<int32_t>(1); }
+  bool has_min_prio() const { return at<3>().valid(); }
+  int32_t min_prio() const { return at<3>().as_int32(); }
+  bool has_filter_tags() const { return at<4>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> filter_tags() const { return GetRepeated<::protozero::ConstChars>(4); }
+};
+
+class AndroidLogConfig : public ::protozero::Message {
+ public:
+  using Decoder = AndroidLogConfig_Decoder;
+  enum : int32_t {
+    kLogIdsFieldNumber = 1,
+    kMinPrioFieldNumber = 3,
+    kFilterTagsFieldNumber = 4,
+  };
+
+  using FieldMetadata_LogIds =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::AndroidLogId,
+      AndroidLogConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LogIds kLogIds() { return {}; }
+  void add_log_ids(::perfetto::protos::pbzero::AndroidLogId value) {
+    static constexpr uint32_t field_id = FieldMetadata_LogIds::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MinPrio =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::AndroidLogPriority,
+      AndroidLogConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MinPrio kMinPrio() { return {}; }
+  void set_min_prio(::perfetto::protos::pbzero::AndroidLogPriority value) {
+    static constexpr uint32_t field_id = FieldMetadata_MinPrio::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FilterTags =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      AndroidLogConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FilterTags kFilterTags() { return {}; }
+  void add_filter_tags(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_FilterTags::kFieldId, data, size);
+  }
+  void add_filter_tags(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_FilterTags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/config/android/android_polled_state_config.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_ANDROID_POLLED_STATE_CONFIG_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_ANDROID_POLLED_STATE_CONFIG_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class AndroidPolledStateConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  AndroidPolledStateConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit AndroidPolledStateConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit AndroidPolledStateConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_poll_ms() const { return at<1>().valid(); }
+  uint32_t poll_ms() const { return at<1>().as_uint32(); }
+};
+
+class AndroidPolledStateConfig : public ::protozero::Message {
+ public:
+  using Decoder = AndroidPolledStateConfig_Decoder;
+  enum : int32_t {
+    kPollMsFieldNumber = 1,
+  };
+
+  using FieldMetadata_PollMs =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      AndroidPolledStateConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PollMs kPollMs() { return {}; }
+  void set_poll_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PollMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/config/android/packages_list_config.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_PACKAGES_LIST_CONFIG_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_PACKAGES_LIST_CONFIG_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class PackagesListConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  PackagesListConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit PackagesListConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit PackagesListConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_package_name_filter() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> package_name_filter() const { return GetRepeated<::protozero::ConstChars>(1); }
+};
+
+class PackagesListConfig : public ::protozero::Message {
+ public:
+  using Decoder = PackagesListConfig_Decoder;
+  enum : int32_t {
+    kPackageNameFilterFieldNumber = 1,
+  };
+
+  using FieldMetadata_PackageNameFilter =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      PackagesListConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PackageNameFilter kPackageNameFilter() { return {}; }
+  void add_package_name_filter(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_PackageNameFilter::kFieldId, data, size);
+  }
+  void add_package_name_filter(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_PackageNameFilter::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/config/ftrace/ftrace_config.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_FTRACE_FTRACE_CONFIG_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_FTRACE_FTRACE_CONFIG_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class FtraceConfig_CompactSchedConfig;
+
+class FtraceConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/14, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  FtraceConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit FtraceConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit FtraceConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_ftrace_events() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> ftrace_events() const { return GetRepeated<::protozero::ConstChars>(1); }
+  bool has_atrace_categories() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> atrace_categories() const { return GetRepeated<::protozero::ConstChars>(2); }
+  bool has_atrace_apps() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> atrace_apps() const { return GetRepeated<::protozero::ConstChars>(3); }
+  bool has_buffer_size_kb() const { return at<10>().valid(); }
+  uint32_t buffer_size_kb() const { return at<10>().as_uint32(); }
+  bool has_drain_period_ms() const { return at<11>().valid(); }
+  uint32_t drain_period_ms() const { return at<11>().as_uint32(); }
+  bool has_compact_sched() const { return at<12>().valid(); }
+  ::protozero::ConstBytes compact_sched() const { return at<12>().as_bytes(); }
+  bool has_symbolize_ksyms() const { return at<13>().valid(); }
+  bool symbolize_ksyms() const { return at<13>().as_bool(); }
+  bool has_initialize_ksyms_synchronously_for_testing() const { return at<14>().valid(); }
+  bool initialize_ksyms_synchronously_for_testing() const { return at<14>().as_bool(); }
+};
+
+class FtraceConfig : public ::protozero::Message {
+ public:
+  using Decoder = FtraceConfig_Decoder;
+  enum : int32_t {
+    kFtraceEventsFieldNumber = 1,
+    kAtraceCategoriesFieldNumber = 2,
+    kAtraceAppsFieldNumber = 3,
+    kBufferSizeKbFieldNumber = 10,
+    kDrainPeriodMsFieldNumber = 11,
+    kCompactSchedFieldNumber = 12,
+    kSymbolizeKsymsFieldNumber = 13,
+    kInitializeKsymsSynchronouslyForTestingFieldNumber = 14,
+  };
+  using CompactSchedConfig = ::perfetto::protos::pbzero::FtraceConfig_CompactSchedConfig;
+
+  using FieldMetadata_FtraceEvents =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      FtraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FtraceEvents kFtraceEvents() { return {}; }
+  void add_ftrace_events(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_FtraceEvents::kFieldId, data, size);
+  }
+  void add_ftrace_events(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_FtraceEvents::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_AtraceCategories =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      FtraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AtraceCategories kAtraceCategories() { return {}; }
+  void add_atrace_categories(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_AtraceCategories::kFieldId, data, size);
+  }
+  void add_atrace_categories(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_AtraceCategories::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_AtraceApps =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      FtraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AtraceApps kAtraceApps() { return {}; }
+  void add_atrace_apps(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_AtraceApps::kFieldId, data, size);
+  }
+  void add_atrace_apps(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_AtraceApps::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BufferSizeKb =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      FtraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BufferSizeKb kBufferSizeKb() { return {}; }
+  void set_buffer_size_kb(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BufferSizeKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DrainPeriodMs =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      FtraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DrainPeriodMs kDrainPeriodMs() { return {}; }
+  void set_drain_period_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DrainPeriodMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CompactSched =
+    ::protozero::proto_utils::FieldMetadata<
+      12,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      FtraceConfig_CompactSchedConfig,
+      FtraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CompactSched kCompactSched() { return {}; }
+  template <typename T = FtraceConfig_CompactSchedConfig> T* set_compact_sched() {
+    return BeginNestedMessage<T>(12);
+  }
+
+
+  using FieldMetadata_SymbolizeKsyms =
+    ::protozero::proto_utils::FieldMetadata<
+      13,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      FtraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SymbolizeKsyms kSymbolizeKsyms() { return {}; }
+  void set_symbolize_ksyms(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_SymbolizeKsyms::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_InitializeKsymsSynchronouslyForTesting =
+    ::protozero::proto_utils::FieldMetadata<
+      14,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      FtraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_InitializeKsymsSynchronouslyForTesting kInitializeKsymsSynchronouslyForTesting() { return {}; }
+  void set_initialize_ksyms_synchronously_for_testing(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_InitializeKsymsSynchronouslyForTesting::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class FtraceConfig_CompactSchedConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  FtraceConfig_CompactSchedConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit FtraceConfig_CompactSchedConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit FtraceConfig_CompactSchedConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_enabled() const { return at<1>().valid(); }
+  bool enabled() const { return at<1>().as_bool(); }
+};
+
+class FtraceConfig_CompactSchedConfig : public ::protozero::Message {
+ public:
+  using Decoder = FtraceConfig_CompactSchedConfig_Decoder;
+  enum : int32_t {
+    kEnabledFieldNumber = 1,
+  };
+
+  using FieldMetadata_Enabled =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      FtraceConfig_CompactSchedConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Enabled kEnabled() { return {}; }
+  void set_enabled(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_Enabled::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/config/gpu/gpu_counter_config.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_GPU_GPU_COUNTER_CONFIG_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_GPU_GPU_COUNTER_CONFIG_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class GpuCounterConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  GpuCounterConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit GpuCounterConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit GpuCounterConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_counter_period_ns() const { return at<1>().valid(); }
+  uint64_t counter_period_ns() const { return at<1>().as_uint64(); }
+  bool has_counter_ids() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint32_t> counter_ids() const { return GetRepeated<uint32_t>(2); }
+  bool has_instrumented_sampling() const { return at<3>().valid(); }
+  bool instrumented_sampling() const { return at<3>().as_bool(); }
+  bool has_fix_gpu_clock() const { return at<4>().valid(); }
+  bool fix_gpu_clock() const { return at<4>().as_bool(); }
+};
+
+class GpuCounterConfig : public ::protozero::Message {
+ public:
+  using Decoder = GpuCounterConfig_Decoder;
+  enum : int32_t {
+    kCounterPeriodNsFieldNumber = 1,
+    kCounterIdsFieldNumber = 2,
+    kInstrumentedSamplingFieldNumber = 3,
+    kFixGpuClockFieldNumber = 4,
+  };
+
+  using FieldMetadata_CounterPeriodNs =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      GpuCounterConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CounterPeriodNs kCounterPeriodNs() { return {}; }
+  void set_counter_period_ns(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CounterPeriodNs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CounterIds =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      GpuCounterConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CounterIds kCounterIds() { return {}; }
+  void add_counter_ids(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CounterIds::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_InstrumentedSampling =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      GpuCounterConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_InstrumentedSampling kInstrumentedSampling() { return {}; }
+  void set_instrumented_sampling(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_InstrumentedSampling::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FixGpuClock =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      GpuCounterConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FixGpuClock kFixGpuClock() { return {}; }
+  void set_fix_gpu_clock(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_FixGpuClock::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/config/gpu/vulkan_memory_config.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_GPU_VULKAN_MEMORY_CONFIG_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_GPU_VULKAN_MEMORY_CONFIG_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class VulkanMemoryConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  VulkanMemoryConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit VulkanMemoryConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit VulkanMemoryConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_track_driver_memory_usage() const { return at<1>().valid(); }
+  bool track_driver_memory_usage() const { return at<1>().as_bool(); }
+  bool has_track_device_memory_usage() const { return at<2>().valid(); }
+  bool track_device_memory_usage() const { return at<2>().as_bool(); }
+};
+
+class VulkanMemoryConfig : public ::protozero::Message {
+ public:
+  using Decoder = VulkanMemoryConfig_Decoder;
+  enum : int32_t {
+    kTrackDriverMemoryUsageFieldNumber = 1,
+    kTrackDeviceMemoryUsageFieldNumber = 2,
+  };
+
+  using FieldMetadata_TrackDriverMemoryUsage =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      VulkanMemoryConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TrackDriverMemoryUsage kTrackDriverMemoryUsage() { return {}; }
+  void set_track_driver_memory_usage(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_TrackDriverMemoryUsage::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TrackDeviceMemoryUsage =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      VulkanMemoryConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TrackDeviceMemoryUsage kTrackDeviceMemoryUsage() { return {}; }
+  void set_track_device_memory_usage(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_TrackDeviceMemoryUsage::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/config/inode_file/inode_file_config.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INODE_FILE_INODE_FILE_CONFIG_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INODE_FILE_INODE_FILE_CONFIG_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class InodeFileConfig_MountPointMappingEntry;
+
+class InodeFileConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  InodeFileConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit InodeFileConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit InodeFileConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_scan_interval_ms() const { return at<1>().valid(); }
+  uint32_t scan_interval_ms() const { return at<1>().as_uint32(); }
+  bool has_scan_delay_ms() const { return at<2>().valid(); }
+  uint32_t scan_delay_ms() const { return at<2>().as_uint32(); }
+  bool has_scan_batch_size() const { return at<3>().valid(); }
+  uint32_t scan_batch_size() const { return at<3>().as_uint32(); }
+  bool has_do_not_scan() const { return at<4>().valid(); }
+  bool do_not_scan() const { return at<4>().as_bool(); }
+  bool has_scan_mount_points() const { return at<5>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> scan_mount_points() const { return GetRepeated<::protozero::ConstChars>(5); }
+  bool has_mount_point_mapping() const { return at<6>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> mount_point_mapping() const { return GetRepeated<::protozero::ConstBytes>(6); }
+};
+
+class InodeFileConfig : public ::protozero::Message {
+ public:
+  using Decoder = InodeFileConfig_Decoder;
+  enum : int32_t {
+    kScanIntervalMsFieldNumber = 1,
+    kScanDelayMsFieldNumber = 2,
+    kScanBatchSizeFieldNumber = 3,
+    kDoNotScanFieldNumber = 4,
+    kScanMountPointsFieldNumber = 5,
+    kMountPointMappingFieldNumber = 6,
+  };
+  using MountPointMappingEntry = ::perfetto::protos::pbzero::InodeFileConfig_MountPointMappingEntry;
+
+  using FieldMetadata_ScanIntervalMs =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      InodeFileConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ScanIntervalMs kScanIntervalMs() { return {}; }
+  void set_scan_interval_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ScanIntervalMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ScanDelayMs =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      InodeFileConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ScanDelayMs kScanDelayMs() { return {}; }
+  void set_scan_delay_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ScanDelayMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ScanBatchSize =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      InodeFileConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ScanBatchSize kScanBatchSize() { return {}; }
+  void set_scan_batch_size(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ScanBatchSize::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DoNotScan =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      InodeFileConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DoNotScan kDoNotScan() { return {}; }
+  void set_do_not_scan(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_DoNotScan::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ScanMountPoints =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      InodeFileConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ScanMountPoints kScanMountPoints() { return {}; }
+  void add_scan_mount_points(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ScanMountPoints::kFieldId, data, size);
+  }
+  void add_scan_mount_points(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ScanMountPoints::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MountPointMapping =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      InodeFileConfig_MountPointMappingEntry,
+      InodeFileConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MountPointMapping kMountPointMapping() { return {}; }
+  template <typename T = InodeFileConfig_MountPointMappingEntry> T* add_mount_point_mapping() {
+    return BeginNestedMessage<T>(6);
+  }
+
+};
+
+class InodeFileConfig_MountPointMappingEntry_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  InodeFileConfig_MountPointMappingEntry_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit InodeFileConfig_MountPointMappingEntry_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit InodeFileConfig_MountPointMappingEntry_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_mountpoint() const { return at<1>().valid(); }
+  ::protozero::ConstChars mountpoint() const { return at<1>().as_string(); }
+  bool has_scan_roots() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> scan_roots() const { return GetRepeated<::protozero::ConstChars>(2); }
+};
+
+class InodeFileConfig_MountPointMappingEntry : public ::protozero::Message {
+ public:
+  using Decoder = InodeFileConfig_MountPointMappingEntry_Decoder;
+  enum : int32_t {
+    kMountpointFieldNumber = 1,
+    kScanRootsFieldNumber = 2,
+  };
+
+  using FieldMetadata_Mountpoint =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      InodeFileConfig_MountPointMappingEntry>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mountpoint kMountpoint() { return {}; }
+  void set_mountpoint(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Mountpoint::kFieldId, data, size);
+  }
+  void set_mountpoint(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mountpoint::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ScanRoots =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      InodeFileConfig_MountPointMappingEntry>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ScanRoots kScanRoots() { return {}; }
+  void add_scan_roots(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ScanRoots::kFieldId, data, size);
+  }
+  void add_scan_roots(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ScanRoots::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/config/interceptors/console_config.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INTERCEPTORS_CONSOLE_CONFIG_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INTERCEPTORS_CONSOLE_CONFIG_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+enum ConsoleConfig_Output : int32_t;
+
+enum ConsoleConfig_Output : int32_t {
+  ConsoleConfig_Output_OUTPUT_UNSPECIFIED = 0,
+  ConsoleConfig_Output_OUTPUT_STDOUT = 1,
+  ConsoleConfig_Output_OUTPUT_STDERR = 2,
+};
+
+const ConsoleConfig_Output ConsoleConfig_Output_MIN = ConsoleConfig_Output_OUTPUT_UNSPECIFIED;
+const ConsoleConfig_Output ConsoleConfig_Output_MAX = ConsoleConfig_Output_OUTPUT_STDERR;
+
+class ConsoleConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ConsoleConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ConsoleConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ConsoleConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_output() const { return at<1>().valid(); }
+  int32_t output() const { return at<1>().as_int32(); }
+  bool has_enable_colors() const { return at<2>().valid(); }
+  bool enable_colors() const { return at<2>().as_bool(); }
+};
+
+class ConsoleConfig : public ::protozero::Message {
+ public:
+  using Decoder = ConsoleConfig_Decoder;
+  enum : int32_t {
+    kOutputFieldNumber = 1,
+    kEnableColorsFieldNumber = 2,
+  };
+  using Output = ::perfetto::protos::pbzero::ConsoleConfig_Output;
+  static const Output OUTPUT_UNSPECIFIED = ConsoleConfig_Output_OUTPUT_UNSPECIFIED;
+  static const Output OUTPUT_STDOUT = ConsoleConfig_Output_OUTPUT_STDOUT;
+  static const Output OUTPUT_STDERR = ConsoleConfig_Output_OUTPUT_STDERR;
+
+  using FieldMetadata_Output =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ConsoleConfig_Output,
+      ConsoleConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Output kOutput() { return {}; }
+  void set_output(::perfetto::protos::pbzero::ConsoleConfig_Output value) {
+    static constexpr uint32_t field_id = FieldMetadata_Output::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_EnableColors =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ConsoleConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EnableColors kEnableColors() { return {}; }
+  void set_enable_colors(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_EnableColors::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/config/power/android_power_config.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_POWER_ANDROID_POWER_CONFIG_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_POWER_ANDROID_POWER_CONFIG_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+enum AndroidPowerConfig_BatteryCounters : int32_t;
+
+enum AndroidPowerConfig_BatteryCounters : int32_t {
+  AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_UNSPECIFIED = 0,
+  AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CHARGE = 1,
+  AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CAPACITY_PERCENT = 2,
+  AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CURRENT = 3,
+  AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CURRENT_AVG = 4,
+};
+
+const AndroidPowerConfig_BatteryCounters AndroidPowerConfig_BatteryCounters_MIN = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_UNSPECIFIED;
+const AndroidPowerConfig_BatteryCounters AndroidPowerConfig_BatteryCounters_MAX = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CURRENT_AVG;
+
+class AndroidPowerConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  AndroidPowerConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit AndroidPowerConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit AndroidPowerConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_battery_poll_ms() const { return at<1>().valid(); }
+  uint32_t battery_poll_ms() const { return at<1>().as_uint32(); }
+  bool has_battery_counters() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<int32_t> battery_counters() const { return GetRepeated<int32_t>(2); }
+  bool has_collect_power_rails() const { return at<3>().valid(); }
+  bool collect_power_rails() const { return at<3>().as_bool(); }
+  bool has_collect_energy_estimation_breakdown() const { return at<4>().valid(); }
+  bool collect_energy_estimation_breakdown() const { return at<4>().as_bool(); }
+};
+
+class AndroidPowerConfig : public ::protozero::Message {
+ public:
+  using Decoder = AndroidPowerConfig_Decoder;
+  enum : int32_t {
+    kBatteryPollMsFieldNumber = 1,
+    kBatteryCountersFieldNumber = 2,
+    kCollectPowerRailsFieldNumber = 3,
+    kCollectEnergyEstimationBreakdownFieldNumber = 4,
+  };
+  using BatteryCounters = ::perfetto::protos::pbzero::AndroidPowerConfig_BatteryCounters;
+  static const BatteryCounters BATTERY_COUNTER_UNSPECIFIED = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_UNSPECIFIED;
+  static const BatteryCounters BATTERY_COUNTER_CHARGE = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CHARGE;
+  static const BatteryCounters BATTERY_COUNTER_CAPACITY_PERCENT = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CAPACITY_PERCENT;
+  static const BatteryCounters BATTERY_COUNTER_CURRENT = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CURRENT;
+  static const BatteryCounters BATTERY_COUNTER_CURRENT_AVG = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CURRENT_AVG;
+
+  using FieldMetadata_BatteryPollMs =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      AndroidPowerConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BatteryPollMs kBatteryPollMs() { return {}; }
+  void set_battery_poll_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BatteryPollMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BatteryCounters =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::AndroidPowerConfig_BatteryCounters,
+      AndroidPowerConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BatteryCounters kBatteryCounters() { return {}; }
+  void add_battery_counters(::perfetto::protos::pbzero::AndroidPowerConfig_BatteryCounters value) {
+    static constexpr uint32_t field_id = FieldMetadata_BatteryCounters::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CollectPowerRails =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      AndroidPowerConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CollectPowerRails kCollectPowerRails() { return {}; }
+  void set_collect_power_rails(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_CollectPowerRails::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CollectEnergyEstimationBreakdown =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      AndroidPowerConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CollectEnergyEstimationBreakdown kCollectEnergyEstimationBreakdown() { return {}; }
+  void set_collect_energy_estimation_breakdown(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_CollectEnergyEstimationBreakdown::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/config/process_stats/process_stats_config.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROCESS_STATS_PROCESS_STATS_CONFIG_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROCESS_STATS_PROCESS_STATS_CONFIG_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+enum ProcessStatsConfig_Quirks : int32_t;
+
+enum ProcessStatsConfig_Quirks : int32_t {
+  ProcessStatsConfig_Quirks_QUIRKS_UNSPECIFIED = 0,
+  ProcessStatsConfig_Quirks_DISABLE_INITIAL_DUMP = 1,
+  ProcessStatsConfig_Quirks_DISABLE_ON_DEMAND = 2,
+};
+
+const ProcessStatsConfig_Quirks ProcessStatsConfig_Quirks_MIN = ProcessStatsConfig_Quirks_QUIRKS_UNSPECIFIED;
+const ProcessStatsConfig_Quirks ProcessStatsConfig_Quirks_MAX = ProcessStatsConfig_Quirks_DISABLE_ON_DEMAND;
+
+class ProcessStatsConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  ProcessStatsConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ProcessStatsConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ProcessStatsConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_quirks() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<int32_t> quirks() const { return GetRepeated<int32_t>(1); }
+  bool has_scan_all_processes_on_start() const { return at<2>().valid(); }
+  bool scan_all_processes_on_start() const { return at<2>().as_bool(); }
+  bool has_record_thread_names() const { return at<3>().valid(); }
+  bool record_thread_names() const { return at<3>().as_bool(); }
+  bool has_proc_stats_poll_ms() const { return at<4>().valid(); }
+  uint32_t proc_stats_poll_ms() const { return at<4>().as_uint32(); }
+  bool has_proc_stats_cache_ttl_ms() const { return at<6>().valid(); }
+  uint32_t proc_stats_cache_ttl_ms() const { return at<6>().as_uint32(); }
+  bool has_record_thread_time_in_state() const { return at<7>().valid(); }
+  bool record_thread_time_in_state() const { return at<7>().as_bool(); }
+  bool has_thread_time_in_state_cache_size() const { return at<8>().valid(); }
+  uint32_t thread_time_in_state_cache_size() const { return at<8>().as_uint32(); }
+};
+
+class ProcessStatsConfig : public ::protozero::Message {
+ public:
+  using Decoder = ProcessStatsConfig_Decoder;
+  enum : int32_t {
+    kQuirksFieldNumber = 1,
+    kScanAllProcessesOnStartFieldNumber = 2,
+    kRecordThreadNamesFieldNumber = 3,
+    kProcStatsPollMsFieldNumber = 4,
+    kProcStatsCacheTtlMsFieldNumber = 6,
+    kRecordThreadTimeInStateFieldNumber = 7,
+    kThreadTimeInStateCacheSizeFieldNumber = 8,
+  };
+  using Quirks = ::perfetto::protos::pbzero::ProcessStatsConfig_Quirks;
+  static const Quirks QUIRKS_UNSPECIFIED = ProcessStatsConfig_Quirks_QUIRKS_UNSPECIFIED;
+  static const Quirks DISABLE_INITIAL_DUMP = ProcessStatsConfig_Quirks_DISABLE_INITIAL_DUMP;
+  static const Quirks DISABLE_ON_DEMAND = ProcessStatsConfig_Quirks_DISABLE_ON_DEMAND;
+
+  using FieldMetadata_Quirks =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ProcessStatsConfig_Quirks,
+      ProcessStatsConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Quirks kQuirks() { return {}; }
+  void add_quirks(::perfetto::protos::pbzero::ProcessStatsConfig_Quirks value) {
+    static constexpr uint32_t field_id = FieldMetadata_Quirks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ScanAllProcessesOnStart =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ProcessStatsConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ScanAllProcessesOnStart kScanAllProcessesOnStart() { return {}; }
+  void set_scan_all_processes_on_start(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_ScanAllProcessesOnStart::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_RecordThreadNames =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ProcessStatsConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RecordThreadNames kRecordThreadNames() { return {}; }
+  void set_record_thread_names(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_RecordThreadNames::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ProcStatsPollMs =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      ProcessStatsConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProcStatsPollMs kProcStatsPollMs() { return {}; }
+  void set_proc_stats_poll_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProcStatsPollMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ProcStatsCacheTtlMs =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      ProcessStatsConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProcStatsCacheTtlMs kProcStatsCacheTtlMs() { return {}; }
+  void set_proc_stats_cache_ttl_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProcStatsCacheTtlMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_RecordThreadTimeInState =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ProcessStatsConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RecordThreadTimeInState kRecordThreadTimeInState() { return {}; }
+  void set_record_thread_time_in_state(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_RecordThreadTimeInState::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ThreadTimeInStateCacheSize =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      ProcessStatsConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ThreadTimeInStateCacheSize kThreadTimeInStateCacheSize() { return {}; }
+  void set_thread_time_in_state_cache_size(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ThreadTimeInStateCacheSize::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/config/profiling/heapprofd_config.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_HEAPPROFD_CONFIG_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_HEAPPROFD_CONFIG_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class HeapprofdConfig_ContinuousDumpConfig;
+
+class HeapprofdConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/27, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  HeapprofdConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit HeapprofdConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit HeapprofdConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_sampling_interval_bytes() const { return at<1>().valid(); }
+  uint64_t sampling_interval_bytes() const { return at<1>().as_uint64(); }
+  bool has_adaptive_sampling_shmem_threshold() const { return at<24>().valid(); }
+  uint64_t adaptive_sampling_shmem_threshold() const { return at<24>().as_uint64(); }
+  bool has_adaptive_sampling_max_sampling_interval_bytes() const { return at<25>().valid(); }
+  uint64_t adaptive_sampling_max_sampling_interval_bytes() const { return at<25>().as_uint64(); }
+  bool has_process_cmdline() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> process_cmdline() const { return GetRepeated<::protozero::ConstChars>(2); }
+  bool has_pid() const { return at<4>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> pid() const { return GetRepeated<uint64_t>(4); }
+  bool has_target_installed_by() const { return at<26>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> target_installed_by() const { return GetRepeated<::protozero::ConstChars>(26); }
+  bool has_heaps() const { return at<20>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> heaps() const { return GetRepeated<::protozero::ConstChars>(20); }
+  bool has_exclude_heaps() const { return at<27>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> exclude_heaps() const { return GetRepeated<::protozero::ConstChars>(27); }
+  bool has_stream_allocations() const { return at<23>().valid(); }
+  bool stream_allocations() const { return at<23>().as_bool(); }
+  bool has_heap_sampling_intervals() const { return at<22>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> heap_sampling_intervals() const { return GetRepeated<uint64_t>(22); }
+  bool has_all_heaps() const { return at<21>().valid(); }
+  bool all_heaps() const { return at<21>().as_bool(); }
+  bool has_all() const { return at<5>().valid(); }
+  bool all() const { return at<5>().as_bool(); }
+  bool has_min_anonymous_memory_kb() const { return at<15>().valid(); }
+  uint32_t min_anonymous_memory_kb() const { return at<15>().as_uint32(); }
+  bool has_max_heapprofd_memory_kb() const { return at<16>().valid(); }
+  uint32_t max_heapprofd_memory_kb() const { return at<16>().as_uint32(); }
+  bool has_max_heapprofd_cpu_secs() const { return at<17>().valid(); }
+  uint64_t max_heapprofd_cpu_secs() const { return at<17>().as_uint64(); }
+  bool has_skip_symbol_prefix() const { return at<7>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> skip_symbol_prefix() const { return GetRepeated<::protozero::ConstChars>(7); }
+  bool has_continuous_dump_config() const { return at<6>().valid(); }
+  ::protozero::ConstBytes continuous_dump_config() const { return at<6>().as_bytes(); }
+  bool has_shmem_size_bytes() const { return at<8>().valid(); }
+  uint64_t shmem_size_bytes() const { return at<8>().as_uint64(); }
+  bool has_block_client() const { return at<9>().valid(); }
+  bool block_client() const { return at<9>().as_bool(); }
+  bool has_block_client_timeout_us() const { return at<14>().valid(); }
+  uint32_t block_client_timeout_us() const { return at<14>().as_uint32(); }
+  bool has_no_startup() const { return at<10>().valid(); }
+  bool no_startup() const { return at<10>().as_bool(); }
+  bool has_no_running() const { return at<11>().valid(); }
+  bool no_running() const { return at<11>().as_bool(); }
+  bool has_dump_at_max() const { return at<13>().valid(); }
+  bool dump_at_max() const { return at<13>().as_bool(); }
+  bool has_disable_fork_teardown() const { return at<18>().valid(); }
+  bool disable_fork_teardown() const { return at<18>().as_bool(); }
+  bool has_disable_vfork_detection() const { return at<19>().valid(); }
+  bool disable_vfork_detection() const { return at<19>().as_bool(); }
+};
+
+class HeapprofdConfig : public ::protozero::Message {
+ public:
+  using Decoder = HeapprofdConfig_Decoder;
+  enum : int32_t {
+    kSamplingIntervalBytesFieldNumber = 1,
+    kAdaptiveSamplingShmemThresholdFieldNumber = 24,
+    kAdaptiveSamplingMaxSamplingIntervalBytesFieldNumber = 25,
+    kProcessCmdlineFieldNumber = 2,
+    kPidFieldNumber = 4,
+    kTargetInstalledByFieldNumber = 26,
+    kHeapsFieldNumber = 20,
+    kExcludeHeapsFieldNumber = 27,
+    kStreamAllocationsFieldNumber = 23,
+    kHeapSamplingIntervalsFieldNumber = 22,
+    kAllHeapsFieldNumber = 21,
+    kAllFieldNumber = 5,
+    kMinAnonymousMemoryKbFieldNumber = 15,
+    kMaxHeapprofdMemoryKbFieldNumber = 16,
+    kMaxHeapprofdCpuSecsFieldNumber = 17,
+    kSkipSymbolPrefixFieldNumber = 7,
+    kContinuousDumpConfigFieldNumber = 6,
+    kShmemSizeBytesFieldNumber = 8,
+    kBlockClientFieldNumber = 9,
+    kBlockClientTimeoutUsFieldNumber = 14,
+    kNoStartupFieldNumber = 10,
+    kNoRunningFieldNumber = 11,
+    kDumpAtMaxFieldNumber = 13,
+    kDisableForkTeardownFieldNumber = 18,
+    kDisableVforkDetectionFieldNumber = 19,
+  };
+  using ContinuousDumpConfig = ::perfetto::protos::pbzero::HeapprofdConfig_ContinuousDumpConfig;
+
+  using FieldMetadata_SamplingIntervalBytes =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      HeapprofdConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SamplingIntervalBytes kSamplingIntervalBytes() { return {}; }
+  void set_sampling_interval_bytes(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SamplingIntervalBytes::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_AdaptiveSamplingShmemThreshold =
+    ::protozero::proto_utils::FieldMetadata<
+      24,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      HeapprofdConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AdaptiveSamplingShmemThreshold kAdaptiveSamplingShmemThreshold() { return {}; }
+  void set_adaptive_sampling_shmem_threshold(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_AdaptiveSamplingShmemThreshold::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_AdaptiveSamplingMaxSamplingIntervalBytes =
+    ::protozero::proto_utils::FieldMetadata<
+      25,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      HeapprofdConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AdaptiveSamplingMaxSamplingIntervalBytes kAdaptiveSamplingMaxSamplingIntervalBytes() { return {}; }
+  void set_adaptive_sampling_max_sampling_interval_bytes(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_AdaptiveSamplingMaxSamplingIntervalBytes::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ProcessCmdline =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      HeapprofdConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProcessCmdline kProcessCmdline() { return {}; }
+  void add_process_cmdline(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ProcessCmdline::kFieldId, data, size);
+  }
+  void add_process_cmdline(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProcessCmdline::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      HeapprofdConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void add_pid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TargetInstalledBy =
+    ::protozero::proto_utils::FieldMetadata<
+      26,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      HeapprofdConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TargetInstalledBy kTargetInstalledBy() { return {}; }
+  void add_target_installed_by(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_TargetInstalledBy::kFieldId, data, size);
+  }
+  void add_target_installed_by(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_TargetInstalledBy::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Heaps =
+    ::protozero::proto_utils::FieldMetadata<
+      20,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      HeapprofdConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Heaps kHeaps() { return {}; }
+  void add_heaps(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Heaps::kFieldId, data, size);
+  }
+  void add_heaps(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Heaps::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ExcludeHeaps =
+    ::protozero::proto_utils::FieldMetadata<
+      27,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      HeapprofdConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ExcludeHeaps kExcludeHeaps() { return {}; }
+  void add_exclude_heaps(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ExcludeHeaps::kFieldId, data, size);
+  }
+  void add_exclude_heaps(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ExcludeHeaps::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_StreamAllocations =
+    ::protozero::proto_utils::FieldMetadata<
+      23,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      HeapprofdConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StreamAllocations kStreamAllocations() { return {}; }
+  void set_stream_allocations(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_StreamAllocations::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HeapSamplingIntervals =
+    ::protozero::proto_utils::FieldMetadata<
+      22,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      HeapprofdConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HeapSamplingIntervals kHeapSamplingIntervals() { return {}; }
+  void add_heap_sampling_intervals(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_HeapSamplingIntervals::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_AllHeaps =
+    ::protozero::proto_utils::FieldMetadata<
+      21,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      HeapprofdConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AllHeaps kAllHeaps() { return {}; }
+  void set_all_heaps(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_AllHeaps::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_All =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      HeapprofdConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_All kAll() { return {}; }
+  void set_all(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_All::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MinAnonymousMemoryKb =
+    ::protozero::proto_utils::FieldMetadata<
+      15,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      HeapprofdConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MinAnonymousMemoryKb kMinAnonymousMemoryKb() { return {}; }
+  void set_min_anonymous_memory_kb(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MinAnonymousMemoryKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MaxHeapprofdMemoryKb =
+    ::protozero::proto_utils::FieldMetadata<
+      16,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      HeapprofdConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MaxHeapprofdMemoryKb kMaxHeapprofdMemoryKb() { return {}; }
+  void set_max_heapprofd_memory_kb(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MaxHeapprofdMemoryKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MaxHeapprofdCpuSecs =
+    ::protozero::proto_utils::FieldMetadata<
+      17,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      HeapprofdConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MaxHeapprofdCpuSecs kMaxHeapprofdCpuSecs() { return {}; }
+  void set_max_heapprofd_cpu_secs(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MaxHeapprofdCpuSecs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SkipSymbolPrefix =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      HeapprofdConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SkipSymbolPrefix kSkipSymbolPrefix() { return {}; }
+  void add_skip_symbol_prefix(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_SkipSymbolPrefix::kFieldId, data, size);
+  }
+  void add_skip_symbol_prefix(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_SkipSymbolPrefix::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ContinuousDumpConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      HeapprofdConfig_ContinuousDumpConfig,
+      HeapprofdConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ContinuousDumpConfig kContinuousDumpConfig() { return {}; }
+  template <typename T = HeapprofdConfig_ContinuousDumpConfig> T* set_continuous_dump_config() {
+    return BeginNestedMessage<T>(6);
+  }
+
+
+  using FieldMetadata_ShmemSizeBytes =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      HeapprofdConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ShmemSizeBytes kShmemSizeBytes() { return {}; }
+  void set_shmem_size_bytes(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ShmemSizeBytes::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BlockClient =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      HeapprofdConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BlockClient kBlockClient() { return {}; }
+  void set_block_client(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_BlockClient::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BlockClientTimeoutUs =
+    ::protozero::proto_utils::FieldMetadata<
+      14,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      HeapprofdConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BlockClientTimeoutUs kBlockClientTimeoutUs() { return {}; }
+  void set_block_client_timeout_us(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BlockClientTimeoutUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NoStartup =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      HeapprofdConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NoStartup kNoStartup() { return {}; }
+  void set_no_startup(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_NoStartup::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NoRunning =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      HeapprofdConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NoRunning kNoRunning() { return {}; }
+  void set_no_running(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_NoRunning::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DumpAtMax =
+    ::protozero::proto_utils::FieldMetadata<
+      13,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      HeapprofdConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DumpAtMax kDumpAtMax() { return {}; }
+  void set_dump_at_max(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_DumpAtMax::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DisableForkTeardown =
+    ::protozero::proto_utils::FieldMetadata<
+      18,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      HeapprofdConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DisableForkTeardown kDisableForkTeardown() { return {}; }
+  void set_disable_fork_teardown(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_DisableForkTeardown::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DisableVforkDetection =
+    ::protozero::proto_utils::FieldMetadata<
+      19,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      HeapprofdConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DisableVforkDetection kDisableVforkDetection() { return {}; }
+  void set_disable_vfork_detection(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_DisableVforkDetection::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class HeapprofdConfig_ContinuousDumpConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  HeapprofdConfig_ContinuousDumpConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit HeapprofdConfig_ContinuousDumpConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit HeapprofdConfig_ContinuousDumpConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dump_phase_ms() const { return at<5>().valid(); }
+  uint32_t dump_phase_ms() const { return at<5>().as_uint32(); }
+  bool has_dump_interval_ms() const { return at<6>().valid(); }
+  uint32_t dump_interval_ms() const { return at<6>().as_uint32(); }
+};
+
+class HeapprofdConfig_ContinuousDumpConfig : public ::protozero::Message {
+ public:
+  using Decoder = HeapprofdConfig_ContinuousDumpConfig_Decoder;
+  enum : int32_t {
+    kDumpPhaseMsFieldNumber = 5,
+    kDumpIntervalMsFieldNumber = 6,
+  };
+
+  using FieldMetadata_DumpPhaseMs =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      HeapprofdConfig_ContinuousDumpConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DumpPhaseMs kDumpPhaseMs() { return {}; }
+  void set_dump_phase_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DumpPhaseMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DumpIntervalMs =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      HeapprofdConfig_ContinuousDumpConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DumpIntervalMs kDumpIntervalMs() { return {}; }
+  void set_dump_interval_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DumpIntervalMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/config/profiling/java_hprof_config.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_JAVA_HPROF_CONFIG_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_JAVA_HPROF_CONFIG_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class JavaHprofConfig_ContinuousDumpConfig;
+
+class JavaHprofConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  JavaHprofConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit JavaHprofConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit JavaHprofConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_process_cmdline() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> process_cmdline() const { return GetRepeated<::protozero::ConstChars>(1); }
+  bool has_pid() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> pid() const { return GetRepeated<uint64_t>(2); }
+  bool has_target_installed_by() const { return at<7>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> target_installed_by() const { return GetRepeated<::protozero::ConstChars>(7); }
+  bool has_continuous_dump_config() const { return at<3>().valid(); }
+  ::protozero::ConstBytes continuous_dump_config() const { return at<3>().as_bytes(); }
+  bool has_min_anonymous_memory_kb() const { return at<4>().valid(); }
+  uint32_t min_anonymous_memory_kb() const { return at<4>().as_uint32(); }
+  bool has_dump_smaps() const { return at<5>().valid(); }
+  bool dump_smaps() const { return at<5>().as_bool(); }
+  bool has_ignored_types() const { return at<6>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> ignored_types() const { return GetRepeated<::protozero::ConstChars>(6); }
+};
+
+class JavaHprofConfig : public ::protozero::Message {
+ public:
+  using Decoder = JavaHprofConfig_Decoder;
+  enum : int32_t {
+    kProcessCmdlineFieldNumber = 1,
+    kPidFieldNumber = 2,
+    kTargetInstalledByFieldNumber = 7,
+    kContinuousDumpConfigFieldNumber = 3,
+    kMinAnonymousMemoryKbFieldNumber = 4,
+    kDumpSmapsFieldNumber = 5,
+    kIgnoredTypesFieldNumber = 6,
+  };
+  using ContinuousDumpConfig = ::perfetto::protos::pbzero::JavaHprofConfig_ContinuousDumpConfig;
+
+  using FieldMetadata_ProcessCmdline =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      JavaHprofConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProcessCmdline kProcessCmdline() { return {}; }
+  void add_process_cmdline(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ProcessCmdline::kFieldId, data, size);
+  }
+  void add_process_cmdline(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProcessCmdline::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      JavaHprofConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void add_pid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TargetInstalledBy =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      JavaHprofConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TargetInstalledBy kTargetInstalledBy() { return {}; }
+  void add_target_installed_by(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_TargetInstalledBy::kFieldId, data, size);
+  }
+  void add_target_installed_by(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_TargetInstalledBy::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ContinuousDumpConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      JavaHprofConfig_ContinuousDumpConfig,
+      JavaHprofConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ContinuousDumpConfig kContinuousDumpConfig() { return {}; }
+  template <typename T = JavaHprofConfig_ContinuousDumpConfig> T* set_continuous_dump_config() {
+    return BeginNestedMessage<T>(3);
+  }
+
+
+  using FieldMetadata_MinAnonymousMemoryKb =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      JavaHprofConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MinAnonymousMemoryKb kMinAnonymousMemoryKb() { return {}; }
+  void set_min_anonymous_memory_kb(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MinAnonymousMemoryKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DumpSmaps =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      JavaHprofConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DumpSmaps kDumpSmaps() { return {}; }
+  void set_dump_smaps(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_DumpSmaps::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IgnoredTypes =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      JavaHprofConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IgnoredTypes kIgnoredTypes() { return {}; }
+  void add_ignored_types(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_IgnoredTypes::kFieldId, data, size);
+  }
+  void add_ignored_types(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_IgnoredTypes::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class JavaHprofConfig_ContinuousDumpConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  JavaHprofConfig_ContinuousDumpConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit JavaHprofConfig_ContinuousDumpConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit JavaHprofConfig_ContinuousDumpConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dump_phase_ms() const { return at<1>().valid(); }
+  uint32_t dump_phase_ms() const { return at<1>().as_uint32(); }
+  bool has_dump_interval_ms() const { return at<2>().valid(); }
+  uint32_t dump_interval_ms() const { return at<2>().as_uint32(); }
+};
+
+class JavaHprofConfig_ContinuousDumpConfig : public ::protozero::Message {
+ public:
+  using Decoder = JavaHprofConfig_ContinuousDumpConfig_Decoder;
+  enum : int32_t {
+    kDumpPhaseMsFieldNumber = 1,
+    kDumpIntervalMsFieldNumber = 2,
+  };
+
+  using FieldMetadata_DumpPhaseMs =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      JavaHprofConfig_ContinuousDumpConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DumpPhaseMs kDumpPhaseMs() { return {}; }
+  void set_dump_phase_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DumpPhaseMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DumpIntervalMs =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      JavaHprofConfig_ContinuousDumpConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DumpIntervalMs kDumpIntervalMs() { return {}; }
+  void set_dump_interval_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DumpIntervalMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/config/profiling/perf_event_config.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_PERF_EVENT_CONFIG_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_PERF_EVENT_CONFIG_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class PerfEventConfig_CallstackSampling;
+class PerfEventConfig_Scope;
+class PerfEvents_Timebase;
+
+class PerfEventConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/18, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  PerfEventConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit PerfEventConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit PerfEventConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_timebase() const { return at<15>().valid(); }
+  ::protozero::ConstBytes timebase() const { return at<15>().as_bytes(); }
+  bool has_callstack_sampling() const { return at<16>().valid(); }
+  ::protozero::ConstBytes callstack_sampling() const { return at<16>().as_bytes(); }
+  bool has_ring_buffer_read_period_ms() const { return at<8>().valid(); }
+  uint32_t ring_buffer_read_period_ms() const { return at<8>().as_uint32(); }
+  bool has_ring_buffer_pages() const { return at<3>().valid(); }
+  uint32_t ring_buffer_pages() const { return at<3>().as_uint32(); }
+  bool has_max_enqueued_footprint_kb() const { return at<17>().valid(); }
+  uint64_t max_enqueued_footprint_kb() const { return at<17>().as_uint64(); }
+  bool has_max_daemon_memory_kb() const { return at<13>().valid(); }
+  uint32_t max_daemon_memory_kb() const { return at<13>().as_uint32(); }
+  bool has_remote_descriptor_timeout_ms() const { return at<9>().valid(); }
+  uint32_t remote_descriptor_timeout_ms() const { return at<9>().as_uint32(); }
+  bool has_unwind_state_clear_period_ms() const { return at<10>().valid(); }
+  uint32_t unwind_state_clear_period_ms() const { return at<10>().as_uint32(); }
+  bool has_all_cpus() const { return at<1>().valid(); }
+  bool all_cpus() const { return at<1>().as_bool(); }
+  bool has_sampling_frequency() const { return at<2>().valid(); }
+  uint32_t sampling_frequency() const { return at<2>().as_uint32(); }
+  bool has_kernel_frames() const { return at<12>().valid(); }
+  bool kernel_frames() const { return at<12>().as_bool(); }
+  bool has_target_pid() const { return at<4>().valid(); }
+  ::protozero::RepeatedFieldIterator<int32_t> target_pid() const { return GetRepeated<int32_t>(4); }
+  bool has_target_cmdline() const { return at<5>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> target_cmdline() const { return GetRepeated<::protozero::ConstChars>(5); }
+  bool has_target_installed_by() const { return at<18>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> target_installed_by() const { return GetRepeated<::protozero::ConstChars>(18); }
+  bool has_exclude_pid() const { return at<6>().valid(); }
+  ::protozero::RepeatedFieldIterator<int32_t> exclude_pid() const { return GetRepeated<int32_t>(6); }
+  bool has_exclude_cmdline() const { return at<7>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> exclude_cmdline() const { return GetRepeated<::protozero::ConstChars>(7); }
+  bool has_additional_cmdline_count() const { return at<11>().valid(); }
+  uint32_t additional_cmdline_count() const { return at<11>().as_uint32(); }
+};
+
+class PerfEventConfig : public ::protozero::Message {
+ public:
+  using Decoder = PerfEventConfig_Decoder;
+  enum : int32_t {
+    kTimebaseFieldNumber = 15,
+    kCallstackSamplingFieldNumber = 16,
+    kRingBufferReadPeriodMsFieldNumber = 8,
+    kRingBufferPagesFieldNumber = 3,
+    kMaxEnqueuedFootprintKbFieldNumber = 17,
+    kMaxDaemonMemoryKbFieldNumber = 13,
+    kRemoteDescriptorTimeoutMsFieldNumber = 9,
+    kUnwindStateClearPeriodMsFieldNumber = 10,
+    kAllCpusFieldNumber = 1,
+    kSamplingFrequencyFieldNumber = 2,
+    kKernelFramesFieldNumber = 12,
+    kTargetPidFieldNumber = 4,
+    kTargetCmdlineFieldNumber = 5,
+    kTargetInstalledByFieldNumber = 18,
+    kExcludePidFieldNumber = 6,
+    kExcludeCmdlineFieldNumber = 7,
+    kAdditionalCmdlineCountFieldNumber = 11,
+  };
+  using CallstackSampling = ::perfetto::protos::pbzero::PerfEventConfig_CallstackSampling;
+  using Scope = ::perfetto::protos::pbzero::PerfEventConfig_Scope;
+
+  using FieldMetadata_Timebase =
+    ::protozero::proto_utils::FieldMetadata<
+      15,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      PerfEvents_Timebase,
+      PerfEventConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Timebase kTimebase() { return {}; }
+  template <typename T = PerfEvents_Timebase> T* set_timebase() {
+    return BeginNestedMessage<T>(15);
+  }
+
+
+  using FieldMetadata_CallstackSampling =
+    ::protozero::proto_utils::FieldMetadata<
+      16,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      PerfEventConfig_CallstackSampling,
+      PerfEventConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CallstackSampling kCallstackSampling() { return {}; }
+  template <typename T = PerfEventConfig_CallstackSampling> T* set_callstack_sampling() {
+    return BeginNestedMessage<T>(16);
+  }
+
+
+  using FieldMetadata_RingBufferReadPeriodMs =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      PerfEventConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RingBufferReadPeriodMs kRingBufferReadPeriodMs() { return {}; }
+  void set_ring_buffer_read_period_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_RingBufferReadPeriodMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_RingBufferPages =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      PerfEventConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RingBufferPages kRingBufferPages() { return {}; }
+  void set_ring_buffer_pages(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_RingBufferPages::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MaxEnqueuedFootprintKb =
+    ::protozero::proto_utils::FieldMetadata<
+      17,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      PerfEventConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MaxEnqueuedFootprintKb kMaxEnqueuedFootprintKb() { return {}; }
+  void set_max_enqueued_footprint_kb(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MaxEnqueuedFootprintKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MaxDaemonMemoryKb =
+    ::protozero::proto_utils::FieldMetadata<
+      13,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      PerfEventConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MaxDaemonMemoryKb kMaxDaemonMemoryKb() { return {}; }
+  void set_max_daemon_memory_kb(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MaxDaemonMemoryKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_RemoteDescriptorTimeoutMs =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      PerfEventConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RemoteDescriptorTimeoutMs kRemoteDescriptorTimeoutMs() { return {}; }
+  void set_remote_descriptor_timeout_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_RemoteDescriptorTimeoutMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_UnwindStateClearPeriodMs =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      PerfEventConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UnwindStateClearPeriodMs kUnwindStateClearPeriodMs() { return {}; }
+  void set_unwind_state_clear_period_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_UnwindStateClearPeriodMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_AllCpus =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      PerfEventConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AllCpus kAllCpus() { return {}; }
+  void set_all_cpus(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_AllCpus::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SamplingFrequency =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      PerfEventConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SamplingFrequency kSamplingFrequency() { return {}; }
+  void set_sampling_frequency(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SamplingFrequency::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_KernelFrames =
+    ::protozero::proto_utils::FieldMetadata<
+      12,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      PerfEventConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_KernelFrames kKernelFrames() { return {}; }
+  void set_kernel_frames(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_KernelFrames::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TargetPid =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      PerfEventConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TargetPid kTargetPid() { return {}; }
+  void add_target_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TargetPid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TargetCmdline =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      PerfEventConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TargetCmdline kTargetCmdline() { return {}; }
+  void add_target_cmdline(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_TargetCmdline::kFieldId, data, size);
+  }
+  void add_target_cmdline(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_TargetCmdline::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TargetInstalledBy =
+    ::protozero::proto_utils::FieldMetadata<
+      18,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      PerfEventConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TargetInstalledBy kTargetInstalledBy() { return {}; }
+  void add_target_installed_by(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_TargetInstalledBy::kFieldId, data, size);
+  }
+  void add_target_installed_by(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_TargetInstalledBy::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ExcludePid =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      PerfEventConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ExcludePid kExcludePid() { return {}; }
+  void add_exclude_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ExcludePid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ExcludeCmdline =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      PerfEventConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ExcludeCmdline kExcludeCmdline() { return {}; }
+  void add_exclude_cmdline(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ExcludeCmdline::kFieldId, data, size);
+  }
+  void add_exclude_cmdline(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ExcludeCmdline::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_AdditionalCmdlineCount =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      PerfEventConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AdditionalCmdlineCount kAdditionalCmdlineCount() { return {}; }
+  void set_additional_cmdline_count(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_AdditionalCmdlineCount::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class PerfEventConfig_Scope_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  PerfEventConfig_Scope_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit PerfEventConfig_Scope_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit PerfEventConfig_Scope_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_target_pid() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<int32_t> target_pid() const { return GetRepeated<int32_t>(1); }
+  bool has_target_cmdline() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> target_cmdline() const { return GetRepeated<::protozero::ConstChars>(2); }
+  bool has_exclude_pid() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<int32_t> exclude_pid() const { return GetRepeated<int32_t>(3); }
+  bool has_exclude_cmdline() const { return at<4>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> exclude_cmdline() const { return GetRepeated<::protozero::ConstChars>(4); }
+  bool has_additional_cmdline_count() const { return at<5>().valid(); }
+  uint32_t additional_cmdline_count() const { return at<5>().as_uint32(); }
+};
+
+class PerfEventConfig_Scope : public ::protozero::Message {
+ public:
+  using Decoder = PerfEventConfig_Scope_Decoder;
+  enum : int32_t {
+    kTargetPidFieldNumber = 1,
+    kTargetCmdlineFieldNumber = 2,
+    kExcludePidFieldNumber = 3,
+    kExcludeCmdlineFieldNumber = 4,
+    kAdditionalCmdlineCountFieldNumber = 5,
+  };
+
+  using FieldMetadata_TargetPid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      PerfEventConfig_Scope>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TargetPid kTargetPid() { return {}; }
+  void add_target_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TargetPid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TargetCmdline =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      PerfEventConfig_Scope>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TargetCmdline kTargetCmdline() { return {}; }
+  void add_target_cmdline(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_TargetCmdline::kFieldId, data, size);
+  }
+  void add_target_cmdline(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_TargetCmdline::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ExcludePid =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      PerfEventConfig_Scope>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ExcludePid kExcludePid() { return {}; }
+  void add_exclude_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ExcludePid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ExcludeCmdline =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      PerfEventConfig_Scope>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ExcludeCmdline kExcludeCmdline() { return {}; }
+  void add_exclude_cmdline(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ExcludeCmdline::kFieldId, data, size);
+  }
+  void add_exclude_cmdline(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ExcludeCmdline::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_AdditionalCmdlineCount =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      PerfEventConfig_Scope>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AdditionalCmdlineCount kAdditionalCmdlineCount() { return {}; }
+  void set_additional_cmdline_count(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_AdditionalCmdlineCount::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class PerfEventConfig_CallstackSampling_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  PerfEventConfig_CallstackSampling_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit PerfEventConfig_CallstackSampling_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit PerfEventConfig_CallstackSampling_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_scope() const { return at<1>().valid(); }
+  ::protozero::ConstBytes scope() const { return at<1>().as_bytes(); }
+  bool has_kernel_frames() const { return at<2>().valid(); }
+  bool kernel_frames() const { return at<2>().as_bool(); }
+};
+
+class PerfEventConfig_CallstackSampling : public ::protozero::Message {
+ public:
+  using Decoder = PerfEventConfig_CallstackSampling_Decoder;
+  enum : int32_t {
+    kScopeFieldNumber = 1,
+    kKernelFramesFieldNumber = 2,
+  };
+
+  using FieldMetadata_Scope =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      PerfEventConfig_Scope,
+      PerfEventConfig_CallstackSampling>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Scope kScope() { return {}; }
+  template <typename T = PerfEventConfig_Scope> T* set_scope() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_KernelFrames =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      PerfEventConfig_CallstackSampling>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_KernelFrames kKernelFrames() { return {}; }
+  void set_kernel_frames(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_KernelFrames::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/config/sys_stats/sys_stats_config.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_SYS_STATS_SYS_STATS_CONFIG_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_SYS_STATS_SYS_STATS_CONFIG_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+enum MeminfoCounters : int32_t;
+enum SysStatsConfig_StatCounters : int32_t;
+enum VmstatCounters : int32_t;
+
+enum SysStatsConfig_StatCounters : int32_t {
+  SysStatsConfig_StatCounters_STAT_UNSPECIFIED = 0,
+  SysStatsConfig_StatCounters_STAT_CPU_TIMES = 1,
+  SysStatsConfig_StatCounters_STAT_IRQ_COUNTS = 2,
+  SysStatsConfig_StatCounters_STAT_SOFTIRQ_COUNTS = 3,
+  SysStatsConfig_StatCounters_STAT_FORK_COUNT = 4,
+};
+
+const SysStatsConfig_StatCounters SysStatsConfig_StatCounters_MIN = SysStatsConfig_StatCounters_STAT_UNSPECIFIED;
+const SysStatsConfig_StatCounters SysStatsConfig_StatCounters_MAX = SysStatsConfig_StatCounters_STAT_FORK_COUNT;
+
+class SysStatsConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  SysStatsConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SysStatsConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SysStatsConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_meminfo_period_ms() const { return at<1>().valid(); }
+  uint32_t meminfo_period_ms() const { return at<1>().as_uint32(); }
+  bool has_meminfo_counters() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<int32_t> meminfo_counters() const { return GetRepeated<int32_t>(2); }
+  bool has_vmstat_period_ms() const { return at<3>().valid(); }
+  uint32_t vmstat_period_ms() const { return at<3>().as_uint32(); }
+  bool has_vmstat_counters() const { return at<4>().valid(); }
+  ::protozero::RepeatedFieldIterator<int32_t> vmstat_counters() const { return GetRepeated<int32_t>(4); }
+  bool has_stat_period_ms() const { return at<5>().valid(); }
+  uint32_t stat_period_ms() const { return at<5>().as_uint32(); }
+  bool has_stat_counters() const { return at<6>().valid(); }
+  ::protozero::RepeatedFieldIterator<int32_t> stat_counters() const { return GetRepeated<int32_t>(6); }
+  bool has_devfreq_period_ms() const { return at<7>().valid(); }
+  uint32_t devfreq_period_ms() const { return at<7>().as_uint32(); }
+};
+
+class SysStatsConfig : public ::protozero::Message {
+ public:
+  using Decoder = SysStatsConfig_Decoder;
+  enum : int32_t {
+    kMeminfoPeriodMsFieldNumber = 1,
+    kMeminfoCountersFieldNumber = 2,
+    kVmstatPeriodMsFieldNumber = 3,
+    kVmstatCountersFieldNumber = 4,
+    kStatPeriodMsFieldNumber = 5,
+    kStatCountersFieldNumber = 6,
+    kDevfreqPeriodMsFieldNumber = 7,
+  };
+  using StatCounters = ::perfetto::protos::pbzero::SysStatsConfig_StatCounters;
+  static const StatCounters STAT_UNSPECIFIED = SysStatsConfig_StatCounters_STAT_UNSPECIFIED;
+  static const StatCounters STAT_CPU_TIMES = SysStatsConfig_StatCounters_STAT_CPU_TIMES;
+  static const StatCounters STAT_IRQ_COUNTS = SysStatsConfig_StatCounters_STAT_IRQ_COUNTS;
+  static const StatCounters STAT_SOFTIRQ_COUNTS = SysStatsConfig_StatCounters_STAT_SOFTIRQ_COUNTS;
+  static const StatCounters STAT_FORK_COUNT = SysStatsConfig_StatCounters_STAT_FORK_COUNT;
+
+  using FieldMetadata_MeminfoPeriodMs =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SysStatsConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MeminfoPeriodMs kMeminfoPeriodMs() { return {}; }
+  void set_meminfo_period_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MeminfoPeriodMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MeminfoCounters =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::MeminfoCounters,
+      SysStatsConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MeminfoCounters kMeminfoCounters() { return {}; }
+  void add_meminfo_counters(::perfetto::protos::pbzero::MeminfoCounters value) {
+    static constexpr uint32_t field_id = FieldMetadata_MeminfoCounters::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_VmstatPeriodMs =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SysStatsConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_VmstatPeriodMs kVmstatPeriodMs() { return {}; }
+  void set_vmstat_period_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_VmstatPeriodMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_VmstatCounters =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::VmstatCounters,
+      SysStatsConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_VmstatCounters kVmstatCounters() { return {}; }
+  void add_vmstat_counters(::perfetto::protos::pbzero::VmstatCounters value) {
+    static constexpr uint32_t field_id = FieldMetadata_VmstatCounters::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_StatPeriodMs =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SysStatsConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StatPeriodMs kStatPeriodMs() { return {}; }
+  void set_stat_period_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_StatPeriodMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_StatCounters =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::SysStatsConfig_StatCounters,
+      SysStatsConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StatCounters kStatCounters() { return {}; }
+  void add_stat_counters(::perfetto::protos::pbzero::SysStatsConfig_StatCounters value) {
+    static constexpr uint32_t field_id = FieldMetadata_StatCounters::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DevfreqPeriodMs =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SysStatsConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DevfreqPeriodMs kDevfreqPeriodMs() { return {}; }
+  void set_devfreq_period_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DevfreqPeriodMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/config/track_event/track_event_config.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACK_EVENT_TRACK_EVENT_CONFIG_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACK_EVENT_TRACK_EVENT_CONFIG_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class TrackEventConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  TrackEventConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TrackEventConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TrackEventConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_disabled_categories() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> disabled_categories() const { return GetRepeated<::protozero::ConstChars>(1); }
+  bool has_enabled_categories() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> enabled_categories() const { return GetRepeated<::protozero::ConstChars>(2); }
+  bool has_disabled_tags() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> disabled_tags() const { return GetRepeated<::protozero::ConstChars>(3); }
+  bool has_enabled_tags() const { return at<4>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> enabled_tags() const { return GetRepeated<::protozero::ConstChars>(4); }
+};
+
+class TrackEventConfig : public ::protozero::Message {
+ public:
+  using Decoder = TrackEventConfig_Decoder;
+  enum : int32_t {
+    kDisabledCategoriesFieldNumber = 1,
+    kEnabledCategoriesFieldNumber = 2,
+    kDisabledTagsFieldNumber = 3,
+    kEnabledTagsFieldNumber = 4,
+  };
+
+  using FieldMetadata_DisabledCategories =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TrackEventConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DisabledCategories kDisabledCategories() { return {}; }
+  void add_disabled_categories(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_DisabledCategories::kFieldId, data, size);
+  }
+  void add_disabled_categories(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_DisabledCategories::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_EnabledCategories =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TrackEventConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EnabledCategories kEnabledCategories() { return {}; }
+  void add_enabled_categories(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_EnabledCategories::kFieldId, data, size);
+  }
+  void add_enabled_categories(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_EnabledCategories::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DisabledTags =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TrackEventConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DisabledTags kDisabledTags() { return {}; }
+  void add_disabled_tags(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_DisabledTags::kFieldId, data, size);
+  }
+  void add_disabled_tags(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_DisabledTags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_EnabledTags =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TrackEventConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EnabledTags kEnabledTags() { return {}; }
+  void add_enabled_tags(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_EnabledTags::kFieldId, data, size);
+  }
+  void add_enabled_tags(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_EnabledTags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/config/chrome/chrome_config.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_CHROME_CHROME_CONFIG_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_CHROME_CHROME_CONFIG_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+enum ChromeConfig_ClientPriority : int32_t;
+
+enum ChromeConfig_ClientPriority : int32_t {
+  ChromeConfig_ClientPriority_UNKNOWN = 0,
+  ChromeConfig_ClientPriority_BACKGROUND = 1,
+  ChromeConfig_ClientPriority_USER_INITIATED = 2,
+};
+
+const ChromeConfig_ClientPriority ChromeConfig_ClientPriority_MIN = ChromeConfig_ClientPriority_UNKNOWN;
+const ChromeConfig_ClientPriority ChromeConfig_ClientPriority_MAX = ChromeConfig_ClientPriority_USER_INITIATED;
+
+class ChromeConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ChromeConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ChromeConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ChromeConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_trace_config() const { return at<1>().valid(); }
+  ::protozero::ConstChars trace_config() const { return at<1>().as_string(); }
+  bool has_privacy_filtering_enabled() const { return at<2>().valid(); }
+  bool privacy_filtering_enabled() const { return at<2>().as_bool(); }
+  bool has_convert_to_legacy_json() const { return at<3>().valid(); }
+  bool convert_to_legacy_json() const { return at<3>().as_bool(); }
+  bool has_client_priority() const { return at<4>().valid(); }
+  int32_t client_priority() const { return at<4>().as_int32(); }
+  bool has_json_agent_label_filter() const { return at<5>().valid(); }
+  ::protozero::ConstChars json_agent_label_filter() const { return at<5>().as_string(); }
+};
+
+class ChromeConfig : public ::protozero::Message {
+ public:
+  using Decoder = ChromeConfig_Decoder;
+  enum : int32_t {
+    kTraceConfigFieldNumber = 1,
+    kPrivacyFilteringEnabledFieldNumber = 2,
+    kConvertToLegacyJsonFieldNumber = 3,
+    kClientPriorityFieldNumber = 4,
+    kJsonAgentLabelFilterFieldNumber = 5,
+  };
+  using ClientPriority = ::perfetto::protos::pbzero::ChromeConfig_ClientPriority;
+  static const ClientPriority UNKNOWN = ChromeConfig_ClientPriority_UNKNOWN;
+  static const ClientPriority BACKGROUND = ChromeConfig_ClientPriority_BACKGROUND;
+  static const ClientPriority USER_INITIATED = ChromeConfig_ClientPriority_USER_INITIATED;
+
+  using FieldMetadata_TraceConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ChromeConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TraceConfig kTraceConfig() { return {}; }
+  void set_trace_config(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_TraceConfig::kFieldId, data, size);
+  }
+  void set_trace_config(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_TraceConfig::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PrivacyFilteringEnabled =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PrivacyFilteringEnabled kPrivacyFilteringEnabled() { return {}; }
+  void set_privacy_filtering_enabled(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_PrivacyFilteringEnabled::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ConvertToLegacyJson =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ConvertToLegacyJson kConvertToLegacyJson() { return {}; }
+  void set_convert_to_legacy_json(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_ConvertToLegacyJson::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ClientPriority =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ChromeConfig_ClientPriority,
+      ChromeConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ClientPriority kClientPriority() { return {}; }
+  void set_client_priority(::perfetto::protos::pbzero::ChromeConfig_ClientPriority value) {
+    static constexpr uint32_t field_id = FieldMetadata_ClientPriority::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_JsonAgentLabelFilter =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ChromeConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_JsonAgentLabelFilter kJsonAgentLabelFilter() { return {}; }
+  void set_json_agent_label_filter(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_JsonAgentLabelFilter::kFieldId, data, size);
+  }
+  void set_json_agent_label_filter(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_JsonAgentLabelFilter::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/config/data_source_config.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_DATA_SOURCE_CONFIG_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_DATA_SOURCE_CONFIG_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class AndroidLogConfig;
+class AndroidPolledStateConfig;
+class AndroidPowerConfig;
+class ChromeConfig;
+class FtraceConfig;
+class GpuCounterConfig;
+class HeapprofdConfig;
+class InodeFileConfig;
+class InterceptorConfig;
+class JavaHprofConfig;
+class PackagesListConfig;
+class PerfEventConfig;
+class ProcessStatsConfig;
+class SysStatsConfig;
+class TestConfig;
+class TrackEventConfig;
+class VulkanMemoryConfig;
+enum DataSourceConfig_SessionInitiator : int32_t;
+
+enum DataSourceConfig_SessionInitiator : int32_t {
+  DataSourceConfig_SessionInitiator_SESSION_INITIATOR_UNSPECIFIED = 0,
+  DataSourceConfig_SessionInitiator_SESSION_INITIATOR_TRUSTED_SYSTEM = 1,
+};
+
+const DataSourceConfig_SessionInitiator DataSourceConfig_SessionInitiator_MIN = DataSourceConfig_SessionInitiator_SESSION_INITIATOR_UNSPECIFIED;
+const DataSourceConfig_SessionInitiator DataSourceConfig_SessionInitiator_MAX = DataSourceConfig_SessionInitiator_SESSION_INITIATOR_TRUSTED_SYSTEM;
+
+class DataSourceConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/115, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  DataSourceConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit DataSourceConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit DataSourceConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_target_buffer() const { return at<2>().valid(); }
+  uint32_t target_buffer() const { return at<2>().as_uint32(); }
+  bool has_trace_duration_ms() const { return at<3>().valid(); }
+  uint32_t trace_duration_ms() const { return at<3>().as_uint32(); }
+  bool has_stop_timeout_ms() const { return at<7>().valid(); }
+  uint32_t stop_timeout_ms() const { return at<7>().as_uint32(); }
+  bool has_enable_extra_guardrails() const { return at<6>().valid(); }
+  bool enable_extra_guardrails() const { return at<6>().as_bool(); }
+  bool has_session_initiator() const { return at<8>().valid(); }
+  int32_t session_initiator() const { return at<8>().as_int32(); }
+  bool has_tracing_session_id() const { return at<4>().valid(); }
+  uint64_t tracing_session_id() const { return at<4>().as_uint64(); }
+  bool has_ftrace_config() const { return at<100>().valid(); }
+  ::protozero::ConstBytes ftrace_config() const { return at<100>().as_bytes(); }
+  bool has_inode_file_config() const { return at<102>().valid(); }
+  ::protozero::ConstBytes inode_file_config() const { return at<102>().as_bytes(); }
+  bool has_process_stats_config() const { return at<103>().valid(); }
+  ::protozero::ConstBytes process_stats_config() const { return at<103>().as_bytes(); }
+  bool has_sys_stats_config() const { return at<104>().valid(); }
+  ::protozero::ConstBytes sys_stats_config() const { return at<104>().as_bytes(); }
+  bool has_heapprofd_config() const { return at<105>().valid(); }
+  ::protozero::ConstBytes heapprofd_config() const { return at<105>().as_bytes(); }
+  bool has_java_hprof_config() const { return at<110>().valid(); }
+  ::protozero::ConstBytes java_hprof_config() const { return at<110>().as_bytes(); }
+  bool has_android_power_config() const { return at<106>().valid(); }
+  ::protozero::ConstBytes android_power_config() const { return at<106>().as_bytes(); }
+  bool has_android_log_config() const { return at<107>().valid(); }
+  ::protozero::ConstBytes android_log_config() const { return at<107>().as_bytes(); }
+  bool has_gpu_counter_config() const { return at<108>().valid(); }
+  ::protozero::ConstBytes gpu_counter_config() const { return at<108>().as_bytes(); }
+  bool has_packages_list_config() const { return at<109>().valid(); }
+  ::protozero::ConstBytes packages_list_config() const { return at<109>().as_bytes(); }
+  bool has_perf_event_config() const { return at<111>().valid(); }
+  ::protozero::ConstBytes perf_event_config() const { return at<111>().as_bytes(); }
+  bool has_vulkan_memory_config() const { return at<112>().valid(); }
+  ::protozero::ConstBytes vulkan_memory_config() const { return at<112>().as_bytes(); }
+  bool has_track_event_config() const { return at<113>().valid(); }
+  ::protozero::ConstBytes track_event_config() const { return at<113>().as_bytes(); }
+  bool has_android_polled_state_config() const { return at<114>().valid(); }
+  ::protozero::ConstBytes android_polled_state_config() const { return at<114>().as_bytes(); }
+  bool has_chrome_config() const { return at<101>().valid(); }
+  ::protozero::ConstBytes chrome_config() const { return at<101>().as_bytes(); }
+  bool has_interceptor_config() const { return at<115>().valid(); }
+  ::protozero::ConstBytes interceptor_config() const { return at<115>().as_bytes(); }
+  // field legacy_config omitted because its id is too high
+  // field for_testing omitted because its id is too high
+};
+
+class DataSourceConfig : public ::protozero::Message {
+ public:
+  using Decoder = DataSourceConfig_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kTargetBufferFieldNumber = 2,
+    kTraceDurationMsFieldNumber = 3,
+    kStopTimeoutMsFieldNumber = 7,
+    kEnableExtraGuardrailsFieldNumber = 6,
+    kSessionInitiatorFieldNumber = 8,
+    kTracingSessionIdFieldNumber = 4,
+    kFtraceConfigFieldNumber = 100,
+    kInodeFileConfigFieldNumber = 102,
+    kProcessStatsConfigFieldNumber = 103,
+    kSysStatsConfigFieldNumber = 104,
+    kHeapprofdConfigFieldNumber = 105,
+    kJavaHprofConfigFieldNumber = 110,
+    kAndroidPowerConfigFieldNumber = 106,
+    kAndroidLogConfigFieldNumber = 107,
+    kGpuCounterConfigFieldNumber = 108,
+    kPackagesListConfigFieldNumber = 109,
+    kPerfEventConfigFieldNumber = 111,
+    kVulkanMemoryConfigFieldNumber = 112,
+    kTrackEventConfigFieldNumber = 113,
+    kAndroidPolledStateConfigFieldNumber = 114,
+    kChromeConfigFieldNumber = 101,
+    kInterceptorConfigFieldNumber = 115,
+    kLegacyConfigFieldNumber = 1000,
+    kForTestingFieldNumber = 1001,
+  };
+  using SessionInitiator = ::perfetto::protos::pbzero::DataSourceConfig_SessionInitiator;
+  static const SessionInitiator SESSION_INITIATOR_UNSPECIFIED = DataSourceConfig_SessionInitiator_SESSION_INITIATOR_UNSPECIFIED;
+  static const SessionInitiator SESSION_INITIATOR_TRUSTED_SYSTEM = DataSourceConfig_SessionInitiator_SESSION_INITIATOR_TRUSTED_SYSTEM;
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      DataSourceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TargetBuffer =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      DataSourceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TargetBuffer kTargetBuffer() { return {}; }
+  void set_target_buffer(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TargetBuffer::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TraceDurationMs =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      DataSourceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TraceDurationMs kTraceDurationMs() { return {}; }
+  void set_trace_duration_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TraceDurationMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_StopTimeoutMs =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      DataSourceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StopTimeoutMs kStopTimeoutMs() { return {}; }
+  void set_stop_timeout_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_StopTimeoutMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_EnableExtraGuardrails =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      DataSourceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EnableExtraGuardrails kEnableExtraGuardrails() { return {}; }
+  void set_enable_extra_guardrails(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_EnableExtraGuardrails::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SessionInitiator =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::DataSourceConfig_SessionInitiator,
+      DataSourceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SessionInitiator kSessionInitiator() { return {}; }
+  void set_session_initiator(::perfetto::protos::pbzero::DataSourceConfig_SessionInitiator value) {
+    static constexpr uint32_t field_id = FieldMetadata_SessionInitiator::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TracingSessionId =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      DataSourceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TracingSessionId kTracingSessionId() { return {}; }
+  void set_tracing_session_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TracingSessionId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FtraceConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      100,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      FtraceConfig,
+      DataSourceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FtraceConfig kFtraceConfig() { return {}; }
+  template <typename T = FtraceConfig> T* set_ftrace_config() {
+    return BeginNestedMessage<T>(100);
+  }
+
+  void set_ftrace_config_raw(const std::string& raw) {
+    return AppendBytes(100, raw.data(), raw.size());
+  }
+
+
+  using FieldMetadata_InodeFileConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      102,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      InodeFileConfig,
+      DataSourceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_InodeFileConfig kInodeFileConfig() { return {}; }
+  template <typename T = InodeFileConfig> T* set_inode_file_config() {
+    return BeginNestedMessage<T>(102);
+  }
+
+  void set_inode_file_config_raw(const std::string& raw) {
+    return AppendBytes(102, raw.data(), raw.size());
+  }
+
+
+  using FieldMetadata_ProcessStatsConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      103,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ProcessStatsConfig,
+      DataSourceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProcessStatsConfig kProcessStatsConfig() { return {}; }
+  template <typename T = ProcessStatsConfig> T* set_process_stats_config() {
+    return BeginNestedMessage<T>(103);
+  }
+
+  void set_process_stats_config_raw(const std::string& raw) {
+    return AppendBytes(103, raw.data(), raw.size());
+  }
+
+
+  using FieldMetadata_SysStatsConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      104,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SysStatsConfig,
+      DataSourceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SysStatsConfig kSysStatsConfig() { return {}; }
+  template <typename T = SysStatsConfig> T* set_sys_stats_config() {
+    return BeginNestedMessage<T>(104);
+  }
+
+  void set_sys_stats_config_raw(const std::string& raw) {
+    return AppendBytes(104, raw.data(), raw.size());
+  }
+
+
+  using FieldMetadata_HeapprofdConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      105,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      HeapprofdConfig,
+      DataSourceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HeapprofdConfig kHeapprofdConfig() { return {}; }
+  template <typename T = HeapprofdConfig> T* set_heapprofd_config() {
+    return BeginNestedMessage<T>(105);
+  }
+
+  void set_heapprofd_config_raw(const std::string& raw) {
+    return AppendBytes(105, raw.data(), raw.size());
+  }
+
+
+  using FieldMetadata_JavaHprofConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      110,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      JavaHprofConfig,
+      DataSourceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_JavaHprofConfig kJavaHprofConfig() { return {}; }
+  template <typename T = JavaHprofConfig> T* set_java_hprof_config() {
+    return BeginNestedMessage<T>(110);
+  }
+
+  void set_java_hprof_config_raw(const std::string& raw) {
+    return AppendBytes(110, raw.data(), raw.size());
+  }
+
+
+  using FieldMetadata_AndroidPowerConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      106,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      AndroidPowerConfig,
+      DataSourceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AndroidPowerConfig kAndroidPowerConfig() { return {}; }
+  template <typename T = AndroidPowerConfig> T* set_android_power_config() {
+    return BeginNestedMessage<T>(106);
+  }
+
+  void set_android_power_config_raw(const std::string& raw) {
+    return AppendBytes(106, raw.data(), raw.size());
+  }
+
+
+  using FieldMetadata_AndroidLogConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      107,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      AndroidLogConfig,
+      DataSourceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AndroidLogConfig kAndroidLogConfig() { return {}; }
+  template <typename T = AndroidLogConfig> T* set_android_log_config() {
+    return BeginNestedMessage<T>(107);
+  }
+
+  void set_android_log_config_raw(const std::string& raw) {
+    return AppendBytes(107, raw.data(), raw.size());
+  }
+
+
+  using FieldMetadata_GpuCounterConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      108,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      GpuCounterConfig,
+      DataSourceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GpuCounterConfig kGpuCounterConfig() { return {}; }
+  template <typename T = GpuCounterConfig> T* set_gpu_counter_config() {
+    return BeginNestedMessage<T>(108);
+  }
+
+  void set_gpu_counter_config_raw(const std::string& raw) {
+    return AppendBytes(108, raw.data(), raw.size());
+  }
+
+
+  using FieldMetadata_PackagesListConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      109,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      PackagesListConfig,
+      DataSourceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PackagesListConfig kPackagesListConfig() { return {}; }
+  template <typename T = PackagesListConfig> T* set_packages_list_config() {
+    return BeginNestedMessage<T>(109);
+  }
+
+  void set_packages_list_config_raw(const std::string& raw) {
+    return AppendBytes(109, raw.data(), raw.size());
+  }
+
+
+  using FieldMetadata_PerfEventConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      111,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      PerfEventConfig,
+      DataSourceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PerfEventConfig kPerfEventConfig() { return {}; }
+  template <typename T = PerfEventConfig> T* set_perf_event_config() {
+    return BeginNestedMessage<T>(111);
+  }
+
+  void set_perf_event_config_raw(const std::string& raw) {
+    return AppendBytes(111, raw.data(), raw.size());
+  }
+
+
+  using FieldMetadata_VulkanMemoryConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      112,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      VulkanMemoryConfig,
+      DataSourceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_VulkanMemoryConfig kVulkanMemoryConfig() { return {}; }
+  template <typename T = VulkanMemoryConfig> T* set_vulkan_memory_config() {
+    return BeginNestedMessage<T>(112);
+  }
+
+  void set_vulkan_memory_config_raw(const std::string& raw) {
+    return AppendBytes(112, raw.data(), raw.size());
+  }
+
+
+  using FieldMetadata_TrackEventConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      113,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TrackEventConfig,
+      DataSourceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TrackEventConfig kTrackEventConfig() { return {}; }
+  template <typename T = TrackEventConfig> T* set_track_event_config() {
+    return BeginNestedMessage<T>(113);
+  }
+
+  void set_track_event_config_raw(const std::string& raw) {
+    return AppendBytes(113, raw.data(), raw.size());
+  }
+
+
+  using FieldMetadata_AndroidPolledStateConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      114,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      AndroidPolledStateConfig,
+      DataSourceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AndroidPolledStateConfig kAndroidPolledStateConfig() { return {}; }
+  template <typename T = AndroidPolledStateConfig> T* set_android_polled_state_config() {
+    return BeginNestedMessage<T>(114);
+  }
+
+  void set_android_polled_state_config_raw(const std::string& raw) {
+    return AppendBytes(114, raw.data(), raw.size());
+  }
+
+
+  using FieldMetadata_ChromeConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      101,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeConfig,
+      DataSourceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeConfig kChromeConfig() { return {}; }
+  template <typename T = ChromeConfig> T* set_chrome_config() {
+    return BeginNestedMessage<T>(101);
+  }
+
+
+  using FieldMetadata_InterceptorConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      115,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      InterceptorConfig,
+      DataSourceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_InterceptorConfig kInterceptorConfig() { return {}; }
+  template <typename T = InterceptorConfig> T* set_interceptor_config() {
+    return BeginNestedMessage<T>(115);
+  }
+
+
+  using FieldMetadata_LegacyConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      1000,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      DataSourceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LegacyConfig kLegacyConfig() { return {}; }
+  void set_legacy_config(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_LegacyConfig::kFieldId, data, size);
+  }
+  void set_legacy_config(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_LegacyConfig::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ForTesting =
+    ::protozero::proto_utils::FieldMetadata<
+      1001,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TestConfig,
+      DataSourceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ForTesting kForTesting() { return {}; }
+  template <typename T = TestConfig> T* set_for_testing() {
+    return BeginNestedMessage<T>(1001);
+  }
+
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/config/interceptor_config.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INTERCEPTOR_CONFIG_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INTERCEPTOR_CONFIG_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class ConsoleConfig;
+
+class InterceptorConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/100, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  InterceptorConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit InterceptorConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit InterceptorConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_console_config() const { return at<100>().valid(); }
+  ::protozero::ConstBytes console_config() const { return at<100>().as_bytes(); }
+};
+
+class InterceptorConfig : public ::protozero::Message {
+ public:
+  using Decoder = InterceptorConfig_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kConsoleConfigFieldNumber = 100,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      InterceptorConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ConsoleConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      100,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ConsoleConfig,
+      InterceptorConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ConsoleConfig kConsoleConfig() { return {}; }
+  template <typename T = ConsoleConfig> T* set_console_config() {
+    return BeginNestedMessage<T>(100);
+  }
+
+  void set_console_config_raw(const std::string& raw) {
+    return AppendBytes(100, raw.data(), raw.size());
+  }
+
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/config/stress_test_config.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_STRESS_TEST_CONFIG_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_STRESS_TEST_CONFIG_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class StressTestConfig_WriterTiming;
+class TraceConfig;
+
+class StressTestConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/11, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  StressTestConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit StressTestConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit StressTestConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_trace_config() const { return at<1>().valid(); }
+  ::protozero::ConstBytes trace_config() const { return at<1>().as_bytes(); }
+  bool has_shmem_size_kb() const { return at<2>().valid(); }
+  uint32_t shmem_size_kb() const { return at<2>().as_uint32(); }
+  bool has_shmem_page_size_kb() const { return at<3>().valid(); }
+  uint32_t shmem_page_size_kb() const { return at<3>().as_uint32(); }
+  bool has_num_processes() const { return at<4>().valid(); }
+  uint32_t num_processes() const { return at<4>().as_uint32(); }
+  bool has_num_threads() const { return at<5>().valid(); }
+  uint32_t num_threads() const { return at<5>().as_uint32(); }
+  bool has_max_events() const { return at<6>().valid(); }
+  uint32_t max_events() const { return at<6>().as_uint32(); }
+  bool has_nesting() const { return at<7>().valid(); }
+  uint32_t nesting() const { return at<7>().as_uint32(); }
+  bool has_steady_state_timings() const { return at<8>().valid(); }
+  ::protozero::ConstBytes steady_state_timings() const { return at<8>().as_bytes(); }
+  bool has_burst_period_ms() const { return at<9>().valid(); }
+  uint32_t burst_period_ms() const { return at<9>().as_uint32(); }
+  bool has_burst_duration_ms() const { return at<10>().valid(); }
+  uint32_t burst_duration_ms() const { return at<10>().as_uint32(); }
+  bool has_burst_timings() const { return at<11>().valid(); }
+  ::protozero::ConstBytes burst_timings() const { return at<11>().as_bytes(); }
+};
+
+class StressTestConfig : public ::protozero::Message {
+ public:
+  using Decoder = StressTestConfig_Decoder;
+  enum : int32_t {
+    kTraceConfigFieldNumber = 1,
+    kShmemSizeKbFieldNumber = 2,
+    kShmemPageSizeKbFieldNumber = 3,
+    kNumProcessesFieldNumber = 4,
+    kNumThreadsFieldNumber = 5,
+    kMaxEventsFieldNumber = 6,
+    kNestingFieldNumber = 7,
+    kSteadyStateTimingsFieldNumber = 8,
+    kBurstPeriodMsFieldNumber = 9,
+    kBurstDurationMsFieldNumber = 10,
+    kBurstTimingsFieldNumber = 11,
+  };
+  using WriterTiming = ::perfetto::protos::pbzero::StressTestConfig_WriterTiming;
+
+  using FieldMetadata_TraceConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceConfig,
+      StressTestConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TraceConfig kTraceConfig() { return {}; }
+  template <typename T = TraceConfig> T* set_trace_config() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_ShmemSizeKb =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      StressTestConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ShmemSizeKb kShmemSizeKb() { return {}; }
+  void set_shmem_size_kb(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ShmemSizeKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ShmemPageSizeKb =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      StressTestConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ShmemPageSizeKb kShmemPageSizeKb() { return {}; }
+  void set_shmem_page_size_kb(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ShmemPageSizeKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NumProcesses =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      StressTestConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NumProcesses kNumProcesses() { return {}; }
+  void set_num_processes(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NumProcesses::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NumThreads =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      StressTestConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NumThreads kNumThreads() { return {}; }
+  void set_num_threads(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NumThreads::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MaxEvents =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      StressTestConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MaxEvents kMaxEvents() { return {}; }
+  void set_max_events(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MaxEvents::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Nesting =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      StressTestConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Nesting kNesting() { return {}; }
+  void set_nesting(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Nesting::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SteadyStateTimings =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      StressTestConfig_WriterTiming,
+      StressTestConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SteadyStateTimings kSteadyStateTimings() { return {}; }
+  template <typename T = StressTestConfig_WriterTiming> T* set_steady_state_timings() {
+    return BeginNestedMessage<T>(8);
+  }
+
+
+  using FieldMetadata_BurstPeriodMs =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      StressTestConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BurstPeriodMs kBurstPeriodMs() { return {}; }
+  void set_burst_period_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BurstPeriodMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BurstDurationMs =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      StressTestConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BurstDurationMs kBurstDurationMs() { return {}; }
+  void set_burst_duration_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BurstDurationMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BurstTimings =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      StressTestConfig_WriterTiming,
+      StressTestConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BurstTimings kBurstTimings() { return {}; }
+  template <typename T = StressTestConfig_WriterTiming> T* set_burst_timings() {
+    return BeginNestedMessage<T>(11);
+  }
+
+};
+
+class StressTestConfig_WriterTiming_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  StressTestConfig_WriterTiming_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit StressTestConfig_WriterTiming_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit StressTestConfig_WriterTiming_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_payload_mean() const { return at<1>().valid(); }
+  double payload_mean() const { return at<1>().as_double(); }
+  bool has_payload_stddev() const { return at<2>().valid(); }
+  double payload_stddev() const { return at<2>().as_double(); }
+  bool has_rate_mean() const { return at<3>().valid(); }
+  double rate_mean() const { return at<3>().as_double(); }
+  bool has_rate_stddev() const { return at<4>().valid(); }
+  double rate_stddev() const { return at<4>().as_double(); }
+  bool has_payload_write_time_ms() const { return at<5>().valid(); }
+  uint32_t payload_write_time_ms() const { return at<5>().as_uint32(); }
+};
+
+class StressTestConfig_WriterTiming : public ::protozero::Message {
+ public:
+  using Decoder = StressTestConfig_WriterTiming_Decoder;
+  enum : int32_t {
+    kPayloadMeanFieldNumber = 1,
+    kPayloadStddevFieldNumber = 2,
+    kRateMeanFieldNumber = 3,
+    kRateStddevFieldNumber = 4,
+    kPayloadWriteTimeMsFieldNumber = 5,
+  };
+
+  using FieldMetadata_PayloadMean =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kDouble,
+      double,
+      StressTestConfig_WriterTiming>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PayloadMean kPayloadMean() { return {}; }
+  void set_payload_mean(double value) {
+    static constexpr uint32_t field_id = FieldMetadata_PayloadMean::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kDouble>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PayloadStddev =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kDouble,
+      double,
+      StressTestConfig_WriterTiming>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PayloadStddev kPayloadStddev() { return {}; }
+  void set_payload_stddev(double value) {
+    static constexpr uint32_t field_id = FieldMetadata_PayloadStddev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kDouble>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_RateMean =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kDouble,
+      double,
+      StressTestConfig_WriterTiming>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RateMean kRateMean() { return {}; }
+  void set_rate_mean(double value) {
+    static constexpr uint32_t field_id = FieldMetadata_RateMean::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kDouble>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_RateStddev =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kDouble,
+      double,
+      StressTestConfig_WriterTiming>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RateStddev kRateStddev() { return {}; }
+  void set_rate_stddev(double value) {
+    static constexpr uint32_t field_id = FieldMetadata_RateStddev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kDouble>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PayloadWriteTimeMs =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      StressTestConfig_WriterTiming>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PayloadWriteTimeMs kPayloadWriteTimeMs() { return {}; }
+  void set_payload_write_time_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PayloadWriteTimeMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/config/test_config.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TEST_CONFIG_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TEST_CONFIG_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class TestConfig_DummyFields;
+
+class TestConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TestConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TestConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TestConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_message_count() const { return at<1>().valid(); }
+  uint32_t message_count() const { return at<1>().as_uint32(); }
+  bool has_max_messages_per_second() const { return at<2>().valid(); }
+  uint32_t max_messages_per_second() const { return at<2>().as_uint32(); }
+  bool has_seed() const { return at<3>().valid(); }
+  uint32_t seed() const { return at<3>().as_uint32(); }
+  bool has_message_size() const { return at<4>().valid(); }
+  uint32_t message_size() const { return at<4>().as_uint32(); }
+  bool has_send_batch_on_register() const { return at<5>().valid(); }
+  bool send_batch_on_register() const { return at<5>().as_bool(); }
+  bool has_dummy_fields() const { return at<6>().valid(); }
+  ::protozero::ConstBytes dummy_fields() const { return at<6>().as_bytes(); }
+};
+
+class TestConfig : public ::protozero::Message {
+ public:
+  using Decoder = TestConfig_Decoder;
+  enum : int32_t {
+    kMessageCountFieldNumber = 1,
+    kMaxMessagesPerSecondFieldNumber = 2,
+    kSeedFieldNumber = 3,
+    kMessageSizeFieldNumber = 4,
+    kSendBatchOnRegisterFieldNumber = 5,
+    kDummyFieldsFieldNumber = 6,
+  };
+  using DummyFields = ::perfetto::protos::pbzero::TestConfig_DummyFields;
+
+  using FieldMetadata_MessageCount =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TestConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MessageCount kMessageCount() { return {}; }
+  void set_message_count(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MessageCount::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MaxMessagesPerSecond =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TestConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MaxMessagesPerSecond kMaxMessagesPerSecond() { return {}; }
+  void set_max_messages_per_second(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MaxMessagesPerSecond::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Seed =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TestConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Seed kSeed() { return {}; }
+  void set_seed(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Seed::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MessageSize =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TestConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MessageSize kMessageSize() { return {}; }
+  void set_message_size(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MessageSize::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SendBatchOnRegister =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TestConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SendBatchOnRegister kSendBatchOnRegister() { return {}; }
+  void set_send_batch_on_register(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_SendBatchOnRegister::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DummyFields =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TestConfig_DummyFields,
+      TestConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DummyFields kDummyFields() { return {}; }
+  template <typename T = TestConfig_DummyFields> T* set_dummy_fields() {
+    return BeginNestedMessage<T>(6);
+  }
+
+};
+
+class TestConfig_DummyFields_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/14, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TestConfig_DummyFields_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TestConfig_DummyFields_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TestConfig_DummyFields_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_field_uint32() const { return at<1>().valid(); }
+  uint32_t field_uint32() const { return at<1>().as_uint32(); }
+  bool has_field_int32() const { return at<2>().valid(); }
+  int32_t field_int32() const { return at<2>().as_int32(); }
+  bool has_field_uint64() const { return at<3>().valid(); }
+  uint64_t field_uint64() const { return at<3>().as_uint64(); }
+  bool has_field_int64() const { return at<4>().valid(); }
+  int64_t field_int64() const { return at<4>().as_int64(); }
+  bool has_field_fixed64() const { return at<5>().valid(); }
+  uint64_t field_fixed64() const { return at<5>().as_uint64(); }
+  bool has_field_sfixed64() const { return at<6>().valid(); }
+  int64_t field_sfixed64() const { return at<6>().as_int64(); }
+  bool has_field_fixed32() const { return at<7>().valid(); }
+  uint32_t field_fixed32() const { return at<7>().as_uint32(); }
+  bool has_field_sfixed32() const { return at<8>().valid(); }
+  int32_t field_sfixed32() const { return at<8>().as_int32(); }
+  bool has_field_double() const { return at<9>().valid(); }
+  double field_double() const { return at<9>().as_double(); }
+  bool has_field_float() const { return at<10>().valid(); }
+  float field_float() const { return at<10>().as_float(); }
+  bool has_field_sint64() const { return at<11>().valid(); }
+  int64_t field_sint64() const { return at<11>().as_int64(); }
+  bool has_field_sint32() const { return at<12>().valid(); }
+  int32_t field_sint32() const { return at<12>().as_int32(); }
+  bool has_field_string() const { return at<13>().valid(); }
+  ::protozero::ConstChars field_string() const { return at<13>().as_string(); }
+  bool has_field_bytes() const { return at<14>().valid(); }
+  ::protozero::ConstBytes field_bytes() const { return at<14>().as_bytes(); }
+};
+
+class TestConfig_DummyFields : public ::protozero::Message {
+ public:
+  using Decoder = TestConfig_DummyFields_Decoder;
+  enum : int32_t {
+    kFieldUint32FieldNumber = 1,
+    kFieldInt32FieldNumber = 2,
+    kFieldUint64FieldNumber = 3,
+    kFieldInt64FieldNumber = 4,
+    kFieldFixed64FieldNumber = 5,
+    kFieldSfixed64FieldNumber = 6,
+    kFieldFixed32FieldNumber = 7,
+    kFieldSfixed32FieldNumber = 8,
+    kFieldDoubleFieldNumber = 9,
+    kFieldFloatFieldNumber = 10,
+    kFieldSint64FieldNumber = 11,
+    kFieldSint32FieldNumber = 12,
+    kFieldStringFieldNumber = 13,
+    kFieldBytesFieldNumber = 14,
+  };
+
+  using FieldMetadata_FieldUint32 =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TestConfig_DummyFields>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FieldUint32 kFieldUint32() { return {}; }
+  void set_field_uint32(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FieldUint32::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FieldInt32 =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      TestConfig_DummyFields>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FieldInt32 kFieldInt32() { return {}; }
+  void set_field_int32(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FieldInt32::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FieldUint64 =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TestConfig_DummyFields>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FieldUint64 kFieldUint64() { return {}; }
+  void set_field_uint64(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FieldUint64::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FieldInt64 =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TestConfig_DummyFields>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FieldInt64 kFieldInt64() { return {}; }
+  void set_field_int64(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FieldInt64::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FieldFixed64 =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kFixed64,
+      uint64_t,
+      TestConfig_DummyFields>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FieldFixed64 kFieldFixed64() { return {}; }
+  void set_field_fixed64(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FieldFixed64::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kFixed64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FieldSfixed64 =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kSfixed64,
+      int64_t,
+      TestConfig_DummyFields>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FieldSfixed64 kFieldSfixed64() { return {}; }
+  void set_field_sfixed64(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FieldSfixed64::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kSfixed64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FieldFixed32 =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kFixed32,
+      uint32_t,
+      TestConfig_DummyFields>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FieldFixed32 kFieldFixed32() { return {}; }
+  void set_field_fixed32(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FieldFixed32::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kFixed32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FieldSfixed32 =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kSfixed32,
+      int32_t,
+      TestConfig_DummyFields>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FieldSfixed32 kFieldSfixed32() { return {}; }
+  void set_field_sfixed32(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FieldSfixed32::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kSfixed32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FieldDouble =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kDouble,
+      double,
+      TestConfig_DummyFields>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FieldDouble kFieldDouble() { return {}; }
+  void set_field_double(double value) {
+    static constexpr uint32_t field_id = FieldMetadata_FieldDouble::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kDouble>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FieldFloat =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kFloat,
+      float,
+      TestConfig_DummyFields>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FieldFloat kFieldFloat() { return {}; }
+  void set_field_float(float value) {
+    static constexpr uint32_t field_id = FieldMetadata_FieldFloat::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kFloat>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FieldSint64 =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kSint64,
+      int64_t,
+      TestConfig_DummyFields>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FieldSint64 kFieldSint64() { return {}; }
+  void set_field_sint64(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FieldSint64::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kSint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FieldSint32 =
+    ::protozero::proto_utils::FieldMetadata<
+      12,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kSint32,
+      int32_t,
+      TestConfig_DummyFields>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FieldSint32 kFieldSint32() { return {}; }
+  void set_field_sint32(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FieldSint32::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kSint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FieldString =
+    ::protozero::proto_utils::FieldMetadata<
+      13,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TestConfig_DummyFields>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FieldString kFieldString() { return {}; }
+  void set_field_string(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_FieldString::kFieldId, data, size);
+  }
+  void set_field_string(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_FieldString::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FieldBytes =
+    ::protozero::proto_utils::FieldMetadata<
+      14,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBytes,
+      std::string,
+      TestConfig_DummyFields>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FieldBytes kFieldBytes() { return {}; }
+  void set_field_bytes(const uint8_t* data, size_t size) {
+    AppendBytes(FieldMetadata_FieldBytes::kFieldId, data, size);
+  }
+  void set_field_bytes(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_FieldBytes::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBytes>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/config/trace_config.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACE_CONFIG_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACE_CONFIG_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class DataSourceConfig;
+class TraceConfig_BufferConfig;
+class TraceConfig_BuiltinDataSource;
+class TraceConfig_DataSource;
+class TraceConfig_GuardrailOverrides;
+class TraceConfig_IncidentReportConfig;
+class TraceConfig_IncrementalStateConfig;
+class TraceConfig_ProducerConfig;
+class TraceConfig_StatsdMetadata;
+class TraceConfig_TraceFilter;
+class TraceConfig_TriggerConfig;
+class TraceConfig_TriggerConfig_Trigger;
+enum BuiltinClock : int32_t;
+enum TraceConfig_BufferConfig_FillPolicy : int32_t;
+enum TraceConfig_CompressionType : int32_t;
+enum TraceConfig_LockdownModeOperation : int32_t;
+enum TraceConfig_StatsdLogging : int32_t;
+enum TraceConfig_TriggerConfig_TriggerMode : int32_t;
+
+enum TraceConfig_LockdownModeOperation : int32_t {
+  TraceConfig_LockdownModeOperation_LOCKDOWN_UNCHANGED = 0,
+  TraceConfig_LockdownModeOperation_LOCKDOWN_CLEAR = 1,
+  TraceConfig_LockdownModeOperation_LOCKDOWN_SET = 2,
+};
+
+const TraceConfig_LockdownModeOperation TraceConfig_LockdownModeOperation_MIN = TraceConfig_LockdownModeOperation_LOCKDOWN_UNCHANGED;
+const TraceConfig_LockdownModeOperation TraceConfig_LockdownModeOperation_MAX = TraceConfig_LockdownModeOperation_LOCKDOWN_SET;
+
+enum TraceConfig_CompressionType : int32_t {
+  TraceConfig_CompressionType_COMPRESSION_TYPE_UNSPECIFIED = 0,
+  TraceConfig_CompressionType_COMPRESSION_TYPE_DEFLATE = 1,
+};
+
+const TraceConfig_CompressionType TraceConfig_CompressionType_MIN = TraceConfig_CompressionType_COMPRESSION_TYPE_UNSPECIFIED;
+const TraceConfig_CompressionType TraceConfig_CompressionType_MAX = TraceConfig_CompressionType_COMPRESSION_TYPE_DEFLATE;
+
+enum TraceConfig_StatsdLogging : int32_t {
+  TraceConfig_StatsdLogging_STATSD_LOGGING_UNSPECIFIED = 0,
+  TraceConfig_StatsdLogging_STATSD_LOGGING_ENABLED = 1,
+  TraceConfig_StatsdLogging_STATSD_LOGGING_DISABLED = 2,
+};
+
+const TraceConfig_StatsdLogging TraceConfig_StatsdLogging_MIN = TraceConfig_StatsdLogging_STATSD_LOGGING_UNSPECIFIED;
+const TraceConfig_StatsdLogging TraceConfig_StatsdLogging_MAX = TraceConfig_StatsdLogging_STATSD_LOGGING_DISABLED;
+
+enum TraceConfig_TriggerConfig_TriggerMode : int32_t {
+  TraceConfig_TriggerConfig_TriggerMode_UNSPECIFIED = 0,
+  TraceConfig_TriggerConfig_TriggerMode_START_TRACING = 1,
+  TraceConfig_TriggerConfig_TriggerMode_STOP_TRACING = 2,
+};
+
+const TraceConfig_TriggerConfig_TriggerMode TraceConfig_TriggerConfig_TriggerMode_MIN = TraceConfig_TriggerConfig_TriggerMode_UNSPECIFIED;
+const TraceConfig_TriggerConfig_TriggerMode TraceConfig_TriggerConfig_TriggerMode_MAX = TraceConfig_TriggerConfig_TriggerMode_STOP_TRACING;
+
+enum TraceConfig_BufferConfig_FillPolicy : int32_t {
+  TraceConfig_BufferConfig_FillPolicy_UNSPECIFIED = 0,
+  TraceConfig_BufferConfig_FillPolicy_RING_BUFFER = 1,
+  TraceConfig_BufferConfig_FillPolicy_DISCARD = 2,
+};
+
+const TraceConfig_BufferConfig_FillPolicy TraceConfig_BufferConfig_FillPolicy_MIN = TraceConfig_BufferConfig_FillPolicy_UNSPECIFIED;
+const TraceConfig_BufferConfig_FillPolicy TraceConfig_BufferConfig_FillPolicy_MAX = TraceConfig_BufferConfig_FillPolicy_DISCARD;
+
+class TraceConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/32, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  TraceConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_buffers() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> buffers() const { return GetRepeated<::protozero::ConstBytes>(1); }
+  bool has_data_sources() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> data_sources() const { return GetRepeated<::protozero::ConstBytes>(2); }
+  bool has_builtin_data_sources() const { return at<20>().valid(); }
+  ::protozero::ConstBytes builtin_data_sources() const { return at<20>().as_bytes(); }
+  bool has_duration_ms() const { return at<3>().valid(); }
+  uint32_t duration_ms() const { return at<3>().as_uint32(); }
+  bool has_enable_extra_guardrails() const { return at<4>().valid(); }
+  bool enable_extra_guardrails() const { return at<4>().as_bool(); }
+  bool has_lockdown_mode() const { return at<5>().valid(); }
+  int32_t lockdown_mode() const { return at<5>().as_int32(); }
+  bool has_producers() const { return at<6>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> producers() const { return GetRepeated<::protozero::ConstBytes>(6); }
+  bool has_statsd_metadata() const { return at<7>().valid(); }
+  ::protozero::ConstBytes statsd_metadata() const { return at<7>().as_bytes(); }
+  bool has_write_into_file() const { return at<8>().valid(); }
+  bool write_into_file() const { return at<8>().as_bool(); }
+  bool has_output_path() const { return at<29>().valid(); }
+  ::protozero::ConstChars output_path() const { return at<29>().as_string(); }
+  bool has_file_write_period_ms() const { return at<9>().valid(); }
+  uint32_t file_write_period_ms() const { return at<9>().as_uint32(); }
+  bool has_max_file_size_bytes() const { return at<10>().valid(); }
+  uint64_t max_file_size_bytes() const { return at<10>().as_uint64(); }
+  bool has_guardrail_overrides() const { return at<11>().valid(); }
+  ::protozero::ConstBytes guardrail_overrides() const { return at<11>().as_bytes(); }
+  bool has_deferred_start() const { return at<12>().valid(); }
+  bool deferred_start() const { return at<12>().as_bool(); }
+  bool has_flush_period_ms() const { return at<13>().valid(); }
+  uint32_t flush_period_ms() const { return at<13>().as_uint32(); }
+  bool has_flush_timeout_ms() const { return at<14>().valid(); }
+  uint32_t flush_timeout_ms() const { return at<14>().as_uint32(); }
+  bool has_data_source_stop_timeout_ms() const { return at<23>().valid(); }
+  uint32_t data_source_stop_timeout_ms() const { return at<23>().as_uint32(); }
+  bool has_notify_traceur() const { return at<16>().valid(); }
+  bool notify_traceur() const { return at<16>().as_bool(); }
+  bool has_bugreport_score() const { return at<30>().valid(); }
+  int32_t bugreport_score() const { return at<30>().as_int32(); }
+  bool has_trigger_config() const { return at<17>().valid(); }
+  ::protozero::ConstBytes trigger_config() const { return at<17>().as_bytes(); }
+  bool has_activate_triggers() const { return at<18>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> activate_triggers() const { return GetRepeated<::protozero::ConstChars>(18); }
+  bool has_incremental_state_config() const { return at<21>().valid(); }
+  ::protozero::ConstBytes incremental_state_config() const { return at<21>().as_bytes(); }
+  bool has_allow_user_build_tracing() const { return at<19>().valid(); }
+  bool allow_user_build_tracing() const { return at<19>().as_bool(); }
+  bool has_unique_session_name() const { return at<22>().valid(); }
+  ::protozero::ConstChars unique_session_name() const { return at<22>().as_string(); }
+  bool has_compression_type() const { return at<24>().valid(); }
+  int32_t compression_type() const { return at<24>().as_int32(); }
+  bool has_incident_report_config() const { return at<25>().valid(); }
+  ::protozero::ConstBytes incident_report_config() const { return at<25>().as_bytes(); }
+  bool has_statsd_logging() const { return at<31>().valid(); }
+  int32_t statsd_logging() const { return at<31>().as_int32(); }
+  bool has_trace_uuid_msb() const { return at<27>().valid(); }
+  int64_t trace_uuid_msb() const { return at<27>().as_int64(); }
+  bool has_trace_uuid_lsb() const { return at<28>().valid(); }
+  int64_t trace_uuid_lsb() const { return at<28>().as_int64(); }
+  bool has_trace_filter() const { return at<32>().valid(); }
+  ::protozero::ConstBytes trace_filter() const { return at<32>().as_bytes(); }
+};
+
+class TraceConfig : public ::protozero::Message {
+ public:
+  using Decoder = TraceConfig_Decoder;
+  enum : int32_t {
+    kBuffersFieldNumber = 1,
+    kDataSourcesFieldNumber = 2,
+    kBuiltinDataSourcesFieldNumber = 20,
+    kDurationMsFieldNumber = 3,
+    kEnableExtraGuardrailsFieldNumber = 4,
+    kLockdownModeFieldNumber = 5,
+    kProducersFieldNumber = 6,
+    kStatsdMetadataFieldNumber = 7,
+    kWriteIntoFileFieldNumber = 8,
+    kOutputPathFieldNumber = 29,
+    kFileWritePeriodMsFieldNumber = 9,
+    kMaxFileSizeBytesFieldNumber = 10,
+    kGuardrailOverridesFieldNumber = 11,
+    kDeferredStartFieldNumber = 12,
+    kFlushPeriodMsFieldNumber = 13,
+    kFlushTimeoutMsFieldNumber = 14,
+    kDataSourceStopTimeoutMsFieldNumber = 23,
+    kNotifyTraceurFieldNumber = 16,
+    kBugreportScoreFieldNumber = 30,
+    kTriggerConfigFieldNumber = 17,
+    kActivateTriggersFieldNumber = 18,
+    kIncrementalStateConfigFieldNumber = 21,
+    kAllowUserBuildTracingFieldNumber = 19,
+    kUniqueSessionNameFieldNumber = 22,
+    kCompressionTypeFieldNumber = 24,
+    kIncidentReportConfigFieldNumber = 25,
+    kStatsdLoggingFieldNumber = 31,
+    kTraceUuidMsbFieldNumber = 27,
+    kTraceUuidLsbFieldNumber = 28,
+    kTraceFilterFieldNumber = 32,
+  };
+  using BufferConfig = ::perfetto::protos::pbzero::TraceConfig_BufferConfig;
+  using DataSource = ::perfetto::protos::pbzero::TraceConfig_DataSource;
+  using BuiltinDataSource = ::perfetto::protos::pbzero::TraceConfig_BuiltinDataSource;
+  using ProducerConfig = ::perfetto::protos::pbzero::TraceConfig_ProducerConfig;
+  using StatsdMetadata = ::perfetto::protos::pbzero::TraceConfig_StatsdMetadata;
+  using GuardrailOverrides = ::perfetto::protos::pbzero::TraceConfig_GuardrailOverrides;
+  using TriggerConfig = ::perfetto::protos::pbzero::TraceConfig_TriggerConfig;
+  using IncrementalStateConfig = ::perfetto::protos::pbzero::TraceConfig_IncrementalStateConfig;
+  using IncidentReportConfig = ::perfetto::protos::pbzero::TraceConfig_IncidentReportConfig;
+  using TraceFilter = ::perfetto::protos::pbzero::TraceConfig_TraceFilter;
+  using LockdownModeOperation = ::perfetto::protos::pbzero::TraceConfig_LockdownModeOperation;
+  using CompressionType = ::perfetto::protos::pbzero::TraceConfig_CompressionType;
+  using StatsdLogging = ::perfetto::protos::pbzero::TraceConfig_StatsdLogging;
+  static const LockdownModeOperation LOCKDOWN_UNCHANGED = TraceConfig_LockdownModeOperation_LOCKDOWN_UNCHANGED;
+  static const LockdownModeOperation LOCKDOWN_CLEAR = TraceConfig_LockdownModeOperation_LOCKDOWN_CLEAR;
+  static const LockdownModeOperation LOCKDOWN_SET = TraceConfig_LockdownModeOperation_LOCKDOWN_SET;
+  static const CompressionType COMPRESSION_TYPE_UNSPECIFIED = TraceConfig_CompressionType_COMPRESSION_TYPE_UNSPECIFIED;
+  static const CompressionType COMPRESSION_TYPE_DEFLATE = TraceConfig_CompressionType_COMPRESSION_TYPE_DEFLATE;
+  static const StatsdLogging STATSD_LOGGING_UNSPECIFIED = TraceConfig_StatsdLogging_STATSD_LOGGING_UNSPECIFIED;
+  static const StatsdLogging STATSD_LOGGING_ENABLED = TraceConfig_StatsdLogging_STATSD_LOGGING_ENABLED;
+  static const StatsdLogging STATSD_LOGGING_DISABLED = TraceConfig_StatsdLogging_STATSD_LOGGING_DISABLED;
+
+  using FieldMetadata_Buffers =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceConfig_BufferConfig,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Buffers kBuffers() { return {}; }
+  template <typename T = TraceConfig_BufferConfig> T* add_buffers() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_DataSources =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceConfig_DataSource,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DataSources kDataSources() { return {}; }
+  template <typename T = TraceConfig_DataSource> T* add_data_sources() {
+    return BeginNestedMessage<T>(2);
+  }
+
+
+  using FieldMetadata_BuiltinDataSources =
+    ::protozero::proto_utils::FieldMetadata<
+      20,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceConfig_BuiltinDataSource,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BuiltinDataSources kBuiltinDataSources() { return {}; }
+  template <typename T = TraceConfig_BuiltinDataSource> T* set_builtin_data_sources() {
+    return BeginNestedMessage<T>(20);
+  }
+
+
+  using FieldMetadata_DurationMs =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DurationMs kDurationMs() { return {}; }
+  void set_duration_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DurationMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_EnableExtraGuardrails =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EnableExtraGuardrails kEnableExtraGuardrails() { return {}; }
+  void set_enable_extra_guardrails(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_EnableExtraGuardrails::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LockdownMode =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::TraceConfig_LockdownModeOperation,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LockdownMode kLockdownMode() { return {}; }
+  void set_lockdown_mode(::perfetto::protos::pbzero::TraceConfig_LockdownModeOperation value) {
+    static constexpr uint32_t field_id = FieldMetadata_LockdownMode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Producers =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceConfig_ProducerConfig,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Producers kProducers() { return {}; }
+  template <typename T = TraceConfig_ProducerConfig> T* add_producers() {
+    return BeginNestedMessage<T>(6);
+  }
+
+
+  using FieldMetadata_StatsdMetadata =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceConfig_StatsdMetadata,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StatsdMetadata kStatsdMetadata() { return {}; }
+  template <typename T = TraceConfig_StatsdMetadata> T* set_statsd_metadata() {
+    return BeginNestedMessage<T>(7);
+  }
+
+
+  using FieldMetadata_WriteIntoFile =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_WriteIntoFile kWriteIntoFile() { return {}; }
+  void set_write_into_file(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_WriteIntoFile::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OutputPath =
+    ::protozero::proto_utils::FieldMetadata<
+      29,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OutputPath kOutputPath() { return {}; }
+  void set_output_path(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_OutputPath::kFieldId, data, size);
+  }
+  void set_output_path(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_OutputPath::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FileWritePeriodMs =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FileWritePeriodMs kFileWritePeriodMs() { return {}; }
+  void set_file_write_period_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FileWritePeriodMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MaxFileSizeBytes =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MaxFileSizeBytes kMaxFileSizeBytes() { return {}; }
+  void set_max_file_size_bytes(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MaxFileSizeBytes::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_GuardrailOverrides =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceConfig_GuardrailOverrides,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GuardrailOverrides kGuardrailOverrides() { return {}; }
+  template <typename T = TraceConfig_GuardrailOverrides> T* set_guardrail_overrides() {
+    return BeginNestedMessage<T>(11);
+  }
+
+
+  using FieldMetadata_DeferredStart =
+    ::protozero::proto_utils::FieldMetadata<
+      12,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DeferredStart kDeferredStart() { return {}; }
+  void set_deferred_start(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_DeferredStart::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FlushPeriodMs =
+    ::protozero::proto_utils::FieldMetadata<
+      13,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FlushPeriodMs kFlushPeriodMs() { return {}; }
+  void set_flush_period_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FlushPeriodMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FlushTimeoutMs =
+    ::protozero::proto_utils::FieldMetadata<
+      14,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FlushTimeoutMs kFlushTimeoutMs() { return {}; }
+  void set_flush_timeout_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FlushTimeoutMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DataSourceStopTimeoutMs =
+    ::protozero::proto_utils::FieldMetadata<
+      23,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DataSourceStopTimeoutMs kDataSourceStopTimeoutMs() { return {}; }
+  void set_data_source_stop_timeout_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DataSourceStopTimeoutMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NotifyTraceur =
+    ::protozero::proto_utils::FieldMetadata<
+      16,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NotifyTraceur kNotifyTraceur() { return {}; }
+  void set_notify_traceur(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_NotifyTraceur::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BugreportScore =
+    ::protozero::proto_utils::FieldMetadata<
+      30,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BugreportScore kBugreportScore() { return {}; }
+  void set_bugreport_score(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BugreportScore::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TriggerConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      17,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceConfig_TriggerConfig,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TriggerConfig kTriggerConfig() { return {}; }
+  template <typename T = TraceConfig_TriggerConfig> T* set_trigger_config() {
+    return BeginNestedMessage<T>(17);
+  }
+
+
+  using FieldMetadata_ActivateTriggers =
+    ::protozero::proto_utils::FieldMetadata<
+      18,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ActivateTriggers kActivateTriggers() { return {}; }
+  void add_activate_triggers(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ActivateTriggers::kFieldId, data, size);
+  }
+  void add_activate_triggers(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ActivateTriggers::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IncrementalStateConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      21,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceConfig_IncrementalStateConfig,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IncrementalStateConfig kIncrementalStateConfig() { return {}; }
+  template <typename T = TraceConfig_IncrementalStateConfig> T* set_incremental_state_config() {
+    return BeginNestedMessage<T>(21);
+  }
+
+
+  using FieldMetadata_AllowUserBuildTracing =
+    ::protozero::proto_utils::FieldMetadata<
+      19,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AllowUserBuildTracing kAllowUserBuildTracing() { return {}; }
+  void set_allow_user_build_tracing(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_AllowUserBuildTracing::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_UniqueSessionName =
+    ::protozero::proto_utils::FieldMetadata<
+      22,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UniqueSessionName kUniqueSessionName() { return {}; }
+  void set_unique_session_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_UniqueSessionName::kFieldId, data, size);
+  }
+  void set_unique_session_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_UniqueSessionName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CompressionType =
+    ::protozero::proto_utils::FieldMetadata<
+      24,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::TraceConfig_CompressionType,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CompressionType kCompressionType() { return {}; }
+  void set_compression_type(::perfetto::protos::pbzero::TraceConfig_CompressionType value) {
+    static constexpr uint32_t field_id = FieldMetadata_CompressionType::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IncidentReportConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      25,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceConfig_IncidentReportConfig,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IncidentReportConfig kIncidentReportConfig() { return {}; }
+  template <typename T = TraceConfig_IncidentReportConfig> T* set_incident_report_config() {
+    return BeginNestedMessage<T>(25);
+  }
+
+
+  using FieldMetadata_StatsdLogging =
+    ::protozero::proto_utils::FieldMetadata<
+      31,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::TraceConfig_StatsdLogging,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StatsdLogging kStatsdLogging() { return {}; }
+  void set_statsd_logging(::perfetto::protos::pbzero::TraceConfig_StatsdLogging value) {
+    static constexpr uint32_t field_id = FieldMetadata_StatsdLogging::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TraceUuidMsb =
+    ::protozero::proto_utils::FieldMetadata<
+      27,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TraceUuidMsb kTraceUuidMsb() { return {}; }
+  void set_trace_uuid_msb(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TraceUuidMsb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TraceUuidLsb =
+    ::protozero::proto_utils::FieldMetadata<
+      28,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TraceUuidLsb kTraceUuidLsb() { return {}; }
+  void set_trace_uuid_lsb(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TraceUuidLsb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TraceFilter =
+    ::protozero::proto_utils::FieldMetadata<
+      32,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceConfig_TraceFilter,
+      TraceConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TraceFilter kTraceFilter() { return {}; }
+  template <typename T = TraceConfig_TraceFilter> T* set_trace_filter() {
+    return BeginNestedMessage<T>(32);
+  }
+
+};
+
+class TraceConfig_TraceFilter_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TraceConfig_TraceFilter_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceConfig_TraceFilter_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceConfig_TraceFilter_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_bytecode() const { return at<1>().valid(); }
+  ::protozero::ConstBytes bytecode() const { return at<1>().as_bytes(); }
+};
+
+class TraceConfig_TraceFilter : public ::protozero::Message {
+ public:
+  using Decoder = TraceConfig_TraceFilter_Decoder;
+  enum : int32_t {
+    kBytecodeFieldNumber = 1,
+  };
+
+  using FieldMetadata_Bytecode =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBytes,
+      std::string,
+      TraceConfig_TraceFilter>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Bytecode kBytecode() { return {}; }
+  void set_bytecode(const uint8_t* data, size_t size) {
+    AppendBytes(FieldMetadata_Bytecode::kFieldId, data, size);
+  }
+  void set_bytecode(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Bytecode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBytes>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TraceConfig_IncidentReportConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TraceConfig_IncidentReportConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceConfig_IncidentReportConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceConfig_IncidentReportConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_destination_package() const { return at<1>().valid(); }
+  ::protozero::ConstChars destination_package() const { return at<1>().as_string(); }
+  bool has_destination_class() const { return at<2>().valid(); }
+  ::protozero::ConstChars destination_class() const { return at<2>().as_string(); }
+  bool has_privacy_level() const { return at<3>().valid(); }
+  int32_t privacy_level() const { return at<3>().as_int32(); }
+  bool has_skip_incidentd() const { return at<5>().valid(); }
+  bool skip_incidentd() const { return at<5>().as_bool(); }
+  bool has_skip_dropbox() const { return at<4>().valid(); }
+  bool skip_dropbox() const { return at<4>().as_bool(); }
+};
+
+class TraceConfig_IncidentReportConfig : public ::protozero::Message {
+ public:
+  using Decoder = TraceConfig_IncidentReportConfig_Decoder;
+  enum : int32_t {
+    kDestinationPackageFieldNumber = 1,
+    kDestinationClassFieldNumber = 2,
+    kPrivacyLevelFieldNumber = 3,
+    kSkipIncidentdFieldNumber = 5,
+    kSkipDropboxFieldNumber = 4,
+  };
+
+  using FieldMetadata_DestinationPackage =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TraceConfig_IncidentReportConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DestinationPackage kDestinationPackage() { return {}; }
+  void set_destination_package(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_DestinationPackage::kFieldId, data, size);
+  }
+  void set_destination_package(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_DestinationPackage::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DestinationClass =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TraceConfig_IncidentReportConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DestinationClass kDestinationClass() { return {}; }
+  void set_destination_class(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_DestinationClass::kFieldId, data, size);
+  }
+  void set_destination_class(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_DestinationClass::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PrivacyLevel =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      TraceConfig_IncidentReportConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PrivacyLevel kPrivacyLevel() { return {}; }
+  void set_privacy_level(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PrivacyLevel::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SkipIncidentd =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TraceConfig_IncidentReportConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SkipIncidentd kSkipIncidentd() { return {}; }
+  void set_skip_incidentd(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_SkipIncidentd::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SkipDropbox =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TraceConfig_IncidentReportConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SkipDropbox kSkipDropbox() { return {}; }
+  void set_skip_dropbox(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_SkipDropbox::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TraceConfig_IncrementalStateConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TraceConfig_IncrementalStateConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceConfig_IncrementalStateConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceConfig_IncrementalStateConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_clear_period_ms() const { return at<1>().valid(); }
+  uint32_t clear_period_ms() const { return at<1>().as_uint32(); }
+};
+
+class TraceConfig_IncrementalStateConfig : public ::protozero::Message {
+ public:
+  using Decoder = TraceConfig_IncrementalStateConfig_Decoder;
+  enum : int32_t {
+    kClearPeriodMsFieldNumber = 1,
+  };
+
+  using FieldMetadata_ClearPeriodMs =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceConfig_IncrementalStateConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ClearPeriodMs kClearPeriodMs() { return {}; }
+  void set_clear_period_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ClearPeriodMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TraceConfig_TriggerConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  TraceConfig_TriggerConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceConfig_TriggerConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceConfig_TriggerConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_trigger_mode() const { return at<1>().valid(); }
+  int32_t trigger_mode() const { return at<1>().as_int32(); }
+  bool has_triggers() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> triggers() const { return GetRepeated<::protozero::ConstBytes>(2); }
+  bool has_trigger_timeout_ms() const { return at<3>().valid(); }
+  uint32_t trigger_timeout_ms() const { return at<3>().as_uint32(); }
+};
+
+class TraceConfig_TriggerConfig : public ::protozero::Message {
+ public:
+  using Decoder = TraceConfig_TriggerConfig_Decoder;
+  enum : int32_t {
+    kTriggerModeFieldNumber = 1,
+    kTriggersFieldNumber = 2,
+    kTriggerTimeoutMsFieldNumber = 3,
+  };
+  using Trigger = ::perfetto::protos::pbzero::TraceConfig_TriggerConfig_Trigger;
+  using TriggerMode = ::perfetto::protos::pbzero::TraceConfig_TriggerConfig_TriggerMode;
+  static const TriggerMode UNSPECIFIED = TraceConfig_TriggerConfig_TriggerMode_UNSPECIFIED;
+  static const TriggerMode START_TRACING = TraceConfig_TriggerConfig_TriggerMode_START_TRACING;
+  static const TriggerMode STOP_TRACING = TraceConfig_TriggerConfig_TriggerMode_STOP_TRACING;
+
+  using FieldMetadata_TriggerMode =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::TraceConfig_TriggerConfig_TriggerMode,
+      TraceConfig_TriggerConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TriggerMode kTriggerMode() { return {}; }
+  void set_trigger_mode(::perfetto::protos::pbzero::TraceConfig_TriggerConfig_TriggerMode value) {
+    static constexpr uint32_t field_id = FieldMetadata_TriggerMode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Triggers =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceConfig_TriggerConfig_Trigger,
+      TraceConfig_TriggerConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Triggers kTriggers() { return {}; }
+  template <typename T = TraceConfig_TriggerConfig_Trigger> T* add_triggers() {
+    return BeginNestedMessage<T>(2);
+  }
+
+
+  using FieldMetadata_TriggerTimeoutMs =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceConfig_TriggerConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TriggerTimeoutMs kTriggerTimeoutMs() { return {}; }
+  void set_trigger_timeout_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TriggerTimeoutMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TraceConfig_TriggerConfig_Trigger_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TraceConfig_TriggerConfig_Trigger_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceConfig_TriggerConfig_Trigger_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceConfig_TriggerConfig_Trigger_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_producer_name_regex() const { return at<2>().valid(); }
+  ::protozero::ConstChars producer_name_regex() const { return at<2>().as_string(); }
+  bool has_stop_delay_ms() const { return at<3>().valid(); }
+  uint32_t stop_delay_ms() const { return at<3>().as_uint32(); }
+  bool has_max_per_24_h() const { return at<4>().valid(); }
+  uint32_t max_per_24_h() const { return at<4>().as_uint32(); }
+  bool has_skip_probability() const { return at<5>().valid(); }
+  double skip_probability() const { return at<5>().as_double(); }
+};
+
+class TraceConfig_TriggerConfig_Trigger : public ::protozero::Message {
+ public:
+  using Decoder = TraceConfig_TriggerConfig_Trigger_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kProducerNameRegexFieldNumber = 2,
+    kStopDelayMsFieldNumber = 3,
+    kMaxPer24HFieldNumber = 4,
+    kSkipProbabilityFieldNumber = 5,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TraceConfig_TriggerConfig_Trigger>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ProducerNameRegex =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TraceConfig_TriggerConfig_Trigger>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProducerNameRegex kProducerNameRegex() { return {}; }
+  void set_producer_name_regex(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ProducerNameRegex::kFieldId, data, size);
+  }
+  void set_producer_name_regex(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProducerNameRegex::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_StopDelayMs =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceConfig_TriggerConfig_Trigger>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StopDelayMs kStopDelayMs() { return {}; }
+  void set_stop_delay_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_StopDelayMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MaxPer24H =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceConfig_TriggerConfig_Trigger>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MaxPer24H kMaxPer24H() { return {}; }
+  void set_max_per_24_h(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MaxPer24H::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SkipProbability =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kDouble,
+      double,
+      TraceConfig_TriggerConfig_Trigger>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SkipProbability kSkipProbability() { return {}; }
+  void set_skip_probability(double value) {
+    static constexpr uint32_t field_id = FieldMetadata_SkipProbability::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kDouble>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TraceConfig_GuardrailOverrides_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TraceConfig_GuardrailOverrides_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceConfig_GuardrailOverrides_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceConfig_GuardrailOverrides_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_max_upload_per_day_bytes() const { return at<1>().valid(); }
+  uint64_t max_upload_per_day_bytes() const { return at<1>().as_uint64(); }
+};
+
+class TraceConfig_GuardrailOverrides : public ::protozero::Message {
+ public:
+  using Decoder = TraceConfig_GuardrailOverrides_Decoder;
+  enum : int32_t {
+    kMaxUploadPerDayBytesFieldNumber = 1,
+  };
+
+  using FieldMetadata_MaxUploadPerDayBytes =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TraceConfig_GuardrailOverrides>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MaxUploadPerDayBytes kMaxUploadPerDayBytes() { return {}; }
+  void set_max_upload_per_day_bytes(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MaxUploadPerDayBytes::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TraceConfig_StatsdMetadata_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TraceConfig_StatsdMetadata_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceConfig_StatsdMetadata_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceConfig_StatsdMetadata_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_triggering_alert_id() const { return at<1>().valid(); }
+  int64_t triggering_alert_id() const { return at<1>().as_int64(); }
+  bool has_triggering_config_uid() const { return at<2>().valid(); }
+  int32_t triggering_config_uid() const { return at<2>().as_int32(); }
+  bool has_triggering_config_id() const { return at<3>().valid(); }
+  int64_t triggering_config_id() const { return at<3>().as_int64(); }
+  bool has_triggering_subscription_id() const { return at<4>().valid(); }
+  int64_t triggering_subscription_id() const { return at<4>().as_int64(); }
+};
+
+class TraceConfig_StatsdMetadata : public ::protozero::Message {
+ public:
+  using Decoder = TraceConfig_StatsdMetadata_Decoder;
+  enum : int32_t {
+    kTriggeringAlertIdFieldNumber = 1,
+    kTriggeringConfigUidFieldNumber = 2,
+    kTriggeringConfigIdFieldNumber = 3,
+    kTriggeringSubscriptionIdFieldNumber = 4,
+  };
+
+  using FieldMetadata_TriggeringAlertId =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TraceConfig_StatsdMetadata>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TriggeringAlertId kTriggeringAlertId() { return {}; }
+  void set_triggering_alert_id(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TriggeringAlertId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TriggeringConfigUid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      TraceConfig_StatsdMetadata>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TriggeringConfigUid kTriggeringConfigUid() { return {}; }
+  void set_triggering_config_uid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TriggeringConfigUid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TriggeringConfigId =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TraceConfig_StatsdMetadata>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TriggeringConfigId kTriggeringConfigId() { return {}; }
+  void set_triggering_config_id(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TriggeringConfigId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TriggeringSubscriptionId =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TraceConfig_StatsdMetadata>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TriggeringSubscriptionId kTriggeringSubscriptionId() { return {}; }
+  void set_triggering_subscription_id(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TriggeringSubscriptionId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TraceConfig_ProducerConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TraceConfig_ProducerConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceConfig_ProducerConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceConfig_ProducerConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_producer_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars producer_name() const { return at<1>().as_string(); }
+  bool has_shm_size_kb() const { return at<2>().valid(); }
+  uint32_t shm_size_kb() const { return at<2>().as_uint32(); }
+  bool has_page_size_kb() const { return at<3>().valid(); }
+  uint32_t page_size_kb() const { return at<3>().as_uint32(); }
+};
+
+class TraceConfig_ProducerConfig : public ::protozero::Message {
+ public:
+  using Decoder = TraceConfig_ProducerConfig_Decoder;
+  enum : int32_t {
+    kProducerNameFieldNumber = 1,
+    kShmSizeKbFieldNumber = 2,
+    kPageSizeKbFieldNumber = 3,
+  };
+
+  using FieldMetadata_ProducerName =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TraceConfig_ProducerConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProducerName kProducerName() { return {}; }
+  void set_producer_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ProducerName::kFieldId, data, size);
+  }
+  void set_producer_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProducerName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ShmSizeKb =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceConfig_ProducerConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ShmSizeKb kShmSizeKb() { return {}; }
+  void set_shm_size_kb(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ShmSizeKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PageSizeKb =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceConfig_ProducerConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PageSizeKb kPageSizeKb() { return {}; }
+  void set_page_size_kb(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PageSizeKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TraceConfig_BuiltinDataSource_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TraceConfig_BuiltinDataSource_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceConfig_BuiltinDataSource_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceConfig_BuiltinDataSource_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_disable_clock_snapshotting() const { return at<1>().valid(); }
+  bool disable_clock_snapshotting() const { return at<1>().as_bool(); }
+  bool has_disable_trace_config() const { return at<2>().valid(); }
+  bool disable_trace_config() const { return at<2>().as_bool(); }
+  bool has_disable_system_info() const { return at<3>().valid(); }
+  bool disable_system_info() const { return at<3>().as_bool(); }
+  bool has_disable_service_events() const { return at<4>().valid(); }
+  bool disable_service_events() const { return at<4>().as_bool(); }
+  bool has_primary_trace_clock() const { return at<5>().valid(); }
+  int32_t primary_trace_clock() const { return at<5>().as_int32(); }
+  bool has_snapshot_interval_ms() const { return at<6>().valid(); }
+  uint32_t snapshot_interval_ms() const { return at<6>().as_uint32(); }
+  bool has_prefer_suspend_clock_for_snapshot() const { return at<7>().valid(); }
+  bool prefer_suspend_clock_for_snapshot() const { return at<7>().as_bool(); }
+};
+
+class TraceConfig_BuiltinDataSource : public ::protozero::Message {
+ public:
+  using Decoder = TraceConfig_BuiltinDataSource_Decoder;
+  enum : int32_t {
+    kDisableClockSnapshottingFieldNumber = 1,
+    kDisableTraceConfigFieldNumber = 2,
+    kDisableSystemInfoFieldNumber = 3,
+    kDisableServiceEventsFieldNumber = 4,
+    kPrimaryTraceClockFieldNumber = 5,
+    kSnapshotIntervalMsFieldNumber = 6,
+    kPreferSuspendClockForSnapshotFieldNumber = 7,
+  };
+
+  using FieldMetadata_DisableClockSnapshotting =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TraceConfig_BuiltinDataSource>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DisableClockSnapshotting kDisableClockSnapshotting() { return {}; }
+  void set_disable_clock_snapshotting(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_DisableClockSnapshotting::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DisableTraceConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TraceConfig_BuiltinDataSource>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DisableTraceConfig kDisableTraceConfig() { return {}; }
+  void set_disable_trace_config(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_DisableTraceConfig::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DisableSystemInfo =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TraceConfig_BuiltinDataSource>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DisableSystemInfo kDisableSystemInfo() { return {}; }
+  void set_disable_system_info(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_DisableSystemInfo::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DisableServiceEvents =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TraceConfig_BuiltinDataSource>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DisableServiceEvents kDisableServiceEvents() { return {}; }
+  void set_disable_service_events(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_DisableServiceEvents::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PrimaryTraceClock =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::BuiltinClock,
+      TraceConfig_BuiltinDataSource>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PrimaryTraceClock kPrimaryTraceClock() { return {}; }
+  void set_primary_trace_clock(::perfetto::protos::pbzero::BuiltinClock value) {
+    static constexpr uint32_t field_id = FieldMetadata_PrimaryTraceClock::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SnapshotIntervalMs =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceConfig_BuiltinDataSource>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SnapshotIntervalMs kSnapshotIntervalMs() { return {}; }
+  void set_snapshot_interval_ms(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SnapshotIntervalMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PreferSuspendClockForSnapshot =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TraceConfig_BuiltinDataSource>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PreferSuspendClockForSnapshot kPreferSuspendClockForSnapshot() { return {}; }
+  void set_prefer_suspend_clock_for_snapshot(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_PreferSuspendClockForSnapshot::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TraceConfig_DataSource_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  TraceConfig_DataSource_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceConfig_DataSource_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceConfig_DataSource_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_config() const { return at<1>().valid(); }
+  ::protozero::ConstBytes config() const { return at<1>().as_bytes(); }
+  bool has_producer_name_filter() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> producer_name_filter() const { return GetRepeated<::protozero::ConstChars>(2); }
+  bool has_producer_name_regex_filter() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> producer_name_regex_filter() const { return GetRepeated<::protozero::ConstChars>(3); }
+};
+
+class TraceConfig_DataSource : public ::protozero::Message {
+ public:
+  using Decoder = TraceConfig_DataSource_Decoder;
+  enum : int32_t {
+    kConfigFieldNumber = 1,
+    kProducerNameFilterFieldNumber = 2,
+    kProducerNameRegexFilterFieldNumber = 3,
+  };
+
+  using FieldMetadata_Config =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      DataSourceConfig,
+      TraceConfig_DataSource>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Config kConfig() { return {}; }
+  template <typename T = DataSourceConfig> T* set_config() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_ProducerNameFilter =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TraceConfig_DataSource>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProducerNameFilter kProducerNameFilter() { return {}; }
+  void add_producer_name_filter(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ProducerNameFilter::kFieldId, data, size);
+  }
+  void add_producer_name_filter(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProducerNameFilter::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ProducerNameRegexFilter =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TraceConfig_DataSource>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProducerNameRegexFilter kProducerNameRegexFilter() { return {}; }
+  void add_producer_name_regex_filter(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ProducerNameRegexFilter::kFieldId, data, size);
+  }
+  void add_producer_name_regex_filter(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProducerNameRegexFilter::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TraceConfig_BufferConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TraceConfig_BufferConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TraceConfig_BufferConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TraceConfig_BufferConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_size_kb() const { return at<1>().valid(); }
+  uint32_t size_kb() const { return at<1>().as_uint32(); }
+  bool has_fill_policy() const { return at<4>().valid(); }
+  int32_t fill_policy() const { return at<4>().as_int32(); }
+};
+
+class TraceConfig_BufferConfig : public ::protozero::Message {
+ public:
+  using Decoder = TraceConfig_BufferConfig_Decoder;
+  enum : int32_t {
+    kSizeKbFieldNumber = 1,
+    kFillPolicyFieldNumber = 4,
+  };
+  using FillPolicy = ::perfetto::protos::pbzero::TraceConfig_BufferConfig_FillPolicy;
+  static const FillPolicy UNSPECIFIED = TraceConfig_BufferConfig_FillPolicy_UNSPECIFIED;
+  static const FillPolicy RING_BUFFER = TraceConfig_BufferConfig_FillPolicy_RING_BUFFER;
+  static const FillPolicy DISCARD = TraceConfig_BufferConfig_FillPolicy_DISCARD;
+
+  using FieldMetadata_SizeKb =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TraceConfig_BufferConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SizeKb kSizeKb() { return {}; }
+  void set_size_kb(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SizeKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FillPolicy =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::TraceConfig_BufferConfig_FillPolicy,
+      TraceConfig_BufferConfig>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FillPolicy kFillPolicy() { return {}; }
+  void set_fill_policy(::perfetto::protos::pbzero::TraceConfig_BufferConfig_FillPolicy value) {
+    static constexpr uint32_t field_id = FieldMetadata_FillPolicy::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/clock_snapshot.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_CLOCK_SNAPSHOT_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_CLOCK_SNAPSHOT_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class ClockSnapshot_Clock;
+enum BuiltinClock : int32_t;
+
+enum ClockSnapshot_Clock_BuiltinClocks : int32_t {
+  ClockSnapshot_Clock_BuiltinClocks_UNKNOWN = 0,
+  ClockSnapshot_Clock_BuiltinClocks_REALTIME = 1,
+  ClockSnapshot_Clock_BuiltinClocks_REALTIME_COARSE = 2,
+  ClockSnapshot_Clock_BuiltinClocks_MONOTONIC = 3,
+  ClockSnapshot_Clock_BuiltinClocks_MONOTONIC_COARSE = 4,
+  ClockSnapshot_Clock_BuiltinClocks_MONOTONIC_RAW = 5,
+  ClockSnapshot_Clock_BuiltinClocks_BOOTTIME = 6,
+  ClockSnapshot_Clock_BuiltinClocks_BUILTIN_CLOCK_MAX_ID = 63,
+};
+
+const ClockSnapshot_Clock_BuiltinClocks ClockSnapshot_Clock_BuiltinClocks_MIN = ClockSnapshot_Clock_BuiltinClocks_UNKNOWN;
+const ClockSnapshot_Clock_BuiltinClocks ClockSnapshot_Clock_BuiltinClocks_MAX = ClockSnapshot_Clock_BuiltinClocks_BUILTIN_CLOCK_MAX_ID;
+
+class ClockSnapshot_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  ClockSnapshot_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ClockSnapshot_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ClockSnapshot_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_clocks() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> clocks() const { return GetRepeated<::protozero::ConstBytes>(1); }
+  bool has_primary_trace_clock() const { return at<2>().valid(); }
+  int32_t primary_trace_clock() const { return at<2>().as_int32(); }
+};
+
+class ClockSnapshot : public ::protozero::Message {
+ public:
+  using Decoder = ClockSnapshot_Decoder;
+  enum : int32_t {
+    kClocksFieldNumber = 1,
+    kPrimaryTraceClockFieldNumber = 2,
+  };
+  using Clock = ::perfetto::protos::pbzero::ClockSnapshot_Clock;
+
+  using FieldMetadata_Clocks =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ClockSnapshot_Clock,
+      ClockSnapshot>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Clocks kClocks() { return {}; }
+  template <typename T = ClockSnapshot_Clock> T* add_clocks() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_PrimaryTraceClock =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::BuiltinClock,
+      ClockSnapshot>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PrimaryTraceClock kPrimaryTraceClock() { return {}; }
+  void set_primary_trace_clock(::perfetto::protos::pbzero::BuiltinClock value) {
+    static constexpr uint32_t field_id = FieldMetadata_PrimaryTraceClock::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class ClockSnapshot_Clock_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ClockSnapshot_Clock_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ClockSnapshot_Clock_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ClockSnapshot_Clock_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_clock_id() const { return at<1>().valid(); }
+  uint32_t clock_id() const { return at<1>().as_uint32(); }
+  bool has_timestamp() const { return at<2>().valid(); }
+  uint64_t timestamp() const { return at<2>().as_uint64(); }
+  bool has_is_incremental() const { return at<3>().valid(); }
+  bool is_incremental() const { return at<3>().as_bool(); }
+  bool has_unit_multiplier_ns() const { return at<4>().valid(); }
+  uint64_t unit_multiplier_ns() const { return at<4>().as_uint64(); }
+};
+
+class ClockSnapshot_Clock : public ::protozero::Message {
+ public:
+  using Decoder = ClockSnapshot_Clock_Decoder;
+  enum : int32_t {
+    kClockIdFieldNumber = 1,
+    kTimestampFieldNumber = 2,
+    kIsIncrementalFieldNumber = 3,
+    kUnitMultiplierNsFieldNumber = 4,
+  };
+  using BuiltinClocks = ::perfetto::protos::pbzero::ClockSnapshot_Clock_BuiltinClocks;
+  static const BuiltinClocks UNKNOWN = ClockSnapshot_Clock_BuiltinClocks_UNKNOWN;
+  static const BuiltinClocks REALTIME = ClockSnapshot_Clock_BuiltinClocks_REALTIME;
+  static const BuiltinClocks REALTIME_COARSE = ClockSnapshot_Clock_BuiltinClocks_REALTIME_COARSE;
+  static const BuiltinClocks MONOTONIC = ClockSnapshot_Clock_BuiltinClocks_MONOTONIC;
+  static const BuiltinClocks MONOTONIC_COARSE = ClockSnapshot_Clock_BuiltinClocks_MONOTONIC_COARSE;
+  static const BuiltinClocks MONOTONIC_RAW = ClockSnapshot_Clock_BuiltinClocks_MONOTONIC_RAW;
+  static const BuiltinClocks BOOTTIME = ClockSnapshot_Clock_BuiltinClocks_BOOTTIME;
+  static const BuiltinClocks BUILTIN_CLOCK_MAX_ID = ClockSnapshot_Clock_BuiltinClocks_BUILTIN_CLOCK_MAX_ID;
+
+  using FieldMetadata_ClockId =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      ClockSnapshot_Clock>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ClockId kClockId() { return {}; }
+  void set_clock_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ClockId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Timestamp =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ClockSnapshot_Clock>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Timestamp kTimestamp() { return {}; }
+  void set_timestamp(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Timestamp::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IsIncremental =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ClockSnapshot_Clock>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IsIncremental kIsIncremental() { return {}; }
+  void set_is_incremental(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_IsIncremental::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_UnitMultiplierNs =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ClockSnapshot_Clock>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UnitMultiplierNs kUnitMultiplierNs() { return {}; }
+  void set_unit_multiplier_ns(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_UnitMultiplierNs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/trigger.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRIGGER_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRIGGER_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class Trigger_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Trigger_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Trigger_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Trigger_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_trigger_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars trigger_name() const { return at<1>().as_string(); }
+  bool has_producer_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars producer_name() const { return at<2>().as_string(); }
+  bool has_trusted_producer_uid() const { return at<3>().valid(); }
+  int32_t trusted_producer_uid() const { return at<3>().as_int32(); }
+};
+
+class Trigger : public ::protozero::Message {
+ public:
+  using Decoder = Trigger_Decoder;
+  enum : int32_t {
+    kTriggerNameFieldNumber = 1,
+    kProducerNameFieldNumber = 2,
+    kTrustedProducerUidFieldNumber = 3,
+  };
+
+  using FieldMetadata_TriggerName =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      Trigger>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TriggerName kTriggerName() { return {}; }
+  void set_trigger_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_TriggerName::kFieldId, data, size);
+  }
+  void set_trigger_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_TriggerName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ProducerName =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      Trigger>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProducerName kProducerName() { return {}; }
+  void set_producer_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ProducerName::kFieldId, data, size);
+  }
+  void set_producer_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProducerName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TrustedProducerUid =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Trigger>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TrustedProducerUid kTrustedProducerUid() { return {}; }
+  void set_trusted_producer_uid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TrustedProducerUid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/system_info.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_SYSTEM_INFO_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_SYSTEM_INFO_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class Utsname;
+
+class SystemInfo_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SystemInfo_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SystemInfo_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SystemInfo_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_utsname() const { return at<1>().valid(); }
+  ::protozero::ConstBytes utsname() const { return at<1>().as_bytes(); }
+  bool has_android_build_fingerprint() const { return at<2>().valid(); }
+  ::protozero::ConstChars android_build_fingerprint() const { return at<2>().as_string(); }
+  bool has_hz() const { return at<3>().valid(); }
+  int64_t hz() const { return at<3>().as_int64(); }
+  bool has_tracing_service_version() const { return at<4>().valid(); }
+  ::protozero::ConstChars tracing_service_version() const { return at<4>().as_string(); }
+};
+
+class SystemInfo : public ::protozero::Message {
+ public:
+  using Decoder = SystemInfo_Decoder;
+  enum : int32_t {
+    kUtsnameFieldNumber = 1,
+    kAndroidBuildFingerprintFieldNumber = 2,
+    kHzFieldNumber = 3,
+    kTracingServiceVersionFieldNumber = 4,
+  };
+
+  using FieldMetadata_Utsname =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Utsname,
+      SystemInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Utsname kUtsname() { return {}; }
+  template <typename T = Utsname> T* set_utsname() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_AndroidBuildFingerprint =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SystemInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AndroidBuildFingerprint kAndroidBuildFingerprint() { return {}; }
+  void set_android_build_fingerprint(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_AndroidBuildFingerprint::kFieldId, data, size);
+  }
+  void set_android_build_fingerprint(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_AndroidBuildFingerprint::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Hz =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      SystemInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Hz kHz() { return {}; }
+  void set_hz(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Hz::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TracingServiceVersion =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SystemInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TracingServiceVersion kTracingServiceVersion() { return {}; }
+  void set_tracing_service_version(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_TracingServiceVersion::kFieldId, data, size);
+  }
+  void set_tracing_service_version(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_TracingServiceVersion::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Utsname_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Utsname_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Utsname_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Utsname_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_sysname() const { return at<1>().valid(); }
+  ::protozero::ConstChars sysname() const { return at<1>().as_string(); }
+  bool has_version() const { return at<2>().valid(); }
+  ::protozero::ConstChars version() const { return at<2>().as_string(); }
+  bool has_release() const { return at<3>().valid(); }
+  ::protozero::ConstChars release() const { return at<3>().as_string(); }
+  bool has_machine() const { return at<4>().valid(); }
+  ::protozero::ConstChars machine() const { return at<4>().as_string(); }
+};
+
+class Utsname : public ::protozero::Message {
+ public:
+  using Decoder = Utsname_Decoder;
+  enum : int32_t {
+    kSysnameFieldNumber = 1,
+    kVersionFieldNumber = 2,
+    kReleaseFieldNumber = 3,
+    kMachineFieldNumber = 4,
+  };
+
+  using FieldMetadata_Sysname =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      Utsname>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Sysname kSysname() { return {}; }
+  void set_sysname(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Sysname::kFieldId, data, size);
+  }
+  void set_sysname(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Sysname::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Version =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      Utsname>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Version kVersion() { return {}; }
+  void set_version(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Version::kFieldId, data, size);
+  }
+  void set_version(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Version::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Release =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      Utsname>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Release kRelease() { return {}; }
+  void set_release(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Release::kFieldId, data, size);
+  }
+  void set_release(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Release::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Machine =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      Utsname>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Machine kMachine() { return {}; }
+  void set_machine(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Machine::kFieldId, data, size);
+  }
+  void set_machine(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Machine::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/android/android_log.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_ANDROID_LOG_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_ANDROID_LOG_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class AndroidLogPacket_LogEvent;
+class AndroidLogPacket_LogEvent_Arg;
+class AndroidLogPacket_Stats;
+enum AndroidLogId : int32_t;
+enum AndroidLogPriority : int32_t;
+
+class AndroidLogPacket_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  AndroidLogPacket_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit AndroidLogPacket_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit AndroidLogPacket_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_events() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> events() const { return GetRepeated<::protozero::ConstBytes>(1); }
+  bool has_stats() const { return at<2>().valid(); }
+  ::protozero::ConstBytes stats() const { return at<2>().as_bytes(); }
+};
+
+class AndroidLogPacket : public ::protozero::Message {
+ public:
+  using Decoder = AndroidLogPacket_Decoder;
+  enum : int32_t {
+    kEventsFieldNumber = 1,
+    kStatsFieldNumber = 2,
+  };
+  using LogEvent = ::perfetto::protos::pbzero::AndroidLogPacket_LogEvent;
+  using Stats = ::perfetto::protos::pbzero::AndroidLogPacket_Stats;
+
+  using FieldMetadata_Events =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      AndroidLogPacket_LogEvent,
+      AndroidLogPacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Events kEvents() { return {}; }
+  template <typename T = AndroidLogPacket_LogEvent> T* add_events() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_Stats =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      AndroidLogPacket_Stats,
+      AndroidLogPacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Stats kStats() { return {}; }
+  template <typename T = AndroidLogPacket_Stats> T* set_stats() {
+    return BeginNestedMessage<T>(2);
+  }
+
+};
+
+class AndroidLogPacket_Stats_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  AndroidLogPacket_Stats_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit AndroidLogPacket_Stats_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit AndroidLogPacket_Stats_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_num_total() const { return at<1>().valid(); }
+  uint64_t num_total() const { return at<1>().as_uint64(); }
+  bool has_num_failed() const { return at<2>().valid(); }
+  uint64_t num_failed() const { return at<2>().as_uint64(); }
+  bool has_num_skipped() const { return at<3>().valid(); }
+  uint64_t num_skipped() const { return at<3>().as_uint64(); }
+};
+
+class AndroidLogPacket_Stats : public ::protozero::Message {
+ public:
+  using Decoder = AndroidLogPacket_Stats_Decoder;
+  enum : int32_t {
+    kNumTotalFieldNumber = 1,
+    kNumFailedFieldNumber = 2,
+    kNumSkippedFieldNumber = 3,
+  };
+
+  using FieldMetadata_NumTotal =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      AndroidLogPacket_Stats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NumTotal kNumTotal() { return {}; }
+  void set_num_total(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NumTotal::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NumFailed =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      AndroidLogPacket_Stats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NumFailed kNumFailed() { return {}; }
+  void set_num_failed(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NumFailed::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NumSkipped =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      AndroidLogPacket_Stats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NumSkipped kNumSkipped() { return {}; }
+  void set_num_skipped(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NumSkipped::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class AndroidLogPacket_LogEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/9, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  AndroidLogPacket_LogEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit AndroidLogPacket_LogEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit AndroidLogPacket_LogEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_log_id() const { return at<1>().valid(); }
+  int32_t log_id() const { return at<1>().as_int32(); }
+  bool has_pid() const { return at<2>().valid(); }
+  int32_t pid() const { return at<2>().as_int32(); }
+  bool has_tid() const { return at<3>().valid(); }
+  int32_t tid() const { return at<3>().as_int32(); }
+  bool has_uid() const { return at<4>().valid(); }
+  int32_t uid() const { return at<4>().as_int32(); }
+  bool has_timestamp() const { return at<5>().valid(); }
+  uint64_t timestamp() const { return at<5>().as_uint64(); }
+  bool has_tag() const { return at<6>().valid(); }
+  ::protozero::ConstChars tag() const { return at<6>().as_string(); }
+  bool has_prio() const { return at<7>().valid(); }
+  int32_t prio() const { return at<7>().as_int32(); }
+  bool has_message() const { return at<8>().valid(); }
+  ::protozero::ConstChars message() const { return at<8>().as_string(); }
+  bool has_args() const { return at<9>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> args() const { return GetRepeated<::protozero::ConstBytes>(9); }
+};
+
+class AndroidLogPacket_LogEvent : public ::protozero::Message {
+ public:
+  using Decoder = AndroidLogPacket_LogEvent_Decoder;
+  enum : int32_t {
+    kLogIdFieldNumber = 1,
+    kPidFieldNumber = 2,
+    kTidFieldNumber = 3,
+    kUidFieldNumber = 4,
+    kTimestampFieldNumber = 5,
+    kTagFieldNumber = 6,
+    kPrioFieldNumber = 7,
+    kMessageFieldNumber = 8,
+    kArgsFieldNumber = 9,
+  };
+  using Arg = ::perfetto::protos::pbzero::AndroidLogPacket_LogEvent_Arg;
+
+  using FieldMetadata_LogId =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::AndroidLogId,
+      AndroidLogPacket_LogEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LogId kLogId() { return {}; }
+  void set_log_id(::perfetto::protos::pbzero::AndroidLogId value) {
+    static constexpr uint32_t field_id = FieldMetadata_LogId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      AndroidLogPacket_LogEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Tid =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      AndroidLogPacket_LogEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Tid kTid() { return {}; }
+  void set_tid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Tid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Uid =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      AndroidLogPacket_LogEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Uid kUid() { return {}; }
+  void set_uid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Uid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Timestamp =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      AndroidLogPacket_LogEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Timestamp kTimestamp() { return {}; }
+  void set_timestamp(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Timestamp::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Tag =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      AndroidLogPacket_LogEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Tag kTag() { return {}; }
+  void set_tag(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Tag::kFieldId, data, size);
+  }
+  void set_tag(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Tag::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Prio =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::AndroidLogPriority,
+      AndroidLogPacket_LogEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Prio kPrio() { return {}; }
+  void set_prio(::perfetto::protos::pbzero::AndroidLogPriority value) {
+    static constexpr uint32_t field_id = FieldMetadata_Prio::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Message =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      AndroidLogPacket_LogEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Message kMessage() { return {}; }
+  void set_message(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Message::kFieldId, data, size);
+  }
+  void set_message(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Message::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Args =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      AndroidLogPacket_LogEvent_Arg,
+      AndroidLogPacket_LogEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Args kArgs() { return {}; }
+  template <typename T = AndroidLogPacket_LogEvent_Arg> T* add_args() {
+    return BeginNestedMessage<T>(9);
+  }
+
+};
+
+class AndroidLogPacket_LogEvent_Arg_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  AndroidLogPacket_LogEvent_Arg_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit AndroidLogPacket_LogEvent_Arg_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit AndroidLogPacket_LogEvent_Arg_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_int_value() const { return at<2>().valid(); }
+  int64_t int_value() const { return at<2>().as_int64(); }
+  bool has_float_value() const { return at<3>().valid(); }
+  float float_value() const { return at<3>().as_float(); }
+  bool has_string_value() const { return at<4>().valid(); }
+  ::protozero::ConstChars string_value() const { return at<4>().as_string(); }
+};
+
+class AndroidLogPacket_LogEvent_Arg : public ::protozero::Message {
+ public:
+  using Decoder = AndroidLogPacket_LogEvent_Arg_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kIntValueFieldNumber = 2,
+    kFloatValueFieldNumber = 3,
+    kStringValueFieldNumber = 4,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      AndroidLogPacket_LogEvent_Arg>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IntValue =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      AndroidLogPacket_LogEvent_Arg>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IntValue kIntValue() { return {}; }
+  void set_int_value(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IntValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FloatValue =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kFloat,
+      float,
+      AndroidLogPacket_LogEvent_Arg>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FloatValue kFloatValue() { return {}; }
+  void set_float_value(float value) {
+    static constexpr uint32_t field_id = FieldMetadata_FloatValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kFloat>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_StringValue =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      AndroidLogPacket_LogEvent_Arg>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StringValue kStringValue() { return {}; }
+  void set_string_value(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_StringValue::kFieldId, data, size);
+  }
+  void set_string_value(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_StringValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/android/frame_timeline_event.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_FRAME_TIMELINE_EVENT_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_FRAME_TIMELINE_EVENT_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class FrameTimelineEvent_ActualDisplayFrameStart;
+class FrameTimelineEvent_ActualSurfaceFrameStart;
+class FrameTimelineEvent_ExpectedDisplayFrameStart;
+class FrameTimelineEvent_ExpectedSurfaceFrameStart;
+class FrameTimelineEvent_FrameEnd;
+enum FrameTimelineEvent_PredictionType : int32_t;
+enum FrameTimelineEvent_PresentType : int32_t;
+
+enum FrameTimelineEvent_JankType : int32_t {
+  FrameTimelineEvent_JankType_JANK_UNSPECIFIED = 0,
+  FrameTimelineEvent_JankType_JANK_NONE = 1,
+  FrameTimelineEvent_JankType_JANK_SF_SCHEDULING = 2,
+  FrameTimelineEvent_JankType_JANK_PREDICTION_ERROR = 4,
+  FrameTimelineEvent_JankType_JANK_DISPLAY_HAL = 8,
+  FrameTimelineEvent_JankType_JANK_SF_CPU_DEADLINE_MISSED = 16,
+  FrameTimelineEvent_JankType_JANK_SF_GPU_DEADLINE_MISSED = 32,
+  FrameTimelineEvent_JankType_JANK_APP_DEADLINE_MISSED = 64,
+  FrameTimelineEvent_JankType_JANK_BUFFER_STUFFING = 128,
+  FrameTimelineEvent_JankType_JANK_UNKNOWN = 256,
+  FrameTimelineEvent_JankType_JANK_SF_STUFFING = 512,
+};
+
+const FrameTimelineEvent_JankType FrameTimelineEvent_JankType_MIN = FrameTimelineEvent_JankType_JANK_UNSPECIFIED;
+const FrameTimelineEvent_JankType FrameTimelineEvent_JankType_MAX = FrameTimelineEvent_JankType_JANK_SF_STUFFING;
+
+enum FrameTimelineEvent_PresentType : int32_t {
+  FrameTimelineEvent_PresentType_PRESENT_UNSPECIFIED = 0,
+  FrameTimelineEvent_PresentType_PRESENT_ON_TIME = 1,
+  FrameTimelineEvent_PresentType_PRESENT_LATE = 2,
+  FrameTimelineEvent_PresentType_PRESENT_EARLY = 3,
+  FrameTimelineEvent_PresentType_PRESENT_DROPPED = 4,
+  FrameTimelineEvent_PresentType_PRESENT_UNKNOWN = 5,
+};
+
+const FrameTimelineEvent_PresentType FrameTimelineEvent_PresentType_MIN = FrameTimelineEvent_PresentType_PRESENT_UNSPECIFIED;
+const FrameTimelineEvent_PresentType FrameTimelineEvent_PresentType_MAX = FrameTimelineEvent_PresentType_PRESENT_UNKNOWN;
+
+enum FrameTimelineEvent_PredictionType : int32_t {
+  FrameTimelineEvent_PredictionType_PREDICTION_UNSPECIFIED = 0,
+  FrameTimelineEvent_PredictionType_PREDICTION_VALID = 1,
+  FrameTimelineEvent_PredictionType_PREDICTION_EXPIRED = 2,
+  FrameTimelineEvent_PredictionType_PREDICTION_UNKNOWN = 3,
+};
+
+const FrameTimelineEvent_PredictionType FrameTimelineEvent_PredictionType_MIN = FrameTimelineEvent_PredictionType_PREDICTION_UNSPECIFIED;
+const FrameTimelineEvent_PredictionType FrameTimelineEvent_PredictionType_MAX = FrameTimelineEvent_PredictionType_PREDICTION_UNKNOWN;
+
+class FrameTimelineEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  FrameTimelineEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit FrameTimelineEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit FrameTimelineEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_expected_display_frame_start() const { return at<1>().valid(); }
+  ::protozero::ConstBytes expected_display_frame_start() const { return at<1>().as_bytes(); }
+  bool has_actual_display_frame_start() const { return at<2>().valid(); }
+  ::protozero::ConstBytes actual_display_frame_start() const { return at<2>().as_bytes(); }
+  bool has_expected_surface_frame_start() const { return at<3>().valid(); }
+  ::protozero::ConstBytes expected_surface_frame_start() const { return at<3>().as_bytes(); }
+  bool has_actual_surface_frame_start() const { return at<4>().valid(); }
+  ::protozero::ConstBytes actual_surface_frame_start() const { return at<4>().as_bytes(); }
+  bool has_frame_end() const { return at<5>().valid(); }
+  ::protozero::ConstBytes frame_end() const { return at<5>().as_bytes(); }
+};
+
+class FrameTimelineEvent : public ::protozero::Message {
+ public:
+  using Decoder = FrameTimelineEvent_Decoder;
+  enum : int32_t {
+    kExpectedDisplayFrameStartFieldNumber = 1,
+    kActualDisplayFrameStartFieldNumber = 2,
+    kExpectedSurfaceFrameStartFieldNumber = 3,
+    kActualSurfaceFrameStartFieldNumber = 4,
+    kFrameEndFieldNumber = 5,
+  };
+  using ExpectedSurfaceFrameStart = ::perfetto::protos::pbzero::FrameTimelineEvent_ExpectedSurfaceFrameStart;
+  using ActualSurfaceFrameStart = ::perfetto::protos::pbzero::FrameTimelineEvent_ActualSurfaceFrameStart;
+  using ExpectedDisplayFrameStart = ::perfetto::protos::pbzero::FrameTimelineEvent_ExpectedDisplayFrameStart;
+  using ActualDisplayFrameStart = ::perfetto::protos::pbzero::FrameTimelineEvent_ActualDisplayFrameStart;
+  using FrameEnd = ::perfetto::protos::pbzero::FrameTimelineEvent_FrameEnd;
+  using JankType = ::perfetto::protos::pbzero::FrameTimelineEvent_JankType;
+  using PresentType = ::perfetto::protos::pbzero::FrameTimelineEvent_PresentType;
+  using PredictionType = ::perfetto::protos::pbzero::FrameTimelineEvent_PredictionType;
+  static const JankType JANK_UNSPECIFIED = FrameTimelineEvent_JankType_JANK_UNSPECIFIED;
+  static const JankType JANK_NONE = FrameTimelineEvent_JankType_JANK_NONE;
+  static const JankType JANK_SF_SCHEDULING = FrameTimelineEvent_JankType_JANK_SF_SCHEDULING;
+  static const JankType JANK_PREDICTION_ERROR = FrameTimelineEvent_JankType_JANK_PREDICTION_ERROR;
+  static const JankType JANK_DISPLAY_HAL = FrameTimelineEvent_JankType_JANK_DISPLAY_HAL;
+  static const JankType JANK_SF_CPU_DEADLINE_MISSED = FrameTimelineEvent_JankType_JANK_SF_CPU_DEADLINE_MISSED;
+  static const JankType JANK_SF_GPU_DEADLINE_MISSED = FrameTimelineEvent_JankType_JANK_SF_GPU_DEADLINE_MISSED;
+  static const JankType JANK_APP_DEADLINE_MISSED = FrameTimelineEvent_JankType_JANK_APP_DEADLINE_MISSED;
+  static const JankType JANK_BUFFER_STUFFING = FrameTimelineEvent_JankType_JANK_BUFFER_STUFFING;
+  static const JankType JANK_UNKNOWN = FrameTimelineEvent_JankType_JANK_UNKNOWN;
+  static const JankType JANK_SF_STUFFING = FrameTimelineEvent_JankType_JANK_SF_STUFFING;
+  static const PresentType PRESENT_UNSPECIFIED = FrameTimelineEvent_PresentType_PRESENT_UNSPECIFIED;
+  static const PresentType PRESENT_ON_TIME = FrameTimelineEvent_PresentType_PRESENT_ON_TIME;
+  static const PresentType PRESENT_LATE = FrameTimelineEvent_PresentType_PRESENT_LATE;
+  static const PresentType PRESENT_EARLY = FrameTimelineEvent_PresentType_PRESENT_EARLY;
+  static const PresentType PRESENT_DROPPED = FrameTimelineEvent_PresentType_PRESENT_DROPPED;
+  static const PresentType PRESENT_UNKNOWN = FrameTimelineEvent_PresentType_PRESENT_UNKNOWN;
+  static const PredictionType PREDICTION_UNSPECIFIED = FrameTimelineEvent_PredictionType_PREDICTION_UNSPECIFIED;
+  static const PredictionType PREDICTION_VALID = FrameTimelineEvent_PredictionType_PREDICTION_VALID;
+  static const PredictionType PREDICTION_EXPIRED = FrameTimelineEvent_PredictionType_PREDICTION_EXPIRED;
+  static const PredictionType PREDICTION_UNKNOWN = FrameTimelineEvent_PredictionType_PREDICTION_UNKNOWN;
+
+  using FieldMetadata_ExpectedDisplayFrameStart =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      FrameTimelineEvent_ExpectedDisplayFrameStart,
+      FrameTimelineEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ExpectedDisplayFrameStart kExpectedDisplayFrameStart() { return {}; }
+  template <typename T = FrameTimelineEvent_ExpectedDisplayFrameStart> T* set_expected_display_frame_start() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_ActualDisplayFrameStart =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      FrameTimelineEvent_ActualDisplayFrameStart,
+      FrameTimelineEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ActualDisplayFrameStart kActualDisplayFrameStart() { return {}; }
+  template <typename T = FrameTimelineEvent_ActualDisplayFrameStart> T* set_actual_display_frame_start() {
+    return BeginNestedMessage<T>(2);
+  }
+
+
+  using FieldMetadata_ExpectedSurfaceFrameStart =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      FrameTimelineEvent_ExpectedSurfaceFrameStart,
+      FrameTimelineEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ExpectedSurfaceFrameStart kExpectedSurfaceFrameStart() { return {}; }
+  template <typename T = FrameTimelineEvent_ExpectedSurfaceFrameStart> T* set_expected_surface_frame_start() {
+    return BeginNestedMessage<T>(3);
+  }
+
+
+  using FieldMetadata_ActualSurfaceFrameStart =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      FrameTimelineEvent_ActualSurfaceFrameStart,
+      FrameTimelineEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ActualSurfaceFrameStart kActualSurfaceFrameStart() { return {}; }
+  template <typename T = FrameTimelineEvent_ActualSurfaceFrameStart> T* set_actual_surface_frame_start() {
+    return BeginNestedMessage<T>(4);
+  }
+
+
+  using FieldMetadata_FrameEnd =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      FrameTimelineEvent_FrameEnd,
+      FrameTimelineEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FrameEnd kFrameEnd() { return {}; }
+  template <typename T = FrameTimelineEvent_FrameEnd> T* set_frame_end() {
+    return BeginNestedMessage<T>(5);
+  }
+
+};
+
+class FrameTimelineEvent_FrameEnd_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  FrameTimelineEvent_FrameEnd_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit FrameTimelineEvent_FrameEnd_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit FrameTimelineEvent_FrameEnd_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_cookie() const { return at<1>().valid(); }
+  int64_t cookie() const { return at<1>().as_int64(); }
+};
+
+class FrameTimelineEvent_FrameEnd : public ::protozero::Message {
+ public:
+  using Decoder = FrameTimelineEvent_FrameEnd_Decoder;
+  enum : int32_t {
+    kCookieFieldNumber = 1,
+  };
+
+  using FieldMetadata_Cookie =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      FrameTimelineEvent_FrameEnd>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cookie kCookie() { return {}; }
+  void set_cookie(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cookie::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class FrameTimelineEvent_ActualDisplayFrameStart_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  FrameTimelineEvent_ActualDisplayFrameStart_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit FrameTimelineEvent_ActualDisplayFrameStart_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit FrameTimelineEvent_ActualDisplayFrameStart_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_cookie() const { return at<1>().valid(); }
+  int64_t cookie() const { return at<1>().as_int64(); }
+  bool has_token() const { return at<2>().valid(); }
+  int64_t token() const { return at<2>().as_int64(); }
+  bool has_pid() const { return at<3>().valid(); }
+  int32_t pid() const { return at<3>().as_int32(); }
+  bool has_present_type() const { return at<4>().valid(); }
+  int32_t present_type() const { return at<4>().as_int32(); }
+  bool has_on_time_finish() const { return at<5>().valid(); }
+  bool on_time_finish() const { return at<5>().as_bool(); }
+  bool has_gpu_composition() const { return at<6>().valid(); }
+  bool gpu_composition() const { return at<6>().as_bool(); }
+  bool has_jank_type() const { return at<7>().valid(); }
+  int32_t jank_type() const { return at<7>().as_int32(); }
+  bool has_prediction_type() const { return at<8>().valid(); }
+  int32_t prediction_type() const { return at<8>().as_int32(); }
+};
+
+class FrameTimelineEvent_ActualDisplayFrameStart : public ::protozero::Message {
+ public:
+  using Decoder = FrameTimelineEvent_ActualDisplayFrameStart_Decoder;
+  enum : int32_t {
+    kCookieFieldNumber = 1,
+    kTokenFieldNumber = 2,
+    kPidFieldNumber = 3,
+    kPresentTypeFieldNumber = 4,
+    kOnTimeFinishFieldNumber = 5,
+    kGpuCompositionFieldNumber = 6,
+    kJankTypeFieldNumber = 7,
+    kPredictionTypeFieldNumber = 8,
+  };
+
+  using FieldMetadata_Cookie =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      FrameTimelineEvent_ActualDisplayFrameStart>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cookie kCookie() { return {}; }
+  void set_cookie(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cookie::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Token =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      FrameTimelineEvent_ActualDisplayFrameStart>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Token kToken() { return {}; }
+  void set_token(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Token::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      FrameTimelineEvent_ActualDisplayFrameStart>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PresentType =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::FrameTimelineEvent_PresentType,
+      FrameTimelineEvent_ActualDisplayFrameStart>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PresentType kPresentType() { return {}; }
+  void set_present_type(::perfetto::protos::pbzero::FrameTimelineEvent_PresentType value) {
+    static constexpr uint32_t field_id = FieldMetadata_PresentType::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OnTimeFinish =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      FrameTimelineEvent_ActualDisplayFrameStart>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OnTimeFinish kOnTimeFinish() { return {}; }
+  void set_on_time_finish(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_OnTimeFinish::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_GpuComposition =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      FrameTimelineEvent_ActualDisplayFrameStart>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GpuComposition kGpuComposition() { return {}; }
+  void set_gpu_composition(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_GpuComposition::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_JankType =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      FrameTimelineEvent_ActualDisplayFrameStart>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_JankType kJankType() { return {}; }
+  void set_jank_type(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_JankType::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PredictionType =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::FrameTimelineEvent_PredictionType,
+      FrameTimelineEvent_ActualDisplayFrameStart>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PredictionType kPredictionType() { return {}; }
+  void set_prediction_type(::perfetto::protos::pbzero::FrameTimelineEvent_PredictionType value) {
+    static constexpr uint32_t field_id = FieldMetadata_PredictionType::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class FrameTimelineEvent_ExpectedDisplayFrameStart_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  FrameTimelineEvent_ExpectedDisplayFrameStart_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit FrameTimelineEvent_ExpectedDisplayFrameStart_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit FrameTimelineEvent_ExpectedDisplayFrameStart_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_cookie() const { return at<1>().valid(); }
+  int64_t cookie() const { return at<1>().as_int64(); }
+  bool has_token() const { return at<2>().valid(); }
+  int64_t token() const { return at<2>().as_int64(); }
+  bool has_pid() const { return at<3>().valid(); }
+  int32_t pid() const { return at<3>().as_int32(); }
+};
+
+class FrameTimelineEvent_ExpectedDisplayFrameStart : public ::protozero::Message {
+ public:
+  using Decoder = FrameTimelineEvent_ExpectedDisplayFrameStart_Decoder;
+  enum : int32_t {
+    kCookieFieldNumber = 1,
+    kTokenFieldNumber = 2,
+    kPidFieldNumber = 3,
+  };
+
+  using FieldMetadata_Cookie =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      FrameTimelineEvent_ExpectedDisplayFrameStart>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cookie kCookie() { return {}; }
+  void set_cookie(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cookie::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Token =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      FrameTimelineEvent_ExpectedDisplayFrameStart>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Token kToken() { return {}; }
+  void set_token(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Token::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      FrameTimelineEvent_ExpectedDisplayFrameStart>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class FrameTimelineEvent_ActualSurfaceFrameStart_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/11, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  FrameTimelineEvent_ActualSurfaceFrameStart_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit FrameTimelineEvent_ActualSurfaceFrameStart_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit FrameTimelineEvent_ActualSurfaceFrameStart_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_cookie() const { return at<1>().valid(); }
+  int64_t cookie() const { return at<1>().as_int64(); }
+  bool has_token() const { return at<2>().valid(); }
+  int64_t token() const { return at<2>().as_int64(); }
+  bool has_display_frame_token() const { return at<3>().valid(); }
+  int64_t display_frame_token() const { return at<3>().as_int64(); }
+  bool has_pid() const { return at<4>().valid(); }
+  int32_t pid() const { return at<4>().as_int32(); }
+  bool has_layer_name() const { return at<5>().valid(); }
+  ::protozero::ConstChars layer_name() const { return at<5>().as_string(); }
+  bool has_present_type() const { return at<6>().valid(); }
+  int32_t present_type() const { return at<6>().as_int32(); }
+  bool has_on_time_finish() const { return at<7>().valid(); }
+  bool on_time_finish() const { return at<7>().as_bool(); }
+  bool has_gpu_composition() const { return at<8>().valid(); }
+  bool gpu_composition() const { return at<8>().as_bool(); }
+  bool has_jank_type() const { return at<9>().valid(); }
+  int32_t jank_type() const { return at<9>().as_int32(); }
+  bool has_prediction_type() const { return at<10>().valid(); }
+  int32_t prediction_type() const { return at<10>().as_int32(); }
+  bool has_is_buffer() const { return at<11>().valid(); }
+  bool is_buffer() const { return at<11>().as_bool(); }
+};
+
+class FrameTimelineEvent_ActualSurfaceFrameStart : public ::protozero::Message {
+ public:
+  using Decoder = FrameTimelineEvent_ActualSurfaceFrameStart_Decoder;
+  enum : int32_t {
+    kCookieFieldNumber = 1,
+    kTokenFieldNumber = 2,
+    kDisplayFrameTokenFieldNumber = 3,
+    kPidFieldNumber = 4,
+    kLayerNameFieldNumber = 5,
+    kPresentTypeFieldNumber = 6,
+    kOnTimeFinishFieldNumber = 7,
+    kGpuCompositionFieldNumber = 8,
+    kJankTypeFieldNumber = 9,
+    kPredictionTypeFieldNumber = 10,
+    kIsBufferFieldNumber = 11,
+  };
+
+  using FieldMetadata_Cookie =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      FrameTimelineEvent_ActualSurfaceFrameStart>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cookie kCookie() { return {}; }
+  void set_cookie(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cookie::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Token =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      FrameTimelineEvent_ActualSurfaceFrameStart>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Token kToken() { return {}; }
+  void set_token(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Token::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DisplayFrameToken =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      FrameTimelineEvent_ActualSurfaceFrameStart>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DisplayFrameToken kDisplayFrameToken() { return {}; }
+  void set_display_frame_token(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DisplayFrameToken::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      FrameTimelineEvent_ActualSurfaceFrameStart>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LayerName =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      FrameTimelineEvent_ActualSurfaceFrameStart>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LayerName kLayerName() { return {}; }
+  void set_layer_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_LayerName::kFieldId, data, size);
+  }
+  void set_layer_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_LayerName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PresentType =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::FrameTimelineEvent_PresentType,
+      FrameTimelineEvent_ActualSurfaceFrameStart>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PresentType kPresentType() { return {}; }
+  void set_present_type(::perfetto::protos::pbzero::FrameTimelineEvent_PresentType value) {
+    static constexpr uint32_t field_id = FieldMetadata_PresentType::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OnTimeFinish =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      FrameTimelineEvent_ActualSurfaceFrameStart>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OnTimeFinish kOnTimeFinish() { return {}; }
+  void set_on_time_finish(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_OnTimeFinish::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_GpuComposition =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      FrameTimelineEvent_ActualSurfaceFrameStart>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GpuComposition kGpuComposition() { return {}; }
+  void set_gpu_composition(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_GpuComposition::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_JankType =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      FrameTimelineEvent_ActualSurfaceFrameStart>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_JankType kJankType() { return {}; }
+  void set_jank_type(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_JankType::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PredictionType =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::FrameTimelineEvent_PredictionType,
+      FrameTimelineEvent_ActualSurfaceFrameStart>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PredictionType kPredictionType() { return {}; }
+  void set_prediction_type(::perfetto::protos::pbzero::FrameTimelineEvent_PredictionType value) {
+    static constexpr uint32_t field_id = FieldMetadata_PredictionType::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IsBuffer =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      FrameTimelineEvent_ActualSurfaceFrameStart>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IsBuffer kIsBuffer() { return {}; }
+  void set_is_buffer(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_IsBuffer::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class FrameTimelineEvent_ExpectedSurfaceFrameStart_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  FrameTimelineEvent_ExpectedSurfaceFrameStart_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit FrameTimelineEvent_ExpectedSurfaceFrameStart_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit FrameTimelineEvent_ExpectedSurfaceFrameStart_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_cookie() const { return at<1>().valid(); }
+  int64_t cookie() const { return at<1>().as_int64(); }
+  bool has_token() const { return at<2>().valid(); }
+  int64_t token() const { return at<2>().as_int64(); }
+  bool has_display_frame_token() const { return at<3>().valid(); }
+  int64_t display_frame_token() const { return at<3>().as_int64(); }
+  bool has_pid() const { return at<4>().valid(); }
+  int32_t pid() const { return at<4>().as_int32(); }
+  bool has_layer_name() const { return at<5>().valid(); }
+  ::protozero::ConstChars layer_name() const { return at<5>().as_string(); }
+};
+
+class FrameTimelineEvent_ExpectedSurfaceFrameStart : public ::protozero::Message {
+ public:
+  using Decoder = FrameTimelineEvent_ExpectedSurfaceFrameStart_Decoder;
+  enum : int32_t {
+    kCookieFieldNumber = 1,
+    kTokenFieldNumber = 2,
+    kDisplayFrameTokenFieldNumber = 3,
+    kPidFieldNumber = 4,
+    kLayerNameFieldNumber = 5,
+  };
+
+  using FieldMetadata_Cookie =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      FrameTimelineEvent_ExpectedSurfaceFrameStart>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cookie kCookie() { return {}; }
+  void set_cookie(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cookie::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Token =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      FrameTimelineEvent_ExpectedSurfaceFrameStart>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Token kToken() { return {}; }
+  void set_token(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Token::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DisplayFrameToken =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      FrameTimelineEvent_ExpectedSurfaceFrameStart>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DisplayFrameToken kDisplayFrameToken() { return {}; }
+  void set_display_frame_token(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DisplayFrameToken::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      FrameTimelineEvent_ExpectedSurfaceFrameStart>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LayerName =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      FrameTimelineEvent_ExpectedSurfaceFrameStart>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LayerName kLayerName() { return {}; }
+  void set_layer_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_LayerName::kFieldId, data, size);
+  }
+  void set_layer_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_LayerName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/android/gpu_mem_event.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_GPU_MEM_EVENT_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_GPU_MEM_EVENT_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class GpuMemTotalEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  GpuMemTotalEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit GpuMemTotalEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit GpuMemTotalEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_gpu_id() const { return at<1>().valid(); }
+  uint32_t gpu_id() const { return at<1>().as_uint32(); }
+  bool has_pid() const { return at<2>().valid(); }
+  uint32_t pid() const { return at<2>().as_uint32(); }
+  bool has_size() const { return at<3>().valid(); }
+  uint64_t size() const { return at<3>().as_uint64(); }
+};
+
+class GpuMemTotalEvent : public ::protozero::Message {
+ public:
+  using Decoder = GpuMemTotalEvent_Decoder;
+  enum : int32_t {
+    kGpuIdFieldNumber = 1,
+    kPidFieldNumber = 2,
+    kSizeFieldNumber = 3,
+  };
+
+  using FieldMetadata_GpuId =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      GpuMemTotalEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GpuId kGpuId() { return {}; }
+  void set_gpu_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_GpuId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      GpuMemTotalEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Size =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      GpuMemTotalEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Size kSize() { return {}; }
+  void set_size(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Size::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/android/graphics_frame_event.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_GRAPHICS_FRAME_EVENT_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_GRAPHICS_FRAME_EVENT_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class GraphicsFrameEvent_BufferEvent;
+enum GraphicsFrameEvent_BufferEventType : int32_t;
+
+enum GraphicsFrameEvent_BufferEventType : int32_t {
+  GraphicsFrameEvent_BufferEventType_UNSPECIFIED = 0,
+  GraphicsFrameEvent_BufferEventType_DEQUEUE = 1,
+  GraphicsFrameEvent_BufferEventType_QUEUE = 2,
+  GraphicsFrameEvent_BufferEventType_POST = 3,
+  GraphicsFrameEvent_BufferEventType_ACQUIRE_FENCE = 4,
+  GraphicsFrameEvent_BufferEventType_LATCH = 5,
+  GraphicsFrameEvent_BufferEventType_HWC_COMPOSITION_QUEUED = 6,
+  GraphicsFrameEvent_BufferEventType_FALLBACK_COMPOSITION = 7,
+  GraphicsFrameEvent_BufferEventType_PRESENT_FENCE = 8,
+  GraphicsFrameEvent_BufferEventType_RELEASE_FENCE = 9,
+  GraphicsFrameEvent_BufferEventType_MODIFY = 10,
+  GraphicsFrameEvent_BufferEventType_DETACH = 11,
+  GraphicsFrameEvent_BufferEventType_ATTACH = 12,
+  GraphicsFrameEvent_BufferEventType_CANCEL = 13,
+};
+
+const GraphicsFrameEvent_BufferEventType GraphicsFrameEvent_BufferEventType_MIN = GraphicsFrameEvent_BufferEventType_UNSPECIFIED;
+const GraphicsFrameEvent_BufferEventType GraphicsFrameEvent_BufferEventType_MAX = GraphicsFrameEvent_BufferEventType_CANCEL;
+
+class GraphicsFrameEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  GraphicsFrameEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit GraphicsFrameEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit GraphicsFrameEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_buffer_event() const { return at<1>().valid(); }
+  ::protozero::ConstBytes buffer_event() const { return at<1>().as_bytes(); }
+};
+
+class GraphicsFrameEvent : public ::protozero::Message {
+ public:
+  using Decoder = GraphicsFrameEvent_Decoder;
+  enum : int32_t {
+    kBufferEventFieldNumber = 1,
+  };
+  using BufferEvent = ::perfetto::protos::pbzero::GraphicsFrameEvent_BufferEvent;
+  using BufferEventType = ::perfetto::protos::pbzero::GraphicsFrameEvent_BufferEventType;
+  static const BufferEventType UNSPECIFIED = GraphicsFrameEvent_BufferEventType_UNSPECIFIED;
+  static const BufferEventType DEQUEUE = GraphicsFrameEvent_BufferEventType_DEQUEUE;
+  static const BufferEventType QUEUE = GraphicsFrameEvent_BufferEventType_QUEUE;
+  static const BufferEventType POST = GraphicsFrameEvent_BufferEventType_POST;
+  static const BufferEventType ACQUIRE_FENCE = GraphicsFrameEvent_BufferEventType_ACQUIRE_FENCE;
+  static const BufferEventType LATCH = GraphicsFrameEvent_BufferEventType_LATCH;
+  static const BufferEventType HWC_COMPOSITION_QUEUED = GraphicsFrameEvent_BufferEventType_HWC_COMPOSITION_QUEUED;
+  static const BufferEventType FALLBACK_COMPOSITION = GraphicsFrameEvent_BufferEventType_FALLBACK_COMPOSITION;
+  static const BufferEventType PRESENT_FENCE = GraphicsFrameEvent_BufferEventType_PRESENT_FENCE;
+  static const BufferEventType RELEASE_FENCE = GraphicsFrameEvent_BufferEventType_RELEASE_FENCE;
+  static const BufferEventType MODIFY = GraphicsFrameEvent_BufferEventType_MODIFY;
+  static const BufferEventType DETACH = GraphicsFrameEvent_BufferEventType_DETACH;
+  static const BufferEventType ATTACH = GraphicsFrameEvent_BufferEventType_ATTACH;
+  static const BufferEventType CANCEL = GraphicsFrameEvent_BufferEventType_CANCEL;
+
+  using FieldMetadata_BufferEvent =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      GraphicsFrameEvent_BufferEvent,
+      GraphicsFrameEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BufferEvent kBufferEvent() { return {}; }
+  template <typename T = GraphicsFrameEvent_BufferEvent> T* set_buffer_event() {
+    return BeginNestedMessage<T>(1);
+  }
+
+};
+
+class GraphicsFrameEvent_BufferEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  GraphicsFrameEvent_BufferEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit GraphicsFrameEvent_BufferEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit GraphicsFrameEvent_BufferEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_frame_number() const { return at<1>().valid(); }
+  uint32_t frame_number() const { return at<1>().as_uint32(); }
+  bool has_type() const { return at<2>().valid(); }
+  int32_t type() const { return at<2>().as_int32(); }
+  bool has_layer_name() const { return at<3>().valid(); }
+  ::protozero::ConstChars layer_name() const { return at<3>().as_string(); }
+  bool has_duration_ns() const { return at<4>().valid(); }
+  uint64_t duration_ns() const { return at<4>().as_uint64(); }
+  bool has_buffer_id() const { return at<5>().valid(); }
+  uint32_t buffer_id() const { return at<5>().as_uint32(); }
+};
+
+class GraphicsFrameEvent_BufferEvent : public ::protozero::Message {
+ public:
+  using Decoder = GraphicsFrameEvent_BufferEvent_Decoder;
+  enum : int32_t {
+    kFrameNumberFieldNumber = 1,
+    kTypeFieldNumber = 2,
+    kLayerNameFieldNumber = 3,
+    kDurationNsFieldNumber = 4,
+    kBufferIdFieldNumber = 5,
+  };
+
+  using FieldMetadata_FrameNumber =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      GraphicsFrameEvent_BufferEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FrameNumber kFrameNumber() { return {}; }
+  void set_frame_number(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FrameNumber::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Type =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::GraphicsFrameEvent_BufferEventType,
+      GraphicsFrameEvent_BufferEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Type kType() { return {}; }
+  void set_type(::perfetto::protos::pbzero::GraphicsFrameEvent_BufferEventType value) {
+    static constexpr uint32_t field_id = FieldMetadata_Type::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LayerName =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      GraphicsFrameEvent_BufferEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LayerName kLayerName() { return {}; }
+  void set_layer_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_LayerName::kFieldId, data, size);
+  }
+  void set_layer_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_LayerName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DurationNs =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      GraphicsFrameEvent_BufferEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DurationNs kDurationNs() { return {}; }
+  void set_duration_ns(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DurationNs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BufferId =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      GraphicsFrameEvent_BufferEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BufferId kBufferId() { return {}; }
+  void set_buffer_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BufferId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/android/initial_display_state.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_INITIAL_DISPLAY_STATE_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_INITIAL_DISPLAY_STATE_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class InitialDisplayState_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  InitialDisplayState_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit InitialDisplayState_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit InitialDisplayState_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_display_state() const { return at<1>().valid(); }
+  int32_t display_state() const { return at<1>().as_int32(); }
+  bool has_brightness() const { return at<2>().valid(); }
+  double brightness() const { return at<2>().as_double(); }
+};
+
+class InitialDisplayState : public ::protozero::Message {
+ public:
+  using Decoder = InitialDisplayState_Decoder;
+  enum : int32_t {
+    kDisplayStateFieldNumber = 1,
+    kBrightnessFieldNumber = 2,
+  };
+
+  using FieldMetadata_DisplayState =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      InitialDisplayState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DisplayState kDisplayState() { return {}; }
+  void set_display_state(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DisplayState::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Brightness =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kDouble,
+      double,
+      InitialDisplayState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Brightness kBrightness() { return {}; }
+  void set_brightness(double value) {
+    static constexpr uint32_t field_id = FieldMetadata_Brightness::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kDouble>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/android/packages_list.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_PACKAGES_LIST_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_PACKAGES_LIST_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class PackagesList_PackageInfo;
+
+class PackagesList_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  PackagesList_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit PackagesList_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit PackagesList_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_packages() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> packages() const { return GetRepeated<::protozero::ConstBytes>(1); }
+  bool has_parse_error() const { return at<2>().valid(); }
+  bool parse_error() const { return at<2>().as_bool(); }
+  bool has_read_error() const { return at<3>().valid(); }
+  bool read_error() const { return at<3>().as_bool(); }
+};
+
+class PackagesList : public ::protozero::Message {
+ public:
+  using Decoder = PackagesList_Decoder;
+  enum : int32_t {
+    kPackagesFieldNumber = 1,
+    kParseErrorFieldNumber = 2,
+    kReadErrorFieldNumber = 3,
+  };
+  using PackageInfo = ::perfetto::protos::pbzero::PackagesList_PackageInfo;
+
+  using FieldMetadata_Packages =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      PackagesList_PackageInfo,
+      PackagesList>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Packages kPackages() { return {}; }
+  template <typename T = PackagesList_PackageInfo> T* add_packages() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_ParseError =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      PackagesList>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ParseError kParseError() { return {}; }
+  void set_parse_error(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_ParseError::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ReadError =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      PackagesList>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ReadError kReadError() { return {}; }
+  void set_read_error(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_ReadError::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class PackagesList_PackageInfo_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  PackagesList_PackageInfo_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit PackagesList_PackageInfo_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit PackagesList_PackageInfo_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_uid() const { return at<2>().valid(); }
+  uint64_t uid() const { return at<2>().as_uint64(); }
+  bool has_debuggable() const { return at<3>().valid(); }
+  bool debuggable() const { return at<3>().as_bool(); }
+  bool has_profileable_from_shell() const { return at<4>().valid(); }
+  bool profileable_from_shell() const { return at<4>().as_bool(); }
+  bool has_version_code() const { return at<5>().valid(); }
+  int64_t version_code() const { return at<5>().as_int64(); }
+};
+
+class PackagesList_PackageInfo : public ::protozero::Message {
+ public:
+  using Decoder = PackagesList_PackageInfo_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kUidFieldNumber = 2,
+    kDebuggableFieldNumber = 3,
+    kProfileableFromShellFieldNumber = 4,
+    kVersionCodeFieldNumber = 5,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      PackagesList_PackageInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Uid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      PackagesList_PackageInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Uid kUid() { return {}; }
+  void set_uid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Uid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Debuggable =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      PackagesList_PackageInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Debuggable kDebuggable() { return {}; }
+  void set_debuggable(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_Debuggable::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ProfileableFromShell =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      PackagesList_PackageInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProfileableFromShell kProfileableFromShell() { return {}; }
+  void set_profileable_from_shell(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProfileableFromShell::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_VersionCode =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      PackagesList_PackageInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_VersionCode kVersionCode() { return {}; }
+  void set_version_code(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_VersionCode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/chrome/chrome_benchmark_metadata.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_CHROME_CHROME_BENCHMARK_METADATA_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_CHROME_CHROME_BENCHMARK_METADATA_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class ChromeBenchmarkMetadata_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/9, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  ChromeBenchmarkMetadata_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ChromeBenchmarkMetadata_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ChromeBenchmarkMetadata_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_benchmark_start_time_us() const { return at<1>().valid(); }
+  int64_t benchmark_start_time_us() const { return at<1>().as_int64(); }
+  bool has_story_run_time_us() const { return at<2>().valid(); }
+  int64_t story_run_time_us() const { return at<2>().as_int64(); }
+  bool has_benchmark_name() const { return at<3>().valid(); }
+  ::protozero::ConstChars benchmark_name() const { return at<3>().as_string(); }
+  bool has_benchmark_description() const { return at<4>().valid(); }
+  ::protozero::ConstChars benchmark_description() const { return at<4>().as_string(); }
+  bool has_label() const { return at<5>().valid(); }
+  ::protozero::ConstChars label() const { return at<5>().as_string(); }
+  bool has_story_name() const { return at<6>().valid(); }
+  ::protozero::ConstChars story_name() const { return at<6>().as_string(); }
+  bool has_story_tags() const { return at<7>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> story_tags() const { return GetRepeated<::protozero::ConstChars>(7); }
+  bool has_story_run_index() const { return at<8>().valid(); }
+  int32_t story_run_index() const { return at<8>().as_int32(); }
+  bool has_had_failures() const { return at<9>().valid(); }
+  bool had_failures() const { return at<9>().as_bool(); }
+};
+
+class ChromeBenchmarkMetadata : public ::protozero::Message {
+ public:
+  using Decoder = ChromeBenchmarkMetadata_Decoder;
+  enum : int32_t {
+    kBenchmarkStartTimeUsFieldNumber = 1,
+    kStoryRunTimeUsFieldNumber = 2,
+    kBenchmarkNameFieldNumber = 3,
+    kBenchmarkDescriptionFieldNumber = 4,
+    kLabelFieldNumber = 5,
+    kStoryNameFieldNumber = 6,
+    kStoryTagsFieldNumber = 7,
+    kStoryRunIndexFieldNumber = 8,
+    kHadFailuresFieldNumber = 9,
+  };
+
+  using FieldMetadata_BenchmarkStartTimeUs =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      ChromeBenchmarkMetadata>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BenchmarkStartTimeUs kBenchmarkStartTimeUs() { return {}; }
+  void set_benchmark_start_time_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BenchmarkStartTimeUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_StoryRunTimeUs =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      ChromeBenchmarkMetadata>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StoryRunTimeUs kStoryRunTimeUs() { return {}; }
+  void set_story_run_time_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_StoryRunTimeUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BenchmarkName =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ChromeBenchmarkMetadata>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BenchmarkName kBenchmarkName() { return {}; }
+  void set_benchmark_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_BenchmarkName::kFieldId, data, size);
+  }
+  void set_benchmark_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_BenchmarkName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BenchmarkDescription =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ChromeBenchmarkMetadata>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BenchmarkDescription kBenchmarkDescription() { return {}; }
+  void set_benchmark_description(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_BenchmarkDescription::kFieldId, data, size);
+  }
+  void set_benchmark_description(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_BenchmarkDescription::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Label =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ChromeBenchmarkMetadata>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Label kLabel() { return {}; }
+  void set_label(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Label::kFieldId, data, size);
+  }
+  void set_label(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Label::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_StoryName =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ChromeBenchmarkMetadata>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StoryName kStoryName() { return {}; }
+  void set_story_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_StoryName::kFieldId, data, size);
+  }
+  void set_story_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_StoryName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_StoryTags =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ChromeBenchmarkMetadata>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StoryTags kStoryTags() { return {}; }
+  void add_story_tags(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_StoryTags::kFieldId, data, size);
+  }
+  void add_story_tags(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_StoryTags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_StoryRunIndex =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ChromeBenchmarkMetadata>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StoryRunIndex kStoryRunIndex() { return {}; }
+  void set_story_run_index(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_StoryRunIndex::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HadFailures =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeBenchmarkMetadata>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HadFailures kHadFailures() { return {}; }
+  void set_had_failures(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_HadFailures::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/chrome/chrome_metadata.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_CHROME_CHROME_METADATA_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_CHROME_CHROME_METADATA_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class BackgroundTracingMetadata;
+class BackgroundTracingMetadata_TriggerRule;
+class BackgroundTracingMetadata_TriggerRule_HistogramRule;
+class BackgroundTracingMetadata_TriggerRule_NamedRule;
+enum BackgroundTracingMetadata_TriggerRule_NamedRule_EventType : int32_t;
+enum BackgroundTracingMetadata_TriggerRule_TriggerType : int32_t;
+
+enum BackgroundTracingMetadata_TriggerRule_TriggerType : int32_t {
+  BackgroundTracingMetadata_TriggerRule_TriggerType_TRIGGER_UNSPECIFIED = 0,
+  BackgroundTracingMetadata_TriggerRule_TriggerType_MONITOR_AND_DUMP_WHEN_SPECIFIC_HISTOGRAM_AND_VALUE = 1,
+  BackgroundTracingMetadata_TriggerRule_TriggerType_MONITOR_AND_DUMP_WHEN_TRIGGER_NAMED = 2,
+};
+
+const BackgroundTracingMetadata_TriggerRule_TriggerType BackgroundTracingMetadata_TriggerRule_TriggerType_MIN = BackgroundTracingMetadata_TriggerRule_TriggerType_TRIGGER_UNSPECIFIED;
+const BackgroundTracingMetadata_TriggerRule_TriggerType BackgroundTracingMetadata_TriggerRule_TriggerType_MAX = BackgroundTracingMetadata_TriggerRule_TriggerType_MONITOR_AND_DUMP_WHEN_TRIGGER_NAMED;
+
+enum BackgroundTracingMetadata_TriggerRule_NamedRule_EventType : int32_t {
+  BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_UNSPECIFIED = 0,
+  BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_SESSION_RESTORE = 1,
+  BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_NAVIGATION = 2,
+  BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_STARTUP = 3,
+  BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_REACHED_CODE = 4,
+  BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_CONTENT_TRIGGER = 5,
+  BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_TEST_RULE = 1000,
+};
+
+const BackgroundTracingMetadata_TriggerRule_NamedRule_EventType BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_MIN = BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_UNSPECIFIED;
+const BackgroundTracingMetadata_TriggerRule_NamedRule_EventType BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_MAX = BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_TEST_RULE;
+
+class BackgroundTracingMetadata_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  BackgroundTracingMetadata_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BackgroundTracingMetadata_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BackgroundTracingMetadata_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_triggered_rule() const { return at<1>().valid(); }
+  ::protozero::ConstBytes triggered_rule() const { return at<1>().as_bytes(); }
+  bool has_active_rules() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> active_rules() const { return GetRepeated<::protozero::ConstBytes>(2); }
+};
+
+class BackgroundTracingMetadata : public ::protozero::Message {
+ public:
+  using Decoder = BackgroundTracingMetadata_Decoder;
+  enum : int32_t {
+    kTriggeredRuleFieldNumber = 1,
+    kActiveRulesFieldNumber = 2,
+  };
+  using TriggerRule = ::perfetto::protos::pbzero::BackgroundTracingMetadata_TriggerRule;
+
+  using FieldMetadata_TriggeredRule =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BackgroundTracingMetadata_TriggerRule,
+      BackgroundTracingMetadata>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TriggeredRule kTriggeredRule() { return {}; }
+  template <typename T = BackgroundTracingMetadata_TriggerRule> T* set_triggered_rule() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_ActiveRules =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BackgroundTracingMetadata_TriggerRule,
+      BackgroundTracingMetadata>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ActiveRules kActiveRules() { return {}; }
+  template <typename T = BackgroundTracingMetadata_TriggerRule> T* add_active_rules() {
+    return BeginNestedMessage<T>(2);
+  }
+
+};
+
+class BackgroundTracingMetadata_TriggerRule_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BackgroundTracingMetadata_TriggerRule_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BackgroundTracingMetadata_TriggerRule_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BackgroundTracingMetadata_TriggerRule_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_trigger_type() const { return at<1>().valid(); }
+  int32_t trigger_type() const { return at<1>().as_int32(); }
+  bool has_histogram_rule() const { return at<2>().valid(); }
+  ::protozero::ConstBytes histogram_rule() const { return at<2>().as_bytes(); }
+  bool has_named_rule() const { return at<3>().valid(); }
+  ::protozero::ConstBytes named_rule() const { return at<3>().as_bytes(); }
+};
+
+class BackgroundTracingMetadata_TriggerRule : public ::protozero::Message {
+ public:
+  using Decoder = BackgroundTracingMetadata_TriggerRule_Decoder;
+  enum : int32_t {
+    kTriggerTypeFieldNumber = 1,
+    kHistogramRuleFieldNumber = 2,
+    kNamedRuleFieldNumber = 3,
+  };
+  using HistogramRule = ::perfetto::protos::pbzero::BackgroundTracingMetadata_TriggerRule_HistogramRule;
+  using NamedRule = ::perfetto::protos::pbzero::BackgroundTracingMetadata_TriggerRule_NamedRule;
+  using TriggerType = ::perfetto::protos::pbzero::BackgroundTracingMetadata_TriggerRule_TriggerType;
+  static const TriggerType TRIGGER_UNSPECIFIED = BackgroundTracingMetadata_TriggerRule_TriggerType_TRIGGER_UNSPECIFIED;
+  static const TriggerType MONITOR_AND_DUMP_WHEN_SPECIFIC_HISTOGRAM_AND_VALUE = BackgroundTracingMetadata_TriggerRule_TriggerType_MONITOR_AND_DUMP_WHEN_SPECIFIC_HISTOGRAM_AND_VALUE;
+  static const TriggerType MONITOR_AND_DUMP_WHEN_TRIGGER_NAMED = BackgroundTracingMetadata_TriggerRule_TriggerType_MONITOR_AND_DUMP_WHEN_TRIGGER_NAMED;
+
+  using FieldMetadata_TriggerType =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::BackgroundTracingMetadata_TriggerRule_TriggerType,
+      BackgroundTracingMetadata_TriggerRule>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TriggerType kTriggerType() { return {}; }
+  void set_trigger_type(::perfetto::protos::pbzero::BackgroundTracingMetadata_TriggerRule_TriggerType value) {
+    static constexpr uint32_t field_id = FieldMetadata_TriggerType::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HistogramRule =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BackgroundTracingMetadata_TriggerRule_HistogramRule,
+      BackgroundTracingMetadata_TriggerRule>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HistogramRule kHistogramRule() { return {}; }
+  template <typename T = BackgroundTracingMetadata_TriggerRule_HistogramRule> T* set_histogram_rule() {
+    return BeginNestedMessage<T>(2);
+  }
+
+
+  using FieldMetadata_NamedRule =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BackgroundTracingMetadata_TriggerRule_NamedRule,
+      BackgroundTracingMetadata_TriggerRule>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NamedRule kNamedRule() { return {}; }
+  template <typename T = BackgroundTracingMetadata_TriggerRule_NamedRule> T* set_named_rule() {
+    return BeginNestedMessage<T>(3);
+  }
+
+};
+
+class BackgroundTracingMetadata_TriggerRule_NamedRule_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BackgroundTracingMetadata_TriggerRule_NamedRule_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BackgroundTracingMetadata_TriggerRule_NamedRule_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BackgroundTracingMetadata_TriggerRule_NamedRule_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_event_type() const { return at<1>().valid(); }
+  int32_t event_type() const { return at<1>().as_int32(); }
+  bool has_content_trigger_name_hash() const { return at<2>().valid(); }
+  uint64_t content_trigger_name_hash() const { return at<2>().as_uint64(); }
+};
+
+class BackgroundTracingMetadata_TriggerRule_NamedRule : public ::protozero::Message {
+ public:
+  using Decoder = BackgroundTracingMetadata_TriggerRule_NamedRule_Decoder;
+  enum : int32_t {
+    kEventTypeFieldNumber = 1,
+    kContentTriggerNameHashFieldNumber = 2,
+  };
+  using EventType = ::perfetto::protos::pbzero::BackgroundTracingMetadata_TriggerRule_NamedRule_EventType;
+  static const EventType UNSPECIFIED = BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_UNSPECIFIED;
+  static const EventType SESSION_RESTORE = BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_SESSION_RESTORE;
+  static const EventType NAVIGATION = BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_NAVIGATION;
+  static const EventType STARTUP = BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_STARTUP;
+  static const EventType REACHED_CODE = BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_REACHED_CODE;
+  static const EventType CONTENT_TRIGGER = BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_CONTENT_TRIGGER;
+  static const EventType TEST_RULE = BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_TEST_RULE;
+
+  using FieldMetadata_EventType =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::BackgroundTracingMetadata_TriggerRule_NamedRule_EventType,
+      BackgroundTracingMetadata_TriggerRule_NamedRule>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EventType kEventType() { return {}; }
+  void set_event_type(::perfetto::protos::pbzero::BackgroundTracingMetadata_TriggerRule_NamedRule_EventType value) {
+    static constexpr uint32_t field_id = FieldMetadata_EventType::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ContentTriggerNameHash =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kFixed64,
+      uint64_t,
+      BackgroundTracingMetadata_TriggerRule_NamedRule>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ContentTriggerNameHash kContentTriggerNameHash() { return {}; }
+  void set_content_trigger_name_hash(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ContentTriggerNameHash::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kFixed64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class BackgroundTracingMetadata_TriggerRule_HistogramRule_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BackgroundTracingMetadata_TriggerRule_HistogramRule_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BackgroundTracingMetadata_TriggerRule_HistogramRule_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BackgroundTracingMetadata_TriggerRule_HistogramRule_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_histogram_name_hash() const { return at<1>().valid(); }
+  uint64_t histogram_name_hash() const { return at<1>().as_uint64(); }
+  bool has_histogram_min_trigger() const { return at<2>().valid(); }
+  int64_t histogram_min_trigger() const { return at<2>().as_int64(); }
+  bool has_histogram_max_trigger() const { return at<3>().valid(); }
+  int64_t histogram_max_trigger() const { return at<3>().as_int64(); }
+};
+
+class BackgroundTracingMetadata_TriggerRule_HistogramRule : public ::protozero::Message {
+ public:
+  using Decoder = BackgroundTracingMetadata_TriggerRule_HistogramRule_Decoder;
+  enum : int32_t {
+    kHistogramNameHashFieldNumber = 1,
+    kHistogramMinTriggerFieldNumber = 2,
+    kHistogramMaxTriggerFieldNumber = 3,
+  };
+
+  using FieldMetadata_HistogramNameHash =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kFixed64,
+      uint64_t,
+      BackgroundTracingMetadata_TriggerRule_HistogramRule>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HistogramNameHash kHistogramNameHash() { return {}; }
+  void set_histogram_name_hash(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_HistogramNameHash::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kFixed64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HistogramMinTrigger =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      BackgroundTracingMetadata_TriggerRule_HistogramRule>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HistogramMinTrigger kHistogramMinTrigger() { return {}; }
+  void set_histogram_min_trigger(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_HistogramMinTrigger::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HistogramMaxTrigger =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      BackgroundTracingMetadata_TriggerRule_HistogramRule>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HistogramMaxTrigger kHistogramMaxTrigger() { return {}; }
+  void set_histogram_max_trigger(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_HistogramMaxTrigger::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class ChromeMetadataPacket_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ChromeMetadataPacket_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ChromeMetadataPacket_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ChromeMetadataPacket_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_background_tracing_metadata() const { return at<1>().valid(); }
+  ::protozero::ConstBytes background_tracing_metadata() const { return at<1>().as_bytes(); }
+  bool has_chrome_version_code() const { return at<2>().valid(); }
+  int32_t chrome_version_code() const { return at<2>().as_int32(); }
+  bool has_enabled_categories() const { return at<3>().valid(); }
+  ::protozero::ConstChars enabled_categories() const { return at<3>().as_string(); }
+};
+
+class ChromeMetadataPacket : public ::protozero::Message {
+ public:
+  using Decoder = ChromeMetadataPacket_Decoder;
+  enum : int32_t {
+    kBackgroundTracingMetadataFieldNumber = 1,
+    kChromeVersionCodeFieldNumber = 2,
+    kEnabledCategoriesFieldNumber = 3,
+  };
+
+  using FieldMetadata_BackgroundTracingMetadata =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BackgroundTracingMetadata,
+      ChromeMetadataPacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BackgroundTracingMetadata kBackgroundTracingMetadata() { return {}; }
+  template <typename T = BackgroundTracingMetadata> T* set_background_tracing_metadata() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_ChromeVersionCode =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ChromeMetadataPacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeVersionCode kChromeVersionCode() { return {}; }
+  void set_chrome_version_code(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ChromeVersionCode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_EnabledCategories =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ChromeMetadataPacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EnabledCategories kEnabledCategories() { return {}; }
+  void set_enabled_categories(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_EnabledCategories::kFieldId, data, size);
+  }
+  void set_enabled_categories(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_EnabledCategories::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/chrome/chrome_trace_event.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_CHROME_CHROME_TRACE_EVENT_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_CHROME_CHROME_TRACE_EVENT_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class ChromeLegacyJsonTrace;
+class ChromeMetadata;
+class ChromeStringTableEntry;
+class ChromeTraceEvent;
+class ChromeTraceEvent_Arg;
+class ChromeTracedValue;
+enum ChromeLegacyJsonTrace_TraceType : int32_t;
+enum ChromeTracedValue_NestedType : int32_t;
+
+enum ChromeLegacyJsonTrace_TraceType : int32_t {
+  ChromeLegacyJsonTrace_TraceType_USER_TRACE = 0,
+  ChromeLegacyJsonTrace_TraceType_SYSTEM_TRACE = 1,
+};
+
+const ChromeLegacyJsonTrace_TraceType ChromeLegacyJsonTrace_TraceType_MIN = ChromeLegacyJsonTrace_TraceType_USER_TRACE;
+const ChromeLegacyJsonTrace_TraceType ChromeLegacyJsonTrace_TraceType_MAX = ChromeLegacyJsonTrace_TraceType_SYSTEM_TRACE;
+
+enum ChromeTracedValue_NestedType : int32_t {
+  ChromeTracedValue_NestedType_DICT = 0,
+  ChromeTracedValue_NestedType_ARRAY = 1,
+};
+
+const ChromeTracedValue_NestedType ChromeTracedValue_NestedType_MIN = ChromeTracedValue_NestedType_DICT;
+const ChromeTracedValue_NestedType ChromeTracedValue_NestedType_MAX = ChromeTracedValue_NestedType_ARRAY;
+
+class ChromeEventBundle_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  ChromeEventBundle_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ChromeEventBundle_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ChromeEventBundle_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_trace_events() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> trace_events() const { return GetRepeated<::protozero::ConstBytes>(1); }
+  bool has_metadata() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> metadata() const { return GetRepeated<::protozero::ConstBytes>(2); }
+  bool has_legacy_ftrace_output() const { return at<4>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> legacy_ftrace_output() const { return GetRepeated<::protozero::ConstChars>(4); }
+  bool has_legacy_json_trace() const { return at<5>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> legacy_json_trace() const { return GetRepeated<::protozero::ConstBytes>(5); }
+  bool has_string_table() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> string_table() const { return GetRepeated<::protozero::ConstBytes>(3); }
+};
+
+class ChromeEventBundle : public ::protozero::Message {
+ public:
+  using Decoder = ChromeEventBundle_Decoder;
+  enum : int32_t {
+    kTraceEventsFieldNumber = 1,
+    kMetadataFieldNumber = 2,
+    kLegacyFtraceOutputFieldNumber = 4,
+    kLegacyJsonTraceFieldNumber = 5,
+    kStringTableFieldNumber = 3,
+  };
+
+  using FieldMetadata_TraceEvents =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeTraceEvent,
+      ChromeEventBundle>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TraceEvents kTraceEvents() { return {}; }
+  template <typename T = ChromeTraceEvent> T* add_trace_events() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_Metadata =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeMetadata,
+      ChromeEventBundle>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Metadata kMetadata() { return {}; }
+  template <typename T = ChromeMetadata> T* add_metadata() {
+    return BeginNestedMessage<T>(2);
+  }
+
+
+  using FieldMetadata_LegacyFtraceOutput =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ChromeEventBundle>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LegacyFtraceOutput kLegacyFtraceOutput() { return {}; }
+  void add_legacy_ftrace_output(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_LegacyFtraceOutput::kFieldId, data, size);
+  }
+  void add_legacy_ftrace_output(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_LegacyFtraceOutput::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LegacyJsonTrace =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeLegacyJsonTrace,
+      ChromeEventBundle>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LegacyJsonTrace kLegacyJsonTrace() { return {}; }
+  template <typename T = ChromeLegacyJsonTrace> T* add_legacy_json_trace() {
+    return BeginNestedMessage<T>(5);
+  }
+
+
+  using FieldMetadata_StringTable =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeStringTableEntry,
+      ChromeEventBundle>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StringTable kStringTable() { return {}; }
+  template <typename T = ChromeStringTableEntry> T* add_string_table() {
+    return BeginNestedMessage<T>(3);
+  }
+
+};
+
+class ChromeLegacyJsonTrace_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ChromeLegacyJsonTrace_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ChromeLegacyJsonTrace_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ChromeLegacyJsonTrace_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_type() const { return at<1>().valid(); }
+  int32_t type() const { return at<1>().as_int32(); }
+  bool has_data() const { return at<2>().valid(); }
+  ::protozero::ConstChars data() const { return at<2>().as_string(); }
+};
+
+class ChromeLegacyJsonTrace : public ::protozero::Message {
+ public:
+  using Decoder = ChromeLegacyJsonTrace_Decoder;
+  enum : int32_t {
+    kTypeFieldNumber = 1,
+    kDataFieldNumber = 2,
+  };
+  using TraceType = ::perfetto::protos::pbzero::ChromeLegacyJsonTrace_TraceType;
+  static const TraceType USER_TRACE = ChromeLegacyJsonTrace_TraceType_USER_TRACE;
+  static const TraceType SYSTEM_TRACE = ChromeLegacyJsonTrace_TraceType_SYSTEM_TRACE;
+
+  using FieldMetadata_Type =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ChromeLegacyJsonTrace_TraceType,
+      ChromeLegacyJsonTrace>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Type kType() { return {}; }
+  void set_type(::perfetto::protos::pbzero::ChromeLegacyJsonTrace_TraceType value) {
+    static constexpr uint32_t field_id = FieldMetadata_Type::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Data =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ChromeLegacyJsonTrace>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Data kData() { return {}; }
+  void set_data(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Data::kFieldId, data, size);
+  }
+  void set_data(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Data::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class ChromeMetadata_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ChromeMetadata_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ChromeMetadata_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ChromeMetadata_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_string_value() const { return at<2>().valid(); }
+  ::protozero::ConstChars string_value() const { return at<2>().as_string(); }
+  bool has_bool_value() const { return at<3>().valid(); }
+  bool bool_value() const { return at<3>().as_bool(); }
+  bool has_int_value() const { return at<4>().valid(); }
+  int64_t int_value() const { return at<4>().as_int64(); }
+  bool has_json_value() const { return at<5>().valid(); }
+  ::protozero::ConstChars json_value() const { return at<5>().as_string(); }
+};
+
+class ChromeMetadata : public ::protozero::Message {
+ public:
+  using Decoder = ChromeMetadata_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kStringValueFieldNumber = 2,
+    kBoolValueFieldNumber = 3,
+    kIntValueFieldNumber = 4,
+    kJsonValueFieldNumber = 5,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ChromeMetadata>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_StringValue =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ChromeMetadata>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StringValue kStringValue() { return {}; }
+  void set_string_value(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_StringValue::kFieldId, data, size);
+  }
+  void set_string_value(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_StringValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BoolValue =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeMetadata>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BoolValue kBoolValue() { return {}; }
+  void set_bool_value(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_BoolValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IntValue =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      ChromeMetadata>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IntValue kIntValue() { return {}; }
+  void set_int_value(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IntValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_JsonValue =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ChromeMetadata>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_JsonValue kJsonValue() { return {}; }
+  void set_json_value(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_JsonValue::kFieldId, data, size);
+  }
+  void set_json_value(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_JsonValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class ChromeTraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/16, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  ChromeTraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ChromeTraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ChromeTraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_timestamp() const { return at<2>().valid(); }
+  int64_t timestamp() const { return at<2>().as_int64(); }
+  bool has_phase() const { return at<3>().valid(); }
+  int32_t phase() const { return at<3>().as_int32(); }
+  bool has_thread_id() const { return at<4>().valid(); }
+  int32_t thread_id() const { return at<4>().as_int32(); }
+  bool has_duration() const { return at<5>().valid(); }
+  int64_t duration() const { return at<5>().as_int64(); }
+  bool has_thread_duration() const { return at<6>().valid(); }
+  int64_t thread_duration() const { return at<6>().as_int64(); }
+  bool has_scope() const { return at<7>().valid(); }
+  ::protozero::ConstChars scope() const { return at<7>().as_string(); }
+  bool has_id() const { return at<8>().valid(); }
+  uint64_t id() const { return at<8>().as_uint64(); }
+  bool has_flags() const { return at<9>().valid(); }
+  uint32_t flags() const { return at<9>().as_uint32(); }
+  bool has_category_group_name() const { return at<10>().valid(); }
+  ::protozero::ConstChars category_group_name() const { return at<10>().as_string(); }
+  bool has_process_id() const { return at<11>().valid(); }
+  int32_t process_id() const { return at<11>().as_int32(); }
+  bool has_thread_timestamp() const { return at<12>().valid(); }
+  int64_t thread_timestamp() const { return at<12>().as_int64(); }
+  bool has_bind_id() const { return at<13>().valid(); }
+  uint64_t bind_id() const { return at<13>().as_uint64(); }
+  bool has_args() const { return at<14>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> args() const { return GetRepeated<::protozero::ConstBytes>(14); }
+  bool has_name_index() const { return at<15>().valid(); }
+  uint32_t name_index() const { return at<15>().as_uint32(); }
+  bool has_category_group_name_index() const { return at<16>().valid(); }
+  uint32_t category_group_name_index() const { return at<16>().as_uint32(); }
+};
+
+class ChromeTraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = ChromeTraceEvent_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kTimestampFieldNumber = 2,
+    kPhaseFieldNumber = 3,
+    kThreadIdFieldNumber = 4,
+    kDurationFieldNumber = 5,
+    kThreadDurationFieldNumber = 6,
+    kScopeFieldNumber = 7,
+    kIdFieldNumber = 8,
+    kFlagsFieldNumber = 9,
+    kCategoryGroupNameFieldNumber = 10,
+    kProcessIdFieldNumber = 11,
+    kThreadTimestampFieldNumber = 12,
+    kBindIdFieldNumber = 13,
+    kArgsFieldNumber = 14,
+    kNameIndexFieldNumber = 15,
+    kCategoryGroupNameIndexFieldNumber = 16,
+  };
+  using Arg = ::perfetto::protos::pbzero::ChromeTraceEvent_Arg;
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ChromeTraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Timestamp =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      ChromeTraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Timestamp kTimestamp() { return {}; }
+  void set_timestamp(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Timestamp::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Phase =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ChromeTraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Phase kPhase() { return {}; }
+  void set_phase(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Phase::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ThreadId =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ChromeTraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ThreadId kThreadId() { return {}; }
+  void set_thread_id(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ThreadId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Duration =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      ChromeTraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Duration kDuration() { return {}; }
+  void set_duration(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Duration::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ThreadDuration =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      ChromeTraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ThreadDuration kThreadDuration() { return {}; }
+  void set_thread_duration(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ThreadDuration::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Scope =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ChromeTraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Scope kScope() { return {}; }
+  void set_scope(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Scope::kFieldId, data, size);
+  }
+  void set_scope(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Scope::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Id =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ChromeTraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Id kId() { return {}; }
+  void set_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Id::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      ChromeTraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CategoryGroupName =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ChromeTraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CategoryGroupName kCategoryGroupName() { return {}; }
+  void set_category_group_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_CategoryGroupName::kFieldId, data, size);
+  }
+  void set_category_group_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_CategoryGroupName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ProcessId =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ChromeTraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProcessId kProcessId() { return {}; }
+  void set_process_id(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProcessId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ThreadTimestamp =
+    ::protozero::proto_utils::FieldMetadata<
+      12,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      ChromeTraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ThreadTimestamp kThreadTimestamp() { return {}; }
+  void set_thread_timestamp(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ThreadTimestamp::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BindId =
+    ::protozero::proto_utils::FieldMetadata<
+      13,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ChromeTraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BindId kBindId() { return {}; }
+  void set_bind_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BindId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Args =
+    ::protozero::proto_utils::FieldMetadata<
+      14,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeTraceEvent_Arg,
+      ChromeTraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Args kArgs() { return {}; }
+  template <typename T = ChromeTraceEvent_Arg> T* add_args() {
+    return BeginNestedMessage<T>(14);
+  }
+
+
+  using FieldMetadata_NameIndex =
+    ::protozero::proto_utils::FieldMetadata<
+      15,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      ChromeTraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NameIndex kNameIndex() { return {}; }
+  void set_name_index(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NameIndex::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CategoryGroupNameIndex =
+    ::protozero::proto_utils::FieldMetadata<
+      16,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      ChromeTraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CategoryGroupNameIndex kCategoryGroupNameIndex() { return {}; }
+  void set_category_group_name_index(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CategoryGroupNameIndex::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class ChromeTraceEvent_Arg_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/10, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ChromeTraceEvent_Arg_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ChromeTraceEvent_Arg_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ChromeTraceEvent_Arg_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_bool_value() const { return at<2>().valid(); }
+  bool bool_value() const { return at<2>().as_bool(); }
+  bool has_uint_value() const { return at<3>().valid(); }
+  uint64_t uint_value() const { return at<3>().as_uint64(); }
+  bool has_int_value() const { return at<4>().valid(); }
+  int64_t int_value() const { return at<4>().as_int64(); }
+  bool has_double_value() const { return at<5>().valid(); }
+  double double_value() const { return at<5>().as_double(); }
+  bool has_string_value() const { return at<6>().valid(); }
+  ::protozero::ConstChars string_value() const { return at<6>().as_string(); }
+  bool has_pointer_value() const { return at<7>().valid(); }
+  uint64_t pointer_value() const { return at<7>().as_uint64(); }
+  bool has_json_value() const { return at<8>().valid(); }
+  ::protozero::ConstChars json_value() const { return at<8>().as_string(); }
+  bool has_traced_value() const { return at<10>().valid(); }
+  ::protozero::ConstBytes traced_value() const { return at<10>().as_bytes(); }
+  bool has_name_index() const { return at<9>().valid(); }
+  uint32_t name_index() const { return at<9>().as_uint32(); }
+};
+
+class ChromeTraceEvent_Arg : public ::protozero::Message {
+ public:
+  using Decoder = ChromeTraceEvent_Arg_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kBoolValueFieldNumber = 2,
+    kUintValueFieldNumber = 3,
+    kIntValueFieldNumber = 4,
+    kDoubleValueFieldNumber = 5,
+    kStringValueFieldNumber = 6,
+    kPointerValueFieldNumber = 7,
+    kJsonValueFieldNumber = 8,
+    kTracedValueFieldNumber = 10,
+    kNameIndexFieldNumber = 9,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ChromeTraceEvent_Arg>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BoolValue =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeTraceEvent_Arg>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BoolValue kBoolValue() { return {}; }
+  void set_bool_value(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_BoolValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_UintValue =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ChromeTraceEvent_Arg>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UintValue kUintValue() { return {}; }
+  void set_uint_value(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_UintValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IntValue =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      ChromeTraceEvent_Arg>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IntValue kIntValue() { return {}; }
+  void set_int_value(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IntValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DoubleValue =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kDouble,
+      double,
+      ChromeTraceEvent_Arg>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DoubleValue kDoubleValue() { return {}; }
+  void set_double_value(double value) {
+    static constexpr uint32_t field_id = FieldMetadata_DoubleValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kDouble>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_StringValue =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ChromeTraceEvent_Arg>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StringValue kStringValue() { return {}; }
+  void set_string_value(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_StringValue::kFieldId, data, size);
+  }
+  void set_string_value(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_StringValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PointerValue =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ChromeTraceEvent_Arg>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PointerValue kPointerValue() { return {}; }
+  void set_pointer_value(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PointerValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_JsonValue =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ChromeTraceEvent_Arg>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_JsonValue kJsonValue() { return {}; }
+  void set_json_value(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_JsonValue::kFieldId, data, size);
+  }
+  void set_json_value(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_JsonValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TracedValue =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeTracedValue,
+      ChromeTraceEvent_Arg>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TracedValue kTracedValue() { return {}; }
+  template <typename T = ChromeTracedValue> T* set_traced_value() {
+    return BeginNestedMessage<T>(10);
+  }
+
+
+  using FieldMetadata_NameIndex =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      ChromeTraceEvent_Arg>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NameIndex kNameIndex() { return {}; }
+  void set_name_index(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NameIndex::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class ChromeStringTableEntry_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ChromeStringTableEntry_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ChromeStringTableEntry_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ChromeStringTableEntry_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_value() const { return at<1>().valid(); }
+  ::protozero::ConstChars value() const { return at<1>().as_string(); }
+  bool has_index() const { return at<2>().valid(); }
+  int32_t index() const { return at<2>().as_int32(); }
+};
+
+class ChromeStringTableEntry : public ::protozero::Message {
+ public:
+  using Decoder = ChromeStringTableEntry_Decoder;
+  enum : int32_t {
+    kValueFieldNumber = 1,
+    kIndexFieldNumber = 2,
+  };
+
+  using FieldMetadata_Value =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ChromeStringTableEntry>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Value kValue() { return {}; }
+  void set_value(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Value::kFieldId, data, size);
+  }
+  void set_value(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Value::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Index =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ChromeStringTableEntry>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Index kIndex() { return {}; }
+  void set_index(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Index::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class ChromeTracedValue_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  ChromeTracedValue_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ChromeTracedValue_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ChromeTracedValue_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_nested_type() const { return at<1>().valid(); }
+  int32_t nested_type() const { return at<1>().as_int32(); }
+  bool has_dict_keys() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> dict_keys() const { return GetRepeated<::protozero::ConstChars>(2); }
+  bool has_dict_values() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> dict_values() const { return GetRepeated<::protozero::ConstBytes>(3); }
+  bool has_array_values() const { return at<4>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> array_values() const { return GetRepeated<::protozero::ConstBytes>(4); }
+  bool has_int_value() const { return at<5>().valid(); }
+  int32_t int_value() const { return at<5>().as_int32(); }
+  bool has_double_value() const { return at<6>().valid(); }
+  double double_value() const { return at<6>().as_double(); }
+  bool has_bool_value() const { return at<7>().valid(); }
+  bool bool_value() const { return at<7>().as_bool(); }
+  bool has_string_value() const { return at<8>().valid(); }
+  ::protozero::ConstChars string_value() const { return at<8>().as_string(); }
+};
+
+class ChromeTracedValue : public ::protozero::Message {
+ public:
+  using Decoder = ChromeTracedValue_Decoder;
+  enum : int32_t {
+    kNestedTypeFieldNumber = 1,
+    kDictKeysFieldNumber = 2,
+    kDictValuesFieldNumber = 3,
+    kArrayValuesFieldNumber = 4,
+    kIntValueFieldNumber = 5,
+    kDoubleValueFieldNumber = 6,
+    kBoolValueFieldNumber = 7,
+    kStringValueFieldNumber = 8,
+  };
+  using NestedType = ::perfetto::protos::pbzero::ChromeTracedValue_NestedType;
+  static const NestedType DICT = ChromeTracedValue_NestedType_DICT;
+  static const NestedType ARRAY = ChromeTracedValue_NestedType_ARRAY;
+
+  using FieldMetadata_NestedType =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ChromeTracedValue_NestedType,
+      ChromeTracedValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NestedType kNestedType() { return {}; }
+  void set_nested_type(::perfetto::protos::pbzero::ChromeTracedValue_NestedType value) {
+    static constexpr uint32_t field_id = FieldMetadata_NestedType::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DictKeys =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ChromeTracedValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DictKeys kDictKeys() { return {}; }
+  void add_dict_keys(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_DictKeys::kFieldId, data, size);
+  }
+  void add_dict_keys(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_DictKeys::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DictValues =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeTracedValue,
+      ChromeTracedValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DictValues kDictValues() { return {}; }
+  template <typename T = ChromeTracedValue> T* add_dict_values() {
+    return BeginNestedMessage<T>(3);
+  }
+
+
+  using FieldMetadata_ArrayValues =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeTracedValue,
+      ChromeTracedValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ArrayValues kArrayValues() { return {}; }
+  template <typename T = ChromeTracedValue> T* add_array_values() {
+    return BeginNestedMessage<T>(4);
+  }
+
+
+  using FieldMetadata_IntValue =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ChromeTracedValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IntValue kIntValue() { return {}; }
+  void set_int_value(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IntValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DoubleValue =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kDouble,
+      double,
+      ChromeTracedValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DoubleValue kDoubleValue() { return {}; }
+  void set_double_value(double value) {
+    static constexpr uint32_t field_id = FieldMetadata_DoubleValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kDouble>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BoolValue =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeTracedValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BoolValue kBoolValue() { return {}; }
+  void set_bool_value(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_BoolValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_StringValue =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ChromeTracedValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StringValue kStringValue() { return {}; }
+  void set_string_value(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_StringValue::kFieldId, data, size);
+  }
+  void set_string_value(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_StringValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/filesystem/inode_file_map.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FILESYSTEM_INODE_FILE_MAP_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FILESYSTEM_INODE_FILE_MAP_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class InodeFileMap_Entry;
+enum InodeFileMap_Entry_Type : int32_t;
+
+enum InodeFileMap_Entry_Type : int32_t {
+  InodeFileMap_Entry_Type_UNKNOWN = 0,
+  InodeFileMap_Entry_Type_FILE = 1,
+  InodeFileMap_Entry_Type_DIRECTORY = 2,
+};
+
+const InodeFileMap_Entry_Type InodeFileMap_Entry_Type_MIN = InodeFileMap_Entry_Type_UNKNOWN;
+const InodeFileMap_Entry_Type InodeFileMap_Entry_Type_MAX = InodeFileMap_Entry_Type_DIRECTORY;
+
+class InodeFileMap_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  InodeFileMap_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit InodeFileMap_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit InodeFileMap_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_block_device_id() const { return at<1>().valid(); }
+  uint64_t block_device_id() const { return at<1>().as_uint64(); }
+  bool has_mount_points() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> mount_points() const { return GetRepeated<::protozero::ConstChars>(2); }
+  bool has_entries() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> entries() const { return GetRepeated<::protozero::ConstBytes>(3); }
+};
+
+class InodeFileMap : public ::protozero::Message {
+ public:
+  using Decoder = InodeFileMap_Decoder;
+  enum : int32_t {
+    kBlockDeviceIdFieldNumber = 1,
+    kMountPointsFieldNumber = 2,
+    kEntriesFieldNumber = 3,
+  };
+  using Entry = ::perfetto::protos::pbzero::InodeFileMap_Entry;
+
+  using FieldMetadata_BlockDeviceId =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      InodeFileMap>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BlockDeviceId kBlockDeviceId() { return {}; }
+  void set_block_device_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BlockDeviceId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MountPoints =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      InodeFileMap>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MountPoints kMountPoints() { return {}; }
+  void add_mount_points(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_MountPoints::kFieldId, data, size);
+  }
+  void add_mount_points(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_MountPoints::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Entries =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      InodeFileMap_Entry,
+      InodeFileMap>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Entries kEntries() { return {}; }
+  template <typename T = InodeFileMap_Entry> T* add_entries() {
+    return BeginNestedMessage<T>(3);
+  }
+
+};
+
+class InodeFileMap_Entry_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  InodeFileMap_Entry_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit InodeFileMap_Entry_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit InodeFileMap_Entry_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_inode_number() const { return at<1>().valid(); }
+  uint64_t inode_number() const { return at<1>().as_uint64(); }
+  bool has_paths() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> paths() const { return GetRepeated<::protozero::ConstChars>(2); }
+  bool has_type() const { return at<3>().valid(); }
+  int32_t type() const { return at<3>().as_int32(); }
+};
+
+class InodeFileMap_Entry : public ::protozero::Message {
+ public:
+  using Decoder = InodeFileMap_Entry_Decoder;
+  enum : int32_t {
+    kInodeNumberFieldNumber = 1,
+    kPathsFieldNumber = 2,
+    kTypeFieldNumber = 3,
+  };
+  using Type = ::perfetto::protos::pbzero::InodeFileMap_Entry_Type;
+  static const Type UNKNOWN = InodeFileMap_Entry_Type_UNKNOWN;
+  static const Type FILE = InodeFileMap_Entry_Type_FILE;
+  static const Type DIRECTORY = InodeFileMap_Entry_Type_DIRECTORY;
+
+  using FieldMetadata_InodeNumber =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      InodeFileMap_Entry>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_InodeNumber kInodeNumber() { return {}; }
+  void set_inode_number(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_InodeNumber::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Paths =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      InodeFileMap_Entry>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Paths kPaths() { return {}; }
+  void add_paths(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Paths::kFieldId, data, size);
+  }
+  void add_paths(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Paths::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Type =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::InodeFileMap_Entry_Type,
+      InodeFileMap_Entry>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Type kType() { return {}; }
+  void set_type(::perfetto::protos::pbzero::InodeFileMap_Entry_Type value) {
+    static constexpr uint32_t field_id = FieldMetadata_Type::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/ftrace_event.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_FTRACE_EVENT_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_FTRACE_EVENT_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class AllocPagesIommuEndFtraceEvent;
+class AllocPagesIommuFailFtraceEvent;
+class AllocPagesIommuStartFtraceEvent;
+class AllocPagesSysEndFtraceEvent;
+class AllocPagesSysFailFtraceEvent;
+class AllocPagesSysStartFtraceEvent;
+class BinderLockFtraceEvent;
+class BinderLockedFtraceEvent;
+class BinderSetPriorityFtraceEvent;
+class BinderTransactionAllocBufFtraceEvent;
+class BinderTransactionFtraceEvent;
+class BinderTransactionReceivedFtraceEvent;
+class BinderUnlockFtraceEvent;
+class BlockBioBackmergeFtraceEvent;
+class BlockBioBounceFtraceEvent;
+class BlockBioCompleteFtraceEvent;
+class BlockBioFrontmergeFtraceEvent;
+class BlockBioQueueFtraceEvent;
+class BlockBioRemapFtraceEvent;
+class BlockDirtyBufferFtraceEvent;
+class BlockGetrqFtraceEvent;
+class BlockPlugFtraceEvent;
+class BlockRqAbortFtraceEvent;
+class BlockRqCompleteFtraceEvent;
+class BlockRqInsertFtraceEvent;
+class BlockRqIssueFtraceEvent;
+class BlockRqRemapFtraceEvent;
+class BlockRqRequeueFtraceEvent;
+class BlockSleeprqFtraceEvent;
+class BlockSplitFtraceEvent;
+class BlockTouchBufferFtraceEvent;
+class BlockUnplugFtraceEvent;
+class CdevUpdateFtraceEvent;
+class CgroupAttachTaskFtraceEvent;
+class CgroupDestroyRootFtraceEvent;
+class CgroupMkdirFtraceEvent;
+class CgroupReleaseFtraceEvent;
+class CgroupRemountFtraceEvent;
+class CgroupRenameFtraceEvent;
+class CgroupRmdirFtraceEvent;
+class CgroupSetupRootFtraceEvent;
+class CgroupTransferTasksFtraceEvent;
+class ClkDisableFtraceEvent;
+class ClkEnableFtraceEvent;
+class ClkSetRateFtraceEvent;
+class ClockDisableFtraceEvent;
+class ClockEnableFtraceEvent;
+class ClockSetRateFtraceEvent;
+class CpuFrequencyFtraceEvent;
+class CpuFrequencyLimitsFtraceEvent;
+class CpuIdleFtraceEvent;
+class CpuhpEnterFtraceEvent;
+class CpuhpExitFtraceEvent;
+class CpuhpLatencyFtraceEvent;
+class CpuhpMultiEnterFtraceEvent;
+class CpuhpPauseFtraceEvent;
+class DmaAllocContiguousRetryFtraceEvent;
+class DmaHeapStatFtraceEvent;
+class DpuTracingMarkWriteFtraceEvent;
+class Ext4AllocDaBlocksFtraceEvent;
+class Ext4AllocateBlocksFtraceEvent;
+class Ext4AllocateInodeFtraceEvent;
+class Ext4BeginOrderedTruncateFtraceEvent;
+class Ext4CollapseRangeFtraceEvent;
+class Ext4DaReleaseSpaceFtraceEvent;
+class Ext4DaReserveSpaceFtraceEvent;
+class Ext4DaUpdateReserveSpaceFtraceEvent;
+class Ext4DaWriteBeginFtraceEvent;
+class Ext4DaWriteEndFtraceEvent;
+class Ext4DaWritePagesExtentFtraceEvent;
+class Ext4DaWritePagesFtraceEvent;
+class Ext4DirectIOEnterFtraceEvent;
+class Ext4DirectIOExitFtraceEvent;
+class Ext4DiscardBlocksFtraceEvent;
+class Ext4DiscardPreallocationsFtraceEvent;
+class Ext4DropInodeFtraceEvent;
+class Ext4EsCacheExtentFtraceEvent;
+class Ext4EsFindDelayedExtentRangeEnterFtraceEvent;
+class Ext4EsFindDelayedExtentRangeExitFtraceEvent;
+class Ext4EsInsertExtentFtraceEvent;
+class Ext4EsLookupExtentEnterFtraceEvent;
+class Ext4EsLookupExtentExitFtraceEvent;
+class Ext4EsRemoveExtentFtraceEvent;
+class Ext4EsShrinkCountFtraceEvent;
+class Ext4EsShrinkFtraceEvent;
+class Ext4EsShrinkScanEnterFtraceEvent;
+class Ext4EsShrinkScanExitFtraceEvent;
+class Ext4EvictInodeFtraceEvent;
+class Ext4ExtConvertToInitializedEnterFtraceEvent;
+class Ext4ExtConvertToInitializedFastpathFtraceEvent;
+class Ext4ExtHandleUnwrittenExtentsFtraceEvent;
+class Ext4ExtInCacheFtraceEvent;
+class Ext4ExtLoadExtentFtraceEvent;
+class Ext4ExtMapBlocksEnterFtraceEvent;
+class Ext4ExtMapBlocksExitFtraceEvent;
+class Ext4ExtPutInCacheFtraceEvent;
+class Ext4ExtRemoveSpaceDoneFtraceEvent;
+class Ext4ExtRemoveSpaceFtraceEvent;
+class Ext4ExtRmIdxFtraceEvent;
+class Ext4ExtRmLeafFtraceEvent;
+class Ext4ExtShowExtentFtraceEvent;
+class Ext4FallocateEnterFtraceEvent;
+class Ext4FallocateExitFtraceEvent;
+class Ext4FindDelallocRangeFtraceEvent;
+class Ext4ForgetFtraceEvent;
+class Ext4FreeBlocksFtraceEvent;
+class Ext4FreeInodeFtraceEvent;
+class Ext4GetImpliedClusterAllocExitFtraceEvent;
+class Ext4GetReservedClusterAllocFtraceEvent;
+class Ext4IndMapBlocksEnterFtraceEvent;
+class Ext4IndMapBlocksExitFtraceEvent;
+class Ext4InsertRangeFtraceEvent;
+class Ext4InvalidatepageFtraceEvent;
+class Ext4JournalStartFtraceEvent;
+class Ext4JournalStartReservedFtraceEvent;
+class Ext4JournalledInvalidatepageFtraceEvent;
+class Ext4JournalledWriteEndFtraceEvent;
+class Ext4LoadInodeBitmapFtraceEvent;
+class Ext4LoadInodeFtraceEvent;
+class Ext4MarkInodeDirtyFtraceEvent;
+class Ext4MbBitmapLoadFtraceEvent;
+class Ext4MbBuddyBitmapLoadFtraceEvent;
+class Ext4MbDiscardPreallocationsFtraceEvent;
+class Ext4MbNewGroupPaFtraceEvent;
+class Ext4MbNewInodePaFtraceEvent;
+class Ext4MbReleaseGroupPaFtraceEvent;
+class Ext4MbReleaseInodePaFtraceEvent;
+class Ext4MballocAllocFtraceEvent;
+class Ext4MballocDiscardFtraceEvent;
+class Ext4MballocFreeFtraceEvent;
+class Ext4MballocPreallocFtraceEvent;
+class Ext4OtherInodeUpdateTimeFtraceEvent;
+class Ext4PunchHoleFtraceEvent;
+class Ext4ReadBlockBitmapLoadFtraceEvent;
+class Ext4ReadpageFtraceEvent;
+class Ext4ReleasepageFtraceEvent;
+class Ext4RemoveBlocksFtraceEvent;
+class Ext4RequestBlocksFtraceEvent;
+class Ext4RequestInodeFtraceEvent;
+class Ext4SyncFileEnterFtraceEvent;
+class Ext4SyncFileExitFtraceEvent;
+class Ext4SyncFsFtraceEvent;
+class Ext4TrimAllFreeFtraceEvent;
+class Ext4TrimExtentFtraceEvent;
+class Ext4TruncateEnterFtraceEvent;
+class Ext4TruncateExitFtraceEvent;
+class Ext4UnlinkEnterFtraceEvent;
+class Ext4UnlinkExitFtraceEvent;
+class Ext4WriteBeginFtraceEvent;
+class Ext4WriteEndFtraceEvent;
+class Ext4WritepageFtraceEvent;
+class Ext4WritepagesFtraceEvent;
+class Ext4WritepagesResultFtraceEvent;
+class Ext4ZeroRangeFtraceEvent;
+class F2fsDoSubmitBioFtraceEvent;
+class F2fsEvictInodeFtraceEvent;
+class F2fsFallocateFtraceEvent;
+class F2fsGetDataBlockFtraceEvent;
+class F2fsGetVictimFtraceEvent;
+class F2fsIgetExitFtraceEvent;
+class F2fsIgetFtraceEvent;
+class F2fsNewInodeFtraceEvent;
+class F2fsReadpageFtraceEvent;
+class F2fsReserveNewBlockFtraceEvent;
+class F2fsSetPageDirtyFtraceEvent;
+class F2fsSubmitWritePageFtraceEvent;
+class F2fsSyncFileEnterFtraceEvent;
+class F2fsSyncFileExitFtraceEvent;
+class F2fsSyncFsFtraceEvent;
+class F2fsTruncateBlocksEnterFtraceEvent;
+class F2fsTruncateBlocksExitFtraceEvent;
+class F2fsTruncateDataBlocksRangeFtraceEvent;
+class F2fsTruncateFtraceEvent;
+class F2fsTruncateInodeBlocksEnterFtraceEvent;
+class F2fsTruncateInodeBlocksExitFtraceEvent;
+class F2fsTruncateNodeFtraceEvent;
+class F2fsTruncateNodesEnterFtraceEvent;
+class F2fsTruncateNodesExitFtraceEvent;
+class F2fsTruncatePartialNodesFtraceEvent;
+class F2fsUnlinkEnterFtraceEvent;
+class F2fsUnlinkExitFtraceEvent;
+class F2fsVmPageMkwriteFtraceEvent;
+class F2fsWriteBeginFtraceEvent;
+class F2fsWriteCheckpointFtraceEvent;
+class F2fsWriteEndFtraceEvent;
+class FastrpcDmaStatFtraceEvent;
+class FenceDestroyFtraceEvent;
+class FenceEnableSignalFtraceEvent;
+class FenceInitFtraceEvent;
+class FenceSignaledFtraceEvent;
+class G2dTracingMarkWriteFtraceEvent;
+class GenericFtraceEvent;
+class GpuFrequencyFtraceEvent;
+class GpuMemTotalFtraceEvent;
+class I2cReadFtraceEvent;
+class I2cReplyFtraceEvent;
+class I2cResultFtraceEvent;
+class I2cWriteFtraceEvent;
+class IommuMapRangeFtraceEvent;
+class IommuSecPtblMapRangeEndFtraceEvent;
+class IommuSecPtblMapRangeStartFtraceEvent;
+class IonAllocBufferEndFtraceEvent;
+class IonAllocBufferFailFtraceEvent;
+class IonAllocBufferFallbackFtraceEvent;
+class IonAllocBufferStartFtraceEvent;
+class IonBufferCreateFtraceEvent;
+class IonBufferDestroyFtraceEvent;
+class IonCpAllocRetryFtraceEvent;
+class IonCpSecureBufferEndFtraceEvent;
+class IonCpSecureBufferStartFtraceEvent;
+class IonHeapGrowFtraceEvent;
+class IonHeapShrinkFtraceEvent;
+class IonPrefetchingFtraceEvent;
+class IonSecureCmaAddToPoolEndFtraceEvent;
+class IonSecureCmaAddToPoolStartFtraceEvent;
+class IonSecureCmaAllocateEndFtraceEvent;
+class IonSecureCmaAllocateStartFtraceEvent;
+class IonSecureCmaShrinkPoolEndFtraceEvent;
+class IonSecureCmaShrinkPoolStartFtraceEvent;
+class IonStatFtraceEvent;
+class IpiEntryFtraceEvent;
+class IpiExitFtraceEvent;
+class IpiRaiseFtraceEvent;
+class IrqHandlerEntryFtraceEvent;
+class IrqHandlerExitFtraceEvent;
+class KfreeFtraceEvent;
+class KmallocFtraceEvent;
+class KmallocNodeFtraceEvent;
+class KmemCacheAllocFtraceEvent;
+class KmemCacheAllocNodeFtraceEvent;
+class KmemCacheFreeFtraceEvent;
+class LowmemoryKillFtraceEvent;
+class MaliTracingMarkWriteFtraceEvent;
+class MarkVictimFtraceEvent;
+class MdpCmdKickoffFtraceEvent;
+class MdpCmdPingpongDoneFtraceEvent;
+class MdpCmdReadptrDoneFtraceEvent;
+class MdpCmdReleaseBwFtraceEvent;
+class MdpCmdWaitPingpongFtraceEvent;
+class MdpCommitFtraceEvent;
+class MdpCompareBwFtraceEvent;
+class MdpMisrCrcFtraceEvent;
+class MdpMixerUpdateFtraceEvent;
+class MdpPerfPrefillCalcFtraceEvent;
+class MdpPerfSetOtFtraceEvent;
+class MdpPerfSetPanicLutsFtraceEvent;
+class MdpPerfSetQosLutsFtraceEvent;
+class MdpPerfSetWmLevelsFtraceEvent;
+class MdpPerfUpdateBusFtraceEvent;
+class MdpSsppChangeFtraceEvent;
+class MdpSsppSetFtraceEvent;
+class MdpTraceCounterFtraceEvent;
+class MdpVideoUnderrunDoneFtraceEvent;
+class MigratePagesEndFtraceEvent;
+class MigratePagesStartFtraceEvent;
+class MigrateRetryFtraceEvent;
+class MmCompactionBeginFtraceEvent;
+class MmCompactionDeferCompactionFtraceEvent;
+class MmCompactionDeferResetFtraceEvent;
+class MmCompactionDeferredFtraceEvent;
+class MmCompactionEndFtraceEvent;
+class MmCompactionFinishedFtraceEvent;
+class MmCompactionIsolateFreepagesFtraceEvent;
+class MmCompactionIsolateMigratepagesFtraceEvent;
+class MmCompactionKcompactdSleepFtraceEvent;
+class MmCompactionKcompactdWakeFtraceEvent;
+class MmCompactionMigratepagesFtraceEvent;
+class MmCompactionSuitableFtraceEvent;
+class MmCompactionTryToCompactPagesFtraceEvent;
+class MmCompactionWakeupKcompactdFtraceEvent;
+class MmEventRecordFtraceEvent;
+class MmFilemapAddToPageCacheFtraceEvent;
+class MmFilemapDeleteFromPageCacheFtraceEvent;
+class MmPageAllocExtfragFtraceEvent;
+class MmPageAllocFtraceEvent;
+class MmPageAllocZoneLockedFtraceEvent;
+class MmPageFreeBatchedFtraceEvent;
+class MmPageFreeFtraceEvent;
+class MmPagePcpuDrainFtraceEvent;
+class MmVmscanDirectReclaimBeginFtraceEvent;
+class MmVmscanDirectReclaimEndFtraceEvent;
+class MmVmscanKswapdSleepFtraceEvent;
+class MmVmscanKswapdWakeFtraceEvent;
+class OomScoreAdjUpdateFtraceEvent;
+class PrintFtraceEvent;
+class RegulatorDisableCompleteFtraceEvent;
+class RegulatorDisableFtraceEvent;
+class RegulatorEnableCompleteFtraceEvent;
+class RegulatorEnableDelayFtraceEvent;
+class RegulatorEnableFtraceEvent;
+class RegulatorSetVoltageCompleteFtraceEvent;
+class RegulatorSetVoltageFtraceEvent;
+class RotatorBwAoAsContextFtraceEvent;
+class RssStatFtraceEvent;
+class SchedBlockedReasonFtraceEvent;
+class SchedCpuHotplugFtraceEvent;
+class SchedPiSetprioFtraceEvent;
+class SchedProcessExecFtraceEvent;
+class SchedProcessExitFtraceEvent;
+class SchedProcessForkFtraceEvent;
+class SchedProcessFreeFtraceEvent;
+class SchedProcessHangFtraceEvent;
+class SchedProcessWaitFtraceEvent;
+class SchedSwitchFtraceEvent;
+class SchedWakeupFtraceEvent;
+class SchedWakeupNewFtraceEvent;
+class SchedWakingFtraceEvent;
+class ScmCallEndFtraceEvent;
+class ScmCallStartFtraceEvent;
+class SdeSdeEvtlogFtraceEvent;
+class SdeSdePerfCalcCrtcFtraceEvent;
+class SdeSdePerfCrtcUpdateFtraceEvent;
+class SdeSdePerfSetQosLutsFtraceEvent;
+class SdeSdePerfUpdateBusFtraceEvent;
+class SdeTracingMarkWriteFtraceEvent;
+class SignalDeliverFtraceEvent;
+class SignalGenerateFtraceEvent;
+class SmbusReadFtraceEvent;
+class SmbusReplyFtraceEvent;
+class SmbusResultFtraceEvent;
+class SmbusWriteFtraceEvent;
+class SoftirqEntryFtraceEvent;
+class SoftirqExitFtraceEvent;
+class SoftirqRaiseFtraceEvent;
+class SuspendResumeFtraceEvent;
+class SyncPtFtraceEvent;
+class SyncTimelineFtraceEvent;
+class SyncWaitFtraceEvent;
+class SysEnterFtraceEvent;
+class SysExitFtraceEvent;
+class TaskNewtaskFtraceEvent;
+class TaskRenameFtraceEvent;
+class ThermalTemperatureFtraceEvent;
+class TracingMarkWriteFtraceEvent;
+class WorkqueueActivateWorkFtraceEvent;
+class WorkqueueExecuteEndFtraceEvent;
+class WorkqueueExecuteStartFtraceEvent;
+class WorkqueueQueueWorkFtraceEvent;
+class ZeroFtraceEvent;
+
+class FtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/358, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  FtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit FtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit FtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_timestamp() const { return at<1>().valid(); }
+  uint64_t timestamp() const { return at<1>().as_uint64(); }
+  bool has_pid() const { return at<2>().valid(); }
+  uint32_t pid() const { return at<2>().as_uint32(); }
+  bool has_print() const { return at<3>().valid(); }
+  ::protozero::ConstBytes print() const { return at<3>().as_bytes(); }
+  bool has_sched_switch() const { return at<4>().valid(); }
+  ::protozero::ConstBytes sched_switch() const { return at<4>().as_bytes(); }
+  bool has_cpu_frequency() const { return at<11>().valid(); }
+  ::protozero::ConstBytes cpu_frequency() const { return at<11>().as_bytes(); }
+  bool has_cpu_frequency_limits() const { return at<12>().valid(); }
+  ::protozero::ConstBytes cpu_frequency_limits() const { return at<12>().as_bytes(); }
+  bool has_cpu_idle() const { return at<13>().valid(); }
+  ::protozero::ConstBytes cpu_idle() const { return at<13>().as_bytes(); }
+  bool has_clock_enable() const { return at<14>().valid(); }
+  ::protozero::ConstBytes clock_enable() const { return at<14>().as_bytes(); }
+  bool has_clock_disable() const { return at<15>().valid(); }
+  ::protozero::ConstBytes clock_disable() const { return at<15>().as_bytes(); }
+  bool has_clock_set_rate() const { return at<16>().valid(); }
+  ::protozero::ConstBytes clock_set_rate() const { return at<16>().as_bytes(); }
+  bool has_sched_wakeup() const { return at<17>().valid(); }
+  ::protozero::ConstBytes sched_wakeup() const { return at<17>().as_bytes(); }
+  bool has_sched_blocked_reason() const { return at<18>().valid(); }
+  ::protozero::ConstBytes sched_blocked_reason() const { return at<18>().as_bytes(); }
+  bool has_sched_cpu_hotplug() const { return at<19>().valid(); }
+  ::protozero::ConstBytes sched_cpu_hotplug() const { return at<19>().as_bytes(); }
+  bool has_sched_waking() const { return at<20>().valid(); }
+  ::protozero::ConstBytes sched_waking() const { return at<20>().as_bytes(); }
+  bool has_ipi_entry() const { return at<21>().valid(); }
+  ::protozero::ConstBytes ipi_entry() const { return at<21>().as_bytes(); }
+  bool has_ipi_exit() const { return at<22>().valid(); }
+  ::protozero::ConstBytes ipi_exit() const { return at<22>().as_bytes(); }
+  bool has_ipi_raise() const { return at<23>().valid(); }
+  ::protozero::ConstBytes ipi_raise() const { return at<23>().as_bytes(); }
+  bool has_softirq_entry() const { return at<24>().valid(); }
+  ::protozero::ConstBytes softirq_entry() const { return at<24>().as_bytes(); }
+  bool has_softirq_exit() const { return at<25>().valid(); }
+  ::protozero::ConstBytes softirq_exit() const { return at<25>().as_bytes(); }
+  bool has_softirq_raise() const { return at<26>().valid(); }
+  ::protozero::ConstBytes softirq_raise() const { return at<26>().as_bytes(); }
+  bool has_i2c_read() const { return at<27>().valid(); }
+  ::protozero::ConstBytes i2c_read() const { return at<27>().as_bytes(); }
+  bool has_i2c_write() const { return at<28>().valid(); }
+  ::protozero::ConstBytes i2c_write() const { return at<28>().as_bytes(); }
+  bool has_i2c_result() const { return at<29>().valid(); }
+  ::protozero::ConstBytes i2c_result() const { return at<29>().as_bytes(); }
+  bool has_i2c_reply() const { return at<30>().valid(); }
+  ::protozero::ConstBytes i2c_reply() const { return at<30>().as_bytes(); }
+  bool has_smbus_read() const { return at<31>().valid(); }
+  ::protozero::ConstBytes smbus_read() const { return at<31>().as_bytes(); }
+  bool has_smbus_write() const { return at<32>().valid(); }
+  ::protozero::ConstBytes smbus_write() const { return at<32>().as_bytes(); }
+  bool has_smbus_result() const { return at<33>().valid(); }
+  ::protozero::ConstBytes smbus_result() const { return at<33>().as_bytes(); }
+  bool has_smbus_reply() const { return at<34>().valid(); }
+  ::protozero::ConstBytes smbus_reply() const { return at<34>().as_bytes(); }
+  bool has_lowmemory_kill() const { return at<35>().valid(); }
+  ::protozero::ConstBytes lowmemory_kill() const { return at<35>().as_bytes(); }
+  bool has_irq_handler_entry() const { return at<36>().valid(); }
+  ::protozero::ConstBytes irq_handler_entry() const { return at<36>().as_bytes(); }
+  bool has_irq_handler_exit() const { return at<37>().valid(); }
+  ::protozero::ConstBytes irq_handler_exit() const { return at<37>().as_bytes(); }
+  bool has_sync_pt() const { return at<38>().valid(); }
+  ::protozero::ConstBytes sync_pt() const { return at<38>().as_bytes(); }
+  bool has_sync_timeline() const { return at<39>().valid(); }
+  ::protozero::ConstBytes sync_timeline() const { return at<39>().as_bytes(); }
+  bool has_sync_wait() const { return at<40>().valid(); }
+  ::protozero::ConstBytes sync_wait() const { return at<40>().as_bytes(); }
+  bool has_ext4_da_write_begin() const { return at<41>().valid(); }
+  ::protozero::ConstBytes ext4_da_write_begin() const { return at<41>().as_bytes(); }
+  bool has_ext4_da_write_end() const { return at<42>().valid(); }
+  ::protozero::ConstBytes ext4_da_write_end() const { return at<42>().as_bytes(); }
+  bool has_ext4_sync_file_enter() const { return at<43>().valid(); }
+  ::protozero::ConstBytes ext4_sync_file_enter() const { return at<43>().as_bytes(); }
+  bool has_ext4_sync_file_exit() const { return at<44>().valid(); }
+  ::protozero::ConstBytes ext4_sync_file_exit() const { return at<44>().as_bytes(); }
+  bool has_block_rq_issue() const { return at<45>().valid(); }
+  ::protozero::ConstBytes block_rq_issue() const { return at<45>().as_bytes(); }
+  bool has_mm_vmscan_direct_reclaim_begin() const { return at<46>().valid(); }
+  ::protozero::ConstBytes mm_vmscan_direct_reclaim_begin() const { return at<46>().as_bytes(); }
+  bool has_mm_vmscan_direct_reclaim_end() const { return at<47>().valid(); }
+  ::protozero::ConstBytes mm_vmscan_direct_reclaim_end() const { return at<47>().as_bytes(); }
+  bool has_mm_vmscan_kswapd_wake() const { return at<48>().valid(); }
+  ::protozero::ConstBytes mm_vmscan_kswapd_wake() const { return at<48>().as_bytes(); }
+  bool has_mm_vmscan_kswapd_sleep() const { return at<49>().valid(); }
+  ::protozero::ConstBytes mm_vmscan_kswapd_sleep() const { return at<49>().as_bytes(); }
+  bool has_binder_transaction() const { return at<50>().valid(); }
+  ::protozero::ConstBytes binder_transaction() const { return at<50>().as_bytes(); }
+  bool has_binder_transaction_received() const { return at<51>().valid(); }
+  ::protozero::ConstBytes binder_transaction_received() const { return at<51>().as_bytes(); }
+  bool has_binder_set_priority() const { return at<52>().valid(); }
+  ::protozero::ConstBytes binder_set_priority() const { return at<52>().as_bytes(); }
+  bool has_binder_lock() const { return at<53>().valid(); }
+  ::protozero::ConstBytes binder_lock() const { return at<53>().as_bytes(); }
+  bool has_binder_locked() const { return at<54>().valid(); }
+  ::protozero::ConstBytes binder_locked() const { return at<54>().as_bytes(); }
+  bool has_binder_unlock() const { return at<55>().valid(); }
+  ::protozero::ConstBytes binder_unlock() const { return at<55>().as_bytes(); }
+  bool has_workqueue_activate_work() const { return at<56>().valid(); }
+  ::protozero::ConstBytes workqueue_activate_work() const { return at<56>().as_bytes(); }
+  bool has_workqueue_execute_end() const { return at<57>().valid(); }
+  ::protozero::ConstBytes workqueue_execute_end() const { return at<57>().as_bytes(); }
+  bool has_workqueue_execute_start() const { return at<58>().valid(); }
+  ::protozero::ConstBytes workqueue_execute_start() const { return at<58>().as_bytes(); }
+  bool has_workqueue_queue_work() const { return at<59>().valid(); }
+  ::protozero::ConstBytes workqueue_queue_work() const { return at<59>().as_bytes(); }
+  bool has_regulator_disable() const { return at<60>().valid(); }
+  ::protozero::ConstBytes regulator_disable() const { return at<60>().as_bytes(); }
+  bool has_regulator_disable_complete() const { return at<61>().valid(); }
+  ::protozero::ConstBytes regulator_disable_complete() const { return at<61>().as_bytes(); }
+  bool has_regulator_enable() const { return at<62>().valid(); }
+  ::protozero::ConstBytes regulator_enable() const { return at<62>().as_bytes(); }
+  bool has_regulator_enable_complete() const { return at<63>().valid(); }
+  ::protozero::ConstBytes regulator_enable_complete() const { return at<63>().as_bytes(); }
+  bool has_regulator_enable_delay() const { return at<64>().valid(); }
+  ::protozero::ConstBytes regulator_enable_delay() const { return at<64>().as_bytes(); }
+  bool has_regulator_set_voltage() const { return at<65>().valid(); }
+  ::protozero::ConstBytes regulator_set_voltage() const { return at<65>().as_bytes(); }
+  bool has_regulator_set_voltage_complete() const { return at<66>().valid(); }
+  ::protozero::ConstBytes regulator_set_voltage_complete() const { return at<66>().as_bytes(); }
+  bool has_cgroup_attach_task() const { return at<67>().valid(); }
+  ::protozero::ConstBytes cgroup_attach_task() const { return at<67>().as_bytes(); }
+  bool has_cgroup_mkdir() const { return at<68>().valid(); }
+  ::protozero::ConstBytes cgroup_mkdir() const { return at<68>().as_bytes(); }
+  bool has_cgroup_remount() const { return at<69>().valid(); }
+  ::protozero::ConstBytes cgroup_remount() const { return at<69>().as_bytes(); }
+  bool has_cgroup_rmdir() const { return at<70>().valid(); }
+  ::protozero::ConstBytes cgroup_rmdir() const { return at<70>().as_bytes(); }
+  bool has_cgroup_transfer_tasks() const { return at<71>().valid(); }
+  ::protozero::ConstBytes cgroup_transfer_tasks() const { return at<71>().as_bytes(); }
+  bool has_cgroup_destroy_root() const { return at<72>().valid(); }
+  ::protozero::ConstBytes cgroup_destroy_root() const { return at<72>().as_bytes(); }
+  bool has_cgroup_release() const { return at<73>().valid(); }
+  ::protozero::ConstBytes cgroup_release() const { return at<73>().as_bytes(); }
+  bool has_cgroup_rename() const { return at<74>().valid(); }
+  ::protozero::ConstBytes cgroup_rename() const { return at<74>().as_bytes(); }
+  bool has_cgroup_setup_root() const { return at<75>().valid(); }
+  ::protozero::ConstBytes cgroup_setup_root() const { return at<75>().as_bytes(); }
+  bool has_mdp_cmd_kickoff() const { return at<76>().valid(); }
+  ::protozero::ConstBytes mdp_cmd_kickoff() const { return at<76>().as_bytes(); }
+  bool has_mdp_commit() const { return at<77>().valid(); }
+  ::protozero::ConstBytes mdp_commit() const { return at<77>().as_bytes(); }
+  bool has_mdp_perf_set_ot() const { return at<78>().valid(); }
+  ::protozero::ConstBytes mdp_perf_set_ot() const { return at<78>().as_bytes(); }
+  bool has_mdp_sspp_change() const { return at<79>().valid(); }
+  ::protozero::ConstBytes mdp_sspp_change() const { return at<79>().as_bytes(); }
+  bool has_tracing_mark_write() const { return at<80>().valid(); }
+  ::protozero::ConstBytes tracing_mark_write() const { return at<80>().as_bytes(); }
+  bool has_mdp_cmd_pingpong_done() const { return at<81>().valid(); }
+  ::protozero::ConstBytes mdp_cmd_pingpong_done() const { return at<81>().as_bytes(); }
+  bool has_mdp_compare_bw() const { return at<82>().valid(); }
+  ::protozero::ConstBytes mdp_compare_bw() const { return at<82>().as_bytes(); }
+  bool has_mdp_perf_set_panic_luts() const { return at<83>().valid(); }
+  ::protozero::ConstBytes mdp_perf_set_panic_luts() const { return at<83>().as_bytes(); }
+  bool has_mdp_sspp_set() const { return at<84>().valid(); }
+  ::protozero::ConstBytes mdp_sspp_set() const { return at<84>().as_bytes(); }
+  bool has_mdp_cmd_readptr_done() const { return at<85>().valid(); }
+  ::protozero::ConstBytes mdp_cmd_readptr_done() const { return at<85>().as_bytes(); }
+  bool has_mdp_misr_crc() const { return at<86>().valid(); }
+  ::protozero::ConstBytes mdp_misr_crc() const { return at<86>().as_bytes(); }
+  bool has_mdp_perf_set_qos_luts() const { return at<87>().valid(); }
+  ::protozero::ConstBytes mdp_perf_set_qos_luts() const { return at<87>().as_bytes(); }
+  bool has_mdp_trace_counter() const { return at<88>().valid(); }
+  ::protozero::ConstBytes mdp_trace_counter() const { return at<88>().as_bytes(); }
+  bool has_mdp_cmd_release_bw() const { return at<89>().valid(); }
+  ::protozero::ConstBytes mdp_cmd_release_bw() const { return at<89>().as_bytes(); }
+  bool has_mdp_mixer_update() const { return at<90>().valid(); }
+  ::protozero::ConstBytes mdp_mixer_update() const { return at<90>().as_bytes(); }
+  bool has_mdp_perf_set_wm_levels() const { return at<91>().valid(); }
+  ::protozero::ConstBytes mdp_perf_set_wm_levels() const { return at<91>().as_bytes(); }
+  bool has_mdp_video_underrun_done() const { return at<92>().valid(); }
+  ::protozero::ConstBytes mdp_video_underrun_done() const { return at<92>().as_bytes(); }
+  bool has_mdp_cmd_wait_pingpong() const { return at<93>().valid(); }
+  ::protozero::ConstBytes mdp_cmd_wait_pingpong() const { return at<93>().as_bytes(); }
+  bool has_mdp_perf_prefill_calc() const { return at<94>().valid(); }
+  ::protozero::ConstBytes mdp_perf_prefill_calc() const { return at<94>().as_bytes(); }
+  bool has_mdp_perf_update_bus() const { return at<95>().valid(); }
+  ::protozero::ConstBytes mdp_perf_update_bus() const { return at<95>().as_bytes(); }
+  bool has_rotator_bw_ao_as_context() const { return at<96>().valid(); }
+  ::protozero::ConstBytes rotator_bw_ao_as_context() const { return at<96>().as_bytes(); }
+  bool has_mm_filemap_add_to_page_cache() const { return at<97>().valid(); }
+  ::protozero::ConstBytes mm_filemap_add_to_page_cache() const { return at<97>().as_bytes(); }
+  bool has_mm_filemap_delete_from_page_cache() const { return at<98>().valid(); }
+  ::protozero::ConstBytes mm_filemap_delete_from_page_cache() const { return at<98>().as_bytes(); }
+  bool has_mm_compaction_begin() const { return at<99>().valid(); }
+  ::protozero::ConstBytes mm_compaction_begin() const { return at<99>().as_bytes(); }
+  bool has_mm_compaction_defer_compaction() const { return at<100>().valid(); }
+  ::protozero::ConstBytes mm_compaction_defer_compaction() const { return at<100>().as_bytes(); }
+  bool has_mm_compaction_deferred() const { return at<101>().valid(); }
+  ::protozero::ConstBytes mm_compaction_deferred() const { return at<101>().as_bytes(); }
+  bool has_mm_compaction_defer_reset() const { return at<102>().valid(); }
+  ::protozero::ConstBytes mm_compaction_defer_reset() const { return at<102>().as_bytes(); }
+  bool has_mm_compaction_end() const { return at<103>().valid(); }
+  ::protozero::ConstBytes mm_compaction_end() const { return at<103>().as_bytes(); }
+  bool has_mm_compaction_finished() const { return at<104>().valid(); }
+  ::protozero::ConstBytes mm_compaction_finished() const { return at<104>().as_bytes(); }
+  bool has_mm_compaction_isolate_freepages() const { return at<105>().valid(); }
+  ::protozero::ConstBytes mm_compaction_isolate_freepages() const { return at<105>().as_bytes(); }
+  bool has_mm_compaction_isolate_migratepages() const { return at<106>().valid(); }
+  ::protozero::ConstBytes mm_compaction_isolate_migratepages() const { return at<106>().as_bytes(); }
+  bool has_mm_compaction_kcompactd_sleep() const { return at<107>().valid(); }
+  ::protozero::ConstBytes mm_compaction_kcompactd_sleep() const { return at<107>().as_bytes(); }
+  bool has_mm_compaction_kcompactd_wake() const { return at<108>().valid(); }
+  ::protozero::ConstBytes mm_compaction_kcompactd_wake() const { return at<108>().as_bytes(); }
+  bool has_mm_compaction_migratepages() const { return at<109>().valid(); }
+  ::protozero::ConstBytes mm_compaction_migratepages() const { return at<109>().as_bytes(); }
+  bool has_mm_compaction_suitable() const { return at<110>().valid(); }
+  ::protozero::ConstBytes mm_compaction_suitable() const { return at<110>().as_bytes(); }
+  bool has_mm_compaction_try_to_compact_pages() const { return at<111>().valid(); }
+  ::protozero::ConstBytes mm_compaction_try_to_compact_pages() const { return at<111>().as_bytes(); }
+  bool has_mm_compaction_wakeup_kcompactd() const { return at<112>().valid(); }
+  ::protozero::ConstBytes mm_compaction_wakeup_kcompactd() const { return at<112>().as_bytes(); }
+  bool has_suspend_resume() const { return at<113>().valid(); }
+  ::protozero::ConstBytes suspend_resume() const { return at<113>().as_bytes(); }
+  bool has_sched_wakeup_new() const { return at<114>().valid(); }
+  ::protozero::ConstBytes sched_wakeup_new() const { return at<114>().as_bytes(); }
+  bool has_block_bio_backmerge() const { return at<115>().valid(); }
+  ::protozero::ConstBytes block_bio_backmerge() const { return at<115>().as_bytes(); }
+  bool has_block_bio_bounce() const { return at<116>().valid(); }
+  ::protozero::ConstBytes block_bio_bounce() const { return at<116>().as_bytes(); }
+  bool has_block_bio_complete() const { return at<117>().valid(); }
+  ::protozero::ConstBytes block_bio_complete() const { return at<117>().as_bytes(); }
+  bool has_block_bio_frontmerge() const { return at<118>().valid(); }
+  ::protozero::ConstBytes block_bio_frontmerge() const { return at<118>().as_bytes(); }
+  bool has_block_bio_queue() const { return at<119>().valid(); }
+  ::protozero::ConstBytes block_bio_queue() const { return at<119>().as_bytes(); }
+  bool has_block_bio_remap() const { return at<120>().valid(); }
+  ::protozero::ConstBytes block_bio_remap() const { return at<120>().as_bytes(); }
+  bool has_block_dirty_buffer() const { return at<121>().valid(); }
+  ::protozero::ConstBytes block_dirty_buffer() const { return at<121>().as_bytes(); }
+  bool has_block_getrq() const { return at<122>().valid(); }
+  ::protozero::ConstBytes block_getrq() const { return at<122>().as_bytes(); }
+  bool has_block_plug() const { return at<123>().valid(); }
+  ::protozero::ConstBytes block_plug() const { return at<123>().as_bytes(); }
+  bool has_block_rq_abort() const { return at<124>().valid(); }
+  ::protozero::ConstBytes block_rq_abort() const { return at<124>().as_bytes(); }
+  bool has_block_rq_complete() const { return at<125>().valid(); }
+  ::protozero::ConstBytes block_rq_complete() const { return at<125>().as_bytes(); }
+  bool has_block_rq_insert() const { return at<126>().valid(); }
+  ::protozero::ConstBytes block_rq_insert() const { return at<126>().as_bytes(); }
+  bool has_block_rq_remap() const { return at<128>().valid(); }
+  ::protozero::ConstBytes block_rq_remap() const { return at<128>().as_bytes(); }
+  bool has_block_rq_requeue() const { return at<129>().valid(); }
+  ::protozero::ConstBytes block_rq_requeue() const { return at<129>().as_bytes(); }
+  bool has_block_sleeprq() const { return at<130>().valid(); }
+  ::protozero::ConstBytes block_sleeprq() const { return at<130>().as_bytes(); }
+  bool has_block_split() const { return at<131>().valid(); }
+  ::protozero::ConstBytes block_split() const { return at<131>().as_bytes(); }
+  bool has_block_touch_buffer() const { return at<132>().valid(); }
+  ::protozero::ConstBytes block_touch_buffer() const { return at<132>().as_bytes(); }
+  bool has_block_unplug() const { return at<133>().valid(); }
+  ::protozero::ConstBytes block_unplug() const { return at<133>().as_bytes(); }
+  bool has_ext4_alloc_da_blocks() const { return at<134>().valid(); }
+  ::protozero::ConstBytes ext4_alloc_da_blocks() const { return at<134>().as_bytes(); }
+  bool has_ext4_allocate_blocks() const { return at<135>().valid(); }
+  ::protozero::ConstBytes ext4_allocate_blocks() const { return at<135>().as_bytes(); }
+  bool has_ext4_allocate_inode() const { return at<136>().valid(); }
+  ::protozero::ConstBytes ext4_allocate_inode() const { return at<136>().as_bytes(); }
+  bool has_ext4_begin_ordered_truncate() const { return at<137>().valid(); }
+  ::protozero::ConstBytes ext4_begin_ordered_truncate() const { return at<137>().as_bytes(); }
+  bool has_ext4_collapse_range() const { return at<138>().valid(); }
+  ::protozero::ConstBytes ext4_collapse_range() const { return at<138>().as_bytes(); }
+  bool has_ext4_da_release_space() const { return at<139>().valid(); }
+  ::protozero::ConstBytes ext4_da_release_space() const { return at<139>().as_bytes(); }
+  bool has_ext4_da_reserve_space() const { return at<140>().valid(); }
+  ::protozero::ConstBytes ext4_da_reserve_space() const { return at<140>().as_bytes(); }
+  bool has_ext4_da_update_reserve_space() const { return at<141>().valid(); }
+  ::protozero::ConstBytes ext4_da_update_reserve_space() const { return at<141>().as_bytes(); }
+  bool has_ext4_da_write_pages() const { return at<142>().valid(); }
+  ::protozero::ConstBytes ext4_da_write_pages() const { return at<142>().as_bytes(); }
+  bool has_ext4_da_write_pages_extent() const { return at<143>().valid(); }
+  ::protozero::ConstBytes ext4_da_write_pages_extent() const { return at<143>().as_bytes(); }
+  bool has_ext4_direct_io_enter() const { return at<144>().valid(); }
+  ::protozero::ConstBytes ext4_direct_io_enter() const { return at<144>().as_bytes(); }
+  bool has_ext4_direct_io_exit() const { return at<145>().valid(); }
+  ::protozero::ConstBytes ext4_direct_io_exit() const { return at<145>().as_bytes(); }
+  bool has_ext4_discard_blocks() const { return at<146>().valid(); }
+  ::protozero::ConstBytes ext4_discard_blocks() const { return at<146>().as_bytes(); }
+  bool has_ext4_discard_preallocations() const { return at<147>().valid(); }
+  ::protozero::ConstBytes ext4_discard_preallocations() const { return at<147>().as_bytes(); }
+  bool has_ext4_drop_inode() const { return at<148>().valid(); }
+  ::protozero::ConstBytes ext4_drop_inode() const { return at<148>().as_bytes(); }
+  bool has_ext4_es_cache_extent() const { return at<149>().valid(); }
+  ::protozero::ConstBytes ext4_es_cache_extent() const { return at<149>().as_bytes(); }
+  bool has_ext4_es_find_delayed_extent_range_enter() const { return at<150>().valid(); }
+  ::protozero::ConstBytes ext4_es_find_delayed_extent_range_enter() const { return at<150>().as_bytes(); }
+  bool has_ext4_es_find_delayed_extent_range_exit() const { return at<151>().valid(); }
+  ::protozero::ConstBytes ext4_es_find_delayed_extent_range_exit() const { return at<151>().as_bytes(); }
+  bool has_ext4_es_insert_extent() const { return at<152>().valid(); }
+  ::protozero::ConstBytes ext4_es_insert_extent() const { return at<152>().as_bytes(); }
+  bool has_ext4_es_lookup_extent_enter() const { return at<153>().valid(); }
+  ::protozero::ConstBytes ext4_es_lookup_extent_enter() const { return at<153>().as_bytes(); }
+  bool has_ext4_es_lookup_extent_exit() const { return at<154>().valid(); }
+  ::protozero::ConstBytes ext4_es_lookup_extent_exit() const { return at<154>().as_bytes(); }
+  bool has_ext4_es_remove_extent() const { return at<155>().valid(); }
+  ::protozero::ConstBytes ext4_es_remove_extent() const { return at<155>().as_bytes(); }
+  bool has_ext4_es_shrink() const { return at<156>().valid(); }
+  ::protozero::ConstBytes ext4_es_shrink() const { return at<156>().as_bytes(); }
+  bool has_ext4_es_shrink_count() const { return at<157>().valid(); }
+  ::protozero::ConstBytes ext4_es_shrink_count() const { return at<157>().as_bytes(); }
+  bool has_ext4_es_shrink_scan_enter() const { return at<158>().valid(); }
+  ::protozero::ConstBytes ext4_es_shrink_scan_enter() const { return at<158>().as_bytes(); }
+  bool has_ext4_es_shrink_scan_exit() const { return at<159>().valid(); }
+  ::protozero::ConstBytes ext4_es_shrink_scan_exit() const { return at<159>().as_bytes(); }
+  bool has_ext4_evict_inode() const { return at<160>().valid(); }
+  ::protozero::ConstBytes ext4_evict_inode() const { return at<160>().as_bytes(); }
+  bool has_ext4_ext_convert_to_initialized_enter() const { return at<161>().valid(); }
+  ::protozero::ConstBytes ext4_ext_convert_to_initialized_enter() const { return at<161>().as_bytes(); }
+  bool has_ext4_ext_convert_to_initialized_fastpath() const { return at<162>().valid(); }
+  ::protozero::ConstBytes ext4_ext_convert_to_initialized_fastpath() const { return at<162>().as_bytes(); }
+  bool has_ext4_ext_handle_unwritten_extents() const { return at<163>().valid(); }
+  ::protozero::ConstBytes ext4_ext_handle_unwritten_extents() const { return at<163>().as_bytes(); }
+  bool has_ext4_ext_in_cache() const { return at<164>().valid(); }
+  ::protozero::ConstBytes ext4_ext_in_cache() const { return at<164>().as_bytes(); }
+  bool has_ext4_ext_load_extent() const { return at<165>().valid(); }
+  ::protozero::ConstBytes ext4_ext_load_extent() const { return at<165>().as_bytes(); }
+  bool has_ext4_ext_map_blocks_enter() const { return at<166>().valid(); }
+  ::protozero::ConstBytes ext4_ext_map_blocks_enter() const { return at<166>().as_bytes(); }
+  bool has_ext4_ext_map_blocks_exit() const { return at<167>().valid(); }
+  ::protozero::ConstBytes ext4_ext_map_blocks_exit() const { return at<167>().as_bytes(); }
+  bool has_ext4_ext_put_in_cache() const { return at<168>().valid(); }
+  ::protozero::ConstBytes ext4_ext_put_in_cache() const { return at<168>().as_bytes(); }
+  bool has_ext4_ext_remove_space() const { return at<169>().valid(); }
+  ::protozero::ConstBytes ext4_ext_remove_space() const { return at<169>().as_bytes(); }
+  bool has_ext4_ext_remove_space_done() const { return at<170>().valid(); }
+  ::protozero::ConstBytes ext4_ext_remove_space_done() const { return at<170>().as_bytes(); }
+  bool has_ext4_ext_rm_idx() const { return at<171>().valid(); }
+  ::protozero::ConstBytes ext4_ext_rm_idx() const { return at<171>().as_bytes(); }
+  bool has_ext4_ext_rm_leaf() const { return at<172>().valid(); }
+  ::protozero::ConstBytes ext4_ext_rm_leaf() const { return at<172>().as_bytes(); }
+  bool has_ext4_ext_show_extent() const { return at<173>().valid(); }
+  ::protozero::ConstBytes ext4_ext_show_extent() const { return at<173>().as_bytes(); }
+  bool has_ext4_fallocate_enter() const { return at<174>().valid(); }
+  ::protozero::ConstBytes ext4_fallocate_enter() const { return at<174>().as_bytes(); }
+  bool has_ext4_fallocate_exit() const { return at<175>().valid(); }
+  ::protozero::ConstBytes ext4_fallocate_exit() const { return at<175>().as_bytes(); }
+  bool has_ext4_find_delalloc_range() const { return at<176>().valid(); }
+  ::protozero::ConstBytes ext4_find_delalloc_range() const { return at<176>().as_bytes(); }
+  bool has_ext4_forget() const { return at<177>().valid(); }
+  ::protozero::ConstBytes ext4_forget() const { return at<177>().as_bytes(); }
+  bool has_ext4_free_blocks() const { return at<178>().valid(); }
+  ::protozero::ConstBytes ext4_free_blocks() const { return at<178>().as_bytes(); }
+  bool has_ext4_free_inode() const { return at<179>().valid(); }
+  ::protozero::ConstBytes ext4_free_inode() const { return at<179>().as_bytes(); }
+  bool has_ext4_get_implied_cluster_alloc_exit() const { return at<180>().valid(); }
+  ::protozero::ConstBytes ext4_get_implied_cluster_alloc_exit() const { return at<180>().as_bytes(); }
+  bool has_ext4_get_reserved_cluster_alloc() const { return at<181>().valid(); }
+  ::protozero::ConstBytes ext4_get_reserved_cluster_alloc() const { return at<181>().as_bytes(); }
+  bool has_ext4_ind_map_blocks_enter() const { return at<182>().valid(); }
+  ::protozero::ConstBytes ext4_ind_map_blocks_enter() const { return at<182>().as_bytes(); }
+  bool has_ext4_ind_map_blocks_exit() const { return at<183>().valid(); }
+  ::protozero::ConstBytes ext4_ind_map_blocks_exit() const { return at<183>().as_bytes(); }
+  bool has_ext4_insert_range() const { return at<184>().valid(); }
+  ::protozero::ConstBytes ext4_insert_range() const { return at<184>().as_bytes(); }
+  bool has_ext4_invalidatepage() const { return at<185>().valid(); }
+  ::protozero::ConstBytes ext4_invalidatepage() const { return at<185>().as_bytes(); }
+  bool has_ext4_journal_start() const { return at<186>().valid(); }
+  ::protozero::ConstBytes ext4_journal_start() const { return at<186>().as_bytes(); }
+  bool has_ext4_journal_start_reserved() const { return at<187>().valid(); }
+  ::protozero::ConstBytes ext4_journal_start_reserved() const { return at<187>().as_bytes(); }
+  bool has_ext4_journalled_invalidatepage() const { return at<188>().valid(); }
+  ::protozero::ConstBytes ext4_journalled_invalidatepage() const { return at<188>().as_bytes(); }
+  bool has_ext4_journalled_write_end() const { return at<189>().valid(); }
+  ::protozero::ConstBytes ext4_journalled_write_end() const { return at<189>().as_bytes(); }
+  bool has_ext4_load_inode() const { return at<190>().valid(); }
+  ::protozero::ConstBytes ext4_load_inode() const { return at<190>().as_bytes(); }
+  bool has_ext4_load_inode_bitmap() const { return at<191>().valid(); }
+  ::protozero::ConstBytes ext4_load_inode_bitmap() const { return at<191>().as_bytes(); }
+  bool has_ext4_mark_inode_dirty() const { return at<192>().valid(); }
+  ::protozero::ConstBytes ext4_mark_inode_dirty() const { return at<192>().as_bytes(); }
+  bool has_ext4_mb_bitmap_load() const { return at<193>().valid(); }
+  ::protozero::ConstBytes ext4_mb_bitmap_load() const { return at<193>().as_bytes(); }
+  bool has_ext4_mb_buddy_bitmap_load() const { return at<194>().valid(); }
+  ::protozero::ConstBytes ext4_mb_buddy_bitmap_load() const { return at<194>().as_bytes(); }
+  bool has_ext4_mb_discard_preallocations() const { return at<195>().valid(); }
+  ::protozero::ConstBytes ext4_mb_discard_preallocations() const { return at<195>().as_bytes(); }
+  bool has_ext4_mb_new_group_pa() const { return at<196>().valid(); }
+  ::protozero::ConstBytes ext4_mb_new_group_pa() const { return at<196>().as_bytes(); }
+  bool has_ext4_mb_new_inode_pa() const { return at<197>().valid(); }
+  ::protozero::ConstBytes ext4_mb_new_inode_pa() const { return at<197>().as_bytes(); }
+  bool has_ext4_mb_release_group_pa() const { return at<198>().valid(); }
+  ::protozero::ConstBytes ext4_mb_release_group_pa() const { return at<198>().as_bytes(); }
+  bool has_ext4_mb_release_inode_pa() const { return at<199>().valid(); }
+  ::protozero::ConstBytes ext4_mb_release_inode_pa() const { return at<199>().as_bytes(); }
+  bool has_ext4_mballoc_alloc() const { return at<200>().valid(); }
+  ::protozero::ConstBytes ext4_mballoc_alloc() const { return at<200>().as_bytes(); }
+  bool has_ext4_mballoc_discard() const { return at<201>().valid(); }
+  ::protozero::ConstBytes ext4_mballoc_discard() const { return at<201>().as_bytes(); }
+  bool has_ext4_mballoc_free() const { return at<202>().valid(); }
+  ::protozero::ConstBytes ext4_mballoc_free() const { return at<202>().as_bytes(); }
+  bool has_ext4_mballoc_prealloc() const { return at<203>().valid(); }
+  ::protozero::ConstBytes ext4_mballoc_prealloc() const { return at<203>().as_bytes(); }
+  bool has_ext4_other_inode_update_time() const { return at<204>().valid(); }
+  ::protozero::ConstBytes ext4_other_inode_update_time() const { return at<204>().as_bytes(); }
+  bool has_ext4_punch_hole() const { return at<205>().valid(); }
+  ::protozero::ConstBytes ext4_punch_hole() const { return at<205>().as_bytes(); }
+  bool has_ext4_read_block_bitmap_load() const { return at<206>().valid(); }
+  ::protozero::ConstBytes ext4_read_block_bitmap_load() const { return at<206>().as_bytes(); }
+  bool has_ext4_readpage() const { return at<207>().valid(); }
+  ::protozero::ConstBytes ext4_readpage() const { return at<207>().as_bytes(); }
+  bool has_ext4_releasepage() const { return at<208>().valid(); }
+  ::protozero::ConstBytes ext4_releasepage() const { return at<208>().as_bytes(); }
+  bool has_ext4_remove_blocks() const { return at<209>().valid(); }
+  ::protozero::ConstBytes ext4_remove_blocks() const { return at<209>().as_bytes(); }
+  bool has_ext4_request_blocks() const { return at<210>().valid(); }
+  ::protozero::ConstBytes ext4_request_blocks() const { return at<210>().as_bytes(); }
+  bool has_ext4_request_inode() const { return at<211>().valid(); }
+  ::protozero::ConstBytes ext4_request_inode() const { return at<211>().as_bytes(); }
+  bool has_ext4_sync_fs() const { return at<212>().valid(); }
+  ::protozero::ConstBytes ext4_sync_fs() const { return at<212>().as_bytes(); }
+  bool has_ext4_trim_all_free() const { return at<213>().valid(); }
+  ::protozero::ConstBytes ext4_trim_all_free() const { return at<213>().as_bytes(); }
+  bool has_ext4_trim_extent() const { return at<214>().valid(); }
+  ::protozero::ConstBytes ext4_trim_extent() const { return at<214>().as_bytes(); }
+  bool has_ext4_truncate_enter() const { return at<215>().valid(); }
+  ::protozero::ConstBytes ext4_truncate_enter() const { return at<215>().as_bytes(); }
+  bool has_ext4_truncate_exit() const { return at<216>().valid(); }
+  ::protozero::ConstBytes ext4_truncate_exit() const { return at<216>().as_bytes(); }
+  bool has_ext4_unlink_enter() const { return at<217>().valid(); }
+  ::protozero::ConstBytes ext4_unlink_enter() const { return at<217>().as_bytes(); }
+  bool has_ext4_unlink_exit() const { return at<218>().valid(); }
+  ::protozero::ConstBytes ext4_unlink_exit() const { return at<218>().as_bytes(); }
+  bool has_ext4_write_begin() const { return at<219>().valid(); }
+  ::protozero::ConstBytes ext4_write_begin() const { return at<219>().as_bytes(); }
+  bool has_ext4_write_end() const { return at<230>().valid(); }
+  ::protozero::ConstBytes ext4_write_end() const { return at<230>().as_bytes(); }
+  bool has_ext4_writepage() const { return at<231>().valid(); }
+  ::protozero::ConstBytes ext4_writepage() const { return at<231>().as_bytes(); }
+  bool has_ext4_writepages() const { return at<232>().valid(); }
+  ::protozero::ConstBytes ext4_writepages() const { return at<232>().as_bytes(); }
+  bool has_ext4_writepages_result() const { return at<233>().valid(); }
+  ::protozero::ConstBytes ext4_writepages_result() const { return at<233>().as_bytes(); }
+  bool has_ext4_zero_range() const { return at<234>().valid(); }
+  ::protozero::ConstBytes ext4_zero_range() const { return at<234>().as_bytes(); }
+  bool has_task_newtask() const { return at<235>().valid(); }
+  ::protozero::ConstBytes task_newtask() const { return at<235>().as_bytes(); }
+  bool has_task_rename() const { return at<236>().valid(); }
+  ::protozero::ConstBytes task_rename() const { return at<236>().as_bytes(); }
+  bool has_sched_process_exec() const { return at<237>().valid(); }
+  ::protozero::ConstBytes sched_process_exec() const { return at<237>().as_bytes(); }
+  bool has_sched_process_exit() const { return at<238>().valid(); }
+  ::protozero::ConstBytes sched_process_exit() const { return at<238>().as_bytes(); }
+  bool has_sched_process_fork() const { return at<239>().valid(); }
+  ::protozero::ConstBytes sched_process_fork() const { return at<239>().as_bytes(); }
+  bool has_sched_process_free() const { return at<240>().valid(); }
+  ::protozero::ConstBytes sched_process_free() const { return at<240>().as_bytes(); }
+  bool has_sched_process_hang() const { return at<241>().valid(); }
+  ::protozero::ConstBytes sched_process_hang() const { return at<241>().as_bytes(); }
+  bool has_sched_process_wait() const { return at<242>().valid(); }
+  ::protozero::ConstBytes sched_process_wait() const { return at<242>().as_bytes(); }
+  bool has_f2fs_do_submit_bio() const { return at<243>().valid(); }
+  ::protozero::ConstBytes f2fs_do_submit_bio() const { return at<243>().as_bytes(); }
+  bool has_f2fs_evict_inode() const { return at<244>().valid(); }
+  ::protozero::ConstBytes f2fs_evict_inode() const { return at<244>().as_bytes(); }
+  bool has_f2fs_fallocate() const { return at<245>().valid(); }
+  ::protozero::ConstBytes f2fs_fallocate() const { return at<245>().as_bytes(); }
+  bool has_f2fs_get_data_block() const { return at<246>().valid(); }
+  ::protozero::ConstBytes f2fs_get_data_block() const { return at<246>().as_bytes(); }
+  bool has_f2fs_get_victim() const { return at<247>().valid(); }
+  ::protozero::ConstBytes f2fs_get_victim() const { return at<247>().as_bytes(); }
+  bool has_f2fs_iget() const { return at<248>().valid(); }
+  ::protozero::ConstBytes f2fs_iget() const { return at<248>().as_bytes(); }
+  bool has_f2fs_iget_exit() const { return at<249>().valid(); }
+  ::protozero::ConstBytes f2fs_iget_exit() const { return at<249>().as_bytes(); }
+  bool has_f2fs_new_inode() const { return at<250>().valid(); }
+  ::protozero::ConstBytes f2fs_new_inode() const { return at<250>().as_bytes(); }
+  bool has_f2fs_readpage() const { return at<251>().valid(); }
+  ::protozero::ConstBytes f2fs_readpage() const { return at<251>().as_bytes(); }
+  bool has_f2fs_reserve_new_block() const { return at<252>().valid(); }
+  ::protozero::ConstBytes f2fs_reserve_new_block() const { return at<252>().as_bytes(); }
+  bool has_f2fs_set_page_dirty() const { return at<253>().valid(); }
+  ::protozero::ConstBytes f2fs_set_page_dirty() const { return at<253>().as_bytes(); }
+  bool has_f2fs_submit_write_page() const { return at<254>().valid(); }
+  ::protozero::ConstBytes f2fs_submit_write_page() const { return at<254>().as_bytes(); }
+  bool has_f2fs_sync_file_enter() const { return at<255>().valid(); }
+  ::protozero::ConstBytes f2fs_sync_file_enter() const { return at<255>().as_bytes(); }
+  bool has_f2fs_sync_file_exit() const { return at<256>().valid(); }
+  ::protozero::ConstBytes f2fs_sync_file_exit() const { return at<256>().as_bytes(); }
+  bool has_f2fs_sync_fs() const { return at<257>().valid(); }
+  ::protozero::ConstBytes f2fs_sync_fs() const { return at<257>().as_bytes(); }
+  bool has_f2fs_truncate() const { return at<258>().valid(); }
+  ::protozero::ConstBytes f2fs_truncate() const { return at<258>().as_bytes(); }
+  bool has_f2fs_truncate_blocks_enter() const { return at<259>().valid(); }
+  ::protozero::ConstBytes f2fs_truncate_blocks_enter() const { return at<259>().as_bytes(); }
+  bool has_f2fs_truncate_blocks_exit() const { return at<260>().valid(); }
+  ::protozero::ConstBytes f2fs_truncate_blocks_exit() const { return at<260>().as_bytes(); }
+  bool has_f2fs_truncate_data_blocks_range() const { return at<261>().valid(); }
+  ::protozero::ConstBytes f2fs_truncate_data_blocks_range() const { return at<261>().as_bytes(); }
+  bool has_f2fs_truncate_inode_blocks_enter() const { return at<262>().valid(); }
+  ::protozero::ConstBytes f2fs_truncate_inode_blocks_enter() const { return at<262>().as_bytes(); }
+  bool has_f2fs_truncate_inode_blocks_exit() const { return at<263>().valid(); }
+  ::protozero::ConstBytes f2fs_truncate_inode_blocks_exit() const { return at<263>().as_bytes(); }
+  bool has_f2fs_truncate_node() const { return at<264>().valid(); }
+  ::protozero::ConstBytes f2fs_truncate_node() const { return at<264>().as_bytes(); }
+  bool has_f2fs_truncate_nodes_enter() const { return at<265>().valid(); }
+  ::protozero::ConstBytes f2fs_truncate_nodes_enter() const { return at<265>().as_bytes(); }
+  bool has_f2fs_truncate_nodes_exit() const { return at<266>().valid(); }
+  ::protozero::ConstBytes f2fs_truncate_nodes_exit() const { return at<266>().as_bytes(); }
+  bool has_f2fs_truncate_partial_nodes() const { return at<267>().valid(); }
+  ::protozero::ConstBytes f2fs_truncate_partial_nodes() const { return at<267>().as_bytes(); }
+  bool has_f2fs_unlink_enter() const { return at<268>().valid(); }
+  ::protozero::ConstBytes f2fs_unlink_enter() const { return at<268>().as_bytes(); }
+  bool has_f2fs_unlink_exit() const { return at<269>().valid(); }
+  ::protozero::ConstBytes f2fs_unlink_exit() const { return at<269>().as_bytes(); }
+  bool has_f2fs_vm_page_mkwrite() const { return at<270>().valid(); }
+  ::protozero::ConstBytes f2fs_vm_page_mkwrite() const { return at<270>().as_bytes(); }
+  bool has_f2fs_write_begin() const { return at<271>().valid(); }
+  ::protozero::ConstBytes f2fs_write_begin() const { return at<271>().as_bytes(); }
+  bool has_f2fs_write_checkpoint() const { return at<272>().valid(); }
+  ::protozero::ConstBytes f2fs_write_checkpoint() const { return at<272>().as_bytes(); }
+  bool has_f2fs_write_end() const { return at<273>().valid(); }
+  ::protozero::ConstBytes f2fs_write_end() const { return at<273>().as_bytes(); }
+  bool has_alloc_pages_iommu_end() const { return at<274>().valid(); }
+  ::protozero::ConstBytes alloc_pages_iommu_end() const { return at<274>().as_bytes(); }
+  bool has_alloc_pages_iommu_fail() const { return at<275>().valid(); }
+  ::protozero::ConstBytes alloc_pages_iommu_fail() const { return at<275>().as_bytes(); }
+  bool has_alloc_pages_iommu_start() const { return at<276>().valid(); }
+  ::protozero::ConstBytes alloc_pages_iommu_start() const { return at<276>().as_bytes(); }
+  bool has_alloc_pages_sys_end() const { return at<277>().valid(); }
+  ::protozero::ConstBytes alloc_pages_sys_end() const { return at<277>().as_bytes(); }
+  bool has_alloc_pages_sys_fail() const { return at<278>().valid(); }
+  ::protozero::ConstBytes alloc_pages_sys_fail() const { return at<278>().as_bytes(); }
+  bool has_alloc_pages_sys_start() const { return at<279>().valid(); }
+  ::protozero::ConstBytes alloc_pages_sys_start() const { return at<279>().as_bytes(); }
+  bool has_dma_alloc_contiguous_retry() const { return at<280>().valid(); }
+  ::protozero::ConstBytes dma_alloc_contiguous_retry() const { return at<280>().as_bytes(); }
+  bool has_iommu_map_range() const { return at<281>().valid(); }
+  ::protozero::ConstBytes iommu_map_range() const { return at<281>().as_bytes(); }
+  bool has_iommu_sec_ptbl_map_range_end() const { return at<282>().valid(); }
+  ::protozero::ConstBytes iommu_sec_ptbl_map_range_end() const { return at<282>().as_bytes(); }
+  bool has_iommu_sec_ptbl_map_range_start() const { return at<283>().valid(); }
+  ::protozero::ConstBytes iommu_sec_ptbl_map_range_start() const { return at<283>().as_bytes(); }
+  bool has_ion_alloc_buffer_end() const { return at<284>().valid(); }
+  ::protozero::ConstBytes ion_alloc_buffer_end() const { return at<284>().as_bytes(); }
+  bool has_ion_alloc_buffer_fail() const { return at<285>().valid(); }
+  ::protozero::ConstBytes ion_alloc_buffer_fail() const { return at<285>().as_bytes(); }
+  bool has_ion_alloc_buffer_fallback() const { return at<286>().valid(); }
+  ::protozero::ConstBytes ion_alloc_buffer_fallback() const { return at<286>().as_bytes(); }
+  bool has_ion_alloc_buffer_start() const { return at<287>().valid(); }
+  ::protozero::ConstBytes ion_alloc_buffer_start() const { return at<287>().as_bytes(); }
+  bool has_ion_cp_alloc_retry() const { return at<288>().valid(); }
+  ::protozero::ConstBytes ion_cp_alloc_retry() const { return at<288>().as_bytes(); }
+  bool has_ion_cp_secure_buffer_end() const { return at<289>().valid(); }
+  ::protozero::ConstBytes ion_cp_secure_buffer_end() const { return at<289>().as_bytes(); }
+  bool has_ion_cp_secure_buffer_start() const { return at<290>().valid(); }
+  ::protozero::ConstBytes ion_cp_secure_buffer_start() const { return at<290>().as_bytes(); }
+  bool has_ion_prefetching() const { return at<291>().valid(); }
+  ::protozero::ConstBytes ion_prefetching() const { return at<291>().as_bytes(); }
+  bool has_ion_secure_cma_add_to_pool_end() const { return at<292>().valid(); }
+  ::protozero::ConstBytes ion_secure_cma_add_to_pool_end() const { return at<292>().as_bytes(); }
+  bool has_ion_secure_cma_add_to_pool_start() const { return at<293>().valid(); }
+  ::protozero::ConstBytes ion_secure_cma_add_to_pool_start() const { return at<293>().as_bytes(); }
+  bool has_ion_secure_cma_allocate_end() const { return at<294>().valid(); }
+  ::protozero::ConstBytes ion_secure_cma_allocate_end() const { return at<294>().as_bytes(); }
+  bool has_ion_secure_cma_allocate_start() const { return at<295>().valid(); }
+  ::protozero::ConstBytes ion_secure_cma_allocate_start() const { return at<295>().as_bytes(); }
+  bool has_ion_secure_cma_shrink_pool_end() const { return at<296>().valid(); }
+  ::protozero::ConstBytes ion_secure_cma_shrink_pool_end() const { return at<296>().as_bytes(); }
+  bool has_ion_secure_cma_shrink_pool_start() const { return at<297>().valid(); }
+  ::protozero::ConstBytes ion_secure_cma_shrink_pool_start() const { return at<297>().as_bytes(); }
+  bool has_kfree() const { return at<298>().valid(); }
+  ::protozero::ConstBytes kfree() const { return at<298>().as_bytes(); }
+  bool has_kmalloc() const { return at<299>().valid(); }
+  ::protozero::ConstBytes kmalloc() const { return at<299>().as_bytes(); }
+  bool has_kmalloc_node() const { return at<300>().valid(); }
+  ::protozero::ConstBytes kmalloc_node() const { return at<300>().as_bytes(); }
+  bool has_kmem_cache_alloc() const { return at<301>().valid(); }
+  ::protozero::ConstBytes kmem_cache_alloc() const { return at<301>().as_bytes(); }
+  bool has_kmem_cache_alloc_node() const { return at<302>().valid(); }
+  ::protozero::ConstBytes kmem_cache_alloc_node() const { return at<302>().as_bytes(); }
+  bool has_kmem_cache_free() const { return at<303>().valid(); }
+  ::protozero::ConstBytes kmem_cache_free() const { return at<303>().as_bytes(); }
+  bool has_migrate_pages_end() const { return at<304>().valid(); }
+  ::protozero::ConstBytes migrate_pages_end() const { return at<304>().as_bytes(); }
+  bool has_migrate_pages_start() const { return at<305>().valid(); }
+  ::protozero::ConstBytes migrate_pages_start() const { return at<305>().as_bytes(); }
+  bool has_migrate_retry() const { return at<306>().valid(); }
+  ::protozero::ConstBytes migrate_retry() const { return at<306>().as_bytes(); }
+  bool has_mm_page_alloc() const { return at<307>().valid(); }
+  ::protozero::ConstBytes mm_page_alloc() const { return at<307>().as_bytes(); }
+  bool has_mm_page_alloc_extfrag() const { return at<308>().valid(); }
+  ::protozero::ConstBytes mm_page_alloc_extfrag() const { return at<308>().as_bytes(); }
+  bool has_mm_page_alloc_zone_locked() const { return at<309>().valid(); }
+  ::protozero::ConstBytes mm_page_alloc_zone_locked() const { return at<309>().as_bytes(); }
+  bool has_mm_page_free() const { return at<310>().valid(); }
+  ::protozero::ConstBytes mm_page_free() const { return at<310>().as_bytes(); }
+  bool has_mm_page_free_batched() const { return at<311>().valid(); }
+  ::protozero::ConstBytes mm_page_free_batched() const { return at<311>().as_bytes(); }
+  bool has_mm_page_pcpu_drain() const { return at<312>().valid(); }
+  ::protozero::ConstBytes mm_page_pcpu_drain() const { return at<312>().as_bytes(); }
+  bool has_rss_stat() const { return at<313>().valid(); }
+  ::protozero::ConstBytes rss_stat() const { return at<313>().as_bytes(); }
+  bool has_ion_heap_shrink() const { return at<314>().valid(); }
+  ::protozero::ConstBytes ion_heap_shrink() const { return at<314>().as_bytes(); }
+  bool has_ion_heap_grow() const { return at<315>().valid(); }
+  ::protozero::ConstBytes ion_heap_grow() const { return at<315>().as_bytes(); }
+  bool has_fence_init() const { return at<316>().valid(); }
+  ::protozero::ConstBytes fence_init() const { return at<316>().as_bytes(); }
+  bool has_fence_destroy() const { return at<317>().valid(); }
+  ::protozero::ConstBytes fence_destroy() const { return at<317>().as_bytes(); }
+  bool has_fence_enable_signal() const { return at<318>().valid(); }
+  ::protozero::ConstBytes fence_enable_signal() const { return at<318>().as_bytes(); }
+  bool has_fence_signaled() const { return at<319>().valid(); }
+  ::protozero::ConstBytes fence_signaled() const { return at<319>().as_bytes(); }
+  bool has_clk_enable() const { return at<320>().valid(); }
+  ::protozero::ConstBytes clk_enable() const { return at<320>().as_bytes(); }
+  bool has_clk_disable() const { return at<321>().valid(); }
+  ::protozero::ConstBytes clk_disable() const { return at<321>().as_bytes(); }
+  bool has_clk_set_rate() const { return at<322>().valid(); }
+  ::protozero::ConstBytes clk_set_rate() const { return at<322>().as_bytes(); }
+  bool has_binder_transaction_alloc_buf() const { return at<323>().valid(); }
+  ::protozero::ConstBytes binder_transaction_alloc_buf() const { return at<323>().as_bytes(); }
+  bool has_signal_deliver() const { return at<324>().valid(); }
+  ::protozero::ConstBytes signal_deliver() const { return at<324>().as_bytes(); }
+  bool has_signal_generate() const { return at<325>().valid(); }
+  ::protozero::ConstBytes signal_generate() const { return at<325>().as_bytes(); }
+  bool has_oom_score_adj_update() const { return at<326>().valid(); }
+  ::protozero::ConstBytes oom_score_adj_update() const { return at<326>().as_bytes(); }
+  bool has_generic() const { return at<327>().valid(); }
+  ::protozero::ConstBytes generic() const { return at<327>().as_bytes(); }
+  bool has_mm_event_record() const { return at<328>().valid(); }
+  ::protozero::ConstBytes mm_event_record() const { return at<328>().as_bytes(); }
+  bool has_sys_enter() const { return at<329>().valid(); }
+  ::protozero::ConstBytes sys_enter() const { return at<329>().as_bytes(); }
+  bool has_sys_exit() const { return at<330>().valid(); }
+  ::protozero::ConstBytes sys_exit() const { return at<330>().as_bytes(); }
+  bool has_zero() const { return at<331>().valid(); }
+  ::protozero::ConstBytes zero() const { return at<331>().as_bytes(); }
+  bool has_gpu_frequency() const { return at<332>().valid(); }
+  ::protozero::ConstBytes gpu_frequency() const { return at<332>().as_bytes(); }
+  bool has_sde_tracing_mark_write() const { return at<333>().valid(); }
+  ::protozero::ConstBytes sde_tracing_mark_write() const { return at<333>().as_bytes(); }
+  bool has_mark_victim() const { return at<334>().valid(); }
+  ::protozero::ConstBytes mark_victim() const { return at<334>().as_bytes(); }
+  bool has_ion_stat() const { return at<335>().valid(); }
+  ::protozero::ConstBytes ion_stat() const { return at<335>().as_bytes(); }
+  bool has_ion_buffer_create() const { return at<336>().valid(); }
+  ::protozero::ConstBytes ion_buffer_create() const { return at<336>().as_bytes(); }
+  bool has_ion_buffer_destroy() const { return at<337>().valid(); }
+  ::protozero::ConstBytes ion_buffer_destroy() const { return at<337>().as_bytes(); }
+  bool has_scm_call_start() const { return at<338>().valid(); }
+  ::protozero::ConstBytes scm_call_start() const { return at<338>().as_bytes(); }
+  bool has_scm_call_end() const { return at<339>().valid(); }
+  ::protozero::ConstBytes scm_call_end() const { return at<339>().as_bytes(); }
+  bool has_gpu_mem_total() const { return at<340>().valid(); }
+  ::protozero::ConstBytes gpu_mem_total() const { return at<340>().as_bytes(); }
+  bool has_thermal_temperature() const { return at<341>().valid(); }
+  ::protozero::ConstBytes thermal_temperature() const { return at<341>().as_bytes(); }
+  bool has_cdev_update() const { return at<342>().valid(); }
+  ::protozero::ConstBytes cdev_update() const { return at<342>().as_bytes(); }
+  bool has_cpuhp_exit() const { return at<343>().valid(); }
+  ::protozero::ConstBytes cpuhp_exit() const { return at<343>().as_bytes(); }
+  bool has_cpuhp_multi_enter() const { return at<344>().valid(); }
+  ::protozero::ConstBytes cpuhp_multi_enter() const { return at<344>().as_bytes(); }
+  bool has_cpuhp_enter() const { return at<345>().valid(); }
+  ::protozero::ConstBytes cpuhp_enter() const { return at<345>().as_bytes(); }
+  bool has_cpuhp_latency() const { return at<346>().valid(); }
+  ::protozero::ConstBytes cpuhp_latency() const { return at<346>().as_bytes(); }
+  bool has_fastrpc_dma_stat() const { return at<347>().valid(); }
+  ::protozero::ConstBytes fastrpc_dma_stat() const { return at<347>().as_bytes(); }
+  bool has_dpu_tracing_mark_write() const { return at<348>().valid(); }
+  ::protozero::ConstBytes dpu_tracing_mark_write() const { return at<348>().as_bytes(); }
+  bool has_g2d_tracing_mark_write() const { return at<349>().valid(); }
+  ::protozero::ConstBytes g2d_tracing_mark_write() const { return at<349>().as_bytes(); }
+  bool has_mali_tracing_mark_write() const { return at<350>().valid(); }
+  ::protozero::ConstBytes mali_tracing_mark_write() const { return at<350>().as_bytes(); }
+  bool has_dma_heap_stat() const { return at<351>().valid(); }
+  ::protozero::ConstBytes dma_heap_stat() const { return at<351>().as_bytes(); }
+  bool has_cpuhp_pause() const { return at<352>().valid(); }
+  ::protozero::ConstBytes cpuhp_pause() const { return at<352>().as_bytes(); }
+  bool has_sched_pi_setprio() const { return at<353>().valid(); }
+  ::protozero::ConstBytes sched_pi_setprio() const { return at<353>().as_bytes(); }
+  bool has_sde_sde_evtlog() const { return at<354>().valid(); }
+  ::protozero::ConstBytes sde_sde_evtlog() const { return at<354>().as_bytes(); }
+  bool has_sde_sde_perf_calc_crtc() const { return at<355>().valid(); }
+  ::protozero::ConstBytes sde_sde_perf_calc_crtc() const { return at<355>().as_bytes(); }
+  bool has_sde_sde_perf_crtc_update() const { return at<356>().valid(); }
+  ::protozero::ConstBytes sde_sde_perf_crtc_update() const { return at<356>().as_bytes(); }
+  bool has_sde_sde_perf_set_qos_luts() const { return at<357>().valid(); }
+  ::protozero::ConstBytes sde_sde_perf_set_qos_luts() const { return at<357>().as_bytes(); }
+  bool has_sde_sde_perf_update_bus() const { return at<358>().valid(); }
+  ::protozero::ConstBytes sde_sde_perf_update_bus() const { return at<358>().as_bytes(); }
+};
+
+class FtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = FtraceEvent_Decoder;
+  enum : int32_t {
+    kTimestampFieldNumber = 1,
+    kPidFieldNumber = 2,
+    kPrintFieldNumber = 3,
+    kSchedSwitchFieldNumber = 4,
+    kCpuFrequencyFieldNumber = 11,
+    kCpuFrequencyLimitsFieldNumber = 12,
+    kCpuIdleFieldNumber = 13,
+    kClockEnableFieldNumber = 14,
+    kClockDisableFieldNumber = 15,
+    kClockSetRateFieldNumber = 16,
+    kSchedWakeupFieldNumber = 17,
+    kSchedBlockedReasonFieldNumber = 18,
+    kSchedCpuHotplugFieldNumber = 19,
+    kSchedWakingFieldNumber = 20,
+    kIpiEntryFieldNumber = 21,
+    kIpiExitFieldNumber = 22,
+    kIpiRaiseFieldNumber = 23,
+    kSoftirqEntryFieldNumber = 24,
+    kSoftirqExitFieldNumber = 25,
+    kSoftirqRaiseFieldNumber = 26,
+    kI2cReadFieldNumber = 27,
+    kI2cWriteFieldNumber = 28,
+    kI2cResultFieldNumber = 29,
+    kI2cReplyFieldNumber = 30,
+    kSmbusReadFieldNumber = 31,
+    kSmbusWriteFieldNumber = 32,
+    kSmbusResultFieldNumber = 33,
+    kSmbusReplyFieldNumber = 34,
+    kLowmemoryKillFieldNumber = 35,
+    kIrqHandlerEntryFieldNumber = 36,
+    kIrqHandlerExitFieldNumber = 37,
+    kSyncPtFieldNumber = 38,
+    kSyncTimelineFieldNumber = 39,
+    kSyncWaitFieldNumber = 40,
+    kExt4DaWriteBeginFieldNumber = 41,
+    kExt4DaWriteEndFieldNumber = 42,
+    kExt4SyncFileEnterFieldNumber = 43,
+    kExt4SyncFileExitFieldNumber = 44,
+    kBlockRqIssueFieldNumber = 45,
+    kMmVmscanDirectReclaimBeginFieldNumber = 46,
+    kMmVmscanDirectReclaimEndFieldNumber = 47,
+    kMmVmscanKswapdWakeFieldNumber = 48,
+    kMmVmscanKswapdSleepFieldNumber = 49,
+    kBinderTransactionFieldNumber = 50,
+    kBinderTransactionReceivedFieldNumber = 51,
+    kBinderSetPriorityFieldNumber = 52,
+    kBinderLockFieldNumber = 53,
+    kBinderLockedFieldNumber = 54,
+    kBinderUnlockFieldNumber = 55,
+    kWorkqueueActivateWorkFieldNumber = 56,
+    kWorkqueueExecuteEndFieldNumber = 57,
+    kWorkqueueExecuteStartFieldNumber = 58,
+    kWorkqueueQueueWorkFieldNumber = 59,
+    kRegulatorDisableFieldNumber = 60,
+    kRegulatorDisableCompleteFieldNumber = 61,
+    kRegulatorEnableFieldNumber = 62,
+    kRegulatorEnableCompleteFieldNumber = 63,
+    kRegulatorEnableDelayFieldNumber = 64,
+    kRegulatorSetVoltageFieldNumber = 65,
+    kRegulatorSetVoltageCompleteFieldNumber = 66,
+    kCgroupAttachTaskFieldNumber = 67,
+    kCgroupMkdirFieldNumber = 68,
+    kCgroupRemountFieldNumber = 69,
+    kCgroupRmdirFieldNumber = 70,
+    kCgroupTransferTasksFieldNumber = 71,
+    kCgroupDestroyRootFieldNumber = 72,
+    kCgroupReleaseFieldNumber = 73,
+    kCgroupRenameFieldNumber = 74,
+    kCgroupSetupRootFieldNumber = 75,
+    kMdpCmdKickoffFieldNumber = 76,
+    kMdpCommitFieldNumber = 77,
+    kMdpPerfSetOtFieldNumber = 78,
+    kMdpSsppChangeFieldNumber = 79,
+    kTracingMarkWriteFieldNumber = 80,
+    kMdpCmdPingpongDoneFieldNumber = 81,
+    kMdpCompareBwFieldNumber = 82,
+    kMdpPerfSetPanicLutsFieldNumber = 83,
+    kMdpSsppSetFieldNumber = 84,
+    kMdpCmdReadptrDoneFieldNumber = 85,
+    kMdpMisrCrcFieldNumber = 86,
+    kMdpPerfSetQosLutsFieldNumber = 87,
+    kMdpTraceCounterFieldNumber = 88,
+    kMdpCmdReleaseBwFieldNumber = 89,
+    kMdpMixerUpdateFieldNumber = 90,
+    kMdpPerfSetWmLevelsFieldNumber = 91,
+    kMdpVideoUnderrunDoneFieldNumber = 92,
+    kMdpCmdWaitPingpongFieldNumber = 93,
+    kMdpPerfPrefillCalcFieldNumber = 94,
+    kMdpPerfUpdateBusFieldNumber = 95,
+    kRotatorBwAoAsContextFieldNumber = 96,
+    kMmFilemapAddToPageCacheFieldNumber = 97,
+    kMmFilemapDeleteFromPageCacheFieldNumber = 98,
+    kMmCompactionBeginFieldNumber = 99,
+    kMmCompactionDeferCompactionFieldNumber = 100,
+    kMmCompactionDeferredFieldNumber = 101,
+    kMmCompactionDeferResetFieldNumber = 102,
+    kMmCompactionEndFieldNumber = 103,
+    kMmCompactionFinishedFieldNumber = 104,
+    kMmCompactionIsolateFreepagesFieldNumber = 105,
+    kMmCompactionIsolateMigratepagesFieldNumber = 106,
+    kMmCompactionKcompactdSleepFieldNumber = 107,
+    kMmCompactionKcompactdWakeFieldNumber = 108,
+    kMmCompactionMigratepagesFieldNumber = 109,
+    kMmCompactionSuitableFieldNumber = 110,
+    kMmCompactionTryToCompactPagesFieldNumber = 111,
+    kMmCompactionWakeupKcompactdFieldNumber = 112,
+    kSuspendResumeFieldNumber = 113,
+    kSchedWakeupNewFieldNumber = 114,
+    kBlockBioBackmergeFieldNumber = 115,
+    kBlockBioBounceFieldNumber = 116,
+    kBlockBioCompleteFieldNumber = 117,
+    kBlockBioFrontmergeFieldNumber = 118,
+    kBlockBioQueueFieldNumber = 119,
+    kBlockBioRemapFieldNumber = 120,
+    kBlockDirtyBufferFieldNumber = 121,
+    kBlockGetrqFieldNumber = 122,
+    kBlockPlugFieldNumber = 123,
+    kBlockRqAbortFieldNumber = 124,
+    kBlockRqCompleteFieldNumber = 125,
+    kBlockRqInsertFieldNumber = 126,
+    kBlockRqRemapFieldNumber = 128,
+    kBlockRqRequeueFieldNumber = 129,
+    kBlockSleeprqFieldNumber = 130,
+    kBlockSplitFieldNumber = 131,
+    kBlockTouchBufferFieldNumber = 132,
+    kBlockUnplugFieldNumber = 133,
+    kExt4AllocDaBlocksFieldNumber = 134,
+    kExt4AllocateBlocksFieldNumber = 135,
+    kExt4AllocateInodeFieldNumber = 136,
+    kExt4BeginOrderedTruncateFieldNumber = 137,
+    kExt4CollapseRangeFieldNumber = 138,
+    kExt4DaReleaseSpaceFieldNumber = 139,
+    kExt4DaReserveSpaceFieldNumber = 140,
+    kExt4DaUpdateReserveSpaceFieldNumber = 141,
+    kExt4DaWritePagesFieldNumber = 142,
+    kExt4DaWritePagesExtentFieldNumber = 143,
+    kExt4DirectIOEnterFieldNumber = 144,
+    kExt4DirectIOExitFieldNumber = 145,
+    kExt4DiscardBlocksFieldNumber = 146,
+    kExt4DiscardPreallocationsFieldNumber = 147,
+    kExt4DropInodeFieldNumber = 148,
+    kExt4EsCacheExtentFieldNumber = 149,
+    kExt4EsFindDelayedExtentRangeEnterFieldNumber = 150,
+    kExt4EsFindDelayedExtentRangeExitFieldNumber = 151,
+    kExt4EsInsertExtentFieldNumber = 152,
+    kExt4EsLookupExtentEnterFieldNumber = 153,
+    kExt4EsLookupExtentExitFieldNumber = 154,
+    kExt4EsRemoveExtentFieldNumber = 155,
+    kExt4EsShrinkFieldNumber = 156,
+    kExt4EsShrinkCountFieldNumber = 157,
+    kExt4EsShrinkScanEnterFieldNumber = 158,
+    kExt4EsShrinkScanExitFieldNumber = 159,
+    kExt4EvictInodeFieldNumber = 160,
+    kExt4ExtConvertToInitializedEnterFieldNumber = 161,
+    kExt4ExtConvertToInitializedFastpathFieldNumber = 162,
+    kExt4ExtHandleUnwrittenExtentsFieldNumber = 163,
+    kExt4ExtInCacheFieldNumber = 164,
+    kExt4ExtLoadExtentFieldNumber = 165,
+    kExt4ExtMapBlocksEnterFieldNumber = 166,
+    kExt4ExtMapBlocksExitFieldNumber = 167,
+    kExt4ExtPutInCacheFieldNumber = 168,
+    kExt4ExtRemoveSpaceFieldNumber = 169,
+    kExt4ExtRemoveSpaceDoneFieldNumber = 170,
+    kExt4ExtRmIdxFieldNumber = 171,
+    kExt4ExtRmLeafFieldNumber = 172,
+    kExt4ExtShowExtentFieldNumber = 173,
+    kExt4FallocateEnterFieldNumber = 174,
+    kExt4FallocateExitFieldNumber = 175,
+    kExt4FindDelallocRangeFieldNumber = 176,
+    kExt4ForgetFieldNumber = 177,
+    kExt4FreeBlocksFieldNumber = 178,
+    kExt4FreeInodeFieldNumber = 179,
+    kExt4GetImpliedClusterAllocExitFieldNumber = 180,
+    kExt4GetReservedClusterAllocFieldNumber = 181,
+    kExt4IndMapBlocksEnterFieldNumber = 182,
+    kExt4IndMapBlocksExitFieldNumber = 183,
+    kExt4InsertRangeFieldNumber = 184,
+    kExt4InvalidatepageFieldNumber = 185,
+    kExt4JournalStartFieldNumber = 186,
+    kExt4JournalStartReservedFieldNumber = 187,
+    kExt4JournalledInvalidatepageFieldNumber = 188,
+    kExt4JournalledWriteEndFieldNumber = 189,
+    kExt4LoadInodeFieldNumber = 190,
+    kExt4LoadInodeBitmapFieldNumber = 191,
+    kExt4MarkInodeDirtyFieldNumber = 192,
+    kExt4MbBitmapLoadFieldNumber = 193,
+    kExt4MbBuddyBitmapLoadFieldNumber = 194,
+    kExt4MbDiscardPreallocationsFieldNumber = 195,
+    kExt4MbNewGroupPaFieldNumber = 196,
+    kExt4MbNewInodePaFieldNumber = 197,
+    kExt4MbReleaseGroupPaFieldNumber = 198,
+    kExt4MbReleaseInodePaFieldNumber = 199,
+    kExt4MballocAllocFieldNumber = 200,
+    kExt4MballocDiscardFieldNumber = 201,
+    kExt4MballocFreeFieldNumber = 202,
+    kExt4MballocPreallocFieldNumber = 203,
+    kExt4OtherInodeUpdateTimeFieldNumber = 204,
+    kExt4PunchHoleFieldNumber = 205,
+    kExt4ReadBlockBitmapLoadFieldNumber = 206,
+    kExt4ReadpageFieldNumber = 207,
+    kExt4ReleasepageFieldNumber = 208,
+    kExt4RemoveBlocksFieldNumber = 209,
+    kExt4RequestBlocksFieldNumber = 210,
+    kExt4RequestInodeFieldNumber = 211,
+    kExt4SyncFsFieldNumber = 212,
+    kExt4TrimAllFreeFieldNumber = 213,
+    kExt4TrimExtentFieldNumber = 214,
+    kExt4TruncateEnterFieldNumber = 215,
+    kExt4TruncateExitFieldNumber = 216,
+    kExt4UnlinkEnterFieldNumber = 217,
+    kExt4UnlinkExitFieldNumber = 218,
+    kExt4WriteBeginFieldNumber = 219,
+    kExt4WriteEndFieldNumber = 230,
+    kExt4WritepageFieldNumber = 231,
+    kExt4WritepagesFieldNumber = 232,
+    kExt4WritepagesResultFieldNumber = 233,
+    kExt4ZeroRangeFieldNumber = 234,
+    kTaskNewtaskFieldNumber = 235,
+    kTaskRenameFieldNumber = 236,
+    kSchedProcessExecFieldNumber = 237,
+    kSchedProcessExitFieldNumber = 238,
+    kSchedProcessForkFieldNumber = 239,
+    kSchedProcessFreeFieldNumber = 240,
+    kSchedProcessHangFieldNumber = 241,
+    kSchedProcessWaitFieldNumber = 242,
+    kF2fsDoSubmitBioFieldNumber = 243,
+    kF2fsEvictInodeFieldNumber = 244,
+    kF2fsFallocateFieldNumber = 245,
+    kF2fsGetDataBlockFieldNumber = 246,
+    kF2fsGetVictimFieldNumber = 247,
+    kF2fsIgetFieldNumber = 248,
+    kF2fsIgetExitFieldNumber = 249,
+    kF2fsNewInodeFieldNumber = 250,
+    kF2fsReadpageFieldNumber = 251,
+    kF2fsReserveNewBlockFieldNumber = 252,
+    kF2fsSetPageDirtyFieldNumber = 253,
+    kF2fsSubmitWritePageFieldNumber = 254,
+    kF2fsSyncFileEnterFieldNumber = 255,
+    kF2fsSyncFileExitFieldNumber = 256,
+    kF2fsSyncFsFieldNumber = 257,
+    kF2fsTruncateFieldNumber = 258,
+    kF2fsTruncateBlocksEnterFieldNumber = 259,
+    kF2fsTruncateBlocksExitFieldNumber = 260,
+    kF2fsTruncateDataBlocksRangeFieldNumber = 261,
+    kF2fsTruncateInodeBlocksEnterFieldNumber = 262,
+    kF2fsTruncateInodeBlocksExitFieldNumber = 263,
+    kF2fsTruncateNodeFieldNumber = 264,
+    kF2fsTruncateNodesEnterFieldNumber = 265,
+    kF2fsTruncateNodesExitFieldNumber = 266,
+    kF2fsTruncatePartialNodesFieldNumber = 267,
+    kF2fsUnlinkEnterFieldNumber = 268,
+    kF2fsUnlinkExitFieldNumber = 269,
+    kF2fsVmPageMkwriteFieldNumber = 270,
+    kF2fsWriteBeginFieldNumber = 271,
+    kF2fsWriteCheckpointFieldNumber = 272,
+    kF2fsWriteEndFieldNumber = 273,
+    kAllocPagesIommuEndFieldNumber = 274,
+    kAllocPagesIommuFailFieldNumber = 275,
+    kAllocPagesIommuStartFieldNumber = 276,
+    kAllocPagesSysEndFieldNumber = 277,
+    kAllocPagesSysFailFieldNumber = 278,
+    kAllocPagesSysStartFieldNumber = 279,
+    kDmaAllocContiguousRetryFieldNumber = 280,
+    kIommuMapRangeFieldNumber = 281,
+    kIommuSecPtblMapRangeEndFieldNumber = 282,
+    kIommuSecPtblMapRangeStartFieldNumber = 283,
+    kIonAllocBufferEndFieldNumber = 284,
+    kIonAllocBufferFailFieldNumber = 285,
+    kIonAllocBufferFallbackFieldNumber = 286,
+    kIonAllocBufferStartFieldNumber = 287,
+    kIonCpAllocRetryFieldNumber = 288,
+    kIonCpSecureBufferEndFieldNumber = 289,
+    kIonCpSecureBufferStartFieldNumber = 290,
+    kIonPrefetchingFieldNumber = 291,
+    kIonSecureCmaAddToPoolEndFieldNumber = 292,
+    kIonSecureCmaAddToPoolStartFieldNumber = 293,
+    kIonSecureCmaAllocateEndFieldNumber = 294,
+    kIonSecureCmaAllocateStartFieldNumber = 295,
+    kIonSecureCmaShrinkPoolEndFieldNumber = 296,
+    kIonSecureCmaShrinkPoolStartFieldNumber = 297,
+    kKfreeFieldNumber = 298,
+    kKmallocFieldNumber = 299,
+    kKmallocNodeFieldNumber = 300,
+    kKmemCacheAllocFieldNumber = 301,
+    kKmemCacheAllocNodeFieldNumber = 302,
+    kKmemCacheFreeFieldNumber = 303,
+    kMigratePagesEndFieldNumber = 304,
+    kMigratePagesStartFieldNumber = 305,
+    kMigrateRetryFieldNumber = 306,
+    kMmPageAllocFieldNumber = 307,
+    kMmPageAllocExtfragFieldNumber = 308,
+    kMmPageAllocZoneLockedFieldNumber = 309,
+    kMmPageFreeFieldNumber = 310,
+    kMmPageFreeBatchedFieldNumber = 311,
+    kMmPagePcpuDrainFieldNumber = 312,
+    kRssStatFieldNumber = 313,
+    kIonHeapShrinkFieldNumber = 314,
+    kIonHeapGrowFieldNumber = 315,
+    kFenceInitFieldNumber = 316,
+    kFenceDestroyFieldNumber = 317,
+    kFenceEnableSignalFieldNumber = 318,
+    kFenceSignaledFieldNumber = 319,
+    kClkEnableFieldNumber = 320,
+    kClkDisableFieldNumber = 321,
+    kClkSetRateFieldNumber = 322,
+    kBinderTransactionAllocBufFieldNumber = 323,
+    kSignalDeliverFieldNumber = 324,
+    kSignalGenerateFieldNumber = 325,
+    kOomScoreAdjUpdateFieldNumber = 326,
+    kGenericFieldNumber = 327,
+    kMmEventRecordFieldNumber = 328,
+    kSysEnterFieldNumber = 329,
+    kSysExitFieldNumber = 330,
+    kZeroFieldNumber = 331,
+    kGpuFrequencyFieldNumber = 332,
+    kSdeTracingMarkWriteFieldNumber = 333,
+    kMarkVictimFieldNumber = 334,
+    kIonStatFieldNumber = 335,
+    kIonBufferCreateFieldNumber = 336,
+    kIonBufferDestroyFieldNumber = 337,
+    kScmCallStartFieldNumber = 338,
+    kScmCallEndFieldNumber = 339,
+    kGpuMemTotalFieldNumber = 340,
+    kThermalTemperatureFieldNumber = 341,
+    kCdevUpdateFieldNumber = 342,
+    kCpuhpExitFieldNumber = 343,
+    kCpuhpMultiEnterFieldNumber = 344,
+    kCpuhpEnterFieldNumber = 345,
+    kCpuhpLatencyFieldNumber = 346,
+    kFastrpcDmaStatFieldNumber = 347,
+    kDpuTracingMarkWriteFieldNumber = 348,
+    kG2dTracingMarkWriteFieldNumber = 349,
+    kMaliTracingMarkWriteFieldNumber = 350,
+    kDmaHeapStatFieldNumber = 351,
+    kCpuhpPauseFieldNumber = 352,
+    kSchedPiSetprioFieldNumber = 353,
+    kSdeSdeEvtlogFieldNumber = 354,
+    kSdeSdePerfCalcCrtcFieldNumber = 355,
+    kSdeSdePerfCrtcUpdateFieldNumber = 356,
+    kSdeSdePerfSetQosLutsFieldNumber = 357,
+    kSdeSdePerfUpdateBusFieldNumber = 358,
+  };
+
+  using FieldMetadata_Timestamp =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Timestamp kTimestamp() { return {}; }
+  void set_timestamp(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Timestamp::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Print =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      PrintFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Print kPrint() { return {}; }
+  template <typename T = PrintFtraceEvent> T* set_print() {
+    return BeginNestedMessage<T>(3);
+  }
+
+
+  using FieldMetadata_SchedSwitch =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SchedSwitchFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SchedSwitch kSchedSwitch() { return {}; }
+  template <typename T = SchedSwitchFtraceEvent> T* set_sched_switch() {
+    return BeginNestedMessage<T>(4);
+  }
+
+
+  using FieldMetadata_CpuFrequency =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      CpuFrequencyFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CpuFrequency kCpuFrequency() { return {}; }
+  template <typename T = CpuFrequencyFtraceEvent> T* set_cpu_frequency() {
+    return BeginNestedMessage<T>(11);
+  }
+
+
+  using FieldMetadata_CpuFrequencyLimits =
+    ::protozero::proto_utils::FieldMetadata<
+      12,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      CpuFrequencyLimitsFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CpuFrequencyLimits kCpuFrequencyLimits() { return {}; }
+  template <typename T = CpuFrequencyLimitsFtraceEvent> T* set_cpu_frequency_limits() {
+    return BeginNestedMessage<T>(12);
+  }
+
+
+  using FieldMetadata_CpuIdle =
+    ::protozero::proto_utils::FieldMetadata<
+      13,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      CpuIdleFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CpuIdle kCpuIdle() { return {}; }
+  template <typename T = CpuIdleFtraceEvent> T* set_cpu_idle() {
+    return BeginNestedMessage<T>(13);
+  }
+
+
+  using FieldMetadata_ClockEnable =
+    ::protozero::proto_utils::FieldMetadata<
+      14,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ClockEnableFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ClockEnable kClockEnable() { return {}; }
+  template <typename T = ClockEnableFtraceEvent> T* set_clock_enable() {
+    return BeginNestedMessage<T>(14);
+  }
+
+
+  using FieldMetadata_ClockDisable =
+    ::protozero::proto_utils::FieldMetadata<
+      15,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ClockDisableFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ClockDisable kClockDisable() { return {}; }
+  template <typename T = ClockDisableFtraceEvent> T* set_clock_disable() {
+    return BeginNestedMessage<T>(15);
+  }
+
+
+  using FieldMetadata_ClockSetRate =
+    ::protozero::proto_utils::FieldMetadata<
+      16,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ClockSetRateFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ClockSetRate kClockSetRate() { return {}; }
+  template <typename T = ClockSetRateFtraceEvent> T* set_clock_set_rate() {
+    return BeginNestedMessage<T>(16);
+  }
+
+
+  using FieldMetadata_SchedWakeup =
+    ::protozero::proto_utils::FieldMetadata<
+      17,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SchedWakeupFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SchedWakeup kSchedWakeup() { return {}; }
+  template <typename T = SchedWakeupFtraceEvent> T* set_sched_wakeup() {
+    return BeginNestedMessage<T>(17);
+  }
+
+
+  using FieldMetadata_SchedBlockedReason =
+    ::protozero::proto_utils::FieldMetadata<
+      18,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SchedBlockedReasonFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SchedBlockedReason kSchedBlockedReason() { return {}; }
+  template <typename T = SchedBlockedReasonFtraceEvent> T* set_sched_blocked_reason() {
+    return BeginNestedMessage<T>(18);
+  }
+
+
+  using FieldMetadata_SchedCpuHotplug =
+    ::protozero::proto_utils::FieldMetadata<
+      19,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SchedCpuHotplugFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SchedCpuHotplug kSchedCpuHotplug() { return {}; }
+  template <typename T = SchedCpuHotplugFtraceEvent> T* set_sched_cpu_hotplug() {
+    return BeginNestedMessage<T>(19);
+  }
+
+
+  using FieldMetadata_SchedWaking =
+    ::protozero::proto_utils::FieldMetadata<
+      20,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SchedWakingFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SchedWaking kSchedWaking() { return {}; }
+  template <typename T = SchedWakingFtraceEvent> T* set_sched_waking() {
+    return BeginNestedMessage<T>(20);
+  }
+
+
+  using FieldMetadata_IpiEntry =
+    ::protozero::proto_utils::FieldMetadata<
+      21,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      IpiEntryFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IpiEntry kIpiEntry() { return {}; }
+  template <typename T = IpiEntryFtraceEvent> T* set_ipi_entry() {
+    return BeginNestedMessage<T>(21);
+  }
+
+
+  using FieldMetadata_IpiExit =
+    ::protozero::proto_utils::FieldMetadata<
+      22,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      IpiExitFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IpiExit kIpiExit() { return {}; }
+  template <typename T = IpiExitFtraceEvent> T* set_ipi_exit() {
+    return BeginNestedMessage<T>(22);
+  }
+
+
+  using FieldMetadata_IpiRaise =
+    ::protozero::proto_utils::FieldMetadata<
+      23,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      IpiRaiseFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IpiRaise kIpiRaise() { return {}; }
+  template <typename T = IpiRaiseFtraceEvent> T* set_ipi_raise() {
+    return BeginNestedMessage<T>(23);
+  }
+
+
+  using FieldMetadata_SoftirqEntry =
+    ::protozero::proto_utils::FieldMetadata<
+      24,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SoftirqEntryFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SoftirqEntry kSoftirqEntry() { return {}; }
+  template <typename T = SoftirqEntryFtraceEvent> T* set_softirq_entry() {
+    return BeginNestedMessage<T>(24);
+  }
+
+
+  using FieldMetadata_SoftirqExit =
+    ::protozero::proto_utils::FieldMetadata<
+      25,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SoftirqExitFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SoftirqExit kSoftirqExit() { return {}; }
+  template <typename T = SoftirqExitFtraceEvent> T* set_softirq_exit() {
+    return BeginNestedMessage<T>(25);
+  }
+
+
+  using FieldMetadata_SoftirqRaise =
+    ::protozero::proto_utils::FieldMetadata<
+      26,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SoftirqRaiseFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SoftirqRaise kSoftirqRaise() { return {}; }
+  template <typename T = SoftirqRaiseFtraceEvent> T* set_softirq_raise() {
+    return BeginNestedMessage<T>(26);
+  }
+
+
+  using FieldMetadata_I2cRead =
+    ::protozero::proto_utils::FieldMetadata<
+      27,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      I2cReadFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_I2cRead kI2cRead() { return {}; }
+  template <typename T = I2cReadFtraceEvent> T* set_i2c_read() {
+    return BeginNestedMessage<T>(27);
+  }
+
+
+  using FieldMetadata_I2cWrite =
+    ::protozero::proto_utils::FieldMetadata<
+      28,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      I2cWriteFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_I2cWrite kI2cWrite() { return {}; }
+  template <typename T = I2cWriteFtraceEvent> T* set_i2c_write() {
+    return BeginNestedMessage<T>(28);
+  }
+
+
+  using FieldMetadata_I2cResult =
+    ::protozero::proto_utils::FieldMetadata<
+      29,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      I2cResultFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_I2cResult kI2cResult() { return {}; }
+  template <typename T = I2cResultFtraceEvent> T* set_i2c_result() {
+    return BeginNestedMessage<T>(29);
+  }
+
+
+  using FieldMetadata_I2cReply =
+    ::protozero::proto_utils::FieldMetadata<
+      30,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      I2cReplyFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_I2cReply kI2cReply() { return {}; }
+  template <typename T = I2cReplyFtraceEvent> T* set_i2c_reply() {
+    return BeginNestedMessage<T>(30);
+  }
+
+
+  using FieldMetadata_SmbusRead =
+    ::protozero::proto_utils::FieldMetadata<
+      31,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SmbusReadFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SmbusRead kSmbusRead() { return {}; }
+  template <typename T = SmbusReadFtraceEvent> T* set_smbus_read() {
+    return BeginNestedMessage<T>(31);
+  }
+
+
+  using FieldMetadata_SmbusWrite =
+    ::protozero::proto_utils::FieldMetadata<
+      32,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SmbusWriteFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SmbusWrite kSmbusWrite() { return {}; }
+  template <typename T = SmbusWriteFtraceEvent> T* set_smbus_write() {
+    return BeginNestedMessage<T>(32);
+  }
+
+
+  using FieldMetadata_SmbusResult =
+    ::protozero::proto_utils::FieldMetadata<
+      33,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SmbusResultFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SmbusResult kSmbusResult() { return {}; }
+  template <typename T = SmbusResultFtraceEvent> T* set_smbus_result() {
+    return BeginNestedMessage<T>(33);
+  }
+
+
+  using FieldMetadata_SmbusReply =
+    ::protozero::proto_utils::FieldMetadata<
+      34,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SmbusReplyFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SmbusReply kSmbusReply() { return {}; }
+  template <typename T = SmbusReplyFtraceEvent> T* set_smbus_reply() {
+    return BeginNestedMessage<T>(34);
+  }
+
+
+  using FieldMetadata_LowmemoryKill =
+    ::protozero::proto_utils::FieldMetadata<
+      35,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      LowmemoryKillFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LowmemoryKill kLowmemoryKill() { return {}; }
+  template <typename T = LowmemoryKillFtraceEvent> T* set_lowmemory_kill() {
+    return BeginNestedMessage<T>(35);
+  }
+
+
+  using FieldMetadata_IrqHandlerEntry =
+    ::protozero::proto_utils::FieldMetadata<
+      36,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      IrqHandlerEntryFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IrqHandlerEntry kIrqHandlerEntry() { return {}; }
+  template <typename T = IrqHandlerEntryFtraceEvent> T* set_irq_handler_entry() {
+    return BeginNestedMessage<T>(36);
+  }
+
+
+  using FieldMetadata_IrqHandlerExit =
+    ::protozero::proto_utils::FieldMetadata<
+      37,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      IrqHandlerExitFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IrqHandlerExit kIrqHandlerExit() { return {}; }
+  template <typename T = IrqHandlerExitFtraceEvent> T* set_irq_handler_exit() {
+    return BeginNestedMessage<T>(37);
+  }
+
+
+  using FieldMetadata_SyncPt =
+    ::protozero::proto_utils::FieldMetadata<
+      38,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SyncPtFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SyncPt kSyncPt() { return {}; }
+  template <typename T = SyncPtFtraceEvent> T* set_sync_pt() {
+    return BeginNestedMessage<T>(38);
+  }
+
+
+  using FieldMetadata_SyncTimeline =
+    ::protozero::proto_utils::FieldMetadata<
+      39,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SyncTimelineFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SyncTimeline kSyncTimeline() { return {}; }
+  template <typename T = SyncTimelineFtraceEvent> T* set_sync_timeline() {
+    return BeginNestedMessage<T>(39);
+  }
+
+
+  using FieldMetadata_SyncWait =
+    ::protozero::proto_utils::FieldMetadata<
+      40,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SyncWaitFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SyncWait kSyncWait() { return {}; }
+  template <typename T = SyncWaitFtraceEvent> T* set_sync_wait() {
+    return BeginNestedMessage<T>(40);
+  }
+
+
+  using FieldMetadata_Ext4DaWriteBegin =
+    ::protozero::proto_utils::FieldMetadata<
+      41,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4DaWriteBeginFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4DaWriteBegin kExt4DaWriteBegin() { return {}; }
+  template <typename T = Ext4DaWriteBeginFtraceEvent> T* set_ext4_da_write_begin() {
+    return BeginNestedMessage<T>(41);
+  }
+
+
+  using FieldMetadata_Ext4DaWriteEnd =
+    ::protozero::proto_utils::FieldMetadata<
+      42,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4DaWriteEndFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4DaWriteEnd kExt4DaWriteEnd() { return {}; }
+  template <typename T = Ext4DaWriteEndFtraceEvent> T* set_ext4_da_write_end() {
+    return BeginNestedMessage<T>(42);
+  }
+
+
+  using FieldMetadata_Ext4SyncFileEnter =
+    ::protozero::proto_utils::FieldMetadata<
+      43,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4SyncFileEnterFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4SyncFileEnter kExt4SyncFileEnter() { return {}; }
+  template <typename T = Ext4SyncFileEnterFtraceEvent> T* set_ext4_sync_file_enter() {
+    return BeginNestedMessage<T>(43);
+  }
+
+
+  using FieldMetadata_Ext4SyncFileExit =
+    ::protozero::proto_utils::FieldMetadata<
+      44,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4SyncFileExitFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4SyncFileExit kExt4SyncFileExit() { return {}; }
+  template <typename T = Ext4SyncFileExitFtraceEvent> T* set_ext4_sync_file_exit() {
+    return BeginNestedMessage<T>(44);
+  }
+
+
+  using FieldMetadata_BlockRqIssue =
+    ::protozero::proto_utils::FieldMetadata<
+      45,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BlockRqIssueFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BlockRqIssue kBlockRqIssue() { return {}; }
+  template <typename T = BlockRqIssueFtraceEvent> T* set_block_rq_issue() {
+    return BeginNestedMessage<T>(45);
+  }
+
+
+  using FieldMetadata_MmVmscanDirectReclaimBegin =
+    ::protozero::proto_utils::FieldMetadata<
+      46,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MmVmscanDirectReclaimBeginFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MmVmscanDirectReclaimBegin kMmVmscanDirectReclaimBegin() { return {}; }
+  template <typename T = MmVmscanDirectReclaimBeginFtraceEvent> T* set_mm_vmscan_direct_reclaim_begin() {
+    return BeginNestedMessage<T>(46);
+  }
+
+
+  using FieldMetadata_MmVmscanDirectReclaimEnd =
+    ::protozero::proto_utils::FieldMetadata<
+      47,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MmVmscanDirectReclaimEndFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MmVmscanDirectReclaimEnd kMmVmscanDirectReclaimEnd() { return {}; }
+  template <typename T = MmVmscanDirectReclaimEndFtraceEvent> T* set_mm_vmscan_direct_reclaim_end() {
+    return BeginNestedMessage<T>(47);
+  }
+
+
+  using FieldMetadata_MmVmscanKswapdWake =
+    ::protozero::proto_utils::FieldMetadata<
+      48,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MmVmscanKswapdWakeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MmVmscanKswapdWake kMmVmscanKswapdWake() { return {}; }
+  template <typename T = MmVmscanKswapdWakeFtraceEvent> T* set_mm_vmscan_kswapd_wake() {
+    return BeginNestedMessage<T>(48);
+  }
+
+
+  using FieldMetadata_MmVmscanKswapdSleep =
+    ::protozero::proto_utils::FieldMetadata<
+      49,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MmVmscanKswapdSleepFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MmVmscanKswapdSleep kMmVmscanKswapdSleep() { return {}; }
+  template <typename T = MmVmscanKswapdSleepFtraceEvent> T* set_mm_vmscan_kswapd_sleep() {
+    return BeginNestedMessage<T>(49);
+  }
+
+
+  using FieldMetadata_BinderTransaction =
+    ::protozero::proto_utils::FieldMetadata<
+      50,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BinderTransactionFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BinderTransaction kBinderTransaction() { return {}; }
+  template <typename T = BinderTransactionFtraceEvent> T* set_binder_transaction() {
+    return BeginNestedMessage<T>(50);
+  }
+
+
+  using FieldMetadata_BinderTransactionReceived =
+    ::protozero::proto_utils::FieldMetadata<
+      51,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BinderTransactionReceivedFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BinderTransactionReceived kBinderTransactionReceived() { return {}; }
+  template <typename T = BinderTransactionReceivedFtraceEvent> T* set_binder_transaction_received() {
+    return BeginNestedMessage<T>(51);
+  }
+
+
+  using FieldMetadata_BinderSetPriority =
+    ::protozero::proto_utils::FieldMetadata<
+      52,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BinderSetPriorityFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BinderSetPriority kBinderSetPriority() { return {}; }
+  template <typename T = BinderSetPriorityFtraceEvent> T* set_binder_set_priority() {
+    return BeginNestedMessage<T>(52);
+  }
+
+
+  using FieldMetadata_BinderLock =
+    ::protozero::proto_utils::FieldMetadata<
+      53,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BinderLockFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BinderLock kBinderLock() { return {}; }
+  template <typename T = BinderLockFtraceEvent> T* set_binder_lock() {
+    return BeginNestedMessage<T>(53);
+  }
+
+
+  using FieldMetadata_BinderLocked =
+    ::protozero::proto_utils::FieldMetadata<
+      54,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BinderLockedFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BinderLocked kBinderLocked() { return {}; }
+  template <typename T = BinderLockedFtraceEvent> T* set_binder_locked() {
+    return BeginNestedMessage<T>(54);
+  }
+
+
+  using FieldMetadata_BinderUnlock =
+    ::protozero::proto_utils::FieldMetadata<
+      55,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BinderUnlockFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BinderUnlock kBinderUnlock() { return {}; }
+  template <typename T = BinderUnlockFtraceEvent> T* set_binder_unlock() {
+    return BeginNestedMessage<T>(55);
+  }
+
+
+  using FieldMetadata_WorkqueueActivateWork =
+    ::protozero::proto_utils::FieldMetadata<
+      56,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      WorkqueueActivateWorkFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_WorkqueueActivateWork kWorkqueueActivateWork() { return {}; }
+  template <typename T = WorkqueueActivateWorkFtraceEvent> T* set_workqueue_activate_work() {
+    return BeginNestedMessage<T>(56);
+  }
+
+
+  using FieldMetadata_WorkqueueExecuteEnd =
+    ::protozero::proto_utils::FieldMetadata<
+      57,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      WorkqueueExecuteEndFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_WorkqueueExecuteEnd kWorkqueueExecuteEnd() { return {}; }
+  template <typename T = WorkqueueExecuteEndFtraceEvent> T* set_workqueue_execute_end() {
+    return BeginNestedMessage<T>(57);
+  }
+
+
+  using FieldMetadata_WorkqueueExecuteStart =
+    ::protozero::proto_utils::FieldMetadata<
+      58,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      WorkqueueExecuteStartFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_WorkqueueExecuteStart kWorkqueueExecuteStart() { return {}; }
+  template <typename T = WorkqueueExecuteStartFtraceEvent> T* set_workqueue_execute_start() {
+    return BeginNestedMessage<T>(58);
+  }
+
+
+  using FieldMetadata_WorkqueueQueueWork =
+    ::protozero::proto_utils::FieldMetadata<
+      59,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      WorkqueueQueueWorkFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_WorkqueueQueueWork kWorkqueueQueueWork() { return {}; }
+  template <typename T = WorkqueueQueueWorkFtraceEvent> T* set_workqueue_queue_work() {
+    return BeginNestedMessage<T>(59);
+  }
+
+
+  using FieldMetadata_RegulatorDisable =
+    ::protozero::proto_utils::FieldMetadata<
+      60,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      RegulatorDisableFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RegulatorDisable kRegulatorDisable() { return {}; }
+  template <typename T = RegulatorDisableFtraceEvent> T* set_regulator_disable() {
+    return BeginNestedMessage<T>(60);
+  }
+
+
+  using FieldMetadata_RegulatorDisableComplete =
+    ::protozero::proto_utils::FieldMetadata<
+      61,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      RegulatorDisableCompleteFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RegulatorDisableComplete kRegulatorDisableComplete() { return {}; }
+  template <typename T = RegulatorDisableCompleteFtraceEvent> T* set_regulator_disable_complete() {
+    return BeginNestedMessage<T>(61);
+  }
+
+
+  using FieldMetadata_RegulatorEnable =
+    ::protozero::proto_utils::FieldMetadata<
+      62,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      RegulatorEnableFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RegulatorEnable kRegulatorEnable() { return {}; }
+  template <typename T = RegulatorEnableFtraceEvent> T* set_regulator_enable() {
+    return BeginNestedMessage<T>(62);
+  }
+
+
+  using FieldMetadata_RegulatorEnableComplete =
+    ::protozero::proto_utils::FieldMetadata<
+      63,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      RegulatorEnableCompleteFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RegulatorEnableComplete kRegulatorEnableComplete() { return {}; }
+  template <typename T = RegulatorEnableCompleteFtraceEvent> T* set_regulator_enable_complete() {
+    return BeginNestedMessage<T>(63);
+  }
+
+
+  using FieldMetadata_RegulatorEnableDelay =
+    ::protozero::proto_utils::FieldMetadata<
+      64,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      RegulatorEnableDelayFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RegulatorEnableDelay kRegulatorEnableDelay() { return {}; }
+  template <typename T = RegulatorEnableDelayFtraceEvent> T* set_regulator_enable_delay() {
+    return BeginNestedMessage<T>(64);
+  }
+
+
+  using FieldMetadata_RegulatorSetVoltage =
+    ::protozero::proto_utils::FieldMetadata<
+      65,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      RegulatorSetVoltageFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RegulatorSetVoltage kRegulatorSetVoltage() { return {}; }
+  template <typename T = RegulatorSetVoltageFtraceEvent> T* set_regulator_set_voltage() {
+    return BeginNestedMessage<T>(65);
+  }
+
+
+  using FieldMetadata_RegulatorSetVoltageComplete =
+    ::protozero::proto_utils::FieldMetadata<
+      66,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      RegulatorSetVoltageCompleteFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RegulatorSetVoltageComplete kRegulatorSetVoltageComplete() { return {}; }
+  template <typename T = RegulatorSetVoltageCompleteFtraceEvent> T* set_regulator_set_voltage_complete() {
+    return BeginNestedMessage<T>(66);
+  }
+
+
+  using FieldMetadata_CgroupAttachTask =
+    ::protozero::proto_utils::FieldMetadata<
+      67,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      CgroupAttachTaskFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CgroupAttachTask kCgroupAttachTask() { return {}; }
+  template <typename T = CgroupAttachTaskFtraceEvent> T* set_cgroup_attach_task() {
+    return BeginNestedMessage<T>(67);
+  }
+
+
+  using FieldMetadata_CgroupMkdir =
+    ::protozero::proto_utils::FieldMetadata<
+      68,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      CgroupMkdirFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CgroupMkdir kCgroupMkdir() { return {}; }
+  template <typename T = CgroupMkdirFtraceEvent> T* set_cgroup_mkdir() {
+    return BeginNestedMessage<T>(68);
+  }
+
+
+  using FieldMetadata_CgroupRemount =
+    ::protozero::proto_utils::FieldMetadata<
+      69,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      CgroupRemountFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CgroupRemount kCgroupRemount() { return {}; }
+  template <typename T = CgroupRemountFtraceEvent> T* set_cgroup_remount() {
+    return BeginNestedMessage<T>(69);
+  }
+
+
+  using FieldMetadata_CgroupRmdir =
+    ::protozero::proto_utils::FieldMetadata<
+      70,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      CgroupRmdirFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CgroupRmdir kCgroupRmdir() { return {}; }
+  template <typename T = CgroupRmdirFtraceEvent> T* set_cgroup_rmdir() {
+    return BeginNestedMessage<T>(70);
+  }
+
+
+  using FieldMetadata_CgroupTransferTasks =
+    ::protozero::proto_utils::FieldMetadata<
+      71,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      CgroupTransferTasksFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CgroupTransferTasks kCgroupTransferTasks() { return {}; }
+  template <typename T = CgroupTransferTasksFtraceEvent> T* set_cgroup_transfer_tasks() {
+    return BeginNestedMessage<T>(71);
+  }
+
+
+  using FieldMetadata_CgroupDestroyRoot =
+    ::protozero::proto_utils::FieldMetadata<
+      72,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      CgroupDestroyRootFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CgroupDestroyRoot kCgroupDestroyRoot() { return {}; }
+  template <typename T = CgroupDestroyRootFtraceEvent> T* set_cgroup_destroy_root() {
+    return BeginNestedMessage<T>(72);
+  }
+
+
+  using FieldMetadata_CgroupRelease =
+    ::protozero::proto_utils::FieldMetadata<
+      73,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      CgroupReleaseFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CgroupRelease kCgroupRelease() { return {}; }
+  template <typename T = CgroupReleaseFtraceEvent> T* set_cgroup_release() {
+    return BeginNestedMessage<T>(73);
+  }
+
+
+  using FieldMetadata_CgroupRename =
+    ::protozero::proto_utils::FieldMetadata<
+      74,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      CgroupRenameFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CgroupRename kCgroupRename() { return {}; }
+  template <typename T = CgroupRenameFtraceEvent> T* set_cgroup_rename() {
+    return BeginNestedMessage<T>(74);
+  }
+
+
+  using FieldMetadata_CgroupSetupRoot =
+    ::protozero::proto_utils::FieldMetadata<
+      75,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      CgroupSetupRootFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CgroupSetupRoot kCgroupSetupRoot() { return {}; }
+  template <typename T = CgroupSetupRootFtraceEvent> T* set_cgroup_setup_root() {
+    return BeginNestedMessage<T>(75);
+  }
+
+
+  using FieldMetadata_MdpCmdKickoff =
+    ::protozero::proto_utils::FieldMetadata<
+      76,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MdpCmdKickoffFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MdpCmdKickoff kMdpCmdKickoff() { return {}; }
+  template <typename T = MdpCmdKickoffFtraceEvent> T* set_mdp_cmd_kickoff() {
+    return BeginNestedMessage<T>(76);
+  }
+
+
+  using FieldMetadata_MdpCommit =
+    ::protozero::proto_utils::FieldMetadata<
+      77,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MdpCommitFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MdpCommit kMdpCommit() { return {}; }
+  template <typename T = MdpCommitFtraceEvent> T* set_mdp_commit() {
+    return BeginNestedMessage<T>(77);
+  }
+
+
+  using FieldMetadata_MdpPerfSetOt =
+    ::protozero::proto_utils::FieldMetadata<
+      78,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MdpPerfSetOtFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MdpPerfSetOt kMdpPerfSetOt() { return {}; }
+  template <typename T = MdpPerfSetOtFtraceEvent> T* set_mdp_perf_set_ot() {
+    return BeginNestedMessage<T>(78);
+  }
+
+
+  using FieldMetadata_MdpSsppChange =
+    ::protozero::proto_utils::FieldMetadata<
+      79,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MdpSsppChangeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MdpSsppChange kMdpSsppChange() { return {}; }
+  template <typename T = MdpSsppChangeFtraceEvent> T* set_mdp_sspp_change() {
+    return BeginNestedMessage<T>(79);
+  }
+
+
+  using FieldMetadata_TracingMarkWrite =
+    ::protozero::proto_utils::FieldMetadata<
+      80,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TracingMarkWriteFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TracingMarkWrite kTracingMarkWrite() { return {}; }
+  template <typename T = TracingMarkWriteFtraceEvent> T* set_tracing_mark_write() {
+    return BeginNestedMessage<T>(80);
+  }
+
+
+  using FieldMetadata_MdpCmdPingpongDone =
+    ::protozero::proto_utils::FieldMetadata<
+      81,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MdpCmdPingpongDoneFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MdpCmdPingpongDone kMdpCmdPingpongDone() { return {}; }
+  template <typename T = MdpCmdPingpongDoneFtraceEvent> T* set_mdp_cmd_pingpong_done() {
+    return BeginNestedMessage<T>(81);
+  }
+
+
+  using FieldMetadata_MdpCompareBw =
+    ::protozero::proto_utils::FieldMetadata<
+      82,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MdpCompareBwFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MdpCompareBw kMdpCompareBw() { return {}; }
+  template <typename T = MdpCompareBwFtraceEvent> T* set_mdp_compare_bw() {
+    return BeginNestedMessage<T>(82);
+  }
+
+
+  using FieldMetadata_MdpPerfSetPanicLuts =
+    ::protozero::proto_utils::FieldMetadata<
+      83,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MdpPerfSetPanicLutsFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MdpPerfSetPanicLuts kMdpPerfSetPanicLuts() { return {}; }
+  template <typename T = MdpPerfSetPanicLutsFtraceEvent> T* set_mdp_perf_set_panic_luts() {
+    return BeginNestedMessage<T>(83);
+  }
+
+
+  using FieldMetadata_MdpSsppSet =
+    ::protozero::proto_utils::FieldMetadata<
+      84,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MdpSsppSetFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MdpSsppSet kMdpSsppSet() { return {}; }
+  template <typename T = MdpSsppSetFtraceEvent> T* set_mdp_sspp_set() {
+    return BeginNestedMessage<T>(84);
+  }
+
+
+  using FieldMetadata_MdpCmdReadptrDone =
+    ::protozero::proto_utils::FieldMetadata<
+      85,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MdpCmdReadptrDoneFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MdpCmdReadptrDone kMdpCmdReadptrDone() { return {}; }
+  template <typename T = MdpCmdReadptrDoneFtraceEvent> T* set_mdp_cmd_readptr_done() {
+    return BeginNestedMessage<T>(85);
+  }
+
+
+  using FieldMetadata_MdpMisrCrc =
+    ::protozero::proto_utils::FieldMetadata<
+      86,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MdpMisrCrcFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MdpMisrCrc kMdpMisrCrc() { return {}; }
+  template <typename T = MdpMisrCrcFtraceEvent> T* set_mdp_misr_crc() {
+    return BeginNestedMessage<T>(86);
+  }
+
+
+  using FieldMetadata_MdpPerfSetQosLuts =
+    ::protozero::proto_utils::FieldMetadata<
+      87,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MdpPerfSetQosLutsFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MdpPerfSetQosLuts kMdpPerfSetQosLuts() { return {}; }
+  template <typename T = MdpPerfSetQosLutsFtraceEvent> T* set_mdp_perf_set_qos_luts() {
+    return BeginNestedMessage<T>(87);
+  }
+
+
+  using FieldMetadata_MdpTraceCounter =
+    ::protozero::proto_utils::FieldMetadata<
+      88,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MdpTraceCounterFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MdpTraceCounter kMdpTraceCounter() { return {}; }
+  template <typename T = MdpTraceCounterFtraceEvent> T* set_mdp_trace_counter() {
+    return BeginNestedMessage<T>(88);
+  }
+
+
+  using FieldMetadata_MdpCmdReleaseBw =
+    ::protozero::proto_utils::FieldMetadata<
+      89,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MdpCmdReleaseBwFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MdpCmdReleaseBw kMdpCmdReleaseBw() { return {}; }
+  template <typename T = MdpCmdReleaseBwFtraceEvent> T* set_mdp_cmd_release_bw() {
+    return BeginNestedMessage<T>(89);
+  }
+
+
+  using FieldMetadata_MdpMixerUpdate =
+    ::protozero::proto_utils::FieldMetadata<
+      90,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MdpMixerUpdateFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MdpMixerUpdate kMdpMixerUpdate() { return {}; }
+  template <typename T = MdpMixerUpdateFtraceEvent> T* set_mdp_mixer_update() {
+    return BeginNestedMessage<T>(90);
+  }
+
+
+  using FieldMetadata_MdpPerfSetWmLevels =
+    ::protozero::proto_utils::FieldMetadata<
+      91,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MdpPerfSetWmLevelsFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MdpPerfSetWmLevels kMdpPerfSetWmLevels() { return {}; }
+  template <typename T = MdpPerfSetWmLevelsFtraceEvent> T* set_mdp_perf_set_wm_levels() {
+    return BeginNestedMessage<T>(91);
+  }
+
+
+  using FieldMetadata_MdpVideoUnderrunDone =
+    ::protozero::proto_utils::FieldMetadata<
+      92,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MdpVideoUnderrunDoneFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MdpVideoUnderrunDone kMdpVideoUnderrunDone() { return {}; }
+  template <typename T = MdpVideoUnderrunDoneFtraceEvent> T* set_mdp_video_underrun_done() {
+    return BeginNestedMessage<T>(92);
+  }
+
+
+  using FieldMetadata_MdpCmdWaitPingpong =
+    ::protozero::proto_utils::FieldMetadata<
+      93,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MdpCmdWaitPingpongFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MdpCmdWaitPingpong kMdpCmdWaitPingpong() { return {}; }
+  template <typename T = MdpCmdWaitPingpongFtraceEvent> T* set_mdp_cmd_wait_pingpong() {
+    return BeginNestedMessage<T>(93);
+  }
+
+
+  using FieldMetadata_MdpPerfPrefillCalc =
+    ::protozero::proto_utils::FieldMetadata<
+      94,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MdpPerfPrefillCalcFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MdpPerfPrefillCalc kMdpPerfPrefillCalc() { return {}; }
+  template <typename T = MdpPerfPrefillCalcFtraceEvent> T* set_mdp_perf_prefill_calc() {
+    return BeginNestedMessage<T>(94);
+  }
+
+
+  using FieldMetadata_MdpPerfUpdateBus =
+    ::protozero::proto_utils::FieldMetadata<
+      95,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MdpPerfUpdateBusFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MdpPerfUpdateBus kMdpPerfUpdateBus() { return {}; }
+  template <typename T = MdpPerfUpdateBusFtraceEvent> T* set_mdp_perf_update_bus() {
+    return BeginNestedMessage<T>(95);
+  }
+
+
+  using FieldMetadata_RotatorBwAoAsContext =
+    ::protozero::proto_utils::FieldMetadata<
+      96,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      RotatorBwAoAsContextFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RotatorBwAoAsContext kRotatorBwAoAsContext() { return {}; }
+  template <typename T = RotatorBwAoAsContextFtraceEvent> T* set_rotator_bw_ao_as_context() {
+    return BeginNestedMessage<T>(96);
+  }
+
+
+  using FieldMetadata_MmFilemapAddToPageCache =
+    ::protozero::proto_utils::FieldMetadata<
+      97,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MmFilemapAddToPageCacheFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MmFilemapAddToPageCache kMmFilemapAddToPageCache() { return {}; }
+  template <typename T = MmFilemapAddToPageCacheFtraceEvent> T* set_mm_filemap_add_to_page_cache() {
+    return BeginNestedMessage<T>(97);
+  }
+
+
+  using FieldMetadata_MmFilemapDeleteFromPageCache =
+    ::protozero::proto_utils::FieldMetadata<
+      98,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MmFilemapDeleteFromPageCacheFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MmFilemapDeleteFromPageCache kMmFilemapDeleteFromPageCache() { return {}; }
+  template <typename T = MmFilemapDeleteFromPageCacheFtraceEvent> T* set_mm_filemap_delete_from_page_cache() {
+    return BeginNestedMessage<T>(98);
+  }
+
+
+  using FieldMetadata_MmCompactionBegin =
+    ::protozero::proto_utils::FieldMetadata<
+      99,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MmCompactionBeginFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MmCompactionBegin kMmCompactionBegin() { return {}; }
+  template <typename T = MmCompactionBeginFtraceEvent> T* set_mm_compaction_begin() {
+    return BeginNestedMessage<T>(99);
+  }
+
+
+  using FieldMetadata_MmCompactionDeferCompaction =
+    ::protozero::proto_utils::FieldMetadata<
+      100,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MmCompactionDeferCompactionFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MmCompactionDeferCompaction kMmCompactionDeferCompaction() { return {}; }
+  template <typename T = MmCompactionDeferCompactionFtraceEvent> T* set_mm_compaction_defer_compaction() {
+    return BeginNestedMessage<T>(100);
+  }
+
+
+  using FieldMetadata_MmCompactionDeferred =
+    ::protozero::proto_utils::FieldMetadata<
+      101,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MmCompactionDeferredFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MmCompactionDeferred kMmCompactionDeferred() { return {}; }
+  template <typename T = MmCompactionDeferredFtraceEvent> T* set_mm_compaction_deferred() {
+    return BeginNestedMessage<T>(101);
+  }
+
+
+  using FieldMetadata_MmCompactionDeferReset =
+    ::protozero::proto_utils::FieldMetadata<
+      102,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MmCompactionDeferResetFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MmCompactionDeferReset kMmCompactionDeferReset() { return {}; }
+  template <typename T = MmCompactionDeferResetFtraceEvent> T* set_mm_compaction_defer_reset() {
+    return BeginNestedMessage<T>(102);
+  }
+
+
+  using FieldMetadata_MmCompactionEnd =
+    ::protozero::proto_utils::FieldMetadata<
+      103,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MmCompactionEndFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MmCompactionEnd kMmCompactionEnd() { return {}; }
+  template <typename T = MmCompactionEndFtraceEvent> T* set_mm_compaction_end() {
+    return BeginNestedMessage<T>(103);
+  }
+
+
+  using FieldMetadata_MmCompactionFinished =
+    ::protozero::proto_utils::FieldMetadata<
+      104,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MmCompactionFinishedFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MmCompactionFinished kMmCompactionFinished() { return {}; }
+  template <typename T = MmCompactionFinishedFtraceEvent> T* set_mm_compaction_finished() {
+    return BeginNestedMessage<T>(104);
+  }
+
+
+  using FieldMetadata_MmCompactionIsolateFreepages =
+    ::protozero::proto_utils::FieldMetadata<
+      105,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MmCompactionIsolateFreepagesFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MmCompactionIsolateFreepages kMmCompactionIsolateFreepages() { return {}; }
+  template <typename T = MmCompactionIsolateFreepagesFtraceEvent> T* set_mm_compaction_isolate_freepages() {
+    return BeginNestedMessage<T>(105);
+  }
+
+
+  using FieldMetadata_MmCompactionIsolateMigratepages =
+    ::protozero::proto_utils::FieldMetadata<
+      106,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MmCompactionIsolateMigratepagesFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MmCompactionIsolateMigratepages kMmCompactionIsolateMigratepages() { return {}; }
+  template <typename T = MmCompactionIsolateMigratepagesFtraceEvent> T* set_mm_compaction_isolate_migratepages() {
+    return BeginNestedMessage<T>(106);
+  }
+
+
+  using FieldMetadata_MmCompactionKcompactdSleep =
+    ::protozero::proto_utils::FieldMetadata<
+      107,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MmCompactionKcompactdSleepFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MmCompactionKcompactdSleep kMmCompactionKcompactdSleep() { return {}; }
+  template <typename T = MmCompactionKcompactdSleepFtraceEvent> T* set_mm_compaction_kcompactd_sleep() {
+    return BeginNestedMessage<T>(107);
+  }
+
+
+  using FieldMetadata_MmCompactionKcompactdWake =
+    ::protozero::proto_utils::FieldMetadata<
+      108,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MmCompactionKcompactdWakeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MmCompactionKcompactdWake kMmCompactionKcompactdWake() { return {}; }
+  template <typename T = MmCompactionKcompactdWakeFtraceEvent> T* set_mm_compaction_kcompactd_wake() {
+    return BeginNestedMessage<T>(108);
+  }
+
+
+  using FieldMetadata_MmCompactionMigratepages =
+    ::protozero::proto_utils::FieldMetadata<
+      109,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MmCompactionMigratepagesFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MmCompactionMigratepages kMmCompactionMigratepages() { return {}; }
+  template <typename T = MmCompactionMigratepagesFtraceEvent> T* set_mm_compaction_migratepages() {
+    return BeginNestedMessage<T>(109);
+  }
+
+
+  using FieldMetadata_MmCompactionSuitable =
+    ::protozero::proto_utils::FieldMetadata<
+      110,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MmCompactionSuitableFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MmCompactionSuitable kMmCompactionSuitable() { return {}; }
+  template <typename T = MmCompactionSuitableFtraceEvent> T* set_mm_compaction_suitable() {
+    return BeginNestedMessage<T>(110);
+  }
+
+
+  using FieldMetadata_MmCompactionTryToCompactPages =
+    ::protozero::proto_utils::FieldMetadata<
+      111,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MmCompactionTryToCompactPagesFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MmCompactionTryToCompactPages kMmCompactionTryToCompactPages() { return {}; }
+  template <typename T = MmCompactionTryToCompactPagesFtraceEvent> T* set_mm_compaction_try_to_compact_pages() {
+    return BeginNestedMessage<T>(111);
+  }
+
+
+  using FieldMetadata_MmCompactionWakeupKcompactd =
+    ::protozero::proto_utils::FieldMetadata<
+      112,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MmCompactionWakeupKcompactdFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MmCompactionWakeupKcompactd kMmCompactionWakeupKcompactd() { return {}; }
+  template <typename T = MmCompactionWakeupKcompactdFtraceEvent> T* set_mm_compaction_wakeup_kcompactd() {
+    return BeginNestedMessage<T>(112);
+  }
+
+
+  using FieldMetadata_SuspendResume =
+    ::protozero::proto_utils::FieldMetadata<
+      113,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SuspendResumeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SuspendResume kSuspendResume() { return {}; }
+  template <typename T = SuspendResumeFtraceEvent> T* set_suspend_resume() {
+    return BeginNestedMessage<T>(113);
+  }
+
+
+  using FieldMetadata_SchedWakeupNew =
+    ::protozero::proto_utils::FieldMetadata<
+      114,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SchedWakeupNewFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SchedWakeupNew kSchedWakeupNew() { return {}; }
+  template <typename T = SchedWakeupNewFtraceEvent> T* set_sched_wakeup_new() {
+    return BeginNestedMessage<T>(114);
+  }
+
+
+  using FieldMetadata_BlockBioBackmerge =
+    ::protozero::proto_utils::FieldMetadata<
+      115,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BlockBioBackmergeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BlockBioBackmerge kBlockBioBackmerge() { return {}; }
+  template <typename T = BlockBioBackmergeFtraceEvent> T* set_block_bio_backmerge() {
+    return BeginNestedMessage<T>(115);
+  }
+
+
+  using FieldMetadata_BlockBioBounce =
+    ::protozero::proto_utils::FieldMetadata<
+      116,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BlockBioBounceFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BlockBioBounce kBlockBioBounce() { return {}; }
+  template <typename T = BlockBioBounceFtraceEvent> T* set_block_bio_bounce() {
+    return BeginNestedMessage<T>(116);
+  }
+
+
+  using FieldMetadata_BlockBioComplete =
+    ::protozero::proto_utils::FieldMetadata<
+      117,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BlockBioCompleteFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BlockBioComplete kBlockBioComplete() { return {}; }
+  template <typename T = BlockBioCompleteFtraceEvent> T* set_block_bio_complete() {
+    return BeginNestedMessage<T>(117);
+  }
+
+
+  using FieldMetadata_BlockBioFrontmerge =
+    ::protozero::proto_utils::FieldMetadata<
+      118,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BlockBioFrontmergeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BlockBioFrontmerge kBlockBioFrontmerge() { return {}; }
+  template <typename T = BlockBioFrontmergeFtraceEvent> T* set_block_bio_frontmerge() {
+    return BeginNestedMessage<T>(118);
+  }
+
+
+  using FieldMetadata_BlockBioQueue =
+    ::protozero::proto_utils::FieldMetadata<
+      119,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BlockBioQueueFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BlockBioQueue kBlockBioQueue() { return {}; }
+  template <typename T = BlockBioQueueFtraceEvent> T* set_block_bio_queue() {
+    return BeginNestedMessage<T>(119);
+  }
+
+
+  using FieldMetadata_BlockBioRemap =
+    ::protozero::proto_utils::FieldMetadata<
+      120,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BlockBioRemapFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BlockBioRemap kBlockBioRemap() { return {}; }
+  template <typename T = BlockBioRemapFtraceEvent> T* set_block_bio_remap() {
+    return BeginNestedMessage<T>(120);
+  }
+
+
+  using FieldMetadata_BlockDirtyBuffer =
+    ::protozero::proto_utils::FieldMetadata<
+      121,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BlockDirtyBufferFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BlockDirtyBuffer kBlockDirtyBuffer() { return {}; }
+  template <typename T = BlockDirtyBufferFtraceEvent> T* set_block_dirty_buffer() {
+    return BeginNestedMessage<T>(121);
+  }
+
+
+  using FieldMetadata_BlockGetrq =
+    ::protozero::proto_utils::FieldMetadata<
+      122,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BlockGetrqFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BlockGetrq kBlockGetrq() { return {}; }
+  template <typename T = BlockGetrqFtraceEvent> T* set_block_getrq() {
+    return BeginNestedMessage<T>(122);
+  }
+
+
+  using FieldMetadata_BlockPlug =
+    ::protozero::proto_utils::FieldMetadata<
+      123,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BlockPlugFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BlockPlug kBlockPlug() { return {}; }
+  template <typename T = BlockPlugFtraceEvent> T* set_block_plug() {
+    return BeginNestedMessage<T>(123);
+  }
+
+
+  using FieldMetadata_BlockRqAbort =
+    ::protozero::proto_utils::FieldMetadata<
+      124,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BlockRqAbortFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BlockRqAbort kBlockRqAbort() { return {}; }
+  template <typename T = BlockRqAbortFtraceEvent> T* set_block_rq_abort() {
+    return BeginNestedMessage<T>(124);
+  }
+
+
+  using FieldMetadata_BlockRqComplete =
+    ::protozero::proto_utils::FieldMetadata<
+      125,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BlockRqCompleteFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BlockRqComplete kBlockRqComplete() { return {}; }
+  template <typename T = BlockRqCompleteFtraceEvent> T* set_block_rq_complete() {
+    return BeginNestedMessage<T>(125);
+  }
+
+
+  using FieldMetadata_BlockRqInsert =
+    ::protozero::proto_utils::FieldMetadata<
+      126,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BlockRqInsertFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BlockRqInsert kBlockRqInsert() { return {}; }
+  template <typename T = BlockRqInsertFtraceEvent> T* set_block_rq_insert() {
+    return BeginNestedMessage<T>(126);
+  }
+
+
+  using FieldMetadata_BlockRqRemap =
+    ::protozero::proto_utils::FieldMetadata<
+      128,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BlockRqRemapFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BlockRqRemap kBlockRqRemap() { return {}; }
+  template <typename T = BlockRqRemapFtraceEvent> T* set_block_rq_remap() {
+    return BeginNestedMessage<T>(128);
+  }
+
+
+  using FieldMetadata_BlockRqRequeue =
+    ::protozero::proto_utils::FieldMetadata<
+      129,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BlockRqRequeueFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BlockRqRequeue kBlockRqRequeue() { return {}; }
+  template <typename T = BlockRqRequeueFtraceEvent> T* set_block_rq_requeue() {
+    return BeginNestedMessage<T>(129);
+  }
+
+
+  using FieldMetadata_BlockSleeprq =
+    ::protozero::proto_utils::FieldMetadata<
+      130,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BlockSleeprqFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BlockSleeprq kBlockSleeprq() { return {}; }
+  template <typename T = BlockSleeprqFtraceEvent> T* set_block_sleeprq() {
+    return BeginNestedMessage<T>(130);
+  }
+
+
+  using FieldMetadata_BlockSplit =
+    ::protozero::proto_utils::FieldMetadata<
+      131,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BlockSplitFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BlockSplit kBlockSplit() { return {}; }
+  template <typename T = BlockSplitFtraceEvent> T* set_block_split() {
+    return BeginNestedMessage<T>(131);
+  }
+
+
+  using FieldMetadata_BlockTouchBuffer =
+    ::protozero::proto_utils::FieldMetadata<
+      132,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BlockTouchBufferFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BlockTouchBuffer kBlockTouchBuffer() { return {}; }
+  template <typename T = BlockTouchBufferFtraceEvent> T* set_block_touch_buffer() {
+    return BeginNestedMessage<T>(132);
+  }
+
+
+  using FieldMetadata_BlockUnplug =
+    ::protozero::proto_utils::FieldMetadata<
+      133,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BlockUnplugFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BlockUnplug kBlockUnplug() { return {}; }
+  template <typename T = BlockUnplugFtraceEvent> T* set_block_unplug() {
+    return BeginNestedMessage<T>(133);
+  }
+
+
+  using FieldMetadata_Ext4AllocDaBlocks =
+    ::protozero::proto_utils::FieldMetadata<
+      134,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4AllocDaBlocksFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4AllocDaBlocks kExt4AllocDaBlocks() { return {}; }
+  template <typename T = Ext4AllocDaBlocksFtraceEvent> T* set_ext4_alloc_da_blocks() {
+    return BeginNestedMessage<T>(134);
+  }
+
+
+  using FieldMetadata_Ext4AllocateBlocks =
+    ::protozero::proto_utils::FieldMetadata<
+      135,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4AllocateBlocksFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4AllocateBlocks kExt4AllocateBlocks() { return {}; }
+  template <typename T = Ext4AllocateBlocksFtraceEvent> T* set_ext4_allocate_blocks() {
+    return BeginNestedMessage<T>(135);
+  }
+
+
+  using FieldMetadata_Ext4AllocateInode =
+    ::protozero::proto_utils::FieldMetadata<
+      136,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4AllocateInodeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4AllocateInode kExt4AllocateInode() { return {}; }
+  template <typename T = Ext4AllocateInodeFtraceEvent> T* set_ext4_allocate_inode() {
+    return BeginNestedMessage<T>(136);
+  }
+
+
+  using FieldMetadata_Ext4BeginOrderedTruncate =
+    ::protozero::proto_utils::FieldMetadata<
+      137,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4BeginOrderedTruncateFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4BeginOrderedTruncate kExt4BeginOrderedTruncate() { return {}; }
+  template <typename T = Ext4BeginOrderedTruncateFtraceEvent> T* set_ext4_begin_ordered_truncate() {
+    return BeginNestedMessage<T>(137);
+  }
+
+
+  using FieldMetadata_Ext4CollapseRange =
+    ::protozero::proto_utils::FieldMetadata<
+      138,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4CollapseRangeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4CollapseRange kExt4CollapseRange() { return {}; }
+  template <typename T = Ext4CollapseRangeFtraceEvent> T* set_ext4_collapse_range() {
+    return BeginNestedMessage<T>(138);
+  }
+
+
+  using FieldMetadata_Ext4DaReleaseSpace =
+    ::protozero::proto_utils::FieldMetadata<
+      139,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4DaReleaseSpaceFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4DaReleaseSpace kExt4DaReleaseSpace() { return {}; }
+  template <typename T = Ext4DaReleaseSpaceFtraceEvent> T* set_ext4_da_release_space() {
+    return BeginNestedMessage<T>(139);
+  }
+
+
+  using FieldMetadata_Ext4DaReserveSpace =
+    ::protozero::proto_utils::FieldMetadata<
+      140,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4DaReserveSpaceFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4DaReserveSpace kExt4DaReserveSpace() { return {}; }
+  template <typename T = Ext4DaReserveSpaceFtraceEvent> T* set_ext4_da_reserve_space() {
+    return BeginNestedMessage<T>(140);
+  }
+
+
+  using FieldMetadata_Ext4DaUpdateReserveSpace =
+    ::protozero::proto_utils::FieldMetadata<
+      141,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4DaUpdateReserveSpaceFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4DaUpdateReserveSpace kExt4DaUpdateReserveSpace() { return {}; }
+  template <typename T = Ext4DaUpdateReserveSpaceFtraceEvent> T* set_ext4_da_update_reserve_space() {
+    return BeginNestedMessage<T>(141);
+  }
+
+
+  using FieldMetadata_Ext4DaWritePages =
+    ::protozero::proto_utils::FieldMetadata<
+      142,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4DaWritePagesFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4DaWritePages kExt4DaWritePages() { return {}; }
+  template <typename T = Ext4DaWritePagesFtraceEvent> T* set_ext4_da_write_pages() {
+    return BeginNestedMessage<T>(142);
+  }
+
+
+  using FieldMetadata_Ext4DaWritePagesExtent =
+    ::protozero::proto_utils::FieldMetadata<
+      143,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4DaWritePagesExtentFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4DaWritePagesExtent kExt4DaWritePagesExtent() { return {}; }
+  template <typename T = Ext4DaWritePagesExtentFtraceEvent> T* set_ext4_da_write_pages_extent() {
+    return BeginNestedMessage<T>(143);
+  }
+
+
+  using FieldMetadata_Ext4DirectIOEnter =
+    ::protozero::proto_utils::FieldMetadata<
+      144,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4DirectIOEnterFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4DirectIOEnter kExt4DirectIOEnter() { return {}; }
+  template <typename T = Ext4DirectIOEnterFtraceEvent> T* set_ext4_direct_io_enter() {
+    return BeginNestedMessage<T>(144);
+  }
+
+
+  using FieldMetadata_Ext4DirectIOExit =
+    ::protozero::proto_utils::FieldMetadata<
+      145,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4DirectIOExitFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4DirectIOExit kExt4DirectIOExit() { return {}; }
+  template <typename T = Ext4DirectIOExitFtraceEvent> T* set_ext4_direct_io_exit() {
+    return BeginNestedMessage<T>(145);
+  }
+
+
+  using FieldMetadata_Ext4DiscardBlocks =
+    ::protozero::proto_utils::FieldMetadata<
+      146,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4DiscardBlocksFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4DiscardBlocks kExt4DiscardBlocks() { return {}; }
+  template <typename T = Ext4DiscardBlocksFtraceEvent> T* set_ext4_discard_blocks() {
+    return BeginNestedMessage<T>(146);
+  }
+
+
+  using FieldMetadata_Ext4DiscardPreallocations =
+    ::protozero::proto_utils::FieldMetadata<
+      147,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4DiscardPreallocationsFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4DiscardPreallocations kExt4DiscardPreallocations() { return {}; }
+  template <typename T = Ext4DiscardPreallocationsFtraceEvent> T* set_ext4_discard_preallocations() {
+    return BeginNestedMessage<T>(147);
+  }
+
+
+  using FieldMetadata_Ext4DropInode =
+    ::protozero::proto_utils::FieldMetadata<
+      148,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4DropInodeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4DropInode kExt4DropInode() { return {}; }
+  template <typename T = Ext4DropInodeFtraceEvent> T* set_ext4_drop_inode() {
+    return BeginNestedMessage<T>(148);
+  }
+
+
+  using FieldMetadata_Ext4EsCacheExtent =
+    ::protozero::proto_utils::FieldMetadata<
+      149,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4EsCacheExtentFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4EsCacheExtent kExt4EsCacheExtent() { return {}; }
+  template <typename T = Ext4EsCacheExtentFtraceEvent> T* set_ext4_es_cache_extent() {
+    return BeginNestedMessage<T>(149);
+  }
+
+
+  using FieldMetadata_Ext4EsFindDelayedExtentRangeEnter =
+    ::protozero::proto_utils::FieldMetadata<
+      150,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4EsFindDelayedExtentRangeEnterFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4EsFindDelayedExtentRangeEnter kExt4EsFindDelayedExtentRangeEnter() { return {}; }
+  template <typename T = Ext4EsFindDelayedExtentRangeEnterFtraceEvent> T* set_ext4_es_find_delayed_extent_range_enter() {
+    return BeginNestedMessage<T>(150);
+  }
+
+
+  using FieldMetadata_Ext4EsFindDelayedExtentRangeExit =
+    ::protozero::proto_utils::FieldMetadata<
+      151,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4EsFindDelayedExtentRangeExitFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4EsFindDelayedExtentRangeExit kExt4EsFindDelayedExtentRangeExit() { return {}; }
+  template <typename T = Ext4EsFindDelayedExtentRangeExitFtraceEvent> T* set_ext4_es_find_delayed_extent_range_exit() {
+    return BeginNestedMessage<T>(151);
+  }
+
+
+  using FieldMetadata_Ext4EsInsertExtent =
+    ::protozero::proto_utils::FieldMetadata<
+      152,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4EsInsertExtentFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4EsInsertExtent kExt4EsInsertExtent() { return {}; }
+  template <typename T = Ext4EsInsertExtentFtraceEvent> T* set_ext4_es_insert_extent() {
+    return BeginNestedMessage<T>(152);
+  }
+
+
+  using FieldMetadata_Ext4EsLookupExtentEnter =
+    ::protozero::proto_utils::FieldMetadata<
+      153,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4EsLookupExtentEnterFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4EsLookupExtentEnter kExt4EsLookupExtentEnter() { return {}; }
+  template <typename T = Ext4EsLookupExtentEnterFtraceEvent> T* set_ext4_es_lookup_extent_enter() {
+    return BeginNestedMessage<T>(153);
+  }
+
+
+  using FieldMetadata_Ext4EsLookupExtentExit =
+    ::protozero::proto_utils::FieldMetadata<
+      154,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4EsLookupExtentExitFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4EsLookupExtentExit kExt4EsLookupExtentExit() { return {}; }
+  template <typename T = Ext4EsLookupExtentExitFtraceEvent> T* set_ext4_es_lookup_extent_exit() {
+    return BeginNestedMessage<T>(154);
+  }
+
+
+  using FieldMetadata_Ext4EsRemoveExtent =
+    ::protozero::proto_utils::FieldMetadata<
+      155,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4EsRemoveExtentFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4EsRemoveExtent kExt4EsRemoveExtent() { return {}; }
+  template <typename T = Ext4EsRemoveExtentFtraceEvent> T* set_ext4_es_remove_extent() {
+    return BeginNestedMessage<T>(155);
+  }
+
+
+  using FieldMetadata_Ext4EsShrink =
+    ::protozero::proto_utils::FieldMetadata<
+      156,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4EsShrinkFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4EsShrink kExt4EsShrink() { return {}; }
+  template <typename T = Ext4EsShrinkFtraceEvent> T* set_ext4_es_shrink() {
+    return BeginNestedMessage<T>(156);
+  }
+
+
+  using FieldMetadata_Ext4EsShrinkCount =
+    ::protozero::proto_utils::FieldMetadata<
+      157,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4EsShrinkCountFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4EsShrinkCount kExt4EsShrinkCount() { return {}; }
+  template <typename T = Ext4EsShrinkCountFtraceEvent> T* set_ext4_es_shrink_count() {
+    return BeginNestedMessage<T>(157);
+  }
+
+
+  using FieldMetadata_Ext4EsShrinkScanEnter =
+    ::protozero::proto_utils::FieldMetadata<
+      158,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4EsShrinkScanEnterFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4EsShrinkScanEnter kExt4EsShrinkScanEnter() { return {}; }
+  template <typename T = Ext4EsShrinkScanEnterFtraceEvent> T* set_ext4_es_shrink_scan_enter() {
+    return BeginNestedMessage<T>(158);
+  }
+
+
+  using FieldMetadata_Ext4EsShrinkScanExit =
+    ::protozero::proto_utils::FieldMetadata<
+      159,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4EsShrinkScanExitFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4EsShrinkScanExit kExt4EsShrinkScanExit() { return {}; }
+  template <typename T = Ext4EsShrinkScanExitFtraceEvent> T* set_ext4_es_shrink_scan_exit() {
+    return BeginNestedMessage<T>(159);
+  }
+
+
+  using FieldMetadata_Ext4EvictInode =
+    ::protozero::proto_utils::FieldMetadata<
+      160,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4EvictInodeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4EvictInode kExt4EvictInode() { return {}; }
+  template <typename T = Ext4EvictInodeFtraceEvent> T* set_ext4_evict_inode() {
+    return BeginNestedMessage<T>(160);
+  }
+
+
+  using FieldMetadata_Ext4ExtConvertToInitializedEnter =
+    ::protozero::proto_utils::FieldMetadata<
+      161,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4ExtConvertToInitializedEnterFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4ExtConvertToInitializedEnter kExt4ExtConvertToInitializedEnter() { return {}; }
+  template <typename T = Ext4ExtConvertToInitializedEnterFtraceEvent> T* set_ext4_ext_convert_to_initialized_enter() {
+    return BeginNestedMessage<T>(161);
+  }
+
+
+  using FieldMetadata_Ext4ExtConvertToInitializedFastpath =
+    ::protozero::proto_utils::FieldMetadata<
+      162,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4ExtConvertToInitializedFastpathFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4ExtConvertToInitializedFastpath kExt4ExtConvertToInitializedFastpath() { return {}; }
+  template <typename T = Ext4ExtConvertToInitializedFastpathFtraceEvent> T* set_ext4_ext_convert_to_initialized_fastpath() {
+    return BeginNestedMessage<T>(162);
+  }
+
+
+  using FieldMetadata_Ext4ExtHandleUnwrittenExtents =
+    ::protozero::proto_utils::FieldMetadata<
+      163,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4ExtHandleUnwrittenExtentsFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4ExtHandleUnwrittenExtents kExt4ExtHandleUnwrittenExtents() { return {}; }
+  template <typename T = Ext4ExtHandleUnwrittenExtentsFtraceEvent> T* set_ext4_ext_handle_unwritten_extents() {
+    return BeginNestedMessage<T>(163);
+  }
+
+
+  using FieldMetadata_Ext4ExtInCache =
+    ::protozero::proto_utils::FieldMetadata<
+      164,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4ExtInCacheFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4ExtInCache kExt4ExtInCache() { return {}; }
+  template <typename T = Ext4ExtInCacheFtraceEvent> T* set_ext4_ext_in_cache() {
+    return BeginNestedMessage<T>(164);
+  }
+
+
+  using FieldMetadata_Ext4ExtLoadExtent =
+    ::protozero::proto_utils::FieldMetadata<
+      165,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4ExtLoadExtentFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4ExtLoadExtent kExt4ExtLoadExtent() { return {}; }
+  template <typename T = Ext4ExtLoadExtentFtraceEvent> T* set_ext4_ext_load_extent() {
+    return BeginNestedMessage<T>(165);
+  }
+
+
+  using FieldMetadata_Ext4ExtMapBlocksEnter =
+    ::protozero::proto_utils::FieldMetadata<
+      166,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4ExtMapBlocksEnterFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4ExtMapBlocksEnter kExt4ExtMapBlocksEnter() { return {}; }
+  template <typename T = Ext4ExtMapBlocksEnterFtraceEvent> T* set_ext4_ext_map_blocks_enter() {
+    return BeginNestedMessage<T>(166);
+  }
+
+
+  using FieldMetadata_Ext4ExtMapBlocksExit =
+    ::protozero::proto_utils::FieldMetadata<
+      167,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4ExtMapBlocksExitFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4ExtMapBlocksExit kExt4ExtMapBlocksExit() { return {}; }
+  template <typename T = Ext4ExtMapBlocksExitFtraceEvent> T* set_ext4_ext_map_blocks_exit() {
+    return BeginNestedMessage<T>(167);
+  }
+
+
+  using FieldMetadata_Ext4ExtPutInCache =
+    ::protozero::proto_utils::FieldMetadata<
+      168,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4ExtPutInCacheFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4ExtPutInCache kExt4ExtPutInCache() { return {}; }
+  template <typename T = Ext4ExtPutInCacheFtraceEvent> T* set_ext4_ext_put_in_cache() {
+    return BeginNestedMessage<T>(168);
+  }
+
+
+  using FieldMetadata_Ext4ExtRemoveSpace =
+    ::protozero::proto_utils::FieldMetadata<
+      169,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4ExtRemoveSpaceFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4ExtRemoveSpace kExt4ExtRemoveSpace() { return {}; }
+  template <typename T = Ext4ExtRemoveSpaceFtraceEvent> T* set_ext4_ext_remove_space() {
+    return BeginNestedMessage<T>(169);
+  }
+
+
+  using FieldMetadata_Ext4ExtRemoveSpaceDone =
+    ::protozero::proto_utils::FieldMetadata<
+      170,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4ExtRemoveSpaceDoneFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4ExtRemoveSpaceDone kExt4ExtRemoveSpaceDone() { return {}; }
+  template <typename T = Ext4ExtRemoveSpaceDoneFtraceEvent> T* set_ext4_ext_remove_space_done() {
+    return BeginNestedMessage<T>(170);
+  }
+
+
+  using FieldMetadata_Ext4ExtRmIdx =
+    ::protozero::proto_utils::FieldMetadata<
+      171,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4ExtRmIdxFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4ExtRmIdx kExt4ExtRmIdx() { return {}; }
+  template <typename T = Ext4ExtRmIdxFtraceEvent> T* set_ext4_ext_rm_idx() {
+    return BeginNestedMessage<T>(171);
+  }
+
+
+  using FieldMetadata_Ext4ExtRmLeaf =
+    ::protozero::proto_utils::FieldMetadata<
+      172,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4ExtRmLeafFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4ExtRmLeaf kExt4ExtRmLeaf() { return {}; }
+  template <typename T = Ext4ExtRmLeafFtraceEvent> T* set_ext4_ext_rm_leaf() {
+    return BeginNestedMessage<T>(172);
+  }
+
+
+  using FieldMetadata_Ext4ExtShowExtent =
+    ::protozero::proto_utils::FieldMetadata<
+      173,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4ExtShowExtentFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4ExtShowExtent kExt4ExtShowExtent() { return {}; }
+  template <typename T = Ext4ExtShowExtentFtraceEvent> T* set_ext4_ext_show_extent() {
+    return BeginNestedMessage<T>(173);
+  }
+
+
+  using FieldMetadata_Ext4FallocateEnter =
+    ::protozero::proto_utils::FieldMetadata<
+      174,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4FallocateEnterFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4FallocateEnter kExt4FallocateEnter() { return {}; }
+  template <typename T = Ext4FallocateEnterFtraceEvent> T* set_ext4_fallocate_enter() {
+    return BeginNestedMessage<T>(174);
+  }
+
+
+  using FieldMetadata_Ext4FallocateExit =
+    ::protozero::proto_utils::FieldMetadata<
+      175,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4FallocateExitFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4FallocateExit kExt4FallocateExit() { return {}; }
+  template <typename T = Ext4FallocateExitFtraceEvent> T* set_ext4_fallocate_exit() {
+    return BeginNestedMessage<T>(175);
+  }
+
+
+  using FieldMetadata_Ext4FindDelallocRange =
+    ::protozero::proto_utils::FieldMetadata<
+      176,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4FindDelallocRangeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4FindDelallocRange kExt4FindDelallocRange() { return {}; }
+  template <typename T = Ext4FindDelallocRangeFtraceEvent> T* set_ext4_find_delalloc_range() {
+    return BeginNestedMessage<T>(176);
+  }
+
+
+  using FieldMetadata_Ext4Forget =
+    ::protozero::proto_utils::FieldMetadata<
+      177,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4ForgetFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4Forget kExt4Forget() { return {}; }
+  template <typename T = Ext4ForgetFtraceEvent> T* set_ext4_forget() {
+    return BeginNestedMessage<T>(177);
+  }
+
+
+  using FieldMetadata_Ext4FreeBlocks =
+    ::protozero::proto_utils::FieldMetadata<
+      178,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4FreeBlocksFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4FreeBlocks kExt4FreeBlocks() { return {}; }
+  template <typename T = Ext4FreeBlocksFtraceEvent> T* set_ext4_free_blocks() {
+    return BeginNestedMessage<T>(178);
+  }
+
+
+  using FieldMetadata_Ext4FreeInode =
+    ::protozero::proto_utils::FieldMetadata<
+      179,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4FreeInodeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4FreeInode kExt4FreeInode() { return {}; }
+  template <typename T = Ext4FreeInodeFtraceEvent> T* set_ext4_free_inode() {
+    return BeginNestedMessage<T>(179);
+  }
+
+
+  using FieldMetadata_Ext4GetImpliedClusterAllocExit =
+    ::protozero::proto_utils::FieldMetadata<
+      180,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4GetImpliedClusterAllocExitFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4GetImpliedClusterAllocExit kExt4GetImpliedClusterAllocExit() { return {}; }
+  template <typename T = Ext4GetImpliedClusterAllocExitFtraceEvent> T* set_ext4_get_implied_cluster_alloc_exit() {
+    return BeginNestedMessage<T>(180);
+  }
+
+
+  using FieldMetadata_Ext4GetReservedClusterAlloc =
+    ::protozero::proto_utils::FieldMetadata<
+      181,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4GetReservedClusterAllocFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4GetReservedClusterAlloc kExt4GetReservedClusterAlloc() { return {}; }
+  template <typename T = Ext4GetReservedClusterAllocFtraceEvent> T* set_ext4_get_reserved_cluster_alloc() {
+    return BeginNestedMessage<T>(181);
+  }
+
+
+  using FieldMetadata_Ext4IndMapBlocksEnter =
+    ::protozero::proto_utils::FieldMetadata<
+      182,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4IndMapBlocksEnterFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4IndMapBlocksEnter kExt4IndMapBlocksEnter() { return {}; }
+  template <typename T = Ext4IndMapBlocksEnterFtraceEvent> T* set_ext4_ind_map_blocks_enter() {
+    return BeginNestedMessage<T>(182);
+  }
+
+
+  using FieldMetadata_Ext4IndMapBlocksExit =
+    ::protozero::proto_utils::FieldMetadata<
+      183,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4IndMapBlocksExitFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4IndMapBlocksExit kExt4IndMapBlocksExit() { return {}; }
+  template <typename T = Ext4IndMapBlocksExitFtraceEvent> T* set_ext4_ind_map_blocks_exit() {
+    return BeginNestedMessage<T>(183);
+  }
+
+
+  using FieldMetadata_Ext4InsertRange =
+    ::protozero::proto_utils::FieldMetadata<
+      184,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4InsertRangeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4InsertRange kExt4InsertRange() { return {}; }
+  template <typename T = Ext4InsertRangeFtraceEvent> T* set_ext4_insert_range() {
+    return BeginNestedMessage<T>(184);
+  }
+
+
+  using FieldMetadata_Ext4Invalidatepage =
+    ::protozero::proto_utils::FieldMetadata<
+      185,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4InvalidatepageFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4Invalidatepage kExt4Invalidatepage() { return {}; }
+  template <typename T = Ext4InvalidatepageFtraceEvent> T* set_ext4_invalidatepage() {
+    return BeginNestedMessage<T>(185);
+  }
+
+
+  using FieldMetadata_Ext4JournalStart =
+    ::protozero::proto_utils::FieldMetadata<
+      186,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4JournalStartFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4JournalStart kExt4JournalStart() { return {}; }
+  template <typename T = Ext4JournalStartFtraceEvent> T* set_ext4_journal_start() {
+    return BeginNestedMessage<T>(186);
+  }
+
+
+  using FieldMetadata_Ext4JournalStartReserved =
+    ::protozero::proto_utils::FieldMetadata<
+      187,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4JournalStartReservedFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4JournalStartReserved kExt4JournalStartReserved() { return {}; }
+  template <typename T = Ext4JournalStartReservedFtraceEvent> T* set_ext4_journal_start_reserved() {
+    return BeginNestedMessage<T>(187);
+  }
+
+
+  using FieldMetadata_Ext4JournalledInvalidatepage =
+    ::protozero::proto_utils::FieldMetadata<
+      188,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4JournalledInvalidatepageFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4JournalledInvalidatepage kExt4JournalledInvalidatepage() { return {}; }
+  template <typename T = Ext4JournalledInvalidatepageFtraceEvent> T* set_ext4_journalled_invalidatepage() {
+    return BeginNestedMessage<T>(188);
+  }
+
+
+  using FieldMetadata_Ext4JournalledWriteEnd =
+    ::protozero::proto_utils::FieldMetadata<
+      189,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4JournalledWriteEndFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4JournalledWriteEnd kExt4JournalledWriteEnd() { return {}; }
+  template <typename T = Ext4JournalledWriteEndFtraceEvent> T* set_ext4_journalled_write_end() {
+    return BeginNestedMessage<T>(189);
+  }
+
+
+  using FieldMetadata_Ext4LoadInode =
+    ::protozero::proto_utils::FieldMetadata<
+      190,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4LoadInodeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4LoadInode kExt4LoadInode() { return {}; }
+  template <typename T = Ext4LoadInodeFtraceEvent> T* set_ext4_load_inode() {
+    return BeginNestedMessage<T>(190);
+  }
+
+
+  using FieldMetadata_Ext4LoadInodeBitmap =
+    ::protozero::proto_utils::FieldMetadata<
+      191,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4LoadInodeBitmapFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4LoadInodeBitmap kExt4LoadInodeBitmap() { return {}; }
+  template <typename T = Ext4LoadInodeBitmapFtraceEvent> T* set_ext4_load_inode_bitmap() {
+    return BeginNestedMessage<T>(191);
+  }
+
+
+  using FieldMetadata_Ext4MarkInodeDirty =
+    ::protozero::proto_utils::FieldMetadata<
+      192,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4MarkInodeDirtyFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4MarkInodeDirty kExt4MarkInodeDirty() { return {}; }
+  template <typename T = Ext4MarkInodeDirtyFtraceEvent> T* set_ext4_mark_inode_dirty() {
+    return BeginNestedMessage<T>(192);
+  }
+
+
+  using FieldMetadata_Ext4MbBitmapLoad =
+    ::protozero::proto_utils::FieldMetadata<
+      193,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4MbBitmapLoadFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4MbBitmapLoad kExt4MbBitmapLoad() { return {}; }
+  template <typename T = Ext4MbBitmapLoadFtraceEvent> T* set_ext4_mb_bitmap_load() {
+    return BeginNestedMessage<T>(193);
+  }
+
+
+  using FieldMetadata_Ext4MbBuddyBitmapLoad =
+    ::protozero::proto_utils::FieldMetadata<
+      194,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4MbBuddyBitmapLoadFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4MbBuddyBitmapLoad kExt4MbBuddyBitmapLoad() { return {}; }
+  template <typename T = Ext4MbBuddyBitmapLoadFtraceEvent> T* set_ext4_mb_buddy_bitmap_load() {
+    return BeginNestedMessage<T>(194);
+  }
+
+
+  using FieldMetadata_Ext4MbDiscardPreallocations =
+    ::protozero::proto_utils::FieldMetadata<
+      195,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4MbDiscardPreallocationsFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4MbDiscardPreallocations kExt4MbDiscardPreallocations() { return {}; }
+  template <typename T = Ext4MbDiscardPreallocationsFtraceEvent> T* set_ext4_mb_discard_preallocations() {
+    return BeginNestedMessage<T>(195);
+  }
+
+
+  using FieldMetadata_Ext4MbNewGroupPa =
+    ::protozero::proto_utils::FieldMetadata<
+      196,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4MbNewGroupPaFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4MbNewGroupPa kExt4MbNewGroupPa() { return {}; }
+  template <typename T = Ext4MbNewGroupPaFtraceEvent> T* set_ext4_mb_new_group_pa() {
+    return BeginNestedMessage<T>(196);
+  }
+
+
+  using FieldMetadata_Ext4MbNewInodePa =
+    ::protozero::proto_utils::FieldMetadata<
+      197,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4MbNewInodePaFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4MbNewInodePa kExt4MbNewInodePa() { return {}; }
+  template <typename T = Ext4MbNewInodePaFtraceEvent> T* set_ext4_mb_new_inode_pa() {
+    return BeginNestedMessage<T>(197);
+  }
+
+
+  using FieldMetadata_Ext4MbReleaseGroupPa =
+    ::protozero::proto_utils::FieldMetadata<
+      198,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4MbReleaseGroupPaFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4MbReleaseGroupPa kExt4MbReleaseGroupPa() { return {}; }
+  template <typename T = Ext4MbReleaseGroupPaFtraceEvent> T* set_ext4_mb_release_group_pa() {
+    return BeginNestedMessage<T>(198);
+  }
+
+
+  using FieldMetadata_Ext4MbReleaseInodePa =
+    ::protozero::proto_utils::FieldMetadata<
+      199,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4MbReleaseInodePaFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4MbReleaseInodePa kExt4MbReleaseInodePa() { return {}; }
+  template <typename T = Ext4MbReleaseInodePaFtraceEvent> T* set_ext4_mb_release_inode_pa() {
+    return BeginNestedMessage<T>(199);
+  }
+
+
+  using FieldMetadata_Ext4MballocAlloc =
+    ::protozero::proto_utils::FieldMetadata<
+      200,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4MballocAllocFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4MballocAlloc kExt4MballocAlloc() { return {}; }
+  template <typename T = Ext4MballocAllocFtraceEvent> T* set_ext4_mballoc_alloc() {
+    return BeginNestedMessage<T>(200);
+  }
+
+
+  using FieldMetadata_Ext4MballocDiscard =
+    ::protozero::proto_utils::FieldMetadata<
+      201,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4MballocDiscardFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4MballocDiscard kExt4MballocDiscard() { return {}; }
+  template <typename T = Ext4MballocDiscardFtraceEvent> T* set_ext4_mballoc_discard() {
+    return BeginNestedMessage<T>(201);
+  }
+
+
+  using FieldMetadata_Ext4MballocFree =
+    ::protozero::proto_utils::FieldMetadata<
+      202,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4MballocFreeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4MballocFree kExt4MballocFree() { return {}; }
+  template <typename T = Ext4MballocFreeFtraceEvent> T* set_ext4_mballoc_free() {
+    return BeginNestedMessage<T>(202);
+  }
+
+
+  using FieldMetadata_Ext4MballocPrealloc =
+    ::protozero::proto_utils::FieldMetadata<
+      203,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4MballocPreallocFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4MballocPrealloc kExt4MballocPrealloc() { return {}; }
+  template <typename T = Ext4MballocPreallocFtraceEvent> T* set_ext4_mballoc_prealloc() {
+    return BeginNestedMessage<T>(203);
+  }
+
+
+  using FieldMetadata_Ext4OtherInodeUpdateTime =
+    ::protozero::proto_utils::FieldMetadata<
+      204,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4OtherInodeUpdateTimeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4OtherInodeUpdateTime kExt4OtherInodeUpdateTime() { return {}; }
+  template <typename T = Ext4OtherInodeUpdateTimeFtraceEvent> T* set_ext4_other_inode_update_time() {
+    return BeginNestedMessage<T>(204);
+  }
+
+
+  using FieldMetadata_Ext4PunchHole =
+    ::protozero::proto_utils::FieldMetadata<
+      205,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4PunchHoleFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4PunchHole kExt4PunchHole() { return {}; }
+  template <typename T = Ext4PunchHoleFtraceEvent> T* set_ext4_punch_hole() {
+    return BeginNestedMessage<T>(205);
+  }
+
+
+  using FieldMetadata_Ext4ReadBlockBitmapLoad =
+    ::protozero::proto_utils::FieldMetadata<
+      206,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4ReadBlockBitmapLoadFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4ReadBlockBitmapLoad kExt4ReadBlockBitmapLoad() { return {}; }
+  template <typename T = Ext4ReadBlockBitmapLoadFtraceEvent> T* set_ext4_read_block_bitmap_load() {
+    return BeginNestedMessage<T>(206);
+  }
+
+
+  using FieldMetadata_Ext4Readpage =
+    ::protozero::proto_utils::FieldMetadata<
+      207,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4ReadpageFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4Readpage kExt4Readpage() { return {}; }
+  template <typename T = Ext4ReadpageFtraceEvent> T* set_ext4_readpage() {
+    return BeginNestedMessage<T>(207);
+  }
+
+
+  using FieldMetadata_Ext4Releasepage =
+    ::protozero::proto_utils::FieldMetadata<
+      208,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4ReleasepageFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4Releasepage kExt4Releasepage() { return {}; }
+  template <typename T = Ext4ReleasepageFtraceEvent> T* set_ext4_releasepage() {
+    return BeginNestedMessage<T>(208);
+  }
+
+
+  using FieldMetadata_Ext4RemoveBlocks =
+    ::protozero::proto_utils::FieldMetadata<
+      209,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4RemoveBlocksFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4RemoveBlocks kExt4RemoveBlocks() { return {}; }
+  template <typename T = Ext4RemoveBlocksFtraceEvent> T* set_ext4_remove_blocks() {
+    return BeginNestedMessage<T>(209);
+  }
+
+
+  using FieldMetadata_Ext4RequestBlocks =
+    ::protozero::proto_utils::FieldMetadata<
+      210,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4RequestBlocksFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4RequestBlocks kExt4RequestBlocks() { return {}; }
+  template <typename T = Ext4RequestBlocksFtraceEvent> T* set_ext4_request_blocks() {
+    return BeginNestedMessage<T>(210);
+  }
+
+
+  using FieldMetadata_Ext4RequestInode =
+    ::protozero::proto_utils::FieldMetadata<
+      211,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4RequestInodeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4RequestInode kExt4RequestInode() { return {}; }
+  template <typename T = Ext4RequestInodeFtraceEvent> T* set_ext4_request_inode() {
+    return BeginNestedMessage<T>(211);
+  }
+
+
+  using FieldMetadata_Ext4SyncFs =
+    ::protozero::proto_utils::FieldMetadata<
+      212,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4SyncFsFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4SyncFs kExt4SyncFs() { return {}; }
+  template <typename T = Ext4SyncFsFtraceEvent> T* set_ext4_sync_fs() {
+    return BeginNestedMessage<T>(212);
+  }
+
+
+  using FieldMetadata_Ext4TrimAllFree =
+    ::protozero::proto_utils::FieldMetadata<
+      213,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4TrimAllFreeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4TrimAllFree kExt4TrimAllFree() { return {}; }
+  template <typename T = Ext4TrimAllFreeFtraceEvent> T* set_ext4_trim_all_free() {
+    return BeginNestedMessage<T>(213);
+  }
+
+
+  using FieldMetadata_Ext4TrimExtent =
+    ::protozero::proto_utils::FieldMetadata<
+      214,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4TrimExtentFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4TrimExtent kExt4TrimExtent() { return {}; }
+  template <typename T = Ext4TrimExtentFtraceEvent> T* set_ext4_trim_extent() {
+    return BeginNestedMessage<T>(214);
+  }
+
+
+  using FieldMetadata_Ext4TruncateEnter =
+    ::protozero::proto_utils::FieldMetadata<
+      215,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4TruncateEnterFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4TruncateEnter kExt4TruncateEnter() { return {}; }
+  template <typename T = Ext4TruncateEnterFtraceEvent> T* set_ext4_truncate_enter() {
+    return BeginNestedMessage<T>(215);
+  }
+
+
+  using FieldMetadata_Ext4TruncateExit =
+    ::protozero::proto_utils::FieldMetadata<
+      216,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4TruncateExitFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4TruncateExit kExt4TruncateExit() { return {}; }
+  template <typename T = Ext4TruncateExitFtraceEvent> T* set_ext4_truncate_exit() {
+    return BeginNestedMessage<T>(216);
+  }
+
+
+  using FieldMetadata_Ext4UnlinkEnter =
+    ::protozero::proto_utils::FieldMetadata<
+      217,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4UnlinkEnterFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4UnlinkEnter kExt4UnlinkEnter() { return {}; }
+  template <typename T = Ext4UnlinkEnterFtraceEvent> T* set_ext4_unlink_enter() {
+    return BeginNestedMessage<T>(217);
+  }
+
+
+  using FieldMetadata_Ext4UnlinkExit =
+    ::protozero::proto_utils::FieldMetadata<
+      218,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4UnlinkExitFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4UnlinkExit kExt4UnlinkExit() { return {}; }
+  template <typename T = Ext4UnlinkExitFtraceEvent> T* set_ext4_unlink_exit() {
+    return BeginNestedMessage<T>(218);
+  }
+
+
+  using FieldMetadata_Ext4WriteBegin =
+    ::protozero::proto_utils::FieldMetadata<
+      219,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4WriteBeginFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4WriteBegin kExt4WriteBegin() { return {}; }
+  template <typename T = Ext4WriteBeginFtraceEvent> T* set_ext4_write_begin() {
+    return BeginNestedMessage<T>(219);
+  }
+
+
+  using FieldMetadata_Ext4WriteEnd =
+    ::protozero::proto_utils::FieldMetadata<
+      230,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4WriteEndFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4WriteEnd kExt4WriteEnd() { return {}; }
+  template <typename T = Ext4WriteEndFtraceEvent> T* set_ext4_write_end() {
+    return BeginNestedMessage<T>(230);
+  }
+
+
+  using FieldMetadata_Ext4Writepage =
+    ::protozero::proto_utils::FieldMetadata<
+      231,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4WritepageFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4Writepage kExt4Writepage() { return {}; }
+  template <typename T = Ext4WritepageFtraceEvent> T* set_ext4_writepage() {
+    return BeginNestedMessage<T>(231);
+  }
+
+
+  using FieldMetadata_Ext4Writepages =
+    ::protozero::proto_utils::FieldMetadata<
+      232,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4WritepagesFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4Writepages kExt4Writepages() { return {}; }
+  template <typename T = Ext4WritepagesFtraceEvent> T* set_ext4_writepages() {
+    return BeginNestedMessage<T>(232);
+  }
+
+
+  using FieldMetadata_Ext4WritepagesResult =
+    ::protozero::proto_utils::FieldMetadata<
+      233,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4WritepagesResultFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4WritepagesResult kExt4WritepagesResult() { return {}; }
+  template <typename T = Ext4WritepagesResultFtraceEvent> T* set_ext4_writepages_result() {
+    return BeginNestedMessage<T>(233);
+  }
+
+
+  using FieldMetadata_Ext4ZeroRange =
+    ::protozero::proto_utils::FieldMetadata<
+      234,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Ext4ZeroRangeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ext4ZeroRange kExt4ZeroRange() { return {}; }
+  template <typename T = Ext4ZeroRangeFtraceEvent> T* set_ext4_zero_range() {
+    return BeginNestedMessage<T>(234);
+  }
+
+
+  using FieldMetadata_TaskNewtask =
+    ::protozero::proto_utils::FieldMetadata<
+      235,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TaskNewtaskFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TaskNewtask kTaskNewtask() { return {}; }
+  template <typename T = TaskNewtaskFtraceEvent> T* set_task_newtask() {
+    return BeginNestedMessage<T>(235);
+  }
+
+
+  using FieldMetadata_TaskRename =
+    ::protozero::proto_utils::FieldMetadata<
+      236,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TaskRenameFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TaskRename kTaskRename() { return {}; }
+  template <typename T = TaskRenameFtraceEvent> T* set_task_rename() {
+    return BeginNestedMessage<T>(236);
+  }
+
+
+  using FieldMetadata_SchedProcessExec =
+    ::protozero::proto_utils::FieldMetadata<
+      237,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SchedProcessExecFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SchedProcessExec kSchedProcessExec() { return {}; }
+  template <typename T = SchedProcessExecFtraceEvent> T* set_sched_process_exec() {
+    return BeginNestedMessage<T>(237);
+  }
+
+
+  using FieldMetadata_SchedProcessExit =
+    ::protozero::proto_utils::FieldMetadata<
+      238,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SchedProcessExitFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SchedProcessExit kSchedProcessExit() { return {}; }
+  template <typename T = SchedProcessExitFtraceEvent> T* set_sched_process_exit() {
+    return BeginNestedMessage<T>(238);
+  }
+
+
+  using FieldMetadata_SchedProcessFork =
+    ::protozero::proto_utils::FieldMetadata<
+      239,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SchedProcessForkFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SchedProcessFork kSchedProcessFork() { return {}; }
+  template <typename T = SchedProcessForkFtraceEvent> T* set_sched_process_fork() {
+    return BeginNestedMessage<T>(239);
+  }
+
+
+  using FieldMetadata_SchedProcessFree =
+    ::protozero::proto_utils::FieldMetadata<
+      240,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SchedProcessFreeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SchedProcessFree kSchedProcessFree() { return {}; }
+  template <typename T = SchedProcessFreeFtraceEvent> T* set_sched_process_free() {
+    return BeginNestedMessage<T>(240);
+  }
+
+
+  using FieldMetadata_SchedProcessHang =
+    ::protozero::proto_utils::FieldMetadata<
+      241,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SchedProcessHangFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SchedProcessHang kSchedProcessHang() { return {}; }
+  template <typename T = SchedProcessHangFtraceEvent> T* set_sched_process_hang() {
+    return BeginNestedMessage<T>(241);
+  }
+
+
+  using FieldMetadata_SchedProcessWait =
+    ::protozero::proto_utils::FieldMetadata<
+      242,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SchedProcessWaitFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SchedProcessWait kSchedProcessWait() { return {}; }
+  template <typename T = SchedProcessWaitFtraceEvent> T* set_sched_process_wait() {
+    return BeginNestedMessage<T>(242);
+  }
+
+
+  using FieldMetadata_F2fsDoSubmitBio =
+    ::protozero::proto_utils::FieldMetadata<
+      243,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsDoSubmitBioFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsDoSubmitBio kF2fsDoSubmitBio() { return {}; }
+  template <typename T = F2fsDoSubmitBioFtraceEvent> T* set_f2fs_do_submit_bio() {
+    return BeginNestedMessage<T>(243);
+  }
+
+
+  using FieldMetadata_F2fsEvictInode =
+    ::protozero::proto_utils::FieldMetadata<
+      244,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsEvictInodeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsEvictInode kF2fsEvictInode() { return {}; }
+  template <typename T = F2fsEvictInodeFtraceEvent> T* set_f2fs_evict_inode() {
+    return BeginNestedMessage<T>(244);
+  }
+
+
+  using FieldMetadata_F2fsFallocate =
+    ::protozero::proto_utils::FieldMetadata<
+      245,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsFallocateFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsFallocate kF2fsFallocate() { return {}; }
+  template <typename T = F2fsFallocateFtraceEvent> T* set_f2fs_fallocate() {
+    return BeginNestedMessage<T>(245);
+  }
+
+
+  using FieldMetadata_F2fsGetDataBlock =
+    ::protozero::proto_utils::FieldMetadata<
+      246,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsGetDataBlockFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsGetDataBlock kF2fsGetDataBlock() { return {}; }
+  template <typename T = F2fsGetDataBlockFtraceEvent> T* set_f2fs_get_data_block() {
+    return BeginNestedMessage<T>(246);
+  }
+
+
+  using FieldMetadata_F2fsGetVictim =
+    ::protozero::proto_utils::FieldMetadata<
+      247,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsGetVictimFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsGetVictim kF2fsGetVictim() { return {}; }
+  template <typename T = F2fsGetVictimFtraceEvent> T* set_f2fs_get_victim() {
+    return BeginNestedMessage<T>(247);
+  }
+
+
+  using FieldMetadata_F2fsIget =
+    ::protozero::proto_utils::FieldMetadata<
+      248,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsIgetFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsIget kF2fsIget() { return {}; }
+  template <typename T = F2fsIgetFtraceEvent> T* set_f2fs_iget() {
+    return BeginNestedMessage<T>(248);
+  }
+
+
+  using FieldMetadata_F2fsIgetExit =
+    ::protozero::proto_utils::FieldMetadata<
+      249,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsIgetExitFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsIgetExit kF2fsIgetExit() { return {}; }
+  template <typename T = F2fsIgetExitFtraceEvent> T* set_f2fs_iget_exit() {
+    return BeginNestedMessage<T>(249);
+  }
+
+
+  using FieldMetadata_F2fsNewInode =
+    ::protozero::proto_utils::FieldMetadata<
+      250,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsNewInodeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsNewInode kF2fsNewInode() { return {}; }
+  template <typename T = F2fsNewInodeFtraceEvent> T* set_f2fs_new_inode() {
+    return BeginNestedMessage<T>(250);
+  }
+
+
+  using FieldMetadata_F2fsReadpage =
+    ::protozero::proto_utils::FieldMetadata<
+      251,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsReadpageFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsReadpage kF2fsReadpage() { return {}; }
+  template <typename T = F2fsReadpageFtraceEvent> T* set_f2fs_readpage() {
+    return BeginNestedMessage<T>(251);
+  }
+
+
+  using FieldMetadata_F2fsReserveNewBlock =
+    ::protozero::proto_utils::FieldMetadata<
+      252,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsReserveNewBlockFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsReserveNewBlock kF2fsReserveNewBlock() { return {}; }
+  template <typename T = F2fsReserveNewBlockFtraceEvent> T* set_f2fs_reserve_new_block() {
+    return BeginNestedMessage<T>(252);
+  }
+
+
+  using FieldMetadata_F2fsSetPageDirty =
+    ::protozero::proto_utils::FieldMetadata<
+      253,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsSetPageDirtyFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsSetPageDirty kF2fsSetPageDirty() { return {}; }
+  template <typename T = F2fsSetPageDirtyFtraceEvent> T* set_f2fs_set_page_dirty() {
+    return BeginNestedMessage<T>(253);
+  }
+
+
+  using FieldMetadata_F2fsSubmitWritePage =
+    ::protozero::proto_utils::FieldMetadata<
+      254,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsSubmitWritePageFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsSubmitWritePage kF2fsSubmitWritePage() { return {}; }
+  template <typename T = F2fsSubmitWritePageFtraceEvent> T* set_f2fs_submit_write_page() {
+    return BeginNestedMessage<T>(254);
+  }
+
+
+  using FieldMetadata_F2fsSyncFileEnter =
+    ::protozero::proto_utils::FieldMetadata<
+      255,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsSyncFileEnterFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsSyncFileEnter kF2fsSyncFileEnter() { return {}; }
+  template <typename T = F2fsSyncFileEnterFtraceEvent> T* set_f2fs_sync_file_enter() {
+    return BeginNestedMessage<T>(255);
+  }
+
+
+  using FieldMetadata_F2fsSyncFileExit =
+    ::protozero::proto_utils::FieldMetadata<
+      256,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsSyncFileExitFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsSyncFileExit kF2fsSyncFileExit() { return {}; }
+  template <typename T = F2fsSyncFileExitFtraceEvent> T* set_f2fs_sync_file_exit() {
+    return BeginNestedMessage<T>(256);
+  }
+
+
+  using FieldMetadata_F2fsSyncFs =
+    ::protozero::proto_utils::FieldMetadata<
+      257,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsSyncFsFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsSyncFs kF2fsSyncFs() { return {}; }
+  template <typename T = F2fsSyncFsFtraceEvent> T* set_f2fs_sync_fs() {
+    return BeginNestedMessage<T>(257);
+  }
+
+
+  using FieldMetadata_F2fsTruncate =
+    ::protozero::proto_utils::FieldMetadata<
+      258,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsTruncateFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsTruncate kF2fsTruncate() { return {}; }
+  template <typename T = F2fsTruncateFtraceEvent> T* set_f2fs_truncate() {
+    return BeginNestedMessage<T>(258);
+  }
+
+
+  using FieldMetadata_F2fsTruncateBlocksEnter =
+    ::protozero::proto_utils::FieldMetadata<
+      259,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsTruncateBlocksEnterFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsTruncateBlocksEnter kF2fsTruncateBlocksEnter() { return {}; }
+  template <typename T = F2fsTruncateBlocksEnterFtraceEvent> T* set_f2fs_truncate_blocks_enter() {
+    return BeginNestedMessage<T>(259);
+  }
+
+
+  using FieldMetadata_F2fsTruncateBlocksExit =
+    ::protozero::proto_utils::FieldMetadata<
+      260,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsTruncateBlocksExitFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsTruncateBlocksExit kF2fsTruncateBlocksExit() { return {}; }
+  template <typename T = F2fsTruncateBlocksExitFtraceEvent> T* set_f2fs_truncate_blocks_exit() {
+    return BeginNestedMessage<T>(260);
+  }
+
+
+  using FieldMetadata_F2fsTruncateDataBlocksRange =
+    ::protozero::proto_utils::FieldMetadata<
+      261,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsTruncateDataBlocksRangeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsTruncateDataBlocksRange kF2fsTruncateDataBlocksRange() { return {}; }
+  template <typename T = F2fsTruncateDataBlocksRangeFtraceEvent> T* set_f2fs_truncate_data_blocks_range() {
+    return BeginNestedMessage<T>(261);
+  }
+
+
+  using FieldMetadata_F2fsTruncateInodeBlocksEnter =
+    ::protozero::proto_utils::FieldMetadata<
+      262,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsTruncateInodeBlocksEnterFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsTruncateInodeBlocksEnter kF2fsTruncateInodeBlocksEnter() { return {}; }
+  template <typename T = F2fsTruncateInodeBlocksEnterFtraceEvent> T* set_f2fs_truncate_inode_blocks_enter() {
+    return BeginNestedMessage<T>(262);
+  }
+
+
+  using FieldMetadata_F2fsTruncateInodeBlocksExit =
+    ::protozero::proto_utils::FieldMetadata<
+      263,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsTruncateInodeBlocksExitFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsTruncateInodeBlocksExit kF2fsTruncateInodeBlocksExit() { return {}; }
+  template <typename T = F2fsTruncateInodeBlocksExitFtraceEvent> T* set_f2fs_truncate_inode_blocks_exit() {
+    return BeginNestedMessage<T>(263);
+  }
+
+
+  using FieldMetadata_F2fsTruncateNode =
+    ::protozero::proto_utils::FieldMetadata<
+      264,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsTruncateNodeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsTruncateNode kF2fsTruncateNode() { return {}; }
+  template <typename T = F2fsTruncateNodeFtraceEvent> T* set_f2fs_truncate_node() {
+    return BeginNestedMessage<T>(264);
+  }
+
+
+  using FieldMetadata_F2fsTruncateNodesEnter =
+    ::protozero::proto_utils::FieldMetadata<
+      265,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsTruncateNodesEnterFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsTruncateNodesEnter kF2fsTruncateNodesEnter() { return {}; }
+  template <typename T = F2fsTruncateNodesEnterFtraceEvent> T* set_f2fs_truncate_nodes_enter() {
+    return BeginNestedMessage<T>(265);
+  }
+
+
+  using FieldMetadata_F2fsTruncateNodesExit =
+    ::protozero::proto_utils::FieldMetadata<
+      266,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsTruncateNodesExitFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsTruncateNodesExit kF2fsTruncateNodesExit() { return {}; }
+  template <typename T = F2fsTruncateNodesExitFtraceEvent> T* set_f2fs_truncate_nodes_exit() {
+    return BeginNestedMessage<T>(266);
+  }
+
+
+  using FieldMetadata_F2fsTruncatePartialNodes =
+    ::protozero::proto_utils::FieldMetadata<
+      267,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsTruncatePartialNodesFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsTruncatePartialNodes kF2fsTruncatePartialNodes() { return {}; }
+  template <typename T = F2fsTruncatePartialNodesFtraceEvent> T* set_f2fs_truncate_partial_nodes() {
+    return BeginNestedMessage<T>(267);
+  }
+
+
+  using FieldMetadata_F2fsUnlinkEnter =
+    ::protozero::proto_utils::FieldMetadata<
+      268,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsUnlinkEnterFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsUnlinkEnter kF2fsUnlinkEnter() { return {}; }
+  template <typename T = F2fsUnlinkEnterFtraceEvent> T* set_f2fs_unlink_enter() {
+    return BeginNestedMessage<T>(268);
+  }
+
+
+  using FieldMetadata_F2fsUnlinkExit =
+    ::protozero::proto_utils::FieldMetadata<
+      269,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsUnlinkExitFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsUnlinkExit kF2fsUnlinkExit() { return {}; }
+  template <typename T = F2fsUnlinkExitFtraceEvent> T* set_f2fs_unlink_exit() {
+    return BeginNestedMessage<T>(269);
+  }
+
+
+  using FieldMetadata_F2fsVmPageMkwrite =
+    ::protozero::proto_utils::FieldMetadata<
+      270,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsVmPageMkwriteFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsVmPageMkwrite kF2fsVmPageMkwrite() { return {}; }
+  template <typename T = F2fsVmPageMkwriteFtraceEvent> T* set_f2fs_vm_page_mkwrite() {
+    return BeginNestedMessage<T>(270);
+  }
+
+
+  using FieldMetadata_F2fsWriteBegin =
+    ::protozero::proto_utils::FieldMetadata<
+      271,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsWriteBeginFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsWriteBegin kF2fsWriteBegin() { return {}; }
+  template <typename T = F2fsWriteBeginFtraceEvent> T* set_f2fs_write_begin() {
+    return BeginNestedMessage<T>(271);
+  }
+
+
+  using FieldMetadata_F2fsWriteCheckpoint =
+    ::protozero::proto_utils::FieldMetadata<
+      272,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsWriteCheckpointFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsWriteCheckpoint kF2fsWriteCheckpoint() { return {}; }
+  template <typename T = F2fsWriteCheckpointFtraceEvent> T* set_f2fs_write_checkpoint() {
+    return BeginNestedMessage<T>(272);
+  }
+
+
+  using FieldMetadata_F2fsWriteEnd =
+    ::protozero::proto_utils::FieldMetadata<
+      273,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      F2fsWriteEndFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_F2fsWriteEnd kF2fsWriteEnd() { return {}; }
+  template <typename T = F2fsWriteEndFtraceEvent> T* set_f2fs_write_end() {
+    return BeginNestedMessage<T>(273);
+  }
+
+
+  using FieldMetadata_AllocPagesIommuEnd =
+    ::protozero::proto_utils::FieldMetadata<
+      274,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      AllocPagesIommuEndFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AllocPagesIommuEnd kAllocPagesIommuEnd() { return {}; }
+  template <typename T = AllocPagesIommuEndFtraceEvent> T* set_alloc_pages_iommu_end() {
+    return BeginNestedMessage<T>(274);
+  }
+
+
+  using FieldMetadata_AllocPagesIommuFail =
+    ::protozero::proto_utils::FieldMetadata<
+      275,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      AllocPagesIommuFailFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AllocPagesIommuFail kAllocPagesIommuFail() { return {}; }
+  template <typename T = AllocPagesIommuFailFtraceEvent> T* set_alloc_pages_iommu_fail() {
+    return BeginNestedMessage<T>(275);
+  }
+
+
+  using FieldMetadata_AllocPagesIommuStart =
+    ::protozero::proto_utils::FieldMetadata<
+      276,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      AllocPagesIommuStartFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AllocPagesIommuStart kAllocPagesIommuStart() { return {}; }
+  template <typename T = AllocPagesIommuStartFtraceEvent> T* set_alloc_pages_iommu_start() {
+    return BeginNestedMessage<T>(276);
+  }
+
+
+  using FieldMetadata_AllocPagesSysEnd =
+    ::protozero::proto_utils::FieldMetadata<
+      277,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      AllocPagesSysEndFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AllocPagesSysEnd kAllocPagesSysEnd() { return {}; }
+  template <typename T = AllocPagesSysEndFtraceEvent> T* set_alloc_pages_sys_end() {
+    return BeginNestedMessage<T>(277);
+  }
+
+
+  using FieldMetadata_AllocPagesSysFail =
+    ::protozero::proto_utils::FieldMetadata<
+      278,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      AllocPagesSysFailFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AllocPagesSysFail kAllocPagesSysFail() { return {}; }
+  template <typename T = AllocPagesSysFailFtraceEvent> T* set_alloc_pages_sys_fail() {
+    return BeginNestedMessage<T>(278);
+  }
+
+
+  using FieldMetadata_AllocPagesSysStart =
+    ::protozero::proto_utils::FieldMetadata<
+      279,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      AllocPagesSysStartFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AllocPagesSysStart kAllocPagesSysStart() { return {}; }
+  template <typename T = AllocPagesSysStartFtraceEvent> T* set_alloc_pages_sys_start() {
+    return BeginNestedMessage<T>(279);
+  }
+
+
+  using FieldMetadata_DmaAllocContiguousRetry =
+    ::protozero::proto_utils::FieldMetadata<
+      280,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      DmaAllocContiguousRetryFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DmaAllocContiguousRetry kDmaAllocContiguousRetry() { return {}; }
+  template <typename T = DmaAllocContiguousRetryFtraceEvent> T* set_dma_alloc_contiguous_retry() {
+    return BeginNestedMessage<T>(280);
+  }
+
+
+  using FieldMetadata_IommuMapRange =
+    ::protozero::proto_utils::FieldMetadata<
+      281,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      IommuMapRangeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IommuMapRange kIommuMapRange() { return {}; }
+  template <typename T = IommuMapRangeFtraceEvent> T* set_iommu_map_range() {
+    return BeginNestedMessage<T>(281);
+  }
+
+
+  using FieldMetadata_IommuSecPtblMapRangeEnd =
+    ::protozero::proto_utils::FieldMetadata<
+      282,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      IommuSecPtblMapRangeEndFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IommuSecPtblMapRangeEnd kIommuSecPtblMapRangeEnd() { return {}; }
+  template <typename T = IommuSecPtblMapRangeEndFtraceEvent> T* set_iommu_sec_ptbl_map_range_end() {
+    return BeginNestedMessage<T>(282);
+  }
+
+
+  using FieldMetadata_IommuSecPtblMapRangeStart =
+    ::protozero::proto_utils::FieldMetadata<
+      283,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      IommuSecPtblMapRangeStartFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IommuSecPtblMapRangeStart kIommuSecPtblMapRangeStart() { return {}; }
+  template <typename T = IommuSecPtblMapRangeStartFtraceEvent> T* set_iommu_sec_ptbl_map_range_start() {
+    return BeginNestedMessage<T>(283);
+  }
+
+
+  using FieldMetadata_IonAllocBufferEnd =
+    ::protozero::proto_utils::FieldMetadata<
+      284,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      IonAllocBufferEndFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IonAllocBufferEnd kIonAllocBufferEnd() { return {}; }
+  template <typename T = IonAllocBufferEndFtraceEvent> T* set_ion_alloc_buffer_end() {
+    return BeginNestedMessage<T>(284);
+  }
+
+
+  using FieldMetadata_IonAllocBufferFail =
+    ::protozero::proto_utils::FieldMetadata<
+      285,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      IonAllocBufferFailFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IonAllocBufferFail kIonAllocBufferFail() { return {}; }
+  template <typename T = IonAllocBufferFailFtraceEvent> T* set_ion_alloc_buffer_fail() {
+    return BeginNestedMessage<T>(285);
+  }
+
+
+  using FieldMetadata_IonAllocBufferFallback =
+    ::protozero::proto_utils::FieldMetadata<
+      286,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      IonAllocBufferFallbackFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IonAllocBufferFallback kIonAllocBufferFallback() { return {}; }
+  template <typename T = IonAllocBufferFallbackFtraceEvent> T* set_ion_alloc_buffer_fallback() {
+    return BeginNestedMessage<T>(286);
+  }
+
+
+  using FieldMetadata_IonAllocBufferStart =
+    ::protozero::proto_utils::FieldMetadata<
+      287,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      IonAllocBufferStartFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IonAllocBufferStart kIonAllocBufferStart() { return {}; }
+  template <typename T = IonAllocBufferStartFtraceEvent> T* set_ion_alloc_buffer_start() {
+    return BeginNestedMessage<T>(287);
+  }
+
+
+  using FieldMetadata_IonCpAllocRetry =
+    ::protozero::proto_utils::FieldMetadata<
+      288,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      IonCpAllocRetryFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IonCpAllocRetry kIonCpAllocRetry() { return {}; }
+  template <typename T = IonCpAllocRetryFtraceEvent> T* set_ion_cp_alloc_retry() {
+    return BeginNestedMessage<T>(288);
+  }
+
+
+  using FieldMetadata_IonCpSecureBufferEnd =
+    ::protozero::proto_utils::FieldMetadata<
+      289,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      IonCpSecureBufferEndFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IonCpSecureBufferEnd kIonCpSecureBufferEnd() { return {}; }
+  template <typename T = IonCpSecureBufferEndFtraceEvent> T* set_ion_cp_secure_buffer_end() {
+    return BeginNestedMessage<T>(289);
+  }
+
+
+  using FieldMetadata_IonCpSecureBufferStart =
+    ::protozero::proto_utils::FieldMetadata<
+      290,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      IonCpSecureBufferStartFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IonCpSecureBufferStart kIonCpSecureBufferStart() { return {}; }
+  template <typename T = IonCpSecureBufferStartFtraceEvent> T* set_ion_cp_secure_buffer_start() {
+    return BeginNestedMessage<T>(290);
+  }
+
+
+  using FieldMetadata_IonPrefetching =
+    ::protozero::proto_utils::FieldMetadata<
+      291,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      IonPrefetchingFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IonPrefetching kIonPrefetching() { return {}; }
+  template <typename T = IonPrefetchingFtraceEvent> T* set_ion_prefetching() {
+    return BeginNestedMessage<T>(291);
+  }
+
+
+  using FieldMetadata_IonSecureCmaAddToPoolEnd =
+    ::protozero::proto_utils::FieldMetadata<
+      292,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      IonSecureCmaAddToPoolEndFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IonSecureCmaAddToPoolEnd kIonSecureCmaAddToPoolEnd() { return {}; }
+  template <typename T = IonSecureCmaAddToPoolEndFtraceEvent> T* set_ion_secure_cma_add_to_pool_end() {
+    return BeginNestedMessage<T>(292);
+  }
+
+
+  using FieldMetadata_IonSecureCmaAddToPoolStart =
+    ::protozero::proto_utils::FieldMetadata<
+      293,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      IonSecureCmaAddToPoolStartFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IonSecureCmaAddToPoolStart kIonSecureCmaAddToPoolStart() { return {}; }
+  template <typename T = IonSecureCmaAddToPoolStartFtraceEvent> T* set_ion_secure_cma_add_to_pool_start() {
+    return BeginNestedMessage<T>(293);
+  }
+
+
+  using FieldMetadata_IonSecureCmaAllocateEnd =
+    ::protozero::proto_utils::FieldMetadata<
+      294,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      IonSecureCmaAllocateEndFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IonSecureCmaAllocateEnd kIonSecureCmaAllocateEnd() { return {}; }
+  template <typename T = IonSecureCmaAllocateEndFtraceEvent> T* set_ion_secure_cma_allocate_end() {
+    return BeginNestedMessage<T>(294);
+  }
+
+
+  using FieldMetadata_IonSecureCmaAllocateStart =
+    ::protozero::proto_utils::FieldMetadata<
+      295,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      IonSecureCmaAllocateStartFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IonSecureCmaAllocateStart kIonSecureCmaAllocateStart() { return {}; }
+  template <typename T = IonSecureCmaAllocateStartFtraceEvent> T* set_ion_secure_cma_allocate_start() {
+    return BeginNestedMessage<T>(295);
+  }
+
+
+  using FieldMetadata_IonSecureCmaShrinkPoolEnd =
+    ::protozero::proto_utils::FieldMetadata<
+      296,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      IonSecureCmaShrinkPoolEndFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IonSecureCmaShrinkPoolEnd kIonSecureCmaShrinkPoolEnd() { return {}; }
+  template <typename T = IonSecureCmaShrinkPoolEndFtraceEvent> T* set_ion_secure_cma_shrink_pool_end() {
+    return BeginNestedMessage<T>(296);
+  }
+
+
+  using FieldMetadata_IonSecureCmaShrinkPoolStart =
+    ::protozero::proto_utils::FieldMetadata<
+      297,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      IonSecureCmaShrinkPoolStartFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IonSecureCmaShrinkPoolStart kIonSecureCmaShrinkPoolStart() { return {}; }
+  template <typename T = IonSecureCmaShrinkPoolStartFtraceEvent> T* set_ion_secure_cma_shrink_pool_start() {
+    return BeginNestedMessage<T>(297);
+  }
+
+
+  using FieldMetadata_Kfree =
+    ::protozero::proto_utils::FieldMetadata<
+      298,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      KfreeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Kfree kKfree() { return {}; }
+  template <typename T = KfreeFtraceEvent> T* set_kfree() {
+    return BeginNestedMessage<T>(298);
+  }
+
+
+  using FieldMetadata_Kmalloc =
+    ::protozero::proto_utils::FieldMetadata<
+      299,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      KmallocFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Kmalloc kKmalloc() { return {}; }
+  template <typename T = KmallocFtraceEvent> T* set_kmalloc() {
+    return BeginNestedMessage<T>(299);
+  }
+
+
+  using FieldMetadata_KmallocNode =
+    ::protozero::proto_utils::FieldMetadata<
+      300,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      KmallocNodeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_KmallocNode kKmallocNode() { return {}; }
+  template <typename T = KmallocNodeFtraceEvent> T* set_kmalloc_node() {
+    return BeginNestedMessage<T>(300);
+  }
+
+
+  using FieldMetadata_KmemCacheAlloc =
+    ::protozero::proto_utils::FieldMetadata<
+      301,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      KmemCacheAllocFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_KmemCacheAlloc kKmemCacheAlloc() { return {}; }
+  template <typename T = KmemCacheAllocFtraceEvent> T* set_kmem_cache_alloc() {
+    return BeginNestedMessage<T>(301);
+  }
+
+
+  using FieldMetadata_KmemCacheAllocNode =
+    ::protozero::proto_utils::FieldMetadata<
+      302,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      KmemCacheAllocNodeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_KmemCacheAllocNode kKmemCacheAllocNode() { return {}; }
+  template <typename T = KmemCacheAllocNodeFtraceEvent> T* set_kmem_cache_alloc_node() {
+    return BeginNestedMessage<T>(302);
+  }
+
+
+  using FieldMetadata_KmemCacheFree =
+    ::protozero::proto_utils::FieldMetadata<
+      303,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      KmemCacheFreeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_KmemCacheFree kKmemCacheFree() { return {}; }
+  template <typename T = KmemCacheFreeFtraceEvent> T* set_kmem_cache_free() {
+    return BeginNestedMessage<T>(303);
+  }
+
+
+  using FieldMetadata_MigratePagesEnd =
+    ::protozero::proto_utils::FieldMetadata<
+      304,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MigratePagesEndFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MigratePagesEnd kMigratePagesEnd() { return {}; }
+  template <typename T = MigratePagesEndFtraceEvent> T* set_migrate_pages_end() {
+    return BeginNestedMessage<T>(304);
+  }
+
+
+  using FieldMetadata_MigratePagesStart =
+    ::protozero::proto_utils::FieldMetadata<
+      305,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MigratePagesStartFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MigratePagesStart kMigratePagesStart() { return {}; }
+  template <typename T = MigratePagesStartFtraceEvent> T* set_migrate_pages_start() {
+    return BeginNestedMessage<T>(305);
+  }
+
+
+  using FieldMetadata_MigrateRetry =
+    ::protozero::proto_utils::FieldMetadata<
+      306,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MigrateRetryFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MigrateRetry kMigrateRetry() { return {}; }
+  template <typename T = MigrateRetryFtraceEvent> T* set_migrate_retry() {
+    return BeginNestedMessage<T>(306);
+  }
+
+
+  using FieldMetadata_MmPageAlloc =
+    ::protozero::proto_utils::FieldMetadata<
+      307,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MmPageAllocFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MmPageAlloc kMmPageAlloc() { return {}; }
+  template <typename T = MmPageAllocFtraceEvent> T* set_mm_page_alloc() {
+    return BeginNestedMessage<T>(307);
+  }
+
+
+  using FieldMetadata_MmPageAllocExtfrag =
+    ::protozero::proto_utils::FieldMetadata<
+      308,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MmPageAllocExtfragFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MmPageAllocExtfrag kMmPageAllocExtfrag() { return {}; }
+  template <typename T = MmPageAllocExtfragFtraceEvent> T* set_mm_page_alloc_extfrag() {
+    return BeginNestedMessage<T>(308);
+  }
+
+
+  using FieldMetadata_MmPageAllocZoneLocked =
+    ::protozero::proto_utils::FieldMetadata<
+      309,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MmPageAllocZoneLockedFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MmPageAllocZoneLocked kMmPageAllocZoneLocked() { return {}; }
+  template <typename T = MmPageAllocZoneLockedFtraceEvent> T* set_mm_page_alloc_zone_locked() {
+    return BeginNestedMessage<T>(309);
+  }
+
+
+  using FieldMetadata_MmPageFree =
+    ::protozero::proto_utils::FieldMetadata<
+      310,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MmPageFreeFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MmPageFree kMmPageFree() { return {}; }
+  template <typename T = MmPageFreeFtraceEvent> T* set_mm_page_free() {
+    return BeginNestedMessage<T>(310);
+  }
+
+
+  using FieldMetadata_MmPageFreeBatched =
+    ::protozero::proto_utils::FieldMetadata<
+      311,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MmPageFreeBatchedFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MmPageFreeBatched kMmPageFreeBatched() { return {}; }
+  template <typename T = MmPageFreeBatchedFtraceEvent> T* set_mm_page_free_batched() {
+    return BeginNestedMessage<T>(311);
+  }
+
+
+  using FieldMetadata_MmPagePcpuDrain =
+    ::protozero::proto_utils::FieldMetadata<
+      312,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MmPagePcpuDrainFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MmPagePcpuDrain kMmPagePcpuDrain() { return {}; }
+  template <typename T = MmPagePcpuDrainFtraceEvent> T* set_mm_page_pcpu_drain() {
+    return BeginNestedMessage<T>(312);
+  }
+
+
+  using FieldMetadata_RssStat =
+    ::protozero::proto_utils::FieldMetadata<
+      313,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      RssStatFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RssStat kRssStat() { return {}; }
+  template <typename T = RssStatFtraceEvent> T* set_rss_stat() {
+    return BeginNestedMessage<T>(313);
+  }
+
+
+  using FieldMetadata_IonHeapShrink =
+    ::protozero::proto_utils::FieldMetadata<
+      314,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      IonHeapShrinkFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IonHeapShrink kIonHeapShrink() { return {}; }
+  template <typename T = IonHeapShrinkFtraceEvent> T* set_ion_heap_shrink() {
+    return BeginNestedMessage<T>(314);
+  }
+
+
+  using FieldMetadata_IonHeapGrow =
+    ::protozero::proto_utils::FieldMetadata<
+      315,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      IonHeapGrowFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IonHeapGrow kIonHeapGrow() { return {}; }
+  template <typename T = IonHeapGrowFtraceEvent> T* set_ion_heap_grow() {
+    return BeginNestedMessage<T>(315);
+  }
+
+
+  using FieldMetadata_FenceInit =
+    ::protozero::proto_utils::FieldMetadata<
+      316,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      FenceInitFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FenceInit kFenceInit() { return {}; }
+  template <typename T = FenceInitFtraceEvent> T* set_fence_init() {
+    return BeginNestedMessage<T>(316);
+  }
+
+
+  using FieldMetadata_FenceDestroy =
+    ::protozero::proto_utils::FieldMetadata<
+      317,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      FenceDestroyFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FenceDestroy kFenceDestroy() { return {}; }
+  template <typename T = FenceDestroyFtraceEvent> T* set_fence_destroy() {
+    return BeginNestedMessage<T>(317);
+  }
+
+
+  using FieldMetadata_FenceEnableSignal =
+    ::protozero::proto_utils::FieldMetadata<
+      318,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      FenceEnableSignalFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FenceEnableSignal kFenceEnableSignal() { return {}; }
+  template <typename T = FenceEnableSignalFtraceEvent> T* set_fence_enable_signal() {
+    return BeginNestedMessage<T>(318);
+  }
+
+
+  using FieldMetadata_FenceSignaled =
+    ::protozero::proto_utils::FieldMetadata<
+      319,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      FenceSignaledFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FenceSignaled kFenceSignaled() { return {}; }
+  template <typename T = FenceSignaledFtraceEvent> T* set_fence_signaled() {
+    return BeginNestedMessage<T>(319);
+  }
+
+
+  using FieldMetadata_ClkEnable =
+    ::protozero::proto_utils::FieldMetadata<
+      320,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ClkEnableFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ClkEnable kClkEnable() { return {}; }
+  template <typename T = ClkEnableFtraceEvent> T* set_clk_enable() {
+    return BeginNestedMessage<T>(320);
+  }
+
+
+  using FieldMetadata_ClkDisable =
+    ::protozero::proto_utils::FieldMetadata<
+      321,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ClkDisableFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ClkDisable kClkDisable() { return {}; }
+  template <typename T = ClkDisableFtraceEvent> T* set_clk_disable() {
+    return BeginNestedMessage<T>(321);
+  }
+
+
+  using FieldMetadata_ClkSetRate =
+    ::protozero::proto_utils::FieldMetadata<
+      322,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ClkSetRateFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ClkSetRate kClkSetRate() { return {}; }
+  template <typename T = ClkSetRateFtraceEvent> T* set_clk_set_rate() {
+    return BeginNestedMessage<T>(322);
+  }
+
+
+  using FieldMetadata_BinderTransactionAllocBuf =
+    ::protozero::proto_utils::FieldMetadata<
+      323,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BinderTransactionAllocBufFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BinderTransactionAllocBuf kBinderTransactionAllocBuf() { return {}; }
+  template <typename T = BinderTransactionAllocBufFtraceEvent> T* set_binder_transaction_alloc_buf() {
+    return BeginNestedMessage<T>(323);
+  }
+
+
+  using FieldMetadata_SignalDeliver =
+    ::protozero::proto_utils::FieldMetadata<
+      324,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SignalDeliverFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SignalDeliver kSignalDeliver() { return {}; }
+  template <typename T = SignalDeliverFtraceEvent> T* set_signal_deliver() {
+    return BeginNestedMessage<T>(324);
+  }
+
+
+  using FieldMetadata_SignalGenerate =
+    ::protozero::proto_utils::FieldMetadata<
+      325,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SignalGenerateFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SignalGenerate kSignalGenerate() { return {}; }
+  template <typename T = SignalGenerateFtraceEvent> T* set_signal_generate() {
+    return BeginNestedMessage<T>(325);
+  }
+
+
+  using FieldMetadata_OomScoreAdjUpdate =
+    ::protozero::proto_utils::FieldMetadata<
+      326,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      OomScoreAdjUpdateFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OomScoreAdjUpdate kOomScoreAdjUpdate() { return {}; }
+  template <typename T = OomScoreAdjUpdateFtraceEvent> T* set_oom_score_adj_update() {
+    return BeginNestedMessage<T>(326);
+  }
+
+
+  using FieldMetadata_Generic =
+    ::protozero::proto_utils::FieldMetadata<
+      327,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      GenericFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Generic kGeneric() { return {}; }
+  template <typename T = GenericFtraceEvent> T* set_generic() {
+    return BeginNestedMessage<T>(327);
+  }
+
+
+  using FieldMetadata_MmEventRecord =
+    ::protozero::proto_utils::FieldMetadata<
+      328,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MmEventRecordFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MmEventRecord kMmEventRecord() { return {}; }
+  template <typename T = MmEventRecordFtraceEvent> T* set_mm_event_record() {
+    return BeginNestedMessage<T>(328);
+  }
+
+
+  using FieldMetadata_SysEnter =
+    ::protozero::proto_utils::FieldMetadata<
+      329,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SysEnterFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SysEnter kSysEnter() { return {}; }
+  template <typename T = SysEnterFtraceEvent> T* set_sys_enter() {
+    return BeginNestedMessage<T>(329);
+  }
+
+
+  using FieldMetadata_SysExit =
+    ::protozero::proto_utils::FieldMetadata<
+      330,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SysExitFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SysExit kSysExit() { return {}; }
+  template <typename T = SysExitFtraceEvent> T* set_sys_exit() {
+    return BeginNestedMessage<T>(330);
+  }
+
+
+  using FieldMetadata_Zero =
+    ::protozero::proto_utils::FieldMetadata<
+      331,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ZeroFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Zero kZero() { return {}; }
+  template <typename T = ZeroFtraceEvent> T* set_zero() {
+    return BeginNestedMessage<T>(331);
+  }
+
+
+  using FieldMetadata_GpuFrequency =
+    ::protozero::proto_utils::FieldMetadata<
+      332,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      GpuFrequencyFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GpuFrequency kGpuFrequency() { return {}; }
+  template <typename T = GpuFrequencyFtraceEvent> T* set_gpu_frequency() {
+    return BeginNestedMessage<T>(332);
+  }
+
+
+  using FieldMetadata_SdeTracingMarkWrite =
+    ::protozero::proto_utils::FieldMetadata<
+      333,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SdeTracingMarkWriteFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SdeTracingMarkWrite kSdeTracingMarkWrite() { return {}; }
+  template <typename T = SdeTracingMarkWriteFtraceEvent> T* set_sde_tracing_mark_write() {
+    return BeginNestedMessage<T>(333);
+  }
+
+
+  using FieldMetadata_MarkVictim =
+    ::protozero::proto_utils::FieldMetadata<
+      334,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MarkVictimFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MarkVictim kMarkVictim() { return {}; }
+  template <typename T = MarkVictimFtraceEvent> T* set_mark_victim() {
+    return BeginNestedMessage<T>(334);
+  }
+
+
+  using FieldMetadata_IonStat =
+    ::protozero::proto_utils::FieldMetadata<
+      335,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      IonStatFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IonStat kIonStat() { return {}; }
+  template <typename T = IonStatFtraceEvent> T* set_ion_stat() {
+    return BeginNestedMessage<T>(335);
+  }
+
+
+  using FieldMetadata_IonBufferCreate =
+    ::protozero::proto_utils::FieldMetadata<
+      336,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      IonBufferCreateFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IonBufferCreate kIonBufferCreate() { return {}; }
+  template <typename T = IonBufferCreateFtraceEvent> T* set_ion_buffer_create() {
+    return BeginNestedMessage<T>(336);
+  }
+
+
+  using FieldMetadata_IonBufferDestroy =
+    ::protozero::proto_utils::FieldMetadata<
+      337,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      IonBufferDestroyFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IonBufferDestroy kIonBufferDestroy() { return {}; }
+  template <typename T = IonBufferDestroyFtraceEvent> T* set_ion_buffer_destroy() {
+    return BeginNestedMessage<T>(337);
+  }
+
+
+  using FieldMetadata_ScmCallStart =
+    ::protozero::proto_utils::FieldMetadata<
+      338,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ScmCallStartFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ScmCallStart kScmCallStart() { return {}; }
+  template <typename T = ScmCallStartFtraceEvent> T* set_scm_call_start() {
+    return BeginNestedMessage<T>(338);
+  }
+
+
+  using FieldMetadata_ScmCallEnd =
+    ::protozero::proto_utils::FieldMetadata<
+      339,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ScmCallEndFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ScmCallEnd kScmCallEnd() { return {}; }
+  template <typename T = ScmCallEndFtraceEvent> T* set_scm_call_end() {
+    return BeginNestedMessage<T>(339);
+  }
+
+
+  using FieldMetadata_GpuMemTotal =
+    ::protozero::proto_utils::FieldMetadata<
+      340,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      GpuMemTotalFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GpuMemTotal kGpuMemTotal() { return {}; }
+  template <typename T = GpuMemTotalFtraceEvent> T* set_gpu_mem_total() {
+    return BeginNestedMessage<T>(340);
+  }
+
+
+  using FieldMetadata_ThermalTemperature =
+    ::protozero::proto_utils::FieldMetadata<
+      341,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ThermalTemperatureFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ThermalTemperature kThermalTemperature() { return {}; }
+  template <typename T = ThermalTemperatureFtraceEvent> T* set_thermal_temperature() {
+    return BeginNestedMessage<T>(341);
+  }
+
+
+  using FieldMetadata_CdevUpdate =
+    ::protozero::proto_utils::FieldMetadata<
+      342,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      CdevUpdateFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CdevUpdate kCdevUpdate() { return {}; }
+  template <typename T = CdevUpdateFtraceEvent> T* set_cdev_update() {
+    return BeginNestedMessage<T>(342);
+  }
+
+
+  using FieldMetadata_CpuhpExit =
+    ::protozero::proto_utils::FieldMetadata<
+      343,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      CpuhpExitFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CpuhpExit kCpuhpExit() { return {}; }
+  template <typename T = CpuhpExitFtraceEvent> T* set_cpuhp_exit() {
+    return BeginNestedMessage<T>(343);
+  }
+
+
+  using FieldMetadata_CpuhpMultiEnter =
+    ::protozero::proto_utils::FieldMetadata<
+      344,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      CpuhpMultiEnterFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CpuhpMultiEnter kCpuhpMultiEnter() { return {}; }
+  template <typename T = CpuhpMultiEnterFtraceEvent> T* set_cpuhp_multi_enter() {
+    return BeginNestedMessage<T>(344);
+  }
+
+
+  using FieldMetadata_CpuhpEnter =
+    ::protozero::proto_utils::FieldMetadata<
+      345,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      CpuhpEnterFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CpuhpEnter kCpuhpEnter() { return {}; }
+  template <typename T = CpuhpEnterFtraceEvent> T* set_cpuhp_enter() {
+    return BeginNestedMessage<T>(345);
+  }
+
+
+  using FieldMetadata_CpuhpLatency =
+    ::protozero::proto_utils::FieldMetadata<
+      346,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      CpuhpLatencyFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CpuhpLatency kCpuhpLatency() { return {}; }
+  template <typename T = CpuhpLatencyFtraceEvent> T* set_cpuhp_latency() {
+    return BeginNestedMessage<T>(346);
+  }
+
+
+  using FieldMetadata_FastrpcDmaStat =
+    ::protozero::proto_utils::FieldMetadata<
+      347,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      FastrpcDmaStatFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FastrpcDmaStat kFastrpcDmaStat() { return {}; }
+  template <typename T = FastrpcDmaStatFtraceEvent> T* set_fastrpc_dma_stat() {
+    return BeginNestedMessage<T>(347);
+  }
+
+
+  using FieldMetadata_DpuTracingMarkWrite =
+    ::protozero::proto_utils::FieldMetadata<
+      348,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      DpuTracingMarkWriteFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DpuTracingMarkWrite kDpuTracingMarkWrite() { return {}; }
+  template <typename T = DpuTracingMarkWriteFtraceEvent> T* set_dpu_tracing_mark_write() {
+    return BeginNestedMessage<T>(348);
+  }
+
+
+  using FieldMetadata_G2dTracingMarkWrite =
+    ::protozero::proto_utils::FieldMetadata<
+      349,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      G2dTracingMarkWriteFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_G2dTracingMarkWrite kG2dTracingMarkWrite() { return {}; }
+  template <typename T = G2dTracingMarkWriteFtraceEvent> T* set_g2d_tracing_mark_write() {
+    return BeginNestedMessage<T>(349);
+  }
+
+
+  using FieldMetadata_MaliTracingMarkWrite =
+    ::protozero::proto_utils::FieldMetadata<
+      350,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MaliTracingMarkWriteFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MaliTracingMarkWrite kMaliTracingMarkWrite() { return {}; }
+  template <typename T = MaliTracingMarkWriteFtraceEvent> T* set_mali_tracing_mark_write() {
+    return BeginNestedMessage<T>(350);
+  }
+
+
+  using FieldMetadata_DmaHeapStat =
+    ::protozero::proto_utils::FieldMetadata<
+      351,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      DmaHeapStatFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DmaHeapStat kDmaHeapStat() { return {}; }
+  template <typename T = DmaHeapStatFtraceEvent> T* set_dma_heap_stat() {
+    return BeginNestedMessage<T>(351);
+  }
+
+
+  using FieldMetadata_CpuhpPause =
+    ::protozero::proto_utils::FieldMetadata<
+      352,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      CpuhpPauseFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CpuhpPause kCpuhpPause() { return {}; }
+  template <typename T = CpuhpPauseFtraceEvent> T* set_cpuhp_pause() {
+    return BeginNestedMessage<T>(352);
+  }
+
+
+  using FieldMetadata_SchedPiSetprio =
+    ::protozero::proto_utils::FieldMetadata<
+      353,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SchedPiSetprioFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SchedPiSetprio kSchedPiSetprio() { return {}; }
+  template <typename T = SchedPiSetprioFtraceEvent> T* set_sched_pi_setprio() {
+    return BeginNestedMessage<T>(353);
+  }
+
+
+  using FieldMetadata_SdeSdeEvtlog =
+    ::protozero::proto_utils::FieldMetadata<
+      354,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SdeSdeEvtlogFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SdeSdeEvtlog kSdeSdeEvtlog() { return {}; }
+  template <typename T = SdeSdeEvtlogFtraceEvent> T* set_sde_sde_evtlog() {
+    return BeginNestedMessage<T>(354);
+  }
+
+
+  using FieldMetadata_SdeSdePerfCalcCrtc =
+    ::protozero::proto_utils::FieldMetadata<
+      355,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SdeSdePerfCalcCrtcFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SdeSdePerfCalcCrtc kSdeSdePerfCalcCrtc() { return {}; }
+  template <typename T = SdeSdePerfCalcCrtcFtraceEvent> T* set_sde_sde_perf_calc_crtc() {
+    return BeginNestedMessage<T>(355);
+  }
+
+
+  using FieldMetadata_SdeSdePerfCrtcUpdate =
+    ::protozero::proto_utils::FieldMetadata<
+      356,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SdeSdePerfCrtcUpdateFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SdeSdePerfCrtcUpdate kSdeSdePerfCrtcUpdate() { return {}; }
+  template <typename T = SdeSdePerfCrtcUpdateFtraceEvent> T* set_sde_sde_perf_crtc_update() {
+    return BeginNestedMessage<T>(356);
+  }
+
+
+  using FieldMetadata_SdeSdePerfSetQosLuts =
+    ::protozero::proto_utils::FieldMetadata<
+      357,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SdeSdePerfSetQosLutsFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SdeSdePerfSetQosLuts kSdeSdePerfSetQosLuts() { return {}; }
+  template <typename T = SdeSdePerfSetQosLutsFtraceEvent> T* set_sde_sde_perf_set_qos_luts() {
+    return BeginNestedMessage<T>(357);
+  }
+
+
+  using FieldMetadata_SdeSdePerfUpdateBus =
+    ::protozero::proto_utils::FieldMetadata<
+      358,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SdeSdePerfUpdateBusFtraceEvent,
+      FtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SdeSdePerfUpdateBus kSdeSdePerfUpdateBus() { return {}; }
+  template <typename T = SdeSdePerfUpdateBusFtraceEvent> T* set_sde_sde_perf_update_bus() {
+    return BeginNestedMessage<T>(358);
+  }
+
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/ftrace_event_bundle.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_FTRACE_EVENT_BUNDLE_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_FTRACE_EVENT_BUNDLE_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class FtraceEvent;
+class FtraceEventBundle_CompactSched;
+
+class FtraceEventBundle_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  FtraceEventBundle_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit FtraceEventBundle_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit FtraceEventBundle_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_cpu() const { return at<1>().valid(); }
+  uint32_t cpu() const { return at<1>().as_uint32(); }
+  bool has_event() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> event() const { return GetRepeated<::protozero::ConstBytes>(2); }
+  bool has_lost_events() const { return at<3>().valid(); }
+  bool lost_events() const { return at<3>().as_bool(); }
+  bool has_compact_sched() const { return at<4>().valid(); }
+  ::protozero::ConstBytes compact_sched() const { return at<4>().as_bytes(); }
+};
+
+class FtraceEventBundle : public ::protozero::Message {
+ public:
+  using Decoder = FtraceEventBundle_Decoder;
+  enum : int32_t {
+    kCpuFieldNumber = 1,
+    kEventFieldNumber = 2,
+    kLostEventsFieldNumber = 3,
+    kCompactSchedFieldNumber = 4,
+  };
+  using CompactSched = ::perfetto::protos::pbzero::FtraceEventBundle_CompactSched;
+
+  using FieldMetadata_Cpu =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      FtraceEventBundle>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cpu kCpu() { return {}; }
+  void set_cpu(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cpu::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Event =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      FtraceEvent,
+      FtraceEventBundle>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Event kEvent() { return {}; }
+  template <typename T = FtraceEvent> T* add_event() {
+    return BeginNestedMessage<T>(2);
+  }
+
+
+  using FieldMetadata_LostEvents =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      FtraceEventBundle>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LostEvents kLostEvents() { return {}; }
+  void set_lost_events(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_LostEvents::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CompactSched =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      FtraceEventBundle_CompactSched,
+      FtraceEventBundle>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CompactSched kCompactSched() { return {}; }
+  template <typename T = FtraceEventBundle_CompactSched> T* set_compact_sched() {
+    return BeginNestedMessage<T>(4);
+  }
+
+};
+
+class FtraceEventBundle_CompactSched_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/11, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  FtraceEventBundle_CompactSched_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit FtraceEventBundle_CompactSched_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit FtraceEventBundle_CompactSched_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_intern_table() const { return at<5>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> intern_table() const { return GetRepeated<::protozero::ConstChars>(5); }
+  bool has_switch_timestamp() const { return at<1>().valid(); }
+  ::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t> switch_timestamp(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t>(1, parse_error_ptr); }
+  bool has_switch_prev_state() const { return at<2>().valid(); }
+  ::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, int64_t> switch_prev_state(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, int64_t>(2, parse_error_ptr); }
+  bool has_switch_next_pid() const { return at<3>().valid(); }
+  ::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, int32_t> switch_next_pid(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, int32_t>(3, parse_error_ptr); }
+  bool has_switch_next_prio() const { return at<4>().valid(); }
+  ::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, int32_t> switch_next_prio(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, int32_t>(4, parse_error_ptr); }
+  bool has_switch_next_comm_index() const { return at<6>().valid(); }
+  ::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, uint32_t> switch_next_comm_index(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, uint32_t>(6, parse_error_ptr); }
+  bool has_waking_timestamp() const { return at<7>().valid(); }
+  ::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t> waking_timestamp(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t>(7, parse_error_ptr); }
+  bool has_waking_pid() const { return at<8>().valid(); }
+  ::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, int32_t> waking_pid(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, int32_t>(8, parse_error_ptr); }
+  bool has_waking_target_cpu() const { return at<9>().valid(); }
+  ::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, int32_t> waking_target_cpu(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, int32_t>(9, parse_error_ptr); }
+  bool has_waking_prio() const { return at<10>().valid(); }
+  ::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, int32_t> waking_prio(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, int32_t>(10, parse_error_ptr); }
+  bool has_waking_comm_index() const { return at<11>().valid(); }
+  ::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, uint32_t> waking_comm_index(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, uint32_t>(11, parse_error_ptr); }
+};
+
+class FtraceEventBundle_CompactSched : public ::protozero::Message {
+ public:
+  using Decoder = FtraceEventBundle_CompactSched_Decoder;
+  enum : int32_t {
+    kInternTableFieldNumber = 5,
+    kSwitchTimestampFieldNumber = 1,
+    kSwitchPrevStateFieldNumber = 2,
+    kSwitchNextPidFieldNumber = 3,
+    kSwitchNextPrioFieldNumber = 4,
+    kSwitchNextCommIndexFieldNumber = 6,
+    kWakingTimestampFieldNumber = 7,
+    kWakingPidFieldNumber = 8,
+    kWakingTargetCpuFieldNumber = 9,
+    kWakingPrioFieldNumber = 10,
+    kWakingCommIndexFieldNumber = 11,
+  };
+
+  using FieldMetadata_InternTable =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      FtraceEventBundle_CompactSched>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_InternTable kInternTable() { return {}; }
+  void add_intern_table(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_InternTable::kFieldId, data, size);
+  }
+  void add_intern_table(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_InternTable::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SwitchTimestamp =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      FtraceEventBundle_CompactSched>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SwitchTimestamp kSwitchTimestamp() { return {}; }
+  void set_switch_timestamp(const ::protozero::PackedVarInt& packed_buffer) {
+    AppendBytes(FieldMetadata_SwitchTimestamp::kFieldId, packed_buffer.data(),
+                packed_buffer.size());
+  }
+
+  using FieldMetadata_SwitchPrevState =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      FtraceEventBundle_CompactSched>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SwitchPrevState kSwitchPrevState() { return {}; }
+  void set_switch_prev_state(const ::protozero::PackedVarInt& packed_buffer) {
+    AppendBytes(FieldMetadata_SwitchPrevState::kFieldId, packed_buffer.data(),
+                packed_buffer.size());
+  }
+
+  using FieldMetadata_SwitchNextPid =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      FtraceEventBundle_CompactSched>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SwitchNextPid kSwitchNextPid() { return {}; }
+  void set_switch_next_pid(const ::protozero::PackedVarInt& packed_buffer) {
+    AppendBytes(FieldMetadata_SwitchNextPid::kFieldId, packed_buffer.data(),
+                packed_buffer.size());
+  }
+
+  using FieldMetadata_SwitchNextPrio =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kRepeatedPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      FtraceEventBundle_CompactSched>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SwitchNextPrio kSwitchNextPrio() { return {}; }
+  void set_switch_next_prio(const ::protozero::PackedVarInt& packed_buffer) {
+    AppendBytes(FieldMetadata_SwitchNextPrio::kFieldId, packed_buffer.data(),
+                packed_buffer.size());
+  }
+
+  using FieldMetadata_SwitchNextCommIndex =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kRepeatedPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      FtraceEventBundle_CompactSched>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SwitchNextCommIndex kSwitchNextCommIndex() { return {}; }
+  void set_switch_next_comm_index(const ::protozero::PackedVarInt& packed_buffer) {
+    AppendBytes(FieldMetadata_SwitchNextCommIndex::kFieldId, packed_buffer.data(),
+                packed_buffer.size());
+  }
+
+  using FieldMetadata_WakingTimestamp =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kRepeatedPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      FtraceEventBundle_CompactSched>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_WakingTimestamp kWakingTimestamp() { return {}; }
+  void set_waking_timestamp(const ::protozero::PackedVarInt& packed_buffer) {
+    AppendBytes(FieldMetadata_WakingTimestamp::kFieldId, packed_buffer.data(),
+                packed_buffer.size());
+  }
+
+  using FieldMetadata_WakingPid =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kRepeatedPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      FtraceEventBundle_CompactSched>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_WakingPid kWakingPid() { return {}; }
+  void set_waking_pid(const ::protozero::PackedVarInt& packed_buffer) {
+    AppendBytes(FieldMetadata_WakingPid::kFieldId, packed_buffer.data(),
+                packed_buffer.size());
+  }
+
+  using FieldMetadata_WakingTargetCpu =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kRepeatedPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      FtraceEventBundle_CompactSched>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_WakingTargetCpu kWakingTargetCpu() { return {}; }
+  void set_waking_target_cpu(const ::protozero::PackedVarInt& packed_buffer) {
+    AppendBytes(FieldMetadata_WakingTargetCpu::kFieldId, packed_buffer.data(),
+                packed_buffer.size());
+  }
+
+  using FieldMetadata_WakingPrio =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kRepeatedPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      FtraceEventBundle_CompactSched>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_WakingPrio kWakingPrio() { return {}; }
+  void set_waking_prio(const ::protozero::PackedVarInt& packed_buffer) {
+    AppendBytes(FieldMetadata_WakingPrio::kFieldId, packed_buffer.data(),
+                packed_buffer.size());
+  }
+
+  using FieldMetadata_WakingCommIndex =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kRepeatedPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      FtraceEventBundle_CompactSched>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_WakingCommIndex kWakingCommIndex() { return {}; }
+  void set_waking_comm_index(const ::protozero::PackedVarInt& packed_buffer) {
+    AppendBytes(FieldMetadata_WakingCommIndex::kFieldId, packed_buffer.data(),
+                packed_buffer.size());
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/ftrace_stats.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_FTRACE_STATS_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_FTRACE_STATS_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class FtraceCpuStats;
+enum FtraceStats_Phase : int32_t;
+
+enum FtraceStats_Phase : int32_t {
+  FtraceStats_Phase_UNSPECIFIED = 0,
+  FtraceStats_Phase_START_OF_TRACE = 1,
+  FtraceStats_Phase_END_OF_TRACE = 2,
+};
+
+const FtraceStats_Phase FtraceStats_Phase_MIN = FtraceStats_Phase_UNSPECIFIED;
+const FtraceStats_Phase FtraceStats_Phase_MAX = FtraceStats_Phase_END_OF_TRACE;
+
+class FtraceStats_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  FtraceStats_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit FtraceStats_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit FtraceStats_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_phase() const { return at<1>().valid(); }
+  int32_t phase() const { return at<1>().as_int32(); }
+  bool has_cpu_stats() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> cpu_stats() const { return GetRepeated<::protozero::ConstBytes>(2); }
+  bool has_kernel_symbols_parsed() const { return at<3>().valid(); }
+  uint32_t kernel_symbols_parsed() const { return at<3>().as_uint32(); }
+  bool has_kernel_symbols_mem_kb() const { return at<4>().valid(); }
+  uint32_t kernel_symbols_mem_kb() const { return at<4>().as_uint32(); }
+};
+
+class FtraceStats : public ::protozero::Message {
+ public:
+  using Decoder = FtraceStats_Decoder;
+  enum : int32_t {
+    kPhaseFieldNumber = 1,
+    kCpuStatsFieldNumber = 2,
+    kKernelSymbolsParsedFieldNumber = 3,
+    kKernelSymbolsMemKbFieldNumber = 4,
+  };
+  using Phase = ::perfetto::protos::pbzero::FtraceStats_Phase;
+  static const Phase UNSPECIFIED = FtraceStats_Phase_UNSPECIFIED;
+  static const Phase START_OF_TRACE = FtraceStats_Phase_START_OF_TRACE;
+  static const Phase END_OF_TRACE = FtraceStats_Phase_END_OF_TRACE;
+
+  using FieldMetadata_Phase =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::FtraceStats_Phase,
+      FtraceStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Phase kPhase() { return {}; }
+  void set_phase(::perfetto::protos::pbzero::FtraceStats_Phase value) {
+    static constexpr uint32_t field_id = FieldMetadata_Phase::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CpuStats =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      FtraceCpuStats,
+      FtraceStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CpuStats kCpuStats() { return {}; }
+  template <typename T = FtraceCpuStats> T* add_cpu_stats() {
+    return BeginNestedMessage<T>(2);
+  }
+
+
+  using FieldMetadata_KernelSymbolsParsed =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      FtraceStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_KernelSymbolsParsed kKernelSymbolsParsed() { return {}; }
+  void set_kernel_symbols_parsed(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_KernelSymbolsParsed::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_KernelSymbolsMemKb =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      FtraceStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_KernelSymbolsMemKb kKernelSymbolsMemKb() { return {}; }
+  void set_kernel_symbols_mem_kb(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_KernelSymbolsMemKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class FtraceCpuStats_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/9, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  FtraceCpuStats_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit FtraceCpuStats_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit FtraceCpuStats_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_cpu() const { return at<1>().valid(); }
+  uint64_t cpu() const { return at<1>().as_uint64(); }
+  bool has_entries() const { return at<2>().valid(); }
+  uint64_t entries() const { return at<2>().as_uint64(); }
+  bool has_overrun() const { return at<3>().valid(); }
+  uint64_t overrun() const { return at<3>().as_uint64(); }
+  bool has_commit_overrun() const { return at<4>().valid(); }
+  uint64_t commit_overrun() const { return at<4>().as_uint64(); }
+  bool has_bytes_read() const { return at<5>().valid(); }
+  uint64_t bytes_read() const { return at<5>().as_uint64(); }
+  bool has_oldest_event_ts() const { return at<6>().valid(); }
+  double oldest_event_ts() const { return at<6>().as_double(); }
+  bool has_now_ts() const { return at<7>().valid(); }
+  double now_ts() const { return at<7>().as_double(); }
+  bool has_dropped_events() const { return at<8>().valid(); }
+  uint64_t dropped_events() const { return at<8>().as_uint64(); }
+  bool has_read_events() const { return at<9>().valid(); }
+  uint64_t read_events() const { return at<9>().as_uint64(); }
+};
+
+class FtraceCpuStats : public ::protozero::Message {
+ public:
+  using Decoder = FtraceCpuStats_Decoder;
+  enum : int32_t {
+    kCpuFieldNumber = 1,
+    kEntriesFieldNumber = 2,
+    kOverrunFieldNumber = 3,
+    kCommitOverrunFieldNumber = 4,
+    kBytesReadFieldNumber = 5,
+    kOldestEventTsFieldNumber = 6,
+    kNowTsFieldNumber = 7,
+    kDroppedEventsFieldNumber = 8,
+    kReadEventsFieldNumber = 9,
+  };
+
+  using FieldMetadata_Cpu =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      FtraceCpuStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cpu kCpu() { return {}; }
+  void set_cpu(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cpu::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Entries =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      FtraceCpuStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Entries kEntries() { return {}; }
+  void set_entries(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Entries::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Overrun =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      FtraceCpuStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Overrun kOverrun() { return {}; }
+  void set_overrun(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Overrun::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CommitOverrun =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      FtraceCpuStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CommitOverrun kCommitOverrun() { return {}; }
+  void set_commit_overrun(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CommitOverrun::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BytesRead =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      FtraceCpuStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BytesRead kBytesRead() { return {}; }
+  void set_bytes_read(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BytesRead::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OldestEventTs =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kDouble,
+      double,
+      FtraceCpuStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OldestEventTs kOldestEventTs() { return {}; }
+  void set_oldest_event_ts(double value) {
+    static constexpr uint32_t field_id = FieldMetadata_OldestEventTs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kDouble>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NowTs =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kDouble,
+      double,
+      FtraceCpuStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NowTs kNowTs() { return {}; }
+  void set_now_ts(double value) {
+    static constexpr uint32_t field_id = FieldMetadata_NowTs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kDouble>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DroppedEvents =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      FtraceCpuStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DroppedEvents kDroppedEvents() { return {}; }
+  void set_dropped_events(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DroppedEvents::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ReadEvents =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      FtraceCpuStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ReadEvents kReadEvents() { return {}; }
+  void set_read_events(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ReadEvents::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/test_bundle_wrapper.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_TEST_BUNDLE_WRAPPER_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_TEST_BUNDLE_WRAPPER_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class FtraceEventBundle;
+
+class TestBundleWrapper_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  TestBundleWrapper_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TestBundleWrapper_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TestBundleWrapper_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_before() const { return at<1>().valid(); }
+  ::protozero::ConstChars before() const { return at<1>().as_string(); }
+  bool has_bundle() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> bundle() const { return GetRepeated<::protozero::ConstBytes>(2); }
+  bool has_after() const { return at<3>().valid(); }
+  ::protozero::ConstChars after() const { return at<3>().as_string(); }
+};
+
+class TestBundleWrapper : public ::protozero::Message {
+ public:
+  using Decoder = TestBundleWrapper_Decoder;
+  enum : int32_t {
+    kBeforeFieldNumber = 1,
+    kBundleFieldNumber = 2,
+    kAfterFieldNumber = 3,
+  };
+
+  using FieldMetadata_Before =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TestBundleWrapper>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Before kBefore() { return {}; }
+  void set_before(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Before::kFieldId, data, size);
+  }
+  void set_before(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Before::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Bundle =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      FtraceEventBundle,
+      TestBundleWrapper>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Bundle kBundle() { return {}; }
+  template <typename T = FtraceEventBundle> T* add_bundle() {
+    return BeginNestedMessage<T>(2);
+  }
+
+
+  using FieldMetadata_After =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TestBundleWrapper>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_After kAfter() { return {}; }
+  void set_after(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_After::kFieldId, data, size);
+  }
+  void set_after(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_After::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/generic.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_GENERIC_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_GENERIC_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class GenericFtraceEvent_Field;
+
+class GenericFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  GenericFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit GenericFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit GenericFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_event_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars event_name() const { return at<1>().as_string(); }
+  bool has_field() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> field() const { return GetRepeated<::protozero::ConstBytes>(2); }
+};
+
+class GenericFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = GenericFtraceEvent_Decoder;
+  enum : int32_t {
+    kEventNameFieldNumber = 1,
+    kFieldFieldNumber = 2,
+  };
+  using Field = ::perfetto::protos::pbzero::GenericFtraceEvent_Field;
+
+  using FieldMetadata_EventName =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      GenericFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EventName kEventName() { return {}; }
+  void set_event_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_EventName::kFieldId, data, size);
+  }
+  void set_event_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_EventName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Field =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      GenericFtraceEvent_Field,
+      GenericFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Field kField() { return {}; }
+  template <typename T = GenericFtraceEvent_Field> T* add_field() {
+    return BeginNestedMessage<T>(2);
+  }
+
+};
+
+class GenericFtraceEvent_Field_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  GenericFtraceEvent_Field_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit GenericFtraceEvent_Field_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit GenericFtraceEvent_Field_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_str_value() const { return at<3>().valid(); }
+  ::protozero::ConstChars str_value() const { return at<3>().as_string(); }
+  bool has_int_value() const { return at<4>().valid(); }
+  int64_t int_value() const { return at<4>().as_int64(); }
+  bool has_uint_value() const { return at<5>().valid(); }
+  uint64_t uint_value() const { return at<5>().as_uint64(); }
+};
+
+class GenericFtraceEvent_Field : public ::protozero::Message {
+ public:
+  using Decoder = GenericFtraceEvent_Field_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kStrValueFieldNumber = 3,
+    kIntValueFieldNumber = 4,
+    kUintValueFieldNumber = 5,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      GenericFtraceEvent_Field>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_StrValue =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      GenericFtraceEvent_Field>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StrValue kStrValue() { return {}; }
+  void set_str_value(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_StrValue::kFieldId, data, size);
+  }
+  void set_str_value(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_StrValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IntValue =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      GenericFtraceEvent_Field>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IntValue kIntValue() { return {}; }
+  void set_int_value(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IntValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_UintValue =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      GenericFtraceEvent_Field>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UintValue kUintValue() { return {}; }
+  void set_uint_value(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_UintValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/binder.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_BINDER_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_BINDER_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class BinderTransactionAllocBufFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BinderTransactionAllocBufFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BinderTransactionAllocBufFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BinderTransactionAllocBufFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_data_size() const { return at<1>().valid(); }
+  uint64_t data_size() const { return at<1>().as_uint64(); }
+  bool has_debug_id() const { return at<2>().valid(); }
+  int32_t debug_id() const { return at<2>().as_int32(); }
+  bool has_offsets_size() const { return at<3>().valid(); }
+  uint64_t offsets_size() const { return at<3>().as_uint64(); }
+};
+
+class BinderTransactionAllocBufFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = BinderTransactionAllocBufFtraceEvent_Decoder;
+  enum : int32_t {
+    kDataSizeFieldNumber = 1,
+    kDebugIdFieldNumber = 2,
+    kOffsetsSizeFieldNumber = 3,
+  };
+
+  using FieldMetadata_DataSize =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BinderTransactionAllocBufFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DataSize kDataSize() { return {}; }
+  void set_data_size(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DataSize::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DebugId =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      BinderTransactionAllocBufFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DebugId kDebugId() { return {}; }
+  void set_debug_id(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DebugId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OffsetsSize =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BinderTransactionAllocBufFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OffsetsSize kOffsetsSize() { return {}; }
+  void set_offsets_size(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OffsetsSize::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class BinderUnlockFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BinderUnlockFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BinderUnlockFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BinderUnlockFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_tag() const { return at<1>().valid(); }
+  ::protozero::ConstChars tag() const { return at<1>().as_string(); }
+};
+
+class BinderUnlockFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = BinderUnlockFtraceEvent_Decoder;
+  enum : int32_t {
+    kTagFieldNumber = 1,
+  };
+
+  using FieldMetadata_Tag =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BinderUnlockFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Tag kTag() { return {}; }
+  void set_tag(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Tag::kFieldId, data, size);
+  }
+  void set_tag(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Tag::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class BinderLockedFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BinderLockedFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BinderLockedFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BinderLockedFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_tag() const { return at<1>().valid(); }
+  ::protozero::ConstChars tag() const { return at<1>().as_string(); }
+};
+
+class BinderLockedFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = BinderLockedFtraceEvent_Decoder;
+  enum : int32_t {
+    kTagFieldNumber = 1,
+  };
+
+  using FieldMetadata_Tag =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BinderLockedFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Tag kTag() { return {}; }
+  void set_tag(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Tag::kFieldId, data, size);
+  }
+  void set_tag(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Tag::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class BinderLockFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BinderLockFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BinderLockFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BinderLockFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_tag() const { return at<1>().valid(); }
+  ::protozero::ConstChars tag() const { return at<1>().as_string(); }
+};
+
+class BinderLockFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = BinderLockFtraceEvent_Decoder;
+  enum : int32_t {
+    kTagFieldNumber = 1,
+  };
+
+  using FieldMetadata_Tag =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BinderLockFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Tag kTag() { return {}; }
+  void set_tag(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Tag::kFieldId, data, size);
+  }
+  void set_tag(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Tag::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class BinderSetPriorityFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BinderSetPriorityFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BinderSetPriorityFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BinderSetPriorityFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_proc() const { return at<1>().valid(); }
+  int32_t proc() const { return at<1>().as_int32(); }
+  bool has_thread() const { return at<2>().valid(); }
+  int32_t thread() const { return at<2>().as_int32(); }
+  bool has_old_prio() const { return at<3>().valid(); }
+  uint32_t old_prio() const { return at<3>().as_uint32(); }
+  bool has_new_prio() const { return at<4>().valid(); }
+  uint32_t new_prio() const { return at<4>().as_uint32(); }
+  bool has_desired_prio() const { return at<5>().valid(); }
+  uint32_t desired_prio() const { return at<5>().as_uint32(); }
+};
+
+class BinderSetPriorityFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = BinderSetPriorityFtraceEvent_Decoder;
+  enum : int32_t {
+    kProcFieldNumber = 1,
+    kThreadFieldNumber = 2,
+    kOldPrioFieldNumber = 3,
+    kNewPrioFieldNumber = 4,
+    kDesiredPrioFieldNumber = 5,
+  };
+
+  using FieldMetadata_Proc =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      BinderSetPriorityFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Proc kProc() { return {}; }
+  void set_proc(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Proc::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Thread =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      BinderSetPriorityFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Thread kThread() { return {}; }
+  void set_thread(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Thread::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OldPrio =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      BinderSetPriorityFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OldPrio kOldPrio() { return {}; }
+  void set_old_prio(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OldPrio::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NewPrio =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      BinderSetPriorityFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NewPrio kNewPrio() { return {}; }
+  void set_new_prio(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NewPrio::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DesiredPrio =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      BinderSetPriorityFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DesiredPrio kDesiredPrio() { return {}; }
+  void set_desired_prio(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DesiredPrio::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class BinderTransactionReceivedFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BinderTransactionReceivedFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BinderTransactionReceivedFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BinderTransactionReceivedFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_debug_id() const { return at<1>().valid(); }
+  int32_t debug_id() const { return at<1>().as_int32(); }
+};
+
+class BinderTransactionReceivedFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = BinderTransactionReceivedFtraceEvent_Decoder;
+  enum : int32_t {
+    kDebugIdFieldNumber = 1,
+  };
+
+  using FieldMetadata_DebugId =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      BinderTransactionReceivedFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DebugId kDebugId() { return {}; }
+  void set_debug_id(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DebugId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class BinderTransactionFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BinderTransactionFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BinderTransactionFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BinderTransactionFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_debug_id() const { return at<1>().valid(); }
+  int32_t debug_id() const { return at<1>().as_int32(); }
+  bool has_target_node() const { return at<2>().valid(); }
+  int32_t target_node() const { return at<2>().as_int32(); }
+  bool has_to_proc() const { return at<3>().valid(); }
+  int32_t to_proc() const { return at<3>().as_int32(); }
+  bool has_to_thread() const { return at<4>().valid(); }
+  int32_t to_thread() const { return at<4>().as_int32(); }
+  bool has_reply() const { return at<5>().valid(); }
+  int32_t reply() const { return at<5>().as_int32(); }
+  bool has_code() const { return at<6>().valid(); }
+  uint32_t code() const { return at<6>().as_uint32(); }
+  bool has_flags() const { return at<7>().valid(); }
+  uint32_t flags() const { return at<7>().as_uint32(); }
+};
+
+class BinderTransactionFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = BinderTransactionFtraceEvent_Decoder;
+  enum : int32_t {
+    kDebugIdFieldNumber = 1,
+    kTargetNodeFieldNumber = 2,
+    kToProcFieldNumber = 3,
+    kToThreadFieldNumber = 4,
+    kReplyFieldNumber = 5,
+    kCodeFieldNumber = 6,
+    kFlagsFieldNumber = 7,
+  };
+
+  using FieldMetadata_DebugId =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      BinderTransactionFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DebugId kDebugId() { return {}; }
+  void set_debug_id(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DebugId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TargetNode =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      BinderTransactionFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TargetNode kTargetNode() { return {}; }
+  void set_target_node(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TargetNode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ToProc =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      BinderTransactionFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ToProc kToProc() { return {}; }
+  void set_to_proc(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ToProc::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ToThread =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      BinderTransactionFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ToThread kToThread() { return {}; }
+  void set_to_thread(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ToThread::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Reply =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      BinderTransactionFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Reply kReply() { return {}; }
+  void set_reply(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Reply::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Code =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      BinderTransactionFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Code kCode() { return {}; }
+  void set_code(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Code::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      BinderTransactionFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/block.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_BLOCK_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_BLOCK_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class BlockUnplugFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BlockUnplugFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BlockUnplugFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BlockUnplugFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_nr_rq() const { return at<1>().valid(); }
+  int32_t nr_rq() const { return at<1>().as_int32(); }
+  bool has_comm() const { return at<2>().valid(); }
+  ::protozero::ConstChars comm() const { return at<2>().as_string(); }
+};
+
+class BlockUnplugFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = BlockUnplugFtraceEvent_Decoder;
+  enum : int32_t {
+    kNrRqFieldNumber = 1,
+    kCommFieldNumber = 2,
+  };
+
+  using FieldMetadata_NrRq =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      BlockUnplugFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrRq kNrRq() { return {}; }
+  void set_nr_rq(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrRq::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Comm =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockUnplugFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Comm kComm() { return {}; }
+  void set_comm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Comm::kFieldId, data, size);
+  }
+  void set_comm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Comm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class BlockTouchBufferFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BlockTouchBufferFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BlockTouchBufferFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BlockTouchBufferFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_sector() const { return at<2>().valid(); }
+  uint64_t sector() const { return at<2>().as_uint64(); }
+  bool has_size() const { return at<3>().valid(); }
+  uint64_t size() const { return at<3>().as_uint64(); }
+};
+
+class BlockTouchBufferFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = BlockTouchBufferFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kSectorFieldNumber = 2,
+    kSizeFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockTouchBufferFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Sector =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockTouchBufferFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Sector kSector() { return {}; }
+  void set_sector(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Sector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Size =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockTouchBufferFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Size kSize() { return {}; }
+  void set_size(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Size::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class BlockSplitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BlockSplitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BlockSplitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BlockSplitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_sector() const { return at<2>().valid(); }
+  uint64_t sector() const { return at<2>().as_uint64(); }
+  bool has_new_sector() const { return at<3>().valid(); }
+  uint64_t new_sector() const { return at<3>().as_uint64(); }
+  bool has_rwbs() const { return at<4>().valid(); }
+  ::protozero::ConstChars rwbs() const { return at<4>().as_string(); }
+  bool has_comm() const { return at<5>().valid(); }
+  ::protozero::ConstChars comm() const { return at<5>().as_string(); }
+};
+
+class BlockSplitFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = BlockSplitFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kSectorFieldNumber = 2,
+    kNewSectorFieldNumber = 3,
+    kRwbsFieldNumber = 4,
+    kCommFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockSplitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Sector =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockSplitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Sector kSector() { return {}; }
+  void set_sector(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Sector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NewSector =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockSplitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NewSector kNewSector() { return {}; }
+  void set_new_sector(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NewSector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Rwbs =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockSplitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Rwbs kRwbs() { return {}; }
+  void set_rwbs(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Rwbs::kFieldId, data, size);
+  }
+  void set_rwbs(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Rwbs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Comm =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockSplitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Comm kComm() { return {}; }
+  void set_comm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Comm::kFieldId, data, size);
+  }
+  void set_comm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Comm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class BlockSleeprqFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BlockSleeprqFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BlockSleeprqFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BlockSleeprqFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_sector() const { return at<2>().valid(); }
+  uint64_t sector() const { return at<2>().as_uint64(); }
+  bool has_nr_sector() const { return at<3>().valid(); }
+  uint32_t nr_sector() const { return at<3>().as_uint32(); }
+  bool has_rwbs() const { return at<4>().valid(); }
+  ::protozero::ConstChars rwbs() const { return at<4>().as_string(); }
+  bool has_comm() const { return at<5>().valid(); }
+  ::protozero::ConstChars comm() const { return at<5>().as_string(); }
+};
+
+class BlockSleeprqFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = BlockSleeprqFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kSectorFieldNumber = 2,
+    kNrSectorFieldNumber = 3,
+    kRwbsFieldNumber = 4,
+    kCommFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockSleeprqFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Sector =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockSleeprqFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Sector kSector() { return {}; }
+  void set_sector(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Sector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NrSector =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      BlockSleeprqFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrSector kNrSector() { return {}; }
+  void set_nr_sector(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrSector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Rwbs =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockSleeprqFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Rwbs kRwbs() { return {}; }
+  void set_rwbs(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Rwbs::kFieldId, data, size);
+  }
+  void set_rwbs(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Rwbs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Comm =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockSleeprqFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Comm kComm() { return {}; }
+  void set_comm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Comm::kFieldId, data, size);
+  }
+  void set_comm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Comm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class BlockRqRequeueFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BlockRqRequeueFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BlockRqRequeueFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BlockRqRequeueFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_sector() const { return at<2>().valid(); }
+  uint64_t sector() const { return at<2>().as_uint64(); }
+  bool has_nr_sector() const { return at<3>().valid(); }
+  uint32_t nr_sector() const { return at<3>().as_uint32(); }
+  bool has_errors() const { return at<4>().valid(); }
+  int32_t errors() const { return at<4>().as_int32(); }
+  bool has_rwbs() const { return at<5>().valid(); }
+  ::protozero::ConstChars rwbs() const { return at<5>().as_string(); }
+  bool has_cmd() const { return at<6>().valid(); }
+  ::protozero::ConstChars cmd() const { return at<6>().as_string(); }
+};
+
+class BlockRqRequeueFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = BlockRqRequeueFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kSectorFieldNumber = 2,
+    kNrSectorFieldNumber = 3,
+    kErrorsFieldNumber = 4,
+    kRwbsFieldNumber = 5,
+    kCmdFieldNumber = 6,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockRqRequeueFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Sector =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockRqRequeueFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Sector kSector() { return {}; }
+  void set_sector(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Sector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NrSector =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      BlockRqRequeueFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrSector kNrSector() { return {}; }
+  void set_nr_sector(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrSector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Errors =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      BlockRqRequeueFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Errors kErrors() { return {}; }
+  void set_errors(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Errors::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Rwbs =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockRqRequeueFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Rwbs kRwbs() { return {}; }
+  void set_rwbs(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Rwbs::kFieldId, data, size);
+  }
+  void set_rwbs(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Rwbs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Cmd =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockRqRequeueFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cmd kCmd() { return {}; }
+  void set_cmd(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Cmd::kFieldId, data, size);
+  }
+  void set_cmd(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cmd::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class BlockRqRemapFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BlockRqRemapFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BlockRqRemapFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BlockRqRemapFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_sector() const { return at<2>().valid(); }
+  uint64_t sector() const { return at<2>().as_uint64(); }
+  bool has_nr_sector() const { return at<3>().valid(); }
+  uint32_t nr_sector() const { return at<3>().as_uint32(); }
+  bool has_old_dev() const { return at<4>().valid(); }
+  uint64_t old_dev() const { return at<4>().as_uint64(); }
+  bool has_old_sector() const { return at<5>().valid(); }
+  uint64_t old_sector() const { return at<5>().as_uint64(); }
+  bool has_nr_bios() const { return at<6>().valid(); }
+  uint32_t nr_bios() const { return at<6>().as_uint32(); }
+  bool has_rwbs() const { return at<7>().valid(); }
+  ::protozero::ConstChars rwbs() const { return at<7>().as_string(); }
+};
+
+class BlockRqRemapFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = BlockRqRemapFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kSectorFieldNumber = 2,
+    kNrSectorFieldNumber = 3,
+    kOldDevFieldNumber = 4,
+    kOldSectorFieldNumber = 5,
+    kNrBiosFieldNumber = 6,
+    kRwbsFieldNumber = 7,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockRqRemapFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Sector =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockRqRemapFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Sector kSector() { return {}; }
+  void set_sector(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Sector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NrSector =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      BlockRqRemapFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrSector kNrSector() { return {}; }
+  void set_nr_sector(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrSector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OldDev =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockRqRemapFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OldDev kOldDev() { return {}; }
+  void set_old_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OldDev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OldSector =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockRqRemapFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OldSector kOldSector() { return {}; }
+  void set_old_sector(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OldSector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NrBios =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      BlockRqRemapFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrBios kNrBios() { return {}; }
+  void set_nr_bios(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrBios::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Rwbs =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockRqRemapFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Rwbs kRwbs() { return {}; }
+  void set_rwbs(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Rwbs::kFieldId, data, size);
+  }
+  void set_rwbs(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Rwbs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class BlockRqInsertFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BlockRqInsertFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BlockRqInsertFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BlockRqInsertFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_sector() const { return at<2>().valid(); }
+  uint64_t sector() const { return at<2>().as_uint64(); }
+  bool has_nr_sector() const { return at<3>().valid(); }
+  uint32_t nr_sector() const { return at<3>().as_uint32(); }
+  bool has_bytes() const { return at<4>().valid(); }
+  uint32_t bytes() const { return at<4>().as_uint32(); }
+  bool has_rwbs() const { return at<5>().valid(); }
+  ::protozero::ConstChars rwbs() const { return at<5>().as_string(); }
+  bool has_comm() const { return at<6>().valid(); }
+  ::protozero::ConstChars comm() const { return at<6>().as_string(); }
+  bool has_cmd() const { return at<7>().valid(); }
+  ::protozero::ConstChars cmd() const { return at<7>().as_string(); }
+};
+
+class BlockRqInsertFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = BlockRqInsertFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kSectorFieldNumber = 2,
+    kNrSectorFieldNumber = 3,
+    kBytesFieldNumber = 4,
+    kRwbsFieldNumber = 5,
+    kCommFieldNumber = 6,
+    kCmdFieldNumber = 7,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockRqInsertFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Sector =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockRqInsertFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Sector kSector() { return {}; }
+  void set_sector(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Sector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NrSector =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      BlockRqInsertFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrSector kNrSector() { return {}; }
+  void set_nr_sector(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrSector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Bytes =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      BlockRqInsertFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Bytes kBytes() { return {}; }
+  void set_bytes(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Bytes::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Rwbs =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockRqInsertFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Rwbs kRwbs() { return {}; }
+  void set_rwbs(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Rwbs::kFieldId, data, size);
+  }
+  void set_rwbs(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Rwbs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Comm =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockRqInsertFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Comm kComm() { return {}; }
+  void set_comm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Comm::kFieldId, data, size);
+  }
+  void set_comm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Comm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Cmd =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockRqInsertFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cmd kCmd() { return {}; }
+  void set_cmd(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Cmd::kFieldId, data, size);
+  }
+  void set_cmd(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cmd::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class BlockRqCompleteFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BlockRqCompleteFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BlockRqCompleteFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BlockRqCompleteFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_sector() const { return at<2>().valid(); }
+  uint64_t sector() const { return at<2>().as_uint64(); }
+  bool has_nr_sector() const { return at<3>().valid(); }
+  uint32_t nr_sector() const { return at<3>().as_uint32(); }
+  bool has_errors() const { return at<4>().valid(); }
+  int32_t errors() const { return at<4>().as_int32(); }
+  bool has_rwbs() const { return at<5>().valid(); }
+  ::protozero::ConstChars rwbs() const { return at<5>().as_string(); }
+  bool has_cmd() const { return at<6>().valid(); }
+  ::protozero::ConstChars cmd() const { return at<6>().as_string(); }
+};
+
+class BlockRqCompleteFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = BlockRqCompleteFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kSectorFieldNumber = 2,
+    kNrSectorFieldNumber = 3,
+    kErrorsFieldNumber = 4,
+    kRwbsFieldNumber = 5,
+    kCmdFieldNumber = 6,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockRqCompleteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Sector =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockRqCompleteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Sector kSector() { return {}; }
+  void set_sector(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Sector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NrSector =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      BlockRqCompleteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrSector kNrSector() { return {}; }
+  void set_nr_sector(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrSector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Errors =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      BlockRqCompleteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Errors kErrors() { return {}; }
+  void set_errors(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Errors::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Rwbs =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockRqCompleteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Rwbs kRwbs() { return {}; }
+  void set_rwbs(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Rwbs::kFieldId, data, size);
+  }
+  void set_rwbs(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Rwbs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Cmd =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockRqCompleteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cmd kCmd() { return {}; }
+  void set_cmd(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Cmd::kFieldId, data, size);
+  }
+  void set_cmd(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cmd::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class BlockRqAbortFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BlockRqAbortFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BlockRqAbortFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BlockRqAbortFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_sector() const { return at<2>().valid(); }
+  uint64_t sector() const { return at<2>().as_uint64(); }
+  bool has_nr_sector() const { return at<3>().valid(); }
+  uint32_t nr_sector() const { return at<3>().as_uint32(); }
+  bool has_errors() const { return at<4>().valid(); }
+  int32_t errors() const { return at<4>().as_int32(); }
+  bool has_rwbs() const { return at<5>().valid(); }
+  ::protozero::ConstChars rwbs() const { return at<5>().as_string(); }
+  bool has_cmd() const { return at<6>().valid(); }
+  ::protozero::ConstChars cmd() const { return at<6>().as_string(); }
+};
+
+class BlockRqAbortFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = BlockRqAbortFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kSectorFieldNumber = 2,
+    kNrSectorFieldNumber = 3,
+    kErrorsFieldNumber = 4,
+    kRwbsFieldNumber = 5,
+    kCmdFieldNumber = 6,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockRqAbortFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Sector =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockRqAbortFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Sector kSector() { return {}; }
+  void set_sector(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Sector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NrSector =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      BlockRqAbortFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrSector kNrSector() { return {}; }
+  void set_nr_sector(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrSector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Errors =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      BlockRqAbortFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Errors kErrors() { return {}; }
+  void set_errors(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Errors::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Rwbs =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockRqAbortFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Rwbs kRwbs() { return {}; }
+  void set_rwbs(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Rwbs::kFieldId, data, size);
+  }
+  void set_rwbs(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Rwbs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Cmd =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockRqAbortFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cmd kCmd() { return {}; }
+  void set_cmd(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Cmd::kFieldId, data, size);
+  }
+  void set_cmd(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cmd::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class BlockPlugFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BlockPlugFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BlockPlugFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BlockPlugFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_comm() const { return at<1>().valid(); }
+  ::protozero::ConstChars comm() const { return at<1>().as_string(); }
+};
+
+class BlockPlugFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = BlockPlugFtraceEvent_Decoder;
+  enum : int32_t {
+    kCommFieldNumber = 1,
+  };
+
+  using FieldMetadata_Comm =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockPlugFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Comm kComm() { return {}; }
+  void set_comm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Comm::kFieldId, data, size);
+  }
+  void set_comm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Comm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class BlockGetrqFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BlockGetrqFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BlockGetrqFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BlockGetrqFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_sector() const { return at<2>().valid(); }
+  uint64_t sector() const { return at<2>().as_uint64(); }
+  bool has_nr_sector() const { return at<3>().valid(); }
+  uint32_t nr_sector() const { return at<3>().as_uint32(); }
+  bool has_rwbs() const { return at<4>().valid(); }
+  ::protozero::ConstChars rwbs() const { return at<4>().as_string(); }
+  bool has_comm() const { return at<5>().valid(); }
+  ::protozero::ConstChars comm() const { return at<5>().as_string(); }
+};
+
+class BlockGetrqFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = BlockGetrqFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kSectorFieldNumber = 2,
+    kNrSectorFieldNumber = 3,
+    kRwbsFieldNumber = 4,
+    kCommFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockGetrqFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Sector =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockGetrqFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Sector kSector() { return {}; }
+  void set_sector(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Sector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NrSector =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      BlockGetrqFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrSector kNrSector() { return {}; }
+  void set_nr_sector(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrSector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Rwbs =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockGetrqFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Rwbs kRwbs() { return {}; }
+  void set_rwbs(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Rwbs::kFieldId, data, size);
+  }
+  void set_rwbs(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Rwbs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Comm =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockGetrqFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Comm kComm() { return {}; }
+  void set_comm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Comm::kFieldId, data, size);
+  }
+  void set_comm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Comm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class BlockDirtyBufferFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BlockDirtyBufferFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BlockDirtyBufferFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BlockDirtyBufferFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_sector() const { return at<2>().valid(); }
+  uint64_t sector() const { return at<2>().as_uint64(); }
+  bool has_size() const { return at<3>().valid(); }
+  uint64_t size() const { return at<3>().as_uint64(); }
+};
+
+class BlockDirtyBufferFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = BlockDirtyBufferFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kSectorFieldNumber = 2,
+    kSizeFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockDirtyBufferFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Sector =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockDirtyBufferFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Sector kSector() { return {}; }
+  void set_sector(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Sector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Size =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockDirtyBufferFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Size kSize() { return {}; }
+  void set_size(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Size::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class BlockBioRemapFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BlockBioRemapFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BlockBioRemapFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BlockBioRemapFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_sector() const { return at<2>().valid(); }
+  uint64_t sector() const { return at<2>().as_uint64(); }
+  bool has_nr_sector() const { return at<3>().valid(); }
+  uint32_t nr_sector() const { return at<3>().as_uint32(); }
+  bool has_old_dev() const { return at<4>().valid(); }
+  uint64_t old_dev() const { return at<4>().as_uint64(); }
+  bool has_old_sector() const { return at<5>().valid(); }
+  uint64_t old_sector() const { return at<5>().as_uint64(); }
+  bool has_rwbs() const { return at<6>().valid(); }
+  ::protozero::ConstChars rwbs() const { return at<6>().as_string(); }
+};
+
+class BlockBioRemapFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = BlockBioRemapFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kSectorFieldNumber = 2,
+    kNrSectorFieldNumber = 3,
+    kOldDevFieldNumber = 4,
+    kOldSectorFieldNumber = 5,
+    kRwbsFieldNumber = 6,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockBioRemapFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Sector =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockBioRemapFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Sector kSector() { return {}; }
+  void set_sector(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Sector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NrSector =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      BlockBioRemapFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrSector kNrSector() { return {}; }
+  void set_nr_sector(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrSector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OldDev =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockBioRemapFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OldDev kOldDev() { return {}; }
+  void set_old_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OldDev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OldSector =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockBioRemapFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OldSector kOldSector() { return {}; }
+  void set_old_sector(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OldSector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Rwbs =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockBioRemapFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Rwbs kRwbs() { return {}; }
+  void set_rwbs(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Rwbs::kFieldId, data, size);
+  }
+  void set_rwbs(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Rwbs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class BlockBioQueueFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BlockBioQueueFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BlockBioQueueFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BlockBioQueueFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_sector() const { return at<2>().valid(); }
+  uint64_t sector() const { return at<2>().as_uint64(); }
+  bool has_nr_sector() const { return at<3>().valid(); }
+  uint32_t nr_sector() const { return at<3>().as_uint32(); }
+  bool has_rwbs() const { return at<4>().valid(); }
+  ::protozero::ConstChars rwbs() const { return at<4>().as_string(); }
+  bool has_comm() const { return at<5>().valid(); }
+  ::protozero::ConstChars comm() const { return at<5>().as_string(); }
+};
+
+class BlockBioQueueFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = BlockBioQueueFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kSectorFieldNumber = 2,
+    kNrSectorFieldNumber = 3,
+    kRwbsFieldNumber = 4,
+    kCommFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockBioQueueFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Sector =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockBioQueueFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Sector kSector() { return {}; }
+  void set_sector(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Sector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NrSector =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      BlockBioQueueFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrSector kNrSector() { return {}; }
+  void set_nr_sector(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrSector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Rwbs =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockBioQueueFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Rwbs kRwbs() { return {}; }
+  void set_rwbs(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Rwbs::kFieldId, data, size);
+  }
+  void set_rwbs(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Rwbs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Comm =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockBioQueueFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Comm kComm() { return {}; }
+  void set_comm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Comm::kFieldId, data, size);
+  }
+  void set_comm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Comm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class BlockBioFrontmergeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BlockBioFrontmergeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BlockBioFrontmergeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BlockBioFrontmergeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_sector() const { return at<2>().valid(); }
+  uint64_t sector() const { return at<2>().as_uint64(); }
+  bool has_nr_sector() const { return at<3>().valid(); }
+  uint32_t nr_sector() const { return at<3>().as_uint32(); }
+  bool has_rwbs() const { return at<4>().valid(); }
+  ::protozero::ConstChars rwbs() const { return at<4>().as_string(); }
+  bool has_comm() const { return at<5>().valid(); }
+  ::protozero::ConstChars comm() const { return at<5>().as_string(); }
+};
+
+class BlockBioFrontmergeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = BlockBioFrontmergeFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kSectorFieldNumber = 2,
+    kNrSectorFieldNumber = 3,
+    kRwbsFieldNumber = 4,
+    kCommFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockBioFrontmergeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Sector =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockBioFrontmergeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Sector kSector() { return {}; }
+  void set_sector(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Sector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NrSector =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      BlockBioFrontmergeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrSector kNrSector() { return {}; }
+  void set_nr_sector(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrSector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Rwbs =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockBioFrontmergeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Rwbs kRwbs() { return {}; }
+  void set_rwbs(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Rwbs::kFieldId, data, size);
+  }
+  void set_rwbs(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Rwbs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Comm =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockBioFrontmergeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Comm kComm() { return {}; }
+  void set_comm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Comm::kFieldId, data, size);
+  }
+  void set_comm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Comm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class BlockBioCompleteFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BlockBioCompleteFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BlockBioCompleteFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BlockBioCompleteFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_sector() const { return at<2>().valid(); }
+  uint64_t sector() const { return at<2>().as_uint64(); }
+  bool has_nr_sector() const { return at<3>().valid(); }
+  uint32_t nr_sector() const { return at<3>().as_uint32(); }
+  bool has_error() const { return at<4>().valid(); }
+  int32_t error() const { return at<4>().as_int32(); }
+  bool has_rwbs() const { return at<5>().valid(); }
+  ::protozero::ConstChars rwbs() const { return at<5>().as_string(); }
+};
+
+class BlockBioCompleteFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = BlockBioCompleteFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kSectorFieldNumber = 2,
+    kNrSectorFieldNumber = 3,
+    kErrorFieldNumber = 4,
+    kRwbsFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockBioCompleteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Sector =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockBioCompleteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Sector kSector() { return {}; }
+  void set_sector(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Sector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NrSector =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      BlockBioCompleteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrSector kNrSector() { return {}; }
+  void set_nr_sector(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrSector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Error =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      BlockBioCompleteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Error kError() { return {}; }
+  void set_error(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Error::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Rwbs =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockBioCompleteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Rwbs kRwbs() { return {}; }
+  void set_rwbs(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Rwbs::kFieldId, data, size);
+  }
+  void set_rwbs(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Rwbs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class BlockBioBounceFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BlockBioBounceFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BlockBioBounceFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BlockBioBounceFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_sector() const { return at<2>().valid(); }
+  uint64_t sector() const { return at<2>().as_uint64(); }
+  bool has_nr_sector() const { return at<3>().valid(); }
+  uint32_t nr_sector() const { return at<3>().as_uint32(); }
+  bool has_rwbs() const { return at<4>().valid(); }
+  ::protozero::ConstChars rwbs() const { return at<4>().as_string(); }
+  bool has_comm() const { return at<5>().valid(); }
+  ::protozero::ConstChars comm() const { return at<5>().as_string(); }
+};
+
+class BlockBioBounceFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = BlockBioBounceFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kSectorFieldNumber = 2,
+    kNrSectorFieldNumber = 3,
+    kRwbsFieldNumber = 4,
+    kCommFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockBioBounceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Sector =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockBioBounceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Sector kSector() { return {}; }
+  void set_sector(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Sector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NrSector =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      BlockBioBounceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrSector kNrSector() { return {}; }
+  void set_nr_sector(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrSector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Rwbs =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockBioBounceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Rwbs kRwbs() { return {}; }
+  void set_rwbs(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Rwbs::kFieldId, data, size);
+  }
+  void set_rwbs(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Rwbs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Comm =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockBioBounceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Comm kComm() { return {}; }
+  void set_comm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Comm::kFieldId, data, size);
+  }
+  void set_comm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Comm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class BlockBioBackmergeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BlockBioBackmergeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BlockBioBackmergeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BlockBioBackmergeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_sector() const { return at<2>().valid(); }
+  uint64_t sector() const { return at<2>().as_uint64(); }
+  bool has_nr_sector() const { return at<3>().valid(); }
+  uint32_t nr_sector() const { return at<3>().as_uint32(); }
+  bool has_rwbs() const { return at<4>().valid(); }
+  ::protozero::ConstChars rwbs() const { return at<4>().as_string(); }
+  bool has_comm() const { return at<5>().valid(); }
+  ::protozero::ConstChars comm() const { return at<5>().as_string(); }
+};
+
+class BlockBioBackmergeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = BlockBioBackmergeFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kSectorFieldNumber = 2,
+    kNrSectorFieldNumber = 3,
+    kRwbsFieldNumber = 4,
+    kCommFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockBioBackmergeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Sector =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockBioBackmergeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Sector kSector() { return {}; }
+  void set_sector(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Sector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NrSector =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      BlockBioBackmergeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrSector kNrSector() { return {}; }
+  void set_nr_sector(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrSector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Rwbs =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockBioBackmergeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Rwbs kRwbs() { return {}; }
+  void set_rwbs(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Rwbs::kFieldId, data, size);
+  }
+  void set_rwbs(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Rwbs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Comm =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockBioBackmergeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Comm kComm() { return {}; }
+  void set_comm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Comm::kFieldId, data, size);
+  }
+  void set_comm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Comm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class BlockRqIssueFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BlockRqIssueFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BlockRqIssueFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BlockRqIssueFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_sector() const { return at<2>().valid(); }
+  uint64_t sector() const { return at<2>().as_uint64(); }
+  bool has_nr_sector() const { return at<3>().valid(); }
+  uint32_t nr_sector() const { return at<3>().as_uint32(); }
+  bool has_bytes() const { return at<4>().valid(); }
+  uint32_t bytes() const { return at<4>().as_uint32(); }
+  bool has_rwbs() const { return at<5>().valid(); }
+  ::protozero::ConstChars rwbs() const { return at<5>().as_string(); }
+  bool has_comm() const { return at<6>().valid(); }
+  ::protozero::ConstChars comm() const { return at<6>().as_string(); }
+  bool has_cmd() const { return at<7>().valid(); }
+  ::protozero::ConstChars cmd() const { return at<7>().as_string(); }
+};
+
+class BlockRqIssueFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = BlockRqIssueFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kSectorFieldNumber = 2,
+    kNrSectorFieldNumber = 3,
+    kBytesFieldNumber = 4,
+    kRwbsFieldNumber = 5,
+    kCommFieldNumber = 6,
+    kCmdFieldNumber = 7,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockRqIssueFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Sector =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BlockRqIssueFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Sector kSector() { return {}; }
+  void set_sector(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Sector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NrSector =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      BlockRqIssueFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrSector kNrSector() { return {}; }
+  void set_nr_sector(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrSector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Bytes =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      BlockRqIssueFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Bytes kBytes() { return {}; }
+  void set_bytes(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Bytes::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Rwbs =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockRqIssueFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Rwbs kRwbs() { return {}; }
+  void set_rwbs(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Rwbs::kFieldId, data, size);
+  }
+  void set_rwbs(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Rwbs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Comm =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockRqIssueFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Comm kComm() { return {}; }
+  void set_comm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Comm::kFieldId, data, size);
+  }
+  void set_comm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Comm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Cmd =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      BlockRqIssueFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cmd kCmd() { return {}; }
+  void set_cmd(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Cmd::kFieldId, data, size);
+  }
+  void set_cmd(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cmd::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/cgroup.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_CGROUP_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_CGROUP_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class CgroupSetupRootFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  CgroupSetupRootFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit CgroupSetupRootFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit CgroupSetupRootFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_root() const { return at<1>().valid(); }
+  int32_t root() const { return at<1>().as_int32(); }
+  bool has_ss_mask() const { return at<2>().valid(); }
+  uint32_t ss_mask() const { return at<2>().as_uint32(); }
+  bool has_name() const { return at<3>().valid(); }
+  ::protozero::ConstChars name() const { return at<3>().as_string(); }
+};
+
+class CgroupSetupRootFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = CgroupSetupRootFtraceEvent_Decoder;
+  enum : int32_t {
+    kRootFieldNumber = 1,
+    kSsMaskFieldNumber = 2,
+    kNameFieldNumber = 3,
+  };
+
+  using FieldMetadata_Root =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      CgroupSetupRootFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Root kRoot() { return {}; }
+  void set_root(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Root::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SsMask =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      CgroupSetupRootFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SsMask kSsMask() { return {}; }
+  void set_ss_mask(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SsMask::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      CgroupSetupRootFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class CgroupRenameFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  CgroupRenameFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit CgroupRenameFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit CgroupRenameFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_root() const { return at<1>().valid(); }
+  int32_t root() const { return at<1>().as_int32(); }
+  bool has_id() const { return at<2>().valid(); }
+  int32_t id() const { return at<2>().as_int32(); }
+  bool has_cname() const { return at<3>().valid(); }
+  ::protozero::ConstChars cname() const { return at<3>().as_string(); }
+};
+
+class CgroupRenameFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = CgroupRenameFtraceEvent_Decoder;
+  enum : int32_t {
+    kRootFieldNumber = 1,
+    kIdFieldNumber = 2,
+    kCnameFieldNumber = 3,
+  };
+
+  using FieldMetadata_Root =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      CgroupRenameFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Root kRoot() { return {}; }
+  void set_root(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Root::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Id =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      CgroupRenameFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Id kId() { return {}; }
+  void set_id(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Id::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Cname =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      CgroupRenameFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cname kCname() { return {}; }
+  void set_cname(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Cname::kFieldId, data, size);
+  }
+  void set_cname(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cname::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class CgroupReleaseFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  CgroupReleaseFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit CgroupReleaseFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit CgroupReleaseFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_root() const { return at<1>().valid(); }
+  int32_t root() const { return at<1>().as_int32(); }
+  bool has_id() const { return at<2>().valid(); }
+  int32_t id() const { return at<2>().as_int32(); }
+  bool has_cname() const { return at<3>().valid(); }
+  ::protozero::ConstChars cname() const { return at<3>().as_string(); }
+};
+
+class CgroupReleaseFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = CgroupReleaseFtraceEvent_Decoder;
+  enum : int32_t {
+    kRootFieldNumber = 1,
+    kIdFieldNumber = 2,
+    kCnameFieldNumber = 3,
+  };
+
+  using FieldMetadata_Root =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      CgroupReleaseFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Root kRoot() { return {}; }
+  void set_root(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Root::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Id =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      CgroupReleaseFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Id kId() { return {}; }
+  void set_id(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Id::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Cname =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      CgroupReleaseFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cname kCname() { return {}; }
+  void set_cname(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Cname::kFieldId, data, size);
+  }
+  void set_cname(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cname::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class CgroupDestroyRootFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  CgroupDestroyRootFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit CgroupDestroyRootFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit CgroupDestroyRootFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_root() const { return at<1>().valid(); }
+  int32_t root() const { return at<1>().as_int32(); }
+  bool has_ss_mask() const { return at<2>().valid(); }
+  uint32_t ss_mask() const { return at<2>().as_uint32(); }
+  bool has_name() const { return at<3>().valid(); }
+  ::protozero::ConstChars name() const { return at<3>().as_string(); }
+};
+
+class CgroupDestroyRootFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = CgroupDestroyRootFtraceEvent_Decoder;
+  enum : int32_t {
+    kRootFieldNumber = 1,
+    kSsMaskFieldNumber = 2,
+    kNameFieldNumber = 3,
+  };
+
+  using FieldMetadata_Root =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      CgroupDestroyRootFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Root kRoot() { return {}; }
+  void set_root(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Root::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SsMask =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      CgroupDestroyRootFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SsMask kSsMask() { return {}; }
+  void set_ss_mask(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SsMask::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      CgroupDestroyRootFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class CgroupTransferTasksFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  CgroupTransferTasksFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit CgroupTransferTasksFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit CgroupTransferTasksFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dst_root() const { return at<1>().valid(); }
+  int32_t dst_root() const { return at<1>().as_int32(); }
+  bool has_dst_id() const { return at<2>().valid(); }
+  int32_t dst_id() const { return at<2>().as_int32(); }
+  bool has_pid() const { return at<3>().valid(); }
+  int32_t pid() const { return at<3>().as_int32(); }
+  bool has_comm() const { return at<4>().valid(); }
+  ::protozero::ConstChars comm() const { return at<4>().as_string(); }
+  bool has_cname() const { return at<5>().valid(); }
+  ::protozero::ConstChars cname() const { return at<5>().as_string(); }
+};
+
+class CgroupTransferTasksFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = CgroupTransferTasksFtraceEvent_Decoder;
+  enum : int32_t {
+    kDstRootFieldNumber = 1,
+    kDstIdFieldNumber = 2,
+    kPidFieldNumber = 3,
+    kCommFieldNumber = 4,
+    kCnameFieldNumber = 5,
+  };
+
+  using FieldMetadata_DstRoot =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      CgroupTransferTasksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DstRoot kDstRoot() { return {}; }
+  void set_dst_root(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DstRoot::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DstId =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      CgroupTransferTasksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DstId kDstId() { return {}; }
+  void set_dst_id(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DstId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      CgroupTransferTasksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Comm =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      CgroupTransferTasksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Comm kComm() { return {}; }
+  void set_comm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Comm::kFieldId, data, size);
+  }
+  void set_comm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Comm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Cname =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      CgroupTransferTasksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cname kCname() { return {}; }
+  void set_cname(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Cname::kFieldId, data, size);
+  }
+  void set_cname(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cname::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class CgroupRmdirFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  CgroupRmdirFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit CgroupRmdirFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit CgroupRmdirFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_root() const { return at<1>().valid(); }
+  int32_t root() const { return at<1>().as_int32(); }
+  bool has_id() const { return at<2>().valid(); }
+  int32_t id() const { return at<2>().as_int32(); }
+  bool has_cname() const { return at<3>().valid(); }
+  ::protozero::ConstChars cname() const { return at<3>().as_string(); }
+};
+
+class CgroupRmdirFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = CgroupRmdirFtraceEvent_Decoder;
+  enum : int32_t {
+    kRootFieldNumber = 1,
+    kIdFieldNumber = 2,
+    kCnameFieldNumber = 3,
+  };
+
+  using FieldMetadata_Root =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      CgroupRmdirFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Root kRoot() { return {}; }
+  void set_root(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Root::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Id =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      CgroupRmdirFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Id kId() { return {}; }
+  void set_id(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Id::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Cname =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      CgroupRmdirFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cname kCname() { return {}; }
+  void set_cname(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Cname::kFieldId, data, size);
+  }
+  void set_cname(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cname::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class CgroupRemountFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  CgroupRemountFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit CgroupRemountFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit CgroupRemountFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_root() const { return at<1>().valid(); }
+  int32_t root() const { return at<1>().as_int32(); }
+  bool has_ss_mask() const { return at<2>().valid(); }
+  uint32_t ss_mask() const { return at<2>().as_uint32(); }
+  bool has_name() const { return at<3>().valid(); }
+  ::protozero::ConstChars name() const { return at<3>().as_string(); }
+};
+
+class CgroupRemountFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = CgroupRemountFtraceEvent_Decoder;
+  enum : int32_t {
+    kRootFieldNumber = 1,
+    kSsMaskFieldNumber = 2,
+    kNameFieldNumber = 3,
+  };
+
+  using FieldMetadata_Root =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      CgroupRemountFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Root kRoot() { return {}; }
+  void set_root(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Root::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SsMask =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      CgroupRemountFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SsMask kSsMask() { return {}; }
+  void set_ss_mask(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SsMask::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      CgroupRemountFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class CgroupMkdirFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  CgroupMkdirFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit CgroupMkdirFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit CgroupMkdirFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_root() const { return at<1>().valid(); }
+  int32_t root() const { return at<1>().as_int32(); }
+  bool has_id() const { return at<2>().valid(); }
+  int32_t id() const { return at<2>().as_int32(); }
+  bool has_cname() const { return at<3>().valid(); }
+  ::protozero::ConstChars cname() const { return at<3>().as_string(); }
+};
+
+class CgroupMkdirFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = CgroupMkdirFtraceEvent_Decoder;
+  enum : int32_t {
+    kRootFieldNumber = 1,
+    kIdFieldNumber = 2,
+    kCnameFieldNumber = 3,
+  };
+
+  using FieldMetadata_Root =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      CgroupMkdirFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Root kRoot() { return {}; }
+  void set_root(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Root::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Id =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      CgroupMkdirFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Id kId() { return {}; }
+  void set_id(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Id::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Cname =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      CgroupMkdirFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cname kCname() { return {}; }
+  void set_cname(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Cname::kFieldId, data, size);
+  }
+  void set_cname(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cname::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class CgroupAttachTaskFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  CgroupAttachTaskFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit CgroupAttachTaskFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit CgroupAttachTaskFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dst_root() const { return at<1>().valid(); }
+  int32_t dst_root() const { return at<1>().as_int32(); }
+  bool has_dst_id() const { return at<2>().valid(); }
+  int32_t dst_id() const { return at<2>().as_int32(); }
+  bool has_pid() const { return at<3>().valid(); }
+  int32_t pid() const { return at<3>().as_int32(); }
+  bool has_comm() const { return at<4>().valid(); }
+  ::protozero::ConstChars comm() const { return at<4>().as_string(); }
+  bool has_cname() const { return at<5>().valid(); }
+  ::protozero::ConstChars cname() const { return at<5>().as_string(); }
+};
+
+class CgroupAttachTaskFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = CgroupAttachTaskFtraceEvent_Decoder;
+  enum : int32_t {
+    kDstRootFieldNumber = 1,
+    kDstIdFieldNumber = 2,
+    kPidFieldNumber = 3,
+    kCommFieldNumber = 4,
+    kCnameFieldNumber = 5,
+  };
+
+  using FieldMetadata_DstRoot =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      CgroupAttachTaskFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DstRoot kDstRoot() { return {}; }
+  void set_dst_root(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DstRoot::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DstId =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      CgroupAttachTaskFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DstId kDstId() { return {}; }
+  void set_dst_id(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DstId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      CgroupAttachTaskFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Comm =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      CgroupAttachTaskFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Comm kComm() { return {}; }
+  void set_comm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Comm::kFieldId, data, size);
+  }
+  void set_comm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Comm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Cname =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      CgroupAttachTaskFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cname kCname() { return {}; }
+  void set_cname(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Cname::kFieldId, data, size);
+  }
+  void set_cname(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cname::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/clk.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_CLK_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_CLK_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class ClkSetRateFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ClkSetRateFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ClkSetRateFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ClkSetRateFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_rate() const { return at<2>().valid(); }
+  uint64_t rate() const { return at<2>().as_uint64(); }
+};
+
+class ClkSetRateFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = ClkSetRateFtraceEvent_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kRateFieldNumber = 2,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ClkSetRateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Rate =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ClkSetRateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Rate kRate() { return {}; }
+  void set_rate(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Rate::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class ClkDisableFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ClkDisableFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ClkDisableFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ClkDisableFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+};
+
+class ClkDisableFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = ClkDisableFtraceEvent_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ClkDisableFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class ClkEnableFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ClkEnableFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ClkEnableFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ClkEnableFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+};
+
+class ClkEnableFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = ClkEnableFtraceEvent_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ClkEnableFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/compaction.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_COMPACTION_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_COMPACTION_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class MmCompactionWakeupKcompactdFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MmCompactionWakeupKcompactdFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MmCompactionWakeupKcompactdFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MmCompactionWakeupKcompactdFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_nid() const { return at<1>().valid(); }
+  int32_t nid() const { return at<1>().as_int32(); }
+  bool has_order() const { return at<2>().valid(); }
+  int32_t order() const { return at<2>().as_int32(); }
+  bool has_classzone_idx() const { return at<3>().valid(); }
+  uint32_t classzone_idx() const { return at<3>().as_uint32(); }
+};
+
+class MmCompactionWakeupKcompactdFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MmCompactionWakeupKcompactdFtraceEvent_Decoder;
+  enum : int32_t {
+    kNidFieldNumber = 1,
+    kOrderFieldNumber = 2,
+    kClasszoneIdxFieldNumber = 3,
+  };
+
+  using FieldMetadata_Nid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmCompactionWakeupKcompactdFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Nid kNid() { return {}; }
+  void set_nid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Nid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Order =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmCompactionWakeupKcompactdFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Order kOrder() { return {}; }
+  void set_order(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Order::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ClasszoneIdx =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MmCompactionWakeupKcompactdFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ClasszoneIdx kClasszoneIdx() { return {}; }
+  void set_classzone_idx(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ClasszoneIdx::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MmCompactionTryToCompactPagesFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MmCompactionTryToCompactPagesFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MmCompactionTryToCompactPagesFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MmCompactionTryToCompactPagesFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_order() const { return at<1>().valid(); }
+  int32_t order() const { return at<1>().as_int32(); }
+  bool has_gfp_mask() const { return at<2>().valid(); }
+  uint32_t gfp_mask() const { return at<2>().as_uint32(); }
+  bool has_mode() const { return at<3>().valid(); }
+  uint32_t mode() const { return at<3>().as_uint32(); }
+};
+
+class MmCompactionTryToCompactPagesFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MmCompactionTryToCompactPagesFtraceEvent_Decoder;
+  enum : int32_t {
+    kOrderFieldNumber = 1,
+    kGfpMaskFieldNumber = 2,
+    kModeFieldNumber = 3,
+  };
+
+  using FieldMetadata_Order =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmCompactionTryToCompactPagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Order kOrder() { return {}; }
+  void set_order(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Order::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_GfpMask =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MmCompactionTryToCompactPagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GfpMask kGfpMask() { return {}; }
+  void set_gfp_mask(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_GfpMask::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Mode =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MmCompactionTryToCompactPagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mode kMode() { return {}; }
+  void set_mode(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MmCompactionSuitableFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MmCompactionSuitableFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MmCompactionSuitableFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MmCompactionSuitableFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_nid() const { return at<1>().valid(); }
+  int32_t nid() const { return at<1>().as_int32(); }
+  bool has_idx() const { return at<2>().valid(); }
+  uint32_t idx() const { return at<2>().as_uint32(); }
+  bool has_order() const { return at<3>().valid(); }
+  int32_t order() const { return at<3>().as_int32(); }
+  bool has_ret() const { return at<4>().valid(); }
+  int32_t ret() const { return at<4>().as_int32(); }
+};
+
+class MmCompactionSuitableFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MmCompactionSuitableFtraceEvent_Decoder;
+  enum : int32_t {
+    kNidFieldNumber = 1,
+    kIdxFieldNumber = 2,
+    kOrderFieldNumber = 3,
+    kRetFieldNumber = 4,
+  };
+
+  using FieldMetadata_Nid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmCompactionSuitableFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Nid kNid() { return {}; }
+  void set_nid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Nid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Idx =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MmCompactionSuitableFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Idx kIdx() { return {}; }
+  void set_idx(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Idx::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Order =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmCompactionSuitableFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Order kOrder() { return {}; }
+  void set_order(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Order::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ret =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmCompactionSuitableFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ret kRet() { return {}; }
+  void set_ret(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ret::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MmCompactionMigratepagesFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MmCompactionMigratepagesFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MmCompactionMigratepagesFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MmCompactionMigratepagesFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_nr_migrated() const { return at<1>().valid(); }
+  uint64_t nr_migrated() const { return at<1>().as_uint64(); }
+  bool has_nr_failed() const { return at<2>().valid(); }
+  uint64_t nr_failed() const { return at<2>().as_uint64(); }
+};
+
+class MmCompactionMigratepagesFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MmCompactionMigratepagesFtraceEvent_Decoder;
+  enum : int32_t {
+    kNrMigratedFieldNumber = 1,
+    kNrFailedFieldNumber = 2,
+  };
+
+  using FieldMetadata_NrMigrated =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmCompactionMigratepagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrMigrated kNrMigrated() { return {}; }
+  void set_nr_migrated(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrMigrated::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NrFailed =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmCompactionMigratepagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrFailed kNrFailed() { return {}; }
+  void set_nr_failed(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrFailed::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MmCompactionKcompactdWakeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MmCompactionKcompactdWakeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MmCompactionKcompactdWakeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MmCompactionKcompactdWakeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_nid() const { return at<1>().valid(); }
+  int32_t nid() const { return at<1>().as_int32(); }
+  bool has_order() const { return at<2>().valid(); }
+  int32_t order() const { return at<2>().as_int32(); }
+  bool has_classzone_idx() const { return at<3>().valid(); }
+  uint32_t classzone_idx() const { return at<3>().as_uint32(); }
+};
+
+class MmCompactionKcompactdWakeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MmCompactionKcompactdWakeFtraceEvent_Decoder;
+  enum : int32_t {
+    kNidFieldNumber = 1,
+    kOrderFieldNumber = 2,
+    kClasszoneIdxFieldNumber = 3,
+  };
+
+  using FieldMetadata_Nid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmCompactionKcompactdWakeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Nid kNid() { return {}; }
+  void set_nid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Nid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Order =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmCompactionKcompactdWakeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Order kOrder() { return {}; }
+  void set_order(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Order::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ClasszoneIdx =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MmCompactionKcompactdWakeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ClasszoneIdx kClasszoneIdx() { return {}; }
+  void set_classzone_idx(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ClasszoneIdx::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MmCompactionKcompactdSleepFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MmCompactionKcompactdSleepFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MmCompactionKcompactdSleepFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MmCompactionKcompactdSleepFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_nid() const { return at<1>().valid(); }
+  int32_t nid() const { return at<1>().as_int32(); }
+};
+
+class MmCompactionKcompactdSleepFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MmCompactionKcompactdSleepFtraceEvent_Decoder;
+  enum : int32_t {
+    kNidFieldNumber = 1,
+  };
+
+  using FieldMetadata_Nid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmCompactionKcompactdSleepFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Nid kNid() { return {}; }
+  void set_nid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Nid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MmCompactionIsolateMigratepagesFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MmCompactionIsolateMigratepagesFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MmCompactionIsolateMigratepagesFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MmCompactionIsolateMigratepagesFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_start_pfn() const { return at<1>().valid(); }
+  uint64_t start_pfn() const { return at<1>().as_uint64(); }
+  bool has_end_pfn() const { return at<2>().valid(); }
+  uint64_t end_pfn() const { return at<2>().as_uint64(); }
+  bool has_nr_scanned() const { return at<3>().valid(); }
+  uint64_t nr_scanned() const { return at<3>().as_uint64(); }
+  bool has_nr_taken() const { return at<4>().valid(); }
+  uint64_t nr_taken() const { return at<4>().as_uint64(); }
+};
+
+class MmCompactionIsolateMigratepagesFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MmCompactionIsolateMigratepagesFtraceEvent_Decoder;
+  enum : int32_t {
+    kStartPfnFieldNumber = 1,
+    kEndPfnFieldNumber = 2,
+    kNrScannedFieldNumber = 3,
+    kNrTakenFieldNumber = 4,
+  };
+
+  using FieldMetadata_StartPfn =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmCompactionIsolateMigratepagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StartPfn kStartPfn() { return {}; }
+  void set_start_pfn(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_StartPfn::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_EndPfn =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmCompactionIsolateMigratepagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EndPfn kEndPfn() { return {}; }
+  void set_end_pfn(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_EndPfn::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NrScanned =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmCompactionIsolateMigratepagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrScanned kNrScanned() { return {}; }
+  void set_nr_scanned(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrScanned::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NrTaken =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmCompactionIsolateMigratepagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrTaken kNrTaken() { return {}; }
+  void set_nr_taken(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrTaken::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MmCompactionIsolateFreepagesFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MmCompactionIsolateFreepagesFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MmCompactionIsolateFreepagesFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MmCompactionIsolateFreepagesFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_start_pfn() const { return at<1>().valid(); }
+  uint64_t start_pfn() const { return at<1>().as_uint64(); }
+  bool has_end_pfn() const { return at<2>().valid(); }
+  uint64_t end_pfn() const { return at<2>().as_uint64(); }
+  bool has_nr_scanned() const { return at<3>().valid(); }
+  uint64_t nr_scanned() const { return at<3>().as_uint64(); }
+  bool has_nr_taken() const { return at<4>().valid(); }
+  uint64_t nr_taken() const { return at<4>().as_uint64(); }
+};
+
+class MmCompactionIsolateFreepagesFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MmCompactionIsolateFreepagesFtraceEvent_Decoder;
+  enum : int32_t {
+    kStartPfnFieldNumber = 1,
+    kEndPfnFieldNumber = 2,
+    kNrScannedFieldNumber = 3,
+    kNrTakenFieldNumber = 4,
+  };
+
+  using FieldMetadata_StartPfn =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmCompactionIsolateFreepagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StartPfn kStartPfn() { return {}; }
+  void set_start_pfn(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_StartPfn::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_EndPfn =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmCompactionIsolateFreepagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EndPfn kEndPfn() { return {}; }
+  void set_end_pfn(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_EndPfn::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NrScanned =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmCompactionIsolateFreepagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrScanned kNrScanned() { return {}; }
+  void set_nr_scanned(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrScanned::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NrTaken =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmCompactionIsolateFreepagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrTaken kNrTaken() { return {}; }
+  void set_nr_taken(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrTaken::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MmCompactionFinishedFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MmCompactionFinishedFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MmCompactionFinishedFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MmCompactionFinishedFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_nid() const { return at<1>().valid(); }
+  int32_t nid() const { return at<1>().as_int32(); }
+  bool has_idx() const { return at<2>().valid(); }
+  uint32_t idx() const { return at<2>().as_uint32(); }
+  bool has_order() const { return at<3>().valid(); }
+  int32_t order() const { return at<3>().as_int32(); }
+  bool has_ret() const { return at<4>().valid(); }
+  int32_t ret() const { return at<4>().as_int32(); }
+};
+
+class MmCompactionFinishedFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MmCompactionFinishedFtraceEvent_Decoder;
+  enum : int32_t {
+    kNidFieldNumber = 1,
+    kIdxFieldNumber = 2,
+    kOrderFieldNumber = 3,
+    kRetFieldNumber = 4,
+  };
+
+  using FieldMetadata_Nid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmCompactionFinishedFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Nid kNid() { return {}; }
+  void set_nid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Nid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Idx =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MmCompactionFinishedFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Idx kIdx() { return {}; }
+  void set_idx(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Idx::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Order =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmCompactionFinishedFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Order kOrder() { return {}; }
+  void set_order(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Order::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ret =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmCompactionFinishedFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ret kRet() { return {}; }
+  void set_ret(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ret::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MmCompactionEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MmCompactionEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MmCompactionEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MmCompactionEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_zone_start() const { return at<1>().valid(); }
+  uint64_t zone_start() const { return at<1>().as_uint64(); }
+  bool has_migrate_pfn() const { return at<2>().valid(); }
+  uint64_t migrate_pfn() const { return at<2>().as_uint64(); }
+  bool has_free_pfn() const { return at<3>().valid(); }
+  uint64_t free_pfn() const { return at<3>().as_uint64(); }
+  bool has_zone_end() const { return at<4>().valid(); }
+  uint64_t zone_end() const { return at<4>().as_uint64(); }
+  bool has_sync() const { return at<5>().valid(); }
+  uint32_t sync() const { return at<5>().as_uint32(); }
+  bool has_status() const { return at<6>().valid(); }
+  int32_t status() const { return at<6>().as_int32(); }
+};
+
+class MmCompactionEndFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MmCompactionEndFtraceEvent_Decoder;
+  enum : int32_t {
+    kZoneStartFieldNumber = 1,
+    kMigratePfnFieldNumber = 2,
+    kFreePfnFieldNumber = 3,
+    kZoneEndFieldNumber = 4,
+    kSyncFieldNumber = 5,
+    kStatusFieldNumber = 6,
+  };
+
+  using FieldMetadata_ZoneStart =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmCompactionEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ZoneStart kZoneStart() { return {}; }
+  void set_zone_start(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ZoneStart::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MigratePfn =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmCompactionEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MigratePfn kMigratePfn() { return {}; }
+  void set_migrate_pfn(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MigratePfn::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FreePfn =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmCompactionEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FreePfn kFreePfn() { return {}; }
+  void set_free_pfn(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FreePfn::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ZoneEnd =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmCompactionEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ZoneEnd kZoneEnd() { return {}; }
+  void set_zone_end(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ZoneEnd::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Sync =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MmCompactionEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Sync kSync() { return {}; }
+  void set_sync(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Sync::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Status =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmCompactionEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Status kStatus() { return {}; }
+  void set_status(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Status::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MmCompactionDeferResetFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MmCompactionDeferResetFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MmCompactionDeferResetFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MmCompactionDeferResetFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_nid() const { return at<1>().valid(); }
+  int32_t nid() const { return at<1>().as_int32(); }
+  bool has_idx() const { return at<2>().valid(); }
+  uint32_t idx() const { return at<2>().as_uint32(); }
+  bool has_order() const { return at<3>().valid(); }
+  int32_t order() const { return at<3>().as_int32(); }
+  bool has_considered() const { return at<4>().valid(); }
+  uint32_t considered() const { return at<4>().as_uint32(); }
+  bool has_defer_shift() const { return at<5>().valid(); }
+  uint32_t defer_shift() const { return at<5>().as_uint32(); }
+  bool has_order_failed() const { return at<6>().valid(); }
+  int32_t order_failed() const { return at<6>().as_int32(); }
+};
+
+class MmCompactionDeferResetFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MmCompactionDeferResetFtraceEvent_Decoder;
+  enum : int32_t {
+    kNidFieldNumber = 1,
+    kIdxFieldNumber = 2,
+    kOrderFieldNumber = 3,
+    kConsideredFieldNumber = 4,
+    kDeferShiftFieldNumber = 5,
+    kOrderFailedFieldNumber = 6,
+  };
+
+  using FieldMetadata_Nid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmCompactionDeferResetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Nid kNid() { return {}; }
+  void set_nid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Nid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Idx =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MmCompactionDeferResetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Idx kIdx() { return {}; }
+  void set_idx(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Idx::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Order =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmCompactionDeferResetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Order kOrder() { return {}; }
+  void set_order(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Order::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Considered =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MmCompactionDeferResetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Considered kConsidered() { return {}; }
+  void set_considered(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Considered::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DeferShift =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MmCompactionDeferResetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DeferShift kDeferShift() { return {}; }
+  void set_defer_shift(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DeferShift::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OrderFailed =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmCompactionDeferResetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OrderFailed kOrderFailed() { return {}; }
+  void set_order_failed(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OrderFailed::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MmCompactionDeferredFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MmCompactionDeferredFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MmCompactionDeferredFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MmCompactionDeferredFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_nid() const { return at<1>().valid(); }
+  int32_t nid() const { return at<1>().as_int32(); }
+  bool has_idx() const { return at<2>().valid(); }
+  uint32_t idx() const { return at<2>().as_uint32(); }
+  bool has_order() const { return at<3>().valid(); }
+  int32_t order() const { return at<3>().as_int32(); }
+  bool has_considered() const { return at<4>().valid(); }
+  uint32_t considered() const { return at<4>().as_uint32(); }
+  bool has_defer_shift() const { return at<5>().valid(); }
+  uint32_t defer_shift() const { return at<5>().as_uint32(); }
+  bool has_order_failed() const { return at<6>().valid(); }
+  int32_t order_failed() const { return at<6>().as_int32(); }
+};
+
+class MmCompactionDeferredFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MmCompactionDeferredFtraceEvent_Decoder;
+  enum : int32_t {
+    kNidFieldNumber = 1,
+    kIdxFieldNumber = 2,
+    kOrderFieldNumber = 3,
+    kConsideredFieldNumber = 4,
+    kDeferShiftFieldNumber = 5,
+    kOrderFailedFieldNumber = 6,
+  };
+
+  using FieldMetadata_Nid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmCompactionDeferredFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Nid kNid() { return {}; }
+  void set_nid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Nid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Idx =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MmCompactionDeferredFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Idx kIdx() { return {}; }
+  void set_idx(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Idx::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Order =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmCompactionDeferredFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Order kOrder() { return {}; }
+  void set_order(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Order::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Considered =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MmCompactionDeferredFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Considered kConsidered() { return {}; }
+  void set_considered(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Considered::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DeferShift =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MmCompactionDeferredFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DeferShift kDeferShift() { return {}; }
+  void set_defer_shift(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DeferShift::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OrderFailed =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmCompactionDeferredFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OrderFailed kOrderFailed() { return {}; }
+  void set_order_failed(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OrderFailed::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MmCompactionDeferCompactionFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MmCompactionDeferCompactionFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MmCompactionDeferCompactionFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MmCompactionDeferCompactionFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_nid() const { return at<1>().valid(); }
+  int32_t nid() const { return at<1>().as_int32(); }
+  bool has_idx() const { return at<2>().valid(); }
+  uint32_t idx() const { return at<2>().as_uint32(); }
+  bool has_order() const { return at<3>().valid(); }
+  int32_t order() const { return at<3>().as_int32(); }
+  bool has_considered() const { return at<4>().valid(); }
+  uint32_t considered() const { return at<4>().as_uint32(); }
+  bool has_defer_shift() const { return at<5>().valid(); }
+  uint32_t defer_shift() const { return at<5>().as_uint32(); }
+  bool has_order_failed() const { return at<6>().valid(); }
+  int32_t order_failed() const { return at<6>().as_int32(); }
+};
+
+class MmCompactionDeferCompactionFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MmCompactionDeferCompactionFtraceEvent_Decoder;
+  enum : int32_t {
+    kNidFieldNumber = 1,
+    kIdxFieldNumber = 2,
+    kOrderFieldNumber = 3,
+    kConsideredFieldNumber = 4,
+    kDeferShiftFieldNumber = 5,
+    kOrderFailedFieldNumber = 6,
+  };
+
+  using FieldMetadata_Nid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmCompactionDeferCompactionFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Nid kNid() { return {}; }
+  void set_nid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Nid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Idx =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MmCompactionDeferCompactionFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Idx kIdx() { return {}; }
+  void set_idx(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Idx::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Order =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmCompactionDeferCompactionFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Order kOrder() { return {}; }
+  void set_order(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Order::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Considered =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MmCompactionDeferCompactionFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Considered kConsidered() { return {}; }
+  void set_considered(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Considered::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DeferShift =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MmCompactionDeferCompactionFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DeferShift kDeferShift() { return {}; }
+  void set_defer_shift(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DeferShift::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OrderFailed =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmCompactionDeferCompactionFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OrderFailed kOrderFailed() { return {}; }
+  void set_order_failed(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OrderFailed::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MmCompactionBeginFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MmCompactionBeginFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MmCompactionBeginFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MmCompactionBeginFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_zone_start() const { return at<1>().valid(); }
+  uint64_t zone_start() const { return at<1>().as_uint64(); }
+  bool has_migrate_pfn() const { return at<2>().valid(); }
+  uint64_t migrate_pfn() const { return at<2>().as_uint64(); }
+  bool has_free_pfn() const { return at<3>().valid(); }
+  uint64_t free_pfn() const { return at<3>().as_uint64(); }
+  bool has_zone_end() const { return at<4>().valid(); }
+  uint64_t zone_end() const { return at<4>().as_uint64(); }
+  bool has_sync() const { return at<5>().valid(); }
+  uint32_t sync() const { return at<5>().as_uint32(); }
+};
+
+class MmCompactionBeginFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MmCompactionBeginFtraceEvent_Decoder;
+  enum : int32_t {
+    kZoneStartFieldNumber = 1,
+    kMigratePfnFieldNumber = 2,
+    kFreePfnFieldNumber = 3,
+    kZoneEndFieldNumber = 4,
+    kSyncFieldNumber = 5,
+  };
+
+  using FieldMetadata_ZoneStart =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmCompactionBeginFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ZoneStart kZoneStart() { return {}; }
+  void set_zone_start(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ZoneStart::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MigratePfn =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmCompactionBeginFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MigratePfn kMigratePfn() { return {}; }
+  void set_migrate_pfn(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MigratePfn::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FreePfn =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmCompactionBeginFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FreePfn kFreePfn() { return {}; }
+  void set_free_pfn(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FreePfn::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ZoneEnd =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmCompactionBeginFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ZoneEnd kZoneEnd() { return {}; }
+  void set_zone_end(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ZoneEnd::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Sync =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MmCompactionBeginFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Sync kSync() { return {}; }
+  void set_sync(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Sync::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/cpuhp.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_CPUHP_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_CPUHP_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class CpuhpPauseFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  CpuhpPauseFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit CpuhpPauseFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit CpuhpPauseFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_active_cpus() const { return at<1>().valid(); }
+  uint32_t active_cpus() const { return at<1>().as_uint32(); }
+  bool has_cpus() const { return at<2>().valid(); }
+  uint32_t cpus() const { return at<2>().as_uint32(); }
+  bool has_pause() const { return at<3>().valid(); }
+  uint32_t pause() const { return at<3>().as_uint32(); }
+  bool has_time() const { return at<4>().valid(); }
+  uint32_t time() const { return at<4>().as_uint32(); }
+};
+
+class CpuhpPauseFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = CpuhpPauseFtraceEvent_Decoder;
+  enum : int32_t {
+    kActiveCpusFieldNumber = 1,
+    kCpusFieldNumber = 2,
+    kPauseFieldNumber = 3,
+    kTimeFieldNumber = 4,
+  };
+
+  using FieldMetadata_ActiveCpus =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      CpuhpPauseFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ActiveCpus kActiveCpus() { return {}; }
+  void set_active_cpus(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ActiveCpus::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Cpus =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      CpuhpPauseFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cpus kCpus() { return {}; }
+  void set_cpus(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cpus::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pause =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      CpuhpPauseFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pause kPause() { return {}; }
+  void set_pause(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pause::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Time =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      CpuhpPauseFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Time kTime() { return {}; }
+  void set_time(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Time::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class CpuhpLatencyFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  CpuhpLatencyFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit CpuhpLatencyFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit CpuhpLatencyFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_cpu() const { return at<1>().valid(); }
+  uint32_t cpu() const { return at<1>().as_uint32(); }
+  bool has_ret() const { return at<2>().valid(); }
+  int32_t ret() const { return at<2>().as_int32(); }
+  bool has_state() const { return at<3>().valid(); }
+  uint32_t state() const { return at<3>().as_uint32(); }
+  bool has_time() const { return at<4>().valid(); }
+  uint64_t time() const { return at<4>().as_uint64(); }
+};
+
+class CpuhpLatencyFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = CpuhpLatencyFtraceEvent_Decoder;
+  enum : int32_t {
+    kCpuFieldNumber = 1,
+    kRetFieldNumber = 2,
+    kStateFieldNumber = 3,
+    kTimeFieldNumber = 4,
+  };
+
+  using FieldMetadata_Cpu =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      CpuhpLatencyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cpu kCpu() { return {}; }
+  void set_cpu(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cpu::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ret =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      CpuhpLatencyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ret kRet() { return {}; }
+  void set_ret(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ret::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_State =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      CpuhpLatencyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_State kState() { return {}; }
+  void set_state(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_State::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Time =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      CpuhpLatencyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Time kTime() { return {}; }
+  void set_time(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Time::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class CpuhpEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  CpuhpEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit CpuhpEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit CpuhpEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_cpu() const { return at<1>().valid(); }
+  uint32_t cpu() const { return at<1>().as_uint32(); }
+  bool has_fun() const { return at<2>().valid(); }
+  uint64_t fun() const { return at<2>().as_uint64(); }
+  bool has_idx() const { return at<3>().valid(); }
+  int32_t idx() const { return at<3>().as_int32(); }
+  bool has_target() const { return at<4>().valid(); }
+  int32_t target() const { return at<4>().as_int32(); }
+};
+
+class CpuhpEnterFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = CpuhpEnterFtraceEvent_Decoder;
+  enum : int32_t {
+    kCpuFieldNumber = 1,
+    kFunFieldNumber = 2,
+    kIdxFieldNumber = 3,
+    kTargetFieldNumber = 4,
+  };
+
+  using FieldMetadata_Cpu =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      CpuhpEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cpu kCpu() { return {}; }
+  void set_cpu(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cpu::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Fun =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      CpuhpEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Fun kFun() { return {}; }
+  void set_fun(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Fun::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Idx =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      CpuhpEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Idx kIdx() { return {}; }
+  void set_idx(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Idx::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Target =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      CpuhpEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Target kTarget() { return {}; }
+  void set_target(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Target::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class CpuhpMultiEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  CpuhpMultiEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit CpuhpMultiEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit CpuhpMultiEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_cpu() const { return at<1>().valid(); }
+  uint32_t cpu() const { return at<1>().as_uint32(); }
+  bool has_fun() const { return at<2>().valid(); }
+  uint64_t fun() const { return at<2>().as_uint64(); }
+  bool has_idx() const { return at<3>().valid(); }
+  int32_t idx() const { return at<3>().as_int32(); }
+  bool has_target() const { return at<4>().valid(); }
+  int32_t target() const { return at<4>().as_int32(); }
+};
+
+class CpuhpMultiEnterFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = CpuhpMultiEnterFtraceEvent_Decoder;
+  enum : int32_t {
+    kCpuFieldNumber = 1,
+    kFunFieldNumber = 2,
+    kIdxFieldNumber = 3,
+    kTargetFieldNumber = 4,
+  };
+
+  using FieldMetadata_Cpu =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      CpuhpMultiEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cpu kCpu() { return {}; }
+  void set_cpu(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cpu::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Fun =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      CpuhpMultiEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Fun kFun() { return {}; }
+  void set_fun(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Fun::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Idx =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      CpuhpMultiEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Idx kIdx() { return {}; }
+  void set_idx(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Idx::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Target =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      CpuhpMultiEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Target kTarget() { return {}; }
+  void set_target(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Target::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class CpuhpExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  CpuhpExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit CpuhpExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit CpuhpExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_cpu() const { return at<1>().valid(); }
+  uint32_t cpu() const { return at<1>().as_uint32(); }
+  bool has_idx() const { return at<2>().valid(); }
+  int32_t idx() const { return at<2>().as_int32(); }
+  bool has_ret() const { return at<3>().valid(); }
+  int32_t ret() const { return at<3>().as_int32(); }
+  bool has_state() const { return at<4>().valid(); }
+  int32_t state() const { return at<4>().as_int32(); }
+};
+
+class CpuhpExitFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = CpuhpExitFtraceEvent_Decoder;
+  enum : int32_t {
+    kCpuFieldNumber = 1,
+    kIdxFieldNumber = 2,
+    kRetFieldNumber = 3,
+    kStateFieldNumber = 4,
+  };
+
+  using FieldMetadata_Cpu =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      CpuhpExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cpu kCpu() { return {}; }
+  void set_cpu(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cpu::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Idx =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      CpuhpExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Idx kIdx() { return {}; }
+  void set_idx(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Idx::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ret =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      CpuhpExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ret kRet() { return {}; }
+  void set_ret(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ret::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_State =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      CpuhpExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_State kState() { return {}; }
+  void set_state(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_State::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/dmabuf_heap.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_DMABUF_HEAP_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_DMABUF_HEAP_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class DmaHeapStatFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  DmaHeapStatFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit DmaHeapStatFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit DmaHeapStatFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_inode() const { return at<1>().valid(); }
+  uint64_t inode() const { return at<1>().as_uint64(); }
+  bool has_len() const { return at<2>().valid(); }
+  int64_t len() const { return at<2>().as_int64(); }
+  bool has_total_allocated() const { return at<3>().valid(); }
+  uint64_t total_allocated() const { return at<3>().as_uint64(); }
+};
+
+class DmaHeapStatFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = DmaHeapStatFtraceEvent_Decoder;
+  enum : int32_t {
+    kInodeFieldNumber = 1,
+    kLenFieldNumber = 2,
+    kTotalAllocatedFieldNumber = 3,
+  };
+
+  using FieldMetadata_Inode =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      DmaHeapStatFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Inode kInode() { return {}; }
+  void set_inode(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Inode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      DmaHeapStatFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TotalAllocated =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      DmaHeapStatFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TotalAllocated kTotalAllocated() { return {}; }
+  void set_total_allocated(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TotalAllocated::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/dpu.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_DPU_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_DPU_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class DpuTracingMarkWriteFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  DpuTracingMarkWriteFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit DpuTracingMarkWriteFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit DpuTracingMarkWriteFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_pid() const { return at<1>().valid(); }
+  int32_t pid() const { return at<1>().as_int32(); }
+  bool has_trace_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars trace_name() const { return at<2>().as_string(); }
+  bool has_trace_begin() const { return at<3>().valid(); }
+  uint32_t trace_begin() const { return at<3>().as_uint32(); }
+  bool has_name() const { return at<4>().valid(); }
+  ::protozero::ConstChars name() const { return at<4>().as_string(); }
+  bool has_type() const { return at<5>().valid(); }
+  uint32_t type() const { return at<5>().as_uint32(); }
+  bool has_value() const { return at<6>().valid(); }
+  int32_t value() const { return at<6>().as_int32(); }
+};
+
+class DpuTracingMarkWriteFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = DpuTracingMarkWriteFtraceEvent_Decoder;
+  enum : int32_t {
+    kPidFieldNumber = 1,
+    kTraceNameFieldNumber = 2,
+    kTraceBeginFieldNumber = 3,
+    kNameFieldNumber = 4,
+    kTypeFieldNumber = 5,
+    kValueFieldNumber = 6,
+  };
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      DpuTracingMarkWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TraceName =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      DpuTracingMarkWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TraceName kTraceName() { return {}; }
+  void set_trace_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_TraceName::kFieldId, data, size);
+  }
+  void set_trace_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_TraceName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TraceBegin =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      DpuTracingMarkWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TraceBegin kTraceBegin() { return {}; }
+  void set_trace_begin(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TraceBegin::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      DpuTracingMarkWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Type =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      DpuTracingMarkWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Type kType() { return {}; }
+  void set_type(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Type::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Value =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      DpuTracingMarkWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Value kValue() { return {}; }
+  void set_value(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Value::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/ext4.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_EXT4_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_EXT4_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class Ext4ZeroRangeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4ZeroRangeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4ZeroRangeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4ZeroRangeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_offset() const { return at<3>().valid(); }
+  int64_t offset() const { return at<3>().as_int64(); }
+  bool has_len() const { return at<4>().valid(); }
+  int64_t len() const { return at<4>().as_int64(); }
+  bool has_mode() const { return at<5>().valid(); }
+  int32_t mode() const { return at<5>().as_int32(); }
+};
+
+class Ext4ZeroRangeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4ZeroRangeFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kOffsetFieldNumber = 3,
+    kLenFieldNumber = 4,
+    kModeFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ZeroRangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ZeroRangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Offset =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4ZeroRangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Offset kOffset() { return {}; }
+  void set_offset(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Offset::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4ZeroRangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Mode =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4ZeroRangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mode kMode() { return {}; }
+  void set_mode(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4WritepagesResultFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4WritepagesResultFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4WritepagesResultFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4WritepagesResultFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_ret() const { return at<3>().valid(); }
+  int32_t ret() const { return at<3>().as_int32(); }
+  bool has_pages_written() const { return at<4>().valid(); }
+  int32_t pages_written() const { return at<4>().as_int32(); }
+  bool has_pages_skipped() const { return at<5>().valid(); }
+  int64_t pages_skipped() const { return at<5>().as_int64(); }
+  bool has_writeback_index() const { return at<6>().valid(); }
+  uint64_t writeback_index() const { return at<6>().as_uint64(); }
+  bool has_sync_mode() const { return at<7>().valid(); }
+  int32_t sync_mode() const { return at<7>().as_int32(); }
+};
+
+class Ext4WritepagesResultFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4WritepagesResultFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kRetFieldNumber = 3,
+    kPagesWrittenFieldNumber = 4,
+    kPagesSkippedFieldNumber = 5,
+    kWritebackIndexFieldNumber = 6,
+    kSyncModeFieldNumber = 7,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4WritepagesResultFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4WritepagesResultFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ret =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4WritepagesResultFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ret kRet() { return {}; }
+  void set_ret(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ret::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PagesWritten =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4WritepagesResultFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PagesWritten kPagesWritten() { return {}; }
+  void set_pages_written(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PagesWritten::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PagesSkipped =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4WritepagesResultFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PagesSkipped kPagesSkipped() { return {}; }
+  void set_pages_skipped(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PagesSkipped::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_WritebackIndex =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4WritepagesResultFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_WritebackIndex kWritebackIndex() { return {}; }
+  void set_writeback_index(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_WritebackIndex::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SyncMode =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4WritepagesResultFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SyncMode kSyncMode() { return {}; }
+  void set_sync_mode(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SyncMode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4WritepagesFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/10, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4WritepagesFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4WritepagesFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4WritepagesFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_nr_to_write() const { return at<3>().valid(); }
+  int64_t nr_to_write() const { return at<3>().as_int64(); }
+  bool has_pages_skipped() const { return at<4>().valid(); }
+  int64_t pages_skipped() const { return at<4>().as_int64(); }
+  bool has_range_start() const { return at<5>().valid(); }
+  int64_t range_start() const { return at<5>().as_int64(); }
+  bool has_range_end() const { return at<6>().valid(); }
+  int64_t range_end() const { return at<6>().as_int64(); }
+  bool has_writeback_index() const { return at<7>().valid(); }
+  uint64_t writeback_index() const { return at<7>().as_uint64(); }
+  bool has_sync_mode() const { return at<8>().valid(); }
+  int32_t sync_mode() const { return at<8>().as_int32(); }
+  bool has_for_kupdate() const { return at<9>().valid(); }
+  uint32_t for_kupdate() const { return at<9>().as_uint32(); }
+  bool has_range_cyclic() const { return at<10>().valid(); }
+  uint32_t range_cyclic() const { return at<10>().as_uint32(); }
+};
+
+class Ext4WritepagesFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4WritepagesFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kNrToWriteFieldNumber = 3,
+    kPagesSkippedFieldNumber = 4,
+    kRangeStartFieldNumber = 5,
+    kRangeEndFieldNumber = 6,
+    kWritebackIndexFieldNumber = 7,
+    kSyncModeFieldNumber = 8,
+    kForKupdateFieldNumber = 9,
+    kRangeCyclicFieldNumber = 10,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4WritepagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4WritepagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NrToWrite =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4WritepagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrToWrite kNrToWrite() { return {}; }
+  void set_nr_to_write(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrToWrite::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PagesSkipped =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4WritepagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PagesSkipped kPagesSkipped() { return {}; }
+  void set_pages_skipped(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PagesSkipped::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_RangeStart =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4WritepagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RangeStart kRangeStart() { return {}; }
+  void set_range_start(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_RangeStart::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_RangeEnd =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4WritepagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RangeEnd kRangeEnd() { return {}; }
+  void set_range_end(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_RangeEnd::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_WritebackIndex =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4WritepagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_WritebackIndex kWritebackIndex() { return {}; }
+  void set_writeback_index(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_WritebackIndex::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SyncMode =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4WritepagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SyncMode kSyncMode() { return {}; }
+  void set_sync_mode(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SyncMode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ForKupdate =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4WritepagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ForKupdate kForKupdate() { return {}; }
+  void set_for_kupdate(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ForKupdate::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_RangeCyclic =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4WritepagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RangeCyclic kRangeCyclic() { return {}; }
+  void set_range_cyclic(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_RangeCyclic::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4WritepageFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4WritepageFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4WritepageFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4WritepageFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_index() const { return at<3>().valid(); }
+  uint64_t index() const { return at<3>().as_uint64(); }
+};
+
+class Ext4WritepageFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4WritepageFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kIndexFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4WritepageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4WritepageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Index =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4WritepageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Index kIndex() { return {}; }
+  void set_index(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Index::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4WriteEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4WriteEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4WriteEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4WriteEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_pos() const { return at<3>().valid(); }
+  int64_t pos() const { return at<3>().as_int64(); }
+  bool has_len() const { return at<4>().valid(); }
+  uint32_t len() const { return at<4>().as_uint32(); }
+  bool has_copied() const { return at<5>().valid(); }
+  uint32_t copied() const { return at<5>().as_uint32(); }
+};
+
+class Ext4WriteEndFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4WriteEndFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kPosFieldNumber = 3,
+    kLenFieldNumber = 4,
+    kCopiedFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4WriteEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4WriteEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pos =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4WriteEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pos kPos() { return {}; }
+  void set_pos(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pos::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4WriteEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Copied =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4WriteEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Copied kCopied() { return {}; }
+  void set_copied(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Copied::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4WriteBeginFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4WriteBeginFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4WriteBeginFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4WriteBeginFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_pos() const { return at<3>().valid(); }
+  int64_t pos() const { return at<3>().as_int64(); }
+  bool has_len() const { return at<4>().valid(); }
+  uint32_t len() const { return at<4>().as_uint32(); }
+  bool has_flags() const { return at<5>().valid(); }
+  uint32_t flags() const { return at<5>().as_uint32(); }
+};
+
+class Ext4WriteBeginFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4WriteBeginFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kPosFieldNumber = 3,
+    kLenFieldNumber = 4,
+    kFlagsFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4WriteBeginFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4WriteBeginFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pos =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4WriteBeginFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pos kPos() { return {}; }
+  void set_pos(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pos::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4WriteBeginFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4WriteBeginFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4UnlinkExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4UnlinkExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4UnlinkExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4UnlinkExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_ret() const { return at<3>().valid(); }
+  int32_t ret() const { return at<3>().as_int32(); }
+};
+
+class Ext4UnlinkExitFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4UnlinkExitFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kRetFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4UnlinkExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4UnlinkExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ret =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4UnlinkExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ret kRet() { return {}; }
+  void set_ret(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ret::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4UnlinkEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4UnlinkEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4UnlinkEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4UnlinkEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_parent() const { return at<3>().valid(); }
+  uint64_t parent() const { return at<3>().as_uint64(); }
+  bool has_size() const { return at<4>().valid(); }
+  int64_t size() const { return at<4>().as_int64(); }
+};
+
+class Ext4UnlinkEnterFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4UnlinkEnterFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kParentFieldNumber = 3,
+    kSizeFieldNumber = 4,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4UnlinkEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4UnlinkEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Parent =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4UnlinkEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Parent kParent() { return {}; }
+  void set_parent(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Parent::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Size =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4UnlinkEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Size kSize() { return {}; }
+  void set_size(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Size::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4TruncateExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4TruncateExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4TruncateExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4TruncateExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_blocks() const { return at<3>().valid(); }
+  uint64_t blocks() const { return at<3>().as_uint64(); }
+};
+
+class Ext4TruncateExitFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4TruncateExitFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kBlocksFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4TruncateExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4TruncateExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Blocks =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4TruncateExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Blocks kBlocks() { return {}; }
+  void set_blocks(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Blocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4TruncateEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4TruncateEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4TruncateEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4TruncateEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_blocks() const { return at<3>().valid(); }
+  uint64_t blocks() const { return at<3>().as_uint64(); }
+};
+
+class Ext4TruncateEnterFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4TruncateEnterFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kBlocksFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4TruncateEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4TruncateEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Blocks =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4TruncateEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Blocks kBlocks() { return {}; }
+  void set_blocks(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Blocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4TrimExtentFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4TrimExtentFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4TrimExtentFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4TrimExtentFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev_major() const { return at<1>().valid(); }
+  int32_t dev_major() const { return at<1>().as_int32(); }
+  bool has_dev_minor() const { return at<2>().valid(); }
+  int32_t dev_minor() const { return at<2>().as_int32(); }
+  bool has_group() const { return at<3>().valid(); }
+  uint32_t group() const { return at<3>().as_uint32(); }
+  bool has_start() const { return at<4>().valid(); }
+  int32_t start() const { return at<4>().as_int32(); }
+  bool has_len() const { return at<5>().valid(); }
+  int32_t len() const { return at<5>().as_int32(); }
+};
+
+class Ext4TrimExtentFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4TrimExtentFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevMajorFieldNumber = 1,
+    kDevMinorFieldNumber = 2,
+    kGroupFieldNumber = 3,
+    kStartFieldNumber = 4,
+    kLenFieldNumber = 5,
+  };
+
+  using FieldMetadata_DevMajor =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4TrimExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DevMajor kDevMajor() { return {}; }
+  void set_dev_major(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DevMajor::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DevMinor =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4TrimExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DevMinor kDevMinor() { return {}; }
+  void set_dev_minor(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DevMinor::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Group =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4TrimExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Group kGroup() { return {}; }
+  void set_group(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Group::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Start =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4TrimExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Start kStart() { return {}; }
+  void set_start(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Start::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4TrimExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4TrimAllFreeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4TrimAllFreeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4TrimAllFreeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4TrimAllFreeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev_major() const { return at<1>().valid(); }
+  int32_t dev_major() const { return at<1>().as_int32(); }
+  bool has_dev_minor() const { return at<2>().valid(); }
+  int32_t dev_minor() const { return at<2>().as_int32(); }
+  bool has_group() const { return at<3>().valid(); }
+  uint32_t group() const { return at<3>().as_uint32(); }
+  bool has_start() const { return at<4>().valid(); }
+  int32_t start() const { return at<4>().as_int32(); }
+  bool has_len() const { return at<5>().valid(); }
+  int32_t len() const { return at<5>().as_int32(); }
+};
+
+class Ext4TrimAllFreeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4TrimAllFreeFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevMajorFieldNumber = 1,
+    kDevMinorFieldNumber = 2,
+    kGroupFieldNumber = 3,
+    kStartFieldNumber = 4,
+    kLenFieldNumber = 5,
+  };
+
+  using FieldMetadata_DevMajor =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4TrimAllFreeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DevMajor kDevMajor() { return {}; }
+  void set_dev_major(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DevMajor::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DevMinor =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4TrimAllFreeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DevMinor kDevMinor() { return {}; }
+  void set_dev_minor(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DevMinor::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Group =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4TrimAllFreeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Group kGroup() { return {}; }
+  void set_group(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Group::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Start =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4TrimAllFreeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Start kStart() { return {}; }
+  void set_start(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Start::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4TrimAllFreeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4SyncFsFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4SyncFsFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4SyncFsFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4SyncFsFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_wait() const { return at<2>().valid(); }
+  int32_t wait() const { return at<2>().as_int32(); }
+};
+
+class Ext4SyncFsFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4SyncFsFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kWaitFieldNumber = 2,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4SyncFsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Wait =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4SyncFsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Wait kWait() { return {}; }
+  void set_wait(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Wait::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4RequestInodeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4RequestInodeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4RequestInodeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4RequestInodeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_dir() const { return at<2>().valid(); }
+  uint64_t dir() const { return at<2>().as_uint64(); }
+  bool has_mode() const { return at<3>().valid(); }
+  uint32_t mode() const { return at<3>().as_uint32(); }
+};
+
+class Ext4RequestInodeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4RequestInodeFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kDirFieldNumber = 2,
+    kModeFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4RequestInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Dir =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4RequestInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dir kDir() { return {}; }
+  void set_dir(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dir::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Mode =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4RequestInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mode kMode() { return {}; }
+  void set_mode(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4RequestBlocksFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/10, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4RequestBlocksFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4RequestBlocksFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4RequestBlocksFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_len() const { return at<3>().valid(); }
+  uint32_t len() const { return at<3>().as_uint32(); }
+  bool has_logical() const { return at<4>().valid(); }
+  uint32_t logical() const { return at<4>().as_uint32(); }
+  bool has_lleft() const { return at<5>().valid(); }
+  uint32_t lleft() const { return at<5>().as_uint32(); }
+  bool has_lright() const { return at<6>().valid(); }
+  uint32_t lright() const { return at<6>().as_uint32(); }
+  bool has_goal() const { return at<7>().valid(); }
+  uint64_t goal() const { return at<7>().as_uint64(); }
+  bool has_pleft() const { return at<8>().valid(); }
+  uint64_t pleft() const { return at<8>().as_uint64(); }
+  bool has_pright() const { return at<9>().valid(); }
+  uint64_t pright() const { return at<9>().as_uint64(); }
+  bool has_flags() const { return at<10>().valid(); }
+  uint32_t flags() const { return at<10>().as_uint32(); }
+};
+
+class Ext4RequestBlocksFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4RequestBlocksFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kLenFieldNumber = 3,
+    kLogicalFieldNumber = 4,
+    kLleftFieldNumber = 5,
+    kLrightFieldNumber = 6,
+    kGoalFieldNumber = 7,
+    kPleftFieldNumber = 8,
+    kPrightFieldNumber = 9,
+    kFlagsFieldNumber = 10,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4RequestBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4RequestBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4RequestBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Logical =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4RequestBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Logical kLogical() { return {}; }
+  void set_logical(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Logical::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Lleft =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4RequestBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Lleft kLleft() { return {}; }
+  void set_lleft(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Lleft::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Lright =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4RequestBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Lright kLright() { return {}; }
+  void set_lright(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Lright::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Goal =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4RequestBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Goal kGoal() { return {}; }
+  void set_goal(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Goal::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pleft =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4RequestBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pleft kPleft() { return {}; }
+  void set_pleft(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pleft::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pright =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4RequestBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pright kPright() { return {}; }
+  void set_pright(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pright::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4RequestBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4RemoveBlocksFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4RemoveBlocksFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4RemoveBlocksFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4RemoveBlocksFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_from() const { return at<3>().valid(); }
+  uint32_t from() const { return at<3>().as_uint32(); }
+  bool has_to() const { return at<4>().valid(); }
+  uint32_t to() const { return at<4>().as_uint32(); }
+  bool has_partial() const { return at<5>().valid(); }
+  int64_t partial() const { return at<5>().as_int64(); }
+  bool has_ee_pblk() const { return at<6>().valid(); }
+  uint64_t ee_pblk() const { return at<6>().as_uint64(); }
+  bool has_ee_lblk() const { return at<7>().valid(); }
+  uint32_t ee_lblk() const { return at<7>().as_uint32(); }
+  bool has_ee_len() const { return at<8>().valid(); }
+  uint32_t ee_len() const { return at<8>().as_uint32(); }
+};
+
+class Ext4RemoveBlocksFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4RemoveBlocksFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kFromFieldNumber = 3,
+    kToFieldNumber = 4,
+    kPartialFieldNumber = 5,
+    kEePblkFieldNumber = 6,
+    kEeLblkFieldNumber = 7,
+    kEeLenFieldNumber = 8,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4RemoveBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4RemoveBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_From =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4RemoveBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_From kFrom() { return {}; }
+  void set_from(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_From::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_To =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4RemoveBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_To kTo() { return {}; }
+  void set_to(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_To::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Partial =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4RemoveBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Partial kPartial() { return {}; }
+  void set_partial(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Partial::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_EePblk =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4RemoveBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EePblk kEePblk() { return {}; }
+  void set_ee_pblk(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_EePblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_EeLblk =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4RemoveBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EeLblk kEeLblk() { return {}; }
+  void set_ee_lblk(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_EeLblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_EeLen =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4RemoveBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EeLen kEeLen() { return {}; }
+  void set_ee_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_EeLen::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4ReleasepageFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4ReleasepageFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4ReleasepageFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4ReleasepageFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_index() const { return at<3>().valid(); }
+  uint64_t index() const { return at<3>().as_uint64(); }
+};
+
+class Ext4ReleasepageFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4ReleasepageFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kIndexFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ReleasepageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ReleasepageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Index =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ReleasepageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Index kIndex() { return {}; }
+  void set_index(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Index::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4ReadpageFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4ReadpageFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4ReadpageFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4ReadpageFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_index() const { return at<3>().valid(); }
+  uint64_t index() const { return at<3>().as_uint64(); }
+};
+
+class Ext4ReadpageFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4ReadpageFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kIndexFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ReadpageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ReadpageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Index =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ReadpageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Index kIndex() { return {}; }
+  void set_index(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Index::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4ReadBlockBitmapLoadFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4ReadBlockBitmapLoadFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4ReadBlockBitmapLoadFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4ReadBlockBitmapLoadFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_group() const { return at<2>().valid(); }
+  uint32_t group() const { return at<2>().as_uint32(); }
+};
+
+class Ext4ReadBlockBitmapLoadFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4ReadBlockBitmapLoadFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kGroupFieldNumber = 2,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ReadBlockBitmapLoadFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Group =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ReadBlockBitmapLoadFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Group kGroup() { return {}; }
+  void set_group(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Group::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4PunchHoleFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4PunchHoleFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4PunchHoleFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4PunchHoleFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_offset() const { return at<3>().valid(); }
+  int64_t offset() const { return at<3>().as_int64(); }
+  bool has_len() const { return at<4>().valid(); }
+  int64_t len() const { return at<4>().as_int64(); }
+  bool has_mode() const { return at<5>().valid(); }
+  int32_t mode() const { return at<5>().as_int32(); }
+};
+
+class Ext4PunchHoleFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4PunchHoleFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kOffsetFieldNumber = 3,
+    kLenFieldNumber = 4,
+    kModeFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4PunchHoleFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4PunchHoleFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Offset =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4PunchHoleFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Offset kOffset() { return {}; }
+  void set_offset(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Offset::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4PunchHoleFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Mode =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4PunchHoleFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mode kMode() { return {}; }
+  void set_mode(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4OtherInodeUpdateTimeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4OtherInodeUpdateTimeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4OtherInodeUpdateTimeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4OtherInodeUpdateTimeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_orig_ino() const { return at<3>().valid(); }
+  uint64_t orig_ino() const { return at<3>().as_uint64(); }
+  bool has_uid() const { return at<4>().valid(); }
+  uint32_t uid() const { return at<4>().as_uint32(); }
+  bool has_gid() const { return at<5>().valid(); }
+  uint32_t gid() const { return at<5>().as_uint32(); }
+  bool has_mode() const { return at<6>().valid(); }
+  uint32_t mode() const { return at<6>().as_uint32(); }
+};
+
+class Ext4OtherInodeUpdateTimeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4OtherInodeUpdateTimeFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kOrigInoFieldNumber = 3,
+    kUidFieldNumber = 4,
+    kGidFieldNumber = 5,
+    kModeFieldNumber = 6,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4OtherInodeUpdateTimeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4OtherInodeUpdateTimeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OrigIno =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4OtherInodeUpdateTimeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OrigIno kOrigIno() { return {}; }
+  void set_orig_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OrigIno::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Uid =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4OtherInodeUpdateTimeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Uid kUid() { return {}; }
+  void set_uid(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Uid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Gid =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4OtherInodeUpdateTimeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Gid kGid() { return {}; }
+  void set_gid(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Gid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Mode =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4OtherInodeUpdateTimeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mode kMode() { return {}; }
+  void set_mode(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4MballocPreallocFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/10, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4MballocPreallocFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4MballocPreallocFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4MballocPreallocFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_orig_logical() const { return at<3>().valid(); }
+  uint32_t orig_logical() const { return at<3>().as_uint32(); }
+  bool has_orig_start() const { return at<4>().valid(); }
+  int32_t orig_start() const { return at<4>().as_int32(); }
+  bool has_orig_group() const { return at<5>().valid(); }
+  uint32_t orig_group() const { return at<5>().as_uint32(); }
+  bool has_orig_len() const { return at<6>().valid(); }
+  int32_t orig_len() const { return at<6>().as_int32(); }
+  bool has_result_logical() const { return at<7>().valid(); }
+  uint32_t result_logical() const { return at<7>().as_uint32(); }
+  bool has_result_start() const { return at<8>().valid(); }
+  int32_t result_start() const { return at<8>().as_int32(); }
+  bool has_result_group() const { return at<9>().valid(); }
+  uint32_t result_group() const { return at<9>().as_uint32(); }
+  bool has_result_len() const { return at<10>().valid(); }
+  int32_t result_len() const { return at<10>().as_int32(); }
+};
+
+class Ext4MballocPreallocFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4MballocPreallocFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kOrigLogicalFieldNumber = 3,
+    kOrigStartFieldNumber = 4,
+    kOrigGroupFieldNumber = 5,
+    kOrigLenFieldNumber = 6,
+    kResultLogicalFieldNumber = 7,
+    kResultStartFieldNumber = 8,
+    kResultGroupFieldNumber = 9,
+    kResultLenFieldNumber = 10,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4MballocPreallocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4MballocPreallocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OrigLogical =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4MballocPreallocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OrigLogical kOrigLogical() { return {}; }
+  void set_orig_logical(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OrigLogical::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OrigStart =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4MballocPreallocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OrigStart kOrigStart() { return {}; }
+  void set_orig_start(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OrigStart::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OrigGroup =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4MballocPreallocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OrigGroup kOrigGroup() { return {}; }
+  void set_orig_group(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OrigGroup::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OrigLen =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4MballocPreallocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OrigLen kOrigLen() { return {}; }
+  void set_orig_len(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OrigLen::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ResultLogical =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4MballocPreallocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ResultLogical kResultLogical() { return {}; }
+  void set_result_logical(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ResultLogical::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ResultStart =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4MballocPreallocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ResultStart kResultStart() { return {}; }
+  void set_result_start(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ResultStart::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ResultGroup =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4MballocPreallocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ResultGroup kResultGroup() { return {}; }
+  void set_result_group(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ResultGroup::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ResultLen =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4MballocPreallocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ResultLen kResultLen() { return {}; }
+  void set_result_len(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ResultLen::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4MballocFreeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4MballocFreeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4MballocFreeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4MballocFreeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_result_start() const { return at<3>().valid(); }
+  int32_t result_start() const { return at<3>().as_int32(); }
+  bool has_result_group() const { return at<4>().valid(); }
+  uint32_t result_group() const { return at<4>().as_uint32(); }
+  bool has_result_len() const { return at<5>().valid(); }
+  int32_t result_len() const { return at<5>().as_int32(); }
+};
+
+class Ext4MballocFreeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4MballocFreeFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kResultStartFieldNumber = 3,
+    kResultGroupFieldNumber = 4,
+    kResultLenFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4MballocFreeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4MballocFreeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ResultStart =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4MballocFreeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ResultStart kResultStart() { return {}; }
+  void set_result_start(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ResultStart::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ResultGroup =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4MballocFreeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ResultGroup kResultGroup() { return {}; }
+  void set_result_group(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ResultGroup::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ResultLen =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4MballocFreeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ResultLen kResultLen() { return {}; }
+  void set_result_len(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ResultLen::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4MballocDiscardFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4MballocDiscardFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4MballocDiscardFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4MballocDiscardFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_result_start() const { return at<3>().valid(); }
+  int32_t result_start() const { return at<3>().as_int32(); }
+  bool has_result_group() const { return at<4>().valid(); }
+  uint32_t result_group() const { return at<4>().as_uint32(); }
+  bool has_result_len() const { return at<5>().valid(); }
+  int32_t result_len() const { return at<5>().as_int32(); }
+};
+
+class Ext4MballocDiscardFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4MballocDiscardFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kResultStartFieldNumber = 3,
+    kResultGroupFieldNumber = 4,
+    kResultLenFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4MballocDiscardFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4MballocDiscardFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ResultStart =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4MballocDiscardFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ResultStart kResultStart() { return {}; }
+  void set_result_start(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ResultStart::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ResultGroup =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4MballocDiscardFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ResultGroup kResultGroup() { return {}; }
+  void set_result_group(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ResultGroup::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ResultLen =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4MballocDiscardFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ResultLen kResultLen() { return {}; }
+  void set_result_len(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ResultLen::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4MballocAllocFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/20, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4MballocAllocFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4MballocAllocFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4MballocAllocFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_orig_logical() const { return at<3>().valid(); }
+  uint32_t orig_logical() const { return at<3>().as_uint32(); }
+  bool has_orig_start() const { return at<4>().valid(); }
+  int32_t orig_start() const { return at<4>().as_int32(); }
+  bool has_orig_group() const { return at<5>().valid(); }
+  uint32_t orig_group() const { return at<5>().as_uint32(); }
+  bool has_orig_len() const { return at<6>().valid(); }
+  int32_t orig_len() const { return at<6>().as_int32(); }
+  bool has_goal_logical() const { return at<7>().valid(); }
+  uint32_t goal_logical() const { return at<7>().as_uint32(); }
+  bool has_goal_start() const { return at<8>().valid(); }
+  int32_t goal_start() const { return at<8>().as_int32(); }
+  bool has_goal_group() const { return at<9>().valid(); }
+  uint32_t goal_group() const { return at<9>().as_uint32(); }
+  bool has_goal_len() const { return at<10>().valid(); }
+  int32_t goal_len() const { return at<10>().as_int32(); }
+  bool has_result_logical() const { return at<11>().valid(); }
+  uint32_t result_logical() const { return at<11>().as_uint32(); }
+  bool has_result_start() const { return at<12>().valid(); }
+  int32_t result_start() const { return at<12>().as_int32(); }
+  bool has_result_group() const { return at<13>().valid(); }
+  uint32_t result_group() const { return at<13>().as_uint32(); }
+  bool has_result_len() const { return at<14>().valid(); }
+  int32_t result_len() const { return at<14>().as_int32(); }
+  bool has_found() const { return at<15>().valid(); }
+  uint32_t found() const { return at<15>().as_uint32(); }
+  bool has_groups() const { return at<16>().valid(); }
+  uint32_t groups() const { return at<16>().as_uint32(); }
+  bool has_buddy() const { return at<17>().valid(); }
+  uint32_t buddy() const { return at<17>().as_uint32(); }
+  bool has_flags() const { return at<18>().valid(); }
+  uint32_t flags() const { return at<18>().as_uint32(); }
+  bool has_tail() const { return at<19>().valid(); }
+  uint32_t tail() const { return at<19>().as_uint32(); }
+  bool has_cr() const { return at<20>().valid(); }
+  uint32_t cr() const { return at<20>().as_uint32(); }
+};
+
+class Ext4MballocAllocFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4MballocAllocFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kOrigLogicalFieldNumber = 3,
+    kOrigStartFieldNumber = 4,
+    kOrigGroupFieldNumber = 5,
+    kOrigLenFieldNumber = 6,
+    kGoalLogicalFieldNumber = 7,
+    kGoalStartFieldNumber = 8,
+    kGoalGroupFieldNumber = 9,
+    kGoalLenFieldNumber = 10,
+    kResultLogicalFieldNumber = 11,
+    kResultStartFieldNumber = 12,
+    kResultGroupFieldNumber = 13,
+    kResultLenFieldNumber = 14,
+    kFoundFieldNumber = 15,
+    kGroupsFieldNumber = 16,
+    kBuddyFieldNumber = 17,
+    kFlagsFieldNumber = 18,
+    kTailFieldNumber = 19,
+    kCrFieldNumber = 20,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4MballocAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4MballocAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OrigLogical =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4MballocAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OrigLogical kOrigLogical() { return {}; }
+  void set_orig_logical(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OrigLogical::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OrigStart =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4MballocAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OrigStart kOrigStart() { return {}; }
+  void set_orig_start(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OrigStart::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OrigGroup =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4MballocAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OrigGroup kOrigGroup() { return {}; }
+  void set_orig_group(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OrigGroup::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OrigLen =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4MballocAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OrigLen kOrigLen() { return {}; }
+  void set_orig_len(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OrigLen::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_GoalLogical =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4MballocAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GoalLogical kGoalLogical() { return {}; }
+  void set_goal_logical(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_GoalLogical::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_GoalStart =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4MballocAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GoalStart kGoalStart() { return {}; }
+  void set_goal_start(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_GoalStart::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_GoalGroup =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4MballocAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GoalGroup kGoalGroup() { return {}; }
+  void set_goal_group(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_GoalGroup::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_GoalLen =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4MballocAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GoalLen kGoalLen() { return {}; }
+  void set_goal_len(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_GoalLen::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ResultLogical =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4MballocAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ResultLogical kResultLogical() { return {}; }
+  void set_result_logical(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ResultLogical::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ResultStart =
+    ::protozero::proto_utils::FieldMetadata<
+      12,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4MballocAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ResultStart kResultStart() { return {}; }
+  void set_result_start(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ResultStart::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ResultGroup =
+    ::protozero::proto_utils::FieldMetadata<
+      13,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4MballocAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ResultGroup kResultGroup() { return {}; }
+  void set_result_group(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ResultGroup::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ResultLen =
+    ::protozero::proto_utils::FieldMetadata<
+      14,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4MballocAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ResultLen kResultLen() { return {}; }
+  void set_result_len(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ResultLen::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Found =
+    ::protozero::proto_utils::FieldMetadata<
+      15,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4MballocAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Found kFound() { return {}; }
+  void set_found(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Found::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Groups =
+    ::protozero::proto_utils::FieldMetadata<
+      16,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4MballocAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Groups kGroups() { return {}; }
+  void set_groups(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Groups::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Buddy =
+    ::protozero::proto_utils::FieldMetadata<
+      17,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4MballocAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Buddy kBuddy() { return {}; }
+  void set_buddy(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Buddy::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      18,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4MballocAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Tail =
+    ::protozero::proto_utils::FieldMetadata<
+      19,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4MballocAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Tail kTail() { return {}; }
+  void set_tail(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Tail::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Cr =
+    ::protozero::proto_utils::FieldMetadata<
+      20,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4MballocAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cr kCr() { return {}; }
+  void set_cr(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4MbReleaseInodePaFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4MbReleaseInodePaFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4MbReleaseInodePaFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4MbReleaseInodePaFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_block() const { return at<3>().valid(); }
+  uint64_t block() const { return at<3>().as_uint64(); }
+  bool has_count() const { return at<4>().valid(); }
+  uint32_t count() const { return at<4>().as_uint32(); }
+};
+
+class Ext4MbReleaseInodePaFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4MbReleaseInodePaFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kBlockFieldNumber = 3,
+    kCountFieldNumber = 4,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4MbReleaseInodePaFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4MbReleaseInodePaFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Block =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4MbReleaseInodePaFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Block kBlock() { return {}; }
+  void set_block(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Block::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Count =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4MbReleaseInodePaFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Count kCount() { return {}; }
+  void set_count(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Count::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4MbReleaseGroupPaFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4MbReleaseGroupPaFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4MbReleaseGroupPaFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4MbReleaseGroupPaFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_pa_pstart() const { return at<2>().valid(); }
+  uint64_t pa_pstart() const { return at<2>().as_uint64(); }
+  bool has_pa_len() const { return at<3>().valid(); }
+  uint32_t pa_len() const { return at<3>().as_uint32(); }
+};
+
+class Ext4MbReleaseGroupPaFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4MbReleaseGroupPaFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kPaPstartFieldNumber = 2,
+    kPaLenFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4MbReleaseGroupPaFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PaPstart =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4MbReleaseGroupPaFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PaPstart kPaPstart() { return {}; }
+  void set_pa_pstart(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PaPstart::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PaLen =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4MbReleaseGroupPaFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PaLen kPaLen() { return {}; }
+  void set_pa_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PaLen::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4MbNewInodePaFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4MbNewInodePaFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4MbNewInodePaFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4MbNewInodePaFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_pa_pstart() const { return at<3>().valid(); }
+  uint64_t pa_pstart() const { return at<3>().as_uint64(); }
+  bool has_pa_lstart() const { return at<4>().valid(); }
+  uint64_t pa_lstart() const { return at<4>().as_uint64(); }
+  bool has_pa_len() const { return at<5>().valid(); }
+  uint32_t pa_len() const { return at<5>().as_uint32(); }
+};
+
+class Ext4MbNewInodePaFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4MbNewInodePaFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kPaPstartFieldNumber = 3,
+    kPaLstartFieldNumber = 4,
+    kPaLenFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4MbNewInodePaFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4MbNewInodePaFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PaPstart =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4MbNewInodePaFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PaPstart kPaPstart() { return {}; }
+  void set_pa_pstart(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PaPstart::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PaLstart =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4MbNewInodePaFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PaLstart kPaLstart() { return {}; }
+  void set_pa_lstart(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PaLstart::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PaLen =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4MbNewInodePaFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PaLen kPaLen() { return {}; }
+  void set_pa_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PaLen::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4MbNewGroupPaFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4MbNewGroupPaFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4MbNewGroupPaFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4MbNewGroupPaFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_pa_pstart() const { return at<3>().valid(); }
+  uint64_t pa_pstart() const { return at<3>().as_uint64(); }
+  bool has_pa_lstart() const { return at<4>().valid(); }
+  uint64_t pa_lstart() const { return at<4>().as_uint64(); }
+  bool has_pa_len() const { return at<5>().valid(); }
+  uint32_t pa_len() const { return at<5>().as_uint32(); }
+};
+
+class Ext4MbNewGroupPaFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4MbNewGroupPaFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kPaPstartFieldNumber = 3,
+    kPaLstartFieldNumber = 4,
+    kPaLenFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4MbNewGroupPaFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4MbNewGroupPaFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PaPstart =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4MbNewGroupPaFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PaPstart kPaPstart() { return {}; }
+  void set_pa_pstart(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PaPstart::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PaLstart =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4MbNewGroupPaFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PaLstart kPaLstart() { return {}; }
+  void set_pa_lstart(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PaLstart::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PaLen =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4MbNewGroupPaFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PaLen kPaLen() { return {}; }
+  void set_pa_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PaLen::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4MbDiscardPreallocationsFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4MbDiscardPreallocationsFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4MbDiscardPreallocationsFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4MbDiscardPreallocationsFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_needed() const { return at<2>().valid(); }
+  int32_t needed() const { return at<2>().as_int32(); }
+};
+
+class Ext4MbDiscardPreallocationsFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4MbDiscardPreallocationsFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kNeededFieldNumber = 2,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4MbDiscardPreallocationsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Needed =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4MbDiscardPreallocationsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Needed kNeeded() { return {}; }
+  void set_needed(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Needed::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4MbBuddyBitmapLoadFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4MbBuddyBitmapLoadFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4MbBuddyBitmapLoadFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4MbBuddyBitmapLoadFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_group() const { return at<2>().valid(); }
+  uint32_t group() const { return at<2>().as_uint32(); }
+};
+
+class Ext4MbBuddyBitmapLoadFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4MbBuddyBitmapLoadFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kGroupFieldNumber = 2,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4MbBuddyBitmapLoadFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Group =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4MbBuddyBitmapLoadFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Group kGroup() { return {}; }
+  void set_group(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Group::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4MbBitmapLoadFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4MbBitmapLoadFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4MbBitmapLoadFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4MbBitmapLoadFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_group() const { return at<2>().valid(); }
+  uint32_t group() const { return at<2>().as_uint32(); }
+};
+
+class Ext4MbBitmapLoadFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4MbBitmapLoadFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kGroupFieldNumber = 2,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4MbBitmapLoadFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Group =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4MbBitmapLoadFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Group kGroup() { return {}; }
+  void set_group(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Group::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4MarkInodeDirtyFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4MarkInodeDirtyFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4MarkInodeDirtyFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4MarkInodeDirtyFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_ip() const { return at<3>().valid(); }
+  uint64_t ip() const { return at<3>().as_uint64(); }
+};
+
+class Ext4MarkInodeDirtyFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4MarkInodeDirtyFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kIpFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4MarkInodeDirtyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4MarkInodeDirtyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ip =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4MarkInodeDirtyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ip kIp() { return {}; }
+  void set_ip(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ip::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4LoadInodeBitmapFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4LoadInodeBitmapFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4LoadInodeBitmapFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4LoadInodeBitmapFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_group() const { return at<2>().valid(); }
+  uint32_t group() const { return at<2>().as_uint32(); }
+};
+
+class Ext4LoadInodeBitmapFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4LoadInodeBitmapFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kGroupFieldNumber = 2,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4LoadInodeBitmapFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Group =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4LoadInodeBitmapFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Group kGroup() { return {}; }
+  void set_group(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Group::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4LoadInodeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4LoadInodeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4LoadInodeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4LoadInodeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+};
+
+class Ext4LoadInodeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4LoadInodeFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4LoadInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4LoadInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4JournalledWriteEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4JournalledWriteEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4JournalledWriteEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4JournalledWriteEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_pos() const { return at<3>().valid(); }
+  int64_t pos() const { return at<3>().as_int64(); }
+  bool has_len() const { return at<4>().valid(); }
+  uint32_t len() const { return at<4>().as_uint32(); }
+  bool has_copied() const { return at<5>().valid(); }
+  uint32_t copied() const { return at<5>().as_uint32(); }
+};
+
+class Ext4JournalledWriteEndFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4JournalledWriteEndFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kPosFieldNumber = 3,
+    kLenFieldNumber = 4,
+    kCopiedFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4JournalledWriteEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4JournalledWriteEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pos =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4JournalledWriteEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pos kPos() { return {}; }
+  void set_pos(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pos::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4JournalledWriteEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Copied =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4JournalledWriteEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Copied kCopied() { return {}; }
+  void set_copied(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Copied::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4JournalledInvalidatepageFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4JournalledInvalidatepageFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4JournalledInvalidatepageFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4JournalledInvalidatepageFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_index() const { return at<3>().valid(); }
+  uint64_t index() const { return at<3>().as_uint64(); }
+  bool has_offset() const { return at<4>().valid(); }
+  uint64_t offset() const { return at<4>().as_uint64(); }
+  bool has_length() const { return at<5>().valid(); }
+  uint32_t length() const { return at<5>().as_uint32(); }
+};
+
+class Ext4JournalledInvalidatepageFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4JournalledInvalidatepageFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kIndexFieldNumber = 3,
+    kOffsetFieldNumber = 4,
+    kLengthFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4JournalledInvalidatepageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4JournalledInvalidatepageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Index =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4JournalledInvalidatepageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Index kIndex() { return {}; }
+  void set_index(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Index::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Offset =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4JournalledInvalidatepageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Offset kOffset() { return {}; }
+  void set_offset(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Offset::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Length =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4JournalledInvalidatepageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Length kLength() { return {}; }
+  void set_length(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Length::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4JournalStartReservedFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4JournalStartReservedFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4JournalStartReservedFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4JournalStartReservedFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ip() const { return at<2>().valid(); }
+  uint64_t ip() const { return at<2>().as_uint64(); }
+  bool has_blocks() const { return at<3>().valid(); }
+  int32_t blocks() const { return at<3>().as_int32(); }
+};
+
+class Ext4JournalStartReservedFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4JournalStartReservedFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kIpFieldNumber = 2,
+    kBlocksFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4JournalStartReservedFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ip =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4JournalStartReservedFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ip kIp() { return {}; }
+  void set_ip(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ip::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Blocks =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4JournalStartReservedFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Blocks kBlocks() { return {}; }
+  void set_blocks(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Blocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4JournalStartFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4JournalStartFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4JournalStartFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4JournalStartFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ip() const { return at<2>().valid(); }
+  uint64_t ip() const { return at<2>().as_uint64(); }
+  bool has_blocks() const { return at<3>().valid(); }
+  int32_t blocks() const { return at<3>().as_int32(); }
+  bool has_rsv_blocks() const { return at<4>().valid(); }
+  int32_t rsv_blocks() const { return at<4>().as_int32(); }
+  bool has_nblocks() const { return at<5>().valid(); }
+  int32_t nblocks() const { return at<5>().as_int32(); }
+};
+
+class Ext4JournalStartFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4JournalStartFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kIpFieldNumber = 2,
+    kBlocksFieldNumber = 3,
+    kRsvBlocksFieldNumber = 4,
+    kNblocksFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4JournalStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ip =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4JournalStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ip kIp() { return {}; }
+  void set_ip(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ip::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Blocks =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4JournalStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Blocks kBlocks() { return {}; }
+  void set_blocks(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Blocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_RsvBlocks =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4JournalStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RsvBlocks kRsvBlocks() { return {}; }
+  void set_rsv_blocks(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_RsvBlocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Nblocks =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4JournalStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Nblocks kNblocks() { return {}; }
+  void set_nblocks(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Nblocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4InvalidatepageFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4InvalidatepageFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4InvalidatepageFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4InvalidatepageFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_index() const { return at<3>().valid(); }
+  uint64_t index() const { return at<3>().as_uint64(); }
+  bool has_offset() const { return at<4>().valid(); }
+  uint64_t offset() const { return at<4>().as_uint64(); }
+  bool has_length() const { return at<5>().valid(); }
+  uint32_t length() const { return at<5>().as_uint32(); }
+};
+
+class Ext4InvalidatepageFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4InvalidatepageFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kIndexFieldNumber = 3,
+    kOffsetFieldNumber = 4,
+    kLengthFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4InvalidatepageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4InvalidatepageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Index =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4InvalidatepageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Index kIndex() { return {}; }
+  void set_index(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Index::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Offset =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4InvalidatepageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Offset kOffset() { return {}; }
+  void set_offset(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Offset::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Length =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4InvalidatepageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Length kLength() { return {}; }
+  void set_length(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Length::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4InsertRangeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4InsertRangeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4InsertRangeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4InsertRangeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_offset() const { return at<3>().valid(); }
+  int64_t offset() const { return at<3>().as_int64(); }
+  bool has_len() const { return at<4>().valid(); }
+  int64_t len() const { return at<4>().as_int64(); }
+};
+
+class Ext4InsertRangeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4InsertRangeFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kOffsetFieldNumber = 3,
+    kLenFieldNumber = 4,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4InsertRangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4InsertRangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Offset =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4InsertRangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Offset kOffset() { return {}; }
+  void set_offset(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Offset::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4InsertRangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4IndMapBlocksExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4IndMapBlocksExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4IndMapBlocksExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4IndMapBlocksExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_flags() const { return at<3>().valid(); }
+  uint32_t flags() const { return at<3>().as_uint32(); }
+  bool has_pblk() const { return at<4>().valid(); }
+  uint64_t pblk() const { return at<4>().as_uint64(); }
+  bool has_lblk() const { return at<5>().valid(); }
+  uint32_t lblk() const { return at<5>().as_uint32(); }
+  bool has_len() const { return at<6>().valid(); }
+  uint32_t len() const { return at<6>().as_uint32(); }
+  bool has_mflags() const { return at<7>().valid(); }
+  uint32_t mflags() const { return at<7>().as_uint32(); }
+  bool has_ret() const { return at<8>().valid(); }
+  int32_t ret() const { return at<8>().as_int32(); }
+};
+
+class Ext4IndMapBlocksExitFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4IndMapBlocksExitFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kFlagsFieldNumber = 3,
+    kPblkFieldNumber = 4,
+    kLblkFieldNumber = 5,
+    kLenFieldNumber = 6,
+    kMflagsFieldNumber = 7,
+    kRetFieldNumber = 8,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4IndMapBlocksExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4IndMapBlocksExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4IndMapBlocksExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pblk =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4IndMapBlocksExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pblk kPblk() { return {}; }
+  void set_pblk(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Lblk =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4IndMapBlocksExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Lblk kLblk() { return {}; }
+  void set_lblk(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Lblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4IndMapBlocksExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Mflags =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4IndMapBlocksExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mflags kMflags() { return {}; }
+  void set_mflags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mflags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ret =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4IndMapBlocksExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ret kRet() { return {}; }
+  void set_ret(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ret::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4IndMapBlocksEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4IndMapBlocksEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4IndMapBlocksEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4IndMapBlocksEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_lblk() const { return at<3>().valid(); }
+  uint32_t lblk() const { return at<3>().as_uint32(); }
+  bool has_len() const { return at<4>().valid(); }
+  uint32_t len() const { return at<4>().as_uint32(); }
+  bool has_flags() const { return at<5>().valid(); }
+  uint32_t flags() const { return at<5>().as_uint32(); }
+};
+
+class Ext4IndMapBlocksEnterFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4IndMapBlocksEnterFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kLblkFieldNumber = 3,
+    kLenFieldNumber = 4,
+    kFlagsFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4IndMapBlocksEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4IndMapBlocksEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Lblk =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4IndMapBlocksEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Lblk kLblk() { return {}; }
+  void set_lblk(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Lblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4IndMapBlocksEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4IndMapBlocksEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4GetReservedClusterAllocFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4GetReservedClusterAllocFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4GetReservedClusterAllocFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4GetReservedClusterAllocFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_lblk() const { return at<3>().valid(); }
+  uint32_t lblk() const { return at<3>().as_uint32(); }
+  bool has_len() const { return at<4>().valid(); }
+  uint32_t len() const { return at<4>().as_uint32(); }
+};
+
+class Ext4GetReservedClusterAllocFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4GetReservedClusterAllocFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kLblkFieldNumber = 3,
+    kLenFieldNumber = 4,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4GetReservedClusterAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4GetReservedClusterAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Lblk =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4GetReservedClusterAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Lblk kLblk() { return {}; }
+  void set_lblk(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Lblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4GetReservedClusterAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4GetImpliedClusterAllocExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4GetImpliedClusterAllocExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4GetImpliedClusterAllocExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4GetImpliedClusterAllocExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_flags() const { return at<2>().valid(); }
+  uint32_t flags() const { return at<2>().as_uint32(); }
+  bool has_lblk() const { return at<3>().valid(); }
+  uint32_t lblk() const { return at<3>().as_uint32(); }
+  bool has_pblk() const { return at<4>().valid(); }
+  uint64_t pblk() const { return at<4>().as_uint64(); }
+  bool has_len() const { return at<5>().valid(); }
+  uint32_t len() const { return at<5>().as_uint32(); }
+  bool has_ret() const { return at<6>().valid(); }
+  int32_t ret() const { return at<6>().as_int32(); }
+};
+
+class Ext4GetImpliedClusterAllocExitFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4GetImpliedClusterAllocExitFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kFlagsFieldNumber = 2,
+    kLblkFieldNumber = 3,
+    kPblkFieldNumber = 4,
+    kLenFieldNumber = 5,
+    kRetFieldNumber = 6,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4GetImpliedClusterAllocExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4GetImpliedClusterAllocExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Lblk =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4GetImpliedClusterAllocExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Lblk kLblk() { return {}; }
+  void set_lblk(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Lblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pblk =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4GetImpliedClusterAllocExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pblk kPblk() { return {}; }
+  void set_pblk(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4GetImpliedClusterAllocExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ret =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4GetImpliedClusterAllocExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ret kRet() { return {}; }
+  void set_ret(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ret::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4FreeInodeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4FreeInodeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4FreeInodeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4FreeInodeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_uid() const { return at<3>().valid(); }
+  uint32_t uid() const { return at<3>().as_uint32(); }
+  bool has_gid() const { return at<4>().valid(); }
+  uint32_t gid() const { return at<4>().as_uint32(); }
+  bool has_blocks() const { return at<5>().valid(); }
+  uint64_t blocks() const { return at<5>().as_uint64(); }
+  bool has_mode() const { return at<6>().valid(); }
+  uint32_t mode() const { return at<6>().as_uint32(); }
+};
+
+class Ext4FreeInodeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4FreeInodeFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kUidFieldNumber = 3,
+    kGidFieldNumber = 4,
+    kBlocksFieldNumber = 5,
+    kModeFieldNumber = 6,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4FreeInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4FreeInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Uid =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4FreeInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Uid kUid() { return {}; }
+  void set_uid(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Uid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Gid =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4FreeInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Gid kGid() { return {}; }
+  void set_gid(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Gid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Blocks =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4FreeInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Blocks kBlocks() { return {}; }
+  void set_blocks(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Blocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Mode =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4FreeInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mode kMode() { return {}; }
+  void set_mode(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4FreeBlocksFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4FreeBlocksFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4FreeBlocksFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4FreeBlocksFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_block() const { return at<3>().valid(); }
+  uint64_t block() const { return at<3>().as_uint64(); }
+  bool has_count() const { return at<4>().valid(); }
+  uint64_t count() const { return at<4>().as_uint64(); }
+  bool has_flags() const { return at<5>().valid(); }
+  int32_t flags() const { return at<5>().as_int32(); }
+  bool has_mode() const { return at<6>().valid(); }
+  uint32_t mode() const { return at<6>().as_uint32(); }
+};
+
+class Ext4FreeBlocksFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4FreeBlocksFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kBlockFieldNumber = 3,
+    kCountFieldNumber = 4,
+    kFlagsFieldNumber = 5,
+    kModeFieldNumber = 6,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4FreeBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4FreeBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Block =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4FreeBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Block kBlock() { return {}; }
+  void set_block(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Block::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Count =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4FreeBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Count kCount() { return {}; }
+  void set_count(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Count::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4FreeBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Mode =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4FreeBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mode kMode() { return {}; }
+  void set_mode(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4ForgetFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4ForgetFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4ForgetFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4ForgetFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_block() const { return at<3>().valid(); }
+  uint64_t block() const { return at<3>().as_uint64(); }
+  bool has_is_metadata() const { return at<4>().valid(); }
+  int32_t is_metadata() const { return at<4>().as_int32(); }
+  bool has_mode() const { return at<5>().valid(); }
+  uint32_t mode() const { return at<5>().as_uint32(); }
+};
+
+class Ext4ForgetFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4ForgetFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kBlockFieldNumber = 3,
+    kIsMetadataFieldNumber = 4,
+    kModeFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ForgetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ForgetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Block =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ForgetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Block kBlock() { return {}; }
+  void set_block(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Block::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IsMetadata =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4ForgetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IsMetadata kIsMetadata() { return {}; }
+  void set_is_metadata(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IsMetadata::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Mode =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ForgetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mode kMode() { return {}; }
+  void set_mode(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4FindDelallocRangeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4FindDelallocRangeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4FindDelallocRangeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4FindDelallocRangeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_from() const { return at<3>().valid(); }
+  uint32_t from() const { return at<3>().as_uint32(); }
+  bool has_to() const { return at<4>().valid(); }
+  uint32_t to() const { return at<4>().as_uint32(); }
+  bool has_reverse() const { return at<5>().valid(); }
+  int32_t reverse() const { return at<5>().as_int32(); }
+  bool has_found() const { return at<6>().valid(); }
+  int32_t found() const { return at<6>().as_int32(); }
+  bool has_found_blk() const { return at<7>().valid(); }
+  uint32_t found_blk() const { return at<7>().as_uint32(); }
+};
+
+class Ext4FindDelallocRangeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4FindDelallocRangeFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kFromFieldNumber = 3,
+    kToFieldNumber = 4,
+    kReverseFieldNumber = 5,
+    kFoundFieldNumber = 6,
+    kFoundBlkFieldNumber = 7,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4FindDelallocRangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4FindDelallocRangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_From =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4FindDelallocRangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_From kFrom() { return {}; }
+  void set_from(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_From::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_To =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4FindDelallocRangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_To kTo() { return {}; }
+  void set_to(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_To::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Reverse =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4FindDelallocRangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Reverse kReverse() { return {}; }
+  void set_reverse(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Reverse::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Found =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4FindDelallocRangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Found kFound() { return {}; }
+  void set_found(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Found::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FoundBlk =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4FindDelallocRangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FoundBlk kFoundBlk() { return {}; }
+  void set_found_blk(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FoundBlk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4FallocateExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4FallocateExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4FallocateExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4FallocateExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_pos() const { return at<3>().valid(); }
+  int64_t pos() const { return at<3>().as_int64(); }
+  bool has_blocks() const { return at<4>().valid(); }
+  uint32_t blocks() const { return at<4>().as_uint32(); }
+  bool has_ret() const { return at<5>().valid(); }
+  int32_t ret() const { return at<5>().as_int32(); }
+};
+
+class Ext4FallocateExitFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4FallocateExitFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kPosFieldNumber = 3,
+    kBlocksFieldNumber = 4,
+    kRetFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4FallocateExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4FallocateExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pos =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4FallocateExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pos kPos() { return {}; }
+  void set_pos(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pos::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Blocks =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4FallocateExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Blocks kBlocks() { return {}; }
+  void set_blocks(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Blocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ret =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4FallocateExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ret kRet() { return {}; }
+  void set_ret(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ret::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4FallocateEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4FallocateEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4FallocateEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4FallocateEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_offset() const { return at<3>().valid(); }
+  int64_t offset() const { return at<3>().as_int64(); }
+  bool has_len() const { return at<4>().valid(); }
+  int64_t len() const { return at<4>().as_int64(); }
+  bool has_mode() const { return at<5>().valid(); }
+  int32_t mode() const { return at<5>().as_int32(); }
+  bool has_pos() const { return at<6>().valid(); }
+  int64_t pos() const { return at<6>().as_int64(); }
+};
+
+class Ext4FallocateEnterFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4FallocateEnterFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kOffsetFieldNumber = 3,
+    kLenFieldNumber = 4,
+    kModeFieldNumber = 5,
+    kPosFieldNumber = 6,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4FallocateEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4FallocateEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Offset =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4FallocateEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Offset kOffset() { return {}; }
+  void set_offset(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Offset::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4FallocateEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Mode =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4FallocateEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mode kMode() { return {}; }
+  void set_mode(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pos =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4FallocateEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pos kPos() { return {}; }
+  void set_pos(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pos::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4ExtShowExtentFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4ExtShowExtentFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4ExtShowExtentFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4ExtShowExtentFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_pblk() const { return at<3>().valid(); }
+  uint64_t pblk() const { return at<3>().as_uint64(); }
+  bool has_lblk() const { return at<4>().valid(); }
+  uint32_t lblk() const { return at<4>().as_uint32(); }
+  bool has_len() const { return at<5>().valid(); }
+  uint32_t len() const { return at<5>().as_uint32(); }
+};
+
+class Ext4ExtShowExtentFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4ExtShowExtentFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kPblkFieldNumber = 3,
+    kLblkFieldNumber = 4,
+    kLenFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtShowExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtShowExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pblk =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtShowExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pblk kPblk() { return {}; }
+  void set_pblk(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Lblk =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtShowExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Lblk kLblk() { return {}; }
+  void set_lblk(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Lblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtShowExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4ExtRmLeafFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4ExtRmLeafFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4ExtRmLeafFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4ExtRmLeafFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_partial() const { return at<3>().valid(); }
+  int64_t partial() const { return at<3>().as_int64(); }
+  bool has_start() const { return at<4>().valid(); }
+  uint32_t start() const { return at<4>().as_uint32(); }
+  bool has_ee_lblk() const { return at<5>().valid(); }
+  uint32_t ee_lblk() const { return at<5>().as_uint32(); }
+  bool has_ee_pblk() const { return at<6>().valid(); }
+  uint64_t ee_pblk() const { return at<6>().as_uint64(); }
+  bool has_ee_len() const { return at<7>().valid(); }
+  int32_t ee_len() const { return at<7>().as_int32(); }
+};
+
+class Ext4ExtRmLeafFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4ExtRmLeafFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kPartialFieldNumber = 3,
+    kStartFieldNumber = 4,
+    kEeLblkFieldNumber = 5,
+    kEePblkFieldNumber = 6,
+    kEeLenFieldNumber = 7,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtRmLeafFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtRmLeafFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Partial =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4ExtRmLeafFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Partial kPartial() { return {}; }
+  void set_partial(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Partial::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Start =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtRmLeafFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Start kStart() { return {}; }
+  void set_start(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Start::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_EeLblk =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtRmLeafFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EeLblk kEeLblk() { return {}; }
+  void set_ee_lblk(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_EeLblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_EePblk =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtRmLeafFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EePblk kEePblk() { return {}; }
+  void set_ee_pblk(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_EePblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_EeLen =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4ExtRmLeafFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EeLen kEeLen() { return {}; }
+  void set_ee_len(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_EeLen::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4ExtRmIdxFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4ExtRmIdxFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4ExtRmIdxFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4ExtRmIdxFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_pblk() const { return at<3>().valid(); }
+  uint64_t pblk() const { return at<3>().as_uint64(); }
+};
+
+class Ext4ExtRmIdxFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4ExtRmIdxFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kPblkFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtRmIdxFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtRmIdxFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pblk =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtRmIdxFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pblk kPblk() { return {}; }
+  void set_pblk(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4ExtRemoveSpaceDoneFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4ExtRemoveSpaceDoneFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4ExtRemoveSpaceDoneFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4ExtRemoveSpaceDoneFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_start() const { return at<3>().valid(); }
+  uint32_t start() const { return at<3>().as_uint32(); }
+  bool has_end() const { return at<4>().valid(); }
+  uint32_t end() const { return at<4>().as_uint32(); }
+  bool has_depth() const { return at<5>().valid(); }
+  int32_t depth() const { return at<5>().as_int32(); }
+  bool has_partial() const { return at<6>().valid(); }
+  int64_t partial() const { return at<6>().as_int64(); }
+  bool has_eh_entries() const { return at<7>().valid(); }
+  uint32_t eh_entries() const { return at<7>().as_uint32(); }
+};
+
+class Ext4ExtRemoveSpaceDoneFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4ExtRemoveSpaceDoneFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kStartFieldNumber = 3,
+    kEndFieldNumber = 4,
+    kDepthFieldNumber = 5,
+    kPartialFieldNumber = 6,
+    kEhEntriesFieldNumber = 7,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtRemoveSpaceDoneFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtRemoveSpaceDoneFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Start =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtRemoveSpaceDoneFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Start kStart() { return {}; }
+  void set_start(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Start::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_End =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtRemoveSpaceDoneFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_End kEnd() { return {}; }
+  void set_end(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_End::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Depth =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4ExtRemoveSpaceDoneFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Depth kDepth() { return {}; }
+  void set_depth(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Depth::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Partial =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4ExtRemoveSpaceDoneFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Partial kPartial() { return {}; }
+  void set_partial(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Partial::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_EhEntries =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtRemoveSpaceDoneFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EhEntries kEhEntries() { return {}; }
+  void set_eh_entries(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_EhEntries::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4ExtRemoveSpaceFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4ExtRemoveSpaceFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4ExtRemoveSpaceFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4ExtRemoveSpaceFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_start() const { return at<3>().valid(); }
+  uint32_t start() const { return at<3>().as_uint32(); }
+  bool has_end() const { return at<4>().valid(); }
+  uint32_t end() const { return at<4>().as_uint32(); }
+  bool has_depth() const { return at<5>().valid(); }
+  int32_t depth() const { return at<5>().as_int32(); }
+};
+
+class Ext4ExtRemoveSpaceFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4ExtRemoveSpaceFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kStartFieldNumber = 3,
+    kEndFieldNumber = 4,
+    kDepthFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtRemoveSpaceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtRemoveSpaceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Start =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtRemoveSpaceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Start kStart() { return {}; }
+  void set_start(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Start::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_End =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtRemoveSpaceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_End kEnd() { return {}; }
+  void set_end(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_End::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Depth =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4ExtRemoveSpaceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Depth kDepth() { return {}; }
+  void set_depth(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Depth::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4ExtPutInCacheFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4ExtPutInCacheFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4ExtPutInCacheFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4ExtPutInCacheFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_lblk() const { return at<3>().valid(); }
+  uint32_t lblk() const { return at<3>().as_uint32(); }
+  bool has_len() const { return at<4>().valid(); }
+  uint32_t len() const { return at<4>().as_uint32(); }
+  bool has_start() const { return at<5>().valid(); }
+  uint64_t start() const { return at<5>().as_uint64(); }
+};
+
+class Ext4ExtPutInCacheFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4ExtPutInCacheFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kLblkFieldNumber = 3,
+    kLenFieldNumber = 4,
+    kStartFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtPutInCacheFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtPutInCacheFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Lblk =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtPutInCacheFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Lblk kLblk() { return {}; }
+  void set_lblk(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Lblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtPutInCacheFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Start =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtPutInCacheFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Start kStart() { return {}; }
+  void set_start(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Start::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4ExtMapBlocksExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4ExtMapBlocksExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4ExtMapBlocksExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4ExtMapBlocksExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_flags() const { return at<3>().valid(); }
+  uint32_t flags() const { return at<3>().as_uint32(); }
+  bool has_pblk() const { return at<4>().valid(); }
+  uint64_t pblk() const { return at<4>().as_uint64(); }
+  bool has_lblk() const { return at<5>().valid(); }
+  uint32_t lblk() const { return at<5>().as_uint32(); }
+  bool has_len() const { return at<6>().valid(); }
+  uint32_t len() const { return at<6>().as_uint32(); }
+  bool has_mflags() const { return at<7>().valid(); }
+  uint32_t mflags() const { return at<7>().as_uint32(); }
+  bool has_ret() const { return at<8>().valid(); }
+  int32_t ret() const { return at<8>().as_int32(); }
+};
+
+class Ext4ExtMapBlocksExitFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4ExtMapBlocksExitFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kFlagsFieldNumber = 3,
+    kPblkFieldNumber = 4,
+    kLblkFieldNumber = 5,
+    kLenFieldNumber = 6,
+    kMflagsFieldNumber = 7,
+    kRetFieldNumber = 8,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtMapBlocksExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtMapBlocksExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtMapBlocksExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pblk =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtMapBlocksExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pblk kPblk() { return {}; }
+  void set_pblk(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Lblk =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtMapBlocksExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Lblk kLblk() { return {}; }
+  void set_lblk(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Lblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtMapBlocksExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Mflags =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtMapBlocksExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mflags kMflags() { return {}; }
+  void set_mflags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mflags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ret =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4ExtMapBlocksExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ret kRet() { return {}; }
+  void set_ret(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ret::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4ExtMapBlocksEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4ExtMapBlocksEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4ExtMapBlocksEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4ExtMapBlocksEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_lblk() const { return at<3>().valid(); }
+  uint32_t lblk() const { return at<3>().as_uint32(); }
+  bool has_len() const { return at<4>().valid(); }
+  uint32_t len() const { return at<4>().as_uint32(); }
+  bool has_flags() const { return at<5>().valid(); }
+  uint32_t flags() const { return at<5>().as_uint32(); }
+};
+
+class Ext4ExtMapBlocksEnterFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4ExtMapBlocksEnterFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kLblkFieldNumber = 3,
+    kLenFieldNumber = 4,
+    kFlagsFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtMapBlocksEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtMapBlocksEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Lblk =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtMapBlocksEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Lblk kLblk() { return {}; }
+  void set_lblk(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Lblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtMapBlocksEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtMapBlocksEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4ExtLoadExtentFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4ExtLoadExtentFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4ExtLoadExtentFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4ExtLoadExtentFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_pblk() const { return at<3>().valid(); }
+  uint64_t pblk() const { return at<3>().as_uint64(); }
+  bool has_lblk() const { return at<4>().valid(); }
+  uint32_t lblk() const { return at<4>().as_uint32(); }
+};
+
+class Ext4ExtLoadExtentFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4ExtLoadExtentFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kPblkFieldNumber = 3,
+    kLblkFieldNumber = 4,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtLoadExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtLoadExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pblk =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtLoadExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pblk kPblk() { return {}; }
+  void set_pblk(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Lblk =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtLoadExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Lblk kLblk() { return {}; }
+  void set_lblk(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Lblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4ExtInCacheFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4ExtInCacheFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4ExtInCacheFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4ExtInCacheFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_lblk() const { return at<3>().valid(); }
+  uint32_t lblk() const { return at<3>().as_uint32(); }
+  bool has_ret() const { return at<4>().valid(); }
+  int32_t ret() const { return at<4>().as_int32(); }
+};
+
+class Ext4ExtInCacheFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4ExtInCacheFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kLblkFieldNumber = 3,
+    kRetFieldNumber = 4,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtInCacheFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtInCacheFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Lblk =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtInCacheFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Lblk kLblk() { return {}; }
+  void set_lblk(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Lblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ret =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4ExtInCacheFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ret kRet() { return {}; }
+  void set_ret(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ret::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4ExtHandleUnwrittenExtentsFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4ExtHandleUnwrittenExtentsFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4ExtHandleUnwrittenExtentsFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4ExtHandleUnwrittenExtentsFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_flags() const { return at<3>().valid(); }
+  int32_t flags() const { return at<3>().as_int32(); }
+  bool has_lblk() const { return at<4>().valid(); }
+  uint32_t lblk() const { return at<4>().as_uint32(); }
+  bool has_pblk() const { return at<5>().valid(); }
+  uint64_t pblk() const { return at<5>().as_uint64(); }
+  bool has_len() const { return at<6>().valid(); }
+  uint32_t len() const { return at<6>().as_uint32(); }
+  bool has_allocated() const { return at<7>().valid(); }
+  uint32_t allocated() const { return at<7>().as_uint32(); }
+  bool has_newblk() const { return at<8>().valid(); }
+  uint64_t newblk() const { return at<8>().as_uint64(); }
+};
+
+class Ext4ExtHandleUnwrittenExtentsFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4ExtHandleUnwrittenExtentsFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kFlagsFieldNumber = 3,
+    kLblkFieldNumber = 4,
+    kPblkFieldNumber = 5,
+    kLenFieldNumber = 6,
+    kAllocatedFieldNumber = 7,
+    kNewblkFieldNumber = 8,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtHandleUnwrittenExtentsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtHandleUnwrittenExtentsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4ExtHandleUnwrittenExtentsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Lblk =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtHandleUnwrittenExtentsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Lblk kLblk() { return {}; }
+  void set_lblk(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Lblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pblk =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtHandleUnwrittenExtentsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pblk kPblk() { return {}; }
+  void set_pblk(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtHandleUnwrittenExtentsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Allocated =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtHandleUnwrittenExtentsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Allocated kAllocated() { return {}; }
+  void set_allocated(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Allocated::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Newblk =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtHandleUnwrittenExtentsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Newblk kNewblk() { return {}; }
+  void set_newblk(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Newblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4ExtConvertToInitializedFastpathFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/10, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4ExtConvertToInitializedFastpathFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4ExtConvertToInitializedFastpathFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4ExtConvertToInitializedFastpathFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_m_lblk() const { return at<3>().valid(); }
+  uint32_t m_lblk() const { return at<3>().as_uint32(); }
+  bool has_m_len() const { return at<4>().valid(); }
+  uint32_t m_len() const { return at<4>().as_uint32(); }
+  bool has_u_lblk() const { return at<5>().valid(); }
+  uint32_t u_lblk() const { return at<5>().as_uint32(); }
+  bool has_u_len() const { return at<6>().valid(); }
+  uint32_t u_len() const { return at<6>().as_uint32(); }
+  bool has_u_pblk() const { return at<7>().valid(); }
+  uint64_t u_pblk() const { return at<7>().as_uint64(); }
+  bool has_i_lblk() const { return at<8>().valid(); }
+  uint32_t i_lblk() const { return at<8>().as_uint32(); }
+  bool has_i_len() const { return at<9>().valid(); }
+  uint32_t i_len() const { return at<9>().as_uint32(); }
+  bool has_i_pblk() const { return at<10>().valid(); }
+  uint64_t i_pblk() const { return at<10>().as_uint64(); }
+};
+
+class Ext4ExtConvertToInitializedFastpathFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4ExtConvertToInitializedFastpathFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kMLblkFieldNumber = 3,
+    kMLenFieldNumber = 4,
+    kULblkFieldNumber = 5,
+    kULenFieldNumber = 6,
+    kUPblkFieldNumber = 7,
+    kILblkFieldNumber = 8,
+    kILenFieldNumber = 9,
+    kIPblkFieldNumber = 10,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtConvertToInitializedFastpathFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtConvertToInitializedFastpathFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MLblk =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtConvertToInitializedFastpathFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MLblk kMLblk() { return {}; }
+  void set_m_lblk(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MLblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MLen =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtConvertToInitializedFastpathFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MLen kMLen() { return {}; }
+  void set_m_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MLen::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ULblk =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtConvertToInitializedFastpathFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ULblk kULblk() { return {}; }
+  void set_u_lblk(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ULblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ULen =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtConvertToInitializedFastpathFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ULen kULen() { return {}; }
+  void set_u_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ULen::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_UPblk =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtConvertToInitializedFastpathFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UPblk kUPblk() { return {}; }
+  void set_u_pblk(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_UPblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ILblk =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtConvertToInitializedFastpathFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ILblk kILblk() { return {}; }
+  void set_i_lblk(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ILblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ILen =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtConvertToInitializedFastpathFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ILen kILen() { return {}; }
+  void set_i_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ILen::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IPblk =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtConvertToInitializedFastpathFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IPblk kIPblk() { return {}; }
+  void set_i_pblk(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IPblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4ExtConvertToInitializedEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4ExtConvertToInitializedEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4ExtConvertToInitializedEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4ExtConvertToInitializedEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_m_lblk() const { return at<3>().valid(); }
+  uint32_t m_lblk() const { return at<3>().as_uint32(); }
+  bool has_m_len() const { return at<4>().valid(); }
+  uint32_t m_len() const { return at<4>().as_uint32(); }
+  bool has_u_lblk() const { return at<5>().valid(); }
+  uint32_t u_lblk() const { return at<5>().as_uint32(); }
+  bool has_u_len() const { return at<6>().valid(); }
+  uint32_t u_len() const { return at<6>().as_uint32(); }
+  bool has_u_pblk() const { return at<7>().valid(); }
+  uint64_t u_pblk() const { return at<7>().as_uint64(); }
+};
+
+class Ext4ExtConvertToInitializedEnterFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4ExtConvertToInitializedEnterFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kMLblkFieldNumber = 3,
+    kMLenFieldNumber = 4,
+    kULblkFieldNumber = 5,
+    kULenFieldNumber = 6,
+    kUPblkFieldNumber = 7,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtConvertToInitializedEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtConvertToInitializedEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MLblk =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtConvertToInitializedEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MLblk kMLblk() { return {}; }
+  void set_m_lblk(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MLblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MLen =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtConvertToInitializedEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MLen kMLen() { return {}; }
+  void set_m_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MLen::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ULblk =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtConvertToInitializedEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ULblk kULblk() { return {}; }
+  void set_u_lblk(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ULblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ULen =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4ExtConvertToInitializedEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ULen kULen() { return {}; }
+  void set_u_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ULen::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_UPblk =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4ExtConvertToInitializedEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UPblk kUPblk() { return {}; }
+  void set_u_pblk(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_UPblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4EvictInodeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4EvictInodeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4EvictInodeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4EvictInodeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_nlink() const { return at<3>().valid(); }
+  int32_t nlink() const { return at<3>().as_int32(); }
+};
+
+class Ext4EvictInodeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4EvictInodeFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kNlinkFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4EvictInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4EvictInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Nlink =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4EvictInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Nlink kNlink() { return {}; }
+  void set_nlink(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Nlink::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4EsShrinkScanExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4EsShrinkScanExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4EsShrinkScanExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4EsShrinkScanExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_nr_shrunk() const { return at<2>().valid(); }
+  int32_t nr_shrunk() const { return at<2>().as_int32(); }
+  bool has_cache_cnt() const { return at<3>().valid(); }
+  int32_t cache_cnt() const { return at<3>().as_int32(); }
+};
+
+class Ext4EsShrinkScanExitFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4EsShrinkScanExitFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kNrShrunkFieldNumber = 2,
+    kCacheCntFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4EsShrinkScanExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NrShrunk =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4EsShrinkScanExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrShrunk kNrShrunk() { return {}; }
+  void set_nr_shrunk(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrShrunk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CacheCnt =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4EsShrinkScanExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CacheCnt kCacheCnt() { return {}; }
+  void set_cache_cnt(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CacheCnt::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4EsShrinkScanEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4EsShrinkScanEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4EsShrinkScanEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4EsShrinkScanEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_nr_to_scan() const { return at<2>().valid(); }
+  int32_t nr_to_scan() const { return at<2>().as_int32(); }
+  bool has_cache_cnt() const { return at<3>().valid(); }
+  int32_t cache_cnt() const { return at<3>().as_int32(); }
+};
+
+class Ext4EsShrinkScanEnterFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4EsShrinkScanEnterFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kNrToScanFieldNumber = 2,
+    kCacheCntFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4EsShrinkScanEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NrToScan =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4EsShrinkScanEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrToScan kNrToScan() { return {}; }
+  void set_nr_to_scan(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrToScan::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CacheCnt =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4EsShrinkScanEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CacheCnt kCacheCnt() { return {}; }
+  void set_cache_cnt(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CacheCnt::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4EsShrinkCountFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4EsShrinkCountFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4EsShrinkCountFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4EsShrinkCountFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_nr_to_scan() const { return at<2>().valid(); }
+  int32_t nr_to_scan() const { return at<2>().as_int32(); }
+  bool has_cache_cnt() const { return at<3>().valid(); }
+  int32_t cache_cnt() const { return at<3>().as_int32(); }
+};
+
+class Ext4EsShrinkCountFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4EsShrinkCountFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kNrToScanFieldNumber = 2,
+    kCacheCntFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4EsShrinkCountFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NrToScan =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4EsShrinkCountFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrToScan kNrToScan() { return {}; }
+  void set_nr_to_scan(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrToScan::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CacheCnt =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4EsShrinkCountFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CacheCnt kCacheCnt() { return {}; }
+  void set_cache_cnt(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CacheCnt::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4EsShrinkFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4EsShrinkFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4EsShrinkFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4EsShrinkFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_nr_shrunk() const { return at<2>().valid(); }
+  int32_t nr_shrunk() const { return at<2>().as_int32(); }
+  bool has_scan_time() const { return at<3>().valid(); }
+  uint64_t scan_time() const { return at<3>().as_uint64(); }
+  bool has_nr_skipped() const { return at<4>().valid(); }
+  int32_t nr_skipped() const { return at<4>().as_int32(); }
+  bool has_retried() const { return at<5>().valid(); }
+  int32_t retried() const { return at<5>().as_int32(); }
+};
+
+class Ext4EsShrinkFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4EsShrinkFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kNrShrunkFieldNumber = 2,
+    kScanTimeFieldNumber = 3,
+    kNrSkippedFieldNumber = 4,
+    kRetriedFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4EsShrinkFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NrShrunk =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4EsShrinkFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrShrunk kNrShrunk() { return {}; }
+  void set_nr_shrunk(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrShrunk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ScanTime =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4EsShrinkFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ScanTime kScanTime() { return {}; }
+  void set_scan_time(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ScanTime::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NrSkipped =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4EsShrinkFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrSkipped kNrSkipped() { return {}; }
+  void set_nr_skipped(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrSkipped::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Retried =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4EsShrinkFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Retried kRetried() { return {}; }
+  void set_retried(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Retried::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4EsRemoveExtentFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4EsRemoveExtentFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4EsRemoveExtentFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4EsRemoveExtentFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_lblk() const { return at<3>().valid(); }
+  int64_t lblk() const { return at<3>().as_int64(); }
+  bool has_len() const { return at<4>().valid(); }
+  int64_t len() const { return at<4>().as_int64(); }
+};
+
+class Ext4EsRemoveExtentFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4EsRemoveExtentFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kLblkFieldNumber = 3,
+    kLenFieldNumber = 4,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4EsRemoveExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4EsRemoveExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Lblk =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4EsRemoveExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Lblk kLblk() { return {}; }
+  void set_lblk(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Lblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4EsRemoveExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4EsLookupExtentExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4EsLookupExtentExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4EsLookupExtentExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4EsLookupExtentExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_lblk() const { return at<3>().valid(); }
+  uint32_t lblk() const { return at<3>().as_uint32(); }
+  bool has_len() const { return at<4>().valid(); }
+  uint32_t len() const { return at<4>().as_uint32(); }
+  bool has_pblk() const { return at<5>().valid(); }
+  uint64_t pblk() const { return at<5>().as_uint64(); }
+  bool has_status() const { return at<6>().valid(); }
+  uint64_t status() const { return at<6>().as_uint64(); }
+  bool has_found() const { return at<7>().valid(); }
+  int32_t found() const { return at<7>().as_int32(); }
+};
+
+class Ext4EsLookupExtentExitFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4EsLookupExtentExitFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kLblkFieldNumber = 3,
+    kLenFieldNumber = 4,
+    kPblkFieldNumber = 5,
+    kStatusFieldNumber = 6,
+    kFoundFieldNumber = 7,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4EsLookupExtentExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4EsLookupExtentExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Lblk =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4EsLookupExtentExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Lblk kLblk() { return {}; }
+  void set_lblk(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Lblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4EsLookupExtentExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pblk =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4EsLookupExtentExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pblk kPblk() { return {}; }
+  void set_pblk(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Status =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4EsLookupExtentExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Status kStatus() { return {}; }
+  void set_status(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Status::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Found =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4EsLookupExtentExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Found kFound() { return {}; }
+  void set_found(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Found::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4EsLookupExtentEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4EsLookupExtentEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4EsLookupExtentEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4EsLookupExtentEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_lblk() const { return at<3>().valid(); }
+  uint32_t lblk() const { return at<3>().as_uint32(); }
+};
+
+class Ext4EsLookupExtentEnterFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4EsLookupExtentEnterFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kLblkFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4EsLookupExtentEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4EsLookupExtentEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Lblk =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4EsLookupExtentEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Lblk kLblk() { return {}; }
+  void set_lblk(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Lblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4EsInsertExtentFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4EsInsertExtentFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4EsInsertExtentFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4EsInsertExtentFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_lblk() const { return at<3>().valid(); }
+  uint32_t lblk() const { return at<3>().as_uint32(); }
+  bool has_len() const { return at<4>().valid(); }
+  uint32_t len() const { return at<4>().as_uint32(); }
+  bool has_pblk() const { return at<5>().valid(); }
+  uint64_t pblk() const { return at<5>().as_uint64(); }
+  bool has_status() const { return at<6>().valid(); }
+  uint64_t status() const { return at<6>().as_uint64(); }
+};
+
+class Ext4EsInsertExtentFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4EsInsertExtentFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kLblkFieldNumber = 3,
+    kLenFieldNumber = 4,
+    kPblkFieldNumber = 5,
+    kStatusFieldNumber = 6,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4EsInsertExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4EsInsertExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Lblk =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4EsInsertExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Lblk kLblk() { return {}; }
+  void set_lblk(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Lblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4EsInsertExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pblk =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4EsInsertExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pblk kPblk() { return {}; }
+  void set_pblk(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Status =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4EsInsertExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Status kStatus() { return {}; }
+  void set_status(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Status::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4EsFindDelayedExtentRangeExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4EsFindDelayedExtentRangeExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4EsFindDelayedExtentRangeExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4EsFindDelayedExtentRangeExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_lblk() const { return at<3>().valid(); }
+  uint32_t lblk() const { return at<3>().as_uint32(); }
+  bool has_len() const { return at<4>().valid(); }
+  uint32_t len() const { return at<4>().as_uint32(); }
+  bool has_pblk() const { return at<5>().valid(); }
+  uint64_t pblk() const { return at<5>().as_uint64(); }
+  bool has_status() const { return at<6>().valid(); }
+  uint64_t status() const { return at<6>().as_uint64(); }
+};
+
+class Ext4EsFindDelayedExtentRangeExitFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4EsFindDelayedExtentRangeExitFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kLblkFieldNumber = 3,
+    kLenFieldNumber = 4,
+    kPblkFieldNumber = 5,
+    kStatusFieldNumber = 6,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4EsFindDelayedExtentRangeExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4EsFindDelayedExtentRangeExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Lblk =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4EsFindDelayedExtentRangeExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Lblk kLblk() { return {}; }
+  void set_lblk(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Lblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4EsFindDelayedExtentRangeExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pblk =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4EsFindDelayedExtentRangeExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pblk kPblk() { return {}; }
+  void set_pblk(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Status =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4EsFindDelayedExtentRangeExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Status kStatus() { return {}; }
+  void set_status(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Status::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4EsFindDelayedExtentRangeEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4EsFindDelayedExtentRangeEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4EsFindDelayedExtentRangeEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4EsFindDelayedExtentRangeEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_lblk() const { return at<3>().valid(); }
+  uint32_t lblk() const { return at<3>().as_uint32(); }
+};
+
+class Ext4EsFindDelayedExtentRangeEnterFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4EsFindDelayedExtentRangeEnterFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kLblkFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4EsFindDelayedExtentRangeEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4EsFindDelayedExtentRangeEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Lblk =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4EsFindDelayedExtentRangeEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Lblk kLblk() { return {}; }
+  void set_lblk(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Lblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4EsCacheExtentFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4EsCacheExtentFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4EsCacheExtentFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4EsCacheExtentFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_lblk() const { return at<3>().valid(); }
+  uint32_t lblk() const { return at<3>().as_uint32(); }
+  bool has_len() const { return at<4>().valid(); }
+  uint32_t len() const { return at<4>().as_uint32(); }
+  bool has_pblk() const { return at<5>().valid(); }
+  uint64_t pblk() const { return at<5>().as_uint64(); }
+  bool has_status() const { return at<6>().valid(); }
+  uint32_t status() const { return at<6>().as_uint32(); }
+};
+
+class Ext4EsCacheExtentFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4EsCacheExtentFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kLblkFieldNumber = 3,
+    kLenFieldNumber = 4,
+    kPblkFieldNumber = 5,
+    kStatusFieldNumber = 6,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4EsCacheExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4EsCacheExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Lblk =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4EsCacheExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Lblk kLblk() { return {}; }
+  void set_lblk(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Lblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4EsCacheExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pblk =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4EsCacheExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pblk kPblk() { return {}; }
+  void set_pblk(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Status =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4EsCacheExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Status kStatus() { return {}; }
+  void set_status(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Status::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4DropInodeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4DropInodeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4DropInodeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4DropInodeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_drop() const { return at<3>().valid(); }
+  int32_t drop() const { return at<3>().as_int32(); }
+};
+
+class Ext4DropInodeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4DropInodeFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kDropFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DropInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DropInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Drop =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4DropInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Drop kDrop() { return {}; }
+  void set_drop(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Drop::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4DiscardPreallocationsFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4DiscardPreallocationsFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4DiscardPreallocationsFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4DiscardPreallocationsFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+};
+
+class Ext4DiscardPreallocationsFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4DiscardPreallocationsFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DiscardPreallocationsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DiscardPreallocationsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4DiscardBlocksFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4DiscardBlocksFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4DiscardBlocksFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4DiscardBlocksFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_blk() const { return at<2>().valid(); }
+  uint64_t blk() const { return at<2>().as_uint64(); }
+  bool has_count() const { return at<3>().valid(); }
+  uint64_t count() const { return at<3>().as_uint64(); }
+};
+
+class Ext4DiscardBlocksFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4DiscardBlocksFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kBlkFieldNumber = 2,
+    kCountFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DiscardBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Blk =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DiscardBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Blk kBlk() { return {}; }
+  void set_blk(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Blk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Count =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DiscardBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Count kCount() { return {}; }
+  void set_count(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Count::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4DirectIOExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4DirectIOExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4DirectIOExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4DirectIOExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_pos() const { return at<3>().valid(); }
+  int64_t pos() const { return at<3>().as_int64(); }
+  bool has_len() const { return at<4>().valid(); }
+  uint64_t len() const { return at<4>().as_uint64(); }
+  bool has_rw() const { return at<5>().valid(); }
+  int32_t rw() const { return at<5>().as_int32(); }
+  bool has_ret() const { return at<6>().valid(); }
+  int32_t ret() const { return at<6>().as_int32(); }
+};
+
+class Ext4DirectIOExitFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4DirectIOExitFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kPosFieldNumber = 3,
+    kLenFieldNumber = 4,
+    kRwFieldNumber = 5,
+    kRetFieldNumber = 6,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DirectIOExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DirectIOExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pos =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4DirectIOExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pos kPos() { return {}; }
+  void set_pos(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pos::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DirectIOExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Rw =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4DirectIOExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Rw kRw() { return {}; }
+  void set_rw(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Rw::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ret =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4DirectIOExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ret kRet() { return {}; }
+  void set_ret(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ret::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4DirectIOEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4DirectIOEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4DirectIOEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4DirectIOEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_pos() const { return at<3>().valid(); }
+  int64_t pos() const { return at<3>().as_int64(); }
+  bool has_len() const { return at<4>().valid(); }
+  uint64_t len() const { return at<4>().as_uint64(); }
+  bool has_rw() const { return at<5>().valid(); }
+  int32_t rw() const { return at<5>().as_int32(); }
+};
+
+class Ext4DirectIOEnterFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4DirectIOEnterFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kPosFieldNumber = 3,
+    kLenFieldNumber = 4,
+    kRwFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DirectIOEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DirectIOEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pos =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4DirectIOEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pos kPos() { return {}; }
+  void set_pos(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pos::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DirectIOEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Rw =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4DirectIOEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Rw kRw() { return {}; }
+  void set_rw(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Rw::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4DaWritePagesExtentFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4DaWritePagesExtentFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4DaWritePagesExtentFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4DaWritePagesExtentFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_lblk() const { return at<3>().valid(); }
+  uint64_t lblk() const { return at<3>().as_uint64(); }
+  bool has_len() const { return at<4>().valid(); }
+  uint32_t len() const { return at<4>().as_uint32(); }
+  bool has_flags() const { return at<5>().valid(); }
+  uint32_t flags() const { return at<5>().as_uint32(); }
+};
+
+class Ext4DaWritePagesExtentFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4DaWritePagesExtentFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kLblkFieldNumber = 3,
+    kLenFieldNumber = 4,
+    kFlagsFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DaWritePagesExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DaWritePagesExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Lblk =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DaWritePagesExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Lblk kLblk() { return {}; }
+  void set_lblk(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Lblk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4DaWritePagesExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4DaWritePagesExtentFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4DaWritePagesFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/10, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4DaWritePagesFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4DaWritePagesFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4DaWritePagesFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_first_page() const { return at<3>().valid(); }
+  uint64_t first_page() const { return at<3>().as_uint64(); }
+  bool has_nr_to_write() const { return at<4>().valid(); }
+  int64_t nr_to_write() const { return at<4>().as_int64(); }
+  bool has_sync_mode() const { return at<5>().valid(); }
+  int32_t sync_mode() const { return at<5>().as_int32(); }
+  bool has_b_blocknr() const { return at<6>().valid(); }
+  uint64_t b_blocknr() const { return at<6>().as_uint64(); }
+  bool has_b_size() const { return at<7>().valid(); }
+  uint32_t b_size() const { return at<7>().as_uint32(); }
+  bool has_b_state() const { return at<8>().valid(); }
+  uint32_t b_state() const { return at<8>().as_uint32(); }
+  bool has_io_done() const { return at<9>().valid(); }
+  int32_t io_done() const { return at<9>().as_int32(); }
+  bool has_pages_written() const { return at<10>().valid(); }
+  int32_t pages_written() const { return at<10>().as_int32(); }
+};
+
+class Ext4DaWritePagesFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4DaWritePagesFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kFirstPageFieldNumber = 3,
+    kNrToWriteFieldNumber = 4,
+    kSyncModeFieldNumber = 5,
+    kBBlocknrFieldNumber = 6,
+    kBSizeFieldNumber = 7,
+    kBStateFieldNumber = 8,
+    kIoDoneFieldNumber = 9,
+    kPagesWrittenFieldNumber = 10,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DaWritePagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DaWritePagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FirstPage =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DaWritePagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FirstPage kFirstPage() { return {}; }
+  void set_first_page(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FirstPage::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NrToWrite =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4DaWritePagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrToWrite kNrToWrite() { return {}; }
+  void set_nr_to_write(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrToWrite::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SyncMode =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4DaWritePagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SyncMode kSyncMode() { return {}; }
+  void set_sync_mode(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SyncMode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BBlocknr =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DaWritePagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BBlocknr kBBlocknr() { return {}; }
+  void set_b_blocknr(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BBlocknr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BSize =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4DaWritePagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BSize kBSize() { return {}; }
+  void set_b_size(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BSize::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BState =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4DaWritePagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BState kBState() { return {}; }
+  void set_b_state(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BState::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IoDone =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4DaWritePagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IoDone kIoDone() { return {}; }
+  void set_io_done(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IoDone::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PagesWritten =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4DaWritePagesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PagesWritten kPagesWritten() { return {}; }
+  void set_pages_written(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PagesWritten::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4DaUpdateReserveSpaceFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/9, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4DaUpdateReserveSpaceFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4DaUpdateReserveSpaceFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4DaUpdateReserveSpaceFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_i_blocks() const { return at<3>().valid(); }
+  uint64_t i_blocks() const { return at<3>().as_uint64(); }
+  bool has_used_blocks() const { return at<4>().valid(); }
+  int32_t used_blocks() const { return at<4>().as_int32(); }
+  bool has_reserved_data_blocks() const { return at<5>().valid(); }
+  int32_t reserved_data_blocks() const { return at<5>().as_int32(); }
+  bool has_reserved_meta_blocks() const { return at<6>().valid(); }
+  int32_t reserved_meta_blocks() const { return at<6>().as_int32(); }
+  bool has_allocated_meta_blocks() const { return at<7>().valid(); }
+  int32_t allocated_meta_blocks() const { return at<7>().as_int32(); }
+  bool has_quota_claim() const { return at<8>().valid(); }
+  int32_t quota_claim() const { return at<8>().as_int32(); }
+  bool has_mode() const { return at<9>().valid(); }
+  uint32_t mode() const { return at<9>().as_uint32(); }
+};
+
+class Ext4DaUpdateReserveSpaceFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4DaUpdateReserveSpaceFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kIBlocksFieldNumber = 3,
+    kUsedBlocksFieldNumber = 4,
+    kReservedDataBlocksFieldNumber = 5,
+    kReservedMetaBlocksFieldNumber = 6,
+    kAllocatedMetaBlocksFieldNumber = 7,
+    kQuotaClaimFieldNumber = 8,
+    kModeFieldNumber = 9,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DaUpdateReserveSpaceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DaUpdateReserveSpaceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IBlocks =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DaUpdateReserveSpaceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IBlocks kIBlocks() { return {}; }
+  void set_i_blocks(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IBlocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_UsedBlocks =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4DaUpdateReserveSpaceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UsedBlocks kUsedBlocks() { return {}; }
+  void set_used_blocks(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_UsedBlocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ReservedDataBlocks =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4DaUpdateReserveSpaceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ReservedDataBlocks kReservedDataBlocks() { return {}; }
+  void set_reserved_data_blocks(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ReservedDataBlocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ReservedMetaBlocks =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4DaUpdateReserveSpaceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ReservedMetaBlocks kReservedMetaBlocks() { return {}; }
+  void set_reserved_meta_blocks(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ReservedMetaBlocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_AllocatedMetaBlocks =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4DaUpdateReserveSpaceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AllocatedMetaBlocks kAllocatedMetaBlocks() { return {}; }
+  void set_allocated_meta_blocks(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_AllocatedMetaBlocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_QuotaClaim =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4DaUpdateReserveSpaceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_QuotaClaim kQuotaClaim() { return {}; }
+  void set_quota_claim(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_QuotaClaim::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Mode =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4DaUpdateReserveSpaceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mode kMode() { return {}; }
+  void set_mode(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4DaReserveSpaceFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4DaReserveSpaceFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4DaReserveSpaceFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4DaReserveSpaceFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_i_blocks() const { return at<3>().valid(); }
+  uint64_t i_blocks() const { return at<3>().as_uint64(); }
+  bool has_reserved_data_blocks() const { return at<4>().valid(); }
+  int32_t reserved_data_blocks() const { return at<4>().as_int32(); }
+  bool has_reserved_meta_blocks() const { return at<5>().valid(); }
+  int32_t reserved_meta_blocks() const { return at<5>().as_int32(); }
+  bool has_mode() const { return at<6>().valid(); }
+  uint32_t mode() const { return at<6>().as_uint32(); }
+  bool has_md_needed() const { return at<7>().valid(); }
+  int32_t md_needed() const { return at<7>().as_int32(); }
+};
+
+class Ext4DaReserveSpaceFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4DaReserveSpaceFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kIBlocksFieldNumber = 3,
+    kReservedDataBlocksFieldNumber = 4,
+    kReservedMetaBlocksFieldNumber = 5,
+    kModeFieldNumber = 6,
+    kMdNeededFieldNumber = 7,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DaReserveSpaceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DaReserveSpaceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IBlocks =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DaReserveSpaceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IBlocks kIBlocks() { return {}; }
+  void set_i_blocks(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IBlocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ReservedDataBlocks =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4DaReserveSpaceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ReservedDataBlocks kReservedDataBlocks() { return {}; }
+  void set_reserved_data_blocks(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ReservedDataBlocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ReservedMetaBlocks =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4DaReserveSpaceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ReservedMetaBlocks kReservedMetaBlocks() { return {}; }
+  void set_reserved_meta_blocks(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ReservedMetaBlocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Mode =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4DaReserveSpaceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mode kMode() { return {}; }
+  void set_mode(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MdNeeded =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4DaReserveSpaceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MdNeeded kMdNeeded() { return {}; }
+  void set_md_needed(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MdNeeded::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4DaReleaseSpaceFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4DaReleaseSpaceFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4DaReleaseSpaceFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4DaReleaseSpaceFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_i_blocks() const { return at<3>().valid(); }
+  uint64_t i_blocks() const { return at<3>().as_uint64(); }
+  bool has_freed_blocks() const { return at<4>().valid(); }
+  int32_t freed_blocks() const { return at<4>().as_int32(); }
+  bool has_reserved_data_blocks() const { return at<5>().valid(); }
+  int32_t reserved_data_blocks() const { return at<5>().as_int32(); }
+  bool has_reserved_meta_blocks() const { return at<6>().valid(); }
+  int32_t reserved_meta_blocks() const { return at<6>().as_int32(); }
+  bool has_allocated_meta_blocks() const { return at<7>().valid(); }
+  int32_t allocated_meta_blocks() const { return at<7>().as_int32(); }
+  bool has_mode() const { return at<8>().valid(); }
+  uint32_t mode() const { return at<8>().as_uint32(); }
+};
+
+class Ext4DaReleaseSpaceFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4DaReleaseSpaceFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kIBlocksFieldNumber = 3,
+    kFreedBlocksFieldNumber = 4,
+    kReservedDataBlocksFieldNumber = 5,
+    kReservedMetaBlocksFieldNumber = 6,
+    kAllocatedMetaBlocksFieldNumber = 7,
+    kModeFieldNumber = 8,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DaReleaseSpaceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DaReleaseSpaceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IBlocks =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DaReleaseSpaceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IBlocks kIBlocks() { return {}; }
+  void set_i_blocks(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IBlocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FreedBlocks =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4DaReleaseSpaceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FreedBlocks kFreedBlocks() { return {}; }
+  void set_freed_blocks(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FreedBlocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ReservedDataBlocks =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4DaReleaseSpaceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ReservedDataBlocks kReservedDataBlocks() { return {}; }
+  void set_reserved_data_blocks(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ReservedDataBlocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ReservedMetaBlocks =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4DaReleaseSpaceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ReservedMetaBlocks kReservedMetaBlocks() { return {}; }
+  void set_reserved_meta_blocks(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ReservedMetaBlocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_AllocatedMetaBlocks =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4DaReleaseSpaceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AllocatedMetaBlocks kAllocatedMetaBlocks() { return {}; }
+  void set_allocated_meta_blocks(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_AllocatedMetaBlocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Mode =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4DaReleaseSpaceFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mode kMode() { return {}; }
+  void set_mode(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4CollapseRangeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4CollapseRangeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4CollapseRangeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4CollapseRangeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_offset() const { return at<3>().valid(); }
+  int64_t offset() const { return at<3>().as_int64(); }
+  bool has_len() const { return at<4>().valid(); }
+  int64_t len() const { return at<4>().as_int64(); }
+};
+
+class Ext4CollapseRangeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4CollapseRangeFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kOffsetFieldNumber = 3,
+    kLenFieldNumber = 4,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4CollapseRangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4CollapseRangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Offset =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4CollapseRangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Offset kOffset() { return {}; }
+  void set_offset(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Offset::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4CollapseRangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4BeginOrderedTruncateFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4BeginOrderedTruncateFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4BeginOrderedTruncateFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4BeginOrderedTruncateFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_new_size() const { return at<3>().valid(); }
+  int64_t new_size() const { return at<3>().as_int64(); }
+};
+
+class Ext4BeginOrderedTruncateFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4BeginOrderedTruncateFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kNewSizeFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4BeginOrderedTruncateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4BeginOrderedTruncateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NewSize =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4BeginOrderedTruncateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NewSize kNewSize() { return {}; }
+  void set_new_size(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NewSize::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4AllocateInodeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4AllocateInodeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4AllocateInodeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4AllocateInodeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_dir() const { return at<3>().valid(); }
+  uint64_t dir() const { return at<3>().as_uint64(); }
+  bool has_mode() const { return at<4>().valid(); }
+  uint32_t mode() const { return at<4>().as_uint32(); }
+};
+
+class Ext4AllocateInodeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4AllocateInodeFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kDirFieldNumber = 3,
+    kModeFieldNumber = 4,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4AllocateInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4AllocateInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Dir =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4AllocateInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dir kDir() { return {}; }
+  void set_dir(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dir::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Mode =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4AllocateInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mode kMode() { return {}; }
+  void set_mode(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4AllocateBlocksFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/11, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4AllocateBlocksFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4AllocateBlocksFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4AllocateBlocksFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_block() const { return at<3>().valid(); }
+  uint64_t block() const { return at<3>().as_uint64(); }
+  bool has_len() const { return at<4>().valid(); }
+  uint32_t len() const { return at<4>().as_uint32(); }
+  bool has_logical() const { return at<5>().valid(); }
+  uint32_t logical() const { return at<5>().as_uint32(); }
+  bool has_lleft() const { return at<6>().valid(); }
+  uint32_t lleft() const { return at<6>().as_uint32(); }
+  bool has_lright() const { return at<7>().valid(); }
+  uint32_t lright() const { return at<7>().as_uint32(); }
+  bool has_goal() const { return at<8>().valid(); }
+  uint64_t goal() const { return at<8>().as_uint64(); }
+  bool has_pleft() const { return at<9>().valid(); }
+  uint64_t pleft() const { return at<9>().as_uint64(); }
+  bool has_pright() const { return at<10>().valid(); }
+  uint64_t pright() const { return at<10>().as_uint64(); }
+  bool has_flags() const { return at<11>().valid(); }
+  uint32_t flags() const { return at<11>().as_uint32(); }
+};
+
+class Ext4AllocateBlocksFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4AllocateBlocksFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kBlockFieldNumber = 3,
+    kLenFieldNumber = 4,
+    kLogicalFieldNumber = 5,
+    kLleftFieldNumber = 6,
+    kLrightFieldNumber = 7,
+    kGoalFieldNumber = 8,
+    kPleftFieldNumber = 9,
+    kPrightFieldNumber = 10,
+    kFlagsFieldNumber = 11,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4AllocateBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4AllocateBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Block =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4AllocateBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Block kBlock() { return {}; }
+  void set_block(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Block::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4AllocateBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Logical =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4AllocateBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Logical kLogical() { return {}; }
+  void set_logical(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Logical::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Lleft =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4AllocateBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Lleft kLleft() { return {}; }
+  void set_lleft(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Lleft::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Lright =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4AllocateBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Lright kLright() { return {}; }
+  void set_lright(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Lright::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Goal =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4AllocateBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Goal kGoal() { return {}; }
+  void set_goal(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Goal::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pleft =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4AllocateBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pleft kPleft() { return {}; }
+  void set_pleft(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pleft::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pright =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4AllocateBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pright kPright() { return {}; }
+  void set_pright(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pright::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4AllocateBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4AllocDaBlocksFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4AllocDaBlocksFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4AllocDaBlocksFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4AllocDaBlocksFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_data_blocks() const { return at<3>().valid(); }
+  uint32_t data_blocks() const { return at<3>().as_uint32(); }
+  bool has_meta_blocks() const { return at<4>().valid(); }
+  uint32_t meta_blocks() const { return at<4>().as_uint32(); }
+};
+
+class Ext4AllocDaBlocksFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4AllocDaBlocksFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kDataBlocksFieldNumber = 3,
+    kMetaBlocksFieldNumber = 4,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4AllocDaBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4AllocDaBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DataBlocks =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4AllocDaBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DataBlocks kDataBlocks() { return {}; }
+  void set_data_blocks(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DataBlocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MetaBlocks =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4AllocDaBlocksFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MetaBlocks kMetaBlocks() { return {}; }
+  void set_meta_blocks(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MetaBlocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4SyncFileExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4SyncFileExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4SyncFileExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4SyncFileExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_ret() const { return at<3>().valid(); }
+  int32_t ret() const { return at<3>().as_int32(); }
+};
+
+class Ext4SyncFileExitFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4SyncFileExitFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kRetFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4SyncFileExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4SyncFileExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ret =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4SyncFileExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ret kRet() { return {}; }
+  void set_ret(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ret::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4SyncFileEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4SyncFileEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4SyncFileEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4SyncFileEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_parent() const { return at<3>().valid(); }
+  uint64_t parent() const { return at<3>().as_uint64(); }
+  bool has_datasync() const { return at<4>().valid(); }
+  int32_t datasync() const { return at<4>().as_int32(); }
+};
+
+class Ext4SyncFileEnterFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4SyncFileEnterFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kParentFieldNumber = 3,
+    kDatasyncFieldNumber = 4,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4SyncFileEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4SyncFileEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Parent =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4SyncFileEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Parent kParent() { return {}; }
+  void set_parent(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Parent::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Datasync =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      Ext4SyncFileEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Datasync kDatasync() { return {}; }
+  void set_datasync(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Datasync::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4DaWriteEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4DaWriteEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4DaWriteEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4DaWriteEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_pos() const { return at<3>().valid(); }
+  int64_t pos() const { return at<3>().as_int64(); }
+  bool has_len() const { return at<4>().valid(); }
+  uint32_t len() const { return at<4>().as_uint32(); }
+  bool has_copied() const { return at<5>().valid(); }
+  uint32_t copied() const { return at<5>().as_uint32(); }
+};
+
+class Ext4DaWriteEndFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4DaWriteEndFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kPosFieldNumber = 3,
+    kLenFieldNumber = 4,
+    kCopiedFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DaWriteEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DaWriteEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pos =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4DaWriteEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pos kPos() { return {}; }
+  void set_pos(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pos::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4DaWriteEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Copied =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4DaWriteEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Copied kCopied() { return {}; }
+  void set_copied(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Copied::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Ext4DaWriteBeginFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Ext4DaWriteBeginFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Ext4DaWriteBeginFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Ext4DaWriteBeginFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_pos() const { return at<3>().valid(); }
+  int64_t pos() const { return at<3>().as_int64(); }
+  bool has_len() const { return at<4>().valid(); }
+  uint32_t len() const { return at<4>().as_uint32(); }
+  bool has_flags() const { return at<5>().valid(); }
+  uint32_t flags() const { return at<5>().as_uint32(); }
+};
+
+class Ext4DaWriteBeginFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = Ext4DaWriteBeginFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kPosFieldNumber = 3,
+    kLenFieldNumber = 4,
+    kFlagsFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DaWriteBeginFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Ext4DaWriteBeginFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pos =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      Ext4DaWriteBeginFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pos kPos() { return {}; }
+  void set_pos(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pos::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4DaWriteBeginFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Ext4DaWriteBeginFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/f2fs.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_F2FS_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_F2FS_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class F2fsWriteEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsWriteEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsWriteEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsWriteEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_pos() const { return at<3>().valid(); }
+  int64_t pos() const { return at<3>().as_int64(); }
+  bool has_len() const { return at<4>().valid(); }
+  uint32_t len() const { return at<4>().as_uint32(); }
+  bool has_copied() const { return at<5>().valid(); }
+  uint32_t copied() const { return at<5>().as_uint32(); }
+};
+
+class F2fsWriteEndFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsWriteEndFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kPosFieldNumber = 3,
+    kLenFieldNumber = 4,
+    kCopiedFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsWriteEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsWriteEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pos =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      F2fsWriteEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pos kPos() { return {}; }
+  void set_pos(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pos::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsWriteEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Copied =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsWriteEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Copied kCopied() { return {}; }
+  void set_copied(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Copied::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsWriteCheckpointFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsWriteCheckpointFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsWriteCheckpointFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsWriteCheckpointFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_is_umount() const { return at<2>().valid(); }
+  uint32_t is_umount() const { return at<2>().as_uint32(); }
+  bool has_msg() const { return at<3>().valid(); }
+  ::protozero::ConstChars msg() const { return at<3>().as_string(); }
+};
+
+class F2fsWriteCheckpointFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsWriteCheckpointFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kIsUmountFieldNumber = 2,
+    kMsgFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsWriteCheckpointFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IsUmount =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsWriteCheckpointFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IsUmount kIsUmount() { return {}; }
+  void set_is_umount(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IsUmount::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Msg =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      F2fsWriteCheckpointFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Msg kMsg() { return {}; }
+  void set_msg(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Msg::kFieldId, data, size);
+  }
+  void set_msg(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Msg::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsWriteBeginFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsWriteBeginFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsWriteBeginFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsWriteBeginFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_pos() const { return at<3>().valid(); }
+  int64_t pos() const { return at<3>().as_int64(); }
+  bool has_len() const { return at<4>().valid(); }
+  uint32_t len() const { return at<4>().as_uint32(); }
+  bool has_flags() const { return at<5>().valid(); }
+  uint32_t flags() const { return at<5>().as_uint32(); }
+};
+
+class F2fsWriteBeginFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsWriteBeginFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kPosFieldNumber = 3,
+    kLenFieldNumber = 4,
+    kFlagsFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsWriteBeginFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsWriteBeginFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pos =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      F2fsWriteBeginFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pos kPos() { return {}; }
+  void set_pos(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pos::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsWriteBeginFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsWriteBeginFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsVmPageMkwriteFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsVmPageMkwriteFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsVmPageMkwriteFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsVmPageMkwriteFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_type() const { return at<3>().valid(); }
+  int32_t type() const { return at<3>().as_int32(); }
+  bool has_dir() const { return at<4>().valid(); }
+  int32_t dir() const { return at<4>().as_int32(); }
+  bool has_index() const { return at<5>().valid(); }
+  uint64_t index() const { return at<5>().as_uint64(); }
+  bool has_dirty() const { return at<6>().valid(); }
+  int32_t dirty() const { return at<6>().as_int32(); }
+};
+
+class F2fsVmPageMkwriteFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsVmPageMkwriteFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kTypeFieldNumber = 3,
+    kDirFieldNumber = 4,
+    kIndexFieldNumber = 5,
+    kDirtyFieldNumber = 6,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsVmPageMkwriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsVmPageMkwriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Type =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      F2fsVmPageMkwriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Type kType() { return {}; }
+  void set_type(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Type::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Dir =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      F2fsVmPageMkwriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dir kDir() { return {}; }
+  void set_dir(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dir::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Index =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsVmPageMkwriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Index kIndex() { return {}; }
+  void set_index(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Index::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Dirty =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      F2fsVmPageMkwriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dirty kDirty() { return {}; }
+  void set_dirty(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dirty::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsUnlinkExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsUnlinkExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsUnlinkExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsUnlinkExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_ret() const { return at<3>().valid(); }
+  int32_t ret() const { return at<3>().as_int32(); }
+};
+
+class F2fsUnlinkExitFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsUnlinkExitFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kRetFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsUnlinkExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsUnlinkExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ret =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      F2fsUnlinkExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ret kRet() { return {}; }
+  void set_ret(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ret::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsUnlinkEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsUnlinkEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsUnlinkEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsUnlinkEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_size() const { return at<3>().valid(); }
+  int64_t size() const { return at<3>().as_int64(); }
+  bool has_blocks() const { return at<4>().valid(); }
+  uint64_t blocks() const { return at<4>().as_uint64(); }
+  bool has_name() const { return at<5>().valid(); }
+  ::protozero::ConstChars name() const { return at<5>().as_string(); }
+};
+
+class F2fsUnlinkEnterFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsUnlinkEnterFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kSizeFieldNumber = 3,
+    kBlocksFieldNumber = 4,
+    kNameFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsUnlinkEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsUnlinkEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Size =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      F2fsUnlinkEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Size kSize() { return {}; }
+  void set_size(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Size::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Blocks =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsUnlinkEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Blocks kBlocks() { return {}; }
+  void set_blocks(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Blocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      F2fsUnlinkEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsTruncatePartialNodesFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsTruncatePartialNodesFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsTruncatePartialNodesFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsTruncatePartialNodesFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_nid() const { return at<3>().valid(); }
+  uint32_t nid() const { return at<3>().as_uint32(); }
+  bool has_depth() const { return at<4>().valid(); }
+  int32_t depth() const { return at<4>().as_int32(); }
+  bool has_err() const { return at<5>().valid(); }
+  int32_t err() const { return at<5>().as_int32(); }
+};
+
+class F2fsTruncatePartialNodesFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsTruncatePartialNodesFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kNidFieldNumber = 3,
+    kDepthFieldNumber = 4,
+    kErrFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsTruncatePartialNodesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsTruncatePartialNodesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Nid =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsTruncatePartialNodesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Nid kNid() { return {}; }
+  void set_nid(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Nid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Depth =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      F2fsTruncatePartialNodesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Depth kDepth() { return {}; }
+  void set_depth(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Depth::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Err =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      F2fsTruncatePartialNodesFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Err kErr() { return {}; }
+  void set_err(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Err::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsTruncateNodesExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsTruncateNodesExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsTruncateNodesExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsTruncateNodesExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_ret() const { return at<3>().valid(); }
+  int32_t ret() const { return at<3>().as_int32(); }
+};
+
+class F2fsTruncateNodesExitFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsTruncateNodesExitFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kRetFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsTruncateNodesExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsTruncateNodesExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ret =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      F2fsTruncateNodesExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ret kRet() { return {}; }
+  void set_ret(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ret::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsTruncateNodesEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsTruncateNodesEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsTruncateNodesEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsTruncateNodesEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_nid() const { return at<3>().valid(); }
+  uint32_t nid() const { return at<3>().as_uint32(); }
+  bool has_blk_addr() const { return at<4>().valid(); }
+  uint32_t blk_addr() const { return at<4>().as_uint32(); }
+};
+
+class F2fsTruncateNodesEnterFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsTruncateNodesEnterFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kNidFieldNumber = 3,
+    kBlkAddrFieldNumber = 4,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsTruncateNodesEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsTruncateNodesEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Nid =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsTruncateNodesEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Nid kNid() { return {}; }
+  void set_nid(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Nid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BlkAddr =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsTruncateNodesEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BlkAddr kBlkAddr() { return {}; }
+  void set_blk_addr(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BlkAddr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsTruncateNodeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsTruncateNodeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsTruncateNodeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsTruncateNodeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_nid() const { return at<3>().valid(); }
+  uint32_t nid() const { return at<3>().as_uint32(); }
+  bool has_blk_addr() const { return at<4>().valid(); }
+  uint32_t blk_addr() const { return at<4>().as_uint32(); }
+};
+
+class F2fsTruncateNodeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsTruncateNodeFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kNidFieldNumber = 3,
+    kBlkAddrFieldNumber = 4,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsTruncateNodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsTruncateNodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Nid =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsTruncateNodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Nid kNid() { return {}; }
+  void set_nid(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Nid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BlkAddr =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsTruncateNodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BlkAddr kBlkAddr() { return {}; }
+  void set_blk_addr(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BlkAddr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsTruncateInodeBlocksExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsTruncateInodeBlocksExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsTruncateInodeBlocksExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsTruncateInodeBlocksExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_ret() const { return at<3>().valid(); }
+  int32_t ret() const { return at<3>().as_int32(); }
+};
+
+class F2fsTruncateInodeBlocksExitFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsTruncateInodeBlocksExitFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kRetFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsTruncateInodeBlocksExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsTruncateInodeBlocksExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ret =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      F2fsTruncateInodeBlocksExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ret kRet() { return {}; }
+  void set_ret(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ret::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsTruncateInodeBlocksEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsTruncateInodeBlocksEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsTruncateInodeBlocksEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsTruncateInodeBlocksEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_size() const { return at<3>().valid(); }
+  int64_t size() const { return at<3>().as_int64(); }
+  bool has_blocks() const { return at<4>().valid(); }
+  uint64_t blocks() const { return at<4>().as_uint64(); }
+  bool has_from() const { return at<5>().valid(); }
+  uint64_t from() const { return at<5>().as_uint64(); }
+};
+
+class F2fsTruncateInodeBlocksEnterFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsTruncateInodeBlocksEnterFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kSizeFieldNumber = 3,
+    kBlocksFieldNumber = 4,
+    kFromFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsTruncateInodeBlocksEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsTruncateInodeBlocksEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Size =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      F2fsTruncateInodeBlocksEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Size kSize() { return {}; }
+  void set_size(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Size::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Blocks =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsTruncateInodeBlocksEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Blocks kBlocks() { return {}; }
+  void set_blocks(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Blocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_From =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsTruncateInodeBlocksEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_From kFrom() { return {}; }
+  void set_from(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_From::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsTruncateDataBlocksRangeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsTruncateDataBlocksRangeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsTruncateDataBlocksRangeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsTruncateDataBlocksRangeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_nid() const { return at<3>().valid(); }
+  uint32_t nid() const { return at<3>().as_uint32(); }
+  bool has_ofs() const { return at<4>().valid(); }
+  uint32_t ofs() const { return at<4>().as_uint32(); }
+  bool has_free() const { return at<5>().valid(); }
+  int32_t free() const { return at<5>().as_int32(); }
+};
+
+class F2fsTruncateDataBlocksRangeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsTruncateDataBlocksRangeFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kNidFieldNumber = 3,
+    kOfsFieldNumber = 4,
+    kFreeFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsTruncateDataBlocksRangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsTruncateDataBlocksRangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Nid =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsTruncateDataBlocksRangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Nid kNid() { return {}; }
+  void set_nid(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Nid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ofs =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsTruncateDataBlocksRangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ofs kOfs() { return {}; }
+  void set_ofs(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ofs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Free =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      F2fsTruncateDataBlocksRangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Free kFree() { return {}; }
+  void set_free(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Free::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsTruncateBlocksExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsTruncateBlocksExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsTruncateBlocksExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsTruncateBlocksExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_ret() const { return at<3>().valid(); }
+  int32_t ret() const { return at<3>().as_int32(); }
+};
+
+class F2fsTruncateBlocksExitFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsTruncateBlocksExitFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kRetFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsTruncateBlocksExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsTruncateBlocksExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ret =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      F2fsTruncateBlocksExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ret kRet() { return {}; }
+  void set_ret(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ret::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsTruncateBlocksEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsTruncateBlocksEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsTruncateBlocksEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsTruncateBlocksEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_size() const { return at<3>().valid(); }
+  int64_t size() const { return at<3>().as_int64(); }
+  bool has_blocks() const { return at<4>().valid(); }
+  uint64_t blocks() const { return at<4>().as_uint64(); }
+  bool has_from() const { return at<5>().valid(); }
+  uint64_t from() const { return at<5>().as_uint64(); }
+};
+
+class F2fsTruncateBlocksEnterFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsTruncateBlocksEnterFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kSizeFieldNumber = 3,
+    kBlocksFieldNumber = 4,
+    kFromFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsTruncateBlocksEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsTruncateBlocksEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Size =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      F2fsTruncateBlocksEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Size kSize() { return {}; }
+  void set_size(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Size::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Blocks =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsTruncateBlocksEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Blocks kBlocks() { return {}; }
+  void set_blocks(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Blocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_From =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsTruncateBlocksEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_From kFrom() { return {}; }
+  void set_from(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_From::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsTruncateFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsTruncateFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsTruncateFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsTruncateFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_pino() const { return at<3>().valid(); }
+  uint64_t pino() const { return at<3>().as_uint64(); }
+  bool has_mode() const { return at<4>().valid(); }
+  uint32_t mode() const { return at<4>().as_uint32(); }
+  bool has_size() const { return at<5>().valid(); }
+  int64_t size() const { return at<5>().as_int64(); }
+  bool has_nlink() const { return at<6>().valid(); }
+  uint32_t nlink() const { return at<6>().as_uint32(); }
+  bool has_blocks() const { return at<7>().valid(); }
+  uint64_t blocks() const { return at<7>().as_uint64(); }
+  bool has_advise() const { return at<8>().valid(); }
+  uint32_t advise() const { return at<8>().as_uint32(); }
+};
+
+class F2fsTruncateFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsTruncateFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kPinoFieldNumber = 3,
+    kModeFieldNumber = 4,
+    kSizeFieldNumber = 5,
+    kNlinkFieldNumber = 6,
+    kBlocksFieldNumber = 7,
+    kAdviseFieldNumber = 8,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsTruncateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsTruncateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pino =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsTruncateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pino kPino() { return {}; }
+  void set_pino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Mode =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsTruncateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mode kMode() { return {}; }
+  void set_mode(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Size =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      F2fsTruncateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Size kSize() { return {}; }
+  void set_size(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Size::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Nlink =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsTruncateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Nlink kNlink() { return {}; }
+  void set_nlink(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Nlink::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Blocks =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsTruncateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Blocks kBlocks() { return {}; }
+  void set_blocks(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Blocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Advise =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsTruncateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Advise kAdvise() { return {}; }
+  void set_advise(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Advise::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsSyncFsFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsSyncFsFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsSyncFsFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsSyncFsFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_dirty() const { return at<2>().valid(); }
+  int32_t dirty() const { return at<2>().as_int32(); }
+  bool has_wait() const { return at<3>().valid(); }
+  int32_t wait() const { return at<3>().as_int32(); }
+};
+
+class F2fsSyncFsFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsSyncFsFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kDirtyFieldNumber = 2,
+    kWaitFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsSyncFsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Dirty =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      F2fsSyncFsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dirty kDirty() { return {}; }
+  void set_dirty(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dirty::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Wait =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      F2fsSyncFsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Wait kWait() { return {}; }
+  void set_wait(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Wait::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsSyncFileExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsSyncFileExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsSyncFileExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsSyncFileExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_need_cp() const { return at<3>().valid(); }
+  uint32_t need_cp() const { return at<3>().as_uint32(); }
+  bool has_datasync() const { return at<4>().valid(); }
+  int32_t datasync() const { return at<4>().as_int32(); }
+  bool has_ret() const { return at<5>().valid(); }
+  int32_t ret() const { return at<5>().as_int32(); }
+};
+
+class F2fsSyncFileExitFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsSyncFileExitFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kNeedCpFieldNumber = 3,
+    kDatasyncFieldNumber = 4,
+    kRetFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsSyncFileExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsSyncFileExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NeedCp =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsSyncFileExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NeedCp kNeedCp() { return {}; }
+  void set_need_cp(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NeedCp::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Datasync =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      F2fsSyncFileExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Datasync kDatasync() { return {}; }
+  void set_datasync(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Datasync::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ret =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      F2fsSyncFileExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ret kRet() { return {}; }
+  void set_ret(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ret::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsSyncFileEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsSyncFileEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsSyncFileEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsSyncFileEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_pino() const { return at<3>().valid(); }
+  uint64_t pino() const { return at<3>().as_uint64(); }
+  bool has_mode() const { return at<4>().valid(); }
+  uint32_t mode() const { return at<4>().as_uint32(); }
+  bool has_size() const { return at<5>().valid(); }
+  int64_t size() const { return at<5>().as_int64(); }
+  bool has_nlink() const { return at<6>().valid(); }
+  uint32_t nlink() const { return at<6>().as_uint32(); }
+  bool has_blocks() const { return at<7>().valid(); }
+  uint64_t blocks() const { return at<7>().as_uint64(); }
+  bool has_advise() const { return at<8>().valid(); }
+  uint32_t advise() const { return at<8>().as_uint32(); }
+};
+
+class F2fsSyncFileEnterFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsSyncFileEnterFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kPinoFieldNumber = 3,
+    kModeFieldNumber = 4,
+    kSizeFieldNumber = 5,
+    kNlinkFieldNumber = 6,
+    kBlocksFieldNumber = 7,
+    kAdviseFieldNumber = 8,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsSyncFileEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsSyncFileEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pino =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsSyncFileEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pino kPino() { return {}; }
+  void set_pino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Mode =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsSyncFileEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mode kMode() { return {}; }
+  void set_mode(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Size =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      F2fsSyncFileEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Size kSize() { return {}; }
+  void set_size(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Size::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Nlink =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsSyncFileEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Nlink kNlink() { return {}; }
+  void set_nlink(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Nlink::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Blocks =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsSyncFileEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Blocks kBlocks() { return {}; }
+  void set_blocks(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Blocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Advise =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsSyncFileEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Advise kAdvise() { return {}; }
+  void set_advise(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Advise::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsSubmitWritePageFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsSubmitWritePageFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsSubmitWritePageFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsSubmitWritePageFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_type() const { return at<3>().valid(); }
+  int32_t type() const { return at<3>().as_int32(); }
+  bool has_index() const { return at<4>().valid(); }
+  uint64_t index() const { return at<4>().as_uint64(); }
+  bool has_block() const { return at<5>().valid(); }
+  uint32_t block() const { return at<5>().as_uint32(); }
+};
+
+class F2fsSubmitWritePageFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsSubmitWritePageFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kTypeFieldNumber = 3,
+    kIndexFieldNumber = 4,
+    kBlockFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsSubmitWritePageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsSubmitWritePageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Type =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      F2fsSubmitWritePageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Type kType() { return {}; }
+  void set_type(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Type::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Index =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsSubmitWritePageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Index kIndex() { return {}; }
+  void set_index(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Index::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Block =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsSubmitWritePageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Block kBlock() { return {}; }
+  void set_block(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Block::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsSetPageDirtyFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsSetPageDirtyFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsSetPageDirtyFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsSetPageDirtyFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_type() const { return at<3>().valid(); }
+  int32_t type() const { return at<3>().as_int32(); }
+  bool has_dir() const { return at<4>().valid(); }
+  int32_t dir() const { return at<4>().as_int32(); }
+  bool has_index() const { return at<5>().valid(); }
+  uint64_t index() const { return at<5>().as_uint64(); }
+  bool has_dirty() const { return at<6>().valid(); }
+  int32_t dirty() const { return at<6>().as_int32(); }
+};
+
+class F2fsSetPageDirtyFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsSetPageDirtyFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kTypeFieldNumber = 3,
+    kDirFieldNumber = 4,
+    kIndexFieldNumber = 5,
+    kDirtyFieldNumber = 6,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsSetPageDirtyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsSetPageDirtyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Type =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      F2fsSetPageDirtyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Type kType() { return {}; }
+  void set_type(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Type::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Dir =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      F2fsSetPageDirtyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dir kDir() { return {}; }
+  void set_dir(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dir::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Index =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsSetPageDirtyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Index kIndex() { return {}; }
+  void set_index(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Index::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Dirty =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      F2fsSetPageDirtyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dirty kDirty() { return {}; }
+  void set_dirty(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dirty::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsReserveNewBlockFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsReserveNewBlockFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsReserveNewBlockFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsReserveNewBlockFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_nid() const { return at<2>().valid(); }
+  uint32_t nid() const { return at<2>().as_uint32(); }
+  bool has_ofs_in_node() const { return at<3>().valid(); }
+  uint32_t ofs_in_node() const { return at<3>().as_uint32(); }
+};
+
+class F2fsReserveNewBlockFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsReserveNewBlockFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kNidFieldNumber = 2,
+    kOfsInNodeFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsReserveNewBlockFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Nid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsReserveNewBlockFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Nid kNid() { return {}; }
+  void set_nid(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Nid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OfsInNode =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsReserveNewBlockFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OfsInNode kOfsInNode() { return {}; }
+  void set_ofs_in_node(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OfsInNode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsReadpageFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsReadpageFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsReadpageFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsReadpageFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_index() const { return at<3>().valid(); }
+  uint64_t index() const { return at<3>().as_uint64(); }
+  bool has_blkaddr() const { return at<4>().valid(); }
+  uint64_t blkaddr() const { return at<4>().as_uint64(); }
+  bool has_type() const { return at<5>().valid(); }
+  int32_t type() const { return at<5>().as_int32(); }
+};
+
+class F2fsReadpageFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsReadpageFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kIndexFieldNumber = 3,
+    kBlkaddrFieldNumber = 4,
+    kTypeFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsReadpageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsReadpageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Index =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsReadpageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Index kIndex() { return {}; }
+  void set_index(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Index::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Blkaddr =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsReadpageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Blkaddr kBlkaddr() { return {}; }
+  void set_blkaddr(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Blkaddr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Type =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      F2fsReadpageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Type kType() { return {}; }
+  void set_type(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Type::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsNewInodeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsNewInodeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsNewInodeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsNewInodeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_ret() const { return at<3>().valid(); }
+  int32_t ret() const { return at<3>().as_int32(); }
+};
+
+class F2fsNewInodeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsNewInodeFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kRetFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsNewInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsNewInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ret =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      F2fsNewInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ret kRet() { return {}; }
+  void set_ret(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ret::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsIgetExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsIgetExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsIgetExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsIgetExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_ret() const { return at<3>().valid(); }
+  int32_t ret() const { return at<3>().as_int32(); }
+};
+
+class F2fsIgetExitFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsIgetExitFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kRetFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsIgetExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsIgetExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ret =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      F2fsIgetExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ret kRet() { return {}; }
+  void set_ret(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ret::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsIgetFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsIgetFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsIgetFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsIgetFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_pino() const { return at<3>().valid(); }
+  uint64_t pino() const { return at<3>().as_uint64(); }
+  bool has_mode() const { return at<4>().valid(); }
+  uint32_t mode() const { return at<4>().as_uint32(); }
+  bool has_size() const { return at<5>().valid(); }
+  int64_t size() const { return at<5>().as_int64(); }
+  bool has_nlink() const { return at<6>().valid(); }
+  uint32_t nlink() const { return at<6>().as_uint32(); }
+  bool has_blocks() const { return at<7>().valid(); }
+  uint64_t blocks() const { return at<7>().as_uint64(); }
+  bool has_advise() const { return at<8>().valid(); }
+  uint32_t advise() const { return at<8>().as_uint32(); }
+};
+
+class F2fsIgetFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsIgetFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kPinoFieldNumber = 3,
+    kModeFieldNumber = 4,
+    kSizeFieldNumber = 5,
+    kNlinkFieldNumber = 6,
+    kBlocksFieldNumber = 7,
+    kAdviseFieldNumber = 8,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsIgetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsIgetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pino =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsIgetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pino kPino() { return {}; }
+  void set_pino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Mode =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsIgetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mode kMode() { return {}; }
+  void set_mode(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Size =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      F2fsIgetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Size kSize() { return {}; }
+  void set_size(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Size::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Nlink =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsIgetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Nlink kNlink() { return {}; }
+  void set_nlink(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Nlink::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Blocks =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsIgetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Blocks kBlocks() { return {}; }
+  void set_blocks(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Blocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Advise =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsIgetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Advise kAdvise() { return {}; }
+  void set_advise(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Advise::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsGetVictimFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/10, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsGetVictimFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsGetVictimFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsGetVictimFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_type() const { return at<2>().valid(); }
+  int32_t type() const { return at<2>().as_int32(); }
+  bool has_gc_type() const { return at<3>().valid(); }
+  int32_t gc_type() const { return at<3>().as_int32(); }
+  bool has_alloc_mode() const { return at<4>().valid(); }
+  int32_t alloc_mode() const { return at<4>().as_int32(); }
+  bool has_gc_mode() const { return at<5>().valid(); }
+  int32_t gc_mode() const { return at<5>().as_int32(); }
+  bool has_victim() const { return at<6>().valid(); }
+  uint32_t victim() const { return at<6>().as_uint32(); }
+  bool has_ofs_unit() const { return at<7>().valid(); }
+  uint32_t ofs_unit() const { return at<7>().as_uint32(); }
+  bool has_pre_victim() const { return at<8>().valid(); }
+  uint32_t pre_victim() const { return at<8>().as_uint32(); }
+  bool has_prefree() const { return at<9>().valid(); }
+  uint32_t prefree() const { return at<9>().as_uint32(); }
+  bool has_free() const { return at<10>().valid(); }
+  uint32_t free() const { return at<10>().as_uint32(); }
+};
+
+class F2fsGetVictimFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsGetVictimFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kTypeFieldNumber = 2,
+    kGcTypeFieldNumber = 3,
+    kAllocModeFieldNumber = 4,
+    kGcModeFieldNumber = 5,
+    kVictimFieldNumber = 6,
+    kOfsUnitFieldNumber = 7,
+    kPreVictimFieldNumber = 8,
+    kPrefreeFieldNumber = 9,
+    kFreeFieldNumber = 10,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsGetVictimFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Type =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      F2fsGetVictimFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Type kType() { return {}; }
+  void set_type(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Type::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_GcType =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      F2fsGetVictimFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GcType kGcType() { return {}; }
+  void set_gc_type(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_GcType::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_AllocMode =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      F2fsGetVictimFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AllocMode kAllocMode() { return {}; }
+  void set_alloc_mode(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_AllocMode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_GcMode =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      F2fsGetVictimFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GcMode kGcMode() { return {}; }
+  void set_gc_mode(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_GcMode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Victim =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsGetVictimFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Victim kVictim() { return {}; }
+  void set_victim(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Victim::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OfsUnit =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsGetVictimFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OfsUnit kOfsUnit() { return {}; }
+  void set_ofs_unit(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OfsUnit::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PreVictim =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsGetVictimFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PreVictim kPreVictim() { return {}; }
+  void set_pre_victim(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PreVictim::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Prefree =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsGetVictimFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Prefree kPrefree() { return {}; }
+  void set_prefree(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Prefree::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Free =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsGetVictimFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Free kFree() { return {}; }
+  void set_free(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Free::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsGetDataBlockFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsGetDataBlockFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsGetDataBlockFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsGetDataBlockFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_iblock() const { return at<3>().valid(); }
+  uint64_t iblock() const { return at<3>().as_uint64(); }
+  bool has_bh_start() const { return at<4>().valid(); }
+  uint64_t bh_start() const { return at<4>().as_uint64(); }
+  bool has_bh_size() const { return at<5>().valid(); }
+  uint64_t bh_size() const { return at<5>().as_uint64(); }
+  bool has_ret() const { return at<6>().valid(); }
+  int32_t ret() const { return at<6>().as_int32(); }
+};
+
+class F2fsGetDataBlockFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsGetDataBlockFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kIblockFieldNumber = 3,
+    kBhStartFieldNumber = 4,
+    kBhSizeFieldNumber = 5,
+    kRetFieldNumber = 6,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsGetDataBlockFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsGetDataBlockFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Iblock =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsGetDataBlockFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Iblock kIblock() { return {}; }
+  void set_iblock(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Iblock::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BhStart =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsGetDataBlockFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BhStart kBhStart() { return {}; }
+  void set_bh_start(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BhStart::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BhSize =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsGetDataBlockFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BhSize kBhSize() { return {}; }
+  void set_bh_size(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BhSize::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ret =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      F2fsGetDataBlockFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ret kRet() { return {}; }
+  void set_ret(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ret::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsFallocateFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsFallocateFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsFallocateFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsFallocateFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_mode() const { return at<3>().valid(); }
+  int32_t mode() const { return at<3>().as_int32(); }
+  bool has_offset() const { return at<4>().valid(); }
+  int64_t offset() const { return at<4>().as_int64(); }
+  bool has_len() const { return at<5>().valid(); }
+  int64_t len() const { return at<5>().as_int64(); }
+  bool has_size() const { return at<6>().valid(); }
+  int64_t size() const { return at<6>().as_int64(); }
+  bool has_blocks() const { return at<7>().valid(); }
+  uint64_t blocks() const { return at<7>().as_uint64(); }
+  bool has_ret() const { return at<8>().valid(); }
+  int32_t ret() const { return at<8>().as_int32(); }
+};
+
+class F2fsFallocateFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsFallocateFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kModeFieldNumber = 3,
+    kOffsetFieldNumber = 4,
+    kLenFieldNumber = 5,
+    kSizeFieldNumber = 6,
+    kBlocksFieldNumber = 7,
+    kRetFieldNumber = 8,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsFallocateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsFallocateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Mode =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      F2fsFallocateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mode kMode() { return {}; }
+  void set_mode(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Offset =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      F2fsFallocateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Offset kOffset() { return {}; }
+  void set_offset(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Offset::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      F2fsFallocateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Size =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      F2fsFallocateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Size kSize() { return {}; }
+  void set_size(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Size::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Blocks =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsFallocateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Blocks kBlocks() { return {}; }
+  void set_blocks(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Blocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ret =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      F2fsFallocateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ret kRet() { return {}; }
+  void set_ret(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ret::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsEvictInodeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsEvictInodeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsEvictInodeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsEvictInodeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_ino() const { return at<2>().valid(); }
+  uint64_t ino() const { return at<2>().as_uint64(); }
+  bool has_pino() const { return at<3>().valid(); }
+  uint64_t pino() const { return at<3>().as_uint64(); }
+  bool has_mode() const { return at<4>().valid(); }
+  uint32_t mode() const { return at<4>().as_uint32(); }
+  bool has_size() const { return at<5>().valid(); }
+  int64_t size() const { return at<5>().as_int64(); }
+  bool has_nlink() const { return at<6>().valid(); }
+  uint32_t nlink() const { return at<6>().as_uint32(); }
+  bool has_blocks() const { return at<7>().valid(); }
+  uint64_t blocks() const { return at<7>().as_uint64(); }
+  bool has_advise() const { return at<8>().valid(); }
+  uint32_t advise() const { return at<8>().as_uint32(); }
+};
+
+class F2fsEvictInodeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsEvictInodeFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kInoFieldNumber = 2,
+    kPinoFieldNumber = 3,
+    kModeFieldNumber = 4,
+    kSizeFieldNumber = 5,
+    kNlinkFieldNumber = 6,
+    kBlocksFieldNumber = 7,
+    kAdviseFieldNumber = 8,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsEvictInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ino =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsEvictInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ino kIno() { return {}; }
+  void set_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pino =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsEvictInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pino kPino() { return {}; }
+  void set_pino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pino::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Mode =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsEvictInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mode kMode() { return {}; }
+  void set_mode(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Size =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      F2fsEvictInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Size kSize() { return {}; }
+  void set_size(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Size::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Nlink =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsEvictInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Nlink kNlink() { return {}; }
+  void set_nlink(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Nlink::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Blocks =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsEvictInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Blocks kBlocks() { return {}; }
+  void set_blocks(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Blocks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Advise =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsEvictInodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Advise kAdvise() { return {}; }
+  void set_advise(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Advise::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class F2fsDoSubmitBioFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  F2fsDoSubmitBioFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit F2fsDoSubmitBioFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit F2fsDoSubmitBioFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dev() const { return at<1>().valid(); }
+  uint64_t dev() const { return at<1>().as_uint64(); }
+  bool has_btype() const { return at<2>().valid(); }
+  int32_t btype() const { return at<2>().as_int32(); }
+  bool has_sync() const { return at<3>().valid(); }
+  uint32_t sync() const { return at<3>().as_uint32(); }
+  bool has_sector() const { return at<4>().valid(); }
+  uint64_t sector() const { return at<4>().as_uint64(); }
+  bool has_size() const { return at<5>().valid(); }
+  uint32_t size() const { return at<5>().as_uint32(); }
+};
+
+class F2fsDoSubmitBioFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = F2fsDoSubmitBioFtraceEvent_Decoder;
+  enum : int32_t {
+    kDevFieldNumber = 1,
+    kBtypeFieldNumber = 2,
+    kSyncFieldNumber = 3,
+    kSectorFieldNumber = 4,
+    kSizeFieldNumber = 5,
+  };
+
+  using FieldMetadata_Dev =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsDoSubmitBioFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dev kDev() { return {}; }
+  void set_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Btype =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      F2fsDoSubmitBioFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Btype kBtype() { return {}; }
+  void set_btype(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Btype::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Sync =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsDoSubmitBioFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Sync kSync() { return {}; }
+  void set_sync(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Sync::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Sector =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      F2fsDoSubmitBioFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Sector kSector() { return {}; }
+  void set_sector(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Sector::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Size =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      F2fsDoSubmitBioFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Size kSize() { return {}; }
+  void set_size(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Size::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/fastrpc.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_FASTRPC_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_FASTRPC_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class FastrpcDmaStatFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  FastrpcDmaStatFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit FastrpcDmaStatFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit FastrpcDmaStatFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_cid() const { return at<1>().valid(); }
+  int32_t cid() const { return at<1>().as_int32(); }
+  bool has_len() const { return at<2>().valid(); }
+  int64_t len() const { return at<2>().as_int64(); }
+  bool has_total_allocated() const { return at<3>().valid(); }
+  uint64_t total_allocated() const { return at<3>().as_uint64(); }
+};
+
+class FastrpcDmaStatFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = FastrpcDmaStatFtraceEvent_Decoder;
+  enum : int32_t {
+    kCidFieldNumber = 1,
+    kLenFieldNumber = 2,
+    kTotalAllocatedFieldNumber = 3,
+  };
+
+  using FieldMetadata_Cid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      FastrpcDmaStatFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cid kCid() { return {}; }
+  void set_cid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      FastrpcDmaStatFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TotalAllocated =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      FastrpcDmaStatFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TotalAllocated kTotalAllocated() { return {}; }
+  void set_total_allocated(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TotalAllocated::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/fence.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_FENCE_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_FENCE_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class FenceSignaledFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  FenceSignaledFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit FenceSignaledFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit FenceSignaledFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_context() const { return at<1>().valid(); }
+  uint32_t context() const { return at<1>().as_uint32(); }
+  bool has_driver() const { return at<2>().valid(); }
+  ::protozero::ConstChars driver() const { return at<2>().as_string(); }
+  bool has_seqno() const { return at<3>().valid(); }
+  uint32_t seqno() const { return at<3>().as_uint32(); }
+  bool has_timeline() const { return at<4>().valid(); }
+  ::protozero::ConstChars timeline() const { return at<4>().as_string(); }
+};
+
+class FenceSignaledFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = FenceSignaledFtraceEvent_Decoder;
+  enum : int32_t {
+    kContextFieldNumber = 1,
+    kDriverFieldNumber = 2,
+    kSeqnoFieldNumber = 3,
+    kTimelineFieldNumber = 4,
+  };
+
+  using FieldMetadata_Context =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      FenceSignaledFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Context kContext() { return {}; }
+  void set_context(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Context::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Driver =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      FenceSignaledFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Driver kDriver() { return {}; }
+  void set_driver(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Driver::kFieldId, data, size);
+  }
+  void set_driver(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Driver::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Seqno =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      FenceSignaledFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Seqno kSeqno() { return {}; }
+  void set_seqno(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Seqno::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Timeline =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      FenceSignaledFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Timeline kTimeline() { return {}; }
+  void set_timeline(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Timeline::kFieldId, data, size);
+  }
+  void set_timeline(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Timeline::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class FenceEnableSignalFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  FenceEnableSignalFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit FenceEnableSignalFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit FenceEnableSignalFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_context() const { return at<1>().valid(); }
+  uint32_t context() const { return at<1>().as_uint32(); }
+  bool has_driver() const { return at<2>().valid(); }
+  ::protozero::ConstChars driver() const { return at<2>().as_string(); }
+  bool has_seqno() const { return at<3>().valid(); }
+  uint32_t seqno() const { return at<3>().as_uint32(); }
+  bool has_timeline() const { return at<4>().valid(); }
+  ::protozero::ConstChars timeline() const { return at<4>().as_string(); }
+};
+
+class FenceEnableSignalFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = FenceEnableSignalFtraceEvent_Decoder;
+  enum : int32_t {
+    kContextFieldNumber = 1,
+    kDriverFieldNumber = 2,
+    kSeqnoFieldNumber = 3,
+    kTimelineFieldNumber = 4,
+  };
+
+  using FieldMetadata_Context =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      FenceEnableSignalFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Context kContext() { return {}; }
+  void set_context(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Context::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Driver =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      FenceEnableSignalFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Driver kDriver() { return {}; }
+  void set_driver(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Driver::kFieldId, data, size);
+  }
+  void set_driver(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Driver::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Seqno =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      FenceEnableSignalFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Seqno kSeqno() { return {}; }
+  void set_seqno(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Seqno::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Timeline =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      FenceEnableSignalFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Timeline kTimeline() { return {}; }
+  void set_timeline(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Timeline::kFieldId, data, size);
+  }
+  void set_timeline(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Timeline::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class FenceDestroyFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  FenceDestroyFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit FenceDestroyFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit FenceDestroyFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_context() const { return at<1>().valid(); }
+  uint32_t context() const { return at<1>().as_uint32(); }
+  bool has_driver() const { return at<2>().valid(); }
+  ::protozero::ConstChars driver() const { return at<2>().as_string(); }
+  bool has_seqno() const { return at<3>().valid(); }
+  uint32_t seqno() const { return at<3>().as_uint32(); }
+  bool has_timeline() const { return at<4>().valid(); }
+  ::protozero::ConstChars timeline() const { return at<4>().as_string(); }
+};
+
+class FenceDestroyFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = FenceDestroyFtraceEvent_Decoder;
+  enum : int32_t {
+    kContextFieldNumber = 1,
+    kDriverFieldNumber = 2,
+    kSeqnoFieldNumber = 3,
+    kTimelineFieldNumber = 4,
+  };
+
+  using FieldMetadata_Context =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      FenceDestroyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Context kContext() { return {}; }
+  void set_context(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Context::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Driver =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      FenceDestroyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Driver kDriver() { return {}; }
+  void set_driver(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Driver::kFieldId, data, size);
+  }
+  void set_driver(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Driver::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Seqno =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      FenceDestroyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Seqno kSeqno() { return {}; }
+  void set_seqno(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Seqno::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Timeline =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      FenceDestroyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Timeline kTimeline() { return {}; }
+  void set_timeline(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Timeline::kFieldId, data, size);
+  }
+  void set_timeline(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Timeline::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class FenceInitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  FenceInitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit FenceInitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit FenceInitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_context() const { return at<1>().valid(); }
+  uint32_t context() const { return at<1>().as_uint32(); }
+  bool has_driver() const { return at<2>().valid(); }
+  ::protozero::ConstChars driver() const { return at<2>().as_string(); }
+  bool has_seqno() const { return at<3>().valid(); }
+  uint32_t seqno() const { return at<3>().as_uint32(); }
+  bool has_timeline() const { return at<4>().valid(); }
+  ::protozero::ConstChars timeline() const { return at<4>().as_string(); }
+};
+
+class FenceInitFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = FenceInitFtraceEvent_Decoder;
+  enum : int32_t {
+    kContextFieldNumber = 1,
+    kDriverFieldNumber = 2,
+    kSeqnoFieldNumber = 3,
+    kTimelineFieldNumber = 4,
+  };
+
+  using FieldMetadata_Context =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      FenceInitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Context kContext() { return {}; }
+  void set_context(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Context::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Driver =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      FenceInitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Driver kDriver() { return {}; }
+  void set_driver(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Driver::kFieldId, data, size);
+  }
+  void set_driver(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Driver::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Seqno =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      FenceInitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Seqno kSeqno() { return {}; }
+  void set_seqno(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Seqno::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Timeline =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      FenceInitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Timeline kTimeline() { return {}; }
+  void set_timeline(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Timeline::kFieldId, data, size);
+  }
+  void set_timeline(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Timeline::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/filemap.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_FILEMAP_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_FILEMAP_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class MmFilemapDeleteFromPageCacheFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MmFilemapDeleteFromPageCacheFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MmFilemapDeleteFromPageCacheFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MmFilemapDeleteFromPageCacheFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_pfn() const { return at<1>().valid(); }
+  uint64_t pfn() const { return at<1>().as_uint64(); }
+  bool has_i_ino() const { return at<2>().valid(); }
+  uint64_t i_ino() const { return at<2>().as_uint64(); }
+  bool has_index() const { return at<3>().valid(); }
+  uint64_t index() const { return at<3>().as_uint64(); }
+  bool has_s_dev() const { return at<4>().valid(); }
+  uint64_t s_dev() const { return at<4>().as_uint64(); }
+  bool has_page() const { return at<5>().valid(); }
+  uint64_t page() const { return at<5>().as_uint64(); }
+};
+
+class MmFilemapDeleteFromPageCacheFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MmFilemapDeleteFromPageCacheFtraceEvent_Decoder;
+  enum : int32_t {
+    kPfnFieldNumber = 1,
+    kIInoFieldNumber = 2,
+    kIndexFieldNumber = 3,
+    kSDevFieldNumber = 4,
+    kPageFieldNumber = 5,
+  };
+
+  using FieldMetadata_Pfn =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmFilemapDeleteFromPageCacheFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pfn kPfn() { return {}; }
+  void set_pfn(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pfn::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IIno =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmFilemapDeleteFromPageCacheFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IIno kIIno() { return {}; }
+  void set_i_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IIno::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Index =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmFilemapDeleteFromPageCacheFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Index kIndex() { return {}; }
+  void set_index(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Index::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SDev =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmFilemapDeleteFromPageCacheFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SDev kSDev() { return {}; }
+  void set_s_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SDev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Page =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmFilemapDeleteFromPageCacheFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Page kPage() { return {}; }
+  void set_page(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Page::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MmFilemapAddToPageCacheFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MmFilemapAddToPageCacheFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MmFilemapAddToPageCacheFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MmFilemapAddToPageCacheFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_pfn() const { return at<1>().valid(); }
+  uint64_t pfn() const { return at<1>().as_uint64(); }
+  bool has_i_ino() const { return at<2>().valid(); }
+  uint64_t i_ino() const { return at<2>().as_uint64(); }
+  bool has_index() const { return at<3>().valid(); }
+  uint64_t index() const { return at<3>().as_uint64(); }
+  bool has_s_dev() const { return at<4>().valid(); }
+  uint64_t s_dev() const { return at<4>().as_uint64(); }
+  bool has_page() const { return at<5>().valid(); }
+  uint64_t page() const { return at<5>().as_uint64(); }
+};
+
+class MmFilemapAddToPageCacheFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MmFilemapAddToPageCacheFtraceEvent_Decoder;
+  enum : int32_t {
+    kPfnFieldNumber = 1,
+    kIInoFieldNumber = 2,
+    kIndexFieldNumber = 3,
+    kSDevFieldNumber = 4,
+    kPageFieldNumber = 5,
+  };
+
+  using FieldMetadata_Pfn =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmFilemapAddToPageCacheFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pfn kPfn() { return {}; }
+  void set_pfn(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pfn::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IIno =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmFilemapAddToPageCacheFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IIno kIIno() { return {}; }
+  void set_i_ino(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IIno::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Index =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmFilemapAddToPageCacheFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Index kIndex() { return {}; }
+  void set_index(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Index::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SDev =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmFilemapAddToPageCacheFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SDev kSDev() { return {}; }
+  void set_s_dev(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SDev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Page =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmFilemapAddToPageCacheFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Page kPage() { return {}; }
+  void set_page(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Page::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/ftrace.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_FTRACE_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_FTRACE_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class PrintFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  PrintFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit PrintFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit PrintFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_ip() const { return at<1>().valid(); }
+  uint64_t ip() const { return at<1>().as_uint64(); }
+  bool has_buf() const { return at<2>().valid(); }
+  ::protozero::ConstChars buf() const { return at<2>().as_string(); }
+};
+
+class PrintFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = PrintFtraceEvent_Decoder;
+  enum : int32_t {
+    kIpFieldNumber = 1,
+    kBufFieldNumber = 2,
+  };
+
+  using FieldMetadata_Ip =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      PrintFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ip kIp() { return {}; }
+  void set_ip(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ip::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Buf =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      PrintFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Buf kBuf() { return {}; }
+  void set_buf(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Buf::kFieldId, data, size);
+  }
+  void set_buf(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Buf::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/g2d.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_G2D_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_G2D_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class G2dTracingMarkWriteFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  G2dTracingMarkWriteFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit G2dTracingMarkWriteFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit G2dTracingMarkWriteFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_pid() const { return at<1>().valid(); }
+  int32_t pid() const { return at<1>().as_int32(); }
+  bool has_name() const { return at<4>().valid(); }
+  ::protozero::ConstChars name() const { return at<4>().as_string(); }
+  bool has_type() const { return at<5>().valid(); }
+  uint32_t type() const { return at<5>().as_uint32(); }
+  bool has_value() const { return at<6>().valid(); }
+  int32_t value() const { return at<6>().as_int32(); }
+};
+
+class G2dTracingMarkWriteFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = G2dTracingMarkWriteFtraceEvent_Decoder;
+  enum : int32_t {
+    kPidFieldNumber = 1,
+    kNameFieldNumber = 4,
+    kTypeFieldNumber = 5,
+    kValueFieldNumber = 6,
+  };
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      G2dTracingMarkWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      G2dTracingMarkWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Type =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      G2dTracingMarkWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Type kType() { return {}; }
+  void set_type(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Type::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Value =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      G2dTracingMarkWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Value kValue() { return {}; }
+  void set_value(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Value::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/gpu_mem.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_GPU_MEM_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_GPU_MEM_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class GpuMemTotalFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  GpuMemTotalFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit GpuMemTotalFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit GpuMemTotalFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_gpu_id() const { return at<1>().valid(); }
+  uint32_t gpu_id() const { return at<1>().as_uint32(); }
+  bool has_pid() const { return at<2>().valid(); }
+  uint32_t pid() const { return at<2>().as_uint32(); }
+  bool has_size() const { return at<3>().valid(); }
+  uint64_t size() const { return at<3>().as_uint64(); }
+};
+
+class GpuMemTotalFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = GpuMemTotalFtraceEvent_Decoder;
+  enum : int32_t {
+    kGpuIdFieldNumber = 1,
+    kPidFieldNumber = 2,
+    kSizeFieldNumber = 3,
+  };
+
+  using FieldMetadata_GpuId =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      GpuMemTotalFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GpuId kGpuId() { return {}; }
+  void set_gpu_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_GpuId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      GpuMemTotalFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Size =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      GpuMemTotalFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Size kSize() { return {}; }
+  void set_size(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Size::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/i2c.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_I2C_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_I2C_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class SmbusReplyFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SmbusReplyFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SmbusReplyFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SmbusReplyFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_adapter_nr() const { return at<1>().valid(); }
+  int32_t adapter_nr() const { return at<1>().as_int32(); }
+  bool has_addr() const { return at<2>().valid(); }
+  uint32_t addr() const { return at<2>().as_uint32(); }
+  bool has_flags() const { return at<3>().valid(); }
+  uint32_t flags() const { return at<3>().as_uint32(); }
+  bool has_command() const { return at<4>().valid(); }
+  uint32_t command() const { return at<4>().as_uint32(); }
+  bool has_len() const { return at<5>().valid(); }
+  uint32_t len() const { return at<5>().as_uint32(); }
+  bool has_protocol() const { return at<6>().valid(); }
+  uint32_t protocol() const { return at<6>().as_uint32(); }
+};
+
+class SmbusReplyFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SmbusReplyFtraceEvent_Decoder;
+  enum : int32_t {
+    kAdapterNrFieldNumber = 1,
+    kAddrFieldNumber = 2,
+    kFlagsFieldNumber = 3,
+    kCommandFieldNumber = 4,
+    kLenFieldNumber = 5,
+    kProtocolFieldNumber = 6,
+  };
+
+  using FieldMetadata_AdapterNr =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SmbusReplyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AdapterNr kAdapterNr() { return {}; }
+  void set_adapter_nr(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_AdapterNr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Addr =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SmbusReplyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Addr kAddr() { return {}; }
+  void set_addr(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Addr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SmbusReplyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Command =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SmbusReplyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Command kCommand() { return {}; }
+  void set_command(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Command::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SmbusReplyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Protocol =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SmbusReplyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Protocol kProtocol() { return {}; }
+  void set_protocol(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Protocol::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SmbusResultFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SmbusResultFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SmbusResultFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SmbusResultFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_adapter_nr() const { return at<1>().valid(); }
+  int32_t adapter_nr() const { return at<1>().as_int32(); }
+  bool has_addr() const { return at<2>().valid(); }
+  uint32_t addr() const { return at<2>().as_uint32(); }
+  bool has_flags() const { return at<3>().valid(); }
+  uint32_t flags() const { return at<3>().as_uint32(); }
+  bool has_read_write() const { return at<4>().valid(); }
+  uint32_t read_write() const { return at<4>().as_uint32(); }
+  bool has_command() const { return at<5>().valid(); }
+  uint32_t command() const { return at<5>().as_uint32(); }
+  bool has_res() const { return at<6>().valid(); }
+  int32_t res() const { return at<6>().as_int32(); }
+  bool has_protocol() const { return at<7>().valid(); }
+  uint32_t protocol() const { return at<7>().as_uint32(); }
+};
+
+class SmbusResultFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SmbusResultFtraceEvent_Decoder;
+  enum : int32_t {
+    kAdapterNrFieldNumber = 1,
+    kAddrFieldNumber = 2,
+    kFlagsFieldNumber = 3,
+    kReadWriteFieldNumber = 4,
+    kCommandFieldNumber = 5,
+    kResFieldNumber = 6,
+    kProtocolFieldNumber = 7,
+  };
+
+  using FieldMetadata_AdapterNr =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SmbusResultFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AdapterNr kAdapterNr() { return {}; }
+  void set_adapter_nr(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_AdapterNr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Addr =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SmbusResultFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Addr kAddr() { return {}; }
+  void set_addr(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Addr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SmbusResultFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ReadWrite =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SmbusResultFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ReadWrite kReadWrite() { return {}; }
+  void set_read_write(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ReadWrite::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Command =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SmbusResultFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Command kCommand() { return {}; }
+  void set_command(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Command::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Res =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SmbusResultFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Res kRes() { return {}; }
+  void set_res(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Res::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Protocol =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SmbusResultFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Protocol kProtocol() { return {}; }
+  void set_protocol(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Protocol::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SmbusWriteFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SmbusWriteFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SmbusWriteFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SmbusWriteFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_adapter_nr() const { return at<1>().valid(); }
+  int32_t adapter_nr() const { return at<1>().as_int32(); }
+  bool has_addr() const { return at<2>().valid(); }
+  uint32_t addr() const { return at<2>().as_uint32(); }
+  bool has_flags() const { return at<3>().valid(); }
+  uint32_t flags() const { return at<3>().as_uint32(); }
+  bool has_command() const { return at<4>().valid(); }
+  uint32_t command() const { return at<4>().as_uint32(); }
+  bool has_len() const { return at<5>().valid(); }
+  uint32_t len() const { return at<5>().as_uint32(); }
+  bool has_protocol() const { return at<6>().valid(); }
+  uint32_t protocol() const { return at<6>().as_uint32(); }
+};
+
+class SmbusWriteFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SmbusWriteFtraceEvent_Decoder;
+  enum : int32_t {
+    kAdapterNrFieldNumber = 1,
+    kAddrFieldNumber = 2,
+    kFlagsFieldNumber = 3,
+    kCommandFieldNumber = 4,
+    kLenFieldNumber = 5,
+    kProtocolFieldNumber = 6,
+  };
+
+  using FieldMetadata_AdapterNr =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SmbusWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AdapterNr kAdapterNr() { return {}; }
+  void set_adapter_nr(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_AdapterNr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Addr =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SmbusWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Addr kAddr() { return {}; }
+  void set_addr(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Addr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SmbusWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Command =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SmbusWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Command kCommand() { return {}; }
+  void set_command(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Command::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SmbusWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Protocol =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SmbusWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Protocol kProtocol() { return {}; }
+  void set_protocol(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Protocol::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SmbusReadFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SmbusReadFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SmbusReadFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SmbusReadFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_adapter_nr() const { return at<1>().valid(); }
+  int32_t adapter_nr() const { return at<1>().as_int32(); }
+  bool has_flags() const { return at<2>().valid(); }
+  uint32_t flags() const { return at<2>().as_uint32(); }
+  bool has_addr() const { return at<3>().valid(); }
+  uint32_t addr() const { return at<3>().as_uint32(); }
+  bool has_command() const { return at<4>().valid(); }
+  uint32_t command() const { return at<4>().as_uint32(); }
+  bool has_protocol() const { return at<5>().valid(); }
+  uint32_t protocol() const { return at<5>().as_uint32(); }
+};
+
+class SmbusReadFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SmbusReadFtraceEvent_Decoder;
+  enum : int32_t {
+    kAdapterNrFieldNumber = 1,
+    kFlagsFieldNumber = 2,
+    kAddrFieldNumber = 3,
+    kCommandFieldNumber = 4,
+    kProtocolFieldNumber = 5,
+  };
+
+  using FieldMetadata_AdapterNr =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SmbusReadFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AdapterNr kAdapterNr() { return {}; }
+  void set_adapter_nr(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_AdapterNr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SmbusReadFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Addr =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SmbusReadFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Addr kAddr() { return {}; }
+  void set_addr(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Addr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Command =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SmbusReadFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Command kCommand() { return {}; }
+  void set_command(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Command::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Protocol =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SmbusReadFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Protocol kProtocol() { return {}; }
+  void set_protocol(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Protocol::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class I2cReplyFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  I2cReplyFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit I2cReplyFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit I2cReplyFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_adapter_nr() const { return at<1>().valid(); }
+  int32_t adapter_nr() const { return at<1>().as_int32(); }
+  bool has_msg_nr() const { return at<2>().valid(); }
+  uint32_t msg_nr() const { return at<2>().as_uint32(); }
+  bool has_addr() const { return at<3>().valid(); }
+  uint32_t addr() const { return at<3>().as_uint32(); }
+  bool has_flags() const { return at<4>().valid(); }
+  uint32_t flags() const { return at<4>().as_uint32(); }
+  bool has_len() const { return at<5>().valid(); }
+  uint32_t len() const { return at<5>().as_uint32(); }
+  bool has_buf() const { return at<6>().valid(); }
+  uint32_t buf() const { return at<6>().as_uint32(); }
+};
+
+class I2cReplyFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = I2cReplyFtraceEvent_Decoder;
+  enum : int32_t {
+    kAdapterNrFieldNumber = 1,
+    kMsgNrFieldNumber = 2,
+    kAddrFieldNumber = 3,
+    kFlagsFieldNumber = 4,
+    kLenFieldNumber = 5,
+    kBufFieldNumber = 6,
+  };
+
+  using FieldMetadata_AdapterNr =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      I2cReplyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AdapterNr kAdapterNr() { return {}; }
+  void set_adapter_nr(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_AdapterNr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MsgNr =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      I2cReplyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MsgNr kMsgNr() { return {}; }
+  void set_msg_nr(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MsgNr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Addr =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      I2cReplyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Addr kAddr() { return {}; }
+  void set_addr(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Addr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      I2cReplyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      I2cReplyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Buf =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      I2cReplyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Buf kBuf() { return {}; }
+  void set_buf(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Buf::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class I2cResultFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  I2cResultFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit I2cResultFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit I2cResultFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_adapter_nr() const { return at<1>().valid(); }
+  int32_t adapter_nr() const { return at<1>().as_int32(); }
+  bool has_nr_msgs() const { return at<2>().valid(); }
+  uint32_t nr_msgs() const { return at<2>().as_uint32(); }
+  bool has_ret() const { return at<3>().valid(); }
+  int32_t ret() const { return at<3>().as_int32(); }
+};
+
+class I2cResultFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = I2cResultFtraceEvent_Decoder;
+  enum : int32_t {
+    kAdapterNrFieldNumber = 1,
+    kNrMsgsFieldNumber = 2,
+    kRetFieldNumber = 3,
+  };
+
+  using FieldMetadata_AdapterNr =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      I2cResultFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AdapterNr kAdapterNr() { return {}; }
+  void set_adapter_nr(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_AdapterNr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NrMsgs =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      I2cResultFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrMsgs kNrMsgs() { return {}; }
+  void set_nr_msgs(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrMsgs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ret =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      I2cResultFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ret kRet() { return {}; }
+  void set_ret(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ret::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class I2cWriteFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  I2cWriteFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit I2cWriteFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit I2cWriteFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_adapter_nr() const { return at<1>().valid(); }
+  int32_t adapter_nr() const { return at<1>().as_int32(); }
+  bool has_msg_nr() const { return at<2>().valid(); }
+  uint32_t msg_nr() const { return at<2>().as_uint32(); }
+  bool has_addr() const { return at<3>().valid(); }
+  uint32_t addr() const { return at<3>().as_uint32(); }
+  bool has_flags() const { return at<4>().valid(); }
+  uint32_t flags() const { return at<4>().as_uint32(); }
+  bool has_len() const { return at<5>().valid(); }
+  uint32_t len() const { return at<5>().as_uint32(); }
+  bool has_buf() const { return at<6>().valid(); }
+  uint32_t buf() const { return at<6>().as_uint32(); }
+};
+
+class I2cWriteFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = I2cWriteFtraceEvent_Decoder;
+  enum : int32_t {
+    kAdapterNrFieldNumber = 1,
+    kMsgNrFieldNumber = 2,
+    kAddrFieldNumber = 3,
+    kFlagsFieldNumber = 4,
+    kLenFieldNumber = 5,
+    kBufFieldNumber = 6,
+  };
+
+  using FieldMetadata_AdapterNr =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      I2cWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AdapterNr kAdapterNr() { return {}; }
+  void set_adapter_nr(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_AdapterNr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MsgNr =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      I2cWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MsgNr kMsgNr() { return {}; }
+  void set_msg_nr(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MsgNr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Addr =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      I2cWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Addr kAddr() { return {}; }
+  void set_addr(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Addr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      I2cWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      I2cWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Buf =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      I2cWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Buf kBuf() { return {}; }
+  void set_buf(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Buf::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class I2cReadFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  I2cReadFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit I2cReadFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit I2cReadFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_adapter_nr() const { return at<1>().valid(); }
+  int32_t adapter_nr() const { return at<1>().as_int32(); }
+  bool has_msg_nr() const { return at<2>().valid(); }
+  uint32_t msg_nr() const { return at<2>().as_uint32(); }
+  bool has_addr() const { return at<3>().valid(); }
+  uint32_t addr() const { return at<3>().as_uint32(); }
+  bool has_flags() const { return at<4>().valid(); }
+  uint32_t flags() const { return at<4>().as_uint32(); }
+  bool has_len() const { return at<5>().valid(); }
+  uint32_t len() const { return at<5>().as_uint32(); }
+};
+
+class I2cReadFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = I2cReadFtraceEvent_Decoder;
+  enum : int32_t {
+    kAdapterNrFieldNumber = 1,
+    kMsgNrFieldNumber = 2,
+    kAddrFieldNumber = 3,
+    kFlagsFieldNumber = 4,
+    kLenFieldNumber = 5,
+  };
+
+  using FieldMetadata_AdapterNr =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      I2cReadFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AdapterNr kAdapterNr() { return {}; }
+  void set_adapter_nr(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_AdapterNr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MsgNr =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      I2cReadFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MsgNr kMsgNr() { return {}; }
+  void set_msg_nr(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MsgNr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Addr =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      I2cReadFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Addr kAddr() { return {}; }
+  void set_addr(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Addr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      I2cReadFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      I2cReadFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/ion.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_ION_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_ION_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class IonStatFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  IonStatFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit IonStatFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit IonStatFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_buffer_id() const { return at<1>().valid(); }
+  uint32_t buffer_id() const { return at<1>().as_uint32(); }
+  bool has_len() const { return at<2>().valid(); }
+  int64_t len() const { return at<2>().as_int64(); }
+  bool has_total_allocated() const { return at<3>().valid(); }
+  uint64_t total_allocated() const { return at<3>().as_uint64(); }
+};
+
+class IonStatFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = IonStatFtraceEvent_Decoder;
+  enum : int32_t {
+    kBufferIdFieldNumber = 1,
+    kLenFieldNumber = 2,
+    kTotalAllocatedFieldNumber = 3,
+  };
+
+  using FieldMetadata_BufferId =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      IonStatFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BufferId kBufferId() { return {}; }
+  void set_buffer_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BufferId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      IonStatFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TotalAllocated =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonStatFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TotalAllocated kTotalAllocated() { return {}; }
+  void set_total_allocated(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TotalAllocated::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/ipi.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_IPI_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_IPI_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class IpiRaiseFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  IpiRaiseFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit IpiRaiseFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit IpiRaiseFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_target_cpus() const { return at<1>().valid(); }
+  uint32_t target_cpus() const { return at<1>().as_uint32(); }
+  bool has_reason() const { return at<2>().valid(); }
+  ::protozero::ConstChars reason() const { return at<2>().as_string(); }
+};
+
+class IpiRaiseFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = IpiRaiseFtraceEvent_Decoder;
+  enum : int32_t {
+    kTargetCpusFieldNumber = 1,
+    kReasonFieldNumber = 2,
+  };
+
+  using FieldMetadata_TargetCpus =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      IpiRaiseFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TargetCpus kTargetCpus() { return {}; }
+  void set_target_cpus(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TargetCpus::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Reason =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      IpiRaiseFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Reason kReason() { return {}; }
+  void set_reason(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Reason::kFieldId, data, size);
+  }
+  void set_reason(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Reason::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class IpiExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  IpiExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit IpiExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit IpiExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_reason() const { return at<1>().valid(); }
+  ::protozero::ConstChars reason() const { return at<1>().as_string(); }
+};
+
+class IpiExitFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = IpiExitFtraceEvent_Decoder;
+  enum : int32_t {
+    kReasonFieldNumber = 1,
+  };
+
+  using FieldMetadata_Reason =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      IpiExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Reason kReason() { return {}; }
+  void set_reason(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Reason::kFieldId, data, size);
+  }
+  void set_reason(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Reason::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class IpiEntryFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  IpiEntryFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit IpiEntryFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit IpiEntryFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_reason() const { return at<1>().valid(); }
+  ::protozero::ConstChars reason() const { return at<1>().as_string(); }
+};
+
+class IpiEntryFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = IpiEntryFtraceEvent_Decoder;
+  enum : int32_t {
+    kReasonFieldNumber = 1,
+  };
+
+  using FieldMetadata_Reason =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      IpiEntryFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Reason kReason() { return {}; }
+  void set_reason(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Reason::kFieldId, data, size);
+  }
+  void set_reason(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Reason::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/irq.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_IRQ_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_IRQ_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class IrqHandlerExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  IrqHandlerExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit IrqHandlerExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit IrqHandlerExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_irq() const { return at<1>().valid(); }
+  int32_t irq() const { return at<1>().as_int32(); }
+  bool has_ret() const { return at<2>().valid(); }
+  int32_t ret() const { return at<2>().as_int32(); }
+};
+
+class IrqHandlerExitFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = IrqHandlerExitFtraceEvent_Decoder;
+  enum : int32_t {
+    kIrqFieldNumber = 1,
+    kRetFieldNumber = 2,
+  };
+
+  using FieldMetadata_Irq =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      IrqHandlerExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Irq kIrq() { return {}; }
+  void set_irq(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Irq::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ret =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      IrqHandlerExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ret kRet() { return {}; }
+  void set_ret(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ret::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class IrqHandlerEntryFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  IrqHandlerEntryFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit IrqHandlerEntryFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit IrqHandlerEntryFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_irq() const { return at<1>().valid(); }
+  int32_t irq() const { return at<1>().as_int32(); }
+  bool has_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars name() const { return at<2>().as_string(); }
+  bool has_handler() const { return at<3>().valid(); }
+  uint32_t handler() const { return at<3>().as_uint32(); }
+};
+
+class IrqHandlerEntryFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = IrqHandlerEntryFtraceEvent_Decoder;
+  enum : int32_t {
+    kIrqFieldNumber = 1,
+    kNameFieldNumber = 2,
+    kHandlerFieldNumber = 3,
+  };
+
+  using FieldMetadata_Irq =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      IrqHandlerEntryFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Irq kIrq() { return {}; }
+  void set_irq(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Irq::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      IrqHandlerEntryFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Handler =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      IrqHandlerEntryFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Handler kHandler() { return {}; }
+  void set_handler(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Handler::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SoftirqRaiseFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SoftirqRaiseFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SoftirqRaiseFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SoftirqRaiseFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_vec() const { return at<1>().valid(); }
+  uint32_t vec() const { return at<1>().as_uint32(); }
+};
+
+class SoftirqRaiseFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SoftirqRaiseFtraceEvent_Decoder;
+  enum : int32_t {
+    kVecFieldNumber = 1,
+  };
+
+  using FieldMetadata_Vec =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SoftirqRaiseFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Vec kVec() { return {}; }
+  void set_vec(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Vec::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SoftirqExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SoftirqExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SoftirqExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SoftirqExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_vec() const { return at<1>().valid(); }
+  uint32_t vec() const { return at<1>().as_uint32(); }
+};
+
+class SoftirqExitFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SoftirqExitFtraceEvent_Decoder;
+  enum : int32_t {
+    kVecFieldNumber = 1,
+  };
+
+  using FieldMetadata_Vec =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SoftirqExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Vec kVec() { return {}; }
+  void set_vec(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Vec::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SoftirqEntryFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SoftirqEntryFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SoftirqEntryFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SoftirqEntryFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_vec() const { return at<1>().valid(); }
+  uint32_t vec() const { return at<1>().as_uint32(); }
+};
+
+class SoftirqEntryFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SoftirqEntryFtraceEvent_Decoder;
+  enum : int32_t {
+    kVecFieldNumber = 1,
+  };
+
+  using FieldMetadata_Vec =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SoftirqEntryFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Vec kVec() { return {}; }
+  void set_vec(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Vec::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/kmem.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_KMEM_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_KMEM_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class IonBufferDestroyFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  IonBufferDestroyFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit IonBufferDestroyFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit IonBufferDestroyFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_addr() const { return at<1>().valid(); }
+  uint64_t addr() const { return at<1>().as_uint64(); }
+  bool has_len() const { return at<2>().valid(); }
+  uint64_t len() const { return at<2>().as_uint64(); }
+};
+
+class IonBufferDestroyFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = IonBufferDestroyFtraceEvent_Decoder;
+  enum : int32_t {
+    kAddrFieldNumber = 1,
+    kLenFieldNumber = 2,
+  };
+
+  using FieldMetadata_Addr =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonBufferDestroyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Addr kAddr() { return {}; }
+  void set_addr(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Addr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonBufferDestroyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class IonBufferCreateFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  IonBufferCreateFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit IonBufferCreateFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit IonBufferCreateFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_addr() const { return at<1>().valid(); }
+  uint64_t addr() const { return at<1>().as_uint64(); }
+  bool has_len() const { return at<2>().valid(); }
+  uint64_t len() const { return at<2>().as_uint64(); }
+};
+
+class IonBufferCreateFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = IonBufferCreateFtraceEvent_Decoder;
+  enum : int32_t {
+    kAddrFieldNumber = 1,
+    kLenFieldNumber = 2,
+  };
+
+  using FieldMetadata_Addr =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonBufferCreateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Addr kAddr() { return {}; }
+  void set_addr(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Addr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonBufferCreateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class IonHeapGrowFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  IonHeapGrowFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit IonHeapGrowFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit IonHeapGrowFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_heap_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars heap_name() const { return at<1>().as_string(); }
+  bool has_len() const { return at<2>().valid(); }
+  uint64_t len() const { return at<2>().as_uint64(); }
+  bool has_total_allocated() const { return at<3>().valid(); }
+  int64_t total_allocated() const { return at<3>().as_int64(); }
+};
+
+class IonHeapGrowFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = IonHeapGrowFtraceEvent_Decoder;
+  enum : int32_t {
+    kHeapNameFieldNumber = 1,
+    kLenFieldNumber = 2,
+    kTotalAllocatedFieldNumber = 3,
+  };
+
+  using FieldMetadata_HeapName =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      IonHeapGrowFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HeapName kHeapName() { return {}; }
+  void set_heap_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_HeapName::kFieldId, data, size);
+  }
+  void set_heap_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_HeapName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonHeapGrowFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TotalAllocated =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      IonHeapGrowFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TotalAllocated kTotalAllocated() { return {}; }
+  void set_total_allocated(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TotalAllocated::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class IonHeapShrinkFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  IonHeapShrinkFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit IonHeapShrinkFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit IonHeapShrinkFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_heap_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars heap_name() const { return at<1>().as_string(); }
+  bool has_len() const { return at<2>().valid(); }
+  uint64_t len() const { return at<2>().as_uint64(); }
+  bool has_total_allocated() const { return at<3>().valid(); }
+  int64_t total_allocated() const { return at<3>().as_int64(); }
+};
+
+class IonHeapShrinkFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = IonHeapShrinkFtraceEvent_Decoder;
+  enum : int32_t {
+    kHeapNameFieldNumber = 1,
+    kLenFieldNumber = 2,
+    kTotalAllocatedFieldNumber = 3,
+  };
+
+  using FieldMetadata_HeapName =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      IonHeapShrinkFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HeapName kHeapName() { return {}; }
+  void set_heap_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_HeapName::kFieldId, data, size);
+  }
+  void set_heap_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_HeapName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonHeapShrinkFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TotalAllocated =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      IonHeapShrinkFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TotalAllocated kTotalAllocated() { return {}; }
+  void set_total_allocated(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TotalAllocated::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class RssStatFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  RssStatFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit RssStatFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit RssStatFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_member() const { return at<1>().valid(); }
+  int32_t member() const { return at<1>().as_int32(); }
+  bool has_size() const { return at<2>().valid(); }
+  int64_t size() const { return at<2>().as_int64(); }
+  bool has_curr() const { return at<3>().valid(); }
+  uint32_t curr() const { return at<3>().as_uint32(); }
+  bool has_mm_id() const { return at<4>().valid(); }
+  uint32_t mm_id() const { return at<4>().as_uint32(); }
+};
+
+class RssStatFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = RssStatFtraceEvent_Decoder;
+  enum : int32_t {
+    kMemberFieldNumber = 1,
+    kSizeFieldNumber = 2,
+    kCurrFieldNumber = 3,
+    kMmIdFieldNumber = 4,
+  };
+
+  using FieldMetadata_Member =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      RssStatFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Member kMember() { return {}; }
+  void set_member(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Member::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Size =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      RssStatFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Size kSize() { return {}; }
+  void set_size(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Size::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Curr =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      RssStatFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Curr kCurr() { return {}; }
+  void set_curr(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Curr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MmId =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      RssStatFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MmId kMmId() { return {}; }
+  void set_mm_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MmId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MmPagePcpuDrainFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MmPagePcpuDrainFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MmPagePcpuDrainFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MmPagePcpuDrainFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_migratetype() const { return at<1>().valid(); }
+  int32_t migratetype() const { return at<1>().as_int32(); }
+  bool has_order() const { return at<2>().valid(); }
+  uint32_t order() const { return at<2>().as_uint32(); }
+  bool has_page() const { return at<3>().valid(); }
+  uint64_t page() const { return at<3>().as_uint64(); }
+  bool has_pfn() const { return at<4>().valid(); }
+  uint64_t pfn() const { return at<4>().as_uint64(); }
+};
+
+class MmPagePcpuDrainFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MmPagePcpuDrainFtraceEvent_Decoder;
+  enum : int32_t {
+    kMigratetypeFieldNumber = 1,
+    kOrderFieldNumber = 2,
+    kPageFieldNumber = 3,
+    kPfnFieldNumber = 4,
+  };
+
+  using FieldMetadata_Migratetype =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmPagePcpuDrainFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Migratetype kMigratetype() { return {}; }
+  void set_migratetype(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Migratetype::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Order =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MmPagePcpuDrainFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Order kOrder() { return {}; }
+  void set_order(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Order::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Page =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmPagePcpuDrainFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Page kPage() { return {}; }
+  void set_page(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Page::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pfn =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmPagePcpuDrainFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pfn kPfn() { return {}; }
+  void set_pfn(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pfn::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MmPageFreeBatchedFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MmPageFreeBatchedFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MmPageFreeBatchedFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MmPageFreeBatchedFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_cold() const { return at<1>().valid(); }
+  int32_t cold() const { return at<1>().as_int32(); }
+  bool has_page() const { return at<2>().valid(); }
+  uint64_t page() const { return at<2>().as_uint64(); }
+  bool has_pfn() const { return at<3>().valid(); }
+  uint64_t pfn() const { return at<3>().as_uint64(); }
+};
+
+class MmPageFreeBatchedFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MmPageFreeBatchedFtraceEvent_Decoder;
+  enum : int32_t {
+    kColdFieldNumber = 1,
+    kPageFieldNumber = 2,
+    kPfnFieldNumber = 3,
+  };
+
+  using FieldMetadata_Cold =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmPageFreeBatchedFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cold kCold() { return {}; }
+  void set_cold(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cold::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Page =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmPageFreeBatchedFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Page kPage() { return {}; }
+  void set_page(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Page::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pfn =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmPageFreeBatchedFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pfn kPfn() { return {}; }
+  void set_pfn(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pfn::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MmPageFreeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MmPageFreeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MmPageFreeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MmPageFreeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_order() const { return at<1>().valid(); }
+  uint32_t order() const { return at<1>().as_uint32(); }
+  bool has_page() const { return at<2>().valid(); }
+  uint64_t page() const { return at<2>().as_uint64(); }
+  bool has_pfn() const { return at<3>().valid(); }
+  uint64_t pfn() const { return at<3>().as_uint64(); }
+};
+
+class MmPageFreeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MmPageFreeFtraceEvent_Decoder;
+  enum : int32_t {
+    kOrderFieldNumber = 1,
+    kPageFieldNumber = 2,
+    kPfnFieldNumber = 3,
+  };
+
+  using FieldMetadata_Order =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MmPageFreeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Order kOrder() { return {}; }
+  void set_order(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Order::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Page =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmPageFreeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Page kPage() { return {}; }
+  void set_page(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Page::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pfn =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmPageFreeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pfn kPfn() { return {}; }
+  void set_pfn(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pfn::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MmPageAllocZoneLockedFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MmPageAllocZoneLockedFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MmPageAllocZoneLockedFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MmPageAllocZoneLockedFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_migratetype() const { return at<1>().valid(); }
+  int32_t migratetype() const { return at<1>().as_int32(); }
+  bool has_order() const { return at<2>().valid(); }
+  uint32_t order() const { return at<2>().as_uint32(); }
+  bool has_page() const { return at<3>().valid(); }
+  uint64_t page() const { return at<3>().as_uint64(); }
+  bool has_pfn() const { return at<4>().valid(); }
+  uint64_t pfn() const { return at<4>().as_uint64(); }
+};
+
+class MmPageAllocZoneLockedFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MmPageAllocZoneLockedFtraceEvent_Decoder;
+  enum : int32_t {
+    kMigratetypeFieldNumber = 1,
+    kOrderFieldNumber = 2,
+    kPageFieldNumber = 3,
+    kPfnFieldNumber = 4,
+  };
+
+  using FieldMetadata_Migratetype =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmPageAllocZoneLockedFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Migratetype kMigratetype() { return {}; }
+  void set_migratetype(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Migratetype::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Order =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MmPageAllocZoneLockedFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Order kOrder() { return {}; }
+  void set_order(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Order::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Page =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmPageAllocZoneLockedFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Page kPage() { return {}; }
+  void set_page(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Page::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pfn =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmPageAllocZoneLockedFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pfn kPfn() { return {}; }
+  void set_pfn(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pfn::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MmPageAllocExtfragFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MmPageAllocExtfragFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MmPageAllocExtfragFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MmPageAllocExtfragFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_alloc_migratetype() const { return at<1>().valid(); }
+  int32_t alloc_migratetype() const { return at<1>().as_int32(); }
+  bool has_alloc_order() const { return at<2>().valid(); }
+  int32_t alloc_order() const { return at<2>().as_int32(); }
+  bool has_fallback_migratetype() const { return at<3>().valid(); }
+  int32_t fallback_migratetype() const { return at<3>().as_int32(); }
+  bool has_fallback_order() const { return at<4>().valid(); }
+  int32_t fallback_order() const { return at<4>().as_int32(); }
+  bool has_page() const { return at<5>().valid(); }
+  uint64_t page() const { return at<5>().as_uint64(); }
+  bool has_change_ownership() const { return at<6>().valid(); }
+  int32_t change_ownership() const { return at<6>().as_int32(); }
+  bool has_pfn() const { return at<7>().valid(); }
+  uint64_t pfn() const { return at<7>().as_uint64(); }
+};
+
+class MmPageAllocExtfragFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MmPageAllocExtfragFtraceEvent_Decoder;
+  enum : int32_t {
+    kAllocMigratetypeFieldNumber = 1,
+    kAllocOrderFieldNumber = 2,
+    kFallbackMigratetypeFieldNumber = 3,
+    kFallbackOrderFieldNumber = 4,
+    kPageFieldNumber = 5,
+    kChangeOwnershipFieldNumber = 6,
+    kPfnFieldNumber = 7,
+  };
+
+  using FieldMetadata_AllocMigratetype =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmPageAllocExtfragFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AllocMigratetype kAllocMigratetype() { return {}; }
+  void set_alloc_migratetype(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_AllocMigratetype::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_AllocOrder =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmPageAllocExtfragFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AllocOrder kAllocOrder() { return {}; }
+  void set_alloc_order(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_AllocOrder::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FallbackMigratetype =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmPageAllocExtfragFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FallbackMigratetype kFallbackMigratetype() { return {}; }
+  void set_fallback_migratetype(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FallbackMigratetype::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FallbackOrder =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmPageAllocExtfragFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FallbackOrder kFallbackOrder() { return {}; }
+  void set_fallback_order(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FallbackOrder::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Page =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmPageAllocExtfragFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Page kPage() { return {}; }
+  void set_page(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Page::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ChangeOwnership =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmPageAllocExtfragFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChangeOwnership kChangeOwnership() { return {}; }
+  void set_change_ownership(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ChangeOwnership::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pfn =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmPageAllocExtfragFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pfn kPfn() { return {}; }
+  void set_pfn(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pfn::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MmPageAllocFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MmPageAllocFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MmPageAllocFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MmPageAllocFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_gfp_flags() const { return at<1>().valid(); }
+  uint32_t gfp_flags() const { return at<1>().as_uint32(); }
+  bool has_migratetype() const { return at<2>().valid(); }
+  int32_t migratetype() const { return at<2>().as_int32(); }
+  bool has_order() const { return at<3>().valid(); }
+  uint32_t order() const { return at<3>().as_uint32(); }
+  bool has_page() const { return at<4>().valid(); }
+  uint64_t page() const { return at<4>().as_uint64(); }
+  bool has_pfn() const { return at<5>().valid(); }
+  uint64_t pfn() const { return at<5>().as_uint64(); }
+};
+
+class MmPageAllocFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MmPageAllocFtraceEvent_Decoder;
+  enum : int32_t {
+    kGfpFlagsFieldNumber = 1,
+    kMigratetypeFieldNumber = 2,
+    kOrderFieldNumber = 3,
+    kPageFieldNumber = 4,
+    kPfnFieldNumber = 5,
+  };
+
+  using FieldMetadata_GfpFlags =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MmPageAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GfpFlags kGfpFlags() { return {}; }
+  void set_gfp_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_GfpFlags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Migratetype =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmPageAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Migratetype kMigratetype() { return {}; }
+  void set_migratetype(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Migratetype::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Order =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MmPageAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Order kOrder() { return {}; }
+  void set_order(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Order::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Page =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmPageAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Page kPage() { return {}; }
+  void set_page(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Page::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pfn =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmPageAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pfn kPfn() { return {}; }
+  void set_pfn(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pfn::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MigrateRetryFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MigrateRetryFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MigrateRetryFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MigrateRetryFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_tries() const { return at<1>().valid(); }
+  int32_t tries() const { return at<1>().as_int32(); }
+};
+
+class MigrateRetryFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MigrateRetryFtraceEvent_Decoder;
+  enum : int32_t {
+    kTriesFieldNumber = 1,
+  };
+
+  using FieldMetadata_Tries =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MigrateRetryFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Tries kTries() { return {}; }
+  void set_tries(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Tries::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MigratePagesStartFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MigratePagesStartFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MigratePagesStartFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MigratePagesStartFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_mode() const { return at<1>().valid(); }
+  int32_t mode() const { return at<1>().as_int32(); }
+};
+
+class MigratePagesStartFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MigratePagesStartFtraceEvent_Decoder;
+  enum : int32_t {
+    kModeFieldNumber = 1,
+  };
+
+  using FieldMetadata_Mode =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MigratePagesStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mode kMode() { return {}; }
+  void set_mode(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MigratePagesEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MigratePagesEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MigratePagesEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MigratePagesEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_mode() const { return at<1>().valid(); }
+  int32_t mode() const { return at<1>().as_int32(); }
+};
+
+class MigratePagesEndFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MigratePagesEndFtraceEvent_Decoder;
+  enum : int32_t {
+    kModeFieldNumber = 1,
+  };
+
+  using FieldMetadata_Mode =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MigratePagesEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mode kMode() { return {}; }
+  void set_mode(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class KmemCacheFreeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  KmemCacheFreeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit KmemCacheFreeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit KmemCacheFreeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_call_site() const { return at<1>().valid(); }
+  uint64_t call_site() const { return at<1>().as_uint64(); }
+  bool has_ptr() const { return at<2>().valid(); }
+  uint64_t ptr() const { return at<2>().as_uint64(); }
+};
+
+class KmemCacheFreeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = KmemCacheFreeFtraceEvent_Decoder;
+  enum : int32_t {
+    kCallSiteFieldNumber = 1,
+    kPtrFieldNumber = 2,
+  };
+
+  using FieldMetadata_CallSite =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      KmemCacheFreeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CallSite kCallSite() { return {}; }
+  void set_call_site(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CallSite::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ptr =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      KmemCacheFreeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ptr kPtr() { return {}; }
+  void set_ptr(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ptr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class KmemCacheAllocNodeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  KmemCacheAllocNodeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit KmemCacheAllocNodeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit KmemCacheAllocNodeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_bytes_alloc() const { return at<1>().valid(); }
+  uint64_t bytes_alloc() const { return at<1>().as_uint64(); }
+  bool has_bytes_req() const { return at<2>().valid(); }
+  uint64_t bytes_req() const { return at<2>().as_uint64(); }
+  bool has_call_site() const { return at<3>().valid(); }
+  uint64_t call_site() const { return at<3>().as_uint64(); }
+  bool has_gfp_flags() const { return at<4>().valid(); }
+  uint32_t gfp_flags() const { return at<4>().as_uint32(); }
+  bool has_node() const { return at<5>().valid(); }
+  int32_t node() const { return at<5>().as_int32(); }
+  bool has_ptr() const { return at<6>().valid(); }
+  uint64_t ptr() const { return at<6>().as_uint64(); }
+};
+
+class KmemCacheAllocNodeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = KmemCacheAllocNodeFtraceEvent_Decoder;
+  enum : int32_t {
+    kBytesAllocFieldNumber = 1,
+    kBytesReqFieldNumber = 2,
+    kCallSiteFieldNumber = 3,
+    kGfpFlagsFieldNumber = 4,
+    kNodeFieldNumber = 5,
+    kPtrFieldNumber = 6,
+  };
+
+  using FieldMetadata_BytesAlloc =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      KmemCacheAllocNodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BytesAlloc kBytesAlloc() { return {}; }
+  void set_bytes_alloc(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BytesAlloc::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BytesReq =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      KmemCacheAllocNodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BytesReq kBytesReq() { return {}; }
+  void set_bytes_req(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BytesReq::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CallSite =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      KmemCacheAllocNodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CallSite kCallSite() { return {}; }
+  void set_call_site(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CallSite::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_GfpFlags =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      KmemCacheAllocNodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GfpFlags kGfpFlags() { return {}; }
+  void set_gfp_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_GfpFlags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Node =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      KmemCacheAllocNodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Node kNode() { return {}; }
+  void set_node(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Node::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ptr =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      KmemCacheAllocNodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ptr kPtr() { return {}; }
+  void set_ptr(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ptr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class KmemCacheAllocFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  KmemCacheAllocFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit KmemCacheAllocFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit KmemCacheAllocFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_bytes_alloc() const { return at<1>().valid(); }
+  uint64_t bytes_alloc() const { return at<1>().as_uint64(); }
+  bool has_bytes_req() const { return at<2>().valid(); }
+  uint64_t bytes_req() const { return at<2>().as_uint64(); }
+  bool has_call_site() const { return at<3>().valid(); }
+  uint64_t call_site() const { return at<3>().as_uint64(); }
+  bool has_gfp_flags() const { return at<4>().valid(); }
+  uint32_t gfp_flags() const { return at<4>().as_uint32(); }
+  bool has_ptr() const { return at<5>().valid(); }
+  uint64_t ptr() const { return at<5>().as_uint64(); }
+};
+
+class KmemCacheAllocFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = KmemCacheAllocFtraceEvent_Decoder;
+  enum : int32_t {
+    kBytesAllocFieldNumber = 1,
+    kBytesReqFieldNumber = 2,
+    kCallSiteFieldNumber = 3,
+    kGfpFlagsFieldNumber = 4,
+    kPtrFieldNumber = 5,
+  };
+
+  using FieldMetadata_BytesAlloc =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      KmemCacheAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BytesAlloc kBytesAlloc() { return {}; }
+  void set_bytes_alloc(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BytesAlloc::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BytesReq =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      KmemCacheAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BytesReq kBytesReq() { return {}; }
+  void set_bytes_req(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BytesReq::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CallSite =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      KmemCacheAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CallSite kCallSite() { return {}; }
+  void set_call_site(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CallSite::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_GfpFlags =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      KmemCacheAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GfpFlags kGfpFlags() { return {}; }
+  void set_gfp_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_GfpFlags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ptr =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      KmemCacheAllocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ptr kPtr() { return {}; }
+  void set_ptr(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ptr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class KmallocNodeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  KmallocNodeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit KmallocNodeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit KmallocNodeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_bytes_alloc() const { return at<1>().valid(); }
+  uint64_t bytes_alloc() const { return at<1>().as_uint64(); }
+  bool has_bytes_req() const { return at<2>().valid(); }
+  uint64_t bytes_req() const { return at<2>().as_uint64(); }
+  bool has_call_site() const { return at<3>().valid(); }
+  uint64_t call_site() const { return at<3>().as_uint64(); }
+  bool has_gfp_flags() const { return at<4>().valid(); }
+  uint32_t gfp_flags() const { return at<4>().as_uint32(); }
+  bool has_node() const { return at<5>().valid(); }
+  int32_t node() const { return at<5>().as_int32(); }
+  bool has_ptr() const { return at<6>().valid(); }
+  uint64_t ptr() const { return at<6>().as_uint64(); }
+};
+
+class KmallocNodeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = KmallocNodeFtraceEvent_Decoder;
+  enum : int32_t {
+    kBytesAllocFieldNumber = 1,
+    kBytesReqFieldNumber = 2,
+    kCallSiteFieldNumber = 3,
+    kGfpFlagsFieldNumber = 4,
+    kNodeFieldNumber = 5,
+    kPtrFieldNumber = 6,
+  };
+
+  using FieldMetadata_BytesAlloc =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      KmallocNodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BytesAlloc kBytesAlloc() { return {}; }
+  void set_bytes_alloc(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BytesAlloc::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BytesReq =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      KmallocNodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BytesReq kBytesReq() { return {}; }
+  void set_bytes_req(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BytesReq::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CallSite =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      KmallocNodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CallSite kCallSite() { return {}; }
+  void set_call_site(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CallSite::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_GfpFlags =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      KmallocNodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GfpFlags kGfpFlags() { return {}; }
+  void set_gfp_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_GfpFlags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Node =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      KmallocNodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Node kNode() { return {}; }
+  void set_node(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Node::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ptr =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      KmallocNodeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ptr kPtr() { return {}; }
+  void set_ptr(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ptr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class KmallocFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  KmallocFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit KmallocFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit KmallocFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_bytes_alloc() const { return at<1>().valid(); }
+  uint64_t bytes_alloc() const { return at<1>().as_uint64(); }
+  bool has_bytes_req() const { return at<2>().valid(); }
+  uint64_t bytes_req() const { return at<2>().as_uint64(); }
+  bool has_call_site() const { return at<3>().valid(); }
+  uint64_t call_site() const { return at<3>().as_uint64(); }
+  bool has_gfp_flags() const { return at<4>().valid(); }
+  uint32_t gfp_flags() const { return at<4>().as_uint32(); }
+  bool has_ptr() const { return at<5>().valid(); }
+  uint64_t ptr() const { return at<5>().as_uint64(); }
+};
+
+class KmallocFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = KmallocFtraceEvent_Decoder;
+  enum : int32_t {
+    kBytesAllocFieldNumber = 1,
+    kBytesReqFieldNumber = 2,
+    kCallSiteFieldNumber = 3,
+    kGfpFlagsFieldNumber = 4,
+    kPtrFieldNumber = 5,
+  };
+
+  using FieldMetadata_BytesAlloc =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      KmallocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BytesAlloc kBytesAlloc() { return {}; }
+  void set_bytes_alloc(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BytesAlloc::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BytesReq =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      KmallocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BytesReq kBytesReq() { return {}; }
+  void set_bytes_req(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BytesReq::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CallSite =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      KmallocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CallSite kCallSite() { return {}; }
+  void set_call_site(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CallSite::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_GfpFlags =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      KmallocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GfpFlags kGfpFlags() { return {}; }
+  void set_gfp_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_GfpFlags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ptr =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      KmallocFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ptr kPtr() { return {}; }
+  void set_ptr(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ptr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class KfreeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  KfreeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit KfreeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit KfreeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_call_site() const { return at<1>().valid(); }
+  uint64_t call_site() const { return at<1>().as_uint64(); }
+  bool has_ptr() const { return at<2>().valid(); }
+  uint64_t ptr() const { return at<2>().as_uint64(); }
+};
+
+class KfreeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = KfreeFtraceEvent_Decoder;
+  enum : int32_t {
+    kCallSiteFieldNumber = 1,
+    kPtrFieldNumber = 2,
+  };
+
+  using FieldMetadata_CallSite =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      KfreeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CallSite kCallSite() { return {}; }
+  void set_call_site(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CallSite::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ptr =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      KfreeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ptr kPtr() { return {}; }
+  void set_ptr(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ptr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class IonSecureCmaShrinkPoolStartFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  IonSecureCmaShrinkPoolStartFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit IonSecureCmaShrinkPoolStartFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit IonSecureCmaShrinkPoolStartFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_drained_size() const { return at<1>().valid(); }
+  uint64_t drained_size() const { return at<1>().as_uint64(); }
+  bool has_skipped_size() const { return at<2>().valid(); }
+  uint64_t skipped_size() const { return at<2>().as_uint64(); }
+};
+
+class IonSecureCmaShrinkPoolStartFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = IonSecureCmaShrinkPoolStartFtraceEvent_Decoder;
+  enum : int32_t {
+    kDrainedSizeFieldNumber = 1,
+    kSkippedSizeFieldNumber = 2,
+  };
+
+  using FieldMetadata_DrainedSize =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonSecureCmaShrinkPoolStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DrainedSize kDrainedSize() { return {}; }
+  void set_drained_size(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DrainedSize::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SkippedSize =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonSecureCmaShrinkPoolStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SkippedSize kSkippedSize() { return {}; }
+  void set_skipped_size(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SkippedSize::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class IonSecureCmaShrinkPoolEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  IonSecureCmaShrinkPoolEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit IonSecureCmaShrinkPoolEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit IonSecureCmaShrinkPoolEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_drained_size() const { return at<1>().valid(); }
+  uint64_t drained_size() const { return at<1>().as_uint64(); }
+  bool has_skipped_size() const { return at<2>().valid(); }
+  uint64_t skipped_size() const { return at<2>().as_uint64(); }
+};
+
+class IonSecureCmaShrinkPoolEndFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = IonSecureCmaShrinkPoolEndFtraceEvent_Decoder;
+  enum : int32_t {
+    kDrainedSizeFieldNumber = 1,
+    kSkippedSizeFieldNumber = 2,
+  };
+
+  using FieldMetadata_DrainedSize =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonSecureCmaShrinkPoolEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DrainedSize kDrainedSize() { return {}; }
+  void set_drained_size(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DrainedSize::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SkippedSize =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonSecureCmaShrinkPoolEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SkippedSize kSkippedSize() { return {}; }
+  void set_skipped_size(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SkippedSize::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class IonSecureCmaAllocateStartFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  IonSecureCmaAllocateStartFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit IonSecureCmaAllocateStartFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit IonSecureCmaAllocateStartFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_align() const { return at<1>().valid(); }
+  uint64_t align() const { return at<1>().as_uint64(); }
+  bool has_flags() const { return at<2>().valid(); }
+  uint64_t flags() const { return at<2>().as_uint64(); }
+  bool has_heap_name() const { return at<3>().valid(); }
+  ::protozero::ConstChars heap_name() const { return at<3>().as_string(); }
+  bool has_len() const { return at<4>().valid(); }
+  uint64_t len() const { return at<4>().as_uint64(); }
+};
+
+class IonSecureCmaAllocateStartFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = IonSecureCmaAllocateStartFtraceEvent_Decoder;
+  enum : int32_t {
+    kAlignFieldNumber = 1,
+    kFlagsFieldNumber = 2,
+    kHeapNameFieldNumber = 3,
+    kLenFieldNumber = 4,
+  };
+
+  using FieldMetadata_Align =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonSecureCmaAllocateStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Align kAlign() { return {}; }
+  void set_align(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Align::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonSecureCmaAllocateStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HeapName =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      IonSecureCmaAllocateStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HeapName kHeapName() { return {}; }
+  void set_heap_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_HeapName::kFieldId, data, size);
+  }
+  void set_heap_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_HeapName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonSecureCmaAllocateStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class IonSecureCmaAllocateEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  IonSecureCmaAllocateEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit IonSecureCmaAllocateEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit IonSecureCmaAllocateEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_align() const { return at<1>().valid(); }
+  uint64_t align() const { return at<1>().as_uint64(); }
+  bool has_flags() const { return at<2>().valid(); }
+  uint64_t flags() const { return at<2>().as_uint64(); }
+  bool has_heap_name() const { return at<3>().valid(); }
+  ::protozero::ConstChars heap_name() const { return at<3>().as_string(); }
+  bool has_len() const { return at<4>().valid(); }
+  uint64_t len() const { return at<4>().as_uint64(); }
+};
+
+class IonSecureCmaAllocateEndFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = IonSecureCmaAllocateEndFtraceEvent_Decoder;
+  enum : int32_t {
+    kAlignFieldNumber = 1,
+    kFlagsFieldNumber = 2,
+    kHeapNameFieldNumber = 3,
+    kLenFieldNumber = 4,
+  };
+
+  using FieldMetadata_Align =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonSecureCmaAllocateEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Align kAlign() { return {}; }
+  void set_align(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Align::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonSecureCmaAllocateEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HeapName =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      IonSecureCmaAllocateEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HeapName kHeapName() { return {}; }
+  void set_heap_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_HeapName::kFieldId, data, size);
+  }
+  void set_heap_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_HeapName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonSecureCmaAllocateEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class IonSecureCmaAddToPoolStartFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  IonSecureCmaAddToPoolStartFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit IonSecureCmaAddToPoolStartFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit IonSecureCmaAddToPoolStartFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_is_prefetch() const { return at<1>().valid(); }
+  uint32_t is_prefetch() const { return at<1>().as_uint32(); }
+  bool has_len() const { return at<2>().valid(); }
+  uint64_t len() const { return at<2>().as_uint64(); }
+  bool has_pool_total() const { return at<3>().valid(); }
+  int32_t pool_total() const { return at<3>().as_int32(); }
+};
+
+class IonSecureCmaAddToPoolStartFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = IonSecureCmaAddToPoolStartFtraceEvent_Decoder;
+  enum : int32_t {
+    kIsPrefetchFieldNumber = 1,
+    kLenFieldNumber = 2,
+    kPoolTotalFieldNumber = 3,
+  };
+
+  using FieldMetadata_IsPrefetch =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      IonSecureCmaAddToPoolStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IsPrefetch kIsPrefetch() { return {}; }
+  void set_is_prefetch(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IsPrefetch::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonSecureCmaAddToPoolStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PoolTotal =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      IonSecureCmaAddToPoolStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PoolTotal kPoolTotal() { return {}; }
+  void set_pool_total(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PoolTotal::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class IonSecureCmaAddToPoolEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  IonSecureCmaAddToPoolEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit IonSecureCmaAddToPoolEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit IonSecureCmaAddToPoolEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_is_prefetch() const { return at<1>().valid(); }
+  uint32_t is_prefetch() const { return at<1>().as_uint32(); }
+  bool has_len() const { return at<2>().valid(); }
+  uint64_t len() const { return at<2>().as_uint64(); }
+  bool has_pool_total() const { return at<3>().valid(); }
+  int32_t pool_total() const { return at<3>().as_int32(); }
+};
+
+class IonSecureCmaAddToPoolEndFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = IonSecureCmaAddToPoolEndFtraceEvent_Decoder;
+  enum : int32_t {
+    kIsPrefetchFieldNumber = 1,
+    kLenFieldNumber = 2,
+    kPoolTotalFieldNumber = 3,
+  };
+
+  using FieldMetadata_IsPrefetch =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      IonSecureCmaAddToPoolEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IsPrefetch kIsPrefetch() { return {}; }
+  void set_is_prefetch(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IsPrefetch::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonSecureCmaAddToPoolEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PoolTotal =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      IonSecureCmaAddToPoolEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PoolTotal kPoolTotal() { return {}; }
+  void set_pool_total(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PoolTotal::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class IonPrefetchingFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  IonPrefetchingFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit IonPrefetchingFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit IonPrefetchingFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_len() const { return at<1>().valid(); }
+  uint64_t len() const { return at<1>().as_uint64(); }
+};
+
+class IonPrefetchingFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = IonPrefetchingFtraceEvent_Decoder;
+  enum : int32_t {
+    kLenFieldNumber = 1,
+  };
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonPrefetchingFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class IonCpSecureBufferStartFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  IonCpSecureBufferStartFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit IonCpSecureBufferStartFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit IonCpSecureBufferStartFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_align() const { return at<1>().valid(); }
+  uint64_t align() const { return at<1>().as_uint64(); }
+  bool has_flags() const { return at<2>().valid(); }
+  uint64_t flags() const { return at<2>().as_uint64(); }
+  bool has_heap_name() const { return at<3>().valid(); }
+  ::protozero::ConstChars heap_name() const { return at<3>().as_string(); }
+  bool has_len() const { return at<4>().valid(); }
+  uint64_t len() const { return at<4>().as_uint64(); }
+};
+
+class IonCpSecureBufferStartFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = IonCpSecureBufferStartFtraceEvent_Decoder;
+  enum : int32_t {
+    kAlignFieldNumber = 1,
+    kFlagsFieldNumber = 2,
+    kHeapNameFieldNumber = 3,
+    kLenFieldNumber = 4,
+  };
+
+  using FieldMetadata_Align =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonCpSecureBufferStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Align kAlign() { return {}; }
+  void set_align(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Align::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonCpSecureBufferStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HeapName =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      IonCpSecureBufferStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HeapName kHeapName() { return {}; }
+  void set_heap_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_HeapName::kFieldId, data, size);
+  }
+  void set_heap_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_HeapName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonCpSecureBufferStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class IonCpSecureBufferEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  IonCpSecureBufferEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit IonCpSecureBufferEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit IonCpSecureBufferEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_align() const { return at<1>().valid(); }
+  uint64_t align() const { return at<1>().as_uint64(); }
+  bool has_flags() const { return at<2>().valid(); }
+  uint64_t flags() const { return at<2>().as_uint64(); }
+  bool has_heap_name() const { return at<3>().valid(); }
+  ::protozero::ConstChars heap_name() const { return at<3>().as_string(); }
+  bool has_len() const { return at<4>().valid(); }
+  uint64_t len() const { return at<4>().as_uint64(); }
+};
+
+class IonCpSecureBufferEndFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = IonCpSecureBufferEndFtraceEvent_Decoder;
+  enum : int32_t {
+    kAlignFieldNumber = 1,
+    kFlagsFieldNumber = 2,
+    kHeapNameFieldNumber = 3,
+    kLenFieldNumber = 4,
+  };
+
+  using FieldMetadata_Align =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonCpSecureBufferEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Align kAlign() { return {}; }
+  void set_align(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Align::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonCpSecureBufferEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HeapName =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      IonCpSecureBufferEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HeapName kHeapName() { return {}; }
+  void set_heap_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_HeapName::kFieldId, data, size);
+  }
+  void set_heap_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_HeapName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonCpSecureBufferEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class IonCpAllocRetryFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  IonCpAllocRetryFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit IonCpAllocRetryFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit IonCpAllocRetryFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_tries() const { return at<1>().valid(); }
+  int32_t tries() const { return at<1>().as_int32(); }
+};
+
+class IonCpAllocRetryFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = IonCpAllocRetryFtraceEvent_Decoder;
+  enum : int32_t {
+    kTriesFieldNumber = 1,
+  };
+
+  using FieldMetadata_Tries =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      IonCpAllocRetryFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Tries kTries() { return {}; }
+  void set_tries(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Tries::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class IonAllocBufferStartFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  IonAllocBufferStartFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit IonAllocBufferStartFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit IonAllocBufferStartFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_client_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars client_name() const { return at<1>().as_string(); }
+  bool has_flags() const { return at<2>().valid(); }
+  uint32_t flags() const { return at<2>().as_uint32(); }
+  bool has_heap_name() const { return at<3>().valid(); }
+  ::protozero::ConstChars heap_name() const { return at<3>().as_string(); }
+  bool has_len() const { return at<4>().valid(); }
+  uint64_t len() const { return at<4>().as_uint64(); }
+  bool has_mask() const { return at<5>().valid(); }
+  uint32_t mask() const { return at<5>().as_uint32(); }
+};
+
+class IonAllocBufferStartFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = IonAllocBufferStartFtraceEvent_Decoder;
+  enum : int32_t {
+    kClientNameFieldNumber = 1,
+    kFlagsFieldNumber = 2,
+    kHeapNameFieldNumber = 3,
+    kLenFieldNumber = 4,
+    kMaskFieldNumber = 5,
+  };
+
+  using FieldMetadata_ClientName =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      IonAllocBufferStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ClientName kClientName() { return {}; }
+  void set_client_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ClientName::kFieldId, data, size);
+  }
+  void set_client_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ClientName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      IonAllocBufferStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HeapName =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      IonAllocBufferStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HeapName kHeapName() { return {}; }
+  void set_heap_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_HeapName::kFieldId, data, size);
+  }
+  void set_heap_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_HeapName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonAllocBufferStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Mask =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      IonAllocBufferStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mask kMask() { return {}; }
+  void set_mask(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mask::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class IonAllocBufferFallbackFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  IonAllocBufferFallbackFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit IonAllocBufferFallbackFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit IonAllocBufferFallbackFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_client_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars client_name() const { return at<1>().as_string(); }
+  bool has_error() const { return at<2>().valid(); }
+  int64_t error() const { return at<2>().as_int64(); }
+  bool has_flags() const { return at<3>().valid(); }
+  uint32_t flags() const { return at<3>().as_uint32(); }
+  bool has_heap_name() const { return at<4>().valid(); }
+  ::protozero::ConstChars heap_name() const { return at<4>().as_string(); }
+  bool has_len() const { return at<5>().valid(); }
+  uint64_t len() const { return at<5>().as_uint64(); }
+  bool has_mask() const { return at<6>().valid(); }
+  uint32_t mask() const { return at<6>().as_uint32(); }
+};
+
+class IonAllocBufferFallbackFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = IonAllocBufferFallbackFtraceEvent_Decoder;
+  enum : int32_t {
+    kClientNameFieldNumber = 1,
+    kErrorFieldNumber = 2,
+    kFlagsFieldNumber = 3,
+    kHeapNameFieldNumber = 4,
+    kLenFieldNumber = 5,
+    kMaskFieldNumber = 6,
+  };
+
+  using FieldMetadata_ClientName =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      IonAllocBufferFallbackFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ClientName kClientName() { return {}; }
+  void set_client_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ClientName::kFieldId, data, size);
+  }
+  void set_client_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ClientName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Error =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      IonAllocBufferFallbackFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Error kError() { return {}; }
+  void set_error(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Error::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      IonAllocBufferFallbackFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HeapName =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      IonAllocBufferFallbackFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HeapName kHeapName() { return {}; }
+  void set_heap_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_HeapName::kFieldId, data, size);
+  }
+  void set_heap_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_HeapName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonAllocBufferFallbackFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Mask =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      IonAllocBufferFallbackFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mask kMask() { return {}; }
+  void set_mask(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mask::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class IonAllocBufferFailFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  IonAllocBufferFailFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit IonAllocBufferFailFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit IonAllocBufferFailFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_client_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars client_name() const { return at<1>().as_string(); }
+  bool has_error() const { return at<2>().valid(); }
+  int64_t error() const { return at<2>().as_int64(); }
+  bool has_flags() const { return at<3>().valid(); }
+  uint32_t flags() const { return at<3>().as_uint32(); }
+  bool has_heap_name() const { return at<4>().valid(); }
+  ::protozero::ConstChars heap_name() const { return at<4>().as_string(); }
+  bool has_len() const { return at<5>().valid(); }
+  uint64_t len() const { return at<5>().as_uint64(); }
+  bool has_mask() const { return at<6>().valid(); }
+  uint32_t mask() const { return at<6>().as_uint32(); }
+};
+
+class IonAllocBufferFailFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = IonAllocBufferFailFtraceEvent_Decoder;
+  enum : int32_t {
+    kClientNameFieldNumber = 1,
+    kErrorFieldNumber = 2,
+    kFlagsFieldNumber = 3,
+    kHeapNameFieldNumber = 4,
+    kLenFieldNumber = 5,
+    kMaskFieldNumber = 6,
+  };
+
+  using FieldMetadata_ClientName =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      IonAllocBufferFailFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ClientName kClientName() { return {}; }
+  void set_client_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ClientName::kFieldId, data, size);
+  }
+  void set_client_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ClientName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Error =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      IonAllocBufferFailFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Error kError() { return {}; }
+  void set_error(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Error::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      IonAllocBufferFailFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HeapName =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      IonAllocBufferFailFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HeapName kHeapName() { return {}; }
+  void set_heap_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_HeapName::kFieldId, data, size);
+  }
+  void set_heap_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_HeapName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonAllocBufferFailFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Mask =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      IonAllocBufferFailFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mask kMask() { return {}; }
+  void set_mask(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mask::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class IonAllocBufferEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  IonAllocBufferEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit IonAllocBufferEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit IonAllocBufferEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_client_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars client_name() const { return at<1>().as_string(); }
+  bool has_flags() const { return at<2>().valid(); }
+  uint32_t flags() const { return at<2>().as_uint32(); }
+  bool has_heap_name() const { return at<3>().valid(); }
+  ::protozero::ConstChars heap_name() const { return at<3>().as_string(); }
+  bool has_len() const { return at<4>().valid(); }
+  uint64_t len() const { return at<4>().as_uint64(); }
+  bool has_mask() const { return at<5>().valid(); }
+  uint32_t mask() const { return at<5>().as_uint32(); }
+};
+
+class IonAllocBufferEndFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = IonAllocBufferEndFtraceEvent_Decoder;
+  enum : int32_t {
+    kClientNameFieldNumber = 1,
+    kFlagsFieldNumber = 2,
+    kHeapNameFieldNumber = 3,
+    kLenFieldNumber = 4,
+    kMaskFieldNumber = 5,
+  };
+
+  using FieldMetadata_ClientName =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      IonAllocBufferEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ClientName kClientName() { return {}; }
+  void set_client_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ClientName::kFieldId, data, size);
+  }
+  void set_client_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ClientName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      IonAllocBufferEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HeapName =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      IonAllocBufferEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HeapName kHeapName() { return {}; }
+  void set_heap_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_HeapName::kFieldId, data, size);
+  }
+  void set_heap_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_HeapName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IonAllocBufferEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Mask =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      IonAllocBufferEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mask kMask() { return {}; }
+  void set_mask(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mask::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class IommuSecPtblMapRangeStartFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  IommuSecPtblMapRangeStartFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit IommuSecPtblMapRangeStartFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit IommuSecPtblMapRangeStartFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_len() const { return at<1>().valid(); }
+  uint64_t len() const { return at<1>().as_uint64(); }
+  bool has_num() const { return at<2>().valid(); }
+  int32_t num() const { return at<2>().as_int32(); }
+  bool has_pa() const { return at<3>().valid(); }
+  uint32_t pa() const { return at<3>().as_uint32(); }
+  bool has_sec_id() const { return at<4>().valid(); }
+  int32_t sec_id() const { return at<4>().as_int32(); }
+  bool has_va() const { return at<5>().valid(); }
+  uint64_t va() const { return at<5>().as_uint64(); }
+};
+
+class IommuSecPtblMapRangeStartFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = IommuSecPtblMapRangeStartFtraceEvent_Decoder;
+  enum : int32_t {
+    kLenFieldNumber = 1,
+    kNumFieldNumber = 2,
+    kPaFieldNumber = 3,
+    kSecIdFieldNumber = 4,
+    kVaFieldNumber = 5,
+  };
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IommuSecPtblMapRangeStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Num =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      IommuSecPtblMapRangeStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Num kNum() { return {}; }
+  void set_num(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Num::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pa =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      IommuSecPtblMapRangeStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pa kPa() { return {}; }
+  void set_pa(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pa::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SecId =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      IommuSecPtblMapRangeStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SecId kSecId() { return {}; }
+  void set_sec_id(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SecId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Va =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IommuSecPtblMapRangeStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Va kVa() { return {}; }
+  void set_va(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Va::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class IommuSecPtblMapRangeEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  IommuSecPtblMapRangeEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit IommuSecPtblMapRangeEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit IommuSecPtblMapRangeEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_len() const { return at<1>().valid(); }
+  uint64_t len() const { return at<1>().as_uint64(); }
+  bool has_num() const { return at<2>().valid(); }
+  int32_t num() const { return at<2>().as_int32(); }
+  bool has_pa() const { return at<3>().valid(); }
+  uint32_t pa() const { return at<3>().as_uint32(); }
+  bool has_sec_id() const { return at<4>().valid(); }
+  int32_t sec_id() const { return at<4>().as_int32(); }
+  bool has_va() const { return at<5>().valid(); }
+  uint64_t va() const { return at<5>().as_uint64(); }
+};
+
+class IommuSecPtblMapRangeEndFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = IommuSecPtblMapRangeEndFtraceEvent_Decoder;
+  enum : int32_t {
+    kLenFieldNumber = 1,
+    kNumFieldNumber = 2,
+    kPaFieldNumber = 3,
+    kSecIdFieldNumber = 4,
+    kVaFieldNumber = 5,
+  };
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IommuSecPtblMapRangeEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Num =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      IommuSecPtblMapRangeEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Num kNum() { return {}; }
+  void set_num(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Num::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pa =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      IommuSecPtblMapRangeEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pa kPa() { return {}; }
+  void set_pa(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pa::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SecId =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      IommuSecPtblMapRangeEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SecId kSecId() { return {}; }
+  void set_sec_id(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SecId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Va =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IommuSecPtblMapRangeEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Va kVa() { return {}; }
+  void set_va(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Va::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class IommuMapRangeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  IommuMapRangeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit IommuMapRangeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit IommuMapRangeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_chunk_size() const { return at<1>().valid(); }
+  uint64_t chunk_size() const { return at<1>().as_uint64(); }
+  bool has_len() const { return at<2>().valid(); }
+  uint64_t len() const { return at<2>().as_uint64(); }
+  bool has_pa() const { return at<3>().valid(); }
+  uint64_t pa() const { return at<3>().as_uint64(); }
+  bool has_va() const { return at<4>().valid(); }
+  uint64_t va() const { return at<4>().as_uint64(); }
+};
+
+class IommuMapRangeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = IommuMapRangeFtraceEvent_Decoder;
+  enum : int32_t {
+    kChunkSizeFieldNumber = 1,
+    kLenFieldNumber = 2,
+    kPaFieldNumber = 3,
+    kVaFieldNumber = 4,
+  };
+
+  using FieldMetadata_ChunkSize =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IommuMapRangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChunkSize kChunkSize() { return {}; }
+  void set_chunk_size(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ChunkSize::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Len =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IommuMapRangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Len kLen() { return {}; }
+  void set_len(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Len::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pa =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IommuMapRangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pa kPa() { return {}; }
+  void set_pa(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pa::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Va =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      IommuMapRangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Va kVa() { return {}; }
+  void set_va(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Va::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class DmaAllocContiguousRetryFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  DmaAllocContiguousRetryFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit DmaAllocContiguousRetryFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit DmaAllocContiguousRetryFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_tries() const { return at<1>().valid(); }
+  int32_t tries() const { return at<1>().as_int32(); }
+};
+
+class DmaAllocContiguousRetryFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = DmaAllocContiguousRetryFtraceEvent_Decoder;
+  enum : int32_t {
+    kTriesFieldNumber = 1,
+  };
+
+  using FieldMetadata_Tries =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      DmaAllocContiguousRetryFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Tries kTries() { return {}; }
+  void set_tries(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Tries::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class AllocPagesSysStartFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  AllocPagesSysStartFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit AllocPagesSysStartFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit AllocPagesSysStartFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_gfp_flags() const { return at<1>().valid(); }
+  uint32_t gfp_flags() const { return at<1>().as_uint32(); }
+  bool has_order() const { return at<2>().valid(); }
+  uint32_t order() const { return at<2>().as_uint32(); }
+};
+
+class AllocPagesSysStartFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = AllocPagesSysStartFtraceEvent_Decoder;
+  enum : int32_t {
+    kGfpFlagsFieldNumber = 1,
+    kOrderFieldNumber = 2,
+  };
+
+  using FieldMetadata_GfpFlags =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      AllocPagesSysStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GfpFlags kGfpFlags() { return {}; }
+  void set_gfp_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_GfpFlags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Order =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      AllocPagesSysStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Order kOrder() { return {}; }
+  void set_order(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Order::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class AllocPagesSysFailFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  AllocPagesSysFailFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit AllocPagesSysFailFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit AllocPagesSysFailFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_gfp_flags() const { return at<1>().valid(); }
+  uint32_t gfp_flags() const { return at<1>().as_uint32(); }
+  bool has_order() const { return at<2>().valid(); }
+  uint32_t order() const { return at<2>().as_uint32(); }
+};
+
+class AllocPagesSysFailFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = AllocPagesSysFailFtraceEvent_Decoder;
+  enum : int32_t {
+    kGfpFlagsFieldNumber = 1,
+    kOrderFieldNumber = 2,
+  };
+
+  using FieldMetadata_GfpFlags =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      AllocPagesSysFailFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GfpFlags kGfpFlags() { return {}; }
+  void set_gfp_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_GfpFlags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Order =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      AllocPagesSysFailFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Order kOrder() { return {}; }
+  void set_order(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Order::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class AllocPagesSysEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  AllocPagesSysEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit AllocPagesSysEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit AllocPagesSysEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_gfp_flags() const { return at<1>().valid(); }
+  uint32_t gfp_flags() const { return at<1>().as_uint32(); }
+  bool has_order() const { return at<2>().valid(); }
+  uint32_t order() const { return at<2>().as_uint32(); }
+};
+
+class AllocPagesSysEndFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = AllocPagesSysEndFtraceEvent_Decoder;
+  enum : int32_t {
+    kGfpFlagsFieldNumber = 1,
+    kOrderFieldNumber = 2,
+  };
+
+  using FieldMetadata_GfpFlags =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      AllocPagesSysEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GfpFlags kGfpFlags() { return {}; }
+  void set_gfp_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_GfpFlags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Order =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      AllocPagesSysEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Order kOrder() { return {}; }
+  void set_order(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Order::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class AllocPagesIommuStartFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  AllocPagesIommuStartFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit AllocPagesIommuStartFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit AllocPagesIommuStartFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_gfp_flags() const { return at<1>().valid(); }
+  uint32_t gfp_flags() const { return at<1>().as_uint32(); }
+  bool has_order() const { return at<2>().valid(); }
+  uint32_t order() const { return at<2>().as_uint32(); }
+};
+
+class AllocPagesIommuStartFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = AllocPagesIommuStartFtraceEvent_Decoder;
+  enum : int32_t {
+    kGfpFlagsFieldNumber = 1,
+    kOrderFieldNumber = 2,
+  };
+
+  using FieldMetadata_GfpFlags =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      AllocPagesIommuStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GfpFlags kGfpFlags() { return {}; }
+  void set_gfp_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_GfpFlags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Order =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      AllocPagesIommuStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Order kOrder() { return {}; }
+  void set_order(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Order::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class AllocPagesIommuFailFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  AllocPagesIommuFailFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit AllocPagesIommuFailFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit AllocPagesIommuFailFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_gfp_flags() const { return at<1>().valid(); }
+  uint32_t gfp_flags() const { return at<1>().as_uint32(); }
+  bool has_order() const { return at<2>().valid(); }
+  uint32_t order() const { return at<2>().as_uint32(); }
+};
+
+class AllocPagesIommuFailFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = AllocPagesIommuFailFtraceEvent_Decoder;
+  enum : int32_t {
+    kGfpFlagsFieldNumber = 1,
+    kOrderFieldNumber = 2,
+  };
+
+  using FieldMetadata_GfpFlags =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      AllocPagesIommuFailFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GfpFlags kGfpFlags() { return {}; }
+  void set_gfp_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_GfpFlags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Order =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      AllocPagesIommuFailFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Order kOrder() { return {}; }
+  void set_order(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Order::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class AllocPagesIommuEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  AllocPagesIommuEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit AllocPagesIommuEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit AllocPagesIommuEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_gfp_flags() const { return at<1>().valid(); }
+  uint32_t gfp_flags() const { return at<1>().as_uint32(); }
+  bool has_order() const { return at<2>().valid(); }
+  uint32_t order() const { return at<2>().as_uint32(); }
+};
+
+class AllocPagesIommuEndFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = AllocPagesIommuEndFtraceEvent_Decoder;
+  enum : int32_t {
+    kGfpFlagsFieldNumber = 1,
+    kOrderFieldNumber = 2,
+  };
+
+  using FieldMetadata_GfpFlags =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      AllocPagesIommuEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GfpFlags kGfpFlags() { return {}; }
+  void set_gfp_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_GfpFlags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Order =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      AllocPagesIommuEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Order kOrder() { return {}; }
+  void set_order(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Order::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/lowmemorykiller.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_LOWMEMORYKILLER_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_LOWMEMORYKILLER_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class LowmemoryKillFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  LowmemoryKillFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit LowmemoryKillFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit LowmemoryKillFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_comm() const { return at<1>().valid(); }
+  ::protozero::ConstChars comm() const { return at<1>().as_string(); }
+  bool has_pid() const { return at<2>().valid(); }
+  int32_t pid() const { return at<2>().as_int32(); }
+  bool has_pagecache_size() const { return at<3>().valid(); }
+  int64_t pagecache_size() const { return at<3>().as_int64(); }
+  bool has_pagecache_limit() const { return at<4>().valid(); }
+  int64_t pagecache_limit() const { return at<4>().as_int64(); }
+  bool has_free() const { return at<5>().valid(); }
+  int64_t free() const { return at<5>().as_int64(); }
+};
+
+class LowmemoryKillFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = LowmemoryKillFtraceEvent_Decoder;
+  enum : int32_t {
+    kCommFieldNumber = 1,
+    kPidFieldNumber = 2,
+    kPagecacheSizeFieldNumber = 3,
+    kPagecacheLimitFieldNumber = 4,
+    kFreeFieldNumber = 5,
+  };
+
+  using FieldMetadata_Comm =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      LowmemoryKillFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Comm kComm() { return {}; }
+  void set_comm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Comm::kFieldId, data, size);
+  }
+  void set_comm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Comm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      LowmemoryKillFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PagecacheSize =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      LowmemoryKillFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PagecacheSize kPagecacheSize() { return {}; }
+  void set_pagecache_size(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PagecacheSize::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PagecacheLimit =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      LowmemoryKillFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PagecacheLimit kPagecacheLimit() { return {}; }
+  void set_pagecache_limit(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PagecacheLimit::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Free =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      LowmemoryKillFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Free kFree() { return {}; }
+  void set_free(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Free::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/mali.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_MALI_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_MALI_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class MaliTracingMarkWriteFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MaliTracingMarkWriteFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MaliTracingMarkWriteFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MaliTracingMarkWriteFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_pid() const { return at<2>().valid(); }
+  int32_t pid() const { return at<2>().as_int32(); }
+  bool has_type() const { return at<3>().valid(); }
+  uint32_t type() const { return at<3>().as_uint32(); }
+  bool has_value() const { return at<4>().valid(); }
+  int32_t value() const { return at<4>().as_int32(); }
+};
+
+class MaliTracingMarkWriteFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MaliTracingMarkWriteFtraceEvent_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kPidFieldNumber = 2,
+    kTypeFieldNumber = 3,
+    kValueFieldNumber = 4,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      MaliTracingMarkWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MaliTracingMarkWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Type =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MaliTracingMarkWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Type kType() { return {}; }
+  void set_type(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Type::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Value =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MaliTracingMarkWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Value kValue() { return {}; }
+  void set_value(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Value::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/mdss.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_MDSS_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_MDSS_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class RotatorBwAoAsContextFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  RotatorBwAoAsContextFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit RotatorBwAoAsContextFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit RotatorBwAoAsContextFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_state() const { return at<1>().valid(); }
+  uint32_t state() const { return at<1>().as_uint32(); }
+};
+
+class RotatorBwAoAsContextFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = RotatorBwAoAsContextFtraceEvent_Decoder;
+  enum : int32_t {
+    kStateFieldNumber = 1,
+  };
+
+  using FieldMetadata_State =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      RotatorBwAoAsContextFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_State kState() { return {}; }
+  void set_state(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_State::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MdpPerfUpdateBusFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MdpPerfUpdateBusFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MdpPerfUpdateBusFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MdpPerfUpdateBusFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_client() const { return at<1>().valid(); }
+  int32_t client() const { return at<1>().as_int32(); }
+  bool has_ab_quota() const { return at<2>().valid(); }
+  uint64_t ab_quota() const { return at<2>().as_uint64(); }
+  bool has_ib_quota() const { return at<3>().valid(); }
+  uint64_t ib_quota() const { return at<3>().as_uint64(); }
+};
+
+class MdpPerfUpdateBusFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MdpPerfUpdateBusFtraceEvent_Decoder;
+  enum : int32_t {
+    kClientFieldNumber = 1,
+    kAbQuotaFieldNumber = 2,
+    kIbQuotaFieldNumber = 3,
+  };
+
+  using FieldMetadata_Client =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MdpPerfUpdateBusFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Client kClient() { return {}; }
+  void set_client(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Client::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_AbQuota =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MdpPerfUpdateBusFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AbQuota kAbQuota() { return {}; }
+  void set_ab_quota(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_AbQuota::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IbQuota =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MdpPerfUpdateBusFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IbQuota kIbQuota() { return {}; }
+  void set_ib_quota(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IbQuota::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MdpPerfPrefillCalcFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/10, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MdpPerfPrefillCalcFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MdpPerfPrefillCalcFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MdpPerfPrefillCalcFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_pnum() const { return at<1>().valid(); }
+  uint32_t pnum() const { return at<1>().as_uint32(); }
+  bool has_latency_buf() const { return at<2>().valid(); }
+  uint32_t latency_buf() const { return at<2>().as_uint32(); }
+  bool has_ot() const { return at<3>().valid(); }
+  uint32_t ot() const { return at<3>().as_uint32(); }
+  bool has_y_buf() const { return at<4>().valid(); }
+  uint32_t y_buf() const { return at<4>().as_uint32(); }
+  bool has_y_scaler() const { return at<5>().valid(); }
+  uint32_t y_scaler() const { return at<5>().as_uint32(); }
+  bool has_pp_lines() const { return at<6>().valid(); }
+  uint32_t pp_lines() const { return at<6>().as_uint32(); }
+  bool has_pp_bytes() const { return at<7>().valid(); }
+  uint32_t pp_bytes() const { return at<7>().as_uint32(); }
+  bool has_post_sc() const { return at<8>().valid(); }
+  uint32_t post_sc() const { return at<8>().as_uint32(); }
+  bool has_fbc_bytes() const { return at<9>().valid(); }
+  uint32_t fbc_bytes() const { return at<9>().as_uint32(); }
+  bool has_prefill_bytes() const { return at<10>().valid(); }
+  uint32_t prefill_bytes() const { return at<10>().as_uint32(); }
+};
+
+class MdpPerfPrefillCalcFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MdpPerfPrefillCalcFtraceEvent_Decoder;
+  enum : int32_t {
+    kPnumFieldNumber = 1,
+    kLatencyBufFieldNumber = 2,
+    kOtFieldNumber = 3,
+    kYBufFieldNumber = 4,
+    kYScalerFieldNumber = 5,
+    kPpLinesFieldNumber = 6,
+    kPpBytesFieldNumber = 7,
+    kPostScFieldNumber = 8,
+    kFbcBytesFieldNumber = 9,
+    kPrefillBytesFieldNumber = 10,
+  };
+
+  using FieldMetadata_Pnum =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfPrefillCalcFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pnum kPnum() { return {}; }
+  void set_pnum(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pnum::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LatencyBuf =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfPrefillCalcFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LatencyBuf kLatencyBuf() { return {}; }
+  void set_latency_buf(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_LatencyBuf::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ot =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfPrefillCalcFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ot kOt() { return {}; }
+  void set_ot(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ot::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_YBuf =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfPrefillCalcFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_YBuf kYBuf() { return {}; }
+  void set_y_buf(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_YBuf::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_YScaler =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfPrefillCalcFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_YScaler kYScaler() { return {}; }
+  void set_y_scaler(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_YScaler::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PpLines =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfPrefillCalcFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PpLines kPpLines() { return {}; }
+  void set_pp_lines(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PpLines::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PpBytes =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfPrefillCalcFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PpBytes kPpBytes() { return {}; }
+  void set_pp_bytes(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PpBytes::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PostSc =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfPrefillCalcFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PostSc kPostSc() { return {}; }
+  void set_post_sc(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PostSc::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FbcBytes =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfPrefillCalcFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FbcBytes kFbcBytes() { return {}; }
+  void set_fbc_bytes(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FbcBytes::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PrefillBytes =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfPrefillCalcFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PrefillBytes kPrefillBytes() { return {}; }
+  void set_prefill_bytes(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PrefillBytes::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MdpCmdWaitPingpongFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MdpCmdWaitPingpongFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MdpCmdWaitPingpongFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MdpCmdWaitPingpongFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_ctl_num() const { return at<1>().valid(); }
+  uint32_t ctl_num() const { return at<1>().as_uint32(); }
+  bool has_kickoff_cnt() const { return at<2>().valid(); }
+  int32_t kickoff_cnt() const { return at<2>().as_int32(); }
+};
+
+class MdpCmdWaitPingpongFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MdpCmdWaitPingpongFtraceEvent_Decoder;
+  enum : int32_t {
+    kCtlNumFieldNumber = 1,
+    kKickoffCntFieldNumber = 2,
+  };
+
+  using FieldMetadata_CtlNum =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpCmdWaitPingpongFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CtlNum kCtlNum() { return {}; }
+  void set_ctl_num(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CtlNum::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_KickoffCnt =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MdpCmdWaitPingpongFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_KickoffCnt kKickoffCnt() { return {}; }
+  void set_kickoff_cnt(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_KickoffCnt::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MdpVideoUnderrunDoneFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MdpVideoUnderrunDoneFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MdpVideoUnderrunDoneFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MdpVideoUnderrunDoneFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_ctl_num() const { return at<1>().valid(); }
+  uint32_t ctl_num() const { return at<1>().as_uint32(); }
+  bool has_underrun_cnt() const { return at<2>().valid(); }
+  uint32_t underrun_cnt() const { return at<2>().as_uint32(); }
+};
+
+class MdpVideoUnderrunDoneFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MdpVideoUnderrunDoneFtraceEvent_Decoder;
+  enum : int32_t {
+    kCtlNumFieldNumber = 1,
+    kUnderrunCntFieldNumber = 2,
+  };
+
+  using FieldMetadata_CtlNum =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpVideoUnderrunDoneFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CtlNum kCtlNum() { return {}; }
+  void set_ctl_num(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CtlNum::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_UnderrunCnt =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpVideoUnderrunDoneFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UnderrunCnt kUnderrunCnt() { return {}; }
+  void set_underrun_cnt(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_UnderrunCnt::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MdpPerfSetWmLevelsFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MdpPerfSetWmLevelsFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MdpPerfSetWmLevelsFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MdpPerfSetWmLevelsFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_pnum() const { return at<1>().valid(); }
+  uint32_t pnum() const { return at<1>().as_uint32(); }
+  bool has_use_space() const { return at<2>().valid(); }
+  uint32_t use_space() const { return at<2>().as_uint32(); }
+  bool has_priority_bytes() const { return at<3>().valid(); }
+  uint32_t priority_bytes() const { return at<3>().as_uint32(); }
+  bool has_wm0() const { return at<4>().valid(); }
+  uint32_t wm0() const { return at<4>().as_uint32(); }
+  bool has_wm1() const { return at<5>().valid(); }
+  uint32_t wm1() const { return at<5>().as_uint32(); }
+  bool has_wm2() const { return at<6>().valid(); }
+  uint32_t wm2() const { return at<6>().as_uint32(); }
+  bool has_mb_cnt() const { return at<7>().valid(); }
+  uint32_t mb_cnt() const { return at<7>().as_uint32(); }
+  bool has_mb_size() const { return at<8>().valid(); }
+  uint32_t mb_size() const { return at<8>().as_uint32(); }
+};
+
+class MdpPerfSetWmLevelsFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MdpPerfSetWmLevelsFtraceEvent_Decoder;
+  enum : int32_t {
+    kPnumFieldNumber = 1,
+    kUseSpaceFieldNumber = 2,
+    kPriorityBytesFieldNumber = 3,
+    kWm0FieldNumber = 4,
+    kWm1FieldNumber = 5,
+    kWm2FieldNumber = 6,
+    kMbCntFieldNumber = 7,
+    kMbSizeFieldNumber = 8,
+  };
+
+  using FieldMetadata_Pnum =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfSetWmLevelsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pnum kPnum() { return {}; }
+  void set_pnum(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pnum::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_UseSpace =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfSetWmLevelsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UseSpace kUseSpace() { return {}; }
+  void set_use_space(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_UseSpace::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PriorityBytes =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfSetWmLevelsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PriorityBytes kPriorityBytes() { return {}; }
+  void set_priority_bytes(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PriorityBytes::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Wm0 =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfSetWmLevelsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Wm0 kWm0() { return {}; }
+  void set_wm0(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Wm0::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Wm1 =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfSetWmLevelsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Wm1 kWm1() { return {}; }
+  void set_wm1(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Wm1::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Wm2 =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfSetWmLevelsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Wm2 kWm2() { return {}; }
+  void set_wm2(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Wm2::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MbCnt =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfSetWmLevelsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MbCnt kMbCnt() { return {}; }
+  void set_mb_cnt(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MbCnt::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MbSize =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfSetWmLevelsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MbSize kMbSize() { return {}; }
+  void set_mb_size(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MbSize::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MdpMixerUpdateFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MdpMixerUpdateFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MdpMixerUpdateFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MdpMixerUpdateFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_mixer_num() const { return at<1>().valid(); }
+  uint32_t mixer_num() const { return at<1>().as_uint32(); }
+};
+
+class MdpMixerUpdateFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MdpMixerUpdateFtraceEvent_Decoder;
+  enum : int32_t {
+    kMixerNumFieldNumber = 1,
+  };
+
+  using FieldMetadata_MixerNum =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpMixerUpdateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MixerNum kMixerNum() { return {}; }
+  void set_mixer_num(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MixerNum::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MdpCmdReleaseBwFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MdpCmdReleaseBwFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MdpCmdReleaseBwFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MdpCmdReleaseBwFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_ctl_num() const { return at<1>().valid(); }
+  uint32_t ctl_num() const { return at<1>().as_uint32(); }
+};
+
+class MdpCmdReleaseBwFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MdpCmdReleaseBwFtraceEvent_Decoder;
+  enum : int32_t {
+    kCtlNumFieldNumber = 1,
+  };
+
+  using FieldMetadata_CtlNum =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpCmdReleaseBwFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CtlNum kCtlNum() { return {}; }
+  void set_ctl_num(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CtlNum::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MdpTraceCounterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MdpTraceCounterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MdpTraceCounterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MdpTraceCounterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_pid() const { return at<1>().valid(); }
+  int32_t pid() const { return at<1>().as_int32(); }
+  bool has_counter_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars counter_name() const { return at<2>().as_string(); }
+  bool has_value() const { return at<3>().valid(); }
+  int32_t value() const { return at<3>().as_int32(); }
+};
+
+class MdpTraceCounterFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MdpTraceCounterFtraceEvent_Decoder;
+  enum : int32_t {
+    kPidFieldNumber = 1,
+    kCounterNameFieldNumber = 2,
+    kValueFieldNumber = 3,
+  };
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MdpTraceCounterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CounterName =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      MdpTraceCounterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CounterName kCounterName() { return {}; }
+  void set_counter_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_CounterName::kFieldId, data, size);
+  }
+  void set_counter_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_CounterName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Value =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MdpTraceCounterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Value kValue() { return {}; }
+  void set_value(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Value::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MdpPerfSetQosLutsFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MdpPerfSetQosLutsFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MdpPerfSetQosLutsFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MdpPerfSetQosLutsFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_pnum() const { return at<1>().valid(); }
+  uint32_t pnum() const { return at<1>().as_uint32(); }
+  bool has_fmt() const { return at<2>().valid(); }
+  uint32_t fmt() const { return at<2>().as_uint32(); }
+  bool has_intf() const { return at<3>().valid(); }
+  uint32_t intf() const { return at<3>().as_uint32(); }
+  bool has_rot() const { return at<4>().valid(); }
+  uint32_t rot() const { return at<4>().as_uint32(); }
+  bool has_fl() const { return at<5>().valid(); }
+  uint32_t fl() const { return at<5>().as_uint32(); }
+  bool has_lut() const { return at<6>().valid(); }
+  uint32_t lut() const { return at<6>().as_uint32(); }
+  bool has_linear() const { return at<7>().valid(); }
+  uint32_t linear() const { return at<7>().as_uint32(); }
+};
+
+class MdpPerfSetQosLutsFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MdpPerfSetQosLutsFtraceEvent_Decoder;
+  enum : int32_t {
+    kPnumFieldNumber = 1,
+    kFmtFieldNumber = 2,
+    kIntfFieldNumber = 3,
+    kRotFieldNumber = 4,
+    kFlFieldNumber = 5,
+    kLutFieldNumber = 6,
+    kLinearFieldNumber = 7,
+  };
+
+  using FieldMetadata_Pnum =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfSetQosLutsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pnum kPnum() { return {}; }
+  void set_pnum(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pnum::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Fmt =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfSetQosLutsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Fmt kFmt() { return {}; }
+  void set_fmt(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Fmt::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Intf =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfSetQosLutsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Intf kIntf() { return {}; }
+  void set_intf(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Intf::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Rot =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfSetQosLutsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Rot kRot() { return {}; }
+  void set_rot(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Rot::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Fl =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfSetQosLutsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Fl kFl() { return {}; }
+  void set_fl(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Fl::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Lut =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfSetQosLutsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Lut kLut() { return {}; }
+  void set_lut(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Lut::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Linear =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfSetQosLutsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Linear kLinear() { return {}; }
+  void set_linear(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Linear::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MdpMisrCrcFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MdpMisrCrcFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MdpMisrCrcFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MdpMisrCrcFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_block_id() const { return at<1>().valid(); }
+  uint32_t block_id() const { return at<1>().as_uint32(); }
+  bool has_vsync_cnt() const { return at<2>().valid(); }
+  uint32_t vsync_cnt() const { return at<2>().as_uint32(); }
+  bool has_crc() const { return at<3>().valid(); }
+  uint32_t crc() const { return at<3>().as_uint32(); }
+};
+
+class MdpMisrCrcFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MdpMisrCrcFtraceEvent_Decoder;
+  enum : int32_t {
+    kBlockIdFieldNumber = 1,
+    kVsyncCntFieldNumber = 2,
+    kCrcFieldNumber = 3,
+  };
+
+  using FieldMetadata_BlockId =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpMisrCrcFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BlockId kBlockId() { return {}; }
+  void set_block_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BlockId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_VsyncCnt =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpMisrCrcFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_VsyncCnt kVsyncCnt() { return {}; }
+  void set_vsync_cnt(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_VsyncCnt::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Crc =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpMisrCrcFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Crc kCrc() { return {}; }
+  void set_crc(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Crc::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MdpCmdReadptrDoneFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MdpCmdReadptrDoneFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MdpCmdReadptrDoneFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MdpCmdReadptrDoneFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_ctl_num() const { return at<1>().valid(); }
+  uint32_t ctl_num() const { return at<1>().as_uint32(); }
+  bool has_koff_cnt() const { return at<2>().valid(); }
+  int32_t koff_cnt() const { return at<2>().as_int32(); }
+};
+
+class MdpCmdReadptrDoneFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MdpCmdReadptrDoneFtraceEvent_Decoder;
+  enum : int32_t {
+    kCtlNumFieldNumber = 1,
+    kKoffCntFieldNumber = 2,
+  };
+
+  using FieldMetadata_CtlNum =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpCmdReadptrDoneFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CtlNum kCtlNum() { return {}; }
+  void set_ctl_num(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CtlNum::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_KoffCnt =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MdpCmdReadptrDoneFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_KoffCnt kKoffCnt() { return {}; }
+  void set_koff_cnt(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_KoffCnt::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MdpSsppSetFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/16, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MdpSsppSetFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MdpSsppSetFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MdpSsppSetFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_num() const { return at<1>().valid(); }
+  uint32_t num() const { return at<1>().as_uint32(); }
+  bool has_play_cnt() const { return at<2>().valid(); }
+  uint32_t play_cnt() const { return at<2>().as_uint32(); }
+  bool has_mixer() const { return at<3>().valid(); }
+  uint32_t mixer() const { return at<3>().as_uint32(); }
+  bool has_stage() const { return at<4>().valid(); }
+  uint32_t stage() const { return at<4>().as_uint32(); }
+  bool has_flags() const { return at<5>().valid(); }
+  uint32_t flags() const { return at<5>().as_uint32(); }
+  bool has_format() const { return at<6>().valid(); }
+  uint32_t format() const { return at<6>().as_uint32(); }
+  bool has_img_w() const { return at<7>().valid(); }
+  uint32_t img_w() const { return at<7>().as_uint32(); }
+  bool has_img_h() const { return at<8>().valid(); }
+  uint32_t img_h() const { return at<8>().as_uint32(); }
+  bool has_src_x() const { return at<9>().valid(); }
+  uint32_t src_x() const { return at<9>().as_uint32(); }
+  bool has_src_y() const { return at<10>().valid(); }
+  uint32_t src_y() const { return at<10>().as_uint32(); }
+  bool has_src_w() const { return at<11>().valid(); }
+  uint32_t src_w() const { return at<11>().as_uint32(); }
+  bool has_src_h() const { return at<12>().valid(); }
+  uint32_t src_h() const { return at<12>().as_uint32(); }
+  bool has_dst_x() const { return at<13>().valid(); }
+  uint32_t dst_x() const { return at<13>().as_uint32(); }
+  bool has_dst_y() const { return at<14>().valid(); }
+  uint32_t dst_y() const { return at<14>().as_uint32(); }
+  bool has_dst_w() const { return at<15>().valid(); }
+  uint32_t dst_w() const { return at<15>().as_uint32(); }
+  bool has_dst_h() const { return at<16>().valid(); }
+  uint32_t dst_h() const { return at<16>().as_uint32(); }
+};
+
+class MdpSsppSetFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MdpSsppSetFtraceEvent_Decoder;
+  enum : int32_t {
+    kNumFieldNumber = 1,
+    kPlayCntFieldNumber = 2,
+    kMixerFieldNumber = 3,
+    kStageFieldNumber = 4,
+    kFlagsFieldNumber = 5,
+    kFormatFieldNumber = 6,
+    kImgWFieldNumber = 7,
+    kImgHFieldNumber = 8,
+    kSrcXFieldNumber = 9,
+    kSrcYFieldNumber = 10,
+    kSrcWFieldNumber = 11,
+    kSrcHFieldNumber = 12,
+    kDstXFieldNumber = 13,
+    kDstYFieldNumber = 14,
+    kDstWFieldNumber = 15,
+    kDstHFieldNumber = 16,
+  };
+
+  using FieldMetadata_Num =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppSetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Num kNum() { return {}; }
+  void set_num(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Num::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PlayCnt =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppSetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PlayCnt kPlayCnt() { return {}; }
+  void set_play_cnt(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PlayCnt::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Mixer =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppSetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mixer kMixer() { return {}; }
+  void set_mixer(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mixer::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Stage =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppSetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Stage kStage() { return {}; }
+  void set_stage(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Stage::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppSetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Format =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppSetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Format kFormat() { return {}; }
+  void set_format(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Format::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ImgW =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppSetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ImgW kImgW() { return {}; }
+  void set_img_w(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ImgW::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ImgH =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppSetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ImgH kImgH() { return {}; }
+  void set_img_h(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ImgH::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SrcX =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppSetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SrcX kSrcX() { return {}; }
+  void set_src_x(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SrcX::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SrcY =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppSetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SrcY kSrcY() { return {}; }
+  void set_src_y(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SrcY::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SrcW =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppSetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SrcW kSrcW() { return {}; }
+  void set_src_w(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SrcW::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SrcH =
+    ::protozero::proto_utils::FieldMetadata<
+      12,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppSetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SrcH kSrcH() { return {}; }
+  void set_src_h(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SrcH::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DstX =
+    ::protozero::proto_utils::FieldMetadata<
+      13,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppSetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DstX kDstX() { return {}; }
+  void set_dst_x(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DstX::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DstY =
+    ::protozero::proto_utils::FieldMetadata<
+      14,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppSetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DstY kDstY() { return {}; }
+  void set_dst_y(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DstY::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DstW =
+    ::protozero::proto_utils::FieldMetadata<
+      15,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppSetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DstW kDstW() { return {}; }
+  void set_dst_w(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DstW::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DstH =
+    ::protozero::proto_utils::FieldMetadata<
+      16,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppSetFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DstH kDstH() { return {}; }
+  void set_dst_h(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DstH::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MdpPerfSetPanicLutsFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MdpPerfSetPanicLutsFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MdpPerfSetPanicLutsFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MdpPerfSetPanicLutsFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_pnum() const { return at<1>().valid(); }
+  uint32_t pnum() const { return at<1>().as_uint32(); }
+  bool has_fmt() const { return at<2>().valid(); }
+  uint32_t fmt() const { return at<2>().as_uint32(); }
+  bool has_mode() const { return at<3>().valid(); }
+  uint32_t mode() const { return at<3>().as_uint32(); }
+  bool has_panic_lut() const { return at<4>().valid(); }
+  uint32_t panic_lut() const { return at<4>().as_uint32(); }
+  bool has_robust_lut() const { return at<5>().valid(); }
+  uint32_t robust_lut() const { return at<5>().as_uint32(); }
+};
+
+class MdpPerfSetPanicLutsFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MdpPerfSetPanicLutsFtraceEvent_Decoder;
+  enum : int32_t {
+    kPnumFieldNumber = 1,
+    kFmtFieldNumber = 2,
+    kModeFieldNumber = 3,
+    kPanicLutFieldNumber = 4,
+    kRobustLutFieldNumber = 5,
+  };
+
+  using FieldMetadata_Pnum =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfSetPanicLutsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pnum kPnum() { return {}; }
+  void set_pnum(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pnum::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Fmt =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfSetPanicLutsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Fmt kFmt() { return {}; }
+  void set_fmt(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Fmt::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Mode =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfSetPanicLutsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mode kMode() { return {}; }
+  void set_mode(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PanicLut =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfSetPanicLutsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PanicLut kPanicLut() { return {}; }
+  void set_panic_lut(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PanicLut::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_RobustLut =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfSetPanicLutsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RobustLut kRobustLut() { return {}; }
+  void set_robust_lut(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_RobustLut::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MdpCompareBwFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MdpCompareBwFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MdpCompareBwFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MdpCompareBwFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_new_ab() const { return at<1>().valid(); }
+  uint64_t new_ab() const { return at<1>().as_uint64(); }
+  bool has_new_ib() const { return at<2>().valid(); }
+  uint64_t new_ib() const { return at<2>().as_uint64(); }
+  bool has_new_wb() const { return at<3>().valid(); }
+  uint64_t new_wb() const { return at<3>().as_uint64(); }
+  bool has_old_ab() const { return at<4>().valid(); }
+  uint64_t old_ab() const { return at<4>().as_uint64(); }
+  bool has_old_ib() const { return at<5>().valid(); }
+  uint64_t old_ib() const { return at<5>().as_uint64(); }
+  bool has_old_wb() const { return at<6>().valid(); }
+  uint64_t old_wb() const { return at<6>().as_uint64(); }
+  bool has_params_changed() const { return at<7>().valid(); }
+  uint32_t params_changed() const { return at<7>().as_uint32(); }
+  bool has_update_bw() const { return at<8>().valid(); }
+  uint32_t update_bw() const { return at<8>().as_uint32(); }
+};
+
+class MdpCompareBwFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MdpCompareBwFtraceEvent_Decoder;
+  enum : int32_t {
+    kNewAbFieldNumber = 1,
+    kNewIbFieldNumber = 2,
+    kNewWbFieldNumber = 3,
+    kOldAbFieldNumber = 4,
+    kOldIbFieldNumber = 5,
+    kOldWbFieldNumber = 6,
+    kParamsChangedFieldNumber = 7,
+    kUpdateBwFieldNumber = 8,
+  };
+
+  using FieldMetadata_NewAb =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MdpCompareBwFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NewAb kNewAb() { return {}; }
+  void set_new_ab(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NewAb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NewIb =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MdpCompareBwFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NewIb kNewIb() { return {}; }
+  void set_new_ib(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NewIb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NewWb =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MdpCompareBwFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NewWb kNewWb() { return {}; }
+  void set_new_wb(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NewWb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OldAb =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MdpCompareBwFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OldAb kOldAb() { return {}; }
+  void set_old_ab(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OldAb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OldIb =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MdpCompareBwFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OldIb kOldIb() { return {}; }
+  void set_old_ib(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OldIb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OldWb =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MdpCompareBwFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OldWb kOldWb() { return {}; }
+  void set_old_wb(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OldWb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ParamsChanged =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpCompareBwFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ParamsChanged kParamsChanged() { return {}; }
+  void set_params_changed(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ParamsChanged::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_UpdateBw =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpCompareBwFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UpdateBw kUpdateBw() { return {}; }
+  void set_update_bw(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_UpdateBw::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MdpCmdPingpongDoneFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MdpCmdPingpongDoneFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MdpCmdPingpongDoneFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MdpCmdPingpongDoneFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_ctl_num() const { return at<1>().valid(); }
+  uint32_t ctl_num() const { return at<1>().as_uint32(); }
+  bool has_intf_num() const { return at<2>().valid(); }
+  uint32_t intf_num() const { return at<2>().as_uint32(); }
+  bool has_pp_num() const { return at<3>().valid(); }
+  uint32_t pp_num() const { return at<3>().as_uint32(); }
+  bool has_koff_cnt() const { return at<4>().valid(); }
+  int32_t koff_cnt() const { return at<4>().as_int32(); }
+};
+
+class MdpCmdPingpongDoneFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MdpCmdPingpongDoneFtraceEvent_Decoder;
+  enum : int32_t {
+    kCtlNumFieldNumber = 1,
+    kIntfNumFieldNumber = 2,
+    kPpNumFieldNumber = 3,
+    kKoffCntFieldNumber = 4,
+  };
+
+  using FieldMetadata_CtlNum =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpCmdPingpongDoneFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CtlNum kCtlNum() { return {}; }
+  void set_ctl_num(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CtlNum::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IntfNum =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpCmdPingpongDoneFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IntfNum kIntfNum() { return {}; }
+  void set_intf_num(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IntfNum::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PpNum =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpCmdPingpongDoneFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PpNum kPpNum() { return {}; }
+  void set_pp_num(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PpNum::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_KoffCnt =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MdpCmdPingpongDoneFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_KoffCnt kKoffCnt() { return {}; }
+  void set_koff_cnt(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_KoffCnt::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TracingMarkWriteFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TracingMarkWriteFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TracingMarkWriteFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TracingMarkWriteFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_pid() const { return at<1>().valid(); }
+  int32_t pid() const { return at<1>().as_int32(); }
+  bool has_trace_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars trace_name() const { return at<2>().as_string(); }
+  bool has_trace_begin() const { return at<3>().valid(); }
+  uint32_t trace_begin() const { return at<3>().as_uint32(); }
+};
+
+class TracingMarkWriteFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = TracingMarkWriteFtraceEvent_Decoder;
+  enum : int32_t {
+    kPidFieldNumber = 1,
+    kTraceNameFieldNumber = 2,
+    kTraceBeginFieldNumber = 3,
+  };
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      TracingMarkWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TraceName =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TracingMarkWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TraceName kTraceName() { return {}; }
+  void set_trace_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_TraceName::kFieldId, data, size);
+  }
+  void set_trace_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_TraceName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TraceBegin =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TracingMarkWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TraceBegin kTraceBegin() { return {}; }
+  void set_trace_begin(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TraceBegin::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MdpSsppChangeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/16, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MdpSsppChangeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MdpSsppChangeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MdpSsppChangeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_num() const { return at<1>().valid(); }
+  uint32_t num() const { return at<1>().as_uint32(); }
+  bool has_play_cnt() const { return at<2>().valid(); }
+  uint32_t play_cnt() const { return at<2>().as_uint32(); }
+  bool has_mixer() const { return at<3>().valid(); }
+  uint32_t mixer() const { return at<3>().as_uint32(); }
+  bool has_stage() const { return at<4>().valid(); }
+  uint32_t stage() const { return at<4>().as_uint32(); }
+  bool has_flags() const { return at<5>().valid(); }
+  uint32_t flags() const { return at<5>().as_uint32(); }
+  bool has_format() const { return at<6>().valid(); }
+  uint32_t format() const { return at<6>().as_uint32(); }
+  bool has_img_w() const { return at<7>().valid(); }
+  uint32_t img_w() const { return at<7>().as_uint32(); }
+  bool has_img_h() const { return at<8>().valid(); }
+  uint32_t img_h() const { return at<8>().as_uint32(); }
+  bool has_src_x() const { return at<9>().valid(); }
+  uint32_t src_x() const { return at<9>().as_uint32(); }
+  bool has_src_y() const { return at<10>().valid(); }
+  uint32_t src_y() const { return at<10>().as_uint32(); }
+  bool has_src_w() const { return at<11>().valid(); }
+  uint32_t src_w() const { return at<11>().as_uint32(); }
+  bool has_src_h() const { return at<12>().valid(); }
+  uint32_t src_h() const { return at<12>().as_uint32(); }
+  bool has_dst_x() const { return at<13>().valid(); }
+  uint32_t dst_x() const { return at<13>().as_uint32(); }
+  bool has_dst_y() const { return at<14>().valid(); }
+  uint32_t dst_y() const { return at<14>().as_uint32(); }
+  bool has_dst_w() const { return at<15>().valid(); }
+  uint32_t dst_w() const { return at<15>().as_uint32(); }
+  bool has_dst_h() const { return at<16>().valid(); }
+  uint32_t dst_h() const { return at<16>().as_uint32(); }
+};
+
+class MdpSsppChangeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MdpSsppChangeFtraceEvent_Decoder;
+  enum : int32_t {
+    kNumFieldNumber = 1,
+    kPlayCntFieldNumber = 2,
+    kMixerFieldNumber = 3,
+    kStageFieldNumber = 4,
+    kFlagsFieldNumber = 5,
+    kFormatFieldNumber = 6,
+    kImgWFieldNumber = 7,
+    kImgHFieldNumber = 8,
+    kSrcXFieldNumber = 9,
+    kSrcYFieldNumber = 10,
+    kSrcWFieldNumber = 11,
+    kSrcHFieldNumber = 12,
+    kDstXFieldNumber = 13,
+    kDstYFieldNumber = 14,
+    kDstWFieldNumber = 15,
+    kDstHFieldNumber = 16,
+  };
+
+  using FieldMetadata_Num =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppChangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Num kNum() { return {}; }
+  void set_num(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Num::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PlayCnt =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppChangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PlayCnt kPlayCnt() { return {}; }
+  void set_play_cnt(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PlayCnt::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Mixer =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppChangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mixer kMixer() { return {}; }
+  void set_mixer(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Mixer::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Stage =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppChangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Stage kStage() { return {}; }
+  void set_stage(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Stage::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Flags =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppChangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flags kFlags() { return {}; }
+  void set_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Format =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppChangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Format kFormat() { return {}; }
+  void set_format(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Format::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ImgW =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppChangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ImgW kImgW() { return {}; }
+  void set_img_w(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ImgW::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ImgH =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppChangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ImgH kImgH() { return {}; }
+  void set_img_h(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ImgH::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SrcX =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppChangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SrcX kSrcX() { return {}; }
+  void set_src_x(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SrcX::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SrcY =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppChangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SrcY kSrcY() { return {}; }
+  void set_src_y(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SrcY::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SrcW =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppChangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SrcW kSrcW() { return {}; }
+  void set_src_w(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SrcW::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SrcH =
+    ::protozero::proto_utils::FieldMetadata<
+      12,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppChangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SrcH kSrcH() { return {}; }
+  void set_src_h(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SrcH::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DstX =
+    ::protozero::proto_utils::FieldMetadata<
+      13,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppChangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DstX kDstX() { return {}; }
+  void set_dst_x(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DstX::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DstY =
+    ::protozero::proto_utils::FieldMetadata<
+      14,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppChangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DstY kDstY() { return {}; }
+  void set_dst_y(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DstY::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DstW =
+    ::protozero::proto_utils::FieldMetadata<
+      15,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppChangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DstW kDstW() { return {}; }
+  void set_dst_w(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DstW::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DstH =
+    ::protozero::proto_utils::FieldMetadata<
+      16,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpSsppChangeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DstH kDstH() { return {}; }
+  void set_dst_h(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DstH::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MdpPerfSetOtFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MdpPerfSetOtFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MdpPerfSetOtFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MdpPerfSetOtFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_pnum() const { return at<1>().valid(); }
+  uint32_t pnum() const { return at<1>().as_uint32(); }
+  bool has_xin_id() const { return at<2>().valid(); }
+  uint32_t xin_id() const { return at<2>().as_uint32(); }
+  bool has_rd_lim() const { return at<3>().valid(); }
+  uint32_t rd_lim() const { return at<3>().as_uint32(); }
+  bool has_is_vbif_rt() const { return at<4>().valid(); }
+  uint32_t is_vbif_rt() const { return at<4>().as_uint32(); }
+};
+
+class MdpPerfSetOtFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MdpPerfSetOtFtraceEvent_Decoder;
+  enum : int32_t {
+    kPnumFieldNumber = 1,
+    kXinIdFieldNumber = 2,
+    kRdLimFieldNumber = 3,
+    kIsVbifRtFieldNumber = 4,
+  };
+
+  using FieldMetadata_Pnum =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfSetOtFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pnum kPnum() { return {}; }
+  void set_pnum(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pnum::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_XinId =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfSetOtFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_XinId kXinId() { return {}; }
+  void set_xin_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_XinId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_RdLim =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfSetOtFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RdLim kRdLim() { return {}; }
+  void set_rd_lim(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_RdLim::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IsVbifRt =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpPerfSetOtFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IsVbifRt kIsVbifRt() { return {}; }
+  void set_is_vbif_rt(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IsVbifRt::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MdpCommitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MdpCommitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MdpCommitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MdpCommitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_num() const { return at<1>().valid(); }
+  uint32_t num() const { return at<1>().as_uint32(); }
+  bool has_play_cnt() const { return at<2>().valid(); }
+  uint32_t play_cnt() const { return at<2>().as_uint32(); }
+  bool has_clk_rate() const { return at<3>().valid(); }
+  uint32_t clk_rate() const { return at<3>().as_uint32(); }
+  bool has_bandwidth() const { return at<4>().valid(); }
+  uint64_t bandwidth() const { return at<4>().as_uint64(); }
+};
+
+class MdpCommitFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MdpCommitFtraceEvent_Decoder;
+  enum : int32_t {
+    kNumFieldNumber = 1,
+    kPlayCntFieldNumber = 2,
+    kClkRateFieldNumber = 3,
+    kBandwidthFieldNumber = 4,
+  };
+
+  using FieldMetadata_Num =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpCommitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Num kNum() { return {}; }
+  void set_num(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Num::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PlayCnt =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpCommitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PlayCnt kPlayCnt() { return {}; }
+  void set_play_cnt(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PlayCnt::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ClkRate =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpCommitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ClkRate kClkRate() { return {}; }
+  void set_clk_rate(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ClkRate::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Bandwidth =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MdpCommitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Bandwidth kBandwidth() { return {}; }
+  void set_bandwidth(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Bandwidth::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MdpCmdKickoffFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MdpCmdKickoffFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MdpCmdKickoffFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MdpCmdKickoffFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_ctl_num() const { return at<1>().valid(); }
+  uint32_t ctl_num() const { return at<1>().as_uint32(); }
+  bool has_kickoff_cnt() const { return at<2>().valid(); }
+  int32_t kickoff_cnt() const { return at<2>().as_int32(); }
+};
+
+class MdpCmdKickoffFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MdpCmdKickoffFtraceEvent_Decoder;
+  enum : int32_t {
+    kCtlNumFieldNumber = 1,
+    kKickoffCntFieldNumber = 2,
+  };
+
+  using FieldMetadata_CtlNum =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MdpCmdKickoffFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CtlNum kCtlNum() { return {}; }
+  void set_ctl_num(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CtlNum::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_KickoffCnt =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MdpCmdKickoffFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_KickoffCnt kKickoffCnt() { return {}; }
+  void set_kickoff_cnt(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_KickoffCnt::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/mm_event.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_MM_EVENT_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_MM_EVENT_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class MmEventRecordFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MmEventRecordFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MmEventRecordFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MmEventRecordFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_avg_lat() const { return at<1>().valid(); }
+  uint32_t avg_lat() const { return at<1>().as_uint32(); }
+  bool has_count() const { return at<2>().valid(); }
+  uint32_t count() const { return at<2>().as_uint32(); }
+  bool has_max_lat() const { return at<3>().valid(); }
+  uint32_t max_lat() const { return at<3>().as_uint32(); }
+  bool has_type() const { return at<4>().valid(); }
+  uint32_t type() const { return at<4>().as_uint32(); }
+};
+
+class MmEventRecordFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MmEventRecordFtraceEvent_Decoder;
+  enum : int32_t {
+    kAvgLatFieldNumber = 1,
+    kCountFieldNumber = 2,
+    kMaxLatFieldNumber = 3,
+    kTypeFieldNumber = 4,
+  };
+
+  using FieldMetadata_AvgLat =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MmEventRecordFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AvgLat kAvgLat() { return {}; }
+  void set_avg_lat(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_AvgLat::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Count =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MmEventRecordFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Count kCount() { return {}; }
+  void set_count(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Count::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MaxLat =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MmEventRecordFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MaxLat kMaxLat() { return {}; }
+  void set_max_lat(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MaxLat::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Type =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MmEventRecordFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Type kType() { return {}; }
+  void set_type(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Type::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/oom.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_OOM_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_OOM_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class MarkVictimFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MarkVictimFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MarkVictimFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MarkVictimFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_pid() const { return at<1>().valid(); }
+  int32_t pid() const { return at<1>().as_int32(); }
+};
+
+class MarkVictimFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MarkVictimFtraceEvent_Decoder;
+  enum : int32_t {
+    kPidFieldNumber = 1,
+  };
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MarkVictimFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class OomScoreAdjUpdateFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  OomScoreAdjUpdateFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit OomScoreAdjUpdateFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit OomScoreAdjUpdateFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_comm() const { return at<1>().valid(); }
+  ::protozero::ConstChars comm() const { return at<1>().as_string(); }
+  bool has_oom_score_adj() const { return at<2>().valid(); }
+  int32_t oom_score_adj() const { return at<2>().as_int32(); }
+  bool has_pid() const { return at<3>().valid(); }
+  int32_t pid() const { return at<3>().as_int32(); }
+};
+
+class OomScoreAdjUpdateFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = OomScoreAdjUpdateFtraceEvent_Decoder;
+  enum : int32_t {
+    kCommFieldNumber = 1,
+    kOomScoreAdjFieldNumber = 2,
+    kPidFieldNumber = 3,
+  };
+
+  using FieldMetadata_Comm =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      OomScoreAdjUpdateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Comm kComm() { return {}; }
+  void set_comm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Comm::kFieldId, data, size);
+  }
+  void set_comm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Comm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OomScoreAdj =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      OomScoreAdjUpdateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OomScoreAdj kOomScoreAdj() { return {}; }
+  void set_oom_score_adj(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OomScoreAdj::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      OomScoreAdjUpdateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/power.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_POWER_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_POWER_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class GpuFrequencyFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  GpuFrequencyFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit GpuFrequencyFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit GpuFrequencyFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_gpu_id() const { return at<1>().valid(); }
+  uint32_t gpu_id() const { return at<1>().as_uint32(); }
+  bool has_state() const { return at<2>().valid(); }
+  uint32_t state() const { return at<2>().as_uint32(); }
+};
+
+class GpuFrequencyFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = GpuFrequencyFtraceEvent_Decoder;
+  enum : int32_t {
+    kGpuIdFieldNumber = 1,
+    kStateFieldNumber = 2,
+  };
+
+  using FieldMetadata_GpuId =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      GpuFrequencyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GpuId kGpuId() { return {}; }
+  void set_gpu_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_GpuId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_State =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      GpuFrequencyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_State kState() { return {}; }
+  void set_state(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_State::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SuspendResumeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SuspendResumeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SuspendResumeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SuspendResumeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_action() const { return at<1>().valid(); }
+  ::protozero::ConstChars action() const { return at<1>().as_string(); }
+  bool has_val() const { return at<2>().valid(); }
+  int32_t val() const { return at<2>().as_int32(); }
+  bool has_start() const { return at<3>().valid(); }
+  uint32_t start() const { return at<3>().as_uint32(); }
+};
+
+class SuspendResumeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SuspendResumeFtraceEvent_Decoder;
+  enum : int32_t {
+    kActionFieldNumber = 1,
+    kValFieldNumber = 2,
+    kStartFieldNumber = 3,
+  };
+
+  using FieldMetadata_Action =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SuspendResumeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Action kAction() { return {}; }
+  void set_action(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Action::kFieldId, data, size);
+  }
+  void set_action(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Action::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Val =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SuspendResumeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Val kVal() { return {}; }
+  void set_val(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Val::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Start =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SuspendResumeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Start kStart() { return {}; }
+  void set_start(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Start::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class ClockSetRateFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ClockSetRateFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ClockSetRateFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ClockSetRateFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_state() const { return at<2>().valid(); }
+  uint64_t state() const { return at<2>().as_uint64(); }
+  bool has_cpu_id() const { return at<3>().valid(); }
+  uint64_t cpu_id() const { return at<3>().as_uint64(); }
+};
+
+class ClockSetRateFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = ClockSetRateFtraceEvent_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kStateFieldNumber = 2,
+    kCpuIdFieldNumber = 3,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ClockSetRateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_State =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ClockSetRateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_State kState() { return {}; }
+  void set_state(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_State::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CpuId =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ClockSetRateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CpuId kCpuId() { return {}; }
+  void set_cpu_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CpuId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class ClockDisableFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ClockDisableFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ClockDisableFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ClockDisableFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_state() const { return at<2>().valid(); }
+  uint64_t state() const { return at<2>().as_uint64(); }
+  bool has_cpu_id() const { return at<3>().valid(); }
+  uint64_t cpu_id() const { return at<3>().as_uint64(); }
+};
+
+class ClockDisableFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = ClockDisableFtraceEvent_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kStateFieldNumber = 2,
+    kCpuIdFieldNumber = 3,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ClockDisableFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_State =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ClockDisableFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_State kState() { return {}; }
+  void set_state(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_State::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CpuId =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ClockDisableFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CpuId kCpuId() { return {}; }
+  void set_cpu_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CpuId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class ClockEnableFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ClockEnableFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ClockEnableFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ClockEnableFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_state() const { return at<2>().valid(); }
+  uint64_t state() const { return at<2>().as_uint64(); }
+  bool has_cpu_id() const { return at<3>().valid(); }
+  uint64_t cpu_id() const { return at<3>().as_uint64(); }
+};
+
+class ClockEnableFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = ClockEnableFtraceEvent_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kStateFieldNumber = 2,
+    kCpuIdFieldNumber = 3,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ClockEnableFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_State =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ClockEnableFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_State kState() { return {}; }
+  void set_state(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_State::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CpuId =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ClockEnableFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CpuId kCpuId() { return {}; }
+  void set_cpu_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CpuId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class CpuIdleFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  CpuIdleFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit CpuIdleFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit CpuIdleFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_state() const { return at<1>().valid(); }
+  uint32_t state() const { return at<1>().as_uint32(); }
+  bool has_cpu_id() const { return at<2>().valid(); }
+  uint32_t cpu_id() const { return at<2>().as_uint32(); }
+};
+
+class CpuIdleFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = CpuIdleFtraceEvent_Decoder;
+  enum : int32_t {
+    kStateFieldNumber = 1,
+    kCpuIdFieldNumber = 2,
+  };
+
+  using FieldMetadata_State =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      CpuIdleFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_State kState() { return {}; }
+  void set_state(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_State::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CpuId =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      CpuIdleFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CpuId kCpuId() { return {}; }
+  void set_cpu_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CpuId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class CpuFrequencyLimitsFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  CpuFrequencyLimitsFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit CpuFrequencyLimitsFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit CpuFrequencyLimitsFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_min_freq() const { return at<1>().valid(); }
+  uint32_t min_freq() const { return at<1>().as_uint32(); }
+  bool has_max_freq() const { return at<2>().valid(); }
+  uint32_t max_freq() const { return at<2>().as_uint32(); }
+  bool has_cpu_id() const { return at<3>().valid(); }
+  uint32_t cpu_id() const { return at<3>().as_uint32(); }
+};
+
+class CpuFrequencyLimitsFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = CpuFrequencyLimitsFtraceEvent_Decoder;
+  enum : int32_t {
+    kMinFreqFieldNumber = 1,
+    kMaxFreqFieldNumber = 2,
+    kCpuIdFieldNumber = 3,
+  };
+
+  using FieldMetadata_MinFreq =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      CpuFrequencyLimitsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MinFreq kMinFreq() { return {}; }
+  void set_min_freq(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MinFreq::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MaxFreq =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      CpuFrequencyLimitsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MaxFreq kMaxFreq() { return {}; }
+  void set_max_freq(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MaxFreq::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CpuId =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      CpuFrequencyLimitsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CpuId kCpuId() { return {}; }
+  void set_cpu_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CpuId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class CpuFrequencyFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  CpuFrequencyFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit CpuFrequencyFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit CpuFrequencyFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_state() const { return at<1>().valid(); }
+  uint32_t state() const { return at<1>().as_uint32(); }
+  bool has_cpu_id() const { return at<2>().valid(); }
+  uint32_t cpu_id() const { return at<2>().as_uint32(); }
+};
+
+class CpuFrequencyFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = CpuFrequencyFtraceEvent_Decoder;
+  enum : int32_t {
+    kStateFieldNumber = 1,
+    kCpuIdFieldNumber = 2,
+  };
+
+  using FieldMetadata_State =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      CpuFrequencyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_State kState() { return {}; }
+  void set_state(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_State::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CpuId =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      CpuFrequencyFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CpuId kCpuId() { return {}; }
+  void set_cpu_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CpuId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/raw_syscalls.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_RAW_SYSCALLS_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_RAW_SYSCALLS_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class SysExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SysExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SysExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SysExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_id() const { return at<1>().valid(); }
+  int64_t id() const { return at<1>().as_int64(); }
+  bool has_ret() const { return at<2>().valid(); }
+  int64_t ret() const { return at<2>().as_int64(); }
+};
+
+class SysExitFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SysExitFtraceEvent_Decoder;
+  enum : int32_t {
+    kIdFieldNumber = 1,
+    kRetFieldNumber = 2,
+  };
+
+  using FieldMetadata_Id =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      SysExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Id kId() { return {}; }
+  void set_id(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Id::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ret =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      SysExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ret kRet() { return {}; }
+  void set_ret(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ret::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SysEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SysEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SysEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SysEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_id() const { return at<1>().valid(); }
+  int64_t id() const { return at<1>().as_int64(); }
+};
+
+class SysEnterFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SysEnterFtraceEvent_Decoder;
+  enum : int32_t {
+    kIdFieldNumber = 1,
+  };
+
+  using FieldMetadata_Id =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      SysEnterFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Id kId() { return {}; }
+  void set_id(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Id::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/regulator.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_REGULATOR_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_REGULATOR_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class RegulatorSetVoltageCompleteFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  RegulatorSetVoltageCompleteFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit RegulatorSetVoltageCompleteFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit RegulatorSetVoltageCompleteFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_val() const { return at<2>().valid(); }
+  uint32_t val() const { return at<2>().as_uint32(); }
+};
+
+class RegulatorSetVoltageCompleteFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = RegulatorSetVoltageCompleteFtraceEvent_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kValFieldNumber = 2,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      RegulatorSetVoltageCompleteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Val =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      RegulatorSetVoltageCompleteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Val kVal() { return {}; }
+  void set_val(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Val::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class RegulatorSetVoltageFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  RegulatorSetVoltageFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit RegulatorSetVoltageFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit RegulatorSetVoltageFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_min() const { return at<2>().valid(); }
+  int32_t min() const { return at<2>().as_int32(); }
+  bool has_max() const { return at<3>().valid(); }
+  int32_t max() const { return at<3>().as_int32(); }
+};
+
+class RegulatorSetVoltageFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = RegulatorSetVoltageFtraceEvent_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kMinFieldNumber = 2,
+    kMaxFieldNumber = 3,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      RegulatorSetVoltageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Min =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      RegulatorSetVoltageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Min kMin() { return {}; }
+  void set_min(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Min::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Max =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      RegulatorSetVoltageFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Max kMax() { return {}; }
+  void set_max(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Max::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class RegulatorEnableDelayFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  RegulatorEnableDelayFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit RegulatorEnableDelayFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit RegulatorEnableDelayFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+};
+
+class RegulatorEnableDelayFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = RegulatorEnableDelayFtraceEvent_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      RegulatorEnableDelayFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class RegulatorEnableCompleteFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  RegulatorEnableCompleteFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit RegulatorEnableCompleteFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit RegulatorEnableCompleteFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+};
+
+class RegulatorEnableCompleteFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = RegulatorEnableCompleteFtraceEvent_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      RegulatorEnableCompleteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class RegulatorEnableFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  RegulatorEnableFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit RegulatorEnableFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit RegulatorEnableFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+};
+
+class RegulatorEnableFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = RegulatorEnableFtraceEvent_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      RegulatorEnableFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class RegulatorDisableCompleteFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  RegulatorDisableCompleteFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit RegulatorDisableCompleteFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit RegulatorDisableCompleteFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+};
+
+class RegulatorDisableCompleteFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = RegulatorDisableCompleteFtraceEvent_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      RegulatorDisableCompleteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class RegulatorDisableFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  RegulatorDisableFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit RegulatorDisableFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit RegulatorDisableFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+};
+
+class RegulatorDisableFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = RegulatorDisableFtraceEvent_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      RegulatorDisableFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/sched.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_SCHED_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_SCHED_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class SchedPiSetprioFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SchedPiSetprioFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SchedPiSetprioFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SchedPiSetprioFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_comm() const { return at<1>().valid(); }
+  ::protozero::ConstChars comm() const { return at<1>().as_string(); }
+  bool has_newprio() const { return at<2>().valid(); }
+  int32_t newprio() const { return at<2>().as_int32(); }
+  bool has_oldprio() const { return at<3>().valid(); }
+  int32_t oldprio() const { return at<3>().as_int32(); }
+  bool has_pid() const { return at<4>().valid(); }
+  int32_t pid() const { return at<4>().as_int32(); }
+};
+
+class SchedPiSetprioFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SchedPiSetprioFtraceEvent_Decoder;
+  enum : int32_t {
+    kCommFieldNumber = 1,
+    kNewprioFieldNumber = 2,
+    kOldprioFieldNumber = 3,
+    kPidFieldNumber = 4,
+  };
+
+  using FieldMetadata_Comm =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SchedPiSetprioFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Comm kComm() { return {}; }
+  void set_comm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Comm::kFieldId, data, size);
+  }
+  void set_comm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Comm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Newprio =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedPiSetprioFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Newprio kNewprio() { return {}; }
+  void set_newprio(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Newprio::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Oldprio =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedPiSetprioFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Oldprio kOldprio() { return {}; }
+  void set_oldprio(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Oldprio::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedPiSetprioFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SchedProcessWaitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SchedProcessWaitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SchedProcessWaitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SchedProcessWaitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_comm() const { return at<1>().valid(); }
+  ::protozero::ConstChars comm() const { return at<1>().as_string(); }
+  bool has_pid() const { return at<2>().valid(); }
+  int32_t pid() const { return at<2>().as_int32(); }
+  bool has_prio() const { return at<3>().valid(); }
+  int32_t prio() const { return at<3>().as_int32(); }
+};
+
+class SchedProcessWaitFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SchedProcessWaitFtraceEvent_Decoder;
+  enum : int32_t {
+    kCommFieldNumber = 1,
+    kPidFieldNumber = 2,
+    kPrioFieldNumber = 3,
+  };
+
+  using FieldMetadata_Comm =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SchedProcessWaitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Comm kComm() { return {}; }
+  void set_comm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Comm::kFieldId, data, size);
+  }
+  void set_comm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Comm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedProcessWaitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Prio =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedProcessWaitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Prio kPrio() { return {}; }
+  void set_prio(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Prio::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SchedProcessHangFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SchedProcessHangFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SchedProcessHangFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SchedProcessHangFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_comm() const { return at<1>().valid(); }
+  ::protozero::ConstChars comm() const { return at<1>().as_string(); }
+  bool has_pid() const { return at<2>().valid(); }
+  int32_t pid() const { return at<2>().as_int32(); }
+};
+
+class SchedProcessHangFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SchedProcessHangFtraceEvent_Decoder;
+  enum : int32_t {
+    kCommFieldNumber = 1,
+    kPidFieldNumber = 2,
+  };
+
+  using FieldMetadata_Comm =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SchedProcessHangFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Comm kComm() { return {}; }
+  void set_comm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Comm::kFieldId, data, size);
+  }
+  void set_comm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Comm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedProcessHangFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SchedProcessFreeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SchedProcessFreeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SchedProcessFreeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SchedProcessFreeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_comm() const { return at<1>().valid(); }
+  ::protozero::ConstChars comm() const { return at<1>().as_string(); }
+  bool has_pid() const { return at<2>().valid(); }
+  int32_t pid() const { return at<2>().as_int32(); }
+  bool has_prio() const { return at<3>().valid(); }
+  int32_t prio() const { return at<3>().as_int32(); }
+};
+
+class SchedProcessFreeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SchedProcessFreeFtraceEvent_Decoder;
+  enum : int32_t {
+    kCommFieldNumber = 1,
+    kPidFieldNumber = 2,
+    kPrioFieldNumber = 3,
+  };
+
+  using FieldMetadata_Comm =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SchedProcessFreeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Comm kComm() { return {}; }
+  void set_comm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Comm::kFieldId, data, size);
+  }
+  void set_comm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Comm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedProcessFreeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Prio =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedProcessFreeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Prio kPrio() { return {}; }
+  void set_prio(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Prio::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SchedProcessForkFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SchedProcessForkFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SchedProcessForkFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SchedProcessForkFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_parent_comm() const { return at<1>().valid(); }
+  ::protozero::ConstChars parent_comm() const { return at<1>().as_string(); }
+  bool has_parent_pid() const { return at<2>().valid(); }
+  int32_t parent_pid() const { return at<2>().as_int32(); }
+  bool has_child_comm() const { return at<3>().valid(); }
+  ::protozero::ConstChars child_comm() const { return at<3>().as_string(); }
+  bool has_child_pid() const { return at<4>().valid(); }
+  int32_t child_pid() const { return at<4>().as_int32(); }
+};
+
+class SchedProcessForkFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SchedProcessForkFtraceEvent_Decoder;
+  enum : int32_t {
+    kParentCommFieldNumber = 1,
+    kParentPidFieldNumber = 2,
+    kChildCommFieldNumber = 3,
+    kChildPidFieldNumber = 4,
+  };
+
+  using FieldMetadata_ParentComm =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SchedProcessForkFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ParentComm kParentComm() { return {}; }
+  void set_parent_comm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ParentComm::kFieldId, data, size);
+  }
+  void set_parent_comm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ParentComm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ParentPid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedProcessForkFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ParentPid kParentPid() { return {}; }
+  void set_parent_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ParentPid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ChildComm =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SchedProcessForkFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChildComm kChildComm() { return {}; }
+  void set_child_comm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ChildComm::kFieldId, data, size);
+  }
+  void set_child_comm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ChildComm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ChildPid =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedProcessForkFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChildPid kChildPid() { return {}; }
+  void set_child_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ChildPid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SchedProcessExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SchedProcessExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SchedProcessExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SchedProcessExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_comm() const { return at<1>().valid(); }
+  ::protozero::ConstChars comm() const { return at<1>().as_string(); }
+  bool has_pid() const { return at<2>().valid(); }
+  int32_t pid() const { return at<2>().as_int32(); }
+  bool has_tgid() const { return at<3>().valid(); }
+  int32_t tgid() const { return at<3>().as_int32(); }
+  bool has_prio() const { return at<4>().valid(); }
+  int32_t prio() const { return at<4>().as_int32(); }
+};
+
+class SchedProcessExitFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SchedProcessExitFtraceEvent_Decoder;
+  enum : int32_t {
+    kCommFieldNumber = 1,
+    kPidFieldNumber = 2,
+    kTgidFieldNumber = 3,
+    kPrioFieldNumber = 4,
+  };
+
+  using FieldMetadata_Comm =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SchedProcessExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Comm kComm() { return {}; }
+  void set_comm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Comm::kFieldId, data, size);
+  }
+  void set_comm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Comm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedProcessExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Tgid =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedProcessExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Tgid kTgid() { return {}; }
+  void set_tgid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Tgid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Prio =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedProcessExitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Prio kPrio() { return {}; }
+  void set_prio(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Prio::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SchedProcessExecFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SchedProcessExecFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SchedProcessExecFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SchedProcessExecFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_filename() const { return at<1>().valid(); }
+  ::protozero::ConstChars filename() const { return at<1>().as_string(); }
+  bool has_pid() const { return at<2>().valid(); }
+  int32_t pid() const { return at<2>().as_int32(); }
+  bool has_old_pid() const { return at<3>().valid(); }
+  int32_t old_pid() const { return at<3>().as_int32(); }
+};
+
+class SchedProcessExecFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SchedProcessExecFtraceEvent_Decoder;
+  enum : int32_t {
+    kFilenameFieldNumber = 1,
+    kPidFieldNumber = 2,
+    kOldPidFieldNumber = 3,
+  };
+
+  using FieldMetadata_Filename =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SchedProcessExecFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Filename kFilename() { return {}; }
+  void set_filename(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Filename::kFieldId, data, size);
+  }
+  void set_filename(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Filename::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedProcessExecFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OldPid =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedProcessExecFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OldPid kOldPid() { return {}; }
+  void set_old_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OldPid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SchedWakeupNewFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SchedWakeupNewFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SchedWakeupNewFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SchedWakeupNewFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_comm() const { return at<1>().valid(); }
+  ::protozero::ConstChars comm() const { return at<1>().as_string(); }
+  bool has_pid() const { return at<2>().valid(); }
+  int32_t pid() const { return at<2>().as_int32(); }
+  bool has_prio() const { return at<3>().valid(); }
+  int32_t prio() const { return at<3>().as_int32(); }
+  bool has_success() const { return at<4>().valid(); }
+  int32_t success() const { return at<4>().as_int32(); }
+  bool has_target_cpu() const { return at<5>().valid(); }
+  int32_t target_cpu() const { return at<5>().as_int32(); }
+};
+
+class SchedWakeupNewFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SchedWakeupNewFtraceEvent_Decoder;
+  enum : int32_t {
+    kCommFieldNumber = 1,
+    kPidFieldNumber = 2,
+    kPrioFieldNumber = 3,
+    kSuccessFieldNumber = 4,
+    kTargetCpuFieldNumber = 5,
+  };
+
+  using FieldMetadata_Comm =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SchedWakeupNewFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Comm kComm() { return {}; }
+  void set_comm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Comm::kFieldId, data, size);
+  }
+  void set_comm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Comm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedWakeupNewFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Prio =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedWakeupNewFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Prio kPrio() { return {}; }
+  void set_prio(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Prio::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Success =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedWakeupNewFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Success kSuccess() { return {}; }
+  void set_success(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Success::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TargetCpu =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedWakeupNewFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TargetCpu kTargetCpu() { return {}; }
+  void set_target_cpu(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TargetCpu::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SchedWakingFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SchedWakingFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SchedWakingFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SchedWakingFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_comm() const { return at<1>().valid(); }
+  ::protozero::ConstChars comm() const { return at<1>().as_string(); }
+  bool has_pid() const { return at<2>().valid(); }
+  int32_t pid() const { return at<2>().as_int32(); }
+  bool has_prio() const { return at<3>().valid(); }
+  int32_t prio() const { return at<3>().as_int32(); }
+  bool has_success() const { return at<4>().valid(); }
+  int32_t success() const { return at<4>().as_int32(); }
+  bool has_target_cpu() const { return at<5>().valid(); }
+  int32_t target_cpu() const { return at<5>().as_int32(); }
+};
+
+class SchedWakingFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SchedWakingFtraceEvent_Decoder;
+  enum : int32_t {
+    kCommFieldNumber = 1,
+    kPidFieldNumber = 2,
+    kPrioFieldNumber = 3,
+    kSuccessFieldNumber = 4,
+    kTargetCpuFieldNumber = 5,
+  };
+
+  using FieldMetadata_Comm =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SchedWakingFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Comm kComm() { return {}; }
+  void set_comm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Comm::kFieldId, data, size);
+  }
+  void set_comm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Comm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedWakingFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Prio =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedWakingFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Prio kPrio() { return {}; }
+  void set_prio(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Prio::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Success =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedWakingFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Success kSuccess() { return {}; }
+  void set_success(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Success::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TargetCpu =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedWakingFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TargetCpu kTargetCpu() { return {}; }
+  void set_target_cpu(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TargetCpu::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SchedCpuHotplugFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SchedCpuHotplugFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SchedCpuHotplugFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SchedCpuHotplugFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_affected_cpu() const { return at<1>().valid(); }
+  int32_t affected_cpu() const { return at<1>().as_int32(); }
+  bool has_error() const { return at<2>().valid(); }
+  int32_t error() const { return at<2>().as_int32(); }
+  bool has_status() const { return at<3>().valid(); }
+  int32_t status() const { return at<3>().as_int32(); }
+};
+
+class SchedCpuHotplugFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SchedCpuHotplugFtraceEvent_Decoder;
+  enum : int32_t {
+    kAffectedCpuFieldNumber = 1,
+    kErrorFieldNumber = 2,
+    kStatusFieldNumber = 3,
+  };
+
+  using FieldMetadata_AffectedCpu =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedCpuHotplugFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AffectedCpu kAffectedCpu() { return {}; }
+  void set_affected_cpu(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_AffectedCpu::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Error =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedCpuHotplugFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Error kError() { return {}; }
+  void set_error(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Error::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Status =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedCpuHotplugFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Status kStatus() { return {}; }
+  void set_status(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Status::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SchedBlockedReasonFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SchedBlockedReasonFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SchedBlockedReasonFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SchedBlockedReasonFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_pid() const { return at<1>().valid(); }
+  int32_t pid() const { return at<1>().as_int32(); }
+  bool has_caller() const { return at<2>().valid(); }
+  uint64_t caller() const { return at<2>().as_uint64(); }
+  bool has_io_wait() const { return at<3>().valid(); }
+  uint32_t io_wait() const { return at<3>().as_uint32(); }
+};
+
+class SchedBlockedReasonFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SchedBlockedReasonFtraceEvent_Decoder;
+  enum : int32_t {
+    kPidFieldNumber = 1,
+    kCallerFieldNumber = 2,
+    kIoWaitFieldNumber = 3,
+  };
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedBlockedReasonFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Caller =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SchedBlockedReasonFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Caller kCaller() { return {}; }
+  void set_caller(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Caller::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IoWait =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SchedBlockedReasonFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IoWait kIoWait() { return {}; }
+  void set_io_wait(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IoWait::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SchedWakeupFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SchedWakeupFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SchedWakeupFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SchedWakeupFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_comm() const { return at<1>().valid(); }
+  ::protozero::ConstChars comm() const { return at<1>().as_string(); }
+  bool has_pid() const { return at<2>().valid(); }
+  int32_t pid() const { return at<2>().as_int32(); }
+  bool has_prio() const { return at<3>().valid(); }
+  int32_t prio() const { return at<3>().as_int32(); }
+  bool has_success() const { return at<4>().valid(); }
+  int32_t success() const { return at<4>().as_int32(); }
+  bool has_target_cpu() const { return at<5>().valid(); }
+  int32_t target_cpu() const { return at<5>().as_int32(); }
+};
+
+class SchedWakeupFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SchedWakeupFtraceEvent_Decoder;
+  enum : int32_t {
+    kCommFieldNumber = 1,
+    kPidFieldNumber = 2,
+    kPrioFieldNumber = 3,
+    kSuccessFieldNumber = 4,
+    kTargetCpuFieldNumber = 5,
+  };
+
+  using FieldMetadata_Comm =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SchedWakeupFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Comm kComm() { return {}; }
+  void set_comm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Comm::kFieldId, data, size);
+  }
+  void set_comm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Comm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedWakeupFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Prio =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedWakeupFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Prio kPrio() { return {}; }
+  void set_prio(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Prio::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Success =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedWakeupFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Success kSuccess() { return {}; }
+  void set_success(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Success::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TargetCpu =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedWakeupFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TargetCpu kTargetCpu() { return {}; }
+  void set_target_cpu(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TargetCpu::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SchedSwitchFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SchedSwitchFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SchedSwitchFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SchedSwitchFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_prev_comm() const { return at<1>().valid(); }
+  ::protozero::ConstChars prev_comm() const { return at<1>().as_string(); }
+  bool has_prev_pid() const { return at<2>().valid(); }
+  int32_t prev_pid() const { return at<2>().as_int32(); }
+  bool has_prev_prio() const { return at<3>().valid(); }
+  int32_t prev_prio() const { return at<3>().as_int32(); }
+  bool has_prev_state() const { return at<4>().valid(); }
+  int64_t prev_state() const { return at<4>().as_int64(); }
+  bool has_next_comm() const { return at<5>().valid(); }
+  ::protozero::ConstChars next_comm() const { return at<5>().as_string(); }
+  bool has_next_pid() const { return at<6>().valid(); }
+  int32_t next_pid() const { return at<6>().as_int32(); }
+  bool has_next_prio() const { return at<7>().valid(); }
+  int32_t next_prio() const { return at<7>().as_int32(); }
+};
+
+class SchedSwitchFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SchedSwitchFtraceEvent_Decoder;
+  enum : int32_t {
+    kPrevCommFieldNumber = 1,
+    kPrevPidFieldNumber = 2,
+    kPrevPrioFieldNumber = 3,
+    kPrevStateFieldNumber = 4,
+    kNextCommFieldNumber = 5,
+    kNextPidFieldNumber = 6,
+    kNextPrioFieldNumber = 7,
+  };
+
+  using FieldMetadata_PrevComm =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SchedSwitchFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PrevComm kPrevComm() { return {}; }
+  void set_prev_comm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_PrevComm::kFieldId, data, size);
+  }
+  void set_prev_comm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_PrevComm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PrevPid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedSwitchFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PrevPid kPrevPid() { return {}; }
+  void set_prev_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PrevPid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PrevPrio =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedSwitchFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PrevPrio kPrevPrio() { return {}; }
+  void set_prev_prio(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PrevPrio::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PrevState =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      SchedSwitchFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PrevState kPrevState() { return {}; }
+  void set_prev_state(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PrevState::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NextComm =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SchedSwitchFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NextComm kNextComm() { return {}; }
+  void set_next_comm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_NextComm::kFieldId, data, size);
+  }
+  void set_next_comm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_NextComm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NextPid =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedSwitchFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NextPid kNextPid() { return {}; }
+  void set_next_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NextPid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NextPrio =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SchedSwitchFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NextPrio kNextPrio() { return {}; }
+  void set_next_prio(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NextPrio::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/scm.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_SCM_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_SCM_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class ScmCallEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/0, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ScmCallEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ScmCallEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ScmCallEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+};
+
+class ScmCallEndFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = ScmCallEndFtraceEvent_Decoder;
+};
+
+class ScmCallStartFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ScmCallStartFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ScmCallStartFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ScmCallStartFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_arginfo() const { return at<1>().valid(); }
+  uint32_t arginfo() const { return at<1>().as_uint32(); }
+  bool has_x0() const { return at<2>().valid(); }
+  uint64_t x0() const { return at<2>().as_uint64(); }
+  bool has_x5() const { return at<3>().valid(); }
+  uint64_t x5() const { return at<3>().as_uint64(); }
+};
+
+class ScmCallStartFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = ScmCallStartFtraceEvent_Decoder;
+  enum : int32_t {
+    kArginfoFieldNumber = 1,
+    kX0FieldNumber = 2,
+    kX5FieldNumber = 3,
+  };
+
+  using FieldMetadata_Arginfo =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      ScmCallStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Arginfo kArginfo() { return {}; }
+  void set_arginfo(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Arginfo::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_X0 =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ScmCallStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_X0 kX0() { return {}; }
+  void set_x0(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_X0::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_X5 =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ScmCallStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_X5 kX5() { return {}; }
+  void set_x5(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_X5::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/sde.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_SDE_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_SDE_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class SdeSdePerfUpdateBusFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SdeSdePerfUpdateBusFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SdeSdePerfUpdateBusFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SdeSdePerfUpdateBusFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_ab_quota() const { return at<1>().valid(); }
+  uint64_t ab_quota() const { return at<1>().as_uint64(); }
+  bool has_bus_id() const { return at<2>().valid(); }
+  uint32_t bus_id() const { return at<2>().as_uint32(); }
+  bool has_client() const { return at<3>().valid(); }
+  int32_t client() const { return at<3>().as_int32(); }
+  bool has_ib_quota() const { return at<4>().valid(); }
+  uint64_t ib_quota() const { return at<4>().as_uint64(); }
+};
+
+class SdeSdePerfUpdateBusFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SdeSdePerfUpdateBusFtraceEvent_Decoder;
+  enum : int32_t {
+    kAbQuotaFieldNumber = 1,
+    kBusIdFieldNumber = 2,
+    kClientFieldNumber = 3,
+    kIbQuotaFieldNumber = 4,
+  };
+
+  using FieldMetadata_AbQuota =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SdeSdePerfUpdateBusFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AbQuota kAbQuota() { return {}; }
+  void set_ab_quota(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_AbQuota::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BusId =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SdeSdePerfUpdateBusFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BusId kBusId() { return {}; }
+  void set_bus_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BusId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Client =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SdeSdePerfUpdateBusFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Client kClient() { return {}; }
+  void set_client(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Client::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IbQuota =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SdeSdePerfUpdateBusFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IbQuota kIbQuota() { return {}; }
+  void set_ib_quota(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IbQuota::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SdeSdePerfSetQosLutsFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SdeSdePerfSetQosLutsFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SdeSdePerfSetQosLutsFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SdeSdePerfSetQosLutsFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_fl() const { return at<1>().valid(); }
+  uint32_t fl() const { return at<1>().as_uint32(); }
+  bool has_fmt() const { return at<2>().valid(); }
+  uint32_t fmt() const { return at<2>().as_uint32(); }
+  bool has_lut() const { return at<3>().valid(); }
+  uint64_t lut() const { return at<3>().as_uint64(); }
+  bool has_lut_usage() const { return at<4>().valid(); }
+  uint32_t lut_usage() const { return at<4>().as_uint32(); }
+  bool has_pnum() const { return at<5>().valid(); }
+  uint32_t pnum() const { return at<5>().as_uint32(); }
+  bool has_rt() const { return at<6>().valid(); }
+  uint32_t rt() const { return at<6>().as_uint32(); }
+};
+
+class SdeSdePerfSetQosLutsFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SdeSdePerfSetQosLutsFtraceEvent_Decoder;
+  enum : int32_t {
+    kFlFieldNumber = 1,
+    kFmtFieldNumber = 2,
+    kLutFieldNumber = 3,
+    kLutUsageFieldNumber = 4,
+    kPnumFieldNumber = 5,
+    kRtFieldNumber = 6,
+  };
+
+  using FieldMetadata_Fl =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SdeSdePerfSetQosLutsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Fl kFl() { return {}; }
+  void set_fl(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Fl::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Fmt =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SdeSdePerfSetQosLutsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Fmt kFmt() { return {}; }
+  void set_fmt(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Fmt::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Lut =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SdeSdePerfSetQosLutsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Lut kLut() { return {}; }
+  void set_lut(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Lut::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LutUsage =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SdeSdePerfSetQosLutsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LutUsage kLutUsage() { return {}; }
+  void set_lut_usage(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_LutUsage::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pnum =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SdeSdePerfSetQosLutsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pnum kPnum() { return {}; }
+  void set_pnum(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pnum::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Rt =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SdeSdePerfSetQosLutsFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Rt kRt() { return {}; }
+  void set_rt(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Rt::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SdeSdePerfCrtcUpdateFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/12, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SdeSdePerfCrtcUpdateFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SdeSdePerfCrtcUpdateFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SdeSdePerfCrtcUpdateFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_bw_ctl_ebi() const { return at<1>().valid(); }
+  uint64_t bw_ctl_ebi() const { return at<1>().as_uint64(); }
+  bool has_bw_ctl_llcc() const { return at<2>().valid(); }
+  uint64_t bw_ctl_llcc() const { return at<2>().as_uint64(); }
+  bool has_bw_ctl_mnoc() const { return at<3>().valid(); }
+  uint64_t bw_ctl_mnoc() const { return at<3>().as_uint64(); }
+  bool has_core_clk_rate() const { return at<4>().valid(); }
+  uint32_t core_clk_rate() const { return at<4>().as_uint32(); }
+  bool has_crtc() const { return at<5>().valid(); }
+  uint32_t crtc() const { return at<5>().as_uint32(); }
+  bool has_params() const { return at<6>().valid(); }
+  int32_t params() const { return at<6>().as_int32(); }
+  bool has_per_pipe_ib_ebi() const { return at<7>().valid(); }
+  uint64_t per_pipe_ib_ebi() const { return at<7>().as_uint64(); }
+  bool has_per_pipe_ib_llcc() const { return at<8>().valid(); }
+  uint64_t per_pipe_ib_llcc() const { return at<8>().as_uint64(); }
+  bool has_per_pipe_ib_mnoc() const { return at<9>().valid(); }
+  uint64_t per_pipe_ib_mnoc() const { return at<9>().as_uint64(); }
+  bool has_stop_req() const { return at<10>().valid(); }
+  uint32_t stop_req() const { return at<10>().as_uint32(); }
+  bool has_update_bus() const { return at<11>().valid(); }
+  uint32_t update_bus() const { return at<11>().as_uint32(); }
+  bool has_update_clk() const { return at<12>().valid(); }
+  uint32_t update_clk() const { return at<12>().as_uint32(); }
+};
+
+class SdeSdePerfCrtcUpdateFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SdeSdePerfCrtcUpdateFtraceEvent_Decoder;
+  enum : int32_t {
+    kBwCtlEbiFieldNumber = 1,
+    kBwCtlLlccFieldNumber = 2,
+    kBwCtlMnocFieldNumber = 3,
+    kCoreClkRateFieldNumber = 4,
+    kCrtcFieldNumber = 5,
+    kParamsFieldNumber = 6,
+    kPerPipeIbEbiFieldNumber = 7,
+    kPerPipeIbLlccFieldNumber = 8,
+    kPerPipeIbMnocFieldNumber = 9,
+    kStopReqFieldNumber = 10,
+    kUpdateBusFieldNumber = 11,
+    kUpdateClkFieldNumber = 12,
+  };
+
+  using FieldMetadata_BwCtlEbi =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SdeSdePerfCrtcUpdateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BwCtlEbi kBwCtlEbi() { return {}; }
+  void set_bw_ctl_ebi(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BwCtlEbi::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BwCtlLlcc =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SdeSdePerfCrtcUpdateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BwCtlLlcc kBwCtlLlcc() { return {}; }
+  void set_bw_ctl_llcc(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BwCtlLlcc::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BwCtlMnoc =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SdeSdePerfCrtcUpdateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BwCtlMnoc kBwCtlMnoc() { return {}; }
+  void set_bw_ctl_mnoc(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BwCtlMnoc::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CoreClkRate =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SdeSdePerfCrtcUpdateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CoreClkRate kCoreClkRate() { return {}; }
+  void set_core_clk_rate(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CoreClkRate::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Crtc =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SdeSdePerfCrtcUpdateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Crtc kCrtc() { return {}; }
+  void set_crtc(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Crtc::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Params =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SdeSdePerfCrtcUpdateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Params kParams() { return {}; }
+  void set_params(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Params::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PerPipeIbEbi =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SdeSdePerfCrtcUpdateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PerPipeIbEbi kPerPipeIbEbi() { return {}; }
+  void set_per_pipe_ib_ebi(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PerPipeIbEbi::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PerPipeIbLlcc =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SdeSdePerfCrtcUpdateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PerPipeIbLlcc kPerPipeIbLlcc() { return {}; }
+  void set_per_pipe_ib_llcc(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PerPipeIbLlcc::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PerPipeIbMnoc =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SdeSdePerfCrtcUpdateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PerPipeIbMnoc kPerPipeIbMnoc() { return {}; }
+  void set_per_pipe_ib_mnoc(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PerPipeIbMnoc::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_StopReq =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SdeSdePerfCrtcUpdateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StopReq kStopReq() { return {}; }
+  void set_stop_req(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_StopReq::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_UpdateBus =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SdeSdePerfCrtcUpdateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UpdateBus kUpdateBus() { return {}; }
+  void set_update_bus(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_UpdateBus::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_UpdateClk =
+    ::protozero::proto_utils::FieldMetadata<
+      12,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SdeSdePerfCrtcUpdateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UpdateClk kUpdateClk() { return {}; }
+  void set_update_clk(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_UpdateClk::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SdeSdePerfCalcCrtcFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SdeSdePerfCalcCrtcFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SdeSdePerfCalcCrtcFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SdeSdePerfCalcCrtcFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_bw_ctl_ebi() const { return at<1>().valid(); }
+  uint64_t bw_ctl_ebi() const { return at<1>().as_uint64(); }
+  bool has_bw_ctl_llcc() const { return at<2>().valid(); }
+  uint64_t bw_ctl_llcc() const { return at<2>().as_uint64(); }
+  bool has_bw_ctl_mnoc() const { return at<3>().valid(); }
+  uint64_t bw_ctl_mnoc() const { return at<3>().as_uint64(); }
+  bool has_core_clk_rate() const { return at<4>().valid(); }
+  uint32_t core_clk_rate() const { return at<4>().as_uint32(); }
+  bool has_crtc() const { return at<5>().valid(); }
+  uint32_t crtc() const { return at<5>().as_uint32(); }
+  bool has_ib_ebi() const { return at<6>().valid(); }
+  uint64_t ib_ebi() const { return at<6>().as_uint64(); }
+  bool has_ib_llcc() const { return at<7>().valid(); }
+  uint64_t ib_llcc() const { return at<7>().as_uint64(); }
+  bool has_ib_mnoc() const { return at<8>().valid(); }
+  uint64_t ib_mnoc() const { return at<8>().as_uint64(); }
+};
+
+class SdeSdePerfCalcCrtcFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SdeSdePerfCalcCrtcFtraceEvent_Decoder;
+  enum : int32_t {
+    kBwCtlEbiFieldNumber = 1,
+    kBwCtlLlccFieldNumber = 2,
+    kBwCtlMnocFieldNumber = 3,
+    kCoreClkRateFieldNumber = 4,
+    kCrtcFieldNumber = 5,
+    kIbEbiFieldNumber = 6,
+    kIbLlccFieldNumber = 7,
+    kIbMnocFieldNumber = 8,
+  };
+
+  using FieldMetadata_BwCtlEbi =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SdeSdePerfCalcCrtcFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BwCtlEbi kBwCtlEbi() { return {}; }
+  void set_bw_ctl_ebi(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BwCtlEbi::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BwCtlLlcc =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SdeSdePerfCalcCrtcFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BwCtlLlcc kBwCtlLlcc() { return {}; }
+  void set_bw_ctl_llcc(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BwCtlLlcc::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BwCtlMnoc =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SdeSdePerfCalcCrtcFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BwCtlMnoc kBwCtlMnoc() { return {}; }
+  void set_bw_ctl_mnoc(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BwCtlMnoc::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CoreClkRate =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SdeSdePerfCalcCrtcFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CoreClkRate kCoreClkRate() { return {}; }
+  void set_core_clk_rate(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CoreClkRate::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Crtc =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SdeSdePerfCalcCrtcFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Crtc kCrtc() { return {}; }
+  void set_crtc(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Crtc::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IbEbi =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SdeSdePerfCalcCrtcFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IbEbi kIbEbi() { return {}; }
+  void set_ib_ebi(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IbEbi::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IbLlcc =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SdeSdePerfCalcCrtcFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IbLlcc kIbLlcc() { return {}; }
+  void set_ib_llcc(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IbLlcc::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IbMnoc =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SdeSdePerfCalcCrtcFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IbMnoc kIbMnoc() { return {}; }
+  void set_ib_mnoc(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IbMnoc::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SdeSdeEvtlogFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SdeSdeEvtlogFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SdeSdeEvtlogFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SdeSdeEvtlogFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_evtlog_tag() const { return at<1>().valid(); }
+  ::protozero::ConstChars evtlog_tag() const { return at<1>().as_string(); }
+  bool has_pid() const { return at<2>().valid(); }
+  int32_t pid() const { return at<2>().as_int32(); }
+  bool has_tag_id() const { return at<3>().valid(); }
+  uint32_t tag_id() const { return at<3>().as_uint32(); }
+};
+
+class SdeSdeEvtlogFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SdeSdeEvtlogFtraceEvent_Decoder;
+  enum : int32_t {
+    kEvtlogTagFieldNumber = 1,
+    kPidFieldNumber = 2,
+    kTagIdFieldNumber = 3,
+  };
+
+  using FieldMetadata_EvtlogTag =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SdeSdeEvtlogFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EvtlogTag kEvtlogTag() { return {}; }
+  void set_evtlog_tag(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_EvtlogTag::kFieldId, data, size);
+  }
+  void set_evtlog_tag(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_EvtlogTag::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SdeSdeEvtlogFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TagId =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SdeSdeEvtlogFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TagId kTagId() { return {}; }
+  void set_tag_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TagId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SdeTracingMarkWriteFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SdeTracingMarkWriteFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SdeTracingMarkWriteFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SdeTracingMarkWriteFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_pid() const { return at<1>().valid(); }
+  int32_t pid() const { return at<1>().as_int32(); }
+  bool has_trace_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars trace_name() const { return at<2>().as_string(); }
+  bool has_trace_type() const { return at<3>().valid(); }
+  uint32_t trace_type() const { return at<3>().as_uint32(); }
+  bool has_value() const { return at<4>().valid(); }
+  int32_t value() const { return at<4>().as_int32(); }
+  bool has_trace_begin() const { return at<5>().valid(); }
+  uint32_t trace_begin() const { return at<5>().as_uint32(); }
+};
+
+class SdeTracingMarkWriteFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SdeTracingMarkWriteFtraceEvent_Decoder;
+  enum : int32_t {
+    kPidFieldNumber = 1,
+    kTraceNameFieldNumber = 2,
+    kTraceTypeFieldNumber = 3,
+    kValueFieldNumber = 4,
+    kTraceBeginFieldNumber = 5,
+  };
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SdeTracingMarkWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TraceName =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SdeTracingMarkWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TraceName kTraceName() { return {}; }
+  void set_trace_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_TraceName::kFieldId, data, size);
+  }
+  void set_trace_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_TraceName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TraceType =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SdeTracingMarkWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TraceType kTraceType() { return {}; }
+  void set_trace_type(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TraceType::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Value =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SdeTracingMarkWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Value kValue() { return {}; }
+  void set_value(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Value::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TraceBegin =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SdeTracingMarkWriteFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TraceBegin kTraceBegin() { return {}; }
+  void set_trace_begin(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TraceBegin::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/signal.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_SIGNAL_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_SIGNAL_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class SignalGenerateFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SignalGenerateFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SignalGenerateFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SignalGenerateFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_code() const { return at<1>().valid(); }
+  int32_t code() const { return at<1>().as_int32(); }
+  bool has_comm() const { return at<2>().valid(); }
+  ::protozero::ConstChars comm() const { return at<2>().as_string(); }
+  bool has_group() const { return at<3>().valid(); }
+  int32_t group() const { return at<3>().as_int32(); }
+  bool has_pid() const { return at<4>().valid(); }
+  int32_t pid() const { return at<4>().as_int32(); }
+  bool has_result() const { return at<5>().valid(); }
+  int32_t result() const { return at<5>().as_int32(); }
+  bool has_sig() const { return at<6>().valid(); }
+  int32_t sig() const { return at<6>().as_int32(); }
+};
+
+class SignalGenerateFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SignalGenerateFtraceEvent_Decoder;
+  enum : int32_t {
+    kCodeFieldNumber = 1,
+    kCommFieldNumber = 2,
+    kGroupFieldNumber = 3,
+    kPidFieldNumber = 4,
+    kResultFieldNumber = 5,
+    kSigFieldNumber = 6,
+  };
+
+  using FieldMetadata_Code =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SignalGenerateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Code kCode() { return {}; }
+  void set_code(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Code::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Comm =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SignalGenerateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Comm kComm() { return {}; }
+  void set_comm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Comm::kFieldId, data, size);
+  }
+  void set_comm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Comm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Group =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SignalGenerateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Group kGroup() { return {}; }
+  void set_group(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Group::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SignalGenerateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Result =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SignalGenerateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Result kResult() { return {}; }
+  void set_result(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Result::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Sig =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SignalGenerateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Sig kSig() { return {}; }
+  void set_sig(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Sig::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SignalDeliverFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SignalDeliverFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SignalDeliverFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SignalDeliverFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_code() const { return at<1>().valid(); }
+  int32_t code() const { return at<1>().as_int32(); }
+  bool has_sa_flags() const { return at<2>().valid(); }
+  uint64_t sa_flags() const { return at<2>().as_uint64(); }
+  bool has_sig() const { return at<3>().valid(); }
+  int32_t sig() const { return at<3>().as_int32(); }
+};
+
+class SignalDeliverFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SignalDeliverFtraceEvent_Decoder;
+  enum : int32_t {
+    kCodeFieldNumber = 1,
+    kSaFlagsFieldNumber = 2,
+    kSigFieldNumber = 3,
+  };
+
+  using FieldMetadata_Code =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SignalDeliverFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Code kCode() { return {}; }
+  void set_code(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Code::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SaFlags =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SignalDeliverFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SaFlags kSaFlags() { return {}; }
+  void set_sa_flags(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SaFlags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Sig =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SignalDeliverFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Sig kSig() { return {}; }
+  void set_sig(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Sig::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/sync.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_SYNC_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_SYNC_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class SyncWaitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SyncWaitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SyncWaitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SyncWaitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_status() const { return at<2>().valid(); }
+  int32_t status() const { return at<2>().as_int32(); }
+  bool has_begin() const { return at<3>().valid(); }
+  uint32_t begin() const { return at<3>().as_uint32(); }
+};
+
+class SyncWaitFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SyncWaitFtraceEvent_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kStatusFieldNumber = 2,
+    kBeginFieldNumber = 3,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SyncWaitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Status =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SyncWaitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Status kStatus() { return {}; }
+  void set_status(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Status::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Begin =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SyncWaitFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Begin kBegin() { return {}; }
+  void set_begin(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Begin::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SyncTimelineFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SyncTimelineFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SyncTimelineFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SyncTimelineFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_value() const { return at<2>().valid(); }
+  ::protozero::ConstChars value() const { return at<2>().as_string(); }
+};
+
+class SyncTimelineFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SyncTimelineFtraceEvent_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kValueFieldNumber = 2,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SyncTimelineFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Value =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SyncTimelineFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Value kValue() { return {}; }
+  void set_value(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Value::kFieldId, data, size);
+  }
+  void set_value(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Value::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SyncPtFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SyncPtFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SyncPtFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SyncPtFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_timeline() const { return at<1>().valid(); }
+  ::protozero::ConstChars timeline() const { return at<1>().as_string(); }
+  bool has_value() const { return at<2>().valid(); }
+  ::protozero::ConstChars value() const { return at<2>().as_string(); }
+};
+
+class SyncPtFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = SyncPtFtraceEvent_Decoder;
+  enum : int32_t {
+    kTimelineFieldNumber = 1,
+    kValueFieldNumber = 2,
+  };
+
+  using FieldMetadata_Timeline =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SyncPtFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Timeline kTimeline() { return {}; }
+  void set_timeline(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Timeline::kFieldId, data, size);
+  }
+  void set_timeline(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Timeline::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Value =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SyncPtFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Value kValue() { return {}; }
+  void set_value(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Value::kFieldId, data, size);
+  }
+  void set_value(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Value::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/systrace.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_SYSTRACE_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_SYSTRACE_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class ZeroFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ZeroFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ZeroFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ZeroFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_flag() const { return at<1>().valid(); }
+  int32_t flag() const { return at<1>().as_int32(); }
+  bool has_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars name() const { return at<2>().as_string(); }
+  bool has_pid() const { return at<3>().valid(); }
+  int32_t pid() const { return at<3>().as_int32(); }
+  bool has_value() const { return at<4>().valid(); }
+  int64_t value() const { return at<4>().as_int64(); }
+};
+
+class ZeroFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = ZeroFtraceEvent_Decoder;
+  enum : int32_t {
+    kFlagFieldNumber = 1,
+    kNameFieldNumber = 2,
+    kPidFieldNumber = 3,
+    kValueFieldNumber = 4,
+  };
+
+  using FieldMetadata_Flag =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ZeroFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Flag kFlag() { return {}; }
+  void set_flag(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Flag::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ZeroFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ZeroFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Value =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      ZeroFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Value kValue() { return {}; }
+  void set_value(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Value::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/task.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_TASK_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_TASK_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class TaskRenameFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TaskRenameFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TaskRenameFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TaskRenameFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_pid() const { return at<1>().valid(); }
+  int32_t pid() const { return at<1>().as_int32(); }
+  bool has_oldcomm() const { return at<2>().valid(); }
+  ::protozero::ConstChars oldcomm() const { return at<2>().as_string(); }
+  bool has_newcomm() const { return at<3>().valid(); }
+  ::protozero::ConstChars newcomm() const { return at<3>().as_string(); }
+  bool has_oom_score_adj() const { return at<4>().valid(); }
+  int32_t oom_score_adj() const { return at<4>().as_int32(); }
+};
+
+class TaskRenameFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = TaskRenameFtraceEvent_Decoder;
+  enum : int32_t {
+    kPidFieldNumber = 1,
+    kOldcommFieldNumber = 2,
+    kNewcommFieldNumber = 3,
+    kOomScoreAdjFieldNumber = 4,
+  };
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      TaskRenameFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Oldcomm =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TaskRenameFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Oldcomm kOldcomm() { return {}; }
+  void set_oldcomm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Oldcomm::kFieldId, data, size);
+  }
+  void set_oldcomm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Oldcomm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Newcomm =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TaskRenameFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Newcomm kNewcomm() { return {}; }
+  void set_newcomm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Newcomm::kFieldId, data, size);
+  }
+  void set_newcomm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Newcomm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OomScoreAdj =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      TaskRenameFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OomScoreAdj kOomScoreAdj() { return {}; }
+  void set_oom_score_adj(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OomScoreAdj::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TaskNewtaskFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TaskNewtaskFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TaskNewtaskFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TaskNewtaskFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_pid() const { return at<1>().valid(); }
+  int32_t pid() const { return at<1>().as_int32(); }
+  bool has_comm() const { return at<2>().valid(); }
+  ::protozero::ConstChars comm() const { return at<2>().as_string(); }
+  bool has_clone_flags() const { return at<3>().valid(); }
+  uint64_t clone_flags() const { return at<3>().as_uint64(); }
+  bool has_oom_score_adj() const { return at<4>().valid(); }
+  int32_t oom_score_adj() const { return at<4>().as_int32(); }
+};
+
+class TaskNewtaskFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = TaskNewtaskFtraceEvent_Decoder;
+  enum : int32_t {
+    kPidFieldNumber = 1,
+    kCommFieldNumber = 2,
+    kCloneFlagsFieldNumber = 3,
+    kOomScoreAdjFieldNumber = 4,
+  };
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      TaskNewtaskFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Comm =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TaskNewtaskFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Comm kComm() { return {}; }
+  void set_comm(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Comm::kFieldId, data, size);
+  }
+  void set_comm(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Comm::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CloneFlags =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TaskNewtaskFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CloneFlags kCloneFlags() { return {}; }
+  void set_clone_flags(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CloneFlags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OomScoreAdj =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      TaskNewtaskFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OomScoreAdj kOomScoreAdj() { return {}; }
+  void set_oom_score_adj(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OomScoreAdj::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/thermal.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_THERMAL_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_THERMAL_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class CdevUpdateFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  CdevUpdateFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit CdevUpdateFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit CdevUpdateFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_target() const { return at<1>().valid(); }
+  uint64_t target() const { return at<1>().as_uint64(); }
+  bool has_type() const { return at<2>().valid(); }
+  ::protozero::ConstChars type() const { return at<2>().as_string(); }
+};
+
+class CdevUpdateFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = CdevUpdateFtraceEvent_Decoder;
+  enum : int32_t {
+    kTargetFieldNumber = 1,
+    kTypeFieldNumber = 2,
+  };
+
+  using FieldMetadata_Target =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      CdevUpdateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Target kTarget() { return {}; }
+  void set_target(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Target::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Type =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      CdevUpdateFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Type kType() { return {}; }
+  void set_type(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Type::kFieldId, data, size);
+  }
+  void set_type(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Type::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class ThermalTemperatureFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ThermalTemperatureFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ThermalTemperatureFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ThermalTemperatureFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_id() const { return at<1>().valid(); }
+  int32_t id() const { return at<1>().as_int32(); }
+  bool has_temp() const { return at<2>().valid(); }
+  int32_t temp() const { return at<2>().as_int32(); }
+  bool has_temp_prev() const { return at<3>().valid(); }
+  int32_t temp_prev() const { return at<3>().as_int32(); }
+  bool has_thermal_zone() const { return at<4>().valid(); }
+  ::protozero::ConstChars thermal_zone() const { return at<4>().as_string(); }
+};
+
+class ThermalTemperatureFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = ThermalTemperatureFtraceEvent_Decoder;
+  enum : int32_t {
+    kIdFieldNumber = 1,
+    kTempFieldNumber = 2,
+    kTempPrevFieldNumber = 3,
+    kThermalZoneFieldNumber = 4,
+  };
+
+  using FieldMetadata_Id =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ThermalTemperatureFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Id kId() { return {}; }
+  void set_id(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Id::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Temp =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ThermalTemperatureFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Temp kTemp() { return {}; }
+  void set_temp(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Temp::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TempPrev =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ThermalTemperatureFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TempPrev kTempPrev() { return {}; }
+  void set_temp_prev(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TempPrev::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ThermalZone =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ThermalTemperatureFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ThermalZone kThermalZone() { return {}; }
+  void set_thermal_zone(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ThermalZone::kFieldId, data, size);
+  }
+  void set_thermal_zone(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ThermalZone::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/vmscan.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_VMSCAN_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_VMSCAN_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class MmVmscanKswapdSleepFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MmVmscanKswapdSleepFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MmVmscanKswapdSleepFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MmVmscanKswapdSleepFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_nid() const { return at<1>().valid(); }
+  int32_t nid() const { return at<1>().as_int32(); }
+};
+
+class MmVmscanKswapdSleepFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MmVmscanKswapdSleepFtraceEvent_Decoder;
+  enum : int32_t {
+    kNidFieldNumber = 1,
+  };
+
+  using FieldMetadata_Nid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmVmscanKswapdSleepFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Nid kNid() { return {}; }
+  void set_nid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Nid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MmVmscanKswapdWakeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MmVmscanKswapdWakeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MmVmscanKswapdWakeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MmVmscanKswapdWakeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_nid() const { return at<1>().valid(); }
+  int32_t nid() const { return at<1>().as_int32(); }
+  bool has_order() const { return at<2>().valid(); }
+  int32_t order() const { return at<2>().as_int32(); }
+};
+
+class MmVmscanKswapdWakeFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MmVmscanKswapdWakeFtraceEvent_Decoder;
+  enum : int32_t {
+    kNidFieldNumber = 1,
+    kOrderFieldNumber = 2,
+  };
+
+  using FieldMetadata_Nid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmVmscanKswapdWakeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Nid kNid() { return {}; }
+  void set_nid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Nid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Order =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmVmscanKswapdWakeFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Order kOrder() { return {}; }
+  void set_order(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Order::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MmVmscanDirectReclaimEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MmVmscanDirectReclaimEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MmVmscanDirectReclaimEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MmVmscanDirectReclaimEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_nr_reclaimed() const { return at<1>().valid(); }
+  uint64_t nr_reclaimed() const { return at<1>().as_uint64(); }
+};
+
+class MmVmscanDirectReclaimEndFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MmVmscanDirectReclaimEndFtraceEvent_Decoder;
+  enum : int32_t {
+    kNrReclaimedFieldNumber = 1,
+  };
+
+  using FieldMetadata_NrReclaimed =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MmVmscanDirectReclaimEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NrReclaimed kNrReclaimed() { return {}; }
+  void set_nr_reclaimed(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NrReclaimed::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MmVmscanDirectReclaimBeginFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MmVmscanDirectReclaimBeginFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MmVmscanDirectReclaimBeginFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MmVmscanDirectReclaimBeginFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_order() const { return at<1>().valid(); }
+  int32_t order() const { return at<1>().as_int32(); }
+  bool has_may_writepage() const { return at<2>().valid(); }
+  int32_t may_writepage() const { return at<2>().as_int32(); }
+  bool has_gfp_flags() const { return at<3>().valid(); }
+  uint32_t gfp_flags() const { return at<3>().as_uint32(); }
+};
+
+class MmVmscanDirectReclaimBeginFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = MmVmscanDirectReclaimBeginFtraceEvent_Decoder;
+  enum : int32_t {
+    kOrderFieldNumber = 1,
+    kMayWritepageFieldNumber = 2,
+    kGfpFlagsFieldNumber = 3,
+  };
+
+  using FieldMetadata_Order =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmVmscanDirectReclaimBeginFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Order kOrder() { return {}; }
+  void set_order(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Order::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MayWritepage =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MmVmscanDirectReclaimBeginFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MayWritepage kMayWritepage() { return {}; }
+  void set_may_writepage(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MayWritepage::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_GfpFlags =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MmVmscanDirectReclaimBeginFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GfpFlags kGfpFlags() { return {}; }
+  void set_gfp_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_GfpFlags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/workqueue.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_WORKQUEUE_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_WORKQUEUE_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class WorkqueueQueueWorkFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  WorkqueueQueueWorkFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit WorkqueueQueueWorkFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit WorkqueueQueueWorkFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_work() const { return at<1>().valid(); }
+  uint64_t work() const { return at<1>().as_uint64(); }
+  bool has_function() const { return at<2>().valid(); }
+  uint64_t function() const { return at<2>().as_uint64(); }
+  bool has_workqueue() const { return at<3>().valid(); }
+  uint64_t workqueue() const { return at<3>().as_uint64(); }
+  bool has_req_cpu() const { return at<4>().valid(); }
+  uint32_t req_cpu() const { return at<4>().as_uint32(); }
+  bool has_cpu() const { return at<5>().valid(); }
+  uint32_t cpu() const { return at<5>().as_uint32(); }
+};
+
+class WorkqueueQueueWorkFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = WorkqueueQueueWorkFtraceEvent_Decoder;
+  enum : int32_t {
+    kWorkFieldNumber = 1,
+    kFunctionFieldNumber = 2,
+    kWorkqueueFieldNumber = 3,
+    kReqCpuFieldNumber = 4,
+    kCpuFieldNumber = 5,
+  };
+
+  using FieldMetadata_Work =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      WorkqueueQueueWorkFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Work kWork() { return {}; }
+  void set_work(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Work::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Function =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      WorkqueueQueueWorkFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Function kFunction() { return {}; }
+  void set_function(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Function::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Workqueue =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      WorkqueueQueueWorkFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Workqueue kWorkqueue() { return {}; }
+  void set_workqueue(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Workqueue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ReqCpu =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      WorkqueueQueueWorkFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ReqCpu kReqCpu() { return {}; }
+  void set_req_cpu(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ReqCpu::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Cpu =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      WorkqueueQueueWorkFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cpu kCpu() { return {}; }
+  void set_cpu(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cpu::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class WorkqueueExecuteStartFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  WorkqueueExecuteStartFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit WorkqueueExecuteStartFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit WorkqueueExecuteStartFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_work() const { return at<1>().valid(); }
+  uint64_t work() const { return at<1>().as_uint64(); }
+  bool has_function() const { return at<2>().valid(); }
+  uint64_t function() const { return at<2>().as_uint64(); }
+};
+
+class WorkqueueExecuteStartFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = WorkqueueExecuteStartFtraceEvent_Decoder;
+  enum : int32_t {
+    kWorkFieldNumber = 1,
+    kFunctionFieldNumber = 2,
+  };
+
+  using FieldMetadata_Work =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      WorkqueueExecuteStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Work kWork() { return {}; }
+  void set_work(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Work::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Function =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      WorkqueueExecuteStartFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Function kFunction() { return {}; }
+  void set_function(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Function::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class WorkqueueExecuteEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  WorkqueueExecuteEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit WorkqueueExecuteEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit WorkqueueExecuteEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_work() const { return at<1>().valid(); }
+  uint64_t work() const { return at<1>().as_uint64(); }
+};
+
+class WorkqueueExecuteEndFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = WorkqueueExecuteEndFtraceEvent_Decoder;
+  enum : int32_t {
+    kWorkFieldNumber = 1,
+  };
+
+  using FieldMetadata_Work =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      WorkqueueExecuteEndFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Work kWork() { return {}; }
+  void set_work(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Work::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class WorkqueueActivateWorkFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  WorkqueueActivateWorkFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit WorkqueueActivateWorkFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit WorkqueueActivateWorkFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_work() const { return at<1>().valid(); }
+  uint64_t work() const { return at<1>().as_uint64(); }
+};
+
+class WorkqueueActivateWorkFtraceEvent : public ::protozero::Message {
+ public:
+  using Decoder = WorkqueueActivateWorkFtraceEvent_Decoder;
+  enum : int32_t {
+    kWorkFieldNumber = 1,
+  };
+
+  using FieldMetadata_Work =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      WorkqueueActivateWorkFtraceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Work kWork() { return {}; }
+  void set_work(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Work::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/gpu/gpu_counter_event.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_GPU_GPU_COUNTER_EVENT_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_GPU_GPU_COUNTER_EVENT_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class GpuCounterDescriptor;
+class GpuCounterEvent_GpuCounter;
+
+class GpuCounterEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  GpuCounterEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit GpuCounterEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit GpuCounterEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_counter_descriptor() const { return at<1>().valid(); }
+  ::protozero::ConstBytes counter_descriptor() const { return at<1>().as_bytes(); }
+  bool has_counters() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> counters() const { return GetRepeated<::protozero::ConstBytes>(2); }
+  bool has_gpu_id() const { return at<3>().valid(); }
+  int32_t gpu_id() const { return at<3>().as_int32(); }
+};
+
+class GpuCounterEvent : public ::protozero::Message {
+ public:
+  using Decoder = GpuCounterEvent_Decoder;
+  enum : int32_t {
+    kCounterDescriptorFieldNumber = 1,
+    kCountersFieldNumber = 2,
+    kGpuIdFieldNumber = 3,
+  };
+  using GpuCounter = ::perfetto::protos::pbzero::GpuCounterEvent_GpuCounter;
+
+  using FieldMetadata_CounterDescriptor =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      GpuCounterDescriptor,
+      GpuCounterEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CounterDescriptor kCounterDescriptor() { return {}; }
+  template <typename T = GpuCounterDescriptor> T* set_counter_descriptor() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_Counters =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      GpuCounterEvent_GpuCounter,
+      GpuCounterEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Counters kCounters() { return {}; }
+  template <typename T = GpuCounterEvent_GpuCounter> T* add_counters() {
+    return BeginNestedMessage<T>(2);
+  }
+
+
+  using FieldMetadata_GpuId =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      GpuCounterEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GpuId kGpuId() { return {}; }
+  void set_gpu_id(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_GpuId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class GpuCounterEvent_GpuCounter_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  GpuCounterEvent_GpuCounter_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit GpuCounterEvent_GpuCounter_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit GpuCounterEvent_GpuCounter_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_counter_id() const { return at<1>().valid(); }
+  uint32_t counter_id() const { return at<1>().as_uint32(); }
+  bool has_int_value() const { return at<2>().valid(); }
+  int64_t int_value() const { return at<2>().as_int64(); }
+  bool has_double_value() const { return at<3>().valid(); }
+  double double_value() const { return at<3>().as_double(); }
+};
+
+class GpuCounterEvent_GpuCounter : public ::protozero::Message {
+ public:
+  using Decoder = GpuCounterEvent_GpuCounter_Decoder;
+  enum : int32_t {
+    kCounterIdFieldNumber = 1,
+    kIntValueFieldNumber = 2,
+    kDoubleValueFieldNumber = 3,
+  };
+
+  using FieldMetadata_CounterId =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      GpuCounterEvent_GpuCounter>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CounterId kCounterId() { return {}; }
+  void set_counter_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CounterId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IntValue =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      GpuCounterEvent_GpuCounter>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IntValue kIntValue() { return {}; }
+  void set_int_value(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IntValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DoubleValue =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kDouble,
+      double,
+      GpuCounterEvent_GpuCounter>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DoubleValue kDoubleValue() { return {}; }
+  void set_double_value(double value) {
+    static constexpr uint32_t field_id = FieldMetadata_DoubleValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kDouble>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/gpu/gpu_log.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_GPU_GPU_LOG_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_GPU_GPU_LOG_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+enum GpuLog_Severity : int32_t;
+
+enum GpuLog_Severity : int32_t {
+  GpuLog_Severity_LOG_SEVERITY_UNSPECIFIED = 0,
+  GpuLog_Severity_LOG_SEVERITY_VERBOSE = 1,
+  GpuLog_Severity_LOG_SEVERITY_DEBUG = 2,
+  GpuLog_Severity_LOG_SEVERITY_INFO = 3,
+  GpuLog_Severity_LOG_SEVERITY_WARNING = 4,
+  GpuLog_Severity_LOG_SEVERITY_ERROR = 5,
+};
+
+const GpuLog_Severity GpuLog_Severity_MIN = GpuLog_Severity_LOG_SEVERITY_UNSPECIFIED;
+const GpuLog_Severity GpuLog_Severity_MAX = GpuLog_Severity_LOG_SEVERITY_ERROR;
+
+class GpuLog_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  GpuLog_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit GpuLog_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit GpuLog_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_severity() const { return at<1>().valid(); }
+  int32_t severity() const { return at<1>().as_int32(); }
+  bool has_tag() const { return at<2>().valid(); }
+  ::protozero::ConstChars tag() const { return at<2>().as_string(); }
+  bool has_log_message() const { return at<3>().valid(); }
+  ::protozero::ConstChars log_message() const { return at<3>().as_string(); }
+};
+
+class GpuLog : public ::protozero::Message {
+ public:
+  using Decoder = GpuLog_Decoder;
+  enum : int32_t {
+    kSeverityFieldNumber = 1,
+    kTagFieldNumber = 2,
+    kLogMessageFieldNumber = 3,
+  };
+  using Severity = ::perfetto::protos::pbzero::GpuLog_Severity;
+  static const Severity LOG_SEVERITY_UNSPECIFIED = GpuLog_Severity_LOG_SEVERITY_UNSPECIFIED;
+  static const Severity LOG_SEVERITY_VERBOSE = GpuLog_Severity_LOG_SEVERITY_VERBOSE;
+  static const Severity LOG_SEVERITY_DEBUG = GpuLog_Severity_LOG_SEVERITY_DEBUG;
+  static const Severity LOG_SEVERITY_INFO = GpuLog_Severity_LOG_SEVERITY_INFO;
+  static const Severity LOG_SEVERITY_WARNING = GpuLog_Severity_LOG_SEVERITY_WARNING;
+  static const Severity LOG_SEVERITY_ERROR = GpuLog_Severity_LOG_SEVERITY_ERROR;
+
+  using FieldMetadata_Severity =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::GpuLog_Severity,
+      GpuLog>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Severity kSeverity() { return {}; }
+  void set_severity(::perfetto::protos::pbzero::GpuLog_Severity value) {
+    static constexpr uint32_t field_id = FieldMetadata_Severity::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Tag =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      GpuLog>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Tag kTag() { return {}; }
+  void set_tag(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Tag::kFieldId, data, size);
+  }
+  void set_tag(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Tag::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LogMessage =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      GpuLog>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LogMessage kLogMessage() { return {}; }
+  void set_log_message(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_LogMessage::kFieldId, data, size);
+  }
+  void set_log_message(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_LogMessage::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/gpu/gpu_render_stage_event.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_GPU_GPU_RENDER_STAGE_EVENT_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_GPU_GPU_RENDER_STAGE_EVENT_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class GpuRenderStageEvent_ExtraData;
+class GpuRenderStageEvent_Specifications;
+class GpuRenderStageEvent_Specifications_ContextSpec;
+class GpuRenderStageEvent_Specifications_Description;
+enum InternedGpuRenderStageSpecification_RenderStageCategory : int32_t;
+enum InternedGraphicsContext_Api : int32_t;
+
+enum InternedGpuRenderStageSpecification_RenderStageCategory : int32_t {
+  InternedGpuRenderStageSpecification_RenderStageCategory_OTHER = 0,
+  InternedGpuRenderStageSpecification_RenderStageCategory_GRAPHICS = 1,
+  InternedGpuRenderStageSpecification_RenderStageCategory_COMPUTE = 2,
+};
+
+const InternedGpuRenderStageSpecification_RenderStageCategory InternedGpuRenderStageSpecification_RenderStageCategory_MIN = InternedGpuRenderStageSpecification_RenderStageCategory_OTHER;
+const InternedGpuRenderStageSpecification_RenderStageCategory InternedGpuRenderStageSpecification_RenderStageCategory_MAX = InternedGpuRenderStageSpecification_RenderStageCategory_COMPUTE;
+
+enum InternedGraphicsContext_Api : int32_t {
+  InternedGraphicsContext_Api_UNDEFINED = 0,
+  InternedGraphicsContext_Api_OPEN_GL = 1,
+  InternedGraphicsContext_Api_VULKAN = 2,
+  InternedGraphicsContext_Api_OPEN_CL = 3,
+};
+
+const InternedGraphicsContext_Api InternedGraphicsContext_Api_MIN = InternedGraphicsContext_Api_UNDEFINED;
+const InternedGraphicsContext_Api InternedGraphicsContext_Api_MAX = InternedGraphicsContext_Api_OPEN_CL;
+
+class InternedGpuRenderStageSpecification_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  InternedGpuRenderStageSpecification_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit InternedGpuRenderStageSpecification_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit InternedGpuRenderStageSpecification_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_iid() const { return at<1>().valid(); }
+  uint64_t iid() const { return at<1>().as_uint64(); }
+  bool has_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars name() const { return at<2>().as_string(); }
+  bool has_description() const { return at<3>().valid(); }
+  ::protozero::ConstChars description() const { return at<3>().as_string(); }
+  bool has_category() const { return at<4>().valid(); }
+  int32_t category() const { return at<4>().as_int32(); }
+};
+
+class InternedGpuRenderStageSpecification : public ::protozero::Message {
+ public:
+  using Decoder = InternedGpuRenderStageSpecification_Decoder;
+  enum : int32_t {
+    kIidFieldNumber = 1,
+    kNameFieldNumber = 2,
+    kDescriptionFieldNumber = 3,
+    kCategoryFieldNumber = 4,
+  };
+  using RenderStageCategory = ::perfetto::protos::pbzero::InternedGpuRenderStageSpecification_RenderStageCategory;
+  static const RenderStageCategory OTHER = InternedGpuRenderStageSpecification_RenderStageCategory_OTHER;
+  static const RenderStageCategory GRAPHICS = InternedGpuRenderStageSpecification_RenderStageCategory_GRAPHICS;
+  static const RenderStageCategory COMPUTE = InternedGpuRenderStageSpecification_RenderStageCategory_COMPUTE;
+
+  using FieldMetadata_Iid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      InternedGpuRenderStageSpecification>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Iid kIid() { return {}; }
+  void set_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Iid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      InternedGpuRenderStageSpecification>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Description =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      InternedGpuRenderStageSpecification>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Description kDescription() { return {}; }
+  void set_description(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Description::kFieldId, data, size);
+  }
+  void set_description(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Description::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Category =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::InternedGpuRenderStageSpecification_RenderStageCategory,
+      InternedGpuRenderStageSpecification>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Category kCategory() { return {}; }
+  void set_category(::perfetto::protos::pbzero::InternedGpuRenderStageSpecification_RenderStageCategory value) {
+    static constexpr uint32_t field_id = FieldMetadata_Category::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class InternedGraphicsContext_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  InternedGraphicsContext_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit InternedGraphicsContext_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit InternedGraphicsContext_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_iid() const { return at<1>().valid(); }
+  uint64_t iid() const { return at<1>().as_uint64(); }
+  bool has_pid() const { return at<2>().valid(); }
+  int32_t pid() const { return at<2>().as_int32(); }
+  bool has_api() const { return at<3>().valid(); }
+  int32_t api() const { return at<3>().as_int32(); }
+};
+
+class InternedGraphicsContext : public ::protozero::Message {
+ public:
+  using Decoder = InternedGraphicsContext_Decoder;
+  enum : int32_t {
+    kIidFieldNumber = 1,
+    kPidFieldNumber = 2,
+    kApiFieldNumber = 3,
+  };
+  using Api = ::perfetto::protos::pbzero::InternedGraphicsContext_Api;
+  static const Api UNDEFINED = InternedGraphicsContext_Api_UNDEFINED;
+  static const Api OPEN_GL = InternedGraphicsContext_Api_OPEN_GL;
+  static const Api VULKAN = InternedGraphicsContext_Api_VULKAN;
+  static const Api OPEN_CL = InternedGraphicsContext_Api_OPEN_CL;
+
+  using FieldMetadata_Iid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      InternedGraphicsContext>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Iid kIid() { return {}; }
+  void set_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Iid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      InternedGraphicsContext>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Api =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::InternedGraphicsContext_Api,
+      InternedGraphicsContext>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Api kApi() { return {}; }
+  void set_api(::perfetto::protos::pbzero::InternedGraphicsContext_Api value) {
+    static constexpr uint32_t field_id = FieldMetadata_Api::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class GpuRenderStageEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/15, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  GpuRenderStageEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit GpuRenderStageEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit GpuRenderStageEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_event_id() const { return at<1>().valid(); }
+  uint64_t event_id() const { return at<1>().as_uint64(); }
+  bool has_duration() const { return at<2>().valid(); }
+  uint64_t duration() const { return at<2>().as_uint64(); }
+  bool has_hw_queue_iid() const { return at<13>().valid(); }
+  uint64_t hw_queue_iid() const { return at<13>().as_uint64(); }
+  bool has_stage_iid() const { return at<14>().valid(); }
+  uint64_t stage_iid() const { return at<14>().as_uint64(); }
+  bool has_gpu_id() const { return at<11>().valid(); }
+  int32_t gpu_id() const { return at<11>().as_int32(); }
+  bool has_context() const { return at<5>().valid(); }
+  uint64_t context() const { return at<5>().as_uint64(); }
+  bool has_render_target_handle() const { return at<8>().valid(); }
+  uint64_t render_target_handle() const { return at<8>().as_uint64(); }
+  bool has_submission_id() const { return at<10>().valid(); }
+  uint32_t submission_id() const { return at<10>().as_uint32(); }
+  bool has_extra_data() const { return at<6>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> extra_data() const { return GetRepeated<::protozero::ConstBytes>(6); }
+  bool has_render_pass_handle() const { return at<9>().valid(); }
+  uint64_t render_pass_handle() const { return at<9>().as_uint64(); }
+  bool has_render_subpass_index_mask() const { return at<15>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> render_subpass_index_mask() const { return GetRepeated<uint64_t>(15); }
+  bool has_command_buffer_handle() const { return at<12>().valid(); }
+  uint64_t command_buffer_handle() const { return at<12>().as_uint64(); }
+  bool has_specifications() const { return at<7>().valid(); }
+  ::protozero::ConstBytes specifications() const { return at<7>().as_bytes(); }
+  bool has_hw_queue_id() const { return at<3>().valid(); }
+  int32_t hw_queue_id() const { return at<3>().as_int32(); }
+  bool has_stage_id() const { return at<4>().valid(); }
+  int32_t stage_id() const { return at<4>().as_int32(); }
+};
+
+class GpuRenderStageEvent : public ::protozero::Message {
+ public:
+  using Decoder = GpuRenderStageEvent_Decoder;
+  enum : int32_t {
+    kEventIdFieldNumber = 1,
+    kDurationFieldNumber = 2,
+    kHwQueueIidFieldNumber = 13,
+    kStageIidFieldNumber = 14,
+    kGpuIdFieldNumber = 11,
+    kContextFieldNumber = 5,
+    kRenderTargetHandleFieldNumber = 8,
+    kSubmissionIdFieldNumber = 10,
+    kExtraDataFieldNumber = 6,
+    kRenderPassHandleFieldNumber = 9,
+    kRenderSubpassIndexMaskFieldNumber = 15,
+    kCommandBufferHandleFieldNumber = 12,
+    kSpecificationsFieldNumber = 7,
+    kHwQueueIdFieldNumber = 3,
+    kStageIdFieldNumber = 4,
+  };
+  using ExtraData = ::perfetto::protos::pbzero::GpuRenderStageEvent_ExtraData;
+  using Specifications = ::perfetto::protos::pbzero::GpuRenderStageEvent_Specifications;
+
+  using FieldMetadata_EventId =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      GpuRenderStageEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EventId kEventId() { return {}; }
+  void set_event_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_EventId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Duration =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      GpuRenderStageEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Duration kDuration() { return {}; }
+  void set_duration(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Duration::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HwQueueIid =
+    ::protozero::proto_utils::FieldMetadata<
+      13,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      GpuRenderStageEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HwQueueIid kHwQueueIid() { return {}; }
+  void set_hw_queue_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_HwQueueIid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_StageIid =
+    ::protozero::proto_utils::FieldMetadata<
+      14,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      GpuRenderStageEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StageIid kStageIid() { return {}; }
+  void set_stage_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_StageIid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_GpuId =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      GpuRenderStageEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GpuId kGpuId() { return {}; }
+  void set_gpu_id(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_GpuId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Context =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      GpuRenderStageEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Context kContext() { return {}; }
+  void set_context(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Context::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_RenderTargetHandle =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      GpuRenderStageEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RenderTargetHandle kRenderTargetHandle() { return {}; }
+  void set_render_target_handle(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_RenderTargetHandle::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SubmissionId =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      GpuRenderStageEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SubmissionId kSubmissionId() { return {}; }
+  void set_submission_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SubmissionId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ExtraData =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      GpuRenderStageEvent_ExtraData,
+      GpuRenderStageEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ExtraData kExtraData() { return {}; }
+  template <typename T = GpuRenderStageEvent_ExtraData> T* add_extra_data() {
+    return BeginNestedMessage<T>(6);
+  }
+
+
+  using FieldMetadata_RenderPassHandle =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      GpuRenderStageEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RenderPassHandle kRenderPassHandle() { return {}; }
+  void set_render_pass_handle(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_RenderPassHandle::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_RenderSubpassIndexMask =
+    ::protozero::proto_utils::FieldMetadata<
+      15,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      GpuRenderStageEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RenderSubpassIndexMask kRenderSubpassIndexMask() { return {}; }
+  void add_render_subpass_index_mask(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_RenderSubpassIndexMask::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CommandBufferHandle =
+    ::protozero::proto_utils::FieldMetadata<
+      12,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      GpuRenderStageEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CommandBufferHandle kCommandBufferHandle() { return {}; }
+  void set_command_buffer_handle(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CommandBufferHandle::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Specifications =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      GpuRenderStageEvent_Specifications,
+      GpuRenderStageEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Specifications kSpecifications() { return {}; }
+  template <typename T = GpuRenderStageEvent_Specifications> T* set_specifications() {
+    return BeginNestedMessage<T>(7);
+  }
+
+
+  using FieldMetadata_HwQueueId =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      GpuRenderStageEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HwQueueId kHwQueueId() { return {}; }
+  void set_hw_queue_id(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_HwQueueId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_StageId =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      GpuRenderStageEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StageId kStageId() { return {}; }
+  void set_stage_id(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_StageId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class GpuRenderStageEvent_Specifications_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  GpuRenderStageEvent_Specifications_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit GpuRenderStageEvent_Specifications_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit GpuRenderStageEvent_Specifications_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_context_spec() const { return at<1>().valid(); }
+  ::protozero::ConstBytes context_spec() const { return at<1>().as_bytes(); }
+  bool has_hw_queue() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> hw_queue() const { return GetRepeated<::protozero::ConstBytes>(2); }
+  bool has_stage() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> stage() const { return GetRepeated<::protozero::ConstBytes>(3); }
+};
+
+class GpuRenderStageEvent_Specifications : public ::protozero::Message {
+ public:
+  using Decoder = GpuRenderStageEvent_Specifications_Decoder;
+  enum : int32_t {
+    kContextSpecFieldNumber = 1,
+    kHwQueueFieldNumber = 2,
+    kStageFieldNumber = 3,
+  };
+  using ContextSpec = ::perfetto::protos::pbzero::GpuRenderStageEvent_Specifications_ContextSpec;
+  using Description = ::perfetto::protos::pbzero::GpuRenderStageEvent_Specifications_Description;
+
+  using FieldMetadata_ContextSpec =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      GpuRenderStageEvent_Specifications_ContextSpec,
+      GpuRenderStageEvent_Specifications>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ContextSpec kContextSpec() { return {}; }
+  template <typename T = GpuRenderStageEvent_Specifications_ContextSpec> T* set_context_spec() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_HwQueue =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      GpuRenderStageEvent_Specifications_Description,
+      GpuRenderStageEvent_Specifications>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HwQueue kHwQueue() { return {}; }
+  template <typename T = GpuRenderStageEvent_Specifications_Description> T* add_hw_queue() {
+    return BeginNestedMessage<T>(2);
+  }
+
+
+  using FieldMetadata_Stage =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      GpuRenderStageEvent_Specifications_Description,
+      GpuRenderStageEvent_Specifications>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Stage kStage() { return {}; }
+  template <typename T = GpuRenderStageEvent_Specifications_Description> T* add_stage() {
+    return BeginNestedMessage<T>(3);
+  }
+
+};
+
+class GpuRenderStageEvent_Specifications_Description_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  GpuRenderStageEvent_Specifications_Description_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit GpuRenderStageEvent_Specifications_Description_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit GpuRenderStageEvent_Specifications_Description_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_description() const { return at<2>().valid(); }
+  ::protozero::ConstChars description() const { return at<2>().as_string(); }
+};
+
+class GpuRenderStageEvent_Specifications_Description : public ::protozero::Message {
+ public:
+  using Decoder = GpuRenderStageEvent_Specifications_Description_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kDescriptionFieldNumber = 2,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      GpuRenderStageEvent_Specifications_Description>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Description =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      GpuRenderStageEvent_Specifications_Description>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Description kDescription() { return {}; }
+  void set_description(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Description::kFieldId, data, size);
+  }
+  void set_description(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Description::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class GpuRenderStageEvent_Specifications_ContextSpec_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  GpuRenderStageEvent_Specifications_ContextSpec_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit GpuRenderStageEvent_Specifications_ContextSpec_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit GpuRenderStageEvent_Specifications_ContextSpec_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_context() const { return at<1>().valid(); }
+  uint64_t context() const { return at<1>().as_uint64(); }
+  bool has_pid() const { return at<2>().valid(); }
+  int32_t pid() const { return at<2>().as_int32(); }
+};
+
+class GpuRenderStageEvent_Specifications_ContextSpec : public ::protozero::Message {
+ public:
+  using Decoder = GpuRenderStageEvent_Specifications_ContextSpec_Decoder;
+  enum : int32_t {
+    kContextFieldNumber = 1,
+    kPidFieldNumber = 2,
+  };
+
+  using FieldMetadata_Context =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      GpuRenderStageEvent_Specifications_ContextSpec>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Context kContext() { return {}; }
+  void set_context(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Context::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      GpuRenderStageEvent_Specifications_ContextSpec>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class GpuRenderStageEvent_ExtraData_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  GpuRenderStageEvent_ExtraData_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit GpuRenderStageEvent_ExtraData_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit GpuRenderStageEvent_ExtraData_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_value() const { return at<2>().valid(); }
+  ::protozero::ConstChars value() const { return at<2>().as_string(); }
+};
+
+class GpuRenderStageEvent_ExtraData : public ::protozero::Message {
+ public:
+  using Decoder = GpuRenderStageEvent_ExtraData_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kValueFieldNumber = 2,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      GpuRenderStageEvent_ExtraData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Value =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      GpuRenderStageEvent_ExtraData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Value kValue() { return {}; }
+  void set_value(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Value::kFieldId, data, size);
+  }
+  void set_value(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Value::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/gpu/vulkan_api_event.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_GPU_VULKAN_API_EVENT_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_GPU_VULKAN_API_EVENT_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class VulkanApiEvent_VkDebugUtilsObjectName;
+class VulkanApiEvent_VkQueueSubmit;
+
+class VulkanApiEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  VulkanApiEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit VulkanApiEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit VulkanApiEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_vk_debug_utils_object_name() const { return at<1>().valid(); }
+  ::protozero::ConstBytes vk_debug_utils_object_name() const { return at<1>().as_bytes(); }
+  bool has_vk_queue_submit() const { return at<2>().valid(); }
+  ::protozero::ConstBytes vk_queue_submit() const { return at<2>().as_bytes(); }
+};
+
+class VulkanApiEvent : public ::protozero::Message {
+ public:
+  using Decoder = VulkanApiEvent_Decoder;
+  enum : int32_t {
+    kVkDebugUtilsObjectNameFieldNumber = 1,
+    kVkQueueSubmitFieldNumber = 2,
+  };
+  using VkDebugUtilsObjectName = ::perfetto::protos::pbzero::VulkanApiEvent_VkDebugUtilsObjectName;
+  using VkQueueSubmit = ::perfetto::protos::pbzero::VulkanApiEvent_VkQueueSubmit;
+
+  using FieldMetadata_VkDebugUtilsObjectName =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      VulkanApiEvent_VkDebugUtilsObjectName,
+      VulkanApiEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_VkDebugUtilsObjectName kVkDebugUtilsObjectName() { return {}; }
+  template <typename T = VulkanApiEvent_VkDebugUtilsObjectName> T* set_vk_debug_utils_object_name() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_VkQueueSubmit =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      VulkanApiEvent_VkQueueSubmit,
+      VulkanApiEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_VkQueueSubmit kVkQueueSubmit() { return {}; }
+  template <typename T = VulkanApiEvent_VkQueueSubmit> T* set_vk_queue_submit() {
+    return BeginNestedMessage<T>(2);
+  }
+
+};
+
+class VulkanApiEvent_VkQueueSubmit_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  VulkanApiEvent_VkQueueSubmit_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit VulkanApiEvent_VkQueueSubmit_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit VulkanApiEvent_VkQueueSubmit_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_duration_ns() const { return at<1>().valid(); }
+  uint64_t duration_ns() const { return at<1>().as_uint64(); }
+  bool has_pid() const { return at<2>().valid(); }
+  uint32_t pid() const { return at<2>().as_uint32(); }
+  bool has_tid() const { return at<3>().valid(); }
+  uint32_t tid() const { return at<3>().as_uint32(); }
+  bool has_vk_queue() const { return at<4>().valid(); }
+  uint64_t vk_queue() const { return at<4>().as_uint64(); }
+  bool has_vk_command_buffers() const { return at<5>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> vk_command_buffers() const { return GetRepeated<uint64_t>(5); }
+  bool has_submission_id() const { return at<6>().valid(); }
+  uint32_t submission_id() const { return at<6>().as_uint32(); }
+};
+
+class VulkanApiEvent_VkQueueSubmit : public ::protozero::Message {
+ public:
+  using Decoder = VulkanApiEvent_VkQueueSubmit_Decoder;
+  enum : int32_t {
+    kDurationNsFieldNumber = 1,
+    kPidFieldNumber = 2,
+    kTidFieldNumber = 3,
+    kVkQueueFieldNumber = 4,
+    kVkCommandBuffersFieldNumber = 5,
+    kSubmissionIdFieldNumber = 6,
+  };
+
+  using FieldMetadata_DurationNs =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      VulkanApiEvent_VkQueueSubmit>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DurationNs kDurationNs() { return {}; }
+  void set_duration_ns(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DurationNs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      VulkanApiEvent_VkQueueSubmit>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Tid =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      VulkanApiEvent_VkQueueSubmit>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Tid kTid() { return {}; }
+  void set_tid(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Tid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_VkQueue =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      VulkanApiEvent_VkQueueSubmit>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_VkQueue kVkQueue() { return {}; }
+  void set_vk_queue(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_VkQueue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_VkCommandBuffers =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      VulkanApiEvent_VkQueueSubmit>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_VkCommandBuffers kVkCommandBuffers() { return {}; }
+  void add_vk_command_buffers(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_VkCommandBuffers::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SubmissionId =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      VulkanApiEvent_VkQueueSubmit>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SubmissionId kSubmissionId() { return {}; }
+  void set_submission_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SubmissionId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class VulkanApiEvent_VkDebugUtilsObjectName_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  VulkanApiEvent_VkDebugUtilsObjectName_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit VulkanApiEvent_VkDebugUtilsObjectName_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit VulkanApiEvent_VkDebugUtilsObjectName_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_pid() const { return at<1>().valid(); }
+  uint32_t pid() const { return at<1>().as_uint32(); }
+  bool has_vk_device() const { return at<2>().valid(); }
+  uint64_t vk_device() const { return at<2>().as_uint64(); }
+  bool has_object_type() const { return at<3>().valid(); }
+  int32_t object_type() const { return at<3>().as_int32(); }
+  bool has_object() const { return at<4>().valid(); }
+  uint64_t object() const { return at<4>().as_uint64(); }
+  bool has_object_name() const { return at<5>().valid(); }
+  ::protozero::ConstChars object_name() const { return at<5>().as_string(); }
+};
+
+class VulkanApiEvent_VkDebugUtilsObjectName : public ::protozero::Message {
+ public:
+  using Decoder = VulkanApiEvent_VkDebugUtilsObjectName_Decoder;
+  enum : int32_t {
+    kPidFieldNumber = 1,
+    kVkDeviceFieldNumber = 2,
+    kObjectTypeFieldNumber = 3,
+    kObjectFieldNumber = 4,
+    kObjectNameFieldNumber = 5,
+  };
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      VulkanApiEvent_VkDebugUtilsObjectName>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_VkDevice =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      VulkanApiEvent_VkDebugUtilsObjectName>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_VkDevice kVkDevice() { return {}; }
+  void set_vk_device(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_VkDevice::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ObjectType =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      VulkanApiEvent_VkDebugUtilsObjectName>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ObjectType kObjectType() { return {}; }
+  void set_object_type(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ObjectType::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Object =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      VulkanApiEvent_VkDebugUtilsObjectName>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Object kObject() { return {}; }
+  void set_object(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Object::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ObjectName =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      VulkanApiEvent_VkDebugUtilsObjectName>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ObjectName kObjectName() { return {}; }
+  void set_object_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ObjectName::kFieldId, data, size);
+  }
+  void set_object_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ObjectName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/gpu/vulkan_memory_event.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_GPU_VULKAN_MEMORY_EVENT_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_GPU_VULKAN_MEMORY_EVENT_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class VulkanMemoryEventAnnotation;
+enum VulkanMemoryEvent_AllocationScope : int32_t;
+enum VulkanMemoryEvent_Operation : int32_t;
+enum VulkanMemoryEvent_Source : int32_t;
+
+enum VulkanMemoryEvent_Source : int32_t {
+  VulkanMemoryEvent_Source_SOURCE_UNSPECIFIED = 0,
+  VulkanMemoryEvent_Source_SOURCE_DRIVER = 1,
+  VulkanMemoryEvent_Source_SOURCE_DEVICE = 2,
+  VulkanMemoryEvent_Source_SOURCE_DEVICE_MEMORY = 3,
+  VulkanMemoryEvent_Source_SOURCE_BUFFER = 4,
+  VulkanMemoryEvent_Source_SOURCE_IMAGE = 5,
+};
+
+const VulkanMemoryEvent_Source VulkanMemoryEvent_Source_MIN = VulkanMemoryEvent_Source_SOURCE_UNSPECIFIED;
+const VulkanMemoryEvent_Source VulkanMemoryEvent_Source_MAX = VulkanMemoryEvent_Source_SOURCE_IMAGE;
+
+enum VulkanMemoryEvent_Operation : int32_t {
+  VulkanMemoryEvent_Operation_OP_UNSPECIFIED = 0,
+  VulkanMemoryEvent_Operation_OP_CREATE = 1,
+  VulkanMemoryEvent_Operation_OP_DESTROY = 2,
+  VulkanMemoryEvent_Operation_OP_BIND = 3,
+  VulkanMemoryEvent_Operation_OP_DESTROY_BOUND = 4,
+  VulkanMemoryEvent_Operation_OP_ANNOTATIONS = 5,
+};
+
+const VulkanMemoryEvent_Operation VulkanMemoryEvent_Operation_MIN = VulkanMemoryEvent_Operation_OP_UNSPECIFIED;
+const VulkanMemoryEvent_Operation VulkanMemoryEvent_Operation_MAX = VulkanMemoryEvent_Operation_OP_ANNOTATIONS;
+
+enum VulkanMemoryEvent_AllocationScope : int32_t {
+  VulkanMemoryEvent_AllocationScope_SCOPE_UNSPECIFIED = 0,
+  VulkanMemoryEvent_AllocationScope_SCOPE_COMMAND = 1,
+  VulkanMemoryEvent_AllocationScope_SCOPE_OBJECT = 2,
+  VulkanMemoryEvent_AllocationScope_SCOPE_CACHE = 3,
+  VulkanMemoryEvent_AllocationScope_SCOPE_DEVICE = 4,
+  VulkanMemoryEvent_AllocationScope_SCOPE_INSTANCE = 5,
+};
+
+const VulkanMemoryEvent_AllocationScope VulkanMemoryEvent_AllocationScope_MIN = VulkanMemoryEvent_AllocationScope_SCOPE_UNSPECIFIED;
+const VulkanMemoryEvent_AllocationScope VulkanMemoryEvent_AllocationScope_MAX = VulkanMemoryEvent_AllocationScope_SCOPE_INSTANCE;
+
+class VulkanMemoryEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/20, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  VulkanMemoryEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit VulkanMemoryEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit VulkanMemoryEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_source() const { return at<1>().valid(); }
+  int32_t source() const { return at<1>().as_int32(); }
+  bool has_operation() const { return at<2>().valid(); }
+  int32_t operation() const { return at<2>().as_int32(); }
+  bool has_timestamp() const { return at<3>().valid(); }
+  int64_t timestamp() const { return at<3>().as_int64(); }
+  bool has_pid() const { return at<4>().valid(); }
+  uint32_t pid() const { return at<4>().as_uint32(); }
+  bool has_memory_address() const { return at<5>().valid(); }
+  uint64_t memory_address() const { return at<5>().as_uint64(); }
+  bool has_memory_size() const { return at<6>().valid(); }
+  uint64_t memory_size() const { return at<6>().as_uint64(); }
+  bool has_caller_iid() const { return at<7>().valid(); }
+  uint64_t caller_iid() const { return at<7>().as_uint64(); }
+  bool has_allocation_scope() const { return at<8>().valid(); }
+  int32_t allocation_scope() const { return at<8>().as_int32(); }
+  bool has_annotations() const { return at<9>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> annotations() const { return GetRepeated<::protozero::ConstBytes>(9); }
+  bool has_device() const { return at<16>().valid(); }
+  uint64_t device() const { return at<16>().as_uint64(); }
+  bool has_device_memory() const { return at<17>().valid(); }
+  uint64_t device_memory() const { return at<17>().as_uint64(); }
+  bool has_memory_type() const { return at<18>().valid(); }
+  uint32_t memory_type() const { return at<18>().as_uint32(); }
+  bool has_heap() const { return at<19>().valid(); }
+  uint32_t heap() const { return at<19>().as_uint32(); }
+  bool has_object_handle() const { return at<20>().valid(); }
+  uint64_t object_handle() const { return at<20>().as_uint64(); }
+};
+
+class VulkanMemoryEvent : public ::protozero::Message {
+ public:
+  using Decoder = VulkanMemoryEvent_Decoder;
+  enum : int32_t {
+    kSourceFieldNumber = 1,
+    kOperationFieldNumber = 2,
+    kTimestampFieldNumber = 3,
+    kPidFieldNumber = 4,
+    kMemoryAddressFieldNumber = 5,
+    kMemorySizeFieldNumber = 6,
+    kCallerIidFieldNumber = 7,
+    kAllocationScopeFieldNumber = 8,
+    kAnnotationsFieldNumber = 9,
+    kDeviceFieldNumber = 16,
+    kDeviceMemoryFieldNumber = 17,
+    kMemoryTypeFieldNumber = 18,
+    kHeapFieldNumber = 19,
+    kObjectHandleFieldNumber = 20,
+  };
+  using Source = ::perfetto::protos::pbzero::VulkanMemoryEvent_Source;
+  using Operation = ::perfetto::protos::pbzero::VulkanMemoryEvent_Operation;
+  using AllocationScope = ::perfetto::protos::pbzero::VulkanMemoryEvent_AllocationScope;
+  static const Source SOURCE_UNSPECIFIED = VulkanMemoryEvent_Source_SOURCE_UNSPECIFIED;
+  static const Source SOURCE_DRIVER = VulkanMemoryEvent_Source_SOURCE_DRIVER;
+  static const Source SOURCE_DEVICE = VulkanMemoryEvent_Source_SOURCE_DEVICE;
+  static const Source SOURCE_DEVICE_MEMORY = VulkanMemoryEvent_Source_SOURCE_DEVICE_MEMORY;
+  static const Source SOURCE_BUFFER = VulkanMemoryEvent_Source_SOURCE_BUFFER;
+  static const Source SOURCE_IMAGE = VulkanMemoryEvent_Source_SOURCE_IMAGE;
+  static const Operation OP_UNSPECIFIED = VulkanMemoryEvent_Operation_OP_UNSPECIFIED;
+  static const Operation OP_CREATE = VulkanMemoryEvent_Operation_OP_CREATE;
+  static const Operation OP_DESTROY = VulkanMemoryEvent_Operation_OP_DESTROY;
+  static const Operation OP_BIND = VulkanMemoryEvent_Operation_OP_BIND;
+  static const Operation OP_DESTROY_BOUND = VulkanMemoryEvent_Operation_OP_DESTROY_BOUND;
+  static const Operation OP_ANNOTATIONS = VulkanMemoryEvent_Operation_OP_ANNOTATIONS;
+  static const AllocationScope SCOPE_UNSPECIFIED = VulkanMemoryEvent_AllocationScope_SCOPE_UNSPECIFIED;
+  static const AllocationScope SCOPE_COMMAND = VulkanMemoryEvent_AllocationScope_SCOPE_COMMAND;
+  static const AllocationScope SCOPE_OBJECT = VulkanMemoryEvent_AllocationScope_SCOPE_OBJECT;
+  static const AllocationScope SCOPE_CACHE = VulkanMemoryEvent_AllocationScope_SCOPE_CACHE;
+  static const AllocationScope SCOPE_DEVICE = VulkanMemoryEvent_AllocationScope_SCOPE_DEVICE;
+  static const AllocationScope SCOPE_INSTANCE = VulkanMemoryEvent_AllocationScope_SCOPE_INSTANCE;
+
+  using FieldMetadata_Source =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::VulkanMemoryEvent_Source,
+      VulkanMemoryEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Source kSource() { return {}; }
+  void set_source(::perfetto::protos::pbzero::VulkanMemoryEvent_Source value) {
+    static constexpr uint32_t field_id = FieldMetadata_Source::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Operation =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::VulkanMemoryEvent_Operation,
+      VulkanMemoryEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Operation kOperation() { return {}; }
+  void set_operation(::perfetto::protos::pbzero::VulkanMemoryEvent_Operation value) {
+    static constexpr uint32_t field_id = FieldMetadata_Operation::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Timestamp =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      VulkanMemoryEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Timestamp kTimestamp() { return {}; }
+  void set_timestamp(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Timestamp::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      VulkanMemoryEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MemoryAddress =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kFixed64,
+      uint64_t,
+      VulkanMemoryEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MemoryAddress kMemoryAddress() { return {}; }
+  void set_memory_address(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MemoryAddress::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kFixed64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MemorySize =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      VulkanMemoryEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MemorySize kMemorySize() { return {}; }
+  void set_memory_size(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MemorySize::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CallerIid =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      VulkanMemoryEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CallerIid kCallerIid() { return {}; }
+  void set_caller_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CallerIid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_AllocationScope =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::VulkanMemoryEvent_AllocationScope,
+      VulkanMemoryEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AllocationScope kAllocationScope() { return {}; }
+  void set_allocation_scope(::perfetto::protos::pbzero::VulkanMemoryEvent_AllocationScope value) {
+    static constexpr uint32_t field_id = FieldMetadata_AllocationScope::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Annotations =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      VulkanMemoryEventAnnotation,
+      VulkanMemoryEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Annotations kAnnotations() { return {}; }
+  template <typename T = VulkanMemoryEventAnnotation> T* add_annotations() {
+    return BeginNestedMessage<T>(9);
+  }
+
+
+  using FieldMetadata_Device =
+    ::protozero::proto_utils::FieldMetadata<
+      16,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kFixed64,
+      uint64_t,
+      VulkanMemoryEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Device kDevice() { return {}; }
+  void set_device(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Device::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kFixed64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DeviceMemory =
+    ::protozero::proto_utils::FieldMetadata<
+      17,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kFixed64,
+      uint64_t,
+      VulkanMemoryEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DeviceMemory kDeviceMemory() { return {}; }
+  void set_device_memory(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DeviceMemory::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kFixed64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MemoryType =
+    ::protozero::proto_utils::FieldMetadata<
+      18,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      VulkanMemoryEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MemoryType kMemoryType() { return {}; }
+  void set_memory_type(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MemoryType::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Heap =
+    ::protozero::proto_utils::FieldMetadata<
+      19,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      VulkanMemoryEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Heap kHeap() { return {}; }
+  void set_heap(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Heap::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ObjectHandle =
+    ::protozero::proto_utils::FieldMetadata<
+      20,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kFixed64,
+      uint64_t,
+      VulkanMemoryEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ObjectHandle kObjectHandle() { return {}; }
+  void set_object_handle(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ObjectHandle::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kFixed64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class VulkanMemoryEventAnnotation_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  VulkanMemoryEventAnnotation_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit VulkanMemoryEventAnnotation_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit VulkanMemoryEventAnnotation_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_key_iid() const { return at<1>().valid(); }
+  uint64_t key_iid() const { return at<1>().as_uint64(); }
+  bool has_int_value() const { return at<2>().valid(); }
+  int64_t int_value() const { return at<2>().as_int64(); }
+  bool has_double_value() const { return at<3>().valid(); }
+  double double_value() const { return at<3>().as_double(); }
+  bool has_string_iid() const { return at<4>().valid(); }
+  uint64_t string_iid() const { return at<4>().as_uint64(); }
+};
+
+class VulkanMemoryEventAnnotation : public ::protozero::Message {
+ public:
+  using Decoder = VulkanMemoryEventAnnotation_Decoder;
+  enum : int32_t {
+    kKeyIidFieldNumber = 1,
+    kIntValueFieldNumber = 2,
+    kDoubleValueFieldNumber = 3,
+    kStringIidFieldNumber = 4,
+  };
+
+  using FieldMetadata_KeyIid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      VulkanMemoryEventAnnotation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_KeyIid kKeyIid() { return {}; }
+  void set_key_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_KeyIid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IntValue =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      VulkanMemoryEventAnnotation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IntValue kIntValue() { return {}; }
+  void set_int_value(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IntValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DoubleValue =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kDouble,
+      double,
+      VulkanMemoryEventAnnotation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DoubleValue kDoubleValue() { return {}; }
+  void set_double_value(double value) {
+    static constexpr uint32_t field_id = FieldMetadata_DoubleValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kDouble>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_StringIid =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      VulkanMemoryEventAnnotation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StringIid kStringIid() { return {}; }
+  void set_string_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_StringIid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/profiling/deobfuscation.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_DEOBFUSCATION_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_DEOBFUSCATION_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class ObfuscatedClass;
+class ObfuscatedMember;
+
+class DeobfuscationMapping_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  DeobfuscationMapping_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit DeobfuscationMapping_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit DeobfuscationMapping_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_package_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars package_name() const { return at<1>().as_string(); }
+  bool has_version_code() const { return at<2>().valid(); }
+  int64_t version_code() const { return at<2>().as_int64(); }
+  bool has_obfuscated_classes() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> obfuscated_classes() const { return GetRepeated<::protozero::ConstBytes>(3); }
+};
+
+class DeobfuscationMapping : public ::protozero::Message {
+ public:
+  using Decoder = DeobfuscationMapping_Decoder;
+  enum : int32_t {
+    kPackageNameFieldNumber = 1,
+    kVersionCodeFieldNumber = 2,
+    kObfuscatedClassesFieldNumber = 3,
+  };
+
+  using FieldMetadata_PackageName =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      DeobfuscationMapping>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PackageName kPackageName() { return {}; }
+  void set_package_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_PackageName::kFieldId, data, size);
+  }
+  void set_package_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_PackageName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_VersionCode =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      DeobfuscationMapping>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_VersionCode kVersionCode() { return {}; }
+  void set_version_code(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_VersionCode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ObfuscatedClasses =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ObfuscatedClass,
+      DeobfuscationMapping>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ObfuscatedClasses kObfuscatedClasses() { return {}; }
+  template <typename T = ObfuscatedClass> T* add_obfuscated_classes() {
+    return BeginNestedMessage<T>(3);
+  }
+
+};
+
+class ObfuscatedClass_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  ObfuscatedClass_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ObfuscatedClass_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ObfuscatedClass_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_obfuscated_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars obfuscated_name() const { return at<1>().as_string(); }
+  bool has_deobfuscated_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars deobfuscated_name() const { return at<2>().as_string(); }
+  bool has_obfuscated_members() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> obfuscated_members() const { return GetRepeated<::protozero::ConstBytes>(3); }
+  bool has_obfuscated_methods() const { return at<4>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> obfuscated_methods() const { return GetRepeated<::protozero::ConstBytes>(4); }
+};
+
+class ObfuscatedClass : public ::protozero::Message {
+ public:
+  using Decoder = ObfuscatedClass_Decoder;
+  enum : int32_t {
+    kObfuscatedNameFieldNumber = 1,
+    kDeobfuscatedNameFieldNumber = 2,
+    kObfuscatedMembersFieldNumber = 3,
+    kObfuscatedMethodsFieldNumber = 4,
+  };
+
+  using FieldMetadata_ObfuscatedName =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ObfuscatedClass>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ObfuscatedName kObfuscatedName() { return {}; }
+  void set_obfuscated_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ObfuscatedName::kFieldId, data, size);
+  }
+  void set_obfuscated_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ObfuscatedName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DeobfuscatedName =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ObfuscatedClass>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DeobfuscatedName kDeobfuscatedName() { return {}; }
+  void set_deobfuscated_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_DeobfuscatedName::kFieldId, data, size);
+  }
+  void set_deobfuscated_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_DeobfuscatedName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ObfuscatedMembers =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ObfuscatedMember,
+      ObfuscatedClass>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ObfuscatedMembers kObfuscatedMembers() { return {}; }
+  template <typename T = ObfuscatedMember> T* add_obfuscated_members() {
+    return BeginNestedMessage<T>(3);
+  }
+
+
+  using FieldMetadata_ObfuscatedMethods =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ObfuscatedMember,
+      ObfuscatedClass>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ObfuscatedMethods kObfuscatedMethods() { return {}; }
+  template <typename T = ObfuscatedMember> T* add_obfuscated_methods() {
+    return BeginNestedMessage<T>(4);
+  }
+
+};
+
+class ObfuscatedMember_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ObfuscatedMember_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ObfuscatedMember_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ObfuscatedMember_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_obfuscated_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars obfuscated_name() const { return at<1>().as_string(); }
+  bool has_deobfuscated_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars deobfuscated_name() const { return at<2>().as_string(); }
+};
+
+class ObfuscatedMember : public ::protozero::Message {
+ public:
+  using Decoder = ObfuscatedMember_Decoder;
+  enum : int32_t {
+    kObfuscatedNameFieldNumber = 1,
+    kDeobfuscatedNameFieldNumber = 2,
+  };
+
+  using FieldMetadata_ObfuscatedName =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ObfuscatedMember>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ObfuscatedName kObfuscatedName() { return {}; }
+  void set_obfuscated_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ObfuscatedName::kFieldId, data, size);
+  }
+  void set_obfuscated_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ObfuscatedName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DeobfuscatedName =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ObfuscatedMember>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DeobfuscatedName kDeobfuscatedName() { return {}; }
+  void set_deobfuscated_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_DeobfuscatedName::kFieldId, data, size);
+  }
+  void set_deobfuscated_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_DeobfuscatedName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/profiling/heap_graph.pbzero.h
+// gen_amalgamated begin header: gen/protos/perfetto/trace/profiling/deobfuscation.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_DEOBFUSCATION_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_DEOBFUSCATION_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class ObfuscatedClass;
+class ObfuscatedMember;
+
+class DeobfuscationMapping_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  DeobfuscationMapping_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit DeobfuscationMapping_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit DeobfuscationMapping_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_package_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars package_name() const { return at<1>().as_string(); }
+  bool has_version_code() const { return at<2>().valid(); }
+  int64_t version_code() const { return at<2>().as_int64(); }
+  bool has_obfuscated_classes() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> obfuscated_classes() const { return GetRepeated<::protozero::ConstBytes>(3); }
+};
+
+class DeobfuscationMapping : public ::protozero::Message {
+ public:
+  using Decoder = DeobfuscationMapping_Decoder;
+  enum : int32_t {
+    kPackageNameFieldNumber = 1,
+    kVersionCodeFieldNumber = 2,
+    kObfuscatedClassesFieldNumber = 3,
+  };
+
+  using FieldMetadata_PackageName =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      DeobfuscationMapping>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PackageName kPackageName() { return {}; }
+  void set_package_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_PackageName::kFieldId, data, size);
+  }
+  void set_package_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_PackageName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_VersionCode =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      DeobfuscationMapping>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_VersionCode kVersionCode() { return {}; }
+  void set_version_code(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_VersionCode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ObfuscatedClasses =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ObfuscatedClass,
+      DeobfuscationMapping>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ObfuscatedClasses kObfuscatedClasses() { return {}; }
+  template <typename T = ObfuscatedClass> T* add_obfuscated_classes() {
+    return BeginNestedMessage<T>(3);
+  }
+
+};
+
+class ObfuscatedClass_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  ObfuscatedClass_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ObfuscatedClass_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ObfuscatedClass_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_obfuscated_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars obfuscated_name() const { return at<1>().as_string(); }
+  bool has_deobfuscated_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars deobfuscated_name() const { return at<2>().as_string(); }
+  bool has_obfuscated_members() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> obfuscated_members() const { return GetRepeated<::protozero::ConstBytes>(3); }
+  bool has_obfuscated_methods() const { return at<4>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> obfuscated_methods() const { return GetRepeated<::protozero::ConstBytes>(4); }
+};
+
+class ObfuscatedClass : public ::protozero::Message {
+ public:
+  using Decoder = ObfuscatedClass_Decoder;
+  enum : int32_t {
+    kObfuscatedNameFieldNumber = 1,
+    kDeobfuscatedNameFieldNumber = 2,
+    kObfuscatedMembersFieldNumber = 3,
+    kObfuscatedMethodsFieldNumber = 4,
+  };
+
+  using FieldMetadata_ObfuscatedName =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ObfuscatedClass>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ObfuscatedName kObfuscatedName() { return {}; }
+  void set_obfuscated_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ObfuscatedName::kFieldId, data, size);
+  }
+  void set_obfuscated_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ObfuscatedName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DeobfuscatedName =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ObfuscatedClass>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DeobfuscatedName kDeobfuscatedName() { return {}; }
+  void set_deobfuscated_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_DeobfuscatedName::kFieldId, data, size);
+  }
+  void set_deobfuscated_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_DeobfuscatedName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ObfuscatedMembers =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ObfuscatedMember,
+      ObfuscatedClass>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ObfuscatedMembers kObfuscatedMembers() { return {}; }
+  template <typename T = ObfuscatedMember> T* add_obfuscated_members() {
+    return BeginNestedMessage<T>(3);
+  }
+
+
+  using FieldMetadata_ObfuscatedMethods =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ObfuscatedMember,
+      ObfuscatedClass>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ObfuscatedMethods kObfuscatedMethods() { return {}; }
+  template <typename T = ObfuscatedMember> T* add_obfuscated_methods() {
+    return BeginNestedMessage<T>(4);
+  }
+
+};
+
+class ObfuscatedMember_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ObfuscatedMember_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ObfuscatedMember_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ObfuscatedMember_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_obfuscated_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars obfuscated_name() const { return at<1>().as_string(); }
+  bool has_deobfuscated_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars deobfuscated_name() const { return at<2>().as_string(); }
+};
+
+class ObfuscatedMember : public ::protozero::Message {
+ public:
+  using Decoder = ObfuscatedMember_Decoder;
+  enum : int32_t {
+    kObfuscatedNameFieldNumber = 1,
+    kDeobfuscatedNameFieldNumber = 2,
+  };
+
+  using FieldMetadata_ObfuscatedName =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ObfuscatedMember>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ObfuscatedName kObfuscatedName() { return {}; }
+  void set_obfuscated_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ObfuscatedName::kFieldId, data, size);
+  }
+  void set_obfuscated_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ObfuscatedName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DeobfuscatedName =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ObfuscatedMember>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DeobfuscatedName kDeobfuscatedName() { return {}; }
+  void set_deobfuscated_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_DeobfuscatedName::kFieldId, data, size);
+  }
+  void set_deobfuscated_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_DeobfuscatedName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_HEAP_GRAPH_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_HEAP_GRAPH_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/profiling/deobfuscation.pbzero.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class HeapGraphObject;
+class HeapGraphRoot;
+class HeapGraphType;
+class InternedString;
+enum HeapGraphRoot_Type : int32_t;
+enum HeapGraphType_Kind : int32_t;
+
+enum HeapGraphType_Kind : int32_t {
+  HeapGraphType_Kind_KIND_UNKNOWN = 0,
+  HeapGraphType_Kind_KIND_NORMAL = 1,
+  HeapGraphType_Kind_KIND_NOREFERENCES = 2,
+  HeapGraphType_Kind_KIND_STRING = 3,
+  HeapGraphType_Kind_KIND_ARRAY = 4,
+  HeapGraphType_Kind_KIND_CLASS = 5,
+  HeapGraphType_Kind_KIND_CLASSLOADER = 6,
+  HeapGraphType_Kind_KIND_DEXCACHE = 7,
+  HeapGraphType_Kind_KIND_SOFT_REFERENCE = 8,
+  HeapGraphType_Kind_KIND_WEAK_REFERENCE = 9,
+  HeapGraphType_Kind_KIND_FINALIZER_REFERENCE = 10,
+  HeapGraphType_Kind_KIND_PHANTOM_REFERENCE = 11,
+};
+
+const HeapGraphType_Kind HeapGraphType_Kind_MIN = HeapGraphType_Kind_KIND_UNKNOWN;
+const HeapGraphType_Kind HeapGraphType_Kind_MAX = HeapGraphType_Kind_KIND_PHANTOM_REFERENCE;
+
+enum HeapGraphRoot_Type : int32_t {
+  HeapGraphRoot_Type_ROOT_UNKNOWN = 0,
+  HeapGraphRoot_Type_ROOT_JNI_GLOBAL = 1,
+  HeapGraphRoot_Type_ROOT_JNI_LOCAL = 2,
+  HeapGraphRoot_Type_ROOT_JAVA_FRAME = 3,
+  HeapGraphRoot_Type_ROOT_NATIVE_STACK = 4,
+  HeapGraphRoot_Type_ROOT_STICKY_CLASS = 5,
+  HeapGraphRoot_Type_ROOT_THREAD_BLOCK = 6,
+  HeapGraphRoot_Type_ROOT_MONITOR_USED = 7,
+  HeapGraphRoot_Type_ROOT_THREAD_OBJECT = 8,
+  HeapGraphRoot_Type_ROOT_INTERNED_STRING = 9,
+  HeapGraphRoot_Type_ROOT_FINALIZING = 10,
+  HeapGraphRoot_Type_ROOT_DEBUGGER = 11,
+  HeapGraphRoot_Type_ROOT_REFERENCE_CLEANUP = 12,
+  HeapGraphRoot_Type_ROOT_VM_INTERNAL = 13,
+  HeapGraphRoot_Type_ROOT_JNI_MONITOR = 14,
+};
+
+const HeapGraphRoot_Type HeapGraphRoot_Type_MIN = HeapGraphRoot_Type_ROOT_UNKNOWN;
+const HeapGraphRoot_Type HeapGraphRoot_Type_MAX = HeapGraphRoot_Type_ROOT_JNI_MONITOR;
+
+class HeapGraph_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/9, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  HeapGraph_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit HeapGraph_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit HeapGraph_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_pid() const { return at<1>().valid(); }
+  int32_t pid() const { return at<1>().as_int32(); }
+  bool has_objects() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> objects() const { return GetRepeated<::protozero::ConstBytes>(2); }
+  bool has_roots() const { return at<7>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> roots() const { return GetRepeated<::protozero::ConstBytes>(7); }
+  bool has_types() const { return at<9>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> types() const { return GetRepeated<::protozero::ConstBytes>(9); }
+  bool has_field_names() const { return at<4>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> field_names() const { return GetRepeated<::protozero::ConstBytes>(4); }
+  bool has_location_names() const { return at<8>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> location_names() const { return GetRepeated<::protozero::ConstBytes>(8); }
+  bool has_continued() const { return at<5>().valid(); }
+  bool continued() const { return at<5>().as_bool(); }
+  bool has_index() const { return at<6>().valid(); }
+  uint64_t index() const { return at<6>().as_uint64(); }
+};
+
+class HeapGraph : public ::protozero::Message {
+ public:
+  using Decoder = HeapGraph_Decoder;
+  enum : int32_t {
+    kPidFieldNumber = 1,
+    kObjectsFieldNumber = 2,
+    kRootsFieldNumber = 7,
+    kTypesFieldNumber = 9,
+    kFieldNamesFieldNumber = 4,
+    kLocationNamesFieldNumber = 8,
+    kContinuedFieldNumber = 5,
+    kIndexFieldNumber = 6,
+  };
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      HeapGraph>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Objects =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      HeapGraphObject,
+      HeapGraph>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Objects kObjects() { return {}; }
+  template <typename T = HeapGraphObject> T* add_objects() {
+    return BeginNestedMessage<T>(2);
+  }
+
+
+  using FieldMetadata_Roots =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      HeapGraphRoot,
+      HeapGraph>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Roots kRoots() { return {}; }
+  template <typename T = HeapGraphRoot> T* add_roots() {
+    return BeginNestedMessage<T>(7);
+  }
+
+
+  using FieldMetadata_Types =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      HeapGraphType,
+      HeapGraph>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Types kTypes() { return {}; }
+  template <typename T = HeapGraphType> T* add_types() {
+    return BeginNestedMessage<T>(9);
+  }
+
+
+  using FieldMetadata_FieldNames =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      InternedString,
+      HeapGraph>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FieldNames kFieldNames() { return {}; }
+  template <typename T = InternedString> T* add_field_names() {
+    return BeginNestedMessage<T>(4);
+  }
+
+
+  using FieldMetadata_LocationNames =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      InternedString,
+      HeapGraph>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LocationNames kLocationNames() { return {}; }
+  template <typename T = InternedString> T* add_location_names() {
+    return BeginNestedMessage<T>(8);
+  }
+
+
+  using FieldMetadata_Continued =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      HeapGraph>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Continued kContinued() { return {}; }
+  void set_continued(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_Continued::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Index =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      HeapGraph>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Index kIndex() { return {}; }
+  void set_index(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Index::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class HeapGraphObject_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  HeapGraphObject_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit HeapGraphObject_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit HeapGraphObject_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_id() const { return at<1>().valid(); }
+  uint64_t id() const { return at<1>().as_uint64(); }
+  bool has_id_delta() const { return at<7>().valid(); }
+  uint64_t id_delta() const { return at<7>().as_uint64(); }
+  bool has_type_id() const { return at<2>().valid(); }
+  uint64_t type_id() const { return at<2>().as_uint64(); }
+  bool has_self_size() const { return at<3>().valid(); }
+  uint64_t self_size() const { return at<3>().as_uint64(); }
+  bool has_reference_field_id_base() const { return at<6>().valid(); }
+  uint64_t reference_field_id_base() const { return at<6>().as_uint64(); }
+  bool has_reference_field_id() const { return at<4>().valid(); }
+  ::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t> reference_field_id(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t>(4, parse_error_ptr); }
+  bool has_reference_object_id() const { return at<5>().valid(); }
+  ::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t> reference_object_id(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t>(5, parse_error_ptr); }
+};
+
+class HeapGraphObject : public ::protozero::Message {
+ public:
+  using Decoder = HeapGraphObject_Decoder;
+  enum : int32_t {
+    kIdFieldNumber = 1,
+    kIdDeltaFieldNumber = 7,
+    kTypeIdFieldNumber = 2,
+    kSelfSizeFieldNumber = 3,
+    kReferenceFieldIdBaseFieldNumber = 6,
+    kReferenceFieldIdFieldNumber = 4,
+    kReferenceObjectIdFieldNumber = 5,
+  };
+
+  using FieldMetadata_Id =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      HeapGraphObject>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Id kId() { return {}; }
+  void set_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Id::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IdDelta =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      HeapGraphObject>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IdDelta kIdDelta() { return {}; }
+  void set_id_delta(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IdDelta::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TypeId =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      HeapGraphObject>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TypeId kTypeId() { return {}; }
+  void set_type_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TypeId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SelfSize =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      HeapGraphObject>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SelfSize kSelfSize() { return {}; }
+  void set_self_size(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SelfSize::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ReferenceFieldIdBase =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      HeapGraphObject>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ReferenceFieldIdBase kReferenceFieldIdBase() { return {}; }
+  void set_reference_field_id_base(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ReferenceFieldIdBase::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ReferenceFieldId =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kRepeatedPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      HeapGraphObject>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ReferenceFieldId kReferenceFieldId() { return {}; }
+  void set_reference_field_id(const ::protozero::PackedVarInt& packed_buffer) {
+    AppendBytes(FieldMetadata_ReferenceFieldId::kFieldId, packed_buffer.data(),
+                packed_buffer.size());
+  }
+
+  using FieldMetadata_ReferenceObjectId =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kRepeatedPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      HeapGraphObject>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ReferenceObjectId kReferenceObjectId() { return {}; }
+  void set_reference_object_id(const ::protozero::PackedVarInt& packed_buffer) {
+    AppendBytes(FieldMetadata_ReferenceObjectId::kFieldId, packed_buffer.data(),
+                packed_buffer.size());
+  }
+};
+
+class HeapGraphType_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  HeapGraphType_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit HeapGraphType_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit HeapGraphType_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_id() const { return at<1>().valid(); }
+  uint64_t id() const { return at<1>().as_uint64(); }
+  bool has_location_id() const { return at<2>().valid(); }
+  uint64_t location_id() const { return at<2>().as_uint64(); }
+  bool has_class_name() const { return at<3>().valid(); }
+  ::protozero::ConstChars class_name() const { return at<3>().as_string(); }
+  bool has_object_size() const { return at<4>().valid(); }
+  uint64_t object_size() const { return at<4>().as_uint64(); }
+  bool has_superclass_id() const { return at<5>().valid(); }
+  uint64_t superclass_id() const { return at<5>().as_uint64(); }
+  bool has_reference_field_id() const { return at<6>().valid(); }
+  ::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t> reference_field_id(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t>(6, parse_error_ptr); }
+  bool has_kind() const { return at<7>().valid(); }
+  int32_t kind() const { return at<7>().as_int32(); }
+  bool has_classloader_id() const { return at<8>().valid(); }
+  uint64_t classloader_id() const { return at<8>().as_uint64(); }
+};
+
+class HeapGraphType : public ::protozero::Message {
+ public:
+  using Decoder = HeapGraphType_Decoder;
+  enum : int32_t {
+    kIdFieldNumber = 1,
+    kLocationIdFieldNumber = 2,
+    kClassNameFieldNumber = 3,
+    kObjectSizeFieldNumber = 4,
+    kSuperclassIdFieldNumber = 5,
+    kReferenceFieldIdFieldNumber = 6,
+    kKindFieldNumber = 7,
+    kClassloaderIdFieldNumber = 8,
+  };
+  using Kind = ::perfetto::protos::pbzero::HeapGraphType_Kind;
+  static const Kind KIND_UNKNOWN = HeapGraphType_Kind_KIND_UNKNOWN;
+  static const Kind KIND_NORMAL = HeapGraphType_Kind_KIND_NORMAL;
+  static const Kind KIND_NOREFERENCES = HeapGraphType_Kind_KIND_NOREFERENCES;
+  static const Kind KIND_STRING = HeapGraphType_Kind_KIND_STRING;
+  static const Kind KIND_ARRAY = HeapGraphType_Kind_KIND_ARRAY;
+  static const Kind KIND_CLASS = HeapGraphType_Kind_KIND_CLASS;
+  static const Kind KIND_CLASSLOADER = HeapGraphType_Kind_KIND_CLASSLOADER;
+  static const Kind KIND_DEXCACHE = HeapGraphType_Kind_KIND_DEXCACHE;
+  static const Kind KIND_SOFT_REFERENCE = HeapGraphType_Kind_KIND_SOFT_REFERENCE;
+  static const Kind KIND_WEAK_REFERENCE = HeapGraphType_Kind_KIND_WEAK_REFERENCE;
+  static const Kind KIND_FINALIZER_REFERENCE = HeapGraphType_Kind_KIND_FINALIZER_REFERENCE;
+  static const Kind KIND_PHANTOM_REFERENCE = HeapGraphType_Kind_KIND_PHANTOM_REFERENCE;
+
+  using FieldMetadata_Id =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      HeapGraphType>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Id kId() { return {}; }
+  void set_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Id::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LocationId =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      HeapGraphType>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LocationId kLocationId() { return {}; }
+  void set_location_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_LocationId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ClassName =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      HeapGraphType>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ClassName kClassName() { return {}; }
+  void set_class_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ClassName::kFieldId, data, size);
+  }
+  void set_class_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ClassName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ObjectSize =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      HeapGraphType>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ObjectSize kObjectSize() { return {}; }
+  void set_object_size(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ObjectSize::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SuperclassId =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      HeapGraphType>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SuperclassId kSuperclassId() { return {}; }
+  void set_superclass_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SuperclassId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ReferenceFieldId =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kRepeatedPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      HeapGraphType>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ReferenceFieldId kReferenceFieldId() { return {}; }
+  void set_reference_field_id(const ::protozero::PackedVarInt& packed_buffer) {
+    AppendBytes(FieldMetadata_ReferenceFieldId::kFieldId, packed_buffer.data(),
+                packed_buffer.size());
+  }
+
+  using FieldMetadata_Kind =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::HeapGraphType_Kind,
+      HeapGraphType>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Kind kKind() { return {}; }
+  void set_kind(::perfetto::protos::pbzero::HeapGraphType_Kind value) {
+    static constexpr uint32_t field_id = FieldMetadata_Kind::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ClassloaderId =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      HeapGraphType>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ClassloaderId kClassloaderId() { return {}; }
+  void set_classloader_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ClassloaderId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class HeapGraphRoot_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  HeapGraphRoot_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit HeapGraphRoot_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit HeapGraphRoot_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_object_ids() const { return at<1>().valid(); }
+  ::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t> object_ids(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t>(1, parse_error_ptr); }
+  bool has_root_type() const { return at<2>().valid(); }
+  int32_t root_type() const { return at<2>().as_int32(); }
+};
+
+class HeapGraphRoot : public ::protozero::Message {
+ public:
+  using Decoder = HeapGraphRoot_Decoder;
+  enum : int32_t {
+    kObjectIdsFieldNumber = 1,
+    kRootTypeFieldNumber = 2,
+  };
+  using Type = ::perfetto::protos::pbzero::HeapGraphRoot_Type;
+  static const Type ROOT_UNKNOWN = HeapGraphRoot_Type_ROOT_UNKNOWN;
+  static const Type ROOT_JNI_GLOBAL = HeapGraphRoot_Type_ROOT_JNI_GLOBAL;
+  static const Type ROOT_JNI_LOCAL = HeapGraphRoot_Type_ROOT_JNI_LOCAL;
+  static const Type ROOT_JAVA_FRAME = HeapGraphRoot_Type_ROOT_JAVA_FRAME;
+  static const Type ROOT_NATIVE_STACK = HeapGraphRoot_Type_ROOT_NATIVE_STACK;
+  static const Type ROOT_STICKY_CLASS = HeapGraphRoot_Type_ROOT_STICKY_CLASS;
+  static const Type ROOT_THREAD_BLOCK = HeapGraphRoot_Type_ROOT_THREAD_BLOCK;
+  static const Type ROOT_MONITOR_USED = HeapGraphRoot_Type_ROOT_MONITOR_USED;
+  static const Type ROOT_THREAD_OBJECT = HeapGraphRoot_Type_ROOT_THREAD_OBJECT;
+  static const Type ROOT_INTERNED_STRING = HeapGraphRoot_Type_ROOT_INTERNED_STRING;
+  static const Type ROOT_FINALIZING = HeapGraphRoot_Type_ROOT_FINALIZING;
+  static const Type ROOT_DEBUGGER = HeapGraphRoot_Type_ROOT_DEBUGGER;
+  static const Type ROOT_REFERENCE_CLEANUP = HeapGraphRoot_Type_ROOT_REFERENCE_CLEANUP;
+  static const Type ROOT_VM_INTERNAL = HeapGraphRoot_Type_ROOT_VM_INTERNAL;
+  static const Type ROOT_JNI_MONITOR = HeapGraphRoot_Type_ROOT_JNI_MONITOR;
+
+  using FieldMetadata_ObjectIds =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      HeapGraphRoot>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ObjectIds kObjectIds() { return {}; }
+  void set_object_ids(const ::protozero::PackedVarInt& packed_buffer) {
+    AppendBytes(FieldMetadata_ObjectIds::kFieldId, packed_buffer.data(),
+                packed_buffer.size());
+  }
+
+  using FieldMetadata_RootType =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::HeapGraphRoot_Type,
+      HeapGraphRoot>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RootType kRootType() { return {}; }
+  void set_root_type(::perfetto::protos::pbzero::HeapGraphRoot_Type value) {
+    static constexpr uint32_t field_id = FieldMetadata_RootType::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/profiling/profile_common.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_PROFILE_COMMON_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_PROFILE_COMMON_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class AddressSymbols;
+class Line;
+
+class Callstack_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  Callstack_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Callstack_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Callstack_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_iid() const { return at<1>().valid(); }
+  uint64_t iid() const { return at<1>().as_uint64(); }
+  bool has_frame_ids() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> frame_ids() const { return GetRepeated<uint64_t>(2); }
+};
+
+class Callstack : public ::protozero::Message {
+ public:
+  using Decoder = Callstack_Decoder;
+  enum : int32_t {
+    kIidFieldNumber = 1,
+    kFrameIdsFieldNumber = 2,
+  };
+
+  using FieldMetadata_Iid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Callstack>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Iid kIid() { return {}; }
+  void set_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Iid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FrameIds =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Callstack>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FrameIds kFrameIds() { return {}; }
+  void add_frame_ids(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FrameIds::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Frame_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Frame_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Frame_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Frame_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_iid() const { return at<1>().valid(); }
+  uint64_t iid() const { return at<1>().as_uint64(); }
+  bool has_function_name_id() const { return at<2>().valid(); }
+  uint64_t function_name_id() const { return at<2>().as_uint64(); }
+  bool has_mapping_id() const { return at<3>().valid(); }
+  uint64_t mapping_id() const { return at<3>().as_uint64(); }
+  bool has_rel_pc() const { return at<4>().valid(); }
+  uint64_t rel_pc() const { return at<4>().as_uint64(); }
+};
+
+class Frame : public ::protozero::Message {
+ public:
+  using Decoder = Frame_Decoder;
+  enum : int32_t {
+    kIidFieldNumber = 1,
+    kFunctionNameIdFieldNumber = 2,
+    kMappingIdFieldNumber = 3,
+    kRelPcFieldNumber = 4,
+  };
+
+  using FieldMetadata_Iid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Frame>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Iid kIid() { return {}; }
+  void set_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Iid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FunctionNameId =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Frame>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FunctionNameId kFunctionNameId() { return {}; }
+  void set_function_name_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FunctionNameId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MappingId =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Frame>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MappingId kMappingId() { return {}; }
+  void set_mapping_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MappingId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_RelPc =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Frame>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RelPc kRelPc() { return {}; }
+  void set_rel_pc(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_RelPc::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Mapping_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  Mapping_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Mapping_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Mapping_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_iid() const { return at<1>().valid(); }
+  uint64_t iid() const { return at<1>().as_uint64(); }
+  bool has_build_id() const { return at<2>().valid(); }
+  uint64_t build_id() const { return at<2>().as_uint64(); }
+  bool has_exact_offset() const { return at<8>().valid(); }
+  uint64_t exact_offset() const { return at<8>().as_uint64(); }
+  bool has_start_offset() const { return at<3>().valid(); }
+  uint64_t start_offset() const { return at<3>().as_uint64(); }
+  bool has_start() const { return at<4>().valid(); }
+  uint64_t start() const { return at<4>().as_uint64(); }
+  bool has_end() const { return at<5>().valid(); }
+  uint64_t end() const { return at<5>().as_uint64(); }
+  bool has_load_bias() const { return at<6>().valid(); }
+  uint64_t load_bias() const { return at<6>().as_uint64(); }
+  bool has_path_string_ids() const { return at<7>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> path_string_ids() const { return GetRepeated<uint64_t>(7); }
+};
+
+class Mapping : public ::protozero::Message {
+ public:
+  using Decoder = Mapping_Decoder;
+  enum : int32_t {
+    kIidFieldNumber = 1,
+    kBuildIdFieldNumber = 2,
+    kExactOffsetFieldNumber = 8,
+    kStartOffsetFieldNumber = 3,
+    kStartFieldNumber = 4,
+    kEndFieldNumber = 5,
+    kLoadBiasFieldNumber = 6,
+    kPathStringIdsFieldNumber = 7,
+  };
+
+  using FieldMetadata_Iid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Mapping>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Iid kIid() { return {}; }
+  void set_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Iid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BuildId =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Mapping>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BuildId kBuildId() { return {}; }
+  void set_build_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BuildId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ExactOffset =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Mapping>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ExactOffset kExactOffset() { return {}; }
+  void set_exact_offset(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ExactOffset::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_StartOffset =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Mapping>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StartOffset kStartOffset() { return {}; }
+  void set_start_offset(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_StartOffset::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Start =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Mapping>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Start kStart() { return {}; }
+  void set_start(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Start::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_End =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Mapping>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_End kEnd() { return {}; }
+  void set_end(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_End::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LoadBias =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Mapping>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LoadBias kLoadBias() { return {}; }
+  void set_load_bias(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_LoadBias::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PathStringIds =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      Mapping>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PathStringIds kPathStringIds() { return {}; }
+  void add_path_string_ids(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PathStringIds::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class ModuleSymbols_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  ModuleSymbols_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ModuleSymbols_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ModuleSymbols_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_path() const { return at<1>().valid(); }
+  ::protozero::ConstChars path() const { return at<1>().as_string(); }
+  bool has_build_id() const { return at<2>().valid(); }
+  ::protozero::ConstChars build_id() const { return at<2>().as_string(); }
+  bool has_address_symbols() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> address_symbols() const { return GetRepeated<::protozero::ConstBytes>(3); }
+};
+
+class ModuleSymbols : public ::protozero::Message {
+ public:
+  using Decoder = ModuleSymbols_Decoder;
+  enum : int32_t {
+    kPathFieldNumber = 1,
+    kBuildIdFieldNumber = 2,
+    kAddressSymbolsFieldNumber = 3,
+  };
+
+  using FieldMetadata_Path =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ModuleSymbols>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Path kPath() { return {}; }
+  void set_path(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Path::kFieldId, data, size);
+  }
+  void set_path(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Path::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BuildId =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ModuleSymbols>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BuildId kBuildId() { return {}; }
+  void set_build_id(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_BuildId::kFieldId, data, size);
+  }
+  void set_build_id(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_BuildId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_AddressSymbols =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      AddressSymbols,
+      ModuleSymbols>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AddressSymbols kAddressSymbols() { return {}; }
+  template <typename T = AddressSymbols> T* add_address_symbols() {
+    return BeginNestedMessage<T>(3);
+  }
+
+};
+
+class AddressSymbols_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  AddressSymbols_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit AddressSymbols_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit AddressSymbols_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_address() const { return at<1>().valid(); }
+  uint64_t address() const { return at<1>().as_uint64(); }
+  bool has_lines() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> lines() const { return GetRepeated<::protozero::ConstBytes>(2); }
+};
+
+class AddressSymbols : public ::protozero::Message {
+ public:
+  using Decoder = AddressSymbols_Decoder;
+  enum : int32_t {
+    kAddressFieldNumber = 1,
+    kLinesFieldNumber = 2,
+  };
+
+  using FieldMetadata_Address =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      AddressSymbols>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Address kAddress() { return {}; }
+  void set_address(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Address::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Lines =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Line,
+      AddressSymbols>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Lines kLines() { return {}; }
+  template <typename T = Line> T* add_lines() {
+    return BeginNestedMessage<T>(2);
+  }
+
+};
+
+class Line_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Line_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Line_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Line_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_function_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars function_name() const { return at<1>().as_string(); }
+  bool has_source_file_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars source_file_name() const { return at<2>().as_string(); }
+  bool has_line_number() const { return at<3>().valid(); }
+  uint32_t line_number() const { return at<3>().as_uint32(); }
+};
+
+class Line : public ::protozero::Message {
+ public:
+  using Decoder = Line_Decoder;
+  enum : int32_t {
+    kFunctionNameFieldNumber = 1,
+    kSourceFileNameFieldNumber = 2,
+    kLineNumberFieldNumber = 3,
+  };
+
+  using FieldMetadata_FunctionName =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      Line>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FunctionName kFunctionName() { return {}; }
+  void set_function_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_FunctionName::kFieldId, data, size);
+  }
+  void set_function_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_FunctionName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SourceFileName =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      Line>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SourceFileName kSourceFileName() { return {}; }
+  void set_source_file_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_SourceFileName::kFieldId, data, size);
+  }
+  void set_source_file_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_SourceFileName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LineNumber =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      Line>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LineNumber kLineNumber() { return {}; }
+  void set_line_number(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_LineNumber::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class ProfiledFrameSymbols_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  ProfiledFrameSymbols_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ProfiledFrameSymbols_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ProfiledFrameSymbols_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_frame_iid() const { return at<1>().valid(); }
+  uint64_t frame_iid() const { return at<1>().as_uint64(); }
+  bool has_function_name_id() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> function_name_id() const { return GetRepeated<uint64_t>(2); }
+  bool has_file_name_id() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> file_name_id() const { return GetRepeated<uint64_t>(3); }
+  bool has_line_number() const { return at<4>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint32_t> line_number() const { return GetRepeated<uint32_t>(4); }
+};
+
+class ProfiledFrameSymbols : public ::protozero::Message {
+ public:
+  using Decoder = ProfiledFrameSymbols_Decoder;
+  enum : int32_t {
+    kFrameIidFieldNumber = 1,
+    kFunctionNameIdFieldNumber = 2,
+    kFileNameIdFieldNumber = 3,
+    kLineNumberFieldNumber = 4,
+  };
+
+  using FieldMetadata_FrameIid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProfiledFrameSymbols>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FrameIid kFrameIid() { return {}; }
+  void set_frame_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FrameIid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FunctionNameId =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProfiledFrameSymbols>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FunctionNameId kFunctionNameId() { return {}; }
+  void add_function_name_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FunctionNameId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FileNameId =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProfiledFrameSymbols>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FileNameId kFileNameId() { return {}; }
+  void add_file_name_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FileNameId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LineNumber =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      ProfiledFrameSymbols>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LineNumber kLineNumber() { return {}; }
+  void add_line_number(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_LineNumber::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class InternedString_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  InternedString_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit InternedString_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit InternedString_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_iid() const { return at<1>().valid(); }
+  uint64_t iid() const { return at<1>().as_uint64(); }
+  bool has_str() const { return at<2>().valid(); }
+  ::protozero::ConstBytes str() const { return at<2>().as_bytes(); }
+};
+
+class InternedString : public ::protozero::Message {
+ public:
+  using Decoder = InternedString_Decoder;
+  enum : int32_t {
+    kIidFieldNumber = 1,
+    kStrFieldNumber = 2,
+  };
+
+  using FieldMetadata_Iid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      InternedString>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Iid kIid() { return {}; }
+  void set_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Iid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Str =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBytes,
+      std::string,
+      InternedString>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Str kStr() { return {}; }
+  void set_str(const uint8_t* data, size_t size) {
+    AppendBytes(FieldMetadata_Str::kFieldId, data, size);
+  }
+  void set_str(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Str::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBytes>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/profiling/profile_packet.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_PROFILE_PACKET_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_PROFILE_PACKET_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class Callstack;
+class Frame;
+class InternedString;
+class Mapping;
+class PerfEvents_Timebase;
+class PerfSample_ProducerEvent;
+class ProfilePacket_HeapSample;
+class ProfilePacket_Histogram;
+class ProfilePacket_Histogram_Bucket;
+class ProfilePacket_ProcessHeapSamples;
+class ProfilePacket_ProcessStats;
+enum PerfSample_ProducerEvent_DataSourceStopReason : int32_t;
+enum PerfSample_SampleSkipReason : int32_t;
+enum ProfilePacket_ProcessHeapSamples_ClientError : int32_t;
+enum Profiling_CpuMode : int32_t;
+enum Profiling_StackUnwindError : int32_t;
+
+enum PerfSample_SampleSkipReason : int32_t {
+  PerfSample_SampleSkipReason_PROFILER_SKIP_UNKNOWN = 0,
+  PerfSample_SampleSkipReason_PROFILER_SKIP_READ_STAGE = 1,
+  PerfSample_SampleSkipReason_PROFILER_SKIP_UNWIND_STAGE = 2,
+  PerfSample_SampleSkipReason_PROFILER_SKIP_UNWIND_ENQUEUE = 3,
+};
+
+const PerfSample_SampleSkipReason PerfSample_SampleSkipReason_MIN = PerfSample_SampleSkipReason_PROFILER_SKIP_UNKNOWN;
+const PerfSample_SampleSkipReason PerfSample_SampleSkipReason_MAX = PerfSample_SampleSkipReason_PROFILER_SKIP_UNWIND_ENQUEUE;
+
+enum PerfSample_ProducerEvent_DataSourceStopReason : int32_t {
+  PerfSample_ProducerEvent_DataSourceStopReason_PROFILER_STOP_UNKNOWN = 0,
+  PerfSample_ProducerEvent_DataSourceStopReason_PROFILER_STOP_GUARDRAIL = 1,
+};
+
+const PerfSample_ProducerEvent_DataSourceStopReason PerfSample_ProducerEvent_DataSourceStopReason_MIN = PerfSample_ProducerEvent_DataSourceStopReason_PROFILER_STOP_UNKNOWN;
+const PerfSample_ProducerEvent_DataSourceStopReason PerfSample_ProducerEvent_DataSourceStopReason_MAX = PerfSample_ProducerEvent_DataSourceStopReason_PROFILER_STOP_GUARDRAIL;
+
+enum Profiling_CpuMode : int32_t {
+  Profiling_CpuMode_MODE_UNKNOWN = 0,
+  Profiling_CpuMode_MODE_KERNEL = 1,
+  Profiling_CpuMode_MODE_USER = 2,
+  Profiling_CpuMode_MODE_HYPERVISOR = 3,
+  Profiling_CpuMode_MODE_GUEST_KERNEL = 4,
+  Profiling_CpuMode_MODE_GUEST_USER = 5,
+};
+
+const Profiling_CpuMode Profiling_CpuMode_MIN = Profiling_CpuMode_MODE_UNKNOWN;
+const Profiling_CpuMode Profiling_CpuMode_MAX = Profiling_CpuMode_MODE_GUEST_USER;
+
+enum Profiling_StackUnwindError : int32_t {
+  Profiling_StackUnwindError_UNWIND_ERROR_UNKNOWN = 0,
+  Profiling_StackUnwindError_UNWIND_ERROR_NONE = 1,
+  Profiling_StackUnwindError_UNWIND_ERROR_MEMORY_INVALID = 2,
+  Profiling_StackUnwindError_UNWIND_ERROR_UNWIND_INFO = 3,
+  Profiling_StackUnwindError_UNWIND_ERROR_UNSUPPORTED = 4,
+  Profiling_StackUnwindError_UNWIND_ERROR_INVALID_MAP = 5,
+  Profiling_StackUnwindError_UNWIND_ERROR_MAX_FRAMES_EXCEEDED = 6,
+  Profiling_StackUnwindError_UNWIND_ERROR_REPEATED_FRAME = 7,
+  Profiling_StackUnwindError_UNWIND_ERROR_INVALID_ELF = 8,
+  Profiling_StackUnwindError_UNWIND_ERROR_SYSTEM_CALL = 9,
+  Profiling_StackUnwindError_UNWIND_ERROR_THREAD_TIMEOUT = 10,
+  Profiling_StackUnwindError_UNWIND_ERROR_THREAD_DOES_NOT_EXIST = 11,
+};
+
+const Profiling_StackUnwindError Profiling_StackUnwindError_MIN = Profiling_StackUnwindError_UNWIND_ERROR_UNKNOWN;
+const Profiling_StackUnwindError Profiling_StackUnwindError_MAX = Profiling_StackUnwindError_UNWIND_ERROR_THREAD_DOES_NOT_EXIST;
+
+enum ProfilePacket_ProcessHeapSamples_ClientError : int32_t {
+  ProfilePacket_ProcessHeapSamples_ClientError_CLIENT_ERROR_NONE = 0,
+  ProfilePacket_ProcessHeapSamples_ClientError_CLIENT_ERROR_HIT_TIMEOUT = 1,
+  ProfilePacket_ProcessHeapSamples_ClientError_CLIENT_ERROR_INVALID_STACK_BOUNDS = 2,
+};
+
+const ProfilePacket_ProcessHeapSamples_ClientError ProfilePacket_ProcessHeapSamples_ClientError_MIN = ProfilePacket_ProcessHeapSamples_ClientError_CLIENT_ERROR_NONE;
+const ProfilePacket_ProcessHeapSamples_ClientError ProfilePacket_ProcessHeapSamples_ClientError_MAX = ProfilePacket_ProcessHeapSamples_ClientError_CLIENT_ERROR_INVALID_STACK_BOUNDS;
+
+class PerfSampleDefaults_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  PerfSampleDefaults_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit PerfSampleDefaults_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit PerfSampleDefaults_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_timebase() const { return at<1>().valid(); }
+  ::protozero::ConstBytes timebase() const { return at<1>().as_bytes(); }
+};
+
+class PerfSampleDefaults : public ::protozero::Message {
+ public:
+  using Decoder = PerfSampleDefaults_Decoder;
+  enum : int32_t {
+    kTimebaseFieldNumber = 1,
+  };
+
+  using FieldMetadata_Timebase =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      PerfEvents_Timebase,
+      PerfSampleDefaults>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Timebase kTimebase() { return {}; }
+  template <typename T = PerfEvents_Timebase> T* set_timebase() {
+    return BeginNestedMessage<T>(1);
+  }
+
+};
+
+class PerfSample_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/19, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  PerfSample_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit PerfSample_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit PerfSample_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_cpu() const { return at<1>().valid(); }
+  uint32_t cpu() const { return at<1>().as_uint32(); }
+  bool has_pid() const { return at<2>().valid(); }
+  uint32_t pid() const { return at<2>().as_uint32(); }
+  bool has_tid() const { return at<3>().valid(); }
+  uint32_t tid() const { return at<3>().as_uint32(); }
+  bool has_cpu_mode() const { return at<5>().valid(); }
+  int32_t cpu_mode() const { return at<5>().as_int32(); }
+  bool has_timebase_count() const { return at<6>().valid(); }
+  uint64_t timebase_count() const { return at<6>().as_uint64(); }
+  bool has_callstack_iid() const { return at<4>().valid(); }
+  uint64_t callstack_iid() const { return at<4>().as_uint64(); }
+  bool has_unwind_error() const { return at<16>().valid(); }
+  int32_t unwind_error() const { return at<16>().as_int32(); }
+  bool has_kernel_records_lost() const { return at<17>().valid(); }
+  uint64_t kernel_records_lost() const { return at<17>().as_uint64(); }
+  bool has_sample_skipped_reason() const { return at<18>().valid(); }
+  int32_t sample_skipped_reason() const { return at<18>().as_int32(); }
+  bool has_producer_event() const { return at<19>().valid(); }
+  ::protozero::ConstBytes producer_event() const { return at<19>().as_bytes(); }
+};
+
+class PerfSample : public ::protozero::Message {
+ public:
+  using Decoder = PerfSample_Decoder;
+  enum : int32_t {
+    kCpuFieldNumber = 1,
+    kPidFieldNumber = 2,
+    kTidFieldNumber = 3,
+    kCpuModeFieldNumber = 5,
+    kTimebaseCountFieldNumber = 6,
+    kCallstackIidFieldNumber = 4,
+    kUnwindErrorFieldNumber = 16,
+    kKernelRecordsLostFieldNumber = 17,
+    kSampleSkippedReasonFieldNumber = 18,
+    kProducerEventFieldNumber = 19,
+  };
+  using ProducerEvent = ::perfetto::protos::pbzero::PerfSample_ProducerEvent;
+  using SampleSkipReason = ::perfetto::protos::pbzero::PerfSample_SampleSkipReason;
+  static const SampleSkipReason PROFILER_SKIP_UNKNOWN = PerfSample_SampleSkipReason_PROFILER_SKIP_UNKNOWN;
+  static const SampleSkipReason PROFILER_SKIP_READ_STAGE = PerfSample_SampleSkipReason_PROFILER_SKIP_READ_STAGE;
+  static const SampleSkipReason PROFILER_SKIP_UNWIND_STAGE = PerfSample_SampleSkipReason_PROFILER_SKIP_UNWIND_STAGE;
+  static const SampleSkipReason PROFILER_SKIP_UNWIND_ENQUEUE = PerfSample_SampleSkipReason_PROFILER_SKIP_UNWIND_ENQUEUE;
+
+  using FieldMetadata_Cpu =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      PerfSample>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cpu kCpu() { return {}; }
+  void set_cpu(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cpu::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      PerfSample>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Tid =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      PerfSample>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Tid kTid() { return {}; }
+  void set_tid(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Tid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CpuMode =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::Profiling_CpuMode,
+      PerfSample>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CpuMode kCpuMode() { return {}; }
+  void set_cpu_mode(::perfetto::protos::pbzero::Profiling_CpuMode value) {
+    static constexpr uint32_t field_id = FieldMetadata_CpuMode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TimebaseCount =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      PerfSample>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TimebaseCount kTimebaseCount() { return {}; }
+  void set_timebase_count(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TimebaseCount::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CallstackIid =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      PerfSample>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CallstackIid kCallstackIid() { return {}; }
+  void set_callstack_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CallstackIid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_UnwindError =
+    ::protozero::proto_utils::FieldMetadata<
+      16,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::Profiling_StackUnwindError,
+      PerfSample>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UnwindError kUnwindError() { return {}; }
+  void set_unwind_error(::perfetto::protos::pbzero::Profiling_StackUnwindError value) {
+    static constexpr uint32_t field_id = FieldMetadata_UnwindError::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_KernelRecordsLost =
+    ::protozero::proto_utils::FieldMetadata<
+      17,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      PerfSample>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_KernelRecordsLost kKernelRecordsLost() { return {}; }
+  void set_kernel_records_lost(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_KernelRecordsLost::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SampleSkippedReason =
+    ::protozero::proto_utils::FieldMetadata<
+      18,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::PerfSample_SampleSkipReason,
+      PerfSample>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SampleSkippedReason kSampleSkippedReason() { return {}; }
+  void set_sample_skipped_reason(::perfetto::protos::pbzero::PerfSample_SampleSkipReason value) {
+    static constexpr uint32_t field_id = FieldMetadata_SampleSkippedReason::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ProducerEvent =
+    ::protozero::proto_utils::FieldMetadata<
+      19,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      PerfSample_ProducerEvent,
+      PerfSample>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProducerEvent kProducerEvent() { return {}; }
+  template <typename T = PerfSample_ProducerEvent> T* set_producer_event() {
+    return BeginNestedMessage<T>(19);
+  }
+
+};
+
+class PerfSample_ProducerEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  PerfSample_ProducerEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit PerfSample_ProducerEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit PerfSample_ProducerEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_source_stop_reason() const { return at<1>().valid(); }
+  int32_t source_stop_reason() const { return at<1>().as_int32(); }
+};
+
+class PerfSample_ProducerEvent : public ::protozero::Message {
+ public:
+  using Decoder = PerfSample_ProducerEvent_Decoder;
+  enum : int32_t {
+    kSourceStopReasonFieldNumber = 1,
+  };
+  using DataSourceStopReason = ::perfetto::protos::pbzero::PerfSample_ProducerEvent_DataSourceStopReason;
+  static const DataSourceStopReason PROFILER_STOP_UNKNOWN = PerfSample_ProducerEvent_DataSourceStopReason_PROFILER_STOP_UNKNOWN;
+  static const DataSourceStopReason PROFILER_STOP_GUARDRAIL = PerfSample_ProducerEvent_DataSourceStopReason_PROFILER_STOP_GUARDRAIL;
+
+  using FieldMetadata_SourceStopReason =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::PerfSample_ProducerEvent_DataSourceStopReason,
+      PerfSample_ProducerEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SourceStopReason kSourceStopReason() { return {}; }
+  void set_source_stop_reason(::perfetto::protos::pbzero::PerfSample_ProducerEvent_DataSourceStopReason value) {
+    static constexpr uint32_t field_id = FieldMetadata_SourceStopReason::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class Profiling_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/0, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  Profiling_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Profiling_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Profiling_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+};
+
+class Profiling : public ::protozero::Message {
+ public:
+  using Decoder = Profiling_Decoder;
+  using CpuMode = ::perfetto::protos::pbzero::Profiling_CpuMode;
+  using StackUnwindError = ::perfetto::protos::pbzero::Profiling_StackUnwindError;
+  static const CpuMode MODE_UNKNOWN = Profiling_CpuMode_MODE_UNKNOWN;
+  static const CpuMode MODE_KERNEL = Profiling_CpuMode_MODE_KERNEL;
+  static const CpuMode MODE_USER = Profiling_CpuMode_MODE_USER;
+  static const CpuMode MODE_HYPERVISOR = Profiling_CpuMode_MODE_HYPERVISOR;
+  static const CpuMode MODE_GUEST_KERNEL = Profiling_CpuMode_MODE_GUEST_KERNEL;
+  static const CpuMode MODE_GUEST_USER = Profiling_CpuMode_MODE_GUEST_USER;
+  static const StackUnwindError UNWIND_ERROR_UNKNOWN = Profiling_StackUnwindError_UNWIND_ERROR_UNKNOWN;
+  static const StackUnwindError UNWIND_ERROR_NONE = Profiling_StackUnwindError_UNWIND_ERROR_NONE;
+  static const StackUnwindError UNWIND_ERROR_MEMORY_INVALID = Profiling_StackUnwindError_UNWIND_ERROR_MEMORY_INVALID;
+  static const StackUnwindError UNWIND_ERROR_UNWIND_INFO = Profiling_StackUnwindError_UNWIND_ERROR_UNWIND_INFO;
+  static const StackUnwindError UNWIND_ERROR_UNSUPPORTED = Profiling_StackUnwindError_UNWIND_ERROR_UNSUPPORTED;
+  static const StackUnwindError UNWIND_ERROR_INVALID_MAP = Profiling_StackUnwindError_UNWIND_ERROR_INVALID_MAP;
+  static const StackUnwindError UNWIND_ERROR_MAX_FRAMES_EXCEEDED = Profiling_StackUnwindError_UNWIND_ERROR_MAX_FRAMES_EXCEEDED;
+  static const StackUnwindError UNWIND_ERROR_REPEATED_FRAME = Profiling_StackUnwindError_UNWIND_ERROR_REPEATED_FRAME;
+  static const StackUnwindError UNWIND_ERROR_INVALID_ELF = Profiling_StackUnwindError_UNWIND_ERROR_INVALID_ELF;
+  static const StackUnwindError UNWIND_ERROR_SYSTEM_CALL = Profiling_StackUnwindError_UNWIND_ERROR_SYSTEM_CALL;
+  static const StackUnwindError UNWIND_ERROR_THREAD_TIMEOUT = Profiling_StackUnwindError_UNWIND_ERROR_THREAD_TIMEOUT;
+  static const StackUnwindError UNWIND_ERROR_THREAD_DOES_NOT_EXIST = Profiling_StackUnwindError_UNWIND_ERROR_THREAD_DOES_NOT_EXIST;
+};
+
+class StreamingProfilePacket_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  StreamingProfilePacket_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit StreamingProfilePacket_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit StreamingProfilePacket_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_callstack_iid() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> callstack_iid() const { return GetRepeated<uint64_t>(1); }
+  bool has_timestamp_delta_us() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<int64_t> timestamp_delta_us() const { return GetRepeated<int64_t>(2); }
+  bool has_process_priority() const { return at<3>().valid(); }
+  int32_t process_priority() const { return at<3>().as_int32(); }
+};
+
+class StreamingProfilePacket : public ::protozero::Message {
+ public:
+  using Decoder = StreamingProfilePacket_Decoder;
+  enum : int32_t {
+    kCallstackIidFieldNumber = 1,
+    kTimestampDeltaUsFieldNumber = 2,
+    kProcessPriorityFieldNumber = 3,
+  };
+
+  using FieldMetadata_CallstackIid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      StreamingProfilePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CallstackIid kCallstackIid() { return {}; }
+  void add_callstack_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CallstackIid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TimestampDeltaUs =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      StreamingProfilePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TimestampDeltaUs kTimestampDeltaUs() { return {}; }
+  void add_timestamp_delta_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TimestampDeltaUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ProcessPriority =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      StreamingProfilePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProcessPriority kProcessPriority() { return {}; }
+  void set_process_priority(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProcessPriority::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class StreamingFree_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  StreamingFree_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit StreamingFree_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit StreamingFree_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_address() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> address() const { return GetRepeated<uint64_t>(1); }
+  bool has_heap_id() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint32_t> heap_id() const { return GetRepeated<uint32_t>(2); }
+  bool has_sequence_number() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> sequence_number() const { return GetRepeated<uint64_t>(3); }
+};
+
+class StreamingFree : public ::protozero::Message {
+ public:
+  using Decoder = StreamingFree_Decoder;
+  enum : int32_t {
+    kAddressFieldNumber = 1,
+    kHeapIdFieldNumber = 2,
+    kSequenceNumberFieldNumber = 3,
+  };
+
+  using FieldMetadata_Address =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      StreamingFree>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Address kAddress() { return {}; }
+  void add_address(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Address::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HeapId =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      StreamingFree>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HeapId kHeapId() { return {}; }
+  void add_heap_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_HeapId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SequenceNumber =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      StreamingFree>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SequenceNumber kSequenceNumber() { return {}; }
+  void add_sequence_number(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SequenceNumber::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class StreamingAllocation_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  StreamingAllocation_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit StreamingAllocation_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit StreamingAllocation_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_address() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> address() const { return GetRepeated<uint64_t>(1); }
+  bool has_size() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> size() const { return GetRepeated<uint64_t>(2); }
+  bool has_sample_size() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> sample_size() const { return GetRepeated<uint64_t>(3); }
+  bool has_clock_monotonic_coarse_timestamp() const { return at<4>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> clock_monotonic_coarse_timestamp() const { return GetRepeated<uint64_t>(4); }
+  bool has_heap_id() const { return at<5>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint32_t> heap_id() const { return GetRepeated<uint32_t>(5); }
+  bool has_sequence_number() const { return at<6>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> sequence_number() const { return GetRepeated<uint64_t>(6); }
+};
+
+class StreamingAllocation : public ::protozero::Message {
+ public:
+  using Decoder = StreamingAllocation_Decoder;
+  enum : int32_t {
+    kAddressFieldNumber = 1,
+    kSizeFieldNumber = 2,
+    kSampleSizeFieldNumber = 3,
+    kClockMonotonicCoarseTimestampFieldNumber = 4,
+    kHeapIdFieldNumber = 5,
+    kSequenceNumberFieldNumber = 6,
+  };
+
+  using FieldMetadata_Address =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      StreamingAllocation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Address kAddress() { return {}; }
+  void add_address(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Address::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Size =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      StreamingAllocation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Size kSize() { return {}; }
+  void add_size(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Size::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SampleSize =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      StreamingAllocation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SampleSize kSampleSize() { return {}; }
+  void add_sample_size(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SampleSize::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ClockMonotonicCoarseTimestamp =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      StreamingAllocation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ClockMonotonicCoarseTimestamp kClockMonotonicCoarseTimestamp() { return {}; }
+  void add_clock_monotonic_coarse_timestamp(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ClockMonotonicCoarseTimestamp::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HeapId =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      StreamingAllocation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HeapId kHeapId() { return {}; }
+  void add_heap_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_HeapId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SequenceNumber =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      StreamingAllocation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SequenceNumber kSequenceNumber() { return {}; }
+  void add_sequence_number(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SequenceNumber::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class ProfilePacket_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  ProfilePacket_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ProfilePacket_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ProfilePacket_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_strings() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> strings() const { return GetRepeated<::protozero::ConstBytes>(1); }
+  bool has_mappings() const { return at<4>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> mappings() const { return GetRepeated<::protozero::ConstBytes>(4); }
+  bool has_frames() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> frames() const { return GetRepeated<::protozero::ConstBytes>(2); }
+  bool has_callstacks() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> callstacks() const { return GetRepeated<::protozero::ConstBytes>(3); }
+  bool has_process_dumps() const { return at<5>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> process_dumps() const { return GetRepeated<::protozero::ConstBytes>(5); }
+  bool has_continued() const { return at<6>().valid(); }
+  bool continued() const { return at<6>().as_bool(); }
+  bool has_index() const { return at<7>().valid(); }
+  uint64_t index() const { return at<7>().as_uint64(); }
+};
+
+class ProfilePacket : public ::protozero::Message {
+ public:
+  using Decoder = ProfilePacket_Decoder;
+  enum : int32_t {
+    kStringsFieldNumber = 1,
+    kMappingsFieldNumber = 4,
+    kFramesFieldNumber = 2,
+    kCallstacksFieldNumber = 3,
+    kProcessDumpsFieldNumber = 5,
+    kContinuedFieldNumber = 6,
+    kIndexFieldNumber = 7,
+  };
+  using HeapSample = ::perfetto::protos::pbzero::ProfilePacket_HeapSample;
+  using Histogram = ::perfetto::protos::pbzero::ProfilePacket_Histogram;
+  using ProcessStats = ::perfetto::protos::pbzero::ProfilePacket_ProcessStats;
+  using ProcessHeapSamples = ::perfetto::protos::pbzero::ProfilePacket_ProcessHeapSamples;
+
+  using FieldMetadata_Strings =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      InternedString,
+      ProfilePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Strings kStrings() { return {}; }
+  template <typename T = InternedString> T* add_strings() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_Mappings =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Mapping,
+      ProfilePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mappings kMappings() { return {}; }
+  template <typename T = Mapping> T* add_mappings() {
+    return BeginNestedMessage<T>(4);
+  }
+
+
+  using FieldMetadata_Frames =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Frame,
+      ProfilePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Frames kFrames() { return {}; }
+  template <typename T = Frame> T* add_frames() {
+    return BeginNestedMessage<T>(2);
+  }
+
+
+  using FieldMetadata_Callstacks =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Callstack,
+      ProfilePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Callstacks kCallstacks() { return {}; }
+  template <typename T = Callstack> T* add_callstacks() {
+    return BeginNestedMessage<T>(3);
+  }
+
+
+  using FieldMetadata_ProcessDumps =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ProfilePacket_ProcessHeapSamples,
+      ProfilePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProcessDumps kProcessDumps() { return {}; }
+  template <typename T = ProfilePacket_ProcessHeapSamples> T* add_process_dumps() {
+    return BeginNestedMessage<T>(5);
+  }
+
+
+  using FieldMetadata_Continued =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ProfilePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Continued kContinued() { return {}; }
+  void set_continued(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_Continued::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Index =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProfilePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Index kIndex() { return {}; }
+  void set_index(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Index::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class ProfilePacket_ProcessHeapSamples_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/14, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  ProfilePacket_ProcessHeapSamples_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ProfilePacket_ProcessHeapSamples_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ProfilePacket_ProcessHeapSamples_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_pid() const { return at<1>().valid(); }
+  uint64_t pid() const { return at<1>().as_uint64(); }
+  bool has_from_startup() const { return at<3>().valid(); }
+  bool from_startup() const { return at<3>().as_bool(); }
+  bool has_rejected_concurrent() const { return at<4>().valid(); }
+  bool rejected_concurrent() const { return at<4>().as_bool(); }
+  bool has_disconnected() const { return at<6>().valid(); }
+  bool disconnected() const { return at<6>().as_bool(); }
+  bool has_buffer_overran() const { return at<7>().valid(); }
+  bool buffer_overran() const { return at<7>().as_bool(); }
+  bool has_client_error() const { return at<14>().valid(); }
+  int32_t client_error() const { return at<14>().as_int32(); }
+  bool has_buffer_corrupted() const { return at<8>().valid(); }
+  bool buffer_corrupted() const { return at<8>().as_bool(); }
+  bool has_hit_guardrail() const { return at<10>().valid(); }
+  bool hit_guardrail() const { return at<10>().as_bool(); }
+  bool has_heap_name() const { return at<11>().valid(); }
+  ::protozero::ConstChars heap_name() const { return at<11>().as_string(); }
+  bool has_sampling_interval_bytes() const { return at<12>().valid(); }
+  uint64_t sampling_interval_bytes() const { return at<12>().as_uint64(); }
+  bool has_orig_sampling_interval_bytes() const { return at<13>().valid(); }
+  uint64_t orig_sampling_interval_bytes() const { return at<13>().as_uint64(); }
+  bool has_timestamp() const { return at<9>().valid(); }
+  uint64_t timestamp() const { return at<9>().as_uint64(); }
+  bool has_stats() const { return at<5>().valid(); }
+  ::protozero::ConstBytes stats() const { return at<5>().as_bytes(); }
+  bool has_samples() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> samples() const { return GetRepeated<::protozero::ConstBytes>(2); }
+};
+
+class ProfilePacket_ProcessHeapSamples : public ::protozero::Message {
+ public:
+  using Decoder = ProfilePacket_ProcessHeapSamples_Decoder;
+  enum : int32_t {
+    kPidFieldNumber = 1,
+    kFromStartupFieldNumber = 3,
+    kRejectedConcurrentFieldNumber = 4,
+    kDisconnectedFieldNumber = 6,
+    kBufferOverranFieldNumber = 7,
+    kClientErrorFieldNumber = 14,
+    kBufferCorruptedFieldNumber = 8,
+    kHitGuardrailFieldNumber = 10,
+    kHeapNameFieldNumber = 11,
+    kSamplingIntervalBytesFieldNumber = 12,
+    kOrigSamplingIntervalBytesFieldNumber = 13,
+    kTimestampFieldNumber = 9,
+    kStatsFieldNumber = 5,
+    kSamplesFieldNumber = 2,
+  };
+  using ClientError = ::perfetto::protos::pbzero::ProfilePacket_ProcessHeapSamples_ClientError;
+  static const ClientError CLIENT_ERROR_NONE = ProfilePacket_ProcessHeapSamples_ClientError_CLIENT_ERROR_NONE;
+  static const ClientError CLIENT_ERROR_HIT_TIMEOUT = ProfilePacket_ProcessHeapSamples_ClientError_CLIENT_ERROR_HIT_TIMEOUT;
+  static const ClientError CLIENT_ERROR_INVALID_STACK_BOUNDS = ProfilePacket_ProcessHeapSamples_ClientError_CLIENT_ERROR_INVALID_STACK_BOUNDS;
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProfilePacket_ProcessHeapSamples>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FromStartup =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ProfilePacket_ProcessHeapSamples>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FromStartup kFromStartup() { return {}; }
+  void set_from_startup(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_FromStartup::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_RejectedConcurrent =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ProfilePacket_ProcessHeapSamples>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RejectedConcurrent kRejectedConcurrent() { return {}; }
+  void set_rejected_concurrent(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_RejectedConcurrent::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Disconnected =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ProfilePacket_ProcessHeapSamples>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Disconnected kDisconnected() { return {}; }
+  void set_disconnected(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_Disconnected::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BufferOverran =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ProfilePacket_ProcessHeapSamples>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BufferOverran kBufferOverran() { return {}; }
+  void set_buffer_overran(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_BufferOverran::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ClientError =
+    ::protozero::proto_utils::FieldMetadata<
+      14,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ProfilePacket_ProcessHeapSamples_ClientError,
+      ProfilePacket_ProcessHeapSamples>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ClientError kClientError() { return {}; }
+  void set_client_error(::perfetto::protos::pbzero::ProfilePacket_ProcessHeapSamples_ClientError value) {
+    static constexpr uint32_t field_id = FieldMetadata_ClientError::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BufferCorrupted =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ProfilePacket_ProcessHeapSamples>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BufferCorrupted kBufferCorrupted() { return {}; }
+  void set_buffer_corrupted(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_BufferCorrupted::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HitGuardrail =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ProfilePacket_ProcessHeapSamples>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HitGuardrail kHitGuardrail() { return {}; }
+  void set_hit_guardrail(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_HitGuardrail::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HeapName =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ProfilePacket_ProcessHeapSamples>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HeapName kHeapName() { return {}; }
+  void set_heap_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_HeapName::kFieldId, data, size);
+  }
+  void set_heap_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_HeapName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SamplingIntervalBytes =
+    ::protozero::proto_utils::FieldMetadata<
+      12,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProfilePacket_ProcessHeapSamples>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SamplingIntervalBytes kSamplingIntervalBytes() { return {}; }
+  void set_sampling_interval_bytes(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SamplingIntervalBytes::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OrigSamplingIntervalBytes =
+    ::protozero::proto_utils::FieldMetadata<
+      13,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProfilePacket_ProcessHeapSamples>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OrigSamplingIntervalBytes kOrigSamplingIntervalBytes() { return {}; }
+  void set_orig_sampling_interval_bytes(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OrigSamplingIntervalBytes::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Timestamp =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProfilePacket_ProcessHeapSamples>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Timestamp kTimestamp() { return {}; }
+  void set_timestamp(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Timestamp::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Stats =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ProfilePacket_ProcessStats,
+      ProfilePacket_ProcessHeapSamples>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Stats kStats() { return {}; }
+  template <typename T = ProfilePacket_ProcessStats> T* set_stats() {
+    return BeginNestedMessage<T>(5);
+  }
+
+
+  using FieldMetadata_Samples =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ProfilePacket_HeapSample,
+      ProfilePacket_ProcessHeapSamples>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Samples kSamples() { return {}; }
+  template <typename T = ProfilePacket_HeapSample> T* add_samples() {
+    return BeginNestedMessage<T>(2);
+  }
+
+};
+
+class ProfilePacket_ProcessStats_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ProfilePacket_ProcessStats_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ProfilePacket_ProcessStats_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ProfilePacket_ProcessStats_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_unwinding_errors() const { return at<1>().valid(); }
+  uint64_t unwinding_errors() const { return at<1>().as_uint64(); }
+  bool has_heap_samples() const { return at<2>().valid(); }
+  uint64_t heap_samples() const { return at<2>().as_uint64(); }
+  bool has_map_reparses() const { return at<3>().valid(); }
+  uint64_t map_reparses() const { return at<3>().as_uint64(); }
+  bool has_unwinding_time_us() const { return at<4>().valid(); }
+  ::protozero::ConstBytes unwinding_time_us() const { return at<4>().as_bytes(); }
+  bool has_total_unwinding_time_us() const { return at<5>().valid(); }
+  uint64_t total_unwinding_time_us() const { return at<5>().as_uint64(); }
+  bool has_client_spinlock_blocked_us() const { return at<6>().valid(); }
+  uint64_t client_spinlock_blocked_us() const { return at<6>().as_uint64(); }
+};
+
+class ProfilePacket_ProcessStats : public ::protozero::Message {
+ public:
+  using Decoder = ProfilePacket_ProcessStats_Decoder;
+  enum : int32_t {
+    kUnwindingErrorsFieldNumber = 1,
+    kHeapSamplesFieldNumber = 2,
+    kMapReparsesFieldNumber = 3,
+    kUnwindingTimeUsFieldNumber = 4,
+    kTotalUnwindingTimeUsFieldNumber = 5,
+    kClientSpinlockBlockedUsFieldNumber = 6,
+  };
+
+  using FieldMetadata_UnwindingErrors =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProfilePacket_ProcessStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UnwindingErrors kUnwindingErrors() { return {}; }
+  void set_unwinding_errors(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_UnwindingErrors::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HeapSamples =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProfilePacket_ProcessStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HeapSamples kHeapSamples() { return {}; }
+  void set_heap_samples(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_HeapSamples::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MapReparses =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProfilePacket_ProcessStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MapReparses kMapReparses() { return {}; }
+  void set_map_reparses(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MapReparses::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_UnwindingTimeUs =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ProfilePacket_Histogram,
+      ProfilePacket_ProcessStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UnwindingTimeUs kUnwindingTimeUs() { return {}; }
+  template <typename T = ProfilePacket_Histogram> T* set_unwinding_time_us() {
+    return BeginNestedMessage<T>(4);
+  }
+
+
+  using FieldMetadata_TotalUnwindingTimeUs =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProfilePacket_ProcessStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TotalUnwindingTimeUs kTotalUnwindingTimeUs() { return {}; }
+  void set_total_unwinding_time_us(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TotalUnwindingTimeUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ClientSpinlockBlockedUs =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProfilePacket_ProcessStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ClientSpinlockBlockedUs kClientSpinlockBlockedUs() { return {}; }
+  void set_client_spinlock_blocked_us(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ClientSpinlockBlockedUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class ProfilePacket_Histogram_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  ProfilePacket_Histogram_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ProfilePacket_Histogram_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ProfilePacket_Histogram_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_buckets() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> buckets() const { return GetRepeated<::protozero::ConstBytes>(1); }
+};
+
+class ProfilePacket_Histogram : public ::protozero::Message {
+ public:
+  using Decoder = ProfilePacket_Histogram_Decoder;
+  enum : int32_t {
+    kBucketsFieldNumber = 1,
+  };
+  using Bucket = ::perfetto::protos::pbzero::ProfilePacket_Histogram_Bucket;
+
+  using FieldMetadata_Buckets =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ProfilePacket_Histogram_Bucket,
+      ProfilePacket_Histogram>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Buckets kBuckets() { return {}; }
+  template <typename T = ProfilePacket_Histogram_Bucket> T* add_buckets() {
+    return BeginNestedMessage<T>(1);
+  }
+
+};
+
+class ProfilePacket_Histogram_Bucket_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ProfilePacket_Histogram_Bucket_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ProfilePacket_Histogram_Bucket_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ProfilePacket_Histogram_Bucket_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_upper_limit() const { return at<1>().valid(); }
+  uint64_t upper_limit() const { return at<1>().as_uint64(); }
+  bool has_max_bucket() const { return at<2>().valid(); }
+  bool max_bucket() const { return at<2>().as_bool(); }
+  bool has_count() const { return at<3>().valid(); }
+  uint64_t count() const { return at<3>().as_uint64(); }
+};
+
+class ProfilePacket_Histogram_Bucket : public ::protozero::Message {
+ public:
+  using Decoder = ProfilePacket_Histogram_Bucket_Decoder;
+  enum : int32_t {
+    kUpperLimitFieldNumber = 1,
+    kMaxBucketFieldNumber = 2,
+    kCountFieldNumber = 3,
+  };
+
+  using FieldMetadata_UpperLimit =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProfilePacket_Histogram_Bucket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UpperLimit kUpperLimit() { return {}; }
+  void set_upper_limit(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_UpperLimit::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MaxBucket =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ProfilePacket_Histogram_Bucket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MaxBucket kMaxBucket() { return {}; }
+  void set_max_bucket(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_MaxBucket::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Count =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProfilePacket_Histogram_Bucket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Count kCount() { return {}; }
+  void set_count(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Count::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class ProfilePacket_HeapSample_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/9, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ProfilePacket_HeapSample_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ProfilePacket_HeapSample_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ProfilePacket_HeapSample_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_callstack_id() const { return at<1>().valid(); }
+  uint64_t callstack_id() const { return at<1>().as_uint64(); }
+  bool has_self_allocated() const { return at<2>().valid(); }
+  uint64_t self_allocated() const { return at<2>().as_uint64(); }
+  bool has_self_freed() const { return at<3>().valid(); }
+  uint64_t self_freed() const { return at<3>().as_uint64(); }
+  bool has_self_max() const { return at<8>().valid(); }
+  uint64_t self_max() const { return at<8>().as_uint64(); }
+  bool has_self_max_count() const { return at<9>().valid(); }
+  uint64_t self_max_count() const { return at<9>().as_uint64(); }
+  bool has_timestamp() const { return at<4>().valid(); }
+  uint64_t timestamp() const { return at<4>().as_uint64(); }
+  bool has_alloc_count() const { return at<5>().valid(); }
+  uint64_t alloc_count() const { return at<5>().as_uint64(); }
+  bool has_free_count() const { return at<6>().valid(); }
+  uint64_t free_count() const { return at<6>().as_uint64(); }
+};
+
+class ProfilePacket_HeapSample : public ::protozero::Message {
+ public:
+  using Decoder = ProfilePacket_HeapSample_Decoder;
+  enum : int32_t {
+    kCallstackIdFieldNumber = 1,
+    kSelfAllocatedFieldNumber = 2,
+    kSelfFreedFieldNumber = 3,
+    kSelfMaxFieldNumber = 8,
+    kSelfMaxCountFieldNumber = 9,
+    kTimestampFieldNumber = 4,
+    kAllocCountFieldNumber = 5,
+    kFreeCountFieldNumber = 6,
+  };
+
+  using FieldMetadata_CallstackId =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProfilePacket_HeapSample>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CallstackId kCallstackId() { return {}; }
+  void set_callstack_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CallstackId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SelfAllocated =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProfilePacket_HeapSample>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SelfAllocated kSelfAllocated() { return {}; }
+  void set_self_allocated(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SelfAllocated::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SelfFreed =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProfilePacket_HeapSample>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SelfFreed kSelfFreed() { return {}; }
+  void set_self_freed(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SelfFreed::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SelfMax =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProfilePacket_HeapSample>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SelfMax kSelfMax() { return {}; }
+  void set_self_max(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SelfMax::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SelfMaxCount =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProfilePacket_HeapSample>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SelfMaxCount kSelfMaxCount() { return {}; }
+  void set_self_max_count(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SelfMaxCount::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Timestamp =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProfilePacket_HeapSample>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Timestamp kTimestamp() { return {}; }
+  void set_timestamp(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Timestamp::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_AllocCount =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProfilePacket_HeapSample>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AllocCount kAllocCount() { return {}; }
+  void set_alloc_count(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_AllocCount::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FreeCount =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProfilePacket_HeapSample>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FreeCount kFreeCount() { return {}; }
+  void set_free_count(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FreeCount::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/profiling/smaps.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_SMAPS_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_SMAPS_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class SmapsEntry;
+
+class SmapsPacket_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  SmapsPacket_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SmapsPacket_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SmapsPacket_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_pid() const { return at<1>().valid(); }
+  uint32_t pid() const { return at<1>().as_uint32(); }
+  bool has_entries() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> entries() const { return GetRepeated<::protozero::ConstBytes>(2); }
+};
+
+class SmapsPacket : public ::protozero::Message {
+ public:
+  using Decoder = SmapsPacket_Decoder;
+  enum : int32_t {
+    kPidFieldNumber = 1,
+    kEntriesFieldNumber = 2,
+  };
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SmapsPacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Entries =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SmapsEntry,
+      SmapsPacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Entries kEntries() { return {}; }
+  template <typename T = SmapsEntry> T* add_entries() {
+    return BeginNestedMessage<T>(2);
+  }
+
+};
+
+class SmapsEntry_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/15, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SmapsEntry_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SmapsEntry_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SmapsEntry_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_path() const { return at<1>().valid(); }
+  ::protozero::ConstChars path() const { return at<1>().as_string(); }
+  bool has_size_kb() const { return at<2>().valid(); }
+  uint64_t size_kb() const { return at<2>().as_uint64(); }
+  bool has_private_dirty_kb() const { return at<3>().valid(); }
+  uint64_t private_dirty_kb() const { return at<3>().as_uint64(); }
+  bool has_swap_kb() const { return at<4>().valid(); }
+  uint64_t swap_kb() const { return at<4>().as_uint64(); }
+  bool has_file_name() const { return at<5>().valid(); }
+  ::protozero::ConstChars file_name() const { return at<5>().as_string(); }
+  bool has_start_address() const { return at<6>().valid(); }
+  uint64_t start_address() const { return at<6>().as_uint64(); }
+  bool has_module_timestamp() const { return at<7>().valid(); }
+  uint64_t module_timestamp() const { return at<7>().as_uint64(); }
+  bool has_module_debugid() const { return at<8>().valid(); }
+  ::protozero::ConstChars module_debugid() const { return at<8>().as_string(); }
+  bool has_module_debug_path() const { return at<9>().valid(); }
+  ::protozero::ConstChars module_debug_path() const { return at<9>().as_string(); }
+  bool has_protection_flags() const { return at<10>().valid(); }
+  uint32_t protection_flags() const { return at<10>().as_uint32(); }
+  bool has_private_clean_resident_kb() const { return at<11>().valid(); }
+  uint64_t private_clean_resident_kb() const { return at<11>().as_uint64(); }
+  bool has_shared_dirty_resident_kb() const { return at<12>().valid(); }
+  uint64_t shared_dirty_resident_kb() const { return at<12>().as_uint64(); }
+  bool has_shared_clean_resident_kb() const { return at<13>().valid(); }
+  uint64_t shared_clean_resident_kb() const { return at<13>().as_uint64(); }
+  bool has_locked_kb() const { return at<14>().valid(); }
+  uint64_t locked_kb() const { return at<14>().as_uint64(); }
+  bool has_proportional_resident_kb() const { return at<15>().valid(); }
+  uint64_t proportional_resident_kb() const { return at<15>().as_uint64(); }
+};
+
+class SmapsEntry : public ::protozero::Message {
+ public:
+  using Decoder = SmapsEntry_Decoder;
+  enum : int32_t {
+    kPathFieldNumber = 1,
+    kSizeKbFieldNumber = 2,
+    kPrivateDirtyKbFieldNumber = 3,
+    kSwapKbFieldNumber = 4,
+    kFileNameFieldNumber = 5,
+    kStartAddressFieldNumber = 6,
+    kModuleTimestampFieldNumber = 7,
+    kModuleDebugidFieldNumber = 8,
+    kModuleDebugPathFieldNumber = 9,
+    kProtectionFlagsFieldNumber = 10,
+    kPrivateCleanResidentKbFieldNumber = 11,
+    kSharedDirtyResidentKbFieldNumber = 12,
+    kSharedCleanResidentKbFieldNumber = 13,
+    kLockedKbFieldNumber = 14,
+    kProportionalResidentKbFieldNumber = 15,
+  };
+
+  using FieldMetadata_Path =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SmapsEntry>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Path kPath() { return {}; }
+  void set_path(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Path::kFieldId, data, size);
+  }
+  void set_path(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Path::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SizeKb =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SmapsEntry>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SizeKb kSizeKb() { return {}; }
+  void set_size_kb(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SizeKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PrivateDirtyKb =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SmapsEntry>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PrivateDirtyKb kPrivateDirtyKb() { return {}; }
+  void set_private_dirty_kb(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PrivateDirtyKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SwapKb =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SmapsEntry>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SwapKb kSwapKb() { return {}; }
+  void set_swap_kb(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SwapKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FileName =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SmapsEntry>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FileName kFileName() { return {}; }
+  void set_file_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_FileName::kFieldId, data, size);
+  }
+  void set_file_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_FileName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_StartAddress =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SmapsEntry>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StartAddress kStartAddress() { return {}; }
+  void set_start_address(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_StartAddress::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ModuleTimestamp =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SmapsEntry>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ModuleTimestamp kModuleTimestamp() { return {}; }
+  void set_module_timestamp(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ModuleTimestamp::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ModuleDebugid =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SmapsEntry>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ModuleDebugid kModuleDebugid() { return {}; }
+  void set_module_debugid(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ModuleDebugid::kFieldId, data, size);
+  }
+  void set_module_debugid(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ModuleDebugid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ModuleDebugPath =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SmapsEntry>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ModuleDebugPath kModuleDebugPath() { return {}; }
+  void set_module_debug_path(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ModuleDebugPath::kFieldId, data, size);
+  }
+  void set_module_debug_path(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ModuleDebugPath::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ProtectionFlags =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SmapsEntry>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProtectionFlags kProtectionFlags() { return {}; }
+  void set_protection_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProtectionFlags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PrivateCleanResidentKb =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SmapsEntry>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PrivateCleanResidentKb kPrivateCleanResidentKb() { return {}; }
+  void set_private_clean_resident_kb(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PrivateCleanResidentKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SharedDirtyResidentKb =
+    ::protozero::proto_utils::FieldMetadata<
+      12,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SmapsEntry>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SharedDirtyResidentKb kSharedDirtyResidentKb() { return {}; }
+  void set_shared_dirty_resident_kb(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SharedDirtyResidentKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SharedCleanResidentKb =
+    ::protozero::proto_utils::FieldMetadata<
+      13,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SmapsEntry>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SharedCleanResidentKb kSharedCleanResidentKb() { return {}; }
+  void set_shared_clean_resident_kb(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SharedCleanResidentKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LockedKb =
+    ::protozero::proto_utils::FieldMetadata<
+      14,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SmapsEntry>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LockedKb kLockedKb() { return {}; }
+  void set_locked_kb(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_LockedKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ProportionalResidentKb =
+    ::protozero::proto_utils::FieldMetadata<
+      15,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SmapsEntry>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProportionalResidentKb kProportionalResidentKb() { return {}; }
+  void set_proportional_resident_kb(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProportionalResidentKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_application_state_info.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_APPLICATION_STATE_INFO_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_APPLICATION_STATE_INFO_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+enum ChromeApplicationStateInfo_ChromeApplicationState : int32_t;
+
+enum ChromeApplicationStateInfo_ChromeApplicationState : int32_t {
+  ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_UNKNOWN = 0,
+  ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_HAS_RUNNING_ACTIVITIES = 1,
+  ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_HAS_PAUSED_ACTIVITIES = 2,
+  ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_HAS_STOPPED_ACTIVITIES = 3,
+  ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_HAS_DESTROYED_ACTIVITIES = 4,
+};
+
+const ChromeApplicationStateInfo_ChromeApplicationState ChromeApplicationStateInfo_ChromeApplicationState_MIN = ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_UNKNOWN;
+const ChromeApplicationStateInfo_ChromeApplicationState ChromeApplicationStateInfo_ChromeApplicationState_MAX = ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_HAS_DESTROYED_ACTIVITIES;
+
+class ChromeApplicationStateInfo_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ChromeApplicationStateInfo_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ChromeApplicationStateInfo_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ChromeApplicationStateInfo_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_application_state() const { return at<1>().valid(); }
+  int32_t application_state() const { return at<1>().as_int32(); }
+};
+
+class ChromeApplicationStateInfo : public ::protozero::Message {
+ public:
+  using Decoder = ChromeApplicationStateInfo_Decoder;
+  enum : int32_t {
+    kApplicationStateFieldNumber = 1,
+  };
+  using ChromeApplicationState = ::perfetto::protos::pbzero::ChromeApplicationStateInfo_ChromeApplicationState;
+  static const ChromeApplicationState APPLICATION_STATE_UNKNOWN = ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_UNKNOWN;
+  static const ChromeApplicationState APPLICATION_STATE_HAS_RUNNING_ACTIVITIES = ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_HAS_RUNNING_ACTIVITIES;
+  static const ChromeApplicationState APPLICATION_STATE_HAS_PAUSED_ACTIVITIES = ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_HAS_PAUSED_ACTIVITIES;
+  static const ChromeApplicationState APPLICATION_STATE_HAS_STOPPED_ACTIVITIES = ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_HAS_STOPPED_ACTIVITIES;
+  static const ChromeApplicationState APPLICATION_STATE_HAS_DESTROYED_ACTIVITIES = ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_HAS_DESTROYED_ACTIVITIES;
+
+  using FieldMetadata_ApplicationState =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ChromeApplicationStateInfo_ChromeApplicationState,
+      ChromeApplicationStateInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ApplicationState kApplicationState() { return {}; }
+  void set_application_state(::perfetto::protos::pbzero::ChromeApplicationStateInfo_ChromeApplicationState value) {
+    static constexpr uint32_t field_id = FieldMetadata_ApplicationState::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_compositor_scheduler_state.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_COMPOSITOR_SCHEDULER_STATE_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_COMPOSITOR_SCHEDULER_STATE_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class BeginFrameArgs;
+class BeginFrameObserverState;
+class BeginFrameSourceState;
+class BeginImplFrameArgs;
+class BeginImplFrameArgs_TimestampsInUs;
+class ChromeCompositorStateMachine;
+class ChromeCompositorStateMachine_MajorState;
+class ChromeCompositorStateMachine_MinorState;
+class CompositorTimingHistory;
+class SourceLocation;
+enum BeginFrameArgs_BeginFrameArgsType : int32_t;
+enum BeginImplFrameArgs_State : int32_t;
+enum ChromeCompositorSchedulerAction : int32_t;
+enum ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode : int32_t;
+enum ChromeCompositorStateMachine_MajorState_BeginImplFrameState : int32_t;
+enum ChromeCompositorStateMachine_MajorState_BeginMainFrameState : int32_t;
+enum ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState : int32_t;
+enum ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState : int32_t;
+enum ChromeCompositorStateMachine_MinorState_ScrollHandlerState : int32_t;
+enum ChromeCompositorStateMachine_MinorState_TreePriority : int32_t;
+
+enum ChromeCompositorSchedulerAction : int32_t {
+  CC_SCHEDULER_ACTION_UNSPECIFIED = 0,
+  CC_SCHEDULER_ACTION_NONE = 1,
+  CC_SCHEDULER_ACTION_SEND_BEGIN_MAIN_FRAME = 2,
+  CC_SCHEDULER_ACTION_COMMIT = 3,
+  CC_SCHEDULER_ACTION_ACTIVATE_SYNC_TREE = 4,
+  CC_SCHEDULER_ACTION_DRAW_IF_POSSIBLE = 5,
+  CC_SCHEDULER_ACTION_DRAW_FORCED = 6,
+  CC_SCHEDULER_ACTION_DRAW_ABORT = 7,
+  CC_SCHEDULER_ACTION_BEGIN_LAYER_TREE_FRAME_SINK_CREATION = 8,
+  CC_SCHEDULER_ACTION_PREPARE_TILES = 9,
+  CC_SCHEDULER_ACTION_INVALIDATE_LAYER_TREE_FRAME_SINK = 10,
+  CC_SCHEDULER_ACTION_PERFORM_IMPL_SIDE_INVALIDATION = 11,
+  CC_SCHEDULER_ACTION_NOTIFY_BEGIN_MAIN_FRAME_NOT_EXPECTED_UNTIL = 12,
+  CC_SCHEDULER_ACTION_NOTIFY_BEGIN_MAIN_FRAME_NOT_EXPECTED_SOON = 13,
+};
+
+const ChromeCompositorSchedulerAction ChromeCompositorSchedulerAction_MIN = CC_SCHEDULER_ACTION_UNSPECIFIED;
+const ChromeCompositorSchedulerAction ChromeCompositorSchedulerAction_MAX = CC_SCHEDULER_ACTION_NOTIFY_BEGIN_MAIN_FRAME_NOT_EXPECTED_SOON;
+
+enum BeginImplFrameArgs_State : int32_t {
+  BeginImplFrameArgs_State_BEGIN_FRAME_FINISHED = 0,
+  BeginImplFrameArgs_State_BEGIN_FRAME_USING = 1,
+};
+
+const BeginImplFrameArgs_State BeginImplFrameArgs_State_MIN = BeginImplFrameArgs_State_BEGIN_FRAME_FINISHED;
+const BeginImplFrameArgs_State BeginImplFrameArgs_State_MAX = BeginImplFrameArgs_State_BEGIN_FRAME_USING;
+
+enum BeginFrameArgs_BeginFrameArgsType : int32_t {
+  BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_UNSPECIFIED = 0,
+  BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_INVALID = 1,
+  BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_NORMAL = 2,
+  BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_MISSED = 3,
+};
+
+const BeginFrameArgs_BeginFrameArgsType BeginFrameArgs_BeginFrameArgsType_MIN = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_UNSPECIFIED;
+const BeginFrameArgs_BeginFrameArgsType BeginFrameArgs_BeginFrameArgsType_MAX = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_MISSED;
+
+enum ChromeCompositorStateMachine_MinorState_TreePriority : int32_t {
+  ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_UNSPECIFIED = 0,
+  ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_SAME_PRIORITY_FOR_BOTH_TREES = 1,
+  ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_SMOOTHNESS_TAKES_PRIORITY = 2,
+  ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_NEW_CONTENT_TAKES_PRIORITY = 3,
+};
+
+const ChromeCompositorStateMachine_MinorState_TreePriority ChromeCompositorStateMachine_MinorState_TreePriority_MIN = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_UNSPECIFIED;
+const ChromeCompositorStateMachine_MinorState_TreePriority ChromeCompositorStateMachine_MinorState_TreePriority_MAX = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_NEW_CONTENT_TAKES_PRIORITY;
+
+enum ChromeCompositorStateMachine_MinorState_ScrollHandlerState : int32_t {
+  ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_HANDLER_UNSPECIFIED = 0,
+  ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_AFFECTS_SCROLL_HANDLER = 1,
+  ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_DOES_NOT_AFFECT_SCROLL_HANDLER = 2,
+};
+
+const ChromeCompositorStateMachine_MinorState_ScrollHandlerState ChromeCompositorStateMachine_MinorState_ScrollHandlerState_MIN = ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_HANDLER_UNSPECIFIED;
+const ChromeCompositorStateMachine_MinorState_ScrollHandlerState ChromeCompositorStateMachine_MinorState_ScrollHandlerState_MAX = ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_DOES_NOT_AFFECT_SCROLL_HANDLER;
+
+enum ChromeCompositorStateMachine_MajorState_BeginImplFrameState : int32_t {
+  ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_UNSPECIFIED = 0,
+  ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_IDLE = 1,
+  ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_INSIDE_BEGIN_FRAME = 2,
+  ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_INSIDE_DEADLINE = 3,
+};
+
+const ChromeCompositorStateMachine_MajorState_BeginImplFrameState ChromeCompositorStateMachine_MajorState_BeginImplFrameState_MIN = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_UNSPECIFIED;
+const ChromeCompositorStateMachine_MajorState_BeginImplFrameState ChromeCompositorStateMachine_MajorState_BeginImplFrameState_MAX = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_INSIDE_DEADLINE;
+
+enum ChromeCompositorStateMachine_MajorState_BeginMainFrameState : int32_t {
+  ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_UNSPECIFIED = 0,
+  ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_IDLE = 1,
+  ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_SENT = 2,
+  ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_READY_TO_COMMIT = 3,
+};
+
+const ChromeCompositorStateMachine_MajorState_BeginMainFrameState ChromeCompositorStateMachine_MajorState_BeginMainFrameState_MIN = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_UNSPECIFIED;
+const ChromeCompositorStateMachine_MajorState_BeginMainFrameState ChromeCompositorStateMachine_MajorState_BeginMainFrameState_MAX = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_READY_TO_COMMIT;
+
+enum ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState : int32_t {
+  ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_UNSPECIFIED = 0,
+  ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_NONE = 1,
+  ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_ACTIVE = 2,
+  ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_CREATING = 3,
+  ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_WAITING_FOR_FIRST_COMMIT = 4,
+  ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_WAITING_FOR_FIRST_ACTIVATION = 5,
+};
+
+const ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_MIN = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_UNSPECIFIED;
+const ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_MAX = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_WAITING_FOR_FIRST_ACTIVATION;
+
+enum ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState : int32_t {
+  ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_UNSPECIFIED = 0,
+  ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_IDLE = 1,
+  ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_COMMIT = 2,
+  ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_ACTIVATION = 3,
+  ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_DRAW = 4,
+};
+
+const ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_MIN = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_UNSPECIFIED;
+const ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_MAX = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_DRAW;
+
+enum ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode : int32_t {
+  ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_UNSPECIFIED = 0,
+  ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_NONE = 1,
+  ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_IMMEDIATE = 2,
+  ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_REGULAR = 3,
+  ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_LATE = 4,
+  ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_BLOCKED = 5,
+};
+
+const ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_MIN = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_UNSPECIFIED;
+const ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_MAX = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_BLOCKED;
+
+class CompositorTimingHistory_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  CompositorTimingHistory_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit CompositorTimingHistory_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit CompositorTimingHistory_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_begin_main_frame_queue_critical_estimate_delta_us() const { return at<1>().valid(); }
+  int64_t begin_main_frame_queue_critical_estimate_delta_us() const { return at<1>().as_int64(); }
+  bool has_begin_main_frame_queue_not_critical_estimate_delta_us() const { return at<2>().valid(); }
+  int64_t begin_main_frame_queue_not_critical_estimate_delta_us() const { return at<2>().as_int64(); }
+  bool has_begin_main_frame_start_to_ready_to_commit_estimate_delta_us() const { return at<3>().valid(); }
+  int64_t begin_main_frame_start_to_ready_to_commit_estimate_delta_us() const { return at<3>().as_int64(); }
+  bool has_commit_to_ready_to_activate_estimate_delta_us() const { return at<4>().valid(); }
+  int64_t commit_to_ready_to_activate_estimate_delta_us() const { return at<4>().as_int64(); }
+  bool has_prepare_tiles_estimate_delta_us() const { return at<5>().valid(); }
+  int64_t prepare_tiles_estimate_delta_us() const { return at<5>().as_int64(); }
+  bool has_activate_estimate_delta_us() const { return at<6>().valid(); }
+  int64_t activate_estimate_delta_us() const { return at<6>().as_int64(); }
+  bool has_draw_estimate_delta_us() const { return at<7>().valid(); }
+  int64_t draw_estimate_delta_us() const { return at<7>().as_int64(); }
+};
+
+class CompositorTimingHistory : public ::protozero::Message {
+ public:
+  using Decoder = CompositorTimingHistory_Decoder;
+  enum : int32_t {
+    kBeginMainFrameQueueCriticalEstimateDeltaUsFieldNumber = 1,
+    kBeginMainFrameQueueNotCriticalEstimateDeltaUsFieldNumber = 2,
+    kBeginMainFrameStartToReadyToCommitEstimateDeltaUsFieldNumber = 3,
+    kCommitToReadyToActivateEstimateDeltaUsFieldNumber = 4,
+    kPrepareTilesEstimateDeltaUsFieldNumber = 5,
+    kActivateEstimateDeltaUsFieldNumber = 6,
+    kDrawEstimateDeltaUsFieldNumber = 7,
+  };
+
+  using FieldMetadata_BeginMainFrameQueueCriticalEstimateDeltaUs =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      CompositorTimingHistory>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BeginMainFrameQueueCriticalEstimateDeltaUs kBeginMainFrameQueueCriticalEstimateDeltaUs() { return {}; }
+  void set_begin_main_frame_queue_critical_estimate_delta_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BeginMainFrameQueueCriticalEstimateDeltaUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BeginMainFrameQueueNotCriticalEstimateDeltaUs =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      CompositorTimingHistory>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BeginMainFrameQueueNotCriticalEstimateDeltaUs kBeginMainFrameQueueNotCriticalEstimateDeltaUs() { return {}; }
+  void set_begin_main_frame_queue_not_critical_estimate_delta_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BeginMainFrameQueueNotCriticalEstimateDeltaUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BeginMainFrameStartToReadyToCommitEstimateDeltaUs =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      CompositorTimingHistory>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BeginMainFrameStartToReadyToCommitEstimateDeltaUs kBeginMainFrameStartToReadyToCommitEstimateDeltaUs() { return {}; }
+  void set_begin_main_frame_start_to_ready_to_commit_estimate_delta_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BeginMainFrameStartToReadyToCommitEstimateDeltaUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CommitToReadyToActivateEstimateDeltaUs =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      CompositorTimingHistory>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CommitToReadyToActivateEstimateDeltaUs kCommitToReadyToActivateEstimateDeltaUs() { return {}; }
+  void set_commit_to_ready_to_activate_estimate_delta_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CommitToReadyToActivateEstimateDeltaUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PrepareTilesEstimateDeltaUs =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      CompositorTimingHistory>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PrepareTilesEstimateDeltaUs kPrepareTilesEstimateDeltaUs() { return {}; }
+  void set_prepare_tiles_estimate_delta_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PrepareTilesEstimateDeltaUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ActivateEstimateDeltaUs =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      CompositorTimingHistory>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ActivateEstimateDeltaUs kActivateEstimateDeltaUs() { return {}; }
+  void set_activate_estimate_delta_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ActivateEstimateDeltaUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DrawEstimateDeltaUs =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      CompositorTimingHistory>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DrawEstimateDeltaUs kDrawEstimateDeltaUs() { return {}; }
+  void set_draw_estimate_delta_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DrawEstimateDeltaUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class BeginFrameSourceState_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BeginFrameSourceState_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BeginFrameSourceState_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BeginFrameSourceState_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_source_id() const { return at<1>().valid(); }
+  uint32_t source_id() const { return at<1>().as_uint32(); }
+  bool has_paused() const { return at<2>().valid(); }
+  bool paused() const { return at<2>().as_bool(); }
+  bool has_num_observers() const { return at<3>().valid(); }
+  uint32_t num_observers() const { return at<3>().as_uint32(); }
+  bool has_last_begin_frame_args() const { return at<4>().valid(); }
+  ::protozero::ConstBytes last_begin_frame_args() const { return at<4>().as_bytes(); }
+};
+
+class BeginFrameSourceState : public ::protozero::Message {
+ public:
+  using Decoder = BeginFrameSourceState_Decoder;
+  enum : int32_t {
+    kSourceIdFieldNumber = 1,
+    kPausedFieldNumber = 2,
+    kNumObserversFieldNumber = 3,
+    kLastBeginFrameArgsFieldNumber = 4,
+  };
+
+  using FieldMetadata_SourceId =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      BeginFrameSourceState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SourceId kSourceId() { return {}; }
+  void set_source_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SourceId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Paused =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      BeginFrameSourceState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Paused kPaused() { return {}; }
+  void set_paused(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_Paused::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NumObservers =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      BeginFrameSourceState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NumObservers kNumObservers() { return {}; }
+  void set_num_observers(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NumObservers::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LastBeginFrameArgs =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BeginFrameArgs,
+      BeginFrameSourceState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LastBeginFrameArgs kLastBeginFrameArgs() { return {}; }
+  template <typename T = BeginFrameArgs> T* set_last_begin_frame_args() {
+    return BeginNestedMessage<T>(4);
+  }
+
+};
+
+class BeginFrameObserverState_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BeginFrameObserverState_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BeginFrameObserverState_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BeginFrameObserverState_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dropped_begin_frame_args() const { return at<1>().valid(); }
+  int64_t dropped_begin_frame_args() const { return at<1>().as_int64(); }
+  bool has_last_begin_frame_args() const { return at<2>().valid(); }
+  ::protozero::ConstBytes last_begin_frame_args() const { return at<2>().as_bytes(); }
+};
+
+class BeginFrameObserverState : public ::protozero::Message {
+ public:
+  using Decoder = BeginFrameObserverState_Decoder;
+  enum : int32_t {
+    kDroppedBeginFrameArgsFieldNumber = 1,
+    kLastBeginFrameArgsFieldNumber = 2,
+  };
+
+  using FieldMetadata_DroppedBeginFrameArgs =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      BeginFrameObserverState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DroppedBeginFrameArgs kDroppedBeginFrameArgs() { return {}; }
+  void set_dropped_begin_frame_args(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DroppedBeginFrameArgs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LastBeginFrameArgs =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BeginFrameArgs,
+      BeginFrameObserverState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LastBeginFrameArgs kLastBeginFrameArgs() { return {}; }
+  template <typename T = BeginFrameArgs> T* set_last_begin_frame_args() {
+    return BeginNestedMessage<T>(2);
+  }
+
+};
+
+class BeginImplFrameArgs_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BeginImplFrameArgs_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BeginImplFrameArgs_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BeginImplFrameArgs_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_updated_at_us() const { return at<1>().valid(); }
+  int64_t updated_at_us() const { return at<1>().as_int64(); }
+  bool has_finished_at_us() const { return at<2>().valid(); }
+  int64_t finished_at_us() const { return at<2>().as_int64(); }
+  bool has_state() const { return at<3>().valid(); }
+  int32_t state() const { return at<3>().as_int32(); }
+  bool has_current_args() const { return at<4>().valid(); }
+  ::protozero::ConstBytes current_args() const { return at<4>().as_bytes(); }
+  bool has_last_args() const { return at<5>().valid(); }
+  ::protozero::ConstBytes last_args() const { return at<5>().as_bytes(); }
+  bool has_timestamps_in_us() const { return at<6>().valid(); }
+  ::protozero::ConstBytes timestamps_in_us() const { return at<6>().as_bytes(); }
+};
+
+class BeginImplFrameArgs : public ::protozero::Message {
+ public:
+  using Decoder = BeginImplFrameArgs_Decoder;
+  enum : int32_t {
+    kUpdatedAtUsFieldNumber = 1,
+    kFinishedAtUsFieldNumber = 2,
+    kStateFieldNumber = 3,
+    kCurrentArgsFieldNumber = 4,
+    kLastArgsFieldNumber = 5,
+    kTimestampsInUsFieldNumber = 6,
+  };
+  using TimestampsInUs = ::perfetto::protos::pbzero::BeginImplFrameArgs_TimestampsInUs;
+  using State = ::perfetto::protos::pbzero::BeginImplFrameArgs_State;
+  static const State BEGIN_FRAME_FINISHED = BeginImplFrameArgs_State_BEGIN_FRAME_FINISHED;
+  static const State BEGIN_FRAME_USING = BeginImplFrameArgs_State_BEGIN_FRAME_USING;
+
+  using FieldMetadata_UpdatedAtUs =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      BeginImplFrameArgs>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UpdatedAtUs kUpdatedAtUs() { return {}; }
+  void set_updated_at_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_UpdatedAtUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FinishedAtUs =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      BeginImplFrameArgs>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FinishedAtUs kFinishedAtUs() { return {}; }
+  void set_finished_at_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FinishedAtUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_State =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::BeginImplFrameArgs_State,
+      BeginImplFrameArgs>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_State kState() { return {}; }
+  void set_state(::perfetto::protos::pbzero::BeginImplFrameArgs_State value) {
+    static constexpr uint32_t field_id = FieldMetadata_State::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CurrentArgs =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BeginFrameArgs,
+      BeginImplFrameArgs>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CurrentArgs kCurrentArgs() { return {}; }
+  template <typename T = BeginFrameArgs> T* set_current_args() {
+    return BeginNestedMessage<T>(4);
+  }
+
+
+  using FieldMetadata_LastArgs =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BeginFrameArgs,
+      BeginImplFrameArgs>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LastArgs kLastArgs() { return {}; }
+  template <typename T = BeginFrameArgs> T* set_last_args() {
+    return BeginNestedMessage<T>(5);
+  }
+
+
+  using FieldMetadata_TimestampsInUs =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BeginImplFrameArgs_TimestampsInUs,
+      BeginImplFrameArgs>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TimestampsInUs kTimestampsInUs() { return {}; }
+  template <typename T = BeginImplFrameArgs_TimestampsInUs> T* set_timestamps_in_us() {
+    return BeginNestedMessage<T>(6);
+  }
+
+};
+
+class BeginImplFrameArgs_TimestampsInUs_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BeginImplFrameArgs_TimestampsInUs_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BeginImplFrameArgs_TimestampsInUs_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BeginImplFrameArgs_TimestampsInUs_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_interval_delta() const { return at<1>().valid(); }
+  int64_t interval_delta() const { return at<1>().as_int64(); }
+  bool has_now_to_deadline_delta() const { return at<2>().valid(); }
+  int64_t now_to_deadline_delta() const { return at<2>().as_int64(); }
+  bool has_frame_time_to_now_delta() const { return at<3>().valid(); }
+  int64_t frame_time_to_now_delta() const { return at<3>().as_int64(); }
+  bool has_frame_time_to_deadline_delta() const { return at<4>().valid(); }
+  int64_t frame_time_to_deadline_delta() const { return at<4>().as_int64(); }
+  bool has_now() const { return at<5>().valid(); }
+  int64_t now() const { return at<5>().as_int64(); }
+  bool has_frame_time() const { return at<6>().valid(); }
+  int64_t frame_time() const { return at<6>().as_int64(); }
+  bool has_deadline() const { return at<7>().valid(); }
+  int64_t deadline() const { return at<7>().as_int64(); }
+};
+
+class BeginImplFrameArgs_TimestampsInUs : public ::protozero::Message {
+ public:
+  using Decoder = BeginImplFrameArgs_TimestampsInUs_Decoder;
+  enum : int32_t {
+    kIntervalDeltaFieldNumber = 1,
+    kNowToDeadlineDeltaFieldNumber = 2,
+    kFrameTimeToNowDeltaFieldNumber = 3,
+    kFrameTimeToDeadlineDeltaFieldNumber = 4,
+    kNowFieldNumber = 5,
+    kFrameTimeFieldNumber = 6,
+    kDeadlineFieldNumber = 7,
+  };
+
+  using FieldMetadata_IntervalDelta =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      BeginImplFrameArgs_TimestampsInUs>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IntervalDelta kIntervalDelta() { return {}; }
+  void set_interval_delta(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IntervalDelta::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NowToDeadlineDelta =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      BeginImplFrameArgs_TimestampsInUs>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NowToDeadlineDelta kNowToDeadlineDelta() { return {}; }
+  void set_now_to_deadline_delta(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NowToDeadlineDelta::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FrameTimeToNowDelta =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      BeginImplFrameArgs_TimestampsInUs>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FrameTimeToNowDelta kFrameTimeToNowDelta() { return {}; }
+  void set_frame_time_to_now_delta(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FrameTimeToNowDelta::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FrameTimeToDeadlineDelta =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      BeginImplFrameArgs_TimestampsInUs>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FrameTimeToDeadlineDelta kFrameTimeToDeadlineDelta() { return {}; }
+  void set_frame_time_to_deadline_delta(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FrameTimeToDeadlineDelta::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Now =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      BeginImplFrameArgs_TimestampsInUs>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Now kNow() { return {}; }
+  void set_now(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Now::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FrameTime =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      BeginImplFrameArgs_TimestampsInUs>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FrameTime kFrameTime() { return {}; }
+  void set_frame_time(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FrameTime::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Deadline =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      BeginImplFrameArgs_TimestampsInUs>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Deadline kDeadline() { return {}; }
+  void set_deadline(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Deadline::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class BeginFrameArgs_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/10, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BeginFrameArgs_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BeginFrameArgs_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BeginFrameArgs_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_type() const { return at<1>().valid(); }
+  int32_t type() const { return at<1>().as_int32(); }
+  bool has_source_id() const { return at<2>().valid(); }
+  uint64_t source_id() const { return at<2>().as_uint64(); }
+  bool has_sequence_number() const { return at<3>().valid(); }
+  uint64_t sequence_number() const { return at<3>().as_uint64(); }
+  bool has_frame_time_us() const { return at<4>().valid(); }
+  int64_t frame_time_us() const { return at<4>().as_int64(); }
+  bool has_deadline_us() const { return at<5>().valid(); }
+  int64_t deadline_us() const { return at<5>().as_int64(); }
+  bool has_interval_delta_us() const { return at<6>().valid(); }
+  int64_t interval_delta_us() const { return at<6>().as_int64(); }
+  bool has_on_critical_path() const { return at<7>().valid(); }
+  bool on_critical_path() const { return at<7>().as_bool(); }
+  bool has_animate_only() const { return at<8>().valid(); }
+  bool animate_only() const { return at<8>().as_bool(); }
+  bool has_source_location_iid() const { return at<9>().valid(); }
+  uint64_t source_location_iid() const { return at<9>().as_uint64(); }
+  bool has_source_location() const { return at<10>().valid(); }
+  ::protozero::ConstBytes source_location() const { return at<10>().as_bytes(); }
+};
+
+class BeginFrameArgs : public ::protozero::Message {
+ public:
+  using Decoder = BeginFrameArgs_Decoder;
+  enum : int32_t {
+    kTypeFieldNumber = 1,
+    kSourceIdFieldNumber = 2,
+    kSequenceNumberFieldNumber = 3,
+    kFrameTimeUsFieldNumber = 4,
+    kDeadlineUsFieldNumber = 5,
+    kIntervalDeltaUsFieldNumber = 6,
+    kOnCriticalPathFieldNumber = 7,
+    kAnimateOnlyFieldNumber = 8,
+    kSourceLocationIidFieldNumber = 9,
+    kSourceLocationFieldNumber = 10,
+  };
+  using BeginFrameArgsType = ::perfetto::protos::pbzero::BeginFrameArgs_BeginFrameArgsType;
+  static const BeginFrameArgsType BEGIN_FRAME_ARGS_TYPE_UNSPECIFIED = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_UNSPECIFIED;
+  static const BeginFrameArgsType BEGIN_FRAME_ARGS_TYPE_INVALID = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_INVALID;
+  static const BeginFrameArgsType BEGIN_FRAME_ARGS_TYPE_NORMAL = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_NORMAL;
+  static const BeginFrameArgsType BEGIN_FRAME_ARGS_TYPE_MISSED = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_MISSED;
+
+  using FieldMetadata_Type =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::BeginFrameArgs_BeginFrameArgsType,
+      BeginFrameArgs>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Type kType() { return {}; }
+  void set_type(::perfetto::protos::pbzero::BeginFrameArgs_BeginFrameArgsType value) {
+    static constexpr uint32_t field_id = FieldMetadata_Type::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SourceId =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BeginFrameArgs>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SourceId kSourceId() { return {}; }
+  void set_source_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SourceId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SequenceNumber =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BeginFrameArgs>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SequenceNumber kSequenceNumber() { return {}; }
+  void set_sequence_number(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SequenceNumber::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FrameTimeUs =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      BeginFrameArgs>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FrameTimeUs kFrameTimeUs() { return {}; }
+  void set_frame_time_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FrameTimeUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DeadlineUs =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      BeginFrameArgs>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DeadlineUs kDeadlineUs() { return {}; }
+  void set_deadline_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DeadlineUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IntervalDeltaUs =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      BeginFrameArgs>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IntervalDeltaUs kIntervalDeltaUs() { return {}; }
+  void set_interval_delta_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IntervalDeltaUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OnCriticalPath =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      BeginFrameArgs>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OnCriticalPath kOnCriticalPath() { return {}; }
+  void set_on_critical_path(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_OnCriticalPath::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_AnimateOnly =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      BeginFrameArgs>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AnimateOnly kAnimateOnly() { return {}; }
+  void set_animate_only(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_AnimateOnly::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SourceLocationIid =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      BeginFrameArgs>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SourceLocationIid kSourceLocationIid() { return {}; }
+  void set_source_location_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SourceLocationIid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SourceLocation =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SourceLocation,
+      BeginFrameArgs>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SourceLocation kSourceLocation() { return {}; }
+  template <typename T = SourceLocation> T* set_source_location() {
+    return BeginNestedMessage<T>(10);
+  }
+
+};
+
+class ChromeCompositorStateMachine_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ChromeCompositorStateMachine_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ChromeCompositorStateMachine_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ChromeCompositorStateMachine_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_major_state() const { return at<1>().valid(); }
+  ::protozero::ConstBytes major_state() const { return at<1>().as_bytes(); }
+  bool has_minor_state() const { return at<2>().valid(); }
+  ::protozero::ConstBytes minor_state() const { return at<2>().as_bytes(); }
+};
+
+class ChromeCompositorStateMachine : public ::protozero::Message {
+ public:
+  using Decoder = ChromeCompositorStateMachine_Decoder;
+  enum : int32_t {
+    kMajorStateFieldNumber = 1,
+    kMinorStateFieldNumber = 2,
+  };
+  using MajorState = ::perfetto::protos::pbzero::ChromeCompositorStateMachine_MajorState;
+  using MinorState = ::perfetto::protos::pbzero::ChromeCompositorStateMachine_MinorState;
+
+  using FieldMetadata_MajorState =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeCompositorStateMachine_MajorState,
+      ChromeCompositorStateMachine>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MajorState kMajorState() { return {}; }
+  template <typename T = ChromeCompositorStateMachine_MajorState> T* set_major_state() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_MinorState =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeCompositorStateMachine_MinorState,
+      ChromeCompositorStateMachine>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MinorState kMinorState() { return {}; }
+  template <typename T = ChromeCompositorStateMachine_MinorState> T* set_minor_state() {
+    return BeginNestedMessage<T>(2);
+  }
+
+};
+
+class ChromeCompositorStateMachine_MinorState_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/46, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ChromeCompositorStateMachine_MinorState_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ChromeCompositorStateMachine_MinorState_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ChromeCompositorStateMachine_MinorState_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_commit_count() const { return at<1>().valid(); }
+  int32_t commit_count() const { return at<1>().as_int32(); }
+  bool has_current_frame_number() const { return at<2>().valid(); }
+  int32_t current_frame_number() const { return at<2>().as_int32(); }
+  bool has_last_frame_number_submit_performed() const { return at<3>().valid(); }
+  int32_t last_frame_number_submit_performed() const { return at<3>().as_int32(); }
+  bool has_last_frame_number_draw_performed() const { return at<4>().valid(); }
+  int32_t last_frame_number_draw_performed() const { return at<4>().as_int32(); }
+  bool has_last_frame_number_begin_main_frame_sent() const { return at<5>().valid(); }
+  int32_t last_frame_number_begin_main_frame_sent() const { return at<5>().as_int32(); }
+  bool has_did_draw() const { return at<6>().valid(); }
+  bool did_draw() const { return at<6>().as_bool(); }
+  bool has_did_send_begin_main_frame_for_current_frame() const { return at<7>().valid(); }
+  bool did_send_begin_main_frame_for_current_frame() const { return at<7>().as_bool(); }
+  bool has_did_notify_begin_main_frame_not_expected_until() const { return at<8>().valid(); }
+  bool did_notify_begin_main_frame_not_expected_until() const { return at<8>().as_bool(); }
+  bool has_did_notify_begin_main_frame_not_expected_soon() const { return at<9>().valid(); }
+  bool did_notify_begin_main_frame_not_expected_soon() const { return at<9>().as_bool(); }
+  bool has_wants_begin_main_frame_not_expected() const { return at<10>().valid(); }
+  bool wants_begin_main_frame_not_expected() const { return at<10>().as_bool(); }
+  bool has_did_commit_during_frame() const { return at<11>().valid(); }
+  bool did_commit_during_frame() const { return at<11>().as_bool(); }
+  bool has_did_invalidate_layer_tree_frame_sink() const { return at<12>().valid(); }
+  bool did_invalidate_layer_tree_frame_sink() const { return at<12>().as_bool(); }
+  bool has_did_perform_impl_side_invalidaion() const { return at<13>().valid(); }
+  bool did_perform_impl_side_invalidaion() const { return at<13>().as_bool(); }
+  bool has_did_prepare_tiles() const { return at<14>().valid(); }
+  bool did_prepare_tiles() const { return at<14>().as_bool(); }
+  bool has_consecutive_checkerboard_animations() const { return at<15>().valid(); }
+  int32_t consecutive_checkerboard_animations() const { return at<15>().as_int32(); }
+  bool has_pending_submit_frames() const { return at<16>().valid(); }
+  int32_t pending_submit_frames() const { return at<16>().as_int32(); }
+  bool has_submit_frames_with_current_layer_tree_frame_sink() const { return at<17>().valid(); }
+  int32_t submit_frames_with_current_layer_tree_frame_sink() const { return at<17>().as_int32(); }
+  bool has_needs_redraw() const { return at<18>().valid(); }
+  bool needs_redraw() const { return at<18>().as_bool(); }
+  bool has_needs_prepare_tiles() const { return at<19>().valid(); }
+  bool needs_prepare_tiles() const { return at<19>().as_bool(); }
+  bool has_needs_begin_main_frame() const { return at<20>().valid(); }
+  bool needs_begin_main_frame() const { return at<20>().as_bool(); }
+  bool has_needs_one_begin_impl_frame() const { return at<21>().valid(); }
+  bool needs_one_begin_impl_frame() const { return at<21>().as_bool(); }
+  bool has_visible() const { return at<22>().valid(); }
+  bool visible() const { return at<22>().as_bool(); }
+  bool has_begin_frame_source_paused() const { return at<23>().valid(); }
+  bool begin_frame_source_paused() const { return at<23>().as_bool(); }
+  bool has_can_draw() const { return at<24>().valid(); }
+  bool can_draw() const { return at<24>().as_bool(); }
+  bool has_resourceless_draw() const { return at<25>().valid(); }
+  bool resourceless_draw() const { return at<25>().as_bool(); }
+  bool has_has_pending_tree() const { return at<26>().valid(); }
+  bool has_pending_tree() const { return at<26>().as_bool(); }
+  bool has_pending_tree_is_ready_for_activation() const { return at<27>().valid(); }
+  bool pending_tree_is_ready_for_activation() const { return at<27>().as_bool(); }
+  bool has_active_tree_needs_first_draw() const { return at<28>().valid(); }
+  bool active_tree_needs_first_draw() const { return at<28>().as_bool(); }
+  bool has_active_tree_is_ready_to_draw() const { return at<29>().valid(); }
+  bool active_tree_is_ready_to_draw() const { return at<29>().as_bool(); }
+  bool has_did_create_and_initialize_first_layer_tree_frame_sink() const { return at<30>().valid(); }
+  bool did_create_and_initialize_first_layer_tree_frame_sink() const { return at<30>().as_bool(); }
+  bool has_tree_priority() const { return at<31>().valid(); }
+  int32_t tree_priority() const { return at<31>().as_int32(); }
+  bool has_scroll_handler_state() const { return at<32>().valid(); }
+  int32_t scroll_handler_state() const { return at<32>().as_int32(); }
+  bool has_critical_begin_main_frame_to_activate_is_fast() const { return at<33>().valid(); }
+  bool critical_begin_main_frame_to_activate_is_fast() const { return at<33>().as_bool(); }
+  bool has_main_thread_missed_last_deadline() const { return at<34>().valid(); }
+  bool main_thread_missed_last_deadline() const { return at<34>().as_bool(); }
+  bool has_skip_next_begin_main_frame_to_reduce_latency() const { return at<35>().valid(); }
+  bool skip_next_begin_main_frame_to_reduce_latency() const { return at<35>().as_bool(); }
+  bool has_video_needs_begin_frames() const { return at<36>().valid(); }
+  bool video_needs_begin_frames() const { return at<36>().as_bool(); }
+  bool has_defer_begin_main_frame() const { return at<37>().valid(); }
+  bool defer_begin_main_frame() const { return at<37>().as_bool(); }
+  bool has_last_commit_had_no_updates() const { return at<38>().valid(); }
+  bool last_commit_had_no_updates() const { return at<38>().as_bool(); }
+  bool has_did_draw_in_last_frame() const { return at<39>().valid(); }
+  bool did_draw_in_last_frame() const { return at<39>().as_bool(); }
+  bool has_did_submit_in_last_frame() const { return at<40>().valid(); }
+  bool did_submit_in_last_frame() const { return at<40>().as_bool(); }
+  bool has_needs_impl_side_invalidation() const { return at<41>().valid(); }
+  bool needs_impl_side_invalidation() const { return at<41>().as_bool(); }
+  bool has_current_pending_tree_is_impl_side() const { return at<42>().valid(); }
+  bool current_pending_tree_is_impl_side() const { return at<42>().as_bool(); }
+  bool has_previous_pending_tree_was_impl_side() const { return at<43>().valid(); }
+  bool previous_pending_tree_was_impl_side() const { return at<43>().as_bool(); }
+  bool has_processing_animation_worklets_for_active_tree() const { return at<44>().valid(); }
+  bool processing_animation_worklets_for_active_tree() const { return at<44>().as_bool(); }
+  bool has_processing_animation_worklets_for_pending_tree() const { return at<45>().valid(); }
+  bool processing_animation_worklets_for_pending_tree() const { return at<45>().as_bool(); }
+  bool has_processing_paint_worklets_for_pending_tree() const { return at<46>().valid(); }
+  bool processing_paint_worklets_for_pending_tree() const { return at<46>().as_bool(); }
+};
+
+class ChromeCompositorStateMachine_MinorState : public ::protozero::Message {
+ public:
+  using Decoder = ChromeCompositorStateMachine_MinorState_Decoder;
+  enum : int32_t {
+    kCommitCountFieldNumber = 1,
+    kCurrentFrameNumberFieldNumber = 2,
+    kLastFrameNumberSubmitPerformedFieldNumber = 3,
+    kLastFrameNumberDrawPerformedFieldNumber = 4,
+    kLastFrameNumberBeginMainFrameSentFieldNumber = 5,
+    kDidDrawFieldNumber = 6,
+    kDidSendBeginMainFrameForCurrentFrameFieldNumber = 7,
+    kDidNotifyBeginMainFrameNotExpectedUntilFieldNumber = 8,
+    kDidNotifyBeginMainFrameNotExpectedSoonFieldNumber = 9,
+    kWantsBeginMainFrameNotExpectedFieldNumber = 10,
+    kDidCommitDuringFrameFieldNumber = 11,
+    kDidInvalidateLayerTreeFrameSinkFieldNumber = 12,
+    kDidPerformImplSideInvalidaionFieldNumber = 13,
+    kDidPrepareTilesFieldNumber = 14,
+    kConsecutiveCheckerboardAnimationsFieldNumber = 15,
+    kPendingSubmitFramesFieldNumber = 16,
+    kSubmitFramesWithCurrentLayerTreeFrameSinkFieldNumber = 17,
+    kNeedsRedrawFieldNumber = 18,
+    kNeedsPrepareTilesFieldNumber = 19,
+    kNeedsBeginMainFrameFieldNumber = 20,
+    kNeedsOneBeginImplFrameFieldNumber = 21,
+    kVisibleFieldNumber = 22,
+    kBeginFrameSourcePausedFieldNumber = 23,
+    kCanDrawFieldNumber = 24,
+    kResourcelessDrawFieldNumber = 25,
+    kHasPendingTreeFieldNumber = 26,
+    kPendingTreeIsReadyForActivationFieldNumber = 27,
+    kActiveTreeNeedsFirstDrawFieldNumber = 28,
+    kActiveTreeIsReadyToDrawFieldNumber = 29,
+    kDidCreateAndInitializeFirstLayerTreeFrameSinkFieldNumber = 30,
+    kTreePriorityFieldNumber = 31,
+    kScrollHandlerStateFieldNumber = 32,
+    kCriticalBeginMainFrameToActivateIsFastFieldNumber = 33,
+    kMainThreadMissedLastDeadlineFieldNumber = 34,
+    kSkipNextBeginMainFrameToReduceLatencyFieldNumber = 35,
+    kVideoNeedsBeginFramesFieldNumber = 36,
+    kDeferBeginMainFrameFieldNumber = 37,
+    kLastCommitHadNoUpdatesFieldNumber = 38,
+    kDidDrawInLastFrameFieldNumber = 39,
+    kDidSubmitInLastFrameFieldNumber = 40,
+    kNeedsImplSideInvalidationFieldNumber = 41,
+    kCurrentPendingTreeIsImplSideFieldNumber = 42,
+    kPreviousPendingTreeWasImplSideFieldNumber = 43,
+    kProcessingAnimationWorkletsForActiveTreeFieldNumber = 44,
+    kProcessingAnimationWorkletsForPendingTreeFieldNumber = 45,
+    kProcessingPaintWorkletsForPendingTreeFieldNumber = 46,
+  };
+  using TreePriority = ::perfetto::protos::pbzero::ChromeCompositorStateMachine_MinorState_TreePriority;
+  using ScrollHandlerState = ::perfetto::protos::pbzero::ChromeCompositorStateMachine_MinorState_ScrollHandlerState;
+  static const TreePriority TREE_PRIORITY_UNSPECIFIED = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_UNSPECIFIED;
+  static const TreePriority TREE_PRIORITY_SAME_PRIORITY_FOR_BOTH_TREES = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_SAME_PRIORITY_FOR_BOTH_TREES;
+  static const TreePriority TREE_PRIORITY_SMOOTHNESS_TAKES_PRIORITY = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_SMOOTHNESS_TAKES_PRIORITY;
+  static const TreePriority TREE_PRIORITY_NEW_CONTENT_TAKES_PRIORITY = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_NEW_CONTENT_TAKES_PRIORITY;
+  static const ScrollHandlerState SCROLL_HANDLER_UNSPECIFIED = ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_HANDLER_UNSPECIFIED;
+  static const ScrollHandlerState SCROLL_AFFECTS_SCROLL_HANDLER = ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_AFFECTS_SCROLL_HANDLER;
+  static const ScrollHandlerState SCROLL_DOES_NOT_AFFECT_SCROLL_HANDLER = ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_DOES_NOT_AFFECT_SCROLL_HANDLER;
+
+  using FieldMetadata_CommitCount =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CommitCount kCommitCount() { return {}; }
+  void set_commit_count(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CommitCount::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CurrentFrameNumber =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CurrentFrameNumber kCurrentFrameNumber() { return {}; }
+  void set_current_frame_number(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CurrentFrameNumber::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LastFrameNumberSubmitPerformed =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LastFrameNumberSubmitPerformed kLastFrameNumberSubmitPerformed() { return {}; }
+  void set_last_frame_number_submit_performed(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_LastFrameNumberSubmitPerformed::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LastFrameNumberDrawPerformed =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LastFrameNumberDrawPerformed kLastFrameNumberDrawPerformed() { return {}; }
+  void set_last_frame_number_draw_performed(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_LastFrameNumberDrawPerformed::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LastFrameNumberBeginMainFrameSent =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LastFrameNumberBeginMainFrameSent kLastFrameNumberBeginMainFrameSent() { return {}; }
+  void set_last_frame_number_begin_main_frame_sent(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_LastFrameNumberBeginMainFrameSent::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DidDraw =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DidDraw kDidDraw() { return {}; }
+  void set_did_draw(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_DidDraw::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DidSendBeginMainFrameForCurrentFrame =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DidSendBeginMainFrameForCurrentFrame kDidSendBeginMainFrameForCurrentFrame() { return {}; }
+  void set_did_send_begin_main_frame_for_current_frame(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_DidSendBeginMainFrameForCurrentFrame::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DidNotifyBeginMainFrameNotExpectedUntil =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DidNotifyBeginMainFrameNotExpectedUntil kDidNotifyBeginMainFrameNotExpectedUntil() { return {}; }
+  void set_did_notify_begin_main_frame_not_expected_until(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_DidNotifyBeginMainFrameNotExpectedUntil::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DidNotifyBeginMainFrameNotExpectedSoon =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DidNotifyBeginMainFrameNotExpectedSoon kDidNotifyBeginMainFrameNotExpectedSoon() { return {}; }
+  void set_did_notify_begin_main_frame_not_expected_soon(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_DidNotifyBeginMainFrameNotExpectedSoon::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_WantsBeginMainFrameNotExpected =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_WantsBeginMainFrameNotExpected kWantsBeginMainFrameNotExpected() { return {}; }
+  void set_wants_begin_main_frame_not_expected(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_WantsBeginMainFrameNotExpected::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DidCommitDuringFrame =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DidCommitDuringFrame kDidCommitDuringFrame() { return {}; }
+  void set_did_commit_during_frame(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_DidCommitDuringFrame::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DidInvalidateLayerTreeFrameSink =
+    ::protozero::proto_utils::FieldMetadata<
+      12,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DidInvalidateLayerTreeFrameSink kDidInvalidateLayerTreeFrameSink() { return {}; }
+  void set_did_invalidate_layer_tree_frame_sink(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_DidInvalidateLayerTreeFrameSink::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DidPerformImplSideInvalidaion =
+    ::protozero::proto_utils::FieldMetadata<
+      13,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DidPerformImplSideInvalidaion kDidPerformImplSideInvalidaion() { return {}; }
+  void set_did_perform_impl_side_invalidaion(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_DidPerformImplSideInvalidaion::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DidPrepareTiles =
+    ::protozero::proto_utils::FieldMetadata<
+      14,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DidPrepareTiles kDidPrepareTiles() { return {}; }
+  void set_did_prepare_tiles(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_DidPrepareTiles::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ConsecutiveCheckerboardAnimations =
+    ::protozero::proto_utils::FieldMetadata<
+      15,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ConsecutiveCheckerboardAnimations kConsecutiveCheckerboardAnimations() { return {}; }
+  void set_consecutive_checkerboard_animations(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ConsecutiveCheckerboardAnimations::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PendingSubmitFrames =
+    ::protozero::proto_utils::FieldMetadata<
+      16,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PendingSubmitFrames kPendingSubmitFrames() { return {}; }
+  void set_pending_submit_frames(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PendingSubmitFrames::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SubmitFramesWithCurrentLayerTreeFrameSink =
+    ::protozero::proto_utils::FieldMetadata<
+      17,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SubmitFramesWithCurrentLayerTreeFrameSink kSubmitFramesWithCurrentLayerTreeFrameSink() { return {}; }
+  void set_submit_frames_with_current_layer_tree_frame_sink(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SubmitFramesWithCurrentLayerTreeFrameSink::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NeedsRedraw =
+    ::protozero::proto_utils::FieldMetadata<
+      18,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NeedsRedraw kNeedsRedraw() { return {}; }
+  void set_needs_redraw(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_NeedsRedraw::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NeedsPrepareTiles =
+    ::protozero::proto_utils::FieldMetadata<
+      19,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NeedsPrepareTiles kNeedsPrepareTiles() { return {}; }
+  void set_needs_prepare_tiles(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_NeedsPrepareTiles::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NeedsBeginMainFrame =
+    ::protozero::proto_utils::FieldMetadata<
+      20,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NeedsBeginMainFrame kNeedsBeginMainFrame() { return {}; }
+  void set_needs_begin_main_frame(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_NeedsBeginMainFrame::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NeedsOneBeginImplFrame =
+    ::protozero::proto_utils::FieldMetadata<
+      21,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NeedsOneBeginImplFrame kNeedsOneBeginImplFrame() { return {}; }
+  void set_needs_one_begin_impl_frame(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_NeedsOneBeginImplFrame::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Visible =
+    ::protozero::proto_utils::FieldMetadata<
+      22,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Visible kVisible() { return {}; }
+  void set_visible(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_Visible::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BeginFrameSourcePaused =
+    ::protozero::proto_utils::FieldMetadata<
+      23,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BeginFrameSourcePaused kBeginFrameSourcePaused() { return {}; }
+  void set_begin_frame_source_paused(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_BeginFrameSourcePaused::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CanDraw =
+    ::protozero::proto_utils::FieldMetadata<
+      24,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CanDraw kCanDraw() { return {}; }
+  void set_can_draw(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_CanDraw::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ResourcelessDraw =
+    ::protozero::proto_utils::FieldMetadata<
+      25,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ResourcelessDraw kResourcelessDraw() { return {}; }
+  void set_resourceless_draw(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_ResourcelessDraw::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HasPendingTree =
+    ::protozero::proto_utils::FieldMetadata<
+      26,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HasPendingTree kHasPendingTree() { return {}; }
+  void set_has_pending_tree(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_HasPendingTree::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PendingTreeIsReadyForActivation =
+    ::protozero::proto_utils::FieldMetadata<
+      27,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PendingTreeIsReadyForActivation kPendingTreeIsReadyForActivation() { return {}; }
+  void set_pending_tree_is_ready_for_activation(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_PendingTreeIsReadyForActivation::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ActiveTreeNeedsFirstDraw =
+    ::protozero::proto_utils::FieldMetadata<
+      28,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ActiveTreeNeedsFirstDraw kActiveTreeNeedsFirstDraw() { return {}; }
+  void set_active_tree_needs_first_draw(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_ActiveTreeNeedsFirstDraw::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ActiveTreeIsReadyToDraw =
+    ::protozero::proto_utils::FieldMetadata<
+      29,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ActiveTreeIsReadyToDraw kActiveTreeIsReadyToDraw() { return {}; }
+  void set_active_tree_is_ready_to_draw(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_ActiveTreeIsReadyToDraw::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DidCreateAndInitializeFirstLayerTreeFrameSink =
+    ::protozero::proto_utils::FieldMetadata<
+      30,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DidCreateAndInitializeFirstLayerTreeFrameSink kDidCreateAndInitializeFirstLayerTreeFrameSink() { return {}; }
+  void set_did_create_and_initialize_first_layer_tree_frame_sink(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_DidCreateAndInitializeFirstLayerTreeFrameSink::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TreePriority =
+    ::protozero::proto_utils::FieldMetadata<
+      31,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ChromeCompositorStateMachine_MinorState_TreePriority,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TreePriority kTreePriority() { return {}; }
+  void set_tree_priority(::perfetto::protos::pbzero::ChromeCompositorStateMachine_MinorState_TreePriority value) {
+    static constexpr uint32_t field_id = FieldMetadata_TreePriority::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ScrollHandlerState =
+    ::protozero::proto_utils::FieldMetadata<
+      32,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ChromeCompositorStateMachine_MinorState_ScrollHandlerState,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ScrollHandlerState kScrollHandlerState() { return {}; }
+  void set_scroll_handler_state(::perfetto::protos::pbzero::ChromeCompositorStateMachine_MinorState_ScrollHandlerState value) {
+    static constexpr uint32_t field_id = FieldMetadata_ScrollHandlerState::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CriticalBeginMainFrameToActivateIsFast =
+    ::protozero::proto_utils::FieldMetadata<
+      33,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CriticalBeginMainFrameToActivateIsFast kCriticalBeginMainFrameToActivateIsFast() { return {}; }
+  void set_critical_begin_main_frame_to_activate_is_fast(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_CriticalBeginMainFrameToActivateIsFast::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MainThreadMissedLastDeadline =
+    ::protozero::proto_utils::FieldMetadata<
+      34,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MainThreadMissedLastDeadline kMainThreadMissedLastDeadline() { return {}; }
+  void set_main_thread_missed_last_deadline(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_MainThreadMissedLastDeadline::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SkipNextBeginMainFrameToReduceLatency =
+    ::protozero::proto_utils::FieldMetadata<
+      35,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SkipNextBeginMainFrameToReduceLatency kSkipNextBeginMainFrameToReduceLatency() { return {}; }
+  void set_skip_next_begin_main_frame_to_reduce_latency(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_SkipNextBeginMainFrameToReduceLatency::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_VideoNeedsBeginFrames =
+    ::protozero::proto_utils::FieldMetadata<
+      36,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_VideoNeedsBeginFrames kVideoNeedsBeginFrames() { return {}; }
+  void set_video_needs_begin_frames(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_VideoNeedsBeginFrames::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DeferBeginMainFrame =
+    ::protozero::proto_utils::FieldMetadata<
+      37,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DeferBeginMainFrame kDeferBeginMainFrame() { return {}; }
+  void set_defer_begin_main_frame(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_DeferBeginMainFrame::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LastCommitHadNoUpdates =
+    ::protozero::proto_utils::FieldMetadata<
+      38,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LastCommitHadNoUpdates kLastCommitHadNoUpdates() { return {}; }
+  void set_last_commit_had_no_updates(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_LastCommitHadNoUpdates::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DidDrawInLastFrame =
+    ::protozero::proto_utils::FieldMetadata<
+      39,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DidDrawInLastFrame kDidDrawInLastFrame() { return {}; }
+  void set_did_draw_in_last_frame(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_DidDrawInLastFrame::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DidSubmitInLastFrame =
+    ::protozero::proto_utils::FieldMetadata<
+      40,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DidSubmitInLastFrame kDidSubmitInLastFrame() { return {}; }
+  void set_did_submit_in_last_frame(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_DidSubmitInLastFrame::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NeedsImplSideInvalidation =
+    ::protozero::proto_utils::FieldMetadata<
+      41,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NeedsImplSideInvalidation kNeedsImplSideInvalidation() { return {}; }
+  void set_needs_impl_side_invalidation(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_NeedsImplSideInvalidation::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CurrentPendingTreeIsImplSide =
+    ::protozero::proto_utils::FieldMetadata<
+      42,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CurrentPendingTreeIsImplSide kCurrentPendingTreeIsImplSide() { return {}; }
+  void set_current_pending_tree_is_impl_side(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_CurrentPendingTreeIsImplSide::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PreviousPendingTreeWasImplSide =
+    ::protozero::proto_utils::FieldMetadata<
+      43,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PreviousPendingTreeWasImplSide kPreviousPendingTreeWasImplSide() { return {}; }
+  void set_previous_pending_tree_was_impl_side(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_PreviousPendingTreeWasImplSide::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ProcessingAnimationWorkletsForActiveTree =
+    ::protozero::proto_utils::FieldMetadata<
+      44,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProcessingAnimationWorkletsForActiveTree kProcessingAnimationWorkletsForActiveTree() { return {}; }
+  void set_processing_animation_worklets_for_active_tree(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProcessingAnimationWorkletsForActiveTree::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ProcessingAnimationWorkletsForPendingTree =
+    ::protozero::proto_utils::FieldMetadata<
+      45,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProcessingAnimationWorkletsForPendingTree kProcessingAnimationWorkletsForPendingTree() { return {}; }
+  void set_processing_animation_worklets_for_pending_tree(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProcessingAnimationWorkletsForPendingTree::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ProcessingPaintWorkletsForPendingTree =
+    ::protozero::proto_utils::FieldMetadata<
+      46,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorStateMachine_MinorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProcessingPaintWorkletsForPendingTree kProcessingPaintWorkletsForPendingTree() { return {}; }
+  void set_processing_paint_worklets_for_pending_tree(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProcessingPaintWorkletsForPendingTree::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class ChromeCompositorStateMachine_MajorState_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ChromeCompositorStateMachine_MajorState_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ChromeCompositorStateMachine_MajorState_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ChromeCompositorStateMachine_MajorState_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_next_action() const { return at<1>().valid(); }
+  int32_t next_action() const { return at<1>().as_int32(); }
+  bool has_begin_impl_frame_state() const { return at<2>().valid(); }
+  int32_t begin_impl_frame_state() const { return at<2>().as_int32(); }
+  bool has_begin_main_frame_state() const { return at<3>().valid(); }
+  int32_t begin_main_frame_state() const { return at<3>().as_int32(); }
+  bool has_layer_tree_frame_sink_state() const { return at<4>().valid(); }
+  int32_t layer_tree_frame_sink_state() const { return at<4>().as_int32(); }
+  bool has_forced_redraw_state() const { return at<5>().valid(); }
+  int32_t forced_redraw_state() const { return at<5>().as_int32(); }
+};
+
+class ChromeCompositorStateMachine_MajorState : public ::protozero::Message {
+ public:
+  using Decoder = ChromeCompositorStateMachine_MajorState_Decoder;
+  enum : int32_t {
+    kNextActionFieldNumber = 1,
+    kBeginImplFrameStateFieldNumber = 2,
+    kBeginMainFrameStateFieldNumber = 3,
+    kLayerTreeFrameSinkStateFieldNumber = 4,
+    kForcedRedrawStateFieldNumber = 5,
+  };
+  using BeginImplFrameState = ::perfetto::protos::pbzero::ChromeCompositorStateMachine_MajorState_BeginImplFrameState;
+  using BeginMainFrameState = ::perfetto::protos::pbzero::ChromeCompositorStateMachine_MajorState_BeginMainFrameState;
+  using LayerTreeFrameSinkState = ::perfetto::protos::pbzero::ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState;
+  using ForcedRedrawOnTimeoutState = ::perfetto::protos::pbzero::ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState;
+  static const BeginImplFrameState BEGIN_IMPL_FRAME_UNSPECIFIED = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_UNSPECIFIED;
+  static const BeginImplFrameState BEGIN_IMPL_FRAME_IDLE = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_IDLE;
+  static const BeginImplFrameState BEGIN_IMPL_FRAME_INSIDE_BEGIN_FRAME = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_INSIDE_BEGIN_FRAME;
+  static const BeginImplFrameState BEGIN_IMPL_FRAME_INSIDE_DEADLINE = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_INSIDE_DEADLINE;
+  static const BeginMainFrameState BEGIN_MAIN_FRAME_UNSPECIFIED = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_UNSPECIFIED;
+  static const BeginMainFrameState BEGIN_MAIN_FRAME_IDLE = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_IDLE;
+  static const BeginMainFrameState BEGIN_MAIN_FRAME_SENT = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_SENT;
+  static const BeginMainFrameState BEGIN_MAIN_FRAME_READY_TO_COMMIT = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_READY_TO_COMMIT;
+  static const LayerTreeFrameSinkState LAYER_TREE_FRAME_UNSPECIFIED = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_UNSPECIFIED;
+  static const LayerTreeFrameSinkState LAYER_TREE_FRAME_NONE = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_NONE;
+  static const LayerTreeFrameSinkState LAYER_TREE_FRAME_ACTIVE = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_ACTIVE;
+  static const LayerTreeFrameSinkState LAYER_TREE_FRAME_CREATING = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_CREATING;
+  static const LayerTreeFrameSinkState LAYER_TREE_FRAME_WAITING_FOR_FIRST_COMMIT = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_WAITING_FOR_FIRST_COMMIT;
+  static const LayerTreeFrameSinkState LAYER_TREE_FRAME_WAITING_FOR_FIRST_ACTIVATION = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_WAITING_FOR_FIRST_ACTIVATION;
+  static const ForcedRedrawOnTimeoutState FORCED_REDRAW_UNSPECIFIED = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_UNSPECIFIED;
+  static const ForcedRedrawOnTimeoutState FORCED_REDRAW_IDLE = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_IDLE;
+  static const ForcedRedrawOnTimeoutState FORCED_REDRAW_WAITING_FOR_COMMIT = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_COMMIT;
+  static const ForcedRedrawOnTimeoutState FORCED_REDRAW_WAITING_FOR_ACTIVATION = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_ACTIVATION;
+  static const ForcedRedrawOnTimeoutState FORCED_REDRAW_WAITING_FOR_DRAW = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_DRAW;
+
+  using FieldMetadata_NextAction =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ChromeCompositorSchedulerAction,
+      ChromeCompositorStateMachine_MajorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NextAction kNextAction() { return {}; }
+  void set_next_action(::perfetto::protos::pbzero::ChromeCompositorSchedulerAction value) {
+    static constexpr uint32_t field_id = FieldMetadata_NextAction::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BeginImplFrameState =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ChromeCompositorStateMachine_MajorState_BeginImplFrameState,
+      ChromeCompositorStateMachine_MajorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BeginImplFrameState kBeginImplFrameState() { return {}; }
+  void set_begin_impl_frame_state(::perfetto::protos::pbzero::ChromeCompositorStateMachine_MajorState_BeginImplFrameState value) {
+    static constexpr uint32_t field_id = FieldMetadata_BeginImplFrameState::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BeginMainFrameState =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ChromeCompositorStateMachine_MajorState_BeginMainFrameState,
+      ChromeCompositorStateMachine_MajorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BeginMainFrameState kBeginMainFrameState() { return {}; }
+  void set_begin_main_frame_state(::perfetto::protos::pbzero::ChromeCompositorStateMachine_MajorState_BeginMainFrameState value) {
+    static constexpr uint32_t field_id = FieldMetadata_BeginMainFrameState::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LayerTreeFrameSinkState =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState,
+      ChromeCompositorStateMachine_MajorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LayerTreeFrameSinkState kLayerTreeFrameSinkState() { return {}; }
+  void set_layer_tree_frame_sink_state(::perfetto::protos::pbzero::ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState value) {
+    static constexpr uint32_t field_id = FieldMetadata_LayerTreeFrameSinkState::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ForcedRedrawState =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState,
+      ChromeCompositorStateMachine_MajorState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ForcedRedrawState kForcedRedrawState() { return {}; }
+  void set_forced_redraw_state(::perfetto::protos::pbzero::ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState value) {
+    static constexpr uint32_t field_id = FieldMetadata_ForcedRedrawState::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class ChromeCompositorSchedulerState_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/17, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ChromeCompositorSchedulerState_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ChromeCompositorSchedulerState_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ChromeCompositorSchedulerState_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_state_machine() const { return at<1>().valid(); }
+  ::protozero::ConstBytes state_machine() const { return at<1>().as_bytes(); }
+  bool has_observing_begin_frame_source() const { return at<2>().valid(); }
+  bool observing_begin_frame_source() const { return at<2>().as_bool(); }
+  bool has_begin_impl_frame_deadline_task() const { return at<3>().valid(); }
+  bool begin_impl_frame_deadline_task() const { return at<3>().as_bool(); }
+  bool has_pending_begin_frame_task() const { return at<4>().valid(); }
+  bool pending_begin_frame_task() const { return at<4>().as_bool(); }
+  bool has_skipped_last_frame_missed_exceeded_deadline() const { return at<5>().valid(); }
+  bool skipped_last_frame_missed_exceeded_deadline() const { return at<5>().as_bool(); }
+  bool has_skipped_last_frame_to_reduce_latency() const { return at<6>().valid(); }
+  bool skipped_last_frame_to_reduce_latency() const { return at<6>().as_bool(); }
+  bool has_inside_action() const { return at<7>().valid(); }
+  int32_t inside_action() const { return at<7>().as_int32(); }
+  bool has_deadline_mode() const { return at<8>().valid(); }
+  int32_t deadline_mode() const { return at<8>().as_int32(); }
+  bool has_deadline_us() const { return at<9>().valid(); }
+  int64_t deadline_us() const { return at<9>().as_int64(); }
+  bool has_deadline_scheduled_at_us() const { return at<10>().valid(); }
+  int64_t deadline_scheduled_at_us() const { return at<10>().as_int64(); }
+  bool has_now_us() const { return at<11>().valid(); }
+  int64_t now_us() const { return at<11>().as_int64(); }
+  bool has_now_to_deadline_delta_us() const { return at<12>().valid(); }
+  int64_t now_to_deadline_delta_us() const { return at<12>().as_int64(); }
+  bool has_now_to_deadline_scheduled_at_delta_us() const { return at<13>().valid(); }
+  int64_t now_to_deadline_scheduled_at_delta_us() const { return at<13>().as_int64(); }
+  bool has_begin_impl_frame_args() const { return at<14>().valid(); }
+  ::protozero::ConstBytes begin_impl_frame_args() const { return at<14>().as_bytes(); }
+  bool has_begin_frame_observer_state() const { return at<15>().valid(); }
+  ::protozero::ConstBytes begin_frame_observer_state() const { return at<15>().as_bytes(); }
+  bool has_begin_frame_source_state() const { return at<16>().valid(); }
+  ::protozero::ConstBytes begin_frame_source_state() const { return at<16>().as_bytes(); }
+  bool has_compositor_timing_history() const { return at<17>().valid(); }
+  ::protozero::ConstBytes compositor_timing_history() const { return at<17>().as_bytes(); }
+};
+
+class ChromeCompositorSchedulerState : public ::protozero::Message {
+ public:
+  using Decoder = ChromeCompositorSchedulerState_Decoder;
+  enum : int32_t {
+    kStateMachineFieldNumber = 1,
+    kObservingBeginFrameSourceFieldNumber = 2,
+    kBeginImplFrameDeadlineTaskFieldNumber = 3,
+    kPendingBeginFrameTaskFieldNumber = 4,
+    kSkippedLastFrameMissedExceededDeadlineFieldNumber = 5,
+    kSkippedLastFrameToReduceLatencyFieldNumber = 6,
+    kInsideActionFieldNumber = 7,
+    kDeadlineModeFieldNumber = 8,
+    kDeadlineUsFieldNumber = 9,
+    kDeadlineScheduledAtUsFieldNumber = 10,
+    kNowUsFieldNumber = 11,
+    kNowToDeadlineDeltaUsFieldNumber = 12,
+    kNowToDeadlineScheduledAtDeltaUsFieldNumber = 13,
+    kBeginImplFrameArgsFieldNumber = 14,
+    kBeginFrameObserverStateFieldNumber = 15,
+    kBeginFrameSourceStateFieldNumber = 16,
+    kCompositorTimingHistoryFieldNumber = 17,
+  };
+  using BeginImplFrameDeadlineMode = ::perfetto::protos::pbzero::ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode;
+  static const BeginImplFrameDeadlineMode DEADLINE_MODE_UNSPECIFIED = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_UNSPECIFIED;
+  static const BeginImplFrameDeadlineMode DEADLINE_MODE_NONE = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_NONE;
+  static const BeginImplFrameDeadlineMode DEADLINE_MODE_IMMEDIATE = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_IMMEDIATE;
+  static const BeginImplFrameDeadlineMode DEADLINE_MODE_REGULAR = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_REGULAR;
+  static const BeginImplFrameDeadlineMode DEADLINE_MODE_LATE = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_LATE;
+  static const BeginImplFrameDeadlineMode DEADLINE_MODE_BLOCKED = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_BLOCKED;
+
+  using FieldMetadata_StateMachine =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeCompositorStateMachine,
+      ChromeCompositorSchedulerState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StateMachine kStateMachine() { return {}; }
+  template <typename T = ChromeCompositorStateMachine> T* set_state_machine() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_ObservingBeginFrameSource =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorSchedulerState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ObservingBeginFrameSource kObservingBeginFrameSource() { return {}; }
+  void set_observing_begin_frame_source(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_ObservingBeginFrameSource::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BeginImplFrameDeadlineTask =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorSchedulerState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BeginImplFrameDeadlineTask kBeginImplFrameDeadlineTask() { return {}; }
+  void set_begin_impl_frame_deadline_task(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_BeginImplFrameDeadlineTask::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PendingBeginFrameTask =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorSchedulerState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PendingBeginFrameTask kPendingBeginFrameTask() { return {}; }
+  void set_pending_begin_frame_task(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_PendingBeginFrameTask::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SkippedLastFrameMissedExceededDeadline =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorSchedulerState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SkippedLastFrameMissedExceededDeadline kSkippedLastFrameMissedExceededDeadline() { return {}; }
+  void set_skipped_last_frame_missed_exceeded_deadline(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_SkippedLastFrameMissedExceededDeadline::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SkippedLastFrameToReduceLatency =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeCompositorSchedulerState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SkippedLastFrameToReduceLatency kSkippedLastFrameToReduceLatency() { return {}; }
+  void set_skipped_last_frame_to_reduce_latency(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_SkippedLastFrameToReduceLatency::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_InsideAction =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ChromeCompositorSchedulerAction,
+      ChromeCompositorSchedulerState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_InsideAction kInsideAction() { return {}; }
+  void set_inside_action(::perfetto::protos::pbzero::ChromeCompositorSchedulerAction value) {
+    static constexpr uint32_t field_id = FieldMetadata_InsideAction::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DeadlineMode =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode,
+      ChromeCompositorSchedulerState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DeadlineMode kDeadlineMode() { return {}; }
+  void set_deadline_mode(::perfetto::protos::pbzero::ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode value) {
+    static constexpr uint32_t field_id = FieldMetadata_DeadlineMode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DeadlineUs =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      ChromeCompositorSchedulerState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DeadlineUs kDeadlineUs() { return {}; }
+  void set_deadline_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DeadlineUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DeadlineScheduledAtUs =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      ChromeCompositorSchedulerState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DeadlineScheduledAtUs kDeadlineScheduledAtUs() { return {}; }
+  void set_deadline_scheduled_at_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DeadlineScheduledAtUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NowUs =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      ChromeCompositorSchedulerState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NowUs kNowUs() { return {}; }
+  void set_now_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NowUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NowToDeadlineDeltaUs =
+    ::protozero::proto_utils::FieldMetadata<
+      12,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      ChromeCompositorSchedulerState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NowToDeadlineDeltaUs kNowToDeadlineDeltaUs() { return {}; }
+  void set_now_to_deadline_delta_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NowToDeadlineDeltaUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NowToDeadlineScheduledAtDeltaUs =
+    ::protozero::proto_utils::FieldMetadata<
+      13,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      ChromeCompositorSchedulerState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NowToDeadlineScheduledAtDeltaUs kNowToDeadlineScheduledAtDeltaUs() { return {}; }
+  void set_now_to_deadline_scheduled_at_delta_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NowToDeadlineScheduledAtDeltaUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BeginImplFrameArgs =
+    ::protozero::proto_utils::FieldMetadata<
+      14,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BeginImplFrameArgs,
+      ChromeCompositorSchedulerState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BeginImplFrameArgs kBeginImplFrameArgs() { return {}; }
+  template <typename T = BeginImplFrameArgs> T* set_begin_impl_frame_args() {
+    return BeginNestedMessage<T>(14);
+  }
+
+
+  using FieldMetadata_BeginFrameObserverState =
+    ::protozero::proto_utils::FieldMetadata<
+      15,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BeginFrameObserverState,
+      ChromeCompositorSchedulerState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BeginFrameObserverState kBeginFrameObserverState() { return {}; }
+  template <typename T = BeginFrameObserverState> T* set_begin_frame_observer_state() {
+    return BeginNestedMessage<T>(15);
+  }
+
+
+  using FieldMetadata_BeginFrameSourceState =
+    ::protozero::proto_utils::FieldMetadata<
+      16,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BeginFrameSourceState,
+      ChromeCompositorSchedulerState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BeginFrameSourceState kBeginFrameSourceState() { return {}; }
+  template <typename T = BeginFrameSourceState> T* set_begin_frame_source_state() {
+    return BeginNestedMessage<T>(16);
+  }
+
+
+  using FieldMetadata_CompositorTimingHistory =
+    ::protozero::proto_utils::FieldMetadata<
+      17,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      CompositorTimingHistory,
+      ChromeCompositorSchedulerState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CompositorTimingHistory kCompositorTimingHistory() { return {}; }
+  template <typename T = CompositorTimingHistory> T* set_compositor_timing_history() {
+    return BeginNestedMessage<T>(17);
+  }
+
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_content_settings_event_info.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_CONTENT_SETTINGS_EVENT_INFO_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_CONTENT_SETTINGS_EVENT_INFO_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class ChromeContentSettingsEventInfo_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ChromeContentSettingsEventInfo_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ChromeContentSettingsEventInfo_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ChromeContentSettingsEventInfo_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_number_of_exceptions() const { return at<1>().valid(); }
+  uint32_t number_of_exceptions() const { return at<1>().as_uint32(); }
+};
+
+class ChromeContentSettingsEventInfo : public ::protozero::Message {
+ public:
+  using Decoder = ChromeContentSettingsEventInfo_Decoder;
+  enum : int32_t {
+    kNumberOfExceptionsFieldNumber = 1,
+  };
+
+  using FieldMetadata_NumberOfExceptions =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      ChromeContentSettingsEventInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NumberOfExceptions kNumberOfExceptions() { return {}; }
+  void set_number_of_exceptions(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NumberOfExceptions::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_frame_reporter.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_FRAME_REPORTER_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_FRAME_REPORTER_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+enum ChromeFrameReporter_FrameDropReason : int32_t;
+enum ChromeFrameReporter_ScrollState : int32_t;
+enum ChromeFrameReporter_State : int32_t;
+
+enum ChromeFrameReporter_State : int32_t {
+  ChromeFrameReporter_State_STATE_NO_UPDATE_DESIRED = 0,
+  ChromeFrameReporter_State_STATE_PRESENTED_ALL = 1,
+  ChromeFrameReporter_State_STATE_PRESENTED_PARTIAL = 2,
+  ChromeFrameReporter_State_STATE_DROPPED = 3,
+};
+
+const ChromeFrameReporter_State ChromeFrameReporter_State_MIN = ChromeFrameReporter_State_STATE_NO_UPDATE_DESIRED;
+const ChromeFrameReporter_State ChromeFrameReporter_State_MAX = ChromeFrameReporter_State_STATE_DROPPED;
+
+enum ChromeFrameReporter_FrameDropReason : int32_t {
+  ChromeFrameReporter_FrameDropReason_REASON_UNSPECIFIED = 0,
+  ChromeFrameReporter_FrameDropReason_REASON_DISPLAY_COMPOSITOR = 1,
+  ChromeFrameReporter_FrameDropReason_REASON_MAIN_THREAD = 2,
+  ChromeFrameReporter_FrameDropReason_REASON_CLIENT_COMPOSITOR = 3,
+};
+
+const ChromeFrameReporter_FrameDropReason ChromeFrameReporter_FrameDropReason_MIN = ChromeFrameReporter_FrameDropReason_REASON_UNSPECIFIED;
+const ChromeFrameReporter_FrameDropReason ChromeFrameReporter_FrameDropReason_MAX = ChromeFrameReporter_FrameDropReason_REASON_CLIENT_COMPOSITOR;
+
+enum ChromeFrameReporter_ScrollState : int32_t {
+  ChromeFrameReporter_ScrollState_SCROLL_NONE = 0,
+  ChromeFrameReporter_ScrollState_SCROLL_MAIN_THREAD = 1,
+  ChromeFrameReporter_ScrollState_SCROLL_COMPOSITOR_THREAD = 2,
+  ChromeFrameReporter_ScrollState_SCROLL_UNKNOWN = 3,
+};
+
+const ChromeFrameReporter_ScrollState ChromeFrameReporter_ScrollState_MIN = ChromeFrameReporter_ScrollState_SCROLL_NONE;
+const ChromeFrameReporter_ScrollState ChromeFrameReporter_ScrollState_MAX = ChromeFrameReporter_ScrollState_SCROLL_UNKNOWN;
+
+class ChromeFrameReporter_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/11, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ChromeFrameReporter_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ChromeFrameReporter_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ChromeFrameReporter_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_state() const { return at<1>().valid(); }
+  int32_t state() const { return at<1>().as_int32(); }
+  bool has_reason() const { return at<2>().valid(); }
+  int32_t reason() const { return at<2>().as_int32(); }
+  bool has_frame_source() const { return at<3>().valid(); }
+  uint64_t frame_source() const { return at<3>().as_uint64(); }
+  bool has_frame_sequence() const { return at<4>().valid(); }
+  uint64_t frame_sequence() const { return at<4>().as_uint64(); }
+  bool has_affects_smoothness() const { return at<5>().valid(); }
+  bool affects_smoothness() const { return at<5>().as_bool(); }
+  bool has_scroll_state() const { return at<6>().valid(); }
+  int32_t scroll_state() const { return at<6>().as_int32(); }
+  bool has_has_main_animation() const { return at<7>().valid(); }
+  bool has_main_animation() const { return at<7>().as_bool(); }
+  bool has_has_compositor_animation() const { return at<8>().valid(); }
+  bool has_compositor_animation() const { return at<8>().as_bool(); }
+  bool has_has_smooth_input_main() const { return at<9>().valid(); }
+  bool has_smooth_input_main() const { return at<9>().as_bool(); }
+  bool has_has_missing_content() const { return at<10>().valid(); }
+  bool has_missing_content() const { return at<10>().as_bool(); }
+  bool has_layer_tree_host_id() const { return at<11>().valid(); }
+  uint64_t layer_tree_host_id() const { return at<11>().as_uint64(); }
+};
+
+class ChromeFrameReporter : public ::protozero::Message {
+ public:
+  using Decoder = ChromeFrameReporter_Decoder;
+  enum : int32_t {
+    kStateFieldNumber = 1,
+    kReasonFieldNumber = 2,
+    kFrameSourceFieldNumber = 3,
+    kFrameSequenceFieldNumber = 4,
+    kAffectsSmoothnessFieldNumber = 5,
+    kScrollStateFieldNumber = 6,
+    kHasMainAnimationFieldNumber = 7,
+    kHasCompositorAnimationFieldNumber = 8,
+    kHasSmoothInputMainFieldNumber = 9,
+    kHasMissingContentFieldNumber = 10,
+    kLayerTreeHostIdFieldNumber = 11,
+  };
+  using State = ::perfetto::protos::pbzero::ChromeFrameReporter_State;
+  using FrameDropReason = ::perfetto::protos::pbzero::ChromeFrameReporter_FrameDropReason;
+  using ScrollState = ::perfetto::protos::pbzero::ChromeFrameReporter_ScrollState;
+  static const State STATE_NO_UPDATE_DESIRED = ChromeFrameReporter_State_STATE_NO_UPDATE_DESIRED;
+  static const State STATE_PRESENTED_ALL = ChromeFrameReporter_State_STATE_PRESENTED_ALL;
+  static const State STATE_PRESENTED_PARTIAL = ChromeFrameReporter_State_STATE_PRESENTED_PARTIAL;
+  static const State STATE_DROPPED = ChromeFrameReporter_State_STATE_DROPPED;
+  static const FrameDropReason REASON_UNSPECIFIED = ChromeFrameReporter_FrameDropReason_REASON_UNSPECIFIED;
+  static const FrameDropReason REASON_DISPLAY_COMPOSITOR = ChromeFrameReporter_FrameDropReason_REASON_DISPLAY_COMPOSITOR;
+  static const FrameDropReason REASON_MAIN_THREAD = ChromeFrameReporter_FrameDropReason_REASON_MAIN_THREAD;
+  static const FrameDropReason REASON_CLIENT_COMPOSITOR = ChromeFrameReporter_FrameDropReason_REASON_CLIENT_COMPOSITOR;
+  static const ScrollState SCROLL_NONE = ChromeFrameReporter_ScrollState_SCROLL_NONE;
+  static const ScrollState SCROLL_MAIN_THREAD = ChromeFrameReporter_ScrollState_SCROLL_MAIN_THREAD;
+  static const ScrollState SCROLL_COMPOSITOR_THREAD = ChromeFrameReporter_ScrollState_SCROLL_COMPOSITOR_THREAD;
+  static const ScrollState SCROLL_UNKNOWN = ChromeFrameReporter_ScrollState_SCROLL_UNKNOWN;
+
+  using FieldMetadata_State =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ChromeFrameReporter_State,
+      ChromeFrameReporter>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_State kState() { return {}; }
+  void set_state(::perfetto::protos::pbzero::ChromeFrameReporter_State value) {
+    static constexpr uint32_t field_id = FieldMetadata_State::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Reason =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ChromeFrameReporter_FrameDropReason,
+      ChromeFrameReporter>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Reason kReason() { return {}; }
+  void set_reason(::perfetto::protos::pbzero::ChromeFrameReporter_FrameDropReason value) {
+    static constexpr uint32_t field_id = FieldMetadata_Reason::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FrameSource =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ChromeFrameReporter>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FrameSource kFrameSource() { return {}; }
+  void set_frame_source(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FrameSource::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FrameSequence =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ChromeFrameReporter>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FrameSequence kFrameSequence() { return {}; }
+  void set_frame_sequence(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FrameSequence::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_AffectsSmoothness =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeFrameReporter>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AffectsSmoothness kAffectsSmoothness() { return {}; }
+  void set_affects_smoothness(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_AffectsSmoothness::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ScrollState =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ChromeFrameReporter_ScrollState,
+      ChromeFrameReporter>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ScrollState kScrollState() { return {}; }
+  void set_scroll_state(::perfetto::protos::pbzero::ChromeFrameReporter_ScrollState value) {
+    static constexpr uint32_t field_id = FieldMetadata_ScrollState::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HasMainAnimation =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeFrameReporter>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HasMainAnimation kHasMainAnimation() { return {}; }
+  void set_has_main_animation(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_HasMainAnimation::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HasCompositorAnimation =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeFrameReporter>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HasCompositorAnimation kHasCompositorAnimation() { return {}; }
+  void set_has_compositor_animation(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_HasCompositorAnimation::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HasSmoothInputMain =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeFrameReporter>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HasSmoothInputMain kHasSmoothInputMain() { return {}; }
+  void set_has_smooth_input_main(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_HasSmoothInputMain::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HasMissingContent =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeFrameReporter>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HasMissingContent kHasMissingContent() { return {}; }
+  void set_has_missing_content(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_HasMissingContent::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LayerTreeHostId =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ChromeFrameReporter>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LayerTreeHostId kLayerTreeHostId() { return {}; }
+  void set_layer_tree_host_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_LayerTreeHostId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_histogram_sample.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_HISTOGRAM_SAMPLE_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_HISTOGRAM_SAMPLE_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class ChromeHistogramSample_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ChromeHistogramSample_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ChromeHistogramSample_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ChromeHistogramSample_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name_hash() const { return at<1>().valid(); }
+  uint64_t name_hash() const { return at<1>().as_uint64(); }
+  bool has_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars name() const { return at<2>().as_string(); }
+  bool has_sample() const { return at<3>().valid(); }
+  int64_t sample() const { return at<3>().as_int64(); }
+  bool has_name_iid() const { return at<4>().valid(); }
+  uint64_t name_iid() const { return at<4>().as_uint64(); }
+};
+
+class ChromeHistogramSample : public ::protozero::Message {
+ public:
+  using Decoder = ChromeHistogramSample_Decoder;
+  enum : int32_t {
+    kNameHashFieldNumber = 1,
+    kNameFieldNumber = 2,
+    kSampleFieldNumber = 3,
+    kNameIidFieldNumber = 4,
+  };
+
+  using FieldMetadata_NameHash =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ChromeHistogramSample>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NameHash kNameHash() { return {}; }
+  void set_name_hash(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NameHash::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ChromeHistogramSample>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Sample =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      ChromeHistogramSample>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Sample kSample() { return {}; }
+  void set_sample(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Sample::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NameIid =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ChromeHistogramSample>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NameIid kNameIid() { return {}; }
+  void set_name_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NameIid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class HistogramName_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  HistogramName_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit HistogramName_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit HistogramName_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_iid() const { return at<1>().valid(); }
+  uint64_t iid() const { return at<1>().as_uint64(); }
+  bool has_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars name() const { return at<2>().as_string(); }
+};
+
+class HistogramName : public ::protozero::Message {
+ public:
+  using Decoder = HistogramName_Decoder;
+  enum : int32_t {
+    kIidFieldNumber = 1,
+    kNameFieldNumber = 2,
+  };
+
+  using FieldMetadata_Iid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      HistogramName>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Iid kIid() { return {}; }
+  void set_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Iid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      HistogramName>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_keyed_service.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_KEYED_SERVICE_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_KEYED_SERVICE_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class ChromeKeyedService_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ChromeKeyedService_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ChromeKeyedService_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ChromeKeyedService_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+};
+
+class ChromeKeyedService : public ::protozero::Message {
+ public:
+  using Decoder = ChromeKeyedService_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+  };
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ChromeKeyedService>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_latency_info.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_LATENCY_INFO_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_LATENCY_INFO_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class ChromeLatencyInfo_ComponentInfo;
+enum ChromeLatencyInfo_LatencyComponentType : int32_t;
+enum ChromeLatencyInfo_Step : int32_t;
+
+enum ChromeLatencyInfo_Step : int32_t {
+  ChromeLatencyInfo_Step_STEP_UNSPECIFIED = 0,
+  ChromeLatencyInfo_Step_STEP_SEND_INPUT_EVENT_UI = 3,
+  ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_IMPL = 5,
+  ChromeLatencyInfo_Step_STEP_DID_HANDLE_INPUT_AND_OVERSCROLL = 8,
+  ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_MAIN = 4,
+  ChromeLatencyInfo_Step_STEP_MAIN_THREAD_SCROLL_UPDATE = 2,
+  ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_MAIN_COMMIT = 1,
+  ChromeLatencyInfo_Step_STEP_HANDLED_INPUT_EVENT_MAIN_OR_IMPL = 9,
+  ChromeLatencyInfo_Step_STEP_HANDLED_INPUT_EVENT_IMPL = 10,
+  ChromeLatencyInfo_Step_STEP_SWAP_BUFFERS = 6,
+  ChromeLatencyInfo_Step_STEP_DRAW_AND_SWAP = 7,
+  ChromeLatencyInfo_Step_STEP_FINISHED_SWAP_BUFFERS = 11,
+};
+
+const ChromeLatencyInfo_Step ChromeLatencyInfo_Step_MIN = ChromeLatencyInfo_Step_STEP_UNSPECIFIED;
+const ChromeLatencyInfo_Step ChromeLatencyInfo_Step_MAX = ChromeLatencyInfo_Step_STEP_FINISHED_SWAP_BUFFERS;
+
+enum ChromeLatencyInfo_LatencyComponentType : int32_t {
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_UNSPECIFIED = 0,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_BEGIN_RWH = 1,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL = 2,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL = 3,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_ORIGINAL = 4,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_UI = 5,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERER_MAIN = 6,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN = 7,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL = 8,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_LAST_EVENT = 9,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_ACK_RWH = 10,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERER_SWAP = 11,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_DISPLAY_COMPOSITOR_RECEIVED_FRAME = 12,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_GPU_SWAP_BUFFER = 13,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_FRAME_SWAP = 14,
+};
+
+const ChromeLatencyInfo_LatencyComponentType ChromeLatencyInfo_LatencyComponentType_MIN = ChromeLatencyInfo_LatencyComponentType_COMPONENT_UNSPECIFIED;
+const ChromeLatencyInfo_LatencyComponentType ChromeLatencyInfo_LatencyComponentType_MAX = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_FRAME_SWAP;
+
+class ChromeLatencyInfo_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  ChromeLatencyInfo_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ChromeLatencyInfo_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ChromeLatencyInfo_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_trace_id() const { return at<1>().valid(); }
+  int64_t trace_id() const { return at<1>().as_int64(); }
+  bool has_step() const { return at<2>().valid(); }
+  int32_t step() const { return at<2>().as_int32(); }
+  bool has_frame_tree_node_id() const { return at<3>().valid(); }
+  int32_t frame_tree_node_id() const { return at<3>().as_int32(); }
+  bool has_component_info() const { return at<4>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> component_info() const { return GetRepeated<::protozero::ConstBytes>(4); }
+  bool has_is_coalesced() const { return at<5>().valid(); }
+  bool is_coalesced() const { return at<5>().as_bool(); }
+  bool has_gesture_scroll_id() const { return at<6>().valid(); }
+  int64_t gesture_scroll_id() const { return at<6>().as_int64(); }
+};
+
+class ChromeLatencyInfo : public ::protozero::Message {
+ public:
+  using Decoder = ChromeLatencyInfo_Decoder;
+  enum : int32_t {
+    kTraceIdFieldNumber = 1,
+    kStepFieldNumber = 2,
+    kFrameTreeNodeIdFieldNumber = 3,
+    kComponentInfoFieldNumber = 4,
+    kIsCoalescedFieldNumber = 5,
+    kGestureScrollIdFieldNumber = 6,
+  };
+  using ComponentInfo = ::perfetto::protos::pbzero::ChromeLatencyInfo_ComponentInfo;
+  using Step = ::perfetto::protos::pbzero::ChromeLatencyInfo_Step;
+  using LatencyComponentType = ::perfetto::protos::pbzero::ChromeLatencyInfo_LatencyComponentType;
+  static const Step STEP_UNSPECIFIED = ChromeLatencyInfo_Step_STEP_UNSPECIFIED;
+  static const Step STEP_SEND_INPUT_EVENT_UI = ChromeLatencyInfo_Step_STEP_SEND_INPUT_EVENT_UI;
+  static const Step STEP_HANDLE_INPUT_EVENT_IMPL = ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_IMPL;
+  static const Step STEP_DID_HANDLE_INPUT_AND_OVERSCROLL = ChromeLatencyInfo_Step_STEP_DID_HANDLE_INPUT_AND_OVERSCROLL;
+  static const Step STEP_HANDLE_INPUT_EVENT_MAIN = ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_MAIN;
+  static const Step STEP_MAIN_THREAD_SCROLL_UPDATE = ChromeLatencyInfo_Step_STEP_MAIN_THREAD_SCROLL_UPDATE;
+  static const Step STEP_HANDLE_INPUT_EVENT_MAIN_COMMIT = ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_MAIN_COMMIT;
+  static const Step STEP_HANDLED_INPUT_EVENT_MAIN_OR_IMPL = ChromeLatencyInfo_Step_STEP_HANDLED_INPUT_EVENT_MAIN_OR_IMPL;
+  static const Step STEP_HANDLED_INPUT_EVENT_IMPL = ChromeLatencyInfo_Step_STEP_HANDLED_INPUT_EVENT_IMPL;
+  static const Step STEP_SWAP_BUFFERS = ChromeLatencyInfo_Step_STEP_SWAP_BUFFERS;
+  static const Step STEP_DRAW_AND_SWAP = ChromeLatencyInfo_Step_STEP_DRAW_AND_SWAP;
+  static const Step STEP_FINISHED_SWAP_BUFFERS = ChromeLatencyInfo_Step_STEP_FINISHED_SWAP_BUFFERS;
+  static const LatencyComponentType COMPONENT_UNSPECIFIED = ChromeLatencyInfo_LatencyComponentType_COMPONENT_UNSPECIFIED;
+  static const LatencyComponentType COMPONENT_INPUT_EVENT_LATENCY_BEGIN_RWH = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_BEGIN_RWH;
+  static const LatencyComponentType COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL;
+  static const LatencyComponentType COMPONENT_INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL;
+  static const LatencyComponentType COMPONENT_INPUT_EVENT_LATENCY_ORIGINAL = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_ORIGINAL;
+  static const LatencyComponentType COMPONENT_INPUT_EVENT_LATENCY_UI = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_UI;
+  static const LatencyComponentType COMPONENT_INPUT_EVENT_LATENCY_RENDERER_MAIN = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERER_MAIN;
+  static const LatencyComponentType COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN;
+  static const LatencyComponentType COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL;
+  static const LatencyComponentType COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_LAST_EVENT = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_LAST_EVENT;
+  static const LatencyComponentType COMPONENT_INPUT_EVENT_LATENCY_ACK_RWH = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_ACK_RWH;
+  static const LatencyComponentType COMPONENT_INPUT_EVENT_LATENCY_RENDERER_SWAP = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERER_SWAP;
+  static const LatencyComponentType COMPONENT_DISPLAY_COMPOSITOR_RECEIVED_FRAME = ChromeLatencyInfo_LatencyComponentType_COMPONENT_DISPLAY_COMPOSITOR_RECEIVED_FRAME;
+  static const LatencyComponentType COMPONENT_INPUT_EVENT_GPU_SWAP_BUFFER = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_GPU_SWAP_BUFFER;
+  static const LatencyComponentType COMPONENT_INPUT_EVENT_LATENCY_FRAME_SWAP = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_FRAME_SWAP;
+
+  using FieldMetadata_TraceId =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      ChromeLatencyInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TraceId kTraceId() { return {}; }
+  void set_trace_id(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TraceId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Step =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ChromeLatencyInfo_Step,
+      ChromeLatencyInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Step kStep() { return {}; }
+  void set_step(::perfetto::protos::pbzero::ChromeLatencyInfo_Step value) {
+    static constexpr uint32_t field_id = FieldMetadata_Step::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FrameTreeNodeId =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ChromeLatencyInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FrameTreeNodeId kFrameTreeNodeId() { return {}; }
+  void set_frame_tree_node_id(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FrameTreeNodeId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ComponentInfo =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeLatencyInfo_ComponentInfo,
+      ChromeLatencyInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ComponentInfo kComponentInfo() { return {}; }
+  template <typename T = ChromeLatencyInfo_ComponentInfo> T* add_component_info() {
+    return BeginNestedMessage<T>(4);
+  }
+
+
+  using FieldMetadata_IsCoalesced =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeLatencyInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IsCoalesced kIsCoalesced() { return {}; }
+  void set_is_coalesced(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_IsCoalesced::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_GestureScrollId =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      ChromeLatencyInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GestureScrollId kGestureScrollId() { return {}; }
+  void set_gesture_scroll_id(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_GestureScrollId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class ChromeLatencyInfo_ComponentInfo_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ChromeLatencyInfo_ComponentInfo_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ChromeLatencyInfo_ComponentInfo_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ChromeLatencyInfo_ComponentInfo_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_component_type() const { return at<1>().valid(); }
+  int32_t component_type() const { return at<1>().as_int32(); }
+  bool has_time_us() const { return at<2>().valid(); }
+  uint64_t time_us() const { return at<2>().as_uint64(); }
+};
+
+class ChromeLatencyInfo_ComponentInfo : public ::protozero::Message {
+ public:
+  using Decoder = ChromeLatencyInfo_ComponentInfo_Decoder;
+  enum : int32_t {
+    kComponentTypeFieldNumber = 1,
+    kTimeUsFieldNumber = 2,
+  };
+
+  using FieldMetadata_ComponentType =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ChromeLatencyInfo_LatencyComponentType,
+      ChromeLatencyInfo_ComponentInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ComponentType kComponentType() { return {}; }
+  void set_component_type(::perfetto::protos::pbzero::ChromeLatencyInfo_LatencyComponentType value) {
+    static constexpr uint32_t field_id = FieldMetadata_ComponentType::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TimeUs =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ChromeLatencyInfo_ComponentInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TimeUs kTimeUs() { return {}; }
+  void set_time_us(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TimeUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_legacy_ipc.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_LEGACY_IPC_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_LEGACY_IPC_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+enum ChromeLegacyIpc_MessageClass : int32_t;
+
+enum ChromeLegacyIpc_MessageClass : int32_t {
+  ChromeLegacyIpc_MessageClass_CLASS_UNSPECIFIED = 0,
+  ChromeLegacyIpc_MessageClass_CLASS_AUTOMATION = 1,
+  ChromeLegacyIpc_MessageClass_CLASS_FRAME = 2,
+  ChromeLegacyIpc_MessageClass_CLASS_PAGE = 3,
+  ChromeLegacyIpc_MessageClass_CLASS_VIEW = 4,
+  ChromeLegacyIpc_MessageClass_CLASS_WIDGET = 5,
+  ChromeLegacyIpc_MessageClass_CLASS_INPUT = 6,
+  ChromeLegacyIpc_MessageClass_CLASS_TEST = 7,
+  ChromeLegacyIpc_MessageClass_CLASS_WORKER = 8,
+  ChromeLegacyIpc_MessageClass_CLASS_NACL = 9,
+  ChromeLegacyIpc_MessageClass_CLASS_GPU_CHANNEL = 10,
+  ChromeLegacyIpc_MessageClass_CLASS_MEDIA = 11,
+  ChromeLegacyIpc_MessageClass_CLASS_PPAPI = 12,
+  ChromeLegacyIpc_MessageClass_CLASS_CHROME = 13,
+  ChromeLegacyIpc_MessageClass_CLASS_DRAG = 14,
+  ChromeLegacyIpc_MessageClass_CLASS_PRINT = 15,
+  ChromeLegacyIpc_MessageClass_CLASS_EXTENSION = 16,
+  ChromeLegacyIpc_MessageClass_CLASS_TEXT_INPUT_CLIENT = 17,
+  ChromeLegacyIpc_MessageClass_CLASS_BLINK_TEST = 18,
+  ChromeLegacyIpc_MessageClass_CLASS_ACCESSIBILITY = 19,
+  ChromeLegacyIpc_MessageClass_CLASS_PRERENDER = 20,
+  ChromeLegacyIpc_MessageClass_CLASS_CHROMOTING = 21,
+  ChromeLegacyIpc_MessageClass_CLASS_BROWSER_PLUGIN = 22,
+  ChromeLegacyIpc_MessageClass_CLASS_ANDROID_WEB_VIEW = 23,
+  ChromeLegacyIpc_MessageClass_CLASS_NACL_HOST = 24,
+  ChromeLegacyIpc_MessageClass_CLASS_ENCRYPTED_MEDIA = 25,
+  ChromeLegacyIpc_MessageClass_CLASS_CAST = 26,
+  ChromeLegacyIpc_MessageClass_CLASS_GIN_JAVA_BRIDGE = 27,
+  ChromeLegacyIpc_MessageClass_CLASS_CHROME_UTILITY_PRINTING = 28,
+  ChromeLegacyIpc_MessageClass_CLASS_OZONE_GPU = 29,
+  ChromeLegacyIpc_MessageClass_CLASS_WEB_TEST = 30,
+  ChromeLegacyIpc_MessageClass_CLASS_NETWORK_HINTS = 31,
+  ChromeLegacyIpc_MessageClass_CLASS_EXTENSIONS_GUEST_VIEW = 32,
+  ChromeLegacyIpc_MessageClass_CLASS_GUEST_VIEW = 33,
+  ChromeLegacyIpc_MessageClass_CLASS_MEDIA_PLAYER_DELEGATE = 34,
+  ChromeLegacyIpc_MessageClass_CLASS_EXTENSION_WORKER = 35,
+  ChromeLegacyIpc_MessageClass_CLASS_SUBRESOURCE_FILTER = 36,
+  ChromeLegacyIpc_MessageClass_CLASS_UNFREEZABLE_FRAME = 37,
+};
+
+const ChromeLegacyIpc_MessageClass ChromeLegacyIpc_MessageClass_MIN = ChromeLegacyIpc_MessageClass_CLASS_UNSPECIFIED;
+const ChromeLegacyIpc_MessageClass ChromeLegacyIpc_MessageClass_MAX = ChromeLegacyIpc_MessageClass_CLASS_UNFREEZABLE_FRAME;
+
+class ChromeLegacyIpc_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ChromeLegacyIpc_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ChromeLegacyIpc_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ChromeLegacyIpc_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_message_class() const { return at<1>().valid(); }
+  int32_t message_class() const { return at<1>().as_int32(); }
+  bool has_message_line() const { return at<2>().valid(); }
+  uint32_t message_line() const { return at<2>().as_uint32(); }
+};
+
+class ChromeLegacyIpc : public ::protozero::Message {
+ public:
+  using Decoder = ChromeLegacyIpc_Decoder;
+  enum : int32_t {
+    kMessageClassFieldNumber = 1,
+    kMessageLineFieldNumber = 2,
+  };
+  using MessageClass = ::perfetto::protos::pbzero::ChromeLegacyIpc_MessageClass;
+  static const MessageClass CLASS_UNSPECIFIED = ChromeLegacyIpc_MessageClass_CLASS_UNSPECIFIED;
+  static const MessageClass CLASS_AUTOMATION = ChromeLegacyIpc_MessageClass_CLASS_AUTOMATION;
+  static const MessageClass CLASS_FRAME = ChromeLegacyIpc_MessageClass_CLASS_FRAME;
+  static const MessageClass CLASS_PAGE = ChromeLegacyIpc_MessageClass_CLASS_PAGE;
+  static const MessageClass CLASS_VIEW = ChromeLegacyIpc_MessageClass_CLASS_VIEW;
+  static const MessageClass CLASS_WIDGET = ChromeLegacyIpc_MessageClass_CLASS_WIDGET;
+  static const MessageClass CLASS_INPUT = ChromeLegacyIpc_MessageClass_CLASS_INPUT;
+  static const MessageClass CLASS_TEST = ChromeLegacyIpc_MessageClass_CLASS_TEST;
+  static const MessageClass CLASS_WORKER = ChromeLegacyIpc_MessageClass_CLASS_WORKER;
+  static const MessageClass CLASS_NACL = ChromeLegacyIpc_MessageClass_CLASS_NACL;
+  static const MessageClass CLASS_GPU_CHANNEL = ChromeLegacyIpc_MessageClass_CLASS_GPU_CHANNEL;
+  static const MessageClass CLASS_MEDIA = ChromeLegacyIpc_MessageClass_CLASS_MEDIA;
+  static const MessageClass CLASS_PPAPI = ChromeLegacyIpc_MessageClass_CLASS_PPAPI;
+  static const MessageClass CLASS_CHROME = ChromeLegacyIpc_MessageClass_CLASS_CHROME;
+  static const MessageClass CLASS_DRAG = ChromeLegacyIpc_MessageClass_CLASS_DRAG;
+  static const MessageClass CLASS_PRINT = ChromeLegacyIpc_MessageClass_CLASS_PRINT;
+  static const MessageClass CLASS_EXTENSION = ChromeLegacyIpc_MessageClass_CLASS_EXTENSION;
+  static const MessageClass CLASS_TEXT_INPUT_CLIENT = ChromeLegacyIpc_MessageClass_CLASS_TEXT_INPUT_CLIENT;
+  static const MessageClass CLASS_BLINK_TEST = ChromeLegacyIpc_MessageClass_CLASS_BLINK_TEST;
+  static const MessageClass CLASS_ACCESSIBILITY = ChromeLegacyIpc_MessageClass_CLASS_ACCESSIBILITY;
+  static const MessageClass CLASS_PRERENDER = ChromeLegacyIpc_MessageClass_CLASS_PRERENDER;
+  static const MessageClass CLASS_CHROMOTING = ChromeLegacyIpc_MessageClass_CLASS_CHROMOTING;
+  static const MessageClass CLASS_BROWSER_PLUGIN = ChromeLegacyIpc_MessageClass_CLASS_BROWSER_PLUGIN;
+  static const MessageClass CLASS_ANDROID_WEB_VIEW = ChromeLegacyIpc_MessageClass_CLASS_ANDROID_WEB_VIEW;
+  static const MessageClass CLASS_NACL_HOST = ChromeLegacyIpc_MessageClass_CLASS_NACL_HOST;
+  static const MessageClass CLASS_ENCRYPTED_MEDIA = ChromeLegacyIpc_MessageClass_CLASS_ENCRYPTED_MEDIA;
+  static const MessageClass CLASS_CAST = ChromeLegacyIpc_MessageClass_CLASS_CAST;
+  static const MessageClass CLASS_GIN_JAVA_BRIDGE = ChromeLegacyIpc_MessageClass_CLASS_GIN_JAVA_BRIDGE;
+  static const MessageClass CLASS_CHROME_UTILITY_PRINTING = ChromeLegacyIpc_MessageClass_CLASS_CHROME_UTILITY_PRINTING;
+  static const MessageClass CLASS_OZONE_GPU = ChromeLegacyIpc_MessageClass_CLASS_OZONE_GPU;
+  static const MessageClass CLASS_WEB_TEST = ChromeLegacyIpc_MessageClass_CLASS_WEB_TEST;
+  static const MessageClass CLASS_NETWORK_HINTS = ChromeLegacyIpc_MessageClass_CLASS_NETWORK_HINTS;
+  static const MessageClass CLASS_EXTENSIONS_GUEST_VIEW = ChromeLegacyIpc_MessageClass_CLASS_EXTENSIONS_GUEST_VIEW;
+  static const MessageClass CLASS_GUEST_VIEW = ChromeLegacyIpc_MessageClass_CLASS_GUEST_VIEW;
+  static const MessageClass CLASS_MEDIA_PLAYER_DELEGATE = ChromeLegacyIpc_MessageClass_CLASS_MEDIA_PLAYER_DELEGATE;
+  static const MessageClass CLASS_EXTENSION_WORKER = ChromeLegacyIpc_MessageClass_CLASS_EXTENSION_WORKER;
+  static const MessageClass CLASS_SUBRESOURCE_FILTER = ChromeLegacyIpc_MessageClass_CLASS_SUBRESOURCE_FILTER;
+  static const MessageClass CLASS_UNFREEZABLE_FRAME = ChromeLegacyIpc_MessageClass_CLASS_UNFREEZABLE_FRAME;
+
+  using FieldMetadata_MessageClass =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ChromeLegacyIpc_MessageClass,
+      ChromeLegacyIpc>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MessageClass kMessageClass() { return {}; }
+  void set_message_class(::perfetto::protos::pbzero::ChromeLegacyIpc_MessageClass value) {
+    static constexpr uint32_t field_id = FieldMetadata_MessageClass::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MessageLine =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      ChromeLegacyIpc>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MessageLine kMessageLine() { return {}; }
+  void set_message_line(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MessageLine::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_message_pump.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_MESSAGE_PUMP_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_MESSAGE_PUMP_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class ChromeMessagePump_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ChromeMessagePump_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ChromeMessagePump_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ChromeMessagePump_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_sent_messages_in_queue() const { return at<1>().valid(); }
+  bool sent_messages_in_queue() const { return at<1>().as_bool(); }
+  bool has_io_handler_location_iid() const { return at<2>().valid(); }
+  uint64_t io_handler_location_iid() const { return at<2>().as_uint64(); }
+};
+
+class ChromeMessagePump : public ::protozero::Message {
+ public:
+  using Decoder = ChromeMessagePump_Decoder;
+  enum : int32_t {
+    kSentMessagesInQueueFieldNumber = 1,
+    kIoHandlerLocationIidFieldNumber = 2,
+  };
+
+  using FieldMetadata_SentMessagesInQueue =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ChromeMessagePump>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SentMessagesInQueue kSentMessagesInQueue() { return {}; }
+  void set_sent_messages_in_queue(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_SentMessagesInQueue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IoHandlerLocationIid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ChromeMessagePump>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IoHandlerLocationIid kIoHandlerLocationIid() { return {}; }
+  void set_io_handler_location_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IoHandlerLocationIid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_mojo_event_info.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_MOJO_EVENT_INFO_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_MOJO_EVENT_INFO_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class ChromeMojoEventInfo_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ChromeMojoEventInfo_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ChromeMojoEventInfo_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ChromeMojoEventInfo_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_watcher_notify_interface_tag() const { return at<1>().valid(); }
+  ::protozero::ConstChars watcher_notify_interface_tag() const { return at<1>().as_string(); }
+  bool has_ipc_hash() const { return at<2>().valid(); }
+  uint32_t ipc_hash() const { return at<2>().as_uint32(); }
+  bool has_mojo_interface_tag() const { return at<3>().valid(); }
+  ::protozero::ConstChars mojo_interface_tag() const { return at<3>().as_string(); }
+};
+
+class ChromeMojoEventInfo : public ::protozero::Message {
+ public:
+  using Decoder = ChromeMojoEventInfo_Decoder;
+  enum : int32_t {
+    kWatcherNotifyInterfaceTagFieldNumber = 1,
+    kIpcHashFieldNumber = 2,
+    kMojoInterfaceTagFieldNumber = 3,
+  };
+
+  using FieldMetadata_WatcherNotifyInterfaceTag =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ChromeMojoEventInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_WatcherNotifyInterfaceTag kWatcherNotifyInterfaceTag() { return {}; }
+  void set_watcher_notify_interface_tag(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_WatcherNotifyInterfaceTag::kFieldId, data, size);
+  }
+  void set_watcher_notify_interface_tag(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_WatcherNotifyInterfaceTag::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IpcHash =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      ChromeMojoEventInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IpcHash kIpcHash() { return {}; }
+  void set_ipc_hash(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IpcHash::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MojoInterfaceTag =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ChromeMojoEventInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MojoInterfaceTag kMojoInterfaceTag() { return {}; }
+  void set_mojo_interface_tag(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_MojoInterfaceTag::kFieldId, data, size);
+  }
+  void set_mojo_interface_tag(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_MojoInterfaceTag::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_process_descriptor.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_PROCESS_DESCRIPTOR_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_PROCESS_DESCRIPTOR_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+enum ChromeProcessDescriptor_ProcessType : int32_t;
+
+enum ChromeProcessDescriptor_ProcessType : int32_t {
+  ChromeProcessDescriptor_ProcessType_PROCESS_UNSPECIFIED = 0,
+  ChromeProcessDescriptor_ProcessType_PROCESS_BROWSER = 1,
+  ChromeProcessDescriptor_ProcessType_PROCESS_RENDERER = 2,
+  ChromeProcessDescriptor_ProcessType_PROCESS_UTILITY = 3,
+  ChromeProcessDescriptor_ProcessType_PROCESS_ZYGOTE = 4,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SANDBOX_HELPER = 5,
+  ChromeProcessDescriptor_ProcessType_PROCESS_GPU = 6,
+  ChromeProcessDescriptor_ProcessType_PROCESS_PPAPI_PLUGIN = 7,
+  ChromeProcessDescriptor_ProcessType_PROCESS_PPAPI_BROKER = 8,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_NETWORK = 9,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_TRACING = 10,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_STORAGE = 11,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_AUDIO = 12,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_DATA_DECODER = 13,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_UTIL_WIN = 14,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PROXY_RESOLVER = 15,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_CDM = 16,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_VIDEO_CAPTURE = 17,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_UNZIPPER = 18,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_MIRRORING = 19,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_FILEPATCHER = 20,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_TTS = 21,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PRINTING = 22,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_QUARANTINE = 23,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_CROS_LOCALSEARCH = 24,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_CROS_ASSISTANT_AUDIO_DECODER = 25,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_FILEUTIL = 26,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PRINTCOMPOSITOR = 27,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PAINTPREVIEW = 28,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_SPEECHRECOGNITION = 29,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_XRDEVICE = 30,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_READICON = 31,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_LANGUAGEDETECTION = 32,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_SHARING = 33,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_MEDIAPARSER = 34,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_QRCODEGENERATOR = 35,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PROFILEIMPORT = 36,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_IME = 37,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_RECORDING = 38,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_SHAPEDETECTION = 39,
+};
+
+const ChromeProcessDescriptor_ProcessType ChromeProcessDescriptor_ProcessType_MIN = ChromeProcessDescriptor_ProcessType_PROCESS_UNSPECIFIED;
+const ChromeProcessDescriptor_ProcessType ChromeProcessDescriptor_ProcessType_MAX = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_SHAPEDETECTION;
+
+class ChromeProcessDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ChromeProcessDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ChromeProcessDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ChromeProcessDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_process_type() const { return at<1>().valid(); }
+  int32_t process_type() const { return at<1>().as_int32(); }
+  bool has_process_priority() const { return at<2>().valid(); }
+  int32_t process_priority() const { return at<2>().as_int32(); }
+  bool has_legacy_sort_index() const { return at<3>().valid(); }
+  int32_t legacy_sort_index() const { return at<3>().as_int32(); }
+  bool has_host_app_package_name() const { return at<4>().valid(); }
+  ::protozero::ConstChars host_app_package_name() const { return at<4>().as_string(); }
+  bool has_crash_trace_id() const { return at<5>().valid(); }
+  uint64_t crash_trace_id() const { return at<5>().as_uint64(); }
+};
+
+class ChromeProcessDescriptor : public ::protozero::Message {
+ public:
+  using Decoder = ChromeProcessDescriptor_Decoder;
+  enum : int32_t {
+    kProcessTypeFieldNumber = 1,
+    kProcessPriorityFieldNumber = 2,
+    kLegacySortIndexFieldNumber = 3,
+    kHostAppPackageNameFieldNumber = 4,
+    kCrashTraceIdFieldNumber = 5,
+  };
+  using ProcessType = ::perfetto::protos::pbzero::ChromeProcessDescriptor_ProcessType;
+  static const ProcessType PROCESS_UNSPECIFIED = ChromeProcessDescriptor_ProcessType_PROCESS_UNSPECIFIED;
+  static const ProcessType PROCESS_BROWSER = ChromeProcessDescriptor_ProcessType_PROCESS_BROWSER;
+  static const ProcessType PROCESS_RENDERER = ChromeProcessDescriptor_ProcessType_PROCESS_RENDERER;
+  static const ProcessType PROCESS_UTILITY = ChromeProcessDescriptor_ProcessType_PROCESS_UTILITY;
+  static const ProcessType PROCESS_ZYGOTE = ChromeProcessDescriptor_ProcessType_PROCESS_ZYGOTE;
+  static const ProcessType PROCESS_SANDBOX_HELPER = ChromeProcessDescriptor_ProcessType_PROCESS_SANDBOX_HELPER;
+  static const ProcessType PROCESS_GPU = ChromeProcessDescriptor_ProcessType_PROCESS_GPU;
+  static const ProcessType PROCESS_PPAPI_PLUGIN = ChromeProcessDescriptor_ProcessType_PROCESS_PPAPI_PLUGIN;
+  static const ProcessType PROCESS_PPAPI_BROKER = ChromeProcessDescriptor_ProcessType_PROCESS_PPAPI_BROKER;
+  static const ProcessType PROCESS_SERVICE_NETWORK = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_NETWORK;
+  static const ProcessType PROCESS_SERVICE_TRACING = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_TRACING;
+  static const ProcessType PROCESS_SERVICE_STORAGE = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_STORAGE;
+  static const ProcessType PROCESS_SERVICE_AUDIO = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_AUDIO;
+  static const ProcessType PROCESS_SERVICE_DATA_DECODER = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_DATA_DECODER;
+  static const ProcessType PROCESS_SERVICE_UTIL_WIN = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_UTIL_WIN;
+  static const ProcessType PROCESS_SERVICE_PROXY_RESOLVER = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PROXY_RESOLVER;
+  static const ProcessType PROCESS_SERVICE_CDM = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_CDM;
+  static const ProcessType PROCESS_SERVICE_VIDEO_CAPTURE = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_VIDEO_CAPTURE;
+  static const ProcessType PROCESS_SERVICE_UNZIPPER = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_UNZIPPER;
+  static const ProcessType PROCESS_SERVICE_MIRRORING = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_MIRRORING;
+  static const ProcessType PROCESS_SERVICE_FILEPATCHER = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_FILEPATCHER;
+  static const ProcessType PROCESS_SERVICE_TTS = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_TTS;
+  static const ProcessType PROCESS_SERVICE_PRINTING = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PRINTING;
+  static const ProcessType PROCESS_SERVICE_QUARANTINE = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_QUARANTINE;
+  static const ProcessType PROCESS_SERVICE_CROS_LOCALSEARCH = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_CROS_LOCALSEARCH;
+  static const ProcessType PROCESS_SERVICE_CROS_ASSISTANT_AUDIO_DECODER = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_CROS_ASSISTANT_AUDIO_DECODER;
+  static const ProcessType PROCESS_SERVICE_FILEUTIL = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_FILEUTIL;
+  static const ProcessType PROCESS_SERVICE_PRINTCOMPOSITOR = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PRINTCOMPOSITOR;
+  static const ProcessType PROCESS_SERVICE_PAINTPREVIEW = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PAINTPREVIEW;
+  static const ProcessType PROCESS_SERVICE_SPEECHRECOGNITION = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_SPEECHRECOGNITION;
+  static const ProcessType PROCESS_SERVICE_XRDEVICE = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_XRDEVICE;
+  static const ProcessType PROCESS_SERVICE_READICON = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_READICON;
+  static const ProcessType PROCESS_SERVICE_LANGUAGEDETECTION = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_LANGUAGEDETECTION;
+  static const ProcessType PROCESS_SERVICE_SHARING = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_SHARING;
+  static const ProcessType PROCESS_SERVICE_MEDIAPARSER = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_MEDIAPARSER;
+  static const ProcessType PROCESS_SERVICE_QRCODEGENERATOR = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_QRCODEGENERATOR;
+  static const ProcessType PROCESS_SERVICE_PROFILEIMPORT = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PROFILEIMPORT;
+  static const ProcessType PROCESS_SERVICE_IME = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_IME;
+  static const ProcessType PROCESS_SERVICE_RECORDING = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_RECORDING;
+  static const ProcessType PROCESS_SERVICE_SHAPEDETECTION = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_SHAPEDETECTION;
+
+  using FieldMetadata_ProcessType =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ChromeProcessDescriptor_ProcessType,
+      ChromeProcessDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProcessType kProcessType() { return {}; }
+  void set_process_type(::perfetto::protos::pbzero::ChromeProcessDescriptor_ProcessType value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProcessType::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ProcessPriority =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ChromeProcessDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProcessPriority kProcessPriority() { return {}; }
+  void set_process_priority(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProcessPriority::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LegacySortIndex =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ChromeProcessDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LegacySortIndex kLegacySortIndex() { return {}; }
+  void set_legacy_sort_index(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_LegacySortIndex::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HostAppPackageName =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ChromeProcessDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HostAppPackageName kHostAppPackageName() { return {}; }
+  void set_host_app_package_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_HostAppPackageName::kFieldId, data, size);
+  }
+  void set_host_app_package_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_HostAppPackageName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CrashTraceId =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ChromeProcessDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CrashTraceId kCrashTraceId() { return {}; }
+  void set_crash_trace_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CrashTraceId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_renderer_scheduler_state.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_RENDERER_SCHEDULER_STATE_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_RENDERER_SCHEDULER_STATE_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+enum ChromeRAILMode : int32_t;
+
+enum ChromeRAILMode : int32_t {
+  RAIL_MODE_NONE = 0,
+  RAIL_MODE_RESPONSE = 1,
+  RAIL_MODE_ANIMATION = 2,
+  RAIL_MODE_IDLE = 3,
+  RAIL_MODE_LOAD = 4,
+};
+
+const ChromeRAILMode ChromeRAILMode_MIN = RAIL_MODE_NONE;
+const ChromeRAILMode ChromeRAILMode_MAX = RAIL_MODE_LOAD;
+
+class ChromeRendererSchedulerState_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ChromeRendererSchedulerState_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ChromeRendererSchedulerState_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ChromeRendererSchedulerState_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_rail_mode() const { return at<1>().valid(); }
+  int32_t rail_mode() const { return at<1>().as_int32(); }
+};
+
+class ChromeRendererSchedulerState : public ::protozero::Message {
+ public:
+  using Decoder = ChromeRendererSchedulerState_Decoder;
+  enum : int32_t {
+    kRailModeFieldNumber = 1,
+  };
+
+  using FieldMetadata_RailMode =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ChromeRAILMode,
+      ChromeRendererSchedulerState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RailMode kRailMode() { return {}; }
+  void set_rail_mode(::perfetto::protos::pbzero::ChromeRAILMode value) {
+    static constexpr uint32_t field_id = FieldMetadata_RailMode::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_thread_descriptor.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_THREAD_DESCRIPTOR_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_THREAD_DESCRIPTOR_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+enum ChromeThreadDescriptor_ThreadType : int32_t;
+
+enum ChromeThreadDescriptor_ThreadType : int32_t {
+  ChromeThreadDescriptor_ThreadType_THREAD_UNSPECIFIED = 0,
+  ChromeThreadDescriptor_ThreadType_THREAD_MAIN = 1,
+  ChromeThreadDescriptor_ThreadType_THREAD_IO = 2,
+  ChromeThreadDescriptor_ThreadType_THREAD_POOL_BG_WORKER = 3,
+  ChromeThreadDescriptor_ThreadType_THREAD_POOL_FG_WORKER = 4,
+  ChromeThreadDescriptor_ThreadType_THREAD_POOL_FG_BLOCKING = 5,
+  ChromeThreadDescriptor_ThreadType_THREAD_POOL_BG_BLOCKING = 6,
+  ChromeThreadDescriptor_ThreadType_THREAD_POOL_SERVICE = 7,
+  ChromeThreadDescriptor_ThreadType_THREAD_COMPOSITOR = 8,
+  ChromeThreadDescriptor_ThreadType_THREAD_VIZ_COMPOSITOR = 9,
+  ChromeThreadDescriptor_ThreadType_THREAD_COMPOSITOR_WORKER = 10,
+  ChromeThreadDescriptor_ThreadType_THREAD_SERVICE_WORKER = 11,
+  ChromeThreadDescriptor_ThreadType_THREAD_NETWORK_SERVICE = 12,
+  ChromeThreadDescriptor_ThreadType_THREAD_CHILD_IO = 13,
+  ChromeThreadDescriptor_ThreadType_THREAD_BROWSER_IO = 14,
+  ChromeThreadDescriptor_ThreadType_THREAD_BROWSER_MAIN = 15,
+  ChromeThreadDescriptor_ThreadType_THREAD_RENDERER_MAIN = 16,
+  ChromeThreadDescriptor_ThreadType_THREAD_UTILITY_MAIN = 17,
+  ChromeThreadDescriptor_ThreadType_THREAD_GPU_MAIN = 18,
+  ChromeThreadDescriptor_ThreadType_THREAD_CACHE_BLOCKFILE = 19,
+  ChromeThreadDescriptor_ThreadType_THREAD_MEDIA = 20,
+  ChromeThreadDescriptor_ThreadType_THREAD_AUDIO_OUTPUTDEVICE = 21,
+  ChromeThreadDescriptor_ThreadType_THREAD_AUDIO_INPUTDEVICE = 22,
+  ChromeThreadDescriptor_ThreadType_THREAD_GPU_MEMORY = 23,
+  ChromeThreadDescriptor_ThreadType_THREAD_GPU_VSYNC = 24,
+  ChromeThreadDescriptor_ThreadType_THREAD_DXA_VIDEODECODER = 25,
+  ChromeThreadDescriptor_ThreadType_THREAD_BROWSER_WATCHDOG = 26,
+  ChromeThreadDescriptor_ThreadType_THREAD_WEBRTC_NETWORK = 27,
+  ChromeThreadDescriptor_ThreadType_THREAD_WINDOW_OWNER = 28,
+  ChromeThreadDescriptor_ThreadType_THREAD_WEBRTC_SIGNALING = 29,
+  ChromeThreadDescriptor_ThreadType_THREAD_WEBRTC_WORKER = 30,
+  ChromeThreadDescriptor_ThreadType_THREAD_PPAPI_MAIN = 31,
+  ChromeThreadDescriptor_ThreadType_THREAD_GPU_WATCHDOG = 32,
+  ChromeThreadDescriptor_ThreadType_THREAD_SWAPPER = 33,
+  ChromeThreadDescriptor_ThreadType_THREAD_GAMEPAD_POLLING = 34,
+  ChromeThreadDescriptor_ThreadType_THREAD_WEBCRYPTO = 35,
+  ChromeThreadDescriptor_ThreadType_THREAD_DATABASE = 36,
+  ChromeThreadDescriptor_ThreadType_THREAD_PROXYRESOLVER = 37,
+  ChromeThreadDescriptor_ThreadType_THREAD_DEVTOOLSADB = 38,
+  ChromeThreadDescriptor_ThreadType_THREAD_NETWORKCONFIGWATCHER = 39,
+  ChromeThreadDescriptor_ThreadType_THREAD_WASAPI_RENDER = 40,
+  ChromeThreadDescriptor_ThreadType_THREAD_MEMORY_INFRA = 50,
+  ChromeThreadDescriptor_ThreadType_THREAD_SAMPLING_PROFILER = 51,
+};
+
+const ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor_ThreadType_MIN = ChromeThreadDescriptor_ThreadType_THREAD_UNSPECIFIED;
+const ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor_ThreadType_MAX = ChromeThreadDescriptor_ThreadType_THREAD_SAMPLING_PROFILER;
+
+class ChromeThreadDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ChromeThreadDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ChromeThreadDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ChromeThreadDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_thread_type() const { return at<1>().valid(); }
+  int32_t thread_type() const { return at<1>().as_int32(); }
+  bool has_legacy_sort_index() const { return at<2>().valid(); }
+  int32_t legacy_sort_index() const { return at<2>().as_int32(); }
+};
+
+class ChromeThreadDescriptor : public ::protozero::Message {
+ public:
+  using Decoder = ChromeThreadDescriptor_Decoder;
+  enum : int32_t {
+    kThreadTypeFieldNumber = 1,
+    kLegacySortIndexFieldNumber = 2,
+  };
+  using ThreadType = ::perfetto::protos::pbzero::ChromeThreadDescriptor_ThreadType;
+  static const ThreadType THREAD_UNSPECIFIED = ChromeThreadDescriptor_ThreadType_THREAD_UNSPECIFIED;
+  static const ThreadType THREAD_MAIN = ChromeThreadDescriptor_ThreadType_THREAD_MAIN;
+  static const ThreadType THREAD_IO = ChromeThreadDescriptor_ThreadType_THREAD_IO;
+  static const ThreadType THREAD_POOL_BG_WORKER = ChromeThreadDescriptor_ThreadType_THREAD_POOL_BG_WORKER;
+  static const ThreadType THREAD_POOL_FG_WORKER = ChromeThreadDescriptor_ThreadType_THREAD_POOL_FG_WORKER;
+  static const ThreadType THREAD_POOL_FG_BLOCKING = ChromeThreadDescriptor_ThreadType_THREAD_POOL_FG_BLOCKING;
+  static const ThreadType THREAD_POOL_BG_BLOCKING = ChromeThreadDescriptor_ThreadType_THREAD_POOL_BG_BLOCKING;
+  static const ThreadType THREAD_POOL_SERVICE = ChromeThreadDescriptor_ThreadType_THREAD_POOL_SERVICE;
+  static const ThreadType THREAD_COMPOSITOR = ChromeThreadDescriptor_ThreadType_THREAD_COMPOSITOR;
+  static const ThreadType THREAD_VIZ_COMPOSITOR = ChromeThreadDescriptor_ThreadType_THREAD_VIZ_COMPOSITOR;
+  static const ThreadType THREAD_COMPOSITOR_WORKER = ChromeThreadDescriptor_ThreadType_THREAD_COMPOSITOR_WORKER;
+  static const ThreadType THREAD_SERVICE_WORKER = ChromeThreadDescriptor_ThreadType_THREAD_SERVICE_WORKER;
+  static const ThreadType THREAD_NETWORK_SERVICE = ChromeThreadDescriptor_ThreadType_THREAD_NETWORK_SERVICE;
+  static const ThreadType THREAD_CHILD_IO = ChromeThreadDescriptor_ThreadType_THREAD_CHILD_IO;
+  static const ThreadType THREAD_BROWSER_IO = ChromeThreadDescriptor_ThreadType_THREAD_BROWSER_IO;
+  static const ThreadType THREAD_BROWSER_MAIN = ChromeThreadDescriptor_ThreadType_THREAD_BROWSER_MAIN;
+  static const ThreadType THREAD_RENDERER_MAIN = ChromeThreadDescriptor_ThreadType_THREAD_RENDERER_MAIN;
+  static const ThreadType THREAD_UTILITY_MAIN = ChromeThreadDescriptor_ThreadType_THREAD_UTILITY_MAIN;
+  static const ThreadType THREAD_GPU_MAIN = ChromeThreadDescriptor_ThreadType_THREAD_GPU_MAIN;
+  static const ThreadType THREAD_CACHE_BLOCKFILE = ChromeThreadDescriptor_ThreadType_THREAD_CACHE_BLOCKFILE;
+  static const ThreadType THREAD_MEDIA = ChromeThreadDescriptor_ThreadType_THREAD_MEDIA;
+  static const ThreadType THREAD_AUDIO_OUTPUTDEVICE = ChromeThreadDescriptor_ThreadType_THREAD_AUDIO_OUTPUTDEVICE;
+  static const ThreadType THREAD_AUDIO_INPUTDEVICE = ChromeThreadDescriptor_ThreadType_THREAD_AUDIO_INPUTDEVICE;
+  static const ThreadType THREAD_GPU_MEMORY = ChromeThreadDescriptor_ThreadType_THREAD_GPU_MEMORY;
+  static const ThreadType THREAD_GPU_VSYNC = ChromeThreadDescriptor_ThreadType_THREAD_GPU_VSYNC;
+  static const ThreadType THREAD_DXA_VIDEODECODER = ChromeThreadDescriptor_ThreadType_THREAD_DXA_VIDEODECODER;
+  static const ThreadType THREAD_BROWSER_WATCHDOG = ChromeThreadDescriptor_ThreadType_THREAD_BROWSER_WATCHDOG;
+  static const ThreadType THREAD_WEBRTC_NETWORK = ChromeThreadDescriptor_ThreadType_THREAD_WEBRTC_NETWORK;
+  static const ThreadType THREAD_WINDOW_OWNER = ChromeThreadDescriptor_ThreadType_THREAD_WINDOW_OWNER;
+  static const ThreadType THREAD_WEBRTC_SIGNALING = ChromeThreadDescriptor_ThreadType_THREAD_WEBRTC_SIGNALING;
+  static const ThreadType THREAD_WEBRTC_WORKER = ChromeThreadDescriptor_ThreadType_THREAD_WEBRTC_WORKER;
+  static const ThreadType THREAD_PPAPI_MAIN = ChromeThreadDescriptor_ThreadType_THREAD_PPAPI_MAIN;
+  static const ThreadType THREAD_GPU_WATCHDOG = ChromeThreadDescriptor_ThreadType_THREAD_GPU_WATCHDOG;
+  static const ThreadType THREAD_SWAPPER = ChromeThreadDescriptor_ThreadType_THREAD_SWAPPER;
+  static const ThreadType THREAD_GAMEPAD_POLLING = ChromeThreadDescriptor_ThreadType_THREAD_GAMEPAD_POLLING;
+  static const ThreadType THREAD_WEBCRYPTO = ChromeThreadDescriptor_ThreadType_THREAD_WEBCRYPTO;
+  static const ThreadType THREAD_DATABASE = ChromeThreadDescriptor_ThreadType_THREAD_DATABASE;
+  static const ThreadType THREAD_PROXYRESOLVER = ChromeThreadDescriptor_ThreadType_THREAD_PROXYRESOLVER;
+  static const ThreadType THREAD_DEVTOOLSADB = ChromeThreadDescriptor_ThreadType_THREAD_DEVTOOLSADB;
+  static const ThreadType THREAD_NETWORKCONFIGWATCHER = ChromeThreadDescriptor_ThreadType_THREAD_NETWORKCONFIGWATCHER;
+  static const ThreadType THREAD_WASAPI_RENDER = ChromeThreadDescriptor_ThreadType_THREAD_WASAPI_RENDER;
+  static const ThreadType THREAD_MEMORY_INFRA = ChromeThreadDescriptor_ThreadType_THREAD_MEMORY_INFRA;
+  static const ThreadType THREAD_SAMPLING_PROFILER = ChromeThreadDescriptor_ThreadType_THREAD_SAMPLING_PROFILER;
+
+  using FieldMetadata_ThreadType =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ChromeThreadDescriptor_ThreadType,
+      ChromeThreadDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ThreadType kThreadType() { return {}; }
+  void set_thread_type(::perfetto::protos::pbzero::ChromeThreadDescriptor_ThreadType value) {
+    static constexpr uint32_t field_id = FieldMetadata_ThreadType::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LegacySortIndex =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ChromeThreadDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LegacySortIndex kLegacySortIndex() { return {}; }
+  void set_legacy_sort_index(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_LegacySortIndex::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_user_event.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_USER_EVENT_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_USER_EVENT_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class ChromeUserEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ChromeUserEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ChromeUserEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ChromeUserEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_action() const { return at<1>().valid(); }
+  ::protozero::ConstChars action() const { return at<1>().as_string(); }
+  bool has_action_hash() const { return at<2>().valid(); }
+  uint64_t action_hash() const { return at<2>().as_uint64(); }
+};
+
+class ChromeUserEvent : public ::protozero::Message {
+ public:
+  using Decoder = ChromeUserEvent_Decoder;
+  enum : int32_t {
+    kActionFieldNumber = 1,
+    kActionHashFieldNumber = 2,
+  };
+
+  using FieldMetadata_Action =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ChromeUserEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Action kAction() { return {}; }
+  void set_action(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Action::kFieldId, data, size);
+  }
+  void set_action(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Action::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ActionHash =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ChromeUserEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ActionHash kActionHash() { return {}; }
+  void set_action_hash(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ActionHash::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_window_handle_event_info.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_WINDOW_HANDLE_EVENT_INFO_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_WINDOW_HANDLE_EVENT_INFO_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class ChromeWindowHandleEventInfo_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ChromeWindowHandleEventInfo_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ChromeWindowHandleEventInfo_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ChromeWindowHandleEventInfo_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_dpi() const { return at<1>().valid(); }
+  uint32_t dpi() const { return at<1>().as_uint32(); }
+  bool has_message_id() const { return at<2>().valid(); }
+  uint32_t message_id() const { return at<2>().as_uint32(); }
+  bool has_hwnd_ptr() const { return at<3>().valid(); }
+  uint64_t hwnd_ptr() const { return at<3>().as_uint64(); }
+};
+
+class ChromeWindowHandleEventInfo : public ::protozero::Message {
+ public:
+  using Decoder = ChromeWindowHandleEventInfo_Decoder;
+  enum : int32_t {
+    kDpiFieldNumber = 1,
+    kMessageIdFieldNumber = 2,
+    kHwndPtrFieldNumber = 3,
+  };
+
+  using FieldMetadata_Dpi =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      ChromeWindowHandleEventInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Dpi kDpi() { return {}; }
+  void set_dpi(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Dpi::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_MessageId =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      ChromeWindowHandleEventInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MessageId kMessageId() { return {}; }
+  void set_message_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_MessageId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HwndPtr =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kFixed64,
+      uint64_t,
+      ChromeWindowHandleEventInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HwndPtr kHwndPtr() { return {}; }
+  void set_hwnd_ptr(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_HwndPtr::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kFixed64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/counter_descriptor.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_COUNTER_DESCRIPTOR_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_COUNTER_DESCRIPTOR_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+enum CounterDescriptor_BuiltinCounterType : int32_t;
+enum CounterDescriptor_Unit : int32_t;
+
+enum CounterDescriptor_BuiltinCounterType : int32_t {
+  CounterDescriptor_BuiltinCounterType_COUNTER_UNSPECIFIED = 0,
+  CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_TIME_NS = 1,
+  CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_INSTRUCTION_COUNT = 2,
+};
+
+const CounterDescriptor_BuiltinCounterType CounterDescriptor_BuiltinCounterType_MIN = CounterDescriptor_BuiltinCounterType_COUNTER_UNSPECIFIED;
+const CounterDescriptor_BuiltinCounterType CounterDescriptor_BuiltinCounterType_MAX = CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_INSTRUCTION_COUNT;
+
+enum CounterDescriptor_Unit : int32_t {
+  CounterDescriptor_Unit_UNIT_UNSPECIFIED = 0,
+  CounterDescriptor_Unit_UNIT_TIME_NS = 1,
+  CounterDescriptor_Unit_UNIT_COUNT = 2,
+  CounterDescriptor_Unit_UNIT_SIZE_BYTES = 3,
+};
+
+const CounterDescriptor_Unit CounterDescriptor_Unit_MIN = CounterDescriptor_Unit_UNIT_UNSPECIFIED;
+const CounterDescriptor_Unit CounterDescriptor_Unit_MAX = CounterDescriptor_Unit_UNIT_SIZE_BYTES;
+
+class CounterDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  CounterDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit CounterDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit CounterDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_type() const { return at<1>().valid(); }
+  int32_t type() const { return at<1>().as_int32(); }
+  bool has_categories() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> categories() const { return GetRepeated<::protozero::ConstChars>(2); }
+  bool has_unit() const { return at<3>().valid(); }
+  int32_t unit() const { return at<3>().as_int32(); }
+  bool has_unit_name() const { return at<6>().valid(); }
+  ::protozero::ConstChars unit_name() const { return at<6>().as_string(); }
+  bool has_unit_multiplier() const { return at<4>().valid(); }
+  int64_t unit_multiplier() const { return at<4>().as_int64(); }
+  bool has_is_incremental() const { return at<5>().valid(); }
+  bool is_incremental() const { return at<5>().as_bool(); }
+};
+
+class CounterDescriptor : public ::protozero::Message {
+ public:
+  using Decoder = CounterDescriptor_Decoder;
+  enum : int32_t {
+    kTypeFieldNumber = 1,
+    kCategoriesFieldNumber = 2,
+    kUnitFieldNumber = 3,
+    kUnitNameFieldNumber = 6,
+    kUnitMultiplierFieldNumber = 4,
+    kIsIncrementalFieldNumber = 5,
+  };
+  using BuiltinCounterType = ::perfetto::protos::pbzero::CounterDescriptor_BuiltinCounterType;
+  using Unit = ::perfetto::protos::pbzero::CounterDescriptor_Unit;
+  static const BuiltinCounterType COUNTER_UNSPECIFIED = CounterDescriptor_BuiltinCounterType_COUNTER_UNSPECIFIED;
+  static const BuiltinCounterType COUNTER_THREAD_TIME_NS = CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_TIME_NS;
+  static const BuiltinCounterType COUNTER_THREAD_INSTRUCTION_COUNT = CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_INSTRUCTION_COUNT;
+  static const Unit UNIT_UNSPECIFIED = CounterDescriptor_Unit_UNIT_UNSPECIFIED;
+  static const Unit UNIT_TIME_NS = CounterDescriptor_Unit_UNIT_TIME_NS;
+  static const Unit UNIT_COUNT = CounterDescriptor_Unit_UNIT_COUNT;
+  static const Unit UNIT_SIZE_BYTES = CounterDescriptor_Unit_UNIT_SIZE_BYTES;
+
+  using FieldMetadata_Type =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::CounterDescriptor_BuiltinCounterType,
+      CounterDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Type kType() { return {}; }
+  void set_type(::perfetto::protos::pbzero::CounterDescriptor_BuiltinCounterType value) {
+    static constexpr uint32_t field_id = FieldMetadata_Type::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Categories =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      CounterDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Categories kCategories() { return {}; }
+  void add_categories(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Categories::kFieldId, data, size);
+  }
+  void add_categories(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Categories::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Unit =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::CounterDescriptor_Unit,
+      CounterDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Unit kUnit() { return {}; }
+  void set_unit(::perfetto::protos::pbzero::CounterDescriptor_Unit value) {
+    static constexpr uint32_t field_id = FieldMetadata_Unit::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_UnitName =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      CounterDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UnitName kUnitName() { return {}; }
+  void set_unit_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_UnitName::kFieldId, data, size);
+  }
+  void set_unit_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_UnitName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_UnitMultiplier =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      CounterDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UnitMultiplier kUnitMultiplier() { return {}; }
+  void set_unit_multiplier(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_UnitMultiplier::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IsIncremental =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      CounterDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IsIncremental kIsIncremental() { return {}; }
+  void set_is_incremental(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_IsIncremental::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/debug_annotation.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_DEBUG_ANNOTATION_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_DEBUG_ANNOTATION_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class DebugAnnotation;
+class DebugAnnotation_NestedValue;
+enum DebugAnnotation_NestedValue_NestedType : int32_t;
+
+enum DebugAnnotation_NestedValue_NestedType : int32_t {
+  DebugAnnotation_NestedValue_NestedType_UNSPECIFIED = 0,
+  DebugAnnotation_NestedValue_NestedType_DICT = 1,
+  DebugAnnotation_NestedValue_NestedType_ARRAY = 2,
+};
+
+const DebugAnnotation_NestedValue_NestedType DebugAnnotation_NestedValue_NestedType_MIN = DebugAnnotation_NestedValue_NestedType_UNSPECIFIED;
+const DebugAnnotation_NestedValue_NestedType DebugAnnotation_NestedValue_NestedType_MAX = DebugAnnotation_NestedValue_NestedType_ARRAY;
+
+class DebugAnnotationName_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  DebugAnnotationName_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit DebugAnnotationName_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit DebugAnnotationName_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_iid() const { return at<1>().valid(); }
+  uint64_t iid() const { return at<1>().as_uint64(); }
+  bool has_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars name() const { return at<2>().as_string(); }
+};
+
+class DebugAnnotationName : public ::protozero::Message {
+ public:
+  using Decoder = DebugAnnotationName_Decoder;
+  enum : int32_t {
+    kIidFieldNumber = 1,
+    kNameFieldNumber = 2,
+  };
+
+  using FieldMetadata_Iid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      DebugAnnotationName>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Iid kIid() { return {}; }
+  void set_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Iid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      DebugAnnotationName>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class DebugAnnotation_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/12, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  DebugAnnotation_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit DebugAnnotation_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit DebugAnnotation_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name_iid() const { return at<1>().valid(); }
+  uint64_t name_iid() const { return at<1>().as_uint64(); }
+  bool has_name() const { return at<10>().valid(); }
+  ::protozero::ConstChars name() const { return at<10>().as_string(); }
+  bool has_bool_value() const { return at<2>().valid(); }
+  bool bool_value() const { return at<2>().as_bool(); }
+  bool has_uint_value() const { return at<3>().valid(); }
+  uint64_t uint_value() const { return at<3>().as_uint64(); }
+  bool has_int_value() const { return at<4>().valid(); }
+  int64_t int_value() const { return at<4>().as_int64(); }
+  bool has_double_value() const { return at<5>().valid(); }
+  double double_value() const { return at<5>().as_double(); }
+  bool has_string_value() const { return at<6>().valid(); }
+  ::protozero::ConstChars string_value() const { return at<6>().as_string(); }
+  bool has_pointer_value() const { return at<7>().valid(); }
+  uint64_t pointer_value() const { return at<7>().as_uint64(); }
+  bool has_nested_value() const { return at<8>().valid(); }
+  ::protozero::ConstBytes nested_value() const { return at<8>().as_bytes(); }
+  bool has_legacy_json_value() const { return at<9>().valid(); }
+  ::protozero::ConstChars legacy_json_value() const { return at<9>().as_string(); }
+  bool has_dict_entries() const { return at<11>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> dict_entries() const { return GetRepeated<::protozero::ConstBytes>(11); }
+  bool has_array_values() const { return at<12>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> array_values() const { return GetRepeated<::protozero::ConstBytes>(12); }
+};
+
+class DebugAnnotation : public ::protozero::Message {
+ public:
+  using Decoder = DebugAnnotation_Decoder;
+  enum : int32_t {
+    kNameIidFieldNumber = 1,
+    kNameFieldNumber = 10,
+    kBoolValueFieldNumber = 2,
+    kUintValueFieldNumber = 3,
+    kIntValueFieldNumber = 4,
+    kDoubleValueFieldNumber = 5,
+    kStringValueFieldNumber = 6,
+    kPointerValueFieldNumber = 7,
+    kNestedValueFieldNumber = 8,
+    kLegacyJsonValueFieldNumber = 9,
+    kDictEntriesFieldNumber = 11,
+    kArrayValuesFieldNumber = 12,
+  };
+  using NestedValue = ::perfetto::protos::pbzero::DebugAnnotation_NestedValue;
+
+  using FieldMetadata_NameIid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      DebugAnnotation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NameIid kNameIid() { return {}; }
+  void set_name_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NameIid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      DebugAnnotation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BoolValue =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      DebugAnnotation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BoolValue kBoolValue() { return {}; }
+  void set_bool_value(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_BoolValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_UintValue =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      DebugAnnotation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UintValue kUintValue() { return {}; }
+  void set_uint_value(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_UintValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IntValue =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      DebugAnnotation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IntValue kIntValue() { return {}; }
+  void set_int_value(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IntValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DoubleValue =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kDouble,
+      double,
+      DebugAnnotation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DoubleValue kDoubleValue() { return {}; }
+  void set_double_value(double value) {
+    static constexpr uint32_t field_id = FieldMetadata_DoubleValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kDouble>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_StringValue =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      DebugAnnotation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StringValue kStringValue() { return {}; }
+  void set_string_value(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_StringValue::kFieldId, data, size);
+  }
+  void set_string_value(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_StringValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PointerValue =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      DebugAnnotation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PointerValue kPointerValue() { return {}; }
+  void set_pointer_value(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PointerValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NestedValue =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      DebugAnnotation_NestedValue,
+      DebugAnnotation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NestedValue kNestedValue() { return {}; }
+  template <typename T = DebugAnnotation_NestedValue> T* set_nested_value() {
+    return BeginNestedMessage<T>(8);
+  }
+
+
+  using FieldMetadata_LegacyJsonValue =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      DebugAnnotation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LegacyJsonValue kLegacyJsonValue() { return {}; }
+  void set_legacy_json_value(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_LegacyJsonValue::kFieldId, data, size);
+  }
+  void set_legacy_json_value(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_LegacyJsonValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DictEntries =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      DebugAnnotation,
+      DebugAnnotation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DictEntries kDictEntries() { return {}; }
+  template <typename T = DebugAnnotation> T* add_dict_entries() {
+    return BeginNestedMessage<T>(11);
+  }
+
+
+  using FieldMetadata_ArrayValues =
+    ::protozero::proto_utils::FieldMetadata<
+      12,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      DebugAnnotation,
+      DebugAnnotation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ArrayValues kArrayValues() { return {}; }
+  template <typename T = DebugAnnotation> T* add_array_values() {
+    return BeginNestedMessage<T>(12);
+  }
+
+};
+
+class DebugAnnotation_NestedValue_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  DebugAnnotation_NestedValue_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit DebugAnnotation_NestedValue_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit DebugAnnotation_NestedValue_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_nested_type() const { return at<1>().valid(); }
+  int32_t nested_type() const { return at<1>().as_int32(); }
+  bool has_dict_keys() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> dict_keys() const { return GetRepeated<::protozero::ConstChars>(2); }
+  bool has_dict_values() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> dict_values() const { return GetRepeated<::protozero::ConstBytes>(3); }
+  bool has_array_values() const { return at<4>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> array_values() const { return GetRepeated<::protozero::ConstBytes>(4); }
+  bool has_int_value() const { return at<5>().valid(); }
+  int64_t int_value() const { return at<5>().as_int64(); }
+  bool has_double_value() const { return at<6>().valid(); }
+  double double_value() const { return at<6>().as_double(); }
+  bool has_bool_value() const { return at<7>().valid(); }
+  bool bool_value() const { return at<7>().as_bool(); }
+  bool has_string_value() const { return at<8>().valid(); }
+  ::protozero::ConstChars string_value() const { return at<8>().as_string(); }
+};
+
+class DebugAnnotation_NestedValue : public ::protozero::Message {
+ public:
+  using Decoder = DebugAnnotation_NestedValue_Decoder;
+  enum : int32_t {
+    kNestedTypeFieldNumber = 1,
+    kDictKeysFieldNumber = 2,
+    kDictValuesFieldNumber = 3,
+    kArrayValuesFieldNumber = 4,
+    kIntValueFieldNumber = 5,
+    kDoubleValueFieldNumber = 6,
+    kBoolValueFieldNumber = 7,
+    kStringValueFieldNumber = 8,
+  };
+  using NestedType = ::perfetto::protos::pbzero::DebugAnnotation_NestedValue_NestedType;
+  static const NestedType UNSPECIFIED = DebugAnnotation_NestedValue_NestedType_UNSPECIFIED;
+  static const NestedType DICT = DebugAnnotation_NestedValue_NestedType_DICT;
+  static const NestedType ARRAY = DebugAnnotation_NestedValue_NestedType_ARRAY;
+
+  using FieldMetadata_NestedType =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::DebugAnnotation_NestedValue_NestedType,
+      DebugAnnotation_NestedValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NestedType kNestedType() { return {}; }
+  void set_nested_type(::perfetto::protos::pbzero::DebugAnnotation_NestedValue_NestedType value) {
+    static constexpr uint32_t field_id = FieldMetadata_NestedType::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DictKeys =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      DebugAnnotation_NestedValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DictKeys kDictKeys() { return {}; }
+  void add_dict_keys(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_DictKeys::kFieldId, data, size);
+  }
+  void add_dict_keys(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_DictKeys::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DictValues =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      DebugAnnotation_NestedValue,
+      DebugAnnotation_NestedValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DictValues kDictValues() { return {}; }
+  template <typename T = DebugAnnotation_NestedValue> T* add_dict_values() {
+    return BeginNestedMessage<T>(3);
+  }
+
+
+  using FieldMetadata_ArrayValues =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      DebugAnnotation_NestedValue,
+      DebugAnnotation_NestedValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ArrayValues kArrayValues() { return {}; }
+  template <typename T = DebugAnnotation_NestedValue> T* add_array_values() {
+    return BeginNestedMessage<T>(4);
+  }
+
+
+  using FieldMetadata_IntValue =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      DebugAnnotation_NestedValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IntValue kIntValue() { return {}; }
+  void set_int_value(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IntValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DoubleValue =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kDouble,
+      double,
+      DebugAnnotation_NestedValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DoubleValue kDoubleValue() { return {}; }
+  void set_double_value(double value) {
+    static constexpr uint32_t field_id = FieldMetadata_DoubleValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kDouble>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BoolValue =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      DebugAnnotation_NestedValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BoolValue kBoolValue() { return {}; }
+  void set_bool_value(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_BoolValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_StringValue =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      DebugAnnotation_NestedValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StringValue kStringValue() { return {}; }
+  void set_string_value(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_StringValue::kFieldId, data, size);
+  }
+  void set_string_value(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_StringValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/log_message.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_LOG_MESSAGE_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_LOG_MESSAGE_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class LogMessageBody_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  LogMessageBody_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit LogMessageBody_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit LogMessageBody_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_iid() const { return at<1>().valid(); }
+  uint64_t iid() const { return at<1>().as_uint64(); }
+  bool has_body() const { return at<2>().valid(); }
+  ::protozero::ConstChars body() const { return at<2>().as_string(); }
+};
+
+class LogMessageBody : public ::protozero::Message {
+ public:
+  using Decoder = LogMessageBody_Decoder;
+  enum : int32_t {
+    kIidFieldNumber = 1,
+    kBodyFieldNumber = 2,
+  };
+
+  using FieldMetadata_Iid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      LogMessageBody>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Iid kIid() { return {}; }
+  void set_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Iid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Body =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      LogMessageBody>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Body kBody() { return {}; }
+  void set_body(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Body::kFieldId, data, size);
+  }
+  void set_body(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Body::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class LogMessage_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  LogMessage_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit LogMessage_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit LogMessage_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_source_location_iid() const { return at<1>().valid(); }
+  uint64_t source_location_iid() const { return at<1>().as_uint64(); }
+  bool has_body_iid() const { return at<2>().valid(); }
+  uint64_t body_iid() const { return at<2>().as_uint64(); }
+};
+
+class LogMessage : public ::protozero::Message {
+ public:
+  using Decoder = LogMessage_Decoder;
+  enum : int32_t {
+    kSourceLocationIidFieldNumber = 1,
+    kBodyIidFieldNumber = 2,
+  };
+
+  using FieldMetadata_SourceLocationIid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      LogMessage>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SourceLocationIid kSourceLocationIid() { return {}; }
+  void set_source_location_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SourceLocationIid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BodyIid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      LogMessage>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BodyIid kBodyIid() { return {}; }
+  void set_body_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BodyIid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/process_descriptor.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_PROCESS_DESCRIPTOR_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_PROCESS_DESCRIPTOR_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+enum ProcessDescriptor_ChromeProcessType : int32_t;
+
+enum ProcessDescriptor_ChromeProcessType : int32_t {
+  ProcessDescriptor_ChromeProcessType_PROCESS_UNSPECIFIED = 0,
+  ProcessDescriptor_ChromeProcessType_PROCESS_BROWSER = 1,
+  ProcessDescriptor_ChromeProcessType_PROCESS_RENDERER = 2,
+  ProcessDescriptor_ChromeProcessType_PROCESS_UTILITY = 3,
+  ProcessDescriptor_ChromeProcessType_PROCESS_ZYGOTE = 4,
+  ProcessDescriptor_ChromeProcessType_PROCESS_SANDBOX_HELPER = 5,
+  ProcessDescriptor_ChromeProcessType_PROCESS_GPU = 6,
+  ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_PLUGIN = 7,
+  ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_BROKER = 8,
+};
+
+const ProcessDescriptor_ChromeProcessType ProcessDescriptor_ChromeProcessType_MIN = ProcessDescriptor_ChromeProcessType_PROCESS_UNSPECIFIED;
+const ProcessDescriptor_ChromeProcessType ProcessDescriptor_ChromeProcessType_MAX = ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_BROKER;
+
+class ProcessDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  ProcessDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ProcessDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ProcessDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_pid() const { return at<1>().valid(); }
+  int32_t pid() const { return at<1>().as_int32(); }
+  bool has_cmdline() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> cmdline() const { return GetRepeated<::protozero::ConstChars>(2); }
+  bool has_process_name() const { return at<6>().valid(); }
+  ::protozero::ConstChars process_name() const { return at<6>().as_string(); }
+  bool has_process_priority() const { return at<5>().valid(); }
+  int32_t process_priority() const { return at<5>().as_int32(); }
+  bool has_start_timestamp_ns() const { return at<7>().valid(); }
+  int64_t start_timestamp_ns() const { return at<7>().as_int64(); }
+  bool has_chrome_process_type() const { return at<4>().valid(); }
+  int32_t chrome_process_type() const { return at<4>().as_int32(); }
+  bool has_legacy_sort_index() const { return at<3>().valid(); }
+  int32_t legacy_sort_index() const { return at<3>().as_int32(); }
+};
+
+class ProcessDescriptor : public ::protozero::Message {
+ public:
+  using Decoder = ProcessDescriptor_Decoder;
+  enum : int32_t {
+    kPidFieldNumber = 1,
+    kCmdlineFieldNumber = 2,
+    kProcessNameFieldNumber = 6,
+    kProcessPriorityFieldNumber = 5,
+    kStartTimestampNsFieldNumber = 7,
+    kChromeProcessTypeFieldNumber = 4,
+    kLegacySortIndexFieldNumber = 3,
+  };
+  using ChromeProcessType = ::perfetto::protos::pbzero::ProcessDescriptor_ChromeProcessType;
+  static const ChromeProcessType PROCESS_UNSPECIFIED = ProcessDescriptor_ChromeProcessType_PROCESS_UNSPECIFIED;
+  static const ChromeProcessType PROCESS_BROWSER = ProcessDescriptor_ChromeProcessType_PROCESS_BROWSER;
+  static const ChromeProcessType PROCESS_RENDERER = ProcessDescriptor_ChromeProcessType_PROCESS_RENDERER;
+  static const ChromeProcessType PROCESS_UTILITY = ProcessDescriptor_ChromeProcessType_PROCESS_UTILITY;
+  static const ChromeProcessType PROCESS_ZYGOTE = ProcessDescriptor_ChromeProcessType_PROCESS_ZYGOTE;
+  static const ChromeProcessType PROCESS_SANDBOX_HELPER = ProcessDescriptor_ChromeProcessType_PROCESS_SANDBOX_HELPER;
+  static const ChromeProcessType PROCESS_GPU = ProcessDescriptor_ChromeProcessType_PROCESS_GPU;
+  static const ChromeProcessType PROCESS_PPAPI_PLUGIN = ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_PLUGIN;
+  static const ChromeProcessType PROCESS_PPAPI_BROKER = ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_BROKER;
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ProcessDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Cmdline =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ProcessDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cmdline kCmdline() { return {}; }
+  void add_cmdline(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Cmdline::kFieldId, data, size);
+  }
+  void add_cmdline(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cmdline::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ProcessName =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ProcessDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProcessName kProcessName() { return {}; }
+  void set_process_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ProcessName::kFieldId, data, size);
+  }
+  void set_process_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProcessName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ProcessPriority =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ProcessDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProcessPriority kProcessPriority() { return {}; }
+  void set_process_priority(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ProcessPriority::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_StartTimestampNs =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      ProcessDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StartTimestampNs kStartTimestampNs() { return {}; }
+  void set_start_timestamp_ns(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_StartTimestampNs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ChromeProcessType =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ProcessDescriptor_ChromeProcessType,
+      ProcessDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeProcessType kChromeProcessType() { return {}; }
+  void set_chrome_process_type(::perfetto::protos::pbzero::ProcessDescriptor_ChromeProcessType value) {
+    static constexpr uint32_t field_id = FieldMetadata_ChromeProcessType::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LegacySortIndex =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ProcessDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LegacySortIndex kLegacySortIndex() { return {}; }
+  void set_legacy_sort_index(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_LegacySortIndex::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/source_location.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_SOURCE_LOCATION_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_SOURCE_LOCATION_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class SourceLocation_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SourceLocation_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SourceLocation_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SourceLocation_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_iid() const { return at<1>().valid(); }
+  uint64_t iid() const { return at<1>().as_uint64(); }
+  bool has_file_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars file_name() const { return at<2>().as_string(); }
+  bool has_function_name() const { return at<3>().valid(); }
+  ::protozero::ConstChars function_name() const { return at<3>().as_string(); }
+  bool has_line_number() const { return at<4>().valid(); }
+  uint32_t line_number() const { return at<4>().as_uint32(); }
+};
+
+class SourceLocation : public ::protozero::Message {
+ public:
+  using Decoder = SourceLocation_Decoder;
+  enum : int32_t {
+    kIidFieldNumber = 1,
+    kFileNameFieldNumber = 2,
+    kFunctionNameFieldNumber = 3,
+    kLineNumberFieldNumber = 4,
+  };
+
+  using FieldMetadata_Iid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SourceLocation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Iid kIid() { return {}; }
+  void set_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Iid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FileName =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SourceLocation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FileName kFileName() { return {}; }
+  void set_file_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_FileName::kFieldId, data, size);
+  }
+  void set_file_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_FileName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FunctionName =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SourceLocation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FunctionName kFunctionName() { return {}; }
+  void set_function_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_FunctionName::kFieldId, data, size);
+  }
+  void set_function_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_FunctionName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LineNumber =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SourceLocation>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LineNumber kLineNumber() { return {}; }
+  void set_line_number(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_LineNumber::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/task_execution.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TASK_EXECUTION_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TASK_EXECUTION_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class TaskExecution_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TaskExecution_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TaskExecution_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TaskExecution_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_posted_from_iid() const { return at<1>().valid(); }
+  uint64_t posted_from_iid() const { return at<1>().as_uint64(); }
+};
+
+class TaskExecution : public ::protozero::Message {
+ public:
+  using Decoder = TaskExecution_Decoder;
+  enum : int32_t {
+    kPostedFromIidFieldNumber = 1,
+  };
+
+  using FieldMetadata_PostedFromIid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TaskExecution>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PostedFromIid kPostedFromIid() { return {}; }
+  void set_posted_from_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PostedFromIid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/thread_descriptor.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_THREAD_DESCRIPTOR_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_THREAD_DESCRIPTOR_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+enum ThreadDescriptor_ChromeThreadType : int32_t;
+
+enum ThreadDescriptor_ChromeThreadType : int32_t {
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_UNSPECIFIED = 0,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_MAIN = 1,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_IO = 2,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_BG_WORKER = 3,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_FG_WORKER = 4,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_FB_BLOCKING = 5,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_BG_BLOCKING = 6,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_SERVICE = 7,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_COMPOSITOR = 8,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_VIZ_COMPOSITOR = 9,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_COMPOSITOR_WORKER = 10,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SERVICE_WORKER = 11,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_MEMORY_INFRA = 50,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SAMPLING_PROFILER = 51,
+};
+
+const ThreadDescriptor_ChromeThreadType ThreadDescriptor_ChromeThreadType_MIN = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_UNSPECIFIED;
+const ThreadDescriptor_ChromeThreadType ThreadDescriptor_ChromeThreadType_MAX = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SAMPLING_PROFILER;
+
+class ThreadDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ThreadDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ThreadDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ThreadDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_pid() const { return at<1>().valid(); }
+  int32_t pid() const { return at<1>().as_int32(); }
+  bool has_tid() const { return at<2>().valid(); }
+  int32_t tid() const { return at<2>().as_int32(); }
+  bool has_thread_name() const { return at<5>().valid(); }
+  ::protozero::ConstChars thread_name() const { return at<5>().as_string(); }
+  bool has_chrome_thread_type() const { return at<4>().valid(); }
+  int32_t chrome_thread_type() const { return at<4>().as_int32(); }
+  bool has_reference_timestamp_us() const { return at<6>().valid(); }
+  int64_t reference_timestamp_us() const { return at<6>().as_int64(); }
+  bool has_reference_thread_time_us() const { return at<7>().valid(); }
+  int64_t reference_thread_time_us() const { return at<7>().as_int64(); }
+  bool has_reference_thread_instruction_count() const { return at<8>().valid(); }
+  int64_t reference_thread_instruction_count() const { return at<8>().as_int64(); }
+  bool has_legacy_sort_index() const { return at<3>().valid(); }
+  int32_t legacy_sort_index() const { return at<3>().as_int32(); }
+};
+
+class ThreadDescriptor : public ::protozero::Message {
+ public:
+  using Decoder = ThreadDescriptor_Decoder;
+  enum : int32_t {
+    kPidFieldNumber = 1,
+    kTidFieldNumber = 2,
+    kThreadNameFieldNumber = 5,
+    kChromeThreadTypeFieldNumber = 4,
+    kReferenceTimestampUsFieldNumber = 6,
+    kReferenceThreadTimeUsFieldNumber = 7,
+    kReferenceThreadInstructionCountFieldNumber = 8,
+    kLegacySortIndexFieldNumber = 3,
+  };
+  using ChromeThreadType = ::perfetto::protos::pbzero::ThreadDescriptor_ChromeThreadType;
+  static const ChromeThreadType CHROME_THREAD_UNSPECIFIED = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_UNSPECIFIED;
+  static const ChromeThreadType CHROME_THREAD_MAIN = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_MAIN;
+  static const ChromeThreadType CHROME_THREAD_IO = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_IO;
+  static const ChromeThreadType CHROME_THREAD_POOL_BG_WORKER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_BG_WORKER;
+  static const ChromeThreadType CHROME_THREAD_POOL_FG_WORKER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_FG_WORKER;
+  static const ChromeThreadType CHROME_THREAD_POOL_FB_BLOCKING = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_FB_BLOCKING;
+  static const ChromeThreadType CHROME_THREAD_POOL_BG_BLOCKING = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_BG_BLOCKING;
+  static const ChromeThreadType CHROME_THREAD_POOL_SERVICE = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_SERVICE;
+  static const ChromeThreadType CHROME_THREAD_COMPOSITOR = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_COMPOSITOR;
+  static const ChromeThreadType CHROME_THREAD_VIZ_COMPOSITOR = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_VIZ_COMPOSITOR;
+  static const ChromeThreadType CHROME_THREAD_COMPOSITOR_WORKER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_COMPOSITOR_WORKER;
+  static const ChromeThreadType CHROME_THREAD_SERVICE_WORKER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SERVICE_WORKER;
+  static const ChromeThreadType CHROME_THREAD_MEMORY_INFRA = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_MEMORY_INFRA;
+  static const ChromeThreadType CHROME_THREAD_SAMPLING_PROFILER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SAMPLING_PROFILER;
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ThreadDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Tid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ThreadDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Tid kTid() { return {}; }
+  void set_tid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Tid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ThreadName =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ThreadDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ThreadName kThreadName() { return {}; }
+  void set_thread_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ThreadName::kFieldId, data, size);
+  }
+  void set_thread_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ThreadName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ChromeThreadType =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::ThreadDescriptor_ChromeThreadType,
+      ThreadDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeThreadType kChromeThreadType() { return {}; }
+  void set_chrome_thread_type(::perfetto::protos::pbzero::ThreadDescriptor_ChromeThreadType value) {
+    static constexpr uint32_t field_id = FieldMetadata_ChromeThreadType::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ReferenceTimestampUs =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      ThreadDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ReferenceTimestampUs kReferenceTimestampUs() { return {}; }
+  void set_reference_timestamp_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ReferenceTimestampUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ReferenceThreadTimeUs =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      ThreadDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ReferenceThreadTimeUs kReferenceThreadTimeUs() { return {}; }
+  void set_reference_thread_time_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ReferenceThreadTimeUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ReferenceThreadInstructionCount =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      ThreadDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ReferenceThreadInstructionCount kReferenceThreadInstructionCount() { return {}; }
+  void set_reference_thread_instruction_count(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ReferenceThreadInstructionCount::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LegacySortIndex =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ThreadDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LegacySortIndex kLegacySortIndex() { return {}; }
+  void set_legacy_sort_index(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_LegacySortIndex::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/track_descriptor.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_DESCRIPTOR_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_DESCRIPTOR_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class ChromeProcessDescriptor;
+class ChromeThreadDescriptor;
+class CounterDescriptor;
+class ProcessDescriptor;
+class ThreadDescriptor;
+
+class TrackDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TrackDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TrackDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TrackDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_uuid() const { return at<1>().valid(); }
+  uint64_t uuid() const { return at<1>().as_uint64(); }
+  bool has_parent_uuid() const { return at<5>().valid(); }
+  uint64_t parent_uuid() const { return at<5>().as_uint64(); }
+  bool has_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars name() const { return at<2>().as_string(); }
+  bool has_process() const { return at<3>().valid(); }
+  ::protozero::ConstBytes process() const { return at<3>().as_bytes(); }
+  bool has_chrome_process() const { return at<6>().valid(); }
+  ::protozero::ConstBytes chrome_process() const { return at<6>().as_bytes(); }
+  bool has_thread() const { return at<4>().valid(); }
+  ::protozero::ConstBytes thread() const { return at<4>().as_bytes(); }
+  bool has_chrome_thread() const { return at<7>().valid(); }
+  ::protozero::ConstBytes chrome_thread() const { return at<7>().as_bytes(); }
+  bool has_counter() const { return at<8>().valid(); }
+  ::protozero::ConstBytes counter() const { return at<8>().as_bytes(); }
+};
+
+class TrackDescriptor : public ::protozero::Message {
+ public:
+  using Decoder = TrackDescriptor_Decoder;
+  enum : int32_t {
+    kUuidFieldNumber = 1,
+    kParentUuidFieldNumber = 5,
+    kNameFieldNumber = 2,
+    kProcessFieldNumber = 3,
+    kChromeProcessFieldNumber = 6,
+    kThreadFieldNumber = 4,
+    kChromeThreadFieldNumber = 7,
+    kCounterFieldNumber = 8,
+  };
+
+  using FieldMetadata_Uuid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Uuid kUuid() { return {}; }
+  void set_uuid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Uuid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ParentUuid =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ParentUuid kParentUuid() { return {}; }
+  void set_parent_uuid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ParentUuid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TrackDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Process =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ProcessDescriptor,
+      TrackDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Process kProcess() { return {}; }
+  template <typename T = ProcessDescriptor> T* set_process() {
+    return BeginNestedMessage<T>(3);
+  }
+
+
+  using FieldMetadata_ChromeProcess =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeProcessDescriptor,
+      TrackDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeProcess kChromeProcess() { return {}; }
+  template <typename T = ChromeProcessDescriptor> T* set_chrome_process() {
+    return BeginNestedMessage<T>(6);
+  }
+
+
+  using FieldMetadata_Thread =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ThreadDescriptor,
+      TrackDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Thread kThread() { return {}; }
+  template <typename T = ThreadDescriptor> T* set_thread() {
+    return BeginNestedMessage<T>(4);
+  }
+
+
+  using FieldMetadata_ChromeThread =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeThreadDescriptor,
+      TrackDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeThread kChromeThread() { return {}; }
+  template <typename T = ChromeThreadDescriptor> T* set_chrome_thread() {
+    return BeginNestedMessage<T>(7);
+  }
+
+
+  using FieldMetadata_Counter =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      CounterDescriptor,
+      TrackDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Counter kCounter() { return {}; }
+  template <typename T = CounterDescriptor> T* set_counter() {
+    return BeginNestedMessage<T>(8);
+  }
+
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/track_event.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_EVENT_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_EVENT_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class ChromeApplicationStateInfo;
+class ChromeCompositorSchedulerState;
+class ChromeContentSettingsEventInfo;
+class ChromeFrameReporter;
+class ChromeHistogramSample;
+class ChromeKeyedService;
+class ChromeLatencyInfo;
+class ChromeLegacyIpc;
+class ChromeMessagePump;
+class ChromeMojoEventInfo;
+class ChromeRendererSchedulerState;
+class ChromeUserEvent;
+class ChromeWindowHandleEventInfo;
+class DebugAnnotation;
+class LogMessage;
+class SourceLocation;
+class TaskExecution;
+class TrackEvent_LegacyEvent;
+enum TrackEvent_LegacyEvent_FlowDirection : int32_t;
+enum TrackEvent_LegacyEvent_InstantEventScope : int32_t;
+enum TrackEvent_Type : int32_t;
+
+enum TrackEvent_Type : int32_t {
+  TrackEvent_Type_TYPE_UNSPECIFIED = 0,
+  TrackEvent_Type_TYPE_SLICE_BEGIN = 1,
+  TrackEvent_Type_TYPE_SLICE_END = 2,
+  TrackEvent_Type_TYPE_INSTANT = 3,
+  TrackEvent_Type_TYPE_COUNTER = 4,
+};
+
+const TrackEvent_Type TrackEvent_Type_MIN = TrackEvent_Type_TYPE_UNSPECIFIED;
+const TrackEvent_Type TrackEvent_Type_MAX = TrackEvent_Type_TYPE_COUNTER;
+
+enum TrackEvent_LegacyEvent_FlowDirection : int32_t {
+  TrackEvent_LegacyEvent_FlowDirection_FLOW_UNSPECIFIED = 0,
+  TrackEvent_LegacyEvent_FlowDirection_FLOW_IN = 1,
+  TrackEvent_LegacyEvent_FlowDirection_FLOW_OUT = 2,
+  TrackEvent_LegacyEvent_FlowDirection_FLOW_INOUT = 3,
+};
+
+const TrackEvent_LegacyEvent_FlowDirection TrackEvent_LegacyEvent_FlowDirection_MIN = TrackEvent_LegacyEvent_FlowDirection_FLOW_UNSPECIFIED;
+const TrackEvent_LegacyEvent_FlowDirection TrackEvent_LegacyEvent_FlowDirection_MAX = TrackEvent_LegacyEvent_FlowDirection_FLOW_INOUT;
+
+enum TrackEvent_LegacyEvent_InstantEventScope : int32_t {
+  TrackEvent_LegacyEvent_InstantEventScope_SCOPE_UNSPECIFIED = 0,
+  TrackEvent_LegacyEvent_InstantEventScope_SCOPE_GLOBAL = 1,
+  TrackEvent_LegacyEvent_InstantEventScope_SCOPE_PROCESS = 2,
+  TrackEvent_LegacyEvent_InstantEventScope_SCOPE_THREAD = 3,
+};
+
+const TrackEvent_LegacyEvent_InstantEventScope TrackEvent_LegacyEvent_InstantEventScope_MIN = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_UNSPECIFIED;
+const TrackEvent_LegacyEvent_InstantEventScope TrackEvent_LegacyEvent_InstantEventScope_MAX = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_THREAD;
+
+class EventName_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  EventName_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit EventName_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit EventName_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_iid() const { return at<1>().valid(); }
+  uint64_t iid() const { return at<1>().as_uint64(); }
+  bool has_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars name() const { return at<2>().as_string(); }
+};
+
+class EventName : public ::protozero::Message {
+ public:
+  using Decoder = EventName_Decoder;
+  enum : int32_t {
+    kIidFieldNumber = 1,
+    kNameFieldNumber = 2,
+  };
+
+  using FieldMetadata_Iid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      EventName>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Iid kIid() { return {}; }
+  void set_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Iid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      EventName>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class EventCategory_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  EventCategory_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit EventCategory_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit EventCategory_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_iid() const { return at<1>().valid(); }
+  uint64_t iid() const { return at<1>().as_uint64(); }
+  bool has_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars name() const { return at<2>().as_string(); }
+};
+
+class EventCategory : public ::protozero::Message {
+ public:
+  using Decoder = EventCategory_Decoder;
+  enum : int32_t {
+    kIidFieldNumber = 1,
+    kNameFieldNumber = 2,
+  };
+
+  using FieldMetadata_Iid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      EventCategory>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Iid kIid() { return {}; }
+  void set_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Iid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      EventCategory>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TrackEventDefaults_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/45, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  TrackEventDefaults_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TrackEventDefaults_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TrackEventDefaults_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_track_uuid() const { return at<11>().valid(); }
+  uint64_t track_uuid() const { return at<11>().as_uint64(); }
+  bool has_extra_counter_track_uuids() const { return at<31>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> extra_counter_track_uuids() const { return GetRepeated<uint64_t>(31); }
+  bool has_extra_double_counter_track_uuids() const { return at<45>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> extra_double_counter_track_uuids() const { return GetRepeated<uint64_t>(45); }
+};
+
+class TrackEventDefaults : public ::protozero::Message {
+ public:
+  using Decoder = TrackEventDefaults_Decoder;
+  enum : int32_t {
+    kTrackUuidFieldNumber = 11,
+    kExtraCounterTrackUuidsFieldNumber = 31,
+    kExtraDoubleCounterTrackUuidsFieldNumber = 45,
+  };
+
+  using FieldMetadata_TrackUuid =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEventDefaults>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TrackUuid kTrackUuid() { return {}; }
+  void set_track_uuid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TrackUuid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ExtraCounterTrackUuids =
+    ::protozero::proto_utils::FieldMetadata<
+      31,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEventDefaults>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ExtraCounterTrackUuids kExtraCounterTrackUuids() { return {}; }
+  void add_extra_counter_track_uuids(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ExtraCounterTrackUuids::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ExtraDoubleCounterTrackUuids =
+    ::protozero::proto_utils::FieldMetadata<
+      45,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEventDefaults>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ExtraDoubleCounterTrackUuids kExtraDoubleCounterTrackUuids() { return {}; }
+  void add_extra_double_counter_track_uuids(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ExtraDoubleCounterTrackUuids::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TrackEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/46, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  TrackEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TrackEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TrackEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_category_iids() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> category_iids() const { return GetRepeated<uint64_t>(3); }
+  bool has_categories() const { return at<22>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> categories() const { return GetRepeated<::protozero::ConstChars>(22); }
+  bool has_name_iid() const { return at<10>().valid(); }
+  uint64_t name_iid() const { return at<10>().as_uint64(); }
+  bool has_name() const { return at<23>().valid(); }
+  ::protozero::ConstChars name() const { return at<23>().as_string(); }
+  bool has_type() const { return at<9>().valid(); }
+  int32_t type() const { return at<9>().as_int32(); }
+  bool has_track_uuid() const { return at<11>().valid(); }
+  uint64_t track_uuid() const { return at<11>().as_uint64(); }
+  bool has_counter_value() const { return at<30>().valid(); }
+  int64_t counter_value() const { return at<30>().as_int64(); }
+  bool has_double_counter_value() const { return at<44>().valid(); }
+  double double_counter_value() const { return at<44>().as_double(); }
+  bool has_extra_counter_track_uuids() const { return at<31>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> extra_counter_track_uuids() const { return GetRepeated<uint64_t>(31); }
+  bool has_extra_counter_values() const { return at<12>().valid(); }
+  ::protozero::RepeatedFieldIterator<int64_t> extra_counter_values() const { return GetRepeated<int64_t>(12); }
+  bool has_extra_double_counter_track_uuids() const { return at<45>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> extra_double_counter_track_uuids() const { return GetRepeated<uint64_t>(45); }
+  bool has_extra_double_counter_values() const { return at<46>().valid(); }
+  ::protozero::RepeatedFieldIterator<double> extra_double_counter_values() const { return GetRepeated<double>(46); }
+  bool has_flow_ids() const { return at<36>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> flow_ids() const { return GetRepeated<uint64_t>(36); }
+  bool has_terminating_flow_ids() const { return at<42>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> terminating_flow_ids() const { return GetRepeated<uint64_t>(42); }
+  bool has_debug_annotations() const { return at<4>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> debug_annotations() const { return GetRepeated<::protozero::ConstBytes>(4); }
+  bool has_task_execution() const { return at<5>().valid(); }
+  ::protozero::ConstBytes task_execution() const { return at<5>().as_bytes(); }
+  bool has_log_message() const { return at<21>().valid(); }
+  ::protozero::ConstBytes log_message() const { return at<21>().as_bytes(); }
+  bool has_cc_scheduler_state() const { return at<24>().valid(); }
+  ::protozero::ConstBytes cc_scheduler_state() const { return at<24>().as_bytes(); }
+  bool has_chrome_user_event() const { return at<25>().valid(); }
+  ::protozero::ConstBytes chrome_user_event() const { return at<25>().as_bytes(); }
+  bool has_chrome_keyed_service() const { return at<26>().valid(); }
+  ::protozero::ConstBytes chrome_keyed_service() const { return at<26>().as_bytes(); }
+  bool has_chrome_legacy_ipc() const { return at<27>().valid(); }
+  ::protozero::ConstBytes chrome_legacy_ipc() const { return at<27>().as_bytes(); }
+  bool has_chrome_histogram_sample() const { return at<28>().valid(); }
+  ::protozero::ConstBytes chrome_histogram_sample() const { return at<28>().as_bytes(); }
+  bool has_chrome_latency_info() const { return at<29>().valid(); }
+  ::protozero::ConstBytes chrome_latency_info() const { return at<29>().as_bytes(); }
+  bool has_chrome_frame_reporter() const { return at<32>().valid(); }
+  ::protozero::ConstBytes chrome_frame_reporter() const { return at<32>().as_bytes(); }
+  bool has_chrome_application_state_info() const { return at<39>().valid(); }
+  ::protozero::ConstBytes chrome_application_state_info() const { return at<39>().as_bytes(); }
+  bool has_chrome_renderer_scheduler_state() const { return at<40>().valid(); }
+  ::protozero::ConstBytes chrome_renderer_scheduler_state() const { return at<40>().as_bytes(); }
+  bool has_chrome_window_handle_event_info() const { return at<41>().valid(); }
+  ::protozero::ConstBytes chrome_window_handle_event_info() const { return at<41>().as_bytes(); }
+  bool has_chrome_content_settings_event_info() const { return at<43>().valid(); }
+  ::protozero::ConstBytes chrome_content_settings_event_info() const { return at<43>().as_bytes(); }
+  bool has_source_location() const { return at<33>().valid(); }
+  ::protozero::ConstBytes source_location() const { return at<33>().as_bytes(); }
+  bool has_source_location_iid() const { return at<34>().valid(); }
+  uint64_t source_location_iid() const { return at<34>().as_uint64(); }
+  bool has_chrome_message_pump() const { return at<35>().valid(); }
+  ::protozero::ConstBytes chrome_message_pump() const { return at<35>().as_bytes(); }
+  bool has_chrome_mojo_event_info() const { return at<38>().valid(); }
+  ::protozero::ConstBytes chrome_mojo_event_info() const { return at<38>().as_bytes(); }
+  bool has_timestamp_delta_us() const { return at<1>().valid(); }
+  int64_t timestamp_delta_us() const { return at<1>().as_int64(); }
+  bool has_timestamp_absolute_us() const { return at<16>().valid(); }
+  int64_t timestamp_absolute_us() const { return at<16>().as_int64(); }
+  bool has_thread_time_delta_us() const { return at<2>().valid(); }
+  int64_t thread_time_delta_us() const { return at<2>().as_int64(); }
+  bool has_thread_time_absolute_us() const { return at<17>().valid(); }
+  int64_t thread_time_absolute_us() const { return at<17>().as_int64(); }
+  bool has_thread_instruction_count_delta() const { return at<8>().valid(); }
+  int64_t thread_instruction_count_delta() const { return at<8>().as_int64(); }
+  bool has_thread_instruction_count_absolute() const { return at<20>().valid(); }
+  int64_t thread_instruction_count_absolute() const { return at<20>().as_int64(); }
+  bool has_legacy_event() const { return at<6>().valid(); }
+  ::protozero::ConstBytes legacy_event() const { return at<6>().as_bytes(); }
+};
+
+class TrackEvent : public ::protozero::Message {
+ public:
+  using Decoder = TrackEvent_Decoder;
+  enum : int32_t {
+    kCategoryIidsFieldNumber = 3,
+    kCategoriesFieldNumber = 22,
+    kNameIidFieldNumber = 10,
+    kNameFieldNumber = 23,
+    kTypeFieldNumber = 9,
+    kTrackUuidFieldNumber = 11,
+    kCounterValueFieldNumber = 30,
+    kDoubleCounterValueFieldNumber = 44,
+    kExtraCounterTrackUuidsFieldNumber = 31,
+    kExtraCounterValuesFieldNumber = 12,
+    kExtraDoubleCounterTrackUuidsFieldNumber = 45,
+    kExtraDoubleCounterValuesFieldNumber = 46,
+    kFlowIdsFieldNumber = 36,
+    kTerminatingFlowIdsFieldNumber = 42,
+    kDebugAnnotationsFieldNumber = 4,
+    kTaskExecutionFieldNumber = 5,
+    kLogMessageFieldNumber = 21,
+    kCcSchedulerStateFieldNumber = 24,
+    kChromeUserEventFieldNumber = 25,
+    kChromeKeyedServiceFieldNumber = 26,
+    kChromeLegacyIpcFieldNumber = 27,
+    kChromeHistogramSampleFieldNumber = 28,
+    kChromeLatencyInfoFieldNumber = 29,
+    kChromeFrameReporterFieldNumber = 32,
+    kChromeApplicationStateInfoFieldNumber = 39,
+    kChromeRendererSchedulerStateFieldNumber = 40,
+    kChromeWindowHandleEventInfoFieldNumber = 41,
+    kChromeContentSettingsEventInfoFieldNumber = 43,
+    kSourceLocationFieldNumber = 33,
+    kSourceLocationIidFieldNumber = 34,
+    kChromeMessagePumpFieldNumber = 35,
+    kChromeMojoEventInfoFieldNumber = 38,
+    kTimestampDeltaUsFieldNumber = 1,
+    kTimestampAbsoluteUsFieldNumber = 16,
+    kThreadTimeDeltaUsFieldNumber = 2,
+    kThreadTimeAbsoluteUsFieldNumber = 17,
+    kThreadInstructionCountDeltaFieldNumber = 8,
+    kThreadInstructionCountAbsoluteFieldNumber = 20,
+    kLegacyEventFieldNumber = 6,
+  };
+  using LegacyEvent = ::perfetto::protos::pbzero::TrackEvent_LegacyEvent;
+  using Type = ::perfetto::protos::pbzero::TrackEvent_Type;
+  static const Type TYPE_UNSPECIFIED = TrackEvent_Type_TYPE_UNSPECIFIED;
+  static const Type TYPE_SLICE_BEGIN = TrackEvent_Type_TYPE_SLICE_BEGIN;
+  static const Type TYPE_SLICE_END = TrackEvent_Type_TYPE_SLICE_END;
+  static const Type TYPE_INSTANT = TrackEvent_Type_TYPE_INSTANT;
+  static const Type TYPE_COUNTER = TrackEvent_Type_TYPE_COUNTER;
+
+  using FieldMetadata_CategoryIids =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CategoryIids kCategoryIids() { return {}; }
+  void add_category_iids(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CategoryIids::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Categories =
+    ::protozero::proto_utils::FieldMetadata<
+      22,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Categories kCategories() { return {}; }
+  void add_categories(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Categories::kFieldId, data, size);
+  }
+  void add_categories(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Categories::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NameIid =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NameIid kNameIid() { return {}; }
+  void set_name_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NameIid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      23,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Type =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::TrackEvent_Type,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Type kType() { return {}; }
+  void set_type(::perfetto::protos::pbzero::TrackEvent_Type value) {
+    static constexpr uint32_t field_id = FieldMetadata_Type::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TrackUuid =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TrackUuid kTrackUuid() { return {}; }
+  void set_track_uuid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TrackUuid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CounterValue =
+    ::protozero::proto_utils::FieldMetadata<
+      30,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CounterValue kCounterValue() { return {}; }
+  void set_counter_value(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CounterValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DoubleCounterValue =
+    ::protozero::proto_utils::FieldMetadata<
+      44,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kDouble,
+      double,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DoubleCounterValue kDoubleCounterValue() { return {}; }
+  void set_double_counter_value(double value) {
+    static constexpr uint32_t field_id = FieldMetadata_DoubleCounterValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kDouble>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ExtraCounterTrackUuids =
+    ::protozero::proto_utils::FieldMetadata<
+      31,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ExtraCounterTrackUuids kExtraCounterTrackUuids() { return {}; }
+  void add_extra_counter_track_uuids(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ExtraCounterTrackUuids::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ExtraCounterValues =
+    ::protozero::proto_utils::FieldMetadata<
+      12,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ExtraCounterValues kExtraCounterValues() { return {}; }
+  void add_extra_counter_values(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ExtraCounterValues::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ExtraDoubleCounterTrackUuids =
+    ::protozero::proto_utils::FieldMetadata<
+      45,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ExtraDoubleCounterTrackUuids kExtraDoubleCounterTrackUuids() { return {}; }
+  void add_extra_double_counter_track_uuids(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ExtraDoubleCounterTrackUuids::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ExtraDoubleCounterValues =
+    ::protozero::proto_utils::FieldMetadata<
+      46,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kDouble,
+      double,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ExtraDoubleCounterValues kExtraDoubleCounterValues() { return {}; }
+  void add_extra_double_counter_values(double value) {
+    static constexpr uint32_t field_id = FieldMetadata_ExtraDoubleCounterValues::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kDouble>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FlowIds =
+    ::protozero::proto_utils::FieldMetadata<
+      36,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FlowIds kFlowIds() { return {}; }
+  void add_flow_ids(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_FlowIds::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TerminatingFlowIds =
+    ::protozero::proto_utils::FieldMetadata<
+      42,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TerminatingFlowIds kTerminatingFlowIds() { return {}; }
+  void add_terminating_flow_ids(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TerminatingFlowIds::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DebugAnnotations =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      DebugAnnotation,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DebugAnnotations kDebugAnnotations() { return {}; }
+  template <typename T = DebugAnnotation> T* add_debug_annotations() {
+    return BeginNestedMessage<T>(4);
+  }
+
+
+  using FieldMetadata_TaskExecution =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TaskExecution,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TaskExecution kTaskExecution() { return {}; }
+  template <typename T = TaskExecution> T* set_task_execution() {
+    return BeginNestedMessage<T>(5);
+  }
+
+
+  using FieldMetadata_LogMessage =
+    ::protozero::proto_utils::FieldMetadata<
+      21,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      LogMessage,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LogMessage kLogMessage() { return {}; }
+  template <typename T = LogMessage> T* set_log_message() {
+    return BeginNestedMessage<T>(21);
+  }
+
+
+  using FieldMetadata_CcSchedulerState =
+    ::protozero::proto_utils::FieldMetadata<
+      24,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeCompositorSchedulerState,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CcSchedulerState kCcSchedulerState() { return {}; }
+  template <typename T = ChromeCompositorSchedulerState> T* set_cc_scheduler_state() {
+    return BeginNestedMessage<T>(24);
+  }
+
+
+  using FieldMetadata_ChromeUserEvent =
+    ::protozero::proto_utils::FieldMetadata<
+      25,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeUserEvent,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeUserEvent kChromeUserEvent() { return {}; }
+  template <typename T = ChromeUserEvent> T* set_chrome_user_event() {
+    return BeginNestedMessage<T>(25);
+  }
+
+
+  using FieldMetadata_ChromeKeyedService =
+    ::protozero::proto_utils::FieldMetadata<
+      26,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeKeyedService,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeKeyedService kChromeKeyedService() { return {}; }
+  template <typename T = ChromeKeyedService> T* set_chrome_keyed_service() {
+    return BeginNestedMessage<T>(26);
+  }
+
+
+  using FieldMetadata_ChromeLegacyIpc =
+    ::protozero::proto_utils::FieldMetadata<
+      27,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeLegacyIpc,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeLegacyIpc kChromeLegacyIpc() { return {}; }
+  template <typename T = ChromeLegacyIpc> T* set_chrome_legacy_ipc() {
+    return BeginNestedMessage<T>(27);
+  }
+
+
+  using FieldMetadata_ChromeHistogramSample =
+    ::protozero::proto_utils::FieldMetadata<
+      28,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeHistogramSample,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeHistogramSample kChromeHistogramSample() { return {}; }
+  template <typename T = ChromeHistogramSample> T* set_chrome_histogram_sample() {
+    return BeginNestedMessage<T>(28);
+  }
+
+
+  using FieldMetadata_ChromeLatencyInfo =
+    ::protozero::proto_utils::FieldMetadata<
+      29,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeLatencyInfo,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeLatencyInfo kChromeLatencyInfo() { return {}; }
+  template <typename T = ChromeLatencyInfo> T* set_chrome_latency_info() {
+    return BeginNestedMessage<T>(29);
+  }
+
+
+  using FieldMetadata_ChromeFrameReporter =
+    ::protozero::proto_utils::FieldMetadata<
+      32,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeFrameReporter,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeFrameReporter kChromeFrameReporter() { return {}; }
+  template <typename T = ChromeFrameReporter> T* set_chrome_frame_reporter() {
+    return BeginNestedMessage<T>(32);
+  }
+
+
+  using FieldMetadata_ChromeApplicationStateInfo =
+    ::protozero::proto_utils::FieldMetadata<
+      39,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeApplicationStateInfo,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeApplicationStateInfo kChromeApplicationStateInfo() { return {}; }
+  template <typename T = ChromeApplicationStateInfo> T* set_chrome_application_state_info() {
+    return BeginNestedMessage<T>(39);
+  }
+
+
+  using FieldMetadata_ChromeRendererSchedulerState =
+    ::protozero::proto_utils::FieldMetadata<
+      40,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeRendererSchedulerState,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeRendererSchedulerState kChromeRendererSchedulerState() { return {}; }
+  template <typename T = ChromeRendererSchedulerState> T* set_chrome_renderer_scheduler_state() {
+    return BeginNestedMessage<T>(40);
+  }
+
+
+  using FieldMetadata_ChromeWindowHandleEventInfo =
+    ::protozero::proto_utils::FieldMetadata<
+      41,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeWindowHandleEventInfo,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeWindowHandleEventInfo kChromeWindowHandleEventInfo() { return {}; }
+  template <typename T = ChromeWindowHandleEventInfo> T* set_chrome_window_handle_event_info() {
+    return BeginNestedMessage<T>(41);
+  }
+
+
+  using FieldMetadata_ChromeContentSettingsEventInfo =
+    ::protozero::proto_utils::FieldMetadata<
+      43,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeContentSettingsEventInfo,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeContentSettingsEventInfo kChromeContentSettingsEventInfo() { return {}; }
+  template <typename T = ChromeContentSettingsEventInfo> T* set_chrome_content_settings_event_info() {
+    return BeginNestedMessage<T>(43);
+  }
+
+
+  using FieldMetadata_SourceLocation =
+    ::protozero::proto_utils::FieldMetadata<
+      33,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SourceLocation,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SourceLocation kSourceLocation() { return {}; }
+  template <typename T = SourceLocation> T* set_source_location() {
+    return BeginNestedMessage<T>(33);
+  }
+
+
+  using FieldMetadata_SourceLocationIid =
+    ::protozero::proto_utils::FieldMetadata<
+      34,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SourceLocationIid kSourceLocationIid() { return {}; }
+  void set_source_location_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SourceLocationIid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ChromeMessagePump =
+    ::protozero::proto_utils::FieldMetadata<
+      35,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeMessagePump,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeMessagePump kChromeMessagePump() { return {}; }
+  template <typename T = ChromeMessagePump> T* set_chrome_message_pump() {
+    return BeginNestedMessage<T>(35);
+  }
+
+
+  using FieldMetadata_ChromeMojoEventInfo =
+    ::protozero::proto_utils::FieldMetadata<
+      38,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeMojoEventInfo,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeMojoEventInfo kChromeMojoEventInfo() { return {}; }
+  template <typename T = ChromeMojoEventInfo> T* set_chrome_mojo_event_info() {
+    return BeginNestedMessage<T>(38);
+  }
+
+
+  using FieldMetadata_TimestampDeltaUs =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TimestampDeltaUs kTimestampDeltaUs() { return {}; }
+  void set_timestamp_delta_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TimestampDeltaUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TimestampAbsoluteUs =
+    ::protozero::proto_utils::FieldMetadata<
+      16,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TimestampAbsoluteUs kTimestampAbsoluteUs() { return {}; }
+  void set_timestamp_absolute_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TimestampAbsoluteUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ThreadTimeDeltaUs =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ThreadTimeDeltaUs kThreadTimeDeltaUs() { return {}; }
+  void set_thread_time_delta_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ThreadTimeDeltaUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ThreadTimeAbsoluteUs =
+    ::protozero::proto_utils::FieldMetadata<
+      17,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ThreadTimeAbsoluteUs kThreadTimeAbsoluteUs() { return {}; }
+  void set_thread_time_absolute_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ThreadTimeAbsoluteUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ThreadInstructionCountDelta =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ThreadInstructionCountDelta kThreadInstructionCountDelta() { return {}; }
+  void set_thread_instruction_count_delta(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ThreadInstructionCountDelta::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ThreadInstructionCountAbsolute =
+    ::protozero::proto_utils::FieldMetadata<
+      20,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ThreadInstructionCountAbsolute kThreadInstructionCountAbsolute() { return {}; }
+  void set_thread_instruction_count_absolute(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ThreadInstructionCountAbsolute::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LegacyEvent =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TrackEvent_LegacyEvent,
+      TrackEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LegacyEvent kLegacyEvent() { return {}; }
+  template <typename T = TrackEvent_LegacyEvent> T* set_legacy_event() {
+    return BeginNestedMessage<T>(6);
+  }
+
+};
+
+class TrackEvent_LegacyEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/19, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TrackEvent_LegacyEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TrackEvent_LegacyEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TrackEvent_LegacyEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name_iid() const { return at<1>().valid(); }
+  uint64_t name_iid() const { return at<1>().as_uint64(); }
+  bool has_phase() const { return at<2>().valid(); }
+  int32_t phase() const { return at<2>().as_int32(); }
+  bool has_duration_us() const { return at<3>().valid(); }
+  int64_t duration_us() const { return at<3>().as_int64(); }
+  bool has_thread_duration_us() const { return at<4>().valid(); }
+  int64_t thread_duration_us() const { return at<4>().as_int64(); }
+  bool has_thread_instruction_delta() const { return at<15>().valid(); }
+  int64_t thread_instruction_delta() const { return at<15>().as_int64(); }
+  bool has_unscoped_id() const { return at<6>().valid(); }
+  uint64_t unscoped_id() const { return at<6>().as_uint64(); }
+  bool has_local_id() const { return at<10>().valid(); }
+  uint64_t local_id() const { return at<10>().as_uint64(); }
+  bool has_global_id() const { return at<11>().valid(); }
+  uint64_t global_id() const { return at<11>().as_uint64(); }
+  bool has_id_scope() const { return at<7>().valid(); }
+  ::protozero::ConstChars id_scope() const { return at<7>().as_string(); }
+  bool has_use_async_tts() const { return at<9>().valid(); }
+  bool use_async_tts() const { return at<9>().as_bool(); }
+  bool has_bind_id() const { return at<8>().valid(); }
+  uint64_t bind_id() const { return at<8>().as_uint64(); }
+  bool has_bind_to_enclosing() const { return at<12>().valid(); }
+  bool bind_to_enclosing() const { return at<12>().as_bool(); }
+  bool has_flow_direction() const { return at<13>().valid(); }
+  int32_t flow_direction() const { return at<13>().as_int32(); }
+  bool has_instant_event_scope() const { return at<14>().valid(); }
+  int32_t instant_event_scope() const { return at<14>().as_int32(); }
+  bool has_pid_override() const { return at<18>().valid(); }
+  int32_t pid_override() const { return at<18>().as_int32(); }
+  bool has_tid_override() const { return at<19>().valid(); }
+  int32_t tid_override() const { return at<19>().as_int32(); }
+};
+
+class TrackEvent_LegacyEvent : public ::protozero::Message {
+ public:
+  using Decoder = TrackEvent_LegacyEvent_Decoder;
+  enum : int32_t {
+    kNameIidFieldNumber = 1,
+    kPhaseFieldNumber = 2,
+    kDurationUsFieldNumber = 3,
+    kThreadDurationUsFieldNumber = 4,
+    kThreadInstructionDeltaFieldNumber = 15,
+    kUnscopedIdFieldNumber = 6,
+    kLocalIdFieldNumber = 10,
+    kGlobalIdFieldNumber = 11,
+    kIdScopeFieldNumber = 7,
+    kUseAsyncTtsFieldNumber = 9,
+    kBindIdFieldNumber = 8,
+    kBindToEnclosingFieldNumber = 12,
+    kFlowDirectionFieldNumber = 13,
+    kInstantEventScopeFieldNumber = 14,
+    kPidOverrideFieldNumber = 18,
+    kTidOverrideFieldNumber = 19,
+  };
+  using FlowDirection = ::perfetto::protos::pbzero::TrackEvent_LegacyEvent_FlowDirection;
+  using InstantEventScope = ::perfetto::protos::pbzero::TrackEvent_LegacyEvent_InstantEventScope;
+  static const FlowDirection FLOW_UNSPECIFIED = TrackEvent_LegacyEvent_FlowDirection_FLOW_UNSPECIFIED;
+  static const FlowDirection FLOW_IN = TrackEvent_LegacyEvent_FlowDirection_FLOW_IN;
+  static const FlowDirection FLOW_OUT = TrackEvent_LegacyEvent_FlowDirection_FLOW_OUT;
+  static const FlowDirection FLOW_INOUT = TrackEvent_LegacyEvent_FlowDirection_FLOW_INOUT;
+  static const InstantEventScope SCOPE_UNSPECIFIED = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_UNSPECIFIED;
+  static const InstantEventScope SCOPE_GLOBAL = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_GLOBAL;
+  static const InstantEventScope SCOPE_PROCESS = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_PROCESS;
+  static const InstantEventScope SCOPE_THREAD = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_THREAD;
+
+  using FieldMetadata_NameIid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NameIid kNameIid() { return {}; }
+  void set_name_iid(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NameIid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Phase =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Phase kPhase() { return {}; }
+  void set_phase(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Phase::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_DurationUs =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DurationUs kDurationUs() { return {}; }
+  void set_duration_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_DurationUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ThreadDurationUs =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ThreadDurationUs kThreadDurationUs() { return {}; }
+  void set_thread_duration_us(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ThreadDurationUs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ThreadInstructionDelta =
+    ::protozero::proto_utils::FieldMetadata<
+      15,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ThreadInstructionDelta kThreadInstructionDelta() { return {}; }
+  void set_thread_instruction_delta(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ThreadInstructionDelta::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_UnscopedId =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UnscopedId kUnscopedId() { return {}; }
+  void set_unscoped_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_UnscopedId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LocalId =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LocalId kLocalId() { return {}; }
+  void set_local_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_LocalId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_GlobalId =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GlobalId kGlobalId() { return {}; }
+  void set_global_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_GlobalId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IdScope =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IdScope kIdScope() { return {}; }
+  void set_id_scope(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_IdScope::kFieldId, data, size);
+  }
+  void set_id_scope(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_IdScope::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_UseAsyncTts =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UseAsyncTts kUseAsyncTts() { return {}; }
+  void set_use_async_tts(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_UseAsyncTts::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BindId =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BindId kBindId() { return {}; }
+  void set_bind_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_BindId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_BindToEnclosing =
+    ::protozero::proto_utils::FieldMetadata<
+      12,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BindToEnclosing kBindToEnclosing() { return {}; }
+  void set_bind_to_enclosing(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_BindToEnclosing::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_FlowDirection =
+    ::protozero::proto_utils::FieldMetadata<
+      13,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::TrackEvent_LegacyEvent_FlowDirection,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FlowDirection kFlowDirection() { return {}; }
+  void set_flow_direction(::perfetto::protos::pbzero::TrackEvent_LegacyEvent_FlowDirection value) {
+    static constexpr uint32_t field_id = FieldMetadata_FlowDirection::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_InstantEventScope =
+    ::protozero::proto_utils::FieldMetadata<
+      14,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::TrackEvent_LegacyEvent_InstantEventScope,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_InstantEventScope kInstantEventScope() { return {}; }
+  void set_instant_event_scope(::perfetto::protos::pbzero::TrackEvent_LegacyEvent_InstantEventScope value) {
+    static constexpr uint32_t field_id = FieldMetadata_InstantEventScope::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PidOverride =
+    ::protozero::proto_utils::FieldMetadata<
+      18,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PidOverride kPidOverride() { return {}; }
+  void set_pid_override(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_PidOverride::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TidOverride =
+    ::protozero::proto_utils::FieldMetadata<
+      19,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      TrackEvent_LegacyEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TidOverride kTidOverride() { return {}; }
+  void set_tid_override(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TidOverride::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/interned_data/interned_data.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_INTERNED_DATA_INTERNED_DATA_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_INTERNED_DATA_INTERNED_DATA_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class Callstack;
+class DebugAnnotationName;
+class EventCategory;
+class EventName;
+class Frame;
+class HistogramName;
+class InternedGpuRenderStageSpecification;
+class InternedGraphicsContext;
+class InternedString;
+class LogMessageBody;
+class Mapping;
+class ProfiledFrameSymbols;
+class SourceLocation;
+
+class InternedData_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/26, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  InternedData_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit InternedData_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit InternedData_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_event_categories() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> event_categories() const { return GetRepeated<::protozero::ConstBytes>(1); }
+  bool has_event_names() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> event_names() const { return GetRepeated<::protozero::ConstBytes>(2); }
+  bool has_debug_annotation_names() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> debug_annotation_names() const { return GetRepeated<::protozero::ConstBytes>(3); }
+  bool has_source_locations() const { return at<4>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> source_locations() const { return GetRepeated<::protozero::ConstBytes>(4); }
+  bool has_log_message_body() const { return at<20>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> log_message_body() const { return GetRepeated<::protozero::ConstBytes>(20); }
+  bool has_histogram_names() const { return at<25>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> histogram_names() const { return GetRepeated<::protozero::ConstBytes>(25); }
+  bool has_build_ids() const { return at<16>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> build_ids() const { return GetRepeated<::protozero::ConstBytes>(16); }
+  bool has_mapping_paths() const { return at<17>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> mapping_paths() const { return GetRepeated<::protozero::ConstBytes>(17); }
+  bool has_source_paths() const { return at<18>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> source_paths() const { return GetRepeated<::protozero::ConstBytes>(18); }
+  bool has_function_names() const { return at<5>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> function_names() const { return GetRepeated<::protozero::ConstBytes>(5); }
+  bool has_profiled_frame_symbols() const { return at<21>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> profiled_frame_symbols() const { return GetRepeated<::protozero::ConstBytes>(21); }
+  bool has_mappings() const { return at<19>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> mappings() const { return GetRepeated<::protozero::ConstBytes>(19); }
+  bool has_frames() const { return at<6>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> frames() const { return GetRepeated<::protozero::ConstBytes>(6); }
+  bool has_callstacks() const { return at<7>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> callstacks() const { return GetRepeated<::protozero::ConstBytes>(7); }
+  bool has_vulkan_memory_keys() const { return at<22>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> vulkan_memory_keys() const { return GetRepeated<::protozero::ConstBytes>(22); }
+  bool has_graphics_contexts() const { return at<23>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> graphics_contexts() const { return GetRepeated<::protozero::ConstBytes>(23); }
+  bool has_gpu_specifications() const { return at<24>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> gpu_specifications() const { return GetRepeated<::protozero::ConstBytes>(24); }
+  bool has_kernel_symbols() const { return at<26>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> kernel_symbols() const { return GetRepeated<::protozero::ConstBytes>(26); }
+};
+
+class InternedData : public ::protozero::Message {
+ public:
+  using Decoder = InternedData_Decoder;
+  enum : int32_t {
+    kEventCategoriesFieldNumber = 1,
+    kEventNamesFieldNumber = 2,
+    kDebugAnnotationNamesFieldNumber = 3,
+    kSourceLocationsFieldNumber = 4,
+    kLogMessageBodyFieldNumber = 20,
+    kHistogramNamesFieldNumber = 25,
+    kBuildIdsFieldNumber = 16,
+    kMappingPathsFieldNumber = 17,
+    kSourcePathsFieldNumber = 18,
+    kFunctionNamesFieldNumber = 5,
+    kProfiledFrameSymbolsFieldNumber = 21,
+    kMappingsFieldNumber = 19,
+    kFramesFieldNumber = 6,
+    kCallstacksFieldNumber = 7,
+    kVulkanMemoryKeysFieldNumber = 22,
+    kGraphicsContextsFieldNumber = 23,
+    kGpuSpecificationsFieldNumber = 24,
+    kKernelSymbolsFieldNumber = 26,
+  };
+
+  using FieldMetadata_EventCategories =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      EventCategory,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EventCategories kEventCategories() { return {}; }
+  template <typename T = EventCategory> T* add_event_categories() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_EventNames =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      EventName,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EventNames kEventNames() { return {}; }
+  template <typename T = EventName> T* add_event_names() {
+    return BeginNestedMessage<T>(2);
+  }
+
+
+  using FieldMetadata_DebugAnnotationNames =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      DebugAnnotationName,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DebugAnnotationNames kDebugAnnotationNames() { return {}; }
+  template <typename T = DebugAnnotationName> T* add_debug_annotation_names() {
+    return BeginNestedMessage<T>(3);
+  }
+
+
+  using FieldMetadata_SourceLocations =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SourceLocation,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SourceLocations kSourceLocations() { return {}; }
+  template <typename T = SourceLocation> T* add_source_locations() {
+    return BeginNestedMessage<T>(4);
+  }
+
+
+  using FieldMetadata_LogMessageBody =
+    ::protozero::proto_utils::FieldMetadata<
+      20,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      LogMessageBody,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LogMessageBody kLogMessageBody() { return {}; }
+  template <typename T = LogMessageBody> T* add_log_message_body() {
+    return BeginNestedMessage<T>(20);
+  }
+
+
+  using FieldMetadata_HistogramNames =
+    ::protozero::proto_utils::FieldMetadata<
+      25,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      HistogramName,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HistogramNames kHistogramNames() { return {}; }
+  template <typename T = HistogramName> T* add_histogram_names() {
+    return BeginNestedMessage<T>(25);
+  }
+
+
+  using FieldMetadata_BuildIds =
+    ::protozero::proto_utils::FieldMetadata<
+      16,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      InternedString,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_BuildIds kBuildIds() { return {}; }
+  template <typename T = InternedString> T* add_build_ids() {
+    return BeginNestedMessage<T>(16);
+  }
+
+
+  using FieldMetadata_MappingPaths =
+    ::protozero::proto_utils::FieldMetadata<
+      17,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      InternedString,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MappingPaths kMappingPaths() { return {}; }
+  template <typename T = InternedString> T* add_mapping_paths() {
+    return BeginNestedMessage<T>(17);
+  }
+
+
+  using FieldMetadata_SourcePaths =
+    ::protozero::proto_utils::FieldMetadata<
+      18,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      InternedString,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SourcePaths kSourcePaths() { return {}; }
+  template <typename T = InternedString> T* add_source_paths() {
+    return BeginNestedMessage<T>(18);
+  }
+
+
+  using FieldMetadata_FunctionNames =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      InternedString,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FunctionNames kFunctionNames() { return {}; }
+  template <typename T = InternedString> T* add_function_names() {
+    return BeginNestedMessage<T>(5);
+  }
+
+
+  using FieldMetadata_ProfiledFrameSymbols =
+    ::protozero::proto_utils::FieldMetadata<
+      21,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ProfiledFrameSymbols,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProfiledFrameSymbols kProfiledFrameSymbols() { return {}; }
+  template <typename T = ProfiledFrameSymbols> T* add_profiled_frame_symbols() {
+    return BeginNestedMessage<T>(21);
+  }
+
+
+  using FieldMetadata_Mappings =
+    ::protozero::proto_utils::FieldMetadata<
+      19,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Mapping,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Mappings kMappings() { return {}; }
+  template <typename T = Mapping> T* add_mappings() {
+    return BeginNestedMessage<T>(19);
+  }
+
+
+  using FieldMetadata_Frames =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Frame,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Frames kFrames() { return {}; }
+  template <typename T = Frame> T* add_frames() {
+    return BeginNestedMessage<T>(6);
+  }
+
+
+  using FieldMetadata_Callstacks =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Callstack,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Callstacks kCallstacks() { return {}; }
+  template <typename T = Callstack> T* add_callstacks() {
+    return BeginNestedMessage<T>(7);
+  }
+
+
+  using FieldMetadata_VulkanMemoryKeys =
+    ::protozero::proto_utils::FieldMetadata<
+      22,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      InternedString,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_VulkanMemoryKeys kVulkanMemoryKeys() { return {}; }
+  template <typename T = InternedString> T* add_vulkan_memory_keys() {
+    return BeginNestedMessage<T>(22);
+  }
+
+
+  using FieldMetadata_GraphicsContexts =
+    ::protozero::proto_utils::FieldMetadata<
+      23,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      InternedGraphicsContext,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GraphicsContexts kGraphicsContexts() { return {}; }
+  template <typename T = InternedGraphicsContext> T* add_graphics_contexts() {
+    return BeginNestedMessage<T>(23);
+  }
+
+
+  using FieldMetadata_GpuSpecifications =
+    ::protozero::proto_utils::FieldMetadata<
+      24,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      InternedGpuRenderStageSpecification,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GpuSpecifications kGpuSpecifications() { return {}; }
+  template <typename T = InternedGpuRenderStageSpecification> T* add_gpu_specifications() {
+    return BeginNestedMessage<T>(24);
+  }
+
+
+  using FieldMetadata_KernelSymbols =
+    ::protozero::proto_utils::FieldMetadata<
+      26,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      InternedString,
+      InternedData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_KernelSymbols kKernelSymbols() { return {}; }
+  template <typename T = InternedString> T* add_kernel_symbols() {
+    return BeginNestedMessage<T>(26);
+  }
+
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/perfetto/perfetto_metatrace.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PERFETTO_PERFETTO_METATRACE_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PERFETTO_PERFETTO_METATRACE_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class PerfettoMetatrace_Arg;
+
+class PerfettoMetatrace_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/9, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  PerfettoMetatrace_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit PerfettoMetatrace_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit PerfettoMetatrace_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_event_id() const { return at<1>().valid(); }
+  uint32_t event_id() const { return at<1>().as_uint32(); }
+  bool has_counter_id() const { return at<2>().valid(); }
+  uint32_t counter_id() const { return at<2>().as_uint32(); }
+  bool has_event_name() const { return at<8>().valid(); }
+  ::protozero::ConstChars event_name() const { return at<8>().as_string(); }
+  bool has_counter_name() const { return at<9>().valid(); }
+  ::protozero::ConstChars counter_name() const { return at<9>().as_string(); }
+  bool has_event_duration_ns() const { return at<3>().valid(); }
+  uint32_t event_duration_ns() const { return at<3>().as_uint32(); }
+  bool has_counter_value() const { return at<4>().valid(); }
+  int32_t counter_value() const { return at<4>().as_int32(); }
+  bool has_thread_id() const { return at<5>().valid(); }
+  uint32_t thread_id() const { return at<5>().as_uint32(); }
+  bool has_has_overruns() const { return at<6>().valid(); }
+  bool has_overruns() const { return at<6>().as_bool(); }
+  bool has_args() const { return at<7>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> args() const { return GetRepeated<::protozero::ConstBytes>(7); }
+};
+
+class PerfettoMetatrace : public ::protozero::Message {
+ public:
+  using Decoder = PerfettoMetatrace_Decoder;
+  enum : int32_t {
+    kEventIdFieldNumber = 1,
+    kCounterIdFieldNumber = 2,
+    kEventNameFieldNumber = 8,
+    kCounterNameFieldNumber = 9,
+    kEventDurationNsFieldNumber = 3,
+    kCounterValueFieldNumber = 4,
+    kThreadIdFieldNumber = 5,
+    kHasOverrunsFieldNumber = 6,
+    kArgsFieldNumber = 7,
+  };
+  using Arg = ::perfetto::protos::pbzero::PerfettoMetatrace_Arg;
+
+  using FieldMetadata_EventId =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      PerfettoMetatrace>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EventId kEventId() { return {}; }
+  void set_event_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_EventId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CounterId =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      PerfettoMetatrace>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CounterId kCounterId() { return {}; }
+  void set_counter_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CounterId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_EventName =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      PerfettoMetatrace>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EventName kEventName() { return {}; }
+  void set_event_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_EventName::kFieldId, data, size);
+  }
+  void set_event_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_EventName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CounterName =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      PerfettoMetatrace>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CounterName kCounterName() { return {}; }
+  void set_counter_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_CounterName::kFieldId, data, size);
+  }
+  void set_counter_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_CounterName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_EventDurationNs =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      PerfettoMetatrace>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EventDurationNs kEventDurationNs() { return {}; }
+  void set_event_duration_ns(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_EventDurationNs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CounterValue =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      PerfettoMetatrace>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CounterValue kCounterValue() { return {}; }
+  void set_counter_value(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CounterValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ThreadId =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      PerfettoMetatrace>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ThreadId kThreadId() { return {}; }
+  void set_thread_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ThreadId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HasOverruns =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      PerfettoMetatrace>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HasOverruns kHasOverruns() { return {}; }
+  void set_has_overruns(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_HasOverruns::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Args =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      PerfettoMetatrace_Arg,
+      PerfettoMetatrace>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Args kArgs() { return {}; }
+  template <typename T = PerfettoMetatrace_Arg> T* add_args() {
+    return BeginNestedMessage<T>(7);
+  }
+
+};
+
+class PerfettoMetatrace_Arg_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  PerfettoMetatrace_Arg_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit PerfettoMetatrace_Arg_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit PerfettoMetatrace_Arg_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_key() const { return at<1>().valid(); }
+  ::protozero::ConstChars key() const { return at<1>().as_string(); }
+  bool has_value() const { return at<2>().valid(); }
+  ::protozero::ConstChars value() const { return at<2>().as_string(); }
+};
+
+class PerfettoMetatrace_Arg : public ::protozero::Message {
+ public:
+  using Decoder = PerfettoMetatrace_Arg_Decoder;
+  enum : int32_t {
+    kKeyFieldNumber = 1,
+    kValueFieldNumber = 2,
+  };
+
+  using FieldMetadata_Key =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      PerfettoMetatrace_Arg>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Key kKey() { return {}; }
+  void set_key(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Key::kFieldId, data, size);
+  }
+  void set_key(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Key::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Value =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      PerfettoMetatrace_Arg>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Value kValue() { return {}; }
+  void set_value(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Value::kFieldId, data, size);
+  }
+  void set_value(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Value::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/perfetto/tracing_service_event.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PERFETTO_TRACING_SERVICE_EVENT_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PERFETTO_TRACING_SERVICE_EVENT_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class TracingServiceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TracingServiceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TracingServiceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TracingServiceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_tracing_started() const { return at<2>().valid(); }
+  bool tracing_started() const { return at<2>().as_bool(); }
+  bool has_all_data_sources_started() const { return at<1>().valid(); }
+  bool all_data_sources_started() const { return at<1>().as_bool(); }
+  bool has_all_data_sources_flushed() const { return at<3>().valid(); }
+  bool all_data_sources_flushed() const { return at<3>().as_bool(); }
+  bool has_read_tracing_buffers_completed() const { return at<4>().valid(); }
+  bool read_tracing_buffers_completed() const { return at<4>().as_bool(); }
+  bool has_tracing_disabled() const { return at<5>().valid(); }
+  bool tracing_disabled() const { return at<5>().as_bool(); }
+  bool has_seized_for_bugreport() const { return at<6>().valid(); }
+  bool seized_for_bugreport() const { return at<6>().as_bool(); }
+};
+
+class TracingServiceEvent : public ::protozero::Message {
+ public:
+  using Decoder = TracingServiceEvent_Decoder;
+  enum : int32_t {
+    kTracingStartedFieldNumber = 2,
+    kAllDataSourcesStartedFieldNumber = 1,
+    kAllDataSourcesFlushedFieldNumber = 3,
+    kReadTracingBuffersCompletedFieldNumber = 4,
+    kTracingDisabledFieldNumber = 5,
+    kSeizedForBugreportFieldNumber = 6,
+  };
+
+  using FieldMetadata_TracingStarted =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TracingServiceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TracingStarted kTracingStarted() { return {}; }
+  void set_tracing_started(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_TracingStarted::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_AllDataSourcesStarted =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TracingServiceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AllDataSourcesStarted kAllDataSourcesStarted() { return {}; }
+  void set_all_data_sources_started(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_AllDataSourcesStarted::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_AllDataSourcesFlushed =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TracingServiceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AllDataSourcesFlushed kAllDataSourcesFlushed() { return {}; }
+  void set_all_data_sources_flushed(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_AllDataSourcesFlushed::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ReadTracingBuffersCompleted =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TracingServiceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ReadTracingBuffersCompleted kReadTracingBuffersCompleted() { return {}; }
+  void set_read_tracing_buffers_completed(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_ReadTracingBuffersCompleted::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TracingDisabled =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TracingServiceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TracingDisabled kTracingDisabled() { return {}; }
+  void set_tracing_disabled(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_TracingDisabled::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SeizedForBugreport =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TracingServiceEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SeizedForBugreport kSeizedForBugreport() { return {}; }
+  void set_seized_for_bugreport(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_SeizedForBugreport::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/power/android_energy_estimation_breakdown.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_POWER_ANDROID_ENERGY_ESTIMATION_BREAKDOWN_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_POWER_ANDROID_ENERGY_ESTIMATION_BREAKDOWN_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class AndroidEnergyConsumerDescriptor;
+class AndroidEnergyEstimationBreakdown_EnergyUidBreakdown;
+
+class AndroidEnergyEstimationBreakdown_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  AndroidEnergyEstimationBreakdown_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit AndroidEnergyEstimationBreakdown_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit AndroidEnergyEstimationBreakdown_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_energy_consumer_descriptor() const { return at<1>().valid(); }
+  ::protozero::ConstBytes energy_consumer_descriptor() const { return at<1>().as_bytes(); }
+  bool has_energy_consumer_id() const { return at<2>().valid(); }
+  int32_t energy_consumer_id() const { return at<2>().as_int32(); }
+  bool has_energy_uws() const { return at<3>().valid(); }
+  int64_t energy_uws() const { return at<3>().as_int64(); }
+  bool has_per_uid_breakdown() const { return at<4>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> per_uid_breakdown() const { return GetRepeated<::protozero::ConstBytes>(4); }
+};
+
+class AndroidEnergyEstimationBreakdown : public ::protozero::Message {
+ public:
+  using Decoder = AndroidEnergyEstimationBreakdown_Decoder;
+  enum : int32_t {
+    kEnergyConsumerDescriptorFieldNumber = 1,
+    kEnergyConsumerIdFieldNumber = 2,
+    kEnergyUwsFieldNumber = 3,
+    kPerUidBreakdownFieldNumber = 4,
+  };
+  using EnergyUidBreakdown = ::perfetto::protos::pbzero::AndroidEnergyEstimationBreakdown_EnergyUidBreakdown;
+
+  using FieldMetadata_EnergyConsumerDescriptor =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      AndroidEnergyConsumerDescriptor,
+      AndroidEnergyEstimationBreakdown>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EnergyConsumerDescriptor kEnergyConsumerDescriptor() { return {}; }
+  template <typename T = AndroidEnergyConsumerDescriptor> T* set_energy_consumer_descriptor() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_EnergyConsumerId =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      AndroidEnergyEstimationBreakdown>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EnergyConsumerId kEnergyConsumerId() { return {}; }
+  void set_energy_consumer_id(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_EnergyConsumerId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_EnergyUws =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      AndroidEnergyEstimationBreakdown>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EnergyUws kEnergyUws() { return {}; }
+  void set_energy_uws(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_EnergyUws::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_PerUidBreakdown =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      AndroidEnergyEstimationBreakdown_EnergyUidBreakdown,
+      AndroidEnergyEstimationBreakdown>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PerUidBreakdown kPerUidBreakdown() { return {}; }
+  template <typename T = AndroidEnergyEstimationBreakdown_EnergyUidBreakdown> T* add_per_uid_breakdown() {
+    return BeginNestedMessage<T>(4);
+  }
+
+};
+
+class AndroidEnergyEstimationBreakdown_EnergyUidBreakdown_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  AndroidEnergyEstimationBreakdown_EnergyUidBreakdown_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit AndroidEnergyEstimationBreakdown_EnergyUidBreakdown_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit AndroidEnergyEstimationBreakdown_EnergyUidBreakdown_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_uid() const { return at<1>().valid(); }
+  int32_t uid() const { return at<1>().as_int32(); }
+  bool has_energy_uws() const { return at<2>().valid(); }
+  int64_t energy_uws() const { return at<2>().as_int64(); }
+};
+
+class AndroidEnergyEstimationBreakdown_EnergyUidBreakdown : public ::protozero::Message {
+ public:
+  using Decoder = AndroidEnergyEstimationBreakdown_EnergyUidBreakdown_Decoder;
+  enum : int32_t {
+    kUidFieldNumber = 1,
+    kEnergyUwsFieldNumber = 2,
+  };
+
+  using FieldMetadata_Uid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      AndroidEnergyEstimationBreakdown_EnergyUidBreakdown>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Uid kUid() { return {}; }
+  void set_uid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Uid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_EnergyUws =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      AndroidEnergyEstimationBreakdown_EnergyUidBreakdown>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EnergyUws kEnergyUws() { return {}; }
+  void set_energy_uws(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_EnergyUws::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/power/battery_counters.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_POWER_BATTERY_COUNTERS_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_POWER_BATTERY_COUNTERS_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class BatteryCounters_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  BatteryCounters_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit BatteryCounters_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit BatteryCounters_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_charge_counter_uah() const { return at<1>().valid(); }
+  int64_t charge_counter_uah() const { return at<1>().as_int64(); }
+  bool has_capacity_percent() const { return at<2>().valid(); }
+  float capacity_percent() const { return at<2>().as_float(); }
+  bool has_current_ua() const { return at<3>().valid(); }
+  int64_t current_ua() const { return at<3>().as_int64(); }
+  bool has_current_avg_ua() const { return at<4>().valid(); }
+  int64_t current_avg_ua() const { return at<4>().as_int64(); }
+};
+
+class BatteryCounters : public ::protozero::Message {
+ public:
+  using Decoder = BatteryCounters_Decoder;
+  enum : int32_t {
+    kChargeCounterUahFieldNumber = 1,
+    kCapacityPercentFieldNumber = 2,
+    kCurrentUaFieldNumber = 3,
+    kCurrentAvgUaFieldNumber = 4,
+  };
+
+  using FieldMetadata_ChargeCounterUah =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      BatteryCounters>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChargeCounterUah kChargeCounterUah() { return {}; }
+  void set_charge_counter_uah(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ChargeCounterUah::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CapacityPercent =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kFloat,
+      float,
+      BatteryCounters>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CapacityPercent kCapacityPercent() { return {}; }
+  void set_capacity_percent(float value) {
+    static constexpr uint32_t field_id = FieldMetadata_CapacityPercent::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kFloat>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CurrentUa =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      BatteryCounters>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CurrentUa kCurrentUa() { return {}; }
+  void set_current_ua(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CurrentUa::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CurrentAvgUa =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      BatteryCounters>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CurrentAvgUa kCurrentAvgUa() { return {}; }
+  void set_current_avg_ua(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CurrentAvgUa::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/power/power_rails.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_POWER_POWER_RAILS_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_POWER_POWER_RAILS_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class PowerRails_EnergyData;
+class PowerRails_RailDescriptor;
+
+class PowerRails_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  PowerRails_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit PowerRails_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit PowerRails_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_rail_descriptor() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> rail_descriptor() const { return GetRepeated<::protozero::ConstBytes>(1); }
+  bool has_energy_data() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> energy_data() const { return GetRepeated<::protozero::ConstBytes>(2); }
+};
+
+class PowerRails : public ::protozero::Message {
+ public:
+  using Decoder = PowerRails_Decoder;
+  enum : int32_t {
+    kRailDescriptorFieldNumber = 1,
+    kEnergyDataFieldNumber = 2,
+  };
+  using RailDescriptor = ::perfetto::protos::pbzero::PowerRails_RailDescriptor;
+  using EnergyData = ::perfetto::protos::pbzero::PowerRails_EnergyData;
+
+  using FieldMetadata_RailDescriptor =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      PowerRails_RailDescriptor,
+      PowerRails>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RailDescriptor kRailDescriptor() { return {}; }
+  template <typename T = PowerRails_RailDescriptor> T* add_rail_descriptor() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_EnergyData =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      PowerRails_EnergyData,
+      PowerRails>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_EnergyData kEnergyData() { return {}; }
+  template <typename T = PowerRails_EnergyData> T* add_energy_data() {
+    return BeginNestedMessage<T>(2);
+  }
+
+};
+
+class PowerRails_EnergyData_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  PowerRails_EnergyData_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit PowerRails_EnergyData_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit PowerRails_EnergyData_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_index() const { return at<1>().valid(); }
+  uint32_t index() const { return at<1>().as_uint32(); }
+  bool has_timestamp_ms() const { return at<2>().valid(); }
+  uint64_t timestamp_ms() const { return at<2>().as_uint64(); }
+  bool has_energy() const { return at<3>().valid(); }
+  uint64_t energy() const { return at<3>().as_uint64(); }
+};
+
+class PowerRails_EnergyData : public ::protozero::Message {
+ public:
+  using Decoder = PowerRails_EnergyData_Decoder;
+  enum : int32_t {
+    kIndexFieldNumber = 1,
+    kTimestampMsFieldNumber = 2,
+    kEnergyFieldNumber = 3,
+  };
+
+  using FieldMetadata_Index =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      PowerRails_EnergyData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Index kIndex() { return {}; }
+  void set_index(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Index::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TimestampMs =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      PowerRails_EnergyData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TimestampMs kTimestampMs() { return {}; }
+  void set_timestamp_ms(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TimestampMs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Energy =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      PowerRails_EnergyData>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Energy kEnergy() { return {}; }
+  void set_energy(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Energy::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class PowerRails_RailDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  PowerRails_RailDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit PowerRails_RailDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit PowerRails_RailDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_index() const { return at<1>().valid(); }
+  uint32_t index() const { return at<1>().as_uint32(); }
+  bool has_rail_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars rail_name() const { return at<2>().as_string(); }
+  bool has_subsys_name() const { return at<3>().valid(); }
+  ::protozero::ConstChars subsys_name() const { return at<3>().as_string(); }
+  bool has_sampling_rate() const { return at<4>().valid(); }
+  uint32_t sampling_rate() const { return at<4>().as_uint32(); }
+};
+
+class PowerRails_RailDescriptor : public ::protozero::Message {
+ public:
+  using Decoder = PowerRails_RailDescriptor_Decoder;
+  enum : int32_t {
+    kIndexFieldNumber = 1,
+    kRailNameFieldNumber = 2,
+    kSubsysNameFieldNumber = 3,
+    kSamplingRateFieldNumber = 4,
+  };
+
+  using FieldMetadata_Index =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      PowerRails_RailDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Index kIndex() { return {}; }
+  void set_index(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Index::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_RailName =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      PowerRails_RailDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RailName kRailName() { return {}; }
+  void set_rail_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_RailName::kFieldId, data, size);
+  }
+  void set_rail_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_RailName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SubsysName =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      PowerRails_RailDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SubsysName kSubsysName() { return {}; }
+  void set_subsys_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_SubsysName::kFieldId, data, size);
+  }
+  void set_subsys_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_SubsysName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SamplingRate =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      PowerRails_RailDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SamplingRate kSamplingRate() { return {}; }
+  void set_sampling_rate(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SamplingRate::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ps/process_stats.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PS_PROCESS_STATS_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PS_PROCESS_STATS_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class ProcessStats_Process;
+class ProcessStats_Thread;
+
+class ProcessStats_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  ProcessStats_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ProcessStats_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ProcessStats_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_processes() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> processes() const { return GetRepeated<::protozero::ConstBytes>(1); }
+  bool has_collection_end_timestamp() const { return at<2>().valid(); }
+  uint64_t collection_end_timestamp() const { return at<2>().as_uint64(); }
+};
+
+class ProcessStats : public ::protozero::Message {
+ public:
+  using Decoder = ProcessStats_Decoder;
+  enum : int32_t {
+    kProcessesFieldNumber = 1,
+    kCollectionEndTimestampFieldNumber = 2,
+  };
+  using Thread = ::perfetto::protos::pbzero::ProcessStats_Thread;
+  using Process = ::perfetto::protos::pbzero::ProcessStats_Process;
+
+  using FieldMetadata_Processes =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ProcessStats_Process,
+      ProcessStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Processes kProcesses() { return {}; }
+  template <typename T = ProcessStats_Process> T* add_processes() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_CollectionEndTimestamp =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProcessStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CollectionEndTimestamp kCollectionEndTimestamp() { return {}; }
+  void set_collection_end_timestamp(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CollectionEndTimestamp::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class ProcessStats_Process_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/14, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  ProcessStats_Process_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ProcessStats_Process_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ProcessStats_Process_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_pid() const { return at<1>().valid(); }
+  int32_t pid() const { return at<1>().as_int32(); }
+  bool has_vm_size_kb() const { return at<2>().valid(); }
+  uint64_t vm_size_kb() const { return at<2>().as_uint64(); }
+  bool has_vm_rss_kb() const { return at<3>().valid(); }
+  uint64_t vm_rss_kb() const { return at<3>().as_uint64(); }
+  bool has_rss_anon_kb() const { return at<4>().valid(); }
+  uint64_t rss_anon_kb() const { return at<4>().as_uint64(); }
+  bool has_rss_file_kb() const { return at<5>().valid(); }
+  uint64_t rss_file_kb() const { return at<5>().as_uint64(); }
+  bool has_rss_shmem_kb() const { return at<6>().valid(); }
+  uint64_t rss_shmem_kb() const { return at<6>().as_uint64(); }
+  bool has_vm_swap_kb() const { return at<7>().valid(); }
+  uint64_t vm_swap_kb() const { return at<7>().as_uint64(); }
+  bool has_vm_locked_kb() const { return at<8>().valid(); }
+  uint64_t vm_locked_kb() const { return at<8>().as_uint64(); }
+  bool has_vm_hwm_kb() const { return at<9>().valid(); }
+  uint64_t vm_hwm_kb() const { return at<9>().as_uint64(); }
+  bool has_oom_score_adj() const { return at<10>().valid(); }
+  int64_t oom_score_adj() const { return at<10>().as_int64(); }
+  bool has_threads() const { return at<11>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> threads() const { return GetRepeated<::protozero::ConstBytes>(11); }
+  bool has_is_peak_rss_resettable() const { return at<12>().valid(); }
+  bool is_peak_rss_resettable() const { return at<12>().as_bool(); }
+  bool has_chrome_private_footprint_kb() const { return at<13>().valid(); }
+  uint32_t chrome_private_footprint_kb() const { return at<13>().as_uint32(); }
+  bool has_chrome_peak_resident_set_kb() const { return at<14>().valid(); }
+  uint32_t chrome_peak_resident_set_kb() const { return at<14>().as_uint32(); }
+};
+
+class ProcessStats_Process : public ::protozero::Message {
+ public:
+  using Decoder = ProcessStats_Process_Decoder;
+  enum : int32_t {
+    kPidFieldNumber = 1,
+    kVmSizeKbFieldNumber = 2,
+    kVmRssKbFieldNumber = 3,
+    kRssAnonKbFieldNumber = 4,
+    kRssFileKbFieldNumber = 5,
+    kRssShmemKbFieldNumber = 6,
+    kVmSwapKbFieldNumber = 7,
+    kVmLockedKbFieldNumber = 8,
+    kVmHwmKbFieldNumber = 9,
+    kOomScoreAdjFieldNumber = 10,
+    kThreadsFieldNumber = 11,
+    kIsPeakRssResettableFieldNumber = 12,
+    kChromePrivateFootprintKbFieldNumber = 13,
+    kChromePeakResidentSetKbFieldNumber = 14,
+  };
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ProcessStats_Process>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_VmSizeKb =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProcessStats_Process>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_VmSizeKb kVmSizeKb() { return {}; }
+  void set_vm_size_kb(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_VmSizeKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_VmRssKb =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProcessStats_Process>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_VmRssKb kVmRssKb() { return {}; }
+  void set_vm_rss_kb(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_VmRssKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_RssAnonKb =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProcessStats_Process>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RssAnonKb kRssAnonKb() { return {}; }
+  void set_rss_anon_kb(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_RssAnonKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_RssFileKb =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProcessStats_Process>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RssFileKb kRssFileKb() { return {}; }
+  void set_rss_file_kb(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_RssFileKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_RssShmemKb =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProcessStats_Process>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RssShmemKb kRssShmemKb() { return {}; }
+  void set_rss_shmem_kb(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_RssShmemKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_VmSwapKb =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProcessStats_Process>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_VmSwapKb kVmSwapKb() { return {}; }
+  void set_vm_swap_kb(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_VmSwapKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_VmLockedKb =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProcessStats_Process>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_VmLockedKb kVmLockedKb() { return {}; }
+  void set_vm_locked_kb(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_VmLockedKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_VmHwmKb =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProcessStats_Process>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_VmHwmKb kVmHwmKb() { return {}; }
+  void set_vm_hwm_kb(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_VmHwmKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OomScoreAdj =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      ProcessStats_Process>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OomScoreAdj kOomScoreAdj() { return {}; }
+  void set_oom_score_adj(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_OomScoreAdj::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Threads =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ProcessStats_Thread,
+      ProcessStats_Process>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Threads kThreads() { return {}; }
+  template <typename T = ProcessStats_Thread> T* add_threads() {
+    return BeginNestedMessage<T>(11);
+  }
+
+
+  using FieldMetadata_IsPeakRssResettable =
+    ::protozero::proto_utils::FieldMetadata<
+      12,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ProcessStats_Process>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IsPeakRssResettable kIsPeakRssResettable() { return {}; }
+  void set_is_peak_rss_resettable(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_IsPeakRssResettable::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ChromePrivateFootprintKb =
+    ::protozero::proto_utils::FieldMetadata<
+      13,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      ProcessStats_Process>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromePrivateFootprintKb kChromePrivateFootprintKb() { return {}; }
+  void set_chrome_private_footprint_kb(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ChromePrivateFootprintKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ChromePeakResidentSetKb =
+    ::protozero::proto_utils::FieldMetadata<
+      14,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      ProcessStats_Process>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromePeakResidentSetKb kChromePeakResidentSetKb() { return {}; }
+  void set_chrome_peak_resident_set_kb(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ChromePeakResidentSetKb::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class ProcessStats_Thread_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  ProcessStats_Thread_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ProcessStats_Thread_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ProcessStats_Thread_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_tid() const { return at<1>().valid(); }
+  int32_t tid() const { return at<1>().as_int32(); }
+  bool has_cpu_freq_indices() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint32_t> cpu_freq_indices() const { return GetRepeated<uint32_t>(2); }
+  bool has_cpu_freq_ticks() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint64_t> cpu_freq_ticks() const { return GetRepeated<uint64_t>(3); }
+  bool has_cpu_freq_full() const { return at<4>().valid(); }
+  bool cpu_freq_full() const { return at<4>().as_bool(); }
+};
+
+class ProcessStats_Thread : public ::protozero::Message {
+ public:
+  using Decoder = ProcessStats_Thread_Decoder;
+  enum : int32_t {
+    kTidFieldNumber = 1,
+    kCpuFreqIndicesFieldNumber = 2,
+    kCpuFreqTicksFieldNumber = 3,
+    kCpuFreqFullFieldNumber = 4,
+  };
+
+  using FieldMetadata_Tid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ProcessStats_Thread>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Tid kTid() { return {}; }
+  void set_tid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Tid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CpuFreqIndices =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      ProcessStats_Thread>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CpuFreqIndices kCpuFreqIndices() { return {}; }
+  void add_cpu_freq_indices(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CpuFreqIndices::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CpuFreqTicks =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProcessStats_Thread>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CpuFreqTicks kCpuFreqTicks() { return {}; }
+  void add_cpu_freq_ticks(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CpuFreqTicks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CpuFreqFull =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      ProcessStats_Thread>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CpuFreqFull kCpuFreqFull() { return {}; }
+  void set_cpu_freq_full(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_CpuFreqFull::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ps/process_tree.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PS_PROCESS_TREE_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PS_PROCESS_TREE_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class ProcessTree_Process;
+class ProcessTree_Thread;
+
+class ProcessTree_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  ProcessTree_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ProcessTree_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ProcessTree_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_processes() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> processes() const { return GetRepeated<::protozero::ConstBytes>(1); }
+  bool has_threads() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> threads() const { return GetRepeated<::protozero::ConstBytes>(2); }
+  bool has_collection_end_timestamp() const { return at<3>().valid(); }
+  uint64_t collection_end_timestamp() const { return at<3>().as_uint64(); }
+};
+
+class ProcessTree : public ::protozero::Message {
+ public:
+  using Decoder = ProcessTree_Decoder;
+  enum : int32_t {
+    kProcessesFieldNumber = 1,
+    kThreadsFieldNumber = 2,
+    kCollectionEndTimestampFieldNumber = 3,
+  };
+  using Thread = ::perfetto::protos::pbzero::ProcessTree_Thread;
+  using Process = ::perfetto::protos::pbzero::ProcessTree_Process;
+
+  using FieldMetadata_Processes =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ProcessTree_Process,
+      ProcessTree>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Processes kProcesses() { return {}; }
+  template <typename T = ProcessTree_Process> T* add_processes() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_Threads =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ProcessTree_Thread,
+      ProcessTree>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Threads kThreads() { return {}; }
+  template <typename T = ProcessTree_Thread> T* add_threads() {
+    return BeginNestedMessage<T>(2);
+  }
+
+
+  using FieldMetadata_CollectionEndTimestamp =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      ProcessTree>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CollectionEndTimestamp kCollectionEndTimestamp() { return {}; }
+  void set_collection_end_timestamp(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CollectionEndTimestamp::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class ProcessTree_Process_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  ProcessTree_Process_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ProcessTree_Process_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ProcessTree_Process_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_pid() const { return at<1>().valid(); }
+  int32_t pid() const { return at<1>().as_int32(); }
+  bool has_ppid() const { return at<2>().valid(); }
+  int32_t ppid() const { return at<2>().as_int32(); }
+  bool has_cmdline() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> cmdline() const { return GetRepeated<::protozero::ConstChars>(3); }
+  bool has_threads_deprecated() const { return at<4>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> threads_deprecated() const { return GetRepeated<::protozero::ConstBytes>(4); }
+  bool has_uid() const { return at<5>().valid(); }
+  int32_t uid() const { return at<5>().as_int32(); }
+};
+
+class ProcessTree_Process : public ::protozero::Message {
+ public:
+  using Decoder = ProcessTree_Process_Decoder;
+  enum : int32_t {
+    kPidFieldNumber = 1,
+    kPpidFieldNumber = 2,
+    kCmdlineFieldNumber = 3,
+    kThreadsDeprecatedFieldNumber = 4,
+    kUidFieldNumber = 5,
+  };
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ProcessTree_Process>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Ppid =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ProcessTree_Process>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Ppid kPpid() { return {}; }
+  void set_ppid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Ppid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Cmdline =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ProcessTree_Process>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cmdline kCmdline() { return {}; }
+  void add_cmdline(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Cmdline::kFieldId, data, size);
+  }
+  void add_cmdline(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cmdline::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ThreadsDeprecated =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ProcessTree_Thread,
+      ProcessTree_Process>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ThreadsDeprecated kThreadsDeprecated() { return {}; }
+  template <typename T = ProcessTree_Thread> T* add_threads_deprecated() {
+    return BeginNestedMessage<T>(4);
+  }
+
+
+  using FieldMetadata_Uid =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ProcessTree_Process>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Uid kUid() { return {}; }
+  void set_uid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Uid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class ProcessTree_Thread_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ProcessTree_Thread_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ProcessTree_Thread_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ProcessTree_Thread_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_tid() const { return at<1>().valid(); }
+  int32_t tid() const { return at<1>().as_int32(); }
+  bool has_tgid() const { return at<3>().valid(); }
+  int32_t tgid() const { return at<3>().as_int32(); }
+  bool has_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars name() const { return at<2>().as_string(); }
+};
+
+class ProcessTree_Thread : public ::protozero::Message {
+ public:
+  using Decoder = ProcessTree_Thread_Decoder;
+  enum : int32_t {
+    kTidFieldNumber = 1,
+    kTgidFieldNumber = 3,
+    kNameFieldNumber = 2,
+  };
+
+  using FieldMetadata_Tid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ProcessTree_Thread>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Tid kTid() { return {}; }
+  void set_tid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Tid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Tgid =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      ProcessTree_Thread>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Tgid kTgid() { return {}; }
+  void set_tgid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Tgid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      ProcessTree_Thread>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/sys_stats/sys_stats.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_SYS_STATS_SYS_STATS_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_SYS_STATS_SYS_STATS_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class SysStats_CpuTimes;
+class SysStats_DevfreqValue;
+class SysStats_InterruptCount;
+class SysStats_MeminfoValue;
+class SysStats_VmstatValue;
+enum MeminfoCounters : int32_t;
+enum VmstatCounters : int32_t;
+
+class SysStats_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/10, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  SysStats_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SysStats_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SysStats_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_meminfo() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> meminfo() const { return GetRepeated<::protozero::ConstBytes>(1); }
+  bool has_vmstat() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> vmstat() const { return GetRepeated<::protozero::ConstBytes>(2); }
+  bool has_cpu_stat() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> cpu_stat() const { return GetRepeated<::protozero::ConstBytes>(3); }
+  bool has_num_forks() const { return at<4>().valid(); }
+  uint64_t num_forks() const { return at<4>().as_uint64(); }
+  bool has_num_irq_total() const { return at<5>().valid(); }
+  uint64_t num_irq_total() const { return at<5>().as_uint64(); }
+  bool has_num_irq() const { return at<6>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> num_irq() const { return GetRepeated<::protozero::ConstBytes>(6); }
+  bool has_num_softirq_total() const { return at<7>().valid(); }
+  uint64_t num_softirq_total() const { return at<7>().as_uint64(); }
+  bool has_num_softirq() const { return at<8>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> num_softirq() const { return GetRepeated<::protozero::ConstBytes>(8); }
+  bool has_collection_end_timestamp() const { return at<9>().valid(); }
+  uint64_t collection_end_timestamp() const { return at<9>().as_uint64(); }
+  bool has_devfreq() const { return at<10>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> devfreq() const { return GetRepeated<::protozero::ConstBytes>(10); }
+};
+
+class SysStats : public ::protozero::Message {
+ public:
+  using Decoder = SysStats_Decoder;
+  enum : int32_t {
+    kMeminfoFieldNumber = 1,
+    kVmstatFieldNumber = 2,
+    kCpuStatFieldNumber = 3,
+    kNumForksFieldNumber = 4,
+    kNumIrqTotalFieldNumber = 5,
+    kNumIrqFieldNumber = 6,
+    kNumSoftirqTotalFieldNumber = 7,
+    kNumSoftirqFieldNumber = 8,
+    kCollectionEndTimestampFieldNumber = 9,
+    kDevfreqFieldNumber = 10,
+  };
+  using MeminfoValue = ::perfetto::protos::pbzero::SysStats_MeminfoValue;
+  using VmstatValue = ::perfetto::protos::pbzero::SysStats_VmstatValue;
+  using CpuTimes = ::perfetto::protos::pbzero::SysStats_CpuTimes;
+  using InterruptCount = ::perfetto::protos::pbzero::SysStats_InterruptCount;
+  using DevfreqValue = ::perfetto::protos::pbzero::SysStats_DevfreqValue;
+
+  using FieldMetadata_Meminfo =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SysStats_MeminfoValue,
+      SysStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Meminfo kMeminfo() { return {}; }
+  template <typename T = SysStats_MeminfoValue> T* add_meminfo() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_Vmstat =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SysStats_VmstatValue,
+      SysStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Vmstat kVmstat() { return {}; }
+  template <typename T = SysStats_VmstatValue> T* add_vmstat() {
+    return BeginNestedMessage<T>(2);
+  }
+
+
+  using FieldMetadata_CpuStat =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SysStats_CpuTimes,
+      SysStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CpuStat kCpuStat() { return {}; }
+  template <typename T = SysStats_CpuTimes> T* add_cpu_stat() {
+    return BeginNestedMessage<T>(3);
+  }
+
+
+  using FieldMetadata_NumForks =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SysStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NumForks kNumForks() { return {}; }
+  void set_num_forks(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NumForks::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NumIrqTotal =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SysStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NumIrqTotal kNumIrqTotal() { return {}; }
+  void set_num_irq_total(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NumIrqTotal::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NumIrq =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SysStats_InterruptCount,
+      SysStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NumIrq kNumIrq() { return {}; }
+  template <typename T = SysStats_InterruptCount> T* add_num_irq() {
+    return BeginNestedMessage<T>(6);
+  }
+
+
+  using FieldMetadata_NumSoftirqTotal =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SysStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NumSoftirqTotal kNumSoftirqTotal() { return {}; }
+  void set_num_softirq_total(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_NumSoftirqTotal::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NumSoftirq =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SysStats_InterruptCount,
+      SysStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NumSoftirq kNumSoftirq() { return {}; }
+  template <typename T = SysStats_InterruptCount> T* add_num_softirq() {
+    return BeginNestedMessage<T>(8);
+  }
+
+
+  using FieldMetadata_CollectionEndTimestamp =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SysStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CollectionEndTimestamp kCollectionEndTimestamp() { return {}; }
+  void set_collection_end_timestamp(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CollectionEndTimestamp::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Devfreq =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SysStats_DevfreqValue,
+      SysStats>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Devfreq kDevfreq() { return {}; }
+  template <typename T = SysStats_DevfreqValue> T* add_devfreq() {
+    return BeginNestedMessage<T>(10);
+  }
+
+};
+
+class SysStats_DevfreqValue_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SysStats_DevfreqValue_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SysStats_DevfreqValue_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SysStats_DevfreqValue_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_key() const { return at<1>().valid(); }
+  ::protozero::ConstChars key() const { return at<1>().as_string(); }
+  bool has_value() const { return at<2>().valid(); }
+  uint64_t value() const { return at<2>().as_uint64(); }
+};
+
+class SysStats_DevfreqValue : public ::protozero::Message {
+ public:
+  using Decoder = SysStats_DevfreqValue_Decoder;
+  enum : int32_t {
+    kKeyFieldNumber = 1,
+    kValueFieldNumber = 2,
+  };
+
+  using FieldMetadata_Key =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      SysStats_DevfreqValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Key kKey() { return {}; }
+  void set_key(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Key::kFieldId, data, size);
+  }
+  void set_key(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Key::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Value =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SysStats_DevfreqValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Value kValue() { return {}; }
+  void set_value(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Value::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SysStats_InterruptCount_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SysStats_InterruptCount_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SysStats_InterruptCount_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SysStats_InterruptCount_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_irq() const { return at<1>().valid(); }
+  int32_t irq() const { return at<1>().as_int32(); }
+  bool has_count() const { return at<2>().valid(); }
+  uint64_t count() const { return at<2>().as_uint64(); }
+};
+
+class SysStats_InterruptCount : public ::protozero::Message {
+ public:
+  using Decoder = SysStats_InterruptCount_Decoder;
+  enum : int32_t {
+    kIrqFieldNumber = 1,
+    kCountFieldNumber = 2,
+  };
+
+  using FieldMetadata_Irq =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      SysStats_InterruptCount>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Irq kIrq() { return {}; }
+  void set_irq(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Irq::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Count =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SysStats_InterruptCount>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Count kCount() { return {}; }
+  void set_count(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Count::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SysStats_CpuTimes_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SysStats_CpuTimes_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SysStats_CpuTimes_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SysStats_CpuTimes_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_cpu_id() const { return at<1>().valid(); }
+  uint32_t cpu_id() const { return at<1>().as_uint32(); }
+  bool has_user_ns() const { return at<2>().valid(); }
+  uint64_t user_ns() const { return at<2>().as_uint64(); }
+  bool has_user_ice_ns() const { return at<3>().valid(); }
+  uint64_t user_ice_ns() const { return at<3>().as_uint64(); }
+  bool has_system_mode_ns() const { return at<4>().valid(); }
+  uint64_t system_mode_ns() const { return at<4>().as_uint64(); }
+  bool has_idle_ns() const { return at<5>().valid(); }
+  uint64_t idle_ns() const { return at<5>().as_uint64(); }
+  bool has_io_wait_ns() const { return at<6>().valid(); }
+  uint64_t io_wait_ns() const { return at<6>().as_uint64(); }
+  bool has_irq_ns() const { return at<7>().valid(); }
+  uint64_t irq_ns() const { return at<7>().as_uint64(); }
+  bool has_softirq_ns() const { return at<8>().valid(); }
+  uint64_t softirq_ns() const { return at<8>().as_uint64(); }
+};
+
+class SysStats_CpuTimes : public ::protozero::Message {
+ public:
+  using Decoder = SysStats_CpuTimes_Decoder;
+  enum : int32_t {
+    kCpuIdFieldNumber = 1,
+    kUserNsFieldNumber = 2,
+    kUserIceNsFieldNumber = 3,
+    kSystemModeNsFieldNumber = 4,
+    kIdleNsFieldNumber = 5,
+    kIoWaitNsFieldNumber = 6,
+    kIrqNsFieldNumber = 7,
+    kSoftirqNsFieldNumber = 8,
+  };
+
+  using FieldMetadata_CpuId =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      SysStats_CpuTimes>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CpuId kCpuId() { return {}; }
+  void set_cpu_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_CpuId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_UserNs =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SysStats_CpuTimes>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UserNs kUserNs() { return {}; }
+  void set_user_ns(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_UserNs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_UserIceNs =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SysStats_CpuTimes>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UserIceNs kUserIceNs() { return {}; }
+  void set_user_ice_ns(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_UserIceNs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SystemModeNs =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SysStats_CpuTimes>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SystemModeNs kSystemModeNs() { return {}; }
+  void set_system_mode_ns(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SystemModeNs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IdleNs =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SysStats_CpuTimes>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IdleNs kIdleNs() { return {}; }
+  void set_idle_ns(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IdleNs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IoWaitNs =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SysStats_CpuTimes>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IoWaitNs kIoWaitNs() { return {}; }
+  void set_io_wait_ns(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IoWaitNs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IrqNs =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SysStats_CpuTimes>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IrqNs kIrqNs() { return {}; }
+  void set_irq_ns(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IrqNs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SoftirqNs =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SysStats_CpuTimes>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SoftirqNs kSoftirqNs() { return {}; }
+  void set_softirq_ns(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SoftirqNs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SysStats_VmstatValue_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SysStats_VmstatValue_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SysStats_VmstatValue_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SysStats_VmstatValue_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_key() const { return at<1>().valid(); }
+  int32_t key() const { return at<1>().as_int32(); }
+  bool has_value() const { return at<2>().valid(); }
+  uint64_t value() const { return at<2>().as_uint64(); }
+};
+
+class SysStats_VmstatValue : public ::protozero::Message {
+ public:
+  using Decoder = SysStats_VmstatValue_Decoder;
+  enum : int32_t {
+    kKeyFieldNumber = 1,
+    kValueFieldNumber = 2,
+  };
+
+  using FieldMetadata_Key =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::VmstatCounters,
+      SysStats_VmstatValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Key kKey() { return {}; }
+  void set_key(::perfetto::protos::pbzero::VmstatCounters value) {
+    static constexpr uint32_t field_id = FieldMetadata_Key::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Value =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SysStats_VmstatValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Value kValue() { return {}; }
+  void set_value(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Value::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class SysStats_MeminfoValue_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  SysStats_MeminfoValue_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit SysStats_MeminfoValue_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit SysStats_MeminfoValue_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_key() const { return at<1>().valid(); }
+  int32_t key() const { return at<1>().as_int32(); }
+  bool has_value() const { return at<2>().valid(); }
+  uint64_t value() const { return at<2>().as_uint64(); }
+};
+
+class SysStats_MeminfoValue : public ::protozero::Message {
+ public:
+  using Decoder = SysStats_MeminfoValue_Decoder;
+  enum : int32_t {
+    kKeyFieldNumber = 1,
+    kValueFieldNumber = 2,
+  };
+
+  using FieldMetadata_Key =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::MeminfoCounters,
+      SysStats_MeminfoValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Key kKey() { return {}; }
+  void set_key(::perfetto::protos::pbzero::MeminfoCounters value) {
+    static constexpr uint32_t field_id = FieldMetadata_Key::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Value =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      SysStats_MeminfoValue>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Value kValue() { return {}; }
+  void set_value(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Value::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/system_info/cpu_info.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_SYSTEM_INFO_CPU_INFO_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_SYSTEM_INFO_CPU_INFO_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class CpuInfo_Cpu;
+
+class CpuInfo_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  CpuInfo_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit CpuInfo_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit CpuInfo_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_cpus() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> cpus() const { return GetRepeated<::protozero::ConstBytes>(1); }
+};
+
+class CpuInfo : public ::protozero::Message {
+ public:
+  using Decoder = CpuInfo_Decoder;
+  enum : int32_t {
+    kCpusFieldNumber = 1,
+  };
+  using Cpu = ::perfetto::protos::pbzero::CpuInfo_Cpu;
+
+  using FieldMetadata_Cpus =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      CpuInfo_Cpu,
+      CpuInfo>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cpus kCpus() { return {}; }
+  template <typename T = CpuInfo_Cpu> T* add_cpus() {
+    return BeginNestedMessage<T>(1);
+  }
+
+};
+
+class CpuInfo_Cpu_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  CpuInfo_Cpu_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit CpuInfo_Cpu_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit CpuInfo_Cpu_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_processor() const { return at<1>().valid(); }
+  ::protozero::ConstChars processor() const { return at<1>().as_string(); }
+  bool has_frequencies() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<uint32_t> frequencies() const { return GetRepeated<uint32_t>(2); }
+};
+
+class CpuInfo_Cpu : public ::protozero::Message {
+ public:
+  using Decoder = CpuInfo_Cpu_Decoder;
+  enum : int32_t {
+    kProcessorFieldNumber = 1,
+    kFrequenciesFieldNumber = 2,
+  };
+
+  using FieldMetadata_Processor =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      CpuInfo_Cpu>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Processor kProcessor() { return {}; }
+  void set_processor(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Processor::kFieldId, data, size);
+  }
+  void set_processor(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Processor::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Frequencies =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      CpuInfo_Cpu>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Frequencies kFrequencies() { return {}; }
+  void add_frequencies(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Frequencies::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/trace_packet_defaults.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACE_PACKET_DEFAULTS_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACE_PACKET_DEFAULTS_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class PerfSampleDefaults;
+class TrackEventDefaults;
+
+class TracePacketDefaults_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/58, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TracePacketDefaults_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TracePacketDefaults_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TracePacketDefaults_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_timestamp_clock_id() const { return at<58>().valid(); }
+  uint32_t timestamp_clock_id() const { return at<58>().as_uint32(); }
+  bool has_track_event_defaults() const { return at<11>().valid(); }
+  ::protozero::ConstBytes track_event_defaults() const { return at<11>().as_bytes(); }
+  bool has_perf_sample_defaults() const { return at<12>().valid(); }
+  ::protozero::ConstBytes perf_sample_defaults() const { return at<12>().as_bytes(); }
+};
+
+class TracePacketDefaults : public ::protozero::Message {
+ public:
+  using Decoder = TracePacketDefaults_Decoder;
+  enum : int32_t {
+    kTimestampClockIdFieldNumber = 58,
+    kTrackEventDefaultsFieldNumber = 11,
+    kPerfSampleDefaultsFieldNumber = 12,
+  };
+
+  using FieldMetadata_TimestampClockId =
+    ::protozero::proto_utils::FieldMetadata<
+      58,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TracePacketDefaults>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TimestampClockId kTimestampClockId() { return {}; }
+  void set_timestamp_clock_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TimestampClockId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TrackEventDefaults =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TrackEventDefaults,
+      TracePacketDefaults>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TrackEventDefaults kTrackEventDefaults() { return {}; }
+  template <typename T = TrackEventDefaults> T* set_track_event_defaults() {
+    return BeginNestedMessage<T>(11);
+  }
+
+
+  using FieldMetadata_PerfSampleDefaults =
+    ::protozero::proto_utils::FieldMetadata<
+      12,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      PerfSampleDefaults,
+      TracePacketDefaults>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PerfSampleDefaults kPerfSampleDefaults() { return {}; }
+  template <typename T = PerfSampleDefaults> T* set_perf_sample_defaults() {
+    return BeginNestedMessage<T>(12);
+  }
+
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/test_event.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TEST_EVENT_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TEST_EVENT_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class TestEvent_TestPayload;
+
+class TestEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TestEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TestEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TestEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_str() const { return at<1>().valid(); }
+  ::protozero::ConstChars str() const { return at<1>().as_string(); }
+  bool has_seq_value() const { return at<2>().valid(); }
+  uint32_t seq_value() const { return at<2>().as_uint32(); }
+  bool has_counter() const { return at<3>().valid(); }
+  uint64_t counter() const { return at<3>().as_uint64(); }
+  bool has_is_last() const { return at<4>().valid(); }
+  bool is_last() const { return at<4>().as_bool(); }
+  bool has_payload() const { return at<5>().valid(); }
+  ::protozero::ConstBytes payload() const { return at<5>().as_bytes(); }
+};
+
+class TestEvent : public ::protozero::Message {
+ public:
+  using Decoder = TestEvent_Decoder;
+  enum : int32_t {
+    kStrFieldNumber = 1,
+    kSeqValueFieldNumber = 2,
+    kCounterFieldNumber = 3,
+    kIsLastFieldNumber = 4,
+    kPayloadFieldNumber = 5,
+  };
+  using TestPayload = ::perfetto::protos::pbzero::TestEvent_TestPayload;
+
+  using FieldMetadata_Str =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TestEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Str kStr() { return {}; }
+  void set_str(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Str::kFieldId, data, size);
+  }
+  void set_str(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Str::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SeqValue =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TestEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SeqValue kSeqValue() { return {}; }
+  void set_seq_value(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SeqValue::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Counter =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TestEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Counter kCounter() { return {}; }
+  void set_counter(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Counter::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IsLast =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TestEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IsLast kIsLast() { return {}; }
+  void set_is_last(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_IsLast::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Payload =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TestEvent_TestPayload,
+      TestEvent>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Payload kPayload() { return {}; }
+  template <typename T = TestEvent_TestPayload> T* set_payload() {
+    return BeginNestedMessage<T>(5);
+  }
+
+};
+
+class TestEvent_TestPayload_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  TestEvent_TestPayload_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TestEvent_TestPayload_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TestEvent_TestPayload_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_str() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstChars> str() const { return GetRepeated<::protozero::ConstChars>(1); }
+  bool has_nested() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> nested() const { return GetRepeated<::protozero::ConstBytes>(2); }
+  bool has_single_string() const { return at<4>().valid(); }
+  ::protozero::ConstChars single_string() const { return at<4>().as_string(); }
+  bool has_single_int() const { return at<5>().valid(); }
+  int32_t single_int() const { return at<5>().as_int32(); }
+  bool has_repeated_ints() const { return at<6>().valid(); }
+  ::protozero::RepeatedFieldIterator<int32_t> repeated_ints() const { return GetRepeated<int32_t>(6); }
+  bool has_remaining_nesting_depth() const { return at<3>().valid(); }
+  uint32_t remaining_nesting_depth() const { return at<3>().as_uint32(); }
+};
+
+class TestEvent_TestPayload : public ::protozero::Message {
+ public:
+  using Decoder = TestEvent_TestPayload_Decoder;
+  enum : int32_t {
+    kStrFieldNumber = 1,
+    kNestedFieldNumber = 2,
+    kSingleStringFieldNumber = 4,
+    kSingleIntFieldNumber = 5,
+    kRepeatedIntsFieldNumber = 6,
+    kRemainingNestingDepthFieldNumber = 3,
+  };
+
+  using FieldMetadata_Str =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TestEvent_TestPayload>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Str kStr() { return {}; }
+  void add_str(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Str::kFieldId, data, size);
+  }
+  void add_str(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Str::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Nested =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TestEvent_TestPayload,
+      TestEvent_TestPayload>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Nested kNested() { return {}; }
+  template <typename T = TestEvent_TestPayload> T* add_nested() {
+    return BeginNestedMessage<T>(2);
+  }
+
+
+  using FieldMetadata_SingleString =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TestEvent_TestPayload>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SingleString kSingleString() { return {}; }
+  void set_single_string(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_SingleString::kFieldId, data, size);
+  }
+  void set_single_string(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_SingleString::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SingleInt =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      TestEvent_TestPayload>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SingleInt kSingleInt() { return {}; }
+  void set_single_int(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SingleInt::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_RepeatedInts =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      TestEvent_TestPayload>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RepeatedInts kRepeatedInts() { return {}; }
+  void add_repeated_ints(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_RepeatedInts::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_RemainingNestingDepth =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TestEvent_TestPayload>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_RemainingNestingDepth kRemainingNestingDepth() { return {}; }
+  void set_remaining_nesting_depth(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_RemainingNestingDepth::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/test_extensions.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TEST_EXTENSIONS_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TEST_EXTENSIONS_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+// gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/track_event.pbzero.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+
+class TestExtensionChild_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TestExtensionChild_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TestExtensionChild_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TestExtensionChild_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_child_field_for_testing() const { return at<1>().valid(); }
+  ::protozero::ConstChars child_field_for_testing() const { return at<1>().as_string(); }
+};
+
+class TestExtensionChild : public ::protozero::Message {
+ public:
+  using Decoder = TestExtensionChild_Decoder;
+  enum : int32_t {
+    kChildFieldForTestingFieldNumber = 1,
+  };
+
+  using FieldMetadata_ChildFieldForTesting =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TestExtensionChild>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChildFieldForTesting kChildFieldForTesting() { return {}; }
+  void set_child_field_for_testing(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ChildFieldForTesting::kFieldId, data, size);
+  }
+  void set_child_field_for_testing(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ChildFieldForTesting::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class TestExtension : public ::perfetto::protos::pbzero::TrackEvent {
+ public:
+
+  using FieldMetadata_StringExtensionForTesting =
+    ::protozero::proto_utils::FieldMetadata<
+      9900,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TestExtension>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StringExtensionForTesting kStringExtensionForTesting() { return {}; }
+  void set_string_extension_for_testing(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_StringExtensionForTesting::kFieldId, data, size);
+  }
+  void set_string_extension_for_testing(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_StringExtensionForTesting::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IntExtensionForTesting =
+    ::protozero::proto_utils::FieldMetadata<
+      9901,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      TestExtension>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IntExtensionForTesting kIntExtensionForTesting() { return {}; }
+  void add_int_extension_for_testing(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_IntExtensionForTesting::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_OmittedExtensionForTesting =
+    ::protozero::proto_utils::FieldMetadata<
+      9902,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      TestExtension>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_OmittedExtensionForTesting kOmittedExtensionForTesting() { return {}; }
+  void set_omitted_extension_for_testing(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_OmittedExtensionForTesting::kFieldId, data, size);
+  }
+  void set_omitted_extension_for_testing(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_OmittedExtensionForTesting::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_NestedMessageExtensionForTesting =
+    ::protozero::proto_utils::FieldMetadata<
+      9903,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TestExtensionChild,
+      TestExtension>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_NestedMessageExtensionForTesting kNestedMessageExtensionForTesting() { return {}; }
+  template <typename T = TestExtensionChild> T* set_nested_message_extension_for_testing() {
+    return BeginNestedMessage<T>(9903);
+  }
+
+};
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/trace_packet.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACE_PACKET_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACE_PACKET_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class AndroidEnergyEstimationBreakdown;
+class AndroidLogPacket;
+class BatteryCounters;
+class ChromeBenchmarkMetadata;
+class ChromeEventBundle;
+class ChromeMetadataPacket;
+class ClockSnapshot;
+class CpuInfo;
+class DeobfuscationMapping;
+class ExtensionDescriptor;
+class FrameTimelineEvent;
+class FtraceEventBundle;
+class FtraceStats;
+class GpuCounterEvent;
+class GpuLog;
+class GpuMemTotalEvent;
+class GpuRenderStageEvent;
+class GraphicsFrameEvent;
+class HeapGraph;
+class InitialDisplayState;
+class InodeFileMap;
+class InternedData;
+class MemoryTrackerSnapshot;
+class ModuleSymbols;
+class PackagesList;
+class PerfSample;
+class PerfettoMetatrace;
+class PowerRails;
+class ProcessDescriptor;
+class ProcessStats;
+class ProcessTree;
+class ProfilePacket;
+class ProfiledFrameSymbols;
+class SmapsPacket;
+class StreamingAllocation;
+class StreamingFree;
+class StreamingProfilePacket;
+class SysStats;
+class SystemInfo;
+class TestEvent;
+class ThreadDescriptor;
+class TraceConfig;
+class TracePacketDefaults;
+class TraceStats;
+class TracingServiceEvent;
+class TrackDescriptor;
+class TrackEvent;
+class Trigger;
+class UiState;
+class VulkanApiEvent;
+class VulkanMemoryEvent;
+
+enum TracePacket_SequenceFlags : int32_t {
+  TracePacket_SequenceFlags_SEQ_UNSPECIFIED = 0,
+  TracePacket_SequenceFlags_SEQ_INCREMENTAL_STATE_CLEARED = 1,
+  TracePacket_SequenceFlags_SEQ_NEEDS_INCREMENTAL_STATE = 2,
+};
+
+const TracePacket_SequenceFlags TracePacket_SequenceFlags_MIN = TracePacket_SequenceFlags_SEQ_UNSPECIFIED;
+const TracePacket_SequenceFlags TracePacket_SequenceFlags_MAX = TracePacket_SequenceFlags_SEQ_NEEDS_INCREMENTAL_STATE;
+
+class TracePacket_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/900, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  TracePacket_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit TracePacket_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit TracePacket_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_timestamp() const { return at<8>().valid(); }
+  uint64_t timestamp() const { return at<8>().as_uint64(); }
+  bool has_timestamp_clock_id() const { return at<58>().valid(); }
+  uint32_t timestamp_clock_id() const { return at<58>().as_uint32(); }
+  bool has_process_tree() const { return at<2>().valid(); }
+  ::protozero::ConstBytes process_tree() const { return at<2>().as_bytes(); }
+  bool has_process_stats() const { return at<9>().valid(); }
+  ::protozero::ConstBytes process_stats() const { return at<9>().as_bytes(); }
+  bool has_inode_file_map() const { return at<4>().valid(); }
+  ::protozero::ConstBytes inode_file_map() const { return at<4>().as_bytes(); }
+  bool has_chrome_events() const { return at<5>().valid(); }
+  ::protozero::ConstBytes chrome_events() const { return at<5>().as_bytes(); }
+  bool has_clock_snapshot() const { return at<6>().valid(); }
+  ::protozero::ConstBytes clock_snapshot() const { return at<6>().as_bytes(); }
+  bool has_sys_stats() const { return at<7>().valid(); }
+  ::protozero::ConstBytes sys_stats() const { return at<7>().as_bytes(); }
+  bool has_track_event() const { return at<11>().valid(); }
+  ::protozero::ConstBytes track_event() const { return at<11>().as_bytes(); }
+  bool has_trace_config() const { return at<33>().valid(); }
+  ::protozero::ConstBytes trace_config() const { return at<33>().as_bytes(); }
+  bool has_ftrace_stats() const { return at<34>().valid(); }
+  ::protozero::ConstBytes ftrace_stats() const { return at<34>().as_bytes(); }
+  bool has_trace_stats() const { return at<35>().valid(); }
+  ::protozero::ConstBytes trace_stats() const { return at<35>().as_bytes(); }
+  bool has_profile_packet() const { return at<37>().valid(); }
+  ::protozero::ConstBytes profile_packet() const { return at<37>().as_bytes(); }
+  bool has_streaming_allocation() const { return at<74>().valid(); }
+  ::protozero::ConstBytes streaming_allocation() const { return at<74>().as_bytes(); }
+  bool has_streaming_free() const { return at<75>().valid(); }
+  ::protozero::ConstBytes streaming_free() const { return at<75>().as_bytes(); }
+  bool has_battery() const { return at<38>().valid(); }
+  ::protozero::ConstBytes battery() const { return at<38>().as_bytes(); }
+  bool has_power_rails() const { return at<40>().valid(); }
+  ::protozero::ConstBytes power_rails() const { return at<40>().as_bytes(); }
+  bool has_android_log() const { return at<39>().valid(); }
+  ::protozero::ConstBytes android_log() const { return at<39>().as_bytes(); }
+  bool has_system_info() const { return at<45>().valid(); }
+  ::protozero::ConstBytes system_info() const { return at<45>().as_bytes(); }
+  bool has_trigger() const { return at<46>().valid(); }
+  ::protozero::ConstBytes trigger() const { return at<46>().as_bytes(); }
+  bool has_packages_list() const { return at<47>().valid(); }
+  ::protozero::ConstBytes packages_list() const { return at<47>().as_bytes(); }
+  bool has_chrome_benchmark_metadata() const { return at<48>().valid(); }
+  ::protozero::ConstBytes chrome_benchmark_metadata() const { return at<48>().as_bytes(); }
+  bool has_perfetto_metatrace() const { return at<49>().valid(); }
+  ::protozero::ConstBytes perfetto_metatrace() const { return at<49>().as_bytes(); }
+  bool has_chrome_metadata() const { return at<51>().valid(); }
+  ::protozero::ConstBytes chrome_metadata() const { return at<51>().as_bytes(); }
+  bool has_gpu_counter_event() const { return at<52>().valid(); }
+  ::protozero::ConstBytes gpu_counter_event() const { return at<52>().as_bytes(); }
+  bool has_gpu_render_stage_event() const { return at<53>().valid(); }
+  ::protozero::ConstBytes gpu_render_stage_event() const { return at<53>().as_bytes(); }
+  bool has_streaming_profile_packet() const { return at<54>().valid(); }
+  ::protozero::ConstBytes streaming_profile_packet() const { return at<54>().as_bytes(); }
+  bool has_heap_graph() const { return at<56>().valid(); }
+  ::protozero::ConstBytes heap_graph() const { return at<56>().as_bytes(); }
+  bool has_graphics_frame_event() const { return at<57>().valid(); }
+  ::protozero::ConstBytes graphics_frame_event() const { return at<57>().as_bytes(); }
+  bool has_vulkan_memory_event() const { return at<62>().valid(); }
+  ::protozero::ConstBytes vulkan_memory_event() const { return at<62>().as_bytes(); }
+  bool has_gpu_log() const { return at<63>().valid(); }
+  ::protozero::ConstBytes gpu_log() const { return at<63>().as_bytes(); }
+  bool has_vulkan_api_event() const { return at<65>().valid(); }
+  ::protozero::ConstBytes vulkan_api_event() const { return at<65>().as_bytes(); }
+  bool has_perf_sample() const { return at<66>().valid(); }
+  ::protozero::ConstBytes perf_sample() const { return at<66>().as_bytes(); }
+  bool has_cpu_info() const { return at<67>().valid(); }
+  ::protozero::ConstBytes cpu_info() const { return at<67>().as_bytes(); }
+  bool has_smaps_packet() const { return at<68>().valid(); }
+  ::protozero::ConstBytes smaps_packet() const { return at<68>().as_bytes(); }
+  bool has_service_event() const { return at<69>().valid(); }
+  ::protozero::ConstBytes service_event() const { return at<69>().as_bytes(); }
+  bool has_initial_display_state() const { return at<70>().valid(); }
+  ::protozero::ConstBytes initial_display_state() const { return at<70>().as_bytes(); }
+  bool has_gpu_mem_total_event() const { return at<71>().valid(); }
+  ::protozero::ConstBytes gpu_mem_total_event() const { return at<71>().as_bytes(); }
+  bool has_memory_tracker_snapshot() const { return at<73>().valid(); }
+  ::protozero::ConstBytes memory_tracker_snapshot() const { return at<73>().as_bytes(); }
+  bool has_frame_timeline_event() const { return at<76>().valid(); }
+  ::protozero::ConstBytes frame_timeline_event() const { return at<76>().as_bytes(); }
+  bool has_android_energy_estimation_breakdown() const { return at<77>().valid(); }
+  ::protozero::ConstBytes android_energy_estimation_breakdown() const { return at<77>().as_bytes(); }
+  bool has_ui_state() const { return at<78>().valid(); }
+  ::protozero::ConstBytes ui_state() const { return at<78>().as_bytes(); }
+  bool has_profiled_frame_symbols() const { return at<55>().valid(); }
+  ::protozero::ConstBytes profiled_frame_symbols() const { return at<55>().as_bytes(); }
+  bool has_module_symbols() const { return at<61>().valid(); }
+  ::protozero::ConstBytes module_symbols() const { return at<61>().as_bytes(); }
+  bool has_deobfuscation_mapping() const { return at<64>().valid(); }
+  ::protozero::ConstBytes deobfuscation_mapping() const { return at<64>().as_bytes(); }
+  bool has_track_descriptor() const { return at<60>().valid(); }
+  ::protozero::ConstBytes track_descriptor() const { return at<60>().as_bytes(); }
+  bool has_process_descriptor() const { return at<43>().valid(); }
+  ::protozero::ConstBytes process_descriptor() const { return at<43>().as_bytes(); }
+  bool has_thread_descriptor() const { return at<44>().valid(); }
+  ::protozero::ConstBytes thread_descriptor() const { return at<44>().as_bytes(); }
+  bool has_ftrace_events() const { return at<1>().valid(); }
+  ::protozero::ConstBytes ftrace_events() const { return at<1>().as_bytes(); }
+  bool has_synchronization_marker() const { return at<36>().valid(); }
+  ::protozero::ConstBytes synchronization_marker() const { return at<36>().as_bytes(); }
+  bool has_compressed_packets() const { return at<50>().valid(); }
+  ::protozero::ConstBytes compressed_packets() const { return at<50>().as_bytes(); }
+  bool has_extension_descriptor() const { return at<72>().valid(); }
+  ::protozero::ConstBytes extension_descriptor() const { return at<72>().as_bytes(); }
+  bool has_for_testing() const { return at<900>().valid(); }
+  ::protozero::ConstBytes for_testing() const { return at<900>().as_bytes(); }
+  bool has_trusted_uid() const { return at<3>().valid(); }
+  int32_t trusted_uid() const { return at<3>().as_int32(); }
+  bool has_trusted_packet_sequence_id() const { return at<10>().valid(); }
+  uint32_t trusted_packet_sequence_id() const { return at<10>().as_uint32(); }
+  bool has_interned_data() const { return at<12>().valid(); }
+  ::protozero::ConstBytes interned_data() const { return at<12>().as_bytes(); }
+  bool has_sequence_flags() const { return at<13>().valid(); }
+  uint32_t sequence_flags() const { return at<13>().as_uint32(); }
+  bool has_incremental_state_cleared() const { return at<41>().valid(); }
+  bool incremental_state_cleared() const { return at<41>().as_bool(); }
+  bool has_trace_packet_defaults() const { return at<59>().valid(); }
+  ::protozero::ConstBytes trace_packet_defaults() const { return at<59>().as_bytes(); }
+  bool has_previous_packet_dropped() const { return at<42>().valid(); }
+  bool previous_packet_dropped() const { return at<42>().as_bool(); }
+};
+
+class TracePacket : public ::protozero::Message {
+ public:
+  using Decoder = TracePacket_Decoder;
+  enum : int32_t {
+    kTimestampFieldNumber = 8,
+    kTimestampClockIdFieldNumber = 58,
+    kProcessTreeFieldNumber = 2,
+    kProcessStatsFieldNumber = 9,
+    kInodeFileMapFieldNumber = 4,
+    kChromeEventsFieldNumber = 5,
+    kClockSnapshotFieldNumber = 6,
+    kSysStatsFieldNumber = 7,
+    kTrackEventFieldNumber = 11,
+    kTraceConfigFieldNumber = 33,
+    kFtraceStatsFieldNumber = 34,
+    kTraceStatsFieldNumber = 35,
+    kProfilePacketFieldNumber = 37,
+    kStreamingAllocationFieldNumber = 74,
+    kStreamingFreeFieldNumber = 75,
+    kBatteryFieldNumber = 38,
+    kPowerRailsFieldNumber = 40,
+    kAndroidLogFieldNumber = 39,
+    kSystemInfoFieldNumber = 45,
+    kTriggerFieldNumber = 46,
+    kPackagesListFieldNumber = 47,
+    kChromeBenchmarkMetadataFieldNumber = 48,
+    kPerfettoMetatraceFieldNumber = 49,
+    kChromeMetadataFieldNumber = 51,
+    kGpuCounterEventFieldNumber = 52,
+    kGpuRenderStageEventFieldNumber = 53,
+    kStreamingProfilePacketFieldNumber = 54,
+    kHeapGraphFieldNumber = 56,
+    kGraphicsFrameEventFieldNumber = 57,
+    kVulkanMemoryEventFieldNumber = 62,
+    kGpuLogFieldNumber = 63,
+    kVulkanApiEventFieldNumber = 65,
+    kPerfSampleFieldNumber = 66,
+    kCpuInfoFieldNumber = 67,
+    kSmapsPacketFieldNumber = 68,
+    kServiceEventFieldNumber = 69,
+    kInitialDisplayStateFieldNumber = 70,
+    kGpuMemTotalEventFieldNumber = 71,
+    kMemoryTrackerSnapshotFieldNumber = 73,
+    kFrameTimelineEventFieldNumber = 76,
+    kAndroidEnergyEstimationBreakdownFieldNumber = 77,
+    kUiStateFieldNumber = 78,
+    kProfiledFrameSymbolsFieldNumber = 55,
+    kModuleSymbolsFieldNumber = 61,
+    kDeobfuscationMappingFieldNumber = 64,
+    kTrackDescriptorFieldNumber = 60,
+    kProcessDescriptorFieldNumber = 43,
+    kThreadDescriptorFieldNumber = 44,
+    kFtraceEventsFieldNumber = 1,
+    kSynchronizationMarkerFieldNumber = 36,
+    kCompressedPacketsFieldNumber = 50,
+    kExtensionDescriptorFieldNumber = 72,
+    kForTestingFieldNumber = 900,
+    kTrustedUidFieldNumber = 3,
+    kTrustedPacketSequenceIdFieldNumber = 10,
+    kInternedDataFieldNumber = 12,
+    kSequenceFlagsFieldNumber = 13,
+    kIncrementalStateClearedFieldNumber = 41,
+    kTracePacketDefaultsFieldNumber = 59,
+    kPreviousPacketDroppedFieldNumber = 42,
+  };
+  using SequenceFlags = ::perfetto::protos::pbzero::TracePacket_SequenceFlags;
+  static const SequenceFlags SEQ_UNSPECIFIED = TracePacket_SequenceFlags_SEQ_UNSPECIFIED;
+  static const SequenceFlags SEQ_INCREMENTAL_STATE_CLEARED = TracePacket_SequenceFlags_SEQ_INCREMENTAL_STATE_CLEARED;
+  static const SequenceFlags SEQ_NEEDS_INCREMENTAL_STATE = TracePacket_SequenceFlags_SEQ_NEEDS_INCREMENTAL_STATE;
+
+  using FieldMetadata_Timestamp =
+    ::protozero::proto_utils::FieldMetadata<
+      8,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Timestamp kTimestamp() { return {}; }
+  void set_timestamp(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Timestamp::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TimestampClockId =
+    ::protozero::proto_utils::FieldMetadata<
+      58,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TimestampClockId kTimestampClockId() { return {}; }
+  void set_timestamp_clock_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TimestampClockId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ProcessTree =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ProcessTree,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProcessTree kProcessTree() { return {}; }
+  template <typename T = ProcessTree> T* set_process_tree() {
+    return BeginNestedMessage<T>(2);
+  }
+
+
+  using FieldMetadata_ProcessStats =
+    ::protozero::proto_utils::FieldMetadata<
+      9,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ProcessStats,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProcessStats kProcessStats() { return {}; }
+  template <typename T = ProcessStats> T* set_process_stats() {
+    return BeginNestedMessage<T>(9);
+  }
+
+
+  using FieldMetadata_InodeFileMap =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      InodeFileMap,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_InodeFileMap kInodeFileMap() { return {}; }
+  template <typename T = InodeFileMap> T* set_inode_file_map() {
+    return BeginNestedMessage<T>(4);
+  }
+
+
+  using FieldMetadata_ChromeEvents =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeEventBundle,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeEvents kChromeEvents() { return {}; }
+  template <typename T = ChromeEventBundle> T* set_chrome_events() {
+    return BeginNestedMessage<T>(5);
+  }
+
+
+  using FieldMetadata_ClockSnapshot =
+    ::protozero::proto_utils::FieldMetadata<
+      6,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ClockSnapshot,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ClockSnapshot kClockSnapshot() { return {}; }
+  template <typename T = ClockSnapshot> T* set_clock_snapshot() {
+    return BeginNestedMessage<T>(6);
+  }
+
+
+  using FieldMetadata_SysStats =
+    ::protozero::proto_utils::FieldMetadata<
+      7,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SysStats,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SysStats kSysStats() { return {}; }
+  template <typename T = SysStats> T* set_sys_stats() {
+    return BeginNestedMessage<T>(7);
+  }
+
+
+  using FieldMetadata_TrackEvent =
+    ::protozero::proto_utils::FieldMetadata<
+      11,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TrackEvent,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TrackEvent kTrackEvent() { return {}; }
+  template <typename T = TrackEvent> T* set_track_event() {
+    return BeginNestedMessage<T>(11);
+  }
+
+
+  using FieldMetadata_TraceConfig =
+    ::protozero::proto_utils::FieldMetadata<
+      33,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceConfig,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TraceConfig kTraceConfig() { return {}; }
+  template <typename T = TraceConfig> T* set_trace_config() {
+    return BeginNestedMessage<T>(33);
+  }
+
+
+  using FieldMetadata_FtraceStats =
+    ::protozero::proto_utils::FieldMetadata<
+      34,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      FtraceStats,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FtraceStats kFtraceStats() { return {}; }
+  template <typename T = FtraceStats> T* set_ftrace_stats() {
+    return BeginNestedMessage<T>(34);
+  }
+
+
+  using FieldMetadata_TraceStats =
+    ::protozero::proto_utils::FieldMetadata<
+      35,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TraceStats,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TraceStats kTraceStats() { return {}; }
+  template <typename T = TraceStats> T* set_trace_stats() {
+    return BeginNestedMessage<T>(35);
+  }
+
+
+  using FieldMetadata_ProfilePacket =
+    ::protozero::proto_utils::FieldMetadata<
+      37,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ProfilePacket,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProfilePacket kProfilePacket() { return {}; }
+  template <typename T = ProfilePacket> T* set_profile_packet() {
+    return BeginNestedMessage<T>(37);
+  }
+
+
+  using FieldMetadata_StreamingAllocation =
+    ::protozero::proto_utils::FieldMetadata<
+      74,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      StreamingAllocation,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StreamingAllocation kStreamingAllocation() { return {}; }
+  template <typename T = StreamingAllocation> T* set_streaming_allocation() {
+    return BeginNestedMessage<T>(74);
+  }
+
+
+  using FieldMetadata_StreamingFree =
+    ::protozero::proto_utils::FieldMetadata<
+      75,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      StreamingFree,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StreamingFree kStreamingFree() { return {}; }
+  template <typename T = StreamingFree> T* set_streaming_free() {
+    return BeginNestedMessage<T>(75);
+  }
+
+
+  using FieldMetadata_Battery =
+    ::protozero::proto_utils::FieldMetadata<
+      38,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      BatteryCounters,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Battery kBattery() { return {}; }
+  template <typename T = BatteryCounters> T* set_battery() {
+    return BeginNestedMessage<T>(38);
+  }
+
+
+  using FieldMetadata_PowerRails =
+    ::protozero::proto_utils::FieldMetadata<
+      40,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      PowerRails,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PowerRails kPowerRails() { return {}; }
+  template <typename T = PowerRails> T* set_power_rails() {
+    return BeginNestedMessage<T>(40);
+  }
+
+
+  using FieldMetadata_AndroidLog =
+    ::protozero::proto_utils::FieldMetadata<
+      39,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      AndroidLogPacket,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AndroidLog kAndroidLog() { return {}; }
+  template <typename T = AndroidLogPacket> T* set_android_log() {
+    return BeginNestedMessage<T>(39);
+  }
+
+
+  using FieldMetadata_SystemInfo =
+    ::protozero::proto_utils::FieldMetadata<
+      45,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SystemInfo,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SystemInfo kSystemInfo() { return {}; }
+  template <typename T = SystemInfo> T* set_system_info() {
+    return BeginNestedMessage<T>(45);
+  }
+
+
+  using FieldMetadata_Trigger =
+    ::protozero::proto_utils::FieldMetadata<
+      46,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      Trigger,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Trigger kTrigger() { return {}; }
+  template <typename T = Trigger> T* set_trigger() {
+    return BeginNestedMessage<T>(46);
+  }
+
+
+  using FieldMetadata_PackagesList =
+    ::protozero::proto_utils::FieldMetadata<
+      47,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      PackagesList,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PackagesList kPackagesList() { return {}; }
+  template <typename T = PackagesList> T* set_packages_list() {
+    return BeginNestedMessage<T>(47);
+  }
+
+
+  using FieldMetadata_ChromeBenchmarkMetadata =
+    ::protozero::proto_utils::FieldMetadata<
+      48,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeBenchmarkMetadata,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeBenchmarkMetadata kChromeBenchmarkMetadata() { return {}; }
+  template <typename T = ChromeBenchmarkMetadata> T* set_chrome_benchmark_metadata() {
+    return BeginNestedMessage<T>(48);
+  }
+
+
+  using FieldMetadata_PerfettoMetatrace =
+    ::protozero::proto_utils::FieldMetadata<
+      49,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      PerfettoMetatrace,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PerfettoMetatrace kPerfettoMetatrace() { return {}; }
+  template <typename T = PerfettoMetatrace> T* set_perfetto_metatrace() {
+    return BeginNestedMessage<T>(49);
+  }
+
+
+  using FieldMetadata_ChromeMetadata =
+    ::protozero::proto_utils::FieldMetadata<
+      51,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ChromeMetadataPacket,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ChromeMetadata kChromeMetadata() { return {}; }
+  template <typename T = ChromeMetadataPacket> T* set_chrome_metadata() {
+    return BeginNestedMessage<T>(51);
+  }
+
+
+  using FieldMetadata_GpuCounterEvent =
+    ::protozero::proto_utils::FieldMetadata<
+      52,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      GpuCounterEvent,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GpuCounterEvent kGpuCounterEvent() { return {}; }
+  template <typename T = GpuCounterEvent> T* set_gpu_counter_event() {
+    return BeginNestedMessage<T>(52);
+  }
+
+
+  using FieldMetadata_GpuRenderStageEvent =
+    ::protozero::proto_utils::FieldMetadata<
+      53,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      GpuRenderStageEvent,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GpuRenderStageEvent kGpuRenderStageEvent() { return {}; }
+  template <typename T = GpuRenderStageEvent> T* set_gpu_render_stage_event() {
+    return BeginNestedMessage<T>(53);
+  }
+
+
+  using FieldMetadata_StreamingProfilePacket =
+    ::protozero::proto_utils::FieldMetadata<
+      54,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      StreamingProfilePacket,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_StreamingProfilePacket kStreamingProfilePacket() { return {}; }
+  template <typename T = StreamingProfilePacket> T* set_streaming_profile_packet() {
+    return BeginNestedMessage<T>(54);
+  }
+
+
+  using FieldMetadata_HeapGraph =
+    ::protozero::proto_utils::FieldMetadata<
+      56,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      HeapGraph,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HeapGraph kHeapGraph() { return {}; }
+  template <typename T = HeapGraph> T* set_heap_graph() {
+    return BeginNestedMessage<T>(56);
+  }
+
+
+  using FieldMetadata_GraphicsFrameEvent =
+    ::protozero::proto_utils::FieldMetadata<
+      57,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      GraphicsFrameEvent,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GraphicsFrameEvent kGraphicsFrameEvent() { return {}; }
+  template <typename T = GraphicsFrameEvent> T* set_graphics_frame_event() {
+    return BeginNestedMessage<T>(57);
+  }
+
+
+  using FieldMetadata_VulkanMemoryEvent =
+    ::protozero::proto_utils::FieldMetadata<
+      62,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      VulkanMemoryEvent,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_VulkanMemoryEvent kVulkanMemoryEvent() { return {}; }
+  template <typename T = VulkanMemoryEvent> T* set_vulkan_memory_event() {
+    return BeginNestedMessage<T>(62);
+  }
+
+
+  using FieldMetadata_GpuLog =
+    ::protozero::proto_utils::FieldMetadata<
+      63,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      GpuLog,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GpuLog kGpuLog() { return {}; }
+  template <typename T = GpuLog> T* set_gpu_log() {
+    return BeginNestedMessage<T>(63);
+  }
+
+
+  using FieldMetadata_VulkanApiEvent =
+    ::protozero::proto_utils::FieldMetadata<
+      65,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      VulkanApiEvent,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_VulkanApiEvent kVulkanApiEvent() { return {}; }
+  template <typename T = VulkanApiEvent> T* set_vulkan_api_event() {
+    return BeginNestedMessage<T>(65);
+  }
+
+
+  using FieldMetadata_PerfSample =
+    ::protozero::proto_utils::FieldMetadata<
+      66,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      PerfSample,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PerfSample kPerfSample() { return {}; }
+  template <typename T = PerfSample> T* set_perf_sample() {
+    return BeginNestedMessage<T>(66);
+  }
+
+
+  using FieldMetadata_CpuInfo =
+    ::protozero::proto_utils::FieldMetadata<
+      67,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      CpuInfo,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CpuInfo kCpuInfo() { return {}; }
+  template <typename T = CpuInfo> T* set_cpu_info() {
+    return BeginNestedMessage<T>(67);
+  }
+
+
+  using FieldMetadata_SmapsPacket =
+    ::protozero::proto_utils::FieldMetadata<
+      68,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      SmapsPacket,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SmapsPacket kSmapsPacket() { return {}; }
+  template <typename T = SmapsPacket> T* set_smaps_packet() {
+    return BeginNestedMessage<T>(68);
+  }
+
+
+  using FieldMetadata_ServiceEvent =
+    ::protozero::proto_utils::FieldMetadata<
+      69,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TracingServiceEvent,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ServiceEvent kServiceEvent() { return {}; }
+  template <typename T = TracingServiceEvent> T* set_service_event() {
+    return BeginNestedMessage<T>(69);
+  }
+
+
+  using FieldMetadata_InitialDisplayState =
+    ::protozero::proto_utils::FieldMetadata<
+      70,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      InitialDisplayState,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_InitialDisplayState kInitialDisplayState() { return {}; }
+  template <typename T = InitialDisplayState> T* set_initial_display_state() {
+    return BeginNestedMessage<T>(70);
+  }
+
+
+  using FieldMetadata_GpuMemTotalEvent =
+    ::protozero::proto_utils::FieldMetadata<
+      71,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      GpuMemTotalEvent,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GpuMemTotalEvent kGpuMemTotalEvent() { return {}; }
+  template <typename T = GpuMemTotalEvent> T* set_gpu_mem_total_event() {
+    return BeginNestedMessage<T>(71);
+  }
+
+
+  using FieldMetadata_MemoryTrackerSnapshot =
+    ::protozero::proto_utils::FieldMetadata<
+      73,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MemoryTrackerSnapshot,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MemoryTrackerSnapshot kMemoryTrackerSnapshot() { return {}; }
+  template <typename T = MemoryTrackerSnapshot> T* set_memory_tracker_snapshot() {
+    return BeginNestedMessage<T>(73);
+  }
+
+
+  using FieldMetadata_FrameTimelineEvent =
+    ::protozero::proto_utils::FieldMetadata<
+      76,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      FrameTimelineEvent,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FrameTimelineEvent kFrameTimelineEvent() { return {}; }
+  template <typename T = FrameTimelineEvent> T* set_frame_timeline_event() {
+    return BeginNestedMessage<T>(76);
+  }
+
+
+  using FieldMetadata_AndroidEnergyEstimationBreakdown =
+    ::protozero::proto_utils::FieldMetadata<
+      77,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      AndroidEnergyEstimationBreakdown,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AndroidEnergyEstimationBreakdown kAndroidEnergyEstimationBreakdown() { return {}; }
+  template <typename T = AndroidEnergyEstimationBreakdown> T* set_android_energy_estimation_breakdown() {
+    return BeginNestedMessage<T>(77);
+  }
+
+
+  using FieldMetadata_UiState =
+    ::protozero::proto_utils::FieldMetadata<
+      78,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      UiState,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_UiState kUiState() { return {}; }
+  template <typename T = UiState> T* set_ui_state() {
+    return BeginNestedMessage<T>(78);
+  }
+
+
+  using FieldMetadata_ProfiledFrameSymbols =
+    ::protozero::proto_utils::FieldMetadata<
+      55,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ProfiledFrameSymbols,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProfiledFrameSymbols kProfiledFrameSymbols() { return {}; }
+  template <typename T = ProfiledFrameSymbols> T* set_profiled_frame_symbols() {
+    return BeginNestedMessage<T>(55);
+  }
+
+
+  using FieldMetadata_ModuleSymbols =
+    ::protozero::proto_utils::FieldMetadata<
+      61,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ModuleSymbols,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ModuleSymbols kModuleSymbols() { return {}; }
+  template <typename T = ModuleSymbols> T* set_module_symbols() {
+    return BeginNestedMessage<T>(61);
+  }
+
+
+  using FieldMetadata_DeobfuscationMapping =
+    ::protozero::proto_utils::FieldMetadata<
+      64,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      DeobfuscationMapping,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_DeobfuscationMapping kDeobfuscationMapping() { return {}; }
+  template <typename T = DeobfuscationMapping> T* set_deobfuscation_mapping() {
+    return BeginNestedMessage<T>(64);
+  }
+
+
+  using FieldMetadata_TrackDescriptor =
+    ::protozero::proto_utils::FieldMetadata<
+      60,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TrackDescriptor,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TrackDescriptor kTrackDescriptor() { return {}; }
+  template <typename T = TrackDescriptor> T* set_track_descriptor() {
+    return BeginNestedMessage<T>(60);
+  }
+
+
+  using FieldMetadata_ProcessDescriptor =
+    ::protozero::proto_utils::FieldMetadata<
+      43,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ProcessDescriptor,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProcessDescriptor kProcessDescriptor() { return {}; }
+  template <typename T = ProcessDescriptor> T* set_process_descriptor() {
+    return BeginNestedMessage<T>(43);
+  }
+
+
+  using FieldMetadata_ThreadDescriptor =
+    ::protozero::proto_utils::FieldMetadata<
+      44,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ThreadDescriptor,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ThreadDescriptor kThreadDescriptor() { return {}; }
+  template <typename T = ThreadDescriptor> T* set_thread_descriptor() {
+    return BeginNestedMessage<T>(44);
+  }
+
+
+  using FieldMetadata_FtraceEvents =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      FtraceEventBundle,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_FtraceEvents kFtraceEvents() { return {}; }
+  template <typename T = FtraceEventBundle> T* set_ftrace_events() {
+    return BeginNestedMessage<T>(1);
+  }
+
+
+  using FieldMetadata_SynchronizationMarker =
+    ::protozero::proto_utils::FieldMetadata<
+      36,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBytes,
+      std::string,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SynchronizationMarker kSynchronizationMarker() { return {}; }
+  void set_synchronization_marker(const uint8_t* data, size_t size) {
+    AppendBytes(FieldMetadata_SynchronizationMarker::kFieldId, data, size);
+  }
+  void set_synchronization_marker(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_SynchronizationMarker::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBytes>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_CompressedPackets =
+    ::protozero::proto_utils::FieldMetadata<
+      50,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBytes,
+      std::string,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_CompressedPackets kCompressedPackets() { return {}; }
+  void set_compressed_packets(const uint8_t* data, size_t size) {
+    AppendBytes(FieldMetadata_CompressedPackets::kFieldId, data, size);
+  }
+  void set_compressed_packets(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_CompressedPackets::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBytes>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ExtensionDescriptor =
+    ::protozero::proto_utils::FieldMetadata<
+      72,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      ExtensionDescriptor,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ExtensionDescriptor kExtensionDescriptor() { return {}; }
+  template <typename T = ExtensionDescriptor> T* set_extension_descriptor() {
+    return BeginNestedMessage<T>(72);
+  }
+
+
+  using FieldMetadata_ForTesting =
+    ::protozero::proto_utils::FieldMetadata<
+      900,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TestEvent,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ForTesting kForTesting() { return {}; }
+  template <typename T = TestEvent> T* set_for_testing() {
+    return BeginNestedMessage<T>(900);
+  }
+
+
+  using FieldMetadata_TrustedUid =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TrustedUid kTrustedUid() { return {}; }
+  void set_trusted_uid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TrustedUid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TrustedPacketSequenceId =
+    ::protozero::proto_utils::FieldMetadata<
+      10,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TrustedPacketSequenceId kTrustedPacketSequenceId() { return {}; }
+  void set_trusted_packet_sequence_id(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TrustedPacketSequenceId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_InternedData =
+    ::protozero::proto_utils::FieldMetadata<
+      12,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      InternedData,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_InternedData kInternedData() { return {}; }
+  template <typename T = InternedData> T* set_interned_data() {
+    return BeginNestedMessage<T>(12);
+  }
+
+
+  using FieldMetadata_SequenceFlags =
+    ::protozero::proto_utils::FieldMetadata<
+      13,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SequenceFlags kSequenceFlags() { return {}; }
+  void set_sequence_flags(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SequenceFlags::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_IncrementalStateCleared =
+    ::protozero::proto_utils::FieldMetadata<
+      41,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_IncrementalStateCleared kIncrementalStateCleared() { return {}; }
+  void set_incremental_state_cleared(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_IncrementalStateCleared::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TracePacketDefaults =
+    ::protozero::proto_utils::FieldMetadata<
+      59,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TracePacketDefaults,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TracePacketDefaults kTracePacketDefaults() { return {}; }
+  template <typename T = TracePacketDefaults> T* set_trace_packet_defaults() {
+    return BeginNestedMessage<T>(59);
+  }
+
+
+  using FieldMetadata_PreviousPacketDropped =
+    ::protozero::proto_utils::FieldMetadata<
+      42,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      TracePacket>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_PreviousPacketDropped kPreviousPacketDropped() { return {}; }
+  void set_previous_packet_dropped(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_PreviousPacketDropped::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/trace.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACE_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACE_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class TracePacket;
+
+class Trace_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  Trace_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit Trace_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit Trace_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_packet() const { return at<1>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> packet() const { return GetRepeated<::protozero::ConstBytes>(1); }
+};
+
+class Trace : public ::protozero::Message {
+ public:
+  using Decoder = Trace_Decoder;
+  enum : int32_t {
+    kPacketFieldNumber = 1,
+  };
+
+  using FieldMetadata_Packet =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      TracePacket,
+      Trace>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Packet kPacket() { return {}; }
+  template <typename T = TracePacket> T* add_packet() {
+    return BeginNestedMessage<T>(1);
+  }
+
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/extension_descriptor.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_EXTENSION_DESCRIPTOR_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_EXTENSION_DESCRIPTOR_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class FileDescriptorSet;
+
+class ExtensionDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  ExtensionDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit ExtensionDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit ExtensionDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_extension_set() const { return at<1>().valid(); }
+  ::protozero::ConstBytes extension_set() const { return at<1>().as_bytes(); }
+};
+
+class ExtensionDescriptor : public ::protozero::Message {
+ public:
+  using Decoder = ExtensionDescriptor_Decoder;
+  enum : int32_t {
+    kExtensionSetFieldNumber = 1,
+  };
+
+  using FieldMetadata_ExtensionSet =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      FileDescriptorSet,
+      ExtensionDescriptor>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ExtensionSet kExtensionSet() { return {}; }
+  template <typename T = FileDescriptorSet> T* set_extension_set() {
+    return BeginNestedMessage<T>(1);
+  }
+
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/memory_graph.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_MEMORY_GRAPH_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_MEMORY_GRAPH_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class MemoryTrackerSnapshot_ProcessSnapshot;
+class MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge;
+class MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode;
+class MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry;
+enum MemoryTrackerSnapshot_LevelOfDetail : int32_t;
+enum MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units : int32_t;
+
+enum MemoryTrackerSnapshot_LevelOfDetail : int32_t {
+  MemoryTrackerSnapshot_LevelOfDetail_DETAIL_FULL = 0,
+  MemoryTrackerSnapshot_LevelOfDetail_DETAIL_LIGHT = 1,
+  MemoryTrackerSnapshot_LevelOfDetail_DETAIL_BACKGROUND = 2,
+};
+
+const MemoryTrackerSnapshot_LevelOfDetail MemoryTrackerSnapshot_LevelOfDetail_MIN = MemoryTrackerSnapshot_LevelOfDetail_DETAIL_FULL;
+const MemoryTrackerSnapshot_LevelOfDetail MemoryTrackerSnapshot_LevelOfDetail_MAX = MemoryTrackerSnapshot_LevelOfDetail_DETAIL_BACKGROUND;
+
+enum MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units : int32_t {
+  MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_UNSPECIFIED = 0,
+  MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_BYTES = 1,
+  MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_COUNT = 2,
+};
+
+const MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_MIN = MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_UNSPECIFIED;
+const MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_MAX = MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_COUNT;
+
+class MemoryTrackerSnapshot_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  MemoryTrackerSnapshot_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MemoryTrackerSnapshot_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MemoryTrackerSnapshot_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_global_dump_id() const { return at<1>().valid(); }
+  uint64_t global_dump_id() const { return at<1>().as_uint64(); }
+  bool has_level_of_detail() const { return at<2>().valid(); }
+  int32_t level_of_detail() const { return at<2>().as_int32(); }
+  bool has_process_memory_dumps() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> process_memory_dumps() const { return GetRepeated<::protozero::ConstBytes>(3); }
+};
+
+class MemoryTrackerSnapshot : public ::protozero::Message {
+ public:
+  using Decoder = MemoryTrackerSnapshot_Decoder;
+  enum : int32_t {
+    kGlobalDumpIdFieldNumber = 1,
+    kLevelOfDetailFieldNumber = 2,
+    kProcessMemoryDumpsFieldNumber = 3,
+  };
+  using ProcessSnapshot = ::perfetto::protos::pbzero::MemoryTrackerSnapshot_ProcessSnapshot;
+  using LevelOfDetail = ::perfetto::protos::pbzero::MemoryTrackerSnapshot_LevelOfDetail;
+  static const LevelOfDetail DETAIL_FULL = MemoryTrackerSnapshot_LevelOfDetail_DETAIL_FULL;
+  static const LevelOfDetail DETAIL_LIGHT = MemoryTrackerSnapshot_LevelOfDetail_DETAIL_LIGHT;
+  static const LevelOfDetail DETAIL_BACKGROUND = MemoryTrackerSnapshot_LevelOfDetail_DETAIL_BACKGROUND;
+
+  using FieldMetadata_GlobalDumpId =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MemoryTrackerSnapshot>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_GlobalDumpId kGlobalDumpId() { return {}; }
+  void set_global_dump_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_GlobalDumpId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_LevelOfDetail =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::MemoryTrackerSnapshot_LevelOfDetail,
+      MemoryTrackerSnapshot>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_LevelOfDetail kLevelOfDetail() { return {}; }
+  void set_level_of_detail(::perfetto::protos::pbzero::MemoryTrackerSnapshot_LevelOfDetail value) {
+    static constexpr uint32_t field_id = FieldMetadata_LevelOfDetail::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ProcessMemoryDumps =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MemoryTrackerSnapshot_ProcessSnapshot,
+      MemoryTrackerSnapshot>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ProcessMemoryDumps kProcessMemoryDumps() { return {}; }
+  template <typename T = MemoryTrackerSnapshot_ProcessSnapshot> T* add_process_memory_dumps() {
+    return BeginNestedMessage<T>(3);
+  }
+
+};
+
+class MemoryTrackerSnapshot_ProcessSnapshot_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  MemoryTrackerSnapshot_ProcessSnapshot_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MemoryTrackerSnapshot_ProcessSnapshot_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MemoryTrackerSnapshot_ProcessSnapshot_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_pid() const { return at<1>().valid(); }
+  int32_t pid() const { return at<1>().as_int32(); }
+  bool has_allocator_dumps() const { return at<2>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> allocator_dumps() const { return GetRepeated<::protozero::ConstBytes>(2); }
+  bool has_memory_edges() const { return at<3>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> memory_edges() const { return GetRepeated<::protozero::ConstBytes>(3); }
+};
+
+class MemoryTrackerSnapshot_ProcessSnapshot : public ::protozero::Message {
+ public:
+  using Decoder = MemoryTrackerSnapshot_ProcessSnapshot_Decoder;
+  enum : int32_t {
+    kPidFieldNumber = 1,
+    kAllocatorDumpsFieldNumber = 2,
+    kMemoryEdgesFieldNumber = 3,
+  };
+  using MemoryNode = ::perfetto::protos::pbzero::MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode;
+  using MemoryEdge = ::perfetto::protos::pbzero::MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge;
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt32,
+      int32_t,
+      MemoryTrackerSnapshot_ProcessSnapshot>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(int32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_AllocatorDumps =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode,
+      MemoryTrackerSnapshot_ProcessSnapshot>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AllocatorDumps kAllocatorDumps() { return {}; }
+  template <typename T = MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode> T* add_allocator_dumps() {
+    return BeginNestedMessage<T>(2);
+  }
+
+
+  using FieldMetadata_MemoryEdges =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge,
+      MemoryTrackerSnapshot_ProcessSnapshot>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_MemoryEdges kMemoryEdges() { return {}; }
+  template <typename T = MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge> T* add_memory_edges() {
+    return BeginNestedMessage<T>(3);
+  }
+
+};
+
+class MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_source_id() const { return at<1>().valid(); }
+  uint64_t source_id() const { return at<1>().as_uint64(); }
+  bool has_target_id() const { return at<2>().valid(); }
+  uint64_t target_id() const { return at<2>().as_uint64(); }
+  bool has_importance() const { return at<3>().valid(); }
+  uint32_t importance() const { return at<3>().as_uint32(); }
+  bool has_overridable() const { return at<4>().valid(); }
+  bool overridable() const { return at<4>().as_bool(); }
+};
+
+class MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge : public ::protozero::Message {
+ public:
+  using Decoder = MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge_Decoder;
+  enum : int32_t {
+    kSourceIdFieldNumber = 1,
+    kTargetIdFieldNumber = 2,
+    kImportanceFieldNumber = 3,
+    kOverridableFieldNumber = 4,
+  };
+
+  using FieldMetadata_SourceId =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SourceId kSourceId() { return {}; }
+  void set_source_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SourceId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TargetId =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TargetId kTargetId() { return {}; }
+  void set_target_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TargetId::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Importance =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Importance kImportance() { return {}; }
+  void set_importance(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Importance::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Overridable =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Overridable kOverridable() { return {}; }
+  void set_overridable(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_Overridable::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+};
+
+class MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
+ public:
+  MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_id() const { return at<1>().valid(); }
+  uint64_t id() const { return at<1>().as_uint64(); }
+  bool has_absolute_name() const { return at<2>().valid(); }
+  ::protozero::ConstChars absolute_name() const { return at<2>().as_string(); }
+  bool has_weak() const { return at<3>().valid(); }
+  bool weak() const { return at<3>().as_bool(); }
+  bool has_size_bytes() const { return at<4>().valid(); }
+  uint64_t size_bytes() const { return at<4>().as_uint64(); }
+  bool has_entries() const { return at<5>().valid(); }
+  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> entries() const { return GetRepeated<::protozero::ConstBytes>(5); }
+};
+
+class MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode : public ::protozero::Message {
+ public:
+  using Decoder = MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_Decoder;
+  enum : int32_t {
+    kIdFieldNumber = 1,
+    kAbsoluteNameFieldNumber = 2,
+    kWeakFieldNumber = 3,
+    kSizeBytesFieldNumber = 4,
+    kEntriesFieldNumber = 5,
+  };
+  using MemoryNodeEntry = ::perfetto::protos::pbzero::MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry;
+
+  using FieldMetadata_Id =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Id kId() { return {}; }
+  void set_id(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Id::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_AbsoluteName =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_AbsoluteName kAbsoluteName() { return {}; }
+  void set_absolute_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_AbsoluteName::kFieldId, data, size);
+  }
+  void set_absolute_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_AbsoluteName::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Weak =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kBool,
+      bool,
+      MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Weak kWeak() { return {}; }
+  void set_weak(bool value) {
+    static constexpr uint32_t field_id = FieldMetadata_Weak::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kBool>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_SizeBytes =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_SizeBytes kSizeBytes() { return {}; }
+  void set_size_bytes(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_SizeBytes::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Entries =
+    ::protozero::proto_utils::FieldMetadata<
+      5,
+      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry,
+      MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Entries kEntries() { return {}; }
+  template <typename T = MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry> T* add_entries() {
+    return BeginNestedMessage<T>(5);
+  }
+
+};
+
+class MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_name() const { return at<1>().valid(); }
+  ::protozero::ConstChars name() const { return at<1>().as_string(); }
+  bool has_units() const { return at<2>().valid(); }
+  int32_t units() const { return at<2>().as_int32(); }
+  bool has_value_uint64() const { return at<3>().valid(); }
+  uint64_t value_uint64() const { return at<3>().as_uint64(); }
+  bool has_value_string() const { return at<4>().valid(); }
+  ::protozero::ConstChars value_string() const { return at<4>().as_string(); }
+};
+
+class MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry : public ::protozero::Message {
+ public:
+  using Decoder = MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Decoder;
+  enum : int32_t {
+    kNameFieldNumber = 1,
+    kUnitsFieldNumber = 2,
+    kValueUint64FieldNumber = 3,
+    kValueStringFieldNumber = 4,
+  };
+  using Units = ::perfetto::protos::pbzero::MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units;
+  static const Units UNSPECIFIED = MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_UNSPECIFIED;
+  static const Units BYTES = MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_BYTES;
+  static const Units COUNT = MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_COUNT;
+
+  using FieldMetadata_Name =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Name kName() { return {}; }
+  void set_name(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
+  }
+  void set_name(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Units =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kEnum,
+      ::perfetto::protos::pbzero::MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units,
+      MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Units kUnits() { return {}; }
+  void set_units(::perfetto::protos::pbzero::MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units value) {
+    static constexpr uint32_t field_id = FieldMetadata_Units::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kEnum>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ValueUint64 =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint64,
+      uint64_t,
+      MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ValueUint64 kValueUint64() { return {}; }
+  void set_value_uint64(uint64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_ValueUint64::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_ValueString =
+    ::protozero::proto_utils::FieldMetadata<
+      4,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_ValueString kValueString() { return {}; }
+  void set_value_string(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_ValueString::kFieldId, data, size);
+  }
+  void set_value_string(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_ValueString::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/ui_state.pbzero.h
+// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
+
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_UI_STATE_PROTO_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_UI_STATE_PROTO_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/field_writer.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace perfetto {
+namespace protos {
+namespace pbzero {
+
+class UiState_HighlightProcess;
+
+class UiState_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  UiState_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit UiState_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit UiState_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_timeline_start_ts() const { return at<1>().valid(); }
+  int64_t timeline_start_ts() const { return at<1>().as_int64(); }
+  bool has_timeline_end_ts() const { return at<2>().valid(); }
+  int64_t timeline_end_ts() const { return at<2>().as_int64(); }
+  bool has_highlight_process() const { return at<3>().valid(); }
+  ::protozero::ConstBytes highlight_process() const { return at<3>().as_bytes(); }
+};
+
+class UiState : public ::protozero::Message {
+ public:
+  using Decoder = UiState_Decoder;
+  enum : int32_t {
+    kTimelineStartTsFieldNumber = 1,
+    kTimelineEndTsFieldNumber = 2,
+    kHighlightProcessFieldNumber = 3,
+  };
+  using HighlightProcess = ::perfetto::protos::pbzero::UiState_HighlightProcess;
+
+  using FieldMetadata_TimelineStartTs =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      UiState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TimelineStartTs kTimelineStartTs() { return {}; }
+  void set_timeline_start_ts(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TimelineStartTs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_TimelineEndTs =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kInt64,
+      int64_t,
+      UiState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_TimelineEndTs kTimelineEndTs() { return {}; }
+  void set_timeline_end_ts(int64_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_TimelineEndTs::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kInt64>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_HighlightProcess =
+    ::protozero::proto_utils::FieldMetadata<
+      3,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kMessage,
+      UiState_HighlightProcess,
+      UiState>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_HighlightProcess kHighlightProcess() { return {}; }
+  template <typename T = UiState_HighlightProcess> T* set_highlight_process() {
+    return BeginNestedMessage<T>(3);
+  }
+
+};
+
+class UiState_HighlightProcess_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
+ public:
+  UiState_HighlightProcess_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
+  explicit UiState_HighlightProcess_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
+  explicit UiState_HighlightProcess_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
+  bool has_pid() const { return at<1>().valid(); }
+  uint32_t pid() const { return at<1>().as_uint32(); }
+  bool has_cmdline() const { return at<2>().valid(); }
+  ::protozero::ConstChars cmdline() const { return at<2>().as_string(); }
+};
+
+class UiState_HighlightProcess : public ::protozero::Message {
+ public:
+  using Decoder = UiState_HighlightProcess_Decoder;
+  enum : int32_t {
+    kPidFieldNumber = 1,
+    kCmdlineFieldNumber = 2,
+  };
+
+  using FieldMetadata_Pid =
+    ::protozero::proto_utils::FieldMetadata<
+      1,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kUint32,
+      uint32_t,
+      UiState_HighlightProcess>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Pid kPid() { return {}; }
+  void set_pid(uint32_t value) {
+    static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kUint32>
+        ::Append(*this, field_id, value);
+  }
+
+  using FieldMetadata_Cmdline =
+    ::protozero::proto_utils::FieldMetadata<
+      2,
+      ::protozero::proto_utils::RepetitionType::kNotRepeated,
+      ::protozero::proto_utils::ProtoSchemaType::kString,
+      std::string,
+      UiState_HighlightProcess>;
+
+  // Ceci n'est pas une pipe.
+  // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
+  // type (and users are expected to use it as such, hence kCamelCase name).
+  // It is declared as a function to keep protozero bindings header-only as
+  // inline constexpr variables are not available until C++17 (while inline
+  // functions are).
+  // TODO(altimin): Use inline variable instead after adopting C++17.  
+  static constexpr FieldMetadata_Cmdline kCmdline() { return {}; }
+  void set_cmdline(const char* data, size_t size) {
+    AppendBytes(FieldMetadata_Cmdline::kFieldId, data, size);
+  }
+  void set_cmdline(std::string value) {
+    static constexpr uint32_t field_id = FieldMetadata_Cmdline::kFieldId;
+    // Call the appropriate protozero::Message::Append(field_id, ...)
+    // method based on the type of the field.
+    ::protozero::internal::FieldWriter<
+      ::protozero::proto_utils::ProtoSchemaType::kString>
+        ::Append(*this, field_id, value);
+  }
+};
+
+} // Namespace.
+} // Namespace.
+} // Namespace.
+#endif  // Include guard.
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_application_state_info.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_APPLICATION_STATE_INFO_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_APPLICATION_STATE_INFO_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeApplicationStateInfo;
+enum ChromeApplicationStateInfo_ChromeApplicationState : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum ChromeApplicationStateInfo_ChromeApplicationState : int {
+  ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_UNKNOWN = 0,
+  ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_HAS_RUNNING_ACTIVITIES = 1,
+  ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_HAS_PAUSED_ACTIVITIES = 2,
+  ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_HAS_STOPPED_ACTIVITIES = 3,
+  ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_HAS_DESTROYED_ACTIVITIES = 4,
+};
+
+class PERFETTO_EXPORT ChromeApplicationStateInfo : public ::protozero::CppMessageObj {
+ public:
+  using ChromeApplicationState = ChromeApplicationStateInfo_ChromeApplicationState;
+  static constexpr auto APPLICATION_STATE_UNKNOWN = ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_UNKNOWN;
+  static constexpr auto APPLICATION_STATE_HAS_RUNNING_ACTIVITIES = ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_HAS_RUNNING_ACTIVITIES;
+  static constexpr auto APPLICATION_STATE_HAS_PAUSED_ACTIVITIES = ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_HAS_PAUSED_ACTIVITIES;
+  static constexpr auto APPLICATION_STATE_HAS_STOPPED_ACTIVITIES = ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_HAS_STOPPED_ACTIVITIES;
+  static constexpr auto APPLICATION_STATE_HAS_DESTROYED_ACTIVITIES = ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_HAS_DESTROYED_ACTIVITIES;
+  static constexpr auto ChromeApplicationState_MIN = ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_UNKNOWN;
+  static constexpr auto ChromeApplicationState_MAX = ChromeApplicationStateInfo_ChromeApplicationState_APPLICATION_STATE_HAS_DESTROYED_ACTIVITIES;
+  enum FieldNumbers {
+    kApplicationStateFieldNumber = 1,
+  };
+
+  ChromeApplicationStateInfo();
+  ~ChromeApplicationStateInfo() override;
+  ChromeApplicationStateInfo(ChromeApplicationStateInfo&&) noexcept;
+  ChromeApplicationStateInfo& operator=(ChromeApplicationStateInfo&&);
+  ChromeApplicationStateInfo(const ChromeApplicationStateInfo&);
+  ChromeApplicationStateInfo& operator=(const ChromeApplicationStateInfo&);
+  bool operator==(const ChromeApplicationStateInfo&) const;
+  bool operator!=(const ChromeApplicationStateInfo& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_application_state() const { return _has_field_[1]; }
+  ChromeApplicationStateInfo_ChromeApplicationState application_state() const { return application_state_; }
+  void set_application_state(ChromeApplicationStateInfo_ChromeApplicationState value) { application_state_ = value; _has_field_.set(1); }
+
+ private:
+  ChromeApplicationStateInfo_ChromeApplicationState application_state_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_APPLICATION_STATE_INFO_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_compositor_scheduler_state.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_COMPOSITOR_SCHEDULER_STATE_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_COMPOSITOR_SCHEDULER_STATE_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class CompositorTimingHistory;
+class BeginFrameSourceState;
+class BeginFrameArgs;
+class SourceLocation;
+class BeginFrameObserverState;
+class BeginImplFrameArgs;
+class BeginImplFrameArgs_TimestampsInUs;
+class ChromeCompositorStateMachine;
+class ChromeCompositorStateMachine_MinorState;
+class ChromeCompositorStateMachine_MajorState;
+class ChromeCompositorSchedulerState;
+enum ChromeCompositorSchedulerAction : int;
+enum BeginFrameArgs_BeginFrameArgsType : int;
+enum BeginImplFrameArgs_State : int;
+enum ChromeCompositorStateMachine_MinorState_TreePriority : int;
+enum ChromeCompositorStateMachine_MinorState_ScrollHandlerState : int;
+enum ChromeCompositorStateMachine_MajorState_BeginImplFrameState : int;
+enum ChromeCompositorStateMachine_MajorState_BeginMainFrameState : int;
+enum ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState : int;
+enum ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState : int;
+enum ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum ChromeCompositorSchedulerAction : int {
+  CC_SCHEDULER_ACTION_UNSPECIFIED = 0,
+  CC_SCHEDULER_ACTION_NONE = 1,
+  CC_SCHEDULER_ACTION_SEND_BEGIN_MAIN_FRAME = 2,
+  CC_SCHEDULER_ACTION_COMMIT = 3,
+  CC_SCHEDULER_ACTION_ACTIVATE_SYNC_TREE = 4,
+  CC_SCHEDULER_ACTION_DRAW_IF_POSSIBLE = 5,
+  CC_SCHEDULER_ACTION_DRAW_FORCED = 6,
+  CC_SCHEDULER_ACTION_DRAW_ABORT = 7,
+  CC_SCHEDULER_ACTION_BEGIN_LAYER_TREE_FRAME_SINK_CREATION = 8,
+  CC_SCHEDULER_ACTION_PREPARE_TILES = 9,
+  CC_SCHEDULER_ACTION_INVALIDATE_LAYER_TREE_FRAME_SINK = 10,
+  CC_SCHEDULER_ACTION_PERFORM_IMPL_SIDE_INVALIDATION = 11,
+  CC_SCHEDULER_ACTION_NOTIFY_BEGIN_MAIN_FRAME_NOT_EXPECTED_UNTIL = 12,
+  CC_SCHEDULER_ACTION_NOTIFY_BEGIN_MAIN_FRAME_NOT_EXPECTED_SOON = 13,
+};
+enum BeginFrameArgs_BeginFrameArgsType : int {
+  BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_UNSPECIFIED = 0,
+  BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_INVALID = 1,
+  BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_NORMAL = 2,
+  BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_MISSED = 3,
+};
+enum BeginImplFrameArgs_State : int {
+  BeginImplFrameArgs_State_BEGIN_FRAME_FINISHED = 0,
+  BeginImplFrameArgs_State_BEGIN_FRAME_USING = 1,
+};
+enum ChromeCompositorStateMachine_MinorState_TreePriority : int {
+  ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_UNSPECIFIED = 0,
+  ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_SAME_PRIORITY_FOR_BOTH_TREES = 1,
+  ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_SMOOTHNESS_TAKES_PRIORITY = 2,
+  ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_NEW_CONTENT_TAKES_PRIORITY = 3,
+};
+enum ChromeCompositorStateMachine_MinorState_ScrollHandlerState : int {
+  ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_HANDLER_UNSPECIFIED = 0,
+  ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_AFFECTS_SCROLL_HANDLER = 1,
+  ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_DOES_NOT_AFFECT_SCROLL_HANDLER = 2,
+};
+enum ChromeCompositorStateMachine_MajorState_BeginImplFrameState : int {
+  ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_UNSPECIFIED = 0,
+  ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_IDLE = 1,
+  ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_INSIDE_BEGIN_FRAME = 2,
+  ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_INSIDE_DEADLINE = 3,
+};
+enum ChromeCompositorStateMachine_MajorState_BeginMainFrameState : int {
+  ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_UNSPECIFIED = 0,
+  ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_IDLE = 1,
+  ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_SENT = 2,
+  ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_READY_TO_COMMIT = 3,
+};
+enum ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState : int {
+  ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_UNSPECIFIED = 0,
+  ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_NONE = 1,
+  ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_ACTIVE = 2,
+  ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_CREATING = 3,
+  ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_WAITING_FOR_FIRST_COMMIT = 4,
+  ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_WAITING_FOR_FIRST_ACTIVATION = 5,
+};
+enum ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState : int {
+  ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_UNSPECIFIED = 0,
+  ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_IDLE = 1,
+  ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_COMMIT = 2,
+  ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_ACTIVATION = 3,
+  ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_DRAW = 4,
+};
+enum ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode : int {
+  ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_UNSPECIFIED = 0,
+  ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_NONE = 1,
+  ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_IMMEDIATE = 2,
+  ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_REGULAR = 3,
+  ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_LATE = 4,
+  ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_BLOCKED = 5,
+};
+
+class PERFETTO_EXPORT CompositorTimingHistory : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kBeginMainFrameQueueCriticalEstimateDeltaUsFieldNumber = 1,
+    kBeginMainFrameQueueNotCriticalEstimateDeltaUsFieldNumber = 2,
+    kBeginMainFrameStartToReadyToCommitEstimateDeltaUsFieldNumber = 3,
+    kCommitToReadyToActivateEstimateDeltaUsFieldNumber = 4,
+    kPrepareTilesEstimateDeltaUsFieldNumber = 5,
+    kActivateEstimateDeltaUsFieldNumber = 6,
+    kDrawEstimateDeltaUsFieldNumber = 7,
+  };
+
+  CompositorTimingHistory();
+  ~CompositorTimingHistory() override;
+  CompositorTimingHistory(CompositorTimingHistory&&) noexcept;
+  CompositorTimingHistory& operator=(CompositorTimingHistory&&);
+  CompositorTimingHistory(const CompositorTimingHistory&);
+  CompositorTimingHistory& operator=(const CompositorTimingHistory&);
+  bool operator==(const CompositorTimingHistory&) const;
+  bool operator!=(const CompositorTimingHistory& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_begin_main_frame_queue_critical_estimate_delta_us() const { return _has_field_[1]; }
+  int64_t begin_main_frame_queue_critical_estimate_delta_us() const { return begin_main_frame_queue_critical_estimate_delta_us_; }
+  void set_begin_main_frame_queue_critical_estimate_delta_us(int64_t value) { begin_main_frame_queue_critical_estimate_delta_us_ = value; _has_field_.set(1); }
+
+  bool has_begin_main_frame_queue_not_critical_estimate_delta_us() const { return _has_field_[2]; }
+  int64_t begin_main_frame_queue_not_critical_estimate_delta_us() const { return begin_main_frame_queue_not_critical_estimate_delta_us_; }
+  void set_begin_main_frame_queue_not_critical_estimate_delta_us(int64_t value) { begin_main_frame_queue_not_critical_estimate_delta_us_ = value; _has_field_.set(2); }
+
+  bool has_begin_main_frame_start_to_ready_to_commit_estimate_delta_us() const { return _has_field_[3]; }
+  int64_t begin_main_frame_start_to_ready_to_commit_estimate_delta_us() const { return begin_main_frame_start_to_ready_to_commit_estimate_delta_us_; }
+  void set_begin_main_frame_start_to_ready_to_commit_estimate_delta_us(int64_t value) { begin_main_frame_start_to_ready_to_commit_estimate_delta_us_ = value; _has_field_.set(3); }
+
+  bool has_commit_to_ready_to_activate_estimate_delta_us() const { return _has_field_[4]; }
+  int64_t commit_to_ready_to_activate_estimate_delta_us() const { return commit_to_ready_to_activate_estimate_delta_us_; }
+  void set_commit_to_ready_to_activate_estimate_delta_us(int64_t value) { commit_to_ready_to_activate_estimate_delta_us_ = value; _has_field_.set(4); }
+
+  bool has_prepare_tiles_estimate_delta_us() const { return _has_field_[5]; }
+  int64_t prepare_tiles_estimate_delta_us() const { return prepare_tiles_estimate_delta_us_; }
+  void set_prepare_tiles_estimate_delta_us(int64_t value) { prepare_tiles_estimate_delta_us_ = value; _has_field_.set(5); }
+
+  bool has_activate_estimate_delta_us() const { return _has_field_[6]; }
+  int64_t activate_estimate_delta_us() const { return activate_estimate_delta_us_; }
+  void set_activate_estimate_delta_us(int64_t value) { activate_estimate_delta_us_ = value; _has_field_.set(6); }
+
+  bool has_draw_estimate_delta_us() const { return _has_field_[7]; }
+  int64_t draw_estimate_delta_us() const { return draw_estimate_delta_us_; }
+  void set_draw_estimate_delta_us(int64_t value) { draw_estimate_delta_us_ = value; _has_field_.set(7); }
+
+ private:
+  int64_t begin_main_frame_queue_critical_estimate_delta_us_{};
+  int64_t begin_main_frame_queue_not_critical_estimate_delta_us_{};
+  int64_t begin_main_frame_start_to_ready_to_commit_estimate_delta_us_{};
+  int64_t commit_to_ready_to_activate_estimate_delta_us_{};
+  int64_t prepare_tiles_estimate_delta_us_{};
+  int64_t activate_estimate_delta_us_{};
+  int64_t draw_estimate_delta_us_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<8> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT BeginFrameSourceState : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kSourceIdFieldNumber = 1,
+    kPausedFieldNumber = 2,
+    kNumObserversFieldNumber = 3,
+    kLastBeginFrameArgsFieldNumber = 4,
+  };
+
+  BeginFrameSourceState();
+  ~BeginFrameSourceState() override;
+  BeginFrameSourceState(BeginFrameSourceState&&) noexcept;
+  BeginFrameSourceState& operator=(BeginFrameSourceState&&);
+  BeginFrameSourceState(const BeginFrameSourceState&);
+  BeginFrameSourceState& operator=(const BeginFrameSourceState&);
+  bool operator==(const BeginFrameSourceState&) const;
+  bool operator!=(const BeginFrameSourceState& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_source_id() const { return _has_field_[1]; }
+  uint32_t source_id() const { return source_id_; }
+  void set_source_id(uint32_t value) { source_id_ = value; _has_field_.set(1); }
+
+  bool has_paused() const { return _has_field_[2]; }
+  bool paused() const { return paused_; }
+  void set_paused(bool value) { paused_ = value; _has_field_.set(2); }
+
+  bool has_num_observers() const { return _has_field_[3]; }
+  uint32_t num_observers() const { return num_observers_; }
+  void set_num_observers(uint32_t value) { num_observers_ = value; _has_field_.set(3); }
+
+  bool has_last_begin_frame_args() const { return _has_field_[4]; }
+  const BeginFrameArgs& last_begin_frame_args() const { return *last_begin_frame_args_; }
+  BeginFrameArgs* mutable_last_begin_frame_args() { _has_field_.set(4); return last_begin_frame_args_.get(); }
+
+ private:
+  uint32_t source_id_{};
+  bool paused_{};
+  uint32_t num_observers_{};
+  ::protozero::CopyablePtr<BeginFrameArgs> last_begin_frame_args_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<5> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT BeginFrameArgs : public ::protozero::CppMessageObj {
+ public:
+  using BeginFrameArgsType = BeginFrameArgs_BeginFrameArgsType;
+  static constexpr auto BEGIN_FRAME_ARGS_TYPE_UNSPECIFIED = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_UNSPECIFIED;
+  static constexpr auto BEGIN_FRAME_ARGS_TYPE_INVALID = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_INVALID;
+  static constexpr auto BEGIN_FRAME_ARGS_TYPE_NORMAL = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_NORMAL;
+  static constexpr auto BEGIN_FRAME_ARGS_TYPE_MISSED = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_MISSED;
+  static constexpr auto BeginFrameArgsType_MIN = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_UNSPECIFIED;
+  static constexpr auto BeginFrameArgsType_MAX = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_MISSED;
+  enum FieldNumbers {
+    kTypeFieldNumber = 1,
+    kSourceIdFieldNumber = 2,
+    kSequenceNumberFieldNumber = 3,
+    kFrameTimeUsFieldNumber = 4,
+    kDeadlineUsFieldNumber = 5,
+    kIntervalDeltaUsFieldNumber = 6,
+    kOnCriticalPathFieldNumber = 7,
+    kAnimateOnlyFieldNumber = 8,
+    kSourceLocationIidFieldNumber = 9,
+    kSourceLocationFieldNumber = 10,
+  };
+
+  BeginFrameArgs();
+  ~BeginFrameArgs() override;
+  BeginFrameArgs(BeginFrameArgs&&) noexcept;
+  BeginFrameArgs& operator=(BeginFrameArgs&&);
+  BeginFrameArgs(const BeginFrameArgs&);
+  BeginFrameArgs& operator=(const BeginFrameArgs&);
+  bool operator==(const BeginFrameArgs&) const;
+  bool operator!=(const BeginFrameArgs& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_type() const { return _has_field_[1]; }
+  BeginFrameArgs_BeginFrameArgsType type() const { return type_; }
+  void set_type(BeginFrameArgs_BeginFrameArgsType value) { type_ = value; _has_field_.set(1); }
+
+  bool has_source_id() const { return _has_field_[2]; }
+  uint64_t source_id() const { return source_id_; }
+  void set_source_id(uint64_t value) { source_id_ = value; _has_field_.set(2); }
+
+  bool has_sequence_number() const { return _has_field_[3]; }
+  uint64_t sequence_number() const { return sequence_number_; }
+  void set_sequence_number(uint64_t value) { sequence_number_ = value; _has_field_.set(3); }
+
+  bool has_frame_time_us() const { return _has_field_[4]; }
+  int64_t frame_time_us() const { return frame_time_us_; }
+  void set_frame_time_us(int64_t value) { frame_time_us_ = value; _has_field_.set(4); }
+
+  bool has_deadline_us() const { return _has_field_[5]; }
+  int64_t deadline_us() const { return deadline_us_; }
+  void set_deadline_us(int64_t value) { deadline_us_ = value; _has_field_.set(5); }
+
+  bool has_interval_delta_us() const { return _has_field_[6]; }
+  int64_t interval_delta_us() const { return interval_delta_us_; }
+  void set_interval_delta_us(int64_t value) { interval_delta_us_ = value; _has_field_.set(6); }
+
+  bool has_on_critical_path() const { return _has_field_[7]; }
+  bool on_critical_path() const { return on_critical_path_; }
+  void set_on_critical_path(bool value) { on_critical_path_ = value; _has_field_.set(7); }
+
+  bool has_animate_only() const { return _has_field_[8]; }
+  bool animate_only() const { return animate_only_; }
+  void set_animate_only(bool value) { animate_only_ = value; _has_field_.set(8); }
+
+  bool has_source_location_iid() const { return _has_field_[9]; }
+  uint64_t source_location_iid() const { return source_location_iid_; }
+  void set_source_location_iid(uint64_t value) { source_location_iid_ = value; _has_field_.set(9); }
+
+  bool has_source_location() const { return _has_field_[10]; }
+  const SourceLocation& source_location() const { return *source_location_; }
+  SourceLocation* mutable_source_location() { _has_field_.set(10); return source_location_.get(); }
+
+ private:
+  BeginFrameArgs_BeginFrameArgsType type_{};
+  uint64_t source_id_{};
+  uint64_t sequence_number_{};
+  int64_t frame_time_us_{};
+  int64_t deadline_us_{};
+  int64_t interval_delta_us_{};
+  bool on_critical_path_{};
+  bool animate_only_{};
+  uint64_t source_location_iid_{};
+  ::protozero::CopyablePtr<SourceLocation> source_location_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<11> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT BeginFrameObserverState : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDroppedBeginFrameArgsFieldNumber = 1,
+    kLastBeginFrameArgsFieldNumber = 2,
+  };
+
+  BeginFrameObserverState();
+  ~BeginFrameObserverState() override;
+  BeginFrameObserverState(BeginFrameObserverState&&) noexcept;
+  BeginFrameObserverState& operator=(BeginFrameObserverState&&);
+  BeginFrameObserverState(const BeginFrameObserverState&);
+  BeginFrameObserverState& operator=(const BeginFrameObserverState&);
+  bool operator==(const BeginFrameObserverState&) const;
+  bool operator!=(const BeginFrameObserverState& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_dropped_begin_frame_args() const { return _has_field_[1]; }
+  int64_t dropped_begin_frame_args() const { return dropped_begin_frame_args_; }
+  void set_dropped_begin_frame_args(int64_t value) { dropped_begin_frame_args_ = value; _has_field_.set(1); }
+
+  bool has_last_begin_frame_args() const { return _has_field_[2]; }
+  const BeginFrameArgs& last_begin_frame_args() const { return *last_begin_frame_args_; }
+  BeginFrameArgs* mutable_last_begin_frame_args() { _has_field_.set(2); return last_begin_frame_args_.get(); }
+
+ private:
+  int64_t dropped_begin_frame_args_{};
+  ::protozero::CopyablePtr<BeginFrameArgs> last_begin_frame_args_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT BeginImplFrameArgs : public ::protozero::CppMessageObj {
+ public:
+  using TimestampsInUs = BeginImplFrameArgs_TimestampsInUs;
+  using State = BeginImplFrameArgs_State;
+  static constexpr auto BEGIN_FRAME_FINISHED = BeginImplFrameArgs_State_BEGIN_FRAME_FINISHED;
+  static constexpr auto BEGIN_FRAME_USING = BeginImplFrameArgs_State_BEGIN_FRAME_USING;
+  static constexpr auto State_MIN = BeginImplFrameArgs_State_BEGIN_FRAME_FINISHED;
+  static constexpr auto State_MAX = BeginImplFrameArgs_State_BEGIN_FRAME_USING;
+  enum FieldNumbers {
+    kUpdatedAtUsFieldNumber = 1,
+    kFinishedAtUsFieldNumber = 2,
+    kStateFieldNumber = 3,
+    kCurrentArgsFieldNumber = 4,
+    kLastArgsFieldNumber = 5,
+    kTimestampsInUsFieldNumber = 6,
+  };
+
+  BeginImplFrameArgs();
+  ~BeginImplFrameArgs() override;
+  BeginImplFrameArgs(BeginImplFrameArgs&&) noexcept;
+  BeginImplFrameArgs& operator=(BeginImplFrameArgs&&);
+  BeginImplFrameArgs(const BeginImplFrameArgs&);
+  BeginImplFrameArgs& operator=(const BeginImplFrameArgs&);
+  bool operator==(const BeginImplFrameArgs&) const;
+  bool operator!=(const BeginImplFrameArgs& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_updated_at_us() const { return _has_field_[1]; }
+  int64_t updated_at_us() const { return updated_at_us_; }
+  void set_updated_at_us(int64_t value) { updated_at_us_ = value; _has_field_.set(1); }
+
+  bool has_finished_at_us() const { return _has_field_[2]; }
+  int64_t finished_at_us() const { return finished_at_us_; }
+  void set_finished_at_us(int64_t value) { finished_at_us_ = value; _has_field_.set(2); }
+
+  bool has_state() const { return _has_field_[3]; }
+  BeginImplFrameArgs_State state() const { return state_; }
+  void set_state(BeginImplFrameArgs_State value) { state_ = value; _has_field_.set(3); }
+
+  bool has_current_args() const { return _has_field_[4]; }
+  const BeginFrameArgs& current_args() const { return *current_args_; }
+  BeginFrameArgs* mutable_current_args() { _has_field_.set(4); return current_args_.get(); }
+
+  bool has_last_args() const { return _has_field_[5]; }
+  const BeginFrameArgs& last_args() const { return *last_args_; }
+  BeginFrameArgs* mutable_last_args() { _has_field_.set(5); return last_args_.get(); }
+
+  bool has_timestamps_in_us() const { return _has_field_[6]; }
+  const BeginImplFrameArgs_TimestampsInUs& timestamps_in_us() const { return *timestamps_in_us_; }
+  BeginImplFrameArgs_TimestampsInUs* mutable_timestamps_in_us() { _has_field_.set(6); return timestamps_in_us_.get(); }
+
+ private:
+  int64_t updated_at_us_{};
+  int64_t finished_at_us_{};
+  BeginImplFrameArgs_State state_{};
+  ::protozero::CopyablePtr<BeginFrameArgs> current_args_;
+  ::protozero::CopyablePtr<BeginFrameArgs> last_args_;
+  ::protozero::CopyablePtr<BeginImplFrameArgs_TimestampsInUs> timestamps_in_us_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<7> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT BeginImplFrameArgs_TimestampsInUs : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kIntervalDeltaFieldNumber = 1,
+    kNowToDeadlineDeltaFieldNumber = 2,
+    kFrameTimeToNowDeltaFieldNumber = 3,
+    kFrameTimeToDeadlineDeltaFieldNumber = 4,
+    kNowFieldNumber = 5,
+    kFrameTimeFieldNumber = 6,
+    kDeadlineFieldNumber = 7,
+  };
+
+  BeginImplFrameArgs_TimestampsInUs();
+  ~BeginImplFrameArgs_TimestampsInUs() override;
+  BeginImplFrameArgs_TimestampsInUs(BeginImplFrameArgs_TimestampsInUs&&) noexcept;
+  BeginImplFrameArgs_TimestampsInUs& operator=(BeginImplFrameArgs_TimestampsInUs&&);
+  BeginImplFrameArgs_TimestampsInUs(const BeginImplFrameArgs_TimestampsInUs&);
+  BeginImplFrameArgs_TimestampsInUs& operator=(const BeginImplFrameArgs_TimestampsInUs&);
+  bool operator==(const BeginImplFrameArgs_TimestampsInUs&) const;
+  bool operator!=(const BeginImplFrameArgs_TimestampsInUs& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_interval_delta() const { return _has_field_[1]; }
+  int64_t interval_delta() const { return interval_delta_; }
+  void set_interval_delta(int64_t value) { interval_delta_ = value; _has_field_.set(1); }
+
+  bool has_now_to_deadline_delta() const { return _has_field_[2]; }
+  int64_t now_to_deadline_delta() const { return now_to_deadline_delta_; }
+  void set_now_to_deadline_delta(int64_t value) { now_to_deadline_delta_ = value; _has_field_.set(2); }
+
+  bool has_frame_time_to_now_delta() const { return _has_field_[3]; }
+  int64_t frame_time_to_now_delta() const { return frame_time_to_now_delta_; }
+  void set_frame_time_to_now_delta(int64_t value) { frame_time_to_now_delta_ = value; _has_field_.set(3); }
+
+  bool has_frame_time_to_deadline_delta() const { return _has_field_[4]; }
+  int64_t frame_time_to_deadline_delta() const { return frame_time_to_deadline_delta_; }
+  void set_frame_time_to_deadline_delta(int64_t value) { frame_time_to_deadline_delta_ = value; _has_field_.set(4); }
+
+  bool has_now() const { return _has_field_[5]; }
+  int64_t now() const { return now_; }
+  void set_now(int64_t value) { now_ = value; _has_field_.set(5); }
+
+  bool has_frame_time() const { return _has_field_[6]; }
+  int64_t frame_time() const { return frame_time_; }
+  void set_frame_time(int64_t value) { frame_time_ = value; _has_field_.set(6); }
+
+  bool has_deadline() const { return _has_field_[7]; }
+  int64_t deadline() const { return deadline_; }
+  void set_deadline(int64_t value) { deadline_ = value; _has_field_.set(7); }
+
+ private:
+  int64_t interval_delta_{};
+  int64_t now_to_deadline_delta_{};
+  int64_t frame_time_to_now_delta_{};
+  int64_t frame_time_to_deadline_delta_{};
+  int64_t now_{};
+  int64_t frame_time_{};
+  int64_t deadline_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<8> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ChromeCompositorStateMachine : public ::protozero::CppMessageObj {
+ public:
+  using MajorState = ChromeCompositorStateMachine_MajorState;
+  using MinorState = ChromeCompositorStateMachine_MinorState;
+  enum FieldNumbers {
+    kMajorStateFieldNumber = 1,
+    kMinorStateFieldNumber = 2,
+  };
+
+  ChromeCompositorStateMachine();
+  ~ChromeCompositorStateMachine() override;
+  ChromeCompositorStateMachine(ChromeCompositorStateMachine&&) noexcept;
+  ChromeCompositorStateMachine& operator=(ChromeCompositorStateMachine&&);
+  ChromeCompositorStateMachine(const ChromeCompositorStateMachine&);
+  ChromeCompositorStateMachine& operator=(const ChromeCompositorStateMachine&);
+  bool operator==(const ChromeCompositorStateMachine&) const;
+  bool operator!=(const ChromeCompositorStateMachine& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_major_state() const { return _has_field_[1]; }
+  const ChromeCompositorStateMachine_MajorState& major_state() const { return *major_state_; }
+  ChromeCompositorStateMachine_MajorState* mutable_major_state() { _has_field_.set(1); return major_state_.get(); }
+
+  bool has_minor_state() const { return _has_field_[2]; }
+  const ChromeCompositorStateMachine_MinorState& minor_state() const { return *minor_state_; }
+  ChromeCompositorStateMachine_MinorState* mutable_minor_state() { _has_field_.set(2); return minor_state_.get(); }
+
+ private:
+  ::protozero::CopyablePtr<ChromeCompositorStateMachine_MajorState> major_state_;
+  ::protozero::CopyablePtr<ChromeCompositorStateMachine_MinorState> minor_state_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ChromeCompositorStateMachine_MinorState : public ::protozero::CppMessageObj {
+ public:
+  using TreePriority = ChromeCompositorStateMachine_MinorState_TreePriority;
+  static constexpr auto TREE_PRIORITY_UNSPECIFIED = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_UNSPECIFIED;
+  static constexpr auto TREE_PRIORITY_SAME_PRIORITY_FOR_BOTH_TREES = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_SAME_PRIORITY_FOR_BOTH_TREES;
+  static constexpr auto TREE_PRIORITY_SMOOTHNESS_TAKES_PRIORITY = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_SMOOTHNESS_TAKES_PRIORITY;
+  static constexpr auto TREE_PRIORITY_NEW_CONTENT_TAKES_PRIORITY = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_NEW_CONTENT_TAKES_PRIORITY;
+  static constexpr auto TreePriority_MIN = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_UNSPECIFIED;
+  static constexpr auto TreePriority_MAX = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_NEW_CONTENT_TAKES_PRIORITY;
+  using ScrollHandlerState = ChromeCompositorStateMachine_MinorState_ScrollHandlerState;
+  static constexpr auto SCROLL_HANDLER_UNSPECIFIED = ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_HANDLER_UNSPECIFIED;
+  static constexpr auto SCROLL_AFFECTS_SCROLL_HANDLER = ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_AFFECTS_SCROLL_HANDLER;
+  static constexpr auto SCROLL_DOES_NOT_AFFECT_SCROLL_HANDLER = ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_DOES_NOT_AFFECT_SCROLL_HANDLER;
+  static constexpr auto ScrollHandlerState_MIN = ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_HANDLER_UNSPECIFIED;
+  static constexpr auto ScrollHandlerState_MAX = ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_DOES_NOT_AFFECT_SCROLL_HANDLER;
+  enum FieldNumbers {
+    kCommitCountFieldNumber = 1,
+    kCurrentFrameNumberFieldNumber = 2,
+    kLastFrameNumberSubmitPerformedFieldNumber = 3,
+    kLastFrameNumberDrawPerformedFieldNumber = 4,
+    kLastFrameNumberBeginMainFrameSentFieldNumber = 5,
+    kDidDrawFieldNumber = 6,
+    kDidSendBeginMainFrameForCurrentFrameFieldNumber = 7,
+    kDidNotifyBeginMainFrameNotExpectedUntilFieldNumber = 8,
+    kDidNotifyBeginMainFrameNotExpectedSoonFieldNumber = 9,
+    kWantsBeginMainFrameNotExpectedFieldNumber = 10,
+    kDidCommitDuringFrameFieldNumber = 11,
+    kDidInvalidateLayerTreeFrameSinkFieldNumber = 12,
+    kDidPerformImplSideInvalidaionFieldNumber = 13,
+    kDidPrepareTilesFieldNumber = 14,
+    kConsecutiveCheckerboardAnimationsFieldNumber = 15,
+    kPendingSubmitFramesFieldNumber = 16,
+    kSubmitFramesWithCurrentLayerTreeFrameSinkFieldNumber = 17,
+    kNeedsRedrawFieldNumber = 18,
+    kNeedsPrepareTilesFieldNumber = 19,
+    kNeedsBeginMainFrameFieldNumber = 20,
+    kNeedsOneBeginImplFrameFieldNumber = 21,
+    kVisibleFieldNumber = 22,
+    kBeginFrameSourcePausedFieldNumber = 23,
+    kCanDrawFieldNumber = 24,
+    kResourcelessDrawFieldNumber = 25,
+    kHasPendingTreeFieldNumber = 26,
+    kPendingTreeIsReadyForActivationFieldNumber = 27,
+    kActiveTreeNeedsFirstDrawFieldNumber = 28,
+    kActiveTreeIsReadyToDrawFieldNumber = 29,
+    kDidCreateAndInitializeFirstLayerTreeFrameSinkFieldNumber = 30,
+    kTreePriorityFieldNumber = 31,
+    kScrollHandlerStateFieldNumber = 32,
+    kCriticalBeginMainFrameToActivateIsFastFieldNumber = 33,
+    kMainThreadMissedLastDeadlineFieldNumber = 34,
+    kSkipNextBeginMainFrameToReduceLatencyFieldNumber = 35,
+    kVideoNeedsBeginFramesFieldNumber = 36,
+    kDeferBeginMainFrameFieldNumber = 37,
+    kLastCommitHadNoUpdatesFieldNumber = 38,
+    kDidDrawInLastFrameFieldNumber = 39,
+    kDidSubmitInLastFrameFieldNumber = 40,
+    kNeedsImplSideInvalidationFieldNumber = 41,
+    kCurrentPendingTreeIsImplSideFieldNumber = 42,
+    kPreviousPendingTreeWasImplSideFieldNumber = 43,
+    kProcessingAnimationWorkletsForActiveTreeFieldNumber = 44,
+    kProcessingAnimationWorkletsForPendingTreeFieldNumber = 45,
+    kProcessingPaintWorkletsForPendingTreeFieldNumber = 46,
+  };
+
+  ChromeCompositorStateMachine_MinorState();
+  ~ChromeCompositorStateMachine_MinorState() override;
+  ChromeCompositorStateMachine_MinorState(ChromeCompositorStateMachine_MinorState&&) noexcept;
+  ChromeCompositorStateMachine_MinorState& operator=(ChromeCompositorStateMachine_MinorState&&);
+  ChromeCompositorStateMachine_MinorState(const ChromeCompositorStateMachine_MinorState&);
+  ChromeCompositorStateMachine_MinorState& operator=(const ChromeCompositorStateMachine_MinorState&);
+  bool operator==(const ChromeCompositorStateMachine_MinorState&) const;
+  bool operator!=(const ChromeCompositorStateMachine_MinorState& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_commit_count() const { return _has_field_[1]; }
+  int32_t commit_count() const { return commit_count_; }
+  void set_commit_count(int32_t value) { commit_count_ = value; _has_field_.set(1); }
+
+  bool has_current_frame_number() const { return _has_field_[2]; }
+  int32_t current_frame_number() const { return current_frame_number_; }
+  void set_current_frame_number(int32_t value) { current_frame_number_ = value; _has_field_.set(2); }
+
+  bool has_last_frame_number_submit_performed() const { return _has_field_[3]; }
+  int32_t last_frame_number_submit_performed() const { return last_frame_number_submit_performed_; }
+  void set_last_frame_number_submit_performed(int32_t value) { last_frame_number_submit_performed_ = value; _has_field_.set(3); }
+
+  bool has_last_frame_number_draw_performed() const { return _has_field_[4]; }
+  int32_t last_frame_number_draw_performed() const { return last_frame_number_draw_performed_; }
+  void set_last_frame_number_draw_performed(int32_t value) { last_frame_number_draw_performed_ = value; _has_field_.set(4); }
+
+  bool has_last_frame_number_begin_main_frame_sent() const { return _has_field_[5]; }
+  int32_t last_frame_number_begin_main_frame_sent() const { return last_frame_number_begin_main_frame_sent_; }
+  void set_last_frame_number_begin_main_frame_sent(int32_t value) { last_frame_number_begin_main_frame_sent_ = value; _has_field_.set(5); }
+
+  bool has_did_draw() const { return _has_field_[6]; }
+  bool did_draw() const { return did_draw_; }
+  void set_did_draw(bool value) { did_draw_ = value; _has_field_.set(6); }
+
+  bool has_did_send_begin_main_frame_for_current_frame() const { return _has_field_[7]; }
+  bool did_send_begin_main_frame_for_current_frame() const { return did_send_begin_main_frame_for_current_frame_; }
+  void set_did_send_begin_main_frame_for_current_frame(bool value) { did_send_begin_main_frame_for_current_frame_ = value; _has_field_.set(7); }
+
+  bool has_did_notify_begin_main_frame_not_expected_until() const { return _has_field_[8]; }
+  bool did_notify_begin_main_frame_not_expected_until() const { return did_notify_begin_main_frame_not_expected_until_; }
+  void set_did_notify_begin_main_frame_not_expected_until(bool value) { did_notify_begin_main_frame_not_expected_until_ = value; _has_field_.set(8); }
+
+  bool has_did_notify_begin_main_frame_not_expected_soon() const { return _has_field_[9]; }
+  bool did_notify_begin_main_frame_not_expected_soon() const { return did_notify_begin_main_frame_not_expected_soon_; }
+  void set_did_notify_begin_main_frame_not_expected_soon(bool value) { did_notify_begin_main_frame_not_expected_soon_ = value; _has_field_.set(9); }
+
+  bool has_wants_begin_main_frame_not_expected() const { return _has_field_[10]; }
+  bool wants_begin_main_frame_not_expected() const { return wants_begin_main_frame_not_expected_; }
+  void set_wants_begin_main_frame_not_expected(bool value) { wants_begin_main_frame_not_expected_ = value; _has_field_.set(10); }
+
+  bool has_did_commit_during_frame() const { return _has_field_[11]; }
+  bool did_commit_during_frame() const { return did_commit_during_frame_; }
+  void set_did_commit_during_frame(bool value) { did_commit_during_frame_ = value; _has_field_.set(11); }
+
+  bool has_did_invalidate_layer_tree_frame_sink() const { return _has_field_[12]; }
+  bool did_invalidate_layer_tree_frame_sink() const { return did_invalidate_layer_tree_frame_sink_; }
+  void set_did_invalidate_layer_tree_frame_sink(bool value) { did_invalidate_layer_tree_frame_sink_ = value; _has_field_.set(12); }
+
+  bool has_did_perform_impl_side_invalidaion() const { return _has_field_[13]; }
+  bool did_perform_impl_side_invalidaion() const { return did_perform_impl_side_invalidaion_; }
+  void set_did_perform_impl_side_invalidaion(bool value) { did_perform_impl_side_invalidaion_ = value; _has_field_.set(13); }
+
+  bool has_did_prepare_tiles() const { return _has_field_[14]; }
+  bool did_prepare_tiles() const { return did_prepare_tiles_; }
+  void set_did_prepare_tiles(bool value) { did_prepare_tiles_ = value; _has_field_.set(14); }
+
+  bool has_consecutive_checkerboard_animations() const { return _has_field_[15]; }
+  int32_t consecutive_checkerboard_animations() const { return consecutive_checkerboard_animations_; }
+  void set_consecutive_checkerboard_animations(int32_t value) { consecutive_checkerboard_animations_ = value; _has_field_.set(15); }
+
+  bool has_pending_submit_frames() const { return _has_field_[16]; }
+  int32_t pending_submit_frames() const { return pending_submit_frames_; }
+  void set_pending_submit_frames(int32_t value) { pending_submit_frames_ = value; _has_field_.set(16); }
+
+  bool has_submit_frames_with_current_layer_tree_frame_sink() const { return _has_field_[17]; }
+  int32_t submit_frames_with_current_layer_tree_frame_sink() const { return submit_frames_with_current_layer_tree_frame_sink_; }
+  void set_submit_frames_with_current_layer_tree_frame_sink(int32_t value) { submit_frames_with_current_layer_tree_frame_sink_ = value; _has_field_.set(17); }
+
+  bool has_needs_redraw() const { return _has_field_[18]; }
+  bool needs_redraw() const { return needs_redraw_; }
+  void set_needs_redraw(bool value) { needs_redraw_ = value; _has_field_.set(18); }
+
+  bool has_needs_prepare_tiles() const { return _has_field_[19]; }
+  bool needs_prepare_tiles() const { return needs_prepare_tiles_; }
+  void set_needs_prepare_tiles(bool value) { needs_prepare_tiles_ = value; _has_field_.set(19); }
+
+  bool has_needs_begin_main_frame() const { return _has_field_[20]; }
+  bool needs_begin_main_frame() const { return needs_begin_main_frame_; }
+  void set_needs_begin_main_frame(bool value) { needs_begin_main_frame_ = value; _has_field_.set(20); }
+
+  bool has_needs_one_begin_impl_frame() const { return _has_field_[21]; }
+  bool needs_one_begin_impl_frame() const { return needs_one_begin_impl_frame_; }
+  void set_needs_one_begin_impl_frame(bool value) { needs_one_begin_impl_frame_ = value; _has_field_.set(21); }
+
+  bool has_visible() const { return _has_field_[22]; }
+  bool visible() const { return visible_; }
+  void set_visible(bool value) { visible_ = value; _has_field_.set(22); }
+
+  bool has_begin_frame_source_paused() const { return _has_field_[23]; }
+  bool begin_frame_source_paused() const { return begin_frame_source_paused_; }
+  void set_begin_frame_source_paused(bool value) { begin_frame_source_paused_ = value; _has_field_.set(23); }
+
+  bool has_can_draw() const { return _has_field_[24]; }
+  bool can_draw() const { return can_draw_; }
+  void set_can_draw(bool value) { can_draw_ = value; _has_field_.set(24); }
+
+  bool has_resourceless_draw() const { return _has_field_[25]; }
+  bool resourceless_draw() const { return resourceless_draw_; }
+  void set_resourceless_draw(bool value) { resourceless_draw_ = value; _has_field_.set(25); }
+
+  bool has_has_pending_tree() const { return _has_field_[26]; }
+  bool has_pending_tree() const { return has_pending_tree_; }
+  void set_has_pending_tree(bool value) { has_pending_tree_ = value; _has_field_.set(26); }
+
+  bool has_pending_tree_is_ready_for_activation() const { return _has_field_[27]; }
+  bool pending_tree_is_ready_for_activation() const { return pending_tree_is_ready_for_activation_; }
+  void set_pending_tree_is_ready_for_activation(bool value) { pending_tree_is_ready_for_activation_ = value; _has_field_.set(27); }
+
+  bool has_active_tree_needs_first_draw() const { return _has_field_[28]; }
+  bool active_tree_needs_first_draw() const { return active_tree_needs_first_draw_; }
+  void set_active_tree_needs_first_draw(bool value) { active_tree_needs_first_draw_ = value; _has_field_.set(28); }
+
+  bool has_active_tree_is_ready_to_draw() const { return _has_field_[29]; }
+  bool active_tree_is_ready_to_draw() const { return active_tree_is_ready_to_draw_; }
+  void set_active_tree_is_ready_to_draw(bool value) { active_tree_is_ready_to_draw_ = value; _has_field_.set(29); }
+
+  bool has_did_create_and_initialize_first_layer_tree_frame_sink() const { return _has_field_[30]; }
+  bool did_create_and_initialize_first_layer_tree_frame_sink() const { return did_create_and_initialize_first_layer_tree_frame_sink_; }
+  void set_did_create_and_initialize_first_layer_tree_frame_sink(bool value) { did_create_and_initialize_first_layer_tree_frame_sink_ = value; _has_field_.set(30); }
+
+  bool has_tree_priority() const { return _has_field_[31]; }
+  ChromeCompositorStateMachine_MinorState_TreePriority tree_priority() const { return tree_priority_; }
+  void set_tree_priority(ChromeCompositorStateMachine_MinorState_TreePriority value) { tree_priority_ = value; _has_field_.set(31); }
+
+  bool has_scroll_handler_state() const { return _has_field_[32]; }
+  ChromeCompositorStateMachine_MinorState_ScrollHandlerState scroll_handler_state() const { return scroll_handler_state_; }
+  void set_scroll_handler_state(ChromeCompositorStateMachine_MinorState_ScrollHandlerState value) { scroll_handler_state_ = value; _has_field_.set(32); }
+
+  bool has_critical_begin_main_frame_to_activate_is_fast() const { return _has_field_[33]; }
+  bool critical_begin_main_frame_to_activate_is_fast() const { return critical_begin_main_frame_to_activate_is_fast_; }
+  void set_critical_begin_main_frame_to_activate_is_fast(bool value) { critical_begin_main_frame_to_activate_is_fast_ = value; _has_field_.set(33); }
+
+  bool has_main_thread_missed_last_deadline() const { return _has_field_[34]; }
+  bool main_thread_missed_last_deadline() const { return main_thread_missed_last_deadline_; }
+  void set_main_thread_missed_last_deadline(bool value) { main_thread_missed_last_deadline_ = value; _has_field_.set(34); }
+
+  bool has_skip_next_begin_main_frame_to_reduce_latency() const { return _has_field_[35]; }
+  bool skip_next_begin_main_frame_to_reduce_latency() const { return skip_next_begin_main_frame_to_reduce_latency_; }
+  void set_skip_next_begin_main_frame_to_reduce_latency(bool value) { skip_next_begin_main_frame_to_reduce_latency_ = value; _has_field_.set(35); }
+
+  bool has_video_needs_begin_frames() const { return _has_field_[36]; }
+  bool video_needs_begin_frames() const { return video_needs_begin_frames_; }
+  void set_video_needs_begin_frames(bool value) { video_needs_begin_frames_ = value; _has_field_.set(36); }
+
+  bool has_defer_begin_main_frame() const { return _has_field_[37]; }
+  bool defer_begin_main_frame() const { return defer_begin_main_frame_; }
+  void set_defer_begin_main_frame(bool value) { defer_begin_main_frame_ = value; _has_field_.set(37); }
+
+  bool has_last_commit_had_no_updates() const { return _has_field_[38]; }
+  bool last_commit_had_no_updates() const { return last_commit_had_no_updates_; }
+  void set_last_commit_had_no_updates(bool value) { last_commit_had_no_updates_ = value; _has_field_.set(38); }
+
+  bool has_did_draw_in_last_frame() const { return _has_field_[39]; }
+  bool did_draw_in_last_frame() const { return did_draw_in_last_frame_; }
+  void set_did_draw_in_last_frame(bool value) { did_draw_in_last_frame_ = value; _has_field_.set(39); }
+
+  bool has_did_submit_in_last_frame() const { return _has_field_[40]; }
+  bool did_submit_in_last_frame() const { return did_submit_in_last_frame_; }
+  void set_did_submit_in_last_frame(bool value) { did_submit_in_last_frame_ = value; _has_field_.set(40); }
+
+  bool has_needs_impl_side_invalidation() const { return _has_field_[41]; }
+  bool needs_impl_side_invalidation() const { return needs_impl_side_invalidation_; }
+  void set_needs_impl_side_invalidation(bool value) { needs_impl_side_invalidation_ = value; _has_field_.set(41); }
+
+  bool has_current_pending_tree_is_impl_side() const { return _has_field_[42]; }
+  bool current_pending_tree_is_impl_side() const { return current_pending_tree_is_impl_side_; }
+  void set_current_pending_tree_is_impl_side(bool value) { current_pending_tree_is_impl_side_ = value; _has_field_.set(42); }
+
+  bool has_previous_pending_tree_was_impl_side() const { return _has_field_[43]; }
+  bool previous_pending_tree_was_impl_side() const { return previous_pending_tree_was_impl_side_; }
+  void set_previous_pending_tree_was_impl_side(bool value) { previous_pending_tree_was_impl_side_ = value; _has_field_.set(43); }
+
+  bool has_processing_animation_worklets_for_active_tree() const { return _has_field_[44]; }
+  bool processing_animation_worklets_for_active_tree() const { return processing_animation_worklets_for_active_tree_; }
+  void set_processing_animation_worklets_for_active_tree(bool value) { processing_animation_worklets_for_active_tree_ = value; _has_field_.set(44); }
+
+  bool has_processing_animation_worklets_for_pending_tree() const { return _has_field_[45]; }
+  bool processing_animation_worklets_for_pending_tree() const { return processing_animation_worklets_for_pending_tree_; }
+  void set_processing_animation_worklets_for_pending_tree(bool value) { processing_animation_worklets_for_pending_tree_ = value; _has_field_.set(45); }
+
+  bool has_processing_paint_worklets_for_pending_tree() const { return _has_field_[46]; }
+  bool processing_paint_worklets_for_pending_tree() const { return processing_paint_worklets_for_pending_tree_; }
+  void set_processing_paint_worklets_for_pending_tree(bool value) { processing_paint_worklets_for_pending_tree_ = value; _has_field_.set(46); }
+
+ private:
+  int32_t commit_count_{};
+  int32_t current_frame_number_{};
+  int32_t last_frame_number_submit_performed_{};
+  int32_t last_frame_number_draw_performed_{};
+  int32_t last_frame_number_begin_main_frame_sent_{};
+  bool did_draw_{};
+  bool did_send_begin_main_frame_for_current_frame_{};
+  bool did_notify_begin_main_frame_not_expected_until_{};
+  bool did_notify_begin_main_frame_not_expected_soon_{};
+  bool wants_begin_main_frame_not_expected_{};
+  bool did_commit_during_frame_{};
+  bool did_invalidate_layer_tree_frame_sink_{};
+  bool did_perform_impl_side_invalidaion_{};
+  bool did_prepare_tiles_{};
+  int32_t consecutive_checkerboard_animations_{};
+  int32_t pending_submit_frames_{};
+  int32_t submit_frames_with_current_layer_tree_frame_sink_{};
+  bool needs_redraw_{};
+  bool needs_prepare_tiles_{};
+  bool needs_begin_main_frame_{};
+  bool needs_one_begin_impl_frame_{};
+  bool visible_{};
+  bool begin_frame_source_paused_{};
+  bool can_draw_{};
+  bool resourceless_draw_{};
+  bool has_pending_tree_{};
+  bool pending_tree_is_ready_for_activation_{};
+  bool active_tree_needs_first_draw_{};
+  bool active_tree_is_ready_to_draw_{};
+  bool did_create_and_initialize_first_layer_tree_frame_sink_{};
+  ChromeCompositorStateMachine_MinorState_TreePriority tree_priority_{};
+  ChromeCompositorStateMachine_MinorState_ScrollHandlerState scroll_handler_state_{};
+  bool critical_begin_main_frame_to_activate_is_fast_{};
+  bool main_thread_missed_last_deadline_{};
+  bool skip_next_begin_main_frame_to_reduce_latency_{};
+  bool video_needs_begin_frames_{};
+  bool defer_begin_main_frame_{};
+  bool last_commit_had_no_updates_{};
+  bool did_draw_in_last_frame_{};
+  bool did_submit_in_last_frame_{};
+  bool needs_impl_side_invalidation_{};
+  bool current_pending_tree_is_impl_side_{};
+  bool previous_pending_tree_was_impl_side_{};
+  bool processing_animation_worklets_for_active_tree_{};
+  bool processing_animation_worklets_for_pending_tree_{};
+  bool processing_paint_worklets_for_pending_tree_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<47> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ChromeCompositorStateMachine_MajorState : public ::protozero::CppMessageObj {
+ public:
+  using BeginImplFrameState = ChromeCompositorStateMachine_MajorState_BeginImplFrameState;
+  static constexpr auto BEGIN_IMPL_FRAME_UNSPECIFIED = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_UNSPECIFIED;
+  static constexpr auto BEGIN_IMPL_FRAME_IDLE = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_IDLE;
+  static constexpr auto BEGIN_IMPL_FRAME_INSIDE_BEGIN_FRAME = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_INSIDE_BEGIN_FRAME;
+  static constexpr auto BEGIN_IMPL_FRAME_INSIDE_DEADLINE = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_INSIDE_DEADLINE;
+  static constexpr auto BeginImplFrameState_MIN = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_UNSPECIFIED;
+  static constexpr auto BeginImplFrameState_MAX = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_INSIDE_DEADLINE;
+  using BeginMainFrameState = ChromeCompositorStateMachine_MajorState_BeginMainFrameState;
+  static constexpr auto BEGIN_MAIN_FRAME_UNSPECIFIED = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_UNSPECIFIED;
+  static constexpr auto BEGIN_MAIN_FRAME_IDLE = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_IDLE;
+  static constexpr auto BEGIN_MAIN_FRAME_SENT = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_SENT;
+  static constexpr auto BEGIN_MAIN_FRAME_READY_TO_COMMIT = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_READY_TO_COMMIT;
+  static constexpr auto BeginMainFrameState_MIN = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_UNSPECIFIED;
+  static constexpr auto BeginMainFrameState_MAX = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_READY_TO_COMMIT;
+  using LayerTreeFrameSinkState = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState;
+  static constexpr auto LAYER_TREE_FRAME_UNSPECIFIED = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_UNSPECIFIED;
+  static constexpr auto LAYER_TREE_FRAME_NONE = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_NONE;
+  static constexpr auto LAYER_TREE_FRAME_ACTIVE = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_ACTIVE;
+  static constexpr auto LAYER_TREE_FRAME_CREATING = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_CREATING;
+  static constexpr auto LAYER_TREE_FRAME_WAITING_FOR_FIRST_COMMIT = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_WAITING_FOR_FIRST_COMMIT;
+  static constexpr auto LAYER_TREE_FRAME_WAITING_FOR_FIRST_ACTIVATION = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_WAITING_FOR_FIRST_ACTIVATION;
+  static constexpr auto LayerTreeFrameSinkState_MIN = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_UNSPECIFIED;
+  static constexpr auto LayerTreeFrameSinkState_MAX = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_WAITING_FOR_FIRST_ACTIVATION;
+  using ForcedRedrawOnTimeoutState = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState;
+  static constexpr auto FORCED_REDRAW_UNSPECIFIED = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_UNSPECIFIED;
+  static constexpr auto FORCED_REDRAW_IDLE = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_IDLE;
+  static constexpr auto FORCED_REDRAW_WAITING_FOR_COMMIT = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_COMMIT;
+  static constexpr auto FORCED_REDRAW_WAITING_FOR_ACTIVATION = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_ACTIVATION;
+  static constexpr auto FORCED_REDRAW_WAITING_FOR_DRAW = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_DRAW;
+  static constexpr auto ForcedRedrawOnTimeoutState_MIN = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_UNSPECIFIED;
+  static constexpr auto ForcedRedrawOnTimeoutState_MAX = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_DRAW;
+  enum FieldNumbers {
+    kNextActionFieldNumber = 1,
+    kBeginImplFrameStateFieldNumber = 2,
+    kBeginMainFrameStateFieldNumber = 3,
+    kLayerTreeFrameSinkStateFieldNumber = 4,
+    kForcedRedrawStateFieldNumber = 5,
+  };
+
+  ChromeCompositorStateMachine_MajorState();
+  ~ChromeCompositorStateMachine_MajorState() override;
+  ChromeCompositorStateMachine_MajorState(ChromeCompositorStateMachine_MajorState&&) noexcept;
+  ChromeCompositorStateMachine_MajorState& operator=(ChromeCompositorStateMachine_MajorState&&);
+  ChromeCompositorStateMachine_MajorState(const ChromeCompositorStateMachine_MajorState&);
+  ChromeCompositorStateMachine_MajorState& operator=(const ChromeCompositorStateMachine_MajorState&);
+  bool operator==(const ChromeCompositorStateMachine_MajorState&) const;
+  bool operator!=(const ChromeCompositorStateMachine_MajorState& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_next_action() const { return _has_field_[1]; }
+  ChromeCompositorSchedulerAction next_action() const { return next_action_; }
+  void set_next_action(ChromeCompositorSchedulerAction value) { next_action_ = value; _has_field_.set(1); }
+
+  bool has_begin_impl_frame_state() const { return _has_field_[2]; }
+  ChromeCompositorStateMachine_MajorState_BeginImplFrameState begin_impl_frame_state() const { return begin_impl_frame_state_; }
+  void set_begin_impl_frame_state(ChromeCompositorStateMachine_MajorState_BeginImplFrameState value) { begin_impl_frame_state_ = value; _has_field_.set(2); }
+
+  bool has_begin_main_frame_state() const { return _has_field_[3]; }
+  ChromeCompositorStateMachine_MajorState_BeginMainFrameState begin_main_frame_state() const { return begin_main_frame_state_; }
+  void set_begin_main_frame_state(ChromeCompositorStateMachine_MajorState_BeginMainFrameState value) { begin_main_frame_state_ = value; _has_field_.set(3); }
+
+  bool has_layer_tree_frame_sink_state() const { return _has_field_[4]; }
+  ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState layer_tree_frame_sink_state() const { return layer_tree_frame_sink_state_; }
+  void set_layer_tree_frame_sink_state(ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState value) { layer_tree_frame_sink_state_ = value; _has_field_.set(4); }
+
+  bool has_forced_redraw_state() const { return _has_field_[5]; }
+  ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState forced_redraw_state() const { return forced_redraw_state_; }
+  void set_forced_redraw_state(ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState value) { forced_redraw_state_ = value; _has_field_.set(5); }
+
+ private:
+  ChromeCompositorSchedulerAction next_action_{};
+  ChromeCompositorStateMachine_MajorState_BeginImplFrameState begin_impl_frame_state_{};
+  ChromeCompositorStateMachine_MajorState_BeginMainFrameState begin_main_frame_state_{};
+  ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState layer_tree_frame_sink_state_{};
+  ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState forced_redraw_state_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<6> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ChromeCompositorSchedulerState : public ::protozero::CppMessageObj {
+ public:
+  using BeginImplFrameDeadlineMode = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode;
+  static constexpr auto DEADLINE_MODE_UNSPECIFIED = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_UNSPECIFIED;
+  static constexpr auto DEADLINE_MODE_NONE = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_NONE;
+  static constexpr auto DEADLINE_MODE_IMMEDIATE = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_IMMEDIATE;
+  static constexpr auto DEADLINE_MODE_REGULAR = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_REGULAR;
+  static constexpr auto DEADLINE_MODE_LATE = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_LATE;
+  static constexpr auto DEADLINE_MODE_BLOCKED = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_BLOCKED;
+  static constexpr auto BeginImplFrameDeadlineMode_MIN = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_UNSPECIFIED;
+  static constexpr auto BeginImplFrameDeadlineMode_MAX = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_BLOCKED;
+  enum FieldNumbers {
+    kStateMachineFieldNumber = 1,
+    kObservingBeginFrameSourceFieldNumber = 2,
+    kBeginImplFrameDeadlineTaskFieldNumber = 3,
+    kPendingBeginFrameTaskFieldNumber = 4,
+    kSkippedLastFrameMissedExceededDeadlineFieldNumber = 5,
+    kSkippedLastFrameToReduceLatencyFieldNumber = 6,
+    kInsideActionFieldNumber = 7,
+    kDeadlineModeFieldNumber = 8,
+    kDeadlineUsFieldNumber = 9,
+    kDeadlineScheduledAtUsFieldNumber = 10,
+    kNowUsFieldNumber = 11,
+    kNowToDeadlineDeltaUsFieldNumber = 12,
+    kNowToDeadlineScheduledAtDeltaUsFieldNumber = 13,
+    kBeginImplFrameArgsFieldNumber = 14,
+    kBeginFrameObserverStateFieldNumber = 15,
+    kBeginFrameSourceStateFieldNumber = 16,
+    kCompositorTimingHistoryFieldNumber = 17,
+  };
+
+  ChromeCompositorSchedulerState();
+  ~ChromeCompositorSchedulerState() override;
+  ChromeCompositorSchedulerState(ChromeCompositorSchedulerState&&) noexcept;
+  ChromeCompositorSchedulerState& operator=(ChromeCompositorSchedulerState&&);
+  ChromeCompositorSchedulerState(const ChromeCompositorSchedulerState&);
+  ChromeCompositorSchedulerState& operator=(const ChromeCompositorSchedulerState&);
+  bool operator==(const ChromeCompositorSchedulerState&) const;
+  bool operator!=(const ChromeCompositorSchedulerState& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_state_machine() const { return _has_field_[1]; }
+  const ChromeCompositorStateMachine& state_machine() const { return *state_machine_; }
+  ChromeCompositorStateMachine* mutable_state_machine() { _has_field_.set(1); return state_machine_.get(); }
+
+  bool has_observing_begin_frame_source() const { return _has_field_[2]; }
+  bool observing_begin_frame_source() const { return observing_begin_frame_source_; }
+  void set_observing_begin_frame_source(bool value) { observing_begin_frame_source_ = value; _has_field_.set(2); }
+
+  bool has_begin_impl_frame_deadline_task() const { return _has_field_[3]; }
+  bool begin_impl_frame_deadline_task() const { return begin_impl_frame_deadline_task_; }
+  void set_begin_impl_frame_deadline_task(bool value) { begin_impl_frame_deadline_task_ = value; _has_field_.set(3); }
+
+  bool has_pending_begin_frame_task() const { return _has_field_[4]; }
+  bool pending_begin_frame_task() const { return pending_begin_frame_task_; }
+  void set_pending_begin_frame_task(bool value) { pending_begin_frame_task_ = value; _has_field_.set(4); }
+
+  bool has_skipped_last_frame_missed_exceeded_deadline() const { return _has_field_[5]; }
+  bool skipped_last_frame_missed_exceeded_deadline() const { return skipped_last_frame_missed_exceeded_deadline_; }
+  void set_skipped_last_frame_missed_exceeded_deadline(bool value) { skipped_last_frame_missed_exceeded_deadline_ = value; _has_field_.set(5); }
+
+  bool has_skipped_last_frame_to_reduce_latency() const { return _has_field_[6]; }
+  bool skipped_last_frame_to_reduce_latency() const { return skipped_last_frame_to_reduce_latency_; }
+  void set_skipped_last_frame_to_reduce_latency(bool value) { skipped_last_frame_to_reduce_latency_ = value; _has_field_.set(6); }
+
+  bool has_inside_action() const { return _has_field_[7]; }
+  ChromeCompositorSchedulerAction inside_action() const { return inside_action_; }
+  void set_inside_action(ChromeCompositorSchedulerAction value) { inside_action_ = value; _has_field_.set(7); }
+
+  bool has_deadline_mode() const { return _has_field_[8]; }
+  ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode deadline_mode() const { return deadline_mode_; }
+  void set_deadline_mode(ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode value) { deadline_mode_ = value; _has_field_.set(8); }
+
+  bool has_deadline_us() const { return _has_field_[9]; }
+  int64_t deadline_us() const { return deadline_us_; }
+  void set_deadline_us(int64_t value) { deadline_us_ = value; _has_field_.set(9); }
+
+  bool has_deadline_scheduled_at_us() const { return _has_field_[10]; }
+  int64_t deadline_scheduled_at_us() const { return deadline_scheduled_at_us_; }
+  void set_deadline_scheduled_at_us(int64_t value) { deadline_scheduled_at_us_ = value; _has_field_.set(10); }
+
+  bool has_now_us() const { return _has_field_[11]; }
+  int64_t now_us() const { return now_us_; }
+  void set_now_us(int64_t value) { now_us_ = value; _has_field_.set(11); }
+
+  bool has_now_to_deadline_delta_us() const { return _has_field_[12]; }
+  int64_t now_to_deadline_delta_us() const { return now_to_deadline_delta_us_; }
+  void set_now_to_deadline_delta_us(int64_t value) { now_to_deadline_delta_us_ = value; _has_field_.set(12); }
+
+  bool has_now_to_deadline_scheduled_at_delta_us() const { return _has_field_[13]; }
+  int64_t now_to_deadline_scheduled_at_delta_us() const { return now_to_deadline_scheduled_at_delta_us_; }
+  void set_now_to_deadline_scheduled_at_delta_us(int64_t value) { now_to_deadline_scheduled_at_delta_us_ = value; _has_field_.set(13); }
+
+  bool has_begin_impl_frame_args() const { return _has_field_[14]; }
+  const BeginImplFrameArgs& begin_impl_frame_args() const { return *begin_impl_frame_args_; }
+  BeginImplFrameArgs* mutable_begin_impl_frame_args() { _has_field_.set(14); return begin_impl_frame_args_.get(); }
+
+  bool has_begin_frame_observer_state() const { return _has_field_[15]; }
+  const BeginFrameObserverState& begin_frame_observer_state() const { return *begin_frame_observer_state_; }
+  BeginFrameObserverState* mutable_begin_frame_observer_state() { _has_field_.set(15); return begin_frame_observer_state_.get(); }
+
+  bool has_begin_frame_source_state() const { return _has_field_[16]; }
+  const BeginFrameSourceState& begin_frame_source_state() const { return *begin_frame_source_state_; }
+  BeginFrameSourceState* mutable_begin_frame_source_state() { _has_field_.set(16); return begin_frame_source_state_.get(); }
+
+  bool has_compositor_timing_history() const { return _has_field_[17]; }
+  const CompositorTimingHistory& compositor_timing_history() const { return *compositor_timing_history_; }
+  CompositorTimingHistory* mutable_compositor_timing_history() { _has_field_.set(17); return compositor_timing_history_.get(); }
+
+ private:
+  ::protozero::CopyablePtr<ChromeCompositorStateMachine> state_machine_;
+  bool observing_begin_frame_source_{};
+  bool begin_impl_frame_deadline_task_{};
+  bool pending_begin_frame_task_{};
+  bool skipped_last_frame_missed_exceeded_deadline_{};
+  bool skipped_last_frame_to_reduce_latency_{};
+  ChromeCompositorSchedulerAction inside_action_{};
+  ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode deadline_mode_{};
+  int64_t deadline_us_{};
+  int64_t deadline_scheduled_at_us_{};
+  int64_t now_us_{};
+  int64_t now_to_deadline_delta_us_{};
+  int64_t now_to_deadline_scheduled_at_delta_us_{};
+  ::protozero::CopyablePtr<BeginImplFrameArgs> begin_impl_frame_args_;
+  ::protozero::CopyablePtr<BeginFrameObserverState> begin_frame_observer_state_;
+  ::protozero::CopyablePtr<BeginFrameSourceState> begin_frame_source_state_;
+  ::protozero::CopyablePtr<CompositorTimingHistory> compositor_timing_history_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<18> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_COMPOSITOR_SCHEDULER_STATE_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_content_settings_event_info.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_CONTENT_SETTINGS_EVENT_INFO_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_CONTENT_SETTINGS_EVENT_INFO_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeContentSettingsEventInfo;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT ChromeContentSettingsEventInfo : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNumberOfExceptionsFieldNumber = 1,
+  };
+
+  ChromeContentSettingsEventInfo();
+  ~ChromeContentSettingsEventInfo() override;
+  ChromeContentSettingsEventInfo(ChromeContentSettingsEventInfo&&) noexcept;
+  ChromeContentSettingsEventInfo& operator=(ChromeContentSettingsEventInfo&&);
+  ChromeContentSettingsEventInfo(const ChromeContentSettingsEventInfo&);
+  ChromeContentSettingsEventInfo& operator=(const ChromeContentSettingsEventInfo&);
+  bool operator==(const ChromeContentSettingsEventInfo&) const;
+  bool operator!=(const ChromeContentSettingsEventInfo& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_number_of_exceptions() const { return _has_field_[1]; }
+  uint32_t number_of_exceptions() const { return number_of_exceptions_; }
+  void set_number_of_exceptions(uint32_t value) { number_of_exceptions_ = value; _has_field_.set(1); }
+
+ private:
+  uint32_t number_of_exceptions_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_CONTENT_SETTINGS_EVENT_INFO_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_frame_reporter.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_FRAME_REPORTER_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_FRAME_REPORTER_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeFrameReporter;
+enum ChromeFrameReporter_State : int;
+enum ChromeFrameReporter_FrameDropReason : int;
+enum ChromeFrameReporter_ScrollState : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum ChromeFrameReporter_State : int {
+  ChromeFrameReporter_State_STATE_NO_UPDATE_DESIRED = 0,
+  ChromeFrameReporter_State_STATE_PRESENTED_ALL = 1,
+  ChromeFrameReporter_State_STATE_PRESENTED_PARTIAL = 2,
+  ChromeFrameReporter_State_STATE_DROPPED = 3,
+};
+enum ChromeFrameReporter_FrameDropReason : int {
+  ChromeFrameReporter_FrameDropReason_REASON_UNSPECIFIED = 0,
+  ChromeFrameReporter_FrameDropReason_REASON_DISPLAY_COMPOSITOR = 1,
+  ChromeFrameReporter_FrameDropReason_REASON_MAIN_THREAD = 2,
+  ChromeFrameReporter_FrameDropReason_REASON_CLIENT_COMPOSITOR = 3,
+};
+enum ChromeFrameReporter_ScrollState : int {
+  ChromeFrameReporter_ScrollState_SCROLL_NONE = 0,
+  ChromeFrameReporter_ScrollState_SCROLL_MAIN_THREAD = 1,
+  ChromeFrameReporter_ScrollState_SCROLL_COMPOSITOR_THREAD = 2,
+  ChromeFrameReporter_ScrollState_SCROLL_UNKNOWN = 3,
+};
+
+class PERFETTO_EXPORT ChromeFrameReporter : public ::protozero::CppMessageObj {
+ public:
+  using State = ChromeFrameReporter_State;
+  static constexpr auto STATE_NO_UPDATE_DESIRED = ChromeFrameReporter_State_STATE_NO_UPDATE_DESIRED;
+  static constexpr auto STATE_PRESENTED_ALL = ChromeFrameReporter_State_STATE_PRESENTED_ALL;
+  static constexpr auto STATE_PRESENTED_PARTIAL = ChromeFrameReporter_State_STATE_PRESENTED_PARTIAL;
+  static constexpr auto STATE_DROPPED = ChromeFrameReporter_State_STATE_DROPPED;
+  static constexpr auto State_MIN = ChromeFrameReporter_State_STATE_NO_UPDATE_DESIRED;
+  static constexpr auto State_MAX = ChromeFrameReporter_State_STATE_DROPPED;
+  using FrameDropReason = ChromeFrameReporter_FrameDropReason;
+  static constexpr auto REASON_UNSPECIFIED = ChromeFrameReporter_FrameDropReason_REASON_UNSPECIFIED;
+  static constexpr auto REASON_DISPLAY_COMPOSITOR = ChromeFrameReporter_FrameDropReason_REASON_DISPLAY_COMPOSITOR;
+  static constexpr auto REASON_MAIN_THREAD = ChromeFrameReporter_FrameDropReason_REASON_MAIN_THREAD;
+  static constexpr auto REASON_CLIENT_COMPOSITOR = ChromeFrameReporter_FrameDropReason_REASON_CLIENT_COMPOSITOR;
+  static constexpr auto FrameDropReason_MIN = ChromeFrameReporter_FrameDropReason_REASON_UNSPECIFIED;
+  static constexpr auto FrameDropReason_MAX = ChromeFrameReporter_FrameDropReason_REASON_CLIENT_COMPOSITOR;
+  using ScrollState = ChromeFrameReporter_ScrollState;
+  static constexpr auto SCROLL_NONE = ChromeFrameReporter_ScrollState_SCROLL_NONE;
+  static constexpr auto SCROLL_MAIN_THREAD = ChromeFrameReporter_ScrollState_SCROLL_MAIN_THREAD;
+  static constexpr auto SCROLL_COMPOSITOR_THREAD = ChromeFrameReporter_ScrollState_SCROLL_COMPOSITOR_THREAD;
+  static constexpr auto SCROLL_UNKNOWN = ChromeFrameReporter_ScrollState_SCROLL_UNKNOWN;
+  static constexpr auto ScrollState_MIN = ChromeFrameReporter_ScrollState_SCROLL_NONE;
+  static constexpr auto ScrollState_MAX = ChromeFrameReporter_ScrollState_SCROLL_UNKNOWN;
+  enum FieldNumbers {
+    kStateFieldNumber = 1,
+    kReasonFieldNumber = 2,
+    kFrameSourceFieldNumber = 3,
+    kFrameSequenceFieldNumber = 4,
+    kAffectsSmoothnessFieldNumber = 5,
+    kScrollStateFieldNumber = 6,
+    kHasMainAnimationFieldNumber = 7,
+    kHasCompositorAnimationFieldNumber = 8,
+    kHasSmoothInputMainFieldNumber = 9,
+    kHasMissingContentFieldNumber = 10,
+    kLayerTreeHostIdFieldNumber = 11,
+  };
+
+  ChromeFrameReporter();
+  ~ChromeFrameReporter() override;
+  ChromeFrameReporter(ChromeFrameReporter&&) noexcept;
+  ChromeFrameReporter& operator=(ChromeFrameReporter&&);
+  ChromeFrameReporter(const ChromeFrameReporter&);
+  ChromeFrameReporter& operator=(const ChromeFrameReporter&);
+  bool operator==(const ChromeFrameReporter&) const;
+  bool operator!=(const ChromeFrameReporter& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_state() const { return _has_field_[1]; }
+  ChromeFrameReporter_State state() const { return state_; }
+  void set_state(ChromeFrameReporter_State value) { state_ = value; _has_field_.set(1); }
+
+  bool has_reason() const { return _has_field_[2]; }
+  ChromeFrameReporter_FrameDropReason reason() const { return reason_; }
+  void set_reason(ChromeFrameReporter_FrameDropReason value) { reason_ = value; _has_field_.set(2); }
+
+  bool has_frame_source() const { return _has_field_[3]; }
+  uint64_t frame_source() const { return frame_source_; }
+  void set_frame_source(uint64_t value) { frame_source_ = value; _has_field_.set(3); }
+
+  bool has_frame_sequence() const { return _has_field_[4]; }
+  uint64_t frame_sequence() const { return frame_sequence_; }
+  void set_frame_sequence(uint64_t value) { frame_sequence_ = value; _has_field_.set(4); }
+
+  bool has_affects_smoothness() const { return _has_field_[5]; }
+  bool affects_smoothness() const { return affects_smoothness_; }
+  void set_affects_smoothness(bool value) { affects_smoothness_ = value; _has_field_.set(5); }
+
+  bool has_scroll_state() const { return _has_field_[6]; }
+  ChromeFrameReporter_ScrollState scroll_state() const { return scroll_state_; }
+  void set_scroll_state(ChromeFrameReporter_ScrollState value) { scroll_state_ = value; _has_field_.set(6); }
+
+  bool has_has_main_animation() const { return _has_field_[7]; }
+  bool has_main_animation() const { return has_main_animation_; }
+  void set_has_main_animation(bool value) { has_main_animation_ = value; _has_field_.set(7); }
+
+  bool has_has_compositor_animation() const { return _has_field_[8]; }
+  bool has_compositor_animation() const { return has_compositor_animation_; }
+  void set_has_compositor_animation(bool value) { has_compositor_animation_ = value; _has_field_.set(8); }
+
+  bool has_has_smooth_input_main() const { return _has_field_[9]; }
+  bool has_smooth_input_main() const { return has_smooth_input_main_; }
+  void set_has_smooth_input_main(bool value) { has_smooth_input_main_ = value; _has_field_.set(9); }
+
+  bool has_has_missing_content() const { return _has_field_[10]; }
+  bool has_missing_content() const { return has_missing_content_; }
+  void set_has_missing_content(bool value) { has_missing_content_ = value; _has_field_.set(10); }
+
+  bool has_layer_tree_host_id() const { return _has_field_[11]; }
+  uint64_t layer_tree_host_id() const { return layer_tree_host_id_; }
+  void set_layer_tree_host_id(uint64_t value) { layer_tree_host_id_ = value; _has_field_.set(11); }
+
+ private:
+  ChromeFrameReporter_State state_{};
+  ChromeFrameReporter_FrameDropReason reason_{};
+  uint64_t frame_source_{};
+  uint64_t frame_sequence_{};
+  bool affects_smoothness_{};
+  ChromeFrameReporter_ScrollState scroll_state_{};
+  bool has_main_animation_{};
+  bool has_compositor_animation_{};
+  bool has_smooth_input_main_{};
+  bool has_missing_content_{};
+  uint64_t layer_tree_host_id_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<12> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_FRAME_REPORTER_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_histogram_sample.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_HISTOGRAM_SAMPLE_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_HISTOGRAM_SAMPLE_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeHistogramSample;
+class HistogramName;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT ChromeHistogramSample : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNameHashFieldNumber = 1,
+    kNameFieldNumber = 2,
+    kSampleFieldNumber = 3,
+    kNameIidFieldNumber = 4,
+  };
+
+  ChromeHistogramSample();
+  ~ChromeHistogramSample() override;
+  ChromeHistogramSample(ChromeHistogramSample&&) noexcept;
+  ChromeHistogramSample& operator=(ChromeHistogramSample&&);
+  ChromeHistogramSample(const ChromeHistogramSample&);
+  ChromeHistogramSample& operator=(const ChromeHistogramSample&);
+  bool operator==(const ChromeHistogramSample&) const;
+  bool operator!=(const ChromeHistogramSample& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name_hash() const { return _has_field_[1]; }
+  uint64_t name_hash() const { return name_hash_; }
+  void set_name_hash(uint64_t value) { name_hash_ = value; _has_field_.set(1); }
+
+  bool has_name() const { return _has_field_[2]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(2); }
+
+  bool has_sample() const { return _has_field_[3]; }
+  int64_t sample() const { return sample_; }
+  void set_sample(int64_t value) { sample_ = value; _has_field_.set(3); }
+
+  bool has_name_iid() const { return _has_field_[4]; }
+  uint64_t name_iid() const { return name_iid_; }
+  void set_name_iid(uint64_t value) { name_iid_ = value; _has_field_.set(4); }
+
+ private:
+  uint64_t name_hash_{};
+  std::string name_{};
+  int64_t sample_{};
+  uint64_t name_iid_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<5> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT HistogramName : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kIidFieldNumber = 1,
+    kNameFieldNumber = 2,
+  };
+
+  HistogramName();
+  ~HistogramName() override;
+  HistogramName(HistogramName&&) noexcept;
+  HistogramName& operator=(HistogramName&&);
+  HistogramName(const HistogramName&);
+  HistogramName& operator=(const HistogramName&);
+  bool operator==(const HistogramName&) const;
+  bool operator!=(const HistogramName& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_iid() const { return _has_field_[1]; }
+  uint64_t iid() const { return iid_; }
+  void set_iid(uint64_t value) { iid_ = value; _has_field_.set(1); }
+
+  bool has_name() const { return _has_field_[2]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(2); }
+
+ private:
+  uint64_t iid_{};
+  std::string name_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_HISTOGRAM_SAMPLE_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_keyed_service.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_KEYED_SERVICE_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_KEYED_SERVICE_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeKeyedService;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT ChromeKeyedService : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNameFieldNumber = 1,
+  };
+
+  ChromeKeyedService();
+  ~ChromeKeyedService() override;
+  ChromeKeyedService(ChromeKeyedService&&) noexcept;
+  ChromeKeyedService& operator=(ChromeKeyedService&&);
+  ChromeKeyedService(const ChromeKeyedService&);
+  ChromeKeyedService& operator=(const ChromeKeyedService&);
+  bool operator==(const ChromeKeyedService&) const;
+  bool operator!=(const ChromeKeyedService& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name() const { return _has_field_[1]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
+
+ private:
+  std::string name_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_KEYED_SERVICE_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_latency_info.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_LATENCY_INFO_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_LATENCY_INFO_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeLatencyInfo;
+class ChromeLatencyInfo_ComponentInfo;
+enum ChromeLatencyInfo_Step : int;
+enum ChromeLatencyInfo_LatencyComponentType : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum ChromeLatencyInfo_Step : int {
+  ChromeLatencyInfo_Step_STEP_UNSPECIFIED = 0,
+  ChromeLatencyInfo_Step_STEP_SEND_INPUT_EVENT_UI = 3,
+  ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_IMPL = 5,
+  ChromeLatencyInfo_Step_STEP_DID_HANDLE_INPUT_AND_OVERSCROLL = 8,
+  ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_MAIN = 4,
+  ChromeLatencyInfo_Step_STEP_MAIN_THREAD_SCROLL_UPDATE = 2,
+  ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_MAIN_COMMIT = 1,
+  ChromeLatencyInfo_Step_STEP_HANDLED_INPUT_EVENT_MAIN_OR_IMPL = 9,
+  ChromeLatencyInfo_Step_STEP_HANDLED_INPUT_EVENT_IMPL = 10,
+  ChromeLatencyInfo_Step_STEP_SWAP_BUFFERS = 6,
+  ChromeLatencyInfo_Step_STEP_DRAW_AND_SWAP = 7,
+  ChromeLatencyInfo_Step_STEP_FINISHED_SWAP_BUFFERS = 11,
+};
+enum ChromeLatencyInfo_LatencyComponentType : int {
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_UNSPECIFIED = 0,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_BEGIN_RWH = 1,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL = 2,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL = 3,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_ORIGINAL = 4,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_UI = 5,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERER_MAIN = 6,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN = 7,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL = 8,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_LAST_EVENT = 9,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_ACK_RWH = 10,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERER_SWAP = 11,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_DISPLAY_COMPOSITOR_RECEIVED_FRAME = 12,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_GPU_SWAP_BUFFER = 13,
+  ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_FRAME_SWAP = 14,
+};
+
+class PERFETTO_EXPORT ChromeLatencyInfo : public ::protozero::CppMessageObj {
+ public:
+  using ComponentInfo = ChromeLatencyInfo_ComponentInfo;
+  using Step = ChromeLatencyInfo_Step;
+  static constexpr auto STEP_UNSPECIFIED = ChromeLatencyInfo_Step_STEP_UNSPECIFIED;
+  static constexpr auto STEP_SEND_INPUT_EVENT_UI = ChromeLatencyInfo_Step_STEP_SEND_INPUT_EVENT_UI;
+  static constexpr auto STEP_HANDLE_INPUT_EVENT_IMPL = ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_IMPL;
+  static constexpr auto STEP_DID_HANDLE_INPUT_AND_OVERSCROLL = ChromeLatencyInfo_Step_STEP_DID_HANDLE_INPUT_AND_OVERSCROLL;
+  static constexpr auto STEP_HANDLE_INPUT_EVENT_MAIN = ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_MAIN;
+  static constexpr auto STEP_MAIN_THREAD_SCROLL_UPDATE = ChromeLatencyInfo_Step_STEP_MAIN_THREAD_SCROLL_UPDATE;
+  static constexpr auto STEP_HANDLE_INPUT_EVENT_MAIN_COMMIT = ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_MAIN_COMMIT;
+  static constexpr auto STEP_HANDLED_INPUT_EVENT_MAIN_OR_IMPL = ChromeLatencyInfo_Step_STEP_HANDLED_INPUT_EVENT_MAIN_OR_IMPL;
+  static constexpr auto STEP_HANDLED_INPUT_EVENT_IMPL = ChromeLatencyInfo_Step_STEP_HANDLED_INPUT_EVENT_IMPL;
+  static constexpr auto STEP_SWAP_BUFFERS = ChromeLatencyInfo_Step_STEP_SWAP_BUFFERS;
+  static constexpr auto STEP_DRAW_AND_SWAP = ChromeLatencyInfo_Step_STEP_DRAW_AND_SWAP;
+  static constexpr auto STEP_FINISHED_SWAP_BUFFERS = ChromeLatencyInfo_Step_STEP_FINISHED_SWAP_BUFFERS;
+  static constexpr auto Step_MIN = ChromeLatencyInfo_Step_STEP_UNSPECIFIED;
+  static constexpr auto Step_MAX = ChromeLatencyInfo_Step_STEP_FINISHED_SWAP_BUFFERS;
+  using LatencyComponentType = ChromeLatencyInfo_LatencyComponentType;
+  static constexpr auto COMPONENT_UNSPECIFIED = ChromeLatencyInfo_LatencyComponentType_COMPONENT_UNSPECIFIED;
+  static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_BEGIN_RWH = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_BEGIN_RWH;
+  static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL;
+  static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL;
+  static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_ORIGINAL = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_ORIGINAL;
+  static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_UI = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_UI;
+  static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_RENDERER_MAIN = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERER_MAIN;
+  static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN;
+  static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL;
+  static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_LAST_EVENT = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_LAST_EVENT;
+  static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_ACK_RWH = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_ACK_RWH;
+  static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_RENDERER_SWAP = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERER_SWAP;
+  static constexpr auto COMPONENT_DISPLAY_COMPOSITOR_RECEIVED_FRAME = ChromeLatencyInfo_LatencyComponentType_COMPONENT_DISPLAY_COMPOSITOR_RECEIVED_FRAME;
+  static constexpr auto COMPONENT_INPUT_EVENT_GPU_SWAP_BUFFER = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_GPU_SWAP_BUFFER;
+  static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_FRAME_SWAP = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_FRAME_SWAP;
+  static constexpr auto LatencyComponentType_MIN = ChromeLatencyInfo_LatencyComponentType_COMPONENT_UNSPECIFIED;
+  static constexpr auto LatencyComponentType_MAX = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_FRAME_SWAP;
+  enum FieldNumbers {
+    kTraceIdFieldNumber = 1,
+    kStepFieldNumber = 2,
+    kFrameTreeNodeIdFieldNumber = 3,
+    kComponentInfoFieldNumber = 4,
+    kIsCoalescedFieldNumber = 5,
+    kGestureScrollIdFieldNumber = 6,
+  };
+
+  ChromeLatencyInfo();
+  ~ChromeLatencyInfo() override;
+  ChromeLatencyInfo(ChromeLatencyInfo&&) noexcept;
+  ChromeLatencyInfo& operator=(ChromeLatencyInfo&&);
+  ChromeLatencyInfo(const ChromeLatencyInfo&);
+  ChromeLatencyInfo& operator=(const ChromeLatencyInfo&);
+  bool operator==(const ChromeLatencyInfo&) const;
+  bool operator!=(const ChromeLatencyInfo& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_trace_id() const { return _has_field_[1]; }
+  int64_t trace_id() const { return trace_id_; }
+  void set_trace_id(int64_t value) { trace_id_ = value; _has_field_.set(1); }
+
+  bool has_step() const { return _has_field_[2]; }
+  ChromeLatencyInfo_Step step() const { return step_; }
+  void set_step(ChromeLatencyInfo_Step value) { step_ = value; _has_field_.set(2); }
+
+  bool has_frame_tree_node_id() const { return _has_field_[3]; }
+  int32_t frame_tree_node_id() const { return frame_tree_node_id_; }
+  void set_frame_tree_node_id(int32_t value) { frame_tree_node_id_ = value; _has_field_.set(3); }
+
+  const std::vector<ChromeLatencyInfo_ComponentInfo>& component_info() const { return component_info_; }
+  std::vector<ChromeLatencyInfo_ComponentInfo>* mutable_component_info() { return &component_info_; }
+  int component_info_size() const;
+  void clear_component_info();
+  ChromeLatencyInfo_ComponentInfo* add_component_info();
+
+  bool has_is_coalesced() const { return _has_field_[5]; }
+  bool is_coalesced() const { return is_coalesced_; }
+  void set_is_coalesced(bool value) { is_coalesced_ = value; _has_field_.set(5); }
+
+  bool has_gesture_scroll_id() const { return _has_field_[6]; }
+  int64_t gesture_scroll_id() const { return gesture_scroll_id_; }
+  void set_gesture_scroll_id(int64_t value) { gesture_scroll_id_ = value; _has_field_.set(6); }
+
+ private:
+  int64_t trace_id_{};
+  ChromeLatencyInfo_Step step_{};
+  int32_t frame_tree_node_id_{};
+  std::vector<ChromeLatencyInfo_ComponentInfo> component_info_;
+  bool is_coalesced_{};
+  int64_t gesture_scroll_id_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<7> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ChromeLatencyInfo_ComponentInfo : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kComponentTypeFieldNumber = 1,
+    kTimeUsFieldNumber = 2,
+  };
+
+  ChromeLatencyInfo_ComponentInfo();
+  ~ChromeLatencyInfo_ComponentInfo() override;
+  ChromeLatencyInfo_ComponentInfo(ChromeLatencyInfo_ComponentInfo&&) noexcept;
+  ChromeLatencyInfo_ComponentInfo& operator=(ChromeLatencyInfo_ComponentInfo&&);
+  ChromeLatencyInfo_ComponentInfo(const ChromeLatencyInfo_ComponentInfo&);
+  ChromeLatencyInfo_ComponentInfo& operator=(const ChromeLatencyInfo_ComponentInfo&);
+  bool operator==(const ChromeLatencyInfo_ComponentInfo&) const;
+  bool operator!=(const ChromeLatencyInfo_ComponentInfo& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_component_type() const { return _has_field_[1]; }
+  ChromeLatencyInfo_LatencyComponentType component_type() const { return component_type_; }
+  void set_component_type(ChromeLatencyInfo_LatencyComponentType value) { component_type_ = value; _has_field_.set(1); }
+
+  bool has_time_us() const { return _has_field_[2]; }
+  uint64_t time_us() const { return time_us_; }
+  void set_time_us(uint64_t value) { time_us_ = value; _has_field_.set(2); }
+
+ private:
+  ChromeLatencyInfo_LatencyComponentType component_type_{};
+  uint64_t time_us_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_LATENCY_INFO_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_legacy_ipc.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_LEGACY_IPC_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_LEGACY_IPC_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeLegacyIpc;
+enum ChromeLegacyIpc_MessageClass : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum ChromeLegacyIpc_MessageClass : int {
+  ChromeLegacyIpc_MessageClass_CLASS_UNSPECIFIED = 0,
+  ChromeLegacyIpc_MessageClass_CLASS_AUTOMATION = 1,
+  ChromeLegacyIpc_MessageClass_CLASS_FRAME = 2,
+  ChromeLegacyIpc_MessageClass_CLASS_PAGE = 3,
+  ChromeLegacyIpc_MessageClass_CLASS_VIEW = 4,
+  ChromeLegacyIpc_MessageClass_CLASS_WIDGET = 5,
+  ChromeLegacyIpc_MessageClass_CLASS_INPUT = 6,
+  ChromeLegacyIpc_MessageClass_CLASS_TEST = 7,
+  ChromeLegacyIpc_MessageClass_CLASS_WORKER = 8,
+  ChromeLegacyIpc_MessageClass_CLASS_NACL = 9,
+  ChromeLegacyIpc_MessageClass_CLASS_GPU_CHANNEL = 10,
+  ChromeLegacyIpc_MessageClass_CLASS_MEDIA = 11,
+  ChromeLegacyIpc_MessageClass_CLASS_PPAPI = 12,
+  ChromeLegacyIpc_MessageClass_CLASS_CHROME = 13,
+  ChromeLegacyIpc_MessageClass_CLASS_DRAG = 14,
+  ChromeLegacyIpc_MessageClass_CLASS_PRINT = 15,
+  ChromeLegacyIpc_MessageClass_CLASS_EXTENSION = 16,
+  ChromeLegacyIpc_MessageClass_CLASS_TEXT_INPUT_CLIENT = 17,
+  ChromeLegacyIpc_MessageClass_CLASS_BLINK_TEST = 18,
+  ChromeLegacyIpc_MessageClass_CLASS_ACCESSIBILITY = 19,
+  ChromeLegacyIpc_MessageClass_CLASS_PRERENDER = 20,
+  ChromeLegacyIpc_MessageClass_CLASS_CHROMOTING = 21,
+  ChromeLegacyIpc_MessageClass_CLASS_BROWSER_PLUGIN = 22,
+  ChromeLegacyIpc_MessageClass_CLASS_ANDROID_WEB_VIEW = 23,
+  ChromeLegacyIpc_MessageClass_CLASS_NACL_HOST = 24,
+  ChromeLegacyIpc_MessageClass_CLASS_ENCRYPTED_MEDIA = 25,
+  ChromeLegacyIpc_MessageClass_CLASS_CAST = 26,
+  ChromeLegacyIpc_MessageClass_CLASS_GIN_JAVA_BRIDGE = 27,
+  ChromeLegacyIpc_MessageClass_CLASS_CHROME_UTILITY_PRINTING = 28,
+  ChromeLegacyIpc_MessageClass_CLASS_OZONE_GPU = 29,
+  ChromeLegacyIpc_MessageClass_CLASS_WEB_TEST = 30,
+  ChromeLegacyIpc_MessageClass_CLASS_NETWORK_HINTS = 31,
+  ChromeLegacyIpc_MessageClass_CLASS_EXTENSIONS_GUEST_VIEW = 32,
+  ChromeLegacyIpc_MessageClass_CLASS_GUEST_VIEW = 33,
+  ChromeLegacyIpc_MessageClass_CLASS_MEDIA_PLAYER_DELEGATE = 34,
+  ChromeLegacyIpc_MessageClass_CLASS_EXTENSION_WORKER = 35,
+  ChromeLegacyIpc_MessageClass_CLASS_SUBRESOURCE_FILTER = 36,
+  ChromeLegacyIpc_MessageClass_CLASS_UNFREEZABLE_FRAME = 37,
+};
+
+class PERFETTO_EXPORT ChromeLegacyIpc : public ::protozero::CppMessageObj {
+ public:
+  using MessageClass = ChromeLegacyIpc_MessageClass;
+  static constexpr auto CLASS_UNSPECIFIED = ChromeLegacyIpc_MessageClass_CLASS_UNSPECIFIED;
+  static constexpr auto CLASS_AUTOMATION = ChromeLegacyIpc_MessageClass_CLASS_AUTOMATION;
+  static constexpr auto CLASS_FRAME = ChromeLegacyIpc_MessageClass_CLASS_FRAME;
+  static constexpr auto CLASS_PAGE = ChromeLegacyIpc_MessageClass_CLASS_PAGE;
+  static constexpr auto CLASS_VIEW = ChromeLegacyIpc_MessageClass_CLASS_VIEW;
+  static constexpr auto CLASS_WIDGET = ChromeLegacyIpc_MessageClass_CLASS_WIDGET;
+  static constexpr auto CLASS_INPUT = ChromeLegacyIpc_MessageClass_CLASS_INPUT;
+  static constexpr auto CLASS_TEST = ChromeLegacyIpc_MessageClass_CLASS_TEST;
+  static constexpr auto CLASS_WORKER = ChromeLegacyIpc_MessageClass_CLASS_WORKER;
+  static constexpr auto CLASS_NACL = ChromeLegacyIpc_MessageClass_CLASS_NACL;
+  static constexpr auto CLASS_GPU_CHANNEL = ChromeLegacyIpc_MessageClass_CLASS_GPU_CHANNEL;
+  static constexpr auto CLASS_MEDIA = ChromeLegacyIpc_MessageClass_CLASS_MEDIA;
+  static constexpr auto CLASS_PPAPI = ChromeLegacyIpc_MessageClass_CLASS_PPAPI;
+  static constexpr auto CLASS_CHROME = ChromeLegacyIpc_MessageClass_CLASS_CHROME;
+  static constexpr auto CLASS_DRAG = ChromeLegacyIpc_MessageClass_CLASS_DRAG;
+  static constexpr auto CLASS_PRINT = ChromeLegacyIpc_MessageClass_CLASS_PRINT;
+  static constexpr auto CLASS_EXTENSION = ChromeLegacyIpc_MessageClass_CLASS_EXTENSION;
+  static constexpr auto CLASS_TEXT_INPUT_CLIENT = ChromeLegacyIpc_MessageClass_CLASS_TEXT_INPUT_CLIENT;
+  static constexpr auto CLASS_BLINK_TEST = ChromeLegacyIpc_MessageClass_CLASS_BLINK_TEST;
+  static constexpr auto CLASS_ACCESSIBILITY = ChromeLegacyIpc_MessageClass_CLASS_ACCESSIBILITY;
+  static constexpr auto CLASS_PRERENDER = ChromeLegacyIpc_MessageClass_CLASS_PRERENDER;
+  static constexpr auto CLASS_CHROMOTING = ChromeLegacyIpc_MessageClass_CLASS_CHROMOTING;
+  static constexpr auto CLASS_BROWSER_PLUGIN = ChromeLegacyIpc_MessageClass_CLASS_BROWSER_PLUGIN;
+  static constexpr auto CLASS_ANDROID_WEB_VIEW = ChromeLegacyIpc_MessageClass_CLASS_ANDROID_WEB_VIEW;
+  static constexpr auto CLASS_NACL_HOST = ChromeLegacyIpc_MessageClass_CLASS_NACL_HOST;
+  static constexpr auto CLASS_ENCRYPTED_MEDIA = ChromeLegacyIpc_MessageClass_CLASS_ENCRYPTED_MEDIA;
+  static constexpr auto CLASS_CAST = ChromeLegacyIpc_MessageClass_CLASS_CAST;
+  static constexpr auto CLASS_GIN_JAVA_BRIDGE = ChromeLegacyIpc_MessageClass_CLASS_GIN_JAVA_BRIDGE;
+  static constexpr auto CLASS_CHROME_UTILITY_PRINTING = ChromeLegacyIpc_MessageClass_CLASS_CHROME_UTILITY_PRINTING;
+  static constexpr auto CLASS_OZONE_GPU = ChromeLegacyIpc_MessageClass_CLASS_OZONE_GPU;
+  static constexpr auto CLASS_WEB_TEST = ChromeLegacyIpc_MessageClass_CLASS_WEB_TEST;
+  static constexpr auto CLASS_NETWORK_HINTS = ChromeLegacyIpc_MessageClass_CLASS_NETWORK_HINTS;
+  static constexpr auto CLASS_EXTENSIONS_GUEST_VIEW = ChromeLegacyIpc_MessageClass_CLASS_EXTENSIONS_GUEST_VIEW;
+  static constexpr auto CLASS_GUEST_VIEW = ChromeLegacyIpc_MessageClass_CLASS_GUEST_VIEW;
+  static constexpr auto CLASS_MEDIA_PLAYER_DELEGATE = ChromeLegacyIpc_MessageClass_CLASS_MEDIA_PLAYER_DELEGATE;
+  static constexpr auto CLASS_EXTENSION_WORKER = ChromeLegacyIpc_MessageClass_CLASS_EXTENSION_WORKER;
+  static constexpr auto CLASS_SUBRESOURCE_FILTER = ChromeLegacyIpc_MessageClass_CLASS_SUBRESOURCE_FILTER;
+  static constexpr auto CLASS_UNFREEZABLE_FRAME = ChromeLegacyIpc_MessageClass_CLASS_UNFREEZABLE_FRAME;
+  static constexpr auto MessageClass_MIN = ChromeLegacyIpc_MessageClass_CLASS_UNSPECIFIED;
+  static constexpr auto MessageClass_MAX = ChromeLegacyIpc_MessageClass_CLASS_UNFREEZABLE_FRAME;
+  enum FieldNumbers {
+    kMessageClassFieldNumber = 1,
+    kMessageLineFieldNumber = 2,
+  };
+
+  ChromeLegacyIpc();
+  ~ChromeLegacyIpc() override;
+  ChromeLegacyIpc(ChromeLegacyIpc&&) noexcept;
+  ChromeLegacyIpc& operator=(ChromeLegacyIpc&&);
+  ChromeLegacyIpc(const ChromeLegacyIpc&);
+  ChromeLegacyIpc& operator=(const ChromeLegacyIpc&);
+  bool operator==(const ChromeLegacyIpc&) const;
+  bool operator!=(const ChromeLegacyIpc& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_message_class() const { return _has_field_[1]; }
+  ChromeLegacyIpc_MessageClass message_class() const { return message_class_; }
+  void set_message_class(ChromeLegacyIpc_MessageClass value) { message_class_ = value; _has_field_.set(1); }
+
+  bool has_message_line() const { return _has_field_[2]; }
+  uint32_t message_line() const { return message_line_; }
+  void set_message_line(uint32_t value) { message_line_ = value; _has_field_.set(2); }
+
+ private:
+  ChromeLegacyIpc_MessageClass message_class_{};
+  uint32_t message_line_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_LEGACY_IPC_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_message_pump.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_MESSAGE_PUMP_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_MESSAGE_PUMP_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeMessagePump;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT ChromeMessagePump : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kSentMessagesInQueueFieldNumber = 1,
+    kIoHandlerLocationIidFieldNumber = 2,
+  };
+
+  ChromeMessagePump();
+  ~ChromeMessagePump() override;
+  ChromeMessagePump(ChromeMessagePump&&) noexcept;
+  ChromeMessagePump& operator=(ChromeMessagePump&&);
+  ChromeMessagePump(const ChromeMessagePump&);
+  ChromeMessagePump& operator=(const ChromeMessagePump&);
+  bool operator==(const ChromeMessagePump&) const;
+  bool operator!=(const ChromeMessagePump& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_sent_messages_in_queue() const { return _has_field_[1]; }
+  bool sent_messages_in_queue() const { return sent_messages_in_queue_; }
+  void set_sent_messages_in_queue(bool value) { sent_messages_in_queue_ = value; _has_field_.set(1); }
+
+  bool has_io_handler_location_iid() const { return _has_field_[2]; }
+  uint64_t io_handler_location_iid() const { return io_handler_location_iid_; }
+  void set_io_handler_location_iid(uint64_t value) { io_handler_location_iid_ = value; _has_field_.set(2); }
+
+ private:
+  bool sent_messages_in_queue_{};
+  uint64_t io_handler_location_iid_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_MESSAGE_PUMP_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_mojo_event_info.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_MOJO_EVENT_INFO_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_MOJO_EVENT_INFO_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeMojoEventInfo;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT ChromeMojoEventInfo : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kWatcherNotifyInterfaceTagFieldNumber = 1,
+    kIpcHashFieldNumber = 2,
+    kMojoInterfaceTagFieldNumber = 3,
+  };
+
+  ChromeMojoEventInfo();
+  ~ChromeMojoEventInfo() override;
+  ChromeMojoEventInfo(ChromeMojoEventInfo&&) noexcept;
+  ChromeMojoEventInfo& operator=(ChromeMojoEventInfo&&);
+  ChromeMojoEventInfo(const ChromeMojoEventInfo&);
+  ChromeMojoEventInfo& operator=(const ChromeMojoEventInfo&);
+  bool operator==(const ChromeMojoEventInfo&) const;
+  bool operator!=(const ChromeMojoEventInfo& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_watcher_notify_interface_tag() const { return _has_field_[1]; }
+  const std::string& watcher_notify_interface_tag() const { return watcher_notify_interface_tag_; }
+  void set_watcher_notify_interface_tag(const std::string& value) { watcher_notify_interface_tag_ = value; _has_field_.set(1); }
+
+  bool has_ipc_hash() const { return _has_field_[2]; }
+  uint32_t ipc_hash() const { return ipc_hash_; }
+  void set_ipc_hash(uint32_t value) { ipc_hash_ = value; _has_field_.set(2); }
+
+  bool has_mojo_interface_tag() const { return _has_field_[3]; }
+  const std::string& mojo_interface_tag() const { return mojo_interface_tag_; }
+  void set_mojo_interface_tag(const std::string& value) { mojo_interface_tag_ = value; _has_field_.set(3); }
+
+ private:
+  std::string watcher_notify_interface_tag_{};
+  uint32_t ipc_hash_{};
+  std::string mojo_interface_tag_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<4> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_MOJO_EVENT_INFO_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_process_descriptor.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_PROCESS_DESCRIPTOR_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_PROCESS_DESCRIPTOR_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeProcessDescriptor;
+enum ChromeProcessDescriptor_ProcessType : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum ChromeProcessDescriptor_ProcessType : int {
+  ChromeProcessDescriptor_ProcessType_PROCESS_UNSPECIFIED = 0,
+  ChromeProcessDescriptor_ProcessType_PROCESS_BROWSER = 1,
+  ChromeProcessDescriptor_ProcessType_PROCESS_RENDERER = 2,
+  ChromeProcessDescriptor_ProcessType_PROCESS_UTILITY = 3,
+  ChromeProcessDescriptor_ProcessType_PROCESS_ZYGOTE = 4,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SANDBOX_HELPER = 5,
+  ChromeProcessDescriptor_ProcessType_PROCESS_GPU = 6,
+  ChromeProcessDescriptor_ProcessType_PROCESS_PPAPI_PLUGIN = 7,
+  ChromeProcessDescriptor_ProcessType_PROCESS_PPAPI_BROKER = 8,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_NETWORK = 9,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_TRACING = 10,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_STORAGE = 11,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_AUDIO = 12,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_DATA_DECODER = 13,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_UTIL_WIN = 14,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PROXY_RESOLVER = 15,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_CDM = 16,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_VIDEO_CAPTURE = 17,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_UNZIPPER = 18,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_MIRRORING = 19,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_FILEPATCHER = 20,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_TTS = 21,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PRINTING = 22,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_QUARANTINE = 23,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_CROS_LOCALSEARCH = 24,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_CROS_ASSISTANT_AUDIO_DECODER = 25,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_FILEUTIL = 26,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PRINTCOMPOSITOR = 27,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PAINTPREVIEW = 28,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_SPEECHRECOGNITION = 29,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_XRDEVICE = 30,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_READICON = 31,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_LANGUAGEDETECTION = 32,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_SHARING = 33,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_MEDIAPARSER = 34,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_QRCODEGENERATOR = 35,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PROFILEIMPORT = 36,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_IME = 37,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_RECORDING = 38,
+  ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_SHAPEDETECTION = 39,
+};
+
+class PERFETTO_EXPORT ChromeProcessDescriptor : public ::protozero::CppMessageObj {
+ public:
+  using ProcessType = ChromeProcessDescriptor_ProcessType;
+  static constexpr auto PROCESS_UNSPECIFIED = ChromeProcessDescriptor_ProcessType_PROCESS_UNSPECIFIED;
+  static constexpr auto PROCESS_BROWSER = ChromeProcessDescriptor_ProcessType_PROCESS_BROWSER;
+  static constexpr auto PROCESS_RENDERER = ChromeProcessDescriptor_ProcessType_PROCESS_RENDERER;
+  static constexpr auto PROCESS_UTILITY = ChromeProcessDescriptor_ProcessType_PROCESS_UTILITY;
+  static constexpr auto PROCESS_ZYGOTE = ChromeProcessDescriptor_ProcessType_PROCESS_ZYGOTE;
+  static constexpr auto PROCESS_SANDBOX_HELPER = ChromeProcessDescriptor_ProcessType_PROCESS_SANDBOX_HELPER;
+  static constexpr auto PROCESS_GPU = ChromeProcessDescriptor_ProcessType_PROCESS_GPU;
+  static constexpr auto PROCESS_PPAPI_PLUGIN = ChromeProcessDescriptor_ProcessType_PROCESS_PPAPI_PLUGIN;
+  static constexpr auto PROCESS_PPAPI_BROKER = ChromeProcessDescriptor_ProcessType_PROCESS_PPAPI_BROKER;
+  static constexpr auto PROCESS_SERVICE_NETWORK = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_NETWORK;
+  static constexpr auto PROCESS_SERVICE_TRACING = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_TRACING;
+  static constexpr auto PROCESS_SERVICE_STORAGE = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_STORAGE;
+  static constexpr auto PROCESS_SERVICE_AUDIO = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_AUDIO;
+  static constexpr auto PROCESS_SERVICE_DATA_DECODER = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_DATA_DECODER;
+  static constexpr auto PROCESS_SERVICE_UTIL_WIN = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_UTIL_WIN;
+  static constexpr auto PROCESS_SERVICE_PROXY_RESOLVER = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PROXY_RESOLVER;
+  static constexpr auto PROCESS_SERVICE_CDM = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_CDM;
+  static constexpr auto PROCESS_SERVICE_VIDEO_CAPTURE = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_VIDEO_CAPTURE;
+  static constexpr auto PROCESS_SERVICE_UNZIPPER = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_UNZIPPER;
+  static constexpr auto PROCESS_SERVICE_MIRRORING = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_MIRRORING;
+  static constexpr auto PROCESS_SERVICE_FILEPATCHER = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_FILEPATCHER;
+  static constexpr auto PROCESS_SERVICE_TTS = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_TTS;
+  static constexpr auto PROCESS_SERVICE_PRINTING = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PRINTING;
+  static constexpr auto PROCESS_SERVICE_QUARANTINE = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_QUARANTINE;
+  static constexpr auto PROCESS_SERVICE_CROS_LOCALSEARCH = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_CROS_LOCALSEARCH;
+  static constexpr auto PROCESS_SERVICE_CROS_ASSISTANT_AUDIO_DECODER = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_CROS_ASSISTANT_AUDIO_DECODER;
+  static constexpr auto PROCESS_SERVICE_FILEUTIL = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_FILEUTIL;
+  static constexpr auto PROCESS_SERVICE_PRINTCOMPOSITOR = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PRINTCOMPOSITOR;
+  static constexpr auto PROCESS_SERVICE_PAINTPREVIEW = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PAINTPREVIEW;
+  static constexpr auto PROCESS_SERVICE_SPEECHRECOGNITION = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_SPEECHRECOGNITION;
+  static constexpr auto PROCESS_SERVICE_XRDEVICE = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_XRDEVICE;
+  static constexpr auto PROCESS_SERVICE_READICON = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_READICON;
+  static constexpr auto PROCESS_SERVICE_LANGUAGEDETECTION = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_LANGUAGEDETECTION;
+  static constexpr auto PROCESS_SERVICE_SHARING = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_SHARING;
+  static constexpr auto PROCESS_SERVICE_MEDIAPARSER = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_MEDIAPARSER;
+  static constexpr auto PROCESS_SERVICE_QRCODEGENERATOR = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_QRCODEGENERATOR;
+  static constexpr auto PROCESS_SERVICE_PROFILEIMPORT = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_PROFILEIMPORT;
+  static constexpr auto PROCESS_SERVICE_IME = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_IME;
+  static constexpr auto PROCESS_SERVICE_RECORDING = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_RECORDING;
+  static constexpr auto PROCESS_SERVICE_SHAPEDETECTION = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_SHAPEDETECTION;
+  static constexpr auto ProcessType_MIN = ChromeProcessDescriptor_ProcessType_PROCESS_UNSPECIFIED;
+  static constexpr auto ProcessType_MAX = ChromeProcessDescriptor_ProcessType_PROCESS_SERVICE_SHAPEDETECTION;
+  enum FieldNumbers {
+    kProcessTypeFieldNumber = 1,
+    kProcessPriorityFieldNumber = 2,
+    kLegacySortIndexFieldNumber = 3,
+    kHostAppPackageNameFieldNumber = 4,
+    kCrashTraceIdFieldNumber = 5,
+  };
+
+  ChromeProcessDescriptor();
+  ~ChromeProcessDescriptor() override;
+  ChromeProcessDescriptor(ChromeProcessDescriptor&&) noexcept;
+  ChromeProcessDescriptor& operator=(ChromeProcessDescriptor&&);
+  ChromeProcessDescriptor(const ChromeProcessDescriptor&);
+  ChromeProcessDescriptor& operator=(const ChromeProcessDescriptor&);
+  bool operator==(const ChromeProcessDescriptor&) const;
+  bool operator!=(const ChromeProcessDescriptor& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_process_type() const { return _has_field_[1]; }
+  ChromeProcessDescriptor_ProcessType process_type() const { return process_type_; }
+  void set_process_type(ChromeProcessDescriptor_ProcessType value) { process_type_ = value; _has_field_.set(1); }
+
+  bool has_process_priority() const { return _has_field_[2]; }
+  int32_t process_priority() const { return process_priority_; }
+  void set_process_priority(int32_t value) { process_priority_ = value; _has_field_.set(2); }
+
+  bool has_legacy_sort_index() const { return _has_field_[3]; }
+  int32_t legacy_sort_index() const { return legacy_sort_index_; }
+  void set_legacy_sort_index(int32_t value) { legacy_sort_index_ = value; _has_field_.set(3); }
+
+  bool has_host_app_package_name() const { return _has_field_[4]; }
+  const std::string& host_app_package_name() const { return host_app_package_name_; }
+  void set_host_app_package_name(const std::string& value) { host_app_package_name_ = value; _has_field_.set(4); }
+
+  bool has_crash_trace_id() const { return _has_field_[5]; }
+  uint64_t crash_trace_id() const { return crash_trace_id_; }
+  void set_crash_trace_id(uint64_t value) { crash_trace_id_ = value; _has_field_.set(5); }
+
+ private:
+  ChromeProcessDescriptor_ProcessType process_type_{};
+  int32_t process_priority_{};
+  int32_t legacy_sort_index_{};
+  std::string host_app_package_name_{};
+  uint64_t crash_trace_id_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<6> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_PROCESS_DESCRIPTOR_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_renderer_scheduler_state.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_RENDERER_SCHEDULER_STATE_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_RENDERER_SCHEDULER_STATE_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeRendererSchedulerState;
+enum ChromeRAILMode : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum ChromeRAILMode : int {
+  RAIL_MODE_NONE = 0,
+  RAIL_MODE_RESPONSE = 1,
+  RAIL_MODE_ANIMATION = 2,
+  RAIL_MODE_IDLE = 3,
+  RAIL_MODE_LOAD = 4,
+};
+
+class PERFETTO_EXPORT ChromeRendererSchedulerState : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kRailModeFieldNumber = 1,
+  };
+
+  ChromeRendererSchedulerState();
+  ~ChromeRendererSchedulerState() override;
+  ChromeRendererSchedulerState(ChromeRendererSchedulerState&&) noexcept;
+  ChromeRendererSchedulerState& operator=(ChromeRendererSchedulerState&&);
+  ChromeRendererSchedulerState(const ChromeRendererSchedulerState&);
+  ChromeRendererSchedulerState& operator=(const ChromeRendererSchedulerState&);
+  bool operator==(const ChromeRendererSchedulerState&) const;
+  bool operator!=(const ChromeRendererSchedulerState& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_rail_mode() const { return _has_field_[1]; }
+  ChromeRAILMode rail_mode() const { return rail_mode_; }
+  void set_rail_mode(ChromeRAILMode value) { rail_mode_ = value; _has_field_.set(1); }
+
+ private:
+  ChromeRAILMode rail_mode_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_RENDERER_SCHEDULER_STATE_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_thread_descriptor.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_THREAD_DESCRIPTOR_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_THREAD_DESCRIPTOR_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeThreadDescriptor;
+enum ChromeThreadDescriptor_ThreadType : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum ChromeThreadDescriptor_ThreadType : int {
+  ChromeThreadDescriptor_ThreadType_THREAD_UNSPECIFIED = 0,
+  ChromeThreadDescriptor_ThreadType_THREAD_MAIN = 1,
+  ChromeThreadDescriptor_ThreadType_THREAD_IO = 2,
+  ChromeThreadDescriptor_ThreadType_THREAD_POOL_BG_WORKER = 3,
+  ChromeThreadDescriptor_ThreadType_THREAD_POOL_FG_WORKER = 4,
+  ChromeThreadDescriptor_ThreadType_THREAD_POOL_FG_BLOCKING = 5,
+  ChromeThreadDescriptor_ThreadType_THREAD_POOL_BG_BLOCKING = 6,
+  ChromeThreadDescriptor_ThreadType_THREAD_POOL_SERVICE = 7,
+  ChromeThreadDescriptor_ThreadType_THREAD_COMPOSITOR = 8,
+  ChromeThreadDescriptor_ThreadType_THREAD_VIZ_COMPOSITOR = 9,
+  ChromeThreadDescriptor_ThreadType_THREAD_COMPOSITOR_WORKER = 10,
+  ChromeThreadDescriptor_ThreadType_THREAD_SERVICE_WORKER = 11,
+  ChromeThreadDescriptor_ThreadType_THREAD_NETWORK_SERVICE = 12,
+  ChromeThreadDescriptor_ThreadType_THREAD_CHILD_IO = 13,
+  ChromeThreadDescriptor_ThreadType_THREAD_BROWSER_IO = 14,
+  ChromeThreadDescriptor_ThreadType_THREAD_BROWSER_MAIN = 15,
+  ChromeThreadDescriptor_ThreadType_THREAD_RENDERER_MAIN = 16,
+  ChromeThreadDescriptor_ThreadType_THREAD_UTILITY_MAIN = 17,
+  ChromeThreadDescriptor_ThreadType_THREAD_GPU_MAIN = 18,
+  ChromeThreadDescriptor_ThreadType_THREAD_CACHE_BLOCKFILE = 19,
+  ChromeThreadDescriptor_ThreadType_THREAD_MEDIA = 20,
+  ChromeThreadDescriptor_ThreadType_THREAD_AUDIO_OUTPUTDEVICE = 21,
+  ChromeThreadDescriptor_ThreadType_THREAD_AUDIO_INPUTDEVICE = 22,
+  ChromeThreadDescriptor_ThreadType_THREAD_GPU_MEMORY = 23,
+  ChromeThreadDescriptor_ThreadType_THREAD_GPU_VSYNC = 24,
+  ChromeThreadDescriptor_ThreadType_THREAD_DXA_VIDEODECODER = 25,
+  ChromeThreadDescriptor_ThreadType_THREAD_BROWSER_WATCHDOG = 26,
+  ChromeThreadDescriptor_ThreadType_THREAD_WEBRTC_NETWORK = 27,
+  ChromeThreadDescriptor_ThreadType_THREAD_WINDOW_OWNER = 28,
+  ChromeThreadDescriptor_ThreadType_THREAD_WEBRTC_SIGNALING = 29,
+  ChromeThreadDescriptor_ThreadType_THREAD_WEBRTC_WORKER = 30,
+  ChromeThreadDescriptor_ThreadType_THREAD_PPAPI_MAIN = 31,
+  ChromeThreadDescriptor_ThreadType_THREAD_GPU_WATCHDOG = 32,
+  ChromeThreadDescriptor_ThreadType_THREAD_SWAPPER = 33,
+  ChromeThreadDescriptor_ThreadType_THREAD_GAMEPAD_POLLING = 34,
+  ChromeThreadDescriptor_ThreadType_THREAD_WEBCRYPTO = 35,
+  ChromeThreadDescriptor_ThreadType_THREAD_DATABASE = 36,
+  ChromeThreadDescriptor_ThreadType_THREAD_PROXYRESOLVER = 37,
+  ChromeThreadDescriptor_ThreadType_THREAD_DEVTOOLSADB = 38,
+  ChromeThreadDescriptor_ThreadType_THREAD_NETWORKCONFIGWATCHER = 39,
+  ChromeThreadDescriptor_ThreadType_THREAD_WASAPI_RENDER = 40,
+  ChromeThreadDescriptor_ThreadType_THREAD_MEMORY_INFRA = 50,
+  ChromeThreadDescriptor_ThreadType_THREAD_SAMPLING_PROFILER = 51,
+};
+
+class PERFETTO_EXPORT ChromeThreadDescriptor : public ::protozero::CppMessageObj {
+ public:
+  using ThreadType = ChromeThreadDescriptor_ThreadType;
+  static constexpr auto THREAD_UNSPECIFIED = ChromeThreadDescriptor_ThreadType_THREAD_UNSPECIFIED;
+  static constexpr auto THREAD_MAIN = ChromeThreadDescriptor_ThreadType_THREAD_MAIN;
+  static constexpr auto THREAD_IO = ChromeThreadDescriptor_ThreadType_THREAD_IO;
+  static constexpr auto THREAD_POOL_BG_WORKER = ChromeThreadDescriptor_ThreadType_THREAD_POOL_BG_WORKER;
+  static constexpr auto THREAD_POOL_FG_WORKER = ChromeThreadDescriptor_ThreadType_THREAD_POOL_FG_WORKER;
+  static constexpr auto THREAD_POOL_FG_BLOCKING = ChromeThreadDescriptor_ThreadType_THREAD_POOL_FG_BLOCKING;
+  static constexpr auto THREAD_POOL_BG_BLOCKING = ChromeThreadDescriptor_ThreadType_THREAD_POOL_BG_BLOCKING;
+  static constexpr auto THREAD_POOL_SERVICE = ChromeThreadDescriptor_ThreadType_THREAD_POOL_SERVICE;
+  static constexpr auto THREAD_COMPOSITOR = ChromeThreadDescriptor_ThreadType_THREAD_COMPOSITOR;
+  static constexpr auto THREAD_VIZ_COMPOSITOR = ChromeThreadDescriptor_ThreadType_THREAD_VIZ_COMPOSITOR;
+  static constexpr auto THREAD_COMPOSITOR_WORKER = ChromeThreadDescriptor_ThreadType_THREAD_COMPOSITOR_WORKER;
+  static constexpr auto THREAD_SERVICE_WORKER = ChromeThreadDescriptor_ThreadType_THREAD_SERVICE_WORKER;
+  static constexpr auto THREAD_NETWORK_SERVICE = ChromeThreadDescriptor_ThreadType_THREAD_NETWORK_SERVICE;
+  static constexpr auto THREAD_CHILD_IO = ChromeThreadDescriptor_ThreadType_THREAD_CHILD_IO;
+  static constexpr auto THREAD_BROWSER_IO = ChromeThreadDescriptor_ThreadType_THREAD_BROWSER_IO;
+  static constexpr auto THREAD_BROWSER_MAIN = ChromeThreadDescriptor_ThreadType_THREAD_BROWSER_MAIN;
+  static constexpr auto THREAD_RENDERER_MAIN = ChromeThreadDescriptor_ThreadType_THREAD_RENDERER_MAIN;
+  static constexpr auto THREAD_UTILITY_MAIN = ChromeThreadDescriptor_ThreadType_THREAD_UTILITY_MAIN;
+  static constexpr auto THREAD_GPU_MAIN = ChromeThreadDescriptor_ThreadType_THREAD_GPU_MAIN;
+  static constexpr auto THREAD_CACHE_BLOCKFILE = ChromeThreadDescriptor_ThreadType_THREAD_CACHE_BLOCKFILE;
+  static constexpr auto THREAD_MEDIA = ChromeThreadDescriptor_ThreadType_THREAD_MEDIA;
+  static constexpr auto THREAD_AUDIO_OUTPUTDEVICE = ChromeThreadDescriptor_ThreadType_THREAD_AUDIO_OUTPUTDEVICE;
+  static constexpr auto THREAD_AUDIO_INPUTDEVICE = ChromeThreadDescriptor_ThreadType_THREAD_AUDIO_INPUTDEVICE;
+  static constexpr auto THREAD_GPU_MEMORY = ChromeThreadDescriptor_ThreadType_THREAD_GPU_MEMORY;
+  static constexpr auto THREAD_GPU_VSYNC = ChromeThreadDescriptor_ThreadType_THREAD_GPU_VSYNC;
+  static constexpr auto THREAD_DXA_VIDEODECODER = ChromeThreadDescriptor_ThreadType_THREAD_DXA_VIDEODECODER;
+  static constexpr auto THREAD_BROWSER_WATCHDOG = ChromeThreadDescriptor_ThreadType_THREAD_BROWSER_WATCHDOG;
+  static constexpr auto THREAD_WEBRTC_NETWORK = ChromeThreadDescriptor_ThreadType_THREAD_WEBRTC_NETWORK;
+  static constexpr auto THREAD_WINDOW_OWNER = ChromeThreadDescriptor_ThreadType_THREAD_WINDOW_OWNER;
+  static constexpr auto THREAD_WEBRTC_SIGNALING = ChromeThreadDescriptor_ThreadType_THREAD_WEBRTC_SIGNALING;
+  static constexpr auto THREAD_WEBRTC_WORKER = ChromeThreadDescriptor_ThreadType_THREAD_WEBRTC_WORKER;
+  static constexpr auto THREAD_PPAPI_MAIN = ChromeThreadDescriptor_ThreadType_THREAD_PPAPI_MAIN;
+  static constexpr auto THREAD_GPU_WATCHDOG = ChromeThreadDescriptor_ThreadType_THREAD_GPU_WATCHDOG;
+  static constexpr auto THREAD_SWAPPER = ChromeThreadDescriptor_ThreadType_THREAD_SWAPPER;
+  static constexpr auto THREAD_GAMEPAD_POLLING = ChromeThreadDescriptor_ThreadType_THREAD_GAMEPAD_POLLING;
+  static constexpr auto THREAD_WEBCRYPTO = ChromeThreadDescriptor_ThreadType_THREAD_WEBCRYPTO;
+  static constexpr auto THREAD_DATABASE = ChromeThreadDescriptor_ThreadType_THREAD_DATABASE;
+  static constexpr auto THREAD_PROXYRESOLVER = ChromeThreadDescriptor_ThreadType_THREAD_PROXYRESOLVER;
+  static constexpr auto THREAD_DEVTOOLSADB = ChromeThreadDescriptor_ThreadType_THREAD_DEVTOOLSADB;
+  static constexpr auto THREAD_NETWORKCONFIGWATCHER = ChromeThreadDescriptor_ThreadType_THREAD_NETWORKCONFIGWATCHER;
+  static constexpr auto THREAD_WASAPI_RENDER = ChromeThreadDescriptor_ThreadType_THREAD_WASAPI_RENDER;
+  static constexpr auto THREAD_MEMORY_INFRA = ChromeThreadDescriptor_ThreadType_THREAD_MEMORY_INFRA;
+  static constexpr auto THREAD_SAMPLING_PROFILER = ChromeThreadDescriptor_ThreadType_THREAD_SAMPLING_PROFILER;
+  static constexpr auto ThreadType_MIN = ChromeThreadDescriptor_ThreadType_THREAD_UNSPECIFIED;
+  static constexpr auto ThreadType_MAX = ChromeThreadDescriptor_ThreadType_THREAD_SAMPLING_PROFILER;
+  enum FieldNumbers {
+    kThreadTypeFieldNumber = 1,
+    kLegacySortIndexFieldNumber = 2,
+  };
+
+  ChromeThreadDescriptor();
+  ~ChromeThreadDescriptor() override;
+  ChromeThreadDescriptor(ChromeThreadDescriptor&&) noexcept;
+  ChromeThreadDescriptor& operator=(ChromeThreadDescriptor&&);
+  ChromeThreadDescriptor(const ChromeThreadDescriptor&);
+  ChromeThreadDescriptor& operator=(const ChromeThreadDescriptor&);
+  bool operator==(const ChromeThreadDescriptor&) const;
+  bool operator!=(const ChromeThreadDescriptor& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_thread_type() const { return _has_field_[1]; }
+  ChromeThreadDescriptor_ThreadType thread_type() const { return thread_type_; }
+  void set_thread_type(ChromeThreadDescriptor_ThreadType value) { thread_type_ = value; _has_field_.set(1); }
+
+  bool has_legacy_sort_index() const { return _has_field_[2]; }
+  int32_t legacy_sort_index() const { return legacy_sort_index_; }
+  void set_legacy_sort_index(int32_t value) { legacy_sort_index_ = value; _has_field_.set(2); }
+
+ private:
+  ChromeThreadDescriptor_ThreadType thread_type_{};
+  int32_t legacy_sort_index_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_THREAD_DESCRIPTOR_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_user_event.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_USER_EVENT_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_USER_EVENT_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeUserEvent;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT ChromeUserEvent : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kActionFieldNumber = 1,
+    kActionHashFieldNumber = 2,
+  };
+
+  ChromeUserEvent();
+  ~ChromeUserEvent() override;
+  ChromeUserEvent(ChromeUserEvent&&) noexcept;
+  ChromeUserEvent& operator=(ChromeUserEvent&&);
+  ChromeUserEvent(const ChromeUserEvent&);
+  ChromeUserEvent& operator=(const ChromeUserEvent&);
+  bool operator==(const ChromeUserEvent&) const;
+  bool operator!=(const ChromeUserEvent& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_action() const { return _has_field_[1]; }
+  const std::string& action() const { return action_; }
+  void set_action(const std::string& value) { action_ = value; _has_field_.set(1); }
+
+  bool has_action_hash() const { return _has_field_[2]; }
+  uint64_t action_hash() const { return action_hash_; }
+  void set_action_hash(uint64_t value) { action_hash_ = value; _has_field_.set(2); }
+
+ private:
+  std::string action_{};
+  uint64_t action_hash_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_USER_EVENT_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_window_handle_event_info.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_WINDOW_HANDLE_EVENT_INFO_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_WINDOW_HANDLE_EVENT_INFO_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeWindowHandleEventInfo;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT ChromeWindowHandleEventInfo : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDpiFieldNumber = 1,
+    kMessageIdFieldNumber = 2,
+    kHwndPtrFieldNumber = 3,
+  };
+
+  ChromeWindowHandleEventInfo();
+  ~ChromeWindowHandleEventInfo() override;
+  ChromeWindowHandleEventInfo(ChromeWindowHandleEventInfo&&) noexcept;
+  ChromeWindowHandleEventInfo& operator=(ChromeWindowHandleEventInfo&&);
+  ChromeWindowHandleEventInfo(const ChromeWindowHandleEventInfo&);
+  ChromeWindowHandleEventInfo& operator=(const ChromeWindowHandleEventInfo&);
+  bool operator==(const ChromeWindowHandleEventInfo&) const;
+  bool operator!=(const ChromeWindowHandleEventInfo& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_dpi() const { return _has_field_[1]; }
+  uint32_t dpi() const { return dpi_; }
+  void set_dpi(uint32_t value) { dpi_ = value; _has_field_.set(1); }
+
+  bool has_message_id() const { return _has_field_[2]; }
+  uint32_t message_id() const { return message_id_; }
+  void set_message_id(uint32_t value) { message_id_ = value; _has_field_.set(2); }
+
+  bool has_hwnd_ptr() const { return _has_field_[3]; }
+  uint64_t hwnd_ptr() const { return hwnd_ptr_; }
+  void set_hwnd_ptr(uint64_t value) { hwnd_ptr_ = value; _has_field_.set(3); }
+
+ private:
+  uint32_t dpi_{};
+  uint32_t message_id_{};
+  uint64_t hwnd_ptr_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<4> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_WINDOW_HANDLE_EVENT_INFO_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/counter_descriptor.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_COUNTER_DESCRIPTOR_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_COUNTER_DESCRIPTOR_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class CounterDescriptor;
+enum CounterDescriptor_BuiltinCounterType : int;
+enum CounterDescriptor_Unit : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum CounterDescriptor_BuiltinCounterType : int {
+  CounterDescriptor_BuiltinCounterType_COUNTER_UNSPECIFIED = 0,
+  CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_TIME_NS = 1,
+  CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_INSTRUCTION_COUNT = 2,
+};
+enum CounterDescriptor_Unit : int {
+  CounterDescriptor_Unit_UNIT_UNSPECIFIED = 0,
+  CounterDescriptor_Unit_UNIT_TIME_NS = 1,
+  CounterDescriptor_Unit_UNIT_COUNT = 2,
+  CounterDescriptor_Unit_UNIT_SIZE_BYTES = 3,
+};
+
+class PERFETTO_EXPORT CounterDescriptor : public ::protozero::CppMessageObj {
+ public:
+  using BuiltinCounterType = CounterDescriptor_BuiltinCounterType;
+  static constexpr auto COUNTER_UNSPECIFIED = CounterDescriptor_BuiltinCounterType_COUNTER_UNSPECIFIED;
+  static constexpr auto COUNTER_THREAD_TIME_NS = CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_TIME_NS;
+  static constexpr auto COUNTER_THREAD_INSTRUCTION_COUNT = CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_INSTRUCTION_COUNT;
+  static constexpr auto BuiltinCounterType_MIN = CounterDescriptor_BuiltinCounterType_COUNTER_UNSPECIFIED;
+  static constexpr auto BuiltinCounterType_MAX = CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_INSTRUCTION_COUNT;
+  using Unit = CounterDescriptor_Unit;
+  static constexpr auto UNIT_UNSPECIFIED = CounterDescriptor_Unit_UNIT_UNSPECIFIED;
+  static constexpr auto UNIT_TIME_NS = CounterDescriptor_Unit_UNIT_TIME_NS;
+  static constexpr auto UNIT_COUNT = CounterDescriptor_Unit_UNIT_COUNT;
+  static constexpr auto UNIT_SIZE_BYTES = CounterDescriptor_Unit_UNIT_SIZE_BYTES;
+  static constexpr auto Unit_MIN = CounterDescriptor_Unit_UNIT_UNSPECIFIED;
+  static constexpr auto Unit_MAX = CounterDescriptor_Unit_UNIT_SIZE_BYTES;
+  enum FieldNumbers {
+    kTypeFieldNumber = 1,
+    kCategoriesFieldNumber = 2,
+    kUnitFieldNumber = 3,
+    kUnitNameFieldNumber = 6,
+    kUnitMultiplierFieldNumber = 4,
+    kIsIncrementalFieldNumber = 5,
+  };
+
+  CounterDescriptor();
+  ~CounterDescriptor() override;
+  CounterDescriptor(CounterDescriptor&&) noexcept;
+  CounterDescriptor& operator=(CounterDescriptor&&);
+  CounterDescriptor(const CounterDescriptor&);
+  CounterDescriptor& operator=(const CounterDescriptor&);
+  bool operator==(const CounterDescriptor&) const;
+  bool operator!=(const CounterDescriptor& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_type() const { return _has_field_[1]; }
+  CounterDescriptor_BuiltinCounterType type() const { return type_; }
+  void set_type(CounterDescriptor_BuiltinCounterType value) { type_ = value; _has_field_.set(1); }
+
+  const std::vector<std::string>& categories() const { return categories_; }
+  std::vector<std::string>* mutable_categories() { return &categories_; }
+  int categories_size() const { return static_cast<int>(categories_.size()); }
+  void clear_categories() { categories_.clear(); }
+  void add_categories(std::string value) { categories_.emplace_back(value); }
+  std::string* add_categories() { categories_.emplace_back(); return &categories_.back(); }
+
+  bool has_unit() const { return _has_field_[3]; }
+  CounterDescriptor_Unit unit() const { return unit_; }
+  void set_unit(CounterDescriptor_Unit value) { unit_ = value; _has_field_.set(3); }
+
+  bool has_unit_name() const { return _has_field_[6]; }
+  const std::string& unit_name() const { return unit_name_; }
+  void set_unit_name(const std::string& value) { unit_name_ = value; _has_field_.set(6); }
+
+  bool has_unit_multiplier() const { return _has_field_[4]; }
+  int64_t unit_multiplier() const { return unit_multiplier_; }
+  void set_unit_multiplier(int64_t value) { unit_multiplier_ = value; _has_field_.set(4); }
+
+  bool has_is_incremental() const { return _has_field_[5]; }
+  bool is_incremental() const { return is_incremental_; }
+  void set_is_incremental(bool value) { is_incremental_ = value; _has_field_.set(5); }
+
+ private:
+  CounterDescriptor_BuiltinCounterType type_{};
+  std::vector<std::string> categories_;
+  CounterDescriptor_Unit unit_{};
+  std::string unit_name_{};
+  int64_t unit_multiplier_{};
+  bool is_incremental_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<7> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_COUNTER_DESCRIPTOR_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/debug_annotation.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_DEBUG_ANNOTATION_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_DEBUG_ANNOTATION_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class DebugAnnotationName;
+class DebugAnnotation;
+class DebugAnnotation_NestedValue;
+enum DebugAnnotation_NestedValue_NestedType : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum DebugAnnotation_NestedValue_NestedType : int {
+  DebugAnnotation_NestedValue_NestedType_UNSPECIFIED = 0,
+  DebugAnnotation_NestedValue_NestedType_DICT = 1,
+  DebugAnnotation_NestedValue_NestedType_ARRAY = 2,
+};
+
+class PERFETTO_EXPORT DebugAnnotationName : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kIidFieldNumber = 1,
+    kNameFieldNumber = 2,
+  };
+
+  DebugAnnotationName();
+  ~DebugAnnotationName() override;
+  DebugAnnotationName(DebugAnnotationName&&) noexcept;
+  DebugAnnotationName& operator=(DebugAnnotationName&&);
+  DebugAnnotationName(const DebugAnnotationName&);
+  DebugAnnotationName& operator=(const DebugAnnotationName&);
+  bool operator==(const DebugAnnotationName&) const;
+  bool operator!=(const DebugAnnotationName& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_iid() const { return _has_field_[1]; }
+  uint64_t iid() const { return iid_; }
+  void set_iid(uint64_t value) { iid_ = value; _has_field_.set(1); }
+
+  bool has_name() const { return _has_field_[2]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(2); }
+
+ private:
+  uint64_t iid_{};
+  std::string name_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT DebugAnnotation : public ::protozero::CppMessageObj {
+ public:
+  using NestedValue = DebugAnnotation_NestedValue;
+  enum FieldNumbers {
+    kNameIidFieldNumber = 1,
+    kNameFieldNumber = 10,
+    kBoolValueFieldNumber = 2,
+    kUintValueFieldNumber = 3,
+    kIntValueFieldNumber = 4,
+    kDoubleValueFieldNumber = 5,
+    kStringValueFieldNumber = 6,
+    kPointerValueFieldNumber = 7,
+    kNestedValueFieldNumber = 8,
+    kLegacyJsonValueFieldNumber = 9,
+    kDictEntriesFieldNumber = 11,
+    kArrayValuesFieldNumber = 12,
+  };
+
+  DebugAnnotation();
+  ~DebugAnnotation() override;
+  DebugAnnotation(DebugAnnotation&&) noexcept;
+  DebugAnnotation& operator=(DebugAnnotation&&);
+  DebugAnnotation(const DebugAnnotation&);
+  DebugAnnotation& operator=(const DebugAnnotation&);
+  bool operator==(const DebugAnnotation&) const;
+  bool operator!=(const DebugAnnotation& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name_iid() const { return _has_field_[1]; }
+  uint64_t name_iid() const { return name_iid_; }
+  void set_name_iid(uint64_t value) { name_iid_ = value; _has_field_.set(1); }
+
+  bool has_name() const { return _has_field_[10]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(10); }
+
+  bool has_bool_value() const { return _has_field_[2]; }
+  bool bool_value() const { return bool_value_; }
+  void set_bool_value(bool value) { bool_value_ = value; _has_field_.set(2); }
+
+  bool has_uint_value() const { return _has_field_[3]; }
+  uint64_t uint_value() const { return uint_value_; }
+  void set_uint_value(uint64_t value) { uint_value_ = value; _has_field_.set(3); }
+
+  bool has_int_value() const { return _has_field_[4]; }
+  int64_t int_value() const { return int_value_; }
+  void set_int_value(int64_t value) { int_value_ = value; _has_field_.set(4); }
+
+  bool has_double_value() const { return _has_field_[5]; }
+  double double_value() const { return double_value_; }
+  void set_double_value(double value) { double_value_ = value; _has_field_.set(5); }
+
+  bool has_string_value() const { return _has_field_[6]; }
+  const std::string& string_value() const { return string_value_; }
+  void set_string_value(const std::string& value) { string_value_ = value; _has_field_.set(6); }
+
+  bool has_pointer_value() const { return _has_field_[7]; }
+  uint64_t pointer_value() const { return pointer_value_; }
+  void set_pointer_value(uint64_t value) { pointer_value_ = value; _has_field_.set(7); }
+
+  bool has_nested_value() const { return _has_field_[8]; }
+  const DebugAnnotation_NestedValue& nested_value() const { return *nested_value_; }
+  DebugAnnotation_NestedValue* mutable_nested_value() { _has_field_.set(8); return nested_value_.get(); }
+
+  bool has_legacy_json_value() const { return _has_field_[9]; }
+  const std::string& legacy_json_value() const { return legacy_json_value_; }
+  void set_legacy_json_value(const std::string& value) { legacy_json_value_ = value; _has_field_.set(9); }
+
+  const std::vector<DebugAnnotation>& dict_entries() const { return dict_entries_; }
+  std::vector<DebugAnnotation>* mutable_dict_entries() { return &dict_entries_; }
+  int dict_entries_size() const;
+  void clear_dict_entries();
+  DebugAnnotation* add_dict_entries();
+
+  const std::vector<DebugAnnotation>& array_values() const { return array_values_; }
+  std::vector<DebugAnnotation>* mutable_array_values() { return &array_values_; }
+  int array_values_size() const;
+  void clear_array_values();
+  DebugAnnotation* add_array_values();
+
+ private:
+  uint64_t name_iid_{};
+  std::string name_{};
+  bool bool_value_{};
+  uint64_t uint_value_{};
+  int64_t int_value_{};
+  double double_value_{};
+  std::string string_value_{};
+  uint64_t pointer_value_{};
+  ::protozero::CopyablePtr<DebugAnnotation_NestedValue> nested_value_;
+  std::string legacy_json_value_{};
+  std::vector<DebugAnnotation> dict_entries_;
+  std::vector<DebugAnnotation> array_values_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<13> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT DebugAnnotation_NestedValue : public ::protozero::CppMessageObj {
+ public:
+  using NestedType = DebugAnnotation_NestedValue_NestedType;
+  static constexpr auto UNSPECIFIED = DebugAnnotation_NestedValue_NestedType_UNSPECIFIED;
+  static constexpr auto DICT = DebugAnnotation_NestedValue_NestedType_DICT;
+  static constexpr auto ARRAY = DebugAnnotation_NestedValue_NestedType_ARRAY;
+  static constexpr auto NestedType_MIN = DebugAnnotation_NestedValue_NestedType_UNSPECIFIED;
+  static constexpr auto NestedType_MAX = DebugAnnotation_NestedValue_NestedType_ARRAY;
+  enum FieldNumbers {
+    kNestedTypeFieldNumber = 1,
+    kDictKeysFieldNumber = 2,
+    kDictValuesFieldNumber = 3,
+    kArrayValuesFieldNumber = 4,
+    kIntValueFieldNumber = 5,
+    kDoubleValueFieldNumber = 6,
+    kBoolValueFieldNumber = 7,
+    kStringValueFieldNumber = 8,
+  };
+
+  DebugAnnotation_NestedValue();
+  ~DebugAnnotation_NestedValue() override;
+  DebugAnnotation_NestedValue(DebugAnnotation_NestedValue&&) noexcept;
+  DebugAnnotation_NestedValue& operator=(DebugAnnotation_NestedValue&&);
+  DebugAnnotation_NestedValue(const DebugAnnotation_NestedValue&);
+  DebugAnnotation_NestedValue& operator=(const DebugAnnotation_NestedValue&);
+  bool operator==(const DebugAnnotation_NestedValue&) const;
+  bool operator!=(const DebugAnnotation_NestedValue& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_nested_type() const { return _has_field_[1]; }
+  DebugAnnotation_NestedValue_NestedType nested_type() const { return nested_type_; }
+  void set_nested_type(DebugAnnotation_NestedValue_NestedType value) { nested_type_ = value; _has_field_.set(1); }
+
+  const std::vector<std::string>& dict_keys() const { return dict_keys_; }
+  std::vector<std::string>* mutable_dict_keys() { return &dict_keys_; }
+  int dict_keys_size() const { return static_cast<int>(dict_keys_.size()); }
+  void clear_dict_keys() { dict_keys_.clear(); }
+  void add_dict_keys(std::string value) { dict_keys_.emplace_back(value); }
+  std::string* add_dict_keys() { dict_keys_.emplace_back(); return &dict_keys_.back(); }
+
+  const std::vector<DebugAnnotation_NestedValue>& dict_values() const { return dict_values_; }
+  std::vector<DebugAnnotation_NestedValue>* mutable_dict_values() { return &dict_values_; }
+  int dict_values_size() const;
+  void clear_dict_values();
+  DebugAnnotation_NestedValue* add_dict_values();
+
+  const std::vector<DebugAnnotation_NestedValue>& array_values() const { return array_values_; }
+  std::vector<DebugAnnotation_NestedValue>* mutable_array_values() { return &array_values_; }
+  int array_values_size() const;
+  void clear_array_values();
+  DebugAnnotation_NestedValue* add_array_values();
+
+  bool has_int_value() const { return _has_field_[5]; }
+  int64_t int_value() const { return int_value_; }
+  void set_int_value(int64_t value) { int_value_ = value; _has_field_.set(5); }
+
+  bool has_double_value() const { return _has_field_[6]; }
+  double double_value() const { return double_value_; }
+  void set_double_value(double value) { double_value_ = value; _has_field_.set(6); }
+
+  bool has_bool_value() const { return _has_field_[7]; }
+  bool bool_value() const { return bool_value_; }
+  void set_bool_value(bool value) { bool_value_ = value; _has_field_.set(7); }
+
+  bool has_string_value() const { return _has_field_[8]; }
+  const std::string& string_value() const { return string_value_; }
+  void set_string_value(const std::string& value) { string_value_ = value; _has_field_.set(8); }
+
+ private:
+  DebugAnnotation_NestedValue_NestedType nested_type_{};
+  std::vector<std::string> dict_keys_;
+  std::vector<DebugAnnotation_NestedValue> dict_values_;
+  std::vector<DebugAnnotation_NestedValue> array_values_;
+  int64_t int_value_{};
+  double double_value_{};
+  bool bool_value_{};
+  std::string string_value_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<9> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_DEBUG_ANNOTATION_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/log_message.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_LOG_MESSAGE_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_LOG_MESSAGE_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class LogMessageBody;
+class LogMessage;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT LogMessageBody : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kIidFieldNumber = 1,
+    kBodyFieldNumber = 2,
+  };
+
+  LogMessageBody();
+  ~LogMessageBody() override;
+  LogMessageBody(LogMessageBody&&) noexcept;
+  LogMessageBody& operator=(LogMessageBody&&);
+  LogMessageBody(const LogMessageBody&);
+  LogMessageBody& operator=(const LogMessageBody&);
+  bool operator==(const LogMessageBody&) const;
+  bool operator!=(const LogMessageBody& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_iid() const { return _has_field_[1]; }
+  uint64_t iid() const { return iid_; }
+  void set_iid(uint64_t value) { iid_ = value; _has_field_.set(1); }
+
+  bool has_body() const { return _has_field_[2]; }
+  const std::string& body() const { return body_; }
+  void set_body(const std::string& value) { body_ = value; _has_field_.set(2); }
+
+ private:
+  uint64_t iid_{};
+  std::string body_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT LogMessage : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kSourceLocationIidFieldNumber = 1,
+    kBodyIidFieldNumber = 2,
+  };
+
+  LogMessage();
+  ~LogMessage() override;
+  LogMessage(LogMessage&&) noexcept;
+  LogMessage& operator=(LogMessage&&);
+  LogMessage(const LogMessage&);
+  LogMessage& operator=(const LogMessage&);
+  bool operator==(const LogMessage&) const;
+  bool operator!=(const LogMessage& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_source_location_iid() const { return _has_field_[1]; }
+  uint64_t source_location_iid() const { return source_location_iid_; }
+  void set_source_location_iid(uint64_t value) { source_location_iid_ = value; _has_field_.set(1); }
+
+  bool has_body_iid() const { return _has_field_[2]; }
+  uint64_t body_iid() const { return body_iid_; }
+  void set_body_iid(uint64_t value) { body_iid_ = value; _has_field_.set(2); }
+
+ private:
+  uint64_t source_location_iid_{};
+  uint64_t body_iid_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_LOG_MESSAGE_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/process_descriptor.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_PROCESS_DESCRIPTOR_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_PROCESS_DESCRIPTOR_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ProcessDescriptor;
+enum ProcessDescriptor_ChromeProcessType : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum ProcessDescriptor_ChromeProcessType : int {
+  ProcessDescriptor_ChromeProcessType_PROCESS_UNSPECIFIED = 0,
+  ProcessDescriptor_ChromeProcessType_PROCESS_BROWSER = 1,
+  ProcessDescriptor_ChromeProcessType_PROCESS_RENDERER = 2,
+  ProcessDescriptor_ChromeProcessType_PROCESS_UTILITY = 3,
+  ProcessDescriptor_ChromeProcessType_PROCESS_ZYGOTE = 4,
+  ProcessDescriptor_ChromeProcessType_PROCESS_SANDBOX_HELPER = 5,
+  ProcessDescriptor_ChromeProcessType_PROCESS_GPU = 6,
+  ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_PLUGIN = 7,
+  ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_BROKER = 8,
+};
+
+class PERFETTO_EXPORT ProcessDescriptor : public ::protozero::CppMessageObj {
+ public:
+  using ChromeProcessType = ProcessDescriptor_ChromeProcessType;
+  static constexpr auto PROCESS_UNSPECIFIED = ProcessDescriptor_ChromeProcessType_PROCESS_UNSPECIFIED;
+  static constexpr auto PROCESS_BROWSER = ProcessDescriptor_ChromeProcessType_PROCESS_BROWSER;
+  static constexpr auto PROCESS_RENDERER = ProcessDescriptor_ChromeProcessType_PROCESS_RENDERER;
+  static constexpr auto PROCESS_UTILITY = ProcessDescriptor_ChromeProcessType_PROCESS_UTILITY;
+  static constexpr auto PROCESS_ZYGOTE = ProcessDescriptor_ChromeProcessType_PROCESS_ZYGOTE;
+  static constexpr auto PROCESS_SANDBOX_HELPER = ProcessDescriptor_ChromeProcessType_PROCESS_SANDBOX_HELPER;
+  static constexpr auto PROCESS_GPU = ProcessDescriptor_ChromeProcessType_PROCESS_GPU;
+  static constexpr auto PROCESS_PPAPI_PLUGIN = ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_PLUGIN;
+  static constexpr auto PROCESS_PPAPI_BROKER = ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_BROKER;
+  static constexpr auto ChromeProcessType_MIN = ProcessDescriptor_ChromeProcessType_PROCESS_UNSPECIFIED;
+  static constexpr auto ChromeProcessType_MAX = ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_BROKER;
+  enum FieldNumbers {
+    kPidFieldNumber = 1,
+    kCmdlineFieldNumber = 2,
+    kProcessNameFieldNumber = 6,
+    kProcessPriorityFieldNumber = 5,
+    kStartTimestampNsFieldNumber = 7,
+    kChromeProcessTypeFieldNumber = 4,
+    kLegacySortIndexFieldNumber = 3,
+  };
+
+  ProcessDescriptor();
+  ~ProcessDescriptor() override;
+  ProcessDescriptor(ProcessDescriptor&&) noexcept;
+  ProcessDescriptor& operator=(ProcessDescriptor&&);
+  ProcessDescriptor(const ProcessDescriptor&);
+  ProcessDescriptor& operator=(const ProcessDescriptor&);
+  bool operator==(const ProcessDescriptor&) const;
+  bool operator!=(const ProcessDescriptor& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_pid() const { return _has_field_[1]; }
+  int32_t pid() const { return pid_; }
+  void set_pid(int32_t value) { pid_ = value; _has_field_.set(1); }
+
+  const std::vector<std::string>& cmdline() const { return cmdline_; }
+  std::vector<std::string>* mutable_cmdline() { return &cmdline_; }
+  int cmdline_size() const { return static_cast<int>(cmdline_.size()); }
+  void clear_cmdline() { cmdline_.clear(); }
+  void add_cmdline(std::string value) { cmdline_.emplace_back(value); }
+  std::string* add_cmdline() { cmdline_.emplace_back(); return &cmdline_.back(); }
+
+  bool has_process_name() const { return _has_field_[6]; }
+  const std::string& process_name() const { return process_name_; }
+  void set_process_name(const std::string& value) { process_name_ = value; _has_field_.set(6); }
+
+  bool has_process_priority() const { return _has_field_[5]; }
+  int32_t process_priority() const { return process_priority_; }
+  void set_process_priority(int32_t value) { process_priority_ = value; _has_field_.set(5); }
+
+  bool has_start_timestamp_ns() const { return _has_field_[7]; }
+  int64_t start_timestamp_ns() const { return start_timestamp_ns_; }
+  void set_start_timestamp_ns(int64_t value) { start_timestamp_ns_ = value; _has_field_.set(7); }
+
+  bool has_chrome_process_type() const { return _has_field_[4]; }
+  ProcessDescriptor_ChromeProcessType chrome_process_type() const { return chrome_process_type_; }
+  void set_chrome_process_type(ProcessDescriptor_ChromeProcessType value) { chrome_process_type_ = value; _has_field_.set(4); }
+
+  bool has_legacy_sort_index() const { return _has_field_[3]; }
+  int32_t legacy_sort_index() const { return legacy_sort_index_; }
+  void set_legacy_sort_index(int32_t value) { legacy_sort_index_ = value; _has_field_.set(3); }
+
+ private:
+  int32_t pid_{};
+  std::vector<std::string> cmdline_;
+  std::string process_name_{};
+  int32_t process_priority_{};
+  int64_t start_timestamp_ns_{};
+  ProcessDescriptor_ChromeProcessType chrome_process_type_{};
+  int32_t legacy_sort_index_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<8> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_PROCESS_DESCRIPTOR_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/source_location.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_SOURCE_LOCATION_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_SOURCE_LOCATION_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class SourceLocation;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT SourceLocation : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kIidFieldNumber = 1,
+    kFileNameFieldNumber = 2,
+    kFunctionNameFieldNumber = 3,
+    kLineNumberFieldNumber = 4,
+  };
+
+  SourceLocation();
+  ~SourceLocation() override;
+  SourceLocation(SourceLocation&&) noexcept;
+  SourceLocation& operator=(SourceLocation&&);
+  SourceLocation(const SourceLocation&);
+  SourceLocation& operator=(const SourceLocation&);
+  bool operator==(const SourceLocation&) const;
+  bool operator!=(const SourceLocation& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_iid() const { return _has_field_[1]; }
+  uint64_t iid() const { return iid_; }
+  void set_iid(uint64_t value) { iid_ = value; _has_field_.set(1); }
+
+  bool has_file_name() const { return _has_field_[2]; }
+  const std::string& file_name() const { return file_name_; }
+  void set_file_name(const std::string& value) { file_name_ = value; _has_field_.set(2); }
+
+  bool has_function_name() const { return _has_field_[3]; }
+  const std::string& function_name() const { return function_name_; }
+  void set_function_name(const std::string& value) { function_name_ = value; _has_field_.set(3); }
+
+  bool has_line_number() const { return _has_field_[4]; }
+  uint32_t line_number() const { return line_number_; }
+  void set_line_number(uint32_t value) { line_number_ = value; _has_field_.set(4); }
+
+ private:
+  uint64_t iid_{};
+  std::string file_name_{};
+  std::string function_name_{};
+  uint32_t line_number_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<5> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_SOURCE_LOCATION_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/task_execution.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TASK_EXECUTION_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TASK_EXECUTION_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class TaskExecution;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT TaskExecution : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kPostedFromIidFieldNumber = 1,
+  };
+
+  TaskExecution();
+  ~TaskExecution() override;
+  TaskExecution(TaskExecution&&) noexcept;
+  TaskExecution& operator=(TaskExecution&&);
+  TaskExecution(const TaskExecution&);
+  TaskExecution& operator=(const TaskExecution&);
+  bool operator==(const TaskExecution&) const;
+  bool operator!=(const TaskExecution& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_posted_from_iid() const { return _has_field_[1]; }
+  uint64_t posted_from_iid() const { return posted_from_iid_; }
+  void set_posted_from_iid(uint64_t value) { posted_from_iid_ = value; _has_field_.set(1); }
+
+ private:
+  uint64_t posted_from_iid_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TASK_EXECUTION_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/thread_descriptor.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_THREAD_DESCRIPTOR_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_THREAD_DESCRIPTOR_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ThreadDescriptor;
+enum ThreadDescriptor_ChromeThreadType : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum ThreadDescriptor_ChromeThreadType : int {
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_UNSPECIFIED = 0,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_MAIN = 1,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_IO = 2,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_BG_WORKER = 3,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_FG_WORKER = 4,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_FB_BLOCKING = 5,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_BG_BLOCKING = 6,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_SERVICE = 7,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_COMPOSITOR = 8,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_VIZ_COMPOSITOR = 9,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_COMPOSITOR_WORKER = 10,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SERVICE_WORKER = 11,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_MEMORY_INFRA = 50,
+  ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SAMPLING_PROFILER = 51,
+};
+
+class PERFETTO_EXPORT ThreadDescriptor : public ::protozero::CppMessageObj {
+ public:
+  using ChromeThreadType = ThreadDescriptor_ChromeThreadType;
+  static constexpr auto CHROME_THREAD_UNSPECIFIED = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_UNSPECIFIED;
+  static constexpr auto CHROME_THREAD_MAIN = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_MAIN;
+  static constexpr auto CHROME_THREAD_IO = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_IO;
+  static constexpr auto CHROME_THREAD_POOL_BG_WORKER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_BG_WORKER;
+  static constexpr auto CHROME_THREAD_POOL_FG_WORKER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_FG_WORKER;
+  static constexpr auto CHROME_THREAD_POOL_FB_BLOCKING = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_FB_BLOCKING;
+  static constexpr auto CHROME_THREAD_POOL_BG_BLOCKING = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_BG_BLOCKING;
+  static constexpr auto CHROME_THREAD_POOL_SERVICE = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_SERVICE;
+  static constexpr auto CHROME_THREAD_COMPOSITOR = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_COMPOSITOR;
+  static constexpr auto CHROME_THREAD_VIZ_COMPOSITOR = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_VIZ_COMPOSITOR;
+  static constexpr auto CHROME_THREAD_COMPOSITOR_WORKER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_COMPOSITOR_WORKER;
+  static constexpr auto CHROME_THREAD_SERVICE_WORKER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SERVICE_WORKER;
+  static constexpr auto CHROME_THREAD_MEMORY_INFRA = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_MEMORY_INFRA;
+  static constexpr auto CHROME_THREAD_SAMPLING_PROFILER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SAMPLING_PROFILER;
+  static constexpr auto ChromeThreadType_MIN = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_UNSPECIFIED;
+  static constexpr auto ChromeThreadType_MAX = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SAMPLING_PROFILER;
+  enum FieldNumbers {
+    kPidFieldNumber = 1,
+    kTidFieldNumber = 2,
+    kThreadNameFieldNumber = 5,
+    kChromeThreadTypeFieldNumber = 4,
+    kReferenceTimestampUsFieldNumber = 6,
+    kReferenceThreadTimeUsFieldNumber = 7,
+    kReferenceThreadInstructionCountFieldNumber = 8,
+    kLegacySortIndexFieldNumber = 3,
+  };
+
+  ThreadDescriptor();
+  ~ThreadDescriptor() override;
+  ThreadDescriptor(ThreadDescriptor&&) noexcept;
+  ThreadDescriptor& operator=(ThreadDescriptor&&);
+  ThreadDescriptor(const ThreadDescriptor&);
+  ThreadDescriptor& operator=(const ThreadDescriptor&);
+  bool operator==(const ThreadDescriptor&) const;
+  bool operator!=(const ThreadDescriptor& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_pid() const { return _has_field_[1]; }
+  int32_t pid() const { return pid_; }
+  void set_pid(int32_t value) { pid_ = value; _has_field_.set(1); }
+
+  bool has_tid() const { return _has_field_[2]; }
+  int32_t tid() const { return tid_; }
+  void set_tid(int32_t value) { tid_ = value; _has_field_.set(2); }
+
+  bool has_thread_name() const { return _has_field_[5]; }
+  const std::string& thread_name() const { return thread_name_; }
+  void set_thread_name(const std::string& value) { thread_name_ = value; _has_field_.set(5); }
+
+  bool has_chrome_thread_type() const { return _has_field_[4]; }
+  ThreadDescriptor_ChromeThreadType chrome_thread_type() const { return chrome_thread_type_; }
+  void set_chrome_thread_type(ThreadDescriptor_ChromeThreadType value) { chrome_thread_type_ = value; _has_field_.set(4); }
+
+  bool has_reference_timestamp_us() const { return _has_field_[6]; }
+  int64_t reference_timestamp_us() const { return reference_timestamp_us_; }
+  void set_reference_timestamp_us(int64_t value) { reference_timestamp_us_ = value; _has_field_.set(6); }
+
+  bool has_reference_thread_time_us() const { return _has_field_[7]; }
+  int64_t reference_thread_time_us() const { return reference_thread_time_us_; }
+  void set_reference_thread_time_us(int64_t value) { reference_thread_time_us_ = value; _has_field_.set(7); }
+
+  bool has_reference_thread_instruction_count() const { return _has_field_[8]; }
+  int64_t reference_thread_instruction_count() const { return reference_thread_instruction_count_; }
+  void set_reference_thread_instruction_count(int64_t value) { reference_thread_instruction_count_ = value; _has_field_.set(8); }
+
+  bool has_legacy_sort_index() const { return _has_field_[3]; }
+  int32_t legacy_sort_index() const { return legacy_sort_index_; }
+  void set_legacy_sort_index(int32_t value) { legacy_sort_index_ = value; _has_field_.set(3); }
+
+ private:
+  int32_t pid_{};
+  int32_t tid_{};
+  std::string thread_name_{};
+  ThreadDescriptor_ChromeThreadType chrome_thread_type_{};
+  int64_t reference_timestamp_us_{};
+  int64_t reference_thread_time_us_{};
+  int64_t reference_thread_instruction_count_{};
+  int32_t legacy_sort_index_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<9> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_THREAD_DESCRIPTOR_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/track_descriptor.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_DESCRIPTOR_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_DESCRIPTOR_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class TrackDescriptor;
+class CounterDescriptor;
+class ChromeThreadDescriptor;
+class ThreadDescriptor;
+class ChromeProcessDescriptor;
+class ProcessDescriptor;
+enum CounterDescriptor_BuiltinCounterType : int;
+enum CounterDescriptor_Unit : int;
+enum ChromeThreadDescriptor_ThreadType : int;
+enum ThreadDescriptor_ChromeThreadType : int;
+enum ChromeProcessDescriptor_ProcessType : int;
+enum ProcessDescriptor_ChromeProcessType : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT TrackDescriptor : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kUuidFieldNumber = 1,
+    kParentUuidFieldNumber = 5,
+    kNameFieldNumber = 2,
+    kProcessFieldNumber = 3,
+    kChromeProcessFieldNumber = 6,
+    kThreadFieldNumber = 4,
+    kChromeThreadFieldNumber = 7,
+    kCounterFieldNumber = 8,
+  };
+
+  TrackDescriptor();
+  ~TrackDescriptor() override;
+  TrackDescriptor(TrackDescriptor&&) noexcept;
+  TrackDescriptor& operator=(TrackDescriptor&&);
+  TrackDescriptor(const TrackDescriptor&);
+  TrackDescriptor& operator=(const TrackDescriptor&);
+  bool operator==(const TrackDescriptor&) const;
+  bool operator!=(const TrackDescriptor& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_uuid() const { return _has_field_[1]; }
+  uint64_t uuid() const { return uuid_; }
+  void set_uuid(uint64_t value) { uuid_ = value; _has_field_.set(1); }
+
+  bool has_parent_uuid() const { return _has_field_[5]; }
+  uint64_t parent_uuid() const { return parent_uuid_; }
+  void set_parent_uuid(uint64_t value) { parent_uuid_ = value; _has_field_.set(5); }
+
+  bool has_name() const { return _has_field_[2]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(2); }
+
+  bool has_process() const { return _has_field_[3]; }
+  const ProcessDescriptor& process() const { return *process_; }
+  ProcessDescriptor* mutable_process() { _has_field_.set(3); return process_.get(); }
+
+  bool has_chrome_process() const { return _has_field_[6]; }
+  const ChromeProcessDescriptor& chrome_process() const { return *chrome_process_; }
+  ChromeProcessDescriptor* mutable_chrome_process() { _has_field_.set(6); return chrome_process_.get(); }
+
+  bool has_thread() const { return _has_field_[4]; }
+  const ThreadDescriptor& thread() const { return *thread_; }
+  ThreadDescriptor* mutable_thread() { _has_field_.set(4); return thread_.get(); }
+
+  bool has_chrome_thread() const { return _has_field_[7]; }
+  const ChromeThreadDescriptor& chrome_thread() const { return *chrome_thread_; }
+  ChromeThreadDescriptor* mutable_chrome_thread() { _has_field_.set(7); return chrome_thread_.get(); }
+
+  bool has_counter() const { return _has_field_[8]; }
+  const CounterDescriptor& counter() const { return *counter_; }
+  CounterDescriptor* mutable_counter() { _has_field_.set(8); return counter_.get(); }
+
+ private:
+  uint64_t uuid_{};
+  uint64_t parent_uuid_{};
+  std::string name_{};
+  ::protozero::CopyablePtr<ProcessDescriptor> process_;
+  ::protozero::CopyablePtr<ChromeProcessDescriptor> chrome_process_;
+  ::protozero::CopyablePtr<ThreadDescriptor> thread_;
+  ::protozero::CopyablePtr<ChromeThreadDescriptor> chrome_thread_;
+  ::protozero::CopyablePtr<CounterDescriptor> counter_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<9> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_DESCRIPTOR_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/track_event.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_EVENT_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_EVENT_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class EventName;
+class EventCategory;
+class TrackEventDefaults;
+class TrackEvent;
+class TrackEvent_LegacyEvent;
+class ChromeMojoEventInfo;
+class ChromeMessagePump;
+class SourceLocation;
+class ChromeContentSettingsEventInfo;
+class ChromeWindowHandleEventInfo;
+class ChromeRendererSchedulerState;
+class ChromeApplicationStateInfo;
+class ChromeFrameReporter;
+class ChromeLatencyInfo;
+class ChromeLatencyInfo_ComponentInfo;
+class ChromeHistogramSample;
+class ChromeLegacyIpc;
+class ChromeKeyedService;
+class ChromeUserEvent;
+class ChromeCompositorSchedulerState;
+class CompositorTimingHistory;
+class BeginFrameSourceState;
+class BeginFrameArgs;
+class BeginFrameObserverState;
+class BeginImplFrameArgs;
+class BeginImplFrameArgs_TimestampsInUs;
+class ChromeCompositorStateMachine;
+class ChromeCompositorStateMachine_MinorState;
+class ChromeCompositorStateMachine_MajorState;
+class LogMessage;
+class TaskExecution;
+class DebugAnnotation;
+class DebugAnnotation_NestedValue;
+enum TrackEvent_Type : int;
+enum TrackEvent_LegacyEvent_FlowDirection : int;
+enum TrackEvent_LegacyEvent_InstantEventScope : int;
+enum ChromeRAILMode : int;
+enum ChromeApplicationStateInfo_ChromeApplicationState : int;
+enum ChromeFrameReporter_State : int;
+enum ChromeFrameReporter_FrameDropReason : int;
+enum ChromeFrameReporter_ScrollState : int;
+enum ChromeLatencyInfo_Step : int;
+enum ChromeLatencyInfo_LatencyComponentType : int;
+enum ChromeLegacyIpc_MessageClass : int;
+enum ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode : int;
+enum ChromeCompositorSchedulerAction : int;
+enum BeginFrameArgs_BeginFrameArgsType : int;
+enum BeginImplFrameArgs_State : int;
+enum ChromeCompositorStateMachine_MinorState_TreePriority : int;
+enum ChromeCompositorStateMachine_MinorState_ScrollHandlerState : int;
+enum ChromeCompositorStateMachine_MajorState_BeginImplFrameState : int;
+enum ChromeCompositorStateMachine_MajorState_BeginMainFrameState : int;
+enum ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState : int;
+enum ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState : int;
+enum DebugAnnotation_NestedValue_NestedType : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum TrackEvent_Type : int {
+  TrackEvent_Type_TYPE_UNSPECIFIED = 0,
+  TrackEvent_Type_TYPE_SLICE_BEGIN = 1,
+  TrackEvent_Type_TYPE_SLICE_END = 2,
+  TrackEvent_Type_TYPE_INSTANT = 3,
+  TrackEvent_Type_TYPE_COUNTER = 4,
+};
+enum TrackEvent_LegacyEvent_FlowDirection : int {
+  TrackEvent_LegacyEvent_FlowDirection_FLOW_UNSPECIFIED = 0,
+  TrackEvent_LegacyEvent_FlowDirection_FLOW_IN = 1,
+  TrackEvent_LegacyEvent_FlowDirection_FLOW_OUT = 2,
+  TrackEvent_LegacyEvent_FlowDirection_FLOW_INOUT = 3,
+};
+enum TrackEvent_LegacyEvent_InstantEventScope : int {
+  TrackEvent_LegacyEvent_InstantEventScope_SCOPE_UNSPECIFIED = 0,
+  TrackEvent_LegacyEvent_InstantEventScope_SCOPE_GLOBAL = 1,
+  TrackEvent_LegacyEvent_InstantEventScope_SCOPE_PROCESS = 2,
+  TrackEvent_LegacyEvent_InstantEventScope_SCOPE_THREAD = 3,
+};
+
+class PERFETTO_EXPORT EventName : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kIidFieldNumber = 1,
+    kNameFieldNumber = 2,
+  };
+
+  EventName();
+  ~EventName() override;
+  EventName(EventName&&) noexcept;
+  EventName& operator=(EventName&&);
+  EventName(const EventName&);
+  EventName& operator=(const EventName&);
+  bool operator==(const EventName&) const;
+  bool operator!=(const EventName& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_iid() const { return _has_field_[1]; }
+  uint64_t iid() const { return iid_; }
+  void set_iid(uint64_t value) { iid_ = value; _has_field_.set(1); }
+
+  bool has_name() const { return _has_field_[2]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(2); }
+
+ private:
+  uint64_t iid_{};
+  std::string name_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT EventCategory : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kIidFieldNumber = 1,
+    kNameFieldNumber = 2,
+  };
+
+  EventCategory();
+  ~EventCategory() override;
+  EventCategory(EventCategory&&) noexcept;
+  EventCategory& operator=(EventCategory&&);
+  EventCategory(const EventCategory&);
+  EventCategory& operator=(const EventCategory&);
+  bool operator==(const EventCategory&) const;
+  bool operator!=(const EventCategory& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_iid() const { return _has_field_[1]; }
+  uint64_t iid() const { return iid_; }
+  void set_iid(uint64_t value) { iid_ = value; _has_field_.set(1); }
+
+  bool has_name() const { return _has_field_[2]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(2); }
+
+ private:
+  uint64_t iid_{};
+  std::string name_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TrackEventDefaults : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kTrackUuidFieldNumber = 11,
+    kExtraCounterTrackUuidsFieldNumber = 31,
+    kExtraDoubleCounterTrackUuidsFieldNumber = 45,
+  };
+
+  TrackEventDefaults();
+  ~TrackEventDefaults() override;
+  TrackEventDefaults(TrackEventDefaults&&) noexcept;
+  TrackEventDefaults& operator=(TrackEventDefaults&&);
+  TrackEventDefaults(const TrackEventDefaults&);
+  TrackEventDefaults& operator=(const TrackEventDefaults&);
+  bool operator==(const TrackEventDefaults&) const;
+  bool operator!=(const TrackEventDefaults& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_track_uuid() const { return _has_field_[11]; }
+  uint64_t track_uuid() const { return track_uuid_; }
+  void set_track_uuid(uint64_t value) { track_uuid_ = value; _has_field_.set(11); }
+
+  const std::vector<uint64_t>& extra_counter_track_uuids() const { return extra_counter_track_uuids_; }
+  std::vector<uint64_t>* mutable_extra_counter_track_uuids() { return &extra_counter_track_uuids_; }
+  int extra_counter_track_uuids_size() const { return static_cast<int>(extra_counter_track_uuids_.size()); }
+  void clear_extra_counter_track_uuids() { extra_counter_track_uuids_.clear(); }
+  void add_extra_counter_track_uuids(uint64_t value) { extra_counter_track_uuids_.emplace_back(value); }
+  uint64_t* add_extra_counter_track_uuids() { extra_counter_track_uuids_.emplace_back(); return &extra_counter_track_uuids_.back(); }
+
+  const std::vector<uint64_t>& extra_double_counter_track_uuids() const { return extra_double_counter_track_uuids_; }
+  std::vector<uint64_t>* mutable_extra_double_counter_track_uuids() { return &extra_double_counter_track_uuids_; }
+  int extra_double_counter_track_uuids_size() const { return static_cast<int>(extra_double_counter_track_uuids_.size()); }
+  void clear_extra_double_counter_track_uuids() { extra_double_counter_track_uuids_.clear(); }
+  void add_extra_double_counter_track_uuids(uint64_t value) { extra_double_counter_track_uuids_.emplace_back(value); }
+  uint64_t* add_extra_double_counter_track_uuids() { extra_double_counter_track_uuids_.emplace_back(); return &extra_double_counter_track_uuids_.back(); }
+
+ private:
+  uint64_t track_uuid_{};
+  std::vector<uint64_t> extra_counter_track_uuids_;
+  std::vector<uint64_t> extra_double_counter_track_uuids_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<46> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TrackEvent : public ::protozero::CppMessageObj {
+ public:
+  using LegacyEvent = TrackEvent_LegacyEvent;
+  using Type = TrackEvent_Type;
+  static constexpr auto TYPE_UNSPECIFIED = TrackEvent_Type_TYPE_UNSPECIFIED;
+  static constexpr auto TYPE_SLICE_BEGIN = TrackEvent_Type_TYPE_SLICE_BEGIN;
+  static constexpr auto TYPE_SLICE_END = TrackEvent_Type_TYPE_SLICE_END;
+  static constexpr auto TYPE_INSTANT = TrackEvent_Type_TYPE_INSTANT;
+  static constexpr auto TYPE_COUNTER = TrackEvent_Type_TYPE_COUNTER;
+  static constexpr auto Type_MIN = TrackEvent_Type_TYPE_UNSPECIFIED;
+  static constexpr auto Type_MAX = TrackEvent_Type_TYPE_COUNTER;
+  enum FieldNumbers {
+    kCategoryIidsFieldNumber = 3,
+    kCategoriesFieldNumber = 22,
+    kNameIidFieldNumber = 10,
+    kNameFieldNumber = 23,
+    kTypeFieldNumber = 9,
+    kTrackUuidFieldNumber = 11,
+    kCounterValueFieldNumber = 30,
+    kDoubleCounterValueFieldNumber = 44,
+    kExtraCounterTrackUuidsFieldNumber = 31,
+    kExtraCounterValuesFieldNumber = 12,
+    kExtraDoubleCounterTrackUuidsFieldNumber = 45,
+    kExtraDoubleCounterValuesFieldNumber = 46,
+    kFlowIdsFieldNumber = 36,
+    kTerminatingFlowIdsFieldNumber = 42,
+    kDebugAnnotationsFieldNumber = 4,
+    kTaskExecutionFieldNumber = 5,
+    kLogMessageFieldNumber = 21,
+    kCcSchedulerStateFieldNumber = 24,
+    kChromeUserEventFieldNumber = 25,
+    kChromeKeyedServiceFieldNumber = 26,
+    kChromeLegacyIpcFieldNumber = 27,
+    kChromeHistogramSampleFieldNumber = 28,
+    kChromeLatencyInfoFieldNumber = 29,
+    kChromeFrameReporterFieldNumber = 32,
+    kChromeApplicationStateInfoFieldNumber = 39,
+    kChromeRendererSchedulerStateFieldNumber = 40,
+    kChromeWindowHandleEventInfoFieldNumber = 41,
+    kChromeContentSettingsEventInfoFieldNumber = 43,
+    kSourceLocationFieldNumber = 33,
+    kSourceLocationIidFieldNumber = 34,
+    kChromeMessagePumpFieldNumber = 35,
+    kChromeMojoEventInfoFieldNumber = 38,
+    kTimestampDeltaUsFieldNumber = 1,
+    kTimestampAbsoluteUsFieldNumber = 16,
+    kThreadTimeDeltaUsFieldNumber = 2,
+    kThreadTimeAbsoluteUsFieldNumber = 17,
+    kThreadInstructionCountDeltaFieldNumber = 8,
+    kThreadInstructionCountAbsoluteFieldNumber = 20,
+    kLegacyEventFieldNumber = 6,
+  };
+
+  TrackEvent();
+  ~TrackEvent() override;
+  TrackEvent(TrackEvent&&) noexcept;
+  TrackEvent& operator=(TrackEvent&&);
+  TrackEvent(const TrackEvent&);
+  TrackEvent& operator=(const TrackEvent&);
+  bool operator==(const TrackEvent&) const;
+  bool operator!=(const TrackEvent& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<uint64_t>& category_iids() const { return category_iids_; }
+  std::vector<uint64_t>* mutable_category_iids() { return &category_iids_; }
+  int category_iids_size() const { return static_cast<int>(category_iids_.size()); }
+  void clear_category_iids() { category_iids_.clear(); }
+  void add_category_iids(uint64_t value) { category_iids_.emplace_back(value); }
+  uint64_t* add_category_iids() { category_iids_.emplace_back(); return &category_iids_.back(); }
+
+  const std::vector<std::string>& categories() const { return categories_; }
+  std::vector<std::string>* mutable_categories() { return &categories_; }
+  int categories_size() const { return static_cast<int>(categories_.size()); }
+  void clear_categories() { categories_.clear(); }
+  void add_categories(std::string value) { categories_.emplace_back(value); }
+  std::string* add_categories() { categories_.emplace_back(); return &categories_.back(); }
+
+  bool has_name_iid() const { return _has_field_[10]; }
+  uint64_t name_iid() const { return name_iid_; }
+  void set_name_iid(uint64_t value) { name_iid_ = value; _has_field_.set(10); }
+
+  bool has_name() const { return _has_field_[23]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(23); }
+
+  bool has_type() const { return _has_field_[9]; }
+  TrackEvent_Type type() const { return type_; }
+  void set_type(TrackEvent_Type value) { type_ = value; _has_field_.set(9); }
+
+  bool has_track_uuid() const { return _has_field_[11]; }
+  uint64_t track_uuid() const { return track_uuid_; }
+  void set_track_uuid(uint64_t value) { track_uuid_ = value; _has_field_.set(11); }
+
+  bool has_counter_value() const { return _has_field_[30]; }
+  int64_t counter_value() const { return counter_value_; }
+  void set_counter_value(int64_t value) { counter_value_ = value; _has_field_.set(30); }
+
+  bool has_double_counter_value() const { return _has_field_[44]; }
+  double double_counter_value() const { return double_counter_value_; }
+  void set_double_counter_value(double value) { double_counter_value_ = value; _has_field_.set(44); }
+
+  const std::vector<uint64_t>& extra_counter_track_uuids() const { return extra_counter_track_uuids_; }
+  std::vector<uint64_t>* mutable_extra_counter_track_uuids() { return &extra_counter_track_uuids_; }
+  int extra_counter_track_uuids_size() const { return static_cast<int>(extra_counter_track_uuids_.size()); }
+  void clear_extra_counter_track_uuids() { extra_counter_track_uuids_.clear(); }
+  void add_extra_counter_track_uuids(uint64_t value) { extra_counter_track_uuids_.emplace_back(value); }
+  uint64_t* add_extra_counter_track_uuids() { extra_counter_track_uuids_.emplace_back(); return &extra_counter_track_uuids_.back(); }
+
+  const std::vector<int64_t>& extra_counter_values() const { return extra_counter_values_; }
+  std::vector<int64_t>* mutable_extra_counter_values() { return &extra_counter_values_; }
+  int extra_counter_values_size() const { return static_cast<int>(extra_counter_values_.size()); }
+  void clear_extra_counter_values() { extra_counter_values_.clear(); }
+  void add_extra_counter_values(int64_t value) { extra_counter_values_.emplace_back(value); }
+  int64_t* add_extra_counter_values() { extra_counter_values_.emplace_back(); return &extra_counter_values_.back(); }
+
+  const std::vector<uint64_t>& extra_double_counter_track_uuids() const { return extra_double_counter_track_uuids_; }
+  std::vector<uint64_t>* mutable_extra_double_counter_track_uuids() { return &extra_double_counter_track_uuids_; }
+  int extra_double_counter_track_uuids_size() const { return static_cast<int>(extra_double_counter_track_uuids_.size()); }
+  void clear_extra_double_counter_track_uuids() { extra_double_counter_track_uuids_.clear(); }
+  void add_extra_double_counter_track_uuids(uint64_t value) { extra_double_counter_track_uuids_.emplace_back(value); }
+  uint64_t* add_extra_double_counter_track_uuids() { extra_double_counter_track_uuids_.emplace_back(); return &extra_double_counter_track_uuids_.back(); }
+
+  const std::vector<double>& extra_double_counter_values() const { return extra_double_counter_values_; }
+  std::vector<double>* mutable_extra_double_counter_values() { return &extra_double_counter_values_; }
+  int extra_double_counter_values_size() const { return static_cast<int>(extra_double_counter_values_.size()); }
+  void clear_extra_double_counter_values() { extra_double_counter_values_.clear(); }
+  void add_extra_double_counter_values(double value) { extra_double_counter_values_.emplace_back(value); }
+  double* add_extra_double_counter_values() { extra_double_counter_values_.emplace_back(); return &extra_double_counter_values_.back(); }
+
+  const std::vector<uint64_t>& flow_ids() const { return flow_ids_; }
+  std::vector<uint64_t>* mutable_flow_ids() { return &flow_ids_; }
+  int flow_ids_size() const { return static_cast<int>(flow_ids_.size()); }
+  void clear_flow_ids() { flow_ids_.clear(); }
+  void add_flow_ids(uint64_t value) { flow_ids_.emplace_back(value); }
+  uint64_t* add_flow_ids() { flow_ids_.emplace_back(); return &flow_ids_.back(); }
+
+  const std::vector<uint64_t>& terminating_flow_ids() const { return terminating_flow_ids_; }
+  std::vector<uint64_t>* mutable_terminating_flow_ids() { return &terminating_flow_ids_; }
+  int terminating_flow_ids_size() const { return static_cast<int>(terminating_flow_ids_.size()); }
+  void clear_terminating_flow_ids() { terminating_flow_ids_.clear(); }
+  void add_terminating_flow_ids(uint64_t value) { terminating_flow_ids_.emplace_back(value); }
+  uint64_t* add_terminating_flow_ids() { terminating_flow_ids_.emplace_back(); return &terminating_flow_ids_.back(); }
+
+  const std::vector<DebugAnnotation>& debug_annotations() const { return debug_annotations_; }
+  std::vector<DebugAnnotation>* mutable_debug_annotations() { return &debug_annotations_; }
+  int debug_annotations_size() const;
+  void clear_debug_annotations();
+  DebugAnnotation* add_debug_annotations();
+
+  bool has_task_execution() const { return _has_field_[5]; }
+  const TaskExecution& task_execution() const { return *task_execution_; }
+  TaskExecution* mutable_task_execution() { _has_field_.set(5); return task_execution_.get(); }
+
+  bool has_log_message() const { return _has_field_[21]; }
+  const LogMessage& log_message() const { return *log_message_; }
+  LogMessage* mutable_log_message() { _has_field_.set(21); return log_message_.get(); }
+
+  bool has_cc_scheduler_state() const { return _has_field_[24]; }
+  const ChromeCompositorSchedulerState& cc_scheduler_state() const { return *cc_scheduler_state_; }
+  ChromeCompositorSchedulerState* mutable_cc_scheduler_state() { _has_field_.set(24); return cc_scheduler_state_.get(); }
+
+  bool has_chrome_user_event() const { return _has_field_[25]; }
+  const ChromeUserEvent& chrome_user_event() const { return *chrome_user_event_; }
+  ChromeUserEvent* mutable_chrome_user_event() { _has_field_.set(25); return chrome_user_event_.get(); }
+
+  bool has_chrome_keyed_service() const { return _has_field_[26]; }
+  const ChromeKeyedService& chrome_keyed_service() const { return *chrome_keyed_service_; }
+  ChromeKeyedService* mutable_chrome_keyed_service() { _has_field_.set(26); return chrome_keyed_service_.get(); }
+
+  bool has_chrome_legacy_ipc() const { return _has_field_[27]; }
+  const ChromeLegacyIpc& chrome_legacy_ipc() const { return *chrome_legacy_ipc_; }
+  ChromeLegacyIpc* mutable_chrome_legacy_ipc() { _has_field_.set(27); return chrome_legacy_ipc_.get(); }
+
+  bool has_chrome_histogram_sample() const { return _has_field_[28]; }
+  const ChromeHistogramSample& chrome_histogram_sample() const { return *chrome_histogram_sample_; }
+  ChromeHistogramSample* mutable_chrome_histogram_sample() { _has_field_.set(28); return chrome_histogram_sample_.get(); }
+
+  bool has_chrome_latency_info() const { return _has_field_[29]; }
+  const ChromeLatencyInfo& chrome_latency_info() const { return *chrome_latency_info_; }
+  ChromeLatencyInfo* mutable_chrome_latency_info() { _has_field_.set(29); return chrome_latency_info_.get(); }
+
+  bool has_chrome_frame_reporter() const { return _has_field_[32]; }
+  const ChromeFrameReporter& chrome_frame_reporter() const { return *chrome_frame_reporter_; }
+  ChromeFrameReporter* mutable_chrome_frame_reporter() { _has_field_.set(32); return chrome_frame_reporter_.get(); }
+
+  bool has_chrome_application_state_info() const { return _has_field_[39]; }
+  const ChromeApplicationStateInfo& chrome_application_state_info() const { return *chrome_application_state_info_; }
+  ChromeApplicationStateInfo* mutable_chrome_application_state_info() { _has_field_.set(39); return chrome_application_state_info_.get(); }
+
+  bool has_chrome_renderer_scheduler_state() const { return _has_field_[40]; }
+  const ChromeRendererSchedulerState& chrome_renderer_scheduler_state() const { return *chrome_renderer_scheduler_state_; }
+  ChromeRendererSchedulerState* mutable_chrome_renderer_scheduler_state() { _has_field_.set(40); return chrome_renderer_scheduler_state_.get(); }
+
+  bool has_chrome_window_handle_event_info() const { return _has_field_[41]; }
+  const ChromeWindowHandleEventInfo& chrome_window_handle_event_info() const { return *chrome_window_handle_event_info_; }
+  ChromeWindowHandleEventInfo* mutable_chrome_window_handle_event_info() { _has_field_.set(41); return chrome_window_handle_event_info_.get(); }
+
+  bool has_chrome_content_settings_event_info() const { return _has_field_[43]; }
+  const ChromeContentSettingsEventInfo& chrome_content_settings_event_info() const { return *chrome_content_settings_event_info_; }
+  ChromeContentSettingsEventInfo* mutable_chrome_content_settings_event_info() { _has_field_.set(43); return chrome_content_settings_event_info_.get(); }
+
+  bool has_source_location() const { return _has_field_[33]; }
+  const SourceLocation& source_location() const { return *source_location_; }
+  SourceLocation* mutable_source_location() { _has_field_.set(33); return source_location_.get(); }
+
+  bool has_source_location_iid() const { return _has_field_[34]; }
+  uint64_t source_location_iid() const { return source_location_iid_; }
+  void set_source_location_iid(uint64_t value) { source_location_iid_ = value; _has_field_.set(34); }
+
+  bool has_chrome_message_pump() const { return _has_field_[35]; }
+  const ChromeMessagePump& chrome_message_pump() const { return *chrome_message_pump_; }
+  ChromeMessagePump* mutable_chrome_message_pump() { _has_field_.set(35); return chrome_message_pump_.get(); }
+
+  bool has_chrome_mojo_event_info() const { return _has_field_[38]; }
+  const ChromeMojoEventInfo& chrome_mojo_event_info() const { return *chrome_mojo_event_info_; }
+  ChromeMojoEventInfo* mutable_chrome_mojo_event_info() { _has_field_.set(38); return chrome_mojo_event_info_.get(); }
+
+  bool has_timestamp_delta_us() const { return _has_field_[1]; }
+  int64_t timestamp_delta_us() const { return timestamp_delta_us_; }
+  void set_timestamp_delta_us(int64_t value) { timestamp_delta_us_ = value; _has_field_.set(1); }
+
+  bool has_timestamp_absolute_us() const { return _has_field_[16]; }
+  int64_t timestamp_absolute_us() const { return timestamp_absolute_us_; }
+  void set_timestamp_absolute_us(int64_t value) { timestamp_absolute_us_ = value; _has_field_.set(16); }
+
+  bool has_thread_time_delta_us() const { return _has_field_[2]; }
+  int64_t thread_time_delta_us() const { return thread_time_delta_us_; }
+  void set_thread_time_delta_us(int64_t value) { thread_time_delta_us_ = value; _has_field_.set(2); }
+
+  bool has_thread_time_absolute_us() const { return _has_field_[17]; }
+  int64_t thread_time_absolute_us() const { return thread_time_absolute_us_; }
+  void set_thread_time_absolute_us(int64_t value) { thread_time_absolute_us_ = value; _has_field_.set(17); }
+
+  bool has_thread_instruction_count_delta() const { return _has_field_[8]; }
+  int64_t thread_instruction_count_delta() const { return thread_instruction_count_delta_; }
+  void set_thread_instruction_count_delta(int64_t value) { thread_instruction_count_delta_ = value; _has_field_.set(8); }
+
+  bool has_thread_instruction_count_absolute() const { return _has_field_[20]; }
+  int64_t thread_instruction_count_absolute() const { return thread_instruction_count_absolute_; }
+  void set_thread_instruction_count_absolute(int64_t value) { thread_instruction_count_absolute_ = value; _has_field_.set(20); }
+
+  bool has_legacy_event() const { return _has_field_[6]; }
+  const TrackEvent_LegacyEvent& legacy_event() const { return *legacy_event_; }
+  TrackEvent_LegacyEvent* mutable_legacy_event() { _has_field_.set(6); return legacy_event_.get(); }
+
+ private:
+  std::vector<uint64_t> category_iids_;
+  std::vector<std::string> categories_;
+  uint64_t name_iid_{};
+  std::string name_{};
+  TrackEvent_Type type_{};
+  uint64_t track_uuid_{};
+  int64_t counter_value_{};
+  double double_counter_value_{};
+  std::vector<uint64_t> extra_counter_track_uuids_;
+  std::vector<int64_t> extra_counter_values_;
+  std::vector<uint64_t> extra_double_counter_track_uuids_;
+  std::vector<double> extra_double_counter_values_;
+  std::vector<uint64_t> flow_ids_;
+  std::vector<uint64_t> terminating_flow_ids_;
+  std::vector<DebugAnnotation> debug_annotations_;
+  ::protozero::CopyablePtr<TaskExecution> task_execution_;
+  ::protozero::CopyablePtr<LogMessage> log_message_;
+  ::protozero::CopyablePtr<ChromeCompositorSchedulerState> cc_scheduler_state_;
+  ::protozero::CopyablePtr<ChromeUserEvent> chrome_user_event_;
+  ::protozero::CopyablePtr<ChromeKeyedService> chrome_keyed_service_;
+  ::protozero::CopyablePtr<ChromeLegacyIpc> chrome_legacy_ipc_;
+  ::protozero::CopyablePtr<ChromeHistogramSample> chrome_histogram_sample_;
+  ::protozero::CopyablePtr<ChromeLatencyInfo> chrome_latency_info_;
+  ::protozero::CopyablePtr<ChromeFrameReporter> chrome_frame_reporter_;
+  ::protozero::CopyablePtr<ChromeApplicationStateInfo> chrome_application_state_info_;
+  ::protozero::CopyablePtr<ChromeRendererSchedulerState> chrome_renderer_scheduler_state_;
+  ::protozero::CopyablePtr<ChromeWindowHandleEventInfo> chrome_window_handle_event_info_;
+  ::protozero::CopyablePtr<ChromeContentSettingsEventInfo> chrome_content_settings_event_info_;
+  ::protozero::CopyablePtr<SourceLocation> source_location_;
+  uint64_t source_location_iid_{};
+  ::protozero::CopyablePtr<ChromeMessagePump> chrome_message_pump_;
+  ::protozero::CopyablePtr<ChromeMojoEventInfo> chrome_mojo_event_info_;
+  int64_t timestamp_delta_us_{};
+  int64_t timestamp_absolute_us_{};
+  int64_t thread_time_delta_us_{};
+  int64_t thread_time_absolute_us_{};
+  int64_t thread_instruction_count_delta_{};
+  int64_t thread_instruction_count_absolute_{};
+  ::protozero::CopyablePtr<TrackEvent_LegacyEvent> legacy_event_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<47> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TrackEvent_LegacyEvent : public ::protozero::CppMessageObj {
+ public:
+  using FlowDirection = TrackEvent_LegacyEvent_FlowDirection;
+  static constexpr auto FLOW_UNSPECIFIED = TrackEvent_LegacyEvent_FlowDirection_FLOW_UNSPECIFIED;
+  static constexpr auto FLOW_IN = TrackEvent_LegacyEvent_FlowDirection_FLOW_IN;
+  static constexpr auto FLOW_OUT = TrackEvent_LegacyEvent_FlowDirection_FLOW_OUT;
+  static constexpr auto FLOW_INOUT = TrackEvent_LegacyEvent_FlowDirection_FLOW_INOUT;
+  static constexpr auto FlowDirection_MIN = TrackEvent_LegacyEvent_FlowDirection_FLOW_UNSPECIFIED;
+  static constexpr auto FlowDirection_MAX = TrackEvent_LegacyEvent_FlowDirection_FLOW_INOUT;
+  using InstantEventScope = TrackEvent_LegacyEvent_InstantEventScope;
+  static constexpr auto SCOPE_UNSPECIFIED = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_UNSPECIFIED;
+  static constexpr auto SCOPE_GLOBAL = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_GLOBAL;
+  static constexpr auto SCOPE_PROCESS = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_PROCESS;
+  static constexpr auto SCOPE_THREAD = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_THREAD;
+  static constexpr auto InstantEventScope_MIN = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_UNSPECIFIED;
+  static constexpr auto InstantEventScope_MAX = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_THREAD;
+  enum FieldNumbers {
+    kNameIidFieldNumber = 1,
+    kPhaseFieldNumber = 2,
+    kDurationUsFieldNumber = 3,
+    kThreadDurationUsFieldNumber = 4,
+    kThreadInstructionDeltaFieldNumber = 15,
+    kUnscopedIdFieldNumber = 6,
+    kLocalIdFieldNumber = 10,
+    kGlobalIdFieldNumber = 11,
+    kIdScopeFieldNumber = 7,
+    kUseAsyncTtsFieldNumber = 9,
+    kBindIdFieldNumber = 8,
+    kBindToEnclosingFieldNumber = 12,
+    kFlowDirectionFieldNumber = 13,
+    kInstantEventScopeFieldNumber = 14,
+    kPidOverrideFieldNumber = 18,
+    kTidOverrideFieldNumber = 19,
+  };
+
+  TrackEvent_LegacyEvent();
+  ~TrackEvent_LegacyEvent() override;
+  TrackEvent_LegacyEvent(TrackEvent_LegacyEvent&&) noexcept;
+  TrackEvent_LegacyEvent& operator=(TrackEvent_LegacyEvent&&);
+  TrackEvent_LegacyEvent(const TrackEvent_LegacyEvent&);
+  TrackEvent_LegacyEvent& operator=(const TrackEvent_LegacyEvent&);
+  bool operator==(const TrackEvent_LegacyEvent&) const;
+  bool operator!=(const TrackEvent_LegacyEvent& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name_iid() const { return _has_field_[1]; }
+  uint64_t name_iid() const { return name_iid_; }
+  void set_name_iid(uint64_t value) { name_iid_ = value; _has_field_.set(1); }
+
+  bool has_phase() const { return _has_field_[2]; }
+  int32_t phase() const { return phase_; }
+  void set_phase(int32_t value) { phase_ = value; _has_field_.set(2); }
+
+  bool has_duration_us() const { return _has_field_[3]; }
+  int64_t duration_us() const { return duration_us_; }
+  void set_duration_us(int64_t value) { duration_us_ = value; _has_field_.set(3); }
+
+  bool has_thread_duration_us() const { return _has_field_[4]; }
+  int64_t thread_duration_us() const { return thread_duration_us_; }
+  void set_thread_duration_us(int64_t value) { thread_duration_us_ = value; _has_field_.set(4); }
+
+  bool has_thread_instruction_delta() const { return _has_field_[15]; }
+  int64_t thread_instruction_delta() const { return thread_instruction_delta_; }
+  void set_thread_instruction_delta(int64_t value) { thread_instruction_delta_ = value; _has_field_.set(15); }
+
+  bool has_unscoped_id() const { return _has_field_[6]; }
+  uint64_t unscoped_id() const { return unscoped_id_; }
+  void set_unscoped_id(uint64_t value) { unscoped_id_ = value; _has_field_.set(6); }
+
+  bool has_local_id() const { return _has_field_[10]; }
+  uint64_t local_id() const { return local_id_; }
+  void set_local_id(uint64_t value) { local_id_ = value; _has_field_.set(10); }
+
+  bool has_global_id() const { return _has_field_[11]; }
+  uint64_t global_id() const { return global_id_; }
+  void set_global_id(uint64_t value) { global_id_ = value; _has_field_.set(11); }
+
+  bool has_id_scope() const { return _has_field_[7]; }
+  const std::string& id_scope() const { return id_scope_; }
+  void set_id_scope(const std::string& value) { id_scope_ = value; _has_field_.set(7); }
+
+  bool has_use_async_tts() const { return _has_field_[9]; }
+  bool use_async_tts() const { return use_async_tts_; }
+  void set_use_async_tts(bool value) { use_async_tts_ = value; _has_field_.set(9); }
+
+  bool has_bind_id() const { return _has_field_[8]; }
+  uint64_t bind_id() const { return bind_id_; }
+  void set_bind_id(uint64_t value) { bind_id_ = value; _has_field_.set(8); }
+
+  bool has_bind_to_enclosing() const { return _has_field_[12]; }
+  bool bind_to_enclosing() const { return bind_to_enclosing_; }
+  void set_bind_to_enclosing(bool value) { bind_to_enclosing_ = value; _has_field_.set(12); }
+
+  bool has_flow_direction() const { return _has_field_[13]; }
+  TrackEvent_LegacyEvent_FlowDirection flow_direction() const { return flow_direction_; }
+  void set_flow_direction(TrackEvent_LegacyEvent_FlowDirection value) { flow_direction_ = value; _has_field_.set(13); }
+
+  bool has_instant_event_scope() const { return _has_field_[14]; }
+  TrackEvent_LegacyEvent_InstantEventScope instant_event_scope() const { return instant_event_scope_; }
+  void set_instant_event_scope(TrackEvent_LegacyEvent_InstantEventScope value) { instant_event_scope_ = value; _has_field_.set(14); }
+
+  bool has_pid_override() const { return _has_field_[18]; }
+  int32_t pid_override() const { return pid_override_; }
+  void set_pid_override(int32_t value) { pid_override_ = value; _has_field_.set(18); }
+
+  bool has_tid_override() const { return _has_field_[19]; }
+  int32_t tid_override() const { return tid_override_; }
+  void set_tid_override(int32_t value) { tid_override_ = value; _has_field_.set(19); }
+
+ private:
+  uint64_t name_iid_{};
+  int32_t phase_{};
+  int64_t duration_us_{};
+  int64_t thread_duration_us_{};
+  int64_t thread_instruction_delta_{};
+  uint64_t unscoped_id_{};
+  uint64_t local_id_{};
+  uint64_t global_id_{};
+  std::string id_scope_{};
+  bool use_async_tts_{};
+  uint64_t bind_id_{};
+  bool bind_to_enclosing_{};
+  TrackEvent_LegacyEvent_FlowDirection flow_direction_{};
+  TrackEvent_LegacyEvent_InstantEventScope instant_event_scope_{};
+  int32_t pid_override_{};
+  int32_t tid_override_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<20> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_EVENT_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/config/android/android_log_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_ANDROID_LOG_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_ANDROID_LOG_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class AndroidLogConfig;
+enum AndroidLogId : int;
+enum AndroidLogPriority : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT AndroidLogConfig : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kLogIdsFieldNumber = 1,
+    kMinPrioFieldNumber = 3,
+    kFilterTagsFieldNumber = 4,
+  };
+
+  AndroidLogConfig();
+  ~AndroidLogConfig() override;
+  AndroidLogConfig(AndroidLogConfig&&) noexcept;
+  AndroidLogConfig& operator=(AndroidLogConfig&&);
+  AndroidLogConfig(const AndroidLogConfig&);
+  AndroidLogConfig& operator=(const AndroidLogConfig&);
+  bool operator==(const AndroidLogConfig&) const;
+  bool operator!=(const AndroidLogConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<AndroidLogId>& log_ids() const { return log_ids_; }
+  std::vector<AndroidLogId>* mutable_log_ids() { return &log_ids_; }
+  int log_ids_size() const { return static_cast<int>(log_ids_.size()); }
+  void clear_log_ids() { log_ids_.clear(); }
+  void add_log_ids(AndroidLogId value) { log_ids_.emplace_back(value); }
+  AndroidLogId* add_log_ids() { log_ids_.emplace_back(); return &log_ids_.back(); }
+
+  bool has_min_prio() const { return _has_field_[3]; }
+  AndroidLogPriority min_prio() const { return min_prio_; }
+  void set_min_prio(AndroidLogPriority value) { min_prio_ = value; _has_field_.set(3); }
+
+  const std::vector<std::string>& filter_tags() const { return filter_tags_; }
+  std::vector<std::string>* mutable_filter_tags() { return &filter_tags_; }
+  int filter_tags_size() const { return static_cast<int>(filter_tags_.size()); }
+  void clear_filter_tags() { filter_tags_.clear(); }
+  void add_filter_tags(std::string value) { filter_tags_.emplace_back(value); }
+  std::string* add_filter_tags() { filter_tags_.emplace_back(); return &filter_tags_.back(); }
+
+ private:
+  std::vector<AndroidLogId> log_ids_;
+  AndroidLogPriority min_prio_{};
+  std::vector<std::string> filter_tags_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<5> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_ANDROID_LOG_CONFIG_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/config/android/android_polled_state_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_ANDROID_POLLED_STATE_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_ANDROID_POLLED_STATE_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class AndroidPolledStateConfig;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT AndroidPolledStateConfig : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kPollMsFieldNumber = 1,
+  };
+
+  AndroidPolledStateConfig();
+  ~AndroidPolledStateConfig() override;
+  AndroidPolledStateConfig(AndroidPolledStateConfig&&) noexcept;
+  AndroidPolledStateConfig& operator=(AndroidPolledStateConfig&&);
+  AndroidPolledStateConfig(const AndroidPolledStateConfig&);
+  AndroidPolledStateConfig& operator=(const AndroidPolledStateConfig&);
+  bool operator==(const AndroidPolledStateConfig&) const;
+  bool operator!=(const AndroidPolledStateConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_poll_ms() const { return _has_field_[1]; }
+  uint32_t poll_ms() const { return poll_ms_; }
+  void set_poll_ms(uint32_t value) { poll_ms_ = value; _has_field_.set(1); }
+
+ private:
+  uint32_t poll_ms_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_ANDROID_POLLED_STATE_CONFIG_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/config/android/packages_list_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_PACKAGES_LIST_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_PACKAGES_LIST_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class PackagesListConfig;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT PackagesListConfig : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kPackageNameFilterFieldNumber = 1,
+  };
+
+  PackagesListConfig();
+  ~PackagesListConfig() override;
+  PackagesListConfig(PackagesListConfig&&) noexcept;
+  PackagesListConfig& operator=(PackagesListConfig&&);
+  PackagesListConfig(const PackagesListConfig&);
+  PackagesListConfig& operator=(const PackagesListConfig&);
+  bool operator==(const PackagesListConfig&) const;
+  bool operator!=(const PackagesListConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<std::string>& package_name_filter() const { return package_name_filter_; }
+  std::vector<std::string>* mutable_package_name_filter() { return &package_name_filter_; }
+  int package_name_filter_size() const { return static_cast<int>(package_name_filter_.size()); }
+  void clear_package_name_filter() { package_name_filter_.clear(); }
+  void add_package_name_filter(std::string value) { package_name_filter_.emplace_back(value); }
+  std::string* add_package_name_filter() { package_name_filter_.emplace_back(); return &package_name_filter_.back(); }
+
+ private:
+  std::vector<std::string> package_name_filter_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_PACKAGES_LIST_CONFIG_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/config/ftrace/ftrace_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_FTRACE_FTRACE_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_FTRACE_FTRACE_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class FtraceConfig;
+class FtraceConfig_CompactSchedConfig;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT FtraceConfig : public ::protozero::CppMessageObj {
+ public:
+  using CompactSchedConfig = FtraceConfig_CompactSchedConfig;
+  enum FieldNumbers {
+    kFtraceEventsFieldNumber = 1,
+    kAtraceCategoriesFieldNumber = 2,
+    kAtraceAppsFieldNumber = 3,
+    kBufferSizeKbFieldNumber = 10,
+    kDrainPeriodMsFieldNumber = 11,
+    kCompactSchedFieldNumber = 12,
+    kSymbolizeKsymsFieldNumber = 13,
+    kInitializeKsymsSynchronouslyForTestingFieldNumber = 14,
+  };
+
+  FtraceConfig();
+  ~FtraceConfig() override;
+  FtraceConfig(FtraceConfig&&) noexcept;
+  FtraceConfig& operator=(FtraceConfig&&);
+  FtraceConfig(const FtraceConfig&);
+  FtraceConfig& operator=(const FtraceConfig&);
+  bool operator==(const FtraceConfig&) const;
+  bool operator!=(const FtraceConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<std::string>& ftrace_events() const { return ftrace_events_; }
+  std::vector<std::string>* mutable_ftrace_events() { return &ftrace_events_; }
+  int ftrace_events_size() const { return static_cast<int>(ftrace_events_.size()); }
+  void clear_ftrace_events() { ftrace_events_.clear(); }
+  void add_ftrace_events(std::string value) { ftrace_events_.emplace_back(value); }
+  std::string* add_ftrace_events() { ftrace_events_.emplace_back(); return &ftrace_events_.back(); }
+
+  const std::vector<std::string>& atrace_categories() const { return atrace_categories_; }
+  std::vector<std::string>* mutable_atrace_categories() { return &atrace_categories_; }
+  int atrace_categories_size() const { return static_cast<int>(atrace_categories_.size()); }
+  void clear_atrace_categories() { atrace_categories_.clear(); }
+  void add_atrace_categories(std::string value) { atrace_categories_.emplace_back(value); }
+  std::string* add_atrace_categories() { atrace_categories_.emplace_back(); return &atrace_categories_.back(); }
+
+  const std::vector<std::string>& atrace_apps() const { return atrace_apps_; }
+  std::vector<std::string>* mutable_atrace_apps() { return &atrace_apps_; }
+  int atrace_apps_size() const { return static_cast<int>(atrace_apps_.size()); }
+  void clear_atrace_apps() { atrace_apps_.clear(); }
+  void add_atrace_apps(std::string value) { atrace_apps_.emplace_back(value); }
+  std::string* add_atrace_apps() { atrace_apps_.emplace_back(); return &atrace_apps_.back(); }
+
+  bool has_buffer_size_kb() const { return _has_field_[10]; }
+  uint32_t buffer_size_kb() const { return buffer_size_kb_; }
+  void set_buffer_size_kb(uint32_t value) { buffer_size_kb_ = value; _has_field_.set(10); }
+
+  bool has_drain_period_ms() const { return _has_field_[11]; }
+  uint32_t drain_period_ms() const { return drain_period_ms_; }
+  void set_drain_period_ms(uint32_t value) { drain_period_ms_ = value; _has_field_.set(11); }
+
+  bool has_compact_sched() const { return _has_field_[12]; }
+  const FtraceConfig_CompactSchedConfig& compact_sched() const { return *compact_sched_; }
+  FtraceConfig_CompactSchedConfig* mutable_compact_sched() { _has_field_.set(12); return compact_sched_.get(); }
+
+  bool has_symbolize_ksyms() const { return _has_field_[13]; }
+  bool symbolize_ksyms() const { return symbolize_ksyms_; }
+  void set_symbolize_ksyms(bool value) { symbolize_ksyms_ = value; _has_field_.set(13); }
+
+  bool has_initialize_ksyms_synchronously_for_testing() const { return _has_field_[14]; }
+  bool initialize_ksyms_synchronously_for_testing() const { return initialize_ksyms_synchronously_for_testing_; }
+  void set_initialize_ksyms_synchronously_for_testing(bool value) { initialize_ksyms_synchronously_for_testing_ = value; _has_field_.set(14); }
+
+ private:
+  std::vector<std::string> ftrace_events_;
+  std::vector<std::string> atrace_categories_;
+  std::vector<std::string> atrace_apps_;
+  uint32_t buffer_size_kb_{};
+  uint32_t drain_period_ms_{};
+  ::protozero::CopyablePtr<FtraceConfig_CompactSchedConfig> compact_sched_;
+  bool symbolize_ksyms_{};
+  bool initialize_ksyms_synchronously_for_testing_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<15> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT FtraceConfig_CompactSchedConfig : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kEnabledFieldNumber = 1,
+  };
+
+  FtraceConfig_CompactSchedConfig();
+  ~FtraceConfig_CompactSchedConfig() override;
+  FtraceConfig_CompactSchedConfig(FtraceConfig_CompactSchedConfig&&) noexcept;
+  FtraceConfig_CompactSchedConfig& operator=(FtraceConfig_CompactSchedConfig&&);
+  FtraceConfig_CompactSchedConfig(const FtraceConfig_CompactSchedConfig&);
+  FtraceConfig_CompactSchedConfig& operator=(const FtraceConfig_CompactSchedConfig&);
+  bool operator==(const FtraceConfig_CompactSchedConfig&) const;
+  bool operator!=(const FtraceConfig_CompactSchedConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_enabled() const { return _has_field_[1]; }
+  bool enabled() const { return enabled_; }
+  void set_enabled(bool value) { enabled_ = value; _has_field_.set(1); }
+
+ private:
+  bool enabled_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_FTRACE_FTRACE_CONFIG_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/config/gpu/gpu_counter_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_GPU_GPU_COUNTER_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_GPU_GPU_COUNTER_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class GpuCounterConfig;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT GpuCounterConfig : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kCounterPeriodNsFieldNumber = 1,
+    kCounterIdsFieldNumber = 2,
+    kInstrumentedSamplingFieldNumber = 3,
+    kFixGpuClockFieldNumber = 4,
+  };
+
+  GpuCounterConfig();
+  ~GpuCounterConfig() override;
+  GpuCounterConfig(GpuCounterConfig&&) noexcept;
+  GpuCounterConfig& operator=(GpuCounterConfig&&);
+  GpuCounterConfig(const GpuCounterConfig&);
+  GpuCounterConfig& operator=(const GpuCounterConfig&);
+  bool operator==(const GpuCounterConfig&) const;
+  bool operator!=(const GpuCounterConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_counter_period_ns() const { return _has_field_[1]; }
+  uint64_t counter_period_ns() const { return counter_period_ns_; }
+  void set_counter_period_ns(uint64_t value) { counter_period_ns_ = value; _has_field_.set(1); }
+
+  const std::vector<uint32_t>& counter_ids() const { return counter_ids_; }
+  std::vector<uint32_t>* mutable_counter_ids() { return &counter_ids_; }
+  int counter_ids_size() const { return static_cast<int>(counter_ids_.size()); }
+  void clear_counter_ids() { counter_ids_.clear(); }
+  void add_counter_ids(uint32_t value) { counter_ids_.emplace_back(value); }
+  uint32_t* add_counter_ids() { counter_ids_.emplace_back(); return &counter_ids_.back(); }
+
+  bool has_instrumented_sampling() const { return _has_field_[3]; }
+  bool instrumented_sampling() const { return instrumented_sampling_; }
+  void set_instrumented_sampling(bool value) { instrumented_sampling_ = value; _has_field_.set(3); }
+
+  bool has_fix_gpu_clock() const { return _has_field_[4]; }
+  bool fix_gpu_clock() const { return fix_gpu_clock_; }
+  void set_fix_gpu_clock(bool value) { fix_gpu_clock_ = value; _has_field_.set(4); }
+
+ private:
+  uint64_t counter_period_ns_{};
+  std::vector<uint32_t> counter_ids_;
+  bool instrumented_sampling_{};
+  bool fix_gpu_clock_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<5> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_GPU_GPU_COUNTER_CONFIG_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/config/gpu/vulkan_memory_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_GPU_VULKAN_MEMORY_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_GPU_VULKAN_MEMORY_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class VulkanMemoryConfig;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT VulkanMemoryConfig : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kTrackDriverMemoryUsageFieldNumber = 1,
+    kTrackDeviceMemoryUsageFieldNumber = 2,
+  };
+
+  VulkanMemoryConfig();
+  ~VulkanMemoryConfig() override;
+  VulkanMemoryConfig(VulkanMemoryConfig&&) noexcept;
+  VulkanMemoryConfig& operator=(VulkanMemoryConfig&&);
+  VulkanMemoryConfig(const VulkanMemoryConfig&);
+  VulkanMemoryConfig& operator=(const VulkanMemoryConfig&);
+  bool operator==(const VulkanMemoryConfig&) const;
+  bool operator!=(const VulkanMemoryConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_track_driver_memory_usage() const { return _has_field_[1]; }
+  bool track_driver_memory_usage() const { return track_driver_memory_usage_; }
+  void set_track_driver_memory_usage(bool value) { track_driver_memory_usage_ = value; _has_field_.set(1); }
+
+  bool has_track_device_memory_usage() const { return _has_field_[2]; }
+  bool track_device_memory_usage() const { return track_device_memory_usage_; }
+  void set_track_device_memory_usage(bool value) { track_device_memory_usage_ = value; _has_field_.set(2); }
+
+ private:
+  bool track_driver_memory_usage_{};
+  bool track_device_memory_usage_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_GPU_VULKAN_MEMORY_CONFIG_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/config/inode_file/inode_file_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INODE_FILE_INODE_FILE_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INODE_FILE_INODE_FILE_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class InodeFileConfig;
+class InodeFileConfig_MountPointMappingEntry;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT InodeFileConfig : public ::protozero::CppMessageObj {
+ public:
+  using MountPointMappingEntry = InodeFileConfig_MountPointMappingEntry;
+  enum FieldNumbers {
+    kScanIntervalMsFieldNumber = 1,
+    kScanDelayMsFieldNumber = 2,
+    kScanBatchSizeFieldNumber = 3,
+    kDoNotScanFieldNumber = 4,
+    kScanMountPointsFieldNumber = 5,
+    kMountPointMappingFieldNumber = 6,
+  };
+
+  InodeFileConfig();
+  ~InodeFileConfig() override;
+  InodeFileConfig(InodeFileConfig&&) noexcept;
+  InodeFileConfig& operator=(InodeFileConfig&&);
+  InodeFileConfig(const InodeFileConfig&);
+  InodeFileConfig& operator=(const InodeFileConfig&);
+  bool operator==(const InodeFileConfig&) const;
+  bool operator!=(const InodeFileConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_scan_interval_ms() const { return _has_field_[1]; }
+  uint32_t scan_interval_ms() const { return scan_interval_ms_; }
+  void set_scan_interval_ms(uint32_t value) { scan_interval_ms_ = value; _has_field_.set(1); }
+
+  bool has_scan_delay_ms() const { return _has_field_[2]; }
+  uint32_t scan_delay_ms() const { return scan_delay_ms_; }
+  void set_scan_delay_ms(uint32_t value) { scan_delay_ms_ = value; _has_field_.set(2); }
+
+  bool has_scan_batch_size() const { return _has_field_[3]; }
+  uint32_t scan_batch_size() const { return scan_batch_size_; }
+  void set_scan_batch_size(uint32_t value) { scan_batch_size_ = value; _has_field_.set(3); }
+
+  bool has_do_not_scan() const { return _has_field_[4]; }
+  bool do_not_scan() const { return do_not_scan_; }
+  void set_do_not_scan(bool value) { do_not_scan_ = value; _has_field_.set(4); }
+
+  const std::vector<std::string>& scan_mount_points() const { return scan_mount_points_; }
+  std::vector<std::string>* mutable_scan_mount_points() { return &scan_mount_points_; }
+  int scan_mount_points_size() const { return static_cast<int>(scan_mount_points_.size()); }
+  void clear_scan_mount_points() { scan_mount_points_.clear(); }
+  void add_scan_mount_points(std::string value) { scan_mount_points_.emplace_back(value); }
+  std::string* add_scan_mount_points() { scan_mount_points_.emplace_back(); return &scan_mount_points_.back(); }
+
+  const std::vector<InodeFileConfig_MountPointMappingEntry>& mount_point_mapping() const { return mount_point_mapping_; }
+  std::vector<InodeFileConfig_MountPointMappingEntry>* mutable_mount_point_mapping() { return &mount_point_mapping_; }
+  int mount_point_mapping_size() const;
+  void clear_mount_point_mapping();
+  InodeFileConfig_MountPointMappingEntry* add_mount_point_mapping();
+
+ private:
+  uint32_t scan_interval_ms_{};
+  uint32_t scan_delay_ms_{};
+  uint32_t scan_batch_size_{};
+  bool do_not_scan_{};
+  std::vector<std::string> scan_mount_points_;
+  std::vector<InodeFileConfig_MountPointMappingEntry> mount_point_mapping_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<7> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT InodeFileConfig_MountPointMappingEntry : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kMountpointFieldNumber = 1,
+    kScanRootsFieldNumber = 2,
+  };
+
+  InodeFileConfig_MountPointMappingEntry();
+  ~InodeFileConfig_MountPointMappingEntry() override;
+  InodeFileConfig_MountPointMappingEntry(InodeFileConfig_MountPointMappingEntry&&) noexcept;
+  InodeFileConfig_MountPointMappingEntry& operator=(InodeFileConfig_MountPointMappingEntry&&);
+  InodeFileConfig_MountPointMappingEntry(const InodeFileConfig_MountPointMappingEntry&);
+  InodeFileConfig_MountPointMappingEntry& operator=(const InodeFileConfig_MountPointMappingEntry&);
+  bool operator==(const InodeFileConfig_MountPointMappingEntry&) const;
+  bool operator!=(const InodeFileConfig_MountPointMappingEntry& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_mountpoint() const { return _has_field_[1]; }
+  const std::string& mountpoint() const { return mountpoint_; }
+  void set_mountpoint(const std::string& value) { mountpoint_ = value; _has_field_.set(1); }
+
+  const std::vector<std::string>& scan_roots() const { return scan_roots_; }
+  std::vector<std::string>* mutable_scan_roots() { return &scan_roots_; }
+  int scan_roots_size() const { return static_cast<int>(scan_roots_.size()); }
+  void clear_scan_roots() { scan_roots_.clear(); }
+  void add_scan_roots(std::string value) { scan_roots_.emplace_back(value); }
+  std::string* add_scan_roots() { scan_roots_.emplace_back(); return &scan_roots_.back(); }
+
+ private:
+  std::string mountpoint_{};
+  std::vector<std::string> scan_roots_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INODE_FILE_INODE_FILE_CONFIG_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/config/interceptors/console_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INTERCEPTORS_CONSOLE_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INTERCEPTORS_CONSOLE_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ConsoleConfig;
+enum ConsoleConfig_Output : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum ConsoleConfig_Output : int {
+  ConsoleConfig_Output_OUTPUT_UNSPECIFIED = 0,
+  ConsoleConfig_Output_OUTPUT_STDOUT = 1,
+  ConsoleConfig_Output_OUTPUT_STDERR = 2,
+};
+
+class PERFETTO_EXPORT ConsoleConfig : public ::protozero::CppMessageObj {
+ public:
+  using Output = ConsoleConfig_Output;
+  static constexpr auto OUTPUT_UNSPECIFIED = ConsoleConfig_Output_OUTPUT_UNSPECIFIED;
+  static constexpr auto OUTPUT_STDOUT = ConsoleConfig_Output_OUTPUT_STDOUT;
+  static constexpr auto OUTPUT_STDERR = ConsoleConfig_Output_OUTPUT_STDERR;
+  static constexpr auto Output_MIN = ConsoleConfig_Output_OUTPUT_UNSPECIFIED;
+  static constexpr auto Output_MAX = ConsoleConfig_Output_OUTPUT_STDERR;
+  enum FieldNumbers {
+    kOutputFieldNumber = 1,
+    kEnableColorsFieldNumber = 2,
+  };
+
+  ConsoleConfig();
+  ~ConsoleConfig() override;
+  ConsoleConfig(ConsoleConfig&&) noexcept;
+  ConsoleConfig& operator=(ConsoleConfig&&);
+  ConsoleConfig(const ConsoleConfig&);
+  ConsoleConfig& operator=(const ConsoleConfig&);
+  bool operator==(const ConsoleConfig&) const;
+  bool operator!=(const ConsoleConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_output() const { return _has_field_[1]; }
+  ConsoleConfig_Output output() const { return output_; }
+  void set_output(ConsoleConfig_Output value) { output_ = value; _has_field_.set(1); }
+
+  bool has_enable_colors() const { return _has_field_[2]; }
+  bool enable_colors() const { return enable_colors_; }
+  void set_enable_colors(bool value) { enable_colors_ = value; _has_field_.set(2); }
+
+ private:
+  ConsoleConfig_Output output_{};
+  bool enable_colors_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INTERCEPTORS_CONSOLE_CONFIG_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/config/power/android_power_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_POWER_ANDROID_POWER_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_POWER_ANDROID_POWER_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class AndroidPowerConfig;
+enum AndroidPowerConfig_BatteryCounters : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum AndroidPowerConfig_BatteryCounters : int {
+  AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_UNSPECIFIED = 0,
+  AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CHARGE = 1,
+  AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CAPACITY_PERCENT = 2,
+  AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CURRENT = 3,
+  AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CURRENT_AVG = 4,
+};
+
+class PERFETTO_EXPORT AndroidPowerConfig : public ::protozero::CppMessageObj {
+ public:
+  using BatteryCounters = AndroidPowerConfig_BatteryCounters;
+  static constexpr auto BATTERY_COUNTER_UNSPECIFIED = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_UNSPECIFIED;
+  static constexpr auto BATTERY_COUNTER_CHARGE = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CHARGE;
+  static constexpr auto BATTERY_COUNTER_CAPACITY_PERCENT = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CAPACITY_PERCENT;
+  static constexpr auto BATTERY_COUNTER_CURRENT = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CURRENT;
+  static constexpr auto BATTERY_COUNTER_CURRENT_AVG = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CURRENT_AVG;
+  static constexpr auto BatteryCounters_MIN = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_UNSPECIFIED;
+  static constexpr auto BatteryCounters_MAX = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CURRENT_AVG;
+  enum FieldNumbers {
+    kBatteryPollMsFieldNumber = 1,
+    kBatteryCountersFieldNumber = 2,
+    kCollectPowerRailsFieldNumber = 3,
+    kCollectEnergyEstimationBreakdownFieldNumber = 4,
+  };
+
+  AndroidPowerConfig();
+  ~AndroidPowerConfig() override;
+  AndroidPowerConfig(AndroidPowerConfig&&) noexcept;
+  AndroidPowerConfig& operator=(AndroidPowerConfig&&);
+  AndroidPowerConfig(const AndroidPowerConfig&);
+  AndroidPowerConfig& operator=(const AndroidPowerConfig&);
+  bool operator==(const AndroidPowerConfig&) const;
+  bool operator!=(const AndroidPowerConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_battery_poll_ms() const { return _has_field_[1]; }
+  uint32_t battery_poll_ms() const { return battery_poll_ms_; }
+  void set_battery_poll_ms(uint32_t value) { battery_poll_ms_ = value; _has_field_.set(1); }
+
+  const std::vector<AndroidPowerConfig_BatteryCounters>& battery_counters() const { return battery_counters_; }
+  std::vector<AndroidPowerConfig_BatteryCounters>* mutable_battery_counters() { return &battery_counters_; }
+  int battery_counters_size() const { return static_cast<int>(battery_counters_.size()); }
+  void clear_battery_counters() { battery_counters_.clear(); }
+  void add_battery_counters(AndroidPowerConfig_BatteryCounters value) { battery_counters_.emplace_back(value); }
+  AndroidPowerConfig_BatteryCounters* add_battery_counters() { battery_counters_.emplace_back(); return &battery_counters_.back(); }
+
+  bool has_collect_power_rails() const { return _has_field_[3]; }
+  bool collect_power_rails() const { return collect_power_rails_; }
+  void set_collect_power_rails(bool value) { collect_power_rails_ = value; _has_field_.set(3); }
+
+  bool has_collect_energy_estimation_breakdown() const { return _has_field_[4]; }
+  bool collect_energy_estimation_breakdown() const { return collect_energy_estimation_breakdown_; }
+  void set_collect_energy_estimation_breakdown(bool value) { collect_energy_estimation_breakdown_ = value; _has_field_.set(4); }
+
+ private:
+  uint32_t battery_poll_ms_{};
+  std::vector<AndroidPowerConfig_BatteryCounters> battery_counters_;
+  bool collect_power_rails_{};
+  bool collect_energy_estimation_breakdown_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<5> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_POWER_ANDROID_POWER_CONFIG_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/config/process_stats/process_stats_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROCESS_STATS_PROCESS_STATS_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROCESS_STATS_PROCESS_STATS_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ProcessStatsConfig;
+enum ProcessStatsConfig_Quirks : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum ProcessStatsConfig_Quirks : int {
+  ProcessStatsConfig_Quirks_QUIRKS_UNSPECIFIED = 0,
+  ProcessStatsConfig_Quirks_DISABLE_INITIAL_DUMP = 1,
+  ProcessStatsConfig_Quirks_DISABLE_ON_DEMAND = 2,
+};
+
+class PERFETTO_EXPORT ProcessStatsConfig : public ::protozero::CppMessageObj {
+ public:
+  using Quirks = ProcessStatsConfig_Quirks;
+  static constexpr auto QUIRKS_UNSPECIFIED = ProcessStatsConfig_Quirks_QUIRKS_UNSPECIFIED;
+  static constexpr auto DISABLE_INITIAL_DUMP = ProcessStatsConfig_Quirks_DISABLE_INITIAL_DUMP;
+  static constexpr auto DISABLE_ON_DEMAND = ProcessStatsConfig_Quirks_DISABLE_ON_DEMAND;
+  static constexpr auto Quirks_MIN = ProcessStatsConfig_Quirks_QUIRKS_UNSPECIFIED;
+  static constexpr auto Quirks_MAX = ProcessStatsConfig_Quirks_DISABLE_ON_DEMAND;
+  enum FieldNumbers {
+    kQuirksFieldNumber = 1,
+    kScanAllProcessesOnStartFieldNumber = 2,
+    kRecordThreadNamesFieldNumber = 3,
+    kProcStatsPollMsFieldNumber = 4,
+    kProcStatsCacheTtlMsFieldNumber = 6,
+    kRecordThreadTimeInStateFieldNumber = 7,
+    kThreadTimeInStateCacheSizeFieldNumber = 8,
+  };
+
+  ProcessStatsConfig();
+  ~ProcessStatsConfig() override;
+  ProcessStatsConfig(ProcessStatsConfig&&) noexcept;
+  ProcessStatsConfig& operator=(ProcessStatsConfig&&);
+  ProcessStatsConfig(const ProcessStatsConfig&);
+  ProcessStatsConfig& operator=(const ProcessStatsConfig&);
+  bool operator==(const ProcessStatsConfig&) const;
+  bool operator!=(const ProcessStatsConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<ProcessStatsConfig_Quirks>& quirks() const { return quirks_; }
+  std::vector<ProcessStatsConfig_Quirks>* mutable_quirks() { return &quirks_; }
+  int quirks_size() const { return static_cast<int>(quirks_.size()); }
+  void clear_quirks() { quirks_.clear(); }
+  void add_quirks(ProcessStatsConfig_Quirks value) { quirks_.emplace_back(value); }
+  ProcessStatsConfig_Quirks* add_quirks() { quirks_.emplace_back(); return &quirks_.back(); }
+
+  bool has_scan_all_processes_on_start() const { return _has_field_[2]; }
+  bool scan_all_processes_on_start() const { return scan_all_processes_on_start_; }
+  void set_scan_all_processes_on_start(bool value) { scan_all_processes_on_start_ = value; _has_field_.set(2); }
+
+  bool has_record_thread_names() const { return _has_field_[3]; }
+  bool record_thread_names() const { return record_thread_names_; }
+  void set_record_thread_names(bool value) { record_thread_names_ = value; _has_field_.set(3); }
+
+  bool has_proc_stats_poll_ms() const { return _has_field_[4]; }
+  uint32_t proc_stats_poll_ms() const { return proc_stats_poll_ms_; }
+  void set_proc_stats_poll_ms(uint32_t value) { proc_stats_poll_ms_ = value; _has_field_.set(4); }
+
+  bool has_proc_stats_cache_ttl_ms() const { return _has_field_[6]; }
+  uint32_t proc_stats_cache_ttl_ms() const { return proc_stats_cache_ttl_ms_; }
+  void set_proc_stats_cache_ttl_ms(uint32_t value) { proc_stats_cache_ttl_ms_ = value; _has_field_.set(6); }
+
+  bool has_record_thread_time_in_state() const { return _has_field_[7]; }
+  bool record_thread_time_in_state() const { return record_thread_time_in_state_; }
+  void set_record_thread_time_in_state(bool value) { record_thread_time_in_state_ = value; _has_field_.set(7); }
+
+  bool has_thread_time_in_state_cache_size() const { return _has_field_[8]; }
+  uint32_t thread_time_in_state_cache_size() const { return thread_time_in_state_cache_size_; }
+  void set_thread_time_in_state_cache_size(uint32_t value) { thread_time_in_state_cache_size_ = value; _has_field_.set(8); }
+
+ private:
+  std::vector<ProcessStatsConfig_Quirks> quirks_;
+  bool scan_all_processes_on_start_{};
+  bool record_thread_names_{};
+  uint32_t proc_stats_poll_ms_{};
+  uint32_t proc_stats_cache_ttl_ms_{};
+  bool record_thread_time_in_state_{};
+  uint32_t thread_time_in_state_cache_size_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<9> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROCESS_STATS_PROCESS_STATS_CONFIG_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/config/profiling/heapprofd_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_HEAPPROFD_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_HEAPPROFD_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class HeapprofdConfig;
+class HeapprofdConfig_ContinuousDumpConfig;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT HeapprofdConfig : public ::protozero::CppMessageObj {
+ public:
+  using ContinuousDumpConfig = HeapprofdConfig_ContinuousDumpConfig;
+  enum FieldNumbers {
+    kSamplingIntervalBytesFieldNumber = 1,
+    kAdaptiveSamplingShmemThresholdFieldNumber = 24,
+    kAdaptiveSamplingMaxSamplingIntervalBytesFieldNumber = 25,
+    kProcessCmdlineFieldNumber = 2,
+    kPidFieldNumber = 4,
+    kTargetInstalledByFieldNumber = 26,
+    kHeapsFieldNumber = 20,
+    kExcludeHeapsFieldNumber = 27,
+    kStreamAllocationsFieldNumber = 23,
+    kHeapSamplingIntervalsFieldNumber = 22,
+    kAllHeapsFieldNumber = 21,
+    kAllFieldNumber = 5,
+    kMinAnonymousMemoryKbFieldNumber = 15,
+    kMaxHeapprofdMemoryKbFieldNumber = 16,
+    kMaxHeapprofdCpuSecsFieldNumber = 17,
+    kSkipSymbolPrefixFieldNumber = 7,
+    kContinuousDumpConfigFieldNumber = 6,
+    kShmemSizeBytesFieldNumber = 8,
+    kBlockClientFieldNumber = 9,
+    kBlockClientTimeoutUsFieldNumber = 14,
+    kNoStartupFieldNumber = 10,
+    kNoRunningFieldNumber = 11,
+    kDumpAtMaxFieldNumber = 13,
+    kDisableForkTeardownFieldNumber = 18,
+    kDisableVforkDetectionFieldNumber = 19,
+  };
+
+  HeapprofdConfig();
+  ~HeapprofdConfig() override;
+  HeapprofdConfig(HeapprofdConfig&&) noexcept;
+  HeapprofdConfig& operator=(HeapprofdConfig&&);
+  HeapprofdConfig(const HeapprofdConfig&);
+  HeapprofdConfig& operator=(const HeapprofdConfig&);
+  bool operator==(const HeapprofdConfig&) const;
+  bool operator!=(const HeapprofdConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_sampling_interval_bytes() const { return _has_field_[1]; }
+  uint64_t sampling_interval_bytes() const { return sampling_interval_bytes_; }
+  void set_sampling_interval_bytes(uint64_t value) { sampling_interval_bytes_ = value; _has_field_.set(1); }
+
+  bool has_adaptive_sampling_shmem_threshold() const { return _has_field_[24]; }
+  uint64_t adaptive_sampling_shmem_threshold() const { return adaptive_sampling_shmem_threshold_; }
+  void set_adaptive_sampling_shmem_threshold(uint64_t value) { adaptive_sampling_shmem_threshold_ = value; _has_field_.set(24); }
+
+  bool has_adaptive_sampling_max_sampling_interval_bytes() const { return _has_field_[25]; }
+  uint64_t adaptive_sampling_max_sampling_interval_bytes() const { return adaptive_sampling_max_sampling_interval_bytes_; }
+  void set_adaptive_sampling_max_sampling_interval_bytes(uint64_t value) { adaptive_sampling_max_sampling_interval_bytes_ = value; _has_field_.set(25); }
+
+  const std::vector<std::string>& process_cmdline() const { return process_cmdline_; }
+  std::vector<std::string>* mutable_process_cmdline() { return &process_cmdline_; }
+  int process_cmdline_size() const { return static_cast<int>(process_cmdline_.size()); }
+  void clear_process_cmdline() { process_cmdline_.clear(); }
+  void add_process_cmdline(std::string value) { process_cmdline_.emplace_back(value); }
+  std::string* add_process_cmdline() { process_cmdline_.emplace_back(); return &process_cmdline_.back(); }
+
+  const std::vector<uint64_t>& pid() const { return pid_; }
+  std::vector<uint64_t>* mutable_pid() { return &pid_; }
+  int pid_size() const { return static_cast<int>(pid_.size()); }
+  void clear_pid() { pid_.clear(); }
+  void add_pid(uint64_t value) { pid_.emplace_back(value); }
+  uint64_t* add_pid() { pid_.emplace_back(); return &pid_.back(); }
+
+  const std::vector<std::string>& target_installed_by() const { return target_installed_by_; }
+  std::vector<std::string>* mutable_target_installed_by() { return &target_installed_by_; }
+  int target_installed_by_size() const { return static_cast<int>(target_installed_by_.size()); }
+  void clear_target_installed_by() { target_installed_by_.clear(); }
+  void add_target_installed_by(std::string value) { target_installed_by_.emplace_back(value); }
+  std::string* add_target_installed_by() { target_installed_by_.emplace_back(); return &target_installed_by_.back(); }
+
+  const std::vector<std::string>& heaps() const { return heaps_; }
+  std::vector<std::string>* mutable_heaps() { return &heaps_; }
+  int heaps_size() const { return static_cast<int>(heaps_.size()); }
+  void clear_heaps() { heaps_.clear(); }
+  void add_heaps(std::string value) { heaps_.emplace_back(value); }
+  std::string* add_heaps() { heaps_.emplace_back(); return &heaps_.back(); }
+
+  const std::vector<std::string>& exclude_heaps() const { return exclude_heaps_; }
+  std::vector<std::string>* mutable_exclude_heaps() { return &exclude_heaps_; }
+  int exclude_heaps_size() const { return static_cast<int>(exclude_heaps_.size()); }
+  void clear_exclude_heaps() { exclude_heaps_.clear(); }
+  void add_exclude_heaps(std::string value) { exclude_heaps_.emplace_back(value); }
+  std::string* add_exclude_heaps() { exclude_heaps_.emplace_back(); return &exclude_heaps_.back(); }
+
+  bool has_stream_allocations() const { return _has_field_[23]; }
+  bool stream_allocations() const { return stream_allocations_; }
+  void set_stream_allocations(bool value) { stream_allocations_ = value; _has_field_.set(23); }
+
+  const std::vector<uint64_t>& heap_sampling_intervals() const { return heap_sampling_intervals_; }
+  std::vector<uint64_t>* mutable_heap_sampling_intervals() { return &heap_sampling_intervals_; }
+  int heap_sampling_intervals_size() const { return static_cast<int>(heap_sampling_intervals_.size()); }
+  void clear_heap_sampling_intervals() { heap_sampling_intervals_.clear(); }
+  void add_heap_sampling_intervals(uint64_t value) { heap_sampling_intervals_.emplace_back(value); }
+  uint64_t* add_heap_sampling_intervals() { heap_sampling_intervals_.emplace_back(); return &heap_sampling_intervals_.back(); }
+
+  bool has_all_heaps() const { return _has_field_[21]; }
+  bool all_heaps() const { return all_heaps_; }
+  void set_all_heaps(bool value) { all_heaps_ = value; _has_field_.set(21); }
+
+  bool has_all() const { return _has_field_[5]; }
+  bool all() const { return all_; }
+  void set_all(bool value) { all_ = value; _has_field_.set(5); }
+
+  bool has_min_anonymous_memory_kb() const { return _has_field_[15]; }
+  uint32_t min_anonymous_memory_kb() const { return min_anonymous_memory_kb_; }
+  void set_min_anonymous_memory_kb(uint32_t value) { min_anonymous_memory_kb_ = value; _has_field_.set(15); }
+
+  bool has_max_heapprofd_memory_kb() const { return _has_field_[16]; }
+  uint32_t max_heapprofd_memory_kb() const { return max_heapprofd_memory_kb_; }
+  void set_max_heapprofd_memory_kb(uint32_t value) { max_heapprofd_memory_kb_ = value; _has_field_.set(16); }
+
+  bool has_max_heapprofd_cpu_secs() const { return _has_field_[17]; }
+  uint64_t max_heapprofd_cpu_secs() const { return max_heapprofd_cpu_secs_; }
+  void set_max_heapprofd_cpu_secs(uint64_t value) { max_heapprofd_cpu_secs_ = value; _has_field_.set(17); }
+
+  const std::vector<std::string>& skip_symbol_prefix() const { return skip_symbol_prefix_; }
+  std::vector<std::string>* mutable_skip_symbol_prefix() { return &skip_symbol_prefix_; }
+  int skip_symbol_prefix_size() const { return static_cast<int>(skip_symbol_prefix_.size()); }
+  void clear_skip_symbol_prefix() { skip_symbol_prefix_.clear(); }
+  void add_skip_symbol_prefix(std::string value) { skip_symbol_prefix_.emplace_back(value); }
+  std::string* add_skip_symbol_prefix() { skip_symbol_prefix_.emplace_back(); return &skip_symbol_prefix_.back(); }
+
+  bool has_continuous_dump_config() const { return _has_field_[6]; }
+  const HeapprofdConfig_ContinuousDumpConfig& continuous_dump_config() const { return *continuous_dump_config_; }
+  HeapprofdConfig_ContinuousDumpConfig* mutable_continuous_dump_config() { _has_field_.set(6); return continuous_dump_config_.get(); }
+
+  bool has_shmem_size_bytes() const { return _has_field_[8]; }
+  uint64_t shmem_size_bytes() const { return shmem_size_bytes_; }
+  void set_shmem_size_bytes(uint64_t value) { shmem_size_bytes_ = value; _has_field_.set(8); }
+
+  bool has_block_client() const { return _has_field_[9]; }
+  bool block_client() const { return block_client_; }
+  void set_block_client(bool value) { block_client_ = value; _has_field_.set(9); }
+
+  bool has_block_client_timeout_us() const { return _has_field_[14]; }
+  uint32_t block_client_timeout_us() const { return block_client_timeout_us_; }
+  void set_block_client_timeout_us(uint32_t value) { block_client_timeout_us_ = value; _has_field_.set(14); }
+
+  bool has_no_startup() const { return _has_field_[10]; }
+  bool no_startup() const { return no_startup_; }
+  void set_no_startup(bool value) { no_startup_ = value; _has_field_.set(10); }
+
+  bool has_no_running() const { return _has_field_[11]; }
+  bool no_running() const { return no_running_; }
+  void set_no_running(bool value) { no_running_ = value; _has_field_.set(11); }
+
+  bool has_dump_at_max() const { return _has_field_[13]; }
+  bool dump_at_max() const { return dump_at_max_; }
+  void set_dump_at_max(bool value) { dump_at_max_ = value; _has_field_.set(13); }
+
+  bool has_disable_fork_teardown() const { return _has_field_[18]; }
+  bool disable_fork_teardown() const { return disable_fork_teardown_; }
+  void set_disable_fork_teardown(bool value) { disable_fork_teardown_ = value; _has_field_.set(18); }
+
+  bool has_disable_vfork_detection() const { return _has_field_[19]; }
+  bool disable_vfork_detection() const { return disable_vfork_detection_; }
+  void set_disable_vfork_detection(bool value) { disable_vfork_detection_ = value; _has_field_.set(19); }
+
+ private:
+  uint64_t sampling_interval_bytes_{};
+  uint64_t adaptive_sampling_shmem_threshold_{};
+  uint64_t adaptive_sampling_max_sampling_interval_bytes_{};
+  std::vector<std::string> process_cmdline_;
+  std::vector<uint64_t> pid_;
+  std::vector<std::string> target_installed_by_;
+  std::vector<std::string> heaps_;
+  std::vector<std::string> exclude_heaps_;
+  bool stream_allocations_{};
+  std::vector<uint64_t> heap_sampling_intervals_;
+  bool all_heaps_{};
+  bool all_{};
+  uint32_t min_anonymous_memory_kb_{};
+  uint32_t max_heapprofd_memory_kb_{};
+  uint64_t max_heapprofd_cpu_secs_{};
+  std::vector<std::string> skip_symbol_prefix_;
+  ::protozero::CopyablePtr<HeapprofdConfig_ContinuousDumpConfig> continuous_dump_config_;
+  uint64_t shmem_size_bytes_{};
+  bool block_client_{};
+  uint32_t block_client_timeout_us_{};
+  bool no_startup_{};
+  bool no_running_{};
+  bool dump_at_max_{};
+  bool disable_fork_teardown_{};
+  bool disable_vfork_detection_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<28> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT HeapprofdConfig_ContinuousDumpConfig : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDumpPhaseMsFieldNumber = 5,
+    kDumpIntervalMsFieldNumber = 6,
+  };
+
+  HeapprofdConfig_ContinuousDumpConfig();
+  ~HeapprofdConfig_ContinuousDumpConfig() override;
+  HeapprofdConfig_ContinuousDumpConfig(HeapprofdConfig_ContinuousDumpConfig&&) noexcept;
+  HeapprofdConfig_ContinuousDumpConfig& operator=(HeapprofdConfig_ContinuousDumpConfig&&);
+  HeapprofdConfig_ContinuousDumpConfig(const HeapprofdConfig_ContinuousDumpConfig&);
+  HeapprofdConfig_ContinuousDumpConfig& operator=(const HeapprofdConfig_ContinuousDumpConfig&);
+  bool operator==(const HeapprofdConfig_ContinuousDumpConfig&) const;
+  bool operator!=(const HeapprofdConfig_ContinuousDumpConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_dump_phase_ms() const { return _has_field_[5]; }
+  uint32_t dump_phase_ms() const { return dump_phase_ms_; }
+  void set_dump_phase_ms(uint32_t value) { dump_phase_ms_ = value; _has_field_.set(5); }
+
+  bool has_dump_interval_ms() const { return _has_field_[6]; }
+  uint32_t dump_interval_ms() const { return dump_interval_ms_; }
+  void set_dump_interval_ms(uint32_t value) { dump_interval_ms_ = value; _has_field_.set(6); }
+
+ private:
+  uint32_t dump_phase_ms_{};
+  uint32_t dump_interval_ms_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<7> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_HEAPPROFD_CONFIG_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/config/profiling/java_hprof_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_JAVA_HPROF_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_JAVA_HPROF_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class JavaHprofConfig;
+class JavaHprofConfig_ContinuousDumpConfig;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT JavaHprofConfig : public ::protozero::CppMessageObj {
+ public:
+  using ContinuousDumpConfig = JavaHprofConfig_ContinuousDumpConfig;
+  enum FieldNumbers {
+    kProcessCmdlineFieldNumber = 1,
+    kPidFieldNumber = 2,
+    kTargetInstalledByFieldNumber = 7,
+    kContinuousDumpConfigFieldNumber = 3,
+    kMinAnonymousMemoryKbFieldNumber = 4,
+    kDumpSmapsFieldNumber = 5,
+    kIgnoredTypesFieldNumber = 6,
+  };
+
+  JavaHprofConfig();
+  ~JavaHprofConfig() override;
+  JavaHprofConfig(JavaHprofConfig&&) noexcept;
+  JavaHprofConfig& operator=(JavaHprofConfig&&);
+  JavaHprofConfig(const JavaHprofConfig&);
+  JavaHprofConfig& operator=(const JavaHprofConfig&);
+  bool operator==(const JavaHprofConfig&) const;
+  bool operator!=(const JavaHprofConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<std::string>& process_cmdline() const { return process_cmdline_; }
+  std::vector<std::string>* mutable_process_cmdline() { return &process_cmdline_; }
+  int process_cmdline_size() const { return static_cast<int>(process_cmdline_.size()); }
+  void clear_process_cmdline() { process_cmdline_.clear(); }
+  void add_process_cmdline(std::string value) { process_cmdline_.emplace_back(value); }
+  std::string* add_process_cmdline() { process_cmdline_.emplace_back(); return &process_cmdline_.back(); }
+
+  const std::vector<uint64_t>& pid() const { return pid_; }
+  std::vector<uint64_t>* mutable_pid() { return &pid_; }
+  int pid_size() const { return static_cast<int>(pid_.size()); }
+  void clear_pid() { pid_.clear(); }
+  void add_pid(uint64_t value) { pid_.emplace_back(value); }
+  uint64_t* add_pid() { pid_.emplace_back(); return &pid_.back(); }
+
+  const std::vector<std::string>& target_installed_by() const { return target_installed_by_; }
+  std::vector<std::string>* mutable_target_installed_by() { return &target_installed_by_; }
+  int target_installed_by_size() const { return static_cast<int>(target_installed_by_.size()); }
+  void clear_target_installed_by() { target_installed_by_.clear(); }
+  void add_target_installed_by(std::string value) { target_installed_by_.emplace_back(value); }
+  std::string* add_target_installed_by() { target_installed_by_.emplace_back(); return &target_installed_by_.back(); }
+
+  bool has_continuous_dump_config() const { return _has_field_[3]; }
+  const JavaHprofConfig_ContinuousDumpConfig& continuous_dump_config() const { return *continuous_dump_config_; }
+  JavaHprofConfig_ContinuousDumpConfig* mutable_continuous_dump_config() { _has_field_.set(3); return continuous_dump_config_.get(); }
+
+  bool has_min_anonymous_memory_kb() const { return _has_field_[4]; }
+  uint32_t min_anonymous_memory_kb() const { return min_anonymous_memory_kb_; }
+  void set_min_anonymous_memory_kb(uint32_t value) { min_anonymous_memory_kb_ = value; _has_field_.set(4); }
+
+  bool has_dump_smaps() const { return _has_field_[5]; }
+  bool dump_smaps() const { return dump_smaps_; }
+  void set_dump_smaps(bool value) { dump_smaps_ = value; _has_field_.set(5); }
+
+  const std::vector<std::string>& ignored_types() const { return ignored_types_; }
+  std::vector<std::string>* mutable_ignored_types() { return &ignored_types_; }
+  int ignored_types_size() const { return static_cast<int>(ignored_types_.size()); }
+  void clear_ignored_types() { ignored_types_.clear(); }
+  void add_ignored_types(std::string value) { ignored_types_.emplace_back(value); }
+  std::string* add_ignored_types() { ignored_types_.emplace_back(); return &ignored_types_.back(); }
+
+ private:
+  std::vector<std::string> process_cmdline_;
+  std::vector<uint64_t> pid_;
+  std::vector<std::string> target_installed_by_;
+  ::protozero::CopyablePtr<JavaHprofConfig_ContinuousDumpConfig> continuous_dump_config_;
+  uint32_t min_anonymous_memory_kb_{};
+  bool dump_smaps_{};
+  std::vector<std::string> ignored_types_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<8> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT JavaHprofConfig_ContinuousDumpConfig : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDumpPhaseMsFieldNumber = 1,
+    kDumpIntervalMsFieldNumber = 2,
+  };
+
+  JavaHprofConfig_ContinuousDumpConfig();
+  ~JavaHprofConfig_ContinuousDumpConfig() override;
+  JavaHprofConfig_ContinuousDumpConfig(JavaHprofConfig_ContinuousDumpConfig&&) noexcept;
+  JavaHprofConfig_ContinuousDumpConfig& operator=(JavaHprofConfig_ContinuousDumpConfig&&);
+  JavaHprofConfig_ContinuousDumpConfig(const JavaHprofConfig_ContinuousDumpConfig&);
+  JavaHprofConfig_ContinuousDumpConfig& operator=(const JavaHprofConfig_ContinuousDumpConfig&);
+  bool operator==(const JavaHprofConfig_ContinuousDumpConfig&) const;
+  bool operator!=(const JavaHprofConfig_ContinuousDumpConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_dump_phase_ms() const { return _has_field_[1]; }
+  uint32_t dump_phase_ms() const { return dump_phase_ms_; }
+  void set_dump_phase_ms(uint32_t value) { dump_phase_ms_ = value; _has_field_.set(1); }
+
+  bool has_dump_interval_ms() const { return _has_field_[2]; }
+  uint32_t dump_interval_ms() const { return dump_interval_ms_; }
+  void set_dump_interval_ms(uint32_t value) { dump_interval_ms_ = value; _has_field_.set(2); }
+
+ private:
+  uint32_t dump_phase_ms_{};
+  uint32_t dump_interval_ms_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_JAVA_HPROF_CONFIG_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/config/profiling/perf_event_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_PERF_EVENT_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_PERF_EVENT_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class PerfEventConfig;
+class PerfEventConfig_CallstackSampling;
+class PerfEventConfig_Scope;
+class PerfEvents_Timebase;
+class PerfEvents_Tracepoint;
+enum PerfEvents_Counter : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT PerfEventConfig : public ::protozero::CppMessageObj {
+ public:
+  using CallstackSampling = PerfEventConfig_CallstackSampling;
+  using Scope = PerfEventConfig_Scope;
+  enum FieldNumbers {
+    kTimebaseFieldNumber = 15,
+    kCallstackSamplingFieldNumber = 16,
+    kRingBufferReadPeriodMsFieldNumber = 8,
+    kRingBufferPagesFieldNumber = 3,
+    kMaxEnqueuedFootprintKbFieldNumber = 17,
+    kMaxDaemonMemoryKbFieldNumber = 13,
+    kRemoteDescriptorTimeoutMsFieldNumber = 9,
+    kUnwindStateClearPeriodMsFieldNumber = 10,
+    kAllCpusFieldNumber = 1,
+    kSamplingFrequencyFieldNumber = 2,
+    kKernelFramesFieldNumber = 12,
+    kTargetPidFieldNumber = 4,
+    kTargetCmdlineFieldNumber = 5,
+    kTargetInstalledByFieldNumber = 18,
+    kExcludePidFieldNumber = 6,
+    kExcludeCmdlineFieldNumber = 7,
+    kAdditionalCmdlineCountFieldNumber = 11,
+  };
+
+  PerfEventConfig();
+  ~PerfEventConfig() override;
+  PerfEventConfig(PerfEventConfig&&) noexcept;
+  PerfEventConfig& operator=(PerfEventConfig&&);
+  PerfEventConfig(const PerfEventConfig&);
+  PerfEventConfig& operator=(const PerfEventConfig&);
+  bool operator==(const PerfEventConfig&) const;
+  bool operator!=(const PerfEventConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_timebase() const { return _has_field_[15]; }
+  const PerfEvents_Timebase& timebase() const { return *timebase_; }
+  PerfEvents_Timebase* mutable_timebase() { _has_field_.set(15); return timebase_.get(); }
+
+  bool has_callstack_sampling() const { return _has_field_[16]; }
+  const PerfEventConfig_CallstackSampling& callstack_sampling() const { return *callstack_sampling_; }
+  PerfEventConfig_CallstackSampling* mutable_callstack_sampling() { _has_field_.set(16); return callstack_sampling_.get(); }
+
+  bool has_ring_buffer_read_period_ms() const { return _has_field_[8]; }
+  uint32_t ring_buffer_read_period_ms() const { return ring_buffer_read_period_ms_; }
+  void set_ring_buffer_read_period_ms(uint32_t value) { ring_buffer_read_period_ms_ = value; _has_field_.set(8); }
+
+  bool has_ring_buffer_pages() const { return _has_field_[3]; }
+  uint32_t ring_buffer_pages() const { return ring_buffer_pages_; }
+  void set_ring_buffer_pages(uint32_t value) { ring_buffer_pages_ = value; _has_field_.set(3); }
+
+  bool has_max_enqueued_footprint_kb() const { return _has_field_[17]; }
+  uint64_t max_enqueued_footprint_kb() const { return max_enqueued_footprint_kb_; }
+  void set_max_enqueued_footprint_kb(uint64_t value) { max_enqueued_footprint_kb_ = value; _has_field_.set(17); }
+
+  bool has_max_daemon_memory_kb() const { return _has_field_[13]; }
+  uint32_t max_daemon_memory_kb() const { return max_daemon_memory_kb_; }
+  void set_max_daemon_memory_kb(uint32_t value) { max_daemon_memory_kb_ = value; _has_field_.set(13); }
+
+  bool has_remote_descriptor_timeout_ms() const { return _has_field_[9]; }
+  uint32_t remote_descriptor_timeout_ms() const { return remote_descriptor_timeout_ms_; }
+  void set_remote_descriptor_timeout_ms(uint32_t value) { remote_descriptor_timeout_ms_ = value; _has_field_.set(9); }
+
+  bool has_unwind_state_clear_period_ms() const { return _has_field_[10]; }
+  uint32_t unwind_state_clear_period_ms() const { return unwind_state_clear_period_ms_; }
+  void set_unwind_state_clear_period_ms(uint32_t value) { unwind_state_clear_period_ms_ = value; _has_field_.set(10); }
+
+  bool has_all_cpus() const { return _has_field_[1]; }
+  bool all_cpus() const { return all_cpus_; }
+  void set_all_cpus(bool value) { all_cpus_ = value; _has_field_.set(1); }
+
+  bool has_sampling_frequency() const { return _has_field_[2]; }
+  uint32_t sampling_frequency() const { return sampling_frequency_; }
+  void set_sampling_frequency(uint32_t value) { sampling_frequency_ = value; _has_field_.set(2); }
+
+  bool has_kernel_frames() const { return _has_field_[12]; }
+  bool kernel_frames() const { return kernel_frames_; }
+  void set_kernel_frames(bool value) { kernel_frames_ = value; _has_field_.set(12); }
+
+  const std::vector<int32_t>& target_pid() const { return target_pid_; }
+  std::vector<int32_t>* mutable_target_pid() { return &target_pid_; }
+  int target_pid_size() const { return static_cast<int>(target_pid_.size()); }
+  void clear_target_pid() { target_pid_.clear(); }
+  void add_target_pid(int32_t value) { target_pid_.emplace_back(value); }
+  int32_t* add_target_pid() { target_pid_.emplace_back(); return &target_pid_.back(); }
+
+  const std::vector<std::string>& target_cmdline() const { return target_cmdline_; }
+  std::vector<std::string>* mutable_target_cmdline() { return &target_cmdline_; }
+  int target_cmdline_size() const { return static_cast<int>(target_cmdline_.size()); }
+  void clear_target_cmdline() { target_cmdline_.clear(); }
+  void add_target_cmdline(std::string value) { target_cmdline_.emplace_back(value); }
+  std::string* add_target_cmdline() { target_cmdline_.emplace_back(); return &target_cmdline_.back(); }
+
+  const std::vector<std::string>& target_installed_by() const { return target_installed_by_; }
+  std::vector<std::string>* mutable_target_installed_by() { return &target_installed_by_; }
+  int target_installed_by_size() const { return static_cast<int>(target_installed_by_.size()); }
+  void clear_target_installed_by() { target_installed_by_.clear(); }
+  void add_target_installed_by(std::string value) { target_installed_by_.emplace_back(value); }
+  std::string* add_target_installed_by() { target_installed_by_.emplace_back(); return &target_installed_by_.back(); }
+
+  const std::vector<int32_t>& exclude_pid() const { return exclude_pid_; }
+  std::vector<int32_t>* mutable_exclude_pid() { return &exclude_pid_; }
+  int exclude_pid_size() const { return static_cast<int>(exclude_pid_.size()); }
+  void clear_exclude_pid() { exclude_pid_.clear(); }
+  void add_exclude_pid(int32_t value) { exclude_pid_.emplace_back(value); }
+  int32_t* add_exclude_pid() { exclude_pid_.emplace_back(); return &exclude_pid_.back(); }
+
+  const std::vector<std::string>& exclude_cmdline() const { return exclude_cmdline_; }
+  std::vector<std::string>* mutable_exclude_cmdline() { return &exclude_cmdline_; }
+  int exclude_cmdline_size() const { return static_cast<int>(exclude_cmdline_.size()); }
+  void clear_exclude_cmdline() { exclude_cmdline_.clear(); }
+  void add_exclude_cmdline(std::string value) { exclude_cmdline_.emplace_back(value); }
+  std::string* add_exclude_cmdline() { exclude_cmdline_.emplace_back(); return &exclude_cmdline_.back(); }
+
+  bool has_additional_cmdline_count() const { return _has_field_[11]; }
+  uint32_t additional_cmdline_count() const { return additional_cmdline_count_; }
+  void set_additional_cmdline_count(uint32_t value) { additional_cmdline_count_ = value; _has_field_.set(11); }
+
+ private:
+  ::protozero::CopyablePtr<PerfEvents_Timebase> timebase_;
+  ::protozero::CopyablePtr<PerfEventConfig_CallstackSampling> callstack_sampling_;
+  uint32_t ring_buffer_read_period_ms_{};
+  uint32_t ring_buffer_pages_{};
+  uint64_t max_enqueued_footprint_kb_{};
+  uint32_t max_daemon_memory_kb_{};
+  uint32_t remote_descriptor_timeout_ms_{};
+  uint32_t unwind_state_clear_period_ms_{};
+  bool all_cpus_{};
+  uint32_t sampling_frequency_{};
+  bool kernel_frames_{};
+  std::vector<int32_t> target_pid_;
+  std::vector<std::string> target_cmdline_;
+  std::vector<std::string> target_installed_by_;
+  std::vector<int32_t> exclude_pid_;
+  std::vector<std::string> exclude_cmdline_;
+  uint32_t additional_cmdline_count_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<19> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT PerfEventConfig_CallstackSampling : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kScopeFieldNumber = 1,
+    kKernelFramesFieldNumber = 2,
+  };
+
+  PerfEventConfig_CallstackSampling();
+  ~PerfEventConfig_CallstackSampling() override;
+  PerfEventConfig_CallstackSampling(PerfEventConfig_CallstackSampling&&) noexcept;
+  PerfEventConfig_CallstackSampling& operator=(PerfEventConfig_CallstackSampling&&);
+  PerfEventConfig_CallstackSampling(const PerfEventConfig_CallstackSampling&);
+  PerfEventConfig_CallstackSampling& operator=(const PerfEventConfig_CallstackSampling&);
+  bool operator==(const PerfEventConfig_CallstackSampling&) const;
+  bool operator!=(const PerfEventConfig_CallstackSampling& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_scope() const { return _has_field_[1]; }
+  const PerfEventConfig_Scope& scope() const { return *scope_; }
+  PerfEventConfig_Scope* mutable_scope() { _has_field_.set(1); return scope_.get(); }
+
+  bool has_kernel_frames() const { return _has_field_[2]; }
+  bool kernel_frames() const { return kernel_frames_; }
+  void set_kernel_frames(bool value) { kernel_frames_ = value; _has_field_.set(2); }
+
+ private:
+  ::protozero::CopyablePtr<PerfEventConfig_Scope> scope_;
+  bool kernel_frames_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT PerfEventConfig_Scope : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kTargetPidFieldNumber = 1,
+    kTargetCmdlineFieldNumber = 2,
+    kExcludePidFieldNumber = 3,
+    kExcludeCmdlineFieldNumber = 4,
+    kAdditionalCmdlineCountFieldNumber = 5,
+  };
+
+  PerfEventConfig_Scope();
+  ~PerfEventConfig_Scope() override;
+  PerfEventConfig_Scope(PerfEventConfig_Scope&&) noexcept;
+  PerfEventConfig_Scope& operator=(PerfEventConfig_Scope&&);
+  PerfEventConfig_Scope(const PerfEventConfig_Scope&);
+  PerfEventConfig_Scope& operator=(const PerfEventConfig_Scope&);
+  bool operator==(const PerfEventConfig_Scope&) const;
+  bool operator!=(const PerfEventConfig_Scope& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<int32_t>& target_pid() const { return target_pid_; }
+  std::vector<int32_t>* mutable_target_pid() { return &target_pid_; }
+  int target_pid_size() const { return static_cast<int>(target_pid_.size()); }
+  void clear_target_pid() { target_pid_.clear(); }
+  void add_target_pid(int32_t value) { target_pid_.emplace_back(value); }
+  int32_t* add_target_pid() { target_pid_.emplace_back(); return &target_pid_.back(); }
+
+  const std::vector<std::string>& target_cmdline() const { return target_cmdline_; }
+  std::vector<std::string>* mutable_target_cmdline() { return &target_cmdline_; }
+  int target_cmdline_size() const { return static_cast<int>(target_cmdline_.size()); }
+  void clear_target_cmdline() { target_cmdline_.clear(); }
+  void add_target_cmdline(std::string value) { target_cmdline_.emplace_back(value); }
+  std::string* add_target_cmdline() { target_cmdline_.emplace_back(); return &target_cmdline_.back(); }
+
+  const std::vector<int32_t>& exclude_pid() const { return exclude_pid_; }
+  std::vector<int32_t>* mutable_exclude_pid() { return &exclude_pid_; }
+  int exclude_pid_size() const { return static_cast<int>(exclude_pid_.size()); }
+  void clear_exclude_pid() { exclude_pid_.clear(); }
+  void add_exclude_pid(int32_t value) { exclude_pid_.emplace_back(value); }
+  int32_t* add_exclude_pid() { exclude_pid_.emplace_back(); return &exclude_pid_.back(); }
+
+  const std::vector<std::string>& exclude_cmdline() const { return exclude_cmdline_; }
+  std::vector<std::string>* mutable_exclude_cmdline() { return &exclude_cmdline_; }
+  int exclude_cmdline_size() const { return static_cast<int>(exclude_cmdline_.size()); }
+  void clear_exclude_cmdline() { exclude_cmdline_.clear(); }
+  void add_exclude_cmdline(std::string value) { exclude_cmdline_.emplace_back(value); }
+  std::string* add_exclude_cmdline() { exclude_cmdline_.emplace_back(); return &exclude_cmdline_.back(); }
+
+  bool has_additional_cmdline_count() const { return _has_field_[5]; }
+  uint32_t additional_cmdline_count() const { return additional_cmdline_count_; }
+  void set_additional_cmdline_count(uint32_t value) { additional_cmdline_count_ = value; _has_field_.set(5); }
+
+ private:
+  std::vector<int32_t> target_pid_;
+  std::vector<std::string> target_cmdline_;
+  std::vector<int32_t> exclude_pid_;
+  std::vector<std::string> exclude_cmdline_;
+  uint32_t additional_cmdline_count_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<6> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_PERF_EVENT_CONFIG_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/config/sys_stats/sys_stats_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_SYS_STATS_SYS_STATS_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_SYS_STATS_SYS_STATS_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class SysStatsConfig;
+enum SysStatsConfig_StatCounters : int;
+enum MeminfoCounters : int;
+enum VmstatCounters : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum SysStatsConfig_StatCounters : int {
+  SysStatsConfig_StatCounters_STAT_UNSPECIFIED = 0,
+  SysStatsConfig_StatCounters_STAT_CPU_TIMES = 1,
+  SysStatsConfig_StatCounters_STAT_IRQ_COUNTS = 2,
+  SysStatsConfig_StatCounters_STAT_SOFTIRQ_COUNTS = 3,
+  SysStatsConfig_StatCounters_STAT_FORK_COUNT = 4,
+};
+
+class PERFETTO_EXPORT SysStatsConfig : public ::protozero::CppMessageObj {
+ public:
+  using StatCounters = SysStatsConfig_StatCounters;
+  static constexpr auto STAT_UNSPECIFIED = SysStatsConfig_StatCounters_STAT_UNSPECIFIED;
+  static constexpr auto STAT_CPU_TIMES = SysStatsConfig_StatCounters_STAT_CPU_TIMES;
+  static constexpr auto STAT_IRQ_COUNTS = SysStatsConfig_StatCounters_STAT_IRQ_COUNTS;
+  static constexpr auto STAT_SOFTIRQ_COUNTS = SysStatsConfig_StatCounters_STAT_SOFTIRQ_COUNTS;
+  static constexpr auto STAT_FORK_COUNT = SysStatsConfig_StatCounters_STAT_FORK_COUNT;
+  static constexpr auto StatCounters_MIN = SysStatsConfig_StatCounters_STAT_UNSPECIFIED;
+  static constexpr auto StatCounters_MAX = SysStatsConfig_StatCounters_STAT_FORK_COUNT;
+  enum FieldNumbers {
+    kMeminfoPeriodMsFieldNumber = 1,
+    kMeminfoCountersFieldNumber = 2,
+    kVmstatPeriodMsFieldNumber = 3,
+    kVmstatCountersFieldNumber = 4,
+    kStatPeriodMsFieldNumber = 5,
+    kStatCountersFieldNumber = 6,
+    kDevfreqPeriodMsFieldNumber = 7,
+  };
+
+  SysStatsConfig();
+  ~SysStatsConfig() override;
+  SysStatsConfig(SysStatsConfig&&) noexcept;
+  SysStatsConfig& operator=(SysStatsConfig&&);
+  SysStatsConfig(const SysStatsConfig&);
+  SysStatsConfig& operator=(const SysStatsConfig&);
+  bool operator==(const SysStatsConfig&) const;
+  bool operator!=(const SysStatsConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_meminfo_period_ms() const { return _has_field_[1]; }
+  uint32_t meminfo_period_ms() const { return meminfo_period_ms_; }
+  void set_meminfo_period_ms(uint32_t value) { meminfo_period_ms_ = value; _has_field_.set(1); }
+
+  const std::vector<MeminfoCounters>& meminfo_counters() const { return meminfo_counters_; }
+  std::vector<MeminfoCounters>* mutable_meminfo_counters() { return &meminfo_counters_; }
+  int meminfo_counters_size() const { return static_cast<int>(meminfo_counters_.size()); }
+  void clear_meminfo_counters() { meminfo_counters_.clear(); }
+  void add_meminfo_counters(MeminfoCounters value) { meminfo_counters_.emplace_back(value); }
+  MeminfoCounters* add_meminfo_counters() { meminfo_counters_.emplace_back(); return &meminfo_counters_.back(); }
+
+  bool has_vmstat_period_ms() const { return _has_field_[3]; }
+  uint32_t vmstat_period_ms() const { return vmstat_period_ms_; }
+  void set_vmstat_period_ms(uint32_t value) { vmstat_period_ms_ = value; _has_field_.set(3); }
+
+  const std::vector<VmstatCounters>& vmstat_counters() const { return vmstat_counters_; }
+  std::vector<VmstatCounters>* mutable_vmstat_counters() { return &vmstat_counters_; }
+  int vmstat_counters_size() const { return static_cast<int>(vmstat_counters_.size()); }
+  void clear_vmstat_counters() { vmstat_counters_.clear(); }
+  void add_vmstat_counters(VmstatCounters value) { vmstat_counters_.emplace_back(value); }
+  VmstatCounters* add_vmstat_counters() { vmstat_counters_.emplace_back(); return &vmstat_counters_.back(); }
+
+  bool has_stat_period_ms() const { return _has_field_[5]; }
+  uint32_t stat_period_ms() const { return stat_period_ms_; }
+  void set_stat_period_ms(uint32_t value) { stat_period_ms_ = value; _has_field_.set(5); }
+
+  const std::vector<SysStatsConfig_StatCounters>& stat_counters() const { return stat_counters_; }
+  std::vector<SysStatsConfig_StatCounters>* mutable_stat_counters() { return &stat_counters_; }
+  int stat_counters_size() const { return static_cast<int>(stat_counters_.size()); }
+  void clear_stat_counters() { stat_counters_.clear(); }
+  void add_stat_counters(SysStatsConfig_StatCounters value) { stat_counters_.emplace_back(value); }
+  SysStatsConfig_StatCounters* add_stat_counters() { stat_counters_.emplace_back(); return &stat_counters_.back(); }
+
+  bool has_devfreq_period_ms() const { return _has_field_[7]; }
+  uint32_t devfreq_period_ms() const { return devfreq_period_ms_; }
+  void set_devfreq_period_ms(uint32_t value) { devfreq_period_ms_ = value; _has_field_.set(7); }
+
+ private:
+  uint32_t meminfo_period_ms_{};
+  std::vector<MeminfoCounters> meminfo_counters_;
+  uint32_t vmstat_period_ms_{};
+  std::vector<VmstatCounters> vmstat_counters_;
+  uint32_t stat_period_ms_{};
+  std::vector<SysStatsConfig_StatCounters> stat_counters_;
+  uint32_t devfreq_period_ms_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<8> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_SYS_STATS_SYS_STATS_CONFIG_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/config/chrome/chrome_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_CHROME_CHROME_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_CHROME_CHROME_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class ChromeConfig;
+enum ChromeConfig_ClientPriority : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum ChromeConfig_ClientPriority : int {
+  ChromeConfig_ClientPriority_UNKNOWN = 0,
+  ChromeConfig_ClientPriority_BACKGROUND = 1,
+  ChromeConfig_ClientPriority_USER_INITIATED = 2,
+};
+
+class PERFETTO_EXPORT ChromeConfig : public ::protozero::CppMessageObj {
+ public:
+  using ClientPriority = ChromeConfig_ClientPriority;
+  static constexpr auto UNKNOWN = ChromeConfig_ClientPriority_UNKNOWN;
+  static constexpr auto BACKGROUND = ChromeConfig_ClientPriority_BACKGROUND;
+  static constexpr auto USER_INITIATED = ChromeConfig_ClientPriority_USER_INITIATED;
+  static constexpr auto ClientPriority_MIN = ChromeConfig_ClientPriority_UNKNOWN;
+  static constexpr auto ClientPriority_MAX = ChromeConfig_ClientPriority_USER_INITIATED;
+  enum FieldNumbers {
+    kTraceConfigFieldNumber = 1,
+    kPrivacyFilteringEnabledFieldNumber = 2,
+    kConvertToLegacyJsonFieldNumber = 3,
+    kClientPriorityFieldNumber = 4,
+    kJsonAgentLabelFilterFieldNumber = 5,
+  };
+
+  ChromeConfig();
+  ~ChromeConfig() override;
+  ChromeConfig(ChromeConfig&&) noexcept;
+  ChromeConfig& operator=(ChromeConfig&&);
+  ChromeConfig(const ChromeConfig&);
+  ChromeConfig& operator=(const ChromeConfig&);
+  bool operator==(const ChromeConfig&) const;
+  bool operator!=(const ChromeConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_trace_config() const { return _has_field_[1]; }
+  const std::string& trace_config() const { return trace_config_; }
+  void set_trace_config(const std::string& value) { trace_config_ = value; _has_field_.set(1); }
+
+  bool has_privacy_filtering_enabled() const { return _has_field_[2]; }
+  bool privacy_filtering_enabled() const { return privacy_filtering_enabled_; }
+  void set_privacy_filtering_enabled(bool value) { privacy_filtering_enabled_ = value; _has_field_.set(2); }
+
+  bool has_convert_to_legacy_json() const { return _has_field_[3]; }
+  bool convert_to_legacy_json() const { return convert_to_legacy_json_; }
+  void set_convert_to_legacy_json(bool value) { convert_to_legacy_json_ = value; _has_field_.set(3); }
+
+  bool has_client_priority() const { return _has_field_[4]; }
+  ChromeConfig_ClientPriority client_priority() const { return client_priority_; }
+  void set_client_priority(ChromeConfig_ClientPriority value) { client_priority_ = value; _has_field_.set(4); }
+
+  bool has_json_agent_label_filter() const { return _has_field_[5]; }
+  const std::string& json_agent_label_filter() const { return json_agent_label_filter_; }
+  void set_json_agent_label_filter(const std::string& value) { json_agent_label_filter_ = value; _has_field_.set(5); }
+
+ private:
+  std::string trace_config_{};
+  bool privacy_filtering_enabled_{};
+  bool convert_to_legacy_json_{};
+  ChromeConfig_ClientPriority client_priority_{};
+  std::string json_agent_label_filter_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<6> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_CHROME_CHROME_CONFIG_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/config/data_source_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_DATA_SOURCE_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_DATA_SOURCE_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class DataSourceConfig;
+class TestConfig;
+class TestConfig_DummyFields;
+class InterceptorConfig;
+class ChromeConfig;
+enum DataSourceConfig_SessionInitiator : int;
+enum ChromeConfig_ClientPriority : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum DataSourceConfig_SessionInitiator : int {
+  DataSourceConfig_SessionInitiator_SESSION_INITIATOR_UNSPECIFIED = 0,
+  DataSourceConfig_SessionInitiator_SESSION_INITIATOR_TRUSTED_SYSTEM = 1,
+};
+
+class PERFETTO_EXPORT DataSourceConfig : public ::protozero::CppMessageObj {
+ public:
+  using SessionInitiator = DataSourceConfig_SessionInitiator;
+  static constexpr auto SESSION_INITIATOR_UNSPECIFIED = DataSourceConfig_SessionInitiator_SESSION_INITIATOR_UNSPECIFIED;
+  static constexpr auto SESSION_INITIATOR_TRUSTED_SYSTEM = DataSourceConfig_SessionInitiator_SESSION_INITIATOR_TRUSTED_SYSTEM;
+  static constexpr auto SessionInitiator_MIN = DataSourceConfig_SessionInitiator_SESSION_INITIATOR_UNSPECIFIED;
+  static constexpr auto SessionInitiator_MAX = DataSourceConfig_SessionInitiator_SESSION_INITIATOR_TRUSTED_SYSTEM;
+  enum FieldNumbers {
+    kNameFieldNumber = 1,
+    kTargetBufferFieldNumber = 2,
+    kTraceDurationMsFieldNumber = 3,
+    kStopTimeoutMsFieldNumber = 7,
+    kEnableExtraGuardrailsFieldNumber = 6,
+    kSessionInitiatorFieldNumber = 8,
+    kTracingSessionIdFieldNumber = 4,
+    kFtraceConfigFieldNumber = 100,
+    kInodeFileConfigFieldNumber = 102,
+    kProcessStatsConfigFieldNumber = 103,
+    kSysStatsConfigFieldNumber = 104,
+    kHeapprofdConfigFieldNumber = 105,
+    kJavaHprofConfigFieldNumber = 110,
+    kAndroidPowerConfigFieldNumber = 106,
+    kAndroidLogConfigFieldNumber = 107,
+    kGpuCounterConfigFieldNumber = 108,
+    kPackagesListConfigFieldNumber = 109,
+    kPerfEventConfigFieldNumber = 111,
+    kVulkanMemoryConfigFieldNumber = 112,
+    kTrackEventConfigFieldNumber = 113,
+    kAndroidPolledStateConfigFieldNumber = 114,
+    kChromeConfigFieldNumber = 101,
+    kInterceptorConfigFieldNumber = 115,
+    kLegacyConfigFieldNumber = 1000,
+    kForTestingFieldNumber = 1001,
+  };
+
+  DataSourceConfig();
+  ~DataSourceConfig() override;
+  DataSourceConfig(DataSourceConfig&&) noexcept;
+  DataSourceConfig& operator=(DataSourceConfig&&);
+  DataSourceConfig(const DataSourceConfig&);
+  DataSourceConfig& operator=(const DataSourceConfig&);
+  bool operator==(const DataSourceConfig&) const;
+  bool operator!=(const DataSourceConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name() const { return _has_field_[1]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
+
+  bool has_target_buffer() const { return _has_field_[2]; }
+  uint32_t target_buffer() const { return target_buffer_; }
+  void set_target_buffer(uint32_t value) { target_buffer_ = value; _has_field_.set(2); }
+
+  bool has_trace_duration_ms() const { return _has_field_[3]; }
+  uint32_t trace_duration_ms() const { return trace_duration_ms_; }
+  void set_trace_duration_ms(uint32_t value) { trace_duration_ms_ = value; _has_field_.set(3); }
+
+  bool has_stop_timeout_ms() const { return _has_field_[7]; }
+  uint32_t stop_timeout_ms() const { return stop_timeout_ms_; }
+  void set_stop_timeout_ms(uint32_t value) { stop_timeout_ms_ = value; _has_field_.set(7); }
+
+  bool has_enable_extra_guardrails() const { return _has_field_[6]; }
+  bool enable_extra_guardrails() const { return enable_extra_guardrails_; }
+  void set_enable_extra_guardrails(bool value) { enable_extra_guardrails_ = value; _has_field_.set(6); }
+
+  bool has_session_initiator() const { return _has_field_[8]; }
+  DataSourceConfig_SessionInitiator session_initiator() const { return session_initiator_; }
+  void set_session_initiator(DataSourceConfig_SessionInitiator value) { session_initiator_ = value; _has_field_.set(8); }
+
+  bool has_tracing_session_id() const { return _has_field_[4]; }
+  uint64_t tracing_session_id() const { return tracing_session_id_; }
+  void set_tracing_session_id(uint64_t value) { tracing_session_id_ = value; _has_field_.set(4); }
+
+  const std::string& ftrace_config_raw() const { return ftrace_config_; }
+  void set_ftrace_config_raw(const std::string& raw) { ftrace_config_ = raw; _has_field_.set(100); }
+
+  const std::string& inode_file_config_raw() const { return inode_file_config_; }
+  void set_inode_file_config_raw(const std::string& raw) { inode_file_config_ = raw; _has_field_.set(102); }
+
+  const std::string& process_stats_config_raw() const { return process_stats_config_; }
+  void set_process_stats_config_raw(const std::string& raw) { process_stats_config_ = raw; _has_field_.set(103); }
+
+  const std::string& sys_stats_config_raw() const { return sys_stats_config_; }
+  void set_sys_stats_config_raw(const std::string& raw) { sys_stats_config_ = raw; _has_field_.set(104); }
+
+  const std::string& heapprofd_config_raw() const { return heapprofd_config_; }
+  void set_heapprofd_config_raw(const std::string& raw) { heapprofd_config_ = raw; _has_field_.set(105); }
+
+  const std::string& java_hprof_config_raw() const { return java_hprof_config_; }
+  void set_java_hprof_config_raw(const std::string& raw) { java_hprof_config_ = raw; _has_field_.set(110); }
+
+  const std::string& android_power_config_raw() const { return android_power_config_; }
+  void set_android_power_config_raw(const std::string& raw) { android_power_config_ = raw; _has_field_.set(106); }
+
+  const std::string& android_log_config_raw() const { return android_log_config_; }
+  void set_android_log_config_raw(const std::string& raw) { android_log_config_ = raw; _has_field_.set(107); }
+
+  const std::string& gpu_counter_config_raw() const { return gpu_counter_config_; }
+  void set_gpu_counter_config_raw(const std::string& raw) { gpu_counter_config_ = raw; _has_field_.set(108); }
+
+  const std::string& packages_list_config_raw() const { return packages_list_config_; }
+  void set_packages_list_config_raw(const std::string& raw) { packages_list_config_ = raw; _has_field_.set(109); }
+
+  const std::string& perf_event_config_raw() const { return perf_event_config_; }
+  void set_perf_event_config_raw(const std::string& raw) { perf_event_config_ = raw; _has_field_.set(111); }
+
+  const std::string& vulkan_memory_config_raw() const { return vulkan_memory_config_; }
+  void set_vulkan_memory_config_raw(const std::string& raw) { vulkan_memory_config_ = raw; _has_field_.set(112); }
+
+  const std::string& track_event_config_raw() const { return track_event_config_; }
+  void set_track_event_config_raw(const std::string& raw) { track_event_config_ = raw; _has_field_.set(113); }
+
+  const std::string& android_polled_state_config_raw() const { return android_polled_state_config_; }
+  void set_android_polled_state_config_raw(const std::string& raw) { android_polled_state_config_ = raw; _has_field_.set(114); }
+
+  bool has_chrome_config() const { return _has_field_[101]; }
+  const ChromeConfig& chrome_config() const { return *chrome_config_; }
+  ChromeConfig* mutable_chrome_config() { _has_field_.set(101); return chrome_config_.get(); }
+
+  bool has_interceptor_config() const { return _has_field_[115]; }
+  const InterceptorConfig& interceptor_config() const { return *interceptor_config_; }
+  InterceptorConfig* mutable_interceptor_config() { _has_field_.set(115); return interceptor_config_.get(); }
+
+  bool has_legacy_config() const { return _has_field_[1000]; }
+  const std::string& legacy_config() const { return legacy_config_; }
+  void set_legacy_config(const std::string& value) { legacy_config_ = value; _has_field_.set(1000); }
+
+  bool has_for_testing() const { return _has_field_[1001]; }
+  const TestConfig& for_testing() const { return *for_testing_; }
+  TestConfig* mutable_for_testing() { _has_field_.set(1001); return for_testing_.get(); }
+
+ private:
+  std::string name_{};
+  uint32_t target_buffer_{};
+  uint32_t trace_duration_ms_{};
+  uint32_t stop_timeout_ms_{};
+  bool enable_extra_guardrails_{};
+  DataSourceConfig_SessionInitiator session_initiator_{};
+  uint64_t tracing_session_id_{};
+  std::string ftrace_config_;  // [lazy=true]
+  std::string inode_file_config_;  // [lazy=true]
+  std::string process_stats_config_;  // [lazy=true]
+  std::string sys_stats_config_;  // [lazy=true]
+  std::string heapprofd_config_;  // [lazy=true]
+  std::string java_hprof_config_;  // [lazy=true]
+  std::string android_power_config_;  // [lazy=true]
+  std::string android_log_config_;  // [lazy=true]
+  std::string gpu_counter_config_;  // [lazy=true]
+  std::string packages_list_config_;  // [lazy=true]
+  std::string perf_event_config_;  // [lazy=true]
+  std::string vulkan_memory_config_;  // [lazy=true]
+  std::string track_event_config_;  // [lazy=true]
+  std::string android_polled_state_config_;  // [lazy=true]
+  ::protozero::CopyablePtr<ChromeConfig> chrome_config_;
+  ::protozero::CopyablePtr<InterceptorConfig> interceptor_config_;
+  std::string legacy_config_{};
+  ::protozero::CopyablePtr<TestConfig> for_testing_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<1002> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_DATA_SOURCE_CONFIG_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/config/interceptor_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INTERCEPTOR_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INTERCEPTOR_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class InterceptorConfig;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT InterceptorConfig : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNameFieldNumber = 1,
+    kConsoleConfigFieldNumber = 100,
+  };
+
+  InterceptorConfig();
+  ~InterceptorConfig() override;
+  InterceptorConfig(InterceptorConfig&&) noexcept;
+  InterceptorConfig& operator=(InterceptorConfig&&);
+  InterceptorConfig(const InterceptorConfig&);
+  InterceptorConfig& operator=(const InterceptorConfig&);
+  bool operator==(const InterceptorConfig&) const;
+  bool operator!=(const InterceptorConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name() const { return _has_field_[1]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
+
+  const std::string& console_config_raw() const { return console_config_; }
+  void set_console_config_raw(const std::string& raw) { console_config_ = raw; _has_field_.set(100); }
+
+ private:
+  std::string name_{};
+  std::string console_config_;  // [lazy=true]
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<101> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INTERCEPTOR_CONFIG_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/config/stress_test_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_STRESS_TEST_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_STRESS_TEST_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class StressTestConfig;
+class StressTestConfig_WriterTiming;
+class TraceConfig;
+class TraceConfig_TraceFilter;
+class TraceConfig_IncidentReportConfig;
+class TraceConfig_IncrementalStateConfig;
+class TraceConfig_TriggerConfig;
+class TraceConfig_TriggerConfig_Trigger;
+class TraceConfig_GuardrailOverrides;
+class TraceConfig_StatsdMetadata;
+class TraceConfig_ProducerConfig;
+class TraceConfig_BuiltinDataSource;
+class TraceConfig_DataSource;
+class DataSourceConfig;
+class TestConfig;
+class TestConfig_DummyFields;
+class InterceptorConfig;
+class ChromeConfig;
+class TraceConfig_BufferConfig;
+enum TraceConfig_LockdownModeOperation : int;
+enum TraceConfig_CompressionType : int;
+enum TraceConfig_StatsdLogging : int;
+enum TraceConfig_TriggerConfig_TriggerMode : int;
+enum BuiltinClock : int;
+enum DataSourceConfig_SessionInitiator : int;
+enum ChromeConfig_ClientPriority : int;
+enum TraceConfig_BufferConfig_FillPolicy : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT StressTestConfig : public ::protozero::CppMessageObj {
+ public:
+  using WriterTiming = StressTestConfig_WriterTiming;
+  enum FieldNumbers {
+    kTraceConfigFieldNumber = 1,
+    kShmemSizeKbFieldNumber = 2,
+    kShmemPageSizeKbFieldNumber = 3,
+    kNumProcessesFieldNumber = 4,
+    kNumThreadsFieldNumber = 5,
+    kMaxEventsFieldNumber = 6,
+    kNestingFieldNumber = 7,
+    kSteadyStateTimingsFieldNumber = 8,
+    kBurstPeriodMsFieldNumber = 9,
+    kBurstDurationMsFieldNumber = 10,
+    kBurstTimingsFieldNumber = 11,
+  };
+
+  StressTestConfig();
+  ~StressTestConfig() override;
+  StressTestConfig(StressTestConfig&&) noexcept;
+  StressTestConfig& operator=(StressTestConfig&&);
+  StressTestConfig(const StressTestConfig&);
+  StressTestConfig& operator=(const StressTestConfig&);
+  bool operator==(const StressTestConfig&) const;
+  bool operator!=(const StressTestConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_trace_config() const { return _has_field_[1]; }
+  const TraceConfig& trace_config() const { return *trace_config_; }
+  TraceConfig* mutable_trace_config() { _has_field_.set(1); return trace_config_.get(); }
+
+  bool has_shmem_size_kb() const { return _has_field_[2]; }
+  uint32_t shmem_size_kb() const { return shmem_size_kb_; }
+  void set_shmem_size_kb(uint32_t value) { shmem_size_kb_ = value; _has_field_.set(2); }
+
+  bool has_shmem_page_size_kb() const { return _has_field_[3]; }
+  uint32_t shmem_page_size_kb() const { return shmem_page_size_kb_; }
+  void set_shmem_page_size_kb(uint32_t value) { shmem_page_size_kb_ = value; _has_field_.set(3); }
+
+  bool has_num_processes() const { return _has_field_[4]; }
+  uint32_t num_processes() const { return num_processes_; }
+  void set_num_processes(uint32_t value) { num_processes_ = value; _has_field_.set(4); }
+
+  bool has_num_threads() const { return _has_field_[5]; }
+  uint32_t num_threads() const { return num_threads_; }
+  void set_num_threads(uint32_t value) { num_threads_ = value; _has_field_.set(5); }
+
+  bool has_max_events() const { return _has_field_[6]; }
+  uint32_t max_events() const { return max_events_; }
+  void set_max_events(uint32_t value) { max_events_ = value; _has_field_.set(6); }
+
+  bool has_nesting() const { return _has_field_[7]; }
+  uint32_t nesting() const { return nesting_; }
+  void set_nesting(uint32_t value) { nesting_ = value; _has_field_.set(7); }
+
+  bool has_steady_state_timings() const { return _has_field_[8]; }
+  const StressTestConfig_WriterTiming& steady_state_timings() const { return *steady_state_timings_; }
+  StressTestConfig_WriterTiming* mutable_steady_state_timings() { _has_field_.set(8); return steady_state_timings_.get(); }
+
+  bool has_burst_period_ms() const { return _has_field_[9]; }
+  uint32_t burst_period_ms() const { return burst_period_ms_; }
+  void set_burst_period_ms(uint32_t value) { burst_period_ms_ = value; _has_field_.set(9); }
+
+  bool has_burst_duration_ms() const { return _has_field_[10]; }
+  uint32_t burst_duration_ms() const { return burst_duration_ms_; }
+  void set_burst_duration_ms(uint32_t value) { burst_duration_ms_ = value; _has_field_.set(10); }
+
+  bool has_burst_timings() const { return _has_field_[11]; }
+  const StressTestConfig_WriterTiming& burst_timings() const { return *burst_timings_; }
+  StressTestConfig_WriterTiming* mutable_burst_timings() { _has_field_.set(11); return burst_timings_.get(); }
+
+ private:
+  ::protozero::CopyablePtr<TraceConfig> trace_config_;
+  uint32_t shmem_size_kb_{};
+  uint32_t shmem_page_size_kb_{};
+  uint32_t num_processes_{};
+  uint32_t num_threads_{};
+  uint32_t max_events_{};
+  uint32_t nesting_{};
+  ::protozero::CopyablePtr<StressTestConfig_WriterTiming> steady_state_timings_;
+  uint32_t burst_period_ms_{};
+  uint32_t burst_duration_ms_{};
+  ::protozero::CopyablePtr<StressTestConfig_WriterTiming> burst_timings_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<12> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT StressTestConfig_WriterTiming : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kPayloadMeanFieldNumber = 1,
+    kPayloadStddevFieldNumber = 2,
+    kRateMeanFieldNumber = 3,
+    kRateStddevFieldNumber = 4,
+    kPayloadWriteTimeMsFieldNumber = 5,
+  };
+
+  StressTestConfig_WriterTiming();
+  ~StressTestConfig_WriterTiming() override;
+  StressTestConfig_WriterTiming(StressTestConfig_WriterTiming&&) noexcept;
+  StressTestConfig_WriterTiming& operator=(StressTestConfig_WriterTiming&&);
+  StressTestConfig_WriterTiming(const StressTestConfig_WriterTiming&);
+  StressTestConfig_WriterTiming& operator=(const StressTestConfig_WriterTiming&);
+  bool operator==(const StressTestConfig_WriterTiming&) const;
+  bool operator!=(const StressTestConfig_WriterTiming& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_payload_mean() const { return _has_field_[1]; }
+  double payload_mean() const { return payload_mean_; }
+  void set_payload_mean(double value) { payload_mean_ = value; _has_field_.set(1); }
+
+  bool has_payload_stddev() const { return _has_field_[2]; }
+  double payload_stddev() const { return payload_stddev_; }
+  void set_payload_stddev(double value) { payload_stddev_ = value; _has_field_.set(2); }
+
+  bool has_rate_mean() const { return _has_field_[3]; }
+  double rate_mean() const { return rate_mean_; }
+  void set_rate_mean(double value) { rate_mean_ = value; _has_field_.set(3); }
+
+  bool has_rate_stddev() const { return _has_field_[4]; }
+  double rate_stddev() const { return rate_stddev_; }
+  void set_rate_stddev(double value) { rate_stddev_ = value; _has_field_.set(4); }
+
+  bool has_payload_write_time_ms() const { return _has_field_[5]; }
+  uint32_t payload_write_time_ms() const { return payload_write_time_ms_; }
+  void set_payload_write_time_ms(uint32_t value) { payload_write_time_ms_ = value; _has_field_.set(5); }
+
+ private:
+  double payload_mean_{};
+  double payload_stddev_{};
+  double rate_mean_{};
+  double rate_stddev_{};
+  uint32_t payload_write_time_ms_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<6> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_STRESS_TEST_CONFIG_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/config/test_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TEST_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TEST_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class TestConfig;
+class TestConfig_DummyFields;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT TestConfig : public ::protozero::CppMessageObj {
+ public:
+  using DummyFields = TestConfig_DummyFields;
+  enum FieldNumbers {
+    kMessageCountFieldNumber = 1,
+    kMaxMessagesPerSecondFieldNumber = 2,
+    kSeedFieldNumber = 3,
+    kMessageSizeFieldNumber = 4,
+    kSendBatchOnRegisterFieldNumber = 5,
+    kDummyFieldsFieldNumber = 6,
+  };
+
+  TestConfig();
+  ~TestConfig() override;
+  TestConfig(TestConfig&&) noexcept;
+  TestConfig& operator=(TestConfig&&);
+  TestConfig(const TestConfig&);
+  TestConfig& operator=(const TestConfig&);
+  bool operator==(const TestConfig&) const;
+  bool operator!=(const TestConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_message_count() const { return _has_field_[1]; }
+  uint32_t message_count() const { return message_count_; }
+  void set_message_count(uint32_t value) { message_count_ = value; _has_field_.set(1); }
+
+  bool has_max_messages_per_second() const { return _has_field_[2]; }
+  uint32_t max_messages_per_second() const { return max_messages_per_second_; }
+  void set_max_messages_per_second(uint32_t value) { max_messages_per_second_ = value; _has_field_.set(2); }
+
+  bool has_seed() const { return _has_field_[3]; }
+  uint32_t seed() const { return seed_; }
+  void set_seed(uint32_t value) { seed_ = value; _has_field_.set(3); }
+
+  bool has_message_size() const { return _has_field_[4]; }
+  uint32_t message_size() const { return message_size_; }
+  void set_message_size(uint32_t value) { message_size_ = value; _has_field_.set(4); }
+
+  bool has_send_batch_on_register() const { return _has_field_[5]; }
+  bool send_batch_on_register() const { return send_batch_on_register_; }
+  void set_send_batch_on_register(bool value) { send_batch_on_register_ = value; _has_field_.set(5); }
+
+  bool has_dummy_fields() const { return _has_field_[6]; }
+  const TestConfig_DummyFields& dummy_fields() const { return *dummy_fields_; }
+  TestConfig_DummyFields* mutable_dummy_fields() { _has_field_.set(6); return dummy_fields_.get(); }
+
+ private:
+  uint32_t message_count_{};
+  uint32_t max_messages_per_second_{};
+  uint32_t seed_{};
+  uint32_t message_size_{};
+  bool send_batch_on_register_{};
+  ::protozero::CopyablePtr<TestConfig_DummyFields> dummy_fields_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<7> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TestConfig_DummyFields : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kFieldUint32FieldNumber = 1,
+    kFieldInt32FieldNumber = 2,
+    kFieldUint64FieldNumber = 3,
+    kFieldInt64FieldNumber = 4,
+    kFieldFixed64FieldNumber = 5,
+    kFieldSfixed64FieldNumber = 6,
+    kFieldFixed32FieldNumber = 7,
+    kFieldSfixed32FieldNumber = 8,
+    kFieldDoubleFieldNumber = 9,
+    kFieldFloatFieldNumber = 10,
+    kFieldSint64FieldNumber = 11,
+    kFieldSint32FieldNumber = 12,
+    kFieldStringFieldNumber = 13,
+    kFieldBytesFieldNumber = 14,
+  };
+
+  TestConfig_DummyFields();
+  ~TestConfig_DummyFields() override;
+  TestConfig_DummyFields(TestConfig_DummyFields&&) noexcept;
+  TestConfig_DummyFields& operator=(TestConfig_DummyFields&&);
+  TestConfig_DummyFields(const TestConfig_DummyFields&);
+  TestConfig_DummyFields& operator=(const TestConfig_DummyFields&);
+  bool operator==(const TestConfig_DummyFields&) const;
+  bool operator!=(const TestConfig_DummyFields& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_field_uint32() const { return _has_field_[1]; }
+  uint32_t field_uint32() const { return field_uint32_; }
+  void set_field_uint32(uint32_t value) { field_uint32_ = value; _has_field_.set(1); }
+
+  bool has_field_int32() const { return _has_field_[2]; }
+  int32_t field_int32() const { return field_int32_; }
+  void set_field_int32(int32_t value) { field_int32_ = value; _has_field_.set(2); }
+
+  bool has_field_uint64() const { return _has_field_[3]; }
+  uint64_t field_uint64() const { return field_uint64_; }
+  void set_field_uint64(uint64_t value) { field_uint64_ = value; _has_field_.set(3); }
+
+  bool has_field_int64() const { return _has_field_[4]; }
+  int64_t field_int64() const { return field_int64_; }
+  void set_field_int64(int64_t value) { field_int64_ = value; _has_field_.set(4); }
+
+  bool has_field_fixed64() const { return _has_field_[5]; }
+  uint64_t field_fixed64() const { return field_fixed64_; }
+  void set_field_fixed64(uint64_t value) { field_fixed64_ = value; _has_field_.set(5); }
+
+  bool has_field_sfixed64() const { return _has_field_[6]; }
+  int64_t field_sfixed64() const { return field_sfixed64_; }
+  void set_field_sfixed64(int64_t value) { field_sfixed64_ = value; _has_field_.set(6); }
+
+  bool has_field_fixed32() const { return _has_field_[7]; }
+  uint32_t field_fixed32() const { return field_fixed32_; }
+  void set_field_fixed32(uint32_t value) { field_fixed32_ = value; _has_field_.set(7); }
+
+  bool has_field_sfixed32() const { return _has_field_[8]; }
+  int32_t field_sfixed32() const { return field_sfixed32_; }
+  void set_field_sfixed32(int32_t value) { field_sfixed32_ = value; _has_field_.set(8); }
+
+  bool has_field_double() const { return _has_field_[9]; }
+  double field_double() const { return field_double_; }
+  void set_field_double(double value) { field_double_ = value; _has_field_.set(9); }
+
+  bool has_field_float() const { return _has_field_[10]; }
+  float field_float() const { return field_float_; }
+  void set_field_float(float value) { field_float_ = value; _has_field_.set(10); }
+
+  bool has_field_sint64() const { return _has_field_[11]; }
+  int64_t field_sint64() const { return field_sint64_; }
+  void set_field_sint64(int64_t value) { field_sint64_ = value; _has_field_.set(11); }
+
+  bool has_field_sint32() const { return _has_field_[12]; }
+  int32_t field_sint32() const { return field_sint32_; }
+  void set_field_sint32(int32_t value) { field_sint32_ = value; _has_field_.set(12); }
+
+  bool has_field_string() const { return _has_field_[13]; }
+  const std::string& field_string() const { return field_string_; }
+  void set_field_string(const std::string& value) { field_string_ = value; _has_field_.set(13); }
+
+  bool has_field_bytes() const { return _has_field_[14]; }
+  const std::string& field_bytes() const { return field_bytes_; }
+  void set_field_bytes(const std::string& value) { field_bytes_ = value; _has_field_.set(14); }
+  void set_field_bytes(const void* p, size_t s) { field_bytes_.assign(reinterpret_cast<const char*>(p), s); _has_field_.set(14); }
+
+ private:
+  uint32_t field_uint32_{};
+  int32_t field_int32_{};
+  uint64_t field_uint64_{};
+  int64_t field_int64_{};
+  uint64_t field_fixed64_{};
+  int64_t field_sfixed64_{};
+  uint32_t field_fixed32_{};
+  int32_t field_sfixed32_{};
+  double field_double_{};
+  float field_float_{};
+  int64_t field_sint64_{};
+  int32_t field_sint32_{};
+  std::string field_string_{};
+  std::string field_bytes_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<15> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TEST_CONFIG_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/config/trace_config.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACE_CONFIG_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACE_CONFIG_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class TraceConfig;
+class TraceConfig_TraceFilter;
+class TraceConfig_IncidentReportConfig;
+class TraceConfig_IncrementalStateConfig;
+class TraceConfig_TriggerConfig;
+class TraceConfig_TriggerConfig_Trigger;
+class TraceConfig_GuardrailOverrides;
+class TraceConfig_StatsdMetadata;
+class TraceConfig_ProducerConfig;
+class TraceConfig_BuiltinDataSource;
+class TraceConfig_DataSource;
+class DataSourceConfig;
+class TestConfig;
+class TestConfig_DummyFields;
+class InterceptorConfig;
+class ChromeConfig;
+class TraceConfig_BufferConfig;
+enum TraceConfig_LockdownModeOperation : int;
+enum TraceConfig_CompressionType : int;
+enum TraceConfig_StatsdLogging : int;
+enum TraceConfig_TriggerConfig_TriggerMode : int;
+enum BuiltinClock : int;
+enum DataSourceConfig_SessionInitiator : int;
+enum ChromeConfig_ClientPriority : int;
+enum TraceConfig_BufferConfig_FillPolicy : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum TraceConfig_LockdownModeOperation : int {
+  TraceConfig_LockdownModeOperation_LOCKDOWN_UNCHANGED = 0,
+  TraceConfig_LockdownModeOperation_LOCKDOWN_CLEAR = 1,
+  TraceConfig_LockdownModeOperation_LOCKDOWN_SET = 2,
+};
+enum TraceConfig_CompressionType : int {
+  TraceConfig_CompressionType_COMPRESSION_TYPE_UNSPECIFIED = 0,
+  TraceConfig_CompressionType_COMPRESSION_TYPE_DEFLATE = 1,
+};
+enum TraceConfig_StatsdLogging : int {
+  TraceConfig_StatsdLogging_STATSD_LOGGING_UNSPECIFIED = 0,
+  TraceConfig_StatsdLogging_STATSD_LOGGING_ENABLED = 1,
+  TraceConfig_StatsdLogging_STATSD_LOGGING_DISABLED = 2,
+};
+enum TraceConfig_TriggerConfig_TriggerMode : int {
+  TraceConfig_TriggerConfig_TriggerMode_UNSPECIFIED = 0,
+  TraceConfig_TriggerConfig_TriggerMode_START_TRACING = 1,
+  TraceConfig_TriggerConfig_TriggerMode_STOP_TRACING = 2,
+};
+enum TraceConfig_BufferConfig_FillPolicy : int {
+  TraceConfig_BufferConfig_FillPolicy_UNSPECIFIED = 0,
+  TraceConfig_BufferConfig_FillPolicy_RING_BUFFER = 1,
+  TraceConfig_BufferConfig_FillPolicy_DISCARD = 2,
+};
+
+class PERFETTO_EXPORT TraceConfig : public ::protozero::CppMessageObj {
+ public:
+  using BufferConfig = TraceConfig_BufferConfig;
+  using DataSource = TraceConfig_DataSource;
+  using BuiltinDataSource = TraceConfig_BuiltinDataSource;
+  using ProducerConfig = TraceConfig_ProducerConfig;
+  using StatsdMetadata = TraceConfig_StatsdMetadata;
+  using GuardrailOverrides = TraceConfig_GuardrailOverrides;
+  using TriggerConfig = TraceConfig_TriggerConfig;
+  using IncrementalStateConfig = TraceConfig_IncrementalStateConfig;
+  using IncidentReportConfig = TraceConfig_IncidentReportConfig;
+  using TraceFilter = TraceConfig_TraceFilter;
+  using LockdownModeOperation = TraceConfig_LockdownModeOperation;
+  static constexpr auto LOCKDOWN_UNCHANGED = TraceConfig_LockdownModeOperation_LOCKDOWN_UNCHANGED;
+  static constexpr auto LOCKDOWN_CLEAR = TraceConfig_LockdownModeOperation_LOCKDOWN_CLEAR;
+  static constexpr auto LOCKDOWN_SET = TraceConfig_LockdownModeOperation_LOCKDOWN_SET;
+  static constexpr auto LockdownModeOperation_MIN = TraceConfig_LockdownModeOperation_LOCKDOWN_UNCHANGED;
+  static constexpr auto LockdownModeOperation_MAX = TraceConfig_LockdownModeOperation_LOCKDOWN_SET;
+  using CompressionType = TraceConfig_CompressionType;
+  static constexpr auto COMPRESSION_TYPE_UNSPECIFIED = TraceConfig_CompressionType_COMPRESSION_TYPE_UNSPECIFIED;
+  static constexpr auto COMPRESSION_TYPE_DEFLATE = TraceConfig_CompressionType_COMPRESSION_TYPE_DEFLATE;
+  static constexpr auto CompressionType_MIN = TraceConfig_CompressionType_COMPRESSION_TYPE_UNSPECIFIED;
+  static constexpr auto CompressionType_MAX = TraceConfig_CompressionType_COMPRESSION_TYPE_DEFLATE;
+  using StatsdLogging = TraceConfig_StatsdLogging;
+  static constexpr auto STATSD_LOGGING_UNSPECIFIED = TraceConfig_StatsdLogging_STATSD_LOGGING_UNSPECIFIED;
+  static constexpr auto STATSD_LOGGING_ENABLED = TraceConfig_StatsdLogging_STATSD_LOGGING_ENABLED;
+  static constexpr auto STATSD_LOGGING_DISABLED = TraceConfig_StatsdLogging_STATSD_LOGGING_DISABLED;
+  static constexpr auto StatsdLogging_MIN = TraceConfig_StatsdLogging_STATSD_LOGGING_UNSPECIFIED;
+  static constexpr auto StatsdLogging_MAX = TraceConfig_StatsdLogging_STATSD_LOGGING_DISABLED;
+  enum FieldNumbers {
+    kBuffersFieldNumber = 1,
+    kDataSourcesFieldNumber = 2,
+    kBuiltinDataSourcesFieldNumber = 20,
+    kDurationMsFieldNumber = 3,
+    kEnableExtraGuardrailsFieldNumber = 4,
+    kLockdownModeFieldNumber = 5,
+    kProducersFieldNumber = 6,
+    kStatsdMetadataFieldNumber = 7,
+    kWriteIntoFileFieldNumber = 8,
+    kOutputPathFieldNumber = 29,
+    kFileWritePeriodMsFieldNumber = 9,
+    kMaxFileSizeBytesFieldNumber = 10,
+    kGuardrailOverridesFieldNumber = 11,
+    kDeferredStartFieldNumber = 12,
+    kFlushPeriodMsFieldNumber = 13,
+    kFlushTimeoutMsFieldNumber = 14,
+    kDataSourceStopTimeoutMsFieldNumber = 23,
+    kNotifyTraceurFieldNumber = 16,
+    kBugreportScoreFieldNumber = 30,
+    kTriggerConfigFieldNumber = 17,
+    kActivateTriggersFieldNumber = 18,
+    kIncrementalStateConfigFieldNumber = 21,
+    kAllowUserBuildTracingFieldNumber = 19,
+    kUniqueSessionNameFieldNumber = 22,
+    kCompressionTypeFieldNumber = 24,
+    kIncidentReportConfigFieldNumber = 25,
+    kStatsdLoggingFieldNumber = 31,
+    kTraceUuidMsbFieldNumber = 27,
+    kTraceUuidLsbFieldNumber = 28,
+    kTraceFilterFieldNumber = 32,
+  };
+
+  TraceConfig();
+  ~TraceConfig() override;
+  TraceConfig(TraceConfig&&) noexcept;
+  TraceConfig& operator=(TraceConfig&&);
+  TraceConfig(const TraceConfig&);
+  TraceConfig& operator=(const TraceConfig&);
+  bool operator==(const TraceConfig&) const;
+  bool operator!=(const TraceConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<TraceConfig_BufferConfig>& buffers() const { return buffers_; }
+  std::vector<TraceConfig_BufferConfig>* mutable_buffers() { return &buffers_; }
+  int buffers_size() const;
+  void clear_buffers();
+  TraceConfig_BufferConfig* add_buffers();
+
+  const std::vector<TraceConfig_DataSource>& data_sources() const { return data_sources_; }
+  std::vector<TraceConfig_DataSource>* mutable_data_sources() { return &data_sources_; }
+  int data_sources_size() const;
+  void clear_data_sources();
+  TraceConfig_DataSource* add_data_sources();
+
+  bool has_builtin_data_sources() const { return _has_field_[20]; }
+  const TraceConfig_BuiltinDataSource& builtin_data_sources() const { return *builtin_data_sources_; }
+  TraceConfig_BuiltinDataSource* mutable_builtin_data_sources() { _has_field_.set(20); return builtin_data_sources_.get(); }
+
+  bool has_duration_ms() const { return _has_field_[3]; }
+  uint32_t duration_ms() const { return duration_ms_; }
+  void set_duration_ms(uint32_t value) { duration_ms_ = value; _has_field_.set(3); }
+
+  bool has_enable_extra_guardrails() const { return _has_field_[4]; }
+  bool enable_extra_guardrails() const { return enable_extra_guardrails_; }
+  void set_enable_extra_guardrails(bool value) { enable_extra_guardrails_ = value; _has_field_.set(4); }
+
+  bool has_lockdown_mode() const { return _has_field_[5]; }
+  TraceConfig_LockdownModeOperation lockdown_mode() const { return lockdown_mode_; }
+  void set_lockdown_mode(TraceConfig_LockdownModeOperation value) { lockdown_mode_ = value; _has_field_.set(5); }
+
+  const std::vector<TraceConfig_ProducerConfig>& producers() const { return producers_; }
+  std::vector<TraceConfig_ProducerConfig>* mutable_producers() { return &producers_; }
+  int producers_size() const;
+  void clear_producers();
+  TraceConfig_ProducerConfig* add_producers();
+
+  bool has_statsd_metadata() const { return _has_field_[7]; }
+  const TraceConfig_StatsdMetadata& statsd_metadata() const { return *statsd_metadata_; }
+  TraceConfig_StatsdMetadata* mutable_statsd_metadata() { _has_field_.set(7); return statsd_metadata_.get(); }
+
+  bool has_write_into_file() const { return _has_field_[8]; }
+  bool write_into_file() const { return write_into_file_; }
+  void set_write_into_file(bool value) { write_into_file_ = value; _has_field_.set(8); }
+
+  bool has_output_path() const { return _has_field_[29]; }
+  const std::string& output_path() const { return output_path_; }
+  void set_output_path(const std::string& value) { output_path_ = value; _has_field_.set(29); }
+
+  bool has_file_write_period_ms() const { return _has_field_[9]; }
+  uint32_t file_write_period_ms() const { return file_write_period_ms_; }
+  void set_file_write_period_ms(uint32_t value) { file_write_period_ms_ = value; _has_field_.set(9); }
+
+  bool has_max_file_size_bytes() const { return _has_field_[10]; }
+  uint64_t max_file_size_bytes() const { return max_file_size_bytes_; }
+  void set_max_file_size_bytes(uint64_t value) { max_file_size_bytes_ = value; _has_field_.set(10); }
+
+  bool has_guardrail_overrides() const { return _has_field_[11]; }
+  const TraceConfig_GuardrailOverrides& guardrail_overrides() const { return *guardrail_overrides_; }
+  TraceConfig_GuardrailOverrides* mutable_guardrail_overrides() { _has_field_.set(11); return guardrail_overrides_.get(); }
+
+  bool has_deferred_start() const { return _has_field_[12]; }
+  bool deferred_start() const { return deferred_start_; }
+  void set_deferred_start(bool value) { deferred_start_ = value; _has_field_.set(12); }
+
+  bool has_flush_period_ms() const { return _has_field_[13]; }
+  uint32_t flush_period_ms() const { return flush_period_ms_; }
+  void set_flush_period_ms(uint32_t value) { flush_period_ms_ = value; _has_field_.set(13); }
+
+  bool has_flush_timeout_ms() const { return _has_field_[14]; }
+  uint32_t flush_timeout_ms() const { return flush_timeout_ms_; }
+  void set_flush_timeout_ms(uint32_t value) { flush_timeout_ms_ = value; _has_field_.set(14); }
+
+  bool has_data_source_stop_timeout_ms() const { return _has_field_[23]; }
+  uint32_t data_source_stop_timeout_ms() const { return data_source_stop_timeout_ms_; }
+  void set_data_source_stop_timeout_ms(uint32_t value) { data_source_stop_timeout_ms_ = value; _has_field_.set(23); }
+
+  bool has_notify_traceur() const { return _has_field_[16]; }
+  bool notify_traceur() const { return notify_traceur_; }
+  void set_notify_traceur(bool value) { notify_traceur_ = value; _has_field_.set(16); }
+
+  bool has_bugreport_score() const { return _has_field_[30]; }
+  int32_t bugreport_score() const { return bugreport_score_; }
+  void set_bugreport_score(int32_t value) { bugreport_score_ = value; _has_field_.set(30); }
+
+  bool has_trigger_config() const { return _has_field_[17]; }
+  const TraceConfig_TriggerConfig& trigger_config() const { return *trigger_config_; }
+  TraceConfig_TriggerConfig* mutable_trigger_config() { _has_field_.set(17); return trigger_config_.get(); }
+
+  const std::vector<std::string>& activate_triggers() const { return activate_triggers_; }
+  std::vector<std::string>* mutable_activate_triggers() { return &activate_triggers_; }
+  int activate_triggers_size() const { return static_cast<int>(activate_triggers_.size()); }
+  void clear_activate_triggers() { activate_triggers_.clear(); }
+  void add_activate_triggers(std::string value) { activate_triggers_.emplace_back(value); }
+  std::string* add_activate_triggers() { activate_triggers_.emplace_back(); return &activate_triggers_.back(); }
+
+  bool has_incremental_state_config() const { return _has_field_[21]; }
+  const TraceConfig_IncrementalStateConfig& incremental_state_config() const { return *incremental_state_config_; }
+  TraceConfig_IncrementalStateConfig* mutable_incremental_state_config() { _has_field_.set(21); return incremental_state_config_.get(); }
+
+  bool has_allow_user_build_tracing() const { return _has_field_[19]; }
+  bool allow_user_build_tracing() const { return allow_user_build_tracing_; }
+  void set_allow_user_build_tracing(bool value) { allow_user_build_tracing_ = value; _has_field_.set(19); }
+
+  bool has_unique_session_name() const { return _has_field_[22]; }
+  const std::string& unique_session_name() const { return unique_session_name_; }
+  void set_unique_session_name(const std::string& value) { unique_session_name_ = value; _has_field_.set(22); }
+
+  bool has_compression_type() const { return _has_field_[24]; }
+  TraceConfig_CompressionType compression_type() const { return compression_type_; }
+  void set_compression_type(TraceConfig_CompressionType value) { compression_type_ = value; _has_field_.set(24); }
+
+  bool has_incident_report_config() const { return _has_field_[25]; }
+  const TraceConfig_IncidentReportConfig& incident_report_config() const { return *incident_report_config_; }
+  TraceConfig_IncidentReportConfig* mutable_incident_report_config() { _has_field_.set(25); return incident_report_config_.get(); }
+
+  bool has_statsd_logging() const { return _has_field_[31]; }
+  TraceConfig_StatsdLogging statsd_logging() const { return statsd_logging_; }
+  void set_statsd_logging(TraceConfig_StatsdLogging value) { statsd_logging_ = value; _has_field_.set(31); }
+
+  bool has_trace_uuid_msb() const { return _has_field_[27]; }
+  int64_t trace_uuid_msb() const { return trace_uuid_msb_; }
+  void set_trace_uuid_msb(int64_t value) { trace_uuid_msb_ = value; _has_field_.set(27); }
+
+  bool has_trace_uuid_lsb() const { return _has_field_[28]; }
+  int64_t trace_uuid_lsb() const { return trace_uuid_lsb_; }
+  void set_trace_uuid_lsb(int64_t value) { trace_uuid_lsb_ = value; _has_field_.set(28); }
+
+  bool has_trace_filter() const { return _has_field_[32]; }
+  const TraceConfig_TraceFilter& trace_filter() const { return *trace_filter_; }
+  TraceConfig_TraceFilter* mutable_trace_filter() { _has_field_.set(32); return trace_filter_.get(); }
+
+ private:
+  std::vector<TraceConfig_BufferConfig> buffers_;
+  std::vector<TraceConfig_DataSource> data_sources_;
+  ::protozero::CopyablePtr<TraceConfig_BuiltinDataSource> builtin_data_sources_;
+  uint32_t duration_ms_{};
+  bool enable_extra_guardrails_{};
+  TraceConfig_LockdownModeOperation lockdown_mode_{};
+  std::vector<TraceConfig_ProducerConfig> producers_;
+  ::protozero::CopyablePtr<TraceConfig_StatsdMetadata> statsd_metadata_;
+  bool write_into_file_{};
+  std::string output_path_{};
+  uint32_t file_write_period_ms_{};
+  uint64_t max_file_size_bytes_{};
+  ::protozero::CopyablePtr<TraceConfig_GuardrailOverrides> guardrail_overrides_;
+  bool deferred_start_{};
+  uint32_t flush_period_ms_{};
+  uint32_t flush_timeout_ms_{};
+  uint32_t data_source_stop_timeout_ms_{};
+  bool notify_traceur_{};
+  int32_t bugreport_score_{};
+  ::protozero::CopyablePtr<TraceConfig_TriggerConfig> trigger_config_;
+  std::vector<std::string> activate_triggers_;
+  ::protozero::CopyablePtr<TraceConfig_IncrementalStateConfig> incremental_state_config_;
+  bool allow_user_build_tracing_{};
+  std::string unique_session_name_{};
+  TraceConfig_CompressionType compression_type_{};
+  ::protozero::CopyablePtr<TraceConfig_IncidentReportConfig> incident_report_config_;
+  TraceConfig_StatsdLogging statsd_logging_{};
+  int64_t trace_uuid_msb_{};
+  int64_t trace_uuid_lsb_{};
+  ::protozero::CopyablePtr<TraceConfig_TraceFilter> trace_filter_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<33> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TraceConfig_TraceFilter : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kBytecodeFieldNumber = 1,
+  };
+
+  TraceConfig_TraceFilter();
+  ~TraceConfig_TraceFilter() override;
+  TraceConfig_TraceFilter(TraceConfig_TraceFilter&&) noexcept;
+  TraceConfig_TraceFilter& operator=(TraceConfig_TraceFilter&&);
+  TraceConfig_TraceFilter(const TraceConfig_TraceFilter&);
+  TraceConfig_TraceFilter& operator=(const TraceConfig_TraceFilter&);
+  bool operator==(const TraceConfig_TraceFilter&) const;
+  bool operator!=(const TraceConfig_TraceFilter& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_bytecode() const { return _has_field_[1]; }
+  const std::string& bytecode() const { return bytecode_; }
+  void set_bytecode(const std::string& value) { bytecode_ = value; _has_field_.set(1); }
+  void set_bytecode(const void* p, size_t s) { bytecode_.assign(reinterpret_cast<const char*>(p), s); _has_field_.set(1); }
+
+ private:
+  std::string bytecode_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TraceConfig_IncidentReportConfig : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDestinationPackageFieldNumber = 1,
+    kDestinationClassFieldNumber = 2,
+    kPrivacyLevelFieldNumber = 3,
+    kSkipIncidentdFieldNumber = 5,
+    kSkipDropboxFieldNumber = 4,
+  };
+
+  TraceConfig_IncidentReportConfig();
+  ~TraceConfig_IncidentReportConfig() override;
+  TraceConfig_IncidentReportConfig(TraceConfig_IncidentReportConfig&&) noexcept;
+  TraceConfig_IncidentReportConfig& operator=(TraceConfig_IncidentReportConfig&&);
+  TraceConfig_IncidentReportConfig(const TraceConfig_IncidentReportConfig&);
+  TraceConfig_IncidentReportConfig& operator=(const TraceConfig_IncidentReportConfig&);
+  bool operator==(const TraceConfig_IncidentReportConfig&) const;
+  bool operator!=(const TraceConfig_IncidentReportConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_destination_package() const { return _has_field_[1]; }
+  const std::string& destination_package() const { return destination_package_; }
+  void set_destination_package(const std::string& value) { destination_package_ = value; _has_field_.set(1); }
+
+  bool has_destination_class() const { return _has_field_[2]; }
+  const std::string& destination_class() const { return destination_class_; }
+  void set_destination_class(const std::string& value) { destination_class_ = value; _has_field_.set(2); }
+
+  bool has_privacy_level() const { return _has_field_[3]; }
+  int32_t privacy_level() const { return privacy_level_; }
+  void set_privacy_level(int32_t value) { privacy_level_ = value; _has_field_.set(3); }
+
+  bool has_skip_incidentd() const { return _has_field_[5]; }
+  bool skip_incidentd() const { return skip_incidentd_; }
+  void set_skip_incidentd(bool value) { skip_incidentd_ = value; _has_field_.set(5); }
+
+  bool has_skip_dropbox() const { return _has_field_[4]; }
+  bool skip_dropbox() const { return skip_dropbox_; }
+  void set_skip_dropbox(bool value) { skip_dropbox_ = value; _has_field_.set(4); }
+
+ private:
+  std::string destination_package_{};
+  std::string destination_class_{};
+  int32_t privacy_level_{};
+  bool skip_incidentd_{};
+  bool skip_dropbox_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<6> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TraceConfig_IncrementalStateConfig : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kClearPeriodMsFieldNumber = 1,
+  };
+
+  TraceConfig_IncrementalStateConfig();
+  ~TraceConfig_IncrementalStateConfig() override;
+  TraceConfig_IncrementalStateConfig(TraceConfig_IncrementalStateConfig&&) noexcept;
+  TraceConfig_IncrementalStateConfig& operator=(TraceConfig_IncrementalStateConfig&&);
+  TraceConfig_IncrementalStateConfig(const TraceConfig_IncrementalStateConfig&);
+  TraceConfig_IncrementalStateConfig& operator=(const TraceConfig_IncrementalStateConfig&);
+  bool operator==(const TraceConfig_IncrementalStateConfig&) const;
+  bool operator!=(const TraceConfig_IncrementalStateConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_clear_period_ms() const { return _has_field_[1]; }
+  uint32_t clear_period_ms() const { return clear_period_ms_; }
+  void set_clear_period_ms(uint32_t value) { clear_period_ms_ = value; _has_field_.set(1); }
+
+ private:
+  uint32_t clear_period_ms_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TraceConfig_TriggerConfig : public ::protozero::CppMessageObj {
+ public:
+  using Trigger = TraceConfig_TriggerConfig_Trigger;
+  using TriggerMode = TraceConfig_TriggerConfig_TriggerMode;
+  static constexpr auto UNSPECIFIED = TraceConfig_TriggerConfig_TriggerMode_UNSPECIFIED;
+  static constexpr auto START_TRACING = TraceConfig_TriggerConfig_TriggerMode_START_TRACING;
+  static constexpr auto STOP_TRACING = TraceConfig_TriggerConfig_TriggerMode_STOP_TRACING;
+  static constexpr auto TriggerMode_MIN = TraceConfig_TriggerConfig_TriggerMode_UNSPECIFIED;
+  static constexpr auto TriggerMode_MAX = TraceConfig_TriggerConfig_TriggerMode_STOP_TRACING;
+  enum FieldNumbers {
+    kTriggerModeFieldNumber = 1,
+    kTriggersFieldNumber = 2,
+    kTriggerTimeoutMsFieldNumber = 3,
+  };
+
+  TraceConfig_TriggerConfig();
+  ~TraceConfig_TriggerConfig() override;
+  TraceConfig_TriggerConfig(TraceConfig_TriggerConfig&&) noexcept;
+  TraceConfig_TriggerConfig& operator=(TraceConfig_TriggerConfig&&);
+  TraceConfig_TriggerConfig(const TraceConfig_TriggerConfig&);
+  TraceConfig_TriggerConfig& operator=(const TraceConfig_TriggerConfig&);
+  bool operator==(const TraceConfig_TriggerConfig&) const;
+  bool operator!=(const TraceConfig_TriggerConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_trigger_mode() const { return _has_field_[1]; }
+  TraceConfig_TriggerConfig_TriggerMode trigger_mode() const { return trigger_mode_; }
+  void set_trigger_mode(TraceConfig_TriggerConfig_TriggerMode value) { trigger_mode_ = value; _has_field_.set(1); }
+
+  const std::vector<TraceConfig_TriggerConfig_Trigger>& triggers() const { return triggers_; }
+  std::vector<TraceConfig_TriggerConfig_Trigger>* mutable_triggers() { return &triggers_; }
+  int triggers_size() const;
+  void clear_triggers();
+  TraceConfig_TriggerConfig_Trigger* add_triggers();
+
+  bool has_trigger_timeout_ms() const { return _has_field_[3]; }
+  uint32_t trigger_timeout_ms() const { return trigger_timeout_ms_; }
+  void set_trigger_timeout_ms(uint32_t value) { trigger_timeout_ms_ = value; _has_field_.set(3); }
+
+ private:
+  TraceConfig_TriggerConfig_TriggerMode trigger_mode_{};
+  std::vector<TraceConfig_TriggerConfig_Trigger> triggers_;
+  uint32_t trigger_timeout_ms_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<4> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TraceConfig_TriggerConfig_Trigger : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNameFieldNumber = 1,
+    kProducerNameRegexFieldNumber = 2,
+    kStopDelayMsFieldNumber = 3,
+    kMaxPer24HFieldNumber = 4,
+    kSkipProbabilityFieldNumber = 5,
+  };
+
+  TraceConfig_TriggerConfig_Trigger();
+  ~TraceConfig_TriggerConfig_Trigger() override;
+  TraceConfig_TriggerConfig_Trigger(TraceConfig_TriggerConfig_Trigger&&) noexcept;
+  TraceConfig_TriggerConfig_Trigger& operator=(TraceConfig_TriggerConfig_Trigger&&);
+  TraceConfig_TriggerConfig_Trigger(const TraceConfig_TriggerConfig_Trigger&);
+  TraceConfig_TriggerConfig_Trigger& operator=(const TraceConfig_TriggerConfig_Trigger&);
+  bool operator==(const TraceConfig_TriggerConfig_Trigger&) const;
+  bool operator!=(const TraceConfig_TriggerConfig_Trigger& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_name() const { return _has_field_[1]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
+
+  bool has_producer_name_regex() const { return _has_field_[2]; }
+  const std::string& producer_name_regex() const { return producer_name_regex_; }
+  void set_producer_name_regex(const std::string& value) { producer_name_regex_ = value; _has_field_.set(2); }
+
+  bool has_stop_delay_ms() const { return _has_field_[3]; }
+  uint32_t stop_delay_ms() const { return stop_delay_ms_; }
+  void set_stop_delay_ms(uint32_t value) { stop_delay_ms_ = value; _has_field_.set(3); }
+
+  bool has_max_per_24_h() const { return _has_field_[4]; }
+  uint32_t max_per_24_h() const { return max_per_24_h_; }
+  void set_max_per_24_h(uint32_t value) { max_per_24_h_ = value; _has_field_.set(4); }
+
+  bool has_skip_probability() const { return _has_field_[5]; }
+  double skip_probability() const { return skip_probability_; }
+  void set_skip_probability(double value) { skip_probability_ = value; _has_field_.set(5); }
+
+ private:
+  std::string name_{};
+  std::string producer_name_regex_{};
+  uint32_t stop_delay_ms_{};
+  uint32_t max_per_24_h_{};
+  double skip_probability_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<6> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TraceConfig_GuardrailOverrides : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kMaxUploadPerDayBytesFieldNumber = 1,
+  };
+
+  TraceConfig_GuardrailOverrides();
+  ~TraceConfig_GuardrailOverrides() override;
+  TraceConfig_GuardrailOverrides(TraceConfig_GuardrailOverrides&&) noexcept;
+  TraceConfig_GuardrailOverrides& operator=(TraceConfig_GuardrailOverrides&&);
+  TraceConfig_GuardrailOverrides(const TraceConfig_GuardrailOverrides&);
+  TraceConfig_GuardrailOverrides& operator=(const TraceConfig_GuardrailOverrides&);
+  bool operator==(const TraceConfig_GuardrailOverrides&) const;
+  bool operator!=(const TraceConfig_GuardrailOverrides& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_max_upload_per_day_bytes() const { return _has_field_[1]; }
+  uint64_t max_upload_per_day_bytes() const { return max_upload_per_day_bytes_; }
+  void set_max_upload_per_day_bytes(uint64_t value) { max_upload_per_day_bytes_ = value; _has_field_.set(1); }
+
+ private:
+  uint64_t max_upload_per_day_bytes_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TraceConfig_StatsdMetadata : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kTriggeringAlertIdFieldNumber = 1,
+    kTriggeringConfigUidFieldNumber = 2,
+    kTriggeringConfigIdFieldNumber = 3,
+    kTriggeringSubscriptionIdFieldNumber = 4,
+  };
+
+  TraceConfig_StatsdMetadata();
+  ~TraceConfig_StatsdMetadata() override;
+  TraceConfig_StatsdMetadata(TraceConfig_StatsdMetadata&&) noexcept;
+  TraceConfig_StatsdMetadata& operator=(TraceConfig_StatsdMetadata&&);
+  TraceConfig_StatsdMetadata(const TraceConfig_StatsdMetadata&);
+  TraceConfig_StatsdMetadata& operator=(const TraceConfig_StatsdMetadata&);
+  bool operator==(const TraceConfig_StatsdMetadata&) const;
+  bool operator!=(const TraceConfig_StatsdMetadata& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_triggering_alert_id() const { return _has_field_[1]; }
+  int64_t triggering_alert_id() const { return triggering_alert_id_; }
+  void set_triggering_alert_id(int64_t value) { triggering_alert_id_ = value; _has_field_.set(1); }
+
+  bool has_triggering_config_uid() const { return _has_field_[2]; }
+  int32_t triggering_config_uid() const { return triggering_config_uid_; }
+  void set_triggering_config_uid(int32_t value) { triggering_config_uid_ = value; _has_field_.set(2); }
+
+  bool has_triggering_config_id() const { return _has_field_[3]; }
+  int64_t triggering_config_id() const { return triggering_config_id_; }
+  void set_triggering_config_id(int64_t value) { triggering_config_id_ = value; _has_field_.set(3); }
+
+  bool has_triggering_subscription_id() const { return _has_field_[4]; }
+  int64_t triggering_subscription_id() const { return triggering_subscription_id_; }
+  void set_triggering_subscription_id(int64_t value) { triggering_subscription_id_ = value; _has_field_.set(4); }
+
+ private:
+  int64_t triggering_alert_id_{};
+  int32_t triggering_config_uid_{};
+  int64_t triggering_config_id_{};
+  int64_t triggering_subscription_id_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<5> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TraceConfig_ProducerConfig : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kProducerNameFieldNumber = 1,
+    kShmSizeKbFieldNumber = 2,
+    kPageSizeKbFieldNumber = 3,
+  };
+
+  TraceConfig_ProducerConfig();
+  ~TraceConfig_ProducerConfig() override;
+  TraceConfig_ProducerConfig(TraceConfig_ProducerConfig&&) noexcept;
+  TraceConfig_ProducerConfig& operator=(TraceConfig_ProducerConfig&&);
+  TraceConfig_ProducerConfig(const TraceConfig_ProducerConfig&);
+  TraceConfig_ProducerConfig& operator=(const TraceConfig_ProducerConfig&);
+  bool operator==(const TraceConfig_ProducerConfig&) const;
+  bool operator!=(const TraceConfig_ProducerConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_producer_name() const { return _has_field_[1]; }
+  const std::string& producer_name() const { return producer_name_; }
+  void set_producer_name(const std::string& value) { producer_name_ = value; _has_field_.set(1); }
+
+  bool has_shm_size_kb() const { return _has_field_[2]; }
+  uint32_t shm_size_kb() const { return shm_size_kb_; }
+  void set_shm_size_kb(uint32_t value) { shm_size_kb_ = value; _has_field_.set(2); }
+
+  bool has_page_size_kb() const { return _has_field_[3]; }
+  uint32_t page_size_kb() const { return page_size_kb_; }
+  void set_page_size_kb(uint32_t value) { page_size_kb_ = value; _has_field_.set(3); }
+
+ private:
+  std::string producer_name_{};
+  uint32_t shm_size_kb_{};
+  uint32_t page_size_kb_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<4> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TraceConfig_BuiltinDataSource : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDisableClockSnapshottingFieldNumber = 1,
+    kDisableTraceConfigFieldNumber = 2,
+    kDisableSystemInfoFieldNumber = 3,
+    kDisableServiceEventsFieldNumber = 4,
+    kPrimaryTraceClockFieldNumber = 5,
+    kSnapshotIntervalMsFieldNumber = 6,
+    kPreferSuspendClockForSnapshotFieldNumber = 7,
+  };
+
+  TraceConfig_BuiltinDataSource();
+  ~TraceConfig_BuiltinDataSource() override;
+  TraceConfig_BuiltinDataSource(TraceConfig_BuiltinDataSource&&) noexcept;
+  TraceConfig_BuiltinDataSource& operator=(TraceConfig_BuiltinDataSource&&);
+  TraceConfig_BuiltinDataSource(const TraceConfig_BuiltinDataSource&);
+  TraceConfig_BuiltinDataSource& operator=(const TraceConfig_BuiltinDataSource&);
+  bool operator==(const TraceConfig_BuiltinDataSource&) const;
+  bool operator!=(const TraceConfig_BuiltinDataSource& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_disable_clock_snapshotting() const { return _has_field_[1]; }
+  bool disable_clock_snapshotting() const { return disable_clock_snapshotting_; }
+  void set_disable_clock_snapshotting(bool value) { disable_clock_snapshotting_ = value; _has_field_.set(1); }
+
+  bool has_disable_trace_config() const { return _has_field_[2]; }
+  bool disable_trace_config() const { return disable_trace_config_; }
+  void set_disable_trace_config(bool value) { disable_trace_config_ = value; _has_field_.set(2); }
+
+  bool has_disable_system_info() const { return _has_field_[3]; }
+  bool disable_system_info() const { return disable_system_info_; }
+  void set_disable_system_info(bool value) { disable_system_info_ = value; _has_field_.set(3); }
+
+  bool has_disable_service_events() const { return _has_field_[4]; }
+  bool disable_service_events() const { return disable_service_events_; }
+  void set_disable_service_events(bool value) { disable_service_events_ = value; _has_field_.set(4); }
+
+  bool has_primary_trace_clock() const { return _has_field_[5]; }
+  BuiltinClock primary_trace_clock() const { return primary_trace_clock_; }
+  void set_primary_trace_clock(BuiltinClock value) { primary_trace_clock_ = value; _has_field_.set(5); }
+
+  bool has_snapshot_interval_ms() const { return _has_field_[6]; }
+  uint32_t snapshot_interval_ms() const { return snapshot_interval_ms_; }
+  void set_snapshot_interval_ms(uint32_t value) { snapshot_interval_ms_ = value; _has_field_.set(6); }
+
+  bool has_prefer_suspend_clock_for_snapshot() const { return _has_field_[7]; }
+  bool prefer_suspend_clock_for_snapshot() const { return prefer_suspend_clock_for_snapshot_; }
+  void set_prefer_suspend_clock_for_snapshot(bool value) { prefer_suspend_clock_for_snapshot_ = value; _has_field_.set(7); }
+
+ private:
+  bool disable_clock_snapshotting_{};
+  bool disable_trace_config_{};
+  bool disable_system_info_{};
+  bool disable_service_events_{};
+  BuiltinClock primary_trace_clock_{};
+  uint32_t snapshot_interval_ms_{};
+  bool prefer_suspend_clock_for_snapshot_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<8> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TraceConfig_DataSource : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kConfigFieldNumber = 1,
+    kProducerNameFilterFieldNumber = 2,
+    kProducerNameRegexFilterFieldNumber = 3,
+  };
+
+  TraceConfig_DataSource();
+  ~TraceConfig_DataSource() override;
+  TraceConfig_DataSource(TraceConfig_DataSource&&) noexcept;
+  TraceConfig_DataSource& operator=(TraceConfig_DataSource&&);
+  TraceConfig_DataSource(const TraceConfig_DataSource&);
+  TraceConfig_DataSource& operator=(const TraceConfig_DataSource&);
+  bool operator==(const TraceConfig_DataSource&) const;
+  bool operator!=(const TraceConfig_DataSource& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_config() const { return _has_field_[1]; }
+  const DataSourceConfig& config() const { return *config_; }
+  DataSourceConfig* mutable_config() { _has_field_.set(1); return config_.get(); }
+
+  const std::vector<std::string>& producer_name_filter() const { return producer_name_filter_; }
+  std::vector<std::string>* mutable_producer_name_filter() { return &producer_name_filter_; }
+  int producer_name_filter_size() const { return static_cast<int>(producer_name_filter_.size()); }
+  void clear_producer_name_filter() { producer_name_filter_.clear(); }
+  void add_producer_name_filter(std::string value) { producer_name_filter_.emplace_back(value); }
+  std::string* add_producer_name_filter() { producer_name_filter_.emplace_back(); return &producer_name_filter_.back(); }
+
+  const std::vector<std::string>& producer_name_regex_filter() const { return producer_name_regex_filter_; }
+  std::vector<std::string>* mutable_producer_name_regex_filter() { return &producer_name_regex_filter_; }
+  int producer_name_regex_filter_size() const { return static_cast<int>(producer_name_regex_filter_.size()); }
+  void clear_producer_name_regex_filter() { producer_name_regex_filter_.clear(); }
+  void add_producer_name_regex_filter(std::string value) { producer_name_regex_filter_.emplace_back(value); }
+  std::string* add_producer_name_regex_filter() { producer_name_regex_filter_.emplace_back(); return &producer_name_regex_filter_.back(); }
+
+ private:
+  ::protozero::CopyablePtr<DataSourceConfig> config_;
+  std::vector<std::string> producer_name_filter_;
+  std::vector<std::string> producer_name_regex_filter_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<4> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT TraceConfig_BufferConfig : public ::protozero::CppMessageObj {
+ public:
+  using FillPolicy = TraceConfig_BufferConfig_FillPolicy;
+  static constexpr auto UNSPECIFIED = TraceConfig_BufferConfig_FillPolicy_UNSPECIFIED;
+  static constexpr auto RING_BUFFER = TraceConfig_BufferConfig_FillPolicy_RING_BUFFER;
+  static constexpr auto DISCARD = TraceConfig_BufferConfig_FillPolicy_DISCARD;
+  static constexpr auto FillPolicy_MIN = TraceConfig_BufferConfig_FillPolicy_UNSPECIFIED;
+  static constexpr auto FillPolicy_MAX = TraceConfig_BufferConfig_FillPolicy_DISCARD;
+  enum FieldNumbers {
+    kSizeKbFieldNumber = 1,
+    kFillPolicyFieldNumber = 4,
+  };
+
+  TraceConfig_BufferConfig();
+  ~TraceConfig_BufferConfig() override;
+  TraceConfig_BufferConfig(TraceConfig_BufferConfig&&) noexcept;
+  TraceConfig_BufferConfig& operator=(TraceConfig_BufferConfig&&);
+  TraceConfig_BufferConfig(const TraceConfig_BufferConfig&);
+  TraceConfig_BufferConfig& operator=(const TraceConfig_BufferConfig&);
+  bool operator==(const TraceConfig_BufferConfig&) const;
+  bool operator!=(const TraceConfig_BufferConfig& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_size_kb() const { return _has_field_[1]; }
+  uint32_t size_kb() const { return size_kb_; }
+  void set_size_kb(uint32_t value) { size_kb_ = value; _has_field_.set(1); }
+
+  bool has_fill_policy() const { return _has_field_[4]; }
+  TraceConfig_BufferConfig_FillPolicy fill_policy() const { return fill_policy_; }
+  void set_fill_policy(TraceConfig_BufferConfig_FillPolicy value) { fill_policy_ = value; _has_field_.set(4); }
+
+ private:
+  uint32_t size_kb_{};
+  TraceConfig_BufferConfig_FillPolicy fill_policy_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<5> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACE_CONFIG_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/ipc/consumer_port.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_CONSUMER_PORT_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_CONSUMER_PORT_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class SaveTraceForBugreportResponse;
+class SaveTraceForBugreportRequest;
+class QueryCapabilitiesResponse;
+class TracingServiceCapabilities;
+class QueryCapabilitiesRequest;
+class QueryServiceStateResponse;
+class TracingServiceState;
+class TracingServiceState_DataSource;
+class DataSourceDescriptor;
+class TracingServiceState_Producer;
+class QueryServiceStateRequest;
+class ObserveEventsResponse;
+class ObservableEvents;
+class ObservableEvents_DataSourceInstanceStateChange;
+class ObserveEventsRequest;
+class GetTraceStatsResponse;
+class TraceStats;
+class TraceStats_FilterStats;
+class TraceStats_BufferStats;
+class GetTraceStatsRequest;
+class AttachResponse;
+class TraceConfig;
+class TraceConfig_TraceFilter;
+class TraceConfig_IncidentReportConfig;
+class TraceConfig_IncrementalStateConfig;
+class TraceConfig_TriggerConfig;
+class TraceConfig_TriggerConfig_Trigger;
+class TraceConfig_GuardrailOverrides;
+class TraceConfig_StatsdMetadata;
+class TraceConfig_ProducerConfig;
+class TraceConfig_BuiltinDataSource;
+class TraceConfig_DataSource;
+class DataSourceConfig;
+class TestConfig;
+class TestConfig_DummyFields;
+class InterceptorConfig;
+class ChromeConfig;
+class TraceConfig_BufferConfig;
+class AttachRequest;
+class DetachResponse;
+class DetachRequest;
+class FlushResponse;
+class FlushRequest;
+class FreeBuffersResponse;
+class FreeBuffersRequest;
+class ReadBuffersResponse;
+class ReadBuffersResponse_Slice;
+class ReadBuffersRequest;
+class DisableTracingResponse;
+class DisableTracingRequest;
+class ChangeTraceConfigResponse;
+class ChangeTraceConfigRequest;
+class StartTracingResponse;
+class StartTracingRequest;
+class EnableTracingResponse;
+class EnableTracingRequest;
+enum ObservableEvents_Type : int;
+enum ObservableEvents_DataSourceInstanceState : int;
+enum TraceConfig_LockdownModeOperation : int;
+enum TraceConfig_CompressionType : int;
+enum TraceConfig_StatsdLogging : int;
+enum TraceConfig_TriggerConfig_TriggerMode : int;
+enum BuiltinClock : int;
+enum DataSourceConfig_SessionInitiator : int;
+enum ChromeConfig_ClientPriority : int;
+enum TraceConfig_BufferConfig_FillPolicy : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT SaveTraceForBugreportResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kSuccessFieldNumber = 1,
+    kMsgFieldNumber = 2,
+  };
+
+  SaveTraceForBugreportResponse();
+  ~SaveTraceForBugreportResponse() override;
+  SaveTraceForBugreportResponse(SaveTraceForBugreportResponse&&) noexcept;
+  SaveTraceForBugreportResponse& operator=(SaveTraceForBugreportResponse&&);
+  SaveTraceForBugreportResponse(const SaveTraceForBugreportResponse&);
+  SaveTraceForBugreportResponse& operator=(const SaveTraceForBugreportResponse&);
+  bool operator==(const SaveTraceForBugreportResponse&) const;
+  bool operator!=(const SaveTraceForBugreportResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_success() const { return _has_field_[1]; }
+  bool success() const { return success_; }
+  void set_success(bool value) { success_ = value; _has_field_.set(1); }
+
+  bool has_msg() const { return _has_field_[2]; }
+  const std::string& msg() const { return msg_; }
+  void set_msg(const std::string& value) { msg_ = value; _has_field_.set(2); }
+
+ private:
+  bool success_{};
+  std::string msg_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT SaveTraceForBugreportRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  SaveTraceForBugreportRequest();
+  ~SaveTraceForBugreportRequest() override;
+  SaveTraceForBugreportRequest(SaveTraceForBugreportRequest&&) noexcept;
+  SaveTraceForBugreportRequest& operator=(SaveTraceForBugreportRequest&&);
+  SaveTraceForBugreportRequest(const SaveTraceForBugreportRequest&);
+  SaveTraceForBugreportRequest& operator=(const SaveTraceForBugreportRequest&);
+  bool operator==(const SaveTraceForBugreportRequest&) const;
+  bool operator!=(const SaveTraceForBugreportRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT QueryCapabilitiesResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kCapabilitiesFieldNumber = 1,
+  };
+
+  QueryCapabilitiesResponse();
+  ~QueryCapabilitiesResponse() override;
+  QueryCapabilitiesResponse(QueryCapabilitiesResponse&&) noexcept;
+  QueryCapabilitiesResponse& operator=(QueryCapabilitiesResponse&&);
+  QueryCapabilitiesResponse(const QueryCapabilitiesResponse&);
+  QueryCapabilitiesResponse& operator=(const QueryCapabilitiesResponse&);
+  bool operator==(const QueryCapabilitiesResponse&) const;
+  bool operator!=(const QueryCapabilitiesResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_capabilities() const { return _has_field_[1]; }
+  const TracingServiceCapabilities& capabilities() const { return *capabilities_; }
+  TracingServiceCapabilities* mutable_capabilities() { _has_field_.set(1); return capabilities_.get(); }
+
+ private:
+  ::protozero::CopyablePtr<TracingServiceCapabilities> capabilities_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT QueryCapabilitiesRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  QueryCapabilitiesRequest();
+  ~QueryCapabilitiesRequest() override;
+  QueryCapabilitiesRequest(QueryCapabilitiesRequest&&) noexcept;
+  QueryCapabilitiesRequest& operator=(QueryCapabilitiesRequest&&);
+  QueryCapabilitiesRequest(const QueryCapabilitiesRequest&);
+  QueryCapabilitiesRequest& operator=(const QueryCapabilitiesRequest&);
+  bool operator==(const QueryCapabilitiesRequest&) const;
+  bool operator!=(const QueryCapabilitiesRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT QueryServiceStateResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kServiceStateFieldNumber = 1,
+  };
+
+  QueryServiceStateResponse();
+  ~QueryServiceStateResponse() override;
+  QueryServiceStateResponse(QueryServiceStateResponse&&) noexcept;
+  QueryServiceStateResponse& operator=(QueryServiceStateResponse&&);
+  QueryServiceStateResponse(const QueryServiceStateResponse&);
+  QueryServiceStateResponse& operator=(const QueryServiceStateResponse&);
+  bool operator==(const QueryServiceStateResponse&) const;
+  bool operator!=(const QueryServiceStateResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_service_state() const { return _has_field_[1]; }
+  const TracingServiceState& service_state() const { return *service_state_; }
+  TracingServiceState* mutable_service_state() { _has_field_.set(1); return service_state_.get(); }
+
+ private:
+  ::protozero::CopyablePtr<TracingServiceState> service_state_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT QueryServiceStateRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  QueryServiceStateRequest();
+  ~QueryServiceStateRequest() override;
+  QueryServiceStateRequest(QueryServiceStateRequest&&) noexcept;
+  QueryServiceStateRequest& operator=(QueryServiceStateRequest&&);
+  QueryServiceStateRequest(const QueryServiceStateRequest&);
+  QueryServiceStateRequest& operator=(const QueryServiceStateRequest&);
+  bool operator==(const QueryServiceStateRequest&) const;
+  bool operator!=(const QueryServiceStateRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ObserveEventsResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kEventsFieldNumber = 1,
+  };
+
+  ObserveEventsResponse();
+  ~ObserveEventsResponse() override;
+  ObserveEventsResponse(ObserveEventsResponse&&) noexcept;
+  ObserveEventsResponse& operator=(ObserveEventsResponse&&);
+  ObserveEventsResponse(const ObserveEventsResponse&);
+  ObserveEventsResponse& operator=(const ObserveEventsResponse&);
+  bool operator==(const ObserveEventsResponse&) const;
+  bool operator!=(const ObserveEventsResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_events() const { return _has_field_[1]; }
+  const ObservableEvents& events() const { return *events_; }
+  ObservableEvents* mutable_events() { _has_field_.set(1); return events_.get(); }
+
+ private:
+  ::protozero::CopyablePtr<ObservableEvents> events_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ObserveEventsRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kEventsToObserveFieldNumber = 1,
+  };
+
+  ObserveEventsRequest();
+  ~ObserveEventsRequest() override;
+  ObserveEventsRequest(ObserveEventsRequest&&) noexcept;
+  ObserveEventsRequest& operator=(ObserveEventsRequest&&);
+  ObserveEventsRequest(const ObserveEventsRequest&);
+  ObserveEventsRequest& operator=(const ObserveEventsRequest&);
+  bool operator==(const ObserveEventsRequest&) const;
+  bool operator!=(const ObserveEventsRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<ObservableEvents_Type>& events_to_observe() const { return events_to_observe_; }
+  std::vector<ObservableEvents_Type>* mutable_events_to_observe() { return &events_to_observe_; }
+  int events_to_observe_size() const { return static_cast<int>(events_to_observe_.size()); }
+  void clear_events_to_observe() { events_to_observe_.clear(); }
+  void add_events_to_observe(ObservableEvents_Type value) { events_to_observe_.emplace_back(value); }
+  ObservableEvents_Type* add_events_to_observe() { events_to_observe_.emplace_back(); return &events_to_observe_.back(); }
+
+ private:
+  std::vector<ObservableEvents_Type> events_to_observe_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT GetTraceStatsResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kTraceStatsFieldNumber = 1,
+  };
+
+  GetTraceStatsResponse();
+  ~GetTraceStatsResponse() override;
+  GetTraceStatsResponse(GetTraceStatsResponse&&) noexcept;
+  GetTraceStatsResponse& operator=(GetTraceStatsResponse&&);
+  GetTraceStatsResponse(const GetTraceStatsResponse&);
+  GetTraceStatsResponse& operator=(const GetTraceStatsResponse&);
+  bool operator==(const GetTraceStatsResponse&) const;
+  bool operator!=(const GetTraceStatsResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_trace_stats() const { return _has_field_[1]; }
+  const TraceStats& trace_stats() const { return *trace_stats_; }
+  TraceStats* mutable_trace_stats() { _has_field_.set(1); return trace_stats_.get(); }
+
+ private:
+  ::protozero::CopyablePtr<TraceStats> trace_stats_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT GetTraceStatsRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  GetTraceStatsRequest();
+  ~GetTraceStatsRequest() override;
+  GetTraceStatsRequest(GetTraceStatsRequest&&) noexcept;
+  GetTraceStatsRequest& operator=(GetTraceStatsRequest&&);
+  GetTraceStatsRequest(const GetTraceStatsRequest&);
+  GetTraceStatsRequest& operator=(const GetTraceStatsRequest&);
+  bool operator==(const GetTraceStatsRequest&) const;
+  bool operator!=(const GetTraceStatsRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT AttachResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kTraceConfigFieldNumber = 1,
+  };
+
+  AttachResponse();
+  ~AttachResponse() override;
+  AttachResponse(AttachResponse&&) noexcept;
+  AttachResponse& operator=(AttachResponse&&);
+  AttachResponse(const AttachResponse&);
+  AttachResponse& operator=(const AttachResponse&);
+  bool operator==(const AttachResponse&) const;
+  bool operator!=(const AttachResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_trace_config() const { return _has_field_[1]; }
+  const TraceConfig& trace_config() const { return *trace_config_; }
+  TraceConfig* mutable_trace_config() { _has_field_.set(1); return trace_config_.get(); }
+
+ private:
+  ::protozero::CopyablePtr<TraceConfig> trace_config_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT AttachRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kKeyFieldNumber = 1,
+  };
+
+  AttachRequest();
+  ~AttachRequest() override;
+  AttachRequest(AttachRequest&&) noexcept;
+  AttachRequest& operator=(AttachRequest&&);
+  AttachRequest(const AttachRequest&);
+  AttachRequest& operator=(const AttachRequest&);
+  bool operator==(const AttachRequest&) const;
+  bool operator!=(const AttachRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_key() const { return _has_field_[1]; }
+  const std::string& key() const { return key_; }
+  void set_key(const std::string& value) { key_ = value; _has_field_.set(1); }
+
+ private:
+  std::string key_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT DetachResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  DetachResponse();
+  ~DetachResponse() override;
+  DetachResponse(DetachResponse&&) noexcept;
+  DetachResponse& operator=(DetachResponse&&);
+  DetachResponse(const DetachResponse&);
+  DetachResponse& operator=(const DetachResponse&);
+  bool operator==(const DetachResponse&) const;
+  bool operator!=(const DetachResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT DetachRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kKeyFieldNumber = 1,
+  };
+
+  DetachRequest();
+  ~DetachRequest() override;
+  DetachRequest(DetachRequest&&) noexcept;
+  DetachRequest& operator=(DetachRequest&&);
+  DetachRequest(const DetachRequest&);
+  DetachRequest& operator=(const DetachRequest&);
+  bool operator==(const DetachRequest&) const;
+  bool operator!=(const DetachRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_key() const { return _has_field_[1]; }
+  const std::string& key() const { return key_; }
+  void set_key(const std::string& value) { key_ = value; _has_field_.set(1); }
+
+ private:
+  std::string key_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT FlushResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  FlushResponse();
+  ~FlushResponse() override;
+  FlushResponse(FlushResponse&&) noexcept;
+  FlushResponse& operator=(FlushResponse&&);
+  FlushResponse(const FlushResponse&);
+  FlushResponse& operator=(const FlushResponse&);
+  bool operator==(const FlushResponse&) const;
+  bool operator!=(const FlushResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT FlushRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kTimeoutMsFieldNumber = 1,
+  };
+
+  FlushRequest();
+  ~FlushRequest() override;
+  FlushRequest(FlushRequest&&) noexcept;
+  FlushRequest& operator=(FlushRequest&&);
+  FlushRequest(const FlushRequest&);
+  FlushRequest& operator=(const FlushRequest&);
+  bool operator==(const FlushRequest&) const;
+  bool operator!=(const FlushRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_timeout_ms() const { return _has_field_[1]; }
+  uint32_t timeout_ms() const { return timeout_ms_; }
+  void set_timeout_ms(uint32_t value) { timeout_ms_ = value; _has_field_.set(1); }
+
+ private:
+  uint32_t timeout_ms_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT FreeBuffersResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  FreeBuffersResponse();
+  ~FreeBuffersResponse() override;
+  FreeBuffersResponse(FreeBuffersResponse&&) noexcept;
+  FreeBuffersResponse& operator=(FreeBuffersResponse&&);
+  FreeBuffersResponse(const FreeBuffersResponse&);
+  FreeBuffersResponse& operator=(const FreeBuffersResponse&);
+  bool operator==(const FreeBuffersResponse&) const;
+  bool operator!=(const FreeBuffersResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT FreeBuffersRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kBufferIdsFieldNumber = 1,
+  };
+
+  FreeBuffersRequest();
+  ~FreeBuffersRequest() override;
+  FreeBuffersRequest(FreeBuffersRequest&&) noexcept;
+  FreeBuffersRequest& operator=(FreeBuffersRequest&&);
+  FreeBuffersRequest(const FreeBuffersRequest&);
+  FreeBuffersRequest& operator=(const FreeBuffersRequest&);
+  bool operator==(const FreeBuffersRequest&) const;
+  bool operator!=(const FreeBuffersRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<uint32_t>& buffer_ids() const { return buffer_ids_; }
+  std::vector<uint32_t>* mutable_buffer_ids() { return &buffer_ids_; }
+  int buffer_ids_size() const { return static_cast<int>(buffer_ids_.size()); }
+  void clear_buffer_ids() { buffer_ids_.clear(); }
+  void add_buffer_ids(uint32_t value) { buffer_ids_.emplace_back(value); }
+  uint32_t* add_buffer_ids() { buffer_ids_.emplace_back(); return &buffer_ids_.back(); }
+
+ private:
+  std::vector<uint32_t> buffer_ids_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ReadBuffersResponse : public ::protozero::CppMessageObj {
+ public:
+  using Slice = ReadBuffersResponse_Slice;
+  enum FieldNumbers {
+    kSlicesFieldNumber = 2,
+  };
+
+  ReadBuffersResponse();
+  ~ReadBuffersResponse() override;
+  ReadBuffersResponse(ReadBuffersResponse&&) noexcept;
+  ReadBuffersResponse& operator=(ReadBuffersResponse&&);
+  ReadBuffersResponse(const ReadBuffersResponse&);
+  ReadBuffersResponse& operator=(const ReadBuffersResponse&);
+  bool operator==(const ReadBuffersResponse&) const;
+  bool operator!=(const ReadBuffersResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<ReadBuffersResponse_Slice>& slices() const { return slices_; }
+  std::vector<ReadBuffersResponse_Slice>* mutable_slices() { return &slices_; }
+  int slices_size() const;
+  void clear_slices();
+  ReadBuffersResponse_Slice* add_slices();
+
+ private:
+  std::vector<ReadBuffersResponse_Slice> slices_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ReadBuffersResponse_Slice : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDataFieldNumber = 1,
+    kLastSliceForPacketFieldNumber = 2,
+  };
+
+  ReadBuffersResponse_Slice();
+  ~ReadBuffersResponse_Slice() override;
+  ReadBuffersResponse_Slice(ReadBuffersResponse_Slice&&) noexcept;
+  ReadBuffersResponse_Slice& operator=(ReadBuffersResponse_Slice&&);
+  ReadBuffersResponse_Slice(const ReadBuffersResponse_Slice&);
+  ReadBuffersResponse_Slice& operator=(const ReadBuffersResponse_Slice&);
+  bool operator==(const ReadBuffersResponse_Slice&) const;
+  bool operator!=(const ReadBuffersResponse_Slice& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_data() const { return _has_field_[1]; }
+  const std::string& data() const { return data_; }
+  void set_data(const std::string& value) { data_ = value; _has_field_.set(1); }
+  void set_data(const void* p, size_t s) { data_.assign(reinterpret_cast<const char*>(p), s); _has_field_.set(1); }
+
+  bool has_last_slice_for_packet() const { return _has_field_[2]; }
+  bool last_slice_for_packet() const { return last_slice_for_packet_; }
+  void set_last_slice_for_packet(bool value) { last_slice_for_packet_ = value; _has_field_.set(2); }
+
+ private:
+  std::string data_{};
+  bool last_slice_for_packet_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ReadBuffersRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  ReadBuffersRequest();
+  ~ReadBuffersRequest() override;
+  ReadBuffersRequest(ReadBuffersRequest&&) noexcept;
+  ReadBuffersRequest& operator=(ReadBuffersRequest&&);
+  ReadBuffersRequest(const ReadBuffersRequest&);
+  ReadBuffersRequest& operator=(const ReadBuffersRequest&);
+  bool operator==(const ReadBuffersRequest&) const;
+  bool operator!=(const ReadBuffersRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT DisableTracingResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  DisableTracingResponse();
+  ~DisableTracingResponse() override;
+  DisableTracingResponse(DisableTracingResponse&&) noexcept;
+  DisableTracingResponse& operator=(DisableTracingResponse&&);
+  DisableTracingResponse(const DisableTracingResponse&);
+  DisableTracingResponse& operator=(const DisableTracingResponse&);
+  bool operator==(const DisableTracingResponse&) const;
+  bool operator!=(const DisableTracingResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT DisableTracingRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  DisableTracingRequest();
+  ~DisableTracingRequest() override;
+  DisableTracingRequest(DisableTracingRequest&&) noexcept;
+  DisableTracingRequest& operator=(DisableTracingRequest&&);
+  DisableTracingRequest(const DisableTracingRequest&);
+  DisableTracingRequest& operator=(const DisableTracingRequest&);
+  bool operator==(const DisableTracingRequest&) const;
+  bool operator!=(const DisableTracingRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ChangeTraceConfigResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  ChangeTraceConfigResponse();
+  ~ChangeTraceConfigResponse() override;
+  ChangeTraceConfigResponse(ChangeTraceConfigResponse&&) noexcept;
+  ChangeTraceConfigResponse& operator=(ChangeTraceConfigResponse&&);
+  ChangeTraceConfigResponse(const ChangeTraceConfigResponse&);
+  ChangeTraceConfigResponse& operator=(const ChangeTraceConfigResponse&);
+  bool operator==(const ChangeTraceConfigResponse&) const;
+  bool operator!=(const ChangeTraceConfigResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ChangeTraceConfigRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kTraceConfigFieldNumber = 1,
+  };
+
+  ChangeTraceConfigRequest();
+  ~ChangeTraceConfigRequest() override;
+  ChangeTraceConfigRequest(ChangeTraceConfigRequest&&) noexcept;
+  ChangeTraceConfigRequest& operator=(ChangeTraceConfigRequest&&);
+  ChangeTraceConfigRequest(const ChangeTraceConfigRequest&);
+  ChangeTraceConfigRequest& operator=(const ChangeTraceConfigRequest&);
+  bool operator==(const ChangeTraceConfigRequest&) const;
+  bool operator!=(const ChangeTraceConfigRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_trace_config() const { return _has_field_[1]; }
+  const TraceConfig& trace_config() const { return *trace_config_; }
+  TraceConfig* mutable_trace_config() { _has_field_.set(1); return trace_config_.get(); }
+
+ private:
+  ::protozero::CopyablePtr<TraceConfig> trace_config_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT StartTracingResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  StartTracingResponse();
+  ~StartTracingResponse() override;
+  StartTracingResponse(StartTracingResponse&&) noexcept;
+  StartTracingResponse& operator=(StartTracingResponse&&);
+  StartTracingResponse(const StartTracingResponse&);
+  StartTracingResponse& operator=(const StartTracingResponse&);
+  bool operator==(const StartTracingResponse&) const;
+  bool operator!=(const StartTracingResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT StartTracingRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  StartTracingRequest();
+  ~StartTracingRequest() override;
+  StartTracingRequest(StartTracingRequest&&) noexcept;
+  StartTracingRequest& operator=(StartTracingRequest&&);
+  StartTracingRequest(const StartTracingRequest&);
+  StartTracingRequest& operator=(const StartTracingRequest&);
+  bool operator==(const StartTracingRequest&) const;
+  bool operator!=(const StartTracingRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT EnableTracingResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDisabledFieldNumber = 1,
+    kErrorFieldNumber = 3,
+  };
+
+  EnableTracingResponse();
+  ~EnableTracingResponse() override;
+  EnableTracingResponse(EnableTracingResponse&&) noexcept;
+  EnableTracingResponse& operator=(EnableTracingResponse&&);
+  EnableTracingResponse(const EnableTracingResponse&);
+  EnableTracingResponse& operator=(const EnableTracingResponse&);
+  bool operator==(const EnableTracingResponse&) const;
+  bool operator!=(const EnableTracingResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_disabled() const { return _has_field_[1]; }
+  bool disabled() const { return disabled_; }
+  void set_disabled(bool value) { disabled_ = value; _has_field_.set(1); }
+
+  bool has_error() const { return _has_field_[3]; }
+  const std::string& error() const { return error_; }
+  void set_error(const std::string& value) { error_ = value; _has_field_.set(3); }
+
+ private:
+  bool disabled_{};
+  std::string error_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<4> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT EnableTracingRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kTraceConfigFieldNumber = 1,
+    kAttachNotificationOnlyFieldNumber = 2,
+  };
+
+  EnableTracingRequest();
+  ~EnableTracingRequest() override;
+  EnableTracingRequest(EnableTracingRequest&&) noexcept;
+  EnableTracingRequest& operator=(EnableTracingRequest&&);
+  EnableTracingRequest(const EnableTracingRequest&);
+  EnableTracingRequest& operator=(const EnableTracingRequest&);
+  bool operator==(const EnableTracingRequest&) const;
+  bool operator!=(const EnableTracingRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_trace_config() const { return _has_field_[1]; }
+  const TraceConfig& trace_config() const { return *trace_config_; }
+  TraceConfig* mutable_trace_config() { _has_field_.set(1); return trace_config_.get(); }
+
+  bool has_attach_notification_only() const { return _has_field_[2]; }
+  bool attach_notification_only() const { return attach_notification_only_; }
+  void set_attach_notification_only(bool value) { attach_notification_only_ = value; _has_field_.set(2); }
+
+ private:
+  ::protozero::CopyablePtr<TraceConfig> trace_config_;
+  bool attach_notification_only_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_CONSUMER_PORT_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/ipc/producer_port.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_PRODUCER_PORT_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_PRODUCER_PORT_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class SyncResponse;
+class SyncRequest;
+class GetAsyncCommandResponse;
+class GetAsyncCommandResponse_ClearIncrementalState;
+class GetAsyncCommandResponse_Flush;
+class GetAsyncCommandResponse_StopDataSource;
+class GetAsyncCommandResponse_StartDataSource;
+class DataSourceConfig;
+class TestConfig;
+class TestConfig_DummyFields;
+class InterceptorConfig;
+class ChromeConfig;
+class GetAsyncCommandResponse_SetupDataSource;
+class GetAsyncCommandResponse_SetupTracing;
+class GetAsyncCommandRequest;
+class ActivateTriggersResponse;
+class ActivateTriggersRequest;
+class NotifyDataSourceStoppedResponse;
+class NotifyDataSourceStoppedRequest;
+class NotifyDataSourceStartedResponse;
+class NotifyDataSourceStartedRequest;
+class CommitDataResponse;
+class UnregisterTraceWriterResponse;
+class UnregisterTraceWriterRequest;
+class RegisterTraceWriterResponse;
+class RegisterTraceWriterRequest;
+class UnregisterDataSourceResponse;
+class UnregisterDataSourceRequest;
+class RegisterDataSourceResponse;
+class RegisterDataSourceRequest;
+class DataSourceDescriptor;
+class InitializeConnectionResponse;
+class InitializeConnectionRequest;
+enum DataSourceConfig_SessionInitiator : int;
+enum ChromeConfig_ClientPriority : int;
+enum InitializeConnectionRequest_ProducerSMBScrapingMode : int;
+enum InitializeConnectionRequest_ProducerBuildFlags : int;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+enum InitializeConnectionRequest_ProducerSMBScrapingMode : int {
+  InitializeConnectionRequest_ProducerSMBScrapingMode_SMB_SCRAPING_UNSPECIFIED = 0,
+  InitializeConnectionRequest_ProducerSMBScrapingMode_SMB_SCRAPING_ENABLED = 1,
+  InitializeConnectionRequest_ProducerSMBScrapingMode_SMB_SCRAPING_DISABLED = 2,
+};
+enum InitializeConnectionRequest_ProducerBuildFlags : int {
+  InitializeConnectionRequest_ProducerBuildFlags_BUILD_FLAGS_UNSPECIFIED = 0,
+  InitializeConnectionRequest_ProducerBuildFlags_BUILD_FLAGS_DCHECKS_ON = 1,
+  InitializeConnectionRequest_ProducerBuildFlags_BUILD_FLAGS_DCHECKS_OFF = 2,
+};
+
+class PERFETTO_EXPORT SyncResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  SyncResponse();
+  ~SyncResponse() override;
+  SyncResponse(SyncResponse&&) noexcept;
+  SyncResponse& operator=(SyncResponse&&);
+  SyncResponse(const SyncResponse&);
+  SyncResponse& operator=(const SyncResponse&);
+  bool operator==(const SyncResponse&) const;
+  bool operator!=(const SyncResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT SyncRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  SyncRequest();
+  ~SyncRequest() override;
+  SyncRequest(SyncRequest&&) noexcept;
+  SyncRequest& operator=(SyncRequest&&);
+  SyncRequest(const SyncRequest&);
+  SyncRequest& operator=(const SyncRequest&);
+  bool operator==(const SyncRequest&) const;
+  bool operator!=(const SyncRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT GetAsyncCommandResponse : public ::protozero::CppMessageObj {
+ public:
+  using SetupDataSource = GetAsyncCommandResponse_SetupDataSource;
+  using StartDataSource = GetAsyncCommandResponse_StartDataSource;
+  using StopDataSource = GetAsyncCommandResponse_StopDataSource;
+  using SetupTracing = GetAsyncCommandResponse_SetupTracing;
+  using Flush = GetAsyncCommandResponse_Flush;
+  using ClearIncrementalState = GetAsyncCommandResponse_ClearIncrementalState;
+  enum FieldNumbers {
+    kSetupTracingFieldNumber = 3,
+    kSetupDataSourceFieldNumber = 6,
+    kStartDataSourceFieldNumber = 1,
+    kStopDataSourceFieldNumber = 2,
+    kFlushFieldNumber = 5,
+    kClearIncrementalStateFieldNumber = 7,
+  };
+
+  GetAsyncCommandResponse();
+  ~GetAsyncCommandResponse() override;
+  GetAsyncCommandResponse(GetAsyncCommandResponse&&) noexcept;
+  GetAsyncCommandResponse& operator=(GetAsyncCommandResponse&&);
+  GetAsyncCommandResponse(const GetAsyncCommandResponse&);
+  GetAsyncCommandResponse& operator=(const GetAsyncCommandResponse&);
+  bool operator==(const GetAsyncCommandResponse&) const;
+  bool operator!=(const GetAsyncCommandResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_setup_tracing() const { return _has_field_[3]; }
+  const GetAsyncCommandResponse_SetupTracing& setup_tracing() const { return *setup_tracing_; }
+  GetAsyncCommandResponse_SetupTracing* mutable_setup_tracing() { _has_field_.set(3); return setup_tracing_.get(); }
+
+  bool has_setup_data_source() const { return _has_field_[6]; }
+  const GetAsyncCommandResponse_SetupDataSource& setup_data_source() const { return *setup_data_source_; }
+  GetAsyncCommandResponse_SetupDataSource* mutable_setup_data_source() { _has_field_.set(6); return setup_data_source_.get(); }
+
+  bool has_start_data_source() const { return _has_field_[1]; }
+  const GetAsyncCommandResponse_StartDataSource& start_data_source() const { return *start_data_source_; }
+  GetAsyncCommandResponse_StartDataSource* mutable_start_data_source() { _has_field_.set(1); return start_data_source_.get(); }
+
+  bool has_stop_data_source() const { return _has_field_[2]; }
+  const GetAsyncCommandResponse_StopDataSource& stop_data_source() const { return *stop_data_source_; }
+  GetAsyncCommandResponse_StopDataSource* mutable_stop_data_source() { _has_field_.set(2); return stop_data_source_.get(); }
+
+  bool has_flush() const { return _has_field_[5]; }
+  const GetAsyncCommandResponse_Flush& flush() const { return *flush_; }
+  GetAsyncCommandResponse_Flush* mutable_flush() { _has_field_.set(5); return flush_.get(); }
+
+  bool has_clear_incremental_state() const { return _has_field_[7]; }
+  const GetAsyncCommandResponse_ClearIncrementalState& clear_incremental_state() const { return *clear_incremental_state_; }
+  GetAsyncCommandResponse_ClearIncrementalState* mutable_clear_incremental_state() { _has_field_.set(7); return clear_incremental_state_.get(); }
+
+ private:
+  ::protozero::CopyablePtr<GetAsyncCommandResponse_SetupTracing> setup_tracing_;
+  ::protozero::CopyablePtr<GetAsyncCommandResponse_SetupDataSource> setup_data_source_;
+  ::protozero::CopyablePtr<GetAsyncCommandResponse_StartDataSource> start_data_source_;
+  ::protozero::CopyablePtr<GetAsyncCommandResponse_StopDataSource> stop_data_source_;
+  ::protozero::CopyablePtr<GetAsyncCommandResponse_Flush> flush_;
+  ::protozero::CopyablePtr<GetAsyncCommandResponse_ClearIncrementalState> clear_incremental_state_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<8> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT GetAsyncCommandResponse_ClearIncrementalState : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDataSourceIdsFieldNumber = 1,
+  };
+
+  GetAsyncCommandResponse_ClearIncrementalState();
+  ~GetAsyncCommandResponse_ClearIncrementalState() override;
+  GetAsyncCommandResponse_ClearIncrementalState(GetAsyncCommandResponse_ClearIncrementalState&&) noexcept;
+  GetAsyncCommandResponse_ClearIncrementalState& operator=(GetAsyncCommandResponse_ClearIncrementalState&&);
+  GetAsyncCommandResponse_ClearIncrementalState(const GetAsyncCommandResponse_ClearIncrementalState&);
+  GetAsyncCommandResponse_ClearIncrementalState& operator=(const GetAsyncCommandResponse_ClearIncrementalState&);
+  bool operator==(const GetAsyncCommandResponse_ClearIncrementalState&) const;
+  bool operator!=(const GetAsyncCommandResponse_ClearIncrementalState& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<uint64_t>& data_source_ids() const { return data_source_ids_; }
+  std::vector<uint64_t>* mutable_data_source_ids() { return &data_source_ids_; }
+  int data_source_ids_size() const { return static_cast<int>(data_source_ids_.size()); }
+  void clear_data_source_ids() { data_source_ids_.clear(); }
+  void add_data_source_ids(uint64_t value) { data_source_ids_.emplace_back(value); }
+  uint64_t* add_data_source_ids() { data_source_ids_.emplace_back(); return &data_source_ids_.back(); }
+
+ private:
+  std::vector<uint64_t> data_source_ids_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT GetAsyncCommandResponse_Flush : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDataSourceIdsFieldNumber = 1,
+    kRequestIdFieldNumber = 2,
+  };
+
+  GetAsyncCommandResponse_Flush();
+  ~GetAsyncCommandResponse_Flush() override;
+  GetAsyncCommandResponse_Flush(GetAsyncCommandResponse_Flush&&) noexcept;
+  GetAsyncCommandResponse_Flush& operator=(GetAsyncCommandResponse_Flush&&);
+  GetAsyncCommandResponse_Flush(const GetAsyncCommandResponse_Flush&);
+  GetAsyncCommandResponse_Flush& operator=(const GetAsyncCommandResponse_Flush&);
+  bool operator==(const GetAsyncCommandResponse_Flush&) const;
+  bool operator!=(const GetAsyncCommandResponse_Flush& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<uint64_t>& data_source_ids() const { return data_source_ids_; }
+  std::vector<uint64_t>* mutable_data_source_ids() { return &data_source_ids_; }
+  int data_source_ids_size() const { return static_cast<int>(data_source_ids_.size()); }
+  void clear_data_source_ids() { data_source_ids_.clear(); }
+  void add_data_source_ids(uint64_t value) { data_source_ids_.emplace_back(value); }
+  uint64_t* add_data_source_ids() { data_source_ids_.emplace_back(); return &data_source_ids_.back(); }
+
+  bool has_request_id() const { return _has_field_[2]; }
+  uint64_t request_id() const { return request_id_; }
+  void set_request_id(uint64_t value) { request_id_ = value; _has_field_.set(2); }
+
+ private:
+  std::vector<uint64_t> data_source_ids_;
+  uint64_t request_id_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT GetAsyncCommandResponse_StopDataSource : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kInstanceIdFieldNumber = 1,
+  };
+
+  GetAsyncCommandResponse_StopDataSource();
+  ~GetAsyncCommandResponse_StopDataSource() override;
+  GetAsyncCommandResponse_StopDataSource(GetAsyncCommandResponse_StopDataSource&&) noexcept;
+  GetAsyncCommandResponse_StopDataSource& operator=(GetAsyncCommandResponse_StopDataSource&&);
+  GetAsyncCommandResponse_StopDataSource(const GetAsyncCommandResponse_StopDataSource&);
+  GetAsyncCommandResponse_StopDataSource& operator=(const GetAsyncCommandResponse_StopDataSource&);
+  bool operator==(const GetAsyncCommandResponse_StopDataSource&) const;
+  bool operator!=(const GetAsyncCommandResponse_StopDataSource& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_instance_id() const { return _has_field_[1]; }
+  uint64_t instance_id() const { return instance_id_; }
+  void set_instance_id(uint64_t value) { instance_id_ = value; _has_field_.set(1); }
+
+ private:
+  uint64_t instance_id_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT GetAsyncCommandResponse_StartDataSource : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNewInstanceIdFieldNumber = 1,
+    kConfigFieldNumber = 2,
+  };
+
+  GetAsyncCommandResponse_StartDataSource();
+  ~GetAsyncCommandResponse_StartDataSource() override;
+  GetAsyncCommandResponse_StartDataSource(GetAsyncCommandResponse_StartDataSource&&) noexcept;
+  GetAsyncCommandResponse_StartDataSource& operator=(GetAsyncCommandResponse_StartDataSource&&);
+  GetAsyncCommandResponse_StartDataSource(const GetAsyncCommandResponse_StartDataSource&);
+  GetAsyncCommandResponse_StartDataSource& operator=(const GetAsyncCommandResponse_StartDataSource&);
+  bool operator==(const GetAsyncCommandResponse_StartDataSource&) const;
+  bool operator!=(const GetAsyncCommandResponse_StartDataSource& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_new_instance_id() const { return _has_field_[1]; }
+  uint64_t new_instance_id() const { return new_instance_id_; }
+  void set_new_instance_id(uint64_t value) { new_instance_id_ = value; _has_field_.set(1); }
+
+  bool has_config() const { return _has_field_[2]; }
+  const DataSourceConfig& config() const { return *config_; }
+  DataSourceConfig* mutable_config() { _has_field_.set(2); return config_.get(); }
+
+ private:
+  uint64_t new_instance_id_{};
+  ::protozero::CopyablePtr<DataSourceConfig> config_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT GetAsyncCommandResponse_SetupDataSource : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kNewInstanceIdFieldNumber = 1,
+    kConfigFieldNumber = 2,
+  };
+
+  GetAsyncCommandResponse_SetupDataSource();
+  ~GetAsyncCommandResponse_SetupDataSource() override;
+  GetAsyncCommandResponse_SetupDataSource(GetAsyncCommandResponse_SetupDataSource&&) noexcept;
+  GetAsyncCommandResponse_SetupDataSource& operator=(GetAsyncCommandResponse_SetupDataSource&&);
+  GetAsyncCommandResponse_SetupDataSource(const GetAsyncCommandResponse_SetupDataSource&);
+  GetAsyncCommandResponse_SetupDataSource& operator=(const GetAsyncCommandResponse_SetupDataSource&);
+  bool operator==(const GetAsyncCommandResponse_SetupDataSource&) const;
+  bool operator!=(const GetAsyncCommandResponse_SetupDataSource& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_new_instance_id() const { return _has_field_[1]; }
+  uint64_t new_instance_id() const { return new_instance_id_; }
+  void set_new_instance_id(uint64_t value) { new_instance_id_ = value; _has_field_.set(1); }
+
+  bool has_config() const { return _has_field_[2]; }
+  const DataSourceConfig& config() const { return *config_; }
+  DataSourceConfig* mutable_config() { _has_field_.set(2); return config_.get(); }
+
+ private:
+  uint64_t new_instance_id_{};
+  ::protozero::CopyablePtr<DataSourceConfig> config_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT GetAsyncCommandResponse_SetupTracing : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kSharedBufferPageSizeKbFieldNumber = 1,
+  };
+
+  GetAsyncCommandResponse_SetupTracing();
+  ~GetAsyncCommandResponse_SetupTracing() override;
+  GetAsyncCommandResponse_SetupTracing(GetAsyncCommandResponse_SetupTracing&&) noexcept;
+  GetAsyncCommandResponse_SetupTracing& operator=(GetAsyncCommandResponse_SetupTracing&&);
+  GetAsyncCommandResponse_SetupTracing(const GetAsyncCommandResponse_SetupTracing&);
+  GetAsyncCommandResponse_SetupTracing& operator=(const GetAsyncCommandResponse_SetupTracing&);
+  bool operator==(const GetAsyncCommandResponse_SetupTracing&) const;
+  bool operator!=(const GetAsyncCommandResponse_SetupTracing& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_shared_buffer_page_size_kb() const { return _has_field_[1]; }
+  uint32_t shared_buffer_page_size_kb() const { return shared_buffer_page_size_kb_; }
+  void set_shared_buffer_page_size_kb(uint32_t value) { shared_buffer_page_size_kb_ = value; _has_field_.set(1); }
+
+ private:
+  uint32_t shared_buffer_page_size_kb_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT GetAsyncCommandRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  GetAsyncCommandRequest();
+  ~GetAsyncCommandRequest() override;
+  GetAsyncCommandRequest(GetAsyncCommandRequest&&) noexcept;
+  GetAsyncCommandRequest& operator=(GetAsyncCommandRequest&&);
+  GetAsyncCommandRequest(const GetAsyncCommandRequest&);
+  GetAsyncCommandRequest& operator=(const GetAsyncCommandRequest&);
+  bool operator==(const GetAsyncCommandRequest&) const;
+  bool operator!=(const GetAsyncCommandRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ActivateTriggersResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  ActivateTriggersResponse();
+  ~ActivateTriggersResponse() override;
+  ActivateTriggersResponse(ActivateTriggersResponse&&) noexcept;
+  ActivateTriggersResponse& operator=(ActivateTriggersResponse&&);
+  ActivateTriggersResponse(const ActivateTriggersResponse&);
+  ActivateTriggersResponse& operator=(const ActivateTriggersResponse&);
+  bool operator==(const ActivateTriggersResponse&) const;
+  bool operator!=(const ActivateTriggersResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT ActivateTriggersRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kTriggerNamesFieldNumber = 1,
+  };
+
+  ActivateTriggersRequest();
+  ~ActivateTriggersRequest() override;
+  ActivateTriggersRequest(ActivateTriggersRequest&&) noexcept;
+  ActivateTriggersRequest& operator=(ActivateTriggersRequest&&);
+  ActivateTriggersRequest(const ActivateTriggersRequest&);
+  ActivateTriggersRequest& operator=(const ActivateTriggersRequest&);
+  bool operator==(const ActivateTriggersRequest&) const;
+  bool operator!=(const ActivateTriggersRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  const std::vector<std::string>& trigger_names() const { return trigger_names_; }
+  std::vector<std::string>* mutable_trigger_names() { return &trigger_names_; }
+  int trigger_names_size() const { return static_cast<int>(trigger_names_.size()); }
+  void clear_trigger_names() { trigger_names_.clear(); }
+  void add_trigger_names(std::string value) { trigger_names_.emplace_back(value); }
+  std::string* add_trigger_names() { trigger_names_.emplace_back(); return &trigger_names_.back(); }
+
+ private:
+  std::vector<std::string> trigger_names_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT NotifyDataSourceStoppedResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  NotifyDataSourceStoppedResponse();
+  ~NotifyDataSourceStoppedResponse() override;
+  NotifyDataSourceStoppedResponse(NotifyDataSourceStoppedResponse&&) noexcept;
+  NotifyDataSourceStoppedResponse& operator=(NotifyDataSourceStoppedResponse&&);
+  NotifyDataSourceStoppedResponse(const NotifyDataSourceStoppedResponse&);
+  NotifyDataSourceStoppedResponse& operator=(const NotifyDataSourceStoppedResponse&);
+  bool operator==(const NotifyDataSourceStoppedResponse&) const;
+  bool operator!=(const NotifyDataSourceStoppedResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT NotifyDataSourceStoppedRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDataSourceIdFieldNumber = 1,
+  };
+
+  NotifyDataSourceStoppedRequest();
+  ~NotifyDataSourceStoppedRequest() override;
+  NotifyDataSourceStoppedRequest(NotifyDataSourceStoppedRequest&&) noexcept;
+  NotifyDataSourceStoppedRequest& operator=(NotifyDataSourceStoppedRequest&&);
+  NotifyDataSourceStoppedRequest(const NotifyDataSourceStoppedRequest&);
+  NotifyDataSourceStoppedRequest& operator=(const NotifyDataSourceStoppedRequest&);
+  bool operator==(const NotifyDataSourceStoppedRequest&) const;
+  bool operator!=(const NotifyDataSourceStoppedRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_data_source_id() const { return _has_field_[1]; }
+  uint64_t data_source_id() const { return data_source_id_; }
+  void set_data_source_id(uint64_t value) { data_source_id_ = value; _has_field_.set(1); }
+
+ private:
+  uint64_t data_source_id_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT NotifyDataSourceStartedResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  NotifyDataSourceStartedResponse();
+  ~NotifyDataSourceStartedResponse() override;
+  NotifyDataSourceStartedResponse(NotifyDataSourceStartedResponse&&) noexcept;
+  NotifyDataSourceStartedResponse& operator=(NotifyDataSourceStartedResponse&&);
+  NotifyDataSourceStartedResponse(const NotifyDataSourceStartedResponse&);
+  NotifyDataSourceStartedResponse& operator=(const NotifyDataSourceStartedResponse&);
+  bool operator==(const NotifyDataSourceStartedResponse&) const;
+  bool operator!=(const NotifyDataSourceStartedResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT NotifyDataSourceStartedRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDataSourceIdFieldNumber = 1,
+  };
+
+  NotifyDataSourceStartedRequest();
+  ~NotifyDataSourceStartedRequest() override;
+  NotifyDataSourceStartedRequest(NotifyDataSourceStartedRequest&&) noexcept;
+  NotifyDataSourceStartedRequest& operator=(NotifyDataSourceStartedRequest&&);
+  NotifyDataSourceStartedRequest(const NotifyDataSourceStartedRequest&);
+  NotifyDataSourceStartedRequest& operator=(const NotifyDataSourceStartedRequest&);
+  bool operator==(const NotifyDataSourceStartedRequest&) const;
+  bool operator!=(const NotifyDataSourceStartedRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_data_source_id() const { return _has_field_[1]; }
+  uint64_t data_source_id() const { return data_source_id_; }
+  void set_data_source_id(uint64_t value) { data_source_id_ = value; _has_field_.set(1); }
+
+ private:
+  uint64_t data_source_id_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT CommitDataResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  CommitDataResponse();
+  ~CommitDataResponse() override;
+  CommitDataResponse(CommitDataResponse&&) noexcept;
+  CommitDataResponse& operator=(CommitDataResponse&&);
+  CommitDataResponse(const CommitDataResponse&);
+  CommitDataResponse& operator=(const CommitDataResponse&);
+  bool operator==(const CommitDataResponse&) const;
+  bool operator!=(const CommitDataResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT UnregisterTraceWriterResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  UnregisterTraceWriterResponse();
+  ~UnregisterTraceWriterResponse() override;
+  UnregisterTraceWriterResponse(UnregisterTraceWriterResponse&&) noexcept;
+  UnregisterTraceWriterResponse& operator=(UnregisterTraceWriterResponse&&);
+  UnregisterTraceWriterResponse(const UnregisterTraceWriterResponse&);
+  UnregisterTraceWriterResponse& operator=(const UnregisterTraceWriterResponse&);
+  bool operator==(const UnregisterTraceWriterResponse&) const;
+  bool operator!=(const UnregisterTraceWriterResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT UnregisterTraceWriterRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kTraceWriterIdFieldNumber = 1,
+  };
+
+  UnregisterTraceWriterRequest();
+  ~UnregisterTraceWriterRequest() override;
+  UnregisterTraceWriterRequest(UnregisterTraceWriterRequest&&) noexcept;
+  UnregisterTraceWriterRequest& operator=(UnregisterTraceWriterRequest&&);
+  UnregisterTraceWriterRequest(const UnregisterTraceWriterRequest&);
+  UnregisterTraceWriterRequest& operator=(const UnregisterTraceWriterRequest&);
+  bool operator==(const UnregisterTraceWriterRequest&) const;
+  bool operator!=(const UnregisterTraceWriterRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_trace_writer_id() const { return _has_field_[1]; }
+  uint32_t trace_writer_id() const { return trace_writer_id_; }
+  void set_trace_writer_id(uint32_t value) { trace_writer_id_ = value; _has_field_.set(1); }
+
+ private:
+  uint32_t trace_writer_id_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT RegisterTraceWriterResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  RegisterTraceWriterResponse();
+  ~RegisterTraceWriterResponse() override;
+  RegisterTraceWriterResponse(RegisterTraceWriterResponse&&) noexcept;
+  RegisterTraceWriterResponse& operator=(RegisterTraceWriterResponse&&);
+  RegisterTraceWriterResponse(const RegisterTraceWriterResponse&);
+  RegisterTraceWriterResponse& operator=(const RegisterTraceWriterResponse&);
+  bool operator==(const RegisterTraceWriterResponse&) const;
+  bool operator!=(const RegisterTraceWriterResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT RegisterTraceWriterRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kTraceWriterIdFieldNumber = 1,
+    kTargetBufferFieldNumber = 2,
+  };
+
+  RegisterTraceWriterRequest();
+  ~RegisterTraceWriterRequest() override;
+  RegisterTraceWriterRequest(RegisterTraceWriterRequest&&) noexcept;
+  RegisterTraceWriterRequest& operator=(RegisterTraceWriterRequest&&);
+  RegisterTraceWriterRequest(const RegisterTraceWriterRequest&);
+  RegisterTraceWriterRequest& operator=(const RegisterTraceWriterRequest&);
+  bool operator==(const RegisterTraceWriterRequest&) const;
+  bool operator!=(const RegisterTraceWriterRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_trace_writer_id() const { return _has_field_[1]; }
+  uint32_t trace_writer_id() const { return trace_writer_id_; }
+  void set_trace_writer_id(uint32_t value) { trace_writer_id_ = value; _has_field_.set(1); }
+
+  bool has_target_buffer() const { return _has_field_[2]; }
+  uint32_t target_buffer() const { return target_buffer_; }
+  void set_target_buffer(uint32_t value) { target_buffer_ = value; _has_field_.set(2); }
+
+ private:
+  uint32_t trace_writer_id_{};
+  uint32_t target_buffer_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT UnregisterDataSourceResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+  };
+
+  UnregisterDataSourceResponse();
+  ~UnregisterDataSourceResponse() override;
+  UnregisterDataSourceResponse(UnregisterDataSourceResponse&&) noexcept;
+  UnregisterDataSourceResponse& operator=(UnregisterDataSourceResponse&&);
+  UnregisterDataSourceResponse(const UnregisterDataSourceResponse&);
+  UnregisterDataSourceResponse& operator=(const UnregisterDataSourceResponse&);
+  bool operator==(const UnregisterDataSourceResponse&) const;
+  bool operator!=(const UnregisterDataSourceResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+ private:
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT UnregisterDataSourceRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDataSourceNameFieldNumber = 1,
+  };
+
+  UnregisterDataSourceRequest();
+  ~UnregisterDataSourceRequest() override;
+  UnregisterDataSourceRequest(UnregisterDataSourceRequest&&) noexcept;
+  UnregisterDataSourceRequest& operator=(UnregisterDataSourceRequest&&);
+  UnregisterDataSourceRequest(const UnregisterDataSourceRequest&);
+  UnregisterDataSourceRequest& operator=(const UnregisterDataSourceRequest&);
+  bool operator==(const UnregisterDataSourceRequest&) const;
+  bool operator!=(const UnregisterDataSourceRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_data_source_name() const { return _has_field_[1]; }
+  const std::string& data_source_name() const { return data_source_name_; }
+  void set_data_source_name(const std::string& value) { data_source_name_ = value; _has_field_.set(1); }
+
+ private:
+  std::string data_source_name_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT RegisterDataSourceResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kErrorFieldNumber = 1,
+  };
+
+  RegisterDataSourceResponse();
+  ~RegisterDataSourceResponse() override;
+  RegisterDataSourceResponse(RegisterDataSourceResponse&&) noexcept;
+  RegisterDataSourceResponse& operator=(RegisterDataSourceResponse&&);
+  RegisterDataSourceResponse(const RegisterDataSourceResponse&);
+  RegisterDataSourceResponse& operator=(const RegisterDataSourceResponse&);
+  bool operator==(const RegisterDataSourceResponse&) const;
+  bool operator!=(const RegisterDataSourceResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_error() const { return _has_field_[1]; }
+  const std::string& error() const { return error_; }
+  void set_error(const std::string& value) { error_ = value; _has_field_.set(1); }
+
+ private:
+  std::string error_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT RegisterDataSourceRequest : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kDataSourceDescriptorFieldNumber = 1,
+  };
+
+  RegisterDataSourceRequest();
+  ~RegisterDataSourceRequest() override;
+  RegisterDataSourceRequest(RegisterDataSourceRequest&&) noexcept;
+  RegisterDataSourceRequest& operator=(RegisterDataSourceRequest&&);
+  RegisterDataSourceRequest(const RegisterDataSourceRequest&);
+  RegisterDataSourceRequest& operator=(const RegisterDataSourceRequest&);
+  bool operator==(const RegisterDataSourceRequest&) const;
+  bool operator!=(const RegisterDataSourceRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_data_source_descriptor() const { return _has_field_[1]; }
+  const DataSourceDescriptor& data_source_descriptor() const { return *data_source_descriptor_; }
+  DataSourceDescriptor* mutable_data_source_descriptor() { _has_field_.set(1); return data_source_descriptor_.get(); }
+
+ private:
+  ::protozero::CopyablePtr<DataSourceDescriptor> data_source_descriptor_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT InitializeConnectionResponse : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kUsingShmemProvidedByProducerFieldNumber = 1,
+    kDirectSmbPatchingSupportedFieldNumber = 2,
+  };
+
+  InitializeConnectionResponse();
+  ~InitializeConnectionResponse() override;
+  InitializeConnectionResponse(InitializeConnectionResponse&&) noexcept;
+  InitializeConnectionResponse& operator=(InitializeConnectionResponse&&);
+  InitializeConnectionResponse(const InitializeConnectionResponse&);
+  InitializeConnectionResponse& operator=(const InitializeConnectionResponse&);
+  bool operator==(const InitializeConnectionResponse&) const;
+  bool operator!=(const InitializeConnectionResponse& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_using_shmem_provided_by_producer() const { return _has_field_[1]; }
+  bool using_shmem_provided_by_producer() const { return using_shmem_provided_by_producer_; }
+  void set_using_shmem_provided_by_producer(bool value) { using_shmem_provided_by_producer_ = value; _has_field_.set(1); }
+
+  bool has_direct_smb_patching_supported() const { return _has_field_[2]; }
+  bool direct_smb_patching_supported() const { return direct_smb_patching_supported_; }
+  void set_direct_smb_patching_supported(bool value) { direct_smb_patching_supported_ = value; _has_field_.set(2); }
+
+ private:
+  bool using_shmem_provided_by_producer_{};
+  bool direct_smb_patching_supported_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT InitializeConnectionRequest : public ::protozero::CppMessageObj {
+ public:
+  using ProducerSMBScrapingMode = InitializeConnectionRequest_ProducerSMBScrapingMode;
+  static constexpr auto SMB_SCRAPING_UNSPECIFIED = InitializeConnectionRequest_ProducerSMBScrapingMode_SMB_SCRAPING_UNSPECIFIED;
+  static constexpr auto SMB_SCRAPING_ENABLED = InitializeConnectionRequest_ProducerSMBScrapingMode_SMB_SCRAPING_ENABLED;
+  static constexpr auto SMB_SCRAPING_DISABLED = InitializeConnectionRequest_ProducerSMBScrapingMode_SMB_SCRAPING_DISABLED;
+  static constexpr auto ProducerSMBScrapingMode_MIN = InitializeConnectionRequest_ProducerSMBScrapingMode_SMB_SCRAPING_UNSPECIFIED;
+  static constexpr auto ProducerSMBScrapingMode_MAX = InitializeConnectionRequest_ProducerSMBScrapingMode_SMB_SCRAPING_DISABLED;
+  using ProducerBuildFlags = InitializeConnectionRequest_ProducerBuildFlags;
+  static constexpr auto BUILD_FLAGS_UNSPECIFIED = InitializeConnectionRequest_ProducerBuildFlags_BUILD_FLAGS_UNSPECIFIED;
+  static constexpr auto BUILD_FLAGS_DCHECKS_ON = InitializeConnectionRequest_ProducerBuildFlags_BUILD_FLAGS_DCHECKS_ON;
+  static constexpr auto BUILD_FLAGS_DCHECKS_OFF = InitializeConnectionRequest_ProducerBuildFlags_BUILD_FLAGS_DCHECKS_OFF;
+  static constexpr auto ProducerBuildFlags_MIN = InitializeConnectionRequest_ProducerBuildFlags_BUILD_FLAGS_UNSPECIFIED;
+  static constexpr auto ProducerBuildFlags_MAX = InitializeConnectionRequest_ProducerBuildFlags_BUILD_FLAGS_DCHECKS_OFF;
+  enum FieldNumbers {
+    kSharedMemoryPageSizeHintBytesFieldNumber = 1,
+    kSharedMemorySizeHintBytesFieldNumber = 2,
+    kProducerNameFieldNumber = 3,
+    kSmbScrapingModeFieldNumber = 4,
+    kBuildFlagsFieldNumber = 5,
+    kProducerProvidedShmemFieldNumber = 6,
+    kSdkVersionFieldNumber = 8,
+  };
+
+  InitializeConnectionRequest();
+  ~InitializeConnectionRequest() override;
+  InitializeConnectionRequest(InitializeConnectionRequest&&) noexcept;
+  InitializeConnectionRequest& operator=(InitializeConnectionRequest&&);
+  InitializeConnectionRequest(const InitializeConnectionRequest&);
+  InitializeConnectionRequest& operator=(const InitializeConnectionRequest&);
+  bool operator==(const InitializeConnectionRequest&) const;
+  bool operator!=(const InitializeConnectionRequest& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_shared_memory_page_size_hint_bytes() const { return _has_field_[1]; }
+  uint32_t shared_memory_page_size_hint_bytes() const { return shared_memory_page_size_hint_bytes_; }
+  void set_shared_memory_page_size_hint_bytes(uint32_t value) { shared_memory_page_size_hint_bytes_ = value; _has_field_.set(1); }
+
+  bool has_shared_memory_size_hint_bytes() const { return _has_field_[2]; }
+  uint32_t shared_memory_size_hint_bytes() const { return shared_memory_size_hint_bytes_; }
+  void set_shared_memory_size_hint_bytes(uint32_t value) { shared_memory_size_hint_bytes_ = value; _has_field_.set(2); }
+
+  bool has_producer_name() const { return _has_field_[3]; }
+  const std::string& producer_name() const { return producer_name_; }
+  void set_producer_name(const std::string& value) { producer_name_ = value; _has_field_.set(3); }
+
+  bool has_smb_scraping_mode() const { return _has_field_[4]; }
+  InitializeConnectionRequest_ProducerSMBScrapingMode smb_scraping_mode() const { return smb_scraping_mode_; }
+  void set_smb_scraping_mode(InitializeConnectionRequest_ProducerSMBScrapingMode value) { smb_scraping_mode_ = value; _has_field_.set(4); }
+
+  bool has_build_flags() const { return _has_field_[5]; }
+  InitializeConnectionRequest_ProducerBuildFlags build_flags() const { return build_flags_; }
+  void set_build_flags(InitializeConnectionRequest_ProducerBuildFlags value) { build_flags_ = value; _has_field_.set(5); }
+
+  bool has_producer_provided_shmem() const { return _has_field_[6]; }
+  bool producer_provided_shmem() const { return producer_provided_shmem_; }
+  void set_producer_provided_shmem(bool value) { producer_provided_shmem_ = value; _has_field_.set(6); }
+
+  bool has_sdk_version() const { return _has_field_[8]; }
+  const std::string& sdk_version() const { return sdk_version_; }
+  void set_sdk_version(const std::string& value) { sdk_version_ = value; _has_field_.set(8); }
+
+ private:
+  uint32_t shared_memory_page_size_hint_bytes_{};
+  uint32_t shared_memory_size_hint_bytes_{};
+  std::string producer_name_{};
+  InitializeConnectionRequest_ProducerSMBScrapingMode smb_scraping_mode_{};
+  InitializeConnectionRequest_ProducerBuildFlags build_flags_{};
+  bool producer_provided_shmem_{};
+  std::string sdk_version_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<9> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_PRODUCER_PORT_PROTO_CPP_H_
+// gen_amalgamated begin header: gen/protos/perfetto/ipc/wire_protocol.gen.h
+// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
+#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_WIRE_PROTOCOL_PROTO_CPP_H_
+#define PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_WIRE_PROTOCOL_PROTO_CPP_H_
+
+#include <stdint.h>
+#include <bitset>
+#include <vector>
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+class IPCFrame;
+class IPCFrame_RequestError;
+class IPCFrame_InvokeMethodReply;
+class IPCFrame_InvokeMethod;
+class IPCFrame_BindServiceReply;
+class IPCFrame_BindServiceReply_MethodInfo;
+class IPCFrame_BindService;
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+namespace protozero {
+class Message;
+}  // namespace protozero
+
+namespace perfetto {
+namespace protos {
+namespace gen {
+
+class PERFETTO_EXPORT IPCFrame : public ::protozero::CppMessageObj {
+ public:
+  using BindService = IPCFrame_BindService;
+  using BindServiceReply = IPCFrame_BindServiceReply;
+  using InvokeMethod = IPCFrame_InvokeMethod;
+  using InvokeMethodReply = IPCFrame_InvokeMethodReply;
+  using RequestError = IPCFrame_RequestError;
+  enum FieldNumbers {
+    kRequestIdFieldNumber = 2,
+    kMsgBindServiceFieldNumber = 3,
+    kMsgBindServiceReplyFieldNumber = 4,
+    kMsgInvokeMethodFieldNumber = 5,
+    kMsgInvokeMethodReplyFieldNumber = 6,
+    kMsgRequestErrorFieldNumber = 7,
+    kDataForTestingFieldNumber = 1,
+  };
+
+  IPCFrame();
+  ~IPCFrame() override;
+  IPCFrame(IPCFrame&&) noexcept;
+  IPCFrame& operator=(IPCFrame&&);
+  IPCFrame(const IPCFrame&);
+  IPCFrame& operator=(const IPCFrame&);
+  bool operator==(const IPCFrame&) const;
+  bool operator!=(const IPCFrame& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_request_id() const { return _has_field_[2]; }
+  uint64_t request_id() const { return request_id_; }
+  void set_request_id(uint64_t value) { request_id_ = value; _has_field_.set(2); }
+
+  bool has_msg_bind_service() const { return _has_field_[3]; }
+  const IPCFrame_BindService& msg_bind_service() const { return *msg_bind_service_; }
+  IPCFrame_BindService* mutable_msg_bind_service() { _has_field_.set(3); return msg_bind_service_.get(); }
+
+  bool has_msg_bind_service_reply() const { return _has_field_[4]; }
+  const IPCFrame_BindServiceReply& msg_bind_service_reply() const { return *msg_bind_service_reply_; }
+  IPCFrame_BindServiceReply* mutable_msg_bind_service_reply() { _has_field_.set(4); return msg_bind_service_reply_.get(); }
+
+  bool has_msg_invoke_method() const { return _has_field_[5]; }
+  const IPCFrame_InvokeMethod& msg_invoke_method() const { return *msg_invoke_method_; }
+  IPCFrame_InvokeMethod* mutable_msg_invoke_method() { _has_field_.set(5); return msg_invoke_method_.get(); }
+
+  bool has_msg_invoke_method_reply() const { return _has_field_[6]; }
+  const IPCFrame_InvokeMethodReply& msg_invoke_method_reply() const { return *msg_invoke_method_reply_; }
+  IPCFrame_InvokeMethodReply* mutable_msg_invoke_method_reply() { _has_field_.set(6); return msg_invoke_method_reply_.get(); }
+
+  bool has_msg_request_error() const { return _has_field_[7]; }
+  const IPCFrame_RequestError& msg_request_error() const { return *msg_request_error_; }
+  IPCFrame_RequestError* mutable_msg_request_error() { _has_field_.set(7); return msg_request_error_.get(); }
+
+  const std::vector<std::string>& data_for_testing() const { return data_for_testing_; }
+  std::vector<std::string>* mutable_data_for_testing() { return &data_for_testing_; }
+  int data_for_testing_size() const { return static_cast<int>(data_for_testing_.size()); }
+  void clear_data_for_testing() { data_for_testing_.clear(); }
+  void add_data_for_testing(std::string value) { data_for_testing_.emplace_back(value); }
+  std::string* add_data_for_testing() { data_for_testing_.emplace_back(); return &data_for_testing_.back(); }
+
+ private:
+  uint64_t request_id_{};
+  ::protozero::CopyablePtr<IPCFrame_BindService> msg_bind_service_;
+  ::protozero::CopyablePtr<IPCFrame_BindServiceReply> msg_bind_service_reply_;
+  ::protozero::CopyablePtr<IPCFrame_InvokeMethod> msg_invoke_method_;
+  ::protozero::CopyablePtr<IPCFrame_InvokeMethodReply> msg_invoke_method_reply_;
+  ::protozero::CopyablePtr<IPCFrame_RequestError> msg_request_error_;
+  std::vector<std::string> data_for_testing_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<8> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT IPCFrame_RequestError : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kErrorFieldNumber = 1,
+  };
+
+  IPCFrame_RequestError();
+  ~IPCFrame_RequestError() override;
+  IPCFrame_RequestError(IPCFrame_RequestError&&) noexcept;
+  IPCFrame_RequestError& operator=(IPCFrame_RequestError&&);
+  IPCFrame_RequestError(const IPCFrame_RequestError&);
+  IPCFrame_RequestError& operator=(const IPCFrame_RequestError&);
+  bool operator==(const IPCFrame_RequestError&) const;
+  bool operator!=(const IPCFrame_RequestError& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_error() const { return _has_field_[1]; }
+  const std::string& error() const { return error_; }
+  void set_error(const std::string& value) { error_ = value; _has_field_.set(1); }
+
+ private:
+  std::string error_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT IPCFrame_InvokeMethodReply : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kSuccessFieldNumber = 1,
+    kHasMoreFieldNumber = 2,
+    kReplyProtoFieldNumber = 3,
+  };
+
+  IPCFrame_InvokeMethodReply();
+  ~IPCFrame_InvokeMethodReply() override;
+  IPCFrame_InvokeMethodReply(IPCFrame_InvokeMethodReply&&) noexcept;
+  IPCFrame_InvokeMethodReply& operator=(IPCFrame_InvokeMethodReply&&);
+  IPCFrame_InvokeMethodReply(const IPCFrame_InvokeMethodReply&);
+  IPCFrame_InvokeMethodReply& operator=(const IPCFrame_InvokeMethodReply&);
+  bool operator==(const IPCFrame_InvokeMethodReply&) const;
+  bool operator!=(const IPCFrame_InvokeMethodReply& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_success() const { return _has_field_[1]; }
+  bool success() const { return success_; }
+  void set_success(bool value) { success_ = value; _has_field_.set(1); }
+
+  bool has_has_more() const { return _has_field_[2]; }
+  bool has_more() const { return has_more_; }
+  void set_has_more(bool value) { has_more_ = value; _has_field_.set(2); }
+
+  bool has_reply_proto() const { return _has_field_[3]; }
+  const std::string& reply_proto() const { return reply_proto_; }
+  void set_reply_proto(const std::string& value) { reply_proto_ = value; _has_field_.set(3); }
+  void set_reply_proto(const void* p, size_t s) { reply_proto_.assign(reinterpret_cast<const char*>(p), s); _has_field_.set(3); }
+
+ private:
+  bool success_{};
+  bool has_more_{};
+  std::string reply_proto_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<4> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT IPCFrame_InvokeMethod : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kServiceIdFieldNumber = 1,
+    kMethodIdFieldNumber = 2,
+    kArgsProtoFieldNumber = 3,
+    kDropReplyFieldNumber = 4,
+  };
+
+  IPCFrame_InvokeMethod();
+  ~IPCFrame_InvokeMethod() override;
+  IPCFrame_InvokeMethod(IPCFrame_InvokeMethod&&) noexcept;
+  IPCFrame_InvokeMethod& operator=(IPCFrame_InvokeMethod&&);
+  IPCFrame_InvokeMethod(const IPCFrame_InvokeMethod&);
+  IPCFrame_InvokeMethod& operator=(const IPCFrame_InvokeMethod&);
+  bool operator==(const IPCFrame_InvokeMethod&) const;
+  bool operator!=(const IPCFrame_InvokeMethod& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_service_id() const { return _has_field_[1]; }
+  uint32_t service_id() const { return service_id_; }
+  void set_service_id(uint32_t value) { service_id_ = value; _has_field_.set(1); }
+
+  bool has_method_id() const { return _has_field_[2]; }
+  uint32_t method_id() const { return method_id_; }
+  void set_method_id(uint32_t value) { method_id_ = value; _has_field_.set(2); }
+
+  bool has_args_proto() const { return _has_field_[3]; }
+  const std::string& args_proto() const { return args_proto_; }
+  void set_args_proto(const std::string& value) { args_proto_ = value; _has_field_.set(3); }
+  void set_args_proto(const void* p, size_t s) { args_proto_.assign(reinterpret_cast<const char*>(p), s); _has_field_.set(3); }
+
+  bool has_drop_reply() const { return _has_field_[4]; }
+  bool drop_reply() const { return drop_reply_; }
+  void set_drop_reply(bool value) { drop_reply_ = value; _has_field_.set(4); }
+
+ private:
+  uint32_t service_id_{};
+  uint32_t method_id_{};
+  std::string args_proto_{};
+  bool drop_reply_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<5> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT IPCFrame_BindServiceReply : public ::protozero::CppMessageObj {
+ public:
+  using MethodInfo = IPCFrame_BindServiceReply_MethodInfo;
+  enum FieldNumbers {
+    kSuccessFieldNumber = 1,
+    kServiceIdFieldNumber = 2,
+    kMethodsFieldNumber = 3,
+  };
+
+  IPCFrame_BindServiceReply();
+  ~IPCFrame_BindServiceReply() override;
+  IPCFrame_BindServiceReply(IPCFrame_BindServiceReply&&) noexcept;
+  IPCFrame_BindServiceReply& operator=(IPCFrame_BindServiceReply&&);
+  IPCFrame_BindServiceReply(const IPCFrame_BindServiceReply&);
+  IPCFrame_BindServiceReply& operator=(const IPCFrame_BindServiceReply&);
+  bool operator==(const IPCFrame_BindServiceReply&) const;
+  bool operator!=(const IPCFrame_BindServiceReply& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_success() const { return _has_field_[1]; }
+  bool success() const { return success_; }
+  void set_success(bool value) { success_ = value; _has_field_.set(1); }
+
+  bool has_service_id() const { return _has_field_[2]; }
+  uint32_t service_id() const { return service_id_; }
+  void set_service_id(uint32_t value) { service_id_ = value; _has_field_.set(2); }
+
+  const std::vector<IPCFrame_BindServiceReply_MethodInfo>& methods() const { return methods_; }
+  std::vector<IPCFrame_BindServiceReply_MethodInfo>* mutable_methods() { return &methods_; }
+  int methods_size() const;
+  void clear_methods();
+  IPCFrame_BindServiceReply_MethodInfo* add_methods();
+
+ private:
+  bool success_{};
+  uint32_t service_id_{};
+  std::vector<IPCFrame_BindServiceReply_MethodInfo> methods_;
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<4> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT IPCFrame_BindServiceReply_MethodInfo : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kIdFieldNumber = 1,
+    kNameFieldNumber = 2,
+  };
+
+  IPCFrame_BindServiceReply_MethodInfo();
+  ~IPCFrame_BindServiceReply_MethodInfo() override;
+  IPCFrame_BindServiceReply_MethodInfo(IPCFrame_BindServiceReply_MethodInfo&&) noexcept;
+  IPCFrame_BindServiceReply_MethodInfo& operator=(IPCFrame_BindServiceReply_MethodInfo&&);
+  IPCFrame_BindServiceReply_MethodInfo(const IPCFrame_BindServiceReply_MethodInfo&);
+  IPCFrame_BindServiceReply_MethodInfo& operator=(const IPCFrame_BindServiceReply_MethodInfo&);
+  bool operator==(const IPCFrame_BindServiceReply_MethodInfo&) const;
+  bool operator!=(const IPCFrame_BindServiceReply_MethodInfo& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_id() const { return _has_field_[1]; }
+  uint32_t id() const { return id_; }
+  void set_id(uint32_t value) { id_ = value; _has_field_.set(1); }
+
+  bool has_name() const { return _has_field_[2]; }
+  const std::string& name() const { return name_; }
+  void set_name(const std::string& value) { name_ = value; _has_field_.set(2); }
+
+ private:
+  uint32_t id_{};
+  std::string name_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<3> _has_field_{};
+};
+
+
+class PERFETTO_EXPORT IPCFrame_BindService : public ::protozero::CppMessageObj {
+ public:
+  enum FieldNumbers {
+    kServiceNameFieldNumber = 1,
+  };
+
+  IPCFrame_BindService();
+  ~IPCFrame_BindService() override;
+  IPCFrame_BindService(IPCFrame_BindService&&) noexcept;
+  IPCFrame_BindService& operator=(IPCFrame_BindService&&);
+  IPCFrame_BindService(const IPCFrame_BindService&);
+  IPCFrame_BindService& operator=(const IPCFrame_BindService&);
+  bool operator==(const IPCFrame_BindService&) const;
+  bool operator!=(const IPCFrame_BindService& other) const { return !(*this == other); }
+
+  bool ParseFromArray(const void*, size_t) override;
+  std::string SerializeAsString() const override;
+  std::vector<uint8_t> SerializeAsArray() const override;
+  void Serialize(::protozero::Message*) const;
+
+  bool has_service_name() const { return _has_field_[1]; }
+  const std::string& service_name() const { return service_name_; }
+  void set_service_name(const std::string& value) { service_name_ = value; _has_field_.set(1); }
+
+ private:
+  std::string service_name_{};
+
+  // Allows to preserve unknown protobuf fields for compatibility
+  // with future versions of .proto files.
+  std::string unknown_fields_;
+
+  std::bitset<2> _has_field_{};
+};
+
+}  // namespace perfetto
+}  // namespace protos
+}  // namespace gen
+
+#endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_WIRE_PROTOCOL_PROTO_CPP_H_
+// gen_amalgamated begin header: include/perfetto/protozero/contiguous_memory_range.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_
+#define INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_
+
+#include <assert.h>
+#include <stddef.h>
+#include <stdint.h>
+
+namespace protozero {
+
+// Keep this struct trivially constructible (no ctors, no default initializers).
+struct ContiguousMemoryRange {
+  uint8_t* begin;
+  uint8_t* end;  // STL style: one byte past the end of the buffer.
+
+  inline bool is_valid() const { return begin != nullptr; }
+  inline void reset() { begin = nullptr; }
+  inline size_t size() const { return static_cast<size_t>(end - begin); }
+};
+
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_
+// gen_amalgamated begin header: include/perfetto/protozero/copyable_ptr.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_COPYABLE_PTR_H_
+#define INCLUDE_PERFETTO_PROTOZERO_COPYABLE_PTR_H_
+
+#include <memory>
+
+namespace protozero {
+
+// This class is essentially a std::vector<T> of fixed size = 1.
+// It's a pointer wrapper with deep copying and deep equality comparison.
+// At all effects this wrapper behaves like the underlying T, with the exception
+// of the heap indirection.
+// Conversely to a std::unique_ptr, the pointer will be always valid, never
+// null. The problem it solves is the following: when generating C++ classes
+// from proto files, we want to keep each header hermetic (i.e. not #include
+// headers of dependent types). As such we can't directly instantiate T
+// field members but we can instead rely on pointers, so only the .cc file needs
+// to see the actual definition of T. If the generated classes were move-only we
+// could just use a unique_ptr there. But they aren't, hence this wrapper.
+// Converesely to unique_ptr, this wrapper:
+// - Default constructs the T instance in its constructor.
+// - Implements deep comparison in operator== instead of pointer comparison.
+template <typename T>
+class CopyablePtr {
+ public:
+  CopyablePtr() : ptr_(new T()) {}
+  ~CopyablePtr() = default;
+
+  // Copy operators.
+  CopyablePtr(const CopyablePtr& other) : ptr_(new T(*other.ptr_)) {}
+  CopyablePtr& operator=(const CopyablePtr& other) {
+    *ptr_ = *other.ptr_;
+    return *this;
+  }
+
+  // Move operators.
+  CopyablePtr(CopyablePtr&& other) noexcept : ptr_(std::move(other.ptr_)) {
+    other.ptr_.reset(new T());
+  }
+
+  CopyablePtr& operator=(CopyablePtr&& other) {
+    ptr_ = std::move(other.ptr_);
+    other.ptr_.reset(new T());
+    return *this;
+  }
+
+  T* get() { return ptr_.get(); }
+  const T* get() const { return ptr_.get(); }
+
+  T* operator->() { return ptr_.get(); }
+  const T* operator->() const { return ptr_.get(); }
+
+  T& operator*() { return *ptr_; }
+  const T& operator*() const { return *ptr_; }
+
+  friend bool operator==(const CopyablePtr& lhs, const CopyablePtr& rhs) {
+    return *lhs == *rhs;
+  }
+
+  friend bool operator!=(const CopyablePtr& lhs, const CopyablePtr& rhs) {
+    // In theory the underlying type might have a special operator!=
+    // implementation which is not just !(x == y). Respect that.
+    return *lhs != *rhs;
+  }
+
+ private:
+  std::unique_ptr<T> ptr_;
+};
+
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_COPYABLE_PTR_H_
+// gen_amalgamated begin header: include/perfetto/protozero/cpp_message_obj.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_CPP_MESSAGE_OBJ_H_
+#define INCLUDE_PERFETTO_PROTOZERO_CPP_MESSAGE_OBJ_H_
+
+#include <stdint.h>
+
+#include <string>
+#include <vector>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+
+namespace protozero {
+
+// Base class for generated .gen.h classes, which are full C++ objects that
+// support both ser and deserialization (but are not zero-copy).
+// This is only used by the "cpp" targets not the "pbzero" ones.
+class PERFETTO_EXPORT CppMessageObj {
+ public:
+  virtual ~CppMessageObj();
+  virtual std::string SerializeAsString() const = 0;
+  virtual std::vector<uint8_t> SerializeAsArray() const = 0;
+  virtual bool ParseFromArray(const void*, size_t) = 0;
+
+  bool ParseFromString(const std::string& str) {
+    return ParseFromArray(str.data(), str.size());
+  }
+};
+
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_CPP_MESSAGE_OBJ_H_
+// gen_amalgamated begin header: include/perfetto/protozero/field.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_FIELD_H_
+#define INCLUDE_PERFETTO_PROTOZERO_FIELD_H_
+
+#include <stdint.h>
+
+#include <string>
+#include <vector>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/contiguous_memory_range.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace protozero {
+
+struct ConstBytes {
+  std::string ToStdString() const {
+    return std::string(reinterpret_cast<const char*>(data), size);
+  }
+
+  const uint8_t* data;
+  size_t size;
+};
+
+struct ConstChars {
+  // Allow implicit conversion to perfetto's base::StringView without depending
+  // on perfetto/base or viceversa.
+  static constexpr bool kConvertibleToStringView = true;
+  std::string ToStdString() const { return std::string(data, size); }
+
+  const char* data;
+  size_t size;
+};
+
+// A protobuf field decoded by the protozero proto decoders. It exposes
+// convenience accessors with minimal debug checks.
+// This class is used both by the iterator-based ProtoDecoder and by the
+// one-shot TypedProtoDecoder.
+// If the field is not valid the accessors consistently return zero-integers or
+// null strings.
+class Field {
+ public:
+  bool valid() const { return id_ != 0; }
+  uint16_t id() const { return id_; }
+  explicit operator bool() const { return valid(); }
+
+  proto_utils::ProtoWireType type() const {
+    auto res = static_cast<proto_utils::ProtoWireType>(type_);
+    PERFETTO_DCHECK(res == proto_utils::ProtoWireType::kVarInt ||
+                    res == proto_utils::ProtoWireType::kLengthDelimited ||
+                    res == proto_utils::ProtoWireType::kFixed32 ||
+                    res == proto_utils::ProtoWireType::kFixed64);
+    return res;
+  }
+
+  bool as_bool() const {
+    PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kVarInt);
+    return static_cast<bool>(int_value_);
+  }
+
+  uint32_t as_uint32() const {
+    PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kVarInt ||
+                    type() == proto_utils::ProtoWireType::kFixed32);
+    return static_cast<uint32_t>(int_value_);
+  }
+
+  int32_t as_int32() const {
+    PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kVarInt ||
+                    type() == proto_utils::ProtoWireType::kFixed32);
+    return static_cast<int32_t>(int_value_);
+  }
+
+  int32_t as_sint32() const {
+    PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kVarInt);
+    return proto_utils::ZigZagDecode(static_cast<uint32_t>(int_value_));
+  }
+
+  uint64_t as_uint64() const {
+    PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kVarInt ||
+                    type() == proto_utils::ProtoWireType::kFixed32 ||
+                    type() == proto_utils::ProtoWireType::kFixed64);
+    return int_value_;
+  }
+
+  int64_t as_int64() const {
+    PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kVarInt ||
+                    type() == proto_utils::ProtoWireType::kFixed32 ||
+                    type() == proto_utils::ProtoWireType::kFixed64);
+    return static_cast<int64_t>(int_value_);
+  }
+
+  int64_t as_sint64() const {
+    PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kVarInt);
+    return proto_utils::ZigZagDecode(static_cast<uint64_t>(int_value_));
+  }
+
+  float as_float() const {
+    PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kFixed32);
+    float res;
+    uint32_t value32 = static_cast<uint32_t>(int_value_);
+    memcpy(&res, &value32, sizeof(res));
+    return res;
+  }
+
+  double as_double() const {
+    PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kFixed64);
+    double res;
+    memcpy(&res, &int_value_, sizeof(res));
+    return res;
+  }
+
+  ConstChars as_string() const {
+    PERFETTO_DCHECK(!valid() ||
+                    type() == proto_utils::ProtoWireType::kLengthDelimited);
+    return ConstChars{reinterpret_cast<const char*>(data()), size_};
+  }
+
+  std::string as_std_string() const { return as_string().ToStdString(); }
+
+  ConstBytes as_bytes() const {
+    PERFETTO_DCHECK(!valid() ||
+                    type() == proto_utils::ProtoWireType::kLengthDelimited);
+    return ConstBytes{data(), size_};
+  }
+
+  const uint8_t* data() const {
+    PERFETTO_DCHECK(!valid() ||
+                    type() == proto_utils::ProtoWireType::kLengthDelimited);
+    return reinterpret_cast<const uint8_t*>(int_value_);
+  }
+
+  size_t size() const {
+    PERFETTO_DCHECK(!valid() ||
+                    type() == proto_utils::ProtoWireType::kLengthDelimited);
+    return size_;
+  }
+
+  uint64_t raw_int_value() const { return int_value_; }
+
+  void initialize(uint16_t id,
+                  uint8_t type,
+                  uint64_t int_value,
+                  uint32_t size) {
+    id_ = id;
+    type_ = type;
+    int_value_ = int_value;
+    size_ = size;
+  }
+
+  // For use with templates. This is used by RepeatedFieldIterator::operator*().
+  void get(bool* val) const { *val = as_bool(); }
+  void get(uint32_t* val) const { *val = as_uint32(); }
+  void get(int32_t* val) const { *val = as_int32(); }
+  void get(uint64_t* val) const { *val = as_uint64(); }
+  void get(int64_t* val) const { *val = as_int64(); }
+  void get(float* val) const { *val = as_float(); }
+  void get(double* val) const { *val = as_double(); }
+  void get(std::string* val) const { *val = as_std_string(); }
+  void get(ConstChars* val) const { *val = as_string(); }
+  void get(ConstBytes* val) const { *val = as_bytes(); }
+  void get_signed(int32_t* val) const { *val = as_sint32(); }
+  void get_signed(int64_t* val) const { *val = as_sint64(); }
+
+  // For enum types.
+  template <typename T,
+            typename = typename std::enable_if<std::is_enum<T>::value, T>::type>
+  void get(T* val) const {
+    *val = static_cast<T>(as_int32());
+  }
+
+  // Serializes the field back into a proto-encoded byte stream and appends it
+  // to |dst|. |dst| is resized accordingly.
+  void SerializeAndAppendTo(std::string* dst) const;
+
+  // Serializes the field back into a proto-encoded byte stream and appends it
+  // to |dst|. |dst| is resized accordingly.
+  void SerializeAndAppendTo(std::vector<uint8_t>* dst) const;
+
+ private:
+  template <typename Container>
+  void SerializeAndAppendToInternal(Container* dst) const;
+
+  // Fields are deliberately not initialized to keep the class trivially
+  // constructible. It makes a large perf difference for ProtoDecoder.
+
+  uint64_t int_value_;  // In kLengthDelimited this contains the data() addr.
+  uint32_t size_;       // Only valid when when type == kLengthDelimited.
+  uint16_t id_;         // Proto field ordinal.
+  uint8_t type_;        // proto_utils::ProtoWireType.
+};
+
+// The Field struct is used in a lot of perf-sensitive contexts.
+static_assert(sizeof(Field) == 16, "Field struct too big");
+
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_FIELD_H_
+// gen_amalgamated begin header: include/perfetto/protozero/field_writer.h
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_FIELD_WRITER_H_
+#define INCLUDE_PERFETTO_PROTOZERO_FIELD_WRITER_H_
+
+namespace protozero {
+namespace internal {
+
+template <proto_utils::ProtoSchemaType proto_schema_type>
+struct FieldWriter {
+  static_assert(proto_schema_type != proto_utils::ProtoSchemaType::kMessage,
+                "FieldWriter can't be used with nested messages");
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kDouble> {
+  inline static void Append(Message& message, uint32_t field_id, double value) {
+    message.AppendFixed(field_id, value);
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kFloat> {
+  inline static void Append(Message& message, uint32_t field_id, float value) {
+    message.AppendFixed(field_id, value);
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kBool> {
+  inline static void Append(Message& message, uint32_t field_id, bool value) {
+    message.AppendTinyVarInt(field_id, value);
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kInt32> {
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            int32_t value) {
+    message.AppendVarInt(field_id, value);
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kInt64> {
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            int64_t value) {
+    message.AppendVarInt(field_id, value);
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kUint32> {
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            uint32_t value) {
+    message.AppendVarInt(field_id, value);
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kUint64> {
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            uint64_t value) {
+    message.AppendVarInt(field_id, value);
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kSint32> {
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            int32_t value) {
+    message.AppendSignedVarInt(field_id, value);
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kSint64> {
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            int64_t value) {
+    message.AppendSignedVarInt(field_id, value);
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kFixed32> {
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            uint32_t value) {
+    message.AppendFixed(field_id, value);
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kFixed64> {
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            uint64_t value) {
+    message.AppendFixed(field_id, value);
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kSfixed32> {
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            int32_t value) {
+    message.AppendFixed(field_id, value);
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kSfixed64> {
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            int64_t value) {
+    message.AppendFixed(field_id, value);
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kEnum> {
+  template <typename EnumType>
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            EnumType value) {
+    message.AppendVarInt(field_id, value);
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kString> {
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            const char* data,
+                            size_t size) {
+    message.AppendBytes(field_id, data, size);
+  }
+
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            const std::string& value) {
+    message.AppendBytes(field_id, value.data(), value.size());
+  }
+};
+
+template <>
+struct FieldWriter<proto_utils::ProtoSchemaType::kBytes> {
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            const uint8_t* data,
+                            size_t size) {
+    message.AppendBytes(field_id, data, size);
+  }
+
+  inline static void Append(Message& message,
+                            uint32_t field_id,
+                            const std::string& value) {
+    message.AppendBytes(field_id, value.data(), value.size());
+  }
+};
+
+}  // namespace internal
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_FIELD_WRITER_H_
+// gen_amalgamated begin header: include/perfetto/protozero/message.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_MESSAGE_H_
+#define INCLUDE_PERFETTO_PROTOZERO_MESSAGE_H_
+
+#include <assert.h>
+#include <stdint.h>
+#include <string.h>
+
+#include <string>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/contiguous_memory_range.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_stream_writer.h"
+
+namespace perfetto {
+namespace shm_fuzz {
+class FakeProducer;
+}  // namespace shm_fuzz
+}  // namespace perfetto
+
+namespace protozero {
+
+class MessageArena;
+class MessageHandleBase;
+
+// Base class extended by the proto C++ stubs generated by the ProtoZero
+// compiler. This class provides the minimal runtime required to support
+// append-only operations and is designed for performance. None of the methods
+// require any dynamic memory allocation, unless more than 16 nested messages
+// are created via BeginNestedMessage() calls.
+class PERFETTO_EXPORT Message {
+ public:
+  friend class MessageHandleBase;
+
+  // The ctor is deliberately a no-op to avoid forwarding args from all
+  // subclasses. The real initialization is performed by Reset().
+  // Nested messages are allocated via placement new by MessageArena and
+  // implictly destroyed when the RootMessage's arena goes away. This is
+  // fine as long as all the fields are PODs, which is checked by the
+  // static_assert()s in the Reset() method.
+  Message() = default;
+
+  // Clears up the state, allowing the message to be reused as a fresh one.
+  void Reset(ScatteredStreamWriter*, MessageArena*);
+
+  // Commits all the changes to the buffer (backfills the size field of this and
+  // all nested messages) and seals the message. Returns the size of the message
+  // (and all nested sub-messages), without taking into account any chunking.
+  // Finalize is idempotent and can be called several times w/o side effects.
+  uint32_t Finalize();
+
+  // Optional. If is_valid() == true, the corresponding memory region (its
+  // length == proto_utils::kMessageLengthFieldSize) is backfilled with the size
+  // of this message (minus |size_already_written| below). This is the mechanism
+  // used by messages to backfill their corresponding size field in the parent
+  // message.
+  uint8_t* size_field() const { return size_field_; }
+  void set_size_field(uint8_t* size_field) { size_field_ = size_field; }
+
+  // This is to deal with case of backfilling the size of a root (non-nested)
+  // message which is split into multiple chunks. Upon finalization only the
+  // partial size that lies in the last chunk has to be backfilled.
+  void inc_size_already_written(uint32_t sz) { size_already_written_ += sz; }
+
+  Message* nested_message() { return nested_message_; }
+
+  bool is_finalized() const { return finalized_; }
+
+#if PERFETTO_DCHECK_IS_ON()
+  void set_handle(MessageHandleBase* handle) { handle_ = handle; }
+#endif
+
+  // Proto types: uint64, uint32, int64, int32, bool, enum.
+  template <typename T>
+  void AppendVarInt(uint32_t field_id, T value) {
+    if (nested_message_)
+      EndNestedMessage();
+
+    uint8_t buffer[proto_utils::kMaxSimpleFieldEncodedSize];
+    uint8_t* pos = buffer;
+
+    pos = proto_utils::WriteVarInt(proto_utils::MakeTagVarInt(field_id), pos);
+    // WriteVarInt encodes signed values in two's complement form.
+    pos = proto_utils::WriteVarInt(value, pos);
+    WriteToStream(buffer, pos);
+  }
+
+  // Proto types: sint64, sint32.
+  template <typename T>
+  void AppendSignedVarInt(uint32_t field_id, T value) {
+    AppendVarInt(field_id, proto_utils::ZigZagEncode(value));
+  }
+
+  // Proto types: bool, enum (small).
+  // Faster version of AppendVarInt for tiny numbers.
+  void AppendTinyVarInt(uint32_t field_id, int32_t value) {
+    PERFETTO_DCHECK(0 <= value && value < 0x80);
+    if (nested_message_)
+      EndNestedMessage();
+
+    uint8_t buffer[proto_utils::kMaxSimpleFieldEncodedSize];
+    uint8_t* pos = buffer;
+    // MakeTagVarInt gets super optimized here for constexpr.
+    pos = proto_utils::WriteVarInt(proto_utils::MakeTagVarInt(field_id), pos);
+    *pos++ = static_cast<uint8_t>(value);
+    WriteToStream(buffer, pos);
+  }
+
+  // Proto types: fixed64, sfixed64, fixed32, sfixed32, double, float.
+  template <typename T>
+  void AppendFixed(uint32_t field_id, T value) {
+    if (nested_message_)
+      EndNestedMessage();
+
+    uint8_t buffer[proto_utils::kMaxSimpleFieldEncodedSize];
+    uint8_t* pos = buffer;
+
+    pos = proto_utils::WriteVarInt(proto_utils::MakeTagFixed<T>(field_id), pos);
+    memcpy(pos, &value, sizeof(T));
+    pos += sizeof(T);
+    // TODO: Optimize memcpy performance, see http://crbug.com/624311 .
+    WriteToStream(buffer, pos);
+  }
+
+  void AppendString(uint32_t field_id, const char* str);
+
+  void AppendString(uint32_t field_id, const std::string& str) {
+    AppendBytes(field_id, str.data(), str.size());
+  }
+
+  void AppendBytes(uint32_t field_id, const void* value, size_t size);
+
+  // Append raw bytes for a field, using the supplied |ranges| to
+  // copy from |num_ranges| individual buffers.
+  size_t AppendScatteredBytes(uint32_t field_id,
+                              ContiguousMemoryRange* ranges,
+                              size_t num_ranges);
+
+  // Begins a nested message. The returned object is owned by the MessageArena
+  // of the root message. The nested message ends either when Finalize() is
+  // called or when any other Append* method is called in the parent class.
+  // The template argument T is supposed to be a stub class auto generated from
+  // a .proto, hence a subclass of Message.
+  template <class T>
+  T* BeginNestedMessage(uint32_t field_id) {
+    // This is to prevent subclasses (which should be autogenerated, though), to
+    // introduce extra state fields (which wouldn't be initialized by Reset()).
+    static_assert(std::is_base_of<Message, T>::value,
+                  "T must be a subclass of Message");
+    static_assert(sizeof(T) == sizeof(Message),
+                  "Message subclasses cannot introduce extra state.");
+    return static_cast<T*>(BeginNestedMessageInternal(field_id));
+  }
+
+  // Gives read-only access to the underlying stream_writer. This is used only
+  // by few internals to query the state of the underlying buffer. It is almost
+  // always a bad idea to poke at the stream_writer() internals.
+  const ScatteredStreamWriter* stream_writer() const { return stream_writer_; }
+
+  // Appends some raw bytes to the message. The use-case for this is preserving
+  // unknown fields in the decode -> re-encode path of xxx.gen.cc classes
+  // generated by the cppgen_plugin.cc.
+  // The caller needs to guarantee that the appended data is properly
+  // proto-encoded and each field has a proto preamble.
+  void AppendRawProtoBytes(const void* data, size_t size) {
+    const uint8_t* src = reinterpret_cast<const uint8_t*>(data);
+    WriteToStream(src, src + size);
+  }
+
+ private:
+  Message(const Message&) = delete;
+  Message& operator=(const Message&) = delete;
+
+  Message* BeginNestedMessageInternal(uint32_t field_id);
+
+  // Called by Finalize and Append* methods.
+  void EndNestedMessage();
+
+  void WriteToStream(const uint8_t* src_begin, const uint8_t* src_end) {
+    PERFETTO_DCHECK(!finalized_);
+    PERFETTO_DCHECK(src_begin <= src_end);
+    const uint32_t size = static_cast<uint32_t>(src_end - src_begin);
+    stream_writer_->WriteBytes(src_begin, size);
+    size_ += size;
+  }
+
+  // Only POD fields are allowed. This class's dtor is never called.
+  // See the comment on the static_assert in the corresponding .cc file.
+
+  // The stream writer interface used for the serialization.
+  ScatteredStreamWriter* stream_writer_;
+
+  // The storage used to allocate nested Message objects.
+  // This is owned by RootMessage<T>.
+  MessageArena* arena_;
+
+  // Pointer to the last child message created through BeginNestedMessage(), if
+  // any, nullptr otherwise. There is no need to keep track of more than one
+  // message per nesting level as the proto-zero API contract mandates that
+  // nested fields can be filled only in a stacked fashion. In other words,
+  // nested messages are finalized and sealed when any other field is set in the
+  // parent message (or the parent message itself is finalized) and cannot be
+  // accessed anymore afterwards.
+  Message* nested_message_;
+
+  // [optional] Pointer to a non-aligned pre-reserved var-int slot of
+  // kMessageLengthFieldSize bytes. When set, the Finalize() method will write
+  // the size of proto-encoded message in the pointed memory region.
+  uint8_t* size_field_;
+
+  // Keeps track of the size of the current message.
+  uint32_t size_;
+
+  // See comment for inc_size_already_written().
+  uint32_t size_already_written_;
+
+  // When true, no more changes to the message are allowed. This is to DCHECK
+  // attempts of writing to a message which has been Finalize()-d.
+  bool finalized_;
+
+#if PERFETTO_DCHECK_IS_ON()
+  // Current generation of message. Incremented on Reset.
+  // Used to detect stale handles.
+  uint32_t generation_;
+
+  MessageHandleBase* handle_;
+#endif
+};
+
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_MESSAGE_H_
+// gen_amalgamated begin header: include/perfetto/protozero/message_arena.h
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_MESSAGE_ARENA_H_
+#define INCLUDE_PERFETTO_PROTOZERO_MESSAGE_ARENA_H_
+
+#include <stdint.h>
+
+#include <list>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+
+namespace protozero {
+
+class Message;
+
+// Object allocator for fixed-sized protozero::Message objects.
+// It's a simple bump-pointer allocator which leverages the stack-alike
+// usage pattern of protozero nested messages. It avoids hitting the system
+// allocator in most cases, by reusing the same block, and falls back on
+// allocating new blocks only when using deeply nested messages (which are
+// extremely rare).
+// This is used by RootMessage<T> to handle the storage for root-level messages.
+class PERFETTO_EXPORT MessageArena {
+ public:
+  MessageArena();
+  ~MessageArena();
+
+  // Strictly no copies or moves as this is used to hand out pointers.
+  MessageArena(const MessageArena&) = delete;
+  MessageArena& operator=(const MessageArena&) = delete;
+  MessageArena(MessageArena&&) = delete;
+  MessageArena& operator=(MessageArena&&) = delete;
+
+  // Allocates a new Message object.
+  Message* NewMessage();
+
+  // Deletes the last message allocated. The |msg| argument is used only for
+  // DCHECKs, it MUST be the pointer obtained by the last NewMessage() call.
+  void DeleteLastMessage(Message* msg) {
+    PERFETTO_DCHECK(!blocks_.empty() && blocks_.back().entries > 0);
+    PERFETTO_DCHECK(&blocks_.back().storage[blocks_.back().entries - 1] ==
+                    static_cast<void*>(msg));
+    DeleteLastMessageInternal();
+  }
+
+  // Resets the state of the arena, clearing up all but one block. This is used
+  // to avoid leaking outstanding unfinished sub-messages while recycling the
+  // RootMessage object (this is extremely rare due to the RAII scoped handles
+  // but could happen if some client does some overly clever std::move() trick).
+  void Reset() {
+    PERFETTO_DCHECK(!blocks_.empty());
+    blocks_.resize(1);
+    auto& block = blocks_.back();
+    block.entries = 0;
+    PERFETTO_ASAN_POISON(block.storage, sizeof(block.storage));
+  }
+
+ private:
+  void DeleteLastMessageInternal();
+
+  struct Block {
+    static constexpr size_t kCapacity = 16;
+
+    Block() { PERFETTO_ASAN_POISON(storage, sizeof(storage)); }
+
+    std::aligned_storage<sizeof(Message), alignof(Message)>::type
+        storage[kCapacity];
+    uint32_t entries = 0;  // # Message entries used (<= kCapacity).
+  };
+
+  // blocks are used to hand out pointers and must not be moved. Hence why
+  // std::list rather than std::vector.
+  std::list<Block> blocks_;
+};
+
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_MESSAGE_ARENA_H_
+// gen_amalgamated begin header: include/perfetto/protozero/message_handle.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_MESSAGE_HANDLE_H_
+#define INCLUDE_PERFETTO_PROTOZERO_MESSAGE_HANDLE_H_
+
+#include <functional>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+
+namespace protozero {
+
+class Message;
+
+// MessageHandle allows to decouple the lifetime of a proto message
+// from the underlying storage. It gives the following guarantees:
+// - The underlying message is finalized (if still alive) if the handle goes
+//   out of scope.
+// - In Debug / DCHECK_ALWAYS_ON builds, the handle becomes null once the
+//   message is finalized. This is to enforce the append-only API. For instance
+//   when adding two repeated messages, the addition of the 2nd one forces
+//   the finalization of the first.
+// Think about this as a WeakPtr<Message> which calls
+// Message::Finalize() when going out of scope.
+
+class PERFETTO_EXPORT MessageHandleBase {
+ public:
+  ~MessageHandleBase();
+
+  // Move-only type.
+  MessageHandleBase(MessageHandleBase&&) noexcept;
+  MessageHandleBase& operator=(MessageHandleBase&&);
+  explicit operator bool() const {
+#if PERFETTO_DCHECK_IS_ON()
+    PERFETTO_DCHECK(!message_ || generation_ == message_->generation_);
+#endif
+    return !!message_;
+  }
+
+ protected:
+  explicit MessageHandleBase(Message* = nullptr);
+  Message* operator->() const {
+#if PERFETTO_DCHECK_IS_ON()
+    PERFETTO_DCHECK(!message_ || generation_ == message_->generation_);
+#endif
+    return message_;
+  }
+  Message& operator*() const { return *(operator->()); }
+
+ private:
+  friend class Message;
+  MessageHandleBase(const MessageHandleBase&) = delete;
+  MessageHandleBase& operator=(const MessageHandleBase&) = delete;
+
+  void reset_message() {
+    // This is called by Message::Finalize().
+    PERFETTO_DCHECK(message_->is_finalized());
+    message_ = nullptr;
+  }
+
+  void Move(MessageHandleBase&&);
+
+  void FinalizeMessage() { message_->Finalize(); }
+
+  Message* message_;
+#if PERFETTO_DCHECK_IS_ON()
+  uint32_t generation_;
+#endif
+};
+
+template <typename T>
+class MessageHandle : public MessageHandleBase {
+ public:
+  MessageHandle() : MessageHandle(nullptr) {}
+  explicit MessageHandle(T* message) : MessageHandleBase(message) {}
+
+  explicit operator bool() const { return MessageHandleBase::operator bool(); }
+
+  T& operator*() const {
+    return static_cast<T&>(MessageHandleBase::operator*());
+  }
+
+  T* operator->() const {
+    return static_cast<T*>(MessageHandleBase::operator->());
+  }
+
+  T* get() const { return static_cast<T*>(MessageHandleBase::operator->()); }
+};
+
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_MESSAGE_HANDLE_H_
+// gen_amalgamated begin header: include/perfetto/protozero/packed_repeated_fields.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_PACKED_REPEATED_FIELDS_H_
+#define INCLUDE_PERFETTO_PROTOZERO_PACKED_REPEATED_FIELDS_H_
+
+#include <stdint.h>
+
+#include <array>
+#include <memory>
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace protozero {
+
+// This file contains classes used when encoding packed repeated fields.
+// To encode such a field, the caller is first expected to accumulate all of the
+// values in one of the following types (depending on the wire type of the
+// individual elements), defined below:
+// * protozero::PackedVarInt
+// * protozero::PackedFixedSizeInt</*element_type=*/ uint32_t>
+// Then that buffer is passed to the protozero-generated setters as an argument.
+// After calling the setter, the buffer can be destroyed.
+//
+// An example of encoding a packed field:
+//   protozero::HeapBuffered<protozero::Message> msg;
+//   protozero::PackedVarInt buf;
+//   buf.Append(42);
+//   buf.Append(-1);
+//   msg->set_fieldname(buf);
+//   msg.SerializeAsString();
+
+class PackedBufferBase {
+ public:
+  PackedBufferBase() { Reset(); }
+
+  // Copy or move is disabled due to pointers to stack addresses.
+  PackedBufferBase(const PackedBufferBase&) = delete;
+  PackedBufferBase(PackedBufferBase&&) = delete;
+  PackedBufferBase& operator=(const PackedBufferBase&) = delete;
+  PackedBufferBase& operator=(PackedBufferBase&&) = delete;
+
+  void Reset();
+
+  const uint8_t* data() const { return storage_begin_; }
+
+  size_t size() const {
+    return static_cast<size_t>(write_ptr_ - storage_begin_);
+  }
+
+ protected:
+  void GrowIfNeeded() {
+    PERFETTO_DCHECK(write_ptr_ >= storage_begin_ && write_ptr_ <= storage_end_);
+    if (PERFETTO_UNLIKELY(write_ptr_ + kMaxElementSize > storage_end_)) {
+      GrowSlowpath();
+    }
+  }
+
+  void GrowSlowpath();
+
+  // max(uint64_t varint encoding, biggest fixed type (uint64)).
+  static constexpr size_t kMaxElementSize = 10;
+
+  // So sizeof(this) == 8k.
+  static constexpr size_t kOnStackStorageSize = 8192 - 32;
+
+  uint8_t* storage_begin_;
+  uint8_t* storage_end_;
+  uint8_t* write_ptr_;
+  std::unique_ptr<uint8_t[]> heap_buf_;
+  alignas(uint64_t) uint8_t stack_buf_[kOnStackStorageSize];
+};
+
+class PackedVarInt : public PackedBufferBase {
+ public:
+  template <typename T>
+  void Append(T value) {
+    GrowIfNeeded();
+    write_ptr_ = proto_utils::WriteVarInt(value, write_ptr_);
+  }
+};
+
+template <typename T /* e.g. uint32_t for Fixed32 */>
+class PackedFixedSizeInt : public PackedBufferBase {
+ public:
+  void Append(T value) {
+    static_assert(sizeof(T) == 4 || sizeof(T) == 8,
+                  "PackedFixedSizeInt should be used only with 32/64-bit ints");
+    static_assert(sizeof(T) <= kMaxElementSize,
+                  "kMaxElementSize needs to be updated");
+    GrowIfNeeded();
+    PERFETTO_DCHECK(reinterpret_cast<size_t>(write_ptr_) % alignof(T) == 0);
+    memcpy(reinterpret_cast<T*>(write_ptr_), &value, sizeof(T));
+    write_ptr_ += sizeof(T);
+  }
+};
+
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_PACKED_REPEATED_FIELDS_H_
+// gen_amalgamated begin header: include/perfetto/protozero/proto_decoder.h
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_PROTO_DECODER_H_
+#define INCLUDE_PERFETTO_PROTOZERO_PROTO_DECODER_H_
+
+#include <stdint.h>
+#include <array>
+#include <memory>
+#include <vector>
+
+// gen_amalgamated expanded: #include "perfetto/base/compiler.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/field.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
+
+namespace protozero {
+
+// A generic protobuf decoder. Doesn't require any knowledge about the proto
+// schema. It tokenizes fields, retrieves their ID and type and exposes
+// accessors to retrieve its values.
+// It does NOT recurse in nested submessages, instead it just computes their
+// boundaries, recursion is left to the caller.
+// This class is designed to be used in perf-sensitive contexts. It does not
+// allocate and does not perform any proto semantic checks (e.g. repeated /
+// required / optional). It's supposedly safe wrt out-of-bounds memory accesses
+// (see proto_decoder_fuzzer.cc).
+// This class serves also as a building block for TypedProtoDecoder, used when
+// the schema is known at compile time.
+class PERFETTO_EXPORT ProtoDecoder {
+ public:
+  // Creates a ProtoDecoder using the given |buffer| with size |length| bytes.
+  ProtoDecoder(const void* buffer, size_t length)
+      : begin_(reinterpret_cast<const uint8_t*>(buffer)),
+        end_(begin_ + length),
+        read_ptr_(begin_) {}
+  ProtoDecoder(const std::string& str) : ProtoDecoder(str.data(), str.size()) {}
+  ProtoDecoder(const ConstBytes& cb) : ProtoDecoder(cb.data, cb.size) {}
+
+  // Reads the next field from the buffer and advances the read cursor. If a
+  // full field cannot be read, the returned Field will be invalid (i.e.
+  // field.valid() == false).
+  Field ReadField();
+
+  // Finds the first field with the given id. Doesn't affect the read cursor.
+  Field FindField(uint32_t field_id);
+
+  // Resets the read cursor to the start of the buffer.
+  void Reset() { read_ptr_ = begin_; }
+
+  // Resets the read cursor to the given position (must be within the buffer).
+  void Reset(const uint8_t* pos) {
+    PERFETTO_DCHECK(pos >= begin_ && pos < end_);
+    read_ptr_ = pos;
+  }
+
+  // Returns the position of read cursor, relative to the start of the buffer.
+  size_t read_offset() const { return static_cast<size_t>(read_ptr_ - begin_); }
+
+  size_t bytes_left() const {
+    PERFETTO_DCHECK(read_ptr_ <= end_);
+    return static_cast<size_t>(end_ - read_ptr_);
+  }
+
+  const uint8_t* begin() const { return begin_; }
+  const uint8_t* end() const { return end_; }
+
+ protected:
+  const uint8_t* const begin_;
+  const uint8_t* const end_;
+  const uint8_t* read_ptr_ = nullptr;
+};
+
+// An iterator-like class used to iterate through repeated fields. Used by
+// TypedProtoDecoder. The iteration sequence is a bit counter-intuitive due to
+// the fact that fields_[field_id] holds the *last* value of the field, not the
+// first, but the remaining storage holds repeated fields in FIFO order.
+// Assume that we push the 10,11,12 into a repeated field with ID=1.
+//
+// Decoder memory layout:  [  fields storage  ] [ repeated fields storage ]
+// 1st iteration:           10
+// 2nd iteration:           11                   10
+// 3rd iteration:           12                   10 11
+//
+// We start the iteration @ fields_[num_fields], which is the start of the
+// repeated fields storage, proceed until the end and lastly jump @ fields_[id].
+template <typename T>
+class RepeatedFieldIterator {
+ public:
+  RepeatedFieldIterator(uint32_t field_id,
+                        const Field* begin,
+                        const Field* end,
+                        const Field* last)
+      : field_id_(field_id), iter_(begin), end_(end), last_(last) {
+    FindNextMatchingId();
+  }
+
+  // Constructs an invalid iterator.
+  RepeatedFieldIterator()
+      : field_id_(0u), iter_(nullptr), end_(nullptr), last_(nullptr) {}
+
+  explicit operator bool() const { return iter_ != end_; }
+  const Field& field() const { return *iter_; }
+
+  T operator*() const {
+    T val{};
+    iter_->get(&val);
+    return val;
+  }
+  const Field* operator->() const { return iter_; }
+
+  RepeatedFieldIterator& operator++() {
+    PERFETTO_DCHECK(iter_ != end_);
+    if (iter_ == last_) {
+      iter_ = end_;
+      return *this;
+    }
+    ++iter_;
+    FindNextMatchingId();
+    return *this;
+  }
+
+  RepeatedFieldIterator operator++(int) {
+    PERFETTO_DCHECK(iter_ != end_);
+    RepeatedFieldIterator it(*this);
+    ++(*this);
+    return it;
+  }
+
+ private:
+  void FindNextMatchingId() {
+    PERFETTO_DCHECK(iter_ != last_);
+    for (; iter_ != end_; ++iter_) {
+      if (iter_->id() == field_id_)
+        return;
+    }
+    iter_ = last_->valid() ? last_ : end_;
+  }
+
+  uint32_t field_id_;
+
+  // Initially points to the beginning of the repeated field storage, then is
+  // incremented as we call operator++().
+  const Field* iter_;
+
+  // Always points to fields_[size_], i.e. past the end of the storage.
+  const Field* end_;
+
+  // Always points to fields_[field_id].
+  const Field* last_;
+};
+
+// As RepeatedFieldIterator, but allows iterating over a packed repeated field
+// (which will be initially stored as a single length-delimited field).
+// See |GetPackedRepeatedField| for details.
+//
+// Assumes little endianness, and that the input buffers are well formed -
+// containing an exact multiple of encoded elements.
+template <proto_utils::ProtoWireType wire_type, typename CppType>
+class PackedRepeatedFieldIterator {
+ public:
+  PackedRepeatedFieldIterator(const uint8_t* data_begin,
+                              size_t size,
+                              bool* parse_error_ptr)
+      : data_end_(data_begin ? data_begin + size : nullptr),
+        read_ptr_(data_begin),
+        parse_error_(parse_error_ptr) {
+    using proto_utils::ProtoWireType;
+    static_assert(wire_type == ProtoWireType::kVarInt ||
+                      wire_type == ProtoWireType::kFixed32 ||
+                      wire_type == ProtoWireType::kFixed64,
+                  "invalid type");
+
+    PERFETTO_DCHECK(parse_error_ptr);
+
+    // Either the field is unset (and there are no data pointer), or the field
+    // is set with a zero length payload. Mark the iterator as invalid in both
+    // cases.
+    if (size == 0) {
+      curr_value_valid_ = false;
+      return;
+    }
+
+    if ((wire_type == ProtoWireType::kFixed32 && (size % 4) != 0) ||
+        (wire_type == ProtoWireType::kFixed64 && (size % 8) != 0)) {
+      *parse_error_ = true;
+      curr_value_valid_ = false;
+      return;
+    }
+
+    ++(*this);
+  }
+
+  const CppType operator*() const { return curr_value_; }
+  explicit operator bool() const { return curr_value_valid_; }
+
+  PackedRepeatedFieldIterator& operator++() {
+    using proto_utils::ProtoWireType;
+
+    if (PERFETTO_UNLIKELY(!curr_value_valid_))
+      return *this;
+
+    if (PERFETTO_UNLIKELY(read_ptr_ == data_end_)) {
+      curr_value_valid_ = false;
+      return *this;
+    }
+
+    if (wire_type == ProtoWireType::kVarInt) {
+      uint64_t new_value = 0;
+      const uint8_t* new_pos =
+          proto_utils::ParseVarInt(read_ptr_, data_end_, &new_value);
+
+      if (PERFETTO_UNLIKELY(new_pos == read_ptr_)) {
+        // Failed to decode the varint (probably incomplete buffer).
+        *parse_error_ = true;
+        curr_value_valid_ = false;
+      } else {
+        read_ptr_ = new_pos;
+        curr_value_ = static_cast<CppType>(new_value);
+      }
+    } else {  // kFixed32 or kFixed64
+      constexpr size_t kStep = wire_type == ProtoWireType::kFixed32 ? 4 : 8;
+
+      // NB: the raw buffer is not guaranteed to be aligned, so neither are
+      // these copies.
+      memcpy(&curr_value_, read_ptr_, sizeof(CppType));
+      read_ptr_ += kStep;
+    }
+
+    return *this;
+  }
+
+  PackedRepeatedFieldIterator operator++(int) {
+    PackedRepeatedFieldIterator it(*this);
+    ++(*this);
+    return it;
+  }
+
+ private:
+  // Might be null if the backing proto field isn't set.
+  const uint8_t* const data_end_;
+
+  // The iterator looks ahead by an element, so |curr_value| holds the value
+  // to be returned when the caller dereferences the iterator, and |read_ptr_|
+  // points at the start of the next element to be decoded.
+  // |read_ptr_| might be null if the backing proto field isn't set.
+  const uint8_t* read_ptr_;
+  CppType curr_value_ = 0;
+
+  // Set to false once we've exhausted the iterator, or encountered an error.
+  bool curr_value_valid_ = true;
+
+  // Where to set parsing errors, supplied by the caller.
+  bool* const parse_error_;
+};
+
+// This decoder loads all fields upfront, without recursing in nested messages.
+// It is used as a base class for typed decoders generated by the pbzero plugin.
+// The split between TypedProtoDecoderBase and TypedProtoDecoder<> is to have
+// unique definition of functions like ParseAllFields() and ExpandHeapStorage().
+// The storage (either on-stack or on-heap) for this class is organized as
+// follows:
+// |-------------------------- fields_ ----------------------|
+// [ field 0 (invalid) ] [ fields 1 .. N ] [ repeated fields ]
+//                                        ^                  ^
+//                                        num_fields_        size_
+class PERFETTO_EXPORT TypedProtoDecoderBase : public ProtoDecoder {
+ public:
+  // If the field |id| is known at compile time, prefer the templated
+  // specialization at<kFieldNumber>().
+  const Field& Get(uint32_t id) const {
+    return PERFETTO_LIKELY(id < num_fields_) ? fields_[id] : fields_[0];
+  }
+
+  // Returns an object that allows to iterate over all instances of a repeated
+  // field given its id. Example usage:
+  //   for (auto it = decoder.GetRepeated<int32_t>(N); it; ++it) { ... }
+  template <typename T>
+  RepeatedFieldIterator<T> GetRepeated(uint32_t field_id) const {
+    return RepeatedFieldIterator<T>(field_id, &fields_[num_fields_],
+                                    &fields_[size_], &fields_[field_id]);
+  }
+
+  // Returns an objects that allows to iterate over all entries of a packed
+  // repeated field given its id and type. The |wire_type| is necessary for
+  // decoding the packed field, the |cpp_type| is for convenience & stronger
+  // typing.
+  //
+  // The caller must also supply a pointer to a bool that is set to true if the
+  // packed buffer is found to be malformed while iterating (so you need to
+  // exhaust the iterator if you want to check the full extent of the buffer).
+  //
+  // Note that unlike standard protobuf parsers, protozero does not allow
+  // treating of packed repeated fields as non-packed and vice-versa (therefore
+  // not making the packed option forwards and backwards compatible). So
+  // the caller needs to use the right accessor for correct results.
+  template <proto_utils::ProtoWireType wire_type, typename cpp_type>
+  PackedRepeatedFieldIterator<wire_type, cpp_type> GetPackedRepeated(
+      uint32_t field_id,
+      bool* parse_error_location) const {
+    const Field& field = Get(field_id);
+    if (field.valid()) {
+      return PackedRepeatedFieldIterator<wire_type, cpp_type>(
+          field.data(), field.size(), parse_error_location);
+    } else {
+      return PackedRepeatedFieldIterator<wire_type, cpp_type>(
+          nullptr, 0, parse_error_location);
+    }
+  }
+
+ protected:
+  TypedProtoDecoderBase(Field* storage,
+                        uint32_t num_fields,
+                        uint32_t capacity,
+                        const uint8_t* buffer,
+                        size_t length)
+      : ProtoDecoder(buffer, length),
+        fields_(storage),
+        num_fields_(num_fields),
+        size_(num_fields),
+        capacity_(capacity) {
+    // The reason why Field needs to be trivially de/constructible is to avoid
+    // implicit initializers on all the ~1000 entries. We need it to initialize
+    // only on the first |max_field_id| fields, the remaining capacity doesn't
+    // require initialization.
+    static_assert(std::is_trivially_constructible<Field>::value &&
+                      std::is_trivially_destructible<Field>::value &&
+                      std::is_trivial<Field>::value,
+                  "Field must be a trivial aggregate type");
+    memset(fields_, 0, sizeof(Field) * num_fields_);
+  }
+
+  void ParseAllFields();
+
+  // Called when the default on-stack storage is exhausted and new repeated
+  // fields need to be pushed.
+  void ExpandHeapStorage();
+
+  // Used only in presence of a large number of repeated fields, when the
+  // default on-stack storage is exhausted.
+  std::unique_ptr<Field[]> heap_storage_;
+
+  // Points to the storage, either on-stack (default, provided by the template
+  // specialization) or |heap_storage_| after ExpandHeapStorage() is called, in
+  // case of a large number of repeated fields.
+  Field* fields_;
+
+  // Number of fields without accounting repeated storage. This is equal to
+  // MAX_FIELD_ID + 1 (to account for the invalid 0th field).
+  // This value is always <= size_ (and hence <= capacity);
+  uint32_t num_fields_;
+
+  // Number of active |fields_| entries. This is initially equal to the highest
+  // number of fields for the message (num_fields_ == MAX_FIELD_ID + 1) and can
+  // grow up to |capacity_| in the case of repeated fields.
+  uint32_t size_;
+
+  // Initially equal to kFieldsCapacity of the TypedProtoDecoder
+  // specialization. Can grow when falling back on heap-based storage, in which
+  // case it represents the size (#fields with each entry of a repeated field
+  // counted individually) of the |heap_storage_| array.
+  uint32_t capacity_;
+};
+
+// Template class instantiated by the auto-generated decoder classes declared in
+// xxx.pbzero.h files.
+template <int MAX_FIELD_ID, bool HAS_NONPACKED_REPEATED_FIELDS>
+class TypedProtoDecoder : public TypedProtoDecoderBase {
+ public:
+  TypedProtoDecoder(const uint8_t* buffer, size_t length)
+      : TypedProtoDecoderBase(on_stack_storage_,
+                              /*num_fields=*/MAX_FIELD_ID + 1,
+                              kCapacity,
+                              buffer,
+                              length) {
+    static_assert(MAX_FIELD_ID <= kMaxDecoderFieldId, "Field ordinal too high");
+    TypedProtoDecoderBase::ParseAllFields();
+  }
+
+  template <uint32_t FIELD_ID>
+  const Field& at() const {
+    static_assert(FIELD_ID <= MAX_FIELD_ID, "FIELD_ID > MAX_FIELD_ID");
+    return fields_[FIELD_ID];
+  }
+
+  TypedProtoDecoder(TypedProtoDecoder&& other) noexcept
+      : TypedProtoDecoderBase(std::move(other)) {
+    // If the moved-from decoder was using on-stack storage, we need to update
+    // our pointer to point to this decoder's on-stack storage.
+    if (fields_ == other.on_stack_storage_) {
+      fields_ = on_stack_storage_;
+      memcpy(on_stack_storage_, other.on_stack_storage_,
+             sizeof(on_stack_storage_));
+    }
+  }
+
+ private:
+  // In the case of non-repeated fields, this constant defines the highest field
+  // id we are able to decode. This is to limit the on-stack storage.
+  // In the case of repeated fields, this constant defines the max number of
+  // repeated fields that we'll be able to store before falling back on the
+  // heap. Keep this value in sync with the one in protozero_generator.cc.
+  static constexpr size_t kMaxDecoderFieldId = 999;
+
+  // If we the message has no repeated fields we need at most N Field entries
+  // in the on-stack storage, where N is the highest field id.
+  // Otherwise we need some room to store repeated fields.
+  static constexpr size_t kCapacity =
+      1 + (HAS_NONPACKED_REPEATED_FIELDS ? kMaxDecoderFieldId : MAX_FIELD_ID);
+
+  Field on_stack_storage_[kCapacity];
+};
+
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_PROTO_DECODER_H_
+// gen_amalgamated begin header: include/perfetto/protozero/proto_utils.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_PROTO_UTILS_H_
+#define INCLUDE_PERFETTO_PROTOZERO_PROTO_UTILS_H_
+
+#include <inttypes.h>
+#include <stddef.h>
+
+#include <type_traits>
+
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+
+namespace protozero {
+namespace proto_utils {
+
+// See https://developers.google.com/protocol-buffers/docs/encoding wire types.
+// This is a type encoded into the proto that provides just enough info to
+// find the length of the following value.
+enum class ProtoWireType : uint32_t {
+  kVarInt = 0,
+  kFixed64 = 1,
+  kLengthDelimited = 2,
+  kFixed32 = 5,
+};
+
+// This is the type defined in the proto for each field. This information
+// is used to decide the translation strategy when writing the trace.
+enum class ProtoSchemaType {
+  kUnknown = 0,
+  kDouble,
+  kFloat,
+  kInt64,
+  kUint64,
+  kInt32,
+  kFixed64,
+  kFixed32,
+  kBool,
+  kString,
+  kGroup,  // Deprecated (proto2 only)
+  kMessage,
+  kBytes,
+  kUint32,
+  kEnum,
+  kSfixed32,
+  kSfixed64,
+  kSint32,
+  kSint64,
+};
+
+inline const char* ProtoSchemaToString(ProtoSchemaType v) {
+  switch (v) {
+    case ProtoSchemaType::kUnknown:
+      return "unknown";
+    case ProtoSchemaType::kDouble:
+      return "double";
+    case ProtoSchemaType::kFloat:
+      return "float";
+    case ProtoSchemaType::kInt64:
+      return "int64";
+    case ProtoSchemaType::kUint64:
+      return "uint64";
+    case ProtoSchemaType::kInt32:
+      return "int32";
+    case ProtoSchemaType::kFixed64:
+      return "fixed64";
+    case ProtoSchemaType::kFixed32:
+      return "fixed32";
+    case ProtoSchemaType::kBool:
+      return "bool";
+    case ProtoSchemaType::kString:
+      return "string";
+    case ProtoSchemaType::kGroup:
+      return "group";
+    case ProtoSchemaType::kMessage:
+      return "message";
+    case ProtoSchemaType::kBytes:
+      return "bytes";
+    case ProtoSchemaType::kUint32:
+      return "uint32";
+    case ProtoSchemaType::kEnum:
+      return "enum";
+    case ProtoSchemaType::kSfixed32:
+      return "sfixed32";
+    case ProtoSchemaType::kSfixed64:
+      return "sfixed64";
+    case ProtoSchemaType::kSint32:
+      return "sint32";
+    case ProtoSchemaType::kSint64:
+      return "sint64";
+  }
+  // For gcc:
+  PERFETTO_DCHECK(false);
+  return "";
+}
+
+// Maximum message size supported: 256 MiB (4 x 7-bit due to varint encoding).
+constexpr size_t kMessageLengthFieldSize = 4;
+constexpr size_t kMaxMessageLength = (1u << (kMessageLengthFieldSize * 7)) - 1;
+
+// Field tag is encoded as 32-bit varint (5 bytes at most).
+// Largest value of simple (not length-delimited) field is 64-bit varint
+// (10 bytes at most). 15 bytes buffer is enough to store a simple field.
+constexpr size_t kMaxTagEncodedSize = 5;
+constexpr size_t kMaxSimpleFieldEncodedSize = kMaxTagEncodedSize + 10;
+
+// Proto types: (int|uint|sint)(32|64), bool, enum.
+constexpr uint32_t MakeTagVarInt(uint32_t field_id) {
+  return (field_id << 3) | static_cast<uint32_t>(ProtoWireType::kVarInt);
+}
+
+// Proto types: fixed64, sfixed64, fixed32, sfixed32, double, float.
+template <typename T>
+constexpr uint32_t MakeTagFixed(uint32_t field_id) {
+  static_assert(sizeof(T) == 8 || sizeof(T) == 4, "Value must be 4 or 8 bytes");
+  return (field_id << 3) |
+         static_cast<uint32_t>((sizeof(T) == 8 ? ProtoWireType::kFixed64
+                                               : ProtoWireType::kFixed32));
+}
+
+// Proto types: string, bytes, embedded messages.
+constexpr uint32_t MakeTagLengthDelimited(uint32_t field_id) {
+  return (field_id << 3) |
+         static_cast<uint32_t>(ProtoWireType::kLengthDelimited);
+}
+
+// Proto types: sint64, sint32.
+template <typename T>
+inline typename std::make_unsigned<T>::type ZigZagEncode(T value) {
+  using UnsignedType = typename std::make_unsigned<T>::type;
+
+  // Right-shift of negative values is implementation specific.
+  // Assert the implementation does what we expect, which is that shifting any
+  // positive value by sizeof(T) * 8 - 1 gives an all 0 bitmap, and a negative
+  // value gives and all 1 bitmap.
+  constexpr uint64_t kUnsignedZero = 0u;
+  constexpr int64_t kNegativeOne = -1;
+  constexpr int64_t kPositiveOne = 1;
+  static_assert(static_cast<uint64_t>(kNegativeOne >> 63) == ~kUnsignedZero,
+                "implementation does not support assumed rightshift");
+  static_assert(static_cast<uint64_t>(kPositiveOne >> 63) == kUnsignedZero,
+                "implementation does not support assumed rightshift");
+
+  return (static_cast<UnsignedType>(value) << 1) ^
+         static_cast<UnsignedType>(value >> (sizeof(T) * 8 - 1));
+}
+
+// Proto types: sint64, sint32.
+template <typename T>
+inline typename std::make_signed<T>::type ZigZagDecode(T value) {
+  using UnsignedType = typename std::make_unsigned<T>::type;
+  using SignedType = typename std::make_signed<T>::type;
+  auto u_value = static_cast<UnsignedType>(value);
+  auto mask = static_cast<UnsignedType>(-static_cast<SignedType>(u_value & 1));
+  return static_cast<SignedType>((u_value >> 1) ^ mask);
+}
+
+template <typename T>
+inline uint8_t* WriteVarInt(T value, uint8_t* target) {
+  // If value is <= 0 we must first sign extend to int64_t (see [1]).
+  // Finally we always cast to an unsigned value to to avoid arithmetic
+  // (sign expanding) shifts in the while loop.
+  // [1]: "If you use int32 or int64 as the type for a negative number, the
+  // resulting varint is always ten bytes long".
+  // - developers.google.com/protocol-buffers/docs/encoding
+  // So for each input type we do the following casts:
+  // uintX_t -> uintX_t -> uintX_t
+  // int8_t  -> int64_t -> uint64_t
+  // int16_t -> int64_t -> uint64_t
+  // int32_t -> int64_t -> uint64_t
+  // int64_t -> int64_t -> uint64_t
+  using MaybeExtendedType =
+      typename std::conditional<std::is_unsigned<T>::value, T, int64_t>::type;
+  using UnsignedType = typename std::make_unsigned<MaybeExtendedType>::type;
+
+  MaybeExtendedType extended_value = static_cast<MaybeExtendedType>(value);
+  UnsignedType unsigned_value = static_cast<UnsignedType>(extended_value);
+
+  while (unsigned_value >= 0x80) {
+    *target++ = static_cast<uint8_t>(unsigned_value) | 0x80;
+    unsigned_value >>= 7;
+  }
+  *target = static_cast<uint8_t>(unsigned_value);
+  return target + 1;
+}
+
+// Writes a fixed-size redundant encoding of the given |value|. This is
+// used to backfill fixed-size reservations for the length field using a
+// non-canonical varint encoding (e.g. \x81\x80\x80\x00 instead of \x01).
+// See https://github.com/google/protobuf/issues/1530.
+// This is used mainly in two cases:
+// 1) At trace writing time, when starting a nested messages. The size of a
+//    nested message is not known until all its field have been written.
+//    |kMessageLengthFieldSize| bytes are reserved to encode the size field and
+//    backfilled at the end.
+// 2) When rewriting a message at trace filtering time, in protozero/filtering.
+//    At that point we know only the upper bound of the length (a filtered
+//    message is <= the original one) and we backfill after the message has been
+//    filtered.
+inline void WriteRedundantVarInt(uint32_t value,
+                                 uint8_t* buf,
+                                 size_t size = kMessageLengthFieldSize) {
+  for (size_t i = 0; i < size; ++i) {
+    const uint8_t msb = (i < size - 1) ? 0x80 : 0;
+    buf[i] = static_cast<uint8_t>(value) | msb;
+    value >>= 7;
+  }
+}
+
+template <uint32_t field_id>
+void StaticAssertSingleBytePreamble() {
+  static_assert(field_id < 16,
+                "Proto field id too big to fit in a single byte preamble");
+}
+
+// Parses a VarInt from the encoded buffer [start, end). |end| is STL-style and
+// points one byte past the end of buffer.
+// The parsed int value is stored in the output arg |value|. Returns a pointer
+// to the next unconsumed byte (so start < retval <= end) or |start| if the
+// VarInt could not be fully parsed because there was not enough space in the
+// buffer.
+inline const uint8_t* ParseVarInt(const uint8_t* start,
+                                  const uint8_t* end,
+                                  uint64_t* out_value) {
+  const uint8_t* pos = start;
+  uint64_t value = 0;
+  for (uint32_t shift = 0; pos < end && shift < 64u; shift += 7) {
+    // Cache *pos into |cur_byte| to prevent that the compiler dereferences the
+    // pointer twice (here and in the if() below) due to char* aliasing rules.
+    uint8_t cur_byte = *pos++;
+    value |= static_cast<uint64_t>(cur_byte & 0x7f) << shift;
+    if ((cur_byte & 0x80) == 0) {
+      // In valid cases we get here.
+      *out_value = value;
+      return pos;
+    }
+  }
+  *out_value = 0;
+  return start;
+}
+
+enum class RepetitionType {
+  kNotRepeated,
+  kRepeatedPacked,
+  kRepeatedNotPacked,
+};
+
+// Provide a common base struct for all templated FieldMetadata types to allow
+// simple checks if a given type is a FieldMetadata or not.
+struct FieldMetadataBase {
+  constexpr FieldMetadataBase() = default;
+};
+
+template <uint32_t field_id,
+          RepetitionType repetition_type,
+          ProtoSchemaType proto_schema_type,
+          typename CppFieldType,
+          typename MessageType>
+struct FieldMetadata : public FieldMetadataBase {
+  constexpr FieldMetadata() = default;
+
+  static constexpr int kFieldId = field_id;
+  // Whether this field is repeated, packed (repeated [packed-true]) or not
+  // (optional).
+  static constexpr RepetitionType kRepetitionType = repetition_type;
+  // Proto type of this field (e.g. int64, fixed32 or nested message).
+  static constexpr ProtoSchemaType kProtoFieldType = proto_schema_type;
+  // C++ type of this field (for nested messages - C++ protozero class).
+  using cpp_field_type = CppFieldType;
+  // Protozero message which this field belongs to.
+  using message_type = MessageType;
+};
+
+namespace internal {
+
+// Ideally we would create variables of FieldMetadata<...> type directly,
+// but before C++17's support for constexpr inline variables arrive, we have to
+// actually use pointers to inline functions instead to avoid having to define
+// symbols in *.pbzero.cc files.
+//
+// Note: protozero bindings will generate Message::kFieldName variable and which
+// can then be passed to TRACE_EVENT macro for inline writing of typed messages.
+// The fact that the former can be passed to the latter is a part of the stable
+// API, while the particular type is not and users should not rely on it.
+template <typename T>
+using FieldMetadataHelper = T (*)(void);
+
+}  // namespace internal
+}  // namespace proto_utils
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_PROTO_UTILS_H_
+// gen_amalgamated begin header: include/perfetto/protozero/root_message.h
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_ROOT_MESSAGE_H_
+#define INCLUDE_PERFETTO_PROTOZERO_ROOT_MESSAGE_H_
+
+// gen_amalgamated expanded: #include "perfetto/protozero/message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/message_arena.h"
+
+namespace protozero {
+
+// Helper class to hand out messages using the default MessageArena.
+// Usage:
+// RootMessage<perfetto::protos::zero::MyMessage> msg;
+// msg.Reset(stream_writer);
+// msg.set_foo(...);
+// auto* nested = msg.set_nested();
+template <typename T = Message>
+class RootMessage : public T {
+ public:
+  RootMessage() { T::Reset(nullptr, &root_arena_); }
+
+  // Disallow copy and move.
+  RootMessage(const RootMessage&) = delete;
+  RootMessage& operator=(const RootMessage&) = delete;
+  RootMessage(RootMessage&&) = delete;
+  RootMessage& operator=(RootMessage&&) = delete;
+
+  void Reset(ScatteredStreamWriter* writer) {
+    root_arena_.Reset();
+    Message::Reset(writer, &root_arena_);
+  }
+
+ private:
+  MessageArena root_arena_;
+};
+
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_ROOT_MESSAGE_H_
+// gen_amalgamated begin header: include/perfetto/protozero/scattered_heap_buffer.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_SCATTERED_HEAP_BUFFER_H_
+#define INCLUDE_PERFETTO_PROTOZERO_SCATTERED_HEAP_BUFFER_H_
+
+#include <memory>
+#include <string>
+#include <vector>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/root_message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_stream_writer.h"
+
+namespace protozero {
+
+class Message;
+
+class PERFETTO_EXPORT ScatteredHeapBuffer
+    : public protozero::ScatteredStreamWriter::Delegate {
+ public:
+  class PERFETTO_EXPORT Slice {
+   public:
+    Slice();
+    explicit Slice(size_t size);
+    Slice(Slice&& slice) noexcept;
+    ~Slice();
+    Slice& operator=(Slice&&);
+
+    inline protozero::ContiguousMemoryRange GetTotalRange() const {
+      return {buffer_.get(), buffer_.get() + size_};
+    }
+
+    inline protozero::ContiguousMemoryRange GetUsedRange() const {
+      return {buffer_.get(), buffer_.get() + size_ - unused_bytes_};
+    }
+
+    uint8_t* start() const { return buffer_.get(); }
+    size_t size() const { return size_; }
+    size_t unused_bytes() const { return unused_bytes_; }
+    void set_unused_bytes(size_t unused_bytes) {
+      PERFETTO_DCHECK(unused_bytes_ <= size_);
+      unused_bytes_ = unused_bytes;
+    }
+
+    void Clear();
+
+   private:
+    std::unique_ptr<uint8_t[]> buffer_;
+    size_t size_;
+    size_t unused_bytes_;
+  };
+
+  ScatteredHeapBuffer(size_t initial_slice_size_bytes = 128,
+                      size_t maximum_slice_size_bytes = 128 * 1024);
+  ~ScatteredHeapBuffer() override;
+
+  // protozero::ScatteredStreamWriter::Delegate implementation.
+  protozero::ContiguousMemoryRange GetNewBuffer() override;
+
+  // Return the slices backing this buffer, adjusted for the number of bytes the
+  // writer has written.
+  const std::vector<Slice>& GetSlices();
+
+  // Stitch all the slices into a single contiguous buffer.
+  std::vector<uint8_t> StitchSlices();
+
+  // Note that the returned ranges point back to this buffer and thus cannot
+  // outlive it.
+  std::vector<protozero::ContiguousMemoryRange> GetRanges();
+
+  // Note that size of the last slice isn't updated to reflect the number of
+  // bytes written by the trace writer.
+  const std::vector<Slice>& slices() const { return slices_; }
+
+  void set_writer(protozero::ScatteredStreamWriter* writer) {
+    writer_ = writer;
+  }
+
+  // Update unused_bytes() of the current |Slice| based on the writer's state.
+  void AdjustUsedSizeOfCurrentSlice();
+
+  // Returns the total size the slices occupy in heap memory (including unused).
+  size_t GetTotalSize();
+
+  // Reset the contents of this buffer but retain one slice allocation (if it
+  // exists) to be reused for future writes.
+  void Reset();
+
+ private:
+  size_t next_slice_size_;
+  const size_t maximum_slice_size_;
+  protozero::ScatteredStreamWriter* writer_ = nullptr;
+  std::vector<Slice> slices_;
+
+  // Used to keep an allocated slice around after this buffer is reset.
+  Slice cached_slice_;
+};
+
+// Helper function to create heap-based protozero messages in one line.
+// Useful when manually serializing a protozero message (primarily in
+// tests/utilities). So instead of the following:
+//   protozero::MyMessage msg;
+//   protozero::ScatteredHeapBuffer shb;
+//   protozero::ScatteredStreamWriter writer(&shb);
+//   shb.set_writer(&writer);
+//   msg.Reset(&writer);
+//   ...
+// You can write:
+//   protozero::HeapBuffered<protozero::MyMessage> msg;
+//   msg->set_stuff(...);
+//   msg.SerializeAsString();
+template <typename T = ::protozero::Message>
+class HeapBuffered {
+ public:
+  HeapBuffered() : HeapBuffered(4096, 4096) {}
+  HeapBuffered(size_t initial_slice_size_bytes, size_t maximum_slice_size_bytes)
+      : shb_(initial_slice_size_bytes, maximum_slice_size_bytes),
+        writer_(&shb_) {
+    shb_.set_writer(&writer_);
+    msg_.Reset(&writer_);
+  }
+
+  // This can't be neither copied nor moved because Message hands out pointers
+  // to itself when creating submessages.
+  HeapBuffered(const HeapBuffered&) = delete;
+  HeapBuffered& operator=(const HeapBuffered&) = delete;
+  HeapBuffered(HeapBuffered&&) = delete;
+  HeapBuffered& operator=(HeapBuffered&&) = delete;
+
+  T* get() { return &msg_; }
+  T* operator->() { return &msg_; }
+
+  bool empty() const { return shb_.slices().empty(); }
+
+  std::vector<uint8_t> SerializeAsArray() {
+    msg_.Finalize();
+    return shb_.StitchSlices();
+  }
+
+  std::string SerializeAsString() {
+    auto vec = SerializeAsArray();
+    return std::string(reinterpret_cast<const char*>(vec.data()), vec.size());
+  }
+
+  std::vector<protozero::ContiguousMemoryRange> GetRanges() {
+    msg_.Finalize();
+    return shb_.GetRanges();
+  }
+
+  const std::vector<ScatteredHeapBuffer::Slice>& GetSlices() {
+    msg_.Finalize();
+    return shb_.GetSlices();
+  }
+
+  void Reset() {
+    shb_.Reset();
+    writer_.Reset(protozero::ContiguousMemoryRange{});
+    msg_.Reset(&writer_);
+    PERFETTO_DCHECK(empty());
+  }
+
+ private:
+  ScatteredHeapBuffer shb_;
+  ScatteredStreamWriter writer_;
+  RootMessage<T> msg_;
+};
+
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_SCATTERED_HEAP_BUFFER_H_
+// gen_amalgamated begin header: include/perfetto/protozero/scattered_stream_null_delegate.h
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_SCATTERED_STREAM_NULL_DELEGATE_H_
+#define INCLUDE_PERFETTO_PROTOZERO_SCATTERED_STREAM_NULL_DELEGATE_H_
+
+#include <memory>
+#include <vector>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/base/logging.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/contiguous_memory_range.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_stream_writer.h"
+
+namespace protozero {
+
+class PERFETTO_EXPORT ScatteredStreamWriterNullDelegate
+    : public ScatteredStreamWriter::Delegate {
+ public:
+  explicit ScatteredStreamWriterNullDelegate(size_t chunk_size);
+  ~ScatteredStreamWriterNullDelegate() override;
+
+  // protozero::ScatteredStreamWriter::Delegate implementation.
+  ContiguousMemoryRange GetNewBuffer() override;
+
+ private:
+  const size_t chunk_size_;
+  std::unique_ptr<uint8_t[]> chunk_;
+};
+
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_SCATTERED_STREAM_NULL_DELEGATE_H_
+// gen_amalgamated begin header: include/perfetto/protozero/scattered_stream_writer.h
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_SCATTERED_STREAM_WRITER_H_
+#define INCLUDE_PERFETTO_PROTOZERO_SCATTERED_STREAM_WRITER_H_
+
+#include <assert.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <string.h>
+
+// gen_amalgamated expanded: #include "perfetto/base/compiler.h"
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/contiguous_memory_range.h"
+
+namespace protozero {
+
+// This class deals with the following problem: append-only proto messages want
+// to write a stream of bytes, without caring about the implementation of the
+// underlying buffer (which concretely will be either the trace ring buffer
+// or a heap-allocated buffer). The main deal is: proto messages don't know in
+// advance what their size will be.
+// Due to the tracing buffer being split into fixed-size chunks, on some
+// occasions, these writes need to be spread over two (or more) non-contiguous
+// chunks of memory. Similarly, when the buffer is backed by the heap, we want
+// to avoid realloc() calls, as they might cause a full copy of the contents
+// of the buffer.
+// The purpose of this class is to abstract away the non-contiguous write logic.
+// This class knows how to deal with writes as long as they fall in the same
+// ContiguousMemoryRange and defers the chunk-chaining logic to the Delegate.
+class PERFETTO_EXPORT ScatteredStreamWriter {
+ public:
+  class PERFETTO_EXPORT Delegate {
+   public:
+    virtual ~Delegate();
+    virtual ContiguousMemoryRange GetNewBuffer() = 0;
+  };
+
+  explicit ScatteredStreamWriter(Delegate* delegate);
+  ~ScatteredStreamWriter();
+
+  inline void WriteByte(uint8_t value) {
+    if (write_ptr_ >= cur_range_.end)
+      Extend();
+    *write_ptr_++ = value;
+  }
+
+  // Assumes that the caller checked that there is enough headroom.
+  // TODO(primiano): perf optimization, this is a tracing hot path. The
+  // compiler can make strong optimization on memcpy if the size arg is a
+  // constexpr. Make a templated variant of this for fixed-size writes.
+  // TODO(primiano): restrict / noalias might also help.
+  inline void WriteBytesUnsafe(const uint8_t* src, size_t size) {
+    uint8_t* const end = write_ptr_ + size;
+    assert(end <= cur_range_.end);
+    memcpy(write_ptr_, src, size);
+    write_ptr_ = end;
+  }
+
+  inline void WriteBytes(const uint8_t* src, size_t size) {
+    uint8_t* const end = write_ptr_ + size;
+    if (PERFETTO_LIKELY(end <= cur_range_.end))
+      return WriteBytesUnsafe(src, size);
+    WriteBytesSlowPath(src, size);
+  }
+
+  void WriteBytesSlowPath(const uint8_t* src, size_t size);
+
+  // Reserves a fixed amount of bytes to be backfilled later. The reserved range
+  // is guaranteed to be contiguous and not span across chunks. |size| has to be
+  // <= than the size of a new buffer returned by the Delegate::GetNewBuffer().
+  uint8_t* ReserveBytes(size_t size);
+
+  // Fast (but unsafe) version of the above. The caller must have previously
+  // checked that there are at least |size| contiguous bytes available.
+  // Returns only the start pointer of the reservation.
+  uint8_t* ReserveBytesUnsafe(size_t size) {
+    uint8_t* begin = write_ptr_;
+    write_ptr_ += size;
+    assert(write_ptr_ <= cur_range_.end);
+    return begin;
+  }
+
+  // Resets the buffer boundaries and the write pointer to the given |range|.
+  // Subsequent WriteByte(s) will write into |range|.
+  void Reset(ContiguousMemoryRange range);
+
+  // Number of contiguous free bytes in |cur_range_| that can be written without
+  // requesting a new buffer.
+  size_t bytes_available() const {
+    return static_cast<size_t>(cur_range_.end - write_ptr_);
+  }
+
+  uint8_t* write_ptr() const { return write_ptr_; }
+
+  uint64_t written() const {
+    return written_previously_ +
+           static_cast<uint64_t>(write_ptr_ - cur_range_.begin);
+  }
+
+ private:
+  ScatteredStreamWriter(const ScatteredStreamWriter&) = delete;
+  ScatteredStreamWriter& operator=(const ScatteredStreamWriter&) = delete;
+
+  void Extend();
+
+  Delegate* const delegate_;
+  ContiguousMemoryRange cur_range_;
+  uint8_t* write_ptr_;
+  uint64_t written_previously_ = 0;
+};
+
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_SCATTERED_STREAM_WRITER_H_
+// gen_amalgamated begin header: include/perfetto/protozero/static_buffer.h
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INCLUDE_PERFETTO_PROTOZERO_STATIC_BUFFER_H_
+#define INCLUDE_PERFETTO_PROTOZERO_STATIC_BUFFER_H_
+
+#include <memory>
+#include <string>
+#include <vector>
+
+// gen_amalgamated expanded: #include "perfetto/base/export.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/root_message.h"
+// gen_amalgamated expanded: #include "perfetto/protozero/scattered_stream_writer.h"
+
+namespace protozero {
+
+class Message;
+
+// A simple implementation of ScatteredStreamWriter::Delegate backed by a
+// fixed-size buffer. It doesn't support expansion. The caller needs to ensure
+// to never write more than the size of the buffer. Will CHECK() otherwise.
+class PERFETTO_EXPORT StaticBufferDelegate
+    : public ScatteredStreamWriter::Delegate {
+ public:
+  StaticBufferDelegate(uint8_t* buf, size_t len) : range_{buf, buf + len} {}
+  ~StaticBufferDelegate() override;
+
+  // ScatteredStreamWriter::Delegate implementation.
+  ContiguousMemoryRange GetNewBuffer() override;
+
+  ContiguousMemoryRange const range_;
+  bool get_new_buffer_called_once_ = false;
+};
+
+// Helper function to create protozero messages backed by a fixed-size buffer
+// in one line. You can write:
+//   protozero::Static<protozero::MyMessage> msg(buf.data(), buf.size());
+//   msg->set_stuff(...);
+//   size_t bytes_encoded = msg.Finalize();
+template <typename T /* protozero::Message */>
+class StaticBuffered {
+ public:
+  StaticBuffered(void* buf, size_t len)
+      : delegate_(reinterpret_cast<uint8_t*>(buf), len), writer_(&delegate_) {
+    msg_.Reset(&writer_);
+  }
+
+  // This can't be neither copied nor moved because Message hands out pointers
+  // to itself when creating submessages.
+  StaticBuffered(const StaticBuffered&) = delete;
+  StaticBuffered& operator=(const StaticBuffered&) = delete;
+  StaticBuffered(StaticBuffered&&) = delete;
+  StaticBuffered& operator=(StaticBuffered&&) = delete;
+
+  T* get() { return &msg_; }
+  T* operator->() { return &msg_; }
+
+  // The lack of a size() method is deliberate. It's to prevent that one
+  // accidentally calls size() before Finalize().
+
+  // Returns the number of encoded bytes (<= the size passed in the ctor).
+  size_t Finalize() {
+    msg_.Finalize();
+    return static_cast<size_t>(writer_.write_ptr() - delegate_.range_.begin);
+  }
+
+ private:
+  StaticBufferDelegate delegate_;
+  ScatteredStreamWriter writer_;
+  RootMessage<T> msg_;
+};
+
+// Helper function to create stack-based protozero messages in one line.
+// You can write:
+//   protozero::StackBuffered<protozero::MyMessage, 16> msg;
+//   msg->set_stuff(...);
+//   size_t bytes_encoded = msg.Finalize();
+template <typename T /* protozero::Message */, size_t N>
+class StackBuffered : public StaticBuffered<T> {
+ public:
+  StackBuffered() : StaticBuffered<T>(&buf_[0], N) {}
+
+ private:
+  uint8_t buf_[N];  // Deliberately not initialized.
+};
+
+}  // namespace protozero
+
+#endif  // INCLUDE_PERFETTO_PROTOZERO_STATIC_BUFFER_H_
+
diff --git a/system/profiler/profiler.cpp b/system/profiler/profiler.cpp
new file mode 100644
index 0000000..97e5fee
--- /dev/null
+++ b/system/profiler/profiler.cpp
@@ -0,0 +1,93 @@
+// Copyright (C) 2021 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "profiler.h"
+
+#include <android-base/properties.h>
+#include <sys/prctl.h>
+
+#include "perfetto.h"
+
+namespace {
+
+class GpuCounterDataSource : public perfetto::DataSource<GpuCounterDataSource> {
+ public:
+  void OnSetup(const SetupArgs& args) override {
+    PERFETTO_ILOG("GpuCounterDataSource OnSetup, name: %s", args.config->name().c_str());
+    const std::string& config_raw = args.config->gpu_counter_config_raw();
+    perfetto::protos::pbzero::GpuCounterConfig::Decoder config(config_raw);
+    for(auto it = config.counter_ids(); it; ++it) {
+      counter_ids.push_back(it->as_uint32());
+    }
+    first = true;
+  }
+
+  void OnStart(const StartArgs&) override {
+    PERFETTO_ILOG("GpuCounterDataSource OnStart called");
+  }
+
+  void OnStop(const StopArgs&) override {
+    PERFETTO_ILOG("GpuCounterDataSource OnStop called");
+  }
+
+  bool first = true;
+  uint64_t count = 0;
+  std::vector<uint32_t> counter_ids;
+};
+
+class GpuRenderStageDataSource: public perfetto::DataSource<GpuRenderStageDataSource> {
+ public:
+  void OnSetup(const SetupArgs& args) override {
+    PERFETTO_ILOG("GpuRenderStageDataSource OnSetup called, name: %s",
+      args.config->name().c_str());
+    first = true;
+  }
+
+  void OnStart(const StartArgs&) override {
+    PERFETTO_ILOG("GpuRenderStageDataSource OnStart called");
+  }
+
+  void OnStop(const StopArgs&) override {
+    PERFETTO_ILOG("GpuRenderStageDataSource OnStop called");
+  }
+
+  bool first = true;
+  uint64_t count = 0;
+};
+
+}
+
+void try_register_goldfish_perfetto() {
+  std::string enableString = android::base::GetProperty("debug.graphics.gpu.profiler.perfetto", "");
+  if (enableString != "1" && enableString != "true") {
+    return;
+  }
+  if (!prctl(PR_GET_DUMPABLE, 0, 0, 0, 0)) {
+    return;
+  }
+  perfetto::TracingInitArgs args;
+  args.backends = perfetto::kSystemBackend;
+  perfetto::Tracing::Initialize(args);
+  {
+    perfetto::DataSourceDescriptor dsd;
+    dsd.set_name("gpu.counters");
+    GpuCounterDataSource::Register(dsd);
+  }
+
+  {
+    perfetto::DataSourceDescriptor dsd;
+    dsd.set_name("gpu.renderstages");
+    GpuRenderStageDataSource::Register(dsd);
+  }
+}
diff --git a/system/profiler/profiler.h b/system/profiler/profiler.h
new file mode 100644
index 0000000..3b4db47
--- /dev/null
+++ b/system/profiler/profiler.h
@@ -0,0 +1,20 @@
+// Copyright (C) 2021 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef __PROFILER_H__
+#define __PROFILER_H__
+
+extern void try_register_goldfish_perfetto();
+
+#endif //__PROFILER_H__
diff --git a/system/profiler/profiler_stub.cpp b/system/profiler/profiler_stub.cpp
new file mode 100644
index 0000000..52fd934
--- /dev/null
+++ b/system/profiler/profiler_stub.cpp
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "profiler.h"
+
+void try_register_goldfish_perfetto() { }
diff --git a/system/renderControl_enc/Android.mk b/system/renderControl_enc/Android.mk
new file mode 100644
index 0000000..f2cce50
--- /dev/null
+++ b/system/renderControl_enc/Android.mk
@@ -0,0 +1,15 @@
+LOCAL_PATH := $(call my-dir)
+
+$(call emugl-begin-shared-library,lib_renderControl_enc)
+
+LOCAL_CFLAGS += \
+    -Wno-unused-function \
+
+LOCAL_SRC_FILES := \
+    renderControl_client_context.cpp \
+    renderControl_enc.cpp \
+    renderControl_entry.cpp
+
+$(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
+$(call emugl-import,libOpenglCodecCommon$(GOLDFISH_OPENGL_LIB_SUFFIX))
+$(call emugl-end-module)
diff --git a/system/renderControl_enc/CMakeLists.txt b/system/renderControl_enc/CMakeLists.txt
new file mode 100644
index 0000000..bdf6293
--- /dev/null
+++ b/system/renderControl_enc/CMakeLists.txt
@@ -0,0 +1,10 @@
+# This is an autogenerated file! Do not edit!
+# instead run make from .../device/generic/goldfish-opengl
+# which will re-generate this file.
+android_validate_sha256("${GOLDFISH_DEVICE_ROOT}/system/renderControl_enc/Android.mk" "780a007ac7a3d2255372ddf40e03aeb10e4c759343d2532f6ddf769f4df73810")
+set(_renderControl_enc_src renderControl_client_context.cpp renderControl_enc.cpp renderControl_entry.cpp)
+android_add_library(TARGET _renderControl_enc SHARED LICENSE Apache-2.0 SRC renderControl_client_context.cpp renderControl_enc.cpp renderControl_entry.cpp)
+target_include_directories(_renderControl_enc PRIVATE ${GOLDFISH_DEVICE_ROOT}/shared/OpenglCodecCommon ${GOLDFISH_DEVICE_ROOT}/android-emu ${GOLDFISH_DEVICE_ROOT}/shared/qemupipe/include-types ${GOLDFISH_DEVICE_ROOT}/shared/qemupipe/include ${GOLDFISH_DEVICE_ROOT}/system/renderControl_enc ${GOLDFISH_DEVICE_ROOT}/./host/include/libOpenglRender ${GOLDFISH_DEVICE_ROOT}/./system/include ${GOLDFISH_DEVICE_ROOT}/./../../../external/qemu/android/android-emugl/guest)
+target_compile_definitions(_renderControl_enc PRIVATE "-DPLATFORM_SDK_VERSION=29" "-DGOLDFISH_HIDL_GRALLOC" "-DHOST_BUILD" "-DANDROID" "-DGL_GLEXT_PROTOTYPES" "-DPAGE_SIZE=4096" "-DGFXSTREAM" "-DENABLE_ANDROID_HEALTH_MONITOR")
+target_compile_options(_renderControl_enc PRIVATE "-fvisibility=default" "-Wno-unused-parameter" "-Wno-unused-function")
+target_link_libraries(_renderControl_enc PRIVATE OpenglCodecCommon_host cutils utils log androidemu android-emu-shared PRIVATE qemupipe_host)
\ No newline at end of file
diff --git a/system/renderControl_enc/README b/system/renderControl_enc/README
new file mode 100644
index 0000000..349b6db
--- /dev/null
+++ b/system/renderControl_enc/README
@@ -0,0 +1,142 @@
+The renderControl.in file in this directory defines an API which is decoded
+on the android guest into a stream and get decoded and executed on the host.
+It is used in order to query the host renderer as well as send the host renderer
+control commands.
+
+The following describes each of the entries defined by this renderControl API.
+
+
+GLint rcGetRendererVersion();
+       This function queries the host renderer version number.
+
+EGLint rcGetEGLVersion(EGLint* major, EGLint* minor);
+       This function queries the host renderer for the EGL version
+       it supports. returns EGL_FALSE on failure.
+
+EGLint rcQueryEGLString(EGLenum name, void* buffer, EGLint bufferSize);
+       This function queries the host for EGL string (.i.e EGL_EXTENSIONS).
+       if buffer is NULL or the bufferSize is not big enough the return value
+       is the negative number of bytes required to store the string value
+       otherwise the string value is copied to buffer and its size is
+       returned.
+
+EGLint rcGetNumConfigs(uint32_t* numAttribs);
+       queries the host for the number of supported EGL configs.
+       The function returns the number of supported configs and returns in
+       numAttribs the number of attributes available for each config.
+
+EGLint rcGetConfigs(uint32_t bufSize, GLuint* buffer);
+       This function queries the host for the all set of supported configs
+       with their attribute values.
+       bufSize is the size of buffer, the size should be at least equal to
+       (numConfigs + 1) * numAttribs * sizeof(GLuint)
+       where numConfigs and numAttribs are the values returned in 
+       rcGetNumConfigs. if bufSize is not big enough then the negative number
+       of required bytes is returned otherwise the function returns the number
+       of configs and buffer is filled as follows: The first 'numAttribs'
+       integer values are filled with the EGL enumerant describing a config
+       attribute, next for each config there are 'numAttribs' integer values
+       holding the attribute values for that config, the values are specified
+       in the same order as the attribute vector.
+
+EGLint rcChooseConfig(EGLint *attribs, uint32_t attribs_size, uint32_t *configs, uint32_t configs_size)
+       This function triggers an eglChooseConfig on the host, to get a list of 
+       configs matching the given attribs values.
+ 	attribs - a list of attribute names followed by the desired values, terminated by EGL_NONE
+	attribs_size - the size of the list
+	configs - the returned matching configuration names (same names as familiar to the client in rcGetConfigs)
+	configs_size - the size of the configs buffers
+	returns - the actual number of matching configurations (<= configs_size) 
+
+EGLint rcGetFBParam(EGLint param);
+       queries the host for framebuffer parameter, see renderControl_types.h
+       for possible values of 'param'.
+
+uint32_t rcCreateContext(uint32_t config, uint32_t share, uint32_t glVersion);
+       This function creates a rendering context on the host and returns its
+       handle. config is the config index for the context, share is either zero
+       or a handle to a sharing context. glVersion is either 1 or 2 for GLES1
+       or GLES2 context respectively.
+
+
+void rcDestroyContext(uint32_t context);
+       This function destroys a rendering context on the host.
+       context is a handle returned in rcCreateContext.
+
+uint32_t rcCreateWindowSurface(uint32_t config, uint32_t width, uint32_t height);
+       This function creates a 'window' surface on the host which can be then
+       bind for rendering through rcMakeCurrent.
+       The function returns a handle to the created window surface.
+
+void rcDestroyWindowSurface(uint32_t windowSurface);
+       This function destoys a window surface.
+
+uint32_t rcCreateColorBuffer(uint32_t width, uint32_t height, GLenum internalFormat);
+       This function creates a colorBuffer object on the host which can be then
+       be specified as a render target for a window surface through 
+       rcSetWindowColorBuffer or to be displayed on the framebuffer window
+       through rcFBPost.
+       The function returns a handle to the colorBuffer object, with an initial
+       reference count of 1.
+
+void rcOpenColorBuffer(uint32_t colorbuffer);
+       Adds an additional reference to the colorbuffer, typically from a
+       different Android process than the one which created it.
+
+void rcCloseColorBuffer(uint32_t colorbuffer);
+       Removes a reference to the colorbuffer. When the reference count drops
+       to zero the colorbuffer is automatically destroyed.
+
+void rcFlushWindowColorBuffer(uint32_t windowSurface, uint32_t colorBuffer);
+       This flushes the current window color buffer
+
+void rcSetWindowColorBuffer(uint32_t windowSurface, uint32_t colorBuffer);
+       This set the target color buffer for a windowSurface, when set the
+       previous target colorBuffer gets updated before switching to the new
+       colorBuffer.
+
+EGLint rcMakeCurrent(uint32_t context, uint32_t drawSurf, uint32_t readSurf);
+       Binds a windowSurface(s) and current rendering context for the 
+       calling thread.
+
+void rcFBPost(uint32_t colorBuffer);
+       This function causes the content of the colorBuffer object to be
+       displayed on the host framebuffer window. The function returns
+       immediatly, the buffer will be displayed at the next swap interval.
+
+void rcFBSetSwapInterval(EGLint interval);
+       Sets the swap interval for the host framebuffer window.
+
+void rcBindTexture(uint32_t colorBuffer);
+       This function instruct the host to bind the content of the specified
+       colorBuffer to the current binded texture object of the calling thread.
+       This function should be used to implement eglBindTexImage.
+
+EGLint rcColorBufferCacheFlush(uint32_t colorbuffer, EGLint postCount, int forRead);
+       This function returns only after all rendering requests for the specified
+       colorBuffer rendering target has been processed and after all 'postCount'
+       posts for the buffer requested previously through rcFBPost has been
+       processed.
+       if 'forRead' is not-zero, the function returns positive value in case
+       there was rendering done to the buffer since the last CacheFlush request
+       with non-zero 'forRead' value, otherwise the function returns zero or
+       negative value on failure.
+
+void rcReadColorBuffer(uint32_t colorbuffer, GLint x, GLint y, 
+                       GLint width, GLint height, GLenum format, 
+                       GLenum type, void* pixels);
+       This function queries the host for the pixel content of a colorBuffer's
+       subregion. It act the same as OpenGL glReadPixels however pixels
+       are always packed with alignment of 1.
+
+void rcUpdateColorBuffer(uint32_t colorbuffer, GLint x, GLint y, 
+                         GLint width, GLint height, GLenum format, 
+                         GLenum type, void* pixels);
+       Updates the content of a subregion of a colorBuffer object.
+       pixels are always unpacked with alignment of 1.
+
+uint32_t rcCreateClientImage(uint32_t context, EGLenum target, GLuint buffer)
+       Create an EGLImage from a client object.
+
+int rcDestroyClientImage(uint32_t image)
+       Destroy an EGLImage object.
diff --git a/system/renderControl_enc/meson.build b/system/renderControl_enc/meson.build
new file mode 100644
index 0000000..fad55f4
--- /dev/null
+++ b/system/renderControl_enc/meson.build
@@ -0,0 +1,14 @@
+# Copyright 2022 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+files_lib_render_control_enc = files(
+  'renderControl_enc.cpp',
+)
+
+lib_render_control_enc = static_library(
+   'render_control',
+   files_lib_render_control_enc,
+   cpp_args: cpp_args,
+   include_directories: [inc_host, inc_opengl_codec, inc_android_emu,
+                         inc_android_compat],
+)
diff --git a/system/renderControl_enc/renderControl.attrib b/system/renderControl_enc/renderControl.attrib
new file mode 100644
index 0000000..fbf52f7
--- /dev/null
+++ b/system/renderControl_enc/renderControl.attrib
@@ -0,0 +1,55 @@
+GLOBAL
+	base_opcode 10000
+	encoder_headers <stdint.h> <EGL/egl.h> "glUtils.h"
+
+rcGetEGLVersion
+    dir major out
+    len major sizeof(EGLint)
+    dir minor out
+    len minor sizeof(EGLint)
+
+rcQueryEGLString
+    dir buffer out
+    len buffer bufferSize
+
+rcGetGLString
+    dir buffer out
+    len buffer bufferSize
+
+rcGetNumConfigs
+    dir numAttribs out
+    len numAttribs sizeof(uint32_t)
+
+rcGetConfigs
+    dir buffer out
+    len buffer bufSize
+
+rcChooseConfig
+    dir attribs in
+    len attribs attribs_size
+    dir configs out
+    var_flag configs nullAllowed
+    len configs configs_size*sizeof(uint32_t)
+
+rcReadColorBuffer
+    dir pixels out
+    len pixels (((glUtilsPixelBitSize(format, type) * width) >> 3) * height)
+
+rcUpdateColorBuffer
+    dir pixels in
+    len pixels (((glUtilsPixelBitSize(format, type) * width) >> 3) * height)
+    var_flag pixels isLarge
+
+rcCloseColorBuffer
+    flag flushOnEncode
+
+rcCloseColorBufferPuid
+    flag flushOnEncode
+
+rcCreateSyncKHR
+    dir attribs in
+    len attribs num_attribs
+    dir glsync_out out
+    len glsync_out sizeof(uint64_t)
+    dir syncthread_out out
+    len syncthread_out sizeof(uint64_t)
diff --git a/system/renderControl_enc/renderControl.in b/system/renderControl_enc/renderControl.in
new file mode 100644
index 0000000..8be1886
--- /dev/null
+++ b/system/renderControl_enc/renderControl.in
@@ -0,0 +1,37 @@
+GL_ENRTY(GLint, rcGetRendererVersion)
+GL_ENTRY(EGLint, rcGetEGLVersion, EGLint *major, EGLint *minor)
+GL_ENTRY(EGLint, rcQueryEGLString, EGLenum name, void *buffer, EGLint bufferSize)
+GL_ENTRY(EGLint, rcGetGLString, EGLenum name, void *buffer, EGLint bufferSize)
+GL_ENTRY(EGLint, rcGetNumConfigs, uint32_t *numAttribs)
+GL_ENTRY(EGLint, rcGetConfigs, uint32_t bufSize, GLuint *buffer)
+GL_ENTRY(EGLint, rcChooseConfig, EGLint *attribs, uint32_t attribs_size, uint32_t *configs, uint32_t configs_size)
+GL_ENTRY(EGLint, rcGetFBParam, EGLint param)
+GL_ENTRY(uint32_t, rcCreateContext, uint32_t config, uint32_t share, uint32_t glVersion)
+GL_ENTRY(void, rcDestroyContext, uint32_t context)
+GL_ENTRY(uint32_t, rcCreateWindowSurface, uint32_t config, uint32_t width, uint32_t height)
+GL_ENTRY(void, rcDestroyWindowSurface, uint32_t windowSurface)
+GL_ENTRY(uint32_t, rcCreateColorBuffer, uint32_t width, uint32_t height, GLenum internalFormat)
+GL_ENTRY(void, rcOpenColorBuffer, uint32_t colorbuffer)
+GL_ENTRY(void, rcCloseColorBuffer, uint32_t colorbuffer)
+GL_ENTRY(void, rcSetWindowColorBuffer, uint32_t windowSurface, uint32_t colorBuffer)
+GL_ENTRY(int, rcFlushWindowColorBuffer, uint32_t windowSurface)
+GL_ENTRY(EGLint, rcMakeCurrent, uint32_t context, uint32_t drawSurf, uint32_t readSurf)
+GL_ENTRY(void, rcFBPost, uint32_t colorBuffer)
+GL_ENTRY(void, rcFBSetSwapInterval, EGLint interval)
+GL_ENTRY(void, rcBindTexture, uint32_t colorBuffer)
+GL_ENTRY(void, rcBindRenderbuffer, uint32_t colorBuffer)
+GL_ENTRY(EGLint, rcColorBufferCacheFlush, uint32_t colorbuffer, EGLint postCount,int forRead)
+GL_ENTRY(void, rcReadColorBuffer, uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void *pixels)
+GL_ENTRY(int, rcUpdateColorBuffer, uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void *pixels)
+GL_ENTRY(int, rcOpenColorBuffer2, uint32_t colorbuffer)
+GL_ENTRY(uint32_t, rcCreateClientImage, uint32_t context, EGLenum target, GLuint buffer)
+GL_ENTRY(int, rcDestroyClientImage, uint32_t image)
+GL_ENTRY(void, rcSelectChecksumHelper, uint32_t newProtocol, uint32_t reserved)
+GL_ENTRY(uint32_t, rcCreateColorBufferPuid, uint32_t width, uint32_t height, GLenum internalFormat, uint64_t puid)
+GL_ENTRY(int, rcOpenColorBuffer2Puid, uint32_t colorbuffer, uint64_t puid)
+GL_ENTRY(void, rcCloseColorBufferPuid, uint32_t colorbuffer, uint64_t puid)
+GL_ENTRY(void, rcCreateSyncKHR, EGLenum type, EGLint* attribs, uint32_t num_attribs, uint64_t* glsync_out, uint64_t* syncthread_out)
+GL_ENTRY(EGLint, rcClientWaitSyncKHR, uint64_t sync, EGLint flags, uint64_t timeout)
+GL_ENTRY(void, rcFlushWindowColorBufferAsync, uint32_t windowSurface)
+GL_ENTRY(uint32_t, rcCreateClientImagePuid, uint32_t context, EGLenum target, GLuint buffer, uint64_t puid)
+GL_ENTRY(int, rcDestroyClientImagePuid, uint32_t image, uint64_t puid)
diff --git a/system/renderControl_enc/renderControl.types b/system/renderControl_enc/renderControl.types
new file mode 100644
index 0000000..578492b
--- /dev/null
+++ b/system/renderControl_enc/renderControl.types
@@ -0,0 +1,14 @@
+uint32_t 32 0x%08x
+uint64_t 64 0x%016lx
+EGLint 32 0x%08x
+GLint 32 0x%08x
+GLuint 32 0x%08x
+GLenum 32 0x%08x
+EGLenum 32 0x%08x
+uint32_t* 32 0x%08x
+EGLint* 32 0x%08x
+int* 32 0x%08x
+GLint* 32 0x%08x
+GLuint* 32 0x%08x
+void* 32 0x%08x
+uint64_t* 32 0x%08x
diff --git a/system/renderControl_enc/renderControl_client_base.h b/system/renderControl_enc/renderControl_client_base.h
new file mode 100644
index 0000000..4fb5d76
--- /dev/null
+++ b/system/renderControl_enc/renderControl_client_base.h
@@ -0,0 +1,41 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+#ifndef __renderControl_client_base_t_h
+#define __renderControl_client_base_t_h
+
+#include "renderControl_client_proc.h"
+
+
+struct renderControl_client_base_t {
+
+	rcGetRendererVersion_client_proc_t rcGetRendererVersion;
+	rcGetEGLVersion_client_proc_t rcGetEGLVersion;
+	rcQueryEGLString_client_proc_t rcQueryEGLString;
+	rcGetGLString_client_proc_t rcGetGLString;
+	rcGetNumConfigs_client_proc_t rcGetNumConfigs;
+	rcGetConfigs_client_proc_t rcGetConfigs;
+	rcChooseConfig_client_proc_t rcChooseConfig;
+	rcGetFBParam_client_proc_t rcGetFBParam;
+	rcCreateContext_client_proc_t rcCreateContext;
+	rcDestroyContext_client_proc_t rcDestroyContext;
+	rcCreateWindowSurface_client_proc_t rcCreateWindowSurface;
+	rcDestroyWindowSurface_client_proc_t rcDestroyWindowSurface;
+	rcCreateColorBuffer_client_proc_t rcCreateColorBuffer;
+	rcOpenColorBuffer_client_proc_t rcOpenColorBuffer;
+	rcCloseColorBuffer_client_proc_t rcCloseColorBuffer;
+	rcSetWindowColorBuffer_client_proc_t rcSetWindowColorBuffer;
+	rcFlushWindowColorBuffer_client_proc_t rcFlushWindowColorBuffer;
+	rcMakeCurrent_client_proc_t rcMakeCurrent;
+	rcFBPost_client_proc_t rcFBPost;
+	rcFBSetSwapInterval_client_proc_t rcFBSetSwapInterval;
+	rcBindTexture_client_proc_t rcBindTexture;
+	rcBindRenderbuffer_client_proc_t rcBindRenderbuffer;
+	rcColorBufferCacheFlush_client_proc_t rcColorBufferCacheFlush;
+	rcReadColorBuffer_client_proc_t rcReadColorBuffer;
+	rcUpdateColorBuffer_client_proc_t rcUpdateColorBuffer;
+	rcOpenColorBuffer2_client_proc_t rcOpenColorBuffer2;
+	rcCreateClientImage_client_proc_t rcCreateClientImage;
+	rcDestroyClientImage_client_proc_t rcDestroyClientImage;
+};
+
+#endif
diff --git a/system/renderControl_enc/renderControl_client_context.cpp b/system/renderControl_enc/renderControl_client_context.cpp
new file mode 100644
index 0000000..ae73135
--- /dev/null
+++ b/system/renderControl_enc/renderControl_client_context.cpp
@@ -0,0 +1,85 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+
+
+#include <string.h>
+#include "renderControl_client_context.h"
+
+
+#include <stdio.h>
+
+int renderControl_client_context_t::initDispatchByName(void *(*getProc)(const char *, void *userData), void *userData)
+{
+	rcGetRendererVersion = (rcGetRendererVersion_client_proc_t) getProc("rcGetRendererVersion", userData);
+	rcGetEGLVersion = (rcGetEGLVersion_client_proc_t) getProc("rcGetEGLVersion", userData);
+	rcQueryEGLString = (rcQueryEGLString_client_proc_t) getProc("rcQueryEGLString", userData);
+	rcGetGLString = (rcGetGLString_client_proc_t) getProc("rcGetGLString", userData);
+	rcGetNumConfigs = (rcGetNumConfigs_client_proc_t) getProc("rcGetNumConfigs", userData);
+	rcGetConfigs = (rcGetConfigs_client_proc_t) getProc("rcGetConfigs", userData);
+	rcChooseConfig = (rcChooseConfig_client_proc_t) getProc("rcChooseConfig", userData);
+	rcGetFBParam = (rcGetFBParam_client_proc_t) getProc("rcGetFBParam", userData);
+	rcCreateContext = (rcCreateContext_client_proc_t) getProc("rcCreateContext", userData);
+	rcDestroyContext = (rcDestroyContext_client_proc_t) getProc("rcDestroyContext", userData);
+	rcCreateWindowSurface = (rcCreateWindowSurface_client_proc_t) getProc("rcCreateWindowSurface", userData);
+	rcDestroyWindowSurface = (rcDestroyWindowSurface_client_proc_t) getProc("rcDestroyWindowSurface", userData);
+	rcCreateColorBuffer = (rcCreateColorBuffer_client_proc_t) getProc("rcCreateColorBuffer", userData);
+	rcOpenColorBuffer = (rcOpenColorBuffer_client_proc_t) getProc("rcOpenColorBuffer", userData);
+	rcCloseColorBuffer = (rcCloseColorBuffer_client_proc_t) getProc("rcCloseColorBuffer", userData);
+	rcSetWindowColorBuffer = (rcSetWindowColorBuffer_client_proc_t) getProc("rcSetWindowColorBuffer", userData);
+	rcFlushWindowColorBuffer = (rcFlushWindowColorBuffer_client_proc_t) getProc("rcFlushWindowColorBuffer", userData);
+	rcMakeCurrent = (rcMakeCurrent_client_proc_t) getProc("rcMakeCurrent", userData);
+	rcFBPost = (rcFBPost_client_proc_t) getProc("rcFBPost", userData);
+	rcFBSetSwapInterval = (rcFBSetSwapInterval_client_proc_t) getProc("rcFBSetSwapInterval", userData);
+	rcBindTexture = (rcBindTexture_client_proc_t) getProc("rcBindTexture", userData);
+	rcBindRenderbuffer = (rcBindRenderbuffer_client_proc_t) getProc("rcBindRenderbuffer", userData);
+	rcColorBufferCacheFlush = (rcColorBufferCacheFlush_client_proc_t) getProc("rcColorBufferCacheFlush", userData);
+	rcReadColorBuffer = (rcReadColorBuffer_client_proc_t) getProc("rcReadColorBuffer", userData);
+	rcUpdateColorBuffer = (rcUpdateColorBuffer_client_proc_t) getProc("rcUpdateColorBuffer", userData);
+	rcOpenColorBuffer2 = (rcOpenColorBuffer2_client_proc_t) getProc("rcOpenColorBuffer2", userData);
+	rcCreateClientImage = (rcCreateClientImage_client_proc_t) getProc("rcCreateClientImage", userData);
+	rcDestroyClientImage = (rcDestroyClientImage_client_proc_t) getProc("rcDestroyClientImage", userData);
+	rcSelectChecksumHelper = (rcSelectChecksumHelper_client_proc_t) getProc("rcSelectChecksumHelper", userData);
+	rcCreateSyncKHR = (rcCreateSyncKHR_client_proc_t) getProc("rcCreateSyncKHR", userData);
+	rcClientWaitSyncKHR = (rcClientWaitSyncKHR_client_proc_t) getProc("rcClientWaitSyncKHR", userData);
+	rcFlushWindowColorBufferAsync = (rcFlushWindowColorBufferAsync_client_proc_t) getProc("rcFlushWindowColorBufferAsync", userData);
+	rcDestroySyncKHR = (rcDestroySyncKHR_client_proc_t) getProc("rcDestroySyncKHR", userData);
+	rcSetPuid = (rcSetPuid_client_proc_t) getProc("rcSetPuid", userData);
+	rcUpdateColorBufferDMA = (rcUpdateColorBufferDMA_client_proc_t) getProc("rcUpdateColorBufferDMA", userData);
+	rcCreateColorBufferDMA = (rcCreateColorBufferDMA_client_proc_t) getProc("rcCreateColorBufferDMA", userData);
+	rcWaitSyncKHR = (rcWaitSyncKHR_client_proc_t) getProc("rcWaitSyncKHR", userData);
+	rcCompose = (rcCompose_client_proc_t) getProc("rcCompose", userData);
+	rcCreateDisplay = (rcCreateDisplay_client_proc_t) getProc("rcCreateDisplay", userData);
+	rcDestroyDisplay = (rcDestroyDisplay_client_proc_t) getProc("rcDestroyDisplay", userData);
+	rcSetDisplayColorBuffer = (rcSetDisplayColorBuffer_client_proc_t) getProc("rcSetDisplayColorBuffer", userData);
+	rcGetDisplayColorBuffer = (rcGetDisplayColorBuffer_client_proc_t) getProc("rcGetDisplayColorBuffer", userData);
+	rcGetColorBufferDisplay = (rcGetColorBufferDisplay_client_proc_t) getProc("rcGetColorBufferDisplay", userData);
+	rcGetDisplayPose = (rcGetDisplayPose_client_proc_t) getProc("rcGetDisplayPose", userData);
+	rcSetDisplayPose = (rcSetDisplayPose_client_proc_t) getProc("rcSetDisplayPose", userData);
+	rcSetColorBufferVulkanMode = (rcSetColorBufferVulkanMode_client_proc_t) getProc("rcSetColorBufferVulkanMode", userData);
+	rcReadColorBufferYUV = (rcReadColorBufferYUV_client_proc_t) getProc("rcReadColorBufferYUV", userData);
+	rcIsSyncSignaled = (rcIsSyncSignaled_client_proc_t) getProc("rcIsSyncSignaled", userData);
+	rcCreateColorBufferWithHandle = (rcCreateColorBufferWithHandle_client_proc_t) getProc("rcCreateColorBufferWithHandle", userData);
+	rcCreateBuffer = (rcCreateBuffer_client_proc_t) getProc("rcCreateBuffer", userData);
+	rcCloseBuffer = (rcCloseBuffer_client_proc_t) getProc("rcCloseBuffer", userData);
+	rcSetColorBufferVulkanMode2 = (rcSetColorBufferVulkanMode2_client_proc_t) getProc("rcSetColorBufferVulkanMode2", userData);
+	rcMapGpaToBufferHandle = (rcMapGpaToBufferHandle_client_proc_t) getProc("rcMapGpaToBufferHandle", userData);
+	rcCreateBuffer2 = (rcCreateBuffer2_client_proc_t) getProc("rcCreateBuffer2", userData);
+	rcMapGpaToBufferHandle2 = (rcMapGpaToBufferHandle2_client_proc_t) getProc("rcMapGpaToBufferHandle2", userData);
+	rcFlushWindowColorBufferAsyncWithFrameNumber = (rcFlushWindowColorBufferAsyncWithFrameNumber_client_proc_t) getProc("rcFlushWindowColorBufferAsyncWithFrameNumber", userData);
+	rcSetTracingForPuid = (rcSetTracingForPuid_client_proc_t) getProc("rcSetTracingForPuid", userData);
+	rcMakeCurrentAsync = (rcMakeCurrentAsync_client_proc_t) getProc("rcMakeCurrentAsync", userData);
+	rcComposeAsync = (rcComposeAsync_client_proc_t) getProc("rcComposeAsync", userData);
+	rcDestroySyncKHRAsync = (rcDestroySyncKHRAsync_client_proc_t) getProc("rcDestroySyncKHRAsync", userData);
+	rcComposeWithoutPost = (rcComposeWithoutPost_client_proc_t) getProc("rcComposeWithoutPost", userData);
+	rcComposeAsyncWithoutPost = (rcComposeAsyncWithoutPost_client_proc_t) getProc("rcComposeAsyncWithoutPost", userData);
+	rcCreateDisplayById = (rcCreateDisplayById_client_proc_t) getProc("rcCreateDisplayById", userData);
+	rcSetDisplayPoseDpi = (rcSetDisplayPoseDpi_client_proc_t) getProc("rcSetDisplayPoseDpi", userData);
+	rcReadColorBufferDMA = (rcReadColorBufferDMA_client_proc_t) getProc("rcReadColorBufferDMA", userData);
+	rcGetFBDisplayConfigsCount = (rcGetFBDisplayConfigsCount_client_proc_t) getProc("rcGetFBDisplayConfigsCount", userData);
+	rcGetFBDisplayConfigsParam = (rcGetFBDisplayConfigsParam_client_proc_t) getProc("rcGetFBDisplayConfigsParam", userData);
+	rcGetFBDisplayActiveConfig = (rcGetFBDisplayActiveConfig_client_proc_t) getProc("rcGetFBDisplayActiveConfig", userData);
+	rcSetProcessMetadata = (rcSetProcessMetadata_client_proc_t) getProc("rcSetProcessMetadata", userData);
+	rcGetHostExtensionsString = (rcGetHostExtensionsString_client_proc_t) getProc("rcGetHostExtensionsString", userData);
+	return 0;
+}
+
diff --git a/system/renderControl_enc/renderControl_client_context.h b/system/renderControl_enc/renderControl_client_context.h
new file mode 100644
index 0000000..e85bd01
--- /dev/null
+++ b/system/renderControl_enc/renderControl_client_context.h
@@ -0,0 +1,92 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+#ifndef __renderControl_client_context_t_h
+#define __renderControl_client_context_t_h
+
+#include "renderControl_client_proc.h"
+
+#include "renderControl_types.h"
+
+
+struct renderControl_client_context_t {
+
+	rcGetRendererVersion_client_proc_t rcGetRendererVersion;
+	rcGetEGLVersion_client_proc_t rcGetEGLVersion;
+	rcQueryEGLString_client_proc_t rcQueryEGLString;
+	rcGetGLString_client_proc_t rcGetGLString;
+	rcGetNumConfigs_client_proc_t rcGetNumConfigs;
+	rcGetConfigs_client_proc_t rcGetConfigs;
+	rcChooseConfig_client_proc_t rcChooseConfig;
+	rcGetFBParam_client_proc_t rcGetFBParam;
+	rcCreateContext_client_proc_t rcCreateContext;
+	rcDestroyContext_client_proc_t rcDestroyContext;
+	rcCreateWindowSurface_client_proc_t rcCreateWindowSurface;
+	rcDestroyWindowSurface_client_proc_t rcDestroyWindowSurface;
+	rcCreateColorBuffer_client_proc_t rcCreateColorBuffer;
+	rcOpenColorBuffer_client_proc_t rcOpenColorBuffer;
+	rcCloseColorBuffer_client_proc_t rcCloseColorBuffer;
+	rcSetWindowColorBuffer_client_proc_t rcSetWindowColorBuffer;
+	rcFlushWindowColorBuffer_client_proc_t rcFlushWindowColorBuffer;
+	rcMakeCurrent_client_proc_t rcMakeCurrent;
+	rcFBPost_client_proc_t rcFBPost;
+	rcFBSetSwapInterval_client_proc_t rcFBSetSwapInterval;
+	rcBindTexture_client_proc_t rcBindTexture;
+	rcBindRenderbuffer_client_proc_t rcBindRenderbuffer;
+	rcColorBufferCacheFlush_client_proc_t rcColorBufferCacheFlush;
+	rcReadColorBuffer_client_proc_t rcReadColorBuffer;
+	rcUpdateColorBuffer_client_proc_t rcUpdateColorBuffer;
+	rcOpenColorBuffer2_client_proc_t rcOpenColorBuffer2;
+	rcCreateClientImage_client_proc_t rcCreateClientImage;
+	rcDestroyClientImage_client_proc_t rcDestroyClientImage;
+	rcSelectChecksumHelper_client_proc_t rcSelectChecksumHelper;
+	rcCreateSyncKHR_client_proc_t rcCreateSyncKHR;
+	rcClientWaitSyncKHR_client_proc_t rcClientWaitSyncKHR;
+	rcFlushWindowColorBufferAsync_client_proc_t rcFlushWindowColorBufferAsync;
+	rcDestroySyncKHR_client_proc_t rcDestroySyncKHR;
+	rcSetPuid_client_proc_t rcSetPuid;
+	rcUpdateColorBufferDMA_client_proc_t rcUpdateColorBufferDMA;
+	rcCreateColorBufferDMA_client_proc_t rcCreateColorBufferDMA;
+	rcWaitSyncKHR_client_proc_t rcWaitSyncKHR;
+	rcCompose_client_proc_t rcCompose;
+	rcCreateDisplay_client_proc_t rcCreateDisplay;
+	rcDestroyDisplay_client_proc_t rcDestroyDisplay;
+	rcSetDisplayColorBuffer_client_proc_t rcSetDisplayColorBuffer;
+	rcGetDisplayColorBuffer_client_proc_t rcGetDisplayColorBuffer;
+	rcGetColorBufferDisplay_client_proc_t rcGetColorBufferDisplay;
+	rcGetDisplayPose_client_proc_t rcGetDisplayPose;
+	rcSetDisplayPose_client_proc_t rcSetDisplayPose;
+	rcSetColorBufferVulkanMode_client_proc_t rcSetColorBufferVulkanMode;
+	rcReadColorBufferYUV_client_proc_t rcReadColorBufferYUV;
+	rcIsSyncSignaled_client_proc_t rcIsSyncSignaled;
+	rcCreateColorBufferWithHandle_client_proc_t rcCreateColorBufferWithHandle;
+	rcCreateBuffer_client_proc_t rcCreateBuffer;
+	rcCloseBuffer_client_proc_t rcCloseBuffer;
+	rcSetColorBufferVulkanMode2_client_proc_t rcSetColorBufferVulkanMode2;
+	rcMapGpaToBufferHandle_client_proc_t rcMapGpaToBufferHandle;
+	rcCreateBuffer2_client_proc_t rcCreateBuffer2;
+	rcMapGpaToBufferHandle2_client_proc_t rcMapGpaToBufferHandle2;
+	rcFlushWindowColorBufferAsyncWithFrameNumber_client_proc_t rcFlushWindowColorBufferAsyncWithFrameNumber;
+	rcSetTracingForPuid_client_proc_t rcSetTracingForPuid;
+	rcMakeCurrentAsync_client_proc_t rcMakeCurrentAsync;
+	rcComposeAsync_client_proc_t rcComposeAsync;
+	rcDestroySyncKHRAsync_client_proc_t rcDestroySyncKHRAsync;
+	rcComposeWithoutPost_client_proc_t rcComposeWithoutPost;
+	rcComposeAsyncWithoutPost_client_proc_t rcComposeAsyncWithoutPost;
+	rcCreateDisplayById_client_proc_t rcCreateDisplayById;
+	rcSetDisplayPoseDpi_client_proc_t rcSetDisplayPoseDpi;
+	rcReadColorBufferDMA_client_proc_t rcReadColorBufferDMA;
+	rcGetFBDisplayConfigsCount_client_proc_t rcGetFBDisplayConfigsCount;
+	rcGetFBDisplayConfigsParam_client_proc_t rcGetFBDisplayConfigsParam;
+	rcGetFBDisplayActiveConfig_client_proc_t rcGetFBDisplayActiveConfig;
+	rcSetProcessMetadata_client_proc_t rcSetProcessMetadata;
+	rcGetHostExtensionsString_client_proc_t rcGetHostExtensionsString;
+	virtual ~renderControl_client_context_t() {}
+
+	typedef renderControl_client_context_t *CONTEXT_ACCESSOR_TYPE(void);
+	static void setContextAccessor(CONTEXT_ACCESSOR_TYPE *f);
+	int initDispatchByName( void *(*getProc)(const char *name, void *userData), void *userData);
+	virtual void setError(unsigned int  error){ (void)error; }
+	virtual unsigned int getError(){ return 0; }
+};
+
+#endif
diff --git a/system/renderControl_enc/renderControl_client_proc.h b/system/renderControl_enc/renderControl_client_proc.h
new file mode 100644
index 0000000..c6a03ae
--- /dev/null
+++ b/system/renderControl_enc/renderControl_client_proc.h
@@ -0,0 +1,87 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+#ifndef __renderControl_client_proc_t_h
+#define __renderControl_client_proc_t_h
+
+
+
+#include "renderControl_types.h"
+#ifdef _MSC_VER
+#include <stdint.h>
+#endif
+#ifndef renderControl_APIENTRY
+#define renderControl_APIENTRY 
+#endif
+typedef GLint (renderControl_APIENTRY *rcGetRendererVersion_client_proc_t) (void * ctx);
+typedef EGLint (renderControl_APIENTRY *rcGetEGLVersion_client_proc_t) (void * ctx, EGLint*, EGLint*);
+typedef EGLint (renderControl_APIENTRY *rcQueryEGLString_client_proc_t) (void * ctx, EGLenum, void*, EGLint);
+typedef EGLint (renderControl_APIENTRY *rcGetGLString_client_proc_t) (void * ctx, EGLenum, void*, EGLint);
+typedef EGLint (renderControl_APIENTRY *rcGetNumConfigs_client_proc_t) (void * ctx, uint32_t*);
+typedef EGLint (renderControl_APIENTRY *rcGetConfigs_client_proc_t) (void * ctx, uint32_t, GLuint*);
+typedef EGLint (renderControl_APIENTRY *rcChooseConfig_client_proc_t) (void * ctx, EGLint*, uint32_t, uint32_t*, uint32_t);
+typedef EGLint (renderControl_APIENTRY *rcGetFBParam_client_proc_t) (void * ctx, EGLint);
+typedef uint32_t (renderControl_APIENTRY *rcCreateContext_client_proc_t) (void * ctx, uint32_t, uint32_t, uint32_t);
+typedef void (renderControl_APIENTRY *rcDestroyContext_client_proc_t) (void * ctx, uint32_t);
+typedef uint32_t (renderControl_APIENTRY *rcCreateWindowSurface_client_proc_t) (void * ctx, uint32_t, uint32_t, uint32_t);
+typedef void (renderControl_APIENTRY *rcDestroyWindowSurface_client_proc_t) (void * ctx, uint32_t);
+typedef uint32_t (renderControl_APIENTRY *rcCreateColorBuffer_client_proc_t) (void * ctx, uint32_t, uint32_t, GLenum);
+typedef void (renderControl_APIENTRY *rcOpenColorBuffer_client_proc_t) (void * ctx, uint32_t);
+typedef void (renderControl_APIENTRY *rcCloseColorBuffer_client_proc_t) (void * ctx, uint32_t);
+typedef void (renderControl_APIENTRY *rcSetWindowColorBuffer_client_proc_t) (void * ctx, uint32_t, uint32_t);
+typedef int (renderControl_APIENTRY *rcFlushWindowColorBuffer_client_proc_t) (void * ctx, uint32_t);
+typedef EGLint (renderControl_APIENTRY *rcMakeCurrent_client_proc_t) (void * ctx, uint32_t, uint32_t, uint32_t);
+typedef void (renderControl_APIENTRY *rcFBPost_client_proc_t) (void * ctx, uint32_t);
+typedef void (renderControl_APIENTRY *rcFBSetSwapInterval_client_proc_t) (void * ctx, EGLint);
+typedef void (renderControl_APIENTRY *rcBindTexture_client_proc_t) (void * ctx, uint32_t);
+typedef void (renderControl_APIENTRY *rcBindRenderbuffer_client_proc_t) (void * ctx, uint32_t);
+typedef EGLint (renderControl_APIENTRY *rcColorBufferCacheFlush_client_proc_t) (void * ctx, uint32_t, EGLint, int);
+typedef void (renderControl_APIENTRY *rcReadColorBuffer_client_proc_t) (void * ctx, uint32_t, GLint, GLint, GLint, GLint, GLenum, GLenum, void*);
+typedef int (renderControl_APIENTRY *rcUpdateColorBuffer_client_proc_t) (void * ctx, uint32_t, GLint, GLint, GLint, GLint, GLenum, GLenum, void*);
+typedef int (renderControl_APIENTRY *rcOpenColorBuffer2_client_proc_t) (void * ctx, uint32_t);
+typedef uint32_t (renderControl_APIENTRY *rcCreateClientImage_client_proc_t) (void * ctx, uint32_t, EGLenum, GLuint);
+typedef int (renderControl_APIENTRY *rcDestroyClientImage_client_proc_t) (void * ctx, uint32_t);
+typedef void (renderControl_APIENTRY *rcSelectChecksumHelper_client_proc_t) (void * ctx, uint32_t, uint32_t);
+typedef void (renderControl_APIENTRY *rcCreateSyncKHR_client_proc_t) (void * ctx, EGLenum, EGLint*, uint32_t, int, uint64_t*, uint64_t*);
+typedef EGLint (renderControl_APIENTRY *rcClientWaitSyncKHR_client_proc_t) (void * ctx, uint64_t, EGLint, uint64_t);
+typedef void (renderControl_APIENTRY *rcFlushWindowColorBufferAsync_client_proc_t) (void * ctx, uint32_t);
+typedef int (renderControl_APIENTRY *rcDestroySyncKHR_client_proc_t) (void * ctx, uint64_t);
+typedef void (renderControl_APIENTRY *rcSetPuid_client_proc_t) (void * ctx, uint64_t);
+typedef int (renderControl_APIENTRY *rcUpdateColorBufferDMA_client_proc_t) (void * ctx, uint32_t, GLint, GLint, GLint, GLint, GLenum, GLenum, void*, uint32_t);
+typedef uint32_t (renderControl_APIENTRY *rcCreateColorBufferDMA_client_proc_t) (void * ctx, uint32_t, uint32_t, GLenum, int);
+typedef void (renderControl_APIENTRY *rcWaitSyncKHR_client_proc_t) (void * ctx, uint64_t, EGLint);
+typedef GLint (renderControl_APIENTRY *rcCompose_client_proc_t) (void * ctx, uint32_t, void*);
+typedef int (renderControl_APIENTRY *rcCreateDisplay_client_proc_t) (void * ctx, uint32_t*);
+typedef int (renderControl_APIENTRY *rcDestroyDisplay_client_proc_t) (void * ctx, uint32_t);
+typedef int (renderControl_APIENTRY *rcSetDisplayColorBuffer_client_proc_t) (void * ctx, uint32_t, uint32_t);
+typedef int (renderControl_APIENTRY *rcGetDisplayColorBuffer_client_proc_t) (void * ctx, uint32_t, uint32_t*);
+typedef int (renderControl_APIENTRY *rcGetColorBufferDisplay_client_proc_t) (void * ctx, uint32_t, uint32_t*);
+typedef int (renderControl_APIENTRY *rcGetDisplayPose_client_proc_t) (void * ctx, uint32_t, GLint*, GLint*, uint32_t*, uint32_t*);
+typedef int (renderControl_APIENTRY *rcSetDisplayPose_client_proc_t) (void * ctx, uint32_t, GLint, GLint, uint32_t, uint32_t);
+typedef GLint (renderControl_APIENTRY *rcSetColorBufferVulkanMode_client_proc_t) (void * ctx, uint32_t, uint32_t);
+typedef void (renderControl_APIENTRY *rcReadColorBufferYUV_client_proc_t) (void * ctx, uint32_t, GLint, GLint, GLint, GLint, void*, uint32_t);
+typedef int (renderControl_APIENTRY *rcIsSyncSignaled_client_proc_t) (void * ctx, uint64_t);
+typedef void (renderControl_APIENTRY *rcCreateColorBufferWithHandle_client_proc_t) (void * ctx, uint32_t, uint32_t, GLenum, uint32_t);
+typedef uint32_t (renderControl_APIENTRY *rcCreateBuffer_client_proc_t) (void * ctx, uint32_t);
+typedef void (renderControl_APIENTRY *rcCloseBuffer_client_proc_t) (void * ctx, uint32_t);
+typedef GLint (renderControl_APIENTRY *rcSetColorBufferVulkanMode2_client_proc_t) (void * ctx, uint32_t, uint32_t, uint32_t);
+typedef int (renderControl_APIENTRY *rcMapGpaToBufferHandle_client_proc_t) (void * ctx, uint32_t, uint64_t);
+typedef uint32_t (renderControl_APIENTRY *rcCreateBuffer2_client_proc_t) (void * ctx, uint64_t, uint32_t);
+typedef int (renderControl_APIENTRY *rcMapGpaToBufferHandle2_client_proc_t) (void * ctx, uint32_t, uint64_t, uint64_t);
+typedef void (renderControl_APIENTRY *rcFlushWindowColorBufferAsyncWithFrameNumber_client_proc_t) (void * ctx, uint32_t, uint32_t);
+typedef void (renderControl_APIENTRY *rcSetTracingForPuid_client_proc_t) (void * ctx, uint64_t, uint32_t, uint64_t);
+typedef void (renderControl_APIENTRY *rcMakeCurrentAsync_client_proc_t) (void * ctx, uint32_t, uint32_t, uint32_t);
+typedef void (renderControl_APIENTRY *rcComposeAsync_client_proc_t) (void * ctx, uint32_t, void*);
+typedef void (renderControl_APIENTRY *rcDestroySyncKHRAsync_client_proc_t) (void * ctx, uint64_t);
+typedef GLint (renderControl_APIENTRY *rcComposeWithoutPost_client_proc_t) (void * ctx, uint32_t, void*);
+typedef void (renderControl_APIENTRY *rcComposeAsyncWithoutPost_client_proc_t) (void * ctx, uint32_t, void*);
+typedef int (renderControl_APIENTRY *rcCreateDisplayById_client_proc_t) (void * ctx, uint32_t);
+typedef int (renderControl_APIENTRY *rcSetDisplayPoseDpi_client_proc_t) (void * ctx, uint32_t, GLint, GLint, uint32_t, uint32_t, uint32_t);
+typedef int (renderControl_APIENTRY *rcReadColorBufferDMA_client_proc_t) (void * ctx, uint32_t, GLint, GLint, GLint, GLint, GLenum, GLenum, void*, uint32_t);
+typedef int (renderControl_APIENTRY *rcGetFBDisplayConfigsCount_client_proc_t) (void * ctx);
+typedef int (renderControl_APIENTRY *rcGetFBDisplayConfigsParam_client_proc_t) (void * ctx, int, EGLint);
+typedef int (renderControl_APIENTRY *rcGetFBDisplayActiveConfig_client_proc_t) (void * ctx);
+typedef void (renderControl_APIENTRY *rcSetProcessMetadata_client_proc_t) (void * ctx, char*, RenderControlByte*, uint32_t);
+typedef int (renderControl_APIENTRY *rcGetHostExtensionsString_client_proc_t) (void * ctx, uint32_t, void*);
+
+
+#endif
diff --git a/system/renderControl_enc/renderControl_enc.cpp b/system/renderControl_enc/renderControl_enc.cpp
new file mode 100644
index 0000000..409eb00
--- /dev/null
+++ b/system/renderControl_enc/renderControl_enc.cpp
@@ -0,0 +1,2897 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+
+
+#include <string.h>
+#include "renderControl_opcodes.h"
+
+#include "renderControl_enc.h"
+
+
+#include <vector>
+
+#include <stdio.h>
+
+#include "aemu/base/Tracing.h"
+
+#include "EncoderDebug.h"
+
+using gfxstream::IOStream;
+
+namespace {
+
+void enc_unsupported()
+{
+	ALOGE("Function is unsupported\n");
+}
+
+GLint rcGetRendererVersion_enc(void *self )
+{
+	ENCODER_DEBUG_LOG("rcGetRendererVersion()");
+	AEMU_SCOPED_TRACE("rcGetRendererVersion encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcGetRendererVersion;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLint retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcGetRendererVersion: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+EGLint rcGetEGLVersion_enc(void *self , EGLint* major, EGLint* minor)
+{
+	ENCODER_DEBUG_LOG("rcGetEGLVersion(major:0x%08x, minor:0x%08x)", major, minor);
+	AEMU_SCOPED_TRACE("rcGetEGLVersion encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_major =  sizeof(EGLint);
+	const unsigned int __size_minor =  sizeof(EGLint);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 0 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcGetEGLVersion;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+	memcpy(ptr, &__size_major, 4); ptr += 4;
+	memcpy(ptr, &__size_minor, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(major, __size_major);
+	if (useChecksum) checksumCalculator->addBuffer(major, __size_major);
+	stream->readback(minor, __size_minor);
+	if (useChecksum) checksumCalculator->addBuffer(minor, __size_minor);
+
+	EGLint retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcGetEGLVersion: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+EGLint rcQueryEGLString_enc(void *self , EGLenum name, void* buffer, EGLint bufferSize)
+{
+	ENCODER_DEBUG_LOG("rcQueryEGLString(name:0x%08x, buffer:0x%08x, bufferSize:0x%08x)", name, buffer, bufferSize);
+	AEMU_SCOPED_TRACE("rcQueryEGLString encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_buffer =  bufferSize;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcQueryEGLString;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &name, 4); ptr += 4;
+	memcpy(ptr, &__size_buffer, 4); ptr += 4;
+		memcpy(ptr, &bufferSize, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(buffer, __size_buffer);
+	if (useChecksum) checksumCalculator->addBuffer(buffer, __size_buffer);
+
+	EGLint retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcQueryEGLString: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+EGLint rcGetGLString_enc(void *self , EGLenum name, void* buffer, EGLint bufferSize)
+{
+	ENCODER_DEBUG_LOG("rcGetGLString(name:0x%08x, buffer:0x%08x, bufferSize:0x%08x)", name, buffer, bufferSize);
+	AEMU_SCOPED_TRACE("rcGetGLString encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_buffer =  bufferSize;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcGetGLString;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &name, 4); ptr += 4;
+	memcpy(ptr, &__size_buffer, 4); ptr += 4;
+		memcpy(ptr, &bufferSize, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(buffer, __size_buffer);
+	if (useChecksum) checksumCalculator->addBuffer(buffer, __size_buffer);
+
+	EGLint retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcGetGLString: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+EGLint rcGetNumConfigs_enc(void *self , uint32_t* numAttribs)
+{
+	ENCODER_DEBUG_LOG("rcGetNumConfigs(numAttribs:0x%08x)", numAttribs);
+	AEMU_SCOPED_TRACE("rcGetNumConfigs encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_numAttribs =  sizeof(uint32_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcGetNumConfigs;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+	memcpy(ptr, &__size_numAttribs, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(numAttribs, __size_numAttribs);
+	if (useChecksum) checksumCalculator->addBuffer(numAttribs, __size_numAttribs);
+
+	EGLint retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcGetNumConfigs: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+EGLint rcGetConfigs_enc(void *self , uint32_t bufSize, GLuint* buffer)
+{
+	ENCODER_DEBUG_LOG("rcGetConfigs(bufSize:0x%08x, buffer:0x%08x)", bufSize, buffer);
+	AEMU_SCOPED_TRACE("rcGetConfigs encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_buffer =  bufSize;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcGetConfigs;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &bufSize, 4); ptr += 4;
+	memcpy(ptr, &__size_buffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(buffer, __size_buffer);
+	if (useChecksum) checksumCalculator->addBuffer(buffer, __size_buffer);
+
+	EGLint retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcGetConfigs: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+EGLint rcChooseConfig_enc(void *self , EGLint* attribs, uint32_t attribs_size, uint32_t* configs, uint32_t configs_size)
+{
+	ENCODER_DEBUG_LOG("rcChooseConfig(attribs:0x%08x, attribs_size:0x%08x, configs:0x%08x, configs_size:0x%08x)", attribs, attribs_size, configs, configs_size);
+	AEMU_SCOPED_TRACE("rcChooseConfig encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_attribs =  attribs_size;
+	const unsigned int __size_configs = ((configs != NULL) ?  configs_size*sizeof(uint32_t) : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + __size_attribs + 4 + 0 + 4 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcChooseConfig;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+	memcpy(ptr, &__size_attribs, 4); ptr += 4;
+	memcpy(ptr, attribs, __size_attribs);ptr += __size_attribs;
+		memcpy(ptr, &attribs_size, 4); ptr += 4;
+	memcpy(ptr, &__size_configs, 4); ptr += 4;
+		memcpy(ptr, &configs_size, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	if (configs != NULL) {
+		stream->readback(configs, __size_configs);
+		if (useChecksum) checksumCalculator->addBuffer(configs, __size_configs);
+	}
+
+	EGLint retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcChooseConfig: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+EGLint rcGetFBParam_enc(void *self , EGLint param)
+{
+	ENCODER_DEBUG_LOG("rcGetFBParam(param:0x%08x)", param);
+	AEMU_SCOPED_TRACE("rcGetFBParam encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcGetFBParam;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	EGLint retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcGetFBParam: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+uint32_t rcCreateContext_enc(void *self , uint32_t config, uint32_t share, uint32_t glVersion)
+{
+	ENCODER_DEBUG_LOG("rcCreateContext(config:0x%08x, share:0x%08x, glVersion:0x%08x)", config, share, glVersion);
+	AEMU_SCOPED_TRACE("rcCreateContext encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcCreateContext;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &config, 4); ptr += 4;
+		memcpy(ptr, &share, 4); ptr += 4;
+		memcpy(ptr, &glVersion, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	uint32_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcCreateContext: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void rcDestroyContext_enc(void *self , uint32_t context)
+{
+	ENCODER_DEBUG_LOG("rcDestroyContext(context:0x%08x)", context);
+	AEMU_SCOPED_TRACE("rcDestroyContext encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcDestroyContext;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &context, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+uint32_t rcCreateWindowSurface_enc(void *self , uint32_t config, uint32_t width, uint32_t height)
+{
+	ENCODER_DEBUG_LOG("rcCreateWindowSurface(config:0x%08x, width:0x%08x, height:0x%08x)", config, width, height);
+	AEMU_SCOPED_TRACE("rcCreateWindowSurface encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcCreateWindowSurface;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &config, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	uint32_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcCreateWindowSurface: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void rcDestroyWindowSurface_enc(void *self , uint32_t windowSurface)
+{
+	ENCODER_DEBUG_LOG("rcDestroyWindowSurface(windowSurface:0x%08x)", windowSurface);
+	AEMU_SCOPED_TRACE("rcDestroyWindowSurface encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcDestroyWindowSurface;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &windowSurface, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+uint32_t rcCreateColorBuffer_enc(void *self , uint32_t width, uint32_t height, GLenum internalFormat)
+{
+	ENCODER_DEBUG_LOG("rcCreateColorBuffer(width:0x%08x, height:0x%08x, internalFormat:0x%08x)", width, height, internalFormat);
+	AEMU_SCOPED_TRACE("rcCreateColorBuffer encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcCreateColorBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &internalFormat, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	uint32_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcCreateColorBuffer: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void rcOpenColorBuffer_enc(void *self , uint32_t colorbuffer)
+{
+	ENCODER_DEBUG_LOG("rcOpenColorBuffer(colorbuffer:0x%08x)", colorbuffer);
+	AEMU_SCOPED_TRACE("rcOpenColorBuffer encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcOpenColorBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &colorbuffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void rcCloseColorBuffer_enc(void *self , uint32_t colorbuffer)
+{
+	ENCODER_DEBUG_LOG("rcCloseColorBuffer(colorbuffer:0x%08x)", colorbuffer);
+	AEMU_SCOPED_TRACE("rcCloseColorBuffer encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcCloseColorBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &colorbuffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->flush();
+}
+
+void rcSetWindowColorBuffer_enc(void *self , uint32_t windowSurface, uint32_t colorBuffer)
+{
+	ENCODER_DEBUG_LOG("rcSetWindowColorBuffer(windowSurface:0x%08x, colorBuffer:0x%08x)", windowSurface, colorBuffer);
+	AEMU_SCOPED_TRACE("rcSetWindowColorBuffer encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcSetWindowColorBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &windowSurface, 4); ptr += 4;
+		memcpy(ptr, &colorBuffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+int rcFlushWindowColorBuffer_enc(void *self , uint32_t windowSurface)
+{
+	ENCODER_DEBUG_LOG("rcFlushWindowColorBuffer(windowSurface:0x%08x)", windowSurface);
+	AEMU_SCOPED_TRACE("rcFlushWindowColorBuffer encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcFlushWindowColorBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &windowSurface, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	int retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcFlushWindowColorBuffer: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+EGLint rcMakeCurrent_enc(void *self , uint32_t context, uint32_t drawSurf, uint32_t readSurf)
+{
+	ENCODER_DEBUG_LOG("rcMakeCurrent(context:0x%08x, drawSurf:0x%08x, readSurf:0x%08x)", context, drawSurf, readSurf);
+	AEMU_SCOPED_TRACE("rcMakeCurrent encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcMakeCurrent;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &context, 4); ptr += 4;
+		memcpy(ptr, &drawSurf, 4); ptr += 4;
+		memcpy(ptr, &readSurf, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	EGLint retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcMakeCurrent: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void rcFBPost_enc(void *self , uint32_t colorBuffer)
+{
+	ENCODER_DEBUG_LOG("rcFBPost(colorBuffer:0x%08x)", colorBuffer);
+	AEMU_SCOPED_TRACE("rcFBPost encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcFBPost;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &colorBuffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void rcFBSetSwapInterval_enc(void *self , EGLint interval)
+{
+	ENCODER_DEBUG_LOG("rcFBSetSwapInterval(interval:0x%08x)", interval);
+	AEMU_SCOPED_TRACE("rcFBSetSwapInterval encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcFBSetSwapInterval;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &interval, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void rcBindTexture_enc(void *self , uint32_t colorBuffer)
+{
+	ENCODER_DEBUG_LOG("rcBindTexture(colorBuffer:0x%08x)", colorBuffer);
+	AEMU_SCOPED_TRACE("rcBindTexture encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcBindTexture;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &colorBuffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void rcBindRenderbuffer_enc(void *self , uint32_t colorBuffer)
+{
+	ENCODER_DEBUG_LOG("rcBindRenderbuffer(colorBuffer:0x%08x)", colorBuffer);
+	AEMU_SCOPED_TRACE("rcBindRenderbuffer encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcBindRenderbuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &colorBuffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+EGLint rcColorBufferCacheFlush_enc(void *self , uint32_t colorbuffer, EGLint postCount, int forRead)
+{
+	ENCODER_DEBUG_LOG("rcColorBufferCacheFlush(colorbuffer:0x%08x, postCount:0x%08x, forRead:%d)", colorbuffer, postCount, forRead);
+	AEMU_SCOPED_TRACE("rcColorBufferCacheFlush encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcColorBufferCacheFlush;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &colorbuffer, 4); ptr += 4;
+		memcpy(ptr, &postCount, 4); ptr += 4;
+		memcpy(ptr, &forRead, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	EGLint retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcColorBufferCacheFlush: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void rcReadColorBuffer_enc(void *self , uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels)
+{
+	ENCODER_DEBUG_LOG("rcReadColorBuffer(colorbuffer:0x%08x, x:0x%08x, y:0x%08x, width:0x%08x, height:0x%08x, format:0x%08x, type:0x%08x, pixels:0x%08x)", colorbuffer, x, y, width, height, format, type, pixels);
+	AEMU_SCOPED_TRACE("rcReadColorBuffer encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_pixels =  (((glUtilsPixelBitSize(format, type) * width) >> 3) * height);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcReadColorBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &colorbuffer, 4); ptr += 4;
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+	memcpy(ptr, &__size_pixels, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(pixels, __size_pixels);
+	if (useChecksum) checksumCalculator->addBuffer(pixels, __size_pixels);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcReadColorBuffer: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+int rcUpdateColorBuffer_enc(void *self , uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels)
+{
+	ENCODER_DEBUG_LOG("rcUpdateColorBuffer(colorbuffer:0x%08x, x:0x%08x, y:0x%08x, width:0x%08x, height:0x%08x, format:0x%08x, type:0x%08x, pixels:0x%08x)", colorbuffer, x, y, width, height, format, type, pixels);
+	AEMU_SCOPED_TRACE("rcUpdateColorBuffer encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_pixels =  (((glUtilsPixelBitSize(format, type) * width) >> 3) * height);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
+	ptr = buf;
+	int tmp = OP_rcUpdateColorBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &colorbuffer, 4); ptr += 4;
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	stream->flush();
+	stream->writeFully(&__size_pixels,4);
+	if (useChecksum) checksumCalculator->addBuffer(&__size_pixels,4);
+		stream->writeFully(pixels, __size_pixels);
+		if (useChecksum) checksumCalculator->addBuffer(pixels, __size_pixels);
+	buf = stream->alloc(checksumSize);
+	if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
+
+
+	int retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcUpdateColorBuffer: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+int rcOpenColorBuffer2_enc(void *self , uint32_t colorbuffer)
+{
+	ENCODER_DEBUG_LOG("rcOpenColorBuffer2(colorbuffer:0x%08x)", colorbuffer);
+	AEMU_SCOPED_TRACE("rcOpenColorBuffer2 encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcOpenColorBuffer2;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &colorbuffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	int retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcOpenColorBuffer2: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+uint32_t rcCreateClientImage_enc(void *self , uint32_t context, EGLenum target, GLuint buffer)
+{
+	ENCODER_DEBUG_LOG("rcCreateClientImage(context:0x%08x, target:0x%08x, buffer:0x%08x)", context, target, buffer);
+	AEMU_SCOPED_TRACE("rcCreateClientImage encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcCreateClientImage;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &context, 4); ptr += 4;
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &buffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	uint32_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcCreateClientImage: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+int rcDestroyClientImage_enc(void *self , uint32_t image)
+{
+	ENCODER_DEBUG_LOG("rcDestroyClientImage(image:0x%08x)", image);
+	AEMU_SCOPED_TRACE("rcDestroyClientImage encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcDestroyClientImage;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &image, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	int retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcDestroyClientImage: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void rcSelectChecksumHelper_enc(void *self , uint32_t newProtocol, uint32_t reserved)
+{
+	ENCODER_DEBUG_LOG("rcSelectChecksumHelper(newProtocol:0x%08x, reserved:0x%08x)", newProtocol, reserved);
+	AEMU_SCOPED_TRACE("rcSelectChecksumHelper encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcSelectChecksumHelper;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &newProtocol, 4); ptr += 4;
+		memcpy(ptr, &reserved, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void rcCreateSyncKHR_enc(void *self , EGLenum type, EGLint* attribs, uint32_t num_attribs, int destroy_when_signaled, uint64_t* glsync_out, uint64_t* syncthread_out)
+{
+	ENCODER_DEBUG_LOG("rcCreateSyncKHR(type:0x%08x, attribs:0x%08x, num_attribs:0x%08x, destroy_when_signaled:%d, glsync_out:0x%08x, syncthread_out:0x%08x)", type, attribs, num_attribs, destroy_when_signaled, glsync_out, syncthread_out);
+	AEMU_SCOPED_TRACE("rcCreateSyncKHR encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_attribs =  num_attribs;
+	const unsigned int __size_glsync_out =  sizeof(uint64_t);
+	const unsigned int __size_syncthread_out =  sizeof(uint64_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_attribs + 4 + 4 + 0 + 0 + 3*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcCreateSyncKHR;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &type, 4); ptr += 4;
+	memcpy(ptr, &__size_attribs, 4); ptr += 4;
+	memcpy(ptr, attribs, __size_attribs);ptr += __size_attribs;
+		memcpy(ptr, &num_attribs, 4); ptr += 4;
+		memcpy(ptr, &destroy_when_signaled, 4); ptr += 4;
+	memcpy(ptr, &__size_glsync_out, 4); ptr += 4;
+	memcpy(ptr, &__size_syncthread_out, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(glsync_out, __size_glsync_out);
+	if (useChecksum) checksumCalculator->addBuffer(glsync_out, __size_glsync_out);
+	stream->readback(syncthread_out, __size_syncthread_out);
+	if (useChecksum) checksumCalculator->addBuffer(syncthread_out, __size_syncthread_out);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcCreateSyncKHR: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+EGLint rcClientWaitSyncKHR_enc(void *self , uint64_t sync, EGLint flags, uint64_t timeout)
+{
+	ENCODER_DEBUG_LOG("rcClientWaitSyncKHR(sync:0x%016lx, flags:0x%08x, timeout:0x%016lx)", sync, flags, timeout);
+	AEMU_SCOPED_TRACE("rcClientWaitSyncKHR encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 4 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcClientWaitSyncKHR;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &sync, 8); ptr += 8;
+		memcpy(ptr, &flags, 4); ptr += 4;
+		memcpy(ptr, &timeout, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	EGLint retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcClientWaitSyncKHR: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void rcFlushWindowColorBufferAsync_enc(void *self , uint32_t windowSurface)
+{
+	ENCODER_DEBUG_LOG("rcFlushWindowColorBufferAsync(windowSurface:0x%08x)", windowSurface);
+	AEMU_SCOPED_TRACE("rcFlushWindowColorBufferAsync encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcFlushWindowColorBufferAsync;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &windowSurface, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+int rcDestroySyncKHR_enc(void *self , uint64_t sync)
+{
+	ENCODER_DEBUG_LOG("rcDestroySyncKHR(sync:0x%016lx)", sync);
+	AEMU_SCOPED_TRACE("rcDestroySyncKHR encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcDestroySyncKHR;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &sync, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	int retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcDestroySyncKHR: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void rcSetPuid_enc(void *self , uint64_t puid)
+{
+	ENCODER_DEBUG_LOG("rcSetPuid(puid:0x%016lx)", puid);
+	AEMU_SCOPED_TRACE("rcSetPuid encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcSetPuid;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &puid, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+int rcUpdateColorBufferDMA_enc(void *self , uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels, uint32_t pixels_size)
+{
+	ENCODER_DEBUG_LOG("rcUpdateColorBufferDMA(colorbuffer:0x%08x, x:0x%08x, y:0x%08x, width:0x%08x, height:0x%08x, format:0x%08x, type:0x%08x, pixels:0x%08x, pixels_size:0x%08x)", colorbuffer, x, y, width, height, format, type, pixels, pixels_size);
+	AEMU_SCOPED_TRACE("rcUpdateColorBufferDMA encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_pixels =  pixels_size;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 8 + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcUpdateColorBufferDMA;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &colorbuffer, 4); ptr += 4;
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+	*(uint64_t *)(ptr) = ctx->lockAndWriteDma(pixels, __size_pixels); ptr += 8;
+		memcpy(ptr, &pixels_size, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	int retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcUpdateColorBufferDMA: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+uint32_t rcCreateColorBufferDMA_enc(void *self , uint32_t width, uint32_t height, GLenum internalFormat, int frameworkFormat)
+{
+	ENCODER_DEBUG_LOG("rcCreateColorBufferDMA(width:0x%08x, height:0x%08x, internalFormat:0x%08x, frameworkFormat:%d)", width, height, internalFormat, frameworkFormat);
+	AEMU_SCOPED_TRACE("rcCreateColorBufferDMA encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcCreateColorBufferDMA;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &internalFormat, 4); ptr += 4;
+		memcpy(ptr, &frameworkFormat, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	uint32_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcCreateColorBufferDMA: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void rcWaitSyncKHR_enc(void *self , uint64_t sync, EGLint flags)
+{
+	ENCODER_DEBUG_LOG("rcWaitSyncKHR(sync:0x%016lx, flags:0x%08x)", sync, flags);
+	AEMU_SCOPED_TRACE("rcWaitSyncKHR encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcWaitSyncKHR;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &sync, 8); ptr += 8;
+		memcpy(ptr, &flags, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+GLint rcCompose_enc(void *self , uint32_t bufferSize, void* buffer)
+{
+	ENCODER_DEBUG_LOG("rcCompose(bufferSize:0x%08x, buffer:0x%08x)", bufferSize, buffer);
+	AEMU_SCOPED_TRACE("rcCompose encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_buffer =  bufferSize;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_buffer + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcCompose;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &bufferSize, 4); ptr += 4;
+	memcpy(ptr, &__size_buffer, 4); ptr += 4;
+	memcpy(ptr, buffer, __size_buffer);ptr += __size_buffer;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLint retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcCompose: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+int rcCreateDisplay_enc(void *self , uint32_t* displayId)
+{
+	ENCODER_DEBUG_LOG("rcCreateDisplay(displayId:0x%08x)", displayId);
+	AEMU_SCOPED_TRACE("rcCreateDisplay encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_displayId =  sizeof(uint32_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcCreateDisplay;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+	memcpy(ptr, &__size_displayId, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(displayId, __size_displayId);
+	if (useChecksum) checksumCalculator->addBuffer(displayId, __size_displayId);
+
+	int retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcCreateDisplay: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+int rcDestroyDisplay_enc(void *self , uint32_t displayId)
+{
+	ENCODER_DEBUG_LOG("rcDestroyDisplay(displayId:0x%08x)", displayId);
+	AEMU_SCOPED_TRACE("rcDestroyDisplay encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcDestroyDisplay;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &displayId, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	int retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcDestroyDisplay: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+int rcSetDisplayColorBuffer_enc(void *self , uint32_t displayId, uint32_t colorBuffer)
+{
+	ENCODER_DEBUG_LOG("rcSetDisplayColorBuffer(displayId:0x%08x, colorBuffer:0x%08x)", displayId, colorBuffer);
+	AEMU_SCOPED_TRACE("rcSetDisplayColorBuffer encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcSetDisplayColorBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &displayId, 4); ptr += 4;
+		memcpy(ptr, &colorBuffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	int retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcSetDisplayColorBuffer: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+int rcGetDisplayColorBuffer_enc(void *self , uint32_t displayId, uint32_t* colorBuffer)
+{
+	ENCODER_DEBUG_LOG("rcGetDisplayColorBuffer(displayId:0x%08x, colorBuffer:0x%08x)", displayId, colorBuffer);
+	AEMU_SCOPED_TRACE("rcGetDisplayColorBuffer encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_colorBuffer =  sizeof(uint32_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcGetDisplayColorBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &displayId, 4); ptr += 4;
+	memcpy(ptr, &__size_colorBuffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(colorBuffer, __size_colorBuffer);
+	if (useChecksum) checksumCalculator->addBuffer(colorBuffer, __size_colorBuffer);
+
+	int retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcGetDisplayColorBuffer: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+int rcGetColorBufferDisplay_enc(void *self , uint32_t colorBuffer, uint32_t* displayId)
+{
+	ENCODER_DEBUG_LOG("rcGetColorBufferDisplay(colorBuffer:0x%08x, displayId:0x%08x)", colorBuffer, displayId);
+	AEMU_SCOPED_TRACE("rcGetColorBufferDisplay encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_displayId =  sizeof(uint32_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcGetColorBufferDisplay;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &colorBuffer, 4); ptr += 4;
+	memcpy(ptr, &__size_displayId, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(displayId, __size_displayId);
+	if (useChecksum) checksumCalculator->addBuffer(displayId, __size_displayId);
+
+	int retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcGetColorBufferDisplay: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+int rcGetDisplayPose_enc(void *self , uint32_t displayId, GLint* x, GLint* y, uint32_t* w, uint32_t* h)
+{
+	ENCODER_DEBUG_LOG("rcGetDisplayPose(displayId:0x%08x, x:0x%08x, y:0x%08x, w:0x%08x, h:0x%08x)", displayId, x, y, w, h);
+	AEMU_SCOPED_TRACE("rcGetDisplayPose encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_x =  sizeof(int32_t);
+	const unsigned int __size_y =  sizeof(int32_t);
+	const unsigned int __size_w =  sizeof(uint32_t);
+	const unsigned int __size_h =  sizeof(uint32_t);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 0 + 0 + 0 + 4*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcGetDisplayPose;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &displayId, 4); ptr += 4;
+	memcpy(ptr, &__size_x, 4); ptr += 4;
+	memcpy(ptr, &__size_y, 4); ptr += 4;
+	memcpy(ptr, &__size_w, 4); ptr += 4;
+	memcpy(ptr, &__size_h, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(x, __size_x);
+	if (useChecksum) checksumCalculator->addBuffer(x, __size_x);
+	stream->readback(y, __size_y);
+	if (useChecksum) checksumCalculator->addBuffer(y, __size_y);
+	stream->readback(w, __size_w);
+	if (useChecksum) checksumCalculator->addBuffer(w, __size_w);
+	stream->readback(h, __size_h);
+	if (useChecksum) checksumCalculator->addBuffer(h, __size_h);
+
+	int retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcGetDisplayPose: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+int rcSetDisplayPose_enc(void *self , uint32_t displayId, GLint x, GLint y, uint32_t w, uint32_t h)
+{
+	ENCODER_DEBUG_LOG("rcSetDisplayPose(displayId:0x%08x, x:0x%08x, y:0x%08x, w:0x%08x, h:0x%08x)", displayId, x, y, w, h);
+	AEMU_SCOPED_TRACE("rcSetDisplayPose encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcSetDisplayPose;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &displayId, 4); ptr += 4;
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &w, 4); ptr += 4;
+		memcpy(ptr, &h, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	int retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcSetDisplayPose: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+GLint rcSetColorBufferVulkanMode_enc(void *self , uint32_t colorBuffer, uint32_t mode)
+{
+	ENCODER_DEBUG_LOG("rcSetColorBufferVulkanMode(colorBuffer:0x%08x, mode:0x%08x)", colorBuffer, mode);
+	AEMU_SCOPED_TRACE("rcSetColorBufferVulkanMode encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcSetColorBufferVulkanMode;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &colorBuffer, 4); ptr += 4;
+		memcpy(ptr, &mode, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLint retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcSetColorBufferVulkanMode: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void rcReadColorBufferYUV_enc(void *self , uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, void* pixels, uint32_t pixels_size)
+{
+	ENCODER_DEBUG_LOG("rcReadColorBufferYUV(colorbuffer:0x%08x, x:0x%08x, y:0x%08x, width:0x%08x, height:0x%08x, pixels:0x%08x, pixels_size:0x%08x)", colorbuffer, x, y, width, height, pixels, pixels_size);
+	AEMU_SCOPED_TRACE("rcReadColorBufferYUV encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_pixels =  pixels_size;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 0 + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcReadColorBufferYUV;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &colorbuffer, 4); ptr += 4;
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+	memcpy(ptr, &__size_pixels, 4); ptr += 4;
+		memcpy(ptr, &pixels_size, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(pixels, __size_pixels);
+	if (useChecksum) checksumCalculator->addBuffer(pixels, __size_pixels);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcReadColorBufferYUV: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+int rcIsSyncSignaled_enc(void *self , uint64_t sync)
+{
+	ENCODER_DEBUG_LOG("rcIsSyncSignaled(sync:0x%016lx)", sync);
+	AEMU_SCOPED_TRACE("rcIsSyncSignaled encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcIsSyncSignaled;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &sync, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	int retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcIsSyncSignaled: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void rcCreateColorBufferWithHandle_enc(void *self , uint32_t width, uint32_t height, GLenum internalFormat, uint32_t handle)
+{
+	ENCODER_DEBUG_LOG("rcCreateColorBufferWithHandle(width:0x%08x, height:0x%08x, internalFormat:0x%08x, handle:0x%08x)", width, height, internalFormat, handle);
+	AEMU_SCOPED_TRACE("rcCreateColorBufferWithHandle encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcCreateColorBufferWithHandle;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &internalFormat, 4); ptr += 4;
+		memcpy(ptr, &handle, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+uint32_t rcCreateBuffer_enc(void *self , uint32_t size)
+{
+	ENCODER_DEBUG_LOG("rcCreateBuffer(size:0x%08x)", size);
+	AEMU_SCOPED_TRACE("rcCreateBuffer encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcCreateBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &size, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	uint32_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcCreateBuffer: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void rcCloseBuffer_enc(void *self , uint32_t buffer)
+{
+	ENCODER_DEBUG_LOG("rcCloseBuffer(buffer:0x%08x)", buffer);
+	AEMU_SCOPED_TRACE("rcCloseBuffer encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcCloseBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &buffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+GLint rcSetColorBufferVulkanMode2_enc(void *self , uint32_t colorBuffer, uint32_t mode, uint32_t memoryProperty)
+{
+	ENCODER_DEBUG_LOG("rcSetColorBufferVulkanMode2(colorBuffer:0x%08x, mode:0x%08x, memoryProperty:0x%08x)", colorBuffer, mode, memoryProperty);
+	AEMU_SCOPED_TRACE("rcSetColorBufferVulkanMode2 encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcSetColorBufferVulkanMode2;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &colorBuffer, 4); ptr += 4;
+		memcpy(ptr, &mode, 4); ptr += 4;
+		memcpy(ptr, &memoryProperty, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLint retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcSetColorBufferVulkanMode2: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+int rcMapGpaToBufferHandle_enc(void *self , uint32_t bufferHandle, uint64_t gpa)
+{
+	ENCODER_DEBUG_LOG("rcMapGpaToBufferHandle(bufferHandle:0x%08x, gpa:0x%016lx)", bufferHandle, gpa);
+	AEMU_SCOPED_TRACE("rcMapGpaToBufferHandle encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcMapGpaToBufferHandle;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &bufferHandle, 4); ptr += 4;
+		memcpy(ptr, &gpa, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	int retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcMapGpaToBufferHandle: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+uint32_t rcCreateBuffer2_enc(void *self , uint64_t size, uint32_t memoryProperty)
+{
+	ENCODER_DEBUG_LOG("rcCreateBuffer2(size:0x%016lx, memoryProperty:0x%08x)", size, memoryProperty);
+	AEMU_SCOPED_TRACE("rcCreateBuffer2 encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcCreateBuffer2;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &size, 8); ptr += 8;
+		memcpy(ptr, &memoryProperty, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	uint32_t retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcCreateBuffer2: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+int rcMapGpaToBufferHandle2_enc(void *self , uint32_t bufferHandle, uint64_t gpa, uint64_t size)
+{
+	ENCODER_DEBUG_LOG("rcMapGpaToBufferHandle2(bufferHandle:0x%08x, gpa:0x%016lx, size:0x%016lx)", bufferHandle, gpa, size);
+	AEMU_SCOPED_TRACE("rcMapGpaToBufferHandle2 encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 8 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcMapGpaToBufferHandle2;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &bufferHandle, 4); ptr += 4;
+		memcpy(ptr, &gpa, 8); ptr += 8;
+		memcpy(ptr, &size, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	int retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcMapGpaToBufferHandle2: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void rcFlushWindowColorBufferAsyncWithFrameNumber_enc(void *self , uint32_t windowSurface, uint32_t frameNumber)
+{
+	ENCODER_DEBUG_LOG("rcFlushWindowColorBufferAsyncWithFrameNumber(windowSurface:0x%08x, frameNumber:0x%08x)", windowSurface, frameNumber);
+	AEMU_SCOPED_TRACE("rcFlushWindowColorBufferAsyncWithFrameNumber encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcFlushWindowColorBufferAsyncWithFrameNumber;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &windowSurface, 4); ptr += 4;
+		memcpy(ptr, &frameNumber, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void rcSetTracingForPuid_enc(void *self , uint64_t puid, uint32_t enable, uint64_t guestTime)
+{
+	ENCODER_DEBUG_LOG("rcSetTracingForPuid(puid:0x%016lx, enable:0x%08x, guestTime:0x%016lx)", puid, enable, guestTime);
+	AEMU_SCOPED_TRACE("rcSetTracingForPuid encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 4 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcSetTracingForPuid;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &puid, 8); ptr += 8;
+		memcpy(ptr, &enable, 4); ptr += 4;
+		memcpy(ptr, &guestTime, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void rcMakeCurrentAsync_enc(void *self , uint32_t context, uint32_t drawSurf, uint32_t readSurf)
+{
+	ENCODER_DEBUG_LOG("rcMakeCurrentAsync(context:0x%08x, drawSurf:0x%08x, readSurf:0x%08x)", context, drawSurf, readSurf);
+	AEMU_SCOPED_TRACE("rcMakeCurrentAsync encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcMakeCurrentAsync;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &context, 4); ptr += 4;
+		memcpy(ptr, &drawSurf, 4); ptr += 4;
+		memcpy(ptr, &readSurf, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->flush();
+}
+
+void rcComposeAsync_enc(void *self , uint32_t bufferSize, void* buffer)
+{
+	ENCODER_DEBUG_LOG("rcComposeAsync(bufferSize:0x%08x, buffer:0x%08x)", bufferSize, buffer);
+	AEMU_SCOPED_TRACE("rcComposeAsync encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_buffer =  bufferSize;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_buffer + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcComposeAsync;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &bufferSize, 4); ptr += 4;
+	memcpy(ptr, &__size_buffer, 4); ptr += 4;
+	memcpy(ptr, buffer, __size_buffer);ptr += __size_buffer;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->flush();
+}
+
+void rcDestroySyncKHRAsync_enc(void *self , uint64_t sync)
+{
+	ENCODER_DEBUG_LOG("rcDestroySyncKHRAsync(sync:0x%016lx)", sync);
+	AEMU_SCOPED_TRACE("rcDestroySyncKHRAsync encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcDestroySyncKHRAsync;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &sync, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->flush();
+}
+
+GLint rcComposeWithoutPost_enc(void *self , uint32_t bufferSize, void* buffer)
+{
+	ENCODER_DEBUG_LOG("rcComposeWithoutPost(bufferSize:0x%08x, buffer:0x%08x)", bufferSize, buffer);
+	AEMU_SCOPED_TRACE("rcComposeWithoutPost encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_buffer =  bufferSize;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_buffer + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcComposeWithoutPost;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &bufferSize, 4); ptr += 4;
+	memcpy(ptr, &__size_buffer, 4); ptr += 4;
+	memcpy(ptr, buffer, __size_buffer);ptr += __size_buffer;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLint retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcComposeWithoutPost: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void rcComposeAsyncWithoutPost_enc(void *self , uint32_t bufferSize, void* buffer)
+{
+	ENCODER_DEBUG_LOG("rcComposeAsyncWithoutPost(bufferSize:0x%08x, buffer:0x%08x)", bufferSize, buffer);
+	AEMU_SCOPED_TRACE("rcComposeAsyncWithoutPost encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_buffer =  bufferSize;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_buffer + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcComposeAsyncWithoutPost;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &bufferSize, 4); ptr += 4;
+	memcpy(ptr, &__size_buffer, 4); ptr += 4;
+	memcpy(ptr, buffer, __size_buffer);ptr += __size_buffer;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->flush();
+}
+
+int rcCreateDisplayById_enc(void *self , uint32_t displayId)
+{
+	ENCODER_DEBUG_LOG("rcCreateDisplayById(displayId:0x%08x)", displayId);
+	AEMU_SCOPED_TRACE("rcCreateDisplayById encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcCreateDisplayById;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &displayId, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	int retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcCreateDisplayById: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+int rcSetDisplayPoseDpi_enc(void *self , uint32_t displayId, GLint x, GLint y, uint32_t w, uint32_t h, uint32_t dpi)
+{
+	ENCODER_DEBUG_LOG("rcSetDisplayPoseDpi(displayId:0x%08x, x:0x%08x, y:0x%08x, w:0x%08x, h:0x%08x, dpi:0x%08x)", displayId, x, y, w, h, dpi);
+	AEMU_SCOPED_TRACE("rcSetDisplayPoseDpi encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcSetDisplayPoseDpi;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &displayId, 4); ptr += 4;
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &w, 4); ptr += 4;
+		memcpy(ptr, &h, 4); ptr += 4;
+		memcpy(ptr, &dpi, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	int retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcSetDisplayPoseDpi: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+int rcReadColorBufferDMA_enc(void *self , uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels, uint32_t pixels_size)
+{
+	ENCODER_DEBUG_LOG("rcReadColorBufferDMA(colorbuffer:0x%08x, x:0x%08x, y:0x%08x, width:0x%08x, height:0x%08x, format:0x%08x, type:0x%08x, pixels:0x%08x, pixels_size:0x%08x)", colorbuffer, x, y, width, height, format, type, pixels, pixels_size);
+	AEMU_SCOPED_TRACE("rcReadColorBufferDMA encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_pixels =  pixels_size;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 8 + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcReadColorBufferDMA;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &colorbuffer, 4); ptr += 4;
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+	*(uint64_t *)(ptr) = ctx->lockAndWriteDma(pixels, __size_pixels); ptr += 8;
+		memcpy(ptr, &pixels_size, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	// Skip readback for var pixels as it's DMA
+	// Skip checksum for var pixels as it's DMA
+
+	int retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcReadColorBufferDMA: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+int rcGetFBDisplayConfigsCount_enc(void *self )
+{
+	ENCODER_DEBUG_LOG("rcGetFBDisplayConfigsCount()");
+	AEMU_SCOPED_TRACE("rcGetFBDisplayConfigsCount encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcGetFBDisplayConfigsCount;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	int retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcGetFBDisplayConfigsCount: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+int rcGetFBDisplayConfigsParam_enc(void *self , int configId, EGLint param)
+{
+	ENCODER_DEBUG_LOG("rcGetFBDisplayConfigsParam(configId:%d, param:0x%08x)", configId, param);
+	AEMU_SCOPED_TRACE("rcGetFBDisplayConfigsParam encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcGetFBDisplayConfigsParam;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &configId, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	int retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcGetFBDisplayConfigsParam: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+int rcGetFBDisplayActiveConfig_enc(void *self )
+{
+	ENCODER_DEBUG_LOG("rcGetFBDisplayActiveConfig()");
+	AEMU_SCOPED_TRACE("rcGetFBDisplayActiveConfig encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcGetFBDisplayActiveConfig;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	int retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcGetFBDisplayActiveConfig: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void rcSetProcessMetadata_enc(void *self , char* key, RenderControlByte* valuePtr, uint32_t valueSize)
+{
+	ENCODER_DEBUG_LOG("rcSetProcessMetadata(key:%s, valuePtr:%p, valueSize:0x%08x)", key, valuePtr, valueSize);
+	AEMU_SCOPED_TRACE("rcSetProcessMetadata encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_key =  (strlen(key) + 1);
+	const unsigned int __size_valuePtr =  valueSize;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + __size_key + __size_valuePtr + 4 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcSetProcessMetadata;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+	memcpy(ptr, &__size_key, 4); ptr += 4;
+	memcpy(ptr, key, __size_key);ptr += __size_key;
+	memcpy(ptr, &__size_valuePtr, 4); ptr += 4;
+	memcpy(ptr, valuePtr, __size_valuePtr);ptr += __size_valuePtr;
+		memcpy(ptr, &valueSize, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+int rcGetHostExtensionsString_enc(void *self , uint32_t bufferSize, void* buffer)
+{
+	ENCODER_DEBUG_LOG("rcGetHostExtensionsString(bufferSize:0x%08x, buffer:0x%08x)", bufferSize, buffer);
+	AEMU_SCOPED_TRACE("rcGetHostExtensionsString encode");
+
+	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_buffer =  bufferSize;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_rcGetHostExtensionsString;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &bufferSize, 4); ptr += 4;
+	memcpy(ptr, &__size_buffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(buffer, __size_buffer);
+	if (useChecksum) checksumCalculator->addBuffer(buffer, __size_buffer);
+
+	int retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("rcGetHostExtensionsString: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+}  // namespace
+
+renderControl_encoder_context_t::renderControl_encoder_context_t(IOStream *stream, ChecksumCalculator *checksumCalculator)
+{
+	m_stream = stream;
+	m_checksumCalculator = checksumCalculator;
+
+	this->rcGetRendererVersion = &rcGetRendererVersion_enc;
+	this->rcGetEGLVersion = &rcGetEGLVersion_enc;
+	this->rcQueryEGLString = &rcQueryEGLString_enc;
+	this->rcGetGLString = &rcGetGLString_enc;
+	this->rcGetNumConfigs = &rcGetNumConfigs_enc;
+	this->rcGetConfigs = &rcGetConfigs_enc;
+	this->rcChooseConfig = &rcChooseConfig_enc;
+	this->rcGetFBParam = &rcGetFBParam_enc;
+	this->rcCreateContext = &rcCreateContext_enc;
+	this->rcDestroyContext = &rcDestroyContext_enc;
+	this->rcCreateWindowSurface = &rcCreateWindowSurface_enc;
+	this->rcDestroyWindowSurface = &rcDestroyWindowSurface_enc;
+	this->rcCreateColorBuffer = &rcCreateColorBuffer_enc;
+	this->rcOpenColorBuffer = &rcOpenColorBuffer_enc;
+	this->rcCloseColorBuffer = &rcCloseColorBuffer_enc;
+	this->rcSetWindowColorBuffer = &rcSetWindowColorBuffer_enc;
+	this->rcFlushWindowColorBuffer = &rcFlushWindowColorBuffer_enc;
+	this->rcMakeCurrent = &rcMakeCurrent_enc;
+	this->rcFBPost = &rcFBPost_enc;
+	this->rcFBSetSwapInterval = &rcFBSetSwapInterval_enc;
+	this->rcBindTexture = &rcBindTexture_enc;
+	this->rcBindRenderbuffer = &rcBindRenderbuffer_enc;
+	this->rcColorBufferCacheFlush = &rcColorBufferCacheFlush_enc;
+	this->rcReadColorBuffer = &rcReadColorBuffer_enc;
+	this->rcUpdateColorBuffer = &rcUpdateColorBuffer_enc;
+	this->rcOpenColorBuffer2 = &rcOpenColorBuffer2_enc;
+	this->rcCreateClientImage = &rcCreateClientImage_enc;
+	this->rcDestroyClientImage = &rcDestroyClientImage_enc;
+	this->rcSelectChecksumHelper = &rcSelectChecksumHelper_enc;
+	this->rcCreateSyncKHR = &rcCreateSyncKHR_enc;
+	this->rcClientWaitSyncKHR = &rcClientWaitSyncKHR_enc;
+	this->rcFlushWindowColorBufferAsync = &rcFlushWindowColorBufferAsync_enc;
+	this->rcDestroySyncKHR = &rcDestroySyncKHR_enc;
+	this->rcSetPuid = &rcSetPuid_enc;
+	this->rcUpdateColorBufferDMA = &rcUpdateColorBufferDMA_enc;
+	this->rcCreateColorBufferDMA = &rcCreateColorBufferDMA_enc;
+	this->rcWaitSyncKHR = &rcWaitSyncKHR_enc;
+	this->rcCompose = &rcCompose_enc;
+	this->rcCreateDisplay = &rcCreateDisplay_enc;
+	this->rcDestroyDisplay = &rcDestroyDisplay_enc;
+	this->rcSetDisplayColorBuffer = &rcSetDisplayColorBuffer_enc;
+	this->rcGetDisplayColorBuffer = &rcGetDisplayColorBuffer_enc;
+	this->rcGetColorBufferDisplay = &rcGetColorBufferDisplay_enc;
+	this->rcGetDisplayPose = &rcGetDisplayPose_enc;
+	this->rcSetDisplayPose = &rcSetDisplayPose_enc;
+	this->rcSetColorBufferVulkanMode = &rcSetColorBufferVulkanMode_enc;
+	this->rcReadColorBufferYUV = &rcReadColorBufferYUV_enc;
+	this->rcIsSyncSignaled = &rcIsSyncSignaled_enc;
+	this->rcCreateColorBufferWithHandle = &rcCreateColorBufferWithHandle_enc;
+	this->rcCreateBuffer = &rcCreateBuffer_enc;
+	this->rcCloseBuffer = &rcCloseBuffer_enc;
+	this->rcSetColorBufferVulkanMode2 = &rcSetColorBufferVulkanMode2_enc;
+	this->rcMapGpaToBufferHandle = &rcMapGpaToBufferHandle_enc;
+	this->rcCreateBuffer2 = &rcCreateBuffer2_enc;
+	this->rcMapGpaToBufferHandle2 = &rcMapGpaToBufferHandle2_enc;
+	this->rcFlushWindowColorBufferAsyncWithFrameNumber = &rcFlushWindowColorBufferAsyncWithFrameNumber_enc;
+	this->rcSetTracingForPuid = &rcSetTracingForPuid_enc;
+	this->rcMakeCurrentAsync = &rcMakeCurrentAsync_enc;
+	this->rcComposeAsync = &rcComposeAsync_enc;
+	this->rcDestroySyncKHRAsync = &rcDestroySyncKHRAsync_enc;
+	this->rcComposeWithoutPost = &rcComposeWithoutPost_enc;
+	this->rcComposeAsyncWithoutPost = &rcComposeAsyncWithoutPost_enc;
+	this->rcCreateDisplayById = &rcCreateDisplayById_enc;
+	this->rcSetDisplayPoseDpi = &rcSetDisplayPoseDpi_enc;
+	this->rcReadColorBufferDMA = &rcReadColorBufferDMA_enc;
+	this->rcGetFBDisplayConfigsCount = &rcGetFBDisplayConfigsCount_enc;
+	this->rcGetFBDisplayConfigsParam = &rcGetFBDisplayConfigsParam_enc;
+	this->rcGetFBDisplayActiveConfig = &rcGetFBDisplayActiveConfig_enc;
+	this->rcSetProcessMetadata = &rcSetProcessMetadata_enc;
+	this->rcGetHostExtensionsString = &rcGetHostExtensionsString_enc;
+}
+
diff --git a/system/renderControl_enc/renderControl_enc.h b/system/renderControl_enc/renderControl_enc.h
new file mode 100644
index 0000000..08340e9
--- /dev/null
+++ b/system/renderControl_enc/renderControl_enc.h
@@ -0,0 +1,25 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+
+#ifndef GUARD_renderControl_encoder_context_t
+#define GUARD_renderControl_encoder_context_t
+
+#include "IOStream.h"
+#include "ChecksumCalculator.h"
+#include "renderControl_client_context.h"
+
+
+#include <stdint.h>
+#include <EGL/egl.h>
+#include "glUtils.h"
+
+struct renderControl_encoder_context_t : public renderControl_client_context_t {
+
+	gfxstream::IOStream *m_stream;
+	ChecksumCalculator *m_checksumCalculator;
+
+	renderControl_encoder_context_t(gfxstream::IOStream *stream, ChecksumCalculator *checksumCalculator);
+	virtual uint64_t lockAndWriteDma(void*, uint32_t) { return 0; }
+};
+
+#endif  // GUARD_renderControl_encoder_context_t
diff --git a/system/renderControl_enc/renderControl_entry.cpp b/system/renderControl_enc/renderControl_entry.cpp
new file mode 100644
index 0000000..859b004
--- /dev/null
+++ b/system/renderControl_enc/renderControl_entry.cpp
@@ -0,0 +1,505 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+#include <stdio.h>
+#include <stdlib.h>
+#include "renderControl_client_context.h"
+
+extern "C" {
+	GLint rcGetRendererVersion();
+	EGLint rcGetEGLVersion(EGLint* major, EGLint* minor);
+	EGLint rcQueryEGLString(EGLenum name, void* buffer, EGLint bufferSize);
+	EGLint rcGetGLString(EGLenum name, void* buffer, EGLint bufferSize);
+	EGLint rcGetNumConfigs(uint32_t* numAttribs);
+	EGLint rcGetConfigs(uint32_t bufSize, GLuint* buffer);
+	EGLint rcChooseConfig(EGLint* attribs, uint32_t attribs_size, uint32_t* configs, uint32_t configs_size);
+	EGLint rcGetFBParam(EGLint param);
+	uint32_t rcCreateContext(uint32_t config, uint32_t share, uint32_t glVersion);
+	void rcDestroyContext(uint32_t context);
+	uint32_t rcCreateWindowSurface(uint32_t config, uint32_t width, uint32_t height);
+	void rcDestroyWindowSurface(uint32_t windowSurface);
+	uint32_t rcCreateColorBuffer(uint32_t width, uint32_t height, GLenum internalFormat);
+	void rcOpenColorBuffer(uint32_t colorbuffer);
+	void rcCloseColorBuffer(uint32_t colorbuffer);
+	void rcSetWindowColorBuffer(uint32_t windowSurface, uint32_t colorBuffer);
+	int rcFlushWindowColorBuffer(uint32_t windowSurface);
+	EGLint rcMakeCurrent(uint32_t context, uint32_t drawSurf, uint32_t readSurf);
+	void rcFBPost(uint32_t colorBuffer);
+	void rcFBSetSwapInterval(EGLint interval);
+	void rcBindTexture(uint32_t colorBuffer);
+	void rcBindRenderbuffer(uint32_t colorBuffer);
+	EGLint rcColorBufferCacheFlush(uint32_t colorbuffer, EGLint postCount, int forRead);
+	void rcReadColorBuffer(uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels);
+	int rcUpdateColorBuffer(uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels);
+	int rcOpenColorBuffer2(uint32_t colorbuffer);
+	uint32_t rcCreateClientImage(uint32_t context, EGLenum target, GLuint buffer);
+	int rcDestroyClientImage(uint32_t image);
+	void rcSelectChecksumHelper(uint32_t newProtocol, uint32_t reserved);
+	void rcCreateSyncKHR(EGLenum type, EGLint* attribs, uint32_t num_attribs, int destroy_when_signaled, uint64_t* glsync_out, uint64_t* syncthread_out);
+	EGLint rcClientWaitSyncKHR(uint64_t sync, EGLint flags, uint64_t timeout);
+	void rcFlushWindowColorBufferAsync(uint32_t windowSurface);
+	int rcDestroySyncKHR(uint64_t sync);
+	void rcSetPuid(uint64_t puid);
+	int rcUpdateColorBufferDMA(uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels, uint32_t pixels_size);
+	uint32_t rcCreateColorBufferDMA(uint32_t width, uint32_t height, GLenum internalFormat, int frameworkFormat);
+	void rcWaitSyncKHR(uint64_t sync, EGLint flags);
+	GLint rcCompose(uint32_t bufferSize, void* buffer);
+	int rcCreateDisplay(uint32_t* displayId);
+	int rcDestroyDisplay(uint32_t displayId);
+	int rcSetDisplayColorBuffer(uint32_t displayId, uint32_t colorBuffer);
+	int rcGetDisplayColorBuffer(uint32_t displayId, uint32_t* colorBuffer);
+	int rcGetColorBufferDisplay(uint32_t colorBuffer, uint32_t* displayId);
+	int rcGetDisplayPose(uint32_t displayId, GLint* x, GLint* y, uint32_t* w, uint32_t* h);
+	int rcSetDisplayPose(uint32_t displayId, GLint x, GLint y, uint32_t w, uint32_t h);
+	GLint rcSetColorBufferVulkanMode(uint32_t colorBuffer, uint32_t mode);
+	void rcReadColorBufferYUV(uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, void* pixels, uint32_t pixels_size);
+	int rcIsSyncSignaled(uint64_t sync);
+	void rcCreateColorBufferWithHandle(uint32_t width, uint32_t height, GLenum internalFormat, uint32_t handle);
+	uint32_t rcCreateBuffer(uint32_t size);
+	void rcCloseBuffer(uint32_t buffer);
+	GLint rcSetColorBufferVulkanMode2(uint32_t colorBuffer, uint32_t mode, uint32_t memoryProperty);
+	int rcMapGpaToBufferHandle(uint32_t bufferHandle, uint64_t gpa);
+	uint32_t rcCreateBuffer2(uint64_t size, uint32_t memoryProperty);
+	int rcMapGpaToBufferHandle2(uint32_t bufferHandle, uint64_t gpa, uint64_t size);
+	void rcFlushWindowColorBufferAsyncWithFrameNumber(uint32_t windowSurface, uint32_t frameNumber);
+	void rcSetTracingForPuid(uint64_t puid, uint32_t enable, uint64_t guestTime);
+	void rcMakeCurrentAsync(uint32_t context, uint32_t drawSurf, uint32_t readSurf);
+	void rcComposeAsync(uint32_t bufferSize, void* buffer);
+	void rcDestroySyncKHRAsync(uint64_t sync);
+	GLint rcComposeWithoutPost(uint32_t bufferSize, void* buffer);
+	void rcComposeAsyncWithoutPost(uint32_t bufferSize, void* buffer);
+	int rcCreateDisplayById(uint32_t displayId);
+	int rcSetDisplayPoseDpi(uint32_t displayId, GLint x, GLint y, uint32_t w, uint32_t h, uint32_t dpi);
+	int rcReadColorBufferDMA(uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels, uint32_t pixels_size);
+	int rcGetFBDisplayConfigsCount();
+	int rcGetFBDisplayConfigsParam(int configId, EGLint param);
+	int rcGetFBDisplayActiveConfig();
+	void rcSetProcessMetadata(char* key, RenderControlByte* valuePtr, uint32_t valueSize);
+	int rcGetHostExtensionsString(uint32_t bufferSize, void* buffer);
+};
+
+#ifndef GET_CONTEXT
+static renderControl_client_context_t::CONTEXT_ACCESSOR_TYPE *getCurrentContext = NULL;
+void renderControl_client_context_t::setContextAccessor(CONTEXT_ACCESSOR_TYPE *f) { getCurrentContext = f; }
+#define GET_CONTEXT renderControl_client_context_t * ctx = getCurrentContext()
+#endif
+
+GLint rcGetRendererVersion()
+{
+	GET_CONTEXT;
+	return ctx->rcGetRendererVersion(ctx);
+}
+
+EGLint rcGetEGLVersion(EGLint* major, EGLint* minor)
+{
+	GET_CONTEXT;
+	return ctx->rcGetEGLVersion(ctx, major, minor);
+}
+
+EGLint rcQueryEGLString(EGLenum name, void* buffer, EGLint bufferSize)
+{
+	GET_CONTEXT;
+	return ctx->rcQueryEGLString(ctx, name, buffer, bufferSize);
+}
+
+EGLint rcGetGLString(EGLenum name, void* buffer, EGLint bufferSize)
+{
+	GET_CONTEXT;
+	return ctx->rcGetGLString(ctx, name, buffer, bufferSize);
+}
+
+EGLint rcGetNumConfigs(uint32_t* numAttribs)
+{
+	GET_CONTEXT;
+	return ctx->rcGetNumConfigs(ctx, numAttribs);
+}
+
+EGLint rcGetConfigs(uint32_t bufSize, GLuint* buffer)
+{
+	GET_CONTEXT;
+	return ctx->rcGetConfigs(ctx, bufSize, buffer);
+}
+
+EGLint rcChooseConfig(EGLint* attribs, uint32_t attribs_size, uint32_t* configs, uint32_t configs_size)
+{
+	GET_CONTEXT;
+	return ctx->rcChooseConfig(ctx, attribs, attribs_size, configs, configs_size);
+}
+
+EGLint rcGetFBParam(EGLint param)
+{
+	GET_CONTEXT;
+	return ctx->rcGetFBParam(ctx, param);
+}
+
+uint32_t rcCreateContext(uint32_t config, uint32_t share, uint32_t glVersion)
+{
+	GET_CONTEXT;
+	return ctx->rcCreateContext(ctx, config, share, glVersion);
+}
+
+void rcDestroyContext(uint32_t context)
+{
+	GET_CONTEXT;
+	ctx->rcDestroyContext(ctx, context);
+}
+
+uint32_t rcCreateWindowSurface(uint32_t config, uint32_t width, uint32_t height)
+{
+	GET_CONTEXT;
+	return ctx->rcCreateWindowSurface(ctx, config, width, height);
+}
+
+void rcDestroyWindowSurface(uint32_t windowSurface)
+{
+	GET_CONTEXT;
+	ctx->rcDestroyWindowSurface(ctx, windowSurface);
+}
+
+uint32_t rcCreateColorBuffer(uint32_t width, uint32_t height, GLenum internalFormat)
+{
+	GET_CONTEXT;
+	return ctx->rcCreateColorBuffer(ctx, width, height, internalFormat);
+}
+
+void rcOpenColorBuffer(uint32_t colorbuffer)
+{
+	GET_CONTEXT;
+	ctx->rcOpenColorBuffer(ctx, colorbuffer);
+}
+
+void rcCloseColorBuffer(uint32_t colorbuffer)
+{
+	GET_CONTEXT;
+	ctx->rcCloseColorBuffer(ctx, colorbuffer);
+}
+
+void rcSetWindowColorBuffer(uint32_t windowSurface, uint32_t colorBuffer)
+{
+	GET_CONTEXT;
+	ctx->rcSetWindowColorBuffer(ctx, windowSurface, colorBuffer);
+}
+
+int rcFlushWindowColorBuffer(uint32_t windowSurface)
+{
+	GET_CONTEXT;
+	return ctx->rcFlushWindowColorBuffer(ctx, windowSurface);
+}
+
+EGLint rcMakeCurrent(uint32_t context, uint32_t drawSurf, uint32_t readSurf)
+{
+	GET_CONTEXT;
+	return ctx->rcMakeCurrent(ctx, context, drawSurf, readSurf);
+}
+
+void rcFBPost(uint32_t colorBuffer)
+{
+	GET_CONTEXT;
+	ctx->rcFBPost(ctx, colorBuffer);
+}
+
+void rcFBSetSwapInterval(EGLint interval)
+{
+	GET_CONTEXT;
+	ctx->rcFBSetSwapInterval(ctx, interval);
+}
+
+void rcBindTexture(uint32_t colorBuffer)
+{
+	GET_CONTEXT;
+	ctx->rcBindTexture(ctx, colorBuffer);
+}
+
+void rcBindRenderbuffer(uint32_t colorBuffer)
+{
+	GET_CONTEXT;
+	ctx->rcBindRenderbuffer(ctx, colorBuffer);
+}
+
+EGLint rcColorBufferCacheFlush(uint32_t colorbuffer, EGLint postCount, int forRead)
+{
+	GET_CONTEXT;
+	return ctx->rcColorBufferCacheFlush(ctx, colorbuffer, postCount, forRead);
+}
+
+void rcReadColorBuffer(uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels)
+{
+	GET_CONTEXT;
+	ctx->rcReadColorBuffer(ctx, colorbuffer, x, y, width, height, format, type, pixels);
+}
+
+int rcUpdateColorBuffer(uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels)
+{
+	GET_CONTEXT;
+	return ctx->rcUpdateColorBuffer(ctx, colorbuffer, x, y, width, height, format, type, pixels);
+}
+
+int rcOpenColorBuffer2(uint32_t colorbuffer)
+{
+	GET_CONTEXT;
+	return ctx->rcOpenColorBuffer2(ctx, colorbuffer);
+}
+
+uint32_t rcCreateClientImage(uint32_t context, EGLenum target, GLuint buffer)
+{
+	GET_CONTEXT;
+	return ctx->rcCreateClientImage(ctx, context, target, buffer);
+}
+
+int rcDestroyClientImage(uint32_t image)
+{
+	GET_CONTEXT;
+	return ctx->rcDestroyClientImage(ctx, image);
+}
+
+void rcSelectChecksumHelper(uint32_t newProtocol, uint32_t reserved)
+{
+	GET_CONTEXT;
+	ctx->rcSelectChecksumHelper(ctx, newProtocol, reserved);
+}
+
+void rcCreateSyncKHR(EGLenum type, EGLint* attribs, uint32_t num_attribs, int destroy_when_signaled, uint64_t* glsync_out, uint64_t* syncthread_out)
+{
+	GET_CONTEXT;
+	ctx->rcCreateSyncKHR(ctx, type, attribs, num_attribs, destroy_when_signaled, glsync_out, syncthread_out);
+}
+
+EGLint rcClientWaitSyncKHR(uint64_t sync, EGLint flags, uint64_t timeout)
+{
+	GET_CONTEXT;
+	return ctx->rcClientWaitSyncKHR(ctx, sync, flags, timeout);
+}
+
+void rcFlushWindowColorBufferAsync(uint32_t windowSurface)
+{
+	GET_CONTEXT;
+	ctx->rcFlushWindowColorBufferAsync(ctx, windowSurface);
+}
+
+int rcDestroySyncKHR(uint64_t sync)
+{
+	GET_CONTEXT;
+	return ctx->rcDestroySyncKHR(ctx, sync);
+}
+
+void rcSetPuid(uint64_t puid)
+{
+	GET_CONTEXT;
+	ctx->rcSetPuid(ctx, puid);
+}
+
+int rcUpdateColorBufferDMA(uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels, uint32_t pixels_size)
+{
+	GET_CONTEXT;
+	return ctx->rcUpdateColorBufferDMA(ctx, colorbuffer, x, y, width, height, format, type, pixels, pixels_size);
+}
+
+uint32_t rcCreateColorBufferDMA(uint32_t width, uint32_t height, GLenum internalFormat, int frameworkFormat)
+{
+	GET_CONTEXT;
+	return ctx->rcCreateColorBufferDMA(ctx, width, height, internalFormat, frameworkFormat);
+}
+
+void rcWaitSyncKHR(uint64_t sync, EGLint flags)
+{
+	GET_CONTEXT;
+	ctx->rcWaitSyncKHR(ctx, sync, flags);
+}
+
+GLint rcCompose(uint32_t bufferSize, void* buffer)
+{
+	GET_CONTEXT;
+	return ctx->rcCompose(ctx, bufferSize, buffer);
+}
+
+int rcCreateDisplay(uint32_t* displayId)
+{
+	GET_CONTEXT;
+	return ctx->rcCreateDisplay(ctx, displayId);
+}
+
+int rcDestroyDisplay(uint32_t displayId)
+{
+	GET_CONTEXT;
+	return ctx->rcDestroyDisplay(ctx, displayId);
+}
+
+int rcSetDisplayColorBuffer(uint32_t displayId, uint32_t colorBuffer)
+{
+	GET_CONTEXT;
+	return ctx->rcSetDisplayColorBuffer(ctx, displayId, colorBuffer);
+}
+
+int rcGetDisplayColorBuffer(uint32_t displayId, uint32_t* colorBuffer)
+{
+	GET_CONTEXT;
+	return ctx->rcGetDisplayColorBuffer(ctx, displayId, colorBuffer);
+}
+
+int rcGetColorBufferDisplay(uint32_t colorBuffer, uint32_t* displayId)
+{
+	GET_CONTEXT;
+	return ctx->rcGetColorBufferDisplay(ctx, colorBuffer, displayId);
+}
+
+int rcGetDisplayPose(uint32_t displayId, GLint* x, GLint* y, uint32_t* w, uint32_t* h)
+{
+	GET_CONTEXT;
+	return ctx->rcGetDisplayPose(ctx, displayId, x, y, w, h);
+}
+
+int rcSetDisplayPose(uint32_t displayId, GLint x, GLint y, uint32_t w, uint32_t h)
+{
+	GET_CONTEXT;
+	return ctx->rcSetDisplayPose(ctx, displayId, x, y, w, h);
+}
+
+GLint rcSetColorBufferVulkanMode(uint32_t colorBuffer, uint32_t mode)
+{
+	GET_CONTEXT;
+	return ctx->rcSetColorBufferVulkanMode(ctx, colorBuffer, mode);
+}
+
+void rcReadColorBufferYUV(uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, void* pixels, uint32_t pixels_size)
+{
+	GET_CONTEXT;
+	ctx->rcReadColorBufferYUV(ctx, colorbuffer, x, y, width, height, pixels, pixels_size);
+}
+
+int rcIsSyncSignaled(uint64_t sync)
+{
+	GET_CONTEXT;
+	return ctx->rcIsSyncSignaled(ctx, sync);
+}
+
+void rcCreateColorBufferWithHandle(uint32_t width, uint32_t height, GLenum internalFormat, uint32_t handle)
+{
+	GET_CONTEXT;
+	ctx->rcCreateColorBufferWithHandle(ctx, width, height, internalFormat, handle);
+}
+
+uint32_t rcCreateBuffer(uint32_t size)
+{
+	GET_CONTEXT;
+	return ctx->rcCreateBuffer(ctx, size);
+}
+
+void rcCloseBuffer(uint32_t buffer)
+{
+	GET_CONTEXT;
+	ctx->rcCloseBuffer(ctx, buffer);
+}
+
+GLint rcSetColorBufferVulkanMode2(uint32_t colorBuffer, uint32_t mode, uint32_t memoryProperty)
+{
+	GET_CONTEXT;
+	return ctx->rcSetColorBufferVulkanMode2(ctx, colorBuffer, mode, memoryProperty);
+}
+
+int rcMapGpaToBufferHandle(uint32_t bufferHandle, uint64_t gpa)
+{
+	GET_CONTEXT;
+	return ctx->rcMapGpaToBufferHandle(ctx, bufferHandle, gpa);
+}
+
+uint32_t rcCreateBuffer2(uint64_t size, uint32_t memoryProperty)
+{
+	GET_CONTEXT;
+	return ctx->rcCreateBuffer2(ctx, size, memoryProperty);
+}
+
+int rcMapGpaToBufferHandle2(uint32_t bufferHandle, uint64_t gpa, uint64_t size)
+{
+	GET_CONTEXT;
+	return ctx->rcMapGpaToBufferHandle2(ctx, bufferHandle, gpa, size);
+}
+
+void rcFlushWindowColorBufferAsyncWithFrameNumber(uint32_t windowSurface, uint32_t frameNumber)
+{
+	GET_CONTEXT;
+	ctx->rcFlushWindowColorBufferAsyncWithFrameNumber(ctx, windowSurface, frameNumber);
+}
+
+void rcSetTracingForPuid(uint64_t puid, uint32_t enable, uint64_t guestTime)
+{
+	GET_CONTEXT;
+	ctx->rcSetTracingForPuid(ctx, puid, enable, guestTime);
+}
+
+void rcMakeCurrentAsync(uint32_t context, uint32_t drawSurf, uint32_t readSurf)
+{
+	GET_CONTEXT;
+	ctx->rcMakeCurrentAsync(ctx, context, drawSurf, readSurf);
+}
+
+void rcComposeAsync(uint32_t bufferSize, void* buffer)
+{
+	GET_CONTEXT;
+	ctx->rcComposeAsync(ctx, bufferSize, buffer);
+}
+
+void rcDestroySyncKHRAsync(uint64_t sync)
+{
+	GET_CONTEXT;
+	ctx->rcDestroySyncKHRAsync(ctx, sync);
+}
+
+GLint rcComposeWithoutPost(uint32_t bufferSize, void* buffer)
+{
+	GET_CONTEXT;
+	return ctx->rcComposeWithoutPost(ctx, bufferSize, buffer);
+}
+
+void rcComposeAsyncWithoutPost(uint32_t bufferSize, void* buffer)
+{
+	GET_CONTEXT;
+	ctx->rcComposeAsyncWithoutPost(ctx, bufferSize, buffer);
+}
+
+int rcCreateDisplayById(uint32_t displayId)
+{
+	GET_CONTEXT;
+	return ctx->rcCreateDisplayById(ctx, displayId);
+}
+
+int rcSetDisplayPoseDpi(uint32_t displayId, GLint x, GLint y, uint32_t w, uint32_t h, uint32_t dpi)
+{
+	GET_CONTEXT;
+	return ctx->rcSetDisplayPoseDpi(ctx, displayId, x, y, w, h, dpi);
+}
+
+int rcReadColorBufferDMA(uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels, uint32_t pixels_size)
+{
+	GET_CONTEXT;
+	return ctx->rcReadColorBufferDMA(ctx, colorbuffer, x, y, width, height, format, type, pixels, pixels_size);
+}
+
+int rcGetFBDisplayConfigsCount()
+{
+	GET_CONTEXT;
+	return ctx->rcGetFBDisplayConfigsCount(ctx);
+}
+
+int rcGetFBDisplayConfigsParam(int configId, EGLint param)
+{
+	GET_CONTEXT;
+	return ctx->rcGetFBDisplayConfigsParam(ctx, configId, param);
+}
+
+int rcGetFBDisplayActiveConfig()
+{
+	GET_CONTEXT;
+	return ctx->rcGetFBDisplayActiveConfig(ctx);
+}
+
+void rcSetProcessMetadata(char* key, RenderControlByte* valuePtr, uint32_t valueSize)
+{
+	GET_CONTEXT;
+	ctx->rcSetProcessMetadata(ctx, key, valuePtr, valueSize);
+}
+
+int rcGetHostExtensionsString(uint32_t bufferSize, void* buffer)
+{
+	GET_CONTEXT;
+	return ctx->rcGetHostExtensionsString(ctx, bufferSize, buffer);
+}
+
diff --git a/system/renderControl_enc/renderControl_ftable.h b/system/renderControl_enc/renderControl_ftable.h
new file mode 100644
index 0000000..368cc79
--- /dev/null
+++ b/system/renderControl_enc/renderControl_ftable.h
@@ -0,0 +1,85 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+#ifndef __renderControl_client_ftable_t_h
+#define __renderControl_client_ftable_t_h
+
+
+static const struct _renderControl_funcs_by_name {
+	const char *name;
+	void *proc;
+} renderControl_funcs_by_name[] = {
+	{"rcGetRendererVersion", (void*)rcGetRendererVersion},
+	{"rcGetEGLVersion", (void*)rcGetEGLVersion},
+	{"rcQueryEGLString", (void*)rcQueryEGLString},
+	{"rcGetGLString", (void*)rcGetGLString},
+	{"rcGetNumConfigs", (void*)rcGetNumConfigs},
+	{"rcGetConfigs", (void*)rcGetConfigs},
+	{"rcChooseConfig", (void*)rcChooseConfig},
+	{"rcGetFBParam", (void*)rcGetFBParam},
+	{"rcCreateContext", (void*)rcCreateContext},
+	{"rcDestroyContext", (void*)rcDestroyContext},
+	{"rcCreateWindowSurface", (void*)rcCreateWindowSurface},
+	{"rcDestroyWindowSurface", (void*)rcDestroyWindowSurface},
+	{"rcCreateColorBuffer", (void*)rcCreateColorBuffer},
+	{"rcOpenColorBuffer", (void*)rcOpenColorBuffer},
+	{"rcCloseColorBuffer", (void*)rcCloseColorBuffer},
+	{"rcSetWindowColorBuffer", (void*)rcSetWindowColorBuffer},
+	{"rcFlushWindowColorBuffer", (void*)rcFlushWindowColorBuffer},
+	{"rcMakeCurrent", (void*)rcMakeCurrent},
+	{"rcFBPost", (void*)rcFBPost},
+	{"rcFBSetSwapInterval", (void*)rcFBSetSwapInterval},
+	{"rcBindTexture", (void*)rcBindTexture},
+	{"rcBindRenderbuffer", (void*)rcBindRenderbuffer},
+	{"rcColorBufferCacheFlush", (void*)rcColorBufferCacheFlush},
+	{"rcReadColorBuffer", (void*)rcReadColorBuffer},
+	{"rcUpdateColorBuffer", (void*)rcUpdateColorBuffer},
+	{"rcOpenColorBuffer2", (void*)rcOpenColorBuffer2},
+	{"rcCreateClientImage", (void*)rcCreateClientImage},
+	{"rcDestroyClientImage", (void*)rcDestroyClientImage},
+	{"rcSelectChecksumHelper", (void*)rcSelectChecksumHelper},
+	{"rcCreateSyncKHR", (void*)rcCreateSyncKHR},
+	{"rcClientWaitSyncKHR", (void*)rcClientWaitSyncKHR},
+	{"rcFlushWindowColorBufferAsync", (void*)rcFlushWindowColorBufferAsync},
+	{"rcDestroySyncKHR", (void*)rcDestroySyncKHR},
+	{"rcSetPuid", (void*)rcSetPuid},
+	{"rcUpdateColorBufferDMA", (void*)rcUpdateColorBufferDMA},
+	{"rcCreateColorBufferDMA", (void*)rcCreateColorBufferDMA},
+	{"rcWaitSyncKHR", (void*)rcWaitSyncKHR},
+	{"rcCompose", (void*)rcCompose},
+	{"rcCreateDisplay", (void*)rcCreateDisplay},
+	{"rcDestroyDisplay", (void*)rcDestroyDisplay},
+	{"rcSetDisplayColorBuffer", (void*)rcSetDisplayColorBuffer},
+	{"rcGetDisplayColorBuffer", (void*)rcGetDisplayColorBuffer},
+	{"rcGetColorBufferDisplay", (void*)rcGetColorBufferDisplay},
+	{"rcGetDisplayPose", (void*)rcGetDisplayPose},
+	{"rcSetDisplayPose", (void*)rcSetDisplayPose},
+	{"rcSetColorBufferVulkanMode", (void*)rcSetColorBufferVulkanMode},
+	{"rcReadColorBufferYUV", (void*)rcReadColorBufferYUV},
+	{"rcIsSyncSignaled", (void*)rcIsSyncSignaled},
+	{"rcCreateColorBufferWithHandle", (void*)rcCreateColorBufferWithHandle},
+	{"rcCreateBuffer", (void*)rcCreateBuffer},
+	{"rcCloseBuffer", (void*)rcCloseBuffer},
+	{"rcSetColorBufferVulkanMode2", (void*)rcSetColorBufferVulkanMode2},
+	{"rcMapGpaToBufferHandle", (void*)rcMapGpaToBufferHandle},
+	{"rcCreateBuffer2", (void*)rcCreateBuffer2},
+	{"rcMapGpaToBufferHandle2", (void*)rcMapGpaToBufferHandle2},
+	{"rcFlushWindowColorBufferAsyncWithFrameNumber", (void*)rcFlushWindowColorBufferAsyncWithFrameNumber},
+	{"rcSetTracingForPuid", (void*)rcSetTracingForPuid},
+	{"rcMakeCurrentAsync", (void*)rcMakeCurrentAsync},
+	{"rcComposeAsync", (void*)rcComposeAsync},
+	{"rcDestroySyncKHRAsync", (void*)rcDestroySyncKHRAsync},
+	{"rcComposeWithoutPost", (void*)rcComposeWithoutPost},
+	{"rcComposeAsyncWithoutPost", (void*)rcComposeAsyncWithoutPost},
+	{"rcCreateDisplayById", (void*)rcCreateDisplayById},
+	{"rcSetDisplayPoseDpi", (void*)rcSetDisplayPoseDpi},
+	{"rcReadColorBufferDMA", (void*)rcReadColorBufferDMA},
+	{"rcGetFBDisplayConfigsCount", (void*)rcGetFBDisplayConfigsCount},
+	{"rcGetFBDisplayConfigsParam", (void*)rcGetFBDisplayConfigsParam},
+	{"rcGetFBDisplayActiveConfig", (void*)rcGetFBDisplayActiveConfig},
+	{"rcSetProcessMetadata", (void*)rcSetProcessMetadata},
+	{"rcGetHostExtensionsString", (void*)rcGetHostExtensionsString},
+};
+static const int renderControl_num_funcs = sizeof(renderControl_funcs_by_name) / sizeof(struct _renderControl_funcs_by_name);
+
+
+#endif
diff --git a/system/renderControl_enc/renderControl_opcodes.h b/system/renderControl_enc/renderControl_opcodes.h
new file mode 100644
index 0000000..25cb345
--- /dev/null
+++ b/system/renderControl_enc/renderControl_opcodes.h
@@ -0,0 +1,79 @@
+// Generated Code - DO NOT EDIT !!
+// generated by 'emugen'
+#ifndef __GUARD_renderControl_opcodes_h_
+#define __GUARD_renderControl_opcodes_h_
+
+#define OP_rcGetRendererVersion 					10000
+#define OP_rcGetEGLVersion 					10001
+#define OP_rcQueryEGLString 					10002
+#define OP_rcGetGLString 					10003
+#define OP_rcGetNumConfigs 					10004
+#define OP_rcGetConfigs 					10005
+#define OP_rcChooseConfig 					10006
+#define OP_rcGetFBParam 					10007
+#define OP_rcCreateContext 					10008
+#define OP_rcDestroyContext 					10009
+#define OP_rcCreateWindowSurface 					10010
+#define OP_rcDestroyWindowSurface 					10011
+#define OP_rcCreateColorBuffer 					10012
+#define OP_rcOpenColorBuffer 					10013
+#define OP_rcCloseColorBuffer 					10014
+#define OP_rcSetWindowColorBuffer 					10015
+#define OP_rcFlushWindowColorBuffer 					10016
+#define OP_rcMakeCurrent 					10017
+#define OP_rcFBPost 					10018
+#define OP_rcFBSetSwapInterval 					10019
+#define OP_rcBindTexture 					10020
+#define OP_rcBindRenderbuffer 					10021
+#define OP_rcColorBufferCacheFlush 					10022
+#define OP_rcReadColorBuffer 					10023
+#define OP_rcUpdateColorBuffer 					10024
+#define OP_rcOpenColorBuffer2 					10025
+#define OP_rcCreateClientImage 					10026
+#define OP_rcDestroyClientImage 					10027
+#define OP_rcSelectChecksumHelper 					10028
+#define OP_rcCreateSyncKHR 					10029
+#define OP_rcClientWaitSyncKHR 					10030
+#define OP_rcFlushWindowColorBufferAsync 					10031
+#define OP_rcDestroySyncKHR 					10032
+#define OP_rcSetPuid 					10033
+#define OP_rcUpdateColorBufferDMA 					10034
+#define OP_rcCreateColorBufferDMA 					10035
+#define OP_rcWaitSyncKHR 					10036
+#define OP_rcCompose 					10037
+#define OP_rcCreateDisplay 					10038
+#define OP_rcDestroyDisplay 					10039
+#define OP_rcSetDisplayColorBuffer 					10040
+#define OP_rcGetDisplayColorBuffer 					10041
+#define OP_rcGetColorBufferDisplay 					10042
+#define OP_rcGetDisplayPose 					10043
+#define OP_rcSetDisplayPose 					10044
+#define OP_rcSetColorBufferVulkanMode 					10045
+#define OP_rcReadColorBufferYUV 					10046
+#define OP_rcIsSyncSignaled 					10047
+#define OP_rcCreateColorBufferWithHandle 					10048
+#define OP_rcCreateBuffer 					10049
+#define OP_rcCloseBuffer 					10050
+#define OP_rcSetColorBufferVulkanMode2 					10051
+#define OP_rcMapGpaToBufferHandle 					10052
+#define OP_rcCreateBuffer2 					10053
+#define OP_rcMapGpaToBufferHandle2 					10054
+#define OP_rcFlushWindowColorBufferAsyncWithFrameNumber 					10055
+#define OP_rcSetTracingForPuid 					10056
+#define OP_rcMakeCurrentAsync 					10057
+#define OP_rcComposeAsync 					10058
+#define OP_rcDestroySyncKHRAsync 					10059
+#define OP_rcComposeWithoutPost 					10060
+#define OP_rcComposeAsyncWithoutPost 					10061
+#define OP_rcCreateDisplayById 					10062
+#define OP_rcSetDisplayPoseDpi 					10063
+#define OP_rcReadColorBufferDMA 					10064
+#define OP_rcGetFBDisplayConfigsCount 					10065
+#define OP_rcGetFBDisplayConfigsParam 					10066
+#define OP_rcGetFBDisplayActiveConfig 					10067
+#define OP_rcSetProcessMetadata 					10068
+#define OP_rcGetHostExtensionsString 					10069
+#define OP_last 					10070
+
+
+#endif
diff --git a/system/renderControl_enc/renderControl_types.h b/system/renderControl_enc/renderControl_types.h
new file mode 100644
index 0000000..e2bb551
--- /dev/null
+++ b/system/renderControl_enc/renderControl_types.h
@@ -0,0 +1,30 @@
+/*
+* Copyright 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include <stdint.h>
+#include <EGL/egl.h>
+#include "glUtils.h"
+
+// values for 'param' argument of rcGetFBParam
+#define FB_WIDTH    1
+#define FB_HEIGHT   2
+#define FB_XDPI     3
+#define FB_YDPI     4
+#define FB_FPS      5
+#define FB_MIN_SWAP_INTERVAL 6
+#define FB_MAX_SWAP_INTERVAL 7
+
+using RenderControlByte = char;
\ No newline at end of file
diff --git a/system/vulkan/Android.mk b/system/vulkan/Android.mk
new file mode 100644
index 0000000..beb7d46
--- /dev/null
+++ b/system/vulkan/Android.mk
@@ -0,0 +1,41 @@
+LOCAL_PATH := $(call my-dir)
+
+$(call emugl-begin-shared-library,vulkan.ranchu)
+$(call emugl-set-shared-library-subpath,hw)
+$(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
+$(call emugl-import,libOpenglSystemCommon libvulkan_enc lib_renderControl_enc)
+$(call emugl-import,libOpenglCodecCommon$(GOLDFISH_OPENGL_LIB_SUFFIX))
+
+# Vulkan include dir
+ifeq (true,$(GOLDFISH_OPENGL_BUILD_FOR_HOST))
+
+LOCAL_C_INCLUDES += $(GFXSTREAM_PROTOCOLS_PATH)/common/vulkan/include
+
+endif
+
+ifneq (true,$(GOLDFISH_OPENGL_BUILD_FOR_HOST))
+
+# Only import androidemu if not building for host.
+# if building for host, we already import android-emu.
+$(call emugl-export,SHARED_LIBRARIES,libandroidemu)
+
+LOCAL_HEADER_LIBRARIES += \
+    hwvulkan_headers \
+    gfxstream_vulkan_headers \
+
+endif
+
+LOCAL_CFLAGS += \
+    -DLOG_TAG=\"goldfish_vulkan\" \
+    -Wno-missing-field-initializers \
+    -fvisibility=hidden \
+    -fstrict-aliasing \
+    -DVK_USE_PLATFORM_ANDROID_KHR \
+    -DVK_NO_PROTOTYPES \
+    -Wno-unused-parameter \
+    -Wno-unused-function
+
+LOCAL_SRC_FILES := \
+    goldfish_vulkan.cpp \
+
+$(call emugl-end-module)
diff --git a/system/vulkan/CMakeLists.txt b/system/vulkan/CMakeLists.txt
new file mode 100644
index 0000000..48a9fd1
--- /dev/null
+++ b/system/vulkan/CMakeLists.txt
@@ -0,0 +1,10 @@
+# This is an autogenerated file! Do not edit!
+# instead run make from .../device/generic/goldfish-opengl
+# which will re-generate this file.
+android_validate_sha256("${GOLDFISH_DEVICE_ROOT}/system/vulkan/Android.mk" "2b78d60122b99e5ba57e1066fed62df201a75f8a327829277fa6d50d52227539")
+set(vulkan.ranchu_src goldfish_vulkan.cpp)
+android_add_library(TARGET vulkan.ranchu SHARED LICENSE Apache-2.0 SRC goldfish_vulkan.cpp)
+target_include_directories(vulkan.ranchu PRIVATE ${GOLDFISH_DEVICE_ROOT}/system/OpenglSystemCommon/bionic-include ${GOLDFISH_DEVICE_ROOT}/system/OpenglSystemCommon ${GOLDFISH_DEVICE_ROOT}/bionic/libc/private ${GOLDFISH_DEVICE_ROOT}/bionic/libc/platform ${GOLDFISH_DEVICE_ROOT}/system/vulkan_enc ${GOLDFISH_DEVICE_ROOT}/shared/gralloc_cb/include ${GOLDFISH_DEVICE_ROOT}/shared/GoldfishAddressSpace/include ${GOLDFISH_DEVICE_ROOT}/platform/include ${GOLDFISH_DEVICE_ROOT}/system/renderControl_enc ${GOLDFISH_DEVICE_ROOT}/system/GLESv2_enc ${GOLDFISH_DEVICE_ROOT}/system/GLESv1_enc ${GOLDFISH_DEVICE_ROOT}/shared/OpenglCodecCommon ${GOLDFISH_DEVICE_ROOT}/android-emu ${GOLDFISH_DEVICE_ROOT}/shared/qemupipe/include-types ${GOLDFISH_DEVICE_ROOT}/shared/qemupipe/include ${GOLDFISH_DEVICE_ROOT}/system/vulkan ${GOLDFISH_DEVICE_ROOT}/./host/include/libOpenglRender ${GOLDFISH_DEVICE_ROOT}/./system/include ${GOLDFISH_DEVICE_ROOT}/./../../../external/qemu/android/android-emugl/guest ${GOLDFISH_DEVICE_ROOT}/./../../../hardware/google/gfxstream/common/vulkan/include)
+target_compile_definitions(vulkan.ranchu PRIVATE "-DPLATFORM_SDK_VERSION=29" "-DGOLDFISH_HIDL_GRALLOC" "-DHOST_BUILD" "-DANDROID" "-DGL_GLEXT_PROTOTYPES" "-DPAGE_SIZE=4096" "-DGFXSTREAM" "-DENABLE_ANDROID_HEALTH_MONITOR" "-DLOG_TAG=\"goldfish_vulkan\"" "-DVK_USE_PLATFORM_ANDROID_KHR" "-DVK_NO_PROTOTYPES")
+target_compile_options(vulkan.ranchu PRIVATE "-fvisibility=default" "-Wno-unused-parameter" "-Wno-missing-field-initializers" "-fvisibility=hidden" "-fstrict-aliasing" "-Wno-unused-function")
+target_link_libraries(vulkan.ranchu PRIVATE OpenglSystemCommon android-emu-shared vulkan_enc gui log _renderControl_enc GLESv2_enc GLESv1_enc OpenglCodecCommon_host cutils utils androidemu GoldfishProfiler PRIVATE gralloc_cb_host GoldfishAddressSpace_host platform_host qemupipe_host)
\ No newline at end of file
diff --git a/system/vulkan/goldfish_vulkan.cpp b/system/vulkan/goldfish_vulkan.cpp
new file mode 100644
index 0000000..2a24334
--- /dev/null
+++ b/system/vulkan/goldfish_vulkan.cpp
@@ -0,0 +1,945 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include <hardware/hwvulkan.h>
+
+#include <log/log.h>
+
+#include <errno.h>
+#include <string.h>
+#ifdef VK_USE_PLATFORM_FUCHSIA
+#include <fidl/fuchsia.logger/cpp/wire.h>
+#include <lib/syslog/global.h>
+#include <lib/zx/channel.h>
+#include <lib/zx/socket.h>
+#include <lib/zxio/zxio.h>
+#include <unistd.h>
+
+#include "TraceProviderFuchsia.h"
+#include "services/service_connector.h"
+#endif
+
+#include "HostConnection.h"
+#include "ProcessPipe.h"
+#include "ResourceTracker.h"
+#include "VkEncoder.h"
+#include "func_table.h"
+
+// Used when there is no Vulkan support on the host.
+// Copied from frameworks/native/vulkan/libvulkan/stubhal.cpp
+namespace vkstubhal {
+
+[[noreturn]] VKAPI_ATTR void NoOp() {
+    LOG_ALWAYS_FATAL("invalid stub function called");
+}
+
+VkResult
+EnumerateInstanceExtensionProperties(const char* /*layer_name*/,
+                                     uint32_t* count,
+                                     VkExtensionProperties* /*properties*/) {
+    AEMU_SCOPED_TRACE("vkstubhal::EnumerateInstanceExtensionProperties");
+    *count = 0;
+    return VK_SUCCESS;
+}
+
+VkResult
+EnumerateInstanceLayerProperties(uint32_t* count,
+                                 VkLayerProperties* /*properties*/) {
+    AEMU_SCOPED_TRACE("vkstubhal::EnumerateInstanceLayerProperties");
+    *count = 0;
+    return VK_SUCCESS;
+}
+
+VkResult CreateInstance(const VkInstanceCreateInfo* /*create_info*/,
+                        const VkAllocationCallbacks* /*allocator*/,
+                        VkInstance* instance) {
+    AEMU_SCOPED_TRACE("vkstubhal::CreateInstance");
+    auto dispatch = new hwvulkan_dispatch_t;
+    dispatch->magic = HWVULKAN_DISPATCH_MAGIC;
+    *instance = reinterpret_cast<VkInstance>(dispatch);
+    return VK_SUCCESS;
+}
+
+void DestroyInstance(VkInstance instance,
+                     const VkAllocationCallbacks* /*allocator*/) {
+    AEMU_SCOPED_TRACE("vkstubhal::DestroyInstance");
+    auto dispatch = reinterpret_cast<hwvulkan_dispatch_t*>(instance);
+    ALOG_ASSERT(dispatch->magic == HWVULKAN_DISPATCH_MAGIC,
+                "DestroyInstance: invalid instance handle");
+    delete dispatch;
+}
+
+VkResult EnumeratePhysicalDevices(VkInstance /*instance*/,
+                                  uint32_t* count,
+                                  VkPhysicalDevice* /*gpus*/) {
+    AEMU_SCOPED_TRACE("vkstubhal::EnumeratePhysicalDevices");
+    *count = 0;
+    return VK_SUCCESS;
+}
+
+VkResult EnumerateInstanceVersion(uint32_t* pApiVersion) {
+    AEMU_SCOPED_TRACE("vkstubhal::EnumerateInstanceVersion");
+    *pApiVersion = VK_API_VERSION_1_0;
+    return VK_SUCCESS;
+}
+
+VkResult
+EnumeratePhysicalDeviceGroups(VkInstance /*instance*/,
+                              uint32_t* count,
+                              VkPhysicalDeviceGroupProperties* /*properties*/) {
+    AEMU_SCOPED_TRACE("vkstubhal::EnumeratePhysicalDeviceGroups");
+    *count = 0;
+    return VK_SUCCESS;
+}
+
+VkResult
+CreateDebugReportCallbackEXT(VkInstance /*instance*/,
+                             const VkDebugReportCallbackCreateInfoEXT* /*pCreateInfo*/,
+                             const VkAllocationCallbacks* /*pAllocator*/,
+                             VkDebugReportCallbackEXT* pCallback)
+{
+    AEMU_SCOPED_TRACE("vkstubhal::CreateDebugReportCallbackEXT");
+    *pCallback = VK_NULL_HANDLE;
+    return VK_SUCCESS;
+}
+
+void
+DestroyDebugReportCallbackEXT(VkInstance /*instance*/,
+                              VkDebugReportCallbackEXT /*callback*/,
+                              const VkAllocationCallbacks* /*pAllocator*/)
+{
+    AEMU_SCOPED_TRACE("vkstubhal::DestroyDebugReportCallbackEXT");
+}
+
+void
+DebugReportMessageEXT(VkInstance /*instance*/,
+                      VkDebugReportFlagsEXT /*flags*/,
+                      VkDebugReportObjectTypeEXT /*objectType*/,
+                      uint64_t /*object*/,
+                      size_t /*location*/,
+                      int32_t /*messageCode*/,
+                      const char* /*pLayerPrefix*/,
+                      const char* /*pMessage*/)
+{
+    AEMU_SCOPED_TRACE("vkstubhal::DebugReportMessageEXT");
+}
+
+VkResult
+CreateDebugUtilsMessengerEXT(VkInstance /*instance*/,
+                             const VkDebugUtilsMessengerCreateInfoEXT* /*pCreateInfo*/,
+                             const VkAllocationCallbacks* /*pAllocator*/,
+                             VkDebugUtilsMessengerEXT* pMessenger)
+{
+    AEMU_SCOPED_TRACE("vkstubhal::CreateDebugUtilsMessengerEXT");
+    *pMessenger = VK_NULL_HANDLE;
+    return VK_SUCCESS;
+}
+
+void
+DestroyDebugUtilsMessengerEXT(VkInstance /*instance*/,
+                              VkDebugUtilsMessengerEXT /*messenger*/,
+                              const VkAllocationCallbacks* /*pAllocator*/)
+{
+    AEMU_SCOPED_TRACE("vkstubhal::DestroyDebugUtilsMessengerkEXT");
+}
+
+void
+SubmitDebugUtilsMessageEXT(VkInstance /*instance*/,
+                           VkDebugUtilsMessageSeverityFlagBitsEXT /*messageSeverity*/,
+                           VkDebugUtilsMessageTypeFlagsEXT /*messageTypes*/,
+                           const VkDebugUtilsMessengerCallbackDataEXT* /*pCallbackData*/)
+{
+    AEMU_SCOPED_TRACE("vkstubhal::SubmitDebugUtilsMessageEXT");
+}
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+VkResult
+GetMemoryZirconHandleFUCHSIA(VkDevice /*device*/,
+                             const VkMemoryGetZirconHandleInfoFUCHSIA* /*pInfo*/,
+                             uint32_t* pHandle) {
+    AEMU_SCOPED_TRACE("vkstubhal::GetMemoryZirconHandleFUCHSIA");
+    *pHandle = 0;
+    return VK_SUCCESS;
+}
+
+VkResult
+GetMemoryZirconHandlePropertiesFUCHSIA(VkDevice /*device*/,
+                                       VkExternalMemoryHandleTypeFlagBits /*handleType*/,
+                                       uint32_t /*handle*/,
+                                       VkMemoryZirconHandlePropertiesFUCHSIA* /*pProperties*/) {
+    AEMU_SCOPED_TRACE("vkstubhal::GetMemoryZirconHandlePropertiesFUCHSIA");
+    return VK_SUCCESS;
+}
+
+VkResult
+GetSemaphoreZirconHandleFUCHSIA(VkDevice /*device*/,
+                                const VkSemaphoreGetZirconHandleInfoFUCHSIA* /*pInfo*/,
+                                uint32_t* pHandle) {
+    AEMU_SCOPED_TRACE("vkstubhal::GetSemaphoreZirconHandleFUCHSIA");
+    *pHandle = 0;
+    return VK_SUCCESS;
+}
+
+VkResult
+ImportSemaphoreZirconHandleFUCHSIA(VkDevice /*device*/,
+                                   const VkImportSemaphoreZirconHandleInfoFUCHSIA* /*pInfo*/) {
+    AEMU_SCOPED_TRACE("vkstubhal::ImportSemaphoreZirconHandleFUCHSIA");
+    return VK_SUCCESS;
+}
+
+VkResult CreateBufferCollectionFUCHSIA(
+    VkDevice /*device*/,
+    const VkBufferCollectionCreateInfoFUCHSIA* /*pInfo*/,
+    const VkAllocationCallbacks* /*pAllocator*/,
+    VkBufferCollectionFUCHSIA* /*pCollection*/) {
+    AEMU_SCOPED_TRACE("vkstubhal::CreateBufferCollectionFUCHSIA");
+    return VK_SUCCESS;
+}
+
+void DestroyBufferCollectionFUCHSIA(
+    VkDevice /*device*/,
+    VkBufferCollectionFUCHSIA /*collection*/,
+    const VkAllocationCallbacks* /*pAllocator*/) {
+    AEMU_SCOPED_TRACE("vkstubhal::DestroyBufferCollectionFUCHSIA");
+}
+
+VkResult SetBufferCollectionImageConstraintsFUCHSIA(
+    VkDevice /*device*/,
+    VkBufferCollectionFUCHSIA /*collection*/,
+    const VkImageConstraintsInfoFUCHSIA* /*pImageConstraintsInfo*/) {
+    AEMU_SCOPED_TRACE("vkstubhal::SetBufferCollectionImageConstraintsFUCHSIA");
+    return VK_SUCCESS;
+}
+
+VkResult SetBufferCollectionBufferConstraintsFUCHSIA(
+    VkDevice /*device*/,
+    VkBufferCollectionFUCHSIA /*collection*/,
+    const VkBufferConstraintsInfoFUCHSIA* /*pBufferConstraintsInfo*/) {
+    AEMU_SCOPED_TRACE("vkstubhal::SetBufferCollectionBufferConstraintsFUCHSIA");
+    return VK_SUCCESS;
+}
+
+VkResult GetBufferCollectionPropertiesFUCHSIA(
+    VkDevice /*device*/,
+    VkBufferCollectionFUCHSIA /*collection*/,
+    VkBufferCollectionPropertiesFUCHSIA* /*pProperties*/) {
+    AEMU_SCOPED_TRACE("vkstubhal::GetBufferCollectionPropertiesFUCHSIA");
+    return VK_SUCCESS;
+}
+#endif
+
+PFN_vkVoidFunction GetInstanceProcAddr(VkInstance instance,
+                                       const char* name) {
+    AEMU_SCOPED_TRACE("vkstubhal::GetInstanceProcAddr");
+    if (strcmp(name, "vkCreateInstance") == 0)
+        return reinterpret_cast<PFN_vkVoidFunction>(CreateInstance);
+    if (strcmp(name, "vkDestroyInstance") == 0)
+        return reinterpret_cast<PFN_vkVoidFunction>(DestroyInstance);
+    if (strcmp(name, "vkEnumerateInstanceExtensionProperties") == 0)
+        return reinterpret_cast<PFN_vkVoidFunction>(
+            EnumerateInstanceExtensionProperties);
+    if (strcmp(name, "vkEnumeratePhysicalDevices") == 0)
+        return reinterpret_cast<PFN_vkVoidFunction>(EnumeratePhysicalDevices);
+    if (strcmp(name, "vkEnumerateInstanceVersion") == 0)
+        return reinterpret_cast<PFN_vkVoidFunction>(EnumerateInstanceVersion);
+    if (strcmp(name, "vkEnumeratePhysicalDeviceGroups") == 0)
+        return reinterpret_cast<PFN_vkVoidFunction>(
+            EnumeratePhysicalDeviceGroups);
+    if (strcmp(name, "vkEnumeratePhysicalDeviceGroupsKHR") == 0)
+        return reinterpret_cast<PFN_vkVoidFunction>(
+            EnumeratePhysicalDeviceGroups);
+    if (strcmp(name, "vkGetInstanceProcAddr") == 0)
+        return reinterpret_cast<PFN_vkVoidFunction>(GetInstanceProcAddr);
+    if (strcmp(name, "vkCreateDebugReportCallbackEXT") == 0)
+        return reinterpret_cast<PFN_vkVoidFunction>(CreateDebugReportCallbackEXT);
+    if (strcmp(name, "vkDestroyDebugReportCallbackEXT") == 0)
+        return reinterpret_cast<PFN_vkVoidFunction>(DestroyDebugReportCallbackEXT);
+    if (strcmp(name, "vkDebugReportMessageEXT") == 0)
+        return reinterpret_cast<PFN_vkVoidFunction>(DebugReportMessageEXT);
+    if (strcmp(name, "vkCreateDebugUtilsMessengerEXT") == 0)
+        return reinterpret_cast<PFN_vkVoidFunction>(CreateDebugUtilsMessengerEXT);
+    if (strcmp(name, "vkDestroyDebugUtilsMessengerEXT") == 0)
+        return reinterpret_cast<PFN_vkVoidFunction>(DestroyDebugUtilsMessengerEXT);
+    if (strcmp(name, "vkSubmitDebugUtilsMessageEXT") == 0)
+        return reinterpret_cast<PFN_vkVoidFunction>(SubmitDebugUtilsMessageEXT);
+#ifdef VK_USE_PLATFORM_FUCHSIA
+    if (strcmp(name, "vkGetMemoryZirconHandleFUCHSIA") == 0)
+        return reinterpret_cast<PFN_vkVoidFunction>(GetMemoryZirconHandleFUCHSIA);
+    if (strcmp(name, "vkGetMemoryZirconHandlePropertiesFUCHSIA") == 0)
+        return reinterpret_cast<PFN_vkVoidFunction>(GetMemoryZirconHandlePropertiesFUCHSIA);
+    if (strcmp(name, "vkGetSemaphoreZirconHandleFUCHSIA") == 0)
+        return reinterpret_cast<PFN_vkVoidFunction>(GetSemaphoreZirconHandleFUCHSIA);
+    if (strcmp(name, "vkImportSemaphoreZirconHandleFUCHSIA") == 0)
+        return reinterpret_cast<PFN_vkVoidFunction>(ImportSemaphoreZirconHandleFUCHSIA);
+    if (strcmp(name, "vkCreateBufferCollectionFUCHSIA") == 0)
+        return reinterpret_cast<PFN_vkVoidFunction>(
+            CreateBufferCollectionFUCHSIA);
+    if (strcmp(name, "vkDestroyBufferCollectionFUCHSIA") == 0)
+        return reinterpret_cast<PFN_vkVoidFunction>(
+            DestroyBufferCollectionFUCHSIA);
+    if (strcmp(name, "vkSetBufferCollectionImageConstraintsFUCHSIA") == 0)
+        return reinterpret_cast<PFN_vkVoidFunction>(
+            SetBufferCollectionImageConstraintsFUCHSIA);
+    if (strcmp(name, "vkSetBufferCollectionBufferConstraintsFUCHSIA") == 0)
+        return reinterpret_cast<PFN_vkVoidFunction>(
+            SetBufferCollectionBufferConstraintsFUCHSIA);
+    if (strcmp(name, "vkGetBufferCollectionPropertiesFUCHSIA") == 0)
+        return reinterpret_cast<PFN_vkVoidFunction>(
+            GetBufferCollectionPropertiesFUCHSIA);
+#endif
+    // Return NoOp for entrypoints that should never be called.
+    if (strcmp(name, "vkGetPhysicalDeviceFeatures") == 0 ||
+        strcmp(name, "vkGetPhysicalDeviceProperties") == 0 ||
+        strcmp(name, "vkGetPhysicalDeviceFormatProperties") == 0 ||
+        strcmp(name, "vkGetPhysicalDeviceImageFormatProperties") == 0 ||
+        strcmp(name, "vkGetPhysicalDeviceMemoryProperties") == 0 ||
+        strcmp(name, "vkGetPhysicalDeviceQueueFamilyProperties") == 0 ||
+        strcmp(name, "vkGetDeviceProcAddr") == 0 ||
+        strcmp(name, "vkCreateDevice") == 0 ||
+        strcmp(name, "vkEnumerateDeviceExtensionProperties") == 0 ||
+        strcmp(name, "vkGetPhysicalDeviceSparseImageFormatProperties") == 0 ||
+        strcmp(name, "vkGetPhysicalDeviceFeatures2") == 0 ||
+        strcmp(name, "vkGetPhysicalDeviceProperties2") == 0 ||
+        strcmp(name, "vkGetPhysicalDeviceFormatProperties2") == 0 ||
+        strcmp(name, "vkGetPhysicalDeviceImageFormatProperties2") == 0 ||
+        strcmp(name, "vkGetPhysicalDeviceQueueFamilyProperties2") == 0 ||
+        strcmp(name, "vkGetPhysicalDeviceMemoryProperties2") == 0 ||
+        strcmp(name, "vkGetPhysicalDeviceSparseImageFormatProperties2") == 0 ||
+        strcmp(name, "vkGetPhysicalDeviceExternalBufferProperties") == 0 ||
+        strcmp(name, "vkGetPhysicalDeviceExternalFenceProperties") == 0 ||
+        strcmp(name, "vkGetPhysicalDeviceExternalSemaphoreProperties") == 0)
+        return reinterpret_cast<PFN_vkVoidFunction>(NoOp);
+
+    // Per the spec, return NULL for nonexistent entrypoints.
+    return nullptr;
+}
+
+} // namespace vkstubhal
+
+namespace {
+
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+
+int OpenDevice(const hw_module_t* module, const char* id, hw_device_t** device);
+
+hw_module_methods_t goldfish_vulkan_module_methods = {
+    .open = OpenDevice
+};
+
+extern "C" __attribute__((visibility("default"))) hwvulkan_module_t HAL_MODULE_INFO_SYM = {
+    .common = {
+        .tag = HARDWARE_MODULE_TAG,
+        .module_api_version = HWVULKAN_MODULE_API_VERSION_0_1,
+        .hal_api_version = HARDWARE_HAL_API_VERSION,
+        .id = HWVULKAN_HARDWARE_MODULE_ID,
+        .name = "Goldfish Vulkan Driver",
+        .author = "The Android Open Source Project",
+        .methods = &goldfish_vulkan_module_methods,
+    },
+};
+
+int CloseDevice(struct hw_device_t* /*device*/) {
+    AEMU_SCOPED_TRACE("goldfish_vulkan::GetInstanceProcAddr");
+    // nothing to do - opening a device doesn't allocate any resources
+    return 0;
+}
+
+#endif
+
+#define VK_HOST_CONNECTION(ret) \
+    HostConnection *hostCon = HostConnection::getOrCreate(VIRTIO_GPU_CAPSET_GFXSTREAM); \
+    if (!hostCon) { \
+        ALOGE("vulkan: Failed to get host connection\n"); \
+        return ret; \
+    } \
+    ExtendedRCEncoderContext *rcEnc = hostCon->rcEncoder(); \
+    if (!rcEnc) { \
+        ALOGE("vulkan: Failed to get renderControl encoder context\n"); \
+        return ret; \
+    } \
+    gfxstream::vk::ResourceTracker::ThreadingCallbacks threadingCallbacks = { \
+        [] { \
+          auto hostCon = HostConnection::get(); \
+          hostCon->rcEncoder(); \
+          return hostCon; \
+        }, \
+        [](HostConnection* hostCon) { return hostCon->vkEncoder(); }, \
+    }; \
+    gfxstream::vk::ResourceTracker::get()->setThreadingCallbacks(threadingCallbacks); \
+    gfxstream::vk::ResourceTracker::get()->setupFeatures(rcEnc->featureInfo_const()); \
+    gfxstream::vk::ResourceTracker::get()->setupCaps();                                    \
+    gfxstream::vk::ResourceTracker::get()->setSeqnoPtr(getSeqnoPtrForProcess()); \
+    auto hostSupportsVulkan = gfxstream::vk::ResourceTracker::get()->hostSupportsVulkan(); \
+    gfxstream::vk::VkEncoder *vkEnc = hostCon->vkEncoder(); \
+    if (!vkEnc) { \
+        ALOGE("vulkan: Failed to get Vulkan encoder\n"); \
+        return ret; \
+    } \
+
+VKAPI_ATTR
+VkResult EnumerateInstanceExtensionProperties(
+    const char* layer_name,
+    uint32_t* count,
+    VkExtensionProperties* properties) {
+    AEMU_SCOPED_TRACE("goldfish_vulkan::EnumerateInstanceExtensionProperties");
+
+    VK_HOST_CONNECTION(VK_ERROR_DEVICE_LOST)
+
+    if (!hostSupportsVulkan) {
+        return vkstubhal::EnumerateInstanceExtensionProperties(layer_name, count, properties);
+    }
+
+    if (layer_name) {
+        ALOGW(
+            "Driver vkEnumerateInstanceExtensionProperties shouldn't be called "
+            "with a layer name ('%s')",
+            layer_name);
+    }
+
+    VkResult res = gfxstream::vk::ResourceTracker::get()->on_vkEnumerateInstanceExtensionProperties(
+        vkEnc, VK_SUCCESS, layer_name, count, properties);
+
+    return res;
+}
+
+VKAPI_ATTR
+VkResult CreateInstance(const VkInstanceCreateInfo* create_info,
+                        const VkAllocationCallbacks* allocator,
+                        VkInstance* out_instance) {
+    AEMU_SCOPED_TRACE("goldfish_vulkan::CreateInstance");
+
+    VK_HOST_CONNECTION(VK_ERROR_DEVICE_LOST)
+
+    if (!hostSupportsVulkan) {
+        return vkstubhal::CreateInstance(create_info, allocator, out_instance);
+    }
+
+    VkResult res = vkEnc->vkCreateInstance(create_info, nullptr, out_instance, true /* do lock */);
+
+    return res;
+}
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+VKAPI_ATTR
+VkResult GetMemoryZirconHandleFUCHSIA(
+    VkDevice device,
+    const VkMemoryGetZirconHandleInfoFUCHSIA* pInfo,
+    uint32_t* pHandle) {
+    AEMU_SCOPED_TRACE("goldfish_vulkan::GetMemoryZirconHandleFUCHSIA");
+
+    VK_HOST_CONNECTION(VK_ERROR_DEVICE_LOST)
+
+    if (!hostSupportsVulkan) {
+        return vkstubhal::GetMemoryZirconHandleFUCHSIA(device, pInfo, pHandle);
+    }
+
+    VkResult res = gfxstream::vk::ResourceTracker::get()->
+        on_vkGetMemoryZirconHandleFUCHSIA(
+            vkEnc, VK_SUCCESS,
+            device, pInfo, pHandle);
+
+    return res;
+}
+
+VKAPI_ATTR
+VkResult GetMemoryZirconHandlePropertiesFUCHSIA(
+    VkDevice device,
+    VkExternalMemoryHandleTypeFlagBits handleType,
+    uint32_t handle,
+    VkMemoryZirconHandlePropertiesFUCHSIA* pProperties) {
+    AEMU_SCOPED_TRACE("goldfish_vulkan::GetMemoryZirconHandlePropertiesFUCHSIA");
+
+    VK_HOST_CONNECTION(VK_ERROR_DEVICE_LOST)
+
+    if (!hostSupportsVulkan) {
+        return vkstubhal::GetMemoryZirconHandlePropertiesFUCHSIA(
+            device, handleType, handle, pProperties);
+    }
+
+    VkResult res = gfxstream::vk::ResourceTracker::get()->
+        on_vkGetMemoryZirconHandlePropertiesFUCHSIA(
+            vkEnc, VK_SUCCESS, device, handleType, handle, pProperties);
+
+    return res;
+}
+
+VKAPI_ATTR
+VkResult GetSemaphoreZirconHandleFUCHSIA(
+    VkDevice device,
+    const VkSemaphoreGetZirconHandleInfoFUCHSIA* pInfo,
+    uint32_t* pHandle) {
+    AEMU_SCOPED_TRACE("goldfish_vulkan::GetSemaphoreZirconHandleFUCHSIA");
+
+    VK_HOST_CONNECTION(VK_ERROR_DEVICE_LOST)
+
+    if (!hostSupportsVulkan) {
+        return vkstubhal::GetSemaphoreZirconHandleFUCHSIA(device, pInfo, pHandle);
+    }
+
+    VkResult res = gfxstream::vk::ResourceTracker::get()->
+        on_vkGetSemaphoreZirconHandleFUCHSIA(
+            vkEnc, VK_SUCCESS, device, pInfo, pHandle);
+
+    return res;
+}
+
+VKAPI_ATTR
+VkResult ImportSemaphoreZirconHandleFUCHSIA(
+    VkDevice device,
+    const VkImportSemaphoreZirconHandleInfoFUCHSIA* pInfo) {
+    AEMU_SCOPED_TRACE("goldfish_vulkan::ImportSemaphoreZirconHandleFUCHSIA");
+
+    VK_HOST_CONNECTION(VK_ERROR_DEVICE_LOST)
+
+    if (!hostSupportsVulkan) {
+        return vkstubhal::ImportSemaphoreZirconHandleFUCHSIA(device, pInfo);
+    }
+
+    VkResult res = gfxstream::vk::ResourceTracker::get()->
+        on_vkImportSemaphoreZirconHandleFUCHSIA(
+            vkEnc, VK_SUCCESS, device, pInfo);
+
+    return res;
+}
+
+VKAPI_ATTR
+VkResult CreateBufferCollectionFUCHSIA(
+    VkDevice device,
+    const VkBufferCollectionCreateInfoFUCHSIA* pInfo,
+    const VkAllocationCallbacks* pAllocator,
+    VkBufferCollectionFUCHSIA* pCollection) {
+    AEMU_SCOPED_TRACE("goldfish_vulkan::CreateBufferCollectionFUCHSIA");
+
+    VK_HOST_CONNECTION(VK_ERROR_DEVICE_LOST)
+
+    if (!hostSupportsVulkan) {
+        return vkstubhal::CreateBufferCollectionFUCHSIA(
+            device, pInfo, pAllocator, pCollection);
+    }
+
+    VkResult res =
+        gfxstream::vk::ResourceTracker::get()->on_vkCreateBufferCollectionFUCHSIA(
+            vkEnc, VK_SUCCESS, device, pInfo, pAllocator, pCollection);
+
+    return res;
+}
+
+VKAPI_ATTR
+void DestroyBufferCollectionFUCHSIA(VkDevice device,
+                                    VkBufferCollectionFUCHSIA collection,
+                                    const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("goldfish_vulkan::DestroyBufferCollectionFUCHSIA");
+
+    VK_HOST_CONNECTION()
+
+    if (!hostSupportsVulkan) {
+        vkstubhal::DestroyBufferCollectionFUCHSIA(device, collection,
+                                                  pAllocator);
+        return;
+    }
+
+    gfxstream::vk::ResourceTracker::get()->on_vkDestroyBufferCollectionFUCHSIA(
+        vkEnc, VK_SUCCESS, device, collection, pAllocator);
+}
+
+VKAPI_ATTR
+VkResult SetBufferCollectionBufferConstraintsFUCHSIA(
+    VkDevice device,
+    VkBufferCollectionFUCHSIA collection,
+    const VkBufferConstraintsInfoFUCHSIA* pBufferConstraintsInfo) {
+    AEMU_SCOPED_TRACE(
+        "goldfish_vulkan::SetBufferCollectionBufferConstraintsFUCHSIA");
+
+    VK_HOST_CONNECTION(VK_ERROR_DEVICE_LOST)
+
+    if (!hostSupportsVulkan) {
+        return vkstubhal::SetBufferCollectionBufferConstraintsFUCHSIA(
+            device, collection, pBufferConstraintsInfo);
+    }
+
+    VkResult res =
+        gfxstream::vk::ResourceTracker::get()
+            ->on_vkSetBufferCollectionBufferConstraintsFUCHSIA(
+                vkEnc, VK_SUCCESS, device, collection, pBufferConstraintsInfo);
+
+    return res;
+}
+
+VKAPI_ATTR
+VkResult SetBufferCollectionImageConstraintsFUCHSIA(
+    VkDevice device,
+    VkBufferCollectionFUCHSIA collection,
+    const VkImageConstraintsInfoFUCHSIA* pImageConstraintsInfo) {
+    AEMU_SCOPED_TRACE(
+        "goldfish_vulkan::SetBufferCollectionBufferConstraintsFUCHSIA");
+
+    VK_HOST_CONNECTION(VK_ERROR_DEVICE_LOST)
+
+    if (!hostSupportsVulkan) {
+        return vkstubhal::SetBufferCollectionImageConstraintsFUCHSIA(
+            device, collection, pImageConstraintsInfo);
+    }
+
+    VkResult res =
+        gfxstream::vk::ResourceTracker::get()
+            ->on_vkSetBufferCollectionImageConstraintsFUCHSIA(
+                vkEnc, VK_SUCCESS, device, collection, pImageConstraintsInfo);
+
+    return res;
+}
+
+VKAPI_ATTR
+VkResult GetBufferCollectionPropertiesFUCHSIA(
+    VkDevice device,
+    VkBufferCollectionFUCHSIA collection,
+    VkBufferCollectionPropertiesFUCHSIA* pProperties) {
+    AEMU_SCOPED_TRACE("goldfish_vulkan::GetBufferCollectionPropertiesFUCHSIA");
+
+    VK_HOST_CONNECTION(VK_ERROR_DEVICE_LOST)
+
+    if (!hostSupportsVulkan) {
+        return vkstubhal::GetBufferCollectionPropertiesFUCHSIA(
+            device, collection, pProperties);
+    }
+
+    VkResult res = gfxstream::vk::ResourceTracker::get()
+                       ->on_vkGetBufferCollectionPropertiesFUCHSIA(
+                           vkEnc, VK_SUCCESS, device, collection, pProperties);
+
+    return res;
+}
+
+#endif
+
+uint64_t currGuestTimeNs() {
+    struct timespec ts;
+#ifdef __APPLE__
+    clock_gettime(CLOCK_REALTIME, &ts);
+#else
+    clock_gettime(CLOCK_BOOTTIME, &ts);
+#endif
+    uint64_t res = (uint64_t)(ts.tv_sec * 1000000000ULL + ts.tv_nsec);
+    return res;
+}
+
+struct FrameTracingState {
+    uint32_t frameNumber = 0;
+    bool tracingEnabled = false;
+    void onSwapBuffersSuccessful(ExtendedRCEncoderContext* rcEnc) {
+#ifdef GFXSTREAM
+        bool current = android::base::isTracingEnabled();
+        // edge trigger
+        if (current && !tracingEnabled) {
+            if (rcEnc->hasHostSideTracing()) {
+                rcEnc->rcSetTracingForPuid(rcEnc, getPuid(), 1, currGuestTimeNs());
+            }
+        }
+        if (!current && tracingEnabled) {
+            if (rcEnc->hasHostSideTracing()) {
+                rcEnc->rcSetTracingForPuid(rcEnc, getPuid(), 0, currGuestTimeNs());
+            }
+        }
+        tracingEnabled = current;
+#endif
+        ++frameNumber;
+    }
+};
+
+static FrameTracingState sFrameTracingState;
+
+static PFN_vkVoidFunction sQueueSignalReleaseImageAndroidImpl = 0;
+
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+static VkResult
+QueueSignalReleaseImageANDROID(
+    VkQueue queue,
+    uint32_t waitSemaphoreCount,
+    const VkSemaphore* pWaitSemaphores,
+    VkImage image,
+    int* pNativeFenceFd)
+{
+    sFrameTracingState.onSwapBuffersSuccessful(HostConnection::get()->rcEncoder());
+    ((PFN_vkQueueSignalReleaseImageANDROID)sQueueSignalReleaseImageAndroidImpl)(queue, waitSemaphoreCount, pWaitSemaphores, image, pNativeFenceFd);
+    return VK_SUCCESS;
+}
+#endif
+
+static PFN_vkVoidFunction GetDeviceProcAddr(VkDevice device, const char* name) {
+    AEMU_SCOPED_TRACE("goldfish_vulkan::GetDeviceProcAddr");
+
+    VK_HOST_CONNECTION(nullptr)
+
+    if (!hostSupportsVulkan) {
+        return nullptr;
+    }
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+    if (!strcmp(name, "vkGetMemoryZirconHandleFUCHSIA")) {
+        return (PFN_vkVoidFunction)GetMemoryZirconHandleFUCHSIA;
+    }
+    if (!strcmp(name, "vkGetMemoryZirconHandlePropertiesFUCHSIA")) {
+        return (PFN_vkVoidFunction)GetMemoryZirconHandlePropertiesFUCHSIA;
+    }
+    if (!strcmp(name, "vkGetSemaphoreZirconHandleFUCHSIA")) {
+        return (PFN_vkVoidFunction)GetSemaphoreZirconHandleFUCHSIA;
+    }
+    if (!strcmp(name, "vkImportSemaphoreZirconHandleFUCHSIA")) {
+        return (PFN_vkVoidFunction)ImportSemaphoreZirconHandleFUCHSIA;
+    }
+    if (!strcmp(name, "vkCreateBufferCollectionFUCHSIA")) {
+        return (PFN_vkVoidFunction)CreateBufferCollectionFUCHSIA;
+    }
+    if (!strcmp(name, "vkDestroyBufferCollectionFUCHSIA")) {
+        return (PFN_vkVoidFunction)DestroyBufferCollectionFUCHSIA;
+    }
+    if (!strcmp(name, "vkSetBufferCollectionImageConstraintsFUCHSIA")) {
+        return (PFN_vkVoidFunction)SetBufferCollectionImageConstraintsFUCHSIA;
+    }
+    if (!strcmp(name, "vkSetBufferCollectionBufferConstraintsFUCHSIA")) {
+        return (PFN_vkVoidFunction)SetBufferCollectionBufferConstraintsFUCHSIA;
+    }
+    if (!strcmp(name, "vkGetBufferCollectionPropertiesFUCHSIA")) {
+        return (PFN_vkVoidFunction)GetBufferCollectionPropertiesFUCHSIA;
+    }
+#endif
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+    if (!strcmp(name, "vkQueueSignalReleaseImageANDROID")) {
+        if (!sQueueSignalReleaseImageAndroidImpl) {
+            sQueueSignalReleaseImageAndroidImpl =
+                (PFN_vkVoidFunction)(
+                    gfxstream::vk::goldfish_vulkan_get_device_proc_address(device, "vkQueueSignalReleaseImageANDROID"));
+        }
+        return (PFN_vkVoidFunction)QueueSignalReleaseImageANDROID;
+    }
+#endif
+    if (!strcmp(name, "vkGetDeviceProcAddr")) {
+        return (PFN_vkVoidFunction)(GetDeviceProcAddr);
+    }
+    return (PFN_vkVoidFunction)(gfxstream::vk::goldfish_vulkan_get_device_proc_address(device, name));
+}
+
+VKAPI_ATTR
+PFN_vkVoidFunction GetInstanceProcAddr(VkInstance instance, const char* name) {
+    AEMU_SCOPED_TRACE("goldfish_vulkan::GetInstanceProcAddr");
+
+    VK_HOST_CONNECTION(nullptr)
+
+    if (!hostSupportsVulkan) {
+        return vkstubhal::GetInstanceProcAddr(instance, name);
+    }
+
+    if (!strcmp(name, "vkEnumerateInstanceExtensionProperties")) {
+        return (PFN_vkVoidFunction)EnumerateInstanceExtensionProperties;
+    }
+    if (!strcmp(name, "vkCreateInstance")) {
+        return (PFN_vkVoidFunction)CreateInstance;
+    }
+    if (!strcmp(name, "vkGetDeviceProcAddr")) {
+        return (PFN_vkVoidFunction)(GetDeviceProcAddr);
+    }
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+    if (!strcmp(name, "vkQueueSignalReleaseImageANDROID")) {
+        if (!sQueueSignalReleaseImageAndroidImpl) {
+            sQueueSignalReleaseImageAndroidImpl =
+                (PFN_vkVoidFunction)(
+                    gfxstream::vk::goldfish_vulkan_get_instance_proc_address(instance, "vkQueueSignalReleaseImageANDROID"));
+        }
+        return (PFN_vkVoidFunction)QueueSignalReleaseImageANDROID;
+    }
+#endif
+    return (PFN_vkVoidFunction)(gfxstream::vk::goldfish_vulkan_get_instance_proc_address(instance, name));
+}
+
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+
+hwvulkan_device_t goldfish_vulkan_device = {
+    .common = {
+        .tag = HARDWARE_DEVICE_TAG,
+        .version = HWVULKAN_DEVICE_API_VERSION_0_1,
+        .module = &HAL_MODULE_INFO_SYM.common,
+        .close = CloseDevice,
+    },
+    .EnumerateInstanceExtensionProperties = EnumerateInstanceExtensionProperties,
+    .CreateInstance = CreateInstance,
+    .GetInstanceProcAddr = GetInstanceProcAddr,
+};
+
+int OpenDevice(const hw_module_t* /*module*/,
+               const char* id,
+               hw_device_t** device) {
+    AEMU_SCOPED_TRACE("goldfish_vulkan::OpenDevice");
+
+    if (strcmp(id, HWVULKAN_DEVICE_0) == 0) {
+        *device = &goldfish_vulkan_device.common;
+        gfxstream::vk::ResourceTracker::get();
+        return 0;
+    }
+    return -ENOENT;
+}
+
+#elif VK_USE_PLATFORM_FUCHSIA
+
+class VulkanDevice {
+public:
+    VulkanDevice() : mHostSupportsGoldfish(IsAccessible(QEMU_PIPE_PATH)) {
+        InitLogger();
+        InitTraceProvider();
+        gfxstream::vk::ResourceTracker::get();
+    }
+
+    static void InitLogger();
+
+    static bool IsAccessible(const char* name) {
+        zx_handle_t handle = GetConnectToServiceFunction()(name);
+        if (handle == ZX_HANDLE_INVALID)
+            return false;
+
+        zxio_storage_t io_storage;
+        zx_status_t status = zxio_create(handle, &io_storage);
+        if (status != ZX_OK)
+            return false;
+
+        status = zxio_close(&io_storage.io, /*should_wait=*/true);
+        if (status != ZX_OK)
+            return false;
+
+        return true;
+    }
+
+    static VulkanDevice& GetInstance() {
+        static VulkanDevice g_instance;
+        return g_instance;
+    }
+
+    PFN_vkVoidFunction GetInstanceProcAddr(VkInstance instance, const char* name) {
+        if (!mHostSupportsGoldfish) {
+            return vkstubhal::GetInstanceProcAddr(instance, name);
+        }
+        return ::GetInstanceProcAddr(instance, name);
+    }
+
+private:
+    void InitTraceProvider();
+
+    TraceProviderFuchsia mTraceProvider;
+    const bool mHostSupportsGoldfish;
+};
+
+void VulkanDevice::InitLogger() {
+  auto log_socket = ([] () -> std::optional<zx::socket> {
+    fidl::ClientEnd<fuchsia_logger::LogSink> channel{zx::channel{
+      GetConnectToServiceFunction()("/svc/fuchsia.logger.LogSink")}};
+    if (!channel.is_valid())
+      return std::nullopt;
+
+    zx::socket local_socket, remote_socket;
+    zx_status_t status = zx::socket::create(ZX_SOCKET_DATAGRAM, &local_socket, &remote_socket);
+    if (status != ZX_OK)
+      return std::nullopt;
+
+    auto result = fidl::WireCall(channel)->Connect(std::move(remote_socket));
+
+    if (!result.ok())
+      return std::nullopt;
+
+    return local_socket;
+  })();
+  if (!log_socket)
+    return;
+
+  fx_logger_config_t config = {
+      .min_severity = FX_LOG_INFO,
+      .log_sink_socket = log_socket->release(),
+      .tags = nullptr,
+      .num_tags = 0,
+  };
+
+  fx_log_reconfigure(&config);
+}
+
+void VulkanDevice::InitTraceProvider() {
+    if (!mTraceProvider.Initialize()) {
+        ALOGE("Trace provider failed to initialize");
+    }
+}
+
+extern "C" __attribute__((visibility("default"))) PFN_vkVoidFunction
+vk_icdGetInstanceProcAddr(VkInstance instance, const char* name) {
+    return VulkanDevice::GetInstance().GetInstanceProcAddr(instance, name);
+}
+
+extern "C" __attribute__((visibility("default"))) VkResult
+vk_icdNegotiateLoaderICDInterfaceVersion(uint32_t* pSupportedVersion) {
+    *pSupportedVersion = std::min(*pSupportedVersion, 3u);
+    return VK_SUCCESS;
+}
+
+typedef VkResult(VKAPI_PTR *PFN_vkOpenInNamespaceAddr)(const char *pName, uint32_t handle);
+
+namespace {
+
+PFN_vkOpenInNamespaceAddr g_vulkan_connector;
+
+zx_handle_t LocalConnectToServiceFunction(const char* pName) {
+    zx::channel remote_endpoint, local_endpoint;
+    zx_status_t status;
+    if ((status = zx::channel::create(0, &remote_endpoint, &local_endpoint)) != ZX_OK) {
+        ALOGE("zx::channel::create failed: %d", status);
+        return ZX_HANDLE_INVALID;
+    }
+    if ((status = g_vulkan_connector(pName, remote_endpoint.release())) != ZX_OK) {
+        ALOGE("vulkan_connector failed: %d", status);
+        return ZX_HANDLE_INVALID;
+    }
+    return local_endpoint.release();
+}
+
+}
+
+extern "C" __attribute__((visibility("default"))) void
+vk_icdInitializeOpenInNamespaceCallback(PFN_vkOpenInNamespaceAddr callback) {
+    g_vulkan_connector = callback;
+    SetConnectToServiceFunction(&LocalConnectToServiceFunction);
+}
+
+#else
+class VulkanDevice {
+public:
+    VulkanDevice() {
+        gfxstream::vk::ResourceTracker::get();
+    }
+
+    static VulkanDevice& GetInstance() {
+        static VulkanDevice g_instance;
+        return g_instance;
+    }
+
+    PFN_vkVoidFunction GetInstanceProcAddr(VkInstance instance, const char* name) {
+        return ::GetInstanceProcAddr(instance, name);
+    }
+};
+
+extern "C" __attribute__((visibility("default"))) PFN_vkVoidFunction
+vk_icdGetInstanceProcAddr(VkInstance instance, const char* name) {
+    return VulkanDevice::GetInstance().GetInstanceProcAddr(instance, name);
+}
+
+extern "C" __attribute__((visibility("default"))) VkResult
+vk_icdNegotiateLoaderICDInterfaceVersion(uint32_t* pSupportedVersion) {
+    *pSupportedVersion = std::min(*pSupportedVersion, 3u);
+    return VK_SUCCESS;
+}
+
+#endif
+
+} // namespace
diff --git a/system/vulkan/meson.build b/system/vulkan/meson.build
new file mode 100644
index 0000000..48d89bb
--- /dev/null
+++ b/system/vulkan/meson.build
@@ -0,0 +1,37 @@
+# Copyright 2022 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+vk_api_xml = files('vk.xml')
+vk_icd_gen = files('vk_icd_gen.py')
+
+files_lib_vulkan_cereal = files(
+  'goldfish_vulkan.cpp',
+)
+
+lib_vulkan_cereal = shared_library(
+   'vulkan_cereal',
+   files_lib_vulkan_cereal,
+   cpp_args: cpp_args,
+   include_directories: [inc_android_emu, inc_android_compat, inc_opengl_system,
+			 inc_host, inc_opengl_codec, inc_render_enc,
+                         inc_vulkan_enc],
+   link_with: [lib_android_compat, lib_emu_android_base, lib_stream,
+               lib_vulkan_enc],
+   install: true,
+)
+
+cereal_icd = custom_target(
+  'cereal_icd',
+  input : [vk_icd_gen, vk_api_xml],
+  output : 'cereal_icd.@[email protected]'.format(host_machine.cpu()),
+  command : [
+    prog_python, '@INPUT0@',
+    '--api-version', '1.0', '--xml', '@INPUT1@',
+    '--lib-path', join_paths(get_option('prefix'), get_option('libdir'),
+                             'libvulkan_cereal.so'),
+    '--out', '@OUTPUT@',
+  ],
+  build_by_default : true,
+  install_dir : with_vulkan_icd_dir,
+  install : true,
+)
diff --git a/system/vulkan/vk.xml b/system/vulkan/vk.xml
new file mode 100644
index 0000000..a16e039
--- /dev/null
+++ b/system/vulkan/vk.xml
@@ -0,0 +1,18288 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<registry>
+    <comment>
+Copyright 2015-2021 The Khronos Group Inc.
+
+SPDX-License-Identifier: Apache-2.0 OR MIT
+    </comment>
+
+    <comment>
+This file, vk.xml, is the Vulkan API Registry. It is a critically important
+and normative part of the Vulkan Specification, including a canonical
+machine-readable definition of the API, parameter and member validation
+language incorporated into the Specification and reference pages, and other
+material which is registered by Khronos, such as tags used by extension and
+layer authors. The authoritative public version of vk.xml is maintained in
+the default branch (currently named main) of the Khronos Vulkan GitHub
+project. The authoritative private version is maintained in the default
+branch of the member gitlab server.
+    </comment>
+
+    <platforms comment="Vulkan platform names, reserved for use with platform- and window system-specific extensions">
+        <platform name="xlib" protect="VK_USE_PLATFORM_XLIB_KHR" comment="X Window System, Xlib client library"/>
+        <platform name="xlib_xrandr" protect="VK_USE_PLATFORM_XLIB_XRANDR_EXT" comment="X Window System, Xlib client library, XRandR extension"/>
+        <platform name="xcb" protect="VK_USE_PLATFORM_XCB_KHR" comment="X Window System, Xcb client library"/>
+        <platform name="wayland" protect="VK_USE_PLATFORM_WAYLAND_KHR" comment="Wayland display server protocol"/>
+        <platform name="directfb" protect="VK_USE_PLATFORM_DIRECTFB_EXT" comment="DirectFB library"/>
+        <platform name="android" protect="VK_USE_PLATFORM_ANDROID_KHR" comment="Android OS"/>
+        <platform name="win32" protect="VK_USE_PLATFORM_WIN32_KHR" comment="Microsoft Win32 API (also refers to Win64 apps)"/>
+        <platform name="vi" protect="VK_USE_PLATFORM_VI_NN" comment="Nintendo Vi"/>
+        <platform name="ios" protect="VK_USE_PLATFORM_IOS_MVK" comment="Apple IOS"/>
+        <platform name="macos" protect="VK_USE_PLATFORM_MACOS_MVK" comment="Apple MacOS"/>
+        <platform name="metal" protect="VK_USE_PLATFORM_METAL_EXT" comment="Metal on CoreAnimation on Apple platforms"/>
+        <platform name="fuchsia" protect="VK_USE_PLATFORM_FUCHSIA" comment="Fuchsia"/>
+        <platform name="ggp" protect="VK_USE_PLATFORM_GGP" comment="Google Games Platform"/>
+        <platform name="provisional" protect="VK_ENABLE_BETA_EXTENSIONS" comment="Enable declarations for beta/provisional extensions"/>
+        <platform name="screen" protect="VK_USE_PLATFORM_SCREEN_QNX" comment="QNX Screen Graphics Subsystem"/>
+    </platforms>
+
+    <tags comment="Vulkan vendor/author tags for extensions and layers">
+        <tag name="IMG"         author="Imagination Technologies"      contact="Michael Worcester @michaelworcester"/>
+        <tag name="AMD"         author="Advanced Micro Devices, Inc."  contact="Daniel Rakos @drakos-amd"/>
+        <tag name="AMDX"        author="Advanced Micro Devices, Inc."  contact="Daniel Rakos @drakos-amd"/>
+        <tag name="ARM"         author="ARM Limited"                   contact="Jan-Harald Fredriksen @janharaldfredriksen-arm"/>
+        <tag name="FSL"         author="Freescale Semiconductor, Inc." contact="Norbert Nopper @FslNopper"/>
+        <tag name="BRCM"        author="Broadcom Corporation"          contact="Graeme Leese @gnl21"/>
+        <tag name="NXP"         author="NXP Semiconductors N.V."       contact="Norbert Nopper @FslNopper"/>
+        <tag name="NV"          author="NVIDIA Corporation"            contact="Daniel Koch @dgkoch"/>
+        <tag name="NVX"         author="NVIDIA Corporation"            contact="Daniel Koch @dgkoch"/>
+        <tag name="VIV"         author="Vivante Corporation"           contact="Yanjun Zhang gitlab:@yanjunzhang"/>
+        <tag name="VSI"         author="VeriSilicon Holdings Co., Ltd." contact="Yanjun Zhang gitlab:@yanjunzhang"/>
+        <tag name="KDAB"        author="KDAB"                          contact="Sean Harmer @seanharmer"/>
+        <tag name="ANDROID"     author="Google LLC"                    contact="Jesse Hall @critsec"/>
+        <tag name="CHROMIUM"    author="Google LLC"                    contact="Jesse Hall @critsec"/>
+        <tag name="FUCHSIA"     author="Google LLC"                    contact="Craig Stout @cdotstout, Jesse Hall @critsec, John Rosasco @rosasco"/>
+        <tag name="GGP"         author="Google, LLC"                   contact="Jean-Francois Roy @jfroy, Hai Nguyen @chaoticbob, Jesse Hall @critsec"/>
+        <tag name="GOOGLE"      author="Google LLC"                    contact="Jesse Hall @critsec"/>
+        <tag name="QCOM"        author="Qualcomm Technologies, Inc."   contact="Jeff Leger @jackohounhd"/>
+        <tag name="LUNARG"      author="LunarG, Inc."                  contact="Karen Ghavam @karenghavam-lunarg"/>
+        <tag name="SAMSUNG"     author="Samsung Electronics Co., Ltd." contact="Alon Or-bach @alonorbach"/>
+        <tag name="SEC"         author="Samsung Electronics Co., Ltd." contact="Alon Or-bach @alonorbach"/>
+        <tag name="TIZEN"       author="Samsung Electronics Co., Ltd." contact="Alon Or-bach @alonorbach"/>
+        <tag name="RENDERDOC"   author="RenderDoc (renderdoc.org)"     contact="Baldur Karlsson @baldurk"/>
+        <tag name="NN"          author="Nintendo Co., Ltd."            contact="Yasuhiro Yoshioka gitlab:@yoshioka_yasuhiro"/>
+        <tag name="MVK"         author="The Brenwill Workshop Ltd."    contact="Bill Hollings @billhollings"/>
+        <tag name="KHR"         author="Khronos"                       contact="Tom Olson @tomolson"/>
+        <tag name="KHX"         author="Khronos"                       contact="Tom Olson @tomolson"/>
+        <tag name="EXT"         author="Multivendor"                   contact="Jon Leech @oddhack"/>
+        <tag name="MESA"        author="Mesa open source project"      contact="Chad Versace @chadversary, Daniel Stone @fooishbar, David Airlie @airlied, Jason Ekstrand @jekstrand"/>
+        <tag name="INTEL"       author="Intel Corporation"             contact="Slawek Grajewski @sgrajewski"/>
+        <tag name="HUAWEI"      author="Huawei Technologies Co. Ltd."  contact="Hueilong Wang @wyvernathuawei, Yunpeng Zhu @yunxingzhu"/>
+        <tag name="VALVE"       author="Valve Corporation"             contact="Pierre-Loup Griffais @plagman, Joshua Ashton @Joshua-Ashton, Hans-Kristian Arntzen @HansKristian-Work"/>
+        <tag name="QNX"         author="BlackBerry Limited"            contact="Mike Gorchak @mgorchak-blackberry"/>
+        <tag name="JUICE"       author="Juice Technologies, Inc."      contact="David McCloskey @damcclos, Dean Beeler @canadacow"/>
+        <tag name="FB"          author="Facebook, Inc"                 contact="Artem Bolgar @artyom17"/>
+    </tags>
+
+    <types comment="Vulkan type definitions">
+        <type name="vk_platform" category="include">#include "vk_platform.h"</type>
+
+            <comment>WSI extensions</comment>
+
+        <type category="include" name="X11/Xlib.h"/>
+        <type category="include" name="X11/extensions/Xrandr.h"/>
+        <type category="include" name="wayland-client.h"/>
+        <type category="include" name="windows.h"/>
+        <type category="include" name="xcb/xcb.h"/>
+        <type category="include" name="directfb.h"/>
+        <type category="include" name="zircon/types.h"/>
+        <type category="include" name="ggp_c/vulkan_types.h"/>
+        <type category="include" name="screen/screen.h"/>
+            <comment>
+                In the current header structure, each platform's interfaces
+                are confined to a platform-specific header (vulkan_xlib.h,
+                vulkan_win32.h, etc.). These headers are not self-contained,
+                and should not include native headers (X11/Xlib.h,
+                windows.h, etc.). Code should either include vulkan.h after
+                defining the appropriate VK_USE_PLATFORM_platform
+                macros, or include the required native headers prior to
+                explicitly including the corresponding platform header.
+
+                To accomplish this, the dependencies of native types require
+                native headers, but the XML defines the content for those
+                native headers as empty. The actual native header includes
+                can be restored by modifying the native header tags above
+                to #include the header file in the 'name' attribute.
+            </comment>
+
+        <type requires="X11/Xlib.h" name="Display"/>
+        <type requires="X11/Xlib.h" name="VisualID"/>
+        <type requires="X11/Xlib.h" name="Window"/>
+        <type requires="X11/extensions/Xrandr.h" name="RROutput"/>
+        <type requires="wayland-client.h" name="wl_display"/>
+        <type requires="wayland-client.h" name="wl_surface"/>
+        <type requires="windows.h" name="HINSTANCE"/>
+        <type requires="windows.h" name="HWND"/>
+        <type requires="windows.h" name="HMONITOR"/>
+        <type requires="windows.h" name="HANDLE"/>
+        <type requires="windows.h" name="SECURITY_ATTRIBUTES"/>
+        <type requires="windows.h" name="DWORD"/>
+        <type requires="windows.h" name="LPCWSTR"/>
+        <type requires="xcb/xcb.h" name="xcb_connection_t"/>
+        <type requires="xcb/xcb.h" name="xcb_visualid_t"/>
+        <type requires="xcb/xcb.h" name="xcb_window_t"/>
+        <type requires="directfb.h" name="IDirectFB"/>
+        <type requires="directfb.h" name="IDirectFBSurface"/>
+        <type requires="zircon/types.h" name="zx_handle_t"/>
+        <type requires="ggp_c/vulkan_types.h" name="GgpStreamDescriptor"/>
+        <type requires="ggp_c/vulkan_types.h" name="GgpFrameToken"/>
+        <type requires="screen/screen.h" name="_screen_context"/>
+        <type requires="screen/screen.h" name="_screen_window"/>
+
+        <type category="define">// DEPRECATED: This define is deprecated. VK_MAKE_API_VERSION should be used instead.
+#define <name>VK_MAKE_VERSION</name>(major, minor, patch) \
+    ((((uint32_t)(major)) &lt;&lt; 22) | (((uint32_t)(minor)) &lt;&lt; 12) | ((uint32_t)(patch)))</type>
+        <type category="define">// DEPRECATED: This define is deprecated. VK_API_VERSION_MAJOR should be used instead.
+#define <name>VK_VERSION_MAJOR</name>(version) ((uint32_t)(version) &gt;&gt; 22)</type>
+        <type category="define">// DEPRECATED: This define is deprecated. VK_API_VERSION_MINOR should be used instead.
+#define <name>VK_VERSION_MINOR</name>(version) (((uint32_t)(version) &gt;&gt; 12) &amp; 0x3FFU)</type>
+        <type category="define">// DEPRECATED: This define is deprecated. VK_API_VERSION_PATCH should be used instead.
+#define <name>VK_VERSION_PATCH</name>(version) ((uint32_t)(version) &amp; 0xFFFU)</type>
+
+        <type category="define">#define <name>VK_MAKE_API_VERSION</name>(variant, major, minor, patch) \
+    ((((uint32_t)(variant)) &lt;&lt; 29) | (((uint32_t)(major)) &lt;&lt; 22) | (((uint32_t)(minor)) &lt;&lt; 12) | ((uint32_t)(patch)))</type>
+        <type category="define">#define <name>VK_API_VERSION_VARIANT</name>(version) ((uint32_t)(version) &gt;&gt; 29)</type>
+        <type category="define">#define <name>VK_API_VERSION_MAJOR</name>(version) (((uint32_t)(version) &gt;&gt; 22) &amp; 0x7FU)</type>
+        <type category="define">#define <name>VK_API_VERSION_MINOR</name>(version) (((uint32_t)(version) &gt;&gt; 12) &amp; 0x3FFU)</type>
+        <type category="define">#define <name>VK_API_VERSION_PATCH</name>(version) ((uint32_t)(version) &amp; 0xFFFU)</type>
+
+        <type category="define">// DEPRECATED: This define has been removed. Specific version defines (e.g. VK_API_VERSION_1_0), or the VK_MAKE_VERSION macro, should be used instead.
+//#define <name>VK_API_VERSION</name> <type>VK_MAKE_VERSION</type>(1, 0, 0) // Patch version should always be set to 0</type>
+        <type category="define" requires="VK_MAKE_API_VERSION">// Vulkan 1.0 version number
+#define <name>VK_API_VERSION_1_0</name> <type>VK_MAKE_API_VERSION</type>(0, 1, 0, 0)// Patch version should always be set to 0</type>
+        <type category="define" requires="VK_MAKE_API_VERSION">// Vulkan 1.1 version number
+#define <name>VK_API_VERSION_1_1</name> <type>VK_MAKE_API_VERSION</type>(0, 1, 1, 0)// Patch version should always be set to 0</type>
+        <type category="define" requires="VK_MAKE_API_VERSION">// Vulkan 1.2 version number
+#define <name>VK_API_VERSION_1_2</name> <type>VK_MAKE_API_VERSION</type>(0, 1, 2, 0)// Patch version should always be set to 0</type>
+        <type category="define">// Version of this file
+#define <name>VK_HEADER_VERSION</name> 198</type>
+        <type category="define" requires="VK_HEADER_VERSION">// Complete version of this file
+#define <name>VK_HEADER_VERSION_COMPLETE</name> <type>VK_MAKE_API_VERSION</type>(0, 1, 2, VK_HEADER_VERSION)</type>
+
+        <type category="define">
+#define <name>VK_DEFINE_HANDLE</name>(object) typedef struct object##_T* object;</type>
+
+        <type category="define" name="VK_USE_64_BIT_PTR_DEFINES">
+#ifndef VK_USE_64_BIT_PTR_DEFINES
+    #if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) &amp;&amp; !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)
+        #define VK_USE_64_BIT_PTR_DEFINES 1
+    #else
+        #define VK_USE_64_BIT_PTR_DEFINES 0
+    #endif
+#endif</type>
+        <type category="define" requires="VK_USE_64_BIT_PTR_DEFINES" name="VK_NULL_HANDLE">
+#ifndef VK_DEFINE_NON_DISPATCHABLE_HANDLE
+    #if (VK_USE_64_BIT_PTR_DEFINES==1)
+        #if (defined(__cplusplus) &amp;&amp; (__cplusplus >= 201103L)) || (defined(_MSVC_LANG) &amp;&amp; (_MSVC_LANG >= 201103L))
+            #define VK_NULL_HANDLE nullptr
+        #else
+            #define VK_NULL_HANDLE ((void*)0)
+        #endif
+    #else
+        #define VK_NULL_HANDLE 0ULL
+    #endif
+#endif
+#ifndef VK_NULL_HANDLE
+    #define VK_NULL_HANDLE 0
+#endif</type>
+        <type category="define" requires="VK_NULL_HANDLE" name="VK_DEFINE_NON_DISPATCHABLE_HANDLE">
+#ifndef VK_DEFINE_NON_DISPATCHABLE_HANDLE
+    #if (VK_USE_64_BIT_PTR_DEFINES==1)
+        #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *object;
+    #else
+        #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object;
+    #endif
+#endif</type>
+
+        <type category="basetype">struct <name>ANativeWindow</name>;</type>
+        <type category="basetype">struct <name>AHardwareBuffer</name>;</type>
+        <type category="basetype">
+#ifdef __OBJC__
+@class CAMetalLayer;
+#else
+typedef void <name>CAMetalLayer</name>;
+#endif</type>
+
+        <type category="basetype">typedef <type>uint32_t</type> <name>VkSampleMask</name>;</type>
+        <type category="basetype">typedef <type>uint32_t</type> <name>VkBool32</name>;</type>
+        <type category="basetype">typedef <type>uint32_t</type> <name>VkFlags</name>;</type>
+        <type category="basetype">typedef <type>uint64_t</type> <name>VkFlags64</name>;</type>
+        <type category="basetype">typedef <type>uint64_t</type> <name>VkDeviceSize</name>;</type>
+        <type category="basetype">typedef <type>uint64_t</type> <name>VkDeviceAddress</name>;</type>
+
+            <comment>Basic C types, pulled in via vk_platform.h</comment>
+        <type requires="vk_platform" name="void"/>
+        <type requires="vk_platform" name="char"/>
+        <type requires="vk_platform" name="float"/>
+        <type requires="vk_platform" name="double"/>
+        <type requires="vk_platform" name="int8_t"/>
+        <type requires="vk_platform" name="uint8_t"/>
+        <type requires="vk_platform" name="int16_t"/>
+        <type requires="vk_platform" name="uint16_t"/>
+        <type requires="vk_platform" name="uint32_t"/>
+        <type requires="vk_platform" name="uint64_t"/>
+        <type requires="vk_platform" name="int32_t"/>
+        <type requires="vk_platform" name="int64_t"/>
+        <type requires="vk_platform" name="size_t"/>
+        <type name="int"/>
+
+            <comment>Bitmask types</comment>
+        <type requires="VkFramebufferCreateFlagBits"      category="bitmask">typedef <type>VkFlags</type> <name>VkFramebufferCreateFlags</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkQueryPoolCreateFlags</name>;</type>
+        <type requires="VkRenderPassCreateFlagBits"       category="bitmask">typedef <type>VkFlags</type> <name>VkRenderPassCreateFlags</name>;</type>
+        <type requires="VkSamplerCreateFlagBits"          category="bitmask">typedef <type>VkFlags</type> <name>VkSamplerCreateFlags</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineLayoutCreateFlags</name>;</type>
+        <type requires="VkPipelineCacheCreateFlagBits"    category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineCacheCreateFlags</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineDepthStencilStateCreateFlags</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineDynamicStateCreateFlags</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineColorBlendStateCreateFlags</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineMultisampleStateCreateFlags</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineRasterizationStateCreateFlags</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineViewportStateCreateFlags</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineTessellationStateCreateFlags</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineInputAssemblyStateCreateFlags</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineVertexInputStateCreateFlags</name>;</type>
+        <type requires="VkPipelineShaderStageCreateFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineShaderStageCreateFlags</name>;</type>
+        <type requires="VkDescriptorSetLayoutCreateFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkDescriptorSetLayoutCreateFlags</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkBufferViewCreateFlags</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkInstanceCreateFlags</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkDeviceCreateFlags</name>;</type>
+        <type requires="VkDeviceQueueCreateFlagBits"      category="bitmask">typedef <type>VkFlags</type> <name>VkDeviceQueueCreateFlags</name>;</type>
+        <type requires="VkQueueFlagBits"                  category="bitmask">typedef <type>VkFlags</type> <name>VkQueueFlags</name>;</type>
+        <type requires="VkMemoryPropertyFlagBits"         category="bitmask">typedef <type>VkFlags</type> <name>VkMemoryPropertyFlags</name>;</type>
+        <type requires="VkMemoryHeapFlagBits"             category="bitmask">typedef <type>VkFlags</type> <name>VkMemoryHeapFlags</name>;</type>
+        <type requires="VkAccessFlagBits"                 category="bitmask">typedef <type>VkFlags</type> <name>VkAccessFlags</name>;</type>
+        <type requires="VkBufferUsageFlagBits"            category="bitmask">typedef <type>VkFlags</type> <name>VkBufferUsageFlags</name>;</type>
+        <type requires="VkBufferCreateFlagBits"           category="bitmask">typedef <type>VkFlags</type> <name>VkBufferCreateFlags</name>;</type>
+        <type requires="VkShaderStageFlagBits"            category="bitmask">typedef <type>VkFlags</type> <name>VkShaderStageFlags</name>;</type>
+        <type requires="VkImageUsageFlagBits"             category="bitmask">typedef <type>VkFlags</type> <name>VkImageUsageFlags</name>;</type>
+        <type requires="VkImageCreateFlagBits"            category="bitmask">typedef <type>VkFlags</type> <name>VkImageCreateFlags</name>;</type>
+        <type requires="VkImageViewCreateFlagBits"        category="bitmask">typedef <type>VkFlags</type> <name>VkImageViewCreateFlags</name>;</type>
+        <type requires="VkPipelineCreateFlagBits"         category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineCreateFlags</name>;</type>
+        <type requires="VkColorComponentFlagBits"         category="bitmask">typedef <type>VkFlags</type> <name>VkColorComponentFlags</name>;</type>
+        <type requires="VkFenceCreateFlagBits"            category="bitmask">typedef <type>VkFlags</type> <name>VkFenceCreateFlags</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkSemaphoreCreateFlags</name>;</type>
+        <type requires="VkFormatFeatureFlagBits"          category="bitmask">typedef <type>VkFlags</type> <name>VkFormatFeatureFlags</name>;</type>
+        <type requires="VkQueryControlFlagBits"           category="bitmask">typedef <type>VkFlags</type> <name>VkQueryControlFlags</name>;</type>
+        <type requires="VkQueryResultFlagBits"            category="bitmask">typedef <type>VkFlags</type> <name>VkQueryResultFlags</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkShaderModuleCreateFlags</name>;</type>
+        <type requires="VkEventCreateFlagBits"            category="bitmask">typedef <type>VkFlags</type> <name>VkEventCreateFlags</name>;</type>
+        <type requires="VkCommandPoolCreateFlagBits"      category="bitmask">typedef <type>VkFlags</type> <name>VkCommandPoolCreateFlags</name>;</type>
+        <type requires="VkCommandPoolResetFlagBits"       category="bitmask">typedef <type>VkFlags</type> <name>VkCommandPoolResetFlags</name>;</type>
+        <type requires="VkCommandBufferResetFlagBits"     category="bitmask">typedef <type>VkFlags</type> <name>VkCommandBufferResetFlags</name>;</type>
+        <type requires="VkCommandBufferUsageFlagBits"     category="bitmask">typedef <type>VkFlags</type> <name>VkCommandBufferUsageFlags</name>;</type>
+        <type requires="VkQueryPipelineStatisticFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkQueryPipelineStatisticFlags</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkMemoryMapFlags</name>;</type>
+        <type requires="VkImageAspectFlagBits"            category="bitmask">typedef <type>VkFlags</type> <name>VkImageAspectFlags</name>;</type>
+        <type requires="VkSparseMemoryBindFlagBits"       category="bitmask">typedef <type>VkFlags</type> <name>VkSparseMemoryBindFlags</name>;</type>
+        <type requires="VkSparseImageFormatFlagBits"      category="bitmask">typedef <type>VkFlags</type> <name>VkSparseImageFormatFlags</name>;</type>
+        <type requires="VkSubpassDescriptionFlagBits"     category="bitmask">typedef <type>VkFlags</type> <name>VkSubpassDescriptionFlags</name>;</type>
+        <type requires="VkPipelineStageFlagBits"          category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineStageFlags</name>;</type>
+        <type requires="VkSampleCountFlagBits"            category="bitmask">typedef <type>VkFlags</type> <name>VkSampleCountFlags</name>;</type>
+        <type requires="VkAttachmentDescriptionFlagBits"  category="bitmask">typedef <type>VkFlags</type> <name>VkAttachmentDescriptionFlags</name>;</type>
+        <type requires="VkStencilFaceFlagBits"            category="bitmask">typedef <type>VkFlags</type> <name>VkStencilFaceFlags</name>;</type>
+        <type requires="VkCullModeFlagBits"               category="bitmask">typedef <type>VkFlags</type> <name>VkCullModeFlags</name>;</type>
+        <type requires="VkDescriptorPoolCreateFlagBits"   category="bitmask">typedef <type>VkFlags</type> <name>VkDescriptorPoolCreateFlags</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkDescriptorPoolResetFlags</name>;</type>
+        <type requires="VkDependencyFlagBits"             category="bitmask">typedef <type>VkFlags</type> <name>VkDependencyFlags</name>;</type>
+        <type requires="VkSubgroupFeatureFlagBits"        category="bitmask">typedef <type>VkFlags</type> <name>VkSubgroupFeatureFlags</name>;</type>
+        <type requires="VkIndirectCommandsLayoutUsageFlagBitsNV" category="bitmask">typedef <type>VkFlags</type> <name>VkIndirectCommandsLayoutUsageFlagsNV</name>;</type>
+        <type requires="VkIndirectStateFlagBitsNV"        category="bitmask">typedef <type>VkFlags</type> <name>VkIndirectStateFlagsNV</name>;</type>
+        <type requires="VkGeometryFlagBitsKHR"            category="bitmask">typedef <type>VkFlags</type> <name>VkGeometryFlagsKHR</name>;</type>
+        <type                                             category="bitmask" name="VkGeometryFlagsNV" alias="VkGeometryFlagsKHR"/>
+        <type requires="VkGeometryInstanceFlagBitsKHR"    category="bitmask">typedef <type>VkFlags</type> <name>VkGeometryInstanceFlagsKHR</name>;</type>
+        <type                                             category="bitmask" name="VkGeometryInstanceFlagsNV" alias="VkGeometryInstanceFlagsKHR"/>
+        <type requires="VkBuildAccelerationStructureFlagBitsKHR" category="bitmask">typedef <type>VkFlags</type> <name>VkBuildAccelerationStructureFlagsKHR</name>;</type>
+        <type                                             category="bitmask" name="VkBuildAccelerationStructureFlagsNV" alias="VkBuildAccelerationStructureFlagsKHR"/>
+        <type requires="VkPrivateDataSlotCreateFlagBitsEXT" category="bitmask">typedef <type>VkFlags</type> <name>VkPrivateDataSlotCreateFlagsEXT</name>;</type>
+        <type requires="VkAccelerationStructureCreateFlagBitsKHR" category="bitmask">typedef <type>VkFlags</type> <name>VkAccelerationStructureCreateFlagsKHR</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkDescriptorUpdateTemplateCreateFlags</name>;</type>
+        <type                                             category="bitmask" name="VkDescriptorUpdateTemplateCreateFlagsKHR" alias="VkDescriptorUpdateTemplateCreateFlags"/>
+        <type requires="VkPipelineCreationFeedbackFlagBitsEXT" category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineCreationFeedbackFlagsEXT</name>;</type>
+        <type requires="VkPerformanceCounterDescriptionFlagBitsKHR" category="bitmask">typedef <type>VkFlags</type> <name>VkPerformanceCounterDescriptionFlagsKHR</name>;</type>
+        <type requires="VkAcquireProfilingLockFlagBitsKHR" category="bitmask">typedef <type>VkFlags</type> <name>VkAcquireProfilingLockFlagsKHR</name>;</type>
+        <type requires="VkSemaphoreWaitFlagBits"          category="bitmask">typedef <type>VkFlags</type> <name>VkSemaphoreWaitFlags</name>;</type>
+        <type                                             category="bitmask" name="VkSemaphoreWaitFlagsKHR" alias="VkSemaphoreWaitFlags"/>
+        <type requires="VkPipelineCompilerControlFlagBitsAMD" category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineCompilerControlFlagsAMD</name>;</type>
+        <type requires="VkShaderCorePropertiesFlagBitsAMD" category="bitmask">typedef <type>VkFlags</type> <name>VkShaderCorePropertiesFlagsAMD</name>;</type>
+        <type requires="VkDeviceDiagnosticsConfigFlagBitsNV" category="bitmask">typedef <type>VkFlags</type> <name>VkDeviceDiagnosticsConfigFlagsNV</name>;</type>
+        <type bitvalues="VkAccessFlagBits2KHR"             category="bitmask">typedef <type>VkFlags64</type> <name>VkAccessFlags2KHR</name>;</type>
+        <type bitvalues="VkPipelineStageFlagBits2KHR"      category="bitmask">typedef <type>VkFlags64</type> <name>VkPipelineStageFlags2KHR</name>;</type>
+        <type                                              category="bitmask">typedef <type>VkFlags</type> <name>VkAccelerationStructureMotionInfoFlagsNV</name>;</type>
+        <type                                              category="bitmask">typedef <type>VkFlags</type> <name>VkAccelerationStructureMotionInstanceFlagsNV</name>;</type>
+        <type bitvalues="VkFormatFeatureFlagBits2KHR"      category="bitmask">typedef <type>VkFlags64</type> <name>VkFormatFeatureFlags2KHR</name>;</type>
+        <type requires="VkRenderingFlagBitsKHR"           category="bitmask">typedef <type>VkFlags</type> <name>VkRenderingFlagsKHR</name>;</type>
+
+            <comment>WSI extensions</comment>
+        <type requires="VkCompositeAlphaFlagBitsKHR"      category="bitmask">typedef <type>VkFlags</type> <name>VkCompositeAlphaFlagsKHR</name>;</type>
+        <type requires="VkDisplayPlaneAlphaFlagBitsKHR"   category="bitmask">typedef <type>VkFlags</type> <name>VkDisplayPlaneAlphaFlagsKHR</name>;</type>
+        <type requires="VkSurfaceTransformFlagBitsKHR"    category="bitmask">typedef <type>VkFlags</type> <name>VkSurfaceTransformFlagsKHR</name>;</type>
+        <type requires="VkSwapchainCreateFlagBitsKHR"     category="bitmask">typedef <type>VkFlags</type> <name>VkSwapchainCreateFlagsKHR</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkDisplayModeCreateFlagsKHR</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkDisplaySurfaceCreateFlagsKHR</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkAndroidSurfaceCreateFlagsKHR</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkViSurfaceCreateFlagsNN</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkWaylandSurfaceCreateFlagsKHR</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkWin32SurfaceCreateFlagsKHR</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkXlibSurfaceCreateFlagsKHR</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkXcbSurfaceCreateFlagsKHR</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkDirectFBSurfaceCreateFlagsEXT</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkIOSSurfaceCreateFlagsMVK</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkMacOSSurfaceCreateFlagsMVK</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkMetalSurfaceCreateFlagsEXT</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkImagePipeSurfaceCreateFlagsFUCHSIA</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkStreamDescriptorSurfaceCreateFlagsGGP</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkHeadlessSurfaceCreateFlagsEXT</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkScreenSurfaceCreateFlagsQNX</name>;</type>
+        <type requires="VkPeerMemoryFeatureFlagBits"      category="bitmask">typedef <type>VkFlags</type> <name>VkPeerMemoryFeatureFlags</name>;</type>
+        <type                                             category="bitmask" name="VkPeerMemoryFeatureFlagsKHR"               alias="VkPeerMemoryFeatureFlags"/>
+        <type requires="VkMemoryAllocateFlagBits"         category="bitmask">typedef <type>VkFlags</type> <name>VkMemoryAllocateFlags</name>;</type>
+        <type                                             category="bitmask" name="VkMemoryAllocateFlagsKHR"                  alias="VkMemoryAllocateFlags"/>
+        <type requires="VkDeviceGroupPresentModeFlagBitsKHR" category="bitmask">typedef <type>VkFlags</type> <name>VkDeviceGroupPresentModeFlagsKHR</name>;</type>
+
+        <type requires="VkDebugReportFlagBitsEXT"         category="bitmask">typedef <type>VkFlags</type> <name>VkDebugReportFlagsEXT</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkCommandPoolTrimFlags</name>;</type>
+        <type                                             category="bitmask" name="VkCommandPoolTrimFlagsKHR"                 alias="VkCommandPoolTrimFlags"/>
+        <type requires="VkExternalMemoryHandleTypeFlagBitsNV" category="bitmask">typedef <type>VkFlags</type> <name>VkExternalMemoryHandleTypeFlagsNV</name>;</type>
+        <type requires="VkExternalMemoryFeatureFlagBitsNV" category="bitmask">typedef <type>VkFlags</type> <name>VkExternalMemoryFeatureFlagsNV</name>;</type>
+        <type requires="VkExternalMemoryHandleTypeFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkExternalMemoryHandleTypeFlags</name>;</type>
+        <type                                             category="bitmask" name="VkExternalMemoryHandleTypeFlagsKHR"        alias="VkExternalMemoryHandleTypeFlags"/>
+        <type requires="VkExternalMemoryFeatureFlagBits"  category="bitmask">typedef <type>VkFlags</type> <name>VkExternalMemoryFeatureFlags</name>;</type>
+        <type                                             category="bitmask" name="VkExternalMemoryFeatureFlagsKHR"           alias="VkExternalMemoryFeatureFlags"/>
+        <type requires="VkExternalSemaphoreHandleTypeFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkExternalSemaphoreHandleTypeFlags</name>;</type>
+        <type                                             category="bitmask" name="VkExternalSemaphoreHandleTypeFlagsKHR"     alias="VkExternalSemaphoreHandleTypeFlags"/>
+        <type requires="VkExternalSemaphoreFeatureFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkExternalSemaphoreFeatureFlags</name>;</type>
+        <type                                             category="bitmask" name="VkExternalSemaphoreFeatureFlagsKHR"        alias="VkExternalSemaphoreFeatureFlags"/>
+        <type requires="VkSemaphoreImportFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkSemaphoreImportFlags</name>;</type>
+        <type                                             category="bitmask" name="VkSemaphoreImportFlagsKHR"                 alias="VkSemaphoreImportFlags"/>
+        <type requires="VkExternalFenceHandleTypeFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkExternalFenceHandleTypeFlags</name>;</type>
+        <type                                             category="bitmask" name="VkExternalFenceHandleTypeFlagsKHR"         alias="VkExternalFenceHandleTypeFlags"/>
+        <type requires="VkExternalFenceFeatureFlagBits"   category="bitmask">typedef <type>VkFlags</type> <name>VkExternalFenceFeatureFlags</name>;</type>
+        <type                                             category="bitmask" name="VkExternalFenceFeatureFlagsKHR"            alias="VkExternalFenceFeatureFlags"/>
+        <type requires="VkFenceImportFlagBits"            category="bitmask">typedef <type>VkFlags</type> <name>VkFenceImportFlags</name>;</type>
+        <type                                             category="bitmask" name="VkFenceImportFlagsKHR"                     alias="VkFenceImportFlags"/>
+        <type requires="VkSurfaceCounterFlagBitsEXT"      category="bitmask">typedef <type>VkFlags</type> <name>VkSurfaceCounterFlagsEXT</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineViewportSwizzleStateCreateFlagsNV</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineDiscardRectangleStateCreateFlagsEXT</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineCoverageToColorStateCreateFlagsNV</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineCoverageModulationStateCreateFlagsNV</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineCoverageReductionStateCreateFlagsNV</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkValidationCacheCreateFlagsEXT</name>;</type>
+        <type requires="VkDebugUtilsMessageSeverityFlagBitsEXT" category="bitmask">typedef <type>VkFlags</type> <name>VkDebugUtilsMessageSeverityFlagsEXT</name>;</type>
+        <type requires="VkDebugUtilsMessageTypeFlagBitsEXT" category="bitmask">typedef <type>VkFlags</type> <name>VkDebugUtilsMessageTypeFlagsEXT</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkDebugUtilsMessengerCreateFlagsEXT</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkDebugUtilsMessengerCallbackDataFlagsEXT</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkDeviceMemoryReportFlagsEXT</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineRasterizationConservativeStateCreateFlagsEXT</name>;</type>
+        <type requires="VkDescriptorBindingFlagBits"      category="bitmask">typedef <type>VkFlags</type> <name>VkDescriptorBindingFlags</name>;</type>
+        <type                                             category="bitmask" name="VkDescriptorBindingFlagsEXT"               alias="VkDescriptorBindingFlags"/>
+        <type requires="VkConditionalRenderingFlagBitsEXT"  category="bitmask">typedef <type>VkFlags</type> <name>VkConditionalRenderingFlagsEXT</name>;</type>
+        <type requires="VkResolveModeFlagBits"            category="bitmask">typedef <type>VkFlags</type> <name>VkResolveModeFlags</name>;</type>
+        <type                                             category="bitmask" name="VkResolveModeFlagsKHR"                     alias="VkResolveModeFlags"/>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineRasterizationStateStreamCreateFlagsEXT</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkPipelineRasterizationDepthClipStateCreateFlagsEXT</name>;</type>
+        <type requires="VkToolPurposeFlagBitsEXT"         category="bitmask">typedef <type>VkFlags</type> <name>VkToolPurposeFlagsEXT</name>;</type>
+        <type requires="VkSubmitFlagBitsKHR"              category="bitmask">typedef <type>VkFlags</type> <name>VkSubmitFlagsKHR</name>;</type>
+        <type                                             category="bitmask">typedef <type>VkFlags</type> <name>VkImageFormatConstraintsFlagsFUCHSIA</name>;</type>
+        <type requires="VkImageConstraintsInfoFlagBitsFUCHSIA"     category="bitmask">typedef <type>VkFlags</type> <name>VkImageConstraintsInfoFlagsFUCHSIA</name>;</type>
+
+            <comment>Video Core extension</comment>
+        <type requires="VkVideoCodecOperationFlagBitsKHR"           category="bitmask">typedef <type>VkFlags</type> <name>VkVideoCodecOperationFlagsKHR</name>;</type>
+        <type requires="VkVideoCapabilityFlagBitsKHR"               category="bitmask">typedef <type>VkFlags</type> <name>VkVideoCapabilityFlagsKHR</name>;</type>
+        <type requires="VkVideoSessionCreateFlagBitsKHR"            category="bitmask">typedef <type>VkFlags</type> <name>VkVideoSessionCreateFlagsKHR</name>;</type>
+        <type                                                       category="bitmask">typedef <type>VkFlags</type> <name>VkVideoBeginCodingFlagsKHR</name>;</type>
+        <type                                                       category="bitmask">typedef <type>VkFlags</type> <name>VkVideoEndCodingFlagsKHR</name>;</type>
+        <type requires="VkVideoCodingQualityPresetFlagBitsKHR"      category="bitmask">typedef <type>VkFlags</type> <name>VkVideoCodingQualityPresetFlagsKHR</name>;</type>
+        <type requires="VkVideoCodingControlFlagBitsKHR"            category="bitmask">typedef <type>VkFlags</type> <name>VkVideoCodingControlFlagsKHR</name>;</type>
+
+            <comment>Video Decode Core extension</comment>
+        <type requires="VkVideoDecodeFlagBitsKHR"                   category="bitmask">typedef <type>VkFlags</type> <name>VkVideoDecodeFlagsKHR</name>;</type>
+
+            <comment>Video Decode H.264 extension</comment>
+        <type requires="VkVideoDecodeH264PictureLayoutFlagBitsEXT"  category="bitmask">typedef <type>VkFlags</type> <name>VkVideoDecodeH264PictureLayoutFlagsEXT</name>;</type>
+        <type                                                       category="bitmask">typedef <type>VkFlags</type> <name>VkVideoDecodeH264CreateFlagsEXT</name>;</type>
+
+            <comment>Video Decode H.265 extension</comment>
+        <type                                                       category="bitmask">typedef <type>VkFlags</type> <name>VkVideoDecodeH265CreateFlagsEXT</name>;</type>
+
+            <comment>Video Encode Core extension</comment>
+        <type requires="VkVideoEncodeFlagBitsKHR"                   category="bitmask">typedef <type>VkFlags</type> <name>VkVideoEncodeFlagsKHR</name>;</type>
+        <type requires="VkVideoEncodeRateControlFlagBitsKHR"        category="bitmask">typedef <type>VkFlags</type> <name>VkVideoEncodeRateControlFlagsKHR</name>;</type>
+        <type requires="VkVideoEncodeRateControlModeFlagBitsKHR"    category="bitmask">typedef <type>VkFlags</type> <name>VkVideoEncodeRateControlModeFlagsKHR</name>;</type>
+        <type requires="VkVideoChromaSubsamplingFlagBitsKHR"        category="bitmask">typedef <type>VkFlags</type> <name>VkVideoChromaSubsamplingFlagsKHR</name>;</type>
+        <type requires="VkVideoComponentBitDepthFlagBitsKHR"        category="bitmask">typedef <type>VkFlags</type> <name>VkVideoComponentBitDepthFlagsKHR</name>;</type>
+
+            <comment>Video Encode H.264 extension</comment>
+        <type requires="VkVideoEncodeH264CapabilityFlagBitsEXT"     category="bitmask">typedef <type>VkFlags</type> <name>VkVideoEncodeH264CapabilityFlagsEXT</name>;</type>
+        <type requires="VkVideoEncodeH264InputModeFlagBitsEXT"      category="bitmask">typedef <type>VkFlags</type> <name>VkVideoEncodeH264InputModeFlagsEXT</name>;</type>
+        <type requires="VkVideoEncodeH264OutputModeFlagBitsEXT"     category="bitmask">typedef <type>VkFlags</type> <name>VkVideoEncodeH264OutputModeFlagsEXT</name>;</type>
+        <type requires="VkVideoEncodeH264CreateFlagBitsEXT"         category="bitmask">typedef <type>VkFlags</type> <name>VkVideoEncodeH264CreateFlagsEXT</name>;</type>
+
+            <comment>Video Encode H.265 extension</comment>
+        <type                                                       category="bitmask">typedef <type>VkFlags</type> <name>VkVideoEncodeH265CapabilityFlagsEXT</name>;</type>
+        <type requires="VkVideoEncodeH265InputModeFlagBitsEXT"      category="bitmask">typedef <type>VkFlags</type> <name>VkVideoEncodeH265InputModeFlagsEXT</name>;</type>
+        <type requires="VkVideoEncodeH265OutputModeFlagBitsEXT"     category="bitmask">typedef <type>VkFlags</type> <name>VkVideoEncodeH265OutputModeFlagsEXT</name>;</type>
+        <type                                                       category="bitmask">typedef <type>VkFlags</type> <name>VkVideoEncodeH265CreateFlagsEXT</name>;</type>
+        <type requires="VkVideoEncodeH265CtbSizeFlagBitsEXT"        category="bitmask">typedef <type>VkFlags</type> <name>VkVideoEncodeH265CtbSizeFlagsEXT</name>;</type>
+
+            <comment>Types which can be void pointers or class pointers, selected at compile time</comment>
+        <type category="handle"                           objtypeenum="VK_OBJECT_TYPE_INSTANCE"><type>VK_DEFINE_HANDLE</type>(<name>VkInstance</name>)</type>
+        <type category="handle" parent="VkInstance"       objtypeenum="VK_OBJECT_TYPE_PHYSICAL_DEVICE"><type>VK_DEFINE_HANDLE</type>(<name>VkPhysicalDevice</name>)</type>
+        <type category="handle" parent="VkPhysicalDevice" objtypeenum="VK_OBJECT_TYPE_DEVICE"><type>VK_DEFINE_HANDLE</type>(<name>VkDevice</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_QUEUE"><type>VK_DEFINE_HANDLE</type>(<name>VkQueue</name>)</type>
+        <type category="handle" parent="VkCommandPool"    objtypeenum="VK_OBJECT_TYPE_COMMAND_BUFFER"><type>VK_DEFINE_HANDLE</type>(<name>VkCommandBuffer</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_DEVICE_MEMORY"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkDeviceMemory</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_COMMAND_POOL"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkCommandPool</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_BUFFER"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkBuffer</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_BUFFER_VIEW"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkBufferView</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_IMAGE"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkImage</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_IMAGE_VIEW"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkImageView</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_SHADER_MODULE"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkShaderModule</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_PIPELINE"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkPipeline</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_PIPELINE_LAYOUT"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkPipelineLayout</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_SAMPLER"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkSampler</name>)</type>
+        <type category="handle" parent="VkDescriptorPool" objtypeenum="VK_OBJECT_TYPE_DESCRIPTOR_SET"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkDescriptorSet</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkDescriptorSetLayout</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_DESCRIPTOR_POOL"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkDescriptorPool</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_FENCE"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkFence</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_SEMAPHORE"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkSemaphore</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_EVENT"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkEvent</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_QUERY_POOL"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkQueryPool</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_FRAMEBUFFER"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkFramebuffer</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_RENDER_PASS"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkRenderPass</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_PIPELINE_CACHE"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkPipelineCache</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NV"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkIndirectCommandsLayoutNV</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkDescriptorUpdateTemplate</name>)</type>
+        <type category="handle" name="VkDescriptorUpdateTemplateKHR" alias="VkDescriptorUpdateTemplate"/>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkSamplerYcbcrConversion</name>)</type>
+        <type category="handle" name="VkSamplerYcbcrConversionKHR"   alias="VkSamplerYcbcrConversion"/>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_VALIDATION_CACHE_EXT"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkValidationCacheEXT</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkAccelerationStructureKHR</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkAccelerationStructureNV</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkPerformanceConfigurationINTEL</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkBufferCollectionFUCHSIA</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_DEFERRED_OPERATION_KHR"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkDeferredOperationKHR</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_PRIVATE_DATA_SLOT_EXT"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkPrivateDataSlotEXT</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_CU_MODULE_NVX"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkCuModuleNVX</name>)</type>
+        <type category="handle" parent="VkDevice"         objtypeenum="VK_OBJECT_TYPE_CU_FUNCTION_NVX"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkCuFunctionNVX</name>)</type>
+
+            <comment>WSI extensions</comment>
+        <type category="handle" parent="VkPhysicalDevice" objtypeenum="VK_OBJECT_TYPE_DISPLAY_KHR"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkDisplayKHR</name>)</type>
+        <type category="handle" parent="VkDisplayKHR"     objtypeenum="VK_OBJECT_TYPE_DISPLAY_MODE_KHR"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkDisplayModeKHR</name>)</type>
+        <type category="handle" parent="VkInstance"       objtypeenum="VK_OBJECT_TYPE_SURFACE_KHR"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkSurfaceKHR</name>)</type>
+        <type category="handle" parent="VkSurfaceKHR"     objtypeenum="VK_OBJECT_TYPE_SWAPCHAIN_KHR"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkSwapchainKHR</name>)</type>
+        <type category="handle" parent="VkInstance"       objtypeenum="VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkDebugReportCallbackEXT</name>)</type>
+        <type category="handle" parent="VkInstance"       objtypeenum="VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkDebugUtilsMessengerEXT</name>)</type>
+
+            <comment>Video extensions</comment>
+        <type category="handle" parent="VkDevice"          objtypeenum="VK_OBJECT_TYPE_VIDEO_SESSION_KHR"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkVideoSessionKHR</name>)</type>
+        <type category="handle" parent="VkVideoSessionKHR" objtypeenum="VK_OBJECT_TYPE_VIDEO_SESSION_PARAMETERS_KHR"><type>VK_DEFINE_NON_DISPATCHABLE_HANDLE</type>(<name>VkVideoSessionParametersKHR</name>)</type>
+
+            <comment>Types generated from corresponding enums tags below</comment>
+        <type name="VkAttachmentLoadOp" category="enum"/>
+        <type name="VkAttachmentStoreOp" category="enum"/>
+        <type name="VkBlendFactor" category="enum"/>
+        <type name="VkBlendOp" category="enum"/>
+        <type name="VkBorderColor" category="enum"/>
+        <type name="VkFramebufferCreateFlagBits" category="enum"/>
+        <type name="VkQueryPoolCreateFlagBits" category="enum"/>
+        <type name="VkRenderPassCreateFlagBits" category="enum"/>
+        <type name="VkSamplerCreateFlagBits" category="enum"/>
+        <type name="VkPipelineCacheHeaderVersion" category="enum"/>
+        <type name="VkPipelineCacheCreateFlagBits" category="enum"/>
+        <type name="VkPipelineShaderStageCreateFlagBits" category="enum"/>
+        <type name="VkDescriptorSetLayoutCreateFlagBits" category="enum"/>
+        <type name="VkInstanceCreateFlagBits" category="enum"/>
+        <type name="VkDeviceQueueCreateFlagBits" category="enum"/>
+        <type name="VkBufferCreateFlagBits" category="enum"/>
+        <type name="VkBufferUsageFlagBits" category="enum"/>
+        <type name="VkColorComponentFlagBits" category="enum"/>
+        <type name="VkComponentSwizzle" category="enum"/>
+        <type name="VkCommandPoolCreateFlagBits" category="enum"/>
+        <type name="VkCommandPoolResetFlagBits" category="enum"/>
+        <type name="VkCommandBufferResetFlagBits" category="enum"/>
+        <type name="VkCommandBufferLevel" category="enum"/>
+        <type name="VkCommandBufferUsageFlagBits" category="enum"/>
+        <type name="VkCompareOp" category="enum"/>
+        <type name="VkCullModeFlagBits" category="enum"/>
+        <type name="VkDescriptorType" category="enum"/>
+        <type name="VkDeviceCreateFlagBits" category="enum"/>
+        <type name="VkDynamicState" category="enum"/>
+        <type name="VkFenceCreateFlagBits" category="enum"/>
+        <type name="VkPolygonMode" category="enum"/>
+        <type name="VkFormat" category="enum"/>
+        <type name="VkFormatFeatureFlagBits" category="enum"/>
+        <type name="VkFrontFace" category="enum"/>
+        <type name="VkImageAspectFlagBits" category="enum"/>
+        <type name="VkImageCreateFlagBits" category="enum"/>
+        <type name="VkImageLayout" category="enum"/>
+        <type name="VkImageTiling" category="enum"/>
+        <type name="VkImageType" category="enum"/>
+        <type name="VkImageUsageFlagBits" category="enum"/>
+        <type name="VkImageViewCreateFlagBits" category="enum"/>
+        <type name="VkImageViewType" category="enum"/>
+        <type name="VkSharingMode" category="enum"/>
+        <type name="VkIndexType" category="enum"/>
+        <type name="VkLogicOp" category="enum"/>
+        <type name="VkMemoryHeapFlagBits" category="enum"/>
+        <type name="VkAccessFlagBits" category="enum"/>
+        <type name="VkMemoryPropertyFlagBits" category="enum"/>
+        <type name="VkPhysicalDeviceType" category="enum"/>
+        <type name="VkPipelineBindPoint" category="enum"/>
+        <type name="VkPipelineCreateFlagBits" category="enum"/>
+        <type name="VkPrimitiveTopology" category="enum"/>
+        <type name="VkQueryControlFlagBits" category="enum"/>
+        <type name="VkQueryPipelineStatisticFlagBits" category="enum"/>
+        <type name="VkQueryResultFlagBits" category="enum"/>
+        <type name="VkQueryType" category="enum"/>
+        <type name="VkQueueFlagBits" category="enum"/>
+        <type name="VkSubpassContents" category="enum"/>
+        <type name="VkResult" category="enum"/>
+        <type name="VkShaderStageFlagBits" category="enum"/>
+        <type name="VkSparseMemoryBindFlagBits" category="enum"/>
+        <type name="VkStencilFaceFlagBits" category="enum"/>
+        <type name="VkStencilOp" category="enum"/>
+        <type name="VkStructureType" category="enum"/>
+        <type name="VkSystemAllocationScope" category="enum"/>
+        <type name="VkInternalAllocationType" category="enum"/>
+        <type name="VkSamplerAddressMode" category="enum"/>
+        <type name="VkFilter" category="enum"/>
+        <type name="VkSamplerMipmapMode" category="enum"/>
+        <type name="VkVertexInputRate" category="enum"/>
+        <type name="VkPipelineStageFlagBits" category="enum"/>
+        <type name="VkSparseImageFormatFlagBits" category="enum"/>
+        <type name="VkSampleCountFlagBits" category="enum"/>
+        <type name="VkAttachmentDescriptionFlagBits" category="enum"/>
+        <type name="VkDescriptorPoolCreateFlagBits" category="enum"/>
+        <type name="VkDependencyFlagBits" category="enum"/>
+        <type name="VkObjectType" category="enum"/>
+        <type name="VkEventCreateFlagBits" category="enum"/>
+        <type name="VkPipelineLayoutCreateFlagBits" category="enum"/>
+        <type name="VkSemaphoreCreateFlagBits" category="enum"/>
+
+        <comment>Extensions</comment>
+        <type name="VkIndirectCommandsLayoutUsageFlagBitsNV" category="enum"/>
+        <type name="VkIndirectCommandsTokenTypeNV" category="enum"/>
+        <type name="VkIndirectStateFlagBitsNV" category="enum"/>
+        <type name="VkPrivateDataSlotCreateFlagBitsEXT" category="enum"/>
+        <type name="VkDescriptorUpdateTemplateType" category="enum"/>
+        <type category="enum" name="VkDescriptorUpdateTemplateTypeKHR"             alias="VkDescriptorUpdateTemplateType"/>
+        <type name="VkViewportCoordinateSwizzleNV" category="enum"/>
+        <type name="VkDiscardRectangleModeEXT" category="enum"/>
+        <type name="VkSubpassDescriptionFlagBits" category="enum"/>
+        <type name="VkPointClippingBehavior" category="enum"/>
+        <type category="enum" name="VkPointClippingBehaviorKHR"                    alias="VkPointClippingBehavior"/>
+        <type name="VkCoverageModulationModeNV" category="enum"/>
+        <type name="VkCoverageReductionModeNV" category="enum"/>
+        <type name="VkValidationCacheHeaderVersionEXT" category="enum"/>
+        <type name="VkShaderInfoTypeAMD" category="enum"/>
+        <type name="VkQueueGlobalPriorityEXT" category="enum"/>
+        <type name="VkTimeDomainEXT" category="enum"/>
+        <type name="VkConservativeRasterizationModeEXT" category="enum"/>
+        <type name="VkResolveModeFlagBits" category="enum"/>
+        <type category="enum" name="VkResolveModeFlagBitsKHR"                      alias="VkResolveModeFlagBits"/>
+        <type name="VkDescriptorBindingFlagBits" category="enum"/>
+        <type category="enum" name="VkDescriptorBindingFlagBitsEXT"                alias="VkDescriptorBindingFlagBits"/>
+        <type name="VkConditionalRenderingFlagBitsEXT" category="enum"/>
+        <type name="VkSemaphoreType" category="enum"/>
+        <type category="enum" name="VkSemaphoreTypeKHR"                            alias="VkSemaphoreType"/>
+        <type name="VkGeometryFlagBitsKHR" category="enum"/>
+        <type category="enum" name="VkGeometryFlagBitsNV"                          alias="VkGeometryFlagBitsKHR"/>
+        <type name="VkGeometryInstanceFlagBitsKHR" category="enum"/>
+        <type category="enum" name="VkGeometryInstanceFlagBitsNV"                  alias="VkGeometryInstanceFlagBitsKHR"/>
+        <type name="VkBuildAccelerationStructureFlagBitsKHR" category="enum"/>
+        <type category="enum" name="VkBuildAccelerationStructureFlagBitsNV"        alias="VkBuildAccelerationStructureFlagBitsKHR"/>
+        <type name="VkAccelerationStructureCreateFlagBitsKHR" category="enum"/>
+        <type name="VkBuildAccelerationStructureModeKHR" category="enum"/>
+        <type name="VkCopyAccelerationStructureModeKHR" category="enum"/>
+        <type category="enum" name="VkCopyAccelerationStructureModeNV"             alias="VkCopyAccelerationStructureModeKHR"/>
+        <type name="VkAccelerationStructureTypeKHR" category="enum"/>
+        <type category="enum" name="VkAccelerationStructureTypeNV"                 alias="VkAccelerationStructureTypeKHR"/>
+        <type name="VkGeometryTypeKHR" category="enum"/>
+        <type category="enum" name="VkGeometryTypeNV"                              alias="VkGeometryTypeKHR"/>
+        <type name="VkRayTracingShaderGroupTypeKHR" category="enum"/>
+        <type category="enum" name="VkRayTracingShaderGroupTypeNV"                 alias="VkRayTracingShaderGroupTypeKHR"/>
+        <type name="VkAccelerationStructureMemoryRequirementsTypeNV" category="enum"/>
+        <type name="VkAccelerationStructureBuildTypeKHR" category="enum"/>
+        <type name="VkAccelerationStructureCompatibilityKHR" category="enum"/>
+        <type name="VkShaderGroupShaderKHR" category="enum"/>
+        <type name="VkMemoryOverallocationBehaviorAMD" category="enum"/>
+        <type name="VkScopeNV" category="enum"/>
+        <type name="VkComponentTypeNV" category="enum"/>
+        <type name="VkDeviceDiagnosticsConfigFlagBitsNV" category="enum"/>
+        <type name="VkPipelineCreationFeedbackFlagBitsEXT" category="enum"/>
+        <type name="VkPerformanceCounterScopeKHR" category="enum"/>
+        <type name="VkPerformanceCounterUnitKHR" category="enum"/>
+        <type name="VkPerformanceCounterStorageKHR" category="enum"/>
+        <type name="VkPerformanceCounterDescriptionFlagBitsKHR" category="enum"/>
+        <type name="VkAcquireProfilingLockFlagBitsKHR" category="enum"/>
+        <type name="VkSemaphoreWaitFlagBits" category="enum"/>
+        <type category="enum" name="VkSemaphoreWaitFlagBitsKHR"                    alias="VkSemaphoreWaitFlagBits"/>
+        <type name="VkPerformanceConfigurationTypeINTEL" category="enum"/>
+        <type name="VkQueryPoolSamplingModeINTEL" category="enum"/>
+        <type name="VkPerformanceOverrideTypeINTEL" category="enum"/>
+        <type name="VkPerformanceParameterTypeINTEL" category="enum"/>
+        <type name="VkPerformanceValueTypeINTEL" category="enum"/>
+        <type name="VkLineRasterizationModeEXT" category="enum"/>
+        <type name="VkShaderModuleCreateFlagBits" category="enum"/>
+        <type name="VkPipelineCompilerControlFlagBitsAMD" category="enum"/>
+        <type name="VkShaderCorePropertiesFlagBitsAMD" category="enum"/>
+        <type name="VkToolPurposeFlagBitsEXT" category="enum"/>
+        <type name="VkFragmentShadingRateNV" category="enum"/>
+        <type name="VkFragmentShadingRateTypeNV" category="enum"/>
+        <type name="VkAccessFlagBits2KHR" category="enum"/>
+        <type name="VkPipelineStageFlagBits2KHR" category="enum"/>
+        <type name="VkProvokingVertexModeEXT" category="enum"/>
+        <type name="VkImageFormatConstraintsFlagBitsFUCHSIA" category="enum"/>
+        <type name="VkImageConstraintsInfoFlagBitsFUCHSIA" category="enum"/>
+        <type name="VkFormatFeatureFlagBits2KHR" category="enum"/>
+        <type name="VkRenderingFlagBitsKHR" category="enum"/>
+
+            <comment>WSI extensions</comment>
+        <type name="VkColorSpaceKHR" category="enum"/>
+        <type name="VkCompositeAlphaFlagBitsKHR" category="enum"/>
+        <type name="VkDisplayPlaneAlphaFlagBitsKHR" category="enum"/>
+        <type name="VkPresentModeKHR" category="enum"/>
+        <type name="VkSurfaceTransformFlagBitsKHR" category="enum"/>
+        <type name="VkDebugReportFlagBitsEXT" category="enum"/>
+        <type name="VkDebugReportObjectTypeEXT" category="enum"/>
+        <type name="VkDeviceMemoryReportEventTypeEXT" category="enum"/>
+        <type name="VkRasterizationOrderAMD" category="enum"/>
+        <type name="VkExternalMemoryHandleTypeFlagBitsNV" category="enum"/>
+        <type name="VkExternalMemoryFeatureFlagBitsNV" category="enum"/>
+        <type name="VkValidationCheckEXT" category="enum"/>
+        <type name="VkValidationFeatureEnableEXT" category="enum"/>
+        <type name="VkValidationFeatureDisableEXT" category="enum"/>
+        <type name="VkExternalMemoryHandleTypeFlagBits" category="enum"/>
+        <type category="enum" name="VkExternalMemoryHandleTypeFlagBitsKHR"         alias="VkExternalMemoryHandleTypeFlagBits"/>
+        <type name="VkExternalMemoryFeatureFlagBits" category="enum"/>
+        <type category="enum" name="VkExternalMemoryFeatureFlagBitsKHR"            alias="VkExternalMemoryFeatureFlagBits"/>
+        <type name="VkExternalSemaphoreHandleTypeFlagBits" category="enum"/>
+        <type category="enum" name="VkExternalSemaphoreHandleTypeFlagBitsKHR"      alias="VkExternalSemaphoreHandleTypeFlagBits"/>
+        <type name="VkExternalSemaphoreFeatureFlagBits" category="enum"/>
+        <type category="enum" name="VkExternalSemaphoreFeatureFlagBitsKHR"         alias="VkExternalSemaphoreFeatureFlagBits"/>
+        <type name="VkSemaphoreImportFlagBits" category="enum"/>
+        <type category="enum" name="VkSemaphoreImportFlagBitsKHR"                  alias="VkSemaphoreImportFlagBits"/>
+        <type name="VkExternalFenceHandleTypeFlagBits" category="enum"/>
+        <type category="enum" name="VkExternalFenceHandleTypeFlagBitsKHR"          alias="VkExternalFenceHandleTypeFlagBits"/>
+        <type name="VkExternalFenceFeatureFlagBits" category="enum"/>
+        <type category="enum" name="VkExternalFenceFeatureFlagBitsKHR"             alias="VkExternalFenceFeatureFlagBits"/>
+        <type name="VkFenceImportFlagBits" category="enum"/>
+        <type category="enum" name="VkFenceImportFlagBitsKHR"                      alias="VkFenceImportFlagBits"/>
+        <type name="VkSurfaceCounterFlagBitsEXT" category="enum"/>
+        <type name="VkDisplayPowerStateEXT" category="enum"/>
+        <type name="VkDeviceEventTypeEXT" category="enum"/>
+        <type name="VkDisplayEventTypeEXT" category="enum"/>
+        <type name="VkPeerMemoryFeatureFlagBits" category="enum"/>
+        <type category="enum" name="VkPeerMemoryFeatureFlagBitsKHR"                alias="VkPeerMemoryFeatureFlagBits"/>
+        <type name="VkMemoryAllocateFlagBits" category="enum"/>
+        <type category="enum" name="VkMemoryAllocateFlagBitsKHR"                   alias="VkMemoryAllocateFlagBits"/>
+        <type name="VkDeviceGroupPresentModeFlagBitsKHR" category="enum"/>
+        <type name="VkSwapchainCreateFlagBitsKHR" category="enum"/>
+        <type name="VkSubgroupFeatureFlagBits" category="enum"/>
+        <type name="VkTessellationDomainOrigin" category="enum"/>
+        <type category="enum" name="VkTessellationDomainOriginKHR"                 alias="VkTessellationDomainOrigin"/>
+        <type name="VkSamplerYcbcrModelConversion" category="enum"/>
+        <type category="enum" name="VkSamplerYcbcrModelConversionKHR"              alias="VkSamplerYcbcrModelConversion"/>
+        <type name="VkSamplerYcbcrRange" category="enum"/>
+        <type category="enum" name="VkSamplerYcbcrRangeKHR"                        alias="VkSamplerYcbcrRange"/>
+        <type name="VkChromaLocation" category="enum"/>
+        <type category="enum" name="VkChromaLocationKHR"                           alias="VkChromaLocation"/>
+        <type name="VkSamplerReductionMode" category="enum"/>
+        <type category="enum" name="VkSamplerReductionModeEXT"                     alias="VkSamplerReductionMode"/>
+        <type name="VkBlendOverlapEXT" category="enum"/>
+        <type name="VkDebugUtilsMessageSeverityFlagBitsEXT" category="enum"/>
+        <type name="VkDebugUtilsMessageTypeFlagBitsEXT" category="enum"/>
+        <type name="VkFullScreenExclusiveEXT" category="enum"/>
+        <type name="VkShaderFloatControlsIndependence" category="enum"/>
+        <type category="enum" name="VkShaderFloatControlsIndependenceKHR"          alias="VkShaderFloatControlsIndependence"/>
+        <type name="VkFragmentShadingRateCombinerOpKHR" category="enum"/>
+        <type name="VkSubmitFlagBitsKHR" category="enum"/>
+
+            <comment>Enumerated types in the header, but not used by the API</comment>
+        <type name="VkVendorId" category="enum"/>
+        <type name="VkDriverId" category="enum"/>
+        <type category="enum" name="VkDriverIdKHR"                                 alias="VkDriverId"/>
+        <type name="VkShadingRatePaletteEntryNV" category="enum"/>
+        <type name="VkCoarseSampleOrderTypeNV" category="enum"/>
+        <type name="VkPipelineExecutableStatisticFormatKHR" category="enum"/>
+
+            <comment>Video Core extensions</comment>
+        <type name="VkVideoCodecOperationFlagBitsKHR" category="enum"/>
+        <type name="VkVideoChromaSubsamplingFlagBitsKHR" category="enum"/>
+        <type name="VkVideoComponentBitDepthFlagBitsKHR" category="enum"/>
+        <type name="VkVideoCapabilityFlagBitsKHR" category="enum"/>
+        <type name="VkVideoSessionCreateFlagBitsKHR" category="enum"/>
+        <type name="VkVideoCodingQualityPresetFlagBitsKHR" category="enum"/>
+        <type name="VkVideoCodingControlFlagBitsKHR" category="enum"/>
+        <type name="VkQueryResultStatusKHR" category="enum"/>
+
+            <comment>Video Decode extensions</comment>
+        <type name="VkVideoDecodeFlagBitsKHR" category="enum"/>
+
+            <comment>Video H.264 Decode extensions</comment>
+        <type name="VkVideoDecodeH264PictureLayoutFlagBitsEXT" category="enum"/>
+
+            <comment>Video H.265 Decode extensions</comment>
+
+            <comment>Video Encode extensions</comment>
+        <type name="VkVideoEncodeFlagBitsKHR" category="enum"/>
+        <type name="VkVideoEncodeRateControlFlagBitsKHR" category="enum"/>
+        <type name="VkVideoEncodeRateControlModeFlagBitsKHR" category="enum"/>
+
+           <comment>Video H.264 Encode extensions</comment>
+        <type name="VkVideoEncodeH264CapabilityFlagBitsEXT"     category="enum"/>
+        <type name="VkVideoEncodeH264InputModeFlagBitsEXT"      category="enum"/>
+        <type name="VkVideoEncodeH264OutputModeFlagBitsEXT"     category="enum"/>
+        <type name="VkVideoEncodeH264CreateFlagBitsEXT"         category="enum"/>
+
+           <comment>Video H.265 Encode extensions</comment>
+        <type name="VkVideoEncodeH265InputModeFlagBitsEXT"      category="enum"/>
+        <type name="VkVideoEncodeH265OutputModeFlagBitsEXT"     category="enum"/>
+        <type name="VkVideoEncodeH265CtbSizeFlagBitsEXT"        category="enum"/>
+
+        <comment>The PFN_vk*Function types are used by VkAllocationCallbacks below</comment>
+        <type category="funcpointer">typedef void (VKAPI_PTR *<name>PFN_vkInternalAllocationNotification</name>)(
+    <type>void</type>*                                       pUserData,
+    <type>size_t</type>                                      size,
+    <type>VkInternalAllocationType</type>                    allocationType,
+    <type>VkSystemAllocationScope</type>                     allocationScope);</type>
+        <type category="funcpointer">typedef void (VKAPI_PTR *<name>PFN_vkInternalFreeNotification</name>)(
+    <type>void</type>*                                       pUserData,
+    <type>size_t</type>                                      size,
+    <type>VkInternalAllocationType</type>                    allocationType,
+    <type>VkSystemAllocationScope</type>                     allocationScope);</type>
+        <type category="funcpointer">typedef void* (VKAPI_PTR *<name>PFN_vkReallocationFunction</name>)(
+    <type>void</type>*                                       pUserData,
+    <type>void</type>*                                       pOriginal,
+    <type>size_t</type>                                      size,
+    <type>size_t</type>                                      alignment,
+    <type>VkSystemAllocationScope</type>                     allocationScope);</type>
+        <type category="funcpointer">typedef void* (VKAPI_PTR *<name>PFN_vkAllocationFunction</name>)(
+    <type>void</type>*                                       pUserData,
+    <type>size_t</type>                                      size,
+    <type>size_t</type>                                      alignment,
+    <type>VkSystemAllocationScope</type>                     allocationScope);</type>
+        <type category="funcpointer">typedef void (VKAPI_PTR *<name>PFN_vkFreeFunction</name>)(
+    <type>void</type>*                                       pUserData,
+    <type>void</type>*                                       pMemory);</type>
+
+            <comment>The PFN_vkVoidFunction type are used by VkGet*ProcAddr below</comment>
+        <type category="funcpointer">typedef void (VKAPI_PTR *<name>PFN_vkVoidFunction</name>)(void);</type>
+
+            <comment>The PFN_vkDebugReportCallbackEXT type are used by the DEBUG_REPORT extension</comment>
+        <type category="funcpointer">typedef VkBool32 (VKAPI_PTR *<name>PFN_vkDebugReportCallbackEXT</name>)(
+    <type>VkDebugReportFlagsEXT</type>                       flags,
+    <type>VkDebugReportObjectTypeEXT</type>                  objectType,
+    <type>uint64_t</type>                                    object,
+    <type>size_t</type>                                      location,
+    <type>int32_t</type>                                     messageCode,
+    const <type>char</type>*                                 pLayerPrefix,
+    const <type>char</type>*                                 pMessage,
+    <type>void</type>*                                       pUserData);</type>
+
+            <comment>The PFN_vkDebugUtilsMessengerCallbackEXT type are used by the VK_EXT_debug_utils extension</comment>
+        <type category="funcpointer" requires="VkDebugUtilsMessengerCallbackDataEXT">typedef VkBool32 (VKAPI_PTR *<name>PFN_vkDebugUtilsMessengerCallbackEXT</name>)(
+    <type>VkDebugUtilsMessageSeverityFlagBitsEXT</type>           messageSeverity,
+    <type>VkDebugUtilsMessageTypeFlagsEXT</type>                  messageTypes,
+    const <type>VkDebugUtilsMessengerCallbackDataEXT</type>*      pCallbackData,
+    <type>void</type>*                                            pUserData);</type>
+
+            <comment>The PFN_vkDeviceMemoryReportCallbackEXT type is used by the VK_EXT_device_memory_report extension</comment>
+        <type category="funcpointer" requires="VkDeviceMemoryReportCallbackDataEXT">typedef void (VKAPI_PTR *<name>PFN_vkDeviceMemoryReportCallbackEXT</name>)(
+    const <type>VkDeviceMemoryReportCallbackDataEXT</type>*  pCallbackData,
+    <type>void</type>*                                       pUserData);</type>
+
+            <comment>Struct types</comment>
+        <type category="struct" name="VkBaseOutStructure">
+            <member><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">struct <type>VkBaseOutStructure</type>* <name>pNext</name></member>
+        </type>
+        <type category="struct" name="VkBaseInStructure">
+            <member><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const struct <type>VkBaseInStructure</type>* <name>pNext</name></member>
+        </type>
+        <type category="struct" name="VkOffset2D">
+            <member><type>int32_t</type>        <name>x</name></member>
+            <member><type>int32_t</type>        <name>y</name></member>
+        </type>
+        <type category="struct" name="VkOffset3D">
+            <member><type>int32_t</type>        <name>x</name></member>
+            <member><type>int32_t</type>        <name>y</name></member>
+            <member><type>int32_t</type>        <name>z</name></member>
+        </type>
+        <type category="struct" name="VkExtent2D">
+            <member><type>uint32_t</type>        <name>width</name></member>
+            <member><type>uint32_t</type>        <name>height</name></member>
+        </type>
+        <type category="struct" name="VkExtent3D">
+            <member><type>uint32_t</type>        <name>width</name></member>
+            <member><type>uint32_t</type>        <name>height</name></member>
+            <member><type>uint32_t</type>        <name>depth</name></member>
+        </type>
+        <type category="struct" name="VkViewport">
+            <member noautovalidity="true"><type>float</type> <name>x</name></member>
+            <member noautovalidity="true"><type>float</type> <name>y</name></member>
+            <member noautovalidity="true"><type>float</type> <name>width</name></member>
+            <member noautovalidity="true"><type>float</type> <name>height</name></member>
+            <member><type>float</type>                       <name>minDepth</name></member>
+            <member><type>float</type>                       <name>maxDepth</name></member>
+        </type>
+        <type category="struct" name="VkRect2D">
+            <member><type>VkOffset2D</type>     <name>offset</name></member>
+            <member><type>VkExtent2D</type>     <name>extent</name></member>
+        </type>
+        <type category="struct" name="VkClearRect">
+            <member><type>VkRect2D</type>       <name>rect</name></member>
+            <member><type>uint32_t</type>       <name>baseArrayLayer</name></member>
+            <member><type>uint32_t</type>       <name>layerCount</name></member>
+        </type>
+        <type category="struct" name="VkComponentMapping">
+            <member><type>VkComponentSwizzle</type> <name>r</name></member>
+            <member><type>VkComponentSwizzle</type> <name>g</name></member>
+            <member><type>VkComponentSwizzle</type> <name>b</name></member>
+            <member><type>VkComponentSwizzle</type> <name>a</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceProperties" returnedonly="true">
+            <member limittype="noauto"><type>uint32_t</type>       <name>apiVersion</name></member>
+            <member limittype="noauto"><type>uint32_t</type>       <name>driverVersion</name></member>
+            <member limittype="noauto"><type>uint32_t</type>       <name>vendorID</name></member>
+            <member limittype="noauto"><type>uint32_t</type>       <name>deviceID</name></member>
+            <member limittype="noauto"><type>VkPhysicalDeviceType</type> <name>deviceType</name></member>
+            <member limittype="noauto"><type>char</type>           <name>deviceName</name>[<enum>VK_MAX_PHYSICAL_DEVICE_NAME_SIZE</enum>]</member>
+            <member limittype="noauto"><type>uint8_t</type>        <name>pipelineCacheUUID</name>[<enum>VK_UUID_SIZE</enum>]</member>
+            <member limittype="struct"><type>VkPhysicalDeviceLimits</type> <name>limits</name></member>
+            <member limittype="struct"><type>VkPhysicalDeviceSparseProperties</type> <name>sparseProperties</name></member>
+        </type>
+        <type category="struct" name="VkExtensionProperties" returnedonly="true">
+            <member><type>char</type>            <name>extensionName</name>[<enum>VK_MAX_EXTENSION_NAME_SIZE</enum>]<comment>extension name</comment></member>
+            <member><type>uint32_t</type>        <name>specVersion</name><comment>version of the extension specification implemented</comment></member>
+        </type>
+        <type category="struct" name="VkLayerProperties" returnedonly="true">
+            <member><type>char</type>            <name>layerName</name>[<enum>VK_MAX_EXTENSION_NAME_SIZE</enum>]<comment>layer name</comment></member>
+            <member><type>uint32_t</type>        <name>specVersion</name><comment>version of the layer specification implemented</comment></member>
+            <member><type>uint32_t</type>        <name>implementationVersion</name><comment>build or release version of the layer's library</comment></member>
+            <member><type>char</type>            <name>description</name>[<enum>VK_MAX_DESCRIPTION_SIZE</enum>]<comment>Free-form description of the layer</comment></member>
+        </type>
+        <type category="struct" name="VkApplicationInfo">
+            <member values="VK_STRUCTURE_TYPE_APPLICATION_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*     <name>pNext</name></member>
+            <member optional="true" len="null-terminated">const <type>char</type>*     <name>pApplicationName</name></member>
+            <member><type>uint32_t</type>        <name>applicationVersion</name></member>
+            <member optional="true" len="null-terminated">const <type>char</type>*     <name>pEngineName</name></member>
+            <member><type>uint32_t</type>        <name>engineVersion</name></member>
+            <member><type>uint32_t</type>        <name>apiVersion</name></member>
+        </type>
+        <type category="struct" name="VkAllocationCallbacks">
+            <member optional="true"><type>void</type>*           <name>pUserData</name></member>
+            <member noautovalidity="true"><type>PFN_vkAllocationFunction</type>   <name>pfnAllocation</name></member>
+            <member noautovalidity="true"><type>PFN_vkReallocationFunction</type> <name>pfnReallocation</name></member>
+            <member noautovalidity="true"><type>PFN_vkFreeFunction</type>    <name>pfnFree</name></member>
+            <member optional="true" noautovalidity="true"><type>PFN_vkInternalAllocationNotification</type> <name>pfnInternalAllocation</name></member>
+            <member optional="true" noautovalidity="true"><type>PFN_vkInternalFreeNotification</type> <name>pfnInternalFree</name></member>
+        </type>
+        <type category="struct" name="VkDeviceQueueCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*     <name>pNext</name></member>
+            <member optional="true"><type>VkDeviceQueueCreateFlags</type>    <name>flags</name></member>
+            <member><type>uint32_t</type>        <name>queueFamilyIndex</name></member>
+            <member><type>uint32_t</type>        <name>queueCount</name></member>
+            <member len="queueCount">const <type>float</type>*    <name>pQueuePriorities</name></member>
+        </type>
+        <type category="struct" name="VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*     <name>pNext</name></member>
+            <member optional="true"><type>VkDeviceCreateFlags</type>    <name>flags</name></member>
+            <member><type>uint32_t</type>        <name>queueCreateInfoCount</name></member>
+            <member len="queueCreateInfoCount">const <type>VkDeviceQueueCreateInfo</type>* <name>pQueueCreateInfos</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>enabledLayerCount</name></member>
+            <member len="enabledLayerCount,null-terminated">const <type>char</type>* const*      <name>ppEnabledLayerNames</name><comment>Ordered list of layer names to be enabled</comment></member>
+            <member optional="true"><type>uint32_t</type>               <name>enabledExtensionCount</name></member>
+            <member len="enabledExtensionCount,null-terminated">const <type>char</type>* const*      <name>ppEnabledExtensionNames</name></member>
+            <member optional="true">const <type>VkPhysicalDeviceFeatures</type>* <name>pEnabledFeatures</name></member>
+        </type>
+        <type category="struct" name="VkInstanceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*     <name>pNext</name></member>
+            <member optional="true"><type>VkInstanceCreateFlags</type>  <name>flags</name></member>
+            <member optional="true">const <type>VkApplicationInfo</type>* <name>pApplicationInfo</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>enabledLayerCount</name></member>
+            <member len="enabledLayerCount,null-terminated">const <type>char</type>* const*      <name>ppEnabledLayerNames</name><comment>Ordered list of layer names to be enabled</comment></member>
+            <member optional="true"><type>uint32_t</type>               <name>enabledExtensionCount</name></member>
+            <member len="enabledExtensionCount,null-terminated">const <type>char</type>* const*      <name>ppEnabledExtensionNames</name><comment>Extension names to be enabled</comment></member>
+        </type>
+        <type category="struct" name="VkQueueFamilyProperties" returnedonly="true">
+            <member optional="true"><type>VkQueueFlags</type>           <name>queueFlags</name><comment>Queue flags</comment></member>
+            <member><type>uint32_t</type>               <name>queueCount</name></member>
+            <member><type>uint32_t</type>               <name>timestampValidBits</name></member>
+            <member><type>VkExtent3D</type>             <name>minImageTransferGranularity</name><comment>Minimum alignment requirement for image transfers</comment></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceMemoryProperties" returnedonly="true">
+            <member><type>uint32_t</type>               <name>memoryTypeCount</name></member>
+            <member><type>VkMemoryType</type>           <name>memoryTypes</name>[<enum>VK_MAX_MEMORY_TYPES</enum>]</member>
+            <member><type>uint32_t</type>               <name>memoryHeapCount</name></member>
+            <member><type>VkMemoryHeap</type>           <name>memoryHeaps</name>[<enum>VK_MAX_MEMORY_HEAPS</enum>]</member>
+        </type>
+        <type category="struct" name="VkMemoryAllocateInfo">
+            <member values="VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member><type>VkDeviceSize</type>           <name>allocationSize</name><comment>Size of memory allocation</comment></member>
+            <member devicememorytypeindex="1"><type>uint32_t</type>               <name>memoryTypeIndex</name><comment>Index of the of the memory type to allocate from</comment></member>
+        </type>
+        <type category="struct" name="VkMemoryRequirements" returnedonly="true">
+            <member><type>VkDeviceSize</type>           <name>size</name><comment>Specified in bytes</comment></member>
+            <member><type>VkDeviceSize</type>           <name>alignment</name><comment>Specified in bytes</comment></member>
+            <member devicememorytypebits="1"><type>uint32_t</type>               <name>memoryTypeBits</name><comment>Bitmask of the allowed memory type indices into memoryTypes[] for this object</comment></member>
+        </type>
+        <type category="struct" name="VkSparseImageFormatProperties" returnedonly="true">
+            <member optional="true"><type>VkImageAspectFlags</type>     <name>aspectMask</name></member>
+            <member><type>VkExtent3D</type>             <name>imageGranularity</name></member>
+            <member optional="true"><type>VkSparseImageFormatFlags</type> <name>flags</name></member>
+        </type>
+        <type category="struct" name="VkSparseImageMemoryRequirements" returnedonly="true">
+            <member><type>VkSparseImageFormatProperties</type> <name>formatProperties</name></member>
+            <member><type>uint32_t</type>               <name>imageMipTailFirstLod</name></member>
+            <member><type>VkDeviceSize</type>           <name>imageMipTailSize</name><comment>Specified in bytes, must be a multiple of sparse block size in bytes / alignment</comment></member>
+            <member><type>VkDeviceSize</type>           <name>imageMipTailOffset</name><comment>Specified in bytes, must be a multiple of sparse block size in bytes / alignment</comment></member>
+            <member><type>VkDeviceSize</type>           <name>imageMipTailStride</name><comment>Specified in bytes, must be a multiple of sparse block size in bytes / alignment</comment></member>
+        </type>
+        <type category="struct" name="VkMemoryType" returnedonly="true">
+            <member optional="true"><type>VkMemoryPropertyFlags</type>  <name>propertyFlags</name><comment>Memory properties of this memory type</comment></member>
+            <member><type>uint32_t</type>               <name>heapIndex</name><comment>Index of the memory heap allocations of this memory type are taken from</comment></member>
+        </type>
+        <type category="struct" name="VkMemoryHeap" returnedonly="true">
+            <member><type>VkDeviceSize</type>           <name>size</name><comment>Available memory in the heap</comment></member>
+            <member optional="true"><type>VkMemoryHeapFlags</type>      <name>flags</name><comment>Flags for the heap</comment></member>
+        </type>
+        <type category="struct" name="VkMappedMemoryRange">
+            <member values="VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member devicememoryhandle="1"><type>VkDeviceMemory</type>         <name>memory</name><comment>Mapped memory object</comment></member>
+            <member devicememoryoffset="1"><type>VkDeviceSize</type>           <name>offset</name><comment>Offset within the memory object where the range starts</comment></member>
+            <member devicememorysize="1"><type>VkDeviceSize</type>           <name>size</name><comment>Size of the range within the memory object</comment></member>
+        </type>
+        <type category="struct" name="VkFormatProperties" returnedonly="true">
+            <member optional="true"><type>VkFormatFeatureFlags</type>   <name>linearTilingFeatures</name><comment>Format features in case of linear tiling</comment></member>
+            <member optional="true"><type>VkFormatFeatureFlags</type>   <name>optimalTilingFeatures</name><comment>Format features in case of optimal tiling</comment></member>
+            <member optional="true"><type>VkFormatFeatureFlags</type>   <name>bufferFeatures</name><comment>Format features supported by buffers</comment></member>
+        </type>
+        <type category="struct" name="VkImageFormatProperties" returnedonly="true">
+            <member><type>VkExtent3D</type>             <name>maxExtent</name><comment>max image dimensions for this resource type</comment></member>
+            <member><type>uint32_t</type>               <name>maxMipLevels</name><comment>max number of mipmap levels for this resource type</comment></member>
+            <member><type>uint32_t</type>               <name>maxArrayLayers</name><comment>max array size for this resource type</comment></member>
+            <member optional="true"><type>VkSampleCountFlags</type>     <name>sampleCounts</name><comment>supported sample counts for this resource type</comment></member>
+            <member><type>VkDeviceSize</type>           <name>maxResourceSize</name><comment>max size (in bytes) of this resource type</comment></member>
+        </type>
+        <type category="struct" name="VkDescriptorBufferInfo">
+            <member optional="true"><type>VkBuffer</type>               <name>buffer</name><comment>Buffer used for this descriptor slot.</comment></member>
+            <member><type>VkDeviceSize</type>           <name>offset</name><comment>Base offset from buffer start in bytes to update in the descriptor set.</comment></member>
+            <member><type>VkDeviceSize</type>           <name>range</name><comment>Size in bytes of the buffer resource for this descriptor update.</comment></member>
+        </type>
+        <type category="struct" name="VkDescriptorImageInfo">
+            <member noautovalidity="true"><type>VkSampler</type>       <name>sampler</name><comment>Sampler to write to the descriptor in case it is a SAMPLER or COMBINED_IMAGE_SAMPLER descriptor. Ignored otherwise.</comment></member>
+            <member noautovalidity="true"><type>VkImageView</type>     <name>imageView</name><comment>Image view to write to the descriptor in case it is a SAMPLED_IMAGE, STORAGE_IMAGE, COMBINED_IMAGE_SAMPLER, or INPUT_ATTACHMENT descriptor. Ignored otherwise.</comment></member>
+            <member noautovalidity="true"><type>VkImageLayout</type>   <name>imageLayout</name><comment>Layout the image is expected to be in when accessed using this descriptor (only used if imageView is not VK_NULL_HANDLE).</comment></member>
+        </type>
+        <type category="struct" name="VkWriteDescriptorSet">
+            <member values="VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member noautovalidity="true"><type>VkDescriptorSet</type>        <name>dstSet</name><comment>Destination descriptor set</comment></member>
+            <member><type>uint32_t</type>               <name>dstBinding</name><comment>Binding within the destination descriptor set to write</comment></member>
+            <member><type>uint32_t</type>               <name>dstArrayElement</name><comment>Array element within the destination binding to write</comment></member>
+            <member><type>uint32_t</type>               <name>descriptorCount</name><comment>Number of descriptors to write (determines the size of the array pointed by pDescriptors)</comment></member>
+            <member><type>VkDescriptorType</type>       <name>descriptorType</name><comment>Descriptor type to write (determines which members of the array pointed by pDescriptors are going to be used)</comment></member>
+            <member noautovalidity="true" len="descriptorCount"
+                filterVar="descriptorType"
+                filterVals="VK_DESCRIPTOR_TYPE_SAMPLER,VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT"
+                >const <type>VkDescriptorImageInfo</type>* <name>pImageInfo</name><comment>Sampler, image view, and layout for SAMPLER, COMBINED_IMAGE_SAMPLER, {SAMPLED,STORAGE}_IMAGE, and INPUT_ATTACHMENT descriptor types.</comment></member>
+            <member noautovalidity="true" len="descriptorCount"
+                filterVar="descriptorType"
+                filterVals="VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC,VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC"
+                >const <type>VkDescriptorBufferInfo</type>* <name>pBufferInfo</name><comment>Raw buffer, size, and offset for {UNIFORM,STORAGE}_BUFFER[_DYNAMIC] descriptor types.</comment></member>
+            <member noautovalidity="true" len="descriptorCount"
+                filterVar="descriptorType"
+                filterVals="VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER,VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER">const <type>VkBufferView</type>*    <name>pTexelBufferView</name><comment>Buffer view to write to the descriptor for {UNIFORM,STORAGE}_TEXEL_BUFFER descriptor types.</comment></member>
+        </type>
+        <type category="struct" name="VkCopyDescriptorSet">
+            <member values="VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member><type>VkDescriptorSet</type>        <name>srcSet</name><comment>Source descriptor set</comment></member>
+            <member><type>uint32_t</type>               <name>srcBinding</name><comment>Binding within the source descriptor set to copy from</comment></member>
+            <member><type>uint32_t</type>               <name>srcArrayElement</name><comment>Array element within the source binding to copy from</comment></member>
+            <member><type>VkDescriptorSet</type>        <name>dstSet</name><comment>Destination descriptor set</comment></member>
+            <member><type>uint32_t</type>               <name>dstBinding</name><comment>Binding within the destination descriptor set to copy to</comment></member>
+            <member><type>uint32_t</type>               <name>dstArrayElement</name><comment>Array element within the destination binding to copy to</comment></member>
+            <member><type>uint32_t</type>               <name>descriptorCount</name><comment>Number of descriptors to write (determines the size of the array pointed by pDescriptors)</comment></member>
+        </type>
+        <type category="struct" name="VkBufferCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkBufferCreateFlags</type>    <name>flags</name><comment>Buffer creation flags</comment></member>
+            <member><type>VkDeviceSize</type>           <name>size</name><comment>Specified in bytes</comment></member>
+            <member><type>VkBufferUsageFlags</type>     <name>usage</name><comment>Buffer usage flags</comment></member>
+            <member><type>VkSharingMode</type>          <name>sharingMode</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>queueFamilyIndexCount</name></member>
+            <member noautovalidity="true" len="queueFamilyIndexCount">const <type>uint32_t</type>*        <name>pQueueFamilyIndices</name></member>
+        </type>
+        <type category="struct" name="VkBufferViewCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkBufferViewCreateFlags</type><name>flags</name></member>
+            <member><type>VkBuffer</type>               <name>buffer</name></member>
+            <member><type>VkFormat</type>               <name>format</name><comment>Optionally specifies format of elements</comment></member>
+            <member><type>VkDeviceSize</type>           <name>offset</name><comment>Specified in bytes</comment></member>
+            <member><type>VkDeviceSize</type>           <name>range</name><comment>View size specified in bytes</comment></member>
+        </type>
+        <type category="struct" name="VkImageSubresource">
+            <member><type>VkImageAspectFlags</type>     <name>aspectMask</name></member>
+            <member><type>uint32_t</type>               <name>mipLevel</name></member>
+            <member><type>uint32_t</type>               <name>arrayLayer</name></member>
+        </type>
+        <type category="struct" name="VkImageSubresourceLayers">
+            <member><type>VkImageAspectFlags</type>     <name>aspectMask</name></member>
+            <member><type>uint32_t</type>               <name>mipLevel</name></member>
+            <member><type>uint32_t</type>               <name>baseArrayLayer</name></member>
+            <member><type>uint32_t</type>               <name>layerCount</name></member>
+        </type>
+        <type category="struct" name="VkImageSubresourceRange">
+            <member><type>VkImageAspectFlags</type>     <name>aspectMask</name></member>
+            <member><type>uint32_t</type>               <name>baseMipLevel</name></member>
+            <member><type>uint32_t</type>               <name>levelCount</name></member>
+            <member><type>uint32_t</type>               <name>baseArrayLayer</name></member>
+            <member><type>uint32_t</type>               <name>layerCount</name></member>
+        </type>
+        <type category="struct" name="VkMemoryBarrier">
+            <member values="VK_STRUCTURE_TYPE_MEMORY_BARRIER"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkAccessFlags</type>          <name>srcAccessMask</name><comment>Memory accesses from the source of the dependency to synchronize</comment></member>
+            <member optional="true"><type>VkAccessFlags</type>          <name>dstAccessMask</name><comment>Memory accesses from the destination of the dependency to synchronize</comment></member>
+        </type>
+        <type category="struct" name="VkBufferMemoryBarrier">
+            <member values="VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member noautovalidity="true"><type>VkAccessFlags</type>          <name>srcAccessMask</name><comment>Memory accesses from the source of the dependency to synchronize</comment></member>
+            <member noautovalidity="true"><type>VkAccessFlags</type>          <name>dstAccessMask</name><comment>Memory accesses from the destination of the dependency to synchronize</comment></member>
+            <member><type>uint32_t</type>               <name>srcQueueFamilyIndex</name><comment>Queue family to transition ownership from</comment></member>
+            <member><type>uint32_t</type>               <name>dstQueueFamilyIndex</name><comment>Queue family to transition ownership to</comment></member>
+            <member><type>VkBuffer</type>               <name>buffer</name><comment>Buffer to sync</comment></member>
+            <member><type>VkDeviceSize</type>           <name>offset</name><comment>Offset within the buffer to sync</comment></member>
+            <member><type>VkDeviceSize</type>           <name>size</name><comment>Amount of bytes to sync</comment></member>
+        </type>
+        <type category="struct" name="VkImageMemoryBarrier">
+            <member values="VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member noautovalidity="true"><type>VkAccessFlags</type>          <name>srcAccessMask</name><comment>Memory accesses from the source of the dependency to synchronize</comment></member>
+            <member noautovalidity="true"><type>VkAccessFlags</type>          <name>dstAccessMask</name><comment>Memory accesses from the destination of the dependency to synchronize</comment></member>
+            <member><type>VkImageLayout</type>          <name>oldLayout</name><comment>Current layout of the image</comment></member>
+            <member><type>VkImageLayout</type>          <name>newLayout</name><comment>New layout to transition the image to</comment></member>
+            <member><type>uint32_t</type>               <name>srcQueueFamilyIndex</name><comment>Queue family to transition ownership from</comment></member>
+            <member><type>uint32_t</type>               <name>dstQueueFamilyIndex</name><comment>Queue family to transition ownership to</comment></member>
+            <member><type>VkImage</type>                <name>image</name><comment>Image to sync</comment></member>
+            <member><type>VkImageSubresourceRange</type> <name>subresourceRange</name><comment>Subresource range to sync</comment></member>
+        </type>
+        <type category="struct" name="VkImageCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkImageCreateFlags</type>     <name>flags</name><comment>Image creation flags</comment></member>
+            <member><type>VkImageType</type>            <name>imageType</name></member>
+            <member><type>VkFormat</type>               <name>format</name></member>
+            <member><type>VkExtent3D</type>             <name>extent</name></member>
+            <member><type>uint32_t</type>               <name>mipLevels</name></member>
+            <member><type>uint32_t</type>               <name>arrayLayers</name></member>
+            <member><type>VkSampleCountFlagBits</type>  <name>samples</name></member>
+            <member><type>VkImageTiling</type>          <name>tiling</name></member>
+            <member><type>VkImageUsageFlags</type>      <name>usage</name><comment>Image usage flags</comment></member>
+            <member><type>VkSharingMode</type>          <name>sharingMode</name><comment>Cross-queue-family sharing mode</comment></member>
+            <member optional="true"><type>uint32_t</type>               <name>queueFamilyIndexCount</name><comment>Number of queue families to share across</comment></member>
+            <member noautovalidity="true" len="queueFamilyIndexCount">const <type>uint32_t</type>*        <name>pQueueFamilyIndices</name><comment>Array of queue family indices to share across</comment></member>
+            <member><type>VkImageLayout</type>          <name>initialLayout</name><comment>Initial image layout for all subresources</comment></member>
+        </type>
+        <type category="struct" name="VkSubresourceLayout" returnedonly="true">
+            <member><type>VkDeviceSize</type>           <name>offset</name><comment>Specified in bytes</comment></member>
+            <member><type>VkDeviceSize</type>           <name>size</name><comment>Specified in bytes</comment></member>
+            <member><type>VkDeviceSize</type>           <name>rowPitch</name><comment>Specified in bytes</comment></member>
+            <member><type>VkDeviceSize</type>           <name>arrayPitch</name><comment>Specified in bytes</comment></member>
+            <member><type>VkDeviceSize</type>           <name>depthPitch</name><comment>Specified in bytes</comment></member>
+        </type>
+        <type category="struct" name="VkImageViewCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkImageViewCreateFlags</type> <name>flags</name></member>
+            <member><type>VkImage</type>                <name>image</name></member>
+            <member><type>VkImageViewType</type>        <name>viewType</name></member>
+            <member><type>VkFormat</type>               <name>format</name></member>
+            <member><type>VkComponentMapping</type>     <name>components</name></member>
+            <member><type>VkImageSubresourceRange</type> <name>subresourceRange</name></member>
+        </type>
+        <type category="struct" name="VkBufferCopy">
+            <member><type>VkDeviceSize</type>                       <name>srcOffset</name><comment>Specified in bytes</comment></member>
+            <member><type>VkDeviceSize</type>                       <name>dstOffset</name><comment>Specified in bytes</comment></member>
+            <member noautovalidity="true"><type>VkDeviceSize</type> <name>size</name><comment>Specified in bytes</comment></member>
+        </type>
+        <type category="struct" name="VkSparseMemoryBind">
+            <member><type>VkDeviceSize</type>           <name>resourceOffset</name><comment>Specified in bytes</comment></member>
+            <member><type>VkDeviceSize</type>           <name>size</name><comment>Specified in bytes</comment></member>
+            <member optional="true" devicememoryhandle="1"><type>VkDeviceMemory</type>         <name>memory</name></member>
+            <member devicememoryoffset="1"><type>VkDeviceSize</type>           <name>memoryOffset</name><comment>Specified in bytes</comment></member>
+            <member optional="true"><type>VkSparseMemoryBindFlags</type><name>flags</name></member>
+        </type>
+        <type category="struct" name="VkSparseImageMemoryBind">
+            <member><type>VkImageSubresource</type>     <name>subresource</name></member>
+            <member><type>VkOffset3D</type>             <name>offset</name></member>
+            <member><type>VkExtent3D</type>             <name>extent</name></member>
+            <member optional="true" devicememoryhandle="1"><type>VkDeviceMemory</type>         <name>memory</name></member>
+            <member devicememoryoffset="1"><type>VkDeviceSize</type>           <name>memoryOffset</name><comment>Specified in bytes</comment></member>
+            <member optional="true"><type>VkSparseMemoryBindFlags</type><name>flags</name></member>
+        </type>
+        <type category="struct" name="VkSparseBufferMemoryBindInfo">
+            <member><type>VkBuffer</type> <name>buffer</name></member>
+            <member><type>uint32_t</type>               <name>bindCount</name></member>
+            <member len="bindCount">const <type>VkSparseMemoryBind</type>* <name>pBinds</name></member>
+        </type>
+        <type category="struct" name="VkSparseImageOpaqueMemoryBindInfo">
+            <member><type>VkImage</type> <name>image</name></member>
+            <member><type>uint32_t</type>               <name>bindCount</name></member>
+            <member len="bindCount">const <type>VkSparseMemoryBind</type>* <name>pBinds</name></member>
+        </type>
+        <type category="struct" name="VkSparseImageMemoryBindInfo">
+            <member><type>VkImage</type> <name>image</name></member>
+            <member><type>uint32_t</type>               <name>bindCount</name></member>
+            <member len="bindCount">const <type>VkSparseImageMemoryBind</type>* <name>pBinds</name></member>
+        </type>
+        <type category="struct" name="VkBindSparseInfo">
+            <member values="VK_STRUCTURE_TYPE_BIND_SPARSE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>waitSemaphoreCount</name></member>
+            <member len="waitSemaphoreCount">const <type>VkSemaphore</type>*     <name>pWaitSemaphores</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>bufferBindCount</name></member>
+            <member len="bufferBindCount">const <type>VkSparseBufferMemoryBindInfo</type>* <name>pBufferBinds</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>imageOpaqueBindCount</name></member>
+            <member len="imageOpaqueBindCount">const <type>VkSparseImageOpaqueMemoryBindInfo</type>* <name>pImageOpaqueBinds</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>imageBindCount</name></member>
+            <member len="imageBindCount">const <type>VkSparseImageMemoryBindInfo</type>* <name>pImageBinds</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>signalSemaphoreCount</name></member>
+            <member len="signalSemaphoreCount">const <type>VkSemaphore</type>*     <name>pSignalSemaphores</name></member>
+        </type>
+        <type category="struct" name="VkImageCopy">
+            <member><type>VkImageSubresourceLayers</type> <name>srcSubresource</name></member>
+            <member><type>VkOffset3D</type>             <name>srcOffset</name><comment>Specified in pixels for both compressed and uncompressed images</comment></member>
+            <member><type>VkImageSubresourceLayers</type> <name>dstSubresource</name></member>
+            <member><type>VkOffset3D</type>             <name>dstOffset</name><comment>Specified in pixels for both compressed and uncompressed images</comment></member>
+            <member><type>VkExtent3D</type>             <name>extent</name><comment>Specified in pixels for both compressed and uncompressed images</comment></member>
+        </type>
+        <type category="struct" name="VkImageBlit">
+            <member><type>VkImageSubresourceLayers</type> <name>srcSubresource</name></member>
+            <member><type>VkOffset3D</type>             <name>srcOffsets</name>[2]<comment>Specified in pixels for both compressed and uncompressed images</comment></member>
+            <member><type>VkImageSubresourceLayers</type> <name>dstSubresource</name></member>
+            <member><type>VkOffset3D</type>             <name>dstOffsets</name>[2]<comment>Specified in pixels for both compressed and uncompressed images</comment></member>
+        </type>
+        <type category="struct" name="VkBufferImageCopy">
+            <member><type>VkDeviceSize</type>           <name>bufferOffset</name><comment>Specified in bytes</comment></member>
+            <member><type>uint32_t</type>               <name>bufferRowLength</name><comment>Specified in texels</comment></member>
+            <member><type>uint32_t</type>               <name>bufferImageHeight</name></member>
+            <member><type>VkImageSubresourceLayers</type> <name>imageSubresource</name></member>
+            <member><type>VkOffset3D</type>             <name>imageOffset</name><comment>Specified in pixels for both compressed and uncompressed images</comment></member>
+            <member><type>VkExtent3D</type>             <name>imageExtent</name><comment>Specified in pixels for both compressed and uncompressed images</comment></member>
+        </type>
+        <type category="struct" name="VkImageResolve">
+            <member><type>VkImageSubresourceLayers</type> <name>srcSubresource</name></member>
+            <member><type>VkOffset3D</type>             <name>srcOffset</name></member>
+            <member><type>VkImageSubresourceLayers</type> <name>dstSubresource</name></member>
+            <member><type>VkOffset3D</type>             <name>dstOffset</name></member>
+            <member><type>VkExtent3D</type>             <name>extent</name></member>
+        </type>
+        <type category="struct" name="VkShaderModuleCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkShaderModuleCreateFlags</type> <name>flags</name></member>
+            <member><type>size_t</type>                 <name>codeSize</name><comment>Specified in bytes</comment></member>
+            <member len="latexmath:[\textrm{codeSize} \over 4]" altlen="codeSize / 4">const <type>uint32_t</type>*            <name>pCode</name><comment>Binary code of size codeSize</comment></member>
+        </type>
+        <type category="struct" name="VkDescriptorSetLayoutBinding">
+            <member><type>uint32_t</type>               <name>binding</name><comment>Binding number for this entry</comment></member>
+            <member><type>VkDescriptorType</type>       <name>descriptorType</name><comment>Type of the descriptors in this binding</comment></member>
+            <member optional="true"><type>uint32_t</type> <name>descriptorCount</name><comment>Number of descriptors in this binding</comment></member>
+            <member noautovalidity="true"><type>VkShaderStageFlags</type>     <name>stageFlags</name><comment>Shader stages this binding is visible to</comment></member>
+            <member noautovalidity="true" optional="true" len="descriptorCount">const <type>VkSampler</type>*       <name>pImmutableSamplers</name><comment>Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains count number of elements)</comment></member>
+        </type>
+        <type category="struct" name="VkDescriptorSetLayoutCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkDescriptorSetLayoutCreateFlags</type>    <name>flags</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>bindingCount</name><comment>Number of bindings in the descriptor set layout</comment></member>
+            <member len="bindingCount">const <type>VkDescriptorSetLayoutBinding</type>* <name>pBindings</name><comment>Array of descriptor set layout bindings</comment></member>
+        </type>
+        <type category="struct" name="VkDescriptorPoolSize">
+            <member><type>VkDescriptorType</type>       <name>type</name></member>
+            <member><type>uint32_t</type>               <name>descriptorCount</name></member>
+        </type>
+        <type category="struct" name="VkDescriptorPoolCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkDescriptorPoolCreateFlags</type>  <name>flags</name></member>
+            <member><type>uint32_t</type>               <name>maxSets</name></member>
+            <member><type>uint32_t</type>               <name>poolSizeCount</name></member>
+            <member len="poolSizeCount">const <type>VkDescriptorPoolSize</type>* <name>pPoolSizes</name></member>
+        </type>
+        <type category="struct" name="VkDescriptorSetAllocateInfo">
+            <member values="VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member><type>VkDescriptorPool</type>       <name>descriptorPool</name></member>
+            <member><type>uint32_t</type>               <name>descriptorSetCount</name></member>
+            <member len="descriptorSetCount">const <type>VkDescriptorSetLayout</type>* <name>pSetLayouts</name></member>
+        </type>
+        <type category="struct" name="VkSpecializationMapEntry">
+            <member><type>uint32_t</type>                     <name>constantID</name><comment>The SpecConstant ID specified in the BIL</comment></member>
+            <member><type>uint32_t</type>                     <name>offset</name><comment>Offset of the value in the data block</comment></member>
+            <member noautovalidity="true"><type>size_t</type> <name>size</name><comment>Size in bytes of the SpecConstant</comment></member>
+        </type>
+        <type category="struct" name="VkSpecializationInfo">
+            <member optional="true"><type>uint32_t</type>               <name>mapEntryCount</name><comment>Number of entries in the map</comment></member>
+            <member len="mapEntryCount">const <type>VkSpecializationMapEntry</type>* <name>pMapEntries</name><comment>Array of map entries</comment></member>
+            <member optional="true"><type>size_t</type>                 <name>dataSize</name><comment>Size in bytes of pData</comment></member>
+            <member len="dataSize">const <type>void</type>*            <name>pData</name><comment>Pointer to SpecConstant data</comment></member>
+        </type>
+        <type category="struct" name="VkPipelineShaderStageCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkPipelineShaderStageCreateFlags</type>    <name>flags</name></member>
+            <member><type>VkShaderStageFlagBits</type>  <name>stage</name><comment>Shader stage</comment></member>
+            <member><type>VkShaderModule</type>         <name>module</name><comment>Module containing entry point</comment></member>
+            <member len="null-terminated">const <type>char</type>*            <name>pName</name><comment>Null-terminated entry point name</comment></member>
+            <member optional="true">const <type>VkSpecializationInfo</type>* <name>pSpecializationInfo</name></member>
+        </type>
+        <type category="struct" name="VkComputePipelineCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkPipelineCreateFlags</type>  <name>flags</name><comment>Pipeline creation flags</comment></member>
+            <member><type>VkPipelineShaderStageCreateInfo</type> <name>stage</name></member>
+            <member><type>VkPipelineLayout</type>       <name>layout</name><comment>Interface layout of the pipeline</comment></member>
+            <member noautovalidity="true" optional="true"><type>VkPipeline</type>      <name>basePipelineHandle</name><comment>If VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is nonzero, it specifies the handle of the base pipeline this is a derivative of</comment></member>
+            <member><type>int32_t</type>                <name>basePipelineIndex</name><comment>If VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is not -1, it specifies an index into pCreateInfos of the base pipeline this is a derivative of</comment></member>
+        </type>
+        <type category="struct" name="VkVertexInputBindingDescription">
+            <member><type>uint32_t</type>               <name>binding</name><comment>Vertex buffer binding id</comment></member>
+            <member><type>uint32_t</type>               <name>stride</name><comment>Distance between vertices in bytes (0 = no advancement)</comment></member>
+            <member><type>VkVertexInputRate</type>      <name>inputRate</name><comment>The rate at which the vertex data is consumed</comment></member>
+        </type>
+        <type category="struct" name="VkVertexInputAttributeDescription">
+            <member><type>uint32_t</type>               <name>location</name><comment>location of the shader vertex attrib</comment></member>
+            <member><type>uint32_t</type>               <name>binding</name><comment>Vertex buffer binding id</comment></member>
+            <member><type>VkFormat</type>               <name>format</name><comment>format of source data</comment></member>
+            <member><type>uint32_t</type>               <name>offset</name><comment>Offset of first element in bytes from base of vertex</comment></member>
+        </type>
+        <type category="struct" name="VkPipelineVertexInputStateCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkPipelineVertexInputStateCreateFlags</type>    <name>flags</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>vertexBindingDescriptionCount</name><comment>number of bindings</comment></member>
+            <member len="vertexBindingDescriptionCount">const <type>VkVertexInputBindingDescription</type>* <name>pVertexBindingDescriptions</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>vertexAttributeDescriptionCount</name><comment>number of attributes</comment></member>
+            <member len="vertexAttributeDescriptionCount">const <type>VkVertexInputAttributeDescription</type>* <name>pVertexAttributeDescriptions</name></member>
+        </type>
+        <type category="struct" name="VkPipelineInputAssemblyStateCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkPipelineInputAssemblyStateCreateFlags</type>    <name>flags</name></member>
+            <member><type>VkPrimitiveTopology</type>    <name>topology</name></member>
+            <member><type>VkBool32</type>               <name>primitiveRestartEnable</name></member>
+        </type>
+        <type category="struct" name="VkPipelineTessellationStateCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkPipelineTessellationStateCreateFlags</type>    <name>flags</name></member>
+            <member><type>uint32_t</type>               <name>patchControlPoints</name></member>
+        </type>
+        <type category="struct" name="VkPipelineViewportStateCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkPipelineViewportStateCreateFlags</type>    <name>flags</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>viewportCount</name></member>
+            <member noautovalidity="true" optional="true" len="viewportCount">const <type>VkViewport</type>*      <name>pViewports</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>scissorCount</name></member>
+            <member noautovalidity="true" optional="true" len="scissorCount">const <type>VkRect2D</type>*        <name>pScissors</name></member>
+        </type>
+        <type category="struct" name="VkPipelineRasterizationStateCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>* <name>pNext</name></member>
+            <member optional="true"><type>VkPipelineRasterizationStateCreateFlags</type>    <name>flags</name></member>
+            <member><type>VkBool32</type>               <name>depthClampEnable</name></member>
+            <member><type>VkBool32</type>               <name>rasterizerDiscardEnable</name></member>
+            <member><type>VkPolygonMode</type>          <name>polygonMode</name><comment>optional (GL45)</comment></member>
+            <member optional="true"><type>VkCullModeFlags</type>        <name>cullMode</name></member>
+            <member><type>VkFrontFace</type>            <name>frontFace</name></member>
+            <member><type>VkBool32</type>               <name>depthBiasEnable</name></member>
+            <member><type>float</type>                  <name>depthBiasConstantFactor</name></member>
+            <member><type>float</type>                  <name>depthBiasClamp</name></member>
+            <member><type>float</type>                  <name>depthBiasSlopeFactor</name></member>
+            <member><type>float</type>                  <name>lineWidth</name></member>
+        </type>
+        <type category="struct" name="VkPipelineMultisampleStateCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkPipelineMultisampleStateCreateFlags</type>    <name>flags</name></member>
+            <member><type>VkSampleCountFlagBits</type>  <name>rasterizationSamples</name><comment>Number of samples used for rasterization</comment></member>
+            <member><type>VkBool32</type>               <name>sampleShadingEnable</name><comment>optional (GL45)</comment></member>
+            <member><type>float</type>                  <name>minSampleShading</name><comment>optional (GL45)</comment></member>
+            <member optional="true" len="latexmath:[\lceil{\mathit{rasterizationSamples} \over 32}\rceil]" altlen="(rasterizationSamples + 31) / 32">const <type>VkSampleMask</type>*    <name>pSampleMask</name><comment>Array of sampleMask words</comment></member>
+            <member><type>VkBool32</type>               <name>alphaToCoverageEnable</name></member>
+            <member><type>VkBool32</type>               <name>alphaToOneEnable</name></member>
+        </type>
+        <type category="struct" name="VkPipelineColorBlendAttachmentState">
+            <member><type>VkBool32</type>               <name>blendEnable</name></member>
+            <member><type>VkBlendFactor</type>          <name>srcColorBlendFactor</name></member>
+            <member><type>VkBlendFactor</type>          <name>dstColorBlendFactor</name></member>
+            <member><type>VkBlendOp</type>              <name>colorBlendOp</name></member>
+            <member><type>VkBlendFactor</type>          <name>srcAlphaBlendFactor</name></member>
+            <member><type>VkBlendFactor</type>          <name>dstAlphaBlendFactor</name></member>
+            <member><type>VkBlendOp</type>              <name>alphaBlendOp</name></member>
+            <member optional="true"><type>VkColorComponentFlags</type>  <name>colorWriteMask</name></member>
+        </type>
+        <type category="struct" name="VkPipelineColorBlendStateCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkPipelineColorBlendStateCreateFlags</type>    <name>flags</name></member>
+            <member><type>VkBool32</type>               <name>logicOpEnable</name></member>
+            <member noautovalidity="true"><type>VkLogicOp</type>              <name>logicOp</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>attachmentCount</name><comment># of pAttachments</comment></member>
+            <member len="attachmentCount">const <type>VkPipelineColorBlendAttachmentState</type>* <name>pAttachments</name></member>
+            <member><type>float</type>                  <name>blendConstants</name>[4]</member>
+        </type>
+        <type category="struct" name="VkPipelineDynamicStateCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkPipelineDynamicStateCreateFlags</type>    <name>flags</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>dynamicStateCount</name></member>
+            <member len="dynamicStateCount">const <type>VkDynamicState</type>*  <name>pDynamicStates</name></member>
+        </type>
+        <type category="struct" name="VkStencilOpState">
+            <member><type>VkStencilOp</type>            <name>failOp</name></member>
+            <member><type>VkStencilOp</type>            <name>passOp</name></member>
+            <member><type>VkStencilOp</type>            <name>depthFailOp</name></member>
+            <member><type>VkCompareOp</type>            <name>compareOp</name></member>
+            <member><type>uint32_t</type>               <name>compareMask</name></member>
+            <member><type>uint32_t</type>               <name>writeMask</name></member>
+            <member><type>uint32_t</type>               <name>reference</name></member>
+        </type>
+        <type category="struct" name="VkPipelineDepthStencilStateCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkPipelineDepthStencilStateCreateFlags</type>    <name>flags</name></member>
+            <member><type>VkBool32</type>               <name>depthTestEnable</name></member>
+            <member><type>VkBool32</type>               <name>depthWriteEnable</name></member>
+            <member><type>VkCompareOp</type>            <name>depthCompareOp</name></member>
+            <member><type>VkBool32</type>               <name>depthBoundsTestEnable</name><comment>optional (depth_bounds_test)</comment></member>
+            <member><type>VkBool32</type>               <name>stencilTestEnable</name></member>
+            <member><type>VkStencilOpState</type>       <name>front</name></member>
+            <member><type>VkStencilOpState</type>       <name>back</name></member>
+            <member><type>float</type>                  <name>minDepthBounds</name></member>
+            <member><type>float</type>                  <name>maxDepthBounds</name></member>
+        </type>
+        <type category="struct" name="VkGraphicsPipelineCreateInfo" let="hasTessellation : (arrayany pStages 0 stageCount (lambda ((s VkPipelineShaderStageCreateInfo)) (or (eq (getfield s stage) VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT) (eq (getfield s stage) VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT)))),hasRasterization : (if (eq 0 pRasterizationState) 0 (not (getfield pRasterizationState rasterizerDiscardEnable)))">
+            <member values="VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkPipelineCreateFlags</type>  <name>flags</name><comment>Pipeline creation flags</comment></member>
+            <member><type>uint32_t</type>               <name>stageCount</name></member>
+            <member len="stageCount">const <type>VkPipelineShaderStageCreateInfo</type>* <name>pStages</name><comment>One entry for each active shader stage</comment></member>
+            <member noautovalidity="true" optional="streamFeature:VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT">const <type>VkPipelineVertexInputStateCreateInfo</type>* <name>pVertexInputState</name></member>
+            <member noautovalidity="true" optional="streamFeature:VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT">const <type>VkPipelineInputAssemblyStateCreateInfo</type>* <name>pInputAssemblyState</name></member>
+            <member noautovalidity="true" optional="true" filterVar="hasTessellation">const <type>VkPipelineTessellationStateCreateInfo</type>* <name>pTessellationState</name></member>
+            <member noautovalidity="true" optional="true" filterVar="hasRasterization">const <type>VkPipelineViewportStateCreateInfo</type>* <name>pViewportState</name></member>
+            <member noautovalidity="true" optional="streamFeature:VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT">const <type>VkPipelineRasterizationStateCreateInfo</type>* <name>pRasterizationState</name></member>
+            <member noautovalidity="true" optional="true" filterVar="hasRasterization">const <type>VkPipelineMultisampleStateCreateInfo</type>* <name>pMultisampleState</name></member>
+            <member noautovalidity="true" optional="true" filterVar="hasRasterization">const <type>VkPipelineDepthStencilStateCreateInfo</type>* <name>pDepthStencilState</name></member>
+            <member noautovalidity="true" optional="true" filterVar="hasRasterization">const <type>VkPipelineColorBlendStateCreateInfo</type>* <name>pColorBlendState</name></member>
+            <member optional="true">const <type>VkPipelineDynamicStateCreateInfo</type>* <name>pDynamicState</name></member>
+            <member><type>VkPipelineLayout</type>       <name>layout</name><comment>Interface layout of the pipeline</comment></member>
+            <member optional="true"><type>VkRenderPass</type>           <name>renderPass</name></member>
+            <member><type>uint32_t</type>               <name>subpass</name></member>
+            <member noautovalidity="true" optional="true"><type>VkPipeline</type>      <name>basePipelineHandle</name><comment>If VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is nonzero, it specifies the handle of the base pipeline this is a derivative of</comment></member>
+            <member><type>int32_t</type>                <name>basePipelineIndex</name><comment>If VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is not -1, it specifies an index into pCreateInfos of the base pipeline this is a derivative of</comment></member>
+        </type>
+        <type category="struct" name="VkPipelineCacheCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkPipelineCacheCreateFlags</type>    <name>flags</name></member>
+            <member optional="true"><type>size_t</type>                 <name>initialDataSize</name><comment>Size of initial data to populate cache, in bytes</comment></member>
+            <member len="initialDataSize">const <type>void</type>*            <name>pInitialData</name><comment>Initial data to populate cache</comment></member>
+        </type>
+        <type category="struct" name="VkPipelineCacheHeaderVersionOne">
+            <comment>The fields in this structure are non-normative since structure packing is implementation-defined in C. The specification defines the normative layout.</comment>
+            <member><type>uint32_t</type>               <name>headerSize</name></member>
+            <member><type>VkPipelineCacheHeaderVersion</type> <name>headerVersion</name></member>
+            <member><type>uint32_t</type>               <name>vendorID</name></member>
+            <member><type>uint32_t</type>               <name>deviceID</name></member>
+            <member><type>uint8_t</type>                <name>pipelineCacheUUID</name>[<enum>VK_UUID_SIZE</enum>]</member>
+        </type>
+        <type category="struct" name="VkPushConstantRange">
+            <member><type>VkShaderStageFlags</type>     <name>stageFlags</name><comment>Which stages use the range</comment></member>
+            <member><type>uint32_t</type>               <name>offset</name><comment>Start of the range, in bytes</comment></member>
+            <member><type>uint32_t</type>               <name>size</name><comment>Size of the range, in bytes</comment></member>
+        </type>
+        <type category="struct" name="VkPipelineLayoutCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkPipelineLayoutCreateFlags</type>    <name>flags</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>setLayoutCount</name><comment>Number of descriptor sets interfaced by the pipeline</comment></member>
+            <member len="setLayoutCount">const <type>VkDescriptorSetLayout</type>* <name>pSetLayouts</name><comment>Array of setCount number of descriptor set layout objects defining the layout of the</comment></member>
+            <member optional="true"><type>uint32_t</type>               <name>pushConstantRangeCount</name><comment>Number of push-constant ranges used by the pipeline</comment></member>
+            <member len="pushConstantRangeCount">const <type>VkPushConstantRange</type>* <name>pPushConstantRanges</name><comment>Array of pushConstantRangeCount number of ranges used by various shader stages</comment></member>
+        </type>
+        <type category="struct" name="VkSamplerCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkSamplerCreateFlags</type>   <name>flags</name></member>
+            <member><type>VkFilter</type>               <name>magFilter</name><comment>Filter mode for magnification</comment></member>
+            <member><type>VkFilter</type>               <name>minFilter</name><comment>Filter mode for minifiation</comment></member>
+            <member><type>VkSamplerMipmapMode</type>    <name>mipmapMode</name><comment>Mipmap selection mode</comment></member>
+            <member><type>VkSamplerAddressMode</type>   <name>addressModeU</name></member>
+            <member><type>VkSamplerAddressMode</type>   <name>addressModeV</name></member>
+            <member><type>VkSamplerAddressMode</type>   <name>addressModeW</name></member>
+            <member><type>float</type>                  <name>mipLodBias</name></member>
+            <member><type>VkBool32</type>               <name>anisotropyEnable</name></member>
+            <member><type>float</type>                  <name>maxAnisotropy</name></member>
+            <member><type>VkBool32</type>               <name>compareEnable</name></member>
+            <member noautovalidity="true"><type>VkCompareOp</type>            <name>compareOp</name></member>
+            <member><type>float</type>                  <name>minLod</name></member>
+            <member><type>float</type>                  <name>maxLod</name></member>
+            <member noautovalidity="true"><type>VkBorderColor</type>          <name>borderColor</name></member>
+            <member><type>VkBool32</type>               <name>unnormalizedCoordinates</name></member>
+        </type>
+        <type category="struct" name="VkCommandPoolCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkCommandPoolCreateFlags</type>   <name>flags</name><comment>Command pool creation flags</comment></member>
+            <member><type>uint32_t</type>               <name>queueFamilyIndex</name></member>
+        </type>
+        <type category="struct" name="VkCommandBufferAllocateInfo">
+            <member values="VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member><type>VkCommandPool</type>          <name>commandPool</name></member>
+            <member><type>VkCommandBufferLevel</type>   <name>level</name></member>
+            <member><type>uint32_t</type>               <name>commandBufferCount</name></member>
+        </type>
+        <type category="struct" name="VkCommandBufferInheritanceInfo">
+            <member values="VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true" noautovalidity="true"><type>VkRenderPass</type>    <name>renderPass</name><comment>Render pass for secondary command buffers</comment></member>
+            <member><type>uint32_t</type>               <name>subpass</name></member>
+            <member optional="true" noautovalidity="true"><type>VkFramebuffer</type>   <name>framebuffer</name><comment>Framebuffer for secondary command buffers</comment></member>
+            <member><type>VkBool32</type>               <name>occlusionQueryEnable</name><comment>Whether this secondary command buffer may be executed during an occlusion query</comment></member>
+            <member optional="true" noautovalidity="true"><type>VkQueryControlFlags</type>    <name>queryFlags</name><comment>Query flags used by this secondary command buffer, if executed during an occlusion query</comment></member>
+            <member optional="true" noautovalidity="true"><type>VkQueryPipelineStatisticFlags</type> <name>pipelineStatistics</name><comment>Pipeline statistics that may be counted for this secondary command buffer</comment></member>
+        </type>
+        <type category="struct" name="VkCommandBufferBeginInfo">
+            <member values="VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkCommandBufferUsageFlags</type>  <name>flags</name><comment>Command buffer usage flags</comment></member>
+            <member optional="true" noautovalidity="true">const <type>VkCommandBufferInheritanceInfo</type>*       <name>pInheritanceInfo</name><comment>Pointer to inheritance info for secondary command buffers</comment></member>
+        </type>
+        <type category="struct" name="VkRenderPassBeginInfo">
+            <member values="VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member><type>VkRenderPass</type>           <name>renderPass</name></member>
+            <member><type>VkFramebuffer</type>          <name>framebuffer</name></member>
+            <member><type>VkRect2D</type>               <name>renderArea</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>clearValueCount</name></member>
+            <member len="clearValueCount" noautovalidity="true">const <type>VkClearValue</type>*    <name>pClearValues</name></member>
+        </type>
+        <type category="union" name="VkClearColorValue" comment="// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared.">
+            <member><type>float</type>                  <name>float32</name>[4]</member>
+            <member><type>int32_t</type>                <name>int32</name>[4]</member>
+            <member><type>uint32_t</type>               <name>uint32</name>[4]</member>
+        </type>
+        <type category="struct" name="VkClearDepthStencilValue">
+            <member><type>float</type>                  <name>depth</name></member>
+            <member><type>uint32_t</type>               <name>stencil</name></member>
+        </type>
+        <type category="union" name="VkClearValue" comment="// Union allowing specification of color or depth and stencil values. Actual value selected is based on attachment being cleared.">
+            <member noautovalidity="true"><type>VkClearColorValue</type>      <name>color</name></member>
+            <member><type>VkClearDepthStencilValue</type> <name>depthStencil</name></member>
+        </type>
+        <type category="struct" name="VkClearAttachment">
+            <member><type>VkImageAspectFlags</type>     <name>aspectMask</name></member>
+            <member><type>uint32_t</type>               <name>colorAttachment</name></member>
+            <member noautovalidity="true"><type>VkClearValue</type>           <name>clearValue</name></member>
+        </type>
+        <type category="struct" name="VkAttachmentDescription">
+            <member optional="true"><type>VkAttachmentDescriptionFlags</type> <name>flags</name></member>
+            <member><type>VkFormat</type>               <name>format</name></member>
+            <member><type>VkSampleCountFlagBits</type>  <name>samples</name></member>
+            <member><type>VkAttachmentLoadOp</type>     <name>loadOp</name><comment>Load operation for color or depth data</comment></member>
+            <member><type>VkAttachmentStoreOp</type>    <name>storeOp</name><comment>Store operation for color or depth data</comment></member>
+            <member><type>VkAttachmentLoadOp</type>     <name>stencilLoadOp</name><comment>Load operation for stencil data</comment></member>
+            <member><type>VkAttachmentStoreOp</type>    <name>stencilStoreOp</name><comment>Store operation for stencil data</comment></member>
+            <member><type>VkImageLayout</type>          <name>initialLayout</name></member>
+            <member><type>VkImageLayout</type>          <name>finalLayout</name></member>
+        </type>
+        <type category="struct" name="VkAttachmentReference">
+            <member><type>uint32_t</type>               <name>attachment</name></member>
+            <member><type>VkImageLayout</type>          <name>layout</name></member>
+        </type>
+        <type category="struct" name="VkSubpassDescription">
+            <member optional="true"><type>VkSubpassDescriptionFlags</type> <name>flags</name></member>
+            <member><type>VkPipelineBindPoint</type>    <name>pipelineBindPoint</name><comment>Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now</comment></member>
+            <member optional="true"><type>uint32_t</type>               <name>inputAttachmentCount</name></member>
+            <member len="inputAttachmentCount">const <type>VkAttachmentReference</type>* <name>pInputAttachments</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>colorAttachmentCount</name></member>
+            <member len="colorAttachmentCount">const <type>VkAttachmentReference</type>* <name>pColorAttachments</name></member>
+            <member optional="true" len="colorAttachmentCount">const <type>VkAttachmentReference</type>* <name>pResolveAttachments</name></member>
+            <member optional="true">const <type>VkAttachmentReference</type>* <name>pDepthStencilAttachment</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>preserveAttachmentCount</name></member>
+            <member len="preserveAttachmentCount">const <type>uint32_t</type>* <name>pPreserveAttachments</name></member>
+        </type>
+        <type category="struct" name="VkSubpassDependency">
+            <member><type>uint32_t</type>               <name>srcSubpass</name></member>
+            <member><type>uint32_t</type>               <name>dstSubpass</name></member>
+            <member optional="true"><type>VkPipelineStageFlags</type>   <name>srcStageMask</name></member>
+            <member optional="true"><type>VkPipelineStageFlags</type>   <name>dstStageMask</name></member>
+            <member optional="true"><type>VkAccessFlags</type>          <name>srcAccessMask</name><comment>Memory accesses from the source of the dependency to synchronize</comment></member>
+            <member optional="true"><type>VkAccessFlags</type>          <name>dstAccessMask</name><comment>Memory accesses from the destination of the dependency to synchronize</comment></member>
+            <member optional="true"><type>VkDependencyFlags</type>      <name>dependencyFlags</name></member>
+        </type>
+        <type category="struct" name="VkRenderPassCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkRenderPassCreateFlags</type> <name>flags</name></member>
+            <member optional="true"><type>uint32_t</type>   <name>attachmentCount</name></member>
+            <member len="attachmentCount">const <type>VkAttachmentDescription</type>* <name>pAttachments</name></member>
+            <member><type>uint32_t</type>               <name>subpassCount</name></member>
+            <member len="subpassCount">const <type>VkSubpassDescription</type>* <name>pSubpasses</name></member>
+            <member optional="true"><type>uint32_t</type>       <name>dependencyCount</name></member>
+            <member len="dependencyCount">const <type>VkSubpassDependency</type>* <name>pDependencies</name></member>
+        </type>
+        <type category="struct" name="VkEventCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_EVENT_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkEventCreateFlags</type>     <name>flags</name><comment>Event creation flags</comment></member>
+        </type>
+        <type category="struct" name="VkFenceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_FENCE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkFenceCreateFlags</type>     <name>flags</name><comment>Fence creation flags</comment></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceFeatures">
+            <member><type>VkBool32</type>               <name>robustBufferAccess</name><comment>out of bounds buffer accesses are well defined</comment></member>
+            <member><type>VkBool32</type>               <name>fullDrawIndexUint32</name><comment>full 32-bit range of indices for indexed draw calls</comment></member>
+            <member><type>VkBool32</type>               <name>imageCubeArray</name><comment>image views which are arrays of cube maps</comment></member>
+            <member><type>VkBool32</type>               <name>independentBlend</name><comment>blending operations are controlled per-attachment</comment></member>
+            <member><type>VkBool32</type>               <name>geometryShader</name><comment>geometry stage</comment></member>
+            <member><type>VkBool32</type>               <name>tessellationShader</name><comment>tessellation control and evaluation stage</comment></member>
+            <member><type>VkBool32</type>               <name>sampleRateShading</name><comment>per-sample shading and interpolation</comment></member>
+            <member><type>VkBool32</type>               <name>dualSrcBlend</name><comment>blend operations which take two sources</comment></member>
+            <member><type>VkBool32</type>               <name>logicOp</name><comment>logic operations</comment></member>
+            <member><type>VkBool32</type>               <name>multiDrawIndirect</name><comment>multi draw indirect</comment></member>
+            <member><type>VkBool32</type>               <name>drawIndirectFirstInstance</name><comment>indirect draws can use non-zero firstInstance</comment></member>
+            <member><type>VkBool32</type>               <name>depthClamp</name><comment>depth clamping</comment></member>
+            <member><type>VkBool32</type>               <name>depthBiasClamp</name><comment>depth bias clamping</comment></member>
+            <member><type>VkBool32</type>               <name>fillModeNonSolid</name><comment>point and wireframe fill modes</comment></member>
+            <member><type>VkBool32</type>               <name>depthBounds</name><comment>depth bounds test</comment></member>
+            <member><type>VkBool32</type>               <name>wideLines</name><comment>lines with width greater than 1</comment></member>
+            <member><type>VkBool32</type>               <name>largePoints</name><comment>points with size greater than 1</comment></member>
+            <member><type>VkBool32</type>               <name>alphaToOne</name><comment>the fragment alpha component can be forced to maximum representable alpha value</comment></member>
+            <member><type>VkBool32</type>               <name>multiViewport</name><comment>viewport arrays</comment></member>
+            <member><type>VkBool32</type>               <name>samplerAnisotropy</name><comment>anisotropic sampler filtering</comment></member>
+            <member><type>VkBool32</type>               <name>textureCompressionETC2</name><comment>ETC texture compression formats</comment></member>
+            <member><type>VkBool32</type>               <name>textureCompressionASTC_LDR</name><comment>ASTC LDR texture compression formats</comment></member>
+            <member><type>VkBool32</type>               <name>textureCompressionBC</name><comment>BC1-7 texture compressed formats</comment></member>
+            <member><type>VkBool32</type>               <name>occlusionQueryPrecise</name><comment>precise occlusion queries returning actual sample counts</comment></member>
+            <member><type>VkBool32</type>               <name>pipelineStatisticsQuery</name><comment>pipeline statistics query</comment></member>
+            <member><type>VkBool32</type>               <name>vertexPipelineStoresAndAtomics</name><comment>stores and atomic ops on storage buffers and images are supported in vertex, tessellation, and geometry stages</comment></member>
+            <member><type>VkBool32</type>               <name>fragmentStoresAndAtomics</name><comment>stores and atomic ops on storage buffers and images are supported in the fragment stage</comment></member>
+            <member><type>VkBool32</type>               <name>shaderTessellationAndGeometryPointSize</name><comment>tessellation and geometry stages can export point size</comment></member>
+            <member><type>VkBool32</type>               <name>shaderImageGatherExtended</name><comment>image gather with run-time values and independent offsets</comment></member>
+            <member><type>VkBool32</type>               <name>shaderStorageImageExtendedFormats</name><comment>the extended set of formats can be used for storage images</comment></member>
+            <member><type>VkBool32</type>               <name>shaderStorageImageMultisample</name><comment>multisample images can be used for storage images</comment></member>
+            <member><type>VkBool32</type>               <name>shaderStorageImageReadWithoutFormat</name><comment>read from storage image does not require format qualifier</comment></member>
+            <member><type>VkBool32</type>               <name>shaderStorageImageWriteWithoutFormat</name><comment>write to storage image does not require format qualifier</comment></member>
+            <member><type>VkBool32</type>               <name>shaderUniformBufferArrayDynamicIndexing</name><comment>arrays of uniform buffers can be accessed with dynamically uniform indices</comment></member>
+            <member><type>VkBool32</type>               <name>shaderSampledImageArrayDynamicIndexing</name><comment>arrays of sampled images can be accessed with dynamically uniform indices</comment></member>
+            <member><type>VkBool32</type>               <name>shaderStorageBufferArrayDynamicIndexing</name><comment>arrays of storage buffers can be accessed with dynamically uniform indices</comment></member>
+            <member><type>VkBool32</type>               <name>shaderStorageImageArrayDynamicIndexing</name><comment>arrays of storage images can be accessed with dynamically uniform indices</comment></member>
+            <member><type>VkBool32</type>               <name>shaderClipDistance</name><comment>clip distance in shaders</comment></member>
+            <member><type>VkBool32</type>               <name>shaderCullDistance</name><comment>cull distance in shaders</comment></member>
+            <member><type>VkBool32</type>               <name>shaderFloat64</name><comment>64-bit floats (doubles) in shaders</comment></member>
+            <member><type>VkBool32</type>               <name>shaderInt64</name><comment>64-bit integers in shaders</comment></member>
+            <member><type>VkBool32</type>               <name>shaderInt16</name><comment>16-bit integers in shaders</comment></member>
+            <member><type>VkBool32</type>               <name>shaderResourceResidency</name><comment>shader can use texture operations that return resource residency information (requires sparseNonResident support)</comment></member>
+            <member><type>VkBool32</type>               <name>shaderResourceMinLod</name><comment>shader can use texture operations that specify minimum resource LOD</comment></member>
+            <member><type>VkBool32</type>               <name>sparseBinding</name><comment>Sparse resources support: Resource memory can be managed at opaque page level rather than object level</comment></member>
+            <member><type>VkBool32</type>               <name>sparseResidencyBuffer</name><comment>Sparse resources support: GPU can access partially resident buffers </comment></member>
+            <member><type>VkBool32</type>               <name>sparseResidencyImage2D</name><comment>Sparse resources support: GPU can access partially resident 2D (non-MSAA non-depth/stencil) images </comment></member>
+            <member><type>VkBool32</type>               <name>sparseResidencyImage3D</name><comment>Sparse resources support: GPU can access partially resident 3D images </comment></member>
+            <member><type>VkBool32</type>               <name>sparseResidency2Samples</name><comment>Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples</comment></member>
+            <member><type>VkBool32</type>               <name>sparseResidency4Samples</name><comment>Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples</comment></member>
+            <member><type>VkBool32</type>               <name>sparseResidency8Samples</name><comment>Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples</comment></member>
+            <member><type>VkBool32</type>               <name>sparseResidency16Samples</name><comment>Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples</comment></member>
+            <member><type>VkBool32</type>               <name>sparseResidencyAliased</name><comment>Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in)</comment></member>
+            <member><type>VkBool32</type>               <name>variableMultisampleRate</name><comment>multisample rate must be the same for all pipelines in a subpass</comment></member>
+            <member><type>VkBool32</type>               <name>inheritedQueries</name><comment>Queries may be inherited from primary to secondary command buffers</comment></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceSparseProperties" returnedonly="true">
+            <member limittype="bitmask"><type>VkBool32</type>               <name>residencyStandard2DBlockShape</name><comment>Sparse resources support: GPU will access all 2D (single sample) sparse resources using the standard sparse image block shapes (based on pixel format)</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>residencyStandard2DMultisampleBlockShape</name><comment>Sparse resources support: GPU will access all 2D (multisample) sparse resources using the standard sparse image block shapes (based on pixel format)</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>residencyStandard3DBlockShape</name><comment>Sparse resources support: GPU will access all 3D sparse resources using the standard sparse image block shapes (based on pixel format)</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>residencyAlignedMipSize</name><comment>Sparse resources support: Images with mip level dimensions that are NOT a multiple of the sparse image block dimensions will be placed in the mip tail</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>residencyNonResidentStrict</name><comment>Sparse resources support: GPU can consistently access non-resident regions of a resource, all reads return as if data is 0, writes are discarded</comment></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceLimits" returnedonly="true">
+                <comment>resource maximum sizes</comment>
+            <member limittype="max"><type>uint32_t</type>               <name>maxImageDimension1D</name><comment>max 1D image dimension</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxImageDimension2D</name><comment>max 2D image dimension</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxImageDimension3D</name><comment>max 3D image dimension</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxImageDimensionCube</name><comment>max cubemap image dimension</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxImageArrayLayers</name><comment>max layers for image arrays</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxTexelBufferElements</name><comment>max texel buffer size (fstexels)</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxUniformBufferRange</name><comment>max uniform buffer range (bytes)</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxStorageBufferRange</name><comment>max storage buffer range (bytes)</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxPushConstantsSize</name><comment>max size of the push constants pool (bytes)</comment></member>
+                <comment>memory limits</comment>
+            <member limittype="max"><type>uint32_t</type>               <name>maxMemoryAllocationCount</name><comment>max number of device memory allocations supported</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxSamplerAllocationCount</name><comment>max number of samplers that can be allocated on a device</comment></member>
+            <member limittype="noauto"><type>VkDeviceSize</type>           <name>bufferImageGranularity</name><comment>Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage</comment></member>
+            <member limittype="max"><type>VkDeviceSize</type>           <name>sparseAddressSpaceSize</name><comment>Total address space available for sparse allocations (bytes)</comment></member>
+                <comment>descriptor set limits</comment>
+            <member limittype="max"><type>uint32_t</type>               <name>maxBoundDescriptorSets</name><comment>max number of descriptors sets that can be bound to a pipeline</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxPerStageDescriptorSamplers</name><comment>max number of samplers allowed per-stage in a descriptor set</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxPerStageDescriptorUniformBuffers</name><comment>max number of uniform buffers allowed per-stage in a descriptor set</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxPerStageDescriptorStorageBuffers</name><comment>max number of storage buffers allowed per-stage in a descriptor set</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxPerStageDescriptorSampledImages</name><comment>max number of sampled images allowed per-stage in a descriptor set</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxPerStageDescriptorStorageImages</name><comment>max number of storage images allowed per-stage in a descriptor set</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxPerStageDescriptorInputAttachments</name><comment>max number of input attachments allowed per-stage in a descriptor set</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxPerStageResources</name><comment>max number of resources allowed by a single stage</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxDescriptorSetSamplers</name><comment>max number of samplers allowed in all stages in a descriptor set</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxDescriptorSetUniformBuffers</name><comment>max number of uniform buffers allowed in all stages in a descriptor set</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxDescriptorSetUniformBuffersDynamic</name><comment>max number of dynamic uniform buffers allowed in all stages in a descriptor set</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxDescriptorSetStorageBuffers</name><comment>max number of storage buffers allowed in all stages in a descriptor set</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxDescriptorSetStorageBuffersDynamic</name><comment>max number of dynamic storage buffers allowed in all stages in a descriptor set</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxDescriptorSetSampledImages</name><comment>max number of sampled images allowed in all stages in a descriptor set</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxDescriptorSetStorageImages</name><comment>max number of storage images allowed in all stages in a descriptor set</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxDescriptorSetInputAttachments</name><comment>max number of input attachments allowed in all stages in a descriptor set</comment></member>
+                <comment>vertex stage limits</comment>
+            <member limittype="max"><type>uint32_t</type>               <name>maxVertexInputAttributes</name><comment>max number of vertex input attribute slots</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxVertexInputBindings</name><comment>max number of vertex input binding slots</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxVertexInputAttributeOffset</name><comment>max vertex input attribute offset added to vertex buffer offset</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxVertexInputBindingStride</name><comment>max vertex input binding stride</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxVertexOutputComponents</name><comment>max number of output components written by vertex shader</comment></member>
+                <comment>tessellation control stage limits</comment>
+            <member limittype="max"><type>uint32_t</type>               <name>maxTessellationGenerationLevel</name><comment>max level supported by tessellation primitive generator</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxTessellationPatchSize</name><comment>max patch size (vertices)</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxTessellationControlPerVertexInputComponents</name><comment>max number of input components per-vertex in TCS</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxTessellationControlPerVertexOutputComponents</name><comment>max number of output components per-vertex in TCS</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxTessellationControlPerPatchOutputComponents</name><comment>max number of output components per-patch in TCS</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxTessellationControlTotalOutputComponents</name><comment>max total number of per-vertex and per-patch output components in TCS</comment></member>
+                <comment>tessellation evaluation stage limits</comment>
+            <member limittype="max"><type>uint32_t</type>               <name>maxTessellationEvaluationInputComponents</name><comment>max number of input components per vertex in TES</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxTessellationEvaluationOutputComponents</name><comment>max number of output components per vertex in TES</comment></member>
+                <comment>geometry stage limits</comment>
+            <member limittype="max"><type>uint32_t</type>               <name>maxGeometryShaderInvocations</name><comment>max invocation count supported in geometry shader</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxGeometryInputComponents</name><comment>max number of input components read in geometry stage</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxGeometryOutputComponents</name><comment>max number of output components written in geometry stage</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxGeometryOutputVertices</name><comment>max number of vertices that can be emitted in geometry stage</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxGeometryTotalOutputComponents</name><comment>max total number of components (all vertices) written in geometry stage</comment></member>
+                <comment>fragment stage limits</comment>
+            <member limittype="max"><type>uint32_t</type>               <name>maxFragmentInputComponents</name><comment>max number of input components read in fragment stage</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxFragmentOutputAttachments</name><comment>max number of output attachments written in fragment stage</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxFragmentDualSrcAttachments</name><comment>max number of output attachments written when using dual source blending</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxFragmentCombinedOutputResources</name><comment>max total number of storage buffers, storage images and output buffers</comment></member>
+                <comment>compute stage limits</comment>
+            <member limittype="max"><type>uint32_t</type>               <name>maxComputeSharedMemorySize</name><comment>max total storage size of work group local storage (bytes)</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxComputeWorkGroupCount</name>[3]<comment>max num of compute work groups that may be dispatched by a single command (x,y,z)</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxComputeWorkGroupInvocations</name><comment>max total compute invocations in a single local work group</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxComputeWorkGroupSize</name>[3]<comment>max local size of a compute work group (x,y,z)</comment></member>
+            <member limittype="noauto"><type>uint32_t</type>               <name>subPixelPrecisionBits</name><comment>number bits of subpixel precision in screen x and y</comment></member>
+            <member limittype="noauto"><type>uint32_t</type>               <name>subTexelPrecisionBits</name><comment>number bits of precision for selecting texel weights</comment></member>
+            <member limittype="noauto"><type>uint32_t</type>               <name>mipmapPrecisionBits</name><comment>number bits of precision for selecting mipmap weights</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxDrawIndexedIndexValue</name><comment>max index value for indexed draw calls (for 32-bit indices)</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxDrawIndirectCount</name><comment>max draw count for indirect draw calls</comment></member>
+            <member limittype="max"><type>float</type>                  <name>maxSamplerLodBias</name><comment>max absolute sampler LOD bias</comment></member>
+            <member limittype="max"><type>float</type>                  <name>maxSamplerAnisotropy</name><comment>max degree of sampler anisotropy</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxViewports</name><comment>max number of active viewports</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxViewportDimensions</name>[2]<comment>max viewport dimensions (x,y)</comment></member>
+            <member limittype="range"><type>float</type>                  <name>viewportBoundsRange</name>[2]<comment>viewport bounds range (min,max)</comment></member>
+            <member limittype="noauto"><type>uint32_t</type>               <name>viewportSubPixelBits</name><comment>number bits of subpixel precision for viewport</comment></member>
+            <member limittype="noauto"><type>size_t</type>                 <name>minMemoryMapAlignment</name><comment>min required alignment of pointers returned by MapMemory (bytes)</comment></member>
+            <member limittype="noauto"><type>VkDeviceSize</type>           <name>minTexelBufferOffsetAlignment</name><comment>min required alignment for texel buffer offsets (bytes) </comment></member>
+            <member limittype="noauto"><type>VkDeviceSize</type>           <name>minUniformBufferOffsetAlignment</name><comment>min required alignment for uniform buffer sizes and offsets (bytes)</comment></member>
+            <member limittype="noauto"><type>VkDeviceSize</type>           <name>minStorageBufferOffsetAlignment</name><comment>min required alignment for storage buffer offsets (bytes)</comment></member>
+            <member limittype="min"><type>int32_t</type>                <name>minTexelOffset</name><comment>min texel offset for OpTextureSampleOffset</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxTexelOffset</name><comment>max texel offset for OpTextureSampleOffset</comment></member>
+            <member limittype="min"><type>int32_t</type>                <name>minTexelGatherOffset</name><comment>min texel offset for OpTextureGatherOffset</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxTexelGatherOffset</name><comment>max texel offset for OpTextureGatherOffset</comment></member>
+            <member limittype="min"><type>float</type>                  <name>minInterpolationOffset</name><comment>furthest negative offset for interpolateAtOffset</comment></member>
+            <member limittype="max"><type>float</type>                  <name>maxInterpolationOffset</name><comment>furthest positive offset for interpolateAtOffset</comment></member>
+            <member limittype="noauto"><type>uint32_t</type>               <name>subPixelInterpolationOffsetBits</name><comment>number of subpixel bits for interpolateAtOffset</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxFramebufferWidth</name><comment>max width for a framebuffer</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxFramebufferHeight</name><comment>max height for a framebuffer</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxFramebufferLayers</name><comment>max layer count for a layered framebuffer</comment></member>
+            <member limittype="bitmask" optional="true"><type>VkSampleCountFlags</type>     <name>framebufferColorSampleCounts</name><comment>supported color sample counts for a framebuffer</comment></member>
+            <member limittype="bitmask" optional="true"><type>VkSampleCountFlags</type>     <name>framebufferDepthSampleCounts</name><comment>supported depth sample counts for a framebuffer</comment></member>
+            <member limittype="bitmask" optional="true"><type>VkSampleCountFlags</type>     <name>framebufferStencilSampleCounts</name><comment>supported stencil sample counts for a framebuffer</comment></member>
+            <member limittype="bitmask" optional="true"><type>VkSampleCountFlags</type>     <name>framebufferNoAttachmentsSampleCounts</name><comment>supported sample counts for a subpass which uses no attachments</comment></member>
+            <member limittype="bitmask"><type>uint32_t</type>               <name>maxColorAttachments</name><comment>max number of color attachments per subpass</comment></member>
+            <member limittype="bitmask" optional="true"><type>VkSampleCountFlags</type>     <name>sampledImageColorSampleCounts</name><comment>supported color sample counts for a non-integer sampled image</comment></member>
+            <member limittype="bitmask" optional="true"><type>VkSampleCountFlags</type>     <name>sampledImageIntegerSampleCounts</name><comment>supported sample counts for an integer image</comment></member>
+            <member limittype="bitmask" optional="true"><type>VkSampleCountFlags</type>     <name>sampledImageDepthSampleCounts</name><comment>supported depth sample counts for a sampled image</comment></member>
+            <member limittype="bitmask" optional="true"><type>VkSampleCountFlags</type>     <name>sampledImageStencilSampleCounts</name><comment>supported stencil sample counts for a sampled image</comment></member>
+            <member limittype="bitmask" optional="true"><type>VkSampleCountFlags</type>     <name>storageImageSampleCounts</name><comment>supported sample counts for a storage image</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxSampleMaskWords</name><comment>max number of sample mask words</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>timestampComputeAndGraphics</name><comment>timestamps on graphics and compute queues</comment></member>
+            <member limittype="noauto"><type>float</type>                  <name>timestampPeriod</name><comment>number of nanoseconds it takes for timestamp query value to increment by 1</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxClipDistances</name><comment>max number of clip distances</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxCullDistances</name><comment>max number of cull distances</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxCombinedClipAndCullDistances</name><comment>max combined number of user clipping</comment></member>
+            <member limittype="max"><type>uint32_t</type>               <name>discreteQueuePriorities</name><comment>distinct queue priorities available </comment></member>
+            <member limittype="range"><type>float</type>                  <name>pointSizeRange</name>[2]<comment>range (min,max) of supported point sizes</comment></member>
+            <member limittype="range"><type>float</type>                  <name>lineWidthRange</name>[2]<comment>range (min,max) of supported line widths</comment></member>
+            <member limittype="max"><type>float</type>                  <name>pointSizeGranularity</name><comment>granularity of supported point sizes</comment></member>
+            <member limittype="max"><type>float</type>                  <name>lineWidthGranularity</name><comment>granularity of supported line widths</comment></member>
+            <member limittype="noauto"><type>VkBool32</type>               <name>strictLines</name><comment>line rasterization follows preferred rules</comment></member>
+            <member limittype="noauto"><type>VkBool32</type>               <name>standardSampleLocations</name><comment>supports standard sample locations for all supported sample counts</comment></member>
+            <member limittype="noauto"><type>VkDeviceSize</type>           <name>optimalBufferCopyOffsetAlignment</name><comment>optimal offset of buffer copies</comment></member>
+            <member limittype="noauto"><type>VkDeviceSize</type>           <name>optimalBufferCopyRowPitchAlignment</name><comment>optimal pitch of buffer copies</comment></member>
+            <member limittype="noauto"><type>VkDeviceSize</type>           <name>nonCoherentAtomSize</name><comment>minimum size and alignment for non-coherent host-mapped device memory access</comment></member>
+        </type>
+        <type category="struct" name="VkSemaphoreCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkSemaphoreCreateFlags</type> <name>flags</name><comment>Semaphore creation flags</comment></member>
+        </type>
+        <type category="struct" name="VkQueryPoolCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkQueryPoolCreateFlags</type> <name>flags</name></member>
+            <member><type>VkQueryType</type>            <name>queryType</name></member>
+            <member><type>uint32_t</type>               <name>queryCount</name></member>
+            <member optional="true" noautovalidity="true"><type>VkQueryPipelineStatisticFlags</type> <name>pipelineStatistics</name><comment>Optional</comment></member>
+        </type>
+        <type category="struct" name="VkFramebufferCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkFramebufferCreateFlags</type>    <name>flags</name></member>
+            <member><type>VkRenderPass</type>                           <name>renderPass</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>attachmentCount</name></member>
+            <member len="attachmentCount">const <type>VkImageView</type>*     <name>pAttachments</name></member>
+            <member><type>uint32_t</type>               <name>width</name></member>
+            <member><type>uint32_t</type>               <name>height</name></member>
+            <member><type>uint32_t</type>               <name>layers</name></member>
+        </type>
+        <type category="struct" name="VkDrawIndirectCommand">
+            <member><type>uint32_t</type>                       <name>vertexCount</name></member>
+            <member><type>uint32_t</type>                       <name>instanceCount</name></member>
+            <member><type>uint32_t</type>                       <name>firstVertex</name></member>
+            <member noautovalidity="true"><type>uint32_t</type> <name>firstInstance</name></member>
+        </type>
+        <type category="struct" name="VkDrawIndexedIndirectCommand">
+            <member><type>uint32_t</type>                       <name>indexCount</name></member>
+            <member><type>uint32_t</type>                       <name>instanceCount</name></member>
+            <member><type>uint32_t</type>                       <name>firstIndex</name></member>
+            <member><type>int32_t</type>                        <name>vertexOffset</name></member>
+            <member noautovalidity="true"><type>uint32_t</type> <name>firstInstance</name></member>
+        </type>
+        <type category="struct" name="VkDispatchIndirectCommand">
+            <member noautovalidity="true"><type>uint32_t</type> <name>x</name></member>
+            <member noautovalidity="true"><type>uint32_t</type> <name>y</name></member>
+            <member noautovalidity="true"><type>uint32_t</type> <name>z</name></member>
+        </type>
+        <type category="struct" name="VkMultiDrawInfoEXT">
+            <member><type>uint32_t</type> <name>firstVertex</name></member>
+            <member><type>uint32_t</type> <name>vertexCount</name></member>
+        </type>
+        <type category="struct" name="VkMultiDrawIndexedInfoEXT">
+            <member><type>uint32_t</type> <name>firstIndex</name></member>
+            <member><type>uint32_t</type> <name>indexCount</name></member>
+            <member><type>int32_t</type> <name>vertexOffset</name></member>
+        </type>
+        <type category="struct" name="VkSubmitInfo">
+            <member values="VK_STRUCTURE_TYPE_SUBMIT_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>* <name>pNext</name></member>
+            <member optional="true"><type>uint32_t</type>       <name>waitSemaphoreCount</name></member>
+            <member len="waitSemaphoreCount">const <type>VkSemaphore</type>*     <name>pWaitSemaphores</name></member>
+            <member len="waitSemaphoreCount">const <type>VkPipelineStageFlags</type>*           <name>pWaitDstStageMask</name></member>
+            <member optional="true"><type>uint32_t</type>       <name>commandBufferCount</name></member>
+            <member len="commandBufferCount">const <type>VkCommandBuffer</type>*     <name>pCommandBuffers</name></member>
+            <member optional="true"><type>uint32_t</type>       <name>signalSemaphoreCount</name></member>
+            <member len="signalSemaphoreCount">const <type>VkSemaphore</type>*     <name>pSignalSemaphores</name></member>
+        </type>
+            <comment>WSI extensions</comment>
+        <type category="struct" name="VkDisplayPropertiesKHR" returnedonly="true">
+            <member><type>VkDisplayKHR</type>                     <name>display</name><comment>Handle of the display object</comment></member>
+            <member len="null-terminated">const <type>char</type>*                      <name>displayName</name><comment>Name of the display</comment></member>
+            <member><type>VkExtent2D</type>                       <name>physicalDimensions</name><comment>In millimeters?</comment></member>
+            <member><type>VkExtent2D</type>                       <name>physicalResolution</name><comment>Max resolution for CRT?</comment></member>
+            <member optional="true"><type>VkSurfaceTransformFlagsKHR</type>       <name>supportedTransforms</name><comment>one or more bits from VkSurfaceTransformFlagsKHR</comment></member>
+            <member><type>VkBool32</type>                         <name>planeReorderPossible</name><comment>VK_TRUE if the overlay plane's z-order can be changed on this display.</comment></member>
+            <member><type>VkBool32</type>                         <name>persistentContent</name><comment>VK_TRUE if this is a "smart" display that supports self-refresh/internal buffering.</comment></member>
+        </type>
+        <type category="struct" name="VkDisplayPlanePropertiesKHR" returnedonly="true">
+            <member><type>VkDisplayKHR</type>                     <name>currentDisplay</name><comment>Display the plane is currently associated with.  Will be VK_NULL_HANDLE if the plane is not in use.</comment></member>
+            <member><type>uint32_t</type>                         <name>currentStackIndex</name><comment>Current z-order of the plane.</comment></member>
+        </type>
+        <type category="struct" name="VkDisplayModeParametersKHR">
+            <member><type>VkExtent2D</type>                       <name>visibleRegion</name><comment>Visible scanout region.</comment></member>
+            <member noautovalidity="true"><type>uint32_t</type>   <name>refreshRate</name><comment>Number of times per second the display is updated.</comment></member>
+        </type>
+        <type category="struct" name="VkDisplayModePropertiesKHR" returnedonly="true">
+            <member><type>VkDisplayModeKHR</type>                 <name>displayMode</name><comment>Handle of this display mode.</comment></member>
+            <member><type>VkDisplayModeParametersKHR</type>       <name>parameters</name><comment>The parameters this mode uses.</comment></member>
+        </type>
+        <type category="struct" name="VkDisplayModeCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkDisplayModeCreateFlagsKHR</type>      <name>flags</name></member>
+            <member><type>VkDisplayModeParametersKHR</type>       <name>parameters</name><comment>The parameters this mode uses.</comment></member>
+        </type>
+        <type category="struct" name="VkDisplayPlaneCapabilitiesKHR" returnedonly="true">
+            <member optional="true"><type>VkDisplayPlaneAlphaFlagsKHR</type>      <name>supportedAlpha</name><comment>Types of alpha blending supported, if any.</comment></member>
+            <member><type>VkOffset2D</type>                       <name>minSrcPosition</name><comment>Does the plane have any position and extent restrictions?</comment></member>
+            <member><type>VkOffset2D</type>                       <name>maxSrcPosition</name></member>
+            <member><type>VkExtent2D</type>                       <name>minSrcExtent</name></member>
+            <member><type>VkExtent2D</type>                       <name>maxSrcExtent</name></member>
+            <member><type>VkOffset2D</type>                       <name>minDstPosition</name></member>
+            <member><type>VkOffset2D</type>                       <name>maxDstPosition</name></member>
+            <member><type>VkExtent2D</type>                       <name>minDstExtent</name></member>
+            <member><type>VkExtent2D</type>                       <name>maxDstExtent</name></member>
+        </type>
+        <type category="struct" name="VkDisplaySurfaceCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkDisplaySurfaceCreateFlagsKHR</type>   <name>flags</name></member>
+            <member><type>VkDisplayModeKHR</type>                 <name>displayMode</name><comment>The mode to use when displaying this surface</comment></member>
+            <member><type>uint32_t</type>                         <name>planeIndex</name><comment>The plane on which this surface appears.  Must be between 0 and the value returned by vkGetPhysicalDeviceDisplayPlanePropertiesKHR() in pPropertyCount.</comment></member>
+            <member><type>uint32_t</type>                         <name>planeStackIndex</name><comment>The z-order of the plane.</comment></member>
+            <member><type>VkSurfaceTransformFlagBitsKHR</type>    <name>transform</name><comment>Transform to apply to the images as part of the scanout operation</comment></member>
+            <member><type>float</type>                            <name>globalAlpha</name><comment>Global alpha value.  Must be between 0 and 1, inclusive.  Ignored if alphaMode is not VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR</comment></member>
+            <member><type>VkDisplayPlaneAlphaFlagBitsKHR</type>   <name>alphaMode</name><comment>What type of alpha blending to use.  Must be a bit from vkGetDisplayPlanePropertiesKHR::supportedAlpha.</comment></member>
+            <member><type>VkExtent2D</type>                       <name>imageExtent</name><comment>size of the images to use with this surface</comment></member>
+        </type>
+        <type category="struct" name="VkDisplayPresentInfoKHR" structextends="VkPresentInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkRect2D</type>                         <name>srcRect</name><comment>Rectangle within the presentable image to read pixel data from when presenting to the display.</comment></member>
+            <member><type>VkRect2D</type>                         <name>dstRect</name><comment>Rectangle within the current display mode's visible region to display srcRectangle in.</comment></member>
+            <member><type>VkBool32</type>                         <name>persistent</name><comment>For smart displays, use buffered mode.  If the display properties member "persistentMode" is VK_FALSE, this member must always be VK_FALSE.</comment></member>
+        </type>
+        <type category="struct" name="VkSurfaceCapabilitiesKHR" returnedonly="true">
+            <member><type>uint32_t</type>                         <name>minImageCount</name><comment>Supported minimum number of images for the surface</comment></member>
+            <member><type>uint32_t</type>                         <name>maxImageCount</name><comment>Supported maximum number of images for the surface, 0 for unlimited</comment></member>
+            <member><type>VkExtent2D</type>                       <name>currentExtent</name><comment>Current image width and height for the surface, (0, 0) if undefined</comment></member>
+            <member><type>VkExtent2D</type>                       <name>minImageExtent</name><comment>Supported minimum image width and height for the surface</comment></member>
+            <member><type>VkExtent2D</type>                       <name>maxImageExtent</name><comment>Supported maximum image width and height for the surface</comment></member>
+            <member><type>uint32_t</type>                         <name>maxImageArrayLayers</name><comment>Supported maximum number of image layers for the surface</comment></member>
+            <member><type>VkSurfaceTransformFlagsKHR</type>       <name>supportedTransforms</name><comment>1 or more bits representing the transforms supported</comment></member>
+            <member><type>VkSurfaceTransformFlagBitsKHR</type>    <name>currentTransform</name><comment>The surface's current transform relative to the device's natural orientation</comment></member>
+            <member><type>VkCompositeAlphaFlagsKHR</type>         <name>supportedCompositeAlpha</name><comment>1 or more bits representing the alpha compositing modes supported</comment></member>
+            <member><type>VkImageUsageFlags</type>                <name>supportedUsageFlags</name><comment>Supported image usage flags for the surface</comment></member>
+        </type>
+        <type category="struct" name="VkAndroidSurfaceCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                    <name>pNext</name></member>
+            <member optional="true"><type>VkAndroidSurfaceCreateFlagsKHR</type> <name>flags</name></member>
+            <member noautovalidity="true">struct <type>ANativeWindow</type>*    <name>window</name></member>
+        </type>
+        <type category="struct" name="VkViSurfaceCreateInfoNN">
+            <member values="VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkViSurfaceCreateFlagsNN</type>   <name>flags</name></member>
+            <member noautovalidity="true"><type>void</type>*                            <name>window</name></member>
+        </type>
+        <type category="struct" name="VkWaylandSurfaceCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkWaylandSurfaceCreateFlagsKHR</type>   <name>flags</name></member>
+            <member noautovalidity="true">struct <type>wl_display</type>*               <name>display</name></member>
+            <member noautovalidity="true">struct <type>wl_surface</type>*               <name>surface</name></member>
+        </type>
+        <type category="struct" name="VkWin32SurfaceCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkWin32SurfaceCreateFlagsKHR</type>   <name>flags</name></member>
+            <member><type>HINSTANCE</type>                        <name>hinstance</name></member>
+            <member><type>HWND</type>                             <name>hwnd</name></member>
+        </type>
+        <type category="struct" name="VkXlibSurfaceCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkXlibSurfaceCreateFlagsKHR</type>   <name>flags</name></member>
+            <member noautovalidity="true"><type>Display</type>*                         <name>dpy</name></member>
+            <member><type>Window</type>                           <name>window</name></member>
+        </type>
+        <type category="struct" name="VkXcbSurfaceCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkXcbSurfaceCreateFlagsKHR</type>   <name>flags</name></member>
+            <member noautovalidity="true"><type>xcb_connection_t</type>*                <name>connection</name></member>
+            <member><type>xcb_window_t</type>                     <name>window</name></member>
+        </type>
+        <type category="struct" name="VkDirectFBSurfaceCreateInfoEXT">
+            <member values="VK_STRUCTURE_TYPE_DIRECTFB_SURFACE_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkDirectFBSurfaceCreateFlagsEXT</type>   <name>flags</name></member>
+            <member noautovalidity="true"><type>IDirectFB</type>*                       <name>dfb</name></member>
+            <member noautovalidity="true"><type>IDirectFBSurface</type>*                <name>surface</name></member>
+        </type>
+        <type category="struct" name="VkImagePipeSurfaceCreateInfoFUCHSIA">
+            <member values="VK_STRUCTURE_TYPE_IMAGEPIPE_SURFACE_CREATE_INFO_FUCHSIA"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkImagePipeSurfaceCreateFlagsFUCHSIA</type>   <name>flags</name></member>
+            <member><type>zx_handle_t</type>                      <name>imagePipeHandle</name></member>
+        </type>
+        <type category="struct" name="VkStreamDescriptorSurfaceCreateInfoGGP">
+            <member values="VK_STRUCTURE_TYPE_STREAM_DESCRIPTOR_SURFACE_CREATE_INFO_GGP"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkStreamDescriptorSurfaceCreateFlagsGGP</type> <name>flags</name></member>
+            <member><type>GgpStreamDescriptor</type>              <name>streamDescriptor</name></member>
+        </type>
+        <type category="struct" name="VkScreenSurfaceCreateInfoQNX">
+            <member values="VK_STRUCTURE_TYPE_SCREEN_SURFACE_CREATE_INFO_QNX"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkScreenSurfaceCreateFlagsQNX</type>    <name>flags</name></member>
+            <member noautovalidity="true">struct <type>_screen_context</type>*    <name>context</name></member>
+            <member noautovalidity="true">struct <type>_screen_window</type>*     <name>window</name></member>
+        </type>
+        <type category="struct" name="VkSurfaceFormatKHR" returnedonly="true">
+            <member><type>VkFormat</type>                         <name>format</name><comment>Supported pair of rendering format</comment></member>
+            <member><type>VkColorSpaceKHR</type>                  <name>colorSpace</name><comment>and color space for the surface</comment></member>
+        </type>
+        <type category="struct" name="VkSwapchainCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkSwapchainCreateFlagsKHR</type>        <name>flags</name></member>
+            <member><type>VkSurfaceKHR</type>                     <name>surface</name><comment>The swapchain's target surface</comment></member>
+            <member><type>uint32_t</type>                         <name>minImageCount</name><comment>Minimum number of presentation images the application needs</comment></member>
+            <member><type>VkFormat</type>                         <name>imageFormat</name><comment>Format of the presentation images</comment></member>
+            <member><type>VkColorSpaceKHR</type>                  <name>imageColorSpace</name><comment>Colorspace of the presentation images</comment></member>
+            <member><type>VkExtent2D</type>                       <name>imageExtent</name><comment>Dimensions of the presentation images</comment></member>
+            <member><type>uint32_t</type>                         <name>imageArrayLayers</name><comment>Determines the number of views for multiview/stereo presentation</comment></member>
+            <member><type>VkImageUsageFlags</type>                <name>imageUsage</name><comment>Bits indicating how the presentation images will be used</comment></member>
+            <member><type>VkSharingMode</type>                    <name>imageSharingMode</name><comment>Sharing mode used for the presentation images</comment></member>
+            <member optional="true"><type>uint32_t</type>         <name>queueFamilyIndexCount</name><comment>Number of queue families having access to the images in case of concurrent sharing mode</comment></member>
+            <member noautovalidity="true" len="queueFamilyIndexCount">const <type>uint32_t</type>*                  <name>pQueueFamilyIndices</name><comment>Array of queue family indices having access to the images in case of concurrent sharing mode</comment></member>
+            <member><type>VkSurfaceTransformFlagBitsKHR</type>    <name>preTransform</name><comment>The transform, relative to the device's natural orientation, applied to the image content prior to presentation</comment></member>
+            <member><type>VkCompositeAlphaFlagBitsKHR</type>      <name>compositeAlpha</name><comment>The alpha blending mode used when compositing this surface with other surfaces in the window system</comment></member>
+            <member><type>VkPresentModeKHR</type>                 <name>presentMode</name><comment>Which presentation mode to use for presents on this swap chain</comment></member>
+            <member><type>VkBool32</type>                         <name>clipped</name><comment>Specifies whether presentable images may be affected by window clip regions</comment></member>
+            <member optional="true"><type>VkSwapchainKHR</type>   <name>oldSwapchain</name><comment>Existing swap chain to replace, if any</comment></member>
+        </type>
+        <type category="struct" name="VkPresentInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_PRESENT_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*  <name>pNext</name></member>
+            <member optional="true"><type>uint32_t</type>         <name>waitSemaphoreCount</name><comment>Number of semaphores to wait for before presenting</comment></member>
+            <member len="waitSemaphoreCount">const <type>VkSemaphore</type>* <name>pWaitSemaphores</name><comment>Semaphores to wait for before presenting</comment></member>
+            <member><type>uint32_t</type>                         <name>swapchainCount</name><comment>Number of swapchains to present in this call</comment></member>
+            <member len="swapchainCount">const <type>VkSwapchainKHR</type>* <name>pSwapchains</name><comment>Swapchains to present an image from</comment></member>
+            <member len="swapchainCount">const <type>uint32_t</type>* <name>pImageIndices</name><comment>Indices of which presentable images to present</comment></member>
+            <member optional="true" len="swapchainCount"><type>VkResult</type>* <name>pResults</name><comment>Optional (i.e. if non-NULL) VkResult for each swapchain</comment></member>
+        </type>
+        <type category="struct" name="VkDebugReportCallbackCreateInfoEXT" structextends="VkInstanceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkDebugReportFlagsEXT</type>            <name>flags</name><comment>Indicates which events call this callback</comment></member>
+            <member><type>PFN_vkDebugReportCallbackEXT</type>     <name>pfnCallback</name><comment>Function pointer of a callback function</comment></member>
+            <member optional="true"><type>void</type>*            <name>pUserData</name><comment>User data provided to callback function</comment></member>
+        </type>
+        <type category="struct" name="VkValidationFlagsEXT" structextends="VkInstanceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT"><type>VkStructureType</type>                  <name>sType</name><comment>Must be VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT</comment></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>uint32_t</type>                         <name>disabledValidationCheckCount</name><comment>Number of validation checks to disable</comment></member>
+            <member len="disabledValidationCheckCount">const <type>VkValidationCheckEXT</type>* <name>pDisabledValidationChecks</name><comment>Validation checks to disable</comment></member>
+        </type>
+        <type category="struct" name="VkValidationFeaturesEXT" structextends="VkInstanceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT"><type>VkStructureType</type>  <name>sType</name><comment>Must be VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT</comment></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>uint32_t</type>                         <name>enabledValidationFeatureCount</name><comment>Number of validation features to enable</comment></member>
+            <member len="enabledValidationFeatureCount">const <type>VkValidationFeatureEnableEXT</type>* <name>pEnabledValidationFeatures</name><comment>Validation features to enable</comment></member>
+            <member optional="true"><type>uint32_t</type>                         <name>disabledValidationFeatureCount</name><comment>Number of validation features to disable</comment></member>
+            <member len="disabledValidationFeatureCount">const <type>VkValidationFeatureDisableEXT</type>* <name>pDisabledValidationFeatures</name><comment>Validation features to disable</comment></member>
+        </type>
+        <type category="struct" name="VkPipelineRasterizationStateRasterizationOrderAMD" structextends="VkPipelineRasterizationStateCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkRasterizationOrderAMD</type>          <name>rasterizationOrder</name><comment>Rasterization order to use for the pipeline</comment></member>
+        </type>
+        <type category="struct" name="VkDebugMarkerObjectNameInfoEXT">
+            <member values="VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkDebugReportObjectTypeEXT</type>       <name>objectType</name><comment>The type of the object</comment></member>
+            <member objecttype="objectType"><type>uint64_t</type>                         <name>object</name><comment>The handle of the object, cast to uint64_t</comment></member>
+            <member len="null-terminated">const <type>char</type>* <name>pObjectName</name><comment>Name to apply to the object</comment></member>
+        </type>
+        <type category="struct" name="VkDebugMarkerObjectTagInfoEXT">
+            <member values="VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkDebugReportObjectTypeEXT</type>       <name>objectType</name><comment>The type of the object</comment></member>
+            <member  objecttype="objectType"><type>uint64_t</type>                         <name>object</name><comment>The handle of the object, cast to uint64_t</comment></member>
+            <member><type>uint64_t</type>                         <name>tagName</name><comment>The name of the tag to set on the object</comment></member>
+            <member><type>size_t</type>                           <name>tagSize</name><comment>The length in bytes of the tag data</comment></member>
+            <member len="tagSize">const <type>void</type>*        <name>pTag</name><comment>Tag data to attach to the object</comment></member>
+        </type>
+        <type category="struct" name="VkDebugMarkerMarkerInfoEXT">
+            <member values="VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member len="null-terminated">const <type>char</type>* <name>pMarkerName</name><comment>Name of the debug marker</comment></member>
+            <member><type>float</type>            <name>color</name>[4]<comment>Optional color for debug marker</comment></member>
+        </type>
+        <type category="struct" name="VkDedicatedAllocationImageCreateInfoNV" structextends="VkImageCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>dedicatedAllocation</name><comment>Whether this image uses a dedicated allocation</comment></member>
+        </type>
+        <type category="struct" name="VkDedicatedAllocationBufferCreateInfoNV" structextends="VkBufferCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>dedicatedAllocation</name><comment>Whether this buffer uses a dedicated allocation</comment></member>
+        </type>
+        <type category="struct" name="VkDedicatedAllocationMemoryAllocateInfoNV" structextends="VkMemoryAllocateInfo">
+            <member values="VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkImage</type>          <name>image</name><comment>Image that this allocation will be bound to</comment></member>
+            <member optional="true"><type>VkBuffer</type>         <name>buffer</name><comment>Buffer that this allocation will be bound to</comment></member>
+        </type>
+        <type category="struct" name="VkExternalImageFormatPropertiesNV" returnedonly="true">
+            <member><type>VkImageFormatProperties</type>          <name>imageFormatProperties</name></member>
+            <member optional="true"><type>VkExternalMemoryFeatureFlagsNV</type>   <name>externalMemoryFeatures</name></member>
+            <member optional="true"><type>VkExternalMemoryHandleTypeFlagsNV</type> <name>exportFromImportedHandleTypes</name></member>
+            <member optional="true"><type>VkExternalMemoryHandleTypeFlagsNV</type> <name>compatibleHandleTypes</name></member>
+        </type>
+        <type category="struct" name="VkExternalMemoryImageCreateInfoNV" structextends="VkImageCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkExternalMemoryHandleTypeFlagsNV</type> <name>handleTypes</name></member>
+        </type>
+        <type category="struct" name="VkExportMemoryAllocateInfoNV" structextends="VkMemoryAllocateInfo">
+            <member values="VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkExternalMemoryHandleTypeFlagsNV</type> <name>handleTypes</name></member>
+        </type>
+        <type category="struct" name="VkImportMemoryWin32HandleInfoNV" structextends="VkMemoryAllocateInfo">
+            <member values="VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkExternalMemoryHandleTypeFlagsNV</type> <name>handleType</name></member>
+            <member optional="true"><type>HANDLE</type>                           <name>handle</name></member>
+        </type>
+        <type category="struct" name="VkExportMemoryWin32HandleInfoNV" structextends="VkMemoryAllocateInfo">
+            <member values="VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true">const <type>SECURITY_ATTRIBUTES</type>*       <name>pAttributes</name></member>
+            <member optional="true"><type>DWORD</type>                            <name>dwAccess</name></member>
+        </type>
+        <type category="struct" name="VkWin32KeyedMutexAcquireReleaseInfoNV" structextends="VkSubmitInfo,VkSubmitInfo2KHR">
+            <member values="VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>uint32_t</type>                         <name>acquireCount</name></member>
+            <member len="acquireCount" devicememoryhandle="1">const <type>VkDeviceMemory</type>*            <name>pAcquireSyncs</name></member>
+            <member len="acquireCount">const <type>uint64_t</type>*                  <name>pAcquireKeys</name></member>
+            <member len="acquireCount">const <type>uint32_t</type>*                  <name>pAcquireTimeoutMilliseconds</name></member>
+            <member optional="true"><type>uint32_t</type>                         <name>releaseCount</name></member>
+            <member len="releaseCount" devicememoryhandle="1">const <type>VkDeviceMemory</type>*            <name>pReleaseSyncs</name></member>
+            <member len="releaseCount">const <type>uint64_t</type>*                  <name>pReleaseKeys</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true"><type>void</type>*    <name>pNext</name></member>
+            <member><type>VkBool32</type>                       <name>deviceGeneratedCommands</name></member>
+        </type>
+        <type category="struct" name="VkDevicePrivateDataCreateInfoEXT" allowduplicate="true" structextends="VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                            <name>pNext</name></member>
+            <member><type>uint32_t</type>                               <name>privateDataSlotRequestCount</name></member>
+        </type>
+        <type category="struct" name="VkPrivateDataSlotCreateInfoEXT">
+            <member values="VK_STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkPrivateDataSlotCreateFlagsEXT</type>        <name>flags</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDevicePrivateDataFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                                  <name>pNext</name></member>
+            <member><type>VkBool32</type>                               <name>privateData</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV" structextends="VkPhysicalDeviceProperties2" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*    <name>pNext</name></member>
+            <member limittype="max"><type>uint32_t</type>         <name>maxGraphicsShaderGroupCount</name></member>
+            <member limittype="max"><type>uint32_t</type>         <name>maxIndirectSequenceCount</name></member>
+            <member limittype="max"><type>uint32_t</type>         <name>maxIndirectCommandsTokenCount</name></member>
+            <member limittype="max"><type>uint32_t</type>         <name>maxIndirectCommandsStreamCount</name></member>
+            <member limittype="max"><type>uint32_t</type>         <name>maxIndirectCommandsTokenOffset</name></member>
+            <member limittype="max"><type>uint32_t</type>         <name>maxIndirectCommandsStreamStride</name></member>
+            <member limittype="noauto"><type>uint32_t</type>         <name>minSequencesCountBufferOffsetAlignment</name></member>
+            <member limittype="noauto"><type>uint32_t</type>         <name>minSequencesIndexBufferOffsetAlignment</name></member>
+            <member limittype="noauto"><type>uint32_t</type>         <name>minIndirectCommandsBufferOffsetAlignment</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceMultiDrawPropertiesEXT" structextends="VkPhysicalDeviceProperties2" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*    <name>pNext</name></member>
+            <member limittype="max"><type>uint32_t</type>         <name>maxMultiDrawCount</name></member>
+        </type>
+        <type category="struct" name="VkGraphicsShaderGroupCreateInfoNV">
+            <member values="VK_STRUCTURE_TYPE_GRAPHICS_SHADER_GROUP_CREATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                <name>pNext</name></member>
+            <member><type>uint32_t</type>                                                   <name>stageCount</name></member>
+            <member len="stageCount">const <type>VkPipelineShaderStageCreateInfo</type>*    <name>pStages</name></member>
+            <member noautovalidity="true" optional="true">const <type>VkPipelineVertexInputStateCreateInfo</type>*                <name>pVertexInputState</name></member>
+            <member noautovalidity="true" optional="true">const <type>VkPipelineTessellationStateCreateInfo</type>*               <name>pTessellationState</name></member>
+        </type>
+        <type category="struct" name="VkGraphicsPipelineShaderGroupsCreateInfoNV" structextends="VkGraphicsPipelineCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                <name>pNext</name></member>
+            <member><type>uint32_t</type>                                                   <name>groupCount</name></member>
+            <member len="groupCount">const <type>VkGraphicsShaderGroupCreateInfoNV</type>*  <name>pGroups</name></member>
+            <member optional="true"><type>uint32_t</type>                                   <name>pipelineCount</name></member>
+            <member len="pipelineCount">const <type>VkPipeline</type>*                      <name>pPipelines</name></member>
+        </type>
+        <type category="struct" name="VkBindShaderGroupIndirectCommandNV">
+            <member><type>uint32_t</type>         <name>groupIndex</name></member>
+        </type>
+        <type category="struct" name="VkBindIndexBufferIndirectCommandNV">
+            <member><type>VkDeviceAddress</type>  <name>bufferAddress</name></member>
+            <member><type>uint32_t</type>         <name>size</name></member>
+            <member><type>VkIndexType</type>      <name>indexType</name></member>
+        </type>
+        <type category="struct" name="VkBindVertexBufferIndirectCommandNV">
+            <member><type>VkDeviceAddress</type>  <name>bufferAddress</name></member>
+            <member><type>uint32_t</type>         <name>size</name></member>
+            <member><type>uint32_t</type>         <name>stride</name></member>
+        </type>
+        <type category="struct" name="VkSetStateFlagsIndirectCommandNV">
+            <member><type>uint32_t</type>          <name>data</name></member>
+        </type>
+        <type category="struct" name="VkIndirectCommandsStreamNV">
+            <member><type>VkBuffer</type>      <name>buffer</name></member>
+            <member><type>VkDeviceSize</type>  <name>offset</name></member>
+        </type>
+        <type category="struct" name="VkIndirectCommandsLayoutTokenNV">
+            <member values="VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_TOKEN_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                    <name>pNext</name></member>
+            <member><type>VkIndirectCommandsTokenTypeNV</type>  <name>tokenType</name></member>
+            <member><type>uint32_t</type>                       <name>stream</name></member>
+            <member><type>uint32_t</type>                       <name>offset</name></member>
+            <member><type>uint32_t</type>                                <name>vertexBindingUnit</name></member>
+            <member><type>VkBool32</type>                                <name>vertexDynamicStride</name></member>
+            <member optional="true"><type>VkPipelineLayout</type>        <name>pushconstantPipelineLayout</name></member>
+            <member optional="true"><type>VkShaderStageFlags</type>      <name>pushconstantShaderStageFlags</name></member>
+            <member><type>uint32_t</type>                                <name>pushconstantOffset</name></member>
+            <member><type>uint32_t</type>                                <name>pushconstantSize</name></member>
+            <member optional="true"><type>VkIndirectStateFlagsNV</type>  <name>indirectStateFlags</name></member>
+            <member optional="true"><type>uint32_t</type>                <name>indexTypeCount</name></member>
+            <member len="indexTypeCount">const <type>VkIndexType</type>* <name>pIndexTypes</name></member>
+            <member len="indexTypeCount">const <type>uint32_t</type>*    <name>pIndexTypeValues</name></member>
+        </type>
+        <type category="struct" name="VkIndirectCommandsLayoutCreateInfoNV">
+            <member values="VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                             <name>pNext</name></member>
+            <member optional="true"><type>VkIndirectCommandsLayoutUsageFlagsNV</type>    <name>flags</name></member>
+            <member><type>VkPipelineBindPoint</type>                     <name>pipelineBindPoint</name></member>
+            <member><type>uint32_t</type>                                <name>tokenCount</name></member>
+            <member len="tokenCount">const <type>VkIndirectCommandsLayoutTokenNV</type>*  <name>pTokens</name></member>
+            <member><type>uint32_t</type>                                <name>streamCount</name></member>
+            <member len="streamCount">const <type>uint32_t</type>*       <name>pStreamStrides</name></member>
+        </type>
+        <type category="struct" name="VkGeneratedCommandsInfoNV">
+            <member values="VK_STRUCTURE_TYPE_GENERATED_COMMANDS_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                        <name>pNext</name></member>
+            <member><type>VkPipelineBindPoint</type>                <name>pipelineBindPoint</name></member>
+            <member><type>VkPipeline</type>                         <name>pipeline</name></member>
+            <member><type>VkIndirectCommandsLayoutNV</type>         <name>indirectCommandsLayout</name></member>
+            <member><type>uint32_t</type>                           <name>streamCount</name></member>
+            <member len="streamCount">const <type>VkIndirectCommandsStreamNV</type>*  <name>pStreams</name></member>
+            <member><type>uint32_t</type>                           <name>sequencesCount</name></member>
+            <member><type>VkBuffer</type>                           <name>preprocessBuffer</name></member>
+            <member><type>VkDeviceSize</type>                       <name>preprocessOffset</name></member>
+            <member><type>VkDeviceSize</type>                       <name>preprocessSize</name></member>
+            <member optional="true"><type>VkBuffer</type>           <name>sequencesCountBuffer</name></member>
+            <member><type>VkDeviceSize</type>                       <name>sequencesCountOffset</name></member>
+            <member optional="true"><type>VkBuffer</type>           <name>sequencesIndexBuffer</name></member>
+            <member><type>VkDeviceSize</type>                       <name>sequencesIndexOffset</name></member>
+        </type>
+        <type category="struct" name="VkGeneratedCommandsMemoryRequirementsInfoNV">
+            <member values="VK_STRUCTURE_TYPE_GENERATED_COMMANDS_MEMORY_REQUIREMENTS_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                 <name>pNext</name></member>
+            <member><type>VkPipelineBindPoint</type>         <name>pipelineBindPoint</name></member>
+            <member><type>VkPipeline</type>                  <name>pipeline</name></member>
+            <member><type>VkIndirectCommandsLayoutNV</type>  <name>indirectCommandsLayout</name></member>
+            <member><type>uint32_t</type>                    <name>maxSequencesCount</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceFeatures2" structextends="VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkPhysicalDeviceFeatures</type>         <name>features</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceFeatures2KHR"                            alias="VkPhysicalDeviceFeatures2"/>
+        <type category="struct" name="VkPhysicalDeviceProperties2" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member limittype="struct"><type>VkPhysicalDeviceProperties</type>       <name>properties</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceProperties2KHR"                          alias="VkPhysicalDeviceProperties2"/>
+        <type category="struct" name="VkFormatProperties2" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkFormatProperties</type>               <name>formatProperties</name></member>
+        </type>
+        <type category="struct" name="VkFormatProperties2KHR"                                  alias="VkFormatProperties2"/>
+        <type category="struct" name="VkImageFormatProperties2" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>* <name>pNext</name></member>
+            <member><type>VkImageFormatProperties</type>          <name>imageFormatProperties</name></member>
+        </type>
+        <type category="struct" name="VkImageFormatProperties2KHR"                             alias="VkImageFormatProperties2"/>
+        <type category="struct" name="VkPhysicalDeviceImageFormatInfo2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>* <name>pNext</name></member>
+            <member><type>VkFormat</type>                         <name>format</name></member>
+            <member><type>VkImageType</type>                      <name>type</name></member>
+            <member><type>VkImageTiling</type>                    <name>tiling</name></member>
+            <member><type>VkImageUsageFlags</type>                <name>usage</name></member>
+            <member optional="true"><type>VkImageCreateFlags</type> <name>flags</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceImageFormatInfo2KHR"                     alias="VkPhysicalDeviceImageFormatInfo2"/>
+        <type category="struct" name="VkQueueFamilyProperties2" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkQueueFamilyProperties</type>          <name>queueFamilyProperties</name></member>
+        </type>
+        <type category="struct" name="VkQueueFamilyProperties2KHR"                             alias="VkQueueFamilyProperties2"/>
+        <type category="struct" name="VkPhysicalDeviceMemoryProperties2" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkPhysicalDeviceMemoryProperties</type> <name>memoryProperties</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceMemoryProperties2KHR"                    alias="VkPhysicalDeviceMemoryProperties2"/>
+        <type category="struct" name="VkSparseImageFormatProperties2" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkSparseImageFormatProperties</type>    <name>properties</name></member>
+        </type>
+        <type category="struct" name="VkSparseImageFormatProperties2KHR"                       alias="VkSparseImageFormatProperties2"/>
+        <type category="struct" name="VkPhysicalDeviceSparseImageFormatInfo2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkFormat</type>                         <name>format</name></member>
+            <member><type>VkImageType</type>                      <name>type</name></member>
+            <member><type>VkSampleCountFlagBits</type>            <name>samples</name></member>
+            <member><type>VkImageUsageFlags</type>                <name>usage</name></member>
+            <member><type>VkImageTiling</type>                    <name>tiling</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceSparseImageFormatInfo2KHR"               alias="VkPhysicalDeviceSparseImageFormatInfo2"/>
+        <type category="struct" name="VkPhysicalDevicePushDescriptorPropertiesKHR" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxPushDescriptors</name></member>
+        </type>
+        <type category="struct" name="VkConformanceVersion">
+            <member><type>uint8_t</type>                          <name>major</name></member>
+            <member><type>uint8_t</type>                          <name>minor</name></member>
+            <member><type>uint8_t</type>                          <name>subminor</name></member>
+            <member><type>uint8_t</type>                          <name>patch</name></member>
+        </type>
+        <type category="struct" name="VkConformanceVersionKHR"                                 alias="VkConformanceVersion"/>
+        <type category="struct" name="VkPhysicalDeviceDriverProperties" structextends="VkPhysicalDeviceProperties2" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member limittype="noauto"><type>VkDriverId</type>                       <name>driverID</name></member>
+            <member limittype="noauto"><type>char</type>                             <name>driverName</name>[<enum>VK_MAX_DRIVER_NAME_SIZE</enum>]</member>
+            <member limittype="noauto"><type>char</type>                             <name>driverInfo</name>[<enum>VK_MAX_DRIVER_INFO_SIZE</enum>]</member>
+            <member limittype="noauto"><type>VkConformanceVersion</type>             <name>conformanceVersion</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceDriverPropertiesKHR"                     alias="VkPhysicalDeviceDriverProperties"/>
+        <type category="struct" name="VkPresentRegionsKHR" structextends="VkPresentInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>uint32_t</type>                         <name>swapchainCount</name><comment>Copy of VkPresentInfoKHR::swapchainCount</comment></member>
+            <member len="swapchainCount" optional="true">const <type>VkPresentRegionKHR</type>*   <name>pRegions</name><comment>The regions that have changed</comment></member>
+        </type>
+        <type category="struct" name="VkPresentRegionKHR">
+            <member optional="true"><type>uint32_t</type>         <name>rectangleCount</name><comment>Number of rectangles in pRectangles</comment></member>
+            <member optional="true" len="rectangleCount">const <type>VkRectLayerKHR</type>*   <name>pRectangles</name><comment>Array of rectangles that have changed in a swapchain's image(s)</comment></member>
+        </type>
+        <type category="struct" name="VkRectLayerKHR">
+            <member><type>VkOffset2D</type>                       <name>offset</name><comment>upper-left corner of a rectangle that has not changed, in pixels of a presentation images</comment></member>
+            <member noautovalidity="true"><type>VkExtent2D</type> <name>extent</name><comment>Dimensions of a rectangle that has not changed, in pixels of a presentation images</comment></member>
+            <member><type>uint32_t</type>                         <name>layer</name><comment>Layer of a swapchain's image(s), for stereoscopic-3D images</comment></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceVariablePointersFeatures" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>variablePointersStorageBuffer</name></member>
+            <member><type>VkBool32</type>                         <name>variablePointers</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceVariablePointersFeaturesKHR"             alias="VkPhysicalDeviceVariablePointersFeatures"/>
+        <type category="struct" name="VkPhysicalDeviceVariablePointerFeaturesKHR"              alias="VkPhysicalDeviceVariablePointersFeatures"/>
+        <type category="struct" name="VkPhysicalDeviceVariablePointerFeatures"                 alias="VkPhysicalDeviceVariablePointersFeatures"/>
+        <type category="struct" name="VkExternalMemoryProperties" returnedonly="true">
+            <member><type>VkExternalMemoryFeatureFlags</type>  <name>externalMemoryFeatures</name></member>
+            <member optional="true"><type>VkExternalMemoryHandleTypeFlags</type> <name>exportFromImportedHandleTypes</name></member>
+            <member><type>VkExternalMemoryHandleTypeFlags</type> <name>compatibleHandleTypes</name></member>
+        </type>
+        <type category="struct" name="VkExternalMemoryPropertiesKHR"                           alias="VkExternalMemoryProperties"/>
+        <type category="struct" name="VkPhysicalDeviceExternalImageFormatInfo"  structextends="VkPhysicalDeviceImageFormatInfo2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkExternalMemoryHandleTypeFlagBits</type> <name>handleType</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceExternalImageFormatInfoKHR"              alias="VkPhysicalDeviceExternalImageFormatInfo"/>
+        <type category="struct" name="VkExternalImageFormatProperties" returnedonly="true" structextends="VkImageFormatProperties2">
+            <member values="VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkExternalMemoryProperties</type> <name>externalMemoryProperties</name></member>
+        </type>
+        <type category="struct" name="VkExternalImageFormatPropertiesKHR"                      alias="VkExternalImageFormatProperties"/>
+        <type category="struct" name="VkPhysicalDeviceExternalBufferInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkBufferCreateFlags</type> <name>flags</name></member>
+            <member><type>VkBufferUsageFlags</type>               <name>usage</name></member>
+            <member><type>VkExternalMemoryHandleTypeFlagBits</type> <name>handleType</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceExternalBufferInfoKHR"                   alias="VkPhysicalDeviceExternalBufferInfo"/>
+        <type category="struct" name="VkExternalBufferProperties" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkExternalMemoryProperties</type>    <name>externalMemoryProperties</name></member>
+        </type>
+        <type category="struct" name="VkExternalBufferPropertiesKHR"                           alias="VkExternalBufferProperties"/>
+        <type category="struct" name="VkPhysicalDeviceIDProperties" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member limittype="noauto"><type>uint8_t</type>                          <name>deviceUUID</name>[<enum>VK_UUID_SIZE</enum>]</member>
+            <member limittype="noauto"><type>uint8_t</type>                          <name>driverUUID</name>[<enum>VK_UUID_SIZE</enum>]</member>
+            <member limittype="noauto"><type>uint8_t</type>                          <name>deviceLUID</name>[<enum>VK_LUID_SIZE</enum>]</member>
+            <member limittype="noauto"><type>uint32_t</type>                         <name>deviceNodeMask</name></member>
+            <member limittype="noauto"><type>VkBool32</type>                         <name>deviceLUIDValid</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceIDPropertiesKHR"                         alias="VkPhysicalDeviceIDProperties"/>
+        <type category="struct" name="VkExternalMemoryImageCreateInfo" structextends="VkImageCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkExternalMemoryHandleTypeFlags</type> <name>handleTypes</name></member>
+        </type>
+        <type category="struct" name="VkExternalMemoryImageCreateInfoKHR"                      alias="VkExternalMemoryImageCreateInfo"/>
+        <type category="struct" name="VkExternalMemoryBufferCreateInfo" structextends="VkBufferCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkExternalMemoryHandleTypeFlags</type> <name>handleTypes</name></member>
+        </type>
+        <type category="struct" name="VkExternalMemoryBufferCreateInfoKHR"                     alias="VkExternalMemoryBufferCreateInfo"/>
+        <type category="struct" name="VkExportMemoryAllocateInfo" structextends="VkMemoryAllocateInfo">
+            <member values="VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkExternalMemoryHandleTypeFlags</type> <name>handleTypes</name></member>
+        </type>
+        <type category="struct" name="VkExportMemoryAllocateInfoKHR"                           alias="VkExportMemoryAllocateInfo"/>
+        <type category="struct" name="VkImportMemoryWin32HandleInfoKHR" structextends="VkMemoryAllocateInfo">
+            <member values="VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkExternalMemoryHandleTypeFlagBits</type> <name>handleType</name></member>
+            <member optional="true"><type>HANDLE</type>           <name>handle</name></member>
+            <member optional="true"><type>LPCWSTR</type>          <name>name</name></member>
+        </type>
+        <type category="struct" name="VkExportMemoryWin32HandleInfoKHR" structextends="VkMemoryAllocateInfo">
+            <member values="VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true">const <type>SECURITY_ATTRIBUTES</type>* <name>pAttributes</name></member>
+            <member><type>DWORD</type>                            <name>dwAccess</name></member>
+            <member><type>LPCWSTR</type>                          <name>name</name></member>
+        </type>
+        <type category="struct" name="VkImportMemoryZirconHandleInfoFUCHSIA" structextends="VkMemoryAllocateInfo">
+            <member values="VK_STRUCTURE_TYPE_IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkExternalMemoryHandleTypeFlagBits</type> <name>handleType</name></member>
+            <member optional="true"><type>zx_handle_t</type>           <name>handle</name></member>
+        </type>
+        <type category="struct" name="VkMemoryZirconHandlePropertiesFUCHSIA" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_MEMORY_ZIRCON_HANDLE_PROPERTIES_FUCHSIA"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>uint32_t</type>                         <name>memoryTypeBits</name></member>
+        </type>
+        <type category="struct" name="VkMemoryGetZirconHandleInfoFUCHSIA">
+            <member values="VK_STRUCTURE_TYPE_MEMORY_GET_ZIRCON_HANDLE_INFO_FUCHSIA"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkDeviceMemory</type>                   <name>memory</name></member>
+            <member><type>VkExternalMemoryHandleTypeFlagBits</type> <name>handleType</name></member>
+        </type>
+        <type category="struct" name="VkMemoryWin32HandlePropertiesKHR" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member devicememorytypebits="1"><type>uint32_t</type>                         <name>memoryTypeBits</name></member>
+        </type>
+        <type category="struct" name="VkMemoryGetWin32HandleInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member devicememoryhandle="1"><type>VkDeviceMemory</type>                   <name>memory</name></member>
+            <member><type>VkExternalMemoryHandleTypeFlagBits</type> <name>handleType</name></member>
+        </type>
+        <type category="struct" name="VkImportMemoryFdInfoKHR" structextends="VkMemoryAllocateInfo">
+            <member values="VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkExternalMemoryHandleTypeFlagBits</type> <name>handleType</name></member>
+            <member><type>int</type>                              <name>fd</name></member>
+        </type>
+        <type category="struct" name="VkMemoryFdPropertiesKHR" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member devicememorytypebits="1"><type>uint32_t</type>                         <name>memoryTypeBits</name></member>
+        </type>
+        <type category="struct" name="VkMemoryGetFdInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member devicememoryhandle="1"><type>VkDeviceMemory</type>                   <name>memory</name></member>
+            <member><type>VkExternalMemoryHandleTypeFlagBits</type> <name>handleType</name></member>
+        </type>
+        <type category="struct" name="VkWin32KeyedMutexAcquireReleaseInfoKHR" structextends="VkSubmitInfo,VkSubmitInfo2KHR">
+            <member values="VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>uint32_t</type>         <name>acquireCount</name></member>
+            <member len="acquireCount" devicememoryhandle="1">const <type>VkDeviceMemory</type>* <name>pAcquireSyncs</name></member>
+            <member len="acquireCount">const <type>uint64_t</type>* <name>pAcquireKeys</name></member>
+            <member len="acquireCount">const <type>uint32_t</type>* <name>pAcquireTimeouts</name></member>
+            <member optional="true"><type>uint32_t</type>         <name>releaseCount</name></member>
+            <member len="releaseCount" devicememoryhandle="1">const <type>VkDeviceMemory</type>* <name>pReleaseSyncs</name></member>
+            <member len="releaseCount">const <type>uint64_t</type>* <name>pReleaseKeys</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceExternalSemaphoreInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkExternalSemaphoreHandleTypeFlagBits</type> <name>handleType</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceExternalSemaphoreInfoKHR"                alias="VkPhysicalDeviceExternalSemaphoreInfo"/>
+        <type category="struct" name="VkExternalSemaphoreProperties" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkExternalSemaphoreHandleTypeFlags</type> <name>exportFromImportedHandleTypes</name></member>
+            <member><type>VkExternalSemaphoreHandleTypeFlags</type> <name>compatibleHandleTypes</name></member>
+            <member optional="true"><type>VkExternalSemaphoreFeatureFlags</type> <name>externalSemaphoreFeatures</name></member>
+        </type>
+        <type category="struct" name="VkExternalSemaphorePropertiesKHR"                        alias="VkExternalSemaphoreProperties"/>
+        <type category="struct" name="VkExportSemaphoreCreateInfo" structextends="VkSemaphoreCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkExternalSemaphoreHandleTypeFlags</type> <name>handleTypes</name></member>
+        </type>
+        <type category="struct" name="VkExportSemaphoreCreateInfoKHR"                          alias="VkExportSemaphoreCreateInfo"/>
+        <type category="struct" name="VkImportSemaphoreWin32HandleInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member externsync="true"><type>VkSemaphore</type>    <name>semaphore</name></member>
+            <member optional="true"><type>VkSemaphoreImportFlags</type> <name>flags</name></member>
+            <member noautovalidity="true"><type>VkExternalSemaphoreHandleTypeFlagBits</type> <name>handleType</name></member>
+            <member optional="true"><type>HANDLE</type>           <name>handle</name></member>
+            <member optional="true"><type>LPCWSTR</type>          <name>name</name></member>
+        </type>
+        <type category="struct" name="VkExportSemaphoreWin32HandleInfoKHR" structextends="VkSemaphoreCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true">const <type>SECURITY_ATTRIBUTES</type>*       <name>pAttributes</name></member>
+            <member><type>DWORD</type>                            <name>dwAccess</name></member>
+            <member><type>LPCWSTR</type>                          <name>name</name></member>
+        </type>
+        <type category="struct" name="VkD3D12FenceSubmitInfoKHR" structextends="VkSubmitInfo">
+            <member values="VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>uint32_t</type>         <name>waitSemaphoreValuesCount</name></member>
+            <member optional="true" len="waitSemaphoreValuesCount">const <type>uint64_t</type>* <name>pWaitSemaphoreValues</name></member>
+            <member optional="true"><type>uint32_t</type>         <name>signalSemaphoreValuesCount</name></member>
+            <member optional="true" len="signalSemaphoreValuesCount">const <type>uint64_t</type>* <name>pSignalSemaphoreValues</name></member>
+        </type>
+        <type category="struct" name="VkSemaphoreGetWin32HandleInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkSemaphore</type>                      <name>semaphore</name></member>
+            <member><type>VkExternalSemaphoreHandleTypeFlagBits</type> <name>handleType</name></member>
+        </type>
+        <type category="struct" name="VkImportSemaphoreFdInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member externsync="true"><type>VkSemaphore</type>    <name>semaphore</name></member>
+            <member optional="true"><type>VkSemaphoreImportFlags</type> <name>flags</name></member>
+            <member><type>VkExternalSemaphoreHandleTypeFlagBits</type> <name>handleType</name></member>
+            <member><type>int</type>                              <name>fd</name></member>
+        </type>
+        <type category="struct" name="VkSemaphoreGetFdInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkSemaphore</type>                      <name>semaphore</name></member>
+            <member><type>VkExternalSemaphoreHandleTypeFlagBits</type> <name>handleType</name></member>
+        </type>
+        <type category="struct" name="VkImportSemaphoreZirconHandleInfoFUCHSIA">
+            <member values="VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_ZIRCON_HANDLE_INFO_FUCHSIA"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member externsync="true"><type>VkSemaphore</type>    <name>semaphore</name></member>
+            <member optional="true"><type>VkSemaphoreImportFlags</type> <name>flags</name></member>
+            <member><type>VkExternalSemaphoreHandleTypeFlagBits</type> <name>handleType</name></member>
+            <member><type>zx_handle_t</type>                              <name>zirconHandle</name></member>
+        </type>
+        <type category="struct" name="VkSemaphoreGetZirconHandleInfoFUCHSIA">
+            <member values="VK_STRUCTURE_TYPE_SEMAPHORE_GET_ZIRCON_HANDLE_INFO_FUCHSIA"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkSemaphore</type>                      <name>semaphore</name></member>
+            <member><type>VkExternalSemaphoreHandleTypeFlagBits</type> <name>handleType</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceExternalFenceInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkExternalFenceHandleTypeFlagBits</type> <name>handleType</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceExternalFenceInfoKHR"                    alias="VkPhysicalDeviceExternalFenceInfo"/>
+        <type category="struct" name="VkExternalFenceProperties" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkExternalFenceHandleTypeFlags</type> <name>exportFromImportedHandleTypes</name></member>
+            <member><type>VkExternalFenceHandleTypeFlags</type> <name>compatibleHandleTypes</name></member>
+            <member optional="true"><type>VkExternalFenceFeatureFlags</type> <name>externalFenceFeatures</name></member>
+        </type>
+        <type category="struct" name="VkExternalFencePropertiesKHR"                            alias="VkExternalFenceProperties"/>
+        <type category="struct" name="VkExportFenceCreateInfo" structextends="VkFenceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkExternalFenceHandleTypeFlags</type> <name>handleTypes</name></member>
+        </type>
+        <type category="struct" name="VkExportFenceCreateInfoKHR"                              alias="VkExportFenceCreateInfo"/>
+        <type category="struct" name="VkImportFenceWin32HandleInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                        <name>pNext</name></member>
+            <member externsync="true"><type>VkFence</type>                          <name>fence</name></member>
+            <member optional="true"><type>VkFenceImportFlags</type>              <name>flags</name></member>
+            <member noautovalidity="true"><type>VkExternalFenceHandleTypeFlagBits</type>  <name>handleType</name></member>
+            <member optional="true"><type>HANDLE</type>                             <name>handle</name></member>
+            <member optional="true"><type>LPCWSTR</type>                            <name>name</name></member>
+        </type>
+        <type category="struct" name="VkExportFenceWin32HandleInfoKHR" structextends="VkFenceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                <name>pNext</name></member>
+            <member optional="true">const <type>SECURITY_ATTRIBUTES</type>* <name>pAttributes</name></member>
+            <member><type>DWORD</type>                                      <name>dwAccess</name></member>
+            <member><type>LPCWSTR</type>                                    <name>name</name></member>
+        </type>
+        <type category="struct" name="VkFenceGetWin32HandleInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkFence</type>                                <name>fence</name></member>
+            <member><type>VkExternalFenceHandleTypeFlagBits</type>   <name>handleType</name></member>
+        </type>
+        <type category="struct" name="VkImportFenceFdInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                            <name>pNext</name></member>
+            <member externsync="true"><type>VkFence</type>              <name>fence</name></member>
+            <member optional="true"><type>VkFenceImportFlags</type>  <name>flags</name></member>
+            <member><type>VkExternalFenceHandleTypeFlagBits</type>   <name>handleType</name></member>
+            <member><type>int</type>                                    <name>fd</name></member>
+        </type>
+        <type category="struct" name="VkFenceGetFdInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkFence</type>                                <name>fence</name></member>
+            <member><type>VkExternalFenceHandleTypeFlagBits</type>   <name>handleType</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceMultiviewFeatures" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>multiview</name><comment>Multiple views in a renderpass</comment></member>
+            <member><type>VkBool32</type>                         <name>multiviewGeometryShader</name><comment>Multiple views in a renderpass w/ geometry shader</comment></member>
+            <member><type>VkBool32</type>                         <name>multiviewTessellationShader</name><comment>Multiple views in a renderpass w/ tessellation shader</comment></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceMultiviewFeaturesKHR"                    alias="VkPhysicalDeviceMultiviewFeatures"/>
+        <type category="struct" name="VkPhysicalDeviceMultiviewProperties" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxMultiviewViewCount</name><comment>max number of views in a subpass</comment></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxMultiviewInstanceIndex</name><comment>max instance index for a draw in a multiview subpass</comment></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceMultiviewPropertiesKHR"                  alias="VkPhysicalDeviceMultiviewProperties"/>
+        <type category="struct" name="VkRenderPassMultiviewCreateInfo" structextends="VkRenderPassCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO"><type>VkStructureType</type>        <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>subpassCount</name></member>
+            <member len="subpassCount">const <type>uint32_t</type>*     <name>pViewMasks</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>dependencyCount</name></member>
+            <member len="dependencyCount">const <type>int32_t</type>*   <name>pViewOffsets</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>correlationMaskCount</name></member>
+            <member len="correlationMaskCount">const <type>uint32_t</type>* <name>pCorrelationMasks</name></member>
+        </type>
+        <type category="struct" name="VkRenderPassMultiviewCreateInfoKHR"                      alias="VkRenderPassMultiviewCreateInfo"/>
+        <type category="struct" name="VkSurfaceCapabilities2EXT" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>uint32_t</type>                         <name>minImageCount</name><comment>Supported minimum number of images for the surface</comment></member>
+            <member><type>uint32_t</type>                         <name>maxImageCount</name><comment>Supported maximum number of images for the surface, 0 for unlimited</comment></member>
+            <member><type>VkExtent2D</type>                       <name>currentExtent</name><comment>Current image width and height for the surface, (0, 0) if undefined</comment></member>
+            <member><type>VkExtent2D</type>                       <name>minImageExtent</name><comment>Supported minimum image width and height for the surface</comment></member>
+            <member><type>VkExtent2D</type>                       <name>maxImageExtent</name><comment>Supported maximum image width and height for the surface</comment></member>
+            <member><type>uint32_t</type>                         <name>maxImageArrayLayers</name><comment>Supported maximum number of image layers for the surface</comment></member>
+            <member><type>VkSurfaceTransformFlagsKHR</type>       <name>supportedTransforms</name><comment>1 or more bits representing the transforms supported</comment></member>
+            <member><type>VkSurfaceTransformFlagBitsKHR</type>    <name>currentTransform</name><comment>The surface's current transform relative to the device's natural orientation</comment></member>
+            <member><type>VkCompositeAlphaFlagsKHR</type>         <name>supportedCompositeAlpha</name><comment>1 or more bits representing the alpha compositing modes supported</comment></member>
+            <member><type>VkImageUsageFlags</type>                <name>supportedUsageFlags</name><comment>Supported image usage flags for the surface</comment></member>
+            <member optional="true"><type>VkSurfaceCounterFlagsEXT</type> <name>supportedSurfaceCounters</name></member>
+        </type>
+        <type category="struct" name="VkDisplayPowerInfoEXT">
+            <member values="VK_STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkDisplayPowerStateEXT</type>           <name>powerState</name></member>
+        </type>
+        <type category="struct" name="VkDeviceEventInfoEXT">
+            <member values="VK_STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkDeviceEventTypeEXT</type>             <name>deviceEvent</name></member>
+        </type>
+        <type category="struct" name="VkDisplayEventInfoEXT">
+            <member values="VK_STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkDisplayEventTypeEXT</type>            <name>displayEvent</name></member>
+        </type>
+        <type category="struct" name="VkSwapchainCounterCreateInfoEXT" structextends="VkSwapchainCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkSurfaceCounterFlagsEXT</type>         <name>surfaceCounters</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceGroupProperties" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>uint32_t</type>                         <name>physicalDeviceCount</name></member>
+            <member><type>VkPhysicalDevice</type>                 <name>physicalDevices</name>[<enum>VK_MAX_DEVICE_GROUP_SIZE</enum>]</member>
+            <member><type>VkBool32</type>                         <name>subsetAllocation</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceGroupPropertiesKHR"                      alias="VkPhysicalDeviceGroupProperties"/>
+        <type category="struct" name="VkMemoryAllocateFlagsInfo" structextends="VkMemoryAllocateInfo">
+            <member values="VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkMemoryAllocateFlags</type> <name>flags</name></member>
+            <member><type>uint32_t</type>                         <name>deviceMask</name></member>
+        </type>
+        <type category="struct" name="VkMemoryAllocateFlagsInfoKHR"                            alias="VkMemoryAllocateFlagsInfo"/>
+        <type category="struct" name="VkBindBufferMemoryInfo">
+            <member values="VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkBuffer</type>                         <name>buffer</name></member>
+            <member devicememoryhandle="1"><type>VkDeviceMemory</type>                   <name>memory</name></member>
+            <member devicememoryoffset="1"><type>VkDeviceSize</type>                     <name>memoryOffset</name></member>
+        </type>
+        <type category="struct" name="VkBindBufferMemoryInfoKHR"                               alias="VkBindBufferMemoryInfo"/>
+        <type category="struct" name="VkBindBufferMemoryDeviceGroupInfo" structextends="VkBindBufferMemoryInfo">
+            <member values="VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>uint32_t</type>         <name>deviceIndexCount</name></member>
+            <member len="deviceIndexCount">const <type>uint32_t</type>*  <name>pDeviceIndices</name></member>
+        </type>
+        <type category="struct" name="VkBindBufferMemoryDeviceGroupInfoKHR"                    alias="VkBindBufferMemoryDeviceGroupInfo"/>
+        <type category="struct" name="VkBindImageMemoryInfo">
+            <member values="VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkImage</type>                          <name>image</name></member>
+            <member noautovalidity="true" devicememoryhandle="1"><type>VkDeviceMemory</type>                   <name>memory</name></member>
+            <member devicememoryoffset="1"><type>VkDeviceSize</type>                     <name>memoryOffset</name></member>
+        </type>
+        <type category="struct" name="VkBindImageMemoryInfoKHR"                                alias="VkBindImageMemoryInfo"/>
+        <type category="struct" name="VkBindImageMemoryDeviceGroupInfo" structextends="VkBindImageMemoryInfo">
+            <member values="VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>uint32_t</type>         <name>deviceIndexCount</name></member>
+            <member len="deviceIndexCount">const <type>uint32_t</type>*  <name>pDeviceIndices</name></member>
+            <member optional="true"><type>uint32_t</type>         <name>splitInstanceBindRegionCount</name></member>
+            <member len="splitInstanceBindRegionCount">const <type>VkRect2D</type>*  <name>pSplitInstanceBindRegions</name></member>
+        </type>
+        <type category="struct" name="VkBindImageMemoryDeviceGroupInfoKHR"                     alias="VkBindImageMemoryDeviceGroupInfo"/>
+        <type category="struct" name="VkDeviceGroupRenderPassBeginInfo" structextends="VkRenderPassBeginInfo,VkRenderingInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>uint32_t</type>                         <name>deviceMask</name></member>
+            <member optional="true"><type>uint32_t</type>         <name>deviceRenderAreaCount</name></member>
+            <member len="deviceRenderAreaCount">const <type>VkRect2D</type>*  <name>pDeviceRenderAreas</name></member>
+        </type>
+        <type category="struct" name="VkDeviceGroupRenderPassBeginInfoKHR"                     alias="VkDeviceGroupRenderPassBeginInfo"/>
+        <type category="struct" name="VkDeviceGroupCommandBufferBeginInfo" structextends="VkCommandBufferBeginInfo">
+            <member values="VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>uint32_t</type>                         <name>deviceMask</name></member>
+        </type>
+        <type category="struct" name="VkDeviceGroupCommandBufferBeginInfoKHR"                  alias="VkDeviceGroupCommandBufferBeginInfo"/>
+        <type category="struct" name="VkDeviceGroupSubmitInfo" structextends="VkSubmitInfo">
+            <member values="VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>uint32_t</type>         <name>waitSemaphoreCount</name></member>
+            <member len="waitSemaphoreCount">const <type>uint32_t</type>*    <name>pWaitSemaphoreDeviceIndices</name></member>
+            <member optional="true"><type>uint32_t</type>         <name>commandBufferCount</name></member>
+            <member len="commandBufferCount">const <type>uint32_t</type>*    <name>pCommandBufferDeviceMasks</name></member>
+            <member optional="true"><type>uint32_t</type>         <name>signalSemaphoreCount</name></member>
+            <member len="signalSemaphoreCount">const <type>uint32_t</type>*  <name>pSignalSemaphoreDeviceIndices</name></member>
+        </type>
+        <type category="struct" name="VkDeviceGroupSubmitInfoKHR"                              alias="VkDeviceGroupSubmitInfo"/>
+        <type category="struct" name="VkDeviceGroupBindSparseInfo" structextends="VkBindSparseInfo">
+            <member values="VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>uint32_t</type>                         <name>resourceDeviceIndex</name></member>
+            <member><type>uint32_t</type>                         <name>memoryDeviceIndex</name></member>
+        </type>
+        <type category="struct" name="VkDeviceGroupBindSparseInfoKHR"                          alias="VkDeviceGroupBindSparseInfo"/>
+        <type category="struct" name="VkDeviceGroupPresentCapabilitiesKHR" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*            <name>pNext</name></member>
+            <member><type>uint32_t</type>                         <name>presentMask</name>[<enum>VK_MAX_DEVICE_GROUP_SIZE</enum>]</member>
+            <member><type>VkDeviceGroupPresentModeFlagsKHR</type> <name>modes</name></member>
+        </type>
+        <type category="struct" name="VkImageSwapchainCreateInfoKHR" structextends="VkImageCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkSwapchainKHR</type>   <name>swapchain</name></member>
+        </type>
+        <type category="struct" name="VkBindImageMemorySwapchainInfoKHR" structextends="VkBindImageMemoryInfo">
+            <member values="VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member externsync="true"><type>VkSwapchainKHR</type> <name>swapchain</name></member>
+            <member><type>uint32_t</type>                         <name>imageIndex</name></member>
+        </type>
+        <type category="struct" name="VkAcquireNextImageInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member externsync="true"><type>VkSwapchainKHR</type> <name>swapchain</name></member>
+            <member><type>uint64_t</type>                         <name>timeout</name></member>
+            <member optional="true" externsync="true"><type>VkSemaphore</type> <name>semaphore</name></member>
+            <member optional="true" externsync="true"><type>VkFence</type> <name>fence</name></member>
+            <member><type>uint32_t</type>                         <name>deviceMask</name></member>
+        </type>
+        <type category="struct" name="VkDeviceGroupPresentInfoKHR" structextends="VkPresentInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>uint32_t</type>         <name>swapchainCount</name></member>
+            <member len="swapchainCount">const <type>uint32_t</type>* <name>pDeviceMasks</name></member>
+            <member><type>VkDeviceGroupPresentModeFlagBitsKHR</type> <name>mode</name></member>
+        </type>
+        <type category="struct" name="VkDeviceGroupDeviceCreateInfo" structextends="VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>uint32_t</type>                         <name>physicalDeviceCount</name></member>
+            <member len="physicalDeviceCount">const <type>VkPhysicalDevice</type>*  <name>pPhysicalDevices</name></member>
+        </type>
+        <type category="struct" name="VkDeviceGroupDeviceCreateInfoKHR"                        alias="VkDeviceGroupDeviceCreateInfo"/>
+        <type category="struct" name="VkDeviceGroupSwapchainCreateInfoKHR" structextends="VkSwapchainCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkDeviceGroupPresentModeFlagsKHR</type>                         <name>modes</name></member>
+        </type>
+        <type category="struct" name="VkDescriptorUpdateTemplateEntry">
+            <member><type>uint32_t</type>                         <name>dstBinding</name><comment>Binding within the destination descriptor set to write</comment></member>
+            <member><type>uint32_t</type>                         <name>dstArrayElement</name><comment>Array element within the destination binding to write</comment></member>
+            <member><type>uint32_t</type>                         <name>descriptorCount</name><comment>Number of descriptors to write</comment></member>
+            <member><type>VkDescriptorType</type>                 <name>descriptorType</name><comment>Descriptor type to write</comment></member>
+            <member><type>size_t</type>                           <name>offset</name><comment>Offset into pData where the descriptors to update are stored</comment></member>
+            <member><type>size_t</type>                           <name>stride</name><comment>Stride between two descriptors in pData when writing more than one descriptor</comment></member>
+        </type>
+        <type category="struct" name="VkDescriptorUpdateTemplateEntryKHR"                      alias="VkDescriptorUpdateTemplateEntry"/>
+        <type category="struct" name="VkDescriptorUpdateTemplateCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                               <name>pNext</name></member>
+            <member optional="true"><type>VkDescriptorUpdateTemplateCreateFlags</type>    <name>flags</name></member>
+            <member><type>uint32_t</type>                 <name>descriptorUpdateEntryCount</name><comment>Number of descriptor update entries to use for the update template</comment></member>
+            <member len="descriptorUpdateEntryCount">const <type>VkDescriptorUpdateTemplateEntry</type>* <name>pDescriptorUpdateEntries</name><comment>Descriptor update entries for the template</comment></member>
+            <member><type>VkDescriptorUpdateTemplateType</type> <name>templateType</name></member>
+            <member noautovalidity="true"><type>VkDescriptorSetLayout</type> <name>descriptorSetLayout</name></member>
+            <member noautovalidity="true"><type>VkPipelineBindPoint</type> <name>pipelineBindPoint</name></member>
+            <member noautovalidity="true"><type>VkPipelineLayout</type><name>pipelineLayout</name><comment>If used for push descriptors, this is the only allowed layout</comment></member>
+            <member noautovalidity="true"><type>uint32_t</type> <name>set</name></member>
+        </type>
+        <type category="struct" name="VkDescriptorUpdateTemplateCreateInfoKHR"                 alias="VkDescriptorUpdateTemplateCreateInfo"/>
+        <type category="struct" name="VkXYColorEXT" comment="Chromaticity coordinate">
+            <member><type>float</type>   <name>x</name></member>
+            <member><type>float</type>   <name>y</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDevicePresentIdFeaturesKHR" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*            <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>presentId</name><comment>Present ID in VkPresentInfoKHR</comment></member>
+        </type>
+        <type category="struct" name="VkPresentIdKHR" structextends="VkPresentInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_PRESENT_ID_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>uint32_t</type>                         <name>swapchainCount</name><comment>Copy of VkPresentInfoKHR::swapchainCount</comment></member>
+            <member len="swapchainCount" optional="true">const <type>uint64_t</type>* <name>pPresentIds</name><comment>Present ID values for each swapchain</comment></member>
+        </type>
+        <type category="struct" name="VkPhysicalDevicePresentWaitFeaturesKHR" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*            <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>presentWait</name><comment>vkWaitForPresentKHR is supported</comment></member>
+        </type>
+        <type category="struct" name="VkHdrMetadataEXT">
+                <comment>Display primary in chromaticity coordinates</comment>
+            <member values="VK_STRUCTURE_TYPE_HDR_METADATA_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*    <name>pNext</name></member>
+                <comment> From SMPTE 2086</comment>
+            <member noautovalidity="true"><type>VkXYColorEXT</type>   <name>displayPrimaryRed</name><comment>Display primary's Red</comment></member>
+            <member noautovalidity="true"><type>VkXYColorEXT</type>   <name>displayPrimaryGreen</name><comment>Display primary's Green</comment></member>
+            <member noautovalidity="true"><type>VkXYColorEXT</type>   <name>displayPrimaryBlue</name><comment>Display primary's Blue</comment></member>
+            <member noautovalidity="true"><type>VkXYColorEXT</type>   <name>whitePoint</name><comment>Display primary's Blue</comment></member>
+            <member noautovalidity="true"><type>float</type>          <name>maxLuminance</name><comment>Display maximum luminance</comment></member>
+            <member noautovalidity="true"><type>float</type>          <name>minLuminance</name><comment>Display minimum luminance</comment></member>
+                <comment> From CTA 861.3</comment>
+            <member noautovalidity="true"><type>float</type>          <name>maxContentLightLevel</name><comment>Content maximum luminance</comment></member>
+            <member noautovalidity="true"><type>float</type>          <name>maxFrameAverageLightLevel</name></member>
+        </type>
+        <type category="struct" name="VkDisplayNativeHdrSurfaceCapabilitiesAMD" returnedonly="true" structextends="VkSurfaceCapabilities2KHR">
+            <member values="VK_STRUCTURE_TYPE_DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*          <name>pNext</name></member>
+            <member><type>VkBool32</type>       <name>localDimmingSupport</name></member>
+        </type>
+        <type category="struct" name="VkSwapchainDisplayNativeHdrCreateInfoAMD" structextends="VkSwapchainCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*    <name>pNext</name></member>
+            <member><type>VkBool32</type>       <name>localDimmingEnable</name></member>
+        </type>
+        <type category="struct" name="VkRefreshCycleDurationGOOGLE" returnedonly="true">
+            <member><type>uint64_t</type>                         <name>refreshDuration</name><comment>Number of nanoseconds from the start of one refresh cycle to the next</comment></member>
+        </type>
+        <type category="struct" name="VkPastPresentationTimingGOOGLE" returnedonly="true">
+            <member><type>uint32_t</type>                         <name>presentID</name><comment>Application-provided identifier, previously given to vkQueuePresentKHR</comment></member>
+            <member><type>uint64_t</type>                         <name>desiredPresentTime</name><comment>Earliest time an image should have been presented, previously given to vkQueuePresentKHR</comment></member>
+            <member><type>uint64_t</type>                         <name>actualPresentTime</name><comment>Time the image was actually displayed</comment></member>
+            <member><type>uint64_t</type>                         <name>earliestPresentTime</name><comment>Earliest time the image could have been displayed</comment></member>
+            <member><type>uint64_t</type>                         <name>presentMargin</name><comment>How early vkQueuePresentKHR was processed vs. how soon it needed to be and make earliestPresentTime</comment></member>
+        </type>
+        <type category="struct" name="VkPresentTimesInfoGOOGLE" structextends="VkPresentInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>uint32_t</type>                         <name>swapchainCount</name><comment>Copy of VkPresentInfoKHR::swapchainCount</comment></member>
+            <member len="swapchainCount" optional="true">const <type>VkPresentTimeGOOGLE</type>*   <name>pTimes</name><comment>The earliest times to present images</comment></member>
+        </type>
+        <type category="struct" name="VkPresentTimeGOOGLE">
+            <member><type>uint32_t</type>                         <name>presentID</name><comment>Application-provided identifier</comment></member>
+            <member><type>uint64_t</type>                         <name>desiredPresentTime</name><comment>Earliest time an image should be presented</comment></member>
+        </type>
+        <type category="struct" name="VkIOSSurfaceCreateInfoMVK">
+            <member values="VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                    <name>pNext</name></member>
+            <member optional="true"><type>VkIOSSurfaceCreateFlagsMVK</type>     <name>flags</name></member>
+            <member noautovalidity="true">const <type>void</type>*                                    <name>pView</name></member>
+        </type>
+        <type category="struct" name="VkMacOSSurfaceCreateInfoMVK">
+            <member values="VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                    <name>pNext</name></member>
+            <member optional="true"><type>VkMacOSSurfaceCreateFlagsMVK</type>   <name>flags</name></member>
+            <member noautovalidity="true">const <type>void</type>*                                    <name>pView</name></member>
+        </type>
+        <type category="struct" name="VkMetalSurfaceCreateInfoEXT">
+            <member values="VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                    <name>pNext</name></member>
+            <member optional="true"><type>VkMetalSurfaceCreateFlagsEXT</type>   <name>flags</name></member>
+            <member noautovalidity="true">const <type>CAMetalLayer</type>*      <name>pLayer</name></member>
+        </type>
+        <type category="struct" name="VkViewportWScalingNV">
+            <member><type>float</type>          <name>xcoeff</name></member>
+            <member><type>float</type>          <name>ycoeff</name></member>
+        </type>
+        <type category="struct" name="VkPipelineViewportWScalingStateCreateInfoNV" structextends="VkPipelineViewportStateCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkBool32</type>               <name>viewportWScalingEnable</name></member>
+            <member><type>uint32_t</type>               <name>viewportCount</name></member>
+            <member noautovalidity="true" optional="true" len="viewportCount">const <type>VkViewportWScalingNV</type>*      <name>pViewportWScalings</name></member>
+        </type>
+        <type category="struct" name="VkViewportSwizzleNV">
+            <member><type>VkViewportCoordinateSwizzleNV</type>          <name>x</name></member>
+            <member><type>VkViewportCoordinateSwizzleNV</type>          <name>y</name></member>
+            <member><type>VkViewportCoordinateSwizzleNV</type>          <name>z</name></member>
+            <member><type>VkViewportCoordinateSwizzleNV</type>          <name>w</name></member>
+        </type>
+        <type category="struct" name="VkPipelineViewportSwizzleStateCreateInfoNV" structextends="VkPipelineViewportStateCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkPipelineViewportSwizzleStateCreateFlagsNV</type>    <name>flags</name></member>
+            <member><type>uint32_t</type>               <name>viewportCount</name></member>
+            <member noautovalidity="true" optional="true" len="viewportCount">const <type>VkViewportSwizzleNV</type>*      <name>pViewportSwizzles</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceDiscardRectanglePropertiesEXT" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                  <name>pNext</name></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxDiscardRectangles</name><comment>max number of active discard rectangles</comment></member>
+        </type>
+        <type category="struct" name="VkPipelineDiscardRectangleStateCreateInfoEXT" structextends="VkGraphicsPipelineCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                       <name>pNext</name></member>
+            <member optional="true"><type>VkPipelineDiscardRectangleStateCreateFlagsEXT</type>     <name>flags</name></member>
+            <member><type>VkDiscardRectangleModeEXT</type>                                         <name>discardRectangleMode</name></member>
+            <member optional="true"><type>uint32_t</type>                                          <name>discardRectangleCount</name></member>
+            <member noautovalidity="true" len="discardRectangleCount">const <type>VkRect2D</type>* <name>pDiscardRectangles</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>perViewPositionAllComponents</name></member>
+        </type>
+        <type category="struct" name="VkInputAttachmentAspectReference">
+            <member><type>uint32_t</type>                        <name>subpass</name></member>
+            <member><type>uint32_t</type>                        <name>inputAttachmentIndex</name></member>
+            <member><type>VkImageAspectFlags</type>              <name>aspectMask</name></member>
+        </type>
+        <type category="struct" name="VkInputAttachmentAspectReferenceKHR"                     alias="VkInputAttachmentAspectReference"/>
+        <type category="struct" name="VkRenderPassInputAttachmentAspectCreateInfo" structextends="VkRenderPassCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                     <name>pNext</name></member>
+            <member><type>uint32_t</type>                        <name>aspectReferenceCount</name></member>
+            <member len="aspectReferenceCount">const <type>VkInputAttachmentAspectReference</type>* <name>pAspectReferences</name></member>
+        </type>
+        <type category="struct" name="VkRenderPassInputAttachmentAspectCreateInfoKHR"          alias="VkRenderPassInputAttachmentAspectCreateInfo"/>
+        <type category="struct" name="VkPhysicalDeviceSurfaceInfo2KHR">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>* <name>pNext</name></member>
+            <member><type>VkSurfaceKHR</type> <name>surface</name></member>
+        </type>
+        <type category="struct" name="VkSurfaceCapabilities2KHR" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*   <name>pNext</name></member>
+            <member><type>VkSurfaceCapabilitiesKHR</type> <name>surfaceCapabilities</name></member>
+        </type>
+        <type category="struct" name="VkSurfaceFormat2KHR" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>* <name>pNext</name></member>
+            <member><type>VkSurfaceFormatKHR</type> <name>surfaceFormat</name></member>
+        </type>
+        <type category="struct" name="VkDisplayProperties2KHR" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_DISPLAY_PROPERTIES_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>* <name>pNext</name></member>
+            <member><type>VkDisplayPropertiesKHR</type> <name>displayProperties</name></member>
+        </type>
+        <type category="struct" name="VkDisplayPlaneProperties2KHR" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_DISPLAY_PLANE_PROPERTIES_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>* <name>pNext</name></member>
+            <member><type>VkDisplayPlanePropertiesKHR</type> <name>displayPlaneProperties</name></member>
+        </type>
+        <type category="struct" name="VkDisplayModeProperties2KHR" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_DISPLAY_MODE_PROPERTIES_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>* <name>pNext</name></member>
+            <member><type>VkDisplayModePropertiesKHR</type> <name>displayModeProperties</name></member>
+        </type>
+        <type category="struct" name="VkDisplayPlaneInfo2KHR">
+            <member values="VK_STRUCTURE_TYPE_DISPLAY_PLANE_INFO_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>* <name>pNext</name></member>
+            <member externsync="true"><type>VkDisplayModeKHR</type> <name>mode</name></member>
+            <member><type>uint32_t</type> <name>planeIndex</name></member>
+        </type>
+        <type category="struct" name="VkDisplayPlaneCapabilities2KHR" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_DISPLAY_PLANE_CAPABILITIES_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>* <name>pNext</name></member>
+            <member><type>VkDisplayPlaneCapabilitiesKHR</type> <name>capabilities</name></member>
+        </type>
+        <type category="struct" name="VkSharedPresentSurfaceCapabilitiesKHR" returnedonly="true" structextends="VkSurfaceCapabilities2KHR">
+            <member values="VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member optional="true"><type>VkImageUsageFlags</type> <name>sharedPresentSupportedUsageFlags</name><comment>Supported image usage flags if swapchain created using a shared present mode</comment></member>
+        </type>
+        <type category="struct" name="VkPhysicalDevice16BitStorageFeatures" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*      <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>storageBuffer16BitAccess</name><comment>16-bit integer/floating-point variables supported in BufferBlock</comment></member>
+            <member><type>VkBool32</type>                         <name>uniformAndStorageBuffer16BitAccess</name><comment>16-bit integer/floating-point variables supported in BufferBlock and Block</comment></member>
+            <member><type>VkBool32</type>                         <name>storagePushConstant16</name><comment>16-bit integer/floating-point variables supported in PushConstant</comment></member>
+            <member><type>VkBool32</type>                         <name>storageInputOutput16</name><comment>16-bit integer/floating-point variables supported in shader inputs and outputs</comment></member>
+        </type>
+        <type category="struct" name="VkPhysicalDevice16BitStorageFeaturesKHR"                 alias="VkPhysicalDevice16BitStorageFeatures"/>
+        <type category="struct" name="VkPhysicalDeviceSubgroupProperties" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                   <name>pNext</name></member>
+            <member limittype="noauto" noautovalidity="true"><type>uint32_t</type>                      <name>subgroupSize</name><comment>The size of a subgroup for this queue.</comment></member>
+            <member limittype="bitmask" noautovalidity="true"><type>VkShaderStageFlags</type>            <name>supportedStages</name><comment>Bitfield of what shader stages support subgroup operations</comment></member>
+            <member limittype="bitmask" noautovalidity="true"><type>VkSubgroupFeatureFlags</type>        <name>supportedOperations</name><comment>Bitfield of what subgroup operations are supported.</comment></member>
+            <member limittype="bitmask" noautovalidity="true"><type>VkBool32</type> <name>quadOperationsInAllStages</name><comment>Flag to specify whether quad operations are available in all stages.</comment></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                          <name>pNext</name></member>
+            <member noautovalidity="true"><type>VkBool32</type> <name>shaderSubgroupExtendedTypes</name><comment>Flag to specify whether subgroup operations with extended types are supported</comment></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR"  alias="VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures"/>
+        <type category="struct" name="VkBufferMemoryRequirementsInfo2">
+            <member values="VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                          <name>pNext</name></member>
+            <member><type>VkBuffer</type>                                                             <name>buffer</name></member>
+        </type>
+        <type category="struct" name="VkBufferMemoryRequirementsInfo2KHR"                      alias="VkBufferMemoryRequirementsInfo2"/>
+        <type category="struct" name="VkDeviceBufferMemoryRequirementsKHR">
+            <member values="VK_STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                           <name>pNext</name></member>
+            <member>const <type>VkBufferCreateInfo</type>*                                                             <name>pCreateInfo</name></member>
+        </type>
+        <type category="struct" name="VkImageMemoryRequirementsInfo2">
+            <member values="VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                          <name>pNext</name></member>
+            <member><type>VkImage</type>                                                              <name>image</name></member>
+        </type>
+        <type category="struct" name="VkImageMemoryRequirementsInfo2KHR"                       alias="VkImageMemoryRequirementsInfo2"/>
+        <type category="struct" name="VkImageSparseMemoryRequirementsInfo2">
+            <member values="VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                          <name>pNext</name></member>
+            <member><type>VkImage</type>                                                              <name>image</name></member>
+        </type>
+        <type category="struct" name="VkImageSparseMemoryRequirementsInfo2KHR"                 alias="VkImageSparseMemoryRequirementsInfo2"/>
+        <type category="struct" name="VkDeviceImageMemoryRequirementsKHR">
+            <member values="VK_STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                          <name>pNext</name></member>
+            <member>const <type>VkImageCreateInfo</type>*                                                             <name>pCreateInfo</name></member>
+            <member><type>VkImageAspectFlagBits</type>                                                                <name>planeAspect</name></member>
+        </type>
+        <type category="struct" name="VkMemoryRequirements2" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>* <name>pNext</name></member>
+            <member><type>VkMemoryRequirements</type>                                                 <name>memoryRequirements</name></member>
+        </type>
+        <type category="struct" name="VkMemoryRequirements2KHR"                                alias="VkMemoryRequirements2"/>
+        <type category="struct" name="VkSparseImageMemoryRequirements2" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                                       <name>pNext</name></member>
+            <member><type>VkSparseImageMemoryRequirements</type>                                      <name>memoryRequirements</name></member>
+        </type>
+        <type category="struct" name="VkSparseImageMemoryRequirements2KHR"                     alias="VkSparseImageMemoryRequirements2"/>
+        <type category="struct" name="VkPhysicalDevicePointClippingProperties" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member limittype="noauto"><type>VkPointClippingBehavior</type>      <name>pointClippingBehavior</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDevicePointClippingPropertiesKHR"              alias="VkPhysicalDevicePointClippingProperties"/>
+        <type category="struct" name="VkMemoryDedicatedRequirements" returnedonly="true" structextends="VkMemoryRequirements2">
+            <member values="VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>prefersDedicatedAllocation</name></member>
+            <member><type>VkBool32</type>                         <name>requiresDedicatedAllocation</name></member>
+        </type>
+        <type category="struct" name="VkMemoryDedicatedRequirementsKHR"                        alias="VkMemoryDedicatedRequirements"/>
+        <type category="struct" name="VkMemoryDedicatedAllocateInfo" structextends="VkMemoryAllocateInfo">
+            <member values="VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>VkImage</type>          <name>image</name><comment>Image that this allocation will be bound to</comment></member>
+            <member optional="true"><type>VkBuffer</type>         <name>buffer</name><comment>Buffer that this allocation will be bound to</comment></member>
+        </type>
+        <type category="struct" name="VkMemoryDedicatedAllocateInfoKHR"                        alias="VkMemoryDedicatedAllocateInfo"/>
+        <type category="struct" name="VkImageViewUsageCreateInfo" structextends="VkImageViewCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>* <name>pNext</name></member>
+            <member><type>VkImageUsageFlags</type> <name>usage</name></member>
+        </type>
+        <type category="struct" name="VkImageViewUsageCreateInfoKHR"                           alias="VkImageViewUsageCreateInfo"/>
+        <type category="struct" name="VkPipelineTessellationDomainOriginStateCreateInfo" structextends="VkPipelineTessellationStateCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkTessellationDomainOrigin</type>    <name>domainOrigin</name></member>
+        </type>
+        <type category="struct" name="VkPipelineTessellationDomainOriginStateCreateInfoKHR"    alias="VkPipelineTessellationDomainOriginStateCreateInfo"/>
+        <type category="struct" name="VkSamplerYcbcrConversionInfo" structextends="VkSamplerCreateInfo,VkImageViewCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkSamplerYcbcrConversion</type>      <name>conversion</name></member>
+        </type>
+        <type category="struct" name="VkSamplerYcbcrConversionInfoKHR"                         alias="VkSamplerYcbcrConversionInfo"/>
+        <type category="struct" name="VkSamplerYcbcrConversionCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkFormat</type>                         <name>format</name></member>
+            <member><type>VkSamplerYcbcrModelConversion</type> <name>ycbcrModel</name></member>
+            <member><type>VkSamplerYcbcrRange</type>           <name>ycbcrRange</name></member>
+            <member><type>VkComponentMapping</type>               <name>components</name></member>
+            <member><type>VkChromaLocation</type>              <name>xChromaOffset</name></member>
+            <member><type>VkChromaLocation</type>              <name>yChromaOffset</name></member>
+            <member><type>VkFilter</type>                         <name>chromaFilter</name></member>
+            <member><type>VkBool32</type>                         <name>forceExplicitReconstruction</name></member>
+        </type>
+        <type category="struct" name="VkSamplerYcbcrConversionCreateInfoKHR"                   alias="VkSamplerYcbcrConversionCreateInfo"/>
+        <type category="struct" name="VkBindImagePlaneMemoryInfo" structextends="VkBindImageMemoryInfo">
+            <member values="VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkImageAspectFlagBits</type>            <name>planeAspect</name></member>
+        </type>
+        <type category="struct" name="VkBindImagePlaneMemoryInfoKHR"                           alias="VkBindImagePlaneMemoryInfo"/>
+        <type category="struct" name="VkImagePlaneMemoryRequirementsInfo" structextends="VkImageMemoryRequirementsInfo2">
+            <member values="VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkImageAspectFlagBits</type>            <name>planeAspect</name></member>
+        </type>
+        <type category="struct" name="VkImagePlaneMemoryRequirementsInfoKHR"                   alias="VkImagePlaneMemoryRequirementsInfo"/>
+        <type category="struct" name="VkPhysicalDeviceSamplerYcbcrConversionFeatures" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*      <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>samplerYcbcrConversion</name><comment>Sampler color conversion supported</comment></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR"       alias="VkPhysicalDeviceSamplerYcbcrConversionFeatures"/>
+        <type category="struct" name="VkSamplerYcbcrConversionImageFormatProperties" returnedonly="true" structextends="VkImageFormatProperties2">
+            <member values="VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*      <name>pNext</name></member>
+            <member><type>uint32_t</type>                         <name>combinedImageSamplerDescriptorCount</name></member>
+        </type>
+        <type category="struct" name="VkSamplerYcbcrConversionImageFormatPropertiesKHR"        alias="VkSamplerYcbcrConversionImageFormatProperties"/>
+        <type category="struct" name="VkTextureLODGatherFormatPropertiesAMD" returnedonly="true" structextends="VkImageFormatProperties2">
+            <member values="VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>supportsTextureGatherLODBiasAMD</name></member>
+        </type>
+        <type category="struct" name="VkConditionalRenderingBeginInfoEXT">
+            <member values="VK_STRUCTURE_TYPE_CONDITIONAL_RENDERING_BEGIN_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkBuffer</type>                         <name>buffer</name></member>
+            <member><type>VkDeviceSize</type>                     <name>offset</name></member>
+            <member optional="true"><type>VkConditionalRenderingFlagsEXT</type>    <name>flags</name></member>
+        </type>
+        <type category="struct" name="VkProtectedSubmitInfo" structextends="VkSubmitInfo">
+            <member values="VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                     <name>pNext</name></member>
+            <member><type>VkBool32</type>                        <name>protectedSubmit</name><comment>Submit protected command buffers</comment></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceProtectedMemoryFeatures" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                               <name>pNext</name></member>
+            <member><type>VkBool32</type>                            <name>protectedMemory</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceProtectedMemoryProperties" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                               <name>pNext</name></member>
+            <member limittype="noauto"><type>VkBool32</type>                            <name>protectedNoFault</name></member>
+        </type>
+        <type category="struct" name="VkDeviceQueueInfo2">
+            <member values="VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                         <name>pNext</name></member>
+            <member optional="true"><type>VkDeviceQueueCreateFlags</type>            <name>flags</name></member>
+            <member><type>uint32_t</type>                            <name>queueFamilyIndex</name></member>
+            <member><type>uint32_t</type>                            <name>queueIndex</name></member>
+        </type>
+        <type category="struct" name="VkPipelineCoverageToColorStateCreateInfoNV" structextends="VkPipelineMultisampleStateCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                                      <name>pNext</name></member>
+            <member optional="true"><type>VkPipelineCoverageToColorStateCreateFlagsNV</type>                    <name>flags</name></member>
+            <member><type>VkBool32</type>                         <name>coverageToColorEnable</name></member>
+            <member optional="true"><type>uint32_t</type>         <name>coverageToColorLocation</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceSamplerFilterMinmaxProperties" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                  <name>pNext</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>filterMinmaxSingleComponentFormats</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>filterMinmaxImageComponentMapping</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT" alias="VkPhysicalDeviceSamplerFilterMinmaxProperties"/>
+        <type category="struct" name="VkSampleLocationEXT">
+            <member><type>float</type>                            <name>x</name></member>
+            <member><type>float</type>                            <name>y</name></member>
+        </type>
+        <type category="struct" name="VkSampleLocationsInfoEXT" structextends="VkImageMemoryBarrier,VkImageMemoryBarrier2KHR">
+            <member values="VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                            <name>pNext</name></member>
+            <member noautovalidity="true"><type>VkSampleCountFlagBits</type>  <name>sampleLocationsPerPixel</name></member>
+            <member><type>VkExtent2D</type>                             <name>sampleLocationGridSize</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>sampleLocationsCount</name></member>
+            <member len="sampleLocationsCount">const <type>VkSampleLocationEXT</type>* <name>pSampleLocations</name></member>
+        </type>
+        <type category="struct" name="VkAttachmentSampleLocationsEXT">
+            <member><type>uint32_t</type>                         <name>attachmentIndex</name></member>
+            <member><type>VkSampleLocationsInfoEXT</type>         <name>sampleLocationsInfo</name></member>
+        </type>
+        <type category="struct" name="VkSubpassSampleLocationsEXT">
+            <member><type>uint32_t</type>                         <name>subpassIndex</name></member>
+            <member><type>VkSampleLocationsInfoEXT</type>         <name>sampleLocationsInfo</name></member>
+        </type>
+        <type category="struct" name="VkRenderPassSampleLocationsBeginInfoEXT" structextends="VkRenderPassBeginInfo">
+            <member values="VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>uint32_t</type>         <name>attachmentInitialSampleLocationsCount</name></member>
+            <member len="attachmentInitialSampleLocationsCount">const <type>VkAttachmentSampleLocationsEXT</type>* <name>pAttachmentInitialSampleLocations</name></member>
+            <member optional="true"><type>uint32_t</type>         <name>postSubpassSampleLocationsCount</name></member>
+            <member len="postSubpassSampleLocationsCount">const <type>VkSubpassSampleLocationsEXT</type>* <name>pPostSubpassSampleLocations</name></member>
+        </type>
+        <type category="struct" name="VkPipelineSampleLocationsStateCreateInfoEXT" structextends="VkPipelineMultisampleStateCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>sampleLocationsEnable</name></member>
+            <member><type>VkSampleLocationsInfoEXT</type>         <name>sampleLocationsInfo</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceSampleLocationsPropertiesEXT" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member limittype="bitmask"><type>VkSampleCountFlags</type>               <name>sampleLocationSampleCounts</name></member>
+            <member limittype="max"><type>VkExtent2D</type>                       <name>maxSampleLocationGridSize</name></member>
+            <member limittype="range"><type>float</type>                            <name>sampleLocationCoordinateRange</name>[2]</member>
+            <member limittype="noauto"><type>uint32_t</type>                         <name>sampleLocationSubPixelBits</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>variableSampleLocations</name></member>
+        </type>
+        <type category="struct" name="VkMultisamplePropertiesEXT" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkExtent2D</type>                       <name>maxSampleLocationGridSize</name></member>
+        </type>
+        <type category="struct" name="VkSamplerReductionModeCreateInfo" structextends="VkSamplerCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkSamplerReductionMode</type>           <name>reductionMode</name></member>
+        </type>
+        <type category="struct" name="VkSamplerReductionModeCreateInfoEXT" alias="VkSamplerReductionModeCreateInfo"/>
+        <type category="struct" name="VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>advancedBlendCoherentOperations</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceMultiDrawFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true" noautovalidity="true"><type>void</type>*                     <name>pNext</name></member>
+            <member><type>VkBool32</type>                                        <name>multiDraw</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>advancedBlendMaxColorAttachments</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>advancedBlendIndependentBlend</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>advancedBlendNonPremultipliedSrcColor</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>advancedBlendNonPremultipliedDstColor</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>advancedBlendCorrelatedOverlap</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>advancedBlendAllOperations</name></member>
+        </type>
+        <type category="struct" name="VkPipelineColorBlendAdvancedStateCreateInfoEXT" structextends="VkPipelineColorBlendStateCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member><type>VkBool32</type>               <name>srcPremultiplied</name></member>
+            <member><type>VkBool32</type>               <name>dstPremultiplied</name></member>
+            <member><type>VkBlendOverlapEXT</type>      <name>blendOverlap</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceInlineUniformBlockFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                  <name>pNext</name></member>
+            <member><type>VkBool32</type>               <name>inlineUniformBlock</name></member>
+            <member><type>VkBool32</type>               <name>descriptorBindingInlineUniformBlockUpdateAfterBind</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceInlineUniformBlockPropertiesEXT" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                  <name>pNext</name></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxInlineUniformBlockSize</name></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxPerStageDescriptorInlineUniformBlocks</name></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks</name></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxDescriptorSetInlineUniformBlocks</name></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxDescriptorSetUpdateAfterBindInlineUniformBlocks</name></member>
+        </type>
+        <type category="struct" name="VkWriteDescriptorSetInlineUniformBlockEXT" structextends="VkWriteDescriptorSet">
+            <member values="VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member><type>uint32_t</type>               <name>dataSize</name></member>
+            <member len="dataSize">const <type>void</type>* <name>pData</name></member>
+        </type>
+        <type category="struct" name="VkDescriptorPoolInlineUniformBlockCreateInfoEXT" structextends="VkDescriptorPoolCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member><type>uint32_t</type>               <name>maxInlineUniformBlockBindings</name></member>
+        </type>
+        <type category="struct" name="VkPipelineCoverageModulationStateCreateInfoNV" structextends="VkPipelineMultisampleStateCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                                      <name>pNext</name></member>
+            <member optional="true"><type>VkPipelineCoverageModulationStateCreateFlagsNV</type>                   <name>flags</name></member>
+            <member><type>VkCoverageModulationModeNV</type>                                                       <name>coverageModulationMode</name></member>
+            <member><type>VkBool32</type>                                                                         <name>coverageModulationTableEnable</name></member>
+            <member optional="true"><type>uint32_t</type>                                                         <name>coverageModulationTableCount</name></member>
+            <member noautovalidity="true" optional="true" len="coverageModulationTableCount">const <type>float</type>* <name>pCoverageModulationTable</name></member>
+        </type>
+        <type category="struct" name="VkImageFormatListCreateInfo" structextends="VkImageCreateInfo,VkSwapchainCreateInfoKHR,VkPhysicalDeviceImageFormatInfo2">
+            <member values="VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                            <name>pNext</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>viewFormatCount</name></member>
+            <member len="viewFormatCount">const <type>VkFormat</type>*  <name>pViewFormats</name></member>
+        </type>
+        <type category="struct" name="VkImageFormatListCreateInfoKHR"                          alias="VkImageFormatListCreateInfo"/>
+        <type category="struct" name="VkValidationCacheCreateInfoEXT">
+            <member values="VK_STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkValidationCacheCreateFlagsEXT</type>    <name>flags</name></member>
+            <member optional="true"><type>size_t</type>                 <name>initialDataSize</name></member>
+            <member len="initialDataSize">const <type>void</type>*            <name>pInitialData</name></member>
+        </type>
+        <type category="struct" name="VkShaderModuleValidationCacheCreateInfoEXT" structextends="VkShaderModuleCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member><type>VkValidationCacheEXT</type>    <name>validationCache</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceMaintenance3Properties" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxPerSetDescriptors</name></member>
+            <member limittype="max"><type>VkDeviceSize</type>                     <name>maxMemoryAllocationSize</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceMaintenance3PropertiesKHR"               alias="VkPhysicalDeviceMaintenance3Properties"/>
+        <type category="struct" name="VkPhysicalDeviceMaintenance4FeaturesKHR" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkBool32</type>                                         <name>maintenance4</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceMaintenance4PropertiesKHR" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member limittype="max"><type>VkDeviceSize</type>                     <name>maxBufferSize</name></member>
+        </type>
+        <type category="struct" name="VkDescriptorSetLayoutSupport" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*            <name>pNext</name></member>
+            <member><type>VkBool32</type>         <name>supported</name></member>
+        </type>
+        <type category="struct" name="VkDescriptorSetLayoutSupportKHR"                         alias="VkDescriptorSetLayoutSupport"/>
+        <type category="struct" name="VkPhysicalDeviceShaderDrawParametersFeatures" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>shaderDrawParameters</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceShaderDrawParameterFeatures"             alias="VkPhysicalDeviceShaderDrawParametersFeatures"/>
+        <type category="struct" name="VkPhysicalDeviceShaderFloat16Int8Features" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo" optional="streamFeature:VULKAN_STREAM_FEATURE_SHADER_FLOAT16_INT8_BIT">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*      <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>shaderFloat16</name><comment>16-bit floats (halfs) in shaders</comment></member>
+            <member><type>VkBool32</type>                         <name>shaderInt8</name><comment>8-bit integers in shaders</comment></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceShaderFloat16Int8FeaturesKHR"            alias="VkPhysicalDeviceShaderFloat16Int8Features" optional="streamFeature:VULKAN_STREAM_FEATURE_SHADER_FLOAT16_INT8_BIT"/>
+        <type category="struct" name="VkPhysicalDeviceFloat16Int8FeaturesKHR"                  alias="VkPhysicalDeviceShaderFloat16Int8Features" optional="streamFeature:VULKAN_STREAM_FEATURE_SHADER_FLOAT16_INT8_BIT"/>
+        <type category="struct" name="VkPhysicalDeviceFloatControlsProperties" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member limittype="noauto"><type>VkShaderFloatControlsIndependence</type> <name>denormBehaviorIndependence</name></member>
+            <member limittype="noauto"><type>VkShaderFloatControlsIndependence</type> <name>roundingModeIndependence</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderSignedZeroInfNanPreserveFloat16</name><comment>An implementation can preserve signed zero, nan, inf</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderSignedZeroInfNanPreserveFloat32</name><comment>An implementation can preserve signed zero, nan, inf</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderSignedZeroInfNanPreserveFloat64</name><comment>An implementation can preserve signed zero, nan, inf</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderDenormPreserveFloat16</name><comment>An implementation can preserve  denormals</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderDenormPreserveFloat32</name><comment>An implementation can preserve  denormals</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderDenormPreserveFloat64</name><comment>An implementation can preserve  denormals</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderDenormFlushToZeroFloat16</name><comment>An implementation can flush to zero  denormals</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderDenormFlushToZeroFloat32</name><comment>An implementation can flush to zero  denormals</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderDenormFlushToZeroFloat64</name><comment>An implementation can flush to zero  denormals</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderRoundingModeRTEFloat16</name><comment>An implementation can support RTE</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderRoundingModeRTEFloat32</name><comment>An implementation can support RTE</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderRoundingModeRTEFloat64</name><comment>An implementation can support RTE</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderRoundingModeRTZFloat16</name><comment>An implementation can support RTZ</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderRoundingModeRTZFloat32</name><comment>An implementation can support RTZ</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderRoundingModeRTZFloat64</name><comment>An implementation can support RTZ</comment></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceFloatControlsPropertiesKHR"              alias="VkPhysicalDeviceFloatControlsProperties"/>
+        <type category="struct" name="VkPhysicalDeviceHostQueryResetFeatures" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>hostQueryReset</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceHostQueryResetFeaturesEXT"               alias="VkPhysicalDeviceHostQueryResetFeatures"/>
+        <type category="struct" name="VkNativeBufferANDROID" structextends="VkImageCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID"><type>VkStructureType</type> <name>sType</name></member>
+            <member>const <type>void</type>* <name>pNext</name></member>
+            <member noautovalidity="true">const <type>uint32_t</type>* <name>handle</name></member>
+            <member><type>int</type> <name>stride</name></member>
+            <member><type>int</type> <name>format</name></member>
+            <member><type>int</type> <name>usage</name></member>
+            <member><type>uint64_t</type> <name>consumer</name></member>
+            <member><type>uint64_t</type> <name>producer</name></member>
+        </type>
+        <type category="struct" name="VkShaderResourceUsageAMD" returnedonly="true">
+            <member><type>uint32_t</type> <name>numUsedVgprs</name></member>
+            <member><type>uint32_t</type> <name>numUsedSgprs</name></member>
+            <member><type>uint32_t</type> <name>ldsSizePerLocalWorkGroup</name></member>
+            <member><type>size_t</type> <name>ldsUsageSizeInBytes</name></member>
+            <member><type>size_t</type> <name>scratchMemUsageInBytes</name></member>
+        </type>
+        <type category="struct" name="VkShaderStatisticsInfoAMD" returnedonly="true">
+            <member><type>VkShaderStageFlags</type> <name>shaderStageMask</name></member>
+            <member><type>VkShaderResourceUsageAMD</type> <name>resourceUsage</name></member>
+            <member><type>uint32_t</type> <name>numPhysicalVgprs</name></member>
+            <member><type>uint32_t</type> <name>numPhysicalSgprs</name></member>
+            <member><type>uint32_t</type> <name>numAvailableVgprs</name></member>
+            <member><type>uint32_t</type> <name>numAvailableSgprs</name></member>
+            <member><type>uint32_t</type> <name>computeWorkGroupSize</name>[3]</member>
+        </type>
+        <type category="struct" name="VkDeviceQueueGlobalPriorityCreateInfoEXT" structextends="VkDeviceQueueCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                    <name>pNext</name></member>
+            <member><type>VkQueueGlobalPriorityEXT</type>       <name>globalPriority</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true" noautovalidity="true"><type>void</type>* <name>pNext</name></member>
+            <member><type>VkBool32</type>                    <name>globalPriorityQuery</name></member>
+        </type>
+        <type category="struct" name="VkQueueFamilyGlobalPriorityPropertiesEXT" structextends="VkQueueFamilyProperties2">
+            <member values="VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*    <name>pNext</name></member>
+            <member><type>uint32_t</type>                 <name>priorityCount</name></member>
+            <member><type>VkQueueGlobalPriorityEXT</type> <name>priorities</name>[<enum>VK_MAX_GLOBAL_PRIORITY_SIZE_EXT</enum>]</member>
+        </type>
+        <type category="struct" name="VkDebugUtilsObjectNameInfoEXT">
+            <member values="VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                            <name>pNext</name></member>
+            <member><type>VkObjectType</type>                                           <name>objectType</name></member>
+            <member objecttype="objectType"><type>uint64_t</type>                                               <name>objectHandle</name></member>
+            <member optional="true" len="null-terminated">const <type>char</type>*      <name>pObjectName</name></member>
+        </type>
+        <type category="struct" name="VkDebugUtilsObjectTagInfoEXT">
+            <member values="VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_TAG_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkObjectType</type>                           <name>objectType</name></member>
+            <member objecttype="objectType"><type>uint64_t</type>                               <name>objectHandle</name></member>
+            <member><type>uint64_t</type>                               <name>tagName</name></member>
+            <member><type>size_t</type>                                 <name>tagSize</name></member>
+            <member len="tagSize">const <type>void</type>*              <name>pTag</name></member>
+        </type>
+        <type category="struct" name="VkDebugUtilsLabelEXT">
+            <member values="VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                            <name>pNext</name></member>
+            <member len="null-terminated">const <type>char</type>*      <name>pLabelName</name></member>
+            <member><type>float</type>                  <name>color</name>[4]</member>
+        </type>
+        <type category="struct" name="VkDebugUtilsMessengerCreateInfoEXT" allowduplicate="true" structextends="VkInstanceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                          <name>pNext</name></member>
+            <member optional="true"><type>VkDebugUtilsMessengerCreateFlagsEXT</type>  <name>flags</name></member>
+            <member><type>VkDebugUtilsMessageSeverityFlagsEXT</type>                  <name>messageSeverity</name></member>
+            <member><type>VkDebugUtilsMessageTypeFlagsEXT</type>                      <name>messageType</name></member>
+            <member><type>PFN_vkDebugUtilsMessengerCallbackEXT</type>                 <name>pfnUserCallback</name></member>
+            <member optional="true"><type>void</type>*                                <name>pUserData</name></member>
+        </type>
+        <type category="struct" name="VkDebugUtilsMessengerCallbackDataEXT">
+            <member values="VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                        <name>pNext</name></member>
+            <member optional="true"><type>VkDebugUtilsMessengerCallbackDataFlagsEXT</type>                          <name>flags</name></member>
+            <member optional="true" len="null-terminated">const <type>char</type>*                                  <name>pMessageIdName</name></member>
+            <member><type>int32_t</type>                                                            <name>messageIdNumber</name></member>
+            <member len="null-terminated">const <type>char</type>*                                                  <name>pMessage</name></member>
+            <member optional="true"><type>uint32_t</type>                                                           <name>queueLabelCount</name></member>
+            <member noautovalidity="true" optional="true" len="queueLabelCount"><type>VkDebugUtilsLabelEXT</type>*  <name>pQueueLabels</name></member>
+            <member optional="true"><type>uint32_t</type>                                                           <name>cmdBufLabelCount</name></member>
+            <member noautovalidity="true" optional="true" len="cmdBufLabelCount"><type>VkDebugUtilsLabelEXT</type>* <name>pCmdBufLabels</name></member>
+            <member><type>uint32_t</type>                                                                           <name>objectCount</name></member>
+            <member noautovalidity="true" len="objectCount"><type>VkDebugUtilsObjectNameInfoEXT</type>*             <name>pObjects</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceDeviceMemoryReportFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>* <name>pNext</name></member>
+            <member><type>VkBool32</type>                    <name>deviceMemoryReport</name></member>
+        </type>
+        <type category="struct" name="VkDeviceDeviceMemoryReportCreateInfoEXT" allowduplicate="true" structextends="VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*         <name>pNext</name></member>
+            <member><type>VkDeviceMemoryReportFlagsEXT</type>        <name>flags</name></member>
+            <member><type>PFN_vkDeviceMemoryReportCallbackEXT</type> <name>pfnUserCallback</name></member>
+            <member><type>void</type>*                               <name>pUserData</name></member>
+        </type>
+        <type category="struct" name="VkDeviceMemoryReportCallbackDataEXT" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_DEVICE_MEMORY_REPORT_CALLBACK_DATA_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*            <name>pNext</name></member>
+            <member><type>VkDeviceMemoryReportFlagsEXT</type>     <name>flags</name></member>
+            <member><type>VkDeviceMemoryReportEventTypeEXT</type> <name>type</name></member>
+            <member><type>uint64_t</type>                         <name>memoryObjectId</name></member>
+            <member><type>VkDeviceSize</type>                     <name>size</name></member>
+            <member><type>VkObjectType</type>                     <name>objectType</name></member>
+            <member><type>uint64_t</type>                         <name>objectHandle</name></member>
+            <member><type>uint32_t</type>                         <name>heapIndex</name></member>
+        </type>
+        <type category="struct" name="VkImportMemoryHostPointerInfoEXT" structextends="VkMemoryAllocateInfo">
+            <member values="VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>* <name>pNext</name></member>
+            <member><type>VkExternalMemoryHandleTypeFlagBits</type> <name>handleType</name></member>
+            <member optional="false"><type>void</type>* <name>pHostPointer</name></member>
+        </type>
+        <type category="struct" name="VkMemoryHostPointerPropertiesEXT" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>* <name>pNext</name></member>
+            <member devicememorytypebits="1"><type>uint32_t</type> <name>memoryTypeBits</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceExternalMemoryHostPropertiesEXT" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>* <name>pNext</name></member>
+            <member limittype="noauto"><type>VkDeviceSize</type> <name>minImportedHostPointerAlignment</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceConservativeRasterizationPropertiesEXT" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                  <name>pNext</name></member>
+            <member limittype="noauto"><type>float</type>                  <name>primitiveOverestimationSize</name><comment>The size in pixels the primitive is enlarged at each edge during conservative rasterization</comment></member>
+            <member limittype="max"><type>float</type>                  <name>maxExtraPrimitiveOverestimationSize</name><comment>The maximum additional overestimation the client can specify in the pipeline state</comment></member>
+            <member limittype="noauto"><type>float</type>                  <name>extraPrimitiveOverestimationSizeGranularity</name><comment>The granularity of extra overestimation sizes the implementations supports between 0 and maxExtraOverestimationSize</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>primitiveUnderestimation</name><comment>true if the implementation supports conservative rasterization underestimation mode</comment></member>
+            <member limittype="noauto"><type>VkBool32</type>               <name>conservativePointAndLineRasterization</name><comment>true if conservative rasterization also applies to points and lines</comment></member>
+            <member limittype="noauto"><type>VkBool32</type>               <name>degenerateTrianglesRasterized</name><comment>true if degenerate triangles (those with zero area after snap) are rasterized</comment></member>
+            <member limittype="noauto"><type>VkBool32</type>               <name>degenerateLinesRasterized</name><comment>true if degenerate lines (those with zero length after snap) are rasterized</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>fullyCoveredFragmentShaderInputVariable</name><comment>true if the implementation supports the FullyCoveredEXT SPIR-V builtin fragment shader input variable</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>conservativeRasterizationPostDepthCoverage</name><comment>true if the implementation supports both conservative rasterization and post depth coverage sample coverage mask</comment></member>
+        </type>
+        <type category="struct" name="VkCalibratedTimestampInfoEXT">
+            <member values="VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member><type>VkTimeDomainEXT</type>        <name>timeDomain</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceShaderCorePropertiesAMD" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*    <name>pNext</name></member>
+            <member limittype="noauto"><type>uint32_t</type> <name>shaderEngineCount</name><comment>number of shader engines</comment></member>
+            <member limittype="noauto"><type>uint32_t</type> <name>shaderArraysPerEngineCount</name><comment>number of shader arrays</comment></member>
+            <member limittype="noauto"><type>uint32_t</type> <name>computeUnitsPerShaderArray</name><comment>number of physical CUs per shader array</comment></member>
+            <member limittype="noauto"><type>uint32_t</type> <name>simdPerComputeUnit</name><comment>number of SIMDs per compute unit</comment></member>
+            <member limittype="noauto"><type>uint32_t</type> <name>wavefrontsPerSimd</name><comment>number of wavefront slots in each SIMD</comment></member>
+            <member limittype="noauto"><type>uint32_t</type> <name>wavefrontSize</name><comment>maximum number of threads per wavefront</comment></member>
+            <member limittype="noauto"><type>uint32_t</type> <name>sgprsPerSimd</name><comment>number of physical SGPRs per SIMD</comment></member>
+            <member limittype="min"><type>uint32_t</type> <name>minSgprAllocation</name><comment>minimum number of SGPRs that can be allocated by a wave</comment></member>
+            <member limittype="max"><type>uint32_t</type> <name>maxSgprAllocation</name><comment>number of available SGPRs</comment></member>
+            <member limittype="noauto"><type>uint32_t</type> <name>sgprAllocationGranularity</name><comment>SGPRs are allocated in groups of this size</comment></member>
+            <member limittype="noauto"><type>uint32_t</type> <name>vgprsPerSimd</name><comment>number of physical VGPRs per SIMD</comment></member>
+            <member limittype="min"><type>uint32_t</type> <name>minVgprAllocation</name><comment>minimum number of VGPRs that can be allocated by a wave</comment></member>
+            <member limittype="max"><type>uint32_t</type> <name>maxVgprAllocation</name><comment>number of available VGPRs</comment></member>
+            <member limittype="noauto"><type>uint32_t</type> <name>vgprAllocationGranularity</name><comment>VGPRs are allocated in groups of this size</comment></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceShaderCoreProperties2AMD" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*    <name>pNext</name><comment>Pointer to next structure</comment></member>
+            <member limittype="bitmask"><type>VkShaderCorePropertiesFlagsAMD</type> <name>shaderCoreFeatures</name><comment>features supported by the shader core</comment></member>
+            <member limittype="max"><type>uint32_t</type> <name>activeComputeUnitCount</name><comment>number of active compute units across all shader engines/arrays</comment></member>
+        </type>
+        <type category="struct" name="VkPipelineRasterizationConservativeStateCreateInfoEXT" structextends="VkPipelineRasterizationStateCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                                      <name>pNext</name></member>
+            <member optional="true"><type>VkPipelineRasterizationConservativeStateCreateFlagsEXT</type>           <name>flags</name><comment>Reserved</comment></member>
+            <member><type>VkConservativeRasterizationModeEXT</type>                                               <name>conservativeRasterizationMode</name><comment>Conservative rasterization mode</comment></member>
+            <member><type>float</type>                                                                            <name>extraPrimitiveOverestimationSize</name><comment>Extra overestimation to add to the primitive</comment></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceDescriptorIndexingFeatures" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkBool32</type>               <name>shaderInputAttachmentArrayDynamicIndexing</name></member>
+            <member><type>VkBool32</type>               <name>shaderUniformTexelBufferArrayDynamicIndexing</name></member>
+            <member><type>VkBool32</type>               <name>shaderStorageTexelBufferArrayDynamicIndexing</name></member>
+            <member><type>VkBool32</type>               <name>shaderUniformBufferArrayNonUniformIndexing</name></member>
+            <member><type>VkBool32</type>               <name>shaderSampledImageArrayNonUniformIndexing</name></member>
+            <member><type>VkBool32</type>               <name>shaderStorageBufferArrayNonUniformIndexing</name></member>
+            <member><type>VkBool32</type>               <name>shaderStorageImageArrayNonUniformIndexing</name></member>
+            <member><type>VkBool32</type>               <name>shaderInputAttachmentArrayNonUniformIndexing</name></member>
+            <member><type>VkBool32</type>               <name>shaderUniformTexelBufferArrayNonUniformIndexing</name></member>
+            <member><type>VkBool32</type>               <name>shaderStorageTexelBufferArrayNonUniformIndexing</name></member>
+            <member><type>VkBool32</type>               <name>descriptorBindingUniformBufferUpdateAfterBind</name></member>
+            <member><type>VkBool32</type>               <name>descriptorBindingSampledImageUpdateAfterBind</name></member>
+            <member><type>VkBool32</type>               <name>descriptorBindingStorageImageUpdateAfterBind</name></member>
+            <member><type>VkBool32</type>               <name>descriptorBindingStorageBufferUpdateAfterBind</name></member>
+            <member><type>VkBool32</type>               <name>descriptorBindingUniformTexelBufferUpdateAfterBind</name></member>
+            <member><type>VkBool32</type>               <name>descriptorBindingStorageTexelBufferUpdateAfterBind</name></member>
+            <member><type>VkBool32</type>               <name>descriptorBindingUpdateUnusedWhilePending</name></member>
+            <member><type>VkBool32</type>               <name>descriptorBindingPartiallyBound</name></member>
+            <member><type>VkBool32</type>               <name>descriptorBindingVariableDescriptorCount</name></member>
+            <member><type>VkBool32</type>               <name>runtimeDescriptorArray</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceDescriptorIndexingFeaturesEXT"           alias="VkPhysicalDeviceDescriptorIndexingFeatures"/>
+        <type category="struct" name="VkPhysicalDeviceDescriptorIndexingProperties" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxUpdateAfterBindDescriptorsInAllPools</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>shaderUniformBufferArrayNonUniformIndexingNative</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>shaderSampledImageArrayNonUniformIndexingNative</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>shaderStorageBufferArrayNonUniformIndexingNative</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>shaderStorageImageArrayNonUniformIndexingNative</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>shaderInputAttachmentArrayNonUniformIndexingNative</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>robustBufferAccessUpdateAfterBind</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>quadDivergentImplicitLod</name></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxPerStageDescriptorUpdateAfterBindSamplers</name></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxPerStageDescriptorUpdateAfterBindUniformBuffers</name></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxPerStageDescriptorUpdateAfterBindStorageBuffers</name></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxPerStageDescriptorUpdateAfterBindSampledImages</name></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxPerStageDescriptorUpdateAfterBindStorageImages</name></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxPerStageDescriptorUpdateAfterBindInputAttachments</name></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxPerStageUpdateAfterBindResources</name></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxDescriptorSetUpdateAfterBindSamplers</name></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxDescriptorSetUpdateAfterBindUniformBuffers</name></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxDescriptorSetUpdateAfterBindUniformBuffersDynamic</name></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxDescriptorSetUpdateAfterBindStorageBuffers</name></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxDescriptorSetUpdateAfterBindStorageBuffersDynamic</name></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxDescriptorSetUpdateAfterBindSampledImages</name></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxDescriptorSetUpdateAfterBindStorageImages</name></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxDescriptorSetUpdateAfterBindInputAttachments</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceDescriptorIndexingPropertiesEXT"         alias="VkPhysicalDeviceDescriptorIndexingProperties"/>
+        <type category="struct" name="VkDescriptorSetLayoutBindingFlagsCreateInfo" structextends="VkDescriptorSetLayoutCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                        <name>pNext</name></member>
+            <member optional="true"><type>uint32_t</type>                                           <name>bindingCount</name></member>
+            <member len="bindingCount" optional="false,true">const <type>VkDescriptorBindingFlags</type>* <name>pBindingFlags</name></member>
+        </type>
+        <type category="struct" name="VkDescriptorSetLayoutBindingFlagsCreateInfoEXT"          alias="VkDescriptorSetLayoutBindingFlagsCreateInfo"/>
+        <type category="struct" name="VkDescriptorSetVariableDescriptorCountAllocateInfo" structextends="VkDescriptorSetAllocateInfo">
+            <member values="VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                            <name>pNext</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>descriptorSetCount</name></member>
+            <member len="descriptorSetCount">const <type>uint32_t</type>* <name>pDescriptorCounts</name></member>
+        </type>
+        <type category="struct" name="VkDescriptorSetVariableDescriptorCountAllocateInfoEXT"   alias="VkDescriptorSetVariableDescriptorCountAllocateInfo"/>
+        <type category="struct" name="VkDescriptorSetVariableDescriptorCountLayoutSupport" structextends="VkDescriptorSetLayoutSupport" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*            <name>pNext</name></member>
+            <member><type>uint32_t</type>         <name>maxVariableDescriptorCount</name></member>
+        </type>
+        <type category="struct" name="VkDescriptorSetVariableDescriptorCountLayoutSupportEXT"  alias="VkDescriptorSetVariableDescriptorCountLayoutSupport"/>
+        <type category="struct" name="VkAttachmentDescription2">
+            <member values="VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkAttachmentDescriptionFlags</type> <name>flags</name></member>
+            <member><type>VkFormat</type>                                     <name>format</name></member>
+            <member><type>VkSampleCountFlagBits</type>                        <name>samples</name></member>
+            <member><type>VkAttachmentLoadOp</type>                           <name>loadOp</name><comment>Load operation for color or depth data</comment></member>
+            <member><type>VkAttachmentStoreOp</type>                          <name>storeOp</name><comment>Store operation for color or depth data</comment></member>
+            <member><type>VkAttachmentLoadOp</type>                           <name>stencilLoadOp</name><comment>Load operation for stencil data</comment></member>
+            <member><type>VkAttachmentStoreOp</type>                          <name>stencilStoreOp</name><comment>Store operation for stencil data</comment></member>
+            <member><type>VkImageLayout</type>                                <name>initialLayout</name></member>
+            <member><type>VkImageLayout</type>                                <name>finalLayout</name></member>
+        </type>
+        <type category="struct" name="VkAttachmentDescription2KHR"                             alias="VkAttachmentDescription2"/>
+        <type category="struct" name="VkAttachmentReference2">
+            <member values="VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>* <name>pNext</name></member>
+            <member><type>uint32_t</type>                          <name>attachment</name></member>
+            <member><type>VkImageLayout</type>                     <name>layout</name></member>
+            <member noautovalidity="true"><type>VkImageAspectFlags</type> <name>aspectMask</name></member>
+        </type>
+        <type category="struct" name="VkAttachmentReference2KHR"                               alias="VkAttachmentReference2"/>
+        <type category="struct" name="VkSubpassDescription2">
+            <member values="VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                           <name>pNext</name></member>
+            <member optional="true"><type>VkSubpassDescriptionFlags</type>                   <name>flags</name></member>
+            <member><type>VkPipelineBindPoint</type>                                         <name>pipelineBindPoint</name></member>
+            <member><type>uint32_t</type>                                                    <name>viewMask</name></member>
+            <member optional="true"><type>uint32_t</type>                                    <name>inputAttachmentCount</name></member>
+            <member len="inputAttachmentCount">const <type>VkAttachmentReference2</type>*    <name>pInputAttachments</name></member>
+            <member optional="true"><type>uint32_t</type>                                    <name>colorAttachmentCount</name></member>
+            <member len="colorAttachmentCount">const <type>VkAttachmentReference2</type>*    <name>pColorAttachments</name></member>
+            <member optional="true" len="colorAttachmentCount">const <type>VkAttachmentReference2</type>* <name>pResolveAttachments</name></member>
+            <member optional="true">const <type>VkAttachmentReference2</type>*               <name>pDepthStencilAttachment</name></member>
+            <member optional="true"><type>uint32_t</type>                                    <name>preserveAttachmentCount</name></member>
+            <member len="preserveAttachmentCount">const <type>uint32_t</type>*               <name>pPreserveAttachments</name></member>
+        </type>
+        <type category="struct" name="VkSubpassDescription2KHR"                                alias="VkSubpassDescription2"/>
+        <type category="struct" name="VkSubpassDependency2">
+            <member values="VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>* <name>pNext</name></member>
+            <member><type>uint32_t</type>                          <name>srcSubpass</name></member>
+            <member><type>uint32_t</type>                          <name>dstSubpass</name></member>
+            <member optional="true"><type>VkPipelineStageFlags</type> <name>srcStageMask</name></member>
+            <member optional="true"><type>VkPipelineStageFlags</type> <name>dstStageMask</name></member>
+            <member optional="true"><type>VkAccessFlags</type>     <name>srcAccessMask</name></member>
+            <member optional="true"><type>VkAccessFlags</type>     <name>dstAccessMask</name></member>
+            <member optional="true"><type>VkDependencyFlags</type> <name>dependencyFlags</name></member>
+            <member><type>int32_t</type>                           <name>viewOffset</name></member>
+        </type>
+        <type category="struct" name="VkSubpassDependency2KHR"                                 alias="VkSubpassDependency2"/>
+        <type category="struct" name="VkRenderPassCreateInfo2">
+            <member values="VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                              <name>pNext</name></member>
+            <member optional="true"><type>VkRenderPassCreateFlags</type>                  <name>flags</name></member>
+            <member optional="true"><type>uint32_t</type>                                 <name>attachmentCount</name></member>
+            <member len="attachmentCount">const <type>VkAttachmentDescription2</type>*    <name>pAttachments</name></member>
+            <member><type>uint32_t</type>                                                 <name>subpassCount</name></member>
+            <member len="subpassCount">const <type>VkSubpassDescription2</type>*          <name>pSubpasses</name></member>
+            <member optional="true"><type>uint32_t</type>                                 <name>dependencyCount</name></member>
+            <member len="dependencyCount">const <type>VkSubpassDependency2</type>*        <name>pDependencies</name></member>
+            <member optional="true"><type>uint32_t</type>                                 <name>correlatedViewMaskCount</name></member>
+            <member len="correlatedViewMaskCount">const <type>uint32_t</type>*            <name>pCorrelatedViewMasks</name></member>
+        </type>
+        <type category="struct" name="VkRenderPassCreateInfo2KHR"                              alias="VkRenderPassCreateInfo2"/>
+        <type category="struct" name="VkSubpassBeginInfo">
+            <member values="VK_STRUCTURE_TYPE_SUBPASS_BEGIN_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member><type>VkSubpassContents</type>      <name>contents</name></member>
+        </type>
+        <type category="struct" name="VkSubpassBeginInfoKHR"                                   alias="VkSubpassBeginInfo"/>
+        <type category="struct" name="VkSubpassEndInfo">
+            <member values="VK_STRUCTURE_TYPE_SUBPASS_END_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+        </type>
+        <type category="struct" name="VkSubpassEndInfoKHR"                                     alias="VkSubpassEndInfo"/>
+        <type category="struct" name="VkPhysicalDeviceTimelineSemaphoreFeatures" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                  <name>pNext</name></member>
+            <member><type>VkBool32</type>               <name>timelineSemaphore</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceTimelineSemaphoreFeaturesKHR"            alias="VkPhysicalDeviceTimelineSemaphoreFeatures"/>
+        <type category="struct" name="VkPhysicalDeviceTimelineSemaphoreProperties" structextends="VkPhysicalDeviceProperties2" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                  <name>pNext</name></member>
+            <member limittype="max"><type>uint64_t</type>               <name>maxTimelineSemaphoreValueDifference</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceTimelineSemaphorePropertiesKHR"          alias="VkPhysicalDeviceTimelineSemaphoreProperties"/>
+        <type category="struct" name="VkSemaphoreTypeCreateInfo" structextends="VkSemaphoreCreateInfo,VkPhysicalDeviceExternalSemaphoreInfo">
+            <member values="VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member><type>VkSemaphoreType</type>        <name>semaphoreType</name></member>
+            <member><type>uint64_t</type>               <name>initialValue</name></member>
+        </type>
+        <type category="struct" name="VkSemaphoreTypeCreateInfoKHR"                            alias="VkSemaphoreTypeCreateInfo"/>
+        <type category="struct" name="VkTimelineSemaphoreSubmitInfo" structextends="VkSubmitInfo,VkBindSparseInfo">
+            <member values="VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member optional="true"><type>uint32_t</type>         <name>waitSemaphoreValueCount</name></member>
+            <member optional="true" len="waitSemaphoreValueCount">const <type>uint64_t</type>* <name>pWaitSemaphoreValues</name></member>
+            <member optional="true"><type>uint32_t</type>         <name>signalSemaphoreValueCount</name></member>
+            <member optional="true" len="signalSemaphoreValueCount">const <type>uint64_t</type>* <name>pSignalSemaphoreValues</name></member>
+        </type>
+        <type category="struct" name="VkTimelineSemaphoreSubmitInfoKHR"                        alias="VkTimelineSemaphoreSubmitInfo"/>
+        <type category="struct" name="VkSemaphoreWaitInfo">
+            <member values="VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkSemaphoreWaitFlags</type> <name>flags</name></member>
+            <member><type>uint32_t</type>               <name>semaphoreCount</name></member>
+            <member len="semaphoreCount">const <type>VkSemaphore</type>* <name>pSemaphores</name></member>
+            <member len="semaphoreCount">const <type>uint64_t</type>*    <name>pValues</name></member>
+        </type>
+        <type category="struct" name="VkSemaphoreWaitInfoKHR"                                  alias="VkSemaphoreWaitInfo"/>
+        <type category="struct" name="VkSemaphoreSignalInfo">
+            <member values="VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member><type>VkSemaphore</type>            <name>semaphore</name></member>
+            <member><type>uint64_t</type>               <name>value</name></member>
+        </type>
+        <type category="struct" name="VkSemaphoreSignalInfoKHR"                                alias="VkSemaphoreSignalInfo"/>
+        <type category="struct" name="VkVertexInputBindingDivisorDescriptionEXT">
+            <member><type>uint32_t</type>          <name>binding</name></member>
+            <member><type>uint32_t</type>          <name>divisor</name></member>
+        </type>
+        <type category="struct" name="VkPipelineVertexInputDivisorStateCreateInfoEXT" structextends="VkPipelineVertexInputStateCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                         <name>pNext</name></member>
+            <member><type>uint32_t</type>                            <name>vertexBindingDivisorCount</name></member>
+            <member len="vertexBindingDivisorCount">const <type>VkVertexInputBindingDivisorDescriptionEXT</type>*      <name>pVertexBindingDivisors</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                  <name>pNext</name></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxVertexAttribDivisor</name><comment>max value of vertex attribute divisor</comment></member>
+        </type>
+        <type category="struct" name="VkPhysicalDevicePCIBusInfoPropertiesEXT" structextends="VkPhysicalDeviceProperties2" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                  <name>pNext</name></member>
+            <member limittype="noauto"><type>uint32_t</type>               <name>pciDomain</name></member>
+            <member limittype="noauto"><type>uint32_t</type>               <name>pciBus</name></member>
+            <member limittype="noauto"><type>uint32_t</type>               <name>pciDevice</name></member>
+            <member limittype="noauto"><type>uint32_t</type>               <name>pciFunction</name></member>
+        </type>
+        <type category="struct" name="VkImportAndroidHardwareBufferInfoANDROID" structextends="VkMemoryAllocateInfo">
+            <member values="VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                        <name>pNext</name></member>
+            <member>struct <type>AHardwareBuffer</type>*            <name>buffer</name></member>
+        </type>
+        <type category="struct" name="VkAndroidHardwareBufferUsageANDROID" structextends="VkImageFormatProperties2" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                              <name>pNext</name></member>
+            <member><type>uint64_t</type>                           <name>androidHardwareBufferUsage</name></member>
+        </type>
+        <type category="struct" name="VkAndroidHardwareBufferPropertiesANDROID" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                              <name>pNext</name></member>
+            <member><type>VkDeviceSize</type>                       <name>allocationSize</name></member>
+            <member devicememorytypebits="1"><type>uint32_t</type>                           <name>memoryTypeBits</name></member>
+        </type>
+        <type category="struct" name="VkMemoryGetAndroidHardwareBufferInfoANDROID">
+            <member values="VK_STRUCTURE_TYPE_MEMORY_GET_ANDROID_HARDWARE_BUFFER_INFO_ANDROID"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                        <name>pNext</name></member>
+            <member devicememoryhandle="1"><type>VkDeviceMemory</type>                     <name>memory</name></member>
+        </type>
+        <type category="struct" name="VkAndroidHardwareBufferFormatPropertiesANDROID" structextends="VkAndroidHardwareBufferPropertiesANDROID" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                              <name>pNext</name></member>
+            <member><type>VkFormat</type>                           <name>format</name></member>
+            <member><type>uint64_t</type>                           <name>externalFormat</name></member>
+            <member><type>VkFormatFeatureFlags</type>               <name>formatFeatures</name></member>
+            <member><type>VkComponentMapping</type>                 <name>samplerYcbcrConversionComponents</name></member>
+            <member><type>VkSamplerYcbcrModelConversion</type>      <name>suggestedYcbcrModel</name></member>
+            <member><type>VkSamplerYcbcrRange</type>                <name>suggestedYcbcrRange</name></member>
+            <member><type>VkChromaLocation</type>                   <name>suggestedXChromaOffset</name></member>
+            <member><type>VkChromaLocation</type>                   <name>suggestedYChromaOffset</name></member>
+        </type>
+        <type category="struct" name="VkCommandBufferInheritanceConditionalRenderingInfoEXT" structextends="VkCommandBufferInheritanceInfo">
+            <member values="VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                         <name>pNext</name></member>
+            <member><type>VkBool32</type>                            <name>conditionalRenderingEnable</name><comment>Whether this secondary command buffer may be executed during an active conditional rendering</comment></member>
+        </type>
+        <type category="struct" name="VkExternalFormatANDROID" structextends="VkImageCreateInfo,VkSamplerYcbcrConversionCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                              <name>pNext</name></member>
+            <member><type>uint64_t</type>                           <name>externalFormat</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDevice8BitStorageFeatures" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*      <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>storageBuffer8BitAccess</name><comment>8-bit integer variables supported in StorageBuffer</comment></member>
+            <member><type>VkBool32</type>                         <name>uniformAndStorageBuffer8BitAccess</name><comment>8-bit integer variables supported in StorageBuffer and Uniform</comment></member>
+            <member><type>VkBool32</type>                         <name>storagePushConstant8</name><comment>8-bit integer variables supported in PushConstant</comment></member>
+        </type>
+        <type category="struct" name="VkPhysicalDevice8BitStorageFeaturesKHR"                  alias="VkPhysicalDevice8BitStorageFeatures"/>
+        <type category="struct" name="VkPhysicalDeviceConditionalRenderingFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>conditionalRendering</name></member>
+            <member><type>VkBool32</type>                           <name>inheritedConditionalRendering</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceVulkanMemoryModelFeatures" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*      <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>vulkanMemoryModel</name></member>
+            <member><type>VkBool32</type>                         <name>vulkanMemoryModelDeviceScope</name></member>
+            <member><type>VkBool32</type>                         <name>vulkanMemoryModelAvailabilityVisibilityChains</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceVulkanMemoryModelFeaturesKHR"            alias="VkPhysicalDeviceVulkanMemoryModelFeatures"/>
+        <type category="struct" name="VkPhysicalDeviceShaderAtomicInt64Features" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                               <name>pNext</name></member>
+            <member><type>VkBool32</type>                            <name>shaderBufferInt64Atomics</name></member>
+            <member><type>VkBool32</type>                            <name>shaderSharedInt64Atomics</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceShaderAtomicInt64FeaturesKHR"            alias="VkPhysicalDeviceShaderAtomicInt64Features"/>
+        <type category="struct" name="VkPhysicalDeviceShaderAtomicFloatFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                               <name>pNext</name></member>
+            <member><type>VkBool32</type>                            <name>shaderBufferFloat32Atomics</name></member>
+            <member><type>VkBool32</type>                            <name>shaderBufferFloat32AtomicAdd</name></member>
+            <member><type>VkBool32</type>                            <name>shaderBufferFloat64Atomics</name></member>
+            <member><type>VkBool32</type>                            <name>shaderBufferFloat64AtomicAdd</name></member>
+            <member><type>VkBool32</type>                            <name>shaderSharedFloat32Atomics</name></member>
+            <member><type>VkBool32</type>                            <name>shaderSharedFloat32AtomicAdd</name></member>
+            <member><type>VkBool32</type>                            <name>shaderSharedFloat64Atomics</name></member>
+            <member><type>VkBool32</type>                            <name>shaderSharedFloat64AtomicAdd</name></member>
+            <member><type>VkBool32</type>                            <name>shaderImageFloat32Atomics</name></member>
+            <member><type>VkBool32</type>                            <name>shaderImageFloat32AtomicAdd</name></member>
+            <member><type>VkBool32</type>                            <name>sparseImageFloat32Atomics</name></member>
+            <member><type>VkBool32</type>                            <name>sparseImageFloat32AtomicAdd</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                               <name>pNext</name></member>
+            <member><type>VkBool32</type>                            <name>shaderBufferFloat16Atomics</name></member>
+            <member><type>VkBool32</type>                            <name>shaderBufferFloat16AtomicAdd</name></member>
+            <member><type>VkBool32</type>                            <name>shaderBufferFloat16AtomicMinMax</name></member>
+            <member><type>VkBool32</type>                            <name>shaderBufferFloat32AtomicMinMax</name></member>
+            <member><type>VkBool32</type>                            <name>shaderBufferFloat64AtomicMinMax</name></member>
+            <member><type>VkBool32</type>                            <name>shaderSharedFloat16Atomics</name></member>
+            <member><type>VkBool32</type>                            <name>shaderSharedFloat16AtomicAdd</name></member>
+            <member><type>VkBool32</type>                            <name>shaderSharedFloat16AtomicMinMax</name></member>
+            <member><type>VkBool32</type>                            <name>shaderSharedFloat32AtomicMinMax</name></member>
+            <member><type>VkBool32</type>                            <name>shaderSharedFloat64AtomicMinMax</name></member>
+            <member><type>VkBool32</type>                            <name>shaderImageFloat32AtomicMinMax</name></member>
+            <member><type>VkBool32</type>                            <name>sparseImageFloat32AtomicMinMax</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>vertexAttributeInstanceRateDivisor</name></member>
+            <member><type>VkBool32</type>                           <name>vertexAttributeInstanceRateZeroDivisor</name></member>
+        </type>
+        <type category="struct" name="VkQueueFamilyCheckpointPropertiesNV" structextends="VkQueueFamilyProperties2" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*           <name>pNext</name></member>
+            <member><type>VkPipelineStageFlags</type> <name>checkpointExecutionStageMask</name></member>
+        </type>
+        <type category="struct" name="VkCheckpointDataNV" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_CHECKPOINT_DATA_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                  <name>pNext</name></member>
+            <member><type>VkPipelineStageFlagBits</type>   <name>stage</name></member>
+            <member noautovalidity="true"><type>void</type>* <name>pCheckpointMarker</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceDepthStencilResolveProperties" structextends="VkPhysicalDeviceProperties2" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                                <name>pNext</name></member>
+            <member limittype="bitmask"><type>VkResolveModeFlags</type>                   <name>supportedDepthResolveModes</name><comment>supported depth resolve modes</comment></member>
+            <member limittype="bitmask"><type>VkResolveModeFlags</type>                   <name>supportedStencilResolveModes</name><comment>supported stencil resolve modes</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                             <name>independentResolveNone</name><comment>depth and stencil resolve modes can be set independently if one of them is none</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                             <name>independentResolve</name><comment>depth and stencil resolve modes can be set independently</comment></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceDepthStencilResolvePropertiesKHR"        alias="VkPhysicalDeviceDepthStencilResolveProperties"/>
+        <type category="struct" name="VkSubpassDescriptionDepthStencilResolve" structextends="VkSubpassDescription2">
+            <member values="VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                              <name>pNext</name></member>
+            <member noautovalidity="true"><type>VkResolveModeFlagBits</type>              <name>depthResolveMode</name><comment>depth resolve mode</comment></member>
+            <member noautovalidity="true"><type>VkResolveModeFlagBits</type>              <name>stencilResolveMode</name><comment>stencil resolve mode</comment></member>
+            <member optional="true">const <type>VkAttachmentReference2</type>*            <name>pDepthStencilResolveAttachment</name><comment>depth/stencil resolve attachment</comment></member>
+        </type>
+        <type category="struct" name="VkSubpassDescriptionDepthStencilResolveKHR"              alias="VkSubpassDescriptionDepthStencilResolve"/>
+        <type category="struct" name="VkImageViewASTCDecodeModeEXT" structextends="VkImageViewCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkFormat</type>                         <name>decodeMode</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceASTCDecodeFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*      <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>decodeModeSharedExponent</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceTransformFeedbackFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                  <name>pNext</name></member>
+            <member><type>VkBool32</type>               <name>transformFeedback</name></member>
+            <member><type>VkBool32</type>               <name>geometryStreams</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceTransformFeedbackPropertiesEXT" structextends="VkPhysicalDeviceProperties2" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                  <name>pNext</name></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxTransformFeedbackStreams</name></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxTransformFeedbackBuffers</name></member>
+            <member limittype="max"><type>VkDeviceSize</type>           <name>maxTransformFeedbackBufferSize</name></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxTransformFeedbackStreamDataSize</name></member>
+            <member limittype="max"><type>uint32_t</type>               <name>maxTransformFeedbackBufferDataSize</name></member>
+            <member limittype="noauto"><type>uint32_t</type>               <name>maxTransformFeedbackBufferDataStride</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>transformFeedbackQueries</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>transformFeedbackStreamsLinesTriangles</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>transformFeedbackRasterizationStreamSelect</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>transformFeedbackDraw</name></member>
+        </type>
+        <type category="struct" name="VkPipelineRasterizationStateStreamCreateInfoEXT" structextends="VkPipelineRasterizationStateCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                                      <name>pNext</name></member>
+            <member optional="true"><type>VkPipelineRasterizationStateStreamCreateFlagsEXT</type>                 <name>flags</name></member>
+            <member><type>uint32_t</type>                                                                         <name>rasterizationStream</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true"><type>void</type>*    <name>pNext</name></member>
+            <member><type>VkBool32</type>                       <name>representativeFragmentTest</name></member>
+        </type>
+        <type category="struct" name="VkPipelineRepresentativeFragmentTestStateCreateInfoNV" structextends="VkGraphicsPipelineCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*    <name>pNext</name></member>
+            <member><type>VkBool32</type>       <name>representativeFragmentTestEnable</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceExclusiveScissorFeaturesNV" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>exclusiveScissor</name></member>
+        </type>
+        <type category="struct" name="VkPipelineViewportExclusiveScissorStateCreateInfoNV" structextends="VkPipelineViewportStateCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                       <name>pNext</name></member>
+            <member optional="true"><type>uint32_t</type>                                          <name>exclusiveScissorCount</name></member>
+            <member noautovalidity="true" len="exclusiveScissorCount">const <type>VkRect2D</type>* <name>pExclusiveScissors</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceCornerSampledImageFeaturesNV" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                              <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>cornerSampledImage</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceComputeShaderDerivativesFeaturesNV" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>computeDerivativeGroupQuads</name></member>
+            <member><type>VkBool32</type>                         <name>computeDerivativeGroupLinear</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>fragmentShaderBarycentric</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceShaderImageFootprintFeaturesNV" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                              <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>imageFootprint</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>dedicatedAllocationImageAliasing</name></member>
+        </type>
+        <type category="struct" name="VkShadingRatePaletteNV">
+            <member><type>uint32_t</type>                                                               <name>shadingRatePaletteEntryCount</name></member>
+            <member len="shadingRatePaletteEntryCount">const <type>VkShadingRatePaletteEntryNV</type>*  <name>pShadingRatePaletteEntries</name></member>
+        </type>
+        <type category="struct" name="VkPipelineViewportShadingRateImageStateCreateInfoNV" structextends="VkPipelineViewportStateCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                             <name>pNext</name></member>
+            <member><type>VkBool32</type>                                                                <name>shadingRateImageEnable</name></member>
+            <member optional="true"><type>uint32_t</type>                                                <name>viewportCount</name></member>
+            <member noautovalidity="true" len="viewportCount">const <type>VkShadingRatePaletteNV</type>* <name>pShadingRatePalettes</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceShadingRateImageFeaturesNV" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                               <name>pNext</name></member>
+            <member><type>VkBool32</type>                            <name>shadingRateImage</name></member>
+            <member><type>VkBool32</type>                            <name>shadingRateCoarseSampleOrder</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceShadingRateImagePropertiesNV" structextends="VkPhysicalDeviceProperties2" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                               <name>pNext</name></member>
+            <member limittype="noauto"><type>VkExtent2D</type>                          <name>shadingRateTexelSize</name></member>
+            <member limittype="max"><type>uint32_t</type>                            <name>shadingRatePaletteSize</name></member>
+            <member limittype="max"><type>uint32_t</type>                            <name>shadingRateMaxCoarseSamples</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceInvocationMaskFeaturesHUAWEI" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                               <name>pNext</name></member>
+            <member><type>VkBool32</type>                            <name>invocationMask</name></member>
+        </type>
+        <type category="struct" name="VkCoarseSampleLocationNV">
+            <member><type>uint32_t</type>                            <name>pixelX</name></member>
+            <member><type>uint32_t</type>                            <name>pixelY</name></member>
+            <member><type>uint32_t</type>                            <name>sample</name></member>
+        </type>
+        <type category="struct" name="VkCoarseSampleOrderCustomNV">
+            <member><type>VkShadingRatePaletteEntryNV</type>         <name>shadingRate</name></member>
+            <member><type>uint32_t</type>                            <name>sampleCount</name></member>
+            <member><type>uint32_t</type>                            <name>sampleLocationCount</name></member>
+            <member len="sampleLocationCount">const <type>VkCoarseSampleLocationNV</type>* <name>pSampleLocations</name></member>
+        </type>
+        <type category="struct" name="VkPipelineViewportCoarseSampleOrderStateCreateInfoNV" structextends="VkPipelineViewportStateCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                            <name>pNext</name></member>
+            <member><type>VkCoarseSampleOrderTypeNV</type>                                              <name>sampleOrderType</name></member>
+            <member optional="true"><type>uint32_t</type>                                               <name>customSampleOrderCount</name></member>
+            <member len="customSampleOrderCount">const <type>VkCoarseSampleOrderCustomNV</type>*        <name>pCustomSampleOrders</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceMeshShaderFeaturesNV" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                               <name>pNext</name></member>
+            <member><type>VkBool32</type>                            <name>taskShader</name></member>
+            <member><type>VkBool32</type>                            <name>meshShader</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceMeshShaderPropertiesNV" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                               <name>pNext</name></member>
+            <member limittype="max"><type>uint32_t</type>                            <name>maxDrawMeshTasksCount</name></member>
+            <member limittype="max"><type>uint32_t</type>                            <name>maxTaskWorkGroupInvocations</name></member>
+            <member limittype="max"><type>uint32_t</type>                            <name>maxTaskWorkGroupSize</name>[3]</member>
+            <member limittype="max"><type>uint32_t</type>                            <name>maxTaskTotalMemorySize</name></member>
+            <member limittype="max"><type>uint32_t</type>                            <name>maxTaskOutputCount</name></member>
+            <member limittype="max"><type>uint32_t</type>                            <name>maxMeshWorkGroupInvocations</name></member>
+            <member limittype="max"><type>uint32_t</type>                            <name>maxMeshWorkGroupSize</name>[3]</member>
+            <member limittype="max"><type>uint32_t</type>                            <name>maxMeshTotalMemorySize</name></member>
+            <member limittype="max"><type>uint32_t</type>                            <name>maxMeshOutputVertices</name></member>
+            <member limittype="max"><type>uint32_t</type>                            <name>maxMeshOutputPrimitives</name></member>
+            <member limittype="max"><type>uint32_t</type>                            <name>maxMeshMultiviewViewCount</name></member>
+            <member limittype="noauto"><type>uint32_t</type>                            <name>meshOutputPerVertexGranularity</name></member>
+            <member limittype="noauto"><type>uint32_t</type>                            <name>meshOutputPerPrimitiveGranularity</name></member>
+        </type>
+        <type category="struct" name="VkDrawMeshTasksIndirectCommandNV">
+            <member><type>uint32_t</type>               <name>taskCount</name></member>
+            <member><type>uint32_t</type>               <name>firstTask</name></member>
+        </type>
+        <type category="struct" name="VkRayTracingShaderGroupCreateInfoNV">
+            <member values="VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member><type>VkRayTracingShaderGroupTypeKHR</type> <name>type</name></member>
+            <member><type>uint32_t</type>               <name>generalShader</name></member>
+            <member><type>uint32_t</type>               <name>closestHitShader</name></member>
+            <member><type>uint32_t</type>               <name>anyHitShader</name></member>
+            <member><type>uint32_t</type>               <name>intersectionShader</name></member>
+        </type>
+        <type category="struct" name="VkRayTracingShaderGroupCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member><type>VkRayTracingShaderGroupTypeKHR</type> <name>type</name></member>
+            <member><type>uint32_t</type>               <name>generalShader</name></member>
+            <member><type>uint32_t</type>               <name>closestHitShader</name></member>
+            <member><type>uint32_t</type>               <name>anyHitShader</name></member>
+            <member><type>uint32_t</type>               <name>intersectionShader</name></member>
+            <member optional="true">const <type>void</type>* <name>pShaderGroupCaptureReplayHandle</name></member>
+        </type>
+        <type category="struct" name="VkRayTracingPipelineCreateInfoNV">
+            <member values="VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkPipelineCreateFlags</type>  <name>flags</name><comment>Pipeline creation flags</comment></member>
+            <member><type>uint32_t</type>               <name>stageCount</name></member>
+            <member len="stageCount">const <type>VkPipelineShaderStageCreateInfo</type>* <name>pStages</name><comment>One entry for each active shader stage</comment></member>
+            <member><type>uint32_t</type>               <name>groupCount</name></member>
+            <member len="groupCount">const <type>VkRayTracingShaderGroupCreateInfoNV</type>* <name>pGroups</name></member>
+            <member><type>uint32_t</type>               <name>maxRecursionDepth</name></member>
+            <member><type>VkPipelineLayout</type>       <name>layout</name><comment>Interface layout of the pipeline</comment></member>
+            <member noautovalidity="true" optional="true"><type>VkPipeline</type>      <name>basePipelineHandle</name><comment>If VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is nonzero, it specifies the handle of the base pipeline this is a derivative of</comment></member>
+            <member><type>int32_t</type>                <name>basePipelineIndex</name><comment>If VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is not -1, it specifies an index into pCreateInfos of the base pipeline this is a derivative of</comment></member>
+        </type>
+        <type category="struct" name="VkRayTracingPipelineCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkPipelineCreateFlags</type>  <name>flags</name><comment>Pipeline creation flags</comment></member>
+            <member optional="true"><type>uint32_t</type> <name>stageCount</name></member>
+            <member len="stageCount">const <type>VkPipelineShaderStageCreateInfo</type>* <name>pStages</name><comment>One entry for each active shader stage</comment></member>
+            <member optional="true"><type>uint32_t</type> <name>groupCount</name></member>
+            <member len="groupCount">const <type>VkRayTracingShaderGroupCreateInfoKHR</type>* <name>pGroups</name></member>
+            <member><type>uint32_t</type>               <name>maxPipelineRayRecursionDepth</name></member>
+            <member optional="true">const <type>VkPipelineLibraryCreateInfoKHR</type>* <name>pLibraryInfo</name></member>
+            <member optional="true">const <type>VkRayTracingPipelineInterfaceCreateInfoKHR</type>* <name>pLibraryInterface</name></member>
+            <member optional="true">const <type>VkPipelineDynamicStateCreateInfo</type>* <name>pDynamicState</name></member>
+            <member><type>VkPipelineLayout</type>       <name>layout</name><comment>Interface layout of the pipeline</comment></member>
+            <member noautovalidity="true" optional="true"><type>VkPipeline</type>      <name>basePipelineHandle</name><comment>If VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is nonzero, it specifies the handle of the base pipeline this is a derivative of</comment></member>
+            <member><type>int32_t</type>                <name>basePipelineIndex</name><comment>If VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is not -1, it specifies an index into pCreateInfos of the base pipeline this is a derivative of</comment></member>
+        </type>
+        <type category="struct" name="VkGeometryTrianglesNV">
+            <member values="VK_STRUCTURE_TYPE_GEOMETRY_TRIANGLES_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                <name>pNext</name></member>
+            <member optional="true"><type>VkBuffer</type>   <name>vertexData</name></member>
+            <member><type>VkDeviceSize</type>               <name>vertexOffset</name></member>
+            <member><type>uint32_t</type>                   <name>vertexCount</name></member>
+            <member><type>VkDeviceSize</type>               <name>vertexStride</name></member>
+            <member><type>VkFormat</type>                   <name>vertexFormat</name></member>
+            <member optional="true"><type>VkBuffer</type>   <name>indexData</name></member>
+            <member><type>VkDeviceSize</type>               <name>indexOffset</name></member>
+            <member><type>uint32_t</type>                   <name>indexCount</name></member>
+            <member><type>VkIndexType</type>                <name>indexType</name></member>
+            <member optional="true"><type>VkBuffer</type>   <name>transformData</name><comment>Optional reference to array of floats representing a 3x4 row major affine transformation matrix.</comment></member>
+            <member><type>VkDeviceSize</type>               <name>transformOffset</name></member>
+        </type>
+        <type category="struct" name="VkGeometryAABBNV">
+            <member values="VK_STRUCTURE_TYPE_GEOMETRY_AABB_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                <name>pNext</name></member>
+            <member optional="true"><type>VkBuffer</type>   <name>aabbData</name></member>
+            <member><type>uint32_t</type>                   <name>numAABBs</name></member>
+            <member><type>uint32_t</type>                   <name>stride</name><comment>Stride in bytes between AABBs</comment></member>
+            <member><type>VkDeviceSize</type>               <name>offset</name><comment>Offset in bytes of the first AABB in aabbData</comment></member>
+        </type>
+        <type category="struct" name="VkGeometryDataNV">
+            <member><type>VkGeometryTrianglesNV</type>                  <name>triangles</name></member>
+            <member><type>VkGeometryAABBNV</type>                       <name>aabbs</name></member>
+        </type>
+        <type category="struct" name="VkGeometryNV">
+            <member values="VK_STRUCTURE_TYPE_GEOMETRY_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                   <name>pNext</name></member>
+            <member><type>VkGeometryTypeKHR</type>                  <name>geometryType</name></member>
+            <member><type>VkGeometryDataNV</type>                              <name>geometry</name></member>
+            <member optional="true"><type>VkGeometryFlagsKHR</type> <name>flags</name></member>
+        </type>
+        <type category="struct" name="VkAccelerationStructureInfoNV">
+            <member values="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkAccelerationStructureTypeNV</type>         <name>type</name></member>
+            <member optional="true"><type>VkBuildAccelerationStructureFlagsNV</type><name>flags</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>instanceCount</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>geometryCount</name></member>
+            <member len="geometryCount">const <type>VkGeometryNV</type>* <name>pGeometries</name></member>
+        </type>
+        <type category="struct" name="VkAccelerationStructureCreateInfoNV">
+            <member values="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkDeviceSize</type>                           <name>compactedSize</name></member>
+            <member><type>VkAccelerationStructureInfoNV</type>          <name>info</name></member>
+        </type>
+        <type category="struct" name="VkBindAccelerationStructureMemoryInfoNV">
+            <member values="VK_STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*     <name>pNext</name></member>
+            <member><type>VkAccelerationStructureNV</type>       <name>accelerationStructure</name></member>
+            <member devicememoryhandle="1"><type>VkDeviceMemory</type>                   <name>memory</name></member>
+            <member devicememoryoffset="1"><type>VkDeviceSize</type>                     <name>memoryOffset</name></member>
+            <member optional="true"><type>uint32_t</type>         <name>deviceIndexCount</name></member>
+            <member len="deviceIndexCount">const <type>uint32_t</type>*  <name>pDeviceIndices</name></member>
+        </type>
+        <type category="struct" name="VkWriteDescriptorSetAccelerationStructureKHR" structextends="VkWriteDescriptorSet">
+            <member values="VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>uint32_t</type>                         <name>accelerationStructureCount</name></member>
+            <member optional="false,true" len="accelerationStructureCount">const <type>VkAccelerationStructureKHR</type>* <name>pAccelerationStructures</name></member>
+        </type>
+        <type category="struct" name="VkWriteDescriptorSetAccelerationStructureNV" structextends="VkWriteDescriptorSet">
+            <member values="VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*      <name>pNext</name></member>
+            <member><type>uint32_t</type>                         <name>accelerationStructureCount</name></member>
+            <member optional="false,true" len="accelerationStructureCount">const <type>VkAccelerationStructureNV</type>* <name>pAccelerationStructures</name></member>
+        </type>
+        <type category="struct" name="VkAccelerationStructureMemoryRequirementsInfoNV">
+            <member values="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                          <name>pNext</name></member>
+            <member><type>VkAccelerationStructureMemoryRequirementsTypeNV</type>                     <name>type</name></member>
+            <member><type>VkAccelerationStructureNV</type>                                           <name>accelerationStructure</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceAccelerationStructureFeaturesKHR" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>accelerationStructure</name></member>
+            <member><type>VkBool32</type>                         <name>accelerationStructureCaptureReplay</name></member>
+            <member><type>VkBool32</type>                         <name>accelerationStructureIndirectBuild</name></member>
+            <member><type>VkBool32</type>                         <name>accelerationStructureHostCommands</name></member>
+            <member><type>VkBool32</type>                         <name>descriptorBindingAccelerationStructureUpdateAfterBind</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceRayTracingPipelineFeaturesKHR" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*            <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>rayTracingPipeline</name></member>
+            <member><type>VkBool32</type>                         <name>rayTracingPipelineShaderGroupHandleCaptureReplay</name></member>
+            <member><type>VkBool32</type>                         <name>rayTracingPipelineShaderGroupHandleCaptureReplayMixed</name></member>
+            <member><type>VkBool32</type>                         <name>rayTracingPipelineTraceRaysIndirect</name></member>
+            <member><type>VkBool32</type>                         <name>rayTraversalPrimitiveCulling</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceRayQueryFeaturesKHR" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*            <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>rayQuery</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceAccelerationStructurePropertiesKHR" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*            <name>pNext</name></member>
+            <member limittype="max"><type>uint64_t</type>                         <name>maxGeometryCount</name></member>
+            <member limittype="max"><type>uint64_t</type>                         <name>maxInstanceCount</name></member>
+            <member limittype="max"><type>uint64_t</type>                         <name>maxPrimitiveCount</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxPerStageDescriptorAccelerationStructures</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxPerStageDescriptorUpdateAfterBindAccelerationStructures</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxDescriptorSetAccelerationStructures</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxDescriptorSetUpdateAfterBindAccelerationStructures</name></member>
+            <member limittype="min"><type>uint32_t</type>                         <name>minAccelerationStructureScratchOffsetAlignment</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceRayTracingPipelinePropertiesKHR" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*            <name>pNext</name></member>
+            <member limittype="noauto"><type>uint32_t</type>                         <name>shaderGroupHandleSize</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxRayRecursionDepth</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxShaderGroupStride</name></member>
+            <member limittype="noauto"><type>uint32_t</type>                         <name>shaderGroupBaseAlignment</name></member>
+            <member limittype="noauto"><type>uint32_t</type>                         <name>shaderGroupHandleCaptureReplaySize</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxRayDispatchInvocationCount</name></member>
+            <member limittype="noauto"><type>uint32_t</type>                         <name>shaderGroupHandleAlignment</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxRayHitAttributeSize</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceRayTracingPropertiesNV" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member limittype="noauto"><type>uint32_t</type>                         <name>shaderGroupHandleSize</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxRecursionDepth</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxShaderGroupStride</name></member>
+            <member limittype="noauto"><type>uint32_t</type>                         <name>shaderGroupBaseAlignment</name></member>
+            <member limittype="max"><type>uint64_t</type>                         <name>maxGeometryCount</name></member>
+            <member limittype="max"><type>uint64_t</type>                         <name>maxInstanceCount</name></member>
+            <member limittype="max"><type>uint64_t</type>                         <name>maxTriangleCount</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxDescriptorSetAccelerationStructures</name></member>
+        </type>
+        <type category="struct" name="VkStridedDeviceAddressRegionKHR">
+            <member optional="true"><type>VkDeviceAddress</type>  <name>deviceAddress</name></member>
+            <member><type>VkDeviceSize</type>                     <name>stride</name></member>
+            <member><type>VkDeviceSize</type>                     <name>size</name></member>
+        </type>
+        <type category="struct" name="VkTraceRaysIndirectCommandKHR">
+            <member><type>uint32_t</type>               <name>width</name></member>
+            <member><type>uint32_t</type>               <name>height</name></member>
+            <member><type>uint32_t</type>               <name>depth</name></member>
+        </type>
+        <type category="struct" name="VkDrmFormatModifierPropertiesListEXT" returnedonly="true" structextends="VkFormatProperties2">
+            <member values="VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>* <name>pNext</name></member>
+            <member optional="true"><type>uint32_t</type> <name>drmFormatModifierCount</name></member>
+            <member optional="true,false" len="drmFormatModifierCount"><type>VkDrmFormatModifierPropertiesEXT</type>* <name>pDrmFormatModifierProperties</name></member>
+        </type>
+        <type category="struct" name="VkDrmFormatModifierPropertiesEXT" returnedonly="true">
+            <member><type>uint64_t</type> <name>drmFormatModifier</name></member>
+            <member><type>uint32_t</type> <name>drmFormatModifierPlaneCount</name></member>
+            <member><type>VkFormatFeatureFlags</type> <name>drmFormatModifierTilingFeatures</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceImageDrmFormatModifierInfoEXT" structextends="VkPhysicalDeviceImageFormatInfo2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>* <name>pNext</name></member>
+            <member><type>uint64_t</type> <name>drmFormatModifier</name></member>
+            <member><type>VkSharingMode</type> <name>sharingMode</name></member>
+            <member optional="true"><type>uint32_t</type> <name>queueFamilyIndexCount</name></member>
+            <member noautovalidity="true" len="queueFamilyIndexCount">const <type>uint32_t</type>* <name>pQueueFamilyIndices</name></member>
+        </type>
+        <type category="struct" name="VkImageDrmFormatModifierListCreateInfoEXT" structextends="VkImageCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>* <name>pNext</name></member>
+            <member><type>uint32_t</type> <name>drmFormatModifierCount</name></member>
+            <member len="drmFormatModifierCount">const <type>uint64_t</type>* <name>pDrmFormatModifiers</name></member>
+        </type>
+        <type category="struct" name="VkImageDrmFormatModifierExplicitCreateInfoEXT" structextends="VkImageCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>* <name>pNext</name></member>
+            <member><type>uint64_t</type> <name>drmFormatModifier</name></member>
+            <member optional="false"><type>uint32_t</type> <name>drmFormatModifierPlaneCount</name></member>
+            <member len="drmFormatModifierPlaneCount">const <type>VkSubresourceLayout</type>* <name>pPlaneLayouts</name></member>
+        </type>
+        <type category="struct" name="VkImageDrmFormatModifierPropertiesEXT" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>* <name>pNext</name></member>
+            <member><type>uint64_t</type> <name>drmFormatModifier</name></member>
+        </type>
+        <type category="struct" name="VkImageStencilUsageCreateInfo" structextends="VkImageCreateInfo,VkPhysicalDeviceImageFormatInfo2">
+            <member values="VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>* <name>pNext</name></member>
+            <member><type>VkImageUsageFlags</type> <name>stencilUsage</name></member>
+        </type>
+        <type category="struct" name="VkImageStencilUsageCreateInfoEXT"                        alias="VkImageStencilUsageCreateInfo"/>
+        <type category="struct" name="VkDeviceMemoryOverallocationCreateInfoAMD"  structextends="VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkMemoryOverallocationBehaviorAMD</type> <name>overallocationBehavior</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceFragmentDensityMapFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>fragmentDensityMap</name></member>
+            <member><type>VkBool32</type>                         <name>fragmentDensityMapDynamic</name></member>
+            <member><type>VkBool32</type>                         <name>fragmentDensityMapNonSubsampledImages</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceFragmentDensityMap2FeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>fragmentDensityMapDeferred</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceFragmentDensityMapPropertiesEXT" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member limittype="min"><type>VkExtent2D</type>                       <name>minFragmentDensityTexelSize</name></member>
+            <member limittype="max"><type>VkExtent2D</type>                       <name>maxFragmentDensityTexelSize</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>fragmentDensityInvocations</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceFragmentDensityMap2PropertiesEXT" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                          <name>pNext</name></member>
+            <member limittype="noauto"><type>VkBool32</type>                       <name>subsampledLoads</name></member>
+            <member limittype="noauto"><type>VkBool32</type>                       <name>subsampledCoarseReconstructionEarlyAccess</name></member>
+            <member limittype="max"><type>uint32_t</type>                       <name>maxSubsampledArrayLayers</name></member>
+            <member limittype="max"><type>uint32_t</type>                       <name>maxDescriptorSetSubsampledSamplers</name></member>
+        </type>
+        <type category="struct" name="VkRenderPassFragmentDensityMapCreateInfoEXT" structextends="VkRenderPassCreateInfo,VkRenderPassCreateInfo2">
+            <member values="VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkAttachmentReference</type>            <name>fragmentDensityMapAttachment</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceScalarBlockLayoutFeatures" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                               <name>pNext</name></member>
+            <member><type>VkBool32</type>                            <name>scalarBlockLayout</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceScalarBlockLayoutFeaturesEXT"            alias="VkPhysicalDeviceScalarBlockLayoutFeatures"/>
+        <type category="struct" name="VkSurfaceProtectedCapabilitiesKHR" structextends="VkSurfaceCapabilities2KHR">
+            <member values="VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>* <name>pNext</name></member>
+            <member><type>VkBool32</type> <name>supportsProtected</name><comment>Represents if surface can be protected</comment></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceUniformBufferStandardLayoutFeatures" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                               <name>pNext</name></member>
+            <member><type>VkBool32</type>                            <name>uniformBufferStandardLayout</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR"  alias="VkPhysicalDeviceUniformBufferStandardLayoutFeatures"/>
+        <type category="struct" name="VkPhysicalDeviceDepthClipEnableFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                  <name>pNext</name></member>
+            <member><type>VkBool32</type>               <name>depthClipEnable</name></member>
+        </type>
+        <type category="struct" name="VkPipelineRasterizationDepthClipStateCreateInfoEXT" structextends="VkPipelineRasterizationStateCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                                 <name>pNext</name></member>
+            <member optional="true"><type>VkPipelineRasterizationDepthClipStateCreateFlagsEXT</type>         <name>flags</name><comment>Reserved</comment></member>
+            <member><type>VkBool32</type>                                                                    <name>depthClipEnable</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceMemoryBudgetPropertiesEXT" structextends="VkPhysicalDeviceMemoryProperties2" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkDeviceSize</type>                       <name>heapBudget</name>[<enum>VK_MAX_MEMORY_HEAPS</enum>]</member>
+            <member><type>VkDeviceSize</type>                       <name>heapUsage</name>[<enum>VK_MAX_MEMORY_HEAPS</enum>]</member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceMemoryPriorityFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>memoryPriority</name></member>
+        </type>
+        <type category="struct" name="VkMemoryPriorityAllocateInfoEXT" structextends="VkMemoryAllocateInfo">
+            <member values="VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                        <name>pNext</name></member>
+            <member><type>float</type>                              <name>priority</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*              <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>pageableDeviceLocalMemory</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceBufferDeviceAddressFeatures" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>bufferDeviceAddress</name></member>
+            <member><type>VkBool32</type>                           <name>bufferDeviceAddressCaptureReplay</name></member>
+            <member><type>VkBool32</type>                           <name>bufferDeviceAddressMultiDevice</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceBufferDeviceAddressFeaturesKHR"          alias="VkPhysicalDeviceBufferDeviceAddressFeatures"/>
+        <type category="struct" name="VkPhysicalDeviceBufferDeviceAddressFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>bufferDeviceAddress</name></member>
+            <member><type>VkBool32</type>                           <name>bufferDeviceAddressCaptureReplay</name></member>
+            <member><type>VkBool32</type>                           <name>bufferDeviceAddressMultiDevice</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceBufferAddressFeaturesEXT"                alias="VkPhysicalDeviceBufferDeviceAddressFeaturesEXT"/>
+        <type category="struct" name="VkBufferDeviceAddressInfo">
+            <member values="VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                            <name>pNext</name></member>
+            <member><type>VkBuffer</type>                                               <name>buffer</name></member>
+        </type>
+        <type category="struct" name="VkBufferDeviceAddressInfoKHR"                            alias="VkBufferDeviceAddressInfo"/>
+        <type category="struct" name="VkBufferDeviceAddressInfoEXT"                            alias="VkBufferDeviceAddressInfo"/>
+        <type category="struct" name="VkBufferOpaqueCaptureAddressCreateInfo" structextends="VkBufferCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>uint64_t</type>                         <name>opaqueCaptureAddress</name></member>
+        </type>
+        <type category="struct" name="VkBufferOpaqueCaptureAddressCreateInfoKHR"               alias="VkBufferOpaqueCaptureAddressCreateInfo"/>
+        <type category="struct" name="VkBufferDeviceAddressCreateInfoEXT" structextends="VkBufferCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkDeviceAddress</type>                  <name>deviceAddress</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceImageViewImageFormatInfoEXT" structextends="VkPhysicalDeviceImageFormatInfo2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkImageViewType</type>                  <name>imageViewType</name></member>
+        </type>
+        <type category="struct" name="VkFilterCubicImageViewImageFormatPropertiesEXT" returnedonly="true" structextends="VkImageFormatProperties2">
+            <member values="VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>filterCubic</name><comment>The combinations of format, image type (and image view type if provided) can be filtered with VK_FILTER_CUBIC_EXT</comment></member>
+            <member><type>VkBool32</type>                         <name>filterCubicMinmax</name><comment>The combination of format, image type (and image view type if provided) can be filtered with VK_FILTER_CUBIC_EXT and ReductionMode of Min or Max</comment></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceImagelessFramebufferFeatures" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                                    <name>pNext</name></member>
+            <member><type>VkBool32</type>                                 <name>imagelessFramebuffer</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceImagelessFramebufferFeaturesKHR"         alias="VkPhysicalDeviceImagelessFramebufferFeatures"/>
+        <type category="struct" name="VkFramebufferAttachmentsCreateInfo" structextends="VkFramebufferCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                              <name>pNext</name></member>
+            <member optional="true"><type>uint32_t</type>                 <name>attachmentImageInfoCount</name></member>
+            <member len="attachmentImageInfoCount">const <type>VkFramebufferAttachmentImageInfo</type>* <name>pAttachmentImageInfos</name></member>
+        </type>
+        <type category="struct" name="VkFramebufferAttachmentsCreateInfoKHR"                   alias="VkFramebufferAttachmentsCreateInfo"/>
+        <type category="struct" name="VkFramebufferAttachmentImageInfo">
+            <member values="VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                              <name>pNext</name></member>
+            <member optional="true"><type>VkImageCreateFlags</type>       <name>flags</name><comment>Image creation flags</comment></member>
+            <member><type>VkImageUsageFlags</type>                        <name>usage</name><comment>Image usage flags</comment></member>
+            <member><type>uint32_t</type>                                 <name>width</name></member>
+            <member><type>uint32_t</type>                                 <name>height</name></member>
+            <member><type>uint32_t</type>                                 <name>layerCount</name></member>
+            <member optional="true"><type>uint32_t</type>                 <name>viewFormatCount</name></member>
+            <member len="viewFormatCount">const <type>VkFormat</type>*    <name>pViewFormats</name></member>
+        </type>
+        <type category="struct" name="VkFramebufferAttachmentImageInfoKHR"                     alias="VkFramebufferAttachmentImageInfo"/>
+        <type category="struct" name="VkRenderPassAttachmentBeginInfo" structextends="VkRenderPassBeginInfo">
+            <member values="VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                              <name>pNext</name></member>
+            <member optional="true"><type>uint32_t</type>                 <name>attachmentCount</name></member>
+            <member len="attachmentCount">const <type>VkImageView</type>* <name>pAttachments</name></member>
+        </type>
+        <type category="struct" name="VkRenderPassAttachmentBeginInfoKHR"                      alias="VkRenderPassAttachmentBeginInfo"/>
+        <type category="struct" name="VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                  <name>pNext</name></member>
+            <member><type>VkBool32</type>               <name>textureCompressionASTC_HDR</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceCooperativeMatrixFeaturesNV" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                               <name>pNext</name></member>
+            <member><type>VkBool32</type>                            <name>cooperativeMatrix</name></member>
+            <member><type>VkBool32</type>                            <name>cooperativeMatrixRobustBufferAccess</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceCooperativeMatrixPropertiesNV" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                               <name>pNext</name></member>
+            <member limittype="bitmask"><type>VkShaderStageFlags</type>                  <name>cooperativeMatrixSupportedStages</name></member>
+        </type>
+        <type category="struct" name="VkCooperativeMatrixPropertiesNV">
+            <member values="VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                               <name>pNext</name></member>
+            <member><type>uint32_t</type>                            <name>MSize</name></member>
+            <member><type>uint32_t</type>                            <name>NSize</name></member>
+            <member><type>uint32_t</type>                            <name>KSize</name></member>
+            <member><type>VkComponentTypeNV</type>                   <name>AType</name></member>
+            <member><type>VkComponentTypeNV</type>                   <name>BType</name></member>
+            <member><type>VkComponentTypeNV</type>                   <name>CType</name></member>
+            <member><type>VkComponentTypeNV</type>                   <name>DType</name></member>
+            <member><type>VkScopeNV</type>                           <name>scope</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceYcbcrImageArraysFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>ycbcrImageArrays</name></member>
+        </type>
+        <type category="struct" name="VkImageViewHandleInfoNVX">
+            <member values="VK_STRUCTURE_TYPE_IMAGE_VIEW_HANDLE_INFO_NVX"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member><type>VkImageView</type>                         <name>imageView</name></member>
+            <member><type>VkDescriptorType</type>                    <name>descriptorType</name></member>
+            <member optional="true"><type>VkSampler</type>           <name>sampler</name></member>
+        </type>
+        <type category="struct" name="VkImageViewAddressPropertiesNVX" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_IMAGE_VIEW_ADDRESS_PROPERTIES_NVX"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*              <name>pNext</name></member>
+            <member><type>VkDeviceAddress</type>    <name>deviceAddress</name></member>
+            <member><type>VkDeviceSize</type>       <name>size</name></member>
+        </type>
+        <type category="struct" name="VkPresentFrameTokenGGP" structextends="VkPresentInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>GgpFrameToken</type>                    <name>frameToken</name></member>
+        </type>
+        <type category="struct" name="VkPipelineCreationFeedbackEXT" returnedonly="true">
+            <member><type>VkPipelineCreationFeedbackFlagsEXT</type>  <name>flags</name></member>
+            <member><type>uint64_t</type>                            <name>duration</name></member>
+        </type>
+        <type category="struct" name="VkPipelineCreationFeedbackCreateInfoEXT" structextends="VkGraphicsPipelineCreateInfo,VkComputePipelineCreateInfo,VkRayTracingPipelineCreateInfoNV,VkRayTracingPipelineCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                         <name>pNext</name></member>
+            <member><type>VkPipelineCreationFeedbackEXT</type>*      <name>pPipelineCreationFeedback</name><comment>Output pipeline creation feedback.</comment></member>
+            <member><type>uint32_t</type>                            <name>pipelineStageCreationFeedbackCount</name></member>
+            <member len="pipelineStageCreationFeedbackCount"><type>VkPipelineCreationFeedbackEXT</type>* <name>pPipelineStageCreationFeedbacks</name><comment>One entry for each shader stage specified in the parent Vk*PipelineCreateInfo struct</comment></member>
+        </type>
+        <type category="struct" name="VkSurfaceFullScreenExclusiveInfoEXT" structextends="VkPhysicalDeviceSurfaceInfo2KHR,VkSwapchainCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkFullScreenExclusiveEXT</type>         <name>fullScreenExclusive</name></member>
+        </type>
+        <type category="struct" name="VkSurfaceFullScreenExclusiveWin32InfoEXT" structextends="VkPhysicalDeviceSurfaceInfo2KHR,VkSwapchainCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*      <name>pNext</name></member>
+            <member><type>HMONITOR</type>         <name>hmonitor</name></member>
+        </type>
+        <type category="struct" name="VkSurfaceCapabilitiesFullScreenExclusiveEXT" structextends="VkSurfaceCapabilities2KHR">
+            <member values="VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*            <name>pNext</name></member>
+            <member><type>VkBool32</type>         <name>fullScreenExclusiveSupported</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDevicePerformanceQueryFeaturesKHR" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*      <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>performanceCounterQueryPools</name><comment>performance counters supported in query pools</comment></member>
+            <member><type>VkBool32</type>                         <name>performanceCounterMultipleQueryPools</name><comment>performance counters from multiple query pools can be accessed in the same primary command buffer</comment></member>
+        </type>
+        <type category="struct" name="VkPhysicalDevicePerformanceQueryPropertiesKHR" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>* <name>pNext</name></member>
+            <member limittype="bitmask" noautovalidity="true"><type>VkBool32</type> <name>allowCommandBufferQueryCopies</name><comment>Flag to specify whether performance queries are allowed to be used in vkCmdCopyQueryPoolResults</comment></member>
+        </type>
+        <type category="struct" name="VkPerformanceCounterKHR" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*              <name>pNext</name></member>
+            <member><type>VkPerformanceCounterUnitKHR</type>        <name>unit</name></member>
+            <member><type>VkPerformanceCounterScopeKHR</type>       <name>scope</name></member>
+            <member><type>VkPerformanceCounterStorageKHR</type>     <name>storage</name></member>
+            <member><type>uint8_t</type> <name>uuid</name>[<enum>VK_UUID_SIZE</enum>]</member>
+        </type>
+        <type category="struct" name="VkPerformanceCounterDescriptionKHR" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_DESCRIPTION_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                   <name>pNext</name></member>
+            <member optional="true"><type>VkPerformanceCounterDescriptionFlagsKHR</type> <name>flags</name></member>
+            <member><type>char</type>                                    <name>name</name>[<enum>VK_MAX_DESCRIPTION_SIZE</enum>]</member>
+            <member><type>char</type>                                    <name>category</name>[<enum>VK_MAX_DESCRIPTION_SIZE</enum>]</member>
+            <member><type>char</type>                                    <name>description</name>[<enum>VK_MAX_DESCRIPTION_SIZE</enum>]</member>
+        </type>
+        <type category="struct" name="VkQueryPoolPerformanceCreateInfoKHR" structextends="VkQueryPoolCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                             <name>pNext</name></member>
+            <member><type>uint32_t</type>                                <name>queueFamilyIndex</name></member>
+            <member><type>uint32_t</type>                                <name>counterIndexCount</name></member>
+            <member len="counterIndexCount">const <type>uint32_t</type>* <name>pCounterIndices</name></member>
+        </type>
+        <type category="union" name="VkPerformanceCounterResultKHR" comment="// Union of all the possible return types a counter result could return">
+            <member><type>int32_t</type>  <name>int32</name></member>
+            <member><type>int64_t</type>  <name>int64</name></member>
+            <member><type>uint32_t</type> <name>uint32</name></member>
+            <member><type>uint64_t</type> <name>uint64</name></member>
+            <member><type>float</type>    <name>float32</name></member>
+            <member><type>double</type>   <name>float64</name></member>
+        </type>
+        <type category="struct" name="VkAcquireProfilingLockInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_ACQUIRE_PROFILING_LOCK_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkAcquireProfilingLockFlagsKHR</type> <name>flags</name><comment>Acquire profiling lock flags</comment></member>
+            <member><type>uint64_t</type> <name>timeout</name></member>
+        </type>
+        <type category="struct" name="VkPerformanceQuerySubmitInfoKHR" structextends="VkSubmitInfo,VkSubmitInfo2KHR">
+            <member values="VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*         <name>pNext</name></member>
+            <member><type>uint32_t</type>            <name>counterPassIndex</name><comment>Index for which counter pass to submit</comment></member>
+        </type>
+        <type category="struct" name="VkHeadlessSurfaceCreateInfoEXT">
+            <member values="VK_STRUCTURE_TYPE_HEADLESS_SURFACE_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkHeadlessSurfaceCreateFlagsEXT</type>   <name>flags</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceCoverageReductionModeFeaturesNV" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true"><type>void</type>*    <name>pNext</name></member>
+            <member><type>VkBool32</type>                       <name>coverageReductionMode</name></member>
+        </type>
+        <type category="struct" name="VkPipelineCoverageReductionStateCreateInfoNV" structextends="VkPipelineMultisampleStateCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                        <name>pNext</name></member>
+            <member optional="true"><type>VkPipelineCoverageReductionStateCreateFlagsNV</type>      <name>flags</name></member>
+            <member><type>VkCoverageReductionModeNV</type>                                          <name>coverageReductionMode</name></member>
+        </type>
+        <type category="struct" name="VkFramebufferMixedSamplesCombinationNV" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_FRAMEBUFFER_MIXED_SAMPLES_COMBINATION_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkCoverageReductionModeNV</type>  <name>coverageReductionMode</name></member>
+            <member><type>VkSampleCountFlagBits</type>      <name>rasterizationSamples</name></member>
+            <member><type>VkSampleCountFlags</type>         <name>depthStencilSamples</name></member>
+            <member><type>VkSampleCountFlags</type>         <name>colorSamples</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>shaderIntegerFunctions2</name></member>
+        </type>
+        <type category="union" name="VkPerformanceValueDataINTEL">
+            <member selection="VK_PERFORMANCE_VALUE_TYPE_UINT32_INTEL"><type>uint32_t</type>                           <name>value32</name></member>
+            <member selection="VK_PERFORMANCE_VALUE_TYPE_UINT64_INTEL"><type>uint64_t</type>                           <name>value64</name></member>
+            <member selection="VK_PERFORMANCE_VALUE_TYPE_FLOAT_INTEL"><type>float</type>                               <name>valueFloat</name></member>
+            <member selection="VK_PERFORMANCE_VALUE_TYPE_BOOL_INTEL"><type>VkBool32</type>                             <name>valueBool</name></member>
+            <member selection="VK_PERFORMANCE_VALUE_TYPE_STRING_INTEL" len="null-terminated">const <type>char</type>*  <name>valueString</name></member>
+        </type>
+        <type category="struct" name="VkPerformanceValueINTEL">
+            <member><type>VkPerformanceValueTypeINTEL</type>        <name>type</name></member>
+            <member selector="type" noautovalidity="true"><type>VkPerformanceValueDataINTEL</type>        <name>data</name></member>
+        </type>
+        <type category="struct" name="VkInitializePerformanceApiInfoINTEL" >
+            <member values="VK_STRUCTURE_TYPE_INITIALIZE_PERFORMANCE_API_INFO_INTEL"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                         <name>pNext</name></member>
+            <member optional="true"><type>void</type>*               <name>pUserData</name></member>
+        </type>
+        <type category="struct" name="VkQueryPoolPerformanceQueryCreateInfoINTEL" structextends="VkQueryPoolCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                         <name>pNext</name></member>
+            <member><type>VkQueryPoolSamplingModeINTEL</type>        <name>performanceCountersSampling</name></member>
+        </type>
+        <type category="struct" name="VkQueryPoolCreateInfoINTEL"                              alias="VkQueryPoolPerformanceQueryCreateInfoINTEL"/>
+        <type category="struct" name="VkPerformanceMarkerInfoINTEL">
+            <member values="VK_STRUCTURE_TYPE_PERFORMANCE_MARKER_INFO_INTEL"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                         <name>pNext</name></member>
+            <member><type>uint64_t</type>                            <name>marker</name></member>
+        </type>
+        <type category="struct" name="VkPerformanceStreamMarkerInfoINTEL">
+            <member values="VK_STRUCTURE_TYPE_PERFORMANCE_STREAM_MARKER_INFO_INTEL"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                         <name>pNext</name></member>
+            <member><type>uint32_t</type>                            <name>marker</name></member>
+        </type>
+        <type category="struct" name="VkPerformanceOverrideInfoINTEL">
+            <member values="VK_STRUCTURE_TYPE_PERFORMANCE_OVERRIDE_INFO_INTEL"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                         <name>pNext</name></member>
+            <member><type>VkPerformanceOverrideTypeINTEL</type>      <name>type</name></member>
+            <member><type>VkBool32</type>                            <name>enable</name></member>
+            <member><type>uint64_t</type>                            <name>parameter</name></member>
+        </type>
+        <type category="struct" name="VkPerformanceConfigurationAcquireInfoINTEL">
+            <member values="VK_STRUCTURE_TYPE_PERFORMANCE_CONFIGURATION_ACQUIRE_INFO_INTEL"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                         <name>pNext</name></member>
+            <member><type>VkPerformanceConfigurationTypeINTEL</type> <name>type</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceShaderClockFeaturesKHR" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                               <name>pNext</name></member>
+            <member><type>VkBool32</type>                            <name>shaderSubgroupClock</name></member>
+            <member><type>VkBool32</type>                            <name>shaderDeviceClock</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceIndexTypeUint8FeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>indexTypeUint8</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceShaderSMBuiltinsPropertiesNV" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                          <name>pNext</name></member>
+            <member limittype="max"><type>uint32_t</type>                       <name>shaderSMCount</name></member>
+            <member limittype="max"><type>uint32_t</type>                       <name>shaderWarpsPerSM</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceShaderSMBuiltinsFeaturesNV" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true"><type>void</type>*    <name>pNext</name></member>
+            <member><type>VkBool32</type>                       <name>shaderSMBuiltins</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                  <name>pNext</name><comment>Pointer to next structure</comment></member>
+            <member><type>VkBool32</type>               <name>fragmentShaderSampleInterlock</name></member>
+            <member><type>VkBool32</type>               <name>fragmentShaderPixelInterlock</name></member>
+            <member><type>VkBool32</type>               <name>fragmentShaderShadingRateInterlock</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true"><type>void</type>*    <name>pNext</name></member>
+            <member><type>VkBool32</type>                       <name>separateDepthStencilLayouts</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR"  alias="VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures"/>
+        <type category="struct" name="VkAttachmentReferenceStencilLayout" structextends="VkAttachmentReference2">
+            <member values="VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true"><type>void</type>*    <name>pNext</name></member>
+            <member><type>VkImageLayout</type>                  <name>stencilLayout</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                     <name>primitiveTopologyListRestart</name></member>
+            <member><type>VkBool32</type>                     <name>primitiveTopologyPatchListRestart</name></member>
+        </type>
+        <type category="struct" name="VkAttachmentReferenceStencilLayoutKHR"                   alias="VkAttachmentReferenceStencilLayout"/>
+        <type category="struct" name="VkAttachmentDescriptionStencilLayout" structextends="VkAttachmentDescription2">
+            <member values="VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true"><type>void</type>*    <name>pNext</name></member>
+            <member><type>VkImageLayout</type>                  <name>stencilInitialLayout</name></member>
+            <member><type>VkImageLayout</type>                  <name>stencilFinalLayout</name></member>
+        </type>
+        <type category="struct" name="VkAttachmentDescriptionStencilLayoutKHR"                 alias="VkAttachmentDescriptionStencilLayout"/>
+        <type category="struct" name="VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*              <name>pNext</name></member>
+            <member><type>VkBool32</type>           <name>pipelineExecutableInfo</name></member>
+        </type>
+        <type category="struct" name="VkPipelineInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*        <name>pNext</name></member>
+            <member><type>VkPipeline</type>         <name>pipeline</name></member>
+        </type>
+        <type category="struct" name="VkPipelineExecutablePropertiesKHR" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_PROPERTIES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*              <name>pNext</name></member>
+            <member><type>VkShaderStageFlags</type> <name>stages</name></member>
+            <member><type>char</type>               <name>name</name>[<enum>VK_MAX_DESCRIPTION_SIZE</enum>]</member>
+            <member><type>char</type>               <name>description</name>[<enum>VK_MAX_DESCRIPTION_SIZE</enum>]</member>
+            <member><type>uint32_t</type>           <name>subgroupSize</name></member>
+        </type>
+        <type category="struct" name="VkPipelineExecutableInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*        <name>pNext</name></member>
+            <member><type>VkPipeline</type>         <name>pipeline</name></member>
+            <member><type>uint32_t</type>           <name>executableIndex</name></member>
+        </type>
+        <type category="union" name="VkPipelineExecutableStatisticValueKHR" returnedonly="true">
+            <member selection="VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_BOOL32_KHR"><type>VkBool32</type>           <name>b32</name></member>
+            <member selection="VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_INT64_KHR"><type>int64_t</type>            <name>i64</name></member>
+            <member selection="VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_UINT64_KHR"><type>uint64_t</type>           <name>u64</name></member>
+            <member selection="VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_FLOAT64_KHR"><type>double</type>             <name>f64</name></member>
+        </type>
+        <type category="struct" name="VkPipelineExecutableStatisticKHR" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_STATISTIC_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*              <name>pNext</name></member>
+            <member><type>char</type>               <name>name</name>[<enum>VK_MAX_DESCRIPTION_SIZE</enum>]</member>
+            <member><type>char</type>               <name>description</name>[<enum>VK_MAX_DESCRIPTION_SIZE</enum>]</member>
+            <member><type>VkPipelineExecutableStatisticFormatKHR</type> <name>format</name></member>
+            <member selector="format" noautovalidity="true"><type>VkPipelineExecutableStatisticValueKHR</type>  <name>value</name></member>
+        </type>
+        <type category="struct" name="VkPipelineExecutableInternalRepresentationKHR" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INTERNAL_REPRESENTATION_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*              <name>pNext</name></member>
+            <member><type>char</type>               <name>name</name>[<enum>VK_MAX_DESCRIPTION_SIZE</enum>]</member>
+            <member><type>char</type>               <name>description</name>[<enum>VK_MAX_DESCRIPTION_SIZE</enum>]</member>
+            <member><type>VkBool32</type>           <name>isText</name></member>
+            <member><type>size_t</type>             <name>dataSize</name></member>
+            <member optional="true" len="dataSize"><type>void</type>* <name>pData</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>shaderDemoteToHelperInvocation</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>texelBufferAlignment</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT" structextends="VkPhysicalDeviceProperties2" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*              <name>pNext</name></member>
+            <member limittype="noauto"><type>VkDeviceSize</type>                       <name>storageTexelBufferOffsetAlignmentBytes</name></member>
+            <member limittype="noauto"><type>VkBool32</type>                           <name>storageTexelBufferOffsetSingleTexelAlignment</name></member>
+            <member limittype="noauto"><type>VkDeviceSize</type>                       <name>uniformTexelBufferOffsetAlignmentBytes</name></member>
+            <member limittype="noauto"><type>VkBool32</type>                           <name>uniformTexelBufferOffsetSingleTexelAlignment</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceSubgroupSizeControlFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                          <name>pNext</name></member>
+            <member><type>VkBool32</type> <name>subgroupSizeControl</name></member>
+            <member><type>VkBool32</type> <name>computeFullSubgroups</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceSubgroupSizeControlPropertiesEXT" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                          <name>pNext</name></member>
+            <member limittype="min" noautovalidity="true"><type>uint32_t</type> <name>minSubgroupSize</name><comment>The minimum subgroup size supported by this device</comment></member>
+            <member limittype="max" noautovalidity="true"><type>uint32_t</type> <name>maxSubgroupSize</name><comment>The maximum subgroup size supported by this device</comment></member>
+            <member limittype="max" noautovalidity="true"><type>uint32_t</type> <name>maxComputeWorkgroupSubgroups</name><comment>The maximum number of subgroups supported in a workgroup</comment></member>
+            <member limittype="bitmask"><type>VkShaderStageFlags</type>             <name>requiredSubgroupSizeStages</name><comment>The shader stages that support specifying a subgroup size</comment></member>
+        </type>
+        <type category="struct" name="VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT" returnedonly="true" structextends="VkPipelineShaderStageCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                  <name>pNext</name></member>
+            <member><type>uint32_t</type>               <name>requiredSubgroupSize</name></member>
+        </type>
+        <type category="struct" name="VkSubpassShadingPipelineCreateInfoHUAWEI" returnedonly="true" structextends="VkComputePipelineCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                  <name>pNext</name></member>
+            <member><type>VkRenderPass</type>           <name>renderPass</name></member>
+            <member><type>uint32_t</type>               <name>subpass</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceSubpassShadingPropertiesHUAWEI" structextends="VkPhysicalDeviceProperties2" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                  <name>pNext</name></member>
+            <member limittype="noauto"><type>uint32_t</type>               <name>maxSubpassShadingWorkgroupSizeAspectRatio</name></member>
+        </type>
+        <type category="struct" name="VkMemoryOpaqueCaptureAddressAllocateInfo" structextends="VkMemoryAllocateInfo">
+            <member values="VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                   <name>pNext</name></member>
+            <member><type>uint64_t</type>                      <name>opaqueCaptureAddress</name></member>
+        </type>
+        <type category="struct" name="VkMemoryOpaqueCaptureAddressAllocateInfoKHR"             alias="VkMemoryOpaqueCaptureAddressAllocateInfo"/>
+        <type category="struct" name="VkDeviceMemoryOpaqueCaptureAddressInfo">
+            <member values="VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member devicememoryhandle="1"><type>VkDeviceMemory</type>                   <name>memory</name></member>
+        </type>
+        <type category="struct" name="VkDeviceMemoryOpaqueCaptureAddressInfoKHR"               alias="VkDeviceMemoryOpaqueCaptureAddressInfo"/>
+        <type category="struct" name="VkPhysicalDeviceLineRasterizationFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>rectangularLines</name></member>
+            <member><type>VkBool32</type>                           <name>bresenhamLines</name></member>
+            <member><type>VkBool32</type>                           <name>smoothLines</name></member>
+            <member><type>VkBool32</type>                           <name>stippledRectangularLines</name></member>
+            <member><type>VkBool32</type>                           <name>stippledBresenhamLines</name></member>
+            <member><type>VkBool32</type>                           <name>stippledSmoothLines</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceLineRasterizationPropertiesEXT" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                               <name>pNext</name></member>
+            <member limittype="noauto"><type>uint32_t</type>                            <name>lineSubPixelPrecisionBits</name></member>
+        </type>
+        <type category="struct" name="VkPipelineRasterizationLineStateCreateInfoEXT" structextends="VkPipelineRasterizationStateCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                      <name>pNext</name></member>
+            <member><type>VkLineRasterizationModeEXT</type>                                       <name>lineRasterizationMode</name></member>
+            <member><type>VkBool32</type>                                                         <name>stippledLineEnable</name></member>
+            <member><type>uint32_t</type>                                                         <name>lineStippleFactor</name></member>
+            <member><type>uint16_t</type>                                                         <name>lineStipplePattern</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>* <name>pNext</name></member>
+            <member><type>VkBool32</type>                                                         <name>pipelineCreationCacheControl</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceVulkan11Features" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true"><type>void</type>*    <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>storageBuffer16BitAccess</name><comment>16-bit integer/floating-point variables supported in BufferBlock</comment></member>
+            <member><type>VkBool32</type>                         <name>uniformAndStorageBuffer16BitAccess</name><comment>16-bit integer/floating-point variables supported in BufferBlock and Block</comment></member>
+            <member><type>VkBool32</type>                         <name>storagePushConstant16</name><comment>16-bit integer/floating-point variables supported in PushConstant</comment></member>
+            <member><type>VkBool32</type>                         <name>storageInputOutput16</name><comment>16-bit integer/floating-point variables supported in shader inputs and outputs</comment></member>
+            <member><type>VkBool32</type>                         <name>multiview</name><comment>Multiple views in a renderpass</comment></member>
+            <member><type>VkBool32</type>                         <name>multiviewGeometryShader</name><comment>Multiple views in a renderpass w/ geometry shader</comment></member>
+            <member><type>VkBool32</type>                         <name>multiviewTessellationShader</name><comment>Multiple views in a renderpass w/ tessellation shader</comment></member>
+            <member><type>VkBool32</type>                         <name>variablePointersStorageBuffer</name></member>
+            <member><type>VkBool32</type>                         <name>variablePointers</name></member>
+            <member><type>VkBool32</type>                         <name>protectedMemory</name></member>
+            <member><type>VkBool32</type>                         <name>samplerYcbcrConversion</name><comment>Sampler color conversion supported</comment></member>
+            <member><type>VkBool32</type>                         <name>shaderDrawParameters</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceVulkan11Properties" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true"><type>void</type>*      <name>pNext</name></member>
+            <member limittype="noauto"><type>uint8_t</type>                          <name>deviceUUID</name>[<enum>VK_UUID_SIZE</enum>]</member>
+            <member limittype="noauto"><type>uint8_t</type>                          <name>driverUUID</name>[<enum>VK_UUID_SIZE</enum>]</member>
+            <member limittype="noauto"><type>uint8_t</type>                          <name>deviceLUID</name>[<enum>VK_LUID_SIZE</enum>]</member>
+            <member limittype="noauto"><type>uint32_t</type>                         <name>deviceNodeMask</name></member>
+            <member limittype="noauto"><type>VkBool32</type>                         <name>deviceLUIDValid</name></member>
+            <member limittype="noauto" noautovalidity="true"><type>uint32_t</type>                      <name>subgroupSize</name><comment>The size of a subgroup for this queue.</comment></member>
+            <member limittype="bitmask" noautovalidity="true"><type>VkShaderStageFlags</type>            <name>subgroupSupportedStages</name><comment>Bitfield of what shader stages support subgroup operations</comment></member>
+            <member limittype="bitmask" noautovalidity="true"><type>VkSubgroupFeatureFlags</type>        <name>subgroupSupportedOperations</name><comment>Bitfield of what subgroup operations are supported.</comment></member>
+            <member limittype="bitmask" noautovalidity="true"><type>VkBool32</type>                      <name>subgroupQuadOperationsInAllStages</name><comment>Flag to specify whether quad operations are available in all stages.</comment></member>
+            <member limittype="noauto"><type>VkPointClippingBehavior</type>          <name>pointClippingBehavior</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxMultiviewViewCount</name><comment>max number of views in a subpass</comment></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxMultiviewInstanceIndex</name><comment>max instance index for a draw in a multiview subpass</comment></member>
+            <member limittype="noauto"><type>VkBool32</type>                         <name>protectedNoFault</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxPerSetDescriptors</name></member>
+            <member limittype="max"><type>VkDeviceSize</type>                     <name>maxMemoryAllocationSize</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceVulkan12Features" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true"><type>void</type>*    <name>pNext</name></member>
+            <member><type>VkBool32</type>                         <name>samplerMirrorClampToEdge</name></member>
+            <member><type>VkBool32</type>                         <name>drawIndirectCount</name></member>
+            <member><type>VkBool32</type>                         <name>storageBuffer8BitAccess</name><comment>8-bit integer variables supported in StorageBuffer</comment></member>
+            <member><type>VkBool32</type>                         <name>uniformAndStorageBuffer8BitAccess</name><comment>8-bit integer variables supported in StorageBuffer and Uniform</comment></member>
+            <member><type>VkBool32</type>                         <name>storagePushConstant8</name><comment>8-bit integer variables supported in PushConstant</comment></member>
+            <member><type>VkBool32</type>                         <name>shaderBufferInt64Atomics</name></member>
+            <member><type>VkBool32</type>                         <name>shaderSharedInt64Atomics</name></member>
+            <member><type>VkBool32</type>                         <name>shaderFloat16</name><comment>16-bit floats (halfs) in shaders</comment></member>
+            <member><type>VkBool32</type>                         <name>shaderInt8</name><comment>8-bit integers in shaders</comment></member>
+            <member><type>VkBool32</type>                         <name>descriptorIndexing</name></member>
+            <member><type>VkBool32</type>                         <name>shaderInputAttachmentArrayDynamicIndexing</name></member>
+            <member><type>VkBool32</type>                         <name>shaderUniformTexelBufferArrayDynamicIndexing</name></member>
+            <member><type>VkBool32</type>                         <name>shaderStorageTexelBufferArrayDynamicIndexing</name></member>
+            <member><type>VkBool32</type>                         <name>shaderUniformBufferArrayNonUniformIndexing</name></member>
+            <member><type>VkBool32</type>                         <name>shaderSampledImageArrayNonUniformIndexing</name></member>
+            <member><type>VkBool32</type>                         <name>shaderStorageBufferArrayNonUniformIndexing</name></member>
+            <member><type>VkBool32</type>                         <name>shaderStorageImageArrayNonUniformIndexing</name></member>
+            <member><type>VkBool32</type>                         <name>shaderInputAttachmentArrayNonUniformIndexing</name></member>
+            <member><type>VkBool32</type>                         <name>shaderUniformTexelBufferArrayNonUniformIndexing</name></member>
+            <member><type>VkBool32</type>                         <name>shaderStorageTexelBufferArrayNonUniformIndexing</name></member>
+            <member><type>VkBool32</type>                         <name>descriptorBindingUniformBufferUpdateAfterBind</name></member>
+            <member><type>VkBool32</type>                         <name>descriptorBindingSampledImageUpdateAfterBind</name></member>
+            <member><type>VkBool32</type>                         <name>descriptorBindingStorageImageUpdateAfterBind</name></member>
+            <member><type>VkBool32</type>                         <name>descriptorBindingStorageBufferUpdateAfterBind</name></member>
+            <member><type>VkBool32</type>                         <name>descriptorBindingUniformTexelBufferUpdateAfterBind</name></member>
+            <member><type>VkBool32</type>                         <name>descriptorBindingStorageTexelBufferUpdateAfterBind</name></member>
+            <member><type>VkBool32</type>                         <name>descriptorBindingUpdateUnusedWhilePending</name></member>
+            <member><type>VkBool32</type>                         <name>descriptorBindingPartiallyBound</name></member>
+            <member><type>VkBool32</type>                         <name>descriptorBindingVariableDescriptorCount</name></member>
+            <member><type>VkBool32</type>                         <name>runtimeDescriptorArray</name></member>
+            <member><type>VkBool32</type>                         <name>samplerFilterMinmax</name></member>
+            <member><type>VkBool32</type>                         <name>scalarBlockLayout</name></member>
+            <member><type>VkBool32</type>                         <name>imagelessFramebuffer</name></member>
+            <member><type>VkBool32</type>                         <name>uniformBufferStandardLayout</name></member>
+            <member><type>VkBool32</type>                         <name>shaderSubgroupExtendedTypes</name></member>
+            <member><type>VkBool32</type>                         <name>separateDepthStencilLayouts</name></member>
+            <member><type>VkBool32</type>                         <name>hostQueryReset</name></member>
+            <member><type>VkBool32</type>                         <name>timelineSemaphore</name></member>
+            <member><type>VkBool32</type>                         <name>bufferDeviceAddress</name></member>
+            <member><type>VkBool32</type>                         <name>bufferDeviceAddressCaptureReplay</name></member>
+            <member><type>VkBool32</type>                         <name>bufferDeviceAddressMultiDevice</name></member>
+            <member><type>VkBool32</type>                         <name>vulkanMemoryModel</name></member>
+            <member><type>VkBool32</type>                         <name>vulkanMemoryModelDeviceScope</name></member>
+            <member><type>VkBool32</type>                         <name>vulkanMemoryModelAvailabilityVisibilityChains</name></member>
+            <member><type>VkBool32</type>                         <name>shaderOutputViewportIndex</name></member>
+            <member><type>VkBool32</type>                         <name>shaderOutputLayer</name></member>
+            <member><type>VkBool32</type>                         <name>subgroupBroadcastDynamicId</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceVulkan12Properties" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true"><type>void</type>*    <name>pNext</name></member>
+            <member limittype="noauto"><type>VkDriverId</type>                       <name>driverID</name></member>
+            <member limittype="noauto"><type>char</type>                             <name>driverName</name>[<enum>VK_MAX_DRIVER_NAME_SIZE</enum>]</member>
+            <member limittype="noauto"><type>char</type>                             <name>driverInfo</name>[<enum>VK_MAX_DRIVER_INFO_SIZE</enum>]</member>
+            <member limittype="noauto"><type>VkConformanceVersion</type>             <name>conformanceVersion</name></member>
+            <member limittype="noauto"><type>VkShaderFloatControlsIndependence</type><name>denormBehaviorIndependence</name></member>
+            <member limittype="noauto"><type>VkShaderFloatControlsIndependence</type><name>roundingModeIndependence</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderSignedZeroInfNanPreserveFloat16</name><comment>An implementation can preserve signed zero, nan, inf</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderSignedZeroInfNanPreserveFloat32</name><comment>An implementation can preserve signed zero, nan, inf</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderSignedZeroInfNanPreserveFloat64</name><comment>An implementation can preserve signed zero, nan, inf</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderDenormPreserveFloat16</name><comment>An implementation can preserve  denormals</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderDenormPreserveFloat32</name><comment>An implementation can preserve  denormals</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderDenormPreserveFloat64</name><comment>An implementation can preserve  denormals</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderDenormFlushToZeroFloat16</name><comment>An implementation can flush to zero  denormals</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderDenormFlushToZeroFloat32</name><comment>An implementation can flush to zero  denormals</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderDenormFlushToZeroFloat64</name><comment>An implementation can flush to zero  denormals</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderRoundingModeRTEFloat16</name><comment>An implementation can support RTE</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderRoundingModeRTEFloat32</name><comment>An implementation can support RTE</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderRoundingModeRTEFloat64</name><comment>An implementation can support RTE</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderRoundingModeRTZFloat16</name><comment>An implementation can support RTZ</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderRoundingModeRTZFloat32</name><comment>An implementation can support RTZ</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderRoundingModeRTZFloat64</name><comment>An implementation can support RTZ</comment></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxUpdateAfterBindDescriptorsInAllPools</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderUniformBufferArrayNonUniformIndexingNative</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderSampledImageArrayNonUniformIndexingNative</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderStorageBufferArrayNonUniformIndexingNative</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderStorageImageArrayNonUniformIndexingNative</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>shaderInputAttachmentArrayNonUniformIndexingNative</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>robustBufferAccessUpdateAfterBind</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>quadDivergentImplicitLod</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxPerStageDescriptorUpdateAfterBindSamplers</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxPerStageDescriptorUpdateAfterBindUniformBuffers</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxPerStageDescriptorUpdateAfterBindStorageBuffers</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxPerStageDescriptorUpdateAfterBindSampledImages</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxPerStageDescriptorUpdateAfterBindStorageImages</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxPerStageDescriptorUpdateAfterBindInputAttachments</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxPerStageUpdateAfterBindResources</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxDescriptorSetUpdateAfterBindSamplers</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxDescriptorSetUpdateAfterBindUniformBuffers</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxDescriptorSetUpdateAfterBindUniformBuffersDynamic</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxDescriptorSetUpdateAfterBindStorageBuffers</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxDescriptorSetUpdateAfterBindStorageBuffersDynamic</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxDescriptorSetUpdateAfterBindSampledImages</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxDescriptorSetUpdateAfterBindStorageImages</name></member>
+            <member limittype="max"><type>uint32_t</type>                         <name>maxDescriptorSetUpdateAfterBindInputAttachments</name></member>
+            <member limittype="bitmask"><type>VkResolveModeFlags</type>               <name>supportedDepthResolveModes</name><comment>supported depth resolve modes</comment></member>
+            <member limittype="bitmask"><type>VkResolveModeFlags</type>               <name>supportedStencilResolveModes</name><comment>supported stencil resolve modes</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>independentResolveNone</name><comment>depth and stencil resolve modes can be set independently if one of them is none</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>independentResolve</name><comment>depth and stencil resolve modes can be set independently</comment></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>filterMinmaxSingleComponentFormats</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>                         <name>filterMinmaxImageComponentMapping</name></member>
+            <member limittype="max"><type>uint64_t</type>                         <name>maxTimelineSemaphoreValueDifference</name></member>
+            <member limittype="bitmask" optional="true"><type>VkSampleCountFlags</type> <name>framebufferIntegerColorSampleCounts</name></member>
+        </type>
+        <type category="struct" name="VkPipelineCompilerControlCreateInfoAMD" structextends="VkGraphicsPipelineCreateInfo,VkComputePipelineCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD"><type>VkStructureType</type>   <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                                            <name>pNext</name></member>
+            <member optional="true"><type>VkPipelineCompilerControlFlagsAMD</type>                                      <name>compilerControlFlags</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceCoherentMemoryFeaturesAMD" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>deviceCoherentMemory</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceToolPropertiesEXT" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TOOL_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>* <name>pNext</name></member>
+            <member><type>char</type>            <name>name</name>[<enum>VK_MAX_EXTENSION_NAME_SIZE</enum>]</member>
+            <member><type>char</type>            <name>version</name>[<enum>VK_MAX_EXTENSION_NAME_SIZE</enum>]</member>
+            <member><type>VkToolPurposeFlagsEXT</type> <name>purposes</name></member>
+            <member><type>char</type>            <name>description</name>[<enum>VK_MAX_DESCRIPTION_SIZE</enum>]</member>
+            <member><type>char</type>            <name>layer</name>[<enum>VK_MAX_EXTENSION_NAME_SIZE</enum>]</member>
+        </type>
+        <type category="struct" name="VkSamplerCustomBorderColorCreateInfoEXT" structextends="VkSamplerCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                                            <name>pNext</name></member>
+            <member noautovalidity="true"><type>VkClearColorValue</type>                                                                      <name>customBorderColor</name></member>
+            <member><type>VkFormat</type>                                                                               <name>format</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceCustomBorderColorPropertiesEXT" structextends="VkPhysicalDeviceProperties2" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                                                                   <name>pNext</name></member>
+            <member limittype="max"><type>uint32_t</type>                                                                                      <name>maxCustomBorderColorSamplers</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceCustomBorderColorFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>customBorderColors</name></member>
+            <member><type>VkBool32</type>                           <name>customBorderColorWithoutFormat</name></member>
+        </type>
+        <type category="struct" name="VkSamplerBorderColorComponentMappingCreateInfoEXT" structextends="VkSamplerCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                                       <name>pNext</name></member>
+            <member><type>VkComponentMapping</type>                                                                                <name>components</name></member>
+            <member><type>VkBool32</type>                                                                                          <name>srgb</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceBorderColorSwizzleFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                     <name>borderColorSwizzle</name></member>
+            <member><type>VkBool32</type>                     <name>borderColorSwizzleFromImage</name></member>
+        </type>
+        <type category="union" name="VkDeviceOrHostAddressKHR">
+            <member noautovalidity="true"><type>VkDeviceAddress</type>            <name>deviceAddress</name></member>
+            <member noautovalidity="true"><type>void</type>*                      <name>hostAddress</name></member>
+        </type>
+        <type category="union" name="VkDeviceOrHostAddressConstKHR">
+            <member noautovalidity="true"><type>VkDeviceAddress</type>            <name>deviceAddress</name></member>
+            <member noautovalidity="true">const <type>void</type>*                <name>hostAddress</name></member>
+        </type>
+        <type category="struct" name="VkAccelerationStructureGeometryTrianglesDataKHR">
+            <member values="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                   <name>pNext</name></member>
+            <member><type>VkFormat</type>                                      <name>vertexFormat</name></member>
+            <member noautovalidity="true"><type>VkDeviceOrHostAddressConstKHR</type>                 <name>vertexData</name></member>
+            <member><type>VkDeviceSize</type>                                  <name>vertexStride</name></member>
+            <member><type>uint32_t</type>                                      <name>maxVertex</name></member>
+            <member><type>VkIndexType</type>                                   <name>indexType</name></member>
+            <member noautovalidity="true"><type>VkDeviceOrHostAddressConstKHR</type>                 <name>indexData</name></member>
+            <member noautovalidity="true"><type>VkDeviceOrHostAddressConstKHR</type>                 <name>transformData</name></member>
+        </type>
+        <type category="struct" name="VkAccelerationStructureGeometryAabbsDataKHR">
+            <member values="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_AABBS_DATA_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                           <name>pNext</name></member>
+            <member noautovalidity="true"><type>VkDeviceOrHostAddressConstKHR</type>         <name>data</name></member>
+            <member><type>VkDeviceSize</type>                          <name>stride</name></member>
+        </type>
+        <type category="struct" name="VkAccelerationStructureGeometryInstancesDataKHR">
+            <member values="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_INSTANCES_DATA_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                           <name>pNext</name></member>
+            <member><type>VkBool32</type>                              <name>arrayOfPointers</name></member>
+            <member noautovalidity="true"><type>VkDeviceOrHostAddressConstKHR</type>         <name>data</name></member>
+        </type>
+        <type category="union" name="VkAccelerationStructureGeometryDataKHR">
+            <member selection="VK_GEOMETRY_TYPE_TRIANGLES_KHR"><type>VkAccelerationStructureGeometryTrianglesDataKHR</type> <name>triangles</name></member>
+            <member selection="VK_GEOMETRY_TYPE_AABBS_KHR"><type>VkAccelerationStructureGeometryAabbsDataKHR</type>         <name>aabbs</name></member>
+            <member selection="VK_GEOMETRY_TYPE_INSTANCES_KHR"><type>VkAccelerationStructureGeometryInstancesDataKHR</type> <name>instances</name></member>
+        </type>
+        <type category="struct" name="VkAccelerationStructureGeometryKHR">
+            <member values="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkGeometryTypeKHR</type>                      <name>geometryType</name></member>
+            <member selector="geometryType"><type>VkAccelerationStructureGeometryDataKHR</type> <name>geometry</name></member>
+            <member optional="true"><type>VkGeometryFlagsKHR</type>     <name>flags</name></member>
+        </type>
+        <type category="struct" name="VkAccelerationStructureBuildGeometryInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                        <name>pNext</name></member>
+            <member><type>VkAccelerationStructureTypeKHR</type>                                     <name>type</name></member>
+            <member optional="true"><type>VkBuildAccelerationStructureFlagsKHR</type>               <name>flags</name></member>
+            <member noautovalidity="true"><type>VkBuildAccelerationStructureModeKHR</type>          <name>mode</name></member>
+            <member optional="true" noautovalidity="true"><type>VkAccelerationStructureKHR</type>                   <name>srcAccelerationStructure</name></member>
+            <member optional="true" noautovalidity="true"><type>VkAccelerationStructureKHR</type>                   <name>dstAccelerationStructure</name></member>
+            <member optional="true"><type>uint32_t</type>                                           <name>geometryCount</name></member>
+            <member len="geometryCount" optional="true">const <type>VkAccelerationStructureGeometryKHR</type>*    <name>pGeometries</name></member>
+            <member len="geometryCount,1" optional="true,false">const <type>VkAccelerationStructureGeometryKHR</type>* const*   <name>ppGeometries</name></member>
+            <member noautovalidity="true"><type>VkDeviceOrHostAddressKHR</type>                                           <name>scratchData</name></member>
+        </type>
+        <type category="struct" name="VkAccelerationStructureBuildRangeInfoKHR">
+            <member><type>uint32_t</type>                                                <name>primitiveCount</name></member>
+            <member><type>uint32_t</type>                                                <name>primitiveOffset</name></member>
+            <member><type>uint32_t</type>                                                <name>firstVertex</name></member>
+            <member><type>uint32_t</type>                                                <name>transformOffset</name></member>
+        </type>
+        <type category="struct" name="VkAccelerationStructureCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                             <name>pNext</name></member>
+            <member optional="true"><type>VkAccelerationStructureCreateFlagsKHR</type>   <name>createFlags</name></member>
+            <member><type>VkBuffer</type>                                                <name>buffer</name></member>
+            <member><type>VkDeviceSize</type>                                            <name>offset</name><comment>Specified in bytes</comment></member>
+            <member><type>VkDeviceSize</type>                                            <name>size</name></member>
+            <member><type>VkAccelerationStructureTypeKHR</type>                          <name>type</name></member>
+            <member optional="true"><type>VkDeviceAddress</type>                         <name>deviceAddress</name></member>
+        </type>
+        <type category="struct" name="VkAabbPositionsKHR">
+            <member><type>float</type>                                                   <name>minX</name></member>
+            <member><type>float</type>                                                   <name>minY</name></member>
+            <member><type>float</type>                                                   <name>minZ</name></member>
+            <member><type>float</type>                                                   <name>maxX</name></member>
+            <member><type>float</type>                                                   <name>maxY</name></member>
+            <member><type>float</type>                                                   <name>maxZ</name></member>
+        </type>
+        <type category="struct" name="VkAabbPositionsNV"                                       alias="VkAabbPositionsKHR"/>
+        <type category="struct" name="VkTransformMatrixKHR">
+            <member><type>float</type>                                                   <name>matrix</name>[3][4]</member>
+        </type>
+        <type category="struct" name="VkTransformMatrixNV"                                     alias="VkTransformMatrixKHR"/>
+        <type category="struct" name="VkAccelerationStructureInstanceKHR">
+            <comment>The bitfields in this structure are non-normative since bitfield ordering is implementation-defined in C. The specification defines the normative layout.</comment>
+            <member><type>VkTransformMatrixKHR</type>                                    <name>transform</name></member>
+            <member><type>uint32_t</type>                                                <name>instanceCustomIndex</name>:24</member>
+            <member><type>uint32_t</type>                                                <name>mask</name>:8</member>
+            <member><type>uint32_t</type>                                                <name>instanceShaderBindingTableRecordOffset</name>:24</member>
+            <member optional="true"><type>VkGeometryInstanceFlagsKHR</type>              <name>flags</name>:8</member>
+            <member><type>uint64_t</type>                                                <name>accelerationStructureReference</name></member>
+        </type>
+        <type category="struct" name="VkAccelerationStructureInstanceNV"                       alias="VkAccelerationStructureInstanceKHR"/>
+        <type category="struct" name="VkAccelerationStructureDeviceAddressInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_DEVICE_ADDRESS_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                            <name>pNext</name></member>
+            <member><type>VkAccelerationStructureKHR</type>                             <name>accelerationStructure</name></member>
+        </type>
+        <type category="struct" name="VkAccelerationStructureVersionInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_VERSION_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                            <name>pNext</name></member>
+            <member len="latexmath:[2 \times \mathtt{VK\_UUID\_SIZE}]" altlen="2*VK_UUID_SIZE">const <type>uint8_t</type>*                    <name>pVersionData</name></member>
+        </type>
+        <type category="struct" name="VkCopyAccelerationStructureInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                            <name>pNext</name></member>
+            <member><type>VkAccelerationStructureKHR</type>                             <name>src</name></member>
+            <member><type>VkAccelerationStructureKHR</type>                             <name>dst</name></member>
+            <member><type>VkCopyAccelerationStructureModeKHR</type>                     <name>mode</name></member>
+        </type>
+        <type category="struct" name="VkCopyAccelerationStructureToMemoryInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_TO_MEMORY_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                            <name>pNext</name></member>
+            <member><type>VkAccelerationStructureKHR</type>                             <name>src</name></member>
+            <member noautovalidity="true"><type>VkDeviceOrHostAddressKHR</type>                               <name>dst</name></member>
+            <member><type>VkCopyAccelerationStructureModeKHR</type>                     <name>mode</name></member>
+        </type>
+        <type category="struct" name="VkCopyMemoryToAccelerationStructureInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_COPY_MEMORY_TO_ACCELERATION_STRUCTURE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                            <name>pNext</name></member>
+            <member noautovalidity="true"><type>VkDeviceOrHostAddressConstKHR</type>                          <name>src</name></member>
+            <member><type>VkAccelerationStructureKHR</type>                             <name>dst</name></member>
+            <member><type>VkCopyAccelerationStructureModeKHR</type>                     <name>mode</name></member>
+        </type>
+        <type category="struct" name="VkRayTracingPipelineInterfaceCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_INTERFACE_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                            <name>pNext</name></member>
+            <member><type>uint32_t</type>                                               <name>maxPipelineRayPayloadSize</name></member>
+            <member><type>uint32_t</type>                                               <name>maxPipelineRayHitAttributeSize</name></member>
+        </type>
+        <type category="struct" name="VkPipelineLibraryCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                            <name>pNext</name></member>
+            <member optional="true"><type>uint32_t</type>                               <name>libraryCount</name></member>
+            <member len="libraryCount">const <type>VkPipeline</type>*                   <name>pLibraries</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceExtendedDynamicStateFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>extendedDynamicState</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceExtendedDynamicState2FeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                     <name>extendedDynamicState2</name></member>
+            <member><type>VkBool32</type>                     <name>extendedDynamicState2LogicOp</name></member>
+            <member><type>VkBool32</type>                     <name>extendedDynamicState2PatchControlPoints</name></member>
+        </type>
+        <type category="struct" name="VkRenderPassTransformBeginInfoQCOM" structextends="VkRenderPassBeginInfo">
+            <member values="VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                           <name>pNext</name><comment>Pointer to next structure</comment></member>
+            <member noautovalidity="true"><type>VkSurfaceTransformFlagBitsKHR</type>   <name>transform</name></member>
+        </type>
+        <type category="struct" name="VkCopyCommandTransformInfoQCOM" structextends="VkBufferImageCopy2KHR,VkImageBlit2KHR">
+            <member values="VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true" noautovalidity="true">const <type>void</type>*     <name>pNext</name></member>
+            <member noautovalidity="true"><type>VkSurfaceTransformFlagBitsKHR</type>   <name>transform</name></member>
+        </type>
+        <type category="struct" name="VkCommandBufferInheritanceRenderPassTransformInfoQCOM" structextends="VkCommandBufferInheritanceInfo">
+            <member values="VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                           <name>pNext</name><comment>Pointer to next structure</comment></member>
+            <member noautovalidity="true"><type>VkSurfaceTransformFlagBitsKHR</type>   <name>transform</name></member>
+            <member><type>VkRect2D</type>                        <name>renderArea</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceDiagnosticsConfigFeaturesNV" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true"><type>void</type>*    <name>pNext</name></member>
+            <member><type>VkBool32</type>                       <name>diagnosticsConfig</name></member>
+        </type>
+        <type category="struct" name="VkDeviceDiagnosticsConfigCreateInfoNV" structextends="VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                         <name>pNext</name></member>
+            <member optional="true"><type>VkDeviceDiagnosticsConfigFlagsNV</type>    <name>flags</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*          <name>pNext</name></member>
+            <member><type>VkBool32</type>       <name>shaderZeroInitializeWorkgroupMemory</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*    <name>pNext</name></member>
+            <member><type>VkBool32</type> <name>shaderSubgroupUniformControlFlow</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceRobustness2FeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>robustBufferAccess2</name></member>
+            <member><type>VkBool32</type>                           <name>robustImageAccess2</name></member>
+            <member><type>VkBool32</type>                           <name>nullDescriptor</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceRobustness2PropertiesEXT" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*        <name>pNext</name></member>
+            <member limittype="noauto"><type>VkDeviceSize</type>                       <name>robustStorageBufferAccessSizeAlignment</name></member>
+            <member limittype="noauto"><type>VkDeviceSize</type>                       <name>robustUniformBufferAccessSizeAlignment</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceImageRobustnessFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>robustImageAccess</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true" noautovalidity="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>workgroupMemoryExplicitLayout</name></member>
+            <member><type>VkBool32</type>                           <name>workgroupMemoryExplicitLayoutScalarBlockLayout</name></member>
+            <member><type>VkBool32</type>                           <name>workgroupMemoryExplicitLayout8BitAccess</name></member>
+            <member><type>VkBool32</type>                           <name>workgroupMemoryExplicitLayout16BitAccess</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDevicePortabilitySubsetFeaturesKHR" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>constantAlphaColorBlendFactors</name></member>
+            <member><type>VkBool32</type>                           <name>events</name></member>
+            <member><type>VkBool32</type>                           <name>imageViewFormatReinterpretation</name></member>
+            <member><type>VkBool32</type>                           <name>imageViewFormatSwizzle</name></member>
+            <member><type>VkBool32</type>                           <name>imageView2DOn3DImage</name></member>
+            <member><type>VkBool32</type>                           <name>multisampleArrayImage</name></member>
+            <member><type>VkBool32</type>                           <name>mutableComparisonSamplers</name></member>
+            <member><type>VkBool32</type>                           <name>pointPolygons</name></member>
+            <member><type>VkBool32</type>                           <name>samplerMipLodBias</name></member>
+            <member><type>VkBool32</type>                           <name>separateStencilMaskRef</name></member>
+            <member><type>VkBool32</type>                           <name>shaderSampleRateInterpolationFunctions</name></member>
+            <member><type>VkBool32</type>                           <name>tessellationIsolines</name></member>
+            <member><type>VkBool32</type>                           <name>tessellationPointMode</name></member>
+            <member><type>VkBool32</type>                           <name>triangleFans</name></member>
+            <member><type>VkBool32</type>                           <name>vertexAttributeAccessBeyondStride</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDevicePortabilitySubsetPropertiesKHR" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*        <name>pNext</name></member>
+            <member limittype="noauto"><type>uint32_t</type>                           <name>minVertexInputBindingStrideAlignment</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDevice4444FormatsFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>formatA4R4G4B4</name></member>
+            <member><type>VkBool32</type>                           <name>formatA4B4G4R4</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceSubpassShadingFeaturesHUAWEI" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>subpassShading</name></member>
+        </type>
+        <type category="struct" name="VkBufferCopy2KHR">
+            <member values="VK_STRUCTURE_TYPE_BUFFER_COPY_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*  <name>pNext</name></member>
+            <member><type>VkDeviceSize</type> <name>srcOffset</name><comment>Specified in bytes</comment></member>
+            <member><type>VkDeviceSize</type> <name>dstOffset</name><comment>Specified in bytes</comment></member>
+            <member noautovalidity="true"><type>VkDeviceSize</type> <name>size</name><comment>Specified in bytes</comment></member>
+        </type>
+        <type category="struct" name="VkImageCopy2KHR">
+            <member values="VK_STRUCTURE_TYPE_IMAGE_COPY_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>* <name>pNext</name></member>
+            <member><type>VkImageSubresourceLayers</type> <name>srcSubresource</name></member>
+            <member><type>VkOffset3D</type> <name>srcOffset</name><comment>Specified in pixels for both compressed and uncompressed images</comment></member>
+            <member><type>VkImageSubresourceLayers</type> <name>dstSubresource</name></member>
+            <member><type>VkOffset3D</type> <name>dstOffset</name><comment>Specified in pixels for both compressed and uncompressed images</comment></member>
+            <member><type>VkExtent3D</type> <name>extent</name><comment>Specified in pixels for both compressed and uncompressed images</comment></member>
+        </type>
+        <type category="struct" name="VkImageBlit2KHR">
+            <member values="VK_STRUCTURE_TYPE_IMAGE_BLIT_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*  <name>pNext</name></member>
+            <member><type>VkImageSubresourceLayers</type> <name>srcSubresource</name></member>
+            <member><type>VkOffset3D</type> <name>srcOffsets</name>[2]<comment>Specified in pixels for both compressed and uncompressed images</comment></member>
+            <member><type>VkImageSubresourceLayers</type> <name>dstSubresource</name></member>
+            <member><type>VkOffset3D</type> <name>dstOffsets</name>[2]<comment>Specified in pixels for both compressed and uncompressed images</comment></member>
+        </type>
+        <type category="struct" name="VkBufferImageCopy2KHR">
+            <member values="VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*  <name>pNext</name></member>
+            <member><type>VkDeviceSize</type> <name>bufferOffset</name><comment>Specified in bytes</comment></member>
+            <member><type>uint32_t</type> <name>bufferRowLength</name><comment>Specified in texels</comment></member>
+            <member><type>uint32_t</type> <name>bufferImageHeight</name></member>
+            <member><type>VkImageSubresourceLayers</type> <name>imageSubresource</name></member>
+            <member><type>VkOffset3D</type> <name>imageOffset</name><comment>Specified in pixels for both compressed and uncompressed images</comment></member>
+            <member><type>VkExtent3D</type> <name>imageExtent</name><comment>Specified in pixels for both compressed and uncompressed images</comment></member>
+        </type>
+        <type category="struct" name="VkImageResolve2KHR">
+            <member values="VK_STRUCTURE_TYPE_IMAGE_RESOLVE_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*  <name>pNext</name></member>
+            <member><type>VkImageSubresourceLayers</type> <name>srcSubresource</name></member>
+            <member><type>VkOffset3D</type> <name>srcOffset</name></member>
+            <member><type>VkImageSubresourceLayers</type> <name>dstSubresource</name></member>
+            <member><type>VkOffset3D</type> <name>dstOffset</name></member>
+            <member><type>VkExtent3D</type> <name>extent</name></member>
+        </type>
+        <type category="struct" name="VkCopyBufferInfo2KHR">
+            <member values="VK_STRUCTURE_TYPE_COPY_BUFFER_INFO_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>* <name>pNext</name></member>
+            <member><type>VkBuffer</type> <name>srcBuffer</name></member>
+            <member><type>VkBuffer</type> <name>dstBuffer</name></member>
+            <member><type>uint32_t</type> <name>regionCount</name></member>
+            <member len="regionCount">const <type>VkBufferCopy2KHR</type>* <name>pRegions</name></member>
+        </type>
+        <type category="struct" name="VkCopyImageInfo2KHR">
+            <member values="VK_STRUCTURE_TYPE_COPY_IMAGE_INFO_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>* <name>pNext</name></member>
+            <member><type>VkImage</type> <name>srcImage</name></member>
+            <member><type>VkImageLayout</type> <name>srcImageLayout</name></member>
+            <member><type>VkImage</type> <name>dstImage</name></member>
+            <member><type>VkImageLayout</type> <name>dstImageLayout</name></member>
+            <member><type>uint32_t</type> <name>regionCount</name></member>
+            <member len="regionCount">const <type>VkImageCopy2KHR</type>* <name>pRegions</name></member>
+        </type>
+        <type category="struct" name="VkBlitImageInfo2KHR">
+            <member values="VK_STRUCTURE_TYPE_BLIT_IMAGE_INFO_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>* <name>pNext</name></member>
+            <member><type>VkImage</type> <name>srcImage</name></member>
+            <member><type>VkImageLayout</type> <name>srcImageLayout</name></member>
+            <member><type>VkImage</type> <name>dstImage</name></member>
+            <member><type>VkImageLayout</type> <name>dstImageLayout</name></member>
+            <member><type>uint32_t</type> <name>regionCount</name></member>
+            <member len="regionCount">const <type>VkImageBlit2KHR</type>* <name>pRegions</name></member>
+            <member><type>VkFilter</type> <name>filter</name></member>
+        </type>
+        <type category="struct" name="VkCopyBufferToImageInfo2KHR">
+            <member values="VK_STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>* <name>pNext</name></member>
+            <member><type>VkBuffer</type> <name>srcBuffer</name></member>
+            <member><type>VkImage</type> <name>dstImage</name></member>
+            <member><type>VkImageLayout</type> <name>dstImageLayout</name></member>
+            <member><type>uint32_t</type> <name>regionCount</name></member>
+            <member len="regionCount">const <type>VkBufferImageCopy2KHR</type>* <name>pRegions</name></member>
+        </type>
+        <type category="struct" name="VkCopyImageToBufferInfo2KHR">
+            <member values="VK_STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>* <name>pNext</name></member>
+            <member><type>VkImage</type> <name>srcImage</name></member>
+            <member><type>VkImageLayout</type> <name>srcImageLayout</name></member>
+            <member><type>VkBuffer</type> <name>dstBuffer</name></member>
+            <member><type>uint32_t</type> <name>regionCount</name></member>
+            <member len="regionCount">const <type>VkBufferImageCopy2KHR</type>* <name>pRegions</name></member>
+        </type>
+        <type category="struct" name="VkResolveImageInfo2KHR">
+            <member values="VK_STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>* <name>pNext</name></member>
+            <member><type>VkImage</type> <name>srcImage</name></member>
+            <member><type>VkImageLayout</type> <name>srcImageLayout</name></member>
+            <member><type>VkImage</type> <name>dstImage</name></member>
+            <member><type>VkImageLayout</type> <name>dstImageLayout</name></member>
+            <member><type>uint32_t</type> <name>regionCount</name></member>
+            <member len="regionCount">const <type>VkImageResolve2KHR</type>* <name>pRegions</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                               <name>pNext</name></member>
+            <member><type>VkBool32</type>                            <name>shaderImageInt64Atomics</name></member>
+            <member><type>VkBool32</type>                            <name>sparseImageInt64Atomics</name></member>
+        </type>
+        <type category="struct" name="VkFragmentShadingRateAttachmentInfoKHR" structextends="VkSubpassDescription2">
+            <member values="VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                <name>pNext</name></member>
+            <member optional="true">const <type>VkAttachmentReference2</type>* <name>pFragmentShadingRateAttachment</name></member>
+            <member><type>VkExtent2D</type>                 <name>shadingRateAttachmentTexelSize</name></member>
+        </type>
+        <type category="struct" name="VkPipelineFragmentShadingRateStateCreateInfoKHR" structextends="VkGraphicsPipelineCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                <name>pNext</name></member>
+            <member><type>VkExtent2D</type>                                 <name>fragmentSize</name></member>
+            <member><type>VkFragmentShadingRateCombinerOpKHR</type>         <name>combinerOps</name>[2]</member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceFragmentShadingRateFeaturesKHR" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*              <name>pNext</name></member>
+            <member><type>VkBool32</type>           <name>pipelineFragmentShadingRate</name></member>
+            <member><type>VkBool32</type>           <name>primitiveFragmentShadingRate</name></member>
+            <member><type>VkBool32</type>           <name>attachmentFragmentShadingRate</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceFragmentShadingRatePropertiesKHR" structextends="VkPhysicalDeviceProperties2" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                  <name>pNext</name></member>
+            <member limittype="min"><type>VkExtent2D</type>             <name>minFragmentShadingRateAttachmentTexelSize</name></member>
+            <member limittype="max"><type>VkExtent2D</type>             <name>maxFragmentShadingRateAttachmentTexelSize</name></member>
+            <member limittype="noauto"><type>uint32_t</type>               <name>maxFragmentShadingRateAttachmentTexelSizeAspectRatio</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>primitiveFragmentShadingRateWithMultipleViewports</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>layeredShadingRateAttachments</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>fragmentShadingRateNonTrivialCombinerOps</name></member>
+            <member limittype="max"><type>VkExtent2D</type>             <name>maxFragmentSize</name></member>
+            <member limittype="noauto"><type>uint32_t</type>               <name>maxFragmentSizeAspectRatio</name></member>
+            <member limittype="noauto"><type>uint32_t</type>               <name>maxFragmentShadingRateCoverageSamples</name></member>
+            <member limittype="max"><type>VkSampleCountFlagBits</type>  <name>maxFragmentShadingRateRasterizationSamples</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>fragmentShadingRateWithShaderDepthStencilWrites</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>fragmentShadingRateWithSampleMask</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>fragmentShadingRateWithShaderSampleMask</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>fragmentShadingRateWithConservativeRasterization</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>fragmentShadingRateWithFragmentShaderInterlock</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>fragmentShadingRateWithCustomSampleLocations</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>               <name>fragmentShadingRateStrictMultiplyCombiner</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceFragmentShadingRateKHR" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*              <name>pNext</name></member>
+            <member><type>VkSampleCountFlags</type> <name>sampleCounts</name></member>
+            <member><type>VkExtent2D</type>         <name>fragmentSize</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true" noautovalidity="true"><type>void</type>*    <name>pNext</name></member>
+            <member><type>VkBool32</type>                       <name>shaderTerminateInvocation</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                              <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>fragmentShadingRateEnums</name></member>
+            <member><type>VkBool32</type>                           <name>supersampleFragmentShadingRates</name></member>
+            <member><type>VkBool32</type>                           <name>noInvocationFragmentShadingRates</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                              <name>pNext</name></member>
+            <member limittype="bitmask"><type>VkSampleCountFlagBits</type>              <name>maxFragmentShadingRateInvocationCount</name></member>
+        </type>
+        <type category="struct" name="VkPipelineFragmentShadingRateEnumStateCreateInfoNV" structextends="VkGraphicsPipelineCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                        <name>pNext</name></member>
+            <member><type>VkFragmentShadingRateTypeNV</type>        <name>shadingRateType</name></member>
+            <member><type>VkFragmentShadingRateNV</type>            <name>shadingRate</name></member>
+            <member><type>VkFragmentShadingRateCombinerOpKHR</type> <name>combinerOps</name>[2]</member>
+        </type>
+        <type category="struct" name="VkAccelerationStructureBuildSizesInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_SIZES_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*        <name>pNext</name></member>
+            <member><type>VkDeviceSize</type>                       <name>accelerationStructureSize</name></member>
+            <member><type>VkDeviceSize</type>                       <name>updateScratchSize</name></member>
+            <member><type>VkDeviceSize</type>                       <name>buildScratchSize</name></member>
+        </type>
+        <type category="struct" name="VkImportColorBufferGOOGLE" structextends="VkMemoryAllocateInfo">
+            <member values="VK_STRUCTURE_TYPE_IMPORT_COLOR_BUFFER_GOOGLE"><type>VkStructureType</type> <name>sType</name></member>
+            <member><type>void</type>*                  <name>pNext</name></member>
+            <member><type>uint32_t</type>   <name>colorBuffer</name></member>
+        </type>
+        <type category="struct" name="VkImportBufferGOOGLE" structextends="VkMemoryAllocateInfo">
+            <member values="VK_STRUCTURE_TYPE_IMPORT_BUFFER_GOOGLE"><type>VkStructureType</type> <name>sType</name></member>
+            <member><type>void</type>*                  <name>pNext</name></member>
+            <member><type>uint32_t</type>   <name>buffer</name></member>
+        </type>
+        <type category="struct" name="VkImportPhysicalAddressGOOGLE" structextends="VkMemoryAllocateInfo">
+            <member values="VK_STRUCTURE_TYPE_IMPORT_PHYSICAL_ADDRESS_GOOGLE"><type>VkStructureType</type> <name>sType</name></member>
+            <member><type>void</type>*                  <name>pNext</name></member>
+            <member><type>uint64_t</type>   <name>physicalAddress</name></member>
+            <member><type>VkDeviceSize</type>   <name>size</name></member>
+            <member><type>VkFormat</type>   <name>format</name></member>
+            <member><type>VkImageTiling</type>   <name>tiling</name></member>
+            <member><type>uint32_t</type>   <name>tilingParameter</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true" noautovalidity="true"><type>void</type>*                     <name>pNext</name></member>
+            <member><type>VkBool32</type>                                        <name>mutableDescriptorType</name></member>
+        </type>
+        <type category="struct" name="VkMutableDescriptorTypeListVALVE">
+            <member optional="true"><type>uint32_t</type>                                          <name>descriptorTypeCount</name></member>
+            <member len="descriptorTypeCount">const <type>VkDescriptorType</type>* <name>pDescriptorTypes</name></member>
+        </type>
+        <type category="struct" name="VkMutableDescriptorTypeCreateInfoVALVE" structextends="VkDescriptorSetLayoutCreateInfo,VkDescriptorPoolCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                                      <name>pNext</name></member>
+            <member optional="true"><type>uint32_t</type>                                                         <name>mutableDescriptorTypeListCount</name></member>
+            <member len="mutableDescriptorTypeListCount">const <type>VkMutableDescriptorTypeListVALVE</type>* <name>pMutableDescriptorTypeLists</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true" noautovalidity="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>vertexInputDynamicState</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceExternalMemoryRDMAFeaturesNV" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_RDMA_FEATURES_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true" noautovalidity="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>externalMemoryRDMA</name></member>
+        </type>
+        <type category="struct" name="VkVertexInputBindingDescription2EXT">
+            <member values="VK_STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true" noautovalidity="true"><type>void</type>*    <name>pNext</name></member>
+            <member><type>uint32_t</type>                       <name>binding</name></member>
+            <member><type>uint32_t</type>                       <name>stride</name></member>
+            <member><type>VkVertexInputRate</type>              <name>inputRate</name></member>
+            <member><type>uint32_t</type>                       <name>divisor</name></member>
+        </type>
+        <type category="struct" name="VkVertexInputAttributeDescription2EXT">
+            <member values="VK_STRUCTURE_TYPE_VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true" noautovalidity="true"><type>void</type>*    <name>pNext</name></member>
+            <member><type>uint32_t</type>                       <name>location</name><comment>location of the shader vertex attrib</comment></member>
+            <member><type>uint32_t</type>                       <name>binding</name><comment>Vertex buffer binding id</comment></member>
+            <member><type>VkFormat</type>                       <name>format</name><comment>format of source data</comment></member>
+            <member><type>uint32_t</type>                       <name>offset</name><comment>Offset of first element in bytes from base of vertex</comment></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceColorWriteEnableFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                     <name>colorWriteEnable</name></member>
+        </type>
+        <type category="struct" name="VkPipelineColorWriteCreateInfoEXT" structextends="VkPipelineColorBlendStateCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>attachmentCount</name><comment># of pAttachments</comment></member>
+            <member len="attachmentCount">const <type>VkBool32</type>*  <name>pColorWriteEnables</name></member>
+        </type>
+        <type category="struct" name="VkMemoryBarrier2KHR" structextends="VkSubpassDependency2">
+            <member values="VK_STRUCTURE_TYPE_MEMORY_BARRIER_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                               <name>pNext</name></member>
+            <member optional="true"><type>VkPipelineStageFlags2KHR</type>  <name>srcStageMask</name></member>
+            <member optional="true"><type>VkAccessFlags2KHR</type>         <name>srcAccessMask</name></member>
+            <member optional="true"><type>VkPipelineStageFlags2KHR</type>  <name>dstStageMask</name></member>
+            <member optional="true"><type>VkAccessFlags2KHR</type>         <name>dstAccessMask</name></member>
+        </type>
+        <type category="struct" name="VkImageMemoryBarrier2KHR">
+            <member values="VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                               <name>pNext</name></member>
+            <member optional="true"><type>VkPipelineStageFlags2KHR</type>  <name>srcStageMask</name></member>
+            <member optional="true"><type>VkAccessFlags2KHR</type>         <name>srcAccessMask</name></member>
+            <member optional="true"><type>VkPipelineStageFlags2KHR</type>  <name>dstStageMask</name></member>
+            <member optional="true"><type>VkAccessFlags2KHR</type>         <name>dstAccessMask</name></member>
+            <member><type>VkImageLayout</type>                             <name>oldLayout</name></member>
+            <member><type>VkImageLayout</type>                             <name>newLayout</name></member>
+            <member><type>uint32_t</type>                                  <name>srcQueueFamilyIndex</name></member>
+            <member><type>uint32_t</type>                                  <name>dstQueueFamilyIndex</name></member>
+            <member><type>VkImage</type>                                   <name>image</name></member>
+            <member><type>VkImageSubresourceRange</type>                   <name>subresourceRange</name></member>
+        </type>
+        <type category="struct" name="VkBufferMemoryBarrier2KHR">
+            <member values="VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                               <name>pNext</name></member>
+            <member optional="true"><type>VkPipelineStageFlags2KHR</type>  <name>srcStageMask</name></member>
+            <member optional="true"><type>VkAccessFlags2KHR</type>         <name>srcAccessMask</name></member>
+            <member optional="true"><type>VkPipelineStageFlags2KHR</type>  <name>dstStageMask</name></member>
+            <member optional="true"><type>VkAccessFlags2KHR</type>         <name>dstAccessMask</name></member>
+            <member><type>uint32_t</type>                                  <name>srcQueueFamilyIndex</name></member>
+            <member><type>uint32_t</type>                                  <name>dstQueueFamilyIndex</name></member>
+            <member><type>VkBuffer</type>                                  <name>buffer</name></member>
+            <member><type>VkDeviceSize</type>                              <name>offset</name></member>
+            <member><type>VkDeviceSize</type>                              <name>size</name></member>
+        </type>
+        <type category="struct" name="VkDependencyInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_DEPENDENCY_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                               <name>pNext</name></member>
+            <member optional="true"><type>VkDependencyFlags</type>         <name>dependencyFlags</name></member>
+            <member optional="true"><type>uint32_t</type>                  <name>memoryBarrierCount</name></member>
+            <member len="memoryBarrierCount">const <type>VkMemoryBarrier2KHR</type>* <name>pMemoryBarriers</name></member>
+            <member optional="true"><type>uint32_t</type>                  <name>bufferMemoryBarrierCount</name></member>
+            <member len="bufferMemoryBarrierCount">const <type>VkBufferMemoryBarrier2KHR</type>* <name>pBufferMemoryBarriers</name></member>
+            <member optional="true"><type>uint32_t</type>                  <name>imageMemoryBarrierCount</name></member>
+            <member len="imageMemoryBarrierCount">const <type>VkImageMemoryBarrier2KHR</type>* <name>pImageMemoryBarriers</name></member>
+        </type>
+        <type category="struct" name="VkSemaphoreSubmitInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO_KHR"><type>VkStructureType</type>       <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                                <name>pNext</name></member>
+            <member><type>VkSemaphore</type>                                                                <name>semaphore</name></member>
+            <member><type>uint64_t</type>                                                                   <name>value</name></member>
+            <member optional="true"><type>VkPipelineStageFlags2KHR</type>                                   <name>stageMask</name></member>
+            <member><type>uint32_t</type>                                                                   <name>deviceIndex</name></member>
+        </type>
+        <type category="struct" name="VkCommandBufferSubmitInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO_KHR"><type>VkStructureType</type>  <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                                <name>pNext</name></member>
+            <member><type>VkCommandBuffer</type>                                                            <name>commandBuffer</name></member>
+            <member><type>uint32_t</type>                                                                   <name>deviceMask</name></member>
+        </type>
+        <type category="struct" name="VkSubmitInfo2KHR">
+            <member values="VK_STRUCTURE_TYPE_SUBMIT_INFO_2_KHR"><type>VkStructureType</type>               <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                                <name>pNext</name></member>
+            <member optional="true"><type>VkSubmitFlagsKHR</type>                                           <name>flags</name></member>
+            <member optional="true"><type>uint32_t</type>                                                   <name>waitSemaphoreInfoCount</name></member>
+            <member len="waitSemaphoreInfoCount">const <type>VkSemaphoreSubmitInfoKHR</type>*               <name>pWaitSemaphoreInfos</name></member>
+            <member optional="true"><type>uint32_t</type>                                                   <name>commandBufferInfoCount</name></member>
+            <member len="commandBufferInfoCount">const <type>VkCommandBufferSubmitInfoKHR</type>*           <name>pCommandBufferInfos</name></member>
+            <member optional="true"><type>uint32_t</type>                                                   <name>signalSemaphoreInfoCount</name></member>
+            <member len="signalSemaphoreInfoCount">const <type>VkSemaphoreSubmitInfoKHR</type>*             <name>pSignalSemaphoreInfos</name></member>
+        </type>
+        <type category="struct" name="VkQueueFamilyCheckpointProperties2NV" structextends="VkQueueFamilyProperties2" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*           <name>pNext</name></member>
+            <member><type>VkPipelineStageFlags2KHR</type> <name>checkpointExecutionStageMask</name></member>
+        </type>
+        <type category="struct" name="VkCheckpointData2NV" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_CHECKPOINT_DATA_2_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                  <name>pNext</name></member>
+            <member><type>VkPipelineStageFlags2KHR</type>   <name>stage</name></member>
+            <member noautovalidity="true"><type>void</type>* <name>pCheckpointMarker</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceSynchronization2FeaturesKHR" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true" noautovalidity="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>synchronization2</name></member>
+        </type>
+        <type category="struct" name="VkVideoQueueFamilyProperties2KHR" structextends="VkQueueFamilyProperties2">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_QUEUE_FAMILY_PROPERTIES_2_KHR"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true"><type>void</type>*                              <name>pNext</name></member>
+            <member><type>VkVideoCodecOperationFlagsKHR</type>      <name>videoCodecOperations</name></member>
+        </type>
+        <type category="struct" name="VkVideoProfilesKHR" structextends="VkFormatProperties2,VkImageCreateInfo,VkImageViewCreateInfo,VkBufferCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_PROFILES_KHR"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true"><type>void</type>*                              <name>pNext</name></member>
+            <member><type>uint32_t</type>                           <name>profileCount</name></member>
+            <member>const <type>VkVideoProfileKHR</type>*           <name>pProfiles</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceVideoFormatInfoKHR" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_FORMAT_INFO_KHR"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true"><type>void</type>*                              <name>pNext</name></member>
+            <member><type>VkImageUsageFlags</type>                  <name>imageUsage</name></member>
+            <member>const <type>VkVideoProfilesKHR</type>*          <name>pVideoProfiles</name></member>
+        </type>
+        <type category="struct" name="VkVideoFormatPropertiesKHR" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_FORMAT_PROPERTIES_KHR"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true"><type>void</type>*                              <name>pNext</name></member>
+            <member><type>VkFormat</type>                           <name>format</name></member>
+        </type>
+        <type category="struct" name="VkVideoProfileKHR" structextends="VkQueryPoolCreateInfo,VkFormatProperties2,VkImageCreateInfo,VkImageViewCreateInfo,VkBufferCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_PROFILE_KHR"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true"><type>void</type>*                              <name>pNext</name></member>
+            <member><type>VkVideoCodecOperationFlagBitsKHR</type>   <name>videoCodecOperation</name></member>
+            <member><type>VkVideoChromaSubsamplingFlagsKHR</type>   <name>chromaSubsampling</name></member>
+            <member><type>VkVideoComponentBitDepthFlagsKHR</type>   <name>lumaBitDepth</name></member>
+            <member><type>VkVideoComponentBitDepthFlagsKHR</type>   <name>chromaBitDepth</name></member>
+        </type>
+        <type category="struct" name="VkVideoCapabilitiesKHR" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_CAPABILITIES_KHR"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkVideoCapabilityFlagsKHR</type>        <name>capabilityFlags</name></member>
+            <member><type>VkDeviceSize</type>                     <name>minBitstreamBufferOffsetAlignment</name></member>
+            <member><type>VkDeviceSize</type>                     <name>minBitstreamBufferSizeAlignment</name></member>
+            <member><type>VkExtent2D</type>                       <name>videoPictureExtentGranularity</name></member>
+            <member><type>VkExtent2D</type>                       <name>minExtent</name></member>
+            <member><type>VkExtent2D</type>                       <name>maxExtent</name></member>
+            <member><type>uint32_t</type>                         <name>maxReferencePicturesSlotsCount</name></member>
+            <member><type>uint32_t</type>                         <name>maxReferencePicturesActiveCount</name></member>
+        </type>
+        <type category="struct" name="VkVideoGetMemoryPropertiesKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_GET_MEMORY_PROPERTIES_KHR"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                       <name>pNext</name></member>
+            <member><type>uint32_t</type>                          <name>memoryBindIndex</name></member>
+            <member><type>VkMemoryRequirements2</type>*            <name>pMemoryRequirements</name></member>
+        </type>
+        <type category="struct" name="VkVideoBindMemoryKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_BIND_MEMORY_KHR"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                       <name>pNext</name></member>
+            <member><type>uint32_t</type>                          <name>memoryBindIndex</name></member>
+            <member><type>VkDeviceMemory</type>                    <name>memory</name></member>
+            <member><type>VkDeviceSize</type>                      <name>memoryOffset</name></member>
+            <member><type>VkDeviceSize</type>                      <name>memorySize</name></member>
+        </type>
+        <type category="struct" name="VkVideoPictureResourceKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_KHR"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*        <name>pNext</name></member>
+            <member><type>VkOffset2D</type>         <name>codedOffset</name><comment>The offset to be used for the picture resource, currently only used in field mode</comment></member>
+            <member><type>VkExtent2D</type>         <name>codedExtent</name><comment>The extent to be used for the picture resource</comment></member>
+            <member><type>uint32_t</type>           <name>baseArrayLayer</name><comment>TThe first array layer to be accessed for the Decode or Encode Operations</comment></member>
+            <member><type>VkImageView</type>        <name>imageViewBinding</name><comment>The ImageView binding of the resource</comment></member>
+        </type>
+        <type category="struct" name="VkVideoReferenceSlotKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_REFERENCE_SLOT_KHR"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*        <name>pNext</name></member>
+            <member><type>int8_t</type>             <name>slotIndex</name><comment>The reference slot index</comment></member>
+            <member>const <type>VkVideoPictureResourceKHR</type>* <name>pPictureResource</name><comment>The reference picture resource</comment></member>
+        </type>
+        <type category="struct" name="VkVideoDecodeInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_DECODE_INFO_KHR"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                            <name>pNext</name></member>
+            <member optional="true"><type>VkVideoDecodeFlagsKHR</type>  <name>flags</name></member>
+            <member><type>VkOffset2D</type>                             <name>codedOffset</name></member>
+            <member><type>VkExtent2D</type>                             <name>codedExtent</name></member>
+            <member><type>VkBuffer</type>                               <name>srcBuffer</name></member>
+            <member><type>VkDeviceSize</type>                           <name>srcBufferOffset</name></member>
+            <member><type>VkDeviceSize</type>                           <name>srcBufferRange</name></member>
+            <member><type>VkVideoPictureResourceKHR</type>              <name>dstPictureResource</name></member>
+            <member>const <type>VkVideoReferenceSlotKHR</type>*         <name>pSetupReferenceSlot</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>referenceSlotCount</name></member>
+            <member len="referenceSlotCount">const <type>VkVideoReferenceSlotKHR</type>* <name>pReferenceSlots</name></member>
+        </type>
+            <comment>Video Decode Codec Standard specific structures</comment>
+        <type category="include" name="vk_video/vulkan_video_codec_h264std.h">#include "vk_video/vulkan_video_codec_h264std.h"</type>
+        <type requires="vk_video/vulkan_video_codec_h264std.h" name="StdVideoH264ProfileIdc"/>
+        <type requires="vk_video/vulkan_video_codec_h264std.h" name="StdVideoH264Level"/>
+        <type requires="vk_video/vulkan_video_codec_h264std.h" name="StdVideoH264ChromaFormatIdc"/>
+        <type requires="vk_video/vulkan_video_codec_h264std.h" name="StdVideoH264PocType"/>
+        <type requires="vk_video/vulkan_video_codec_h264std.h" name="StdVideoH264SpsFlags"/>
+        <type requires="vk_video/vulkan_video_codec_h264std.h" name="StdVideoH264ScalingLists"/>
+        <type requires="vk_video/vulkan_video_codec_h264std.h" name="StdVideoH264SequenceParameterSetVui"/>
+        <type requires="vk_video/vulkan_video_codec_h264std.h" name="StdVideoH264AspectRatioIdc"/>
+        <type requires="vk_video/vulkan_video_codec_h264std.h" name="StdVideoH264HrdParameters"/>
+        <type requires="vk_video/vulkan_video_codec_h264std.h" name="StdVideoH264SpsVuiFlags"/>
+        <type requires="vk_video/vulkan_video_codec_h264std.h" name="StdVideoH264WeightedBipredIdc"/>
+        <type requires="vk_video/vulkan_video_codec_h264std.h" name="StdVideoH264PpsFlags"/>
+        <type requires="vk_video/vulkan_video_codec_h264std.h" name="StdVideoH264SliceType"/>
+        <type requires="vk_video/vulkan_video_codec_h264std.h" name="StdVideoH264CabacInitIdc"/>
+        <type requires="vk_video/vulkan_video_codec_h264std.h" name="StdVideoH264DisableDeblockingFilterIdc"/>
+        <type requires="vk_video/vulkan_video_codec_h264std.h" name="StdVideoH264PictureType"/>
+        <type requires="vk_video/vulkan_video_codec_h264std.h" name="StdVideoH264ModificationOfPicNumsIdc"/>
+        <type requires="vk_video/vulkan_video_codec_h264std.h" name="StdVideoH264MemMgmtControlOp"/>
+        <type category="include" name="vk_video/vulkan_video_codec_h264std_decode.h">#include "vk_video/vulkan_video_codec_h264std_decode.h"</type>
+        <type requires="vk_video/vulkan_video_codec_h264std_decode.h" name="StdVideoDecodeH264PictureInfo"/>
+        <type requires="vk_video/vulkan_video_codec_h264std_decode.h" name="StdVideoDecodeH264ReferenceInfo"/>
+        <type requires="vk_video/vulkan_video_codec_h264std_decode.h" name="StdVideoDecodeH264Mvc"/>
+        <type requires="vk_video/vulkan_video_codec_h264std_decode.h" name="StdVideoDecodeH264PictureInfoFlags"/>
+        <type requires="vk_video/vulkan_video_codec_h264std_decode.h" name="StdVideoDecodeH264ReferenceInfoFlags"/>
+        <type requires="vk_video/vulkan_video_codec_h264std_decode.h" name="StdVideoDecodeH264MvcElement"/>
+        <type requires="vk_video/vulkan_video_codec_h264std_decode.h" name="StdVideoDecodeH264MvcElementFlags"/>
+        <type category="struct" name="VkVideoDecodeH264ProfileEXT" structextends="VkVideoProfileKHR,VkQueryPoolCreateInfo,VkFormatProperties2,VkImageCreateInfo,VkImageViewCreateInfo,VkBufferCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                            <name>pNext</name></member>
+            <member><type>StdVideoH264ProfileIdc</type>                 <name>stdProfileIdc</name></member>
+            <member><type>VkVideoDecodeH264PictureLayoutFlagsEXT</type> <name>pictureLayout</name></member>
+        </type>
+        <type category="struct" name="VkVideoDecodeH264CapabilitiesEXT" returnedonly="true" structextends="VkVideoCapabilitiesKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>uint32_t</type>                         <name>maxLevel</name></member>
+            <member><type>VkOffset2D</type>                       <name>fieldOffsetGranularity</name></member>
+            <member><type>VkExtensionProperties</type>            <name>stdExtensionVersion</name></member>
+        </type>
+        <type category="struct" name="VkVideoDecodeH264SessionCreateInfoEXT" structextends="VkVideoSessionCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_CREATE_INFO_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkVideoDecodeH264CreateFlagsEXT</type>  <name>flags</name></member>
+            <member>const <type>VkExtensionProperties</type>*     <name>pStdExtensionVersion</name></member>
+        </type>
+        <type requires="vk_video/vulkan_video_codec_h264std.h" name="StdVideoH264SequenceParameterSet"/>
+        <type requires="vk_video/vulkan_video_codec_h264std.h" name="StdVideoH264PictureParameterSet"/>
+        <type category="struct" name="VkVideoDecodeH264SessionParametersAddInfoEXT" structextends="VkVideoSessionParametersUpdateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                               <name>pNext</name></member>
+            <member><type>uint32_t</type>                                                                  <name>spsStdCount</name></member>
+            <member len="spsStdCount" optional="true">const <type>StdVideoH264SequenceParameterSet</type>* <name>pSpsStd</name></member>
+            <member><type>uint32_t</type>                                                                  <name>ppsStdCount</name></member>
+            <member len="ppsStdCount" optional="true">const <type>StdVideoH264PictureParameterSet</type>*  <name>pPpsStd</name><comment>List of Picture Parameters associated with the spsStd, above</comment></member>
+        </type>
+        <type category="struct" name="VkVideoDecodeH264SessionParametersCreateInfoEXT" structextends="VkVideoSessionParametersCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                               <name>pNext</name></member>
+            <member><type>uint32_t</type>                                                                  <name>maxSpsStdCount</name></member>
+            <member><type>uint32_t</type>                                                                  <name>maxPpsStdCount</name></member>
+            <member optional="true">const <type>VkVideoDecodeH264SessionParametersAddInfoEXT</type>*       <name>pParametersAddInfo</name></member>
+        </type>
+        <type category="struct" name="VkVideoDecodeH264PictureInfoEXT" structextends="VkVideoDecodeInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PICTURE_INFO_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true" noautovalidity="true">const <type>void</type>*     <name>pNext</name></member>
+            <member>const <type>StdVideoDecodeH264PictureInfo</type>*  <name>pStdPictureInfo</name></member>
+            <member><type>uint32_t</type>                              <name>slicesCount</name></member>
+            <member len="slicesCount">const <type>uint32_t</type>*     <name>pSlicesDataOffsets</name></member>
+        </type>
+        <type category="struct" name="VkVideoDecodeH264DpbSlotInfoEXT" structextends="VkVideoReferenceSlotKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                            <name>pNext</name></member>
+            <member>const <type>StdVideoDecodeH264ReferenceInfo</type>* <name>pStdReferenceInfo</name></member>
+        </type>
+        <type category="struct" name="VkVideoDecodeH264MvcEXT" structextends="VkVideoDecodeH264PictureInfoEXT">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_MVC_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true" noautovalidity="true">const <type>void</type>*<name>pNext</name></member>
+            <member>const <type>StdVideoDecodeH264Mvc</type>*   <name>pStdMvc</name></member>
+        </type>
+        <type category="include" name="vk_video/vulkan_video_codec_h265std.h">#include "vk_video/vulkan_video_codec_h265std.h"</type>
+        <type requires="vk_video/vulkan_video_codec_h265std.h" name="StdVideoH265ProfileIdc"/>
+        <type requires="vk_video/vulkan_video_codec_h265std.h" name="StdVideoH265VideoParameterSet"/>
+        <type requires="vk_video/vulkan_video_codec_h265std.h" name="StdVideoH265SequenceParameterSet"/>
+        <type requires="vk_video/vulkan_video_codec_h265std.h" name="StdVideoH265PictureParameterSet"/>
+        <type requires="vk_video/vulkan_video_codec_h265std.h" name="StdVideoH265DecPicBufMgr"/>
+        <type requires="vk_video/vulkan_video_codec_h265std.h" name="StdVideoH265HrdParameters"/>
+        <type requires="vk_video/vulkan_video_codec_h265std.h" name="StdVideoH265VpsFlags"/>
+        <type requires="vk_video/vulkan_video_codec_h265std.h" name="StdVideoH265Level"/>
+        <type requires="vk_video/vulkan_video_codec_h265std.h" name="StdVideoH265SpsFlags"/>
+        <type requires="vk_video/vulkan_video_codec_h265std.h" name="StdVideoH265ScalingLists"/>
+        <type requires="vk_video/vulkan_video_codec_h265std.h" name="StdVideoH265SequenceParameterSetVui"/>
+        <type requires="vk_video/vulkan_video_codec_h265std.h" name="StdVideoH265PredictorPaletteEntries"/>
+        <type requires="vk_video/vulkan_video_codec_h265std.h" name="StdVideoH265PpsFlags"/>
+        <type requires="vk_video/vulkan_video_codec_h265std.h" name="StdVideoH265SubLayerHrdParameters"/>
+        <type requires="vk_video/vulkan_video_codec_h265std.h" name="StdVideoH265HrdFlags"/>
+        <type requires="vk_video/vulkan_video_codec_h265std.h" name="StdVideoH265SpsVuiFlags"/>
+        <type requires="vk_video/vulkan_video_codec_h265std.h" name="StdVideoH265SliceType"/>
+        <type requires="vk_video/vulkan_video_codec_h265std.h" name="StdVideoH265PictureType"/>
+        <type category="include" name="vk_video/vulkan_video_codec_h265std_decode.h">#include "vk_video/vulkan_video_codec_h265std_decode.h"</type>
+        <type requires="vk_video/vulkan_video_codec_h265std_decode.h" name="StdVideoDecodeH265PictureInfo"/>
+        <type requires="vk_video/vulkan_video_codec_h265std_decode.h" name="StdVideoDecodeH265ReferenceInfo"/>
+        <type requires="vk_video/vulkan_video_codec_h265std_decode.h" name="StdVideoDecodeH265PictureInfoFlags"/>
+        <type requires="vk_video/vulkan_video_codec_h265std_decode.h" name="StdVideoDecodeH265ReferenceInfoFlags"/>
+        <type category="struct" name="VkVideoDecodeH265ProfileEXT" structextends="VkVideoProfileKHR,VkQueryPoolCreateInfo,VkFormatProperties2,VkImageCreateInfo,VkImageViewCreateInfo,VkBufferCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                    <name>pNext</name></member>
+            <member><type>StdVideoH265ProfileIdc</type>         <name>stdProfileIdc</name></member>
+        </type>
+        <type category="struct" name="VkVideoDecodeH265CapabilitiesEXT" returnedonly="true" structextends="VkVideoCapabilitiesKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member><type>uint32_t</type>                         <name>maxLevel</name></member>
+            <member><type>VkExtensionProperties</type>            <name>stdExtensionVersion</name></member>
+        </type>
+        <type category="struct" name="VkVideoDecodeH265SessionCreateInfoEXT" structextends="VkVideoSessionCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_CREATE_INFO_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                      <name>pNext</name></member>
+            <member><type>VkVideoDecodeH265CreateFlagsEXT</type>  <name>flags</name></member>
+            <member>const <type>VkExtensionProperties</type>*     <name>pStdExtensionVersion</name></member>
+        </type>
+        <type category="struct" name="VkVideoDecodeH265SessionParametersAddInfoEXT" structextends="VkVideoSessionParametersUpdateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                               <name>pNext</name></member>
+            <member><type>uint32_t</type>                                                                  <name>spsStdCount</name></member>
+            <member len="spsStdCount" optional="true">const <type>StdVideoH265SequenceParameterSet</type>* <name>pSpsStd</name></member>
+            <member><type>uint32_t</type>                                                                  <name>ppsStdCount</name></member>
+            <member len="ppsStdCount" optional="true">const <type>StdVideoH265PictureParameterSet</type>*  <name>pPpsStd</name><comment>List of Picture Parameters associated with the spsStd, above</comment></member>
+        </type>
+        <type category="struct" name="VkVideoDecodeH265SessionParametersCreateInfoEXT" structextends="VkVideoSessionParametersCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                         <name>pNext</name></member>
+            <member><type>uint32_t</type>                                                            <name>maxSpsStdCount</name></member>
+            <member><type>uint32_t</type>                                                            <name>maxPpsStdCount</name></member>
+            <member optional="true">const <type>VkVideoDecodeH265SessionParametersAddInfoEXT</type>* <name>pParametersAddInfo</name></member>
+        </type>
+        <type category="struct" name="VkVideoDecodeH265PictureInfoEXT" structextends="VkVideoDecodeInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PICTURE_INFO_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                        <name>pNext</name></member>
+            <member><type>StdVideoDecodeH265PictureInfo</type>*     <name>pStdPictureInfo</name></member>
+            <member><type>uint32_t</type>                           <name>slicesCount</name></member>
+            <member len="slicesCount">const <type>uint32_t</type>*  <name>pSlicesDataOffsets</name></member>
+        </type>
+        <type category="struct" name="VkVideoDecodeH265DpbSlotInfoEXT" structextends="VkVideoReferenceSlotKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                             <name>pNext</name></member>
+            <member>const <type>StdVideoDecodeH265ReferenceInfo</type>*  <name>pStdReferenceInfo</name></member>
+        </type>
+        <type category="struct" name="VkVideoSessionCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_SESSION_CREATE_INFO_KHR"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                   <name>pNext</name></member>
+            <member><type>uint32_t</type>                                      <name>queueFamilyIndex</name></member>
+            <member optional="true"><type>VkVideoSessionCreateFlagsKHR</type>  <name>flags</name></member>
+            <member>const <type>VkVideoProfileKHR</type>*                      <name>pVideoProfile</name></member>
+            <member><type>VkFormat</type>                                      <name>pictureFormat</name></member>
+            <member><type>VkExtent2D</type>                                    <name>maxCodedExtent</name></member>
+            <member><type>VkFormat</type>                                      <name>referencePicturesFormat</name></member>
+            <member><type>uint32_t</type>                                      <name>maxReferencePicturesSlotsCount</name></member>
+            <member><type>uint32_t</type>                                      <name>maxReferencePicturesActiveCount</name></member>
+        </type>
+        <type category="struct" name="VkVideoSessionParametersCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                            <name>pNext</name></member>
+            <member optional="true"><type>VkVideoSessionParametersKHR</type>            <name>videoSessionParametersTemplate</name></member>
+            <member><type>VkVideoSessionKHR</type>                                      <name>videoSession</name></member>
+        </type>
+        <type category="struct" name="VkVideoSessionParametersUpdateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_UPDATE_INFO_KHR"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                            <name>pNext</name></member>
+            <member><type>uint32_t</type>                                               <name>updateSequenceCount</name></member>
+        </type>
+        <type category="struct" name="VkVideoBeginCodingInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_BEGIN_CODING_INFO_KHR"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                             <name>pNext</name></member>
+            <member optional="true"><type>VkVideoBeginCodingFlagsKHR</type>              <name>flags</name></member>
+            <member><type>VkVideoCodingQualityPresetFlagsKHR</type>                      <name>codecQualityPreset</name></member>
+            <member><type>VkVideoSessionKHR</type>                                       <name>videoSession</name></member>
+            <member optional="true"><type>VkVideoSessionParametersKHR</type>             <name>videoSessionParameters</name></member>
+            <member optional="true"><type>uint32_t</type>                                <name>referenceSlotCount</name></member>
+            <member len="referenceSlotCount">const <type>VkVideoReferenceSlotKHR</type>* <name>pReferenceSlots</name></member>
+        </type>
+        <type category="struct" name="VkVideoEndCodingInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_END_CODING_INFO_KHR"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                              <name>pNext</name></member>
+            <member optional="true"><type>VkVideoEndCodingFlagsKHR</type> <name>flags</name></member>
+        </type>
+        <type category="struct" name="VkVideoCodingControlInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_CODING_CONTROL_INFO_KHR"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                  <name>pNext</name></member>
+            <member optional="true"><type>VkVideoCodingControlFlagsKHR</type> <name>flags</name></member>
+        </type>
+        <type category="struct" name="VkVideoEncodeInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_ENCODE_INFO_KHR"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member optional="true"><type>VkVideoEncodeFlagsKHR</type>  <name>flags</name></member>
+            <member><type>uint32_t</type>                               <name>qualityLevel</name></member>
+            <member><type>VkExtent2D</type>                             <name>codedExtent</name></member>
+            <member><type>VkBuffer</type>                               <name>dstBitstreamBuffer</name></member>
+            <member><type>VkDeviceSize</type>                           <name>dstBitstreamBufferOffset</name></member>
+            <member><type>VkDeviceSize</type>                           <name>dstBitstreamBufferMaxRange</name></member>
+            <member><type>VkVideoPictureResourceKHR</type>              <name>srcPictureResource</name></member>
+            <member>const <type>VkVideoReferenceSlotKHR</type>*         <name>pSetupReferenceSlot</name></member>
+            <member optional="true"><type>uint32_t</type>               <name>referenceSlotCount</name></member>
+            <member len="referenceSlotCount">const <type>VkVideoReferenceSlotKHR</type>* <name>pReferenceSlots</name></member>
+        </type>
+        <type category="struct" name="VkVideoEncodeRateControlInfoKHR" structextends="VkVideoCodingControlInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_INFO_KHR"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                              <name>pNext</name></member>
+            <member><type>VkVideoEncodeRateControlFlagsKHR</type>         <name>flags</name></member>
+            <member><type>VkVideoEncodeRateControlModeFlagBitsKHR</type>  <name>rateControlMode</name></member>
+            <member><type>uint32_t</type>                                 <name>averageBitrate</name></member>
+            <member><type>uint16_t</type>                                 <name>peakToAverageBitrateRatio</name></member>
+            <member><type>uint16_t</type>                                 <name>frameRateNumerator</name></member>
+            <member><type>uint16_t</type>                                 <name>frameRateDenominator</name></member>
+            <member><type>uint32_t</type>                                 <name>virtualBufferSizeInMs</name></member>
+        </type>
+        <type category="struct" name="VkVideoEncodeH264CapabilitiesEXT" structextends="VkVideoCapabilitiesKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                           <name>pNext</name></member>
+            <member><type>VkVideoEncodeH264CapabilityFlagsEXT</type>   <name>flags</name></member>
+            <member><type>VkVideoEncodeH264InputModeFlagsEXT</type>    <name>inputModeFlags</name></member>
+            <member><type>VkVideoEncodeH264OutputModeFlagsEXT</type>   <name>outputModeFlags</name></member>
+            <member><type>VkExtent2D</type>                            <name>minPictureSizeInMbs</name></member>
+            <member><type>VkExtent2D</type>                            <name>maxPictureSizeInMbs</name></member>
+            <member><type>VkExtent2D</type>                            <name>inputImageDataAlignment</name></member>
+            <member><type>uint8_t</type>                               <name>maxNumL0ReferenceForP</name></member>
+            <member><type>uint8_t</type>                               <name>maxNumL0ReferenceForB</name></member>
+            <member><type>uint8_t</type>                               <name>maxNumL1Reference</name></member>
+            <member><type>uint8_t</type>                               <name>qualityLevelCount</name></member>
+            <member><type>VkExtensionProperties</type>                 <name>stdExtensionVersion</name></member>
+        </type>
+        <type category="struct" name="VkVideoEncodeH264SessionCreateInfoEXT" structextends="VkVideoSessionCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_CREATE_INFO_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                     <name>pNext</name></member>
+            <member><type>VkVideoEncodeH264CreateFlagsEXT</type> <name>flags</name></member>
+            <member><type>VkExtent2D</type>                      <name>maxPictureSizeInMbs</name></member>
+            <member>const <type>VkExtensionProperties</type>*    <name>pStdExtensionVersion</name></member>
+        </type>
+        <type category="include" name="vk_video/vulkan_video_codec_h264std_encode.h">#include "vk_video/vulkan_video_codec_h264std_encode.h"</type>
+        <type requires="vk_video/vulkan_video_codec_h264std_encode.h" name="StdVideoEncodeH264SliceHeader"/>
+        <type requires="vk_video/vulkan_video_codec_h264std_encode.h" name="StdVideoEncodeH264PictureInfo"/>
+        <type requires="vk_video/vulkan_video_codec_h264std_encode.h" name="StdVideoEncodeH264SliceHeaderFlags"/>
+        <type requires="vk_video/vulkan_video_codec_h264std_encode.h" name="StdVideoEncodeH264RefMemMgmtCtrlOperations"/>
+        <type requires="vk_video/vulkan_video_codec_h264std_encode.h" name="StdVideoEncodeH264PictureInfoFlags"/>
+        <type requires="vk_video/vulkan_video_codec_h264std_encode.h" name="StdVideoEncodeH264RefMgmtFlags"/>
+        <type requires="vk_video/vulkan_video_codec_h264std_encode.h" name="StdVideoEncodeH264RefListModEntry"/>
+        <type requires="vk_video/vulkan_video_codec_h264std_encode.h" name="StdVideoEncodeH264RefPicMarkingEntry"/>
+        <type category="struct" name="VkVideoEncodeH264SessionParametersAddInfoEXT" structextends="VkVideoSessionParametersUpdateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                               <name>pNext</name></member>
+            <member><type>uint32_t</type>                                                                  <name>spsStdCount</name></member>
+            <member len="spsStdCount" optional="true">const <type>StdVideoH264SequenceParameterSet</type>* <name>pSpsStd</name></member>
+            <member><type>uint32_t</type>                                                                  <name>ppsStdCount</name></member>
+            <member len="ppsStdCount" optional="true">const <type>StdVideoH264PictureParameterSet</type>*  <name>pPpsStd</name><comment>List of Picture Parameters associated with the spsStd, above</comment></member>
+        </type>
+        <type category="struct" name="VkVideoEncodeH264SessionParametersCreateInfoEXT" structextends="VkVideoSessionParametersCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                         <name>pNext</name></member>
+            <member><type>uint32_t</type>                                                            <name>maxSpsStdCount</name></member>
+            <member><type>uint32_t</type>                                                            <name>maxPpsStdCount</name></member>
+            <member optional="true">const <type>VkVideoEncodeH264SessionParametersAddInfoEXT</type>* <name>pParametersAddInfo</name></member>
+        </type>
+        <type category="struct" name="VkVideoEncodeH264DpbSlotInfoEXT">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_DPB_SLOT_INFO_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                          <name>pNext</name></member>
+            <member><type>int8_t</type>                                                               <name>slotIndex</name></member>
+            <member>const <type>StdVideoEncodeH264PictureInfo</type>*                                 <name>pStdPictureInfo</name></member>
+        </type>
+        <type category="struct" name="VkVideoEncodeH264VclFrameInfoEXT" structextends="VkVideoEncodeInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_VCL_FRAME_INFO_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                          <name>pNext</name></member>
+            <member><type>uint8_t</type>                                                              <name>refDefaultFinalList0EntryCount</name></member>
+            <member len="refDefaultFinalList0EntryCount">const <type>VkVideoEncodeH264DpbSlotInfoEXT</type>* <name>pRefDefaultFinalList0Entries</name></member>
+            <member><type>uint8_t</type>                                                              <name>refDefaultFinalList1EntryCount</name></member>
+            <member len="refDefaultFinalList1EntryCount">const <type>VkVideoEncodeH264DpbSlotInfoEXT</type>* <name>pRefDefaultFinalList1Entries</name></member>
+            <member><type>uint32_t</type>                                                             <name>naluSliceEntryCount</name></member>
+            <member len="naluSliceEntryCount">const <type>VkVideoEncodeH264NaluSliceEXT</type>*     <name>pNaluSliceEntries</name></member>
+            <member>const <type>VkVideoEncodeH264DpbSlotInfoEXT</type>*                               <name>pCurrentPictureInfo</name></member>
+        </type>
+        <type category="struct" name="VkVideoEncodeH264EmitPictureParametersEXT" structextends="VkVideoEncodeInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_EMIT_PICTURE_PARAMETERS_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                             <name>pNext</name></member>
+            <member><type>uint8_t</type>                                 <name>spsId</name></member>
+            <member><type>VkBool32</type>                                <name>emitSpsEnable</name></member>
+            <member><type>uint32_t</type>                                <name>ppsIdEntryCount</name></member>
+            <member len="ppsIdEntryCount">const <type>uint8_t</type>*  <name>ppsIdEntries</name></member>
+        </type>
+        <type category="struct" name="VkVideoEncodeH264ProfileEXT" structextends="VkVideoProfileKHR,VkQueryPoolCreateInfo,VkFormatProperties2,VkImageCreateInfo,VkImageViewCreateInfo,VkBufferCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                    <name>pNext</name></member>
+            <member><type>StdVideoH264ProfileIdc</type>         <name>stdProfileIdc</name></member>
+        </type>
+        <type category="struct" name="VkVideoEncodeH264NaluSliceEXT">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_NALU_SLICE_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                     <name>pNext</name></member>
+            <member>const <type>StdVideoEncodeH264SliceHeader</type>*            <name>pSliceHeaderStd</name></member>
+            <member><type>uint32_t</type>                                        <name>mbCount</name></member>
+            <member><type>uint8_t</type>                                         <name>refFinalList0EntryCount</name></member>
+            <member len="refFinalList0EntryCount">const <type>VkVideoEncodeH264DpbSlotInfoEXT</type>* <name>pRefFinalList0Entries</name></member>
+            <member><type>uint8_t</type>                                         <name>refFinalList1EntryCount</name></member>
+            <member len="refFinalList1EntryCount">const <type>VkVideoEncodeH264DpbSlotInfoEXT</type>* <name>pRefFinalList1Entries</name></member>
+            <member><type>uint32_t</type>                                        <name>precedingNaluBytes</name></member>
+            <member><type>uint8_t</type>                                         <name>minQp</name></member>
+            <member><type>uint8_t</type>                                         <name>maxQp</name></member>
+        </type>
+        <type category="struct" name="VkVideoEncodeH265CapabilitiesEXT" structextends="VkVideoCapabilitiesKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*           <name>pNext</name></member>
+            <member><type>VkVideoEncodeH265CapabilityFlagsEXT</type>   <name>flags</name></member>
+            <member><type>VkVideoEncodeH265InputModeFlagsEXT</type>    <name>inputModeFlags</name></member>
+            <member><type>VkVideoEncodeH265OutputModeFlagsEXT</type>   <name>outputModeFlags</name></member>
+            <member><type>VkVideoEncodeH265CtbSizeFlagsEXT</type>      <name>ctbSizes</name></member>
+            <member><type>VkExtent2D</type>                            <name>inputImageDataAlignment</name></member>
+            <member><type>uint8_t</type>                               <name>maxNumL0ReferenceForP</name></member>
+            <member><type>uint8_t</type>                               <name>maxNumL0ReferenceForB</name></member>
+            <member><type>uint8_t</type>                               <name>maxNumL1Reference</name></member>
+            <member><type>uint8_t</type>                               <name>maxNumSubLayers</name></member>
+            <member><type>uint8_t</type>                               <name>qualityLevelCount</name></member>
+            <member><type>VkExtensionProperties</type>                 <name>stdExtensionVersion</name></member>
+        </type>
+        <type category="struct" name="VkVideoEncodeH265SessionCreateInfoEXT" structextends="VkVideoSessionCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_CREATE_INFO_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*      <name>pNext</name></member>
+            <member><type>VkVideoEncodeH265CreateFlagsEXT</type>  <name>flags</name></member>
+            <member>const <type>VkExtensionProperties</type>*     <name>pStdExtensionVersion</name></member>
+        </type>
+        <type category="include" name="vk_video/vulkan_video_codec_h265std_encode.h">#include "vk_video/vulkan_video_codec_h265std_encode.h"</type>
+        <type requires="vk_video/vulkan_video_codec_h265std_encode.h" name="StdVideoEncodeH265PictureInfoFlags"/>
+        <type requires="vk_video/vulkan_video_codec_h265std_encode.h" name="StdVideoEncodeH265SliceSegmentHeader"/>
+        <type requires="vk_video/vulkan_video_codec_h265std_encode.h" name="StdVideoEncodeH265PictureInfo"/>
+        <type requires="vk_video/vulkan_video_codec_h265std_encode.h" name="StdVideoEncodeH265SliceHeader"/>
+        <type requires="vk_video/vulkan_video_codec_h265std_encode.h" name="StdVideoEncodeH265ReferenceInfo"/>
+        <type requires="vk_video/vulkan_video_codec_h265std_encode.h" name="StdVideoEncodeH265ReferenceModifications"/>
+        <type requires="vk_video/vulkan_video_codec_h265std_encode.h" name="StdVideoEncodeH265SliceHeaderFlags"/>
+        <type requires="vk_video/vulkan_video_codec_h265std_encode.h" name="StdVideoEncodeH265ReferenceInfoFlags"/>
+        <type requires="vk_video/vulkan_video_codec_h265std_encode.h" name="StdVideoEncodeH265ReferenceModificationFlags"/>
+        <type category="struct" name="VkVideoEncodeH265SessionParametersAddInfoEXT" structextends="VkVideoSessionParametersUpdateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                               <name>pNext</name></member>
+            <member><type>uint32_t</type>                                                                  <name>vpsStdCount</name></member>
+            <member len="vpsStdCount" optional="true">const <type>StdVideoH265VideoParameterSet</type>*    <name>pVpsStd</name></member>
+            <member><type>uint32_t</type>                                                                  <name>spsStdCount</name></member>
+            <member len="spsStdCount" optional="true">const <type>StdVideoH265SequenceParameterSet</type>* <name>pSpsStd</name></member>
+            <member><type>uint32_t</type>                                                                  <name>ppsStdCount</name></member>
+            <member len="ppsStdCount" optional="true">const <type>StdVideoH265PictureParameterSet</type>*  <name>pPpsStd</name><comment>List of Picture Parameters associated with the spsStd, above</comment></member>
+        </type>
+        <type category="struct" name="VkVideoEncodeH265SessionParametersCreateInfoEXT" structextends="VkVideoSessionParametersCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                         <name>pNext</name></member>
+            <member><type>uint32_t</type>                                                            <name>maxVpsStdCount</name></member>
+            <member><type>uint32_t</type>                                                            <name>maxSpsStdCount</name></member>
+            <member><type>uint32_t</type>                                                            <name>maxPpsStdCount</name></member>
+            <member optional="true">const <type>VkVideoEncodeH265SessionParametersAddInfoEXT</type>* <name>pParametersAddInfo</name></member>
+        </type>
+        <type category="struct" name="VkVideoEncodeH265VclFrameInfoEXT" structextends="VkVideoEncodeInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_VCL_FRAME_INFO_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                       <name>pNext</name></member>
+            <member optional="true">const <type>VkVideoEncodeH265ReferenceListsEXT</type>*         <name>pReferenceFinalLists</name></member>
+            <member><type>uint32_t</type>                                                          <name>naluSliceEntryCount</name></member>
+            <member len="naluSliceEntryCount">const <type>VkVideoEncodeH265NaluSliceEXT</type>*    <name>pNaluSliceEntries</name></member>
+            <member>const <type>StdVideoEncodeH265PictureInfo</type>*                              <name>pCurrentPictureInfo</name></member>
+        </type>
+        <type category="struct" name="VkVideoEncodeH265EmitPictureParametersEXT" structextends="VkVideoEncodeInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_EMIT_PICTURE_PARAMETERS_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*             <name>pNext</name></member>
+            <member><type>uint8_t</type>                                 <name>vpsId</name></member>
+            <member><type>uint8_t</type>                                 <name>spsId</name></member>
+            <member><type>VkBool32</type>                                <name>emitVpsEnable</name></member>
+            <member><type>VkBool32</type>                                <name>emitSpsEnable</name></member>
+            <member optional="true"><type>uint32_t</type>                <name>ppsIdEntryCount</name></member>
+            <member len="ppsIdEntryCount">const <type>uint8_t</type>*    <name>ppsIdEntries</name></member>
+        </type>
+        <type category="struct" name="VkVideoEncodeH265NaluSliceEXT">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_NALU_SLICE_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                <name>pNext</name></member>
+            <member><type>uint32_t</type>                                                   <name>ctbCount</name></member>
+            <member optional="true">const <type>VkVideoEncodeH265ReferenceListsEXT</type>*  <name>pReferenceFinalLists</name></member>
+            <member>const <type>StdVideoEncodeH265SliceHeader</type>*                       <name>pSliceHeaderStd</name></member>
+        </type>
+        <type category="struct" name="VkVideoEncodeH265ProfileEXT" structextends="VkVideoProfileKHR,VkQueryPoolCreateInfo,VkFormatProperties2,VkImageCreateInfo,VkImageViewCreateInfo,VkBufferCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*    <name>pNext</name></member>
+            <member><type>StdVideoH265ProfileIdc</type>         <name>stdProfileIdc</name></member>
+        </type>
+        <type category="struct" name="VkVideoEncodeH265DpbSlotInfoEXT">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_DPB_SLOT_INFO_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*              <name>pNext</name></member>
+            <member><type>int8_t</type>                                   <name>slotIndex</name></member>
+            <member>const <type>StdVideoEncodeH265ReferenceInfo</type>*   <name>pStdReferenceInfo</name></member>
+        </type>
+        <type category="struct" name="VkVideoEncodeH265ReferenceListsEXT">
+            <member values="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_REFERENCE_LISTS_EXT"><type>VkStructureType</type><name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                            <name>pNext</name></member>
+            <member optional="true"><type>uint8_t</type>                                                <name>referenceList0EntryCount</name></member>
+            <member len="referenceList0EntryCount">const <type>VkVideoEncodeH265DpbSlotInfoEXT</type>*  <name>pReferenceList0Entries</name></member>
+            <member optional="true"><type>uint8_t</type>                                                <name>referenceList1EntryCount</name></member>
+            <member len="referenceList1EntryCount">const <type>VkVideoEncodeH265DpbSlotInfoEXT</type>*  <name>pReferenceList1Entries</name></member>
+            <member>const <type>StdVideoEncodeH265ReferenceModifications</type>*                        <name>pReferenceModifications</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceInheritedViewportScissorFeaturesNV" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                               <name>pNext</name></member>
+            <member><type>VkBool32</type>                            <name>inheritedViewportScissor2D</name></member>
+        </type>
+        <type category="struct" name="VkCommandBufferInheritanceViewportScissorInfoNV" structextends="VkCommandBufferInheritanceInfo">
+            <member values="VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                    <name>pNext</name></member>
+            <member><type>VkBool32</type>                                       <name>viewportScissor2D</name></member>
+            <member><type>uint32_t</type>                                       <name>viewportDepthCount</name></member>
+            <member noautovalidity="true">const <type>VkViewport</type>*        <name>pViewportDepths</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                     <name>ycbcr2plane444Formats</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceProvokingVertexFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true" noautovalidity="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>provokingVertexLast</name></member>
+            <member><type>VkBool32</type>                           <name>transformFeedbackPreservesProvokingVertex</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceProvokingVertexPropertiesEXT" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                               <name>pNext</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>                            <name>provokingVertexModePerPipeline</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>                            <name>transformFeedbackPreservesTriangleFanProvokingVertex</name></member>
+        </type>
+        <type category="struct" name="VkPipelineRasterizationProvokingVertexStateCreateInfoEXT" structextends="VkPipelineRasterizationStateCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                        <name>pNext</name></member>
+            <member><type>VkProvokingVertexModeEXT</type>           <name>provokingVertexMode</name></member>
+        </type>
+        <type category="struct" name="VkCuModuleCreateInfoNVX">
+            <member values="VK_STRUCTURE_TYPE_CU_MODULE_CREATE_INFO_NVX"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member><type>size_t</type>                 <name>dataSize</name></member>
+            <member len="dataSize">const <type>void</type>*            <name>pData</name></member>
+        </type>
+        <type category="struct" name="VkCuFunctionCreateInfoNVX">
+            <member values="VK_STRUCTURE_TYPE_CU_FUNCTION_CREATE_INFO_NVX"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                        <name>pNext</name></member>
+            <member><type>VkCuModuleNVX</type>                      <name>module</name></member>
+            <member len="null-terminated">const <type>char</type>*  <name>pName</name></member>
+        </type>
+        <type category="struct" name="VkCuLaunchInfoNVX">
+            <member values="VK_STRUCTURE_TYPE_CU_LAUNCH_INFO_NVX"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member><type>VkCuFunctionNVX</type>        <name>function</name></member>
+            <member><type>uint32_t</type>               <name>gridDimX</name></member>
+            <member><type>uint32_t</type>               <name>gridDimY</name></member>
+            <member><type>uint32_t</type>               <name>gridDimZ</name></member>
+            <member><type>uint32_t</type>               <name>blockDimX</name></member>
+            <member><type>uint32_t</type>               <name>blockDimY</name></member>
+            <member><type>uint32_t</type>               <name>blockDimZ</name></member>
+            <member><type>uint32_t</type>               <name>sharedMemBytes</name></member>
+            <member><type>size_t</type>                 <name>paramCount</name></member>
+            <member len="paramCount">const <type>void</type>* const *    <name>pParams</name></member>
+            <member><type>size_t</type>                 <name>extraCount</name></member>
+            <member len="extraCount">const <type>void</type>* const *    <name>pExtras</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*               <name>pNext</name></member>
+            <member><type>VkBool32</type>                            <name>shaderIntegerDotProduct</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*               <name>pNext</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProduct8BitUnsignedAccelerated</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProduct8BitSignedAccelerated</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProduct8BitMixedSignednessAccelerated</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProduct4x8BitPackedUnsignedAccelerated</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProduct4x8BitPackedSignedAccelerated</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProduct4x8BitPackedMixedSignednessAccelerated</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProduct16BitUnsignedAccelerated</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProduct16BitSignedAccelerated</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProduct16BitMixedSignednessAccelerated</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProduct32BitUnsignedAccelerated</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProduct32BitSignedAccelerated</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProduct32BitMixedSignednessAccelerated</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProduct64BitUnsignedAccelerated</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProduct64BitSignedAccelerated</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProduct64BitMixedSignednessAccelerated</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProductAccumulatingSaturating8BitUnsignedAccelerated</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProductAccumulatingSaturating8BitSignedAccelerated</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProductAccumulatingSaturating16BitUnsignedAccelerated</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProductAccumulatingSaturating16BitSignedAccelerated</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProductAccumulatingSaturating32BitUnsignedAccelerated</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProductAccumulatingSaturating32BitSignedAccelerated</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProductAccumulatingSaturating64BitUnsignedAccelerated</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProductAccumulatingSaturating64BitSignedAccelerated</name></member>
+            <member limittype="bitmask"><type>VkBool32</type>        <name>integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceDrmPropertiesEXT" returnedonly="true" structextends="VkPhysicalDeviceProperties2">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>* <name>pNext</name></member>
+            <member limittype="bitmask"><type>VkBool32</type> <name>hasPrimary</name></member>
+            <member limittype="bitmask"><type>VkBool32</type> <name>hasRender</name></member>
+            <member limittype="noauto"><type>int64_t</type> <name>primaryMajor</name></member>
+            <member limittype="noauto"><type>int64_t</type> <name>primaryMinor</name></member>
+            <member limittype="noauto"><type>int64_t</type> <name>renderMajor</name></member>
+            <member limittype="noauto"><type>int64_t</type> <name>renderMinor</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceRayTracingMotionBlurFeaturesNV" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true" noautovalidity="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>rayTracingMotionBlur</name></member>
+            <member><type>VkBool32</type>                           <name>rayTracingMotionBlurPipelineTraceRaysIndirect</name></member>
+        </type>
+        <type name="VkAccelerationStructureMotionInstanceTypeNV" category="enum"/>
+        <type category="struct" name="VkAccelerationStructureGeometryMotionTrianglesDataNV" structextends="VkAccelerationStructureGeometryTrianglesDataKHR">
+            <member values="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                   <name>pNext</name></member>
+            <member noautovalidity="true"><type>VkDeviceOrHostAddressConstKHR</type>                 <name>vertexData</name></member>
+        </type>
+        <type category="struct" name="VkAccelerationStructureMotionInfoNV" structextends="VkAccelerationStructureCreateInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                    <name>pNext</name></member>
+            <member><type>uint32_t</type>                                       <name>maxInstances</name></member>
+            <member optional="true"><type>VkAccelerationStructureMotionInfoFlagsNV</type> <name>flags</name></member>
+        </type>
+        <type category="struct" name="VkSRTDataNV">
+            <member><type>float</type> <name>sx</name></member>
+            <member><type>float</type> <name>a</name></member>
+            <member><type>float</type> <name>b</name></member>
+            <member><type>float</type> <name>pvx</name></member>
+            <member><type>float</type> <name>sy</name></member>
+            <member><type>float</type> <name>c</name></member>
+            <member><type>float</type> <name>pvy</name></member>
+            <member><type>float</type> <name>sz</name></member>
+            <member><type>float</type> <name>pvz</name></member>
+            <member><type>float</type> <name>qx</name></member>
+            <member><type>float</type> <name>qy</name></member>
+            <member><type>float</type> <name>qz</name></member>
+            <member><type>float</type> <name>qw</name></member>
+            <member><type>float</type> <name>tx</name></member>
+            <member><type>float</type> <name>ty</name></member>
+            <member><type>float</type> <name>tz</name></member>
+        </type>
+        <type category="struct" name="VkAccelerationStructureSRTMotionInstanceNV">
+            <comment>The bitfields in this structure are non-normative since bitfield ordering is implementation-defined in C. The specification defines the normative layout.</comment>
+            <member><type>VkSRTDataNV</type>                                             <name>transformT0</name></member>
+            <member><type>VkSRTDataNV</type>                                             <name>transformT1</name></member>
+            <member><type>uint32_t</type>                                                <name>instanceCustomIndex</name>:24</member>
+            <member><type>uint32_t</type>                                                <name>mask</name>:8</member>
+            <member><type>uint32_t</type>                                                <name>instanceShaderBindingTableRecordOffset</name>:24</member>
+            <member optional="true"><type>VkGeometryInstanceFlagsKHR</type>              <name>flags</name>:8</member>
+            <member><type>uint64_t</type>                                                <name>accelerationStructureReference</name></member>
+        </type>
+        <type category="struct" name="VkAccelerationStructureMatrixMotionInstanceNV">
+            <comment>The bitfields in this structure are non-normative since bitfield ordering is implementation-defined in C. The specification defines the normative layout.</comment>
+            <member><type>VkTransformMatrixKHR</type>                                    <name>transformT0</name></member>
+            <member><type>VkTransformMatrixKHR</type>                                    <name>transformT1</name></member>
+            <member><type>uint32_t</type>                                                <name>instanceCustomIndex</name>:24</member>
+            <member><type>uint32_t</type>                                                <name>mask</name>:8</member>
+            <member><type>uint32_t</type>                                                <name>instanceShaderBindingTableRecordOffset</name>:24</member>
+            <member optional="true"><type>VkGeometryInstanceFlagsKHR</type>              <name>flags</name>:8</member>
+            <member><type>uint64_t</type>                                                <name>accelerationStructureReference</name></member>
+        </type>
+        <type category="union" name="VkAccelerationStructureMotionInstanceDataNV">
+            <member selection="VK_ACCELERATION_STRUCTURE_MOTION_INSTANCE_TYPE_STATIC_NV"><type>VkAccelerationStructureInstanceKHR</type>            <name>staticInstance</name></member>
+            <member selection="VK_ACCELERATION_STRUCTURE_MOTION_INSTANCE_TYPE_MATRIX_MOTION_NV"><type>VkAccelerationStructureMatrixMotionInstanceNV</type> <name>matrixMotionInstance</name></member>
+            <member selection="VK_ACCELERATION_STRUCTURE_MOTION_INSTANCE_TYPE_SRT_MOTION_NV"><type>VkAccelerationStructureSRTMotionInstanceNV</type>    <name>srtMotionInstance</name></member>
+        </type>
+        <type category="struct" name="VkAccelerationStructureMotionInstanceNV">
+            <member><type>VkAccelerationStructureMotionInstanceTypeNV</type> <name>type</name></member>
+            <member optional="true"><type>VkAccelerationStructureMotionInstanceFlagsNV</type> <name>flags</name></member>
+            <member selector="type"><type>VkAccelerationStructureMotionInstanceDataNV</type> <name>data</name></member>
+        </type>
+        <type category="basetype">typedef <type>void</type>* <name>VkRemoteAddressNV</name>;</type>
+        <type category="struct" name="VkMemoryGetRemoteAddressInfoNV">
+            <member values="VK_STRUCTURE_TYPE_MEMORY_GET_REMOTE_ADDRESS_INFO_NV"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*        <name>pNext</name></member>
+            <member><type>VkDeviceMemory</type>                     <name>memory</name></member>
+            <member><type>VkExternalMemoryHandleTypeFlagBits</type> <name>handleType</name></member>
+        </type>
+        <type category="struct" name="VkImportMemoryBufferCollectionFUCHSIA" structextends="VkMemoryAllocateInfo">
+            <member values="VK_STRUCTURE_TYPE_IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*      <name>pNext</name></member>
+            <member><type>VkBufferCollectionFUCHSIA</type>        <name>collection</name></member>
+            <member><type>uint32_t</type>                         <name>index</name></member>
+        </type>
+        <type category="struct" name="VkBufferCollectionImageCreateInfoFUCHSIA" structextends="VkImageCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*      <name>pNext</name></member>
+            <member><type>VkBufferCollectionFUCHSIA</type>        <name>collection</name></member>
+            <member><type>uint32_t</type>                         <name>index</name></member>
+        </type>
+        <type category="struct" name="VkBufferCollectionBufferCreateInfoFUCHSIA" structextends="VkBufferCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*      <name>pNext</name></member>
+            <member><type>VkBufferCollectionFUCHSIA</type>        <name>collection</name></member>
+            <member><type>uint32_t</type>                         <name>index</name></member>
+        </type>
+        <type category="struct" name="VkBufferCollectionCreateInfoFUCHSIA">
+            <member values="VK_STRUCTURE_TYPE_BUFFER_COLLECTION_CREATE_INFO_FUCHSIA"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*      <name>pNext</name></member>
+            <member><type>zx_handle_t</type>                      <name>collectionToken</name></member>
+        </type>
+        <type category="struct" name="VkBufferCollectionPropertiesFUCHSIA">
+            <member values="VK_STRUCTURE_TYPE_BUFFER_COLLECTION_PROPERTIES_FUCHSIA"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*            <name>pNext</name></member>
+            <member><type>uint32_t</type>                         <name>memoryTypeBits</name></member>
+            <member><type>uint32_t</type>                         <name>bufferCount</name></member>
+            <member><type>uint32_t</type>                         <name>createInfoIndex</name></member>
+            <member><type>uint64_t</type>                         <name>sysmemPixelFormat</name></member>
+            <member><type>VkFormatFeatureFlags</type>             <name>formatFeatures</name></member>
+            <member><type>VkSysmemColorSpaceFUCHSIA</type>        <name>sysmemColorSpaceIndex</name></member>
+            <member><type>VkComponentMapping</type>               <name>samplerYcbcrConversionComponents</name></member>
+            <member><type>VkSamplerYcbcrModelConversion</type>    <name>suggestedYcbcrModel</name></member>
+            <member><type>VkSamplerYcbcrRange</type>              <name>suggestedYcbcrRange</name></member>
+            <member><type>VkChromaLocation</type>                 <name>suggestedXChromaOffset</name></member>
+            <member><type>VkChromaLocation</type>                 <name>suggestedYChromaOffset</name></member>
+        </type>
+        <type category="struct" name="VkBufferConstraintsInfoFUCHSIA">
+            <member values="VK_STRUCTURE_TYPE_BUFFER_CONSTRAINTS_INFO_FUCHSIA"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*               <name>pNext</name></member>
+            <member><type>VkBufferCreateInfo</type>                        <name>createInfo</name></member>
+            <member optional="true"><type>VkFormatFeatureFlags</type>      <name>requiredFormatFeatures</name></member>
+            <member><type>VkBufferCollectionConstraintsInfoFUCHSIA</type>  <name>bufferCollectionConstraints</name></member>
+        </type>
+        <type category="struct" name="VkSysmemColorSpaceFUCHSIA">
+            <member values="VK_STRUCTURE_TYPE_SYSMEM_COLOR_SPACE_FUCHSIA"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*     <name>pNext</name></member>
+            <member><type>uint32_t</type>                        <name>colorSpace</name></member>
+        </type>
+        <type category="struct" name="VkImageFormatConstraintsInfoFUCHSIA">
+            <member values="VK_STRUCTURE_TYPE_IMAGE_FORMAT_CONSTRAINTS_INFO_FUCHSIA"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                            <name>pNext</name></member>
+            <member><type>VkImageCreateInfo</type>                                      <name>imageCreateInfo</name></member>
+            <member><type>VkFormatFeatureFlags</type>                                   <name>requiredFormatFeatures</name></member>
+            <member optional="true"><type>VkImageFormatConstraintsFlagsFUCHSIA</type>   <name>flags</name></member>
+            <member optional="true"><type>uint64_t</type>                               <name>sysmemPixelFormat</name></member>
+            <member><type>uint32_t</type>                                               <name>colorSpaceCount</name></member>
+            <member>const <type>VkSysmemColorSpaceFUCHSIA</type>*                       <name>pColorSpaces</name></member>
+        </type>
+        <type category="struct" name="VkImageConstraintsInfoFUCHSIA">
+            <member values="VK_STRUCTURE_TYPE_IMAGE_CONSTRAINTS_INFO_FUCHSIA"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                      <name>pNext</name></member>
+            <member><type>uint32_t</type>                                                         <name>formatConstraintsCount</name></member>
+            <member len="formatConstraintsCount">const <type>VkImageFormatConstraintsInfoFUCHSIA</type>* <name>pFormatConstraints</name></member>
+            <member><type>VkBufferCollectionConstraintsInfoFUCHSIA</type>                         <name>bufferCollectionConstraints</name></member>
+            <member optional="true"><type>VkImageConstraintsInfoFlagsFUCHSIA</type>               <name>flags</name></member>
+        </type>
+        <type category="struct" name="VkBufferCollectionConstraintsInfoFUCHSIA">
+            <member values="VK_STRUCTURE_TYPE_BUFFER_COLLECTION_CONSTRAINTS_INFO_FUCHSIA"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*     <name>pNext</name></member>
+            <member><type>uint32_t</type>                        <name>minBufferCount</name></member>
+            <member><type>uint32_t</type>                        <name>maxBufferCount</name></member>
+            <member><type>uint32_t</type>                        <name>minBufferCountForCamping</name></member>
+            <member><type>uint32_t</type>                        <name>minBufferCountForDedicatedSlack</name></member>
+            <member><type>uint32_t</type>                        <name>minBufferCountForSharedSlack</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true" noautovalidity="true"><type>void</type>*        <name>pNext</name></member>
+            <member><type>VkBool32</type>                           <name>formatRgba10x6WithoutYCbCrSampler</name></member>
+        </type>
+        <type category="struct" name="VkFormatProperties3KHR" returnedonly="true" structextends="VkFormatProperties2">
+            <member values="VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                            <name>pNext</name></member>
+            <member optional="true"><type>VkFormatFeatureFlags2KHR</type>         <name>linearTilingFeatures</name></member>
+            <member optional="true"><type>VkFormatFeatureFlags2KHR</type>         <name>optimalTilingFeatures</name></member>
+            <member optional="true"><type>VkFormatFeatureFlags2KHR</type>         <name>bufferFeatures</name></member>
+        </type>
+        <type category="struct" name="VkDrmFormatModifierPropertiesList2EXT" returnedonly="true" structextends="VkFormatProperties2">
+            <member values="VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>* <name>pNext</name></member>
+            <member optional="true"><type>uint32_t</type> <name>drmFormatModifierCount</name></member>
+            <member optional="true,false" len="drmFormatModifierCount"><type>VkDrmFormatModifierProperties2EXT</type>* <name>pDrmFormatModifierProperties</name></member>
+        </type>
+        <type category="struct" name="VkDrmFormatModifierProperties2EXT" returnedonly="true">
+            <member><type>uint64_t</type> <name>drmFormatModifier</name></member>
+            <member><type>uint32_t</type> <name>drmFormatModifierPlaneCount</name></member>
+            <member><type>VkFormatFeatureFlags2KHR</type> <name>drmFormatModifierTilingFeatures</name></member>
+        </type>
+        <type category="struct" name="VkAndroidHardwareBufferFormatProperties2ANDROID" structextends="VkAndroidHardwareBufferPropertiesANDROID" returnedonly="true">
+            <member values="VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true"><type>void</type>*                              <name>pNext</name></member>
+            <member><type>VkFormat</type>                           <name>format</name></member>
+            <member><type>uint64_t</type>                           <name>externalFormat</name></member>
+            <member><type>VkFormatFeatureFlags2KHR</type>           <name>formatFeatures</name></member>
+            <member><type>VkComponentMapping</type>                 <name>samplerYcbcrConversionComponents</name></member>
+            <member><type>VkSamplerYcbcrModelConversion</type>      <name>suggestedYcbcrModel</name></member>
+            <member><type>VkSamplerYcbcrRange</type>                <name>suggestedYcbcrRange</name></member>
+            <member><type>VkChromaLocation</type>                   <name>suggestedXChromaOffset</name></member>
+            <member><type>VkChromaLocation</type>                   <name>suggestedYChromaOffset</name></member>
+        </type>
+        <type category="struct" name="VkPipelineRenderingCreateInfoKHR" structextends="VkGraphicsPipelineCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                <name>pNext</name></member>
+            <member><type>uint32_t</type>                                                                   <name>viewMask</name></member>
+            <member optional="true"><type>uint32_t</type>                                                   <name>colorAttachmentCount</name></member>
+            <member len="colorAttachmentCount">const <type>VkFormat</type>*                                 <name>pColorAttachmentFormats</name></member>
+            <member><type>VkFormat</type>                                                                   <name>depthAttachmentFormat</name></member>
+            <member><type>VkFormat</type>                                                                   <name>stencilAttachmentFormat</name></member>
+        </type>
+        <type category="struct" name="VkRenderingInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_RENDERING_INFO_KHR"><type>VkStructureType</type>              <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                <name>pNext</name></member>
+            <member optional="true"><type>VkRenderingFlagsKHR</type>                                        <name>flags</name></member>
+            <member><type>VkRect2D</type>                                                                   <name>renderArea</name></member>
+            <member><type>uint32_t</type>                                                                   <name>layerCount</name></member>
+            <member><type>uint32_t</type>                                                                   <name>viewMask</name></member>
+            <member optional="true"><type>uint32_t</type>                                                   <name>colorAttachmentCount</name></member>
+            <member len="colorAttachmentCount">const <type>VkRenderingAttachmentInfoKHR</type>*             <name>pColorAttachments</name></member>
+            <member optional="true">const <type>VkRenderingAttachmentInfoKHR</type>*                        <name>pDepthAttachment</name></member>
+            <member optional="true">const <type>VkRenderingAttachmentInfoKHR</type>*                        <name>pStencilAttachment</name></member>
+        </type>
+        <type category="struct" name="VkRenderingAttachmentInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO_KHR"><type>VkStructureType</type>   <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                <name>pNext</name></member>
+            <member optional="true"><type>VkImageView</type>                                                <name>imageView</name></member>
+            <member><type>VkImageLayout</type>                                                              <name>imageLayout</name></member>
+            <member optional="true"><type>VkResolveModeFlagBits</type>                                      <name>resolveMode</name></member>
+            <member optional="true"><type>VkImageView</type>                                                <name>resolveImageView</name></member>
+            <member><type>VkImageLayout</type>                                                              <name>resolveImageLayout</name></member>
+            <member><type>VkAttachmentLoadOp</type>                                                         <name>loadOp</name></member>
+            <member><type>VkAttachmentStoreOp</type>                                                        <name>storeOp</name></member>
+            <member><type>VkClearValue</type>                                                               <name>clearValue</name></member>
+        </type>
+        <type category="struct" name="VkRenderingFragmentShadingRateAttachmentInfoKHR" structextends="VkRenderingInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member  optional="true">const <type>void</type>*                                               <name>pNext</name></member>
+            <member optional="true"><type>VkImageView</type>                                                <name>imageView</name></member>
+            <member><type>VkImageLayout</type>                                                              <name>imageLayout</name></member>
+            <member><type>VkExtent2D</type>                                                                 <name>shadingRateAttachmentTexelSize</name></member>
+        </type>
+        <type category="struct" name="VkRenderingFragmentDensityMapAttachmentInfoEXT" structextends="VkRenderingInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                <name>pNext</name></member>
+            <member><type>VkImageView</type>                                                                <name>imageView</name></member>
+            <member><type>VkImageLayout</type>                                                              <name>imageLayout</name></member>
+        </type>
+        <type category="struct" name="VkPhysicalDeviceDynamicRenderingFeaturesKHR" structextends="VkPhysicalDeviceFeatures2,VkDeviceCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true" noautovalidity="true"><type>void</type>*                                <name>pNext</name></member>
+            <member><type>VkBool32</type>                                                                   <name>dynamicRendering</name></member>
+        </type>
+        <type category="struct" name="VkCommandBufferInheritanceRenderingInfoKHR" structextends="VkCommandBufferInheritanceInfo">
+            <member values="VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO_KHR"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                <name>pNext</name></member>
+            <member optional="true"><type>VkRenderingFlagsKHR</type>                                        <name>flags</name></member>
+            <member><type>uint32_t</type>                                                                   <name>viewMask</name></member>
+            <member><type>uint32_t</type>                                                                   <name>colorAttachmentCount</name></member>
+            <member len="colorAttachmentCount">const <type>VkFormat</type>*                                 <name>pColorAttachmentFormats</name></member>
+            <member><type>VkFormat</type>                                                                   <name>depthAttachmentFormat</name></member>
+            <member><type>VkFormat</type>                                                                   <name>stencilAttachmentFormat</name></member>
+            <member optional="true"><type>VkSampleCountFlagBits</type>                                      <name>rasterizationSamples</name></member>
+        </type>
+        <type category="struct" name="VkAttachmentSampleCountInfoAMD" structextends="VkCommandBufferInheritanceInfo,VkGraphicsPipelineCreateInfo">
+            <member values="VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*                                                <name>pNext</name></member>
+            <member><type>uint32_t</type>                                                                   <name>colorAttachmentCount</name></member>
+            <member optional="false,true" len="colorAttachmentCount">const <type>VkSampleCountFlagBits</type>* <name>pColorAttachmentSamples</name></member>
+            <member optional="true"><type>VkSampleCountFlagBits</type>                                      <name>depthStencilAttachmentSamples</name></member>
+        </type>
+        <type category="struct" name="VkAttachmentSampleCountInfoNV" alias="VkAttachmentSampleCountInfoAMD"/>
+        <type category="struct" name="VkMultiviewPerViewAttributesInfoNVX" structextends="VkCommandBufferInheritanceInfo,VkGraphicsPipelineCreateInfo,VkRenderingInfoKHR">
+            <member values="VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX"><type>VkStructureType</type> <name>sType</name></member>
+            <member optional="true">const <type>void</type>*            <name>pNext</name></member>
+            <member><type>VkBool32</type>                               <name>perViewAttributes</name></member>
+            <member><type>VkBool32</type>                               <name>perViewAttributesPositionXOnly</name></member>
+        </type>
+    </types>
+    <comment>Vulkan enumerant (token) definitions</comment>
+
+    <enums name="API Constants" comment="Vulkan hardcoded constants - not an enumerated type, part of the header boilerplate">
+        <enum type="uint32_t" value="256"       name="VK_MAX_PHYSICAL_DEVICE_NAME_SIZE"/>
+        <enum type="uint32_t" value="16"        name="VK_UUID_SIZE"/>
+        <enum type="uint32_t" value="8"         name="VK_LUID_SIZE"/>
+        <enum                                   name="VK_LUID_SIZE_KHR" alias="VK_LUID_SIZE"/>
+        <enum type="uint32_t" value="256"       name="VK_MAX_EXTENSION_NAME_SIZE"/>
+        <enum type="uint32_t" value="256"       name="VK_MAX_DESCRIPTION_SIZE"/>
+        <enum type="uint32_t" value="32"        name="VK_MAX_MEMORY_TYPES"/>
+        <enum type="uint32_t" value="16"        name="VK_MAX_MEMORY_HEAPS" comment="The maximum number of unique memory heaps, each of which supporting 1 or more memory types"/>
+        <enum type="float"    value="1000.0F"   name="VK_LOD_CLAMP_NONE"/>
+        <enum type="uint32_t" value="(~0U)"     name="VK_REMAINING_MIP_LEVELS"/>
+        <enum type="uint32_t" value="(~0U)"     name="VK_REMAINING_ARRAY_LAYERS"/>
+        <enum type="uint64_t" value="(~0ULL)"   name="VK_WHOLE_SIZE"/>
+        <enum type="uint32_t" value="(~0U)"     name="VK_ATTACHMENT_UNUSED"/>
+        <enum type="uint32_t" value="1"         name="VK_TRUE"/>
+        <enum type="uint32_t" value="0"         name="VK_FALSE"/>
+        <enum type="uint32_t" value="(~0U)"     name="VK_QUEUE_FAMILY_IGNORED"/>
+        <enum type="uint32_t" value="(~1U)"     name="VK_QUEUE_FAMILY_EXTERNAL"/>
+        <enum                                   name="VK_QUEUE_FAMILY_EXTERNAL_KHR" alias="VK_QUEUE_FAMILY_EXTERNAL"/>
+        <enum type="uint32_t" value="(~2U)"     name="VK_QUEUE_FAMILY_FOREIGN_EXT"/>
+        <enum type="uint32_t" value="(~0U)"     name="VK_SUBPASS_EXTERNAL"/>
+        <enum type="uint32_t" value="32"        name="VK_MAX_DEVICE_GROUP_SIZE"/>
+        <enum                                   name="VK_MAX_DEVICE_GROUP_SIZE_KHR" alias="VK_MAX_DEVICE_GROUP_SIZE"/>
+        <enum type="uint32_t" value="256"       name="VK_MAX_DRIVER_NAME_SIZE"/>
+        <enum                                   name="VK_MAX_DRIVER_NAME_SIZE_KHR" alias="VK_MAX_DRIVER_NAME_SIZE"/>
+        <enum type="uint32_t" value="256"       name="VK_MAX_DRIVER_INFO_SIZE"/>
+        <enum                                   name="VK_MAX_DRIVER_INFO_SIZE_KHR" alias="VK_MAX_DRIVER_INFO_SIZE"/>
+        <enum type="uint32_t" value="(~0U)"     name="VK_SHADER_UNUSED_KHR"/>
+        <enum                                   name="VK_SHADER_UNUSED_NV" alias="VK_SHADER_UNUSED_KHR"/>
+        <enum type="uint32_t" value="16"        name="VK_MAX_GLOBAL_PRIORITY_SIZE_EXT"/>
+    </enums>
+
+    <comment>
+        Unlike OpenGL, most tokens in Vulkan are actual typed enumerants in
+        their own numeric namespaces. The "name" attribute is the C enum
+        type name, and is pulled in from a type tag definition above
+        (slightly clunky, but retains the type / enum distinction). "type"
+        attributes of "enum" or "bitmask" indicate that these values should
+        be generated inside an appropriate definition.
+    </comment>
+
+    <enums name="VkImageLayout" type="enum">
+        <enum value="0"     name="VK_IMAGE_LAYOUT_UNDEFINED"                         comment="Implicit layout an image is when its contents are undefined due to various reasons (e.g. right after creation)"/>
+        <enum value="1"     name="VK_IMAGE_LAYOUT_GENERAL"                           comment="General layout when image can be used for any kind of access"/>
+        <enum value="2"     name="VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL"          comment="Optimal layout when image is only used for color attachment read/write"/>
+        <enum value="3"     name="VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL"  comment="Optimal layout when image is only used for depth/stencil attachment read/write"/>
+        <enum value="4"     name="VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL"   comment="Optimal layout when image is used for read only depth/stencil attachment and shader access"/>
+        <enum value="5"     name="VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL"          comment="Optimal layout when image is used for read only shader access"/>
+        <enum value="6"     name="VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL"              comment="Optimal layout when image is used only as source of transfer operations"/>
+        <enum value="7"     name="VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL"              comment="Optimal layout when image is used only as destination of transfer operations"/>
+        <enum value="8"     name="VK_IMAGE_LAYOUT_PREINITIALIZED"                    comment="Initial layout used when the data is populated by the CPU"/>
+    </enums>
+    <enums name="VkAttachmentLoadOp" type="enum">
+        <enum value="0"     name="VK_ATTACHMENT_LOAD_OP_LOAD"/>
+        <enum value="1"     name="VK_ATTACHMENT_LOAD_OP_CLEAR"/>
+        <enum value="2"     name="VK_ATTACHMENT_LOAD_OP_DONT_CARE"/>
+    </enums>
+    <enums name="VkAttachmentStoreOp" type="enum">
+        <enum value="0"     name="VK_ATTACHMENT_STORE_OP_STORE"/>
+        <enum value="1"     name="VK_ATTACHMENT_STORE_OP_DONT_CARE"/>
+    </enums>
+    <enums name="VkImageType" type="enum">
+        <enum value="0"     name="VK_IMAGE_TYPE_1D"/>
+        <enum value="1"     name="VK_IMAGE_TYPE_2D"/>
+        <enum value="2"     name="VK_IMAGE_TYPE_3D"/>
+    </enums>
+    <enums name="VkImageTiling" type="enum">
+        <enum value="0"     name="VK_IMAGE_TILING_OPTIMAL"/>
+        <enum value="1"     name="VK_IMAGE_TILING_LINEAR"/>
+    </enums>
+    <enums name="VkImageViewType" type="enum">
+        <enum value="0"     name="VK_IMAGE_VIEW_TYPE_1D"/>
+        <enum value="1"     name="VK_IMAGE_VIEW_TYPE_2D"/>
+        <enum value="2"     name="VK_IMAGE_VIEW_TYPE_3D"/>
+        <enum value="3"     name="VK_IMAGE_VIEW_TYPE_CUBE"/>
+        <enum value="4"     name="VK_IMAGE_VIEW_TYPE_1D_ARRAY"/>
+        <enum value="5"     name="VK_IMAGE_VIEW_TYPE_2D_ARRAY"/>
+        <enum value="6"     name="VK_IMAGE_VIEW_TYPE_CUBE_ARRAY"/>
+    </enums>
+    <enums name="VkCommandBufferLevel" type="enum">
+        <enum value="0"     name="VK_COMMAND_BUFFER_LEVEL_PRIMARY"/>
+        <enum value="1"     name="VK_COMMAND_BUFFER_LEVEL_SECONDARY"/>
+    </enums>
+    <enums name="VkComponentSwizzle" type="enum">
+        <enum value="0"     name="VK_COMPONENT_SWIZZLE_IDENTITY"/>
+        <enum value="1"     name="VK_COMPONENT_SWIZZLE_ZERO"/>
+        <enum value="2"     name="VK_COMPONENT_SWIZZLE_ONE"/>
+        <enum value="3"     name="VK_COMPONENT_SWIZZLE_R"/>
+        <enum value="4"     name="VK_COMPONENT_SWIZZLE_G"/>
+        <enum value="5"     name="VK_COMPONENT_SWIZZLE_B"/>
+        <enum value="6"     name="VK_COMPONENT_SWIZZLE_A"/>
+    </enums>
+    <enums name="VkDescriptorType" type="enum">
+        <enum value="0"     name="VK_DESCRIPTOR_TYPE_SAMPLER"/>
+        <enum value="1"     name="VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER"/>
+        <enum value="2"     name="VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE"/>
+        <enum value="3"     name="VK_DESCRIPTOR_TYPE_STORAGE_IMAGE"/>
+        <enum value="4"     name="VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER"/>
+        <enum value="5"     name="VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER"/>
+        <enum value="6"     name="VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER"/>
+        <enum value="7"     name="VK_DESCRIPTOR_TYPE_STORAGE_BUFFER"/>
+        <enum value="8"     name="VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC"/>
+        <enum value="9"     name="VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC"/>
+        <enum value="10"    name="VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT"/>
+    </enums>
+    <enums name="VkQueryType" type="enum">
+        <enum value="0"     name="VK_QUERY_TYPE_OCCLUSION"/>
+        <enum value="1"     name="VK_QUERY_TYPE_PIPELINE_STATISTICS"                 comment="Optional"/>
+        <enum value="2"     name="VK_QUERY_TYPE_TIMESTAMP"/>
+    </enums>
+    <enums name="VkBorderColor" type="enum">
+        <enum value="0"     name="VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK"/>
+        <enum value="1"     name="VK_BORDER_COLOR_INT_TRANSPARENT_BLACK"/>
+        <enum value="2"     name="VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK"/>
+        <enum value="3"     name="VK_BORDER_COLOR_INT_OPAQUE_BLACK"/>
+        <enum value="4"     name="VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE"/>
+        <enum value="5"     name="VK_BORDER_COLOR_INT_OPAQUE_WHITE"/>
+    </enums>
+    <enums name="VkPipelineBindPoint" type="enum">
+        <enum value="0"     name="VK_PIPELINE_BIND_POINT_GRAPHICS"/>
+        <enum value="1"     name="VK_PIPELINE_BIND_POINT_COMPUTE"/>
+    </enums>
+    <enums name="VkPipelineCacheHeaderVersion" type="enum">
+        <enum value="1"     name="VK_PIPELINE_CACHE_HEADER_VERSION_ONE"/>
+    </enums>
+    <enums name="VkPipelineCacheCreateFlagBits" type="bitmask">
+    </enums>
+    <enums name="VkPrimitiveTopology" type="enum">
+        <enum value="0"     name="VK_PRIMITIVE_TOPOLOGY_POINT_LIST"/>
+        <enum value="1"     name="VK_PRIMITIVE_TOPOLOGY_LINE_LIST"/>
+        <enum value="2"     name="VK_PRIMITIVE_TOPOLOGY_LINE_STRIP"/>
+        <enum value="3"     name="VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST"/>
+        <enum value="4"     name="VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP"/>
+        <enum value="5"     name="VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN"/>
+        <enum value="6"     name="VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY"/>
+        <enum value="7"     name="VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY"/>
+        <enum value="8"     name="VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY"/>
+        <enum value="9"     name="VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY"/>
+        <enum value="10"    name="VK_PRIMITIVE_TOPOLOGY_PATCH_LIST"/>
+    </enums>
+    <enums name="VkSharingMode" type="enum">
+        <enum value="0"     name="VK_SHARING_MODE_EXCLUSIVE"/>
+        <enum value="1"     name="VK_SHARING_MODE_CONCURRENT"/>
+    </enums>
+    <enums name="VkIndexType" type="enum">
+        <enum value="0"     name="VK_INDEX_TYPE_UINT16"/>
+        <enum value="1"     name="VK_INDEX_TYPE_UINT32"/>
+    </enums>
+    <enums name="VkFilter" type="enum">
+        <enum value="0"     name="VK_FILTER_NEAREST"/>
+        <enum value="1"     name="VK_FILTER_LINEAR"/>
+    </enums>
+    <enums name="VkSamplerMipmapMode" type="enum">
+        <enum value="0"     name="VK_SAMPLER_MIPMAP_MODE_NEAREST"                        comment="Choose nearest mip level"/>
+        <enum value="1"     name="VK_SAMPLER_MIPMAP_MODE_LINEAR"                         comment="Linear filter between mip levels"/>
+    </enums>
+    <enums name="VkSamplerAddressMode" type="enum">
+        <enum value="0"     name="VK_SAMPLER_ADDRESS_MODE_REPEAT"/>
+        <enum value="1"     name="VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT"/>
+        <enum value="2"     name="VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE"/>
+        <enum value="3"     name="VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER"/>
+            <comment>
+                value="4" reserved for VK_KHR_sampler_mirror_clamp_to_edge
+                enum VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE; do not
+                alias!
+            </comment>
+    </enums>
+    <enums name="VkCompareOp" type="enum">
+        <enum value="0"     name="VK_COMPARE_OP_NEVER"/>
+        <enum value="1"     name="VK_COMPARE_OP_LESS"/>
+        <enum value="2"     name="VK_COMPARE_OP_EQUAL"/>
+        <enum value="3"     name="VK_COMPARE_OP_LESS_OR_EQUAL"/>
+        <enum value="4"     name="VK_COMPARE_OP_GREATER"/>
+        <enum value="5"     name="VK_COMPARE_OP_NOT_EQUAL"/>
+        <enum value="6"     name="VK_COMPARE_OP_GREATER_OR_EQUAL"/>
+        <enum value="7"     name="VK_COMPARE_OP_ALWAYS"/>
+    </enums>
+    <enums name="VkPolygonMode" type="enum">
+        <enum value="0"     name="VK_POLYGON_MODE_FILL"/>
+        <enum value="1"     name="VK_POLYGON_MODE_LINE"/>
+        <enum value="2"     name="VK_POLYGON_MODE_POINT"/>
+    </enums>
+    <enums name="VkFrontFace" type="enum">
+        <enum value="0"     name="VK_FRONT_FACE_COUNTER_CLOCKWISE"/>
+        <enum value="1"     name="VK_FRONT_FACE_CLOCKWISE"/>
+    </enums>
+    <enums name="VkBlendFactor" type="enum">
+        <enum value="0"     name="VK_BLEND_FACTOR_ZERO"/>
+        <enum value="1"     name="VK_BLEND_FACTOR_ONE"/>
+        <enum value="2"     name="VK_BLEND_FACTOR_SRC_COLOR"/>
+        <enum value="3"     name="VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR"/>
+        <enum value="4"     name="VK_BLEND_FACTOR_DST_COLOR"/>
+        <enum value="5"     name="VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR"/>
+        <enum value="6"     name="VK_BLEND_FACTOR_SRC_ALPHA"/>
+        <enum value="7"     name="VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA"/>
+        <enum value="8"     name="VK_BLEND_FACTOR_DST_ALPHA"/>
+        <enum value="9"     name="VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA"/>
+        <enum value="10"    name="VK_BLEND_FACTOR_CONSTANT_COLOR"/>
+        <enum value="11"    name="VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR"/>
+        <enum value="12"    name="VK_BLEND_FACTOR_CONSTANT_ALPHA"/>
+        <enum value="13"    name="VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA"/>
+        <enum value="14"    name="VK_BLEND_FACTOR_SRC_ALPHA_SATURATE"/>
+        <enum value="15"    name="VK_BLEND_FACTOR_SRC1_COLOR"/>
+        <enum value="16"    name="VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR"/>
+        <enum value="17"    name="VK_BLEND_FACTOR_SRC1_ALPHA"/>
+        <enum value="18"    name="VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA"/>
+    </enums>
+    <enums name="VkBlendOp" type="enum">
+        <enum value="0"     name="VK_BLEND_OP_ADD"/>
+        <enum value="1"     name="VK_BLEND_OP_SUBTRACT"/>
+        <enum value="2"     name="VK_BLEND_OP_REVERSE_SUBTRACT"/>
+        <enum value="3"     name="VK_BLEND_OP_MIN"/>
+        <enum value="4"     name="VK_BLEND_OP_MAX"/>
+    </enums>
+    <enums name="VkStencilOp" type="enum">
+        <enum value="0"     name="VK_STENCIL_OP_KEEP"/>
+        <enum value="1"     name="VK_STENCIL_OP_ZERO"/>
+        <enum value="2"     name="VK_STENCIL_OP_REPLACE"/>
+        <enum value="3"     name="VK_STENCIL_OP_INCREMENT_AND_CLAMP"/>
+        <enum value="4"     name="VK_STENCIL_OP_DECREMENT_AND_CLAMP"/>
+        <enum value="5"     name="VK_STENCIL_OP_INVERT"/>
+        <enum value="6"     name="VK_STENCIL_OP_INCREMENT_AND_WRAP"/>
+        <enum value="7"     name="VK_STENCIL_OP_DECREMENT_AND_WRAP"/>
+    </enums>
+    <enums name="VkLogicOp" type="enum">
+        <enum value="0"     name="VK_LOGIC_OP_CLEAR"/>
+        <enum value="1"     name="VK_LOGIC_OP_AND"/>
+        <enum value="2"     name="VK_LOGIC_OP_AND_REVERSE"/>
+        <enum value="3"     name="VK_LOGIC_OP_COPY"/>
+        <enum value="4"     name="VK_LOGIC_OP_AND_INVERTED"/>
+        <enum value="5"     name="VK_LOGIC_OP_NO_OP"/>
+        <enum value="6"     name="VK_LOGIC_OP_XOR"/>
+        <enum value="7"     name="VK_LOGIC_OP_OR"/>
+        <enum value="8"     name="VK_LOGIC_OP_NOR"/>
+        <enum value="9"     name="VK_LOGIC_OP_EQUIVALENT"/>
+        <enum value="10"    name="VK_LOGIC_OP_INVERT"/>
+        <enum value="11"    name="VK_LOGIC_OP_OR_REVERSE"/>
+        <enum value="12"    name="VK_LOGIC_OP_COPY_INVERTED"/>
+        <enum value="13"    name="VK_LOGIC_OP_OR_INVERTED"/>
+        <enum value="14"    name="VK_LOGIC_OP_NAND"/>
+        <enum value="15"    name="VK_LOGIC_OP_SET"/>
+    </enums>
+    <enums name="VkInternalAllocationType" type="enum">
+        <enum value="0"     name="VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE"/>
+    </enums>
+    <enums name="VkSystemAllocationScope" type="enum">
+        <enum value="0"     name="VK_SYSTEM_ALLOCATION_SCOPE_COMMAND"/>
+        <enum value="1"     name="VK_SYSTEM_ALLOCATION_SCOPE_OBJECT"/>
+        <enum value="2"     name="VK_SYSTEM_ALLOCATION_SCOPE_CACHE"/>
+        <enum value="3"     name="VK_SYSTEM_ALLOCATION_SCOPE_DEVICE"/>
+        <enum value="4"     name="VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE"/>
+    </enums>
+    <enums name="VkPhysicalDeviceType" type="enum">
+        <enum value="0"     name="VK_PHYSICAL_DEVICE_TYPE_OTHER"/>
+        <enum value="1"     name="VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU"/>
+        <enum value="2"     name="VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU"/>
+        <enum value="3"     name="VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU"/>
+        <enum value="4"     name="VK_PHYSICAL_DEVICE_TYPE_CPU"/>
+    </enums>
+    <enums name="VkVertexInputRate" type="enum">
+        <enum value="0"     name="VK_VERTEX_INPUT_RATE_VERTEX"/>
+        <enum value="1"     name="VK_VERTEX_INPUT_RATE_INSTANCE"/>
+    </enums>
+    <enums name="VkFormat" type="enum" comment="Vulkan format definitions">
+        <enum value="0"     name="VK_FORMAT_UNDEFINED"/>
+        <enum value="1"     name="VK_FORMAT_R4G4_UNORM_PACK8"/>
+        <enum value="2"     name="VK_FORMAT_R4G4B4A4_UNORM_PACK16"/>
+        <enum value="3"     name="VK_FORMAT_B4G4R4A4_UNORM_PACK16"/>
+        <enum value="4"     name="VK_FORMAT_R5G6B5_UNORM_PACK16"/>
+        <enum value="5"     name="VK_FORMAT_B5G6R5_UNORM_PACK16"/>
+        <enum value="6"     name="VK_FORMAT_R5G5B5A1_UNORM_PACK16"/>
+        <enum value="7"     name="VK_FORMAT_B5G5R5A1_UNORM_PACK16"/>
+        <enum value="8"     name="VK_FORMAT_A1R5G5B5_UNORM_PACK16"/>
+        <enum value="9"     name="VK_FORMAT_R8_UNORM"/>
+        <enum value="10"    name="VK_FORMAT_R8_SNORM"/>
+        <enum value="11"    name="VK_FORMAT_R8_USCALED"/>
+        <enum value="12"    name="VK_FORMAT_R8_SSCALED"/>
+        <enum value="13"    name="VK_FORMAT_R8_UINT"/>
+        <enum value="14"    name="VK_FORMAT_R8_SINT"/>
+        <enum value="15"    name="VK_FORMAT_R8_SRGB"/>
+        <enum value="16"    name="VK_FORMAT_R8G8_UNORM"/>
+        <enum value="17"    name="VK_FORMAT_R8G8_SNORM"/>
+        <enum value="18"    name="VK_FORMAT_R8G8_USCALED"/>
+        <enum value="19"    name="VK_FORMAT_R8G8_SSCALED"/>
+        <enum value="20"    name="VK_FORMAT_R8G8_UINT"/>
+        <enum value="21"    name="VK_FORMAT_R8G8_SINT"/>
+        <enum value="22"    name="VK_FORMAT_R8G8_SRGB"/>
+        <enum value="23"    name="VK_FORMAT_R8G8B8_UNORM"/>
+        <enum value="24"    name="VK_FORMAT_R8G8B8_SNORM"/>
+        <enum value="25"    name="VK_FORMAT_R8G8B8_USCALED"/>
+        <enum value="26"    name="VK_FORMAT_R8G8B8_SSCALED"/>
+        <enum value="27"    name="VK_FORMAT_R8G8B8_UINT"/>
+        <enum value="28"    name="VK_FORMAT_R8G8B8_SINT"/>
+        <enum value="29"    name="VK_FORMAT_R8G8B8_SRGB"/>
+        <enum value="30"    name="VK_FORMAT_B8G8R8_UNORM"/>
+        <enum value="31"    name="VK_FORMAT_B8G8R8_SNORM"/>
+        <enum value="32"    name="VK_FORMAT_B8G8R8_USCALED"/>
+        <enum value="33"    name="VK_FORMAT_B8G8R8_SSCALED"/>
+        <enum value="34"    name="VK_FORMAT_B8G8R8_UINT"/>
+        <enum value="35"    name="VK_FORMAT_B8G8R8_SINT"/>
+        <enum value="36"    name="VK_FORMAT_B8G8R8_SRGB"/>
+        <enum value="37"    name="VK_FORMAT_R8G8B8A8_UNORM"/>
+        <enum value="38"    name="VK_FORMAT_R8G8B8A8_SNORM"/>
+        <enum value="39"    name="VK_FORMAT_R8G8B8A8_USCALED"/>
+        <enum value="40"    name="VK_FORMAT_R8G8B8A8_SSCALED"/>
+        <enum value="41"    name="VK_FORMAT_R8G8B8A8_UINT"/>
+        <enum value="42"    name="VK_FORMAT_R8G8B8A8_SINT"/>
+        <enum value="43"    name="VK_FORMAT_R8G8B8A8_SRGB"/>
+        <enum value="44"    name="VK_FORMAT_B8G8R8A8_UNORM"/>
+        <enum value="45"    name="VK_FORMAT_B8G8R8A8_SNORM"/>
+        <enum value="46"    name="VK_FORMAT_B8G8R8A8_USCALED"/>
+        <enum value="47"    name="VK_FORMAT_B8G8R8A8_SSCALED"/>
+        <enum value="48"    name="VK_FORMAT_B8G8R8A8_UINT"/>
+        <enum value="49"    name="VK_FORMAT_B8G8R8A8_SINT"/>
+        <enum value="50"    name="VK_FORMAT_B8G8R8A8_SRGB"/>
+        <enum value="51"    name="VK_FORMAT_A8B8G8R8_UNORM_PACK32"/>
+        <enum value="52"    name="VK_FORMAT_A8B8G8R8_SNORM_PACK32"/>
+        <enum value="53"    name="VK_FORMAT_A8B8G8R8_USCALED_PACK32"/>
+        <enum value="54"    name="VK_FORMAT_A8B8G8R8_SSCALED_PACK32"/>
+        <enum value="55"    name="VK_FORMAT_A8B8G8R8_UINT_PACK32"/>
+        <enum value="56"    name="VK_FORMAT_A8B8G8R8_SINT_PACK32"/>
+        <enum value="57"    name="VK_FORMAT_A8B8G8R8_SRGB_PACK32"/>
+        <enum value="58"    name="VK_FORMAT_A2R10G10B10_UNORM_PACK32"/>
+        <enum value="59"    name="VK_FORMAT_A2R10G10B10_SNORM_PACK32"/>
+        <enum value="60"    name="VK_FORMAT_A2R10G10B10_USCALED_PACK32"/>
+        <enum value="61"    name="VK_FORMAT_A2R10G10B10_SSCALED_PACK32"/>
+        <enum value="62"    name="VK_FORMAT_A2R10G10B10_UINT_PACK32"/>
+        <enum value="63"    name="VK_FORMAT_A2R10G10B10_SINT_PACK32"/>
+        <enum value="64"    name="VK_FORMAT_A2B10G10R10_UNORM_PACK32"/>
+        <enum value="65"    name="VK_FORMAT_A2B10G10R10_SNORM_PACK32"/>
+        <enum value="66"    name="VK_FORMAT_A2B10G10R10_USCALED_PACK32"/>
+        <enum value="67"    name="VK_FORMAT_A2B10G10R10_SSCALED_PACK32"/>
+        <enum value="68"    name="VK_FORMAT_A2B10G10R10_UINT_PACK32"/>
+        <enum value="69"    name="VK_FORMAT_A2B10G10R10_SINT_PACK32"/>
+        <enum value="70"    name="VK_FORMAT_R16_UNORM"/>
+        <enum value="71"    name="VK_FORMAT_R16_SNORM"/>
+        <enum value="72"    name="VK_FORMAT_R16_USCALED"/>
+        <enum value="73"    name="VK_FORMAT_R16_SSCALED"/>
+        <enum value="74"    name="VK_FORMAT_R16_UINT"/>
+        <enum value="75"    name="VK_FORMAT_R16_SINT"/>
+        <enum value="76"    name="VK_FORMAT_R16_SFLOAT"/>
+        <enum value="77"    name="VK_FORMAT_R16G16_UNORM"/>
+        <enum value="78"    name="VK_FORMAT_R16G16_SNORM"/>
+        <enum value="79"    name="VK_FORMAT_R16G16_USCALED"/>
+        <enum value="80"    name="VK_FORMAT_R16G16_SSCALED"/>
+        <enum value="81"    name="VK_FORMAT_R16G16_UINT"/>
+        <enum value="82"    name="VK_FORMAT_R16G16_SINT"/>
+        <enum value="83"    name="VK_FORMAT_R16G16_SFLOAT"/>
+        <enum value="84"    name="VK_FORMAT_R16G16B16_UNORM"/>
+        <enum value="85"    name="VK_FORMAT_R16G16B16_SNORM"/>
+        <enum value="86"    name="VK_FORMAT_R16G16B16_USCALED"/>
+        <enum value="87"    name="VK_FORMAT_R16G16B16_SSCALED"/>
+        <enum value="88"    name="VK_FORMAT_R16G16B16_UINT"/>
+        <enum value="89"    name="VK_FORMAT_R16G16B16_SINT"/>
+        <enum value="90"    name="VK_FORMAT_R16G16B16_SFLOAT"/>
+        <enum value="91"    name="VK_FORMAT_R16G16B16A16_UNORM"/>
+        <enum value="92"    name="VK_FORMAT_R16G16B16A16_SNORM"/>
+        <enum value="93"    name="VK_FORMAT_R16G16B16A16_USCALED"/>
+        <enum value="94"    name="VK_FORMAT_R16G16B16A16_SSCALED"/>
+        <enum value="95"    name="VK_FORMAT_R16G16B16A16_UINT"/>
+        <enum value="96"    name="VK_FORMAT_R16G16B16A16_SINT"/>
+        <enum value="97"    name="VK_FORMAT_R16G16B16A16_SFLOAT"/>
+        <enum value="98"    name="VK_FORMAT_R32_UINT"/>
+        <enum value="99"    name="VK_FORMAT_R32_SINT"/>
+        <enum value="100"   name="VK_FORMAT_R32_SFLOAT"/>
+        <enum value="101"   name="VK_FORMAT_R32G32_UINT"/>
+        <enum value="102"   name="VK_FORMAT_R32G32_SINT"/>
+        <enum value="103"   name="VK_FORMAT_R32G32_SFLOAT"/>
+        <enum value="104"   name="VK_FORMAT_R32G32B32_UINT"/>
+        <enum value="105"   name="VK_FORMAT_R32G32B32_SINT"/>
+        <enum value="106"   name="VK_FORMAT_R32G32B32_SFLOAT"/>
+        <enum value="107"   name="VK_FORMAT_R32G32B32A32_UINT"/>
+        <enum value="108"   name="VK_FORMAT_R32G32B32A32_SINT"/>
+        <enum value="109"   name="VK_FORMAT_R32G32B32A32_SFLOAT"/>
+        <enum value="110"   name="VK_FORMAT_R64_UINT"/>
+        <enum value="111"   name="VK_FORMAT_R64_SINT"/>
+        <enum value="112"   name="VK_FORMAT_R64_SFLOAT"/>
+        <enum value="113"   name="VK_FORMAT_R64G64_UINT"/>
+        <enum value="114"   name="VK_FORMAT_R64G64_SINT"/>
+        <enum value="115"   name="VK_FORMAT_R64G64_SFLOAT"/>
+        <enum value="116"   name="VK_FORMAT_R64G64B64_UINT"/>
+        <enum value="117"   name="VK_FORMAT_R64G64B64_SINT"/>
+        <enum value="118"   name="VK_FORMAT_R64G64B64_SFLOAT"/>
+        <enum value="119"   name="VK_FORMAT_R64G64B64A64_UINT"/>
+        <enum value="120"   name="VK_FORMAT_R64G64B64A64_SINT"/>
+        <enum value="121"   name="VK_FORMAT_R64G64B64A64_SFLOAT"/>
+        <enum value="122"   name="VK_FORMAT_B10G11R11_UFLOAT_PACK32"/>
+        <enum value="123"   name="VK_FORMAT_E5B9G9R9_UFLOAT_PACK32"/>
+        <enum value="124"   name="VK_FORMAT_D16_UNORM"/>
+        <enum value="125"   name="VK_FORMAT_X8_D24_UNORM_PACK32"/>
+        <enum value="126"   name="VK_FORMAT_D32_SFLOAT"/>
+        <enum value="127"   name="VK_FORMAT_S8_UINT"/>
+        <enum value="128"   name="VK_FORMAT_D16_UNORM_S8_UINT"/>
+        <enum value="129"   name="VK_FORMAT_D24_UNORM_S8_UINT"/>
+        <enum value="130"   name="VK_FORMAT_D32_SFLOAT_S8_UINT"/>
+        <enum value="131"   name="VK_FORMAT_BC1_RGB_UNORM_BLOCK"/>
+        <enum value="132"   name="VK_FORMAT_BC1_RGB_SRGB_BLOCK"/>
+        <enum value="133"   name="VK_FORMAT_BC1_RGBA_UNORM_BLOCK"/>
+        <enum value="134"   name="VK_FORMAT_BC1_RGBA_SRGB_BLOCK"/>
+        <enum value="135"   name="VK_FORMAT_BC2_UNORM_BLOCK"/>
+        <enum value="136"   name="VK_FORMAT_BC2_SRGB_BLOCK"/>
+        <enum value="137"   name="VK_FORMAT_BC3_UNORM_BLOCK"/>
+        <enum value="138"   name="VK_FORMAT_BC3_SRGB_BLOCK"/>
+        <enum value="139"   name="VK_FORMAT_BC4_UNORM_BLOCK"/>
+        <enum value="140"   name="VK_FORMAT_BC4_SNORM_BLOCK"/>
+        <enum value="141"   name="VK_FORMAT_BC5_UNORM_BLOCK"/>
+        <enum value="142"   name="VK_FORMAT_BC5_SNORM_BLOCK"/>
+        <enum value="143"   name="VK_FORMAT_BC6H_UFLOAT_BLOCK"/>
+        <enum value="144"   name="VK_FORMAT_BC6H_SFLOAT_BLOCK"/>
+        <enum value="145"   name="VK_FORMAT_BC7_UNORM_BLOCK"/>
+        <enum value="146"   name="VK_FORMAT_BC7_SRGB_BLOCK"/>
+        <enum value="147"   name="VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK"/>
+        <enum value="148"   name="VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK"/>
+        <enum value="149"   name="VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK"/>
+        <enum value="150"   name="VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK"/>
+        <enum value="151"   name="VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK"/>
+        <enum value="152"   name="VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK"/>
+        <enum value="153"   name="VK_FORMAT_EAC_R11_UNORM_BLOCK"/>
+        <enum value="154"   name="VK_FORMAT_EAC_R11_SNORM_BLOCK"/>
+        <enum value="155"   name="VK_FORMAT_EAC_R11G11_UNORM_BLOCK"/>
+        <enum value="156"   name="VK_FORMAT_EAC_R11G11_SNORM_BLOCK"/>
+        <enum value="157"   name="VK_FORMAT_ASTC_4x4_UNORM_BLOCK"/>
+        <enum value="158"   name="VK_FORMAT_ASTC_4x4_SRGB_BLOCK"/>
+        <enum value="159"   name="VK_FORMAT_ASTC_5x4_UNORM_BLOCK"/>
+        <enum value="160"   name="VK_FORMAT_ASTC_5x4_SRGB_BLOCK"/>
+        <enum value="161"   name="VK_FORMAT_ASTC_5x5_UNORM_BLOCK"/>
+        <enum value="162"   name="VK_FORMAT_ASTC_5x5_SRGB_BLOCK"/>
+        <enum value="163"   name="VK_FORMAT_ASTC_6x5_UNORM_BLOCK"/>
+        <enum value="164"   name="VK_FORMAT_ASTC_6x5_SRGB_BLOCK"/>
+        <enum value="165"   name="VK_FORMAT_ASTC_6x6_UNORM_BLOCK"/>
+        <enum value="166"   name="VK_FORMAT_ASTC_6x6_SRGB_BLOCK"/>
+        <enum value="167"   name="VK_FORMAT_ASTC_8x5_UNORM_BLOCK"/>
+        <enum value="168"   name="VK_FORMAT_ASTC_8x5_SRGB_BLOCK"/>
+        <enum value="169"   name="VK_FORMAT_ASTC_8x6_UNORM_BLOCK"/>
+        <enum value="170"   name="VK_FORMAT_ASTC_8x6_SRGB_BLOCK"/>
+        <enum value="171"   name="VK_FORMAT_ASTC_8x8_UNORM_BLOCK"/>
+        <enum value="172"   name="VK_FORMAT_ASTC_8x8_SRGB_BLOCK"/>
+        <enum value="173"   name="VK_FORMAT_ASTC_10x5_UNORM_BLOCK"/>
+        <enum value="174"   name="VK_FORMAT_ASTC_10x5_SRGB_BLOCK"/>
+        <enum value="175"   name="VK_FORMAT_ASTC_10x6_UNORM_BLOCK"/>
+        <enum value="176"   name="VK_FORMAT_ASTC_10x6_SRGB_BLOCK"/>
+        <enum value="177"   name="VK_FORMAT_ASTC_10x8_UNORM_BLOCK"/>
+        <enum value="178"   name="VK_FORMAT_ASTC_10x8_SRGB_BLOCK"/>
+        <enum value="179"   name="VK_FORMAT_ASTC_10x10_UNORM_BLOCK"/>
+        <enum value="180"   name="VK_FORMAT_ASTC_10x10_SRGB_BLOCK"/>
+        <enum value="181"   name="VK_FORMAT_ASTC_12x10_UNORM_BLOCK"/>
+        <enum value="182"   name="VK_FORMAT_ASTC_12x10_SRGB_BLOCK"/>
+        <enum value="183"   name="VK_FORMAT_ASTC_12x12_UNORM_BLOCK"/>
+        <enum value="184"   name="VK_FORMAT_ASTC_12x12_SRGB_BLOCK"/>
+    </enums>
+    <enums name="VkStructureType" type="enum" comment="Structure type enumerant">
+        <enum value="0"     name="VK_STRUCTURE_TYPE_APPLICATION_INFO"/>
+        <enum value="1"     name="VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO"/>
+        <enum value="2"     name="VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO"/>
+        <enum value="3"     name="VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO"/>
+        <enum value="4"     name="VK_STRUCTURE_TYPE_SUBMIT_INFO"/>
+        <enum value="5"     name="VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO"/>
+        <enum value="6"     name="VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE"/>
+        <enum value="7"     name="VK_STRUCTURE_TYPE_BIND_SPARSE_INFO"/>
+        <enum value="8"     name="VK_STRUCTURE_TYPE_FENCE_CREATE_INFO"/>
+        <enum value="9"     name="VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO"/>
+        <enum value="10"    name="VK_STRUCTURE_TYPE_EVENT_CREATE_INFO"/>
+        <enum value="11"    name="VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO"/>
+        <enum value="12"    name="VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO"/>
+        <enum value="13"    name="VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO"/>
+        <enum value="14"    name="VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO"/>
+        <enum value="15"    name="VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO"/>
+        <enum value="16"    name="VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO"/>
+        <enum value="17"    name="VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO"/>
+        <enum value="18"    name="VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO"/>
+        <enum value="19"    name="VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO"/>
+        <enum value="20"    name="VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO"/>
+        <enum value="21"    name="VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO"/>
+        <enum value="22"    name="VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO"/>
+        <enum value="23"    name="VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO"/>
+        <enum value="24"    name="VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO"/>
+        <enum value="25"    name="VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO"/>
+        <enum value="26"    name="VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO"/>
+        <enum value="27"    name="VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO"/>
+        <enum value="28"    name="VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO"/>
+        <enum value="29"    name="VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO"/>
+        <enum value="30"    name="VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO"/>
+        <enum value="31"    name="VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO"/>
+        <enum value="32"    name="VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO"/>
+        <enum value="33"    name="VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO"/>
+        <enum value="34"    name="VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO"/>
+        <enum value="35"    name="VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET"/>
+        <enum value="36"    name="VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET"/>
+        <enum value="37"    name="VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO"/>
+        <enum value="38"    name="VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO"/>
+        <enum value="39"    name="VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO"/>
+        <enum value="40"    name="VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO"/>
+        <enum value="41"    name="VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO"/>
+        <enum value="42"    name="VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO"/>
+        <enum value="43"    name="VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO"/>
+        <enum value="44"    name="VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER"/>
+        <enum value="45"    name="VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER"/>
+        <enum value="46"    name="VK_STRUCTURE_TYPE_MEMORY_BARRIER"/>
+        <enum value="47"    name="VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO" comment="Reserved for internal use by the loader, layers, and ICDs"/>
+        <enum value="48"    name="VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO" comment="Reserved for internal use by the loader, layers, and ICDs"/>
+    </enums>
+    <enums name="VkSubpassContents" type="enum">
+        <enum value="0"     name="VK_SUBPASS_CONTENTS_INLINE"/>
+        <enum value="1"     name="VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS"/>
+    </enums>
+    <enums name="VkResult" type="enum" comment="API result codes">
+            <comment>Return codes (positive values)</comment>
+        <enum value="0"     name="VK_SUCCESS" comment="Command completed successfully"/>
+        <enum value="1"     name="VK_NOT_READY" comment="A fence or query has not yet completed"/>
+        <enum value="2"     name="VK_TIMEOUT" comment="A wait operation has not completed in the specified time"/>
+        <enum value="3"     name="VK_EVENT_SET" comment="An event is signaled"/>
+        <enum value="4"     name="VK_EVENT_RESET" comment="An event is unsignaled"/>
+        <enum value="5"     name="VK_INCOMPLETE" comment="A return array was too small for the result"/>
+            <comment>Error codes (negative values)</comment>
+        <enum value="-1"    name="VK_ERROR_OUT_OF_HOST_MEMORY" comment="A host memory allocation has failed"/>
+        <enum value="-2"    name="VK_ERROR_OUT_OF_DEVICE_MEMORY" comment="A device memory allocation has failed"/>
+        <enum value="-3"    name="VK_ERROR_INITIALIZATION_FAILED" comment="Initialization of a object has failed"/>
+        <enum value="-4"    name="VK_ERROR_DEVICE_LOST" comment="The logical device has been lost. See &lt;&lt;devsandqueues-lost-device&gt;&gt;"/>
+        <enum value="-5"    name="VK_ERROR_MEMORY_MAP_FAILED" comment="Mapping of a memory object has failed"/>
+        <enum value="-6"    name="VK_ERROR_LAYER_NOT_PRESENT" comment="Layer specified does not exist"/>
+        <enum value="-7"    name="VK_ERROR_EXTENSION_NOT_PRESENT" comment="Extension specified does not exist"/>
+        <enum value="-8"    name="VK_ERROR_FEATURE_NOT_PRESENT" comment="Requested feature is not available on this device"/>
+        <enum value="-9"    name="VK_ERROR_INCOMPATIBLE_DRIVER" comment="Unable to find a Vulkan driver"/>
+        <enum value="-10"   name="VK_ERROR_TOO_MANY_OBJECTS" comment="Too many objects of the type have already been created"/>
+        <enum value="-11"   name="VK_ERROR_FORMAT_NOT_SUPPORTED" comment="Requested format is not supported on this device"/>
+        <enum value="-12"   name="VK_ERROR_FRAGMENTED_POOL" comment="A requested pool allocation has failed due to fragmentation of the pool's memory"/>
+        <enum value="-13"   name="VK_ERROR_UNKNOWN" comment="An unknown error has occurred, due to an implementation or application bug"/>
+            <unused start="-14" comment="This is the next unused available error code (negative value)"/>
+    </enums>
+    <enums name="VkDynamicState" type="enum">
+        <enum value="0"     name="VK_DYNAMIC_STATE_VIEWPORT"/>
+        <enum value="1"     name="VK_DYNAMIC_STATE_SCISSOR"/>
+        <enum value="2"     name="VK_DYNAMIC_STATE_LINE_WIDTH"/>
+        <enum value="3"     name="VK_DYNAMIC_STATE_DEPTH_BIAS"/>
+        <enum value="4"     name="VK_DYNAMIC_STATE_BLEND_CONSTANTS"/>
+        <enum value="5"     name="VK_DYNAMIC_STATE_DEPTH_BOUNDS"/>
+        <enum value="6"     name="VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK"/>
+        <enum value="7"     name="VK_DYNAMIC_STATE_STENCIL_WRITE_MASK"/>
+        <enum value="8"     name="VK_DYNAMIC_STATE_STENCIL_REFERENCE"/>
+    </enums>
+    <enums name="VkDescriptorUpdateTemplateType" type="enum">
+        <enum value="0"     name="VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET"   comment="Create descriptor update template for descriptor set updates"/>
+    </enums>
+    <enums name="VkObjectType" type="enum" comment="Enums to track objects of various types - also see objtypeenum attributes on type tags">
+        <enum value="0"     name="VK_OBJECT_TYPE_UNKNOWN"/>
+        <enum value="1"     name="VK_OBJECT_TYPE_INSTANCE"/>
+        <enum value="2"     name="VK_OBJECT_TYPE_PHYSICAL_DEVICE"/>
+        <enum value="3"     name="VK_OBJECT_TYPE_DEVICE"/>
+        <enum value="4"     name="VK_OBJECT_TYPE_QUEUE"/>
+        <enum value="5"     name="VK_OBJECT_TYPE_SEMAPHORE"/>
+        <enum value="6"     name="VK_OBJECT_TYPE_COMMAND_BUFFER"/>
+        <enum value="7"     name="VK_OBJECT_TYPE_FENCE"/>
+        <enum value="8"     name="VK_OBJECT_TYPE_DEVICE_MEMORY"/>
+        <enum value="9"     name="VK_OBJECT_TYPE_BUFFER"/>
+        <enum value="10"    name="VK_OBJECT_TYPE_IMAGE"/>
+        <enum value="11"    name="VK_OBJECT_TYPE_EVENT"/>
+        <enum value="12"    name="VK_OBJECT_TYPE_QUERY_POOL"/>
+        <enum value="13"    name="VK_OBJECT_TYPE_BUFFER_VIEW"/>
+        <enum value="14"    name="VK_OBJECT_TYPE_IMAGE_VIEW"/>
+        <enum value="15"    name="VK_OBJECT_TYPE_SHADER_MODULE"/>
+        <enum value="16"    name="VK_OBJECT_TYPE_PIPELINE_CACHE"/>
+        <enum value="17"    name="VK_OBJECT_TYPE_PIPELINE_LAYOUT"/>
+        <enum value="18"    name="VK_OBJECT_TYPE_RENDER_PASS"/>
+        <enum value="19"    name="VK_OBJECT_TYPE_PIPELINE"/>
+        <enum value="20"    name="VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT"/>
+        <enum value="21"    name="VK_OBJECT_TYPE_SAMPLER"/>
+        <enum value="22"    name="VK_OBJECT_TYPE_DESCRIPTOR_POOL"/>
+        <enum value="23"    name="VK_OBJECT_TYPE_DESCRIPTOR_SET"/>
+        <enum value="24"    name="VK_OBJECT_TYPE_FRAMEBUFFER"/>
+        <enum value="25"    name="VK_OBJECT_TYPE_COMMAND_POOL"/>
+    </enums>
+
+        <comment>Flags</comment>
+    <enums name="VkQueueFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_QUEUE_GRAPHICS_BIT"                             comment="Queue supports graphics operations"/>
+        <enum bitpos="1"    name="VK_QUEUE_COMPUTE_BIT"                              comment="Queue supports compute operations"/>
+        <enum bitpos="2"    name="VK_QUEUE_TRANSFER_BIT"                             comment="Queue supports transfer operations"/>
+        <enum bitpos="3"    name="VK_QUEUE_SPARSE_BINDING_BIT"                       comment="Queue supports sparse resource memory management operations"/>
+    </enums>
+    <enums name="VkCullModeFlagBits" type="bitmask">
+        <enum value="0"     name="VK_CULL_MODE_NONE"/>
+        <enum bitpos="0"    name="VK_CULL_MODE_FRONT_BIT"/>
+        <enum bitpos="1"    name="VK_CULL_MODE_BACK_BIT"/>
+        <enum value="0x00000003" name="VK_CULL_MODE_FRONT_AND_BACK"/>
+    </enums>
+    <enums name="VkRenderPassCreateFlagBits" type="bitmask">
+    </enums>
+    <enums name="VkDeviceQueueCreateFlagBits" type="bitmask">
+    </enums>
+    <enums name="VkMemoryPropertyFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT"               comment="If otherwise stated, then allocate memory on device"/>
+        <enum bitpos="1"    name="VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT"               comment="Memory is mappable by host"/>
+        <enum bitpos="2"    name="VK_MEMORY_PROPERTY_HOST_COHERENT_BIT"              comment="Memory will have i/o coherency. If not set, application may need to use vkFlushMappedMemoryRanges and vkInvalidateMappedMemoryRanges to flush/invalidate host cache"/>
+        <enum bitpos="3"    name="VK_MEMORY_PROPERTY_HOST_CACHED_BIT"                comment="Memory will be cached by the host"/>
+        <enum bitpos="4"    name="VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT"           comment="Memory may be allocated by the driver when it is required"/>
+    </enums>
+    <enums name="VkMemoryHeapFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_MEMORY_HEAP_DEVICE_LOCAL_BIT"                   comment="If set, heap represents device memory"/>
+    </enums>
+    <enums name="VkAccessFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_ACCESS_INDIRECT_COMMAND_READ_BIT"               comment="Controls coherency of indirect command reads"/>
+        <enum bitpos="1"    name="VK_ACCESS_INDEX_READ_BIT"                          comment="Controls coherency of index reads"/>
+        <enum bitpos="2"    name="VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT"               comment="Controls coherency of vertex attribute reads"/>
+        <enum bitpos="3"    name="VK_ACCESS_UNIFORM_READ_BIT"                        comment="Controls coherency of uniform buffer reads"/>
+        <enum bitpos="4"    name="VK_ACCESS_INPUT_ATTACHMENT_READ_BIT"               comment="Controls coherency of input attachment reads"/>
+        <enum bitpos="5"    name="VK_ACCESS_SHADER_READ_BIT"                         comment="Controls coherency of shader reads"/>
+        <enum bitpos="6"    name="VK_ACCESS_SHADER_WRITE_BIT"                        comment="Controls coherency of shader writes"/>
+        <enum bitpos="7"    name="VK_ACCESS_COLOR_ATTACHMENT_READ_BIT"               comment="Controls coherency of color attachment reads"/>
+        <enum bitpos="8"    name="VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT"              comment="Controls coherency of color attachment writes"/>
+        <enum bitpos="9"    name="VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT"       comment="Controls coherency of depth/stencil attachment reads"/>
+        <enum bitpos="10"   name="VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT"      comment="Controls coherency of depth/stencil attachment writes"/>
+        <enum bitpos="11"   name="VK_ACCESS_TRANSFER_READ_BIT"                       comment="Controls coherency of transfer reads"/>
+        <enum bitpos="12"   name="VK_ACCESS_TRANSFER_WRITE_BIT"                      comment="Controls coherency of transfer writes"/>
+        <enum bitpos="13"   name="VK_ACCESS_HOST_READ_BIT"                           comment="Controls coherency of host reads"/>
+        <enum bitpos="14"   name="VK_ACCESS_HOST_WRITE_BIT"                          comment="Controls coherency of host writes"/>
+        <enum bitpos="15"   name="VK_ACCESS_MEMORY_READ_BIT"                         comment="Controls coherency of memory reads"/>
+        <enum bitpos="16"   name="VK_ACCESS_MEMORY_WRITE_BIT"                        comment="Controls coherency of memory writes"/>
+    </enums>
+    <enums name="VkBufferUsageFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_BUFFER_USAGE_TRANSFER_SRC_BIT"                  comment="Can be used as a source of transfer operations"/>
+        <enum bitpos="1"    name="VK_BUFFER_USAGE_TRANSFER_DST_BIT"                  comment="Can be used as a destination of transfer operations"/>
+        <enum bitpos="2"    name="VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT"          comment="Can be used as TBO"/>
+        <enum bitpos="3"    name="VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT"          comment="Can be used as IBO"/>
+        <enum bitpos="4"    name="VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT"                comment="Can be used as UBO"/>
+        <enum bitpos="5"    name="VK_BUFFER_USAGE_STORAGE_BUFFER_BIT"                comment="Can be used as SSBO"/>
+        <enum bitpos="6"    name="VK_BUFFER_USAGE_INDEX_BUFFER_BIT"                  comment="Can be used as source of fixed-function index fetch (index buffer)"/>
+        <enum bitpos="7"    name="VK_BUFFER_USAGE_VERTEX_BUFFER_BIT"                 comment="Can be used as source of fixed-function vertex fetch (VBO)"/>
+        <enum bitpos="8"    name="VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT"               comment="Can be the source of indirect parameters (e.g. indirect buffer, parameter buffer)"/>
+    </enums>
+    <enums name="VkBufferCreateFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_BUFFER_CREATE_SPARSE_BINDING_BIT"               comment="Buffer should support sparse backing"/>
+        <enum bitpos="1"    name="VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT"             comment="Buffer should support sparse backing with partial residency"/>
+        <enum bitpos="2"    name="VK_BUFFER_CREATE_SPARSE_ALIASED_BIT"               comment="Buffer should support constant data access to physical memory ranges mapped into multiple locations of sparse buffers"/>
+    </enums>
+    <enums name="VkShaderStageFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_SHADER_STAGE_VERTEX_BIT"/>
+        <enum bitpos="1"    name="VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT"/>
+        <enum bitpos="2"    name="VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT"/>
+        <enum bitpos="3"    name="VK_SHADER_STAGE_GEOMETRY_BIT"/>
+        <enum bitpos="4"    name="VK_SHADER_STAGE_FRAGMENT_BIT"/>
+        <enum bitpos="5"    name="VK_SHADER_STAGE_COMPUTE_BIT"/>
+        <enum value="0x0000001F" name="VK_SHADER_STAGE_ALL_GRAPHICS"/>
+        <enum value="0x7FFFFFFF" name="VK_SHADER_STAGE_ALL"/>
+    </enums>
+    <enums name="VkImageUsageFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_IMAGE_USAGE_TRANSFER_SRC_BIT"                   comment="Can be used as a source of transfer operations"/>
+        <enum bitpos="1"    name="VK_IMAGE_USAGE_TRANSFER_DST_BIT"                   comment="Can be used as a destination of transfer operations"/>
+        <enum bitpos="2"    name="VK_IMAGE_USAGE_SAMPLED_BIT"                        comment="Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)"/>
+        <enum bitpos="3"    name="VK_IMAGE_USAGE_STORAGE_BIT"                        comment="Can be used as storage image (STORAGE_IMAGE descriptor type)"/>
+        <enum bitpos="4"    name="VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT"               comment="Can be used as framebuffer color attachment"/>
+        <enum bitpos="5"    name="VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT"       comment="Can be used as framebuffer depth/stencil attachment"/>
+        <enum bitpos="6"    name="VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT"           comment="Image data not needed outside of rendering"/>
+        <enum bitpos="7"    name="VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT"               comment="Can be used as framebuffer input attachment"/>
+    </enums>
+    <enums name="VkImageCreateFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_IMAGE_CREATE_SPARSE_BINDING_BIT"                comment="Image should support sparse backing"/>
+        <enum bitpos="1"    name="VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT"              comment="Image should support sparse backing with partial residency"/>
+        <enum bitpos="2"    name="VK_IMAGE_CREATE_SPARSE_ALIASED_BIT"                comment="Image should support constant data access to physical memory ranges mapped into multiple locations of sparse images"/>
+        <enum bitpos="3"    name="VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT"                comment="Allows image views to have different format than the base image"/>
+        <enum bitpos="4"    name="VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT"               comment="Allows creating image views with cube type from the created image"/>
+    </enums>
+    <enums name="VkImageViewCreateFlagBits" type="bitmask">
+    </enums>
+    <enums name="VkSamplerCreateFlagBits" type="bitmask">
+    </enums>
+    <enums name="VkPipelineCreateFlagBits" type="bitmask" comment="Note that the gap at bitpos 10 is unused, and can be reserved">
+        <enum bitpos="0"    name="VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT"/>
+        <enum bitpos="1"    name="VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT"/>
+        <enum bitpos="2"    name="VK_PIPELINE_CREATE_DERIVATIVE_BIT"/>
+    </enums>
+    <enums name="VkPipelineShaderStageCreateFlagBits" type="bitmask">
+    </enums>
+    <enums name="VkColorComponentFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_COLOR_COMPONENT_R_BIT"/>
+        <enum bitpos="1"    name="VK_COLOR_COMPONENT_G_BIT"/>
+        <enum bitpos="2"    name="VK_COLOR_COMPONENT_B_BIT"/>
+        <enum bitpos="3"    name="VK_COLOR_COMPONENT_A_BIT"/>
+    </enums>
+    <enums name="VkFenceCreateFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_FENCE_CREATE_SIGNALED_BIT"/>
+    </enums>
+    <enums name="VkSemaphoreCreateFlagBits" type="bitmask">
+    </enums>
+    <enums name="VkFormatFeatureFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT"               comment="Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)"/>
+        <enum bitpos="1"    name="VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT"               comment="Format can be used for storage images (STORAGE_IMAGE descriptor type)"/>
+        <enum bitpos="2"    name="VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT"        comment="Format supports atomic operations in case it is used for storage images"/>
+        <enum bitpos="3"    name="VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT"        comment="Format can be used for uniform texel buffers (TBOs)"/>
+        <enum bitpos="4"    name="VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT"        comment="Format can be used for storage texel buffers (IBOs)"/>
+        <enum bitpos="5"    name="VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT" comment="Format supports atomic operations in case it is used for storage texel buffers"/>
+        <enum bitpos="6"    name="VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT"               comment="Format can be used for vertex buffers (VBOs)"/>
+        <enum bitpos="7"    name="VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT"            comment="Format can be used for color attachment images"/>
+        <enum bitpos="8"    name="VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT"      comment="Format supports blending in case it is used for color attachment images"/>
+        <enum bitpos="9"    name="VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT"    comment="Format can be used for depth/stencil attachment images"/>
+        <enum bitpos="10"   name="VK_FORMAT_FEATURE_BLIT_SRC_BIT"                    comment="Format can be used as the source image of blits with vkCmdBlitImage"/>
+        <enum bitpos="11"   name="VK_FORMAT_FEATURE_BLIT_DST_BIT"                    comment="Format can be used as the destination image of blits with vkCmdBlitImage"/>
+        <enum bitpos="12"   name="VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT" comment="Format can be filtered with VK_FILTER_LINEAR when being sampled"/>
+    </enums>
+    <enums name="VkQueryControlFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_QUERY_CONTROL_PRECISE_BIT"                      comment="Require precise results to be collected by the query"/>
+    </enums>
+    <enums name="VkQueryResultFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_QUERY_RESULT_64_BIT"                            comment="Results of the queries are written to the destination buffer as 64-bit values"/>
+        <enum bitpos="1"    name="VK_QUERY_RESULT_WAIT_BIT"                          comment="Results of the queries are waited on before proceeding with the result copy"/>
+        <enum bitpos="2"    name="VK_QUERY_RESULT_WITH_AVAILABILITY_BIT"             comment="Besides the results of the query, the availability of the results is also written"/>
+        <enum bitpos="3"    name="VK_QUERY_RESULT_PARTIAL_BIT"                       comment="Copy the partial results of the query even if the final results are not available"/>
+    </enums>
+    <enums name="VkCommandBufferUsageFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT"/>
+        <enum bitpos="1"    name="VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT"/>
+        <enum bitpos="2"    name="VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT"      comment="Command buffer may be submitted/executed more than once simultaneously"/>
+    </enums>
+    <enums name="VkQueryPipelineStatisticFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT"                    comment="Optional"/>
+        <enum bitpos="1"    name="VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT"                  comment="Optional"/>
+        <enum bitpos="2"    name="VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT"                  comment="Optional"/>
+        <enum bitpos="3"    name="VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT"                comment="Optional"/>
+        <enum bitpos="4"    name="VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT"                 comment="Optional"/>
+        <enum bitpos="5"    name="VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT"                       comment="Optional"/>
+        <enum bitpos="6"    name="VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT"                        comment="Optional"/>
+        <enum bitpos="7"    name="VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT"                comment="Optional"/>
+        <enum bitpos="8"    name="VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT"        comment="Optional"/>
+        <enum bitpos="9"    name="VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT" comment="Optional"/>
+        <enum bitpos="10"   name="VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT"                 comment="Optional"/>
+    </enums>
+    <enums name="VkImageAspectFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_IMAGE_ASPECT_COLOR_BIT"/>
+        <enum bitpos="1"    name="VK_IMAGE_ASPECT_DEPTH_BIT"/>
+        <enum bitpos="2"    name="VK_IMAGE_ASPECT_STENCIL_BIT"/>
+        <enum bitpos="3"    name="VK_IMAGE_ASPECT_METADATA_BIT"/>
+    </enums>
+    <enums name="VkSparseImageFormatFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT"         comment="Image uses a single mip tail region for all array layers"/>
+        <enum bitpos="1"    name="VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT"       comment="Image requires mip level dimensions to be an integer multiple of the sparse image block dimensions for non-tail mip levels."/>
+        <enum bitpos="2"    name="VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT" comment="Image uses a non-standard sparse image block dimensions"/>
+    </enums>
+    <enums name="VkSparseMemoryBindFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_SPARSE_MEMORY_BIND_METADATA_BIT"                comment="Operation binds resource metadata to memory"/>
+    </enums>
+    <enums name="VkPipelineStageFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT"                 comment="Before subsequent commands are processed"/>
+        <enum bitpos="1"    name="VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT"               comment="Draw/DispatchIndirect command fetch"/>
+        <enum bitpos="2"    name="VK_PIPELINE_STAGE_VERTEX_INPUT_BIT"                comment="Vertex/index fetch"/>
+        <enum bitpos="3"    name="VK_PIPELINE_STAGE_VERTEX_SHADER_BIT"               comment="Vertex shading"/>
+        <enum bitpos="4"    name="VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT" comment="Tessellation control shading"/>
+        <enum bitpos="5"    name="VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT" comment="Tessellation evaluation shading"/>
+        <enum bitpos="6"    name="VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT"             comment="Geometry shading"/>
+        <enum bitpos="7"    name="VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT"             comment="Fragment shading"/>
+        <enum bitpos="8"    name="VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT"        comment="Early fragment (depth and stencil) tests"/>
+        <enum bitpos="9"    name="VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT"         comment="Late fragment (depth and stencil) tests"/>
+        <enum bitpos="10"   name="VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT"     comment="Color attachment writes"/>
+        <enum bitpos="11"   name="VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT"              comment="Compute shading"/>
+        <enum bitpos="12"   name="VK_PIPELINE_STAGE_TRANSFER_BIT"                    comment="Transfer/copy operations"/>
+        <enum bitpos="13"   name="VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT"              comment="After previous commands have completed"/>
+        <enum bitpos="14"   name="VK_PIPELINE_STAGE_HOST_BIT"                        comment="Indicates host (CPU) is a source/sink of the dependency"/>
+        <enum bitpos="15"   name="VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT"                comment="All stages of the graphics pipeline"/>
+        <enum bitpos="16"   name="VK_PIPELINE_STAGE_ALL_COMMANDS_BIT"                comment="All stages supported on the queue"/>
+    </enums>
+    <enums name="VkCommandPoolCreateFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_COMMAND_POOL_CREATE_TRANSIENT_BIT"              comment="Command buffers have a short lifetime"/>
+        <enum bitpos="1"    name="VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT"   comment="Command buffers may release their memory individually"/>
+    </enums>
+    <enums name="VkCommandPoolResetFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT"       comment="Release resources owned by the pool"/>
+    </enums>
+    <enums name="VkCommandBufferResetFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT"     comment="Release resources owned by the buffer"/>
+    </enums>
+    <enums name="VkSampleCountFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_SAMPLE_COUNT_1_BIT"                             comment="Sample count 1 supported"/>
+        <enum bitpos="1"    name="VK_SAMPLE_COUNT_2_BIT"                             comment="Sample count 2 supported"/>
+        <enum bitpos="2"    name="VK_SAMPLE_COUNT_4_BIT"                             comment="Sample count 4 supported"/>
+        <enum bitpos="3"    name="VK_SAMPLE_COUNT_8_BIT"                             comment="Sample count 8 supported"/>
+        <enum bitpos="4"    name="VK_SAMPLE_COUNT_16_BIT"                            comment="Sample count 16 supported"/>
+        <enum bitpos="5"    name="VK_SAMPLE_COUNT_32_BIT"                            comment="Sample count 32 supported"/>
+        <enum bitpos="6"    name="VK_SAMPLE_COUNT_64_BIT"                            comment="Sample count 64 supported"/>
+    </enums>
+    <enums name="VkAttachmentDescriptionFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT"           comment="The attachment may alias physical memory of another attachment in the same render pass"/>
+    </enums>
+    <enums name="VkStencilFaceFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_STENCIL_FACE_FRONT_BIT"                         comment="Front face"/>
+        <enum bitpos="1"    name="VK_STENCIL_FACE_BACK_BIT"                          comment="Back face"/>
+        <enum value="0x00000003" name="VK_STENCIL_FACE_FRONT_AND_BACK"               comment="Front and back faces"/>
+        <enum                    name="VK_STENCIL_FRONT_AND_BACK" alias="VK_STENCIL_FACE_FRONT_AND_BACK" comment="Alias for backwards compatibility"/>
+    </enums>
+    <enums name="VkDescriptorPoolCreateFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT" comment="Descriptor sets may be freed individually"/>
+    </enums>
+    <enums name="VkDependencyFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_DEPENDENCY_BY_REGION_BIT"                       comment="Dependency is per pixel region "/>
+    </enums>
+    <enums name="VkSemaphoreType" type="enum">
+        <enum value="0"     name="VK_SEMAPHORE_TYPE_BINARY"/>
+        <enum value="1"     name="VK_SEMAPHORE_TYPE_TIMELINE"/>
+    </enums>
+    <enums name="VkSemaphoreWaitFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_SEMAPHORE_WAIT_ANY_BIT"/>
+    </enums>
+
+        <comment>WSI Extensions</comment>
+    <enums name="VkPresentModeKHR" type="enum">
+        <enum value="0"     name="VK_PRESENT_MODE_IMMEDIATE_KHR"/>
+        <enum value="1"     name="VK_PRESENT_MODE_MAILBOX_KHR"/>
+        <enum value="2"     name="VK_PRESENT_MODE_FIFO_KHR"/>
+        <enum value="3"     name="VK_PRESENT_MODE_FIFO_RELAXED_KHR"/>
+    </enums>
+    <enums name="VkColorSpaceKHR" type="enum">
+        <enum value="0"     name="VK_COLOR_SPACE_SRGB_NONLINEAR_KHR"/>
+        <enum               name="VK_COLORSPACE_SRGB_NONLINEAR_KHR" alias="VK_COLOR_SPACE_SRGB_NONLINEAR_KHR" comment="Backwards-compatible alias containing a typo"/>
+    </enums>
+    <enums name="VkDisplayPlaneAlphaFlagBitsKHR" type="bitmask">
+        <enum bitpos="0"    name="VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR"/>
+        <enum bitpos="1"    name="VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR"/>
+        <enum bitpos="2"    name="VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR"/>
+        <enum bitpos="3"    name="VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR"/>
+    </enums>
+    <enums name="VkCompositeAlphaFlagBitsKHR" type="bitmask">
+        <enum bitpos="0"    name="VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR"/>
+        <enum bitpos="1"    name="VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR"/>
+        <enum bitpos="2"    name="VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR"/>
+        <enum bitpos="3"    name="VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR"/>
+    </enums>
+    <enums name="VkSurfaceTransformFlagBitsKHR" type="bitmask">
+        <enum bitpos="0"    name="VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR"/>
+        <enum bitpos="1"    name="VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR"/>
+        <enum bitpos="2"    name="VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR"/>
+        <enum bitpos="3"    name="VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR"/>
+        <enum bitpos="4"    name="VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR"/>
+        <enum bitpos="5"    name="VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR"/>
+        <enum bitpos="6"    name="VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR"/>
+        <enum bitpos="7"    name="VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR"/>
+        <enum bitpos="8"    name="VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR"/>
+    </enums>
+    <enums name="VkTimeDomainEXT" type="enum">
+        <enum value="0"     name="VK_TIME_DOMAIN_DEVICE_EXT"/>
+        <enum value="1"     name="VK_TIME_DOMAIN_CLOCK_MONOTONIC_EXT"/>
+        <enum value="2"     name="VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT"/>
+        <enum value="3"     name="VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT"/>
+    </enums>
+    <enums name="VkDebugReportFlagBitsEXT" type="bitmask">
+        <enum bitpos="0"    name="VK_DEBUG_REPORT_INFORMATION_BIT_EXT"/>
+        <enum bitpos="1"    name="VK_DEBUG_REPORT_WARNING_BIT_EXT"/>
+        <enum bitpos="2"    name="VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT"/>
+        <enum bitpos="3"    name="VK_DEBUG_REPORT_ERROR_BIT_EXT"/>
+        <enum bitpos="4"    name="VK_DEBUG_REPORT_DEBUG_BIT_EXT"/>
+    </enums>
+    <enums name="VkDebugReportObjectTypeEXT" type="enum">
+        <enum value="0"     name="VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT"/>
+        <enum value="1"     name="VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT"/>
+        <enum value="2"     name="VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT"/>
+        <enum value="3"     name="VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT"/>
+        <enum value="4"     name="VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT"/>
+        <enum value="5"     name="VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT"/>
+        <enum value="6"     name="VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT"/>
+        <enum value="7"     name="VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT"/>
+        <enum value="8"     name="VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT"/>
+        <enum value="9"     name="VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT"/>
+        <enum value="10"    name="VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT"/>
+        <enum value="11"    name="VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT"/>
+        <enum value="12"    name="VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT"/>
+        <enum value="13"    name="VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT"/>
+        <enum value="14"    name="VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT"/>
+        <enum value="15"    name="VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT"/>
+        <enum value="16"    name="VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT"/>
+        <enum value="17"    name="VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT"/>
+        <enum value="18"    name="VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT"/>
+        <enum value="19"    name="VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT"/>
+        <enum value="20"    name="VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT"/>
+        <enum value="21"    name="VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT"/>
+        <enum value="22"    name="VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT"/>
+        <enum value="23"    name="VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT"/>
+        <enum value="24"    name="VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT"/>
+        <enum value="25"    name="VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT"/>
+        <enum value="26"    name="VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT"/>
+        <enum value="27"    name="VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT"/>
+        <enum value="28"    name="VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT"/>
+        <enum               name="VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT" alias="VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT" comment="Backwards-compatible alias containing a typo"/>
+        <enum value="29"    name="VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT"/>
+        <enum value="30"    name="VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT"/>
+        <!--<enum value="31"    name="VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT" comment="Removed NVX_device_generated_commands"/>-->
+        <!--<enum value="32"    name="VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT" comment="Removed NVX_device_generated_commands"/>-->
+        <enum value="33"    name="VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT"/>
+        <enum               name="VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT" alias="VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT" comment="Backwards-compatible alias containing a typo"/>
+    </enums>
+    <enums name="VkDeviceMemoryReportEventTypeEXT" type="enum">
+        <enum value="0"     name="VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_ALLOCATE_EXT"/>
+        <enum value="1"     name="VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_FREE_EXT"/>
+        <enum value="2"     name="VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_IMPORT_EXT"/>
+        <enum value="3"     name="VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_UNIMPORT_EXT"/>
+        <enum value="4"     name="VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_ALLOCATION_FAILED_EXT"/>
+    </enums>
+    <enums name="VkRasterizationOrderAMD" type="enum">
+        <enum value="0"     name="VK_RASTERIZATION_ORDER_STRICT_AMD"/>
+        <enum value="1"     name="VK_RASTERIZATION_ORDER_RELAXED_AMD"/>
+    </enums>
+    <enums name="VkExternalMemoryHandleTypeFlagBitsNV" type="bitmask">
+        <enum bitpos="0"    name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV"/>
+        <enum bitpos="1"    name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV"/>
+        <enum bitpos="2"    name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_BIT_NV"/>
+        <enum bitpos="3"    name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_KMT_BIT_NV"/>
+    </enums>
+    <enums name="VkExternalMemoryFeatureFlagBitsNV" type="bitmask">
+        <enum bitpos="0"    name="VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_NV"/>
+        <enum bitpos="1"    name="VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_NV"/>
+        <enum bitpos="2"    name="VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_NV"/>
+    </enums>
+    <enums name="VkValidationCheckEXT" type="enum">
+        <enum value="0"     name="VK_VALIDATION_CHECK_ALL_EXT"/>
+        <enum value="1"     name="VK_VALIDATION_CHECK_SHADERS_EXT"/>
+    </enums>
+    <enums name="VkValidationFeatureEnableEXT" type="enum">
+        <enum value="0"     name="VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT"/>
+        <enum value="1"     name="VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT"/>
+        <enum value="2"     name="VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT"/>
+        <enum value="3"     name="VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT"/>
+        <enum value="4"     name="VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION_EXT"/>
+    </enums>
+    <enums name="VkValidationFeatureDisableEXT" type="enum">
+        <enum value="0"     name="VK_VALIDATION_FEATURE_DISABLE_ALL_EXT"/>
+        <enum value="1"     name="VK_VALIDATION_FEATURE_DISABLE_SHADERS_EXT"/>
+        <enum value="2"     name="VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT"/>
+        <enum value="3"     name="VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT"/>
+        <enum value="4"     name="VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT"/>
+        <enum value="5"     name="VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT"/>
+        <enum value="6"     name="VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT"/>
+        <enum value="7"     name="VK_VALIDATION_FEATURE_DISABLE_SHADER_VALIDATION_CACHE_EXT"/>
+    </enums>
+    <enums name="VkSubgroupFeatureFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_SUBGROUP_FEATURE_BASIC_BIT"              comment="Basic subgroup operations"/>
+        <enum bitpos="1"    name="VK_SUBGROUP_FEATURE_VOTE_BIT"               comment="Vote subgroup operations"/>
+        <enum bitpos="2"    name="VK_SUBGROUP_FEATURE_ARITHMETIC_BIT"         comment="Arithmetic subgroup operations"/>
+        <enum bitpos="3"    name="VK_SUBGROUP_FEATURE_BALLOT_BIT"             comment="Ballot subgroup operations"/>
+        <enum bitpos="4"    name="VK_SUBGROUP_FEATURE_SHUFFLE_BIT"            comment="Shuffle subgroup operations"/>
+        <enum bitpos="5"    name="VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT"   comment="Shuffle relative subgroup operations"/>
+        <enum bitpos="6"    name="VK_SUBGROUP_FEATURE_CLUSTERED_BIT"          comment="Clustered subgroup operations"/>
+        <enum bitpos="7"    name="VK_SUBGROUP_FEATURE_QUAD_BIT"               comment="Quad subgroup operations"/>
+    </enums>
+    <enums name="VkIndirectCommandsLayoutUsageFlagBitsNV" type="bitmask">
+        <enum bitpos="0"    name="VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EXPLICIT_PREPROCESS_BIT_NV"/>
+        <enum bitpos="1"    name="VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NV"/>
+        <enum bitpos="2"    name="VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NV"/>
+    </enums>
+    <enums name="VkIndirectStateFlagBitsNV" type="bitmask">
+        <enum bitpos="0"    name="VK_INDIRECT_STATE_FLAG_FRONTFACE_BIT_NV"/>
+    </enums>
+    <enums name="VkIndirectCommandsTokenTypeNV" type="enum">
+        <enum value="0"     name="VK_INDIRECT_COMMANDS_TOKEN_TYPE_SHADER_GROUP_NV"/>
+        <enum value="1"     name="VK_INDIRECT_COMMANDS_TOKEN_TYPE_STATE_FLAGS_NV"/>
+        <enum value="2"     name="VK_INDIRECT_COMMANDS_TOKEN_TYPE_INDEX_BUFFER_NV"/>
+        <enum value="3"     name="VK_INDIRECT_COMMANDS_TOKEN_TYPE_VERTEX_BUFFER_NV"/>
+        <enum value="4"     name="VK_INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_CONSTANT_NV"/>
+        <enum value="5"     name="VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_INDEXED_NV"/>
+        <enum value="6"     name="VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_NV"/>
+        <enum value="7"     name="VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_TASKS_NV"/>
+    </enums>
+    <enums name="VkPrivateDataSlotCreateFlagBitsEXT" type="bitmask">
+    </enums>
+    <enums name="VkDescriptorSetLayoutCreateFlagBits" type="bitmask">
+    </enums>
+    <enums name="VkExternalMemoryHandleTypeFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT"/>
+        <enum bitpos="1"    name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT"/>
+        <enum bitpos="2"    name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT"/>
+        <enum bitpos="3"    name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT"/>
+        <enum bitpos="4"    name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT"/>
+        <enum bitpos="5"    name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT"/>
+        <enum bitpos="6"    name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT"/>
+    </enums>
+    <enums name="VkExternalMemoryFeatureFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT"/>
+        <enum bitpos="1"    name="VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT"/>
+        <enum bitpos="2"    name="VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT"/>
+    </enums>
+    <enums name="VkExternalSemaphoreHandleTypeFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT"/>
+        <enum bitpos="1"    name="VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT"/>
+        <enum bitpos="2"    name="VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT"/>
+        <enum bitpos="3"    name="VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT"/>
+        <enum               name="VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE_BIT" alias="VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT"/>
+        <enum bitpos="4"    name="VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT"/>
+    </enums>
+    <enums name="VkExternalSemaphoreFeatureFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT"/>
+        <enum bitpos="1"    name="VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT"/>
+    </enums>
+    <enums name="VkSemaphoreImportFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_SEMAPHORE_IMPORT_TEMPORARY_BIT"/>
+    </enums>
+    <enums name="VkExternalFenceHandleTypeFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT"/>
+        <enum bitpos="1"    name="VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT"/>
+        <enum bitpos="2"    name="VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT"/>
+        <enum bitpos="3"    name="VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT"/>
+    </enums>
+    <enums name="VkExternalFenceFeatureFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT"/>
+        <enum bitpos="1"    name="VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT"/>
+    </enums>
+    <enums name="VkFenceImportFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_FENCE_IMPORT_TEMPORARY_BIT"/>
+    </enums>
+    <enums name="VkSurfaceCounterFlagBitsEXT" type="bitmask">
+        <enum bitpos="0"    name="VK_SURFACE_COUNTER_VBLANK_BIT_EXT"/>
+        <enum               name="VK_SURFACE_COUNTER_VBLANK_EXT" alias="VK_SURFACE_COUNTER_VBLANK_BIT_EXT" comment="Backwards-compatible alias containing a typo"/>
+    </enums>
+    <enums name="VkDisplayPowerStateEXT" type="enum">
+        <enum value="0"     name="VK_DISPLAY_POWER_STATE_OFF_EXT"/>
+        <enum value="1"     name="VK_DISPLAY_POWER_STATE_SUSPEND_EXT"/>
+        <enum value="2"     name="VK_DISPLAY_POWER_STATE_ON_EXT"/>
+    </enums>
+    <enums name="VkDeviceEventTypeEXT" type="enum">
+        <enum value="0"     name="VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT"/>
+    </enums>
+    <enums name="VkDisplayEventTypeEXT" type="enum">
+        <enum value="0"     name="VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT"/>
+    </enums>
+    <enums name="VkPeerMemoryFeatureFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT"           comment="Can read with vkCmdCopy commands"/>
+        <enum bitpos="1"    name="VK_PEER_MEMORY_FEATURE_COPY_DST_BIT"           comment="Can write with vkCmdCopy commands"/>
+        <enum bitpos="2"    name="VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT"        comment="Can read with any access type/command"/>
+        <enum bitpos="3"    name="VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT"        comment="Can write with and access type/command"/>
+    </enums>
+    <enums name="VkMemoryAllocateFlagBits" type="bitmask">
+        <enum bitpos="0"    name="VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT"            comment="Force allocation on specific devices"/>
+    </enums>
+    <enums name="VkDeviceGroupPresentModeFlagBitsKHR" type="bitmask">
+        <enum bitpos="0"    name="VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR"        comment="Present from local memory"/>
+        <enum bitpos="1"    name="VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR"       comment="Present from remote memory"/>
+        <enum bitpos="2"    name="VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR"          comment="Present sum of local and/or remote memory"/>
+        <enum bitpos="3"    name="VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR" comment="Each physical device presents from local memory"/>
+    </enums>
+    <enums name="VkSwapchainCreateFlagBitsKHR" type="bitmask">
+    </enums>
+    <enums name="VkViewportCoordinateSwizzleNV" type="enum">
+        <enum value="0"     name="VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV"/>
+        <enum value="1"     name="VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_X_NV"/>
+        <enum value="2"     name="VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Y_NV"/>
+        <enum value="3"     name="VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Y_NV"/>
+        <enum value="4"     name="VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Z_NV"/>
+        <enum value="5"     name="VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Z_NV"/>
+        <enum value="6"     name="VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_W_NV"/>
+        <enum value="7"     name="VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV"/>
+    </enums>
+    <enums name="VkDiscardRectangleModeEXT" type="enum">
+        <enum value="0"     name="VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT"/>
+        <enum value="1"     name="VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT"/>
+    </enums>
+    <enums name="VkSubpassDescriptionFlagBits" type="bitmask">
+    </enums>
+    <enums name="VkPointClippingBehavior" type="enum">
+        <enum value="0"     name="VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES"/>
+        <enum value="1"     name="VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY"/>
+    </enums>
+    <enums name="VkSamplerReductionMode" type="enum">
+        <enum value="0"     name="VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE"/>
+        <enum value="1"     name="VK_SAMPLER_REDUCTION_MODE_MIN"/>
+        <enum value="2"     name="VK_SAMPLER_REDUCTION_MODE_MAX"/>
+    </enums>
+    <enums name="VkTessellationDomainOrigin" type="enum">
+        <enum value="0"     name="VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT"/>
+        <enum value="1"     name="VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT"/>
+    </enums>
+    <enums name="VkSamplerYcbcrModelConversion" type="enum">
+        <enum value="0"     name="VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY"/>
+        <enum value="1"     name="VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY" comment="just range expansion"/>
+        <enum value="2"     name="VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709"      comment="aka HD YUV"/>
+        <enum value="3"     name="VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601"      comment="aka SD YUV"/>
+        <enum value="4"     name="VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020"     comment="aka UHD YUV"/>
+    </enums>
+    <enums name="VkSamplerYcbcrRange" type="enum">
+        <enum value="0"     name="VK_SAMPLER_YCBCR_RANGE_ITU_FULL"    comment="Luma 0..1 maps to 0..255, chroma -0.5..0.5 to 1..255 (clamped)"/>
+        <enum value="1"     name="VK_SAMPLER_YCBCR_RANGE_ITU_NARROW"  comment="Luma 0..1 maps to 16..235, chroma -0.5..0.5 to 16..240"/>
+    </enums>
+    <enums name="VkChromaLocation" type="enum">
+        <enum value="0"     name="VK_CHROMA_LOCATION_COSITED_EVEN"/>
+        <enum value="1"     name="VK_CHROMA_LOCATION_MIDPOINT"/>
+    </enums>
+    <enums name="VkBlendOverlapEXT" type="enum">
+        <enum value="0"     name="VK_BLEND_OVERLAP_UNCORRELATED_EXT"/>
+        <enum value="1"     name="VK_BLEND_OVERLAP_DISJOINT_EXT"/>
+        <enum value="2"     name="VK_BLEND_OVERLAP_CONJOINT_EXT"/>
+    </enums>
+    <enums name="VkCoverageModulationModeNV" type="enum">
+        <enum value="0"     name="VK_COVERAGE_MODULATION_MODE_NONE_NV"/>
+        <enum value="1"     name="VK_COVERAGE_MODULATION_MODE_RGB_NV"/>
+        <enum value="2"     name="VK_COVERAGE_MODULATION_MODE_ALPHA_NV"/>
+        <enum value="3"     name="VK_COVERAGE_MODULATION_MODE_RGBA_NV"/>
+    </enums>
+    <enums name="VkCoverageReductionModeNV" type="enum">
+        <enum value="0"     name="VK_COVERAGE_REDUCTION_MODE_MERGE_NV"/>
+        <enum value="1"     name="VK_COVERAGE_REDUCTION_MODE_TRUNCATE_NV"/>
+    </enums>
+    <enums name="VkValidationCacheHeaderVersionEXT" type="enum">
+        <enum value="1"     name="VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT"/>
+    </enums>
+    <enums name="VkShaderInfoTypeAMD" type="enum">
+        <enum value="0"     name="VK_SHADER_INFO_TYPE_STATISTICS_AMD"/>
+        <enum value="1"     name="VK_SHADER_INFO_TYPE_BINARY_AMD"/>
+        <enum value="2"     name="VK_SHADER_INFO_TYPE_DISASSEMBLY_AMD"/>
+    </enums>
+    <enums name="VkQueueGlobalPriorityEXT" type="enum">
+        <enum value="128"   name="VK_QUEUE_GLOBAL_PRIORITY_LOW_EXT"/>
+        <enum value="256"   name="VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT"/>
+        <enum value="512"   name="VK_QUEUE_GLOBAL_PRIORITY_HIGH_EXT"/>
+        <enum value="1024"  name="VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT"/>
+    </enums>
+    <enums name="VkDebugUtilsMessageSeverityFlagBitsEXT" type="bitmask">
+        <enum bitpos="0"    name="VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT"/>
+        <enum bitpos="4"    name="VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT"/>
+        <enum bitpos="8"    name="VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT"/>
+        <enum bitpos="12"   name="VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT"/>
+    </enums>
+    <enums name="VkDebugUtilsMessageTypeFlagBitsEXT" type="bitmask">
+        <enum bitpos="0"    name="VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT"/>
+        <enum bitpos="1"    name="VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT"/>
+        <enum bitpos="2"    name="VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT"/>
+    </enums>
+    <enums name="VkConservativeRasterizationModeEXT" type="enum">
+        <enum value="0"     name="VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT"/>
+        <enum value="1"     name="VK_CONSERVATIVE_RASTERIZATION_MODE_OVERESTIMATE_EXT"/>
+        <enum value="2"     name="VK_CONSERVATIVE_RASTERIZATION_MODE_UNDERESTIMATE_EXT"/>
+    </enums>
+    <enums name="VkDescriptorBindingFlagBits" type="bitmask">
+        <enum bitpos="0" name="VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT"/>
+        <enum bitpos="1" name="VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT"/>
+        <enum bitpos="2" name="VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT"/>
+        <enum bitpos="3" name="VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT"/>
+    </enums>
+    <enums name="VkVendorId" type="enum">
+        <comment>Vendor IDs are now represented as enums instead of the old
+                 &lt;vendorids&gt; tag, allowing them to be included in the
+                 API headers.</comment>
+        <enum value="0x10001" name="VK_VENDOR_ID_VIV"   comment="Vivante vendor ID"/>
+        <enum value="0x10002" name="VK_VENDOR_ID_VSI"   comment="VeriSilicon vendor ID"/>
+        <enum value="0x10003" name="VK_VENDOR_ID_KAZAN" comment="Kazan Software Renderer"/>
+        <enum value="0x10004" name="VK_VENDOR_ID_CODEPLAY" comment="Codeplay Software Ltd. vendor ID"/>
+        <enum value="0x10005" name="VK_VENDOR_ID_MESA"  comment="Mesa vendor ID"/>
+        <enum value="0x10006" name="VK_VENDOR_ID_POCL"  comment="PoCL vendor ID"/>
+            <unused start="0x10007" comment="This is the next unused available Khronos vendor ID"/>
+    </enums>
+    <enums name="VkDriverId" type="enum">
+        <comment>Driver IDs are now represented as enums instead of the old
+                 &lt;driverids&gt; tag, allowing them to be included in the
+                 API headers.</comment>
+        <enum value="1"       name="VK_DRIVER_ID_AMD_PROPRIETARY"               comment="Advanced Micro Devices, Inc."/>
+        <enum value="2"       name="VK_DRIVER_ID_AMD_OPEN_SOURCE"               comment="Advanced Micro Devices, Inc."/>
+        <enum value="3"       name="VK_DRIVER_ID_MESA_RADV"                     comment="Mesa open source project"/>
+        <enum value="4"       name="VK_DRIVER_ID_NVIDIA_PROPRIETARY"            comment="NVIDIA Corporation"/>
+        <enum value="5"       name="VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS"     comment="Intel Corporation"/>
+        <enum value="6"       name="VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA"        comment="Intel Corporation"/>
+        <enum value="7"       name="VK_DRIVER_ID_IMAGINATION_PROPRIETARY"       comment="Imagination Technologies"/>
+        <enum value="8"       name="VK_DRIVER_ID_QUALCOMM_PROPRIETARY"          comment="Qualcomm Technologies, Inc."/>
+        <enum value="9"       name="VK_DRIVER_ID_ARM_PROPRIETARY"               comment="Arm Limited"/>
+        <enum value="10"      name="VK_DRIVER_ID_GOOGLE_SWIFTSHADER"            comment="Google LLC"/>
+        <enum value="11"      name="VK_DRIVER_ID_GGP_PROPRIETARY"               comment="Google LLC"/>
+        <enum value="12"      name="VK_DRIVER_ID_BROADCOM_PROPRIETARY"          comment="Broadcom Inc."/>
+        <enum value="13"      name="VK_DRIVER_ID_MESA_LLVMPIPE"                 comment="Mesa"/>
+        <enum value="14"      name="VK_DRIVER_ID_MOLTENVK"                      comment="MoltenVK"/>
+        <enum value="15"      name="VK_DRIVER_ID_COREAVI_PROPRIETARY"           comment="Core Avionics &amp; Industrial Inc."/>
+        <enum value="16"      name="VK_DRIVER_ID_JUICE_PROPRIETARY"             comment="Juice Technologies, Inc."/>
+        <enum value="17"      name="VK_DRIVER_ID_VERISILICON_PROPRIETARY"       comment="Verisilicon, Inc."/>
+        <enum value="18"      name="VK_DRIVER_ID_MESA_TURNIP"                   comment="Mesa open source project"/>
+        <enum value="19"      name="VK_DRIVER_ID_MESA_V3DV"                     comment="Mesa open source project"/>
+        <enum value="20"      name="VK_DRIVER_ID_MESA_PANVK"                    comment="Mesa open source project"/>
+    </enums>
+    <enums name="VkConditionalRenderingFlagBitsEXT" type="bitmask">
+        <enum bitpos="0"    name="VK_CONDITIONAL_RENDERING_INVERTED_BIT_EXT"/>
+    </enums>
+    <enums name="VkResolveModeFlagBits" type="bitmask">
+        <enum value="0" name="VK_RESOLVE_MODE_NONE"/>
+        <enum bitpos="0" name="VK_RESOLVE_MODE_SAMPLE_ZERO_BIT"/>
+        <enum bitpos="1" name="VK_RESOLVE_MODE_AVERAGE_BIT"/>
+        <enum bitpos="2" name="VK_RESOLVE_MODE_MIN_BIT"/>
+        <enum bitpos="3" name="VK_RESOLVE_MODE_MAX_BIT"/>
+    </enums>
+    <enums name="VkShadingRatePaletteEntryNV" type="enum">
+        <enum value="0" name="VK_SHADING_RATE_PALETTE_ENTRY_NO_INVOCATIONS_NV"/>
+        <enum value="1" name="VK_SHADING_RATE_PALETTE_ENTRY_16_INVOCATIONS_PER_PIXEL_NV"/>
+        <enum value="2" name="VK_SHADING_RATE_PALETTE_ENTRY_8_INVOCATIONS_PER_PIXEL_NV"/>
+        <enum value="3" name="VK_SHADING_RATE_PALETTE_ENTRY_4_INVOCATIONS_PER_PIXEL_NV"/>
+        <enum value="4" name="VK_SHADING_RATE_PALETTE_ENTRY_2_INVOCATIONS_PER_PIXEL_NV"/>
+        <enum value="5" name="VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_PIXEL_NV"/>
+        <enum value="6" name="VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X1_PIXELS_NV"/>
+        <enum value="7" name="VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_1X2_PIXELS_NV"/>
+        <enum value="8" name="VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X2_PIXELS_NV"/>
+        <enum value="9" name="VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X2_PIXELS_NV"/>
+        <enum value="10" name="VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X4_PIXELS_NV"/>
+        <enum value="11" name="VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X4_PIXELS_NV"/>
+    </enums>
+    <enums name="VkCoarseSampleOrderTypeNV" type="enum">
+        <enum value="0" name="VK_COARSE_SAMPLE_ORDER_TYPE_DEFAULT_NV"/>
+        <enum value="1" name="VK_COARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV"/>
+        <enum value="2" name="VK_COARSE_SAMPLE_ORDER_TYPE_PIXEL_MAJOR_NV"/>
+        <enum value="3" name="VK_COARSE_SAMPLE_ORDER_TYPE_SAMPLE_MAJOR_NV"/>
+    </enums>
+    <enums name="VkGeometryInstanceFlagBitsKHR" type="bitmask">
+        <enum bitpos="0" name="VK_GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR"/>
+        <enum bitpos="1" name="VK_GEOMETRY_INSTANCE_TRIANGLE_FLIP_FACING_BIT_KHR"/>
+        <enum bitpos="2" name="VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR"/>
+        <enum bitpos="3" name="VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR"/>
+        <enum            name="VK_GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_KHR" alias="VK_GEOMETRY_INSTANCE_TRIANGLE_FLIP_FACING_BIT_KHR"/>
+    </enums>
+    <enums name="VkGeometryFlagBitsKHR" type="bitmask">
+        <enum bitpos="0" name="VK_GEOMETRY_OPAQUE_BIT_KHR"/>
+        <enum bitpos="1" name="VK_GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR"/>
+    </enums>
+    <enums name="VkBuildAccelerationStructureFlagBitsKHR" type="bitmask">
+        <enum bitpos="0" name="VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR"/>
+        <enum bitpos="1" name="VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR"/>
+        <enum bitpos="2" name="VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR"/>
+        <enum bitpos="3" name="VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR"/>
+        <enum bitpos="4" name="VK_BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_KHR"/>
+    </enums>
+    <enums name="VkAccelerationStructureCreateFlagBitsKHR" type="bitmask">
+        <enum bitpos="0" name="VK_ACCELERATION_STRUCTURE_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR"/>
+    </enums>
+    <enums name="VkCopyAccelerationStructureModeKHR" type="enum">
+        <enum value="0" name="VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR"/>
+        <enum value="1" name="VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR"/>
+        <enum value="2" name="VK_COPY_ACCELERATION_STRUCTURE_MODE_SERIALIZE_KHR"/>
+        <enum value="3" name="VK_COPY_ACCELERATION_STRUCTURE_MODE_DESERIALIZE_KHR"/>
+    </enums>
+    <enums name="VkBuildAccelerationStructureModeKHR" type="enum">
+        <enum value="0" name="VK_BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR"/>
+        <enum value="1" name="VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR"/>
+    </enums>
+    <enums name="VkAccelerationStructureTypeKHR" type="enum">
+        <enum value="0" name="VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR"/>
+        <enum value="1" name="VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR"/>
+        <enum value="2" name="VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR"/>
+    </enums>
+    <enums name="VkGeometryTypeKHR" type="enum">
+        <enum value="0" name="VK_GEOMETRY_TYPE_TRIANGLES_KHR"/>
+        <enum value="1" name="VK_GEOMETRY_TYPE_AABBS_KHR"/>
+        <enum value="2" name="VK_GEOMETRY_TYPE_INSTANCES_KHR"/>
+    </enums>
+    <enums name="VkAccelerationStructureMemoryRequirementsTypeNV" type="enum">
+        <enum value="0" name="VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV"/>
+        <enum value="1" name="VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NV"/>
+        <enum value="2" name="VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_NV"/>
+    </enums>
+    <enums name="VkAccelerationStructureBuildTypeKHR" type="enum">
+        <enum value="0" name="VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_KHR"/>
+        <enum value="1" name="VK_ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR"/>
+        <enum value="2" name="VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR"/>
+    </enums>
+    <enums name="VkRayTracingShaderGroupTypeKHR" type="enum">
+        <enum value="0" name="VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR"/>
+        <enum value="1" name="VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR"/>
+        <enum value="2" name="VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR"/>
+    </enums>
+    <enums name="VkAccelerationStructureCompatibilityKHR" type="enum">
+        <enum value="0" name="VK_ACCELERATION_STRUCTURE_COMPATIBILITY_COMPATIBLE_KHR"/>
+        <enum value="1" name="VK_ACCELERATION_STRUCTURE_COMPATIBILITY_INCOMPATIBLE_KHR"/>
+    </enums>
+    <enums name="VkShaderGroupShaderKHR" type="enum">
+        <enum value="0" name="VK_SHADER_GROUP_SHADER_GENERAL_KHR"/>
+        <enum value="1" name="VK_SHADER_GROUP_SHADER_CLOSEST_HIT_KHR"/>
+        <enum value="2" name="VK_SHADER_GROUP_SHADER_ANY_HIT_KHR"/>
+        <enum value="3" name="VK_SHADER_GROUP_SHADER_INTERSECTION_KHR"/>
+    </enums>
+    <enums name="VkMemoryOverallocationBehaviorAMD" type="enum">
+        <enum value="0"     name="VK_MEMORY_OVERALLOCATION_BEHAVIOR_DEFAULT_AMD"/>
+        <enum value="1"     name="VK_MEMORY_OVERALLOCATION_BEHAVIOR_ALLOWED_AMD"/>
+        <enum value="2"     name="VK_MEMORY_OVERALLOCATION_BEHAVIOR_DISALLOWED_AMD"/>
+    </enums>
+    <enums name="VkFramebufferCreateFlagBits" type="bitmask">
+    </enums>
+    <enums name="VkScopeNV" type="enum">
+        <enum value="1"     name="VK_SCOPE_DEVICE_NV"/>
+        <enum value="2"     name="VK_SCOPE_WORKGROUP_NV"/>
+        <enum value="3"     name="VK_SCOPE_SUBGROUP_NV"/>
+        <enum value="5"     name="VK_SCOPE_QUEUE_FAMILY_NV"/>
+    </enums>
+    <enums name="VkComponentTypeNV" type="enum">
+        <enum value="0"     name="VK_COMPONENT_TYPE_FLOAT16_NV"/>
+        <enum value="1"     name="VK_COMPONENT_TYPE_FLOAT32_NV"/>
+        <enum value="2"     name="VK_COMPONENT_TYPE_FLOAT64_NV"/>
+        <enum value="3"     name="VK_COMPONENT_TYPE_SINT8_NV"/>
+        <enum value="4"     name="VK_COMPONENT_TYPE_SINT16_NV"/>
+        <enum value="5"     name="VK_COMPONENT_TYPE_SINT32_NV"/>
+        <enum value="6"     name="VK_COMPONENT_TYPE_SINT64_NV"/>
+        <enum value="7"     name="VK_COMPONENT_TYPE_UINT8_NV"/>
+        <enum value="8"     name="VK_COMPONENT_TYPE_UINT16_NV"/>
+        <enum value="9"     name="VK_COMPONENT_TYPE_UINT32_NV"/>
+        <enum value="10"    name="VK_COMPONENT_TYPE_UINT64_NV"/>
+    </enums>
+    <enums name="VkDeviceDiagnosticsConfigFlagBitsNV" type="bitmask">
+        <enum bitpos="0" name="VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_SHADER_DEBUG_INFO_BIT_NV"/>
+        <enum bitpos="1" name="VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_RESOURCE_TRACKING_BIT_NV"/>
+        <enum bitpos="2" name="VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_AUTOMATIC_CHECKPOINTS_BIT_NV"/>
+    </enums>
+    <enums name="VkPipelineCreationFeedbackFlagBitsEXT" type="bitmask">
+        <enum bitpos="0"    name="VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT_EXT"/>
+        <enum bitpos="1"    name="VK_PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT_EXT"/>
+        <enum bitpos="2"    name="VK_PIPELINE_CREATION_FEEDBACK_BASE_PIPELINE_ACCELERATION_BIT_EXT"/>
+    </enums>
+    <enums name="VkFullScreenExclusiveEXT" type="enum">
+        <enum value="0"     name="VK_FULL_SCREEN_EXCLUSIVE_DEFAULT_EXT"/>
+        <enum value="1"     name="VK_FULL_SCREEN_EXCLUSIVE_ALLOWED_EXT"/>
+        <enum value="2"     name="VK_FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT"/>
+        <enum value="3"     name="VK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT"/>
+    </enums>
+    <enums name="VkPerformanceCounterScopeKHR" type="enum">
+        <enum value="0"     name="VK_PERFORMANCE_COUNTER_SCOPE_COMMAND_BUFFER_KHR"/>
+        <enum value="1"     name="VK_PERFORMANCE_COUNTER_SCOPE_RENDER_PASS_KHR"/>
+        <enum value="2"     name="VK_PERFORMANCE_COUNTER_SCOPE_COMMAND_KHR"/>
+        <enum               name="VK_QUERY_SCOPE_COMMAND_BUFFER_KHR" alias="VK_PERFORMANCE_COUNTER_SCOPE_COMMAND_BUFFER_KHR"/>
+        <enum               name="VK_QUERY_SCOPE_RENDER_PASS_KHR" alias="VK_PERFORMANCE_COUNTER_SCOPE_RENDER_PASS_KHR"/>
+        <enum               name="VK_QUERY_SCOPE_COMMAND_KHR" alias="VK_PERFORMANCE_COUNTER_SCOPE_COMMAND_KHR"/>
+    </enums>
+    <enums name="VkPerformanceCounterUnitKHR" type="enum">
+        <enum value="0"     name="VK_PERFORMANCE_COUNTER_UNIT_GENERIC_KHR"/>
+        <enum value="1"     name="VK_PERFORMANCE_COUNTER_UNIT_PERCENTAGE_KHR"/>
+        <enum value="2"     name="VK_PERFORMANCE_COUNTER_UNIT_NANOSECONDS_KHR"/>
+        <enum value="3"     name="VK_PERFORMANCE_COUNTER_UNIT_BYTES_KHR"/>
+        <enum value="4"     name="VK_PERFORMANCE_COUNTER_UNIT_BYTES_PER_SECOND_KHR"/>
+        <enum value="5"     name="VK_PERFORMANCE_COUNTER_UNIT_KELVIN_KHR"/>
+        <enum value="6"     name="VK_PERFORMANCE_COUNTER_UNIT_WATTS_KHR"/>
+        <enum value="7"     name="VK_PERFORMANCE_COUNTER_UNIT_VOLTS_KHR"/>
+        <enum value="8"     name="VK_PERFORMANCE_COUNTER_UNIT_AMPS_KHR"/>
+        <enum value="9"     name="VK_PERFORMANCE_COUNTER_UNIT_HERTZ_KHR"/>
+        <enum value="10"    name="VK_PERFORMANCE_COUNTER_UNIT_CYCLES_KHR"/>
+    </enums>
+    <enums name="VkPerformanceCounterStorageKHR" type="enum">
+        <enum value="0"     name="VK_PERFORMANCE_COUNTER_STORAGE_INT32_KHR"/>
+        <enum value="1"     name="VK_PERFORMANCE_COUNTER_STORAGE_INT64_KHR"/>
+        <enum value="2"     name="VK_PERFORMANCE_COUNTER_STORAGE_UINT32_KHR"/>
+        <enum value="3"     name="VK_PERFORMANCE_COUNTER_STORAGE_UINT64_KHR"/>
+        <enum value="4"     name="VK_PERFORMANCE_COUNTER_STORAGE_FLOAT32_KHR"/>
+        <enum value="5"     name="VK_PERFORMANCE_COUNTER_STORAGE_FLOAT64_KHR"/>
+    </enums>
+    <enums name="VkPerformanceCounterDescriptionFlagBitsKHR" type="bitmask">
+        <enum bitpos="0"    name="VK_PERFORMANCE_COUNTER_DESCRIPTION_PERFORMANCE_IMPACTING_BIT_KHR"/>
+        <enum               name="VK_PERFORMANCE_COUNTER_DESCRIPTION_PERFORMANCE_IMPACTING_KHR" alias="VK_PERFORMANCE_COUNTER_DESCRIPTION_PERFORMANCE_IMPACTING_BIT_KHR" comment="Backwards-compatible alias containing a typo"/>
+        <enum bitpos="1"    name="VK_PERFORMANCE_COUNTER_DESCRIPTION_CONCURRENTLY_IMPACTED_BIT_KHR"/>
+        <enum               name="VK_PERFORMANCE_COUNTER_DESCRIPTION_CONCURRENTLY_IMPACTED_KHR" alias="VK_PERFORMANCE_COUNTER_DESCRIPTION_CONCURRENTLY_IMPACTED_BIT_KHR" comment="Backwards-compatible alias containing a typo"/>
+    </enums>
+    <enums name="VkAcquireProfilingLockFlagBitsKHR" type="bitmask">
+    </enums>
+    <enums name="VkShaderCorePropertiesFlagBitsAMD" type="bitmask">
+    </enums>
+    <enums name="VkPerformanceConfigurationTypeINTEL" type="enum">
+        <enum value="0"     name="VK_PERFORMANCE_CONFIGURATION_TYPE_COMMAND_QUEUE_METRICS_DISCOVERY_ACTIVATED_INTEL"/>
+    </enums>
+    <enums name="VkQueryPoolSamplingModeINTEL" type="enum">
+        <enum value="0"     name="VK_QUERY_POOL_SAMPLING_MODE_MANUAL_INTEL"/>
+    </enums>
+    <enums name="VkPerformanceOverrideTypeINTEL" type="enum">
+        <enum value="0"     name="VK_PERFORMANCE_OVERRIDE_TYPE_NULL_HARDWARE_INTEL"/>
+        <enum value="1"     name="VK_PERFORMANCE_OVERRIDE_TYPE_FLUSH_GPU_CACHES_INTEL"/>
+    </enums>
+    <enums name="VkPerformanceParameterTypeINTEL" type="enum">
+        <enum value="0"     name="VK_PERFORMANCE_PARAMETER_TYPE_HW_COUNTERS_SUPPORTED_INTEL"/>
+        <enum value="1"     name="VK_PERFORMANCE_PARAMETER_TYPE_STREAM_MARKER_VALID_BITS_INTEL"/>
+    </enums>
+    <enums name="VkPerformanceValueTypeINTEL" type="enum">
+        <enum value="0"     name="VK_PERFORMANCE_VALUE_TYPE_UINT32_INTEL"/>
+        <enum value="1"     name="VK_PERFORMANCE_VALUE_TYPE_UINT64_INTEL"/>
+        <enum value="2"     name="VK_PERFORMANCE_VALUE_TYPE_FLOAT_INTEL"/>
+        <enum value="3"     name="VK_PERFORMANCE_VALUE_TYPE_BOOL_INTEL"/>
+        <enum value="4"     name="VK_PERFORMANCE_VALUE_TYPE_STRING_INTEL"/>
+    </enums>
+    <enums name="VkShaderFloatControlsIndependence" type="enum">
+        <enum value="0"     name="VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY"/>
+        <enum value="1"     name="VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL"/>
+        <enum value="2"     name="VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_NONE"/>
+    </enums>
+    <enums name="VkPipelineExecutableStatisticFormatKHR" type="enum">
+        <enum value="0" name="VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_BOOL32_KHR"/>
+        <enum value="1" name="VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_INT64_KHR"/>
+        <enum value="2" name="VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_UINT64_KHR"/>
+        <enum value="3" name="VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_FLOAT64_KHR"/>
+    </enums>
+    <enums name="VkLineRasterizationModeEXT" type="enum">
+        <enum value="0"     name="VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT"/>
+        <enum value="1"     name="VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT"/>
+        <enum value="2"     name="VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT"/>
+        <enum value="3"     name="VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT"/>
+    </enums>
+    <enums name="VkShaderModuleCreateFlagBits" type="bitmask">
+    </enums>
+    <enums name="VkPipelineCompilerControlFlagBitsAMD" type="bitmask">
+    </enums>
+    <enums name="VkToolPurposeFlagBitsEXT" type="bitmask">
+        <enum bitpos="0"     name="VK_TOOL_PURPOSE_VALIDATION_BIT_EXT"/>
+        <enum bitpos="1"     name="VK_TOOL_PURPOSE_PROFILING_BIT_EXT"/>
+        <enum bitpos="2"     name="VK_TOOL_PURPOSE_TRACING_BIT_EXT"/>
+        <enum bitpos="3"     name="VK_TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT_EXT"/>
+        <enum bitpos="4"     name="VK_TOOL_PURPOSE_MODIFYING_FEATURES_BIT_EXT"/>
+    </enums>
+    <enums name="VkFragmentShadingRateCombinerOpKHR" type="enum">
+        <enum value="0" name="VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR"/>
+        <enum value="1" name="VK_FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_KHR"/>
+        <enum value="2" name="VK_FRAGMENT_SHADING_RATE_COMBINER_OP_MIN_KHR"/>
+        <enum value="3" name="VK_FRAGMENT_SHADING_RATE_COMBINER_OP_MAX_KHR"/>
+        <enum value="4" name="VK_FRAGMENT_SHADING_RATE_COMBINER_OP_MUL_KHR"/>
+    </enums>
+    <enums name="VkFragmentShadingRateNV" type="enum">
+        <enum value="0"  name="VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV"/>
+        <enum value="1"  name="VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV"/>
+        <enum value="4"  name="VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV"/>
+        <enum value="5"  name="VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV"/>
+        <enum value="6"  name="VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV"/>
+        <enum value="9"  name="VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV"/>
+        <enum value="10" name="VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV"/>
+        <enum value="11" name="VK_FRAGMENT_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV"/>
+        <enum value="12" name="VK_FRAGMENT_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV"/>
+        <enum value="13" name="VK_FRAGMENT_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV"/>
+        <enum value="14" name="VK_FRAGMENT_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV"/>
+        <enum value="15" name="VK_FRAGMENT_SHADING_RATE_NO_INVOCATIONS_NV"/>
+    </enums>
+    <enums name="VkFragmentShadingRateTypeNV" type="enum">
+        <enum value="0"  name="VK_FRAGMENT_SHADING_RATE_TYPE_FRAGMENT_SIZE_NV"/>
+        <enum value="1"  name="VK_FRAGMENT_SHADING_RATE_TYPE_ENUMS_NV"/>
+    </enums>
+    <enums name="VkAccessFlagBits2KHR" type="bitmask" bitwidth="64">
+        <enum value="0"     name="VK_ACCESS_2_NONE_KHR"/>
+        <enum bitpos="0"    name="VK_ACCESS_2_INDIRECT_COMMAND_READ_BIT_KHR"/>
+        <enum bitpos="1"    name="VK_ACCESS_2_INDEX_READ_BIT_KHR"/>
+        <enum bitpos="2"    name="VK_ACCESS_2_VERTEX_ATTRIBUTE_READ_BIT_KHR"/>
+        <enum bitpos="3"    name="VK_ACCESS_2_UNIFORM_READ_BIT_KHR"/>
+        <enum bitpos="4"    name="VK_ACCESS_2_INPUT_ATTACHMENT_READ_BIT_KHR"/>
+        <enum bitpos="5"    name="VK_ACCESS_2_SHADER_READ_BIT_KHR"/>
+        <enum bitpos="6"    name="VK_ACCESS_2_SHADER_WRITE_BIT_KHR"/>
+        <enum bitpos="7"    name="VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT_KHR"/>
+        <enum bitpos="8"    name="VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT_KHR"/>
+        <enum bitpos="9"    name="VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT_KHR"/>
+        <enum bitpos="10"   name="VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT_KHR"/>
+        <enum bitpos="11"   name="VK_ACCESS_2_TRANSFER_READ_BIT_KHR"/>
+        <enum bitpos="12"   name="VK_ACCESS_2_TRANSFER_WRITE_BIT_KHR"/>
+        <enum bitpos="13"   name="VK_ACCESS_2_HOST_READ_BIT_KHR"/>
+        <enum bitpos="14"   name="VK_ACCESS_2_HOST_WRITE_BIT_KHR"/>
+        <enum bitpos="15"   name="VK_ACCESS_2_MEMORY_READ_BIT_KHR"/>
+        <enum bitpos="16"   name="VK_ACCESS_2_MEMORY_WRITE_BIT_KHR"/>
+        <!-- bitpos 17-31 are specified by extensions to the original VkAccessFlagBits enum -->
+        <enum bitpos="32"   name="VK_ACCESS_2_SHADER_SAMPLED_READ_BIT_KHR"/>
+        <enum bitpos="33"   name="VK_ACCESS_2_SHADER_STORAGE_READ_BIT_KHR"/>
+        <enum bitpos="34"   name="VK_ACCESS_2_SHADER_STORAGE_WRITE_BIT_KHR"/>
+    </enums>
+    <enums name="VkPipelineStageFlagBits2KHR" type="bitmask" bitwidth="64">
+        <enum value="0"    name="VK_PIPELINE_STAGE_2_NONE_KHR"/>
+        <enum bitpos="0"    name="VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT_KHR"/>
+        <enum bitpos="1"    name="VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT_KHR"/>
+        <enum bitpos="2"    name="VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT_KHR"/>
+        <enum bitpos="3"    name="VK_PIPELINE_STAGE_2_VERTEX_SHADER_BIT_KHR"/>
+        <enum bitpos="4"    name="VK_PIPELINE_STAGE_2_TESSELLATION_CONTROL_SHADER_BIT_KHR"/>
+        <enum bitpos="5"    name="VK_PIPELINE_STAGE_2_TESSELLATION_EVALUATION_SHADER_BIT_KHR"/>
+        <enum bitpos="6"    name="VK_PIPELINE_STAGE_2_GEOMETRY_SHADER_BIT_KHR"/>
+        <enum bitpos="7"    name="VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT_KHR"/>
+        <enum bitpos="8"    name="VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT_KHR"/>
+        <enum bitpos="9"    name="VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT_KHR"/>
+        <enum bitpos="10"   name="VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT_KHR"/>
+        <enum bitpos="11"   name="VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT_KHR"/>
+        <enum bitpos="12"   name="VK_PIPELINE_STAGE_2_ALL_TRANSFER_BIT_KHR"/>
+        <enum               name="VK_PIPELINE_STAGE_2_TRANSFER_BIT_KHR" alias="VK_PIPELINE_STAGE_2_ALL_TRANSFER_BIT_KHR"/>
+        <enum bitpos="13"   name="VK_PIPELINE_STAGE_2_BOTTOM_OF_PIPE_BIT_KHR"/>
+        <enum bitpos="14"   name="VK_PIPELINE_STAGE_2_HOST_BIT_KHR"/>
+        <enum bitpos="15"   name="VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT_KHR"/>
+        <enum bitpos="16"   name="VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT_KHR"/>
+        <!-- bitpos 17-31 are specified by extensions to the original VkPipelineStageFlagBits enum -->
+        <enum bitpos="32"   name="VK_PIPELINE_STAGE_2_COPY_BIT_KHR"/>
+        <enum bitpos="33"   name="VK_PIPELINE_STAGE_2_RESOLVE_BIT_KHR"/>
+        <enum bitpos="34"   name="VK_PIPELINE_STAGE_2_BLIT_BIT_KHR"/>
+        <enum bitpos="35"   name="VK_PIPELINE_STAGE_2_CLEAR_BIT_KHR"/>
+        <enum bitpos="36"   name="VK_PIPELINE_STAGE_2_INDEX_INPUT_BIT_KHR"/>
+        <enum bitpos="37"   name="VK_PIPELINE_STAGE_2_VERTEX_ATTRIBUTE_INPUT_BIT_KHR"/>
+        <enum bitpos="38"   name="VK_PIPELINE_STAGE_2_PRE_RASTERIZATION_SHADERS_BIT_KHR"/>
+    </enums>
+    <enums name="VkSubmitFlagBitsKHR" type="bitmask">
+        <enum bitpos="0"    name="VK_SUBMIT_PROTECTED_BIT_KHR"/>
+    </enums>
+    <enums name="VkEventCreateFlagBits" type="bitmask">
+    </enums>
+    <enums name="VkPipelineLayoutCreateFlagBits" type="bitmask">
+    </enums>
+    <enums name="VkProvokingVertexModeEXT" type="enum">
+        <enum value="0"     name="VK_PROVOKING_VERTEX_MODE_FIRST_VERTEX_EXT"/>
+        <enum value="1"     name="VK_PROVOKING_VERTEX_MODE_LAST_VERTEX_EXT"/>
+    </enums>
+    <enums name="VkAccelerationStructureMotionInstanceTypeNV" type="enum">
+        <enum value="0" name="VK_ACCELERATION_STRUCTURE_MOTION_INSTANCE_TYPE_STATIC_NV"/>
+        <enum value="1" name="VK_ACCELERATION_STRUCTURE_MOTION_INSTANCE_TYPE_MATRIX_MOTION_NV"/>
+        <enum value="2" name="VK_ACCELERATION_STRUCTURE_MOTION_INSTANCE_TYPE_SRT_MOTION_NV"/>
+    </enums>
+
+    <enums name="VkVideoCodecOperationFlagBitsKHR" type="bitmask">
+        <enum value="0"     name="VK_VIDEO_CODEC_OPERATION_INVALID_BIT_KHR"/>
+    </enums>
+    <enums name="VkVideoChromaSubsamplingFlagBitsKHR" type="bitmask" comment="Vulkan video chroma subsampling definitions">
+        <enum value="0"     name="VK_VIDEO_CHROMA_SUBSAMPLING_INVALID_BIT_KHR"/>
+        <enum bitpos="0"    name="VK_VIDEO_CHROMA_SUBSAMPLING_MONOCHROME_BIT_KHR"/>
+        <enum bitpos="1"    name="VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR"/>
+        <enum bitpos="2"    name="VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR"/>
+        <enum bitpos="3"    name="VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR"/>
+    </enums>
+    <enums name="VkVideoComponentBitDepthFlagBitsKHR" type="bitmask" comment="Vulkan video component bit depth definitions">
+        <enum value="0"     name="VK_VIDEO_COMPONENT_BIT_DEPTH_INVALID_KHR"/>
+        <enum bitpos="0"    name="VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR"/>
+        <enum bitpos="2"    name="VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR"/>
+        <enum bitpos="4"    name="VK_VIDEO_COMPONENT_BIT_DEPTH_12_BIT_KHR"/>
+    </enums>
+    <enums name="VkVideoCapabilityFlagBitsKHR" type="bitmask">
+        <enum bitpos="0"    name="VK_VIDEO_CAPABILITY_PROTECTED_CONTENT_BIT_KHR"/>
+        <enum bitpos="1"    name="VK_VIDEO_CAPABILITY_SEPARATE_REFERENCE_IMAGES_BIT_KHR"/>
+    </enums>
+    <enums name="VkVideoSessionCreateFlagBitsKHR" type="bitmask">
+        <enum value="0"     name="VK_VIDEO_SESSION_CREATE_DEFAULT_KHR"/>
+        <enum bitpos="0"    name="VK_VIDEO_SESSION_CREATE_PROTECTED_CONTENT_BIT_KHR"/>
+    </enums>
+    <enums name="VkVideoCodingQualityPresetFlagBitsKHR" type="bitmask">
+        <enum bitpos="0"       name="VK_VIDEO_CODING_QUALITY_PRESET_NORMAL_BIT_KHR"/>
+        <enum bitpos="1"       name="VK_VIDEO_CODING_QUALITY_PRESET_POWER_BIT_KHR"/>
+        <enum bitpos="2"       name="VK_VIDEO_CODING_QUALITY_PRESET_QUALITY_BIT_KHR"/>
+    </enums>
+    <enums name="VkVideoDecodeH264PictureLayoutFlagBitsEXT" type="bitmask">
+        <enum value="0"       name="VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_PROGRESSIVE_EXT"/>
+        <enum bitpos="0"      name="VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_INTERLEAVED_LINES_BIT_EXT"/>
+        <enum bitpos="1"      name="VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_SEPARATE_PLANES_BIT_EXT"/>
+    </enums>
+    <enums name="VkVideoCodingControlFlagBitsKHR" type="bitmask">
+        <enum value="0"     name="VK_VIDEO_CODING_CONTROL_DEFAULT_KHR"/>
+        <enum bitpos="0"    name="VK_VIDEO_CODING_CONTROL_RESET_BIT_KHR"/>
+    </enums>
+    <enums name="VkQueryResultStatusKHR" type="enum">
+        <enum value="-1"    name="VK_QUERY_RESULT_STATUS_ERROR_KHR"/>
+        <enum value="0"     name="VK_QUERY_RESULT_STATUS_NOT_READY_KHR"/>
+        <enum value="1"     name="VK_QUERY_RESULT_STATUS_COMPLETE_KHR"/>
+    </enums>
+    <enums name="VkVideoDecodeFlagBitsKHR" type="bitmask">
+        <enum value="0"     name="VK_VIDEO_DECODE_DEFAULT_KHR"/>
+        <enum bitpos="0"    name="VK_VIDEO_DECODE_RESERVED_0_BIT_KHR"/>
+    </enums>
+    <enums name="VkVideoEncodeFlagBitsKHR" type="bitmask">
+        <enum value="0"     name="VK_VIDEO_ENCODE_DEFAULT_KHR"/>
+        <enum bitpos="0"    name="VK_VIDEO_ENCODE_RESERVED_0_BIT_KHR"/>
+    </enums>
+    <enums name="VkVideoEncodeRateControlFlagBitsKHR" type="bitmask">
+        <enum value="0"     name="VK_VIDEO_ENCODE_RATE_CONTROL_DEFAULT_KHR"/>
+        <enum bitpos="0"    name="VK_VIDEO_ENCODE_RATE_CONTROL_RESET_BIT_KHR"/>
+    </enums>
+    <enums name="VkVideoEncodeRateControlModeFlagBitsKHR" type="bitmask">
+        <enum value="0"      name="VK_VIDEO_ENCODE_RATE_CONTROL_MODE_NONE_BIT_KHR"/>
+        <enum value="1"      name="VK_VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR"/>
+        <enum value="2"      name="VK_VIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR"/>
+    </enums>
+    <enums name="VkVideoEncodeH264CapabilityFlagBitsEXT" type="bitmask">
+        <enum bitpos="0"      name="VK_VIDEO_ENCODE_H264_CAPABILITY_CABAC_BIT_EXT"/>
+        <enum bitpos="1"      name="VK_VIDEO_ENCODE_H264_CAPABILITY_CAVLC_BIT_EXT"/>
+        <enum bitpos="2"      name="VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_BI_PRED_IMPLICIT_BIT_EXT"/>
+        <enum bitpos="3"      name="VK_VIDEO_ENCODE_H264_CAPABILITY_TRANSFORM_8X8_BIT_EXT"/>
+        <enum bitpos="4"      name="VK_VIDEO_ENCODE_H264_CAPABILITY_CHROMA_QP_OFFSET_BIT_EXT"/>
+        <enum bitpos="5"      name="VK_VIDEO_ENCODE_H264_CAPABILITY_SECOND_CHROMA_QP_OFFSET_BIT_EXT"/>
+        <enum bitpos="6"      name="VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_DISABLED_BIT_EXT"/>
+        <enum bitpos="7"      name="VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_ENABLED_BIT_EXT"/>
+        <enum bitpos="8"      name="VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_PARTIAL_BIT_EXT"/>
+        <enum bitpos="9"      name="VK_VIDEO_ENCODE_H264_CAPABILITY_MULTIPLE_SLICE_PER_FRAME_BIT_EXT"/>
+        <enum bitpos="10"      name="VK_VIDEO_ENCODE_H264_CAPABILITY_EVENLY_DISTRIBUTED_SLICE_SIZE_BIT_EXT"/>
+    </enums>
+    <enums name="VkVideoEncodeH264InputModeFlagBitsEXT" type="bitmask">
+        <enum bitpos="0"      name="VK_VIDEO_ENCODE_H264_INPUT_MODE_FRAME_BIT_EXT"/>
+        <enum bitpos="1"      name="VK_VIDEO_ENCODE_H264_INPUT_MODE_SLICE_BIT_EXT"/>
+        <enum bitpos="2"      name="VK_VIDEO_ENCODE_H264_INPUT_MODE_NON_VCL_BIT_EXT"/>
+    </enums>
+    <enums name="VkVideoEncodeH264OutputModeFlagBitsEXT" type="bitmask">
+        <enum bitpos="0"      name="VK_VIDEO_ENCODE_H264_OUTPUT_MODE_FRAME_BIT_EXT"/>
+        <enum bitpos="1"      name="VK_VIDEO_ENCODE_H264_OUTPUT_MODE_SLICE_BIT_EXT"/>
+        <enum bitpos="2"      name="VK_VIDEO_ENCODE_H264_OUTPUT_MODE_NON_VCL_BIT_EXT"/>
+    </enums>
+    <enums name="VkVideoEncodeH264CreateFlagBitsEXT" type="bitmask">
+        <enum value="0"     name="VK_VIDEO_ENCODE_H264_CREATE_DEFAULT_EXT"/>
+        <enum bitpos="0"    name="VK_VIDEO_ENCODE_H264_CREATE_RESERVED_0_BIT_EXT"/>
+    </enums>
+    <enums name="VkImageFormatConstraintsFlagBitsFUCHSIA" type="bitmask">
+    </enums>
+    <enums name="VkImageConstraintsInfoFlagBitsFUCHSIA" type="bitmask">
+        <enum bitpos="0"    name="VK_IMAGE_CONSTRAINTS_INFO_CPU_READ_RARELY_FUCHSIA"/>
+        <enum bitpos="1"    name="VK_IMAGE_CONSTRAINTS_INFO_CPU_READ_OFTEN_FUCHSIA"/>
+        <enum bitpos="2"    name="VK_IMAGE_CONSTRAINTS_INFO_CPU_WRITE_RARELY_FUCHSIA"/>
+        <enum bitpos="3"    name="VK_IMAGE_CONSTRAINTS_INFO_CPU_WRITE_OFTEN_FUCHSIA"/>
+        <enum bitpos="4"    name="VK_IMAGE_CONSTRAINTS_INFO_PROTECTED_OPTIONAL_FUCHSIA"/>
+    </enums>
+    <enums name="VkFormatFeatureFlagBits2KHR" type="bitmask" bitwidth="64">
+      <enum bitpos="0"  name="VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT_KHR"/>
+      <enum bitpos="1"  name="VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT_KHR"/>
+      <enum bitpos="2"  name="VK_FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT_KHR"/>
+      <enum bitpos="3"  name="VK_FORMAT_FEATURE_2_UNIFORM_TEXEL_BUFFER_BIT_KHR"/>
+      <enum bitpos="4"  name="VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_BIT_KHR"/>
+      <enum bitpos="5"  name="VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_ATOMIC_BIT_KHR"/>
+      <enum bitpos="6"  name="VK_FORMAT_FEATURE_2_VERTEX_BUFFER_BIT_KHR"/>
+      <enum bitpos="7"  name="VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT_KHR"/>
+      <enum bitpos="8"  name="VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT_KHR"/>
+      <enum bitpos="9"  name="VK_FORMAT_FEATURE_2_DEPTH_STENCIL_ATTACHMENT_BIT_KHR"/>
+      <enum bitpos="10" name="VK_FORMAT_FEATURE_2_BLIT_SRC_BIT_KHR"/>
+      <enum bitpos="11" name="VK_FORMAT_FEATURE_2_BLIT_DST_BIT_KHR"/>
+      <enum bitpos="12" name="VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT_KHR"/>
+      <enum bitpos="13" name="VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT"/>
+      <enum bitpos="14" name="VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT_KHR"/>
+      <enum bitpos="15" name="VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT_KHR"/>
+      <enum bitpos="16" name="VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT_KHR"/>
+      <enum bitpos="17" name="VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT_KHR"/>
+      <enum bitpos="18" name="VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT_KHR"/>
+      <enum bitpos="19" name="VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT_KHR"/>
+      <enum bitpos="20" name="VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT_KHR"/>
+      <enum bitpos="21" name="VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT_KHR"/>
+      <enum bitpos="22" name="VK_FORMAT_FEATURE_2_DISJOINT_BIT_KHR"/>
+      <enum bitpos="23" name="VK_FORMAT_FEATURE_2_COSITED_CHROMA_SAMPLES_BIT_KHR"/>
+      <enum bitpos="31" name="VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT_KHR"/>
+      <enum bitpos="32" name="VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT_KHR"/>
+      <enum bitpos="33" name="VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT_KHR"/>
+    </enums>
+    <enums name="VkVideoEncodeH265InputModeFlagBitsEXT" type="bitmask">
+        <enum bitpos="0"      name="VK_VIDEO_ENCODE_H265_INPUT_MODE_FRAME_BIT_EXT"/>
+        <enum bitpos="1"      name="VK_VIDEO_ENCODE_H265_INPUT_MODE_SLICE_BIT_EXT"/>
+        <enum bitpos="2"      name="VK_VIDEO_ENCODE_H265_INPUT_MODE_NON_VCL_BIT_EXT"/>
+    </enums>
+    <enums name="VkVideoEncodeH265OutputModeFlagBitsEXT" type="bitmask">
+        <enum bitpos="0"      name="VK_VIDEO_ENCODE_H265_OUTPUT_MODE_FRAME_BIT_EXT"/>
+        <enum bitpos="1"      name="VK_VIDEO_ENCODE_H265_OUTPUT_MODE_SLICE_BIT_EXT"/>
+        <enum bitpos="2"      name="VK_VIDEO_ENCODE_H265_OUTPUT_MODE_NON_VCL_BIT_EXT"/>
+    </enums>
+    <enums name="VkVideoEncodeH265CtbSizeFlagBitsEXT" type="bitmask">
+        <enum bitpos="0"      name="VK_VIDEO_ENCODE_H265_CTB_SIZE_8_BIT_EXT"/>
+        <enum bitpos="1"      name="VK_VIDEO_ENCODE_H265_CTB_SIZE_16_BIT_EXT"/>
+        <enum bitpos="2"      name="VK_VIDEO_ENCODE_H265_CTB_SIZE_32_BIT_EXT"/>
+        <enum bitpos="3"      name="VK_VIDEO_ENCODE_H265_CTB_SIZE_64_BIT_EXT"/>
+    </enums>
+    <enums name="VkRenderingFlagBitsKHR" type="bitmask">
+        <enum bitpos="0"    name="VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT_KHR"/>
+        <enum bitpos="1"    name="VK_RENDERING_SUSPENDING_BIT_KHR"/>
+        <enum bitpos="2"    name="VK_RENDERING_RESUMING_BIT_KHR"/>
+    </enums>
+
+    <commands comment="Vulkan command definitions">
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INITIALIZATION_FAILED,VK_ERROR_LAYER_NOT_PRESENT,VK_ERROR_EXTENSION_NOT_PRESENT,VK_ERROR_INCOMPATIBLE_DRIVER">
+            <proto><type>VkResult</type> <name>vkCreateInstance</name></proto>
+            <param>const <type>VkInstanceCreateInfo</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkInstance</type>* <name>pInstance</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyInstance</name></proto>
+            <param optional="true" externsync="true"><type>VkInstance</type> <name>instance</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <implicitexternsyncparams>
+                <param>all sname:VkPhysicalDevice objects enumerated from pname:instance</param>
+            </implicitexternsyncparams>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INITIALIZATION_FAILED">
+            <proto><type>VkResult</type> <name>vkEnumeratePhysicalDevices</name></proto>
+            <param><type>VkInstance</type> <name>instance</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pPhysicalDeviceCount</name></param>
+            <param optional="true" len="pPhysicalDeviceCount"><type>VkPhysicalDevice</type>* <name>pPhysicalDevices</name></param>
+        </command>
+        <command>
+            <proto><type>PFN_vkVoidFunction</type> <name>vkGetDeviceProcAddr</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param len="null-terminated">const <type>char</type>* <name>pName</name></param>
+        </command>
+        <command>
+            <proto><type>PFN_vkVoidFunction</type> <name>vkGetInstanceProcAddr</name></proto>
+            <param optional="true"><type>VkInstance</type> <name>instance</name></param>
+            <param len="null-terminated">const <type>char</type>* <name>pName</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetPhysicalDeviceProperties</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>VkPhysicalDeviceProperties</type>* <name>pProperties</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetPhysicalDeviceQueueFamilyProperties</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pQueueFamilyPropertyCount</name></param>
+            <param optional="true" len="pQueueFamilyPropertyCount"><type>VkQueueFamilyProperties</type>* <name>pQueueFamilyProperties</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetPhysicalDeviceMemoryProperties</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>VkPhysicalDeviceMemoryProperties</type>* <name>pMemoryProperties</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetPhysicalDeviceFeatures</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>VkPhysicalDeviceFeatures</type>* <name>pFeatures</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetPhysicalDeviceFormatProperties</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>VkFormat</type> <name>format</name></param>
+            <param><type>VkFormatProperties</type>* <name>pFormatProperties</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_FORMAT_NOT_SUPPORTED">
+            <proto><type>VkResult</type> <name>vkGetPhysicalDeviceImageFormatProperties</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>VkFormat</type> <name>format</name></param>
+            <param><type>VkImageType</type> <name>type</name></param>
+            <param><type>VkImageTiling</type> <name>tiling</name></param>
+            <param><type>VkImageUsageFlags</type> <name>usage</name></param>
+            <param optional="true"><type>VkImageCreateFlags</type> <name>flags</name></param>
+            <param><type>VkImageFormatProperties</type>* <name>pImageFormatProperties</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INITIALIZATION_FAILED,VK_ERROR_EXTENSION_NOT_PRESENT,VK_ERROR_FEATURE_NOT_PRESENT,VK_ERROR_TOO_MANY_OBJECTS,VK_ERROR_DEVICE_LOST">
+            <proto><type>VkResult</type> <name>vkCreateDevice</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param>const <type>VkDeviceCreateInfo</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkDevice</type>* <name>pDevice</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyDevice</name></proto>
+            <param optional="true" externsync="true"><type>VkDevice</type> <name>device</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <implicitexternsyncparams>
+                <param>all sname:VkQueue objects created from pname:device</param>
+            </implicitexternsyncparams>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkEnumerateInstanceVersion</name></proto>
+            <param><type>uint32_t</type>* <name>pApiVersion</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkEnumerateInstanceLayerProperties</name></proto>
+            <param optional="false,true"><type>uint32_t</type>* <name>pPropertyCount</name></param>
+            <param optional="true" len="pPropertyCount"><type>VkLayerProperties</type>* <name>pProperties</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_LAYER_NOT_PRESENT">
+            <proto><type>VkResult</type> <name>vkEnumerateInstanceExtensionProperties</name></proto>
+            <param optional="true" len="null-terminated">const <type>char</type>* <name>pLayerName</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pPropertyCount</name></param>
+            <param optional="true" len="pPropertyCount"><type>VkExtensionProperties</type>* <name>pProperties</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkEnumerateDeviceLayerProperties</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pPropertyCount</name></param>
+            <param optional="true" len="pPropertyCount"><type>VkLayerProperties</type>* <name>pProperties</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_LAYER_NOT_PRESENT">
+            <proto><type>VkResult</type> <name>vkEnumerateDeviceExtensionProperties</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param optional="true" len="null-terminated">const <type>char</type>* <name>pLayerName</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pPropertyCount</name></param>
+            <param optional="true" len="pPropertyCount"><type>VkExtensionProperties</type>* <name>pProperties</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetDeviceQueue</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>uint32_t</type> <name>queueFamilyIndex</name></param>
+            <param><type>uint32_t</type> <name>queueIndex</name></param>
+            <param><type>VkQueue</type>* <name>pQueue</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST">
+            <proto><type>VkResult</type> <name>vkQueueSubmit</name></proto>
+            <param externsync="true"><type>VkQueue</type> <name>queue</name></param>
+            <param optional="true"><type>uint32_t</type> <name>submitCount</name></param>
+            <param len="submitCount">const <type>VkSubmitInfo</type>* <name>pSubmits</name></param>
+            <param optional="true" externsync="true"><type>VkFence</type> <name>fence</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST">
+            <proto><type>VkResult</type> <name>vkQueueWaitIdle</name></proto>
+            <param externsync="true"><type>VkQueue</type> <name>queue</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST">
+            <proto><type>VkResult</type> <name>vkDeviceWaitIdle</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <implicitexternsyncparams>
+                <param>all sname:VkQueue objects created from pname:device</param>
+            </implicitexternsyncparams>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INVALID_EXTERNAL_HANDLE,VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR">
+            <proto><type>VkResult</type> <name>vkAllocateMemory</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkMemoryAllocateInfo</type>* <name>pAllocateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkDeviceMemory</type>* <name>pMemory</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkFreeMemory</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true" devicememoryhandle="1"><type>VkDeviceMemory</type> <name>memory</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_MEMORY_MAP_FAILED">
+            <proto><type>VkResult</type> <name>vkMapMemory</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="true" devicememoryhandle="1"><type>VkDeviceMemory</type> <name>memory</name></param>
+            <param><type>VkDeviceSize</type> <name>offset</name></param>
+            <param><type>VkDeviceSize</type> <name>size</name></param>
+            <param optional="true"><type>VkMemoryMapFlags</type> <name>flags</name></param>
+            <param optional="false,true"><type>void</type>** <name>ppData</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkUnmapMemory</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="true" devicememoryhandle="1"><type>VkDeviceMemory</type> <name>memory</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkFlushMappedMemoryRanges</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>uint32_t</type> <name>memoryRangeCount</name></param>
+            <param len="memoryRangeCount">const <type>VkMappedMemoryRange</type>* <name>pMemoryRanges</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkInvalidateMappedMemoryRanges</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>uint32_t</type> <name>memoryRangeCount</name></param>
+            <param len="memoryRangeCount">const <type>VkMappedMemoryRange</type>* <name>pMemoryRanges</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetDeviceMemoryCommitment</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param devicememoryhandle="1"><type>VkDeviceMemory</type> <name>memory</name></param>
+            <param devicememoryoffset="1"><type>VkDeviceSize</type>* <name>pCommittedMemoryInBytes</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetBufferMemoryRequirements</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkBuffer</type> <name>buffer</name></param>
+            <param><type>VkMemoryRequirements</type>* <name>pMemoryRequirements</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR">
+            <proto><type>VkResult</type> <name>vkBindBufferMemory</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="true"><type>VkBuffer</type> <name>buffer</name></param>
+            <param devicememoryhandle="1"><type>VkDeviceMemory</type> <name>memory</name></param>
+            <param devicememoryoffset="1"><type>VkDeviceSize</type> <name>memoryOffset</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetImageMemoryRequirements</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkImage</type> <name>image</name></param>
+            <param><type>VkMemoryRequirements</type>* <name>pMemoryRequirements</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkBindImageMemory</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="true"><type>VkImage</type> <name>image</name></param>
+            <param devicememoryhandle="1"><type>VkDeviceMemory</type> <name>memory</name></param>
+            <param devicememoryoffset="1"><type>VkDeviceSize</type> <name>memoryOffset</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetImageSparseMemoryRequirements</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkImage</type> <name>image</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pSparseMemoryRequirementCount</name></param>
+            <param optional="true" len="pSparseMemoryRequirementCount"><type>VkSparseImageMemoryRequirements</type>* <name>pSparseMemoryRequirements</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetPhysicalDeviceSparseImageFormatProperties</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>VkFormat</type> <name>format</name></param>
+            <param><type>VkImageType</type> <name>type</name></param>
+            <param><type>VkSampleCountFlagBits</type> <name>samples</name></param>
+            <param><type>VkImageUsageFlags</type> <name>usage</name></param>
+            <param><type>VkImageTiling</type> <name>tiling</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pPropertyCount</name></param>
+            <param optional="true" len="pPropertyCount"><type>VkSparseImageFormatProperties</type>* <name>pProperties</name></param>
+        </command>
+        <command queues="sparse_binding" successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST">
+            <proto><type>VkResult</type> <name>vkQueueBindSparse</name></proto>
+            <param externsync="true"><type>VkQueue</type> <name>queue</name></param>
+            <param optional="true"><type>uint32_t</type> <name>bindInfoCount</name></param>
+            <param len="bindInfoCount" externsync="pBindInfo[].pBufferBinds[].buffer,pBindInfo[].pImageOpaqueBinds[].image,pBindInfo[].pImageBinds[].image">const <type>VkBindSparseInfo</type>* <name>pBindInfo</name></param>
+            <param optional="true" externsync="true"><type>VkFence</type> <name>fence</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateFence</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkFenceCreateInfo</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkFence</type>* <name>pFence</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyFence</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true"><type>VkFence</type> <name>fence</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkResetFences</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>uint32_t</type> <name>fenceCount</name></param>
+            <param len="fenceCount" externsync="true">const <type>VkFence</type>* <name>pFences</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_NOT_READY" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST">
+            <proto><type>VkResult</type> <name>vkGetFenceStatus</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkFence</type> <name>fence</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_TIMEOUT" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST">
+            <proto><type>VkResult</type> <name>vkWaitForFences</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>uint32_t</type> <name>fenceCount</name></param>
+            <param len="fenceCount">const <type>VkFence</type>* <name>pFences</name></param>
+            <param><type>VkBool32</type> <name>waitAll</name></param>
+            <param><type>uint64_t</type> <name>timeout</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateSemaphore</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkSemaphoreCreateInfo</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkSemaphore</type>* <name>pSemaphore</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroySemaphore</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true"><type>VkSemaphore</type> <name>semaphore</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateEvent</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkEventCreateInfo</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkEvent</type>* <name>pEvent</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyEvent</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true"><type>VkEvent</type> <name>event</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command successcodes="VK_EVENT_SET,VK_EVENT_RESET" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST">
+            <proto><type>VkResult</type> <name>vkGetEventStatus</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkEvent</type> <name>event</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkSetEvent</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="true"><type>VkEvent</type> <name>event</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkResetEvent</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="true"><type>VkEvent</type> <name>event</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateQueryPool</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkQueryPoolCreateInfo</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkQueryPool</type>* <name>pQueryPool</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyQueryPool</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true"><type>VkQueryPool</type> <name>queryPool</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_NOT_READY" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST">
+            <proto><type>VkResult</type> <name>vkGetQueryPoolResults</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkQueryPool</type> <name>queryPool</name></param>
+            <param><type>uint32_t</type> <name>firstQuery</name></param>
+            <param><type>uint32_t</type> <name>queryCount</name></param>
+            <param><type>size_t</type> <name>dataSize</name></param>
+            <param len="dataSize"><type>void</type>* <name>pData</name></param>
+            <param><type>VkDeviceSize</type> <name>stride</name></param>
+            <param optional="true"><type>VkQueryResultFlags</type> <name>flags</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkResetQueryPool</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkQueryPool</type> <name>queryPool</name></param>
+            <param><type>uint32_t</type> <name>firstQuery</name></param>
+            <param><type>uint32_t</type> <name>queryCount</name></param>
+        </command>
+        <command name="vkResetQueryPoolEXT"                        alias="vkResetQueryPool"/>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR">
+            <proto><type>VkResult</type> <name>vkCreateBuffer</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkBufferCreateInfo</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkBuffer</type>* <name>pBuffer</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyBuffer</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true"><type>VkBuffer</type> <name>buffer</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateBufferView</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkBufferViewCreateInfo</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkBufferView</type>* <name>pView</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyBufferView</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true"><type>VkBufferView</type> <name>bufferView</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateImage</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkImageCreateInfo</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkImage</type>* <name>pImage</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyImage</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true"><type>VkImage</type> <name>image</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetImageSubresourceLayout</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkImage</type> <name>image</name></param>
+            <param>const <type>VkImageSubresource</type>* <name>pSubresource</name></param>
+            <param><type>VkSubresourceLayout</type>* <name>pLayout</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateImageView</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkImageViewCreateInfo</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkImageView</type>* <name>pView</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyImageView</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true"><type>VkImageView</type> <name>imageView</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INVALID_SHADER_NV">
+            <proto><type>VkResult</type> <name>vkCreateShaderModule</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkShaderModuleCreateInfo</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkShaderModule</type>* <name>pShaderModule</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyShaderModule</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true"><type>VkShaderModule</type> <name>shaderModule</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreatePipelineCache</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkPipelineCacheCreateInfo</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkPipelineCache</type>* <name>pPipelineCache</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyPipelineCache</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true"><type>VkPipelineCache</type> <name>pipelineCache</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetPipelineCacheData</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkPipelineCache</type> <name>pipelineCache</name></param>
+            <param optional="false,true"><type>size_t</type>* <name>pDataSize</name></param>
+            <param optional="true" len="pDataSize"><type>void</type>* <name>pData</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkMergePipelineCaches</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="true"><type>VkPipelineCache</type> <name>dstCache</name></param>
+            <param><type>uint32_t</type> <name>srcCacheCount</name></param>
+            <param len="srcCacheCount">const <type>VkPipelineCache</type>* <name>pSrcCaches</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_PIPELINE_COMPILE_REQUIRED_EXT" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INVALID_SHADER_NV">
+            <proto><type>VkResult</type> <name>vkCreateGraphicsPipelines</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true"><type>VkPipelineCache</type> <name>pipelineCache</name></param>
+            <param><type>uint32_t</type> <name>createInfoCount</name></param>
+            <param len="createInfoCount">const <type>VkGraphicsPipelineCreateInfo</type>* <name>pCreateInfos</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param len="createInfoCount"><type>VkPipeline</type>* <name>pPipelines</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_PIPELINE_COMPILE_REQUIRED_EXT" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INVALID_SHADER_NV">
+            <proto><type>VkResult</type> <name>vkCreateComputePipelines</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true"><type>VkPipelineCache</type> <name>pipelineCache</name></param>
+            <param><type>uint32_t</type> <name>createInfoCount</name></param>
+            <param len="createInfoCount">const <type>VkComputePipelineCreateInfo</type>* <name>pCreateInfos</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param len="createInfoCount"><type>VkPipeline</type>* <name>pPipelines</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_SURFACE_LOST_KHR">
+            <proto><type>VkResult</type> <name>vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkRenderPass</type> <name>renderpass</name></param>
+            <param><type>VkExtent2D</type>* <name>pMaxWorkgroupSize</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyPipeline</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true"><type>VkPipeline</type> <name>pipeline</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreatePipelineLayout</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkPipelineLayoutCreateInfo</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkPipelineLayout</type>* <name>pPipelineLayout</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyPipelineLayout</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true"><type>VkPipelineLayout</type> <name>pipelineLayout</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateSampler</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkSamplerCreateInfo</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkSampler</type>* <name>pSampler</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroySampler</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true"><type>VkSampler</type> <name>sampler</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateDescriptorSetLayout</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkDescriptorSetLayoutCreateInfo</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkDescriptorSetLayout</type>* <name>pSetLayout</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyDescriptorSetLayout</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true"><type>VkDescriptorSetLayout</type> <name>descriptorSetLayout</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_FRAGMENTATION_EXT">
+            <proto><type>VkResult</type> <name>vkCreateDescriptorPool</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkDescriptorPoolCreateInfo</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkDescriptorPool</type>* <name>pDescriptorPool</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyDescriptorPool</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true"><type>VkDescriptorPool</type> <name>descriptorPool</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS">
+            <proto><type>VkResult</type> <name>vkResetDescriptorPool</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="true"><type>VkDescriptorPool</type> <name>descriptorPool</name></param>
+            <param optional="true"><type>VkDescriptorPoolResetFlags</type> <name>flags</name></param>
+            <implicitexternsyncparams>
+                <param>any sname:VkDescriptorSet objects allocated from pname:descriptorPool</param>
+            </implicitexternsyncparams>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_FRAGMENTED_POOL,VK_ERROR_OUT_OF_POOL_MEMORY">
+            <proto><type>VkResult</type> <name>vkAllocateDescriptorSets</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="pAllocateInfo-&gt;descriptorPool">const <type>VkDescriptorSetAllocateInfo</type>* <name>pAllocateInfo</name></param>
+            <param len="pAllocateInfo-&gt;descriptorSetCount"><type>VkDescriptorSet</type>* <name>pDescriptorSets</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS">
+            <proto><type>VkResult</type> <name>vkFreeDescriptorSets</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="true"><type>VkDescriptorPool</type> <name>descriptorPool</name></param>
+            <param><type>uint32_t</type> <name>descriptorSetCount</name></param>
+            <param noautovalidity="true" externsync="true" len="descriptorSetCount">const <type>VkDescriptorSet</type>* <name>pDescriptorSets</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkUpdateDescriptorSets</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true"><type>uint32_t</type> <name>descriptorWriteCount</name></param>
+            <param len="descriptorWriteCount" externsync="pDescriptorWrites[].dstSet">const <type>VkWriteDescriptorSet</type>* <name>pDescriptorWrites</name></param>
+            <param optional="true"><type>uint32_t</type> <name>descriptorCopyCount</name></param>
+            <param len="descriptorCopyCount" externsync="pDescriptorCopies[].dstSet">const <type>VkCopyDescriptorSet</type>* <name>pDescriptorCopies</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateFramebuffer</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkFramebufferCreateInfo</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkFramebuffer</type>* <name>pFramebuffer</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyFramebuffer</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true"><type>VkFramebuffer</type> <name>framebuffer</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateRenderPass</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkRenderPassCreateInfo</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkRenderPass</type>* <name>pRenderPass</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyRenderPass</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true"><type>VkRenderPass</type> <name>renderPass</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetRenderAreaGranularity</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkRenderPass</type> <name>renderPass</name></param>
+            <param><type>VkExtent2D</type>* <name>pGranularity</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateCommandPool</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkCommandPoolCreateInfo</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkCommandPool</type>* <name>pCommandPool</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyCommandPool</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true"><type>VkCommandPool</type> <name>commandPool</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkResetCommandPool</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="true"><type>VkCommandPool</type> <name>commandPool</name></param>
+            <param optional="true"><type>VkCommandPoolResetFlags</type> <name>flags</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkAllocateCommandBuffers</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="pAllocateInfo-&gt;commandPool">const <type>VkCommandBufferAllocateInfo</type>* <name>pAllocateInfo</name></param>
+            <param len="pAllocateInfo-&gt;commandBufferCount"><type>VkCommandBuffer</type>* <name>pCommandBuffers</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkFreeCommandBuffers</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="true"><type>VkCommandPool</type> <name>commandPool</name></param>
+            <param><type>uint32_t</type> <name>commandBufferCount</name></param>
+            <param noautovalidity="true" externsync="true" len="commandBufferCount">const <type>VkCommandBuffer</type>* <name>pCommandBuffers</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkBeginCommandBuffer</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkCommandBufferBeginInfo</type>* <name>pBeginInfo</name></param>
+            <implicitexternsyncparams>
+                <param>the sname:VkCommandPool that pname:commandBuffer was allocated from</param>
+            </implicitexternsyncparams>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkEndCommandBuffer</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <implicitexternsyncparams>
+                <param>the sname:VkCommandPool that pname:commandBuffer was allocated from</param>
+            </implicitexternsyncparams>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkResetCommandBuffer</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param optional="true"><type>VkCommandBufferResetFlags</type> <name>flags</name></param>
+            <implicitexternsyncparams>
+                <param>the sname:VkCommandPool that pname:commandBuffer was allocated from</param>
+            </implicitexternsyncparams>
+        </command>
+        <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdBindPipeline</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkPipelineBindPoint</type> <name>pipelineBindPoint</name></param>
+            <param><type>VkPipeline</type> <name>pipeline</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetViewport</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>firstViewport</name></param>
+            <param><type>uint32_t</type> <name>viewportCount</name></param>
+            <param len="viewportCount">const <type>VkViewport</type>* <name>pViewports</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetScissor</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>firstScissor</name></param>
+            <param><type>uint32_t</type> <name>scissorCount</name></param>
+            <param len="scissorCount">const <type>VkRect2D</type>* <name>pScissors</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetLineWidth</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>float</type> <name>lineWidth</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetDepthBias</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>float</type> <name>depthBiasConstantFactor</name></param>
+            <param><type>float</type> <name>depthBiasClamp</name></param>
+            <param><type>float</type> <name>depthBiasSlopeFactor</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetBlendConstants</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>float</type> <name>blendConstants</name>[4]</param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetDepthBounds</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>float</type> <name>minDepthBounds</name></param>
+            <param><type>float</type> <name>maxDepthBounds</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetStencilCompareMask</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkStencilFaceFlags</type> <name>faceMask</name></param>
+            <param><type>uint32_t</type> <name>compareMask</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetStencilWriteMask</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkStencilFaceFlags</type> <name>faceMask</name></param>
+            <param><type>uint32_t</type> <name>writeMask</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetStencilReference</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkStencilFaceFlags</type> <name>faceMask</name></param>
+            <param><type>uint32_t</type> <name>reference</name></param>
+        </command>
+        <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdBindDescriptorSets</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkPipelineBindPoint</type> <name>pipelineBindPoint</name></param>
+            <param><type>VkPipelineLayout</type> <name>layout</name></param>
+            <param><type>uint32_t</type> <name>firstSet</name></param>
+            <param><type>uint32_t</type> <name>descriptorSetCount</name></param>
+            <param len="descriptorSetCount">const <type>VkDescriptorSet</type>* <name>pDescriptorSets</name></param>
+            <param optional="true"><type>uint32_t</type> <name>dynamicOffsetCount</name></param>
+            <param len="dynamicOffsetCount">const <type>uint32_t</type>* <name>pDynamicOffsets</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdBindIndexBuffer</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkBuffer</type> <name>buffer</name></param>
+            <param><type>VkDeviceSize</type> <name>offset</name></param>
+            <param><type>VkIndexType</type> <name>indexType</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdBindVertexBuffers</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>firstBinding</name></param>
+            <param><type>uint32_t</type> <name>bindingCount</name></param>
+            <param len="bindingCount">const <type>VkBuffer</type>* <name>pBuffers</name></param>
+            <param len="bindingCount">const <type>VkDeviceSize</type>* <name>pOffsets</name></param>
+        </command>
+        <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdDraw</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>vertexCount</name></param>
+            <param><type>uint32_t</type> <name>instanceCount</name></param>
+            <param><type>uint32_t</type> <name>firstVertex</name></param>
+            <param><type>uint32_t</type> <name>firstInstance</name></param>
+        </command>
+        <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdDrawIndexed</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>indexCount</name></param>
+            <param><type>uint32_t</type> <name>instanceCount</name></param>
+            <param><type>uint32_t</type> <name>firstIndex</name></param>
+            <param><type>int32_t</type> <name>vertexOffset</name></param>
+            <param><type>uint32_t</type> <name>firstInstance</name></param>
+        </command>
+        <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdDrawMultiEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param optional="true"><type>uint32_t</type> <name>drawCount</name></param>
+            <param noautovalidity="true" len="drawCount">const <type>VkMultiDrawInfoEXT</type>* <name>pVertexInfo</name></param>
+            <param><type>uint32_t</type> <name>instanceCount</name></param>
+            <param><type>uint32_t</type> <name>firstInstance</name></param>
+            <param><type>uint32_t</type> <name>stride</name></param>
+        </command>
+        <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdDrawMultiIndexedEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param optional="true"><type>uint32_t</type> <name>drawCount</name></param>
+            <param noautovalidity="true" len="drawCount">const <type>VkMultiDrawIndexedInfoEXT</type>* <name>pIndexInfo</name></param>
+            <param><type>uint32_t</type> <name>instanceCount</name></param>
+            <param><type>uint32_t</type> <name>firstInstance</name></param>
+            <param><type>uint32_t</type> <name>stride</name></param>
+            <param optional="true">const <type>int32_t</type>* <name>pVertexOffset</name></param>
+        </command>
+        <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdDrawIndirect</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkBuffer</type> <name>buffer</name></param>
+            <param><type>VkDeviceSize</type> <name>offset</name></param>
+            <param><type>uint32_t</type> <name>drawCount</name></param>
+            <param><type>uint32_t</type> <name>stride</name></param>
+        </command>
+        <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdDrawIndexedIndirect</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkBuffer</type> <name>buffer</name></param>
+            <param><type>VkDeviceSize</type> <name>offset</name></param>
+            <param><type>uint32_t</type> <name>drawCount</name></param>
+            <param><type>uint32_t</type> <name>stride</name></param>
+        </command>
+        <command queues="compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdDispatch</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>groupCountX</name></param>
+            <param><type>uint32_t</type> <name>groupCountY</name></param>
+            <param><type>uint32_t</type> <name>groupCountZ</name></param>
+        </command>
+        <command queues="compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdDispatchIndirect</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkBuffer</type> <name>buffer</name></param>
+            <param><type>VkDeviceSize</type> <name>offset</name></param>
+        </command>
+        <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSubpassShadingHUAWEI</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+        </command>
+        <command queues="transfer,graphics,compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdCopyBuffer</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkBuffer</type> <name>srcBuffer</name></param>
+            <param><type>VkBuffer</type> <name>dstBuffer</name></param>
+            <param><type>uint32_t</type> <name>regionCount</name></param>
+            <param len="regionCount">const <type>VkBufferCopy</type>* <name>pRegions</name></param>
+        </command>
+        <command queues="transfer,graphics,compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdCopyImage</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkImage</type> <name>srcImage</name></param>
+            <param><type>VkImageLayout</type> <name>srcImageLayout</name></param>
+            <param><type>VkImage</type> <name>dstImage</name></param>
+            <param><type>VkImageLayout</type> <name>dstImageLayout</name></param>
+            <param><type>uint32_t</type> <name>regionCount</name></param>
+            <param len="regionCount">const <type>VkImageCopy</type>* <name>pRegions</name></param>
+        </command>
+        <command queues="graphics" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdBlitImage</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkImage</type> <name>srcImage</name></param>
+            <param><type>VkImageLayout</type> <name>srcImageLayout</name></param>
+            <param><type>VkImage</type> <name>dstImage</name></param>
+            <param><type>VkImageLayout</type> <name>dstImageLayout</name></param>
+            <param><type>uint32_t</type> <name>regionCount</name></param>
+            <param len="regionCount">const <type>VkImageBlit</type>* <name>pRegions</name></param>
+            <param><type>VkFilter</type> <name>filter</name></param>
+        </command>
+        <command queues="transfer,graphics,compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdCopyBufferToImage</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkBuffer</type> <name>srcBuffer</name></param>
+            <param><type>VkImage</type> <name>dstImage</name></param>
+            <param><type>VkImageLayout</type> <name>dstImageLayout</name></param>
+            <param><type>uint32_t</type> <name>regionCount</name></param>
+            <param len="regionCount">const <type>VkBufferImageCopy</type>* <name>pRegions</name></param>
+        </command>
+        <command queues="transfer,graphics,compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdCopyImageToBuffer</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkImage</type> <name>srcImage</name></param>
+            <param><type>VkImageLayout</type> <name>srcImageLayout</name></param>
+            <param><type>VkBuffer</type> <name>dstBuffer</name></param>
+            <param><type>uint32_t</type> <name>regionCount</name></param>
+            <param len="regionCount">const <type>VkBufferImageCopy</type>* <name>pRegions</name></param>
+        </command>
+        <command queues="transfer,graphics,compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdUpdateBuffer</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkBuffer</type> <name>dstBuffer</name></param>
+            <param><type>VkDeviceSize</type> <name>dstOffset</name></param>
+            <param><type>VkDeviceSize</type> <name>dataSize</name></param>
+            <param len="dataSize">const <type>void</type>* <name>pData</name></param>
+        </command>
+        <command queues="transfer,graphics,compute" renderpass="outside" cmdbufferlevel="primary,secondary" comment="transfer support is only available when VK_KHR_maintenance1 is enabled, as documented in valid usage language in the specification">
+            <proto><type>void</type> <name>vkCmdFillBuffer</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkBuffer</type> <name>dstBuffer</name></param>
+            <param><type>VkDeviceSize</type> <name>dstOffset</name></param>
+            <param><type>VkDeviceSize</type> <name>size</name></param>
+            <param><type>uint32_t</type> <name>data</name></param>
+        </command>
+        <command queues="graphics,compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdClearColorImage</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkImage</type> <name>image</name></param>
+            <param><type>VkImageLayout</type> <name>imageLayout</name></param>
+            <param>const <type>VkClearColorValue</type>* <name>pColor</name></param>
+            <param><type>uint32_t</type> <name>rangeCount</name></param>
+            <param len="rangeCount">const <type>VkImageSubresourceRange</type>* <name>pRanges</name></param>
+        </command>
+        <command queues="graphics" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdClearDepthStencilImage</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkImage</type> <name>image</name></param>
+            <param><type>VkImageLayout</type> <name>imageLayout</name></param>
+            <param>const <type>VkClearDepthStencilValue</type>* <name>pDepthStencil</name></param>
+            <param><type>uint32_t</type> <name>rangeCount</name></param>
+            <param len="rangeCount">const <type>VkImageSubresourceRange</type>* <name>pRanges</name></param>
+        </command>
+        <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdClearAttachments</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>attachmentCount</name></param>
+            <param len="attachmentCount">const <type>VkClearAttachment</type>* <name>pAttachments</name></param>
+            <param><type>uint32_t</type> <name>rectCount</name></param>
+            <param len="rectCount">const <type>VkClearRect</type>* <name>pRects</name></param>
+        </command>
+        <command queues="graphics" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdResolveImage</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkImage</type> <name>srcImage</name></param>
+            <param><type>VkImageLayout</type> <name>srcImageLayout</name></param>
+            <param><type>VkImage</type> <name>dstImage</name></param>
+            <param><type>VkImageLayout</type> <name>dstImageLayout</name></param>
+            <param><type>uint32_t</type> <name>regionCount</name></param>
+            <param len="regionCount">const <type>VkImageResolve</type>* <name>pRegions</name></param>
+        </command>
+        <command queues="graphics,compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetEvent</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkEvent</type> <name>event</name></param>
+            <param optional="true"><type>VkPipelineStageFlags</type> <name>stageMask</name></param>
+        </command>
+        <command queues="graphics,compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdResetEvent</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkEvent</type> <name>event</name></param>
+            <param optional="true"><type>VkPipelineStageFlags</type> <name>stageMask</name></param>
+        </command>
+        <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdWaitEvents</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>eventCount</name></param>
+            <param len="eventCount">const <type>VkEvent</type>* <name>pEvents</name></param>
+            <param optional="true"><type>VkPipelineStageFlags</type> <name>srcStageMask</name></param>
+            <param optional="true"><type>VkPipelineStageFlags</type> <name>dstStageMask</name></param>
+            <param optional="true"><type>uint32_t</type> <name>memoryBarrierCount</name></param>
+            <param len="memoryBarrierCount">const <type>VkMemoryBarrier</type>* <name>pMemoryBarriers</name></param>
+            <param optional="true"><type>uint32_t</type> <name>bufferMemoryBarrierCount</name></param>
+            <param len="bufferMemoryBarrierCount">const <type>VkBufferMemoryBarrier</type>* <name>pBufferMemoryBarriers</name></param>
+            <param optional="true"><type>uint32_t</type> <name>imageMemoryBarrierCount</name></param>
+            <param len="imageMemoryBarrierCount">const <type>VkImageMemoryBarrier</type>* <name>pImageMemoryBarriers</name></param>
+        </command>
+        <command queues="transfer,graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdPipelineBarrier</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param optional="true"><type>VkPipelineStageFlags</type> <name>srcStageMask</name></param>
+            <param optional="true"><type>VkPipelineStageFlags</type> <name>dstStageMask</name></param>
+            <param optional="true"><type>VkDependencyFlags</type> <name>dependencyFlags</name></param>
+            <param optional="true"><type>uint32_t</type> <name>memoryBarrierCount</name></param>
+            <param len="memoryBarrierCount">const <type>VkMemoryBarrier</type>* <name>pMemoryBarriers</name></param>
+            <param optional="true"><type>uint32_t</type> <name>bufferMemoryBarrierCount</name></param>
+            <param len="bufferMemoryBarrierCount">const <type>VkBufferMemoryBarrier</type>* <name>pBufferMemoryBarriers</name></param>
+            <param optional="true"><type>uint32_t</type> <name>imageMemoryBarrierCount</name></param>
+            <param len="imageMemoryBarrierCount">const <type>VkImageMemoryBarrier</type>* <name>pImageMemoryBarriers</name></param>
+        </command>
+        <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdBeginQuery</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkQueryPool</type> <name>queryPool</name></param>
+            <param><type>uint32_t</type> <name>query</name></param>
+            <param optional="true"><type>VkQueryControlFlags</type> <name>flags</name></param>
+        </command>
+        <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdEndQuery</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkQueryPool</type> <name>queryPool</name></param>
+            <param><type>uint32_t</type> <name>query</name></param>
+        </command>
+        <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdBeginConditionalRenderingEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkConditionalRenderingBeginInfoEXT</type>* <name>pConditionalRenderingBegin</name></param>
+        </command>
+        <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdEndConditionalRenderingEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+        </command>
+        <command queues="graphics,compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdResetQueryPool</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkQueryPool</type> <name>queryPool</name></param>
+            <param><type>uint32_t</type> <name>firstQuery</name></param>
+            <param><type>uint32_t</type> <name>queryCount</name></param>
+        </command>
+        <command queues="transfer,graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdWriteTimestamp</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkPipelineStageFlagBits</type> <name>pipelineStage</name></param>
+            <param><type>VkQueryPool</type> <name>queryPool</name></param>
+            <param><type>uint32_t</type> <name>query</name></param>
+        </command>
+        <command queues="graphics,compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdCopyQueryPoolResults</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkQueryPool</type> <name>queryPool</name></param>
+            <param><type>uint32_t</type> <name>firstQuery</name></param>
+            <param><type>uint32_t</type> <name>queryCount</name></param>
+            <param><type>VkBuffer</type> <name>dstBuffer</name></param>
+            <param><type>VkDeviceSize</type> <name>dstOffset</name></param>
+            <param><type>VkDeviceSize</type> <name>stride</name></param>
+            <param optional="true"><type>VkQueryResultFlags</type> <name>flags</name></param>
+        </command>
+        <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdPushConstants</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkPipelineLayout</type> <name>layout</name></param>
+            <param><type>VkShaderStageFlags</type> <name>stageFlags</name></param>
+            <param><type>uint32_t</type> <name>offset</name></param>
+            <param><type>uint32_t</type> <name>size</name></param>
+            <param len="size">const <type>void</type>* <name>pValues</name></param>
+        </command>
+        <command queues="graphics" renderpass="outside" cmdbufferlevel="primary">
+            <proto><type>void</type> <name>vkCmdBeginRenderPass</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkRenderPassBeginInfo</type>* <name>pRenderPassBegin</name></param>
+            <param><type>VkSubpassContents</type> <name>contents</name></param>
+        </command>
+        <command queues="graphics" renderpass="inside" cmdbufferlevel="primary">
+            <proto><type>void</type> <name>vkCmdNextSubpass</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkSubpassContents</type> <name>contents</name></param>
+        </command>
+        <command queues="graphics" renderpass="inside" cmdbufferlevel="primary">
+            <proto><type>void</type> <name>vkCmdEndRenderPass</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+        </command>
+        <command queues="transfer,graphics,compute" renderpass="both" cmdbufferlevel="primary">
+            <proto><type>void</type> <name>vkCmdExecuteCommands</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>commandBufferCount</name></param>
+            <param len="commandBufferCount">const <type>VkCommandBuffer</type>* <name>pCommandBuffers</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_NATIVE_WINDOW_IN_USE_KHR">
+            <proto><type>VkResult</type> <name>vkCreateAndroidSurfaceKHR</name></proto>
+            <param><type>VkInstance</type> <name>instance</name></param>
+            <param>const <type>VkAndroidSurfaceCreateInfoKHR</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkSurfaceKHR</type>* <name>pSurface</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetPhysicalDeviceDisplayPropertiesKHR</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pPropertyCount</name></param>
+            <param optional="true" len="pPropertyCount"><type>VkDisplayPropertiesKHR</type>* <name>pProperties</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetPhysicalDeviceDisplayPlanePropertiesKHR</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pPropertyCount</name></param>
+            <param optional="true" len="pPropertyCount"><type>VkDisplayPlanePropertiesKHR</type>* <name>pProperties</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetDisplayPlaneSupportedDisplaysKHR</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>uint32_t</type> <name>planeIndex</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pDisplayCount</name></param>
+            <param optional="true" len="pDisplayCount"><type>VkDisplayKHR</type>* <name>pDisplays</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetDisplayModePropertiesKHR</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>VkDisplayKHR</type> <name>display</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pPropertyCount</name></param>
+            <param optional="true" len="pPropertyCount"><type>VkDisplayModePropertiesKHR</type>* <name>pProperties</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INITIALIZATION_FAILED">
+            <proto><type>VkResult</type> <name>vkCreateDisplayModeKHR</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param externsync="true"><type>VkDisplayKHR</type> <name>display</name></param>
+            <param>const <type>VkDisplayModeCreateInfoKHR</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkDisplayModeKHR</type>* <name>pMode</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetDisplayPlaneCapabilitiesKHR</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param externsync="true"><type>VkDisplayModeKHR</type> <name>mode</name></param>
+            <param><type>uint32_t</type> <name>planeIndex</name></param>
+            <param><type>VkDisplayPlaneCapabilitiesKHR</type>* <name>pCapabilities</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateDisplayPlaneSurfaceKHR</name></proto>
+            <param><type>VkInstance</type> <name>instance</name></param>
+            <param>const <type>VkDisplaySurfaceCreateInfoKHR</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkSurfaceKHR</type>* <name>pSurface</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INCOMPATIBLE_DISPLAY_KHR,VK_ERROR_DEVICE_LOST,VK_ERROR_SURFACE_LOST_KHR">
+            <proto><type>VkResult</type> <name>vkCreateSharedSwapchainsKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>uint32_t</type> <name>swapchainCount</name></param>
+            <param len="swapchainCount" externsync="pCreateInfos[].surface,pCreateInfos[].oldSwapchain">const <type>VkSwapchainCreateInfoKHR</type>* <name>pCreateInfos</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param len="swapchainCount"><type>VkSwapchainKHR</type>* <name>pSwapchains</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroySurfaceKHR</name></proto>
+            <param><type>VkInstance</type> <name>instance</name></param>
+            <param optional="true" externsync="true"><type>VkSurfaceKHR</type> <name>surface</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_SURFACE_LOST_KHR">
+            <proto><type>VkResult</type> <name>vkGetPhysicalDeviceSurfaceSupportKHR</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>uint32_t</type> <name>queueFamilyIndex</name></param>
+            <param><type>VkSurfaceKHR</type> <name>surface</name></param>
+            <param><type>VkBool32</type>* <name>pSupported</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_SURFACE_LOST_KHR">
+            <proto><type>VkResult</type> <name>vkGetPhysicalDeviceSurfaceCapabilitiesKHR</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>VkSurfaceKHR</type> <name>surface</name></param>
+            <param><type>VkSurfaceCapabilitiesKHR</type>* <name>pSurfaceCapabilities</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_SURFACE_LOST_KHR">
+            <proto><type>VkResult</type> <name>vkGetPhysicalDeviceSurfaceFormatsKHR</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>VkSurfaceKHR</type> <name>surface</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pSurfaceFormatCount</name></param>
+            <param optional="true" len="pSurfaceFormatCount"><type>VkSurfaceFormatKHR</type>* <name>pSurfaceFormats</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_SURFACE_LOST_KHR">
+            <proto><type>VkResult</type> <name>vkGetPhysicalDeviceSurfacePresentModesKHR</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>VkSurfaceKHR</type> <name>surface</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pPresentModeCount</name></param>
+            <param optional="true" len="pPresentModeCount"><type>VkPresentModeKHR</type>* <name>pPresentModes</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST,VK_ERROR_SURFACE_LOST_KHR,VK_ERROR_NATIVE_WINDOW_IN_USE_KHR,VK_ERROR_INITIALIZATION_FAILED">
+            <proto><type>VkResult</type> <name>vkCreateSwapchainKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="pCreateInfo-&gt;surface,pCreateInfo-&gt;oldSwapchain">const <type>VkSwapchainCreateInfoKHR</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkSwapchainKHR</type>* <name>pSwapchain</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroySwapchainKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true"><type>VkSwapchainKHR</type> <name>swapchain</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetSwapchainImagesKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkSwapchainKHR</type> <name>swapchain</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pSwapchainImageCount</name></param>
+            <param optional="true" len="pSwapchainImageCount"><type>VkImage</type>* <name>pSwapchainImages</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_TIMEOUT,VK_NOT_READY,VK_SUBOPTIMAL_KHR" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST,VK_ERROR_OUT_OF_DATE_KHR,VK_ERROR_SURFACE_LOST_KHR,VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT">
+            <proto><type>VkResult</type> <name>vkAcquireNextImageKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="true"><type>VkSwapchainKHR</type> <name>swapchain</name></param>
+            <param><type>uint64_t</type> <name>timeout</name></param>
+            <param optional="true" externsync="true"><type>VkSemaphore</type> <name>semaphore</name></param>
+            <param optional="true" externsync="true"><type>VkFence</type> <name>fence</name></param>
+            <param><type>uint32_t</type>* <name>pImageIndex</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_SUBOPTIMAL_KHR" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST,VK_ERROR_OUT_OF_DATE_KHR,VK_ERROR_SURFACE_LOST_KHR,VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT">
+            <proto><type>VkResult</type> <name>vkQueuePresentKHR</name></proto>
+            <param externsync="true"><type>VkQueue</type> <name>queue</name></param>
+            <param externsync="pPresentInfo-&gt;pWaitSemaphores[],pPresentInfo-&gt;pSwapchains[]">const <type>VkPresentInfoKHR</type>* <name>pPresentInfo</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_NATIVE_WINDOW_IN_USE_KHR">
+            <proto><type>VkResult</type> <name>vkCreateViSurfaceNN</name></proto>
+            <param><type>VkInstance</type> <name>instance</name></param>
+            <param>const <type>VkViSurfaceCreateInfoNN</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkSurfaceKHR</type>* <name>pSurface</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateWaylandSurfaceKHR</name></proto>
+            <param><type>VkInstance</type> <name>instance</name></param>
+            <param>const <type>VkWaylandSurfaceCreateInfoKHR</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkSurfaceKHR</type>* <name>pSurface</name></param>
+        </command>
+        <command>
+            <proto><type>VkBool32</type> <name>vkGetPhysicalDeviceWaylandPresentationSupportKHR</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>uint32_t</type> <name>queueFamilyIndex</name></param>
+            <param>struct <type>wl_display</type>* <name>display</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateWin32SurfaceKHR</name></proto>
+            <param><type>VkInstance</type> <name>instance</name></param>
+            <param>const <type>VkWin32SurfaceCreateInfoKHR</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkSurfaceKHR</type>* <name>pSurface</name></param>
+        </command>
+        <command>
+            <proto><type>VkBool32</type> <name>vkGetPhysicalDeviceWin32PresentationSupportKHR</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>uint32_t</type> <name>queueFamilyIndex</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateXlibSurfaceKHR</name></proto>
+            <param><type>VkInstance</type> <name>instance</name></param>
+            <param>const <type>VkXlibSurfaceCreateInfoKHR</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkSurfaceKHR</type>* <name>pSurface</name></param>
+        </command>
+        <command>
+            <proto><type>VkBool32</type> <name>vkGetPhysicalDeviceXlibPresentationSupportKHR</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>uint32_t</type> <name>queueFamilyIndex</name></param>
+            <param><type>Display</type>* <name>dpy</name></param>
+            <param><type>VisualID</type> <name>visualID</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateXcbSurfaceKHR</name></proto>
+            <param><type>VkInstance</type> <name>instance</name></param>
+            <param>const <type>VkXcbSurfaceCreateInfoKHR</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkSurfaceKHR</type>* <name>pSurface</name></param>
+        </command>
+        <command>
+            <proto><type>VkBool32</type> <name>vkGetPhysicalDeviceXcbPresentationSupportKHR</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>uint32_t</type> <name>queueFamilyIndex</name></param>
+            <param><type>xcb_connection_t</type>* <name>connection</name></param>
+            <param><type>xcb_visualid_t</type> <name>visual_id</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateDirectFBSurfaceEXT</name></proto>
+            <param><type>VkInstance</type> <name>instance</name></param>
+            <param>const <type>VkDirectFBSurfaceCreateInfoEXT</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkSurfaceKHR</type>* <name>pSurface</name></param>
+        </command>
+        <command>
+            <proto><type>VkBool32</type> <name>vkGetPhysicalDeviceDirectFBPresentationSupportEXT</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>uint32_t</type> <name>queueFamilyIndex</name></param>
+            <param><type>IDirectFB</type>* <name>dfb</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateImagePipeSurfaceFUCHSIA</name></proto>
+            <param><type>VkInstance</type> <name>instance</name></param>
+            <param>const <type>VkImagePipeSurfaceCreateInfoFUCHSIA</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkSurfaceKHR</type>* <name>pSurface</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_NATIVE_WINDOW_IN_USE_KHR">
+            <proto><type>VkResult</type> <name>vkCreateStreamDescriptorSurfaceGGP</name></proto>
+            <param><type>VkInstance</type> <name>instance</name></param>
+            <param>const <type>VkStreamDescriptorSurfaceCreateInfoGGP</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkSurfaceKHR</type>* <name>pSurface</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateScreenSurfaceQNX</name></proto>
+            <param><type>VkInstance</type> <name>instance</name></param>
+            <param>const <type>VkScreenSurfaceCreateInfoQNX</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkSurfaceKHR</type>* <name>pSurface</name></param>
+        </command>
+        <command>
+            <proto><type>VkBool32</type> <name>vkGetPhysicalDeviceScreenPresentationSupportQNX</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>uint32_t</type> <name>queueFamilyIndex</name></param>
+            <param>struct <type>_screen_window</type>* <name>window</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateDebugReportCallbackEXT</name></proto>
+            <param><type>VkInstance</type> <name>instance</name></param>
+            <param>const <type>VkDebugReportCallbackCreateInfoEXT</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkDebugReportCallbackEXT</type>* <name>pCallback</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyDebugReportCallbackEXT</name></proto>
+            <param><type>VkInstance</type> <name>instance</name></param>
+            <param optional="true" externsync="true"><type>VkDebugReportCallbackEXT</type> <name>callback</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDebugReportMessageEXT</name></proto>
+            <param><type>VkInstance</type> <name>instance</name></param>
+            <param><type>VkDebugReportFlagsEXT</type> <name>flags</name></param>
+            <param><type>VkDebugReportObjectTypeEXT</type> <name>objectType</name></param>
+            <param objecttype="objectType"><type>uint64_t</type> <name>object</name></param>
+            <param><type>size_t</type> <name>location</name></param>
+            <param><type>int32_t</type> <name>messageCode</name></param>
+            <param len="null-terminated">const <type>char</type>* <name>pLayerPrefix</name></param>
+            <param len="null-terminated">const <type>char</type>* <name>pMessage</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkDebugMarkerSetObjectNameEXT</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="pNameInfo-&gt;object">const <type>VkDebugMarkerObjectNameInfoEXT</type>* <name>pNameInfo</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkDebugMarkerSetObjectTagEXT</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="pTagInfo-&gt;object">const <type>VkDebugMarkerObjectTagInfoEXT</type>* <name>pTagInfo</name></param>
+        </command>
+        <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdDebugMarkerBeginEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkDebugMarkerMarkerInfoEXT</type>* <name>pMarkerInfo</name></param>
+        </command>
+        <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdDebugMarkerEndEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+        </command>
+        <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdDebugMarkerInsertEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkDebugMarkerMarkerInfoEXT</type>* <name>pMarkerInfo</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_FORMAT_NOT_SUPPORTED">
+            <proto><type>VkResult</type> <name>vkGetPhysicalDeviceExternalImageFormatPropertiesNV</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>VkFormat</type> <name>format</name></param>
+            <param><type>VkImageType</type> <name>type</name></param>
+            <param><type>VkImageTiling</type> <name>tiling</name></param>
+            <param><type>VkImageUsageFlags</type> <name>usage</name></param>
+            <param optional="true"><type>VkImageCreateFlags</type> <name>flags</name></param>
+            <param optional="true"><type>VkExternalMemoryHandleTypeFlagsNV</type> <name>externalHandleType</name></param>
+            <param><type>VkExternalImageFormatPropertiesNV</type>* <name>pExternalImageFormatProperties</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_TOO_MANY_OBJECTS,VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetMemoryWin32HandleNV</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param devicememoryhandle="1"><type>VkDeviceMemory</type> <name>memory</name></param>
+            <param><type>VkExternalMemoryHandleTypeFlagsNV</type> <name>handleType</name></param>
+            <param><type>HANDLE</type>* <name>pHandle</name></param>
+        </command>
+        <command queues="graphics,compute" renderpass="inside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdExecuteGeneratedCommandsNV</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkBool32</type> <name>isPreprocessed</name></param>
+            <param>const <type>VkGeneratedCommandsInfoNV</type>* <name>pGeneratedCommandsInfo</name></param>
+        </command>
+        <command queues="graphics,compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdPreprocessGeneratedCommandsNV</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkGeneratedCommandsInfoNV</type>* <name>pGeneratedCommandsInfo</name></param>
+        </command>
+        <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdBindPipelineShaderGroupNV</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkPipelineBindPoint</type> <name>pipelineBindPoint</name></param>
+            <param><type>VkPipeline</type> <name>pipeline</name></param>
+            <param><type>uint32_t</type> <name>groupIndex</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetGeneratedCommandsMemoryRequirementsNV</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkGeneratedCommandsMemoryRequirementsInfoNV</type>* <name>pInfo</name></param>
+            <param><type>VkMemoryRequirements2</type>* <name>pMemoryRequirements</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateIndirectCommandsLayoutNV</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkIndirectCommandsLayoutCreateInfoNV</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkIndirectCommandsLayoutNV</type>* <name>pIndirectCommandsLayout</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyIndirectCommandsLayoutNV</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true"><type>VkIndirectCommandsLayoutNV</type> <name>indirectCommandsLayout</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetPhysicalDeviceFeatures2</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>VkPhysicalDeviceFeatures2</type>* <name>pFeatures</name></param>
+        </command>
+        <command name="vkGetPhysicalDeviceFeatures2KHR"                        alias="vkGetPhysicalDeviceFeatures2"/>
+        <command>
+            <proto><type>void</type> <name>vkGetPhysicalDeviceProperties2</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>VkPhysicalDeviceProperties2</type>* <name>pProperties</name></param>
+        </command>
+        <command name="vkGetPhysicalDeviceProperties2KHR"                      alias="vkGetPhysicalDeviceProperties2"/>
+        <command>
+            <proto><type>void</type> <name>vkGetPhysicalDeviceFormatProperties2</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>VkFormat</type> <name>format</name></param>
+            <param><type>VkFormatProperties2</type>* <name>pFormatProperties</name></param>
+        </command>
+        <command name="vkGetPhysicalDeviceFormatProperties2KHR"                alias="vkGetPhysicalDeviceFormatProperties2"/>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_FORMAT_NOT_SUPPORTED">
+            <proto><type>VkResult</type> <name>vkGetPhysicalDeviceImageFormatProperties2</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param>const <type>VkPhysicalDeviceImageFormatInfo2</type>* <name>pImageFormatInfo</name></param>
+            <param><type>VkImageFormatProperties2</type>* <name>pImageFormatProperties</name></param>
+        </command>
+        <command name="vkGetPhysicalDeviceImageFormatProperties2KHR"           alias="vkGetPhysicalDeviceImageFormatProperties2"/>
+        <command>
+            <proto><type>void</type> <name>vkGetPhysicalDeviceQueueFamilyProperties2</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pQueueFamilyPropertyCount</name></param>
+            <param optional="true" len="pQueueFamilyPropertyCount"><type>VkQueueFamilyProperties2</type>* <name>pQueueFamilyProperties</name></param>
+        </command>
+        <command name="vkGetPhysicalDeviceQueueFamilyProperties2KHR"           alias="vkGetPhysicalDeviceQueueFamilyProperties2"/>
+        <command>
+            <proto><type>void</type> <name>vkGetPhysicalDeviceMemoryProperties2</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>VkPhysicalDeviceMemoryProperties2</type>* <name>pMemoryProperties</name></param>
+        </command>
+        <command name="vkGetPhysicalDeviceMemoryProperties2KHR"                alias="vkGetPhysicalDeviceMemoryProperties2"/>
+        <command>
+            <proto><type>void</type> <name>vkGetPhysicalDeviceSparseImageFormatProperties2</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param>const <type>VkPhysicalDeviceSparseImageFormatInfo2</type>* <name>pFormatInfo</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pPropertyCount</name></param>
+            <param optional="true" len="pPropertyCount"><type>VkSparseImageFormatProperties2</type>* <name>pProperties</name></param>
+        </command>
+        <command name="vkGetPhysicalDeviceSparseImageFormatProperties2KHR"     alias="vkGetPhysicalDeviceSparseImageFormatProperties2"/>
+        <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdPushDescriptorSetKHR</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkPipelineBindPoint</type> <name>pipelineBindPoint</name></param>
+            <param><type>VkPipelineLayout</type> <name>layout</name></param>
+            <param><type>uint32_t</type> <name>set</name></param>
+            <param><type>uint32_t</type> <name>descriptorWriteCount</name></param>
+            <param len="descriptorWriteCount">const <type>VkWriteDescriptorSet</type>* <name>pDescriptorWrites</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkTrimCommandPool</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="true"><type>VkCommandPool</type> <name>commandPool</name></param>
+            <param optional="true"><type>VkCommandPoolTrimFlags</type> <name>flags</name></param>
+        </command>
+        <command name="vkTrimCommandPoolKHR"                                   alias="vkTrimCommandPool"/>
+        <command>
+            <proto><type>void</type> <name>vkGetPhysicalDeviceExternalBufferProperties</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param>const <type>VkPhysicalDeviceExternalBufferInfo</type>* <name>pExternalBufferInfo</name></param>
+            <param><type>VkExternalBufferProperties</type>* <name>pExternalBufferProperties</name></param>
+        </command>
+        <command name="vkGetPhysicalDeviceExternalBufferPropertiesKHR"         alias="vkGetPhysicalDeviceExternalBufferProperties"/>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_TOO_MANY_OBJECTS,VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetMemoryWin32HandleKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkMemoryGetWin32HandleInfoKHR</type>* <name>pGetWin32HandleInfo</name></param>
+            <param><type>HANDLE</type>* <name>pHandle</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_INVALID_EXTERNAL_HANDLE">
+            <proto><type>VkResult</type> <name>vkGetMemoryWin32HandlePropertiesKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkExternalMemoryHandleTypeFlagBits</type> <name>handleType</name></param>
+            <param><type>HANDLE</type> <name>handle</name></param>
+            <param><type>VkMemoryWin32HandlePropertiesKHR</type>* <name>pMemoryWin32HandleProperties</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_TOO_MANY_OBJECTS,VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetMemoryFdKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkMemoryGetFdInfoKHR</type>* <name>pGetFdInfo</name></param>
+            <param><type>int</type>* <name>pFd</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_INVALID_EXTERNAL_HANDLE">
+            <proto><type>VkResult</type> <name>vkGetMemoryFdPropertiesKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkExternalMemoryHandleTypeFlagBits</type> <name>handleType</name></param>
+            <param><type>int</type> <name>fd</name></param>
+            <param><type>VkMemoryFdPropertiesKHR</type>* <name>pMemoryFdProperties</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_TOO_MANY_OBJECTS,VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetMemoryZirconHandleFUCHSIA</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkMemoryGetZirconHandleInfoFUCHSIA</type>* <name>pGetZirconHandleInfo</name></param>
+            <param><type>zx_handle_t</type>* <name>pZirconHandle</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_INVALID_EXTERNAL_HANDLE">
+            <proto><type>VkResult</type> <name>vkGetMemoryZirconHandlePropertiesFUCHSIA</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkExternalMemoryHandleTypeFlagBits</type> <name>handleType</name></param>
+            <param><type>zx_handle_t</type> <name>zirconHandle</name></param>
+            <param><type>VkMemoryZirconHandlePropertiesFUCHSIA</type>* <name>pMemoryZirconHandleProperties</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_INVALID_EXTERNAL_HANDLE">
+            <proto><type>VkResult</type> <name>vkGetMemoryRemoteAddressNV</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkMemoryGetRemoteAddressInfoNV</type>* <name>pMemoryGetRemoteAddressInfo</name></param>
+            <param><type>VkRemoteAddressNV</type>* <name>pAddress</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetPhysicalDeviceExternalSemaphoreProperties</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param>const <type>VkPhysicalDeviceExternalSemaphoreInfo</type>* <name>pExternalSemaphoreInfo</name></param>
+            <param><type>VkExternalSemaphoreProperties</type>* <name>pExternalSemaphoreProperties</name></param>
+        </command>
+        <command name="vkGetPhysicalDeviceExternalSemaphorePropertiesKHR"      alias="vkGetPhysicalDeviceExternalSemaphoreProperties"/>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_TOO_MANY_OBJECTS,VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetSemaphoreWin32HandleKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkSemaphoreGetWin32HandleInfoKHR</type>* <name>pGetWin32HandleInfo</name></param>
+            <param><type>HANDLE</type>* <name>pHandle</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_INVALID_EXTERNAL_HANDLE">
+            <proto><type>VkResult</type> <name>vkImportSemaphoreWin32HandleKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkImportSemaphoreWin32HandleInfoKHR</type>* <name>pImportSemaphoreWin32HandleInfo</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_TOO_MANY_OBJECTS,VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetSemaphoreFdKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkSemaphoreGetFdInfoKHR</type>* <name>pGetFdInfo</name></param>
+            <param><type>int</type>* <name>pFd</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_INVALID_EXTERNAL_HANDLE">
+            <proto><type>VkResult</type> <name>vkImportSemaphoreFdKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkImportSemaphoreFdInfoKHR</type>* <name>pImportSemaphoreFdInfo</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_TOO_MANY_OBJECTS,VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetSemaphoreZirconHandleFUCHSIA</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkSemaphoreGetZirconHandleInfoFUCHSIA</type>* <name>pGetZirconHandleInfo</name></param>
+            <param><type>zx_handle_t</type>* <name>pZirconHandle</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_INVALID_EXTERNAL_HANDLE">
+            <proto><type>VkResult</type> <name>vkImportSemaphoreZirconHandleFUCHSIA</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkImportSemaphoreZirconHandleInfoFUCHSIA</type>* <name>pImportSemaphoreZirconHandleInfo</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetPhysicalDeviceExternalFenceProperties</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param>const <type>VkPhysicalDeviceExternalFenceInfo</type>* <name>pExternalFenceInfo</name></param>
+            <param><type>VkExternalFenceProperties</type>* <name>pExternalFenceProperties</name></param>
+        </command>
+        <command name="vkGetPhysicalDeviceExternalFencePropertiesKHR"          alias="vkGetPhysicalDeviceExternalFenceProperties"/>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_TOO_MANY_OBJECTS,VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetFenceWin32HandleKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkFenceGetWin32HandleInfoKHR</type>* <name>pGetWin32HandleInfo</name></param>
+            <param><type>HANDLE</type>* <name>pHandle</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_INVALID_EXTERNAL_HANDLE">
+            <proto><type>VkResult</type> <name>vkImportFenceWin32HandleKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkImportFenceWin32HandleInfoKHR</type>* <name>pImportFenceWin32HandleInfo</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_TOO_MANY_OBJECTS,VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetFenceFdKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkFenceGetFdInfoKHR</type>* <name>pGetFdInfo</name></param>
+            <param><type>int</type>* <name>pFd</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_INVALID_EXTERNAL_HANDLE">
+            <proto><type>VkResult</type> <name>vkImportFenceFdKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkImportFenceFdInfoKHR</type>* <name>pImportFenceFdInfo</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS">
+            <proto><type>VkResult</type> <name>vkReleaseDisplayEXT</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>VkDisplayKHR</type> <name>display</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_INITIALIZATION_FAILED">
+            <proto><type>VkResult</type> <name>vkAcquireXlibDisplayEXT</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>Display</type>* <name>dpy</name></param>
+            <param><type>VkDisplayKHR</type> <name>display</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetRandROutputDisplayEXT</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>Display</type>* <name>dpy</name></param>
+            <param><type>RROutput</type> <name>rrOutput</name></param>
+            <param><type>VkDisplayKHR</type>* <name>pDisplay</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_DEVICE_LOST,VK_ERROR_INITIALIZATION_FAILED">
+            <proto><type>VkResult</type> <name>vkAcquireWinrtDisplayNV</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>VkDisplayKHR</type> <name>display</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_DEVICE_LOST,VK_ERROR_INITIALIZATION_FAILED">
+            <proto><type>VkResult</type> <name>vkGetWinrtDisplayNV</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>uint32_t</type> <name>deviceRelativeId</name></param>
+            <param><type>VkDisplayKHR</type>* <name>pDisplay</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkDisplayPowerControlEXT</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkDisplayKHR</type> <name>display</name></param>
+            <param>const <type>VkDisplayPowerInfoEXT</type>* <name>pDisplayPowerInfo</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkRegisterDeviceEventEXT</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkDeviceEventInfoEXT</type>* <name>pDeviceEventInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkFence</type>* <name>pFence</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkRegisterDisplayEventEXT</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkDisplayKHR</type> <name>display</name></param>
+            <param>const <type>VkDisplayEventInfoEXT</type>* <name>pDisplayEventInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkFence</type>* <name>pFence</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_DEVICE_LOST,VK_ERROR_OUT_OF_DATE_KHR">
+            <proto><type>VkResult</type> <name>vkGetSwapchainCounterEXT</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkSwapchainKHR</type> <name>swapchain</name></param>
+            <param><type>VkSurfaceCounterFlagBitsEXT</type> <name>counter</name></param>
+            <param><type>uint64_t</type>* <name>pCounterValue</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_SURFACE_LOST_KHR">
+            <proto><type>VkResult</type> <name>vkGetPhysicalDeviceSurfaceCapabilities2EXT</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>VkSurfaceKHR</type> <name>surface</name></param>
+            <param><type>VkSurfaceCapabilities2EXT</type>* <name>pSurfaceCapabilities</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INITIALIZATION_FAILED">
+            <proto><type>VkResult</type> <name>vkEnumeratePhysicalDeviceGroups</name></proto>
+            <param><type>VkInstance</type> <name>instance</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pPhysicalDeviceGroupCount</name></param>
+            <param optional="true" len="pPhysicalDeviceGroupCount"><type>VkPhysicalDeviceGroupProperties</type>* <name>pPhysicalDeviceGroupProperties</name></param>
+        </command>
+        <command name="vkEnumeratePhysicalDeviceGroupsKHR"                     alias="vkEnumeratePhysicalDeviceGroups"/>
+        <command>
+            <proto><type>void</type> <name>vkGetDeviceGroupPeerMemoryFeatures</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>uint32_t</type> <name>heapIndex</name></param>
+            <param><type>uint32_t</type> <name>localDeviceIndex</name></param>
+            <param><type>uint32_t</type> <name>remoteDeviceIndex</name></param>
+            <param><type>VkPeerMemoryFeatureFlags</type>* <name>pPeerMemoryFeatures</name></param>
+        </command>
+        <command name="vkGetDeviceGroupPeerMemoryFeaturesKHR"                  alias="vkGetDeviceGroupPeerMemoryFeatures"/>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR">
+            <proto><type>VkResult</type> <name>vkBindBufferMemory2</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>uint32_t</type> <name>bindInfoCount</name></param>
+            <param len="bindInfoCount">const <type>VkBindBufferMemoryInfo</type>* <name>pBindInfos</name></param>
+        </command>
+        <command name="vkBindBufferMemory2KHR"                                 alias="vkBindBufferMemory2"/>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkBindImageMemory2</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>uint32_t</type> <name>bindInfoCount</name></param>
+            <param len="bindInfoCount">const <type>VkBindImageMemoryInfo</type>* <name>pBindInfos</name></param>
+        </command>
+        <command name="vkBindImageMemory2KHR"                                  alias="vkBindImageMemory2"/>
+        <command queues="graphics,compute,transfer" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetDeviceMask</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>deviceMask</name></param>
+        </command>
+        <command name="vkCmdSetDeviceMaskKHR"                                  alias="vkCmdSetDeviceMask"/>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetDeviceGroupPresentCapabilitiesKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkDeviceGroupPresentCapabilitiesKHR</type>* <name>pDeviceGroupPresentCapabilities</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_SURFACE_LOST_KHR">
+            <proto><type>VkResult</type> <name>vkGetDeviceGroupSurfacePresentModesKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="true"><type>VkSurfaceKHR</type> <name>surface</name></param>
+            <param optional="false,true"><type>VkDeviceGroupPresentModeFlagsKHR</type>* <name>pModes</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_TIMEOUT,VK_NOT_READY,VK_SUBOPTIMAL_KHR" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST,VK_ERROR_OUT_OF_DATE_KHR,VK_ERROR_SURFACE_LOST_KHR,VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT">
+            <proto><type>VkResult</type> <name>vkAcquireNextImage2KHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkAcquireNextImageInfoKHR</type>* <name>pAcquireInfo</name></param>
+            <param><type>uint32_t</type>* <name>pImageIndex</name></param>
+        </command>
+        <command queues="compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdDispatchBase</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>baseGroupX</name></param>
+            <param><type>uint32_t</type> <name>baseGroupY</name></param>
+            <param><type>uint32_t</type> <name>baseGroupZ</name></param>
+            <param><type>uint32_t</type> <name>groupCountX</name></param>
+            <param><type>uint32_t</type> <name>groupCountY</name></param>
+            <param><type>uint32_t</type> <name>groupCountZ</name></param>
+        </command>
+        <command name="vkCmdDispatchBaseKHR"                                   alias="vkCmdDispatchBase"/>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetPhysicalDevicePresentRectanglesKHR</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param externsync="true"><type>VkSurfaceKHR</type> <name>surface</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pRectCount</name></param>
+            <param optional="true" len="pRectCount"><type>VkRect2D</type>* <name>pRects</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateDescriptorUpdateTemplate</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkDescriptorUpdateTemplateCreateInfo</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkDescriptorUpdateTemplate</type>* <name>pDescriptorUpdateTemplate</name></param>
+        </command>
+        <command name="vkCreateDescriptorUpdateTemplateKHR"                    alias="vkCreateDescriptorUpdateTemplate"/>
+        <command>
+            <proto><type>void</type> <name>vkDestroyDescriptorUpdateTemplate</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true"><type>VkDescriptorUpdateTemplate</type> <name>descriptorUpdateTemplate</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command name="vkDestroyDescriptorUpdateTemplateKHR"                   alias="vkDestroyDescriptorUpdateTemplate"/>
+        <command>
+            <proto><type>void</type> <name>vkUpdateDescriptorSetWithTemplate</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="true"><type>VkDescriptorSet</type> <name>descriptorSet</name></param>
+            <param><type>VkDescriptorUpdateTemplate</type> <name>descriptorUpdateTemplate</name></param>
+            <param noautovalidity="true">const <type>void</type>* <name>pData</name></param>
+        </command>
+        <command name="vkUpdateDescriptorSetWithTemplateKHR"                   alias="vkUpdateDescriptorSetWithTemplate"/>
+        <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdPushDescriptorSetWithTemplateKHR</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkDescriptorUpdateTemplate</type> <name>descriptorUpdateTemplate</name></param>
+            <param><type>VkPipelineLayout</type> <name>layout</name></param>
+            <param><type>uint32_t</type> <name>set</name></param>
+            <param noautovalidity="true">const <type>void</type>* <name>pData</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkSetHdrMetadataEXT</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>uint32_t</type> <name>swapchainCount</name></param>
+            <param len="swapchainCount">const <type>VkSwapchainKHR</type>* <name>pSwapchains</name></param>
+            <param len="swapchainCount">const <type>VkHdrMetadataEXT</type>* <name>pMetadata</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_SUBOPTIMAL_KHR" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST,VK_ERROR_OUT_OF_DATE_KHR,VK_ERROR_SURFACE_LOST_KHR,VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT">
+            <proto><type>VkResult</type> <name>vkGetSwapchainStatusKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="true"><type>VkSwapchainKHR</type> <name>swapchain</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_DEVICE_LOST,VK_ERROR_SURFACE_LOST_KHR">
+            <proto><type>VkResult</type> <name>vkGetRefreshCycleDurationGOOGLE</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="true"><type>VkSwapchainKHR</type> <name>swapchain</name></param>
+            <param><type>VkRefreshCycleDurationGOOGLE</type>* <name>pDisplayTimingProperties</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_DEVICE_LOST,VK_ERROR_OUT_OF_DATE_KHR,VK_ERROR_SURFACE_LOST_KHR">
+            <proto><type>VkResult</type> <name>vkGetPastPresentationTimingGOOGLE</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="true"><type>VkSwapchainKHR</type> <name>swapchain</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pPresentationTimingCount</name></param>
+            <param optional="true" len="pPresentationTimingCount"><type>VkPastPresentationTimingGOOGLE</type>* <name>pPresentationTimings</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_NATIVE_WINDOW_IN_USE_KHR">
+            <proto><type>VkResult</type> <name>vkCreateIOSSurfaceMVK</name></proto>
+            <param><type>VkInstance</type> <name>instance</name></param>
+            <param>const <type>VkIOSSurfaceCreateInfoMVK</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkSurfaceKHR</type>* <name>pSurface</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_NATIVE_WINDOW_IN_USE_KHR">
+            <proto><type>VkResult</type> <name>vkCreateMacOSSurfaceMVK</name></proto>
+            <param><type>VkInstance</type> <name>instance</name></param>
+            <param>const <type>VkMacOSSurfaceCreateInfoMVK</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkSurfaceKHR</type>* <name>pSurface</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_NATIVE_WINDOW_IN_USE_KHR">
+            <proto><type>VkResult</type> <name>vkCreateMetalSurfaceEXT</name></proto>
+            <param><type>VkInstance</type> <name>instance</name></param>
+            <param>const <type>VkMetalSurfaceCreateInfoEXT</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkSurfaceKHR</type>* <name>pSurface</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetViewportWScalingNV</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>firstViewport</name></param>
+            <param><type>uint32_t</type> <name>viewportCount</name></param>
+            <param len="viewportCount">const <type>VkViewportWScalingNV</type>* <name>pViewportWScalings</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetDiscardRectangleEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>firstDiscardRectangle</name></param>
+            <param><type>uint32_t</type> <name>discardRectangleCount</name></param>
+            <param len="discardRectangleCount">const <type>VkRect2D</type>* <name>pDiscardRectangles</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetSampleLocationsEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkSampleLocationsInfoEXT</type>* <name>pSampleLocationsInfo</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetPhysicalDeviceMultisamplePropertiesEXT</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>VkSampleCountFlagBits</type> <name>samples</name></param>
+            <param><type>VkMultisamplePropertiesEXT</type>* <name>pMultisampleProperties</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_SURFACE_LOST_KHR">
+            <proto><type>VkResult</type> <name>vkGetPhysicalDeviceSurfaceCapabilities2KHR</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param>const <type>VkPhysicalDeviceSurfaceInfo2KHR</type>* <name>pSurfaceInfo</name></param>
+            <param><type>VkSurfaceCapabilities2KHR</type>* <name>pSurfaceCapabilities</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_SURFACE_LOST_KHR">
+            <proto><type>VkResult</type> <name>vkGetPhysicalDeviceSurfaceFormats2KHR</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param>const <type>VkPhysicalDeviceSurfaceInfo2KHR</type>* <name>pSurfaceInfo</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pSurfaceFormatCount</name></param>
+            <param optional="true" len="pSurfaceFormatCount"><type>VkSurfaceFormat2KHR</type>* <name>pSurfaceFormats</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetPhysicalDeviceDisplayProperties2KHR</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pPropertyCount</name></param>
+            <param optional="true" len="pPropertyCount"><type>VkDisplayProperties2KHR</type>* <name>pProperties</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetPhysicalDeviceDisplayPlaneProperties2KHR</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pPropertyCount</name></param>
+            <param optional="true" len="pPropertyCount"><type>VkDisplayPlaneProperties2KHR</type>* <name>pProperties</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetDisplayModeProperties2KHR</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>VkDisplayKHR</type> <name>display</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pPropertyCount</name></param>
+            <param optional="true" len="pPropertyCount"><type>VkDisplayModeProperties2KHR</type>* <name>pProperties</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetDisplayPlaneCapabilities2KHR</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param>const <type>VkDisplayPlaneInfo2KHR</type>* <name>pDisplayPlaneInfo</name></param>
+            <param><type>VkDisplayPlaneCapabilities2KHR</type>* <name>pCapabilities</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetBufferMemoryRequirements2</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkBufferMemoryRequirementsInfo2</type>* <name>pInfo</name></param>
+            <param><type>VkMemoryRequirements2</type>* <name>pMemoryRequirements</name></param>
+        </command>
+        <command name="vkGetBufferMemoryRequirements2KHR"                      alias="vkGetBufferMemoryRequirements2"/>
+        <command>
+            <proto><type>void</type> <name>vkGetImageMemoryRequirements2</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkImageMemoryRequirementsInfo2</type>* <name>pInfo</name></param>
+            <param><type>VkMemoryRequirements2</type>* <name>pMemoryRequirements</name></param>
+        </command>
+        <command name="vkGetImageMemoryRequirements2KHR"                       alias="vkGetImageMemoryRequirements2"/>
+        <command>
+            <proto><type>void</type> <name>vkGetImageSparseMemoryRequirements2</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkImageSparseMemoryRequirementsInfo2</type>* <name>pInfo</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pSparseMemoryRequirementCount</name></param>
+            <param optional="true" len="pSparseMemoryRequirementCount"><type>VkSparseImageMemoryRequirements2</type>* <name>pSparseMemoryRequirements</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetDeviceBufferMemoryRequirementsKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkDeviceBufferMemoryRequirementsKHR</type>* <name>pInfo</name></param>
+            <param><type>VkMemoryRequirements2</type>* <name>pMemoryRequirements</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetDeviceImageMemoryRequirementsKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkDeviceImageMemoryRequirementsKHR</type>* <name>pInfo</name></param>
+            <param><type>VkMemoryRequirements2</type>* <name>pMemoryRequirements</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetDeviceImageSparseMemoryRequirementsKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkDeviceImageMemoryRequirementsKHR</type>* <name>pInfo</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pSparseMemoryRequirementCount</name></param>
+            <param optional="true" len="pSparseMemoryRequirementCount"><type>VkSparseImageMemoryRequirements2</type>* <name>pSparseMemoryRequirements</name></param>
+        </command>
+        <command name="vkGetImageSparseMemoryRequirements2KHR"                 alias="vkGetImageSparseMemoryRequirements2"/>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateSamplerYcbcrConversion</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkSamplerYcbcrConversionCreateInfo</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkSamplerYcbcrConversion</type>* <name>pYcbcrConversion</name></param>
+        </command>
+        <command name="vkCreateSamplerYcbcrConversionKHR"                      alias="vkCreateSamplerYcbcrConversion"/>
+        <command>
+            <proto><type>void</type> <name>vkDestroySamplerYcbcrConversion</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true"><type>VkSamplerYcbcrConversion</type> <name>ycbcrConversion</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command name="vkDestroySamplerYcbcrConversionKHR"                     alias="vkDestroySamplerYcbcrConversion"/>
+        <command>
+            <proto><type>void</type> <name>vkGetDeviceQueue2</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkDeviceQueueInfo2</type>* <name>pQueueInfo</name></param>
+            <param><type>VkQueue</type>* <name>pQueue</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateValidationCacheEXT</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkValidationCacheCreateInfoEXT</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkValidationCacheEXT</type>* <name>pValidationCache</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyValidationCacheEXT</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true"><type>VkValidationCacheEXT</type> <name>validationCache</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetValidationCacheDataEXT</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkValidationCacheEXT</type> <name>validationCache</name></param>
+            <param optional="false,true"><type>size_t</type>* <name>pDataSize</name></param>
+            <param optional="true" len="pDataSize"><type>void</type>* <name>pData</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkMergeValidationCachesEXT</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="true"><type>VkValidationCacheEXT</type> <name>dstCache</name></param>
+            <param><type>uint32_t</type> <name>srcCacheCount</name></param>
+            <param len="srcCacheCount">const <type>VkValidationCacheEXT</type>* <name>pSrcCaches</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetDescriptorSetLayoutSupport</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkDescriptorSetLayoutCreateInfo</type>* <name>pCreateInfo</name></param>
+            <param><type>VkDescriptorSetLayoutSupport</type>* <name>pSupport</name></param>
+        </command>
+        <command name="vkGetDescriptorSetLayoutSupportKHR"                     alias="vkGetDescriptorSetLayoutSupport"/>
+        <command>
+            <proto><type>VkResult</type> <name>vkGetSwapchainGrallocUsageANDROID</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkFormat</type> <name>format</name></param>
+            <param><type>VkImageUsageFlags</type> <name>imageUsage</name></param>
+            <param><type>int</type>* <name>grallocUsage</name></param>
+        </command>
+        <command>
+            <proto><type>VkResult</type> <name>vkAcquireImageANDROID</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkImage</type> <name>image</name></param>
+            <param><type>int</type> <name>nativeFenceFd</name></param>
+            <param><type>VkSemaphore</type> <name>semaphore</name></param>
+            <param><type>VkFence</type> <name>fence</name></param>
+        </command>
+        <command>
+            <proto><type>VkResult</type> <name>vkQueueSignalReleaseImageANDROID</name></proto>
+            <param><type>VkQueue</type> <name>queue</name></param>
+            <param optional="true"><type>uint32_t</type> <name>waitSemaphoreCount</name></param>
+            <param noautovalidity="true" len="waitSemaphoreCount">const <type>VkSemaphore</type>* <name>pWaitSemaphores</name></param>
+            <param><type>VkImage</type> <name>image</name></param>
+            <param><type>int</type>* <name>pNativeFenceFd</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_FEATURE_NOT_PRESENT,VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetShaderInfoAMD</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkPipeline</type> <name>pipeline</name></param>
+            <param><type>VkShaderStageFlagBits</type> <name>shaderStage</name></param>
+            <param><type>VkShaderInfoTypeAMD</type> <name>infoType</name></param>
+            <param optional="false,true"><type>size_t</type>* <name>pInfoSize</name></param>
+            <param optional="true" len="pInfoSize"><type>void</type>* <name>pInfo</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkSetLocalDimmingAMD</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkSwapchainKHR</type> <name>swapChain</name></param>
+            <param><type>VkBool32</type> <name>localDimmingEnable</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetPhysicalDeviceCalibrateableTimeDomainsEXT</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pTimeDomainCount</name></param>
+            <param optional="true" len="pTimeDomainCount"><type>VkTimeDomainEXT</type>* <name>pTimeDomains</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetCalibratedTimestampsEXT</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>uint32_t</type> <name>timestampCount</name></param>
+            <param len="timestampCount">const <type>VkCalibratedTimestampInfoEXT</type>* <name>pTimestampInfos</name></param>
+            <param len="timestampCount"><type>uint64_t</type>* <name>pTimestamps</name></param>
+            <param><type>uint64_t</type>* <name>pMaxDeviation</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkSetDebugUtilsObjectNameEXT</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="pNameInfo-&gt;objectHandle">const <type>VkDebugUtilsObjectNameInfoEXT</type>* <name>pNameInfo</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkSetDebugUtilsObjectTagEXT</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="pTagInfo-&gt;objectHandle">const <type>VkDebugUtilsObjectTagInfoEXT</type>* <name>pTagInfo</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkQueueBeginDebugUtilsLabelEXT</name></proto>
+            <param><type>VkQueue</type> <name>queue</name></param>
+            <param>const <type>VkDebugUtilsLabelEXT</type>* <name>pLabelInfo</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkQueueEndDebugUtilsLabelEXT</name></proto>
+            <param><type>VkQueue</type> <name>queue</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkQueueInsertDebugUtilsLabelEXT</name></proto>
+            <param><type>VkQueue</type> <name>queue</name></param>
+            <param>const <type>VkDebugUtilsLabelEXT</type>* <name>pLabelInfo</name></param>
+        </command>
+        <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdBeginDebugUtilsLabelEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkDebugUtilsLabelEXT</type>* <name>pLabelInfo</name></param>
+        </command>
+        <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdEndDebugUtilsLabelEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+        </command>
+        <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdInsertDebugUtilsLabelEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkDebugUtilsLabelEXT</type>* <name>pLabelInfo</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateDebugUtilsMessengerEXT</name></proto>
+            <param><type>VkInstance</type> <name>instance</name></param>
+            <param>const <type>VkDebugUtilsMessengerCreateInfoEXT</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkDebugUtilsMessengerEXT</type>* <name>pMessenger</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyDebugUtilsMessengerEXT</name></proto>
+            <param><type>VkInstance</type> <name>instance</name></param>
+            <param optional="true" externsync="true"><type>VkDebugUtilsMessengerEXT</type> <name>messenger</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkSubmitDebugUtilsMessageEXT</name></proto>
+            <param><type>VkInstance</type> <name>instance</name></param>
+            <param><type>VkDebugUtilsMessageSeverityFlagBitsEXT</type> <name>messageSeverity</name></param>
+            <param><type>VkDebugUtilsMessageTypeFlagsEXT</type> <name>messageTypes</name></param>
+            <param>const <type>VkDebugUtilsMessengerCallbackDataEXT</type>* <name>pCallbackData</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_INVALID_EXTERNAL_HANDLE">
+            <proto><type>VkResult</type> <name>vkGetMemoryHostPointerPropertiesEXT</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkExternalMemoryHandleTypeFlagBits</type> <name>handleType</name></param>
+            <param optional="false">const <type>void</type>* <name>pHostPointer</name></param>
+            <param><type>VkMemoryHostPointerPropertiesEXT</type>* <name>pMemoryHostPointerProperties</name></param>
+        </command>
+        <command queues="transfer,graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdWriteBufferMarkerAMD</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkPipelineStageFlagBits</type> <name>pipelineStage</name></param>
+            <param><type>VkBuffer</type> <name>dstBuffer</name></param>
+            <param><type>VkDeviceSize</type> <name>dstOffset</name></param>
+            <param><type>uint32_t</type> <name>marker</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateRenderPass2</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkRenderPassCreateInfo2</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkRenderPass</type>* <name>pRenderPass</name></param>
+        </command>
+        <command name="vkCreateRenderPass2KHR"                                 alias="vkCreateRenderPass2"/>
+        <command queues="graphics" renderpass="outside" cmdbufferlevel="primary">
+            <proto><type>void</type> <name>vkCmdBeginRenderPass2</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkRenderPassBeginInfo</type>*      <name>pRenderPassBegin</name></param>
+            <param>const <type>VkSubpassBeginInfo</type>*      <name>pSubpassBeginInfo</name></param>
+        </command>
+        <command name="vkCmdBeginRenderPass2KHR"                               alias="vkCmdBeginRenderPass2"/>
+        <command queues="graphics" renderpass="inside" cmdbufferlevel="primary">
+            <proto><type>void</type> <name>vkCmdNextSubpass2</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkSubpassBeginInfo</type>*      <name>pSubpassBeginInfo</name></param>
+            <param>const <type>VkSubpassEndInfo</type>*        <name>pSubpassEndInfo</name></param>
+        </command>
+        <command name="vkCmdNextSubpass2KHR"                                   alias="vkCmdNextSubpass2"/>
+        <command queues="graphics" renderpass="inside" cmdbufferlevel="primary">
+            <proto><type>void</type> <name>vkCmdEndRenderPass2</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkSubpassEndInfo</type>*        <name>pSubpassEndInfo</name></param>
+        </command>
+        <command name="vkCmdEndRenderPass2KHR"                                 alias="vkCmdEndRenderPass2"/>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST">
+            <proto><type>VkResult</type> <name>vkGetSemaphoreCounterValue</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkSemaphore</type> <name>semaphore</name></param>
+            <param><type>uint64_t</type>* <name>pValue</name></param>
+        </command>
+        <command name="vkGetSemaphoreCounterValueKHR"              alias="vkGetSemaphoreCounterValue"/>
+        <command successcodes="VK_SUCCESS,VK_TIMEOUT" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST">
+            <proto><type>VkResult</type> <name>vkWaitSemaphores</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkSemaphoreWaitInfo</type>* <name>pWaitInfo</name></param>
+            <param><type>uint64_t</type> <name>timeout</name></param>
+        </command>
+        <command name="vkWaitSemaphoresKHR"                        alias="vkWaitSemaphores"/>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkSignalSemaphore</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkSemaphoreSignalInfo</type>* <name>pSignalInfo</name></param>
+        </command>
+        <command name="vkSignalSemaphoreKHR"                       alias="vkSignalSemaphore"/>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR">
+            <proto><type>VkResult</type> <name>vkGetAndroidHardwareBufferPropertiesANDROID</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const struct <type>AHardwareBuffer</type>* <name>buffer</name></param>
+            <param><type>VkAndroidHardwareBufferPropertiesANDROID</type>* <name>pProperties</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_TOO_MANY_OBJECTS,VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetMemoryAndroidHardwareBufferANDROID</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkMemoryGetAndroidHardwareBufferInfoANDROID</type>* <name>pInfo</name></param>
+            <param>struct <type>AHardwareBuffer</type>** <name>pBuffer</name></param>
+        </command>
+        <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdDrawIndirectCount</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkBuffer</type> <name>buffer</name></param>
+            <param><type>VkDeviceSize</type> <name>offset</name></param>
+            <param><type>VkBuffer</type> <name>countBuffer</name></param>
+            <param><type>VkDeviceSize</type> <name>countBufferOffset</name></param>
+            <param><type>uint32_t</type> <name>maxDrawCount</name></param>
+            <param><type>uint32_t</type> <name>stride</name></param>
+        </command>
+        <command name="vkCmdDrawIndirectCountKHR"                              alias="vkCmdDrawIndirectCount"/>
+        <command name="vkCmdDrawIndirectCountAMD"                              alias="vkCmdDrawIndirectCount"/>
+        <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdDrawIndexedIndirectCount</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkBuffer</type> <name>buffer</name></param>
+            <param><type>VkDeviceSize</type> <name>offset</name></param>
+            <param><type>VkBuffer</type> <name>countBuffer</name></param>
+            <param><type>VkDeviceSize</type> <name>countBufferOffset</name></param>
+            <param><type>uint32_t</type> <name>maxDrawCount</name></param>
+            <param><type>uint32_t</type> <name>stride</name></param>
+        </command>
+        <command name="vkCmdDrawIndexedIndirectCountKHR"                       alias="vkCmdDrawIndexedIndirectCount"/>
+        <command name="vkCmdDrawIndexedIndirectCountAMD"                       alias="vkCmdDrawIndexedIndirectCount"/>
+        <command queues="graphics,compute,transfer" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetCheckpointNV</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param noautovalidity="true">const <type>void</type>* <name>pCheckpointMarker</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetQueueCheckpointDataNV</name></proto>
+            <param><type>VkQueue</type> <name>queue</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pCheckpointDataCount</name></param>
+            <param optional="true" len="pCheckpointDataCount"><type>VkCheckpointDataNV</type>* <name>pCheckpointData</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_MEMORY_MAP_FAILED">
+            <proto><type>VkResult</type> <name>vkMapMemoryIntoAddressSpaceGOOGLE</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="true" devicememoryhandle="1"><type>VkDeviceMemory</type> <name>memory</name></param>
+            <param optional="false,true"><type>uint64_t</type>* <name>pAddress</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_INITIALIZATION_FAILED,VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkRegisterImageColorBufferGOOGLE</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkImage</type> <name>image</name></param>
+            <param><type>uint32_t</type> <name>colorBuffer</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_INITIALIZATION_FAILED,VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkRegisterBufferColorBufferGOOGLE</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkBuffer</type> <name>buffer</name></param>
+            <param><type>uint32_t</type> <name>colorBuffer</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkUpdateDescriptorSetWithTemplateSizedGOOGLE</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="true"><type>VkDescriptorSet</type> <name>descriptorSet</name></param>
+            <param><type>VkDescriptorUpdateTemplate</type> <name>descriptorUpdateTemplate</name></param>
+            <param><type>uint32_t</type> <name>imageInfoCount</name></param>
+            <param><type>uint32_t</type> <name>bufferInfoCount</name></param>
+            <param><type>uint32_t</type> <name>bufferViewCount</name></param>
+            <param optional="true" len="imageInfoCount">const <type>uint32_t</type>* <name>pImageInfoEntryIndices</name></param>
+            <param optional="true" len="bufferInfoCount">const <type>uint32_t</type>* <name>pBufferInfoEntryIndices</name></param>
+            <param optional="true" len="bufferViewCount">const <type>uint32_t</type>* <name>pBufferViewEntryIndices</name></param>
+            <param optional="true" len="imageInfoCount">const <type>VkDescriptorImageInfo</type>* <name>pImageInfos</name></param>
+            <param optional="true" len="bufferInfoCount">const <type>VkDescriptorBufferInfo</type>* <name>pBufferInfos</name></param>
+            <param optional="true" len="bufferViewCount">const <type>VkBufferView</type>* <name>pBufferViews</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkBeginCommandBufferAsyncGOOGLE</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkCommandBufferBeginInfo</type>* <name>pBeginInfo</name></param>
+            <implicitexternsyncparams>
+                <param>the sname:VkCommandPool that pname:commandBuffer was allocated from</param>
+            </implicitexternsyncparams>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkEndCommandBufferAsyncGOOGLE</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <implicitexternsyncparams>
+                <param>the sname:VkCommandPool that pname:commandBuffer was allocated from</param>
+            </implicitexternsyncparams>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkResetCommandBufferAsyncGOOGLE</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param optional="true"><type>VkCommandBufferResetFlags</type> <name>flags</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkCommandBufferHostSyncGOOGLE</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>needHostSync</name></param>
+            <param><type>uint32_t</type> <name>sequenceNumber</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateImageWithRequirementsGOOGLE</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkImageCreateInfo</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkImage</type>* <name>pImage</name></param>
+            <param><type>VkMemoryRequirements</type>* <name>pMemoryRequirements</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateBufferWithRequirementsGOOGLE</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkBufferCreateInfo</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkBuffer</type>* <name>pBuffer</name></param>
+            <param><type>VkMemoryRequirements</type>* <name>pMemoryRequirements</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetMemoryHostAddressInfoGOOGLE</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="true" devicememoryhandle="1"><type>VkDeviceMemory</type> <name>memory</name></param>
+            <param optional="false,true"><type>uint64_t</type>* <name>pAddress</name></param>
+            <param optional="false,true"><type>uint64_t</type>* <name>pSize</name></param>
+            <param optional="false,true"><type>uint64_t</type>* <name>pHostmemId</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkFreeMemorySyncGOOGLE</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true" devicememoryhandle="1"><type>VkDeviceMemory</type> <name>memory</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkQueueHostSyncGOOGLE</name></proto>
+            <param externsync="true"><type>VkQueue</type> <name>queue</name></param>
+            <param><type>uint32_t</type> <name>needHostSync</name></param>
+            <param><type>uint32_t</type> <name>sequenceNumber</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkQueueSubmitAsyncGOOGLE</name></proto>
+            <param externsync="true"><type>VkQueue</type> <name>queue</name></param>
+            <param optional="true"><type>uint32_t</type> <name>submitCount</name></param>
+            <param len="submitCount" externsync="pSubmits[].pWaitSemaphores[],pSubmits[].pSignalSemaphores[]">const <type>VkSubmitInfo</type>* <name>pSubmits</name></param>
+            <param optional="true" externsync="true"><type>VkFence</type> <name>fence</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkQueueWaitIdleAsyncGOOGLE</name></proto>
+            <param><type>VkQueue</type> <name>queue</name></param>
+        </command>
+        <command queues="sparse_binding">
+            <proto><type>void</type> <name>vkQueueBindSparseAsyncGOOGLE</name></proto>
+            <param externsync="true"><type>VkQueue</type> <name>queue</name></param>
+            <param optional="true"><type>uint32_t</type> <name>bindInfoCount</name></param>
+            <param len="bindInfoCount" externsync="pBindInfo[].pWaitSemaphores[],pBindInfo[].pSignalSemaphores[],pBindInfo[].pBufferBinds[].buffer,pBindInfo[].pImageOpaqueBinds[].image,pBindInfo[].pImageBinds[].image">const <type>VkBindSparseInfo</type>* <name>pBindInfo</name></param>
+            <param optional="true" externsync="true"><type>VkFence</type> <name>fence</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetLinearImageLayoutGOOGLE</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkFormat</type> <name>format</name></param>
+            <param><type>VkDeviceSize</type>* <name>pOffset</name></param>
+            <param><type>VkDeviceSize</type>* <name>pRowPitchAlignment</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkQueueFlushCommandsGOOGLE</name></proto>
+            <param externsync="true"><type>VkQueue</type> <name>queue</name></param>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkDeviceSize</type> <name>dataSize</name></param>
+            <param len="dataSize">const <type>void</type>* <name>pData</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetMTLDeviceMVK</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>void</type>** <name>pMTLDevice</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS">
+            <proto><type>VkResult</type> <name>vkSetMTLTextureMVK</name></proto>
+            <param><type>VkImage</type> <name>image</name></param>
+            <param><type>void</type>* <name>mtlTexture</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetMTLTextureMVK</name></proto>
+            <param><type>VkImage</type> <name>image</name></param>
+            <param><type>void</type>** <name>pMTLTexture</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetMTLBufferMVK</name></proto>
+            <param><type>VkBuffer</type> <name>buffer</name></param>
+            <param><type>void</type>** <name>pMTLBuffer</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS">
+            <proto><type>VkResult</type> <name>vkUseIOSurfaceMVK</name></proto>
+            <param><type>VkImage</type> <name>image</name></param>
+            <param><type>void</type>* <name>ioSurface</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetIOSurfaceMVK</name></proto>
+            <param><type>VkImage</type> <name>image</name></param>
+            <param><type>void</type>**  <name>pIOSurface</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdBindTransformFeedbackBuffersEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>firstBinding</name></param>
+            <param><type>uint32_t</type> <name>bindingCount</name></param>
+            <param len="bindingCount">const <type>VkBuffer</type>* <name>pBuffers</name></param>
+            <param len="bindingCount">const <type>VkDeviceSize</type>* <name>pOffsets</name></param>
+            <param optional="true" len="bindingCount" noautovalidity="true">const <type>VkDeviceSize</type>* <name>pSizes</name></param>
+        </command>
+        <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdBeginTransformFeedbackEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>firstCounterBuffer</name></param>
+            <param optional="true"><type>uint32_t</type> <name>counterBufferCount</name></param>
+            <param noautovalidity="true" len="counterBufferCount">const <type>VkBuffer</type>* <name>pCounterBuffers</name></param>
+            <param optional="true" len="counterBufferCount">const <type>VkDeviceSize</type>* <name>pCounterBufferOffsets</name></param>
+        </command>
+        <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdEndTransformFeedbackEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>firstCounterBuffer</name></param>
+            <param optional="true"><type>uint32_t</type> <name>counterBufferCount</name></param>
+            <param noautovalidity="true" len="counterBufferCount">const <type>VkBuffer</type>* <name>pCounterBuffers</name></param>
+            <param optional="true" len="counterBufferCount">const <type>VkDeviceSize</type>* <name>pCounterBufferOffsets</name></param>
+        </command>
+        <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdBeginQueryIndexedEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkQueryPool</type> <name>queryPool</name></param>
+            <param><type>uint32_t</type> <name>query</name></param>
+            <param optional="true"><type>VkQueryControlFlags</type> <name>flags</name></param>
+            <param><type>uint32_t</type> <name>index</name></param>
+        </command>
+        <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdEndQueryIndexedEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkQueryPool</type> <name>queryPool</name></param>
+            <param><type>uint32_t</type> <name>query</name></param>
+            <param><type>uint32_t</type> <name>index</name></param>
+        </command>
+        <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdDrawIndirectByteCountEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>instanceCount</name></param>
+            <param><type>uint32_t</type> <name>firstInstance</name></param>
+            <param><type>VkBuffer</type> <name>counterBuffer</name></param>
+            <param><type>VkDeviceSize</type> <name>counterBufferOffset</name></param>
+            <param><type>uint32_t</type> <name>counterOffset</name></param>
+            <param><type>uint32_t</type> <name>vertexStride</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetExclusiveScissorNV</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>firstExclusiveScissor</name></param>
+            <param><type>uint32_t</type> <name>exclusiveScissorCount</name></param>
+            <param len="exclusiveScissorCount">const <type>VkRect2D</type>* <name>pExclusiveScissors</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdBindShadingRateImageNV</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param optional="true"><type>VkImageView</type> <name>imageView</name></param>
+            <param><type>VkImageLayout</type> <name>imageLayout</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetViewportShadingRatePaletteNV</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>firstViewport</name></param>
+            <param><type>uint32_t</type> <name>viewportCount</name></param>
+            <param len="viewportCount">const <type>VkShadingRatePaletteNV</type>* <name>pShadingRatePalettes</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetCoarseSampleOrderNV</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkCoarseSampleOrderTypeNV</type> <name>sampleOrderType</name></param>
+            <param optional="true"><type>uint32_t</type> <name>customSampleOrderCount</name></param>
+            <param len="customSampleOrderCount">const <type>VkCoarseSampleOrderCustomNV</type>* <name>pCustomSampleOrders</name></param>
+        </command>
+        <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdDrawMeshTasksNV</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>taskCount</name></param>
+            <param><type>uint32_t</type> <name>firstTask</name></param>
+        </command>
+        <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdDrawMeshTasksIndirectNV</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkBuffer</type> <name>buffer</name></param>
+            <param><type>VkDeviceSize</type> <name>offset</name></param>
+            <param><type>uint32_t</type> <name>drawCount</name></param>
+            <param><type>uint32_t</type> <name>stride</name></param>
+        </command>
+        <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdDrawMeshTasksIndirectCountNV</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkBuffer</type> <name>buffer</name></param>
+            <param><type>VkDeviceSize</type> <name>offset</name></param>
+            <param><type>VkBuffer</type> <name>countBuffer</name></param>
+            <param><type>VkDeviceSize</type> <name>countBufferOffset</name></param>
+            <param><type>uint32_t</type> <name>maxDrawCount</name></param>
+            <param><type>uint32_t</type> <name>stride</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCompileDeferredNV</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkPipeline</type> <name>pipeline</name></param>
+            <param><type>uint32_t</type> <name>shader</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateAccelerationStructureNV</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkAccelerationStructureCreateInfoNV</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkAccelerationStructureNV</type>* <name>pAccelerationStructure</name></param>
+        </command>
+        <command queues="compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdBindInvocationMaskHUAWEI</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param optional="true"><type>VkImageView</type> <name>imageView</name></param>
+            <param><type>VkImageLayout</type> <name>imageLayout</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyAccelerationStructureKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true"><type>VkAccelerationStructureKHR</type> <name>accelerationStructure</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyAccelerationStructureNV</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true"><type>VkAccelerationStructureNV</type> <name>accelerationStructure</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetAccelerationStructureMemoryRequirementsNV</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkAccelerationStructureMemoryRequirementsInfoNV</type>* <name>pInfo</name></param>
+            <param><type>VkMemoryRequirements2KHR</type>* <name>pMemoryRequirements</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkBindAccelerationStructureMemoryNV</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>uint32_t</type> <name>bindInfoCount</name></param>
+            <param len="bindInfoCount">const <type>VkBindAccelerationStructureMemoryInfoNV</type>* <name>pBindInfos</name></param>
+        </command>
+        <command queues="compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdCopyAccelerationStructureNV</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkAccelerationStructureNV</type> <name>dst</name></param>
+            <param><type>VkAccelerationStructureNV</type> <name>src</name></param>
+            <param><type>VkCopyAccelerationStructureModeKHR</type> <name>mode</name></param>
+        </command>
+        <command queues="compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdCopyAccelerationStructureKHR</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkCopyAccelerationStructureInfoKHR</type>* <name>pInfo</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_OPERATION_DEFERRED_KHR,VK_OPERATION_NOT_DEFERRED_KHR" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCopyAccelerationStructureKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true"><type>VkDeferredOperationKHR</type> <name>deferredOperation</name></param>
+            <param>const <type>VkCopyAccelerationStructureInfoKHR</type>* <name>pInfo</name></param>
+        </command>
+        <command queues="compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdCopyAccelerationStructureToMemoryKHR</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkCopyAccelerationStructureToMemoryInfoKHR</type>* <name>pInfo</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_OPERATION_DEFERRED_KHR,VK_OPERATION_NOT_DEFERRED_KHR" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCopyAccelerationStructureToMemoryKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true"><type>VkDeferredOperationKHR</type> <name>deferredOperation</name></param>
+            <param>const <type>VkCopyAccelerationStructureToMemoryInfoKHR</type>* <name>pInfo</name></param>
+        </command>
+        <command queues="compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdCopyMemoryToAccelerationStructureKHR</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkCopyMemoryToAccelerationStructureInfoKHR</type>* <name>pInfo</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_OPERATION_DEFERRED_KHR,VK_OPERATION_NOT_DEFERRED_KHR" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCopyMemoryToAccelerationStructureKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true"><type>VkDeferredOperationKHR</type> <name>deferredOperation</name></param>
+            <param>const <type>VkCopyMemoryToAccelerationStructureInfoKHR</type>* <name>pInfo</name></param>
+        </command>
+        <command queues="compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdWriteAccelerationStructuresPropertiesKHR</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>accelerationStructureCount</name></param>
+            <param len="accelerationStructureCount">const <type>VkAccelerationStructureKHR</type>* <name>pAccelerationStructures</name></param>
+            <param><type>VkQueryType</type> <name>queryType</name></param>
+            <param><type>VkQueryPool</type> <name>queryPool</name></param>
+            <param><type>uint32_t</type> <name>firstQuery</name></param>
+        </command>
+        <command queues="compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdWriteAccelerationStructuresPropertiesNV</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>accelerationStructureCount</name></param>
+            <param len="accelerationStructureCount">const <type>VkAccelerationStructureNV</type>* <name>pAccelerationStructures</name></param>
+            <param><type>VkQueryType</type> <name>queryType</name></param>
+            <param><type>VkQueryPool</type> <name>queryPool</name></param>
+            <param><type>uint32_t</type> <name>firstQuery</name></param>
+        </command>
+        <command queues="compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdBuildAccelerationStructureNV</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkAccelerationStructureInfoNV</type>* <name>pInfo</name></param>
+            <param optional="true"><type>VkBuffer</type> <name>instanceData</name></param>
+            <param><type>VkDeviceSize</type> <name>instanceOffset</name></param>
+            <param><type>VkBool32</type> <name>update</name></param>
+            <param><type>VkAccelerationStructureNV</type> <name>dst</name></param>
+            <param optional="true"><type>VkAccelerationStructureNV</type> <name>src</name></param>
+            <param><type>VkBuffer</type> <name>scratch</name></param>
+            <param><type>VkDeviceSize</type> <name>scratchOffset</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkWriteAccelerationStructuresPropertiesKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>uint32_t</type> <name>accelerationStructureCount</name></param>
+            <param len="accelerationStructureCount">const <type>VkAccelerationStructureKHR</type>* <name>pAccelerationStructures</name></param>
+            <param><type>VkQueryType</type>  <name>queryType</name></param>
+            <param><type>size_t</type>       <name>dataSize</name></param>
+            <param len="dataSize"><type>void</type>* <name>pData</name></param>
+            <param><type>size_t</type> <name>stride</name></param>
+        </command>
+        <command queues="compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdTraceRaysKHR</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkStridedDeviceAddressRegionKHR</type>* <name>pRaygenShaderBindingTable</name></param>
+            <param>const <type>VkStridedDeviceAddressRegionKHR</type>* <name>pMissShaderBindingTable</name></param>
+            <param>const <type>VkStridedDeviceAddressRegionKHR</type>* <name>pHitShaderBindingTable</name></param>
+            <param>const <type>VkStridedDeviceAddressRegionKHR</type>* <name>pCallableShaderBindingTable</name></param>
+            <param><type>uint32_t</type> <name>width</name></param>
+            <param><type>uint32_t</type> <name>height</name></param>
+            <param><type>uint32_t</type> <name>depth</name></param>
+        </command>
+        <command queues="compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdTraceRaysNV</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkBuffer</type> <name>raygenShaderBindingTableBuffer</name></param>
+            <param><type>VkDeviceSize</type> <name>raygenShaderBindingOffset</name></param>
+            <param optional="true"><type>VkBuffer</type> <name>missShaderBindingTableBuffer</name></param>
+            <param><type>VkDeviceSize</type> <name>missShaderBindingOffset</name></param>
+            <param><type>VkDeviceSize</type> <name>missShaderBindingStride</name></param>
+            <param optional="true"><type>VkBuffer</type> <name>hitShaderBindingTableBuffer</name></param>
+            <param><type>VkDeviceSize</type> <name>hitShaderBindingOffset</name></param>
+            <param><type>VkDeviceSize</type> <name>hitShaderBindingStride</name></param>
+            <param optional="true"><type>VkBuffer</type> <name>callableShaderBindingTableBuffer</name></param>
+            <param><type>VkDeviceSize</type> <name>callableShaderBindingOffset</name></param>
+            <param><type>VkDeviceSize</type> <name>callableShaderBindingStride</name></param>
+            <param><type>uint32_t</type> <name>width</name></param>
+            <param><type>uint32_t</type> <name>height</name></param>
+            <param><type>uint32_t</type> <name>depth</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetRayTracingShaderGroupHandlesKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkPipeline</type> <name>pipeline</name></param>
+            <param><type>uint32_t</type> <name>firstGroup</name></param>
+            <param><type>uint32_t</type> <name>groupCount</name></param>
+            <param><type>size_t</type> <name>dataSize</name></param>
+            <param len="dataSize"><type>void</type>* <name>pData</name></param>
+        </command>
+        <command name="vkGetRayTracingShaderGroupHandlesNV"                 alias="vkGetRayTracingShaderGroupHandlesKHR"/>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetRayTracingCaptureReplayShaderGroupHandlesKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkPipeline</type> <name>pipeline</name></param>
+            <param><type>uint32_t</type> <name>firstGroup</name></param>
+            <param><type>uint32_t</type> <name>groupCount</name></param>
+            <param><type>size_t</type> <name>dataSize</name></param>
+            <param len="dataSize"><type>void</type>* <name>pData</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetAccelerationStructureHandleNV</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkAccelerationStructureNV</type> <name>accelerationStructure</name></param>
+            <param><type>size_t</type> <name>dataSize</name></param>
+            <param len="dataSize"><type>void</type>* <name>pData</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_PIPELINE_COMPILE_REQUIRED_EXT" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INVALID_SHADER_NV">
+            <proto><type>VkResult</type> <name>vkCreateRayTracingPipelinesNV</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true"><type>VkPipelineCache</type> <name>pipelineCache</name></param>
+            <param><type>uint32_t</type> <name>createInfoCount</name></param>
+            <param len="createInfoCount">const <type>VkRayTracingPipelineCreateInfoNV</type>* <name>pCreateInfos</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param len="createInfoCount"><type>VkPipeline</type>* <name>pPipelines</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_OPERATION_DEFERRED_KHR,VK_OPERATION_NOT_DEFERRED_KHR,VK_PIPELINE_COMPILE_REQUIRED_EXT" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS">
+            <proto><type>VkResult</type> <name>vkCreateRayTracingPipelinesKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true"><type>VkDeferredOperationKHR</type> <name>deferredOperation</name></param>
+            <param optional="true"><type>VkPipelineCache</type> <name>pipelineCache</name></param>
+            <param><type>uint32_t</type> <name>createInfoCount</name></param>
+            <param len="createInfoCount">const <type>VkRayTracingPipelineCreateInfoKHR</type>* <name>pCreateInfos</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param len="createInfoCount"><type>VkPipeline</type>* <name>pPipelines</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetPhysicalDeviceCooperativeMatrixPropertiesNV</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pPropertyCount</name></param>
+            <param optional="true" len="pPropertyCount"><type>VkCooperativeMatrixPropertiesNV</type>* <name>pProperties</name></param>
+        </command>
+        <command queues="compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdTraceRaysIndirectKHR</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkStridedDeviceAddressRegionKHR</type>* <name>pRaygenShaderBindingTable</name></param>
+            <param>const <type>VkStridedDeviceAddressRegionKHR</type>* <name>pMissShaderBindingTable</name></param>
+            <param>const <type>VkStridedDeviceAddressRegionKHR</type>* <name>pHitShaderBindingTable</name></param>
+            <param>const <type>VkStridedDeviceAddressRegionKHR</type>* <name>pCallableShaderBindingTable</name></param>
+            <param><type>VkDeviceAddress</type> <name>indirectDeviceAddress</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetDeviceAccelerationStructureCompatibilityKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkAccelerationStructureVersionInfoKHR</type>* <name>pVersionInfo</name></param>
+            <param><type>VkAccelerationStructureCompatibilityKHR</type>* <name>pCompatibility</name></param>
+        </command>
+        <command>
+            <proto><type>VkDeviceSize</type> <name>vkGetRayTracingShaderGroupStackSizeKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkPipeline</type> <name>pipeline</name></param>
+            <param><type>uint32_t</type> <name>group</name></param>
+            <param><type>VkShaderGroupShaderKHR</type> <name>groupShader</name></param>
+        </command>
+        <command queues="compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetRayTracingPipelineStackSizeKHR</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>pipelineStackSize</name></param>
+        </command>
+        <command>
+            <proto><type>uint32_t</type> <name>vkGetImageViewHandleNVX</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkImageViewHandleInfoNVX</type>* <name>pInfo</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_UNKNOWN">
+            <proto><type>VkResult</type> <name>vkGetImageViewAddressNVX</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkImageView</type> <name>imageView</name></param>
+            <param><type>VkImageViewAddressPropertiesNVX</type>* <name>pProperties</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_SURFACE_LOST_KHR">
+            <proto><type>VkResult</type> <name>vkGetPhysicalDeviceSurfacePresentModes2EXT</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param>const <type>VkPhysicalDeviceSurfaceInfo2KHR</type>* <name>pSurfaceInfo</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pPresentModeCount</name></param>
+            <param optional="true" len="pPresentModeCount"><type>VkPresentModeKHR</type>* <name>pPresentModes</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_SURFACE_LOST_KHR">
+            <proto><type>VkResult</type> <name>vkGetDeviceGroupSurfacePresentModes2EXT</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkPhysicalDeviceSurfaceInfo2KHR</type>* <name>pSurfaceInfo</name></param>
+            <param optional="false,true"><type>VkDeviceGroupPresentModeFlagsKHR</type>* <name>pModes</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INITIALIZATION_FAILED,VK_ERROR_SURFACE_LOST_KHR">
+            <proto><type>VkResult</type> <name>vkAcquireFullScreenExclusiveModeEXT</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkSwapchainKHR</type> <name>swapchain</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_SURFACE_LOST_KHR">
+            <proto><type>VkResult</type> <name>vkReleaseFullScreenExclusiveModeEXT</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkSwapchainKHR</type> <name>swapchain</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INITIALIZATION_FAILED">
+            <proto><type>VkResult</type> <name>vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>uint32_t</type> <name>queueFamilyIndex</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pCounterCount</name></param>
+            <param optional="true" len="pCounterCount"><type>VkPerformanceCounterKHR</type>* <name>pCounters</name></param>
+            <param optional="true" len="pCounterCount"><type>VkPerformanceCounterDescriptionKHR</type>* <name>pCounterDescriptions</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param>const <type>VkQueryPoolPerformanceCreateInfoKHR</type>* <name>pPerformanceQueryCreateInfo</name></param>
+            <param><type>uint32_t</type>* <name>pNumPasses</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_TIMEOUT">
+            <proto><type>VkResult</type> <name>vkAcquireProfilingLockKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkAcquireProfilingLockInfoKHR</type>* <name>pInfo</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkReleaseProfilingLockKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetImageDrmFormatModifierPropertiesEXT</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkImage</type> <name>image</name></param>
+            <param><type>VkImageDrmFormatModifierPropertiesEXT</type>* <name>pProperties</name></param>
+        </command>
+        <command>
+            <proto><type>uint64_t</type> <name>vkGetBufferOpaqueCaptureAddress</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkBufferDeviceAddressInfo</type>* <name>pInfo</name></param>
+        </command>
+        <command name="vkGetBufferOpaqueCaptureAddressKHR" alias="vkGetBufferOpaqueCaptureAddress"/>
+        <command>
+            <proto><type>VkDeviceAddress</type> <name>vkGetBufferDeviceAddress</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkBufferDeviceAddressInfo</type>* <name>pInfo</name></param>
+        </command>
+        <command name="vkGetBufferDeviceAddressKHR"        alias="vkGetBufferDeviceAddress"/>
+        <command name="vkGetBufferDeviceAddressEXT"        alias="vkGetBufferDeviceAddress"/>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateHeadlessSurfaceEXT</name></proto>
+            <param><type>VkInstance</type> <name>instance</name></param>
+            <param>const <type>VkHeadlessSurfaceCreateInfoEXT</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkSurfaceKHR</type>* <name>pSurface</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pCombinationCount</name></param>
+            <param optional="true" len="pCombinationCount"><type>VkFramebufferMixedSamplesCombinationNV</type>* <name>pCombinations</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_TOO_MANY_OBJECTS,VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkInitializePerformanceApiINTEL</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkInitializePerformanceApiInfoINTEL</type>* <name>pInitializeInfo</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkUninitializePerformanceApiINTEL</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+        </command>
+        <command queues="graphics,compute,transfer" renderpass="both" cmdbufferlevel="primary,secondary" successcodes="VK_SUCCESS" errorcodes="VK_ERROR_TOO_MANY_OBJECTS,VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkCmdSetPerformanceMarkerINTEL</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkPerformanceMarkerInfoINTEL</type>* <name>pMarkerInfo</name></param>
+        </command>
+        <command queues="graphics,compute,transfer" renderpass="both" cmdbufferlevel="primary,secondary" successcodes="VK_SUCCESS" errorcodes="VK_ERROR_TOO_MANY_OBJECTS,VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkCmdSetPerformanceStreamMarkerINTEL</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkPerformanceStreamMarkerInfoINTEL</type>* <name>pMarkerInfo</name></param>
+        </command>
+        <command queues="graphics,compute,transfer" renderpass="both" cmdbufferlevel="primary,secondary" successcodes="VK_SUCCESS" errorcodes="VK_ERROR_TOO_MANY_OBJECTS,VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkCmdSetPerformanceOverrideINTEL</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkPerformanceOverrideInfoINTEL</type>* <name>pOverrideInfo</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_TOO_MANY_OBJECTS,VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkAcquirePerformanceConfigurationINTEL</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkPerformanceConfigurationAcquireInfoINTEL</type>* <name>pAcquireInfo</name></param>
+            <param><type>VkPerformanceConfigurationINTEL</type>* <name>pConfiguration</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_TOO_MANY_OBJECTS,VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkReleasePerformanceConfigurationINTEL</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true"><type>VkPerformanceConfigurationINTEL</type> <name>configuration</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_TOO_MANY_OBJECTS,VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkQueueSetPerformanceConfigurationINTEL</name></proto>
+            <param><type>VkQueue</type> <name>queue</name></param>
+            <param><type>VkPerformanceConfigurationINTEL</type> <name>configuration</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_TOO_MANY_OBJECTS,VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetPerformanceParameterINTEL</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkPerformanceParameterTypeINTEL</type> <name>parameter</name></param>
+            <param><type>VkPerformanceValueINTEL</type>* <name>pValue</name></param>
+        </command>
+        <command>
+            <proto><type>uint64_t</type> <name>vkGetDeviceMemoryOpaqueCaptureAddress</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkDeviceMemoryOpaqueCaptureAddressInfo</type>* <name>pInfo</name></param>
+        </command>
+        <command name="vkGetDeviceMemoryOpaqueCaptureAddressKHR"        alias="vkGetDeviceMemoryOpaqueCaptureAddress"/>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetPipelineExecutablePropertiesKHR</name></proto>
+            <param><type>VkDevice</type>                        <name>device</name></param>
+            <param>const <type>VkPipelineInfoKHR</type>*        <name>pPipelineInfo</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pExecutableCount</name></param>
+            <param optional="true" len="pExecutableCount"><type>VkPipelineExecutablePropertiesKHR</type>* <name>pProperties</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetPipelineExecutableStatisticsKHR</name></proto>
+            <param><type>VkDevice</type>                        <name>device</name></param>
+            <param>const <type>VkPipelineExecutableInfoKHR</type>*  <name>pExecutableInfo</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pStatisticCount</name></param>
+            <param optional="true" len="pStatisticCount"><type>VkPipelineExecutableStatisticKHR</type>* <name>pStatistics</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetPipelineExecutableInternalRepresentationsKHR</name></proto>
+            <param><type>VkDevice</type>                        <name>device</name></param>
+            <param>const <type>VkPipelineExecutableInfoKHR</type>*  <name>pExecutableInfo</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pInternalRepresentationCount</name></param>
+            <param optional="true" len="pInternalRepresentationCount"><type>VkPipelineExecutableInternalRepresentationKHR</type>* <name>pInternalRepresentations</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetLineStippleEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>lineStippleFactor</name></param>
+            <param><type>uint16_t</type> <name>lineStipplePattern</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetPhysicalDeviceToolPropertiesEXT</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pToolCount</name></param>
+            <param optional="true" len="pToolCount"><type>VkPhysicalDeviceToolPropertiesEXT</type>* <name>pToolProperties</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR">
+            <proto><type>VkResult</type> <name>vkCreateAccelerationStructureKHR</name></proto>
+            <param><type>VkDevice</type>                                           <name>device</name></param>
+            <param>const <type>VkAccelerationStructureCreateInfoKHR</type>*        <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>*       <name>pAllocator</name></param>
+            <param><type>VkAccelerationStructureKHR</type>*                        <name>pAccelerationStructure</name></param>
+        </command>
+        <command queues="compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdBuildAccelerationStructuresKHR</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type>                                    <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>infoCount</name></param>
+            <param len="infoCount">const <type>VkAccelerationStructureBuildGeometryInfoKHR</type>* <name>pInfos</name></param>
+            <param len="infoCount">const <type>VkAccelerationStructureBuildRangeInfoKHR</type>* const* <name>ppBuildRangeInfos</name></param>
+        </command>
+        <command queues="compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdBuildAccelerationStructuresIndirectKHR</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type>                  <name>commandBuffer</name></param>
+            <param><type>uint32_t</type>                                           <name>infoCount</name></param>
+            <param len="infoCount">const <type>VkAccelerationStructureBuildGeometryInfoKHR</type>* <name>pInfos</name></param>
+            <param len="infoCount">const <type>VkDeviceAddress</type>*             <name>pIndirectDeviceAddresses</name></param>
+            <param len="infoCount">const <type>uint32_t</type>*                    <name>pIndirectStrides</name></param>
+            <param len="infoCount">const <type>uint32_t</type>* const*             <name>ppMaxPrimitiveCounts</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_OPERATION_DEFERRED_KHR,VK_OPERATION_NOT_DEFERRED_KHR" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkBuildAccelerationStructuresKHR</name></proto>
+            <param><type>VkDevice</type>                                           <name>device</name></param>
+            <param optional="true"><type>VkDeferredOperationKHR</type> <name>deferredOperation</name></param>
+            <param><type>uint32_t</type> <name>infoCount</name></param>
+            <param len="infoCount">const <type>VkAccelerationStructureBuildGeometryInfoKHR</type>* <name>pInfos</name></param>
+            <param len="infoCount">const <type>VkAccelerationStructureBuildRangeInfoKHR</type>* const* <name>ppBuildRangeInfos</name></param>
+        </command>
+        <command>
+            <proto><type>VkDeviceAddress</type> <name>vkGetAccelerationStructureDeviceAddressKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkAccelerationStructureDeviceAddressInfoKHR</type>* <name>pInfo</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreateDeferredOperationKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkDeferredOperationKHR</type>* <name>pDeferredOperation</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyDeferredOperationKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true"><type>VkDeferredOperationKHR</type> <name>operation</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command>
+            <proto><type>uint32_t</type> <name>vkGetDeferredOperationMaxConcurrencyKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkDeferredOperationKHR</type> <name>operation</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_NOT_READY">
+            <proto><type>VkResult</type> <name>vkGetDeferredOperationResultKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkDeferredOperationKHR</type> <name>operation</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_THREAD_DONE_KHR,VK_THREAD_IDLE_KHR" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
+            <proto><type>VkResult</type> <name>vkDeferredOperationJoinKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkDeferredOperationKHR</type> <name>operation</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetCullModeEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param optional="true"><type>VkCullModeFlags</type> <name>cullMode</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetFrontFaceEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkFrontFace</type> <name>frontFace</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetPrimitiveTopologyEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkPrimitiveTopology</type> <name>primitiveTopology</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetViewportWithCountEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>viewportCount</name></param>
+            <param len="viewportCount">const <type>VkViewport</type>* <name>pViewports</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetScissorWithCountEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>scissorCount</name></param>
+            <param len="scissorCount">const <type>VkRect2D</type>* <name>pScissors</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdBindVertexBuffers2EXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>firstBinding</name></param>
+            <param><type>uint32_t</type> <name>bindingCount</name></param>
+            <param len="bindingCount" optional="false,true">const <type>VkBuffer</type>* <name>pBuffers</name></param>
+            <param len="bindingCount">const <type>VkDeviceSize</type>* <name>pOffsets</name></param>
+            <param optional="true" len="bindingCount">const <type>VkDeviceSize</type>* <name>pSizes</name></param>
+            <param optional="true" len="bindingCount">const <type>VkDeviceSize</type>* <name>pStrides</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetDepthTestEnableEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkBool32</type> <name>depthTestEnable</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetDepthWriteEnableEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkBool32</type> <name>depthWriteEnable</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetDepthCompareOpEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkCompareOp</type> <name>depthCompareOp</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetDepthBoundsTestEnableEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkBool32</type> <name>depthBoundsTestEnable</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetStencilTestEnableEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkBool32</type> <name>stencilTestEnable</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetStencilOpEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkStencilFaceFlags</type> <name>faceMask</name></param>
+            <param><type>VkStencilOp</type> <name>failOp</name></param>
+            <param><type>VkStencilOp</type> <name>passOp</name></param>
+            <param><type>VkStencilOp</type> <name>depthFailOp</name></param>
+            <param><type>VkCompareOp</type> <name>compareOp</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetPatchControlPointsEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>uint32_t</type> <name>patchControlPoints</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetRasterizerDiscardEnableEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkBool32</type> <name>rasterizerDiscardEnable</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetDepthBiasEnableEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkBool32</type> <name>depthBiasEnable</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetLogicOpEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkLogicOp</type> <name>logicOp</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetPrimitiveRestartEnableEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param><type>VkBool32</type> <name>primitiveRestartEnable</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkCreatePrivateDataSlotEXT</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkPrivateDataSlotCreateInfoEXT</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkPrivateDataSlotEXT</type>* <name>pPrivateDataSlot</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyPrivateDataSlotEXT</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param optional="true" externsync="true"><type>VkPrivateDataSlotEXT</type> <name>privateDataSlot</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkSetPrivateDataEXT</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkObjectType</type> <name>objectType</name></param>
+            <param objecttype="objectType"><type>uint64_t</type> <name>objectHandle</name></param>
+            <param><type>VkPrivateDataSlotEXT</type> <name>privateDataSlot</name></param>
+            <param><type>uint64_t</type> <name>data</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetPrivateDataEXT</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkObjectType</type> <name>objectType</name></param>
+            <param objecttype="objectType"><type>uint64_t</type> <name>objectHandle</name></param>
+            <param><type>VkPrivateDataSlotEXT</type> <name>privateDataSlot</name></param>
+            <param><type>uint64_t</type>* <name>pData</name></param>
+        </command>
+        <command queues="transfer,graphics,compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdCopyBuffer2KHR</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkCopyBufferInfo2KHR</type>* <name>pCopyBufferInfo</name></param>
+        </command>
+        <command queues="transfer,graphics,compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdCopyImage2KHR</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkCopyImageInfo2KHR</type>* <name>pCopyImageInfo</name></param>
+        </command>
+        <command queues="graphics" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdBlitImage2KHR</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkBlitImageInfo2KHR</type>* <name>pBlitImageInfo</name></param>
+        </command>
+        <command queues="transfer,graphics,compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdCopyBufferToImage2KHR</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkCopyBufferToImageInfo2KHR</type>* <name>pCopyBufferToImageInfo</name></param>
+        </command>
+        <command queues="transfer,graphics,compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdCopyImageToBuffer2KHR</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkCopyImageToBufferInfo2KHR</type>* <name>pCopyImageToBufferInfo</name></param>
+        </command>
+        <command queues="graphics" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdResolveImage2KHR</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkResolveImageInfo2KHR</type>* <name>pResolveImageInfo</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetFragmentShadingRateKHR</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type>           <name>commandBuffer</name></param>
+            <param>const <type>VkExtent2D</type>*                           <name>pFragmentSize</name></param>
+            <param>const <type>VkFragmentShadingRateCombinerOpKHR</type>    <name>combinerOps</name>[2]</param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetPhysicalDeviceFragmentShadingRatesKHR</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pFragmentShadingRateCount</name></param>
+            <param optional="true" len="pFragmentShadingRateCount"><type>VkPhysicalDeviceFragmentShadingRateKHR</type>* <name>pFragmentShadingRates</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetFragmentShadingRateEnumNV</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type>           <name>commandBuffer</name></param>
+            <param><type>VkFragmentShadingRateNV</type>                     <name>shadingRate</name></param>
+            <param>const <type>VkFragmentShadingRateCombinerOpKHR</type>    <name>combinerOps</name>[2]</param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetAccelerationStructureBuildSizesKHR</name></proto>
+            <param><type>VkDevice</type>                                            <name>device</name></param>
+            <param><type>VkAccelerationStructureBuildTypeKHR</type>                 <name>buildType</name></param>
+            <param>const <type>VkAccelerationStructureBuildGeometryInfoKHR</type>*  <name>pBuildInfo</name></param>
+            <param optional="true" len="pBuildInfo-&gt;geometryCount">const <type>uint32_t</type>*  <name>pMaxPrimitiveCounts</name></param>
+            <param><type>VkAccelerationStructureBuildSizesInfoKHR</type>*           <name>pSizeInfo</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkQueueCommitDescriptorSetUpdatesGOOGLE</name></proto>
+            <param externsync="true"><type>VkQueue</type> <name>queue</name></param>
+            <param externsync="true"><type>uint32_t</type> <name>descriptorPoolCount</name></param>
+            <param len="descriptorPoolCount" externsync="true">const <type>VkDescriptorPool</type>* <name>pDescriptorPools</name></param>
+            <param externsync="true"><type>uint32_t</type> <name>descriptorSetCount</name></param>
+            <param len="descriptorSetCount" externsync="true">const <type>VkDescriptorSetLayout</type>* <name>pSetLayouts</name></param>
+            <param len="descriptorSetCount" externsync="true">const <type>uint64_t</type>* <name>pDescriptorSetPoolIds</name></param>
+            <param len="descriptorSetCount" externsync="true">const <type>uint32_t</type>* <name>pDescriptorSetWhichPool</name></param>
+            <param len="descriptorSetCount" externsync="true">const <type>uint32_t</type>* <name>pDescriptorSetPendingAllocation</name></param>
+            <param len="descriptorSetCount" externsync="true">const <type>uint32_t</type>* <name>pDescriptorWriteStartingIndices</name></param>
+            <param externsync="true"><type>uint32_t</type> <name>pendingDescriptorWriteCount</name></param>
+            <param len="pendingDescriptorWriteCount" externsync="true">const <type>VkWriteDescriptorSet</type>* <name>pPendingDescriptorWrites</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkCollectDescriptorPoolIdsGOOGLE</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="true"><type>VkDescriptorPool</type> <name>descriptorPool</name></param>
+            <param optiona="false,true"><type>uint32_t</type>* <name>pPoolIdCount</name></param>
+            <param optional="true" len="pPoolIdCount"><type>uint64_t</type>* <name>pPoolIds</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkQueueSignalReleaseImageANDROIDAsyncGOOGLE</name></proto>
+            <param><type>VkQueue</type> <name>queue</name></param>
+            <param optional="true"><type>uint32_t</type> <name>waitSemaphoreCount</name></param>
+            <param noautovalidity="true" len="waitSemaphoreCount">const <type>VkSemaphore</type>* <name>pWaitSemaphores</name></param>
+            <param><type>VkImage</type> <name>image</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetVertexInputEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param optional="true"><type>uint32_t</type> <name>vertexBindingDescriptionCount</name></param>
+            <param len="vertexBindingDescriptionCount">const <type>VkVertexInputBindingDescription2EXT</type>* <name>pVertexBindingDescriptions</name></param>
+            <param optional="true"><type>uint32_t</type> <name>vertexAttributeDescriptionCount</name></param>
+            <param len="vertexAttributeDescriptionCount">const <type>VkVertexInputAttributeDescription2EXT</type>* <name>pVertexAttributeDescriptions</name></param>
+        </command>
+        <command queues="graphics" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type>                                    <name>vkCmdSetColorWriteEnableEXT</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type>       <name>commandBuffer</name></param>
+            <param><type>uint32_t</type>                                <name>attachmentCount</name></param>
+            <param len="attachmentCount">const <type>VkBool32</type>*   <name>pColorWriteEnables</name></param>
+        </command>
+        <command queues="graphics,compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdSetEvent2KHR</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type>                   <name>commandBuffer</name></param>
+            <param><type>VkEvent</type>                                             <name>event</name></param>
+            <param>const <type>VkDependencyInfoKHR</type>*                          <name>pDependencyInfo</name></param>
+        </command>
+        <command queues="graphics,compute" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdResetEvent2KHR</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type>                   <name>commandBuffer</name></param>
+            <param><type>VkEvent</type>                                             <name>event</name></param>
+            <param><type>VkPipelineStageFlags2KHR</type>                            <name>stageMask</name></param>
+        </command>
+        <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdWaitEvents2KHR</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type>                   <name>commandBuffer</name></param>
+            <param><type>uint32_t</type>                                            <name>eventCount</name></param>
+            <param len="eventCount">const <type>VkEvent</type>*                     <name>pEvents</name></param>
+            <param len="eventCount">const <type>VkDependencyInfoKHR</type>*         <name>pDependencyInfos</name></param>
+        </command>
+        <command queues="transfer,graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdPipelineBarrier2KHR</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type>                   <name>commandBuffer</name></param>
+            <param>const <type>VkDependencyInfoKHR</type>*                                <name>pDependencyInfo</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST">
+            <proto><type>VkResult</type> <name>vkQueueSubmit2KHR</name></proto>
+            <param externsync="true"><type>VkQueue</type>                           <name>queue</name></param>
+            <param optional="true"><type>uint32_t</type>                            <name>submitCount</name></param>
+            <param len="submitCount">const <type>VkSubmitInfo2KHR</type>*           <name>pSubmits</name></param>
+            <param optional="true" externsync="true"><type>VkFence</type>           <name>fence</name></param>
+        </command>
+        <command queues="transfer,graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdWriteTimestamp2KHR</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type>                   <name>commandBuffer</name></param>
+            <param><type>VkPipelineStageFlags2KHR</type>                            <name>stage</name></param>
+            <param><type>VkQueryPool</type>                                         <name>queryPool</name></param>
+            <param><type>uint32_t</type>                                            <name>query</name></param>
+        </command>
+        <command queues="transfer,graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdWriteBufferMarker2AMD</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type>                   <name>commandBuffer</name></param>
+            <param><type>VkPipelineStageFlags2KHR</type>                            <name>stage</name></param>
+            <param><type>VkBuffer</type>                                            <name>dstBuffer</name></param>
+            <param><type>VkDeviceSize</type>                                        <name>dstOffset</name></param>
+            <param><type>uint32_t</type>                                            <name>marker</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkGetQueueCheckpointData2NV</name></proto>
+            <param><type>VkQueue</type> <name>queue</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pCheckpointDataCount</name></param>
+            <param optional="true" len="pCheckpointDataCount"><type>VkCheckpointData2NV</type>* <name>pCheckpointData</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_EXTENSION_NOT_PRESENT,VK_ERROR_INITIALIZATION_FAILED,VK_ERROR_FEATURE_NOT_PRESENT,VK_ERROR_FORMAT_NOT_SUPPORTED">
+            <proto><type>VkResult</type> <name>vkGetPhysicalDeviceVideoCapabilitiesKHR</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param>const <type>VkVideoProfileKHR</type>* <name>pVideoProfile</name></param>
+            <param><type>VkVideoCapabilitiesKHR</type>* <name>pCapabilities</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_EXTENSION_NOT_PRESENT,VK_ERROR_INITIALIZATION_FAILED,VK_ERROR_FORMAT_NOT_SUPPORTED">
+            <proto><type>VkResult</type> <name>vkGetPhysicalDeviceVideoFormatPropertiesKHR</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param>const <type>VkPhysicalDeviceVideoFormatInfoKHR</type>* <name>pVideoFormatInfo</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pVideoFormatPropertyCount</name></param>
+            <param optional="true" len="pVideoFormatPropertyCount"><type>VkVideoFormatPropertiesKHR</type>* <name>pVideoFormatProperties</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INITIALIZATION_FAILED,VK_ERROR_INCOMPATIBLE_DRIVER,VK_ERROR_FEATURE_NOT_PRESENT">
+            <proto><type>VkResult</type> <name>vkCreateVideoSessionKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkVideoSessionCreateInfoKHR</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkVideoSessionKHR</type>* <name>pVideoSession</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyVideoSessionKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkVideoSessionKHR</type> <name>videoSession</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_INITIALIZATION_FAILED,VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_TOO_MANY_OBJECTS">
+            <proto><type>VkResult</type> <name>vkCreateVideoSessionParametersKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkVideoSessionParametersCreateInfoKHR</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkVideoSessionParametersKHR</type>* <name>pVideoSessionParameters</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_INITIALIZATION_FAILED,VK_ERROR_TOO_MANY_OBJECTS">
+            <proto><type>VkResult</type> <name>vkUpdateVideoSessionParametersKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkVideoSessionParametersKHR</type> <name>videoSessionParameters</name></param>
+            <param>const <type>VkVideoSessionParametersUpdateInfoKHR</type>* <name>pUpdateInfo</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyVideoSessionParametersKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkVideoSessionParametersKHR</type> <name>videoSessionParameters</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_INCOMPLETE" errorcodes="VK_ERROR_INITIALIZATION_FAILED">
+            <proto><type>VkResult</type> <name>vkGetVideoSessionMemoryRequirementsKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkVideoSessionKHR</type> <name>videoSession</name></param>
+            <param optional="false,true"><type>uint32_t</type>* <name>pVideoSessionMemoryRequirementsCount</name></param>
+            <param optional="true" len="pVideoSessionMemoryRequirementsCount"><type>VkVideoGetMemoryPropertiesKHR</type>* <name>pVideoSessionMemoryRequirements</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_INITIALIZATION_FAILED">
+            <proto><type>VkResult</type> <name>vkBindVideoSessionMemoryKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkVideoSessionKHR</type> <name>videoSession</name></param>
+            <param><type>uint32_t</type> <name>videoSessionBindMemoryCount</name></param>
+            <param len="videoSessionBindMemoryCount">const <type>VkVideoBindMemoryKHR</type>* <name>pVideoSessionBindMemories</name></param>
+        </command>
+        <command queues="decode" renderpass="outside" cmdbufferlevel="primary">
+            <proto><type>void</type> <name>vkCmdDecodeVideoKHR</name></proto>
+            <param><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkVideoDecodeInfoKHR</type>* <name>pFrameInfo</name></param>
+        </command>
+        <command queues="decode,encode" renderpass="outside" cmdbufferlevel="primary">
+            <proto><type>void</type> <name>vkCmdBeginVideoCodingKHR</name></proto>
+            <param><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkVideoBeginCodingInfoKHR</type>* <name>pBeginInfo</name></param>
+        </command>
+        <command queues="decode,encode" renderpass="outside" cmdbufferlevel="primary">
+            <proto><type>void</type> <name>vkCmdControlVideoCodingKHR</name></proto>
+            <param><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkVideoCodingControlInfoKHR</type>* <name>pCodingControlInfo</name></param>
+        </command>
+        <command queues="decode,encode" renderpass="outside" cmdbufferlevel="primary">
+            <proto><type>void</type> <name>vkCmdEndVideoCodingKHR</name></proto>
+            <param><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkVideoEndCodingInfoKHR</type>* <name>pEndCodingInfo</name></param>
+        </command>
+        <command queues="encode" renderpass="outside" cmdbufferlevel="primary">
+            <proto><type>void</type> <name>vkCmdEncodeVideoKHR</name></proto>
+            <param><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkVideoEncodeInfoKHR</type>* <name>pEncodeInfo</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_INITIALIZATION_FAILED">
+            <proto><type>VkResult</type> <name>vkCreateCuModuleNVX</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkCuModuleCreateInfoNVX</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkCuModuleNVX</type>* <name>pModule</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_INITIALIZATION_FAILED">
+            <proto><type>VkResult</type> <name>vkCreateCuFunctionNVX</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkCuFunctionCreateInfoNVX</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkCuFunctionNVX</type>* <name>pFunction</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyCuModuleNVX</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkCuModuleNVX</type> <name>module</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyCuFunctionNVX</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkCuFunctionNVX</type> <name>function</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command queues="graphics,compute" renderpass="both" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdCuLaunchKernelNVX</name></proto>
+            <param><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+            <param>const <type>VkCuLaunchInfoNVX</type>* <name>pLaunchInfo</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkSetDeviceMemoryPriorityEXT</name></proto>
+            <param><type>VkDevice</type>       <name>device</name></param>
+            <param><type>VkDeviceMemory</type> <name>memory</name></param>
+            <param><type>float</type>          <name>priority</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_INITIALIZATION_FAILED">
+            <proto><type>VkResult</type> <name>vkAcquireDrmDisplayEXT</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>int32_t</type> <name>drmFd</name></param>
+            <param><type>VkDisplayKHR</type> <name>display</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_INITIALIZATION_FAILED,VK_ERROR_OUT_OF_HOST_MEMORY">
+            <proto><type>VkResult</type> <name>vkGetDrmDisplayEXT</name></proto>
+            <param><type>VkPhysicalDevice</type> <name>physicalDevice</name></param>
+            <param><type>int32_t</type> <name>drmFd</name></param>
+            <param><type>uint32_t</type> <name>connectorId</name></param>
+            <param><type>VkDisplayKHR</type>* <name>display</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS,VK_TIMEOUT" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST">
+            <proto><type>VkResult</type> <name>vkWaitForPresentKHR</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param externsync="true"><type>VkSwapchainKHR</type> <name>swapchain</name></param>
+            <param><type>uint64_t</type> <name>presentId</name></param>
+            <param><type>uint64_t</type> <name>timeout</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_INVALID_EXTERNAL_HANDLE,VK_ERROR_INITIALIZATION_FAILED">
+            <proto><type>VkResult</type> <name>vkCreateBufferCollectionFUCHSIA</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param>const <type>VkBufferCollectionCreateInfoFUCHSIA</type>* <name>pCreateInfo</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+            <param><type>VkBufferCollectionFUCHSIA</type>* <name>pCollection</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_INITIALIZATION_FAILED,VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_FORMAT_NOT_SUPPORTED">
+            <proto><type>VkResult</type> <name>vkSetBufferCollectionBufferConstraintsFUCHSIA</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkBufferCollectionFUCHSIA</type> <name>collection</name></param>
+            <param>const <type>VkBufferConstraintsInfoFUCHSIA</type>* <name>pBufferConstraintsInfo</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_INITIALIZATION_FAILED,VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_FORMAT_NOT_SUPPORTED">
+            <proto><type>VkResult</type> <name>vkSetBufferCollectionImageConstraintsFUCHSIA</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkBufferCollectionFUCHSIA</type> <name>collection</name></param>
+            <param>const <type>VkImageConstraintsInfoFUCHSIA</type>* <name>pImageConstraintsInfo</name></param>
+        </command>
+        <command>
+            <proto><type>void</type> <name>vkDestroyBufferCollectionFUCHSIA</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkBufferCollectionFUCHSIA</type> <name>collection</name></param>
+            <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
+        </command>
+        <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_INITIALIZATION_FAILED">
+            <proto><type>VkResult</type> <name>vkGetBufferCollectionPropertiesFUCHSIA</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>VkBufferCollectionFUCHSIA</type> <name>collection</name></param>
+            <param><type>VkBufferCollectionPropertiesFUCHSIA</type>* <name>pProperties</name></param>
+        </command>
+        <command queues="graphics" renderpass="outside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdBeginRenderingKHR</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type>                   <name>commandBuffer</name></param>
+            <param>const <type>VkRenderingInfoKHR</type>*                           <name>pRenderingInfo</name></param>
+        </command>
+        <command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary">
+            <proto><type>void</type> <name>vkCmdEndRenderingKHR</name></proto>
+            <param externsync="true"><type>VkCommandBuffer</type>                   <name>commandBuffer</name></param>
+        </command>
+    </commands>
+
+    <feature api="vulkan" name="VK_VERSION_1_0" number="1.0" comment="Vulkan core API interface definitions">
+        <require comment="Header boilerplate">
+            <type name="vk_platform"/>
+            <type name="VK_DEFINE_HANDLE"/>
+            <type name="VK_USE_64_BIT_PTR_DEFINES"/>
+            <type name="VK_DEFINE_NON_DISPATCHABLE_HANDLE"/>
+            <type name="VK_NULL_HANDLE"/>
+        </require>
+        <require comment="Fundamental types used by many commands and structures">
+            <type name="VkBool32"/>
+            <type name="VkDeviceAddress"/>
+            <type name="VkDeviceSize"/>
+            <type name="VkExtent2D"/>
+            <type name="VkExtent3D"/>
+            <type name="VkFlags"/>
+            <type name="VkOffset2D"/>
+            <type name="VkOffset3D"/>
+            <type name="VkRect2D"/>
+            <type name="VkResult"/>
+            <type name="VkStructureType"/>
+        </require>
+        <require comment="These types are part of the API, though not directly used in API commands or data structures">
+            <type name="VkBaseInStructure"/>
+            <type name="VkBaseOutStructure"/>
+            <type name="VkBufferMemoryBarrier"/>
+            <type name="VkDispatchIndirectCommand"/>
+            <type name="VkDrawIndexedIndirectCommand"/>
+            <type name="VkDrawIndirectCommand"/>
+            <type name="VkImageMemoryBarrier"/>
+            <type name="VkMemoryBarrier"/>
+            <type name="VkObjectType"/>
+            <type name="VkPipelineCacheHeaderVersionOne"/>
+            <type name="VkVendorId"/>
+        </require>
+        <require comment="API version macros">
+            <type name="VK_API_VERSION"/>
+            <type name="VK_API_VERSION_1_0"/>
+            <type name="VK_HEADER_VERSION"/>
+            <type name="VK_HEADER_VERSION_COMPLETE"/>
+            <type name="VK_MAKE_VERSION"/>
+            <type name="VK_VERSION_MAJOR"/>
+            <type name="VK_VERSION_MINOR"/>
+            <type name="VK_VERSION_PATCH"/>
+            <type name="VK_MAKE_API_VERSION"/>
+            <type name="VK_API_VERSION_VARIANT"/>
+            <type name="VK_API_VERSION_MAJOR"/>
+            <type name="VK_API_VERSION_MINOR"/>
+            <type name="VK_API_VERSION_PATCH"/>
+        </require>
+        <require comment="API constants">
+            <enum name="VK_ATTACHMENT_UNUSED"/>
+            <enum name="VK_FALSE"/>
+            <enum name="VK_LOD_CLAMP_NONE"/>
+            <enum name="VK_QUEUE_FAMILY_IGNORED"/>
+            <enum name="VK_REMAINING_ARRAY_LAYERS"/>
+            <enum name="VK_REMAINING_MIP_LEVELS"/>
+            <enum name="VK_SUBPASS_EXTERNAL"/>
+            <enum name="VK_TRUE"/>
+            <enum name="VK_WHOLE_SIZE"/>
+            <type name="VkPipelineCacheHeaderVersion"/>
+        </require>
+        <require comment="Device initialization">
+            <type name="PFN_vkAllocationFunction"/>
+            <type name="PFN_vkFreeFunction"/>
+            <type name="PFN_vkInternalAllocationNotification"/>
+            <type name="PFN_vkInternalFreeNotification"/>
+            <type name="PFN_vkReallocationFunction"/>
+            <type name="PFN_vkVoidFunction"/>
+            <type name="VkAllocationCallbacks"/>
+            <type name="VkApplicationInfo"/>
+            <type name="VkFormat"/>
+            <type name="VkFormatFeatureFlagBits"/>
+            <type name="VkFormatFeatureFlags"/>
+            <type name="VkFormatProperties"/>
+            <type name="VkImageCreateFlagBits"/>
+            <type name="VkImageCreateFlags"/>
+            <type name="VkImageFormatProperties"/>
+            <type name="VkImageTiling"/>
+            <type name="VkImageType"/>
+            <type name="VkImageUsageFlagBits"/>
+            <type name="VkImageUsageFlags"/>
+            <type name="VkInstance"/>
+            <type name="VkInstanceCreateFlags" comment="Will add VkInstanceCreateFlagBits when bits are defined in the future"/>
+            <type name="VkInstanceCreateInfo"/>
+            <type name="VkInternalAllocationType"/>
+            <type name="VkMemoryHeap"/>
+            <type name="VkMemoryHeapFlagBits"/>
+            <type name="VkMemoryHeapFlags"/>
+            <type name="VkMemoryPropertyFlagBits"/>
+            <type name="VkMemoryPropertyFlags"/>
+            <type name="VkMemoryType"/>
+            <type name="VkPhysicalDevice"/>
+            <type name="VkPhysicalDeviceFeatures"/>
+            <type name="VkPhysicalDeviceLimits"/>
+            <type name="VkPhysicalDeviceMemoryProperties"/>
+            <type name="VkPhysicalDeviceProperties"/>
+            <type name="VkPhysicalDeviceSparseProperties"/>
+            <type name="VkPhysicalDeviceType"/>
+            <type name="VkQueueFamilyProperties"/>
+            <type name="VkQueueFlagBits"/>
+            <type name="VkQueueFlags"/>
+            <type name="VkSampleCountFlagBits"/>
+            <type name="VkSampleCountFlags"/>
+            <type name="VkSystemAllocationScope"/>
+            <command name="vkCreateInstance"/>
+            <command name="vkDestroyInstance"/>
+            <command name="vkEnumeratePhysicalDevices"/>
+            <command name="vkGetPhysicalDeviceFeatures"/>
+            <command name="vkGetPhysicalDeviceFormatProperties"/>
+            <command name="vkGetPhysicalDeviceImageFormatProperties"/>
+            <command name="vkGetPhysicalDeviceProperties"/>
+            <command name="vkGetPhysicalDeviceQueueFamilyProperties"/>
+            <command name="vkGetPhysicalDeviceMemoryProperties"/>
+            <command name="vkGetInstanceProcAddr"/>
+            <command name="vkGetDeviceProcAddr"/>
+        </require>
+        <require comment="Device commands">
+            <type name="VkDevice"/>
+            <type name="VkDeviceCreateFlags" comment="Will add VkDeviceCreateFlagBits when bits are defined in the future"/>
+            <type name="VkDeviceCreateInfo"/>
+            <type name="VkDeviceQueueCreateFlags" comment="VkDeviceQueueCreateFlagBits was added later"/>
+            <type name="VkDeviceQueueCreateInfo"/>
+            <command name="vkCreateDevice"/>
+            <command name="vkDestroyDevice"/>
+        </require>
+        <require comment="Extension discovery commands">
+            <type name="VkExtensionProperties"/>
+            <command name="vkEnumerateInstanceExtensionProperties"/>
+            <command name="vkEnumerateDeviceExtensionProperties"/>
+        </require>
+        <require comment="Layer discovery commands">
+            <type name="VkLayerProperties"/>
+            <command name="vkEnumerateInstanceLayerProperties"/>
+            <command name="vkEnumerateDeviceLayerProperties"/>
+        </require>
+        <require comment="Queue commands">
+            <type name="VkPipelineStageFlagBits"/>
+            <type name="VkPipelineStageFlags"/>
+            <type name="VkQueue"/>
+            <type name="VkSubmitInfo"/>
+            <command name="vkGetDeviceQueue"/>
+            <command name="vkQueueSubmit"/>
+            <command name="vkQueueWaitIdle"/>
+            <command name="vkDeviceWaitIdle"/>
+        </require>
+        <require comment="Memory commands">
+            <type name="VkMappedMemoryRange"/>
+            <type name="VkMemoryAllocateInfo"/>
+            <type name="VkMemoryMapFlags"/>
+            <command name="vkAllocateMemory"/>
+            <command name="vkFreeMemory"/>
+            <command name="vkMapMemory"/>
+            <command name="vkUnmapMemory"/>
+            <command name="vkFlushMappedMemoryRanges"/>
+            <command name="vkInvalidateMappedMemoryRanges"/>
+            <command name="vkGetDeviceMemoryCommitment"/>
+        </require>
+        <require comment="Memory management API commands">
+            <type name="VkDeviceMemory"/>
+            <type name="VkMemoryRequirements"/>
+            <command name="vkBindBufferMemory"/>
+            <command name="vkBindImageMemory"/>
+            <command name="vkGetBufferMemoryRequirements"/>
+            <command name="vkGetImageMemoryRequirements"/>
+        </require>
+        <require comment="Sparse resource memory management API commands">
+            <type name="VkBindSparseInfo"/>
+            <type name="VkImageAspectFlagBits"/>
+            <type name="VkImageAspectFlags"/>
+            <type name="VkImageSubresource"/>
+            <type name="VkSparseBufferMemoryBindInfo"/>
+            <type name="VkSparseImageFormatFlagBits"/>
+            <type name="VkSparseImageFormatFlags"/>
+            <type name="VkSparseImageFormatProperties"/>
+            <type name="VkSparseImageMemoryBind"/>
+            <type name="VkSparseImageMemoryBindInfo"/>
+            <type name="VkSparseImageMemoryRequirements"/>
+            <type name="VkSparseImageOpaqueMemoryBindInfo"/>
+            <type name="VkSparseMemoryBind"/>
+            <type name="VkSparseMemoryBindFlagBits"/>
+            <type name="VkSparseMemoryBindFlags"/>
+            <command name="vkGetImageSparseMemoryRequirements"/>
+            <command name="vkGetPhysicalDeviceSparseImageFormatProperties"/>
+            <command name="vkQueueBindSparse"/>
+        </require>
+        <require comment="Fence commands">
+            <type name="VkFence"/>
+            <type name="VkFenceCreateFlagBits"/>
+            <type name="VkFenceCreateFlags"/>
+            <type name="VkFenceCreateInfo"/>
+            <command name="vkCreateFence"/>
+            <command name="vkDestroyFence"/>
+            <command name="vkResetFences"/>
+            <command name="vkGetFenceStatus"/>
+            <command name="vkWaitForFences"/>
+        </require>
+        <require comment="Queue semaphore commands">
+            <type name="VkSemaphore"/>
+            <type name="VkSemaphoreCreateFlags" comment="Will add VkSemaphoreCreateFlagBits when bits are defined in the future"/>
+            <type name="VkSemaphoreCreateInfo"/>
+            <command name="vkCreateSemaphore"/>
+            <command name="vkDestroySemaphore"/>
+        </require>
+        <require comment="Event commands">
+            <type name="VkEvent"/>
+            <type name="VkEventCreateFlags"/>
+            <type name="VkEventCreateFlagBits"/>
+            <type name="VkEventCreateInfo"/>
+            <command name="vkCreateEvent"/>
+            <command name="vkDestroyEvent"/>
+            <command name="vkGetEventStatus"/>
+            <command name="vkSetEvent"/>
+            <command name="vkResetEvent"/>
+        </require>
+        <require comment="Query commands">
+            <type name="VkQueryPipelineStatisticFlagBits"/>
+            <type name="VkQueryPipelineStatisticFlags"/>
+            <type name="VkQueryPool"/>
+            <type name="VkQueryPoolCreateFlags" comment="Will add VkQueryPoolCreateFlagBits when bits are defined in the future"/>
+            <type name="VkQueryPoolCreateInfo"/>
+            <type name="VkQueryResultFlagBits"/>
+            <type name="VkQueryResultFlags"/>
+            <type name="VkQueryType"/>
+            <command name="vkCreateQueryPool"/>
+            <command name="vkDestroyQueryPool"/>
+            <command name="vkGetQueryPoolResults"/>
+        </require>
+        <require comment="Buffer commands">
+            <type name="VkBuffer"/>
+            <type name="VkBufferCreateFlagBits"/>
+            <type name="VkBufferCreateFlags"/>
+            <type name="VkBufferCreateInfo"/>
+            <type name="VkBufferUsageFlagBits"/>
+            <type name="VkBufferUsageFlags"/>
+            <type name="VkSharingMode"/>
+            <command name="vkCreateBuffer"/>
+            <command name="vkDestroyBuffer"/>
+        </require>
+        <require comment="Buffer view commands">
+            <type name="VkBufferView"/>
+            <type name="VkBufferViewCreateFlags" comment="Will add VkBufferViewFlagBits when bits are defined in the future"/>
+            <type name="VkBufferViewCreateInfo"/>
+            <command name="vkCreateBufferView"/>
+            <command name="vkDestroyBufferView"/>
+        </require>
+        <require comment="Image commands">
+            <type name="VkImage"/>
+            <type name="VkImageCreateInfo"/>
+            <type name="VkImageLayout"/>
+            <type name="VkSubresourceLayout"/>
+            <command name="vkCreateImage"/>
+            <command name="vkDestroyImage"/>
+            <command name="vkGetImageSubresourceLayout"/>
+        </require>
+        <require comment="Image view commands">
+            <type name="VkComponentMapping"/>
+            <type name="VkComponentSwizzle"/>
+            <type name="VkImageSubresourceRange"/>
+            <type name="VkImageView"/>
+            <type name="VkImageViewCreateFlagBits"/>
+            <type name="VkImageViewCreateFlags"/>
+            <type name="VkImageViewCreateInfo"/>
+            <type name="VkImageViewType"/>
+            <command name="vkCreateImageView"/>
+            <command name="vkDestroyImageView"/>
+        </require>
+        <require comment="Shader commands">
+            <type name="VkShaderModule"/>
+            <type name="VkShaderModuleCreateFlags"/>
+            <type name="VkShaderModuleCreateInfo"/>
+            <command name="vkCreateShaderModule"/>
+            <command name="vkDestroyShaderModule"/>
+        </require>
+        <require comment="Pipeline Cache commands">
+            <type name="VkPipelineCache"/>
+            <type name="VkPipelineCacheCreateFlags" comment="VkPipelineCacheCreateFlagBits was added later"/>
+            <type name="VkPipelineCacheCreateInfo"/>
+            <command name="vkCreatePipelineCache"/>
+            <command name="vkDestroyPipelineCache"/>
+            <command name="vkGetPipelineCacheData"/>
+            <command name="vkMergePipelineCaches"/>
+        </require>
+        <require comment="Pipeline commands">
+            <type name="VkBlendFactor"/>
+            <type name="VkBlendOp"/>
+            <type name="VkColorComponentFlagBits"/>
+            <type name="VkColorComponentFlags"/>
+            <type name="VkCompareOp"/>
+            <type name="VkComputePipelineCreateInfo"/>
+            <type name="VkCullModeFlagBits"/>
+            <type name="VkCullModeFlags"/>
+            <type name="VkDynamicState"/>
+            <type name="VkFrontFace"/>
+            <type name="VkGraphicsPipelineCreateInfo"/>
+            <type name="VkLogicOp"/>
+            <type name="VkPipeline"/>
+            <type name="VkPipelineColorBlendAttachmentState"/>
+            <type name="VkPipelineColorBlendStateCreateFlags" comment="Will add VkPipeline*StateFlagBits when bits are defined in the future"/>
+            <type name="VkPipelineColorBlendStateCreateInfo"/>
+            <type name="VkPipelineCreateFlagBits"/>
+            <type name="VkPipelineCreateFlags"/>
+            <type name="VkPipelineDepthStencilStateCreateFlags" comment="Will add VkPipeline*StateFlagBits when bits are defined in the future"/>
+            <type name="VkPipelineDepthStencilStateCreateInfo"/>
+            <type name="VkPipelineDynamicStateCreateFlags" comment="Will add VkPipeline*StateFlagBits when bits are defined in the future"/>
+            <type name="VkPipelineDynamicStateCreateInfo"/>
+            <type name="VkPipelineInputAssemblyStateCreateFlags" comment="Will add VkPipeline*StateFlagBits when bits are defined in the future"/>
+            <type name="VkPipelineInputAssemblyStateCreateInfo"/>
+            <type name="VkPipelineLayoutCreateFlags" comment="Will add VkPipelineLayoutCreateFlagBits when bits are defined in the future"/>
+            <type name="VkPipelineMultisampleStateCreateFlags" comment="Will add VkPipelineMultisampleStateCreateFlagBits when bits are defined in the future"/>
+            <type name="VkPipelineMultisampleStateCreateInfo"/>
+            <type name="VkPipelineRasterizationStateCreateFlags" comment="Will add VkPipelineRasterizationStateCreateFlagBits when bits are defined in the future"/>
+            <type name="VkPipelineRasterizationStateCreateInfo"/>
+            <type name="VkPipelineShaderStageCreateFlagBits"/>
+            <type name="VkPipelineShaderStageCreateFlags"/>
+            <type name="VkPipelineShaderStageCreateInfo"/>
+            <type name="VkPipelineTessellationStateCreateFlags" comment="Will add VkPipelineTessellationStateCreateFlagBits when bits are defined in the future"/>
+            <type name="VkPipelineTessellationStateCreateInfo"/>
+            <type name="VkPipelineVertexInputStateCreateFlags" comment="Will add VkPipelineVertexInputStateCreateFlagBits when bits are defined in the future"/>
+            <type name="VkPipelineVertexInputStateCreateInfo"/>
+            <type name="VkPipelineViewportStateCreateFlags" comment="Will add VkPipelineViewportStateCreateFlagBits when bits are defined in the future"/>
+            <type name="VkPipelineViewportStateCreateInfo"/>
+            <type name="VkPolygonMode"/>
+            <type name="VkPrimitiveTopology"/>
+            <type name="VkSampleMask"/>
+            <type name="VkShaderStageFlagBits"/>
+            <type name="VkShaderStageFlags"/>
+            <type name="VkSpecializationInfo"/>
+            <type name="VkSpecializationMapEntry"/>
+            <type name="VkStencilOp"/>
+            <type name="VkStencilOpState"/>
+            <type name="VkVertexInputAttributeDescription"/>
+            <type name="VkVertexInputBindingDescription"/>
+            <type name="VkVertexInputRate"/>
+            <type name="VkViewport"/>
+            <command name="vkCreateGraphicsPipelines"/>
+            <command name="vkCreateComputePipelines"/>
+            <command name="vkDestroyPipeline"/>
+        </require>
+        <require comment="Pipeline layout commands">
+            <type name="VkPipelineLayout"/>
+            <type name="VkPipelineLayoutCreateInfo"/>
+            <type name="VkPushConstantRange"/>
+            <command name="vkCreatePipelineLayout"/>
+            <command name="vkDestroyPipelineLayout"/>
+        </require>
+        <require comment="Sampler commands">
+            <type name="VkBorderColor"/>
+            <type name="VkFilter"/>
+            <type name="VkSampler"/>
+            <type name="VkSamplerAddressMode"/>
+            <type name="VkSamplerCreateFlagBits"/>
+            <type name="VkSamplerCreateFlags"/>
+            <type name="VkSamplerCreateInfo"/>
+            <type name="VkSamplerMipmapMode"/>
+            <command name="vkCreateSampler"/>
+            <command name="vkDestroySampler"/>
+        </require>
+        <require comment="Descriptor set commands">
+            <type name="VkCopyDescriptorSet"/>
+            <type name="VkDescriptorBufferInfo"/>
+            <type name="VkDescriptorImageInfo"/>
+            <type name="VkDescriptorPool"/>
+            <type name="VkDescriptorPoolCreateFlagBits"/>
+            <type name="VkDescriptorPoolCreateFlags"/>
+            <type name="VkDescriptorPoolCreateInfo"/>
+            <type name="VkDescriptorPoolResetFlags"/>
+            <type name="VkDescriptorPoolSize"/>
+            <type name="VkDescriptorSet"/>
+            <type name="VkDescriptorSetAllocateInfo"/>
+            <type name="VkDescriptorSetLayout"/>
+            <type name="VkDescriptorSetLayoutBinding"/>
+            <type name="VkDescriptorSetLayoutCreateFlagBits"/>
+            <type name="VkDescriptorSetLayoutCreateFlags"/>
+            <type name="VkDescriptorSetLayoutCreateInfo"/>
+            <type name="VkDescriptorType"/>
+            <type name="VkWriteDescriptorSet"/>
+            <command name="vkCreateDescriptorSetLayout"/>
+            <command name="vkDestroyDescriptorSetLayout"/>
+            <command name="vkCreateDescriptorPool"/>
+            <command name="vkDestroyDescriptorPool"/>
+            <command name="vkResetDescriptorPool"/>
+            <command name="vkAllocateDescriptorSets"/>
+            <command name="vkFreeDescriptorSets"/>
+            <command name="vkUpdateDescriptorSets"/>
+        </require>
+        <require comment="Pass commands">
+            <type name="VkAccessFlagBits"/>
+            <type name="VkAccessFlags"/>
+            <type name="VkAttachmentDescription"/>
+            <type name="VkAttachmentDescriptionFlagBits"/>
+            <type name="VkAttachmentDescriptionFlags"/>
+            <type name="VkAttachmentLoadOp"/>
+            <type name="VkAttachmentReference"/>
+            <type name="VkAttachmentStoreOp"/>
+            <type name="VkDependencyFlagBits"/>
+            <type name="VkDependencyFlags"/>
+            <type name="VkFramebuffer"/>
+            <type name="VkFramebufferCreateFlagBits"/>
+            <type name="VkFramebufferCreateFlags"/>
+            <type name="VkFramebufferCreateInfo"/>
+            <type name="VkPipelineBindPoint"/>
+            <type name="VkRenderPass"/>
+            <type name="VkRenderPassCreateFlagBits"/>
+            <type name="VkRenderPassCreateFlags"/>
+            <type name="VkRenderPassCreateInfo"/>
+            <type name="VkSubpassDependency"/>
+            <type name="VkSubpassDescription"/>
+            <type name="VkSubpassDescriptionFlagBits"/>
+            <type name="VkSubpassDescriptionFlags"/>
+            <command name="vkCreateFramebuffer"/>
+            <command name="vkDestroyFramebuffer"/>
+            <command name="vkCreateRenderPass"/>
+            <command name="vkDestroyRenderPass"/>
+            <command name="vkGetRenderAreaGranularity"/>
+        </require>
+        <require comment="Command pool commands">
+            <type name="VkCommandPool"/>
+            <type name="VkCommandPoolCreateFlagBits"/>
+            <type name="VkCommandPoolCreateFlags"/>
+            <type name="VkCommandPoolCreateInfo"/>
+            <type name="VkCommandPoolResetFlagBits"/>
+            <type name="VkCommandPoolResetFlags"/>
+            <command name="vkCreateCommandPool"/>
+            <command name="vkDestroyCommandPool"/>
+            <command name="vkResetCommandPool"/>
+        </require>
+        <require comment="Command buffer commands">
+            <type name="VkCommandBuffer"/>
+            <type name="VkCommandBufferAllocateInfo"/>
+            <type name="VkCommandBufferBeginInfo"/>
+            <type name="VkCommandBufferInheritanceInfo"/>
+            <type name="VkCommandBufferLevel"/>
+            <type name="VkCommandBufferResetFlagBits"/>
+            <type name="VkCommandBufferResetFlags"/>
+            <type name="VkCommandBufferUsageFlagBits"/>
+            <type name="VkCommandBufferUsageFlags"/>
+            <type name="VkQueryControlFlagBits"/>
+            <type name="VkQueryControlFlags"/>
+            <command name="vkAllocateCommandBuffers"/>
+            <command name="vkFreeCommandBuffers"/>
+            <command name="vkBeginCommandBuffer"/>
+            <command name="vkEndCommandBuffer"/>
+            <command name="vkResetCommandBuffer"/>
+        </require>
+        <require comment="Command buffer building commands">
+            <type name="VkBufferCopy"/>
+            <type name="VkBufferImageCopy"/>
+            <type name="VkClearAttachment"/>
+            <type name="VkClearColorValue"/>
+            <type name="VkClearDepthStencilValue"/>
+            <type name="VkClearRect"/>
+            <type name="VkClearValue"/>
+            <type name="VkImageBlit"/>
+            <type name="VkImageCopy"/>
+            <type name="VkImageResolve"/>
+            <type name="VkImageSubresourceLayers"/>
+            <type name="VkIndexType"/>
+            <type name="VkRenderPassBeginInfo"/>
+            <type name="VkStencilFaceFlagBits"/>
+            <type name="VkStencilFaceFlags"/>
+            <type name="VkSubpassContents"/>
+            <command name="vkCmdBindPipeline"/>
+            <command name="vkCmdSetViewport"/>
+            <command name="vkCmdSetScissor"/>
+            <command name="vkCmdSetLineWidth"/>
+            <command name="vkCmdSetDepthBias"/>
+            <command name="vkCmdSetBlendConstants"/>
+            <command name="vkCmdSetDepthBounds"/>
+            <command name="vkCmdSetStencilCompareMask"/>
+            <command name="vkCmdSetStencilWriteMask"/>
+            <command name="vkCmdSetStencilReference"/>
+            <command name="vkCmdBindDescriptorSets"/>
+            <command name="vkCmdBindIndexBuffer"/>
+            <command name="vkCmdBindVertexBuffers"/>
+            <command name="vkCmdDraw"/>
+            <command name="vkCmdDrawIndexed"/>
+            <command name="vkCmdDrawIndirect"/>
+            <command name="vkCmdDrawIndexedIndirect"/>
+            <command name="vkCmdDispatch"/>
+            <command name="vkCmdDispatchIndirect"/>
+            <command name="vkCmdCopyBuffer"/>
+            <command name="vkCmdCopyImage"/>
+            <command name="vkCmdBlitImage"/>
+            <command name="vkCmdCopyBufferToImage"/>
+            <command name="vkCmdCopyImageToBuffer"/>
+            <command name="vkCmdUpdateBuffer"/>
+            <command name="vkCmdFillBuffer"/>
+            <command name="vkCmdClearColorImage"/>
+            <command name="vkCmdClearDepthStencilImage"/>
+            <command name="vkCmdClearAttachments"/>
+            <command name="vkCmdResolveImage"/>
+            <command name="vkCmdSetEvent"/>
+            <command name="vkCmdResetEvent"/>
+            <command name="vkCmdWaitEvents"/>
+            <command name="vkCmdPipelineBarrier"/>
+            <command name="vkCmdBeginQuery"/>
+            <command name="vkCmdEndQuery"/>
+            <command name="vkCmdResetQueryPool"/>
+            <command name="vkCmdWriteTimestamp"/>
+            <command name="vkCmdCopyQueryPoolResults"/>
+            <command name="vkCmdPushConstants"/>
+            <command name="vkCmdBeginRenderPass"/>
+            <command name="vkCmdNextSubpass"/>
+            <command name="vkCmdEndRenderPass"/>
+            <command name="vkCmdExecuteCommands"/>
+        </require>
+    </feature>
+    <feature api="vulkan" name="VK_VERSION_1_1" number="1.1" comment="Vulkan 1.1 core API interface definitions.">
+        <require>
+            <type name="VK_API_VERSION_1_1"/>
+        </require>
+        <require comment="Device Initialization">
+            <command name="vkEnumerateInstanceVersion"/>
+        </require>
+        <require comment="Promoted from VK_KHR_relaxed_block_layout, which has no API"/>
+        <require comment="Promoted from VK_KHR_storage_buffer_storage_class, which has no API"/>
+        <require comment="Originally based on VK_KHR_subgroup (extension 94), but the actual enum block used was, incorrectly, that of extension 95">
+            <enum extends="VkStructureType" extnumber="95"  offset="0"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES"/>
+            <type                                       name="VkPhysicalDeviceSubgroupProperties"/>
+            <type                                       name="VkSubgroupFeatureFlags"/>
+            <type                                       name="VkSubgroupFeatureFlagBits"/>
+        </require>
+        <require comment="Promoted from VK_KHR_bind_memory2">
+            <command name="vkBindBufferMemory2"/>
+            <command name="vkBindImageMemory2"/>
+            <enum extends="VkStructureType" extnumber="158" offset="0"          name="VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO"/>
+            <enum extends="VkStructureType" extnumber="158" offset="1"          name="VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO"/>
+            <enum bitpos="10" extends="VkImageCreateFlagBits"                   name="VK_IMAGE_CREATE_ALIAS_BIT"/>
+            <type name="VkBindBufferMemoryInfo"/>
+            <type name="VkBindImageMemoryInfo"/>
+        </require>
+        <require comment="Promoted from VK_KHR_16bit_storage">
+            <enum extends="VkStructureType" extnumber="84"  offset="0"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES"/>
+            <type name="VkPhysicalDevice16BitStorageFeatures"/>
+        </require>
+        <require comment="Promoted from VK_KHR_dedicated_allocation">
+            <enum extends="VkStructureType" extnumber="128" offset="0"          name="VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS"/>
+            <enum extends="VkStructureType" extnumber="128" offset="1"          name="VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO"/>
+            <type name="VkMemoryDedicatedRequirements"/>
+            <type name="VkMemoryDedicatedAllocateInfo"/>
+        </require>
+        <require comment="Promoted from VK_KHR_device_group">
+            <enum extends="VkStructureType" extnumber="61"  offset="0"          name="VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO"/>
+            <comment>offset 1 reserved for the old VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHX enum</comment>
+            <comment>offset 2 reserved for the old VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHX enum</comment>
+            <enum extends="VkStructureType" extnumber="61"  offset="3"          name="VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO"/>
+            <enum extends="VkStructureType" extnumber="61"  offset="4"          name="VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO"/>
+            <enum extends="VkStructureType" extnumber="61"  offset="5"          name="VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO"/>
+            <enum extends="VkStructureType" extnumber="61"  offset="6"          name="VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO"/>
+            <type name="VkPeerMemoryFeatureFlags"/>
+            <type name="VkPeerMemoryFeatureFlagBits"/>
+            <type name="VkMemoryAllocateFlags"/>
+            <type name="VkMemoryAllocateFlagBits"/>
+            <type name="VkMemoryAllocateFlagsInfo"/>
+            <type name="VkDeviceGroupRenderPassBeginInfo"/>
+            <type name="VkDeviceGroupCommandBufferBeginInfo"/>
+            <type name="VkDeviceGroupSubmitInfo"/>
+            <type name="VkDeviceGroupBindSparseInfo"/>
+            <command name="vkGetDeviceGroupPeerMemoryFeatures"/>
+            <command name="vkCmdSetDeviceMask"/>
+            <command name="vkCmdDispatchBase"/>
+            <enum bitpos="3"  extends="VkPipelineCreateFlagBits"                name="VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT"/>
+            <enum bitpos="4"  extends="VkPipelineCreateFlagBits"                name="VK_PIPELINE_CREATE_DISPATCH_BASE_BIT"/>
+            <enum extends="VkPipelineCreateFlagBits"                            name="VK_PIPELINE_CREATE_DISPATCH_BASE" alias="VK_PIPELINE_CREATE_DISPATCH_BASE_BIT"/>
+            <enum bitpos="2"  extends="VkDependencyFlagBits"                    name="VK_DEPENDENCY_DEVICE_GROUP_BIT" comment="Dependency is across devices"/>
+        </require>
+        <require comment="Promoted from VK_KHR_device_group + VK_KHR_bind_memory2">
+            <enum extends="VkStructureType" extnumber="61"  offset="13"         name="VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO"/>
+            <enum extends="VkStructureType" extnumber="61"  offset="14"         name="VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO"/>
+            <type name="VkBindBufferMemoryDeviceGroupInfo"/>
+            <type name="VkBindImageMemoryDeviceGroupInfo"/>
+            <enum bitpos="6"  extends="VkImageCreateFlagBits"                   name="VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT" comment="Allows using VkBindImageMemoryDeviceGroupInfo::pSplitInstanceBindRegions when binding memory to the image"/>
+        </require>
+        <require comment="Promoted from VK_KHR_device_group_creation">
+            <enum extends="VkStructureType" extnumber="71"  offset="0"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES"/>
+            <enum extends="VkStructureType" extnumber="71"  offset="1"          name="VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO"/>
+            <enum name="VK_MAX_DEVICE_GROUP_SIZE"/>
+            <type name="VkPhysicalDeviceGroupProperties"/>
+            <type name="VkDeviceGroupDeviceCreateInfo"/>
+            <command name="vkEnumeratePhysicalDeviceGroups"/>
+            <enum bitpos="1"  extends="VkMemoryHeapFlagBits"                    name="VK_MEMORY_HEAP_MULTI_INSTANCE_BIT" comment="If set, heap allocations allocate multiple instances by default"/>
+        </require>
+        <require comment="Promoted from VK_KHR_get_memory_requirements2">
+            <enum extends="VkStructureType" extnumber="147" offset="0"          name="VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2"/>
+            <enum extends="VkStructureType" extnumber="147" offset="1"          name="VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2"/>
+            <enum extends="VkStructureType" extnumber="147" offset="2"          name="VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2"/>
+            <enum extends="VkStructureType" extnumber="147" offset="3"          name="VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2"/>
+            <enum extends="VkStructureType" extnumber="147" offset="4"          name="VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2"/>
+            <type name="VkBufferMemoryRequirementsInfo2"/>
+            <type name="VkImageMemoryRequirementsInfo2"/>
+            <type name="VkImageSparseMemoryRequirementsInfo2"/>
+            <type name="VkMemoryRequirements2"/>
+            <type name="VkSparseImageMemoryRequirements2"/>
+            <command name="vkGetImageMemoryRequirements2"/>
+            <command name="vkGetBufferMemoryRequirements2"/>
+            <command name="vkGetImageSparseMemoryRequirements2"/>
+        </require>
+        <require comment="Promoted from VK_KHR_get_physical_device_properties2">
+            <enum extends="VkStructureType" extnumber="60"  offset="0"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2"/>
+            <enum extends="VkStructureType" extnumber="60"  offset="1"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2"/>
+            <enum extends="VkStructureType" extnumber="60"  offset="2"          name="VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2"/>
+            <enum extends="VkStructureType" extnumber="60"  offset="3"          name="VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2"/>
+            <enum extends="VkStructureType" extnumber="60"  offset="4"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2"/>
+            <enum extends="VkStructureType" extnumber="60"  offset="5"          name="VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2"/>
+            <enum extends="VkStructureType" extnumber="60"  offset="6"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2"/>
+            <enum extends="VkStructureType" extnumber="60"  offset="7"          name="VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2"/>
+            <enum extends="VkStructureType" extnumber="60"  offset="8"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2"/>
+            <type name="VkPhysicalDeviceFeatures2"/>
+            <type name="VkPhysicalDeviceProperties2"/>
+            <type name="VkFormatProperties2"/>
+            <type name="VkImageFormatProperties2"/>
+            <type name="VkPhysicalDeviceImageFormatInfo2"/>
+            <type name="VkQueueFamilyProperties2"/>
+            <type name="VkPhysicalDeviceMemoryProperties2"/>
+            <type name="VkSparseImageFormatProperties2"/>
+            <type name="VkPhysicalDeviceSparseImageFormatInfo2"/>
+            <command name="vkGetPhysicalDeviceFeatures2"/>
+            <command name="vkGetPhysicalDeviceProperties2"/>
+            <command name="vkGetPhysicalDeviceFormatProperties2"/>
+            <command name="vkGetPhysicalDeviceImageFormatProperties2"/>
+            <command name="vkGetPhysicalDeviceQueueFamilyProperties2"/>
+            <command name="vkGetPhysicalDeviceMemoryProperties2"/>
+            <command name="vkGetPhysicalDeviceSparseImageFormatProperties2"/>
+        </require>
+        <require comment="Promoted from VK_KHR_maintenance1">
+            <enum extends="VkResult"        extnumber="70"  offset="0"  dir="-" name="VK_ERROR_OUT_OF_POOL_MEMORY"/>
+            <enum bitpos="14" extends="VkFormatFeatureFlagBits"                 name="VK_FORMAT_FEATURE_TRANSFER_SRC_BIT" comment="Format can be used as the source image of image transfer commands"/>
+            <enum bitpos="15" extends="VkFormatFeatureFlagBits"                 name="VK_FORMAT_FEATURE_TRANSFER_DST_BIT" comment="Format can be used as the destination image of image transfer commands"/>
+            <enum bitpos="5"  extends="VkImageCreateFlagBits"                   name="VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT" comment="The 3D image can be viewed as a 2D or 2D array image"/>
+            <command name="vkTrimCommandPool"/>
+            <comment>Additional dependent types / tokens extending enumerants, not explicitly mentioned</comment>
+            <type name="VkCommandPoolTrimFlags"/>
+        </require>
+        <require comment="Promoted from VK_KHR_maintenance2">
+            <enum bitpos="7"  extends="VkImageCreateFlagBits"                   name="VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT"/>
+            <enum bitpos="8"  extends="VkImageCreateFlagBits"                   name="VK_IMAGE_CREATE_EXTENDED_USAGE_BIT"/>
+            <enum extends="VkStructureType" extnumber="118" offset="0"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES"/>
+            <enum extends="VkStructureType" extnumber="118" offset="1"          name="VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO"/>
+            <enum extends="VkStructureType" extnumber="118" offset="2"          name="VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO"/>
+            <enum extends="VkStructureType" extnumber="118" offset="3"          name="VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO"/>
+            <enum extends="VkImageLayout"   extnumber="118" offset="0"          name="VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL"/>
+            <enum extends="VkImageLayout"   extnumber="118" offset="1"          name="VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL"/>
+            <type name="VkPhysicalDevicePointClippingProperties"/>
+            <type name="VkPointClippingBehavior"/>
+            <type name="VkRenderPassInputAttachmentAspectCreateInfo"/>
+            <type name="VkInputAttachmentAspectReference"/>
+            <type name="VkImageViewUsageCreateInfo"/>
+            <type name="VkTessellationDomainOrigin"/>
+            <type name="VkPipelineTessellationDomainOriginStateCreateInfo"/>
+        </require>
+        <require comment="Promoted from VK_KHR_multiview">
+            <enum extends="VkStructureType" extnumber="54"  offset="0"          name="VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO"/>
+            <enum extends="VkStructureType" extnumber="54"  offset="1"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES"/>
+            <enum extends="VkStructureType" extnumber="54"  offset="2"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES"/>
+            <enum bitpos="1"  extends="VkDependencyFlagBits"                    name="VK_DEPENDENCY_VIEW_LOCAL_BIT"/>
+            <type name="VkRenderPassMultiviewCreateInfo"/>
+            <type name="VkPhysicalDeviceMultiviewFeatures"/>
+            <type name="VkPhysicalDeviceMultiviewProperties"/>
+        </require>
+        <require comment="Promoted from VK_KHR_variable_pointers">
+            <enum extends="VkStructureType" extnumber="121" offset="0"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES"/>
+            <enum extends="VkStructureType"                                     name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES"/>
+            <type name="VkPhysicalDeviceVariablePointerFeatures"/>
+            <type name="VkPhysicalDeviceVariablePointersFeatures"/>
+        </require>
+        <require comment="Originally based on VK_KHR_protected_memory (extension 146), which was never published; thus the mystifying large value= numbers below. These are not aliased since they weren't actually promoted from an extension.">
+            <enum extends="VkStructureType" extnumber="146" offset="0"          name="VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO"/>
+            <enum extends="VkStructureType" extnumber="146" offset="1"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES"/>
+            <enum extends="VkStructureType" extnumber="146" offset="2"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES"/>
+            <enum extends="VkStructureType" extnumber="146" offset="3"          name="VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2"/>
+            <enum bitpos="4"  extends="VkQueueFlagBits"                         name="VK_QUEUE_PROTECTED_BIT" comment="Queues may support protected operations"/>
+            <enum bitpos="0"  extends="VkDeviceQueueCreateFlagBits"             name="VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT" comment="Queue is a protected-capable device queue"/>
+            <type name="VkDeviceQueueCreateFlagBits" comment="This is a temporary workaround for processors not recognizing that VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT above also requires this type"/>
+            <enum bitpos="5"  extends="VkMemoryPropertyFlagBits"                name="VK_MEMORY_PROPERTY_PROTECTED_BIT" comment="Memory is protected"/>
+            <enum bitpos="3"  extends="VkBufferCreateFlagBits"                  name="VK_BUFFER_CREATE_PROTECTED_BIT" comment="Buffer requires protected memory"/>
+            <enum bitpos="11" extends="VkImageCreateFlagBits"                   name="VK_IMAGE_CREATE_PROTECTED_BIT" comment="Image requires protected memory"/>
+            <enum bitpos="2"  extends="VkCommandPoolCreateFlagBits"             name="VK_COMMAND_POOL_CREATE_PROTECTED_BIT" comment="Command buffers allocated from pool are protected command buffers"/>
+            <type name="VkPhysicalDeviceProtectedMemoryFeatures"/>
+            <type name="VkPhysicalDeviceProtectedMemoryProperties"/>
+            <type name="VkDeviceQueueInfo2"/>
+            <type name="VkProtectedSubmitInfo"/>
+            <command name="vkGetDeviceQueue2"/>
+        </require>
+        <require comment="Promoted from VK_KHR_sampler_ycbcr_conversion">
+            <enum extends="VkStructureType" extnumber="157" offset="0"          name="VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO"/>
+            <enum extends="VkStructureType" extnumber="157" offset="1"          name="VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO"/>
+            <enum extends="VkStructureType" extnumber="157" offset="2"          name="VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO"/>
+            <enum extends="VkStructureType" extnumber="157" offset="3"          name="VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO"/>
+            <enum extends="VkStructureType" extnumber="157" offset="4"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES"/>
+            <enum extends="VkStructureType" extnumber="157" offset="5"          name="VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES"/>
+            <enum extends="VkObjectType"    extnumber="157" offset="0"          name="VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION"/>
+            <enum extends="VkFormat"        extnumber="157" offset="0"          name="VK_FORMAT_G8B8G8R8_422_UNORM"/>
+            <enum extends="VkFormat"        extnumber="157" offset="1"          name="VK_FORMAT_B8G8R8G8_422_UNORM"/>
+            <enum extends="VkFormat"        extnumber="157" offset="2"          name="VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM"/>
+            <enum extends="VkFormat"        extnumber="157" offset="3"          name="VK_FORMAT_G8_B8R8_2PLANE_420_UNORM"/>
+            <enum extends="VkFormat"        extnumber="157" offset="4"          name="VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM"/>
+            <enum extends="VkFormat"        extnumber="157" offset="5"          name="VK_FORMAT_G8_B8R8_2PLANE_422_UNORM"/>
+            <enum extends="VkFormat"        extnumber="157" offset="6"          name="VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM"/>
+            <enum extends="VkFormat"        extnumber="157" offset="7"          name="VK_FORMAT_R10X6_UNORM_PACK16"/>
+            <enum extends="VkFormat"        extnumber="157" offset="8"          name="VK_FORMAT_R10X6G10X6_UNORM_2PACK16"/>
+            <enum extends="VkFormat"        extnumber="157" offset="9"          name="VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16"/>
+            <enum extends="VkFormat"        extnumber="157" offset="10"         name="VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16"/>
+            <enum extends="VkFormat"        extnumber="157" offset="11"         name="VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16"/>
+            <enum extends="VkFormat"        extnumber="157" offset="12"         name="VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16"/>
+            <enum extends="VkFormat"        extnumber="157" offset="13"         name="VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16"/>
+            <enum extends="VkFormat"        extnumber="157" offset="14"         name="VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16"/>
+            <enum extends="VkFormat"        extnumber="157" offset="15"         name="VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16"/>
+            <enum extends="VkFormat"        extnumber="157" offset="16"         name="VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16"/>
+            <enum extends="VkFormat"        extnumber="157" offset="17"         name="VK_FORMAT_R12X4_UNORM_PACK16"/>
+            <enum extends="VkFormat"        extnumber="157" offset="18"         name="VK_FORMAT_R12X4G12X4_UNORM_2PACK16"/>
+            <enum extends="VkFormat"        extnumber="157" offset="19"         name="VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16"/>
+            <enum extends="VkFormat"        extnumber="157" offset="20"         name="VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16"/>
+            <enum extends="VkFormat"        extnumber="157" offset="21"         name="VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16"/>
+            <enum extends="VkFormat"        extnumber="157" offset="22"         name="VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16"/>
+            <enum extends="VkFormat"        extnumber="157" offset="23"         name="VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16"/>
+            <enum extends="VkFormat"        extnumber="157" offset="24"         name="VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16"/>
+            <enum extends="VkFormat"        extnumber="157" offset="25"         name="VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16"/>
+            <enum extends="VkFormat"        extnumber="157" offset="26"         name="VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16"/>
+            <enum extends="VkFormat"        extnumber="157" offset="27"         name="VK_FORMAT_G16B16G16R16_422_UNORM"/>
+            <enum extends="VkFormat"        extnumber="157" offset="28"         name="VK_FORMAT_B16G16R16G16_422_UNORM"/>
+            <enum extends="VkFormat"        extnumber="157" offset="29"         name="VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM"/>
+            <enum extends="VkFormat"        extnumber="157" offset="30"         name="VK_FORMAT_G16_B16R16_2PLANE_420_UNORM"/>
+            <enum extends="VkFormat"        extnumber="157" offset="31"         name="VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM"/>
+            <enum extends="VkFormat"        extnumber="157" offset="32"         name="VK_FORMAT_G16_B16R16_2PLANE_422_UNORM"/>
+            <enum extends="VkFormat"        extnumber="157" offset="33"         name="VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM"/>
+            <enum bitpos="4"  extends="VkImageAspectFlagBits"                   name="VK_IMAGE_ASPECT_PLANE_0_BIT"/>
+            <enum bitpos="5"  extends="VkImageAspectFlagBits"                   name="VK_IMAGE_ASPECT_PLANE_1_BIT"/>
+            <enum bitpos="6"  extends="VkImageAspectFlagBits"                   name="VK_IMAGE_ASPECT_PLANE_2_BIT"/>
+            <enum bitpos="9"  extends="VkImageCreateFlagBits"                   name="VK_IMAGE_CREATE_DISJOINT_BIT"/>
+            <enum bitpos="17" extends="VkFormatFeatureFlagBits"                 name="VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT" comment="Format can have midpoint rather than cosited chroma samples"/>
+            <enum bitpos="18" extends="VkFormatFeatureFlagBits"                 name="VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT" comment="Format can be used with linear filtering whilst color conversion is enabled"/>
+            <enum bitpos="19" extends="VkFormatFeatureFlagBits"                 name="VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT" comment="Format can have different chroma, min and mag filters"/>
+            <enum bitpos="20" extends="VkFormatFeatureFlagBits"                 name="VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT"/>
+            <enum bitpos="21" extends="VkFormatFeatureFlagBits"                 name="VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT"/>
+            <enum bitpos="22" extends="VkFormatFeatureFlagBits"                 name="VK_FORMAT_FEATURE_DISJOINT_BIT" comment="Format supports disjoint planes"/>
+            <enum bitpos="23" extends="VkFormatFeatureFlagBits"                 name="VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT" comment="Format can have cosited rather than midpoint chroma samples"/>
+            <type name="VkSamplerYcbcrConversionCreateInfo"/>
+            <type name="VkSamplerYcbcrConversionInfo"/>
+            <type name="VkBindImagePlaneMemoryInfo"/>
+            <type name="VkImagePlaneMemoryRequirementsInfo"/>
+            <type name="VkPhysicalDeviceSamplerYcbcrConversionFeatures"/>
+            <type name="VkSamplerYcbcrConversionImageFormatProperties"/>
+            <command name="vkCreateSamplerYcbcrConversion"/>
+            <command name="vkDestroySamplerYcbcrConversion"/>
+            <comment>Additional dependent types / tokens extending enumerants, not explicitly mentioned</comment>
+            <type name="VkSamplerYcbcrConversion"/>
+            <type name="VkSamplerYcbcrModelConversion"/>
+            <type name="VkSamplerYcbcrRange"/>
+            <type name="VkChromaLocation"/>
+        </require>
+        <require comment="Promoted from VK_KHR_descriptor_update_template">
+            <enum extends="VkStructureType" extnumber="86"  offset="0"          name="VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO"/>
+            <enum extends="VkObjectType"    extnumber="86"  offset="0"          name="VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE"/>
+            <command name="vkCreateDescriptorUpdateTemplate"/>
+            <command name="vkDestroyDescriptorUpdateTemplate"/>
+            <command name="vkUpdateDescriptorSetWithTemplate"/>
+            <type name="VkDescriptorUpdateTemplate"/>
+            <type name="VkDescriptorUpdateTemplateCreateFlags"/>
+            <type name="VkDescriptorUpdateTemplateType"/>
+            <type name="VkDescriptorUpdateTemplateEntry"/>
+            <type name="VkDescriptorUpdateTemplateCreateInfo"/>
+        </require>
+        <require comment="Promoted from VK_KHR_external_memory_capabilities">
+            <enum extends="VkStructureType" extnumber="72"  offset="0"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO"/>
+            <enum extends="VkStructureType" extnumber="72"  offset="1"          name="VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES"/>
+            <enum extends="VkStructureType" extnumber="72"  offset="2"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO"/>
+            <enum extends="VkStructureType" extnumber="72"  offset="3"          name="VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES"/>
+            <enum extends="VkStructureType" extnumber="72"  offset="4"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES"/>
+            <enum name="VK_LUID_SIZE"/>
+            <type name="VkExternalMemoryHandleTypeFlags"/>
+            <type name="VkExternalMemoryHandleTypeFlagBits"/>
+            <type name="VkExternalMemoryFeatureFlags"/>
+            <type name="VkExternalMemoryFeatureFlagBits"/>
+            <type name="VkExternalMemoryProperties"/>
+            <type name="VkPhysicalDeviceExternalImageFormatInfo"/>
+            <type name="VkExternalImageFormatProperties"/>
+            <type name="VkPhysicalDeviceExternalBufferInfo"/>
+            <type name="VkExternalBufferProperties"/>
+            <type name="VkPhysicalDeviceIDProperties"/>
+            <command name="vkGetPhysicalDeviceExternalBufferProperties"/>
+        </require>
+        <require comment="Promoted from VK_KHR_external_memory">
+            <enum extends="VkStructureType" extnumber="73"  offset="0"          name="VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO"/>
+            <enum extends="VkStructureType" extnumber="73"  offset="1"          name="VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO"/>
+            <enum extends="VkStructureType" extnumber="73"  offset="2"          name="VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO"/>
+            <enum extends="VkResult"        extnumber="73"  offset="3"  dir="-" name="VK_ERROR_INVALID_EXTERNAL_HANDLE"/>
+            <enum name="VK_QUEUE_FAMILY_EXTERNAL"/>
+            <type name="VkExternalMemoryImageCreateInfo"/>
+            <type name="VkExternalMemoryBufferCreateInfo"/>
+            <type name="VkExportMemoryAllocateInfo"/>
+        </require>
+        <require comment="Promoted from VK_KHR_external_fence_capabilities">
+            <enum extends="VkStructureType" extnumber="113" offset="0"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO"/>
+            <enum extends="VkStructureType" extnumber="113" offset="1"          name="VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES"/>
+            <type name="VkExternalFenceHandleTypeFlags"/>
+            <type name="VkExternalFenceHandleTypeFlagBits"/>
+            <type name="VkExternalFenceFeatureFlags"/>
+            <type name="VkExternalFenceFeatureFlagBits"/>
+            <type name="VkPhysicalDeviceExternalFenceInfo"/>
+            <type name="VkExternalFenceProperties"/>
+            <command name="vkGetPhysicalDeviceExternalFenceProperties"/>
+        </require>
+        <require comment="Promoted from VK_KHR_external_fence">
+            <enum extends="VkStructureType" extnumber="114" offset="0"          name="VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO"/>
+            <type name="VkFenceImportFlags"/>
+            <type name="VkFenceImportFlagBits"/>
+            <type name="VkExportFenceCreateInfo"/>
+        </require>
+        <require comment="Promoted from VK_KHR_external_semaphore">
+            <enum extends="VkStructureType" extnumber="78"  offset="0"          name="VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO"/>
+            <type name="VkSemaphoreImportFlags"/>
+            <type name="VkSemaphoreImportFlagBits"/>
+            <type name="VkExportSemaphoreCreateInfo"/>
+        </require>
+        <require comment="Promoted from VK_KHR_external_semaphore_capabilities">
+            <enum extends="VkStructureType" extnumber="77"  offset="0"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO"/>
+            <enum extends="VkStructureType" extnumber="77"  offset="1"          name="VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES"/>
+            <type name="VkExternalSemaphoreHandleTypeFlags"/>
+            <type name="VkExternalSemaphoreHandleTypeFlagBits"/>
+            <type name="VkExternalSemaphoreFeatureFlags"/>
+            <type name="VkExternalSemaphoreFeatureFlagBits"/>
+            <type name="VkPhysicalDeviceExternalSemaphoreInfo"/>
+            <type name="VkExternalSemaphoreProperties"/>
+            <command name="vkGetPhysicalDeviceExternalSemaphoreProperties"/>
+        </require>
+        <require comment="Promoted from VK_KHR_maintenance3">
+            <enum extends="VkStructureType" extnumber="169" offset="0"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES"/>
+            <enum extends="VkStructureType" extnumber="169" offset="1"          name="VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT"/>
+            <type name="VkPhysicalDeviceMaintenance3Properties"/>
+            <type name="VkDescriptorSetLayoutSupport"/>
+            <command name="vkGetDescriptorSetLayoutSupport"/>
+        </require>
+        <require comment="Promoted from VK_KHR_shader_draw_parameters, with a feature support query added">
+            <enum extends="VkStructureType" extnumber="64"  offset="0"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES"/>
+            <enum extends="VkStructureType"                                     name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES"/>
+            <type name="VkPhysicalDeviceShaderDrawParameterFeatures"/>
+            <type name="VkPhysicalDeviceShaderDrawParametersFeatures"/>
+        </require>
+    </feature>
+    <feature api="vulkan" name="VK_VERSION_1_2" number="1.2" comment="Vulkan 1.2 core API interface definitions.">
+        <require>
+            <type name="VK_API_VERSION_1_2"/>
+        </require>
+        <require>
+            <enum extends="VkStructureType" value="49" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES"/>
+            <enum extends="VkStructureType" value="50" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES"/>
+            <enum extends="VkStructureType" value="51" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES"/>
+            <enum extends="VkStructureType" value="52" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES"/>
+            <type name="VkPhysicalDeviceVulkan11Features"/>
+            <type name="VkPhysicalDeviceVulkan11Properties"/>
+            <type name="VkPhysicalDeviceVulkan12Features"/>
+            <type name="VkPhysicalDeviceVulkan12Properties"/>
+        </require>
+        <require comment="Promoted from VK_KHR_image_format_list (extension 148)">
+            <enum offset="0" extends="VkStructureType"  extnumber="148"         name="VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO"/>
+            <type name="VkImageFormatListCreateInfo"/>
+        </require>
+        <require comment="Promoted from VK_KHR_sampler_mirror_clamp_to_edge (extension 15)">
+            <enum value="4" extends="VkSamplerAddressMode"                      name="VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE" comment="No need to add an extnumber attribute, since this uses a core enum value"/>
+        </require>
+        <require comment="Promoted from VK_KHR_draw_indirect_count (extension 170)">
+            <command name="vkCmdDrawIndirectCount"/>
+            <command name="vkCmdDrawIndexedIndirectCount"/>
+        </require>
+        <require comment="Promoted from VK_KHR_create_renderpass2 (extension 110)">
+            <enum offset="0" extends="VkStructureType" extnumber="110"          name="VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2"/>
+            <enum offset="1" extends="VkStructureType" extnumber="110"          name="VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2"/>
+            <enum offset="2" extends="VkStructureType" extnumber="110"          name="VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2"/>
+            <enum offset="3" extends="VkStructureType" extnumber="110"          name="VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2"/>
+            <enum offset="4" extends="VkStructureType" extnumber="110"          name="VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2"/>
+            <enum offset="5" extends="VkStructureType" extnumber="110"          name="VK_STRUCTURE_TYPE_SUBPASS_BEGIN_INFO"/>
+            <enum offset="6" extends="VkStructureType" extnumber="110"          name="VK_STRUCTURE_TYPE_SUBPASS_END_INFO"/>
+            <command name="vkCreateRenderPass2"/>
+            <command name="vkCmdBeginRenderPass2"/>
+            <command name="vkCmdNextSubpass2"/>
+            <command name="vkCmdEndRenderPass2"/>
+            <type name="VkRenderPassCreateInfo2"/>
+            <type name="VkAttachmentDescription2"/>
+            <type name="VkAttachmentReference2"/>
+            <type name="VkSubpassDescription2"/>
+            <type name="VkSubpassDependency2"/>
+            <type name="VkSubpassBeginInfo"/>
+            <type name="VkSubpassEndInfo"/>
+        </require>
+        <require comment="Promoted from VK_KHR_8bit_storage (extension 178)">
+            <enum offset="0" extends="VkStructureType" extnumber="178"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES"/>
+            <type name="VkPhysicalDevice8BitStorageFeatures"/>
+        </require>
+        <require comment="Promoted from VK_KHR_driver_properties (extension 197)">
+            <enum offset="0" extends="VkStructureType" extnumber="197"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES"/>
+            <enum name="VK_MAX_DRIVER_NAME_SIZE"/>
+            <enum name="VK_MAX_DRIVER_INFO_SIZE"/>
+            <type name="VkDriverId"/>
+            <type name="VkConformanceVersion"/>
+            <type name="VkPhysicalDeviceDriverProperties"/>
+        </require>
+        <require comment="Promoted from VK_KHR_shader_atomic_int64 (extension 181)">
+            <enum offset="0" extends="VkStructureType" extnumber="181"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES"/>
+            <type name="VkPhysicalDeviceShaderAtomicInt64Features"/>
+        </require>
+        <require comment="Promoted from VK_KHR_shader_float16_int8 (extension 83)">
+            <enum offset="0" extends="VkStructureType" extnumber="83"           name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES"/>
+            <type name="VkPhysicalDeviceShaderFloat16Int8Features"/>
+        </require>
+        <require comment="Promoted from VK_KHR_shader_float_controls (extension 198)">
+            <enum offset="0" extends="VkStructureType" extnumber="198"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES"/>
+            <type name="VkPhysicalDeviceFloatControlsProperties"/>
+            <type name="VkShaderFloatControlsIndependence"/>
+        </require>
+        <require comment="Promoted from VK_EXT_descriptor_indexing (extension 162)">
+            <enum offset="0" extends="VkStructureType" extnumber="162"          name="VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO"/>
+            <enum offset="1" extends="VkStructureType" extnumber="162"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES"/>
+            <enum offset="2" extends="VkStructureType" extnumber="162"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES"/>
+            <enum offset="3" extends="VkStructureType" extnumber="162"          name="VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO"/>
+            <enum offset="4" extends="VkStructureType" extnumber="162"          name="VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT"/>
+            <enum bitpos="1" extends="VkDescriptorPoolCreateFlagBits"           name="VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT"/>
+            <enum bitpos="1" extends="VkDescriptorSetLayoutCreateFlagBits"      name="VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT"/>
+            <enum offset="0" dir="-" extends="VkResult" extnumber="162"         name="VK_ERROR_FRAGMENTATION"/>
+            <type name="VkDescriptorSetLayoutBindingFlagsCreateInfo"/>
+            <type name="VkPhysicalDeviceDescriptorIndexingFeatures"/>
+            <type name="VkPhysicalDeviceDescriptorIndexingProperties"/>
+            <type name="VkDescriptorSetVariableDescriptorCountAllocateInfo"/>
+            <type name="VkDescriptorSetVariableDescriptorCountLayoutSupport"/>
+            <type name="VkDescriptorBindingFlagBits"/>
+            <type name="VkDescriptorBindingFlags"/>
+        </require>
+        <require comment="Promoted from VK_KHR_depth_stencil_resolve (extension 200)">
+            <enum offset="0" extends="VkStructureType" extnumber="200"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES"/>
+            <enum offset="1" extends="VkStructureType" extnumber="200"          name="VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE"/>
+            <type name="VkSubpassDescriptionDepthStencilResolve"/>
+            <type name="VkPhysicalDeviceDepthStencilResolveProperties"/>
+            <type name="VkResolveModeFlagBits"/>
+            <type name="VkResolveModeFlags"/>
+        </require>
+        <require comment="Promoted from VK_EXT_scalar_block_layout (extension 222))">
+            <type                                                               name="VkPhysicalDeviceScalarBlockLayoutFeatures"/>
+            <enum offset="0" extends="VkStructureType" extnumber="222"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES"/>
+        </require>
+        <require comment="Promoted from VK_EXT_shader_viewport_index_layer, which has no API (extension 163)"/>
+        <require comment="Promoted from VK_EXT_separate_stencil_usage (extension 247)">
+            <enum offset="0" extends="VkStructureType" extnumber="247"          name="VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO"/>
+            <type name="VkImageStencilUsageCreateInfo"/>
+        </require>
+        <require comment="Promoted from VK_EXT_sampler_filter_minmax (extension 131)">
+            <enum offset="0" extends="VkStructureType" extnumber="131"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES"/>
+            <enum offset="1" extends="VkStructureType" extnumber="131"          name="VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO"/>
+            <enum bitpos="16" extends="VkFormatFeatureFlagBits"                 name="VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT" comment="Format can be used with min/max reduction filtering"/>
+            <type name="VkSamplerReductionMode"/>
+            <type name="VkSamplerReductionModeCreateInfo"/>
+            <type name="VkPhysicalDeviceSamplerFilterMinmaxProperties"/>
+        </require>
+        <require comment="Promoted from VK_KHR_vulkan_memory_model (extension 212)">
+            <enum offset="0" extends="VkStructureType" extnumber="212"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES"/>
+            <type name="VkPhysicalDeviceVulkanMemoryModelFeatures"/>
+        </require>
+        <require comment="Promoted from VK_KHR_imageless_framebuffer (extension 109)">
+            <type name="VkPhysicalDeviceImagelessFramebufferFeatures"/>
+            <type name="VkFramebufferAttachmentsCreateInfo"/>
+            <type name="VkFramebufferAttachmentImageInfo"/>
+            <type name="VkRenderPassAttachmentBeginInfo"/>
+            <enum offset="0" extends="VkStructureType" extnumber="109"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES"/>
+            <enum offset="1" extends="VkStructureType" extnumber="109"          name="VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO"/>
+            <enum offset="2" extends="VkStructureType" extnumber="109"          name="VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO"/>
+            <enum offset="3" extends="VkStructureType" extnumber="109"          name="VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO"/>
+            <enum bitpos="0" extends="VkFramebufferCreateFlagBits"              name="VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT"/>
+        </require>
+        <require comment="Promoted from VK_KHR_uniform_buffer_standard_layout (extension 254)">
+            <type name="VkPhysicalDeviceUniformBufferStandardLayoutFeatures"/>
+            <enum offset="0" extends="VkStructureType" extnumber="254"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES"/>
+        </require>
+        <require comment="Promoted from VK_KHR_shader_subgroup_extended_types (extension 176)">
+            <enum offset="0" extends="VkStructureType" extnumber="176"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES"/>
+            <type name="VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures"/>
+        </require>
+        <require comment="Promoted from VK_KHR_spirv_1_4 (extension 237)">
+        </require>
+        <require comment="Promoted from VK_KHR_separate_depth_stencil_layouts (extension 242)">
+            <enum offset="0" extends="VkStructureType" extnumber="242"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES"/>
+            <enum offset="1" extends="VkStructureType" extnumber="242"          name="VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT"/>
+            <enum offset="2" extends="VkStructureType" extnumber="242"          name="VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT"/>
+            <enum offset="0" extends="VkImageLayout"   extnumber="242"          name="VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL"/>
+            <enum offset="1" extends="VkImageLayout"   extnumber="242"          name="VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL"/>
+            <enum offset="2" extends="VkImageLayout"   extnumber="242"          name="VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL"/>
+            <enum offset="3" extends="VkImageLayout"   extnumber="242"          name="VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL"/>
+            <type name="VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures"/>
+            <type name="VkAttachmentReferenceStencilLayout"/>
+            <type name="VkAttachmentDescriptionStencilLayout"/>
+        </require>
+        <require comment="Promoted from VK_EXT_host_query_reset (extension 262)">
+            <enum offset="0" extends="VkStructureType" extnumber="262"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES"/>
+            <type name="VkPhysicalDeviceHostQueryResetFeatures"/>
+            <command name="vkResetQueryPool"/>
+        </require>
+        <require comment="Promoted from VK_KHR_timeline_semaphore (extension 208)">
+            <enum offset="0" extends="VkStructureType" extnumber="208"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES"/>
+            <enum offset="1" extends="VkStructureType" extnumber="208"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES"/>
+            <enum offset="2" extends="VkStructureType" extnumber="208"          name="VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO"/>
+            <enum offset="3" extends="VkStructureType" extnumber="208"          name="VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO"/>
+            <enum offset="4" extends="VkStructureType" extnumber="208"          name="VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO"/>
+            <enum offset="5" extends="VkStructureType" extnumber="208"          name="VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO"/>
+            <type name="VkSemaphoreType"/>
+            <type name="VkPhysicalDeviceTimelineSemaphoreFeatures"/>
+            <type name="VkPhysicalDeviceTimelineSemaphoreProperties"/>
+            <type name="VkSemaphoreTypeCreateInfo"/>
+            <type name="VkTimelineSemaphoreSubmitInfo"/>
+            <type name="VkSemaphoreWaitFlagBits"/>
+            <type name="VkSemaphoreWaitFlags"/>
+            <type name="VkSemaphoreWaitInfo"/>
+            <type name="VkSemaphoreSignalInfo"/>
+            <command name="vkGetSemaphoreCounterValue"/>
+            <command name="vkWaitSemaphores"/>
+            <command name="vkSignalSemaphore"/>
+        </require>
+        <require comment="Promoted from VK_KHR_buffer_device_address (extension 258)">
+            <enum offset="0" extends="VkStructureType" extnumber="258"          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES"/>
+            <enum offset="1" extends="VkStructureType" extnumber="245"          name="VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO"/>
+            <enum offset="2" extends="VkStructureType" extnumber="258"          name="VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO"/>
+            <enum offset="3" extends="VkStructureType" extnumber="258"          name="VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO"/>
+            <enum offset="4" extends="VkStructureType" extnumber="258"          name="VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO"/>
+            <enum bitpos="17" extends="VkBufferUsageFlagBits"                   name="VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT"/>
+            <enum bitpos="4"  extends="VkBufferCreateFlagBits"                  name="VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT"/>
+            <enum bitpos="1" extends="VkMemoryAllocateFlagBits"                 name="VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT"/>
+            <enum bitpos="2" extends="VkMemoryAllocateFlagBits"                 name="VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT"/>
+            <enum offset="0" dir="-" extends="VkResult" extnumber="258"         name="VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS"/>
+            <type name="VkPhysicalDeviceBufferDeviceAddressFeatures"/>
+            <type name="VkBufferDeviceAddressInfo"/>
+            <type name="VkBufferOpaqueCaptureAddressCreateInfo"/>
+            <type name="VkMemoryOpaqueCaptureAddressAllocateInfo"/>
+            <type name="VkDeviceMemoryOpaqueCaptureAddressInfo"/>
+            <command name="vkGetBufferDeviceAddress"/>
+            <command name="vkGetBufferOpaqueCaptureAddress"/>
+            <command name="vkGetDeviceMemoryOpaqueCaptureAddress"/>
+        </require>
+    </feature>
+
+    <extensions comment="Vulkan extension interface definitions">
+        <extension name="VK_KHR_surface" number="1" type="instance" author="KHR" contact="James Jones @cubanismo,Ian Elliott @ianelliottus" supported="vulkan">
+            <require>
+                <enum value="25"                                                name="VK_KHR_SURFACE_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_surface&quot;"                        name="VK_KHR_SURFACE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkResult" dir="-"                     name="VK_ERROR_SURFACE_LOST_KHR"/>
+                <enum offset="1" extends="VkResult" dir="-"                     name="VK_ERROR_NATIVE_WINDOW_IN_USE_KHR"/>
+                <enum offset="0" extends="VkObjectType"                         name="VK_OBJECT_TYPE_SURFACE_KHR"/>
+                <type name="VkSurfaceKHR"/>
+                <type name="VkSurfaceTransformFlagBitsKHR"/>
+                <type name="VkPresentModeKHR"/>
+                <type name="VkColorSpaceKHR"/>
+                <type name="VkCompositeAlphaFlagBitsKHR"/>
+                <type name="VkCompositeAlphaFlagsKHR"/>
+                <type name="VkSurfaceCapabilitiesKHR"/>
+                <type name="VkSurfaceFormatKHR"/>
+                <command name="vkDestroySurfaceKHR"/>
+                <command name="vkGetPhysicalDeviceSurfaceSupportKHR"/>
+                <command name="vkGetPhysicalDeviceSurfaceCapabilitiesKHR"/>
+                <command name="vkGetPhysicalDeviceSurfaceFormatsKHR"/>
+                <command name="vkGetPhysicalDeviceSurfacePresentModesKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_swapchain" number="2" type="device" requires="VK_KHR_surface" author="KHR" contact="James Jones @cubanismo,Ian Elliott @ianelliottus" supported="vulkan">
+            <require>
+                <enum value="70"                                                name="VK_KHR_SWAPCHAIN_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_swapchain&quot;"                      name="VK_KHR_SWAPCHAIN_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR"/>
+                <enum offset="1" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_PRESENT_INFO_KHR"/>
+                <enum offset="2" extends="VkImageLayout"                        name="VK_IMAGE_LAYOUT_PRESENT_SRC_KHR"/>
+                <enum offset="3" extends="VkResult"                             name="VK_SUBOPTIMAL_KHR"/>
+                <enum offset="4" extends="VkResult" dir="-"                     name="VK_ERROR_OUT_OF_DATE_KHR"/>
+                <enum offset="0" extends="VkObjectType"                         name="VK_OBJECT_TYPE_SWAPCHAIN_KHR"/>
+                <type name="VkSwapchainCreateFlagBitsKHR"/>
+                <type name="VkSwapchainCreateFlagsKHR"/>
+                <type name="VkSwapchainCreateInfoKHR"/>
+                <type name="VkSwapchainKHR"/>
+                <type name="VkPresentInfoKHR"/>
+                <command name="vkCreateSwapchainKHR"/>
+                <command name="vkDestroySwapchainKHR"/>
+                <command name="vkGetSwapchainImagesKHR"/>
+                <command name="vkAcquireNextImageKHR"/>
+                <command name="vkQueuePresentKHR"/>
+            </require>
+            <require feature="VK_VERSION_1_1">
+                <comment>This duplicates definitions in VK_KHR_device_group below</comment>
+                <enum extends="VkStructureType" extnumber="61"  offset="7"      name="VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR"/>
+                <enum extends="VkStructureType" extnumber="61"  offset="8"      name="VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR"/>
+                <enum extends="VkStructureType" extnumber="61"  offset="9"      name="VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR"/>
+                <enum extends="VkStructureType" extnumber="61"  offset="10"     name="VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR"/>
+                <enum extends="VkStructureType" extnumber="61"  offset="11"     name="VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR"/>
+                <enum extends="VkStructureType" extnumber="61"  offset="12"     name="VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR"/>
+                <enum bitpos="0" extends="VkSwapchainCreateFlagBitsKHR"         name="VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR" comment="Allow images with VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT"/>
+                <type name="VkImageSwapchainCreateInfoKHR"/>
+                <type name="VkBindImageMemorySwapchainInfoKHR"/>
+                <type name="VkAcquireNextImageInfoKHR"/>
+                <type name="VkDeviceGroupPresentModeFlagBitsKHR"/>
+                <type name="VkDeviceGroupPresentModeFlagsKHR"/>
+                <type name="VkDeviceGroupPresentCapabilitiesKHR"/>
+                <type name="VkDeviceGroupPresentInfoKHR"/>
+                <type name="VkDeviceGroupSwapchainCreateInfoKHR"/>
+                <command name="vkGetDeviceGroupPresentCapabilitiesKHR"/>
+                <command name="vkGetDeviceGroupSurfacePresentModesKHR"/>
+                <command name="vkGetPhysicalDevicePresentRectanglesKHR"/>
+                <command name="vkAcquireNextImage2KHR"/>
+                <enum bitpos="1" extends="VkSwapchainCreateFlagBitsKHR"         name="VK_SWAPCHAIN_CREATE_PROTECTED_BIT_KHR"     comment="Swapchain is protected"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_display" number="3" type="instance" requires="VK_KHR_surface" author="KHR" contact="James Jones @cubanismo,Norbert Nopper @FslNopper" supported="vulkan">
+            <require>
+                <enum value="23"                                                name="VK_KHR_DISPLAY_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_display&quot;"                        name="VK_KHR_DISPLAY_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR"/>
+                <enum offset="1" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR"/>
+                <enum offset="0" extends="VkObjectType"                         name="VK_OBJECT_TYPE_DISPLAY_KHR"/>
+                <enum offset="1" extends="VkObjectType"                         name="VK_OBJECT_TYPE_DISPLAY_MODE_KHR"/>
+                <type name="VkDisplayKHR"/>
+                <type name="VkDisplayModeCreateFlagsKHR"/>
+                <type name="VkDisplayModeCreateInfoKHR"/>
+                <type name="VkDisplayModeKHR"/>
+                <type name="VkDisplayModeParametersKHR"/>
+                <type name="VkDisplayModePropertiesKHR"/>
+                <type name="VkDisplayPlaneAlphaFlagBitsKHR"/>
+                <type name="VkDisplayPlaneAlphaFlagsKHR"/>
+                <type name="VkDisplayPlaneCapabilitiesKHR"/>
+                <type name="VkDisplayPlanePropertiesKHR"/>
+                <type name="VkDisplayPropertiesKHR"/>
+                <type name="VkDisplaySurfaceCreateFlagsKHR"/>
+                <type name="VkDisplaySurfaceCreateInfoKHR"/>
+                <type name="VkSurfaceTransformFlagsKHR"/>
+                <command name="vkGetPhysicalDeviceDisplayPropertiesKHR"/>
+                <command name="vkGetPhysicalDeviceDisplayPlanePropertiesKHR"/>
+                <command name="vkGetDisplayPlaneSupportedDisplaysKHR"/>
+                <command name="vkGetDisplayModePropertiesKHR"/>
+                <command name="vkCreateDisplayModeKHR"/>
+                <command name="vkGetDisplayPlaneCapabilitiesKHR"/>
+                <command name="vkCreateDisplayPlaneSurfaceKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_display_swapchain" number="4" type="device" requires="VK_KHR_swapchain,VK_KHR_display" author="KHR" contact="James Jones @cubanismo" supported="vulkan">
+            <require>
+                <enum value="10"                                                name="VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_display_swapchain&quot;"              name="VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR"/>
+                <enum offset="1" extends="VkResult" dir="-"                     name="VK_ERROR_INCOMPATIBLE_DISPLAY_KHR"/>
+                <type name="VkDisplayPresentInfoKHR"/>
+                <command name="vkCreateSharedSwapchainsKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_xlib_surface" number="5" type="instance" requires="VK_KHR_surface" platform="xlib" author="KHR" contact="Jesse Hall @critsec,Ian Elliott @ianelliottus" supported="vulkan">
+            <require>
+                <enum value="6"                                                 name="VK_KHR_XLIB_SURFACE_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_xlib_surface&quot;"                   name="VK_KHR_XLIB_SURFACE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR"/>
+                <type name="VkXlibSurfaceCreateFlagsKHR"/>
+                <type name="VkXlibSurfaceCreateInfoKHR"/>
+                <command name="vkCreateXlibSurfaceKHR"/>
+                <command name="vkGetPhysicalDeviceXlibPresentationSupportKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_xcb_surface" number="6" type="instance" requires="VK_KHR_surface" platform="xcb" author="KHR" contact="Jesse Hall @critsec,Ian Elliott @ianelliottus" supported="vulkan">
+            <require>
+                <enum value="6"                                                 name="VK_KHR_XCB_SURFACE_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_xcb_surface&quot;"                    name="VK_KHR_XCB_SURFACE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR"/>
+                <type name="VkXcbSurfaceCreateFlagsKHR"/>
+                <type name="VkXcbSurfaceCreateInfoKHR"/>
+                <command name="vkCreateXcbSurfaceKHR"/>
+                <command name="vkGetPhysicalDeviceXcbPresentationSupportKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_wayland_surface" number="7" type="instance" requires="VK_KHR_surface" platform="wayland" author="KHR" contact="Jesse Hall @critsec,Ian Elliott @ianelliottus" supported="vulkan">
+            <require>
+                <enum value="6"                                                 name="VK_KHR_WAYLAND_SURFACE_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_wayland_surface&quot;"                name="VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR"/>
+                <type name="VkWaylandSurfaceCreateFlagsKHR"/>
+                <type name="VkWaylandSurfaceCreateInfoKHR"/>
+                <command name="vkCreateWaylandSurfaceKHR"/>
+                <command name="vkGetPhysicalDeviceWaylandPresentationSupportKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_mir_surface" number="8" type="instance" requires="VK_KHR_surface" author="KHR" supported="disabled" comment="Extension permanently disabled. Extension number should not be reused">
+            <require>
+                <enum value="4"                                                 name="VK_KHR_MIR_SURFACE_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_mir_surface&quot;"                    name="VK_KHR_MIR_SURFACE_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_android_surface" number="9" type="instance" requires="VK_KHR_surface" platform="android" author="KHR" contact="Jesse Hall @critsec" supported="vulkan">
+            <require>
+                <enum value="6"                                                 name="VK_KHR_ANDROID_SURFACE_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_android_surface&quot;"                name="VK_KHR_ANDROID_SURFACE_EXTENSION_NAME"/>
+                <type name="ANativeWindow"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR"/>
+                <type name="VkAndroidSurfaceCreateFlagsKHR"/>
+                <type name="VkAndroidSurfaceCreateInfoKHR"/>
+                <command name="vkCreateAndroidSurfaceKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_win32_surface" number="10" type="instance" requires="VK_KHR_surface" platform="win32" author="KHR" contact="Jesse Hall @critsec,Ian Elliott @ianelliottus" supported="vulkan">
+            <require>
+                <enum value="6"                                                 name="VK_KHR_WIN32_SURFACE_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_win32_surface&quot;"                  name="VK_KHR_WIN32_SURFACE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR"/>
+                <type name="VkWin32SurfaceCreateFlagsKHR"/>
+                <type name="VkWin32SurfaceCreateInfoKHR"/>
+                <command name="vkCreateWin32SurfaceKHR"/>
+                <command name="vkGetPhysicalDeviceWin32PresentationSupportKHR"/>
+            </require>
+        </extension>
+        <!-- TODO(liyl): spec version 8 has some types that are not supported yet. -->
+        <extension name="VK_ANDROID_native_buffer" number="11" type="device" author="ANDROID" platform="android" contact="Jesse Hall @critsec" supported="vulkan">
+            <require>
+                <enum value="6"                                                 name="VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION"/>
+                <enum value="11"                                                name="VK_ANDROID_NATIVE_BUFFER_NUMBER"/>
+                <enum value="&quot;VK_ANDROID_native_buffer&quot;"              name="VK_ANDROID_NATIVE_BUFFER_EXTENSION_NAME"/>
+                <enum                                                           name="VK_ANDROID_NATIVE_BUFFER_NAME" alias="VK_ANDROID_NATIVE_BUFFER_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID"/>
+                <type name="VkNativeBufferANDROID"/>
+                <command name="vkGetSwapchainGrallocUsageANDROID"/>
+                <command name="vkAcquireImageANDROID"/>
+                <command name="vkQueueSignalReleaseImageANDROID"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_debug_report" number="12" type="instance" author="GOOGLE" contact="Courtney Goeltzenleuchter @courtney-g" specialuse="debugging" supported="vulkan" deprecatedby="VK_EXT_debug_utils">
+            <require>
+                <enum value="10"                                                name="VK_EXT_DEBUG_REPORT_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_debug_report&quot;"                   name="VK_EXT_DEBUG_REPORT_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT"/>
+                <enum alias="VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT" extends="VkStructureType" name="VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT" comment="Backwards-compatible alias containing a typo"/>
+                <enum offset="1" extends="VkResult" dir="-"                     name="VK_ERROR_VALIDATION_FAILED_EXT"/>
+                <enum offset="0" extends="VkObjectType"                         name="VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT"/>
+                <type name="VkDebugReportCallbackEXT"/>
+                <type name="PFN_vkDebugReportCallbackEXT"/>
+                <type name="VkDebugReportFlagBitsEXT"/>
+                <type name="VkDebugReportFlagsEXT"/>
+                <type name="VkDebugReportObjectTypeEXT"/>
+                <type name="VkDebugReportCallbackCreateInfoEXT"/>
+                <command name="vkCreateDebugReportCallbackEXT"/>
+                <command name="vkDestroyDebugReportCallbackEXT"/>
+                <command name="vkDebugReportMessageEXT"/>
+            </require>
+            <require feature="VK_VERSION_1_1">
+                <comment>This duplicates definitions in other extensions, below</comment>
+                <enum extends="VkDebugReportObjectTypeEXT" extnumber="157" offset="0"  name="VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT"/>
+                <enum extends="VkDebugReportObjectTypeEXT" extnumber="86"  offset="0"  name="VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_glsl_shader" number="13" type="device" author="NV" contact="Piers Daniell @pdaniell-nv" supported="vulkan" deprecatedby="">
+            <require>
+                <enum value="1"                                                 name="VK_NV_GLSL_SHADER_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_glsl_shader&quot;"                     name="VK_NV_GLSL_SHADER_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkResult" dir="-"                     name="VK_ERROR_INVALID_SHADER_NV"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_depth_range_unrestricted" type="device" number="14" author="NV" contact="Piers Daniell @pdaniell-nv" supported="vulkan">
+            <require>
+                <enum value="1"                                                 name="VK_EXT_DEPTH_RANGE_UNRESTRICTED_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_depth_range_unrestricted&quot;"       name="VK_EXT_DEPTH_RANGE_UNRESTRICTED_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_sampler_mirror_clamp_to_edge" type="device" number="15" author="KHR" contact="Tobias Hector @tobski" supported="vulkan" promotedto="VK_VERSION_1_2">
+            <require>
+                <enum value="3"                                                 name="VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_sampler_mirror_clamp_to_edge&quot;"   name="VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME"/>
+                <enum value="4" extends="VkSamplerAddressMode"                  name="VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE" comment="Note that this defines what was previously a core enum, and so uses the 'value' attribute rather than 'offset', and does not have a suffix. This is a special case, and should not be repeated"/>
+                <enum           extends="VkSamplerAddressMode"                  name="VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE_KHR" alias="VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE" comment="Alias introduced for consistency with extension suffixing rules"/>
+            </require>
+        </extension>
+        <extension name="VK_IMG_filter_cubic" number="16" type="device" author="IMG" contact="Tobias Hector @tobski" supported="vulkan">
+            <require>
+                <enum value="1"                                                 name="VK_IMG_FILTER_CUBIC_SPEC_VERSION"/>
+                <enum value="&quot;VK_IMG_filter_cubic&quot;"                   name="VK_IMG_FILTER_CUBIC_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkFilter"                             name="VK_FILTER_CUBIC_IMG"/>
+                <enum bitpos="13" extends="VkFormatFeatureFlagBits"             name="VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG" comment="Format can be filtered with VK_FILTER_CUBIC_IMG when being sampled"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_17" number="17" author="AMD" contact="Daniel Rakos @drakos-amd" supported="disabled">
+            <require>
+                <enum value="0"                                                 name="VK_AMD_EXTENSION_17_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_17&quot;"                   name="VK_AMD_EXTENSION_17_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_18" number="18" author="AMD" contact="Daniel Rakos @drakos-amd" supported="disabled">
+            <require>
+                <enum value="0"                                                 name="VK_AMD_EXTENSION_18_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_18&quot;"                   name="VK_AMD_EXTENSION_18_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_rasterization_order" number="19" type="device" author="AMD" contact="Daniel Rakos @drakos-amd" supported="vulkan">
+            <require>
+                <enum value="1"                                                 name="VK_AMD_RASTERIZATION_ORDER_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_rasterization_order&quot;"            name="VK_AMD_RASTERIZATION_ORDER_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD"/>
+                <type name="VkRasterizationOrderAMD"/>
+                <type name="VkPipelineRasterizationStateRasterizationOrderAMD"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_20" number="20" author="AMD" contact="Daniel Rakos @drakos-amd" supported="disabled">
+            <require>
+                <enum value="0"                                                 name="VK_AMD_EXTENSION_20_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_20&quot;"                   name="VK_AMD_EXTENSION_20_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_shader_trinary_minmax" number="21" type="device" author="AMD" contact="Qun Lin @linqun" supported="vulkan">
+            <require>
+                <enum value="1"                                                 name="VK_AMD_SHADER_TRINARY_MINMAX_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_shader_trinary_minmax&quot;"          name="VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_shader_explicit_vertex_parameter" number="22" type="device" author="AMD" contact="Qun Lin @linqun" supported="vulkan">
+            <require>
+                <enum value="1"                                                 name="VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_shader_explicit_vertex_parameter&quot;" name="VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_debug_marker" number="23" type="device" requires="VK_EXT_debug_report" author="Baldur Karlsson" contact="Baldur Karlsson @baldurk" specialuse="debugging" supported="vulkan" promotedto="VK_EXT_debug_utils">
+            <require>
+                <enum value="4"                                                 name="VK_EXT_DEBUG_MARKER_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_debug_marker&quot;"                   name="VK_EXT_DEBUG_MARKER_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT"/>
+                <enum offset="1" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT"/>
+                <enum offset="2" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT"/>
+                <type name="VkDebugReportObjectTypeEXT"/>
+                <type name="VkDebugMarkerObjectNameInfoEXT"/>
+                <type name="VkDebugMarkerObjectTagInfoEXT"/>
+                <type name="VkDebugMarkerMarkerInfoEXT"/>
+                <command name="vkDebugMarkerSetObjectTagEXT"/>
+                <command name="vkDebugMarkerSetObjectNameEXT"/>
+                <command name="vkCmdDebugMarkerBeginEXT"/>
+                <command name="vkCmdDebugMarkerEndEXT"/>
+                <command name="vkCmdDebugMarkerInsertEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_video_queue" number="24" type="device" requires="VK_KHR_get_physical_device_properties2,VK_KHR_sampler_ycbcr_conversion" author="KHR" contact="Tony Zlatinski @tzlatinski" provisional="true" platform="provisional" supported="vulkan">
+            <require>
+                <enum value="2"                                         name="VK_KHR_VIDEO_QUEUE_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_video_queue&quot;"            name="VK_KHR_VIDEO_QUEUE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_VIDEO_PROFILE_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="1" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_VIDEO_CAPABILITIES_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="2" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="3" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_VIDEO_GET_MEMORY_PROPERTIES_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="4" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_VIDEO_BIND_MEMORY_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="5" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_VIDEO_SESSION_CREATE_INFO_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="6" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="7" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_UPDATE_INFO_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="8" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_VIDEO_BEGIN_CODING_INFO_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="9" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_VIDEO_END_CODING_INFO_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="10" extends="VkStructureType"             name="VK_STRUCTURE_TYPE_VIDEO_CODING_CONTROL_INFO_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="11" extends="VkStructureType"             name="VK_STRUCTURE_TYPE_VIDEO_REFERENCE_SLOT_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="12" extends="VkStructureType"             name="VK_STRUCTURE_TYPE_VIDEO_QUEUE_FAMILY_PROPERTIES_2_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="13" extends="VkStructureType"             name="VK_STRUCTURE_TYPE_VIDEO_PROFILES_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="14" extends="VkStructureType"             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_FORMAT_INFO_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="15" extends="VkStructureType"             name="VK_STRUCTURE_TYPE_VIDEO_FORMAT_PROPERTIES_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+
+                <enum offset="0"  extends="VkObjectType"                name="VK_OBJECT_TYPE_VIDEO_SESSION_KHR"             comment="VkVideoSessionKHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="1"  extends="VkObjectType"                name="VK_OBJECT_TYPE_VIDEO_SESSION_PARAMETERS_KHR"  comment="VkVideoSessionParametersKHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+
+                <enum offset="0" extends="VkQueryType"                  name="VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum bitpos="4" extends="VkQueryResultFlagBits"        name="VK_QUERY_RESULT_WITH_STATUS_BIT_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+
+                <type name="VkVideoSessionKHR"/>
+                <type name="VkVideoSessionParametersKHR"/>
+
+                <type name="VkVideoCodecOperationFlagBitsKHR"/>
+                <type name="VkVideoCodecOperationFlagsKHR"/>
+                <type name="VkVideoChromaSubsamplingFlagBitsKHR"/>
+                <type name="VkVideoChromaSubsamplingFlagsKHR"/>
+                <type name="VkVideoComponentBitDepthFlagBitsKHR"/>
+                <type name="VkVideoComponentBitDepthFlagsKHR"/>
+                <type name="VkVideoCapabilityFlagBitsKHR"/>
+                <type name="VkVideoCapabilityFlagsKHR"/>
+                <type name="VkVideoSessionCreateFlagBitsKHR"/>
+                <type name="VkVideoSessionCreateFlagsKHR"/>
+                <type name="VkVideoBeginCodingFlagsKHR"/>
+                <type name="VkVideoEndCodingFlagsKHR"/>
+                <type name="VkVideoCodingControlFlagBitsKHR"/>
+                <type name="VkVideoCodingControlFlagsKHR"/>
+                <type name="VkVideoCodingQualityPresetFlagBitsKHR"/>
+                <type name="VkVideoCodingQualityPresetFlagsKHR"/>
+
+                <type name="VkQueryResultStatusKHR"/>
+
+                <type name="VkVideoQueueFamilyProperties2KHR"/>
+                <type name="VkVideoProfileKHR"/>
+                <type name="VkVideoProfilesKHR"/>
+                <type name="VkVideoCapabilitiesKHR"/>
+                <type name="VkPhysicalDeviceVideoFormatInfoKHR"/>
+                <type name="VkVideoFormatPropertiesKHR"/>
+                <type name="VkVideoPictureResourceKHR"/>
+                <type name="VkVideoReferenceSlotKHR"/>
+                <type name="VkVideoGetMemoryPropertiesKHR"/>
+                <type name="VkVideoBindMemoryKHR"/>
+                <type name="VkVideoSessionCreateInfoKHR"/>
+                <type name="VkVideoSessionParametersCreateInfoKHR"/>
+                <type name="VkVideoSessionParametersUpdateInfoKHR"/>
+                <type name="VkVideoBeginCodingInfoKHR"/>
+                <type name="VkVideoEndCodingInfoKHR"/>
+                <type name="VkVideoCodingControlInfoKHR"/>
+
+                <command name="vkGetPhysicalDeviceVideoCapabilitiesKHR"/>
+                <command name="vkGetPhysicalDeviceVideoFormatPropertiesKHR"/>
+
+                <command name="vkCreateVideoSessionKHR"/>
+                <command name="vkDestroyVideoSessionKHR"/>
+                <command name="vkGetVideoSessionMemoryRequirementsKHR"/>
+                <command name="vkBindVideoSessionMemoryKHR"/>
+                <command name="vkCreateVideoSessionParametersKHR"/>
+                <command name="vkUpdateVideoSessionParametersKHR"/>
+                <command name="vkDestroyVideoSessionParametersKHR"/>
+                <command name="vkCmdBeginVideoCodingKHR"/>
+                <command name="vkCmdEndVideoCodingKHR"/>
+                <command name="vkCmdControlVideoCodingKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_video_decode_queue" number="25" type="device" requires="VK_KHR_video_queue,VK_KHR_synchronization2" author="KHR" contact="[email protected]" provisional="true" platform="provisional" supported="vulkan">
+            <require>
+                <enum value="2"                                         name="VK_KHR_VIDEO_DECODE_QUEUE_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_video_decode_queue&quot;"     name="VK_KHR_VIDEO_DECODE_QUEUE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_VIDEO_DECODE_INFO_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum bitpos="5" extends="VkQueueFlagBits"              name="VK_QUEUE_VIDEO_DECODE_BIT_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum bitpos="26" extends="VkPipelineStageFlagBits2KHR" name="VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum bitpos="35" extends="VkAccessFlagBits2KHR"        name="VK_ACCESS_2_VIDEO_DECODE_READ_BIT_KHR" protect="VK_ENABLE_BETA_EXTENSIONS" />
+                <enum bitpos="36" extends="VkAccessFlagBits2KHR"        name="VK_ACCESS_2_VIDEO_DECODE_WRITE_BIT_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum bitpos="13" extends="VkBufferUsageFlagBits"       name="VK_BUFFER_USAGE_VIDEO_DECODE_SRC_BIT_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum bitpos="14" extends="VkBufferUsageFlagBits"       name="VK_BUFFER_USAGE_VIDEO_DECODE_DST_BIT_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum bitpos="10" extends="VkImageUsageFlagBits"        name="VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum bitpos="11" extends="VkImageUsageFlagBits"        name="VK_IMAGE_USAGE_VIDEO_DECODE_SRC_BIT_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum bitpos="12" extends="VkImageUsageFlagBits"        name="VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum bitpos="25" extends="VkFormatFeatureFlagBits"     name="VK_FORMAT_FEATURE_VIDEO_DECODE_OUTPUT_BIT_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum bitpos="26" extends="VkFormatFeatureFlagBits"     name="VK_FORMAT_FEATURE_VIDEO_DECODE_DPB_BIT_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="0" extends="VkImageLayout"                name="VK_IMAGE_LAYOUT_VIDEO_DECODE_DST_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="1" extends="VkImageLayout"                name="VK_IMAGE_LAYOUT_VIDEO_DECODE_SRC_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="2" extends="VkImageLayout"                name="VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+
+                <type name="VkVideoDecodeFlagBitsKHR"/>
+                <type name="VkVideoDecodeFlagsKHR"/>
+
+                <type name="VkVideoDecodeInfoKHR"/>
+                <command name="vkCmdDecodeVideoKHR"/>
+            </require>
+            <require extension="VK_KHR_format_feature_flags2">
+                <enum bitpos="25" extends="VkFormatFeatureFlagBits2KHR"     name="VK_FORMAT_FEATURE_2_VIDEO_DECODE_OUTPUT_BIT_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum bitpos="26" extends="VkFormatFeatureFlagBits2KHR"     name="VK_FORMAT_FEATURE_2_VIDEO_DECODE_DPB_BIT_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_gcn_shader" number="26" type="device" author="AMD" contact="Dominik Witczak @dominikwitczakamd" supported="vulkan">
+            <require>
+                <enum value="1"                                                 name="VK_AMD_GCN_SHADER_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_gcn_shader&quot;"                     name="VK_AMD_GCN_SHADER_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_dedicated_allocation" number="27" type="device" author="NV" contact="Jeff Bolz @jeffbolznv" supported="vulkan" deprecatedby="VK_KHR_dedicated_allocation">
+            <require>
+                <enum value="1"                                                 name="VK_NV_DEDICATED_ALLOCATION_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_dedicated_allocation&quot;"            name="VK_NV_DEDICATED_ALLOCATION_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV"/>
+                <enum offset="1" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV"/>
+                <enum offset="2" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV"/>
+                <type name="VkDedicatedAllocationImageCreateInfoNV"/>
+                <type name="VkDedicatedAllocationBufferCreateInfoNV"/>
+                <type name="VkDedicatedAllocationMemoryAllocateInfoNV"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_28" number="28" author="NV" contact="Piers Daniell @pdaniell-nv" supported="disabled">
+            <require>
+                <enum value="0"                                                 name="VK_EXT_EXTENSION_28_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_28&quot;"                   name="VK_EXT_EXTENSION_28_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_transform_feedback" number="29" type="device" author="NV" contact="Piers Daniell @pdaniell-nv" specialuse="glemulation,d3demulation,devtools" supported="vulkan" requires="VK_KHR_get_physical_device_properties2">
+            <require>
+                <enum value="1"                                                 name="VK_EXT_TRANSFORM_FEEDBACK_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_transform_feedback&quot;"             name="VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME"/>
+                <command name="vkCmdBindTransformFeedbackBuffersEXT"/>
+                <command name="vkCmdBeginTransformFeedbackEXT"/>
+                <command name="vkCmdEndTransformFeedbackEXT"/>
+                <command name="vkCmdBeginQueryIndexedEXT"/>
+                <command name="vkCmdEndQueryIndexedEXT"/>
+                <command name="vkCmdDrawIndirectByteCountEXT"/>
+
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT"/>
+                <enum offset="1" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT"/>
+                <enum offset="2" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT"/>
+
+                <enum offset="4" extends="VkQueryType"                          name="VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT"/>
+
+                <enum bitpos="11" extends="VkBufferUsageFlagBits"               name="VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT"/>
+                <enum bitpos="12" extends="VkBufferUsageFlagBits"               name="VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT"/>
+
+                <enum bitpos="25" extends="VkAccessFlagBits"                    name="VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXT"/>
+                <enum bitpos="26" extends="VkAccessFlagBits"                    name="VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT"/>
+                <enum bitpos="27" extends="VkAccessFlagBits"                    name="VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT"/>
+
+                <enum bitpos="24" extends="VkPipelineStageFlagBits"             name="VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT"/>
+
+                <type name="VkPhysicalDeviceTransformFeedbackFeaturesEXT"/>
+                <type name="VkPhysicalDeviceTransformFeedbackPropertiesEXT"/>
+                <type name="VkPipelineRasterizationStateStreamCreateInfoEXT"/>
+
+                <type name="VkPipelineRasterizationStateStreamCreateFlagsEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_NVX_binary_import" number="30" type="device" author="NVX" contact="Eric Werness @ewerness-nv,Liam Middlebrook @liam-middlebrook" supported="vulkan">
+            <require>
+                <enum value="1"                                                 name="VK_NVX_BINARY_IMPORT_SPEC_VERSION"/>
+                <enum value="&quot;VK_NVX_binary_import&quot;"                  name="VK_NVX_BINARY_IMPORT_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_CU_MODULE_CREATE_INFO_NVX"/>
+                <enum offset="1" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_CU_FUNCTION_CREATE_INFO_NVX"/>
+                <enum offset="2" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_CU_LAUNCH_INFO_NVX"/>
+                <enum offset="0" extends="VkObjectType"                         name="VK_OBJECT_TYPE_CU_MODULE_NVX"/>
+                <enum offset="1" extends="VkObjectType"                         name="VK_OBJECT_TYPE_CU_FUNCTION_NVX"/>
+                <enum offset="0" extends="VkDebugReportObjectTypeEXT"           name="VK_DEBUG_REPORT_OBJECT_TYPE_CU_MODULE_NVX_EXT"/>
+                <enum offset="1" extends="VkDebugReportObjectTypeEXT"           name="VK_DEBUG_REPORT_OBJECT_TYPE_CU_FUNCTION_NVX_EXT"/>
+                <type name="VkCuModuleNVX"/>
+                <type name="VkCuFunctionNVX"/>
+                <type name="VkCuModuleCreateInfoNVX"/>
+                <type name="VkCuFunctionCreateInfoNVX"/>
+                <type name="VkCuLaunchInfoNVX"/>
+                <command name="vkCreateCuModuleNVX"/>
+                <command name="vkCreateCuFunctionNVX"/>
+                <command name="vkDestroyCuModuleNVX"/>
+                <command name="vkDestroyCuFunctionNVX"/>
+                <command name="vkCmdCuLaunchKernelNVX"/>
+            </require>
+        </extension>
+        <extension name="VK_NVX_image_view_handle" number="31" type="device" author="NVX" contact="Eric Werness @ewerness-nv" supported="vulkan">
+            <require>
+                <enum value="2"                                                 name="VK_NVX_IMAGE_VIEW_HANDLE_SPEC_VERSION"/>
+                <enum value="&quot;VK_NVX_image_view_handle&quot;"              name="VK_NVX_IMAGE_VIEW_HANDLE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_IMAGE_VIEW_HANDLE_INFO_NVX"/>
+                <enum offset="1" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_IMAGE_VIEW_ADDRESS_PROPERTIES_NVX"/>
+                <type name="VkImageViewHandleInfoNVX"/>
+                <type name="VkImageViewAddressPropertiesNVX"/>
+                <command name="vkGetImageViewHandleNVX"/>
+                <command name="vkGetImageViewAddressNVX"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_32" number="32" author="AMD" contact="Daniel Rakos @drakos-amd" supported="disabled">
+            <require>
+                <enum value="0"                                                 name="VK_AMD_EXTENSION_32_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_32&quot;"                   name="VK_AMD_EXTENSION_32_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_33" number="33" author="AMD" contact="Daniel Rakos @drakos-amd" supported="disabled">
+            <require>
+                <enum value="0"                                                 name="VK_AMD_EXTENSION_33_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_33&quot;"                   name="VK_AMD_EXTENSION_33_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_draw_indirect_count" number="34" type="device" author="AMD" contact="Daniel Rakos @drakos-amd" supported="vulkan" promotedto="VK_KHR_draw_indirect_count">
+            <require>
+                <enum value="2"                                                 name="VK_AMD_DRAW_INDIRECT_COUNT_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_draw_indirect_count&quot;"            name="VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME"/>
+                <command name="vkCmdDrawIndirectCountAMD"/>
+                <command name="vkCmdDrawIndexedIndirectCountAMD"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_35" number="35" author="AMD" contact="Daniel Rakos @drakos-amd" supported="disabled">
+            <require>
+                <enum value="0"                                                 name="VK_AMD_EXTENSION_35_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_35&quot;"                   name="VK_AMD_EXTENSION_35_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_negative_viewport_height" number="36" type="device" author="AMD" contact="Matthaeus G. Chajdas @anteru" supported="vulkan" obsoletedby="VK_KHR_maintenance1">
+            <require>
+                <enum value="1"                                                 name="VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_negative_viewport_height&quot;"       name="VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_gpu_shader_half_float" number="37" type="device" author="AMD" contact="Dominik Witczak @dominikwitczakamd" supported="vulkan" deprecatedby="VK_KHR_shader_float16_int8">
+            <require>
+                <enum value="2"                                                 name="VK_AMD_GPU_SHADER_HALF_FLOAT_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_gpu_shader_half_float&quot;"          name="VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_shader_ballot" number="38" type="device" author="AMD" contact="Dominik Witczak @dominikwitczakamd" supported="vulkan">
+            <require>
+                <enum value="1"                                                 name="VK_AMD_SHADER_BALLOT_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_shader_ballot&quot;"                  name="VK_AMD_SHADER_BALLOT_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_video_encode_h264" number="39" type="device" requires="VK_KHR_video_encode_queue" author="KHR" contact="Ahmed Abdelkhalek @aabdelkh" provisional="true" platform="provisional" supported="vulkan">
+            <require>
+                <enum value="2"                                                 name="VK_EXT_VIDEO_ENCODE_H264_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_video_encode_h264&quot;"              name="VK_EXT_VIDEO_ENCODE_H264_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="1" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_CREATE_INFO_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="2" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="3" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="4" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_VCL_FRAME_INFO_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="5" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_DPB_SLOT_INFO_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="6" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_NALU_SLICE_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="7" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_EMIT_PICTURE_PARAMETERS_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="8" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum bitpos="16" extends="VkVideoCodecOperationFlagBitsKHR"    name="VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+
+                <type name="VkVideoEncodeH264CapabilityFlagBitsEXT"/>
+                <type name="VkVideoEncodeH264CapabilityFlagsEXT"/>
+                <type name="VkVideoEncodeH264InputModeFlagBitsEXT"/>
+                <type name="VkVideoEncodeH264InputModeFlagsEXT"/>
+                <type name="VkVideoEncodeH264OutputModeFlagBitsEXT"/>
+                <type name="VkVideoEncodeH264OutputModeFlagsEXT"/>
+                <type name="VkVideoEncodeH264CreateFlagBitsEXT"/>
+                <type name="VkVideoEncodeH264CreateFlagsEXT"/>
+                <type name="VkVideoEncodeH264CapabilitiesEXT"/>
+                <type name="VkVideoEncodeH264SessionCreateInfoEXT"/>
+                <type name="VkVideoEncodeH264SessionParametersCreateInfoEXT"/>
+                <type name="VkVideoEncodeH264SessionParametersAddInfoEXT"/>
+                <type name="VkVideoEncodeH264VclFrameInfoEXT"/>
+                <type name="VkVideoEncodeH264EmitPictureParametersEXT"/>
+                <type name="VkVideoEncodeH264DpbSlotInfoEXT"/>
+                <type name="VkVideoEncodeH264NaluSliceEXT"/>
+                <type name="VkVideoEncodeH264ProfileEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_video_encode_h265" number="40" type="device" requires="VK_KHR_video_encode_queue" author="KHR" contact="Ahmed Abdelkhalek @aabdelkh" provisional="true" platform="provisional" supported="vulkan">
+            <require>
+                <enum value="2"                                              name="VK_EXT_VIDEO_ENCODE_H265_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_video_encode_h265&quot;"           name="VK_EXT_VIDEO_ENCODE_H265_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                   name="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="1" extends="VkStructureType"                   name="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_CREATE_INFO_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="2" extends="VkStructureType"                   name="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="3" extends="VkStructureType"                   name="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="4" extends="VkStructureType"                   name="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_VCL_FRAME_INFO_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="5" extends="VkStructureType"                   name="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_DPB_SLOT_INFO_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="6" extends="VkStructureType"                   name="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_NALU_SLICE_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="7" extends="VkStructureType"                   name="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_EMIT_PICTURE_PARAMETERS_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="8" extends="VkStructureType"                   name="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="9" extends="VkStructureType"                   name="VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_REFERENCE_LISTS_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum bitpos="17" extends="VkVideoCodecOperationFlagBitsKHR" name="VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+
+                <type name="VkVideoEncodeH265CapabilityFlagsEXT"/>
+                <type name="VkVideoEncodeH265InputModeFlagBitsEXT"/>
+                <type name="VkVideoEncodeH265InputModeFlagsEXT"/>
+                <type name="VkVideoEncodeH265OutputModeFlagBitsEXT"/>
+                <type name="VkVideoEncodeH265OutputModeFlagsEXT"/>
+                <type name="VkVideoEncodeH265CreateFlagsEXT" comment="Will add VkVideoEncodeH265CreateFlagBitsEXT when bits are defined in the future"/>
+
+                <type name="VkVideoEncodeH265CtbSizeFlagBitsEXT"/>
+                <type name="VkVideoEncodeH265CtbSizeFlagsEXT"/>
+                <type name="VkVideoEncodeH265CapabilitiesEXT"/>
+                <type name="VkVideoEncodeH265SessionCreateInfoEXT"/>
+                <type name="VkVideoEncodeH265SessionParametersCreateInfoEXT"/>
+                <type name="VkVideoEncodeH265SessionParametersAddInfoEXT"/>
+                <type name="VkVideoEncodeH265VclFrameInfoEXT"/>
+                <type name="VkVideoEncodeH265EmitPictureParametersEXT"/>
+                <type name="VkVideoEncodeH265DpbSlotInfoEXT"/>
+                <type name="VkVideoEncodeH265NaluSliceEXT"/>
+                <type name="VkVideoEncodeH265ProfileEXT"/>
+                <type name="VkVideoEncodeH265ReferenceListsEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_video_decode_h264" number="41" type="device" requires="VK_KHR_video_decode_queue" author="KHR" contact="[email protected]" provisional="true" platform="provisional" supported="vulkan">
+            <require>
+                <enum value="3"                                              name="VK_EXT_VIDEO_DECODE_H264_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_video_decode_h264&quot;"           name="VK_EXT_VIDEO_DECODE_H264_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                   name="VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="1" extends="VkStructureType"                   name="VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_CREATE_INFO_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="2" extends="VkStructureType"                   name="VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PICTURE_INFO_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="3" extends="VkStructureType"                   name="VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_MVC_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="4" extends="VkStructureType"                   name="VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="5" extends="VkStructureType"                   name="VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="6" extends="VkStructureType"                   name="VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="7" extends="VkStructureType"                   name="VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum bitpos="0" extends="VkVideoCodecOperationFlagBitsKHR"  name="VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <type name="VkVideoDecodeH264PictureLayoutFlagBitsEXT"/>
+                <type name="VkVideoDecodeH264PictureLayoutFlagsEXT"/>
+                <type name="VkVideoDecodeH264CreateFlagsEXT"/>
+                <type name="VkVideoDecodeH264ProfileEXT"/>
+                <type name="VkVideoDecodeH264CapabilitiesEXT"/>
+                <type name="VkVideoDecodeH264SessionCreateInfoEXT"/>
+                <type name="VkVideoDecodeH264SessionParametersCreateInfoEXT"/>
+                <type name="VkVideoDecodeH264SessionParametersAddInfoEXT"/>
+                <type name="VkVideoDecodeH264PictureInfoEXT"/>
+                <type name="VkVideoDecodeH264MvcEXT"/>
+                <type name="VkVideoDecodeH264DpbSlotInfoEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_texture_gather_bias_lod" number="42" author="AMD" contact="Rex Xu @amdrexu" supported="vulkan" type="device" requires="VK_KHR_get_physical_device_properties2">
+            <require>
+                <enum value="1"                                                 name="VK_AMD_TEXTURE_GATHER_BIAS_LOD_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_texture_gather_bias_lod&quot;"        name="VK_AMD_TEXTURE_GATHER_BIAS_LOD_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD"/>
+                <type name="VkTextureLODGatherFormatPropertiesAMD"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_shader_info" number="43" author="AMD" contact="Jaakko Konttinen @jaakkoamd" supported="vulkan" specialuse="devtools" type="device">
+            <require>
+                <enum value="1"                                                 name="VK_AMD_SHADER_INFO_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_shader_info&quot;"                    name="VK_AMD_SHADER_INFO_EXTENSION_NAME"/>
+                <type name="VkShaderInfoTypeAMD"/>
+                <type name="VkShaderResourceUsageAMD"/>
+                <type name="VkShaderStatisticsInfoAMD"/>
+                <command name="vkGetShaderInfoAMD"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_44" number="44" author="AMD" contact="Daniel Rakos @drakos-amd" supported="disabled">
+            <require>
+                <enum value="0"                                                 name="VK_AMD_EXTENSION_44_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_44&quot;"                   name="VK_AMD_EXTENSION_44_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_dynamic_rendering" number="45" author="KHR" type="device" requires="VK_KHR_get_physical_device_properties2" contact="Tobias Hector @tobski" supported="vulkan">
+            <require>
+                <enum value="1"                                                 name="VK_KHR_DYNAMIC_RENDERING_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_dynamic_rendering&quot;"              name="VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME"/>
+                <command name="vkCmdBeginRenderingKHR"/>
+                <command name="vkCmdEndRenderingKHR"/>
+                <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_RENDERING_INFO_KHR"/>
+                <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO_KHR"/>
+                <enum offset="2" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO_KHR"/>
+                <enum offset="3" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR"/>
+                <enum offset="4" extends="VkStructureType" name="VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO_KHR"/>
+                <enum offset="0" extends="VkAttachmentStoreOp" extnumber="302" name="VK_ATTACHMENT_STORE_OP_NONE_KHR"/>
+                <type name="VkRenderingInfoKHR"/>
+                <type name="VkRenderingAttachmentInfoKHR"/>
+                <type name="VkPipelineRenderingCreateInfoKHR"/>
+                <type name="VkPhysicalDeviceDynamicRenderingFeaturesKHR"/>
+                <type name="VkCommandBufferInheritanceRenderingInfoKHR"/>
+                <type name="VkRenderingFlagsKHR"/>
+                <type name="VkRenderingFlagBitsKHR"/>
+            </require>
+            <require extension="VK_KHR_fragment_shading_rate">
+                <enum bitpos="21" extends="VkPipelineCreateFlagBits" name="VK_PIPELINE_RASTERIZATION_STATE_CREATE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR"/>
+                <enum offset="6" extends="VkStructureType" name="VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR"/>
+                <type name="VkRenderingFragmentShadingRateAttachmentInfoKHR"/>
+            </require>
+            <require extension="VK_EXT_fragment_density_map">
+                <enum bitpos="22" extends="VkPipelineCreateFlagBits" name="VK_PIPELINE_RASTERIZATION_STATE_CREATE_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT"/>
+                <enum offset="7" extends="VkStructureType" name="VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT"/>
+                <type name="VkRenderingFragmentDensityMapAttachmentInfoEXT"/>
+            </require>
+            <require extension="VK_AMD_mixed_attachment_samples">
+                <enum offset="8" extends="VkStructureType" name="VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD"/>
+                <type name="VkAttachmentSampleCountInfoAMD"/>
+            </require>
+            <require extension="VK_NV_framebuffer_mixed_samples">
+                <enum extends="VkStructureType" name="VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_NV" alias="VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD"/>
+                <type name="VkAttachmentSampleCountInfoNV"/>
+            </require>
+            <require extension="VK_NVX_multiview_per_view_attributes">
+                <enum offset="9" extends="VkStructureType" name="VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX"/>
+                <type name="VkMultiviewPerViewAttributesInfoNVX"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_46" number="46" author="AMD" contact="Daniel Rakos @drakos-amd" supported="disabled">
+            <require>
+                <enum value="0"                                                 name="VK_AMD_EXTENSION_46_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_46&quot;"                   name="VK_AMD_EXTENSION_46_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_shader_image_load_store_lod" number="47" author="AMD" contact="Dominik Witczak @dominikwitczakamd" supported="vulkan" type="device">
+            <require>
+                <enum value="1"                                                 name="VK_AMD_SHADER_IMAGE_LOAD_STORE_LOD_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_shader_image_load_store_lod&quot;"    name="VK_AMD_SHADER_IMAGE_LOAD_STORE_LOD_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_NVX_extension_48" number="48" author="NVX" contact="James Jones @cubanismo" supported="disabled">
+            <require>
+                <enum value="0"                                                 name="VK_NVX_EXTENSION_48_SPEC_VERSION"/>
+                <enum value="&quot;VK_NVX_extension_48&quot;"                   name="VK_NVX_EXTENSION_48_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_GOOGLE_extension_49" number="49" author="GOOGLE" contact="Jean-Francois Roy @jfroy" supported="disabled">
+            <require>
+                <enum value="0"                                                 name="VK_GOOGLE_EXTENSION_49_SPEC_VERSION"/>
+                <enum value="&quot;VK_GOOGLE_extension_49&quot;"                name="VK_GOOGLE_EXTENSION_49_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_GGP_stream_descriptor_surface" number="50" type="instance" requires="VK_KHR_surface" platform="ggp" author="GGP" contact="Jean-Francois Roy @jfroy" supported="vulkan">
+            <require>
+                <enum value="1"                                                 name="VK_GGP_STREAM_DESCRIPTOR_SURFACE_SPEC_VERSION"/>
+                <enum value="&quot;VK_GGP_stream_descriptor_surface&quot;"      name="VK_GGP_STREAM_DESCRIPTOR_SURFACE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_STREAM_DESCRIPTOR_SURFACE_CREATE_INFO_GGP"/>
+                <type name="VkStreamDescriptorSurfaceCreateFlagsGGP"/>
+                <type name="VkStreamDescriptorSurfaceCreateInfoGGP"/>
+                <command name="vkCreateStreamDescriptorSurfaceGGP"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_corner_sampled_image" number="51" author="NV" type="device" requires="VK_KHR_get_physical_device_properties2" contact="Daniel Koch @dgkoch" supported="vulkan">
+            <require>
+                <enum value="2"                                                 name="VK_NV_CORNER_SAMPLED_IMAGE_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_corner_sampled_image&quot;"            name="VK_NV_CORNER_SAMPLED_IMAGE_EXTENSION_NAME"/>
+                <enum bitpos="13" extends="VkImageCreateFlagBits"               name="VK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NV"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV"/>
+                <type name="VkPhysicalDeviceCornerSampledImageFeaturesNV"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_extension_52" number="52" author="NV" contact="Daniel Koch @dgkoch" supported="disabled">
+            <require>
+                <enum value="0"                                                 name="VK_NV_EXTENSION_52_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_extension_52&quot;"                    name="VK_NV_EXTENSION_52_EXTENSION_NAME"/>
+                <enum bitpos="0" extends="VkShaderModuleCreateFlagBits"         name="VK_SHADER_MODULE_CREATE_RESERVED_0_BIT_NV"/>
+                <enum bitpos="2" extends="VkPipelineShaderStageCreateFlagBits"  name="VK_PIPELINE_SHADER_STAGE_CREATE_RESERVED_2_BIT_NV"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_extension_53" number="53" author="NV" contact="Jeff Bolz @jeffbolznv" supported="disabled">
+            <require>
+                <enum value="0"                                                 name="VK_NV_EXTENSION_53_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_extension_53&quot;"                    name="VK_NV_EXTENSION_53_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_multiview" number="54" type="device" author="KHR" requires="VK_KHR_get_physical_device_properties2" contact="Jeff Bolz @jeffbolznv" supported="vulkan" promotedto="VK_VERSION_1_1">
+            <require>
+                <enum value="1"                                                 name="VK_KHR_MULTIVIEW_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_multiview&quot;"                      name="VK_KHR_MULTIVIEW_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO_KHR" alias="VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES"/>
+                <enum extends="VkDependencyFlagBits"                            name="VK_DEPENDENCY_VIEW_LOCAL_BIT_KHR" alias="VK_DEPENDENCY_VIEW_LOCAL_BIT"/>
+                <type name="VkRenderPassMultiviewCreateInfoKHR"/>
+                <type name="VkPhysicalDeviceMultiviewFeaturesKHR"/>
+                <type name="VkPhysicalDeviceMultiviewPropertiesKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_IMG_format_pvrtc" number="55" type="device" author="IMG" contact="Stuart Smith" supported="vulkan">
+            <require>
+                <enum value="1"                                                 name="VK_IMG_FORMAT_PVRTC_SPEC_VERSION"/>
+                <enum value="&quot;VK_IMG_format_pvrtc&quot;"                   name="VK_IMG_FORMAT_PVRTC_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkFormat"                             name="VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG"/>
+                <enum offset="1" extends="VkFormat"                             name="VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG"/>
+                <enum offset="2" extends="VkFormat"                             name="VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG"/>
+                <enum offset="3" extends="VkFormat"                             name="VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG"/>
+                <enum offset="4" extends="VkFormat"                             name="VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG"/>
+                <enum offset="5" extends="VkFormat"                             name="VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG"/>
+                <enum offset="6" extends="VkFormat"                             name="VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG"/>
+                <enum offset="7" extends="VkFormat"                             name="VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_external_memory_capabilities" number="56" type="instance" author="NV" contact="James Jones @cubanismo" supported="vulkan" deprecatedby="VK_KHR_external_memory_capabilities">
+            <require>
+                <enum value="1"                                                 name="VK_NV_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_external_memory_capabilities&quot;"    name="VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME"/>
+                <type name="VkExternalMemoryHandleTypeFlagsNV"/>
+                <type name="VkExternalMemoryHandleTypeFlagBitsNV"/>
+                <type name="VkExternalMemoryFeatureFlagsNV"/>
+                <type name="VkExternalMemoryFeatureFlagBitsNV"/>
+                <type name="VkExternalImageFormatPropertiesNV"/>
+                <command name="vkGetPhysicalDeviceExternalImageFormatPropertiesNV"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_external_memory" number="57" type="device" requires="VK_NV_external_memory_capabilities" author="NV" contact="James Jones @cubanismo" supported="vulkan" deprecatedby="VK_KHR_external_memory">
+            <require>
+                <enum value="1"                                                 name="VK_NV_EXTERNAL_MEMORY_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_external_memory&quot;"                 name="VK_NV_EXTERNAL_MEMORY_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV"/>
+                <enum offset="1" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV"/>
+                <type name="VkExternalMemoryImageCreateInfoNV"/>
+                <type name="VkExportMemoryAllocateInfoNV"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_external_memory_win32" number="58" type="device" requires="VK_NV_external_memory" author="NV" contact="James Jones @cubanismo" platform="win32" supported="vulkan" deprecatedby="VK_KHR_external_memory_win32">
+            <require>
+                <enum value="1"                                                 name="VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_external_memory_win32&quot;"           name="VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV"/>
+                <enum offset="1" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV"/>
+                <type name="VkImportMemoryWin32HandleInfoNV"/>
+                <type name="VkExportMemoryWin32HandleInfoNV"/>
+                <command name="vkGetMemoryWin32HandleNV"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_win32_keyed_mutex" number="59" type="device" requires="VK_NV_external_memory_win32" author="NV" contact="Carsten Rohde @crohde" platform="win32" supported="vulkan" promotedto="VK_KHR_win32_keyed_mutex">
+            <require>
+                <enum value="2"                                                 name="VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_win32_keyed_mutex&quot;"               name="VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV"/>
+                <type name="VkWin32KeyedMutexAcquireReleaseInfoNV"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_get_physical_device_properties2" number="60" type="instance" author="KHR" contact="Jeff Bolz @jeffbolznv" supported="vulkan" promotedto="VK_VERSION_1_1">
+            <require>
+                <enum value="2"                                                 name="VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_get_physical_device_properties2&quot;" name="VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR" alias="VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR" alias="VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR" alias="VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR" alias="VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2"/>
+                <type name="VkPhysicalDeviceFeatures2KHR"/>
+                <type name="VkPhysicalDeviceProperties2KHR"/>
+                <type name="VkFormatProperties2KHR"/>
+                <type name="VkImageFormatProperties2KHR"/>
+                <type name="VkPhysicalDeviceImageFormatInfo2KHR"/>
+                <type name="VkQueueFamilyProperties2KHR"/>
+                <type name="VkPhysicalDeviceMemoryProperties2KHR"/>
+                <type name="VkSparseImageFormatProperties2KHR"/>
+                <type name="VkPhysicalDeviceSparseImageFormatInfo2KHR"/>
+                <command name="vkGetPhysicalDeviceFeatures2KHR"/>
+                <command name="vkGetPhysicalDeviceProperties2KHR"/>
+                <command name="vkGetPhysicalDeviceFormatProperties2KHR"/>
+                <command name="vkGetPhysicalDeviceImageFormatProperties2KHR"/>
+                <command name="vkGetPhysicalDeviceQueueFamilyProperties2KHR"/>
+                <command name="vkGetPhysicalDeviceMemoryProperties2KHR"/>
+                <command name="vkGetPhysicalDeviceSparseImageFormatProperties2KHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_device_group" number="61" type="device" author="KHR" requires="VK_KHR_device_group_creation" contact="Jeff Bolz @jeffbolznv" supported="vulkan" promotedto="VK_VERSION_1_1">
+            <require>
+                <enum value="4"                                                 name="VK_KHR_DEVICE_GROUP_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_device_group&quot;"                   name="VK_KHR_DEVICE_GROUP_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO_KHR" alias="VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO_KHR" alias="VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO_KHR" alias="VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO_KHR" alias="VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO_KHR" alias="VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO"/>
+                <type name="VkPeerMemoryFeatureFlagsKHR"/>
+                <type name="VkPeerMemoryFeatureFlagBitsKHR"/>
+                <enum extends="VkPeerMemoryFeatureFlagBits"                     name="VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT_KHR" alias="VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT"/>
+                <enum extends="VkPeerMemoryFeatureFlagBits"                     name="VK_PEER_MEMORY_FEATURE_COPY_DST_BIT_KHR" alias="VK_PEER_MEMORY_FEATURE_COPY_DST_BIT"/>
+                <enum extends="VkPeerMemoryFeatureFlagBits"                     name="VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT_KHR" alias="VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT"/>
+                <enum extends="VkPeerMemoryFeatureFlagBits"                     name="VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT_KHR" alias="VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT"/>
+                <type name="VkMemoryAllocateFlagsKHR"/>
+                <type name="VkMemoryAllocateFlagBitsKHR"/>
+                <enum extends="VkMemoryAllocateFlagBits"                        name="VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT_KHR" alias="VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT"/>
+                <type name="VkMemoryAllocateFlagsInfoKHR"/>
+                <type name="VkDeviceGroupRenderPassBeginInfoKHR"/>
+                <type name="VkDeviceGroupCommandBufferBeginInfoKHR"/>
+                <type name="VkDeviceGroupSubmitInfoKHR"/>
+                <type name="VkDeviceGroupBindSparseInfoKHR"/>
+                <command name="vkGetDeviceGroupPeerMemoryFeaturesKHR"/>
+                <command name="vkCmdSetDeviceMaskKHR"/>
+                <command name="vkCmdDispatchBaseKHR"/>
+                <enum extends="VkPipelineCreateFlagBits"                        name="VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHR" alias="VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT"/>
+                <enum extends="VkPipelineCreateFlagBits"                        name="VK_PIPELINE_CREATE_DISPATCH_BASE_KHR" alias="VK_PIPELINE_CREATE_DISPATCH_BASE"/>
+                <enum extends="VkDependencyFlagBits"                            name="VK_DEPENDENCY_DEVICE_GROUP_BIT_KHR" alias="VK_DEPENDENCY_DEVICE_GROUP_BIT"/>
+            </require>
+            <require extension="VK_KHR_bind_memory2">
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO_KHR" alias="VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO_KHR" alias="VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO"/>
+                <type name="VkBindBufferMemoryDeviceGroupInfoKHR"/>
+                <type name="VkBindImageMemoryDeviceGroupInfoKHR"/>
+                <enum extends="VkImageCreateFlagBits"                           name="VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR" alias="VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT"/>
+            </require>
+            <require extension="VK_KHR_surface">
+                <enum offset="7" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR"/>
+                <type name="VkDeviceGroupPresentModeFlagBitsKHR"/>
+                <type name="VkDeviceGroupPresentModeFlagsKHR"/>
+                <type name="VkDeviceGroupPresentCapabilitiesKHR"/>
+                <command name="vkGetDeviceGroupPresentCapabilitiesKHR"/>
+                <command name="vkGetDeviceGroupSurfacePresentModesKHR"/>
+                <command name="vkGetPhysicalDevicePresentRectanglesKHR"/>
+            </require>
+            <require extension="VK_KHR_swapchain">
+                <enum offset="8" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR"/>
+                <enum offset="9" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR"/>
+                <enum offset="10" extends="VkStructureType"                     name="VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR"/>
+                <enum offset="11" extends="VkStructureType"                     name="VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR"/>
+                <enum offset="12" extends="VkStructureType"                     name="VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR"/>
+                <enum bitpos="0" extends="VkSwapchainCreateFlagBitsKHR"         name="VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR" comment="Allow images with VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT"/>
+                <type name="VkImageSwapchainCreateInfoKHR"/>
+                <type name="VkBindImageMemorySwapchainInfoKHR"/>
+                <type name="VkAcquireNextImageInfoKHR"/>
+                <type name="VkDeviceGroupPresentInfoKHR"/>
+                <type name="VkDeviceGroupSwapchainCreateInfoKHR"/>
+                <command name="vkAcquireNextImage2KHR"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_validation_flags" number="62" type="instance" author="GOOGLE" contact="Tobin Ehlis @tobine" specialuse="debugging" supported="vulkan" deprecatedby="VK_EXT_validation_features">
+            <require>
+                <enum value="2"                                                 name="VK_EXT_VALIDATION_FLAGS_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_validation_flags&quot;"               name="VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT"/>
+                <type name="VkValidationFlagsEXT"/>
+                <type name="VkValidationCheckEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_NN_vi_surface" number="63" type="instance" author="NN" contact="Mathias Heyer gitlab:@mheyer" requires="VK_KHR_surface" platform="vi" supported="vulkan">
+            <require>
+                <enum value="1"                                                 name="VK_NN_VI_SURFACE_SPEC_VERSION"/>
+                <enum value="&quot;VK_NN_vi_surface&quot;"                      name="VK_NN_VI_SURFACE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN"/>
+                <type name="VkViSurfaceCreateFlagsNN"/>
+                <type name="VkViSurfaceCreateInfoNN"/>
+                <command name="vkCreateViSurfaceNN"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_shader_draw_parameters" number="64" type="device" author="KHR" contact="Daniel Koch @dgkoch" supported="vulkan" promotedto="VK_VERSION_1_1">
+            <require>
+                <enum value="1"                                                 name="VK_KHR_SHADER_DRAW_PARAMETERS_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_shader_draw_parameters&quot;"         name="VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_shader_subgroup_ballot" number="65" type="device" author="NV" contact="Daniel Koch @dgkoch" supported="vulkan" deprecatedby="VK_VERSION_1_2">
+            <require>
+                <enum value="1"                                                 name="VK_EXT_SHADER_SUBGROUP_BALLOT_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_shader_subgroup_ballot&quot;"         name="VK_EXT_SHADER_SUBGROUP_BALLOT_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_shader_subgroup_vote" number="66" type="device" author="NV" contact="Daniel Koch @dgkoch" supported="vulkan" deprecatedby="VK_VERSION_1_1">
+            <require>
+                <enum value="1"                                                 name="VK_EXT_SHADER_SUBGROUP_VOTE_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_shader_subgroup_vote&quot;"           name="VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_texture_compression_astc_hdr" number="67" type="device" author="ARM" contact="Jan-Harald Fredriksen @janharaldfredriksen-arm" requires="VK_KHR_get_physical_device_properties2" supported="vulkan">
+            <require>
+                <enum value="1"                                                 name="VK_EXT_TEXTURE_COMPRESSION_ASTC_HDR_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_texture_compression_astc_hdr&quot;"   name="VK_EXT_TEXTURE_COMPRESSION_ASTC_HDR_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES_EXT"/>
+                <type name="VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT"/>
+                <enum extends="VkFormat" extnumber="67" offset="0" name="VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="67" offset="1" name="VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="67" offset="2" name="VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="67" offset="3" name="VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="67" offset="4" name="VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="67" offset="5" name="VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="67" offset="6" name="VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="67" offset="7" name="VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="67" offset="8" name="VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="67" offset="9" name="VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="67" offset="10" name="VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="67" offset="11" name="VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="67" offset="12" name="VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="67" offset="13" name="VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_astc_decode_mode" number="68" type="device" author="ARM" contact="Jan-Harald Fredriksen @janharaldfredriksen-arm" requires="VK_KHR_get_physical_device_properties2" supported="vulkan">
+            <require>
+                <enum value="1"                                                 name="VK_EXT_ASTC_DECODE_MODE_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_astc_decode_mode&quot;"               name="VK_EXT_ASTC_DECODE_MODE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT"/>
+                <enum offset="1" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT"/>
+                <type name="VkImageViewASTCDecodeModeEXT"/>
+                <type name="VkPhysicalDeviceASTCDecodeFeaturesEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_IMG_extension_69" number="69" type="device" author="IMG" contact="Tobias Hector @tobski" supported="disabled">
+            <require>
+                <enum value="0"                                                 name="VK_IMG_EXTENSION_69_SPEC_VERSION"/>
+                <enum value="&quot;VK_IMG_extension_69&quot;"                   name="VK_IMG_EXTENSION_69_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_maintenance1" number="70" type="device" author="KHR" contact="Piers Daniell @pdaniell-nv" supported="vulkan" promotedto="VK_VERSION_1_1">
+            <require>
+                <enum value="2"                                                 name="VK_KHR_MAINTENANCE_1_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_maintenance1&quot;"                   name="VK_KHR_MAINTENANCE_1_EXTENSION_NAME"/>
+                <enum alias="VK_KHR_MAINTENANCE_1_SPEC_VERSION"                 name="VK_KHR_MAINTENANCE1_SPEC_VERSION" comment="Backwards-compatible alias containing a typo"/>
+                <enum alias="VK_KHR_MAINTENANCE_1_EXTENSION_NAME"               name="VK_KHR_MAINTENANCE1_EXTENSION_NAME" comment="Backwards-compatible alias containing a typo"/>
+                <enum extends="VkResult"                                        name="VK_ERROR_OUT_OF_POOL_MEMORY_KHR" alias="VK_ERROR_OUT_OF_POOL_MEMORY"/>
+                <enum extends="VkFormatFeatureFlagBits"                         name="VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR" alias="VK_FORMAT_FEATURE_TRANSFER_SRC_BIT"/>
+                <enum extends="VkFormatFeatureFlagBits"                         name="VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR" alias="VK_FORMAT_FEATURE_TRANSFER_DST_BIT"/>
+                <enum extends="VkImageCreateFlagBits"                           name="VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR" alias="VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT"/>
+                <type name="VkCommandPoolTrimFlagsKHR"/>
+                <command name="vkTrimCommandPoolKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_device_group_creation" number="71" type="instance" author="KHR" contact="Jeff Bolz @jeffbolznv" supported="vulkan" promotedto="VK_VERSION_1_1">
+            <require>
+                <enum value="1"                                                 name="VK_KHR_DEVICE_GROUP_CREATION_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_device_group_creation&quot;"          name="VK_KHR_DEVICE_GROUP_CREATION_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHR" alias="VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO"/>
+                <enum name="VK_MAX_DEVICE_GROUP_SIZE_KHR"/>
+                <type name="VkPhysicalDeviceGroupPropertiesKHR"/>
+                <type name="VkDeviceGroupDeviceCreateInfoKHR"/>
+                <command name="vkEnumeratePhysicalDeviceGroupsKHR"/>
+                <enum extends="VkMemoryHeapFlagBits"                            name="VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHR" alias="VK_MEMORY_HEAP_MULTI_INSTANCE_BIT"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_external_memory_capabilities" number="72" type="instance" author="KHR" requires="VK_KHR_get_physical_device_properties2" contact="James Jones @cubanismo" supported="vulkan" promotedto="VK_VERSION_1_1">
+            <require>
+                <enum value="1"                                                 name="VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_external_memory_capabilities&quot;"   name="VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES_KHR" alias="VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES_KHR" alias="VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES"/>
+                <enum name="VK_LUID_SIZE_KHR"/>
+                <type name="VkExternalMemoryHandleTypeFlagsKHR"/>
+                <type name="VkExternalMemoryHandleTypeFlagBitsKHR"/>
+                <enum extends="VkExternalMemoryHandleTypeFlagBits"              name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR" alias="VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT"/>
+                <enum extends="VkExternalMemoryHandleTypeFlagBits"              name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR" alias="VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT"/>
+                <enum extends="VkExternalMemoryHandleTypeFlagBits"              name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR" alias="VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT"/>
+                <enum extends="VkExternalMemoryHandleTypeFlagBits"              name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHR" alias="VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT"/>
+                <enum extends="VkExternalMemoryHandleTypeFlagBits"              name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHR" alias="VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT"/>
+                <enum extends="VkExternalMemoryHandleTypeFlagBits"              name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHR" alias="VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT"/>
+                <enum extends="VkExternalMemoryHandleTypeFlagBits"              name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHR" alias="VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT"/>
+                <type name="VkExternalMemoryFeatureFlagsKHR"/>
+                <type name="VkExternalMemoryFeatureFlagBitsKHR"/>
+                <enum extends="VkExternalMemoryFeatureFlagBits"                 name="VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_KHR" alias="VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT"/>
+                <enum extends="VkExternalMemoryFeatureFlagBits"                 name="VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_KHR" alias="VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT"/>
+                <enum extends="VkExternalMemoryFeatureFlagBits"                 name="VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_KHR" alias="VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT"/>
+                <type name="VkExternalMemoryPropertiesKHR"/>
+                <type name="VkPhysicalDeviceExternalImageFormatInfoKHR"/>
+                <type name="VkExternalImageFormatPropertiesKHR"/>
+                <type name="VkPhysicalDeviceExternalBufferInfoKHR"/>
+                <type name="VkExternalBufferPropertiesKHR"/>
+                <type name="VkPhysicalDeviceIDPropertiesKHR"/>
+                <command name="vkGetPhysicalDeviceExternalBufferPropertiesKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_external_memory" number="73" type="device" requires="VK_KHR_external_memory_capabilities" author="KHR" contact="James Jones @cubanismo" supported="vulkan" promotedto="VK_VERSION_1_1">
+            <require>
+                <enum value="1"                                                 name="VK_KHR_EXTERNAL_MEMORY_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_external_memory&quot;"                name="VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR" alias="VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHR" alias="VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR" alias="VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO"/>
+                <enum extends="VkResult"                                        name="VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR" alias="VK_ERROR_INVALID_EXTERNAL_HANDLE"/>
+                <enum name="VK_QUEUE_FAMILY_EXTERNAL_KHR"/>
+                <type name="VkExternalMemoryImageCreateInfoKHR"/>
+                <type name="VkExternalMemoryBufferCreateInfoKHR"/>
+                <type name="VkExportMemoryAllocateInfoKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_external_memory_win32" number="74" type="device" requires="VK_KHR_external_memory" author="KHR" contact="James Jones @cubanismo" platform="win32" supported="vulkan">
+            <require>
+                <enum value="1"                                                 name="VK_KHR_EXTERNAL_MEMORY_WIN32_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_external_memory_win32&quot;"          name="VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR"/>
+                <enum offset="1" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR"/>
+                <enum offset="2" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR"/>
+                <enum offset="3" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR"/>
+                <type name="VkImportMemoryWin32HandleInfoKHR"/>
+                <type name="VkExportMemoryWin32HandleInfoKHR"/>
+                <type name="VkMemoryWin32HandlePropertiesKHR"/>
+                <type name="VkMemoryGetWin32HandleInfoKHR"/>
+                <command name="vkGetMemoryWin32HandleKHR"/>
+                <command name="vkGetMemoryWin32HandlePropertiesKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_external_memory_fd" number="75" type="device" requires="VK_KHR_external_memory" author="KHR" contact="James Jones @cubanismo" supported="vulkan">
+            <require>
+                <enum value="1"                                                 name="VK_KHR_EXTERNAL_MEMORY_FD_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_external_memory_fd&quot;"             name="VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR"/>
+                <enum offset="1" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR"/>
+                <enum offset="2" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR"/>
+                <type name="VkImportMemoryFdInfoKHR"/>
+                <type name="VkMemoryFdPropertiesKHR"/>
+                <type name="VkMemoryGetFdInfoKHR"/>
+                <command name="vkGetMemoryFdKHR"/>
+                <command name="vkGetMemoryFdPropertiesKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_win32_keyed_mutex" number="76" type="device" requires="VK_KHR_external_memory_win32" author="KHR" contact="Carsten Rohde @crohde" platform="win32" supported="vulkan">
+            <require>
+                <enum value="1"                                                 name="VK_KHR_WIN32_KEYED_MUTEX_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_win32_keyed_mutex&quot;"              name="VK_KHR_WIN32_KEYED_MUTEX_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR"/>
+                <type name="VkWin32KeyedMutexAcquireReleaseInfoKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_external_semaphore_capabilities" number="77" type="instance" author="KHR" requires="VK_KHR_get_physical_device_properties2" contact="James Jones @cubanismo" supported="vulkan" promotedto="VK_VERSION_1_1">
+            <require>
+                <enum value="1"                                                 name="VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_external_semaphore_capabilities&quot;" name="VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO"/>
+                <enum extends="VkStructureType"                                 name="VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES_KHR" alias="VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES"/>
+                <enum name="VK_LUID_SIZE_KHR"/>
+                <type name="VkExternalSemaphoreHandleTypeFlagsKHR"/>
+                <type name="VkExternalSemaphoreHandleTypeFlagBitsKHR"/>
+                <enum extends="VkExternalSemaphoreHandleTypeFlagBits"       name="VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR" alias="VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT"/>
+                <enum extends="VkExternalSemaphoreHandleTypeFlagBits"       name="VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR" alias="VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT"/>
+                <enum extends="VkExternalSemaphoreHandleTypeFlagBits"       name="VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR" alias="VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT"/>
+                <enum extends="VkExternalSemaphoreHandleTypeFlagBits"       name="VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT_KHR" alias="VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT"/>
+                <enum extends="VkExternalSemaphoreHandleTypeFlagBits"       name="VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT_KHR" alias="VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT"/>
+                <type name="VkExternalSemaphoreFeatureFlagsKHR"/>
+                <type name="VkExternalSemaphoreFeatureFlagBitsKHR"/>
+                <enum extends="VkExternalSemaphoreFeatureFlagBits"          name="VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT_KHR" alias="VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT"/>
+                <enum extends="VkExternalSemaphoreFeatureFlagBits"          name="VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT_KHR" alias="VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT"/>
+                <type name="VkPhysicalDeviceExternalSemaphoreInfoKHR"/>
+                <type name="VkExternalSemaphorePropertiesKHR"/>
+                <type name="VkPhysicalDeviceIDPropertiesKHR"/>
+                <command name="vkGetPhysicalDeviceExternalSemaphorePropertiesKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_external_semaphore" number="78" type="device" requires="VK_KHR_external_semaphore_capabilities" author="KHR" contact="James Jones @cubanismo" supported="vulkan" promotedto="VK_VERSION_1_1">
+            <require>
+                <enum value="1"                                             name="VK_KHR_EXTERNAL_SEMAPHORE_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_external_semaphore&quot;"         name="VK_KHR_EXTERNAL_SEMAPHORE_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO_KHR" alias="VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO"/>
+                <type name="VkSemaphoreImportFlagsKHR"/>
+                <type name="VkSemaphoreImportFlagBitsKHR"/>
+                <enum extends="VkSemaphoreImportFlagBits"                   name="VK_SEMAPHORE_IMPORT_TEMPORARY_BIT_KHR" alias="VK_SEMAPHORE_IMPORT_TEMPORARY_BIT"/>
+                <type name="VkExportSemaphoreCreateInfoKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_external_semaphore_win32" number="79" type="device" requires="VK_KHR_external_semaphore" author="KHR" contact="James Jones @cubanismo" platform="win32" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_KHR_EXTERNAL_SEMAPHORE_WIN32_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_external_semaphore_win32&quot;"   name="VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR"/>
+                <enum offset="2" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR"/>
+                <enum offset="3" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR"/>
+                <type name="VkImportSemaphoreWin32HandleInfoKHR"/>
+                <type name="VkExportSemaphoreWin32HandleInfoKHR"/>
+                <type name="VkD3D12FenceSubmitInfoKHR"/>
+                <type name="VkSemaphoreGetWin32HandleInfoKHR"/>
+                <command name="vkImportSemaphoreWin32HandleKHR"/>
+                <command name="vkGetSemaphoreWin32HandleKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_external_semaphore_fd" number="80" type="device" requires="VK_KHR_external_semaphore" author="KHR" contact="James Jones @cubanismo" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_KHR_EXTERNAL_SEMAPHORE_FD_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_external_semaphore_fd&quot;"      name="VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR"/>
+                <type name="VkImportSemaphoreFdInfoKHR"/>
+                <type name="VkSemaphoreGetFdInfoKHR"/>
+                <command name="vkImportSemaphoreFdKHR"/>
+                <command name="vkGetSemaphoreFdKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_push_descriptor" number="81" type="device" author="KHR" requires="VK_KHR_get_physical_device_properties2" contact="Jeff Bolz @jeffbolznv" supported="vulkan">
+            <require>
+                <enum value="2"                                             name="VK_KHR_PUSH_DESCRIPTOR_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_push_descriptor&quot;"            name="VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR"/>
+                <enum bitpos="0" extends="VkDescriptorSetLayoutCreateFlagBits"   name="VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR"  comment="Descriptors are pushed via flink:vkCmdPushDescriptorSetKHR"/>
+                <command name="vkCmdPushDescriptorSetKHR"/>
+                <type name="VkPhysicalDevicePushDescriptorPropertiesKHR"/>
+            </require>
+            <require feature="VK_VERSION_1_1">
+                <command name="vkCmdPushDescriptorSetWithTemplateKHR"/>
+                <enum value="1" extends="VkDescriptorUpdateTemplateType"    name="VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR" comment="Create descriptor update template for pushed descriptor updates"/>
+            </require>
+            <require extension="VK_KHR_descriptor_update_template">
+                <command name="vkCmdPushDescriptorSetWithTemplateKHR"/>
+                <enum value="1" extends="VkDescriptorUpdateTemplateType"    name="VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR" comment="Create descriptor update template for pushed descriptor updates"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_conditional_rendering" number="82" type="device" author="NV" contact="Vikram Kushwaha @vkushwaha" supported="vulkan">
+            <require>
+                <enum value="2"                                             name="VK_EXT_CONDITIONAL_RENDERING_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_conditional_rendering&quot;"      name="VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT"/>
+                <enum offset="2" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_CONDITIONAL_RENDERING_BEGIN_INFO_EXT"/>
+                <type name="VkConditionalRenderingFlagsEXT"/>
+                <type name="VkConditionalRenderingFlagBitsEXT"/>
+                <enum bitpos="20" extends="VkAccessFlagBits"                name="VK_ACCESS_CONDITIONAL_RENDERING_READ_BIT_EXT"  comment="read access flag for reading conditional rendering predicate"/>
+                <enum bitpos="9"  extends="VkBufferUsageFlagBits"           name="VK_BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT" comment="Specifies the buffer can be used as predicate in conditional rendering"/>
+                <enum bitpos="18" extends="VkPipelineStageFlagBits"         name="VK_PIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT" comment="A pipeline stage for conditional rendering predicate fetch"/>
+                <command name="vkCmdBeginConditionalRenderingEXT"/>
+                <command name="vkCmdEndConditionalRenderingEXT"/>
+                <type name="VkConditionalRenderingBeginInfoEXT"/>
+                <type name="VkPhysicalDeviceConditionalRenderingFeaturesEXT"/>
+                <type name="VkCommandBufferInheritanceConditionalRenderingInfoEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_shader_float16_int8" number="83" type="device" requires="VK_KHR_get_physical_device_properties2" author="KHR" contact="Alexander Galazin @alegal-arm" supported="vulkan" promotedto="VK_VERSION_1_2">
+            <require>
+                <enum value="1"                                             name="VK_KHR_SHADER_FLOAT16_INT8_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_shader_float16_int8&quot;"        name="VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES"/>
+                <type name="VkPhysicalDeviceShaderFloat16Int8FeaturesKHR"/>
+                <type name="VkPhysicalDeviceFloat16Int8FeaturesKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_16bit_storage" number="84" type="device" requires="VK_KHR_get_physical_device_properties2,VK_KHR_storage_buffer_storage_class" author="KHR" contact="Jan-Harald Fredriksen @janharaldfredriksen-arm" supported="vulkan" promotedto="VK_VERSION_1_1">
+            <require>
+                <enum value="1"                                             name="VK_KHR_16BIT_STORAGE_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_16bit_storage&quot;"              name="VK_KHR_16BIT_STORAGE_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES"/>
+                <type name="VkPhysicalDevice16BitStorageFeaturesKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_incremental_present" number="85" type="device" author="KHR" requires="VK_KHR_swapchain" contact="Ian Elliott @ianelliottus" supported="vulkan">
+            <require>
+                <enum value="2"                                             name="VK_KHR_INCREMENTAL_PRESENT_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_incremental_present&quot;"        name="VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR"/>
+                <type name="VkPresentRegionsKHR"/>
+                <type name="VkPresentRegionKHR"/>
+                <type name="VkRectLayerKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_descriptor_update_template" number="86" type="device" author="KHR" contact="Markus Tavenrath @mtavenrath" supported="vulkan" promotedto="VK_VERSION_1_1">
+            <require>
+                <enum value="1"                                             name="VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_descriptor_update_template&quot;" name="VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR" alias="VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO"/>
+                <enum extends="VkObjectType"                                name="VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR" alias="VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE"/>
+                <command name="vkCreateDescriptorUpdateTemplateKHR"/>
+                <command name="vkDestroyDescriptorUpdateTemplateKHR"/>
+                <command name="vkUpdateDescriptorSetWithTemplateKHR"/>
+                <type name="VkDescriptorUpdateTemplateKHR"/>
+                <type name="VkDescriptorUpdateTemplateCreateFlagsKHR"/>
+                <type name="VkDescriptorUpdateTemplateTypeKHR"/>
+                <type name="VkDescriptorUpdateTemplateEntryKHR"/>
+                <type name="VkDescriptorUpdateTemplateCreateInfoKHR"/>
+                <enum extends="VkDescriptorUpdateTemplateType"              name="VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR" alias="VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET"/>
+            </require>
+            <require extension="VK_KHR_push_descriptor">
+                <command name="vkCmdPushDescriptorSetWithTemplateKHR"/>
+                <enum value="1" extends="VkDescriptorUpdateTemplateType"    name="VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR" comment="Create descriptor update template for pushed descriptor updates"/>
+            </require>
+            <require extension="VK_EXT_debug_report">
+                <enum extends="VkDebugReportObjectTypeEXT"                  name="VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR_EXT" alias="VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT"/>
+            </require>
+        </extension>
+        <extension name="VK_NVX_device_generated_commands" number="87" type="device" author="NVX" contact="Christoph Kubisch @pixeljetstream" supported="disabled">
+            <require>
+                <enum value="3"                                             name="VK_NVX_DEVICE_GENERATED_COMMANDS_SPEC_VERSION"/>
+                <enum value="&quot;VK_NVX_device_generated_commands&quot;"  name="VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_clip_space_w_scaling" number="88" type="device" author="NV" contact="Eric Werness @ewerness-nv" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_NV_CLIP_SPACE_W_SCALING_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_clip_space_w_scaling&quot;"        name="VK_NV_CLIP_SPACE_W_SCALING_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV"/>
+                <enum offset="0" extends="VkDynamicState"                   name="VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV"/>
+                <type name="VkViewportWScalingNV"/>
+                <type name="VkPipelineViewportWScalingStateCreateInfoNV"/>
+                <command name="vkCmdSetViewportWScalingNV"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_direct_mode_display" number="89" type="instance" requires="VK_KHR_display" author="NV" contact="James Jones @cubanismo" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_DIRECT_MODE_DISPLAY_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_direct_mode_display&quot;"        name="VK_EXT_DIRECT_MODE_DISPLAY_EXTENSION_NAME"/>
+                <command name="vkReleaseDisplayEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_acquire_xlib_display" number="90" type="instance" requires="VK_EXT_direct_mode_display" author="NV" contact="James Jones @cubanismo" platform="xlib_xrandr" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_ACQUIRE_XLIB_DISPLAY_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_acquire_xlib_display&quot;"       name="VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME"/>
+                <command name="vkAcquireXlibDisplayEXT"/>
+                <command name="vkGetRandROutputDisplayEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_display_surface_counter" number="91" type="instance" requires="VK_KHR_display" author="NV" contact="James Jones @cubanismo" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_DISPLAY_SURFACE_COUNTER_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_display_surface_counter&quot;"    name="VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME"/>
+                <enum offset="0"                                           extends="VkStructureType" name="VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT"/>
+                <enum alias="VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT" extends="VkStructureType" name="VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES2_EXT" comment="Backwards-compatible alias containing a typo"/>
+                <type name="VkSurfaceCounterFlagsEXT"/>
+                <type name="VkSurfaceCounterFlagBitsEXT"/>
+                <type name="VkSurfaceCapabilities2EXT"/>
+                <command name="vkGetPhysicalDeviceSurfaceCapabilities2EXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_display_control" number="92" type="device" requires="VK_EXT_display_surface_counter,VK_KHR_swapchain" author="NV" contact="James Jones @cubanismo" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_DISPLAY_CONTROL_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_display_control&quot;"            name="VK_EXT_DISPLAY_CONTROL_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT"/>
+                <enum offset="2" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT"/>
+                <enum offset="3" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT"/>
+                <type name="VkDisplayPowerStateEXT"/>
+                <type name="VkDeviceEventTypeEXT"/>
+                <type name="VkDisplayEventTypeEXT"/>
+                <type name="VkDisplayPowerInfoEXT"/>
+                <type name="VkDeviceEventInfoEXT"/>
+                <type name="VkDisplayEventInfoEXT"/>
+                <type name="VkSwapchainCounterCreateInfoEXT"/>
+                <command name="vkDisplayPowerControlEXT"/>
+                <command name="vkRegisterDeviceEventEXT"/>
+                <command name="vkRegisterDisplayEventEXT"/>
+                <command name="vkGetSwapchainCounterEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_GOOGLE_display_timing" number="93" type="device" author="GOOGLE" requires="VK_KHR_swapchain" contact="Ian Elliott @ianelliottus" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_GOOGLE_DISPLAY_TIMING_SPEC_VERSION"/>
+                <enum value="&quot;VK_GOOGLE_display_timing&quot;"          name="VK_GOOGLE_DISPLAY_TIMING_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE"/>
+                <type name="VkRefreshCycleDurationGOOGLE"/>
+                <type name="VkPastPresentationTimingGOOGLE"/>
+                <type name="VkPresentTimesInfoGOOGLE"/>
+                <type name="VkPresentTimeGOOGLE"/>
+                <command name="vkGetRefreshCycleDurationGOOGLE"/>
+                <command name="vkGetPastPresentationTimingGOOGLE"/>
+            </require>
+        </extension>
+        <extension name="VK_RESERVED_do_not_use_94" number="94" supported="disabled" comment="Used for functionality subsumed into Vulkan 1.1 and not published as an extension">
+            <require>
+                <enum value="1"                                             name="VK_RESERVED_DO_NOT_USE_94_SPEC_VERSION"/>
+                <enum value="&quot;VK_RESERVED_do_not_use_94&quot;"         name="VK_RESERVED_DO_NOT_USE_94_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_sample_mask_override_coverage" number="95" type="device" author="NV" contact="Piers Daniell @pdaniell-nv" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_NV_SAMPLE_MASK_OVERRIDE_COVERAGE_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_sample_mask_override_coverage&quot;" name="VK_NV_SAMPLE_MASK_OVERRIDE_COVERAGE_EXTENSION_NAME"/>
+                <comment>
+                    enum offset=0 was mistakenly used for the 1.1 core enum
+                    VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES
+                    (value=1000094000). Fortunately, no conflict resulted.
+                </comment>
+            </require>
+        </extension>
+        <extension name="VK_NV_geometry_shader_passthrough" number="96" type="device" author="NV" contact="Daniel Koch @dgkoch" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_NV_GEOMETRY_SHADER_PASSTHROUGH_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_geometry_shader_passthrough&quot;" name="VK_NV_GEOMETRY_SHADER_PASSTHROUGH_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_viewport_array2" number="97" type="device" author="NV" contact="Daniel Koch @dgkoch" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_NV_VIEWPORT_ARRAY_2_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_viewport_array2&quot;"             name="VK_NV_VIEWPORT_ARRAY_2_EXTENSION_NAME"/>
+                <enum alias="VK_NV_VIEWPORT_ARRAY_2_SPEC_VERSION"           name="VK_NV_VIEWPORT_ARRAY2_SPEC_VERSION" comment="Backwards-compatible alias containing a typo"/>
+                <enum alias="VK_NV_VIEWPORT_ARRAY_2_EXTENSION_NAME"         name="VK_NV_VIEWPORT_ARRAY2_EXTENSION_NAME" comment="Backwards-compatible alias containing a typo"/>
+            </require>
+        </extension>
+        <extension name="VK_NVX_multiview_per_view_attributes" number="98" type="device" requires="VK_KHR_multiview" author="NVX" contact="Jeff Bolz @jeffbolznv" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_SPEC_VERSION"/>
+                <enum value="&quot;VK_NVX_multiview_per_view_attributes&quot;" name="VK_NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX"/>
+                <enum bitpos="0" extends="VkSubpassDescriptionFlagBits"     name="VK_SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX"/>
+                <enum bitpos="1" extends="VkSubpassDescriptionFlagBits"     name="VK_SUBPASS_DESCRIPTION_PER_VIEW_POSITION_X_ONLY_BIT_NVX"/>
+                <type name="VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_viewport_swizzle" number="99" type="device" author="NV" contact="Piers Daniell @pdaniell-nv" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_NV_VIEWPORT_SWIZZLE_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_viewport_swizzle&quot;"            name="VK_NV_VIEWPORT_SWIZZLE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV"/>
+                <type name="VkViewportSwizzleNV"/>
+                <type name="VkViewportCoordinateSwizzleNV"/>
+                <type name="VkPipelineViewportSwizzleStateCreateInfoNV"/>
+                <type name="VkPipelineViewportSwizzleStateCreateFlagsNV"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_discard_rectangles" number="100" type="device" requires="VK_KHR_get_physical_device_properties2" author="NV" contact="Piers Daniell @pdaniell-nv" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_discard_rectangles&quot;"         name="VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT"/>
+                <enum offset="0" extends="VkDynamicState"                   name="VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT"/>
+                <type name="VkPhysicalDeviceDiscardRectanglePropertiesEXT"/>
+                <type name="VkPipelineDiscardRectangleStateCreateInfoEXT"/>
+                <type name="VkPipelineDiscardRectangleStateCreateFlagsEXT"/>
+                <type name="VkDiscardRectangleModeEXT"/>
+                <command name="vkCmdSetDiscardRectangleEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_extension_101" number="101" author="NV" contact="Daniel Koch @dgkoch" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_NV_EXTENSION_101_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_extension_101&quot;"               name="VK_NV_EXTENSION_101_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_conservative_rasterization" number="102" type="device" requires="VK_KHR_get_physical_device_properties2" author="NV" contact="Piers Daniell @pdaniell-nv" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_CONSERVATIVE_RASTERIZATION_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_conservative_rasterization&quot;" name="VK_EXT_CONSERVATIVE_RASTERIZATION_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT"/>
+                <type name="VkPhysicalDeviceConservativeRasterizationPropertiesEXT"/>
+                <type name="VkPipelineRasterizationConservativeStateCreateInfoEXT"/>
+                <type name="VkPipelineRasterizationConservativeStateCreateFlagsEXT"/>
+                <type name="VkConservativeRasterizationModeEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_depth_clip_enable" number="103" type="device" author="EXT" contact="Piers Daniell @pdaniell-nv" specialuse="d3demulation" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_DEPTH_CLIP_ENABLE_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_depth_clip_enable&quot;"          name="VK_EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT"/>
+                <type name="VkPhysicalDeviceDepthClipEnableFeaturesEXT"/>
+                <type name="VkPipelineRasterizationDepthClipStateCreateInfoEXT"/>
+                <type name="VkPipelineRasterizationDepthClipStateCreateFlagsEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_extension_104" number="104" author="NV" contact="Mathias Schott gitlab:@mschott" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_NV_EXTENSION_104_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_extension_104&quot;"               name="VK_NV_EXTENSION_104_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_swapchain_colorspace" number="105" type="instance" author="GOOGLE" contact="Courtney Goeltzenleuchter @courtney-g" requires="VK_KHR_surface" supported="vulkan">
+            <require>
+                <enum value="4"                                             name="VK_EXT_SWAPCHAIN_COLOR_SPACE_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_swapchain_colorspace&quot;"       name="VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME"/>
+                <enum offset="1" extends="VkColorSpaceKHR"                  name="VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT"/>
+                <enum offset="2" extends="VkColorSpaceKHR"                  name="VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT"/>
+                <enum offset="3" extends="VkColorSpaceKHR"                  name="VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT"/>
+                <enum offset="4" extends="VkColorSpaceKHR"                  name="VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT"/>
+                <enum offset="5" extends="VkColorSpaceKHR"                  name="VK_COLOR_SPACE_BT709_LINEAR_EXT"/>
+                <enum offset="6" extends="VkColorSpaceKHR"                  name="VK_COLOR_SPACE_BT709_NONLINEAR_EXT"/>
+                <enum offset="7" extends="VkColorSpaceKHR"                  name="VK_COLOR_SPACE_BT2020_LINEAR_EXT"/>
+                <enum offset="8" extends="VkColorSpaceKHR"                  name="VK_COLOR_SPACE_HDR10_ST2084_EXT"/>
+                <enum offset="9" extends="VkColorSpaceKHR"                  name="VK_COLOR_SPACE_DOLBYVISION_EXT"/>
+                <enum offset="10" extends="VkColorSpaceKHR"                 name="VK_COLOR_SPACE_HDR10_HLG_EXT"/>
+                <enum offset="11" extends="VkColorSpaceKHR"                 name="VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT"/>
+                <enum offset="12" extends="VkColorSpaceKHR"                 name="VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT"/>
+                <enum offset="13" extends="VkColorSpaceKHR"                 name="VK_COLOR_SPACE_PASS_THROUGH_EXT"/>
+                <enum offset="14" extends="VkColorSpaceKHR"                 name="VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT"/>
+                <enum extends="VkColorSpaceKHR"                             name="VK_COLOR_SPACE_DCI_P3_LINEAR_EXT" alias="VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT" comment="Deprecated name for backwards compatibility"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_hdr_metadata" number="106" type="device" requires="VK_KHR_swapchain" author="GOOGLE" contact="Courtney Goeltzenleuchter @courtney-g" supported="vulkan">
+            <require>
+                <enum value="2"                                             name="VK_EXT_HDR_METADATA_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_hdr_metadata&quot;"               name="VK_EXT_HDR_METADATA_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_HDR_METADATA_EXT"/>
+                <type name="VkHdrMetadataEXT"/>
+                <type name="VkXYColorEXT"/>
+                <command name="vkSetHdrMetadataEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_IMG_extension_107" number="107" author="IMG" contact="Michael Worcester @michaelworcester" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_IMG_EXTENSION_107_SPEC_VERSION"/>
+                <enum value="&quot;VK_IMG_extension_107&quot;"              name="VK_IMG_EXTENSION_107_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_IMG_extension_108" number="108" author="IMG" contact="Michael Worcester @michaelworcester" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_IMG_EXTENSION_108_SPEC_VERSION"/>
+                <enum value="&quot;VK_IMG_extension_108&quot;"              name="VK_IMG_EXTENSION_108_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_imageless_framebuffer" requires="VK_KHR_maintenance2,VK_KHR_image_format_list" number="109" author="KHR" contact="Tobias Hector @tobias" type="device" supported="vulkan" promotedto="VK_VERSION_1_2">
+            <require>
+                <enum value="1"                                             name="VK_KHR_IMAGELESS_FRAMEBUFFER_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_imageless_framebuffer&quot;"      name="VK_KHR_IMAGELESS_FRAMEBUFFER_EXTENSION_NAME"/>
+                <type name="VkPhysicalDeviceImagelessFramebufferFeaturesKHR"/>
+                <type name="VkFramebufferAttachmentsCreateInfoKHR"/>
+                <type name="VkFramebufferAttachmentImageInfoKHR"/>
+                <type name="VkRenderPassAttachmentBeginInfoKHR"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO_KHR" alias="VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO_KHR" alias="VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO_KHR" alias="VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO"/>
+                <enum extends="VkFramebufferCreateFlagBits"                 name="VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT_KHR" alias="VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_create_renderpass2" requires="VK_KHR_multiview,VK_KHR_maintenance2" number="110" contact="Tobias Hector @tobias" type="device" supported="vulkan" promotedto="VK_VERSION_1_2">
+            <require>
+                <enum value="1"                                             name="VK_KHR_CREATE_RENDERPASS_2_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_create_renderpass2&quot;"         name="VK_KHR_CREATE_RENDERPASS_2_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2_KHR" alias="VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2_KHR" alias="VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2_KHR" alias="VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2_KHR" alias="VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2_KHR" alias="VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_SUBPASS_BEGIN_INFO_KHR" alias="VK_STRUCTURE_TYPE_SUBPASS_BEGIN_INFO"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_SUBPASS_END_INFO_KHR" alias="VK_STRUCTURE_TYPE_SUBPASS_END_INFO"/>
+                <command name="vkCreateRenderPass2KHR"/>
+                <command name="vkCmdBeginRenderPass2KHR"/>
+                <command name="vkCmdNextSubpass2KHR"/>
+                <command name="vkCmdEndRenderPass2KHR"/>
+                <type name="VkRenderPassCreateInfo2KHR"/>
+                <type name="VkAttachmentDescription2KHR"/>
+                <type name="VkAttachmentReference2KHR"/>
+                <type name="VkSubpassDescription2KHR"/>
+                <type name="VkSubpassDependency2KHR"/>
+                <type name="VkSubpassBeginInfoKHR"/>
+                <type name="VkSubpassEndInfoKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_IMG_extension_111" number="111" author="IMG" contact="Michael Worcester @michaelworcester" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_IMG_EXTENSION_111_SPEC_VERSION"/>
+                <enum value="&quot;VK_IMG_extension_111&quot;"              name="VK_IMG_EXTENSION_111_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_shared_presentable_image" number="112" type="device" requires="VK_KHR_swapchain,VK_KHR_get_physical_device_properties2,VK_KHR_get_surface_capabilities2" author="KHR" contact="Alon Or-bach @alonorbach" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_KHR_SHARED_PRESENTABLE_IMAGE_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_shared_presentable_image&quot;"   name="VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR"/>
+                <enum offset="0" extends="VkPresentModeKHR"                 name="VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR"/>
+                <enum offset="1" extends="VkPresentModeKHR"                 name="VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR"/>
+                <enum offset="0" extends="VkImageLayout"                    name="VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR"/>
+                <type name="VkSharedPresentSurfaceCapabilitiesKHR"/>
+                <command name="vkGetSwapchainStatusKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_external_fence_capabilities" number="113" type="instance" author="KHR" requires="VK_KHR_get_physical_device_properties2" contact="Jesse Hall @critsec" supported="vulkan" promotedto="VK_VERSION_1_1">
+            <require>
+                <enum value="1"                                             name="VK_KHR_EXTERNAL_FENCE_CAPABILITIES_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_external_fence_capabilities&quot;" name="VK_KHR_EXTERNAL_FENCE_CAPABILITIES_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES_KHR" alias="VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES"/>
+                <enum name="VK_LUID_SIZE_KHR"/>
+                <type name="VkExternalFenceHandleTypeFlagsKHR"/>
+                <type name="VkExternalFenceHandleTypeFlagBitsKHR"/>
+                <enum extends="VkExternalFenceHandleTypeFlagBits"           name="VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR" alias="VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT"/>
+                <enum extends="VkExternalFenceHandleTypeFlagBits"           name="VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR" alias="VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT"/>
+                <enum extends="VkExternalFenceHandleTypeFlagBits"           name="VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR" alias="VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT"/>
+                <enum extends="VkExternalFenceHandleTypeFlagBits"           name="VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT_KHR" alias="VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT"/>
+                <type name="VkExternalFenceFeatureFlagsKHR"/>
+                <type name="VkExternalFenceFeatureFlagBitsKHR"/>
+                <enum extends="VkExternalFenceFeatureFlagBits"              name="VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT_KHR" alias="VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT"/>
+                <enum extends="VkExternalFenceFeatureFlagBits"              name="VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT_KHR" alias="VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT"/>
+                <type name="VkPhysicalDeviceExternalFenceInfoKHR"/>
+                <type name="VkExternalFencePropertiesKHR"/>
+                <type name="VkPhysicalDeviceIDPropertiesKHR"/>
+                <command name="vkGetPhysicalDeviceExternalFencePropertiesKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_external_fence" number="114" type="device" requires="VK_KHR_external_fence_capabilities" author="KHR" contact="Jesse Hall @critsec" supported="vulkan" promotedto="VK_VERSION_1_1">
+            <require>
+                <enum value="1"                                             name="VK_KHR_EXTERNAL_FENCE_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_external_fence&quot;"             name="VK_KHR_EXTERNAL_FENCE_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO_KHR" alias="VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO"/>
+                <type name="VkFenceImportFlagsKHR"/>
+                <type name="VkFenceImportFlagBitsKHR"/>
+                <enum extends="VkFenceImportFlagBits"                       name="VK_FENCE_IMPORT_TEMPORARY_BIT_KHR" alias="VK_FENCE_IMPORT_TEMPORARY_BIT"/>
+                <type name="VkExportFenceCreateInfoKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_external_fence_win32" number="115" type="device" requires="VK_KHR_external_fence" author="KHR" contact="Jesse Hall @critsec" platform="win32" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_KHR_EXTERNAL_FENCE_WIN32_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_external_fence_win32&quot;"       name="VK_KHR_EXTERNAL_FENCE_WIN32_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR"/>
+                <enum offset="2" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR"/>
+                <type name="VkImportFenceWin32HandleInfoKHR"/>
+                <type name="VkExportFenceWin32HandleInfoKHR"/>
+                <type name="VkFenceGetWin32HandleInfoKHR"/>
+                <command name="vkImportFenceWin32HandleKHR"/>
+                <command name="vkGetFenceWin32HandleKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_external_fence_fd" number="116" type="device" requires="VK_KHR_external_fence" author="KHR" contact="Jesse Hall @critsec" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_KHR_EXTERNAL_FENCE_FD_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_external_fence_fd&quot;"          name="VK_KHR_EXTERNAL_FENCE_FD_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR"/>
+                <type name="VkImportFenceFdInfoKHR"/>
+                <type name="VkFenceGetFdInfoKHR"/>
+                <command name="vkImportFenceFdKHR"/>
+                <command name="vkGetFenceFdKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_performance_query" number="117" type="device" requires="VK_KHR_get_physical_device_properties2" author="KHR" contact="Alon Or-bach @alonorbach" specialuse="devtools" supported="vulkan">
+            <require>
+                <enum value="1"                                    name="VK_KHR_PERFORMANCE_QUERY_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_performance_query&quot;" name="VK_KHR_PERFORMANCE_QUERY_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkQueryType"             name="VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR"/>
+                <enum offset="0" extends="VkStructureType"         name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR"/>
+                <enum offset="1" extends="VkStructureType"         name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR"/>
+                <enum offset="2" extends="VkStructureType"         name="VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR"/>
+                <enum offset="3" extends="VkStructureType"         name="VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR"/>
+                <enum offset="4" extends="VkStructureType"         name="VK_STRUCTURE_TYPE_ACQUIRE_PROFILING_LOCK_INFO_KHR"/>
+                <enum offset="5" extends="VkStructureType"         name="VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_KHR"/>
+                <enum offset="6" extends="VkStructureType"         name="VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_DESCRIPTION_KHR"/>
+                <type name="VkPhysicalDevicePerformanceQueryFeaturesKHR"/>
+                <type name="VkPhysicalDevicePerformanceQueryPropertiesKHR"/>
+                <type name="VkPerformanceCounterKHR"/>
+                <type name="VkPerformanceCounterDescriptionKHR"/>
+                <type name="VkPerformanceCounterDescriptionFlagsKHR"/>
+                <type name="VkPerformanceCounterDescriptionFlagBitsKHR"/>
+                <type name="VkQueryPoolPerformanceCreateInfoKHR"/>
+                <type name="VkPerformanceCounterScopeKHR"/>
+                <type name="VkPerformanceCounterStorageKHR"/>
+                <type name="VkPerformanceCounterUnitKHR"/>
+                <type name="VkPerformanceCounterResultKHR"/>
+                <type name="VkAcquireProfilingLockInfoKHR"/>
+                <type name="VkAcquireProfilingLockFlagsKHR"/>
+                <type name="VkAcquireProfilingLockFlagBitsKHR"/>
+                <type name="VkPerformanceQuerySubmitInfoKHR"/>
+                <command name="vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR"/>
+                <command name="vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR"/>
+                <command name="vkAcquireProfilingLockKHR"/>
+                <command name="vkReleaseProfilingLockKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_maintenance2" number="118" type="device" author="KHR" contact="Michael Worcester @michaelworcester" supported="vulkan" promotedto="VK_VERSION_1_1">
+            <require>
+                <enum value="1"                                             name="VK_KHR_MAINTENANCE_2_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_maintenance2&quot;"               name="VK_KHR_MAINTENANCE_2_EXTENSION_NAME"/>
+                <enum alias="VK_KHR_MAINTENANCE_2_SPEC_VERSION"             name="VK_KHR_MAINTENANCE2_SPEC_VERSION" comment="Backwards-compatible alias containing a typo"/>
+                <enum alias="VK_KHR_MAINTENANCE_2_EXTENSION_NAME"           name="VK_KHR_MAINTENANCE2_EXTENSION_NAME" comment="Backwards-compatible alias containing a typo"/>
+                <enum extends="VkImageCreateFlagBits"                       name="VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR" alias="VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT"/>
+                <enum extends="VkImageCreateFlagBits"                       name="VK_IMAGE_CREATE_EXTENDED_USAGE_BIT_KHR" alias="VK_IMAGE_CREATE_EXTENDED_USAGE_BIT"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO_KHR" alias="VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO_KHR" alias="VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO_KHR" alias="VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO"/>
+                <enum extends="VkImageLayout"                               name="VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR" alias="VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL"/>
+                <enum extends="VkImageLayout"                               name="VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR" alias="VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL"/>
+                <type name="VkPhysicalDevicePointClippingPropertiesKHR"/>
+                <type name="VkPointClippingBehaviorKHR"/>
+                <enum extends="VkPointClippingBehavior"                     name="VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES_KHR" alias="VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES"/>
+                <enum extends="VkPointClippingBehavior"                     name="VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY_KHR" alias="VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY"/>
+                <type name="VkRenderPassInputAttachmentAspectCreateInfoKHR"/>
+                <type name="VkInputAttachmentAspectReferenceKHR"/>
+                <type name="VkImageViewUsageCreateInfoKHR"/>
+                <type name="VkTessellationDomainOriginKHR"/>
+                <enum extends="VkTessellationDomainOrigin"                  name="VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT_KHR" alias="VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT"/>
+                <enum extends="VkTessellationDomainOrigin"                  name="VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT_KHR" alias="VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT"/>
+                <type name="VkPipelineTessellationDomainOriginStateCreateInfoKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_extension_119" number="119" author="KHR" contact="Michael Worcester @michaelworcester" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_KHR_EXTENSION_119_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_extension_119&quot;"              name="VK_KHR_EXTENSION_119_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_get_surface_capabilities2" number="120" type="instance" requires="VK_KHR_surface" author="KHR" contact="James Jones @cubanismo" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_KHR_GET_SURFACE_CAPABILITIES_2_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_get_surface_capabilities2&quot;"  name="VK_KHR_GET_SURFACE_CAPABILITIES_2_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR"/>
+                <enum offset="2" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR"/>
+                <type name="VkPhysicalDeviceSurfaceInfo2KHR"/>
+                <type name="VkSurfaceCapabilities2KHR"/>
+                <type name="VkSurfaceFormat2KHR"/>
+                <command name="vkGetPhysicalDeviceSurfaceCapabilities2KHR"/>
+                <command name="vkGetPhysicalDeviceSurfaceFormats2KHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_variable_pointers" number="121" type="device" author="KHR" contact="Jesse Hall @critsec" requires="VK_KHR_get_physical_device_properties2,VK_KHR_storage_buffer_storage_class" supported="vulkan" promotedto="VK_VERSION_1_1">
+            <require>
+                <enum value="1"                                             name="VK_KHR_VARIABLE_POINTERS_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_variable_pointers&quot;"          name="VK_KHR_VARIABLE_POINTERS_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES_KHR"/>
+                <type name="VkPhysicalDeviceVariablePointerFeaturesKHR"/>
+                <type name="VkPhysicalDeviceVariablePointersFeaturesKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_get_display_properties2" number="122" type="instance" requires="VK_KHR_display" author="KHR" contact="James Jones @cubanismo" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_KHR_GET_DISPLAY_PROPERTIES_2_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_get_display_properties2&quot;"    name="VK_KHR_GET_DISPLAY_PROPERTIES_2_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_DISPLAY_PROPERTIES_2_KHR"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_DISPLAY_PLANE_PROPERTIES_2_KHR"/>
+                <enum offset="2" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_DISPLAY_MODE_PROPERTIES_2_KHR"/>
+                <enum offset="3" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_DISPLAY_PLANE_INFO_2_KHR"/>
+                <enum offset="4" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_DISPLAY_PLANE_CAPABILITIES_2_KHR"/>
+                <type name="VkDisplayProperties2KHR"/>
+                <type name="VkDisplayPlaneProperties2KHR"/>
+                <type name="VkDisplayModeProperties2KHR"/>
+                <type name="VkDisplayPlaneInfo2KHR"/>
+                <type name="VkDisplayPlaneCapabilities2KHR"/>
+                <command name="vkGetPhysicalDeviceDisplayProperties2KHR"/>
+                <command name="vkGetPhysicalDeviceDisplayPlaneProperties2KHR"/>
+                <command name="vkGetDisplayModeProperties2KHR"/>
+                <command name="vkGetDisplayPlaneCapabilities2KHR"/>
+            </require>
+        </extension>
+        <extension name="VK_MVK_ios_surface" number="123" type="instance" requires="VK_KHR_surface" platform="ios" supported="vulkan" author="MVK" contact="Bill Hollings @billhollings" deprecatedby="VK_EXT_metal_surface">
+            <require>
+                <enum value="3"                                             name="VK_MVK_IOS_SURFACE_SPEC_VERSION"/>
+                <enum value="&quot;VK_MVK_ios_surface&quot;"                name="VK_MVK_IOS_SURFACE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK"/>
+                <type name="VkIOSSurfaceCreateFlagsMVK"/>
+                <type name="VkIOSSurfaceCreateInfoMVK"/>
+                <command name="vkCreateIOSSurfaceMVK"/>
+            </require>
+        </extension>
+        <extension name="VK_MVK_macos_surface" number="124" type="instance" requires="VK_KHR_surface" platform="macos" supported="vulkan" author="MVK" contact="Bill Hollings @billhollings" deprecatedby="VK_EXT_metal_surface">
+            <require>
+                <enum value="3"                                             name="VK_MVK_MACOS_SURFACE_SPEC_VERSION"/>
+                <enum value="&quot;VK_MVK_macos_surface&quot;"              name="VK_MVK_MACOS_SURFACE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK"/>
+                <type name="VkMacOSSurfaceCreateFlagsMVK"/>
+                <type name="VkMacOSSurfaceCreateInfoMVK"/>
+                <command name="vkCreateMacOSSurfaceMVK"/>
+            </require>
+        </extension>
+        <extension name="VK_MVK_moltenvk" number="125" type="instance" author="MVK" contact="Bill Hollings @billhollings" supported="vulkan">
+            <require>
+                <enum value="0"                                             name="VK_MVK_MOLTENVK_SPEC_VERSION"/>
+                <enum value="&quot;VK_MVK_moltenvk&quot;"                   name="VK_MVK_MOLTENVK_EXTENSION_NAME"/>
+                <command name="vkGetMTLDeviceMVK"/>
+                <command name="vkSetMTLTextureMVK"/>
+                <command name="vkGetMTLTextureMVK"/>
+                <command name="vkGetMTLBufferMVK"/>
+                <command name="vkUseIOSurfaceMVK"/>
+                <command name="vkGetIOSurfaceMVK"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_external_memory_dma_buf" number="126" type="device" requires="VK_KHR_external_memory_fd" author="EXT" contact="Chad Versace @chadversary" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_EXTERNAL_MEMORY_DMA_BUF_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_external_memory_dma_buf&quot;"    name="VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME"/>
+                <enum bitpos="9" extends="VkExternalMemoryHandleTypeFlagBits" name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_queue_family_foreign" number="127" type="device" author="EXT" requires="VK_KHR_external_memory" contact="Chad Versace @chadversary" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_QUEUE_FAMILY_FOREIGN_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_queue_family_foreign&quot;"       name="VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME"/>
+                <enum                                                       name="VK_QUEUE_FAMILY_FOREIGN_EXT"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_dedicated_allocation" number="128" type="device" author="KHR" requires="VK_KHR_get_memory_requirements2" contact="James Jones @cubanismo" supported="vulkan" promotedto="VK_VERSION_1_1">
+            <require>
+                <enum value="3"                                             name="VK_KHR_DEDICATED_ALLOCATION_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_dedicated_allocation&quot;"       name="VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR" alias="VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR" alias="VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO"/>
+                <type name="VkMemoryDedicatedRequirementsKHR"/>
+                <type name="VkMemoryDedicatedAllocateInfoKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_debug_utils" number="129" type="instance" author="EXT" contact="Mark Young @marky-lunarg" specialuse="debugging" supported="vulkan">
+            <require>
+                <enum value="2"                                             name="VK_EXT_DEBUG_UTILS_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_debug_utils&quot;"                name="VK_EXT_DEBUG_UTILS_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_TAG_INFO_EXT"/>
+                <enum offset="2" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT"/>
+                <enum offset="3" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT"/>
+                <enum offset="4" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT"/>
+                <enum offset="0" extends="VkObjectType"                     name="VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT"/>
+                <type name="PFN_vkDebugUtilsMessengerCallbackEXT"/>
+                <type name="VkDebugUtilsLabelEXT"/>
+                <type name="VkDebugUtilsMessageSeverityFlagBitsEXT"/>
+                <type name="VkDebugUtilsMessageSeverityFlagsEXT"/>
+                <type name="VkDebugUtilsMessageTypeFlagBitsEXT"/>
+                <type name="VkDebugUtilsMessageTypeFlagsEXT"/>
+                <type name="VkDebugUtilsMessengerCallbackDataEXT"/>
+                <type name="VkDebugUtilsMessengerCallbackDataFlagsEXT"/>
+                <type name="VkDebugUtilsMessengerCreateFlagsEXT"/>
+                <type name="VkDebugUtilsMessengerCreateInfoEXT"/>
+                <type name="VkDebugUtilsMessengerEXT"/>
+                <type name="VkDebugUtilsObjectNameInfoEXT"/>
+                <type name="VkDebugUtilsObjectTagInfoEXT"/>
+                <command name="vkSetDebugUtilsObjectNameEXT"/>
+                <command name="vkSetDebugUtilsObjectTagEXT"/>
+                <command name="vkQueueBeginDebugUtilsLabelEXT"/>
+                <command name="vkQueueEndDebugUtilsLabelEXT"/>
+                <command name="vkQueueInsertDebugUtilsLabelEXT"/>
+                <command name="vkCmdBeginDebugUtilsLabelEXT"/>
+                <command name="vkCmdEndDebugUtilsLabelEXT"/>
+                <command name="vkCmdInsertDebugUtilsLabelEXT"/>
+                <command name="vkCreateDebugUtilsMessengerEXT"/>
+                <command name="vkDestroyDebugUtilsMessengerEXT"/>
+                <command name="vkSubmitDebugUtilsMessageEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_ANDROID_external_memory_android_hardware_buffer" number="130" type="device" author="ANDROID" requires="VK_KHR_sampler_ycbcr_conversion,VK_KHR_external_memory,VK_EXT_queue_family_foreign,VK_KHR_dedicated_allocation" platform="android" contact="Jesse Hall @critsec" supported="vulkan">
+            <require>
+                <enum value="4"                                             name="VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_SPEC_VERSION"/>
+                <enum value="&quot;VK_ANDROID_external_memory_android_hardware_buffer&quot;" name="VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME"/>
+                <enum bitpos="10" extends="VkExternalMemoryHandleTypeFlagBits" name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID"/>
+                <enum offset="2" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID"/>
+                <enum offset="3" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID"/>
+                <enum offset="4" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_MEMORY_GET_ANDROID_HARDWARE_BUFFER_INFO_ANDROID"/>
+                <enum offset="5" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID"/>
+                <type name="VkAndroidHardwareBufferUsageANDROID"/>
+                <type name="VkAndroidHardwareBufferPropertiesANDROID"/>
+                <type name="VkAndroidHardwareBufferFormatPropertiesANDROID"/>
+                <type name="VkImportAndroidHardwareBufferInfoANDROID"/>
+                <type name="VkMemoryGetAndroidHardwareBufferInfoANDROID"/>
+                <type name="VkExternalFormatANDROID"/>
+                <command name="vkGetAndroidHardwareBufferPropertiesANDROID"/>
+                <command name="vkGetMemoryAndroidHardwareBufferANDROID"/>
+                <type name="AHardwareBuffer"/>
+            </require>
+            <require extension="VK_KHR_format_feature_flags2">
+                <type name="VkAndroidHardwareBufferFormatProperties2ANDROID"/>
+                <enum offset="6" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_sampler_filter_minmax" number="131" type="device" author="NV" requires="VK_KHR_get_physical_device_properties2" contact="Jeff Bolz @jeffbolznv" supported="vulkan" promotedto="VK_VERSION_1_2">
+            <require>
+                <enum value="2"                                             name="VK_EXT_SAMPLER_FILTER_MINMAX_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_sampler_filter_minmax&quot;"      name="VK_EXT_SAMPLER_FILTER_MINMAX_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES_EXT" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO_EXT" alias="VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO"/>
+                <enum extends="VkFormatFeatureFlagBits"                     name="VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT_EXT" alias="VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT"/>
+                <enum extends="VkSamplerReductionMode"                      name="VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT" alias="VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE"/>
+                <enum extends="VkSamplerReductionMode"                      name="VK_SAMPLER_REDUCTION_MODE_MIN_EXT" alias="VK_SAMPLER_REDUCTION_MODE_MIN"/>
+                <enum extends="VkSamplerReductionMode"                      name="VK_SAMPLER_REDUCTION_MODE_MAX_EXT" alias="VK_SAMPLER_REDUCTION_MODE_MAX"/>
+                <type name="VkSamplerReductionModeEXT"/>
+                <type name="VkSamplerReductionModeCreateInfoEXT"/>
+                <type name="VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_storage_buffer_storage_class" number="132" type="device" author="KHR" contact="Alexander Galazin @alegal-arm" supported="vulkan" promotedto="VK_VERSION_1_1">
+            <require>
+                <enum value="1"                                             name="VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_storage_buffer_storage_class&quot;" name="VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_gpu_shader_int16" number="133" type="device" author="AMD" contact="Qun Lin @linqun" supported="vulkan" deprecatedby="VK_KHR_shader_float16_int8">
+            <require>
+                <enum value="2"                                             name="VK_AMD_GPU_SHADER_INT16_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_gpu_shader_int16&quot;"           name="VK_AMD_GPU_SHADER_INT16_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_134" number="134" author="AMD" contact="Mais Alnasser @malnasse" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_AMD_EXTENSION_134_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_134&quot;"              name="VK_AMD_EXTENSION_134_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_135" number="135" author="AMD" contact="Mais Alnasser @malnasse" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_AMD_EXTENSION_135_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_135&quot;"              name="VK_AMD_EXTENSION_135_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_136" number="136" author="AMD" contact="Mais Alnasser @malnasse" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_AMD_EXTENSION_136_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_136&quot;"              name="VK_AMD_EXTENSION_136_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_mixed_attachment_samples" number="137" type="device" author="AMD" contact="Matthaeus G. Chajdas @anteru" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_AMD_MIXED_ATTACHMENT_SAMPLES_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_mixed_attachment_samples&quot;"   name="VK_AMD_MIXED_ATTACHMENT_SAMPLES_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_shader_fragment_mask" number="138" author="AMD" contact="Aaron Hagan @AaronHaganAMD" supported="vulkan" type="device">
+            <require>
+                <enum value="1"                                             name="VK_AMD_SHADER_FRAGMENT_MASK_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_shader_fragment_mask&quot;"       name="VK_AMD_SHADER_FRAGMENT_MASK_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_inline_uniform_block" number="139" type="device" author="EXT" requires="VK_KHR_get_physical_device_properties2,VK_KHR_maintenance1" contact="Daniel Rakos @aqnuep" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_INLINE_UNIFORM_BLOCK_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_inline_uniform_block&quot;"       name="VK_EXT_INLINE_UNIFORM_BLOCK_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkDescriptorType"                 name="VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT"/>
+                <enum offset="2" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT"/>
+                <enum offset="3" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO_EXT"/>
+                <type name="VkPhysicalDeviceInlineUniformBlockFeaturesEXT"/>
+                <type name="VkPhysicalDeviceInlineUniformBlockPropertiesEXT"/>
+                <type name="VkWriteDescriptorSetInlineUniformBlockEXT"/>
+                <type name="VkDescriptorPoolInlineUniformBlockCreateInfoEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_140" number="140" author="AMD" contact="Mais Alnasser @malnasse" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_AMD_EXTENSION_140_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_140&quot;"              name="VK_AMD_EXTENSION_140_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_shader_stencil_export" number="141" type="device" author="EXT" contact="Dominik Witczak @dominikwitczakamd" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_SHADER_STENCIL_EXPORT_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_shader_stencil_export&quot;"      name="VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_142" number="142" author="AMD" contact="Mais Alnasser @malnasse" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_AMD_EXTENSION_142_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_142&quot;"              name="VK_AMD_EXTENSION_142_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_143" number="143" author="AMD" contact="Mais Alnasser @malnasse" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_AMD_EXTENSION_143_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_143&quot;"              name="VK_AMD_EXTENSION_143_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_sample_locations" number="144" type="device" author="AMD" contact="Daniel Rakos @drakos-amd" supported="vulkan" requires="VK_KHR_get_physical_device_properties2">
+            <require>
+                <enum value="1"                                             name="VK_EXT_SAMPLE_LOCATIONS_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_sample_locations&quot;"           name="VK_EXT_SAMPLE_LOCATIONS_EXTENSION_NAME"/>
+                <enum bitpos="12" extends="VkImageCreateFlagBits"           name="VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT"/>
+                <enum offset="2" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT"/>
+                <enum offset="3" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT"/>
+                <enum offset="4" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT"/>
+                <enum offset="0" extends="VkDynamicState"                   name="VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT"/>
+                <type name="VkSampleLocationEXT"/>
+                <type name="VkSampleLocationsInfoEXT"/>
+                <type name="VkAttachmentSampleLocationsEXT"/>
+                <type name="VkSubpassSampleLocationsEXT"/>
+                <type name="VkRenderPassSampleLocationsBeginInfoEXT"/>
+                <type name="VkPipelineSampleLocationsStateCreateInfoEXT"/>
+                <type name="VkPhysicalDeviceSampleLocationsPropertiesEXT"/>
+                <type name="VkMultisamplePropertiesEXT"/>
+                <command name="vkCmdSetSampleLocationsEXT"/>
+                <command name="vkGetPhysicalDeviceMultisamplePropertiesEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_relaxed_block_layout" number="145" type="device" author="KHR" contact="John Kessenich @johnkslang" supported="vulkan" promotedto="VK_VERSION_1_1">
+            <require>
+                <enum value="1"                                             name="VK_KHR_RELAXED_BLOCK_LAYOUT_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_relaxed_block_layout&quot;"       name="VK_KHR_RELAXED_BLOCK_LAYOUT_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_RESERVED_do_not_use_146" number="146" supported="disabled" comment="Used for functionality subsumed into Vulkan 1.1 and not published as an extension">
+            <require>
+                <enum value="1"                                             name="VK_RESERVED_DO_NOT_USE_146_SPEC_VERSION"/>
+                <enum value="&quot;VK_RESERVED_do_not_use_146&quot;"        name="VK_RESERVED_DO_NOT_USE_146_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_get_memory_requirements2" number="147" type="device" author="KHR" contact="Jason Ekstrand @jekstrand" supported="vulkan" promotedto="VK_VERSION_1_1">
+            <require>
+                <enum value="1" name="VK_KHR_GET_MEMORY_REQUIREMENTS_2_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_get_memory_requirements2&quot;"   name="VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2_KHR" alias="VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR" alias="VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2_KHR" alias="VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR" alias="VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2_KHR" alias="VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2"/>
+                <type name="VkBufferMemoryRequirementsInfo2KHR"/>
+                <type name="VkImageMemoryRequirementsInfo2KHR"/>
+                <type name="VkImageSparseMemoryRequirementsInfo2KHR"/>
+                <type name="VkMemoryRequirements2KHR"/>
+                <type name="VkSparseImageMemoryRequirements2KHR"/>
+                <command name="vkGetImageMemoryRequirements2KHR"/>
+                <command name="vkGetBufferMemoryRequirements2KHR"/>
+                <command name="vkGetImageSparseMemoryRequirements2KHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_image_format_list" number="148" type="device" author="KHR" contact="Jason Ekstrand @jekstrand" supported="vulkan" promotedto="VK_VERSION_1_2">
+            <require>
+                <enum value="1"                                             name="VK_KHR_IMAGE_FORMAT_LIST_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_image_format_list&quot;"          name="VK_KHR_IMAGE_FORMAT_LIST_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR" alias="VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO"/>
+                <type name="VkImageFormatListCreateInfoKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_blend_operation_advanced" number="149" type="device" author="NV" contact="Jeff Bolz @jeffbolznv" supported="vulkan">
+            <require>
+                <enum value="2"                                             name="VK_EXT_BLEND_OPERATION_ADVANCED_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_blend_operation_advanced&quot;"   name="VK_EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT"/>
+                <enum offset="2" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT"/>
+                <type name="VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT"/>
+                <type name="VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT"/>
+                <type name="VkPipelineColorBlendAdvancedStateCreateInfoEXT"/>
+                <type name="VkBlendOverlapEXT"/>
+                <enum offset="0" extends="VkBlendOp"                        name="VK_BLEND_OP_ZERO_EXT"/>
+                <enum offset="1" extends="VkBlendOp"                        name="VK_BLEND_OP_SRC_EXT"/>
+                <enum offset="2" extends="VkBlendOp"                        name="VK_BLEND_OP_DST_EXT"/>
+                <enum offset="3" extends="VkBlendOp"                        name="VK_BLEND_OP_SRC_OVER_EXT"/>
+                <enum offset="4" extends="VkBlendOp"                        name="VK_BLEND_OP_DST_OVER_EXT"/>
+                <enum offset="5" extends="VkBlendOp"                        name="VK_BLEND_OP_SRC_IN_EXT"/>
+                <enum offset="6" extends="VkBlendOp"                        name="VK_BLEND_OP_DST_IN_EXT"/>
+                <enum offset="7" extends="VkBlendOp"                        name="VK_BLEND_OP_SRC_OUT_EXT"/>
+                <enum offset="8" extends="VkBlendOp"                        name="VK_BLEND_OP_DST_OUT_EXT"/>
+                <enum offset="9" extends="VkBlendOp"                        name="VK_BLEND_OP_SRC_ATOP_EXT"/>
+                <enum offset="10" extends="VkBlendOp"                       name="VK_BLEND_OP_DST_ATOP_EXT"/>
+                <enum offset="11" extends="VkBlendOp"                       name="VK_BLEND_OP_XOR_EXT"/>
+                <enum offset="12" extends="VkBlendOp"                       name="VK_BLEND_OP_MULTIPLY_EXT"/>
+                <enum offset="13" extends="VkBlendOp"                       name="VK_BLEND_OP_SCREEN_EXT"/>
+                <enum offset="14" extends="VkBlendOp"                       name="VK_BLEND_OP_OVERLAY_EXT"/>
+                <enum offset="15" extends="VkBlendOp"                       name="VK_BLEND_OP_DARKEN_EXT"/>
+                <enum offset="16" extends="VkBlendOp"                       name="VK_BLEND_OP_LIGHTEN_EXT"/>
+                <enum offset="17" extends="VkBlendOp"                       name="VK_BLEND_OP_COLORDODGE_EXT"/>
+                <enum offset="18" extends="VkBlendOp"                       name="VK_BLEND_OP_COLORBURN_EXT"/>
+                <enum offset="19" extends="VkBlendOp"                       name="VK_BLEND_OP_HARDLIGHT_EXT"/>
+                <enum offset="20" extends="VkBlendOp"                       name="VK_BLEND_OP_SOFTLIGHT_EXT"/>
+                <enum offset="21" extends="VkBlendOp"                       name="VK_BLEND_OP_DIFFERENCE_EXT"/>
+                <enum offset="22" extends="VkBlendOp"                       name="VK_BLEND_OP_EXCLUSION_EXT"/>
+                <enum offset="23" extends="VkBlendOp"                       name="VK_BLEND_OP_INVERT_EXT"/>
+                <enum offset="24" extends="VkBlendOp"                       name="VK_BLEND_OP_INVERT_RGB_EXT"/>
+                <enum offset="25" extends="VkBlendOp"                       name="VK_BLEND_OP_LINEARDODGE_EXT"/>
+                <enum offset="26" extends="VkBlendOp"                       name="VK_BLEND_OP_LINEARBURN_EXT"/>
+                <enum offset="27" extends="VkBlendOp"                       name="VK_BLEND_OP_VIVIDLIGHT_EXT"/>
+                <enum offset="28" extends="VkBlendOp"                       name="VK_BLEND_OP_LINEARLIGHT_EXT"/>
+                <enum offset="29" extends="VkBlendOp"                       name="VK_BLEND_OP_PINLIGHT_EXT"/>
+                <enum offset="30" extends="VkBlendOp"                       name="VK_BLEND_OP_HARDMIX_EXT"/>
+                <enum offset="31" extends="VkBlendOp"                       name="VK_BLEND_OP_HSL_HUE_EXT"/>
+                <enum offset="32" extends="VkBlendOp"                       name="VK_BLEND_OP_HSL_SATURATION_EXT"/>
+                <enum offset="33" extends="VkBlendOp"                       name="VK_BLEND_OP_HSL_COLOR_EXT"/>
+                <enum offset="34" extends="VkBlendOp"                       name="VK_BLEND_OP_HSL_LUMINOSITY_EXT"/>
+                <enum offset="35" extends="VkBlendOp"                       name="VK_BLEND_OP_PLUS_EXT"/>
+                <enum offset="36" extends="VkBlendOp"                       name="VK_BLEND_OP_PLUS_CLAMPED_EXT"/>
+                <enum offset="37" extends="VkBlendOp"                       name="VK_BLEND_OP_PLUS_CLAMPED_ALPHA_EXT"/>
+                <enum offset="38" extends="VkBlendOp"                       name="VK_BLEND_OP_PLUS_DARKER_EXT"/>
+                <enum offset="39" extends="VkBlendOp"                       name="VK_BLEND_OP_MINUS_EXT"/>
+                <enum offset="40" extends="VkBlendOp"                       name="VK_BLEND_OP_MINUS_CLAMPED_EXT"/>
+                <enum offset="41" extends="VkBlendOp"                       name="VK_BLEND_OP_CONTRAST_EXT"/>
+                <enum offset="42" extends="VkBlendOp"                       name="VK_BLEND_OP_INVERT_OVG_EXT"/>
+                <enum offset="43" extends="VkBlendOp"                       name="VK_BLEND_OP_RED_EXT"/>
+                <enum offset="44" extends="VkBlendOp"                       name="VK_BLEND_OP_GREEN_EXT"/>
+                <enum offset="45" extends="VkBlendOp"                       name="VK_BLEND_OP_BLUE_EXT"/>
+                <enum bitpos="19" extends="VkAccessFlagBits"                name="VK_ACCESS_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_fragment_coverage_to_color" number="150" type="device" author="NV" contact="Jeff Bolz @jeffbolznv" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_NV_FRAGMENT_COVERAGE_TO_COLOR_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_fragment_coverage_to_color&quot;"  name="VK_NV_FRAGMENT_COVERAGE_TO_COLOR_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV"/>
+                <type name="VkPipelineCoverageToColorStateCreateFlagsNV"/>
+                <type name="VkPipelineCoverageToColorStateCreateInfoNV"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_acceleration_structure" number="151" type="device" requiresCore="1.1" requires="VK_EXT_descriptor_indexing,VK_KHR_buffer_device_address,VK_KHR_deferred_host_operations" author="KHR" contact="Daniel Koch @dgkoch" supported="vulkan" sortorder="1">
+            <require>
+                <enum value="13"                                            name="VK_KHR_ACCELERATION_STRUCTURE_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_acceleration_structure&quot;"     name="VK_KHR_ACCELERATION_STRUCTURE_EXTENSION_NAME"/>
+                <enum offset="7"  extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR"/>
+                <enum offset="0"  extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR"/>
+                <enum offset="2"  extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_DEVICE_ADDRESS_INFO_KHR"/>
+                <enum offset="3"  extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_AABBS_DATA_KHR"/>
+                <enum offset="4"  extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_INSTANCES_DATA_KHR"/>
+                <enum offset="5"  extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR"/>
+                <enum offset="6"  extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR"/>
+                <enum offset="9"  extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_VERSION_INFO_KHR"/>
+                <enum offset="10" extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_INFO_KHR"/>
+                <enum offset="11" extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_TO_MEMORY_INFO_KHR"/>
+                <enum offset="12" extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_COPY_MEMORY_TO_ACCELERATION_STRUCTURE_INFO_KHR"/>
+                <enum offset="13" extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR"/>
+                <enum offset="14" extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR"/>
+                <enum offset="17" extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR"/>
+                <enum offset="20" extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_SIZES_INFO_KHR"/>
+                <enum bitpos="25" extends="VkPipelineStageFlagBits"         name="VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR"/>
+                <enum offset="0"  extends="VkDescriptorType"                name="VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR"/>
+                <enum bitpos="21" extends="VkAccessFlagBits"                name="VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR"/>
+                <enum bitpos="22" extends="VkAccessFlagBits"                name="VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR"/>
+                <enum offset="0"  extends="VkQueryType"                     name="VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR"/>
+                <enum offset="1"  extends="VkQueryType"                     name="VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR"/>
+                <enum offset="0"  extends="VkObjectType"                    name="VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR"/>
+                <enum offset="0"  extends="VkDebugReportObjectTypeEXT"      name="VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR_EXT"/>
+                <enum offset="0"  extends="VkIndexType" extnumber="166"     name="VK_INDEX_TYPE_NONE_KHR"/>
+                <enum bitpos="29" extends="VkFormatFeatureFlagBits"         name="VK_FORMAT_FEATURE_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR"/>
+                <enum bitpos="19" extends="VkBufferUsageFlagBits"           name="VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR"/>
+                <enum bitpos="20" extends="VkBufferUsageFlagBits"           name="VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR"/>
+                <type name="VkAccelerationStructureTypeKHR"/>
+                <type name="VkDeviceOrHostAddressKHR"/>
+                <type name="VkDeviceOrHostAddressConstKHR"/>
+                <type name="VkAccelerationStructureBuildRangeInfoKHR"/>
+                <type name="VkAabbPositionsKHR"/>
+                <type name="VkAccelerationStructureGeometryTrianglesDataKHR"/>
+                <type name="VkTransformMatrixKHR"/>
+                <type name="VkAccelerationStructureBuildGeometryInfoKHR"/>
+                <type name="VkAccelerationStructureBuildTypeKHR"/>
+                <type name="VkAccelerationStructureGeometryAabbsDataKHR"/>
+                <type name="VkAccelerationStructureInstanceKHR"/>
+                <type name="VkAccelerationStructureGeometryInstancesDataKHR"/>
+                <type name="VkAccelerationStructureGeometryDataKHR"/>
+                <type name="VkAccelerationStructureGeometryKHR"/>
+                <type name="VkGeometryFlagsKHR"/>
+                <type name="VkGeometryInstanceFlagsKHR"/>
+                <type name="VkGeometryFlagBitsKHR"/>
+                <type name="VkGeometryInstanceFlagBitsKHR"/>
+                <type name="VkAccelerationStructureCreateInfoKHR"/>
+                <type name="VkAccelerationStructureKHR"/>
+                <type name="VkBuildAccelerationStructureFlagBitsKHR"/>
+                <type name="VkBuildAccelerationStructureFlagsKHR"/>
+                <type name="VkCopyAccelerationStructureModeKHR"/>
+                <type name="VkGeometryTypeKHR"/>
+                <type name="VkWriteDescriptorSetAccelerationStructureKHR"/>
+                <type name="VkPhysicalDeviceAccelerationStructureFeaturesKHR"/>
+                <type name="VkPhysicalDeviceAccelerationStructurePropertiesKHR"/>
+                <type name="VkAccelerationStructureDeviceAddressInfoKHR"/>
+                <type name="VkAccelerationStructureVersionInfoKHR"/>
+                <type name="VkCopyAccelerationStructureToMemoryInfoKHR"/>
+                <type name="VkCopyMemoryToAccelerationStructureInfoKHR"/>
+                <type name="VkCopyAccelerationStructureInfoKHR"/>
+                <type name="VkAccelerationStructureCompatibilityKHR"/>
+                <type name="VkAccelerationStructureCreateFlagBitsKHR"/>
+                <type name="VkAccelerationStructureCreateFlagsKHR"/>
+                <type name="VkBuildAccelerationStructureModeKHR"/>
+                <type name="VkAccelerationStructureBuildSizesInfoKHR"/>
+                <command name="vkCreateAccelerationStructureKHR"/>
+                <command name="vkDestroyAccelerationStructureKHR"/>
+                <command name="vkCmdBuildAccelerationStructuresKHR"/>
+                <command name="vkCmdBuildAccelerationStructuresIndirectKHR"/>
+                <command name="vkBuildAccelerationStructuresKHR"/>
+                <command name="vkCopyAccelerationStructureKHR"/>
+                <command name="vkCopyAccelerationStructureToMemoryKHR"/>
+                <command name="vkCopyMemoryToAccelerationStructureKHR"/>
+                <command name="vkWriteAccelerationStructuresPropertiesKHR"/>
+                <command name="vkCmdCopyAccelerationStructureKHR"/>
+                <command name="vkCmdCopyAccelerationStructureToMemoryKHR"/>
+                <command name="vkCmdCopyMemoryToAccelerationStructureKHR"/>
+                <command name="vkGetAccelerationStructureDeviceAddressKHR"/>
+                <command name="vkCmdWriteAccelerationStructuresPropertiesKHR"/>
+                <command name="vkGetDeviceAccelerationStructureCompatibilityKHR"/>
+                <command name="vkGetAccelerationStructureBuildSizesKHR"/>
+            </require>
+            <require extension="VK_KHR_format_feature_flags2">
+                <enum bitpos="29" extends="VkFormatFeatureFlagBits2KHR"     name="VK_FORMAT_FEATURE_2_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_ray_tracing_pipeline" number="348" type="device" requiresCore="1.1" requires="VK_KHR_spirv_1_4,VK_KHR_acceleration_structure" author="KHR" contact="Daniel Koch @dgkoch" supported="vulkan" sortorder="1">
+            <require>
+                <enum value="1"                                             name="VK_KHR_RAY_TRACING_PIPELINE_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_ray_tracing_pipeline&quot;"       name="VK_KHR_RAY_TRACING_PIPELINE_EXTENSION_NAME"/>
+                <enum                                                       name="VK_SHADER_UNUSED_KHR"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR"/>
+                <enum offset="15" extends="VkStructureType" extnumber="151" name="VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_KHR"/>
+                <enum offset="16" extends="VkStructureType" extnumber="151" name="VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_KHR"/>
+                <enum offset="18" extends="VkStructureType" extnumber="151" name="VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_INTERFACE_CREATE_INFO_KHR"/>
+                <enum bitpos="8"  extends="VkShaderStageFlagBits"           name="VK_SHADER_STAGE_RAYGEN_BIT_KHR"/>
+                <enum bitpos="9"  extends="VkShaderStageFlagBits"           name="VK_SHADER_STAGE_ANY_HIT_BIT_KHR"/>
+                <enum bitpos="10" extends="VkShaderStageFlagBits"           name="VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR"/>
+                <enum bitpos="11" extends="VkShaderStageFlagBits"           name="VK_SHADER_STAGE_MISS_BIT_KHR"/>
+                <enum bitpos="12" extends="VkShaderStageFlagBits"           name="VK_SHADER_STAGE_INTERSECTION_BIT_KHR"/>
+                <enum bitpos="13" extends="VkShaderStageFlagBits"           name="VK_SHADER_STAGE_CALLABLE_BIT_KHR"/>
+                <enum bitpos="21" extends="VkPipelineStageFlagBits"         name="VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR"/>
+                <enum bitpos="10" extends="VkBufferUsageFlagBits"           name="VK_BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR"/>
+                <enum offset="0"  extends="VkPipelineBindPoint" extnumber="166" name="VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR"/>
+                <enum bitpos="14" extends="VkPipelineCreateFlagBits"        name="VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR"/>
+                <enum bitpos="15" extends="VkPipelineCreateFlagBits"        name="VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR"/>
+                <enum bitpos="16" extends="VkPipelineCreateFlagBits"        name="VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR"/>
+                <enum bitpos="17" extends="VkPipelineCreateFlagBits"        name="VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR"/>
+                <enum bitpos="12" extends="VkPipelineCreateFlagBits"        name="VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR"/>
+                <enum bitpos="13" extends="VkPipelineCreateFlagBits"        name="VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR"/>
+                <enum bitpos="19" extends="VkPipelineCreateFlagBits"        name="VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR"/>
+                <enum offset="0"  extends="VkDynamicState"                  name="VK_DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR"/>
+                <type name="VkRayTracingShaderGroupCreateInfoKHR"/>
+                <type name="VkRayTracingShaderGroupTypeKHR"/>
+                <type name="VkRayTracingPipelineCreateInfoKHR"/>
+                <type name="VkPhysicalDeviceRayTracingPipelineFeaturesKHR"/>
+                <type name="VkPhysicalDeviceRayTracingPipelinePropertiesKHR"/>
+                <type name="VkStridedDeviceAddressRegionKHR"/>
+                <type name="VkTraceRaysIndirectCommandKHR"/>
+                <type name="VkRayTracingPipelineInterfaceCreateInfoKHR"/>
+                <type name="VkShaderGroupShaderKHR"/>
+                <command name="vkCmdTraceRaysKHR"/>
+                <command name="vkCreateRayTracingPipelinesKHR"/>
+                <command name="vkGetRayTracingShaderGroupHandlesKHR"/>
+                <command name="vkGetRayTracingCaptureReplayShaderGroupHandlesKHR"/>
+                <command name="vkCmdTraceRaysIndirectKHR"/>
+                <command name="vkGetRayTracingShaderGroupStackSizeKHR"/>
+                <command name="vkCmdSetRayTracingPipelineStackSizeKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_ray_query" number="349" type="device" requiresCore="1.1" requires="VK_KHR_spirv_1_4,VK_KHR_acceleration_structure" author="KHR" contact="Daniel Koch @dgkoch" supported="vulkan" sortorder="1">
+            <require>
+                <enum value="1"                                             name="VK_KHR_RAY_QUERY_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_ray_query&quot;"                  name="VK_KHR_RAY_QUERY_EXTENSION_NAME"/>
+                <enum offset="13" extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR"/>
+                <type name="VkPhysicalDeviceRayQueryFeaturesKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_extension_152" number="152" author="NV" contact="Jeff Bolz @jeffbolznv" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_NV_EXTENSION_152_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_extension_152&quot;"               name="VK_NV_EXTENSION_152_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_framebuffer_mixed_samples" number="153" type="device" author="NV" contact="Jeff Bolz @jeffbolznv" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_NV_FRAMEBUFFER_MIXED_SAMPLES_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_framebuffer_mixed_samples&quot;"   name="VK_NV_FRAMEBUFFER_MIXED_SAMPLES_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV"/>
+                <type name="VkPipelineCoverageModulationStateCreateInfoNV"/>
+                <type name="VkPipelineCoverageModulationStateCreateFlagsNV"/>
+                <type name="VkCoverageModulationModeNV"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_fill_rectangle" number="154" type="device" author="NV" contact="Jeff Bolz @jeffbolznv" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_NV_FILL_RECTANGLE_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_fill_rectangle&quot;"              name="VK_NV_FILL_RECTANGLE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkPolygonMode"                    name="VK_POLYGON_MODE_FILL_RECTANGLE_NV"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_shader_sm_builtins" number="155" type="device" requiresCore="1.1" author="NV" contact="Daniel Koch @dgkoch" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_NV_SHADER_SM_BUILTINS_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_shader_sm_builtins&quot;"          name="VK_NV_SHADER_SM_BUILTINS_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV"/>
+                <type name="VkPhysicalDeviceShaderSMBuiltinsPropertiesNV"/>
+                <type name="VkPhysicalDeviceShaderSMBuiltinsFeaturesNV"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_post_depth_coverage" number="156" type="device" author="NV" contact="Daniel Koch @dgkoch" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_POST_DEPTH_COVERAGE_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_post_depth_coverage&quot;"        name="VK_EXT_POST_DEPTH_COVERAGE_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_sampler_ycbcr_conversion" number="157" type="device" requires="VK_KHR_maintenance1,VK_KHR_bind_memory2,VK_KHR_get_memory_requirements2,VK_KHR_get_physical_device_properties2" author="KHR" contact="Andrew Garrard @fluppeteer" supported="vulkan" promotedto="VK_VERSION_1_1">
+            <require>
+                <enum value="14"                                            name="VK_KHR_SAMPLER_YCBCR_CONVERSION_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_sampler_ycbcr_conversion&quot;"   name="VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO_KHR" alias="VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO_KHR" alias="VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO_KHR" alias="VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO_KHR" alias="VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES_KHR" alias="VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES"/>
+                <enum extends="VkDebugReportObjectTypeEXT"                  name="VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR_EXT" alias="VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT"/>
+                <enum extends="VkObjectType"                                name="VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR" alias="VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_G8B8G8R8_422_UNORM_KHR" alias="VK_FORMAT_G8B8G8R8_422_UNORM"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_B8G8R8G8_422_UNORM_KHR" alias="VK_FORMAT_B8G8R8G8_422_UNORM"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR" alias="VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR" alias="VK_FORMAT_G8_B8R8_2PLANE_420_UNORM"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR" alias="VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR" alias="VK_FORMAT_G8_B8R8_2PLANE_422_UNORM"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR" alias="VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_R10X6_UNORM_PACK16_KHR" alias="VK_FORMAT_R10X6_UNORM_PACK16"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR" alias="VK_FORMAT_R10X6G10X6_UNORM_2PACK16"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR" alias="VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR" alias="VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR" alias="VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR" alias="VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR" alias="VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR" alias="VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR" alias="VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR" alias="VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_R12X4_UNORM_PACK16_KHR" alias="VK_FORMAT_R12X4_UNORM_PACK16"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR" alias="VK_FORMAT_R12X4G12X4_UNORM_2PACK16"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR" alias="VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR" alias="VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR" alias="VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR" alias="VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR" alias="VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR" alias="VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR" alias="VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR" alias="VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_G16B16G16R16_422_UNORM_KHR" alias="VK_FORMAT_G16B16G16R16_422_UNORM"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_B16G16R16G16_422_UNORM_KHR" alias="VK_FORMAT_B16G16R16G16_422_UNORM"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR" alias="VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR" alias="VK_FORMAT_G16_B16R16_2PLANE_420_UNORM"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR" alias="VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR" alias="VK_FORMAT_G16_B16R16_2PLANE_422_UNORM"/>
+                <enum extends="VkFormat"                                    name="VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR" alias="VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM"/>
+                <enum extends="VkImageAspectFlagBits"                       name="VK_IMAGE_ASPECT_PLANE_0_BIT_KHR" alias="VK_IMAGE_ASPECT_PLANE_0_BIT"/>
+                <enum extends="VkImageAspectFlagBits"                       name="VK_IMAGE_ASPECT_PLANE_1_BIT_KHR" alias="VK_IMAGE_ASPECT_PLANE_1_BIT"/>
+                <enum extends="VkImageAspectFlagBits"                       name="VK_IMAGE_ASPECT_PLANE_2_BIT_KHR" alias="VK_IMAGE_ASPECT_PLANE_2_BIT"/>
+                <enum extends="VkImageCreateFlagBits"                       name="VK_IMAGE_CREATE_DISJOINT_BIT_KHR" alias="VK_IMAGE_CREATE_DISJOINT_BIT"/>
+                <enum extends="VkFormatFeatureFlagBits"                     name="VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT_KHR" alias="VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT"/>
+                <enum extends="VkFormatFeatureFlagBits"                     name="VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT_KHR" alias="VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT"/>
+                <enum extends="VkFormatFeatureFlagBits"                     name="VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT_KHR" alias="VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT"/>
+                <enum extends="VkFormatFeatureFlagBits"                     name="VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT_KHR" alias="VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT"/>
+                <enum extends="VkFormatFeatureFlagBits"                     name="VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT_KHR" alias="VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT"/>
+                <enum extends="VkFormatFeatureFlagBits"                     name="VK_FORMAT_FEATURE_DISJOINT_BIT_KHR" alias="VK_FORMAT_FEATURE_DISJOINT_BIT"/>
+                <enum extends="VkFormatFeatureFlagBits"                     name="VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT_KHR" alias="VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT"/>
+                <type name="VkSamplerYcbcrConversionCreateInfoKHR"/>
+                <type name="VkSamplerYcbcrConversionInfoKHR"/>
+                <type name="VkBindImagePlaneMemoryInfoKHR"/>
+                <type name="VkImagePlaneMemoryRequirementsInfoKHR"/>
+                <type name="VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR"/>
+                <type name="VkSamplerYcbcrConversionImageFormatPropertiesKHR"/>
+                <command name="vkCreateSamplerYcbcrConversionKHR"/>
+                <command name="vkDestroySamplerYcbcrConversionKHR"/>
+                <type name="VkSamplerYcbcrConversionKHR"/>
+                <type name="VkSamplerYcbcrModelConversionKHR"/>
+                <enum extends="VkSamplerYcbcrModelConversion"               name="VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY_KHR" alias="VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY"/>
+                <enum extends="VkSamplerYcbcrModelConversion"               name="VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY_KHR" alias="VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY"/>
+                <enum extends="VkSamplerYcbcrModelConversion"               name="VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709_KHR" alias="VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709"/>
+                <enum extends="VkSamplerYcbcrModelConversion"               name="VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601_KHR" alias="VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601"/>
+                <enum extends="VkSamplerYcbcrModelConversion"               name="VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020_KHR" alias="VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020"/>
+                <type name="VkSamplerYcbcrRangeKHR"/>
+                <enum extends="VkSamplerYcbcrRange"                         name="VK_SAMPLER_YCBCR_RANGE_ITU_FULL_KHR" alias="VK_SAMPLER_YCBCR_RANGE_ITU_FULL"/>
+                <enum extends="VkSamplerYcbcrRange"                         name="VK_SAMPLER_YCBCR_RANGE_ITU_NARROW_KHR" alias="VK_SAMPLER_YCBCR_RANGE_ITU_NARROW"/>
+                <type name="VkChromaLocationKHR"/>
+                <enum extends="VkChromaLocation"                            name="VK_CHROMA_LOCATION_COSITED_EVEN_KHR" alias="VK_CHROMA_LOCATION_COSITED_EVEN"/>
+                <enum extends="VkChromaLocation"                            name="VK_CHROMA_LOCATION_MIDPOINT_KHR" alias="VK_CHROMA_LOCATION_MIDPOINT"/>
+            </require>
+            <require extension="VK_EXT_debug_report">
+                <enum extends="VkDebugReportObjectTypeEXT" offset="0"       name="VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_bind_memory2" number="158" type="device" author="KHR" contact="Tobias Hector @tobski" supported="vulkan" promotedto="VK_VERSION_1_1">
+            <require>
+                <enum value="1"                                             name="VK_KHR_BIND_MEMORY_2_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_bind_memory2&quot;"               name="VK_KHR_BIND_MEMORY_2_EXTENSION_NAME"/>
+                <command name="vkBindBufferMemory2KHR"/>
+                <command name="vkBindImageMemory2KHR"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHR" alias="VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR" alias="VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO"/>
+                <enum extends="VkImageCreateFlagBits"                       name="VK_IMAGE_CREATE_ALIAS_BIT_KHR" alias="VK_IMAGE_CREATE_ALIAS_BIT"/>
+                <type name="VkBindBufferMemoryInfoKHR"/>
+                <type name="VkBindImageMemoryInfoKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_image_drm_format_modifier" number="159" type="device" requires="VK_KHR_bind_memory2,VK_KHR_get_physical_device_properties2,VK_KHR_image_format_list,VK_KHR_sampler_ycbcr_conversion" author="EXT" contact="Chad Versace @chadversary" supported="vulkan">
+            <require>
+                <enum value="2"                                             name="VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_image_drm_format_modifier&quot;"  name="VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME"/>
+                <enum offset="0" dir="-" extends="VkResult"                 name="VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT"/>
+                <enum offset="2" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT"/>
+                <enum offset="3" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT"/>
+                <enum offset="4" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT"/>
+                <enum offset="5" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT"/>
+                <enum offset="0" extends="VkImageTiling"                    name="VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT"/>
+                <enum bitpos="7"  extends="VkImageAspectFlagBits"           name="VK_IMAGE_ASPECT_MEMORY_PLANE_0_BIT_EXT"/>
+                <enum bitpos="8"  extends="VkImageAspectFlagBits"           name="VK_IMAGE_ASPECT_MEMORY_PLANE_1_BIT_EXT"/>
+                <enum bitpos="9"  extends="VkImageAspectFlagBits"           name="VK_IMAGE_ASPECT_MEMORY_PLANE_2_BIT_EXT"/>
+                <enum bitpos="10" extends="VkImageAspectFlagBits"           name="VK_IMAGE_ASPECT_MEMORY_PLANE_3_BIT_EXT"/>
+                <type name="VkDrmFormatModifierPropertiesListEXT"/>
+                <type name="VkDrmFormatModifierPropertiesEXT"/>
+                <type name="VkPhysicalDeviceImageDrmFormatModifierInfoEXT"/>
+                <type name="VkImageDrmFormatModifierListCreateInfoEXT"/>
+                <type name="VkImageDrmFormatModifierExplicitCreateInfoEXT"/>
+                <type name="VkImageDrmFormatModifierPropertiesEXT"/>
+                <command name="vkGetImageDrmFormatModifierPropertiesEXT"/>
+            </require>
+            <require extension="VK_KHR_format_feature_flags2">
+                <type name="VkDrmFormatModifierPropertiesList2EXT"/>
+                <type name="VkDrmFormatModifierProperties2EXT"/>
+                <enum offset="6" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_160" number="160" author="EXT" contact="Mark Young @marky-lunarg" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_EXT_EXTENSION_160_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_160&quot;"              name="VK_EXT_EXTENSION_160_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_validation_cache" number="161" type="device" author="GOOGLE" contact="Cort Stratton @cdwfs" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_VALIDATION_CACHE_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_validation_cache&quot;"           name="VK_EXT_VALIDATION_CACHE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT"/>
+                <enum offset="0" extends="VkObjectType"                     name="VK_OBJECT_TYPE_VALIDATION_CACHE_EXT"/>
+                <type name="VkValidationCacheEXT"/>
+                <type name="VkValidationCacheCreateInfoEXT"/>
+                <type name="VkShaderModuleValidationCacheCreateInfoEXT"/>
+                <type name="VkValidationCacheHeaderVersionEXT"/>
+                <type name="VkValidationCacheCreateFlagsEXT"/>
+                <command name="vkCreateValidationCacheEXT"/>
+                <command name="vkDestroyValidationCacheEXT"/>
+                <command name="vkMergeValidationCachesEXT"/>
+                <command name="vkGetValidationCacheDataEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_descriptor_indexing" number="162" type="device" requires="VK_KHR_get_physical_device_properties2,VK_KHR_maintenance3" author="NV" contact="Jeff Bolz @jeffbolznv" supported="vulkan" promotedto="VK_VERSION_1_2">
+            <require>
+                <enum value="2"                                             name="VK_EXT_DESCRIPTOR_INDEXING_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_descriptor_indexing&quot;"        name="VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO_EXT" alias="VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES_EXT" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO_EXT" alias="VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT_EXT" alias="VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT"/>
+                <enum extends="VkDescriptorBindingFlagBits"                 name="VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT" alias="VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT"/>
+                <enum extends="VkDescriptorBindingFlagBits"                 name="VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT_EXT" alias="VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT"/>
+                <enum extends="VkDescriptorBindingFlagBits"                 name="VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT_EXT" alias="VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT"/>
+                <enum extends="VkDescriptorBindingFlagBits"                 name="VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT" alias="VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT"/>
+                <enum extends="VkDescriptorPoolCreateFlagBits"              name="VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT" alias="VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT"/>
+                <enum extends="VkDescriptorSetLayoutCreateFlagBits"         name="VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT" alias="VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT"/>
+                <enum extends="VkResult"                                    name="VK_ERROR_FRAGMENTATION_EXT" alias="VK_ERROR_FRAGMENTATION"/>
+                <type name="VkDescriptorSetLayoutBindingFlagsCreateInfoEXT"/>
+                <type name="VkPhysicalDeviceDescriptorIndexingFeaturesEXT"/>
+                <type name="VkPhysicalDeviceDescriptorIndexingPropertiesEXT"/>
+                <type name="VkDescriptorSetVariableDescriptorCountAllocateInfoEXT"/>
+                <type name="VkDescriptorSetVariableDescriptorCountLayoutSupportEXT"/>
+                <type name="VkDescriptorBindingFlagBitsEXT"/>
+                <type name="VkDescriptorBindingFlagsEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_shader_viewport_index_layer" number="163" type="device" author="NV" contact="Daniel Koch @dgkoch" supported="vulkan" promotedto="VK_VERSION_1_2">
+            <require>
+                <enum value="1"                                             name="VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_shader_viewport_index_layer&quot;" name="VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_portability_subset" number="164" type="device" requires="VK_KHR_get_physical_device_properties2" author="KHR" contact="Bill Hollings @billhollings" platform="provisional" supported="vulkan" provisional="true">
+            <require>
+                <enum value="1"                                             name="VK_KHR_PORTABILITY_SUBSET_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_portability_subset&quot;"         name="VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <type name="VkPhysicalDevicePortabilitySubsetFeaturesKHR"/>
+                <type name="VkPhysicalDevicePortabilitySubsetPropertiesKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_shading_rate_image" number="165" type="device" requires="VK_KHR_get_physical_device_properties2" author="NV" contact="Pat Brown @nvpbrown" supported="vulkan">
+            <require>
+                <enum value="3"                                             name="VK_NV_SHADING_RATE_IMAGE_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_shading_rate_image&quot;"          name="VK_NV_SHADING_RATE_IMAGE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV"/>
+                <enum offset="2" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV"/>
+                <enum            extends="VkImageLayout"                    name="VK_IMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV" alias="VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR"/>
+                <enum offset="4" extends="VkDynamicState"                   name="VK_DYNAMIC_STATE_VIEWPORT_SHADING_RATE_PALETTE_NV"/>
+                <enum            extends="VkAccessFlagBits"                 name="VK_ACCESS_SHADING_RATE_IMAGE_READ_BIT_NV" alias="VK_ACCESS_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR"/>
+                <enum            extends="VkImageUsageFlagBits"             name="VK_IMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV" alias="VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR"/>
+                <enum            extends="VkPipelineStageFlagBits"          name="VK_PIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV" alias="VK_PIPELINE_STAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR"/>
+                <enum offset="5" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV"/>
+                <enum offset="6" extends="VkDynamicState"                   name="VK_DYNAMIC_STATE_VIEWPORT_COARSE_SAMPLE_ORDER_NV"/>
+                <type name="VkShadingRatePaletteEntryNV"/>
+                <type name="VkShadingRatePaletteNV"/>
+                <type name="VkPipelineViewportShadingRateImageStateCreateInfoNV"/>
+                <type name="VkPhysicalDeviceShadingRateImageFeaturesNV"/>
+                <type name="VkPhysicalDeviceShadingRateImagePropertiesNV"/>
+                <type name="VkCoarseSampleLocationNV"/>
+                <type name="VkCoarseSampleOrderCustomNV"/>
+                <type name="VkPipelineViewportCoarseSampleOrderStateCreateInfoNV"/>
+                <type name="VkCoarseSampleOrderTypeNV"/>
+                <command name="vkCmdBindShadingRateImageNV"/>
+                <command name="vkCmdSetViewportShadingRatePaletteNV"/>
+                <command name="vkCmdSetCoarseSampleOrderNV"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_ray_tracing" number="166" type="device" requires="VK_KHR_get_physical_device_properties2,VK_KHR_get_memory_requirements2" author="NV" contact="Eric Werness @ewerness-nv" supported="vulkan">
+            <require>
+                <enum value="3"                               name="VK_NV_RAY_TRACING_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_ray_tracing&quot;"   name="VK_NV_RAY_TRACING_EXTENSION_NAME"/>
+                <enum                                         name="VK_SHADER_UNUSED_NV"/>
+                <enum offset="0"  extends="VkStructureType"   name="VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NV"/>
+                <enum offset="1"  extends="VkStructureType"   name="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NV"/>
+                <enum offset="3"  extends="VkStructureType"   name="VK_STRUCTURE_TYPE_GEOMETRY_NV"/>
+                <enum offset="4"  extends="VkStructureType"   name="VK_STRUCTURE_TYPE_GEOMETRY_TRIANGLES_NV"/>
+                <enum offset="5"  extends="VkStructureType"   name="VK_STRUCTURE_TYPE_GEOMETRY_AABB_NV"/>
+                <enum offset="6"  extends="VkStructureType"   name="VK_STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NV"/>
+                <enum offset="7"  extends="VkStructureType"   name="VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV"/>
+                <enum offset="8"  extends="VkStructureType"   name="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NV"/>
+                <enum offset="9"  extends="VkStructureType"   name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV"/>
+                <enum offset="11" extends="VkStructureType"   name="VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NV"/>
+                <enum offset="12" extends="VkStructureType"   name="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV"/>
+                <enum extends="VkShaderStageFlagBits"         name="VK_SHADER_STAGE_RAYGEN_BIT_NV" alias="VK_SHADER_STAGE_RAYGEN_BIT_KHR"/>
+                <enum extends="VkShaderStageFlagBits"         name="VK_SHADER_STAGE_ANY_HIT_BIT_NV" alias="VK_SHADER_STAGE_ANY_HIT_BIT_KHR"/>
+                <enum extends="VkShaderStageFlagBits"         name="VK_SHADER_STAGE_CLOSEST_HIT_BIT_NV" alias="VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR"/>
+                <enum extends="VkShaderStageFlagBits"         name="VK_SHADER_STAGE_MISS_BIT_NV" alias="VK_SHADER_STAGE_MISS_BIT_KHR"/>
+                <enum extends="VkShaderStageFlagBits"         name="VK_SHADER_STAGE_INTERSECTION_BIT_NV" alias="VK_SHADER_STAGE_INTERSECTION_BIT_KHR"/>
+                <enum extends="VkShaderStageFlagBits"         name="VK_SHADER_STAGE_CALLABLE_BIT_NV" alias="VK_SHADER_STAGE_CALLABLE_BIT_KHR"/>
+                <enum extends="VkPipelineStageFlagBits"       name="VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_NV" alias="VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR"/>
+                <enum extends="VkPipelineStageFlagBits"       name="VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_NV" alias="VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR"/>
+                <enum extends="VkBufferUsageFlagBits"         name="VK_BUFFER_USAGE_RAY_TRACING_BIT_NV" alias="VK_BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR"/>
+                <enum extends="VkPipelineBindPoint"           name="VK_PIPELINE_BIND_POINT_RAY_TRACING_NV" alias="VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR"/>
+                <enum offset="0" extends="VkDescriptorType"   name="VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV"/>
+                <enum extends="VkAccessFlagBits"              name="VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_NV" alias="VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR"/>
+                <enum extends="VkAccessFlagBits"              name="VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_NV" alias="VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR"/>
+                <enum offset="0" extends="VkQueryType"        name="VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV"/>
+                <enum bitpos="5" extends="VkPipelineCreateFlagBits"      name="VK_PIPELINE_CREATE_DEFER_COMPILE_BIT_NV"/>
+                <enum offset="0" extends="VkObjectType"       name="VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV"/>
+                <enum offset="0" extends="VkDebugReportObjectTypeEXT" name="VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV_EXT"/>
+                <enum extends="VkIndexType"                   name="VK_INDEX_TYPE_NONE_NV" alias="VK_INDEX_TYPE_NONE_KHR"/>
+                <type name="VkRayTracingShaderGroupCreateInfoNV"/>
+                <type name="VkRayTracingShaderGroupTypeNV"/>
+                <enum extends="VkRayTracingShaderGroupTypeKHR" name="VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_NV" alias="VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR"/>
+                <enum extends="VkRayTracingShaderGroupTypeKHR" name="VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_NV" alias="VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR"/>
+                <enum extends="VkRayTracingShaderGroupTypeKHR" name="VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_NV" alias="VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR"/>
+                <type name="VkRayTracingPipelineCreateInfoNV"/>
+                <type name="VkGeometryTypeNV"/>
+                <enum extends="VkGeometryTypeKHR" name="VK_GEOMETRY_TYPE_TRIANGLES_NV" alias="VK_GEOMETRY_TYPE_TRIANGLES_KHR"/>
+                <enum extends="VkGeometryTypeKHR" name="VK_GEOMETRY_TYPE_AABBS_NV" alias="VK_GEOMETRY_TYPE_AABBS_KHR"/>
+                <type name="VkAccelerationStructureTypeNV"/>
+                <enum extends="VkAccelerationStructureTypeKHR" name="VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_NV" alias="VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR"/>
+                <enum extends="VkAccelerationStructureTypeKHR" name="VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_NV" alias="VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR"/>
+                <type name="VkGeometryTrianglesNV"/>
+                <type name="VkGeometryAABBNV"/>
+                <type name="VkGeometryDataNV"/>
+                <type name="VkGeometryNV"/>
+                <type name="VkGeometryFlagsNV"/>
+                <type name="VkGeometryFlagBitsNV"/>
+                <enum extends="VkGeometryFlagBitsKHR" name="VK_GEOMETRY_OPAQUE_BIT_NV" alias="VK_GEOMETRY_OPAQUE_BIT_KHR"/>
+                <enum extends="VkGeometryFlagBitsKHR" name="VK_GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_NV" alias="VK_GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR"/>
+                <type name="VkGeometryInstanceFlagsNV"/>
+                <type name="VkGeometryInstanceFlagBitsNV"/>
+                <enum extends="VkGeometryInstanceFlagBitsKHR" name="VK_GEOMETRY_INSTANCE_TRIANGLE_CULL_DISABLE_BIT_NV" alias="VK_GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR"/>
+                <enum extends="VkGeometryInstanceFlagBitsKHR" name="VK_GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_NV" alias="VK_GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_KHR"/>
+                <enum extends="VkGeometryInstanceFlagBitsKHR" name="VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_NV" alias="VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR"/>
+                <enum extends="VkGeometryInstanceFlagBitsKHR" name="VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_NV" alias="VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR"/>
+                <type name="VkAccelerationStructureInfoNV"/>
+                <type name="VkAccelerationStructureCreateInfoNV"/>
+                <type name="VkAccelerationStructureNV"/>
+                <type name="VkBuildAccelerationStructureFlagBitsNV"/>
+                <enum extends="VkBuildAccelerationStructureFlagBitsKHR" name="VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_NV" alias="VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR"/>
+                <enum extends="VkBuildAccelerationStructureFlagBitsKHR" name="VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_NV" alias="VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR"/>
+                <enum extends="VkBuildAccelerationStructureFlagBitsKHR" name="VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_NV" alias="VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR"/>
+                <enum extends="VkBuildAccelerationStructureFlagBitsKHR" name="VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_NV" alias="VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR"/>
+                <enum extends="VkBuildAccelerationStructureFlagBitsKHR" name="VK_BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_NV" alias="VK_BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_KHR"/>
+                <type name="VkBuildAccelerationStructureFlagsNV"/>
+                <type name="VkCopyAccelerationStructureModeNV"/>
+                <enum extends="VkCopyAccelerationStructureModeKHR" name="VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_NV" alias="VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR"/>
+                <enum extends="VkCopyAccelerationStructureModeKHR" name="VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_NV" alias="VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR"/>
+                <type name="VkBindAccelerationStructureMemoryInfoNV"/>
+                <type name="VkWriteDescriptorSetAccelerationStructureNV"/>
+                <type name="VkAccelerationStructureMemoryRequirementsInfoNV"/>
+                <type name="VkPhysicalDeviceRayTracingPropertiesNV"/>
+                <type name="VkMemoryRequirements2KHR"/>
+                <type name="VkAccelerationStructureMemoryRequirementsTypeNV"/>
+                <type name="VkTransformMatrixNV"/>
+                <type name="VkAabbPositionsNV"/>
+                <type name="VkAccelerationStructureInstanceNV"/>
+                <command name="vkCreateAccelerationStructureNV"/>
+                <command name="vkDestroyAccelerationStructureNV"/>
+                <command name="vkGetAccelerationStructureMemoryRequirementsNV"/>
+                <command name="vkBindAccelerationStructureMemoryNV"/>
+                <command name="vkCmdBuildAccelerationStructureNV"/>
+                <command name="vkCmdCopyAccelerationStructureNV"/>
+                <command name="vkCmdTraceRaysNV"/>
+                <command name="vkCreateRayTracingPipelinesNV"/>
+                <command name="vkGetRayTracingShaderGroupHandlesNV"/>
+                <command name="vkGetAccelerationStructureHandleNV"/>
+                <command name="vkCmdWriteAccelerationStructuresPropertiesNV"/>
+                <command name="vkCompileDeferredNV"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_representative_fragment_test" number="167" type="device" author="NV" contact="Kedarnath Thangudu @kthangudu" supported="vulkan">
+            <require>
+                <enum value="2"                                             name="VK_NV_REPRESENTATIVE_FRAGMENT_TEST_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_representative_fragment_test&quot;" name="VK_NV_REPRESENTATIVE_FRAGMENT_TEST_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV"/>
+                <enum offset="1" extends="VkStructureType"  name="VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV"/>
+                <type name="VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV"/>
+                <type name="VkPipelineRepresentativeFragmentTestStateCreateInfoNV"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_extension_168" number="168" author="NV" contact="Daniel Koch @dgkoch" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_NV_EXTENSION_168_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_extension_168&quot;"               name="VK_NV_EXTENSION_168_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_maintenance3" number="169" type="device" requires="VK_KHR_get_physical_device_properties2" author="KHR" contact="Jeff Bolz @jeffbolznv" supported="vulkan" promotedto="VK_VERSION_1_1">
+            <require>
+                <enum value="1"                                             name="VK_KHR_MAINTENANCE_3_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_maintenance3&quot;"               name="VK_KHR_MAINTENANCE_3_EXTENSION_NAME"/>
+                <enum alias="VK_KHR_MAINTENANCE_3_SPEC_VERSION"             name="VK_KHR_MAINTENANCE3_SPEC_VERSION" comment="Backwards-compatible alias containing a typo"/>
+                <enum alias="VK_KHR_MAINTENANCE_3_EXTENSION_NAME"           name="VK_KHR_MAINTENANCE3_EXTENSION_NAME" comment="Backwards-compatible alias containing a typo"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT_KHR" alias="VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT"/>
+                <type name="VkPhysicalDeviceMaintenance3PropertiesKHR"/>
+                <type name="VkDescriptorSetLayoutSupportKHR"/>
+                <command name="vkGetDescriptorSetLayoutSupportKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_draw_indirect_count" number="170" type="device" author="KHR" contact="Piers Daniell @pdaniell-nv" supported="vulkan" promotedto="VK_VERSION_1_2">
+            <require>
+                <enum value="1"                                             name="VK_KHR_DRAW_INDIRECT_COUNT_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_draw_indirect_count&quot;"        name="VK_KHR_DRAW_INDIRECT_COUNT_EXTENSION_NAME"/>
+                <command name="vkCmdDrawIndirectCountKHR"/>
+                <command name="vkCmdDrawIndexedIndirectCountKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_filter_cubic" number="171" type="device" author="QCOM" contact="Bill Licea-Kane @wwlk" supported="vulkan">
+            <require>
+                <enum value="3"                                             name="VK_EXT_FILTER_CUBIC_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_filter_cubic&quot;"               name="VK_EXT_FILTER_CUBIC_EXTENSION_NAME"/>
+                <enum extends="VkFilter"                                    name="VK_FILTER_CUBIC_EXT" alias="VK_FILTER_CUBIC_IMG"/>
+                <enum extends="VkFormatFeatureFlagBits"                     name="VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT" alias="VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT"/>
+                <type name="VkPhysicalDeviceImageViewImageFormatInfoEXT"/>
+                <type name="VkFilterCubicImageViewImageFormatPropertiesEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_QCOM_render_pass_shader_resolve" number="172" type="device" author="QCOM" contact="Bill Licea-Kane @wwlk" supported="vulkan">
+            <require>
+                <enum value="4"                                                 name="VK_QCOM_RENDER_PASS_SHADER_RESOLVE_SPEC_VERSION"/>
+                <enum value="&quot;VK_QCOM_render_pass_shader_resolve&quot;"    name="VK_QCOM_RENDER_PASS_SHADER_RESOLVE_EXTENSION_NAME"/>
+                <enum bitpos="2" extends="VkSubpassDescriptionFlagBits"         name="VK_SUBPASS_DESCRIPTION_FRAGMENT_REGION_BIT_QCOM"/>
+                <enum bitpos="3" extends="VkSubpassDescriptionFlagBits"         name="VK_SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM"/>
+            </require>
+        </extension>
+        <extension name="VK_QCOM_extension_173" number="173" author="QCOM" contact="Bill Licea-Kane @wwlk" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_QCOM_EXTENSION_173_SPEC_VERSION"/>
+                <enum value="&quot;VK_QCOM_extension_173&quot;"             name="VK_QCOM_EXTENSION_173_EXTENSION_NAME"/>
+                <enum bitpos="18" extends="VkBufferUsageFlagBits"           name="VK_BUFFER_USAGE_RESERVED_18_BIT_QCOM"/>
+                <enum bitpos="16" extends="VkImageUsageFlagBits"            name="VK_IMAGE_USAGE_RESERVED_16_BIT_QCOM"/>
+                <enum bitpos="17" extends="VkImageUsageFlagBits"            name="VK_IMAGE_USAGE_RESERVED_17_BIT_QCOM"/>
+            </require>
+        </extension>
+        <extension name="VK_QCOM_extension_174" number="174" author="QCOM" contact="Bill Licea-Kane @wwlk" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_QCOM_EXTENSION_174_SPEC_VERSION"/>
+                <enum value="&quot;VK_QCOM_extension_174&quot;"             name="VK_QCOM_EXTENSION_174_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_global_priority" number="175" type="device" author="EXT" contact="Andres Rodriguez @lostgoat" supported="vulkan">
+            <require>
+                <enum value="2"                                             name="VK_EXT_GLOBAL_PRIORITY_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_global_priority&quot;"            name="VK_EXT_GLOBAL_PRIORITY_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT"/>
+                <enum offset="1" dir="-" extends="VkResult"                 name="VK_ERROR_NOT_PERMITTED_EXT"/>
+                <type name="VkDeviceQueueGlobalPriorityCreateInfoEXT"/>
+                <type name="VkQueueGlobalPriorityEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_shader_subgroup_extended_types" number="176" type="device" requiresCore="1.1" author="KHR" contact="Neil Henning @sheredom" supported="vulkan" promotedto="VK_VERSION_1_2">
+            <require>
+                <enum value="1"                                                 name="VK_KHR_SHADER_SUBGROUP_EXTENDED_TYPES_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_shader_subgroup_extended_types&quot;" name="VK_KHR_SHADER_SUBGROUP_EXTENDED_TYPES_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES"/>
+                <type name="VkPhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_177" number="177" author="EXT" contact="Neil Henning @sheredom" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_EXT_EXTENSION_177_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_177&quot;"              name="VK_EXT_EXTENSION_177_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_8bit_storage" number="178" type="device" requires="VK_KHR_get_physical_device_properties2,VK_KHR_storage_buffer_storage_class" author="KHR" contact="Alexander Galazin @alegal-arm" supported="vulkan" promotedto="VK_VERSION_1_2">
+            <require>
+                <enum value="1"                                             name="VK_KHR_8BIT_STORAGE_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_8bit_storage&quot;"               name="VK_KHR_8BIT_STORAGE_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES"/>
+                <type name="VkPhysicalDevice8BitStorageFeaturesKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_external_memory_host" number="179" type="device" author="EXT" requires="VK_KHR_external_memory" contact="Daniel Rakos @drakos-amd" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_EXTERNAL_MEMORY_HOST_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_external_memory_host&quot;"       name="VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT"/>
+                <enum offset="2" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT"/>
+                <enum bitpos="7" extends="VkExternalMemoryHandleTypeFlagBits" name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT"/>
+                <enum bitpos="8" extends="VkExternalMemoryHandleTypeFlagBits" name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT"/>
+                <type name="VkImportMemoryHostPointerInfoEXT"/>
+                <type name="VkMemoryHostPointerPropertiesEXT"/>
+                <type name="VkPhysicalDeviceExternalMemoryHostPropertiesEXT"/>
+                <command name="vkGetMemoryHostPointerPropertiesEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_buffer_marker" number="180" type="device" author="AMD" contact="Daniel Rakos @drakos-amd" specialuse="devtools" supported="vulkan">
+            <require>
+                <enum value="1"                                          name="VK_AMD_BUFFER_MARKER_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_buffer_marker&quot;"           name="VK_AMD_BUFFER_MARKER_EXTENSION_NAME"/>
+                <command name="vkCmdWriteBufferMarkerAMD"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_shader_atomic_int64" number="181" type="device" author="KHR" requires="VK_KHR_get_physical_device_properties2" contact="Aaron Hagan @ahagan" supported="vulkan" promotedto="VK_VERSION_1_2">
+            <require>
+                <enum value="1"                                             name="VK_KHR_SHADER_ATOMIC_INT64_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_shader_atomic_int64&quot;"        name="VK_KHR_SHADER_ATOMIC_INT64_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES"/>
+                <type name="VkPhysicalDeviceShaderAtomicInt64FeaturesKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_shader_clock" number="182" type="device" author="KHR" requires="VK_KHR_get_physical_device_properties2" contact="Aaron Hagan @ahagan" supported="vulkan">
+            <require>
+                <enum value="1"                                          name="VK_KHR_SHADER_CLOCK_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_shader_clock&quot;"            name="VK_KHR_SHADER_CLOCK_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"               name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR"/>
+                <type name="VkPhysicalDeviceShaderClockFeaturesKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_183" number="183" author="AMD" contact="Daniel Rakos @drakos-amd" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_AMD_EXTENSION_183_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_183&quot;"              name="VK_AMD_EXTENSION_183_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_pipeline_compiler_control" number="184" type="device" author="AMD" contact="Matthaeus G. Chajdas @anteru" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_AMD_PIPELINE_COMPILER_CONTROL_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_pipeline_compiler_control&quot;"  name="VK_AMD_PIPELINE_COMPILER_CONTROL_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD"/>
+                <type name="VkPipelineCompilerControlFlagBitsAMD"/>
+                <type name="VkPipelineCompilerControlFlagsAMD"/>
+                <type name="VkPipelineCompilerControlCreateInfoAMD"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_calibrated_timestamps" number="185" type="device" requires="VK_KHR_get_physical_device_properties2" author="EXT" contact="Daniel Rakos @drakos-amd" supported="vulkan">
+            <require>
+                <enum value="2"                                             name="VK_EXT_CALIBRATED_TIMESTAMPS_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_calibrated_timestamps&quot;"      name="VK_EXT_CALIBRATED_TIMESTAMPS_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT"/>
+                <type name="VkTimeDomainEXT"/>
+                <type name="VkCalibratedTimestampInfoEXT"/>
+                <command name="vkGetPhysicalDeviceCalibrateableTimeDomainsEXT"/>
+                <command name="vkGetCalibratedTimestampsEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_shader_core_properties" number="186" type="device" author="AMD" requires="VK_KHR_get_physical_device_properties2" contact="Martin Dinkov @mdinkov" supported="vulkan">
+            <require>
+                <enum value="2"                                          name="VK_AMD_SHADER_CORE_PROPERTIES_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_shader_core_properties&quot;"  name="VK_AMD_SHADER_CORE_PROPERTIES_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"               name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD"/>
+                <type name="VkPhysicalDeviceShaderCorePropertiesAMD"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_187" number="187" author="AMD" contact="Daniel Rakos @drakos-amd" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_AMD_EXTENSION_187_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_187&quot;"              name="VK_AMD_EXTENSION_187_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_video_decode_h265" number="188" type="device" requires="VK_KHR_video_decode_queue" author="KHR" contact="[email protected]" provisional="true" platform="provisional" supported="vulkan">
+            <require>
+                <enum value="1"                                         name="VK_EXT_VIDEO_DECODE_H265_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_video_decode_h265&quot;"      name="VK_EXT_VIDEO_DECODE_H265_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="1" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_CREATE_INFO_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="2" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="3" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="4" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="5" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PICTURE_INFO_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="6" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum bitpos="1" extends="VkVideoCodecOperationFlagBitsKHR"      name="VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_EXT" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+
+                <type name="VkVideoDecodeH265CreateFlagsEXT"/>
+                <type name="VkVideoDecodeH265ProfileEXT"/>
+                <type name="VkVideoDecodeH265CapabilitiesEXT"/>
+                <type name="VkVideoDecodeH265SessionCreateInfoEXT"/>
+
+                <type name="VkVideoDecodeH265SessionParametersCreateInfoEXT"/>
+                <type name="VkVideoDecodeH265SessionParametersAddInfoEXT"/>
+                <type name="VkVideoDecodeH265PictureInfoEXT"/>
+                <type name="VkVideoDecodeH265DpbSlotInfoEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_189" number="189" author="AMD" contact="Daniel Rakos @drakos-amd" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_AMD_EXTENSION_189_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_189&quot;"              name="VK_AMD_EXTENSION_189_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_memory_overallocation_behavior" number="190" type="device" author="AMD" contact="Martin Dinkov @mdinkov" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_AMD_MEMORY_OVERALLOCATION_BEHAVIOR_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_memory_overallocation_behavior&quot;"    name="VK_AMD_MEMORY_OVERALLOCATION_BEHAVIOR_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD"/>
+                <type name="VkMemoryOverallocationBehaviorAMD"/>
+                <type name="VkDeviceMemoryOverallocationCreateInfoAMD"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_vertex_attribute_divisor" number="191" type="device" requires="VK_KHR_get_physical_device_properties2" author="NV" contact="Vikram Kushwaha @vkushwaha" supported="vulkan">
+            <require>
+                <enum value="3"                                         name="VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_vertex_attribute_divisor&quot;"   name="VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT"/>
+                <enum offset="1" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT"/>
+                <enum offset="2" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT"/>
+                <type name="VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT"/>
+                <type name="VkVertexInputBindingDivisorDescriptionEXT"/>
+                <type name="VkPipelineVertexInputDivisorStateCreateInfoEXT"/>
+                <type name="VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_GGP_frame_token" number="192" type="device" requires="VK_KHR_swapchain,VK_GGP_stream_descriptor_surface" platform="ggp" author="GGP" contact="Jean-Francois Roy @jfroy" supported="vulkan">
+            <require>
+                <enum value="1"                                                 name="VK_GGP_FRAME_TOKEN_SPEC_VERSION"/>
+                <enum value="&quot;VK_GGP_frame_token&quot;"                    name="VK_GGP_FRAME_TOKEN_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP"/>
+                <type name="VkPresentFrameTokenGGP"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_pipeline_creation_feedback" number="193" type="device" author="GOOGLE" contact="Jean-Francois Roy @jfroy" specialuse="devtools" supported="vulkan">
+            <require>
+                <enum value="1"                                         name="VK_EXT_PIPELINE_CREATION_FEEDBACK_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_pipeline_creation_feedback&quot;" name="VK_EXT_PIPELINE_CREATION_FEEDBACK_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT"/>
+                <type name="VkPipelineCreationFeedbackFlagBitsEXT"/>
+                <type name="VkPipelineCreationFeedbackFlagsEXT"/>
+                <type name="VkPipelineCreationFeedbackCreateInfoEXT"/>
+                <type name="VkPipelineCreationFeedbackEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_GOOGLE_extension_194" number="194" author="GOOGLE" contact="Jean-Francois Roy @jfroy" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_GOOGLE_EXTENSION_194_SPEC_VERSION"/>
+                <enum value="&quot;VK_GOOGLE_extension_194&quot;"       name="VK_GOOGLE_EXTENSION_194_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_GOOGLE_extension_195" number="195" author="GOOGLE" contact="Jean-Francois Roy @jfroy" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_GOOGLE_EXTENSION_195_SPEC_VERSION"/>
+                <enum value="&quot;VK_GOOGLE_extension_195&quot;"       name="VK_GOOGLE_EXTENSION_195_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_GOOGLE_extension_196" number="196" author="GOOGLE" contact="Jean-Francois Roy @jfroy" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_GOOGLE_EXTENSION_196_SPEC_VERSION"/>
+                <enum value="&quot;VK_GOOGLE_extension_196&quot;"       name="VK_GOOGLE_EXTENSION_196_EXTENSION_NAME"/>
+                <enum bitpos="1"  extends="VkPipelineCacheCreateFlagBits"
+                    name="VK_PIPELINE_CACHE_CREATE_RESERVED_1_BIT_EXT"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_driver_properties" number="197" type="device" requires="VK_KHR_get_physical_device_properties2" author="KHR" contact="Daniel Rakos @drakos-amd" supported="vulkan" promotedto="VK_VERSION_1_2">
+            <require>
+                <enum value="1"                                             name="VK_KHR_DRIVER_PROPERTIES_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_driver_properties&quot;"          name="VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES"/>
+                <enum name="VK_MAX_DRIVER_NAME_SIZE_KHR"/>
+                <enum name="VK_MAX_DRIVER_INFO_SIZE_KHR"/>
+                <type name="VkDriverIdKHR"/>
+                <enum extends="VkDriverId"                                  name="VK_DRIVER_ID_AMD_PROPRIETARY_KHR" alias="VK_DRIVER_ID_AMD_PROPRIETARY"/>
+                <enum extends="VkDriverId"                                  name="VK_DRIVER_ID_AMD_OPEN_SOURCE_KHR" alias="VK_DRIVER_ID_AMD_OPEN_SOURCE"/>
+                <enum extends="VkDriverId"                                  name="VK_DRIVER_ID_MESA_RADV_KHR" alias="VK_DRIVER_ID_MESA_RADV"/>
+                <enum extends="VkDriverId"                                  name="VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR" alias="VK_DRIVER_ID_NVIDIA_PROPRIETARY"/>
+                <enum extends="VkDriverId"                                  name="VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS_KHR" alias="VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS"/>
+                <enum extends="VkDriverId"                                  name="VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA_KHR" alias="VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA"/>
+                <enum extends="VkDriverId"                                  name="VK_DRIVER_ID_IMAGINATION_PROPRIETARY_KHR" alias="VK_DRIVER_ID_IMAGINATION_PROPRIETARY"/>
+                <enum extends="VkDriverId"                                  name="VK_DRIVER_ID_QUALCOMM_PROPRIETARY_KHR" alias="VK_DRIVER_ID_QUALCOMM_PROPRIETARY"/>
+                <enum extends="VkDriverId"                                  name="VK_DRIVER_ID_ARM_PROPRIETARY_KHR" alias="VK_DRIVER_ID_ARM_PROPRIETARY"/>
+                <enum extends="VkDriverId"                                  name="VK_DRIVER_ID_GOOGLE_SWIFTSHADER_KHR" alias="VK_DRIVER_ID_GOOGLE_SWIFTSHADER"/>
+                <enum extends="VkDriverId"                                  name="VK_DRIVER_ID_GGP_PROPRIETARY_KHR" alias="VK_DRIVER_ID_GGP_PROPRIETARY"/>
+                <enum extends="VkDriverId"                                  name="VK_DRIVER_ID_BROADCOM_PROPRIETARY_KHR" alias="VK_DRIVER_ID_BROADCOM_PROPRIETARY"/>
+                <type name="VkConformanceVersionKHR"/>
+                <type name="VkPhysicalDeviceDriverPropertiesKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_shader_float_controls" number="198" type="device" requires="VK_KHR_get_physical_device_properties2" author="KHR" contact="Alexander Galazin @alegal-arm" supported="vulkan" promotedto="VK_VERSION_1_2">
+            <require>
+                <enum value="4"                                             name="VK_KHR_SHADER_FLOAT_CONTROLS_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_shader_float_controls&quot;"      name="VK_KHR_SHADER_FLOAT_CONTROLS_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES"/>
+                <type name="VkPhysicalDeviceFloatControlsPropertiesKHR"/>
+                <type name="VkShaderFloatControlsIndependenceKHR"/>
+                <enum extends="VkShaderFloatControlsIndependence"           name="VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY_KHR" alias="VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY"/>
+                <enum extends="VkShaderFloatControlsIndependence"           name="VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL_KHR"         alias="VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL"/>
+                <enum extends="VkShaderFloatControlsIndependence"           name="VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_NONE_KHR"        alias="VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_NONE"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_shader_subgroup_partitioned" number="199" type="device" requiresCore="1.1" author="NV" contact="Jeff Bolz @jeffbolznv" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_NV_SHADER_SUBGROUP_PARTITIONED_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_shader_subgroup_partitioned&quot;" name="VK_NV_SHADER_SUBGROUP_PARTITIONED_EXTENSION_NAME"/>
+                <enum bitpos="8" extends="VkSubgroupFeatureFlagBits"        name="VK_SUBGROUP_FEATURE_PARTITIONED_BIT_NV"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_depth_stencil_resolve" number="200" type="device" requires="VK_KHR_create_renderpass2" author="KHR" contact="Jan-Harald Fredriksen @janharald" supported="vulkan" promotedto="VK_VERSION_1_2">
+            <require>
+                <enum value="1"                                             name="VK_KHR_DEPTH_STENCIL_RESOLVE_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_depth_stencil_resolve&quot;"      name="VK_KHR_DEPTH_STENCIL_RESOLVE_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE_KHR" alias="VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE"/>
+                <type name="VkSubpassDescriptionDepthStencilResolveKHR"/>
+                <type name="VkPhysicalDeviceDepthStencilResolvePropertiesKHR"/>
+                <type name="VkResolveModeFlagBitsKHR"/>
+                <type name="VkResolveModeFlagsKHR"/>
+                <enum extends="VkResolveModeFlagBits"                       name="VK_RESOLVE_MODE_NONE_KHR" alias="VK_RESOLVE_MODE_NONE"/>
+                <enum extends="VkResolveModeFlagBits"                       name="VK_RESOLVE_MODE_SAMPLE_ZERO_BIT_KHR" alias="VK_RESOLVE_MODE_SAMPLE_ZERO_BIT"/>
+                <enum extends="VkResolveModeFlagBits"                       name="VK_RESOLVE_MODE_AVERAGE_BIT_KHR" alias="VK_RESOLVE_MODE_AVERAGE_BIT"/>
+                <enum extends="VkResolveModeFlagBits"                       name="VK_RESOLVE_MODE_MIN_BIT_KHR" alias="VK_RESOLVE_MODE_MIN_BIT"/>
+                <enum extends="VkResolveModeFlagBits"                       name="VK_RESOLVE_MODE_MAX_BIT_KHR" alias="VK_RESOLVE_MODE_MAX_BIT"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_swapchain_mutable_format" number="201" type="device" author="KHR" requires="VK_KHR_swapchain,VK_KHR_maintenance2,VK_KHR_image_format_list" contact="Daniel Rakos @drakos-arm" supported="vulkan">
+            <require>
+                <enum value="1"                                         name="VK_KHR_SWAPCHAIN_MUTABLE_FORMAT_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_swapchain_mutable_format&quot;" name="VK_KHR_SWAPCHAIN_MUTABLE_FORMAT_EXTENSION_NAME"/>
+                <enum bitpos="2" extends="VkSwapchainCreateFlagBitsKHR" name="VK_SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_compute_shader_derivatives" number="202" type="device" requires="VK_KHR_get_physical_device_properties2" author="NV" contact="Pat Brown @nvpbrown" supported="vulkan">
+            <require>
+                <enum value="1"                                         name="VK_NV_COMPUTE_SHADER_DERIVATIVES_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_compute_shader_derivatives&quot;" name="VK_NV_COMPUTE_SHADER_DERIVATIVES_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV"/>
+                <type name="VkPhysicalDeviceComputeShaderDerivativesFeaturesNV"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_mesh_shader" number="203" type="device" requires="VK_KHR_get_physical_device_properties2" author="NV" contact="Christoph Kubisch @pixeljetstream" supported="vulkan">
+            <require>
+                <enum value="1"                                         name="VK_NV_MESH_SHADER_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_mesh_shader&quot;"             name="VK_NV_MESH_SHADER_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV"/>
+                <enum offset="1" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV"/>
+                <enum bitpos="6" extends="VkShaderStageFlagBits"        name="VK_SHADER_STAGE_TASK_BIT_NV"/>
+                <enum bitpos="7" extends="VkShaderStageFlagBits"        name="VK_SHADER_STAGE_MESH_BIT_NV"/>
+                <enum bitpos="19" extends="VkPipelineStageFlagBits"     name="VK_PIPELINE_STAGE_TASK_SHADER_BIT_NV"/>
+                <enum bitpos="20" extends="VkPipelineStageFlagBits"     name="VK_PIPELINE_STAGE_MESH_SHADER_BIT_NV"/>
+                <command name="vkCmdDrawMeshTasksNV"/>
+                <command name="vkCmdDrawMeshTasksIndirectNV"/>
+                <command name="vkCmdDrawMeshTasksIndirectCountNV"/>
+                <type name="VkPhysicalDeviceMeshShaderFeaturesNV"/>
+                <type name="VkPhysicalDeviceMeshShaderPropertiesNV"/>
+                <type name="VkDrawMeshTasksIndirectCommandNV"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_fragment_shader_barycentric" number="204" type="device" requires="VK_KHR_get_physical_device_properties2" author="NV" contact="Pat Brown @nvpbrown" supported="vulkan">
+            <require>
+                <enum value="1"                                         name="VK_NV_FRAGMENT_SHADER_BARYCENTRIC_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_fragment_shader_barycentric&quot;" name="VK_NV_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV"/>
+                <type name="VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_shader_image_footprint" number="205" type="device" requires="VK_KHR_get_physical_device_properties2" author="NV" contact="Pat Brown @nvpbrown" supported="vulkan">
+            <require>
+                <enum value="2"                                         name="VK_NV_SHADER_IMAGE_FOOTPRINT_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_shader_image_footprint&quot;"  name="VK_NV_SHADER_IMAGE_FOOTPRINT_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV"/>
+                <type name="VkPhysicalDeviceShaderImageFootprintFeaturesNV"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_scissor_exclusive" number="206" type="device" requires="VK_KHR_get_physical_device_properties2" author="NV" contact="Pat Brown @nvpbrown" supported="vulkan">
+            <require>
+                <enum value="1"                                         name="VK_NV_SCISSOR_EXCLUSIVE_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_scissor_exclusive&quot;"       name="VK_NV_SCISSOR_EXCLUSIVE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV"/>
+                <enum offset="1" extends="VkDynamicState" name="VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_NV"/>
+                <enum offset="2" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV"/>
+                <type name="VkPipelineViewportExclusiveScissorStateCreateInfoNV"/>
+                <type name="VkPhysicalDeviceExclusiveScissorFeaturesNV"/>
+                <command name="vkCmdSetExclusiveScissorNV"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_device_diagnostic_checkpoints" type="device" number="207" requires="VK_KHR_get_physical_device_properties2" author="NVIDIA" contact="Nuno Subtil @nsubtil" supported="vulkan">
+            <require>
+                <enum value="2"                                         name="VK_NV_DEVICE_DIAGNOSTIC_CHECKPOINTS_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_device_diagnostic_checkpoints&quot;" name="VK_NV_DEVICE_DIAGNOSTIC_CHECKPOINTS_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_CHECKPOINT_DATA_NV"/>
+                <enum offset="1" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV"/>
+                <type name="VkQueueFamilyCheckpointPropertiesNV"/>
+                <type name="VkCheckpointDataNV"/>
+                <command name="vkCmdSetCheckpointNV"/>
+                <command name="vkGetQueueCheckpointDataNV"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_timeline_semaphore" number="208" type="device" author="KHR" requires="VK_KHR_get_physical_device_properties2" contact="Jason Ekstrand @jekstrand" supported="vulkan" promotedto="VK_VERSION_1_2">
+            <require>
+                <enum value="2"                                         name="VK_KHR_TIMELINE_SEMAPHORE_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_timeline_semaphore&quot;"     name="VK_KHR_TIMELINE_SEMAPHORE_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO_KHR" alias="VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO_KHR" alias="VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO_KHR" alias="VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO_KHR" alias="VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO"/>
+                <enum extends="VkSemaphoreType"                             name="VK_SEMAPHORE_TYPE_BINARY_KHR" alias="VK_SEMAPHORE_TYPE_BINARY"/>
+                <enum extends="VkSemaphoreType"                             name="VK_SEMAPHORE_TYPE_TIMELINE_KHR" alias="VK_SEMAPHORE_TYPE_TIMELINE"/>
+                <enum extends="VkSemaphoreWaitFlagBits"                     name="VK_SEMAPHORE_WAIT_ANY_BIT_KHR" alias="VK_SEMAPHORE_WAIT_ANY_BIT"/>
+                <type name="VkSemaphoreTypeKHR"/>
+                <type name="VkPhysicalDeviceTimelineSemaphoreFeaturesKHR"/>
+                <type name="VkPhysicalDeviceTimelineSemaphorePropertiesKHR"/>
+                <type name="VkSemaphoreTypeCreateInfoKHR"/>
+                <type name="VkTimelineSemaphoreSubmitInfoKHR"/>
+                <type name="VkSemaphoreWaitFlagBitsKHR"/>
+                <type name="VkSemaphoreWaitFlagsKHR"/>
+                <type name="VkSemaphoreWaitInfoKHR"/>
+                <type name="VkSemaphoreSignalInfoKHR"/>
+                <command name="vkGetSemaphoreCounterValueKHR"/>
+                <command name="vkWaitSemaphoresKHR"/>
+                <command name="vkSignalSemaphoreKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_extension_209" number="209" type="device" author="KHR" contact="Ian Elliott @ianelliott" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_KHR_EXTENSION_209_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_extension_209&quot;"          name="VK_KHR_EXTENSION_209_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_INTEL_shader_integer_functions2" number="210" type="device" requires="VK_KHR_get_physical_device_properties2" author="INTEL" contact="Ian Romanick @ianromanick" supported="vulkan">
+            <require>
+                <enum value="1"                                         name="VK_INTEL_SHADER_INTEGER_FUNCTIONS_2_SPEC_VERSION"/>
+                <enum value="&quot;VK_INTEL_shader_integer_functions2&quot;" name="VK_INTEL_SHADER_INTEGER_FUNCTIONS_2_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL"/>
+                <type name="VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL"/>
+            </require>
+        </extension>
+        <extension name="VK_INTEL_performance_query" number="211" type="device" author="INTEL" contact="Lionel Landwerlin @llandwerlin" specialuse="devtools" supported="vulkan">
+            <require>
+                <enum value="2"                                         name="VK_INTEL_PERFORMANCE_QUERY_SPEC_VERSION"/>
+                <enum value="&quot;VK_INTEL_performance_query&quot;"    name="VK_INTEL_PERFORMANCE_QUERY_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL"/>
+                <enum extends="VkStructureType" name="VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO_INTEL" alias="VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL" comment="Backwards-compatible alias"/>
+                <enum offset="1" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_INITIALIZE_PERFORMANCE_API_INFO_INTEL"/>
+                <enum offset="2" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_PERFORMANCE_MARKER_INFO_INTEL"/>
+                <enum offset="3" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_PERFORMANCE_STREAM_MARKER_INFO_INTEL"/>
+                <enum offset="4" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_PERFORMANCE_OVERRIDE_INFO_INTEL"/>
+                <enum offset="5" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_PERFORMANCE_CONFIGURATION_ACQUIRE_INFO_INTEL"/>
+                <enum offset="0" extends="VkQueryType"                  name="VK_QUERY_TYPE_PERFORMANCE_QUERY_INTEL"/>
+                <enum offset="0" extends="VkObjectType"                 name="VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL"/>
+                <type name="VkPerformanceConfigurationTypeINTEL"/>
+                <type name="VkQueryPoolSamplingModeINTEL"/>
+                <type name="VkPerformanceOverrideTypeINTEL"/>
+                <type name="VkPerformanceParameterTypeINTEL"/>
+                <type name="VkPerformanceValueTypeINTEL"/>
+                <type name="VkPerformanceValueDataINTEL"/>
+                <type name="VkPerformanceValueINTEL"/>
+                <type name="VkInitializePerformanceApiInfoINTEL"/>
+                <type name="VkQueryPoolCreateInfoINTEL"/>
+                <type name="VkQueryPoolPerformanceQueryCreateInfoINTEL"/>
+                <type name="VkPerformanceMarkerInfoINTEL"/>
+                <type name="VkPerformanceStreamMarkerInfoINTEL"/>
+                <type name="VkPerformanceOverrideInfoINTEL"/>
+                <type name="VkPerformanceConfigurationAcquireInfoINTEL"/>
+                <type name="VkPerformanceConfigurationINTEL"/>
+                <command name="vkInitializePerformanceApiINTEL"/>
+                <command name="vkUninitializePerformanceApiINTEL"/>
+                <command name="vkCmdSetPerformanceMarkerINTEL"/>
+                <command name="vkCmdSetPerformanceStreamMarkerINTEL"/>
+                <command name="vkCmdSetPerformanceOverrideINTEL"/>
+                <command name="vkAcquirePerformanceConfigurationINTEL"/>
+                <command name="vkReleasePerformanceConfigurationINTEL"/>
+                <command name="vkQueueSetPerformanceConfigurationINTEL"/>
+                <command name="vkGetPerformanceParameterINTEL"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_vulkan_memory_model" number="212" type="device" author="KHR" contact="Jeff Bolz @jeffbolznv" supported="vulkan" promotedto="VK_VERSION_1_2">
+            <require>
+                <enum value="3"                                         name="VK_KHR_VULKAN_MEMORY_MODEL_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_vulkan_memory_model&quot;"    name="VK_KHR_VULKAN_MEMORY_MODEL_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                         name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES"/>
+                <type name="VkPhysicalDeviceVulkanMemoryModelFeaturesKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_pci_bus_info" number="213" type="device" author="EXT" requires="VK_KHR_get_physical_device_properties2" contact="Matthaeus G. Chajdas @anteru" supported="vulkan">
+            <require>
+                <enum value="2"                                         name="VK_EXT_PCI_BUS_INFO_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_pci_bus_info&quot;"           name="VK_EXT_PCI_BUS_INFO_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT"/>
+                <type name="VkPhysicalDevicePCIBusInfoPropertiesEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_display_native_hdr" number="214" type="device" author="AMD" requires="VK_KHR_get_physical_device_properties2,VK_KHR_get_surface_capabilities2,VK_KHR_swapchain" contact="Matthaeus G. Chajdas @anteru" supported="vulkan">
+            <require>
+                <enum value="1"                                         name="VK_AMD_DISPLAY_NATIVE_HDR_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_display_native_hdr&quot;"     name="VK_AMD_DISPLAY_NATIVE_HDR_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD"/>
+                <enum offset="1" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD"/>
+                <enum offset="0" extends="VkColorSpaceKHR"              name="VK_COLOR_SPACE_DISPLAY_NATIVE_AMD"/>
+                <type name="VkDisplayNativeHdrSurfaceCapabilitiesAMD"/>
+                <type name="VkSwapchainDisplayNativeHdrCreateInfoAMD"/>
+                <command name="vkSetLocalDimmingAMD"/>
+            </require>
+        </extension>
+        <extension name="VK_FUCHSIA_imagepipe_surface" number="215" type="instance" author="FUCHSIA" requires="VK_KHR_surface" platform="fuchsia" contact="Craig Stout @cdotstout" supported="vulkan">
+            <require>
+                <enum value="1"                                         name="VK_FUCHSIA_IMAGEPIPE_SURFACE_SPEC_VERSION"/>
+                <enum value="&quot;VK_FUCHSIA_imagepipe_surface&quot;"  name="VK_FUCHSIA_IMAGEPIPE_SURFACE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_IMAGEPIPE_SURFACE_CREATE_INFO_FUCHSIA"/>
+                <type name="VkImagePipeSurfaceCreateFlagsFUCHSIA"/>
+                <type name="VkImagePipeSurfaceCreateInfoFUCHSIA"/>
+                <command name="vkCreateImagePipeSurfaceFUCHSIA"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_shader_terminate_invocation" number="216" type="device" author="KHR" requires="VK_KHR_get_physical_device_properties2" contact="Jesse Hall @critsec" supported="vulkan">
+            <require>
+                <enum value="1"                                                 name="VK_KHR_SHADER_TERMINATE_INVOCATION_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_shader_terminate_invocation&quot;"    name="VK_KHR_SHADER_TERMINATE_INVOCATION_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR"/>
+                <type name="VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_GOOGLE_extension_217" number="217" author="GOOGLE" contact="Jesse Hall @critsec" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_GOOGLE_EXTENSION_217_SPEC_VERSION"/>
+                <enum value="&quot;VK_GOOGLE_extension_217&quot;"           name="VK_GOOGLE_EXTENSION_217_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_metal_surface" number="218" type="instance" requires="VK_KHR_surface" platform="metal" supported="vulkan" author="EXT" contact="Dzmitry Malyshau @kvark">
+            <require>
+                <enum value="1"                                             name="VK_EXT_METAL_SURFACE_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_metal_surface&quot;"              name="VK_EXT_METAL_SURFACE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT"/>
+                <type name="VkMetalSurfaceCreateFlagsEXT"/>
+                <type name="VkMetalSurfaceCreateInfoEXT"/>
+                <command name="vkCreateMetalSurfaceEXT"/>
+                <type name="CAMetalLayer"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_fragment_density_map" number="219" type="device" requires="VK_KHR_get_physical_device_properties2" author="EXT" contact="Matthew Netsch @mnetsch" supported="vulkan">
+            <require>
+                <enum value="2"                                             name="VK_EXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_fragment_density_map&quot;"       name="VK_EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME"/>
+                <enum offset="0"  extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT"/>
+                <enum offset="1"  extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT"/>
+                <enum offset="2"  extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT"/>
+                <enum bitpos="14" extends="VkImageCreateFlagBits"           name="VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT"/>
+                <enum offset="0"  extends="VkImageLayout"                   name="VK_IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT"/>
+                <enum bitpos="24" extends="VkAccessFlagBits"                name="VK_ACCESS_FRAGMENT_DENSITY_MAP_READ_BIT_EXT"/>
+                <enum bitpos="24" extends="VkFormatFeatureFlagBits"         name="VK_FORMAT_FEATURE_FRAGMENT_DENSITY_MAP_BIT_EXT"/>
+                <enum bitpos="9"  extends="VkImageUsageFlagBits"            name="VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT"/>
+                <enum bitpos="0"  extends="VkImageViewCreateFlagBits"       name="VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DYNAMIC_BIT_EXT"/>
+                <enum bitpos="23" extends="VkPipelineStageFlagBits"         name="VK_PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT"/>
+                <enum bitpos="0"  extends="VkSamplerCreateFlagBits"         name="VK_SAMPLER_CREATE_SUBSAMPLED_BIT_EXT"/>
+                <enum bitpos="1"  extends="VkSamplerCreateFlagBits"         name="VK_SAMPLER_CREATE_SUBSAMPLED_COARSE_RECONSTRUCTION_BIT_EXT"/>
+                <type name="VkPhysicalDeviceFragmentDensityMapFeaturesEXT"/>
+                <type name="VkPhysicalDeviceFragmentDensityMapPropertiesEXT"/>
+                <type name="VkRenderPassFragmentDensityMapCreateInfoEXT"/>
+            </require>
+            <require extension="VK_KHR_format_feature_flags2">
+                <enum bitpos="24" extends="VkFormatFeatureFlagBits2KHR"     name="VK_FORMAT_FEATURE_2_FRAGMENT_DENSITY_MAP_BIT_EXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_220" number="220" author="EXT" contact="Dzmitry Malyshau @kvark" supported="disabled">
+            <require>
+                <enum value="0"                                              name="VK_EXT_EXTENSION_220_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_220&quot;"               name="VK_EXT_EXTENSION_220_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_extension_221" number="221" author="KHR" contact="Tobias Hector @tobski" supported="disabled">
+            <require>
+                <enum value="0"                                              name="VK_KHR_EXTENSION_221_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_extension_221&quot;"               name="VK_KHR_EXTENSION_221_EXTENSION_NAME"/>
+                <enum bitpos="0" extends="VkRenderPassCreateFlagBits"        name="VK_RENDER_PASS_CREATE_RESERVED_0_BIT_KHR"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_scalar_block_layout" number="222" requires="VK_KHR_get_physical_device_properties2" type="device" author="EXT" contact="Tobias Hector @tobski" supported="vulkan" promotedto="VK_VERSION_1_2">
+            <require>
+                <enum value="1"                                             name="VK_EXT_SCALAR_BLOCK_LAYOUT_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_scalar_block_layout&quot;"        name="VK_EXT_SCALAR_BLOCK_LAYOUT_EXTENSION_NAME"/>
+                <type name="VkPhysicalDeviceScalarBlockLayoutFeaturesEXT"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES_EXT" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_223" number="223" author="EXT" contact="Tobias Hector @tobski" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_EXT_EXTENSION_223_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_223&quot;"              name="VK_EXT_EXTENSION_223_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_GOOGLE_hlsl_functionality1" number="224" type="device" author="GOOGLE" contact="Hai Nguyen @chaoticbob" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_GOOGLE_HLSL_FUNCTIONALITY_1_SPEC_VERSION"/>
+                <enum value="&quot;VK_GOOGLE_hlsl_functionality1&quot;"     name="VK_GOOGLE_HLSL_FUNCTIONALITY_1_EXTENSION_NAME"/>
+                <enum alias="VK_GOOGLE_HLSL_FUNCTIONALITY_1_SPEC_VERSION"   name="VK_GOOGLE_HLSL_FUNCTIONALITY1_SPEC_VERSION" comment="Backwards-compatible alias containing a typo"/>
+                <enum alias="VK_GOOGLE_HLSL_FUNCTIONALITY_1_EXTENSION_NAME" name="VK_GOOGLE_HLSL_FUNCTIONALITY1_EXTENSION_NAME" comment="Backwards-compatible alias containing a typo"/>
+            </require>
+        </extension>
+        <extension name="VK_GOOGLE_decorate_string" number="225" type="device" author="GOOGLE" contact="Hai Nguyen @chaoticbob" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_GOOGLE_DECORATE_STRING_SPEC_VERSION"/>
+                <enum value="&quot;VK_GOOGLE_decorate_string&quot;"         name="VK_GOOGLE_DECORATE_STRING_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_subgroup_size_control" number="226" type="device" requiresCore="1.1" author="EXT" contact="Neil Henning @sheredom" supported="vulkan">
+            <require>
+                <enum value="2"                                                name="VK_EXT_SUBGROUP_SIZE_CONTROL_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_subgroup_size_control&quot;"         name="VK_EXT_SUBGROUP_SIZE_CONTROL_EXTENSION_NAME"/>
+                <type                                                          name="VkPhysicalDeviceSubgroupSizeControlFeaturesEXT"/>
+                <type                                                          name="VkPhysicalDeviceSubgroupSizeControlPropertiesEXT"/>
+                <type                                                          name="VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT"/>
+                <enum offset="0" extends="VkStructureType"                     name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT"/>
+                <enum offset="1" extends="VkStructureType"                     name="VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT"/>
+                <enum offset="2" extends="VkStructureType"                     name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT"/>
+                <enum bitpos="0" extends="VkPipelineShaderStageCreateFlagBits" name="VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT"/>
+                <enum bitpos="1" extends="VkPipelineShaderStageCreateFlagBits" name="VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT_EXT"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_fragment_shading_rate" number="227" type="device" requires="VK_KHR_create_renderpass2,VK_KHR_get_physical_device_properties2" author="KHR" contact="Tobias Hector @tobski" supported="vulkan">
+            <require>
+                <enum value="2"                                                 name="VK_KHR_FRAGMENT_SHADING_RATE_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_fragment_shading_rate&quot;" name="VK_KHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME"/>
+                <type name="VkFragmentShadingRateCombinerOpKHR"/>
+                <type name="VkFragmentShadingRateAttachmentInfoKHR"/>
+                <type name="VkPipelineFragmentShadingRateStateCreateInfoKHR"/>
+                <type name="VkPhysicalDeviceFragmentShadingRateFeaturesKHR"/>
+                <type name="VkPhysicalDeviceFragmentShadingRatePropertiesKHR"/>
+                <type name="VkPhysicalDeviceFragmentShadingRateKHR"/>
+                <command name="vkGetPhysicalDeviceFragmentShadingRatesKHR"/>
+                <command name="vkCmdSetFragmentShadingRateKHR"/>
+                <enum offset="3" extends="VkImageLayout" extnumber="165"        name="VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR"/>
+                <enum offset="0" extends="VkDynamicState"                       name="VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR"/>
+                <enum offset="1" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR"/>
+                <enum offset="2" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR"/>
+                <enum offset="3" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR"/>
+                <enum offset="4" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_KHR"/>
+                <enum bitpos="23" extends="VkAccessFlagBits"                    name="VK_ACCESS_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR"/>
+                <enum bitpos="8" extends="VkImageUsageFlagBits"                 name="VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR"/>
+                <enum bitpos="22" extends="VkPipelineStageFlagBits"             name="VK_PIPELINE_STAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR"/>
+                <enum bitpos="30" extends="VkFormatFeatureFlagBits"             name="VK_FORMAT_FEATURE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR"/>
+            </require>
+            <require extension="VK_KHR_format_feature_flags2">
+                <enum bitpos="30" extends="VkFormatFeatureFlagBits2KHR"         name="VK_FORMAT_FEATURE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_shader_core_properties2" number="228" type="device" author="AMD" contact="Matthaeus G. Chajdas @anteru" supported="vulkan" requires="VK_AMD_shader_core_properties">
+            <require>
+                <enum value="1"                                             name="VK_AMD_SHADER_CORE_PROPERTIES_2_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_shader_core_properties2&quot;"    name="VK_AMD_SHADER_CORE_PROPERTIES_2_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD"/>
+                <type                                                       name="VkPhysicalDeviceShaderCoreProperties2AMD"/>
+                <type                                                       name="VkShaderCorePropertiesFlagBitsAMD"/>
+                <type                                                       name="VkShaderCorePropertiesFlagsAMD"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_229" number="229" author="AMD" contact="Martin Dinkov @mdinkov" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_AMD_EXTENSION_229_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_229&quot;"              name="VK_AMD_EXTENSION_229_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_device_coherent_memory" number="230" type="device" author="AMD" contact="Tobias Hector @tobski" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_AMD_DEVICE_COHERENT_MEMORY_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_device_coherent_memory&quot;"     name="VK_AMD_DEVICE_COHERENT_MEMORY_EXTENSION_NAME"/>
+                <enum bitpos="6" extends="VkMemoryPropertyFlagBits"         name="VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD"/>
+                <enum bitpos="7" extends="VkMemoryPropertyFlagBits"         name="VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD"/>
+                <type                                                       name="VkPhysicalDeviceCoherentMemoryFeaturesAMD"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_231" number="231" author="AMD" contact="Martin Dinkov @mdinkov" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_AMD_EXTENSION_231_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_231&quot;"              name="VK_AMD_EXTENSION_231_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_232" number="232" author="AMD" contact="Martin Dinkov @mdinkov" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_AMD_EXTENSION_232_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_232&quot;"              name="VK_AMD_EXTENSION_232_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_233" number="233" author="AMD" contact="Martin Dinkov @mdinkov" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_AMD_EXTENSION_233_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_233&quot;"              name="VK_AMD_EXTENSION_233_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_234" number="234" author="AMD" contact="Martin Dinkov @mdinkov" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_AMD_EXTENSION_234_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_234&quot;"              name="VK_AMD_EXTENSION_234_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_shader_image_atomic_int64" number="235" type="device" requires="VK_KHR_get_physical_device_properties2" author="EXT" contact="Tobias Hector @tobski" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_SHADER_IMAGE_ATOMIC_INT64_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_shader_image_atomic_int64&quot;"  name="VK_EXT_SHADER_IMAGE_ATOMIC_INT64_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT"/>
+                <type name="VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_236" number="236" author="AMD" contact="Martin Dinkov @mdinkov" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_AMD_EXTENSION_236_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_236&quot;"              name="VK_AMD_EXTENSION_236_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_spirv_1_4" number="237" type="device" requiresCore="1.1" requires="VK_KHR_shader_float_controls" author="KHR" contact="Jesse Hall @critsec" supported="vulkan" promotedto="VK_VERSION_1_2">
+            <require>
+                <enum value="1"                                             name="VK_KHR_SPIRV_1_4_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_spirv_1_4&quot;"                  name="VK_KHR_SPIRV_1_4_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_memory_budget" number="238" type="device" requires="VK_KHR_get_physical_device_properties2" author="EXT" contact="Jeff Bolz @jeffbolznv" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_MEMORY_BUDGET_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_memory_budget&quot;"              name="VK_EXT_MEMORY_BUDGET_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT"/>
+                <type name="VkPhysicalDeviceMemoryBudgetPropertiesEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_memory_priority" number="239" type="device" requires="VK_KHR_get_physical_device_properties2"  author="EXT" contact="Jeff Bolz @jeffbolznv" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_MEMORY_PRIORITY_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_memory_priority&quot;"            name="VK_EXT_MEMORY_PRIORITY_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT"/>
+                <type name="VkPhysicalDeviceMemoryPriorityFeaturesEXT"/>
+                <type name="VkMemoryPriorityAllocateInfoEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_surface_protected_capabilities" number="240" type="instance" requiresCore="1.1" requires="VK_KHR_get_surface_capabilities2" author="KHR" contact="Sandeep Shinde @sashinde" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_KHR_SURFACE_PROTECTED_CAPABILITIES_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_surface_protected_capabilities&quot;"   name="VK_KHR_SURFACE_PROTECTED_CAPABILITIES_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR"/>
+                <type name="VkSurfaceProtectedCapabilitiesKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_dedicated_allocation_image_aliasing" number="241" type="device" requires="VK_KHR_dedicated_allocation" author="NVIDIA" contact="Nuno Subtil @nsubtil" supported="vulkan">
+            <require>
+                <enum value="1"                                                         name="VK_NV_DEDICATED_ALLOCATION_IMAGE_ALIASING_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_dedicated_allocation_image_aliasing&quot;"     name="VK_NV_DEDICATED_ALLOCATION_IMAGE_ALIASING_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                              name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV"/>
+                <type name="VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_separate_depth_stencil_layouts" number="242" type="device" requires="VK_KHR_get_physical_device_properties2,VK_KHR_create_renderpass2" author="KHR" contact="Piers Daniell @pdaniell-nv" supported="vulkan" promotedto="VK_VERSION_1_2">
+            <require>
+                <enum value="1"                                                   name="VK_KHR_SEPARATE_DEPTH_STENCIL_LAYOUTS_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_separate_depth_stencil_layouts&quot;"   name="VK_KHR_SEPARATE_DEPTH_STENCIL_LAYOUTS_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT_KHR" alias="VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT_KHR" alias="VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT"/>
+                <enum extends="VkImageLayout"                               name="VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL_KHR" alias="VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL"/>
+                <enum extends="VkImageLayout"                               name="VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL_KHR" alias="VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL"/>
+                <enum extends="VkImageLayout"                               name="VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL_KHR" alias="VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL"/>
+                <enum extends="VkImageLayout"                               name="VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL_KHR" alias="VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL"/>
+                <type name="VkPhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR"/>
+                <type name="VkAttachmentReferenceStencilLayoutKHR"/>
+                <type name="VkAttachmentDescriptionStencilLayoutKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_INTEL_extension_243" number="243" author="INTEL" contact="Slawek Grajewski @sgrajewski" supported="disabled">
+            <require>
+                <enum value="0"                                              name="VK_INTEL_EXTENSION_243_SPEC_VERSION"/>
+                <enum value="&quot;VK_INTEL_extension_243&quot;"             name="VK_INTEL_EXTENSION_243_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_MESA_extension_244" number="244" author="MESA" contact="Andres Rodriguez @lostgoat" supported="disabled">
+            <require>
+                <enum value="0"                                              name="VK_MESA_EXTENSION_244_SPEC_VERSION"/>
+                <enum value="&quot;VK_MESA_extension_244&quot;"              name="VK_MESA_EXTENSION_244_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_buffer_device_address" number="245" type="device" requires="VK_KHR_get_physical_device_properties2" author="NV" contact="Jeff Bolz @jeffbolznv"  deprecatedby="VK_KHR_buffer_device_address" supported="vulkan">
+            <require>
+                <enum value="2"                                             name="VK_EXT_BUFFER_DEVICE_ADDRESS_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_buffer_device_address&quot;"      name="VK_EXT_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_ADDRESS_FEATURES_EXT" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_EXT" alias="VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO"/>
+                <enum offset="2" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT"/>
+                <enum extends="VkBufferUsageFlagBits"                       name="VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_EXT" alias="VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT"/>
+                <enum extends="VkBufferCreateFlagBits"                      name="VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_EXT" alias="VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT"/>
+                <enum extends="VkResult"                                    name="VK_ERROR_INVALID_DEVICE_ADDRESS_EXT" alias="VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS"/>
+                <type name="VkPhysicalDeviceBufferAddressFeaturesEXT"/>
+                <type name="VkPhysicalDeviceBufferDeviceAddressFeaturesEXT"/>
+                <type name="VkBufferDeviceAddressInfoEXT"/>
+                <type name="VkBufferDeviceAddressCreateInfoEXT"/>
+                <command name="vkGetBufferDeviceAddressEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_tooling_info" number="246" type="device" author="EXT" contact="Tobias Hector @tobski" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_TOOLING_INFO_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_tooling_info&quot;"               name="VK_EXT_TOOLING_INFO_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TOOL_PROPERTIES_EXT"/>
+                <type                                                       name="VkToolPurposeFlagBitsEXT"/>
+                <type                                                       name="VkToolPurposeFlagsEXT"/>
+                <type                                                       name="VkPhysicalDeviceToolPropertiesEXT"/>
+                <command                                                    name="vkGetPhysicalDeviceToolPropertiesEXT"/>
+            </require>
+            <require extension="VK_EXT_debug_report">
+                <enum bitpos="5" extends="VkToolPurposeFlagBitsEXT"         name="VK_TOOL_PURPOSE_DEBUG_REPORTING_BIT_EXT"/>
+            </require>
+            <require extension="VK_EXT_debug_marker">
+                <enum bitpos="6" extends="VkToolPurposeFlagBitsEXT"         name="VK_TOOL_PURPOSE_DEBUG_MARKERS_BIT_EXT"/>
+            </require>
+            <require extension="VK_EXT_debug_utils">
+                <enum bitpos="5" extends="VkToolPurposeFlagBitsEXT"         name="VK_TOOL_PURPOSE_DEBUG_REPORTING_BIT_EXT"/>
+                <enum bitpos="6" extends="VkToolPurposeFlagBitsEXT"         name="VK_TOOL_PURPOSE_DEBUG_MARKERS_BIT_EXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_separate_stencil_usage" number="247" type="device" author="EXT" contact="Daniel Rakos @drakos-amd" supported="vulkan" promotedto="VK_VERSION_1_2">
+            <require>
+                <enum value="1"                                             name="VK_EXT_SEPARATE_STENCIL_USAGE_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_separate_stencil_usage&quot;"     name="VK_EXT_SEPARATE_STENCIL_USAGE_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO_EXT" alias="VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO"/>
+                <type name="VkImageStencilUsageCreateInfoEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_validation_features" number="248" type="instance" author="LUNARG" contact="Karl Schultz @karl-lunarg" specialuse="debugging" supported="vulkan">
+            <require>
+                <enum value="5"                                             name="VK_EXT_VALIDATION_FEATURES_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_validation_features&quot;"        name="VK_EXT_VALIDATION_FEATURES_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT"/>
+                <type name="VkValidationFeaturesEXT"/>
+                <type name="VkValidationFeatureEnableEXT"/>
+                <type name="VkValidationFeatureDisableEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_present_wait" number="249" type="device" requires="VK_KHR_swapchain,VK_KHR_present_id" author="KHR" contact="Keith Packard @keithp" supported="vulkan">
+            <require>
+                <enum value="1"                                         name="VK_KHR_PRESENT_WAIT_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_present_wait&quot;"           name="VK_KHR_PRESENT_WAIT_EXTENSION_NAME"/>
+                <command name="vkWaitForPresentKHR"/>
+                <enum offset="0" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR"/>
+                <type name="VkPhysicalDevicePresentWaitFeaturesKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_cooperative_matrix" number="250" type="device" requires="VK_KHR_get_physical_device_properties2" author="NV" contact="Jeff Bolz @jeffbolznv" supported="vulkan">
+            <require>
+                <enum value="1"                                              name="VK_NV_COOPERATIVE_MATRIX_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_cooperative_matrix&quot;"           name="VK_NV_COOPERATIVE_MATRIX_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                   name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV"/>
+                <enum offset="1" extends="VkStructureType"                   name="VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_NV"/>
+                <enum offset="2" extends="VkStructureType"                   name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV"/>
+                <type name="VkCooperativeMatrixPropertiesNV"/>
+                <type name="VkScopeNV"/>
+                <type name="VkComponentTypeNV"/>
+                <type name="VkPhysicalDeviceCooperativeMatrixFeaturesNV"/>
+                <type name="VkPhysicalDeviceCooperativeMatrixPropertiesNV"/>
+                <command name="vkGetPhysicalDeviceCooperativeMatrixPropertiesNV"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_coverage_reduction_mode" number="251" requires="VK_NV_framebuffer_mixed_samples" type="device" author="NV" contact="Kedarnath Thangudu @kthangudu" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_NV_COVERAGE_REDUCTION_MODE_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_coverage_reduction_mode&quot;"     name="VK_NV_COVERAGE_REDUCTION_MODE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV"/>
+                <enum offset="2" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_FRAMEBUFFER_MIXED_SAMPLES_COMBINATION_NV"/>
+                <type name="VkPhysicalDeviceCoverageReductionModeFeaturesNV"/>
+                <type name="VkPipelineCoverageReductionStateCreateInfoNV"/>
+                <type name="VkPipelineCoverageReductionStateCreateFlagsNV"/>
+                <type name="VkCoverageReductionModeNV"/>
+                <type name="VkFramebufferMixedSamplesCombinationNV"/>
+                <command name="vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_fragment_shader_interlock" number="252" author="EXT" type="device" requires="VK_KHR_get_physical_device_properties2" contact="Piers Daniell @pdaniell-nv" supported="vulkan">
+            <require>
+                <enum value="1"                                                 name="VK_EXT_FRAGMENT_SHADER_INTERLOCK_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_fragment_shader_interlock&quot;"      name="VK_EXT_FRAGMENT_SHADER_INTERLOCK_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT"/>
+                <type name="VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_ycbcr_image_arrays" number="253" type="device" requires="VK_KHR_sampler_ycbcr_conversion" author="EXT" contact="Piers Daniell @pdaniell-nv" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_YCBCR_IMAGE_ARRAYS_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_ycbcr_image_arrays&quot;"         name="VK_EXT_YCBCR_IMAGE_ARRAYS_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT"/>
+                <type name="VkPhysicalDeviceYcbcrImageArraysFeaturesEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_uniform_buffer_standard_layout" number="254" requires="VK_KHR_get_physical_device_properties2" type="device" author="KHR" contact="Graeme Leese @gnl21" supported="vulkan" promotedto="VK_VERSION_1_2">
+            <require>
+                <enum value="1"                                                 name="VK_KHR_UNIFORM_BUFFER_STANDARD_LAYOUT_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_uniform_buffer_standard_layout&quot;" name="VK_KHR_UNIFORM_BUFFER_STANDARD_LAYOUT_EXTENSION_NAME"/>
+                <type                                                           name="VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_provoking_vertex" number="255" type="device" author="EXT" requires="VK_KHR_get_physical_device_properties2" contact="Jesse Hall @jessehall" specialuse="glemulation" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_PROVOKING_VERTEX_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_provoking_vertex&quot;"           name="VK_EXT_PROVOKING_VERTEX_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT"/>
+                <enum offset="2" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT"/>
+                <type name="VkPhysicalDeviceProvokingVertexFeaturesEXT"/>
+                <type name="VkPhysicalDeviceProvokingVertexPropertiesEXT"/>
+                <type name="VkPipelineRasterizationProvokingVertexStateCreateInfoEXT"/>
+                <type name="VkProvokingVertexModeEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_full_screen_exclusive" number="256" type="device" author="EXT" requires="VK_KHR_get_physical_device_properties2,VK_KHR_surface,VK_KHR_get_surface_capabilities2,VK_KHR_swapchain" platform="win32" contact="James Jones @cubanismo" supported="vulkan">
+            <require>
+                <enum value="4"                                             name="VK_EXT_FULL_SCREEN_EXCLUSIVE_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_full_screen_exclusive&quot;"      name="VK_EXT_FULL_SCREEN_EXCLUSIVE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT"/>
+                <enum offset="2" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT"/>
+                <enum offset="0" extends="VkResult" dir="-"                 name="VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT"/>
+                <type name="VkFullScreenExclusiveEXT"/>
+                <type name="VkSurfaceFullScreenExclusiveInfoEXT"/>
+                <type name="VkSurfaceCapabilitiesFullScreenExclusiveEXT"/>
+                <command name="vkGetPhysicalDeviceSurfacePresentModes2EXT"/>
+                <command name="vkAcquireFullScreenExclusiveModeEXT"/>
+                <command name="vkReleaseFullScreenExclusiveModeEXT"/>
+            </require>
+            <require extension="VK_KHR_win32_surface">
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT"/>
+                <type name="VkSurfaceFullScreenExclusiveWin32InfoEXT"/>
+            </require>
+            <require extension="VK_KHR_device_group">
+                <command name="vkGetDeviceGroupSurfacePresentModes2EXT"/>
+            </require>
+            <require feature="VK_VERSION_1_1">
+                <command name="vkGetDeviceGroupSurfacePresentModes2EXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_headless_surface" number="257" type="instance" requires="VK_KHR_surface" author="EXT" contact="Lisa Wu @chengtianww" supported="vulkan">
+            <require>
+                <enum value="1"                                                 name="VK_EXT_HEADLESS_SURFACE_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_headless_surface&quot;"               name="VK_EXT_HEADLESS_SURFACE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_HEADLESS_SURFACE_CREATE_INFO_EXT"/>
+                <type name="VkHeadlessSurfaceCreateFlagsEXT"/>
+                <type name="VkHeadlessSurfaceCreateInfoEXT"/>
+                <command name="vkCreateHeadlessSurfaceEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_buffer_device_address" number="258" type="device" requires="VK_KHR_get_physical_device_properties2" author="KHR" contact="Jeff Bolz @jeffbolznv" supported="vulkan" promotedto="VK_VERSION_1_2">
+            <require>
+                <enum value="1"                                             name="VK_KHR_BUFFER_DEVICE_ADDRESS_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_buffer_device_address&quot;"      name="VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_KHR" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_KHR" alias="VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO_KHR" alias="VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO_KHR" alias="VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO_KHR" alias="VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO"/>
+                <enum extends="VkBufferUsageFlagBits"                       name="VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_KHR" alias="VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT"/>
+                <enum extends="VkBufferCreateFlagBits"                      name="VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR" alias="VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT"/>
+                <enum extends="VkMemoryAllocateFlagBits"                    name="VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT_KHR" alias="VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT"/>
+                <enum extends="VkMemoryAllocateFlagBits"                    name="VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR" alias="VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT"/>
+                <enum extends="VkResult"                                    name="VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR" alias="VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS"/>
+                <type name="VkPhysicalDeviceBufferDeviceAddressFeaturesKHR"/>
+                <type name="VkBufferDeviceAddressInfoKHR"/>
+                <type name="VkBufferOpaqueCaptureAddressCreateInfoKHR"/>
+                <type name="VkMemoryOpaqueCaptureAddressAllocateInfoKHR"/>
+                <type name="VkDeviceMemoryOpaqueCaptureAddressInfoKHR"/>
+                <command name="vkGetBufferDeviceAddressKHR"/>
+                <command name="vkGetBufferOpaqueCaptureAddressKHR"/>
+                <command name="vkGetDeviceMemoryOpaqueCaptureAddressKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_259" number="259" author="EXT" contact="Jeff Leger @jackohound" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_EXT_EXTENSION_259_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_259&quot;"              name="VK_EXT_EXTENSION_259_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_line_rasterization" number="260" type="device" requires="VK_KHR_get_physical_device_properties2" author="EXT" contact="Jeff Bolz @jeffbolznv" specialuse="cadsupport" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_LINE_RASTERIZATION_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_line_rasterization&quot;"         name="VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT"/>
+                <enum offset="2" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT"/>
+                <enum offset="0" extends="VkDynamicState"                   name="VK_DYNAMIC_STATE_LINE_STIPPLE_EXT"/>
+                <type name="VkPhysicalDeviceLineRasterizationFeaturesEXT"/>
+                <type name="VkPhysicalDeviceLineRasterizationPropertiesEXT"/>
+                <type name="VkPipelineRasterizationLineStateCreateInfoEXT"/>
+                <type name="VkLineRasterizationModeEXT"/>
+                <command name="vkCmdSetLineStippleEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_shader_atomic_float" number="261" type="device" author="NV" requires="VK_KHR_get_physical_device_properties2" contact="Vikram Kushwaha @vkushwaha-nv" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_SHADER_ATOMIC_FLOAT_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_shader_atomic_float&quot;"        name="VK_EXT_SHADER_ATOMIC_FLOAT_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT"/>
+                <type name="VkPhysicalDeviceShaderAtomicFloatFeaturesEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_host_query_reset" number="262" author="EXT" contact="Bas Nieuwenhuizen @BNieuwenhuizen" supported="vulkan" type="device" requires="VK_KHR_get_physical_device_properties2" promotedto="VK_VERSION_1_2">
+            <require>
+                <enum value="1"                                             name="VK_EXT_HOST_QUERY_RESET_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_host_query_reset&quot;"           name="VK_EXT_HOST_QUERY_RESET_EXTENSION_NAME"/>
+                <enum extends="VkStructureType"                             name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES_EXT" alias="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES"/>
+                <type name="VkPhysicalDeviceHostQueryResetFeaturesEXT"/>
+                <command name="vkResetQueryPoolEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_GGP_extension_263" number="263" author="GGP" contact="Jean-Francois Roy @jfroy" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_GGP_EXTENSION_263_SPEC_VERSION"/>
+                <enum value="&quot;VK_GGP_extension_263&quot;"              name="VK_GGP_EXTENSION_263_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_BRCM_extension_264" number="264" author="BRCM" contact="Graeme Leese @gnl21" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_BRCM_EXTENSION_264_SPEC_VERSION"/>
+                <enum value="&quot;VK_BRCM_extension_264&quot;"             name="VK_BRCM_EXTENSION_264_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_BRCM_extension_265" number="265" author="BRCM" contact="Graeme Leese @gnl21" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_BRCM_EXTENSION_265_SPEC_VERSION"/>
+                <enum value="&quot;VK_BRCM_extension_265&quot;"             name="VK_BRCM_EXTENSION_265_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_index_type_uint8" number="266" type="device" author="EXT" contact="Piers Daniell @pdaniell-nv" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_INDEX_TYPE_UINT8_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_index_type_uint8&quot;"           name="VK_EXT_INDEX_TYPE_UINT8_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT"/>
+                <enum offset="0" extends="VkIndexType"                      name="VK_INDEX_TYPE_UINT8_EXT"/>
+                <type name="VkPhysicalDeviceIndexTypeUint8FeaturesEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_267" number="267" type="device" author="EXT" contact="Piers Daniell @pdaniell-nv" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_EXT_EXTENSION_267_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_267&quot;"              name="VK_EXT_EXTENSION_267_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extended_dynamic_state" number="268" type="device" requires="VK_KHR_get_physical_device_properties2" author="EXT" contact="Piers Daniell @pdaniell-nv" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_EXTENDED_DYNAMIC_STATE_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extended_dynamic_state&quot;"     name="VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT"/>
+                <enum offset="0" extends="VkDynamicState"                   name="VK_DYNAMIC_STATE_CULL_MODE_EXT"/>
+                <enum offset="1" extends="VkDynamicState"                   name="VK_DYNAMIC_STATE_FRONT_FACE_EXT"/>
+                <enum offset="2" extends="VkDynamicState"                   name="VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY_EXT"/>
+                <enum offset="3" extends="VkDynamicState"                   name="VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXT"/>
+                <enum offset="4" extends="VkDynamicState"                   name="VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT_EXT"/>
+                <enum offset="5" extends="VkDynamicState"                   name="VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT"/>
+                <enum offset="6" extends="VkDynamicState"                   name="VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE_EXT"/>
+                <enum offset="7" extends="VkDynamicState"                   name="VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE_EXT"/>
+                <enum offset="8" extends="VkDynamicState"                   name="VK_DYNAMIC_STATE_DEPTH_COMPARE_OP_EXT"/>
+                <enum offset="9" extends="VkDynamicState"                   name="VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE_EXT"/>
+                <enum offset="10" extends="VkDynamicState"                  name="VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE_EXT"/>
+                <enum offset="11" extends="VkDynamicState"                  name="VK_DYNAMIC_STATE_STENCIL_OP_EXT"/>
+                <type name="VkPhysicalDeviceExtendedDynamicStateFeaturesEXT"/>
+                <command name="vkCmdSetCullModeEXT"/>
+                <command name="vkCmdSetFrontFaceEXT"/>
+                <command name="vkCmdSetPrimitiveTopologyEXT"/>
+                <command name="vkCmdSetViewportWithCountEXT"/>
+                <command name="vkCmdSetScissorWithCountEXT"/>
+                <command name="vkCmdBindVertexBuffers2EXT"/>
+                <command name="vkCmdSetDepthTestEnableEXT"/>
+                <command name="vkCmdSetDepthWriteEnableEXT"/>
+                <command name="vkCmdSetDepthCompareOpEXT"/>
+                <command name="vkCmdSetDepthBoundsTestEnableEXT"/>
+                <command name="vkCmdSetStencilTestEnableEXT"/>
+                <command name="vkCmdSetStencilOpEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_deferred_host_operations" number="269" type="device" author="KHR" contact="Josh Barczak @jbarczak" supported="vulkan">
+            <require>
+                <enum value="4"                                             name="VK_KHR_DEFERRED_HOST_OPERATIONS_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_deferred_host_operations&quot;"   name="VK_KHR_DEFERRED_HOST_OPERATIONS_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkObjectType"                     name="VK_OBJECT_TYPE_DEFERRED_OPERATION_KHR"/>
+                <type name="VkDeferredOperationKHR"/>
+                <command name="vkCreateDeferredOperationKHR"/>
+                <command name="vkDestroyDeferredOperationKHR"/>
+                <command name="vkGetDeferredOperationMaxConcurrencyKHR"/>
+                <command name="vkGetDeferredOperationResultKHR"/>
+                <command name="vkDeferredOperationJoinKHR" />
+                <enum extends="VkResult"       offset="0"       name="VK_THREAD_IDLE_KHR" />
+                <enum extends="VkResult"       offset="1"       name="VK_THREAD_DONE_KHR" />
+                <enum extends="VkResult"       offset="2"       name="VK_OPERATION_DEFERRED_KHR" />
+                <enum extends="VkResult"       offset="3"       name="VK_OPERATION_NOT_DEFERRED_KHR" />
+            </require>
+        </extension>
+        <extension name="VK_KHR_pipeline_executable_properties" number="270" type="device" requires="VK_KHR_get_physical_device_properties2" author="KHR" contact="Jason Ekstrand @jekstrand" specialuse="devtools" supported="vulkan">
+            <require>
+                <enum value="1"                                         name="VK_KHR_PIPELINE_EXECUTABLE_PROPERTIES_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_pipeline_executable_properties&quot;"   name="VK_KHR_PIPELINE_EXECUTABLE_PROPERTIES_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR"/>
+                <enum offset="1" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_PIPELINE_INFO_KHR"/>
+                <enum offset="2" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_PROPERTIES_KHR"/>
+                <enum offset="3" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INFO_KHR"/>
+                <enum offset="4" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_STATISTIC_KHR"/>
+                <enum offset="5" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INTERNAL_REPRESENTATION_KHR"/>
+                <enum bitpos="6" extends="VkPipelineCreateFlagBits"     name="VK_PIPELINE_CREATE_CAPTURE_STATISTICS_BIT_KHR"/>
+                <enum bitpos="7" extends="VkPipelineCreateFlagBits"     name="VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR"/>
+                <type name="VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR"/>
+                <type name="VkPipelineInfoKHR"/>
+                <type name="VkPipelineExecutablePropertiesKHR"/>
+                <type name="VkPipelineExecutableInfoKHR"/>
+                <type name="VkPipelineExecutableStatisticFormatKHR"/>
+                <type name="VkPipelineExecutableStatisticValueKHR"/>
+                <type name="VkPipelineExecutableStatisticKHR"/>
+                <type name="VkPipelineExecutableInternalRepresentationKHR"/>
+                <command name="vkGetPipelineExecutablePropertiesKHR"/>
+                <command name="vkGetPipelineExecutableStatisticsKHR"/>
+                <command name="vkGetPipelineExecutableInternalRepresentationsKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_INTEL_extension_271" number="271" type="device" author="INTEL" contact="Jason Ekstrand @jekstrand" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_INTEL_EXTENSION_271_SPEC_VERSION"/>
+                <enum value="&quot;VK_INTEL_extension_271&quot;"            name="VK_INTEL_EXTENSION_271_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_INTEL_extension_272" number="272" type="device" author="INTEL" contact="Jason Ekstrand @jekstrand" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_INTEL_EXTENSION_272_SPEC_VERSION"/>
+                <enum value="&quot;VK_INTEL_extension_272&quot;"            name="VK_INTEL_EXTENSION_272_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_INTEL_extension_273" number="273" type="device" author="INTEL" contact="Jason Ekstrand @jekstrand" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_INTEL_EXTENSION_273_SPEC_VERSION"/>
+                <enum value="&quot;VK_INTEL_extension_273&quot;"            name="VK_INTEL_EXTENSION_273_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_shader_atomic_float2" number="274" type="device" requires="VK_EXT_shader_atomic_float" author="EXT" contact="Jason Ekstrand @jekstrand" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_SHADER_ATOMIC_FLOAT_2_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_shader_atomic_float2&quot;"       name="VK_EXT_SHADER_ATOMIC_FLOAT_2_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT"/>
+                <type name="VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_extension_275" number="275" type="instance" author="KHR" contact="Lionel Landwerlin @llandwerlin" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_KHR_EXTENSION_275_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_extension_275&quot;"              name="VK_KHR_EXTENSION_275_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_extension_276" number="276" type="device" author="KHR" contact="James Jones @cubanismo" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_KHR_EXTENSION_276_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_extension_276&quot;"              name="VK_KHR_EXTENSION_276_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_shader_demote_to_helper_invocation" number="277" type="device" requires="VK_KHR_get_physical_device_properties2" author="EXT" contact="Jeff Bolz @jeffbolznv" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_shader_demote_to_helper_invocation&quot;" name="VK_EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                          name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT"/>
+                <type name="VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_device_generated_commands" number="278" type="device" requiresCore="1.1" requires="VK_KHR_buffer_device_address" author="NV" contact="Christoph Kubisch @pixeljetstream" supported="vulkan">
+            <require>
+                <comment>
+                    This extension requires buffer_device_address functionality.
+                    VK_EXT_buffer_device_address is also acceptable, but since it is deprecated the KHR version is preferred.
+                </comment>
+                <enum value="3"                                             name="VK_NV_DEVICE_GENERATED_COMMANDS_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_device_generated_commands&quot;"   name="VK_NV_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_GRAPHICS_SHADER_GROUP_CREATE_INFO_NV"/>
+                <enum offset="2" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV"/>
+                <enum offset="3" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_TOKEN_NV"/>
+                <enum offset="4" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NV"/>
+                <enum offset="5" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_GENERATED_COMMANDS_INFO_NV"/>
+                <enum offset="6" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_GENERATED_COMMANDS_MEMORY_REQUIREMENTS_INFO_NV"/>
+                <enum offset="7" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV"/>
+                <enum bitpos="18" extends="VkPipelineCreateFlagBits"        name="VK_PIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV"/>
+                <enum bitpos="17" extends="VkPipelineStageFlagBits"         name="VK_PIPELINE_STAGE_COMMAND_PREPROCESS_BIT_NV"/>
+                <enum bitpos="17" extends="VkAccessFlagBits"                name="VK_ACCESS_COMMAND_PREPROCESS_READ_BIT_NV"/>
+                <enum bitpos="18" extends="VkAccessFlagBits"                name="VK_ACCESS_COMMAND_PREPROCESS_WRITE_BIT_NV"/>
+                <enum offset="0" extends="VkObjectType"                     name="VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NV"/>
+                <type name="VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV"/>
+                <type name="VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV"/>
+                <type name="VkGraphicsShaderGroupCreateInfoNV"/>
+                <type name="VkGraphicsPipelineShaderGroupsCreateInfoNV"/>
+                <type name="VkBindShaderGroupIndirectCommandNV"/>
+                <type name="VkBindIndexBufferIndirectCommandNV"/>
+                <type name="VkBindVertexBufferIndirectCommandNV"/>
+                <type name="VkSetStateFlagsIndirectCommandNV"/>
+                <type name="VkIndirectStateFlagBitsNV"/>
+                <type name="VkIndirectStateFlagsNV"/>
+                <type name="VkIndirectCommandsLayoutNV"/>
+                <type name="VkIndirectCommandsTokenTypeNV"/>
+                <type name="VkIndirectCommandsLayoutUsageFlagBitsNV"/>
+                <type name="VkIndirectCommandsLayoutUsageFlagsNV"/>
+                <type name="VkIndirectCommandsStreamNV"/>
+                <type name="VkIndirectCommandsLayoutTokenNV"/>
+                <type name="VkIndirectCommandsLayoutCreateInfoNV"/>
+                <type name="VkGeneratedCommandsInfoNV"/>
+                <type name="VkGeneratedCommandsMemoryRequirementsInfoNV"/>
+                <command name="vkGetGeneratedCommandsMemoryRequirementsNV"/>
+                <command name="vkCmdPreprocessGeneratedCommandsNV"/>
+                <command name="vkCmdExecuteGeneratedCommandsNV"/>
+                <command name="vkCmdBindPipelineShaderGroupNV"/>
+                <command name="vkCreateIndirectCommandsLayoutNV"/>
+                <command name="vkDestroyIndirectCommandsLayoutNV"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_inherited_viewport_scissor" number="279" type="device" author="NV" contact="David Zhao Akeley @akeley98" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_NV_INHERITED_VIEWPORT_SCISSOR_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_inherited_viewport_scissor&quot;"  name="VK_NV_INHERITED_VIEWPORT_SCISSOR_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV"/>
+                <type name="VkPhysicalDeviceInheritedViewportScissorFeaturesNV"/>
+                <type name="VkCommandBufferInheritanceViewportScissorInfoNV"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_extension_280" number="280" type="device" author="KHR" contact="Kevin Petit @kevinpetit" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_KHR_EXTENSION_280_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_extension_280&quot;"              name="VK_KHR_EXTENSION_280_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_shader_integer_dot_product" number="281" type="device" author="KHR" requires="VK_KHR_get_physical_device_properties2" contact="Kevin Petit @kevinpetit" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_KHR_SHADER_INTEGER_DOT_PRODUCT_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_shader_integer_dot_product&quot;" name="VK_KHR_SHADER_INTEGER_DOT_PRODUCT_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR"/>
+                <type name="VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR"/>
+                <type name="VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_texel_buffer_alignment" number="282" type="device" requires="VK_KHR_get_physical_device_properties2" author="EXT" contact="Jeff Bolz @jeffbolznv" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_TEXEL_BUFFER_ALIGNMENT_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_texel_buffer_alignment&quot;"     name="VK_EXT_TEXEL_BUFFER_ALIGNMENT_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT"/>
+                <type name="VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT"/>
+                <type name="VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_QCOM_render_pass_transform" number="283" type="device" requires="VK_KHR_swapchain,VK_KHR_surface" author="QCOM" contact="Jeff Leger @jackohound" supported="vulkan">
+            <require>
+                <enum value="2"                                             name="VK_QCOM_RENDER_PASS_TRANSFORM_SPEC_VERSION"/>
+                <enum value="&quot;VK_QCOM_render_pass_transform&quot;"     name="VK_QCOM_RENDER_PASS_TRANSFORM_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM"/>
+                <enum bitpos="1" extends="VkRenderPassCreateFlagBits"       name="VK_RENDER_PASS_CREATE_TRANSFORM_BIT_QCOM"/>
+                <type name="VkRenderPassTransformBeginInfoQCOM"/>
+                <type name="VkCommandBufferInheritanceRenderPassTransformInfoQCOM"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_284" number="284" type="device" author="EXT" contact="Samuel Pitoiset @hakzsam" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_EXT_EXTENSION_284_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_284&quot;"              name="VK_EXT_EXTENSION_284_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_device_memory_report" number="285" type="device" requires="VK_KHR_get_physical_device_properties2" author="EXT" contact="Yiwei Zhang @zhangyiwei" specialuse="devtools" supported="vulkan">
+            <require>
+                <enum value="2"                                             name="VK_EXT_DEVICE_MEMORY_REPORT_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_device_memory_report&quot;"       name="VK_EXT_DEVICE_MEMORY_REPORT_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT"/>
+                <enum offset="2" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_DEVICE_MEMORY_REPORT_CALLBACK_DATA_EXT"/>
+                <type name="VkPhysicalDeviceDeviceMemoryReportFeaturesEXT"/>
+                <type name="VkDeviceDeviceMemoryReportCreateInfoEXT"/>
+                <type name="VkDeviceMemoryReportCallbackDataEXT"/>
+                <type name="VkDeviceMemoryReportFlagsEXT"/>
+                <type name="VkDeviceMemoryReportEventTypeEXT"/>
+                <type name="PFN_vkDeviceMemoryReportCallbackEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_acquire_drm_display" number="286" type="instance" requires="VK_EXT_direct_mode_display" author="EXT" contact="Drew DeVault [email protected]" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_ACQUIRE_DRM_DISPLAY_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_acquire_drm_display&quot;"        name="VK_EXT_ACQUIRE_DRM_DISPLAY_EXTENSION_NAME"/>
+                <command name="vkAcquireDrmDisplayEXT"/>
+                <command name="vkGetDrmDisplayEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_robustness2" number="287"  type="device" author="EXT" contact="Liam Middlebrook @liam-middlebrook" supported="vulkan">
+            <require>
+                <enum value="1"                                                 name="VK_EXT_ROBUSTNESS_2_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_robustness2&quot;"                    name="VK_EXT_ROBUSTNESS_2_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT"/>
+                <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT"/>
+                <type name="VkPhysicalDeviceRobustness2FeaturesEXT"/>
+                <type name="VkPhysicalDeviceRobustness2PropertiesEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_custom_border_color" number="288" type="device" author="EXT" contact="Liam Middlebrook @liam-middlebrook" specialuse="glemulation,d3demulation" supported="vulkan">
+            <require>
+                <enum value="12"                                            name="VK_EXT_CUSTOM_BORDER_COLOR_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_custom_border_color&quot;"        name="VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT"/>
+                <enum offset="2" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT"/>
+                <enum offset="3" extends="VkBorderColor"                    name="VK_BORDER_COLOR_FLOAT_CUSTOM_EXT"/>
+                <enum offset="4" extends="VkBorderColor"                    name="VK_BORDER_COLOR_INT_CUSTOM_EXT"/>
+                <type name="VkSamplerCustomBorderColorCreateInfoEXT"/>
+                <type name="VkPhysicalDeviceCustomBorderColorPropertiesEXT"/>
+                <type name="VkPhysicalDeviceCustomBorderColorFeaturesEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_289" number="289" author="EXT" contact="Jan-Harald Fredriksen @janharaldfredriksen-arm" supported="disabled">
+            <require>
+                <comment>
+                    These enums are present only to inform downstream
+                    consumers like KTX2. There is no actual Vulkan extension
+                    corresponding to the enums.
+                </comment>
+                <enum value="0"                                             name="VK_EXT_EXTENSION_289_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_289&quot;"              name="VK_EXT_EXTENSION_289_EXTENSION_NAME"/>
+                <enum extends="VkFormat" extnumber="289" offset="0" name="VK_FORMAT_ASTC_3x3x3_UNORM_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="289" offset="1" name="VK_FORMAT_ASTC_3x3x3_SRGB_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="289" offset="2" name="VK_FORMAT_ASTC_3x3x3_SFLOAT_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="289" offset="3" name="VK_FORMAT_ASTC_4x3x3_UNORM_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="289" offset="4" name="VK_FORMAT_ASTC_4x3x3_SRGB_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="289" offset="5" name="VK_FORMAT_ASTC_4x3x3_SFLOAT_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="289" offset="6" name="VK_FORMAT_ASTC_4x4x3_UNORM_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="289" offset="7" name="VK_FORMAT_ASTC_4x4x3_SRGB_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="289" offset="8" name="VK_FORMAT_ASTC_4x4x3_SFLOAT_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="289" offset="9" name="VK_FORMAT_ASTC_4x4x4_UNORM_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="289" offset="10" name="VK_FORMAT_ASTC_4x4x4_SRGB_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="289" offset="11" name="VK_FORMAT_ASTC_4x4x4_SFLOAT_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="289" offset="12" name="VK_FORMAT_ASTC_5x4x4_UNORM_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="289" offset="13" name="VK_FORMAT_ASTC_5x4x4_SRGB_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="289" offset="14" name="VK_FORMAT_ASTC_5x4x4_SFLOAT_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="289" offset="15" name="VK_FORMAT_ASTC_5x5x4_UNORM_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="289" offset="16" name="VK_FORMAT_ASTC_5x5x4_SRGB_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="289" offset="17" name="VK_FORMAT_ASTC_5x5x4_SFLOAT_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="289" offset="18" name="VK_FORMAT_ASTC_5x5x5_UNORM_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="289" offset="19" name="VK_FORMAT_ASTC_5x5x5_SRGB_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="289" offset="20" name="VK_FORMAT_ASTC_5x5x5_SFLOAT_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="289" offset="21" name="VK_FORMAT_ASTC_6x5x5_UNORM_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="289" offset="22" name="VK_FORMAT_ASTC_6x5x5_SRGB_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="289" offset="23" name="VK_FORMAT_ASTC_6x5x5_SFLOAT_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="289" offset="24" name="VK_FORMAT_ASTC_6x6x5_UNORM_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="289" offset="25" name="VK_FORMAT_ASTC_6x6x5_SRGB_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="289" offset="26" name="VK_FORMAT_ASTC_6x6x5_SFLOAT_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="289" offset="27" name="VK_FORMAT_ASTC_6x6x6_UNORM_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="289" offset="28" name="VK_FORMAT_ASTC_6x6x6_SRGB_BLOCK_EXT"/>
+                <enum extends="VkFormat" extnumber="289" offset="29" name="VK_FORMAT_ASTC_6x6x6_SFLOAT_BLOCK_EXT"/>
+            </require>
+        </extension>
+        <extension name="VK_GOOGLE_user_type" number="290" type="device" author="GOOGLE" contact="Kaye Mason @chaleur" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_GOOGLE_USER_TYPE_SPEC_VERSION"/>
+                <enum value="&quot;VK_GOOGLE_user_type&quot;"               name="VK_GOOGLE_USER_TYPE_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_pipeline_library" number="291" type="device" author="KHR" contact="Christoph Kubisch @pixeljetstream" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_KHR_PIPELINE_LIBRARY_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_pipeline_library&quot;"           name="VK_KHR_PIPELINE_LIBRARY_EXTENSION_NAME"/>
+                <enum bitpos="11" extends="VkPipelineCreateFlagBits"        name="VK_PIPELINE_CREATE_LIBRARY_BIT_KHR"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR"/>
+                <type name="VkPipelineLibraryCreateInfoKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_extension_292" number="292" author="NV" contact="Daniel Koch @dgkoch" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_NV_EXTENSION_292_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_extension_292&quot;"               name="VK_NV_EXTENSION_292_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_extension_293" number="293" author="NV" contact="Daniel Koch @dgkoch" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_NV_EXTENSION_293_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_extension_293&quot;"               name="VK_NV_EXTENSION_293_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_shader_non_semantic_info" number="294" type="device" author="KHR" contact="Baldur Karlsson @baldurk" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_KHR_SHADER_NON_SEMANTIC_INFO_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_shader_non_semantic_info&quot;"   name="VK_KHR_SHADER_NON_SEMANTIC_INFO_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_present_id" number="295" type="device" requires="VK_KHR_swapchain" author="KHR" contact="Keith Packard @keithp" supported="vulkan">
+            <require>
+                <enum value="1"                                         name="VK_KHR_PRESENT_ID_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_present_id&quot;"             name="VK_KHR_PRESENT_ID_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_PRESENT_ID_KHR"/>
+                <type name="VkPresentIdKHR"/>
+                <enum offset="1" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR"/>
+                <type name="VkPhysicalDevicePresentIdFeaturesKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_private_data" number="296" type="device" author="NV" contact="Matthew Rusch @mattruschnv" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_PRIVATE_DATA_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_private_data&quot;"               name="VK_EXT_PRIVATE_DATA_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO_EXT"/>
+                <enum offset="2" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO_EXT"/>
+                <enum offset="0" extends="VkObjectType"                     name="VK_OBJECT_TYPE_PRIVATE_DATA_SLOT_EXT"/>
+                <type name="VkPhysicalDevicePrivateDataFeaturesEXT"/>
+                <type name="VkDevicePrivateDataCreateInfoEXT"/>
+                <type name="VkPrivateDataSlotCreateInfoEXT"/>
+                <type name="VkPrivateDataSlotEXT"/>
+                <type name="VkPrivateDataSlotCreateFlagsEXT"/>
+                <type name="VkPrivateDataSlotCreateFlagBitsEXT"/>
+                <command name="vkCreatePrivateDataSlotEXT"/>
+                <command name="vkDestroyPrivateDataSlotEXT"/>
+                <command name="vkSetPrivateDataEXT"/>
+                <command name="vkGetPrivateDataEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_extension_297" number="297" author="KHR" contact="Corentin Wallez @Kangz" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_KHR_EXTENSION_297_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_extension_297&quot;"              name="VK_KHR_EXTENSION_297_EXTENSION_NAME"/>
+                <enum bitpos="3" extends="VkPipelineShaderStageCreateFlagBits"  name="VK_PIPELINE_SHADER_STAGE_CREATE_RESERVED_3_BIT_KHR"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_pipeline_creation_cache_control" number="298" type="device" author="AMD" contact="Gregory Grebe @grgrebe_amd" supported="vulkan">
+            <require>
+                <enum value="3" name="VK_EXT_PIPELINE_CREATION_CACHE_CONTROL_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_pipeline_creation_cache_control&quot;"
+                    name="VK_EXT_PIPELINE_CREATION_CACHE_CONTROL_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"
+                    name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES_EXT"/>
+                <type name="VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT"/>
+                <enum bitpos="8"  extends="VkPipelineCreateFlagBits"
+                    name="VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_EXT"/>
+                <enum bitpos="9" extends="VkPipelineCreateFlagBits"
+                    name="VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT_EXT"/>
+                <enum extends="VkResult" offset="0" name="VK_PIPELINE_COMPILE_REQUIRED_EXT"/>
+                <enum extends="VkResult"            name="VK_ERROR_PIPELINE_COMPILE_REQUIRED_EXT" alias="VK_PIPELINE_COMPILE_REQUIRED_EXT"/>
+                <enum bitpos="0"  extends="VkPipelineCacheCreateFlagBits"
+                    name="VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT_EXT"/>
+                <type name="VkPipelineCacheCreateFlagBits" comment="This is a temporary workaround for processors not recognizing that VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT_EXT above also requires this type"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_extension_299" number="299" author="KHR" contact="Mark Bellamy @mark.bellamy_arm" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_KHR_EXTENSION_299_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_extension_299&quot;"              name="VK_KHR_EXTENSION_299_EXTENSION_NAME"/>
+                <enum bitpos="2"  extends="VkMemoryHeapFlagBits"            name="VK_MEMORY_HEAP_RESERVED_2_BIT_KHR"/>
+                <enum             extends="VkPipelineCacheCreateFlagBits"   name="VK_PIPELINE_CACHE_CREATE_RESERVED_1_BIT_KHR" alias="VK_PIPELINE_CACHE_CREATE_RESERVED_1_BIT_EXT"/>
+                <enum bitpos="2"  extends="VkPipelineCacheCreateFlagBits"   name="VK_PIPELINE_CACHE_CREATE_RESERVED_2_BIT_KHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_video_encode_queue" number="300"  type="device" requires="VK_KHR_video_queue,VK_KHR_synchronization2" author="KHR" contact="[email protected]" provisional="true" platform="provisional" supported="vulkan">
+            <require>
+                <enum value="3"                                         name="VK_KHR_VIDEO_ENCODE_QUEUE_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_video_encode_queue&quot;"     name="VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME"/>
+                <enum bitpos="27" extends="VkPipelineStageFlagBits2KHR" name="VK_PIPELINE_STAGE_2_VIDEO_ENCODE_BIT_KHR" protect="VK_ENABLE_BETA_EXTENSIONS" />
+                <enum bitpos="37" extends="VkAccessFlagBits2KHR"        name="VK_ACCESS_2_VIDEO_ENCODE_READ_BIT_KHR" protect="VK_ENABLE_BETA_EXTENSIONS" />
+                <enum bitpos="38" extends="VkAccessFlagBits2KHR"        name="VK_ACCESS_2_VIDEO_ENCODE_WRITE_BIT_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="0" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_VIDEO_ENCODE_INFO_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="1" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_INFO_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum bitpos="6" extends="VkQueueFlagBits"              name="VK_QUEUE_VIDEO_ENCODE_BIT_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum bitpos="15" extends="VkBufferUsageFlagBits"       name="VK_BUFFER_USAGE_VIDEO_ENCODE_DST_BIT_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum bitpos="16" extends="VkBufferUsageFlagBits"       name="VK_BUFFER_USAGE_VIDEO_ENCODE_SRC_BIT_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum bitpos="13" extends="VkImageUsageFlagBits"        name="VK_IMAGE_USAGE_VIDEO_ENCODE_DST_BIT_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum bitpos="14" extends="VkImageUsageFlagBits"        name="VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum bitpos="15" extends="VkImageUsageFlagBits"        name="VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum bitpos="27" extends="VkFormatFeatureFlagBits"     name="VK_FORMAT_FEATURE_VIDEO_ENCODE_INPUT_BIT_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum bitpos="28" extends="VkFormatFeatureFlagBits"     name="VK_FORMAT_FEATURE_VIDEO_ENCODE_DPB_BIT_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="0" extends="VkImageLayout"                name="VK_IMAGE_LAYOUT_VIDEO_ENCODE_DST_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="1" extends="VkImageLayout"                name="VK_IMAGE_LAYOUT_VIDEO_ENCODE_SRC_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="2" extends="VkImageLayout"                name="VK_IMAGE_LAYOUT_VIDEO_ENCODE_DPB_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum offset="0" extends="VkQueryType"                  name="VK_QUERY_TYPE_VIDEO_ENCODE_BITSTREAM_BUFFER_RANGE_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+
+                <type name="VkVideoEncodeFlagBitsKHR"/>
+                <type name="VkVideoEncodeFlagsKHR"/>
+                <type name="VkVideoEncodeInfoKHR"/>
+
+                <type name="VkVideoEncodeRateControlFlagBitsKHR"/>
+                <type name="VkVideoEncodeRateControlFlagsKHR"/>
+                <type name="VkVideoEncodeRateControlModeFlagBitsKHR"/>
+                <type name="VkVideoEncodeRateControlModeFlagsKHR"/>
+
+                <type name="VkVideoEncodeRateControlInfoKHR"/>
+                <command name="vkCmdEncodeVideoKHR"/>
+            </require>
+            <require extension="VK_KHR_format_feature_flags2">
+                <enum bitpos="27" extends="VkFormatFeatureFlagBits2KHR"     name="VK_FORMAT_FEATURE_2_VIDEO_ENCODE_INPUT_BIT_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+                <enum bitpos="28" extends="VkFormatFeatureFlagBits2KHR"     name="VK_FORMAT_FEATURE_2_VIDEO_ENCODE_DPB_BIT_KHR" protect="VK_ENABLE_BETA_EXTENSIONS"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_device_diagnostics_config" number="301" type="device" requires="VK_KHR_get_physical_device_properties2" author="NV" contact="Kedarnath Thangudu @kthangudu" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_NV_DEVICE_DIAGNOSTICS_CONFIG_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_device_diagnostics_config&quot;"   name="VK_NV_DEVICE_DIAGNOSTICS_CONFIG_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV"/>
+                <enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV"/>
+                <type name="VkPhysicalDeviceDiagnosticsConfigFeaturesNV"/>
+                <type name="VkDeviceDiagnosticsConfigCreateInfoNV"/>
+                <type name="VkDeviceDiagnosticsConfigFlagsNV"/>
+                <type name="VkDeviceDiagnosticsConfigFlagBitsNV"/>
+            </require>
+        </extension>
+        <extension name="VK_QCOM_render_pass_store_ops" number="302" type="device" author="QCOM" contact="Bill Licea-Kane @wwlk" supported="vulkan">
+            <require>
+                <enum value="2"                                             name="VK_QCOM_RENDER_PASS_STORE_OPS_SPEC_VERSION"/>
+                <enum value="&quot;VK_QCOM_render_pass_store_ops&quot;"     name="VK_QCOM_RENDER_PASS_STORE_OPS_EXTENSION_NAME"/>
+                <enum extends="VkAttachmentStoreOp"                         name="VK_ATTACHMENT_STORE_OP_NONE_QCOM" alias="VK_ATTACHMENT_STORE_OP_NONE_KHR"/>
+            </require>
+        </extension>
+        <extension name="VK_QCOM_extension_303" number="303" author="QCOM" contact="Bill Licea-Kane @wwlk" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_QCOM_EXTENSION_303_SPEC_VERSION"/>
+                <enum value="&quot;VK_QCOM_extension_303&quot;"             name="VK_QCOM_EXTENSION_303_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_QCOM_extension_304" number="304" author="QCOM" contact="Bill Licea-Kane @wwlk" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_QCOM_EXTENSION_304_SPEC_VERSION"/>
+                <enum value="&quot;VK_QCOM_extension_304&quot;"             name="VK_QCOM_EXTENSION_304_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_QCOM_extension_305" number="305" author="QCOM" contact="Bill Licea-Kane @wwlk" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_QCOM_EXTENSION_305_SPEC_VERSION"/>
+                <enum value="&quot;VK_QCOM_extension_305&quot;"             name="VK_QCOM_EXTENSION_305_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_QCOM_extension_306" number="306" author="QCOM" contact="Bill Licea-Kane @wwlk" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_QCOM_EXTENSION_306_SPEC_VERSION"/>
+                <enum value="&quot;VK_QCOM_extension_306&quot;"             name="VK_QCOM_EXTENSION_306_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_QCOM_extension_307" number="307" author="QCOM" contact="Bill Licea-Kane @wwlk" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_QCOM_EXTENSION_307_SPEC_VERSION"/>
+                <enum value="&quot;VK_QCOM_extension_307&quot;"             name="VK_QCOM_EXTENSION_307_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_extension_308" number="308" type="device" author="NV" contact="Tristan Lorach @tlorach" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_NV_EXTENSION_308_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_extension_308&quot;"               name="VK_NV_EXTENSION_308_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_extension_309" number="309" author="KHR" contact="Aidan Fabius @afabius" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_KHR_EXTENSION_309_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_extension_309&quot;"              name="VK_KHR_EXTENSION_309_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_QCOM_extension_310" number="310" author="QCOM" contact="Jeff Leger @jackohound" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_QCOM_EXTENSION_310_SPEC_VERSION"/>
+                <enum value="&quot;VK_QCOM_extension_310&quot;"             name="VK_QCOM_EXTENSION_310_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_RESERVED_QCOM"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_extension_311" number="311" author="NV" contact="Charles Hansen @cshansen" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_NV_EXTENSION_311_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_extension_311&quot;"               name="VK_NV_EXTENSION_311_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_312" number="312" author="MVK" contact="Bill Hollings @billhollings" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_EXT_EXTENSION_312_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_312&quot;"              name="VK_EXT_EXTENSION_312_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_313" number="313" author="MVK" contact="Bill Hollings @billhollings" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_EXT_EXTENSION_313_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_313&quot;"              name="VK_EXT_EXTENSION_313_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_314" number="314" author="AMD" contact="Martin Dinkov @mdinkov" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_AMD_EXTENSION_314_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_314&quot;"              name="VK_AMD_EXTENSION_314_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_synchronization2" number="315" type="device" author="KHR" requires="VK_KHR_get_physical_device_properties2" contact="Tobias Hector @tobski" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_KHR_SYNCHRONIZATION_2_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_synchronization2&quot;"           name="VK_KHR_SYNCHRONIZATION_2_EXTENSION_NAME"/>
+                <enum offset="0"  extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_MEMORY_BARRIER_2_KHR"/>
+                <enum offset="1"  extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2_KHR"/>
+                <enum offset="2"  extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2_KHR"/>
+                <enum offset="3"  extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_DEPENDENCY_INFO_KHR"/>
+                <enum offset="4"  extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_SUBMIT_INFO_2_KHR"/>
+                <enum offset="5"  extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO_KHR"/>
+                <enum offset="6"  extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO_KHR"/>
+                <enum offset="7"  extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR"/>
+                <enum bitpos="0"  extends="VkEventCreateFlagBits"           name="VK_EVENT_CREATE_DEVICE_ONLY_BIT_KHR"/>
+                <enum offset="0"  extends="VkImageLayout"                   name="VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR"/>
+                <enum offset="1"  extends="VkImageLayout"                   name="VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR"/>
+                <enum value="0"  extends="VkPipelineStageFlagBits"          name="VK_PIPELINE_STAGE_NONE_KHR"/>
+                <enum value="0"  extends="VkAccessFlagBits"                 name="VK_ACCESS_NONE_KHR"/>
+                <type name="VkFlags64"/>
+                <type name="VkPipelineStageFlags2KHR"/>
+                <type name="VkPipelineStageFlagBits2KHR"/>
+                <type name="VkAccessFlags2KHR"/>
+                <type name="VkAccessFlagBits2KHR"/>
+                <type name="VkMemoryBarrier2KHR"/>
+                <type name="VkBufferMemoryBarrier2KHR"/>
+                <type name="VkImageMemoryBarrier2KHR"/>
+                <type name="VkDependencyInfoKHR"/>
+                <type name="VkSubmitInfo2KHR"/>
+                <type name="VkSemaphoreSubmitInfoKHR"/>
+                <type name="VkCommandBufferSubmitInfoKHR"/>
+                <type name="VkSubmitFlagBitsKHR"/>
+                <type name="VkSubmitFlagsKHR"/>
+                <type name="VkPhysicalDeviceSynchronization2FeaturesKHR"/>
+                <command name="vkCmdSetEvent2KHR"/>
+                <command name="vkCmdResetEvent2KHR"/>
+                <command name="vkCmdWaitEvents2KHR"/>
+                <command name="vkCmdPipelineBarrier2KHR"/>
+                <command name="vkCmdWriteTimestamp2KHR"/>
+                <command name="vkQueueSubmit2KHR"/>
+            </require>
+            <require extension="VK_EXT_transform_feedback">
+                <enum bitpos="24" extends="VkPipelineStageFlagBits2KHR"     name="VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT"/>
+                <enum bitpos="25" extends="VkAccessFlagBits2KHR"            name="VK_ACCESS_2_TRANSFORM_FEEDBACK_WRITE_BIT_EXT"/>
+                <enum bitpos="26" extends="VkAccessFlagBits2KHR"            name="VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT"/>
+                <enum bitpos="27" extends="VkAccessFlagBits2KHR"            name="VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT"/>
+            </require>
+            <require extension="VK_EXT_conditional_rendering">
+                <enum bitpos="18" extends="VkPipelineStageFlagBits2KHR"     name="VK_PIPELINE_STAGE_2_CONDITIONAL_RENDERING_BIT_EXT" comment="A pipeline stage for conditional rendering predicate fetch"/>
+                <enum bitpos="20" extends="VkAccessFlagBits2KHR"            name="VK_ACCESS_2_CONDITIONAL_RENDERING_READ_BIT_EXT"  comment="read access flag for reading conditional rendering predicate"/>
+            </require>
+            <require extension="VK_NV_device_generated_commands">
+                <enum bitpos="17" extends="VkPipelineStageFlagBits2KHR"     name="VK_PIPELINE_STAGE_2_COMMAND_PREPROCESS_BIT_NV"/>
+                <enum bitpos="17" extends="VkAccessFlagBits2KHR"            name="VK_ACCESS_2_COMMAND_PREPROCESS_READ_BIT_NV"/>
+                <enum bitpos="18" extends="VkAccessFlagBits2KHR"            name="VK_ACCESS_2_COMMAND_PREPROCESS_WRITE_BIT_NV"/>
+            </require>
+            <require extension="VK_KHR_fragment_shading_rate">
+                <enum bitpos="22" extends="VkPipelineStageFlagBits2KHR"     name="VK_PIPELINE_STAGE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR"/>
+                <enum bitpos="23" extends="VkAccessFlagBits2KHR"            name="VK_ACCESS_2_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR"/>
+            </require>
+            <require extension="VK_NV_shading_rate_image">
+                <enum extends="VkPipelineStageFlagBits2KHR"                 name="VK_PIPELINE_STAGE_2_SHADING_RATE_IMAGE_BIT_NV" alias="VK_PIPELINE_STAGE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR"/>
+                <enum extends="VkAccessFlagBits2KHR"                        name="VK_ACCESS_2_SHADING_RATE_IMAGE_READ_BIT_NV"    alias="VK_ACCESS_2_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR"/>
+            </require>
+            <require extension="VK_KHR_acceleration_structure">
+                <enum bitpos="25" extends="VkPipelineStageFlagBits2KHR"     name="VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_BUILD_BIT_KHR"/>
+                <enum bitpos="21" extends="VkAccessFlagBits2KHR"            name="VK_ACCESS_2_ACCELERATION_STRUCTURE_READ_BIT_KHR"/>
+                <enum bitpos="22" extends="VkAccessFlagBits2KHR"            name="VK_ACCESS_2_ACCELERATION_STRUCTURE_WRITE_BIT_KHR"/>
+            </require>
+            <require extension="VK_KHR_ray_tracing_pipeline">
+                <enum bitpos="21" extends="VkPipelineStageFlagBits2KHR"     name="VK_PIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_KHR"/>
+            </require>
+            <require extension="VK_NV_ray_tracing">
+                <enum extends="VkPipelineStageFlagBits2KHR"                 name="VK_PIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_NV" alias="VK_PIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_KHR"/>
+                <enum extends="VkPipelineStageFlagBits2KHR"                 name="VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_BUILD_BIT_NV" alias="VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_BUILD_BIT_KHR"/>
+                <enum extends="VkAccessFlagBits2KHR"                        name="VK_ACCESS_2_ACCELERATION_STRUCTURE_READ_BIT_NV" alias="VK_ACCESS_2_ACCELERATION_STRUCTURE_READ_BIT_KHR"/>
+                <enum extends="VkAccessFlagBits2KHR"                        name="VK_ACCESS_2_ACCELERATION_STRUCTURE_WRITE_BIT_NV" alias="VK_ACCESS_2_ACCELERATION_STRUCTURE_WRITE_BIT_KHR"/>
+            </require>
+            <require extension="VK_EXT_fragment_density_map">
+                <enum bitpos="23" extends="VkPipelineStageFlagBits2KHR"     name="VK_PIPELINE_STAGE_2_FRAGMENT_DENSITY_PROCESS_BIT_EXT"/>
+                <enum bitpos="24" extends="VkAccessFlagBits2KHR"            name="VK_ACCESS_2_FRAGMENT_DENSITY_MAP_READ_BIT_EXT"/>
+            </require>
+            <require extension="VK_EXT_blend_operation_advanced">
+                <enum bitpos="19" extends="VkAccessFlagBits2KHR"            name="VK_ACCESS_2_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT"/>
+            </require>
+            <require extension="VK_NV_mesh_shader">
+                <enum bitpos="19" extends="VkPipelineStageFlagBits2KHR"     name="VK_PIPELINE_STAGE_2_TASK_SHADER_BIT_NV"/>
+                <enum bitpos="20" extends="VkPipelineStageFlagBits2KHR"     name="VK_PIPELINE_STAGE_2_MESH_SHADER_BIT_NV"/>
+            </require>
+            <require extension="VK_AMD_buffer_marker">
+                <command name="vkCmdWriteBufferMarker2AMD"/>
+            </require>
+            <require extension="VK_NV_device_diagnostic_checkpoints">
+                <type name="VkQueueFamilyCheckpointProperties2NV"/>
+                <type name="VkCheckpointData2NV"/>
+                <command name="vkGetQueueCheckpointData2NV"/>
+                <enum offset="8" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV"/>
+                <enum offset="9" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_CHECKPOINT_DATA_2_NV"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_316" number="316" author="AMD" contact="Martin Dinkov @mdinkov" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_AMD_EXTENSION_316_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_316&quot;"              name="VK_AMD_EXTENSION_316_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_317" number="317" author="AMD" contact="Martin Dinkov @mdinkov" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_AMD_EXTENSION_317_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_317&quot;"              name="VK_AMD_EXTENSION_317_EXTENSION_NAME"/>
+                <enum bitpos="4" extends="VkDescriptorSetLayoutCreateFlagBits"  name="VK_DESCRIPTOR_SET_LAYOUT_CREATE_RESERVED_4_BIT_AMD"/>
+                <enum bitpos="21" extends="VkBufferUsageFlagBits"               name="VK_BUFFER_USAGE_RESERVED_21_BIT_AMD"/>
+                <enum bitpos="22" extends="VkBufferUsageFlagBits"               name="VK_BUFFER_USAGE_RESERVED_22_BIT_AMD"/>
+                <enum bitpos="5" extends="VkBufferCreateFlagBits"               name="VK_BUFFER_CREATE_RESERVED_5_BIT_AMD"/>
+                <enum bitpos="16" extends="VkImageCreateFlagBits"               name="VK_IMAGE_CREATE_RESERVED_16_BIT_AMD"/>
+                <enum bitpos="3" extends="VkSamplerCreateFlagBits"              name="VK_SAMPLER_CREATE_RESERVED_3_BIT_AMD"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_318" number="318" author="AMD" contact="Martin Dinkov @mdinkov" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_AMD_EXTENSION_318_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_318&quot;"              name="VK_AMD_EXTENSION_318_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_319" number="319" author="AMD" contact="Martin Dinkov @mdinkov" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_AMD_EXTENSION_319_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_319&quot;"              name="VK_AMD_EXTENSION_319_EXTENSION_NAME"/>
+                <enum bitpos="3" extends="VkDescriptorSetLayoutCreateFlagBits" name="VK_DESCRIPTOR_SET_LAYOUT_CREATE_RESERVED_3_BIT_AMD"/>
+                <enum bitpos="0" extends="VkPipelineLayoutCreateFlagBits" name="VK_PIPELINE_LAYOUT_CREATE_RESERVED_0_BIT_AMD"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_320" number="320" author="AMD" contact="Martin Dinkov @mdinkov" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_AMD_EXTENSION_320_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_320&quot;"              name="VK_AMD_EXTENSION_320_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_321" number="321" author="AMD" contact="Martin Dinkov @mdinkov" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_AMD_EXTENSION_321_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_321&quot;"              name="VK_AMD_EXTENSION_321_EXTENSION_NAME"/>
+                <enum bitpos="23" extends="VkPipelineCreateFlagBits"            name="VK_PIPELINE_CREATE_RESERVED_23_BIT_AMD"/>
+                <enum bitpos="10" extends="VkPipelineCreateFlagBits"            name="VK_PIPELINE_CREATE_RESERVED_10_BIT_AMD"/>
+                <enum bitpos="1"  extends="VkPipelineLayoutCreateFlagBits"      name="VK_PIPELINE_LAYOUT_CREATE_RESERVED_1_BIT_AMD"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_322" number="322" author="AMD" contact="Martin Dinkov @mdinkov" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_AMD_EXTENSION_322_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_322&quot;"              name="VK_AMD_EXTENSION_322_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_AMD_extension_323" number="323" author="AMD" contact="Martin Dinkov @mdinkov" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_AMD_EXTENSION_323_SPEC_VERSION"/>
+                <enum value="&quot;VK_AMD_extension_323&quot;"              name="VK_AMD_EXTENSION_323_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_shader_subgroup_uniform_control_flow" number="324" type="device" requiresCore="1.1" author="KHR" contact="Alan Baker @alan-baker" supported="vulkan">
+            <require>
+                <enum value="1" name="VK_KHR_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_shader_subgroup_uniform_control_flow&quot;" name="VK_KHR_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR"/>
+                <type name="VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_extension_325" number="325" author="KHR" contact="Ralph Potter gitlab:@r_potter" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_KHR_EXTENSION_325_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_extension_325&quot;"              name="VK_KHR_EXTENSION_325_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_zero_initialize_workgroup_memory" number="326" type="device" requires="VK_KHR_get_physical_device_properties2" author="KHR" contact="Alan Baker @alan-baker" supported="vulkan">
+            <require>
+                <enum value="1" name="VK_KHR_ZERO_INITIALIZE_WORKGROUP_MEMORY_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_zero_initialize_workgroup_memory&quot;" name="VK_KHR_ZERO_INITIALIZE_WORKGROUP_MEMORY_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES_KHR"/>
+                <type name="VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_fragment_shading_rate_enums" number="327" type="device" requires="VK_KHR_fragment_shading_rate" author="NV" contact="Pat Brown @nvpbrown" supported="vulkan">
+            <require>
+                <enum value="1"                                                 name="VK_NV_FRAGMENT_SHADING_RATE_ENUMS_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_fragment_shading_rate_enums&quot;" name="VK_NV_FRAGMENT_SHADING_RATE_ENUMS_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV"/>
+                <enum offset="1" extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV"/>
+                <enum offset="2" extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV"/>
+                <type name="VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV"/>
+                <type name="VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV"/>
+                <type name="VkPipelineFragmentShadingRateEnumStateCreateInfoNV"/>
+                <type name="VkFragmentShadingRateNV"/>
+                <type name="VkFragmentShadingRateTypeNV"/>
+                <command name="vkCmdSetFragmentShadingRateEnumNV"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_ray_tracing_motion_blur" number="328" type="device" requires="VK_KHR_ray_tracing_pipeline" author="NV" contact="Eric Werness" supported="vulkan">
+            <require>
+                <enum value="1"                                                    name="VK_NV_RAY_TRACING_MOTION_BLUR_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_ray_tracing_motion_blur&quot;"            name="VK_NV_RAY_TRACING_MOTION_BLUR_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                         name="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV"/>
+                <enum offset="1" extends="VkStructureType"                         name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV"/>
+                <enum offset="2" extends="VkStructureType"                         name="VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV"/>
+                <enum bitpos="5" extends="VkBuildAccelerationStructureFlagBitsKHR" name="VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV"/>
+                <enum bitpos="2" extends="VkAccelerationStructureCreateFlagBitsKHR" name="VK_ACCELERATION_STRUCTURE_CREATE_MOTION_BIT_NV"/>
+                <enum bitpos="20" extends="VkPipelineCreateFlagBits"               name="VK_PIPELINE_CREATE_RAY_TRACING_ALLOW_MOTION_BIT_NV"/>
+                <type name="VkAccelerationStructureGeometryMotionTrianglesDataNV"/>
+                <type name="VkAccelerationStructureMotionInfoNV"/>
+                <type name="VkAccelerationStructureMotionInstanceNV"/>
+                <type name="VkAccelerationStructureMotionInstanceDataNV"/>
+                <type name="VkAccelerationStructureMatrixMotionInstanceNV"/>
+                <type name="VkAccelerationStructureSRTMotionInstanceNV"/>
+                <type name="VkSRTDataNV"/>
+                <type name="VkAccelerationStructureMotionInstanceTypeNV"/>
+                <type name="VkPhysicalDeviceRayTracingMotionBlurFeaturesNV"/>
+                <type name="VkAccelerationStructureMotionInfoFlagsNV"/>
+                <type name="VkAccelerationStructureMotionInstanceFlagsNV"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_extension_329" number="329" author="NV" contact="Pat Brown @nvpbrown" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_NV_EXTENSION_329_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_extension_329&quot;"               name="VK_NV_EXTENSION_329_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_extension_330" number="330" author="NV" contact="Liam Middlebrook @liam-middlebrook" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_NV_EXTENSION_330_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_extension_330&quot;"               name="VK_NV_EXTENSION_330_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_ycbcr_2plane_444_formats" number="331" type="device" requires="VK_KHR_sampler_ycbcr_conversion" author="EXT" contact="Tony Zlatinski @tzlatinski" supported="vulkan">
+            <require>
+                <enum value="1"                                           name="VK_EXT_YCBCR_2PLANE_444_FORMATS_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_ycbcr_2plane_444_formats&quot;" name="VK_EXT_YCBCR_2PLANE_444_FORMATS_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT"/>
+                <enum offset="0" extends="VkFormat"                       name="VK_FORMAT_G8_B8R8_2PLANE_444_UNORM_EXT"/>
+                <enum offset="1" extends="VkFormat"                       name="VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16_EXT"/>
+                <enum offset="2" extends="VkFormat"                       name="VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16_EXT"/>
+                <enum offset="3" extends="VkFormat"                       name="VK_FORMAT_G16_B16R16_2PLANE_444_UNORM_EXT"/>
+                <type name="VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_extension_332" number="332" author="NV" contact="Tony Zlatinski @tzlatinski" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_NV_EXTENSION_332_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_extension_332&quot;"               name="VK_NV_EXTENSION_332_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_fragment_density_map2" number="333" type="device" requires="VK_EXT_fragment_density_map" author="EXT" contact="Matthew Netsch @mnetsch" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_FRAGMENT_DENSITY_MAP_2_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_fragment_density_map2&quot;"      name="VK_EXT_FRAGMENT_DENSITY_MAP_2_EXTENSION_NAME"/>
+                <enum offset="0"  extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT"/>
+                <enum offset="1"  extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT"/>
+                <enum bitpos="1"  extends="VkImageViewCreateFlagBits"       name="VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DEFERRED_BIT_EXT"/>
+                <type name="VkPhysicalDeviceFragmentDensityMap2FeaturesEXT"/>
+                <type name="VkPhysicalDeviceFragmentDensityMap2PropertiesEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_QCOM_rotated_copy_commands" number="334" type="device" requires="VK_KHR_swapchain,VK_KHR_copy_commands2" author="QCOM" contact="Jeff Leger @jackohound" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_QCOM_ROTATED_COPY_COMMANDS_SPEC_VERSION"/>
+                <enum value="&quot;VK_QCOM_rotated_copy_commands&quot;"     name="VK_QCOM_ROTATED_COPY_COMMANDS_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM"/>
+                <type name="VkCopyCommandTransformInfoQCOM"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_extension_335" number="335" author="KHR" contact="Mark Bellamy @mark.bellamy_arm" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_KHR_EXTENSION_335_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_extension_335&quot;"              name="VK_KHR_EXTENSION_335_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_image_robustness" number="336" type="device" author="EXT" contact="Graeme Leese @gnl21" supported="vulkan" requires="VK_KHR_get_physical_device_properties2">
+            <require>
+                <enum value="1"                                             name="VK_EXT_IMAGE_ROBUSTNESS_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_image_robustness&quot;"           name="VK_EXT_IMAGE_ROBUSTNESS_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES_EXT"/>
+                <type name="VkPhysicalDeviceImageRobustnessFeaturesEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_workgroup_memory_explicit_layout" number="337" type="device" requires="VK_KHR_get_physical_device_properties2" author="KHR" contact="Caio Marcelo de Oliveira Filho @cmarcelo" supported="vulkan">
+            <require>
+                <enum value="1"                                                      name="VK_KHR_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_workgroup_memory_explicit_layout&quot;"    name="VK_KHR_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                           name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR"/>
+                <type name="VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_copy_commands2" number="338" author="KHR" type="device" contact="Jeff Leger @jackohound" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_KHR_COPY_COMMANDS_2_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_copy_commands2&quot;"             name="VK_KHR_COPY_COMMANDS_2_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_COPY_BUFFER_INFO_2_KHR"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_COPY_IMAGE_INFO_2_KHR"/>
+                <enum offset="2" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2_KHR"/>
+                <enum offset="3" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2_KHR"/>
+                <enum offset="4" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_BLIT_IMAGE_INFO_2_KHR"/>
+                <enum offset="5" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2_KHR"/>
+                <enum offset="6" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_BUFFER_COPY_2_KHR"/>
+                <enum offset="7" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_IMAGE_COPY_2_KHR"/>
+                <enum offset="8" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_IMAGE_BLIT_2_KHR"/>
+                <enum offset="9" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2_KHR"/>
+                <enum offset="10" extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_IMAGE_RESOLVE_2_KHR"/>
+                <type name="VkCopyBufferInfo2KHR"/>
+                <type name="VkCopyImageInfo2KHR"/>
+                <type name="VkCopyBufferToImageInfo2KHR"/>
+                <type name="VkCopyImageToBufferInfo2KHR"/>
+                <type name="VkBlitImageInfo2KHR"/>
+                <type name="VkResolveImageInfo2KHR"/>
+                <type name="VkBufferCopy2KHR"/>
+                <type name="VkImageCopy2KHR"/>
+                <type name="VkImageBlit2KHR"/>
+                <type name="VkBufferImageCopy2KHR"/>
+                <type name="VkImageResolve2KHR"/>
+                <command name="vkCmdCopyBuffer2KHR"/>
+                <command name="vkCmdCopyImage2KHR"/>
+                <command name="vkCmdCopyBufferToImage2KHR"/>
+                <command name="vkCmdCopyImageToBuffer2KHR"/>
+                <command name="vkCmdBlitImage2KHR"/>
+                <command name="vkCmdResolveImage2KHR"/>
+            </require>
+        </extension>
+        <extension name="VK_ARM_extension_339" number="339" author="ARM" contact="Jan-Harald Fredriksen @janharaldfredriksen-arm" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_ARM_EXTENSION_339_SPEC_VERSION"/>
+                <enum value="&quot;VK_ARM_extension_339&quot;"              name="VK_ARM_EXTENSION_339_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_340" number="340" author="EXT" contact="Joshua Ashton @Joshua-Ashton" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_EXT_EXTENSION_340_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_340&quot;"              name="VK_EXT_EXTENSION_340_EXTENSION_NAME"/>
+                <enum bitpos="19" extends="VkImageUsageFlagBits"            name="VK_IMAGE_USAGE_RESERVED_19_BIT_EXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_4444_formats" number="341" type="device" requires="VK_KHR_get_physical_device_properties2" author="EXT" contact="Joshua Ashton @Joshua-Ashton" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_4444_FORMATS_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_4444_formats&quot;"               name="VK_EXT_4444_FORMATS_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT"/>
+                <enum offset="0" extends="VkFormat"                         name="VK_FORMAT_A4R4G4B4_UNORM_PACK16_EXT"/>
+                <enum offset="1" extends="VkFormat"                         name="VK_FORMAT_A4B4G4R4_UNORM_PACK16_EXT"/>
+                <type name="VkPhysicalDevice4444FormatsFeaturesEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_342" number="342" author="EXT" contact="Ralph Potter gitlab:@r_potter" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_EXT_EXTENSION_342_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_342&quot;"              name="VK_EXT_EXTENSION_342_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_ARM_extension_343" number="343" author="ARM" contact="Jan-Harald Fredriksen @janharaldfredriksen-arm" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_ARM_EXTENSION_343_SPEC_VERSION"/>
+                <enum value="&quot;VK_ARM_extension_343&quot;"              name="VK_ARM_EXTENSION_343_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_ARM_extension_344" number="344" author="ARM" contact="Jan-Harald Fredriksen @janharaldfredriksen-arm" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_ARM_EXTENSION_344_SPEC_VERSION"/>
+                <enum value="&quot;VK_ARM_extension_344&quot;"              name="VK_ARM_EXTENSION_344_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_rgba10x6_formats" number="345" type="device" requires="VK_KHR_sampler_ycbcr_conversion" author="EXT" contact="Jan-Harald Fredriksen @janharaldfredriksen-arm" supported="vulkan">
+             <require>
+                    <enum value="1"                                                name="VK_EXT_RGBA10X6_FORMATS_SPEC_VERSION"/>
+                    <enum value="&quot;VK_EXT_rgba10x6_formats&quot;"              name="VK_EXT_RGBA10X6_FORMATS_EXTENSION_NAME"/>
+                    <enum offset="0" extends="VkStructureType"                     name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT"/>
+                    <type name="VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_acquire_winrt_display" number="346" type="device" requires="VK_EXT_direct_mode_display" author="NV" contact="Jeff Juliano @jjuliano" platform="win32" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_NV_ACQUIRE_WINRT_DISPLAY_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_acquire_winrt_display&quot;"       name="VK_NV_ACQUIRE_WINRT_DISPLAY_EXTENSION_NAME"/>
+                <command name="vkAcquireWinrtDisplayNV"/>
+                <command name="vkGetWinrtDisplayNV"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_directfb_surface" number="347" type="instance" requires="VK_KHR_surface" platform="directfb" supported="vulkan" author="EXT" contact="Nicolas Caramelli @caramelli">
+            <require>
+                <enum value="1"                                             name="VK_EXT_DIRECTFB_SURFACE_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_directfb_surface&quot;"           name="VK_EXT_DIRECTFB_SURFACE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_DIRECTFB_SURFACE_CREATE_INFO_EXT"/>
+                <type name="VkDirectFBSurfaceCreateFlagsEXT"/>
+                <type name="VkDirectFBSurfaceCreateInfoEXT"/>
+                <command name="vkCreateDirectFBSurfaceEXT"/>
+                <command name="vkGetPhysicalDeviceDirectFBPresentationSupportEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_extension_350" number="350" author="KHR" contact="Mark Bellamy @mark.bellamy_arm" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_KHR_EXTENSION_350_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_extension_350&quot;"              name="VK_KHR_EXTENSION_350_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_extension_351" number="351" author="NV" contact="Liam Middlebrook @liam-middlebrook" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_NV_EXTENSION_351_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_extension_351&quot;"               name="VK_NV_EXTENSION_351_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_VALVE_mutable_descriptor_type" number="352" type="device" supported="vulkan" author="VALVE" contact="Joshua Ashton @Joshua-Ashton,Hans-Kristian Arntzen @HansKristian-Work" specialuse="d3demulation" requires="VK_KHR_maintenance3">
+            <require>
+                <enum value="1"                                                name="VK_VALVE_MUTABLE_DESCRIPTOR_TYPE_SPEC_VERSION"/>
+                <enum value="&quot;VK_VALVE_mutable_descriptor_type&quot;"     name="VK_VALVE_MUTABLE_DESCRIPTOR_TYPE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                     name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE"/>
+                <enum offset="2" extends="VkStructureType"                     name="VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE"/>
+                <enum offset="0" extends="VkDescriptorType"                    name="VK_DESCRIPTOR_TYPE_MUTABLE_VALVE"/>
+                <enum bitpos="2" extends="VkDescriptorPoolCreateFlagBits"      name="VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_VALVE"/>
+                <enum bitpos="2" extends="VkDescriptorSetLayoutCreateFlagBits" name="VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_VALVE"/>
+                <type name="VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE"/>
+                <type name="VkMutableDescriptorTypeListVALVE"/>
+                <type name="VkMutableDescriptorTypeCreateInfoVALVE"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_vertex_input_dynamic_state" number="353" type="device" requires="VK_KHR_get_physical_device_properties2" author="EXT" contact="Piers Daniell @pdaniell-nv" supported="vulkan">
+            <require>
+                <enum value="2"                                             name="VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_vertex_input_dynamic_state&quot;" name="VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT"/>
+                <enum offset="2" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT"/>
+                <enum offset="0" extends="VkDynamicState"                   name="VK_DYNAMIC_STATE_VERTEX_INPUT_EXT"/>
+                <type name="VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT"/>
+                <type name="VkVertexInputBindingDescription2EXT"/>
+                <type name="VkVertexInputAttributeDescription2EXT"/>
+                <command name="vkCmdSetVertexInputEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_physical_device_drm" number="354" author="EXT" type="device" contact="Simon Ser @emersion" supported="vulkan" requires="VK_KHR_get_physical_device_properties2">
+            <require>
+                <enum value="1"                                             name="VK_EXT_PHYSICAL_DEVICE_DRM_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_physical_device_drm&quot;"        name="VK_EXT_PHYSICAL_DEVICE_DRM_EXTENSION_NAME"/>
+
+                <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT"/>
+
+                <type name="VkPhysicalDeviceDrmPropertiesEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_355" number="355" author="EXT" contact="Ralph Potter gitlab:@r_potter" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_EXT_EXTENSION_355_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_355&quot;"              name="VK_EXT_EXTENSION_355_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_vertex_attribute_aliasing" number="356" type="device" author="EXT" contact="Shahbaz Youssefi @syoussefi" supported="disabled" specialuse="glemulation">
+            <require>
+                <enum value="0"                                             name="VK_EXT_VERTEX_ATTRIBUTE_ALIASING_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_vertex_attribute_aliasing&quot;"  name="VK_EXT_VERTEX_ATTRIBUTE_ALIASING_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_primitive_topology_list_restart" number="357" type="device" author="EXT" contact="Shahbaz Youssefi @syoussefi" supported="vulkan" specialuse="glemulation">
+            <require>
+                <enum value="1"                                             name="VK_EXT_PRIMITIVE_TOPOLOGY_LIST_RESTART_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_primitive_topology_list_restart&quot;"           name="VK_EXT_PRIMITIVE_TOPOLOGY_LIST_RESTART_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT"/>
+                <type name="VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_extension_358" number="358" author="KHR" contact="Jeff Bolz @jeffbolznv" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_KHR_EXTENSION_358_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_extension_358&quot;"              name="VK_KHR_EXTENSION_358_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_359" number="359" author="EXT" contact="Bill Hollings @billhollings" supported="disabled" specialuse="glemulation">
+            <require>
+                <enum value="0"                                             name="VK_EXT_EXTENSION_359_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_359&quot;"              name="VK_EXT_EXTENSION_359_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_360" number="360" author="EXT" contact="Bill Hollings @billhollings" supported="disabled" specialuse="glemulation">
+            <require>
+                <enum value="0"                                             name="VK_EXT_EXTENSION_360_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_360&quot;"              name="VK_EXT_EXTENSION_360_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_format_feature_flags2" number="361" author="KHR" type="device" requires="VK_KHR_get_physical_device_properties2" contact="Lionel Landwerlin @llandwerlin" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_KHR_FORMAT_FEATURE_FLAGS_2_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_format_feature_flags2&quot;"      name="VK_KHR_FORMAT_FEATURE_FLAGS_2_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3_KHR"/>
+                <type                                                       name="VkFormatFeatureFlags2KHR"/>
+                <type                                                       name="VkFormatFeatureFlagBits2KHR"/>
+                <type                                                       name="VkFormatProperties3KHR"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_362" number="362" author="EXT" contact="Lionel Duc @nvlduc" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_EXT_EXTENSION_362_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_362&quot;"              name="VK_EXT_EXTENSION_362_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_363" number="363" author="EXT" contact="Kaye Mason @chaleur" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_EXT_EXTENSION_363_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_363&quot;"              name="VK_EXT_EXTENSION_363_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_FUCHSIA_extension_364" number="364" author="FUCHSIA" contact="Craig Stout @cdotstout" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_FUCHSIA_EXTENSION_364_SPEC_VERSION"/>
+                <enum value="&quot;VK_FUCHSIA_extension_364&quot;"          name="VK_FUCHSIA_EXTENSION_364_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_FUCHSIA_external_memory" number="365" type="device" requires="VK_KHR_external_memory_capabilities,VK_KHR_external_memory" author="FUCHSIA" contact="John Rosasco @rosasco" platform="fuchsia" supported="vulkan">
+            <require>
+                <enum value="1"                                                name="VK_FUCHSIA_EXTERNAL_MEMORY_SPEC_VERSION"/>
+                <enum value="&quot;VK_FUCHSIA_external_memory&quot;"           name="VK_FUCHSIA_EXTERNAL_MEMORY_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                     name="VK_STRUCTURE_TYPE_IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA"/>
+                <enum offset="1" extends="VkStructureType"                     name="VK_STRUCTURE_TYPE_MEMORY_ZIRCON_HANDLE_PROPERTIES_FUCHSIA"/>
+                <enum offset="2" extends="VkStructureType"                     name="VK_STRUCTURE_TYPE_MEMORY_GET_ZIRCON_HANDLE_INFO_FUCHSIA"/>
+                <enum bitpos="11" extends="VkExternalMemoryHandleTypeFlagBits" name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_ZIRCON_VMO_BIT_FUCHSIA"/>
+                <type name="VkImportMemoryZirconHandleInfoFUCHSIA"/>
+                <type name="VkMemoryZirconHandlePropertiesFUCHSIA"/>
+                <type name="VkMemoryGetZirconHandleInfoFUCHSIA"/>
+                <command name="vkGetMemoryZirconHandleFUCHSIA"/>
+                <command name="vkGetMemoryZirconHandlePropertiesFUCHSIA"/>
+            </require>
+        </extension>
+        <extension name="VK_FUCHSIA_external_semaphore" number="366" type="device" requires="VK_KHR_external_semaphore_capabilities,VK_KHR_external_semaphore" author="FUCHSIA" contact="John Rosasco @rosasco" platform="fuchsia" supported="vulkan">
+            <require>
+                <enum value="1"                                                name="VK_FUCHSIA_EXTERNAL_SEMAPHORE_SPEC_VERSION"/>
+                <enum value="&quot;VK_FUCHSIA_external_semaphore&quot;"        name="VK_FUCHSIA_EXTERNAL_SEMAPHORE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                     name="VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_ZIRCON_HANDLE_INFO_FUCHSIA"/>
+                <enum offset="1" extends="VkStructureType"                     name="VK_STRUCTURE_TYPE_SEMAPHORE_GET_ZIRCON_HANDLE_INFO_FUCHSIA"/>
+                <enum bitpos="7" extends="VkExternalSemaphoreHandleTypeFlagBits" name="VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_ZIRCON_EVENT_BIT_FUCHSIA"/>
+                <type name="VkImportSemaphoreZirconHandleInfoFUCHSIA"/>
+                <type name="VkSemaphoreGetZirconHandleInfoFUCHSIA"/>
+                <command name="vkImportSemaphoreZirconHandleFUCHSIA"/>
+                <command name="vkGetSemaphoreZirconHandleFUCHSIA"/>
+            </require>
+        </extension>
+        <extension name="VK_FUCHSIA_buffer_collection" number="367" type="device" requires="VK_FUCHSIA_external_memory,VK_KHR_sampler_ycbcr_conversion" author="FUCHSIA" contact="John Rosasco @rosasco" supported="vulkan" platform="fuchsia">
+            <require>
+                <enum value="2"                                         name="VK_FUCHSIA_BUFFER_COLLECTION_SPEC_VERSION"/>
+                <enum value="&quot;VK_FUCHSIA_buffer_collection&quot;"  name="VK_FUCHSIA_BUFFER_COLLECTION_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_BUFFER_COLLECTION_CREATE_INFO_FUCHSIA"/>
+                <enum offset="0" extends="VkObjectType"                 name="VK_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA" comment="VkBufferCollectionFUCHSIA"/>
+                <enum offset="0" extends="VkDebugReportObjectTypeEXT"   name="VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA_EXT"/>
+                <enum offset="1" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA"/>
+                <enum offset="2" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA"/>
+                <enum offset="3" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_BUFFER_COLLECTION_PROPERTIES_FUCHSIA"/>
+                <enum offset="4" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_BUFFER_CONSTRAINTS_INFO_FUCHSIA"/>
+                <enum offset="5" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA"/>
+                <enum offset="6" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_IMAGE_CONSTRAINTS_INFO_FUCHSIA"/>
+                <enum offset="7" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_IMAGE_FORMAT_CONSTRAINTS_INFO_FUCHSIA"/>
+                <enum offset="8" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_SYSMEM_COLOR_SPACE_FUCHSIA"/>
+                <enum offset="9" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_BUFFER_COLLECTION_CONSTRAINTS_INFO_FUCHSIA"/>
+                <type name="VkBufferCollectionFUCHSIA"/>
+                <type name="VkBufferCollectionCreateInfoFUCHSIA"/>
+                <type name="VkImportMemoryBufferCollectionFUCHSIA"/>
+                <type name="VkBufferCollectionImageCreateInfoFUCHSIA"/>
+                <type name="VkBufferConstraintsInfoFUCHSIA"/>
+                <type name="VkBufferCollectionBufferCreateInfoFUCHSIA"/>
+                <type name="VkBufferCollectionPropertiesFUCHSIA"/>
+                <type name="VkImageFormatConstraintsFlagsFUCHSIA" comment="Will add VkImageFormatConstraintsFlagBitsFUCHSIA when bits are defined in the future"/>
+                <type name="VkSysmemColorSpaceFUCHSIA"/>
+                <type name="VkImageConstraintsInfoFlagBitsFUCHSIA"/>
+                <type name="VkImageConstraintsInfoFlagsFUCHSIA"/>
+                <type name="VkImageConstraintsInfoFUCHSIA"/>
+                <type name="VkImageFormatConstraintsInfoFUCHSIA"/>
+                <type name="VkBufferCollectionConstraintsInfoFUCHSIA"/>
+                <command name="vkCreateBufferCollectionFUCHSIA"/>
+                <command name="vkSetBufferCollectionImageConstraintsFUCHSIA"/>
+                <command name="vkSetBufferCollectionBufferConstraintsFUCHSIA"/>
+                <command name="vkDestroyBufferCollectionFUCHSIA"/>
+                <command name="vkGetBufferCollectionPropertiesFUCHSIA"/>
+            </require>
+        </extension>
+        <extension name="VK_FUCHSIA_extension_368" number="368" author="FUCHSIA" contact="Craig Stout @cdotstout" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_FUCHSIA_EXTENSION_368_SPEC_VERSION"/>
+                <enum value="&quot;VK_FUCHSIA_extension_368&quot;"          name="VK_FUCHSIA_EXTENSION_368_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_QCOM_extension_369" number="369" author="QCOM" contact="Matthew Netsch @mnetsch" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_QCOM_EXTENSION_369_SPEC_VERSION"/>
+                <enum value="&quot;VK_QCOM_extension_369&quot;"         name="VK_QCOM_EXTENSION_369_EXTENSION_NAME"/>
+                <enum bitpos="4" extends="VkDescriptorBindingFlagBits"  name="VK_DESCRIPTOR_BINDING_RESERVED_4_BIT_QCOM"/>
+            </require>
+        </extension>
+        <extension name="VK_HUAWEI_subpass_shading" number="370" type="device" author="HUAWEI" contact="Hueilong Wang @wyvernathuawei" requires="VK_KHR_create_renderpass2,VK_KHR_synchronization2" supported="vulkan">
+            <require>
+                <enum value="2"                                         name="VK_HUAWEI_SUBPASS_SHADING_SPEC_VERSION"/>
+                <enum value="&quot;VK_HUAWEI_subpass_shading&quot;"         name="VK_HUAWEI_SUBPASS_SHADING_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI"/>
+                <enum offset="2" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI"/>
+                <enum offset="3" extends="VkPipelineBindPoint" extnumber="370" name="VK_PIPELINE_BIND_POINT_SUBPASS_SHADING_HUAWEI"/>
+                <enum bitpos="39" extends="VkPipelineStageFlagBits2KHR"     name="VK_PIPELINE_STAGE_2_SUBPASS_SHADING_BIT_HUAWEI"/>
+                <enum bitpos="14" extends="VkShaderStageFlagBits"           name="VK_SHADER_STAGE_SUBPASS_SHADING_BIT_HUAWEI"/>
+                <type name="VkSubpassShadingPipelineCreateInfoHUAWEI"/>
+                <type name="VkPhysicalDeviceSubpassShadingFeaturesHUAWEI"/>
+                <type name="VkPhysicalDeviceSubpassShadingPropertiesHUAWEI"/>
+                <command name="vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI"/>
+                <command name="vkCmdSubpassShadingHUAWEI"/>
+            </require>
+        </extension>
+        <extension name="VK_HUAWEI_invocation_mask" number="371" type="device" requires="VK_KHR_ray_tracing_pipeline,VK_KHR_synchronization2" author="Huawei" contact="Yunpeng Zhu @yunxingzhu" supported="vulkan">
+            <require>
+                <enum value="1"                                              name="VK_HUAWEI_INVOCATION_MASK_SPEC_VERSION"/>
+                <enum value="&quot;VK_HUAWEI_invocation_mask&quot;"        name="VK_HUAWEI_INVOCATION_MASK_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                   name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI"/>
+                <enum bitpos="39" extends="VkAccessFlagBits2KHR"             name="VK_ACCESS_2_INVOCATION_MASK_READ_BIT_HUAWEI"/>
+                <enum bitpos="18" extends="VkImageUsageFlagBits"             name="VK_IMAGE_USAGE_INVOCATION_MASK_BIT_HUAWEI"/>
+                <enum bitpos="40" extends="VkPipelineStageFlagBits2KHR"      name="VK_PIPELINE_STAGE_2_INVOCATION_MASK_BIT_HUAWEI"/>
+                <type name="VkPhysicalDeviceInvocationMaskFeaturesHUAWEI"/>
+                <command name="vkCmdBindInvocationMaskHUAWEI"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_external_memory_rdma" number="372" type="device" requires="VK_KHR_external_memory" author="NV" contact="Carsten Rohde @crohde" supported="vulkan">
+            <require>
+                <enum value="1"                                                 name="VK_NV_EXTERNAL_MEMORY_RDMA_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_external_memory_rdma&quot;"            name="VK_NV_EXTERNAL_MEMORY_RDMA_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_MEMORY_GET_REMOTE_ADDRESS_INFO_NV"/>
+                <enum offset="1" extends="VkStructureType"                      name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_RDMA_FEATURES_NV"/>
+                <enum bitpos="8" extends="VkMemoryPropertyFlagBits"             name="VK_MEMORY_PROPERTY_RDMA_CAPABLE_BIT_NV"/>
+                <enum bitpos="12" extends="VkExternalMemoryHandleTypeFlagBits"  name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_RDMA_ADDRESS_BIT_NV"/>
+                <type name="VkRemoteAddressNV"/>
+                <type name="VkMemoryGetRemoteAddressInfoNV"/>
+                <type name="VkPhysicalDeviceExternalMemoryRDMAFeaturesNV"/>
+                <command name="vkGetMemoryRemoteAddressNV"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_extension_373" number="373" author="NV" contact="Daniel Koch @dgkoch" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_NV_EXTENSION_373_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_extension_373&quot;"           name="VK_NV_EXTENSION_373_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_extension_374" number="374" author="NV" contact="Daniel Koch @dgkoch" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_NV_EXTENSION_374_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_extension_374&quot;"           name="VK_NV_EXTENSION_374_EXTENSION_NAME"/>
+                <enum bitpos="4" extends="VkExternalFenceHandleTypeFlagBits" name="VK_EXTERNAL_FENCE_HANDLE_TYPE_RESERVED_4_BIT_NV"/>
+                <enum bitpos="5" extends="VkExternalFenceHandleTypeFlagBits" name="VK_EXTERNAL_FENCE_HANDLE_TYPE_RESERVED_5_BIT_NV"/>
+                <enum bitpos="5" extends="VkExternalSemaphoreHandleTypeFlagBits" name="VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_RESERVED_5_BIT_NV"/>
+                <enum bitpos="6" extends="VkExternalSemaphoreHandleTypeFlagBits" name="VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_RESERVED_6_BIT_NV"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_extension_375" number="375" author="NV" contact="Daniel Koch @dgkoch" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_NV_EXTENSION_375_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_extension_375&quot;"           name="VK_NV_EXTENSION_375_EXTENSION_NAME"/>
+                <enum bitpos="13" extends="VkExternalMemoryHandleTypeFlagBits"  name="VK_EXTERNAL_MEMORY_HANDLE_TYPE_RESERVED_13_BIT_NV"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_376" number="376" author="EXT" contact="Shahbaz Youssefi @syoussefi" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_EXT_EXTENSION_376_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_376&quot;"          name="VK_EXT_EXTENSION_376_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_377" number="377" author="EXT" contact="Hugues Evrard @hevrard" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_EXT_EXTENSION_377_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_377&quot;"          name="VK_EXT_EXTENSION_377_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extended_dynamic_state2" number="378" type="device" requires="VK_KHR_get_physical_device_properties2" author="EXT" contact="Vikram Kushwaha @vkushwaha-nv" supported="vulkan">
+            <require>
+                <enum value="1"                                             name="VK_EXT_EXTENDED_DYNAMIC_STATE_2_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extended_dynamic_state2&quot;"     name="VK_EXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT"/>
+                <enum offset="0" extends="VkDynamicState"                   name="VK_DYNAMIC_STATE_PATCH_CONTROL_POINTS_EXT"/>
+                <enum offset="1" extends="VkDynamicState"                   name="VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE_EXT"/>
+                <enum offset="2" extends="VkDynamicState"                   name="VK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE_EXT"/>
+                <enum offset="3" extends="VkDynamicState"                   name="VK_DYNAMIC_STATE_LOGIC_OP_EXT"/>
+                <enum offset="4" extends="VkDynamicState"                   name="VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE_EXT"/>
+                <type name="VkPhysicalDeviceExtendedDynamicState2FeaturesEXT"/>
+                <command name="vkCmdSetPatchControlPointsEXT"/>
+                <command name="vkCmdSetRasterizerDiscardEnableEXT"/>
+                <command name="vkCmdSetDepthBiasEnableEXT"/>
+                <command name="vkCmdSetLogicOpEXT"/>
+                <command name="vkCmdSetPrimitiveRestartEnableEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_QNX_screen_surface" number="379" type="instance" requires="VK_KHR_surface" platform="screen" author="QNX" contact="Mike Gorchak @mgorchak-blackberry" supported="vulkan">
+            <require>
+                <enum value="1"                                         name="VK_QNX_SCREEN_SURFACE_SPEC_VERSION"/>
+                <enum value="&quot;VK_QNX_screen_surface&quot;"         name="VK_QNX_SCREEN_SURFACE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_SCREEN_SURFACE_CREATE_INFO_QNX"/>
+                <type name="VkScreenSurfaceCreateFlagsQNX"/>
+                <type name="VkScreenSurfaceCreateInfoQNX"/>
+                <command name="vkCreateScreenSurfaceQNX"/>
+                <command name="vkGetPhysicalDeviceScreenPresentationSupportQNX"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_extension_380" number="380" author="KHR" contact="James Jones @cubanismo" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_KHR_EXTENSION_380_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_extension_380&quot;"          name="VK_KHR_EXTENSION_380_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_extension_381" number="381" author="KHR" contact="James Jones @cubanismo" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_KHR_EXTENSION_381_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_extension_381&quot;"          name="VK_KHR_EXTENSION_381_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_color_write_enable" number="382" type="device" requires="VK_KHR_get_physical_device_properties2" author="EXT" contact="Sharif Elcott @selcott" supported="vulkan">
+            <require>
+                <enum value="1"                                         name="VK_EXT_COLOR_WRITE_ENABLE_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_color_write_enable&quot;"     name="VK_EXT_COLOR_WRITE_ENABLE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT"/>
+                <enum offset="1" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT"/>
+                <enum offset="0" extends="VkDynamicState"               name="VK_DYNAMIC_STATE_COLOR_WRITE_ENABLE_EXT"/>
+                <type name="VkPhysicalDeviceColorWriteEnableFeaturesEXT"/>
+                <type name="VkPipelineColorWriteCreateInfoEXT"/>
+                <command name="vkCmdSetColorWriteEnableEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_383" number="383" author="EXT" contact="Shahbaz Youssefi @syoussefi" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_EXT_EXTENSION_383_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_383&quot;"          name="VK_EXT_EXTENSION_383_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_384" number="384" type="instance" author="EXT" contact="Chia-I Wu @olvaffe1" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_EXT_EXTENSION_384_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_384&quot;"          name="VK_EXT_EXTENSION_384_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_MESA_extension_385" number="385" type="instance" author="MESA" contact="Chia-I Wu @olvaffe1" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_MESA_EXTENSION_385_SPEC_VERSION"/>
+                <enum value="&quot;VK_MESA_extension_385&quot;"         name="VK_MESA_EXTENSION_385_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_GOOGLE_extension_386" number="386" author="GOOGLE" contact="Chia-I Wu @olvaffe1" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_GOOGLE_EXTENSION_386_SPEC_VERSION"/>
+                <enum value="&quot;VK_GOOGLE_extension_386&quot;"       name="VK_GOOGLE_EXTENSION_386_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_extension_387" number="387" author="KHR" contact="Daniel Koch @dgkoch" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_KHR_EXTENSION_387_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_extension_387&quot;"              name="VK_KHR_EXTENSION_387_EXTENSION_NAME"/>
+                <enum bitpos="28" extends="VkPipelineStageFlagBits2KHR"     name="VK_PIPELINE_STAGE_2_RESERVED_387_BIT_KHR"/>
+                <enum bitpos="40" extends="VkAccessFlagBits2KHR"            name="VK_ACCESS_2_RESERVED_387_BIT_KHR"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_388" number="388" author="EXT" contact="Alan Baker @alan-baker" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_EXT_EXTENSION_388_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_388&quot;"              name="VK_EXT_EXTENSION_388_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_global_priority_query" number="389" type="device" requires="VK_EXT_global_priority,VK_KHR_get_physical_device_properties2" author="EXT" contact="Yiwei Zhang @zhangyiwei" supported="vulkan">
+            <require>
+                <enum value="1"                                         name="VK_EXT_GLOBAL_PRIORITY_QUERY_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_global_priority_query&quot;"  name="VK_EXT_GLOBAL_PRIORITY_QUERY_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_EXT"/>
+                <enum offset="1" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_EXT"/>
+                <enum                                                   name="VK_MAX_GLOBAL_PRIORITY_SIZE_EXT"/>
+                <type                                                   name="VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT"/>
+                <type                                                   name="VkQueueFamilyGlobalPriorityPropertiesEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_390" number="390" author="EXT" contact="Joshua Ashton @Joshua-Ashton" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_EXT_EXTENSION_390_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_390&quot;"              name="VK_EXT_EXTENSION_390_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_391" number="391" author="EXT" contact="Joshua Ashton @Joshua-Ashton" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_EXT_EXTENSION_391_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_391&quot;"              name="VK_EXT_EXTENSION_391_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_392" number="392" author="EXT" contact="Joshua Ashton @Joshua-Ashton" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_EXT_EXTENSION_392_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_392&quot;"              name="VK_EXT_EXTENSION_392_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_multi_draw" number="393" author="EXT" contact="Mike Blumenkrantz @zmike" type="device" supported="vulkan">
+            <require>
+                <enum value="1"                                         name="VK_EXT_MULTI_DRAW_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_multi_draw&quot;"             name="VK_EXT_MULTI_DRAW_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                 name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT"/>
+                <enum offset="1" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT"/>
+                <type name="VkPhysicalDeviceMultiDrawFeaturesEXT"/>
+                <type name="VkPhysicalDeviceMultiDrawPropertiesEXT"/>
+                <command name="vkCmdDrawMultiEXT"/>
+                <command name="vkCmdDrawMultiIndexedEXT"/>
+                <type name="VkMultiDrawInfoEXT"/>
+                <type name="VkMultiDrawIndexedInfoEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_394" number="394" author="EXT" contact="Mike Blumenkrantz @zmike" type="device" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_EXT_EXTENSION_394_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_394&quot;"              name="VK_EXT_EXTENSION_394_EXTENSION_NAME"/>
+                <enum extends="VkImageCreateFlagBits" bitpos="17" name="VK_IMAGE_CREATE_RESERVED_394_BIT_EXT"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_extension_395" number="395" author="KHR" contact="Lenny Komow @lkomow" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_KHR_EXTENSION_395_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_extension_395&quot;"              name="VK_KHR_EXTENSION_395_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_extension_396" number="396" author="EXT" contact="Jan-Harald Fredriksen @janharaldfredriksen-arm" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_KHR_EXTENSION_396_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_extension_396&quot;"              name="VK_KHR_EXTENSION_396_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_extension_397" number="397" author="NV" contact="Christoph Kubisch @pixeljetstream" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_NV_EXTENSION_397_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_extension_397&quot;"           name="VK_NV_EXTENSION_397_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_extension_398" number="398" author="NV" contact="Christoph Kubisch @pixeljetstream" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_NV_EXTENSION_398_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_extension_398&quot;"           name="VK_NV_EXTENSION_398_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_JUICE_extension_399" number="399" author="JUICE" contact="Dean Beeler @canadacow" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_JUICE_EXTENSION_399_SPEC_VERSION"/>
+                <enum value="&quot;VK_JUICE_extension_399&quot;"        name="VK_JUICE_EXTENSION_399_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_JUICE_extension_400" number="400" author="JUICE" contact="David McCloskey @damcclos" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_JUICE_EXTENSION_400_SPEC_VERSION"/>
+                <enum value="&quot;VK_JUICE_extension_400&quot;"        name="VK_JUICE_EXTENSION_400_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_load_store_op_none" number="401" author="EXT" type="device" contact="Shahbaz Youssefi @syoussefi" supported="vulkan">
+            <require>
+                <enum value="1"                                         name="VK_EXT_LOAD_STORE_OP_NONE_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_load_store_op_none&quot;"          name="VK_EXT_LOAD_STORE_OP_NONE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkAttachmentLoadOp" name="VK_ATTACHMENT_LOAD_OP_NONE_EXT"/>
+                <enum extends="VkAttachmentStoreOp" name="VK_ATTACHMENT_STORE_OP_NONE_EXT" alias="VK_ATTACHMENT_STORE_OP_NONE_KHR"/>
+            </require>
+        </extension>
+        <extension name="VK_FB_extension_402" number="402" author="FB" contact="Artem Bolgar @artyom17" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_FB_EXTENSION_402_SPEC_VERSION"/>
+                <enum value="&quot;VK_FB_extension_402&quot;"           name="VK_FB_EXTENSION_402_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_FB_extension_403" number="403" author="FB" contact="Artem Bolgar @artyom17" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_FB_EXTENSION_403_SPEC_VERSION"/>
+                <enum value="&quot;VK_FB_extension_403&quot;"           name="VK_FB_EXTENSION_403_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_FB_extension_404" number="404" author="FB" contact="Artem Bolgar @artyom17" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_FB_EXTENSION_404_SPEC_VERSION"/>
+                <enum value="&quot;VK_FB_extension_404&quot;"           name="VK_FB_EXTENSION_404_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_HUAWEI_extension_405" number="405" author="HUAWEI" contact="Hueilong Wang @wyvernathuawei" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_HUAWEI_EXTENSION_405_SPEC_VERSION"/>
+                <enum value="&quot;VK_HUAWEI_extension_405&quot;"           name="VK_HUAWEI_EXTENSION_405_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_HUAWEI_extension_406" number="406" author="HUAWEI" contact="Hueilong Wang @wyvernathuawei" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_HUAWEI_EXTENSION_406_SPEC_VERSION"/>
+                <enum value="&quot;VK_HUAWEI_extension_406&quot;"           name="VK_HUAWEI_EXTENSION_406_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_GGP_extension_407" number="407" author="GGP" contact="J.D. Rouan @jdrouan" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_GGP_EXTENSION_407_SPEC_VERSION"/>
+                <enum value="&quot;VK_GGP_extension_407&quot;"          name="VK_GGP_EXTENSION_407_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_GGP_extension_408" number="408" author="GGP" contact="J.D. Rouan @jdrouan" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_GGP_EXTENSION_408_SPEC_VERSION"/>
+                <enum value="&quot;VK_GGP_extension_408&quot;"          name="VK_GGP_EXTENSION_408_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_GGP_extension_409" number="409" author="GGP" contact="J.D. Rouan @jdrouan" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_GGP_EXTENSION_409_SPEC_VERSION"/>
+                <enum value="&quot;VK_GGP_extension_409&quot;"          name="VK_GGP_EXTENSION_409_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_GGP_extension_410" number="410" author="GGP" contact="J.D. Rouan @jdrouan" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_GGP_EXTENSION_410_SPEC_VERSION"/>
+                <enum value="&quot;VK_GGP_extension_410&quot;"          name="VK_GGP_EXTENSION_410_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_GGP_extension_411" number="411" author="GGP" contact="J.D. Rouan @jdrouan" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_GGP_EXTENSION_411_SPEC_VERSION"/>
+                <enum value="&quot;VK_GGP_extension_411&quot;"          name="VK_GGP_EXTENSION_411_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_border_color_swizzle" number="412" type="device" author="EXT" contact="Piers Daniell @pdaniell-nv" supported="vulkan" requires="VK_EXT_custom_border_color" specialuse="glemulation,d3demulation">
+            <require>
+                <enum value="1"                                         name="VK_EXT_BORDER_COLOR_SWIZZLE_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_border_color_swizzle&quot;"   name="VK_EXT_BORDER_COLOR_SWIZZLE_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT"/>
+                <enum offset="1" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT"/>
+                <type name="VkPhysicalDeviceBorderColorSwizzleFeaturesEXT"/>
+                <type name="VkSamplerBorderColorComponentMappingCreateInfoEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_pageable_device_local_memory" number="413" author="EXT" contact="Piers Daniell @pdaniell-nv" type="device" requires="VK_EXT_memory_priority" supported="vulkan">
+            <require>
+                <enum value="1"                                                  name="VK_EXT_PAGEABLE_DEVICE_LOCAL_MEMORY_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_pageable_device_local_memory&quot;"    name="VK_EXT_PAGEABLE_DEVICE_LOCAL_MEMORY_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                       name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT"/>
+                <type                                                            name="VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT"/>
+                <command                                                         name="vkSetDeviceMemoryPriorityEXT"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_maintenance4" number="414" type="device" requiresCore="1.1" author="KHR" contact="Piers Daniell @pdaniell-nv" supported="vulkan">
+            <require>
+                <enum value="1"                                               name="VK_KHR_MAINTENANCE_4_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_maintenance4&quot;"                 name="VK_KHR_MAINTENANCE_4_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                    name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES_KHR"/>
+                <enum offset="1" extends="VkStructureType"                    name="VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES_KHR"/>
+                <enum offset="2" extends="VkStructureType"                    name="VK_STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS_KHR"/>
+                <enum offset="3" extends="VkStructureType"                    name="VK_STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS_KHR"/>
+                <type name="VkPhysicalDeviceMaintenance4FeaturesKHR"/>
+                <type name="VkPhysicalDeviceMaintenance4PropertiesKHR"/>
+                <type name="VkDeviceBufferMemoryRequirementsKHR"/>
+                <type name="VkDeviceImageMemoryRequirementsKHR"/>
+                <command name="vkGetDeviceBufferMemoryRequirementsKHR"/>
+                <command name="vkGetDeviceImageMemoryRequirementsKHR"/>
+                <command name="vkGetDeviceImageSparseMemoryRequirementsKHR"/>
+            </require>
+        </extension>
+        <extension name="VK_HUAWEI_extension_415" number="415" author="HUAWEI" contact="Hueilong Wang @wyvernathuawei" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_HUAWEI_EXTENSION_415_SPEC_VERSION"/>
+                <enum value="&quot;VK_HUAWEI_extension_415&quot;"         name="VK_HUAWEI_EXTENSION_415_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_ARM_extension_416" number="416" author="ARM" contact="Jan-Harald Fredriksen @janharaldfredriksen-arm" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_ARM_EXTENSION_416_SPEC_VERSION"/>
+                <enum value="&quot;VK_ARM_extension_416&quot;"          name="VK_ARM_EXTENSION_416_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_extension_417" number="417" author="KHR" contact="Kevin Petit @kevinpetit" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_KHR_EXTENSION_417_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_extension_417&quot;"          name="VK_KHR_EXTENSION_417_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_ARM_extension_418" number="418" author="ARM" contact="Kevin Petit @kevinpetit" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_ARM_EXTENSION_418_SPEC_VERSION"/>
+                <enum value="&quot;VK_ARM_extension_418&quot;"          name="VK_ARM_EXTENSION_418_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_419" number="419" author="EXT" contact="Mike Blumenkrantz @zmike" type="device" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_EXT_EXTENSION_419_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_419&quot;"              name="VK_EXT_EXTENSION_419_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_420" number="420" author="EXT" contact="Mike Blumenkrantz @zmike" type="device" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_EXT_EXTENSION_420_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_420&quot;"              name="VK_EXT_EXTENSION_420_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_KHR_extension_421" number="421" author="KHR" contact="Hans-Kristian Arntzen @HansKristian-Work" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_KHR_EXTENSION_421_SPEC_VERSION"/>
+                <enum value="&quot;VK_KHR_extension_421&quot;"              name="VK_KHR_EXTENSION_421_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_extension_422" number="422" author="EXT" contact="Graeme Leese @gnl21" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_EXT_EXTENSION_422_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_extension_422&quot;"              name="VK_EXT_EXTENSION_422_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_EXT_disable_cube_map_wrap" number="423" author="EXT" contact="Georg Lehmann @DadSchoorse" supported="disabled">
+            <require>
+                <enum value="0"                                             name="VK_EXT_DISABLE_CUBE_MAP_WRAP_SPEC_VERSION"/>
+                <enum value="&quot;VK_EXT_disable_cube_map_wrap&quot;"      name="VK_EXT_DISABLE_CUBE_MAP_WRAP_EXTENSION_NAME"/>
+                <enum bitpos="2"  extends="VkSamplerCreateFlagBits"         name="VK_SAMPLER_CREATE_RESERVED_2_BIT_EXT"/>
+            </require>
+        </extension>
+        <extension name="VK_ARM_extension_424" number="424" author="ARM" contact="Jan-Harald Fredriksen @janharaldfredriksen-arm" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_ARM_EXTENSION_424_SPEC_VERSION"/>
+                <enum value="&quot;VK_ARM_extension_424&quot;"          name="VK_ARM_EXTENSION_424_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_ARM_extension_425" number="425" author="ARM" contact="Jan-Harald Fredriksen @janharaldfredriksen-arm" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_ARM_EXTENSION_425_SPEC_VERSION"/>
+                <enum value="&quot;VK_ARM_extension_425&quot;"          name="VK_ARM_EXTENSION_425_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_QCOM_extension_426" number="426" author="QCOM" contact="Matthew Netsch @mnetsch" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_QCOM_EXTENSION_426_SPEC_VERSION"/>
+                <enum value="&quot;VK_QCOM_extension_426&quot;"         name="VK_QCOM_EXTENSION_426_EXTENSION_NAME"/>
+                <enum bitpos="15" extends="VkImageCreateFlagBits"       name="VK_IMAGE_CREATE_RESERVED_426_BIT_QCOM"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_extension_427" number="427" author="NV" contact="Vikram Kushwaha @vkushwaha-nv" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_NV_EXTENSION_427_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_extension_427&quot;"           name="VK_NV_EXTENSION_427_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_extension_428" number="428" author="NV" contact="Vikram Kushwaha @vkushwaha-nv" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_NV_EXTENSION_428_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_extension_428&quot;"           name="VK_NV_EXTENSION_428_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_extension_429" number="429" author="NV" contact="Vikram Kushwaha @vkushwaha-nv" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_NV_EXTENSION_429_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_extension_429&quot;"           name="VK_NV_EXTENSION_429_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_extension_430" number="430" author="NV" contact="Vikram Kushwaha @vkushwaha-nv" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_NV_EXTENSION_430_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_extension_430&quot;"           name="VK_NV_EXTENSION_430_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_extension_431" number="431" author="NV" contact="Sourav Parmar @souravpNV" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_NV_EXTENSION_431_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_extension_431&quot;"           name="VK_NV_EXTENSION_431_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_extension_432" number="432" author="NV" contact="Sourav Parmar @souravpNV" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_NV_EXTENSION_432_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_extension_432&quot;"           name="VK_NV_EXTENSION_432_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_NV_extension_433" number="433" author="NV" contact="Sourav Parmar @souravpNV" supported="disabled">
+            <require>
+                <enum value="0"                                         name="VK_NV_EXTENSION_433_SPEC_VERSION"/>
+                <enum value="&quot;VK_NV_extension_433&quot;"           name="VK_NV_EXTENSION_433_EXTENSION_NAME"/>
+            </require>
+        </extension>
+        <extension name="VK_GOOGLE_gfxstream" number="386" author="GOOGLE" contact="Lingfeng Yang @frank,Roman Kiryanov @rkir,Yilong Li @liyl_google" supported="vulkan">
+            <require>
+                <enum value="0"                                             name="VK_GOOGLE_GFXSTREAM_SPEC_VERSION"/>
+                <enum value="386"                                           name="VK_GOOGLE_GFXSTREAM_NUMBER"/>
+                <enum value="&quot;VK_GOOGLE_gfxstream&quot;"               name="VK_GOOGLE_GFXSTREAM_EXTENSION_NAME"/>
+                <enum offset="0" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_IMPORT_COLOR_BUFFER_GOOGLE"/>
+                <enum offset="1" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_IMPORT_PHYSICAL_ADDRESS_GOOGLE"/>
+                <enum offset="2" extends="VkStructureType"                  name="VK_STRUCTURE_TYPE_IMPORT_BUFFER_HANDLE_GOOGLE"/>
+                <type name="VkImportColorBufferGOOGLE"/>
+                <type name="VkImportBufferGOOGLE"/>
+                <type name="VkImportPhysicalAddressGOOGLE"/>
+                <command name="vkRegisterImageColorBufferGOOGLE"/>
+                <command name="vkRegisterBufferColorBufferGOOGLE"/>
+                <command name="vkMapMemoryIntoAddressSpaceGOOGLE"/>
+                <command name="vkUpdateDescriptorSetWithTemplateSizedGOOGLE"/>
+                <command name="vkBeginCommandBufferAsyncGOOGLE"/>
+                <command name="vkEndCommandBufferAsyncGOOGLE"/>
+                <command name="vkResetCommandBufferAsyncGOOGLE"/>
+                <command name="vkCommandBufferHostSyncGOOGLE"/>
+                <command name="vkCreateImageWithRequirementsGOOGLE"/>
+                <command name="vkCreateBufferWithRequirementsGOOGLE"/>
+                <command name="vkGetMemoryHostAddressInfoGOOGLE"/>
+                <command name="vkFreeMemorySyncGOOGLE"/>
+                <command name="vkQueueHostSyncGOOGLE"/>
+                <command name="vkQueueSubmitAsyncGOOGLE"/>
+                <command name="vkQueueWaitIdleAsyncGOOGLE"/>
+                <command name="vkQueueBindSparseAsyncGOOGLE"/>
+                <command name="vkGetLinearImageLayoutGOOGLE"/>
+                <command name="vkQueueFlushCommandsGOOGLE"/>
+                <command name="vkQueueCommitDescriptorSetUpdatesGOOGLE"/>
+                <command name="vkCollectDescriptorPoolIdsGOOGLE"/>
+                <command name="vkQueueSignalReleaseImageANDROIDAsyncGOOGLE"/>
+            </require>
+        </extension>
+    </extensions>
+    <spirvextensions comment="SPIR-V Extensions allowed in Vulkan and what is required to use it">
+        <spirvextension name="SPV_KHR_variable_pointers">
+            <enable version="VK_API_VERSION_1_1"/>
+            <enable extension="VK_KHR_variable_pointers"/>
+        </spirvextension>
+        <spirvextension name="SPV_AMD_shader_explicit_vertex_parameter">
+            <enable extension="VK_AMD_shader_explicit_vertex_parameter"/>
+        </spirvextension>
+        <spirvextension name="SPV_AMD_gcn_shader">
+            <enable extension="VK_AMD_gcn_shader"/>
+        </spirvextension>
+        <spirvextension name="SPV_AMD_gpu_shader_half_float">
+            <enable extension="VK_AMD_gpu_shader_half_float"/>
+        </spirvextension>
+        <spirvextension name="SPV_AMD_gpu_shader_int16">
+            <enable extension="VK_AMD_gpu_shader_int16"/>
+        </spirvextension>
+        <spirvextension name="SPV_AMD_shader_ballot">
+            <enable extension="VK_AMD_shader_ballot"/>
+        </spirvextension>
+        <spirvextension name="SPV_AMD_shader_fragment_mask">
+            <enable extension="VK_AMD_shader_fragment_mask"/>
+        </spirvextension>
+        <spirvextension name="SPV_AMD_shader_image_load_store_lod">
+            <enable extension="VK_AMD_shader_image_load_store_lod"/>
+        </spirvextension>
+        <spirvextension name="SPV_AMD_shader_trinary_minmax">
+            <enable extension="VK_AMD_shader_trinary_minmax"/>
+        </spirvextension>
+        <spirvextension name="SPV_AMD_texture_gather_bias_lod">
+            <enable extension="VK_AMD_texture_gather_bias_lod"/>
+        </spirvextension>
+        <spirvextension name="SPV_KHR_shader_draw_parameters">
+            <enable version="VK_API_VERSION_1_1"/>
+            <enable extension="VK_KHR_shader_draw_parameters"/>
+        </spirvextension>
+        <spirvextension name="SPV_KHR_8bit_storage">
+            <enable version="VK_API_VERSION_1_2"/>
+            <enable extension="VK_KHR_8bit_storage"/>
+        </spirvextension>
+        <spirvextension name="SPV_KHR_16bit_storage">
+            <enable version="VK_API_VERSION_1_1"/>
+            <enable extension="VK_KHR_16bit_storage"/>
+        </spirvextension>
+        <spirvextension name="SPV_KHR_shader_clock">
+            <enable extension="VK_KHR_shader_clock"/>
+        </spirvextension>
+        <spirvextension name="SPV_KHR_float_controls">
+            <enable version="VK_API_VERSION_1_2"/>
+            <enable extension="VK_KHR_shader_float_controls"/>
+        </spirvextension>
+        <spirvextension name="SPV_KHR_storage_buffer_storage_class">
+            <enable version="VK_API_VERSION_1_1"/>
+            <enable extension="VK_KHR_storage_buffer_storage_class"/>
+        </spirvextension>
+        <spirvextension name="SPV_KHR_post_depth_coverage">
+            <enable extension="VK_EXT_post_depth_coverage"/>
+        </spirvextension>
+        <spirvextension name="SPV_EXT_shader_stencil_export">
+            <enable extension="VK_EXT_shader_stencil_export"/>
+        </spirvextension>
+        <spirvextension name="SPV_KHR_shader_ballot">
+            <enable extension="VK_EXT_shader_subgroup_ballot"/>
+        </spirvextension>
+        <spirvextension name="SPV_KHR_subgroup_vote">
+            <enable extension="VK_EXT_shader_subgroup_vote"/>
+        </spirvextension>
+        <spirvextension name="SPV_NV_sample_mask_override_coverage">
+            <enable extension="VK_NV_sample_mask_override_coverage"/>
+        </spirvextension>
+        <spirvextension name="SPV_NV_geometry_shader_passthrough">
+            <enable extension="VK_NV_geometry_shader_passthrough"/>
+        </spirvextension>
+        <spirvextension name="SPV_NV_mesh_shader">
+            <enable extension="VK_NV_mesh_shader"/>
+        </spirvextension>
+        <spirvextension name="SPV_NV_viewport_array2">
+            <enable extension="VK_NV_viewport_array2"/>
+        </spirvextension>
+        <spirvextension name="SPV_NV_shader_subgroup_partitioned">
+            <enable extension="VK_NV_shader_subgroup_partitioned"/>
+        </spirvextension>
+        <spirvextension name="SPV_EXT_shader_viewport_index_layer">
+            <enable version="VK_API_VERSION_1_2"/>
+            <enable extension="VK_EXT_shader_viewport_index_layer"/>
+        </spirvextension>
+        <spirvextension name="SPV_NVX_multiview_per_view_attributes">
+            <enable extension="VK_NVX_multiview_per_view_attributes"/>
+        </spirvextension>
+        <spirvextension name="SPV_EXT_descriptor_indexing">
+            <enable version="VK_API_VERSION_1_2"/>
+            <enable extension="VK_EXT_descriptor_indexing"/>
+        </spirvextension>
+        <spirvextension name="SPV_KHR_vulkan_memory_model">
+            <enable version="VK_API_VERSION_1_2"/>
+            <enable extension="VK_KHR_vulkan_memory_model"/>
+        </spirvextension>
+        <spirvextension name="SPV_NV_compute_shader_derivatives">
+            <enable extension="VK_NV_compute_shader_derivatives"/>
+        </spirvextension>
+        <spirvextension name="SPV_NV_fragment_shader_barycentric">
+            <enable extension="VK_NV_fragment_shader_barycentric"/>
+        </spirvextension>
+        <spirvextension name="SPV_NV_shader_image_footprint">
+            <enable extension="VK_NV_shader_image_footprint"/>
+        </spirvextension>
+        <spirvextension name="SPV_NV_shading_rate">
+            <enable extension="VK_NV_shading_rate_image"/>
+        </spirvextension>
+        <spirvextension name="SPV_NV_ray_tracing">
+            <enable extension="VK_NV_ray_tracing"/>
+        </spirvextension>
+        <spirvextension name="SPV_KHR_ray_tracing">
+            <enable extension="VK_KHR_ray_tracing_pipeline"/>
+        </spirvextension>
+        <spirvextension name="SPV_KHR_ray_query">
+            <enable extension="VK_KHR_ray_query"/>
+        </spirvextension>
+        <spirvextension name="SPV_GOOGLE_hlsl_functionality1">
+            <enable extension="VK_GOOGLE_hlsl_functionality1"/>
+        </spirvextension>
+        <spirvextension name="SPV_GOOGLE_user_type">
+            <enable extension="VK_GOOGLE_user_type"/>
+        </spirvextension>
+        <spirvextension name="SPV_GOOGLE_decorate_string">
+            <enable extension="VK_GOOGLE_decorate_string"/>
+        </spirvextension>
+        <spirvextension name="SPV_EXT_fragment_invocation_density">
+            <enable extension="VK_EXT_fragment_density_map"/>
+        </spirvextension>
+        <spirvextension name="SPV_KHR_physical_storage_buffer">
+            <enable version="VK_API_VERSION_1_2"/>
+            <enable extension="VK_KHR_buffer_device_address"/>
+        </spirvextension>
+        <spirvextension name="SPV_EXT_physical_storage_buffer">
+            <enable extension="VK_EXT_buffer_device_address"/>
+        </spirvextension>
+        <spirvextension name="SPV_NV_cooperative_matrix">
+            <enable extension="VK_NV_cooperative_matrix"/>
+        </spirvextension>
+        <spirvextension name="SPV_NV_shader_sm_builtins">
+            <enable extension="VK_NV_shader_sm_builtins"/>
+        </spirvextension>
+        <spirvextension name="SPV_EXT_fragment_shader_interlock">
+            <enable extension="VK_EXT_fragment_shader_interlock"/>
+        </spirvextension>
+        <spirvextension name="SPV_EXT_demote_to_helper_invocation">
+            <enable extension="VK_EXT_shader_demote_to_helper_invocation"/>
+        </spirvextension>
+        <spirvextension name="SPV_KHR_fragment_shading_rate">
+            <enable extension="VK_KHR_fragment_shading_rate"/>
+        </spirvextension>
+        <spirvextension name="SPV_KHR_non_semantic_info">
+            <enable extension="VK_KHR_shader_non_semantic_info"/>
+        </spirvextension>
+        <spirvextension name="SPV_EXT_shader_image_int64">
+            <enable extension="VK_EXT_shader_image_atomic_int64"/>
+        </spirvextension>
+        <spirvextension name="SPV_KHR_terminate_invocation">
+            <enable extension="VK_KHR_shader_terminate_invocation"/>
+        </spirvextension>
+        <spirvextension name="SPV_KHR_multiview">
+            <enable version="VK_API_VERSION_1_1"/>
+            <enable extension="VK_KHR_multiview"/>
+        </spirvextension>
+        <spirvextension name="SPV_KHR_workgroup_memory_explicit_layout">
+            <enable extension="VK_KHR_workgroup_memory_explicit_layout"/>
+        </spirvextension>
+        <spirvextension name="SPV_EXT_shader_atomic_float_add">
+            <enable extension="VK_EXT_shader_atomic_float"/>
+        </spirvextension>
+        <spirvextension name="SPV_KHR_subgroup_uniform_control_flow">
+            <enable extension="VK_KHR_shader_subgroup_uniform_control_flow"/>
+        </spirvextension>
+        <spirvextension name="SPV_EXT_shader_atomic_float_min_max">
+            <enable extension="VK_EXT_shader_atomic_float2"/>
+        </spirvextension>
+        <spirvextension name="SPV_EXT_shader_atomic_float16_add">
+            <enable extension="VK_EXT_shader_atomic_float2"/>
+        </spirvextension>
+        <spirvextension name="SPV_KHR_integer_dot_product">
+            <enable extension="VK_KHR_shader_integer_dot_product"/>
+        </spirvextension>
+    </spirvextensions>
+    <spirvcapabilities comment="SPIR-V Capabilities allowed in Vulkan and what is required to use it">
+        <spirvcapability name="Matrix">
+            <enable version="VK_API_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="Shader">
+            <enable version="VK_API_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="InputAttachment">
+            <enable version="VK_API_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="Sampled1D">
+            <enable version="VK_API_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="Image1D">
+            <enable version="VK_API_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="SampledBuffer">
+            <enable version="VK_API_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="ImageBuffer">
+            <enable version="VK_API_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="ImageQuery">
+            <enable version="VK_API_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="DerivativeControl">
+            <enable version="VK_API_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="Geometry">
+            <enable struct="VkPhysicalDeviceFeatures" feature="geometryShader" requires="VK_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="Tessellation">
+            <enable struct="VkPhysicalDeviceFeatures" feature="tessellationShader" requires="VK_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="Float64">
+            <enable struct="VkPhysicalDeviceFeatures" feature="shaderFloat64" requires="VK_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="Int64">
+            <enable struct="VkPhysicalDeviceFeatures" feature="shaderInt64" requires="VK_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="Int64Atomics">
+            <enable struct="VkPhysicalDeviceVulkan12Features" feature="shaderBufferInt64Atomics" requires="VK_VERSION_1_2,VK_KHR_shader_atomic_int64"/>
+            <enable struct="VkPhysicalDeviceVulkan12Features" feature="shaderSharedInt64Atomics" requires="VK_VERSION_1_2,VK_KHR_shader_atomic_int64"/>
+            <enable struct="VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT" feature="shaderImageInt64Atomics" requires="VK_EXT_shader_image_atomic_int64"/>
+        </spirvcapability>
+        <spirvcapability name="AtomicFloat16AddEXT">
+            <enable struct="VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT" feature="shaderBufferFloat16AtomicAdd" requires="VK_EXT_shader_atomic_float2"/>
+            <enable struct="VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT" feature="shaderSharedFloat16AtomicAdd" requires="VK_EXT_shader_atomic_float2"/>
+        </spirvcapability>
+        <spirvcapability name="AtomicFloat32AddEXT">
+            <enable struct="VkPhysicalDeviceShaderAtomicFloatFeaturesEXT" feature="shaderBufferFloat32AtomicAdd" requires="VK_EXT_shader_atomic_float"/>
+            <enable struct="VkPhysicalDeviceShaderAtomicFloatFeaturesEXT" feature="shaderSharedFloat32AtomicAdd" requires="VK_EXT_shader_atomic_float"/>
+            <enable struct="VkPhysicalDeviceShaderAtomicFloatFeaturesEXT" feature="shaderImageFloat32AtomicAdd" requires="VK_EXT_shader_atomic_float"/>
+        </spirvcapability>
+        <spirvcapability name="AtomicFloat64AddEXT">
+            <enable struct="VkPhysicalDeviceShaderAtomicFloatFeaturesEXT" feature="shaderBufferFloat64AtomicAdd" requires="VK_EXT_shader_atomic_float"/>
+            <enable struct="VkPhysicalDeviceShaderAtomicFloatFeaturesEXT" feature="shaderSharedFloat64AtomicAdd" requires="VK_EXT_shader_atomic_float"/>
+        </spirvcapability>
+        <spirvcapability name="AtomicFloat16MinMaxEXT">
+            <enable struct="VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT" feature="shaderBufferFloat16AtomicMinMax" requires="VK_EXT_shader_atomic_float2"/>
+            <enable struct="VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT" feature="shaderSharedFloat16AtomicMinMax" requires="VK_EXT_shader_atomic_float2"/>
+        </spirvcapability>
+        <spirvcapability name="AtomicFloat32MinMaxEXT">
+            <enable struct="VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT" feature="shaderBufferFloat32AtomicMinMax" requires="VK_EXT_shader_atomic_float2"/>
+            <enable struct="VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT" feature="shaderSharedFloat32AtomicMinMax" requires="VK_EXT_shader_atomic_float2"/>
+            <enable struct="VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT" feature="shaderImageFloat32AtomicMinMax" requires="VK_EXT_shader_atomic_float2"/>
+        </spirvcapability>
+        <spirvcapability name="AtomicFloat64MinMaxEXT">
+            <enable struct="VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT" feature="shaderBufferFloat64AtomicMinMax" requires="VK_EXT_shader_atomic_float2"/>
+            <enable struct="VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT" feature="shaderSharedFloat64AtomicMinMax" requires="VK_EXT_shader_atomic_float2"/>
+        </spirvcapability>
+        <spirvcapability name="Int64ImageEXT">
+            <enable struct="VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT" feature="shaderImageInt64Atomics" requires="VK_EXT_shader_image_atomic_int64"/>
+        </spirvcapability>
+        <spirvcapability name="Int16">
+            <enable struct="VkPhysicalDeviceFeatures" feature="shaderInt16" requires="VK_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="TessellationPointSize">
+            <enable struct="VkPhysicalDeviceFeatures" feature="shaderTessellationAndGeometryPointSize" requires="VK_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="GeometryPointSize">
+            <enable struct="VkPhysicalDeviceFeatures" feature="shaderTessellationAndGeometryPointSize" requires="VK_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="ImageGatherExtended">
+            <enable struct="VkPhysicalDeviceFeatures" feature="shaderImageGatherExtended" requires="VK_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="StorageImageMultisample">
+            <enable struct="VkPhysicalDeviceFeatures" feature="shaderStorageImageMultisample" requires="VK_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="UniformBufferArrayDynamicIndexing">
+            <enable struct="VkPhysicalDeviceFeatures" feature="shaderUniformBufferArrayDynamicIndexing" requires="VK_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="SampledImageArrayDynamicIndexing">
+            <enable struct="VkPhysicalDeviceFeatures" feature="shaderSampledImageArrayDynamicIndexing" requires="VK_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="StorageBufferArrayDynamicIndexing">
+            <enable struct="VkPhysicalDeviceFeatures" feature="shaderStorageBufferArrayDynamicIndexing" requires="VK_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="StorageImageArrayDynamicIndexing">
+            <enable struct="VkPhysicalDeviceFeatures" feature="shaderStorageImageArrayDynamicIndexing" requires="VK_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="ClipDistance">
+            <enable struct="VkPhysicalDeviceFeatures" feature="shaderClipDistance" requires="VK_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="CullDistance">
+            <enable struct="VkPhysicalDeviceFeatures" feature="shaderCullDistance" requires="VK_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="ImageCubeArray">
+            <enable struct="VkPhysicalDeviceFeatures" feature="imageCubeArray" requires="VK_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="SampleRateShading">
+            <enable struct="VkPhysicalDeviceFeatures" feature="sampleRateShading" requires="VK_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="SparseResidency">
+            <enable struct="VkPhysicalDeviceFeatures" feature="shaderResourceResidency" requires="VK_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="MinLod">
+            <enable struct="VkPhysicalDeviceFeatures" feature="shaderResourceMinLod" requires="VK_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="SampledCubeArray">
+            <enable struct="VkPhysicalDeviceFeatures" feature="imageCubeArray" requires="VK_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="ImageMSArray">
+            <enable struct="VkPhysicalDeviceFeatures" feature="shaderStorageImageMultisample" requires="VK_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="StorageImageExtendedFormats">
+            <enable version="VK_API_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="InterpolationFunction">
+            <enable struct="VkPhysicalDeviceFeatures" feature="sampleRateShading" requires="VK_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="StorageImageReadWithoutFormat">
+            <enable struct="VkPhysicalDeviceFeatures" feature="shaderStorageImageReadWithoutFormat" requires="VK_VERSION_1_0"/>
+            <enable extension="VK_KHR_format_feature_flags2"/>
+        </spirvcapability>
+        <spirvcapability name="StorageImageWriteWithoutFormat">
+            <enable struct="VkPhysicalDeviceFeatures" feature="shaderStorageImageWriteWithoutFormat" requires="VK_VERSION_1_0"/>
+            <enable extension="VK_KHR_format_feature_flags2"/>
+        </spirvcapability>
+        <spirvcapability name="MultiViewport">
+            <enable struct="VkPhysicalDeviceFeatures" feature="multiViewport" requires="VK_VERSION_1_0"/>
+        </spirvcapability>
+        <spirvcapability name="DrawParameters">
+            <enable struct="VkPhysicalDeviceVulkan11Features" feature="shaderDrawParameters" requires="VK_VERSION_1_2"/>
+            <enable struct="VkPhysicalDeviceShaderDrawParametersFeatures" feature="shaderDrawParameters" requires="VK_VERSION_1_1"/>
+            <enable extension="VK_KHR_shader_draw_parameters"/>
+        </spirvcapability>
+        <spirvcapability name="MultiView">
+            <enable struct="VkPhysicalDeviceVulkan11Features" feature="multiview" requires="VK_VERSION_1_2"/>
+            <enable struct="VkPhysicalDeviceMultiviewFeatures" feature="multiview" requires="VK_KHR_multiview"/>
+        </spirvcapability>
+        <spirvcapability name="DeviceGroup">
+            <enable version="VK_API_VERSION_1_1"/>
+            <enable extension="VK_KHR_device_group"/>
+        </spirvcapability>
+        <spirvcapability name="VariablePointersStorageBuffer">
+            <enable struct="VkPhysicalDeviceVulkan11Features" feature="variablePointersStorageBuffer" requires="VK_VERSION_1_2"/>
+            <enable struct="VkPhysicalDeviceVariablePointersFeatures" feature="variablePointersStorageBuffer" requires="VK_KHR_variable_pointers"/>
+        </spirvcapability>
+        <spirvcapability name="VariablePointers">
+            <enable struct="VkPhysicalDeviceVulkan11Features" feature="variablePointers" requires="VK_VERSION_1_2"/>
+            <enable struct="VkPhysicalDeviceVariablePointersFeatures" feature="variablePointers" requires="VK_KHR_variable_pointers"/>
+        </spirvcapability>
+        <spirvcapability name="ShaderClockKHR">
+            <enable extension="VK_KHR_shader_clock"/>
+        </spirvcapability>
+        <spirvcapability name="StencilExportEXT">
+            <enable extension="VK_EXT_shader_stencil_export"/>
+        </spirvcapability>
+        <spirvcapability name="SubgroupBallotKHR">
+            <enable extension="VK_EXT_shader_subgroup_ballot"/>
+        </spirvcapability>
+        <spirvcapability name="SubgroupVoteKHR">
+            <enable extension="VK_EXT_shader_subgroup_vote"/>
+        </spirvcapability>
+        <spirvcapability name="ImageReadWriteLodAMD">
+            <enable extension="VK_AMD_shader_image_load_store_lod"/>
+        </spirvcapability>
+        <spirvcapability name="ImageGatherBiasLodAMD">
+            <enable extension="VK_AMD_texture_gather_bias_lod"/>
+        </spirvcapability>
+        <spirvcapability name="FragmentMaskAMD">
+            <enable extension="VK_AMD_shader_fragment_mask"/>
+        </spirvcapability>
+        <spirvcapability name="SampleMaskOverrideCoverageNV">
+            <enable extension="VK_NV_sample_mask_override_coverage"/>
+        </spirvcapability>
+        <spirvcapability name="GeometryShaderPassthroughNV">
+            <enable extension="VK_NV_geometry_shader_passthrough"/>
+        </spirvcapability>
+        <spirvcapability name="ShaderViewportIndex">
+            <enable struct="VkPhysicalDeviceVulkan12Features" feature="shaderOutputViewportIndex" requires="VK_VERSION_1_2"/>
+        </spirvcapability>
+        <spirvcapability name="ShaderLayer">
+            <enable struct="VkPhysicalDeviceVulkan12Features" feature="shaderOutputLayer" requires="VK_VERSION_1_2"/>
+        </spirvcapability>
+        <spirvcapability name="ShaderViewportIndexLayerEXT">
+            <enable extension="VK_EXT_shader_viewport_index_layer"/>
+        </spirvcapability>
+        <spirvcapability name="ShaderViewportIndexLayerNV">
+            <enable extension="VK_NV_viewport_array2"/>
+        </spirvcapability>
+        <spirvcapability name="ShaderViewportMaskNV">
+            <enable extension="VK_NV_viewport_array2"/>
+        </spirvcapability>
+        <spirvcapability name="PerViewAttributesNV">
+            <enable extension="VK_NVX_multiview_per_view_attributes"/>
+        </spirvcapability>
+        <spirvcapability name="StorageBuffer16BitAccess">
+            <enable struct="VkPhysicalDeviceVulkan11Features" feature="storageBuffer16BitAccess" requires="VK_VERSION_1_2"/>
+            <enable struct="VkPhysicalDevice16BitStorageFeatures" feature="storageBuffer16BitAccess" requires="VK_KHR_16bit_storage"/>
+        </spirvcapability>
+        <spirvcapability name="UniformAndStorageBuffer16BitAccess">
+            <enable struct="VkPhysicalDeviceVulkan11Features" feature="uniformAndStorageBuffer16BitAccess" requires="VK_VERSION_1_2"/>
+            <enable struct="VkPhysicalDevice16BitStorageFeatures" feature="uniformAndStorageBuffer16BitAccess" requires="VK_KHR_16bit_storage"/>
+        </spirvcapability>
+        <spirvcapability name="StoragePushConstant16">
+            <enable struct="VkPhysicalDeviceVulkan11Features" feature="storagePushConstant16" requires="VK_VERSION_1_2"/>
+            <enable struct="VkPhysicalDevice16BitStorageFeatures" feature="storagePushConstant16" requires="VK_KHR_16bit_storage"/>
+        </spirvcapability>
+        <spirvcapability name="StorageInputOutput16">
+            <enable struct="VkPhysicalDeviceVulkan11Features" feature="storageInputOutput16" requires="VK_VERSION_1_2"/>
+            <enable struct="VkPhysicalDevice16BitStorageFeatures" feature="storageInputOutput16" requires="VK_KHR_16bit_storage"/>
+        </spirvcapability>
+        <spirvcapability name="GroupNonUniform">
+            <enable property="VkPhysicalDeviceVulkan11Properties" member="subgroupSupportedOperations" value="VK_SUBGROUP_FEATURE_BASIC_BIT" requires="VK_VERSION_1_1"/>
+        </spirvcapability>
+        <spirvcapability name="GroupNonUniformVote">
+            <enable property="VkPhysicalDeviceVulkan11Properties" member="subgroupSupportedOperations" value="VK_SUBGROUP_FEATURE_VOTE_BIT" requires="VK_VERSION_1_1"/>
+        </spirvcapability>
+        <spirvcapability name="GroupNonUniformArithmetic">
+            <enable property="VkPhysicalDeviceVulkan11Properties" member="subgroupSupportedOperations" value="VK_SUBGROUP_FEATURE_ARITHMETIC_BIT" requires="VK_VERSION_1_1"/>
+        </spirvcapability>
+        <spirvcapability name="GroupNonUniformBallot">
+            <enable property="VkPhysicalDeviceVulkan11Properties" member="subgroupSupportedOperations" value="VK_SUBGROUP_FEATURE_BALLOT_BIT" requires="VK_VERSION_1_1"/>
+        </spirvcapability>
+        <spirvcapability name="GroupNonUniformShuffle">
+            <enable property="VkPhysicalDeviceVulkan11Properties" member="subgroupSupportedOperations" value="VK_SUBGROUP_FEATURE_SHUFFLE_BIT" requires="VK_VERSION_1_1"/>
+        </spirvcapability>
+        <spirvcapability name="GroupNonUniformShuffleRelative">
+            <enable property="VkPhysicalDeviceVulkan11Properties" member="subgroupSupportedOperations" value="VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT" requires="VK_VERSION_1_1"/>
+        </spirvcapability>
+        <spirvcapability name="GroupNonUniformClustered">
+            <enable property="VkPhysicalDeviceVulkan11Properties" member="subgroupSupportedOperations" value="VK_SUBGROUP_FEATURE_CLUSTERED_BIT" requires="VK_VERSION_1_1"/>
+        </spirvcapability>
+        <spirvcapability name="GroupNonUniformQuad">
+            <enable property="VkPhysicalDeviceVulkan11Properties" member="subgroupSupportedOperations" value="VK_SUBGROUP_FEATURE_QUAD_BIT" requires="VK_VERSION_1_1"/>
+        </spirvcapability>
+        <spirvcapability name="GroupNonUniformPartitionedNV">
+            <enable property="VkPhysicalDeviceVulkan11Properties" member="subgroupSupportedOperations" value="VK_SUBGROUP_FEATURE_PARTITIONED_BIT_NV" requires="VK_NV_shader_subgroup_partitioned"/>
+        </spirvcapability>
+        <spirvcapability name="SampleMaskPostDepthCoverage">
+            <enable extension="VK_EXT_post_depth_coverage"/>
+        </spirvcapability>
+        <spirvcapability name="ShaderNonUniform">
+            <enable version="VK_API_VERSION_1_2"/>
+            <enable extension="VK_EXT_descriptor_indexing"/>
+        </spirvcapability>
+        <spirvcapability name="RuntimeDescriptorArray">
+            <enable struct="VkPhysicalDeviceVulkan12Features" feature="runtimeDescriptorArray" requires="VK_VERSION_1_2,VK_EXT_descriptor_indexing"/>
+        </spirvcapability>
+        <spirvcapability name="InputAttachmentArrayDynamicIndexing">
+            <enable struct="VkPhysicalDeviceVulkan12Features" feature="shaderInputAttachmentArrayDynamicIndexing" requires="VK_VERSION_1_2,VK_EXT_descriptor_indexing"/>
+        </spirvcapability>
+        <spirvcapability name="UniformTexelBufferArrayDynamicIndexing">
+            <enable struct="VkPhysicalDeviceVulkan12Features" feature="shaderUniformTexelBufferArrayDynamicIndexing" requires="VK_VERSION_1_2,VK_EXT_descriptor_indexing"/>
+        </spirvcapability>
+        <spirvcapability name="StorageTexelBufferArrayDynamicIndexing">
+            <enable struct="VkPhysicalDeviceVulkan12Features" feature="shaderStorageTexelBufferArrayDynamicIndexing" requires="VK_VERSION_1_2,VK_EXT_descriptor_indexing"/>
+        </spirvcapability>
+        <spirvcapability name="UniformBufferArrayNonUniformIndexing">
+            <enable struct="VkPhysicalDeviceVulkan12Features" feature="shaderUniformBufferArrayNonUniformIndexing" requires="VK_VERSION_1_2,VK_EXT_descriptor_indexing"/>
+        </spirvcapability>
+        <spirvcapability name="SampledImageArrayNonUniformIndexing">
+            <enable struct="VkPhysicalDeviceVulkan12Features" feature="shaderSampledImageArrayNonUniformIndexing" requires="VK_VERSION_1_2,VK_EXT_descriptor_indexing"/>
+        </spirvcapability>
+        <spirvcapability name="StorageBufferArrayNonUniformIndexing">
+            <enable struct="VkPhysicalDeviceVulkan12Features" feature="shaderStorageBufferArrayNonUniformIndexing" requires="VK_VERSION_1_2,VK_EXT_descriptor_indexing"/>
+        </spirvcapability>
+        <spirvcapability name="StorageImageArrayNonUniformIndexing">
+            <enable struct="VkPhysicalDeviceVulkan12Features" feature="shaderStorageImageArrayNonUniformIndexing" requires="VK_VERSION_1_2,VK_EXT_descriptor_indexing"/>
+        </spirvcapability>
+        <spirvcapability name="InputAttachmentArrayNonUniformIndexing">
+            <enable struct="VkPhysicalDeviceVulkan12Features" feature="shaderInputAttachmentArrayNonUniformIndexing" requires="VK_VERSION_1_2,VK_EXT_descriptor_indexing"/>
+        </spirvcapability>
+        <spirvcapability name="UniformTexelBufferArrayNonUniformIndexing">
+            <enable struct="VkPhysicalDeviceVulkan12Features" feature="shaderUniformTexelBufferArrayNonUniformIndexing" requires="VK_VERSION_1_2,VK_EXT_descriptor_indexing"/>
+        </spirvcapability>
+        <spirvcapability name="StorageTexelBufferArrayNonUniformIndexing">
+            <enable struct="VkPhysicalDeviceVulkan12Features" feature="shaderStorageTexelBufferArrayNonUniformIndexing" requires="VK_VERSION_1_2,VK_EXT_descriptor_indexing"/>
+        </spirvcapability>
+        <spirvcapability name="Float16">
+            <enable struct="VkPhysicalDeviceVulkan12Features" feature="shaderFloat16" requires="VK_VERSION_1_2,VK_KHR_shader_float16_int8"/>
+            <enable extension="VK_AMD_gpu_shader_half_float"/>
+        </spirvcapability>
+        <spirvcapability name="Int8">
+            <enable struct="VkPhysicalDeviceVulkan12Features" feature="shaderInt8" requires="VK_VERSION_1_2,VK_KHR_shader_float16_int8"/>
+        </spirvcapability>
+        <spirvcapability name="StorageBuffer8BitAccess">
+            <enable struct="VkPhysicalDeviceVulkan12Features" feature="storageBuffer8BitAccess" requires="VK_VERSION_1_2,VK_KHR_8bit_storage"/>
+        </spirvcapability>
+        <spirvcapability name="UniformAndStorageBuffer8BitAccess">
+            <enable struct="VkPhysicalDeviceVulkan12Features" feature="uniformAndStorageBuffer8BitAccess" requires="VK_VERSION_1_2,VK_KHR_8bit_storage"/>
+        </spirvcapability>
+        <spirvcapability name="StoragePushConstant8">
+            <enable struct="VkPhysicalDeviceVulkan12Features" feature="storagePushConstant8" requires="VK_VERSION_1_2,VK_KHR_8bit_storage"/>
+        </spirvcapability>
+        <spirvcapability name="VulkanMemoryModel">
+            <enable struct="VkPhysicalDeviceVulkan12Features" feature="vulkanMemoryModel" requires="VK_VERSION_1_2,VK_KHR_vulkan_memory_model"/>
+        </spirvcapability>
+        <spirvcapability name="VulkanMemoryModelDeviceScope">
+            <enable struct="VkPhysicalDeviceVulkan12Features" feature="vulkanMemoryModelDeviceScope" requires="VK_VERSION_1_2,VK_KHR_vulkan_memory_model"/>
+        </spirvcapability>
+        <spirvcapability name="DenormPreserve">
+            <enable property="VkPhysicalDeviceVulkan12Properties" member="shaderDenormPreserveFloat16" value="VK_TRUE" requires="VK_VERSION_1_2,VK_KHR_shader_float_controls"/>
+            <enable property="VkPhysicalDeviceVulkan12Properties" member="shaderDenormPreserveFloat32" value="VK_TRUE" requires="VK_VERSION_1_2,VK_KHR_shader_float_controls"/>
+            <enable property="VkPhysicalDeviceVulkan12Properties" member="shaderDenormPreserveFloat64" value="VK_TRUE" requires="VK_VERSION_1_2,VK_KHR_shader_float_controls"/>
+        </spirvcapability>
+        <spirvcapability name="DenormFlushToZero">
+            <enable property="VkPhysicalDeviceVulkan12Properties" member="shaderDenormFlushToZeroFloat16" value="VK_TRUE" requires="VK_VERSION_1_2,VK_KHR_shader_float_controls"/>
+            <enable property="VkPhysicalDeviceVulkan12Properties" member="shaderDenormFlushToZeroFloat32" value="VK_TRUE" requires="VK_VERSION_1_2,VK_KHR_shader_float_controls"/>
+            <enable property="VkPhysicalDeviceVulkan12Properties" member="shaderDenormFlushToZeroFloat64" value="VK_TRUE" requires="VK_VERSION_1_2,VK_KHR_shader_float_controls"/>
+        </spirvcapability>
+        <spirvcapability name="SignedZeroInfNanPreserve">
+            <enable property="VkPhysicalDeviceVulkan12Properties" member="shaderSignedZeroInfNanPreserveFloat16" value="VK_TRUE" requires="VK_VERSION_1_2,VK_KHR_shader_float_controls"/>
+            <enable property="VkPhysicalDeviceVulkan12Properties" member="shaderSignedZeroInfNanPreserveFloat32" value="VK_TRUE" requires="VK_VERSION_1_2,VK_KHR_shader_float_controls"/>
+            <enable property="VkPhysicalDeviceVulkan12Properties" member="shaderSignedZeroInfNanPreserveFloat64" value="VK_TRUE" requires="VK_VERSION_1_2,VK_KHR_shader_float_controls"/>
+        </spirvcapability>
+        <spirvcapability name="RoundingModeRTE">
+            <enable property="VkPhysicalDeviceVulkan12Properties" member="shaderRoundingModeRTEFloat16" value="VK_TRUE" requires="VK_VERSION_1_2,VK_KHR_shader_float_controls"/>
+            <enable property="VkPhysicalDeviceVulkan12Properties" member="shaderRoundingModeRTEFloat32" value="VK_TRUE" requires="VK_VERSION_1_2,VK_KHR_shader_float_controls"/>
+            <enable property="VkPhysicalDeviceVulkan12Properties" member="shaderRoundingModeRTEFloat64" value="VK_TRUE" requires="VK_VERSION_1_2,VK_KHR_shader_float_controls"/>
+        </spirvcapability>
+        <spirvcapability name="RoundingModeRTZ">
+            <enable property="VkPhysicalDeviceVulkan12Properties" member="shaderRoundingModeRTZFloat16" value="VK_TRUE" requires="VK_VERSION_1_2,VK_KHR_shader_float_controls"/>
+            <enable property="VkPhysicalDeviceVulkan12Properties" member="shaderRoundingModeRTZFloat32" value="VK_TRUE" requires="VK_VERSION_1_2,VK_KHR_shader_float_controls"/>
+            <enable property="VkPhysicalDeviceVulkan12Properties" member="shaderRoundingModeRTZFloat64" value="VK_TRUE" requires="VK_VERSION_1_2,VK_KHR_shader_float_controls"/>
+        </spirvcapability>
+        <spirvcapability name="ComputeDerivativeGroupQuadsNV">
+            <enable struct="VkPhysicalDeviceComputeShaderDerivativesFeaturesNV" feature="computeDerivativeGroupQuads" requires="VK_NV_compute_shader_derivatives"/>
+        </spirvcapability>
+        <spirvcapability name="ComputeDerivativeGroupLinearNV">
+            <enable struct="VkPhysicalDeviceComputeShaderDerivativesFeaturesNV" feature="computeDerivativeGroupLinear" requires="VK_NV_compute_shader_derivatives"/>
+        </spirvcapability>
+        <spirvcapability name="FragmentBarycentricNV">
+            <enable struct="VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV" feature="fragmentShaderBarycentric" requires="VK_NV_fragment_shader_barycentric"/>
+        </spirvcapability>
+        <spirvcapability name="ImageFootprintNV">
+            <enable struct="VkPhysicalDeviceShaderImageFootprintFeaturesNV" feature="imageFootprint" requires="VK_NV_shader_image_footprint"/>
+        </spirvcapability>
+        <spirvcapability name="ShadingRateNV">
+            <enable struct="VkPhysicalDeviceShadingRateImageFeaturesNV" feature="shadingRateImage" requires="VK_NV_shading_rate_image"/>
+        </spirvcapability>
+        <spirvcapability name="MeshShadingNV">
+            <enable extension="VK_NV_mesh_shader"/>
+        </spirvcapability>
+        <spirvcapability name="RayTracingKHR">
+            <enable struct="VkPhysicalDeviceRayTracingPipelineFeaturesKHR" feature="rayTracingPipeline" requires="VK_KHR_ray_tracing_pipeline"/>
+        </spirvcapability>
+        <spirvcapability name="RayQueryKHR">
+            <enable struct="VkPhysicalDeviceRayQueryFeaturesKHR" feature="rayQuery" requires="VK_KHR_ray_query"/>
+        </spirvcapability>
+        <spirvcapability name="RayTraversalPrimitiveCullingKHR">
+            <enable struct="VkPhysicalDeviceRayTracingPipelineFeaturesKHR" feature="rayTraversalPrimitiveCulling" requires="VK_KHR_ray_tracing_pipeline"/>
+        </spirvcapability>
+        <spirvcapability name="RayTracingNV">
+            <enable extension="VK_NV_ray_tracing"/>
+        </spirvcapability>
+        <spirvcapability name="RayTracingMotionBlurNV">
+            <enable struct="VkPhysicalDeviceRayTracingMotionBlurFeaturesNV" feature="rayTracingMotionBlur" requires="VK_NV_ray_tracing_motion_blur"/>
+        </spirvcapability>
+        <spirvcapability name="TransformFeedback">
+            <enable struct="VkPhysicalDeviceTransformFeedbackFeaturesEXT" feature="transformFeedback" requires="VK_EXT_transform_feedback"/>
+        </spirvcapability>
+        <spirvcapability name="GeometryStreams">
+            <enable struct="VkPhysicalDeviceTransformFeedbackFeaturesEXT" feature="geometryStreams" requires="VK_EXT_transform_feedback"/>
+        </spirvcapability>
+        <spirvcapability name="FragmentDensityEXT">
+            <enable struct="VkPhysicalDeviceFragmentDensityMapFeaturesEXT" feature="fragmentDensityMap" requires="VK_EXT_fragment_density_map"/>
+        </spirvcapability>
+        <spirvcapability name="PhysicalStorageBufferAddresses">
+            <enable struct="VkPhysicalDeviceVulkan12Features" feature="bufferDeviceAddress" requires="VK_VERSION_1_2,VK_KHR_buffer_device_address"/>
+            <enable struct="VkPhysicalDeviceBufferDeviceAddressFeaturesEXT" feature="bufferDeviceAddress" requires="VK_EXT_buffer_device_address" alias="bufferDeviceAddressEXT"/>
+        </spirvcapability>
+        <spirvcapability name="CooperativeMatrixNV">
+            <enable struct="VkPhysicalDeviceCooperativeMatrixFeaturesNV" feature="cooperativeMatrix" requires="VK_NV_cooperative_matrix"/>
+        </spirvcapability>
+        <spirvcapability name="IntegerFunctions2INTEL">
+            <enable struct="VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL" feature="shaderIntegerFunctions2" requires="VK_INTEL_shader_integer_functions2"/>
+        </spirvcapability>
+        <spirvcapability name="ShaderSMBuiltinsNV">
+            <enable struct="VkPhysicalDeviceShaderSMBuiltinsFeaturesNV" feature="shaderSMBuiltins" requires="VK_NV_shader_sm_builtins"/>
+        </spirvcapability>
+        <spirvcapability name="FragmentShaderSampleInterlockEXT">
+            <enable struct="VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT" feature="fragmentShaderSampleInterlock" requires="VK_EXT_fragment_shader_interlock"/>
+        </spirvcapability>
+        <spirvcapability name="FragmentShaderPixelInterlockEXT">
+            <enable struct="VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT" feature="fragmentShaderPixelInterlock" requires="VK_EXT_fragment_shader_interlock"/>
+        </spirvcapability>
+        <spirvcapability name="FragmentShaderShadingRateInterlockEXT">
+            <enable struct="VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT" feature="fragmentShaderShadingRateInterlock" requires="VK_EXT_fragment_shader_interlock"/>
+            <enable struct="VkPhysicalDeviceShadingRateImageFeaturesNV" feature="shadingRateImage" requires="VK_NV_shading_rate_image"/>
+        </spirvcapability>
+        <spirvcapability name="DemoteToHelperInvocationEXT">
+            <enable struct="VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT" feature="shaderDemoteToHelperInvocation" requires="VK_EXT_shader_demote_to_helper_invocation"/>
+        </spirvcapability>
+        <spirvcapability name="FragmentShadingRateKHR">
+            <enable struct="VkPhysicalDeviceFragmentShadingRateFeaturesKHR" feature="pipelineFragmentShadingRate" requires="VK_KHR_fragment_shading_rate"/>
+            <enable struct="VkPhysicalDeviceFragmentShadingRateFeaturesKHR" feature="primitiveFragmentShadingRate" requires="VK_KHR_fragment_shading_rate"/>
+            <enable struct="VkPhysicalDeviceFragmentShadingRateFeaturesKHR" feature="attachmentFragmentShadingRate" requires="VK_KHR_fragment_shading_rate"/>
+        </spirvcapability>
+        <spirvcapability name="WorkgroupMemoryExplicitLayoutKHR">
+            <enable struct="VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR" feature="workgroupMemoryExplicitLayout" requires="VK_KHR_workgroup_memory_explicit_layout"/>
+        </spirvcapability>
+        <spirvcapability name="WorkgroupMemoryExplicitLayout8BitAccessKHR">
+            <enable struct="VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR" feature="workgroupMemoryExplicitLayout8BitAccess" requires="VK_KHR_workgroup_memory_explicit_layout"/>
+        </spirvcapability>
+        <spirvcapability name="WorkgroupMemoryExplicitLayout16BitAccessKHR">
+            <enable struct="VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR" feature="workgroupMemoryExplicitLayout16BitAccess" requires="VK_KHR_workgroup_memory_explicit_layout"/>
+        </spirvcapability>
+        <spirvcapability name="DotProductInputAllKHR">
+            <enable struct="VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR" feature="shaderIntegerDotProduct" requires="VK_KHR_shader_integer_dot_product"/>
+        </spirvcapability>
+        <spirvcapability name="DotProductInput4x8BitKHR">
+            <enable struct="VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR" feature="shaderIntegerDotProduct" requires="VK_KHR_shader_integer_dot_product"/>
+        </spirvcapability>
+        <spirvcapability name="DotProductInput4x8BitPackedKHR">
+            <enable struct="VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR" feature="shaderIntegerDotProduct" requires="VK_KHR_shader_integer_dot_product"/>
+        </spirvcapability>
+        <spirvcapability name="DotProductKHR">
+            <enable struct="VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR" feature="shaderIntegerDotProduct" requires="VK_KHR_shader_integer_dot_product"/>
+        </spirvcapability>
+    </spirvcapabilities>
+</registry>
diff --git a/system/vulkan/vk_icd_gen.py b/system/vulkan/vk_icd_gen.py
new file mode 100644
index 0000000..d5401e8
--- /dev/null
+++ b/system/vulkan/vk_icd_gen.py
@@ -0,0 +1,78 @@
+# Copyright 2017 Intel Corporation
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sub license, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice (including the
+# next paragraph) shall be included in all copies or substantial portions
+# of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+# IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
+# ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+import argparse
+import json
+import os.path
+import re
+import xml.etree.ElementTree as et
+
+def get_xml_patch_version(xml_file):
+    xml = et.parse(xml_file)
+    for d in xml.findall('.types/type'):
+        if d.get('category', None) != 'define':
+            continue
+
+        name = d.find('.name')
+        if name.text != 'VK_HEADER_VERSION':
+            continue;
+
+        return name.tail.strip()
+
+if __name__ == '__main__':
+    parser = argparse.ArgumentParser()
+    parser.add_argument('--api-version', required=True,
+                        help='Vulkan API version.')
+    parser.add_argument('--xml', required=False,
+                        help='Vulkan registry XML for patch version')
+    parser.add_argument('--lib-path', required=True,
+                        help='Path to installed library')
+    parser.add_argument('--out', required=False,
+                        help='Output json file.')
+    args = parser.parse_args()
+
+    version = args.api_version
+    if args.xml:
+        re.match(r'\d+\.\d+', version)
+        version = version + '.' + get_xml_patch_version(args.xml)
+    else:
+        re.match(r'\d+\.\d+\.\d+', version)
+
+    json_data = {
+        'file_format_version': '1.0.0',
+        'ICD': {
+            'library_path': args.lib_path,
+            'api_version': version,
+        },
+    }
+
+    json_params = {
+        'indent': 4,
+        'sort_keys': True,
+        'separators': (',', ': '),
+    }
+
+    if args.out:
+        with open(args.out, 'w') as f:
+            json.dump(json_data, f, **json_params)
+    else:
+        print(json.dumps(json_data, **json_params))
diff --git a/system/vulkan_enc/Android.mk b/system/vulkan_enc/Android.mk
new file mode 100644
index 0000000..e085a51
--- /dev/null
+++ b/system/vulkan_enc/Android.mk
@@ -0,0 +1,81 @@
+LOCAL_PATH := $(call my-dir)
+
+$(call emugl-begin-shared-library,libvulkan_enc)
+$(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
+$(call emugl-import,libOpenglCodecCommon$(GOLDFISH_OPENGL_LIB_SUFFIX) lib_renderControl_enc)
+ifeq (true,$(GOLDFISH_OPENGL_BUILD_FOR_HOST))
+$(call emugl-import,libandroidemu)
+$(call emugl-import,libplatform$(GOLDFISH_OPENGL_LIB_SUFFIX))
+$(call emugl-import,libGoldfishAddressSpace$(GOLDFISH_OPENGL_LIB_SUFFIX))
+else
+$(call emugl-export,SHARED_LIBRARIES,libandroidemu)
+$(call emugl-export,STATIC_LIBRARIES,libplatform)
+$(call emugl-export,STATIC_LIBRARIES,libGoldfishAddressSpace)
+endif
+
+# Vulkan include dir
+ifeq (true,$(GOLDFISH_OPENGL_BUILD_FOR_HOST))
+LOCAL_C_INCLUDES += \
+    $(LOCAL_PATH) \
+    $(GFXSTREAM_PROTOCOLS_PATH)/common/vulkan/include
+endif
+
+ifneq (true,$(GOLDFISH_OPENGL_BUILD_FOR_HOST))
+LOCAL_C_INCLUDES += \
+    $(LOCAL_PATH) \
+    $(LOCAL_PATH)/../vulkan_enc \
+    external/libdrm \
+    external/minigbm/cros_gralloc \
+
+LOCAL_HEADER_LIBRARIES += \
+    hwvulkan_headers \
+    gfxstream_vulkan_headers \
+
+LOCAL_SHARED_LIBRARIES += libdrm
+
+endif
+
+LOCAL_CFLAGS += \
+    -DLOG_TAG=\"goldfish_vulkan\" \
+    -DVK_ANDROID_native_buffer \
+    -DVK_EXT_device_memory_report \
+    -DVK_GOOGLE_gfxstream \
+    -Wno-missing-field-initializers \
+    -Werror \
+    -fstrict-aliasing \
+    -DVK_USE_PLATFORM_ANDROID_KHR \
+    -DVK_NO_PROTOTYPES \
+    -DVIRTIO_GPU
+
+LOCAL_SRC_FILES := AndroidHardwareBuffer.cpp \
+    CommandBufferStagingStream.cpp \
+    DescriptorSetVirtualization.cpp \
+    HostVisibleMemoryVirtualization.cpp \
+    Resources.cpp \
+    Validation.cpp \
+    VulkanStreamGuest.cpp \
+    VulkanHandleMapping.cpp \
+    ResourceTracker.cpp \
+    VkEncoder.cpp \
+    goldfish_vk_extension_structs_guest.cpp \
+    goldfish_vk_marshaling_guest.cpp \
+    goldfish_vk_reserved_marshaling_guest.cpp \
+    goldfish_vk_deepcopy_guest.cpp \
+    goldfish_vk_counting_guest.cpp \
+    goldfish_vk_handlemap_guest.cpp \
+    goldfish_vk_transform_guest.cpp \
+	func_table.cpp \
+
+LOCAL_TIDY_DISABLED_SRCS := VkEncoder.cpp
+LOCAL_TIDY := false
+
+ifeq (true,$(GOLDFISH_OPENGL_BUILD_FOR_HOST))
+LOCAL_CFLAGS += -D__ANDROID_API__=28
+$(call emugl-export,SHARED_LIBRARIES,libgui)
+else
+$(call emugl-export,SHARED_LIBRARIES,libsync libnativewindow)
+LOCAL_STATIC_LIBRARIES += libarect
+endif
+
+$(call emugl-end-module)
+
diff --git a/system/vulkan_enc/AndroidHardwareBuffer.cpp b/system/vulkan_enc/AndroidHardwareBuffer.cpp
new file mode 100644
index 0000000..09946ee
--- /dev/null
+++ b/system/vulkan_enc/AndroidHardwareBuffer.cpp
@@ -0,0 +1,348 @@
+/// Copyright (C) 2019 The Android Open Source Project
+// Copyright (C) 2019 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include "AndroidHardwareBuffer.h"
+
+#if !defined(HOST_BUILD)
+#if defined(__ANDROID__) || defined(__linux__)
+#include <drm_fourcc.h>
+#define DRM_FORMAT_YVU420_ANDROID fourcc_code('9', '9', '9', '7')
+#endif
+#endif
+
+#include "../OpenglSystemCommon/HostConnection.h"
+
+#include "vk_format_info.h"
+#include "vk_util.h"
+#include <assert.h>
+
+namespace gfxstream {
+namespace vk {
+
+// From Intel ANV implementation.
+/* Construct ahw usage mask from image usage bits, see
+ * 'AHardwareBuffer Usage Equivalence' in Vulkan spec.
+ */
+uint64_t
+getAndroidHardwareBufferUsageFromVkUsage(const VkImageCreateFlags vk_create,
+                                 const VkImageUsageFlags vk_usage)
+{
+   uint64_t ahw_usage = 0;
+
+   if (vk_usage & VK_IMAGE_USAGE_SAMPLED_BIT)
+      ahw_usage |= AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE;
+
+   if (vk_usage & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT)
+      ahw_usage |= AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE;
+
+   if (vk_usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT)
+      ahw_usage |= AHARDWAREBUFFER_USAGE_GPU_COLOR_OUTPUT;
+
+   if (vk_create & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT)
+      ahw_usage |= AHARDWAREBUFFER_USAGE_GPU_CUBE_MAP;
+
+   if (vk_create & VK_IMAGE_CREATE_PROTECTED_BIT)
+      ahw_usage |= AHARDWAREBUFFER_USAGE_PROTECTED_CONTENT;
+
+   /* No usage bits set - set at least one GPU usage. */
+   if (ahw_usage == 0)
+      ahw_usage = AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE;
+
+   return ahw_usage;
+}
+
+void updateMemoryTypeBits(uint32_t* memoryTypeBits, uint32_t colorBufferMemoryIndex) {
+   *memoryTypeBits = 1u << colorBufferMemoryIndex;
+}
+
+VkResult getAndroidHardwareBufferPropertiesANDROID(
+    Gralloc* grallocHelper,
+    const AHardwareBuffer* buffer,
+    VkAndroidHardwareBufferPropertiesANDROID* pProperties) {
+
+    const native_handle_t *handle =
+       AHardwareBuffer_getNativeHandle(buffer);
+
+    VkAndroidHardwareBufferFormatPropertiesANDROID* ahbFormatProps =
+        vk_find_struct<VkAndroidHardwareBufferFormatPropertiesANDROID>(pProperties);
+
+    if (ahbFormatProps) {
+        AHardwareBuffer_Desc desc;
+        AHardwareBuffer_describe(buffer, &desc);
+
+       const uint64_t gpu_usage =
+          AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE |
+          AHARDWAREBUFFER_USAGE_GPU_COLOR_OUTPUT |
+          AHARDWAREBUFFER_USAGE_GPU_DATA_BUFFER;
+
+        if (!(desc.usage & (gpu_usage))) {
+            return VK_ERROR_INVALID_EXTERNAL_HANDLE;
+        }
+        switch(desc.format) {
+            case AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM:
+                  ahbFormatProps->format = VK_FORMAT_R8G8B8A8_UNORM;
+                  break;
+            case AHARDWAREBUFFER_FORMAT_R8G8B8X8_UNORM:
+                  ahbFormatProps->format = VK_FORMAT_R8G8B8A8_UNORM;
+                  break;
+            case AHARDWAREBUFFER_FORMAT_R8G8B8_UNORM:
+                  ahbFormatProps->format = VK_FORMAT_R8G8B8_UNORM;
+                  break;
+            case AHARDWAREBUFFER_FORMAT_R5G6B5_UNORM:
+                  ahbFormatProps->format = VK_FORMAT_R5G6B5_UNORM_PACK16;
+                  break;
+            case AHARDWAREBUFFER_FORMAT_R16G16B16A16_FLOAT:
+                  ahbFormatProps->format = VK_FORMAT_R16G16B16A16_SFLOAT;
+                  break;
+            case AHARDWAREBUFFER_FORMAT_R10G10B10A2_UNORM:
+                  ahbFormatProps->format = VK_FORMAT_A2B10G10R10_UNORM_PACK32;
+                  break;
+            case AHARDWAREBUFFER_FORMAT_D16_UNORM:
+                  ahbFormatProps->format = VK_FORMAT_D16_UNORM;
+                  break;
+            case AHARDWAREBUFFER_FORMAT_D24_UNORM:
+                  ahbFormatProps->format = VK_FORMAT_X8_D24_UNORM_PACK32;
+                  break;
+            case AHARDWAREBUFFER_FORMAT_D24_UNORM_S8_UINT:
+                  ahbFormatProps->format = VK_FORMAT_D24_UNORM_S8_UINT;
+                  break;
+            case AHARDWAREBUFFER_FORMAT_D32_FLOAT:
+                  ahbFormatProps->format = VK_FORMAT_D32_SFLOAT;
+                  break;
+            case AHARDWAREBUFFER_FORMAT_D32_FLOAT_S8_UINT:
+                  ahbFormatProps->format = VK_FORMAT_D32_SFLOAT_S8_UINT;
+                  break;
+            case AHARDWAREBUFFER_FORMAT_S8_UINT:
+                  ahbFormatProps->format = VK_FORMAT_S8_UINT;
+                  break;
+            default:
+                  ahbFormatProps->format = VK_FORMAT_UNDEFINED;
+        }
+        ahbFormatProps->externalFormat = desc.format;
+
+        // The formatFeatures member must include
+        // VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT and at least one of
+        // VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT or
+        // VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT, and should include
+        // VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT and
+        // VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT.
+
+        // org.skia.skqp.SkQPRunner#UnitTest_VulkanHardwareBuffer* requires the following:
+        // VK_FORMAT_FEATURE_TRANSFER_SRC_BIT
+        // VK_FORMAT_FEATURE_TRANSFER_DST_BIT
+        // VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT
+        ahbFormatProps->formatFeatures =
+            VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT |
+            VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT |
+            VK_FORMAT_FEATURE_TRANSFER_SRC_BIT |
+            VK_FORMAT_FEATURE_TRANSFER_DST_BIT |
+            VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT;
+
+        // "Implementations may not always be able to determine the color model,
+        // numerical range, or chroma offsets of the image contents, so the values in
+        // VkAndroidHardwareBufferFormatPropertiesANDROID are only suggestions.
+        // Applications should treat these values as sensible defaults to use in the
+        // absence of more reliable information obtained through some other means."
+
+        ahbFormatProps->samplerYcbcrConversionComponents.r = VK_COMPONENT_SWIZZLE_IDENTITY;
+        ahbFormatProps->samplerYcbcrConversionComponents.g = VK_COMPONENT_SWIZZLE_IDENTITY;
+        ahbFormatProps->samplerYcbcrConversionComponents.b = VK_COMPONENT_SWIZZLE_IDENTITY;
+        ahbFormatProps->samplerYcbcrConversionComponents.a = VK_COMPONENT_SWIZZLE_IDENTITY;
+
+#if !defined(HOST_BUILD)
+#if defined(__ANDROID__) || defined(__linux__)
+        if (android_format_is_yuv(desc.format)) {
+            uint32_t drmFormat = grallocHelper->getFormatDrmFourcc(handle);
+            if (drmFormat) {
+                // The host renderer is not aware of the plane ordering for YUV formats used
+                // in the guest and simply knows that the format "layout" is one of:
+                //
+                //  * VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16
+                //  * VK_FORMAT_G8_B8R8_2PLANE_420_UNORM
+                //  * VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM
+                //
+                // With this, the guest needs to adjust the component swizzle based on plane
+                // ordering to ensure that the channels are interpreted correctly.
+                //
+                // From the Vulkan spec's "Sampler Y'CBCR Conversion" section:
+                //
+                //  * Y comes from the G-channel (after swizzle)
+                //  * U (CB) comes from the B-channel (after swizzle)
+                //  * V (CR) comes from the R-channel (after swizzle)
+                //
+                // See https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#textures-sampler-YCbCr-conversion
+                //
+                // To match the above, the guest needs to swizzle such that:
+                //
+                //  * Y ends up in the G-channel
+                //  * U (CB) ends up in the B-channel
+                //  * V (CB) ends up in the R-channel
+                switch (drmFormat) {
+                    case DRM_FORMAT_NV12:
+                        // NV12 is a Y-plane followed by a interleaved UV-plane and is
+                        // VK_FORMAT_G8_B8R8_2PLANE_420_UNORM on the host.
+                    case DRM_FORMAT_P010:
+                        // P010 is a Y-plane followed by a interleaved UV-plane and is
+                        // VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16 on the host.
+                        break;
+
+                    case DRM_FORMAT_NV21:
+                        // NV21 is a Y-plane followed by a interleaved VU-plane and is
+                        // VK_FORMAT_G8_B8R8_2PLANE_420_UNORM on the host.
+                    case DRM_FORMAT_YVU420:
+                        // YV12 is a Y-plane, then a V-plane, and then a U-plane and is
+                        // VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM on the host.
+                    case DRM_FORMAT_YVU420_ANDROID:
+                        // DRM_FORMAT_YVU420_ANDROID is the same as DRM_FORMAT_YVU420 with
+                        // Android's extra alignement requirements.
+                        ahbFormatProps->samplerYcbcrConversionComponents.r = VK_COMPONENT_SWIZZLE_B;
+                        ahbFormatProps->samplerYcbcrConversionComponents.b = VK_COMPONENT_SWIZZLE_R;
+                        break;
+
+                    default:
+                        ALOGE("%s: Unhandled YUV drm format:%" PRIu32, __FUNCTION__, drmFormat);
+                        break;
+                }
+            }
+        }
+#endif
+#endif
+
+        ahbFormatProps->suggestedYcbcrModel =
+            android_format_is_yuv(desc.format) ?
+                VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601 :
+                VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY;
+        ahbFormatProps->suggestedYcbcrRange = VK_SAMPLER_YCBCR_RANGE_ITU_FULL;
+
+        ahbFormatProps->suggestedXChromaOffset = VK_CHROMA_LOCATION_MIDPOINT;
+        ahbFormatProps->suggestedYChromaOffset = VK_CHROMA_LOCATION_MIDPOINT;
+    }
+
+    uint32_t colorBufferHandle =
+        grallocHelper->getHostHandle(handle);
+    if (!colorBufferHandle) {
+        return VK_ERROR_INVALID_EXTERNAL_HANDLE;
+    }
+
+    pProperties->allocationSize =
+        grallocHelper->getAllocatedSize(handle);
+
+    return VK_SUCCESS;
+}
+
+// Based on Intel ANV implementation.
+VkResult getMemoryAndroidHardwareBufferANDROID(struct AHardwareBuffer **pBuffer) {
+
+   /* Some quotes from Vulkan spec:
+    *
+    * "If the device memory was created by importing an Android hardware
+    * buffer, vkGetMemoryAndroidHardwareBufferANDROID must return that same
+    * Android hardware buffer object."
+    *
+    * "VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID must
+    * have been included in VkExportMemoryAllocateInfo::handleTypes when
+    * memory was created."
+    */
+
+    if (!pBuffer) return VK_ERROR_OUT_OF_HOST_MEMORY;
+    if (!(*pBuffer)) return VK_ERROR_OUT_OF_HOST_MEMORY;
+
+    AHardwareBuffer_acquire(*pBuffer);
+    return VK_SUCCESS;
+}
+
+VkResult importAndroidHardwareBuffer(
+    Gralloc* grallocHelper,
+    const VkImportAndroidHardwareBufferInfoANDROID* info,
+    struct AHardwareBuffer **importOut) {
+
+    if (!info || !info->buffer) {
+        return VK_ERROR_INVALID_EXTERNAL_HANDLE;
+    }
+
+    uint32_t colorBufferHandle =
+        grallocHelper->getHostHandle(
+            AHardwareBuffer_getNativeHandle(info->buffer));
+    if (!colorBufferHandle) {
+        return VK_ERROR_INVALID_EXTERNAL_HANDLE;
+    }
+
+    auto ahb = info->buffer;
+
+    AHardwareBuffer_acquire(ahb);
+
+    if (importOut) *importOut = ahb;
+
+    return VK_SUCCESS;
+}
+
+VkResult createAndroidHardwareBuffer(
+    bool hasDedicatedImage,
+    bool hasDedicatedBuffer,
+    const VkExtent3D& imageExtent,
+    uint32_t imageLayers,
+    VkFormat imageFormat,
+    VkImageUsageFlags imageUsage,
+    VkImageCreateFlags imageCreateFlags,
+    VkDeviceSize bufferSize,
+    VkDeviceSize allocationInfoAllocSize,
+    struct AHardwareBuffer **out) {
+
+    uint32_t w = 0;
+    uint32_t h = 1;
+    uint32_t layers = 1;
+    uint32_t format = 0;
+    uint64_t usage = 0;
+
+    /* If caller passed dedicated information. */
+    if (hasDedicatedImage) {
+       w = imageExtent.width;
+       h = imageExtent.height;
+       layers = imageLayers;
+       format = android_format_from_vk(imageFormat);
+       usage = getAndroidHardwareBufferUsageFromVkUsage(imageCreateFlags, imageUsage);
+    } else if (hasDedicatedBuffer) {
+       w = bufferSize;
+       format = AHARDWAREBUFFER_FORMAT_BLOB;
+       usage = AHARDWAREBUFFER_USAGE_CPU_READ_OFTEN |
+               AHARDWAREBUFFER_USAGE_CPU_WRITE_OFTEN |
+               AHARDWAREBUFFER_USAGE_GPU_DATA_BUFFER;
+    } else {
+       w = allocationInfoAllocSize;
+       format = AHARDWAREBUFFER_FORMAT_BLOB;
+       usage = AHARDWAREBUFFER_USAGE_CPU_READ_OFTEN |
+               AHARDWAREBUFFER_USAGE_CPU_WRITE_OFTEN |
+               AHARDWAREBUFFER_USAGE_GPU_DATA_BUFFER;
+    }
+
+    struct AHardwareBuffer *ahw = NULL;
+    struct AHardwareBuffer_Desc desc = {
+        .width = w,
+        .height = h,
+        .layers = layers,
+        .format = format,
+        .usage = usage,
+    };
+
+    if (AHardwareBuffer_allocate(&desc, &ahw) != 0) {
+        return VK_ERROR_OUT_OF_HOST_MEMORY;
+    }
+
+    *out = ahw;
+
+    return VK_SUCCESS;
+}
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/AndroidHardwareBuffer.h b/system/vulkan_enc/AndroidHardwareBuffer.h
new file mode 100644
index 0000000..c5e64ee
--- /dev/null
+++ b/system/vulkan_enc/AndroidHardwareBuffer.h
@@ -0,0 +1,63 @@
+/// Copyright (C) 2019 The Android Open Source Project
+// Copyright (C) 2019 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#pragma once
+
+#include "HostVisibleMemoryVirtualization.h"
+
+#include <vulkan/vulkan.h>
+#include <vndk/hardware_buffer.h>
+
+// Structure similar to
+// https://github.com/mesa3d/mesa/blob/master/src/intel/vulkan/anv_android.c
+
+class Gralloc;
+
+namespace gfxstream {
+namespace vk {
+
+uint64_t
+getAndroidHardwareBufferUsageFromVkUsage(
+    const VkImageCreateFlags vk_create,
+    const VkImageUsageFlags vk_usage);
+
+void updateMemoryTypeBits(uint32_t* memoryTypeBits, uint32_t colorBufferMemoryIndex);
+
+VkResult getAndroidHardwareBufferPropertiesANDROID(
+    Gralloc* grallocHelper,
+    const AHardwareBuffer* buffer,
+    VkAndroidHardwareBufferPropertiesANDROID* pProperties);
+
+VkResult getMemoryAndroidHardwareBufferANDROID(
+    struct AHardwareBuffer **pBuffer);
+
+VkResult importAndroidHardwareBuffer(
+    Gralloc* grallocHelper,
+    const VkImportAndroidHardwareBufferInfoANDROID* info,
+    struct AHardwareBuffer **importOut);
+
+VkResult createAndroidHardwareBuffer(
+    bool hasDedicatedImage,
+    bool hasDedicatedBuffer,
+    const VkExtent3D& imageExtent,
+    uint32_t imageLayers,
+    VkFormat imageFormat,
+    VkImageUsageFlags imageUsage,
+    VkImageCreateFlags imageCreateFlags,
+    VkDeviceSize bufferSize,
+    VkDeviceSize allocationInfoAllocSize,
+    struct AHardwareBuffer **out);
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/CMakeLists.txt b/system/vulkan_enc/CMakeLists.txt
new file mode 100644
index 0000000..81dbeb5
--- /dev/null
+++ b/system/vulkan_enc/CMakeLists.txt
@@ -0,0 +1,10 @@
+# This is an autogenerated file! Do not edit!
+# instead run make from .../device/generic/goldfish-opengl
+# which will re-generate this file.
+android_validate_sha256("${GOLDFISH_DEVICE_ROOT}/system/vulkan_enc/Android.mk" "a38a9cb4212af60da21bc4f42d5c09644a1940afcccb766bf88266e70340f779")
+set(vulkan_enc_src AndroidHardwareBuffer.cpp CommandBufferStagingStream.cpp DescriptorSetVirtualization.cpp HostVisibleMemoryVirtualization.cpp Resources.cpp Validation.cpp VulkanStreamGuest.cpp VulkanHandleMapping.cpp ResourceTracker.cpp VkEncoder.cpp goldfish_vk_extension_structs_guest.cpp goldfish_vk_marshaling_guest.cpp goldfish_vk_reserved_marshaling_guest.cpp goldfish_vk_deepcopy_guest.cpp goldfish_vk_counting_guest.cpp goldfish_vk_handlemap_guest.cpp goldfish_vk_transform_guest.cpp func_table.cpp)
+android_add_library(TARGET vulkan_enc SHARED LICENSE Apache-2.0 SRC AndroidHardwareBuffer.cpp CommandBufferStagingStream.cpp DescriptorSetVirtualization.cpp HostVisibleMemoryVirtualization.cpp Resources.cpp Validation.cpp VulkanStreamGuest.cpp VulkanHandleMapping.cpp ResourceTracker.cpp VkEncoder.cpp goldfish_vk_extension_structs_guest.cpp goldfish_vk_marshaling_guest.cpp goldfish_vk_reserved_marshaling_guest.cpp goldfish_vk_deepcopy_guest.cpp goldfish_vk_counting_guest.cpp goldfish_vk_handlemap_guest.cpp goldfish_vk_transform_guest.cpp func_table.cpp)
+target_include_directories(vulkan_enc PRIVATE ${GOLDFISH_DEVICE_ROOT}/shared/GoldfishAddressSpace/include ${GOLDFISH_DEVICE_ROOT}/platform/include ${GOLDFISH_DEVICE_ROOT}/system/renderControl_enc ${GOLDFISH_DEVICE_ROOT}/shared/OpenglCodecCommon ${GOLDFISH_DEVICE_ROOT}/android-emu ${GOLDFISH_DEVICE_ROOT}/shared/qemupipe/include-types ${GOLDFISH_DEVICE_ROOT}/shared/qemupipe/include ${GOLDFISH_DEVICE_ROOT}/system/vulkan_enc ${GOLDFISH_DEVICE_ROOT}/./host/include/libOpenglRender ${GOLDFISH_DEVICE_ROOT}/./system/include ${GOLDFISH_DEVICE_ROOT}/./../../../external/qemu/android/android-emugl/guest ${GOLDFISH_DEVICE_ROOT}/./../../../hardware/google/gfxstream/common/vulkan/include)
+target_compile_definitions(vulkan_enc PRIVATE "-DPLATFORM_SDK_VERSION=29" "-DGOLDFISH_HIDL_GRALLOC" "-DHOST_BUILD" "-DANDROID" "-DGL_GLEXT_PROTOTYPES" "-DPAGE_SIZE=4096" "-DGFXSTREAM" "-DENABLE_ANDROID_HEALTH_MONITOR" "-DLOG_TAG=\"goldfish_vulkan\"" "-DVK_ANDROID_native_buffer" "-DVK_EXT_device_memory_report" "-DVK_GOOGLE_gfxstream" "-DVK_USE_PLATFORM_ANDROID_KHR" "-DVK_NO_PROTOTYPES" "-DVIRTIO_GPU" "-D__ANDROID_API__=28")
+target_compile_options(vulkan_enc PRIVATE "-fvisibility=default" "-Wno-unused-parameter" "-Wno-missing-field-initializers" "-Werror" "-fstrict-aliasing")
+target_link_libraries(vulkan_enc PRIVATE gui log android-emu-shared _renderControl_enc OpenglCodecCommon_host cutils utils androidemu PRIVATE GoldfishAddressSpace_host platform_host qemupipe_host)
\ No newline at end of file
diff --git a/system/vulkan_enc/CommandBufferStagingStream.cpp b/system/vulkan_enc/CommandBufferStagingStream.cpp
new file mode 100644
index 0000000..1f57387
--- /dev/null
+++ b/system/vulkan_enc/CommandBufferStagingStream.cpp
@@ -0,0 +1,257 @@
+/*
+* Copyright (C) 2021 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#include "CommandBufferStagingStream.h"
+
+#if PLATFORM_SDK_VERSION < 26
+#include <cutils/log.h>
+#else
+#include <log/log.h>
+#endif
+#include <cutils/properties.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <atomic>
+#include <vector>
+
+static const size_t kReadSize = 512 * 1024;
+static const size_t kWriteOffset = kReadSize;
+
+namespace gfxstream {
+namespace vk {
+
+CommandBufferStagingStream::CommandBufferStagingStream()
+    : IOStream(1048576), m_size(0), m_writePos(0) {
+    // use default allocators
+    m_alloc = [](size_t size) -> Memory {
+        return {
+            .deviceMemory = VK_NULL_HANDLE,  // no device memory for malloc
+            .ptr = malloc(size),
+        };
+    };
+    m_free = [](const Memory& mem) { free(mem.ptr); };
+    m_realloc = [](const Memory& mem, size_t size) -> Memory {
+        return {.deviceMemory = VK_NULL_HANDLE, .ptr = realloc(mem.ptr, size)};
+    };
+}
+
+CommandBufferStagingStream::CommandBufferStagingStream(const Alloc& allocFn, const Free& freeFn)
+    : CommandBufferStagingStream() {
+    m_usingCustomAlloc = true;
+    // for custom allocation, allocate metadata memory at the beginning.
+    // m_alloc, m_free and m_realloc wraps sync data logic
+
+    // \param size to allocate
+    // \return ptr starting at data
+    m_alloc = [&allocFn](size_t size) -> Memory {
+        // allocation requested size + sync data size
+
+        // <---sync bytes--><----Data--->
+        // |———————————————|————————————|
+        // |0|1|2|3|4|5|6|7|............|
+        // |———————————————|————————————|
+        // ꜛ               ꜛ
+        // allocated ptr   ptr to data [dataPtr]
+
+        Memory memory;
+        if (!allocFn) {
+            ALOGE("Custom allocation (%zu bytes) failed\n", size);
+            return memory;
+        }
+
+        // custom allocation/free requires metadata for sync between host/guest
+        const size_t totalSize = size + kSyncDataSize;
+        memory = allocFn(totalSize);
+        if (!memory.ptr) {
+            ALOGE("Custom allocation (%zu bytes) failed\n", size);
+            return memory;
+        }
+
+        // set sync data to read complete
+        uint32_t* syncDWordPtr = reinterpret_cast<uint32_t*>(memory.ptr);
+        __atomic_store_n(syncDWordPtr, kSyncDataReadComplete, __ATOMIC_RELEASE);
+        return memory;
+    };
+
+    m_free = [&freeFn](const Memory& mem) {
+        if (!freeFn) {
+            ALOGE("Custom free for memory(%p) failed\n", mem.ptr);
+            return;
+        }
+        freeFn(mem);
+    };
+
+    // \param ptr is the data pointer currently allocated
+    // \return dataPtr starting at data
+    m_realloc = [this](const Memory& mem, size_t size) -> Memory {
+        // realloc requires freeing previously allocated memory
+        // read sync DWORD to ensure host is done reading this memory
+        // before releasing it.
+
+        size_t hostWaits = 0;
+
+        uint32_t* syncDWordPtr = reinterpret_cast<uint32_t*>(mem.ptr);
+        while (__atomic_load_n(syncDWordPtr, __ATOMIC_ACQUIRE) != kSyncDataReadComplete) {
+            hostWaits++;
+            usleep(10);
+            if (hostWaits > 1000) {
+                ALOGD("%s: warning, stalled on host decoding on this command buffer stream\n",
+                      __func__);
+            }
+        }
+
+        // for custom allocation/free, memory holding metadata must be copied
+        // along with stream data
+        // <---sync bytes--><----Data--->
+        // |———————————————|————————————|
+        // |0|1|2|3|4|5|6|7|............|
+        // |———————————————|————————————|
+        // ꜛ               ꜛ
+        // [copyLocation]  ptr to data [ptr]
+
+        const size_t toCopySize = m_writePos + kSyncDataSize;
+        unsigned char* copyLocation = static_cast<unsigned char*>(mem.ptr);
+        std::vector<uint8_t> tmp(copyLocation, copyLocation + toCopySize);
+        m_free(mem);
+
+        // get new buffer and copy previous stream data to it
+        Memory newMemory = m_alloc(size);
+        unsigned char* newBuf = static_cast<unsigned char*>(newMemory.ptr);
+        if (!newBuf) {
+            ALOGE("Custom allocation (%zu bytes) failed\n", size);
+            return newMemory;
+        }
+        // copy previous data
+        memcpy(newBuf, tmp.data(), toCopySize);
+
+        return newMemory;
+    };
+}
+
+CommandBufferStagingStream::~CommandBufferStagingStream() {
+    flush();
+    if (m_mem.ptr) m_free(m_mem);
+}
+
+unsigned char* CommandBufferStagingStream::getDataPtr() {
+    if (!m_mem.ptr) return nullptr;
+    const size_t metadataSize = m_usingCustomAlloc ? kSyncDataSize : 0;
+    return static_cast<unsigned char*>(m_mem.ptr) + metadataSize;
+}
+
+void CommandBufferStagingStream::markFlushing() {
+    if (!m_usingCustomAlloc) {
+        return;
+    }
+    uint32_t* syncDWordPtr = reinterpret_cast<uint32_t*>(m_mem.ptr);
+    __atomic_store_n(syncDWordPtr, kSyncDataReadPending, __ATOMIC_RELEASE);
+}
+
+size_t CommandBufferStagingStream::idealAllocSize(size_t len) {
+    if (len > 1048576) return len;
+    return 1048576;
+}
+
+void* CommandBufferStagingStream::allocBuffer(size_t minSize) {
+    size_t allocSize = (1048576 < minSize ? minSize : 1048576);
+    // Initial case: blank
+    if (!m_mem.ptr) {
+        m_mem = m_alloc(allocSize);
+        m_size = allocSize;
+        return getDataPtr();
+    }
+
+    // Calculate remaining
+    size_t remaining = m_size - m_writePos;
+    // check if there is at least minSize bytes left in buffer
+    // if not, reallocate a buffer of big enough size
+    if (remaining < minSize) {
+        size_t newAllocSize = m_size * 2 + allocSize;
+        m_mem = m_realloc(m_mem, newAllocSize);
+        m_size = newAllocSize;
+
+        return (void*)(getDataPtr() + m_writePos);
+    }
+
+    // for custom allocations, host should have finished reading
+    // data from command buffer since command buffers are flushed
+    // on queue submit.
+    // allocBuffer should not be called on command buffers that are currently
+    // being read by the host
+    if (m_usingCustomAlloc) {
+        uint32_t* syncDWordPtr = reinterpret_cast<uint32_t*>(m_mem.ptr);
+        LOG_ALWAYS_FATAL_IF(
+            __atomic_load_n(syncDWordPtr, __ATOMIC_ACQUIRE) != kSyncDataReadComplete,
+            "FATAL: allocBuffer() called but previous read not complete");
+    }
+
+    return (void*)(getDataPtr() + m_writePos);
+}
+
+int CommandBufferStagingStream::commitBuffer(size_t size)
+{
+    m_writePos += size;
+    return 0;
+}
+
+const unsigned char *CommandBufferStagingStream::readFully(void*, size_t) {
+    // Not supported
+    ALOGE("CommandBufferStagingStream::%s: Fatal: not supported\n", __func__);
+    abort();
+    return nullptr;
+}
+
+const unsigned char *CommandBufferStagingStream::read(void*, size_t*) {
+    // Not supported
+    ALOGE("CommandBufferStagingStream::%s: Fatal: not supported\n", __func__);
+    abort();
+    return nullptr;
+}
+
+int CommandBufferStagingStream::writeFully(const void*, size_t)
+{
+    // Not supported
+    ALOGE("CommandBufferStagingStream::%s: Fatal: not supported\n", __func__);
+    abort();
+    return 0;
+}
+
+const unsigned char *CommandBufferStagingStream::commitBufferAndReadFully(
+    size_t, void *, size_t) {
+
+    // Not supported
+    ALOGE("CommandBufferStagingStream::%s: Fatal: not supported\n", __func__);
+    abort();
+    return nullptr;
+}
+
+void CommandBufferStagingStream::getWritten(unsigned char** bufOut, size_t* sizeOut) {
+    *bufOut = getDataPtr();
+    *sizeOut = m_writePos;
+}
+
+void CommandBufferStagingStream::reset() {
+    m_writePos = 0;
+    IOStream::rewind();
+}
+
+VkDeviceMemory CommandBufferStagingStream::getDeviceMemory() { return m_mem.deviceMemory; }
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/CommandBufferStagingStream.h b/system/vulkan_enc/CommandBufferStagingStream.h
new file mode 100644
index 0000000..9aa9e96
--- /dev/null
+++ b/system/vulkan_enc/CommandBufferStagingStream.h
@@ -0,0 +1,119 @@
+/*
+* Copyright (C) 2021 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#ifndef __COMMAND_BUFFER_STAGING_STREAM_H
+#define __COMMAND_BUFFER_STAGING_STREAM_H
+
+#include <vulkan/vulkan_core.h>
+
+#include <functional>
+
+#include "IOStream.h"
+
+namespace gfxstream {
+namespace vk {
+
+class CommandBufferStagingStream : public IOStream {
+public:
+ // host will write kSyncDataReadComplete to the sync bytes to indicate memory is no longer being
+ // used by host. This is only used with custom allocators. The sync bytes are used to ensure that,
+ // during reallocations the guest does not free memory being read by the host. The guest ensures
+ // that the sync bytes are marked as read complete before releasing the memory.
+ static constexpr size_t kSyncDataSize = 8;
+ // indicates read is complete
+ static constexpr uint32_t kSyncDataReadComplete = 0X0;
+ // indicates read is pending
+ static constexpr uint32_t kSyncDataReadPending = 0X1;
+
+ // \struct backing memory structure
+ struct Memory {
+     VkDeviceMemory deviceMemory =
+         VK_NULL_HANDLE;                   // device memory associated with allocated memory
+     void* ptr = nullptr;                  // pointer to allocated memory
+     bool operator==(const Memory& rhs) const {
+         return (deviceMemory == rhs.deviceMemory) && (ptr == rhs.ptr);
+     }
+ };
+
+ // allocator
+ // param size to allocate
+ // return allocated memory
+ using Alloc = std::function<Memory(size_t)>;
+ // free function
+ // param memory to free
+ using Free = std::function<void(const Memory&)>;
+ // constructor
+ // \param allocFn is the allocation function provided.
+ // \param freeFn is the free function provided
+ explicit CommandBufferStagingStream(const Alloc& allocFn, const Free& freeFn);
+ // constructor
+ explicit CommandBufferStagingStream();
+ ~CommandBufferStagingStream();
+
+ virtual size_t idealAllocSize(size_t len);
+ virtual void* allocBuffer(size_t minSize);
+ virtual int commitBuffer(size_t size);
+ virtual const unsigned char* readFully(void* buf, size_t len);
+ virtual const unsigned char* read(void* buf, size_t* inout_len);
+ virtual int writeFully(const void* buf, size_t len);
+ virtual const unsigned char* commitBufferAndReadFully(size_t size, void* buf, size_t len);
+
+ void getWritten(unsigned char** bufOut, size_t* sizeOut);
+ void reset();
+
+ // marks the command buffer stream as flushing. The owner of CommandBufferStagingStream
+ // should call markFlushing after finishing writing to the stream.
+ // This will mark the sync data to kSyncDataReadPending. This is only applicable when
+ // using custom allocators. markFlushing will be a no-op if called
+ // when not using custom allocators
+ void markFlushing();
+
+ // gets the device memory associated with the stream. This is VK_NULL_HANDLE for default allocation
+ // \return device memory
+ VkDeviceMemory getDeviceMemory();
+
+private:
+ // underlying memory for data
+ Memory m_mem;
+ // size of portion of memory available for data.
+ // for custom allocation, this size excludes size of sync data.
+ size_t m_size;
+ // current write position in data buffer
+ uint32_t m_writePos;
+
+ // alloc function
+ Alloc m_alloc;
+ // free function
+ Free m_free;
+
+ // realloc function
+ // \param size of memory to be allocated
+ // \ param reference size to update with actual size allocated. This size can be < requested size
+ // for custom allocation to account for sync data
+ using Realloc = std::function<Memory(const Memory&, size_t)>;
+ Realloc m_realloc;
+
+ // flag tracking use of custom allocation/free
+ bool m_usingCustomAlloc = false;
+
+ // adjusted memory location to point to start of data after accounting for metadata
+ // \return pointer to data start
+ unsigned char* getDataPtr();
+};
+
+}  // namespace vk
+}  // namespace gfxstream
+
+#endif
diff --git a/system/vulkan_enc/DescriptorSetVirtualization.cpp b/system/vulkan_enc/DescriptorSetVirtualization.cpp
new file mode 100644
index 0000000..0cc6826
--- /dev/null
+++ b/system/vulkan_enc/DescriptorSetVirtualization.cpp
@@ -0,0 +1,499 @@
+// Copyright (C) 2021 The Android Open Source Project
+// Copyright (C) 2021 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include "DescriptorSetVirtualization.h"
+#include "Resources.h"
+
+namespace gfxstream {
+namespace vk {
+
+void clearReifiedDescriptorSet(ReifiedDescriptorSet* set) {
+    set->pool = VK_NULL_HANDLE;
+    set->setLayout = VK_NULL_HANDLE;
+    set->poolId = -1;
+    set->allocationPending = false;
+    set->allWrites.clear();
+    set->pendingWriteArrayRanges.clear();
+}
+
+void initDescriptorWriteTable(const std::vector<VkDescriptorSetLayoutBinding>& layoutBindings, DescriptorWriteTable& table) {
+    uint32_t highestBindingNumber = 0;
+
+    for (uint32_t i = 0; i < layoutBindings.size(); ++i) {
+        if (layoutBindings[i].binding > highestBindingNumber) {
+            highestBindingNumber = layoutBindings[i].binding;
+        }
+    }
+
+    std::vector<uint32_t> countsEachBinding(highestBindingNumber + 1, 0);
+
+    for (uint32_t i = 0; i < layoutBindings.size(); ++i) {
+        countsEachBinding[layoutBindings[i].binding] =
+            layoutBindings[i].descriptorCount;
+    }
+
+    table.resize(countsEachBinding.size());
+
+    for (uint32_t i = 0; i < table.size(); ++i) {
+        table[i].resize(countsEachBinding[i]);
+
+        for (uint32_t j = 0; j < countsEachBinding[i]; ++j) {
+            table[i][j].type = DescriptorWriteType::Empty;
+            table[i][j].dstArrayElement = 0;
+        }
+    }
+}
+
+static void initializeReifiedDescriptorSet(VkDescriptorPool pool, VkDescriptorSetLayout setLayout, ReifiedDescriptorSet* set) {
+
+    set->pendingWriteArrayRanges.clear();
+
+    const auto& layoutInfo = *(as_goldfish_VkDescriptorSetLayout(setLayout)->layoutInfo);
+
+    initDescriptorWriteTable(layoutInfo.bindings, set->allWrites);
+
+    for (size_t i = 0; i < layoutInfo.bindings.size(); ++i) {
+        // Bindings can be sparsely defined
+        const auto& binding = layoutInfo.bindings[i];
+        uint32_t bindingIndex = binding.binding;
+        if (set->bindingIsImmutableSampler.size() <= bindingIndex) {
+            set->bindingIsImmutableSampler.resize(bindingIndex + 1, false);
+        }
+        set->bindingIsImmutableSampler[bindingIndex] =
+            binding.descriptorCount > 0 &&
+            (binding.descriptorType == VK_DESCRIPTOR_TYPE_SAMPLER ||
+             binding.descriptorType ==
+             VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER) &&
+            binding.pImmutableSamplers;
+    }
+
+    set->pool = pool;
+    set->setLayout = setLayout;
+    set->allocationPending = true;
+    set->bindings = layoutInfo.bindings;
+}
+
+bool isDescriptorTypeImageInfo(VkDescriptorType descType) {
+    return (descType == VK_DESCRIPTOR_TYPE_SAMPLER) ||
+           (descType == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER) ||
+           (descType == VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE) ||
+           (descType == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE) ||
+           (descType == VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT);
+}
+
+bool isDescriptorTypeBufferInfo(VkDescriptorType descType) {
+    return (descType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER) ||
+           (descType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC) ||
+           (descType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER) ||
+           (descType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC);
+}
+
+bool isDescriptorTypeBufferView(VkDescriptorType descType) {
+    return (descType == VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER) ||
+           (descType == VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER);
+}
+
+bool isDescriptorTypeInlineUniformBlock(VkDescriptorType descType) {
+    return descType == VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT;
+}
+
+bool isDescriptorTypeAccelerationStructure(VkDescriptorType descType) {
+    return descType == VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR;
+}
+
+void doEmulatedDescriptorWrite(const VkWriteDescriptorSet* write, ReifiedDescriptorSet* toWrite) {
+    VkDescriptorType descType = write->descriptorType;
+    uint32_t dstBinding = write->dstBinding;
+    uint32_t dstArrayElement = write->dstArrayElement;
+    uint32_t descriptorCount = write->descriptorCount;
+
+    DescriptorWriteTable& table = toWrite->allWrites;
+
+    uint32_t arrOffset = dstArrayElement;
+
+    if (isDescriptorTypeImageInfo(descType)) {
+        for (uint32_t i = 0; i < descriptorCount; ++i, ++arrOffset) {
+            if (arrOffset >= table[dstBinding].size()) {
+                ++dstBinding;
+                arrOffset = 0;
+            }
+            auto& entry = table[dstBinding][arrOffset];
+            entry.imageInfo = write->pImageInfo[i];
+            entry.type = DescriptorWriteType::ImageInfo;
+            entry.descriptorType = descType;
+        }
+    } else if (isDescriptorTypeBufferInfo(descType)) {
+        for (uint32_t i = 0; i < descriptorCount; ++i, ++arrOffset) {
+            if (arrOffset >= table[dstBinding].size()) {
+                ++dstBinding;
+                arrOffset = 0;
+            }
+            auto& entry = table[dstBinding][arrOffset];
+            entry.bufferInfo = write->pBufferInfo[i];
+            entry.type = DescriptorWriteType::BufferInfo;
+            entry.descriptorType = descType;
+        }
+    } else if (isDescriptorTypeBufferView(descType)) {
+        for (uint32_t i = 0; i < descriptorCount; ++i, ++arrOffset) {
+            if (arrOffset >= table[dstBinding].size()) {
+                ++dstBinding;
+                arrOffset = 0;
+            }
+            auto& entry = table[dstBinding][arrOffset];
+            entry.bufferView = write->pTexelBufferView[i];
+            entry.type = DescriptorWriteType::BufferView;
+            entry.descriptorType = descType;
+        }
+    } else if (isDescriptorTypeInlineUniformBlock(descType) ||
+               isDescriptorTypeAccelerationStructure(descType)) {
+        // TODO
+        // Look for pNext inline uniform block or acceleration structure.
+        // Append new DescriptorWrite entry that holds the buffer
+        ALOGW("%s: Ignoring emulated write for descriptor type 0x%x\n", __func__, descType);
+    }
+}
+
+void doEmulatedDescriptorCopy(const VkCopyDescriptorSet* copy, const ReifiedDescriptorSet* src, ReifiedDescriptorSet* dst) {
+    const DescriptorWriteTable& srcTable = src->allWrites;
+    DescriptorWriteTable& dstTable = dst->allWrites;
+
+    // src/dst may be the same descriptor set, so we need to create a temporary array for that case.
+    // (TODO: Maybe just notice the pointers are the same? can aliasing in any other way happen?)
+
+    std::vector<DescriptorWrite> toCopy;
+    uint32_t currBinding = copy->srcBinding;
+    uint32_t arrOffset = copy->srcArrayElement;
+    for (uint32_t i = 0; i < copy->descriptorCount; ++i, ++arrOffset) {
+        if (arrOffset >= srcTable[currBinding].size()) {
+            ++currBinding;
+            arrOffset = 0;
+        }
+        toCopy.push_back(srcTable[currBinding][arrOffset]);
+    }
+
+    currBinding = copy->dstBinding;
+    arrOffset = copy->dstArrayElement;
+    for (uint32_t i = 0; i < copy->descriptorCount; ++i, ++arrOffset) {
+        if (arrOffset >= dstTable[currBinding].size()) {
+            ++currBinding;
+            arrOffset = 0;
+        }
+        dstTable[currBinding][arrOffset] = toCopy[i];
+    }
+}
+
+void doEmulatedDescriptorImageInfoWriteFromTemplate(
+    VkDescriptorType descType,
+    uint32_t binding,
+    uint32_t dstArrayElement,
+    uint32_t count,
+    const VkDescriptorImageInfo* imageInfos,
+    ReifiedDescriptorSet* set) {
+
+    DescriptorWriteTable& table = set->allWrites;
+
+    uint32_t currBinding = binding;
+    uint32_t arrOffset = dstArrayElement;
+
+    for (uint32_t i = 0; i < count; ++i, ++arrOffset) {
+        if (arrOffset >= table[currBinding].size()) {
+            ++currBinding;
+            arrOffset = 0;
+        }
+        auto& entry = table[currBinding][arrOffset];
+        entry.imageInfo = imageInfos[i];
+        entry.type = DescriptorWriteType::ImageInfo;
+        entry.descriptorType = descType;
+    }
+}
+
+void doEmulatedDescriptorBufferInfoWriteFromTemplate(
+    VkDescriptorType descType,
+    uint32_t binding,
+    uint32_t dstArrayElement,
+    uint32_t count,
+    const VkDescriptorBufferInfo* bufferInfos,
+    ReifiedDescriptorSet* set) {
+
+    DescriptorWriteTable& table = set->allWrites;
+
+    uint32_t currBinding = binding;
+    uint32_t arrOffset = dstArrayElement;
+
+    for (uint32_t i = 0; i < count; ++i, ++arrOffset) {
+        if (arrOffset >= table[currBinding].size()) {
+            ++currBinding;
+            arrOffset = 0;
+        }
+        auto& entry = table[currBinding][dstArrayElement + i];
+        entry.bufferInfo = bufferInfos[i];
+        entry.type = DescriptorWriteType::BufferInfo;
+        entry.descriptorType = descType;
+    }
+}
+
+void doEmulatedDescriptorBufferViewWriteFromTemplate(
+    VkDescriptorType descType,
+    uint32_t binding,
+    uint32_t dstArrayElement,
+    uint32_t count,
+    const VkBufferView* bufferViews,
+    ReifiedDescriptorSet* set) {
+
+    DescriptorWriteTable& table = set->allWrites;
+
+    uint32_t currBinding = binding;
+    uint32_t arrOffset = dstArrayElement;
+
+    for (uint32_t i = 0; i < count; ++i, ++arrOffset) {
+        if (arrOffset >= table[currBinding].size()) {
+            ++currBinding;
+            arrOffset = 0;
+        }
+        auto& entry = table[currBinding][dstArrayElement + i];
+        entry.bufferView = bufferViews[i];
+        entry.type = DescriptorWriteType::BufferView;
+        entry.descriptorType = descType;
+    }
+}
+
+static bool isBindingFeasibleForAlloc(
+    const DescriptorPoolAllocationInfo::DescriptorCountInfo& countInfo,
+    const VkDescriptorSetLayoutBinding& binding) {
+
+    if (binding.descriptorCount && (countInfo.type != binding.descriptorType)) {
+        return false;
+    }
+
+    uint32_t availDescriptorCount =
+        countInfo.descriptorCount - countInfo.used;
+
+    if (availDescriptorCount < binding.descriptorCount) {
+        ALOGV("%s: Ran out of descriptors of type 0x%x. "
+              "Wanted %u from layout but "
+              "we only have %u free (total in pool: %u)\n", __func__,
+              binding.descriptorType,
+              binding.descriptorCount,
+              countInfo.descriptorCount - countInfo.used,
+              countInfo.descriptorCount);
+        return false;
+    }
+
+    return true;
+}
+
+static bool isBindingFeasibleForFree(
+    const DescriptorPoolAllocationInfo::DescriptorCountInfo& countInfo,
+    const VkDescriptorSetLayoutBinding& binding) {
+
+    if (countInfo.type != binding.descriptorType) return false;
+    if (countInfo.used < binding.descriptorCount) {
+        ALOGV("%s: Was a descriptor set double freed? "
+              "Ran out of descriptors of type 0x%x. "
+              "Wanted to free %u from layout but "
+              "we only have %u used (total in pool: %u)\n", __func__,
+              binding.descriptorType,
+              binding.descriptorCount,
+              countInfo.used,
+              countInfo.descriptorCount);
+        return false;
+    }
+    return true;
+}
+
+static void allocBindingFeasible(
+    const VkDescriptorSetLayoutBinding& binding,
+    DescriptorPoolAllocationInfo::DescriptorCountInfo& poolState) {
+    poolState.used += binding.descriptorCount;
+}
+
+static void freeBindingFeasible(
+    const VkDescriptorSetLayoutBinding& binding,
+    DescriptorPoolAllocationInfo::DescriptorCountInfo& poolState) {
+    poolState.used -= binding.descriptorCount;
+}
+
+static VkResult validateDescriptorSetAllocation(const VkDescriptorSetAllocateInfo* pAllocateInfo) {
+    VkDescriptorPool pool = pAllocateInfo->descriptorPool;
+    DescriptorPoolAllocationInfo* poolInfo = as_goldfish_VkDescriptorPool(pool)->allocInfo;
+
+    // Check the number of sets available.
+    auto setsAvailable = poolInfo->maxSets - poolInfo->usedSets;
+
+    if (setsAvailable < pAllocateInfo->descriptorSetCount) {
+        ALOGV("%s: Error: VkDescriptorSetAllocateInfo wants %u sets "
+              "but we only have %u available. "
+              "Bailing with VK_ERROR_OUT_OF_POOL_MEMORY.\n", __func__,
+              pAllocateInfo->descriptorSetCount,
+              setsAvailable);
+        return VK_ERROR_OUT_OF_POOL_MEMORY;
+    }
+
+    // Perform simulated allocation and error out with
+    // VK_ERROR_OUT_OF_POOL_MEMORY if it fails.
+    std::vector<DescriptorPoolAllocationInfo::DescriptorCountInfo> descriptorCountCopy =
+        poolInfo->descriptorCountInfo;
+
+    for (uint32_t i = 0; i < pAllocateInfo->descriptorSetCount; ++i) {
+        if (!pAllocateInfo->pSetLayouts[i]) {
+            ALOGV("%s: Error: Tried to allocate a descriptor set with null set layout.\n", __func__);
+            return VK_ERROR_INITIALIZATION_FAILED;
+        }
+
+        auto setLayoutInfo = as_goldfish_VkDescriptorSetLayout(pAllocateInfo->pSetLayouts[i])->layoutInfo;
+        if (!setLayoutInfo) {
+            return VK_ERROR_INITIALIZATION_FAILED;
+        }
+
+        for (const auto& binding : setLayoutInfo->bindings) {
+            bool success = false;
+            for (auto& pool : descriptorCountCopy) {
+                if (!isBindingFeasibleForAlloc(pool, binding)) continue;
+
+                success = true;
+                allocBindingFeasible(binding, pool);
+                break;
+            }
+
+            if (!success) {
+                return VK_ERROR_OUT_OF_POOL_MEMORY;
+            }
+        }
+    }
+    return VK_SUCCESS;
+}
+
+void applyDescriptorSetAllocation(VkDescriptorPool pool, VkDescriptorSetLayout setLayout) {
+    auto allocInfo = as_goldfish_VkDescriptorPool(pool)->allocInfo;
+    auto setLayoutInfo = as_goldfish_VkDescriptorSetLayout(setLayout)->layoutInfo;
+
+    ++allocInfo->usedSets;
+
+    for (const auto& binding : setLayoutInfo->bindings) {
+        for (auto& countForPool : allocInfo->descriptorCountInfo) {
+            if (!isBindingFeasibleForAlloc(countForPool, binding)) continue;
+            allocBindingFeasible(binding, countForPool);
+            break;
+        }
+    }
+}
+
+void removeDescriptorSetAllocation(VkDescriptorPool pool, const std::vector<VkDescriptorSetLayoutBinding>& bindings) {
+    auto allocInfo = as_goldfish_VkDescriptorPool(pool)->allocInfo;
+
+    if (0 == allocInfo->usedSets) {
+        ALOGV("%s: Warning: a descriptor set was double freed.\n", __func__);
+        return;
+    }
+
+    --allocInfo->usedSets;
+
+    for (const auto& binding : bindings) {
+        for (auto& countForPool : allocInfo->descriptorCountInfo) {
+            if (!isBindingFeasibleForFree(countForPool, binding)) continue;
+            freeBindingFeasible(binding, countForPool);
+            break;
+        }
+    }
+}
+
+void fillDescriptorSetInfoForPool(VkDescriptorPool pool, VkDescriptorSetLayout setLayout, VkDescriptorSet set) {
+    DescriptorPoolAllocationInfo* allocInfo = as_goldfish_VkDescriptorPool(pool)->allocInfo;
+
+    ReifiedDescriptorSet* newReified = new ReifiedDescriptorSet;
+    newReified->poolId = as_goldfish_VkDescriptorSet(set)->underlying;
+    newReified->allocationPending = true;
+
+    as_goldfish_VkDescriptorSet(set)->reified = newReified;
+
+    allocInfo->allocedPoolIds.insert(newReified->poolId);
+    allocInfo->allocedSets.insert(set);
+
+    initializeReifiedDescriptorSet(pool, setLayout, newReified);
+}
+
+VkResult validateAndApplyVirtualDescriptorSetAllocation(const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pSets) {
+    VkResult validateRes = validateDescriptorSetAllocation(pAllocateInfo);
+
+    if (validateRes != VK_SUCCESS) return validateRes;
+
+    for (uint32_t i = 0; i < pAllocateInfo->descriptorSetCount; ++i) {
+        applyDescriptorSetAllocation(pAllocateInfo->descriptorPool, pAllocateInfo->pSetLayouts[i]);
+    }
+
+    VkDescriptorPool pool = pAllocateInfo->descriptorPool;
+    DescriptorPoolAllocationInfo* allocInfo = as_goldfish_VkDescriptorPool(pool)->allocInfo;
+
+    if (allocInfo->freePoolIds.size() < pAllocateInfo->descriptorSetCount) {
+        ALOGE("%s: FATAL: Somehow out of descriptor pool IDs. Wanted %u IDs but only have %u free IDs remaining. The count for maxSets was %u and used was %u\n", __func__,
+                pAllocateInfo->descriptorSetCount,
+                (uint32_t)allocInfo->freePoolIds.size(),
+                allocInfo->maxSets,
+                allocInfo->usedSets);
+        abort();
+    }
+
+    for (uint32_t i = 0 ; i < pAllocateInfo->descriptorSetCount; ++i) {
+        uint64_t id = allocInfo->freePoolIds.back();
+        allocInfo->freePoolIds.pop_back();
+
+        VkDescriptorSet newSet = new_from_host_VkDescriptorSet((VkDescriptorSet)id);
+        pSets[i] = newSet;
+
+        fillDescriptorSetInfoForPool(pool, pAllocateInfo->pSetLayouts[i], newSet);
+    }
+
+    return VK_SUCCESS;
+}
+
+bool removeDescriptorSetFromPool(VkDescriptorSet set, bool usePoolIds) {
+    ReifiedDescriptorSet* reified = as_goldfish_VkDescriptorSet(set)->reified;
+
+    VkDescriptorPool pool = reified->pool;
+    DescriptorPoolAllocationInfo* allocInfo = as_goldfish_VkDescriptorPool(pool)->allocInfo;
+
+    if (usePoolIds) {
+        // Look for the set's pool Id in the pool. If not found, then this wasn't really allocated, and bail.
+        if (allocInfo->allocedPoolIds.find(reified->poolId) == allocInfo->allocedPoolIds.end()) {
+            return false;
+        }
+    }
+
+    const std::vector<VkDescriptorSetLayoutBinding>& bindings = reified->bindings;
+    removeDescriptorSetAllocation(pool, bindings);
+
+    if (usePoolIds) {
+        allocInfo->freePoolIds.push_back(reified->poolId);
+        allocInfo->allocedPoolIds.erase(reified->poolId);
+    }
+    allocInfo->allocedSets.erase(set);
+
+    return true;
+}
+
+std::vector<VkDescriptorSet> clearDescriptorPool(VkDescriptorPool pool, bool usePoolIds) {
+    std::vector<VkDescriptorSet> toClear;
+    for (auto set : as_goldfish_VkDescriptorPool(pool)->allocInfo->allocedSets) {
+        toClear.push_back(set);
+    }
+
+    for (auto set: toClear) {
+        removeDescriptorSetFromPool(set, usePoolIds);
+    }
+
+    return toClear;
+}
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/DescriptorSetVirtualization.h b/system/vulkan_enc/DescriptorSetVirtualization.h
new file mode 100644
index 0000000..15e4226
--- /dev/null
+++ b/system/vulkan_enc/DescriptorSetVirtualization.h
@@ -0,0 +1,153 @@
+// Copyright (C) 2021 The Android Open Source Project
+// Copyright (C) 2021 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#pragma once
+
+#include "aemu/base/containers/EntityManager.h"
+
+#include <vulkan/vulkan.h>
+
+#include <unordered_set>
+#include <vector>
+
+namespace gfxstream {
+namespace vk {
+
+enum DescriptorWriteType {
+    Empty = 0,
+    ImageInfo = 1,
+    BufferInfo = 2,
+    BufferView = 3,
+    InlineUniformBlock = 4,
+    AccelerationStructure = 5,
+};
+
+struct DescriptorWrite {
+    DescriptorWriteType type;
+    VkDescriptorType descriptorType;
+
+    uint32_t dstArrayElement; // Only used for inlineUniformBlock and accelerationStructure.
+
+    union {
+        VkDescriptorImageInfo imageInfo;
+        VkDescriptorBufferInfo bufferInfo;
+        VkBufferView bufferView;
+        VkWriteDescriptorSetInlineUniformBlockEXT inlineUniformBlock;
+        VkWriteDescriptorSetAccelerationStructureKHR accelerationStructure;
+    };
+
+    std::vector<uint8_t> inlineUniformBlockBuffer;
+};
+
+using DescriptorWriteTable = std::vector<std::vector<DescriptorWrite>>;
+
+struct DescriptorWriteArrayRange {
+    uint32_t begin;
+    uint32_t count;
+};
+
+using DescriptorWriteDstArrayRangeTable = std::vector<std::vector<DescriptorWriteArrayRange>>;
+
+struct ReifiedDescriptorSet {
+    VkDescriptorPool pool;
+    VkDescriptorSetLayout setLayout;
+    uint64_t poolId;
+    bool allocationPending;
+
+    // Indexed first by binding number
+    DescriptorWriteTable allWrites;
+
+    // Indexed first by binding number
+    DescriptorWriteDstArrayRangeTable pendingWriteArrayRanges;
+
+    // Indexed by binding number
+    std::vector<bool> bindingIsImmutableSampler;
+
+    // Copied from the descriptor set layout
+    std::vector<VkDescriptorSetLayoutBinding> bindings;
+};
+
+struct DescriptorPoolAllocationInfo {
+    VkDevice device;
+    VkDescriptorPoolCreateFlags createFlags;
+
+    // TODO: This should be in a single fancy data structure of some kind.
+    std::vector<uint64_t> freePoolIds;
+    std::unordered_set<uint32_t> allocedPoolIds;
+    std::unordered_set<VkDescriptorSet> allocedSets;
+    uint32_t maxSets;
+    uint32_t usedSets;
+
+    // Fine-grained tracking of descriptor counts in individual pools
+    struct DescriptorCountInfo {
+        VkDescriptorType type;
+        uint32_t descriptorCount;
+        uint32_t used;
+    };
+    std::vector<DescriptorCountInfo> descriptorCountInfo;
+};
+
+struct DescriptorSetLayoutInfo {
+    std::vector<VkDescriptorSetLayoutBinding> bindings;
+    uint32_t refcount;
+};
+
+void clearReifiedDescriptorSet(ReifiedDescriptorSet* set);
+
+void initDescriptorWriteTable(const std::vector<VkDescriptorSetLayoutBinding>& layoutBindings, DescriptorWriteTable& table);
+
+bool isDescriptorTypeImageInfo(VkDescriptorType descType);
+bool isDescriptorTypeBufferInfo(VkDescriptorType descType);
+bool isDescriptorTypeBufferView(VkDescriptorType descType);
+bool isDescriptorTypeInlineUniformBlock(VkDescriptorType descType);
+bool isDescriptorTypeAccelerationStructure(VkDescriptorType descType);
+
+void doEmulatedDescriptorWrite(const VkWriteDescriptorSet* write, ReifiedDescriptorSet* toWrite);
+void doEmulatedDescriptorCopy(const VkCopyDescriptorSet* copy, const ReifiedDescriptorSet* src, ReifiedDescriptorSet* dst);
+
+void doEmulatedDescriptorImageInfoWriteFromTemplate(
+    VkDescriptorType descType,
+    uint32_t binding,
+    uint32_t dstArrayElement,
+    uint32_t count,
+    const VkDescriptorImageInfo* imageInfos,
+    ReifiedDescriptorSet* set);
+
+void doEmulatedDescriptorBufferInfoWriteFromTemplate(
+    VkDescriptorType descType,
+    uint32_t binding,
+    uint32_t dstArrayElement,
+    uint32_t count,
+    const VkDescriptorBufferInfo* bufferInfos,
+    ReifiedDescriptorSet* set);
+
+void doEmulatedDescriptorBufferViewWriteFromTemplate(
+    VkDescriptorType descType,
+    uint32_t binding,
+    uint32_t dstArrayElement,
+    uint32_t count,
+    const VkBufferView* bufferViews,
+    ReifiedDescriptorSet* set);
+
+void applyDescriptorSetAllocation(VkDescriptorPool pool, VkDescriptorSetLayout setLayout);
+void fillDescriptorSetInfoForPool(VkDescriptorPool pool, VkDescriptorSetLayout setLayout, VkDescriptorSet set);
+VkResult validateAndApplyVirtualDescriptorSetAllocation(const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pSets);
+
+// Returns false if set wasn't found in its pool.
+bool removeDescriptorSetFromPool(VkDescriptorSet set, bool usePoolIds);
+
+std::vector<VkDescriptorSet> clearDescriptorPool(VkDescriptorPool pool, bool usePoolIds);
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/HostVisibleMemoryVirtualization.cpp b/system/vulkan_enc/HostVisibleMemoryVirtualization.cpp
new file mode 100644
index 0000000..5f3b23a
--- /dev/null
+++ b/system/vulkan_enc/HostVisibleMemoryVirtualization.cpp
@@ -0,0 +1,73 @@
+// Copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2018 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include "HostVisibleMemoryVirtualization.h"
+
+#include <log/log.h>
+
+#include <set>
+
+#include "../OpenglSystemCommon/EmulatorFeatureInfo.h"
+#include "ResourceTracker.h"
+#include "Resources.h"
+#include "VkEncoder.h"
+#include "aemu/base/AndroidSubAllocator.h"
+
+using android::base::guest::SubAllocator;
+
+namespace gfxstream {
+namespace vk {
+
+bool isHostVisible(const VkPhysicalDeviceMemoryProperties* memoryProps, uint32_t index) {
+    return memoryProps->memoryTypes[index].propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
+}
+
+CoherentMemory::CoherentMemory(VirtGpuBlobMappingPtr blobMapping, uint64_t size, VkDevice device,
+                               VkDeviceMemory memory)
+    : mSize(size), mBlobMapping(blobMapping), mDevice(device), mMemory(memory) {
+    mAllocator =
+        std::make_unique<android::base::guest::SubAllocator>(blobMapping->asRawPtr(), mSize, 4096);
+}
+
+CoherentMemory::CoherentMemory(GoldfishAddressSpaceBlockPtr block, uint64_t gpuAddr, uint64_t size,
+                               VkDevice device, VkDeviceMemory memory)
+    : mSize(size), mBlock(block), mDevice(device), mMemory(memory) {
+    void* address = block->mmap(gpuAddr);
+    mAllocator =
+        std::make_unique<android::base::guest::SubAllocator>(address, mSize, kLargestPageSize);
+}
+
+CoherentMemory::~CoherentMemory() {
+    ResourceTracker::getThreadLocalEncoder()->vkFreeMemorySyncGOOGLE(mDevice, mMemory, nullptr,
+                                                                     false);
+}
+
+VkDeviceMemory CoherentMemory::getDeviceMemory() const { return mMemory; }
+
+bool CoherentMemory::subAllocate(uint64_t size, uint8_t** ptr, uint64_t& offset) {
+    auto address = mAllocator->alloc(size);
+    if (!address) return false;
+
+    *ptr = (uint8_t*)address;
+    offset = mAllocator->getOffset(address);
+    return true;
+}
+
+bool CoherentMemory::release(uint8_t* ptr) {
+    mAllocator->free(ptr);
+    return true;
+}
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/HostVisibleMemoryVirtualization.h b/system/vulkan_enc/HostVisibleMemoryVirtualization.h
new file mode 100644
index 0000000..bd62386
--- /dev/null
+++ b/system/vulkan_enc/HostVisibleMemoryVirtualization.h
@@ -0,0 +1,70 @@
+// Copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2018 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#pragma once
+
+#include <vulkan/vulkan.h>
+
+#include "VirtGpu.h"
+#include "aemu/base/AndroidSubAllocator.h"
+#include "goldfish_address_space.h"
+
+constexpr uint64_t kMegaByte = 1048576;
+
+// This needs to be a power of 2 that is at least the min alignment needed
+// in HostVisibleMemoryVirtualization.cpp.
+// Some Windows drivers require a 64KB alignment for suballocated memory (b:152769369) for YUV
+// images.
+constexpr uint64_t kLargestPageSize = 65536;
+
+constexpr uint64_t kDefaultHostMemBlockSize = 16 * kMegaByte;  // 16 mb
+constexpr uint64_t kHostVisibleHeapSize = 512 * kMegaByte;     // 512 mb
+
+namespace gfxstream {
+namespace vk {
+
+bool isHostVisible(const VkPhysicalDeviceMemoryProperties* memoryProps, uint32_t index);
+
+using GoldfishAddressSpaceBlockPtr = std::shared_ptr<GoldfishAddressSpaceBlock>;
+using SubAllocatorPtr = std::unique_ptr<android::base::guest::SubAllocator>;
+
+class CoherentMemory {
+   public:
+    CoherentMemory(VirtGpuBlobMappingPtr blobMapping, uint64_t size, VkDevice device,
+                   VkDeviceMemory memory);
+    CoherentMemory(GoldfishAddressSpaceBlockPtr block, uint64_t gpuAddr, uint64_t size,
+                   VkDevice device, VkDeviceMemory memory);
+    ~CoherentMemory();
+
+    VkDeviceMemory getDeviceMemory() const;
+
+    bool subAllocate(uint64_t size, uint8_t** ptr, uint64_t& offset);
+    bool release(uint8_t* ptr);
+
+   private:
+    CoherentMemory(CoherentMemory const&);
+    void operator=(CoherentMemory const&);
+
+    uint64_t mSize;
+    VirtGpuBlobMappingPtr mBlobMapping = nullptr;
+    GoldfishAddressSpaceBlockPtr mBlock = nullptr;
+    VkDevice mDevice;
+    VkDeviceMemory mMemory;
+    SubAllocatorPtr mAllocator;
+};
+
+using CoherentMemoryPtr = std::shared_ptr<CoherentMemory>;
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/ResourceTracker.cpp b/system/vulkan_enc/ResourceTracker.cpp
new file mode 100644
index 0000000..f6dec28
--- /dev/null
+++ b/system/vulkan_enc/ResourceTracker.cpp
@@ -0,0 +1,8506 @@
+// Copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2018 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "ResourceTracker.h"
+
+#include "../OpenglSystemCommon/EmulatorFeatureInfo.h"
+#include "../OpenglSystemCommon/HostConnection.h"
+#include "CommandBufferStagingStream.h"
+#include "DescriptorSetVirtualization.h"
+#include "Resources.h"
+#include "aemu/base/Optional.h"
+#include "aemu/base/Tracing.h"
+#include "aemu/base/threads/AndroidWorkPool.h"
+#include "goldfish_vk_private_defs.h"
+#include "vulkan/vulkan_core.h"
+
+/// Use installed headers or locally defined Fuchsia-specific bits
+#ifdef VK_USE_PLATFORM_FUCHSIA
+
+#include <cutils/native_handle.h>
+#include <fidl/fuchsia.hardware.goldfish/cpp/wire.h>
+#include <fidl/fuchsia.sysmem/cpp/wire.h>
+#include <lib/zx/channel.h>
+#include <lib/zx/vmo.h>
+#include <optional>
+#include <zircon/errors.h>
+#include <zircon/process.h>
+#include <zircon/rights.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
+
+#include "services/service_connector.h"
+
+#ifndef FUCHSIA_NO_TRACE
+#include <lib/trace/event.h>
+#endif
+
+#define GET_STATUS_SAFE(result, member) \
+    ((result).ok() ? ((result)->member) : ZX_OK)
+
+#else
+
+typedef uint32_t zx_handle_t;
+typedef uint64_t zx_koid_t;
+#define ZX_HANDLE_INVALID         ((zx_handle_t)0)
+#define ZX_KOID_INVALID ((zx_koid_t)0)
+void zx_handle_close(zx_handle_t) { }
+void zx_event_create(int, zx_handle_t*) { }
+#endif // VK_USE_PLATFORM_FUCHSIA
+
+/// Use installed headers or locally defined Android-specific bits
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+
+/// Goldfish sync only used for AEMU -- should replace in virtio-gpu when possibe
+#include "../egl/goldfish_sync.h"
+#include "AndroidHardwareBuffer.h"
+
+#else
+
+#if defined(__linux__)
+#include "../egl/goldfish_sync.h"
+#endif
+
+#include <android/hardware_buffer.h>
+
+#endif // VK_USE_PLATFORM_ANDROID_KHR
+
+#include "HostVisibleMemoryVirtualization.h"
+#include "Resources.h"
+#include "VkEncoder.h"
+#include "aemu/base/AlignedBuf.h"
+#include "aemu/base/synchronization/AndroidLock.h"
+#include "goldfish_address_space.h"
+#include "goldfish_vk_private_defs.h"
+#include "util.h"
+#include "virtgpu_gfxstream_protocol.h"
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+#include "vk_format_info.h"
+#endif
+#include "vk_struct_id.h"
+#include "vk_util.h"
+
+#include <set>
+#include <string>
+#include <unordered_map>
+#include <unordered_set>
+
+#include <vndk/hardware_buffer.h>
+#include <log/log.h>
+#include <stdlib.h>
+#include <sync/sync.h>
+
+#if defined(__ANDROID__) || defined(__linux__) || defined(__APPLE__)
+
+#include <sys/mman.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+#ifdef HOST_BUILD
+#include "android/utils/tempfile.h"
+#endif
+
+static inline int
+inline_memfd_create(const char *name, unsigned int flags) {
+#ifdef HOST_BUILD
+    TempFile* tmpFile = tempfile_create();
+    return open(tempfile_path(tmpFile), O_RDWR);
+    // TODO: Windows is not suppose to support VkSemaphoreGetFdInfoKHR
+#else
+    return syscall(SYS_memfd_create, name, flags);
+#endif
+}
+
+#define memfd_create inline_memfd_create
+#endif
+
+#define RESOURCE_TRACKER_DEBUG 0
+
+#if RESOURCE_TRACKER_DEBUG
+#undef D
+#define D(fmt,...) ALOGD("%s: " fmt, __func__, ##__VA_ARGS__);
+#else
+#ifndef D
+#define D(fmt,...)
+#endif
+#endif
+
+using android::base::Optional;
+using android::base::guest::AutoLock;
+using android::base::guest::RecursiveLock;
+using android::base::guest::Lock;
+using android::base::guest::WorkPool;
+
+namespace gfxstream {
+namespace vk {
+
+#define MAKE_HANDLE_MAPPING_FOREACH(type_name, map_impl, map_to_u64_impl, map_from_u64_impl) \
+    void mapHandles_##type_name(type_name* handles, size_t count) override { \
+        for (size_t i = 0; i < count; ++i) { \
+            map_impl; \
+        } \
+    } \
+    void mapHandles_##type_name##_u64(const type_name* handles, uint64_t* handle_u64s, size_t count) override { \
+        for (size_t i = 0; i < count; ++i) { \
+            map_to_u64_impl; \
+        } \
+    } \
+    void mapHandles_u64_##type_name(const uint64_t* handle_u64s, type_name* handles, size_t count) override { \
+        for (size_t i = 0; i < count; ++i) { \
+            map_from_u64_impl; \
+        } \
+    } \
+
+#define DEFINE_RESOURCE_TRACKING_CLASS(class_name, impl) \
+class class_name : public VulkanHandleMapping { \
+public: \
+    virtual ~class_name() { } \
+    GOLDFISH_VK_LIST_HANDLE_TYPES(impl) \
+}; \
+
+#define CREATE_MAPPING_IMPL_FOR_TYPE(type_name) \
+    MAKE_HANDLE_MAPPING_FOREACH(type_name, \
+        handles[i] = new_from_host_##type_name(handles[i]); ResourceTracker::get()->register_##type_name(handles[i]);, \
+        handle_u64s[i] = (uint64_t)new_from_host_##type_name(handles[i]), \
+        handles[i] = (type_name)new_from_host_u64_##type_name(handle_u64s[i]); ResourceTracker::get()->register_##type_name(handles[i]);)
+
+#define UNWRAP_MAPPING_IMPL_FOR_TYPE(type_name) \
+    MAKE_HANDLE_MAPPING_FOREACH(type_name, \
+        handles[i] = get_host_##type_name(handles[i]), \
+        handle_u64s[i] = (uint64_t)get_host_u64_##type_name(handles[i]), \
+        handles[i] = (type_name)get_host_##type_name((type_name)handle_u64s[i]))
+
+#define DESTROY_MAPPING_IMPL_FOR_TYPE(type_name) \
+    MAKE_HANDLE_MAPPING_FOREACH(type_name, \
+        ResourceTracker::get()->unregister_##type_name(handles[i]); delete_goldfish_##type_name(handles[i]), \
+        (void)handle_u64s[i]; delete_goldfish_##type_name(handles[i]), \
+        (void)handles[i]; delete_goldfish_##type_name((type_name)handle_u64s[i]))
+
+DEFINE_RESOURCE_TRACKING_CLASS(CreateMapping, CREATE_MAPPING_IMPL_FOR_TYPE)
+DEFINE_RESOURCE_TRACKING_CLASS(UnwrapMapping, UNWRAP_MAPPING_IMPL_FOR_TYPE)
+DEFINE_RESOURCE_TRACKING_CLASS(DestroyMapping, DESTROY_MAPPING_IMPL_FOR_TYPE)
+
+static uint32_t* sSeqnoPtr = nullptr;
+
+// static
+uint32_t ResourceTracker::streamFeatureBits = 0;
+ResourceTracker::ThreadingCallbacks ResourceTracker::threadingCallbacks;
+
+struct StagingInfo {
+    Lock mLock;
+    std::vector<CommandBufferStagingStream*> streams;
+    std::vector<VkEncoder*> encoders;
+    /// \brief sets alloc and free callbacks for memory allocation for CommandBufferStagingStream(s)
+    /// \param allocFn is the callback to allocate memory
+    /// \param freeFn is the callback to free memory
+    void setAllocFree(CommandBufferStagingStream::Alloc&& allocFn,
+                      CommandBufferStagingStream::Free&& freeFn) {
+        mAlloc = allocFn;
+        mFree = freeFn;
+    }
+
+    ~StagingInfo() {
+        for (auto stream : streams) {
+            delete stream;
+        }
+
+        for (auto encoder : encoders) {
+            delete encoder;
+        }
+    }
+
+    void pushStaging(CommandBufferStagingStream* stream, VkEncoder* encoder) {
+        AutoLock<Lock> lock(mLock);
+        stream->reset();
+        streams.push_back(stream);
+        encoders.push_back(encoder);
+    }
+
+    void popStaging(CommandBufferStagingStream** streamOut, VkEncoder** encoderOut) {
+        AutoLock<Lock> lock(mLock);
+        CommandBufferStagingStream* stream;
+        VkEncoder* encoder;
+        if (streams.empty()) {
+            if (mAlloc && mFree) {
+                // if custom allocators are provided, forward them to CommandBufferStagingStream
+                stream = new CommandBufferStagingStream(mAlloc, mFree);
+            } else {
+                stream = new CommandBufferStagingStream;
+            }
+            encoder = new VkEncoder(stream);
+        } else {
+            stream = streams.back();
+            encoder = encoders.back();
+            streams.pop_back();
+            encoders.pop_back();
+        }
+        *streamOut = stream;
+        *encoderOut = encoder;
+    }
+
+   private:
+    CommandBufferStagingStream::Alloc mAlloc = nullptr;
+    CommandBufferStagingStream::Free mFree = nullptr;
+};
+
+static StagingInfo sStaging;
+
+class ResourceTracker::Impl {
+public:
+    Impl() = default;
+    CreateMapping createMapping;
+    UnwrapMapping unwrapMapping;
+    DestroyMapping destroyMapping;
+    DefaultHandleMapping defaultMapping;
+
+#define HANDLE_DEFINE_TRIVIAL_INFO_STRUCT(type) \
+    struct type##_Info { \
+        uint32_t unused; \
+    }; \
+
+    GOLDFISH_VK_LIST_TRIVIAL_HANDLE_TYPES(HANDLE_DEFINE_TRIVIAL_INFO_STRUCT)
+
+    struct VkInstance_Info {
+        uint32_t highestApiVersion;
+        std::set<std::string> enabledExtensions;
+        // Fodder for vkEnumeratePhysicalDevices.
+        std::vector<VkPhysicalDevice> physicalDevices;
+    };
+
+    struct VkDevice_Info {
+        VkPhysicalDevice physdev;
+        VkPhysicalDeviceProperties props;
+        VkPhysicalDeviceMemoryProperties memProps;
+        uint32_t apiVersion;
+        std::set<std::string> enabledExtensions;
+        std::vector<std::pair<PFN_vkDeviceMemoryReportCallbackEXT, void *>> deviceMemoryReportCallbacks;
+    };
+
+    struct VkDeviceMemory_Info {
+        bool dedicated = false;
+        bool imported = false;
+
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+        AHardwareBuffer* ahw = nullptr;
+#endif
+        zx_handle_t vmoHandle = ZX_HANDLE_INVALID;
+        VkDevice device;
+
+        uint8_t* ptr = nullptr;
+
+        uint64_t blobId = 0;
+        uint64_t allocationSize = 0;
+        uint32_t memoryTypeIndex = 0;
+        uint64_t coherentMemorySize = 0;
+        uint64_t coherentMemoryOffset = 0;
+
+        GoldfishAddressSpaceBlockPtr goldfishBlock = nullptr;
+        CoherentMemoryPtr coherentMemory = nullptr;
+    };
+
+    struct VkCommandBuffer_Info {
+        uint32_t placeholder;
+    };
+
+    struct VkQueue_Info {
+        VkDevice device;
+    };
+
+    // custom guest-side structs for images/buffers because of AHardwareBuffer :((
+    struct VkImage_Info {
+        VkDevice device;
+        VkImageCreateInfo createInfo;
+        bool external = false;
+        VkExternalMemoryImageCreateInfo externalCreateInfo;
+        VkDeviceMemory currentBacking = VK_NULL_HANDLE;
+        VkDeviceSize currentBackingOffset = 0;
+        VkDeviceSize currentBackingSize = 0;
+        bool baseRequirementsKnown = false;
+        VkMemoryRequirements baseRequirements;
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+        bool hasExternalFormat = false;
+        unsigned androidFormat = 0;
+        std::vector<int> pendingQsriSyncFds;
+#endif
+#ifdef VK_USE_PLATFORM_FUCHSIA
+        bool isSysmemBackedMemory = false;
+#endif
+    };
+
+    struct VkBuffer_Info {
+        VkDevice device;
+        VkBufferCreateInfo createInfo;
+        bool external = false;
+        VkExternalMemoryBufferCreateInfo externalCreateInfo;
+        VkDeviceMemory currentBacking = VK_NULL_HANDLE;
+        VkDeviceSize currentBackingOffset = 0;
+        VkDeviceSize currentBackingSize = 0;
+        bool baseRequirementsKnown = false;
+        VkMemoryRequirements baseRequirements;
+#ifdef VK_USE_PLATFORM_FUCHSIA
+        bool isSysmemBackedMemory = false;
+#endif
+    };
+
+    struct VkSemaphore_Info {
+        VkDevice device;
+        zx_handle_t eventHandle = ZX_HANDLE_INVALID;
+        zx_koid_t eventKoid = ZX_KOID_INVALID;
+        std::optional<int> syncFd = {};
+    };
+
+    struct VkDescriptorUpdateTemplate_Info {
+        uint32_t templateEntryCount = 0;
+        VkDescriptorUpdateTemplateEntry* templateEntries;
+
+        uint32_t imageInfoCount = 0;
+        uint32_t bufferInfoCount = 0;
+        uint32_t bufferViewCount = 0;
+        uint32_t* imageInfoIndices;
+        uint32_t* bufferInfoIndices;
+        uint32_t* bufferViewIndices;
+        VkDescriptorImageInfo* imageInfos;
+        VkDescriptorBufferInfo* bufferInfos;
+        VkBufferView* bufferViews;
+    };
+
+    struct VkFence_Info {
+        VkDevice device;
+        bool external = false;
+        VkExportFenceCreateInfo exportFenceCreateInfo;
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__)
+        int syncFd = -1;
+#endif
+    };
+
+    struct VkDescriptorPool_Info {
+        uint32_t unused;
+    };
+
+    struct VkDescriptorSet_Info {
+        uint32_t unused;
+    };
+
+    struct VkDescriptorSetLayout_Info {
+        uint32_t unused;
+    };
+
+    struct VkCommandPool_Info {
+        uint32_t unused;
+    };
+
+    struct VkSampler_Info {
+        uint32_t unused;
+    };
+
+    struct VkBufferCollectionFUCHSIA_Info {
+#ifdef VK_USE_PLATFORM_FUCHSIA
+        android::base::Optional<
+            fuchsia_sysmem::wire::BufferCollectionConstraints>
+            constraints;
+        android::base::Optional<VkBufferCollectionPropertiesFUCHSIA> properties;
+
+        // the index of corresponding createInfo for each image format
+        // constraints in |constraints|.
+        std::vector<uint32_t> createInfoIndex;
+#endif  // VK_USE_PLATFORM_FUCHSIA
+    };
+
+#define HANDLE_REGISTER_IMPL_IMPL(type) \
+    std::unordered_map<type, type##_Info> info_##type; \
+    void register_##type(type obj) { \
+        AutoLock<RecursiveLock> lock(mLock); \
+        info_##type[obj] = type##_Info(); \
+    } \
+
+#define HANDLE_UNREGISTER_IMPL_IMPL(type) \
+    void unregister_##type(type obj) { \
+        AutoLock<RecursiveLock> lock(mLock); \
+        info_##type.erase(obj); \
+    } \
+
+    GOLDFISH_VK_LIST_HANDLE_TYPES(HANDLE_REGISTER_IMPL_IMPL)
+    GOLDFISH_VK_LIST_TRIVIAL_HANDLE_TYPES(HANDLE_UNREGISTER_IMPL_IMPL)
+
+    void unregister_VkInstance(VkInstance instance) {
+        AutoLock<RecursiveLock> lock(mLock);
+
+        auto it = info_VkInstance.find(instance);
+        if (it == info_VkInstance.end()) return;
+        auto info = it->second;
+        info_VkInstance.erase(instance);
+        lock.unlock();
+    }
+
+    void unregister_VkDevice(VkDevice device) {
+        AutoLock<RecursiveLock> lock(mLock);
+
+        auto it = info_VkDevice.find(device);
+        if (it == info_VkDevice.end()) return;
+        auto info = it->second;
+        info_VkDevice.erase(device);
+        lock.unlock();
+    }
+
+    void unregister_VkCommandPool(VkCommandPool pool) {
+        if (!pool) return;
+
+        clearCommandPool(pool);
+
+        AutoLock<RecursiveLock> lock(mLock);
+        info_VkCommandPool.erase(pool);
+    }
+
+    void unregister_VkSampler(VkSampler sampler) {
+        if (!sampler) return;
+
+        AutoLock<RecursiveLock> lock(mLock);
+        info_VkSampler.erase(sampler);
+    }
+
+    void unregister_VkCommandBuffer(VkCommandBuffer commandBuffer) {
+        resetCommandBufferStagingInfo(commandBuffer, true /* also reset primaries */, true /* also clear pending descriptor sets */);
+
+        struct goldfish_VkCommandBuffer* cb = as_goldfish_VkCommandBuffer(commandBuffer);
+        if (!cb) return;
+        if (cb->lastUsedEncoder) { cb->lastUsedEncoder->decRef(); }
+        eraseObjects(&cb->subObjects);
+        forAllObjects(cb->poolObjects, [cb](void* commandPool) {
+            struct goldfish_VkCommandPool* p = as_goldfish_VkCommandPool((VkCommandPool)commandPool);
+            eraseObject(&p->subObjects, (void*)cb);
+        });
+        eraseObjects(&cb->poolObjects);
+
+        if (cb->userPtr) {
+            CommandBufferPendingDescriptorSets* pendingSets = (CommandBufferPendingDescriptorSets*)cb->userPtr;
+            delete pendingSets;
+        }
+
+        AutoLock<RecursiveLock> lock(mLock);
+        info_VkCommandBuffer.erase(commandBuffer);
+    }
+
+    void unregister_VkQueue(VkQueue queue) {
+        struct goldfish_VkQueue* q = as_goldfish_VkQueue(queue);
+        if (!q) return;
+        if (q->lastUsedEncoder) { q->lastUsedEncoder->decRef(); }
+
+        AutoLock<RecursiveLock> lock(mLock);
+        info_VkQueue.erase(queue);
+    }
+
+    void unregister_VkDeviceMemory(VkDeviceMemory mem) {
+        AutoLock<RecursiveLock> lock(mLock);
+
+        auto it = info_VkDeviceMemory.find(mem);
+        if (it == info_VkDeviceMemory.end()) return;
+
+        auto& memInfo = it->second;
+
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+        if (memInfo.ahw) {
+            AHardwareBuffer_release(memInfo.ahw);
+        }
+#endif
+
+        if (memInfo.vmoHandle != ZX_HANDLE_INVALID) {
+            zx_handle_close(memInfo.vmoHandle);
+        }
+
+        info_VkDeviceMemory.erase(mem);
+    }
+
+    void unregister_VkImage(VkImage img) {
+        AutoLock<RecursiveLock> lock(mLock);
+
+        auto it = info_VkImage.find(img);
+        if (it == info_VkImage.end()) return;
+
+        auto& imageInfo = it->second;
+
+        info_VkImage.erase(img);
+    }
+
+    void unregister_VkBuffer(VkBuffer buf) {
+        AutoLock<RecursiveLock> lock(mLock);
+
+        auto it = info_VkBuffer.find(buf);
+        if (it == info_VkBuffer.end()) return;
+
+        info_VkBuffer.erase(buf);
+    }
+
+    void unregister_VkSemaphore(VkSemaphore sem) {
+        AutoLock<RecursiveLock> lock(mLock);
+
+        auto it = info_VkSemaphore.find(sem);
+        if (it == info_VkSemaphore.end()) return;
+
+        auto& semInfo = it->second;
+
+        if (semInfo.eventHandle != ZX_HANDLE_INVALID) {
+            zx_handle_close(semInfo.eventHandle);
+        }
+
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__)
+        if (semInfo.syncFd.value_or(-1) >= 0) {
+            close(semInfo.syncFd.value());
+        }
+#endif
+
+        info_VkSemaphore.erase(sem);
+    }
+
+    void unregister_VkDescriptorUpdateTemplate(VkDescriptorUpdateTemplate templ) {
+
+        AutoLock<RecursiveLock> lock(mLock);
+        auto it = info_VkDescriptorUpdateTemplate.find(templ);
+        if (it == info_VkDescriptorUpdateTemplate.end())
+            return;
+
+        auto& info = it->second;
+        if (info.templateEntryCount) delete [] info.templateEntries;
+        if (info.imageInfoCount) {
+            delete [] info.imageInfoIndices;
+            delete [] info.imageInfos;
+        }
+        if (info.bufferInfoCount) {
+            delete [] info.bufferInfoIndices;
+            delete [] info.bufferInfos;
+        }
+        if (info.bufferViewCount) {
+            delete [] info.bufferViewIndices;
+            delete [] info.bufferViews;
+        }
+        info_VkDescriptorUpdateTemplate.erase(it);
+    }
+
+    void unregister_VkFence(VkFence fence) {
+        AutoLock<RecursiveLock> lock(mLock);
+        auto it = info_VkFence.find(fence);
+        if (it == info_VkFence.end()) return;
+
+        auto& fenceInfo = it->second;
+        (void)fenceInfo;
+
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__)
+        if (fenceInfo.syncFd >= 0) {
+            close(fenceInfo.syncFd);
+        }
+#endif
+
+        info_VkFence.erase(fence);
+    }
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+    void unregister_VkBufferCollectionFUCHSIA(
+        VkBufferCollectionFUCHSIA collection) {
+        AutoLock<RecursiveLock> lock(mLock);
+        info_VkBufferCollectionFUCHSIA.erase(collection);
+    }
+#endif
+
+    void unregister_VkDescriptorSet_locked(VkDescriptorSet set) {
+        struct goldfish_VkDescriptorSet* ds = as_goldfish_VkDescriptorSet(set);
+        delete ds->reified;
+        info_VkDescriptorSet.erase(set);
+    }
+
+    void unregister_VkDescriptorSet(VkDescriptorSet set) {
+        if (!set) return;
+
+        AutoLock<RecursiveLock> lock(mLock);
+        unregister_VkDescriptorSet_locked(set);
+    }
+
+    void unregister_VkDescriptorSetLayout(VkDescriptorSetLayout setLayout) {
+        if (!setLayout) return;
+
+        AutoLock<RecursiveLock> lock(mLock);
+        delete as_goldfish_VkDescriptorSetLayout(setLayout)->layoutInfo;
+        info_VkDescriptorSetLayout.erase(setLayout);
+    }
+
+    VkResult allocAndInitializeDescriptorSets(
+        void* context,
+        VkDevice device,
+        const VkDescriptorSetAllocateInfo* ci,
+        VkDescriptorSet* sets) {
+
+        if (mFeatureInfo->hasVulkanBatchedDescriptorSetUpdate) {
+            // Using the pool ID's we collected earlier from the host
+            VkResult poolAllocResult = validateAndApplyVirtualDescriptorSetAllocation(ci, sets);
+
+            if (poolAllocResult != VK_SUCCESS) return poolAllocResult;
+
+            for (uint32_t i = 0; i < ci->descriptorSetCount; ++i) {
+                register_VkDescriptorSet(sets[i]);
+                VkDescriptorSetLayout setLayout = as_goldfish_VkDescriptorSet(sets[i])->reified->setLayout;
+
+                // Need to add ref to the set layout in the virtual case
+                // because the set itself might not be realized on host at the
+                // same time
+                struct goldfish_VkDescriptorSetLayout* dsl = as_goldfish_VkDescriptorSetLayout(setLayout);
+                ++dsl->layoutInfo->refcount;
+            }
+        } else {
+            // Pass through and use host allocation
+            VkEncoder* enc = (VkEncoder*)context;
+            VkResult allocRes = enc->vkAllocateDescriptorSets(device, ci, sets, true /* do lock */);
+
+            if (allocRes != VK_SUCCESS) return allocRes;
+
+            for (uint32_t i = 0; i < ci->descriptorSetCount; ++i) {
+                applyDescriptorSetAllocation(ci->descriptorPool, ci->pSetLayouts[i]);
+                fillDescriptorSetInfoForPool(ci->descriptorPool, ci->pSetLayouts[i], sets[i]);
+            }
+        }
+
+        return VK_SUCCESS;
+    }
+
+    VkDescriptorImageInfo createImmutableSamplersFilteredImageInfo(
+        VkDescriptorType descType,
+        VkDescriptorSet descSet,
+        uint32_t binding,
+        const VkDescriptorImageInfo* pImageInfo) {
+
+        VkDescriptorImageInfo res = *pImageInfo;
+
+        if (descType != VK_DESCRIPTOR_TYPE_SAMPLER &&
+            descType != VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER) return res;
+
+        bool immutableSampler = as_goldfish_VkDescriptorSet(descSet)->reified->bindingIsImmutableSampler[binding];
+
+        if (!immutableSampler) return res;
+
+        res.sampler = 0;
+
+        return res;
+    }
+
+    bool descriptorBindingIsImmutableSampler(
+        VkDescriptorSet dstSet,
+        uint32_t dstBinding) {
+
+        return as_goldfish_VkDescriptorSet(dstSet)->reified->bindingIsImmutableSampler[dstBinding];
+    }
+
+    VkDescriptorImageInfo
+    filterNonexistentSampler(
+        const VkDescriptorImageInfo& inputInfo) {
+
+        VkSampler sampler =
+            inputInfo.sampler;
+
+        VkDescriptorImageInfo res = inputInfo;
+
+        if (sampler) {
+            auto it = info_VkSampler.find(sampler);
+            bool samplerExists = it != info_VkSampler.end();
+            if (!samplerExists) res.sampler = 0;
+        }
+
+        return res;
+    }
+
+
+    void freeDescriptorSetsIfHostAllocated(VkEncoder* enc, VkDevice device, uint32_t descriptorSetCount, const VkDescriptorSet* sets) {
+        for (uint32_t i = 0; i < descriptorSetCount; ++i) {
+            struct goldfish_VkDescriptorSet* ds = as_goldfish_VkDescriptorSet(sets[i]);
+            if (ds->reified->allocationPending) {
+                unregister_VkDescriptorSet(sets[i]);
+                delete_goldfish_VkDescriptorSet(sets[i]);
+            } else {
+                enc->vkFreeDescriptorSets(device, ds->reified->pool, 1, &sets[i], false /* no lock */);
+            }
+        }
+    }
+
+    void clearDescriptorPoolAndUnregisterDescriptorSets(void* context, VkDevice device, VkDescriptorPool pool) {
+
+        std::vector<VkDescriptorSet> toClear =
+            clearDescriptorPool(pool, mFeatureInfo->hasVulkanBatchedDescriptorSetUpdate);
+
+        for (auto set : toClear) {
+            if (mFeatureInfo->hasVulkanBatchedDescriptorSetUpdate) {
+                VkDescriptorSetLayout setLayout = as_goldfish_VkDescriptorSet(set)->reified->setLayout;
+                decDescriptorSetLayoutRef(context, device, setLayout, nullptr);
+            }
+            unregister_VkDescriptorSet(set);
+            delete_goldfish_VkDescriptorSet(set);
+        }
+    }
+
+    void unregister_VkDescriptorPool(VkDescriptorPool pool) {
+        if (!pool) return;
+
+        AutoLock<RecursiveLock> lock(mLock);
+
+        struct goldfish_VkDescriptorPool* dp = as_goldfish_VkDescriptorPool(pool);
+        delete dp->allocInfo;
+
+        info_VkDescriptorPool.erase(pool);
+    }
+
+    bool descriptorPoolSupportsIndividualFreeLocked(VkDescriptorPool pool) {
+        return as_goldfish_VkDescriptorPool(pool)->allocInfo->createFlags &
+            VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT;
+    }
+
+    static constexpr uint32_t kDefaultApiVersion = VK_MAKE_VERSION(1, 1, 0);
+
+    void setInstanceInfo(VkInstance instance,
+                         uint32_t enabledExtensionCount,
+                         const char* const* ppEnabledExtensionNames,
+                         uint32_t apiVersion) {
+        AutoLock<RecursiveLock> lock(mLock);
+        auto& info = info_VkInstance[instance];
+        info.highestApiVersion = apiVersion;
+
+        if (!ppEnabledExtensionNames) return;
+
+        for (uint32_t i = 0; i < enabledExtensionCount; ++i) {
+            info.enabledExtensions.insert(ppEnabledExtensionNames[i]);
+        }
+    }
+
+    void setDeviceInfo(VkDevice device,
+                       VkPhysicalDevice physdev,
+                       VkPhysicalDeviceProperties props,
+                       VkPhysicalDeviceMemoryProperties memProps,
+                       uint32_t enabledExtensionCount,
+                       const char* const* ppEnabledExtensionNames,
+                       const void* pNext) {
+        AutoLock<RecursiveLock> lock(mLock);
+        auto& info = info_VkDevice[device];
+        info.physdev = physdev;
+        info.props = props;
+        info.memProps = memProps;
+        info.apiVersion = props.apiVersion;
+
+        const VkBaseInStructure *extensionCreateInfo =
+            reinterpret_cast<const VkBaseInStructure *>(pNext);
+        while(extensionCreateInfo) {
+            if(extensionCreateInfo->sType
+                == VK_STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT) {
+                auto deviceMemoryReportCreateInfo =
+                    reinterpret_cast<const VkDeviceDeviceMemoryReportCreateInfoEXT *>(
+                        extensionCreateInfo);
+                if(deviceMemoryReportCreateInfo->pfnUserCallback != nullptr) {
+                    info.deviceMemoryReportCallbacks.emplace_back(
+                        deviceMemoryReportCreateInfo->pfnUserCallback,
+                        deviceMemoryReportCreateInfo->pUserData);
+                }
+            }
+            extensionCreateInfo = extensionCreateInfo->pNext;
+        }
+
+        if (!ppEnabledExtensionNames) return;
+
+        for (uint32_t i = 0; i < enabledExtensionCount; ++i) {
+            info.enabledExtensions.insert(ppEnabledExtensionNames[i]);
+        }
+    }
+
+    void emitDeviceMemoryReport(VkDevice_Info info,
+                                VkDeviceMemoryReportEventTypeEXT type,
+                                uint64_t memoryObjectId,
+                                VkDeviceSize size,
+                                VkObjectType objectType,
+                                uint64_t objectHandle,
+                                uint32_t heapIndex = 0) {
+        if(info.deviceMemoryReportCallbacks.empty()) return;
+
+        const VkDeviceMemoryReportCallbackDataEXT callbackData = {
+            VK_STRUCTURE_TYPE_DEVICE_MEMORY_REPORT_CALLBACK_DATA_EXT,  // sType
+            nullptr,                                                   // pNext
+            0,                                                         // flags
+            type,                                                      // type
+            memoryObjectId,                                            // memoryObjectId
+            size,                                                      // size
+            objectType,                                                // objectType
+            objectHandle,                                              // objectHandle
+            heapIndex,                                                 // heapIndex
+        };
+        for(const auto &callback : info.deviceMemoryReportCallbacks) {
+            callback.first(&callbackData, callback.second);
+        }
+    }
+
+    void setDeviceMemoryInfo(VkDevice device,
+                             VkDeviceMemory memory,
+                             VkDeviceSize allocationSize,
+                             uint8_t* ptr,
+                             uint32_t memoryTypeIndex,
+                             AHardwareBuffer* ahw = nullptr,
+                             bool imported = false,
+                             zx_handle_t vmoHandle = ZX_HANDLE_INVALID) {
+        AutoLock<RecursiveLock> lock(mLock);
+        auto& info = info_VkDeviceMemory[memory];
+
+        info.device = device;
+        info.allocationSize = allocationSize;
+        info.ptr = ptr;
+        info.memoryTypeIndex = memoryTypeIndex;
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+        info.ahw = ahw;
+#endif
+        info.imported = imported;
+        info.vmoHandle = vmoHandle;
+    }
+
+    void setImageInfo(VkImage image,
+                      VkDevice device,
+                      const VkImageCreateInfo *pCreateInfo) {
+        AutoLock<RecursiveLock> lock(mLock);
+        auto& info = info_VkImage[image];
+
+        info.device = device;
+        info.createInfo = *pCreateInfo;
+    }
+
+    uint8_t* getMappedPointer(VkDeviceMemory memory) {
+        AutoLock<RecursiveLock> lock(mLock);
+        const auto it = info_VkDeviceMemory.find(memory);
+        if (it == info_VkDeviceMemory.end()) return nullptr;
+
+        const auto& info = it->second;
+        return info.ptr;
+    }
+
+    VkDeviceSize getMappedSize(VkDeviceMemory memory) {
+        AutoLock<RecursiveLock> lock(mLock);
+        const auto it = info_VkDeviceMemory.find(memory);
+        if (it == info_VkDeviceMemory.end()) return 0;
+
+        const auto& info = it->second;
+        return info.allocationSize;
+    }
+
+    bool isValidMemoryRange(const VkMappedMemoryRange& range) const {
+        AutoLock<RecursiveLock> lock(mLock);
+        const auto it = info_VkDeviceMemory.find(range.memory);
+        if (it == info_VkDeviceMemory.end()) return false;
+        const auto& info = it->second;
+
+        if (!info.ptr) return false;
+
+        VkDeviceSize offset = range.offset;
+        VkDeviceSize size = range.size;
+
+        if (size == VK_WHOLE_SIZE) {
+            return offset <= info.allocationSize;
+        }
+
+        return offset + size <= info.allocationSize;
+    }
+
+    void setupCaps(void) {
+        VirtGpuDevice& instance = VirtGpuDevice::getInstance((enum VirtGpuCapset)3);
+        mCaps = instance.getCaps();
+
+        // Delete once goldfish Linux drivers are gone
+        if (mCaps.gfxstreamCapset.protocolVersion == 0) {
+            mCaps.gfxstreamCapset.colorBufferMemoryIndex = 0xFFFFFFFF;
+        }
+    }
+
+    void setupFeatures(const EmulatorFeatureInfo* features) {
+        if (!features || mFeatureInfo) return;
+        mFeatureInfo.reset(new EmulatorFeatureInfo);
+        *mFeatureInfo = *features;
+
+        if (mFeatureInfo->hasDirectMem) {
+            mGoldfishAddressSpaceBlockProvider.reset(
+                new GoldfishAddressSpaceBlockProvider(
+                    GoldfishAddressSpaceSubdeviceType::NoSubdevice));
+        }
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+        if (mFeatureInfo->hasVulkan) {
+            fidl::ClientEnd<fuchsia_hardware_goldfish::ControlDevice> channel{
+                zx::channel(GetConnectToServiceFunction()("/loader-gpu-devices/class/goldfish-control/000"))};
+            if (!channel) {
+                ALOGE("failed to open control device");
+                abort();
+            }
+            mControlDevice =
+                fidl::WireSyncClient<fuchsia_hardware_goldfish::ControlDevice>(
+                    std::move(channel));
+
+            fidl::ClientEnd<fuchsia_sysmem::Allocator> sysmem_channel{
+                zx::channel(GetConnectToServiceFunction()("/svc/fuchsia.sysmem.Allocator"))};
+            if (!sysmem_channel) {
+                ALOGE("failed to open sysmem connection");
+            }
+            mSysmemAllocator =
+                fidl::WireSyncClient<fuchsia_sysmem::Allocator>(
+                    std::move(sysmem_channel));
+            char name[ZX_MAX_NAME_LEN] = {};
+            zx_object_get_property(zx_process_self(), ZX_PROP_NAME, name, sizeof(name));
+            std::string client_name(name);
+            client_name += "-goldfish";
+            zx_info_handle_basic_t info;
+            zx_object_get_info(zx_process_self(), ZX_INFO_HANDLE_BASIC, &info, sizeof(info),
+                               nullptr, nullptr);
+            mSysmemAllocator->SetDebugClientInfo(fidl::StringView::FromExternal(client_name),
+                                                 info.koid);
+        }
+#endif
+
+        if (mFeatureInfo->hasVulkanNullOptionalStrings) {
+            ResourceTracker::streamFeatureBits |= VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT;
+        }
+        if (mFeatureInfo->hasVulkanIgnoredHandles) {
+            ResourceTracker::streamFeatureBits |= VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT;
+        }
+        if (mFeatureInfo->hasVulkanShaderFloat16Int8) {
+            ResourceTracker::streamFeatureBits |= VULKAN_STREAM_FEATURE_SHADER_FLOAT16_INT8_BIT;
+        }
+        if (mFeatureInfo->hasVulkanQueueSubmitWithCommands) {
+            ResourceTracker::streamFeatureBits |= VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+        }
+    }
+
+    void setThreadingCallbacks(const ResourceTracker::ThreadingCallbacks& callbacks) {
+        ResourceTracker::threadingCallbacks = callbacks;
+    }
+
+    bool hostSupportsVulkan() const {
+        if (!mFeatureInfo) return false;
+
+        return mFeatureInfo->hasVulkan;
+    }
+
+    bool usingDirectMapping() const {
+        return true;
+    }
+
+    uint32_t getStreamFeatures() const {
+        return ResourceTracker::streamFeatureBits;
+    }
+
+    bool supportsDeferredCommands() const {
+        if (!mFeatureInfo) return false;
+        return mFeatureInfo->hasDeferredVulkanCommands;
+    }
+
+    bool supportsAsyncQueueSubmit() const {
+        if (!mFeatureInfo) return false;
+        return mFeatureInfo->hasVulkanAsyncQueueSubmit;
+    }
+
+    bool supportsCreateResourcesWithRequirements() const {
+        if (!mFeatureInfo) return false;
+        return mFeatureInfo->hasVulkanCreateResourcesWithRequirements;
+    }
+
+    int getHostInstanceExtensionIndex(const std::string& extName) const {
+        int i = 0;
+        for (const auto& prop : mHostInstanceExtensions) {
+            if (extName == std::string(prop.extensionName)) {
+                return i;
+            }
+            ++i;
+        }
+        return -1;
+    }
+
+    int getHostDeviceExtensionIndex(const std::string& extName) const {
+        int i = 0;
+        for (const auto& prop : mHostDeviceExtensions) {
+            if (extName == std::string(prop.extensionName)) {
+                return i;
+            }
+            ++i;
+        }
+        return -1;
+    }
+
+    void deviceMemoryTransform_tohost(
+        VkDeviceMemory* memory, uint32_t memoryCount,
+        VkDeviceSize* offset, uint32_t offsetCount,
+        VkDeviceSize* size, uint32_t sizeCount,
+        uint32_t* typeIndex, uint32_t typeIndexCount,
+        uint32_t* typeBits, uint32_t typeBitsCount) {
+
+        (void)memoryCount;
+        (void)offsetCount;
+        (void)sizeCount;
+        (void)typeIndex;
+        (void)typeIndexCount;
+        (void)typeBits;
+        (void)typeBitsCount;
+
+        if (memory) {
+            AutoLock<RecursiveLock> lock (mLock);
+
+            for (uint32_t i = 0; i < memoryCount; ++i) {
+                VkDeviceMemory mem = memory[i];
+
+                auto it = info_VkDeviceMemory.find(mem);
+                if (it == info_VkDeviceMemory.end())
+                    return;
+
+                const auto& info = it->second;
+
+                if (!info.coherentMemory)
+                    continue;
+
+                memory[i] = info.coherentMemory->getDeviceMemory();
+
+                if (offset) {
+                    offset[i] = info.coherentMemoryOffset + offset[i];
+                }
+
+                if (size && size[i] == VK_WHOLE_SIZE) {
+                    size[i] = info.allocationSize;
+                }
+
+                // TODO
+                (void)memory;
+                (void)offset;
+                (void)size;
+            }
+        }
+    }
+
+    void deviceMemoryTransform_fromhost(
+        VkDeviceMemory* memory, uint32_t memoryCount,
+        VkDeviceSize* offset, uint32_t offsetCount,
+        VkDeviceSize* size, uint32_t sizeCount,
+        uint32_t* typeIndex, uint32_t typeIndexCount,
+        uint32_t* typeBits, uint32_t typeBitsCount) {
+
+        (void)memory;
+        (void)memoryCount;
+        (void)offset;
+        (void)offsetCount;
+        (void)size;
+        (void)sizeCount;
+        (void)typeIndex;
+        (void)typeIndexCount;
+        (void)typeBits;
+        (void)typeBitsCount;
+    }
+
+    void transformImpl_VkExternalMemoryProperties_fromhost(
+        VkExternalMemoryProperties* pProperties,
+        uint32_t) {
+        VkExternalMemoryHandleTypeFlags supportedHandleType = 0u;
+#ifdef VK_USE_PLATFORM_FUCHSIA
+        supportedHandleType |=
+                VK_EXTERNAL_MEMORY_HANDLE_TYPE_ZIRCON_VMO_BIT_FUCHSIA;
+#endif  // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+        supportedHandleType |=
+            VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT |
+            VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID;
+#endif  // VK_USE_PLATFORM_ANDROID_KHR
+        if (supportedHandleType) {
+            pProperties->compatibleHandleTypes &= supportedHandleType;
+            pProperties->exportFromImportedHandleTypes &= supportedHandleType;
+        }
+    }
+
+    VkResult on_vkEnumerateInstanceExtensionProperties(
+        void* context,
+        VkResult,
+        const char*,
+        uint32_t* pPropertyCount,
+        VkExtensionProperties* pProperties) {
+        std::vector<const char*> allowedExtensionNames = {
+            "VK_KHR_get_physical_device_properties2",
+            "VK_KHR_sampler_ycbcr_conversion",
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__)
+            "VK_KHR_external_semaphore_capabilities",
+            "VK_KHR_external_memory_capabilities",
+            "VK_KHR_external_fence_capabilities",
+#endif
+        };
+
+        VkEncoder* enc = (VkEncoder*)context;
+
+        // Only advertise a select set of extensions.
+        if (mHostInstanceExtensions.empty()) {
+            uint32_t hostPropCount = 0;
+            enc->vkEnumerateInstanceExtensionProperties(nullptr, &hostPropCount, nullptr, true /* do lock */);
+            mHostInstanceExtensions.resize(hostPropCount);
+
+            VkResult hostRes =
+                enc->vkEnumerateInstanceExtensionProperties(
+                    nullptr, &hostPropCount, mHostInstanceExtensions.data(), true /* do lock */);
+
+            if (hostRes != VK_SUCCESS) {
+                return hostRes;
+            }
+        }
+
+        std::vector<VkExtensionProperties> filteredExts;
+
+        for (size_t i = 0; i < allowedExtensionNames.size(); ++i) {
+            auto extIndex = getHostInstanceExtensionIndex(allowedExtensionNames[i]);
+            if (extIndex != -1) {
+                filteredExts.push_back(mHostInstanceExtensions[extIndex]);
+            }
+        }
+
+        VkExtensionProperties anbExtProps[] = {
+#ifdef VK_USE_PLATFORM_FUCHSIA
+            { "VK_KHR_external_memory_capabilities", 1},
+            { "VK_KHR_external_semaphore_capabilities", 1},
+#endif
+        };
+
+        for (auto& anbExtProp: anbExtProps) {
+            filteredExts.push_back(anbExtProp);
+        }
+
+        // Spec:
+        //
+        // https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkEnumerateInstanceExtensionProperties.html
+        //
+        // If pProperties is NULL, then the number of extensions properties
+        // available is returned in pPropertyCount. Otherwise, pPropertyCount
+        // must point to a variable set by the user to the number of elements
+        // in the pProperties array, and on return the variable is overwritten
+        // with the number of structures actually written to pProperties. If
+        // pPropertyCount is less than the number of extension properties
+        // available, at most pPropertyCount structures will be written. If
+        // pPropertyCount is smaller than the number of extensions available,
+        // VK_INCOMPLETE will be returned instead of VK_SUCCESS, to indicate
+        // that not all the available properties were returned.
+        //
+        // pPropertyCount must be a valid pointer to a uint32_t value
+        if (!pPropertyCount) return VK_ERROR_INITIALIZATION_FAILED;
+
+        if (!pProperties) {
+            *pPropertyCount = (uint32_t)filteredExts.size();
+            return VK_SUCCESS;
+        } else {
+            auto actualExtensionCount = (uint32_t)filteredExts.size();
+            if (*pPropertyCount > actualExtensionCount) {
+              *pPropertyCount = actualExtensionCount;
+            }
+
+            for (uint32_t i = 0; i < *pPropertyCount; ++i) {
+                pProperties[i] = filteredExts[i];
+            }
+
+            if (actualExtensionCount > *pPropertyCount) {
+                return VK_INCOMPLETE;
+            }
+
+            return VK_SUCCESS;
+        }
+    }
+
+    VkResult on_vkEnumerateDeviceExtensionProperties(
+        void* context,
+        VkResult,
+        VkPhysicalDevice physdev,
+        const char*,
+        uint32_t* pPropertyCount,
+        VkExtensionProperties* pProperties) {
+
+        std::vector<const char*> allowedExtensionNames = {
+            "VK_KHR_vulkan_memory_model",
+            "VK_KHR_buffer_device_address",
+            "VK_KHR_maintenance1",
+            "VK_KHR_maintenance2",
+            "VK_KHR_maintenance3",
+            "VK_KHR_bind_memory2",
+            "VK_KHR_dedicated_allocation",
+            "VK_KHR_get_memory_requirements2",
+            "VK_KHR_sampler_ycbcr_conversion",
+            "VK_KHR_shader_float16_int8",
+            // Timeline semaphores buggy in newer NVIDIA drivers
+            // (vkWaitSemaphoresKHR causes further vkCommandBuffer dispatches to deadlock)
+#ifndef VK_USE_PLATFORM_ANDROID_KHR
+            "VK_KHR_timeline_semaphore",
+#endif
+            "VK_AMD_gpu_shader_half_float",
+            "VK_NV_shader_subgroup_partitioned",
+            "VK_KHR_shader_subgroup_extended_types",
+            "VK_EXT_subgroup_size_control",
+            "VK_EXT_provoking_vertex",
+            "VK_EXT_line_rasterization",
+            "VK_KHR_shader_terminate_invocation",
+            "VK_EXT_transform_feedback",
+            "VK_EXT_primitive_topology_list_restart",
+            "VK_EXT_index_type_uint8",
+            "VK_EXT_load_store_op_none",
+            "VK_EXT_swapchain_colorspace",
+            "VK_EXT_image_robustness",
+            "VK_EXT_custom_border_color",
+            "VK_EXT_shader_stencil_export",
+            "VK_KHR_image_format_list",
+            "VK_KHR_incremental_present",
+            "VK_KHR_pipeline_executable_properties",
+            "VK_EXT_queue_family_foreign",
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__)
+            "VK_KHR_external_semaphore",
+            "VK_KHR_external_semaphore_fd",
+            // "VK_KHR_external_semaphore_win32", not exposed because it's translated to fd
+            "VK_KHR_external_memory",
+            "VK_KHR_external_fence",
+            "VK_KHR_external_fence_fd",
+            "VK_EXT_device_memory_report",
+#endif
+#if !defined(VK_USE_PLATFORM_ANDROID_KHR) && defined(__linux__)
+           "VK_KHR_create_renderpass2",
+           "VK_KHR_imageless_framebuffer",
+#endif
+        };
+
+        VkEncoder* enc = (VkEncoder*)context;
+
+        if (mHostDeviceExtensions.empty()) {
+            uint32_t hostPropCount = 0;
+            enc->vkEnumerateDeviceExtensionProperties(physdev, nullptr, &hostPropCount, nullptr, true /* do lock */);
+            mHostDeviceExtensions.resize(hostPropCount);
+
+            VkResult hostRes =
+                enc->vkEnumerateDeviceExtensionProperties(
+                    physdev, nullptr, &hostPropCount, mHostDeviceExtensions.data(), true /* do lock */);
+
+            if (hostRes != VK_SUCCESS) {
+                return hostRes;
+            }
+        }
+
+        bool hostHasWin32ExternalSemaphore =
+            getHostDeviceExtensionIndex(
+                "VK_KHR_external_semaphore_win32") != -1;
+
+        bool hostHasPosixExternalSemaphore =
+            getHostDeviceExtensionIndex(
+                "VK_KHR_external_semaphore_fd") != -1;
+
+        D("%s: host has ext semaphore? win32 %d posix %d\n", __func__,
+          hostHasWin32ExternalSemaphore,
+          hostHasPosixExternalSemaphore);
+
+        bool hostSupportsExternalSemaphore =
+            hostHasWin32ExternalSemaphore ||
+            hostHasPosixExternalSemaphore;
+
+        std::vector<VkExtensionProperties> filteredExts;
+
+        for (size_t i = 0; i < allowedExtensionNames.size(); ++i) {
+            auto extIndex = getHostDeviceExtensionIndex(allowedExtensionNames[i]);
+            if (extIndex != -1) {
+                filteredExts.push_back(mHostDeviceExtensions[extIndex]);
+            }
+        }
+
+        VkExtensionProperties anbExtProps[] = {
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+            { "VK_ANDROID_native_buffer", 7 },
+#endif
+#ifdef VK_USE_PLATFORM_FUCHSIA
+            { "VK_KHR_external_memory", 1 },
+            { "VK_KHR_external_semaphore", 1 },
+            { "VK_FUCHSIA_external_semaphore", 1 },
+#endif
+        };
+
+        for (auto& anbExtProp: anbExtProps) {
+            filteredExts.push_back(anbExtProp);
+        }
+
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__)
+        bool hostSupportsExternalFenceFd =
+            getHostDeviceExtensionIndex(
+                "VK_KHR_external_fence_fd") != -1;
+        if (!hostSupportsExternalFenceFd) {
+            filteredExts.push_back(
+                VkExtensionProperties { "VK_KHR_external_fence_fd", 1});
+        }
+#endif
+
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__)
+        if (hostSupportsExternalSemaphore &&
+            !hostHasPosixExternalSemaphore) {
+            filteredExts.push_back(
+                VkExtensionProperties { "VK_KHR_external_semaphore_fd", 1});
+        }
+#endif
+
+        bool win32ExtMemAvailable =
+            getHostDeviceExtensionIndex(
+                "VK_KHR_external_memory_win32") != -1;
+        bool posixExtMemAvailable =
+            getHostDeviceExtensionIndex(
+                "VK_KHR_external_memory_fd") != -1;
+        bool moltenVkExtAvailable =
+            getHostDeviceExtensionIndex(
+                "VK_MVK_moltenvk") != -1;
+
+        bool hostHasExternalMemorySupport =
+            win32ExtMemAvailable || posixExtMemAvailable || moltenVkExtAvailable;
+
+        if (hostHasExternalMemorySupport) {
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+            filteredExts.push_back(
+                VkExtensionProperties {
+                   "VK_ANDROID_external_memory_android_hardware_buffer", 7
+                });
+            filteredExts.push_back(
+                VkExtensionProperties { "VK_EXT_queue_family_foreign", 1 });
+#endif
+#ifdef VK_USE_PLATFORM_FUCHSIA
+            filteredExts.push_back(
+                VkExtensionProperties { "VK_FUCHSIA_external_memory", 1});
+            filteredExts.push_back(
+                VkExtensionProperties { "VK_FUCHSIA_buffer_collection", 1 });
+#endif
+#if !defined(VK_USE_PLATFORM_ANDROID_KHR) && defined(__linux__)
+            filteredExts.push_back(
+                VkExtensionProperties {
+                   "VK_KHR_external_memory_fd", 1
+                });
+            filteredExts.push_back(
+                VkExtensionProperties { "VK_EXT_external_memory_dma_buf", 1 });
+#endif
+        }
+
+        // Spec:
+        //
+        // https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkEnumerateDeviceExtensionProperties.html
+        //
+        // pPropertyCount is a pointer to an integer related to the number of
+        // extension properties available or queried, and is treated in the
+        // same fashion as the
+        // vkEnumerateInstanceExtensionProperties::pPropertyCount parameter.
+        //
+        // https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkEnumerateInstanceExtensionProperties.html
+        //
+        // If pProperties is NULL, then the number of extensions properties
+        // available is returned in pPropertyCount. Otherwise, pPropertyCount
+        // must point to a variable set by the user to the number of elements
+        // in the pProperties array, and on return the variable is overwritten
+        // with the number of structures actually written to pProperties. If
+        // pPropertyCount is less than the number of extension properties
+        // available, at most pPropertyCount structures will be written. If
+        // pPropertyCount is smaller than the number of extensions available,
+        // VK_INCOMPLETE will be returned instead of VK_SUCCESS, to indicate
+        // that not all the available properties were returned.
+        //
+        // pPropertyCount must be a valid pointer to a uint32_t value
+
+        if (!pPropertyCount) return VK_ERROR_INITIALIZATION_FAILED;
+
+        if (!pProperties) {
+            *pPropertyCount = (uint32_t)filteredExts.size();
+            return VK_SUCCESS;
+        } else {
+            auto actualExtensionCount = (uint32_t)filteredExts.size();
+            if (*pPropertyCount > actualExtensionCount) {
+              *pPropertyCount = actualExtensionCount;
+            }
+
+            for (uint32_t i = 0; i < *pPropertyCount; ++i) {
+                pProperties[i] = filteredExts[i];
+            }
+
+            if (actualExtensionCount > *pPropertyCount) {
+                return VK_INCOMPLETE;
+            }
+
+            return VK_SUCCESS;
+        }
+    }
+
+    VkResult on_vkEnumeratePhysicalDevices(
+        void* context, VkResult,
+        VkInstance instance, uint32_t* pPhysicalDeviceCount,
+        VkPhysicalDevice* pPhysicalDevices) {
+
+        VkEncoder* enc = (VkEncoder*)context;
+
+        if (!instance) return VK_ERROR_INITIALIZATION_FAILED;
+
+        if (!pPhysicalDeviceCount) return VK_ERROR_INITIALIZATION_FAILED;
+
+        AutoLock<RecursiveLock> lock(mLock);
+
+        // When this function is called, we actually need to do two things:
+        // - Get full information about physical devices from the host,
+        // even if the guest did not ask for it
+        // - Serve the guest query according to the spec:
+        //
+        // https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkEnumeratePhysicalDevices.html
+
+        auto it = info_VkInstance.find(instance);
+
+        if (it == info_VkInstance.end()) return VK_ERROR_INITIALIZATION_FAILED;
+
+        auto& info = it->second;
+
+        // Get the full host information here if it doesn't exist already.
+        if (info.physicalDevices.empty()) {
+            uint32_t hostPhysicalDeviceCount = 0;
+
+            lock.unlock();
+            VkResult countRes = enc->vkEnumeratePhysicalDevices(
+                instance, &hostPhysicalDeviceCount, nullptr, false /* no lock */);
+            lock.lock();
+
+            if (countRes != VK_SUCCESS) {
+                ALOGE("%s: failed: could not count host physical devices. "
+                      "Error %d\n", __func__, countRes);
+                return countRes;
+            }
+
+            info.physicalDevices.resize(hostPhysicalDeviceCount);
+
+            lock.unlock();
+            VkResult enumRes = enc->vkEnumeratePhysicalDevices(
+                instance, &hostPhysicalDeviceCount, info.physicalDevices.data(), false /* no lock */);
+            lock.lock();
+
+            if (enumRes != VK_SUCCESS) {
+                ALOGE("%s: failed: could not retrieve host physical devices. "
+                      "Error %d\n", __func__, enumRes);
+                return enumRes;
+            }
+        }
+
+        // Serve the guest query according to the spec.
+        //
+        // https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkEnumeratePhysicalDevices.html
+        //
+        // If pPhysicalDevices is NULL, then the number of physical devices
+        // available is returned in pPhysicalDeviceCount. Otherwise,
+        // pPhysicalDeviceCount must point to a variable set by the user to the
+        // number of elements in the pPhysicalDevices array, and on return the
+        // variable is overwritten with the number of handles actually written
+        // to pPhysicalDevices. If pPhysicalDeviceCount is less than the number
+        // of physical devices available, at most pPhysicalDeviceCount
+        // structures will be written.  If pPhysicalDeviceCount is smaller than
+        // the number of physical devices available, VK_INCOMPLETE will be
+        // returned instead of VK_SUCCESS, to indicate that not all the
+        // available physical devices were returned.
+
+        if (!pPhysicalDevices) {
+            *pPhysicalDeviceCount = (uint32_t)info.physicalDevices.size();
+            return VK_SUCCESS;
+        } else {
+            uint32_t actualDeviceCount = (uint32_t)info.physicalDevices.size();
+            uint32_t toWrite = actualDeviceCount < *pPhysicalDeviceCount ? actualDeviceCount : *pPhysicalDeviceCount;
+
+            for (uint32_t i = 0; i < toWrite; ++i) {
+                pPhysicalDevices[i] = info.physicalDevices[i];
+            }
+
+            *pPhysicalDeviceCount = toWrite;
+
+            if (actualDeviceCount > *pPhysicalDeviceCount) {
+                return VK_INCOMPLETE;
+            }
+
+            return VK_SUCCESS;
+        }
+    }
+
+    void on_vkGetPhysicalDeviceProperties(
+        void*,
+        VkPhysicalDevice,
+        VkPhysicalDeviceProperties* pProperties) {
+        if (pProperties) {
+            pProperties->deviceType = VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU;
+        }
+    }
+
+    void on_vkGetPhysicalDeviceFeatures2(
+        void*,
+        VkPhysicalDevice,
+        VkPhysicalDeviceFeatures2* pFeatures) {
+        if (pFeatures) {
+            VkPhysicalDeviceDeviceMemoryReportFeaturesEXT* memoryReportFeaturesEXT =
+                vk_find_struct<VkPhysicalDeviceDeviceMemoryReportFeaturesEXT>(pFeatures);
+            if (memoryReportFeaturesEXT) {
+                memoryReportFeaturesEXT->deviceMemoryReport = VK_TRUE;
+            }
+        }
+    }
+
+    void on_vkGetPhysicalDeviceProperties2(
+        void*,
+        VkPhysicalDevice,
+        VkPhysicalDeviceProperties2* pProperties) {
+        if (pProperties) {
+            pProperties->properties.deviceType =
+                VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU;
+
+            VkPhysicalDeviceDeviceMemoryReportFeaturesEXT* memoryReportFeaturesEXT =
+                vk_find_struct<VkPhysicalDeviceDeviceMemoryReportFeaturesEXT>(pProperties);
+            if (memoryReportFeaturesEXT) {
+                memoryReportFeaturesEXT->deviceMemoryReport = VK_TRUE;
+            }
+        }
+    }
+
+    void on_vkGetPhysicalDeviceMemoryProperties(
+        void* context,
+        VkPhysicalDevice physicalDevice,
+        VkPhysicalDeviceMemoryProperties* out) {
+        // gfxstream decides which physical device to expose to the guest on startup.
+        // Otherwise, we would need a physical device to properties mapping.
+        *out = getPhysicalDeviceMemoryProperties(context, VK_NULL_HANDLE, physicalDevice);
+    }
+
+    void on_vkGetPhysicalDeviceMemoryProperties2(
+        void*,
+        VkPhysicalDevice physdev,
+        VkPhysicalDeviceMemoryProperties2* out) {
+
+        on_vkGetPhysicalDeviceMemoryProperties(nullptr, physdev, &out->memoryProperties);
+    }
+
+    void on_vkGetDeviceQueue(void*,
+                             VkDevice device,
+                             uint32_t,
+                             uint32_t,
+                             VkQueue* pQueue) {
+        AutoLock<RecursiveLock> lock(mLock);
+        info_VkQueue[*pQueue].device = device;
+    }
+
+    void on_vkGetDeviceQueue2(void*,
+                              VkDevice device,
+                              const VkDeviceQueueInfo2*,
+                              VkQueue* pQueue) {
+        AutoLock<RecursiveLock> lock(mLock);
+        info_VkQueue[*pQueue].device = device;
+    }
+
+    VkResult on_vkCreateInstance(
+        void* context,
+        VkResult input_result,
+        const VkInstanceCreateInfo* createInfo,
+        const VkAllocationCallbacks*,
+        VkInstance* pInstance) {
+
+        if (input_result != VK_SUCCESS) return input_result;
+
+        VkEncoder* enc = (VkEncoder*)context;
+
+        uint32_t apiVersion;
+        VkResult enumInstanceVersionRes =
+            enc->vkEnumerateInstanceVersion(&apiVersion, false /* no lock */);
+
+        setInstanceInfo(
+            *pInstance,
+            createInfo->enabledExtensionCount,
+            createInfo->ppEnabledExtensionNames,
+            apiVersion);
+
+        return input_result;
+    }
+
+    VkResult on_vkCreateDevice(
+        void* context,
+        VkResult input_result,
+        VkPhysicalDevice physicalDevice,
+        const VkDeviceCreateInfo* pCreateInfo,
+        const VkAllocationCallbacks*,
+        VkDevice* pDevice) {
+
+        if (input_result != VK_SUCCESS) return input_result;
+
+        VkEncoder* enc = (VkEncoder*)context;
+
+        VkPhysicalDeviceProperties props;
+        VkPhysicalDeviceMemoryProperties memProps;
+        enc->vkGetPhysicalDeviceProperties(physicalDevice, &props, false /* no lock */);
+        enc->vkGetPhysicalDeviceMemoryProperties(physicalDevice, &memProps, false /* no lock */);
+
+        setDeviceInfo(
+            *pDevice, physicalDevice, props, memProps,
+            pCreateInfo->enabledExtensionCount, pCreateInfo->ppEnabledExtensionNames,
+            pCreateInfo->pNext);
+
+        return input_result;
+    }
+
+    void on_vkDestroyDevice_pre(
+        void* context,
+        VkDevice device,
+        const VkAllocationCallbacks*) {
+
+        (void)context;
+        AutoLock<RecursiveLock> lock(mLock);
+
+        auto it = info_VkDevice.find(device);
+        if (it == info_VkDevice.end()) return;
+
+        for (auto itr = info_VkDeviceMemory.cbegin() ; itr != info_VkDeviceMemory.cend(); ) {
+            auto& memInfo = itr->second;
+            if (memInfo.device == device) {
+                itr = info_VkDeviceMemory.erase(itr);
+            } else {
+                itr++;
+            }
+        }
+    }
+
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+    VkResult on_vkGetAndroidHardwareBufferPropertiesANDROID(
+            void* context, VkResult,
+            VkDevice device,
+            const AHardwareBuffer* buffer,
+            VkAndroidHardwareBufferPropertiesANDROID* pProperties) {
+        auto grallocHelper =
+            ResourceTracker::threadingCallbacks.hostConnectionGetFunc()->grallocHelper();
+
+        // Delete once goldfish Linux drivers are gone
+	if (mCaps.gfxstreamCapset.colorBufferMemoryIndex == 0xFFFFFFFF) {
+            const VkPhysicalDeviceMemoryProperties& memProps =
+                getPhysicalDeviceMemoryProperties(context, device, VK_NULL_HANDLE);
+
+            mCaps.gfxstreamCapset.colorBufferMemoryIndex =
+                (1u << memProps.memoryTypeCount) - 1;
+        }
+
+        updateMemoryTypeBits(&pProperties->memoryTypeBits,
+                             mCaps.gfxstreamCapset.colorBufferMemoryIndex);
+
+        return getAndroidHardwareBufferPropertiesANDROID(
+            grallocHelper, buffer, pProperties);
+    }
+
+    VkResult on_vkGetMemoryAndroidHardwareBufferANDROID(
+        void*, VkResult,
+        VkDevice device,
+        const VkMemoryGetAndroidHardwareBufferInfoANDROID *pInfo,
+        struct AHardwareBuffer** pBuffer) {
+
+        if (!pInfo) return VK_ERROR_INITIALIZATION_FAILED;
+        if (!pInfo->memory) return VK_ERROR_INITIALIZATION_FAILED;
+
+        AutoLock<RecursiveLock> lock(mLock);
+
+        auto deviceIt = info_VkDevice.find(device);
+
+        if (deviceIt == info_VkDevice.end()) {
+            return VK_ERROR_INITIALIZATION_FAILED;
+        }
+
+        auto memoryIt = info_VkDeviceMemory.find(pInfo->memory);
+
+        if (memoryIt == info_VkDeviceMemory.end()) {
+            return VK_ERROR_INITIALIZATION_FAILED;
+        }
+
+        auto& info = memoryIt->second;
+
+        VkResult queryRes =
+            getMemoryAndroidHardwareBufferANDROID(&info.ahw);
+
+        if (queryRes != VK_SUCCESS) return queryRes;
+
+        *pBuffer = info.ahw;
+
+        return queryRes;
+    }
+#endif
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+    VkResult on_vkGetMemoryZirconHandleFUCHSIA(
+        void*, VkResult,
+        VkDevice device,
+        const VkMemoryGetZirconHandleInfoFUCHSIA* pInfo,
+        uint32_t* pHandle) {
+
+        if (!pInfo) return VK_ERROR_INITIALIZATION_FAILED;
+        if (!pInfo->memory) return VK_ERROR_INITIALIZATION_FAILED;
+
+        AutoLock<RecursiveLock> lock(mLock);
+
+        auto deviceIt = info_VkDevice.find(device);
+
+        if (deviceIt == info_VkDevice.end()) {
+            return VK_ERROR_INITIALIZATION_FAILED;
+        }
+
+        auto memoryIt = info_VkDeviceMemory.find(pInfo->memory);
+
+        if (memoryIt == info_VkDeviceMemory.end()) {
+            return VK_ERROR_INITIALIZATION_FAILED;
+        }
+
+        auto& info = memoryIt->second;
+
+        if (info.vmoHandle == ZX_HANDLE_INVALID) {
+            ALOGE("%s: memory cannot be exported", __func__);
+            return VK_ERROR_INITIALIZATION_FAILED;
+        }
+
+        *pHandle = ZX_HANDLE_INVALID;
+        zx_handle_duplicate(info.vmoHandle, ZX_RIGHT_SAME_RIGHTS, pHandle);
+        return VK_SUCCESS;
+    }
+
+    VkResult on_vkGetMemoryZirconHandlePropertiesFUCHSIA(
+        void*, VkResult,
+        VkDevice device,
+        VkExternalMemoryHandleTypeFlagBits handleType,
+        uint32_t handle,
+        VkMemoryZirconHandlePropertiesFUCHSIA* pProperties) {
+        using fuchsia_hardware_goldfish::wire::kMemoryPropertyDeviceLocal;
+        using fuchsia_hardware_goldfish::wire::kMemoryPropertyHostVisible;
+
+        if (handleType !=
+            VK_EXTERNAL_MEMORY_HANDLE_TYPE_ZIRCON_VMO_BIT_FUCHSIA) {
+            return VK_ERROR_INITIALIZATION_FAILED;
+        }
+
+        zx_info_handle_basic_t handleInfo;
+        zx_status_t status = zx::unowned_vmo(handle)->get_info(
+            ZX_INFO_HANDLE_BASIC, &handleInfo, sizeof(handleInfo), nullptr,
+            nullptr);
+        if (status != ZX_OK || handleInfo.type != ZX_OBJ_TYPE_VMO) {
+            return VK_ERROR_INVALID_EXTERNAL_HANDLE;
+        }
+
+        AutoLock<RecursiveLock> lock(mLock);
+
+        auto deviceIt = info_VkDevice.find(device);
+
+        if (deviceIt == info_VkDevice.end()) {
+            return VK_ERROR_INITIALIZATION_FAILED;
+        }
+
+        auto& info = deviceIt->second;
+
+        zx::vmo vmo_dup;
+        status =
+            zx::unowned_vmo(handle)->duplicate(ZX_RIGHT_SAME_RIGHTS, &vmo_dup);
+        if (status != ZX_OK) {
+            ALOGE("zx_handle_duplicate() error: %d", status);
+            return VK_ERROR_INITIALIZATION_FAILED;
+        }
+
+        uint32_t memoryProperty = 0u;
+
+        auto result = mControlDevice->GetBufferHandleInfo(std::move(vmo_dup));
+        if (!result.ok()) {
+            ALOGE(
+                "mControlDevice->GetBufferHandleInfo fatal error: epitaph: %d",
+                result.status());
+            return VK_ERROR_INITIALIZATION_FAILED;
+        }
+        if (result.value().is_ok()) {
+            memoryProperty = result.value().value()->info.memory_property();
+        } else if (result.value().error_value() == ZX_ERR_NOT_FOUND) {
+            // If an VMO is allocated while ColorBuffer/Buffer is not created,
+            // it must be a device-local buffer, since for host-visible buffers,
+            // ColorBuffer/Buffer is created at sysmem allocation time.
+            memoryProperty = kMemoryPropertyDeviceLocal;
+        } else {
+            // Importing read-only host memory into the Vulkan driver should not
+            // work, but it is not an error to try to do so. Returning a
+            // VkMemoryZirconHandlePropertiesFUCHSIA with no available
+            // memoryType bits should be enough for clients. See fxbug.dev/24225
+            // for other issues this this flow.
+            ALOGW("GetBufferHandleInfo failed: %d", result.value().error_value());
+            pProperties->memoryTypeBits = 0;
+            return VK_SUCCESS;
+        }
+
+        pProperties->memoryTypeBits = 0;
+        for (uint32_t i = 0; i < info.memProps.memoryTypeCount; ++i) {
+            if (((memoryProperty & kMemoryPropertyDeviceLocal) &&
+                 (info.memProps.memoryTypes[i].propertyFlags &
+                  VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)) ||
+                ((memoryProperty & kMemoryPropertyHostVisible) &&
+                 (info.memProps.memoryTypes[i].propertyFlags &
+                  VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT))) {
+                pProperties->memoryTypeBits |= 1ull << i;
+            }
+        }
+        return VK_SUCCESS;
+    }
+
+    zx_koid_t getEventKoid(zx_handle_t eventHandle) {
+        if (eventHandle == ZX_HANDLE_INVALID) {
+            return ZX_KOID_INVALID;
+        }
+
+        zx_info_handle_basic_t info;
+        zx_status_t status =
+            zx_object_get_info(eventHandle, ZX_INFO_HANDLE_BASIC, &info,
+                               sizeof(info), nullptr, nullptr);
+        if (status != ZX_OK) {
+            ALOGE("Cannot get object info of handle %u: %d", eventHandle,
+                  status);
+            return ZX_KOID_INVALID;
+        }
+        return info.koid;
+    }
+
+    VkResult on_vkImportSemaphoreZirconHandleFUCHSIA(
+        void*, VkResult,
+        VkDevice device,
+        const VkImportSemaphoreZirconHandleInfoFUCHSIA* pInfo) {
+
+        if (!pInfo) return VK_ERROR_INITIALIZATION_FAILED;
+        if (!pInfo->semaphore) return VK_ERROR_INITIALIZATION_FAILED;
+
+        AutoLock<RecursiveLock> lock(mLock);
+
+        auto deviceIt = info_VkDevice.find(device);
+
+        if (deviceIt == info_VkDevice.end()) {
+            return VK_ERROR_INITIALIZATION_FAILED;
+        }
+
+        auto semaphoreIt = info_VkSemaphore.find(pInfo->semaphore);
+
+        if (semaphoreIt == info_VkSemaphore.end()) {
+            return VK_ERROR_INITIALIZATION_FAILED;
+        }
+
+        auto& info = semaphoreIt->second;
+
+        if (info.eventHandle != ZX_HANDLE_INVALID) {
+            zx_handle_close(info.eventHandle);
+        }
+#if VK_HEADER_VERSION < 174
+        info.eventHandle = pInfo->handle;
+#else // VK_HEADER_VERSION >= 174
+        info.eventHandle = pInfo->zirconHandle;
+#endif // VK_HEADER_VERSION < 174
+        if (info.eventHandle != ZX_HANDLE_INVALID) {
+            info.eventKoid = getEventKoid(info.eventHandle);
+        }
+
+        return VK_SUCCESS;
+    }
+
+    VkResult on_vkGetSemaphoreZirconHandleFUCHSIA(
+        void*, VkResult,
+        VkDevice device,
+        const VkSemaphoreGetZirconHandleInfoFUCHSIA* pInfo,
+        uint32_t* pHandle) {
+
+        if (!pInfo) return VK_ERROR_INITIALIZATION_FAILED;
+        if (!pInfo->semaphore) return VK_ERROR_INITIALIZATION_FAILED;
+
+        AutoLock<RecursiveLock> lock(mLock);
+
+        auto deviceIt = info_VkDevice.find(device);
+
+        if (deviceIt == info_VkDevice.end()) {
+            return VK_ERROR_INITIALIZATION_FAILED;
+        }
+
+        auto semaphoreIt = info_VkSemaphore.find(pInfo->semaphore);
+
+        if (semaphoreIt == info_VkSemaphore.end()) {
+            return VK_ERROR_INITIALIZATION_FAILED;
+        }
+
+        auto& info = semaphoreIt->second;
+
+        if (info.eventHandle == ZX_HANDLE_INVALID) {
+            return VK_ERROR_INITIALIZATION_FAILED;
+        }
+
+        *pHandle = ZX_HANDLE_INVALID;
+        zx_handle_duplicate(info.eventHandle, ZX_RIGHT_SAME_RIGHTS, pHandle);
+        return VK_SUCCESS;
+    }
+
+    VkResult on_vkCreateBufferCollectionFUCHSIA(
+        void*,
+        VkResult,
+        VkDevice,
+        const VkBufferCollectionCreateInfoFUCHSIA* pInfo,
+        const VkAllocationCallbacks*,
+        VkBufferCollectionFUCHSIA* pCollection) {
+        fidl::ClientEnd<::fuchsia_sysmem::BufferCollectionToken> token_client;
+
+        if (pInfo->collectionToken) {
+            token_client =
+                fidl::ClientEnd<::fuchsia_sysmem::BufferCollectionToken>(
+                    zx::channel(pInfo->collectionToken));
+        } else {
+            auto endpoints = fidl::CreateEndpoints<
+                ::fuchsia_sysmem::BufferCollectionToken>();
+            if (!endpoints.is_ok()) {
+                ALOGE("zx_channel_create failed: %d", endpoints.status_value());
+                return VK_ERROR_INITIALIZATION_FAILED;
+            }
+
+            auto result = mSysmemAllocator->AllocateSharedCollection(
+                std::move(endpoints->server));
+            if (!result.ok()) {
+                ALOGE("AllocateSharedCollection failed: %d", result.status());
+                return VK_ERROR_INITIALIZATION_FAILED;
+            }
+            token_client = std::move(endpoints->client);
+        }
+
+        auto endpoints =
+            fidl::CreateEndpoints<::fuchsia_sysmem::BufferCollection>();
+        if (!endpoints.is_ok()) {
+            ALOGE("zx_channel_create failed: %d", endpoints.status_value());
+            return VK_ERROR_INITIALIZATION_FAILED;
+        }
+        auto [collection_client, collection_server] =
+            std::move(endpoints.value());
+
+        auto result = mSysmemAllocator->BindSharedCollection(
+            std::move(token_client), std::move(collection_server));
+        if (!result.ok()) {
+            ALOGE("BindSharedCollection failed: %d", result.status());
+            return VK_ERROR_INITIALIZATION_FAILED;
+        }
+
+        auto* sysmem_collection =
+            new fidl::WireSyncClient<fuchsia_sysmem::BufferCollection>(
+                std::move(collection_client));
+        *pCollection =
+            reinterpret_cast<VkBufferCollectionFUCHSIA>(sysmem_collection);
+
+        register_VkBufferCollectionFUCHSIA(*pCollection);
+        return VK_SUCCESS;
+    }
+
+    void on_vkDestroyBufferCollectionFUCHSIA(
+        void*,
+        VkResult,
+        VkDevice,
+        VkBufferCollectionFUCHSIA collection,
+        const VkAllocationCallbacks*) {
+        auto sysmem_collection = reinterpret_cast<
+            fidl::WireSyncClient<fuchsia_sysmem::BufferCollection>*>(
+            collection);
+        if (sysmem_collection) {
+            (*sysmem_collection)->Close();
+        }
+        delete sysmem_collection;
+
+        unregister_VkBufferCollectionFUCHSIA(collection);
+    }
+
+    inline fuchsia_sysmem::wire::BufferCollectionConstraints
+    defaultBufferCollectionConstraints(
+        size_t minSizeBytes,
+        size_t minBufferCount,
+        size_t maxBufferCount = 0u,
+        size_t minBufferCountForCamping = 0u,
+        size_t minBufferCountForDedicatedSlack = 0u,
+        size_t minBufferCountForSharedSlack = 0u) {
+        fuchsia_sysmem::wire::BufferCollectionConstraints constraints = {};
+        constraints.min_buffer_count = minBufferCount;
+        if (maxBufferCount > 0) {
+            constraints.max_buffer_count = maxBufferCount;
+        }
+        if (minBufferCountForCamping) {
+            constraints.min_buffer_count_for_camping = minBufferCountForCamping;
+        }
+        if (minBufferCountForSharedSlack) {
+            constraints.min_buffer_count_for_shared_slack =
+                minBufferCountForSharedSlack;
+        }
+        constraints.has_buffer_memory_constraints = true;
+        fuchsia_sysmem::wire::BufferMemoryConstraints& buffer_constraints =
+            constraints.buffer_memory_constraints;
+
+        buffer_constraints.min_size_bytes = minSizeBytes;
+        buffer_constraints.max_size_bytes = 0xffffffff;
+        buffer_constraints.physically_contiguous_required = false;
+        buffer_constraints.secure_required = false;
+
+        // No restrictions on coherency domain or Heaps.
+        buffer_constraints.ram_domain_supported = true;
+        buffer_constraints.cpu_domain_supported = true;
+        buffer_constraints.inaccessible_domain_supported = true;
+        buffer_constraints.heap_permitted_count = 2;
+        buffer_constraints.heap_permitted[0] =
+            fuchsia_sysmem::wire::HeapType::kGoldfishDeviceLocal;
+        buffer_constraints.heap_permitted[1] =
+            fuchsia_sysmem::wire::HeapType::kGoldfishHostVisible;
+
+        return constraints;
+    }
+
+    uint32_t getBufferCollectionConstraintsVulkanImageUsage(
+        const VkImageCreateInfo* pImageInfo) {
+        uint32_t usage = 0u;
+        VkImageUsageFlags imageUsage = pImageInfo->usage;
+
+#define SetUsageBit(BIT, VALUE)                                           \
+    if (imageUsage & VK_IMAGE_USAGE_##BIT##_BIT) {                 \
+        usage |= fuchsia_sysmem::wire::kVulkanImageUsage##VALUE; \
+    }
+
+        SetUsageBit(COLOR_ATTACHMENT, ColorAttachment);
+        SetUsageBit(TRANSFER_SRC, TransferSrc);
+        SetUsageBit(TRANSFER_DST, TransferDst);
+        SetUsageBit(SAMPLED, Sampled);
+
+#undef SetUsageBit
+        return usage;
+    }
+
+    uint32_t getBufferCollectionConstraintsVulkanBufferUsage(
+        VkBufferUsageFlags bufferUsage) {
+        uint32_t usage = 0u;
+
+#define SetUsageBit(BIT, VALUE)                                            \
+    if (bufferUsage & VK_BUFFER_USAGE_##BIT##_BIT) {                \
+        usage |= fuchsia_sysmem::wire::kVulkanBufferUsage##VALUE; \
+    }
+
+        SetUsageBit(TRANSFER_SRC, TransferSrc);
+        SetUsageBit(TRANSFER_DST, TransferDst);
+        SetUsageBit(UNIFORM_TEXEL_BUFFER, UniformTexelBuffer);
+        SetUsageBit(STORAGE_TEXEL_BUFFER, StorageTexelBuffer);
+        SetUsageBit(UNIFORM_BUFFER, UniformBuffer);
+        SetUsageBit(STORAGE_BUFFER, StorageBuffer);
+        SetUsageBit(INDEX_BUFFER, IndexBuffer);
+        SetUsageBit(VERTEX_BUFFER, VertexBuffer);
+        SetUsageBit(INDIRECT_BUFFER, IndirectBuffer);
+
+#undef SetUsageBit
+        return usage;
+    }
+
+    uint32_t getBufferCollectionConstraintsVulkanBufferUsage(
+        const VkBufferConstraintsInfoFUCHSIA* pBufferConstraintsInfo) {
+        VkBufferUsageFlags bufferUsage =
+            pBufferConstraintsInfo->createInfo.usage;
+        return getBufferCollectionConstraintsVulkanBufferUsage(bufferUsage);
+    }
+
+    static fuchsia_sysmem::wire::PixelFormatType vkFormatTypeToSysmem(
+        VkFormat format) {
+        switch (format) {
+            case VK_FORMAT_B8G8R8A8_SINT:
+            case VK_FORMAT_B8G8R8A8_UNORM:
+            case VK_FORMAT_B8G8R8A8_SRGB:
+            case VK_FORMAT_B8G8R8A8_SNORM:
+            case VK_FORMAT_B8G8R8A8_SSCALED:
+            case VK_FORMAT_B8G8R8A8_USCALED:
+                return fuchsia_sysmem::wire::PixelFormatType::kBgra32;
+            case VK_FORMAT_R8G8B8A8_SINT:
+            case VK_FORMAT_R8G8B8A8_UNORM:
+            case VK_FORMAT_R8G8B8A8_SRGB:
+            case VK_FORMAT_R8G8B8A8_SNORM:
+            case VK_FORMAT_R8G8B8A8_SSCALED:
+            case VK_FORMAT_R8G8B8A8_USCALED:
+                return fuchsia_sysmem::wire::PixelFormatType::kR8G8B8A8;
+            case VK_FORMAT_R8_UNORM:
+            case VK_FORMAT_R8_UINT:
+            case VK_FORMAT_R8_USCALED:
+            case VK_FORMAT_R8_SNORM:
+            case VK_FORMAT_R8_SINT:
+            case VK_FORMAT_R8_SSCALED:
+            case VK_FORMAT_R8_SRGB:
+                return fuchsia_sysmem::wire::PixelFormatType::kR8;
+            case VK_FORMAT_R8G8_UNORM:
+            case VK_FORMAT_R8G8_UINT:
+            case VK_FORMAT_R8G8_USCALED:
+            case VK_FORMAT_R8G8_SNORM:
+            case VK_FORMAT_R8G8_SINT:
+            case VK_FORMAT_R8G8_SSCALED:
+            case VK_FORMAT_R8G8_SRGB:
+                return fuchsia_sysmem::wire::PixelFormatType::kR8G8;
+            default:
+                return fuchsia_sysmem::wire::PixelFormatType::kInvalid;
+        }
+    }
+
+    static bool vkFormatMatchesSysmemFormat(
+        VkFormat vkFormat,
+        fuchsia_sysmem::wire::PixelFormatType sysmemFormat) {
+        switch (vkFormat) {
+            case VK_FORMAT_B8G8R8A8_SINT:
+            case VK_FORMAT_B8G8R8A8_UNORM:
+            case VK_FORMAT_B8G8R8A8_SRGB:
+            case VK_FORMAT_B8G8R8A8_SNORM:
+            case VK_FORMAT_B8G8R8A8_SSCALED:
+            case VK_FORMAT_B8G8R8A8_USCALED:
+                return sysmemFormat ==
+                       fuchsia_sysmem::wire::PixelFormatType::kBgra32;
+            case VK_FORMAT_R8G8B8A8_SINT:
+            case VK_FORMAT_R8G8B8A8_UNORM:
+            case VK_FORMAT_R8G8B8A8_SRGB:
+            case VK_FORMAT_R8G8B8A8_SNORM:
+            case VK_FORMAT_R8G8B8A8_SSCALED:
+            case VK_FORMAT_R8G8B8A8_USCALED:
+                return sysmemFormat ==
+                       fuchsia_sysmem::wire::PixelFormatType::kR8G8B8A8;
+            case VK_FORMAT_R8_UNORM:
+            case VK_FORMAT_R8_UINT:
+            case VK_FORMAT_R8_USCALED:
+            case VK_FORMAT_R8_SNORM:
+            case VK_FORMAT_R8_SINT:
+            case VK_FORMAT_R8_SSCALED:
+            case VK_FORMAT_R8_SRGB:
+                return sysmemFormat ==
+                           fuchsia_sysmem::wire::PixelFormatType::kR8 ||
+                       sysmemFormat ==
+                           fuchsia_sysmem::wire::PixelFormatType::kL8;
+            case VK_FORMAT_R8G8_UNORM:
+            case VK_FORMAT_R8G8_UINT:
+            case VK_FORMAT_R8G8_USCALED:
+            case VK_FORMAT_R8G8_SNORM:
+            case VK_FORMAT_R8G8_SINT:
+            case VK_FORMAT_R8G8_SSCALED:
+            case VK_FORMAT_R8G8_SRGB:
+                return sysmemFormat ==
+                       fuchsia_sysmem::wire::PixelFormatType::kR8G8;
+            default:
+                return false;
+        }
+    }
+
+    static VkFormat sysmemPixelFormatTypeToVk(
+        fuchsia_sysmem::wire::PixelFormatType format) {
+        switch (format) {
+            case fuchsia_sysmem::wire::PixelFormatType::kBgra32:
+                return VK_FORMAT_B8G8R8A8_SRGB;
+            case fuchsia_sysmem::wire::PixelFormatType::kR8G8B8A8:
+                return VK_FORMAT_R8G8B8A8_SRGB;
+            case fuchsia_sysmem::wire::PixelFormatType::kL8:
+            case fuchsia_sysmem::wire::PixelFormatType::kR8:
+                return VK_FORMAT_R8_UNORM;
+            case fuchsia_sysmem::wire::PixelFormatType::kR8G8:
+                return VK_FORMAT_R8G8_UNORM;
+            default:
+                return VK_FORMAT_UNDEFINED;
+        }
+    }
+
+    // TODO(fxbug.dev/90856): This is currently only used for allocating
+    // memory for dedicated external images. It should be migrated to use
+    // SetBufferCollectionImageConstraintsFUCHSIA.
+    VkResult setBufferCollectionConstraintsFUCHSIA(
+        VkEncoder* enc,
+        VkDevice device,
+        fidl::WireSyncClient<fuchsia_sysmem::BufferCollection>* collection,
+        const VkImageCreateInfo* pImageInfo) {
+        if (pImageInfo == nullptr) {
+            ALOGE("setBufferCollectionConstraints: pImageInfo cannot be null.");
+            return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+        }
+
+        const VkSysmemColorSpaceFUCHSIA kDefaultColorSpace = {
+            .sType = VK_STRUCTURE_TYPE_SYSMEM_COLOR_SPACE_FUCHSIA,
+            .pNext = nullptr,
+            .colorSpace = static_cast<uint32_t>(
+                fuchsia_sysmem::wire::ColorSpaceType::kSrgb),
+        };
+
+        std::vector<VkImageFormatConstraintsInfoFUCHSIA> formatInfos;
+        if (pImageInfo->format == VK_FORMAT_UNDEFINED) {
+            const auto kFormats = {
+                VK_FORMAT_B8G8R8A8_SRGB,
+                VK_FORMAT_R8G8B8A8_SRGB,
+            };
+            for (auto format : kFormats) {
+                // shallow copy, using pNext from pImageInfo directly.
+                auto createInfo = *pImageInfo;
+                createInfo.format = format;
+                formatInfos.push_back(VkImageFormatConstraintsInfoFUCHSIA{
+                    .sType =
+                        VK_STRUCTURE_TYPE_IMAGE_FORMAT_CONSTRAINTS_INFO_FUCHSIA,
+                    .pNext = nullptr,
+                    .imageCreateInfo = createInfo,
+                    .colorSpaceCount = 1,
+                    .pColorSpaces = &kDefaultColorSpace,
+                });
+            }
+        } else {
+            formatInfos.push_back(VkImageFormatConstraintsInfoFUCHSIA{
+                .sType =
+                    VK_STRUCTURE_TYPE_IMAGE_FORMAT_CONSTRAINTS_INFO_FUCHSIA,
+                .pNext = nullptr,
+                .imageCreateInfo = *pImageInfo,
+                .colorSpaceCount = 1,
+                .pColorSpaces = &kDefaultColorSpace,
+            });
+        }
+
+        VkImageConstraintsInfoFUCHSIA imageConstraints = {
+            .sType = VK_STRUCTURE_TYPE_IMAGE_CONSTRAINTS_INFO_FUCHSIA,
+            .pNext = nullptr,
+            .formatConstraintsCount = static_cast<uint32_t>(formatInfos.size()),
+            .pFormatConstraints = formatInfos.data(),
+            .bufferCollectionConstraints =
+                VkBufferCollectionConstraintsInfoFUCHSIA{
+                    .sType =
+                        VK_STRUCTURE_TYPE_BUFFER_COLLECTION_CONSTRAINTS_INFO_FUCHSIA,
+                    .pNext = nullptr,
+                    .minBufferCount = 1,
+                    .maxBufferCount = 0,
+                    .minBufferCountForCamping = 0,
+                    .minBufferCountForDedicatedSlack = 0,
+                    .minBufferCountForSharedSlack = 0,
+                },
+            .flags = 0u,
+        };
+
+        return setBufferCollectionImageConstraintsFUCHSIA(
+            enc, device, collection, &imageConstraints);
+    }
+
+    VkResult addImageBufferCollectionConstraintsFUCHSIA(
+        VkEncoder* enc,
+        VkDevice device,
+        VkPhysicalDevice physicalDevice,
+        const VkImageFormatConstraintsInfoFUCHSIA*
+            formatConstraints,  // always non-zero
+        VkImageTiling tiling,
+        fuchsia_sysmem::wire::BufferCollectionConstraints* constraints) {
+        // First check if the format, tiling and usage is supported on host.
+        VkImageFormatProperties imageFormatProperties;
+        auto createInfo = &formatConstraints->imageCreateInfo;
+        auto result = enc->vkGetPhysicalDeviceImageFormatProperties(
+            physicalDevice, createInfo->format, createInfo->imageType, tiling,
+            createInfo->usage, createInfo->flags, &imageFormatProperties,
+            true /* do lock */);
+        if (result != VK_SUCCESS) {
+            ALOGD(
+                "%s: Image format (%u) type (%u) tiling (%u) "
+                "usage (%u) flags (%u) not supported by physical "
+                "device",
+                __func__, static_cast<uint32_t>(createInfo->format),
+                static_cast<uint32_t>(createInfo->imageType),
+                static_cast<uint32_t>(tiling),
+                static_cast<uint32_t>(createInfo->usage),
+                static_cast<uint32_t>(createInfo->flags));
+            return VK_ERROR_FORMAT_NOT_SUPPORTED;
+        }
+
+        // Check if format constraints contains unsupported format features.
+        {
+            VkFormatProperties formatProperties;
+            enc->vkGetPhysicalDeviceFormatProperties(
+                physicalDevice, createInfo->format, &formatProperties,
+                true /* do lock */);
+
+            auto supportedFeatures =
+                (tiling == VK_IMAGE_TILING_LINEAR)
+                    ? formatProperties.linearTilingFeatures
+                    : formatProperties.optimalTilingFeatures;
+            auto requiredFeatures = formatConstraints->requiredFormatFeatures;
+            if ((~supportedFeatures) & requiredFeatures) {
+                ALOGD(
+                    "%s: Host device support features for %s tiling: %08x, "
+                    "required features: %08x, feature bits %08x missing",
+                    __func__,
+                    tiling == VK_IMAGE_TILING_LINEAR ? "LINEAR" : "OPTIMAL",
+                    static_cast<uint32_t>(requiredFeatures),
+                    static_cast<uint32_t>(supportedFeatures),
+                    static_cast<uint32_t>((~supportedFeatures) &
+                                          requiredFeatures));
+                return VK_ERROR_FORMAT_NOT_SUPPORTED;
+            }
+        }
+
+        fuchsia_sysmem::wire::ImageFormatConstraints imageConstraints;
+        if (formatConstraints->sysmemPixelFormat != 0) {
+            auto pixelFormat =
+                static_cast<fuchsia_sysmem::wire::PixelFormatType>(
+                    formatConstraints->sysmemPixelFormat);
+            if (createInfo->format != VK_FORMAT_UNDEFINED &&
+                !vkFormatMatchesSysmemFormat(createInfo->format, pixelFormat)) {
+                ALOGD("%s: VkFormat %u doesn't match sysmem pixelFormat %lu",
+                      __func__, static_cast<uint32_t>(createInfo->format),
+                      formatConstraints->sysmemPixelFormat);
+                return VK_ERROR_FORMAT_NOT_SUPPORTED;
+            }
+            imageConstraints.pixel_format.type = pixelFormat;
+        } else {
+            auto pixel_format = vkFormatTypeToSysmem(createInfo->format);
+            if (pixel_format ==
+                fuchsia_sysmem::wire::PixelFormatType::kInvalid) {
+                ALOGD("%s: Unsupported VkFormat %u", __func__,
+                      static_cast<uint32_t>(createInfo->format));
+                return VK_ERROR_FORMAT_NOT_SUPPORTED;
+            }
+            imageConstraints.pixel_format.type = pixel_format;
+        }
+
+        imageConstraints.color_spaces_count =
+            formatConstraints->colorSpaceCount;
+        for (size_t i = 0; i < formatConstraints->colorSpaceCount; i++) {
+            imageConstraints.color_space[0].type =
+                static_cast<fuchsia_sysmem::wire::ColorSpaceType>(
+                    formatConstraints->pColorSpaces[i].colorSpace);
+        }
+
+        // Get row alignment from host GPU.
+        VkDeviceSize offset = 0;
+        VkDeviceSize rowPitchAlignment = 1u;
+
+        if (tiling == VK_IMAGE_TILING_LINEAR) {
+            VkImageCreateInfo createInfoDup = *createInfo;
+            createInfoDup.pNext = nullptr;
+            enc->vkGetLinearImageLayout2GOOGLE(device, &createInfoDup, &offset,
+                                            &rowPitchAlignment,
+                                            true /* do lock */);
+            D("vkGetLinearImageLayout2GOOGLE: format %d offset %lu "
+              "rowPitchAlignment = %lu",
+              (int)createInfo->format, offset, rowPitchAlignment);
+        }
+
+        imageConstraints.min_coded_width = createInfo->extent.width;
+        imageConstraints.max_coded_width = 0xfffffff;
+        imageConstraints.min_coded_height = createInfo->extent.height;
+        imageConstraints.max_coded_height = 0xffffffff;
+        // The min_bytes_per_row can be calculated by sysmem using
+        // |min_coded_width|, |bytes_per_row_divisor| and color format.
+        imageConstraints.min_bytes_per_row = 0;
+        imageConstraints.max_bytes_per_row = 0xffffffff;
+        imageConstraints.max_coded_width_times_coded_height = 0xffffffff;
+
+        imageConstraints.layers = 1;
+        imageConstraints.coded_width_divisor = 1;
+        imageConstraints.coded_height_divisor = 1;
+        imageConstraints.bytes_per_row_divisor = rowPitchAlignment;
+        imageConstraints.start_offset_divisor = 1;
+        imageConstraints.display_width_divisor = 1;
+        imageConstraints.display_height_divisor = 1;
+        imageConstraints.pixel_format.has_format_modifier = true;
+        imageConstraints.pixel_format.format_modifier.value =
+            (tiling == VK_IMAGE_TILING_LINEAR)
+                ? fuchsia_sysmem::wire::kFormatModifierLinear
+                : fuchsia_sysmem::wire::kFormatModifierGoogleGoldfishOptimal;
+
+        constraints->image_format_constraints
+            [constraints->image_format_constraints_count++] = imageConstraints;
+        return VK_SUCCESS;
+    }
+
+    struct SetBufferCollectionImageConstraintsResult {
+        VkResult result;
+        fuchsia_sysmem::wire::BufferCollectionConstraints constraints;
+        std::vector<uint32_t> createInfoIndex;
+    };
+
+    SetBufferCollectionImageConstraintsResult
+    setBufferCollectionImageConstraintsImpl(
+        VkEncoder* enc,
+        VkDevice device,
+        fidl::WireSyncClient<fuchsia_sysmem::BufferCollection>* pCollection,
+        const VkImageConstraintsInfoFUCHSIA* pImageConstraintsInfo) {
+        const auto& collection = *pCollection;
+        if (!pImageConstraintsInfo ||
+             pImageConstraintsInfo->sType !=
+                 VK_STRUCTURE_TYPE_IMAGE_CONSTRAINTS_INFO_FUCHSIA) {
+            ALOGE("%s: invalid pImageConstraintsInfo", __func__);
+            return {VK_ERROR_INITIALIZATION_FAILED};
+        }
+
+        if (pImageConstraintsInfo->formatConstraintsCount == 0) {
+            ALOGE("%s: formatConstraintsCount must be greater than 0",
+                  __func__);
+            abort();
+        }
+
+        fuchsia_sysmem::wire::BufferCollectionConstraints constraints =
+            defaultBufferCollectionConstraints(
+                /* min_size_bytes */ 0,
+                pImageConstraintsInfo->bufferCollectionConstraints
+                    .minBufferCount,
+                pImageConstraintsInfo->bufferCollectionConstraints
+                    .maxBufferCount,
+                pImageConstraintsInfo->bufferCollectionConstraints
+                    .minBufferCountForCamping,
+                pImageConstraintsInfo->bufferCollectionConstraints
+                    .minBufferCountForDedicatedSlack,
+                pImageConstraintsInfo->bufferCollectionConstraints
+                    .minBufferCountForSharedSlack);
+
+        std::vector<fuchsia_sysmem::wire::ImageFormatConstraints>
+            format_constraints;
+
+        VkPhysicalDevice physicalDevice;
+        {
+            AutoLock<RecursiveLock> lock(mLock);
+            auto deviceIt = info_VkDevice.find(device);
+            if (deviceIt == info_VkDevice.end()) {
+                return {VK_ERROR_INITIALIZATION_FAILED};
+            }
+            physicalDevice = deviceIt->second.physdev;
+        }
+
+        std::vector<uint32_t> createInfoIndex;
+
+        bool hasOptimalTiling = false;
+        for (uint32_t i = 0; i < pImageConstraintsInfo->formatConstraintsCount;
+             i++) {
+            const VkImageCreateInfo* createInfo =
+                &pImageConstraintsInfo->pFormatConstraints[i].imageCreateInfo;
+            const VkImageFormatConstraintsInfoFUCHSIA* formatConstraints =
+                &pImageConstraintsInfo->pFormatConstraints[i];
+
+            // add ImageFormatConstraints for *optimal* tiling
+            VkResult optimalResult = VK_ERROR_FORMAT_NOT_SUPPORTED;
+            if (createInfo->tiling == VK_IMAGE_TILING_OPTIMAL) {
+                optimalResult = addImageBufferCollectionConstraintsFUCHSIA(
+                    enc, device, physicalDevice, formatConstraints,
+                    VK_IMAGE_TILING_OPTIMAL, &constraints);
+                if (optimalResult == VK_SUCCESS) {
+                    createInfoIndex.push_back(i);
+                    hasOptimalTiling = true;
+                }
+            }
+
+            // Add ImageFormatConstraints for *linear* tiling
+            VkResult linearResult = addImageBufferCollectionConstraintsFUCHSIA(
+                enc, device, physicalDevice, formatConstraints,
+                VK_IMAGE_TILING_LINEAR, &constraints);
+            if (linearResult == VK_SUCCESS) {
+                createInfoIndex.push_back(i);
+            }
+
+            // Update usage and BufferMemoryConstraints
+            if (linearResult == VK_SUCCESS || optimalResult == VK_SUCCESS) {
+                constraints.usage.vulkan |=
+                    getBufferCollectionConstraintsVulkanImageUsage(createInfo);
+
+                if (formatConstraints && formatConstraints->flags) {
+                    ALOGW(
+                        "%s: Non-zero flags (%08x) in image format "
+                        "constraints; this is currently not supported, see "
+                        "fxbug.dev/68833.",
+                        __func__, formatConstraints->flags);
+                }
+            }
+        }
+
+        // Set buffer memory constraints based on optimal/linear tiling support
+        // and flags.
+        VkImageConstraintsInfoFlagsFUCHSIA flags = pImageConstraintsInfo->flags;
+        if (flags & VK_IMAGE_CONSTRAINTS_INFO_CPU_READ_RARELY_FUCHSIA)
+            constraints.usage.cpu |= fuchsia_sysmem::wire::kCpuUsageRead;
+        if (flags & VK_IMAGE_CONSTRAINTS_INFO_CPU_READ_OFTEN_FUCHSIA)
+            constraints.usage.cpu |= fuchsia_sysmem::wire::kCpuUsageReadOften;
+        if (flags & VK_IMAGE_CONSTRAINTS_INFO_CPU_WRITE_RARELY_FUCHSIA)
+            constraints.usage.cpu |= fuchsia_sysmem::wire::kCpuUsageWrite;
+        if (flags & VK_IMAGE_CONSTRAINTS_INFO_CPU_WRITE_OFTEN_FUCHSIA)
+            constraints.usage.cpu |= fuchsia_sysmem::wire::kCpuUsageWriteOften;
+
+        constraints.has_buffer_memory_constraints = true;
+        auto& memory_constraints = constraints.buffer_memory_constraints;
+        memory_constraints.cpu_domain_supported = true;
+        memory_constraints.ram_domain_supported = true;
+        memory_constraints.inaccessible_domain_supported =
+            hasOptimalTiling &&
+            !(flags & (VK_IMAGE_CONSTRAINTS_INFO_CPU_READ_RARELY_FUCHSIA |
+                       VK_IMAGE_CONSTRAINTS_INFO_CPU_READ_OFTEN_FUCHSIA |
+                       VK_IMAGE_CONSTRAINTS_INFO_CPU_WRITE_RARELY_FUCHSIA |
+                       VK_IMAGE_CONSTRAINTS_INFO_CPU_WRITE_OFTEN_FUCHSIA));
+
+        if (memory_constraints.inaccessible_domain_supported) {
+            memory_constraints.heap_permitted_count = 2;
+            memory_constraints.heap_permitted[0] =
+                fuchsia_sysmem::wire::HeapType::kGoldfishDeviceLocal;
+            memory_constraints.heap_permitted[1] =
+                fuchsia_sysmem::wire::HeapType::kGoldfishHostVisible;
+        } else {
+            memory_constraints.heap_permitted_count = 1;
+            memory_constraints.heap_permitted[0] =
+                fuchsia_sysmem::wire::HeapType::kGoldfishHostVisible;
+        }
+
+        if (constraints.image_format_constraints_count == 0) {
+            ALOGE("%s: none of the specified formats is supported by device",
+                  __func__);
+            return {VK_ERROR_FORMAT_NOT_SUPPORTED};
+        }
+
+        constexpr uint32_t kVulkanPriority = 5;
+        const char kName[] = "GoldfishSysmemShared";
+        collection->SetName(kVulkanPriority, fidl::StringView(kName));
+
+        auto result = collection->SetConstraints(true, constraints);
+        if (!result.ok()) {
+            ALOGE("setBufferCollectionConstraints: SetConstraints failed: %d",
+                  result.status());
+            return {VK_ERROR_INITIALIZATION_FAILED};
+        }
+
+        return {VK_SUCCESS, constraints, std::move(createInfoIndex)};
+    }
+
+    VkResult setBufferCollectionImageConstraintsFUCHSIA(
+        VkEncoder* enc,
+        VkDevice device,
+        fidl::WireSyncClient<fuchsia_sysmem::BufferCollection>* pCollection,
+        const VkImageConstraintsInfoFUCHSIA* pImageConstraintsInfo) {
+        const auto& collection = *pCollection;
+
+        auto setConstraintsResult = setBufferCollectionImageConstraintsImpl(
+            enc, device, pCollection, pImageConstraintsInfo);
+        if (setConstraintsResult.result != VK_SUCCESS) {
+            return setConstraintsResult.result;
+        }
+
+        // copy constraints to info_VkBufferCollectionFUCHSIA if
+        // |collection| is a valid VkBufferCollectionFUCHSIA handle.
+        AutoLock<RecursiveLock> lock(mLock);
+        VkBufferCollectionFUCHSIA buffer_collection =
+            reinterpret_cast<VkBufferCollectionFUCHSIA>(pCollection);
+        if (info_VkBufferCollectionFUCHSIA.find(buffer_collection) !=
+            info_VkBufferCollectionFUCHSIA.end()) {
+            info_VkBufferCollectionFUCHSIA[buffer_collection].constraints =
+                android::base::makeOptional(
+                    std::move(setConstraintsResult.constraints));
+            info_VkBufferCollectionFUCHSIA[buffer_collection].createInfoIndex =
+                std::move(setConstraintsResult.createInfoIndex);
+        }
+
+        return VK_SUCCESS;
+    }
+
+    struct SetBufferCollectionBufferConstraintsResult {
+        VkResult result;
+        fuchsia_sysmem::wire::BufferCollectionConstraints constraints;
+    };
+
+    SetBufferCollectionBufferConstraintsResult
+    setBufferCollectionBufferConstraintsImpl(
+        fidl::WireSyncClient<fuchsia_sysmem::BufferCollection>* pCollection,
+        const VkBufferConstraintsInfoFUCHSIA* pBufferConstraintsInfo) {
+        const auto& collection = *pCollection;
+        if (pBufferConstraintsInfo == nullptr) {
+            ALOGE(
+                "setBufferCollectionBufferConstraints: "
+                "pBufferConstraintsInfo cannot be null.");
+            return {VK_ERROR_OUT_OF_DEVICE_MEMORY};
+        }
+
+        fuchsia_sysmem::wire::BufferCollectionConstraints constraints =
+            defaultBufferCollectionConstraints(
+                /* min_size_bytes */ pBufferConstraintsInfo->createInfo.size,
+                /* buffer_count */ pBufferConstraintsInfo
+                    ->bufferCollectionConstraints.minBufferCount);
+        constraints.usage.vulkan =
+            getBufferCollectionConstraintsVulkanBufferUsage(
+                pBufferConstraintsInfo);
+
+        constexpr uint32_t kVulkanPriority = 5;
+        const char kName[] = "GoldfishBufferSysmemShared";
+        collection->SetName(kVulkanPriority, fidl::StringView(kName));
+
+        auto result = collection->SetConstraints(true, constraints);
+        if (!result.ok()) {
+            ALOGE("setBufferCollectionConstraints: SetConstraints failed: %d",
+                  result.status());
+            return {VK_ERROR_OUT_OF_DEVICE_MEMORY};
+        }
+
+        return {VK_SUCCESS, constraints};
+    }
+
+    VkResult setBufferCollectionBufferConstraintsFUCHSIA(
+        fidl::WireSyncClient<fuchsia_sysmem::BufferCollection>* pCollection,
+        const VkBufferConstraintsInfoFUCHSIA* pBufferConstraintsInfo) {
+        auto setConstraintsResult = setBufferCollectionBufferConstraintsImpl(
+            pCollection, pBufferConstraintsInfo);
+        if (setConstraintsResult.result != VK_SUCCESS) {
+            return setConstraintsResult.result;
+        }
+
+        // copy constraints to info_VkBufferCollectionFUCHSIA if
+        // |collection| is a valid VkBufferCollectionFUCHSIA handle.
+        AutoLock<RecursiveLock> lock(mLock);
+        VkBufferCollectionFUCHSIA buffer_collection =
+            reinterpret_cast<VkBufferCollectionFUCHSIA>(pCollection);
+        if (info_VkBufferCollectionFUCHSIA.find(buffer_collection) !=
+            info_VkBufferCollectionFUCHSIA.end()) {
+            info_VkBufferCollectionFUCHSIA[buffer_collection].constraints =
+                android::base::makeOptional(setConstraintsResult.constraints);
+        }
+
+        return VK_SUCCESS;
+    }
+
+    VkResult on_vkSetBufferCollectionImageConstraintsFUCHSIA(
+        void* context,
+        VkResult,
+        VkDevice device,
+        VkBufferCollectionFUCHSIA collection,
+        const VkImageConstraintsInfoFUCHSIA* pImageConstraintsInfo) {
+        VkEncoder* enc = (VkEncoder*)context;
+        auto sysmem_collection = reinterpret_cast<
+            fidl::WireSyncClient<fuchsia_sysmem::BufferCollection>*>(
+            collection);
+        return setBufferCollectionImageConstraintsFUCHSIA(
+            enc, device, sysmem_collection, pImageConstraintsInfo);
+    }
+
+    VkResult on_vkSetBufferCollectionBufferConstraintsFUCHSIA(
+        void*,
+        VkResult,
+        VkDevice,
+        VkBufferCollectionFUCHSIA collection,
+        const VkBufferConstraintsInfoFUCHSIA* pBufferConstraintsInfo) {
+        auto sysmem_collection = reinterpret_cast<
+            fidl::WireSyncClient<fuchsia_sysmem::BufferCollection>*>(
+            collection);
+        return setBufferCollectionBufferConstraintsFUCHSIA(
+            sysmem_collection, pBufferConstraintsInfo);
+    }
+
+    VkResult getBufferCollectionImageCreateInfoIndexLocked(
+        VkBufferCollectionFUCHSIA collection,
+        fuchsia_sysmem::wire::BufferCollectionInfo2& info,
+        uint32_t* outCreateInfoIndex) {
+        if (!info_VkBufferCollectionFUCHSIA[collection]
+                 .constraints.hasValue()) {
+            ALOGE("%s: constraints not set", __func__);
+            return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+        }
+
+        if (!info.settings.has_image_format_constraints) {
+            // no image format constraints, skip getting createInfoIndex.
+            return VK_SUCCESS;
+        }
+
+        const auto& constraints =
+            *info_VkBufferCollectionFUCHSIA[collection].constraints;
+        const auto& createInfoIndices =
+            info_VkBufferCollectionFUCHSIA[collection].createInfoIndex;
+        const auto& out = info.settings.image_format_constraints;
+        bool foundCreateInfo = false;
+
+        for (size_t imageFormatIndex = 0;
+             imageFormatIndex < constraints.image_format_constraints_count;
+             imageFormatIndex++) {
+            const auto& in =
+                constraints.image_format_constraints[imageFormatIndex];
+            // These checks are sorted in order of how often they're expected to
+            // mismatch, from most likely to least likely. They aren't always
+            // equality comparisons, since sysmem may change some values in
+            // compatible ways on behalf of the other participants.
+            if ((out.pixel_format.type != in.pixel_format.type) ||
+                (out.pixel_format.has_format_modifier !=
+                 in.pixel_format.has_format_modifier) ||
+                (out.pixel_format.format_modifier.value !=
+                 in.pixel_format.format_modifier.value) ||
+                (out.min_bytes_per_row < in.min_bytes_per_row) ||
+                (out.required_max_coded_width < in.required_max_coded_width) ||
+                (out.required_max_coded_height <
+                 in.required_max_coded_height) ||
+                (in.bytes_per_row_divisor != 0 &&
+                 out.bytes_per_row_divisor % in.bytes_per_row_divisor != 0)) {
+                continue;
+            }
+            // Check if the out colorspaces are a subset of the in color spaces.
+            bool all_color_spaces_found = true;
+            for (uint32_t j = 0; j < out.color_spaces_count; j++) {
+                bool found_matching_color_space = false;
+                for (uint32_t k = 0; k < in.color_spaces_count; k++) {
+                    if (out.color_space[j].type == in.color_space[k].type) {
+                        found_matching_color_space = true;
+                        break;
+                    }
+                }
+                if (!found_matching_color_space) {
+                    all_color_spaces_found = false;
+                    break;
+                }
+            }
+            if (!all_color_spaces_found) {
+                continue;
+            }
+
+            // Choose the first valid format for now.
+            *outCreateInfoIndex = createInfoIndices[imageFormatIndex];
+            return VK_SUCCESS;
+        }
+
+        ALOGE("%s: cannot find a valid image format in constraints", __func__);
+        return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+    }
+
+    VkResult on_vkGetBufferCollectionPropertiesFUCHSIA(
+        void* context,
+        VkResult,
+        VkDevice device,
+        VkBufferCollectionFUCHSIA collection,
+        VkBufferCollectionPropertiesFUCHSIA* pProperties) {
+        VkEncoder* enc = (VkEncoder*)context;
+        const auto& sysmem_collection = *reinterpret_cast<
+            fidl::WireSyncClient<fuchsia_sysmem::BufferCollection>*>(
+            collection);
+
+        auto result = sysmem_collection->WaitForBuffersAllocated();
+        if (!result.ok() || result->status != ZX_OK) {
+            ALOGE("Failed wait for allocation: %d %d", result.status(),
+                  GET_STATUS_SAFE(result, status));
+            return VK_ERROR_INITIALIZATION_FAILED;
+        }
+        fuchsia_sysmem::wire::BufferCollectionInfo2 info =
+            std::move(result->buffer_collection_info);
+
+        bool is_host_visible =
+            info.settings.buffer_settings.heap ==
+            fuchsia_sysmem::wire::HeapType::kGoldfishHostVisible;
+        bool is_device_local =
+            info.settings.buffer_settings.heap ==
+            fuchsia_sysmem::wire::HeapType::kGoldfishDeviceLocal;
+        if (!is_host_visible && !is_device_local) {
+            ALOGE("buffer collection uses a non-goldfish heap (type 0x%lu)",
+                  static_cast<uint64_t>(info.settings.buffer_settings.heap));
+            return VK_ERROR_INITIALIZATION_FAILED;
+        }
+
+        // memoryTypeBits
+        // ====================================================================
+        {
+            AutoLock<RecursiveLock> lock(mLock);
+            auto deviceIt = info_VkDevice.find(device);
+            if (deviceIt == info_VkDevice.end()) {
+                return VK_ERROR_INITIALIZATION_FAILED;
+            }
+            auto& deviceInfo = deviceIt->second;
+
+            // Device local memory type supported.
+            pProperties->memoryTypeBits = 0;
+            for (uint32_t i = 0; i < deviceInfo.memProps.memoryTypeCount; ++i) {
+                if ((is_device_local &&
+                     (deviceInfo.memProps.memoryTypes[i].propertyFlags &
+                      VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)) ||
+                    (is_host_visible &&
+                     (deviceInfo.memProps.memoryTypes[i].propertyFlags &
+                      VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT))) {
+                    pProperties->memoryTypeBits |= 1ull << i;
+                }
+            }
+        }
+
+        // bufferCount
+        // ====================================================================
+        pProperties->bufferCount = info.buffer_count;
+
+        auto storeProperties = [this, collection, pProperties]() -> VkResult {
+            // store properties to storage
+            AutoLock<RecursiveLock> lock(mLock);
+            if (info_VkBufferCollectionFUCHSIA.find(collection) ==
+                info_VkBufferCollectionFUCHSIA.end()) {
+                return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+            }
+
+            info_VkBufferCollectionFUCHSIA[collection].properties =
+                android::base::makeOptional(*pProperties);
+
+            // We only do a shallow copy so we should remove all pNext pointers.
+            info_VkBufferCollectionFUCHSIA[collection].properties->pNext =
+                nullptr;
+            info_VkBufferCollectionFUCHSIA[collection]
+                .properties->sysmemColorSpaceIndex.pNext = nullptr;
+            return VK_SUCCESS;
+        };
+
+        // The fields below only apply to buffer collections with image formats.
+        if (!info.settings.has_image_format_constraints) {
+            ALOGD("%s: buffer collection doesn't have image format constraints",
+                  __func__);
+            return storeProperties();
+        }
+
+        // sysmemFormat
+        // ====================================================================
+
+        pProperties->sysmemPixelFormat = static_cast<uint64_t>(
+            info.settings.image_format_constraints.pixel_format.type);
+
+        // colorSpace
+        // ====================================================================
+        if (info.settings.image_format_constraints.color_spaces_count == 0) {
+            ALOGE(
+                "%s: color space missing from allocated buffer collection "
+                "constraints",
+                __func__);
+            return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+        }
+        // Only report first colorspace for now.
+        pProperties->sysmemColorSpaceIndex.colorSpace = static_cast<uint32_t>(
+            info.settings.image_format_constraints.color_space[0].type);
+
+        // createInfoIndex
+        // ====================================================================
+        {
+            AutoLock<RecursiveLock> lock(mLock);
+            auto getIndexResult = getBufferCollectionImageCreateInfoIndexLocked(
+                collection, info, &pProperties->createInfoIndex);
+            if (getIndexResult != VK_SUCCESS) {
+                return getIndexResult;
+            }
+        }
+
+        // formatFeatures
+        // ====================================================================
+        VkPhysicalDevice physicalDevice;
+        {
+            AutoLock<RecursiveLock> lock(mLock);
+            auto deviceIt = info_VkDevice.find(device);
+            if (deviceIt == info_VkDevice.end()) {
+                return VK_ERROR_INITIALIZATION_FAILED;
+            }
+            physicalDevice = deviceIt->second.physdev;
+        }
+
+        VkFormat vkFormat = sysmemPixelFormatTypeToVk(
+            info.settings.image_format_constraints.pixel_format.type);
+        VkFormatProperties formatProperties;
+        enc->vkGetPhysicalDeviceFormatProperties(
+            physicalDevice, vkFormat, &formatProperties, true /* do lock */);
+        if (is_device_local) {
+            pProperties->formatFeatures =
+                formatProperties.optimalTilingFeatures;
+        }
+        if (is_host_visible) {
+            pProperties->formatFeatures = formatProperties.linearTilingFeatures;
+        }
+
+        // YCbCr properties
+        // ====================================================================
+        // TODO(59804): Implement this correctly when we support YUV pixel
+        // formats in goldfish ICD.
+        pProperties->samplerYcbcrConversionComponents.r =
+            VK_COMPONENT_SWIZZLE_IDENTITY;
+        pProperties->samplerYcbcrConversionComponents.g =
+            VK_COMPONENT_SWIZZLE_IDENTITY;
+        pProperties->samplerYcbcrConversionComponents.b =
+            VK_COMPONENT_SWIZZLE_IDENTITY;
+        pProperties->samplerYcbcrConversionComponents.a =
+            VK_COMPONENT_SWIZZLE_IDENTITY;
+        pProperties->suggestedYcbcrModel =
+            VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY;
+        pProperties->suggestedYcbcrRange = VK_SAMPLER_YCBCR_RANGE_ITU_FULL;
+        pProperties->suggestedXChromaOffset = VK_CHROMA_LOCATION_MIDPOINT;
+        pProperties->suggestedYChromaOffset = VK_CHROMA_LOCATION_MIDPOINT;
+
+        return storeProperties();
+    }
+#endif
+
+    CoherentMemoryPtr createCoherentMemory(VkDevice device,
+                                           VkDeviceMemory mem,
+                                           const VkMemoryAllocateInfo& hostAllocationInfo,
+                                           VkEncoder* enc,
+                                           VkResult& res)
+    {
+        CoherentMemoryPtr coherentMemory = nullptr;
+        if (mFeatureInfo->hasDirectMem) {
+            uint64_t gpuAddr = 0;
+            GoldfishAddressSpaceBlockPtr block = nullptr;
+            res = enc->vkMapMemoryIntoAddressSpaceGOOGLE(device, mem, &gpuAddr, true);
+            if (res != VK_SUCCESS) {
+                return coherentMemory;
+            }
+            {
+                AutoLock<RecursiveLock> lock(mLock);
+                auto it = info_VkDeviceMemory.find(mem);
+                if (it == info_VkDeviceMemory.end()) {
+                     res = VK_ERROR_OUT_OF_HOST_MEMORY;
+                     return coherentMemory;
+                }
+                auto& info = it->second;
+                block = info.goldfishBlock;
+                info.goldfishBlock = nullptr;
+
+                coherentMemory =
+                    std::make_shared<CoherentMemory>(block, gpuAddr, hostAllocationInfo.allocationSize, device, mem);
+            }
+        } else if (mFeatureInfo->hasVirtioGpuNext) {
+            struct VirtGpuCreateBlob createBlob = { 0 };
+            uint64_t hvaSizeId[3];
+            res = enc->vkGetMemoryHostAddressInfoGOOGLE(device, mem,
+                    &hvaSizeId[0], &hvaSizeId[1], &hvaSizeId[2], true /* do lock */);
+            if(res != VK_SUCCESS) {
+                return coherentMemory;
+            }
+            {
+                AutoLock<RecursiveLock> lock(mLock);
+                VirtGpuDevice& instance = VirtGpuDevice::getInstance((enum VirtGpuCapset)3);
+                createBlob.blobMem = kBlobMemHost3d;
+                createBlob.flags = kBlobFlagMappable;
+                createBlob.blobId = hvaSizeId[2];
+                createBlob.size = hostAllocationInfo.allocationSize;
+
+                auto blob = instance.createBlob(createBlob);
+                if (!blob) {
+                    res = VK_ERROR_OUT_OF_DEVICE_MEMORY;
+                    return coherentMemory;
+                }
+
+                VirtGpuBlobMappingPtr mapping = blob->createMapping();
+                if (!mapping) {
+                    res = VK_ERROR_OUT_OF_DEVICE_MEMORY;
+                    return coherentMemory;
+                }
+
+                coherentMemory =
+                    std::make_shared<CoherentMemory>(mapping, createBlob.size, device, mem);
+            }
+        } else {
+            ALOGE("FATAL: Unsupported virtual memory feature");
+            abort();
+        }
+        return coherentMemory;
+    }
+
+    VkResult allocateCoherentMemory(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo,
+                                    VkEncoder* enc, VkDeviceMemory* pMemory) {
+        uint64_t blobId = 0;
+        uint64_t offset = 0;
+        uint8_t *ptr = nullptr;
+        VkMemoryAllocateFlagsInfo allocFlagsInfo;
+        VkMemoryOpaqueCaptureAddressAllocateInfo opaqueCaptureAddressAllocInfo;
+        VkCreateBlobGOOGLE createBlobInfo;
+        VirtGpuBlobPtr guestBlob = nullptr;
+
+        memset(&createBlobInfo, 0, sizeof(struct VkCreateBlobGOOGLE));
+        createBlobInfo.sType = VK_STRUCTURE_TYPE_CREATE_BLOB_GOOGLE;
+
+        const VkMemoryAllocateFlagsInfo* allocFlagsInfoPtr =
+            vk_find_struct<VkMemoryAllocateFlagsInfo>(pAllocateInfo);
+        const VkMemoryOpaqueCaptureAddressAllocateInfo* opaqueCaptureAddressAllocInfoPtr =
+            vk_find_struct<VkMemoryOpaqueCaptureAddressAllocateInfo>(pAllocateInfo);
+
+        bool deviceAddressMemoryAllocation =
+            allocFlagsInfoPtr &&
+            ((allocFlagsInfoPtr->flags & VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT) ||
+             (allocFlagsInfoPtr->flags & VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT));
+
+        bool dedicated = deviceAddressMemoryAllocation;
+
+        if (mCaps.gfxstreamCapset.deferredMapping || mCaps.params[kParamCreateGuestHandle])
+            dedicated = true;
+
+        VkMemoryAllocateInfo hostAllocationInfo = vk_make_orphan_copy(*pAllocateInfo);
+        vk_struct_chain_iterator structChainIter = vk_make_chain_iterator(&hostAllocationInfo);
+
+        if (mCaps.gfxstreamCapset.deferredMapping || mCaps.params[kParamCreateGuestHandle]) {
+            hostAllocationInfo.allocationSize =
+                ALIGN(pAllocateInfo->allocationSize, mCaps.gfxstreamCapset.blobAlignment);
+        } else if (dedicated) {
+            // Over-aligning to kLargestSize to some Windows drivers (b:152769369).  Can likely
+            // have host report the desired alignment.
+            hostAllocationInfo.allocationSize =
+                ALIGN(pAllocateInfo->allocationSize, kLargestPageSize);
+        } else {
+            VkDeviceSize roundedUpAllocSize = ALIGN(pAllocateInfo->allocationSize, kMegaByte);
+            hostAllocationInfo.allocationSize = std::max(roundedUpAllocSize,
+                                                         kDefaultHostMemBlockSize);
+        }
+
+        // Support device address capture/replay allocations
+        if (deviceAddressMemoryAllocation) {
+            if (allocFlagsInfoPtr) {
+                ALOGV("%s: has alloc flags\n", __func__);
+                allocFlagsInfo = *allocFlagsInfoPtr;
+                vk_append_struct(&structChainIter, &allocFlagsInfo);
+            }
+
+            if (opaqueCaptureAddressAllocInfoPtr) {
+                ALOGV("%s: has opaque capture address\n", __func__);
+                opaqueCaptureAddressAllocInfo = *opaqueCaptureAddressAllocInfoPtr;
+                vk_append_struct(&structChainIter, &opaqueCaptureAddressAllocInfo);
+            }
+        }
+
+        if (mCaps.params[kParamCreateGuestHandle]) {
+            struct VirtGpuCreateBlob createBlob = {0};
+            struct VirtGpuExecBuffer exec = {};
+            VirtGpuDevice& instance = VirtGpuDevice::getInstance();
+            struct gfxstreamPlaceholderCommandVk placeholderCmd = {};
+
+            createBlobInfo.blobId = ++mBlobId;
+            createBlobInfo.blobMem = kBlobMemGuest;
+            createBlobInfo.blobFlags = kBlobFlagCreateGuestHandle;
+            vk_append_struct(&structChainIter, &createBlobInfo);
+
+            createBlob.blobMem = kBlobMemGuest;
+            createBlob.flags = kBlobFlagCreateGuestHandle;
+            createBlob.blobId = createBlobInfo.blobId;
+            createBlob.size = hostAllocationInfo.allocationSize;
+
+            guestBlob = instance.createBlob(createBlob);
+            if (!guestBlob) return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+
+            placeholderCmd.hdr.opCode = GFXSTREAM_PLACEHOLDER_COMMAND_VK;
+            exec.command = static_cast<void*>(&placeholderCmd);
+            exec.command_size = sizeof(placeholderCmd);
+            exec.flags = kRingIdx;
+            exec.ring_idx = 1;
+            if (instance.execBuffer(exec, guestBlob)) return VK_ERROR_OUT_OF_HOST_MEMORY;
+
+            guestBlob->wait();
+        } else if (mCaps.gfxstreamCapset.deferredMapping) {
+            createBlobInfo.blobId = ++mBlobId;
+            createBlobInfo.blobMem = kBlobMemHost3d;
+            vk_append_struct(&structChainIter, &createBlobInfo);
+        }
+
+        VkDeviceMemory mem = VK_NULL_HANDLE;
+        VkResult host_res =
+        enc->vkAllocateMemory(device, &hostAllocationInfo, nullptr,
+                              &mem, true /* do lock */);
+        if(host_res != VK_SUCCESS) {
+            return host_res;
+        }
+
+        struct VkDeviceMemory_Info info;
+        if (mCaps.gfxstreamCapset.deferredMapping || mCaps.params[kParamCreateGuestHandle]) {
+            info.allocationSize = pAllocateInfo->allocationSize;
+            info.blobId = createBlobInfo.blobId;
+        }
+
+        if (guestBlob) {
+            auto mapping = guestBlob->createMapping();
+            if (!mapping) return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+
+            auto coherentMemory = std::make_shared<CoherentMemory>(
+                mapping, hostAllocationInfo.allocationSize, device, mem);
+
+            coherentMemory->subAllocate(pAllocateInfo->allocationSize, &ptr, offset);
+            info.coherentMemoryOffset = offset;
+            info.coherentMemory = coherentMemory;
+            info.ptr = ptr;
+        }
+
+        info.coherentMemorySize = hostAllocationInfo.allocationSize;
+        info.memoryTypeIndex = hostAllocationInfo.memoryTypeIndex;
+        info.device = device;
+        info.dedicated = dedicated;
+        {
+            // createCoherentMemory inside need to access info_VkDeviceMemory
+            // information. set it before use.
+            AutoLock<RecursiveLock> lock(mLock);
+            info_VkDeviceMemory[mem] = info;
+        }
+
+        if (mCaps.gfxstreamCapset.deferredMapping || mCaps.params[kParamCreateGuestHandle]) {
+            *pMemory = mem;
+            return host_res;
+        }
+
+        auto coherentMemory = createCoherentMemory(device, mem, hostAllocationInfo, enc, host_res);
+        if(coherentMemory) {
+            AutoLock<RecursiveLock> lock(mLock);
+            coherentMemory->subAllocate(pAllocateInfo->allocationSize, &ptr, offset);
+            info.allocationSize = pAllocateInfo->allocationSize;
+            info.coherentMemoryOffset = offset;
+            info.coherentMemory = coherentMemory;
+            info.ptr = ptr;
+            info_VkDeviceMemory[mem] = info;
+            *pMemory = mem;
+        }
+        else {
+            enc->vkFreeMemory(device, mem, nullptr, true);
+            AutoLock<RecursiveLock> lock(mLock);
+            info_VkDeviceMemory.erase(mem);
+        }
+        return host_res;
+    }
+
+    VkResult getCoherentMemory(const VkMemoryAllocateInfo* pAllocateInfo, VkEncoder* enc,
+                               VkDevice device, VkDeviceMemory* pMemory) {
+        VkMemoryAllocateFlagsInfo allocFlagsInfo;
+        VkMemoryOpaqueCaptureAddressAllocateInfo opaqueCaptureAddressAllocInfo;
+
+        // Add buffer device address capture structs
+        const VkMemoryAllocateFlagsInfo* allocFlagsInfoPtr =
+            vk_find_struct<VkMemoryAllocateFlagsInfo>(pAllocateInfo);
+
+        bool dedicated = allocFlagsInfoPtr &&
+                         ((allocFlagsInfoPtr->flags & VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT) ||
+                          (allocFlagsInfoPtr->flags & VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT));
+
+        if (mCaps.gfxstreamCapset.deferredMapping || mCaps.params[kParamCreateGuestHandle])
+            dedicated = true;
+
+        CoherentMemoryPtr coherentMemory = nullptr;
+        uint8_t *ptr = nullptr;
+        uint64_t offset = 0;
+        {
+            AutoLock<RecursiveLock> lock(mLock);
+            for (const auto &[memory, info] : info_VkDeviceMemory) {
+                if (info.memoryTypeIndex != pAllocateInfo->memoryTypeIndex)
+                    continue;
+
+                if (info.dedicated || dedicated)
+                    continue;
+
+                if (!info.coherentMemory)
+                    continue;
+
+                if (!info.coherentMemory->subAllocate(pAllocateInfo->allocationSize, &ptr, offset))
+                    continue;
+
+                coherentMemory = info.coherentMemory;
+                break;
+            }
+            if (coherentMemory) {
+                struct VkDeviceMemory_Info info;
+                info.coherentMemoryOffset = offset;
+                info.ptr = ptr;
+                info.memoryTypeIndex = pAllocateInfo->memoryTypeIndex;
+                info.allocationSize = pAllocateInfo->allocationSize;
+                info.coherentMemory = coherentMemory;
+                info.device = device;
+
+                // for suballocated memory, create an alias VkDeviceMemory handle for application
+                // memory used for suballocations will still be VkDeviceMemory associated with
+                // CoherentMemory
+                auto mem = new_from_host_VkDeviceMemory(VK_NULL_HANDLE);
+                info_VkDeviceMemory[mem] = info;
+                *pMemory = mem;
+                return VK_SUCCESS;
+            }
+        }
+        return allocateCoherentMemory(device, pAllocateInfo, enc, pMemory);
+    }
+
+    uint64_t getAHardwareBufferId(AHardwareBuffer* ahw) {
+        uint64_t id = 0;
+#if defined(PLATFORM_SDK_VERSION) && PLATFORM_SDK_VERSION >= 31
+        AHardwareBuffer_getId(ahw, &id);
+#else
+        (void)ahw;
+#endif
+        return id;
+    }
+
+    VkResult on_vkAllocateMemory(
+        void* context,
+        VkResult input_result,
+        VkDevice device,
+        const VkMemoryAllocateInfo* pAllocateInfo,
+        const VkAllocationCallbacks* pAllocator,
+        VkDeviceMemory* pMemory) {
+
+#define _RETURN_FAILURE_WITH_DEVICE_MEMORY_REPORT(result) \
+        { \
+            auto it = info_VkDevice.find(device); \
+            if (it == info_VkDevice.end()) return result; \
+            emitDeviceMemoryReport( \
+                it->second, \
+                VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_ALLOCATION_FAILED_EXT, \
+                0, \
+                pAllocateInfo->allocationSize, \
+                VK_OBJECT_TYPE_DEVICE_MEMORY, \
+                0, \
+                pAllocateInfo->memoryTypeIndex); \
+            return result; \
+        }
+
+#define _RETURN_SCUCCESS_WITH_DEVICE_MEMORY_REPORT \
+        { \
+            uint64_t memoryObjectId = (uint64_t)(void*)*pMemory; \
+            if (ahw) { \
+                memoryObjectId = getAHardwareBufferId(ahw); \
+            } \
+            emitDeviceMemoryReport( \
+                info_VkDevice[device], \
+                isImport ? VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_IMPORT_EXT : VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_ALLOCATE_EXT, \
+                memoryObjectId, \
+                pAllocateInfo->allocationSize, \
+                VK_OBJECT_TYPE_DEVICE_MEMORY, \
+                (uint64_t)(void*)*pMemory, \
+                pAllocateInfo->memoryTypeIndex); \
+            return VK_SUCCESS; \
+        }
+
+
+        if (input_result != VK_SUCCESS) _RETURN_FAILURE_WITH_DEVICE_MEMORY_REPORT(input_result);
+
+        VkEncoder* enc = (VkEncoder*)context;
+
+        VkMemoryAllocateInfo finalAllocInfo = vk_make_orphan_copy(*pAllocateInfo);
+        vk_struct_chain_iterator structChainIter = vk_make_chain_iterator(&finalAllocInfo);
+
+        VkMemoryAllocateFlagsInfo allocFlagsInfo;
+        VkMemoryOpaqueCaptureAddressAllocateInfo opaqueCaptureAddressAllocInfo;
+
+        // Add buffer device address capture structs
+        const VkMemoryAllocateFlagsInfo* allocFlagsInfoPtr =
+            vk_find_struct<VkMemoryAllocateFlagsInfo>(pAllocateInfo);
+        const VkMemoryOpaqueCaptureAddressAllocateInfo* opaqueCaptureAddressAllocInfoPtr =
+            vk_find_struct<VkMemoryOpaqueCaptureAddressAllocateInfo>(pAllocateInfo);
+
+        if (allocFlagsInfoPtr) {
+            ALOGV("%s: has alloc flags\n", __func__);
+            allocFlagsInfo = *allocFlagsInfoPtr;
+            vk_append_struct(&structChainIter, &allocFlagsInfo);
+        }
+
+        if (opaqueCaptureAddressAllocInfoPtr) {
+            ALOGV("%s: has opaque capture address\n", __func__);
+            opaqueCaptureAddressAllocInfo = *opaqueCaptureAddressAllocInfoPtr;
+            vk_append_struct(&structChainIter, &opaqueCaptureAddressAllocInfo);
+        }
+
+        VkMemoryDedicatedAllocateInfo dedicatedAllocInfo;
+        VkImportColorBufferGOOGLE importCbInfo = {
+            VK_STRUCTURE_TYPE_IMPORT_COLOR_BUFFER_GOOGLE, 0,
+        };
+        VkImportBufferGOOGLE importBufferInfo = {
+                VK_STRUCTURE_TYPE_IMPORT_BUFFER_GOOGLE,
+                0,
+        };
+        // VkImportPhysicalAddressGOOGLE importPhysAddrInfo = {
+        //     VK_STRUCTURE_TYPE_IMPORT_PHYSICAL_ADDRESS_GOOGLE, 0,
+        // };
+
+        const VkExportMemoryAllocateInfo* exportAllocateInfoPtr =
+            vk_find_struct<VkExportMemoryAllocateInfo>(pAllocateInfo);
+
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+        const VkImportAndroidHardwareBufferInfoANDROID* importAhbInfoPtr =
+            vk_find_struct<VkImportAndroidHardwareBufferInfoANDROID>(pAllocateInfo);
+#else
+        const void* importAhbInfoPtr = nullptr;
+#endif
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+        const VkImportMemoryBufferCollectionFUCHSIA*
+            importBufferCollectionInfoPtr =
+                vk_find_struct<VkImportMemoryBufferCollectionFUCHSIA>(
+                    pAllocateInfo);
+
+        const VkImportMemoryZirconHandleInfoFUCHSIA* importVmoInfoPtr =
+                vk_find_struct<VkImportMemoryZirconHandleInfoFUCHSIA>(
+                        pAllocateInfo);
+#else
+        const void* importBufferCollectionInfoPtr = nullptr;
+        const void* importVmoInfoPtr = nullptr;
+#endif  // VK_USE_PLATFORM_FUCHSIA
+
+        const VkMemoryDedicatedAllocateInfo* dedicatedAllocInfoPtr =
+            vk_find_struct<VkMemoryDedicatedAllocateInfo>(pAllocateInfo);
+
+        // Note for AHardwareBuffers, the Vulkan spec states:
+        //
+        //     Android hardware buffers have intrinsic width, height, format, and usage
+        //     properties, so Vulkan images bound to memory imported from an Android
+        //     hardware buffer must use dedicated allocations
+        //
+        // so any allocation requests with a VkImportAndroidHardwareBufferInfoANDROID
+        // will necessarily have a VkMemoryDedicatedAllocateInfo. However, the host
+        // may or may not actually use a dedicated allocation to emulate
+        // AHardwareBuffers. As such, the VkMemoryDedicatedAllocateInfo is passed to the
+        // host and the host will decide whether or not to use it.
+
+        bool shouldPassThroughDedicatedAllocInfo =
+            !exportAllocateInfoPtr &&
+            !importBufferCollectionInfoPtr &&
+            !importVmoInfoPtr;
+
+        const VkPhysicalDeviceMemoryProperties& physicalDeviceMemoryProps
+            = getPhysicalDeviceMemoryProperties(context, device, VK_NULL_HANDLE);
+
+        const bool requestedMemoryIsHostVisible =
+            isHostVisible(&physicalDeviceMemoryProps, pAllocateInfo->memoryTypeIndex);
+
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__)
+        shouldPassThroughDedicatedAllocInfo &= !requestedMemoryIsHostVisible;
+#endif  // VK_USE_PLATFORM_FUCHSIA
+
+        if (shouldPassThroughDedicatedAllocInfo &&
+            dedicatedAllocInfoPtr) {
+            dedicatedAllocInfo = vk_make_orphan_copy(*dedicatedAllocInfoPtr);
+            vk_append_struct(&structChainIter, &dedicatedAllocInfo);
+        }
+
+        // State needed for import/export.
+        bool exportAhb = false;
+        bool exportVmo = false;
+        bool importAhb = false;
+        bool importBufferCollection = false;
+        bool importVmo = false;
+        (void)exportVmo;
+
+        // Even if we export allocate, the underlying operation
+        // for the host is always going to be an import operation.
+        // This is also how Intel's implementation works,
+        // and is generally simpler;
+        // even in an export allocation,
+        // we perform AHardwareBuffer allocation
+        // on the guest side, at this layer,
+        // and then we attach a new VkDeviceMemory
+        // to the AHardwareBuffer on the host via an "import" operation.
+        AHardwareBuffer* ahw = nullptr;
+
+        if (exportAllocateInfoPtr) {
+            exportAhb =
+                exportAllocateInfoPtr->handleTypes &
+                VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID;
+#ifdef VK_USE_PLATFORM_FUCHSIA
+            exportVmo = exportAllocateInfoPtr->handleTypes &
+                        VK_EXTERNAL_MEMORY_HANDLE_TYPE_ZIRCON_VMO_BIT_FUCHSIA;
+#endif  // VK_USE_PLATFORM_FUCHSIA
+        } else if (importAhbInfoPtr) {
+            importAhb = true;
+        } else if (importBufferCollectionInfoPtr) {
+            importBufferCollection = true;
+        } else if (importVmoInfoPtr) {
+            importVmo = true;
+        }
+        bool isImport = importAhb || importBufferCollection ||
+                        importVmo;
+
+#if defined(VK_USE_PLATFORM_ANDROID_KHR)
+        if (exportAhb) {
+            bool hasDedicatedImage = dedicatedAllocInfoPtr &&
+                (dedicatedAllocInfoPtr->image != VK_NULL_HANDLE);
+            bool hasDedicatedBuffer = dedicatedAllocInfoPtr &&
+                (dedicatedAllocInfoPtr->buffer != VK_NULL_HANDLE);
+            VkExtent3D imageExtent = { 0, 0, 0 };
+            uint32_t imageLayers = 0;
+            VkFormat imageFormat = VK_FORMAT_UNDEFINED;
+            VkImageUsageFlags imageUsage = 0;
+            VkImageCreateFlags imageCreateFlags = 0;
+            VkDeviceSize bufferSize = 0;
+            VkDeviceSize allocationInfoAllocSize =
+                finalAllocInfo.allocationSize;
+
+            if (hasDedicatedImage) {
+                AutoLock<RecursiveLock> lock(mLock);
+
+                auto it = info_VkImage.find(
+                    dedicatedAllocInfoPtr->image);
+                if (it == info_VkImage.end()) _RETURN_FAILURE_WITH_DEVICE_MEMORY_REPORT(VK_ERROR_INITIALIZATION_FAILED);
+                const auto& info = it->second;
+                const auto& imgCi = info.createInfo;
+
+                imageExtent = imgCi.extent;
+                imageLayers = imgCi.arrayLayers;
+                imageFormat = imgCi.format;
+                imageUsage = imgCi.usage;
+                imageCreateFlags = imgCi.flags;
+            }
+
+            if (hasDedicatedBuffer) {
+                AutoLock<RecursiveLock> lock(mLock);
+
+                auto it = info_VkBuffer.find(
+                    dedicatedAllocInfoPtr->buffer);
+                if (it == info_VkBuffer.end()) _RETURN_FAILURE_WITH_DEVICE_MEMORY_REPORT(VK_ERROR_INITIALIZATION_FAILED);
+                const auto& info = it->second;
+                const auto& bufCi = info.createInfo;
+
+                bufferSize = bufCi.size;
+            }
+
+            VkResult ahbCreateRes =
+                createAndroidHardwareBuffer(
+                    hasDedicatedImage,
+                    hasDedicatedBuffer,
+                    imageExtent,
+                    imageLayers,
+                    imageFormat,
+                    imageUsage,
+                    imageCreateFlags,
+                    bufferSize,
+                    allocationInfoAllocSize,
+                    &ahw);
+
+            if (ahbCreateRes != VK_SUCCESS) {
+                _RETURN_FAILURE_WITH_DEVICE_MEMORY_REPORT(ahbCreateRes);
+            }
+        }
+
+        if (importAhb) {
+            ahw = importAhbInfoPtr->buffer;
+            // We still need to acquire the AHardwareBuffer.
+            importAndroidHardwareBuffer(
+                ResourceTracker::threadingCallbacks.hostConnectionGetFunc()->grallocHelper(),
+                importAhbInfoPtr, nullptr);
+        }
+
+        if (ahw) {
+            D("%s: Import AHardwareBuffer", __func__);
+            const uint32_t hostHandle =
+                ResourceTracker::threadingCallbacks.hostConnectionGetFunc()->grallocHelper()
+                    ->getHostHandle(AHardwareBuffer_getNativeHandle(ahw));
+
+            AHardwareBuffer_Desc ahbDesc = {};
+            AHardwareBuffer_describe(ahw, &ahbDesc);
+            if (ahbDesc.format == AHARDWAREBUFFER_FORMAT_BLOB) {
+                importBufferInfo.buffer = hostHandle;
+                vk_append_struct(&structChainIter, &importBufferInfo);
+            } else {
+                importCbInfo.colorBuffer = hostHandle;
+                vk_append_struct(&structChainIter, &importCbInfo);
+            }
+        }
+#endif
+        zx_handle_t vmo_handle = ZX_HANDLE_INVALID;
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+        if (importBufferCollection) {
+            const auto& collection = *reinterpret_cast<
+                fidl::WireSyncClient<fuchsia_sysmem::BufferCollection>*>(
+                importBufferCollectionInfoPtr->collection);
+            auto result = collection->WaitForBuffersAllocated();
+            if (!result.ok() || result->status != ZX_OK) {
+                ALOGE("WaitForBuffersAllocated failed: %d %d", result.status(),
+                      GET_STATUS_SAFE(result, status));
+                _RETURN_FAILURE_WITH_DEVICE_MEMORY_REPORT(VK_ERROR_INITIALIZATION_FAILED);
+            }
+            fuchsia_sysmem::wire::BufferCollectionInfo2& info =
+                result->buffer_collection_info;
+            uint32_t index = importBufferCollectionInfoPtr->index;
+            if (info.buffer_count < index) {
+                ALOGE("Invalid buffer index: %d %d", index);
+                _RETURN_FAILURE_WITH_DEVICE_MEMORY_REPORT(VK_ERROR_INITIALIZATION_FAILED);
+            }
+            vmo_handle = info.buffers[index].vmo.release();
+        }
+
+        if (importVmo) {
+            vmo_handle = importVmoInfoPtr->handle;
+        }
+
+        if (exportVmo) {
+            bool hasDedicatedImage = dedicatedAllocInfoPtr &&
+                (dedicatedAllocInfoPtr->image != VK_NULL_HANDLE);
+            bool hasDedicatedBuffer =
+                dedicatedAllocInfoPtr &&
+                (dedicatedAllocInfoPtr->buffer != VK_NULL_HANDLE);
+
+            if (hasDedicatedImage && hasDedicatedBuffer) {
+                ALOGE(
+                    "Invalid VkMemoryDedicatedAllocationInfo: At least one "
+                    "of image and buffer must be VK_NULL_HANDLE.");
+                return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+            }
+
+            const VkImageCreateInfo* pImageCreateInfo = nullptr;
+
+            VkBufferConstraintsInfoFUCHSIA bufferConstraintsInfo = {
+                .sType =
+                    VK_STRUCTURE_TYPE_BUFFER_COLLECTION_CREATE_INFO_FUCHSIA,
+                .pNext = nullptr,
+                .createInfo = {},
+                .requiredFormatFeatures = 0,
+                .bufferCollectionConstraints =
+                    VkBufferCollectionConstraintsInfoFUCHSIA{
+                        .sType =
+                            VK_STRUCTURE_TYPE_BUFFER_COLLECTION_CONSTRAINTS_INFO_FUCHSIA,
+                        .pNext = nullptr,
+                        .minBufferCount = 1,
+                        .maxBufferCount = 0,
+                        .minBufferCountForCamping = 0,
+                        .minBufferCountForDedicatedSlack = 0,
+                        .minBufferCountForSharedSlack = 0,
+                    },
+            };
+            const VkBufferConstraintsInfoFUCHSIA* pBufferConstraintsInfo =
+                nullptr;
+
+            if (hasDedicatedImage) {
+                AutoLock<RecursiveLock> lock(mLock);
+
+                auto it = info_VkImage.find(dedicatedAllocInfoPtr->image);
+                if (it == info_VkImage.end()) return VK_ERROR_INITIALIZATION_FAILED;
+                const auto& imageInfo = it->second;
+
+                pImageCreateInfo = &imageInfo.createInfo;
+            }
+
+            if (hasDedicatedBuffer) {
+                AutoLock<RecursiveLock> lock(mLock);
+
+                auto it = info_VkBuffer.find(dedicatedAllocInfoPtr->buffer);
+                if (it == info_VkBuffer.end())
+                    return VK_ERROR_INITIALIZATION_FAILED;
+                const auto& bufferInfo = it->second;
+
+                bufferConstraintsInfo.createInfo = bufferInfo.createInfo;
+                pBufferConstraintsInfo = &bufferConstraintsInfo;
+            }
+
+            hasDedicatedImage = hasDedicatedImage &&
+                                getBufferCollectionConstraintsVulkanImageUsage(
+                                    pImageCreateInfo);
+            hasDedicatedBuffer =
+                hasDedicatedBuffer &&
+                getBufferCollectionConstraintsVulkanBufferUsage(
+                    pBufferConstraintsInfo);
+
+            if (hasDedicatedImage || hasDedicatedBuffer) {
+                auto token_ends =
+                    fidl::CreateEndpoints<::fuchsia_sysmem::BufferCollectionToken>();
+                if (!token_ends.is_ok()) {
+                    ALOGE("zx_channel_create failed: %d", token_ends.status_value());
+                    abort();
+                }
+
+                {
+                    auto result = mSysmemAllocator->AllocateSharedCollection(
+                        std::move(token_ends->server));
+                    if (!result.ok()) {
+                        ALOGE("AllocateSharedCollection failed: %d",
+                              result.status());
+                        abort();
+                    }
+                }
+
+                auto collection_ends =
+                    fidl::CreateEndpoints<::fuchsia_sysmem::BufferCollection>();
+                if (!collection_ends.is_ok()) {
+                    ALOGE("zx_channel_create failed: %d", collection_ends.status_value());
+                    abort();
+                }
+
+                {
+                    auto result = mSysmemAllocator->BindSharedCollection(
+                        std::move(token_ends->client), std::move(collection_ends->server));
+                    if (!result.ok()) {
+                        ALOGE("BindSharedCollection failed: %d",
+                              result.status());
+                        abort();
+                    }
+                }
+
+                fidl::WireSyncClient<fuchsia_sysmem::BufferCollection> collection(
+                    std::move(collection_ends->client));
+                if (hasDedicatedImage) {
+                    // TODO(fxbug.dev/90856): Use setBufferCollectionImageConstraintsFUCHSIA.
+                    VkResult res = setBufferCollectionConstraintsFUCHSIA(
+                        enc, device, &collection, pImageCreateInfo);
+                    if (res == VK_ERROR_FORMAT_NOT_SUPPORTED) {
+                      ALOGE("setBufferCollectionConstraints failed: format %u is not supported",
+                            pImageCreateInfo->format);
+                      return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+                    }
+                    if (res != VK_SUCCESS) {
+                        ALOGE("setBufferCollectionConstraints failed: %d", res);
+                        abort();
+                    }
+                }
+
+                if (hasDedicatedBuffer) {
+                    VkResult res = setBufferCollectionBufferConstraintsFUCHSIA(
+                        &collection, pBufferConstraintsInfo);
+                    if (res != VK_SUCCESS) {
+                        ALOGE("setBufferCollectionBufferConstraints failed: %d",
+                              res);
+                        abort();
+                    }
+                }
+
+                {
+                    auto result = collection->WaitForBuffersAllocated();
+                    if (result.ok() && result->status == ZX_OK) {
+                        fuchsia_sysmem::wire::BufferCollectionInfo2& info =
+                            result->buffer_collection_info;
+                        if (!info.buffer_count) {
+                            ALOGE(
+                                "WaitForBuffersAllocated returned "
+                                "invalid count: %d",
+                                info.buffer_count);
+                            abort();
+                        }
+                        vmo_handle = info.buffers[0].vmo.release();
+                    } else {
+                        ALOGE("WaitForBuffersAllocated failed: %d %d",
+                              result.status(), GET_STATUS_SAFE(result, status));
+                        abort();
+                    }
+                }
+
+                collection->Close();
+
+                zx::vmo vmo_copy;
+                zx_status_t status = zx_handle_duplicate(vmo_handle, ZX_RIGHT_SAME_RIGHTS,
+                                                         vmo_copy.reset_and_get_address());
+                if (status != ZX_OK) {
+                    ALOGE("Failed to duplicate VMO: %d", status);
+                    abort();
+                }
+
+                if (pImageCreateInfo) {
+                    // Only device-local images need to create color buffer; for
+                    // host-visible images, the color buffer is already created
+                    // when sysmem allocates memory. Here we use the |tiling|
+                    // field of image creation info to determine if it uses
+                    // host-visible memory.
+                    bool isLinear = pImageCreateInfo->tiling == VK_IMAGE_TILING_LINEAR;
+                    if (!isLinear) {
+                        fuchsia_hardware_goldfish::wire::ColorBufferFormatType format;
+                        switch (pImageCreateInfo->format) {
+                            case VK_FORMAT_B8G8R8A8_SINT:
+                            case VK_FORMAT_B8G8R8A8_UNORM:
+                            case VK_FORMAT_B8G8R8A8_SRGB:
+                            case VK_FORMAT_B8G8R8A8_SNORM:
+                            case VK_FORMAT_B8G8R8A8_SSCALED:
+                            case VK_FORMAT_B8G8R8A8_USCALED:
+                                format = fuchsia_hardware_goldfish::wire::ColorBufferFormatType::
+                                        kBgra;
+                                break;
+                            case VK_FORMAT_R8G8B8A8_SINT:
+                            case VK_FORMAT_R8G8B8A8_UNORM:
+                            case VK_FORMAT_R8G8B8A8_SRGB:
+                            case VK_FORMAT_R8G8B8A8_SNORM:
+                            case VK_FORMAT_R8G8B8A8_SSCALED:
+                            case VK_FORMAT_R8G8B8A8_USCALED:
+                                format = fuchsia_hardware_goldfish::wire::ColorBufferFormatType::
+                                        kRgba;
+                                break;
+                            case VK_FORMAT_R8_UNORM:
+                            case VK_FORMAT_R8_UINT:
+                            case VK_FORMAT_R8_USCALED:
+                            case VK_FORMAT_R8_SNORM:
+                            case VK_FORMAT_R8_SINT:
+                            case VK_FORMAT_R8_SSCALED:
+                            case VK_FORMAT_R8_SRGB:
+                                format = fuchsia_hardware_goldfish::wire::ColorBufferFormatType::
+                                        kLuminance;
+                                break;
+                            case VK_FORMAT_R8G8_UNORM:
+                            case VK_FORMAT_R8G8_UINT:
+                            case VK_FORMAT_R8G8_USCALED:
+                            case VK_FORMAT_R8G8_SNORM:
+                            case VK_FORMAT_R8G8_SINT:
+                            case VK_FORMAT_R8G8_SSCALED:
+                            case VK_FORMAT_R8G8_SRGB:
+                                format =
+                                        fuchsia_hardware_goldfish::wire::ColorBufferFormatType::kRg;
+                                break;
+                            default:
+                                ALOGE("Unsupported format: %d",
+                                      pImageCreateInfo->format);
+                                abort();
+                        }
+
+                        fidl::Arena arena;
+                        fuchsia_hardware_goldfish::wire::CreateColorBuffer2Params createParams(
+                                arena);
+                        createParams.set_width(pImageCreateInfo->extent.width)
+                                .set_height(pImageCreateInfo->extent.height)
+                                .set_format(format)
+                                .set_memory_property(fuchsia_hardware_goldfish::wire::
+                                                             kMemoryPropertyDeviceLocal);
+
+                        auto result = mControlDevice->CreateColorBuffer2(std::move(vmo_copy),
+                                                                         std::move(createParams));
+                        if (!result.ok() || result->res != ZX_OK) {
+                            if (result.ok() &&
+                                result->res == ZX_ERR_ALREADY_EXISTS) {
+                                ALOGD("CreateColorBuffer: color buffer already "
+                                      "exists\n");
+                            } else {
+                                ALOGE("CreateColorBuffer failed: %d:%d",
+                                      result.status(),
+                                      GET_STATUS_SAFE(result, res));
+                                abort();
+                            }
+                        }
+                    }
+                }
+
+                if (pBufferConstraintsInfo) {
+                    fidl::Arena arena;
+                    fuchsia_hardware_goldfish::wire::CreateBuffer2Params createParams(arena);
+                    createParams
+                        .set_size(arena,
+                                  pBufferConstraintsInfo->createInfo.size)
+                        .set_memory_property(fuchsia_hardware_goldfish::wire::
+                                                 kMemoryPropertyDeviceLocal);
+
+                    auto result =
+                        mControlDevice->CreateBuffer2(std::move(vmo_copy), std::move(createParams));
+                    if (!result.ok() || result->is_error()) {
+                        ALOGE("CreateBuffer2 failed: %d:%d", result.status(),
+                              GET_STATUS_SAFE(result, error_value()));
+                        abort();
+                    }
+                }
+            } else {
+                ALOGW("Dedicated image / buffer not available. Cannot create "
+                      "BufferCollection to export VMOs.");
+                return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+            }
+        }
+
+        if (vmo_handle != ZX_HANDLE_INVALID) {
+            zx::vmo vmo_copy;
+            zx_status_t status = zx_handle_duplicate(vmo_handle,
+                                                     ZX_RIGHT_SAME_RIGHTS,
+                                                     vmo_copy.reset_and_get_address());
+            if (status != ZX_OK) {
+                ALOGE("Failed to duplicate VMO: %d", status);
+                abort();
+            }
+            zx_status_t status2 = ZX_OK;
+
+            auto result = mControlDevice->GetBufferHandle(std::move(vmo_copy));
+            if (!result.ok() || result->res != ZX_OK) {
+                ALOGE("GetBufferHandle failed: %d:%d", result.status(),
+                      GET_STATUS_SAFE(result, res));
+            } else {
+                fuchsia_hardware_goldfish::wire::BufferHandleType
+                    handle_type = result->type;
+                uint32_t buffer_handle = result->id;
+
+                if (handle_type == fuchsia_hardware_goldfish::wire::
+                                       BufferHandleType::kBuffer) {
+                    importBufferInfo.buffer = buffer_handle;
+                    vk_append_struct(&structChainIter, &importBufferInfo);
+                } else {
+                    importCbInfo.colorBuffer = buffer_handle;
+                    vk_append_struct(&structChainIter, &importCbInfo);
+                }
+            }
+        }
+#endif
+
+        if (ahw || !requestedMemoryIsHostVisible) {
+            input_result =
+                enc->vkAllocateMemory(
+                    device, &finalAllocInfo, pAllocator, pMemory, true /* do lock */);
+
+            if (input_result != VK_SUCCESS) _RETURN_FAILURE_WITH_DEVICE_MEMORY_REPORT(input_result);
+
+            VkDeviceSize allocationSize = finalAllocInfo.allocationSize;
+            setDeviceMemoryInfo(
+                device, *pMemory,
+                0, nullptr,
+                finalAllocInfo.memoryTypeIndex,
+                ahw,
+                isImport,
+                vmo_handle);
+
+            _RETURN_SCUCCESS_WITH_DEVICE_MEMORY_REPORT;
+        }
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+        if (vmo_handle != ZX_HANDLE_INVALID) {
+            input_result = enc->vkAllocateMemory(device, &finalAllocInfo, pAllocator, pMemory, true /* do lock */);
+
+            // Get VMO handle rights, and only use allowed rights to map the
+            // host memory.
+            zx_info_handle_basic handle_info;
+            zx_status_t status = zx_object_get_info(vmo_handle, ZX_INFO_HANDLE_BASIC, &handle_info,
+                                        sizeof(handle_info), nullptr, nullptr);
+            if (status != ZX_OK) {
+                ALOGE("%s: cannot get vmo object info: vmo = %u status: %d.", __func__, vmo_handle,
+                      status);
+                return VK_ERROR_OUT_OF_HOST_MEMORY;
+            }
+
+            zx_vm_option_t vm_permission = 0u;
+            vm_permission |= (handle_info.rights & ZX_RIGHT_READ) ? ZX_VM_PERM_READ : 0;
+            vm_permission |= (handle_info.rights & ZX_RIGHT_WRITE) ? ZX_VM_PERM_WRITE : 0;
+
+            zx_paddr_t addr;
+            status = zx_vmar_map(zx_vmar_root_self(), vm_permission, 0, vmo_handle, 0,
+                finalAllocInfo.allocationSize, &addr);
+            if (status != ZX_OK) {
+                ALOGE("%s: cannot map vmar: status %d.", __func__, status);
+                return VK_ERROR_OUT_OF_HOST_MEMORY;
+            }
+
+            setDeviceMemoryInfo(device, *pMemory,
+                finalAllocInfo.allocationSize,
+                reinterpret_cast<uint8_t*>(addr), finalAllocInfo.memoryTypeIndex,
+                /*ahw=*/nullptr, isImport, vmo_handle);
+            return VK_SUCCESS;
+        }
+#endif
+
+        // Host visible memory with direct mapping
+        VkResult result = getCoherentMemory(&finalAllocInfo, enc, device, pMemory);
+        if (result != VK_SUCCESS)
+            return result;
+
+        _RETURN_SCUCCESS_WITH_DEVICE_MEMORY_REPORT;
+    }
+
+    CoherentMemoryPtr freeCoherentMemoryLocked(VkDeviceMemory memory, VkDeviceMemory_Info& info) {
+        if (info.coherentMemory && info.ptr) {
+            if (info.coherentMemory->getDeviceMemory() != memory) {
+                delete_goldfish_VkDeviceMemory(memory);
+            }
+
+            if (info.ptr) {
+                info.coherentMemory->release(info.ptr);
+                info.ptr = nullptr;
+            }
+
+            return std::move(info.coherentMemory);
+        }
+
+        return nullptr;
+    }
+
+    void on_vkFreeMemory(
+        void* context,
+        VkDevice device,
+        VkDeviceMemory memory,
+        const VkAllocationCallbacks* pAllocateInfo) {
+
+        AutoLock<RecursiveLock> lock(mLock);
+
+        auto it = info_VkDeviceMemory.find(memory);
+        if (it == info_VkDeviceMemory.end()) return;
+        auto& info = it->second;
+        uint64_t memoryObjectId = (uint64_t)(void*)memory;
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+        if (info.ahw) {
+            memoryObjectId = getAHardwareBufferId(info.ahw);
+        }
+#endif
+
+        emitDeviceMemoryReport(info_VkDevice[device],
+                               info.imported ? VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_UNIMPORT_EXT
+                                             : VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_FREE_EXT,
+                               memoryObjectId, 0 /* size */, VK_OBJECT_TYPE_DEVICE_MEMORY,
+                               (uint64_t)(void*)memory);
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+        if (info.vmoHandle && info.ptr) {
+            zx_status_t status = zx_vmar_unmap(
+                zx_vmar_root_self(), reinterpret_cast<zx_paddr_t>(info.ptr), info.allocationSize);
+            if (status != ZX_OK) {
+                ALOGE("%s: Cannot unmap ptr: status %d", status);
+            }
+            info.ptr = nullptr;
+        }
+#endif
+
+        if (!info.coherentMemory) {
+            lock.unlock();
+            VkEncoder* enc = (VkEncoder*)context;
+            enc->vkFreeMemory(device, memory, pAllocateInfo, true /* do lock */);
+            return;
+        }
+
+        auto coherentMemory = freeCoherentMemoryLocked(memory, info);
+
+        // We have to release the lock before we could possibly free a
+        // CoherentMemory, because that will call into VkEncoder, which
+        // shouldn't be called when the lock is held.
+        lock.unlock();
+        coherentMemory = nullptr;
+    }
+
+    VkResult on_vkMapMemory(void* context, VkResult host_result, VkDevice device,
+                            VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size,
+                            VkMemoryMapFlags, void** ppData) {
+        if (host_result != VK_SUCCESS) {
+            ALOGE("%s: Host failed to map\n", __func__);
+            return host_result;
+        }
+
+        AutoLock<RecursiveLock> lock(mLock);
+
+        auto it = info_VkDeviceMemory.find(memory);
+        if (it == info_VkDeviceMemory.end()) {
+            ALOGE("%s: Could not find this device memory\n", __func__);
+            return VK_ERROR_MEMORY_MAP_FAILED;
+        }
+
+        auto& info = it->second;
+
+        if (info.blobId && !info.coherentMemory && !mCaps.params[kParamCreateGuestHandle]) {
+            VkEncoder* enc = (VkEncoder*)context;
+            VirtGpuBlobMappingPtr mapping;
+            VirtGpuDevice& instance = VirtGpuDevice::getInstance();
+
+            uint64_t offset;
+            uint8_t* ptr;
+
+            VkResult vkResult = enc->vkGetBlobGOOGLE(device, memory, false);
+            if (vkResult != VK_SUCCESS) return vkResult;
+
+            struct VirtGpuCreateBlob createBlob = {};
+            createBlob.blobMem = kBlobMemHost3d;
+            createBlob.flags = kBlobFlagMappable;
+            createBlob.blobId = info.blobId;
+            createBlob.size = info.coherentMemorySize;
+
+            auto blob = instance.createBlob(createBlob);
+            if (!blob) return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+
+            mapping = blob->createMapping();
+            if (!mapping) return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+
+            auto coherentMemory =
+                std::make_shared<CoherentMemory>(mapping, createBlob.size, device, memory);
+
+            coherentMemory->subAllocate(info.allocationSize, &ptr, offset);
+
+            info.coherentMemoryOffset = offset;
+            info.coherentMemory = coherentMemory;
+            info.ptr = ptr;
+        }
+
+        if (!info.ptr) {
+            ALOGE("%s: ptr null\n", __func__);
+            return VK_ERROR_MEMORY_MAP_FAILED;
+        }
+
+        if (size != VK_WHOLE_SIZE &&
+            (info.ptr + offset + size > info.ptr + info.allocationSize)) {
+            ALOGE("%s: size is too big. alloc size 0x%llx while we wanted offset 0x%llx size 0x%llx total 0x%llx\n", __func__,
+                    (unsigned long long)info.allocationSize,
+                    (unsigned long long)offset,
+                    (unsigned long long)size,
+                    (unsigned long long)offset);
+            return VK_ERROR_MEMORY_MAP_FAILED;
+        }
+
+        *ppData = info.ptr + offset;
+
+        return host_result;
+    }
+
+    void on_vkUnmapMemory(
+        void*,
+        VkDevice,
+        VkDeviceMemory) {
+        // no-op
+    }
+
+    void transformExternalResourceMemoryDedicatedRequirementsForGuest(
+        VkMemoryDedicatedRequirements* dedicatedReqs) {
+        dedicatedReqs->prefersDedicatedAllocation = VK_TRUE;
+        dedicatedReqs->requiresDedicatedAllocation = VK_TRUE;
+    }
+
+    void transformImageMemoryRequirementsForGuestLocked(
+        VkImage image,
+        VkMemoryRequirements* reqs) {
+
+        setMemoryRequirementsForSysmemBackedImage(image, reqs);
+    }
+
+    void transformImageMemoryRequirements2ForGuest(
+        VkImage image,
+        VkMemoryRequirements2* reqs2) {
+
+        AutoLock<RecursiveLock> lock(mLock);
+
+        auto it = info_VkImage.find(image);
+        if (it == info_VkImage.end()) return;
+
+        auto& info = it->second;
+
+        if (!info.external ||
+            !info.externalCreateInfo.handleTypes) {
+            setMemoryRequirementsForSysmemBackedImage(image, &reqs2->memoryRequirements);
+            return;
+        }
+
+        setMemoryRequirementsForSysmemBackedImage(image, &reqs2->memoryRequirements);
+
+        VkMemoryDedicatedRequirements* dedicatedReqs =
+            vk_find_struct<VkMemoryDedicatedRequirements>(reqs2);
+
+        if (!dedicatedReqs) return;
+
+        transformExternalResourceMemoryDedicatedRequirementsForGuest(
+            dedicatedReqs);
+    }
+
+    void transformBufferMemoryRequirements2ForGuest(
+        VkBuffer buffer,
+        VkMemoryRequirements2* reqs2) {
+
+        AutoLock<RecursiveLock> lock(mLock);
+
+        auto it = info_VkBuffer.find(buffer);
+        if (it == info_VkBuffer.end()) return;
+
+        auto& info = it->second;
+
+        if (!info.external ||
+            !info.externalCreateInfo.handleTypes) {
+            return;
+        }
+
+        VkMemoryDedicatedRequirements* dedicatedReqs =
+            vk_find_struct<VkMemoryDedicatedRequirements>(reqs2);
+
+        if (!dedicatedReqs) return;
+
+        transformExternalResourceMemoryDedicatedRequirementsForGuest(
+            dedicatedReqs);
+    }
+
+    VkResult on_vkCreateImage(
+        void* context, VkResult,
+        VkDevice device, const VkImageCreateInfo *pCreateInfo,
+        const VkAllocationCallbacks *pAllocator,
+        VkImage *pImage) {
+        VkEncoder* enc = (VkEncoder*)context;
+
+        VkImageCreateInfo localCreateInfo = vk_make_orphan_copy(*pCreateInfo);
+        vk_struct_chain_iterator structChainIter = vk_make_chain_iterator(&localCreateInfo);
+        VkExternalMemoryImageCreateInfo localExtImgCi;
+
+        const VkExternalMemoryImageCreateInfo* extImgCiPtr =
+            vk_find_struct<VkExternalMemoryImageCreateInfo>(pCreateInfo);
+        if (extImgCiPtr) {
+            localExtImgCi = vk_make_orphan_copy(*extImgCiPtr);
+            vk_append_struct(&structChainIter, &localExtImgCi);
+        }
+
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+        VkNativeBufferANDROID localAnb;
+        const VkNativeBufferANDROID* anbInfoPtr =
+            vk_find_struct<VkNativeBufferANDROID>(pCreateInfo);
+        if (anbInfoPtr) {
+            localAnb = vk_make_orphan_copy(*anbInfoPtr);
+            vk_append_struct(&structChainIter, &localAnb);
+        }
+
+        VkExternalFormatANDROID localExtFormatAndroid;
+        const VkExternalFormatANDROID* extFormatAndroidPtr =
+            vk_find_struct<VkExternalFormatANDROID>(pCreateInfo);
+        if (extFormatAndroidPtr) {
+            localExtFormatAndroid = vk_make_orphan_copy(*extFormatAndroidPtr);
+
+            // Do not append external format android;
+            // instead, replace the local image localCreateInfo format
+            // with the corresponding Vulkan format
+            if (extFormatAndroidPtr->externalFormat) {
+                localCreateInfo.format =
+                    vk_format_from_android(extFormatAndroidPtr->externalFormat);
+                if (localCreateInfo.format == VK_FORMAT_UNDEFINED)
+                    return VK_ERROR_VALIDATION_FAILED_EXT;
+            }
+        }
+#endif
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+        const VkBufferCollectionImageCreateInfoFUCHSIA* extBufferCollectionPtr =
+            vk_find_struct<VkBufferCollectionImageCreateInfoFUCHSIA>(
+                pCreateInfo);
+
+        bool isSysmemBackedMemory = false;
+
+        if (extImgCiPtr &&
+            (extImgCiPtr->handleTypes &
+             VK_EXTERNAL_MEMORY_HANDLE_TYPE_ZIRCON_VMO_BIT_FUCHSIA)) {
+            isSysmemBackedMemory = true;
+        }
+
+        if (extBufferCollectionPtr) {
+            const auto& collection = *reinterpret_cast<
+                fidl::WireSyncClient<fuchsia_sysmem::BufferCollection>*>(
+                extBufferCollectionPtr->collection);
+            uint32_t index = extBufferCollectionPtr->index;
+            zx::vmo vmo;
+
+            fuchsia_sysmem::wire::BufferCollectionInfo2 info;
+
+            auto result = collection->WaitForBuffersAllocated();
+            if (result.ok() && result->status == ZX_OK) {
+                info = std::move(result->buffer_collection_info);
+                if (index < info.buffer_count && info.settings.has_image_format_constraints) {
+                    vmo = std::move(info.buffers[index].vmo);
+                }
+            } else {
+                ALOGE("WaitForBuffersAllocated failed: %d %d", result.status(),
+                      GET_STATUS_SAFE(result, status));
+            }
+
+            if (vmo.is_valid()) {
+                zx::vmo vmo_dup;
+                if (zx_status_t status = vmo.duplicate(ZX_RIGHT_SAME_RIGHTS, &vmo_dup);
+                    status != ZX_OK) {
+                    ALOGE("%s: zx_vmo_duplicate failed: %d", __func__, status);
+                    abort();
+                }
+
+                auto buffer_handle_result = mControlDevice->GetBufferHandle(std::move(vmo_dup));
+                if (!buffer_handle_result.ok()) {
+                    ALOGE("%s: GetBufferHandle FIDL error: %d", __func__,
+                          buffer_handle_result.status());
+                    abort();
+                }
+                if (buffer_handle_result.value().res == ZX_OK) {
+                    // Buffer handle already exists.
+                    // If it is a ColorBuffer, no-op; Otherwise return error.
+                    if (buffer_handle_result.value().type !=
+                        fuchsia_hardware_goldfish::wire::BufferHandleType::kColorBuffer) {
+                        ALOGE("%s: BufferHandle %u is not a ColorBuffer", __func__,
+                              buffer_handle_result.value().id);
+                        return VK_ERROR_OUT_OF_HOST_MEMORY;
+                    }
+                } else if (buffer_handle_result.value().res == ZX_ERR_NOT_FOUND) {
+                    // Buffer handle not found. Create ColorBuffer based on buffer settings.
+                    auto format =
+                        info.settings.image_format_constraints.pixel_format.type ==
+                                fuchsia_sysmem::wire::PixelFormatType::kR8G8B8A8
+                            ? fuchsia_hardware_goldfish::wire::ColorBufferFormatType::kRgba
+                            : fuchsia_hardware_goldfish::wire::ColorBufferFormatType::kBgra;
+
+                    uint32_t memory_property =
+                        info.settings.buffer_settings.heap ==
+                                fuchsia_sysmem::wire::HeapType::kGoldfishDeviceLocal
+                            ? fuchsia_hardware_goldfish::wire::kMemoryPropertyDeviceLocal
+                            : fuchsia_hardware_goldfish::wire::kMemoryPropertyHostVisible;
+
+                    fidl::Arena arena;
+                    fuchsia_hardware_goldfish::wire::CreateColorBuffer2Params createParams(
+                        arena);
+                    createParams.set_width(
+                            info.settings.image_format_constraints.min_coded_width)
+                        .set_height(
+                            info.settings.image_format_constraints.min_coded_height)
+                        .set_format(format)
+                        .set_memory_property(memory_property);
+
+                    auto result =
+                        mControlDevice->CreateColorBuffer2(std::move(vmo), std::move(createParams));
+                    if (result.ok() && result->res == ZX_ERR_ALREADY_EXISTS) {
+                        ALOGD(
+                            "CreateColorBuffer: color buffer already exists\n");
+                    } else if (!result.ok() || result->res != ZX_OK) {
+                        ALOGE("CreateColorBuffer failed: %d:%d", result.status(),
+                            GET_STATUS_SAFE(result, res));
+                    }
+                }
+
+                if (info.settings.buffer_settings.heap ==
+                    fuchsia_sysmem::wire::HeapType::kGoldfishHostVisible) {
+                    ALOGD(
+                        "%s: Image uses host visible memory heap; set tiling "
+                        "to linear to match host ImageCreateInfo",
+                        __func__);
+                    localCreateInfo.tiling = VK_IMAGE_TILING_LINEAR;
+                }
+            }
+            isSysmemBackedMemory = true;
+        }
+
+        if (isSysmemBackedMemory) {
+            localCreateInfo.flags |= VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
+        }
+#endif
+
+        VkResult res;
+        VkMemoryRequirements memReqs;
+
+        if (supportsCreateResourcesWithRequirements()) {
+            res = enc->vkCreateImageWithRequirementsGOOGLE(device, &localCreateInfo, pAllocator, pImage, &memReqs, true /* do lock */);
+        } else {
+            res = enc->vkCreateImage(device, &localCreateInfo, pAllocator, pImage, true /* do lock */);
+        }
+
+        if (res != VK_SUCCESS) return res;
+
+        AutoLock<RecursiveLock> lock(mLock);
+
+        auto it = info_VkImage.find(*pImage);
+        if (it == info_VkImage.end()) return VK_ERROR_INITIALIZATION_FAILED;
+
+        auto& info = it->second;
+
+        info.device = device;
+        info.createInfo = *pCreateInfo;
+        info.createInfo.pNext = nullptr;
+
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+        if (extFormatAndroidPtr && extFormatAndroidPtr->externalFormat) {
+            info.hasExternalFormat = true;
+            info.androidFormat = extFormatAndroidPtr->externalFormat;
+        }
+#endif  // VK_USE_PLATFORM_ANDROID_KHR
+
+        if (supportsCreateResourcesWithRequirements()) {
+            info.baseRequirementsKnown = true;
+        }
+
+        if (extImgCiPtr) {
+            info.external = true;
+            info.externalCreateInfo = *extImgCiPtr;
+        }
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+        if (isSysmemBackedMemory) {
+            info.isSysmemBackedMemory = true;
+        }
+#endif
+
+// Delete `protocolVersion` check goldfish drivers are gone.
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+        if (extImgCiPtr &&
+            mCaps.gfxstreamCapset.protocolVersion &&
+            (extImgCiPtr->handleTypes &
+             VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID)) {
+            updateMemoryTypeBits(&memReqs.memoryTypeBits,
+                                 mCaps.gfxstreamCapset.colorBufferMemoryIndex);
+        }
+#endif
+
+        if (info.baseRequirementsKnown) {
+            transformImageMemoryRequirementsForGuestLocked(*pImage, &memReqs);
+            info.baseRequirements = memReqs;
+        }
+        return res;
+    }
+
+    VkResult on_vkCreateSamplerYcbcrConversion(
+        void* context, VkResult,
+        VkDevice device,
+        const VkSamplerYcbcrConversionCreateInfo* pCreateInfo,
+        const VkAllocationCallbacks* pAllocator,
+        VkSamplerYcbcrConversion* pYcbcrConversion) {
+
+        VkSamplerYcbcrConversionCreateInfo localCreateInfo = vk_make_orphan_copy(*pCreateInfo);
+
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+        const VkExternalFormatANDROID* extFormatAndroidPtr =
+            vk_find_struct<VkExternalFormatANDROID>(pCreateInfo);
+        if (extFormatAndroidPtr) {
+            if (extFormatAndroidPtr->externalFormat == AHARDWAREBUFFER_FORMAT_R5G6B5_UNORM) {
+                // We don't support external formats on host and it causes RGB565
+                // to fail in CtsGraphicsTestCases android.graphics.cts.BasicVulkanGpuTest
+                // when passed as an external format.
+                // We may consider doing this for all external formats.
+                // See b/134771579.
+                *pYcbcrConversion = VK_YCBCR_CONVERSION_DO_NOTHING;
+                return VK_SUCCESS;
+            } else if (extFormatAndroidPtr->externalFormat) {
+                localCreateInfo.format =
+                    vk_format_from_android(extFormatAndroidPtr->externalFormat);
+            }
+        }
+#endif
+
+        VkEncoder* enc = (VkEncoder*)context;
+        VkResult res = enc->vkCreateSamplerYcbcrConversion(
+            device, &localCreateInfo, pAllocator, pYcbcrConversion, true /* do lock */);
+
+        if (*pYcbcrConversion == VK_YCBCR_CONVERSION_DO_NOTHING) {
+            ALOGE("FATAL: vkCreateSamplerYcbcrConversion returned a reserved value (VK_YCBCR_CONVERSION_DO_NOTHING)");
+            abort();
+        }
+        return res;
+    }
+
+    void on_vkDestroySamplerYcbcrConversion(
+        void* context,
+        VkDevice device,
+        VkSamplerYcbcrConversion ycbcrConversion,
+        const VkAllocationCallbacks* pAllocator) {
+        VkEncoder* enc = (VkEncoder*)context;
+        if (ycbcrConversion != VK_YCBCR_CONVERSION_DO_NOTHING) {
+            enc->vkDestroySamplerYcbcrConversion(device, ycbcrConversion, pAllocator, true /* do lock */);
+        }
+    }
+
+    VkResult on_vkCreateSamplerYcbcrConversionKHR(
+        void* context, VkResult,
+        VkDevice device,
+        const VkSamplerYcbcrConversionCreateInfo* pCreateInfo,
+        const VkAllocationCallbacks* pAllocator,
+        VkSamplerYcbcrConversion* pYcbcrConversion) {
+
+        VkSamplerYcbcrConversionCreateInfo localCreateInfo = vk_make_orphan_copy(*pCreateInfo);
+
+#if defined(VK_USE_PLATFORM_ANDROID_KHR)
+        const VkExternalFormatANDROID* extFormatAndroidPtr =
+            vk_find_struct<VkExternalFormatANDROID>(pCreateInfo);
+        if (extFormatAndroidPtr) {
+            if (extFormatAndroidPtr->externalFormat == AHARDWAREBUFFER_FORMAT_R5G6B5_UNORM) {
+                // We don't support external formats on host and it causes RGB565
+                // to fail in CtsGraphicsTestCases android.graphics.cts.BasicVulkanGpuTest
+                // when passed as an external format.
+                // We may consider doing this for all external formats.
+                // See b/134771579.
+                *pYcbcrConversion = VK_YCBCR_CONVERSION_DO_NOTHING;
+                return VK_SUCCESS;
+            } else if (extFormatAndroidPtr->externalFormat) {
+                localCreateInfo.format =
+                    vk_format_from_android(extFormatAndroidPtr->externalFormat);
+            }
+        }
+#endif
+
+        VkEncoder* enc = (VkEncoder*)context;
+        VkResult res = enc->vkCreateSamplerYcbcrConversionKHR(
+            device, &localCreateInfo, pAllocator, pYcbcrConversion, true /* do lock */);
+
+        if (*pYcbcrConversion == VK_YCBCR_CONVERSION_DO_NOTHING) {
+            ALOGE("FATAL: vkCreateSamplerYcbcrConversionKHR returned a reserved value (VK_YCBCR_CONVERSION_DO_NOTHING)");
+            abort();
+        }
+        return res;
+    }
+
+    void on_vkDestroySamplerYcbcrConversionKHR(
+        void* context,
+        VkDevice device,
+        VkSamplerYcbcrConversion ycbcrConversion,
+        const VkAllocationCallbacks* pAllocator) {
+        VkEncoder* enc = (VkEncoder*)context;
+        if (ycbcrConversion != VK_YCBCR_CONVERSION_DO_NOTHING) {
+            enc->vkDestroySamplerYcbcrConversionKHR(device, ycbcrConversion, pAllocator, true /* do lock */);
+        }
+    }
+
+    VkResult on_vkCreateSampler(
+        void* context, VkResult,
+        VkDevice device,
+        const VkSamplerCreateInfo* pCreateInfo,
+        const VkAllocationCallbacks* pAllocator,
+        VkSampler* pSampler) {
+        VkSamplerCreateInfo localCreateInfo = vk_make_orphan_copy(*pCreateInfo);
+        vk_struct_chain_iterator structChainIter = vk_make_chain_iterator(&localCreateInfo);
+
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(VK_USE_PLATFORM_FUCHSIA)
+        VkSamplerYcbcrConversionInfo localVkSamplerYcbcrConversionInfo;
+        const VkSamplerYcbcrConversionInfo* samplerYcbcrConversionInfo =
+            vk_find_struct<VkSamplerYcbcrConversionInfo>(pCreateInfo);
+        if (samplerYcbcrConversionInfo) {
+            if (samplerYcbcrConversionInfo->conversion != VK_YCBCR_CONVERSION_DO_NOTHING) {
+                localVkSamplerYcbcrConversionInfo =
+                    vk_make_orphan_copy(*samplerYcbcrConversionInfo);
+                vk_append_struct(&structChainIter, &localVkSamplerYcbcrConversionInfo);
+            }
+        }
+
+        VkSamplerCustomBorderColorCreateInfoEXT localVkSamplerCustomBorderColorCreateInfo;
+        const VkSamplerCustomBorderColorCreateInfoEXT* samplerCustomBorderColorCreateInfo =
+            vk_find_struct<VkSamplerCustomBorderColorCreateInfoEXT>(pCreateInfo);
+        if (samplerCustomBorderColorCreateInfo) {
+            localVkSamplerCustomBorderColorCreateInfo =
+                vk_make_orphan_copy(*samplerCustomBorderColorCreateInfo);
+            vk_append_struct(&structChainIter, &localVkSamplerCustomBorderColorCreateInfo);
+        }
+#endif
+
+        VkEncoder* enc = (VkEncoder*)context;
+        return enc->vkCreateSampler(device, &localCreateInfo, pAllocator, pSampler, true /* do lock */);
+    }
+
+    void on_vkGetPhysicalDeviceExternalFenceProperties(
+        void* context,
+        VkPhysicalDevice physicalDevice,
+        const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo,
+        VkExternalFenceProperties* pExternalFenceProperties) {
+
+        (void)context;
+        (void)physicalDevice;
+
+        pExternalFenceProperties->exportFromImportedHandleTypes = 0;
+        pExternalFenceProperties->compatibleHandleTypes = 0;
+        pExternalFenceProperties->externalFenceFeatures = 0;
+
+        bool syncFd =
+            pExternalFenceInfo->handleType &
+            VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT;
+
+        if (!syncFd) {
+            return;
+        }
+
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__)
+        pExternalFenceProperties->exportFromImportedHandleTypes =
+            VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT;
+        pExternalFenceProperties->compatibleHandleTypes =
+            VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT;
+        pExternalFenceProperties->externalFenceFeatures =
+            VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT |
+            VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT;
+
+        D("%s: asked for sync fd, set the features\n", __func__);
+#endif
+    }
+
+    VkResult on_vkCreateFence(
+        void* context,
+        VkResult input_result,
+        VkDevice device,
+        const VkFenceCreateInfo* pCreateInfo,
+        const VkAllocationCallbacks* pAllocator, VkFence* pFence) {
+
+        VkEncoder* enc = (VkEncoder*)context;
+        VkFenceCreateInfo finalCreateInfo = *pCreateInfo;
+
+        const VkExportFenceCreateInfo* exportFenceInfoPtr =
+            vk_find_struct<VkExportFenceCreateInfo>(pCreateInfo);
+
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__)
+        bool exportSyncFd =
+            exportFenceInfoPtr &&
+            (exportFenceInfoPtr->handleTypes &
+             VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT);
+#endif
+
+        input_result = enc->vkCreateFence(
+            device, &finalCreateInfo, pAllocator, pFence, true /* do lock */);
+
+        if (input_result != VK_SUCCESS) return input_result;
+
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__)
+        if (exportSyncFd) {
+            if (!mFeatureInfo->hasVirtioGpuNativeSync) {
+                ALOGV("%s: ensure sync device\n", __func__);
+                ensureSyncDeviceFd();
+            }
+
+            ALOGV("%s: getting fence info\n", __func__);
+            AutoLock<RecursiveLock> lock(mLock);
+            auto it = info_VkFence.find(*pFence);
+
+            if (it == info_VkFence.end())
+                return VK_ERROR_INITIALIZATION_FAILED;
+
+            auto& info = it->second;
+
+            info.external = true;
+            info.exportFenceCreateInfo = *exportFenceInfoPtr;
+            ALOGV("%s: info set (fence still -1). fence: %p\n", __func__, (void*)(*pFence));
+            // syncFd is still -1 because we expect user to explicitly
+            // export it via vkGetFenceFdKHR
+        }
+#endif
+
+        return input_result;
+    }
+
+    void on_vkDestroyFence(
+        void* context,
+        VkDevice device,
+        VkFence fence,
+        const VkAllocationCallbacks* pAllocator) {
+        VkEncoder* enc = (VkEncoder*)context;
+        enc->vkDestroyFence(device, fence, pAllocator, true /* do lock */);
+    }
+
+    VkResult on_vkResetFences(
+        void* context,
+        VkResult,
+        VkDevice device,
+        uint32_t fenceCount,
+        const VkFence* pFences) {
+
+        VkEncoder* enc = (VkEncoder*)context;
+        VkResult res = enc->vkResetFences(device, fenceCount, pFences, true /* do lock */);
+
+        if (res != VK_SUCCESS) return res;
+
+        if (!fenceCount) return res;
+
+        // Permanence: temporary
+        // on fence reset, close the fence fd
+        // and act like we need to GetFenceFdKHR/ImportFenceFdKHR again
+        AutoLock<RecursiveLock> lock(mLock);
+        for (uint32_t i = 0; i < fenceCount; ++i) {
+            VkFence fence = pFences[i];
+            auto it = info_VkFence.find(fence);
+            auto& info = it->second;
+            if (!info.external) continue;
+
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__)
+            if (info.syncFd >= 0) {
+                ALOGV("%s: resetting fence. make fd -1\n", __func__);
+                goldfish_sync_signal(info.syncFd);
+                close(info.syncFd);
+                info.syncFd = -1;
+            }
+#endif
+        }
+
+        return res;
+    }
+
+    VkResult on_vkImportFenceFdKHR(
+        void* context,
+        VkResult,
+        VkDevice device,
+        const VkImportFenceFdInfoKHR* pImportFenceFdInfo) {
+
+        (void)context;
+        (void)device;
+        (void)pImportFenceFdInfo;
+
+        // Transference: copy
+        // meaning dup() the incoming fd
+
+        VkEncoder* enc = (VkEncoder*)context;
+
+        bool hasFence = pImportFenceFdInfo->fence != VK_NULL_HANDLE;
+
+        if (!hasFence) return VK_ERROR_OUT_OF_HOST_MEMORY;
+
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__)
+
+        bool syncFdImport =
+            pImportFenceFdInfo->handleType & VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT;
+
+        if (!syncFdImport) {
+            ALOGV("%s: VK_ERROR_OUT_OF_HOST_MEMORY: no sync fd import\n", __func__);
+            return VK_ERROR_OUT_OF_HOST_MEMORY;
+        }
+
+        AutoLock<RecursiveLock> lock(mLock);
+        auto it = info_VkFence.find(pImportFenceFdInfo->fence);
+        if (it == info_VkFence.end()) {
+            ALOGV("%s: VK_ERROR_OUT_OF_HOST_MEMORY: no fence info\n", __func__);
+            return VK_ERROR_OUT_OF_HOST_MEMORY;
+        }
+
+        auto& info = it->second;
+
+        if (info.syncFd >= 0) {
+            ALOGV("%s: previous sync fd exists, close it\n", __func__);
+            goldfish_sync_signal(info.syncFd);
+            close(info.syncFd);
+        }
+
+        if (pImportFenceFdInfo->fd < 0) {
+            ALOGV("%s: import -1, set to -1 and exit\n", __func__);
+            info.syncFd = -1;
+        } else {
+            ALOGV("%s: import actual fd, dup and close()\n", __func__);
+            info.syncFd = dup(pImportFenceFdInfo->fd);
+            close(pImportFenceFdInfo->fd);
+        }
+        return VK_SUCCESS;
+#else
+        return VK_ERROR_OUT_OF_HOST_MEMORY;
+#endif
+    }
+
+    VkResult createFence(VkDevice device, uint64_t hostFenceHandle, int64_t& osHandle) {
+        struct VirtGpuExecBuffer exec = { };
+        struct gfxstreamCreateExportSyncVK exportSync = { };
+        VirtGpuDevice& instance = VirtGpuDevice::getInstance();
+
+        uint64_t hostDeviceHandle = get_host_u64_VkDevice(device);
+
+        exportSync.hdr.opCode = GFXSTREAM_CREATE_EXPORT_SYNC_VK;
+        exportSync.deviceHandleLo = (uint32_t)hostDeviceHandle;
+        exportSync.deviceHandleHi = (uint32_t)(hostDeviceHandle >> 32);
+        exportSync.fenceHandleLo = (uint32_t)hostFenceHandle;
+        exportSync.fenceHandleHi = (uint32_t)(hostFenceHandle >> 32);
+
+        exec.command = static_cast<void*>(&exportSync);
+        exec.command_size = sizeof(exportSync);
+        exec.flags = kFenceOut | kRingIdx;
+        if (instance.execBuffer(exec, nullptr))
+            return VK_ERROR_OUT_OF_HOST_MEMORY;
+
+        osHandle = exec.handle.osHandle;
+        return VK_SUCCESS;
+    }
+
+    VkResult on_vkGetFenceFdKHR(
+        void* context,
+        VkResult,
+        VkDevice device,
+        const VkFenceGetFdInfoKHR* pGetFdInfo,
+        int* pFd) {
+
+        // export operation.
+        // first check if fence is signaled
+        // then if so, return -1
+        // else, queue work
+
+        VkEncoder* enc = (VkEncoder*)context;
+
+        bool hasFence = pGetFdInfo->fence != VK_NULL_HANDLE;
+
+        if (!hasFence) {
+            ALOGV("%s: VK_ERROR_OUT_OF_HOST_MEMORY: no fence\n", __func__);
+            return VK_ERROR_OUT_OF_HOST_MEMORY;
+        }
+
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__)
+        bool syncFdExport =
+            pGetFdInfo->handleType & VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT;
+
+        if (!syncFdExport) {
+            ALOGV("%s: VK_ERROR_OUT_OF_HOST_MEMORY: no sync fd fence\n", __func__);
+            return VK_ERROR_OUT_OF_HOST_MEMORY;
+        }
+
+        VkResult currentFenceStatus = enc->vkGetFenceStatus(device, pGetFdInfo->fence, true /* do lock */);
+
+        if (VK_ERROR_DEVICE_LOST == currentFenceStatus) { // Other error
+            ALOGV("%s: VK_ERROR_DEVICE_LOST: Other error\n", __func__);
+            *pFd = -1;
+            return VK_ERROR_DEVICE_LOST;
+        }
+
+        if (VK_NOT_READY == currentFenceStatus || VK_SUCCESS == currentFenceStatus) {
+            // Fence is valid. We also create a new sync fd for a signaled
+            // fence, because ANGLE will use the returned fd directly to
+            // implement eglDupNativeFenceFDANDROID, where -1 is only returned
+            // when error occurs.
+            AutoLock<RecursiveLock> lock(mLock);
+
+            auto it = info_VkFence.find(pGetFdInfo->fence);
+            if (it == info_VkFence.end()) {
+                ALOGV("%s: VK_ERROR_OUT_OF_HOST_MEMORY: no fence info\n", __func__);
+                return VK_ERROR_OUT_OF_HOST_MEMORY;
+            }
+
+            auto& info = it->second;
+
+            bool syncFdCreated =
+                info.external &&
+                (info.exportFenceCreateInfo.handleTypes &
+                 VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT);
+
+            if (!syncFdCreated) {
+                ALOGV("%s: VK_ERROR_OUT_OF_HOST_MEMORY: no sync fd created\n", __func__);
+                return VK_ERROR_OUT_OF_HOST_MEMORY;
+            }
+
+            if (mFeatureInfo->hasVirtioGpuNativeSync) {
+                VkResult result;
+                int64_t osHandle;
+                uint64_t hostFenceHandle = get_host_u64_VkFence(pGetFdInfo->fence);
+
+                result = createFence(device, hostFenceHandle, osHandle);
+                if (result != VK_SUCCESS)
+                    return result;
+
+                *pFd = osHandle;
+            } else {
+                goldfish_sync_queue_work(
+                    mSyncDeviceFd,
+                    get_host_u64_VkFence(pGetFdInfo->fence) /* the handle */,
+                    GOLDFISH_SYNC_VULKAN_SEMAPHORE_SYNC /* thread handle (doubling as type field) */,
+                    pFd);
+            }
+
+            // relinquish ownership
+            info.syncFd = -1;
+            ALOGV("%s: got fd: %d\n", __func__, *pFd);
+            return VK_SUCCESS;
+        }
+        return VK_ERROR_DEVICE_LOST;
+#else
+        return VK_ERROR_OUT_OF_HOST_MEMORY;
+#endif
+    }
+
+    VkResult on_vkWaitForFences(
+        void* context,
+        VkResult,
+        VkDevice device,
+        uint32_t fenceCount,
+        const VkFence* pFences,
+        VkBool32 waitAll,
+        uint64_t timeout) {
+
+        VkEncoder* enc = (VkEncoder*)context;
+
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__)
+        std::vector<VkFence> fencesExternal;
+        std::vector<int> fencesExternalWaitFds;
+        std::vector<VkFence> fencesNonExternal;
+
+        AutoLock<RecursiveLock> lock(mLock);
+
+        for (uint32_t i = 0; i < fenceCount; ++i) {
+            auto it = info_VkFence.find(pFences[i]);
+            if (it == info_VkFence.end()) continue;
+            const auto& info = it->second;
+            if (info.syncFd >= 0) {
+                fencesExternal.push_back(pFences[i]);
+                fencesExternalWaitFds.push_back(info.syncFd);
+            } else {
+                fencesNonExternal.push_back(pFences[i]);
+            }
+        }
+
+        lock.unlock();
+
+        if (fencesExternal.empty()) {
+            // No need for work pool, just wait with host driver.
+            return enc->vkWaitForFences(
+                device, fenceCount, pFences, waitAll, timeout, true /* do lock */);
+        } else {
+            // Depending on wait any or wait all,
+            // schedule a wait group with waitAny/waitAll
+            std::vector<WorkPool::Task> tasks;
+
+            ALOGV("%s: scheduling ext waits\n", __func__);
+
+            for (auto fd : fencesExternalWaitFds) {
+                ALOGV("%s: wait on %d\n", __func__, fd);
+                tasks.push_back([fd] {
+                    sync_wait(fd, 3000);
+                    ALOGV("done waiting on fd %d\n", fd);
+                });
+            }
+
+            if (!fencesNonExternal.empty()) {
+                tasks.push_back([this,
+                                 fencesNonExternal /* copy of vector */,
+                                 device, waitAll, timeout] {
+                    auto hostConn = ResourceTracker::threadingCallbacks.hostConnectionGetFunc();
+                    auto vkEncoder = ResourceTracker::threadingCallbacks.vkEncoderGetFunc(hostConn);
+                    ALOGV("%s: vkWaitForFences to host\n", __func__);
+                    vkEncoder->vkWaitForFences(device, fencesNonExternal.size(), fencesNonExternal.data(), waitAll, timeout, true /* do lock */);
+                });
+            }
+
+            auto waitGroupHandle = mWorkPool.schedule(tasks);
+
+            // Convert timeout to microseconds from nanoseconds
+            bool waitRes = false;
+            if (waitAll) {
+                waitRes = mWorkPool.waitAll(waitGroupHandle, timeout / 1000);
+            } else {
+                waitRes = mWorkPool.waitAny(waitGroupHandle, timeout / 1000);
+            }
+
+            if (waitRes) {
+                ALOGV("%s: VK_SUCCESS\n", __func__);
+                return VK_SUCCESS;
+            } else {
+                ALOGV("%s: VK_TIMEOUT\n", __func__);
+                return VK_TIMEOUT;
+            }
+        }
+#else
+        return enc->vkWaitForFences(
+            device, fenceCount, pFences, waitAll, timeout, true /* do lock */);
+#endif
+    }
+
+    VkResult on_vkCreateDescriptorPool(
+        void* context,
+        VkResult,
+        VkDevice device,
+        const VkDescriptorPoolCreateInfo* pCreateInfo,
+        const VkAllocationCallbacks* pAllocator,
+        VkDescriptorPool* pDescriptorPool) {
+
+        VkEncoder* enc = (VkEncoder*)context;
+
+        VkResult res = enc->vkCreateDescriptorPool(
+            device, pCreateInfo, pAllocator, pDescriptorPool, true /* do lock */);
+
+        if (res != VK_SUCCESS) return res;
+
+        VkDescriptorPool pool = *pDescriptorPool;
+
+        struct goldfish_VkDescriptorPool* dp = as_goldfish_VkDescriptorPool(pool);
+        dp->allocInfo = new DescriptorPoolAllocationInfo;
+        dp->allocInfo->device = device;
+        dp->allocInfo->createFlags = pCreateInfo->flags;
+        dp->allocInfo->maxSets = pCreateInfo->maxSets;
+        dp->allocInfo->usedSets = 0;
+
+        for (uint32_t i = 0; i < pCreateInfo->poolSizeCount; ++i) {
+            dp->allocInfo->descriptorCountInfo.push_back({
+                pCreateInfo->pPoolSizes[i].type,
+                pCreateInfo->pPoolSizes[i].descriptorCount,
+                0, /* used */
+            });
+        }
+
+        if (mFeatureInfo->hasVulkanBatchedDescriptorSetUpdate) {
+            std::vector<uint64_t> poolIds(pCreateInfo->maxSets);
+
+            uint32_t count = pCreateInfo->maxSets;
+            enc->vkCollectDescriptorPoolIdsGOOGLE(
+                device, pool, &count, poolIds.data(), true /* do lock */);
+
+            dp->allocInfo->freePoolIds = poolIds;
+        }
+
+        return res;
+    }
+
+    void on_vkDestroyDescriptorPool(
+        void* context,
+        VkDevice device,
+        VkDescriptorPool descriptorPool,
+        const VkAllocationCallbacks* pAllocator) {
+
+        if (!descriptorPool) return;
+
+        VkEncoder* enc = (VkEncoder*)context;
+
+        clearDescriptorPoolAndUnregisterDescriptorSets(context, device, descriptorPool);
+
+        enc->vkDestroyDescriptorPool(device, descriptorPool, pAllocator, true /* do lock */);
+    }
+
+    VkResult on_vkResetDescriptorPool(
+        void* context,
+        VkResult,
+        VkDevice device,
+        VkDescriptorPool descriptorPool,
+        VkDescriptorPoolResetFlags flags) {
+
+        if (!descriptorPool) return VK_ERROR_INITIALIZATION_FAILED;
+
+        VkEncoder* enc = (VkEncoder*)context;
+
+        VkResult res = enc->vkResetDescriptorPool(device, descriptorPool, flags, true /* do lock */);
+
+        if (res != VK_SUCCESS) return res;
+
+        clearDescriptorPoolAndUnregisterDescriptorSets(context, device, descriptorPool);
+        return res;
+    }
+
+    VkResult on_vkAllocateDescriptorSets(
+        void* context,
+        VkResult,
+        VkDevice device,
+        const VkDescriptorSetAllocateInfo*          pAllocateInfo,
+        VkDescriptorSet*                            pDescriptorSets) {
+
+        VkEncoder* enc = (VkEncoder*)context;
+
+        return allocAndInitializeDescriptorSets(context, device, pAllocateInfo, pDescriptorSets);
+    }
+
+    VkResult on_vkFreeDescriptorSets(
+        void* context,
+        VkResult,
+        VkDevice                                    device,
+        VkDescriptorPool                            descriptorPool,
+        uint32_t                                    descriptorSetCount,
+        const VkDescriptorSet*                      pDescriptorSets) {
+
+        VkEncoder* enc = (VkEncoder*)context;
+
+        // Bit of robustness so that we can double free descriptor sets
+        // and do other invalid usages
+        // https://github.com/KhronosGroup/Vulkan-Docs/issues/1070
+        // (people expect VK_SUCCESS to always be returned by vkFreeDescriptorSets)
+        std::vector<VkDescriptorSet> toActuallyFree;
+        {
+            AutoLock<RecursiveLock> lock(mLock);
+
+            // Pool was destroyed
+            if (info_VkDescriptorPool.find(descriptorPool) == info_VkDescriptorPool.end()) {
+                return VK_SUCCESS;
+            }
+
+            if (!descriptorPoolSupportsIndividualFreeLocked(descriptorPool))
+                return VK_SUCCESS;
+
+            std::vector<VkDescriptorSet> existingDescriptorSets;;
+
+            // Check if this descriptor set was in the pool's set of allocated descriptor sets,
+            // to guard against double free (Double free is allowed by the client)
+            {
+                auto allocedSets = as_goldfish_VkDescriptorPool(descriptorPool)->allocInfo->allocedSets;
+
+                for (uint32_t i = 0; i < descriptorSetCount; ++i) {
+
+                    if (allocedSets.end() == allocedSets.find(pDescriptorSets[i])) {
+                        ALOGV("%s: Warning: descriptor set %p not found in pool. Was this double-freed?\n", __func__,
+                              (void*)pDescriptorSets[i]);
+                        continue;
+                    }
+
+                    auto it = info_VkDescriptorSet.find(pDescriptorSets[i]);
+                    if (it == info_VkDescriptorSet.end())
+                        continue;
+
+                    existingDescriptorSets.push_back(pDescriptorSets[i]);
+                }
+            }
+
+            for (auto set : existingDescriptorSets) {
+                if (removeDescriptorSetFromPool(set, mFeatureInfo->hasVulkanBatchedDescriptorSetUpdate)) {
+                    toActuallyFree.push_back(set);
+                }
+            }
+
+            if (toActuallyFree.empty()) return VK_SUCCESS;
+        }
+
+        if (mFeatureInfo->hasVulkanBatchedDescriptorSetUpdate) {
+            // In the batched set update case, decrement refcount on the set layout
+            // and only free on host if we satisfied a pending allocation on the
+            // host.
+            for (uint32_t i = 0; i < toActuallyFree.size(); ++i) {
+                VkDescriptorSetLayout setLayout = as_goldfish_VkDescriptorSet(toActuallyFree[i])->reified->setLayout;
+                decDescriptorSetLayoutRef(context, device, setLayout, nullptr);
+            }
+            freeDescriptorSetsIfHostAllocated(
+                enc, device, (uint32_t)toActuallyFree.size(), toActuallyFree.data());
+        } else {
+            // In the non-batched set update case, just free them directly.
+            enc->vkFreeDescriptorSets(device, descriptorPool, (uint32_t)toActuallyFree.size(), toActuallyFree.data(), true /* do lock */);
+        }
+        return VK_SUCCESS;
+    }
+
+    VkResult on_vkCreateDescriptorSetLayout(
+        void* context,
+        VkResult,
+        VkDevice device,
+        const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
+        const VkAllocationCallbacks* pAllocator,
+        VkDescriptorSetLayout* pSetLayout) {
+
+        VkEncoder* enc = (VkEncoder*)context;
+
+        VkResult res = enc->vkCreateDescriptorSetLayout(
+            device, pCreateInfo, pAllocator, pSetLayout, true /* do lock */);
+
+        if (res != VK_SUCCESS) return res;
+
+        struct goldfish_VkDescriptorSetLayout* dsl =
+            as_goldfish_VkDescriptorSetLayout(*pSetLayout);
+        dsl->layoutInfo = new DescriptorSetLayoutInfo;
+        for (uint32_t i = 0; i < pCreateInfo->bindingCount; ++i) {
+            dsl->layoutInfo->bindings.push_back(pCreateInfo->pBindings[i]);
+        }
+        dsl->layoutInfo->refcount = 1;
+
+        return res;
+    }
+
+    void on_vkUpdateDescriptorSets(
+        void* context,
+        VkDevice device,
+        uint32_t descriptorWriteCount,
+        const VkWriteDescriptorSet* pDescriptorWrites,
+        uint32_t descriptorCopyCount,
+        const VkCopyDescriptorSet* pDescriptorCopies) {
+
+        VkEncoder* enc = (VkEncoder*)context;
+
+        std::vector<VkDescriptorImageInfo> transformedImageInfos;
+        std::vector<VkWriteDescriptorSet> transformedWrites(descriptorWriteCount);
+
+        memcpy(transformedWrites.data(), pDescriptorWrites, sizeof(VkWriteDescriptorSet) * descriptorWriteCount);
+
+        size_t imageInfosNeeded = 0;
+        for (uint32_t i = 0; i < descriptorWriteCount; ++i) {
+            if (!isDescriptorTypeImageInfo(transformedWrites[i].descriptorType)) continue;
+            if (!transformedWrites[i].pImageInfo) continue;
+
+            imageInfosNeeded += transformedWrites[i].descriptorCount;
+        }
+
+        transformedImageInfos.resize(imageInfosNeeded);
+
+        size_t imageInfoIndex = 0;
+        for (uint32_t i = 0; i < descriptorWriteCount; ++i) {
+            if (!isDescriptorTypeImageInfo(transformedWrites[i].descriptorType)) continue;
+            if (!transformedWrites[i].pImageInfo) continue;
+
+            for (uint32_t j = 0; j < transformedWrites[i].descriptorCount; ++j) {
+                transformedImageInfos[imageInfoIndex] = transformedWrites[i].pImageInfo[j];
+                ++imageInfoIndex;
+            }
+            transformedWrites[i].pImageInfo = &transformedImageInfos[imageInfoIndex - transformedWrites[i].descriptorCount];
+        }
+
+        {
+            // Validate and filter samplers
+            AutoLock<RecursiveLock> lock(mLock);
+            size_t imageInfoIndex = 0;
+            for (uint32_t i = 0; i < descriptorWriteCount; ++i) {
+
+                if (!isDescriptorTypeImageInfo(transformedWrites[i].descriptorType)) continue;
+                if (!transformedWrites[i].pImageInfo) continue;
+
+                bool isImmutableSampler =
+                    descriptorBindingIsImmutableSampler(
+                        transformedWrites[i].dstSet,
+                        transformedWrites[i].dstBinding);
+
+                for (uint32_t j = 0; j < transformedWrites[i].descriptorCount; ++j) {
+                    if (isImmutableSampler) {
+                        transformedImageInfos[imageInfoIndex].sampler = 0;
+                    }
+                    transformedImageInfos[imageInfoIndex] =
+                        filterNonexistentSampler(transformedImageInfos[imageInfoIndex]);
+                    ++imageInfoIndex;
+                }
+            }
+        }
+
+        if (mFeatureInfo->hasVulkanBatchedDescriptorSetUpdate) {
+            for (uint32_t i = 0; i < descriptorWriteCount; ++i) {
+                VkDescriptorSet set = transformedWrites[i].dstSet;
+                doEmulatedDescriptorWrite(&transformedWrites[i],
+                        as_goldfish_VkDescriptorSet(set)->reified);
+            }
+
+            for (uint32_t i = 0; i < descriptorCopyCount; ++i) {
+                doEmulatedDescriptorCopy(&pDescriptorCopies[i],
+                        as_goldfish_VkDescriptorSet(pDescriptorCopies[i].srcSet)->reified,
+                        as_goldfish_VkDescriptorSet(pDescriptorCopies[i].dstSet)->reified);
+            }
+        } else {
+            enc->vkUpdateDescriptorSets(
+                    device, descriptorWriteCount, transformedWrites.data(),
+                    descriptorCopyCount, pDescriptorCopies, true /* do lock */);
+        }
+    }
+
+    void on_vkDestroyImage(
+        void* context,
+        VkDevice device, VkImage image, const VkAllocationCallbacks *pAllocator) {
+
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+        {
+          AutoLock<RecursiveLock> lock(mLock); // do not guard encoder may cause
+                                               // deadlock b/243339973
+
+          // Wait for any pending QSRIs to prevent a race between the Gfxstream host
+          // potentially processing the below `vkDestroyImage()` from the VK encoder
+          // command stream before processing a previously submitted
+          // `VIRTIO_GPU_NATIVE_SYNC_VULKAN_QSRI_EXPORT` from the virtio-gpu command
+          // stream which relies on the image existing.
+          auto imageInfoIt = info_VkImage.find(image);
+          if (imageInfoIt != info_VkImage.end()) {
+            auto& imageInfo = imageInfoIt->second;
+            for (int syncFd : imageInfo.pendingQsriSyncFds) {
+                int syncWaitRet = sync_wait(syncFd, 3000);
+                if (syncWaitRet < 0) {
+                    ALOGE("%s: Failed to wait for pending QSRI sync: sterror: %s errno: %d",
+                          __func__, strerror(errno), errno);
+                }
+                close(syncFd);
+            }
+            imageInfo.pendingQsriSyncFds.clear();
+          }
+        }
+#endif
+        VkEncoder* enc = (VkEncoder*)context;
+        enc->vkDestroyImage(device, image, pAllocator, true /* do lock */);
+    }
+
+    void setMemoryRequirementsForSysmemBackedImage(
+        VkImage image, VkMemoryRequirements *pMemoryRequirements) {
+#ifdef VK_USE_PLATFORM_FUCHSIA
+        auto it = info_VkImage.find(image);
+        if (it == info_VkImage.end()) return;
+        auto& info = it->second;
+        if (info.isSysmemBackedMemory) {
+            auto width = info.createInfo.extent.width;
+            auto height = info.createInfo.extent.height;
+            pMemoryRequirements->size = width * height * 4;
+        }
+#else
+        // Bypass "unused parameter" checks.
+        (void)image;
+        (void)pMemoryRequirements;
+#endif
+    }
+
+    void on_vkGetImageMemoryRequirements(
+        void *context, VkDevice device, VkImage image,
+        VkMemoryRequirements *pMemoryRequirements) {
+
+        AutoLock<RecursiveLock> lock(mLock);
+
+        auto it = info_VkImage.find(image);
+        if (it == info_VkImage.end()) return;
+
+        auto& info = it->second;
+
+        if (info.baseRequirementsKnown) {
+            *pMemoryRequirements = info.baseRequirements;
+            return;
+        }
+
+        lock.unlock();
+
+        VkEncoder* enc = (VkEncoder*)context;
+
+        enc->vkGetImageMemoryRequirements(
+            device, image, pMemoryRequirements, true /* do lock */);
+
+        lock.lock();
+
+        transformImageMemoryRequirementsForGuestLocked(
+            image, pMemoryRequirements);
+
+        info.baseRequirementsKnown = true;
+        info.baseRequirements = *pMemoryRequirements;
+    }
+
+    void on_vkGetImageMemoryRequirements2(
+        void *context, VkDevice device, const VkImageMemoryRequirementsInfo2 *pInfo,
+        VkMemoryRequirements2 *pMemoryRequirements) {
+        VkEncoder* enc = (VkEncoder*)context;
+        enc->vkGetImageMemoryRequirements2(
+            device, pInfo, pMemoryRequirements, true /* do lock */);
+        transformImageMemoryRequirements2ForGuest(
+            pInfo->image, pMemoryRequirements);
+    }
+
+    void on_vkGetImageMemoryRequirements2KHR(
+        void *context, VkDevice device, const VkImageMemoryRequirementsInfo2 *pInfo,
+        VkMemoryRequirements2 *pMemoryRequirements) {
+        VkEncoder* enc = (VkEncoder*)context;
+        enc->vkGetImageMemoryRequirements2KHR(
+            device, pInfo, pMemoryRequirements, true /* do lock */);
+        transformImageMemoryRequirements2ForGuest(
+            pInfo->image, pMemoryRequirements);
+    }
+
+    VkResult on_vkBindImageMemory(
+        void* context, VkResult,
+        VkDevice device, VkImage image, VkDeviceMemory memory,
+        VkDeviceSize memoryOffset) {
+        VkEncoder* enc = (VkEncoder*)context;
+        // Do not forward calls with invalid handles to host.
+        if (info_VkDeviceMemory.find(memory) == info_VkDeviceMemory.end() ||
+            info_VkImage.find(image) == info_VkImage.end()) {
+            return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+        }
+        return enc->vkBindImageMemory(device, image, memory, memoryOffset, true /* do lock */);
+    }
+
+    VkResult on_vkBindImageMemory2(
+        void* context, VkResult,
+        VkDevice device, uint32_t bindingCount, const VkBindImageMemoryInfo* pBindInfos) {
+        VkEncoder* enc = (VkEncoder*)context;
+        // Do not forward calls with invalid handles to host.
+        if (!pBindInfos ||
+            info_VkDeviceMemory.find(pBindInfos->memory) ==
+                info_VkDeviceMemory.end() ||
+            info_VkImage.find(pBindInfos->image) == info_VkImage.end()) {
+            return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+        }
+        return enc->vkBindImageMemory2(device, bindingCount, pBindInfos, true /* do lock */);
+    }
+
+    VkResult on_vkBindImageMemory2KHR(
+        void* context, VkResult,
+        VkDevice device, uint32_t bindingCount, const VkBindImageMemoryInfo* pBindInfos) {
+        VkEncoder* enc = (VkEncoder*)context;
+        // Do not forward calls with invalid handles to host.
+        if (!pBindInfos ||
+            info_VkDeviceMemory.find(pBindInfos->memory) ==
+                info_VkDeviceMemory.end() ||
+            info_VkImage.find(pBindInfos->image) == info_VkImage.end()) {
+            return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+        }
+        return enc->vkBindImageMemory2KHR(device, bindingCount, pBindInfos, true /* do lock */);
+    }
+
+    VkResult on_vkCreateBuffer(
+        void* context, VkResult,
+        VkDevice device, const VkBufferCreateInfo *pCreateInfo,
+        const VkAllocationCallbacks *pAllocator,
+        VkBuffer *pBuffer) {
+        VkEncoder* enc = (VkEncoder*)context;
+
+        VkBufferCreateInfo localCreateInfo = vk_make_orphan_copy(*pCreateInfo);
+        vk_struct_chain_iterator structChainIter =
+            vk_make_chain_iterator(&localCreateInfo);
+        VkExternalMemoryBufferCreateInfo localExtBufCi;
+
+        const VkExternalMemoryBufferCreateInfo* extBufCiPtr =
+            vk_find_struct<VkExternalMemoryBufferCreateInfo>(pCreateInfo);
+        if (extBufCiPtr) {
+            localExtBufCi = vk_make_orphan_copy(*extBufCiPtr);
+            vk_append_struct(&structChainIter, &localExtBufCi);
+        }
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+        Optional<zx::vmo> vmo;
+        bool isSysmemBackedMemory = false;
+
+        if (extBufCiPtr &&
+            (extBufCiPtr->handleTypes &
+             VK_EXTERNAL_MEMORY_HANDLE_TYPE_ZIRCON_VMO_BIT_FUCHSIA)) {
+            isSysmemBackedMemory = true;
+        }
+
+        const auto* extBufferCollectionPtr =
+            vk_find_struct<VkBufferCollectionBufferCreateInfoFUCHSIA>(
+                pCreateInfo);
+
+        if (extBufferCollectionPtr) {
+            const auto& collection = *reinterpret_cast<
+                fidl::WireSyncClient<fuchsia_sysmem::BufferCollection>*>(
+                extBufferCollectionPtr->collection);
+            uint32_t index = extBufferCollectionPtr->index;
+
+            auto result = collection->WaitForBuffersAllocated();
+            if (result.ok() && result->status == ZX_OK) {
+                auto& info = result->buffer_collection_info;
+                if (index < info.buffer_count) {
+                    vmo = android::base::makeOptional(
+                            std::move(info.buffers[index].vmo));
+                }
+            } else {
+                ALOGE("WaitForBuffersAllocated failed: %d %d", result.status(),
+                      GET_STATUS_SAFE(result, status));
+            }
+
+            if (vmo && vmo->is_valid()) {
+                fidl::Arena arena;
+                fuchsia_hardware_goldfish::wire::CreateBuffer2Params createParams(arena);
+                createParams.set_size(arena, pCreateInfo->size)
+                    .set_memory_property(
+                        fuchsia_hardware_goldfish::wire::kMemoryPropertyDeviceLocal);
+
+                auto result =
+                    mControlDevice->CreateBuffer2(std::move(*vmo), createParams);
+                if (!result.ok() ||
+                    (result->is_error() != ZX_OK &&
+                     result->error_value() != ZX_ERR_ALREADY_EXISTS)) {
+                    ALOGE("CreateBuffer2 failed: %d:%d", result.status(),
+                          GET_STATUS_SAFE(result, error_value()));
+                }
+                isSysmemBackedMemory = true;
+            }
+        }
+#endif  // VK_USE_PLATFORM_FUCHSIA
+
+        VkResult res;
+        VkMemoryRequirements memReqs;
+
+        if (supportsCreateResourcesWithRequirements()) {
+            res = enc->vkCreateBufferWithRequirementsGOOGLE(
+                device, &localCreateInfo, pAllocator, pBuffer, &memReqs,
+                true /* do lock */);
+        } else {
+            res = enc->vkCreateBuffer(device, &localCreateInfo, pAllocator,
+                                      pBuffer, true /* do lock */);
+        }
+
+        if (res != VK_SUCCESS) return res;
+
+// Delete `protocolVersion` check goldfish drivers are gone.
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+        if (extBufCiPtr &&
+            mCaps.gfxstreamCapset.protocolVersion &&
+            (extBufCiPtr->handleTypes &
+             VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID)) {
+            updateMemoryTypeBits(&memReqs.memoryTypeBits,
+                                 mCaps.gfxstreamCapset.colorBufferMemoryIndex);
+        }
+#endif
+
+        AutoLock<RecursiveLock> lock(mLock);
+
+        auto it = info_VkBuffer.find(*pBuffer);
+        if (it == info_VkBuffer.end()) return VK_ERROR_INITIALIZATION_FAILED;
+
+        auto& info = it->second;
+
+        info.createInfo = localCreateInfo;
+        info.createInfo.pNext = nullptr;
+
+        if (supportsCreateResourcesWithRequirements()) {
+            info.baseRequirementsKnown = true;
+            info.baseRequirements = memReqs;
+        }
+
+        if (extBufCiPtr) {
+            info.external = true;
+            info.externalCreateInfo = *extBufCiPtr;
+        }
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+        if (isSysmemBackedMemory) {
+            info.isSysmemBackedMemory = true;
+        }
+#endif
+
+        return res;
+    }
+
+    void on_vkDestroyBuffer(
+        void* context,
+        VkDevice device, VkBuffer buffer, const VkAllocationCallbacks *pAllocator) {
+        VkEncoder* enc = (VkEncoder*)context;
+        enc->vkDestroyBuffer(device, buffer, pAllocator, true /* do lock */);
+    }
+
+    void on_vkGetBufferMemoryRequirements(
+        void* context, VkDevice device, VkBuffer buffer, VkMemoryRequirements *pMemoryRequirements) {
+
+        AutoLock<RecursiveLock> lock(mLock);
+
+        auto it = info_VkBuffer.find(buffer);
+        if (it == info_VkBuffer.end()) return;
+
+        auto& info = it->second;
+
+        if (info.baseRequirementsKnown) {
+            *pMemoryRequirements = info.baseRequirements;
+            return;
+        }
+
+        lock.unlock();
+
+        VkEncoder* enc = (VkEncoder*)context;
+        enc->vkGetBufferMemoryRequirements(
+            device, buffer, pMemoryRequirements, true /* do lock */);
+
+        lock.lock();
+
+        info.baseRequirementsKnown = true;
+        info.baseRequirements = *pMemoryRequirements;
+    }
+
+    void on_vkGetBufferMemoryRequirements2(
+        void* context, VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo,
+        VkMemoryRequirements2* pMemoryRequirements) {
+        VkEncoder* enc = (VkEncoder*)context;
+        enc->vkGetBufferMemoryRequirements2(device, pInfo, pMemoryRequirements, true /* do lock */);
+        transformBufferMemoryRequirements2ForGuest(
+            pInfo->buffer, pMemoryRequirements);
+    }
+
+    void on_vkGetBufferMemoryRequirements2KHR(
+        void* context, VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo,
+        VkMemoryRequirements2* pMemoryRequirements) {
+        VkEncoder* enc = (VkEncoder*)context;
+        enc->vkGetBufferMemoryRequirements2KHR(device, pInfo, pMemoryRequirements, true /* do lock */);
+        transformBufferMemoryRequirements2ForGuest(
+            pInfo->buffer, pMemoryRequirements);
+    }
+
+    VkResult on_vkBindBufferMemory(
+        void *context, VkResult,
+        VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset) {
+        VkEncoder *enc = (VkEncoder *)context;
+        return enc->vkBindBufferMemory(
+            device, buffer, memory, memoryOffset, true /* do lock */);
+    }
+
+    VkResult on_vkBindBufferMemory2(
+        void *context, VkResult,
+        VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo *pBindInfos) {
+        VkEncoder *enc = (VkEncoder *)context;
+        return enc->vkBindBufferMemory2(
+            device, bindInfoCount, pBindInfos, true /* do lock */);
+    }
+
+    VkResult on_vkBindBufferMemory2KHR(
+        void *context, VkResult,
+        VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo *pBindInfos) {
+        VkEncoder *enc = (VkEncoder *)context;
+        return enc->vkBindBufferMemory2KHR(
+            device, bindInfoCount, pBindInfos, true /* do lock */);
+    }
+
+    void ensureSyncDeviceFd() {
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__)
+        if (mSyncDeviceFd >= 0)
+            return;
+        mSyncDeviceFd = goldfish_sync_open();
+        if (mSyncDeviceFd >= 0) {
+            ALOGD("%s: created sync device for current Vulkan process: %d\n", __func__, mSyncDeviceFd);
+        } else {
+            ALOGD("%s: failed to create sync device for current Vulkan process\n", __func__);
+        }
+#endif
+    }
+
+    VkResult on_vkCreateSemaphore(
+        void* context, VkResult input_result,
+        VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo,
+        const VkAllocationCallbacks* pAllocator,
+        VkSemaphore* pSemaphore) {
+
+        VkEncoder* enc = (VkEncoder*)context;
+
+        VkSemaphoreCreateInfo finalCreateInfo = *pCreateInfo;
+
+        const VkExportSemaphoreCreateInfoKHR* exportSemaphoreInfoPtr =
+            vk_find_struct<VkExportSemaphoreCreateInfoKHR>(pCreateInfo);
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+        bool exportEvent =
+                exportSemaphoreInfoPtr &&
+                (exportSemaphoreInfoPtr->handleTypes &
+                 VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_ZIRCON_EVENT_BIT_FUCHSIA);
+
+        if (exportEvent) {
+            finalCreateInfo.pNext = nullptr;
+            // If we have timeline semaphores externally, leave it there.
+            const VkSemaphoreTypeCreateInfo* typeCi =
+                vk_find_struct<VkSemaphoreTypeCreateInfo>(pCreateInfo);
+            if (typeCi) finalCreateInfo.pNext = typeCi;
+        }
+#endif
+
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__)
+        bool exportSyncFd = exportSemaphoreInfoPtr &&
+            (exportSemaphoreInfoPtr->handleTypes &
+             VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT);
+
+        if (exportSyncFd) {
+            finalCreateInfo.pNext = nullptr;
+            // If we have timeline semaphores externally, leave it there.
+            const VkSemaphoreTypeCreateInfo* typeCi =
+                vk_find_struct<VkSemaphoreTypeCreateInfo>(pCreateInfo);
+            if (typeCi) finalCreateInfo.pNext = typeCi;
+        }
+#endif
+        input_result = enc->vkCreateSemaphore(
+            device, &finalCreateInfo, pAllocator, pSemaphore, true /* do lock */);
+
+        zx_handle_t event_handle = ZX_HANDLE_INVALID;
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+        if (exportEvent) {
+            zx_event_create(0, &event_handle);
+        }
+#endif
+
+        AutoLock<RecursiveLock> lock(mLock);
+
+        auto it = info_VkSemaphore.find(*pSemaphore);
+        if (it == info_VkSemaphore.end()) return VK_ERROR_INITIALIZATION_FAILED;
+
+        auto& info = it->second;
+
+        info.device = device;
+        info.eventHandle = event_handle;
+#ifdef VK_USE_PLATFORM_FUCHSIA
+        info.eventKoid = getEventKoid(info.eventHandle);
+#endif
+
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__)
+        if (exportSyncFd) {
+            if (mFeatureInfo->hasVirtioGpuNativeSync) {
+                VkResult result;
+                int64_t osHandle;
+                uint64_t hostFenceHandle = get_host_u64_VkSemaphore(*pSemaphore);
+
+                result = createFence(device, hostFenceHandle, osHandle);
+                if (result != VK_SUCCESS)
+                    return result;
+
+                info.syncFd.emplace(osHandle);
+            } else {
+                ensureSyncDeviceFd();
+
+                if (exportSyncFd) {
+                    int syncFd = -1;
+                    goldfish_sync_queue_work(
+                            mSyncDeviceFd,
+                            get_host_u64_VkSemaphore(*pSemaphore) /* the handle */,
+                            GOLDFISH_SYNC_VULKAN_SEMAPHORE_SYNC /* thread handle (doubling as type field) */,
+                            &syncFd);
+                    info.syncFd.emplace(syncFd);
+                }
+            }
+        }
+#endif
+
+        return VK_SUCCESS;
+    }
+
+    void on_vkDestroySemaphore(
+        void* context,
+        VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks *pAllocator) {
+        VkEncoder* enc = (VkEncoder*)context;
+        enc->vkDestroySemaphore(device, semaphore, pAllocator, true /* do lock */);
+    }
+
+    // https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#vkGetSemaphoreFdKHR
+    // Each call to vkGetSemaphoreFdKHR must create a new file descriptor and transfer ownership
+    // of it to the application. To avoid leaking resources, the application must release ownership
+    // of the file descriptor when it is no longer needed.
+    VkResult on_vkGetSemaphoreFdKHR(
+        void* context, VkResult,
+        VkDevice device, const VkSemaphoreGetFdInfoKHR* pGetFdInfo,
+        int* pFd) {
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__)
+        VkEncoder* enc = (VkEncoder*)context;
+        bool getSyncFd =
+            pGetFdInfo->handleType & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT;
+
+        if (getSyncFd) {
+            AutoLock<RecursiveLock> lock(mLock);
+            auto it = info_VkSemaphore.find(pGetFdInfo->semaphore);
+            if (it == info_VkSemaphore.end()) return VK_ERROR_OUT_OF_HOST_MEMORY;
+            auto& semInfo = it->second;
+            // syncFd is supposed to have value.
+            *pFd = dup(semInfo.syncFd.value_or(-1));
+            return VK_SUCCESS;
+        } else {
+            // opaque fd
+            int hostFd = 0;
+            VkResult result = enc->vkGetSemaphoreFdKHR(device, pGetFdInfo, &hostFd, true /* do lock */);
+            if (result != VK_SUCCESS) {
+                return result;
+            }
+            *pFd = memfd_create("vk_opaque_fd", 0);
+            write(*pFd, &hostFd, sizeof(hostFd));
+            return VK_SUCCESS;
+        }
+#else
+        (void)context;
+        (void)device;
+        (void)pGetFdInfo;
+        (void)pFd;
+        return VK_ERROR_INCOMPATIBLE_DRIVER;
+#endif
+    }
+
+    VkResult on_vkImportSemaphoreFdKHR(
+        void* context, VkResult input_result,
+        VkDevice device,
+        const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo) {
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__)
+        VkEncoder* enc = (VkEncoder*)context;
+        if (input_result != VK_SUCCESS) {
+            return input_result;
+        }
+
+        if (pImportSemaphoreFdInfo->handleType &
+            VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT) {
+            VkImportSemaphoreFdInfoKHR tmpInfo = *pImportSemaphoreFdInfo;
+
+            AutoLock<RecursiveLock> lock(mLock);
+
+            auto semaphoreIt = info_VkSemaphore.find(pImportSemaphoreFdInfo->semaphore);
+            auto& info = semaphoreIt->second;
+
+            if (info.syncFd.value_or(-1) >= 0) {
+                close(info.syncFd.value());
+            }
+
+            info.syncFd.emplace(pImportSemaphoreFdInfo->fd);
+
+            return VK_SUCCESS;
+        } else {
+            int fd = pImportSemaphoreFdInfo->fd;
+            int err = lseek(fd, 0, SEEK_SET);
+            if (err == -1) {
+                ALOGE("lseek fail on import semaphore");
+            }
+            int hostFd = 0;
+            read(fd, &hostFd, sizeof(hostFd));
+            VkImportSemaphoreFdInfoKHR tmpInfo = *pImportSemaphoreFdInfo;
+            tmpInfo.fd = hostFd;
+            VkResult result = enc->vkImportSemaphoreFdKHR(device, &tmpInfo, true /* do lock */);
+            close(fd);
+            return result;
+        }
+#else
+        (void)context;
+        (void)input_result;
+        (void)device;
+        (void)pImportSemaphoreFdInfo;
+        return VK_ERROR_INCOMPATIBLE_DRIVER;
+#endif
+    }
+
+    struct CommandBufferPendingDescriptorSets {
+        std::unordered_set<VkDescriptorSet> sets;
+    };
+
+    void collectAllPendingDescriptorSetsBottomUp(const std::vector<VkCommandBuffer>& workingSet, std::unordered_set<VkDescriptorSet>& allDs) {
+        if (workingSet.empty()) return;
+
+        std::vector<VkCommandBuffer> nextLevel;
+        for (auto commandBuffer : workingSet) {
+            struct goldfish_VkCommandBuffer* cb = as_goldfish_VkCommandBuffer(commandBuffer);
+            forAllObjects(cb->subObjects, [&nextLevel](void* secondary) {
+                    nextLevel.push_back((VkCommandBuffer)secondary);
+                    });
+        }
+
+        collectAllPendingDescriptorSetsBottomUp(nextLevel, allDs);
+
+        for (auto cmdbuf : workingSet) {
+            struct goldfish_VkCommandBuffer* cb = as_goldfish_VkCommandBuffer(cmdbuf);
+
+            if (!cb->userPtr) {
+                continue; // No descriptors to update.
+            }
+
+            CommandBufferPendingDescriptorSets* pendingDescriptorSets =
+                (CommandBufferPendingDescriptorSets*)(cb->userPtr);
+
+            if (pendingDescriptorSets->sets.empty()) {
+                continue; // No descriptors to update.
+            }
+
+            allDs.insert(pendingDescriptorSets->sets.begin(), pendingDescriptorSets->sets.end());
+        }
+    }
+
+    void commitDescriptorSetUpdates(void* context, VkQueue queue, const std::unordered_set<VkDescriptorSet>& sets) {
+        VkEncoder* enc = (VkEncoder*)context;
+
+        std::unordered_map<VkDescriptorPool, uint32_t> poolSet;
+        std::vector<VkDescriptorPool> pools;
+        std::vector<VkDescriptorSetLayout> setLayouts;
+        std::vector<uint64_t> poolIds;
+        std::vector<uint32_t> descriptorSetWhichPool;
+        std::vector<uint32_t> pendingAllocations;
+        std::vector<uint32_t> writeStartingIndices;
+        std::vector<VkWriteDescriptorSet> writesForHost;
+
+        uint32_t poolIndex = 0;
+        uint32_t currentWriteIndex = 0;
+        for (auto set : sets) {
+            ReifiedDescriptorSet* reified = as_goldfish_VkDescriptorSet(set)->reified;
+            VkDescriptorPool pool = reified->pool;
+            VkDescriptorSetLayout setLayout = reified->setLayout;
+
+            auto it = poolSet.find(pool);
+            if (it == poolSet.end()) {
+                poolSet[pool] = poolIndex;
+                descriptorSetWhichPool.push_back(poolIndex);
+                pools.push_back(pool);
+                ++poolIndex;
+            } else {
+                uint32_t savedPoolIndex = it->second;
+                descriptorSetWhichPool.push_back(savedPoolIndex);
+            }
+
+            poolIds.push_back(reified->poolId);
+            setLayouts.push_back(setLayout);
+            pendingAllocations.push_back(reified->allocationPending ? 1 : 0);
+            writeStartingIndices.push_back(currentWriteIndex);
+
+            auto& writes = reified->allWrites;
+
+            for (size_t i = 0; i < writes.size(); ++i) {
+                uint32_t binding = i;
+
+                for (size_t j = 0; j < writes[i].size(); ++j) {
+                    auto& write = writes[i][j];
+
+                    if (write.type == DescriptorWriteType::Empty) continue;
+
+                    uint32_t dstArrayElement = 0;
+
+                    VkDescriptorImageInfo* imageInfo = nullptr;
+                    VkDescriptorBufferInfo* bufferInfo = nullptr;
+                    VkBufferView* bufferView = nullptr;
+
+                    switch (write.type) {
+                        case DescriptorWriteType::Empty:
+                            break;
+                        case DescriptorWriteType::ImageInfo:
+                            dstArrayElement = j;
+                            imageInfo = &write.imageInfo;
+                            break;
+                        case DescriptorWriteType::BufferInfo:
+                            dstArrayElement = j;
+                            bufferInfo = &write.bufferInfo;
+                            break;
+                        case DescriptorWriteType::BufferView:
+                            dstArrayElement = j;
+                            bufferView = &write.bufferView;
+                            break;
+                        case DescriptorWriteType::InlineUniformBlock:
+                        case DescriptorWriteType::AccelerationStructure:
+                            // TODO
+                            ALOGE("Encountered pending inline uniform block or acceleration structure desc write, abort (NYI)\n");
+                            abort();
+                        default:
+                            break;
+
+                    }
+
+                    // TODO: Combine multiple writes into one VkWriteDescriptorSet.
+                    VkWriteDescriptorSet forHost = {
+                        VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, 0 /* TODO: inline uniform block */,
+                        set,
+                        binding,
+                        dstArrayElement,
+                        1,
+                        write.descriptorType,
+                        imageInfo,
+                        bufferInfo,
+                        bufferView,
+                    };
+
+                    writesForHost.push_back(forHost);
+                    ++currentWriteIndex;
+
+                    // Set it back to empty.
+                    write.type = DescriptorWriteType::Empty;
+                }
+            }
+        }
+
+        // Skip out if there's nothing to VkWriteDescriptorSet home about.
+        if (writesForHost.empty()) {
+            return;
+        }
+
+        enc->vkQueueCommitDescriptorSetUpdatesGOOGLE(
+            queue,
+            (uint32_t)pools.size(), pools.data(),
+            (uint32_t)sets.size(),
+            setLayouts.data(),
+            poolIds.data(),
+            descriptorSetWhichPool.data(),
+            pendingAllocations.data(),
+            writeStartingIndices.data(),
+            (uint32_t)writesForHost.size(),
+            writesForHost.data(),
+            false /* no lock */);
+
+        // If we got here, then we definitely serviced the allocations.
+        for (auto set : sets) {
+            ReifiedDescriptorSet* reified = as_goldfish_VkDescriptorSet(set)->reified;
+            reified->allocationPending = false;
+        }
+    }
+
+    void flushCommandBufferPendingCommandsBottomUp(void* context, VkQueue queue, const std::vector<VkCommandBuffer>& workingSet) {
+        if (workingSet.empty()) return;
+
+        std::vector<VkCommandBuffer> nextLevel;
+        for (auto commandBuffer : workingSet) {
+            struct goldfish_VkCommandBuffer* cb = as_goldfish_VkCommandBuffer(commandBuffer);
+            forAllObjects(cb->subObjects, [&nextLevel](void* secondary) {
+                nextLevel.push_back((VkCommandBuffer)secondary);
+            });
+        }
+
+        flushCommandBufferPendingCommandsBottomUp(context, queue, nextLevel);
+
+        // After this point, everyone at the previous level has been flushed
+        for (auto cmdbuf : workingSet) {
+            struct goldfish_VkCommandBuffer* cb = as_goldfish_VkCommandBuffer(cmdbuf);
+
+            // There's no pending commands here, skip. (case 1)
+            if (!cb->privateStream) continue;
+
+            unsigned char* writtenPtr = 0;
+            size_t written = 0;
+            CommandBufferStagingStream* cmdBufStream =
+                static_cast<CommandBufferStagingStream*>(cb->privateStream);
+            cmdBufStream->getWritten(&writtenPtr, &written);
+
+            // There's no pending commands here, skip. (case 2, stream created but no new recordings)
+            if (!written) continue;
+
+            // There are pending commands to flush.
+            VkEncoder* enc = (VkEncoder*)context;
+            VkDeviceMemory deviceMemory = cmdBufStream->getDeviceMemory();
+            VkDeviceSize dataOffset = 0;
+            if (mFeatureInfo->hasVulkanAuxCommandMemory) {
+                // for suballocations, deviceMemory is an alias VkDeviceMemory
+                // get underling VkDeviceMemory for given alias
+                deviceMemoryTransform_tohost(&deviceMemory, 1 /*memoryCount*/, &dataOffset,
+                                             1 /*offsetCount*/, nullptr /*size*/, 0 /*sizeCount*/,
+                                             nullptr /*typeIndex*/, 0 /*typeIndexCount*/,
+                                             nullptr /*typeBits*/, 0 /*typeBitCounts*/);
+
+                // mark stream as flushing before flushing commands
+                cmdBufStream->markFlushing();
+                enc->vkQueueFlushCommandsFromAuxMemoryGOOGLE(queue, cmdbuf, deviceMemory,
+                                                             dataOffset, written, true /*do lock*/);
+            } else {
+                enc->vkQueueFlushCommandsGOOGLE(queue, cmdbuf, written, (const void*)writtenPtr,
+                                                true /* do lock */);
+            }
+            // Reset this stream.
+            // flushing happens on vkQueueSubmit
+            // vulkan api states that on queue submit,
+            // applications MUST not attempt to modify the command buffer in any way
+            // -as the device may be processing the commands recorded to it.
+            // It is safe to call reset() here for this reason.
+            // Command Buffer associated with this stream will only leave pending state
+            // after queue submit is complete and host has read the data
+            cmdBufStream->reset();
+        }
+    }
+
+    // Unlike resetCommandBufferStagingInfo, this does not always erase its
+    // superObjects pointers because the command buffer has merely been
+    // submitted, not reset.  However, if the command buffer was recorded with
+    // ONE_TIME_SUBMIT_BIT, then it will also reset its primaries.
+    //
+    // Also, we save the set of descriptor sets referenced by this command
+    // buffer because we only submitted the command buffer and it's possible to
+    // update the descriptor set again and re-submit the same command without
+    // recording it (Update-after-bind descriptor sets)
+    void resetCommandBufferPendingTopology(VkCommandBuffer commandBuffer) {
+        struct goldfish_VkCommandBuffer* cb = as_goldfish_VkCommandBuffer(commandBuffer);
+        if (cb->flags & VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT) {
+            resetCommandBufferStagingInfo(commandBuffer,
+                true /* reset primaries */,
+                true /* clear pending descriptor sets */);
+        } else {
+            resetCommandBufferStagingInfo(commandBuffer,
+                false /* Don't reset primaries */,
+                false /* Don't clear pending descriptor sets */);
+        }
+    }
+
+    void flushStagingStreams(void* context, VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits) {
+        std::vector<VkCommandBuffer> toFlush;
+        for (uint32_t i = 0; i < submitCount; ++i) {
+            for (uint32_t j = 0; j < pSubmits[i].commandBufferCount; ++j) {
+                toFlush.push_back(pSubmits[i].pCommandBuffers[j]);
+            }
+        }
+
+        std::unordered_set<VkDescriptorSet> pendingSets;
+        collectAllPendingDescriptorSetsBottomUp(toFlush, pendingSets);
+        commitDescriptorSetUpdates(context, queue, pendingSets);
+
+        flushCommandBufferPendingCommandsBottomUp(context, queue, toFlush);
+
+        for (auto cb : toFlush) {
+            resetCommandBufferPendingTopology(cb);
+        }
+    }
+
+    VkResult on_vkQueueSubmit(
+        void* context, VkResult input_result,
+        VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence) {
+        AEMU_SCOPED_TRACE("on_vkQueueSubmit");
+
+        flushStagingStreams(context, queue, submitCount, pSubmits);
+
+        std::vector<VkSemaphore> pre_signal_semaphores;
+        std::vector<zx_handle_t> pre_signal_events;
+        std::vector<int> pre_signal_sync_fds;
+        std::vector<std::pair<zx_handle_t, zx_koid_t>> post_wait_events;
+        std::vector<int> post_wait_sync_fds;
+
+        VkEncoder* enc = (VkEncoder*)context;
+
+        AutoLock<RecursiveLock> lock(mLock);
+
+        for (uint32_t i = 0; i < submitCount; ++i) {
+            for (uint32_t j = 0; j < pSubmits[i].waitSemaphoreCount; ++j) {
+                auto it = info_VkSemaphore.find(pSubmits[i].pWaitSemaphores[j]);
+                if (it != info_VkSemaphore.end()) {
+                    auto& semInfo = it->second;
+#ifdef VK_USE_PLATFORM_FUCHSIA
+                    if (semInfo.eventHandle) {
+                        pre_signal_events.push_back(semInfo.eventHandle);
+                        pre_signal_semaphores.push_back(pSubmits[i].pWaitSemaphores[j]);
+                    }
+#endif
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__)
+                    if (semInfo.syncFd.has_value()) {
+                        pre_signal_sync_fds.push_back(semInfo.syncFd.value());
+                        pre_signal_semaphores.push_back(pSubmits[i].pWaitSemaphores[j]);
+                    }
+#endif
+                }
+            }
+            for (uint32_t j = 0; j < pSubmits[i].signalSemaphoreCount; ++j) {
+                auto it = info_VkSemaphore.find(pSubmits[i].pSignalSemaphores[j]);
+                if (it != info_VkSemaphore.end()) {
+                    auto& semInfo = it->second;
+#ifdef VK_USE_PLATFORM_FUCHSIA
+                    if (semInfo.eventHandle) {
+                        post_wait_events.push_back(
+                            {semInfo.eventHandle, semInfo.eventKoid});
+#ifndef FUCHSIA_NO_TRACE
+                        if (semInfo.eventKoid != ZX_KOID_INVALID) {
+                            // TODO(fxbug.dev/66098): Remove the "semaphore"
+                            // FLOW_END events once it is removed from clients
+                            // (for example, gfx Engine).
+                            TRACE_FLOW_END("gfx", "semaphore",
+                                           semInfo.eventKoid);
+                            TRACE_FLOW_BEGIN("gfx", "goldfish_post_wait_event",
+                                             semInfo.eventKoid);
+                        }
+#endif
+                    }
+#endif
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__)
+                    if (semInfo.syncFd.value_or(-1) >= 0) {
+                        post_wait_sync_fds.push_back(semInfo.syncFd.value());
+                    }
+#endif
+                }
+            }
+        }
+        lock.unlock();
+
+        if (pre_signal_semaphores.empty()) {
+            if (supportsAsyncQueueSubmit()) {
+                enc->vkQueueSubmitAsyncGOOGLE(queue, submitCount, pSubmits, fence, true /* do lock */);
+                input_result = VK_SUCCESS;
+            } else {
+                input_result = enc->vkQueueSubmit(queue, submitCount, pSubmits, fence, true /* do lock */);
+                if (input_result != VK_SUCCESS) return input_result;
+            }
+        } else {
+            // Schedule waits on the OS external objects and
+            // signal the wait semaphores
+            // in a separate thread.
+            std::vector<WorkPool::Task> preSignalTasks;
+            std::vector<WorkPool::Task> preSignalQueueSubmitTasks;;
+#ifdef VK_USE_PLATFORM_FUCHSIA
+            for (auto event : pre_signal_events) {
+                preSignalTasks.push_back([event] {
+                    zx_object_wait_one(
+                        event,
+                        ZX_EVENT_SIGNALED,
+                        ZX_TIME_INFINITE,
+                        nullptr);
+                });
+            }
+#endif
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__)
+            for (auto fd : pre_signal_sync_fds) {
+                // https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkImportSemaphoreFdInfoKHR.html
+                // fd == -1 is treated as already signaled
+                if (fd != -1) {
+                    preSignalTasks.push_back([fd] {
+                        sync_wait(fd, 3000);
+                    });
+                }
+            }
+#endif
+            if (!preSignalTasks.empty()) {
+                auto waitGroupHandle = mWorkPool.schedule(preSignalTasks);
+                mWorkPool.waitAll(waitGroupHandle);
+            }
+
+            VkSubmitInfo submit_info = {
+                .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO,
+                .waitSemaphoreCount = 0,
+                .pWaitSemaphores = nullptr,
+                .pWaitDstStageMask = nullptr,
+                .signalSemaphoreCount =
+                    static_cast<uint32_t>(pre_signal_semaphores.size()),
+                .pSignalSemaphores = pre_signal_semaphores.data()};
+
+            if (supportsAsyncQueueSubmit()) {
+                enc->vkQueueSubmitAsyncGOOGLE(queue, 1, &submit_info, VK_NULL_HANDLE, true /* do lock */);
+            } else {
+                enc->vkQueueSubmit(queue, 1, &submit_info, VK_NULL_HANDLE, true /* do lock */);
+            }
+
+            if (supportsAsyncQueueSubmit()) {
+                enc->vkQueueSubmitAsyncGOOGLE(queue, submitCount, pSubmits, fence, true /* do lock */);
+                input_result = VK_SUCCESS;
+            } else {
+                input_result = enc->vkQueueSubmit(queue, submitCount, pSubmits, fence, true /* do lock */);
+                if (input_result != VK_SUCCESS) return input_result;
+            }
+        }
+
+        lock.lock();
+        int externalFenceFdToSignal = -1;
+
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__)
+        if (fence != VK_NULL_HANDLE) {
+            auto it = info_VkFence.find(fence);
+            if (it != info_VkFence.end()) {
+                const auto& info = it->second;
+                if (info.syncFd >= 0) {
+                    externalFenceFdToSignal = info.syncFd;
+                }
+            }
+        }
+#endif
+        if (externalFenceFdToSignal >= 0 ||
+            !post_wait_events.empty() ||
+            !post_wait_sync_fds.empty()) {
+
+            std::vector<WorkPool::Task> tasks;
+
+            tasks.push_back([queue, externalFenceFdToSignal,
+                             post_wait_events /* copy of zx handles */,
+                             post_wait_sync_fds /* copy of sync fds */] {
+                auto hostConn = ResourceTracker::threadingCallbacks.hostConnectionGetFunc();
+                auto vkEncoder = ResourceTracker::threadingCallbacks.vkEncoderGetFunc(hostConn);
+                auto waitIdleRes = vkEncoder->vkQueueWaitIdle(queue, true /* do lock */);
+#ifdef VK_USE_PLATFORM_FUCHSIA
+                AEMU_SCOPED_TRACE("on_vkQueueSubmit::SignalSemaphores");
+                (void)externalFenceFdToSignal;
+                for (auto& [event, koid] : post_wait_events) {
+#ifndef FUCHSIA_NO_TRACE
+                    if (koid != ZX_KOID_INVALID) {
+                        TRACE_FLOW_END("gfx", "goldfish_post_wait_event", koid);
+                        TRACE_FLOW_BEGIN("gfx", "event_signal", koid);
+                    }
+#endif
+                    zx_object_signal(event, 0, ZX_EVENT_SIGNALED);
+                }
+#endif
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__)
+                for (auto& fd : post_wait_sync_fds) {
+                    goldfish_sync_signal(fd);
+                }
+
+                if (externalFenceFdToSignal >= 0) {
+                    ALOGV("%s: external fence real signal: %d\n", __func__, externalFenceFdToSignal);
+                    goldfish_sync_signal(externalFenceFdToSignal);
+                }
+#endif
+            });
+            auto queueAsyncWaitHandle = mWorkPool.schedule(tasks);
+            auto& queueWorkItems = mQueueSensitiveWorkPoolItems[queue];
+            queueWorkItems.push_back(queueAsyncWaitHandle);
+        }
+
+        return VK_SUCCESS;
+    }
+
+    VkResult on_vkQueueWaitIdle(
+        void* context, VkResult,
+        VkQueue queue) {
+
+        VkEncoder* enc = (VkEncoder*)context;
+
+        AutoLock<RecursiveLock> lock(mLock);
+        std::vector<WorkPool::WaitGroupHandle> toWait =
+            mQueueSensitiveWorkPoolItems[queue];
+        mQueueSensitiveWorkPoolItems[queue].clear();
+        lock.unlock();
+
+        if (toWait.empty()) {
+            ALOGV("%s: No queue-specific work pool items\n", __func__);
+            return enc->vkQueueWaitIdle(queue, true /* do lock */);
+        }
+
+        for (auto handle : toWait) {
+            ALOGV("%s: waiting on work group item: %llu\n", __func__,
+                  (unsigned long long)handle);
+            mWorkPool.waitAll(handle);
+        }
+
+        // now done waiting, get the host's opinion
+        return enc->vkQueueWaitIdle(queue, true /* do lock */);
+    }
+
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+    void unwrap_VkNativeBufferANDROID(
+        const VkImageCreateInfo* pCreateInfo,
+        VkImageCreateInfo* local_pCreateInfo) {
+
+        if (!pCreateInfo->pNext) return;
+
+        const VkNativeBufferANDROID* nativeInfo =
+            vk_find_struct<VkNativeBufferANDROID>(pCreateInfo);
+        if (!nativeInfo) {
+            return;
+        }
+
+        if (!nativeInfo->handle) return;
+
+        VkNativeBufferANDROID* nativeInfoOut =
+            reinterpret_cast<VkNativeBufferANDROID*>(
+                const_cast<void*>(
+                    local_pCreateInfo->pNext));
+
+        if (!nativeInfoOut->handle) {
+            ALOGE("FATAL: Local native buffer info not properly allocated!");
+            abort();
+        }
+
+        *(uint32_t*)(nativeInfoOut->handle) =
+            ResourceTracker::threadingCallbacks.hostConnectionGetFunc()->
+                grallocHelper()->getHostHandle(
+                    (const native_handle_t*)nativeInfo->handle);
+    }
+
+    void unwrap_vkAcquireImageANDROID_nativeFenceFd(int fd, int*) {
+        if (fd != -1) {
+            AEMU_SCOPED_TRACE("waitNativeFenceInAcquire");
+            // Implicit Synchronization
+            sync_wait(fd, 3000);
+            // From libvulkan's swapchain.cpp:
+            // """
+            // NOTE: we're relying on AcquireImageANDROID to close fence_clone,
+            // even if the call fails. We could close it ourselves on failure, but
+            // that would create a race condition if the driver closes it on a
+            // failure path: some other thread might create an fd with the same
+            // number between the time the driver closes it and the time we close
+            // it. We must assume one of: the driver *always* closes it even on
+            // failure, or *never* closes it on failure.
+            // """
+            // Therefore, assume contract where we need to close fd in this driver
+            close(fd);
+        }
+    }
+#endif
+
+    // Action of vkMapMemoryIntoAddressSpaceGOOGLE:
+    // 1. preprocess (on_vkMapMemoryIntoAddressSpaceGOOGLE_pre):
+    //    uses address space device to reserve the right size of
+    //    memory.
+    // 2. the reservation results in a physical address. the physical
+    //    address is set as |*pAddress|.
+    // 3. after pre, the API call is encoded to the host, where the
+    //    value of pAddress is also sent (the physical address).
+    // 4. the host will obtain the actual gpu pointer and send it
+    //    back out in |*pAddress|.
+    // 5. postprocess (on_vkMapMemoryIntoAddressSpaceGOOGLE) will run,
+    //    using the mmap() method of GoldfishAddressSpaceBlock to obtain
+    //    a pointer in guest userspace corresponding to the host pointer.
+    VkResult on_vkMapMemoryIntoAddressSpaceGOOGLE_pre(
+        void*,
+        VkResult,
+        VkDevice,
+        VkDeviceMemory memory,
+        uint64_t* pAddress) {
+
+        AutoLock<RecursiveLock> lock(mLock);
+
+        auto it = info_VkDeviceMemory.find(memory);
+        if (it == info_VkDeviceMemory.end()) {
+            return VK_ERROR_OUT_OF_HOST_MEMORY;
+        }
+
+        auto& memInfo = it->second;
+
+        GoldfishAddressSpaceBlockPtr block = std::make_shared<GoldfishAddressSpaceBlock>();
+        block->allocate(mGoldfishAddressSpaceBlockProvider.get(), memInfo.coherentMemorySize);
+
+        memInfo.goldfishBlock = block;
+        *pAddress = block->physAddr();
+
+        return VK_SUCCESS;
+    }
+
+    VkResult on_vkMapMemoryIntoAddressSpaceGOOGLE(
+        void*,
+        VkResult input_result,
+        VkDevice,
+        VkDeviceMemory memory,
+        uint64_t* pAddress) {
+        (void)memory;
+	(void)pAddress;
+
+        if (input_result != VK_SUCCESS) {
+            return input_result;
+        }
+
+        return input_result;
+    }
+
+    VkResult initDescriptorUpdateTemplateBuffers(
+        const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
+        VkDescriptorUpdateTemplate descriptorUpdateTemplate) {
+
+        AutoLock<RecursiveLock> lock(mLock);
+
+        auto it = info_VkDescriptorUpdateTemplate.find(descriptorUpdateTemplate);
+        if (it == info_VkDescriptorUpdateTemplate.end()) {
+            return VK_ERROR_INITIALIZATION_FAILED;
+        }
+
+        auto& info = it->second;
+
+        for (uint32_t i = 0; i < pCreateInfo->descriptorUpdateEntryCount; ++i) {
+            const auto& entry = pCreateInfo->pDescriptorUpdateEntries[i];
+            uint32_t descCount = entry.descriptorCount;
+            VkDescriptorType descType = entry.descriptorType;
+            ++info.templateEntryCount;
+            for (uint32_t j = 0; j < descCount; ++j) {
+                if (isDescriptorTypeImageInfo(descType)) {
+                    ++info.imageInfoCount;
+                } else if (isDescriptorTypeBufferInfo(descType)) {
+                    ++info.bufferInfoCount;
+                } else if (isDescriptorTypeBufferView(descType)) {
+                    ++info.bufferViewCount;
+                } else {
+                    ALOGE("%s: FATAL: Unknown descriptor type %d\n", __func__, descType);
+                    abort();
+                }
+            }
+        }
+
+        if (info.templateEntryCount)
+            info.templateEntries = new VkDescriptorUpdateTemplateEntry[info.templateEntryCount];
+
+        if (info.imageInfoCount) {
+            info.imageInfoIndices = new uint32_t[info.imageInfoCount];
+            info.imageInfos = new VkDescriptorImageInfo[info.imageInfoCount];
+        }
+
+        if (info.bufferInfoCount) {
+            info.bufferInfoIndices = new uint32_t[info.bufferInfoCount];
+            info.bufferInfos = new VkDescriptorBufferInfo[info.bufferInfoCount];
+        }
+
+        if (info.bufferViewCount) {
+            info.bufferViewIndices = new uint32_t[info.bufferViewCount];
+            info.bufferViews = new VkBufferView[info.bufferViewCount];
+        }
+
+        uint32_t imageInfoIndex = 0;
+        uint32_t bufferInfoIndex = 0;
+        uint32_t bufferViewIndex = 0;
+
+        for (uint32_t i = 0; i < pCreateInfo->descriptorUpdateEntryCount; ++i) {
+            const auto& entry = pCreateInfo->pDescriptorUpdateEntries[i];
+            uint32_t descCount = entry.descriptorCount;
+            VkDescriptorType descType = entry.descriptorType;
+
+            info.templateEntries[i] = entry;
+
+            for (uint32_t j = 0; j < descCount; ++j) {
+                if (isDescriptorTypeImageInfo(descType)) {
+                    info.imageInfoIndices[imageInfoIndex] = i;
+                    ++imageInfoIndex;
+                } else if (isDescriptorTypeBufferInfo(descType)) {
+                    info.bufferInfoIndices[bufferInfoIndex] = i;
+                    ++bufferInfoIndex;
+                } else if (isDescriptorTypeBufferView(descType)) {
+                    info.bufferViewIndices[bufferViewIndex] = i;
+                    ++bufferViewIndex;
+                } else {
+                    ALOGE("%s: FATAL: Unknown descriptor type %d\n", __func__, descType);
+                    abort();
+                }
+            }
+        }
+
+        return VK_SUCCESS;
+    }
+
+    VkResult on_vkCreateDescriptorUpdateTemplate(
+        void* context, VkResult input_result,
+        VkDevice device,
+        const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
+        const VkAllocationCallbacks* pAllocator,
+        VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) {
+
+        (void)context;
+        (void)device;
+        (void)pAllocator;
+
+        if (input_result != VK_SUCCESS) return input_result;
+
+        return initDescriptorUpdateTemplateBuffers(pCreateInfo, *pDescriptorUpdateTemplate);
+    }
+
+    VkResult on_vkCreateDescriptorUpdateTemplateKHR(
+        void* context, VkResult input_result,
+        VkDevice device,
+        const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
+        const VkAllocationCallbacks* pAllocator,
+        VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) {
+
+        (void)context;
+        (void)device;
+        (void)pAllocator;
+
+        if (input_result != VK_SUCCESS) return input_result;
+
+        return initDescriptorUpdateTemplateBuffers(pCreateInfo, *pDescriptorUpdateTemplate);
+    }
+
+    void on_vkUpdateDescriptorSetWithTemplate(
+        void* context,
+        VkDevice device,
+        VkDescriptorSet descriptorSet,
+        VkDescriptorUpdateTemplate descriptorUpdateTemplate,
+        const void* pData) {
+
+        VkEncoder* enc = (VkEncoder*)context;
+
+        uint8_t* userBuffer = (uint8_t*)pData;
+        if (!userBuffer) return;
+
+        // TODO: Make this thread safe
+        AutoLock<RecursiveLock> lock(mLock);
+
+        auto it = info_VkDescriptorUpdateTemplate.find(descriptorUpdateTemplate);
+        if (it == info_VkDescriptorUpdateTemplate.end()) {
+            return;
+        }
+
+        auto& info = it->second;
+
+        uint32_t templateEntryCount = info.templateEntryCount;
+        VkDescriptorUpdateTemplateEntry* templateEntries = info.templateEntries;
+
+        uint32_t imageInfoCount = info.imageInfoCount;
+        uint32_t bufferInfoCount = info.bufferInfoCount;
+        uint32_t bufferViewCount = info.bufferViewCount;
+        uint32_t* imageInfoIndices = info.imageInfoIndices;
+        uint32_t* bufferInfoIndices = info.bufferInfoIndices;
+        uint32_t* bufferViewIndices = info.bufferViewIndices;
+        VkDescriptorImageInfo* imageInfos = info.imageInfos;
+        VkDescriptorBufferInfo* bufferInfos = info.bufferInfos;
+        VkBufferView* bufferViews = info.bufferViews;
+
+        lock.unlock();
+
+        size_t currImageInfoOffset = 0;
+        size_t currBufferInfoOffset = 0;
+        size_t currBufferViewOffset = 0;
+
+        struct goldfish_VkDescriptorSet* ds = as_goldfish_VkDescriptorSet(descriptorSet);
+        ReifiedDescriptorSet* reified = ds->reified;
+
+        bool batched = mFeatureInfo->hasVulkanBatchedDescriptorSetUpdate;
+
+        for (uint32_t i = 0; i < templateEntryCount; ++i) {
+            const auto& entry = templateEntries[i];
+            VkDescriptorType descType = entry.descriptorType;
+            uint32_t dstBinding = entry.dstBinding;
+
+            auto offset = entry.offset;
+            auto stride = entry.stride;
+            auto dstArrayElement = entry.dstArrayElement;
+
+            uint32_t descCount = entry.descriptorCount;
+
+            if (isDescriptorTypeImageInfo(descType)) {
+
+                if (!stride) stride = sizeof(VkDescriptorImageInfo);
+
+                const VkDescriptorImageInfo* currImageInfoBegin =
+                    (const VkDescriptorImageInfo*)((uint8_t*)imageInfos + currImageInfoOffset);
+
+                for (uint32_t j = 0; j < descCount; ++j) {
+                    const VkDescriptorImageInfo* user =
+                        (const VkDescriptorImageInfo*)(userBuffer + offset + j * stride);
+
+                    memcpy(((uint8_t*)imageInfos) + currImageInfoOffset,
+                           user, sizeof(VkDescriptorImageInfo));
+                    currImageInfoOffset += sizeof(VkDescriptorImageInfo);
+                }
+
+                if (batched) {
+                  doEmulatedDescriptorImageInfoWriteFromTemplate(
+                        descType,
+                        dstBinding,
+                        dstArrayElement,
+                        descCount,
+                        currImageInfoBegin,
+                        reified);
+                }
+            } else if (isDescriptorTypeBufferInfo(descType)) {
+
+
+                if (!stride) stride = sizeof(VkDescriptorBufferInfo);
+
+                const VkDescriptorBufferInfo* currBufferInfoBegin =
+                    (const VkDescriptorBufferInfo*)((uint8_t*)bufferInfos + currBufferInfoOffset);
+
+                for (uint32_t j = 0; j < descCount; ++j) {
+                    const VkDescriptorBufferInfo* user =
+                        (const VkDescriptorBufferInfo*)(userBuffer + offset + j * stride);
+
+                    memcpy(((uint8_t*)bufferInfos) + currBufferInfoOffset,
+                           user, sizeof(VkDescriptorBufferInfo));
+                    currBufferInfoOffset += sizeof(VkDescriptorBufferInfo);
+                }
+
+                if (batched) {
+                  doEmulatedDescriptorBufferInfoWriteFromTemplate(
+                        descType,
+                        dstBinding,
+                        dstArrayElement,
+                        descCount,
+                        currBufferInfoBegin,
+                        reified);
+                }
+
+            } else if (isDescriptorTypeBufferView(descType)) {
+                if (!stride) stride = sizeof(VkBufferView);
+
+                const VkBufferView* currBufferViewBegin =
+                    (const VkBufferView*)((uint8_t*)bufferViews + currBufferViewOffset);
+
+                for (uint32_t j = 0; j < descCount; ++j) {
+                  const VkBufferView* user =
+                        (const VkBufferView*)(userBuffer + offset + j * stride);
+
+                    memcpy(((uint8_t*)bufferViews) + currBufferViewOffset,
+                           user, sizeof(VkBufferView));
+                    currBufferViewOffset += sizeof(VkBufferView);
+                }
+
+                if (batched) {
+                  doEmulatedDescriptorBufferViewWriteFromTemplate(
+                        descType,
+                        dstBinding,
+                        dstArrayElement,
+                        descCount,
+                        currBufferViewBegin,
+                        reified);
+                }
+            } else {
+                ALOGE("%s: FATAL: Unknown descriptor type %d\n", __func__, descType);
+                abort();
+            }
+        }
+
+        if (batched) return;
+
+        enc->vkUpdateDescriptorSetWithTemplateSizedGOOGLE(
+            device,
+            descriptorSet,
+            descriptorUpdateTemplate,
+            imageInfoCount,
+            bufferInfoCount,
+            bufferViewCount,
+            imageInfoIndices,
+            bufferInfoIndices,
+            bufferViewIndices,
+            imageInfos,
+            bufferInfos,
+            bufferViews,
+            true /* do lock */);
+    }
+
+    VkResult on_vkGetPhysicalDeviceImageFormatProperties2_common(
+        bool isKhr,
+        void* context, VkResult input_result,
+        VkPhysicalDevice physicalDevice,
+        const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
+        VkImageFormatProperties2* pImageFormatProperties) {
+
+        VkEncoder* enc = (VkEncoder*)context;
+        (void)input_result;
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+
+        constexpr VkFormat kExternalImageSupportedFormats[] = {
+            VK_FORMAT_B8G8R8A8_SINT,
+            VK_FORMAT_B8G8R8A8_UNORM,
+            VK_FORMAT_B8G8R8A8_SRGB,
+            VK_FORMAT_B8G8R8A8_SNORM,
+            VK_FORMAT_B8G8R8A8_SSCALED,
+            VK_FORMAT_B8G8R8A8_USCALED,
+            VK_FORMAT_R8G8B8A8_SINT,
+            VK_FORMAT_R8G8B8A8_UNORM,
+            VK_FORMAT_R8G8B8A8_SRGB,
+            VK_FORMAT_R8G8B8A8_SNORM,
+            VK_FORMAT_R8G8B8A8_SSCALED,
+            VK_FORMAT_R8G8B8A8_USCALED,
+            VK_FORMAT_R8_UNORM,
+            VK_FORMAT_R8_UINT,
+            VK_FORMAT_R8_USCALED,
+            VK_FORMAT_R8_SNORM,
+            VK_FORMAT_R8_SINT,
+            VK_FORMAT_R8_SSCALED,
+            VK_FORMAT_R8_SRGB,
+            VK_FORMAT_R8G8_UNORM,
+            VK_FORMAT_R8G8_UINT,
+            VK_FORMAT_R8G8_USCALED,
+            VK_FORMAT_R8G8_SNORM,
+            VK_FORMAT_R8G8_SINT,
+            VK_FORMAT_R8G8_SSCALED,
+            VK_FORMAT_R8G8_SRGB,
+        };
+
+        VkExternalImageFormatProperties* ext_img_properties =
+            vk_find_struct<VkExternalImageFormatProperties>(pImageFormatProperties);
+
+        if (ext_img_properties) {
+          if (std::find(std::begin(kExternalImageSupportedFormats),
+                        std::end(kExternalImageSupportedFormats),
+                        pImageFormatInfo->format) == std::end(kExternalImageSupportedFormats)) {
+            return VK_ERROR_FORMAT_NOT_SUPPORTED;
+          }
+        }
+#endif
+
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+        VkAndroidHardwareBufferUsageANDROID* output_ahw_usage =
+            vk_find_struct<VkAndroidHardwareBufferUsageANDROID>(pImageFormatProperties);
+#endif
+
+        VkResult hostRes;
+
+        if (isKhr) {
+            hostRes = enc->vkGetPhysicalDeviceImageFormatProperties2KHR(
+                physicalDevice, pImageFormatInfo,
+                pImageFormatProperties, true /* do lock */);
+        } else {
+            hostRes = enc->vkGetPhysicalDeviceImageFormatProperties2(
+                physicalDevice, pImageFormatInfo,
+                pImageFormatProperties, true /* do lock */);
+        }
+
+        if (hostRes != VK_SUCCESS) return hostRes;
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+        if (ext_img_properties) {
+            const VkPhysicalDeviceExternalImageFormatInfo* ext_img_info =
+                vk_find_struct<VkPhysicalDeviceExternalImageFormatInfo>(pImageFormatInfo);
+            if (ext_img_info) {
+                if (static_cast<uint32_t>(ext_img_info->handleType) ==
+                    VK_EXTERNAL_MEMORY_HANDLE_TYPE_ZIRCON_VMO_BIT_FUCHSIA) {
+                    ext_img_properties->externalMemoryProperties = {
+                            .externalMemoryFeatures =
+                                    VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT |
+                                    VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT,
+                            .exportFromImportedHandleTypes =
+                                    VK_EXTERNAL_MEMORY_HANDLE_TYPE_ZIRCON_VMO_BIT_FUCHSIA,
+                            .compatibleHandleTypes =
+                                    VK_EXTERNAL_MEMORY_HANDLE_TYPE_ZIRCON_VMO_BIT_FUCHSIA,
+                    };
+                }
+            }
+        }
+#endif
+
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+        if (output_ahw_usage) {
+            output_ahw_usage->androidHardwareBufferUsage =
+                getAndroidHardwareBufferUsageFromVkUsage(
+                    pImageFormatInfo->flags,
+                    pImageFormatInfo->usage);
+        }
+#endif
+
+        return hostRes;
+    }
+
+    VkResult on_vkGetPhysicalDeviceImageFormatProperties2(
+        void* context, VkResult input_result,
+        VkPhysicalDevice physicalDevice,
+        const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
+        VkImageFormatProperties2* pImageFormatProperties) {
+        return on_vkGetPhysicalDeviceImageFormatProperties2_common(
+            false /* not KHR */, context, input_result,
+            physicalDevice, pImageFormatInfo, pImageFormatProperties);
+    }
+
+    VkResult on_vkGetPhysicalDeviceImageFormatProperties2KHR(
+        void* context, VkResult input_result,
+        VkPhysicalDevice physicalDevice,
+        const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
+        VkImageFormatProperties2* pImageFormatProperties) {
+        return on_vkGetPhysicalDeviceImageFormatProperties2_common(
+            true /* is KHR */, context, input_result,
+            physicalDevice, pImageFormatInfo, pImageFormatProperties);
+    }
+
+    void on_vkGetPhysicalDeviceExternalSemaphoreProperties(
+        void*,
+        VkPhysicalDevice,
+        const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo,
+        VkExternalSemaphoreProperties* pExternalSemaphoreProperties) {
+        (void)pExternalSemaphoreInfo;
+        (void)pExternalSemaphoreProperties;
+#ifdef VK_USE_PLATFORM_FUCHSIA
+        if (pExternalSemaphoreInfo->handleType ==
+            static_cast<uint32_t>(VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_ZIRCON_EVENT_BIT_FUCHSIA)) {
+            pExternalSemaphoreProperties->compatibleHandleTypes |=
+                VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_ZIRCON_EVENT_BIT_FUCHSIA;
+            pExternalSemaphoreProperties->exportFromImportedHandleTypes |=
+                VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_ZIRCON_EVENT_BIT_FUCHSIA;
+            pExternalSemaphoreProperties->externalSemaphoreFeatures |=
+                VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT |
+                VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT;
+        }
+#else
+        if (pExternalSemaphoreInfo->handleType ==
+            VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT) {
+            pExternalSemaphoreProperties->compatibleHandleTypes |=
+                VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT;
+            pExternalSemaphoreProperties->exportFromImportedHandleTypes |=
+                VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT;
+            pExternalSemaphoreProperties->externalSemaphoreFeatures |=
+                VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT |
+                VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT;
+        }
+#endif  // VK_USE_PLATFORM_FUCHSIA
+    }
+
+    void registerEncoderCleanupCallback(const VkEncoder* encoder, void* object, CleanupCallback callback) {
+        AutoLock<RecursiveLock> lock(mLock);
+        auto& callbacks = mEncoderCleanupCallbacks[encoder];
+        callbacks[object] = callback;
+    }
+
+    void unregisterEncoderCleanupCallback(const VkEncoder* encoder, void* object) {
+        AutoLock<RecursiveLock> lock(mLock);
+        mEncoderCleanupCallbacks[encoder].erase(object);
+    }
+
+    void onEncoderDeleted(const VkEncoder* encoder) {
+        AutoLock<RecursiveLock> lock(mLock);
+        if (mEncoderCleanupCallbacks.find(encoder) == mEncoderCleanupCallbacks.end()) return;
+
+        std::unordered_map<void*, CleanupCallback> callbackCopies = mEncoderCleanupCallbacks[encoder];
+
+        mEncoderCleanupCallbacks.erase(encoder);
+        lock.unlock();
+
+        for (auto it : callbackCopies) {
+            it.second();
+        }
+    }
+
+    uint32_t syncEncodersForCommandBuffer(VkCommandBuffer commandBuffer, VkEncoder* currentEncoder) {
+        struct goldfish_VkCommandBuffer* cb = as_goldfish_VkCommandBuffer(commandBuffer);
+        if (!cb) return 0;
+
+        auto lastEncoder = cb->lastUsedEncoder;
+
+        if (lastEncoder == currentEncoder) return 0;
+
+        currentEncoder->incRef();
+
+        cb->lastUsedEncoder = currentEncoder;
+
+        if (!lastEncoder) return 0;
+
+        auto oldSeq = cb->sequenceNumber;
+        cb->sequenceNumber += 2;
+        lastEncoder->vkCommandBufferHostSyncGOOGLE(commandBuffer, false, oldSeq + 1, true /* do lock */);
+        lastEncoder->flush();
+        currentEncoder->vkCommandBufferHostSyncGOOGLE(commandBuffer, true, oldSeq + 2, true /* do lock */);
+
+        if (lastEncoder->decRef()) {
+            cb->lastUsedEncoder = nullptr;
+        }
+        return 0;
+    }
+
+    uint32_t syncEncodersForQueue(VkQueue queue, VkEncoder* currentEncoder) {
+        if (!supportsAsyncQueueSubmit()) {
+            return 0;
+        }
+
+        struct goldfish_VkQueue* q = as_goldfish_VkQueue(queue);
+        if (!q) return 0;
+
+        auto lastEncoder = q->lastUsedEncoder;
+
+        if (lastEncoder == currentEncoder) return 0;
+
+        currentEncoder->incRef();
+
+        q->lastUsedEncoder = currentEncoder;
+
+        if (!lastEncoder) return 0;
+
+        auto oldSeq = q->sequenceNumber;
+        q->sequenceNumber += 2;
+        lastEncoder->vkQueueHostSyncGOOGLE(queue, false, oldSeq + 1, true /* do lock */);
+        lastEncoder->flush();
+        currentEncoder->vkQueueHostSyncGOOGLE(queue, true, oldSeq + 2, true /* do lock */);
+
+        if (lastEncoder->decRef()) {
+            q->lastUsedEncoder = nullptr;
+        }
+
+        return 0;
+    }
+
+    CommandBufferStagingStream::Alloc getAlloc() {
+        if (mFeatureInfo->hasVulkanAuxCommandMemory) {
+            return [this](size_t size) -> CommandBufferStagingStream::Memory {
+                VkMemoryAllocateInfo info{
+                    .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO,
+                    .pNext = nullptr,
+                    .allocationSize = size,
+                    .memoryTypeIndex = VK_MAX_MEMORY_TYPES  // indicates auxiliary memory
+                };
+
+                auto enc = ResourceTracker::getThreadLocalEncoder();
+                VkDevice device = VK_NULL_HANDLE;
+                VkDeviceMemory vkDeviceMem = VK_NULL_HANDLE;
+                VkResult result = getCoherentMemory(&info, enc, device, &vkDeviceMem);
+                if (result != VK_SUCCESS) {
+                    ALOGE("Failed to get coherent memory %u", result);
+                    return {.deviceMemory = VK_NULL_HANDLE, .ptr = nullptr};
+                }
+
+                // getCoherentMemory() uses suballocations.
+                // To retrieve the suballocated memory address, look up
+                // VkDeviceMemory filled in by getCoherentMemory()
+                // scope of mLock
+                {
+                    AutoLock<RecursiveLock> lock(mLock);
+                    const auto it = info_VkDeviceMemory.find(vkDeviceMem);
+                    if (it == info_VkDeviceMemory.end()) {
+                        ALOGE("Coherent memory allocated %u not found", result);
+                        return {.deviceMemory = VK_NULL_HANDLE, .ptr = nullptr};
+                    };
+
+                    const auto& info = it->second;
+                    return {.deviceMemory = vkDeviceMem, .ptr = info.ptr};
+                }
+            };
+        }
+        return nullptr;
+    }
+
+    CommandBufferStagingStream::Free getFree() {
+        if (mFeatureInfo->hasVulkanAuxCommandMemory) {
+            return [this](const CommandBufferStagingStream::Memory& memory) {
+                // deviceMemory may not be the actual backing auxiliary VkDeviceMemory
+                // for suballocations, deviceMemory is a alias VkDeviceMemory hand;
+                // freeCoherentMemoryLocked maps the alias to the backing VkDeviceMemory
+                VkDeviceMemory deviceMemory = memory.deviceMemory;
+                AutoLock<RecursiveLock> lock(mLock);
+                auto it = info_VkDeviceMemory.find(deviceMemory);
+                if (it == info_VkDeviceMemory.end()) {
+                    ALOGE("Device memory to free not found");
+                    return;
+                }
+                auto coherentMemory = freeCoherentMemoryLocked(deviceMemory, it->second);
+                // We have to release the lock before we could possibly free a
+                // CoherentMemory, because that will call into VkEncoder, which
+                // shouldn't be called when the lock is held.
+                lock.unlock();
+                coherentMemory = nullptr;
+            };
+        }
+        return nullptr;
+    }
+
+    VkResult on_vkBeginCommandBuffer(
+        void* context, VkResult input_result,
+        VkCommandBuffer commandBuffer,
+        const VkCommandBufferBeginInfo* pBeginInfo) {
+
+        (void)context;
+
+        resetCommandBufferStagingInfo(commandBuffer, true /* also reset primaries */, true /* also clear pending descriptor sets */);
+
+        VkEncoder* enc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+        (void)input_result;
+
+        struct goldfish_VkCommandBuffer* cb = as_goldfish_VkCommandBuffer(commandBuffer);
+        cb->flags = pBeginInfo->flags;
+
+        VkCommandBufferBeginInfo modifiedBeginInfo;
+
+        if (pBeginInfo->pInheritanceInfo && !cb->isSecondary) {
+            modifiedBeginInfo = *pBeginInfo;
+            modifiedBeginInfo.pInheritanceInfo = nullptr;
+            pBeginInfo = &modifiedBeginInfo;
+        }
+
+        if (!supportsDeferredCommands()) {
+            return enc->vkBeginCommandBuffer(commandBuffer, pBeginInfo, true /* do lock */);
+        }
+
+        enc->vkBeginCommandBufferAsyncGOOGLE(commandBuffer, pBeginInfo, true /* do lock */);
+
+        return VK_SUCCESS;
+    }
+
+    VkResult on_vkEndCommandBuffer(
+        void* context, VkResult input_result,
+        VkCommandBuffer commandBuffer) {
+
+        VkEncoder* enc = (VkEncoder*)context;
+        (void)input_result;
+
+        if (!supportsDeferredCommands()) {
+            return enc->vkEndCommandBuffer(commandBuffer, true /* do lock */);
+        }
+
+        enc->vkEndCommandBufferAsyncGOOGLE(commandBuffer, true /* do lock */);
+
+        return VK_SUCCESS;
+    }
+
+    VkResult on_vkResetCommandBuffer(
+        void* context, VkResult input_result,
+        VkCommandBuffer commandBuffer,
+        VkCommandBufferResetFlags flags) {
+
+        resetCommandBufferStagingInfo(commandBuffer, true /* also reset primaries */, true /* also clear pending descriptor sets */);
+
+        VkEncoder* enc = (VkEncoder*)context;
+        (void)input_result;
+
+        if (!supportsDeferredCommands()) {
+            return enc->vkResetCommandBuffer(commandBuffer, flags, true /* do lock */);
+        }
+
+        enc->vkResetCommandBufferAsyncGOOGLE(commandBuffer, flags, true /* do lock */);
+        return VK_SUCCESS;
+    }
+
+    VkResult on_vkCreateImageView(
+        void* context, VkResult input_result,
+        VkDevice device,
+        const VkImageViewCreateInfo* pCreateInfo,
+        const VkAllocationCallbacks* pAllocator,
+        VkImageView* pView) {
+
+        VkEncoder* enc = (VkEncoder*)context;
+        (void)input_result;
+
+        VkImageViewCreateInfo localCreateInfo = vk_make_orphan_copy(*pCreateInfo);
+        vk_struct_chain_iterator structChainIter = vk_make_chain_iterator(&localCreateInfo);
+
+#if defined(VK_USE_PLATFORM_ANDROID_KHR)
+        if (pCreateInfo->format == VK_FORMAT_UNDEFINED) {
+            AutoLock<RecursiveLock> lock(mLock);
+
+            auto it = info_VkImage.find(pCreateInfo->image);
+            if (it != info_VkImage.end() && it->second.hasExternalFormat) {
+                localCreateInfo.format = vk_format_from_android(it->second.androidFormat);
+            }
+        }
+        VkSamplerYcbcrConversionInfo localVkSamplerYcbcrConversionInfo;
+        const VkSamplerYcbcrConversionInfo* samplerYcbcrConversionInfo =
+            vk_find_struct<VkSamplerYcbcrConversionInfo>(pCreateInfo);
+        if (samplerYcbcrConversionInfo) {
+            if (samplerYcbcrConversionInfo->conversion != VK_YCBCR_CONVERSION_DO_NOTHING) {
+                localVkSamplerYcbcrConversionInfo = vk_make_orphan_copy(*samplerYcbcrConversionInfo);
+                vk_append_struct(&structChainIter, &localVkSamplerYcbcrConversionInfo);
+            }
+        }
+#endif
+
+        return enc->vkCreateImageView(device, &localCreateInfo, pAllocator, pView, true /* do lock */);
+    }
+
+    void on_vkCmdExecuteCommands(
+        void* context,
+        VkCommandBuffer commandBuffer,
+        uint32_t commandBufferCount,
+        const VkCommandBuffer* pCommandBuffers) {
+
+        VkEncoder* enc = (VkEncoder*)context;
+
+        if (!mFeatureInfo->hasVulkanQueueSubmitWithCommands) {
+            enc->vkCmdExecuteCommands(commandBuffer, commandBufferCount, pCommandBuffers, true /* do lock */);
+            return;
+        }
+
+        struct goldfish_VkCommandBuffer* primary = as_goldfish_VkCommandBuffer(commandBuffer);
+        for (uint32_t i = 0; i < commandBufferCount; ++i) {
+            struct goldfish_VkCommandBuffer* secondary = as_goldfish_VkCommandBuffer(pCommandBuffers[i]);
+            appendObject(&secondary->superObjects, primary);
+            appendObject(&primary->subObjects, secondary);
+        }
+
+        enc->vkCmdExecuteCommands(commandBuffer, commandBufferCount, pCommandBuffers, true /* do lock */);
+    }
+
+    void addPendingDescriptorSets(VkCommandBuffer commandBuffer, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets) {
+        struct goldfish_VkCommandBuffer* cb = as_goldfish_VkCommandBuffer(commandBuffer);
+
+        if (!cb->userPtr) {
+            CommandBufferPendingDescriptorSets* newPendingSets =
+                new CommandBufferPendingDescriptorSets;
+            cb->userPtr = newPendingSets;
+        }
+
+        CommandBufferPendingDescriptorSets* pendingSets =
+            (CommandBufferPendingDescriptorSets*)cb->userPtr;
+
+        for (uint32_t i = 0; i < descriptorSetCount; ++i) {
+            pendingSets->sets.insert(pDescriptorSets[i]);
+        }
+    }
+
+    void on_vkCmdBindDescriptorSets(
+        void* context,
+        VkCommandBuffer commandBuffer,
+        VkPipelineBindPoint pipelineBindPoint,
+        VkPipelineLayout layout,
+        uint32_t firstSet,
+        uint32_t descriptorSetCount,
+        const VkDescriptorSet* pDescriptorSets,
+        uint32_t dynamicOffsetCount,
+        const uint32_t* pDynamicOffsets) {
+
+        VkEncoder* enc = (VkEncoder*)context;
+
+        if (mFeatureInfo->hasVulkanBatchedDescriptorSetUpdate)
+            addPendingDescriptorSets(commandBuffer, descriptorSetCount, pDescriptorSets);
+
+        enc->vkCmdBindDescriptorSets(
+            commandBuffer,
+            pipelineBindPoint,
+            layout,
+            firstSet,
+            descriptorSetCount,
+            pDescriptorSets,
+            dynamicOffsetCount,
+            pDynamicOffsets,
+            true /* do lock */);
+    }
+
+    void on_vkCmdPipelineBarrier(
+        void* context,
+        VkCommandBuffer commandBuffer,
+        VkPipelineStageFlags srcStageMask,
+        VkPipelineStageFlags dstStageMask,
+        VkDependencyFlags dependencyFlags,
+        uint32_t memoryBarrierCount,
+        const VkMemoryBarrier* pMemoryBarriers,
+        uint32_t bufferMemoryBarrierCount,
+        const VkBufferMemoryBarrier* pBufferMemoryBarriers,
+        uint32_t imageMemoryBarrierCount,
+        const VkImageMemoryBarrier* pImageMemoryBarriers) {
+
+        VkEncoder* enc = (VkEncoder*)context;
+
+        std::vector<VkImageMemoryBarrier> updatedImageMemoryBarriers;
+        updatedImageMemoryBarriers.reserve(imageMemoryBarrierCount);
+        for (uint32_t i = 0; i < imageMemoryBarrierCount; i++) {
+            VkImageMemoryBarrier barrier = pImageMemoryBarriers[i];
+
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+            // Unfortunetly, Android does not yet have a mechanism for sharing the expected
+            // VkImageLayout when passing around AHardwareBuffer-s so many existing users
+            // that import AHardwareBuffer-s into VkImage-s/VkDeviceMemory-s simply use
+            // VK_IMAGE_LAYOUT_UNDEFINED. However, the Vulkan spec's image layout transition
+            // sections says "If the old layout is VK_IMAGE_LAYOUT_UNDEFINED, the contents of
+            // that range may be discarded." Some Vulkan drivers have been observed to actually
+            // perform the discard which leads to AHardwareBuffer-s being unintentionally
+            // cleared. See go/ahb-vkimagelayout for more information.
+            if (barrier.srcQueueFamilyIndex != barrier.dstQueueFamilyIndex &&
+                (barrier.srcQueueFamilyIndex == VK_QUEUE_FAMILY_EXTERNAL ||
+                 barrier.srcQueueFamilyIndex == VK_QUEUE_FAMILY_FOREIGN_EXT) &&
+                barrier.oldLayout == VK_IMAGE_LAYOUT_UNDEFINED) {
+                // This is not a complete solution as the Vulkan spec does not require that
+                // Vulkan drivers perform a no-op in the case when oldLayout equals newLayout
+                // but this has been observed to be enough to work for now to avoid clearing
+                // out images.
+                // TODO(b/236179843): figure out long term solution.
+                barrier.oldLayout = barrier.newLayout;
+            }
+#endif
+
+            updatedImageMemoryBarriers.push_back(barrier);
+        }
+
+        enc->vkCmdPipelineBarrier(
+            commandBuffer,
+            srcStageMask,
+            dstStageMask,
+            dependencyFlags,
+            memoryBarrierCount,
+            pMemoryBarriers,
+            bufferMemoryBarrierCount,
+            pBufferMemoryBarriers,
+            updatedImageMemoryBarriers.size(),
+            updatedImageMemoryBarriers.data(),
+            true /* do lock */);
+    }
+
+    void decDescriptorSetLayoutRef(
+        void* context,
+        VkDevice device,
+        VkDescriptorSetLayout descriptorSetLayout,
+        const VkAllocationCallbacks* pAllocator) {
+
+        if (!descriptorSetLayout) return;
+
+        struct goldfish_VkDescriptorSetLayout* setLayout = as_goldfish_VkDescriptorSetLayout(descriptorSetLayout);
+
+        if (0 == --setLayout->layoutInfo->refcount) {
+            VkEncoder* enc = (VkEncoder*)context;
+            enc->vkDestroyDescriptorSetLayout(device, descriptorSetLayout, pAllocator, true /* do lock */);
+        }
+    }
+
+    void on_vkDestroyDescriptorSetLayout(
+        void* context,
+        VkDevice device,
+        VkDescriptorSetLayout descriptorSetLayout,
+        const VkAllocationCallbacks* pAllocator) {
+        decDescriptorSetLayoutRef(context, device, descriptorSetLayout, pAllocator);
+    }
+
+    VkResult on_vkAllocateCommandBuffers(
+        void* context,
+        VkResult input_result,
+        VkDevice device,
+        const VkCommandBufferAllocateInfo* pAllocateInfo,
+        VkCommandBuffer* pCommandBuffers) {
+
+        (void)input_result;
+
+        VkEncoder* enc = (VkEncoder*)context;
+        VkResult res = enc->vkAllocateCommandBuffers(device, pAllocateInfo, pCommandBuffers, true /* do lock */);
+        if (VK_SUCCESS != res) return res;
+
+        for (uint32_t i = 0; i < pAllocateInfo->commandBufferCount; ++i) {
+            struct goldfish_VkCommandBuffer* cb = as_goldfish_VkCommandBuffer(pCommandBuffers[i]);
+            cb->isSecondary = pAllocateInfo->level == VK_COMMAND_BUFFER_LEVEL_SECONDARY;
+            cb->device = device;
+        }
+
+        return res;
+    }
+
+#if defined(VK_USE_PLATFORM_ANDROID_KHR)
+    VkResult exportSyncFdForQSRILocked(VkImage image, int *fd) {
+
+        ALOGV("%s: call for image %p hos timage handle 0x%llx\n", __func__, (void*)image,
+              (unsigned long long)get_host_u64_VkImage(image));
+
+        if (mFeatureInfo->hasVirtioGpuNativeSync) {
+            struct VirtGpuExecBuffer exec = { };
+            struct gfxstreamCreateQSRIExportVK exportQSRI = { };
+            VirtGpuDevice& instance = VirtGpuDevice::getInstance();
+
+            uint64_t hostImageHandle = get_host_u64_VkImage(image);
+
+            exportQSRI.hdr.opCode = GFXSTREAM_CREATE_QSRI_EXPORT_VK;
+            exportQSRI.imageHandleLo = (uint32_t)hostImageHandle;
+            exportQSRI.imageHandleHi = (uint32_t)(hostImageHandle >> 32);
+
+            exec.command = static_cast<void*>(&exportQSRI);
+            exec.command_size = sizeof(exportQSRI);
+            exec.flags = kFenceOut | kRingIdx;
+            if (instance.execBuffer(exec, nullptr))
+                return VK_ERROR_OUT_OF_HOST_MEMORY;
+
+            *fd = exec.handle.osHandle;
+        } else {
+            goldfish_sync_queue_work(
+                    mSyncDeviceFd,
+                    get_host_u64_VkImage(image) /* the handle */,
+                    GOLDFISH_SYNC_VULKAN_QSRI /* thread handle (doubling as type field) */,
+                    fd);
+        }
+
+        ALOGV("%s: got fd: %d\n", __func__, *fd);
+        auto imageInfoIt = info_VkImage.find(image);
+        if (imageInfoIt != info_VkImage.end()) {
+            auto& imageInfo = imageInfoIt->second;
+
+            // Remove any pending QSRI sync fds that are already signaled.
+            auto syncFdIt = imageInfo.pendingQsriSyncFds.begin();
+            while (syncFdIt != imageInfo.pendingQsriSyncFds.end()) {
+                int syncFd = *syncFdIt;
+                int syncWaitRet = sync_wait(syncFd, /*timeout msecs*/0);
+                if (syncWaitRet == 0) {
+                    // Sync fd is signaled.
+                    syncFdIt = imageInfo.pendingQsriSyncFds.erase(syncFdIt);
+                    close(syncFd);
+                } else {
+                    if (errno != ETIME) {
+                        ALOGE("%s: Failed to wait for pending QSRI sync: sterror: %s errno: %d",
+                              __func__, strerror(errno), errno);
+                    }
+                    break;
+                }
+            }
+
+            int syncFdDup = dup(*fd);
+            if (syncFdDup < 0) {
+                ALOGE("%s: Failed to dup() QSRI sync fd : sterror: %s errno: %d",
+                      __func__, strerror(errno), errno);
+            } else {
+                imageInfo.pendingQsriSyncFds.push_back(syncFdDup);
+            }
+        }
+
+        return VK_SUCCESS;
+    }
+
+    VkResult on_vkQueueSignalReleaseImageANDROID(
+        void* context,
+        VkResult input_result,
+        VkQueue queue,
+        uint32_t waitSemaphoreCount,
+        const VkSemaphore* pWaitSemaphores,
+        VkImage image,
+        int* pNativeFenceFd) {
+
+        (void)input_result;
+
+        VkEncoder* enc = (VkEncoder*)context;
+
+        if (!mFeatureInfo->hasVulkanAsyncQsri) {
+            return enc->vkQueueSignalReleaseImageANDROID(queue, waitSemaphoreCount, pWaitSemaphores, image, pNativeFenceFd, true /* lock */);
+        }
+
+        {
+            AutoLock<RecursiveLock> lock(mLock);
+            auto it = info_VkImage.find(image);
+            if (it == info_VkImage.end()) {
+                if (pNativeFenceFd) *pNativeFenceFd = -1;
+                return VK_ERROR_INITIALIZATION_FAILED;
+            }
+        }
+
+        enc->vkQueueSignalReleaseImageANDROIDAsyncGOOGLE(queue, waitSemaphoreCount, pWaitSemaphores, image, true /* lock */);
+
+        AutoLock<RecursiveLock> lock(mLock);
+        VkResult result;
+        if (pNativeFenceFd) {
+            result =
+                exportSyncFdForQSRILocked(image, pNativeFenceFd);
+        } else {
+            int syncFd;
+            result = exportSyncFdForQSRILocked(image, &syncFd);
+
+            if (syncFd >= 0)
+                close(syncFd);
+        }
+
+        return result;
+    }
+#endif
+
+    VkResult on_vkCreateGraphicsPipelines(
+        void* context,
+        VkResult input_result,
+        VkDevice device,
+        VkPipelineCache pipelineCache,
+        uint32_t createInfoCount,
+        const VkGraphicsPipelineCreateInfo* pCreateInfos,
+        const VkAllocationCallbacks* pAllocator,
+        VkPipeline* pPipelines) {
+        (void)input_result;
+        VkEncoder* enc = (VkEncoder*)context;
+        std::vector<VkGraphicsPipelineCreateInfo> localCreateInfos(
+                pCreateInfos, pCreateInfos + createInfoCount);
+        for (VkGraphicsPipelineCreateInfo& graphicsPipelineCreateInfo : localCreateInfos) {
+            // dEQP-VK.api.pipeline.pipeline_invalid_pointers_unused_structs#graphics
+            bool requireViewportState = false;
+            // VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00750
+            requireViewportState |= graphicsPipelineCreateInfo.pRasterizationState != nullptr &&
+                    graphicsPipelineCreateInfo.pRasterizationState->rasterizerDiscardEnable
+                        == VK_FALSE;
+            // VUID-VkGraphicsPipelineCreateInfo-pViewportState-04892
+#ifdef VK_EXT_extended_dynamic_state2
+            if (!requireViewportState && graphicsPipelineCreateInfo.pDynamicState) {
+                for (uint32_t i = 0; i <
+                            graphicsPipelineCreateInfo.pDynamicState->dynamicStateCount; i++) {
+                    if (VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE_EXT ==
+                                graphicsPipelineCreateInfo.pDynamicState->pDynamicStates[i]) {
+                        requireViewportState = true;
+                        break;
+                    }
+                }
+            }
+#endif // VK_EXT_extended_dynamic_state2
+            if (!requireViewportState) {
+                graphicsPipelineCreateInfo.pViewportState = nullptr;
+            }
+
+            // It has the same requirement as for pViewportState.
+            bool shouldIncludeFragmentShaderState = requireViewportState;
+
+            // VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00751
+            if (!shouldIncludeFragmentShaderState) {
+                graphicsPipelineCreateInfo.pMultisampleState = nullptr;
+            }
+
+            // VUID-VkGraphicsPipelineCreateInfo-renderPass-06043
+            // VUID-VkGraphicsPipelineCreateInfo-renderPass-06044
+            if (graphicsPipelineCreateInfo.renderPass == VK_NULL_HANDLE
+                    || !shouldIncludeFragmentShaderState) {
+                graphicsPipelineCreateInfo.pDepthStencilState = nullptr;
+                graphicsPipelineCreateInfo.pColorBlendState = nullptr;
+            }
+        }
+        return enc->vkCreateGraphicsPipelines(device, pipelineCache, localCreateInfos.size(),
+                localCreateInfos.data(), pAllocator, pPipelines, true /* do lock */);
+    }
+
+    uint32_t getApiVersionFromInstance(VkInstance instance) const {
+        AutoLock<RecursiveLock> lock(mLock);
+        uint32_t api = kDefaultApiVersion;
+
+        auto it = info_VkInstance.find(instance);
+        if (it == info_VkInstance.end()) return api;
+
+        api = it->second.highestApiVersion;
+
+        return api;
+    }
+
+    uint32_t getApiVersionFromDevice(VkDevice device) const {
+        AutoLock<RecursiveLock> lock(mLock);
+
+        uint32_t api = kDefaultApiVersion;
+
+        auto it = info_VkDevice.find(device);
+        if (it == info_VkDevice.end()) return api;
+
+        api = it->second.apiVersion;
+
+        return api;
+    }
+
+    bool hasInstanceExtension(VkInstance instance, const std::string& name) const {
+        AutoLock<RecursiveLock> lock(mLock);
+
+        auto it = info_VkInstance.find(instance);
+        if (it == info_VkInstance.end()) return false;
+
+        return it->second.enabledExtensions.find(name) !=
+               it->second.enabledExtensions.end();
+    }
+
+    bool hasDeviceExtension(VkDevice device, const std::string& name) const {
+        AutoLock<RecursiveLock> lock(mLock);
+
+        auto it = info_VkDevice.find(device);
+        if (it == info_VkDevice.end()) return false;
+
+        return it->second.enabledExtensions.find(name) !=
+               it->second.enabledExtensions.end();
+    }
+
+    VkDevice getDevice(VkCommandBuffer commandBuffer) const {
+        struct goldfish_VkCommandBuffer* cb = as_goldfish_VkCommandBuffer(commandBuffer);
+        if (!cb) {
+            return nullptr;
+        }
+        return cb->device;
+    }
+
+    // Resets staging stream for this command buffer and primary command buffers
+    // where this command buffer has been recorded. If requested, also clears the pending
+    // descriptor sets.
+    void resetCommandBufferStagingInfo(VkCommandBuffer commandBuffer, bool alsoResetPrimaries,
+                                       bool alsoClearPendingDescriptorSets) {
+        struct goldfish_VkCommandBuffer* cb = as_goldfish_VkCommandBuffer(commandBuffer);
+        if (!cb) {
+            return;
+        }
+        if (cb->privateEncoder) {
+            sStaging.pushStaging((CommandBufferStagingStream*)cb->privateStream, cb->privateEncoder);
+            cb->privateEncoder = nullptr;
+            cb->privateStream = nullptr;
+        }
+
+        if (alsoClearPendingDescriptorSets && cb->userPtr) {
+            CommandBufferPendingDescriptorSets* pendingSets = (CommandBufferPendingDescriptorSets*)cb->userPtr;
+            pendingSets->sets.clear();
+        }
+
+        if (alsoResetPrimaries) {
+            forAllObjects(cb->superObjects, [this, alsoResetPrimaries, alsoClearPendingDescriptorSets](void* obj) {
+                VkCommandBuffer superCommandBuffer = (VkCommandBuffer)obj;
+                struct goldfish_VkCommandBuffer* superCb = as_goldfish_VkCommandBuffer(superCommandBuffer);
+                this->resetCommandBufferStagingInfo(superCommandBuffer, alsoResetPrimaries, alsoClearPendingDescriptorSets);
+            });
+            eraseObjects(&cb->superObjects);
+        }
+
+        forAllObjects(cb->subObjects, [cb](void* obj) {
+            VkCommandBuffer subCommandBuffer = (VkCommandBuffer)obj;
+            struct goldfish_VkCommandBuffer* subCb = as_goldfish_VkCommandBuffer(subCommandBuffer);
+            // We don't do resetCommandBufferStagingInfo(subCommandBuffer)
+            // since the user still might have submittable stuff pending there.
+            eraseObject(&subCb->superObjects, (void*)cb);
+        });
+
+        eraseObjects(&cb->subObjects);
+    }
+
+    void resetCommandPoolStagingInfo(VkCommandPool commandPool) {
+        struct goldfish_VkCommandPool* p = as_goldfish_VkCommandPool(commandPool);
+
+        if (!p) return;
+
+        forAllObjects(p->subObjects, [this](void* commandBuffer) {
+            this->resetCommandBufferStagingInfo((VkCommandBuffer)commandBuffer, true /* also reset primaries */, true /* also clear pending descriptor sets */);
+        });
+    }
+
+    void addToCommandPool(VkCommandPool commandPool,
+                          uint32_t commandBufferCount,
+                          VkCommandBuffer* pCommandBuffers) {
+        for (uint32_t i = 0; i < commandBufferCount; ++i) {
+            struct goldfish_VkCommandPool* p = as_goldfish_VkCommandPool(commandPool);
+            struct goldfish_VkCommandBuffer* cb = as_goldfish_VkCommandBuffer(pCommandBuffers[i]);
+            appendObject(&p->subObjects, (void*)(pCommandBuffers[i]));
+            appendObject(&cb->poolObjects, (void*)commandPool);
+        }
+    }
+
+    void clearCommandPool(VkCommandPool commandPool) {
+        resetCommandPoolStagingInfo(commandPool);
+        struct goldfish_VkCommandPool* p = as_goldfish_VkCommandPool(commandPool);
+        forAllObjects(p->subObjects, [this](void* commandBuffer) {
+            this->unregister_VkCommandBuffer((VkCommandBuffer)commandBuffer);
+        });
+        eraseObjects(&p->subObjects);
+    }
+
+private:
+    mutable RecursiveLock mLock;
+
+    const VkPhysicalDeviceMemoryProperties& getPhysicalDeviceMemoryProperties(
+            void* context,
+            VkDevice device = VK_NULL_HANDLE,
+            VkPhysicalDevice physicalDevice = VK_NULL_HANDLE) {
+        if (!mCachedPhysicalDeviceMemoryProps) {
+            if (physicalDevice == VK_NULL_HANDLE) {
+                AutoLock<RecursiveLock> lock(mLock);
+
+                auto deviceInfoIt = info_VkDevice.find(device);
+                if (deviceInfoIt == info_VkDevice.end()) {
+                    ALOGE("Failed to pass device or physical device.");
+                    abort();
+                }
+                const auto& deviceInfo = deviceInfoIt->second;
+                physicalDevice = deviceInfo.physdev;
+            }
+
+            VkEncoder* enc = (VkEncoder*)context;
+
+            VkPhysicalDeviceMemoryProperties properties;
+            enc->vkGetPhysicalDeviceMemoryProperties(physicalDevice, &properties, true /* no lock */);
+
+            mCachedPhysicalDeviceMemoryProps.emplace(std::move(properties));
+        }
+        return *mCachedPhysicalDeviceMemoryProps;
+    }
+
+    std::optional<const VkPhysicalDeviceMemoryProperties> mCachedPhysicalDeviceMemoryProps;
+    std::unique_ptr<EmulatorFeatureInfo> mFeatureInfo;
+    std::unique_ptr<GoldfishAddressSpaceBlockProvider> mGoldfishAddressSpaceBlockProvider;
+
+    struct VirtGpuCaps mCaps;
+    std::vector<VkExtensionProperties> mHostInstanceExtensions;
+    std::vector<VkExtensionProperties> mHostDeviceExtensions;
+
+    // 32 bits only for now, upper bits may be used later.
+    std::atomic<uint32_t> mBlobId = 0;
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__)
+    int mSyncDeviceFd = -1;
+#endif
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+    fidl::WireSyncClient<fuchsia_hardware_goldfish::ControlDevice>
+        mControlDevice;
+    fidl::WireSyncClient<fuchsia_sysmem::Allocator>
+        mSysmemAllocator;
+#endif
+
+    WorkPool mWorkPool { 4 };
+    std::unordered_map<VkQueue, std::vector<WorkPool::WaitGroupHandle>>
+        mQueueSensitiveWorkPoolItems;
+
+    std::unordered_map<const VkEncoder*, std::unordered_map<void*, CleanupCallback>> mEncoderCleanupCallbacks;
+
+};
+
+ResourceTracker::ResourceTracker() : mImpl(new ResourceTracker::Impl()) { }
+ResourceTracker::~ResourceTracker() { }
+VulkanHandleMapping* ResourceTracker::createMapping() {
+    return &mImpl->createMapping;
+}
+VulkanHandleMapping* ResourceTracker::unwrapMapping() {
+    return &mImpl->unwrapMapping;
+}
+VulkanHandleMapping* ResourceTracker::destroyMapping() {
+    return &mImpl->destroyMapping;
+}
+VulkanHandleMapping* ResourceTracker::defaultMapping() {
+    return &mImpl->defaultMapping;
+}
+static ResourceTracker* sTracker = nullptr;
+// static
+ResourceTracker* ResourceTracker::get() {
+    if (!sTracker) {
+        // To be initialized once on vulkan device open.
+        sTracker = new ResourceTracker;
+    }
+    return sTracker;
+}
+
+#define HANDLE_REGISTER_IMPL(type) \
+    void ResourceTracker::register_##type(type obj) { \
+        mImpl->register_##type(obj); \
+    } \
+    void ResourceTracker::unregister_##type(type obj) { \
+        mImpl->unregister_##type(obj); \
+    } \
+
+GOLDFISH_VK_LIST_HANDLE_TYPES(HANDLE_REGISTER_IMPL)
+
+uint8_t* ResourceTracker::getMappedPointer(VkDeviceMemory memory) {
+    return mImpl->getMappedPointer(memory);
+}
+
+VkDeviceSize ResourceTracker::getMappedSize(VkDeviceMemory memory) {
+    return mImpl->getMappedSize(memory);
+}
+
+bool ResourceTracker::isValidMemoryRange(const VkMappedMemoryRange& range) const {
+    return mImpl->isValidMemoryRange(range);
+}
+
+void ResourceTracker::setupFeatures(const EmulatorFeatureInfo* features) {
+    mImpl->setupFeatures(features);
+}
+
+void ResourceTracker::setupCaps(void) { mImpl->setupCaps(); }
+
+void ResourceTracker::setThreadingCallbacks(const ResourceTracker::ThreadingCallbacks& callbacks) {
+    mImpl->setThreadingCallbacks(callbacks);
+}
+
+bool ResourceTracker::hostSupportsVulkan() const {
+    return mImpl->hostSupportsVulkan();
+}
+
+bool ResourceTracker::usingDirectMapping() const {
+    return mImpl->usingDirectMapping();
+}
+
+uint32_t ResourceTracker::getStreamFeatures() const {
+    return mImpl->getStreamFeatures();
+}
+
+uint32_t ResourceTracker::getApiVersionFromInstance(VkInstance instance) const {
+    return mImpl->getApiVersionFromInstance(instance);
+}
+
+uint32_t ResourceTracker::getApiVersionFromDevice(VkDevice device) const {
+    return mImpl->getApiVersionFromDevice(device);
+}
+bool ResourceTracker::hasInstanceExtension(VkInstance instance, const std::string &name) const {
+    return mImpl->hasInstanceExtension(instance, name);
+}
+bool ResourceTracker::hasDeviceExtension(VkDevice device, const std::string &name) const {
+    return mImpl->hasDeviceExtension(device, name);
+}
+VkDevice ResourceTracker::getDevice(VkCommandBuffer commandBuffer) const {
+    return mImpl->getDevice(commandBuffer);
+}
+void ResourceTracker::addToCommandPool(VkCommandPool commandPool,
+                      uint32_t commandBufferCount,
+                      VkCommandBuffer* pCommandBuffers) {
+    mImpl->addToCommandPool(commandPool, commandBufferCount, pCommandBuffers);
+}
+void ResourceTracker::resetCommandPoolStagingInfo(VkCommandPool commandPool) {
+    mImpl->resetCommandPoolStagingInfo(commandPool);
+}
+
+
+// static
+ALWAYS_INLINE VkEncoder* ResourceTracker::getCommandBufferEncoder(VkCommandBuffer commandBuffer) {
+    if (!(ResourceTracker::streamFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT)) {
+        auto enc = ResourceTracker::getThreadLocalEncoder();
+        ResourceTracker::get()->syncEncodersForCommandBuffer(commandBuffer, enc);
+        return enc;
+    }
+
+    struct goldfish_VkCommandBuffer* cb = as_goldfish_VkCommandBuffer(commandBuffer);
+    if (!cb->privateEncoder) {
+        sStaging.setAllocFree(ResourceTracker::get()->getAlloc(),
+                              ResourceTracker::get()->getFree());
+        sStaging.popStaging((CommandBufferStagingStream**)&cb->privateStream, &cb->privateEncoder);
+    }
+    uint8_t* writtenPtr; size_t written;
+    ((CommandBufferStagingStream*)cb->privateStream)->getWritten(&writtenPtr, &written);
+    return cb->privateEncoder;
+}
+
+// static
+ALWAYS_INLINE VkEncoder* ResourceTracker::getQueueEncoder(VkQueue queue) {
+    auto enc = ResourceTracker::getThreadLocalEncoder();
+    if (!(ResourceTracker::streamFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT)) {
+        ResourceTracker::get()->syncEncodersForQueue(queue, enc);
+    }
+    return enc;
+}
+
+// static
+ALWAYS_INLINE VkEncoder* ResourceTracker::getThreadLocalEncoder() {
+    auto hostConn = ResourceTracker::threadingCallbacks.hostConnectionGetFunc();
+    auto vkEncoder = ResourceTracker::threadingCallbacks.vkEncoderGetFunc(hostConn);
+    return vkEncoder;
+}
+
+// static
+void ResourceTracker::setSeqnoPtr(uint32_t* seqnoptr) {
+    sSeqnoPtr = seqnoptr;
+}
+
+// static
+ALWAYS_INLINE uint32_t ResourceTracker::nextSeqno() {
+    uint32_t res = __atomic_add_fetch(sSeqnoPtr, 1, __ATOMIC_SEQ_CST);
+    return res;
+}
+
+// static
+ALWAYS_INLINE uint32_t ResourceTracker::getSeqno() {
+    uint32_t res = __atomic_load_n(sSeqnoPtr, __ATOMIC_SEQ_CST);
+    return res;
+}
+
+VkResult ResourceTracker::on_vkEnumerateInstanceExtensionProperties(
+    void* context,
+    VkResult input_result,
+    const char* pLayerName,
+    uint32_t* pPropertyCount,
+    VkExtensionProperties* pProperties) {
+    return mImpl->on_vkEnumerateInstanceExtensionProperties(
+        context, input_result, pLayerName, pPropertyCount, pProperties);
+}
+
+VkResult ResourceTracker::on_vkEnumerateDeviceExtensionProperties(
+    void* context,
+    VkResult input_result,
+    VkPhysicalDevice physicalDevice,
+    const char* pLayerName,
+    uint32_t* pPropertyCount,
+    VkExtensionProperties* pProperties) {
+    return mImpl->on_vkEnumerateDeviceExtensionProperties(
+        context, input_result, physicalDevice, pLayerName, pPropertyCount, pProperties);
+}
+
+VkResult ResourceTracker::on_vkEnumeratePhysicalDevices(
+    void* context, VkResult input_result,
+    VkInstance instance, uint32_t* pPhysicalDeviceCount,
+    VkPhysicalDevice* pPhysicalDevices) {
+    return mImpl->on_vkEnumeratePhysicalDevices(
+        context, input_result, instance, pPhysicalDeviceCount,
+        pPhysicalDevices);
+}
+
+void ResourceTracker::on_vkGetPhysicalDeviceProperties(
+    void* context,
+    VkPhysicalDevice physicalDevice,
+    VkPhysicalDeviceProperties* pProperties) {
+    mImpl->on_vkGetPhysicalDeviceProperties(context, physicalDevice,
+        pProperties);
+}
+
+void ResourceTracker::on_vkGetPhysicalDeviceFeatures2(
+    void* context,
+    VkPhysicalDevice physicalDevice,
+    VkPhysicalDeviceFeatures2* pFeatures) {
+    mImpl->on_vkGetPhysicalDeviceFeatures2(context, physicalDevice,
+        pFeatures);
+}
+
+void ResourceTracker::on_vkGetPhysicalDeviceFeatures2KHR(
+    void* context,
+    VkPhysicalDevice physicalDevice,
+    VkPhysicalDeviceFeatures2* pFeatures) {
+    mImpl->on_vkGetPhysicalDeviceFeatures2(context, physicalDevice,
+        pFeatures);
+}
+
+void ResourceTracker::on_vkGetPhysicalDeviceProperties2(
+    void* context,
+    VkPhysicalDevice physicalDevice,
+    VkPhysicalDeviceProperties2* pProperties) {
+    mImpl->on_vkGetPhysicalDeviceProperties2(context, physicalDevice,
+        pProperties);
+}
+
+void ResourceTracker::on_vkGetPhysicalDeviceProperties2KHR(
+    void* context,
+    VkPhysicalDevice physicalDevice,
+    VkPhysicalDeviceProperties2* pProperties) {
+    mImpl->on_vkGetPhysicalDeviceProperties2(context, physicalDevice,
+        pProperties);
+}
+
+void ResourceTracker::on_vkGetPhysicalDeviceMemoryProperties(
+    void* context,
+    VkPhysicalDevice physicalDevice,
+    VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
+    mImpl->on_vkGetPhysicalDeviceMemoryProperties(
+        context, physicalDevice, pMemoryProperties);
+}
+
+void ResourceTracker::on_vkGetPhysicalDeviceMemoryProperties2(
+    void* context,
+    VkPhysicalDevice physicalDevice,
+    VkPhysicalDeviceMemoryProperties2* pMemoryProperties) {
+    mImpl->on_vkGetPhysicalDeviceMemoryProperties2(
+        context, physicalDevice, pMemoryProperties);
+}
+
+void ResourceTracker::on_vkGetPhysicalDeviceMemoryProperties2KHR(
+    void* context,
+    VkPhysicalDevice physicalDevice,
+    VkPhysicalDeviceMemoryProperties2* pMemoryProperties) {
+    mImpl->on_vkGetPhysicalDeviceMemoryProperties2(
+        context, physicalDevice, pMemoryProperties);
+}
+
+void ResourceTracker::on_vkGetDeviceQueue(void* context,
+                                          VkDevice device,
+                                          uint32_t queueFamilyIndex,
+                                          uint32_t queueIndex,
+                                          VkQueue* pQueue) {
+    mImpl->on_vkGetDeviceQueue(context, device, queueFamilyIndex, queueIndex,
+                               pQueue);
+}
+
+void ResourceTracker::on_vkGetDeviceQueue2(void* context,
+                                           VkDevice device,
+                                           const VkDeviceQueueInfo2* pQueueInfo,
+                                           VkQueue* pQueue) {
+    mImpl->on_vkGetDeviceQueue2(context, device, pQueueInfo, pQueue);
+}
+
+VkResult ResourceTracker::on_vkCreateInstance(
+    void* context,
+    VkResult input_result,
+    const VkInstanceCreateInfo* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator,
+    VkInstance* pInstance) {
+    return mImpl->on_vkCreateInstance(
+        context, input_result, pCreateInfo, pAllocator, pInstance);
+}
+
+VkResult ResourceTracker::on_vkCreateDevice(
+    void* context,
+    VkResult input_result,
+    VkPhysicalDevice physicalDevice,
+    const VkDeviceCreateInfo* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator,
+    VkDevice* pDevice) {
+    return mImpl->on_vkCreateDevice(
+        context, input_result, physicalDevice, pCreateInfo, pAllocator, pDevice);
+}
+
+void ResourceTracker::on_vkDestroyDevice_pre(
+    void* context,
+    VkDevice device,
+    const VkAllocationCallbacks* pAllocator) {
+    mImpl->on_vkDestroyDevice_pre(context, device, pAllocator);
+}
+
+VkResult ResourceTracker::on_vkAllocateMemory(
+    void* context,
+    VkResult input_result,
+    VkDevice device,
+    const VkMemoryAllocateInfo* pAllocateInfo,
+    const VkAllocationCallbacks* pAllocator,
+    VkDeviceMemory* pMemory) {
+    return mImpl->on_vkAllocateMemory(
+        context, input_result, device, pAllocateInfo, pAllocator, pMemory);
+}
+
+void ResourceTracker::on_vkFreeMemory(
+    void* context,
+    VkDevice device,
+    VkDeviceMemory memory,
+    const VkAllocationCallbacks* pAllocator) {
+    return mImpl->on_vkFreeMemory(
+        context, device, memory, pAllocator);
+}
+
+VkResult ResourceTracker::on_vkMapMemory(
+    void* context,
+    VkResult input_result,
+    VkDevice device,
+    VkDeviceMemory memory,
+    VkDeviceSize offset,
+    VkDeviceSize size,
+    VkMemoryMapFlags flags,
+    void** ppData) {
+    return mImpl->on_vkMapMemory(
+        context, input_result, device, memory, offset, size, flags, ppData);
+}
+
+void ResourceTracker::on_vkUnmapMemory(
+    void* context,
+    VkDevice device,
+    VkDeviceMemory memory) {
+    mImpl->on_vkUnmapMemory(context, device, memory);
+}
+
+VkResult ResourceTracker::on_vkCreateImage(
+    void* context, VkResult input_result,
+    VkDevice device, const VkImageCreateInfo *pCreateInfo,
+    const VkAllocationCallbacks *pAllocator,
+    VkImage *pImage) {
+    return mImpl->on_vkCreateImage(
+        context, input_result,
+        device, pCreateInfo, pAllocator, pImage);
+}
+
+void ResourceTracker::on_vkDestroyImage(
+    void* context,
+    VkDevice device, VkImage image, const VkAllocationCallbacks *pAllocator) {
+    mImpl->on_vkDestroyImage(context,
+        device, image, pAllocator);
+}
+
+void ResourceTracker::on_vkGetImageMemoryRequirements(
+    void *context, VkDevice device, VkImage image,
+    VkMemoryRequirements *pMemoryRequirements) {
+    mImpl->on_vkGetImageMemoryRequirements(
+        context, device, image, pMemoryRequirements);
+}
+
+void ResourceTracker::on_vkGetImageMemoryRequirements2(
+    void *context, VkDevice device, const VkImageMemoryRequirementsInfo2 *pInfo,
+    VkMemoryRequirements2 *pMemoryRequirements) {
+    mImpl->on_vkGetImageMemoryRequirements2(
+        context, device, pInfo, pMemoryRequirements);
+}
+
+void ResourceTracker::on_vkGetImageMemoryRequirements2KHR(
+    void *context, VkDevice device, const VkImageMemoryRequirementsInfo2 *pInfo,
+    VkMemoryRequirements2 *pMemoryRequirements) {
+    mImpl->on_vkGetImageMemoryRequirements2KHR(
+        context, device, pInfo, pMemoryRequirements);
+}
+
+VkResult ResourceTracker::on_vkBindImageMemory(
+    void* context, VkResult input_result,
+    VkDevice device, VkImage image, VkDeviceMemory memory,
+    VkDeviceSize memoryOffset) {
+    return mImpl->on_vkBindImageMemory(
+        context, input_result, device, image, memory, memoryOffset);
+}
+
+VkResult ResourceTracker::on_vkBindImageMemory2(
+    void* context, VkResult input_result,
+    VkDevice device, uint32_t bindingCount, const VkBindImageMemoryInfo* pBindInfos) {
+    return mImpl->on_vkBindImageMemory2(
+        context, input_result, device, bindingCount, pBindInfos);
+}
+
+VkResult ResourceTracker::on_vkBindImageMemory2KHR(
+    void* context, VkResult input_result,
+    VkDevice device, uint32_t bindingCount, const VkBindImageMemoryInfo* pBindInfos) {
+    return mImpl->on_vkBindImageMemory2KHR(
+        context, input_result, device, bindingCount, pBindInfos);
+}
+
+VkResult ResourceTracker::on_vkCreateBuffer(
+    void* context, VkResult input_result,
+    VkDevice device, const VkBufferCreateInfo *pCreateInfo,
+    const VkAllocationCallbacks *pAllocator,
+    VkBuffer *pBuffer) {
+    return mImpl->on_vkCreateBuffer(
+        context, input_result,
+        device, pCreateInfo, pAllocator, pBuffer);
+}
+
+void ResourceTracker::on_vkDestroyBuffer(
+    void* context,
+    VkDevice device, VkBuffer buffer, const VkAllocationCallbacks *pAllocator) {
+    mImpl->on_vkDestroyBuffer(context, device, buffer, pAllocator);
+}
+
+void ResourceTracker::on_vkGetBufferMemoryRequirements(
+    void* context, VkDevice device, VkBuffer buffer, VkMemoryRequirements *pMemoryRequirements) {
+    mImpl->on_vkGetBufferMemoryRequirements(context, device, buffer, pMemoryRequirements);
+}
+
+void ResourceTracker::on_vkGetBufferMemoryRequirements2(
+    void* context, VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo,
+    VkMemoryRequirements2* pMemoryRequirements) {
+    mImpl->on_vkGetBufferMemoryRequirements2(
+        context, device, pInfo, pMemoryRequirements);
+}
+
+void ResourceTracker::on_vkGetBufferMemoryRequirements2KHR(
+    void* context, VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo,
+    VkMemoryRequirements2* pMemoryRequirements) {
+    mImpl->on_vkGetBufferMemoryRequirements2KHR(
+        context, device, pInfo, pMemoryRequirements);
+}
+
+VkResult ResourceTracker::on_vkBindBufferMemory(
+    void* context, VkResult input_result,
+    VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset) {
+    return mImpl->on_vkBindBufferMemory(
+        context, input_result,
+        device, buffer, memory, memoryOffset);
+}
+
+VkResult ResourceTracker::on_vkBindBufferMemory2(
+    void* context, VkResult input_result,
+    VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo *pBindInfos) {
+    return mImpl->on_vkBindBufferMemory2(
+        context, input_result,
+        device, bindInfoCount, pBindInfos);
+}
+
+VkResult ResourceTracker::on_vkBindBufferMemory2KHR(
+    void* context, VkResult input_result,
+    VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo *pBindInfos) {
+    return mImpl->on_vkBindBufferMemory2KHR(
+        context, input_result,
+        device, bindInfoCount, pBindInfos);
+}
+
+VkResult ResourceTracker::on_vkCreateSemaphore(
+    void* context, VkResult input_result,
+    VkDevice device, const VkSemaphoreCreateInfo *pCreateInfo,
+    const VkAllocationCallbacks *pAllocator,
+    VkSemaphore *pSemaphore) {
+    return mImpl->on_vkCreateSemaphore(
+        context, input_result,
+        device, pCreateInfo, pAllocator, pSemaphore);
+}
+
+void ResourceTracker::on_vkDestroySemaphore(
+    void* context,
+    VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks *pAllocator) {
+    mImpl->on_vkDestroySemaphore(context, device, semaphore, pAllocator);
+}
+
+VkResult ResourceTracker::on_vkQueueSubmit(
+    void* context, VkResult input_result,
+    VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence) {
+    return mImpl->on_vkQueueSubmit(
+        context, input_result, queue, submitCount, pSubmits, fence);
+}
+
+VkResult ResourceTracker::on_vkQueueWaitIdle(
+    void* context, VkResult input_result,
+    VkQueue queue) {
+    return mImpl->on_vkQueueWaitIdle(context, input_result, queue);
+}
+
+VkResult ResourceTracker::on_vkGetSemaphoreFdKHR(
+    void* context, VkResult input_result,
+    VkDevice device,
+    const VkSemaphoreGetFdInfoKHR* pGetFdInfo,
+    int* pFd) {
+    return mImpl->on_vkGetSemaphoreFdKHR(context, input_result, device, pGetFdInfo, pFd);
+}
+
+VkResult ResourceTracker::on_vkImportSemaphoreFdKHR(
+    void* context, VkResult input_result,
+    VkDevice device,
+    const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo) {
+    return mImpl->on_vkImportSemaphoreFdKHR(context, input_result, device, pImportSemaphoreFdInfo);
+}
+
+void ResourceTracker::unwrap_VkNativeBufferANDROID(
+    const VkImageCreateInfo* pCreateInfo,
+    VkImageCreateInfo* local_pCreateInfo) {
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+    mImpl->unwrap_VkNativeBufferANDROID(pCreateInfo, local_pCreateInfo);
+#endif
+}
+
+void ResourceTracker::unwrap_vkAcquireImageANDROID_nativeFenceFd(int fd, int* fd_out) {
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+    mImpl->unwrap_vkAcquireImageANDROID_nativeFenceFd(fd, fd_out);
+#endif
+}
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+VkResult ResourceTracker::on_vkGetMemoryZirconHandleFUCHSIA(
+    void* context, VkResult input_result,
+    VkDevice device,
+    const VkMemoryGetZirconHandleInfoFUCHSIA* pInfo,
+    uint32_t* pHandle) {
+    return mImpl->on_vkGetMemoryZirconHandleFUCHSIA(
+        context, input_result, device, pInfo, pHandle);
+}
+
+VkResult ResourceTracker::on_vkGetMemoryZirconHandlePropertiesFUCHSIA(
+    void* context, VkResult input_result,
+    VkDevice device,
+    VkExternalMemoryHandleTypeFlagBits handleType,
+    uint32_t handle,
+    VkMemoryZirconHandlePropertiesFUCHSIA* pProperties) {
+    return mImpl->on_vkGetMemoryZirconHandlePropertiesFUCHSIA(
+        context, input_result, device, handleType, handle, pProperties);
+}
+
+VkResult ResourceTracker::on_vkGetSemaphoreZirconHandleFUCHSIA(
+    void* context, VkResult input_result,
+    VkDevice device,
+    const VkSemaphoreGetZirconHandleInfoFUCHSIA* pInfo,
+    uint32_t* pHandle) {
+    return mImpl->on_vkGetSemaphoreZirconHandleFUCHSIA(
+        context, input_result, device, pInfo, pHandle);
+}
+
+VkResult ResourceTracker::on_vkImportSemaphoreZirconHandleFUCHSIA(
+    void* context, VkResult input_result,
+    VkDevice device,
+    const VkImportSemaphoreZirconHandleInfoFUCHSIA* pInfo) {
+    return mImpl->on_vkImportSemaphoreZirconHandleFUCHSIA(
+        context, input_result, device, pInfo);
+}
+
+VkResult ResourceTracker::on_vkCreateBufferCollectionFUCHSIA(
+    void* context,
+    VkResult input_result,
+    VkDevice device,
+    const VkBufferCollectionCreateInfoFUCHSIA* pInfo,
+    const VkAllocationCallbacks* pAllocator,
+    VkBufferCollectionFUCHSIA* pCollection) {
+    return mImpl->on_vkCreateBufferCollectionFUCHSIA(
+        context, input_result, device, pInfo, pAllocator, pCollection);
+}
+
+void ResourceTracker::on_vkDestroyBufferCollectionFUCHSIA(
+    void* context,
+    VkResult input_result,
+    VkDevice device,
+    VkBufferCollectionFUCHSIA collection,
+    const VkAllocationCallbacks* pAllocator) {
+    return mImpl->on_vkDestroyBufferCollectionFUCHSIA(
+        context, input_result, device, collection, pAllocator);
+}
+
+VkResult ResourceTracker::on_vkSetBufferCollectionBufferConstraintsFUCHSIA(
+    void* context,
+    VkResult input_result,
+    VkDevice device,
+    VkBufferCollectionFUCHSIA collection,
+    const VkBufferConstraintsInfoFUCHSIA* pBufferDConstraintsInfo) {
+    return mImpl->on_vkSetBufferCollectionBufferConstraintsFUCHSIA(
+        context, input_result, device, collection, pBufferDConstraintsInfo);
+}
+
+VkResult ResourceTracker::on_vkSetBufferCollectionImageConstraintsFUCHSIA(
+    void* context,
+    VkResult input_result,
+    VkDevice device,
+    VkBufferCollectionFUCHSIA collection,
+    const VkImageConstraintsInfoFUCHSIA* pImageConstraintsInfo) {
+    return mImpl->on_vkSetBufferCollectionImageConstraintsFUCHSIA(
+        context, input_result, device, collection, pImageConstraintsInfo);
+}
+
+VkResult ResourceTracker::on_vkGetBufferCollectionPropertiesFUCHSIA(
+    void* context,
+    VkResult input_result,
+    VkDevice device,
+    VkBufferCollectionFUCHSIA collection,
+    VkBufferCollectionPropertiesFUCHSIA* pProperties) {
+    return mImpl->on_vkGetBufferCollectionPropertiesFUCHSIA(
+        context, input_result, device, collection, pProperties);
+}
+#endif
+
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+VkResult ResourceTracker::on_vkGetAndroidHardwareBufferPropertiesANDROID(
+    void* context, VkResult input_result,
+    VkDevice device,
+    const AHardwareBuffer* buffer,
+    VkAndroidHardwareBufferPropertiesANDROID* pProperties) {
+    return mImpl->on_vkGetAndroidHardwareBufferPropertiesANDROID(
+        context, input_result, device, buffer, pProperties);
+}
+VkResult ResourceTracker::on_vkGetMemoryAndroidHardwareBufferANDROID(
+    void* context, VkResult input_result,
+    VkDevice device,
+    const VkMemoryGetAndroidHardwareBufferInfoANDROID *pInfo,
+    struct AHardwareBuffer** pBuffer) {
+    return mImpl->on_vkGetMemoryAndroidHardwareBufferANDROID(
+        context, input_result,
+        device, pInfo, pBuffer);
+}
+#endif
+
+VkResult ResourceTracker::on_vkCreateSamplerYcbcrConversion(
+    void* context, VkResult input_result,
+    VkDevice device,
+    const VkSamplerYcbcrConversionCreateInfo* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator,
+    VkSamplerYcbcrConversion* pYcbcrConversion) {
+    return mImpl->on_vkCreateSamplerYcbcrConversion(
+        context, input_result, device, pCreateInfo, pAllocator, pYcbcrConversion);
+}
+
+void ResourceTracker::on_vkDestroySamplerYcbcrConversion(
+    void* context,
+    VkDevice device,
+    VkSamplerYcbcrConversion ycbcrConversion,
+    const VkAllocationCallbacks* pAllocator) {
+    mImpl->on_vkDestroySamplerYcbcrConversion(
+        context, device, ycbcrConversion, pAllocator);
+}
+
+VkResult ResourceTracker::on_vkCreateSamplerYcbcrConversionKHR(
+    void* context, VkResult input_result,
+    VkDevice device,
+    const VkSamplerYcbcrConversionCreateInfo* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator,
+    VkSamplerYcbcrConversion* pYcbcrConversion) {
+    return mImpl->on_vkCreateSamplerYcbcrConversionKHR(
+        context, input_result, device, pCreateInfo, pAllocator, pYcbcrConversion);
+}
+
+void ResourceTracker::on_vkDestroySamplerYcbcrConversionKHR(
+    void* context,
+    VkDevice device,
+    VkSamplerYcbcrConversion ycbcrConversion,
+    const VkAllocationCallbacks* pAllocator) {
+    mImpl->on_vkDestroySamplerYcbcrConversionKHR(
+        context, device, ycbcrConversion, pAllocator);
+}
+
+VkResult ResourceTracker::on_vkCreateSampler(
+    void* context, VkResult input_result,
+    VkDevice device,
+    const VkSamplerCreateInfo* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator,
+    VkSampler* pSampler) {
+    return mImpl->on_vkCreateSampler(
+        context, input_result, device, pCreateInfo, pAllocator, pSampler);
+}
+
+void ResourceTracker::on_vkGetPhysicalDeviceExternalFenceProperties(
+    void* context,
+    VkPhysicalDevice physicalDevice,
+    const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo,
+    VkExternalFenceProperties* pExternalFenceProperties) {
+    mImpl->on_vkGetPhysicalDeviceExternalFenceProperties(
+        context, physicalDevice, pExternalFenceInfo, pExternalFenceProperties);
+}
+
+void ResourceTracker::on_vkGetPhysicalDeviceExternalFencePropertiesKHR(
+    void* context,
+    VkPhysicalDevice physicalDevice,
+    const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo,
+    VkExternalFenceProperties* pExternalFenceProperties) {
+    mImpl->on_vkGetPhysicalDeviceExternalFenceProperties(
+        context, physicalDevice, pExternalFenceInfo, pExternalFenceProperties);
+}
+
+VkResult ResourceTracker::on_vkCreateFence(
+    void* context,
+    VkResult input_result,
+    VkDevice device,
+    const VkFenceCreateInfo* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkFence* pFence) {
+    return mImpl->on_vkCreateFence(
+        context, input_result, device, pCreateInfo, pAllocator, pFence);
+}
+
+void ResourceTracker::on_vkDestroyFence(
+    void* context,
+    VkDevice device,
+    VkFence fence,
+    const VkAllocationCallbacks* pAllocator) {
+    mImpl->on_vkDestroyFence(
+        context, device, fence, pAllocator);
+}
+
+VkResult ResourceTracker::on_vkResetFences(
+    void* context,
+    VkResult input_result,
+    VkDevice device,
+    uint32_t fenceCount,
+    const VkFence* pFences) {
+    return mImpl->on_vkResetFences(
+        context, input_result, device, fenceCount, pFences);
+}
+
+VkResult ResourceTracker::on_vkImportFenceFdKHR(
+    void* context,
+    VkResult input_result,
+    VkDevice device,
+    const VkImportFenceFdInfoKHR* pImportFenceFdInfo) {
+    return mImpl->on_vkImportFenceFdKHR(
+        context, input_result, device, pImportFenceFdInfo);
+}
+
+VkResult ResourceTracker::on_vkGetFenceFdKHR(
+    void* context,
+    VkResult input_result,
+    VkDevice device,
+    const VkFenceGetFdInfoKHR* pGetFdInfo,
+    int* pFd) {
+    return mImpl->on_vkGetFenceFdKHR(
+        context, input_result, device, pGetFdInfo, pFd);
+}
+
+VkResult ResourceTracker::on_vkWaitForFences(
+    void* context,
+    VkResult input_result,
+    VkDevice device,
+    uint32_t fenceCount,
+    const VkFence* pFences,
+    VkBool32 waitAll,
+    uint64_t timeout) {
+    return mImpl->on_vkWaitForFences(
+        context, input_result, device, fenceCount, pFences, waitAll, timeout);
+}
+
+VkResult ResourceTracker::on_vkCreateDescriptorPool(
+    void* context,
+    VkResult input_result,
+    VkDevice device,
+    const VkDescriptorPoolCreateInfo* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator,
+    VkDescriptorPool* pDescriptorPool) {
+    return mImpl->on_vkCreateDescriptorPool(
+        context, input_result, device, pCreateInfo, pAllocator, pDescriptorPool);
+}
+
+void ResourceTracker::on_vkDestroyDescriptorPool(
+    void* context,
+    VkDevice device,
+    VkDescriptorPool descriptorPool,
+    const VkAllocationCallbacks* pAllocator) {
+    mImpl->on_vkDestroyDescriptorPool(context, device, descriptorPool, pAllocator);
+}
+
+VkResult ResourceTracker::on_vkResetDescriptorPool(
+    void* context,
+    VkResult input_result,
+    VkDevice device,
+    VkDescriptorPool descriptorPool,
+    VkDescriptorPoolResetFlags flags) {
+    return mImpl->on_vkResetDescriptorPool(
+        context, input_result, device, descriptorPool, flags);
+}
+
+VkResult ResourceTracker::on_vkAllocateDescriptorSets(
+    void* context,
+    VkResult input_result,
+    VkDevice                                    device,
+    const VkDescriptorSetAllocateInfo*          pAllocateInfo,
+    VkDescriptorSet*                            pDescriptorSets) {
+    return mImpl->on_vkAllocateDescriptorSets(
+        context, input_result, device, pAllocateInfo, pDescriptorSets);
+}
+
+VkResult ResourceTracker::on_vkFreeDescriptorSets(
+    void* context,
+    VkResult input_result,
+    VkDevice                                    device,
+    VkDescriptorPool                            descriptorPool,
+    uint32_t                                    descriptorSetCount,
+    const VkDescriptorSet*                      pDescriptorSets) {
+    return mImpl->on_vkFreeDescriptorSets(
+        context, input_result, device, descriptorPool, descriptorSetCount, pDescriptorSets);
+}
+
+VkResult ResourceTracker::on_vkCreateDescriptorSetLayout(
+    void* context,
+    VkResult input_result,
+    VkDevice device,
+    const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator,
+    VkDescriptorSetLayout* pSetLayout) {
+    return mImpl->on_vkCreateDescriptorSetLayout(
+        context, input_result, device, pCreateInfo, pAllocator, pSetLayout);
+}
+
+void ResourceTracker::on_vkUpdateDescriptorSets(
+    void* context,
+    VkDevice device,
+    uint32_t descriptorWriteCount,
+    const VkWriteDescriptorSet* pDescriptorWrites,
+    uint32_t descriptorCopyCount,
+    const VkCopyDescriptorSet* pDescriptorCopies) {
+    return mImpl->on_vkUpdateDescriptorSets(
+        context, device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, pDescriptorCopies);
+}
+
+VkResult ResourceTracker::on_vkMapMemoryIntoAddressSpaceGOOGLE_pre(
+    void* context,
+    VkResult input_result,
+    VkDevice device,
+    VkDeviceMemory memory,
+    uint64_t* pAddress) {
+    return mImpl->on_vkMapMemoryIntoAddressSpaceGOOGLE_pre(
+        context, input_result, device, memory, pAddress);
+}
+
+VkResult ResourceTracker::on_vkMapMemoryIntoAddressSpaceGOOGLE(
+    void* context,
+    VkResult input_result,
+    VkDevice device,
+    VkDeviceMemory memory,
+    uint64_t* pAddress) {
+    return mImpl->on_vkMapMemoryIntoAddressSpaceGOOGLE(
+        context, input_result, device, memory, pAddress);
+}
+
+VkResult ResourceTracker::on_vkCreateDescriptorUpdateTemplate(
+    void* context, VkResult input_result,
+    VkDevice device,
+    const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator,
+    VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) {
+    return mImpl->on_vkCreateDescriptorUpdateTemplate(
+        context, input_result,
+        device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate);
+}
+
+VkResult ResourceTracker::on_vkCreateDescriptorUpdateTemplateKHR(
+    void* context, VkResult input_result,
+    VkDevice device,
+    const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator,
+    VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) {
+    return mImpl->on_vkCreateDescriptorUpdateTemplateKHR(
+        context, input_result,
+        device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate);
+}
+
+void ResourceTracker::on_vkUpdateDescriptorSetWithTemplate(
+    void* context,
+    VkDevice device,
+    VkDescriptorSet descriptorSet,
+    VkDescriptorUpdateTemplate descriptorUpdateTemplate,
+    const void* pData) {
+    mImpl->on_vkUpdateDescriptorSetWithTemplate(
+        context, device, descriptorSet,
+        descriptorUpdateTemplate, pData);
+}
+
+VkResult ResourceTracker::on_vkGetPhysicalDeviceImageFormatProperties2(
+    void* context, VkResult input_result,
+    VkPhysicalDevice physicalDevice,
+    const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
+    VkImageFormatProperties2* pImageFormatProperties) {
+    return mImpl->on_vkGetPhysicalDeviceImageFormatProperties2(
+        context, input_result, physicalDevice, pImageFormatInfo,
+        pImageFormatProperties);
+}
+
+VkResult ResourceTracker::on_vkGetPhysicalDeviceImageFormatProperties2KHR(
+    void* context, VkResult input_result,
+    VkPhysicalDevice physicalDevice,
+    const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
+    VkImageFormatProperties2* pImageFormatProperties) {
+    return mImpl->on_vkGetPhysicalDeviceImageFormatProperties2KHR(
+        context, input_result, physicalDevice, pImageFormatInfo,
+        pImageFormatProperties);
+}
+
+void ResourceTracker::on_vkGetPhysicalDeviceExternalSemaphoreProperties(
+    void* context,
+    VkPhysicalDevice physicalDevice,
+    const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo,
+    VkExternalSemaphoreProperties* pExternalSemaphoreProperties) {
+    mImpl->on_vkGetPhysicalDeviceExternalSemaphoreProperties(
+        context, physicalDevice, pExternalSemaphoreInfo,
+        pExternalSemaphoreProperties);
+}
+
+void ResourceTracker::on_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(
+    void* context,
+    VkPhysicalDevice physicalDevice,
+    const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo,
+    VkExternalSemaphoreProperties* pExternalSemaphoreProperties) {
+    mImpl->on_vkGetPhysicalDeviceExternalSemaphoreProperties(
+        context, physicalDevice, pExternalSemaphoreInfo,
+        pExternalSemaphoreProperties);
+}
+
+void ResourceTracker::registerEncoderCleanupCallback(const VkEncoder* encoder, void* handle, ResourceTracker::CleanupCallback callback) {
+    mImpl->registerEncoderCleanupCallback(encoder, handle, callback);
+}
+
+void ResourceTracker::unregisterEncoderCleanupCallback(const VkEncoder* encoder, void* handle) {
+    mImpl->unregisterEncoderCleanupCallback(encoder, handle);
+}
+
+void ResourceTracker::onEncoderDeleted(const VkEncoder* encoder) {
+    mImpl->onEncoderDeleted(encoder);
+}
+
+uint32_t ResourceTracker::syncEncodersForCommandBuffer(VkCommandBuffer commandBuffer, VkEncoder* current) {
+    return mImpl->syncEncodersForCommandBuffer(commandBuffer, current);
+}
+
+uint32_t ResourceTracker::syncEncodersForQueue(VkQueue queue, VkEncoder* current) {
+    return mImpl->syncEncodersForQueue(queue, current);
+}
+
+CommandBufferStagingStream::Alloc ResourceTracker::getAlloc() { return mImpl->getAlloc(); }
+
+CommandBufferStagingStream::Free ResourceTracker::getFree() { return mImpl->getFree(); }
+
+VkResult ResourceTracker::on_vkBeginCommandBuffer(
+    void* context, VkResult input_result,
+    VkCommandBuffer commandBuffer,
+    const VkCommandBufferBeginInfo* pBeginInfo) {
+    return mImpl->on_vkBeginCommandBuffer(
+        context, input_result, commandBuffer, pBeginInfo);
+}
+
+VkResult ResourceTracker::on_vkEndCommandBuffer(
+    void* context, VkResult input_result,
+    VkCommandBuffer commandBuffer) {
+    return mImpl->on_vkEndCommandBuffer(
+        context, input_result, commandBuffer);
+}
+
+VkResult ResourceTracker::on_vkResetCommandBuffer(
+    void* context, VkResult input_result,
+    VkCommandBuffer commandBuffer,
+    VkCommandBufferResetFlags flags) {
+    return mImpl->on_vkResetCommandBuffer(
+        context, input_result, commandBuffer, flags);
+}
+
+VkResult ResourceTracker::on_vkCreateImageView(
+    void* context, VkResult input_result,
+    VkDevice device,
+    const VkImageViewCreateInfo* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator,
+    VkImageView* pView) {
+    return mImpl->on_vkCreateImageView(
+        context, input_result, device, pCreateInfo, pAllocator, pView);
+}
+
+void ResourceTracker::on_vkCmdExecuteCommands(
+    void* context,
+    VkCommandBuffer commandBuffer,
+    uint32_t commandBufferCount,
+    const VkCommandBuffer* pCommandBuffers) {
+    mImpl->on_vkCmdExecuteCommands(
+        context, commandBuffer, commandBufferCount, pCommandBuffers);
+}
+
+void ResourceTracker::on_vkCmdBindDescriptorSets(
+    void* context,
+    VkCommandBuffer commandBuffer,
+    VkPipelineBindPoint pipelineBindPoint,
+    VkPipelineLayout layout,
+    uint32_t firstSet,
+    uint32_t descriptorSetCount,
+    const VkDescriptorSet* pDescriptorSets,
+    uint32_t dynamicOffsetCount,
+    const uint32_t* pDynamicOffsets) {
+    mImpl->on_vkCmdBindDescriptorSets(
+        context,
+        commandBuffer,
+        pipelineBindPoint,
+        layout,
+        firstSet,
+        descriptorSetCount,
+        pDescriptorSets,
+        dynamicOffsetCount,
+        pDynamicOffsets);
+}
+
+void ResourceTracker::on_vkCmdPipelineBarrier(
+    void* context,
+    VkCommandBuffer commandBuffer,
+    VkPipelineStageFlags srcStageMask,
+    VkPipelineStageFlags dstStageMask,
+    VkDependencyFlags dependencyFlags,
+    uint32_t memoryBarrierCount,
+    const VkMemoryBarrier* pMemoryBarriers,
+    uint32_t bufferMemoryBarrierCount,
+    const VkBufferMemoryBarrier* pBufferMemoryBarriers,
+    uint32_t imageMemoryBarrierCount,
+    const VkImageMemoryBarrier* pImageMemoryBarriers) {
+    mImpl->on_vkCmdPipelineBarrier(
+        context,
+        commandBuffer,
+        srcStageMask,
+        dstStageMask,
+        dependencyFlags,
+        memoryBarrierCount,
+        pMemoryBarriers,
+        bufferMemoryBarrierCount,
+        pBufferMemoryBarriers,
+        imageMemoryBarrierCount,
+        pImageMemoryBarriers);
+}
+
+void ResourceTracker::on_vkDestroyDescriptorSetLayout(
+    void* context,
+    VkDevice device,
+    VkDescriptorSetLayout descriptorSetLayout,
+    const VkAllocationCallbacks* pAllocator) {
+    mImpl->on_vkDestroyDescriptorSetLayout(context, device, descriptorSetLayout, pAllocator);
+}
+
+VkResult ResourceTracker::on_vkAllocateCommandBuffers(
+    void* context,
+    VkResult input_result,
+    VkDevice device,
+    const VkCommandBufferAllocateInfo* pAllocateInfo,
+    VkCommandBuffer* pCommandBuffers) {
+    return mImpl->on_vkAllocateCommandBuffers(context, input_result, device, pAllocateInfo, pCommandBuffers);
+}
+
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+VkResult ResourceTracker::on_vkQueueSignalReleaseImageANDROID(
+    void* context,
+    VkResult input_result,
+    VkQueue queue,
+    uint32_t waitSemaphoreCount,
+    const VkSemaphore* pWaitSemaphores,
+    VkImage image,
+    int* pNativeFenceFd) {
+    return mImpl->on_vkQueueSignalReleaseImageANDROID(context, input_result, queue, waitSemaphoreCount, pWaitSemaphores, image, pNativeFenceFd);
+}
+#endif
+
+VkResult ResourceTracker::on_vkCreateGraphicsPipelines(
+    void* context,
+    VkResult input_result,
+    VkDevice device,
+    VkPipelineCache pipelineCache,
+    uint32_t createInfoCount,
+    const VkGraphicsPipelineCreateInfo* pCreateInfos,
+    const VkAllocationCallbacks* pAllocator,
+    VkPipeline* pPipelines) {
+    return mImpl->on_vkCreateGraphicsPipelines(context, input_result, device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
+}
+
+void ResourceTracker::deviceMemoryTransform_tohost(
+    VkDeviceMemory* memory, uint32_t memoryCount,
+    VkDeviceSize* offset, uint32_t offsetCount,
+    VkDeviceSize* size, uint32_t sizeCount,
+    uint32_t* typeIndex, uint32_t typeIndexCount,
+    uint32_t* typeBits, uint32_t typeBitsCount) {
+    mImpl->deviceMemoryTransform_tohost(
+        memory, memoryCount,
+        offset, offsetCount,
+        size, sizeCount,
+        typeIndex, typeIndexCount,
+        typeBits, typeBitsCount);
+}
+
+void ResourceTracker::deviceMemoryTransform_fromhost(
+    VkDeviceMemory* memory, uint32_t memoryCount,
+    VkDeviceSize* offset, uint32_t offsetCount,
+    VkDeviceSize* size, uint32_t sizeCount,
+    uint32_t* typeIndex, uint32_t typeIndexCount,
+    uint32_t* typeBits, uint32_t typeBitsCount) {
+    mImpl->deviceMemoryTransform_fromhost(
+        memory, memoryCount,
+        offset, offsetCount,
+        size, sizeCount,
+        typeIndex, typeIndexCount,
+        typeBits, typeBitsCount);
+}
+
+void ResourceTracker::transformImpl_VkExternalMemoryProperties_fromhost(
+    VkExternalMemoryProperties* pProperties,
+    uint32_t lenAccess) {
+    mImpl->transformImpl_VkExternalMemoryProperties_fromhost(pProperties,
+                                                             lenAccess);
+}
+
+void ResourceTracker::transformImpl_VkExternalMemoryProperties_tohost(
+    VkExternalMemoryProperties*, uint32_t) {}
+
+void ResourceTracker::transformImpl_VkImageCreateInfo_fromhost(const VkImageCreateInfo*,
+                                                               uint32_t) {}
+void ResourceTracker::transformImpl_VkImageCreateInfo_tohost(const VkImageCreateInfo*,
+                                                             uint32_t) {}
+
+#define DEFINE_TRANSFORMED_TYPE_IMPL(type)                                  \
+    void ResourceTracker::transformImpl_##type##_tohost(type*, uint32_t) {} \
+    void ResourceTracker::transformImpl_##type##_fromhost(type*, uint32_t) {}
+
+LIST_TRIVIAL_TRANSFORMED_TYPES(DEFINE_TRANSFORMED_TYPE_IMPL)
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/ResourceTracker.h b/system/vulkan_enc/ResourceTracker.h
new file mode 100644
index 0000000..1c76aa6
--- /dev/null
+++ b/system/vulkan_enc/ResourceTracker.h
@@ -0,0 +1,687 @@
+// Copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2018 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#pragma once
+
+#include <vulkan/vulkan.h>
+
+#include <functional>
+#include <memory>
+
+#include "CommandBufferStagingStream.h"
+#include "VulkanHandleMapping.h"
+#include "VulkanHandles.h"
+#include "aemu/base/Tracing.h"
+#include "goldfish_vk_transform_guest.h"
+
+struct EmulatorFeatureInfo;
+
+class HostConnection;
+
+namespace gfxstream {
+namespace vk {
+
+class VkEncoder;
+
+class ResourceTracker {
+public:
+    ResourceTracker();
+    virtual ~ResourceTracker();
+    static ResourceTracker* get();
+
+    VulkanHandleMapping* createMapping();
+    VulkanHandleMapping* unwrapMapping();
+    VulkanHandleMapping* destroyMapping();
+    VulkanHandleMapping* defaultMapping();
+
+    using HostConnectionGetFunc = HostConnection* (*)();
+    using VkEncoderGetFunc = VkEncoder* (*)(HostConnection*);
+    using CleanupCallback = std::function<void()>;
+
+    struct ThreadingCallbacks {
+        HostConnectionGetFunc hostConnectionGetFunc = 0;
+        VkEncoderGetFunc vkEncoderGetFunc = 0;
+    };
+
+    static uint32_t streamFeatureBits;
+    static ThreadingCallbacks threadingCallbacks;
+
+#define HANDLE_REGISTER_DECL(type) \
+    void register_##type(type); \
+    void unregister_##type(type); \
+
+    GOLDFISH_VK_LIST_HANDLE_TYPES(HANDLE_REGISTER_DECL)
+
+    VkResult on_vkEnumerateInstanceExtensionProperties(
+        void* context,
+        VkResult input_result,
+        const char* pLayerName,
+        uint32_t* pPropertyCount,
+        VkExtensionProperties* pProperties);
+
+    VkResult on_vkEnumerateDeviceExtensionProperties(
+        void* context,
+        VkResult input_result,
+        VkPhysicalDevice physicalDevice,
+        const char* pLayerName,
+        uint32_t* pPropertyCount,
+        VkExtensionProperties* pProperties);
+
+    VkResult on_vkEnumeratePhysicalDevices(
+        void* context, VkResult input_result,
+        VkInstance instance, uint32_t* pPhysicalDeviceCount,
+        VkPhysicalDevice* pPhysicalDevices);
+
+    void on_vkGetPhysicalDeviceFeatures2(
+        void* context,
+        VkPhysicalDevice physicalDevice,
+        VkPhysicalDeviceFeatures2* pFeatures);
+    void on_vkGetPhysicalDeviceFeatures2KHR(
+        void* context,
+        VkPhysicalDevice physicalDevice,
+        VkPhysicalDeviceFeatures2* pFeatures);
+    void on_vkGetPhysicalDeviceProperties(
+        void* context,
+        VkPhysicalDevice physicalDevice,
+        VkPhysicalDeviceProperties* pProperties);
+    void on_vkGetPhysicalDeviceProperties2(
+        void* context,
+        VkPhysicalDevice physicalDevice,
+        VkPhysicalDeviceProperties2* pProperties);
+    void on_vkGetPhysicalDeviceProperties2KHR(
+        void* context,
+        VkPhysicalDevice physicalDevice,
+        VkPhysicalDeviceProperties2* pProperties);
+
+    void on_vkGetPhysicalDeviceMemoryProperties(
+        void* context,
+        VkPhysicalDevice physicalDevice,
+        VkPhysicalDeviceMemoryProperties* pMemoryProperties);
+    void on_vkGetPhysicalDeviceMemoryProperties2(
+        void* context,
+        VkPhysicalDevice physicalDevice,
+        VkPhysicalDeviceMemoryProperties2* pMemoryProperties);
+    void on_vkGetPhysicalDeviceMemoryProperties2KHR(
+        void* context,
+        VkPhysicalDevice physicalDevice,
+        VkPhysicalDeviceMemoryProperties2* pMemoryProperties);
+    void on_vkGetDeviceQueue(void* context,
+                             VkDevice device,
+                             uint32_t queueFamilyIndex,
+                             uint32_t queueIndex,
+                             VkQueue* pQueue);
+    void on_vkGetDeviceQueue2(void* context,
+                              VkDevice device,
+                              const VkDeviceQueueInfo2* pQueueInfo,
+                              VkQueue* pQueue);
+
+    VkResult on_vkCreateInstance(
+        void* context,
+        VkResult input_result,
+        const VkInstanceCreateInfo* createInfo,
+        const VkAllocationCallbacks* pAllocator,
+        VkInstance* pInstance);
+    VkResult on_vkCreateDevice(
+        void* context,
+        VkResult input_result,
+        VkPhysicalDevice physicalDevice,
+        const VkDeviceCreateInfo* pCreateInfo,
+        const VkAllocationCallbacks* pAllocator,
+        VkDevice* pDevice);
+    void on_vkDestroyDevice_pre(
+        void* context,
+        VkDevice device,
+        const VkAllocationCallbacks* pAllocator);
+
+    VkResult on_vkAllocateMemory(
+        void* context,
+        VkResult input_result,
+        VkDevice device,
+        const VkMemoryAllocateInfo* pAllocateInfo,
+        const VkAllocationCallbacks* pAllocator,
+        VkDeviceMemory* pMemory);
+    void on_vkFreeMemory(
+        void* context,
+        VkDevice device,
+        VkDeviceMemory memory,
+        const VkAllocationCallbacks* pAllocator);
+
+    VkResult on_vkMapMemory(
+        void* context,
+        VkResult input_result,
+        VkDevice device,
+        VkDeviceMemory memory,
+        VkDeviceSize offset,
+        VkDeviceSize size,
+        VkMemoryMapFlags,
+        void** ppData);
+
+    void on_vkUnmapMemory(
+        void* context,
+        VkDevice device,
+        VkDeviceMemory memory);
+
+    VkResult on_vkCreateImage(
+        void* context, VkResult input_result,
+        VkDevice device, const VkImageCreateInfo *pCreateInfo,
+        const VkAllocationCallbacks *pAllocator,
+        VkImage *pImage);
+    void on_vkDestroyImage(
+        void* context,
+        VkDevice device, VkImage image, const VkAllocationCallbacks *pAllocator);
+
+    void on_vkGetImageMemoryRequirements(
+        void *context, VkDevice device, VkImage image,
+        VkMemoryRequirements *pMemoryRequirements);
+    void on_vkGetImageMemoryRequirements2(
+        void *context, VkDevice device, const VkImageMemoryRequirementsInfo2 *pInfo,
+        VkMemoryRequirements2 *pMemoryRequirements);
+    void on_vkGetImageMemoryRequirements2KHR(
+        void *context, VkDevice device, const VkImageMemoryRequirementsInfo2 *pInfo,
+        VkMemoryRequirements2 *pMemoryRequirements);
+
+    VkResult on_vkBindImageMemory(
+        void* context, VkResult input_result,
+        VkDevice device, VkImage image, VkDeviceMemory memory,
+        VkDeviceSize memoryOffset);
+    VkResult on_vkBindImageMemory2(
+        void* context, VkResult input_result,
+        VkDevice device, uint32_t bindingCount, const VkBindImageMemoryInfo* pBindInfos);
+    VkResult on_vkBindImageMemory2KHR(
+        void* context, VkResult input_result,
+        VkDevice device, uint32_t bindingCount, const VkBindImageMemoryInfo* pBindInfos);
+
+    VkResult on_vkCreateBuffer(
+        void* context, VkResult input_result,
+        VkDevice device, const VkBufferCreateInfo *pCreateInfo,
+        const VkAllocationCallbacks *pAllocator,
+        VkBuffer *pBuffer);
+    void on_vkDestroyBuffer(
+        void* context,
+        VkDevice device, VkBuffer buffer, const VkAllocationCallbacks *pAllocator);
+
+    void on_vkGetBufferMemoryRequirements(
+        void* context, VkDevice device, VkBuffer buffer, VkMemoryRequirements *pMemoryRequirements);
+    void on_vkGetBufferMemoryRequirements2(
+        void* context, VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo,
+        VkMemoryRequirements2* pMemoryRequirements);
+    void on_vkGetBufferMemoryRequirements2KHR(
+        void* context, VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo,
+        VkMemoryRequirements2* pMemoryRequirements);
+
+    VkResult on_vkBindBufferMemory(
+        void* context, VkResult input_result,
+        VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset);
+    VkResult on_vkBindBufferMemory2(
+        void* context, VkResult input_result,
+        VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo *pBindInfos);
+    VkResult on_vkBindBufferMemory2KHR(
+        void* context, VkResult input_result,
+        VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo *pBindInfos);
+
+    VkResult on_vkCreateSemaphore(
+        void* context, VkResult,
+        VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo,
+        const VkAllocationCallbacks* pAllocator,
+        VkSemaphore* pSemaphore);
+    void on_vkDestroySemaphore(
+        void* context,
+        VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks *pAllocator);
+    VkResult on_vkGetSemaphoreFdKHR(
+        void* context, VkResult,
+        VkDevice device,
+        const VkSemaphoreGetFdInfoKHR* pGetFdInfo,
+        int* pFd);
+    VkResult on_vkImportSemaphoreFdKHR(
+        void* context, VkResult,
+        VkDevice device,
+        const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo);
+
+    VkResult on_vkQueueSubmit(
+        void* context, VkResult input_result,
+        VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence);
+
+    VkResult on_vkQueueWaitIdle(
+        void* context, VkResult input_result,
+        VkQueue queue);
+
+    void unwrap_VkNativeBufferANDROID(
+        const VkImageCreateInfo* pCreateInfo,
+        VkImageCreateInfo* local_pCreateInfo);
+    void unwrap_vkAcquireImageANDROID_nativeFenceFd(int fd, int* fd_out);
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+    VkResult on_vkGetMemoryZirconHandleFUCHSIA(
+        void* context, VkResult input_result,
+        VkDevice device,
+        const VkMemoryGetZirconHandleInfoFUCHSIA* pInfo,
+        uint32_t* pHandle);
+    VkResult on_vkGetMemoryZirconHandlePropertiesFUCHSIA(
+        void* context, VkResult input_result,
+        VkDevice device,
+        VkExternalMemoryHandleTypeFlagBits handleType,
+        uint32_t handle,
+        VkMemoryZirconHandlePropertiesFUCHSIA* pProperties);
+    VkResult on_vkGetSemaphoreZirconHandleFUCHSIA(
+        void* context, VkResult input_result,
+        VkDevice device,
+        const VkSemaphoreGetZirconHandleInfoFUCHSIA* pInfo,
+        uint32_t* pHandle);
+    VkResult on_vkImportSemaphoreZirconHandleFUCHSIA(
+        void* context, VkResult input_result,
+        VkDevice device,
+        const VkImportSemaphoreZirconHandleInfoFUCHSIA* pInfo);
+    VkResult on_vkCreateBufferCollectionFUCHSIA(
+        void* context,
+        VkResult input_result,
+        VkDevice device,
+        const VkBufferCollectionCreateInfoFUCHSIA* pInfo,
+        const VkAllocationCallbacks* pAllocator,
+        VkBufferCollectionFUCHSIA* pCollection);
+    void on_vkDestroyBufferCollectionFUCHSIA(
+        void* context,
+        VkResult input_result,
+        VkDevice device,
+        VkBufferCollectionFUCHSIA collection,
+        const VkAllocationCallbacks* pAllocator);
+    VkResult on_vkSetBufferCollectionBufferConstraintsFUCHSIA(
+        void* context,
+        VkResult input_result,
+        VkDevice device,
+        VkBufferCollectionFUCHSIA collection,
+        const VkBufferConstraintsInfoFUCHSIA* pBufferConstraintsInfo);
+    VkResult on_vkSetBufferCollectionImageConstraintsFUCHSIA(
+        void* context,
+        VkResult input_result,
+        VkDevice device,
+        VkBufferCollectionFUCHSIA collection,
+        const VkImageConstraintsInfoFUCHSIA* pImageConstraintsInfo);
+    VkResult on_vkGetBufferCollectionPropertiesFUCHSIA(
+        void* context,
+        VkResult input_result,
+        VkDevice device,
+        VkBufferCollectionFUCHSIA collection,
+        VkBufferCollectionPropertiesFUCHSIA* pProperties);
+#endif
+
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+    VkResult on_vkGetAndroidHardwareBufferPropertiesANDROID(
+        void* context, VkResult input_result,
+        VkDevice device,
+        const AHardwareBuffer* buffer,
+        VkAndroidHardwareBufferPropertiesANDROID* pProperties);
+    VkResult on_vkGetMemoryAndroidHardwareBufferANDROID(
+        void* context, VkResult input_result,
+        VkDevice device,
+        const VkMemoryGetAndroidHardwareBufferInfoANDROID *pInfo,
+        struct AHardwareBuffer** pBuffer);
+#endif
+
+    VkResult on_vkCreateSamplerYcbcrConversion(
+        void* context, VkResult input_result,
+        VkDevice device,
+        const VkSamplerYcbcrConversionCreateInfo* pCreateInfo,
+        const VkAllocationCallbacks* pAllocator,
+        VkSamplerYcbcrConversion* pYcbcrConversion);
+    void on_vkDestroySamplerYcbcrConversion(
+        void* context,
+        VkDevice device,
+        VkSamplerYcbcrConversion ycbcrConversion,
+        const VkAllocationCallbacks* pAllocator);
+    VkResult on_vkCreateSamplerYcbcrConversionKHR(
+        void* context, VkResult input_result,
+        VkDevice device,
+        const VkSamplerYcbcrConversionCreateInfo* pCreateInfo,
+        const VkAllocationCallbacks* pAllocator,
+        VkSamplerYcbcrConversion* pYcbcrConversion);
+    void on_vkDestroySamplerYcbcrConversionKHR(
+        void* context,
+        VkDevice device,
+        VkSamplerYcbcrConversion ycbcrConversion,
+        const VkAllocationCallbacks* pAllocator);
+
+    VkResult on_vkCreateSampler(
+        void* context, VkResult input_result,
+        VkDevice device,
+        const VkSamplerCreateInfo* pCreateInfo,
+        const VkAllocationCallbacks* pAllocator,
+        VkSampler* pSampler);
+
+    void on_vkGetPhysicalDeviceExternalFenceProperties(
+        void* context,
+        VkPhysicalDevice physicalDevice,
+        const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo,
+        VkExternalFenceProperties* pExternalFenceProperties);
+
+    void on_vkGetPhysicalDeviceExternalFencePropertiesKHR(
+        void* context,
+        VkPhysicalDevice physicalDevice,
+        const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo,
+        VkExternalFenceProperties* pExternalFenceProperties);
+
+    VkResult on_vkCreateFence(
+        void* context,
+        VkResult input_result,
+        VkDevice device,
+        const VkFenceCreateInfo* pCreateInfo,
+        const VkAllocationCallbacks* pAllocator, VkFence* pFence);
+
+    void on_vkDestroyFence(
+        void* context,
+        VkDevice device,
+        VkFence fence,
+        const VkAllocationCallbacks* pAllocator);
+
+    VkResult on_vkResetFences(
+        void* context,
+        VkResult input_result,
+        VkDevice device,
+        uint32_t fenceCount,
+        const VkFence* pFences);
+
+    VkResult on_vkImportFenceFdKHR(
+        void* context,
+        VkResult input_result,
+        VkDevice device,
+        const VkImportFenceFdInfoKHR* pImportFenceFdInfo);
+
+    VkResult on_vkGetFenceFdKHR(
+        void* context,
+        VkResult input_result,
+        VkDevice device,
+        const VkFenceGetFdInfoKHR* pGetFdInfo,
+        int* pFd);
+
+    VkResult on_vkWaitForFences(
+        void* context,
+        VkResult input_result,
+        VkDevice device,
+        uint32_t fenceCount,
+        const VkFence* pFences,
+        VkBool32 waitAll,
+        uint64_t timeout);
+
+    VkResult on_vkCreateDescriptorPool(
+        void* context,
+        VkResult input_result,
+        VkDevice device,
+        const VkDescriptorPoolCreateInfo* pCreateInfo,
+        const VkAllocationCallbacks* pAllocator,
+        VkDescriptorPool* pDescriptorPool);
+
+    void on_vkDestroyDescriptorPool(
+        void* context,
+        VkDevice device,
+        VkDescriptorPool descriptorPool,
+        const VkAllocationCallbacks* pAllocator);
+
+    VkResult on_vkResetDescriptorPool(
+        void* context,
+        VkResult input_result,
+        VkDevice device,
+        VkDescriptorPool descriptorPool,
+        VkDescriptorPoolResetFlags flags);
+
+    VkResult on_vkAllocateDescriptorSets(
+        void* context,
+        VkResult input_result,
+        VkDevice                                    device,
+        const VkDescriptorSetAllocateInfo*          pAllocateInfo,
+        VkDescriptorSet*                            pDescriptorSets);
+
+    VkResult on_vkFreeDescriptorSets(
+        void* context,
+        VkResult input_result,
+        VkDevice                                    device,
+        VkDescriptorPool                            descriptorPool,
+        uint32_t                                    descriptorSetCount,
+        const VkDescriptorSet*                      pDescriptorSets);
+
+    VkResult on_vkCreateDescriptorSetLayout(
+        void* context,
+        VkResult input_result,
+        VkDevice device,
+        const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
+        const VkAllocationCallbacks* pAllocator,
+        VkDescriptorSetLayout* pSetLayout);
+
+    void on_vkUpdateDescriptorSets(
+        void* context,
+        VkDevice device,
+        uint32_t descriptorWriteCount,
+        const VkWriteDescriptorSet* pDescriptorWrites,
+        uint32_t descriptorCopyCount,
+        const VkCopyDescriptorSet* pDescriptorCopies);
+
+    VkResult on_vkMapMemoryIntoAddressSpaceGOOGLE_pre(
+        void* context,
+        VkResult input_result,
+        VkDevice device,
+        VkDeviceMemory memory,
+        uint64_t* pAddress);
+    VkResult on_vkMapMemoryIntoAddressSpaceGOOGLE(
+        void* context,
+        VkResult input_result,
+        VkDevice device,
+        VkDeviceMemory memory,
+        uint64_t* pAddress);
+
+    VkResult on_vkCreateDescriptorUpdateTemplate(
+        void* context, VkResult input_result,
+        VkDevice device,
+        const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
+        const VkAllocationCallbacks* pAllocator,
+        VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate);
+
+    VkResult on_vkCreateDescriptorUpdateTemplateKHR(
+        void* context, VkResult input_result,
+        VkDevice device,
+        const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
+        const VkAllocationCallbacks* pAllocator,
+        VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate);
+
+    void on_vkUpdateDescriptorSetWithTemplate(
+        void* context,
+        VkDevice device,
+        VkDescriptorSet descriptorSet,
+        VkDescriptorUpdateTemplate descriptorUpdateTemplate,
+        const void* pData);
+
+    VkResult on_vkGetPhysicalDeviceImageFormatProperties2(
+        void* context, VkResult input_result,
+        VkPhysicalDevice physicalDevice,
+        const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
+        VkImageFormatProperties2* pImageFormatProperties);
+
+    VkResult on_vkGetPhysicalDeviceImageFormatProperties2KHR(
+        void* context, VkResult input_result,
+        VkPhysicalDevice physicalDevice,
+        const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
+        VkImageFormatProperties2* pImageFormatProperties);
+
+    void on_vkGetPhysicalDeviceExternalSemaphoreProperties(
+        void* context,
+        VkPhysicalDevice physicalDevice,
+        const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo,
+        VkExternalSemaphoreProperties* pExternalSemaphoreProperties);
+
+    void on_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(
+        void* context,
+        VkPhysicalDevice physicalDevice,
+        const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo,
+        VkExternalSemaphoreProperties* pExternalSemaphoreProperties);
+
+    void registerEncoderCleanupCallback(const VkEncoder* encoder, void* handle, CleanupCallback callback);
+    void unregisterEncoderCleanupCallback(const VkEncoder* encoder, void* handle);
+    void onEncoderDeleted(const VkEncoder* encoder);
+
+    uint32_t syncEncodersForCommandBuffer(VkCommandBuffer commandBuffer, VkEncoder* current);
+    uint32_t syncEncodersForQueue(VkQueue queue, VkEncoder* current);
+
+    CommandBufferStagingStream::Alloc getAlloc();
+    CommandBufferStagingStream::Free getFree();
+
+    VkResult on_vkBeginCommandBuffer(
+        void* context, VkResult input_result,
+        VkCommandBuffer commandBuffer,
+        const VkCommandBufferBeginInfo* pBeginInfo);
+    VkResult on_vkEndCommandBuffer(
+        void* context, VkResult input_result,
+        VkCommandBuffer commandBuffer);
+    VkResult on_vkResetCommandBuffer(
+        void* context, VkResult input_result,
+        VkCommandBuffer commandBuffer,
+        VkCommandBufferResetFlags flags);
+
+    VkResult on_vkCreateImageView(
+        void* context, VkResult input_result,
+        VkDevice device,
+        const VkImageViewCreateInfo* pCreateInfo,
+        const VkAllocationCallbacks* pAllocator,
+        VkImageView* pView);
+
+    void on_vkCmdExecuteCommands(
+        void* context,
+        VkCommandBuffer commandBuffer,
+        uint32_t commandBufferCount,
+        const VkCommandBuffer* pCommandBuffers);
+
+    void on_vkCmdBindDescriptorSets(
+        void* context,
+        VkCommandBuffer commandBuffer,
+        VkPipelineBindPoint pipelineBindPoint,
+        VkPipelineLayout layout,
+        uint32_t firstSet,
+        uint32_t descriptorSetCount,
+        const VkDescriptorSet* pDescriptorSets,
+        uint32_t dynamicOffsetCount,
+        const uint32_t* pDynamicOffsets);
+
+    void on_vkCmdPipelineBarrier(
+        void* context,
+        VkCommandBuffer commandBuffer,
+        VkPipelineStageFlags srcStageMask,
+        VkPipelineStageFlags dstStageMask,
+        VkDependencyFlags dependencyFlags,
+        uint32_t memoryBarrierCount,
+        const VkMemoryBarrier* pMemoryBarriers,
+        uint32_t bufferMemoryBarrierCount,
+        const VkBufferMemoryBarrier* pBufferMemoryBarriers,
+        uint32_t imageMemoryBarrierCount,
+        const VkImageMemoryBarrier* pImageMemoryBarriers);
+
+    void on_vkDestroyDescriptorSetLayout(
+        void* context,
+        VkDevice device,
+        VkDescriptorSetLayout descriptorSetLayout,
+        const VkAllocationCallbacks* pAllocator);
+
+    VkResult on_vkAllocateCommandBuffers(
+        void* context,
+        VkResult input_result,
+        VkDevice device,
+        const VkCommandBufferAllocateInfo* pAllocateInfo,
+        VkCommandBuffer* pCommandBuffers);
+
+    VkResult on_vkQueueSignalReleaseImageANDROID(
+        void* context,
+        VkResult input_result,
+        VkQueue queue,
+        uint32_t waitSemaphoreCount,
+        const VkSemaphore* pWaitSemaphores,
+        VkImage image,
+        int* pNativeFenceFd);
+
+    VkResult on_vkCreateGraphicsPipelines(
+        void* context,
+        VkResult input_result,
+        VkDevice device,
+        VkPipelineCache pipelineCache,
+        uint32_t createInfoCount,
+        const VkGraphicsPipelineCreateInfo* pCreateInfos,
+        const VkAllocationCallbacks* pAllocator,
+        VkPipeline* pPipelines);
+
+    uint8_t* getMappedPointer(VkDeviceMemory memory);
+    VkDeviceSize getMappedSize(VkDeviceMemory memory);
+    VkDeviceSize getNonCoherentExtendedSize(VkDevice device, VkDeviceSize basicSize) const;
+    bool isValidMemoryRange(const VkMappedMemoryRange& range) const;
+
+    void setupFeatures(const EmulatorFeatureInfo* features);
+    void setupCaps(void);
+
+    void setThreadingCallbacks(const ThreadingCallbacks& callbacks);
+    bool hostSupportsVulkan() const;
+    bool usingDirectMapping() const;
+    uint32_t getStreamFeatures() const;
+    uint32_t getApiVersionFromInstance(VkInstance instance) const;
+    uint32_t getApiVersionFromDevice(VkDevice device) const;
+    bool hasInstanceExtension(VkInstance instance, const std::string& name) const;
+    bool hasDeviceExtension(VkDevice instance, const std::string& name) const;
+    VkDevice getDevice(VkCommandBuffer commandBuffer) const;
+    void addToCommandPool(VkCommandPool commandPool,
+                          uint32_t commandBufferCount,
+                          VkCommandBuffer* pCommandBuffers);
+    void resetCommandPoolStagingInfo(VkCommandPool commandPool);
+
+#ifdef __GNUC__
+    #define ALWAYS_INLINE
+#elif
+    #define ALWAYS_INLINE __attribute__((always_inline))
+#endif
+
+    static VkEncoder* getCommandBufferEncoder(VkCommandBuffer commandBuffer);
+    static VkEncoder* getQueueEncoder(VkQueue queue);
+    static VkEncoder* getThreadLocalEncoder();
+
+    static void setSeqnoPtr(uint32_t* seqnoptr);
+    static ALWAYS_INLINE uint32_t nextSeqno();
+    static ALWAYS_INLINE uint32_t getSeqno();
+
+    // Transforms
+    void deviceMemoryTransform_tohost(
+        VkDeviceMemory* memory, uint32_t memoryCount,
+        VkDeviceSize* offset, uint32_t offsetCount,
+        VkDeviceSize* size, uint32_t sizeCount,
+        uint32_t* typeIndex, uint32_t typeIndexCount,
+        uint32_t* typeBits, uint32_t typeBitsCount);
+    void deviceMemoryTransform_fromhost(
+        VkDeviceMemory* memory, uint32_t memoryCount,
+        VkDeviceSize* offset, uint32_t offsetCount,
+        VkDeviceSize* size, uint32_t sizeCount,
+        uint32_t* typeIndex, uint32_t typeIndexCount,
+        uint32_t* typeBits, uint32_t typeBitsCount);
+
+    void transformImpl_VkExternalMemoryProperties_fromhost(
+        VkExternalMemoryProperties* pProperties,
+        uint32_t);
+    void transformImpl_VkExternalMemoryProperties_tohost(
+        VkExternalMemoryProperties* pProperties,
+        uint32_t);
+    void transformImpl_VkImageCreateInfo_fromhost(const VkImageCreateInfo*, uint32_t);
+    void transformImpl_VkImageCreateInfo_tohost(const VkImageCreateInfo*, uint32_t);
+
+#define DEFINE_TRANSFORMED_TYPE_PROTOTYPE(type)          \
+    void transformImpl_##type##_tohost(type*, uint32_t); \
+    void transformImpl_##type##_fromhost(type*, uint32_t);
+
+    LIST_TRIVIAL_TRANSFORMED_TYPES(DEFINE_TRANSFORMED_TYPE_PROTOTYPE)
+
+private:
+    class Impl;
+    std::unique_ptr<Impl> mImpl;
+};
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/Resources.cpp b/system/vulkan_enc/Resources.cpp
new file mode 100644
index 0000000..229c675
--- /dev/null
+++ b/system/vulkan_enc/Resources.cpp
@@ -0,0 +1,266 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include "Resources.h"
+
+#include <log/log.h>
+#include <stdlib.h>
+
+#define GOLDFISH_VK_OBJECT_DEBUG 0
+
+#if GOLDFISH_VK_OBJECT_DEBUG
+#define D(fmt,...) ALOGD("%s: " fmt, __func__, ##__VA_ARGS__);
+#else
+#ifndef D
+#define D(fmt,...)
+#endif
+#endif
+
+extern "C" {
+
+#define GOLDFISH_VK_NEW_DISPATCHABLE_FROM_HOST_IMPL(type) \
+    type new_from_host_##type(type underlying) { \
+        struct goldfish_##type* res = \
+            static_cast<goldfish_##type*>(malloc(sizeof(goldfish_##type))); \
+        if (!res) { \
+            ALOGE("FATAL: Failed to alloc " #type " handle"); \
+            abort(); \
+        } \
+        res->dispatch.magic = HWVULKAN_DISPATCH_MAGIC; \
+        res->underlying = (uint64_t)underlying; \
+        res->lastUsedEncoder = nullptr; \
+        res->sequenceNumber = 0; \
+        res->privateEncoder = 0; \
+        res->privateStream = 0; \
+        res->flags = 0; \
+        res->poolObjects = 0; \
+        res->subObjects = 0; \
+        res->superObjects = 0; \
+        res->userPtr = 0; \
+        return reinterpret_cast<type>(res); \
+    } \
+
+#define GOLDFISH_VK_NEW_TRIVIAL_NON_DISPATCHABLE_FROM_HOST_IMPL(type) \
+    type new_from_host_##type(type underlying) { \
+        struct goldfish_##type* res = \
+            static_cast<goldfish_##type*>(malloc(sizeof(goldfish_##type))); \
+        res->underlying = (uint64_t)underlying; \
+        res->poolObjects = 0; \
+        res->subObjects = 0; \
+        res->superObjects = 0; \
+        res->userPtr = 0; \
+        return reinterpret_cast<type>(res); \
+    } \
+
+#define GOLDFISH_VK_AS_GOLDFISH_IMPL(type) \
+    struct goldfish_##type* as_goldfish_##type(type toCast) { \
+        return reinterpret_cast<goldfish_##type*>(toCast); \
+    } \
+
+#define GOLDFISH_VK_GET_HOST_IMPL(type) \
+    type get_host_##type(type toUnwrap) { \
+        if (!toUnwrap) return VK_NULL_HANDLE; \
+        auto as_goldfish = as_goldfish_##type(toUnwrap); \
+        return (type)(as_goldfish->underlying); \
+    } \
+
+#define GOLDFISH_VK_DELETE_GOLDFISH_IMPL(type) \
+    void delete_goldfish_##type(type toDelete) { \
+        D("guest %p", toDelete); \
+        free(as_goldfish_##type(toDelete)); \
+    } \
+
+#define GOLDFISH_VK_IDENTITY_IMPL(type) \
+    type vk_handle_identity_##type(type handle) { \
+        return handle; \
+    } \
+
+#define GOLDFISH_VK_NEW_DISPATCHABLE_FROM_HOST_U64_IMPL(type) \
+    type new_from_host_u64_##type(uint64_t underlying) { \
+        struct goldfish_##type* res = \
+            static_cast<goldfish_##type*>(malloc(sizeof(goldfish_##type))); \
+        if (!res) { \
+            ALOGE("FATAL: Failed to alloc " #type " handle"); \
+            abort(); \
+        } \
+        res->dispatch.magic = HWVULKAN_DISPATCH_MAGIC; \
+        res->underlying = underlying; \
+        res->lastUsedEncoder = nullptr; \
+        res->sequenceNumber = 0; \
+        res->privateEncoder = 0; \
+        res->privateStream = 0; \
+        res->flags = 0; \
+        res->poolObjects = 0; \
+        res->subObjects = 0; \
+        res->superObjects = 0; \
+        res->userPtr = 0; \
+        return reinterpret_cast<type>(res); \
+    } \
+
+#define GOLDFISH_VK_NEW_TRIVIAL_NON_DISPATCHABLE_FROM_HOST_U64_IMPL(type) \
+    type new_from_host_u64_##type(uint64_t underlying) { \
+        struct goldfish_##type* res = \
+            static_cast<goldfish_##type*>(malloc(sizeof(goldfish_##type))); \
+        res->underlying = underlying; \
+        D("guest %p: host u64: 0x%llx", res, (unsigned long long)res->underlying); \
+        res->poolObjects = 0; \
+        res->subObjects = 0; \
+        res->superObjects = 0; \
+        res->userPtr = 0; \
+        return reinterpret_cast<type>(res); \
+    } \
+
+#define GOLDFISH_VK_GET_HOST_U64_IMPL(type) \
+    uint64_t get_host_u64_##type(type toUnwrap) { \
+        if (!toUnwrap) return 0; \
+        auto as_goldfish = as_goldfish_##type(toUnwrap); \
+        D("guest %p: host u64: 0x%llx", toUnwrap, (unsigned long long)as_goldfish->underlying); \
+        return as_goldfish->underlying; \
+    } \
+
+GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_NEW_DISPATCHABLE_FROM_HOST_IMPL)
+GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_AS_GOLDFISH_IMPL)
+GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_GET_HOST_IMPL)
+GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_DELETE_GOLDFISH_IMPL)
+GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_IDENTITY_IMPL)
+GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_NEW_DISPATCHABLE_FROM_HOST_U64_IMPL)
+GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_GET_HOST_U64_IMPL)
+
+GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_AS_GOLDFISH_IMPL)
+GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_GET_HOST_IMPL)
+GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_IDENTITY_IMPL)
+GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_GET_HOST_U64_IMPL)
+GOLDFISH_VK_LIST_AUTODEFINED_STRUCT_NON_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_NEW_TRIVIAL_NON_DISPATCHABLE_FROM_HOST_IMPL)
+GOLDFISH_VK_LIST_AUTODEFINED_STRUCT_NON_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_NEW_TRIVIAL_NON_DISPATCHABLE_FROM_HOST_U64_IMPL)
+GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_DELETE_GOLDFISH_IMPL)
+
+VkDescriptorPool new_from_host_VkDescriptorPool(VkDescriptorPool underlying) {
+    struct goldfish_VkDescriptorPool* res =
+        static_cast<goldfish_VkDescriptorPool*>(malloc(sizeof(goldfish_VkDescriptorPool)));
+    res->underlying = (uint64_t)underlying;
+    res->allocInfo = nullptr;
+    return reinterpret_cast<VkDescriptorPool>(res);
+}
+
+VkDescriptorPool new_from_host_u64_VkDescriptorPool(uint64_t underlying) {
+    return new_from_host_VkDescriptorPool((VkDescriptorPool)underlying);
+}
+
+VkDescriptorSet new_from_host_VkDescriptorSet(VkDescriptorSet underlying) {
+    struct goldfish_VkDescriptorSet* res =
+        static_cast<goldfish_VkDescriptorSet*>(malloc(sizeof(goldfish_VkDescriptorSet)));
+    res->underlying = (uint64_t)underlying;
+    res->reified = nullptr;
+    return reinterpret_cast<VkDescriptorSet>(res);
+}
+
+VkDescriptorSet new_from_host_u64_VkDescriptorSet(uint64_t underlying) {
+    return new_from_host_VkDescriptorSet((VkDescriptorSet)underlying);
+}
+
+VkDescriptorSetLayout new_from_host_VkDescriptorSetLayout(VkDescriptorSetLayout underlying) {
+    struct goldfish_VkDescriptorSetLayout* res =
+        static_cast<goldfish_VkDescriptorSetLayout*>(malloc(sizeof(goldfish_VkDescriptorSetLayout)));
+    res->underlying = (uint64_t)underlying;
+    res->layoutInfo = nullptr;
+    return reinterpret_cast<VkDescriptorSetLayout>(res);
+}
+
+VkDescriptorSetLayout new_from_host_u64_VkDescriptorSetLayout(uint64_t underlying) {
+    return new_from_host_VkDescriptorSetLayout((VkDescriptorSetLayout)underlying);
+}
+
+} // extern "C"
+
+namespace gfxstream {
+namespace vk {
+
+void appendObject(struct goldfish_vk_object_list** begin, void* val) {
+    D("for %p", val);
+    struct goldfish_vk_object_list* o = new goldfish_vk_object_list;
+    o->next = nullptr;
+    o->obj = val;
+    D("new ptr: %p", o);
+    if (!*begin) { D("first"); *begin = o; return; }
+
+    struct goldfish_vk_object_list* q = *begin;
+    struct goldfish_vk_object_list* p = q;
+
+    while (q) {
+        p = q;
+        q = q->next;
+    }
+
+    D("set next of %p to %p", p, o);
+    p->next = o;
+}
+
+void eraseObject(struct goldfish_vk_object_list** begin, void* val) {
+        D("for val %p", val);
+    if (!*begin) {
+        D("val %p notfound", val);
+        return;
+    }
+
+    struct goldfish_vk_object_list* q = *begin;
+    struct goldfish_vk_object_list* p = q;
+
+    while (q) {
+        struct goldfish_vk_object_list* n = q->next;
+        if (val == q->obj) {
+            D("val %p found, delete", val);
+            delete q;
+            if (*begin == q) {
+                D("val %p set begin to %p:", val, n);
+                *begin = n;
+            } else {
+                D("val %p set pnext to %p:", val, n);
+                p->next = n;
+            }
+            return;
+        }
+        p = q;
+        q = n;
+    }
+
+        D("val %p notfound after looping", val);
+}
+
+void eraseObjects(struct goldfish_vk_object_list** begin) {
+    struct goldfish_vk_object_list* q = *begin;
+    struct goldfish_vk_object_list* p = q;
+
+    while (q) {
+        p = q;
+        q = q->next;
+        delete p;
+    }
+
+    *begin = nullptr;
+}
+
+void forAllObjects(struct goldfish_vk_object_list* begin, std::function<void(void*)> func) {
+    struct goldfish_vk_object_list* q = begin;
+    struct goldfish_vk_object_list* p = q;
+
+    D("call");
+    while (q) {
+        D("iter");
+        p = q;
+        q = q->next;
+        func(p->obj);
+    }
+}
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/Resources.h b/system/vulkan_enc/Resources.h
new file mode 100644
index 0000000..6270f9a
--- /dev/null
+++ b/system/vulkan_enc/Resources.h
@@ -0,0 +1,148 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#pragma once
+
+#include <hardware/hwvulkan.h>
+#include <vulkan/vulkan.h>
+
+#include "VulkanHandles.h"
+
+#include <inttypes.h>
+
+#include <functional>
+
+namespace gfxstream {
+class IOStream;
+namespace vk {
+class VkEncoder;
+struct DescriptorPoolAllocationInfo;
+struct ReifiedDescriptorSet;
+struct DescriptorSetLayoutInfo;
+}  // namespace vk
+}  // namespace gfxstream
+
+
+extern "C" {
+
+struct goldfish_vk_object_list {
+    void* obj;
+    struct goldfish_vk_object_list* next;
+};
+
+#define GOLDFISH_VK_DEFINE_DISPATCHABLE_HANDLE_STRUCT(type) \
+    struct goldfish_##type { \
+        hwvulkan_dispatch_t dispatch; \
+        uint64_t underlying; \
+        gfxstream::vk::VkEncoder* lastUsedEncoder; \
+        uint32_t sequenceNumber; \
+        gfxstream::vk::VkEncoder* privateEncoder; \
+        gfxstream::IOStream* privateStream; \
+        uint32_t flags; \
+        struct goldfish_vk_object_list* poolObjects; \
+        struct goldfish_vk_object_list* subObjects; \
+        struct goldfish_vk_object_list* superObjects; \
+        void* userPtr; \
+    }; \
+
+#define GOLDFISH_VK_DEFINE_TRIVIAL_NON_DISPATCHABLE_HANDLE_STRUCT(type) \
+    struct goldfish_##type { \
+        uint64_t underlying; \
+        struct goldfish_vk_object_list* poolObjects; \
+        struct goldfish_vk_object_list* subObjects; \
+        struct goldfish_vk_object_list* superObjects; \
+        void* userPtr; \
+    }; \
+
+#define GOLDFISH_VK_NEW_FROM_HOST_DECL(type) \
+    type new_from_host_##type(type);
+
+#define GOLDFISH_VK_AS_GOLDFISH_DECL(type) \
+    struct goldfish_##type* as_goldfish_##type(type);
+
+#define GOLDFISH_VK_GET_HOST_DECL(type) \
+    type get_host_##type(type);
+
+#define GOLDFISH_VK_DELETE_GOLDFISH_DECL(type) \
+    void delete_goldfish_##type(type);
+
+#define GOLDFISH_VK_IDENTITY_DECL(type) \
+    type vk_handle_identity_##type(type);
+
+#define GOLDFISH_VK_NEW_FROM_HOST_U64_DECL(type) \
+    type new_from_host_u64_##type(uint64_t);
+
+#define GOLDFISH_VK_GET_HOST_U64_DECL(type) \
+    uint64_t get_host_u64_##type(type);
+
+GOLDFISH_VK_LIST_AUTODEFINED_STRUCT_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_DEFINE_DISPATCHABLE_HANDLE_STRUCT)
+GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_NEW_FROM_HOST_DECL)
+GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_AS_GOLDFISH_DECL)
+GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_GET_HOST_DECL)
+GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_DELETE_GOLDFISH_DECL)
+GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_IDENTITY_DECL)
+GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_NEW_FROM_HOST_U64_DECL)
+GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_GET_HOST_U64_DECL)
+
+GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_NEW_FROM_HOST_DECL)
+GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_AS_GOLDFISH_DECL)
+GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_GET_HOST_DECL)
+GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_DELETE_GOLDFISH_DECL)
+GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_IDENTITY_DECL)
+GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_NEW_FROM_HOST_U64_DECL)
+GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_GET_HOST_U64_DECL)
+GOLDFISH_VK_LIST_AUTODEFINED_STRUCT_NON_DISPATCHABLE_HANDLE_TYPES(GOLDFISH_VK_DEFINE_TRIVIAL_NON_DISPATCHABLE_HANDLE_STRUCT)
+
+struct goldfish_VkDescriptorPool {
+    uint64_t underlying;
+    gfxstream::vk::DescriptorPoolAllocationInfo* allocInfo;
+};
+
+struct goldfish_VkDescriptorSet {
+    uint64_t underlying;
+    gfxstream::vk::ReifiedDescriptorSet* reified;
+};
+
+struct goldfish_VkDescriptorSetLayout {
+    uint64_t underlying;
+    gfxstream::vk::DescriptorSetLayoutInfo* layoutInfo;
+};
+
+struct goldfish_VkCommandBuffer {
+    hwvulkan_dispatch_t dispatch;
+    uint64_t underlying;
+    gfxstream::vk::VkEncoder* lastUsedEncoder;
+    uint32_t sequenceNumber;
+    gfxstream::vk::VkEncoder* privateEncoder;
+    gfxstream::IOStream* privateStream;
+    uint32_t flags;
+    struct goldfish_vk_object_list* poolObjects;
+    struct goldfish_vk_object_list* subObjects;
+    struct goldfish_vk_object_list* superObjects;
+    void* userPtr;
+    bool isSecondary;
+    VkDevice device;
+};
+
+} // extern "C"
+
+namespace gfxstream {
+namespace vk {
+
+void appendObject(struct goldfish_vk_object_list** begin, void* val);
+void eraseObject(struct goldfish_vk_object_list** begin, void* val);
+void eraseObjects(struct goldfish_vk_object_list** begin);
+void forAllObjects(struct goldfish_vk_object_list* begin, std::function<void(void*)> func);
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/Validation.cpp b/system/vulkan_enc/Validation.cpp
new file mode 100644
index 0000000..3b75786
--- /dev/null
+++ b/system/vulkan_enc/Validation.cpp
@@ -0,0 +1,59 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include "Validation.h"
+
+#include "Resources.h"
+#include "ResourceTracker.h"
+
+namespace gfxstream {
+namespace vk {
+
+VkResult Validation::on_vkFlushMappedMemoryRanges(
+    void*,
+    VkResult,
+    VkDevice,
+    uint32_t memoryRangeCount,
+    const VkMappedMemoryRange* pMemoryRanges) {
+
+    auto resources = ResourceTracker::get();
+
+    for (uint32_t i = 0; i < memoryRangeCount; ++i) {
+        if (!resources->isValidMemoryRange(pMemoryRanges[i])) {
+            return VK_ERROR_OUT_OF_HOST_MEMORY;
+        }
+    }
+
+    return VK_SUCCESS;
+}
+
+VkResult Validation::on_vkInvalidateMappedMemoryRanges(
+    void*,
+    VkResult,
+    VkDevice,
+    uint32_t memoryRangeCount,
+    const VkMappedMemoryRange* pMemoryRanges) {
+
+    auto resources = ResourceTracker::get();
+
+    for (uint32_t i = 0; i < memoryRangeCount; ++i) {
+        if (!resources->isValidMemoryRange(pMemoryRanges[i])) {
+            return VK_ERROR_OUT_OF_HOST_MEMORY;
+        }
+    }
+
+    return VK_SUCCESS;
+}
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/Validation.h b/system/vulkan_enc/Validation.h
new file mode 100644
index 0000000..0dfd2d3
--- /dev/null
+++ b/system/vulkan_enc/Validation.h
@@ -0,0 +1,38 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#pragma once
+
+#include <vulkan/vulkan.h>
+
+namespace gfxstream {
+namespace vk {
+
+class Validation {
+public:
+    VkResult on_vkFlushMappedMemoryRanges(
+        void* context,
+        VkResult input_result,
+        VkDevice device,
+        uint32_t memoryRangeCount,
+        const VkMappedMemoryRange* pMemoryRanges);
+    VkResult on_vkInvalidateMappedMemoryRanges(
+        void* context,
+        VkResult input_result,
+        VkDevice device,
+        uint32_t memoryRangeCount,
+        const VkMappedMemoryRange* pMemoryRanges);
+};
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/VkEncoder.cpp b/system/vulkan_enc/VkEncoder.cpp
new file mode 100644
index 0000000..b530af5
--- /dev/null
+++ b/system/vulkan_enc/VkEncoder.cpp
@@ -0,0 +1,64216 @@
+// Copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2018 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Autogenerated module VkEncoder
+//
+// (impl) generated by codegen/vulkan/scripts/genvk.py -registry codegen/vulkan/xml/vk.xml cereal -o
+// host/vulkan/cereal
+//
+// Please do not modify directly;
+// re-run gfxstream-protocols/scripts/generate-vulkan-sources.sh,
+// or directly from Python by defining:
+// VULKAN_REGISTRY_XML_DIR : Directory containing vk.xml
+// VULKAN_REGISTRY_SCRIPTS_DIR : Directory containing genvk.py
+// CEREAL_OUTPUT_DIR: Where to put the generated sources.
+//
+// python3 $VULKAN_REGISTRY_SCRIPTS_DIR/genvk.py -registry $VULKAN_REGISTRY_XML_DIR/vk.xml cereal -o
+// $CEREAL_OUTPUT_DIR
+//
+
+#include "VkEncoder.h"
+
+#include <cutils/properties.h>
+
+#include <memory>
+#include <optional>
+#include <string>
+#include <unordered_map>
+#include <vector>
+
+#include "EncoderDebug.h"
+#include "IOStream.h"
+#include "ResourceTracker.h"
+#include "Resources.h"
+#include "Validation.h"
+#include "VulkanStreamGuest.h"
+#include "aemu/base/AlignedBuf.h"
+#include "aemu/base/BumpPool.h"
+#include "aemu/base/synchronization/AndroidLock.h"
+#include "goldfish_vk_counting_guest.h"
+#include "goldfish_vk_deepcopy_guest.h"
+#include "goldfish_vk_handlemap_guest.h"
+#include "goldfish_vk_marshaling_guest.h"
+#include "goldfish_vk_private_defs.h"
+#include "goldfish_vk_reserved_marshaling_guest.h"
+#include "goldfish_vk_transform_guest.h"
+
+namespace gfxstream {
+namespace vk {
+
+using namespace gfxstream::vk;
+
+using android::base::BumpPool;
+using android::base::guest::AutoLock;
+using android::base::guest::Lock;
+
+#include "VkEncoder.cpp.inl"
+
+#define VALIDATE_RET(retType, success, validate)   \
+    retType goldfish_vk_validateResult = validate; \
+    if (goldfish_vk_validateResult != success) return goldfish_vk_validateResult;
+
+#define VALIDATE_VOID(validate)                     \
+    VkResult goldfish_vk_validateResult = validate; \
+    if (goldfish_vk_validateResult != VK_SUCCESS) return;
+
+#ifdef VK_VERSION_1_0
+VkResult VkEncoder::vkCreateInstance(const VkInstanceCreateInfo* pCreateInfo,
+                                     const VkAllocationCallbacks* pAllocator, VkInstance* pInstance,
+                                     uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateInstance in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCreateInstance(pCreateInfo:%p, pAllocator:%p, pInstance:%p)", pCreateInfo,
+                      pAllocator, pInstance);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkInstanceCreateInfo* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkInstanceCreateInfo*)pool->alloc(sizeof(const VkInstanceCreateInfo));
+        deepcopy_VkInstanceCreateInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                      (VkInstanceCreateInfo*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkInstanceCreateInfo(sResourceTracker,
+                                              (VkInstanceCreateInfo*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        count_VkInstanceCreateInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                   (VkInstanceCreateInfo*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_0;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateInstance = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateInstance);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateInstance);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateInstance = OP_vkCreateInstance;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateInstance, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateInstance, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    reservedmarshal_VkInstanceCreateInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkInstanceCreateInfo*)(local_pCreateInfo), streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = (uint64_t)((*pInstance));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCreateInstance), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_2;
+    stream->read((uint64_t*)&cgen_var_2, 8);
+    stream->handleMapping()->mapHandles_u64_VkInstance(&cgen_var_2, (VkInstance*)pInstance, 1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateInstance_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateInstance_VkResult_return, sizeof(VkResult));
+    sResourceTracker->on_vkCreateInstance(this, vkCreateInstance_VkResult_return, pCreateInfo,
+                                          pAllocator, pInstance);
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateInstance_VkResult_return;
+}
+
+void VkEncoder::vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks* pAllocator,
+                                  uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyInstance in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroyInstance(instance:%p, pAllocator:%p)", instance, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkInstance local_instance;
+    VkAllocationCallbacks* local_pAllocator;
+    local_instance = instance;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyInstance =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDestroyInstance);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyInstance);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyInstance = OP_vkDestroyInstance;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyInstance, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyInstance, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkInstance((*&local_instance));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkDestroyInstance), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkInstance((VkInstance*)&instance);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkEnumeratePhysicalDevices(VkInstance instance, uint32_t* pPhysicalDeviceCount,
+                                               VkPhysicalDevice* pPhysicalDevices,
+                                               uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkEnumeratePhysicalDevices in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkEnumeratePhysicalDevices(instance:%p, pPhysicalDeviceCount:%p, pPhysicalDevices:%p)",
+        instance, pPhysicalDeviceCount, pPhysicalDevices);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkInstance local_instance;
+    local_instance = instance;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pPhysicalDeviceCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pPhysicalDevices) {
+            if ((*(pPhysicalDeviceCount))) {
+                *countPtr += (*(pPhysicalDeviceCount)) * 8;
+            }
+        }
+    }
+    uint32_t packetSize_vkEnumeratePhysicalDevices =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkEnumeratePhysicalDevices);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkEnumeratePhysicalDevices);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkEnumeratePhysicalDevices = OP_vkEnumeratePhysicalDevices;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkEnumeratePhysicalDevices, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkEnumeratePhysicalDevices, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkInstance((*&local_instance));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pPhysicalDeviceCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pPhysicalDeviceCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pPhysicalDeviceCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    /* is handle, possibly out */;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pPhysicalDevices;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pPhysicalDevices) {
+        if ((*(pPhysicalDeviceCount))) {
+            uint8_t* cgen_var_2_0_ptr = (uint8_t*)(*streamPtrPtr);
+            if (pPhysicalDeviceCount) {
+                for (uint32_t k = 0; k < (*(pPhysicalDeviceCount)); ++k) {
+                    uint64_t tmpval = (uint64_t)(pPhysicalDevices[k]);
+                    memcpy(cgen_var_2_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+                }
+            }
+            *streamPtrPtr += 8 * (*(pPhysicalDeviceCount));
+        }
+    }
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkEnumeratePhysicalDevices), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pPhysicalDeviceCount;
+    check_pPhysicalDeviceCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pPhysicalDeviceCount) {
+        if (!(check_pPhysicalDeviceCount)) {
+            fprintf(stderr, "fatal: pPhysicalDeviceCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pPhysicalDeviceCount, sizeof(uint32_t));
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    // WARNING PTR CHECK
+    VkPhysicalDevice* check_pPhysicalDevices;
+    check_pPhysicalDevices = (VkPhysicalDevice*)(uintptr_t)stream->getBe64();
+    if (pPhysicalDevices) {
+        if (!(check_pPhysicalDevices)) {
+            fprintf(stderr, "fatal: pPhysicalDevices inconsistent between guest and host\n");
+        }
+        if ((*(pPhysicalDeviceCount))) {
+            uint64_t* cgen_var_4_0;
+            stream->alloc((void**)&cgen_var_4_0, (*(pPhysicalDeviceCount)) * 8);
+            stream->read((uint64_t*)cgen_var_4_0, (*(pPhysicalDeviceCount)) * 8);
+            stream->handleMapping()->mapHandles_u64_VkPhysicalDevice(
+                cgen_var_4_0, (VkPhysicalDevice*)pPhysicalDevices, (*(pPhysicalDeviceCount)));
+        }
+    }
+    stream->unsetHandleMapping();
+    VkResult vkEnumeratePhysicalDevices_VkResult_return = (VkResult)0;
+    stream->read(&vkEnumeratePhysicalDevices_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkEnumeratePhysicalDevices_VkResult_return;
+}
+
+void VkEncoder::vkGetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice,
+                                            VkPhysicalDeviceFeatures* pFeatures, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceFeatures in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetPhysicalDeviceFeatures(physicalDevice:%p, pFeatures:%p)",
+                      physicalDevice, pFeatures);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    local_physicalDevice = physicalDevice;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPhysicalDeviceFeatures(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkPhysicalDeviceFeatures*)(pFeatures), countPtr);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceFeatures =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetPhysicalDeviceFeatures);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceFeatures);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceFeatures = OP_vkGetPhysicalDeviceFeatures;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceFeatures, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceFeatures, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPhysicalDeviceFeatures(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                             (VkPhysicalDeviceFeatures*)(pFeatures), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceFeatures), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkPhysicalDeviceFeatures(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkPhysicalDeviceFeatures*)(pFeatures));
+    if (pFeatures) {
+        transform_fromhost_VkPhysicalDeviceFeatures(sResourceTracker,
+                                                    (VkPhysicalDeviceFeatures*)(pFeatures));
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice,
+                                                    VkFormat format,
+                                                    VkFormatProperties* pFormatProperties,
+                                                    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceFormatProperties in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceFormatProperties(physicalDevice:%p, format:%d, pFormatProperties:%p)",
+        physicalDevice, format, pFormatProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkFormat local_format;
+    local_physicalDevice = physicalDevice;
+    local_format = format;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkFormat);
+        count_VkFormatProperties(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                 (VkFormatProperties*)(pFormatProperties), countPtr);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceFormatProperties =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceFormatProperties);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceFormatProperties);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceFormatProperties = OP_vkGetPhysicalDeviceFormatProperties;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceFormatProperties, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceFormatProperties, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkFormat*)&local_format, sizeof(VkFormat));
+    *streamPtrPtr += sizeof(VkFormat);
+    reservedmarshal_VkFormatProperties(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkFormatProperties*)(pFormatProperties), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetPhysicalDeviceFormatProperties),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkFormatProperties(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                 (VkFormatProperties*)(pFormatProperties));
+    if (pFormatProperties) {
+        transform_fromhost_VkFormatProperties(sResourceTracker,
+                                              (VkFormatProperties*)(pFormatProperties));
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkGetPhysicalDeviceImageFormatProperties(
+    VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling,
+    VkImageUsageFlags usage, VkImageCreateFlags flags,
+    VkImageFormatProperties* pImageFormatProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceImageFormatProperties in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceImageFormatProperties(physicalDevice:%p, format:%d, usage:%d, "
+        "flags:%d, pImageFormatProperties:%p)",
+        physicalDevice, format, usage, flags, pImageFormatProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkFormat local_format;
+    VkImageType local_type;
+    VkImageTiling local_tiling;
+    VkImageUsageFlags local_usage;
+    VkImageCreateFlags local_flags;
+    local_physicalDevice = physicalDevice;
+    local_format = format;
+    local_type = type;
+    local_tiling = tiling;
+    local_usage = usage;
+    local_flags = flags;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkFormat);
+        *countPtr += sizeof(VkImageType);
+        *countPtr += sizeof(VkImageTiling);
+        *countPtr += sizeof(VkImageUsageFlags);
+        *countPtr += sizeof(VkImageCreateFlags);
+        count_VkImageFormatProperties(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                      (VkImageFormatProperties*)(pImageFormatProperties), countPtr);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceImageFormatProperties =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceImageFormatProperties);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceImageFormatProperties);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties =
+        OP_vkGetPhysicalDeviceImageFormatProperties;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceImageFormatProperties, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceImageFormatProperties, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkFormat*)&local_format, sizeof(VkFormat));
+    *streamPtrPtr += sizeof(VkFormat);
+    memcpy(*streamPtrPtr, (VkImageType*)&local_type, sizeof(VkImageType));
+    *streamPtrPtr += sizeof(VkImageType);
+    memcpy(*streamPtrPtr, (VkImageTiling*)&local_tiling, sizeof(VkImageTiling));
+    *streamPtrPtr += sizeof(VkImageTiling);
+    memcpy(*streamPtrPtr, (VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags));
+    *streamPtrPtr += sizeof(VkImageUsageFlags);
+    memcpy(*streamPtrPtr, (VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags));
+    *streamPtrPtr += sizeof(VkImageCreateFlags);
+    reservedmarshal_VkImageFormatProperties(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                            (VkImageFormatProperties*)(pImageFormatProperties),
+                                            streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceImageFormatProperties),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkImageFormatProperties(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                      (VkImageFormatProperties*)(pImageFormatProperties));
+    if (pImageFormatProperties) {
+        transform_fromhost_VkImageFormatProperties(
+            sResourceTracker, (VkImageFormatProperties*)(pImageFormatProperties));
+    }
+    VkResult vkGetPhysicalDeviceImageFormatProperties_VkResult_return = (VkResult)0;
+    stream->read(&vkGetPhysicalDeviceImageFormatProperties_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDeviceImageFormatProperties_VkResult_return;
+}
+
+void VkEncoder::vkGetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice,
+                                              VkPhysicalDeviceProperties* pProperties,
+                                              uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceProperties in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetPhysicalDeviceProperties(physicalDevice:%p, pProperties:%p)",
+                      physicalDevice, pProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    local_physicalDevice = physicalDevice;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPhysicalDeviceProperties(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkPhysicalDeviceProperties*)(pProperties), countPtr);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceProperties =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceProperties);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceProperties);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceProperties = OP_vkGetPhysicalDeviceProperties;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceProperties, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceProperties, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPhysicalDeviceProperties(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                               (VkPhysicalDeviceProperties*)(pProperties),
+                                               streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceProperties), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkPhysicalDeviceProperties(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkPhysicalDeviceProperties*)(pProperties));
+    if (pProperties) {
+        transform_fromhost_VkPhysicalDeviceProperties(sResourceTracker,
+                                                      (VkPhysicalDeviceProperties*)(pProperties));
+    }
+    sResourceTracker->on_vkGetPhysicalDeviceProperties(this, physicalDevice, pProperties);
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetPhysicalDeviceQueueFamilyProperties(
+    VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount,
+    VkQueueFamilyProperties* pQueueFamilyProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceQueueFamilyProperties in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceQueueFamilyProperties(physicalDevice:%p, pQueueFamilyPropertyCount:%p, "
+        "pQueueFamilyProperties:%p)",
+        physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    local_physicalDevice = physicalDevice;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pQueueFamilyPropertyCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pQueueFamilyProperties) {
+            if (pQueueFamilyPropertyCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) {
+                    count_VkQueueFamilyProperties(
+                        sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                        (VkQueueFamilyProperties*)(pQueueFamilyProperties + i), countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceQueueFamilyProperties =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceQueueFamilyProperties);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceQueueFamilyProperties);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties =
+        OP_vkGetPhysicalDeviceQueueFamilyProperties;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceQueueFamilyProperties, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceQueueFamilyProperties, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pQueueFamilyPropertyCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pQueueFamilyProperties;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pQueueFamilyProperties) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) {
+            reservedmarshal_VkQueueFamilyProperties(
+                stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkQueueFamilyProperties*)(pQueueFamilyProperties + i), streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceQueueFamilyProperties),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pQueueFamilyPropertyCount;
+    check_pQueueFamilyPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pQueueFamilyPropertyCount) {
+        if (!(check_pQueueFamilyPropertyCount)) {
+            fprintf(stderr,
+                    "fatal: pQueueFamilyPropertyCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkQueueFamilyProperties* check_pQueueFamilyProperties;
+    check_pQueueFamilyProperties = (VkQueueFamilyProperties*)(uintptr_t)stream->getBe64();
+    if (pQueueFamilyProperties) {
+        if (!(check_pQueueFamilyProperties)) {
+            fprintf(stderr, "fatal: pQueueFamilyProperties inconsistent between guest and host\n");
+        }
+        if (pQueueFamilyPropertyCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) {
+                unmarshal_VkQueueFamilyProperties(
+                    stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                    (VkQueueFamilyProperties*)(pQueueFamilyProperties + i));
+            }
+        }
+    }
+    if (pQueueFamilyPropertyCount) {
+        if (pQueueFamilyProperties) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) {
+                transform_fromhost_VkQueueFamilyProperties(
+                    sResourceTracker, (VkQueueFamilyProperties*)(pQueueFamilyProperties + i));
+            }
+        }
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetPhysicalDeviceMemoryProperties(
+    VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceMemoryProperties in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceMemoryProperties(physicalDevice:%p, pMemoryProperties:%p)",
+        physicalDevice, pMemoryProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    local_physicalDevice = physicalDevice;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPhysicalDeviceMemoryProperties(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties), countPtr);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceMemoryProperties);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceMemoryProperties);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceMemoryProperties = OP_vkGetPhysicalDeviceMemoryProperties;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceMemoryProperties, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceMemoryProperties, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPhysicalDeviceMemoryProperties(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties),
+        streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetPhysicalDeviceMemoryProperties),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkPhysicalDeviceMemoryProperties(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties));
+    if (pMemoryProperties) {
+        transform_fromhost_VkPhysicalDeviceMemoryProperties(
+            sResourceTracker, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties));
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+PFN_vkVoidFunction VkEncoder::vkGetInstanceProcAddr(VkInstance instance, const char* pName,
+                                                    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetInstanceProcAddr in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetInstanceProcAddr(instance:%p, pName:%p)", instance, pName);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkInstance local_instance;
+    char* local_pName;
+    local_instance = instance;
+    // Avoiding deepcopy for pName
+    local_pName = (char*)pName;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t) + (local_pName ? strlen(local_pName) : 0);
+    }
+    uint32_t packetSize_vkGetInstanceProcAddr =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetInstanceProcAddr);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetInstanceProcAddr);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetInstanceProcAddr = OP_vkGetInstanceProcAddr;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetInstanceProcAddr, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetInstanceProcAddr, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkInstance((*&local_instance));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    {
+        uint32_t l = local_pName ? strlen(local_pName) : 0;
+        memcpy(*streamPtrPtr, (uint32_t*)&l, sizeof(uint32_t));
+        android::base::Stream::toBe32((uint8_t*)*streamPtrPtr);
+        *streamPtrPtr += sizeof(uint32_t);
+        memcpy(*streamPtrPtr, (char*)local_pName, l);
+        *streamPtrPtr += l;
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetInstanceProcAddr), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    PFN_vkVoidFunction vkGetInstanceProcAddr_PFN_vkVoidFunction_return = (PFN_vkVoidFunction)0;
+    stream->read(&vkGetInstanceProcAddr_PFN_vkVoidFunction_return, sizeof(PFN_vkVoidFunction));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetInstanceProcAddr_PFN_vkVoidFunction_return;
+}
+
+PFN_vkVoidFunction VkEncoder::vkGetDeviceProcAddr(VkDevice device, const char* pName,
+                                                  uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetDeviceProcAddr in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetDeviceProcAddr(device:%p, pName:%p)", device, pName);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    char* local_pName;
+    local_device = device;
+    // Avoiding deepcopy for pName
+    local_pName = (char*)pName;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t) + (local_pName ? strlen(local_pName) : 0);
+    }
+    uint32_t packetSize_vkGetDeviceProcAddr =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetDeviceProcAddr);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetDeviceProcAddr);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetDeviceProcAddr = OP_vkGetDeviceProcAddr;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetDeviceProcAddr, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetDeviceProcAddr, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    {
+        uint32_t l = local_pName ? strlen(local_pName) : 0;
+        memcpy(*streamPtrPtr, (uint32_t*)&l, sizeof(uint32_t));
+        android::base::Stream::toBe32((uint8_t*)*streamPtrPtr);
+        *streamPtrPtr += sizeof(uint32_t);
+        memcpy(*streamPtrPtr, (char*)local_pName, l);
+        *streamPtrPtr += l;
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetDeviceProcAddr), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    PFN_vkVoidFunction vkGetDeviceProcAddr_PFN_vkVoidFunction_return = (PFN_vkVoidFunction)0;
+    stream->read(&vkGetDeviceProcAddr_PFN_vkVoidFunction_return, sizeof(PFN_vkVoidFunction));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetDeviceProcAddr_PFN_vkVoidFunction_return;
+}
+
+VkResult VkEncoder::vkCreateDevice(VkPhysicalDevice physicalDevice,
+                                   const VkDeviceCreateInfo* pCreateInfo,
+                                   const VkAllocationCallbacks* pAllocator, VkDevice* pDevice,
+                                   uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateDevice in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateDevice(physicalDevice:%p, pCreateInfo:%p, pAllocator:%p, pDevice:%p)",
+        physicalDevice, pCreateInfo, pAllocator, pDevice);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkDeviceCreateInfo* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_physicalDevice = physicalDevice;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkDeviceCreateInfo*)pool->alloc(sizeof(const VkDeviceCreateInfo));
+        deepcopy_VkDeviceCreateInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                    (VkDeviceCreateInfo*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkDeviceCreateInfo(sResourceTracker,
+                                            (VkDeviceCreateInfo*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDeviceCreateInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                 (VkDeviceCreateInfo*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateDevice = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateDevice);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateDevice);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateDevice = OP_vkCreateDevice;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateDevice, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateDevice, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDeviceCreateInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkDeviceCreateInfo*)(local_pCreateInfo), streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCreateDevice), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkDevice(&cgen_var_3, (VkDevice*)pDevice, 1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateDevice_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateDevice_VkResult_return, sizeof(VkResult));
+    sResourceTracker->on_vkCreateDevice(this, vkCreateDevice_VkResult_return, physicalDevice,
+                                        pCreateInfo, pAllocator, pDevice);
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateDevice_VkResult_return;
+}
+
+void VkEncoder::vkDestroyDevice(VkDevice device, const VkAllocationCallbacks* pAllocator,
+                                uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyDevice in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroyDevice(device:%p, pAllocator:%p)", device, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    sResourceTracker->on_vkDestroyDevice_pre(this, device, pAllocator);
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyDevice = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDestroyDevice);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyDevice);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyDevice = OP_vkDestroyDevice;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyDevice, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyDevice, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkDestroyDevice), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkDevice((VkDevice*)&device);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkEnumerateInstanceExtensionProperties(const char* pLayerName,
+                                                           uint32_t* pPropertyCount,
+                                                           VkExtensionProperties* pProperties,
+                                                           uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkEnumerateInstanceExtensionProperties in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkEnumerateInstanceExtensionProperties(pLayerName:%p, pPropertyCount:%p, pProperties:%p)",
+        pLayerName, pPropertyCount, pProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    char* local_pLayerName;
+    // Avoiding deepcopy for pLayerName
+    local_pLayerName = (char*)pLayerName;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        if (sFeatureBits & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) {
+            // WARNING PTR CHECK
+            *countPtr += 8;
+            if (local_pLayerName) {
+                *countPtr += sizeof(uint32_t) + (local_pLayerName ? strlen(local_pLayerName) : 0);
+            }
+        } else {
+            *countPtr += sizeof(uint32_t) + (local_pLayerName ? strlen(local_pLayerName) : 0);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pPropertyCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pProperties) {
+            if (pPropertyCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                    count_VkExtensionProperties(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                (VkExtensionProperties*)(pProperties + i),
+                                                countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkEnumerateInstanceExtensionProperties =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkEnumerateInstanceExtensionProperties);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkEnumerateInstanceExtensionProperties);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkEnumerateInstanceExtensionProperties =
+        OP_vkEnumerateInstanceExtensionProperties;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkEnumerateInstanceExtensionProperties, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkEnumerateInstanceExtensionProperties, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    if (stream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) {
+        // WARNING PTR CHECK
+        uint64_t cgen_var_0 = (uint64_t)(uintptr_t)local_pLayerName;
+        memcpy((*streamPtrPtr), &cgen_var_0, 8);
+        android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+        *streamPtrPtr += 8;
+        if (local_pLayerName) {
+            {
+                uint32_t l = local_pLayerName ? strlen(local_pLayerName) : 0;
+                memcpy(*streamPtrPtr, (uint32_t*)&l, sizeof(uint32_t));
+                android::base::Stream::toBe32((uint8_t*)*streamPtrPtr);
+                *streamPtrPtr += sizeof(uint32_t);
+                memcpy(*streamPtrPtr, (char*)local_pLayerName, l);
+                *streamPtrPtr += l;
+            }
+        }
+    } else {
+        {
+            uint32_t l = local_pLayerName ? strlen(local_pLayerName) : 0;
+            memcpy(*streamPtrPtr, (uint32_t*)&l, sizeof(uint32_t));
+            android::base::Stream::toBe32((uint8_t*)*streamPtrPtr);
+            *streamPtrPtr += sizeof(uint32_t);
+            memcpy(*streamPtrPtr, (char*)local_pLayerName, l);
+            *streamPtrPtr += l;
+        }
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)pPropertyCount;
+    memcpy((*streamPtrPtr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pPropertyCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pPropertyCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pProperties;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pProperties) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+            reservedmarshal_VkExtensionProperties(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                  (VkExtensionProperties*)(pProperties + i),
+                                                  streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkEnumerateInstanceExtensionProperties),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pPropertyCount;
+    check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pPropertyCount) {
+        if (!(check_pPropertyCount)) {
+            fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkExtensionProperties* check_pProperties;
+    check_pProperties = (VkExtensionProperties*)(uintptr_t)stream->getBe64();
+    if (pProperties) {
+        if (!(check_pProperties)) {
+            fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
+        }
+        if (pPropertyCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                unmarshal_VkExtensionProperties(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                (VkExtensionProperties*)(pProperties + i));
+            }
+        }
+    }
+    if (pPropertyCount) {
+        if (pProperties) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                transform_fromhost_VkExtensionProperties(sResourceTracker,
+                                                         (VkExtensionProperties*)(pProperties + i));
+            }
+        }
+    }
+    VkResult vkEnumerateInstanceExtensionProperties_VkResult_return = (VkResult)0;
+    stream->read(&vkEnumerateInstanceExtensionProperties_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkEnumerateInstanceExtensionProperties_VkResult_return;
+}
+
+VkResult VkEncoder::vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice,
+                                                         const char* pLayerName,
+                                                         uint32_t* pPropertyCount,
+                                                         VkExtensionProperties* pProperties,
+                                                         uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkEnumerateDeviceExtensionProperties in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkEnumerateDeviceExtensionProperties(physicalDevice:%p, pLayerName:%p, pPropertyCount:%p, "
+        "pProperties:%p)",
+        physicalDevice, pLayerName, pPropertyCount, pProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    char* local_pLayerName;
+    local_physicalDevice = physicalDevice;
+    // Avoiding deepcopy for pLayerName
+    local_pLayerName = (char*)pLayerName;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        if (sFeatureBits & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) {
+            // WARNING PTR CHECK
+            *countPtr += 8;
+            if (local_pLayerName) {
+                *countPtr += sizeof(uint32_t) + (local_pLayerName ? strlen(local_pLayerName) : 0);
+            }
+        } else {
+            *countPtr += sizeof(uint32_t) + (local_pLayerName ? strlen(local_pLayerName) : 0);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pPropertyCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pProperties) {
+            if (pPropertyCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                    count_VkExtensionProperties(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                (VkExtensionProperties*)(pProperties + i),
+                                                countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkEnumerateDeviceExtensionProperties =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkEnumerateDeviceExtensionProperties);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkEnumerateDeviceExtensionProperties);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkEnumerateDeviceExtensionProperties = OP_vkEnumerateDeviceExtensionProperties;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkEnumerateDeviceExtensionProperties, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkEnumerateDeviceExtensionProperties, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    if (stream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) {
+        // WARNING PTR CHECK
+        uint64_t cgen_var_0_0 = (uint64_t)(uintptr_t)local_pLayerName;
+        memcpy((*streamPtrPtr), &cgen_var_0_0, 8);
+        android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+        *streamPtrPtr += 8;
+        if (local_pLayerName) {
+            {
+                uint32_t l = local_pLayerName ? strlen(local_pLayerName) : 0;
+                memcpy(*streamPtrPtr, (uint32_t*)&l, sizeof(uint32_t));
+                android::base::Stream::toBe32((uint8_t*)*streamPtrPtr);
+                *streamPtrPtr += sizeof(uint32_t);
+                memcpy(*streamPtrPtr, (char*)local_pLayerName, l);
+                *streamPtrPtr += l;
+            }
+        }
+    } else {
+        {
+            uint32_t l = local_pLayerName ? strlen(local_pLayerName) : 0;
+            memcpy(*streamPtrPtr, (uint32_t*)&l, sizeof(uint32_t));
+            android::base::Stream::toBe32((uint8_t*)*streamPtrPtr);
+            *streamPtrPtr += sizeof(uint32_t);
+            memcpy(*streamPtrPtr, (char*)local_pLayerName, l);
+            *streamPtrPtr += l;
+        }
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pPropertyCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pPropertyCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pPropertyCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pProperties;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pProperties) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+            reservedmarshal_VkExtensionProperties(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                  (VkExtensionProperties*)(pProperties + i),
+                                                  streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkEnumerateDeviceExtensionProperties),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pPropertyCount;
+    check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pPropertyCount) {
+        if (!(check_pPropertyCount)) {
+            fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkExtensionProperties* check_pProperties;
+    check_pProperties = (VkExtensionProperties*)(uintptr_t)stream->getBe64();
+    if (pProperties) {
+        if (!(check_pProperties)) {
+            fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
+        }
+        if (pPropertyCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                unmarshal_VkExtensionProperties(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                (VkExtensionProperties*)(pProperties + i));
+            }
+        }
+    }
+    if (pPropertyCount) {
+        if (pProperties) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                transform_fromhost_VkExtensionProperties(sResourceTracker,
+                                                         (VkExtensionProperties*)(pProperties + i));
+            }
+        }
+    }
+    VkResult vkEnumerateDeviceExtensionProperties_VkResult_return = (VkResult)0;
+    stream->read(&vkEnumerateDeviceExtensionProperties_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkEnumerateDeviceExtensionProperties_VkResult_return;
+}
+
+VkResult VkEncoder::vkEnumerateInstanceLayerProperties(uint32_t* pPropertyCount,
+                                                       VkLayerProperties* pProperties,
+                                                       uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkEnumerateInstanceLayerProperties in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkEnumerateInstanceLayerProperties(pPropertyCount:%p, pProperties:%p)",
+                      pPropertyCount, pProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pPropertyCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pProperties) {
+            if (pPropertyCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                    count_VkLayerProperties(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                            (VkLayerProperties*)(pProperties + i), countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkEnumerateInstanceLayerProperties =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkEnumerateInstanceLayerProperties);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkEnumerateInstanceLayerProperties);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkEnumerateInstanceLayerProperties = OP_vkEnumerateInstanceLayerProperties;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkEnumerateInstanceLayerProperties, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkEnumerateInstanceLayerProperties, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)pPropertyCount;
+    memcpy((*streamPtrPtr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pPropertyCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pPropertyCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pProperties;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pProperties) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+            reservedmarshal_VkLayerProperties(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkLayerProperties*)(pProperties + i), streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkEnumerateInstanceLayerProperties), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pPropertyCount;
+    check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pPropertyCount) {
+        if (!(check_pPropertyCount)) {
+            fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkLayerProperties* check_pProperties;
+    check_pProperties = (VkLayerProperties*)(uintptr_t)stream->getBe64();
+    if (pProperties) {
+        if (!(check_pProperties)) {
+            fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
+        }
+        if (pPropertyCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                unmarshal_VkLayerProperties(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                            (VkLayerProperties*)(pProperties + i));
+            }
+        }
+    }
+    if (pPropertyCount) {
+        if (pProperties) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                transform_fromhost_VkLayerProperties(sResourceTracker,
+                                                     (VkLayerProperties*)(pProperties + i));
+            }
+        }
+    }
+    VkResult vkEnumerateInstanceLayerProperties_VkResult_return = (VkResult)0;
+    stream->read(&vkEnumerateInstanceLayerProperties_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkEnumerateInstanceLayerProperties_VkResult_return;
+}
+
+VkResult VkEncoder::vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice,
+                                                     uint32_t* pPropertyCount,
+                                                     VkLayerProperties* pProperties,
+                                                     uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkEnumerateDeviceLayerProperties in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkEnumerateDeviceLayerProperties(physicalDevice:%p, pPropertyCount:%p, pProperties:%p)",
+        physicalDevice, pPropertyCount, pProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    local_physicalDevice = physicalDevice;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pPropertyCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pProperties) {
+            if (pPropertyCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                    count_VkLayerProperties(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                            (VkLayerProperties*)(pProperties + i), countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkEnumerateDeviceLayerProperties =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkEnumerateDeviceLayerProperties);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkEnumerateDeviceLayerProperties);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkEnumerateDeviceLayerProperties = OP_vkEnumerateDeviceLayerProperties;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkEnumerateDeviceLayerProperties, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkEnumerateDeviceLayerProperties, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pPropertyCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pPropertyCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pPropertyCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pProperties;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pProperties) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+            reservedmarshal_VkLayerProperties(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkLayerProperties*)(pProperties + i), streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkEnumerateDeviceLayerProperties), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pPropertyCount;
+    check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pPropertyCount) {
+        if (!(check_pPropertyCount)) {
+            fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkLayerProperties* check_pProperties;
+    check_pProperties = (VkLayerProperties*)(uintptr_t)stream->getBe64();
+    if (pProperties) {
+        if (!(check_pProperties)) {
+            fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
+        }
+        if (pPropertyCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                unmarshal_VkLayerProperties(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                            (VkLayerProperties*)(pProperties + i));
+            }
+        }
+    }
+    if (pPropertyCount) {
+        if (pProperties) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                transform_fromhost_VkLayerProperties(sResourceTracker,
+                                                     (VkLayerProperties*)(pProperties + i));
+            }
+        }
+    }
+    VkResult vkEnumerateDeviceLayerProperties_VkResult_return = (VkResult)0;
+    stream->read(&vkEnumerateDeviceLayerProperties_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkEnumerateDeviceLayerProperties_VkResult_return;
+}
+
+void VkEncoder::vkGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex,
+                                 VkQueue* pQueue, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetDeviceQueue in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetDeviceQueue(device:%p, queueFamilyIndex:%d, queueIndex:%d, pQueue:%p)",
+                      device, queueFamilyIndex, queueIndex, pQueue);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    uint32_t local_queueFamilyIndex;
+    uint32_t local_queueIndex;
+    local_device = device;
+    local_queueFamilyIndex = queueFamilyIndex;
+    local_queueIndex = queueIndex;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkGetDeviceQueue = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetDeviceQueue);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetDeviceQueue);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetDeviceQueue = OP_vkGetDeviceQueue;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetDeviceQueue, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetDeviceQueue, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_queueIndex, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    /* is handle, possibly out */;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = (uint64_t)((*pQueue));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetDeviceQueue), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_2;
+    stream->read((uint64_t*)&cgen_var_2, 8);
+    stream->handleMapping()->mapHandles_u64_VkQueue(&cgen_var_2, (VkQueue*)pQueue, 1);
+    stream->unsetHandleMapping();
+    sResourceTracker->on_vkGetDeviceQueue(this, device, queueFamilyIndex, queueIndex, pQueue);
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits,
+                                  VkFence fence, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkQueueSubmit in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkQueueSubmit(queue:%p, submitCount:%d, pSubmits:%p, fence:%p)", queue,
+                      submitCount, pSubmits, fence);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkQueue local_queue;
+    uint32_t local_submitCount;
+    VkSubmitInfo* local_pSubmits;
+    VkFence local_fence;
+    local_queue = queue;
+    local_submitCount = submitCount;
+    local_pSubmits = nullptr;
+    if (pSubmits) {
+        local_pSubmits = (VkSubmitInfo*)pool->alloc(((submitCount)) * sizeof(const VkSubmitInfo));
+        for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) {
+            deepcopy_VkSubmitInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pSubmits + i,
+                                  (VkSubmitInfo*)(local_pSubmits + i));
+        }
+    }
+    local_fence = fence;
+    if (local_pSubmits) {
+        for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) {
+            transform_tohost_VkSubmitInfo(sResourceTracker, (VkSubmitInfo*)(local_pSubmits + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) {
+            count_VkSubmitInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                               (VkSubmitInfo*)(local_pSubmits + i), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkQueueSubmit = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkQueueSubmit);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkQueueSubmit);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkQueueSubmit = OP_vkQueueSubmit;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkQueueSubmit, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkQueueSubmit, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkQueue((*&local_queue));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_submitCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) {
+        reservedmarshal_VkSubmitInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                     (VkSubmitInfo*)(local_pSubmits + i), streamPtrPtr);
+    }
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkFence((*&local_fence));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkQueueSubmit), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkQueueSubmit_VkResult_return = (VkResult)0;
+    stream->read(&vkQueueSubmit_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkQueueSubmit_VkResult_return;
+}
+
+VkResult VkEncoder::vkQueueWaitIdle(VkQueue queue, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkQueueWaitIdle in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkQueueWaitIdle(queue:%p)", queue);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkQueue local_queue;
+    local_queue = queue;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkQueueWaitIdle = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkQueueWaitIdle);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkQueueWaitIdle);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkQueueWaitIdle = OP_vkQueueWaitIdle;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkQueueWaitIdle, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkQueueWaitIdle, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkQueue((*&local_queue));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkQueueWaitIdle), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkQueueWaitIdle_VkResult_return = (VkResult)0;
+    stream->read(&vkQueueWaitIdle_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkQueueWaitIdle_VkResult_return;
+}
+
+VkResult VkEncoder::vkDeviceWaitIdle(VkDevice device, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDeviceWaitIdle in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDeviceWaitIdle(device:%p)", device);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    local_device = device;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkDeviceWaitIdle = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDeviceWaitIdle);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDeviceWaitIdle);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDeviceWaitIdle = OP_vkDeviceWaitIdle;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDeviceWaitIdle, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDeviceWaitIdle, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkDeviceWaitIdle), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkDeviceWaitIdle_VkResult_return = (VkResult)0;
+    stream->read(&vkDeviceWaitIdle_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkDeviceWaitIdle_VkResult_return;
+}
+
+VkResult VkEncoder::vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo,
+                                     const VkAllocationCallbacks* pAllocator,
+                                     VkDeviceMemory* pMemory, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkAllocateMemory in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkAllocateMemory(device:%p, pAllocateInfo:%p, pAllocator:%p, pMemory:%p)",
+                      device, pAllocateInfo, pAllocator, pMemory);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkMemoryAllocateInfo* local_pAllocateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pAllocateInfo = nullptr;
+    if (pAllocateInfo) {
+        local_pAllocateInfo =
+            (VkMemoryAllocateInfo*)pool->alloc(sizeof(const VkMemoryAllocateInfo));
+        deepcopy_VkMemoryAllocateInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocateInfo,
+                                      (VkMemoryAllocateInfo*)(local_pAllocateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocateInfo) {
+        transform_tohost_VkMemoryAllocateInfo(sResourceTracker,
+                                              (VkMemoryAllocateInfo*)(local_pAllocateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkMemoryAllocateInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                   (VkMemoryAllocateInfo*)(local_pAllocateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkAllocateMemory = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkAllocateMemory);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkAllocateMemory);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkAllocateMemory = OP_vkAllocateMemory;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkAllocateMemory, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkAllocateMemory, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkMemoryAllocateInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkMemoryAllocateInfo*)(local_pAllocateInfo),
+                                         streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pMemory));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkAllocateMemory), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkDeviceMemory(&cgen_var_3, (VkDeviceMemory*)pMemory,
+                                                           1);
+    stream->unsetHandleMapping();
+    VkResult vkAllocateMemory_VkResult_return = (VkResult)0;
+    stream->read(&vkAllocateMemory_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkAllocateMemory_VkResult_return;
+}
+
+void VkEncoder::vkFreeMemory(VkDevice device, VkDeviceMemory memory,
+                             const VkAllocationCallbacks* pAllocator, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkFreeMemory in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkFreeMemory(device:%p, memory:%p, pAllocator:%p)", device, memory,
+                      pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDeviceMemory local_memory;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_memory = memory;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    sResourceTracker->deviceMemoryTransform_tohost(
+        (VkDeviceMemory*)&local_memory, 1, (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr, 0,
+        (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0);
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkFreeMemory = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkFreeMemory);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkFreeMemory);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkFreeMemory = OP_vkFreeMemory;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkFreeMemory, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkFreeMemory, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDeviceMemory((*&local_memory));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkFreeMemory), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)&memory);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset,
+                                VkDeviceSize size, VkMemoryMapFlags flags, void** ppData,
+                                uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkMapMemory in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    (void)doLock;
+    VkResult vkMapMemory_VkResult_return = (VkResult)0;
+    vkMapMemory_VkResult_return = sResourceTracker->on_vkMapMemory(this, VK_SUCCESS, device, memory,
+                                                                   offset, size, flags, ppData);
+    return vkMapMemory_VkResult_return;
+}
+
+void VkEncoder::vkUnmapMemory(VkDevice device, VkDeviceMemory memory, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkUnmapMemory in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    (void)doLock;
+    sResourceTracker->on_vkUnmapMemory(this, device, memory);
+}
+
+VkResult VkEncoder::vkFlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount,
+                                              const VkMappedMemoryRange* pMemoryRanges,
+                                              uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkFlushMappedMemoryRanges in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    VALIDATE_RET(VkResult, VK_SUCCESS,
+                 mImpl->validation()->on_vkFlushMappedMemoryRanges(
+                     this, VK_SUCCESS, device, memoryRangeCount, pMemoryRanges));
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    uint32_t local_memoryRangeCount;
+    VkMappedMemoryRange* local_pMemoryRanges;
+    local_device = device;
+    local_memoryRangeCount = memoryRangeCount;
+    local_pMemoryRanges = nullptr;
+    if (pMemoryRanges) {
+        local_pMemoryRanges = (VkMappedMemoryRange*)pool->alloc(((memoryRangeCount)) *
+                                                                sizeof(const VkMappedMemoryRange));
+        for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) {
+            deepcopy_VkMappedMemoryRange(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pMemoryRanges + i,
+                                         (VkMappedMemoryRange*)(local_pMemoryRanges + i));
+        }
+    }
+    if (local_pMemoryRanges) {
+        for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) {
+            transform_tohost_VkMappedMemoryRange(sResourceTracker,
+                                                 (VkMappedMemoryRange*)(local_pMemoryRanges + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) {
+            count_VkMappedMemoryRange(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                      (VkMappedMemoryRange*)(local_pMemoryRanges + i), countPtr);
+        }
+    }
+    uint32_t packetSize_vkFlushMappedMemoryRanges =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkFlushMappedMemoryRanges);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkFlushMappedMemoryRanges);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkFlushMappedMemoryRanges = OP_vkFlushMappedMemoryRanges;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkFlushMappedMemoryRanges, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkFlushMappedMemoryRanges, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_memoryRangeCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) {
+        reservedmarshal_VkMappedMemoryRange(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                            (VkMappedMemoryRange*)(local_pMemoryRanges + i),
+                                            streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkFlushMappedMemoryRanges), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    if (!sResourceTracker->usingDirectMapping()) {
+        for (uint32_t i = 0; i < memoryRangeCount; ++i) {
+            auto range = pMemoryRanges[i];
+            auto memory = pMemoryRanges[i].memory;
+            auto size = pMemoryRanges[i].size;
+            auto offset = pMemoryRanges[i].offset;
+            uint64_t streamSize = 0;
+            if (!memory) {
+                stream->write(&streamSize, sizeof(uint64_t));
+                continue;
+            };
+            auto hostPtr = sResourceTracker->getMappedPointer(memory);
+            auto actualSize =
+                size == VK_WHOLE_SIZE ? sResourceTracker->getMappedSize(memory) : size;
+            if (!hostPtr) {
+                stream->write(&streamSize, sizeof(uint64_t));
+                continue;
+            };
+            streamSize = actualSize;
+            stream->write(&streamSize, sizeof(uint64_t));
+            uint8_t* targetRange = hostPtr + offset;
+            stream->write(targetRange, actualSize);
+        }
+    }
+    VkResult vkFlushMappedMemoryRanges_VkResult_return = (VkResult)0;
+    stream->read(&vkFlushMappedMemoryRanges_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkFlushMappedMemoryRanges_VkResult_return;
+}
+
+VkResult VkEncoder::vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount,
+                                                   const VkMappedMemoryRange* pMemoryRanges,
+                                                   uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkInvalidateMappedMemoryRanges in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    VALIDATE_RET(VkResult, VK_SUCCESS,
+                 mImpl->validation()->on_vkInvalidateMappedMemoryRanges(
+                     this, VK_SUCCESS, device, memoryRangeCount, pMemoryRanges));
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    uint32_t local_memoryRangeCount;
+    VkMappedMemoryRange* local_pMemoryRanges;
+    local_device = device;
+    local_memoryRangeCount = memoryRangeCount;
+    local_pMemoryRanges = nullptr;
+    if (pMemoryRanges) {
+        local_pMemoryRanges = (VkMappedMemoryRange*)pool->alloc(((memoryRangeCount)) *
+                                                                sizeof(const VkMappedMemoryRange));
+        for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) {
+            deepcopy_VkMappedMemoryRange(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pMemoryRanges + i,
+                                         (VkMappedMemoryRange*)(local_pMemoryRanges + i));
+        }
+    }
+    if (local_pMemoryRanges) {
+        for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) {
+            transform_tohost_VkMappedMemoryRange(sResourceTracker,
+                                                 (VkMappedMemoryRange*)(local_pMemoryRanges + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) {
+            count_VkMappedMemoryRange(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                      (VkMappedMemoryRange*)(local_pMemoryRanges + i), countPtr);
+        }
+    }
+    uint32_t packetSize_vkInvalidateMappedMemoryRanges =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkInvalidateMappedMemoryRanges);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkInvalidateMappedMemoryRanges);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkInvalidateMappedMemoryRanges = OP_vkInvalidateMappedMemoryRanges;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkInvalidateMappedMemoryRanges, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkInvalidateMappedMemoryRanges, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_memoryRangeCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) {
+        reservedmarshal_VkMappedMemoryRange(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                            (VkMappedMemoryRange*)(local_pMemoryRanges + i),
+                                            streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkInvalidateMappedMemoryRanges), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkInvalidateMappedMemoryRanges_VkResult_return = (VkResult)0;
+    stream->read(&vkInvalidateMappedMemoryRanges_VkResult_return, sizeof(VkResult));
+    if (!sResourceTracker->usingDirectMapping()) {
+        for (uint32_t i = 0; i < memoryRangeCount; ++i) {
+            auto range = pMemoryRanges[i];
+            auto memory = pMemoryRanges[i].memory;
+            auto size = pMemoryRanges[i].size;
+            auto offset = pMemoryRanges[i].offset;
+            uint64_t streamSize = 0;
+            if (!memory) {
+                stream->read(&streamSize, sizeof(uint64_t));
+                continue;
+            };
+            auto hostPtr = sResourceTracker->getMappedPointer(memory);
+            auto actualSize =
+                size == VK_WHOLE_SIZE ? sResourceTracker->getMappedSize(memory) : size;
+            if (!hostPtr) {
+                stream->read(&streamSize, sizeof(uint64_t));
+                continue;
+            };
+            streamSize = actualSize;
+            stream->read(&streamSize, sizeof(uint64_t));
+            uint8_t* targetRange = hostPtr + offset;
+            stream->read(targetRange, actualSize);
+        }
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkInvalidateMappedMemoryRanges_VkResult_return;
+}
+
+void VkEncoder::vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory,
+                                            VkDeviceSize* pCommittedMemoryInBytes,
+                                            uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetDeviceMemoryCommitment in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetDeviceMemoryCommitment(device:%p, memory:%p, pCommittedMemoryInBytes:%p)", device,
+        memory, pCommittedMemoryInBytes);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDeviceMemory local_memory;
+    local_device = device;
+    local_memory = memory;
+    sResourceTracker->deviceMemoryTransform_tohost(
+        (VkDeviceMemory*)&local_memory, 1, (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr, 0,
+        (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0);
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+    }
+    uint32_t packetSize_vkGetDeviceMemoryCommitment =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetDeviceMemoryCommitment);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetDeviceMemoryCommitment);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetDeviceMemoryCommitment = OP_vkGetDeviceMemoryCommitment;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetDeviceMemoryCommitment, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetDeviceMemoryCommitment, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDeviceMemory((*&local_memory));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)pCommittedMemoryInBytes, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetDeviceMemoryCommitment), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((VkDeviceSize*)pCommittedMemoryInBytes, sizeof(VkDeviceSize));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory memory,
+                                       VkDeviceSize memoryOffset, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkBindBufferMemory in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkBindBufferMemory(device:%p, buffer:%p, memory:%p, memoryOffset:%ld)",
+                      device, buffer, memory, memoryOffset);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkBuffer local_buffer;
+    VkDeviceMemory local_memory;
+    VkDeviceSize local_memoryOffset;
+    local_device = device;
+    local_buffer = buffer;
+    local_memory = memory;
+    local_memoryOffset = memoryOffset;
+    sResourceTracker->deviceMemoryTransform_tohost(
+        (VkDeviceMemory*)&local_memory, 1, (VkDeviceSize*)&local_memoryOffset, 1,
+        (VkDeviceSize*)nullptr, 0, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0);
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_2;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+    }
+    uint32_t packetSize_vkBindBufferMemory =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkBindBufferMemory);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkBindBufferMemory);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkBindBufferMemory = OP_vkBindBufferMemory;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkBindBufferMemory, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkBindBufferMemory, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkBuffer((*&local_buffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = get_host_u64_VkDeviceMemory((*&local_memory));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkBindBufferMemory), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkBindBufferMemory_VkResult_return = (VkResult)0;
+    stream->read(&vkBindBufferMemory_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkBindBufferMemory_VkResult_return;
+}
+
+VkResult VkEncoder::vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory memory,
+                                      VkDeviceSize memoryOffset, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkBindImageMemory in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkBindImageMemory(device:%p, image:%p, memory:%p, memoryOffset:%ld)", device,
+                      image, memory, memoryOffset);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkImage local_image;
+    VkDeviceMemory local_memory;
+    VkDeviceSize local_memoryOffset;
+    local_device = device;
+    local_image = image;
+    local_memory = memory;
+    local_memoryOffset = memoryOffset;
+    sResourceTracker->deviceMemoryTransform_tohost(
+        (VkDeviceMemory*)&local_memory, 1, (VkDeviceSize*)&local_memoryOffset, 1,
+        (VkDeviceSize*)nullptr, 0, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0);
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_2;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+    }
+    uint32_t packetSize_vkBindImageMemory =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkBindImageMemory);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkBindImageMemory);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkBindImageMemory = OP_vkBindImageMemory;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkBindImageMemory, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkBindImageMemory, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkImage((*&local_image));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = get_host_u64_VkDeviceMemory((*&local_memory));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkBindImageMemory), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkBindImageMemory_VkResult_return = (VkResult)0;
+    stream->read(&vkBindImageMemory_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkBindImageMemory_VkResult_return;
+}
+
+void VkEncoder::vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer,
+                                              VkMemoryRequirements* pMemoryRequirements,
+                                              uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetBufferMemoryRequirements in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetBufferMemoryRequirements(device:%p, buffer:%p, pMemoryRequirements:%p)",
+                      device, buffer, pMemoryRequirements);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkBuffer local_buffer;
+    local_device = device;
+    local_buffer = buffer;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        count_VkMemoryRequirements(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                   (VkMemoryRequirements*)(pMemoryRequirements), countPtr);
+    }
+    uint32_t packetSize_vkGetBufferMemoryRequirements =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetBufferMemoryRequirements);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetBufferMemoryRequirements);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetBufferMemoryRequirements = OP_vkGetBufferMemoryRequirements;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetBufferMemoryRequirements, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetBufferMemoryRequirements, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkBuffer((*&local_buffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkMemoryRequirements(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkMemoryRequirements*)(pMemoryRequirements),
+                                         streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetBufferMemoryRequirements), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkMemoryRequirements(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                   (VkMemoryRequirements*)(pMemoryRequirements));
+    if (pMemoryRequirements) {
+        transform_fromhost_VkMemoryRequirements(sResourceTracker,
+                                                (VkMemoryRequirements*)(pMemoryRequirements));
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetImageMemoryRequirements(VkDevice device, VkImage image,
+                                             VkMemoryRequirements* pMemoryRequirements,
+                                             uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetImageMemoryRequirements in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetImageMemoryRequirements(device:%p, image:%p, pMemoryRequirements:%p)",
+                      device, image, pMemoryRequirements);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkImage local_image;
+    local_device = device;
+    local_image = image;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        count_VkMemoryRequirements(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                   (VkMemoryRequirements*)(pMemoryRequirements), countPtr);
+    }
+    uint32_t packetSize_vkGetImageMemoryRequirements =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetImageMemoryRequirements);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetImageMemoryRequirements);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetImageMemoryRequirements = OP_vkGetImageMemoryRequirements;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetImageMemoryRequirements, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetImageMemoryRequirements, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkImage((*&local_image));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkMemoryRequirements(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkMemoryRequirements*)(pMemoryRequirements),
+                                         streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetImageMemoryRequirements), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkMemoryRequirements(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                   (VkMemoryRequirements*)(pMemoryRequirements));
+    if (pMemoryRequirements) {
+        transform_fromhost_VkMemoryRequirements(sResourceTracker,
+                                                (VkMemoryRequirements*)(pMemoryRequirements));
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetImageSparseMemoryRequirements(
+    VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount,
+    VkSparseImageMemoryRequirements* pSparseMemoryRequirements, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetImageSparseMemoryRequirements in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetImageSparseMemoryRequirements(device:%p, image:%p, pSparseMemoryRequirementCount:%p, "
+        "pSparseMemoryRequirements:%p)",
+        device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkImage local_image;
+    local_device = device;
+    local_image = image;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pSparseMemoryRequirementCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pSparseMemoryRequirements) {
+            if (pSparseMemoryRequirementCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) {
+                    count_VkSparseImageMemoryRequirements(
+                        sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                        (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i),
+                        countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetImageSparseMemoryRequirements =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetImageSparseMemoryRequirements);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetImageSparseMemoryRequirements);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetImageSparseMemoryRequirements = OP_vkGetImageSparseMemoryRequirements;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetImageSparseMemoryRequirements, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetImageSparseMemoryRequirements, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkImage((*&local_image));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pSparseMemoryRequirementCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_3 = (uint64_t)(uintptr_t)pSparseMemoryRequirements;
+    memcpy((*streamPtrPtr), &cgen_var_3, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pSparseMemoryRequirements) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) {
+            reservedmarshal_VkSparseImageMemoryRequirements(
+                stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i), streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetImageSparseMemoryRequirements), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pSparseMemoryRequirementCount;
+    check_pSparseMemoryRequirementCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pSparseMemoryRequirementCount) {
+        if (!(check_pSparseMemoryRequirementCount)) {
+            fprintf(stderr,
+                    "fatal: pSparseMemoryRequirementCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkSparseImageMemoryRequirements* check_pSparseMemoryRequirements;
+    check_pSparseMemoryRequirements =
+        (VkSparseImageMemoryRequirements*)(uintptr_t)stream->getBe64();
+    if (pSparseMemoryRequirements) {
+        if (!(check_pSparseMemoryRequirements)) {
+            fprintf(stderr,
+                    "fatal: pSparseMemoryRequirements inconsistent between guest and host\n");
+        }
+        if (pSparseMemoryRequirementCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) {
+                unmarshal_VkSparseImageMemoryRequirements(
+                    stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                    (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i));
+            }
+        }
+    }
+    if (pSparseMemoryRequirementCount) {
+        if (pSparseMemoryRequirements) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) {
+                transform_fromhost_VkSparseImageMemoryRequirements(
+                    sResourceTracker,
+                    (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i));
+            }
+        }
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetPhysicalDeviceSparseImageFormatProperties(
+    VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type,
+    VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling,
+    uint32_t* pPropertyCount, VkSparseImageFormatProperties* pProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkGetPhysicalDeviceSparseImageFormatProperties in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceSparseImageFormatProperties(physicalDevice:%p, format:%d, usage:%d, "
+        "pPropertyCount:%p, pProperties:%p)",
+        physicalDevice, format, usage, pPropertyCount, pProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkFormat local_format;
+    VkImageType local_type;
+    VkSampleCountFlagBits local_samples;
+    VkImageUsageFlags local_usage;
+    VkImageTiling local_tiling;
+    local_physicalDevice = physicalDevice;
+    local_format = format;
+    local_type = type;
+    local_samples = samples;
+    local_usage = usage;
+    local_tiling = tiling;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkFormat);
+        *countPtr += sizeof(VkImageType);
+        *countPtr += sizeof(VkSampleCountFlagBits);
+        *countPtr += sizeof(VkImageUsageFlags);
+        *countPtr += sizeof(VkImageTiling);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pPropertyCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pProperties) {
+            if (pPropertyCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                    count_VkSparseImageFormatProperties(
+                        sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                        (VkSparseImageFormatProperties*)(pProperties + i), countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceSparseImageFormatProperties =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceSparseImageFormatProperties);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceSparseImageFormatProperties);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties =
+        OP_vkGetPhysicalDeviceSparseImageFormatProperties;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceSparseImageFormatProperties, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceSparseImageFormatProperties, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkFormat*)&local_format, sizeof(VkFormat));
+    *streamPtrPtr += sizeof(VkFormat);
+    memcpy(*streamPtrPtr, (VkImageType*)&local_type, sizeof(VkImageType));
+    *streamPtrPtr += sizeof(VkImageType);
+    memcpy(*streamPtrPtr, (VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits));
+    *streamPtrPtr += sizeof(VkSampleCountFlagBits);
+    memcpy(*streamPtrPtr, (VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags));
+    *streamPtrPtr += sizeof(VkImageUsageFlags);
+    memcpy(*streamPtrPtr, (VkImageTiling*)&local_tiling, sizeof(VkImageTiling));
+    *streamPtrPtr += sizeof(VkImageTiling);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pPropertyCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pPropertyCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pPropertyCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pProperties;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pProperties) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+            reservedmarshal_VkSparseImageFormatProperties(
+                stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkSparseImageFormatProperties*)(pProperties + i), streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceSparseImageFormatProperties),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pPropertyCount;
+    check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pPropertyCount) {
+        if (!(check_pPropertyCount)) {
+            fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkSparseImageFormatProperties* check_pProperties;
+    check_pProperties = (VkSparseImageFormatProperties*)(uintptr_t)stream->getBe64();
+    if (pProperties) {
+        if (!(check_pProperties)) {
+            fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
+        }
+        if (pPropertyCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                unmarshal_VkSparseImageFormatProperties(
+                    stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                    (VkSparseImageFormatProperties*)(pProperties + i));
+            }
+        }
+    }
+    if (pPropertyCount) {
+        if (pProperties) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                transform_fromhost_VkSparseImageFormatProperties(
+                    sResourceTracker, (VkSparseImageFormatProperties*)(pProperties + i));
+            }
+        }
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCount,
+                                      const VkBindSparseInfo* pBindInfo, VkFence fence,
+                                      uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkQueueBindSparse in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkQueueBindSparse(queue:%p, bindInfoCount:%d, pBindInfo:%p, fence:%p)",
+                      queue, bindInfoCount, pBindInfo, fence);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkQueue local_queue;
+    uint32_t local_bindInfoCount;
+    VkBindSparseInfo* local_pBindInfo;
+    VkFence local_fence;
+    local_queue = queue;
+    local_bindInfoCount = bindInfoCount;
+    local_pBindInfo = nullptr;
+    if (pBindInfo) {
+        local_pBindInfo =
+            (VkBindSparseInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindSparseInfo));
+        for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) {
+            deepcopy_VkBindSparseInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pBindInfo + i,
+                                      (VkBindSparseInfo*)(local_pBindInfo + i));
+        }
+    }
+    local_fence = fence;
+    if (local_pBindInfo) {
+        for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) {
+            transform_tohost_VkBindSparseInfo(sResourceTracker,
+                                              (VkBindSparseInfo*)(local_pBindInfo + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) {
+            count_VkBindSparseInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                   (VkBindSparseInfo*)(local_pBindInfo + i), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkQueueBindSparse =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkQueueBindSparse);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkQueueBindSparse);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkQueueBindSparse = OP_vkQueueBindSparse;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkQueueBindSparse, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkQueueBindSparse, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkQueue((*&local_queue));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) {
+        reservedmarshal_VkBindSparseInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkBindSparseInfo*)(local_pBindInfo + i), streamPtrPtr);
+    }
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkFence((*&local_fence));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkQueueBindSparse), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkQueueBindSparse_VkResult_return = (VkResult)0;
+    stream->read(&vkQueueBindSparse_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkQueueBindSparse_VkResult_return;
+}
+
+VkResult VkEncoder::vkCreateFence(VkDevice device, const VkFenceCreateInfo* pCreateInfo,
+                                  const VkAllocationCallbacks* pAllocator, VkFence* pFence,
+                                  uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateFence in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCreateFence(device:%p, pCreateInfo:%p, pAllocator:%p, pFence:%p)", device,
+                      pCreateInfo, pAllocator, pFence);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkFenceCreateInfo* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkFenceCreateInfo*)pool->alloc(sizeof(const VkFenceCreateInfo));
+        deepcopy_VkFenceCreateInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                   (VkFenceCreateInfo*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkFenceCreateInfo(sResourceTracker,
+                                           (VkFenceCreateInfo*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkFenceCreateInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                (VkFenceCreateInfo*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateFence = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateFence);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateFence);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateFence = OP_vkCreateFence;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateFence, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateFence, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkFenceCreateInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                      (VkFenceCreateInfo*)(local_pCreateInfo), streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pFence));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCreateFence), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkFence(&cgen_var_3, (VkFence*)pFence, 1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateFence_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateFence_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateFence_VkResult_return;
+}
+
+void VkEncoder::vkDestroyFence(VkDevice device, VkFence fence,
+                               const VkAllocationCallbacks* pAllocator, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyFence in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroyFence(device:%p, fence:%p, pAllocator:%p)", device, fence,
+                      pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkFence local_fence;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_fence = fence;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyFence = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDestroyFence);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyFence);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyFence = OP_vkDestroyFence;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyFence, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyFence, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkFence((*&local_fence));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkDestroyFence), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkFence((VkFence*)&fence);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences,
+                                  uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkResetFences in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkResetFences(device:%p, fenceCount:%d, pFences:%p)", device, fenceCount,
+                      pFences);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    uint32_t local_fenceCount;
+    VkFence* local_pFences;
+    local_device = device;
+    local_fenceCount = fenceCount;
+    // Avoiding deepcopy for pFences
+    local_pFences = (VkFence*)pFences;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        if (((fenceCount))) {
+            *countPtr += ((fenceCount)) * 8;
+        }
+    }
+    uint32_t packetSize_vkResetFences = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkResetFences);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkResetFences);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkResetFences = OP_vkResetFences;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkResetFences, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkResetFences, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_fenceCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (((fenceCount))) {
+        uint8_t* cgen_var_1_ptr = (uint8_t*)(*streamPtrPtr);
+        for (uint32_t k = 0; k < ((fenceCount)); ++k) {
+            uint64_t tmpval = get_host_u64_VkFence(local_pFences[k]);
+            memcpy(cgen_var_1_ptr + k * 8, &tmpval, sizeof(uint64_t));
+        }
+        *streamPtrPtr += 8 * ((fenceCount));
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkResetFences), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkResetFences_VkResult_return = (VkResult)0;
+    stream->read(&vkResetFences_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkResetFences_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetFenceStatus(VkDevice device, VkFence fence, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetFenceStatus in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetFenceStatus(device:%p, fence:%p)", device, fence);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkFence local_fence;
+    local_device = device;
+    local_fence = fence;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkGetFenceStatus = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetFenceStatus);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetFenceStatus);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetFenceStatus = OP_vkGetFenceStatus;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetFenceStatus, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetFenceStatus, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkFence((*&local_fence));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetFenceStatus), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkGetFenceStatus_VkResult_return = (VkResult)0;
+    stream->read(&vkGetFenceStatus_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetFenceStatus_VkResult_return;
+}
+
+VkResult VkEncoder::vkWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences,
+                                    VkBool32 waitAll, uint64_t timeout, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkWaitForFences in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkWaitForFences(device:%p, fenceCount:%d, pFences:%p, waitAll:%d, timeout:%ld)", device,
+        fenceCount, pFences, waitAll, timeout);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    uint32_t local_fenceCount;
+    VkFence* local_pFences;
+    VkBool32 local_waitAll;
+    uint64_t local_timeout;
+    local_device = device;
+    local_fenceCount = fenceCount;
+    // Avoiding deepcopy for pFences
+    local_pFences = (VkFence*)pFences;
+    local_waitAll = waitAll;
+    local_timeout = timeout;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        if (((fenceCount))) {
+            *countPtr += ((fenceCount)) * 8;
+        }
+        *countPtr += sizeof(VkBool32);
+        *countPtr += sizeof(uint64_t);
+    }
+    uint32_t packetSize_vkWaitForFences = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkWaitForFences);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkWaitForFences);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkWaitForFences = OP_vkWaitForFences;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkWaitForFences, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkWaitForFences, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_fenceCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (((fenceCount))) {
+        uint8_t* cgen_var_1_ptr = (uint8_t*)(*streamPtrPtr);
+        for (uint32_t k = 0; k < ((fenceCount)); ++k) {
+            uint64_t tmpval = get_host_u64_VkFence(local_pFences[k]);
+            memcpy(cgen_var_1_ptr + k * 8, &tmpval, sizeof(uint64_t));
+        }
+        *streamPtrPtr += 8 * ((fenceCount));
+    }
+    memcpy(*streamPtrPtr, (VkBool32*)&local_waitAll, sizeof(VkBool32));
+    *streamPtrPtr += sizeof(VkBool32);
+    memcpy(*streamPtrPtr, (uint64_t*)&local_timeout, sizeof(uint64_t));
+    *streamPtrPtr += sizeof(uint64_t);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkWaitForFences), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkWaitForFences_VkResult_return = (VkResult)0;
+    stream->read(&vkWaitForFences_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkWaitForFences_VkResult_return;
+}
+
+VkResult VkEncoder::vkCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo,
+                                      const VkAllocationCallbacks* pAllocator,
+                                      VkSemaphore* pSemaphore, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateSemaphore in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCreateSemaphore(device:%p, pCreateInfo:%p, pAllocator:%p, pSemaphore:%p)",
+                      device, pCreateInfo, pAllocator, pSemaphore);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSemaphoreCreateInfo* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo =
+            (VkSemaphoreCreateInfo*)pool->alloc(sizeof(const VkSemaphoreCreateInfo));
+        deepcopy_VkSemaphoreCreateInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                       (VkSemaphoreCreateInfo*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkSemaphoreCreateInfo(sResourceTracker,
+                                               (VkSemaphoreCreateInfo*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkSemaphoreCreateInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkSemaphoreCreateInfo*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateSemaphore =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateSemaphore);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateSemaphore);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateSemaphore = OP_vkCreateSemaphore;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateSemaphore, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateSemaphore, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkSemaphoreCreateInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkSemaphoreCreateInfo*)(local_pCreateInfo),
+                                          streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pSemaphore));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCreateSemaphore), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkSemaphore(&cgen_var_3, (VkSemaphore*)pSemaphore, 1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateSemaphore_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateSemaphore_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateSemaphore_VkResult_return;
+}
+
+void VkEncoder::vkDestroySemaphore(VkDevice device, VkSemaphore semaphore,
+                                   const VkAllocationCallbacks* pAllocator, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroySemaphore in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroySemaphore(device:%p, semaphore:%p, pAllocator:%p)", device,
+                      semaphore, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSemaphore local_semaphore;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_semaphore = semaphore;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroySemaphore =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDestroySemaphore);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroySemaphore);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroySemaphore = OP_vkDestroySemaphore;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroySemaphore, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroySemaphore, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkSemaphore((*&local_semaphore));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroySemaphore), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkSemaphore((VkSemaphore*)&semaphore);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkCreateEvent(VkDevice device, const VkEventCreateInfo* pCreateInfo,
+                                  const VkAllocationCallbacks* pAllocator, VkEvent* pEvent,
+                                  uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateEvent in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCreateEvent(device:%p, pCreateInfo:%p, pAllocator:%p, pEvent:%p)", device,
+                      pCreateInfo, pAllocator, pEvent);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkEventCreateInfo* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkEventCreateInfo*)pool->alloc(sizeof(const VkEventCreateInfo));
+        deepcopy_VkEventCreateInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                   (VkEventCreateInfo*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkEventCreateInfo(sResourceTracker,
+                                           (VkEventCreateInfo*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkEventCreateInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                (VkEventCreateInfo*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateEvent = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateEvent);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateEvent);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateEvent = OP_vkCreateEvent;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateEvent, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateEvent, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkEventCreateInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                      (VkEventCreateInfo*)(local_pCreateInfo), streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pEvent));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCreateEvent), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkEvent(&cgen_var_3, (VkEvent*)pEvent, 1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateEvent_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateEvent_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateEvent_VkResult_return;
+}
+
+void VkEncoder::vkDestroyEvent(VkDevice device, VkEvent event,
+                               const VkAllocationCallbacks* pAllocator, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyEvent in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroyEvent(device:%p, event:%p, pAllocator:%p)", device, event,
+                      pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkEvent local_event;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_event = event;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyEvent = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDestroyEvent);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyEvent);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyEvent = OP_vkDestroyEvent;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyEvent, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyEvent, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkEvent((*&local_event));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkDestroyEvent), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkEvent((VkEvent*)&event);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkGetEventStatus(VkDevice device, VkEvent event, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetEventStatus in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetEventStatus(device:%p, event:%p)", device, event);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkEvent local_event;
+    local_device = device;
+    local_event = event;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkGetEventStatus = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetEventStatus);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetEventStatus);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetEventStatus = OP_vkGetEventStatus;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetEventStatus, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetEventStatus, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkEvent((*&local_event));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetEventStatus), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkGetEventStatus_VkResult_return = (VkResult)0;
+    stream->read(&vkGetEventStatus_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetEventStatus_VkResult_return;
+}
+
+VkResult VkEncoder::vkSetEvent(VkDevice device, VkEvent event, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkSetEvent in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkSetEvent(device:%p, event:%p)", device, event);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkEvent local_event;
+    local_device = device;
+    local_event = event;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkSetEvent = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkSetEvent);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkSetEvent);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkSetEvent = OP_vkSetEvent;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkSetEvent, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkSetEvent, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkEvent((*&local_event));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkSetEvent), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkSetEvent_VkResult_return = (VkResult)0;
+    stream->read(&vkSetEvent_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkSetEvent_VkResult_return;
+}
+
+VkResult VkEncoder::vkResetEvent(VkDevice device, VkEvent event, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkResetEvent in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkResetEvent(device:%p, event:%p)", device, event);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkEvent local_event;
+    local_device = device;
+    local_event = event;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkResetEvent = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkResetEvent);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkResetEvent);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkResetEvent = OP_vkResetEvent;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkResetEvent, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkResetEvent, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkEvent((*&local_event));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkResetEvent), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkResetEvent_VkResult_return = (VkResult)0;
+    stream->read(&vkResetEvent_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkResetEvent_VkResult_return;
+}
+
+VkResult VkEncoder::vkCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo,
+                                      const VkAllocationCallbacks* pAllocator,
+                                      VkQueryPool* pQueryPool, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateQueryPool in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCreateQueryPool(device:%p, pCreateInfo:%p, pAllocator:%p, pQueryPool:%p)",
+                      device, pCreateInfo, pAllocator, pQueryPool);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkQueryPoolCreateInfo* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo =
+            (VkQueryPoolCreateInfo*)pool->alloc(sizeof(const VkQueryPoolCreateInfo));
+        deepcopy_VkQueryPoolCreateInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                       (VkQueryPoolCreateInfo*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkQueryPoolCreateInfo(sResourceTracker,
+                                               (VkQueryPoolCreateInfo*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkQueryPoolCreateInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkQueryPoolCreateInfo*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateQueryPool =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateQueryPool);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateQueryPool);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateQueryPool = OP_vkCreateQueryPool;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateQueryPool, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateQueryPool, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkQueryPoolCreateInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkQueryPoolCreateInfo*)(local_pCreateInfo),
+                                          streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pQueryPool));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCreateQueryPool), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkQueryPool(&cgen_var_3, (VkQueryPool*)pQueryPool, 1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateQueryPool_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateQueryPool_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateQueryPool_VkResult_return;
+}
+
+void VkEncoder::vkDestroyQueryPool(VkDevice device, VkQueryPool queryPool,
+                                   const VkAllocationCallbacks* pAllocator, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyQueryPool in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroyQueryPool(device:%p, queryPool:%p, pAllocator:%p)", device,
+                      queryPool, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkQueryPool local_queryPool;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_queryPool = queryPool;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyQueryPool =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDestroyQueryPool);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyQueryPool);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyQueryPool = OP_vkDestroyQueryPool;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyQueryPool, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyQueryPool, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkQueryPool((*&local_queryPool));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroyQueryPool), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkQueryPool((VkQueryPool*)&queryPool);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkGetQueryPoolResults(VkDevice device, VkQueryPool queryPool,
+                                          uint32_t firstQuery, uint32_t queryCount, size_t dataSize,
+                                          void* pData, VkDeviceSize stride,
+                                          VkQueryResultFlags flags, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetQueryPoolResults in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetQueryPoolResults(device:%p, queryPool:%p, firstQuery:%d, queryCount:%d, "
+        "dataSize:%ld, pData:%p, stride:%ld, flags:%d)",
+        device, queryPool, firstQuery, queryCount, dataSize, pData, stride, flags);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkQueryPool local_queryPool;
+    uint32_t local_firstQuery;
+    uint32_t local_queryCount;
+    size_t local_dataSize;
+    VkDeviceSize local_stride;
+    VkQueryResultFlags local_flags;
+    local_device = device;
+    local_queryPool = queryPool;
+    local_firstQuery = firstQuery;
+    local_queryCount = queryCount;
+    local_dataSize = dataSize;
+    local_stride = stride;
+    local_flags = flags;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += 8;
+        *countPtr += ((dataSize)) * sizeof(uint8_t);
+        *countPtr += sizeof(VkDeviceSize);
+        *countPtr += sizeof(VkQueryResultFlags);
+    }
+    uint32_t packetSize_vkGetQueryPoolResults =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetQueryPoolResults);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetQueryPoolResults);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetQueryPoolResults = OP_vkGetQueryPoolResults;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetQueryPoolResults, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetQueryPoolResults, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkQueryPool((*&local_queryPool));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstQuery, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_queryCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    uint64_t cgen_var_2 = (uint64_t)local_dataSize;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    memcpy(*streamPtrPtr, (void*)pData, ((dataSize)) * sizeof(uint8_t));
+    *streamPtrPtr += ((dataSize)) * sizeof(uint8_t);
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_stride, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    memcpy(*streamPtrPtr, (VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags));
+    *streamPtrPtr += sizeof(VkQueryResultFlags);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetQueryPoolResults), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((void*)pData, ((dataSize)) * sizeof(uint8_t));
+    VkResult vkGetQueryPoolResults_VkResult_return = (VkResult)0;
+    stream->read(&vkGetQueryPoolResults_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetQueryPoolResults_VkResult_return;
+}
+
+VkResult VkEncoder::vkCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo,
+                                   const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer,
+                                   uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateBuffer in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCreateBuffer(device:%p, pCreateInfo:%p, pAllocator:%p, pBuffer:%p)",
+                      device, pCreateInfo, pAllocator, pBuffer);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkBufferCreateInfo* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkBufferCreateInfo*)pool->alloc(sizeof(const VkBufferCreateInfo));
+        deepcopy_VkBufferCreateInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                    (VkBufferCreateInfo*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkBufferCreateInfo(sResourceTracker,
+                                            (VkBufferCreateInfo*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkBufferCreateInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                 (VkBufferCreateInfo*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateBuffer = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateBuffer);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateBuffer);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateBuffer = OP_vkCreateBuffer;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateBuffer, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateBuffer, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkBufferCreateInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkBufferCreateInfo*)(local_pCreateInfo), streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pBuffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCreateBuffer), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_3, (VkBuffer*)pBuffer, 1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateBuffer_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateBuffer_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateBuffer_VkResult_return;
+}
+
+void VkEncoder::vkDestroyBuffer(VkDevice device, VkBuffer buffer,
+                                const VkAllocationCallbacks* pAllocator, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyBuffer in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroyBuffer(device:%p, buffer:%p, pAllocator:%p)", device, buffer,
+                      pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkBuffer local_buffer;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_buffer = buffer;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyBuffer = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDestroyBuffer);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyBuffer);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyBuffer = OP_vkDestroyBuffer;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyBuffer, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyBuffer, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkBuffer((*&local_buffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkDestroyBuffer), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkBuffer((VkBuffer*)&buffer);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo,
+                                       const VkAllocationCallbacks* pAllocator, VkBufferView* pView,
+                                       uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateBufferView in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCreateBufferView(device:%p, pCreateInfo:%p, pAllocator:%p, pView:%p)",
+                      device, pCreateInfo, pAllocator, pView);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkBufferViewCreateInfo* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo =
+            (VkBufferViewCreateInfo*)pool->alloc(sizeof(const VkBufferViewCreateInfo));
+        deepcopy_VkBufferViewCreateInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                        (VkBufferViewCreateInfo*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkBufferViewCreateInfo(sResourceTracker,
+                                                (VkBufferViewCreateInfo*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkBufferViewCreateInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                     (VkBufferViewCreateInfo*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateBufferView =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateBufferView);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateBufferView);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateBufferView = OP_vkCreateBufferView;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateBufferView, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateBufferView, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkBufferViewCreateInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                           (VkBufferViewCreateInfo*)(local_pCreateInfo),
+                                           streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pView));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateBufferView), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkBufferView(&cgen_var_3, (VkBufferView*)pView, 1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateBufferView_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateBufferView_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateBufferView_VkResult_return;
+}
+
+void VkEncoder::vkDestroyBufferView(VkDevice device, VkBufferView bufferView,
+                                    const VkAllocationCallbacks* pAllocator, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyBufferView in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroyBufferView(device:%p, bufferView:%p, pAllocator:%p)", device,
+                      bufferView, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkBufferView local_bufferView;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_bufferView = bufferView;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyBufferView =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDestroyBufferView);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyBufferView);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyBufferView = OP_vkDestroyBufferView;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyBufferView, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyBufferView, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkBufferView((*&local_bufferView));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroyBufferView), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkBufferView((VkBufferView*)&bufferView);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo,
+                                  const VkAllocationCallbacks* pAllocator, VkImage* pImage,
+                                  uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateImage in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkImageCreateInfo* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkImageCreateInfo*)pool->alloc(sizeof(const VkImageCreateInfo));
+        deepcopy_VkImageCreateInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                   (VkImageCreateInfo*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    sResourceTracker->unwrap_VkNativeBufferANDROID(pCreateInfo, local_pCreateInfo);
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        sResourceTracker->transformImpl_VkImageCreateInfo_tohost(local_pCreateInfo, 1);
+        transform_tohost_VkImageCreateInfo(sResourceTracker,
+                                           (VkImageCreateInfo*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkImageCreateInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                (VkImageCreateInfo*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateImage = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateImage);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateImage);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateImage = OP_vkCreateImage;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateImage, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateImage, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkImageCreateInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                      (VkImageCreateInfo*)(local_pCreateInfo), streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pImage));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCreateImage), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_3, (VkImage*)pImage, 1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateImage_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateImage_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateImage_VkResult_return;
+}
+
+void VkEncoder::vkDestroyImage(VkDevice device, VkImage image,
+                               const VkAllocationCallbacks* pAllocator, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyImage in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroyImage(device:%p, image:%p, pAllocator:%p)", device, image,
+                      pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkImage local_image;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_image = image;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyImage = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDestroyImage);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyImage);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyImage = OP_vkDestroyImage;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyImage, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyImage, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkImage((*&local_image));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkDestroyImage), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkImage((VkImage*)&image);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetImageSubresourceLayout(VkDevice device, VkImage image,
+                                            const VkImageSubresource* pSubresource,
+                                            VkSubresourceLayout* pLayout, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetImageSubresourceLayout in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetImageSubresourceLayout(device:%p, image:%p, pSubresource:%p, pLayout:%p)", device,
+        image, pSubresource, pLayout);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkImage local_image;
+    VkImageSubresource* local_pSubresource;
+    local_device = device;
+    local_image = image;
+    local_pSubresource = nullptr;
+    if (pSubresource) {
+        local_pSubresource = (VkImageSubresource*)pool->alloc(sizeof(const VkImageSubresource));
+        deepcopy_VkImageSubresource(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pSubresource,
+                                    (VkImageSubresource*)(local_pSubresource));
+    }
+    if (local_pSubresource) {
+        transform_tohost_VkImageSubresource(sResourceTracker,
+                                            (VkImageSubresource*)(local_pSubresource));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        count_VkImageSubresource(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                 (VkImageSubresource*)(local_pSubresource), countPtr);
+        count_VkSubresourceLayout(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                  (VkSubresourceLayout*)(pLayout), countPtr);
+    }
+    uint32_t packetSize_vkGetImageSubresourceLayout =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetImageSubresourceLayout);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetImageSubresourceLayout);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetImageSubresourceLayout = OP_vkGetImageSubresourceLayout;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetImageSubresourceLayout, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetImageSubresourceLayout, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkImage((*&local_image));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkImageSubresource(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkImageSubresource*)(local_pSubresource), streamPtrPtr);
+    reservedmarshal_VkSubresourceLayout(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkSubresourceLayout*)(pLayout), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetImageSubresourceLayout), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkSubresourceLayout(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                  (VkSubresourceLayout*)(pLayout));
+    if (pLayout) {
+        transform_fromhost_VkSubresourceLayout(sResourceTracker, (VkSubresourceLayout*)(pLayout));
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkCreateImageView(VkDevice device, const VkImageViewCreateInfo* pCreateInfo,
+                                      const VkAllocationCallbacks* pAllocator, VkImageView* pView,
+                                      uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateImageView in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCreateImageView(device:%p, pCreateInfo:%p, pAllocator:%p, pView:%p)",
+                      device, pCreateInfo, pAllocator, pView);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkImageViewCreateInfo* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo =
+            (VkImageViewCreateInfo*)pool->alloc(sizeof(const VkImageViewCreateInfo));
+        deepcopy_VkImageViewCreateInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                       (VkImageViewCreateInfo*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkImageViewCreateInfo(sResourceTracker,
+                                               (VkImageViewCreateInfo*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkImageViewCreateInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkImageViewCreateInfo*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateImageView =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateImageView);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateImageView);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateImageView = OP_vkCreateImageView;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateImageView, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateImageView, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkImageViewCreateInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkImageViewCreateInfo*)(local_pCreateInfo),
+                                          streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pView));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCreateImageView), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkImageView(&cgen_var_3, (VkImageView*)pView, 1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateImageView_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateImageView_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateImageView_VkResult_return;
+}
+
+void VkEncoder::vkDestroyImageView(VkDevice device, VkImageView imageView,
+                                   const VkAllocationCallbacks* pAllocator, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyImageView in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroyImageView(device:%p, imageView:%p, pAllocator:%p)", device,
+                      imageView, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkImageView local_imageView;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_imageView = imageView;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyImageView =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDestroyImageView);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyImageView);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyImageView = OP_vkDestroyImageView;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyImageView, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyImageView, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkImageView((*&local_imageView));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroyImageView), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkImageView((VkImageView*)&imageView);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkCreateShaderModule(VkDevice device,
+                                         const VkShaderModuleCreateInfo* pCreateInfo,
+                                         const VkAllocationCallbacks* pAllocator,
+                                         VkShaderModule* pShaderModule, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateShaderModule in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateShaderModule(device:%p, pCreateInfo:%p, pAllocator:%p, pShaderModule:%p)", device,
+        pCreateInfo, pAllocator, pShaderModule);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkShaderModuleCreateInfo* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo =
+            (VkShaderModuleCreateInfo*)pool->alloc(sizeof(const VkShaderModuleCreateInfo));
+        deepcopy_VkShaderModuleCreateInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                          (VkShaderModuleCreateInfo*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkShaderModuleCreateInfo(sResourceTracker,
+                                                  (VkShaderModuleCreateInfo*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkShaderModuleCreateInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkShaderModuleCreateInfo*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateShaderModule =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateShaderModule);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateShaderModule);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateShaderModule = OP_vkCreateShaderModule;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateShaderModule, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateShaderModule, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkShaderModuleCreateInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                             (VkShaderModuleCreateInfo*)(local_pCreateInfo),
+                                             streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pShaderModule));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateShaderModule), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkShaderModule(&cgen_var_3,
+                                                           (VkShaderModule*)pShaderModule, 1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateShaderModule_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateShaderModule_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateShaderModule_VkResult_return;
+}
+
+void VkEncoder::vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule,
+                                      const VkAllocationCallbacks* pAllocator, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyShaderModule in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroyShaderModule(device:%p, shaderModule:%p, pAllocator:%p)", device,
+                      shaderModule, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkShaderModule local_shaderModule;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_shaderModule = shaderModule;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyShaderModule =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDestroyShaderModule);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyShaderModule);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyShaderModule = OP_vkDestroyShaderModule;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyShaderModule, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyShaderModule, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkShaderModule((*&local_shaderModule));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroyShaderModule), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkShaderModule((VkShaderModule*)&shaderModule);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkCreatePipelineCache(VkDevice device,
+                                          const VkPipelineCacheCreateInfo* pCreateInfo,
+                                          const VkAllocationCallbacks* pAllocator,
+                                          VkPipelineCache* pPipelineCache, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreatePipelineCache in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreatePipelineCache(device:%p, pCreateInfo:%p, pAllocator:%p, pPipelineCache:%p)",
+        device, pCreateInfo, pAllocator, pPipelineCache);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkPipelineCacheCreateInfo* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo =
+            (VkPipelineCacheCreateInfo*)pool->alloc(sizeof(const VkPipelineCacheCreateInfo));
+        deepcopy_VkPipelineCacheCreateInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                           (VkPipelineCacheCreateInfo*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkPipelineCacheCreateInfo(sResourceTracker,
+                                                   (VkPipelineCacheCreateInfo*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPipelineCacheCreateInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkPipelineCacheCreateInfo*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreatePipelineCache =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreatePipelineCache);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreatePipelineCache);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreatePipelineCache = OP_vkCreatePipelineCache;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreatePipelineCache, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreatePipelineCache, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPipelineCacheCreateInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkPipelineCacheCreateInfo*)(local_pCreateInfo),
+                                              streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pPipelineCache));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreatePipelineCache), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkPipelineCache(&cgen_var_3,
+                                                            (VkPipelineCache*)pPipelineCache, 1);
+    stream->unsetHandleMapping();
+    VkResult vkCreatePipelineCache_VkResult_return = (VkResult)0;
+    stream->read(&vkCreatePipelineCache_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreatePipelineCache_VkResult_return;
+}
+
+void VkEncoder::vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache,
+                                       const VkAllocationCallbacks* pAllocator, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyPipelineCache in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroyPipelineCache(device:%p, pipelineCache:%p, pAllocator:%p)", device,
+                      pipelineCache, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkPipelineCache local_pipelineCache;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pipelineCache = pipelineCache;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyPipelineCache =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDestroyPipelineCache);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyPipelineCache);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyPipelineCache = OP_vkDestroyPipelineCache;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyPipelineCache, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyPipelineCache, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkPipelineCache((*&local_pipelineCache));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroyPipelineCache), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkPipelineCache(
+        (VkPipelineCache*)&pipelineCache);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache,
+                                           size_t* pDataSize, void* pData, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPipelineCacheData in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetPipelineCacheData(device:%p, pipelineCache:%p, pDataSize:%p, pData:%p)",
+                      device, pipelineCache, pDataSize, pData);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkPipelineCache local_pipelineCache;
+    local_device = device;
+    local_pipelineCache = pipelineCache;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pDataSize) {
+            *countPtr += 8;
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pData) {
+            if (pDataSize) {
+                *countPtr += (*(pDataSize)) * sizeof(uint8_t);
+            }
+        }
+    }
+    uint32_t packetSize_vkGetPipelineCacheData =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetPipelineCacheData);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPipelineCacheData);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPipelineCacheData = OP_vkGetPipelineCacheData;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPipelineCacheData, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPipelineCacheData, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkPipelineCache((*&local_pipelineCache));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pDataSize;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pDataSize) {
+        uint64_t cgen_var_2_0 = (uint64_t)(*pDataSize);
+        memcpy((*streamPtrPtr), &cgen_var_2_0, 8);
+        android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+        *streamPtrPtr += 8;
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_3 = (uint64_t)(uintptr_t)pData;
+    memcpy((*streamPtrPtr), &cgen_var_3, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pData) {
+        memcpy(*streamPtrPtr, (void*)pData, (*(pDataSize)) * sizeof(uint8_t));
+        *streamPtrPtr += (*(pDataSize)) * sizeof(uint8_t);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPipelineCacheData), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    size_t* check_pDataSize;
+    check_pDataSize = (size_t*)(uintptr_t)stream->getBe64();
+    if (pDataSize) {
+        if (!(check_pDataSize)) {
+            fprintf(stderr, "fatal: pDataSize inconsistent between guest and host\n");
+        }
+        (*pDataSize) = (size_t)stream->getBe64();
+    }
+    // WARNING PTR CHECK
+    void* check_pData;
+    check_pData = (void*)(uintptr_t)stream->getBe64();
+    if (pData) {
+        if (!(check_pData)) {
+            fprintf(stderr, "fatal: pData inconsistent between guest and host\n");
+        }
+        stream->read((void*)pData, (*(pDataSize)) * sizeof(uint8_t));
+    }
+    VkResult vkGetPipelineCacheData_VkResult_return = (VkResult)0;
+    stream->read(&vkGetPipelineCacheData_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPipelineCacheData_VkResult_return;
+}
+
+VkResult VkEncoder::vkMergePipelineCaches(VkDevice device, VkPipelineCache dstCache,
+                                          uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches,
+                                          uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkMergePipelineCaches in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkMergePipelineCaches(device:%p, dstCache:%p, srcCacheCount:%d, pSrcCaches:%p)", device,
+        dstCache, srcCacheCount, pSrcCaches);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkPipelineCache local_dstCache;
+    uint32_t local_srcCacheCount;
+    VkPipelineCache* local_pSrcCaches;
+    local_device = device;
+    local_dstCache = dstCache;
+    local_srcCacheCount = srcCacheCount;
+    // Avoiding deepcopy for pSrcCaches
+    local_pSrcCaches = (VkPipelineCache*)pSrcCaches;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        if (((srcCacheCount))) {
+            *countPtr += ((srcCacheCount)) * 8;
+        }
+    }
+    uint32_t packetSize_vkMergePipelineCaches =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkMergePipelineCaches);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkMergePipelineCaches);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkMergePipelineCaches = OP_vkMergePipelineCaches;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkMergePipelineCaches, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkMergePipelineCaches, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkPipelineCache((*&local_dstCache));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_srcCacheCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (((srcCacheCount))) {
+        uint8_t* cgen_var_2_ptr = (uint8_t*)(*streamPtrPtr);
+        for (uint32_t k = 0; k < ((srcCacheCount)); ++k) {
+            uint64_t tmpval = get_host_u64_VkPipelineCache(local_pSrcCaches[k]);
+            memcpy(cgen_var_2_ptr + k * 8, &tmpval, sizeof(uint64_t));
+        }
+        *streamPtrPtr += 8 * ((srcCacheCount));
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkMergePipelineCaches), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkMergePipelineCaches_VkResult_return = (VkResult)0;
+    stream->read(&vkMergePipelineCaches_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkMergePipelineCaches_VkResult_return;
+}
+
+VkResult VkEncoder::vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache,
+                                              uint32_t createInfoCount,
+                                              const VkGraphicsPipelineCreateInfo* pCreateInfos,
+                                              const VkAllocationCallbacks* pAllocator,
+                                              VkPipeline* pPipelines, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateGraphicsPipelines in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateGraphicsPipelines(device:%p, pipelineCache:%p, createInfoCount:%d, "
+        "pCreateInfos:%p, pAllocator:%p, pPipelines:%p)",
+        device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkPipelineCache local_pipelineCache;
+    uint32_t local_createInfoCount;
+    VkGraphicsPipelineCreateInfo* local_pCreateInfos;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pipelineCache = pipelineCache;
+    local_createInfoCount = createInfoCount;
+    local_pCreateInfos = nullptr;
+    if (pCreateInfos) {
+        local_pCreateInfos = (VkGraphicsPipelineCreateInfo*)pool->alloc(
+            ((createInfoCount)) * sizeof(const VkGraphicsPipelineCreateInfo));
+        for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) {
+            deepcopy_VkGraphicsPipelineCreateInfo(
+                pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfos + i,
+                (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i));
+        }
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfos) {
+        for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) {
+            transform_tohost_VkGraphicsPipelineCreateInfo(
+                sResourceTracker, (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i));
+        }
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) {
+            count_VkGraphicsPipelineCreateInfo(
+                sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i), countPtr);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        if (((createInfoCount))) {
+            *countPtr += ((createInfoCount)) * 8;
+        }
+    }
+    uint32_t packetSize_vkCreateGraphicsPipelines =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateGraphicsPipelines);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateGraphicsPipelines);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateGraphicsPipelines = OP_vkCreateGraphicsPipelines;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateGraphicsPipelines, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateGraphicsPipelines, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkPipelineCache((*&local_pipelineCache));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_createInfoCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) {
+        reservedmarshal_VkGraphicsPipelineCreateInfo(
+            stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i), streamPtrPtr);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    if (((createInfoCount))) {
+        uint8_t* cgen_var_3_ptr = (uint8_t*)(*streamPtrPtr);
+        for (uint32_t k = 0; k < ((createInfoCount)); ++k) {
+            uint64_t tmpval = (uint64_t)(pPipelines[k]);
+            memcpy(cgen_var_3_ptr + k * 8, &tmpval, sizeof(uint64_t));
+        }
+        *streamPtrPtr += 8 * ((createInfoCount));
+    }
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateGraphicsPipelines), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    if (((createInfoCount))) {
+        uint64_t* cgen_var_4;
+        stream->alloc((void**)&cgen_var_4, ((createInfoCount)) * 8);
+        stream->read((uint64_t*)cgen_var_4, ((createInfoCount)) * 8);
+        stream->handleMapping()->mapHandles_u64_VkPipeline(cgen_var_4, (VkPipeline*)pPipelines,
+                                                           ((createInfoCount)));
+    }
+    stream->unsetHandleMapping();
+    VkResult vkCreateGraphicsPipelines_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateGraphicsPipelines_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateGraphicsPipelines_VkResult_return;
+}
+
+VkResult VkEncoder::vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache,
+                                             uint32_t createInfoCount,
+                                             const VkComputePipelineCreateInfo* pCreateInfos,
+                                             const VkAllocationCallbacks* pAllocator,
+                                             VkPipeline* pPipelines, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateComputePipelines in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateComputePipelines(device:%p, pipelineCache:%p, createInfoCount:%d, "
+        "pCreateInfos:%p, pAllocator:%p, pPipelines:%p)",
+        device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkPipelineCache local_pipelineCache;
+    uint32_t local_createInfoCount;
+    VkComputePipelineCreateInfo* local_pCreateInfos;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pipelineCache = pipelineCache;
+    local_createInfoCount = createInfoCount;
+    local_pCreateInfos = nullptr;
+    if (pCreateInfos) {
+        local_pCreateInfos = (VkComputePipelineCreateInfo*)pool->alloc(
+            ((createInfoCount)) * sizeof(const VkComputePipelineCreateInfo));
+        for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) {
+            deepcopy_VkComputePipelineCreateInfo(
+                pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfos + i,
+                (VkComputePipelineCreateInfo*)(local_pCreateInfos + i));
+        }
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfos) {
+        for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) {
+            transform_tohost_VkComputePipelineCreateInfo(
+                sResourceTracker, (VkComputePipelineCreateInfo*)(local_pCreateInfos + i));
+        }
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) {
+            count_VkComputePipelineCreateInfo(
+                sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkComputePipelineCreateInfo*)(local_pCreateInfos + i), countPtr);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        if (((createInfoCount))) {
+            *countPtr += ((createInfoCount)) * 8;
+        }
+    }
+    uint32_t packetSize_vkCreateComputePipelines =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateComputePipelines);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateComputePipelines);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateComputePipelines = OP_vkCreateComputePipelines;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateComputePipelines, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateComputePipelines, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkPipelineCache((*&local_pipelineCache));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_createInfoCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) {
+        reservedmarshal_VkComputePipelineCreateInfo(
+            stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkComputePipelineCreateInfo*)(local_pCreateInfos + i), streamPtrPtr);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    if (((createInfoCount))) {
+        uint8_t* cgen_var_3_ptr = (uint8_t*)(*streamPtrPtr);
+        for (uint32_t k = 0; k < ((createInfoCount)); ++k) {
+            uint64_t tmpval = (uint64_t)(pPipelines[k]);
+            memcpy(cgen_var_3_ptr + k * 8, &tmpval, sizeof(uint64_t));
+        }
+        *streamPtrPtr += 8 * ((createInfoCount));
+    }
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateComputePipelines), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    if (((createInfoCount))) {
+        uint64_t* cgen_var_4;
+        stream->alloc((void**)&cgen_var_4, ((createInfoCount)) * 8);
+        stream->read((uint64_t*)cgen_var_4, ((createInfoCount)) * 8);
+        stream->handleMapping()->mapHandles_u64_VkPipeline(cgen_var_4, (VkPipeline*)pPipelines,
+                                                           ((createInfoCount)));
+    }
+    stream->unsetHandleMapping();
+    VkResult vkCreateComputePipelines_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateComputePipelines_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateComputePipelines_VkResult_return;
+}
+
+void VkEncoder::vkDestroyPipeline(VkDevice device, VkPipeline pipeline,
+                                  const VkAllocationCallbacks* pAllocator, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyPipeline in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroyPipeline(device:%p, pipeline:%p, pAllocator:%p)", device, pipeline,
+                      pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkPipeline local_pipeline;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pipeline = pipeline;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyPipeline =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDestroyPipeline);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyPipeline);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyPipeline = OP_vkDestroyPipeline;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyPipeline, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyPipeline, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkPipeline((*&local_pipeline));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkDestroyPipeline), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkPipeline((VkPipeline*)&pipeline);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkCreatePipelineLayout(VkDevice device,
+                                           const VkPipelineLayoutCreateInfo* pCreateInfo,
+                                           const VkAllocationCallbacks* pAllocator,
+                                           VkPipelineLayout* pPipelineLayout, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreatePipelineLayout in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreatePipelineLayout(device:%p, pCreateInfo:%p, pAllocator:%p, pPipelineLayout:%p)",
+        device, pCreateInfo, pAllocator, pPipelineLayout);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkPipelineLayoutCreateInfo* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo =
+            (VkPipelineLayoutCreateInfo*)pool->alloc(sizeof(const VkPipelineLayoutCreateInfo));
+        deepcopy_VkPipelineLayoutCreateInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                            (VkPipelineLayoutCreateInfo*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkPipelineLayoutCreateInfo(
+            sResourceTracker, (VkPipelineLayoutCreateInfo*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPipelineLayoutCreateInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkPipelineLayoutCreateInfo*)(local_pCreateInfo),
+                                         countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreatePipelineLayout =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreatePipelineLayout);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreatePipelineLayout);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreatePipelineLayout = OP_vkCreatePipelineLayout;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreatePipelineLayout, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreatePipelineLayout, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPipelineLayoutCreateInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                               (VkPipelineLayoutCreateInfo*)(local_pCreateInfo),
+                                               streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pPipelineLayout));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreatePipelineLayout), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkPipelineLayout(&cgen_var_3,
+                                                             (VkPipelineLayout*)pPipelineLayout, 1);
+    stream->unsetHandleMapping();
+    VkResult vkCreatePipelineLayout_VkResult_return = (VkResult)0;
+    stream->read(&vkCreatePipelineLayout_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreatePipelineLayout_VkResult_return;
+}
+
+void VkEncoder::vkDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout,
+                                        const VkAllocationCallbacks* pAllocator, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyPipelineLayout in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroyPipelineLayout(device:%p, pipelineLayout:%p, pAllocator:%p)",
+                      device, pipelineLayout, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkPipelineLayout local_pipelineLayout;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pipelineLayout = pipelineLayout;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyPipelineLayout =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDestroyPipelineLayout);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyPipelineLayout);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyPipelineLayout = OP_vkDestroyPipelineLayout;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyPipelineLayout, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyPipelineLayout, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkPipelineLayout((*&local_pipelineLayout));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroyPipelineLayout), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkPipelineLayout(
+        (VkPipelineLayout*)&pipelineLayout);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkCreateSampler(VkDevice device, const VkSamplerCreateInfo* pCreateInfo,
+                                    const VkAllocationCallbacks* pAllocator, VkSampler* pSampler,
+                                    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateSampler in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCreateSampler(device:%p, pCreateInfo:%p, pAllocator:%p, pSampler:%p)",
+                      device, pCreateInfo, pAllocator, pSampler);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSamplerCreateInfo* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkSamplerCreateInfo*)pool->alloc(sizeof(const VkSamplerCreateInfo));
+        deepcopy_VkSamplerCreateInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                     (VkSamplerCreateInfo*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkSamplerCreateInfo(sResourceTracker,
+                                             (VkSamplerCreateInfo*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkSamplerCreateInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                  (VkSamplerCreateInfo*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateSampler = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateSampler);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateSampler);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateSampler = OP_vkCreateSampler;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateSampler, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateSampler, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkSamplerCreateInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkSamplerCreateInfo*)(local_pCreateInfo), streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pSampler));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCreateSampler), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkSampler(&cgen_var_3, (VkSampler*)pSampler, 1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateSampler_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateSampler_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateSampler_VkResult_return;
+}
+
+void VkEncoder::vkDestroySampler(VkDevice device, VkSampler sampler,
+                                 const VkAllocationCallbacks* pAllocator, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroySampler in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroySampler(device:%p, sampler:%p, pAllocator:%p)", device, sampler,
+                      pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSampler local_sampler;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_sampler = sampler;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroySampler = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDestroySampler);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroySampler);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroySampler = OP_vkDestroySampler;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroySampler, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroySampler, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkSampler((*&local_sampler));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkDestroySampler), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkSampler((VkSampler*)&sampler);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkCreateDescriptorSetLayout(VkDevice device,
+                                                const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
+                                                const VkAllocationCallbacks* pAllocator,
+                                                VkDescriptorSetLayout* pSetLayout,
+                                                uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateDescriptorSetLayout in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateDescriptorSetLayout(device:%p, pCreateInfo:%p, pAllocator:%p, pSetLayout:%p)",
+        device, pCreateInfo, pAllocator, pSetLayout);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDescriptorSetLayoutCreateInfo* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkDescriptorSetLayoutCreateInfo*)pool->alloc(
+            sizeof(const VkDescriptorSetLayoutCreateInfo));
+        deepcopy_VkDescriptorSetLayoutCreateInfo(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+            (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkDescriptorSetLayoutCreateInfo(
+            sResourceTracker, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDescriptorSetLayoutCreateInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo),
+                                              countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateDescriptorSetLayout =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateDescriptorSetLayout);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateDescriptorSetLayout);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateDescriptorSetLayout = OP_vkCreateDescriptorSetLayout;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateDescriptorSetLayout, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateDescriptorSetLayout, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDescriptorSetLayoutCreateInfo(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo),
+        streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pSetLayout));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateDescriptorSetLayout), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkDescriptorSetLayout(
+        &cgen_var_3, (VkDescriptorSetLayout*)pSetLayout, 1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateDescriptorSetLayout_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateDescriptorSetLayout_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateDescriptorSetLayout_VkResult_return;
+}
+
+void VkEncoder::vkDestroyDescriptorSetLayout(VkDevice device,
+                                             VkDescriptorSetLayout descriptorSetLayout,
+                                             const VkAllocationCallbacks* pAllocator,
+                                             uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyDescriptorSetLayout in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkDestroyDescriptorSetLayout(device:%p, descriptorSetLayout:%p, pAllocator:%p)", device,
+        descriptorSetLayout, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDescriptorSetLayout local_descriptorSetLayout;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_descriptorSetLayout = descriptorSetLayout;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyDescriptorSetLayout =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkDestroyDescriptorSetLayout);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyDescriptorSetLayout);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyDescriptorSetLayout = OP_vkDestroyDescriptorSetLayout;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyDescriptorSetLayout, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyDescriptorSetLayout, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDescriptorSetLayout((*&local_descriptorSetLayout));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroyDescriptorSetLayout), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkDescriptorSetLayout(
+        (VkDescriptorSetLayout*)&descriptorSetLayout);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkCreateDescriptorPool(VkDevice device,
+                                           const VkDescriptorPoolCreateInfo* pCreateInfo,
+                                           const VkAllocationCallbacks* pAllocator,
+                                           VkDescriptorPool* pDescriptorPool, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateDescriptorPool in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateDescriptorPool(device:%p, pCreateInfo:%p, pAllocator:%p, pDescriptorPool:%p)",
+        device, pCreateInfo, pAllocator, pDescriptorPool);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDescriptorPoolCreateInfo* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo =
+            (VkDescriptorPoolCreateInfo*)pool->alloc(sizeof(const VkDescriptorPoolCreateInfo));
+        deepcopy_VkDescriptorPoolCreateInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                            (VkDescriptorPoolCreateInfo*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkDescriptorPoolCreateInfo(
+            sResourceTracker, (VkDescriptorPoolCreateInfo*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDescriptorPoolCreateInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkDescriptorPoolCreateInfo*)(local_pCreateInfo),
+                                         countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateDescriptorPool =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateDescriptorPool);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateDescriptorPool);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateDescriptorPool = OP_vkCreateDescriptorPool;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateDescriptorPool, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateDescriptorPool, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDescriptorPoolCreateInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                               (VkDescriptorPoolCreateInfo*)(local_pCreateInfo),
+                                               streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pDescriptorPool));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateDescriptorPool), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkDescriptorPool(&cgen_var_3,
+                                                             (VkDescriptorPool*)pDescriptorPool, 1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateDescriptorPool_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateDescriptorPool_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateDescriptorPool_VkResult_return;
+}
+
+void VkEncoder::vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool,
+                                        const VkAllocationCallbacks* pAllocator, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyDescriptorPool in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroyDescriptorPool(device:%p, descriptorPool:%p, pAllocator:%p)",
+                      device, descriptorPool, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDescriptorPool local_descriptorPool;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_descriptorPool = descriptorPool;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyDescriptorPool =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDestroyDescriptorPool);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyDescriptorPool);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyDescriptorPool = OP_vkDestroyDescriptorPool;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyDescriptorPool, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyDescriptorPool, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDescriptorPool((*&local_descriptorPool));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroyDescriptorPool), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkDescriptorPool(
+        (VkDescriptorPool*)&descriptorPool);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool,
+                                          VkDescriptorPoolResetFlags flags, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkResetDescriptorPool in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkResetDescriptorPool(device:%p, descriptorPool:%p, flags:%d)", device,
+                      descriptorPool, flags);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDescriptorPool local_descriptorPool;
+    VkDescriptorPoolResetFlags local_flags;
+    local_device = device;
+    local_descriptorPool = descriptorPool;
+    local_flags = flags;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDescriptorPoolResetFlags);
+    }
+    uint32_t packetSize_vkResetDescriptorPool =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkResetDescriptorPool);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkResetDescriptorPool);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkResetDescriptorPool = OP_vkResetDescriptorPool;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkResetDescriptorPool, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkResetDescriptorPool, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDescriptorPool((*&local_descriptorPool));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDescriptorPoolResetFlags*)&local_flags,
+           sizeof(VkDescriptorPoolResetFlags));
+    *streamPtrPtr += sizeof(VkDescriptorPoolResetFlags);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkResetDescriptorPool), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkResetDescriptorPool_VkResult_return = (VkResult)0;
+    stream->read(&vkResetDescriptorPool_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkResetDescriptorPool_VkResult_return;
+}
+
+VkResult VkEncoder::vkAllocateDescriptorSets(VkDevice device,
+                                             const VkDescriptorSetAllocateInfo* pAllocateInfo,
+                                             VkDescriptorSet* pDescriptorSets, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkAllocateDescriptorSets in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkAllocateDescriptorSets(device:%p, pAllocateInfo:%p, pDescriptorSets:%p)",
+                      device, pAllocateInfo, pDescriptorSets);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDescriptorSetAllocateInfo* local_pAllocateInfo;
+    local_device = device;
+    local_pAllocateInfo = nullptr;
+    if (pAllocateInfo) {
+        local_pAllocateInfo =
+            (VkDescriptorSetAllocateInfo*)pool->alloc(sizeof(const VkDescriptorSetAllocateInfo));
+        deepcopy_VkDescriptorSetAllocateInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocateInfo,
+                                             (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo));
+    }
+    if (local_pAllocateInfo) {
+        transform_tohost_VkDescriptorSetAllocateInfo(
+            sResourceTracker, (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDescriptorSetAllocateInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo),
+                                          countPtr);
+        if (pAllocateInfo->descriptorSetCount) {
+            *countPtr += pAllocateInfo->descriptorSetCount * 8;
+        }
+    }
+    uint32_t packetSize_vkAllocateDescriptorSets =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkAllocateDescriptorSets);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkAllocateDescriptorSets);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkAllocateDescriptorSets = OP_vkAllocateDescriptorSets;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkAllocateDescriptorSets, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkAllocateDescriptorSets, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDescriptorSetAllocateInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo),
+                                                streamPtrPtr);
+    /* is handle, possibly out */;
+    if (pAllocateInfo->descriptorSetCount) {
+        uint8_t* cgen_var_1_ptr = (uint8_t*)(*streamPtrPtr);
+        for (uint32_t k = 0; k < pAllocateInfo->descriptorSetCount; ++k) {
+            uint64_t tmpval = (uint64_t)(pDescriptorSets[k]);
+            memcpy(cgen_var_1_ptr + k * 8, &tmpval, sizeof(uint64_t));
+        }
+        *streamPtrPtr += 8 * pAllocateInfo->descriptorSetCount;
+    }
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkAllocateDescriptorSets), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    if (pAllocateInfo->descriptorSetCount) {
+        uint64_t* cgen_var_2;
+        stream->alloc((void**)&cgen_var_2, pAllocateInfo->descriptorSetCount * 8);
+        stream->read((uint64_t*)cgen_var_2, pAllocateInfo->descriptorSetCount * 8);
+        stream->handleMapping()->mapHandles_u64_VkDescriptorSet(
+            cgen_var_2, (VkDescriptorSet*)pDescriptorSets, pAllocateInfo->descriptorSetCount);
+    }
+    stream->unsetHandleMapping();
+    VkResult vkAllocateDescriptorSets_VkResult_return = (VkResult)0;
+    stream->read(&vkAllocateDescriptorSets_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkAllocateDescriptorSets_VkResult_return;
+}
+
+VkResult VkEncoder::vkFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool,
+                                         uint32_t descriptorSetCount,
+                                         const VkDescriptorSet* pDescriptorSets, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkFreeDescriptorSets in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkFreeDescriptorSets(device:%p, descriptorPool:%p, descriptorSetCount:%d, "
+        "pDescriptorSets:%p)",
+        device, descriptorPool, descriptorSetCount, pDescriptorSets);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDescriptorPool local_descriptorPool;
+    uint32_t local_descriptorSetCount;
+    VkDescriptorSet* local_pDescriptorSets;
+    local_device = device;
+    local_descriptorPool = descriptorPool;
+    local_descriptorSetCount = descriptorSetCount;
+    // Avoiding deepcopy for pDescriptorSets
+    local_pDescriptorSets = (VkDescriptorSet*)pDescriptorSets;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pDescriptorSets) {
+            if (((descriptorSetCount))) {
+                *countPtr += ((descriptorSetCount)) * 8;
+            }
+        }
+    }
+    uint32_t packetSize_vkFreeDescriptorSets =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkFreeDescriptorSets);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkFreeDescriptorSets);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkFreeDescriptorSets = OP_vkFreeDescriptorSets;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkFreeDescriptorSets, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkFreeDescriptorSets, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDescriptorPool((*&local_descriptorPool));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_descriptorSetCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pDescriptorSets;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pDescriptorSets) {
+        if (((descriptorSetCount))) {
+            uint8_t* cgen_var_2_0_ptr = (uint8_t*)(*streamPtrPtr);
+            for (uint32_t k = 0; k < ((descriptorSetCount)); ++k) {
+                uint64_t tmpval = get_host_u64_VkDescriptorSet(local_pDescriptorSets[k]);
+                memcpy(cgen_var_2_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+            }
+            *streamPtrPtr += 8 * ((descriptorSetCount));
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkFreeDescriptorSets), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkFreeDescriptorSets_VkResult_return = (VkResult)0;
+    stream->read(&vkFreeDescriptorSets_VkResult_return, sizeof(VkResult));
+    if (pDescriptorSets) {
+        sResourceTracker->destroyMapping()->mapHandles_VkDescriptorSet(
+            (VkDescriptorSet*)pDescriptorSets, ((descriptorSetCount)));
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkFreeDescriptorSets_VkResult_return;
+}
+
+void VkEncoder::vkUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount,
+                                       const VkWriteDescriptorSet* pDescriptorWrites,
+                                       uint32_t descriptorCopyCount,
+                                       const VkCopyDescriptorSet* pDescriptorCopies,
+                                       uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkUpdateDescriptorSets in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkUpdateDescriptorSets(device:%p, descriptorWriteCount:%d, pDescriptorWrites:%p, "
+        "descriptorCopyCount:%d, pDescriptorCopies:%p)",
+        device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, pDescriptorCopies);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    uint32_t local_descriptorWriteCount;
+    VkWriteDescriptorSet* local_pDescriptorWrites;
+    uint32_t local_descriptorCopyCount;
+    VkCopyDescriptorSet* local_pDescriptorCopies;
+    local_device = device;
+    local_descriptorWriteCount = descriptorWriteCount;
+    local_pDescriptorWrites = nullptr;
+    if (pDescriptorWrites) {
+        local_pDescriptorWrites = (VkWriteDescriptorSet*)pool->alloc(
+            ((descriptorWriteCount)) * sizeof(const VkWriteDescriptorSet));
+        for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) {
+            deepcopy_VkWriteDescriptorSet(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pDescriptorWrites + i,
+                                          (VkWriteDescriptorSet*)(local_pDescriptorWrites + i));
+        }
+    }
+    local_descriptorCopyCount = descriptorCopyCount;
+    local_pDescriptorCopies = nullptr;
+    if (pDescriptorCopies) {
+        local_pDescriptorCopies = (VkCopyDescriptorSet*)pool->alloc(
+            ((descriptorCopyCount)) * sizeof(const VkCopyDescriptorSet));
+        for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i) {
+            deepcopy_VkCopyDescriptorSet(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pDescriptorCopies + i,
+                                         (VkCopyDescriptorSet*)(local_pDescriptorCopies + i));
+        }
+    }
+    if (local_pDescriptorWrites) {
+        for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) {
+            transform_tohost_VkWriteDescriptorSet(
+                sResourceTracker, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i));
+        }
+    }
+    if (local_pDescriptorCopies) {
+        for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i) {
+            transform_tohost_VkCopyDescriptorSet(
+                sResourceTracker, (VkCopyDescriptorSet*)(local_pDescriptorCopies + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) {
+            count_VkWriteDescriptorSet(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkWriteDescriptorSet*)(local_pDescriptorWrites + i),
+                                       countPtr);
+        }
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i) {
+            count_VkCopyDescriptorSet(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                      (VkCopyDescriptorSet*)(local_pDescriptorCopies + i),
+                                      countPtr);
+        }
+    }
+    uint32_t packetSize_vkUpdateDescriptorSets =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkUpdateDescriptorSets);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkUpdateDescriptorSets);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkUpdateDescriptorSets = OP_vkUpdateDescriptorSets;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkUpdateDescriptorSets, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkUpdateDescriptorSets, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) {
+        reservedmarshal_VkWriteDescriptorSet(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                             (VkWriteDescriptorSet*)(local_pDescriptorWrites + i),
+                                             streamPtrPtr);
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_descriptorCopyCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i) {
+        reservedmarshal_VkCopyDescriptorSet(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                            (VkCopyDescriptorSet*)(local_pDescriptorCopies + i),
+                                            streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkUpdateDescriptorSets), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo,
+                                        const VkAllocationCallbacks* pAllocator,
+                                        VkFramebuffer* pFramebuffer, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateFramebuffer in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateFramebuffer(device:%p, pCreateInfo:%p, pAllocator:%p, pFramebuffer:%p)", device,
+        pCreateInfo, pAllocator, pFramebuffer);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkFramebufferCreateInfo* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo =
+            (VkFramebufferCreateInfo*)pool->alloc(sizeof(const VkFramebufferCreateInfo));
+        deepcopy_VkFramebufferCreateInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                         (VkFramebufferCreateInfo*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkFramebufferCreateInfo(sResourceTracker,
+                                                 (VkFramebufferCreateInfo*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkFramebufferCreateInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                      (VkFramebufferCreateInfo*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateFramebuffer =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateFramebuffer);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateFramebuffer);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateFramebuffer = OP_vkCreateFramebuffer;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateFramebuffer, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateFramebuffer, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkFramebufferCreateInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                            (VkFramebufferCreateInfo*)(local_pCreateInfo),
+                                            streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pFramebuffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateFramebuffer), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkFramebuffer(&cgen_var_3, (VkFramebuffer*)pFramebuffer,
+                                                          1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateFramebuffer_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateFramebuffer_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateFramebuffer_VkResult_return;
+}
+
+void VkEncoder::vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer,
+                                     const VkAllocationCallbacks* pAllocator, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyFramebuffer in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroyFramebuffer(device:%p, framebuffer:%p, pAllocator:%p)", device,
+                      framebuffer, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkFramebuffer local_framebuffer;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_framebuffer = framebuffer;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyFramebuffer =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDestroyFramebuffer);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyFramebuffer);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyFramebuffer = OP_vkDestroyFramebuffer;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyFramebuffer, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyFramebuffer, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkFramebuffer((*&local_framebuffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroyFramebuffer), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkFramebuffer((VkFramebuffer*)&framebuffer);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo,
+                                       const VkAllocationCallbacks* pAllocator,
+                                       VkRenderPass* pRenderPass, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateRenderPass in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateRenderPass(device:%p, pCreateInfo:%p, pAllocator:%p, pRenderPass:%p)", device,
+        pCreateInfo, pAllocator, pRenderPass);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkRenderPassCreateInfo* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo =
+            (VkRenderPassCreateInfo*)pool->alloc(sizeof(const VkRenderPassCreateInfo));
+        deepcopy_VkRenderPassCreateInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                        (VkRenderPassCreateInfo*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkRenderPassCreateInfo(sResourceTracker,
+                                                (VkRenderPassCreateInfo*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkRenderPassCreateInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                     (VkRenderPassCreateInfo*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateRenderPass =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateRenderPass);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateRenderPass);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateRenderPass = OP_vkCreateRenderPass;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateRenderPass, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateRenderPass, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkRenderPassCreateInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                           (VkRenderPassCreateInfo*)(local_pCreateInfo),
+                                           streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pRenderPass));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateRenderPass), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkRenderPass(&cgen_var_3, (VkRenderPass*)pRenderPass,
+                                                         1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateRenderPass_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateRenderPass_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateRenderPass_VkResult_return;
+}
+
+void VkEncoder::vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass,
+                                    const VkAllocationCallbacks* pAllocator, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyRenderPass in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroyRenderPass(device:%p, renderPass:%p, pAllocator:%p)", device,
+                      renderPass, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkRenderPass local_renderPass;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_renderPass = renderPass;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyRenderPass =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDestroyRenderPass);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyRenderPass);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyRenderPass = OP_vkDestroyRenderPass;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyRenderPass, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyRenderPass, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkRenderPass((*&local_renderPass));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroyRenderPass), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkRenderPass((VkRenderPass*)&renderPass);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass,
+                                           VkExtent2D* pGranularity, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetRenderAreaGranularity in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetRenderAreaGranularity(device:%p, renderPass:%p, pGranularity:%p)",
+                      device, renderPass, pGranularity);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkRenderPass local_renderPass;
+    local_device = device;
+    local_renderPass = renderPass;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        count_VkExtent2D(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM, (VkExtent2D*)(pGranularity),
+                         countPtr);
+    }
+    uint32_t packetSize_vkGetRenderAreaGranularity =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetRenderAreaGranularity);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetRenderAreaGranularity);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetRenderAreaGranularity = OP_vkGetRenderAreaGranularity;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetRenderAreaGranularity, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetRenderAreaGranularity, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkRenderPass((*&local_renderPass));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkExtent2D(stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkExtent2D*)(pGranularity),
+                               streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetRenderAreaGranularity), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkExtent2D(stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkExtent2D*)(pGranularity));
+    if (pGranularity) {
+        transform_fromhost_VkExtent2D(sResourceTracker, (VkExtent2D*)(pGranularity));
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo,
+                                        const VkAllocationCallbacks* pAllocator,
+                                        VkCommandPool* pCommandPool, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateCommandPool in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateCommandPool(device:%p, pCreateInfo:%p, pAllocator:%p, pCommandPool:%p)", device,
+        pCreateInfo, pAllocator, pCommandPool);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkCommandPoolCreateInfo* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo =
+            (VkCommandPoolCreateInfo*)pool->alloc(sizeof(const VkCommandPoolCreateInfo));
+        deepcopy_VkCommandPoolCreateInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                         (VkCommandPoolCreateInfo*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkCommandPoolCreateInfo(sResourceTracker,
+                                                 (VkCommandPoolCreateInfo*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkCommandPoolCreateInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                      (VkCommandPoolCreateInfo*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateCommandPool =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateCommandPool);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateCommandPool);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateCommandPool = OP_vkCreateCommandPool;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateCommandPool, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateCommandPool, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkCommandPoolCreateInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                            (VkCommandPoolCreateInfo*)(local_pCreateInfo),
+                                            streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pCommandPool));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateCommandPool), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkCommandPool(&cgen_var_3, (VkCommandPool*)pCommandPool,
+                                                          1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateCommandPool_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateCommandPool_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateCommandPool_VkResult_return;
+}
+
+void VkEncoder::vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool,
+                                     const VkAllocationCallbacks* pAllocator, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyCommandPool in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroyCommandPool(device:%p, commandPool:%p, pAllocator:%p)", device,
+                      commandPool, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkCommandPool local_commandPool;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_commandPool = commandPool;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyCommandPool =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDestroyCommandPool);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyCommandPool);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyCommandPool = OP_vkDestroyCommandPool;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyCommandPool, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyCommandPool, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkCommandPool((*&local_commandPool));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroyCommandPool), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkCommandPool((VkCommandPool*)&commandPool);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkResetCommandPool(VkDevice device, VkCommandPool commandPool,
+                                       VkCommandPoolResetFlags flags, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkResetCommandPool in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkResetCommandPool(device:%p, commandPool:%p, flags:%d)", device,
+                      commandPool, flags);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkCommandPool local_commandPool;
+    VkCommandPoolResetFlags local_flags;
+    local_device = device;
+    local_commandPool = commandPool;
+    local_flags = flags;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkCommandPoolResetFlags);
+    }
+    uint32_t packetSize_vkResetCommandPool =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkResetCommandPool);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkResetCommandPool);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkResetCommandPool = OP_vkResetCommandPool;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkResetCommandPool, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkResetCommandPool, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkCommandPool((*&local_commandPool));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkCommandPoolResetFlags*)&local_flags, sizeof(VkCommandPoolResetFlags));
+    *streamPtrPtr += sizeof(VkCommandPoolResetFlags);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkResetCommandPool), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkResetCommandPool_VkResult_return = (VkResult)0;
+    stream->read(&vkResetCommandPool_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkResetCommandPool_VkResult_return;
+}
+
+VkResult VkEncoder::vkAllocateCommandBuffers(VkDevice device,
+                                             const VkCommandBufferAllocateInfo* pAllocateInfo,
+                                             VkCommandBuffer* pCommandBuffers, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkAllocateCommandBuffers in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkAllocateCommandBuffers(device:%p, pAllocateInfo:%p, pCommandBuffers:%p)",
+                      device, pAllocateInfo, pCommandBuffers);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkCommandBufferAllocateInfo* local_pAllocateInfo;
+    local_device = device;
+    local_pAllocateInfo = nullptr;
+    if (pAllocateInfo) {
+        local_pAllocateInfo =
+            (VkCommandBufferAllocateInfo*)pool->alloc(sizeof(const VkCommandBufferAllocateInfo));
+        deepcopy_VkCommandBufferAllocateInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocateInfo,
+                                             (VkCommandBufferAllocateInfo*)(local_pAllocateInfo));
+    }
+    if (local_pAllocateInfo) {
+        transform_tohost_VkCommandBufferAllocateInfo(
+            sResourceTracker, (VkCommandBufferAllocateInfo*)(local_pAllocateInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkCommandBufferAllocateInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkCommandBufferAllocateInfo*)(local_pAllocateInfo),
+                                          countPtr);
+        if (pAllocateInfo->commandBufferCount) {
+            *countPtr += pAllocateInfo->commandBufferCount * 8;
+        }
+    }
+    uint32_t packetSize_vkAllocateCommandBuffers =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkAllocateCommandBuffers);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkAllocateCommandBuffers);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkAllocateCommandBuffers = OP_vkAllocateCommandBuffers;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkAllocateCommandBuffers, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkAllocateCommandBuffers, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkCommandBufferAllocateInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                (VkCommandBufferAllocateInfo*)(local_pAllocateInfo),
+                                                streamPtrPtr);
+    /* is handle, possibly out */;
+    if (pAllocateInfo->commandBufferCount) {
+        uint8_t* cgen_var_1_ptr = (uint8_t*)(*streamPtrPtr);
+        for (uint32_t k = 0; k < pAllocateInfo->commandBufferCount; ++k) {
+            uint64_t tmpval = (uint64_t)(pCommandBuffers[k]);
+            memcpy(cgen_var_1_ptr + k * 8, &tmpval, sizeof(uint64_t));
+        }
+        *streamPtrPtr += 8 * pAllocateInfo->commandBufferCount;
+    }
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkAllocateCommandBuffers), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    if (pAllocateInfo->commandBufferCount) {
+        uint64_t* cgen_var_2;
+        stream->alloc((void**)&cgen_var_2, pAllocateInfo->commandBufferCount * 8);
+        stream->read((uint64_t*)cgen_var_2, pAllocateInfo->commandBufferCount * 8);
+        stream->handleMapping()->mapHandles_u64_VkCommandBuffer(
+            cgen_var_2, (VkCommandBuffer*)pCommandBuffers, pAllocateInfo->commandBufferCount);
+    }
+    stream->unsetHandleMapping();
+    VkResult vkAllocateCommandBuffers_VkResult_return = (VkResult)0;
+    stream->read(&vkAllocateCommandBuffers_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkAllocateCommandBuffers_VkResult_return;
+}
+
+void VkEncoder::vkFreeCommandBuffers(VkDevice device, VkCommandPool commandPool,
+                                     uint32_t commandBufferCount,
+                                     const VkCommandBuffer* pCommandBuffers, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkFreeCommandBuffers in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkFreeCommandBuffers(device:%p, commandPool:%p, commandBufferCount:%d, "
+        "pCommandBuffers:%p)",
+        device, commandPool, commandBufferCount, pCommandBuffers);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkCommandPool local_commandPool;
+    uint32_t local_commandBufferCount;
+    VkCommandBuffer* local_pCommandBuffers;
+    local_device = device;
+    local_commandPool = commandPool;
+    local_commandBufferCount = commandBufferCount;
+    // Avoiding deepcopy for pCommandBuffers
+    local_pCommandBuffers = (VkCommandBuffer*)pCommandBuffers;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pCommandBuffers) {
+            if (((commandBufferCount))) {
+                *countPtr += ((commandBufferCount)) * 8;
+            }
+        }
+    }
+    uint32_t packetSize_vkFreeCommandBuffers =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkFreeCommandBuffers);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkFreeCommandBuffers);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkFreeCommandBuffers = OP_vkFreeCommandBuffers;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkFreeCommandBuffers, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkFreeCommandBuffers, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkCommandPool((*&local_commandPool));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_commandBufferCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pCommandBuffers;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pCommandBuffers) {
+        if (((commandBufferCount))) {
+            uint8_t* cgen_var_2_0_ptr = (uint8_t*)(*streamPtrPtr);
+            for (uint32_t k = 0; k < ((commandBufferCount)); ++k) {
+                uint64_t tmpval = get_host_u64_VkCommandBuffer(local_pCommandBuffers[k]);
+                memcpy(cgen_var_2_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+            }
+            *streamPtrPtr += 8 * ((commandBufferCount));
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkFreeCommandBuffers), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    if (pCommandBuffers) {
+        sResourceTracker->destroyMapping()->mapHandles_VkCommandBuffer(
+            (VkCommandBuffer*)pCommandBuffers, ((commandBufferCount)));
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkBeginCommandBuffer(VkCommandBuffer commandBuffer,
+                                         const VkCommandBufferBeginInfo* pBeginInfo,
+                                         uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkBeginCommandBuffer in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkBeginCommandBuffer(commandBuffer:%p, pBeginInfo:%p)", commandBuffer,
+                      pBeginInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkCommandBufferBeginInfo* local_pBeginInfo;
+    local_commandBuffer = commandBuffer;
+    local_pBeginInfo = nullptr;
+    if (pBeginInfo) {
+        local_pBeginInfo =
+            (VkCommandBufferBeginInfo*)pool->alloc(sizeof(const VkCommandBufferBeginInfo));
+        deepcopy_VkCommandBufferBeginInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pBeginInfo,
+                                          (VkCommandBufferBeginInfo*)(local_pBeginInfo));
+    }
+    if (local_pBeginInfo) {
+        transform_tohost_VkCommandBufferBeginInfo(sResourceTracker,
+                                                  (VkCommandBufferBeginInfo*)(local_pBeginInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkCommandBufferBeginInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkCommandBufferBeginInfo*)(local_pBeginInfo), countPtr);
+    }
+    uint32_t packetSize_vkBeginCommandBuffer = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkBeginCommandBuffer);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkBeginCommandBuffer -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkBeginCommandBuffer);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkBeginCommandBuffer = OP_vkBeginCommandBuffer;
+    memcpy(streamPtr, &opcode_vkBeginCommandBuffer, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkBeginCommandBuffer, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkCommandBufferBeginInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                             (VkCommandBufferBeginInfo*)(local_pBeginInfo),
+                                             streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkBeginCommandBuffer), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkBeginCommandBuffer_VkResult_return = (VkResult)0;
+    stream->read(&vkBeginCommandBuffer_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkBeginCommandBuffer_VkResult_return;
+}
+
+VkResult VkEncoder::vkEndCommandBuffer(VkCommandBuffer commandBuffer, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkEndCommandBuffer in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkEndCommandBuffer(commandBuffer:%p)", commandBuffer);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    local_commandBuffer = commandBuffer;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkEndCommandBuffer = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkEndCommandBuffer);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkEndCommandBuffer -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkEndCommandBuffer);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkEndCommandBuffer = OP_vkEndCommandBuffer;
+    memcpy(streamPtr, &opcode_vkEndCommandBuffer, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkEndCommandBuffer, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkEndCommandBuffer), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkEndCommandBuffer_VkResult_return = (VkResult)0;
+    stream->read(&vkEndCommandBuffer_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkEndCommandBuffer_VkResult_return;
+}
+
+VkResult VkEncoder::vkResetCommandBuffer(VkCommandBuffer commandBuffer,
+                                         VkCommandBufferResetFlags flags, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkResetCommandBuffer in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkResetCommandBuffer(commandBuffer:%p, flags:%d)", commandBuffer, flags);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkCommandBufferResetFlags local_flags;
+    local_commandBuffer = commandBuffer;
+    local_flags = flags;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkCommandBufferResetFlags);
+    }
+    uint32_t packetSize_vkResetCommandBuffer = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkResetCommandBuffer);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkResetCommandBuffer -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkResetCommandBuffer);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkResetCommandBuffer = OP_vkResetCommandBuffer;
+    memcpy(streamPtr, &opcode_vkResetCommandBuffer, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkResetCommandBuffer, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkCommandBufferResetFlags*)&local_flags,
+           sizeof(VkCommandBufferResetFlags));
+    *streamPtrPtr += sizeof(VkCommandBufferResetFlags);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkResetCommandBuffer), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkResetCommandBuffer_VkResult_return = (VkResult)0;
+    stream->read(&vkResetCommandBuffer_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkResetCommandBuffer_VkResult_return;
+}
+
+void VkEncoder::vkCmdBindPipeline(VkCommandBuffer commandBuffer,
+                                  VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline,
+                                  uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdBindPipeline in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdBindPipeline(commandBuffer:%p, pipeline:%p)", commandBuffer, pipeline);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkPipelineBindPoint local_pipelineBindPoint;
+    VkPipeline local_pipeline;
+    local_commandBuffer = commandBuffer;
+    local_pipelineBindPoint = pipelineBindPoint;
+    local_pipeline = pipeline;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkPipelineBindPoint);
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkCmdBindPipeline = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdBindPipeline);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdBindPipeline -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdBindPipeline);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdBindPipeline = OP_vkCmdBindPipeline;
+    memcpy(streamPtr, &opcode_vkCmdBindPipeline, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdBindPipeline, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkPipelineBindPoint*)&local_pipelineBindPoint,
+           sizeof(VkPipelineBindPoint));
+    *streamPtrPtr += sizeof(VkPipelineBindPoint);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPipeline((*&local_pipeline));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdBindPipeline), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport,
+                                 uint32_t viewportCount, const VkViewport* pViewports,
+                                 uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetViewport in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdSetViewport(commandBuffer:%p, firstViewport:%d, viewportCount:%d, pViewports:%p)",
+        commandBuffer, firstViewport, viewportCount, pViewports);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_firstViewport;
+    uint32_t local_viewportCount;
+    VkViewport* local_pViewports;
+    local_commandBuffer = commandBuffer;
+    local_firstViewport = firstViewport;
+    local_viewportCount = viewportCount;
+    local_pViewports = nullptr;
+    if (pViewports) {
+        local_pViewports = (VkViewport*)pool->alloc(((viewportCount)) * sizeof(const VkViewport));
+        for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) {
+            deepcopy_VkViewport(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pViewports + i,
+                                (VkViewport*)(local_pViewports + i));
+        }
+    }
+    if (local_pViewports) {
+        for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) {
+            transform_tohost_VkViewport(sResourceTracker, (VkViewport*)(local_pViewports + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) {
+            count_VkViewport(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                             (VkViewport*)(local_pViewports + i), countPtr);
+        }
+    }
+    uint32_t packetSize_vkCmdSetViewport = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetViewport);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetViewport -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetViewport);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetViewport = OP_vkCmdSetViewport;
+    memcpy(streamPtr, &opcode_vkCmdSetViewport, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetViewport, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstViewport, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_viewportCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) {
+        reservedmarshal_VkViewport(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                   (VkViewport*)(local_pViewports + i), streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdSetViewport), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor,
+                                uint32_t scissorCount, const VkRect2D* pScissors, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetScissor in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdSetScissor(commandBuffer:%p, firstScissor:%d, scissorCount:%d, pScissors:%p)",
+        commandBuffer, firstScissor, scissorCount, pScissors);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_firstScissor;
+    uint32_t local_scissorCount;
+    VkRect2D* local_pScissors;
+    local_commandBuffer = commandBuffer;
+    local_firstScissor = firstScissor;
+    local_scissorCount = scissorCount;
+    local_pScissors = nullptr;
+    if (pScissors) {
+        local_pScissors = (VkRect2D*)pool->alloc(((scissorCount)) * sizeof(const VkRect2D));
+        for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) {
+            deepcopy_VkRect2D(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pScissors + i,
+                              (VkRect2D*)(local_pScissors + i));
+        }
+    }
+    if (local_pScissors) {
+        for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) {
+            transform_tohost_VkRect2D(sResourceTracker, (VkRect2D*)(local_pScissors + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) {
+            count_VkRect2D(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                           (VkRect2D*)(local_pScissors + i), countPtr);
+        }
+    }
+    uint32_t packetSize_vkCmdSetScissor = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetScissor);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetScissor -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetScissor);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetScissor = OP_vkCmdSetScissor;
+    memcpy(streamPtr, &opcode_vkCmdSetScissor, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetScissor, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstScissor, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_scissorCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) {
+        reservedmarshal_VkRect2D(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                 (VkRect2D*)(local_pScissors + i), streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdSetScissor), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetLineWidth in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdSetLineWidth(commandBuffer:%p, lineWidth:%f)", commandBuffer,
+                      lineWidth);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    float local_lineWidth;
+    local_commandBuffer = commandBuffer;
+    local_lineWidth = lineWidth;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(float);
+    }
+    uint32_t packetSize_vkCmdSetLineWidth = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetLineWidth);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetLineWidth -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetLineWidth);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetLineWidth = OP_vkCmdSetLineWidth;
+    memcpy(streamPtr, &opcode_vkCmdSetLineWidth, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetLineWidth, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (float*)&local_lineWidth, sizeof(float));
+    *streamPtrPtr += sizeof(float);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdSetLineWidth), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor,
+                                  float depthBiasClamp, float depthBiasSlopeFactor,
+                                  uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetDepthBias in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdSetDepthBias(commandBuffer:%p, depthBiasConstantFactor:%f, depthBiasClamp:%f, "
+        "depthBiasSlopeFactor:%f)",
+        commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    float local_depthBiasConstantFactor;
+    float local_depthBiasClamp;
+    float local_depthBiasSlopeFactor;
+    local_commandBuffer = commandBuffer;
+    local_depthBiasConstantFactor = depthBiasConstantFactor;
+    local_depthBiasClamp = depthBiasClamp;
+    local_depthBiasSlopeFactor = depthBiasSlopeFactor;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(float);
+        *countPtr += sizeof(float);
+        *countPtr += sizeof(float);
+    }
+    uint32_t packetSize_vkCmdSetDepthBias = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetDepthBias);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetDepthBias -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetDepthBias);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetDepthBias = OP_vkCmdSetDepthBias;
+    memcpy(streamPtr, &opcode_vkCmdSetDepthBias, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetDepthBias, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (float*)&local_depthBiasConstantFactor, sizeof(float));
+    *streamPtrPtr += sizeof(float);
+    memcpy(*streamPtrPtr, (float*)&local_depthBiasClamp, sizeof(float));
+    *streamPtrPtr += sizeof(float);
+    memcpy(*streamPtrPtr, (float*)&local_depthBiasSlopeFactor, sizeof(float));
+    *streamPtrPtr += sizeof(float);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdSetDepthBias), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4],
+                                       uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetBlendConstants in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdSetBlendConstants(commandBuffer:%p, blendConstants:%f)", commandBuffer,
+                      blendConstants);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    float local_blendConstants[4];
+    local_commandBuffer = commandBuffer;
+    memcpy(local_blendConstants, blendConstants, 4 * sizeof(const float));
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += 4 * sizeof(float);
+    }
+    uint32_t packetSize_vkCmdSetBlendConstants = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetBlendConstants);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetBlendConstants -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetBlendConstants);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetBlendConstants = OP_vkCmdSetBlendConstants;
+    memcpy(streamPtr, &opcode_vkCmdSetBlendConstants, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetBlendConstants, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (float*)local_blendConstants, 4 * sizeof(float));
+    *streamPtrPtr += 4 * sizeof(float);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetBlendConstants), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds,
+                                    float maxDepthBounds, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetDepthBounds in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdSetDepthBounds(commandBuffer:%p, minDepthBounds:%f, maxDepthBounds:%f)",
+                      commandBuffer, minDepthBounds, maxDepthBounds);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    float local_minDepthBounds;
+    float local_maxDepthBounds;
+    local_commandBuffer = commandBuffer;
+    local_minDepthBounds = minDepthBounds;
+    local_maxDepthBounds = maxDepthBounds;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(float);
+        *countPtr += sizeof(float);
+    }
+    uint32_t packetSize_vkCmdSetDepthBounds = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetDepthBounds);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetDepthBounds -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetDepthBounds);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetDepthBounds = OP_vkCmdSetDepthBounds;
+    memcpy(streamPtr, &opcode_vkCmdSetDepthBounds, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetDepthBounds, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (float*)&local_minDepthBounds, sizeof(float));
+    *streamPtrPtr += sizeof(float);
+    memcpy(*streamPtrPtr, (float*)&local_maxDepthBounds, sizeof(float));
+    *streamPtrPtr += sizeof(float);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetDepthBounds), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdSetStencilCompareMask(VkCommandBuffer commandBuffer,
+                                           VkStencilFaceFlags faceMask, uint32_t compareMask,
+                                           uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetStencilCompareMask in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdSetStencilCompareMask(commandBuffer:%p, faceMask:%d, compareMask:%d)",
+                      commandBuffer, faceMask, compareMask);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkStencilFaceFlags local_faceMask;
+    uint32_t local_compareMask;
+    local_commandBuffer = commandBuffer;
+    local_faceMask = faceMask;
+    local_compareMask = compareMask;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkStencilFaceFlags);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdSetStencilCompareMask = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetStencilCompareMask);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetStencilCompareMask -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetStencilCompareMask);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetStencilCompareMask = OP_vkCmdSetStencilCompareMask;
+    memcpy(streamPtr, &opcode_vkCmdSetStencilCompareMask, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetStencilCompareMask, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags));
+    *streamPtrPtr += sizeof(VkStencilFaceFlags);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_compareMask, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetStencilCompareMask), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask,
+                                         uint32_t writeMask, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetStencilWriteMask in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdSetStencilWriteMask(commandBuffer:%p, faceMask:%d, writeMask:%d)",
+                      commandBuffer, faceMask, writeMask);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkStencilFaceFlags local_faceMask;
+    uint32_t local_writeMask;
+    local_commandBuffer = commandBuffer;
+    local_faceMask = faceMask;
+    local_writeMask = writeMask;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkStencilFaceFlags);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdSetStencilWriteMask = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetStencilWriteMask);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetStencilWriteMask -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetStencilWriteMask);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetStencilWriteMask = OP_vkCmdSetStencilWriteMask;
+    memcpy(streamPtr, &opcode_vkCmdSetStencilWriteMask, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetStencilWriteMask, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags));
+    *streamPtrPtr += sizeof(VkStencilFaceFlags);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_writeMask, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetStencilWriteMask), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdSetStencilReference(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask,
+                                         uint32_t reference, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetStencilReference in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdSetStencilReference(commandBuffer:%p, faceMask:%d, reference:%d)",
+                      commandBuffer, faceMask, reference);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkStencilFaceFlags local_faceMask;
+    uint32_t local_reference;
+    local_commandBuffer = commandBuffer;
+    local_faceMask = faceMask;
+    local_reference = reference;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkStencilFaceFlags);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdSetStencilReference = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetStencilReference);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetStencilReference -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetStencilReference);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetStencilReference = OP_vkCmdSetStencilReference;
+    memcpy(streamPtr, &opcode_vkCmdSetStencilReference, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetStencilReference, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags));
+    *streamPtrPtr += sizeof(VkStencilFaceFlags);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_reference, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetStencilReference), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdBindDescriptorSets(
+    VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout,
+    uint32_t firstSet, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets,
+    uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdBindDescriptorSets in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdBindDescriptorSets(commandBuffer:%p, layout:%p, firstSet:%d, descriptorSetCount:%d, "
+        "pDescriptorSets:%p, dynamicOffsetCount:%d, pDynamicOffsets:%p)",
+        commandBuffer, layout, firstSet, descriptorSetCount, pDescriptorSets, dynamicOffsetCount,
+        pDynamicOffsets);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkPipelineBindPoint local_pipelineBindPoint;
+    VkPipelineLayout local_layout;
+    uint32_t local_firstSet;
+    uint32_t local_descriptorSetCount;
+    VkDescriptorSet* local_pDescriptorSets;
+    uint32_t local_dynamicOffsetCount;
+    uint32_t* local_pDynamicOffsets;
+    local_commandBuffer = commandBuffer;
+    local_pipelineBindPoint = pipelineBindPoint;
+    local_layout = layout;
+    local_firstSet = firstSet;
+    local_descriptorSetCount = descriptorSetCount;
+    // Avoiding deepcopy for pDescriptorSets
+    local_pDescriptorSets = (VkDescriptorSet*)pDescriptorSets;
+    local_dynamicOffsetCount = dynamicOffsetCount;
+    // Avoiding deepcopy for pDynamicOffsets
+    local_pDynamicOffsets = (uint32_t*)pDynamicOffsets;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkPipelineBindPoint);
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        if (((descriptorSetCount))) {
+            *countPtr += ((descriptorSetCount)) * 8;
+        }
+        *countPtr += sizeof(uint32_t);
+        *countPtr += ((dynamicOffsetCount)) * sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdBindDescriptorSets = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdBindDescriptorSets);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdBindDescriptorSets -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdBindDescriptorSets);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdBindDescriptorSets = OP_vkCmdBindDescriptorSets;
+    memcpy(streamPtr, &opcode_vkCmdBindDescriptorSets, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdBindDescriptorSets, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkPipelineBindPoint*)&local_pipelineBindPoint,
+           sizeof(VkPipelineBindPoint));
+    *streamPtrPtr += sizeof(VkPipelineBindPoint);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPipelineLayout((*&local_layout));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstSet, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_descriptorSetCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (((descriptorSetCount))) {
+        uint8_t* cgen_var_1_ptr = (uint8_t*)(*streamPtrPtr);
+        for (uint32_t k = 0; k < ((descriptorSetCount)); ++k) {
+            uint64_t tmpval = get_host_u64_VkDescriptorSet(local_pDescriptorSets[k]);
+            memcpy(cgen_var_1_ptr + k * 8, &tmpval, sizeof(uint64_t));
+        }
+        *streamPtrPtr += 8 * ((descriptorSetCount));
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_dynamicOffsetCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)local_pDynamicOffsets,
+           ((dynamicOffsetCount)) * sizeof(uint32_t));
+    *streamPtrPtr += ((dynamicOffsetCount)) * sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdBindDescriptorSets), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                     VkDeviceSize offset, VkIndexType indexType, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdBindIndexBuffer in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdBindIndexBuffer(commandBuffer:%p, buffer:%p, offset:%ld)",
+                      commandBuffer, buffer, offset);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkBuffer local_buffer;
+    VkDeviceSize local_offset;
+    VkIndexType local_indexType;
+    local_commandBuffer = commandBuffer;
+    local_buffer = buffer;
+    local_offset = offset;
+    local_indexType = indexType;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        *countPtr += sizeof(VkIndexType);
+    }
+    uint32_t packetSize_vkCmdBindIndexBuffer = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdBindIndexBuffer);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdBindIndexBuffer -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdBindIndexBuffer);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdBindIndexBuffer = OP_vkCmdBindIndexBuffer;
+    memcpy(streamPtr, &opcode_vkCmdBindIndexBuffer, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdBindIndexBuffer, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&local_buffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    memcpy(*streamPtrPtr, (VkIndexType*)&local_indexType, sizeof(VkIndexType));
+    *streamPtrPtr += sizeof(VkIndexType);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdBindIndexBuffer), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding,
+                                       uint32_t bindingCount, const VkBuffer* pBuffers,
+                                       const VkDeviceSize* pOffsets, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdBindVertexBuffers in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdBindVertexBuffers(commandBuffer:%p, firstBinding:%d, bindingCount:%d, pBuffers:%p, "
+        "pOffsets:%p)",
+        commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_firstBinding;
+    uint32_t local_bindingCount;
+    VkBuffer* local_pBuffers;
+    VkDeviceSize* local_pOffsets;
+    local_commandBuffer = commandBuffer;
+    local_firstBinding = firstBinding;
+    local_bindingCount = bindingCount;
+    // Avoiding deepcopy for pBuffers
+    local_pBuffers = (VkBuffer*)pBuffers;
+    // Avoiding deepcopy for pOffsets
+    local_pOffsets = (VkDeviceSize*)pOffsets;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        if (((bindingCount))) {
+            *countPtr += ((bindingCount)) * 8;
+        }
+        *countPtr += ((bindingCount)) * sizeof(VkDeviceSize);
+    }
+    uint32_t packetSize_vkCmdBindVertexBuffers = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdBindVertexBuffers);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdBindVertexBuffers -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdBindVertexBuffers);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdBindVertexBuffers = OP_vkCmdBindVertexBuffers;
+    memcpy(streamPtr, &opcode_vkCmdBindVertexBuffers, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdBindVertexBuffers, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstBinding, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_bindingCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (((bindingCount))) {
+        uint8_t* cgen_var_0_ptr = (uint8_t*)(*streamPtrPtr);
+        for (uint32_t k = 0; k < ((bindingCount)); ++k) {
+            uint64_t tmpval = get_host_u64_VkBuffer(local_pBuffers[k]);
+            memcpy(cgen_var_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+        }
+        *streamPtrPtr += 8 * ((bindingCount));
+    }
+    memcpy(*streamPtrPtr, (VkDeviceSize*)local_pOffsets, ((bindingCount)) * sizeof(VkDeviceSize));
+    *streamPtrPtr += ((bindingCount)) * sizeof(VkDeviceSize);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdBindVertexBuffers), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount,
+                          uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance,
+                          uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdDraw in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdDraw(commandBuffer:%p, vertexCount:%d, instanceCount:%d, firstVertex:%d, "
+        "firstInstance:%d)",
+        commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_vertexCount;
+    uint32_t local_instanceCount;
+    uint32_t local_firstVertex;
+    uint32_t local_firstInstance;
+    local_commandBuffer = commandBuffer;
+    local_vertexCount = vertexCount;
+    local_instanceCount = instanceCount;
+    local_firstVertex = firstVertex;
+    local_firstInstance = firstInstance;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdDraw = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdDraw);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdDraw -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdDraw);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdDraw = OP_vkCmdDraw;
+    memcpy(streamPtr, &opcode_vkCmdDraw, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdDraw, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_vertexCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_instanceCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstVertex, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstInstance, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdDraw), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount,
+                                 uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset,
+                                 uint32_t firstInstance, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdDrawIndexed in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdDrawIndexed(commandBuffer:%p, indexCount:%d, instanceCount:%d, firstIndex:%d, "
+        "vertexOffset:%d, firstInstance:%d)",
+        commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_indexCount;
+    uint32_t local_instanceCount;
+    uint32_t local_firstIndex;
+    int32_t local_vertexOffset;
+    uint32_t local_firstInstance;
+    local_commandBuffer = commandBuffer;
+    local_indexCount = indexCount;
+    local_instanceCount = instanceCount;
+    local_firstIndex = firstIndex;
+    local_vertexOffset = vertexOffset;
+    local_firstInstance = firstInstance;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(int32_t);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdDrawIndexed = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdDrawIndexed);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdDrawIndexed -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdDrawIndexed);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdDrawIndexed = OP_vkCmdDrawIndexed;
+    memcpy(streamPtr, &opcode_vkCmdDrawIndexed, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdDrawIndexed, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_indexCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_instanceCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstIndex, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (int32_t*)&local_vertexOffset, sizeof(int32_t));
+    *streamPtrPtr += sizeof(int32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstInstance, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdDrawIndexed), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                  VkDeviceSize offset, uint32_t drawCount, uint32_t stride,
+                                  uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdDrawIndirect in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdDrawIndirect(commandBuffer:%p, buffer:%p, offset:%ld, drawCount:%d, stride:%d)",
+        commandBuffer, buffer, offset, drawCount, stride);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkBuffer local_buffer;
+    VkDeviceSize local_offset;
+    uint32_t local_drawCount;
+    uint32_t local_stride;
+    local_commandBuffer = commandBuffer;
+    local_buffer = buffer;
+    local_offset = offset;
+    local_drawCount = drawCount;
+    local_stride = stride;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdDrawIndirect = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdDrawIndirect);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdDrawIndirect -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdDrawIndirect);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdDrawIndirect = OP_vkCmdDrawIndirect;
+    memcpy(streamPtr, &opcode_vkCmdDrawIndirect, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdDrawIndirect, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&local_buffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_drawCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_stride, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdDrawIndirect), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                         VkDeviceSize offset, uint32_t drawCount, uint32_t stride,
+                                         uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdDrawIndexedIndirect in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdDrawIndexedIndirect(commandBuffer:%p, buffer:%p, offset:%ld, drawCount:%d, "
+        "stride:%d)",
+        commandBuffer, buffer, offset, drawCount, stride);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkBuffer local_buffer;
+    VkDeviceSize local_offset;
+    uint32_t local_drawCount;
+    uint32_t local_stride;
+    local_commandBuffer = commandBuffer;
+    local_buffer = buffer;
+    local_offset = offset;
+    local_drawCount = drawCount;
+    local_stride = stride;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdDrawIndexedIndirect = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdDrawIndexedIndirect);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdDrawIndexedIndirect -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdDrawIndexedIndirect);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdDrawIndexedIndirect = OP_vkCmdDrawIndexedIndirect;
+    memcpy(streamPtr, &opcode_vkCmdDrawIndexedIndirect, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdDrawIndexedIndirect, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&local_buffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_drawCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_stride, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdDrawIndexedIndirect), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdDispatch(VkCommandBuffer commandBuffer, uint32_t groupCountX,
+                              uint32_t groupCountY, uint32_t groupCountZ, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdDispatch in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdDispatch(commandBuffer:%p, groupCountX:%d, groupCountY:%d, groupCountZ:%d)",
+        commandBuffer, groupCountX, groupCountY, groupCountZ);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_groupCountX;
+    uint32_t local_groupCountY;
+    uint32_t local_groupCountZ;
+    local_commandBuffer = commandBuffer;
+    local_groupCountX = groupCountX;
+    local_groupCountY = groupCountY;
+    local_groupCountZ = groupCountZ;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdDispatch = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdDispatch);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdDispatch -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdDispatch);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdDispatch = OP_vkCmdDispatch;
+    memcpy(streamPtr, &opcode_vkCmdDispatch, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdDispatch, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_groupCountX, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_groupCountY, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_groupCountZ, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdDispatch), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                      VkDeviceSize offset, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdDispatchIndirect in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdDispatchIndirect(commandBuffer:%p, buffer:%p, offset:%ld)",
+                      commandBuffer, buffer, offset);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkBuffer local_buffer;
+    VkDeviceSize local_offset;
+    local_commandBuffer = commandBuffer;
+    local_buffer = buffer;
+    local_offset = offset;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+    }
+    uint32_t packetSize_vkCmdDispatchIndirect = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdDispatchIndirect);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdDispatchIndirect -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdDispatchIndirect);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdDispatchIndirect = OP_vkCmdDispatchIndirect;
+    memcpy(streamPtr, &opcode_vkCmdDispatchIndirect, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdDispatchIndirect, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&local_buffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdDispatchIndirect), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer,
+                                VkBuffer dstBuffer, uint32_t regionCount,
+                                const VkBufferCopy* pRegions, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdCopyBuffer in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdCopyBuffer(commandBuffer:%p, srcBuffer:%p, dstBuffer:%p, regionCount:%d, "
+        "pRegions:%p)",
+        commandBuffer, srcBuffer, dstBuffer, regionCount, pRegions);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkBuffer local_srcBuffer;
+    VkBuffer local_dstBuffer;
+    uint32_t local_regionCount;
+    VkBufferCopy* local_pRegions;
+    local_commandBuffer = commandBuffer;
+    local_srcBuffer = srcBuffer;
+    local_dstBuffer = dstBuffer;
+    local_regionCount = regionCount;
+    local_pRegions = nullptr;
+    if (pRegions) {
+        local_pRegions = (VkBufferCopy*)pool->alloc(((regionCount)) * sizeof(const VkBufferCopy));
+        for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
+            deepcopy_VkBufferCopy(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pRegions + i,
+                                  (VkBufferCopy*)(local_pRegions + i));
+        }
+    }
+    if (local_pRegions) {
+        for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
+            transform_tohost_VkBufferCopy(sResourceTracker, (VkBufferCopy*)(local_pRegions + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_2;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
+            count_VkBufferCopy(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                               (VkBufferCopy*)(local_pRegions + i), countPtr);
+        }
+    }
+    uint32_t packetSize_vkCmdCopyBuffer = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdCopyBuffer);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdCopyBuffer -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdCopyBuffer);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdCopyBuffer = OP_vkCmdCopyBuffer;
+    memcpy(streamPtr, &opcode_vkCmdCopyBuffer, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdCopyBuffer, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&local_srcBuffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkBuffer((*&local_dstBuffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_regionCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
+        reservedmarshal_VkBufferCopy(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                     (VkBufferCopy*)(local_pRegions + i), streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdCopyBuffer), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage,
+                               VkImageLayout srcImageLayout, VkImage dstImage,
+                               VkImageLayout dstImageLayout, uint32_t regionCount,
+                               const VkImageCopy* pRegions, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdCopyImage in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdCopyImage(commandBuffer:%p, srcImage:%p, srcImageLayout:%d, dstImage:%p, "
+        "dstImageLayout:%d, regionCount:%d, pRegions:%p)",
+        commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkImage local_srcImage;
+    VkImageLayout local_srcImageLayout;
+    VkImage local_dstImage;
+    VkImageLayout local_dstImageLayout;
+    uint32_t local_regionCount;
+    VkImageCopy* local_pRegions;
+    local_commandBuffer = commandBuffer;
+    local_srcImage = srcImage;
+    local_srcImageLayout = srcImageLayout;
+    local_dstImage = dstImage;
+    local_dstImageLayout = dstImageLayout;
+    local_regionCount = regionCount;
+    local_pRegions = nullptr;
+    if (pRegions) {
+        local_pRegions = (VkImageCopy*)pool->alloc(((regionCount)) * sizeof(const VkImageCopy));
+        for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
+            deepcopy_VkImageCopy(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pRegions + i,
+                                 (VkImageCopy*)(local_pRegions + i));
+        }
+    }
+    if (local_pRegions) {
+        for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
+            transform_tohost_VkImageCopy(sResourceTracker, (VkImageCopy*)(local_pRegions + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkImageLayout);
+        uint64_t cgen_var_2;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkImageLayout);
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
+            count_VkImageCopy(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                              (VkImageCopy*)(local_pRegions + i), countPtr);
+        }
+    }
+    uint32_t packetSize_vkCmdCopyImage = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdCopyImage);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdCopyImage -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdCopyImage);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdCopyImage = OP_vkCmdCopyImage;
+    memcpy(streamPtr, &opcode_vkCmdCopyImage, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdCopyImage, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImage((*&local_srcImage));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout));
+    *streamPtrPtr += sizeof(VkImageLayout);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkImage((*&local_dstImage));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout));
+    *streamPtrPtr += sizeof(VkImageLayout);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_regionCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
+        reservedmarshal_VkImageCopy(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkImageCopy*)(local_pRegions + i), streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdCopyImage), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage,
+                               VkImageLayout srcImageLayout, VkImage dstImage,
+                               VkImageLayout dstImageLayout, uint32_t regionCount,
+                               const VkImageBlit* pRegions, VkFilter filter, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdBlitImage in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdBlitImage(commandBuffer:%p, srcImage:%p, srcImageLayout:%d, dstImage:%p, "
+        "dstImageLayout:%d, regionCount:%d, pRegions:%p)",
+        commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkImage local_srcImage;
+    VkImageLayout local_srcImageLayout;
+    VkImage local_dstImage;
+    VkImageLayout local_dstImageLayout;
+    uint32_t local_regionCount;
+    VkImageBlit* local_pRegions;
+    VkFilter local_filter;
+    local_commandBuffer = commandBuffer;
+    local_srcImage = srcImage;
+    local_srcImageLayout = srcImageLayout;
+    local_dstImage = dstImage;
+    local_dstImageLayout = dstImageLayout;
+    local_regionCount = regionCount;
+    local_pRegions = nullptr;
+    if (pRegions) {
+        local_pRegions = (VkImageBlit*)pool->alloc(((regionCount)) * sizeof(const VkImageBlit));
+        for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
+            deepcopy_VkImageBlit(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pRegions + i,
+                                 (VkImageBlit*)(local_pRegions + i));
+        }
+    }
+    local_filter = filter;
+    if (local_pRegions) {
+        for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
+            transform_tohost_VkImageBlit(sResourceTracker, (VkImageBlit*)(local_pRegions + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkImageLayout);
+        uint64_t cgen_var_2;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkImageLayout);
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
+            count_VkImageBlit(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                              (VkImageBlit*)(local_pRegions + i), countPtr);
+        }
+        *countPtr += sizeof(VkFilter);
+    }
+    uint32_t packetSize_vkCmdBlitImage = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdBlitImage);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdBlitImage -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdBlitImage);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdBlitImage = OP_vkCmdBlitImage;
+    memcpy(streamPtr, &opcode_vkCmdBlitImage, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdBlitImage, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImage((*&local_srcImage));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout));
+    *streamPtrPtr += sizeof(VkImageLayout);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkImage((*&local_dstImage));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout));
+    *streamPtrPtr += sizeof(VkImageLayout);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_regionCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
+        reservedmarshal_VkImageBlit(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkImageBlit*)(local_pRegions + i), streamPtrPtr);
+    }
+    memcpy(*streamPtrPtr, (VkFilter*)&local_filter, sizeof(VkFilter));
+    *streamPtrPtr += sizeof(VkFilter);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdBlitImage), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer,
+                                       VkImage dstImage, VkImageLayout dstImageLayout,
+                                       uint32_t regionCount, const VkBufferImageCopy* pRegions,
+                                       uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdCopyBufferToImage in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdCopyBufferToImage(commandBuffer:%p, srcBuffer:%p, dstImage:%p, dstImageLayout:%d, "
+        "regionCount:%d, pRegions:%p)",
+        commandBuffer, srcBuffer, dstImage, dstImageLayout, regionCount, pRegions);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkBuffer local_srcBuffer;
+    VkImage local_dstImage;
+    VkImageLayout local_dstImageLayout;
+    uint32_t local_regionCount;
+    VkBufferImageCopy* local_pRegions;
+    local_commandBuffer = commandBuffer;
+    local_srcBuffer = srcBuffer;
+    local_dstImage = dstImage;
+    local_dstImageLayout = dstImageLayout;
+    local_regionCount = regionCount;
+    local_pRegions = nullptr;
+    if (pRegions) {
+        local_pRegions =
+            (VkBufferImageCopy*)pool->alloc(((regionCount)) * sizeof(const VkBufferImageCopy));
+        for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
+            deepcopy_VkBufferImageCopy(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pRegions + i,
+                                       (VkBufferImageCopy*)(local_pRegions + i));
+        }
+    }
+    if (local_pRegions) {
+        for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
+            transform_tohost_VkBufferImageCopy(sResourceTracker,
+                                               (VkBufferImageCopy*)(local_pRegions + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_2;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkImageLayout);
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
+            count_VkBufferImageCopy(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkBufferImageCopy*)(local_pRegions + i), countPtr);
+        }
+    }
+    uint32_t packetSize_vkCmdCopyBufferToImage = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdCopyBufferToImage);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdCopyBufferToImage -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdCopyBufferToImage);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdCopyBufferToImage = OP_vkCmdCopyBufferToImage;
+    memcpy(streamPtr, &opcode_vkCmdCopyBufferToImage, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdCopyBufferToImage, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&local_srcBuffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkImage((*&local_dstImage));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout));
+    *streamPtrPtr += sizeof(VkImageLayout);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_regionCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
+        reservedmarshal_VkBufferImageCopy(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkBufferImageCopy*)(local_pRegions + i), streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdCopyBufferToImage), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage,
+                                       VkImageLayout srcImageLayout, VkBuffer dstBuffer,
+                                       uint32_t regionCount, const VkBufferImageCopy* pRegions,
+                                       uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdCopyImageToBuffer in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdCopyImageToBuffer(commandBuffer:%p, srcImage:%p, srcImageLayout:%d, dstBuffer:%p, "
+        "regionCount:%d, pRegions:%p)",
+        commandBuffer, srcImage, srcImageLayout, dstBuffer, regionCount, pRegions);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkImage local_srcImage;
+    VkImageLayout local_srcImageLayout;
+    VkBuffer local_dstBuffer;
+    uint32_t local_regionCount;
+    VkBufferImageCopy* local_pRegions;
+    local_commandBuffer = commandBuffer;
+    local_srcImage = srcImage;
+    local_srcImageLayout = srcImageLayout;
+    local_dstBuffer = dstBuffer;
+    local_regionCount = regionCount;
+    local_pRegions = nullptr;
+    if (pRegions) {
+        local_pRegions =
+            (VkBufferImageCopy*)pool->alloc(((regionCount)) * sizeof(const VkBufferImageCopy));
+        for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
+            deepcopy_VkBufferImageCopy(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pRegions + i,
+                                       (VkBufferImageCopy*)(local_pRegions + i));
+        }
+    }
+    if (local_pRegions) {
+        for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
+            transform_tohost_VkBufferImageCopy(sResourceTracker,
+                                               (VkBufferImageCopy*)(local_pRegions + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkImageLayout);
+        uint64_t cgen_var_2;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
+            count_VkBufferImageCopy(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkBufferImageCopy*)(local_pRegions + i), countPtr);
+        }
+    }
+    uint32_t packetSize_vkCmdCopyImageToBuffer = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdCopyImageToBuffer);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdCopyImageToBuffer -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdCopyImageToBuffer);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdCopyImageToBuffer = OP_vkCmdCopyImageToBuffer;
+    memcpy(streamPtr, &opcode_vkCmdCopyImageToBuffer, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdCopyImageToBuffer, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImage((*&local_srcImage));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout));
+    *streamPtrPtr += sizeof(VkImageLayout);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkBuffer((*&local_dstBuffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_regionCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
+        reservedmarshal_VkBufferImageCopy(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkBufferImageCopy*)(local_pRegions + i), streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdCopyImageToBuffer), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer,
+                                  VkDeviceSize dstOffset, VkDeviceSize dataSize, const void* pData,
+                                  uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdUpdateBuffer in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdUpdateBuffer(commandBuffer:%p, dstBuffer:%p, dstOffset:%ld, dataSize:%ld, pData:%p)",
+        commandBuffer, dstBuffer, dstOffset, dataSize, pData);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkBuffer local_dstBuffer;
+    VkDeviceSize local_dstOffset;
+    VkDeviceSize local_dataSize;
+    void* local_pData;
+    local_commandBuffer = commandBuffer;
+    local_dstBuffer = dstBuffer;
+    local_dstOffset = dstOffset;
+    local_dataSize = dataSize;
+    // Avoiding deepcopy for pData
+    local_pData = (void*)pData;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        *countPtr += sizeof(VkDeviceSize);
+        *countPtr += ((dataSize)) * sizeof(uint8_t);
+    }
+    uint32_t packetSize_vkCmdUpdateBuffer = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdUpdateBuffer);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdUpdateBuffer -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdUpdateBuffer);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdUpdateBuffer = OP_vkCmdUpdateBuffer;
+    memcpy(streamPtr, &opcode_vkCmdUpdateBuffer, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdUpdateBuffer, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&local_dstBuffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_dataSize, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    memcpy(*streamPtrPtr, (void*)local_pData, ((dataSize)) * sizeof(uint8_t));
+    *streamPtrPtr += ((dataSize)) * sizeof(uint8_t);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdUpdateBuffer), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer,
+                                VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data,
+                                uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdFillBuffer in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdFillBuffer(commandBuffer:%p, dstBuffer:%p, dstOffset:%ld, size:%ld, data:%d)",
+        commandBuffer, dstBuffer, dstOffset, size, data);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkBuffer local_dstBuffer;
+    VkDeviceSize local_dstOffset;
+    VkDeviceSize local_size;
+    uint32_t local_data;
+    local_commandBuffer = commandBuffer;
+    local_dstBuffer = dstBuffer;
+    local_dstOffset = dstOffset;
+    local_size = size;
+    local_data = data;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        *countPtr += sizeof(VkDeviceSize);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdFillBuffer = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdFillBuffer);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdFillBuffer -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdFillBuffer);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdFillBuffer = OP_vkCmdFillBuffer;
+    memcpy(streamPtr, &opcode_vkCmdFillBuffer, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdFillBuffer, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&local_dstBuffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_size, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_data, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdFillBuffer), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image,
+                                     VkImageLayout imageLayout, const VkClearColorValue* pColor,
+                                     uint32_t rangeCount, const VkImageSubresourceRange* pRanges,
+                                     uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdClearColorImage in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdClearColorImage(commandBuffer:%p, image:%p, imageLayout:%d, pColor:%p, "
+        "rangeCount:%d, pRanges:%p)",
+        commandBuffer, image, imageLayout, pColor, rangeCount, pRanges);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkImage local_image;
+    VkImageLayout local_imageLayout;
+    VkClearColorValue* local_pColor;
+    uint32_t local_rangeCount;
+    VkImageSubresourceRange* local_pRanges;
+    local_commandBuffer = commandBuffer;
+    local_image = image;
+    local_imageLayout = imageLayout;
+    local_pColor = nullptr;
+    if (pColor) {
+        local_pColor = (VkClearColorValue*)pool->alloc(sizeof(const VkClearColorValue));
+        deepcopy_VkClearColorValue(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pColor,
+                                   (VkClearColorValue*)(local_pColor));
+    }
+    local_rangeCount = rangeCount;
+    local_pRanges = nullptr;
+    if (pRanges) {
+        local_pRanges = (VkImageSubresourceRange*)pool->alloc(
+            ((rangeCount)) * sizeof(const VkImageSubresourceRange));
+        for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) {
+            deepcopy_VkImageSubresourceRange(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pRanges + i,
+                                             (VkImageSubresourceRange*)(local_pRanges + i));
+        }
+    }
+    if (local_pColor) {
+        transform_tohost_VkClearColorValue(sResourceTracker, (VkClearColorValue*)(local_pColor));
+    }
+    if (local_pRanges) {
+        for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) {
+            transform_tohost_VkImageSubresourceRange(sResourceTracker,
+                                                     (VkImageSubresourceRange*)(local_pRanges + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkImageLayout);
+        count_VkClearColorValue(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                (VkClearColorValue*)(local_pColor), countPtr);
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) {
+            count_VkImageSubresourceRange(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkImageSubresourceRange*)(local_pRanges + i), countPtr);
+        }
+    }
+    uint32_t packetSize_vkCmdClearColorImage = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdClearColorImage);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdClearColorImage -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdClearColorImage);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdClearColorImage = OP_vkCmdClearColorImage;
+    memcpy(streamPtr, &opcode_vkCmdClearColorImage, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdClearColorImage, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImage((*&local_image));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout));
+    *streamPtrPtr += sizeof(VkImageLayout);
+    reservedmarshal_VkClearColorValue(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                      (VkClearColorValue*)(local_pColor), streamPtrPtr);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_rangeCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) {
+        reservedmarshal_VkImageSubresourceRange(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                (VkImageSubresourceRange*)(local_pRanges + i),
+                                                streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdClearColorImage), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image,
+                                            VkImageLayout imageLayout,
+                                            const VkClearDepthStencilValue* pDepthStencil,
+                                            uint32_t rangeCount,
+                                            const VkImageSubresourceRange* pRanges,
+                                            uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdClearDepthStencilImage in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdClearDepthStencilImage(commandBuffer:%p, image:%p, imageLayout:%d, pDepthStencil:%p, "
+        "rangeCount:%d, pRanges:%p)",
+        commandBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkImage local_image;
+    VkImageLayout local_imageLayout;
+    VkClearDepthStencilValue* local_pDepthStencil;
+    uint32_t local_rangeCount;
+    VkImageSubresourceRange* local_pRanges;
+    local_commandBuffer = commandBuffer;
+    local_image = image;
+    local_imageLayout = imageLayout;
+    local_pDepthStencil = nullptr;
+    if (pDepthStencil) {
+        local_pDepthStencil =
+            (VkClearDepthStencilValue*)pool->alloc(sizeof(const VkClearDepthStencilValue));
+        deepcopy_VkClearDepthStencilValue(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pDepthStencil,
+                                          (VkClearDepthStencilValue*)(local_pDepthStencil));
+    }
+    local_rangeCount = rangeCount;
+    local_pRanges = nullptr;
+    if (pRanges) {
+        local_pRanges = (VkImageSubresourceRange*)pool->alloc(
+            ((rangeCount)) * sizeof(const VkImageSubresourceRange));
+        for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) {
+            deepcopy_VkImageSubresourceRange(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pRanges + i,
+                                             (VkImageSubresourceRange*)(local_pRanges + i));
+        }
+    }
+    if (local_pDepthStencil) {
+        transform_tohost_VkClearDepthStencilValue(sResourceTracker,
+                                                  (VkClearDepthStencilValue*)(local_pDepthStencil));
+    }
+    if (local_pRanges) {
+        for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) {
+            transform_tohost_VkImageSubresourceRange(sResourceTracker,
+                                                     (VkImageSubresourceRange*)(local_pRanges + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkImageLayout);
+        count_VkClearDepthStencilValue(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkClearDepthStencilValue*)(local_pDepthStencil), countPtr);
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) {
+            count_VkImageSubresourceRange(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkImageSubresourceRange*)(local_pRanges + i), countPtr);
+        }
+    }
+    uint32_t packetSize_vkCmdClearDepthStencilImage = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdClearDepthStencilImage);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdClearDepthStencilImage -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdClearDepthStencilImage);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdClearDepthStencilImage = OP_vkCmdClearDepthStencilImage;
+    memcpy(streamPtr, &opcode_vkCmdClearDepthStencilImage, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdClearDepthStencilImage, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImage((*&local_image));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout));
+    *streamPtrPtr += sizeof(VkImageLayout);
+    reservedmarshal_VkClearDepthStencilValue(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                             (VkClearDepthStencilValue*)(local_pDepthStencil),
+                                             streamPtrPtr);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_rangeCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) {
+        reservedmarshal_VkImageSubresourceRange(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                (VkImageSubresourceRange*)(local_pRanges + i),
+                                                streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdClearDepthStencilImage), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount,
+                                      const VkClearAttachment* pAttachments, uint32_t rectCount,
+                                      const VkClearRect* pRects, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdClearAttachments in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdClearAttachments(commandBuffer:%p, attachmentCount:%d, pAttachments:%p, "
+        "rectCount:%d, pRects:%p)",
+        commandBuffer, attachmentCount, pAttachments, rectCount, pRects);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_attachmentCount;
+    VkClearAttachment* local_pAttachments;
+    uint32_t local_rectCount;
+    VkClearRect* local_pRects;
+    local_commandBuffer = commandBuffer;
+    local_attachmentCount = attachmentCount;
+    local_pAttachments = nullptr;
+    if (pAttachments) {
+        local_pAttachments =
+            (VkClearAttachment*)pool->alloc(((attachmentCount)) * sizeof(const VkClearAttachment));
+        for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i) {
+            deepcopy_VkClearAttachment(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAttachments + i,
+                                       (VkClearAttachment*)(local_pAttachments + i));
+        }
+    }
+    local_rectCount = rectCount;
+    local_pRects = nullptr;
+    if (pRects) {
+        local_pRects = (VkClearRect*)pool->alloc(((rectCount)) * sizeof(const VkClearRect));
+        for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i) {
+            deepcopy_VkClearRect(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pRects + i,
+                                 (VkClearRect*)(local_pRects + i));
+        }
+    }
+    if (local_pAttachments) {
+        for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i) {
+            transform_tohost_VkClearAttachment(sResourceTracker,
+                                               (VkClearAttachment*)(local_pAttachments + i));
+        }
+    }
+    if (local_pRects) {
+        for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i) {
+            transform_tohost_VkClearRect(sResourceTracker, (VkClearRect*)(local_pRects + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i) {
+            count_VkClearAttachment(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkClearAttachment*)(local_pAttachments + i), countPtr);
+        }
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i) {
+            count_VkClearRect(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                              (VkClearRect*)(local_pRects + i), countPtr);
+        }
+    }
+    uint32_t packetSize_vkCmdClearAttachments = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdClearAttachments);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdClearAttachments -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdClearAttachments);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdClearAttachments = OP_vkCmdClearAttachments;
+    memcpy(streamPtr, &opcode_vkCmdClearAttachments, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdClearAttachments, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_attachmentCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i) {
+        reservedmarshal_VkClearAttachment(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkClearAttachment*)(local_pAttachments + i),
+                                          streamPtrPtr);
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_rectCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i) {
+        reservedmarshal_VkClearRect(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkClearRect*)(local_pRects + i), streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdClearAttachments), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage,
+                                  VkImageLayout srcImageLayout, VkImage dstImage,
+                                  VkImageLayout dstImageLayout, uint32_t regionCount,
+                                  const VkImageResolve* pRegions, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdResolveImage in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdResolveImage(commandBuffer:%p, srcImage:%p, srcImageLayout:%d, dstImage:%p, "
+        "dstImageLayout:%d, regionCount:%d, pRegions:%p)",
+        commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkImage local_srcImage;
+    VkImageLayout local_srcImageLayout;
+    VkImage local_dstImage;
+    VkImageLayout local_dstImageLayout;
+    uint32_t local_regionCount;
+    VkImageResolve* local_pRegions;
+    local_commandBuffer = commandBuffer;
+    local_srcImage = srcImage;
+    local_srcImageLayout = srcImageLayout;
+    local_dstImage = dstImage;
+    local_dstImageLayout = dstImageLayout;
+    local_regionCount = regionCount;
+    local_pRegions = nullptr;
+    if (pRegions) {
+        local_pRegions =
+            (VkImageResolve*)pool->alloc(((regionCount)) * sizeof(const VkImageResolve));
+        for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
+            deepcopy_VkImageResolve(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pRegions + i,
+                                    (VkImageResolve*)(local_pRegions + i));
+        }
+    }
+    if (local_pRegions) {
+        for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
+            transform_tohost_VkImageResolve(sResourceTracker,
+                                            (VkImageResolve*)(local_pRegions + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkImageLayout);
+        uint64_t cgen_var_2;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkImageLayout);
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
+            count_VkImageResolve(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                 (VkImageResolve*)(local_pRegions + i), countPtr);
+        }
+    }
+    uint32_t packetSize_vkCmdResolveImage = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdResolveImage);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdResolveImage -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdResolveImage);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdResolveImage = OP_vkCmdResolveImage;
+    memcpy(streamPtr, &opcode_vkCmdResolveImage, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdResolveImage, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImage((*&local_srcImage));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout));
+    *streamPtrPtr += sizeof(VkImageLayout);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkImage((*&local_dstImage));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout));
+    *streamPtrPtr += sizeof(VkImageLayout);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_regionCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) {
+        reservedmarshal_VkImageResolve(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkImageResolve*)(local_pRegions + i), streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdResolveImage), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event,
+                              VkPipelineStageFlags stageMask, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetEvent in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdSetEvent(commandBuffer:%p, event:%p, stageMask:%d)", commandBuffer,
+                      event, stageMask);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkEvent local_event;
+    VkPipelineStageFlags local_stageMask;
+    local_commandBuffer = commandBuffer;
+    local_event = event;
+    local_stageMask = stageMask;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkPipelineStageFlags);
+    }
+    uint32_t packetSize_vkCmdSetEvent = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetEvent);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetEvent -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetEvent);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetEvent = OP_vkCmdSetEvent;
+    memcpy(streamPtr, &opcode_vkCmdSetEvent, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetEvent, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkEvent((*&local_event));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags));
+    *streamPtrPtr += sizeof(VkPipelineStageFlags);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdSetEvent), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event,
+                                VkPipelineStageFlags stageMask, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdResetEvent in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdResetEvent(commandBuffer:%p, event:%p, stageMask:%d)", commandBuffer,
+                      event, stageMask);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkEvent local_event;
+    VkPipelineStageFlags local_stageMask;
+    local_commandBuffer = commandBuffer;
+    local_event = event;
+    local_stageMask = stageMask;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkPipelineStageFlags);
+    }
+    uint32_t packetSize_vkCmdResetEvent = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdResetEvent);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdResetEvent -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdResetEvent);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdResetEvent = OP_vkCmdResetEvent;
+    memcpy(streamPtr, &opcode_vkCmdResetEvent, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdResetEvent, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkEvent((*&local_event));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags));
+    *streamPtrPtr += sizeof(VkPipelineStageFlags);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdResetEvent), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount,
+                                const VkEvent* pEvents, VkPipelineStageFlags srcStageMask,
+                                VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount,
+                                const VkMemoryBarrier* pMemoryBarriers,
+                                uint32_t bufferMemoryBarrierCount,
+                                const VkBufferMemoryBarrier* pBufferMemoryBarriers,
+                                uint32_t imageMemoryBarrierCount,
+                                const VkImageMemoryBarrier* pImageMemoryBarriers, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdWaitEvents in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdWaitEvents(commandBuffer:%p, eventCount:%d, pEvents:%p, srcStageMask:%d, "
+        "dstStageMask:%d, memoryBarrierCount:%d, pMemoryBarriers:%p, bufferMemoryBarrierCount:%d, "
+        "pBufferMemoryBarriers:%p, imageMemoryBarrierCount:%d, pImageMemoryBarriers:%p)",
+        commandBuffer, eventCount, pEvents, srcStageMask, dstStageMask, memoryBarrierCount,
+        pMemoryBarriers, bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount,
+        pImageMemoryBarriers);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_eventCount;
+    VkEvent* local_pEvents;
+    VkPipelineStageFlags local_srcStageMask;
+    VkPipelineStageFlags local_dstStageMask;
+    uint32_t local_memoryBarrierCount;
+    VkMemoryBarrier* local_pMemoryBarriers;
+    uint32_t local_bufferMemoryBarrierCount;
+    VkBufferMemoryBarrier* local_pBufferMemoryBarriers;
+    uint32_t local_imageMemoryBarrierCount;
+    VkImageMemoryBarrier* local_pImageMemoryBarriers;
+    local_commandBuffer = commandBuffer;
+    local_eventCount = eventCount;
+    // Avoiding deepcopy for pEvents
+    local_pEvents = (VkEvent*)pEvents;
+    local_srcStageMask = srcStageMask;
+    local_dstStageMask = dstStageMask;
+    local_memoryBarrierCount = memoryBarrierCount;
+    local_pMemoryBarriers = nullptr;
+    if (pMemoryBarriers) {
+        local_pMemoryBarriers =
+            (VkMemoryBarrier*)pool->alloc(((memoryBarrierCount)) * sizeof(const VkMemoryBarrier));
+        for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) {
+            deepcopy_VkMemoryBarrier(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pMemoryBarriers + i,
+                                     (VkMemoryBarrier*)(local_pMemoryBarriers + i));
+        }
+    }
+    local_bufferMemoryBarrierCount = bufferMemoryBarrierCount;
+    local_pBufferMemoryBarriers = nullptr;
+    if (pBufferMemoryBarriers) {
+        local_pBufferMemoryBarriers = (VkBufferMemoryBarrier*)pool->alloc(
+            ((bufferMemoryBarrierCount)) * sizeof(const VkBufferMemoryBarrier));
+        for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) {
+            deepcopy_VkBufferMemoryBarrier(
+                pool, VK_STRUCTURE_TYPE_MAX_ENUM, pBufferMemoryBarriers + i,
+                (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i));
+        }
+    }
+    local_imageMemoryBarrierCount = imageMemoryBarrierCount;
+    local_pImageMemoryBarriers = nullptr;
+    if (pImageMemoryBarriers) {
+        local_pImageMemoryBarriers = (VkImageMemoryBarrier*)pool->alloc(
+            ((imageMemoryBarrierCount)) * sizeof(const VkImageMemoryBarrier));
+        for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) {
+            deepcopy_VkImageMemoryBarrier(pool, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          pImageMemoryBarriers + i,
+                                          (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i));
+        }
+    }
+    if (local_pMemoryBarriers) {
+        for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) {
+            transform_tohost_VkMemoryBarrier(sResourceTracker,
+                                             (VkMemoryBarrier*)(local_pMemoryBarriers + i));
+        }
+    }
+    if (local_pBufferMemoryBarriers) {
+        for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) {
+            transform_tohost_VkBufferMemoryBarrier(
+                sResourceTracker, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i));
+        }
+    }
+    if (local_pImageMemoryBarriers) {
+        for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) {
+            transform_tohost_VkImageMemoryBarrier(
+                sResourceTracker, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        if (((eventCount))) {
+            *countPtr += ((eventCount)) * 8;
+        }
+        *countPtr += sizeof(VkPipelineStageFlags);
+        *countPtr += sizeof(VkPipelineStageFlags);
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) {
+            count_VkMemoryBarrier(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                  (VkMemoryBarrier*)(local_pMemoryBarriers + i), countPtr);
+        }
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) {
+            count_VkBufferMemoryBarrier(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i),
+                                        countPtr);
+        }
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) {
+            count_VkImageMemoryBarrier(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i),
+                                       countPtr);
+        }
+    }
+    uint32_t packetSize_vkCmdWaitEvents = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdWaitEvents);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdWaitEvents -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdWaitEvents);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdWaitEvents = OP_vkCmdWaitEvents;
+    memcpy(streamPtr, &opcode_vkCmdWaitEvents, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdWaitEvents, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_eventCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (((eventCount))) {
+        uint8_t* cgen_var_0_ptr = (uint8_t*)(*streamPtrPtr);
+        for (uint32_t k = 0; k < ((eventCount)); ++k) {
+            uint64_t tmpval = get_host_u64_VkEvent(local_pEvents[k]);
+            memcpy(cgen_var_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+        }
+        *streamPtrPtr += 8 * ((eventCount));
+    }
+    memcpy(*streamPtrPtr, (VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags));
+    *streamPtrPtr += sizeof(VkPipelineStageFlags);
+    memcpy(*streamPtrPtr, (VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags));
+    *streamPtrPtr += sizeof(VkPipelineStageFlags);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) {
+        reservedmarshal_VkMemoryBarrier(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkMemoryBarrier*)(local_pMemoryBarriers + i),
+                                        streamPtrPtr);
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) {
+        reservedmarshal_VkBufferMemoryBarrier(
+            stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i), streamPtrPtr);
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) {
+        reservedmarshal_VkImageMemoryBarrier(
+            stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i), streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdWaitEvents), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdPipelineBarrier(
+    VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask,
+    VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags,
+    uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers,
+    uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers,
+    uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdPipelineBarrier in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdPipelineBarrier(commandBuffer:%p, srcStageMask:%d, dstStageMask:%d, "
+        "dependencyFlags:%d, memoryBarrierCount:%d, pMemoryBarriers:%p, "
+        "bufferMemoryBarrierCount:%d, pBufferMemoryBarriers:%p, imageMemoryBarrierCount:%d, "
+        "pImageMemoryBarriers:%p)",
+        commandBuffer, srcStageMask, dstStageMask, dependencyFlags, memoryBarrierCount,
+        pMemoryBarriers, bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount,
+        pImageMemoryBarriers);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkPipelineStageFlags local_srcStageMask;
+    VkPipelineStageFlags local_dstStageMask;
+    VkDependencyFlags local_dependencyFlags;
+    uint32_t local_memoryBarrierCount;
+    VkMemoryBarrier* local_pMemoryBarriers;
+    uint32_t local_bufferMemoryBarrierCount;
+    VkBufferMemoryBarrier* local_pBufferMemoryBarriers;
+    uint32_t local_imageMemoryBarrierCount;
+    VkImageMemoryBarrier* local_pImageMemoryBarriers;
+    local_commandBuffer = commandBuffer;
+    local_srcStageMask = srcStageMask;
+    local_dstStageMask = dstStageMask;
+    local_dependencyFlags = dependencyFlags;
+    local_memoryBarrierCount = memoryBarrierCount;
+    local_pMemoryBarriers = nullptr;
+    if (pMemoryBarriers) {
+        local_pMemoryBarriers =
+            (VkMemoryBarrier*)pool->alloc(((memoryBarrierCount)) * sizeof(const VkMemoryBarrier));
+        for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) {
+            deepcopy_VkMemoryBarrier(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pMemoryBarriers + i,
+                                     (VkMemoryBarrier*)(local_pMemoryBarriers + i));
+        }
+    }
+    local_bufferMemoryBarrierCount = bufferMemoryBarrierCount;
+    local_pBufferMemoryBarriers = nullptr;
+    if (pBufferMemoryBarriers) {
+        local_pBufferMemoryBarriers = (VkBufferMemoryBarrier*)pool->alloc(
+            ((bufferMemoryBarrierCount)) * sizeof(const VkBufferMemoryBarrier));
+        for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) {
+            deepcopy_VkBufferMemoryBarrier(
+                pool, VK_STRUCTURE_TYPE_MAX_ENUM, pBufferMemoryBarriers + i,
+                (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i));
+        }
+    }
+    local_imageMemoryBarrierCount = imageMemoryBarrierCount;
+    local_pImageMemoryBarriers = nullptr;
+    if (pImageMemoryBarriers) {
+        local_pImageMemoryBarriers = (VkImageMemoryBarrier*)pool->alloc(
+            ((imageMemoryBarrierCount)) * sizeof(const VkImageMemoryBarrier));
+        for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) {
+            deepcopy_VkImageMemoryBarrier(pool, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          pImageMemoryBarriers + i,
+                                          (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i));
+        }
+    }
+    if (local_pMemoryBarriers) {
+        for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) {
+            transform_tohost_VkMemoryBarrier(sResourceTracker,
+                                             (VkMemoryBarrier*)(local_pMemoryBarriers + i));
+        }
+    }
+    if (local_pBufferMemoryBarriers) {
+        for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) {
+            transform_tohost_VkBufferMemoryBarrier(
+                sResourceTracker, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i));
+        }
+    }
+    if (local_pImageMemoryBarriers) {
+        for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) {
+            transform_tohost_VkImageMemoryBarrier(
+                sResourceTracker, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkPipelineStageFlags);
+        *countPtr += sizeof(VkPipelineStageFlags);
+        *countPtr += sizeof(VkDependencyFlags);
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) {
+            count_VkMemoryBarrier(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                  (VkMemoryBarrier*)(local_pMemoryBarriers + i), countPtr);
+        }
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) {
+            count_VkBufferMemoryBarrier(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i),
+                                        countPtr);
+        }
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) {
+            count_VkImageMemoryBarrier(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i),
+                                       countPtr);
+        }
+    }
+    uint32_t packetSize_vkCmdPipelineBarrier = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdPipelineBarrier);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdPipelineBarrier -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdPipelineBarrier);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdPipelineBarrier = OP_vkCmdPipelineBarrier;
+    memcpy(streamPtr, &opcode_vkCmdPipelineBarrier, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdPipelineBarrier, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags));
+    *streamPtrPtr += sizeof(VkPipelineStageFlags);
+    memcpy(*streamPtrPtr, (VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags));
+    *streamPtrPtr += sizeof(VkPipelineStageFlags);
+    memcpy(*streamPtrPtr, (VkDependencyFlags*)&local_dependencyFlags, sizeof(VkDependencyFlags));
+    *streamPtrPtr += sizeof(VkDependencyFlags);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) {
+        reservedmarshal_VkMemoryBarrier(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkMemoryBarrier*)(local_pMemoryBarriers + i),
+                                        streamPtrPtr);
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) {
+        reservedmarshal_VkBufferMemoryBarrier(
+            stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i), streamPtrPtr);
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) {
+        reservedmarshal_VkImageMemoryBarrier(
+            stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i), streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdPipelineBarrier), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool,
+                                uint32_t query, VkQueryControlFlags flags, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdBeginQuery in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdBeginQuery(commandBuffer:%p, queryPool:%p, query:%d, flags:%d)",
+                      commandBuffer, queryPool, query, flags);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkQueryPool local_queryPool;
+    uint32_t local_query;
+    VkQueryControlFlags local_flags;
+    local_commandBuffer = commandBuffer;
+    local_queryPool = queryPool;
+    local_query = query;
+    local_flags = flags;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(VkQueryControlFlags);
+    }
+    uint32_t packetSize_vkCmdBeginQuery = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdBeginQuery);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdBeginQuery -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdBeginQuery);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdBeginQuery = OP_vkCmdBeginQuery;
+    memcpy(streamPtr, &opcode_vkCmdBeginQuery, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdBeginQuery, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkQueryPool((*&local_queryPool));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_query, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (VkQueryControlFlags*)&local_flags, sizeof(VkQueryControlFlags));
+    *streamPtrPtr += sizeof(VkQueryControlFlags);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdBeginQuery), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query,
+                              uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdEndQuery in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdEndQuery(commandBuffer:%p, queryPool:%p, query:%d)", commandBuffer,
+                      queryPool, query);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkQueryPool local_queryPool;
+    uint32_t local_query;
+    local_commandBuffer = commandBuffer;
+    local_queryPool = queryPool;
+    local_query = query;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdEndQuery = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdEndQuery);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdEndQuery -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdEndQuery);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdEndQuery = OP_vkCmdEndQuery;
+    memcpy(streamPtr, &opcode_vkCmdEndQuery, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdEndQuery, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkQueryPool((*&local_queryPool));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_query, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdEndQuery), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool,
+                                    uint32_t firstQuery, uint32_t queryCount, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdResetQueryPool in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdResetQueryPool(commandBuffer:%p, queryPool:%p, firstQuery:%d, queryCount:%d)",
+        commandBuffer, queryPool, firstQuery, queryCount);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkQueryPool local_queryPool;
+    uint32_t local_firstQuery;
+    uint32_t local_queryCount;
+    local_commandBuffer = commandBuffer;
+    local_queryPool = queryPool;
+    local_firstQuery = firstQuery;
+    local_queryCount = queryCount;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdResetQueryPool = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdResetQueryPool);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdResetQueryPool -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdResetQueryPool);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdResetQueryPool = OP_vkCmdResetQueryPool;
+    memcpy(streamPtr, &opcode_vkCmdResetQueryPool, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdResetQueryPool, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkQueryPool((*&local_queryPool));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstQuery, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_queryCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdResetQueryPool), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdWriteTimestamp(VkCommandBuffer commandBuffer,
+                                    VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool,
+                                    uint32_t query, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdWriteTimestamp in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdWriteTimestamp(commandBuffer:%p, queryPool:%p, query:%d)",
+                      commandBuffer, queryPool, query);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkPipelineStageFlagBits local_pipelineStage;
+    VkQueryPool local_queryPool;
+    uint32_t local_query;
+    local_commandBuffer = commandBuffer;
+    local_pipelineStage = pipelineStage;
+    local_queryPool = queryPool;
+    local_query = query;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkPipelineStageFlagBits);
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdWriteTimestamp = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdWriteTimestamp);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdWriteTimestamp -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdWriteTimestamp);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdWriteTimestamp = OP_vkCmdWriteTimestamp;
+    memcpy(streamPtr, &opcode_vkCmdWriteTimestamp, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdWriteTimestamp, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkPipelineStageFlagBits*)&local_pipelineStage,
+           sizeof(VkPipelineStageFlagBits));
+    *streamPtrPtr += sizeof(VkPipelineStageFlagBits);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkQueryPool((*&local_queryPool));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_query, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdWriteTimestamp), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool,
+                                          uint32_t firstQuery, uint32_t queryCount,
+                                          VkBuffer dstBuffer, VkDeviceSize dstOffset,
+                                          VkDeviceSize stride, VkQueryResultFlags flags,
+                                          uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdCopyQueryPoolResults in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdCopyQueryPoolResults(commandBuffer:%p, queryPool:%p, firstQuery:%d, queryCount:%d, "
+        "dstBuffer:%p, dstOffset:%ld, stride:%ld, flags:%d)",
+        commandBuffer, queryPool, firstQuery, queryCount, dstBuffer, dstOffset, stride, flags);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkQueryPool local_queryPool;
+    uint32_t local_firstQuery;
+    uint32_t local_queryCount;
+    VkBuffer local_dstBuffer;
+    VkDeviceSize local_dstOffset;
+    VkDeviceSize local_stride;
+    VkQueryResultFlags local_flags;
+    local_commandBuffer = commandBuffer;
+    local_queryPool = queryPool;
+    local_firstQuery = firstQuery;
+    local_queryCount = queryCount;
+    local_dstBuffer = dstBuffer;
+    local_dstOffset = dstOffset;
+    local_stride = stride;
+    local_flags = flags;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        uint64_t cgen_var_2;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        *countPtr += sizeof(VkDeviceSize);
+        *countPtr += sizeof(VkQueryResultFlags);
+    }
+    uint32_t packetSize_vkCmdCopyQueryPoolResults = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdCopyQueryPoolResults);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdCopyQueryPoolResults -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdCopyQueryPoolResults);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdCopyQueryPoolResults = OP_vkCmdCopyQueryPoolResults;
+    memcpy(streamPtr, &opcode_vkCmdCopyQueryPoolResults, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdCopyQueryPoolResults, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkQueryPool((*&local_queryPool));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstQuery, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_queryCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkBuffer((*&local_dstBuffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_stride, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    memcpy(*streamPtrPtr, (VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags));
+    *streamPtrPtr += sizeof(VkQueryResultFlags);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdCopyQueryPoolResults), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout,
+                                   VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size,
+                                   const void* pValues, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdPushConstants in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdPushConstants(commandBuffer:%p, layout:%p, stageFlags:%d, offset:%d, size:%d, "
+        "pValues:%p)",
+        commandBuffer, layout, stageFlags, offset, size, pValues);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkPipelineLayout local_layout;
+    VkShaderStageFlags local_stageFlags;
+    uint32_t local_offset;
+    uint32_t local_size;
+    void* local_pValues;
+    local_commandBuffer = commandBuffer;
+    local_layout = layout;
+    local_stageFlags = stageFlags;
+    local_offset = offset;
+    local_size = size;
+    // Avoiding deepcopy for pValues
+    local_pValues = (void*)pValues;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkShaderStageFlags);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += ((size)) * sizeof(uint8_t);
+    }
+    uint32_t packetSize_vkCmdPushConstants = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdPushConstants);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdPushConstants -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdPushConstants);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdPushConstants = OP_vkCmdPushConstants;
+    memcpy(streamPtr, &opcode_vkCmdPushConstants, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdPushConstants, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPipelineLayout((*&local_layout));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkShaderStageFlags*)&local_stageFlags, sizeof(VkShaderStageFlags));
+    *streamPtrPtr += sizeof(VkShaderStageFlags);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_offset, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_size, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (void*)local_pValues, ((size)) * sizeof(uint8_t));
+    *streamPtrPtr += ((size)) * sizeof(uint8_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdPushConstants), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdBeginRenderPass(VkCommandBuffer commandBuffer,
+                                     const VkRenderPassBeginInfo* pRenderPassBegin,
+                                     VkSubpassContents contents, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdBeginRenderPass in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdBeginRenderPass(commandBuffer:%p, pRenderPassBegin:%p)", commandBuffer,
+                      pRenderPassBegin);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkRenderPassBeginInfo* local_pRenderPassBegin;
+    VkSubpassContents local_contents;
+    local_commandBuffer = commandBuffer;
+    local_pRenderPassBegin = nullptr;
+    if (pRenderPassBegin) {
+        local_pRenderPassBegin =
+            (VkRenderPassBeginInfo*)pool->alloc(sizeof(const VkRenderPassBeginInfo));
+        deepcopy_VkRenderPassBeginInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pRenderPassBegin,
+                                       (VkRenderPassBeginInfo*)(local_pRenderPassBegin));
+    }
+    local_contents = contents;
+    if (local_pRenderPassBegin) {
+        transform_tohost_VkRenderPassBeginInfo(sResourceTracker,
+                                               (VkRenderPassBeginInfo*)(local_pRenderPassBegin));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkRenderPassBeginInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkRenderPassBeginInfo*)(local_pRenderPassBegin), countPtr);
+        *countPtr += sizeof(VkSubpassContents);
+    }
+    uint32_t packetSize_vkCmdBeginRenderPass = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdBeginRenderPass);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdBeginRenderPass -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdBeginRenderPass);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdBeginRenderPass = OP_vkCmdBeginRenderPass;
+    memcpy(streamPtr, &opcode_vkCmdBeginRenderPass, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdBeginRenderPass, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkRenderPassBeginInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkRenderPassBeginInfo*)(local_pRenderPassBegin),
+                                          streamPtrPtr);
+    memcpy(*streamPtrPtr, (VkSubpassContents*)&local_contents, sizeof(VkSubpassContents));
+    *streamPtrPtr += sizeof(VkSubpassContents);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdBeginRenderPass), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents,
+                                 uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdNextSubpass in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdNextSubpass(commandBuffer:%p)", commandBuffer);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkSubpassContents local_contents;
+    local_commandBuffer = commandBuffer;
+    local_contents = contents;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkSubpassContents);
+    }
+    uint32_t packetSize_vkCmdNextSubpass = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdNextSubpass);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdNextSubpass -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdNextSubpass);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdNextSubpass = OP_vkCmdNextSubpass;
+    memcpy(streamPtr, &opcode_vkCmdNextSubpass, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdNextSubpass, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkSubpassContents*)&local_contents, sizeof(VkSubpassContents));
+    *streamPtrPtr += sizeof(VkSubpassContents);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdNextSubpass), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdEndRenderPass(VkCommandBuffer commandBuffer, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdEndRenderPass in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdEndRenderPass(commandBuffer:%p)", commandBuffer);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    local_commandBuffer = commandBuffer;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkCmdEndRenderPass = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdEndRenderPass);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdEndRenderPass -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdEndRenderPass);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdEndRenderPass = OP_vkCmdEndRenderPass;
+    memcpy(streamPtr, &opcode_vkCmdEndRenderPass, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdEndRenderPass, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdEndRenderPass), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBufferCount,
+                                     const VkCommandBuffer* pCommandBuffers, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdExecuteCommands in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdExecuteCommands(commandBuffer:%p, commandBufferCount:%d, pCommandBuffers:%p)",
+        commandBuffer, commandBufferCount, pCommandBuffers);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_commandBufferCount;
+    VkCommandBuffer* local_pCommandBuffers;
+    local_commandBuffer = commandBuffer;
+    local_commandBufferCount = commandBufferCount;
+    // Avoiding deepcopy for pCommandBuffers
+    local_pCommandBuffers = (VkCommandBuffer*)pCommandBuffers;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        if (((commandBufferCount))) {
+            *countPtr += ((commandBufferCount)) * 8;
+        }
+    }
+    uint32_t packetSize_vkCmdExecuteCommands = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdExecuteCommands);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdExecuteCommands -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdExecuteCommands);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdExecuteCommands = OP_vkCmdExecuteCommands;
+    memcpy(streamPtr, &opcode_vkCmdExecuteCommands, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdExecuteCommands, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_commandBufferCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (((commandBufferCount))) {
+        uint8_t* cgen_var_0_ptr = (uint8_t*)(*streamPtrPtr);
+        for (uint32_t k = 0; k < ((commandBufferCount)); ++k) {
+            uint64_t tmpval = get_host_u64_VkCommandBuffer(local_pCommandBuffers[k]);
+            memcpy(cgen_var_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+        }
+        *streamPtrPtr += 8 * ((commandBufferCount));
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdExecuteCommands), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_VERSION_1_1
+VkResult VkEncoder::vkEnumerateInstanceVersion(uint32_t* pApiVersion, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkEnumerateInstanceVersion in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkEnumerateInstanceVersion(pApiVersion:%p)", pApiVersion);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    size_t count = 0;
+    size_t* countPtr = &count;
+    { *countPtr += sizeof(uint32_t); }
+    uint32_t packetSize_vkEnumerateInstanceVersion =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkEnumerateInstanceVersion);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkEnumerateInstanceVersion);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkEnumerateInstanceVersion = OP_vkEnumerateInstanceVersion;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkEnumerateInstanceVersion, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkEnumerateInstanceVersion, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)pApiVersion, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkEnumerateInstanceVersion), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((uint32_t*)pApiVersion, sizeof(uint32_t));
+    VkResult vkEnumerateInstanceVersion_VkResult_return = (VkResult)0;
+    stream->read(&vkEnumerateInstanceVersion_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkEnumerateInstanceVersion_VkResult_return;
+}
+
+VkResult VkEncoder::vkBindBufferMemory2(VkDevice device, uint32_t bindInfoCount,
+                                        const VkBindBufferMemoryInfo* pBindInfos, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkBindBufferMemory2 in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkBindBufferMemory2(device:%p, bindInfoCount:%d, pBindInfos:%p)", device,
+                      bindInfoCount, pBindInfos);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    uint32_t local_bindInfoCount;
+    VkBindBufferMemoryInfo* local_pBindInfos;
+    local_device = device;
+    local_bindInfoCount = bindInfoCount;
+    local_pBindInfos = nullptr;
+    if (pBindInfos) {
+        local_pBindInfos = (VkBindBufferMemoryInfo*)pool->alloc(
+            ((bindInfoCount)) * sizeof(const VkBindBufferMemoryInfo));
+        for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) {
+            deepcopy_VkBindBufferMemoryInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pBindInfos + i,
+                                            (VkBindBufferMemoryInfo*)(local_pBindInfos + i));
+        }
+    }
+    if (local_pBindInfos) {
+        for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) {
+            transform_tohost_VkBindBufferMemoryInfo(
+                sResourceTracker, (VkBindBufferMemoryInfo*)(local_pBindInfos + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) {
+            count_VkBindBufferMemoryInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkBindBufferMemoryInfo*)(local_pBindInfos + i), countPtr);
+        }
+    }
+    uint32_t packetSize_vkBindBufferMemory2 =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkBindBufferMemory2);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkBindBufferMemory2);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkBindBufferMemory2 = OP_vkBindBufferMemory2;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkBindBufferMemory2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkBindBufferMemory2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) {
+        reservedmarshal_VkBindBufferMemoryInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                               (VkBindBufferMemoryInfo*)(local_pBindInfos + i),
+                                               streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkBindBufferMemory2), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkBindBufferMemory2_VkResult_return = (VkResult)0;
+    stream->read(&vkBindBufferMemory2_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkBindBufferMemory2_VkResult_return;
+}
+
+VkResult VkEncoder::vkBindImageMemory2(VkDevice device, uint32_t bindInfoCount,
+                                       const VkBindImageMemoryInfo* pBindInfos, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkBindImageMemory2 in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkBindImageMemory2(device:%p, bindInfoCount:%d, pBindInfos:%p)", device,
+                      bindInfoCount, pBindInfos);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    uint32_t local_bindInfoCount;
+    VkBindImageMemoryInfo* local_pBindInfos;
+    local_device = device;
+    local_bindInfoCount = bindInfoCount;
+    local_pBindInfos = nullptr;
+    if (pBindInfos) {
+        local_pBindInfos = (VkBindImageMemoryInfo*)pool->alloc(((bindInfoCount)) *
+                                                               sizeof(const VkBindImageMemoryInfo));
+        for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) {
+            deepcopy_VkBindImageMemoryInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pBindInfos + i,
+                                           (VkBindImageMemoryInfo*)(local_pBindInfos + i));
+        }
+    }
+    if (local_pBindInfos) {
+        for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) {
+            transform_tohost_VkBindImageMemoryInfo(sResourceTracker,
+                                                   (VkBindImageMemoryInfo*)(local_pBindInfos + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) {
+            count_VkBindImageMemoryInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkBindImageMemoryInfo*)(local_pBindInfos + i), countPtr);
+        }
+    }
+    uint32_t packetSize_vkBindImageMemory2 =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkBindImageMemory2);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkBindImageMemory2);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkBindImageMemory2 = OP_vkBindImageMemory2;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkBindImageMemory2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkBindImageMemory2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) {
+        reservedmarshal_VkBindImageMemoryInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkBindImageMemoryInfo*)(local_pBindInfos + i),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkBindImageMemory2), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkBindImageMemory2_VkResult_return = (VkResult)0;
+    stream->read(&vkBindImageMemory2_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkBindImageMemory2_VkResult_return;
+}
+
+void VkEncoder::vkGetDeviceGroupPeerMemoryFeatures(VkDevice device, uint32_t heapIndex,
+                                                   uint32_t localDeviceIndex,
+                                                   uint32_t remoteDeviceIndex,
+                                                   VkPeerMemoryFeatureFlags* pPeerMemoryFeatures,
+                                                   uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetDeviceGroupPeerMemoryFeatures in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetDeviceGroupPeerMemoryFeatures(device:%p, heapIndex:%d, localDeviceIndex:%d, "
+        "remoteDeviceIndex:%d, pPeerMemoryFeatures:%p)",
+        device, heapIndex, localDeviceIndex, remoteDeviceIndex, pPeerMemoryFeatures);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    uint32_t local_heapIndex;
+    uint32_t local_localDeviceIndex;
+    uint32_t local_remoteDeviceIndex;
+    local_device = device;
+    local_heapIndex = heapIndex;
+    local_localDeviceIndex = localDeviceIndex;
+    local_remoteDeviceIndex = remoteDeviceIndex;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(VkPeerMemoryFeatureFlags);
+    }
+    uint32_t packetSize_vkGetDeviceGroupPeerMemoryFeatures =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetDeviceGroupPeerMemoryFeatures);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetDeviceGroupPeerMemoryFeatures);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetDeviceGroupPeerMemoryFeatures = OP_vkGetDeviceGroupPeerMemoryFeatures;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetDeviceGroupPeerMemoryFeatures, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetDeviceGroupPeerMemoryFeatures, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_heapIndex, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_localDeviceIndex, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures,
+           sizeof(VkPeerMemoryFeatureFlags));
+    *streamPtrPtr += sizeof(VkPeerMemoryFeatureFlags);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetDeviceGroupPeerMemoryFeatures), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdSetDeviceMask(VkCommandBuffer commandBuffer, uint32_t deviceMask,
+                                   uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetDeviceMask in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdSetDeviceMask(commandBuffer:%p, deviceMask:%d)", commandBuffer,
+                      deviceMask);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_deviceMask;
+    local_commandBuffer = commandBuffer;
+    local_deviceMask = deviceMask;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdSetDeviceMask = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetDeviceMask);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetDeviceMask -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetDeviceMask);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetDeviceMask = OP_vkCmdSetDeviceMask;
+    memcpy(streamPtr, &opcode_vkCmdSetDeviceMask, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetDeviceMask, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_deviceMask, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetDeviceMask), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdDispatchBase(VkCommandBuffer commandBuffer, uint32_t baseGroupX,
+                                  uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX,
+                                  uint32_t groupCountY, uint32_t groupCountZ, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdDispatchBase in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdDispatchBase(commandBuffer:%p, baseGroupX:%d, baseGroupY:%d, baseGroupZ:%d, "
+        "groupCountX:%d, groupCountY:%d, groupCountZ:%d)",
+        commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_baseGroupX;
+    uint32_t local_baseGroupY;
+    uint32_t local_baseGroupZ;
+    uint32_t local_groupCountX;
+    uint32_t local_groupCountY;
+    uint32_t local_groupCountZ;
+    local_commandBuffer = commandBuffer;
+    local_baseGroupX = baseGroupX;
+    local_baseGroupY = baseGroupY;
+    local_baseGroupZ = baseGroupZ;
+    local_groupCountX = groupCountX;
+    local_groupCountY = groupCountY;
+    local_groupCountZ = groupCountZ;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdDispatchBase = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdDispatchBase);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdDispatchBase -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdDispatchBase);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdDispatchBase = OP_vkCmdDispatchBase;
+    memcpy(streamPtr, &opcode_vkCmdDispatchBase, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdDispatchBase, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_baseGroupX, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_baseGroupY, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_baseGroupZ, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_groupCountX, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_groupCountY, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_groupCountZ, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdDispatchBase), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkEnumeratePhysicalDeviceGroups(
+    VkInstance instance, uint32_t* pPhysicalDeviceGroupCount,
+    VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkEnumeratePhysicalDeviceGroups in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkEnumeratePhysicalDeviceGroups(instance:%p, pPhysicalDeviceGroupCount:%p, "
+        "pPhysicalDeviceGroupProperties:%p)",
+        instance, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkInstance local_instance;
+    local_instance = instance;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pPhysicalDeviceGroupCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pPhysicalDeviceGroupProperties) {
+            if (pPhysicalDeviceGroupCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) {
+                    count_VkPhysicalDeviceGroupProperties(
+                        sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                        (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i),
+                        countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkEnumeratePhysicalDeviceGroups =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkEnumeratePhysicalDeviceGroups);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkEnumeratePhysicalDeviceGroups);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkEnumeratePhysicalDeviceGroups = OP_vkEnumeratePhysicalDeviceGroups;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkEnumeratePhysicalDeviceGroups, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkEnumeratePhysicalDeviceGroups, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkInstance((*&local_instance));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pPhysicalDeviceGroupCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pPhysicalDeviceGroupProperties) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) {
+            reservedmarshal_VkPhysicalDeviceGroupProperties(
+                stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i),
+                streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkEnumeratePhysicalDeviceGroups), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pPhysicalDeviceGroupCount;
+    check_pPhysicalDeviceGroupCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pPhysicalDeviceGroupCount) {
+        if (!(check_pPhysicalDeviceGroupCount)) {
+            fprintf(stderr,
+                    "fatal: pPhysicalDeviceGroupCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkPhysicalDeviceGroupProperties* check_pPhysicalDeviceGroupProperties;
+    check_pPhysicalDeviceGroupProperties =
+        (VkPhysicalDeviceGroupProperties*)(uintptr_t)stream->getBe64();
+    if (pPhysicalDeviceGroupProperties) {
+        if (!(check_pPhysicalDeviceGroupProperties)) {
+            fprintf(stderr,
+                    "fatal: pPhysicalDeviceGroupProperties inconsistent between guest and host\n");
+        }
+        if (pPhysicalDeviceGroupCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) {
+                unmarshal_VkPhysicalDeviceGroupProperties(
+                    stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                    (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i));
+            }
+        }
+    }
+    if (pPhysicalDeviceGroupCount) {
+        if (pPhysicalDeviceGroupProperties) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) {
+                transform_fromhost_VkPhysicalDeviceGroupProperties(
+                    sResourceTracker,
+                    (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i));
+            }
+        }
+    }
+    VkResult vkEnumeratePhysicalDeviceGroups_VkResult_return = (VkResult)0;
+    stream->read(&vkEnumeratePhysicalDeviceGroups_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkEnumeratePhysicalDeviceGroups_VkResult_return;
+}
+
+void VkEncoder::vkGetImageMemoryRequirements2(VkDevice device,
+                                              const VkImageMemoryRequirementsInfo2* pInfo,
+                                              VkMemoryRequirements2* pMemoryRequirements,
+                                              uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetImageMemoryRequirements2 in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetImageMemoryRequirements2(device:%p, pInfo:%p, pMemoryRequirements:%p)",
+                      device, pInfo, pMemoryRequirements);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkImageMemoryRequirementsInfo2* local_pInfo;
+    local_device = device;
+    local_pInfo = nullptr;
+    if (pInfo) {
+        local_pInfo = (VkImageMemoryRequirementsInfo2*)pool->alloc(
+            sizeof(const VkImageMemoryRequirementsInfo2));
+        deepcopy_VkImageMemoryRequirementsInfo2(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfo,
+                                                (VkImageMemoryRequirementsInfo2*)(local_pInfo));
+    }
+    if (local_pInfo) {
+        transform_tohost_VkImageMemoryRequirementsInfo2(
+            sResourceTracker, (VkImageMemoryRequirementsInfo2*)(local_pInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkImageMemoryRequirementsInfo2(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                             (VkImageMemoryRequirementsInfo2*)(local_pInfo),
+                                             countPtr);
+        count_VkMemoryRequirements2(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkMemoryRequirements2*)(pMemoryRequirements), countPtr);
+    }
+    uint32_t packetSize_vkGetImageMemoryRequirements2 =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetImageMemoryRequirements2);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetImageMemoryRequirements2);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetImageMemoryRequirements2 = OP_vkGetImageMemoryRequirements2;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetImageMemoryRequirements2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetImageMemoryRequirements2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkImageMemoryRequirementsInfo2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                   (VkImageMemoryRequirementsInfo2*)(local_pInfo),
+                                                   streamPtrPtr);
+    reservedmarshal_VkMemoryRequirements2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkMemoryRequirements2*)(pMemoryRequirements),
+                                          streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetImageMemoryRequirements2), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkMemoryRequirements2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkMemoryRequirements2*)(pMemoryRequirements));
+    if (pMemoryRequirements) {
+        transform_fromhost_VkMemoryRequirements2(sResourceTracker,
+                                                 (VkMemoryRequirements2*)(pMemoryRequirements));
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetBufferMemoryRequirements2(VkDevice device,
+                                               const VkBufferMemoryRequirementsInfo2* pInfo,
+                                               VkMemoryRequirements2* pMemoryRequirements,
+                                               uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetBufferMemoryRequirements2 in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetBufferMemoryRequirements2(device:%p, pInfo:%p, pMemoryRequirements:%p)",
+                      device, pInfo, pMemoryRequirements);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkBufferMemoryRequirementsInfo2* local_pInfo;
+    local_device = device;
+    local_pInfo = nullptr;
+    if (pInfo) {
+        local_pInfo = (VkBufferMemoryRequirementsInfo2*)pool->alloc(
+            sizeof(const VkBufferMemoryRequirementsInfo2));
+        deepcopy_VkBufferMemoryRequirementsInfo2(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfo,
+                                                 (VkBufferMemoryRequirementsInfo2*)(local_pInfo));
+    }
+    if (local_pInfo) {
+        transform_tohost_VkBufferMemoryRequirementsInfo2(
+            sResourceTracker, (VkBufferMemoryRequirementsInfo2*)(local_pInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkBufferMemoryRequirementsInfo2(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkBufferMemoryRequirementsInfo2*)(local_pInfo),
+                                              countPtr);
+        count_VkMemoryRequirements2(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkMemoryRequirements2*)(pMemoryRequirements), countPtr);
+    }
+    uint32_t packetSize_vkGetBufferMemoryRequirements2 =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetBufferMemoryRequirements2);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetBufferMemoryRequirements2);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetBufferMemoryRequirements2 = OP_vkGetBufferMemoryRequirements2;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetBufferMemoryRequirements2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetBufferMemoryRequirements2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkBufferMemoryRequirementsInfo2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                    (VkBufferMemoryRequirementsInfo2*)(local_pInfo),
+                                                    streamPtrPtr);
+    reservedmarshal_VkMemoryRequirements2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkMemoryRequirements2*)(pMemoryRequirements),
+                                          streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetBufferMemoryRequirements2), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkMemoryRequirements2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkMemoryRequirements2*)(pMemoryRequirements));
+    if (pMemoryRequirements) {
+        transform_fromhost_VkMemoryRequirements2(sResourceTracker,
+                                                 (VkMemoryRequirements2*)(pMemoryRequirements));
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetImageSparseMemoryRequirements2(
+    VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo,
+    uint32_t* pSparseMemoryRequirementCount,
+    VkSparseImageMemoryRequirements2* pSparseMemoryRequirements, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetImageSparseMemoryRequirements2 in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetImageSparseMemoryRequirements2(device:%p, pInfo:%p, "
+        "pSparseMemoryRequirementCount:%p, pSparseMemoryRequirements:%p)",
+        device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkImageSparseMemoryRequirementsInfo2* local_pInfo;
+    local_device = device;
+    local_pInfo = nullptr;
+    if (pInfo) {
+        local_pInfo = (VkImageSparseMemoryRequirementsInfo2*)pool->alloc(
+            sizeof(const VkImageSparseMemoryRequirementsInfo2));
+        deepcopy_VkImageSparseMemoryRequirementsInfo2(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfo,
+            (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo));
+    }
+    if (local_pInfo) {
+        transform_tohost_VkImageSparseMemoryRequirementsInfo2(
+            sResourceTracker, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkImageSparseMemoryRequirementsInfo2(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pSparseMemoryRequirementCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pSparseMemoryRequirements) {
+            if (pSparseMemoryRequirementCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) {
+                    count_VkSparseImageMemoryRequirements2(
+                        sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                        (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i),
+                        countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetImageSparseMemoryRequirements2 =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetImageSparseMemoryRequirements2);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetImageSparseMemoryRequirements2);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetImageSparseMemoryRequirements2 = OP_vkGetImageSparseMemoryRequirements2;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetImageSparseMemoryRequirements2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetImageSparseMemoryRequirements2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkImageSparseMemoryRequirementsInfo2(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo),
+        streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pSparseMemoryRequirementCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pSparseMemoryRequirements;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pSparseMemoryRequirements) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) {
+            reservedmarshal_VkSparseImageMemoryRequirements2(
+                stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i), streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetImageSparseMemoryRequirements2),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pSparseMemoryRequirementCount;
+    check_pSparseMemoryRequirementCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pSparseMemoryRequirementCount) {
+        if (!(check_pSparseMemoryRequirementCount)) {
+            fprintf(stderr,
+                    "fatal: pSparseMemoryRequirementCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkSparseImageMemoryRequirements2* check_pSparseMemoryRequirements;
+    check_pSparseMemoryRequirements =
+        (VkSparseImageMemoryRequirements2*)(uintptr_t)stream->getBe64();
+    if (pSparseMemoryRequirements) {
+        if (!(check_pSparseMemoryRequirements)) {
+            fprintf(stderr,
+                    "fatal: pSparseMemoryRequirements inconsistent between guest and host\n");
+        }
+        if (pSparseMemoryRequirementCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) {
+                unmarshal_VkSparseImageMemoryRequirements2(
+                    stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                    (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i));
+            }
+        }
+    }
+    if (pSparseMemoryRequirementCount) {
+        if (pSparseMemoryRequirements) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) {
+                transform_fromhost_VkSparseImageMemoryRequirements2(
+                    sResourceTracker,
+                    (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i));
+            }
+        }
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
+                                             VkPhysicalDeviceFeatures2* pFeatures,
+                                             uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceFeatures2 in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetPhysicalDeviceFeatures2(physicalDevice:%p, pFeatures:%p)",
+                      physicalDevice, pFeatures);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    local_physicalDevice = physicalDevice;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPhysicalDeviceFeatures2(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkPhysicalDeviceFeatures2*)(pFeatures), countPtr);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceFeatures2 =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceFeatures2);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceFeatures2);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceFeatures2 = OP_vkGetPhysicalDeviceFeatures2;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceFeatures2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceFeatures2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPhysicalDeviceFeatures2(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkPhysicalDeviceFeatures2*)(pFeatures), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceFeatures2), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkPhysicalDeviceFeatures2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkPhysicalDeviceFeatures2*)(pFeatures));
+    if (pFeatures) {
+        transform_fromhost_VkPhysicalDeviceFeatures2(sResourceTracker,
+                                                     (VkPhysicalDeviceFeatures2*)(pFeatures));
+    }
+    sResourceTracker->on_vkGetPhysicalDeviceFeatures2(this, physicalDevice, pFeatures);
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice,
+                                               VkPhysicalDeviceProperties2* pProperties,
+                                               uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceProperties2 in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetPhysicalDeviceProperties2(physicalDevice:%p, pProperties:%p)",
+                      physicalDevice, pProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    local_physicalDevice = physicalDevice;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPhysicalDeviceProperties2(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkPhysicalDeviceProperties2*)(pProperties), countPtr);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceProperties2 =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceProperties2);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceProperties2);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceProperties2 = OP_vkGetPhysicalDeviceProperties2;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceProperties2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceProperties2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPhysicalDeviceProperties2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                (VkPhysicalDeviceProperties2*)(pProperties),
+                                                streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceProperties2), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkPhysicalDeviceProperties2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkPhysicalDeviceProperties2*)(pProperties));
+    if (pProperties) {
+        transform_fromhost_VkPhysicalDeviceProperties2(sResourceTracker,
+                                                       (VkPhysicalDeviceProperties2*)(pProperties));
+    }
+    sResourceTracker->on_vkGetPhysicalDeviceProperties2(this, physicalDevice, pProperties);
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetPhysicalDeviceFormatProperties2(VkPhysicalDevice physicalDevice,
+                                                     VkFormat format,
+                                                     VkFormatProperties2* pFormatProperties,
+                                                     uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceFormatProperties2 in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceFormatProperties2(physicalDevice:%p, format:%d, pFormatProperties:%p)",
+        physicalDevice, format, pFormatProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkFormat local_format;
+    local_physicalDevice = physicalDevice;
+    local_format = format;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkFormat);
+        count_VkFormatProperties2(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                  (VkFormatProperties2*)(pFormatProperties), countPtr);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceFormatProperties2 =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceFormatProperties2);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceFormatProperties2);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceFormatProperties2 = OP_vkGetPhysicalDeviceFormatProperties2;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceFormatProperties2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceFormatProperties2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkFormat*)&local_format, sizeof(VkFormat));
+    *streamPtrPtr += sizeof(VkFormat);
+    reservedmarshal_VkFormatProperties2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkFormatProperties2*)(pFormatProperties), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetPhysicalDeviceFormatProperties2),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkFormatProperties2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                  (VkFormatProperties2*)(pFormatProperties));
+    if (pFormatProperties) {
+        transform_fromhost_VkFormatProperties2(sResourceTracker,
+                                               (VkFormatProperties2*)(pFormatProperties));
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkGetPhysicalDeviceImageFormatProperties2(
+    VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
+    VkImageFormatProperties2* pImageFormatProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceImageFormatProperties2 in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceImageFormatProperties2(physicalDevice:%p, pImageFormatInfo:%p, "
+        "pImageFormatProperties:%p)",
+        physicalDevice, pImageFormatInfo, pImageFormatProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkPhysicalDeviceImageFormatInfo2* local_pImageFormatInfo;
+    local_physicalDevice = physicalDevice;
+    local_pImageFormatInfo = nullptr;
+    if (pImageFormatInfo) {
+        local_pImageFormatInfo = (VkPhysicalDeviceImageFormatInfo2*)pool->alloc(
+            sizeof(const VkPhysicalDeviceImageFormatInfo2));
+        deepcopy_VkPhysicalDeviceImageFormatInfo2(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pImageFormatInfo,
+            (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo));
+    }
+    if (local_pImageFormatInfo) {
+        transform_tohost_VkPhysicalDeviceImageFormatInfo2(
+            sResourceTracker, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPhysicalDeviceImageFormatInfo2(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo), countPtr);
+        count_VkImageFormatProperties2(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkImageFormatProperties2*)(pImageFormatProperties),
+                                       countPtr);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceImageFormatProperties2 =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceImageFormatProperties2);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceImageFormatProperties2);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties2 =
+        OP_vkGetPhysicalDeviceImageFormatProperties2;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceImageFormatProperties2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceImageFormatProperties2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPhysicalDeviceImageFormatInfo2(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo), streamPtrPtr);
+    reservedmarshal_VkImageFormatProperties2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                             (VkImageFormatProperties2*)(pImageFormatProperties),
+                                             streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceImageFormatProperties2),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkImageFormatProperties2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkImageFormatProperties2*)(pImageFormatProperties));
+    if (pImageFormatProperties) {
+        transform_fromhost_VkImageFormatProperties2(
+            sResourceTracker, (VkImageFormatProperties2*)(pImageFormatProperties));
+    }
+    VkResult vkGetPhysicalDeviceImageFormatProperties2_VkResult_return = (VkResult)0;
+    stream->read(&vkGetPhysicalDeviceImageFormatProperties2_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDeviceImageFormatProperties2_VkResult_return;
+}
+
+void VkEncoder::vkGetPhysicalDeviceQueueFamilyProperties2(
+    VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount,
+    VkQueueFamilyProperties2* pQueueFamilyProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceQueueFamilyProperties2 in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceQueueFamilyProperties2(physicalDevice:%p, "
+        "pQueueFamilyPropertyCount:%p, pQueueFamilyProperties:%p)",
+        physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    local_physicalDevice = physicalDevice;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pQueueFamilyPropertyCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pQueueFamilyProperties) {
+            if (pQueueFamilyPropertyCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) {
+                    count_VkQueueFamilyProperties2(
+                        sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                        (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i), countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceQueueFamilyProperties2 =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceQueueFamilyProperties2);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceQueueFamilyProperties2);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties2 =
+        OP_vkGetPhysicalDeviceQueueFamilyProperties2;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceQueueFamilyProperties2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceQueueFamilyProperties2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pQueueFamilyPropertyCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pQueueFamilyProperties;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pQueueFamilyProperties) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) {
+            reservedmarshal_VkQueueFamilyProperties2(
+                stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i), streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceQueueFamilyProperties2),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pQueueFamilyPropertyCount;
+    check_pQueueFamilyPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pQueueFamilyPropertyCount) {
+        if (!(check_pQueueFamilyPropertyCount)) {
+            fprintf(stderr,
+                    "fatal: pQueueFamilyPropertyCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkQueueFamilyProperties2* check_pQueueFamilyProperties;
+    check_pQueueFamilyProperties = (VkQueueFamilyProperties2*)(uintptr_t)stream->getBe64();
+    if (pQueueFamilyProperties) {
+        if (!(check_pQueueFamilyProperties)) {
+            fprintf(stderr, "fatal: pQueueFamilyProperties inconsistent between guest and host\n");
+        }
+        if (pQueueFamilyPropertyCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) {
+                unmarshal_VkQueueFamilyProperties2(
+                    stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                    (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i));
+            }
+        }
+    }
+    if (pQueueFamilyPropertyCount) {
+        if (pQueueFamilyProperties) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) {
+                transform_fromhost_VkQueueFamilyProperties2(
+                    sResourceTracker, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i));
+            }
+        }
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetPhysicalDeviceMemoryProperties2(
+    VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2* pMemoryProperties,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceMemoryProperties2 in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceMemoryProperties2(physicalDevice:%p, pMemoryProperties:%p)",
+        physicalDevice, pMemoryProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    local_physicalDevice = physicalDevice;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPhysicalDeviceMemoryProperties2(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties), countPtr);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties2 =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceMemoryProperties2);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceMemoryProperties2);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceMemoryProperties2 = OP_vkGetPhysicalDeviceMemoryProperties2;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceMemoryProperties2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceMemoryProperties2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPhysicalDeviceMemoryProperties2(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties),
+        streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetPhysicalDeviceMemoryProperties2),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkPhysicalDeviceMemoryProperties2(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties));
+    if (pMemoryProperties) {
+        transform_fromhost_VkPhysicalDeviceMemoryProperties2(
+            sResourceTracker, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties));
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetPhysicalDeviceSparseImageFormatProperties2(
+    VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo,
+    uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkGetPhysicalDeviceSparseImageFormatProperties2 in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceSparseImageFormatProperties2(physicalDevice:%p, pFormatInfo:%p, "
+        "pPropertyCount:%p, pProperties:%p)",
+        physicalDevice, pFormatInfo, pPropertyCount, pProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkPhysicalDeviceSparseImageFormatInfo2* local_pFormatInfo;
+    local_physicalDevice = physicalDevice;
+    local_pFormatInfo = nullptr;
+    if (pFormatInfo) {
+        local_pFormatInfo = (VkPhysicalDeviceSparseImageFormatInfo2*)pool->alloc(
+            sizeof(const VkPhysicalDeviceSparseImageFormatInfo2));
+        deepcopy_VkPhysicalDeviceSparseImageFormatInfo2(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pFormatInfo,
+            (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo));
+    }
+    if (local_pFormatInfo) {
+        transform_tohost_VkPhysicalDeviceSparseImageFormatInfo2(
+            sResourceTracker, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPhysicalDeviceSparseImageFormatInfo2(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pPropertyCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pProperties) {
+            if (pPropertyCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                    count_VkSparseImageFormatProperties2(
+                        sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                        (VkSparseImageFormatProperties2*)(pProperties + i), countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2 =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2);
+    uint8_t* streamPtr =
+        stream->reserve(packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties2 =
+        OP_vkGetPhysicalDeviceSparseImageFormatProperties2;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceSparseImageFormatProperties2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2,
+           sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPhysicalDeviceSparseImageFormatInfo2(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo), streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pPropertyCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pPropertyCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pPropertyCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pProperties;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pProperties) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+            reservedmarshal_VkSparseImageFormatProperties2(
+                stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkSparseImageFormatProperties2*)(pProperties + i), streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pPropertyCount;
+    check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pPropertyCount) {
+        if (!(check_pPropertyCount)) {
+            fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkSparseImageFormatProperties2* check_pProperties;
+    check_pProperties = (VkSparseImageFormatProperties2*)(uintptr_t)stream->getBe64();
+    if (pProperties) {
+        if (!(check_pProperties)) {
+            fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
+        }
+        if (pPropertyCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                unmarshal_VkSparseImageFormatProperties2(
+                    stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                    (VkSparseImageFormatProperties2*)(pProperties + i));
+            }
+        }
+    }
+    if (pPropertyCount) {
+        if (pProperties) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                transform_fromhost_VkSparseImageFormatProperties2(
+                    sResourceTracker, (VkSparseImageFormatProperties2*)(pProperties + i));
+            }
+        }
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkTrimCommandPool(VkDevice device, VkCommandPool commandPool,
+                                  VkCommandPoolTrimFlags flags, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkTrimCommandPool in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkTrimCommandPool(device:%p, commandPool:%p, flags:%d)", device, commandPool,
+                      flags);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkCommandPool local_commandPool;
+    VkCommandPoolTrimFlags local_flags;
+    local_device = device;
+    local_commandPool = commandPool;
+    local_flags = flags;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkCommandPoolTrimFlags);
+    }
+    uint32_t packetSize_vkTrimCommandPool =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkTrimCommandPool);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkTrimCommandPool);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkTrimCommandPool = OP_vkTrimCommandPool;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkTrimCommandPool, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkTrimCommandPool, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkCommandPool((*&local_commandPool));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags));
+    *streamPtrPtr += sizeof(VkCommandPoolTrimFlags);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkTrimCommandPool), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2* pQueueInfo,
+                                  VkQueue* pQueue, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetDeviceQueue2 in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetDeviceQueue2(device:%p, pQueueInfo:%p, pQueue:%p)", device, pQueueInfo,
+                      pQueue);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDeviceQueueInfo2* local_pQueueInfo;
+    local_device = device;
+    local_pQueueInfo = nullptr;
+    if (pQueueInfo) {
+        local_pQueueInfo = (VkDeviceQueueInfo2*)pool->alloc(sizeof(const VkDeviceQueueInfo2));
+        deepcopy_VkDeviceQueueInfo2(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pQueueInfo,
+                                    (VkDeviceQueueInfo2*)(local_pQueueInfo));
+    }
+    if (local_pQueueInfo) {
+        transform_tohost_VkDeviceQueueInfo2(sResourceTracker,
+                                            (VkDeviceQueueInfo2*)(local_pQueueInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDeviceQueueInfo2(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                 (VkDeviceQueueInfo2*)(local_pQueueInfo), countPtr);
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkGetDeviceQueue2 =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetDeviceQueue2);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetDeviceQueue2);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetDeviceQueue2 = OP_vkGetDeviceQueue2;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetDeviceQueue2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetDeviceQueue2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDeviceQueueInfo2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkDeviceQueueInfo2*)(local_pQueueInfo), streamPtrPtr);
+    /* is handle, possibly out */;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = (uint64_t)((*pQueue));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetDeviceQueue2), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_2;
+    stream->read((uint64_t*)&cgen_var_2, 8);
+    stream->handleMapping()->mapHandles_u64_VkQueue(&cgen_var_2, (VkQueue*)pQueue, 1);
+    stream->unsetHandleMapping();
+    sResourceTracker->on_vkGetDeviceQueue2(this, device, pQueueInfo, pQueue);
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkCreateSamplerYcbcrConversion(
+    VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateSamplerYcbcrConversion in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateSamplerYcbcrConversion(device:%p, pCreateInfo:%p, pAllocator:%p, "
+        "pYcbcrConversion:%p)",
+        device, pCreateInfo, pAllocator, pYcbcrConversion);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSamplerYcbcrConversionCreateInfo* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkSamplerYcbcrConversionCreateInfo*)pool->alloc(
+            sizeof(const VkSamplerYcbcrConversionCreateInfo));
+        deepcopy_VkSamplerYcbcrConversionCreateInfo(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+            (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkSamplerYcbcrConversionCreateInfo(
+            sResourceTracker, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkSamplerYcbcrConversionCreateInfo(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateSamplerYcbcrConversion =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCreateSamplerYcbcrConversion);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateSamplerYcbcrConversion);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateSamplerYcbcrConversion = OP_vkCreateSamplerYcbcrConversion;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateSamplerYcbcrConversion, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateSamplerYcbcrConversion, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkSamplerYcbcrConversionCreateInfo(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo), streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pYcbcrConversion));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateSamplerYcbcrConversion), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkSamplerYcbcrConversion(
+        &cgen_var_3, (VkSamplerYcbcrConversion*)pYcbcrConversion, 1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateSamplerYcbcrConversion_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateSamplerYcbcrConversion_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateSamplerYcbcrConversion_VkResult_return;
+}
+
+void VkEncoder::vkDestroySamplerYcbcrConversion(VkDevice device,
+                                                VkSamplerYcbcrConversion ycbcrConversion,
+                                                const VkAllocationCallbacks* pAllocator,
+                                                uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroySamplerYcbcrConversion in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkDestroySamplerYcbcrConversion(device:%p, ycbcrConversion:%p, pAllocator:%p)", device,
+        ycbcrConversion, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSamplerYcbcrConversion local_ycbcrConversion;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_ycbcrConversion = ycbcrConversion;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroySamplerYcbcrConversion =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkDestroySamplerYcbcrConversion);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroySamplerYcbcrConversion);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroySamplerYcbcrConversion = OP_vkDestroySamplerYcbcrConversion;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroySamplerYcbcrConversion, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroySamplerYcbcrConversion, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkSamplerYcbcrConversion((*&local_ycbcrConversion));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroySamplerYcbcrConversion), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkSamplerYcbcrConversion(
+        (VkSamplerYcbcrConversion*)&ycbcrConversion);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkCreateDescriptorUpdateTemplate(
+    VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateDescriptorUpdateTemplate in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateDescriptorUpdateTemplate(device:%p, pCreateInfo:%p, pAllocator:%p, "
+        "pDescriptorUpdateTemplate:%p)",
+        device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDescriptorUpdateTemplateCreateInfo* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkDescriptorUpdateTemplateCreateInfo*)pool->alloc(
+            sizeof(const VkDescriptorUpdateTemplateCreateInfo));
+        deepcopy_VkDescriptorUpdateTemplateCreateInfo(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+            (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkDescriptorUpdateTemplateCreateInfo(
+            sResourceTracker, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDescriptorUpdateTemplateCreateInfo(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateDescriptorUpdateTemplate =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCreateDescriptorUpdateTemplate);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateDescriptorUpdateTemplate);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateDescriptorUpdateTemplate = OP_vkCreateDescriptorUpdateTemplate;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateDescriptorUpdateTemplate, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateDescriptorUpdateTemplate, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDescriptorUpdateTemplateCreateInfo(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo), streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pDescriptorUpdateTemplate));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateDescriptorUpdateTemplate), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkDescriptorUpdateTemplate(
+        &cgen_var_3, (VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, 1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateDescriptorUpdateTemplate_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateDescriptorUpdateTemplate_VkResult_return, sizeof(VkResult));
+    sResourceTracker->on_vkCreateDescriptorUpdateTemplate(
+        this, vkCreateDescriptorUpdateTemplate_VkResult_return, device, pCreateInfo, pAllocator,
+        pDescriptorUpdateTemplate);
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateDescriptorUpdateTemplate_VkResult_return;
+}
+
+void VkEncoder::vkDestroyDescriptorUpdateTemplate(
+    VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate,
+    const VkAllocationCallbacks* pAllocator, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyDescriptorUpdateTemplate in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkDestroyDescriptorUpdateTemplate(device:%p, descriptorUpdateTemplate:%p, pAllocator:%p)",
+        device, descriptorUpdateTemplate, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDescriptorUpdateTemplate local_descriptorUpdateTemplate;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_descriptorUpdateTemplate = descriptorUpdateTemplate;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyDescriptorUpdateTemplate =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkDestroyDescriptorUpdateTemplate);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyDescriptorUpdateTemplate);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyDescriptorUpdateTemplate = OP_vkDestroyDescriptorUpdateTemplate;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyDescriptorUpdateTemplate, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyDescriptorUpdateTemplate, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDescriptorUpdateTemplate((*&local_descriptorUpdateTemplate));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroyDescriptorUpdateTemplate), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkDescriptorUpdateTemplate(
+        (VkDescriptorUpdateTemplate*)&descriptorUpdateTemplate);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkUpdateDescriptorSetWithTemplate(
+    VkDevice device, VkDescriptorSet descriptorSet,
+    VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkUpdateDescriptorSetWithTemplate in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkUpdateDescriptorSetWithTemplate(device:%p, descriptorSet:%p, "
+        "descriptorUpdateTemplate:%p, pData:%p)",
+        device, descriptorSet, descriptorUpdateTemplate, pData);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDescriptorSet local_descriptorSet;
+    VkDescriptorUpdateTemplate local_descriptorUpdateTemplate;
+    void* local_pData;
+    local_device = device;
+    local_descriptorSet = descriptorSet;
+    local_descriptorUpdateTemplate = descriptorUpdateTemplate;
+    // Avoiding deepcopy for pData
+    local_pData = (void*)pData;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_2;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pData) {
+            *countPtr += sizeof(uint8_t);
+        }
+    }
+    uint32_t packetSize_vkUpdateDescriptorSetWithTemplate =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkUpdateDescriptorSetWithTemplate);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkUpdateDescriptorSetWithTemplate);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkUpdateDescriptorSetWithTemplate = OP_vkUpdateDescriptorSetWithTemplate;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkUpdateDescriptorSetWithTemplate, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkUpdateDescriptorSetWithTemplate, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDescriptorSet((*&local_descriptorSet));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = get_host_u64_VkDescriptorUpdateTemplate((*&local_descriptorUpdateTemplate));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_3 = (uint64_t)(uintptr_t)local_pData;
+    memcpy((*streamPtrPtr), &cgen_var_3, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pData) {
+        memcpy(*streamPtrPtr, (void*)local_pData, sizeof(uint8_t));
+        *streamPtrPtr += sizeof(uint8_t);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkUpdateDescriptorSetWithTemplate), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetPhysicalDeviceExternalBufferProperties(
+    VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo,
+    VkExternalBufferProperties* pExternalBufferProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceExternalBufferProperties in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceExternalBufferProperties(physicalDevice:%p, pExternalBufferInfo:%p, "
+        "pExternalBufferProperties:%p)",
+        physicalDevice, pExternalBufferInfo, pExternalBufferProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkPhysicalDeviceExternalBufferInfo* local_pExternalBufferInfo;
+    local_physicalDevice = physicalDevice;
+    local_pExternalBufferInfo = nullptr;
+    if (pExternalBufferInfo) {
+        local_pExternalBufferInfo = (VkPhysicalDeviceExternalBufferInfo*)pool->alloc(
+            sizeof(const VkPhysicalDeviceExternalBufferInfo));
+        deepcopy_VkPhysicalDeviceExternalBufferInfo(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pExternalBufferInfo,
+            (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo));
+    }
+    if (local_pExternalBufferInfo) {
+        sResourceTracker->transformImpl_VkPhysicalDeviceExternalBufferInfo_tohost(
+            local_pExternalBufferInfo, 1);
+        transform_tohost_VkPhysicalDeviceExternalBufferInfo(
+            sResourceTracker, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPhysicalDeviceExternalBufferInfo(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo), countPtr);
+        count_VkExternalBufferProperties(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkExternalBufferProperties*)(pExternalBufferProperties),
+                                         countPtr);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceExternalBufferProperties =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceExternalBufferProperties);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceExternalBufferProperties);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceExternalBufferProperties =
+        OP_vkGetPhysicalDeviceExternalBufferProperties;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceExternalBufferProperties, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceExternalBufferProperties, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPhysicalDeviceExternalBufferInfo(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo), streamPtrPtr);
+    reservedmarshal_VkExternalBufferProperties(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkExternalBufferProperties*)(pExternalBufferProperties), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceExternalBufferProperties),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkExternalBufferProperties(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkExternalBufferProperties*)(pExternalBufferProperties));
+    if (pExternalBufferProperties) {
+        sResourceTracker->transformImpl_VkExternalBufferProperties_fromhost(
+            pExternalBufferProperties, 1);
+        transform_fromhost_VkExternalBufferProperties(
+            sResourceTracker, (VkExternalBufferProperties*)(pExternalBufferProperties));
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetPhysicalDeviceExternalFenceProperties(
+    VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo,
+    VkExternalFenceProperties* pExternalFenceProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceExternalFenceProperties in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceExternalFenceProperties(physicalDevice:%p, pExternalFenceInfo:%p, "
+        "pExternalFenceProperties:%p)",
+        physicalDevice, pExternalFenceInfo, pExternalFenceProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkPhysicalDeviceExternalFenceInfo* local_pExternalFenceInfo;
+    local_physicalDevice = physicalDevice;
+    local_pExternalFenceInfo = nullptr;
+    if (pExternalFenceInfo) {
+        local_pExternalFenceInfo = (VkPhysicalDeviceExternalFenceInfo*)pool->alloc(
+            sizeof(const VkPhysicalDeviceExternalFenceInfo));
+        deepcopy_VkPhysicalDeviceExternalFenceInfo(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pExternalFenceInfo,
+            (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo));
+    }
+    if (local_pExternalFenceInfo) {
+        transform_tohost_VkPhysicalDeviceExternalFenceInfo(
+            sResourceTracker, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPhysicalDeviceExternalFenceInfo(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo), countPtr);
+        count_VkExternalFenceProperties(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkExternalFenceProperties*)(pExternalFenceProperties),
+                                        countPtr);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceExternalFenceProperties =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceExternalFenceProperties);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceExternalFenceProperties);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceExternalFenceProperties =
+        OP_vkGetPhysicalDeviceExternalFenceProperties;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceExternalFenceProperties, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceExternalFenceProperties, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPhysicalDeviceExternalFenceInfo(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo), streamPtrPtr);
+    reservedmarshal_VkExternalFenceProperties(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkExternalFenceProperties*)(pExternalFenceProperties),
+        streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceExternalFenceProperties),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkExternalFenceProperties(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkExternalFenceProperties*)(pExternalFenceProperties));
+    if (pExternalFenceProperties) {
+        transform_fromhost_VkExternalFenceProperties(
+            sResourceTracker, (VkExternalFenceProperties*)(pExternalFenceProperties));
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetPhysicalDeviceExternalSemaphoreProperties(
+    VkPhysicalDevice physicalDevice,
+    const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo,
+    VkExternalSemaphoreProperties* pExternalSemaphoreProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkGetPhysicalDeviceExternalSemaphoreProperties in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceExternalSemaphoreProperties(physicalDevice:%p, "
+        "pExternalSemaphoreInfo:%p, pExternalSemaphoreProperties:%p)",
+        physicalDevice, pExternalSemaphoreInfo, pExternalSemaphoreProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkPhysicalDeviceExternalSemaphoreInfo* local_pExternalSemaphoreInfo;
+    local_physicalDevice = physicalDevice;
+    local_pExternalSemaphoreInfo = nullptr;
+    if (pExternalSemaphoreInfo) {
+        local_pExternalSemaphoreInfo = (VkPhysicalDeviceExternalSemaphoreInfo*)pool->alloc(
+            sizeof(const VkPhysicalDeviceExternalSemaphoreInfo));
+        deepcopy_VkPhysicalDeviceExternalSemaphoreInfo(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pExternalSemaphoreInfo,
+            (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo));
+    }
+    if (local_pExternalSemaphoreInfo) {
+        transform_tohost_VkPhysicalDeviceExternalSemaphoreInfo(
+            sResourceTracker,
+            (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPhysicalDeviceExternalSemaphoreInfo(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo), countPtr);
+        count_VkExternalSemaphoreProperties(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties), countPtr);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceExternalSemaphoreProperties =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceExternalSemaphoreProperties);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceExternalSemaphoreProperties);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceExternalSemaphoreProperties =
+        OP_vkGetPhysicalDeviceExternalSemaphoreProperties;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceExternalSemaphoreProperties, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceExternalSemaphoreProperties, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPhysicalDeviceExternalSemaphoreInfo(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo), streamPtrPtr);
+    reservedmarshal_VkExternalSemaphoreProperties(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceExternalSemaphoreProperties),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkExternalSemaphoreProperties(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties));
+    if (pExternalSemaphoreProperties) {
+        transform_fromhost_VkExternalSemaphoreProperties(
+            sResourceTracker, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties));
+    }
+    sResourceTracker->on_vkGetPhysicalDeviceExternalSemaphoreProperties(
+        this, physicalDevice, pExternalSemaphoreInfo, pExternalSemaphoreProperties);
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetDescriptorSetLayoutSupport(VkDevice device,
+                                                const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
+                                                VkDescriptorSetLayoutSupport* pSupport,
+                                                uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetDescriptorSetLayoutSupport in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetDescriptorSetLayoutSupport(device:%p, pCreateInfo:%p, pSupport:%p)",
+                      device, pCreateInfo, pSupport);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDescriptorSetLayoutCreateInfo* local_pCreateInfo;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkDescriptorSetLayoutCreateInfo*)pool->alloc(
+            sizeof(const VkDescriptorSetLayoutCreateInfo));
+        deepcopy_VkDescriptorSetLayoutCreateInfo(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+            (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
+    }
+    if (local_pCreateInfo) {
+        transform_tohost_VkDescriptorSetLayoutCreateInfo(
+            sResourceTracker, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDescriptorSetLayoutCreateInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo),
+                                              countPtr);
+        count_VkDescriptorSetLayoutSupport(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                           (VkDescriptorSetLayoutSupport*)(pSupport), countPtr);
+    }
+    uint32_t packetSize_vkGetDescriptorSetLayoutSupport =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetDescriptorSetLayoutSupport);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetDescriptorSetLayoutSupport);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetDescriptorSetLayoutSupport = OP_vkGetDescriptorSetLayoutSupport;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetDescriptorSetLayoutSupport, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetDescriptorSetLayoutSupport, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDescriptorSetLayoutCreateInfo(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo),
+        streamPtrPtr);
+    reservedmarshal_VkDescriptorSetLayoutSupport(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                 (VkDescriptorSetLayoutSupport*)(pSupport),
+                                                 streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetDescriptorSetLayoutSupport), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkDescriptorSetLayoutSupport(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                           (VkDescriptorSetLayoutSupport*)(pSupport));
+    if (pSupport) {
+        transform_fromhost_VkDescriptorSetLayoutSupport(sResourceTracker,
+                                                        (VkDescriptorSetLayoutSupport*)(pSupport));
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_VERSION_1_2
+void VkEncoder::vkCmdDrawIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                       VkDeviceSize offset, VkBuffer countBuffer,
+                                       VkDeviceSize countBufferOffset, uint32_t maxDrawCount,
+                                       uint32_t stride, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdDrawIndirectCount in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdDrawIndirectCount(commandBuffer:%p, buffer:%p, offset:%ld, countBuffer:%p, "
+        "countBufferOffset:%ld, maxDrawCount:%d, stride:%d)",
+        commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkBuffer local_buffer;
+    VkDeviceSize local_offset;
+    VkBuffer local_countBuffer;
+    VkDeviceSize local_countBufferOffset;
+    uint32_t local_maxDrawCount;
+    uint32_t local_stride;
+    local_commandBuffer = commandBuffer;
+    local_buffer = buffer;
+    local_offset = offset;
+    local_countBuffer = countBuffer;
+    local_countBufferOffset = countBufferOffset;
+    local_maxDrawCount = maxDrawCount;
+    local_stride = stride;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        uint64_t cgen_var_2;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdDrawIndirectCount = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdDrawIndirectCount);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdDrawIndirectCount -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdDrawIndirectCount);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdDrawIndirectCount = OP_vkCmdDrawIndirectCount;
+    memcpy(streamPtr, &opcode_vkCmdDrawIndirectCount, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdDrawIndirectCount, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&local_buffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkBuffer((*&local_countBuffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_stride, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdDrawIndirectCount), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                              VkDeviceSize offset, VkBuffer countBuffer,
+                                              VkDeviceSize countBufferOffset, uint32_t maxDrawCount,
+                                              uint32_t stride, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdDrawIndexedIndirectCount in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdDrawIndexedIndirectCount(commandBuffer:%p, buffer:%p, offset:%ld, countBuffer:%p, "
+        "countBufferOffset:%ld, maxDrawCount:%d, stride:%d)",
+        commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkBuffer local_buffer;
+    VkDeviceSize local_offset;
+    VkBuffer local_countBuffer;
+    VkDeviceSize local_countBufferOffset;
+    uint32_t local_maxDrawCount;
+    uint32_t local_stride;
+    local_commandBuffer = commandBuffer;
+    local_buffer = buffer;
+    local_offset = offset;
+    local_countBuffer = countBuffer;
+    local_countBufferOffset = countBufferOffset;
+    local_maxDrawCount = maxDrawCount;
+    local_stride = stride;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        uint64_t cgen_var_2;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdDrawIndexedIndirectCount = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdDrawIndexedIndirectCount);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdDrawIndexedIndirectCount -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdDrawIndexedIndirectCount);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdDrawIndexedIndirectCount = OP_vkCmdDrawIndexedIndirectCount;
+    memcpy(streamPtr, &opcode_vkCmdDrawIndexedIndirectCount, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdDrawIndexedIndirectCount, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&local_buffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkBuffer((*&local_countBuffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_stride, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdDrawIndexedIndirectCount), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkCreateRenderPass2(VkDevice device, const VkRenderPassCreateInfo2* pCreateInfo,
+                                        const VkAllocationCallbacks* pAllocator,
+                                        VkRenderPass* pRenderPass, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateRenderPass2 in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateRenderPass2(device:%p, pCreateInfo:%p, pAllocator:%p, pRenderPass:%p)", device,
+        pCreateInfo, pAllocator, pRenderPass);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkRenderPassCreateInfo2* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo =
+            (VkRenderPassCreateInfo2*)pool->alloc(sizeof(const VkRenderPassCreateInfo2));
+        deepcopy_VkRenderPassCreateInfo2(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                         (VkRenderPassCreateInfo2*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkRenderPassCreateInfo2(sResourceTracker,
+                                                 (VkRenderPassCreateInfo2*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkRenderPassCreateInfo2(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                      (VkRenderPassCreateInfo2*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateRenderPass2 =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateRenderPass2);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateRenderPass2);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateRenderPass2 = OP_vkCreateRenderPass2;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateRenderPass2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateRenderPass2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkRenderPassCreateInfo2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                            (VkRenderPassCreateInfo2*)(local_pCreateInfo),
+                                            streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pRenderPass));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateRenderPass2), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkRenderPass(&cgen_var_3, (VkRenderPass*)pRenderPass,
+                                                         1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateRenderPass2_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateRenderPass2_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateRenderPass2_VkResult_return;
+}
+
+void VkEncoder::vkCmdBeginRenderPass2(VkCommandBuffer commandBuffer,
+                                      const VkRenderPassBeginInfo* pRenderPassBegin,
+                                      const VkSubpassBeginInfo* pSubpassBeginInfo,
+                                      uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdBeginRenderPass2 in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdBeginRenderPass2(commandBuffer:%p, pRenderPassBegin:%p, pSubpassBeginInfo:%p)",
+        commandBuffer, pRenderPassBegin, pSubpassBeginInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkRenderPassBeginInfo* local_pRenderPassBegin;
+    VkSubpassBeginInfo* local_pSubpassBeginInfo;
+    local_commandBuffer = commandBuffer;
+    local_pRenderPassBegin = nullptr;
+    if (pRenderPassBegin) {
+        local_pRenderPassBegin =
+            (VkRenderPassBeginInfo*)pool->alloc(sizeof(const VkRenderPassBeginInfo));
+        deepcopy_VkRenderPassBeginInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pRenderPassBegin,
+                                       (VkRenderPassBeginInfo*)(local_pRenderPassBegin));
+    }
+    local_pSubpassBeginInfo = nullptr;
+    if (pSubpassBeginInfo) {
+        local_pSubpassBeginInfo =
+            (VkSubpassBeginInfo*)pool->alloc(sizeof(const VkSubpassBeginInfo));
+        deepcopy_VkSubpassBeginInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pSubpassBeginInfo,
+                                    (VkSubpassBeginInfo*)(local_pSubpassBeginInfo));
+    }
+    if (local_pRenderPassBegin) {
+        transform_tohost_VkRenderPassBeginInfo(sResourceTracker,
+                                               (VkRenderPassBeginInfo*)(local_pRenderPassBegin));
+    }
+    if (local_pSubpassBeginInfo) {
+        transform_tohost_VkSubpassBeginInfo(sResourceTracker,
+                                            (VkSubpassBeginInfo*)(local_pSubpassBeginInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkRenderPassBeginInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkRenderPassBeginInfo*)(local_pRenderPassBegin), countPtr);
+        count_VkSubpassBeginInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                 (VkSubpassBeginInfo*)(local_pSubpassBeginInfo), countPtr);
+    }
+    uint32_t packetSize_vkCmdBeginRenderPass2 = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdBeginRenderPass2);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdBeginRenderPass2 -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdBeginRenderPass2);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdBeginRenderPass2 = OP_vkCmdBeginRenderPass2;
+    memcpy(streamPtr, &opcode_vkCmdBeginRenderPass2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdBeginRenderPass2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkRenderPassBeginInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkRenderPassBeginInfo*)(local_pRenderPassBegin),
+                                          streamPtrPtr);
+    reservedmarshal_VkSubpassBeginInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkSubpassBeginInfo*)(local_pSubpassBeginInfo),
+                                       streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdBeginRenderPass2), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdNextSubpass2(VkCommandBuffer commandBuffer,
+                                  const VkSubpassBeginInfo* pSubpassBeginInfo,
+                                  const VkSubpassEndInfo* pSubpassEndInfo, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdNextSubpass2 in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdNextSubpass2(commandBuffer:%p, pSubpassBeginInfo:%p, pSubpassEndInfo:%p)",
+        commandBuffer, pSubpassBeginInfo, pSubpassEndInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkSubpassBeginInfo* local_pSubpassBeginInfo;
+    VkSubpassEndInfo* local_pSubpassEndInfo;
+    local_commandBuffer = commandBuffer;
+    local_pSubpassBeginInfo = nullptr;
+    if (pSubpassBeginInfo) {
+        local_pSubpassBeginInfo =
+            (VkSubpassBeginInfo*)pool->alloc(sizeof(const VkSubpassBeginInfo));
+        deepcopy_VkSubpassBeginInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pSubpassBeginInfo,
+                                    (VkSubpassBeginInfo*)(local_pSubpassBeginInfo));
+    }
+    local_pSubpassEndInfo = nullptr;
+    if (pSubpassEndInfo) {
+        local_pSubpassEndInfo = (VkSubpassEndInfo*)pool->alloc(sizeof(const VkSubpassEndInfo));
+        deepcopy_VkSubpassEndInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pSubpassEndInfo,
+                                  (VkSubpassEndInfo*)(local_pSubpassEndInfo));
+    }
+    if (local_pSubpassBeginInfo) {
+        transform_tohost_VkSubpassBeginInfo(sResourceTracker,
+                                            (VkSubpassBeginInfo*)(local_pSubpassBeginInfo));
+    }
+    if (local_pSubpassEndInfo) {
+        transform_tohost_VkSubpassEndInfo(sResourceTracker,
+                                          (VkSubpassEndInfo*)(local_pSubpassEndInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkSubpassBeginInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                 (VkSubpassBeginInfo*)(local_pSubpassBeginInfo), countPtr);
+        count_VkSubpassEndInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                               (VkSubpassEndInfo*)(local_pSubpassEndInfo), countPtr);
+    }
+    uint32_t packetSize_vkCmdNextSubpass2 = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdNextSubpass2);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdNextSubpass2 -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdNextSubpass2);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdNextSubpass2 = OP_vkCmdNextSubpass2;
+    memcpy(streamPtr, &opcode_vkCmdNextSubpass2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdNextSubpass2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkSubpassBeginInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkSubpassBeginInfo*)(local_pSubpassBeginInfo),
+                                       streamPtrPtr);
+    reservedmarshal_VkSubpassEndInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                     (VkSubpassEndInfo*)(local_pSubpassEndInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdNextSubpass2), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdEndRenderPass2(VkCommandBuffer commandBuffer,
+                                    const VkSubpassEndInfo* pSubpassEndInfo, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdEndRenderPass2 in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdEndRenderPass2(commandBuffer:%p, pSubpassEndInfo:%p)", commandBuffer,
+                      pSubpassEndInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkSubpassEndInfo* local_pSubpassEndInfo;
+    local_commandBuffer = commandBuffer;
+    local_pSubpassEndInfo = nullptr;
+    if (pSubpassEndInfo) {
+        local_pSubpassEndInfo = (VkSubpassEndInfo*)pool->alloc(sizeof(const VkSubpassEndInfo));
+        deepcopy_VkSubpassEndInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pSubpassEndInfo,
+                                  (VkSubpassEndInfo*)(local_pSubpassEndInfo));
+    }
+    if (local_pSubpassEndInfo) {
+        transform_tohost_VkSubpassEndInfo(sResourceTracker,
+                                          (VkSubpassEndInfo*)(local_pSubpassEndInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkSubpassEndInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                               (VkSubpassEndInfo*)(local_pSubpassEndInfo), countPtr);
+    }
+    uint32_t packetSize_vkCmdEndRenderPass2 = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdEndRenderPass2);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdEndRenderPass2 -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdEndRenderPass2);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdEndRenderPass2 = OP_vkCmdEndRenderPass2;
+    memcpy(streamPtr, &opcode_vkCmdEndRenderPass2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdEndRenderPass2, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkSubpassEndInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                     (VkSubpassEndInfo*)(local_pSubpassEndInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdEndRenderPass2), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkResetQueryPool(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery,
+                                 uint32_t queryCount, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkResetQueryPool in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkResetQueryPool(device:%p, queryPool:%p, firstQuery:%d, queryCount:%d)",
+                      device, queryPool, firstQuery, queryCount);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkQueryPool local_queryPool;
+    uint32_t local_firstQuery;
+    uint32_t local_queryCount;
+    local_device = device;
+    local_queryPool = queryPool;
+    local_firstQuery = firstQuery;
+    local_queryCount = queryCount;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkResetQueryPool = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkResetQueryPool);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkResetQueryPool);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkResetQueryPool = OP_vkResetQueryPool;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkResetQueryPool, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkResetQueryPool, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkQueryPool((*&local_queryPool));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstQuery, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_queryCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkResetQueryPool), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkGetSemaphoreCounterValue(VkDevice device, VkSemaphore semaphore,
+                                               uint64_t* pValue, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetSemaphoreCounterValue in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetSemaphoreCounterValue(device:%p, semaphore:%p, pValue:%p)", device,
+                      semaphore, pValue);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSemaphore local_semaphore;
+    local_device = device;
+    local_semaphore = semaphore;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint64_t);
+    }
+    uint32_t packetSize_vkGetSemaphoreCounterValue =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetSemaphoreCounterValue);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetSemaphoreCounterValue);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetSemaphoreCounterValue = OP_vkGetSemaphoreCounterValue;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetSemaphoreCounterValue, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetSemaphoreCounterValue, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkSemaphore((*&local_semaphore));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint64_t*)pValue, sizeof(uint64_t));
+    *streamPtrPtr += sizeof(uint64_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetSemaphoreCounterValue), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((uint64_t*)pValue, sizeof(uint64_t));
+    VkResult vkGetSemaphoreCounterValue_VkResult_return = (VkResult)0;
+    stream->read(&vkGetSemaphoreCounterValue_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetSemaphoreCounterValue_VkResult_return;
+}
+
+VkResult VkEncoder::vkWaitSemaphores(VkDevice device, const VkSemaphoreWaitInfo* pWaitInfo,
+                                     uint64_t timeout, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkWaitSemaphores in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkWaitSemaphores(device:%p, pWaitInfo:%p, timeout:%ld)", device, pWaitInfo,
+                      timeout);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSemaphoreWaitInfo* local_pWaitInfo;
+    uint64_t local_timeout;
+    local_device = device;
+    local_pWaitInfo = nullptr;
+    if (pWaitInfo) {
+        local_pWaitInfo = (VkSemaphoreWaitInfo*)pool->alloc(sizeof(const VkSemaphoreWaitInfo));
+        deepcopy_VkSemaphoreWaitInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pWaitInfo,
+                                     (VkSemaphoreWaitInfo*)(local_pWaitInfo));
+    }
+    local_timeout = timeout;
+    if (local_pWaitInfo) {
+        transform_tohost_VkSemaphoreWaitInfo(sResourceTracker,
+                                             (VkSemaphoreWaitInfo*)(local_pWaitInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkSemaphoreWaitInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                  (VkSemaphoreWaitInfo*)(local_pWaitInfo), countPtr);
+        *countPtr += sizeof(uint64_t);
+    }
+    uint32_t packetSize_vkWaitSemaphores = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkWaitSemaphores);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkWaitSemaphores);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkWaitSemaphores = OP_vkWaitSemaphores;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkWaitSemaphores, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkWaitSemaphores, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkSemaphoreWaitInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkSemaphoreWaitInfo*)(local_pWaitInfo), streamPtrPtr);
+    memcpy(*streamPtrPtr, (uint64_t*)&local_timeout, sizeof(uint64_t));
+    *streamPtrPtr += sizeof(uint64_t);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkWaitSemaphores), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkWaitSemaphores_VkResult_return = (VkResult)0;
+    stream->read(&vkWaitSemaphores_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkWaitSemaphores_VkResult_return;
+}
+
+VkResult VkEncoder::vkSignalSemaphore(VkDevice device, const VkSemaphoreSignalInfo* pSignalInfo,
+                                      uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkSignalSemaphore in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkSignalSemaphore(device:%p, pSignalInfo:%p)", device, pSignalInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSemaphoreSignalInfo* local_pSignalInfo;
+    local_device = device;
+    local_pSignalInfo = nullptr;
+    if (pSignalInfo) {
+        local_pSignalInfo =
+            (VkSemaphoreSignalInfo*)pool->alloc(sizeof(const VkSemaphoreSignalInfo));
+        deepcopy_VkSemaphoreSignalInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pSignalInfo,
+                                       (VkSemaphoreSignalInfo*)(local_pSignalInfo));
+    }
+    if (local_pSignalInfo) {
+        transform_tohost_VkSemaphoreSignalInfo(sResourceTracker,
+                                               (VkSemaphoreSignalInfo*)(local_pSignalInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkSemaphoreSignalInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkSemaphoreSignalInfo*)(local_pSignalInfo), countPtr);
+    }
+    uint32_t packetSize_vkSignalSemaphore =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkSignalSemaphore);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkSignalSemaphore);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkSignalSemaphore = OP_vkSignalSemaphore;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkSignalSemaphore, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkSignalSemaphore, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkSemaphoreSignalInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkSemaphoreSignalInfo*)(local_pSignalInfo),
+                                          streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkSignalSemaphore), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkSignalSemaphore_VkResult_return = (VkResult)0;
+    stream->read(&vkSignalSemaphore_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkSignalSemaphore_VkResult_return;
+}
+
+VkDeviceAddress VkEncoder::vkGetBufferDeviceAddress(VkDevice device,
+                                                    const VkBufferDeviceAddressInfo* pInfo,
+                                                    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetBufferDeviceAddress in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetBufferDeviceAddress(device:%p, pInfo:%p)", device, pInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkBufferDeviceAddressInfo* local_pInfo;
+    local_device = device;
+    local_pInfo = nullptr;
+    if (pInfo) {
+        local_pInfo =
+            (VkBufferDeviceAddressInfo*)pool->alloc(sizeof(const VkBufferDeviceAddressInfo));
+        deepcopy_VkBufferDeviceAddressInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfo,
+                                           (VkBufferDeviceAddressInfo*)(local_pInfo));
+    }
+    if (local_pInfo) {
+        transform_tohost_VkBufferDeviceAddressInfo(sResourceTracker,
+                                                   (VkBufferDeviceAddressInfo*)(local_pInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkBufferDeviceAddressInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkBufferDeviceAddressInfo*)(local_pInfo), countPtr);
+    }
+    uint32_t packetSize_vkGetBufferDeviceAddress =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetBufferDeviceAddress);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetBufferDeviceAddress);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetBufferDeviceAddress = OP_vkGetBufferDeviceAddress;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetBufferDeviceAddress, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetBufferDeviceAddress, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkBufferDeviceAddressInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkBufferDeviceAddressInfo*)(local_pInfo),
+                                              streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetBufferDeviceAddress), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkDeviceAddress vkGetBufferDeviceAddress_VkDeviceAddress_return = (VkDeviceAddress)0;
+    stream->read(&vkGetBufferDeviceAddress_VkDeviceAddress_return, sizeof(VkDeviceAddress));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetBufferDeviceAddress_VkDeviceAddress_return;
+}
+
+uint64_t VkEncoder::vkGetBufferOpaqueCaptureAddress(VkDevice device,
+                                                    const VkBufferDeviceAddressInfo* pInfo,
+                                                    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetBufferOpaqueCaptureAddress in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetBufferOpaqueCaptureAddress(device:%p, pInfo:%p)", device, pInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkBufferDeviceAddressInfo* local_pInfo;
+    local_device = device;
+    local_pInfo = nullptr;
+    if (pInfo) {
+        local_pInfo =
+            (VkBufferDeviceAddressInfo*)pool->alloc(sizeof(const VkBufferDeviceAddressInfo));
+        deepcopy_VkBufferDeviceAddressInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfo,
+                                           (VkBufferDeviceAddressInfo*)(local_pInfo));
+    }
+    if (local_pInfo) {
+        transform_tohost_VkBufferDeviceAddressInfo(sResourceTracker,
+                                                   (VkBufferDeviceAddressInfo*)(local_pInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkBufferDeviceAddressInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkBufferDeviceAddressInfo*)(local_pInfo), countPtr);
+    }
+    uint32_t packetSize_vkGetBufferOpaqueCaptureAddress =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetBufferOpaqueCaptureAddress);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetBufferOpaqueCaptureAddress);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetBufferOpaqueCaptureAddress = OP_vkGetBufferOpaqueCaptureAddress;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetBufferOpaqueCaptureAddress, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetBufferOpaqueCaptureAddress, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkBufferDeviceAddressInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkBufferDeviceAddressInfo*)(local_pInfo),
+                                              streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetBufferOpaqueCaptureAddress), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    uint64_t vkGetBufferOpaqueCaptureAddress_uint64_t_return = (uint64_t)0;
+    stream->read(&vkGetBufferOpaqueCaptureAddress_uint64_t_return, sizeof(uint64_t));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetBufferOpaqueCaptureAddress_uint64_t_return;
+}
+
+uint64_t VkEncoder::vkGetDeviceMemoryOpaqueCaptureAddress(
+    VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetDeviceMemoryOpaqueCaptureAddress in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetDeviceMemoryOpaqueCaptureAddress(device:%p, pInfo:%p)", device, pInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDeviceMemoryOpaqueCaptureAddressInfo* local_pInfo;
+    local_device = device;
+    local_pInfo = nullptr;
+    if (pInfo) {
+        local_pInfo = (VkDeviceMemoryOpaqueCaptureAddressInfo*)pool->alloc(
+            sizeof(const VkDeviceMemoryOpaqueCaptureAddressInfo));
+        deepcopy_VkDeviceMemoryOpaqueCaptureAddressInfo(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfo,
+            (VkDeviceMemoryOpaqueCaptureAddressInfo*)(local_pInfo));
+    }
+    if (local_pInfo) {
+        transform_tohost_VkDeviceMemoryOpaqueCaptureAddressInfo(
+            sResourceTracker, (VkDeviceMemoryOpaqueCaptureAddressInfo*)(local_pInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDeviceMemoryOpaqueCaptureAddressInfo(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkDeviceMemoryOpaqueCaptureAddressInfo*)(local_pInfo), countPtr);
+    }
+    uint32_t packetSize_vkGetDeviceMemoryOpaqueCaptureAddress =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetDeviceMemoryOpaqueCaptureAddress);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetDeviceMemoryOpaqueCaptureAddress);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetDeviceMemoryOpaqueCaptureAddress =
+        OP_vkGetDeviceMemoryOpaqueCaptureAddress;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetDeviceMemoryOpaqueCaptureAddress, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetDeviceMemoryOpaqueCaptureAddress, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDeviceMemoryOpaqueCaptureAddressInfo(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkDeviceMemoryOpaqueCaptureAddressInfo*)(local_pInfo),
+        streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetDeviceMemoryOpaqueCaptureAddress),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    uint64_t vkGetDeviceMemoryOpaqueCaptureAddress_uint64_t_return = (uint64_t)0;
+    stream->read(&vkGetDeviceMemoryOpaqueCaptureAddress_uint64_t_return, sizeof(uint64_t));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetDeviceMemoryOpaqueCaptureAddress_uint64_t_return;
+}
+
+#endif
+#ifdef VK_KHR_surface
+void VkEncoder::vkDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface,
+                                    const VkAllocationCallbacks* pAllocator, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroySurfaceKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroySurfaceKHR(instance:%p, surface:%p, pAllocator:%p)", instance,
+                      surface, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkInstance local_instance;
+    VkSurfaceKHR local_surface;
+    VkAllocationCallbacks* local_pAllocator;
+    local_instance = instance;
+    local_surface = surface;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroySurfaceKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDestroySurfaceKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroySurfaceKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroySurfaceKHR = OP_vkDestroySurfaceKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroySurfaceKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroySurfaceKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkInstance((*&local_instance));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkSurfaceKHR((*&local_surface));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroySurfaceKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&surface);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice,
+                                                         uint32_t queueFamilyIndex,
+                                                         VkSurfaceKHR surface, VkBool32* pSupported,
+                                                         uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceSurfaceSupportKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceSurfaceSupportKHR(physicalDevice:%p, queueFamilyIndex:%d, surface:%p, "
+        "pSupported:%p)",
+        physicalDevice, queueFamilyIndex, surface, pSupported);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    uint32_t local_queueFamilyIndex;
+    VkSurfaceKHR local_surface;
+    local_physicalDevice = physicalDevice;
+    local_queueFamilyIndex = queueFamilyIndex;
+    local_surface = surface;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkBool32);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceSurfaceSupportKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceSurfaceSupportKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceSurfaceSupportKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceSurfaceSupportKHR = OP_vkGetPhysicalDeviceSurfaceSupportKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceSurfaceSupportKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceSurfaceSupportKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkSurfaceKHR((*&local_surface));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkBool32*)pSupported, sizeof(VkBool32));
+    *streamPtrPtr += sizeof(VkBool32);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetPhysicalDeviceSurfaceSupportKHR),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((VkBool32*)pSupported, sizeof(VkBool32));
+    VkResult vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
+    VkPhysicalDevice physicalDevice, VkSurfaceKHR surface,
+    VkSurfaceCapabilitiesKHR* pSurfaceCapabilities, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice:%p, surface:%p, "
+        "pSurfaceCapabilities:%p)",
+        physicalDevice, surface, pSurfaceCapabilities);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkSurfaceKHR local_surface;
+    local_physicalDevice = physicalDevice;
+    local_surface = surface;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        count_VkSurfaceCapabilitiesKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities), countPtr);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceSurfaceCapabilitiesKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceSurfaceCapabilitiesKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceSurfaceCapabilitiesKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilitiesKHR =
+        OP_vkGetPhysicalDeviceSurfaceCapabilitiesKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceSurfaceCapabilitiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceSurfaceCapabilitiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkSurfaceKHR((*&local_surface));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkSurfaceCapabilitiesKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                             (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities),
+                                             streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceSurfaceCapabilitiesKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkSurfaceCapabilitiesKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities));
+    if (pSurfaceCapabilities) {
+        transform_fromhost_VkSurfaceCapabilitiesKHR(
+            sResourceTracker, (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities));
+    }
+    VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice,
+                                                         VkSurfaceKHR surface,
+                                                         uint32_t* pSurfaceFormatCount,
+                                                         VkSurfaceFormatKHR* pSurfaceFormats,
+                                                         uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceSurfaceFormatsKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceSurfaceFormatsKHR(physicalDevice:%p, surface:%p, "
+        "pSurfaceFormatCount:%p, pSurfaceFormats:%p)",
+        physicalDevice, surface, pSurfaceFormatCount, pSurfaceFormats);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkSurfaceKHR local_surface;
+    local_physicalDevice = physicalDevice;
+    local_surface = surface;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pSurfaceFormatCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pSurfaceFormats) {
+            if (pSurfaceFormatCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) {
+                    count_VkSurfaceFormatKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                             (VkSurfaceFormatKHR*)(pSurfaceFormats + i), countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceSurfaceFormatsKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceSurfaceFormatsKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceSurfaceFormatsKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceSurfaceFormatsKHR = OP_vkGetPhysicalDeviceSurfaceFormatsKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceSurfaceFormatsKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceSurfaceFormatsKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkSurfaceKHR((*&local_surface));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pSurfaceFormatCount;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pSurfaceFormatCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pSurfaceFormatCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_3 = (uint64_t)(uintptr_t)pSurfaceFormats;
+    memcpy((*streamPtrPtr), &cgen_var_3, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pSurfaceFormats) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) {
+            reservedmarshal_VkSurfaceFormatKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                               (VkSurfaceFormatKHR*)(pSurfaceFormats + i),
+                                               streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetPhysicalDeviceSurfaceFormatsKHR),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pSurfaceFormatCount;
+    check_pSurfaceFormatCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pSurfaceFormatCount) {
+        if (!(check_pSurfaceFormatCount)) {
+            fprintf(stderr, "fatal: pSurfaceFormatCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkSurfaceFormatKHR* check_pSurfaceFormats;
+    check_pSurfaceFormats = (VkSurfaceFormatKHR*)(uintptr_t)stream->getBe64();
+    if (pSurfaceFormats) {
+        if (!(check_pSurfaceFormats)) {
+            fprintf(stderr, "fatal: pSurfaceFormats inconsistent between guest and host\n");
+        }
+        if (pSurfaceFormatCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) {
+                unmarshal_VkSurfaceFormatKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                             (VkSurfaceFormatKHR*)(pSurfaceFormats + i));
+            }
+        }
+    }
+    if (pSurfaceFormatCount) {
+        if (pSurfaceFormats) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) {
+                transform_fromhost_VkSurfaceFormatKHR(sResourceTracker,
+                                                      (VkSurfaceFormatKHR*)(pSurfaceFormats + i));
+            }
+        }
+    }
+    VkResult vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice,
+                                                              VkSurfaceKHR surface,
+                                                              uint32_t* pPresentModeCount,
+                                                              VkPresentModeKHR* pPresentModes,
+                                                              uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceSurfacePresentModesKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceSurfacePresentModesKHR(physicalDevice:%p, surface:%p, "
+        "pPresentModeCount:%p, pPresentModes:%p)",
+        physicalDevice, surface, pPresentModeCount, pPresentModes);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkSurfaceKHR local_surface;
+    local_physicalDevice = physicalDevice;
+    local_surface = surface;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pPresentModeCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pPresentModes) {
+            if (pPresentModeCount) {
+                *countPtr += (*(pPresentModeCount)) * sizeof(VkPresentModeKHR);
+            }
+        }
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceSurfacePresentModesKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceSurfacePresentModesKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceSurfacePresentModesKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceSurfacePresentModesKHR =
+        OP_vkGetPhysicalDeviceSurfacePresentModesKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceSurfacePresentModesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceSurfacePresentModesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkSurfaceKHR((*&local_surface));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pPresentModeCount;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pPresentModeCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pPresentModeCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_3 = (uint64_t)(uintptr_t)pPresentModes;
+    memcpy((*streamPtrPtr), &cgen_var_3, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pPresentModes) {
+        memcpy(*streamPtrPtr, (VkPresentModeKHR*)pPresentModes,
+               (*(pPresentModeCount)) * sizeof(VkPresentModeKHR));
+        *streamPtrPtr += (*(pPresentModeCount)) * sizeof(VkPresentModeKHR);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceSurfacePresentModesKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pPresentModeCount;
+    check_pPresentModeCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pPresentModeCount) {
+        if (!(check_pPresentModeCount)) {
+            fprintf(stderr, "fatal: pPresentModeCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pPresentModeCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkPresentModeKHR* check_pPresentModes;
+    check_pPresentModes = (VkPresentModeKHR*)(uintptr_t)stream->getBe64();
+    if (pPresentModes) {
+        if (!(check_pPresentModes)) {
+            fprintf(stderr, "fatal: pPresentModes inconsistent between guest and host\n");
+        }
+        stream->read((VkPresentModeKHR*)pPresentModes,
+                     (*(pPresentModeCount)) * sizeof(VkPresentModeKHR));
+    }
+    VkResult vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return;
+}
+
+#endif
+#ifdef VK_KHR_swapchain
+VkResult VkEncoder::vkCreateSwapchainKHR(VkDevice device,
+                                         const VkSwapchainCreateInfoKHR* pCreateInfo,
+                                         const VkAllocationCallbacks* pAllocator,
+                                         VkSwapchainKHR* pSwapchain, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateSwapchainKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateSwapchainKHR(device:%p, pCreateInfo:%p, pAllocator:%p, pSwapchain:%p)", device,
+        pCreateInfo, pAllocator, pSwapchain);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSwapchainCreateInfoKHR* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo =
+            (VkSwapchainCreateInfoKHR*)pool->alloc(sizeof(const VkSwapchainCreateInfoKHR));
+        deepcopy_VkSwapchainCreateInfoKHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                          (VkSwapchainCreateInfoKHR*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkSwapchainCreateInfoKHR(sResourceTracker,
+                                                  (VkSwapchainCreateInfoKHR*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkSwapchainCreateInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkSwapchainCreateInfoKHR*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateSwapchainKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateSwapchainKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateSwapchainKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateSwapchainKHR = OP_vkCreateSwapchainKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateSwapchainKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateSwapchainKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkSwapchainCreateInfoKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                             (VkSwapchainCreateInfoKHR*)(local_pCreateInfo),
+                                             streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pSwapchain));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateSwapchainKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkSwapchainKHR(&cgen_var_3, (VkSwapchainKHR*)pSwapchain,
+                                                           1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateSwapchainKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateSwapchainKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateSwapchainKHR_VkResult_return;
+}
+
+void VkEncoder::vkDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain,
+                                      const VkAllocationCallbacks* pAllocator, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroySwapchainKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroySwapchainKHR(device:%p, swapchain:%p, pAllocator:%p)", device,
+                      swapchain, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSwapchainKHR local_swapchain;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_swapchain = swapchain;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroySwapchainKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDestroySwapchainKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroySwapchainKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroySwapchainKHR = OP_vkDestroySwapchainKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroySwapchainKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroySwapchainKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkSwapchainKHR((*&local_swapchain));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroySwapchainKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&swapchain);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain,
+                                            uint32_t* pSwapchainImageCount,
+                                            VkImage* pSwapchainImages, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetSwapchainImagesKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetSwapchainImagesKHR(device:%p, swapchain:%p, pSwapchainImageCount:%p, "
+        "pSwapchainImages:%p)",
+        device, swapchain, pSwapchainImageCount, pSwapchainImages);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSwapchainKHR local_swapchain;
+    local_device = device;
+    local_swapchain = swapchain;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pSwapchainImageCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pSwapchainImages) {
+            if ((*(pSwapchainImageCount))) {
+                *countPtr += (*(pSwapchainImageCount)) * 8;
+            }
+        }
+    }
+    uint32_t packetSize_vkGetSwapchainImagesKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetSwapchainImagesKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetSwapchainImagesKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetSwapchainImagesKHR = OP_vkGetSwapchainImagesKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetSwapchainImagesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetSwapchainImagesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkSwapchainKHR((*&local_swapchain));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pSwapchainImageCount;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pSwapchainImageCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pSwapchainImageCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    /* is handle, possibly out */;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_3 = (uint64_t)(uintptr_t)pSwapchainImages;
+    memcpy((*streamPtrPtr), &cgen_var_3, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pSwapchainImages) {
+        if ((*(pSwapchainImageCount))) {
+            uint8_t* cgen_var_3_0_ptr = (uint8_t*)(*streamPtrPtr);
+            if (pSwapchainImageCount) {
+                for (uint32_t k = 0; k < (*(pSwapchainImageCount)); ++k) {
+                    uint64_t tmpval = (uint64_t)(pSwapchainImages[k]);
+                    memcpy(cgen_var_3_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+                }
+            }
+            *streamPtrPtr += 8 * (*(pSwapchainImageCount));
+        }
+    }
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetSwapchainImagesKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pSwapchainImageCount;
+    check_pSwapchainImageCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pSwapchainImageCount) {
+        if (!(check_pSwapchainImageCount)) {
+            fprintf(stderr, "fatal: pSwapchainImageCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pSwapchainImageCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkImage* check_pSwapchainImages;
+    check_pSwapchainImages = (VkImage*)(uintptr_t)stream->getBe64();
+    if (pSwapchainImages) {
+        if (!(check_pSwapchainImages)) {
+            fprintf(stderr, "fatal: pSwapchainImages inconsistent between guest and host\n");
+        }
+        if ((*(pSwapchainImageCount))) {
+            uint64_t* cgen_var_5_0;
+            stream->alloc((void**)&cgen_var_5_0, (*(pSwapchainImageCount)) * 8);
+            stream->read((uint64_t*)cgen_var_5_0, (*(pSwapchainImageCount)) * 8);
+            stream->handleMapping()->mapHandles_u64_VkImage(
+                cgen_var_5_0, (VkImage*)pSwapchainImages, (*(pSwapchainImageCount)));
+        }
+    }
+    VkResult vkGetSwapchainImagesKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetSwapchainImagesKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetSwapchainImagesKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain,
+                                          uint64_t timeout, VkSemaphore semaphore, VkFence fence,
+                                          uint32_t* pImageIndex, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkAcquireNextImageKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkAcquireNextImageKHR(device:%p, swapchain:%p, timeout:%ld, semaphore:%p, fence:%p, "
+        "pImageIndex:%p)",
+        device, swapchain, timeout, semaphore, fence, pImageIndex);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSwapchainKHR local_swapchain;
+    uint64_t local_timeout;
+    VkSemaphore local_semaphore;
+    VkFence local_fence;
+    local_device = device;
+    local_swapchain = swapchain;
+    local_timeout = timeout;
+    local_semaphore = semaphore;
+    local_fence = fence;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint64_t);
+        uint64_t cgen_var_2;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_3;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkAcquireNextImageKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkAcquireNextImageKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkAcquireNextImageKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkAcquireNextImageKHR = OP_vkAcquireNextImageKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkAcquireNextImageKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkAcquireNextImageKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkSwapchainKHR((*&local_swapchain));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint64_t*)&local_timeout, sizeof(uint64_t));
+    *streamPtrPtr += sizeof(uint64_t);
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = get_host_u64_VkSemaphore((*&local_semaphore));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_3;
+    *&cgen_var_3 = get_host_u64_VkFence((*&local_fence));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_3, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)pImageIndex, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkAcquireNextImageKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((uint32_t*)pImageIndex, sizeof(uint32_t));
+    VkResult vkAcquireNextImageKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkAcquireNextImageKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkAcquireNextImageKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR* pPresentInfo,
+                                      uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkQueuePresentKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkQueuePresentKHR(queue:%p, pPresentInfo:%p)", queue, pPresentInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkQueue local_queue;
+    VkPresentInfoKHR* local_pPresentInfo;
+    local_queue = queue;
+    local_pPresentInfo = nullptr;
+    if (pPresentInfo) {
+        local_pPresentInfo = (VkPresentInfoKHR*)pool->alloc(sizeof(const VkPresentInfoKHR));
+        deepcopy_VkPresentInfoKHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pPresentInfo,
+                                  (VkPresentInfoKHR*)(local_pPresentInfo));
+    }
+    if (local_pPresentInfo) {
+        transform_tohost_VkPresentInfoKHR(sResourceTracker,
+                                          (VkPresentInfoKHR*)(local_pPresentInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPresentInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                               (VkPresentInfoKHR*)(local_pPresentInfo), countPtr);
+    }
+    uint32_t packetSize_vkQueuePresentKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkQueuePresentKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkQueuePresentKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkQueuePresentKHR = OP_vkQueuePresentKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkQueuePresentKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkQueuePresentKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkQueue((*&local_queue));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPresentInfoKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                     (VkPresentInfoKHR*)(local_pPresentInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkQueuePresentKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkQueuePresentKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkQueuePresentKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkQueuePresentKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetDeviceGroupPresentCapabilitiesKHR(
+    VkDevice device, VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetDeviceGroupPresentCapabilitiesKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetDeviceGroupPresentCapabilitiesKHR(device:%p, pDeviceGroupPresentCapabilities:%p)",
+        device, pDeviceGroupPresentCapabilities);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    local_device = device;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDeviceGroupPresentCapabilitiesKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities), countPtr);
+    }
+    uint32_t packetSize_vkGetDeviceGroupPresentCapabilitiesKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetDeviceGroupPresentCapabilitiesKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetDeviceGroupPresentCapabilitiesKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetDeviceGroupPresentCapabilitiesKHR =
+        OP_vkGetDeviceGroupPresentCapabilitiesKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetDeviceGroupPresentCapabilitiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetDeviceGroupPresentCapabilitiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDeviceGroupPresentCapabilitiesKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetDeviceGroupPresentCapabilitiesKHR),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkDeviceGroupPresentCapabilitiesKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities));
+    if (pDeviceGroupPresentCapabilities) {
+        transform_fromhost_VkDeviceGroupPresentCapabilitiesKHR(
+            sResourceTracker,
+            (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities));
+    }
+    VkResult vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetDeviceGroupSurfacePresentModesKHR(VkDevice device, VkSurfaceKHR surface,
+                                                           VkDeviceGroupPresentModeFlagsKHR* pModes,
+                                                           uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetDeviceGroupSurfacePresentModesKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetDeviceGroupSurfacePresentModesKHR(device:%p, surface:%p, pModes:%p)",
+                      device, surface, pModes);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSurfaceKHR local_surface;
+    local_device = device;
+    local_surface = surface;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pModes) {
+            *countPtr += sizeof(VkDeviceGroupPresentModeFlagsKHR);
+        }
+    }
+    uint32_t packetSize_vkGetDeviceGroupSurfacePresentModesKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetDeviceGroupSurfacePresentModesKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetDeviceGroupSurfacePresentModesKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetDeviceGroupSurfacePresentModesKHR =
+        OP_vkGetDeviceGroupSurfacePresentModesKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetDeviceGroupSurfacePresentModesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetDeviceGroupSurfacePresentModesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkSurfaceKHR((*&local_surface));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pModes;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pModes) {
+        memcpy(*streamPtrPtr, (VkDeviceGroupPresentModeFlagsKHR*)pModes,
+               sizeof(VkDeviceGroupPresentModeFlagsKHR));
+        *streamPtrPtr += sizeof(VkDeviceGroupPresentModeFlagsKHR);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetDeviceGroupSurfacePresentModesKHR),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    VkDeviceGroupPresentModeFlagsKHR* check_pModes;
+    check_pModes = (VkDeviceGroupPresentModeFlagsKHR*)(uintptr_t)stream->getBe64();
+    if (pModes) {
+        if (!(check_pModes)) {
+            fprintf(stderr, "fatal: pModes inconsistent between guest and host\n");
+        }
+        stream->read((VkDeviceGroupPresentModeFlagsKHR*)pModes,
+                     sizeof(VkDeviceGroupPresentModeFlagsKHR));
+    }
+    VkResult vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetPhysicalDevicePresentRectanglesKHR(VkPhysicalDevice physicalDevice,
+                                                            VkSurfaceKHR surface,
+                                                            uint32_t* pRectCount, VkRect2D* pRects,
+                                                            uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDevicePresentRectanglesKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDevicePresentRectanglesKHR(physicalDevice:%p, surface:%p, pRectCount:%p, "
+        "pRects:%p)",
+        physicalDevice, surface, pRectCount, pRects);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkSurfaceKHR local_surface;
+    local_physicalDevice = physicalDevice;
+    local_surface = surface;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pRectCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pRects) {
+            if (pRectCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i) {
+                    count_VkRect2D(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                   (VkRect2D*)(pRects + i), countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetPhysicalDevicePresentRectanglesKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDevicePresentRectanglesKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDevicePresentRectanglesKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDevicePresentRectanglesKHR =
+        OP_vkGetPhysicalDevicePresentRectanglesKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDevicePresentRectanglesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDevicePresentRectanglesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkSurfaceKHR((*&local_surface));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pRectCount;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pRectCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pRectCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_3 = (uint64_t)(uintptr_t)pRects;
+    memcpy((*streamPtrPtr), &cgen_var_3, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pRects) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i) {
+            reservedmarshal_VkRect2D(stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkRect2D*)(pRects + i),
+                                     streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDevicePresentRectanglesKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pRectCount;
+    check_pRectCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pRectCount) {
+        if (!(check_pRectCount)) {
+            fprintf(stderr, "fatal: pRectCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pRectCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkRect2D* check_pRects;
+    check_pRects = (VkRect2D*)(uintptr_t)stream->getBe64();
+    if (pRects) {
+        if (!(check_pRects)) {
+            fprintf(stderr, "fatal: pRects inconsistent between guest and host\n");
+        }
+        if (pRectCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i) {
+                unmarshal_VkRect2D(stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkRect2D*)(pRects + i));
+            }
+        }
+    }
+    if (pRectCount) {
+        if (pRects) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i) {
+                transform_fromhost_VkRect2D(sResourceTracker, (VkRect2D*)(pRects + i));
+            }
+        }
+    }
+    VkResult vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkAcquireNextImage2KHR(VkDevice device,
+                                           const VkAcquireNextImageInfoKHR* pAcquireInfo,
+                                           uint32_t* pImageIndex, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkAcquireNextImage2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkAcquireNextImage2KHR(device:%p, pAcquireInfo:%p, pImageIndex:%p)", device,
+                      pAcquireInfo, pImageIndex);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkAcquireNextImageInfoKHR* local_pAcquireInfo;
+    local_device = device;
+    local_pAcquireInfo = nullptr;
+    if (pAcquireInfo) {
+        local_pAcquireInfo =
+            (VkAcquireNextImageInfoKHR*)pool->alloc(sizeof(const VkAcquireNextImageInfoKHR));
+        deepcopy_VkAcquireNextImageInfoKHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAcquireInfo,
+                                           (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo));
+    }
+    if (local_pAcquireInfo) {
+        transform_tohost_VkAcquireNextImageInfoKHR(
+            sResourceTracker, (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkAcquireNextImageInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo), countPtr);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkAcquireNextImage2KHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkAcquireNextImage2KHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkAcquireNextImage2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkAcquireNextImage2KHR = OP_vkAcquireNextImage2KHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkAcquireNextImage2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkAcquireNextImage2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkAcquireNextImageInfoKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo),
+                                              streamPtrPtr);
+    memcpy(*streamPtrPtr, (uint32_t*)pImageIndex, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkAcquireNextImage2KHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((uint32_t*)pImageIndex, sizeof(uint32_t));
+    VkResult vkAcquireNextImage2KHR_VkResult_return = (VkResult)0;
+    stream->read(&vkAcquireNextImage2KHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkAcquireNextImage2KHR_VkResult_return;
+}
+
+#endif
+#ifdef VK_KHR_display
+VkResult VkEncoder::vkGetPhysicalDeviceDisplayPropertiesKHR(VkPhysicalDevice physicalDevice,
+                                                            uint32_t* pPropertyCount,
+                                                            VkDisplayPropertiesKHR* pProperties,
+                                                            uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceDisplayPropertiesKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceDisplayPropertiesKHR(physicalDevice:%p, pPropertyCount:%p, "
+        "pProperties:%p)",
+        physicalDevice, pPropertyCount, pProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    local_physicalDevice = physicalDevice;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pPropertyCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pProperties) {
+            if (pPropertyCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                    count_VkDisplayPropertiesKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                 (VkDisplayPropertiesKHR*)(pProperties + i),
+                                                 countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceDisplayPropertiesKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceDisplayPropertiesKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceDisplayPropertiesKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceDisplayPropertiesKHR =
+        OP_vkGetPhysicalDeviceDisplayPropertiesKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceDisplayPropertiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceDisplayPropertiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pPropertyCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pPropertyCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pPropertyCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pProperties;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pProperties) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+            reservedmarshal_VkDisplayPropertiesKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                   (VkDisplayPropertiesKHR*)(pProperties + i),
+                                                   streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceDisplayPropertiesKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pPropertyCount;
+    check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pPropertyCount) {
+        if (!(check_pPropertyCount)) {
+            fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkDisplayPropertiesKHR* check_pProperties;
+    check_pProperties = (VkDisplayPropertiesKHR*)(uintptr_t)stream->getBe64();
+    if (pProperties) {
+        if (!(check_pProperties)) {
+            fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
+        }
+        if (pPropertyCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                unmarshal_VkDisplayPropertiesKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                 (VkDisplayPropertiesKHR*)(pProperties + i));
+            }
+        }
+    }
+    if (pPropertyCount) {
+        if (pProperties) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                transform_fromhost_VkDisplayPropertiesKHR(
+                    sResourceTracker, (VkDisplayPropertiesKHR*)(pProperties + i));
+            }
+        }
+    }
+    VkResult vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
+    VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount,
+    VkDisplayPlanePropertiesKHR* pProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkGetPhysicalDeviceDisplayPlanePropertiesKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceDisplayPlanePropertiesKHR(physicalDevice:%p, pPropertyCount:%p, "
+        "pProperties:%p)",
+        physicalDevice, pPropertyCount, pProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    local_physicalDevice = physicalDevice;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pPropertyCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pProperties) {
+            if (pPropertyCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                    count_VkDisplayPlanePropertiesKHR(
+                        sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                        (VkDisplayPlanePropertiesKHR*)(pProperties + i), countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceDisplayPlanePropertiesKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceDisplayPlanePropertiesKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceDisplayPlanePropertiesKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceDisplayPlanePropertiesKHR =
+        OP_vkGetPhysicalDeviceDisplayPlanePropertiesKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceDisplayPlanePropertiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceDisplayPlanePropertiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pPropertyCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pPropertyCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pPropertyCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pProperties;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pProperties) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+            reservedmarshal_VkDisplayPlanePropertiesKHR(
+                stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkDisplayPlanePropertiesKHR*)(pProperties + i),
+                streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceDisplayPlanePropertiesKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pPropertyCount;
+    check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pPropertyCount) {
+        if (!(check_pPropertyCount)) {
+            fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkDisplayPlanePropertiesKHR* check_pProperties;
+    check_pProperties = (VkDisplayPlanePropertiesKHR*)(uintptr_t)stream->getBe64();
+    if (pProperties) {
+        if (!(check_pProperties)) {
+            fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
+        }
+        if (pPropertyCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                unmarshal_VkDisplayPlanePropertiesKHR(
+                    stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                    (VkDisplayPlanePropertiesKHR*)(pProperties + i));
+            }
+        }
+    }
+    if (pPropertyCount) {
+        if (pProperties) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                transform_fromhost_VkDisplayPlanePropertiesKHR(
+                    sResourceTracker, (VkDisplayPlanePropertiesKHR*)(pProperties + i));
+            }
+        }
+    }
+    VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetDisplayPlaneSupportedDisplaysKHR(VkPhysicalDevice physicalDevice,
+                                                          uint32_t planeIndex,
+                                                          uint32_t* pDisplayCount,
+                                                          VkDisplayKHR* pDisplays,
+                                                          uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetDisplayPlaneSupportedDisplaysKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetDisplayPlaneSupportedDisplaysKHR(physicalDevice:%p, planeIndex:%d, pDisplayCount:%p, "
+        "pDisplays:%p)",
+        physicalDevice, planeIndex, pDisplayCount, pDisplays);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    uint32_t local_planeIndex;
+    local_physicalDevice = physicalDevice;
+    local_planeIndex = planeIndex;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pDisplayCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pDisplays) {
+            if ((*(pDisplayCount))) {
+                *countPtr += (*(pDisplayCount)) * 8;
+            }
+        }
+    }
+    uint32_t packetSize_vkGetDisplayPlaneSupportedDisplaysKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetDisplayPlaneSupportedDisplaysKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetDisplayPlaneSupportedDisplaysKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetDisplayPlaneSupportedDisplaysKHR =
+        OP_vkGetDisplayPlaneSupportedDisplaysKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetDisplayPlaneSupportedDisplaysKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetDisplayPlaneSupportedDisplaysKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_planeIndex, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pDisplayCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pDisplayCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pDisplayCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    /* is handle, possibly out */;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pDisplays;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pDisplays) {
+        if ((*(pDisplayCount))) {
+            uint8_t* cgen_var_2_0_ptr = (uint8_t*)(*streamPtrPtr);
+            if (pDisplayCount) {
+                for (uint32_t k = 0; k < (*(pDisplayCount)); ++k) {
+                    uint64_t tmpval = (uint64_t)(pDisplays[k]);
+                    memcpy(cgen_var_2_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+                }
+            }
+            *streamPtrPtr += 8 * (*(pDisplayCount));
+        }
+    }
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetDisplayPlaneSupportedDisplaysKHR),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pDisplayCount;
+    check_pDisplayCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pDisplayCount) {
+        if (!(check_pDisplayCount)) {
+            fprintf(stderr, "fatal: pDisplayCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pDisplayCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkDisplayKHR* check_pDisplays;
+    check_pDisplays = (VkDisplayKHR*)(uintptr_t)stream->getBe64();
+    if (pDisplays) {
+        if (!(check_pDisplays)) {
+            fprintf(stderr, "fatal: pDisplays inconsistent between guest and host\n");
+        }
+        if ((*(pDisplayCount))) {
+            uint64_t* cgen_var_4_0;
+            stream->alloc((void**)&cgen_var_4_0, (*(pDisplayCount)) * 8);
+            stream->read((uint64_t*)cgen_var_4_0, (*(pDisplayCount)) * 8);
+            stream->handleMapping()->mapHandles_u64_VkDisplayKHR(
+                cgen_var_4_0, (VkDisplayKHR*)pDisplays, (*(pDisplayCount)));
+        }
+    }
+    VkResult vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetDisplayModePropertiesKHR(VkPhysicalDevice physicalDevice,
+                                                  VkDisplayKHR display, uint32_t* pPropertyCount,
+                                                  VkDisplayModePropertiesKHR* pProperties,
+                                                  uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetDisplayModePropertiesKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetDisplayModePropertiesKHR(physicalDevice:%p, display:%p, pPropertyCount:%p, "
+        "pProperties:%p)",
+        physicalDevice, display, pPropertyCount, pProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkDisplayKHR local_display;
+    local_physicalDevice = physicalDevice;
+    local_display = display;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pPropertyCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pProperties) {
+            if (pPropertyCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                    count_VkDisplayModePropertiesKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                     (VkDisplayModePropertiesKHR*)(pProperties + i),
+                                                     countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetDisplayModePropertiesKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetDisplayModePropertiesKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetDisplayModePropertiesKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetDisplayModePropertiesKHR = OP_vkGetDisplayModePropertiesKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetDisplayModePropertiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetDisplayModePropertiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDisplayKHR((*&local_display));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pPropertyCount;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pPropertyCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pPropertyCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_3 = (uint64_t)(uintptr_t)pProperties;
+    memcpy((*streamPtrPtr), &cgen_var_3, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pProperties) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+            reservedmarshal_VkDisplayModePropertiesKHR(
+                stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkDisplayModePropertiesKHR*)(pProperties + i),
+                streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetDisplayModePropertiesKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pPropertyCount;
+    check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pPropertyCount) {
+        if (!(check_pPropertyCount)) {
+            fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkDisplayModePropertiesKHR* check_pProperties;
+    check_pProperties = (VkDisplayModePropertiesKHR*)(uintptr_t)stream->getBe64();
+    if (pProperties) {
+        if (!(check_pProperties)) {
+            fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
+        }
+        if (pPropertyCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                unmarshal_VkDisplayModePropertiesKHR(
+                    stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                    (VkDisplayModePropertiesKHR*)(pProperties + i));
+            }
+        }
+    }
+    if (pPropertyCount) {
+        if (pProperties) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                transform_fromhost_VkDisplayModePropertiesKHR(
+                    sResourceTracker, (VkDisplayModePropertiesKHR*)(pProperties + i));
+            }
+        }
+    }
+    VkResult vkGetDisplayModePropertiesKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetDisplayModePropertiesKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetDisplayModePropertiesKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkCreateDisplayModeKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display,
+                                           const VkDisplayModeCreateInfoKHR* pCreateInfo,
+                                           const VkAllocationCallbacks* pAllocator,
+                                           VkDisplayModeKHR* pMode, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateDisplayModeKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateDisplayModeKHR(physicalDevice:%p, display:%p, pCreateInfo:%p, pAllocator:%p, "
+        "pMode:%p)",
+        physicalDevice, display, pCreateInfo, pAllocator, pMode);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkDisplayKHR local_display;
+    VkDisplayModeCreateInfoKHR* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_physicalDevice = physicalDevice;
+    local_display = display;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo =
+            (VkDisplayModeCreateInfoKHR*)pool->alloc(sizeof(const VkDisplayModeCreateInfoKHR));
+        deepcopy_VkDisplayModeCreateInfoKHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                            (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkDisplayModeCreateInfoKHR(
+            sResourceTracker, (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        count_VkDisplayModeCreateInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo),
+                                         countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_2;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateDisplayModeKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateDisplayModeKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateDisplayModeKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateDisplayModeKHR = OP_vkCreateDisplayModeKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateDisplayModeKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateDisplayModeKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDisplayKHR((*&local_display));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDisplayModeCreateInfoKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                               (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo),
+                                               streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_3;
+    *&cgen_var_3 = (uint64_t)((*pMode));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_3, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateDisplayModeKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_4;
+    stream->read((uint64_t*)&cgen_var_4, 8);
+    stream->handleMapping()->mapHandles_u64_VkDisplayModeKHR(&cgen_var_4, (VkDisplayModeKHR*)pMode,
+                                                             1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateDisplayModeKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateDisplayModeKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateDisplayModeKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetDisplayPlaneCapabilitiesKHR(VkPhysicalDevice physicalDevice,
+                                                     VkDisplayModeKHR mode, uint32_t planeIndex,
+                                                     VkDisplayPlaneCapabilitiesKHR* pCapabilities,
+                                                     uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetDisplayPlaneCapabilitiesKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetDisplayPlaneCapabilitiesKHR(physicalDevice:%p, mode:%p, planeIndex:%d, "
+        "pCapabilities:%p)",
+        physicalDevice, mode, planeIndex, pCapabilities);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkDisplayModeKHR local_mode;
+    uint32_t local_planeIndex;
+    local_physicalDevice = physicalDevice;
+    local_mode = mode;
+    local_planeIndex = planeIndex;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        count_VkDisplayPlaneCapabilitiesKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                            (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities),
+                                            countPtr);
+    }
+    uint32_t packetSize_vkGetDisplayPlaneCapabilitiesKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetDisplayPlaneCapabilitiesKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetDisplayPlaneCapabilitiesKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetDisplayPlaneCapabilitiesKHR = OP_vkGetDisplayPlaneCapabilitiesKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetDisplayPlaneCapabilitiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetDisplayPlaneCapabilitiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDisplayModeKHR((*&local_mode));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_planeIndex, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    reservedmarshal_VkDisplayPlaneCapabilitiesKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                  (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities),
+                                                  streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetDisplayPlaneCapabilitiesKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkDisplayPlaneCapabilitiesKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                            (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities));
+    if (pCapabilities) {
+        transform_fromhost_VkDisplayPlaneCapabilitiesKHR(
+            sResourceTracker, (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities));
+    }
+    VkResult vkGetDisplayPlaneCapabilitiesKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetDisplayPlaneCapabilitiesKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetDisplayPlaneCapabilitiesKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkCreateDisplayPlaneSurfaceKHR(VkInstance instance,
+                                                   const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
+                                                   const VkAllocationCallbacks* pAllocator,
+                                                   VkSurfaceKHR* pSurface, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateDisplayPlaneSurfaceKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateDisplayPlaneSurfaceKHR(instance:%p, pCreateInfo:%p, pAllocator:%p, pSurface:%p)",
+        instance, pCreateInfo, pAllocator, pSurface);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkInstance local_instance;
+    VkDisplaySurfaceCreateInfoKHR* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_instance = instance;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkDisplaySurfaceCreateInfoKHR*)pool->alloc(
+            sizeof(const VkDisplaySurfaceCreateInfoKHR));
+        deepcopy_VkDisplaySurfaceCreateInfoKHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                               (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkDisplaySurfaceCreateInfoKHR(
+            sResourceTracker, (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDisplaySurfaceCreateInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                            (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo),
+                                            countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateDisplayPlaneSurfaceKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCreateDisplayPlaneSurfaceKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateDisplayPlaneSurfaceKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateDisplayPlaneSurfaceKHR = OP_vkCreateDisplayPlaneSurfaceKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateDisplayPlaneSurfaceKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateDisplayPlaneSurfaceKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkInstance((*&local_instance));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDisplaySurfaceCreateInfoKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo),
+        streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pSurface));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateDisplayPlaneSurfaceKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_3, (VkSurfaceKHR*)pSurface, 1);
+    VkResult vkCreateDisplayPlaneSurfaceKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateDisplayPlaneSurfaceKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateDisplayPlaneSurfaceKHR_VkResult_return;
+}
+
+#endif
+#ifdef VK_KHR_display_swapchain
+VkResult VkEncoder::vkCreateSharedSwapchainsKHR(VkDevice device, uint32_t swapchainCount,
+                                                const VkSwapchainCreateInfoKHR* pCreateInfos,
+                                                const VkAllocationCallbacks* pAllocator,
+                                                VkSwapchainKHR* pSwapchains, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateSharedSwapchainsKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateSharedSwapchainsKHR(device:%p, swapchainCount:%d, pCreateInfos:%p, pAllocator:%p, "
+        "pSwapchains:%p)",
+        device, swapchainCount, pCreateInfos, pAllocator, pSwapchains);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    uint32_t local_swapchainCount;
+    VkSwapchainCreateInfoKHR* local_pCreateInfos;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_swapchainCount = swapchainCount;
+    local_pCreateInfos = nullptr;
+    if (pCreateInfos) {
+        local_pCreateInfos = (VkSwapchainCreateInfoKHR*)pool->alloc(
+            ((swapchainCount)) * sizeof(const VkSwapchainCreateInfoKHR));
+        for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) {
+            deepcopy_VkSwapchainCreateInfoKHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfos + i,
+                                              (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i));
+        }
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfos) {
+        for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) {
+            transform_tohost_VkSwapchainCreateInfoKHR(
+                sResourceTracker, (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i));
+        }
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) {
+            count_VkSwapchainCreateInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                           (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i),
+                                           countPtr);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        if (((swapchainCount))) {
+            *countPtr += ((swapchainCount)) * 8;
+        }
+    }
+    uint32_t packetSize_vkCreateSharedSwapchainsKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateSharedSwapchainsKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateSharedSwapchainsKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateSharedSwapchainsKHR = OP_vkCreateSharedSwapchainsKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateSharedSwapchainsKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateSharedSwapchainsKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_swapchainCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) {
+        reservedmarshal_VkSwapchainCreateInfoKHR(
+            stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i),
+            streamPtrPtr);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    if (((swapchainCount))) {
+        uint8_t* cgen_var_2_ptr = (uint8_t*)(*streamPtrPtr);
+        for (uint32_t k = 0; k < ((swapchainCount)); ++k) {
+            uint64_t tmpval = (uint64_t)(pSwapchains[k]);
+            memcpy(cgen_var_2_ptr + k * 8, &tmpval, sizeof(uint64_t));
+        }
+        *streamPtrPtr += 8 * ((swapchainCount));
+    }
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateSharedSwapchainsKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    if (((swapchainCount))) {
+        uint64_t* cgen_var_3;
+        stream->alloc((void**)&cgen_var_3, ((swapchainCount)) * 8);
+        stream->read((uint64_t*)cgen_var_3, ((swapchainCount)) * 8);
+        stream->handleMapping()->mapHandles_u64_VkSwapchainKHR(
+            cgen_var_3, (VkSwapchainKHR*)pSwapchains, ((swapchainCount)));
+    }
+    VkResult vkCreateSharedSwapchainsKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateSharedSwapchainsKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateSharedSwapchainsKHR_VkResult_return;
+}
+
+#endif
+#ifdef VK_KHR_xlib_surface
+VkResult VkEncoder::vkCreateXlibSurfaceKHR(VkInstance instance,
+                                           const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
+                                           const VkAllocationCallbacks* pAllocator,
+                                           VkSurfaceKHR* pSurface, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateXlibSurfaceKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateXlibSurfaceKHR(instance:%p, pCreateInfo:%p, pAllocator:%p, pSurface:%p)", instance,
+        pCreateInfo, pAllocator, pSurface);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkInstance local_instance;
+    VkXlibSurfaceCreateInfoKHR* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_instance = instance;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo =
+            (VkXlibSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkXlibSurfaceCreateInfoKHR));
+        deepcopy_VkXlibSurfaceCreateInfoKHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                            (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkXlibSurfaceCreateInfoKHR(
+            sResourceTracker, (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkXlibSurfaceCreateInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo),
+                                         countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateXlibSurfaceKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateXlibSurfaceKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateXlibSurfaceKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateXlibSurfaceKHR = OP_vkCreateXlibSurfaceKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateXlibSurfaceKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateXlibSurfaceKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkInstance((*&local_instance));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkXlibSurfaceCreateInfoKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                               (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo),
+                                               streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pSurface));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateXlibSurfaceKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_3, (VkSurfaceKHR*)pSurface, 1);
+    VkResult vkCreateXlibSurfaceKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateXlibSurfaceKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateXlibSurfaceKHR_VkResult_return;
+}
+
+VkBool32 VkEncoder::vkGetPhysicalDeviceXlibPresentationSupportKHR(VkPhysicalDevice physicalDevice,
+                                                                  uint32_t queueFamilyIndex,
+                                                                  Display* dpy, VisualID visualID,
+                                                                  uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkGetPhysicalDeviceXlibPresentationSupportKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceXlibPresentationSupportKHR(physicalDevice:%p, queueFamilyIndex:%d, "
+        "dpy:%p)",
+        physicalDevice, queueFamilyIndex, dpy);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    uint32_t local_queueFamilyIndex;
+    VisualID local_visualID;
+    local_physicalDevice = physicalDevice;
+    local_queueFamilyIndex = queueFamilyIndex;
+    local_visualID = visualID;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(Display);
+        *countPtr += sizeof(VisualID);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceXlibPresentationSupportKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceXlibPresentationSupportKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceXlibPresentationSupportKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceXlibPresentationSupportKHR =
+        OP_vkGetPhysicalDeviceXlibPresentationSupportKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceXlibPresentationSupportKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceXlibPresentationSupportKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (Display*)dpy, sizeof(Display));
+    *streamPtrPtr += sizeof(Display);
+    memcpy(*streamPtrPtr, (VisualID*)&local_visualID, sizeof(VisualID));
+    *streamPtrPtr += sizeof(VisualID);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceXlibPresentationSupportKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((Display*)dpy, sizeof(Display));
+    VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return = (VkBool32)0;
+    stream->read(&vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return, sizeof(VkBool32));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return;
+}
+
+#endif
+#ifdef VK_KHR_xcb_surface
+VkResult VkEncoder::vkCreateXcbSurfaceKHR(VkInstance instance,
+                                          const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
+                                          const VkAllocationCallbacks* pAllocator,
+                                          VkSurfaceKHR* pSurface, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateXcbSurfaceKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateXcbSurfaceKHR(instance:%p, pCreateInfo:%p, pAllocator:%p, pSurface:%p)", instance,
+        pCreateInfo, pAllocator, pSurface);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkInstance local_instance;
+    VkXcbSurfaceCreateInfoKHR* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_instance = instance;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo =
+            (VkXcbSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkXcbSurfaceCreateInfoKHR));
+        deepcopy_VkXcbSurfaceCreateInfoKHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                           (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkXcbSurfaceCreateInfoKHR(sResourceTracker,
+                                                   (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkXcbSurfaceCreateInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateXcbSurfaceKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateXcbSurfaceKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateXcbSurfaceKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateXcbSurfaceKHR = OP_vkCreateXcbSurfaceKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateXcbSurfaceKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateXcbSurfaceKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkInstance((*&local_instance));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkXcbSurfaceCreateInfoKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo),
+                                              streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pSurface));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateXcbSurfaceKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_3, (VkSurfaceKHR*)pSurface, 1);
+    VkResult vkCreateXcbSurfaceKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateXcbSurfaceKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateXcbSurfaceKHR_VkResult_return;
+}
+
+VkBool32 VkEncoder::vkGetPhysicalDeviceXcbPresentationSupportKHR(VkPhysicalDevice physicalDevice,
+                                                                 uint32_t queueFamilyIndex,
+                                                                 xcb_connection_t* connection,
+                                                                 xcb_visualid_t visual_id,
+                                                                 uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkGetPhysicalDeviceXcbPresentationSupportKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceXcbPresentationSupportKHR(physicalDevice:%p, queueFamilyIndex:%d, "
+        "connection:%p)",
+        physicalDevice, queueFamilyIndex, connection);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    uint32_t local_queueFamilyIndex;
+    xcb_visualid_t local_visual_id;
+    local_physicalDevice = physicalDevice;
+    local_queueFamilyIndex = queueFamilyIndex;
+    local_visual_id = visual_id;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(xcb_connection_t);
+        *countPtr += sizeof(xcb_visualid_t);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceXcbPresentationSupportKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceXcbPresentationSupportKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceXcbPresentationSupportKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceXcbPresentationSupportKHR =
+        OP_vkGetPhysicalDeviceXcbPresentationSupportKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceXcbPresentationSupportKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceXcbPresentationSupportKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (xcb_connection_t*)connection, sizeof(xcb_connection_t));
+    *streamPtrPtr += sizeof(xcb_connection_t);
+    memcpy(*streamPtrPtr, (xcb_visualid_t*)&local_visual_id, sizeof(xcb_visualid_t));
+    *streamPtrPtr += sizeof(xcb_visualid_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceXcbPresentationSupportKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((xcb_connection_t*)connection, sizeof(xcb_connection_t));
+    VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return = (VkBool32)0;
+    stream->read(&vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return, sizeof(VkBool32));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return;
+}
+
+#endif
+#ifdef VK_KHR_wayland_surface
+VkResult VkEncoder::vkCreateWaylandSurfaceKHR(VkInstance instance,
+                                              const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
+                                              const VkAllocationCallbacks* pAllocator,
+                                              VkSurfaceKHR* pSurface, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateWaylandSurfaceKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateWaylandSurfaceKHR(instance:%p, pCreateInfo:%p, pAllocator:%p, pSurface:%p)",
+        instance, pCreateInfo, pAllocator, pSurface);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkInstance local_instance;
+    VkWaylandSurfaceCreateInfoKHR* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_instance = instance;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkWaylandSurfaceCreateInfoKHR*)pool->alloc(
+            sizeof(const VkWaylandSurfaceCreateInfoKHR));
+        deepcopy_VkWaylandSurfaceCreateInfoKHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                               (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkWaylandSurfaceCreateInfoKHR(
+            sResourceTracker, (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkWaylandSurfaceCreateInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                            (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo),
+                                            countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateWaylandSurfaceKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateWaylandSurfaceKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateWaylandSurfaceKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateWaylandSurfaceKHR = OP_vkCreateWaylandSurfaceKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateWaylandSurfaceKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateWaylandSurfaceKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkInstance((*&local_instance));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkWaylandSurfaceCreateInfoKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo),
+        streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pSurface));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateWaylandSurfaceKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_3, (VkSurfaceKHR*)pSurface, 1);
+    VkResult vkCreateWaylandSurfaceKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateWaylandSurfaceKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateWaylandSurfaceKHR_VkResult_return;
+}
+
+VkBool32 VkEncoder::vkGetPhysicalDeviceWaylandPresentationSupportKHR(
+    VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, wl_display* display,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkGetPhysicalDeviceWaylandPresentationSupportKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceWaylandPresentationSupportKHR(physicalDevice:%p, queueFamilyIndex:%d, "
+        "display:%p)",
+        physicalDevice, queueFamilyIndex, display);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    uint32_t local_queueFamilyIndex;
+    local_physicalDevice = physicalDevice;
+    local_queueFamilyIndex = queueFamilyIndex;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(wl_display);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceWaylandPresentationSupportKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceWaylandPresentationSupportKHR);
+    uint8_t* streamPtr =
+        stream->reserve(packetSize_vkGetPhysicalDeviceWaylandPresentationSupportKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceWaylandPresentationSupportKHR =
+        OP_vkGetPhysicalDeviceWaylandPresentationSupportKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceWaylandPresentationSupportKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceWaylandPresentationSupportKHR,
+           sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (wl_display*)display, sizeof(wl_display));
+    *streamPtrPtr += sizeof(wl_display);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceWaylandPresentationSupportKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((wl_display*)display, sizeof(wl_display));
+    VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return = (VkBool32)0;
+    stream->read(&vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return,
+                 sizeof(VkBool32));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return;
+}
+
+#endif
+#ifdef VK_KHR_android_surface
+VkResult VkEncoder::vkCreateAndroidSurfaceKHR(VkInstance instance,
+                                              const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
+                                              const VkAllocationCallbacks* pAllocator,
+                                              VkSurfaceKHR* pSurface, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateAndroidSurfaceKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateAndroidSurfaceKHR(instance:%p, pCreateInfo:%p, pAllocator:%p, pSurface:%p)",
+        instance, pCreateInfo, pAllocator, pSurface);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkInstance local_instance;
+    VkAndroidSurfaceCreateInfoKHR* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_instance = instance;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkAndroidSurfaceCreateInfoKHR*)pool->alloc(
+            sizeof(const VkAndroidSurfaceCreateInfoKHR));
+        deepcopy_VkAndroidSurfaceCreateInfoKHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                               (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkAndroidSurfaceCreateInfoKHR(
+            sResourceTracker, (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkAndroidSurfaceCreateInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                            (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo),
+                                            countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateAndroidSurfaceKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateAndroidSurfaceKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateAndroidSurfaceKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateAndroidSurfaceKHR = OP_vkCreateAndroidSurfaceKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateAndroidSurfaceKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateAndroidSurfaceKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkInstance((*&local_instance));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkAndroidSurfaceCreateInfoKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo),
+        streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pSurface));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateAndroidSurfaceKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_3, (VkSurfaceKHR*)pSurface, 1);
+    VkResult vkCreateAndroidSurfaceKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateAndroidSurfaceKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateAndroidSurfaceKHR_VkResult_return;
+}
+
+#endif
+#ifdef VK_KHR_win32_surface
+VkResult VkEncoder::vkCreateWin32SurfaceKHR(VkInstance instance,
+                                            const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
+                                            const VkAllocationCallbacks* pAllocator,
+                                            VkSurfaceKHR* pSurface, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateWin32SurfaceKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateWin32SurfaceKHR(instance:%p, pCreateInfo:%p, pAllocator:%p, pSurface:%p)",
+        instance, pCreateInfo, pAllocator, pSurface);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkInstance local_instance;
+    VkWin32SurfaceCreateInfoKHR* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_instance = instance;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo =
+            (VkWin32SurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkWin32SurfaceCreateInfoKHR));
+        deepcopy_VkWin32SurfaceCreateInfoKHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                             (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkWin32SurfaceCreateInfoKHR(
+            sResourceTracker, (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkWin32SurfaceCreateInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo),
+                                          countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateWin32SurfaceKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateWin32SurfaceKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateWin32SurfaceKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateWin32SurfaceKHR = OP_vkCreateWin32SurfaceKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateWin32SurfaceKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateWin32SurfaceKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkInstance((*&local_instance));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkWin32SurfaceCreateInfoKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo),
+                                                streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pSurface));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateWin32SurfaceKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_3, (VkSurfaceKHR*)pSurface, 1);
+    VkResult vkCreateWin32SurfaceKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateWin32SurfaceKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateWin32SurfaceKHR_VkResult_return;
+}
+
+VkBool32 VkEncoder::vkGetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice,
+                                                                   uint32_t queueFamilyIndex,
+                                                                   uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkGetPhysicalDeviceWin32PresentationSupportKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceWin32PresentationSupportKHR(physicalDevice:%p, queueFamilyIndex:%d)",
+        physicalDevice, queueFamilyIndex);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    uint32_t local_queueFamilyIndex;
+    local_physicalDevice = physicalDevice;
+    local_queueFamilyIndex = queueFamilyIndex;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceWin32PresentationSupportKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceWin32PresentationSupportKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceWin32PresentationSupportKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceWin32PresentationSupportKHR =
+        OP_vkGetPhysicalDeviceWin32PresentationSupportKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceWin32PresentationSupportKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceWin32PresentationSupportKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceWin32PresentationSupportKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkBool32 vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return = (VkBool32)0;
+    stream->read(&vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return, sizeof(VkBool32));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return;
+}
+
+#endif
+#ifdef VK_KHR_sampler_mirror_clamp_to_edge
+#endif
+#ifdef VK_KHR_video_queue
+VkResult VkEncoder::vkGetPhysicalDeviceVideoCapabilitiesKHR(VkPhysicalDevice physicalDevice,
+                                                            const VkVideoProfileKHR* pVideoProfile,
+                                                            VkVideoCapabilitiesKHR* pCapabilities,
+                                                            uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceVideoCapabilitiesKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceVideoCapabilitiesKHR(physicalDevice:%p, pVideoProfile:%p, "
+        "pCapabilities:%p)",
+        physicalDevice, pVideoProfile, pCapabilities);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkVideoProfileKHR* local_pVideoProfile;
+    local_physicalDevice = physicalDevice;
+    local_pVideoProfile = nullptr;
+    if (pVideoProfile) {
+        local_pVideoProfile = (VkVideoProfileKHR*)pool->alloc(sizeof(const VkVideoProfileKHR));
+        deepcopy_VkVideoProfileKHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pVideoProfile,
+                                   (VkVideoProfileKHR*)(local_pVideoProfile));
+    }
+    if (local_pVideoProfile) {
+        transform_tohost_VkVideoProfileKHR(sResourceTracker,
+                                           (VkVideoProfileKHR*)(local_pVideoProfile));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkVideoProfileKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                (VkVideoProfileKHR*)(local_pVideoProfile), countPtr);
+        count_VkVideoCapabilitiesKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                     (VkVideoCapabilitiesKHR*)(pCapabilities), countPtr);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceVideoCapabilitiesKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceVideoCapabilitiesKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceVideoCapabilitiesKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceVideoCapabilitiesKHR =
+        OP_vkGetPhysicalDeviceVideoCapabilitiesKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceVideoCapabilitiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceVideoCapabilitiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkVideoProfileKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                      (VkVideoProfileKHR*)(local_pVideoProfile), streamPtrPtr);
+    reservedmarshal_VkVideoCapabilitiesKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                           (VkVideoCapabilitiesKHR*)(pCapabilities), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceVideoCapabilitiesKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkVideoCapabilitiesKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                     (VkVideoCapabilitiesKHR*)(pCapabilities));
+    if (pCapabilities) {
+        transform_fromhost_VkVideoCapabilitiesKHR(sResourceTracker,
+                                                  (VkVideoCapabilitiesKHR*)(pCapabilities));
+    }
+    VkResult vkGetPhysicalDeviceVideoCapabilitiesKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetPhysicalDeviceVideoCapabilitiesKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDeviceVideoCapabilitiesKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetPhysicalDeviceVideoFormatPropertiesKHR(
+    VkPhysicalDevice physicalDevice, const VkPhysicalDeviceVideoFormatInfoKHR* pVideoFormatInfo,
+    uint32_t* pVideoFormatPropertyCount, VkVideoFormatPropertiesKHR* pVideoFormatProperties,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceVideoFormatPropertiesKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceVideoFormatPropertiesKHR(physicalDevice:%p, pVideoFormatInfo:%p, "
+        "pVideoFormatPropertyCount:%p, pVideoFormatProperties:%p)",
+        physicalDevice, pVideoFormatInfo, pVideoFormatPropertyCount, pVideoFormatProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkPhysicalDeviceVideoFormatInfoKHR* local_pVideoFormatInfo;
+    local_physicalDevice = physicalDevice;
+    local_pVideoFormatInfo = nullptr;
+    if (pVideoFormatInfo) {
+        local_pVideoFormatInfo = (VkPhysicalDeviceVideoFormatInfoKHR*)pool->alloc(
+            sizeof(const VkPhysicalDeviceVideoFormatInfoKHR));
+        deepcopy_VkPhysicalDeviceVideoFormatInfoKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pVideoFormatInfo,
+            (VkPhysicalDeviceVideoFormatInfoKHR*)(local_pVideoFormatInfo));
+    }
+    if (local_pVideoFormatInfo) {
+        transform_tohost_VkPhysicalDeviceVideoFormatInfoKHR(
+            sResourceTracker, (VkPhysicalDeviceVideoFormatInfoKHR*)(local_pVideoFormatInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPhysicalDeviceVideoFormatInfoKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkPhysicalDeviceVideoFormatInfoKHR*)(local_pVideoFormatInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pVideoFormatPropertyCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pVideoFormatProperties) {
+            if (pVideoFormatPropertyCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pVideoFormatPropertyCount)); ++i) {
+                    count_VkVideoFormatPropertiesKHR(
+                        sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                        (VkVideoFormatPropertiesKHR*)(pVideoFormatProperties + i), countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceVideoFormatPropertiesKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceVideoFormatPropertiesKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceVideoFormatPropertiesKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceVideoFormatPropertiesKHR =
+        OP_vkGetPhysicalDeviceVideoFormatPropertiesKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceVideoFormatPropertiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceVideoFormatPropertiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPhysicalDeviceVideoFormatInfoKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkPhysicalDeviceVideoFormatInfoKHR*)(local_pVideoFormatInfo), streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pVideoFormatPropertyCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pVideoFormatPropertyCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pVideoFormatPropertyCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pVideoFormatProperties;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pVideoFormatProperties) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pVideoFormatPropertyCount)); ++i) {
+            reservedmarshal_VkVideoFormatPropertiesKHR(
+                stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkVideoFormatPropertiesKHR*)(pVideoFormatProperties + i), streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceVideoFormatPropertiesKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pVideoFormatPropertyCount;
+    check_pVideoFormatPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pVideoFormatPropertyCount) {
+        if (!(check_pVideoFormatPropertyCount)) {
+            fprintf(stderr,
+                    "fatal: pVideoFormatPropertyCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pVideoFormatPropertyCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkVideoFormatPropertiesKHR* check_pVideoFormatProperties;
+    check_pVideoFormatProperties = (VkVideoFormatPropertiesKHR*)(uintptr_t)stream->getBe64();
+    if (pVideoFormatProperties) {
+        if (!(check_pVideoFormatProperties)) {
+            fprintf(stderr, "fatal: pVideoFormatProperties inconsistent between guest and host\n");
+        }
+        if (pVideoFormatPropertyCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pVideoFormatPropertyCount)); ++i) {
+                unmarshal_VkVideoFormatPropertiesKHR(
+                    stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                    (VkVideoFormatPropertiesKHR*)(pVideoFormatProperties + i));
+            }
+        }
+    }
+    if (pVideoFormatPropertyCount) {
+        if (pVideoFormatProperties) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pVideoFormatPropertyCount)); ++i) {
+                transform_fromhost_VkVideoFormatPropertiesKHR(
+                    sResourceTracker, (VkVideoFormatPropertiesKHR*)(pVideoFormatProperties + i));
+            }
+        }
+    }
+    VkResult vkGetPhysicalDeviceVideoFormatPropertiesKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetPhysicalDeviceVideoFormatPropertiesKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDeviceVideoFormatPropertiesKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkCreateVideoSessionKHR(VkDevice device,
+                                            const VkVideoSessionCreateInfoKHR* pCreateInfo,
+                                            const VkAllocationCallbacks* pAllocator,
+                                            VkVideoSessionKHR* pVideoSession, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateVideoSessionKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateVideoSessionKHR(device:%p, pCreateInfo:%p, pAllocator:%p, pVideoSession:%p)",
+        device, pCreateInfo, pAllocator, pVideoSession);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkVideoSessionCreateInfoKHR* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo =
+            (VkVideoSessionCreateInfoKHR*)pool->alloc(sizeof(const VkVideoSessionCreateInfoKHR));
+        deepcopy_VkVideoSessionCreateInfoKHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                             (VkVideoSessionCreateInfoKHR*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkVideoSessionCreateInfoKHR(
+            sResourceTracker, (VkVideoSessionCreateInfoKHR*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkVideoSessionCreateInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkVideoSessionCreateInfoKHR*)(local_pCreateInfo),
+                                          countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateVideoSessionKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateVideoSessionKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateVideoSessionKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateVideoSessionKHR = OP_vkCreateVideoSessionKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateVideoSessionKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateVideoSessionKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkVideoSessionCreateInfoKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                (VkVideoSessionCreateInfoKHR*)(local_pCreateInfo),
+                                                streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    uint64_t cgen_var_2 = (uint64_t)(*pVideoSession);
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateVideoSessionKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    (*pVideoSession) = (VkVideoSessionKHR)stream->getBe64();
+    VkResult vkCreateVideoSessionKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateVideoSessionKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateVideoSessionKHR_VkResult_return;
+}
+
+void VkEncoder::vkDestroyVideoSessionKHR(VkDevice device, VkVideoSessionKHR videoSession,
+                                         const VkAllocationCallbacks* pAllocator, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyVideoSessionKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroyVideoSessionKHR(device:%p, pAllocator:%p)", device, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkVideoSessionKHR local_videoSession;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_videoSession = videoSession;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyVideoSessionKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDestroyVideoSessionKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyVideoSessionKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyVideoSessionKHR = OP_vkDestroyVideoSessionKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyVideoSessionKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyVideoSessionKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1 = (uint64_t)local_videoSession;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroyVideoSessionKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkGetVideoSessionMemoryRequirementsKHR(
+    VkDevice device, VkVideoSessionKHR videoSession, uint32_t* pVideoSessionMemoryRequirementsCount,
+    VkVideoGetMemoryPropertiesKHR* pVideoSessionMemoryRequirements, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetVideoSessionMemoryRequirementsKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetVideoSessionMemoryRequirementsKHR(device:%p, "
+        "pVideoSessionMemoryRequirementsCount:%p, pVideoSessionMemoryRequirements:%p)",
+        device, pVideoSessionMemoryRequirementsCount, pVideoSessionMemoryRequirements);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkVideoSessionKHR local_videoSession;
+    local_device = device;
+    local_videoSession = videoSession;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pVideoSessionMemoryRequirementsCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pVideoSessionMemoryRequirements) {
+            if (pVideoSessionMemoryRequirementsCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pVideoSessionMemoryRequirementsCount)); ++i) {
+                    count_VkVideoGetMemoryPropertiesKHR(
+                        sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                        (VkVideoGetMemoryPropertiesKHR*)(pVideoSessionMemoryRequirements + i),
+                        countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetVideoSessionMemoryRequirementsKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetVideoSessionMemoryRequirementsKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetVideoSessionMemoryRequirementsKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetVideoSessionMemoryRequirementsKHR =
+        OP_vkGetVideoSessionMemoryRequirementsKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetVideoSessionMemoryRequirementsKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetVideoSessionMemoryRequirementsKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1 = (uint64_t)local_videoSession;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pVideoSessionMemoryRequirementsCount;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pVideoSessionMemoryRequirementsCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pVideoSessionMemoryRequirementsCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_3 = (uint64_t)(uintptr_t)pVideoSessionMemoryRequirements;
+    memcpy((*streamPtrPtr), &cgen_var_3, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pVideoSessionMemoryRequirements) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pVideoSessionMemoryRequirementsCount)); ++i) {
+            reservedmarshal_VkVideoGetMemoryPropertiesKHR(
+                stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkVideoGetMemoryPropertiesKHR*)(pVideoSessionMemoryRequirements + i),
+                streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetVideoSessionMemoryRequirementsKHR),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pVideoSessionMemoryRequirementsCount;
+    check_pVideoSessionMemoryRequirementsCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pVideoSessionMemoryRequirementsCount) {
+        if (!(check_pVideoSessionMemoryRequirementsCount)) {
+            fprintf(stderr,
+                    "fatal: pVideoSessionMemoryRequirementsCount inconsistent between guest and "
+                    "host\n");
+        }
+        stream->read((uint32_t*)pVideoSessionMemoryRequirementsCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkVideoGetMemoryPropertiesKHR* check_pVideoSessionMemoryRequirements;
+    check_pVideoSessionMemoryRequirements =
+        (VkVideoGetMemoryPropertiesKHR*)(uintptr_t)stream->getBe64();
+    if (pVideoSessionMemoryRequirements) {
+        if (!(check_pVideoSessionMemoryRequirements)) {
+            fprintf(stderr,
+                    "fatal: pVideoSessionMemoryRequirements inconsistent between guest and host\n");
+        }
+        if (pVideoSessionMemoryRequirementsCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pVideoSessionMemoryRequirementsCount)); ++i) {
+                unmarshal_VkVideoGetMemoryPropertiesKHR(
+                    stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                    (VkVideoGetMemoryPropertiesKHR*)(pVideoSessionMemoryRequirements + i));
+            }
+        }
+    }
+    if (pVideoSessionMemoryRequirementsCount) {
+        if (pVideoSessionMemoryRequirements) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pVideoSessionMemoryRequirementsCount)); ++i) {
+                transform_fromhost_VkVideoGetMemoryPropertiesKHR(
+                    sResourceTracker,
+                    (VkVideoGetMemoryPropertiesKHR*)(pVideoSessionMemoryRequirements + i));
+            }
+        }
+    }
+    VkResult vkGetVideoSessionMemoryRequirementsKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetVideoSessionMemoryRequirementsKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetVideoSessionMemoryRequirementsKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkBindVideoSessionMemoryKHR(
+    VkDevice device, VkVideoSessionKHR videoSession, uint32_t videoSessionBindMemoryCount,
+    const VkVideoBindMemoryKHR* pVideoSessionBindMemories, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkBindVideoSessionMemoryKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkBindVideoSessionMemoryKHR(device:%p, videoSessionBindMemoryCount:%d, "
+        "pVideoSessionBindMemories:%p)",
+        device, videoSessionBindMemoryCount, pVideoSessionBindMemories);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkVideoSessionKHR local_videoSession;
+    uint32_t local_videoSessionBindMemoryCount;
+    VkVideoBindMemoryKHR* local_pVideoSessionBindMemories;
+    local_device = device;
+    local_videoSession = videoSession;
+    local_videoSessionBindMemoryCount = videoSessionBindMemoryCount;
+    local_pVideoSessionBindMemories = nullptr;
+    if (pVideoSessionBindMemories) {
+        local_pVideoSessionBindMemories = (VkVideoBindMemoryKHR*)pool->alloc(
+            ((videoSessionBindMemoryCount)) * sizeof(const VkVideoBindMemoryKHR));
+        for (uint32_t i = 0; i < (uint32_t)((videoSessionBindMemoryCount)); ++i) {
+            deepcopy_VkVideoBindMemoryKHR(
+                pool, VK_STRUCTURE_TYPE_MAX_ENUM, pVideoSessionBindMemories + i,
+                (VkVideoBindMemoryKHR*)(local_pVideoSessionBindMemories + i));
+        }
+    }
+    if (local_pVideoSessionBindMemories) {
+        for (uint32_t i = 0; i < (uint32_t)((videoSessionBindMemoryCount)); ++i) {
+            transform_tohost_VkVideoBindMemoryKHR(
+                sResourceTracker, (VkVideoBindMemoryKHR*)(local_pVideoSessionBindMemories + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += 8;
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((videoSessionBindMemoryCount)); ++i) {
+            count_VkVideoBindMemoryKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkVideoBindMemoryKHR*)(local_pVideoSessionBindMemories + i),
+                                       countPtr);
+        }
+    }
+    uint32_t packetSize_vkBindVideoSessionMemoryKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkBindVideoSessionMemoryKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkBindVideoSessionMemoryKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkBindVideoSessionMemoryKHR = OP_vkBindVideoSessionMemoryKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkBindVideoSessionMemoryKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkBindVideoSessionMemoryKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1 = (uint64_t)local_videoSession;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_videoSessionBindMemoryCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((videoSessionBindMemoryCount)); ++i) {
+        reservedmarshal_VkVideoBindMemoryKHR(
+            stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkVideoBindMemoryKHR*)(local_pVideoSessionBindMemories + i), streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkBindVideoSessionMemoryKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkBindVideoSessionMemoryKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkBindVideoSessionMemoryKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkBindVideoSessionMemoryKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkCreateVideoSessionParametersKHR(
+    VkDevice device, const VkVideoSessionParametersCreateInfoKHR* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkVideoSessionParametersKHR* pVideoSessionParameters,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateVideoSessionParametersKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateVideoSessionParametersKHR(device:%p, pCreateInfo:%p, pAllocator:%p, "
+        "pVideoSessionParameters:%p)",
+        device, pCreateInfo, pAllocator, pVideoSessionParameters);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkVideoSessionParametersCreateInfoKHR* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkVideoSessionParametersCreateInfoKHR*)pool->alloc(
+            sizeof(const VkVideoSessionParametersCreateInfoKHR));
+        deepcopy_VkVideoSessionParametersCreateInfoKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+            (VkVideoSessionParametersCreateInfoKHR*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkVideoSessionParametersCreateInfoKHR(
+            sResourceTracker, (VkVideoSessionParametersCreateInfoKHR*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkVideoSessionParametersCreateInfoKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkVideoSessionParametersCreateInfoKHR*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateVideoSessionParametersKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCreateVideoSessionParametersKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateVideoSessionParametersKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateVideoSessionParametersKHR = OP_vkCreateVideoSessionParametersKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateVideoSessionParametersKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateVideoSessionParametersKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkVideoSessionParametersCreateInfoKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkVideoSessionParametersCreateInfoKHR*)(local_pCreateInfo), streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    uint64_t cgen_var_2 = (uint64_t)(*pVideoSessionParameters);
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateVideoSessionParametersKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    (*pVideoSessionParameters) = (VkVideoSessionParametersKHR)stream->getBe64();
+    VkResult vkCreateVideoSessionParametersKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateVideoSessionParametersKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateVideoSessionParametersKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkUpdateVideoSessionParametersKHR(
+    VkDevice device, VkVideoSessionParametersKHR videoSessionParameters,
+    const VkVideoSessionParametersUpdateInfoKHR* pUpdateInfo, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkUpdateVideoSessionParametersKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkUpdateVideoSessionParametersKHR(device:%p, pUpdateInfo:%p)", device,
+                      pUpdateInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkVideoSessionParametersKHR local_videoSessionParameters;
+    VkVideoSessionParametersUpdateInfoKHR* local_pUpdateInfo;
+    local_device = device;
+    local_videoSessionParameters = videoSessionParameters;
+    local_pUpdateInfo = nullptr;
+    if (pUpdateInfo) {
+        local_pUpdateInfo = (VkVideoSessionParametersUpdateInfoKHR*)pool->alloc(
+            sizeof(const VkVideoSessionParametersUpdateInfoKHR));
+        deepcopy_VkVideoSessionParametersUpdateInfoKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pUpdateInfo,
+            (VkVideoSessionParametersUpdateInfoKHR*)(local_pUpdateInfo));
+    }
+    if (local_pUpdateInfo) {
+        transform_tohost_VkVideoSessionParametersUpdateInfoKHR(
+            sResourceTracker, (VkVideoSessionParametersUpdateInfoKHR*)(local_pUpdateInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += 8;
+        count_VkVideoSessionParametersUpdateInfoKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkVideoSessionParametersUpdateInfoKHR*)(local_pUpdateInfo), countPtr);
+    }
+    uint32_t packetSize_vkUpdateVideoSessionParametersKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkUpdateVideoSessionParametersKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkUpdateVideoSessionParametersKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkUpdateVideoSessionParametersKHR = OP_vkUpdateVideoSessionParametersKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkUpdateVideoSessionParametersKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkUpdateVideoSessionParametersKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1 = (uint64_t)local_videoSessionParameters;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    reservedmarshal_VkVideoSessionParametersUpdateInfoKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkVideoSessionParametersUpdateInfoKHR*)(local_pUpdateInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkUpdateVideoSessionParametersKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkUpdateVideoSessionParametersKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkUpdateVideoSessionParametersKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkUpdateVideoSessionParametersKHR_VkResult_return;
+}
+
+void VkEncoder::vkDestroyVideoSessionParametersKHR(
+    VkDevice device, VkVideoSessionParametersKHR videoSessionParameters,
+    const VkAllocationCallbacks* pAllocator, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyVideoSessionParametersKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroyVideoSessionParametersKHR(device:%p, pAllocator:%p)", device,
+                      pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkVideoSessionParametersKHR local_videoSessionParameters;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_videoSessionParameters = videoSessionParameters;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyVideoSessionParametersKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkDestroyVideoSessionParametersKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyVideoSessionParametersKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyVideoSessionParametersKHR = OP_vkDestroyVideoSessionParametersKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyVideoSessionParametersKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyVideoSessionParametersKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1 = (uint64_t)local_videoSessionParameters;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroyVideoSessionParametersKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdBeginVideoCodingKHR(VkCommandBuffer commandBuffer,
+                                         const VkVideoBeginCodingInfoKHR* pBeginInfo,
+                                         uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdBeginVideoCodingKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdBeginVideoCodingKHR(commandBuffer:%p, pBeginInfo:%p)", commandBuffer,
+                      pBeginInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkVideoBeginCodingInfoKHR* local_pBeginInfo;
+    local_commandBuffer = commandBuffer;
+    local_pBeginInfo = nullptr;
+    if (pBeginInfo) {
+        local_pBeginInfo =
+            (VkVideoBeginCodingInfoKHR*)pool->alloc(sizeof(const VkVideoBeginCodingInfoKHR));
+        deepcopy_VkVideoBeginCodingInfoKHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pBeginInfo,
+                                           (VkVideoBeginCodingInfoKHR*)(local_pBeginInfo));
+    }
+    if (local_pBeginInfo) {
+        transform_tohost_VkVideoBeginCodingInfoKHR(sResourceTracker,
+                                                   (VkVideoBeginCodingInfoKHR*)(local_pBeginInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkVideoBeginCodingInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkVideoBeginCodingInfoKHR*)(local_pBeginInfo), countPtr);
+    }
+    uint32_t packetSize_vkCmdBeginVideoCodingKHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdBeginVideoCodingKHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdBeginVideoCodingKHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdBeginVideoCodingKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdBeginVideoCodingKHR = OP_vkCmdBeginVideoCodingKHR;
+    memcpy(streamPtr, &opcode_vkCmdBeginVideoCodingKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdBeginVideoCodingKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkVideoBeginCodingInfoKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkVideoBeginCodingInfoKHR*)(local_pBeginInfo),
+                                              streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdBeginVideoCodingKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdEndVideoCodingKHR(VkCommandBuffer commandBuffer,
+                                       const VkVideoEndCodingInfoKHR* pEndCodingInfo,
+                                       uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdEndVideoCodingKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdEndVideoCodingKHR(commandBuffer:%p, pEndCodingInfo:%p)", commandBuffer,
+                      pEndCodingInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkVideoEndCodingInfoKHR* local_pEndCodingInfo;
+    local_commandBuffer = commandBuffer;
+    local_pEndCodingInfo = nullptr;
+    if (pEndCodingInfo) {
+        local_pEndCodingInfo =
+            (VkVideoEndCodingInfoKHR*)pool->alloc(sizeof(const VkVideoEndCodingInfoKHR));
+        deepcopy_VkVideoEndCodingInfoKHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pEndCodingInfo,
+                                         (VkVideoEndCodingInfoKHR*)(local_pEndCodingInfo));
+    }
+    if (local_pEndCodingInfo) {
+        transform_tohost_VkVideoEndCodingInfoKHR(sResourceTracker,
+                                                 (VkVideoEndCodingInfoKHR*)(local_pEndCodingInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkVideoEndCodingInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                      (VkVideoEndCodingInfoKHR*)(local_pEndCodingInfo), countPtr);
+    }
+    uint32_t packetSize_vkCmdEndVideoCodingKHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdEndVideoCodingKHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdEndVideoCodingKHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdEndVideoCodingKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdEndVideoCodingKHR = OP_vkCmdEndVideoCodingKHR;
+    memcpy(streamPtr, &opcode_vkCmdEndVideoCodingKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdEndVideoCodingKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkVideoEndCodingInfoKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                            (VkVideoEndCodingInfoKHR*)(local_pEndCodingInfo),
+                                            streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdEndVideoCodingKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdControlVideoCodingKHR(VkCommandBuffer commandBuffer,
+                                           const VkVideoCodingControlInfoKHR* pCodingControlInfo,
+                                           uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdControlVideoCodingKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdControlVideoCodingKHR(commandBuffer:%p, pCodingControlInfo:%p)",
+                      commandBuffer, pCodingControlInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkVideoCodingControlInfoKHR* local_pCodingControlInfo;
+    local_commandBuffer = commandBuffer;
+    local_pCodingControlInfo = nullptr;
+    if (pCodingControlInfo) {
+        local_pCodingControlInfo =
+            (VkVideoCodingControlInfoKHR*)pool->alloc(sizeof(const VkVideoCodingControlInfoKHR));
+        deepcopy_VkVideoCodingControlInfoKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCodingControlInfo,
+            (VkVideoCodingControlInfoKHR*)(local_pCodingControlInfo));
+    }
+    if (local_pCodingControlInfo) {
+        transform_tohost_VkVideoCodingControlInfoKHR(
+            sResourceTracker, (VkVideoCodingControlInfoKHR*)(local_pCodingControlInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkVideoCodingControlInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkVideoCodingControlInfoKHR*)(local_pCodingControlInfo),
+                                          countPtr);
+    }
+    uint32_t packetSize_vkCmdControlVideoCodingKHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdControlVideoCodingKHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdControlVideoCodingKHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdControlVideoCodingKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdControlVideoCodingKHR = OP_vkCmdControlVideoCodingKHR;
+    memcpy(streamPtr, &opcode_vkCmdControlVideoCodingKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdControlVideoCodingKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkVideoCodingControlInfoKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkVideoCodingControlInfoKHR*)(local_pCodingControlInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdControlVideoCodingKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_KHR_video_decode_queue
+void VkEncoder::vkCmdDecodeVideoKHR(VkCommandBuffer commandBuffer,
+                                    const VkVideoDecodeInfoKHR* pFrameInfo, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdDecodeVideoKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdDecodeVideoKHR(commandBuffer:%p, pFrameInfo:%p)", commandBuffer,
+                      pFrameInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkVideoDecodeInfoKHR* local_pFrameInfo;
+    local_commandBuffer = commandBuffer;
+    local_pFrameInfo = nullptr;
+    if (pFrameInfo) {
+        local_pFrameInfo = (VkVideoDecodeInfoKHR*)pool->alloc(sizeof(const VkVideoDecodeInfoKHR));
+        deepcopy_VkVideoDecodeInfoKHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pFrameInfo,
+                                      (VkVideoDecodeInfoKHR*)(local_pFrameInfo));
+    }
+    if (local_pFrameInfo) {
+        transform_tohost_VkVideoDecodeInfoKHR(sResourceTracker,
+                                              (VkVideoDecodeInfoKHR*)(local_pFrameInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkVideoDecodeInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                   (VkVideoDecodeInfoKHR*)(local_pFrameInfo), countPtr);
+    }
+    uint32_t packetSize_vkCmdDecodeVideoKHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdDecodeVideoKHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdDecodeVideoKHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdDecodeVideoKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdDecodeVideoKHR = OP_vkCmdDecodeVideoKHR;
+    memcpy(streamPtr, &opcode_vkCmdDecodeVideoKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdDecodeVideoKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkVideoDecodeInfoKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkVideoDecodeInfoKHR*)(local_pFrameInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdDecodeVideoKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_KHR_dynamic_rendering
+void VkEncoder::vkCmdBeginRenderingKHR(VkCommandBuffer commandBuffer,
+                                       const VkRenderingInfoKHR* pRenderingInfo, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdBeginRenderingKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdBeginRenderingKHR(commandBuffer:%p, pRenderingInfo:%p)", commandBuffer,
+                      pRenderingInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkRenderingInfoKHR* local_pRenderingInfo;
+    local_commandBuffer = commandBuffer;
+    local_pRenderingInfo = nullptr;
+    if (pRenderingInfo) {
+        local_pRenderingInfo = (VkRenderingInfoKHR*)pool->alloc(sizeof(const VkRenderingInfoKHR));
+        deepcopy_VkRenderingInfoKHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pRenderingInfo,
+                                    (VkRenderingInfoKHR*)(local_pRenderingInfo));
+    }
+    if (local_pRenderingInfo) {
+        transform_tohost_VkRenderingInfoKHR(sResourceTracker,
+                                            (VkRenderingInfoKHR*)(local_pRenderingInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkRenderingInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                 (VkRenderingInfoKHR*)(local_pRenderingInfo), countPtr);
+    }
+    uint32_t packetSize_vkCmdBeginRenderingKHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdBeginRenderingKHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdBeginRenderingKHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdBeginRenderingKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdBeginRenderingKHR = OP_vkCmdBeginRenderingKHR;
+    memcpy(streamPtr, &opcode_vkCmdBeginRenderingKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdBeginRenderingKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkRenderingInfoKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkRenderingInfoKHR*)(local_pRenderingInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdBeginRenderingKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdEndRenderingKHR(VkCommandBuffer commandBuffer, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdEndRenderingKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdEndRenderingKHR(commandBuffer:%p)", commandBuffer);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    local_commandBuffer = commandBuffer;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkCmdEndRenderingKHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdEndRenderingKHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdEndRenderingKHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdEndRenderingKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdEndRenderingKHR = OP_vkCmdEndRenderingKHR;
+    memcpy(streamPtr, &opcode_vkCmdEndRenderingKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdEndRenderingKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdEndRenderingKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_KHR_multiview
+#endif
+#ifdef VK_KHR_get_physical_device_properties2
+void VkEncoder::vkGetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice,
+                                                VkPhysicalDeviceFeatures2* pFeatures,
+                                                uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceFeatures2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetPhysicalDeviceFeatures2KHR(physicalDevice:%p, pFeatures:%p)",
+                      physicalDevice, pFeatures);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    local_physicalDevice = physicalDevice;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPhysicalDeviceFeatures2(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkPhysicalDeviceFeatures2*)(pFeatures), countPtr);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceFeatures2KHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceFeatures2KHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceFeatures2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceFeatures2KHR = OP_vkGetPhysicalDeviceFeatures2KHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceFeatures2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceFeatures2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPhysicalDeviceFeatures2(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkPhysicalDeviceFeatures2*)(pFeatures), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceFeatures2KHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkPhysicalDeviceFeatures2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkPhysicalDeviceFeatures2*)(pFeatures));
+    if (pFeatures) {
+        transform_fromhost_VkPhysicalDeviceFeatures2(sResourceTracker,
+                                                     (VkPhysicalDeviceFeatures2*)(pFeatures));
+    }
+    sResourceTracker->on_vkGetPhysicalDeviceFeatures2KHR(this, physicalDevice, pFeatures);
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetPhysicalDeviceProperties2KHR(VkPhysicalDevice physicalDevice,
+                                                  VkPhysicalDeviceProperties2* pProperties,
+                                                  uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceProperties2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetPhysicalDeviceProperties2KHR(physicalDevice:%p, pProperties:%p)",
+                      physicalDevice, pProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    local_physicalDevice = physicalDevice;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPhysicalDeviceProperties2(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkPhysicalDeviceProperties2*)(pProperties), countPtr);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceProperties2KHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceProperties2KHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceProperties2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceProperties2KHR = OP_vkGetPhysicalDeviceProperties2KHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceProperties2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceProperties2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPhysicalDeviceProperties2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                (VkPhysicalDeviceProperties2*)(pProperties),
+                                                streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceProperties2KHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkPhysicalDeviceProperties2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkPhysicalDeviceProperties2*)(pProperties));
+    if (pProperties) {
+        transform_fromhost_VkPhysicalDeviceProperties2(sResourceTracker,
+                                                       (VkPhysicalDeviceProperties2*)(pProperties));
+    }
+    sResourceTracker->on_vkGetPhysicalDeviceProperties2KHR(this, physicalDevice, pProperties);
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice,
+                                                        VkFormat format,
+                                                        VkFormatProperties2* pFormatProperties,
+                                                        uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceFormatProperties2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceFormatProperties2KHR(physicalDevice:%p, format:%d, "
+        "pFormatProperties:%p)",
+        physicalDevice, format, pFormatProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkFormat local_format;
+    local_physicalDevice = physicalDevice;
+    local_format = format;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkFormat);
+        count_VkFormatProperties2(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                  (VkFormatProperties2*)(pFormatProperties), countPtr);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceFormatProperties2KHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceFormatProperties2KHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceFormatProperties2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceFormatProperties2KHR =
+        OP_vkGetPhysicalDeviceFormatProperties2KHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceFormatProperties2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceFormatProperties2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkFormat*)&local_format, sizeof(VkFormat));
+    *streamPtrPtr += sizeof(VkFormat);
+    reservedmarshal_VkFormatProperties2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkFormatProperties2*)(pFormatProperties), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceFormatProperties2KHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkFormatProperties2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                  (VkFormatProperties2*)(pFormatProperties));
+    if (pFormatProperties) {
+        transform_fromhost_VkFormatProperties2(sResourceTracker,
+                                               (VkFormatProperties2*)(pFormatProperties));
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkGetPhysicalDeviceImageFormatProperties2KHR(
+    VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
+    VkImageFormatProperties2* pImageFormatProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkGetPhysicalDeviceImageFormatProperties2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceImageFormatProperties2KHR(physicalDevice:%p, pImageFormatInfo:%p, "
+        "pImageFormatProperties:%p)",
+        physicalDevice, pImageFormatInfo, pImageFormatProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkPhysicalDeviceImageFormatInfo2* local_pImageFormatInfo;
+    local_physicalDevice = physicalDevice;
+    local_pImageFormatInfo = nullptr;
+    if (pImageFormatInfo) {
+        local_pImageFormatInfo = (VkPhysicalDeviceImageFormatInfo2*)pool->alloc(
+            sizeof(const VkPhysicalDeviceImageFormatInfo2));
+        deepcopy_VkPhysicalDeviceImageFormatInfo2(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pImageFormatInfo,
+            (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo));
+    }
+    if (local_pImageFormatInfo) {
+        transform_tohost_VkPhysicalDeviceImageFormatInfo2(
+            sResourceTracker, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPhysicalDeviceImageFormatInfo2(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo), countPtr);
+        count_VkImageFormatProperties2(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkImageFormatProperties2*)(pImageFormatProperties),
+                                       countPtr);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceImageFormatProperties2KHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceImageFormatProperties2KHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceImageFormatProperties2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties2KHR =
+        OP_vkGetPhysicalDeviceImageFormatProperties2KHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceImageFormatProperties2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceImageFormatProperties2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPhysicalDeviceImageFormatInfo2(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo), streamPtrPtr);
+    reservedmarshal_VkImageFormatProperties2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                             (VkImageFormatProperties2*)(pImageFormatProperties),
+                                             streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceImageFormatProperties2KHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkImageFormatProperties2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkImageFormatProperties2*)(pImageFormatProperties));
+    if (pImageFormatProperties) {
+        transform_fromhost_VkImageFormatProperties2(
+            sResourceTracker, (VkImageFormatProperties2*)(pImageFormatProperties));
+    }
+    VkResult vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return;
+}
+
+void VkEncoder::vkGetPhysicalDeviceQueueFamilyProperties2KHR(
+    VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount,
+    VkQueueFamilyProperties2* pQueueFamilyProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkGetPhysicalDeviceQueueFamilyProperties2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceQueueFamilyProperties2KHR(physicalDevice:%p, "
+        "pQueueFamilyPropertyCount:%p, pQueueFamilyProperties:%p)",
+        physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    local_physicalDevice = physicalDevice;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pQueueFamilyPropertyCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pQueueFamilyProperties) {
+            if (pQueueFamilyPropertyCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) {
+                    count_VkQueueFamilyProperties2(
+                        sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                        (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i), countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceQueueFamilyProperties2KHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceQueueFamilyProperties2KHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceQueueFamilyProperties2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties2KHR =
+        OP_vkGetPhysicalDeviceQueueFamilyProperties2KHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceQueueFamilyProperties2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceQueueFamilyProperties2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pQueueFamilyPropertyCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pQueueFamilyProperties;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pQueueFamilyProperties) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) {
+            reservedmarshal_VkQueueFamilyProperties2(
+                stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i), streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceQueueFamilyProperties2KHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pQueueFamilyPropertyCount;
+    check_pQueueFamilyPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pQueueFamilyPropertyCount) {
+        if (!(check_pQueueFamilyPropertyCount)) {
+            fprintf(stderr,
+                    "fatal: pQueueFamilyPropertyCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkQueueFamilyProperties2* check_pQueueFamilyProperties;
+    check_pQueueFamilyProperties = (VkQueueFamilyProperties2*)(uintptr_t)stream->getBe64();
+    if (pQueueFamilyProperties) {
+        if (!(check_pQueueFamilyProperties)) {
+            fprintf(stderr, "fatal: pQueueFamilyProperties inconsistent between guest and host\n");
+        }
+        if (pQueueFamilyPropertyCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) {
+                unmarshal_VkQueueFamilyProperties2(
+                    stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                    (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i));
+            }
+        }
+    }
+    if (pQueueFamilyPropertyCount) {
+        if (pQueueFamilyProperties) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) {
+                transform_fromhost_VkQueueFamilyProperties2(
+                    sResourceTracker, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i));
+            }
+        }
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetPhysicalDeviceMemoryProperties2KHR(
+    VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2* pMemoryProperties,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceMemoryProperties2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceMemoryProperties2KHR(physicalDevice:%p, pMemoryProperties:%p)",
+        physicalDevice, pMemoryProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    local_physicalDevice = physicalDevice;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPhysicalDeviceMemoryProperties2(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties), countPtr);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties2KHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceMemoryProperties2KHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceMemoryProperties2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceMemoryProperties2KHR =
+        OP_vkGetPhysicalDeviceMemoryProperties2KHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceMemoryProperties2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceMemoryProperties2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPhysicalDeviceMemoryProperties2(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties),
+        streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceMemoryProperties2KHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkPhysicalDeviceMemoryProperties2(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties));
+    if (pMemoryProperties) {
+        transform_fromhost_VkPhysicalDeviceMemoryProperties2(
+            sResourceTracker, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties));
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetPhysicalDeviceSparseImageFormatProperties2KHR(
+    VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo,
+    uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkGetPhysicalDeviceSparseImageFormatProperties2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceSparseImageFormatProperties2KHR(physicalDevice:%p, pFormatInfo:%p, "
+        "pPropertyCount:%p, pProperties:%p)",
+        physicalDevice, pFormatInfo, pPropertyCount, pProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkPhysicalDeviceSparseImageFormatInfo2* local_pFormatInfo;
+    local_physicalDevice = physicalDevice;
+    local_pFormatInfo = nullptr;
+    if (pFormatInfo) {
+        local_pFormatInfo = (VkPhysicalDeviceSparseImageFormatInfo2*)pool->alloc(
+            sizeof(const VkPhysicalDeviceSparseImageFormatInfo2));
+        deepcopy_VkPhysicalDeviceSparseImageFormatInfo2(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pFormatInfo,
+            (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo));
+    }
+    if (local_pFormatInfo) {
+        transform_tohost_VkPhysicalDeviceSparseImageFormatInfo2(
+            sResourceTracker, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPhysicalDeviceSparseImageFormatInfo2(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pPropertyCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pProperties) {
+            if (pPropertyCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                    count_VkSparseImageFormatProperties2(
+                        sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                        (VkSparseImageFormatProperties2*)(pProperties + i), countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2KHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2KHR);
+    uint8_t* streamPtr =
+        stream->reserve(packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties2KHR =
+        OP_vkGetPhysicalDeviceSparseImageFormatProperties2KHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceSparseImageFormatProperties2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2KHR,
+           sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPhysicalDeviceSparseImageFormatInfo2(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo), streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pPropertyCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pPropertyCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pPropertyCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pProperties;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pProperties) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+            reservedmarshal_VkSparseImageFormatProperties2(
+                stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkSparseImageFormatProperties2*)(pProperties + i), streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2KHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pPropertyCount;
+    check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pPropertyCount) {
+        if (!(check_pPropertyCount)) {
+            fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkSparseImageFormatProperties2* check_pProperties;
+    check_pProperties = (VkSparseImageFormatProperties2*)(uintptr_t)stream->getBe64();
+    if (pProperties) {
+        if (!(check_pProperties)) {
+            fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
+        }
+        if (pPropertyCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                unmarshal_VkSparseImageFormatProperties2(
+                    stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                    (VkSparseImageFormatProperties2*)(pProperties + i));
+            }
+        }
+    }
+    if (pPropertyCount) {
+        if (pProperties) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                transform_fromhost_VkSparseImageFormatProperties2(
+                    sResourceTracker, (VkSparseImageFormatProperties2*)(pProperties + i));
+            }
+        }
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_KHR_device_group
+void VkEncoder::vkGetDeviceGroupPeerMemoryFeaturesKHR(VkDevice device, uint32_t heapIndex,
+                                                      uint32_t localDeviceIndex,
+                                                      uint32_t remoteDeviceIndex,
+                                                      VkPeerMemoryFeatureFlags* pPeerMemoryFeatures,
+                                                      uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetDeviceGroupPeerMemoryFeaturesKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetDeviceGroupPeerMemoryFeaturesKHR(device:%p, heapIndex:%d, localDeviceIndex:%d, "
+        "remoteDeviceIndex:%d, pPeerMemoryFeatures:%p)",
+        device, heapIndex, localDeviceIndex, remoteDeviceIndex, pPeerMemoryFeatures);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    uint32_t local_heapIndex;
+    uint32_t local_localDeviceIndex;
+    uint32_t local_remoteDeviceIndex;
+    local_device = device;
+    local_heapIndex = heapIndex;
+    local_localDeviceIndex = localDeviceIndex;
+    local_remoteDeviceIndex = remoteDeviceIndex;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(VkPeerMemoryFeatureFlags);
+    }
+    uint32_t packetSize_vkGetDeviceGroupPeerMemoryFeaturesKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetDeviceGroupPeerMemoryFeaturesKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetDeviceGroupPeerMemoryFeaturesKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetDeviceGroupPeerMemoryFeaturesKHR =
+        OP_vkGetDeviceGroupPeerMemoryFeaturesKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetDeviceGroupPeerMemoryFeaturesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetDeviceGroupPeerMemoryFeaturesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_heapIndex, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_localDeviceIndex, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures,
+           sizeof(VkPeerMemoryFeatureFlags));
+    *streamPtrPtr += sizeof(VkPeerMemoryFeatureFlags);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetDeviceGroupPeerMemoryFeaturesKHR),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdSetDeviceMaskKHR(VkCommandBuffer commandBuffer, uint32_t deviceMask,
+                                      uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetDeviceMaskKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdSetDeviceMaskKHR(commandBuffer:%p, deviceMask:%d)", commandBuffer,
+                      deviceMask);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_deviceMask;
+    local_commandBuffer = commandBuffer;
+    local_deviceMask = deviceMask;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdSetDeviceMaskKHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetDeviceMaskKHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetDeviceMaskKHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetDeviceMaskKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetDeviceMaskKHR = OP_vkCmdSetDeviceMaskKHR;
+    memcpy(streamPtr, &opcode_vkCmdSetDeviceMaskKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetDeviceMaskKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_deviceMask, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetDeviceMaskKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdDispatchBaseKHR(VkCommandBuffer commandBuffer, uint32_t baseGroupX,
+                                     uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX,
+                                     uint32_t groupCountY, uint32_t groupCountZ, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdDispatchBaseKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdDispatchBaseKHR(commandBuffer:%p, baseGroupX:%d, baseGroupY:%d, baseGroupZ:%d, "
+        "groupCountX:%d, groupCountY:%d, groupCountZ:%d)",
+        commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_baseGroupX;
+    uint32_t local_baseGroupY;
+    uint32_t local_baseGroupZ;
+    uint32_t local_groupCountX;
+    uint32_t local_groupCountY;
+    uint32_t local_groupCountZ;
+    local_commandBuffer = commandBuffer;
+    local_baseGroupX = baseGroupX;
+    local_baseGroupY = baseGroupY;
+    local_baseGroupZ = baseGroupZ;
+    local_groupCountX = groupCountX;
+    local_groupCountY = groupCountY;
+    local_groupCountZ = groupCountZ;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdDispatchBaseKHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdDispatchBaseKHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdDispatchBaseKHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdDispatchBaseKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdDispatchBaseKHR = OP_vkCmdDispatchBaseKHR;
+    memcpy(streamPtr, &opcode_vkCmdDispatchBaseKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdDispatchBaseKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_baseGroupX, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_baseGroupY, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_baseGroupZ, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_groupCountX, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_groupCountY, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_groupCountZ, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdDispatchBaseKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_KHR_shader_draw_parameters
+#endif
+#ifdef VK_KHR_maintenance1
+void VkEncoder::vkTrimCommandPoolKHR(VkDevice device, VkCommandPool commandPool,
+                                     VkCommandPoolTrimFlags flags, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkTrimCommandPoolKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkTrimCommandPoolKHR(device:%p, commandPool:%p, flags:%d)", device,
+                      commandPool, flags);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkCommandPool local_commandPool;
+    VkCommandPoolTrimFlags local_flags;
+    local_device = device;
+    local_commandPool = commandPool;
+    local_flags = flags;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkCommandPoolTrimFlags);
+    }
+    uint32_t packetSize_vkTrimCommandPoolKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkTrimCommandPoolKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkTrimCommandPoolKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkTrimCommandPoolKHR = OP_vkTrimCommandPoolKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkTrimCommandPoolKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkTrimCommandPoolKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkCommandPool((*&local_commandPool));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags));
+    *streamPtrPtr += sizeof(VkCommandPoolTrimFlags);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkTrimCommandPoolKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_KHR_device_group_creation
+VkResult VkEncoder::vkEnumeratePhysicalDeviceGroupsKHR(
+    VkInstance instance, uint32_t* pPhysicalDeviceGroupCount,
+    VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkEnumeratePhysicalDeviceGroupsKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkEnumeratePhysicalDeviceGroupsKHR(instance:%p, pPhysicalDeviceGroupCount:%p, "
+        "pPhysicalDeviceGroupProperties:%p)",
+        instance, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkInstance local_instance;
+    local_instance = instance;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pPhysicalDeviceGroupCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pPhysicalDeviceGroupProperties) {
+            if (pPhysicalDeviceGroupCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) {
+                    count_VkPhysicalDeviceGroupProperties(
+                        sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                        (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i),
+                        countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkEnumeratePhysicalDeviceGroupsKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkEnumeratePhysicalDeviceGroupsKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkEnumeratePhysicalDeviceGroupsKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkEnumeratePhysicalDeviceGroupsKHR = OP_vkEnumeratePhysicalDeviceGroupsKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkEnumeratePhysicalDeviceGroupsKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkEnumeratePhysicalDeviceGroupsKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkInstance((*&local_instance));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pPhysicalDeviceGroupCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pPhysicalDeviceGroupProperties) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) {
+            reservedmarshal_VkPhysicalDeviceGroupProperties(
+                stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i),
+                streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkEnumeratePhysicalDeviceGroupsKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pPhysicalDeviceGroupCount;
+    check_pPhysicalDeviceGroupCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pPhysicalDeviceGroupCount) {
+        if (!(check_pPhysicalDeviceGroupCount)) {
+            fprintf(stderr,
+                    "fatal: pPhysicalDeviceGroupCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkPhysicalDeviceGroupProperties* check_pPhysicalDeviceGroupProperties;
+    check_pPhysicalDeviceGroupProperties =
+        (VkPhysicalDeviceGroupProperties*)(uintptr_t)stream->getBe64();
+    if (pPhysicalDeviceGroupProperties) {
+        if (!(check_pPhysicalDeviceGroupProperties)) {
+            fprintf(stderr,
+                    "fatal: pPhysicalDeviceGroupProperties inconsistent between guest and host\n");
+        }
+        if (pPhysicalDeviceGroupCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) {
+                unmarshal_VkPhysicalDeviceGroupProperties(
+                    stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                    (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i));
+            }
+        }
+    }
+    if (pPhysicalDeviceGroupCount) {
+        if (pPhysicalDeviceGroupProperties) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) {
+                transform_fromhost_VkPhysicalDeviceGroupProperties(
+                    sResourceTracker,
+                    (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i));
+            }
+        }
+    }
+    VkResult vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return;
+}
+
+#endif
+#ifdef VK_KHR_external_memory_capabilities
+void VkEncoder::vkGetPhysicalDeviceExternalBufferPropertiesKHR(
+    VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo,
+    VkExternalBufferProperties* pExternalBufferProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkGetPhysicalDeviceExternalBufferPropertiesKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceExternalBufferPropertiesKHR(physicalDevice:%p, pExternalBufferInfo:%p, "
+        "pExternalBufferProperties:%p)",
+        physicalDevice, pExternalBufferInfo, pExternalBufferProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkPhysicalDeviceExternalBufferInfo* local_pExternalBufferInfo;
+    local_physicalDevice = physicalDevice;
+    local_pExternalBufferInfo = nullptr;
+    if (pExternalBufferInfo) {
+        local_pExternalBufferInfo = (VkPhysicalDeviceExternalBufferInfo*)pool->alloc(
+            sizeof(const VkPhysicalDeviceExternalBufferInfo));
+        deepcopy_VkPhysicalDeviceExternalBufferInfo(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pExternalBufferInfo,
+            (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo));
+    }
+    if (local_pExternalBufferInfo) {
+        sResourceTracker->transformImpl_VkPhysicalDeviceExternalBufferInfo_tohost(
+            local_pExternalBufferInfo, 1);
+        transform_tohost_VkPhysicalDeviceExternalBufferInfo(
+            sResourceTracker, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPhysicalDeviceExternalBufferInfo(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo), countPtr);
+        count_VkExternalBufferProperties(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkExternalBufferProperties*)(pExternalBufferProperties),
+                                         countPtr);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceExternalBufferPropertiesKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceExternalBufferPropertiesKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceExternalBufferPropertiesKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceExternalBufferPropertiesKHR =
+        OP_vkGetPhysicalDeviceExternalBufferPropertiesKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceExternalBufferPropertiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceExternalBufferPropertiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPhysicalDeviceExternalBufferInfo(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo), streamPtrPtr);
+    reservedmarshal_VkExternalBufferProperties(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkExternalBufferProperties*)(pExternalBufferProperties), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceExternalBufferPropertiesKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkExternalBufferProperties(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkExternalBufferProperties*)(pExternalBufferProperties));
+    if (pExternalBufferProperties) {
+        sResourceTracker->transformImpl_VkExternalBufferProperties_fromhost(
+            pExternalBufferProperties, 1);
+        transform_fromhost_VkExternalBufferProperties(
+            sResourceTracker, (VkExternalBufferProperties*)(pExternalBufferProperties));
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_KHR_external_memory
+#endif
+#ifdef VK_KHR_external_memory_win32
+VkResult VkEncoder::vkGetMemoryWin32HandleKHR(
+    VkDevice device, const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetMemoryWin32HandleKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetMemoryWin32HandleKHR(device:%p, pGetWin32HandleInfo:%p, pHandle:%p)",
+                      device, pGetWin32HandleInfo, pHandle);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkMemoryGetWin32HandleInfoKHR* local_pGetWin32HandleInfo;
+    local_device = device;
+    local_pGetWin32HandleInfo = nullptr;
+    if (pGetWin32HandleInfo) {
+        local_pGetWin32HandleInfo = (VkMemoryGetWin32HandleInfoKHR*)pool->alloc(
+            sizeof(const VkMemoryGetWin32HandleInfoKHR));
+        deepcopy_VkMemoryGetWin32HandleInfoKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pGetWin32HandleInfo,
+            (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
+    }
+    if (local_pGetWin32HandleInfo) {
+        transform_tohost_VkMemoryGetWin32HandleInfoKHR(
+            sResourceTracker, (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkMemoryGetWin32HandleInfoKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo), countPtr);
+        *countPtr += sizeof(HANDLE);
+    }
+    uint32_t packetSize_vkGetMemoryWin32HandleKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetMemoryWin32HandleKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetMemoryWin32HandleKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetMemoryWin32HandleKHR = OP_vkGetMemoryWin32HandleKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetMemoryWin32HandleKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetMemoryWin32HandleKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkMemoryGetWin32HandleInfoKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo), streamPtrPtr);
+    memcpy(*streamPtrPtr, (HANDLE*)pHandle, sizeof(HANDLE));
+    *streamPtrPtr += sizeof(HANDLE);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetMemoryWin32HandleKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((HANDLE*)pHandle, sizeof(HANDLE));
+    VkResult vkGetMemoryWin32HandleKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetMemoryWin32HandleKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetMemoryWin32HandleKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetMemoryWin32HandlePropertiesKHR(
+    VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE handle,
+    VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetMemoryWin32HandlePropertiesKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetMemoryWin32HandlePropertiesKHR(device:%p, pMemoryWin32HandleProperties:%p)", device,
+        pMemoryWin32HandleProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkExternalMemoryHandleTypeFlagBits local_handleType;
+    HANDLE local_handle;
+    local_device = device;
+    local_handleType = handleType;
+    local_handle = handle;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkExternalMemoryHandleTypeFlagBits);
+        *countPtr += sizeof(HANDLE);
+        count_VkMemoryWin32HandlePropertiesKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties), countPtr);
+    }
+    uint32_t packetSize_vkGetMemoryWin32HandlePropertiesKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetMemoryWin32HandlePropertiesKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetMemoryWin32HandlePropertiesKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetMemoryWin32HandlePropertiesKHR = OP_vkGetMemoryWin32HandlePropertiesKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetMemoryWin32HandlePropertiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetMemoryWin32HandlePropertiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkExternalMemoryHandleTypeFlagBits*)&local_handleType,
+           sizeof(VkExternalMemoryHandleTypeFlagBits));
+    *streamPtrPtr += sizeof(VkExternalMemoryHandleTypeFlagBits);
+    memcpy(*streamPtrPtr, (HANDLE*)&local_handle, sizeof(HANDLE));
+    *streamPtrPtr += sizeof(HANDLE);
+    reservedmarshal_VkMemoryWin32HandlePropertiesKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetMemoryWin32HandlePropertiesKHR),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkMemoryWin32HandlePropertiesKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties));
+    if (pMemoryWin32HandleProperties) {
+        transform_fromhost_VkMemoryWin32HandlePropertiesKHR(
+            sResourceTracker, (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties));
+    }
+    VkResult vkGetMemoryWin32HandlePropertiesKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetMemoryWin32HandlePropertiesKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetMemoryWin32HandlePropertiesKHR_VkResult_return;
+}
+
+#endif
+#ifdef VK_KHR_external_memory_fd
+VkResult VkEncoder::vkGetMemoryFdKHR(VkDevice device, const VkMemoryGetFdInfoKHR* pGetFdInfo,
+                                     int* pFd, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetMemoryFdKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetMemoryFdKHR(device:%p, pGetFdInfo:%p, pFd:%p)", device, pGetFdInfo,
+                      pFd);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkMemoryGetFdInfoKHR* local_pGetFdInfo;
+    local_device = device;
+    local_pGetFdInfo = nullptr;
+    if (pGetFdInfo) {
+        local_pGetFdInfo = (VkMemoryGetFdInfoKHR*)pool->alloc(sizeof(const VkMemoryGetFdInfoKHR));
+        deepcopy_VkMemoryGetFdInfoKHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pGetFdInfo,
+                                      (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo));
+    }
+    if (local_pGetFdInfo) {
+        transform_tohost_VkMemoryGetFdInfoKHR(sResourceTracker,
+                                              (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkMemoryGetFdInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                   (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo), countPtr);
+        *countPtr += sizeof(int);
+    }
+    uint32_t packetSize_vkGetMemoryFdKHR = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetMemoryFdKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetMemoryFdKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetMemoryFdKHR = OP_vkGetMemoryFdKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetMemoryFdKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetMemoryFdKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkMemoryGetFdInfoKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo), streamPtrPtr);
+    memcpy(*streamPtrPtr, (int*)pFd, sizeof(int));
+    *streamPtrPtr += sizeof(int);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetMemoryFdKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((int*)pFd, sizeof(int));
+    VkResult vkGetMemoryFdKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetMemoryFdKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetMemoryFdKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetMemoryFdPropertiesKHR(VkDevice device,
+                                               VkExternalMemoryHandleTypeFlagBits handleType,
+                                               int fd, VkMemoryFdPropertiesKHR* pMemoryFdProperties,
+                                               uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetMemoryFdPropertiesKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetMemoryFdPropertiesKHR(device:%p, fd:%d, pMemoryFdProperties:%p)",
+                      device, fd, pMemoryFdProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkExternalMemoryHandleTypeFlagBits local_handleType;
+    int local_fd;
+    local_device = device;
+    local_handleType = handleType;
+    local_fd = fd;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkExternalMemoryHandleTypeFlagBits);
+        *countPtr += sizeof(int);
+        count_VkMemoryFdPropertiesKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                      (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties), countPtr);
+    }
+    uint32_t packetSize_vkGetMemoryFdPropertiesKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetMemoryFdPropertiesKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetMemoryFdPropertiesKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetMemoryFdPropertiesKHR = OP_vkGetMemoryFdPropertiesKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetMemoryFdPropertiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetMemoryFdPropertiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkExternalMemoryHandleTypeFlagBits*)&local_handleType,
+           sizeof(VkExternalMemoryHandleTypeFlagBits));
+    *streamPtrPtr += sizeof(VkExternalMemoryHandleTypeFlagBits);
+    memcpy(*streamPtrPtr, (int*)&local_fd, sizeof(int));
+    *streamPtrPtr += sizeof(int);
+    reservedmarshal_VkMemoryFdPropertiesKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                            (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties),
+                                            streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetMemoryFdPropertiesKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkMemoryFdPropertiesKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                      (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties));
+    if (pMemoryFdProperties) {
+        transform_fromhost_VkMemoryFdPropertiesKHR(sResourceTracker,
+                                                   (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties));
+    }
+    VkResult vkGetMemoryFdPropertiesKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetMemoryFdPropertiesKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetMemoryFdPropertiesKHR_VkResult_return;
+}
+
+#endif
+#ifdef VK_KHR_win32_keyed_mutex
+#endif
+#ifdef VK_KHR_external_semaphore_capabilities
+void VkEncoder::vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(
+    VkPhysicalDevice physicalDevice,
+    const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo,
+    VkExternalSemaphoreProperties* pExternalSemaphoreProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(physicalDevice:%p, "
+        "pExternalSemaphoreInfo:%p, pExternalSemaphoreProperties:%p)",
+        physicalDevice, pExternalSemaphoreInfo, pExternalSemaphoreProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkPhysicalDeviceExternalSemaphoreInfo* local_pExternalSemaphoreInfo;
+    local_physicalDevice = physicalDevice;
+    local_pExternalSemaphoreInfo = nullptr;
+    if (pExternalSemaphoreInfo) {
+        local_pExternalSemaphoreInfo = (VkPhysicalDeviceExternalSemaphoreInfo*)pool->alloc(
+            sizeof(const VkPhysicalDeviceExternalSemaphoreInfo));
+        deepcopy_VkPhysicalDeviceExternalSemaphoreInfo(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pExternalSemaphoreInfo,
+            (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo));
+    }
+    if (local_pExternalSemaphoreInfo) {
+        transform_tohost_VkPhysicalDeviceExternalSemaphoreInfo(
+            sResourceTracker,
+            (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPhysicalDeviceExternalSemaphoreInfo(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo), countPtr);
+        count_VkExternalSemaphoreProperties(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties), countPtr);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR);
+    uint8_t* streamPtr =
+        stream->reserve(packetSize_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR =
+        OP_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR,
+           sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPhysicalDeviceExternalSemaphoreInfo(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo), streamPtrPtr);
+    reservedmarshal_VkExternalSemaphoreProperties(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkExternalSemaphoreProperties(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties));
+    if (pExternalSemaphoreProperties) {
+        transform_fromhost_VkExternalSemaphoreProperties(
+            sResourceTracker, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties));
+    }
+    sResourceTracker->on_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(
+        this, physicalDevice, pExternalSemaphoreInfo, pExternalSemaphoreProperties);
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_KHR_external_semaphore
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+VkResult VkEncoder::vkImportSemaphoreWin32HandleKHR(
+    VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkImportSemaphoreWin32HandleKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkImportSemaphoreWin32HandleKHR(device:%p, pImportSemaphoreWin32HandleInfo:%p)", device,
+        pImportSemaphoreWin32HandleInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkImportSemaphoreWin32HandleInfoKHR* local_pImportSemaphoreWin32HandleInfo;
+    local_device = device;
+    local_pImportSemaphoreWin32HandleInfo = nullptr;
+    if (pImportSemaphoreWin32HandleInfo) {
+        local_pImportSemaphoreWin32HandleInfo = (VkImportSemaphoreWin32HandleInfoKHR*)pool->alloc(
+            sizeof(const VkImportSemaphoreWin32HandleInfoKHR));
+        deepcopy_VkImportSemaphoreWin32HandleInfoKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pImportSemaphoreWin32HandleInfo,
+            (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo));
+    }
+    if (local_pImportSemaphoreWin32HandleInfo) {
+        transform_tohost_VkImportSemaphoreWin32HandleInfoKHR(
+            sResourceTracker,
+            (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkImportSemaphoreWin32HandleInfoKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo),
+            countPtr);
+    }
+    uint32_t packetSize_vkImportSemaphoreWin32HandleKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkImportSemaphoreWin32HandleKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkImportSemaphoreWin32HandleKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkImportSemaphoreWin32HandleKHR = OP_vkImportSemaphoreWin32HandleKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkImportSemaphoreWin32HandleKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkImportSemaphoreWin32HandleKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkImportSemaphoreWin32HandleInfoKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo),
+        streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkImportSemaphoreWin32HandleKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkImportSemaphoreWin32HandleKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkImportSemaphoreWin32HandleKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkImportSemaphoreWin32HandleKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetSemaphoreWin32HandleKHR(
+    VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetSemaphoreWin32HandleKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetSemaphoreWin32HandleKHR(device:%p, pGetWin32HandleInfo:%p, pHandle:%p)",
+                      device, pGetWin32HandleInfo, pHandle);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSemaphoreGetWin32HandleInfoKHR* local_pGetWin32HandleInfo;
+    local_device = device;
+    local_pGetWin32HandleInfo = nullptr;
+    if (pGetWin32HandleInfo) {
+        local_pGetWin32HandleInfo = (VkSemaphoreGetWin32HandleInfoKHR*)pool->alloc(
+            sizeof(const VkSemaphoreGetWin32HandleInfoKHR));
+        deepcopy_VkSemaphoreGetWin32HandleInfoKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pGetWin32HandleInfo,
+            (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
+    }
+    if (local_pGetWin32HandleInfo) {
+        transform_tohost_VkSemaphoreGetWin32HandleInfoKHR(
+            sResourceTracker, (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkSemaphoreGetWin32HandleInfoKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo), countPtr);
+        *countPtr += sizeof(HANDLE);
+    }
+    uint32_t packetSize_vkGetSemaphoreWin32HandleKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetSemaphoreWin32HandleKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetSemaphoreWin32HandleKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetSemaphoreWin32HandleKHR = OP_vkGetSemaphoreWin32HandleKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetSemaphoreWin32HandleKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetSemaphoreWin32HandleKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkSemaphoreGetWin32HandleInfoKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo), streamPtrPtr);
+    memcpy(*streamPtrPtr, (HANDLE*)pHandle, sizeof(HANDLE));
+    *streamPtrPtr += sizeof(HANDLE);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetSemaphoreWin32HandleKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((HANDLE*)pHandle, sizeof(HANDLE));
+    VkResult vkGetSemaphoreWin32HandleKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetSemaphoreWin32HandleKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetSemaphoreWin32HandleKHR_VkResult_return;
+}
+
+#endif
+#ifdef VK_KHR_external_semaphore_fd
+VkResult VkEncoder::vkImportSemaphoreFdKHR(VkDevice device,
+                                           const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo,
+                                           uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkImportSemaphoreFdKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkImportSemaphoreFdKHR(device:%p, pImportSemaphoreFdInfo:%p)", device,
+                      pImportSemaphoreFdInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkImportSemaphoreFdInfoKHR* local_pImportSemaphoreFdInfo;
+    local_device = device;
+    local_pImportSemaphoreFdInfo = nullptr;
+    if (pImportSemaphoreFdInfo) {
+        local_pImportSemaphoreFdInfo =
+            (VkImportSemaphoreFdInfoKHR*)pool->alloc(sizeof(const VkImportSemaphoreFdInfoKHR));
+        deepcopy_VkImportSemaphoreFdInfoKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pImportSemaphoreFdInfo,
+            (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo));
+    }
+    if (local_pImportSemaphoreFdInfo) {
+        transform_tohost_VkImportSemaphoreFdInfoKHR(
+            sResourceTracker, (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkImportSemaphoreFdInfoKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo), countPtr);
+    }
+    uint32_t packetSize_vkImportSemaphoreFdKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkImportSemaphoreFdKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkImportSemaphoreFdKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkImportSemaphoreFdKHR = OP_vkImportSemaphoreFdKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkImportSemaphoreFdKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkImportSemaphoreFdKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkImportSemaphoreFdInfoKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkImportSemaphoreFdKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkImportSemaphoreFdKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkImportSemaphoreFdKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkImportSemaphoreFdKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetSemaphoreFdKHR(VkDevice device, const VkSemaphoreGetFdInfoKHR* pGetFdInfo,
+                                        int* pFd, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetSemaphoreFdKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetSemaphoreFdKHR(device:%p, pGetFdInfo:%p, pFd:%p)", device, pGetFdInfo,
+                      pFd);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSemaphoreGetFdInfoKHR* local_pGetFdInfo;
+    local_device = device;
+    local_pGetFdInfo = nullptr;
+    if (pGetFdInfo) {
+        local_pGetFdInfo =
+            (VkSemaphoreGetFdInfoKHR*)pool->alloc(sizeof(const VkSemaphoreGetFdInfoKHR));
+        deepcopy_VkSemaphoreGetFdInfoKHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pGetFdInfo,
+                                         (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo));
+    }
+    if (local_pGetFdInfo) {
+        transform_tohost_VkSemaphoreGetFdInfoKHR(sResourceTracker,
+                                                 (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkSemaphoreGetFdInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                      (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo), countPtr);
+        *countPtr += sizeof(int);
+    }
+    uint32_t packetSize_vkGetSemaphoreFdKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetSemaphoreFdKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetSemaphoreFdKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetSemaphoreFdKHR = OP_vkGetSemaphoreFdKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetSemaphoreFdKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetSemaphoreFdKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkSemaphoreGetFdInfoKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                            (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo),
+                                            streamPtrPtr);
+    memcpy(*streamPtrPtr, (int*)pFd, sizeof(int));
+    *streamPtrPtr += sizeof(int);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetSemaphoreFdKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((int*)pFd, sizeof(int));
+    VkResult vkGetSemaphoreFdKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetSemaphoreFdKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetSemaphoreFdKHR_VkResult_return;
+}
+
+#endif
+#ifdef VK_KHR_push_descriptor
+void VkEncoder::vkCmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer,
+                                          VkPipelineBindPoint pipelineBindPoint,
+                                          VkPipelineLayout layout, uint32_t set,
+                                          uint32_t descriptorWriteCount,
+                                          const VkWriteDescriptorSet* pDescriptorWrites,
+                                          uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdPushDescriptorSetKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdPushDescriptorSetKHR(commandBuffer:%p, layout:%p, set:%d, descriptorWriteCount:%d, "
+        "pDescriptorWrites:%p)",
+        commandBuffer, layout, set, descriptorWriteCount, pDescriptorWrites);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkPipelineBindPoint local_pipelineBindPoint;
+    VkPipelineLayout local_layout;
+    uint32_t local_set;
+    uint32_t local_descriptorWriteCount;
+    VkWriteDescriptorSet* local_pDescriptorWrites;
+    local_commandBuffer = commandBuffer;
+    local_pipelineBindPoint = pipelineBindPoint;
+    local_layout = layout;
+    local_set = set;
+    local_descriptorWriteCount = descriptorWriteCount;
+    local_pDescriptorWrites = nullptr;
+    if (pDescriptorWrites) {
+        local_pDescriptorWrites = (VkWriteDescriptorSet*)pool->alloc(
+            ((descriptorWriteCount)) * sizeof(const VkWriteDescriptorSet));
+        for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) {
+            deepcopy_VkWriteDescriptorSet(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pDescriptorWrites + i,
+                                          (VkWriteDescriptorSet*)(local_pDescriptorWrites + i));
+        }
+    }
+    if (local_pDescriptorWrites) {
+        for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) {
+            transform_tohost_VkWriteDescriptorSet(
+                sResourceTracker, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkPipelineBindPoint);
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) {
+            count_VkWriteDescriptorSet(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkWriteDescriptorSet*)(local_pDescriptorWrites + i),
+                                       countPtr);
+        }
+    }
+    uint32_t packetSize_vkCmdPushDescriptorSetKHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdPushDescriptorSetKHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdPushDescriptorSetKHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdPushDescriptorSetKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdPushDescriptorSetKHR = OP_vkCmdPushDescriptorSetKHR;
+    memcpy(streamPtr, &opcode_vkCmdPushDescriptorSetKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdPushDescriptorSetKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkPipelineBindPoint*)&local_pipelineBindPoint,
+           sizeof(VkPipelineBindPoint));
+    *streamPtrPtr += sizeof(VkPipelineBindPoint);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPipelineLayout((*&local_layout));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_set, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) {
+        reservedmarshal_VkWriteDescriptorSet(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                             (VkWriteDescriptorSet*)(local_pDescriptorWrites + i),
+                                             streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdPushDescriptorSetKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdPushDescriptorSetWithTemplateKHR(
+    VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplate descriptorUpdateTemplate,
+    VkPipelineLayout layout, uint32_t set, const void* pData, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdPushDescriptorSetWithTemplateKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdPushDescriptorSetWithTemplateKHR(commandBuffer:%p, descriptorUpdateTemplate:%p, "
+        "layout:%p, set:%d, pData:%p)",
+        commandBuffer, descriptorUpdateTemplate, layout, set, pData);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkDescriptorUpdateTemplate local_descriptorUpdateTemplate;
+    VkPipelineLayout local_layout;
+    uint32_t local_set;
+    void* local_pData;
+    local_commandBuffer = commandBuffer;
+    local_descriptorUpdateTemplate = descriptorUpdateTemplate;
+    local_layout = layout;
+    local_set = set;
+    // Avoiding deepcopy for pData
+    local_pData = (void*)pData;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_2;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pData) {
+            *countPtr += sizeof(uint8_t);
+        }
+    }
+    uint32_t packetSize_vkCmdPushDescriptorSetWithTemplateKHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdPushDescriptorSetWithTemplateKHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdPushDescriptorSetWithTemplateKHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdPushDescriptorSetWithTemplateKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdPushDescriptorSetWithTemplateKHR =
+        OP_vkCmdPushDescriptorSetWithTemplateKHR;
+    memcpy(streamPtr, &opcode_vkCmdPushDescriptorSetWithTemplateKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdPushDescriptorSetWithTemplateKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDescriptorUpdateTemplate((*&local_descriptorUpdateTemplate));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkPipelineLayout((*&local_layout));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_set, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pData;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pData) {
+        memcpy(*streamPtrPtr, (void*)local_pData, sizeof(uint8_t));
+        *streamPtrPtr += sizeof(uint8_t);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdPushDescriptorSetWithTemplateKHR),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_KHR_shader_float16_int8
+#endif
+#ifdef VK_KHR_16bit_storage
+#endif
+#ifdef VK_KHR_incremental_present
+#endif
+#ifdef VK_KHR_descriptor_update_template
+VkResult VkEncoder::vkCreateDescriptorUpdateTemplateKHR(
+    VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateDescriptorUpdateTemplateKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateDescriptorUpdateTemplateKHR(device:%p, pCreateInfo:%p, pAllocator:%p, "
+        "pDescriptorUpdateTemplate:%p)",
+        device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDescriptorUpdateTemplateCreateInfo* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkDescriptorUpdateTemplateCreateInfo*)pool->alloc(
+            sizeof(const VkDescriptorUpdateTemplateCreateInfo));
+        deepcopy_VkDescriptorUpdateTemplateCreateInfo(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+            (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkDescriptorUpdateTemplateCreateInfo(
+            sResourceTracker, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDescriptorUpdateTemplateCreateInfo(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateDescriptorUpdateTemplateKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCreateDescriptorUpdateTemplateKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateDescriptorUpdateTemplateKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateDescriptorUpdateTemplateKHR = OP_vkCreateDescriptorUpdateTemplateKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateDescriptorUpdateTemplateKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateDescriptorUpdateTemplateKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDescriptorUpdateTemplateCreateInfo(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo), streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pDescriptorUpdateTemplate));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCreateDescriptorUpdateTemplateKHR),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkDescriptorUpdateTemplate(
+        &cgen_var_3, (VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, 1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateDescriptorUpdateTemplateKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateDescriptorUpdateTemplateKHR_VkResult_return, sizeof(VkResult));
+    sResourceTracker->on_vkCreateDescriptorUpdateTemplateKHR(
+        this, vkCreateDescriptorUpdateTemplateKHR_VkResult_return, device, pCreateInfo, pAllocator,
+        pDescriptorUpdateTemplate);
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateDescriptorUpdateTemplateKHR_VkResult_return;
+}
+
+void VkEncoder::vkDestroyDescriptorUpdateTemplateKHR(
+    VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate,
+    const VkAllocationCallbacks* pAllocator, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyDescriptorUpdateTemplateKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkDestroyDescriptorUpdateTemplateKHR(device:%p, descriptorUpdateTemplate:%p, "
+        "pAllocator:%p)",
+        device, descriptorUpdateTemplate, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDescriptorUpdateTemplate local_descriptorUpdateTemplate;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_descriptorUpdateTemplate = descriptorUpdateTemplate;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyDescriptorUpdateTemplateKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkDestroyDescriptorUpdateTemplateKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyDescriptorUpdateTemplateKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyDescriptorUpdateTemplateKHR = OP_vkDestroyDescriptorUpdateTemplateKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyDescriptorUpdateTemplateKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyDescriptorUpdateTemplateKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDescriptorUpdateTemplate((*&local_descriptorUpdateTemplate));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkDestroyDescriptorUpdateTemplateKHR),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkDescriptorUpdateTemplate(
+        (VkDescriptorUpdateTemplate*)&descriptorUpdateTemplate);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkUpdateDescriptorSetWithTemplateKHR(
+    VkDevice device, VkDescriptorSet descriptorSet,
+    VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkUpdateDescriptorSetWithTemplateKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkUpdateDescriptorSetWithTemplateKHR(device:%p, descriptorSet:%p, "
+        "descriptorUpdateTemplate:%p, pData:%p)",
+        device, descriptorSet, descriptorUpdateTemplate, pData);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDescriptorSet local_descriptorSet;
+    VkDescriptorUpdateTemplate local_descriptorUpdateTemplate;
+    void* local_pData;
+    local_device = device;
+    local_descriptorSet = descriptorSet;
+    local_descriptorUpdateTemplate = descriptorUpdateTemplate;
+    // Avoiding deepcopy for pData
+    local_pData = (void*)pData;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_2;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pData) {
+            *countPtr += sizeof(uint8_t);
+        }
+    }
+    uint32_t packetSize_vkUpdateDescriptorSetWithTemplateKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkUpdateDescriptorSetWithTemplateKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkUpdateDescriptorSetWithTemplateKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkUpdateDescriptorSetWithTemplateKHR = OP_vkUpdateDescriptorSetWithTemplateKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkUpdateDescriptorSetWithTemplateKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkUpdateDescriptorSetWithTemplateKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDescriptorSet((*&local_descriptorSet));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = get_host_u64_VkDescriptorUpdateTemplate((*&local_descriptorUpdateTemplate));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_3 = (uint64_t)(uintptr_t)local_pData;
+    memcpy((*streamPtrPtr), &cgen_var_3, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pData) {
+        memcpy(*streamPtrPtr, (void*)local_pData, sizeof(uint8_t));
+        *streamPtrPtr += sizeof(uint8_t);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkUpdateDescriptorSetWithTemplateKHR),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_KHR_imageless_framebuffer
+#endif
+#ifdef VK_KHR_create_renderpass2
+VkResult VkEncoder::vkCreateRenderPass2KHR(VkDevice device,
+                                           const VkRenderPassCreateInfo2* pCreateInfo,
+                                           const VkAllocationCallbacks* pAllocator,
+                                           VkRenderPass* pRenderPass, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateRenderPass2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateRenderPass2KHR(device:%p, pCreateInfo:%p, pAllocator:%p, pRenderPass:%p)", device,
+        pCreateInfo, pAllocator, pRenderPass);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkRenderPassCreateInfo2* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo =
+            (VkRenderPassCreateInfo2*)pool->alloc(sizeof(const VkRenderPassCreateInfo2));
+        deepcopy_VkRenderPassCreateInfo2(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                         (VkRenderPassCreateInfo2*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkRenderPassCreateInfo2(sResourceTracker,
+                                                 (VkRenderPassCreateInfo2*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkRenderPassCreateInfo2(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                      (VkRenderPassCreateInfo2*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateRenderPass2KHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateRenderPass2KHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateRenderPass2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateRenderPass2KHR = OP_vkCreateRenderPass2KHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateRenderPass2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateRenderPass2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkRenderPassCreateInfo2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                            (VkRenderPassCreateInfo2*)(local_pCreateInfo),
+                                            streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pRenderPass));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateRenderPass2KHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkRenderPass(&cgen_var_3, (VkRenderPass*)pRenderPass,
+                                                         1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateRenderPass2KHR_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateRenderPass2KHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateRenderPass2KHR_VkResult_return;
+}
+
+void VkEncoder::vkCmdBeginRenderPass2KHR(VkCommandBuffer commandBuffer,
+                                         const VkRenderPassBeginInfo* pRenderPassBegin,
+                                         const VkSubpassBeginInfo* pSubpassBeginInfo,
+                                         uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdBeginRenderPass2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdBeginRenderPass2KHR(commandBuffer:%p, pRenderPassBegin:%p, pSubpassBeginInfo:%p)",
+        commandBuffer, pRenderPassBegin, pSubpassBeginInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkRenderPassBeginInfo* local_pRenderPassBegin;
+    VkSubpassBeginInfo* local_pSubpassBeginInfo;
+    local_commandBuffer = commandBuffer;
+    local_pRenderPassBegin = nullptr;
+    if (pRenderPassBegin) {
+        local_pRenderPassBegin =
+            (VkRenderPassBeginInfo*)pool->alloc(sizeof(const VkRenderPassBeginInfo));
+        deepcopy_VkRenderPassBeginInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pRenderPassBegin,
+                                       (VkRenderPassBeginInfo*)(local_pRenderPassBegin));
+    }
+    local_pSubpassBeginInfo = nullptr;
+    if (pSubpassBeginInfo) {
+        local_pSubpassBeginInfo =
+            (VkSubpassBeginInfo*)pool->alloc(sizeof(const VkSubpassBeginInfo));
+        deepcopy_VkSubpassBeginInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pSubpassBeginInfo,
+                                    (VkSubpassBeginInfo*)(local_pSubpassBeginInfo));
+    }
+    if (local_pRenderPassBegin) {
+        transform_tohost_VkRenderPassBeginInfo(sResourceTracker,
+                                               (VkRenderPassBeginInfo*)(local_pRenderPassBegin));
+    }
+    if (local_pSubpassBeginInfo) {
+        transform_tohost_VkSubpassBeginInfo(sResourceTracker,
+                                            (VkSubpassBeginInfo*)(local_pSubpassBeginInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkRenderPassBeginInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkRenderPassBeginInfo*)(local_pRenderPassBegin), countPtr);
+        count_VkSubpassBeginInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                 (VkSubpassBeginInfo*)(local_pSubpassBeginInfo), countPtr);
+    }
+    uint32_t packetSize_vkCmdBeginRenderPass2KHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdBeginRenderPass2KHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdBeginRenderPass2KHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdBeginRenderPass2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdBeginRenderPass2KHR = OP_vkCmdBeginRenderPass2KHR;
+    memcpy(streamPtr, &opcode_vkCmdBeginRenderPass2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdBeginRenderPass2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkRenderPassBeginInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkRenderPassBeginInfo*)(local_pRenderPassBegin),
+                                          streamPtrPtr);
+    reservedmarshal_VkSubpassBeginInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkSubpassBeginInfo*)(local_pSubpassBeginInfo),
+                                       streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdBeginRenderPass2KHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdNextSubpass2KHR(VkCommandBuffer commandBuffer,
+                                     const VkSubpassBeginInfo* pSubpassBeginInfo,
+                                     const VkSubpassEndInfo* pSubpassEndInfo, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdNextSubpass2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdNextSubpass2KHR(commandBuffer:%p, pSubpassBeginInfo:%p, pSubpassEndInfo:%p)",
+        commandBuffer, pSubpassBeginInfo, pSubpassEndInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkSubpassBeginInfo* local_pSubpassBeginInfo;
+    VkSubpassEndInfo* local_pSubpassEndInfo;
+    local_commandBuffer = commandBuffer;
+    local_pSubpassBeginInfo = nullptr;
+    if (pSubpassBeginInfo) {
+        local_pSubpassBeginInfo =
+            (VkSubpassBeginInfo*)pool->alloc(sizeof(const VkSubpassBeginInfo));
+        deepcopy_VkSubpassBeginInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pSubpassBeginInfo,
+                                    (VkSubpassBeginInfo*)(local_pSubpassBeginInfo));
+    }
+    local_pSubpassEndInfo = nullptr;
+    if (pSubpassEndInfo) {
+        local_pSubpassEndInfo = (VkSubpassEndInfo*)pool->alloc(sizeof(const VkSubpassEndInfo));
+        deepcopy_VkSubpassEndInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pSubpassEndInfo,
+                                  (VkSubpassEndInfo*)(local_pSubpassEndInfo));
+    }
+    if (local_pSubpassBeginInfo) {
+        transform_tohost_VkSubpassBeginInfo(sResourceTracker,
+                                            (VkSubpassBeginInfo*)(local_pSubpassBeginInfo));
+    }
+    if (local_pSubpassEndInfo) {
+        transform_tohost_VkSubpassEndInfo(sResourceTracker,
+                                          (VkSubpassEndInfo*)(local_pSubpassEndInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkSubpassBeginInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                 (VkSubpassBeginInfo*)(local_pSubpassBeginInfo), countPtr);
+        count_VkSubpassEndInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                               (VkSubpassEndInfo*)(local_pSubpassEndInfo), countPtr);
+    }
+    uint32_t packetSize_vkCmdNextSubpass2KHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdNextSubpass2KHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdNextSubpass2KHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdNextSubpass2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdNextSubpass2KHR = OP_vkCmdNextSubpass2KHR;
+    memcpy(streamPtr, &opcode_vkCmdNextSubpass2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdNextSubpass2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkSubpassBeginInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkSubpassBeginInfo*)(local_pSubpassBeginInfo),
+                                       streamPtrPtr);
+    reservedmarshal_VkSubpassEndInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                     (VkSubpassEndInfo*)(local_pSubpassEndInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdNextSubpass2KHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdEndRenderPass2KHR(VkCommandBuffer commandBuffer,
+                                       const VkSubpassEndInfo* pSubpassEndInfo, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdEndRenderPass2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdEndRenderPass2KHR(commandBuffer:%p, pSubpassEndInfo:%p)", commandBuffer,
+                      pSubpassEndInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkSubpassEndInfo* local_pSubpassEndInfo;
+    local_commandBuffer = commandBuffer;
+    local_pSubpassEndInfo = nullptr;
+    if (pSubpassEndInfo) {
+        local_pSubpassEndInfo = (VkSubpassEndInfo*)pool->alloc(sizeof(const VkSubpassEndInfo));
+        deepcopy_VkSubpassEndInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pSubpassEndInfo,
+                                  (VkSubpassEndInfo*)(local_pSubpassEndInfo));
+    }
+    if (local_pSubpassEndInfo) {
+        transform_tohost_VkSubpassEndInfo(sResourceTracker,
+                                          (VkSubpassEndInfo*)(local_pSubpassEndInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkSubpassEndInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                               (VkSubpassEndInfo*)(local_pSubpassEndInfo), countPtr);
+    }
+    uint32_t packetSize_vkCmdEndRenderPass2KHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdEndRenderPass2KHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdEndRenderPass2KHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdEndRenderPass2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdEndRenderPass2KHR = OP_vkCmdEndRenderPass2KHR;
+    memcpy(streamPtr, &opcode_vkCmdEndRenderPass2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdEndRenderPass2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkSubpassEndInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                     (VkSubpassEndInfo*)(local_pSubpassEndInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdEndRenderPass2KHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_KHR_shared_presentable_image
+VkResult VkEncoder::vkGetSwapchainStatusKHR(VkDevice device, VkSwapchainKHR swapchain,
+                                            uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetSwapchainStatusKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetSwapchainStatusKHR(device:%p, swapchain:%p)", device, swapchain);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSwapchainKHR local_swapchain;
+    local_device = device;
+    local_swapchain = swapchain;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkGetSwapchainStatusKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetSwapchainStatusKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetSwapchainStatusKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetSwapchainStatusKHR = OP_vkGetSwapchainStatusKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetSwapchainStatusKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetSwapchainStatusKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkSwapchainKHR((*&local_swapchain));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetSwapchainStatusKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkGetSwapchainStatusKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetSwapchainStatusKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetSwapchainStatusKHR_VkResult_return;
+}
+
+#endif
+#ifdef VK_KHR_external_fence_capabilities
+void VkEncoder::vkGetPhysicalDeviceExternalFencePropertiesKHR(
+    VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo,
+    VkExternalFenceProperties* pExternalFenceProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkGetPhysicalDeviceExternalFencePropertiesKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceExternalFencePropertiesKHR(physicalDevice:%p, pExternalFenceInfo:%p, "
+        "pExternalFenceProperties:%p)",
+        physicalDevice, pExternalFenceInfo, pExternalFenceProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkPhysicalDeviceExternalFenceInfo* local_pExternalFenceInfo;
+    local_physicalDevice = physicalDevice;
+    local_pExternalFenceInfo = nullptr;
+    if (pExternalFenceInfo) {
+        local_pExternalFenceInfo = (VkPhysicalDeviceExternalFenceInfo*)pool->alloc(
+            sizeof(const VkPhysicalDeviceExternalFenceInfo));
+        deepcopy_VkPhysicalDeviceExternalFenceInfo(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pExternalFenceInfo,
+            (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo));
+    }
+    if (local_pExternalFenceInfo) {
+        transform_tohost_VkPhysicalDeviceExternalFenceInfo(
+            sResourceTracker, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPhysicalDeviceExternalFenceInfo(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo), countPtr);
+        count_VkExternalFenceProperties(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkExternalFenceProperties*)(pExternalFenceProperties),
+                                        countPtr);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceExternalFencePropertiesKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceExternalFencePropertiesKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceExternalFencePropertiesKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceExternalFencePropertiesKHR =
+        OP_vkGetPhysicalDeviceExternalFencePropertiesKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceExternalFencePropertiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceExternalFencePropertiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPhysicalDeviceExternalFenceInfo(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo), streamPtrPtr);
+    reservedmarshal_VkExternalFenceProperties(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkExternalFenceProperties*)(pExternalFenceProperties),
+        streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceExternalFencePropertiesKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkExternalFenceProperties(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkExternalFenceProperties*)(pExternalFenceProperties));
+    if (pExternalFenceProperties) {
+        transform_fromhost_VkExternalFenceProperties(
+            sResourceTracker, (VkExternalFenceProperties*)(pExternalFenceProperties));
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_KHR_external_fence
+#endif
+#ifdef VK_KHR_external_fence_win32
+VkResult VkEncoder::vkImportFenceWin32HandleKHR(
+    VkDevice device, const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkImportFenceWin32HandleKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkImportFenceWin32HandleKHR(device:%p, pImportFenceWin32HandleInfo:%p)",
+                      device, pImportFenceWin32HandleInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkImportFenceWin32HandleInfoKHR* local_pImportFenceWin32HandleInfo;
+    local_device = device;
+    local_pImportFenceWin32HandleInfo = nullptr;
+    if (pImportFenceWin32HandleInfo) {
+        local_pImportFenceWin32HandleInfo = (VkImportFenceWin32HandleInfoKHR*)pool->alloc(
+            sizeof(const VkImportFenceWin32HandleInfoKHR));
+        deepcopy_VkImportFenceWin32HandleInfoKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pImportFenceWin32HandleInfo,
+            (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo));
+    }
+    if (local_pImportFenceWin32HandleInfo) {
+        transform_tohost_VkImportFenceWin32HandleInfoKHR(
+            sResourceTracker,
+            (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkImportFenceWin32HandleInfoKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo), countPtr);
+    }
+    uint32_t packetSize_vkImportFenceWin32HandleKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkImportFenceWin32HandleKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkImportFenceWin32HandleKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkImportFenceWin32HandleKHR = OP_vkImportFenceWin32HandleKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkImportFenceWin32HandleKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkImportFenceWin32HandleKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkImportFenceWin32HandleInfoKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkImportFenceWin32HandleKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkImportFenceWin32HandleKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkImportFenceWin32HandleKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkImportFenceWin32HandleKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetFenceWin32HandleKHR(
+    VkDevice device, const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetFenceWin32HandleKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetFenceWin32HandleKHR(device:%p, pGetWin32HandleInfo:%p, pHandle:%p)",
+                      device, pGetWin32HandleInfo, pHandle);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkFenceGetWin32HandleInfoKHR* local_pGetWin32HandleInfo;
+    local_device = device;
+    local_pGetWin32HandleInfo = nullptr;
+    if (pGetWin32HandleInfo) {
+        local_pGetWin32HandleInfo =
+            (VkFenceGetWin32HandleInfoKHR*)pool->alloc(sizeof(const VkFenceGetWin32HandleInfoKHR));
+        deepcopy_VkFenceGetWin32HandleInfoKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pGetWin32HandleInfo,
+            (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
+    }
+    if (local_pGetWin32HandleInfo) {
+        transform_tohost_VkFenceGetWin32HandleInfoKHR(
+            sResourceTracker, (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkFenceGetWin32HandleInfoKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo), countPtr);
+        *countPtr += sizeof(HANDLE);
+    }
+    uint32_t packetSize_vkGetFenceWin32HandleKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetFenceWin32HandleKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetFenceWin32HandleKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetFenceWin32HandleKHR = OP_vkGetFenceWin32HandleKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetFenceWin32HandleKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetFenceWin32HandleKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkFenceGetWin32HandleInfoKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo), streamPtrPtr);
+    memcpy(*streamPtrPtr, (HANDLE*)pHandle, sizeof(HANDLE));
+    *streamPtrPtr += sizeof(HANDLE);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetFenceWin32HandleKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((HANDLE*)pHandle, sizeof(HANDLE));
+    VkResult vkGetFenceWin32HandleKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetFenceWin32HandleKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetFenceWin32HandleKHR_VkResult_return;
+}
+
+#endif
+#ifdef VK_KHR_external_fence_fd
+VkResult VkEncoder::vkImportFenceFdKHR(VkDevice device,
+                                       const VkImportFenceFdInfoKHR* pImportFenceFdInfo,
+                                       uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkImportFenceFdKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkImportFenceFdKHR(device:%p, pImportFenceFdInfo:%p)", device,
+                      pImportFenceFdInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkImportFenceFdInfoKHR* local_pImportFenceFdInfo;
+    local_device = device;
+    local_pImportFenceFdInfo = nullptr;
+    if (pImportFenceFdInfo) {
+        local_pImportFenceFdInfo =
+            (VkImportFenceFdInfoKHR*)pool->alloc(sizeof(const VkImportFenceFdInfoKHR));
+        deepcopy_VkImportFenceFdInfoKHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pImportFenceFdInfo,
+                                        (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo));
+    }
+    if (local_pImportFenceFdInfo) {
+        transform_tohost_VkImportFenceFdInfoKHR(
+            sResourceTracker, (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkImportFenceFdInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                     (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo), countPtr);
+    }
+    uint32_t packetSize_vkImportFenceFdKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkImportFenceFdKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkImportFenceFdKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkImportFenceFdKHR = OP_vkImportFenceFdKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkImportFenceFdKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkImportFenceFdKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkImportFenceFdInfoKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                           (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo),
+                                           streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkImportFenceFdKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkImportFenceFdKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkImportFenceFdKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkImportFenceFdKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetFenceFdKHR(VkDevice device, const VkFenceGetFdInfoKHR* pGetFdInfo,
+                                    int* pFd, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetFenceFdKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetFenceFdKHR(device:%p, pGetFdInfo:%p, pFd:%p)", device, pGetFdInfo, pFd);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkFenceGetFdInfoKHR* local_pGetFdInfo;
+    local_device = device;
+    local_pGetFdInfo = nullptr;
+    if (pGetFdInfo) {
+        local_pGetFdInfo = (VkFenceGetFdInfoKHR*)pool->alloc(sizeof(const VkFenceGetFdInfoKHR));
+        deepcopy_VkFenceGetFdInfoKHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pGetFdInfo,
+                                     (VkFenceGetFdInfoKHR*)(local_pGetFdInfo));
+    }
+    if (local_pGetFdInfo) {
+        transform_tohost_VkFenceGetFdInfoKHR(sResourceTracker,
+                                             (VkFenceGetFdInfoKHR*)(local_pGetFdInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkFenceGetFdInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                  (VkFenceGetFdInfoKHR*)(local_pGetFdInfo), countPtr);
+        *countPtr += sizeof(int);
+    }
+    uint32_t packetSize_vkGetFenceFdKHR = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetFenceFdKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetFenceFdKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetFenceFdKHR = OP_vkGetFenceFdKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetFenceFdKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetFenceFdKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkFenceGetFdInfoKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkFenceGetFdInfoKHR*)(local_pGetFdInfo), streamPtrPtr);
+    memcpy(*streamPtrPtr, (int*)pFd, sizeof(int));
+    *streamPtrPtr += sizeof(int);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetFenceFdKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((int*)pFd, sizeof(int));
+    VkResult vkGetFenceFdKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetFenceFdKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetFenceFdKHR_VkResult_return;
+}
+
+#endif
+#ifdef VK_KHR_performance_query
+VkResult VkEncoder::vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(
+    VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, uint32_t* pCounterCount,
+    VkPerformanceCounterKHR* pCounters, VkPerformanceCounterDescriptionKHR* pCounterDescriptions,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(
+            mHealthMonitor,
+            "vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(physicalDevice:%p, "
+        "queueFamilyIndex:%d, pCounterCount:%p, pCounters:%p, pCounterDescriptions:%p)",
+        physicalDevice, queueFamilyIndex, pCounterCount, pCounters, pCounterDescriptions);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    uint32_t local_queueFamilyIndex;
+    local_physicalDevice = physicalDevice;
+    local_queueFamilyIndex = queueFamilyIndex;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pCounterCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pCounters) {
+            if (pCounterCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pCounterCount)); ++i) {
+                    count_VkPerformanceCounterKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                  (VkPerformanceCounterKHR*)(pCounters + i),
+                                                  countPtr);
+                }
+            }
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pCounterDescriptions) {
+            if (pCounterCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pCounterCount)); ++i) {
+                    count_VkPerformanceCounterDescriptionKHR(
+                        sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                        (VkPerformanceCounterDescriptionKHR*)(pCounterDescriptions + i), countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(
+        packetSize_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR);
+    uint8_t* streamPtr =
+        stream->reserve(packetSize_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR =
+        OP_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR,
+           sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR,
+           sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pCounterCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pCounterCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pCounterCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pCounters;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pCounters) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pCounterCount)); ++i) {
+            reservedmarshal_VkPerformanceCounterKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                    (VkPerformanceCounterKHR*)(pCounters + i),
+                                                    streamPtrPtr);
+        }
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_3 = (uint64_t)(uintptr_t)pCounterDescriptions;
+    memcpy((*streamPtrPtr), &cgen_var_3, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pCounterDescriptions) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pCounterCount)); ++i) {
+            reservedmarshal_VkPerformanceCounterDescriptionKHR(
+                stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkPerformanceCounterDescriptionKHR*)(pCounterDescriptions + i), streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(
+                packetSize_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pCounterCount;
+    check_pCounterCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pCounterCount) {
+        if (!(check_pCounterCount)) {
+            fprintf(stderr, "fatal: pCounterCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pCounterCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkPerformanceCounterKHR* check_pCounters;
+    check_pCounters = (VkPerformanceCounterKHR*)(uintptr_t)stream->getBe64();
+    if (pCounters) {
+        if (!(check_pCounters)) {
+            fprintf(stderr, "fatal: pCounters inconsistent between guest and host\n");
+        }
+        if (pCounterCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pCounterCount)); ++i) {
+                unmarshal_VkPerformanceCounterKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                  (VkPerformanceCounterKHR*)(pCounters + i));
+            }
+        }
+    }
+    if (pCounterCount) {
+        if (pCounters) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pCounterCount)); ++i) {
+                transform_fromhost_VkPerformanceCounterKHR(
+                    sResourceTracker, (VkPerformanceCounterKHR*)(pCounters + i));
+            }
+        }
+    }
+    // WARNING PTR CHECK
+    VkPerformanceCounterDescriptionKHR* check_pCounterDescriptions;
+    check_pCounterDescriptions = (VkPerformanceCounterDescriptionKHR*)(uintptr_t)stream->getBe64();
+    if (pCounterDescriptions) {
+        if (!(check_pCounterDescriptions)) {
+            fprintf(stderr, "fatal: pCounterDescriptions inconsistent between guest and host\n");
+        }
+        if (pCounterCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pCounterCount)); ++i) {
+                unmarshal_VkPerformanceCounterDescriptionKHR(
+                    stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                    (VkPerformanceCounterDescriptionKHR*)(pCounterDescriptions + i));
+            }
+        }
+    }
+    if (pCounterCount) {
+        if (pCounterDescriptions) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pCounterCount)); ++i) {
+                transform_fromhost_VkPerformanceCounterDescriptionKHR(
+                    sResourceTracker,
+                    (VkPerformanceCounterDescriptionKHR*)(pCounterDescriptions + i));
+            }
+        }
+    }
+    VkResult vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR_VkResult_return =
+        (VkResult)0;
+    stream->read(&vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR_VkResult_return,
+                 sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR_VkResult_return;
+}
+
+void VkEncoder::vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(
+    VkPhysicalDevice physicalDevice,
+    const VkQueryPoolPerformanceCreateInfoKHR* pPerformanceQueryCreateInfo, uint32_t* pNumPasses,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(physicalDevice:%p, "
+        "pPerformanceQueryCreateInfo:%p, pNumPasses:%p)",
+        physicalDevice, pPerformanceQueryCreateInfo, pNumPasses);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkQueryPoolPerformanceCreateInfoKHR* local_pPerformanceQueryCreateInfo;
+    local_physicalDevice = physicalDevice;
+    local_pPerformanceQueryCreateInfo = nullptr;
+    if (pPerformanceQueryCreateInfo) {
+        local_pPerformanceQueryCreateInfo = (VkQueryPoolPerformanceCreateInfoKHR*)pool->alloc(
+            sizeof(const VkQueryPoolPerformanceCreateInfoKHR));
+        deepcopy_VkQueryPoolPerformanceCreateInfoKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pPerformanceQueryCreateInfo,
+            (VkQueryPoolPerformanceCreateInfoKHR*)(local_pPerformanceQueryCreateInfo));
+    }
+    if (local_pPerformanceQueryCreateInfo) {
+        transform_tohost_VkQueryPoolPerformanceCreateInfoKHR(
+            sResourceTracker,
+            (VkQueryPoolPerformanceCreateInfoKHR*)(local_pPerformanceQueryCreateInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkQueryPoolPerformanceCreateInfoKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkQueryPoolPerformanceCreateInfoKHR*)(local_pPerformanceQueryCreateInfo), countPtr);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR);
+    uint8_t* streamPtr =
+        stream->reserve(packetSize_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR =
+        OP_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR,
+           sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR,
+           sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkQueryPoolPerformanceCreateInfoKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkQueryPoolPerformanceCreateInfoKHR*)(local_pPerformanceQueryCreateInfo), streamPtrPtr);
+    memcpy(*streamPtrPtr, (uint32_t*)pNumPasses, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((uint32_t*)pNumPasses, sizeof(uint32_t));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkAcquireProfilingLockKHR(VkDevice device,
+                                              const VkAcquireProfilingLockInfoKHR* pInfo,
+                                              uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkAcquireProfilingLockKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkAcquireProfilingLockKHR(device:%p, pInfo:%p)", device, pInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkAcquireProfilingLockInfoKHR* local_pInfo;
+    local_device = device;
+    local_pInfo = nullptr;
+    if (pInfo) {
+        local_pInfo = (VkAcquireProfilingLockInfoKHR*)pool->alloc(
+            sizeof(const VkAcquireProfilingLockInfoKHR));
+        deepcopy_VkAcquireProfilingLockInfoKHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfo,
+                                               (VkAcquireProfilingLockInfoKHR*)(local_pInfo));
+    }
+    if (local_pInfo) {
+        transform_tohost_VkAcquireProfilingLockInfoKHR(
+            sResourceTracker, (VkAcquireProfilingLockInfoKHR*)(local_pInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkAcquireProfilingLockInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                            (VkAcquireProfilingLockInfoKHR*)(local_pInfo),
+                                            countPtr);
+    }
+    uint32_t packetSize_vkAcquireProfilingLockKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkAcquireProfilingLockKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkAcquireProfilingLockKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkAcquireProfilingLockKHR = OP_vkAcquireProfilingLockKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkAcquireProfilingLockKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkAcquireProfilingLockKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkAcquireProfilingLockInfoKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                  (VkAcquireProfilingLockInfoKHR*)(local_pInfo),
+                                                  streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkAcquireProfilingLockKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkAcquireProfilingLockKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkAcquireProfilingLockKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkAcquireProfilingLockKHR_VkResult_return;
+}
+
+void VkEncoder::vkReleaseProfilingLockKHR(VkDevice device, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkReleaseProfilingLockKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkReleaseProfilingLockKHR(device:%p)", device);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    local_device = device;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkReleaseProfilingLockKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkReleaseProfilingLockKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkReleaseProfilingLockKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkReleaseProfilingLockKHR = OP_vkReleaseProfilingLockKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkReleaseProfilingLockKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkReleaseProfilingLockKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkReleaseProfilingLockKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_KHR_maintenance2
+#endif
+#ifdef VK_KHR_get_surface_capabilities2
+VkResult VkEncoder::vkGetPhysicalDeviceSurfaceCapabilities2KHR(
+    VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
+    VkSurfaceCapabilities2KHR* pSurfaceCapabilities, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceSurfaceCapabilities2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceSurfaceCapabilities2KHR(physicalDevice:%p, pSurfaceInfo:%p, "
+        "pSurfaceCapabilities:%p)",
+        physicalDevice, pSurfaceInfo, pSurfaceCapabilities);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkPhysicalDeviceSurfaceInfo2KHR* local_pSurfaceInfo;
+    local_physicalDevice = physicalDevice;
+    local_pSurfaceInfo = nullptr;
+    if (pSurfaceInfo) {
+        local_pSurfaceInfo = (VkPhysicalDeviceSurfaceInfo2KHR*)pool->alloc(
+            sizeof(const VkPhysicalDeviceSurfaceInfo2KHR));
+        deepcopy_VkPhysicalDeviceSurfaceInfo2KHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pSurfaceInfo,
+            (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo));
+    }
+    if (local_pSurfaceInfo) {
+        transform_tohost_VkPhysicalDeviceSurfaceInfo2KHR(
+            sResourceTracker, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPhysicalDeviceSurfaceInfo2KHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo), countPtr);
+        count_VkSurfaceCapabilities2KHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities),
+                                        countPtr);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceSurfaceCapabilities2KHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceSurfaceCapabilities2KHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceSurfaceCapabilities2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilities2KHR =
+        OP_vkGetPhysicalDeviceSurfaceCapabilities2KHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceSurfaceCapabilities2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceSurfaceCapabilities2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPhysicalDeviceSurfaceInfo2KHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo),
+        streamPtrPtr);
+    reservedmarshal_VkSurfaceCapabilities2KHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities),
+                                              streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceSurfaceCapabilities2KHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkSurfaceCapabilities2KHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities));
+    if (pSurfaceCapabilities) {
+        transform_fromhost_VkSurfaceCapabilities2KHR(
+            sResourceTracker, (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities));
+    }
+    VkResult vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetPhysicalDeviceSurfaceFormats2KHR(
+    VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
+    uint32_t* pSurfaceFormatCount, VkSurfaceFormat2KHR* pSurfaceFormats, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceSurfaceFormats2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceSurfaceFormats2KHR(physicalDevice:%p, pSurfaceInfo:%p, "
+        "pSurfaceFormatCount:%p, pSurfaceFormats:%p)",
+        physicalDevice, pSurfaceInfo, pSurfaceFormatCount, pSurfaceFormats);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkPhysicalDeviceSurfaceInfo2KHR* local_pSurfaceInfo;
+    local_physicalDevice = physicalDevice;
+    local_pSurfaceInfo = nullptr;
+    if (pSurfaceInfo) {
+        local_pSurfaceInfo = (VkPhysicalDeviceSurfaceInfo2KHR*)pool->alloc(
+            sizeof(const VkPhysicalDeviceSurfaceInfo2KHR));
+        deepcopy_VkPhysicalDeviceSurfaceInfo2KHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pSurfaceInfo,
+            (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo));
+    }
+    if (local_pSurfaceInfo) {
+        transform_tohost_VkPhysicalDeviceSurfaceInfo2KHR(
+            sResourceTracker, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPhysicalDeviceSurfaceInfo2KHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pSurfaceFormatCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pSurfaceFormats) {
+            if (pSurfaceFormatCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) {
+                    count_VkSurfaceFormat2KHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkSurfaceFormat2KHR*)(pSurfaceFormats + i),
+                                              countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceSurfaceFormats2KHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceSurfaceFormats2KHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceSurfaceFormats2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceSurfaceFormats2KHR =
+        OP_vkGetPhysicalDeviceSurfaceFormats2KHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceSurfaceFormats2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceSurfaceFormats2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPhysicalDeviceSurfaceInfo2KHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo),
+        streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pSurfaceFormatCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pSurfaceFormatCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pSurfaceFormatCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pSurfaceFormats;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pSurfaceFormats) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) {
+            reservedmarshal_VkSurfaceFormat2KHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                (VkSurfaceFormat2KHR*)(pSurfaceFormats + i),
+                                                streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetPhysicalDeviceSurfaceFormats2KHR),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pSurfaceFormatCount;
+    check_pSurfaceFormatCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pSurfaceFormatCount) {
+        if (!(check_pSurfaceFormatCount)) {
+            fprintf(stderr, "fatal: pSurfaceFormatCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkSurfaceFormat2KHR* check_pSurfaceFormats;
+    check_pSurfaceFormats = (VkSurfaceFormat2KHR*)(uintptr_t)stream->getBe64();
+    if (pSurfaceFormats) {
+        if (!(check_pSurfaceFormats)) {
+            fprintf(stderr, "fatal: pSurfaceFormats inconsistent between guest and host\n");
+        }
+        if (pSurfaceFormatCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) {
+                unmarshal_VkSurfaceFormat2KHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkSurfaceFormat2KHR*)(pSurfaceFormats + i));
+            }
+        }
+    }
+    if (pSurfaceFormatCount) {
+        if (pSurfaceFormats) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) {
+                transform_fromhost_VkSurfaceFormat2KHR(sResourceTracker,
+                                                       (VkSurfaceFormat2KHR*)(pSurfaceFormats + i));
+            }
+        }
+    }
+    VkResult vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return;
+}
+
+#endif
+#ifdef VK_KHR_variable_pointers
+#endif
+#ifdef VK_KHR_get_display_properties2
+VkResult VkEncoder::vkGetPhysicalDeviceDisplayProperties2KHR(VkPhysicalDevice physicalDevice,
+                                                             uint32_t* pPropertyCount,
+                                                             VkDisplayProperties2KHR* pProperties,
+                                                             uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceDisplayProperties2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceDisplayProperties2KHR(physicalDevice:%p, pPropertyCount:%p, "
+        "pProperties:%p)",
+        physicalDevice, pPropertyCount, pProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    local_physicalDevice = physicalDevice;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pPropertyCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pProperties) {
+            if (pPropertyCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                    count_VkDisplayProperties2KHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                  (VkDisplayProperties2KHR*)(pProperties + i),
+                                                  countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceDisplayProperties2KHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceDisplayProperties2KHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceDisplayProperties2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceDisplayProperties2KHR =
+        OP_vkGetPhysicalDeviceDisplayProperties2KHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceDisplayProperties2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceDisplayProperties2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pPropertyCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pPropertyCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pPropertyCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pProperties;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pProperties) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+            reservedmarshal_VkDisplayProperties2KHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                    (VkDisplayProperties2KHR*)(pProperties + i),
+                                                    streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceDisplayProperties2KHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pPropertyCount;
+    check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pPropertyCount) {
+        if (!(check_pPropertyCount)) {
+            fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkDisplayProperties2KHR* check_pProperties;
+    check_pProperties = (VkDisplayProperties2KHR*)(uintptr_t)stream->getBe64();
+    if (pProperties) {
+        if (!(check_pProperties)) {
+            fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
+        }
+        if (pPropertyCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                unmarshal_VkDisplayProperties2KHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                  (VkDisplayProperties2KHR*)(pProperties + i));
+            }
+        }
+    }
+    if (pPropertyCount) {
+        if (pProperties) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                transform_fromhost_VkDisplayProperties2KHR(
+                    sResourceTracker, (VkDisplayProperties2KHR*)(pProperties + i));
+            }
+        }
+    }
+    VkResult vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetPhysicalDeviceDisplayPlaneProperties2KHR(
+    VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount,
+    VkDisplayPlaneProperties2KHR* pProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkGetPhysicalDeviceDisplayPlaneProperties2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceDisplayPlaneProperties2KHR(physicalDevice:%p, pPropertyCount:%p, "
+        "pProperties:%p)",
+        physicalDevice, pPropertyCount, pProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    local_physicalDevice = physicalDevice;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pPropertyCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pProperties) {
+            if (pPropertyCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                    count_VkDisplayPlaneProperties2KHR(
+                        sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                        (VkDisplayPlaneProperties2KHR*)(pProperties + i), countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceDisplayPlaneProperties2KHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceDisplayPlaneProperties2KHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceDisplayPlaneProperties2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceDisplayPlaneProperties2KHR =
+        OP_vkGetPhysicalDeviceDisplayPlaneProperties2KHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceDisplayPlaneProperties2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceDisplayPlaneProperties2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pPropertyCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pPropertyCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pPropertyCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pProperties;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pProperties) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+            reservedmarshal_VkDisplayPlaneProperties2KHR(
+                stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkDisplayPlaneProperties2KHR*)(pProperties + i), streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceDisplayPlaneProperties2KHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pPropertyCount;
+    check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pPropertyCount) {
+        if (!(check_pPropertyCount)) {
+            fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkDisplayPlaneProperties2KHR* check_pProperties;
+    check_pProperties = (VkDisplayPlaneProperties2KHR*)(uintptr_t)stream->getBe64();
+    if (pProperties) {
+        if (!(check_pProperties)) {
+            fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
+        }
+        if (pPropertyCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                unmarshal_VkDisplayPlaneProperties2KHR(
+                    stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                    (VkDisplayPlaneProperties2KHR*)(pProperties + i));
+            }
+        }
+    }
+    if (pPropertyCount) {
+        if (pProperties) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                transform_fromhost_VkDisplayPlaneProperties2KHR(
+                    sResourceTracker, (VkDisplayPlaneProperties2KHR*)(pProperties + i));
+            }
+        }
+    }
+    VkResult vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetDisplayModeProperties2KHR(VkPhysicalDevice physicalDevice,
+                                                   VkDisplayKHR display, uint32_t* pPropertyCount,
+                                                   VkDisplayModeProperties2KHR* pProperties,
+                                                   uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetDisplayModeProperties2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetDisplayModeProperties2KHR(physicalDevice:%p, display:%p, pPropertyCount:%p, "
+        "pProperties:%p)",
+        physicalDevice, display, pPropertyCount, pProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkDisplayKHR local_display;
+    local_physicalDevice = physicalDevice;
+    local_display = display;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pPropertyCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pProperties) {
+            if (pPropertyCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                    count_VkDisplayModeProperties2KHR(
+                        sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                        (VkDisplayModeProperties2KHR*)(pProperties + i), countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetDisplayModeProperties2KHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetDisplayModeProperties2KHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetDisplayModeProperties2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetDisplayModeProperties2KHR = OP_vkGetDisplayModeProperties2KHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetDisplayModeProperties2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetDisplayModeProperties2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDisplayKHR((*&local_display));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pPropertyCount;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pPropertyCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pPropertyCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_3 = (uint64_t)(uintptr_t)pProperties;
+    memcpy((*streamPtrPtr), &cgen_var_3, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pProperties) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+            reservedmarshal_VkDisplayModeProperties2KHR(
+                stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkDisplayModeProperties2KHR*)(pProperties + i),
+                streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetDisplayModeProperties2KHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pPropertyCount;
+    check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pPropertyCount) {
+        if (!(check_pPropertyCount)) {
+            fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkDisplayModeProperties2KHR* check_pProperties;
+    check_pProperties = (VkDisplayModeProperties2KHR*)(uintptr_t)stream->getBe64();
+    if (pProperties) {
+        if (!(check_pProperties)) {
+            fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
+        }
+        if (pPropertyCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                unmarshal_VkDisplayModeProperties2KHR(
+                    stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                    (VkDisplayModeProperties2KHR*)(pProperties + i));
+            }
+        }
+    }
+    if (pPropertyCount) {
+        if (pProperties) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                transform_fromhost_VkDisplayModeProperties2KHR(
+                    sResourceTracker, (VkDisplayModeProperties2KHR*)(pProperties + i));
+            }
+        }
+    }
+    VkResult vkGetDisplayModeProperties2KHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetDisplayModeProperties2KHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetDisplayModeProperties2KHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetDisplayPlaneCapabilities2KHR(
+    VkPhysicalDevice physicalDevice, const VkDisplayPlaneInfo2KHR* pDisplayPlaneInfo,
+    VkDisplayPlaneCapabilities2KHR* pCapabilities, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetDisplayPlaneCapabilities2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetDisplayPlaneCapabilities2KHR(physicalDevice:%p, pDisplayPlaneInfo:%p, "
+        "pCapabilities:%p)",
+        physicalDevice, pDisplayPlaneInfo, pCapabilities);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkDisplayPlaneInfo2KHR* local_pDisplayPlaneInfo;
+    local_physicalDevice = physicalDevice;
+    local_pDisplayPlaneInfo = nullptr;
+    if (pDisplayPlaneInfo) {
+        local_pDisplayPlaneInfo =
+            (VkDisplayPlaneInfo2KHR*)pool->alloc(sizeof(const VkDisplayPlaneInfo2KHR));
+        deepcopy_VkDisplayPlaneInfo2KHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pDisplayPlaneInfo,
+                                        (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo));
+    }
+    if (local_pDisplayPlaneInfo) {
+        transform_tohost_VkDisplayPlaneInfo2KHR(sResourceTracker,
+                                                (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDisplayPlaneInfo2KHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                     (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo), countPtr);
+        count_VkDisplayPlaneCapabilities2KHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                             (VkDisplayPlaneCapabilities2KHR*)(pCapabilities),
+                                             countPtr);
+    }
+    uint32_t packetSize_vkGetDisplayPlaneCapabilities2KHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetDisplayPlaneCapabilities2KHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetDisplayPlaneCapabilities2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetDisplayPlaneCapabilities2KHR = OP_vkGetDisplayPlaneCapabilities2KHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetDisplayPlaneCapabilities2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetDisplayPlaneCapabilities2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDisplayPlaneInfo2KHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                           (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo),
+                                           streamPtrPtr);
+    reservedmarshal_VkDisplayPlaneCapabilities2KHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                   (VkDisplayPlaneCapabilities2KHR*)(pCapabilities),
+                                                   streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetDisplayPlaneCapabilities2KHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkDisplayPlaneCapabilities2KHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                             (VkDisplayPlaneCapabilities2KHR*)(pCapabilities));
+    if (pCapabilities) {
+        transform_fromhost_VkDisplayPlaneCapabilities2KHR(
+            sResourceTracker, (VkDisplayPlaneCapabilities2KHR*)(pCapabilities));
+    }
+    VkResult vkGetDisplayPlaneCapabilities2KHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetDisplayPlaneCapabilities2KHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetDisplayPlaneCapabilities2KHR_VkResult_return;
+}
+
+#endif
+#ifdef VK_KHR_dedicated_allocation
+#endif
+#ifdef VK_KHR_storage_buffer_storage_class
+#endif
+#ifdef VK_KHR_relaxed_block_layout
+#endif
+#ifdef VK_KHR_get_memory_requirements2
+void VkEncoder::vkGetImageMemoryRequirements2KHR(VkDevice device,
+                                                 const VkImageMemoryRequirementsInfo2* pInfo,
+                                                 VkMemoryRequirements2* pMemoryRequirements,
+                                                 uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetImageMemoryRequirements2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetImageMemoryRequirements2KHR(device:%p, pInfo:%p, pMemoryRequirements:%p)", device,
+        pInfo, pMemoryRequirements);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkImageMemoryRequirementsInfo2* local_pInfo;
+    local_device = device;
+    local_pInfo = nullptr;
+    if (pInfo) {
+        local_pInfo = (VkImageMemoryRequirementsInfo2*)pool->alloc(
+            sizeof(const VkImageMemoryRequirementsInfo2));
+        deepcopy_VkImageMemoryRequirementsInfo2(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfo,
+                                                (VkImageMemoryRequirementsInfo2*)(local_pInfo));
+    }
+    if (local_pInfo) {
+        transform_tohost_VkImageMemoryRequirementsInfo2(
+            sResourceTracker, (VkImageMemoryRequirementsInfo2*)(local_pInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkImageMemoryRequirementsInfo2(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                             (VkImageMemoryRequirementsInfo2*)(local_pInfo),
+                                             countPtr);
+        count_VkMemoryRequirements2(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkMemoryRequirements2*)(pMemoryRequirements), countPtr);
+    }
+    uint32_t packetSize_vkGetImageMemoryRequirements2KHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetImageMemoryRequirements2KHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetImageMemoryRequirements2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetImageMemoryRequirements2KHR = OP_vkGetImageMemoryRequirements2KHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetImageMemoryRequirements2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetImageMemoryRequirements2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkImageMemoryRequirementsInfo2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                   (VkImageMemoryRequirementsInfo2*)(local_pInfo),
+                                                   streamPtrPtr);
+    reservedmarshal_VkMemoryRequirements2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkMemoryRequirements2*)(pMemoryRequirements),
+                                          streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetImageMemoryRequirements2KHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkMemoryRequirements2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkMemoryRequirements2*)(pMemoryRequirements));
+    if (pMemoryRequirements) {
+        transform_fromhost_VkMemoryRequirements2(sResourceTracker,
+                                                 (VkMemoryRequirements2*)(pMemoryRequirements));
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetBufferMemoryRequirements2KHR(VkDevice device,
+                                                  const VkBufferMemoryRequirementsInfo2* pInfo,
+                                                  VkMemoryRequirements2* pMemoryRequirements,
+                                                  uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetBufferMemoryRequirements2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetBufferMemoryRequirements2KHR(device:%p, pInfo:%p, pMemoryRequirements:%p)", device,
+        pInfo, pMemoryRequirements);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkBufferMemoryRequirementsInfo2* local_pInfo;
+    local_device = device;
+    local_pInfo = nullptr;
+    if (pInfo) {
+        local_pInfo = (VkBufferMemoryRequirementsInfo2*)pool->alloc(
+            sizeof(const VkBufferMemoryRequirementsInfo2));
+        deepcopy_VkBufferMemoryRequirementsInfo2(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfo,
+                                                 (VkBufferMemoryRequirementsInfo2*)(local_pInfo));
+    }
+    if (local_pInfo) {
+        transform_tohost_VkBufferMemoryRequirementsInfo2(
+            sResourceTracker, (VkBufferMemoryRequirementsInfo2*)(local_pInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkBufferMemoryRequirementsInfo2(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkBufferMemoryRequirementsInfo2*)(local_pInfo),
+                                              countPtr);
+        count_VkMemoryRequirements2(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkMemoryRequirements2*)(pMemoryRequirements), countPtr);
+    }
+    uint32_t packetSize_vkGetBufferMemoryRequirements2KHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetBufferMemoryRequirements2KHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetBufferMemoryRequirements2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetBufferMemoryRequirements2KHR = OP_vkGetBufferMemoryRequirements2KHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetBufferMemoryRequirements2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetBufferMemoryRequirements2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkBufferMemoryRequirementsInfo2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                    (VkBufferMemoryRequirementsInfo2*)(local_pInfo),
+                                                    streamPtrPtr);
+    reservedmarshal_VkMemoryRequirements2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkMemoryRequirements2*)(pMemoryRequirements),
+                                          streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetBufferMemoryRequirements2KHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkMemoryRequirements2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkMemoryRequirements2*)(pMemoryRequirements));
+    if (pMemoryRequirements) {
+        transform_fromhost_VkMemoryRequirements2(sResourceTracker,
+                                                 (VkMemoryRequirements2*)(pMemoryRequirements));
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetImageSparseMemoryRequirements2KHR(
+    VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo,
+    uint32_t* pSparseMemoryRequirementCount,
+    VkSparseImageMemoryRequirements2* pSparseMemoryRequirements, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetImageSparseMemoryRequirements2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetImageSparseMemoryRequirements2KHR(device:%p, pInfo:%p, "
+        "pSparseMemoryRequirementCount:%p, pSparseMemoryRequirements:%p)",
+        device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkImageSparseMemoryRequirementsInfo2* local_pInfo;
+    local_device = device;
+    local_pInfo = nullptr;
+    if (pInfo) {
+        local_pInfo = (VkImageSparseMemoryRequirementsInfo2*)pool->alloc(
+            sizeof(const VkImageSparseMemoryRequirementsInfo2));
+        deepcopy_VkImageSparseMemoryRequirementsInfo2(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfo,
+            (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo));
+    }
+    if (local_pInfo) {
+        transform_tohost_VkImageSparseMemoryRequirementsInfo2(
+            sResourceTracker, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkImageSparseMemoryRequirementsInfo2(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pSparseMemoryRequirementCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pSparseMemoryRequirements) {
+            if (pSparseMemoryRequirementCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) {
+                    count_VkSparseImageMemoryRequirements2(
+                        sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                        (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i),
+                        countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetImageSparseMemoryRequirements2KHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetImageSparseMemoryRequirements2KHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetImageSparseMemoryRequirements2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetImageSparseMemoryRequirements2KHR =
+        OP_vkGetImageSparseMemoryRequirements2KHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetImageSparseMemoryRequirements2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetImageSparseMemoryRequirements2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkImageSparseMemoryRequirementsInfo2(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo),
+        streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pSparseMemoryRequirementCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pSparseMemoryRequirements;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pSparseMemoryRequirements) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) {
+            reservedmarshal_VkSparseImageMemoryRequirements2(
+                stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i), streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetImageSparseMemoryRequirements2KHR),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pSparseMemoryRequirementCount;
+    check_pSparseMemoryRequirementCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pSparseMemoryRequirementCount) {
+        if (!(check_pSparseMemoryRequirementCount)) {
+            fprintf(stderr,
+                    "fatal: pSparseMemoryRequirementCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkSparseImageMemoryRequirements2* check_pSparseMemoryRequirements;
+    check_pSparseMemoryRequirements =
+        (VkSparseImageMemoryRequirements2*)(uintptr_t)stream->getBe64();
+    if (pSparseMemoryRequirements) {
+        if (!(check_pSparseMemoryRequirements)) {
+            fprintf(stderr,
+                    "fatal: pSparseMemoryRequirements inconsistent between guest and host\n");
+        }
+        if (pSparseMemoryRequirementCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) {
+                unmarshal_VkSparseImageMemoryRequirements2(
+                    stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                    (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i));
+            }
+        }
+    }
+    if (pSparseMemoryRequirementCount) {
+        if (pSparseMemoryRequirements) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) {
+                transform_fromhost_VkSparseImageMemoryRequirements2(
+                    sResourceTracker,
+                    (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i));
+            }
+        }
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_KHR_image_format_list
+#endif
+#ifdef VK_KHR_sampler_ycbcr_conversion
+VkResult VkEncoder::vkCreateSamplerYcbcrConversionKHR(
+    VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateSamplerYcbcrConversionKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateSamplerYcbcrConversionKHR(device:%p, pCreateInfo:%p, pAllocator:%p, "
+        "pYcbcrConversion:%p)",
+        device, pCreateInfo, pAllocator, pYcbcrConversion);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSamplerYcbcrConversionCreateInfo* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkSamplerYcbcrConversionCreateInfo*)pool->alloc(
+            sizeof(const VkSamplerYcbcrConversionCreateInfo));
+        deepcopy_VkSamplerYcbcrConversionCreateInfo(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+            (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkSamplerYcbcrConversionCreateInfo(
+            sResourceTracker, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkSamplerYcbcrConversionCreateInfo(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateSamplerYcbcrConversionKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCreateSamplerYcbcrConversionKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateSamplerYcbcrConversionKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateSamplerYcbcrConversionKHR = OP_vkCreateSamplerYcbcrConversionKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateSamplerYcbcrConversionKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateSamplerYcbcrConversionKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkSamplerYcbcrConversionCreateInfo(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo), streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pYcbcrConversion));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateSamplerYcbcrConversionKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkSamplerYcbcrConversion(
+        &cgen_var_3, (VkSamplerYcbcrConversion*)pYcbcrConversion, 1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateSamplerYcbcrConversionKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateSamplerYcbcrConversionKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateSamplerYcbcrConversionKHR_VkResult_return;
+}
+
+void VkEncoder::vkDestroySamplerYcbcrConversionKHR(VkDevice device,
+                                                   VkSamplerYcbcrConversion ycbcrConversion,
+                                                   const VkAllocationCallbacks* pAllocator,
+                                                   uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroySamplerYcbcrConversionKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkDestroySamplerYcbcrConversionKHR(device:%p, ycbcrConversion:%p, pAllocator:%p)", device,
+        ycbcrConversion, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSamplerYcbcrConversion local_ycbcrConversion;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_ycbcrConversion = ycbcrConversion;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroySamplerYcbcrConversionKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkDestroySamplerYcbcrConversionKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroySamplerYcbcrConversionKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroySamplerYcbcrConversionKHR = OP_vkDestroySamplerYcbcrConversionKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroySamplerYcbcrConversionKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroySamplerYcbcrConversionKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkSamplerYcbcrConversion((*&local_ycbcrConversion));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroySamplerYcbcrConversionKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkSamplerYcbcrConversion(
+        (VkSamplerYcbcrConversion*)&ycbcrConversion);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_KHR_bind_memory2
+VkResult VkEncoder::vkBindBufferMemory2KHR(VkDevice device, uint32_t bindInfoCount,
+                                           const VkBindBufferMemoryInfo* pBindInfos,
+                                           uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkBindBufferMemory2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkBindBufferMemory2KHR(device:%p, bindInfoCount:%d, pBindInfos:%p)", device,
+                      bindInfoCount, pBindInfos);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    uint32_t local_bindInfoCount;
+    VkBindBufferMemoryInfo* local_pBindInfos;
+    local_device = device;
+    local_bindInfoCount = bindInfoCount;
+    local_pBindInfos = nullptr;
+    if (pBindInfos) {
+        local_pBindInfos = (VkBindBufferMemoryInfo*)pool->alloc(
+            ((bindInfoCount)) * sizeof(const VkBindBufferMemoryInfo));
+        for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) {
+            deepcopy_VkBindBufferMemoryInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pBindInfos + i,
+                                            (VkBindBufferMemoryInfo*)(local_pBindInfos + i));
+        }
+    }
+    if (local_pBindInfos) {
+        for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) {
+            transform_tohost_VkBindBufferMemoryInfo(
+                sResourceTracker, (VkBindBufferMemoryInfo*)(local_pBindInfos + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) {
+            count_VkBindBufferMemoryInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkBindBufferMemoryInfo*)(local_pBindInfos + i), countPtr);
+        }
+    }
+    uint32_t packetSize_vkBindBufferMemory2KHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkBindBufferMemory2KHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkBindBufferMemory2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkBindBufferMemory2KHR = OP_vkBindBufferMemory2KHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkBindBufferMemory2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkBindBufferMemory2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) {
+        reservedmarshal_VkBindBufferMemoryInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                               (VkBindBufferMemoryInfo*)(local_pBindInfos + i),
+                                               streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkBindBufferMemory2KHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkBindBufferMemory2KHR_VkResult_return = (VkResult)0;
+    stream->read(&vkBindBufferMemory2KHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkBindBufferMemory2KHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkBindImageMemory2KHR(VkDevice device, uint32_t bindInfoCount,
+                                          const VkBindImageMemoryInfo* pBindInfos,
+                                          uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkBindImageMemory2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkBindImageMemory2KHR(device:%p, bindInfoCount:%d, pBindInfos:%p)", device,
+                      bindInfoCount, pBindInfos);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    uint32_t local_bindInfoCount;
+    VkBindImageMemoryInfo* local_pBindInfos;
+    local_device = device;
+    local_bindInfoCount = bindInfoCount;
+    local_pBindInfos = nullptr;
+    if (pBindInfos) {
+        local_pBindInfos = (VkBindImageMemoryInfo*)pool->alloc(((bindInfoCount)) *
+                                                               sizeof(const VkBindImageMemoryInfo));
+        for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) {
+            deepcopy_VkBindImageMemoryInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pBindInfos + i,
+                                           (VkBindImageMemoryInfo*)(local_pBindInfos + i));
+        }
+    }
+    if (local_pBindInfos) {
+        for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) {
+            transform_tohost_VkBindImageMemoryInfo(sResourceTracker,
+                                                   (VkBindImageMemoryInfo*)(local_pBindInfos + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) {
+            count_VkBindImageMemoryInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkBindImageMemoryInfo*)(local_pBindInfos + i), countPtr);
+        }
+    }
+    uint32_t packetSize_vkBindImageMemory2KHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkBindImageMemory2KHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkBindImageMemory2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkBindImageMemory2KHR = OP_vkBindImageMemory2KHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkBindImageMemory2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkBindImageMemory2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) {
+        reservedmarshal_VkBindImageMemoryInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkBindImageMemoryInfo*)(local_pBindInfos + i),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkBindImageMemory2KHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkBindImageMemory2KHR_VkResult_return = (VkResult)0;
+    stream->read(&vkBindImageMemory2KHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkBindImageMemory2KHR_VkResult_return;
+}
+
+#endif
+#ifdef VK_KHR_portability_subset
+#endif
+#ifdef VK_KHR_maintenance3
+void VkEncoder::vkGetDescriptorSetLayoutSupportKHR(
+    VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
+    VkDescriptorSetLayoutSupport* pSupport, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetDescriptorSetLayoutSupportKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetDescriptorSetLayoutSupportKHR(device:%p, pCreateInfo:%p, pSupport:%p)",
+                      device, pCreateInfo, pSupport);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDescriptorSetLayoutCreateInfo* local_pCreateInfo;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkDescriptorSetLayoutCreateInfo*)pool->alloc(
+            sizeof(const VkDescriptorSetLayoutCreateInfo));
+        deepcopy_VkDescriptorSetLayoutCreateInfo(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+            (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
+    }
+    if (local_pCreateInfo) {
+        transform_tohost_VkDescriptorSetLayoutCreateInfo(
+            sResourceTracker, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDescriptorSetLayoutCreateInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo),
+                                              countPtr);
+        count_VkDescriptorSetLayoutSupport(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                           (VkDescriptorSetLayoutSupport*)(pSupport), countPtr);
+    }
+    uint32_t packetSize_vkGetDescriptorSetLayoutSupportKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetDescriptorSetLayoutSupportKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetDescriptorSetLayoutSupportKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetDescriptorSetLayoutSupportKHR = OP_vkGetDescriptorSetLayoutSupportKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetDescriptorSetLayoutSupportKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetDescriptorSetLayoutSupportKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDescriptorSetLayoutCreateInfo(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo),
+        streamPtrPtr);
+    reservedmarshal_VkDescriptorSetLayoutSupport(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                 (VkDescriptorSetLayoutSupport*)(pSupport),
+                                                 streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetDescriptorSetLayoutSupportKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkDescriptorSetLayoutSupport(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                           (VkDescriptorSetLayoutSupport*)(pSupport));
+    if (pSupport) {
+        transform_fromhost_VkDescriptorSetLayoutSupport(sResourceTracker,
+                                                        (VkDescriptorSetLayoutSupport*)(pSupport));
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_KHR_draw_indirect_count
+void VkEncoder::vkCmdDrawIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                          VkDeviceSize offset, VkBuffer countBuffer,
+                                          VkDeviceSize countBufferOffset, uint32_t maxDrawCount,
+                                          uint32_t stride, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdDrawIndirectCountKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdDrawIndirectCountKHR(commandBuffer:%p, buffer:%p, offset:%ld, countBuffer:%p, "
+        "countBufferOffset:%ld, maxDrawCount:%d, stride:%d)",
+        commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkBuffer local_buffer;
+    VkDeviceSize local_offset;
+    VkBuffer local_countBuffer;
+    VkDeviceSize local_countBufferOffset;
+    uint32_t local_maxDrawCount;
+    uint32_t local_stride;
+    local_commandBuffer = commandBuffer;
+    local_buffer = buffer;
+    local_offset = offset;
+    local_countBuffer = countBuffer;
+    local_countBufferOffset = countBufferOffset;
+    local_maxDrawCount = maxDrawCount;
+    local_stride = stride;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        uint64_t cgen_var_2;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdDrawIndirectCountKHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdDrawIndirectCountKHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdDrawIndirectCountKHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdDrawIndirectCountKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdDrawIndirectCountKHR = OP_vkCmdDrawIndirectCountKHR;
+    memcpy(streamPtr, &opcode_vkCmdDrawIndirectCountKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdDrawIndirectCountKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&local_buffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkBuffer((*&local_countBuffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_stride, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdDrawIndirectCountKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdDrawIndexedIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                                 VkDeviceSize offset, VkBuffer countBuffer,
+                                                 VkDeviceSize countBufferOffset,
+                                                 uint32_t maxDrawCount, uint32_t stride,
+                                                 uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdDrawIndexedIndirectCountKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdDrawIndexedIndirectCountKHR(commandBuffer:%p, buffer:%p, offset:%ld, countBuffer:%p, "
+        "countBufferOffset:%ld, maxDrawCount:%d, stride:%d)",
+        commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkBuffer local_buffer;
+    VkDeviceSize local_offset;
+    VkBuffer local_countBuffer;
+    VkDeviceSize local_countBufferOffset;
+    uint32_t local_maxDrawCount;
+    uint32_t local_stride;
+    local_commandBuffer = commandBuffer;
+    local_buffer = buffer;
+    local_offset = offset;
+    local_countBuffer = countBuffer;
+    local_countBufferOffset = countBufferOffset;
+    local_maxDrawCount = maxDrawCount;
+    local_stride = stride;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        uint64_t cgen_var_2;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdDrawIndexedIndirectCountKHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdDrawIndexedIndirectCountKHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdDrawIndexedIndirectCountKHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdDrawIndexedIndirectCountKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdDrawIndexedIndirectCountKHR = OP_vkCmdDrawIndexedIndirectCountKHR;
+    memcpy(streamPtr, &opcode_vkCmdDrawIndexedIndirectCountKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdDrawIndexedIndirectCountKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&local_buffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkBuffer((*&local_countBuffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_stride, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdDrawIndexedIndirectCountKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_KHR_shader_subgroup_extended_types
+#endif
+#ifdef VK_KHR_8bit_storage
+#endif
+#ifdef VK_KHR_shader_atomic_int64
+#endif
+#ifdef VK_KHR_shader_clock
+#endif
+#ifdef VK_KHR_driver_properties
+#endif
+#ifdef VK_KHR_shader_float_controls
+#endif
+#ifdef VK_KHR_depth_stencil_resolve
+#endif
+#ifdef VK_KHR_swapchain_mutable_format
+#endif
+#ifdef VK_KHR_timeline_semaphore
+VkResult VkEncoder::vkGetSemaphoreCounterValueKHR(VkDevice device, VkSemaphore semaphore,
+                                                  uint64_t* pValue, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetSemaphoreCounterValueKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetSemaphoreCounterValueKHR(device:%p, semaphore:%p, pValue:%p)", device,
+                      semaphore, pValue);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSemaphore local_semaphore;
+    local_device = device;
+    local_semaphore = semaphore;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint64_t);
+    }
+    uint32_t packetSize_vkGetSemaphoreCounterValueKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetSemaphoreCounterValueKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetSemaphoreCounterValueKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetSemaphoreCounterValueKHR = OP_vkGetSemaphoreCounterValueKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetSemaphoreCounterValueKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetSemaphoreCounterValueKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkSemaphore((*&local_semaphore));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint64_t*)pValue, sizeof(uint64_t));
+    *streamPtrPtr += sizeof(uint64_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetSemaphoreCounterValueKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((uint64_t*)pValue, sizeof(uint64_t));
+    VkResult vkGetSemaphoreCounterValueKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetSemaphoreCounterValueKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetSemaphoreCounterValueKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkWaitSemaphoresKHR(VkDevice device, const VkSemaphoreWaitInfo* pWaitInfo,
+                                        uint64_t timeout, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkWaitSemaphoresKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkWaitSemaphoresKHR(device:%p, pWaitInfo:%p, timeout:%ld)", device,
+                      pWaitInfo, timeout);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSemaphoreWaitInfo* local_pWaitInfo;
+    uint64_t local_timeout;
+    local_device = device;
+    local_pWaitInfo = nullptr;
+    if (pWaitInfo) {
+        local_pWaitInfo = (VkSemaphoreWaitInfo*)pool->alloc(sizeof(const VkSemaphoreWaitInfo));
+        deepcopy_VkSemaphoreWaitInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pWaitInfo,
+                                     (VkSemaphoreWaitInfo*)(local_pWaitInfo));
+    }
+    local_timeout = timeout;
+    if (local_pWaitInfo) {
+        transform_tohost_VkSemaphoreWaitInfo(sResourceTracker,
+                                             (VkSemaphoreWaitInfo*)(local_pWaitInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkSemaphoreWaitInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                  (VkSemaphoreWaitInfo*)(local_pWaitInfo), countPtr);
+        *countPtr += sizeof(uint64_t);
+    }
+    uint32_t packetSize_vkWaitSemaphoresKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkWaitSemaphoresKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkWaitSemaphoresKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkWaitSemaphoresKHR = OP_vkWaitSemaphoresKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkWaitSemaphoresKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkWaitSemaphoresKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkSemaphoreWaitInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkSemaphoreWaitInfo*)(local_pWaitInfo), streamPtrPtr);
+    memcpy(*streamPtrPtr, (uint64_t*)&local_timeout, sizeof(uint64_t));
+    *streamPtrPtr += sizeof(uint64_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkWaitSemaphoresKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkWaitSemaphoresKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkWaitSemaphoresKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkWaitSemaphoresKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkSignalSemaphoreKHR(VkDevice device, const VkSemaphoreSignalInfo* pSignalInfo,
+                                         uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkSignalSemaphoreKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkSignalSemaphoreKHR(device:%p, pSignalInfo:%p)", device, pSignalInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSemaphoreSignalInfo* local_pSignalInfo;
+    local_device = device;
+    local_pSignalInfo = nullptr;
+    if (pSignalInfo) {
+        local_pSignalInfo =
+            (VkSemaphoreSignalInfo*)pool->alloc(sizeof(const VkSemaphoreSignalInfo));
+        deepcopy_VkSemaphoreSignalInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pSignalInfo,
+                                       (VkSemaphoreSignalInfo*)(local_pSignalInfo));
+    }
+    if (local_pSignalInfo) {
+        transform_tohost_VkSemaphoreSignalInfo(sResourceTracker,
+                                               (VkSemaphoreSignalInfo*)(local_pSignalInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkSemaphoreSignalInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkSemaphoreSignalInfo*)(local_pSignalInfo), countPtr);
+    }
+    uint32_t packetSize_vkSignalSemaphoreKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkSignalSemaphoreKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkSignalSemaphoreKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkSignalSemaphoreKHR = OP_vkSignalSemaphoreKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkSignalSemaphoreKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkSignalSemaphoreKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkSemaphoreSignalInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkSemaphoreSignalInfo*)(local_pSignalInfo),
+                                          streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkSignalSemaphoreKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkSignalSemaphoreKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkSignalSemaphoreKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkSignalSemaphoreKHR_VkResult_return;
+}
+
+#endif
+#ifdef VK_KHR_vulkan_memory_model
+#endif
+#ifdef VK_KHR_shader_terminate_invocation
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+VkResult VkEncoder::vkGetPhysicalDeviceFragmentShadingRatesKHR(
+    VkPhysicalDevice physicalDevice, uint32_t* pFragmentShadingRateCount,
+    VkPhysicalDeviceFragmentShadingRateKHR* pFragmentShadingRates, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceFragmentShadingRatesKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceFragmentShadingRatesKHR(physicalDevice:%p, "
+        "pFragmentShadingRateCount:%p, pFragmentShadingRates:%p)",
+        physicalDevice, pFragmentShadingRateCount, pFragmentShadingRates);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    local_physicalDevice = physicalDevice;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pFragmentShadingRateCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pFragmentShadingRates) {
+            if (pFragmentShadingRateCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pFragmentShadingRateCount)); ++i) {
+                    count_VkPhysicalDeviceFragmentShadingRateKHR(
+                        sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                        (VkPhysicalDeviceFragmentShadingRateKHR*)(pFragmentShadingRates + i),
+                        countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceFragmentShadingRatesKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceFragmentShadingRatesKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceFragmentShadingRatesKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceFragmentShadingRatesKHR =
+        OP_vkGetPhysicalDeviceFragmentShadingRatesKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceFragmentShadingRatesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceFragmentShadingRatesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pFragmentShadingRateCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pFragmentShadingRateCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pFragmentShadingRateCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pFragmentShadingRates;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pFragmentShadingRates) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pFragmentShadingRateCount)); ++i) {
+            reservedmarshal_VkPhysicalDeviceFragmentShadingRateKHR(
+                stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkPhysicalDeviceFragmentShadingRateKHR*)(pFragmentShadingRates + i), streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceFragmentShadingRatesKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pFragmentShadingRateCount;
+    check_pFragmentShadingRateCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pFragmentShadingRateCount) {
+        if (!(check_pFragmentShadingRateCount)) {
+            fprintf(stderr,
+                    "fatal: pFragmentShadingRateCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pFragmentShadingRateCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkPhysicalDeviceFragmentShadingRateKHR* check_pFragmentShadingRates;
+    check_pFragmentShadingRates =
+        (VkPhysicalDeviceFragmentShadingRateKHR*)(uintptr_t)stream->getBe64();
+    if (pFragmentShadingRates) {
+        if (!(check_pFragmentShadingRates)) {
+            fprintf(stderr, "fatal: pFragmentShadingRates inconsistent between guest and host\n");
+        }
+        if (pFragmentShadingRateCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pFragmentShadingRateCount)); ++i) {
+                unmarshal_VkPhysicalDeviceFragmentShadingRateKHR(
+                    stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                    (VkPhysicalDeviceFragmentShadingRateKHR*)(pFragmentShadingRates + i));
+            }
+        }
+    }
+    if (pFragmentShadingRateCount) {
+        if (pFragmentShadingRates) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pFragmentShadingRateCount)); ++i) {
+                transform_fromhost_VkPhysicalDeviceFragmentShadingRateKHR(
+                    sResourceTracker,
+                    (VkPhysicalDeviceFragmentShadingRateKHR*)(pFragmentShadingRates + i));
+            }
+        }
+    }
+    VkResult vkGetPhysicalDeviceFragmentShadingRatesKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetPhysicalDeviceFragmentShadingRatesKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDeviceFragmentShadingRatesKHR_VkResult_return;
+}
+
+void VkEncoder::vkCmdSetFragmentShadingRateKHR(
+    VkCommandBuffer commandBuffer, const VkExtent2D* pFragmentSize,
+    const VkFragmentShadingRateCombinerOpKHR combinerOps[2], uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetFragmentShadingRateKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdSetFragmentShadingRateKHR(commandBuffer:%p, pFragmentSize:%p)",
+                      commandBuffer, pFragmentSize);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkExtent2D* local_pFragmentSize;
+    VkFragmentShadingRateCombinerOpKHR local_combinerOps[2];
+    local_commandBuffer = commandBuffer;
+    local_pFragmentSize = nullptr;
+    if (pFragmentSize) {
+        local_pFragmentSize = (VkExtent2D*)pool->alloc(sizeof(const VkExtent2D));
+        deepcopy_VkExtent2D(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pFragmentSize,
+                            (VkExtent2D*)(local_pFragmentSize));
+    }
+    memcpy(local_combinerOps, combinerOps, 2 * sizeof(const VkFragmentShadingRateCombinerOpKHR));
+    if (local_pFragmentSize) {
+        transform_tohost_VkExtent2D(sResourceTracker, (VkExtent2D*)(local_pFragmentSize));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkExtent2D(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                         (VkExtent2D*)(local_pFragmentSize), countPtr);
+        *countPtr += 2 * sizeof(VkFragmentShadingRateCombinerOpKHR);
+    }
+    uint32_t packetSize_vkCmdSetFragmentShadingRateKHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdSetFragmentShadingRateKHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetFragmentShadingRateKHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetFragmentShadingRateKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetFragmentShadingRateKHR = OP_vkCmdSetFragmentShadingRateKHR;
+    memcpy(streamPtr, &opcode_vkCmdSetFragmentShadingRateKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetFragmentShadingRateKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkExtent2D(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                               (VkExtent2D*)(local_pFragmentSize), streamPtrPtr);
+    memcpy(*streamPtrPtr, (VkFragmentShadingRateCombinerOpKHR*)local_combinerOps,
+           2 * sizeof(VkFragmentShadingRateCombinerOpKHR));
+    *streamPtrPtr += 2 * sizeof(VkFragmentShadingRateCombinerOpKHR);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetFragmentShadingRateKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_KHR_spirv_1_4
+#endif
+#ifdef VK_KHR_surface_protected_capabilities
+#endif
+#ifdef VK_KHR_separate_depth_stencil_layouts
+#endif
+#ifdef VK_KHR_present_wait
+VkResult VkEncoder::vkWaitForPresentKHR(VkDevice device, VkSwapchainKHR swapchain,
+                                        uint64_t presentId, uint64_t timeout, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkWaitForPresentKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkWaitForPresentKHR(device:%p, swapchain:%p, presentId:%ld, timeout:%ld)",
+                      device, swapchain, presentId, timeout);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSwapchainKHR local_swapchain;
+    uint64_t local_presentId;
+    uint64_t local_timeout;
+    local_device = device;
+    local_swapchain = swapchain;
+    local_presentId = presentId;
+    local_timeout = timeout;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint64_t);
+        *countPtr += sizeof(uint64_t);
+    }
+    uint32_t packetSize_vkWaitForPresentKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkWaitForPresentKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkWaitForPresentKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkWaitForPresentKHR = OP_vkWaitForPresentKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkWaitForPresentKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkWaitForPresentKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkSwapchainKHR((*&local_swapchain));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint64_t*)&local_presentId, sizeof(uint64_t));
+    *streamPtrPtr += sizeof(uint64_t);
+    memcpy(*streamPtrPtr, (uint64_t*)&local_timeout, sizeof(uint64_t));
+    *streamPtrPtr += sizeof(uint64_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkWaitForPresentKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkWaitForPresentKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkWaitForPresentKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkWaitForPresentKHR_VkResult_return;
+}
+
+#endif
+#ifdef VK_KHR_uniform_buffer_standard_layout
+#endif
+#ifdef VK_KHR_buffer_device_address
+VkDeviceAddress VkEncoder::vkGetBufferDeviceAddressKHR(VkDevice device,
+                                                       const VkBufferDeviceAddressInfo* pInfo,
+                                                       uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetBufferDeviceAddressKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetBufferDeviceAddressKHR(device:%p, pInfo:%p)", device, pInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkBufferDeviceAddressInfo* local_pInfo;
+    local_device = device;
+    local_pInfo = nullptr;
+    if (pInfo) {
+        local_pInfo =
+            (VkBufferDeviceAddressInfo*)pool->alloc(sizeof(const VkBufferDeviceAddressInfo));
+        deepcopy_VkBufferDeviceAddressInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfo,
+                                           (VkBufferDeviceAddressInfo*)(local_pInfo));
+    }
+    if (local_pInfo) {
+        transform_tohost_VkBufferDeviceAddressInfo(sResourceTracker,
+                                                   (VkBufferDeviceAddressInfo*)(local_pInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkBufferDeviceAddressInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkBufferDeviceAddressInfo*)(local_pInfo), countPtr);
+    }
+    uint32_t packetSize_vkGetBufferDeviceAddressKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetBufferDeviceAddressKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetBufferDeviceAddressKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetBufferDeviceAddressKHR = OP_vkGetBufferDeviceAddressKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetBufferDeviceAddressKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetBufferDeviceAddressKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkBufferDeviceAddressInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkBufferDeviceAddressInfo*)(local_pInfo),
+                                              streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetBufferDeviceAddressKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkDeviceAddress vkGetBufferDeviceAddressKHR_VkDeviceAddress_return = (VkDeviceAddress)0;
+    stream->read(&vkGetBufferDeviceAddressKHR_VkDeviceAddress_return, sizeof(VkDeviceAddress));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetBufferDeviceAddressKHR_VkDeviceAddress_return;
+}
+
+uint64_t VkEncoder::vkGetBufferOpaqueCaptureAddressKHR(VkDevice device,
+                                                       const VkBufferDeviceAddressInfo* pInfo,
+                                                       uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetBufferOpaqueCaptureAddressKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetBufferOpaqueCaptureAddressKHR(device:%p, pInfo:%p)", device, pInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkBufferDeviceAddressInfo* local_pInfo;
+    local_device = device;
+    local_pInfo = nullptr;
+    if (pInfo) {
+        local_pInfo =
+            (VkBufferDeviceAddressInfo*)pool->alloc(sizeof(const VkBufferDeviceAddressInfo));
+        deepcopy_VkBufferDeviceAddressInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfo,
+                                           (VkBufferDeviceAddressInfo*)(local_pInfo));
+    }
+    if (local_pInfo) {
+        transform_tohost_VkBufferDeviceAddressInfo(sResourceTracker,
+                                                   (VkBufferDeviceAddressInfo*)(local_pInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkBufferDeviceAddressInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkBufferDeviceAddressInfo*)(local_pInfo), countPtr);
+    }
+    uint32_t packetSize_vkGetBufferOpaqueCaptureAddressKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetBufferOpaqueCaptureAddressKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetBufferOpaqueCaptureAddressKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetBufferOpaqueCaptureAddressKHR = OP_vkGetBufferOpaqueCaptureAddressKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetBufferOpaqueCaptureAddressKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetBufferOpaqueCaptureAddressKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkBufferDeviceAddressInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkBufferDeviceAddressInfo*)(local_pInfo),
+                                              streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetBufferOpaqueCaptureAddressKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    uint64_t vkGetBufferOpaqueCaptureAddressKHR_uint64_t_return = (uint64_t)0;
+    stream->read(&vkGetBufferOpaqueCaptureAddressKHR_uint64_t_return, sizeof(uint64_t));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetBufferOpaqueCaptureAddressKHR_uint64_t_return;
+}
+
+uint64_t VkEncoder::vkGetDeviceMemoryOpaqueCaptureAddressKHR(
+    VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetDeviceMemoryOpaqueCaptureAddressKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetDeviceMemoryOpaqueCaptureAddressKHR(device:%p, pInfo:%p)", device,
+                      pInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDeviceMemoryOpaqueCaptureAddressInfo* local_pInfo;
+    local_device = device;
+    local_pInfo = nullptr;
+    if (pInfo) {
+        local_pInfo = (VkDeviceMemoryOpaqueCaptureAddressInfo*)pool->alloc(
+            sizeof(const VkDeviceMemoryOpaqueCaptureAddressInfo));
+        deepcopy_VkDeviceMemoryOpaqueCaptureAddressInfo(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfo,
+            (VkDeviceMemoryOpaqueCaptureAddressInfo*)(local_pInfo));
+    }
+    if (local_pInfo) {
+        transform_tohost_VkDeviceMemoryOpaqueCaptureAddressInfo(
+            sResourceTracker, (VkDeviceMemoryOpaqueCaptureAddressInfo*)(local_pInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDeviceMemoryOpaqueCaptureAddressInfo(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkDeviceMemoryOpaqueCaptureAddressInfo*)(local_pInfo), countPtr);
+    }
+    uint32_t packetSize_vkGetDeviceMemoryOpaqueCaptureAddressKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetDeviceMemoryOpaqueCaptureAddressKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetDeviceMemoryOpaqueCaptureAddressKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetDeviceMemoryOpaqueCaptureAddressKHR =
+        OP_vkGetDeviceMemoryOpaqueCaptureAddressKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetDeviceMemoryOpaqueCaptureAddressKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetDeviceMemoryOpaqueCaptureAddressKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDeviceMemoryOpaqueCaptureAddressInfo(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkDeviceMemoryOpaqueCaptureAddressInfo*)(local_pInfo),
+        streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetDeviceMemoryOpaqueCaptureAddressKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    uint64_t vkGetDeviceMemoryOpaqueCaptureAddressKHR_uint64_t_return = (uint64_t)0;
+    stream->read(&vkGetDeviceMemoryOpaqueCaptureAddressKHR_uint64_t_return, sizeof(uint64_t));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetDeviceMemoryOpaqueCaptureAddressKHR_uint64_t_return;
+}
+
+#endif
+#ifdef VK_KHR_deferred_host_operations
+VkResult VkEncoder::vkCreateDeferredOperationKHR(VkDevice device,
+                                                 const VkAllocationCallbacks* pAllocator,
+                                                 VkDeferredOperationKHR* pDeferredOperation,
+                                                 uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateDeferredOperationKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateDeferredOperationKHR(device:%p, pAllocator:%p, pDeferredOperation:%p)", device,
+        pAllocator, pDeferredOperation);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateDeferredOperationKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCreateDeferredOperationKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateDeferredOperationKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateDeferredOperationKHR = OP_vkCreateDeferredOperationKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateDeferredOperationKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateDeferredOperationKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    uint64_t cgen_var_2 = (uint64_t)(*pDeferredOperation);
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateDeferredOperationKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    (*pDeferredOperation) = (VkDeferredOperationKHR)stream->getBe64();
+    VkResult vkCreateDeferredOperationKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateDeferredOperationKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateDeferredOperationKHR_VkResult_return;
+}
+
+void VkEncoder::vkDestroyDeferredOperationKHR(VkDevice device, VkDeferredOperationKHR operation,
+                                              const VkAllocationCallbacks* pAllocator,
+                                              uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyDeferredOperationKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroyDeferredOperationKHR(device:%p, pAllocator:%p)", device,
+                      pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDeferredOperationKHR local_operation;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_operation = operation;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyDeferredOperationKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkDestroyDeferredOperationKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyDeferredOperationKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyDeferredOperationKHR = OP_vkDestroyDeferredOperationKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyDeferredOperationKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyDeferredOperationKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1 = (uint64_t)local_operation;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroyDeferredOperationKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+uint32_t VkEncoder::vkGetDeferredOperationMaxConcurrencyKHR(VkDevice device,
+                                                            VkDeferredOperationKHR operation,
+                                                            uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetDeferredOperationMaxConcurrencyKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetDeferredOperationMaxConcurrencyKHR(device:%p)", device);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDeferredOperationKHR local_operation;
+    local_device = device;
+    local_operation = operation;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkGetDeferredOperationMaxConcurrencyKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetDeferredOperationMaxConcurrencyKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetDeferredOperationMaxConcurrencyKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetDeferredOperationMaxConcurrencyKHR =
+        OP_vkGetDeferredOperationMaxConcurrencyKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetDeferredOperationMaxConcurrencyKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetDeferredOperationMaxConcurrencyKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1 = (uint64_t)local_operation;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetDeferredOperationMaxConcurrencyKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    uint32_t vkGetDeferredOperationMaxConcurrencyKHR_uint32_t_return = (uint32_t)0;
+    stream->read(&vkGetDeferredOperationMaxConcurrencyKHR_uint32_t_return, sizeof(uint32_t));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetDeferredOperationMaxConcurrencyKHR_uint32_t_return;
+}
+
+VkResult VkEncoder::vkGetDeferredOperationResultKHR(VkDevice device,
+                                                    VkDeferredOperationKHR operation,
+                                                    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetDeferredOperationResultKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetDeferredOperationResultKHR(device:%p)", device);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDeferredOperationKHR local_operation;
+    local_device = device;
+    local_operation = operation;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkGetDeferredOperationResultKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetDeferredOperationResultKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetDeferredOperationResultKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetDeferredOperationResultKHR = OP_vkGetDeferredOperationResultKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetDeferredOperationResultKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetDeferredOperationResultKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1 = (uint64_t)local_operation;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetDeferredOperationResultKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkGetDeferredOperationResultKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetDeferredOperationResultKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetDeferredOperationResultKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkDeferredOperationJoinKHR(VkDevice device, VkDeferredOperationKHR operation,
+                                               uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDeferredOperationJoinKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDeferredOperationJoinKHR(device:%p)", device);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDeferredOperationKHR local_operation;
+    local_device = device;
+    local_operation = operation;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkDeferredOperationJoinKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDeferredOperationJoinKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDeferredOperationJoinKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDeferredOperationJoinKHR = OP_vkDeferredOperationJoinKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDeferredOperationJoinKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDeferredOperationJoinKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1 = (uint64_t)local_operation;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDeferredOperationJoinKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkDeferredOperationJoinKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkDeferredOperationJoinKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkDeferredOperationJoinKHR_VkResult_return;
+}
+
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+VkResult VkEncoder::vkGetPipelineExecutablePropertiesKHR(
+    VkDevice device, const VkPipelineInfoKHR* pPipelineInfo, uint32_t* pExecutableCount,
+    VkPipelineExecutablePropertiesKHR* pProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPipelineExecutablePropertiesKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPipelineExecutablePropertiesKHR(device:%p, pPipelineInfo:%p, pExecutableCount:%p, "
+        "pProperties:%p)",
+        device, pPipelineInfo, pExecutableCount, pProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkPipelineInfoKHR* local_pPipelineInfo;
+    local_device = device;
+    local_pPipelineInfo = nullptr;
+    if (pPipelineInfo) {
+        local_pPipelineInfo = (VkPipelineInfoKHR*)pool->alloc(sizeof(const VkPipelineInfoKHR));
+        deepcopy_VkPipelineInfoKHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pPipelineInfo,
+                                   (VkPipelineInfoKHR*)(local_pPipelineInfo));
+    }
+    if (local_pPipelineInfo) {
+        transform_tohost_VkPipelineInfoKHR(sResourceTracker,
+                                           (VkPipelineInfoKHR*)(local_pPipelineInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPipelineInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                (VkPipelineInfoKHR*)(local_pPipelineInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pExecutableCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pProperties) {
+            if (pExecutableCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pExecutableCount)); ++i) {
+                    count_VkPipelineExecutablePropertiesKHR(
+                        sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                        (VkPipelineExecutablePropertiesKHR*)(pProperties + i), countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetPipelineExecutablePropertiesKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPipelineExecutablePropertiesKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPipelineExecutablePropertiesKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPipelineExecutablePropertiesKHR = OP_vkGetPipelineExecutablePropertiesKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPipelineExecutablePropertiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPipelineExecutablePropertiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPipelineInfoKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                      (VkPipelineInfoKHR*)(local_pPipelineInfo), streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pExecutableCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pExecutableCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pExecutableCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pProperties;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pProperties) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pExecutableCount)); ++i) {
+            reservedmarshal_VkPipelineExecutablePropertiesKHR(
+                stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkPipelineExecutablePropertiesKHR*)(pProperties + i), streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetPipelineExecutablePropertiesKHR),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pExecutableCount;
+    check_pExecutableCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pExecutableCount) {
+        if (!(check_pExecutableCount)) {
+            fprintf(stderr, "fatal: pExecutableCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pExecutableCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkPipelineExecutablePropertiesKHR* check_pProperties;
+    check_pProperties = (VkPipelineExecutablePropertiesKHR*)(uintptr_t)stream->getBe64();
+    if (pProperties) {
+        if (!(check_pProperties)) {
+            fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
+        }
+        if (pExecutableCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pExecutableCount)); ++i) {
+                unmarshal_VkPipelineExecutablePropertiesKHR(
+                    stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                    (VkPipelineExecutablePropertiesKHR*)(pProperties + i));
+            }
+        }
+    }
+    if (pExecutableCount) {
+        if (pProperties) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pExecutableCount)); ++i) {
+                transform_fromhost_VkPipelineExecutablePropertiesKHR(
+                    sResourceTracker, (VkPipelineExecutablePropertiesKHR*)(pProperties + i));
+            }
+        }
+    }
+    VkResult vkGetPipelineExecutablePropertiesKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetPipelineExecutablePropertiesKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPipelineExecutablePropertiesKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetPipelineExecutableStatisticsKHR(
+    VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo, uint32_t* pStatisticCount,
+    VkPipelineExecutableStatisticKHR* pStatistics, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPipelineExecutableStatisticsKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPipelineExecutableStatisticsKHR(device:%p, pExecutableInfo:%p, pStatisticCount:%p, "
+        "pStatistics:%p)",
+        device, pExecutableInfo, pStatisticCount, pStatistics);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkPipelineExecutableInfoKHR* local_pExecutableInfo;
+    local_device = device;
+    local_pExecutableInfo = nullptr;
+    if (pExecutableInfo) {
+        local_pExecutableInfo =
+            (VkPipelineExecutableInfoKHR*)pool->alloc(sizeof(const VkPipelineExecutableInfoKHR));
+        deepcopy_VkPipelineExecutableInfoKHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pExecutableInfo,
+                                             (VkPipelineExecutableInfoKHR*)(local_pExecutableInfo));
+    }
+    if (local_pExecutableInfo) {
+        transform_tohost_VkPipelineExecutableInfoKHR(
+            sResourceTracker, (VkPipelineExecutableInfoKHR*)(local_pExecutableInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPipelineExecutableInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkPipelineExecutableInfoKHR*)(local_pExecutableInfo),
+                                          countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pStatisticCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pStatistics) {
+            if (pStatisticCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pStatisticCount)); ++i) {
+                    count_VkPipelineExecutableStatisticKHR(
+                        sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                        (VkPipelineExecutableStatisticKHR*)(pStatistics + i), countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetPipelineExecutableStatisticsKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPipelineExecutableStatisticsKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPipelineExecutableStatisticsKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPipelineExecutableStatisticsKHR = OP_vkGetPipelineExecutableStatisticsKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPipelineExecutableStatisticsKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPipelineExecutableStatisticsKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPipelineExecutableInfoKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkPipelineExecutableInfoKHR*)(local_pExecutableInfo),
+        streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pStatisticCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pStatisticCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pStatisticCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pStatistics;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pStatistics) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pStatisticCount)); ++i) {
+            reservedmarshal_VkPipelineExecutableStatisticKHR(
+                stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkPipelineExecutableStatisticKHR*)(pStatistics + i), streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetPipelineExecutableStatisticsKHR),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pStatisticCount;
+    check_pStatisticCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pStatisticCount) {
+        if (!(check_pStatisticCount)) {
+            fprintf(stderr, "fatal: pStatisticCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pStatisticCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkPipelineExecutableStatisticKHR* check_pStatistics;
+    check_pStatistics = (VkPipelineExecutableStatisticKHR*)(uintptr_t)stream->getBe64();
+    if (pStatistics) {
+        if (!(check_pStatistics)) {
+            fprintf(stderr, "fatal: pStatistics inconsistent between guest and host\n");
+        }
+        if (pStatisticCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pStatisticCount)); ++i) {
+                unmarshal_VkPipelineExecutableStatisticKHR(
+                    stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                    (VkPipelineExecutableStatisticKHR*)(pStatistics + i));
+            }
+        }
+    }
+    if (pStatisticCount) {
+        if (pStatistics) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pStatisticCount)); ++i) {
+                transform_fromhost_VkPipelineExecutableStatisticKHR(
+                    sResourceTracker, (VkPipelineExecutableStatisticKHR*)(pStatistics + i));
+            }
+        }
+    }
+    VkResult vkGetPipelineExecutableStatisticsKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetPipelineExecutableStatisticsKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPipelineExecutableStatisticsKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetPipelineExecutableInternalRepresentationsKHR(
+    VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo,
+    uint32_t* pInternalRepresentationCount,
+    VkPipelineExecutableInternalRepresentationKHR* pInternalRepresentations, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkGetPipelineExecutableInternalRepresentationsKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPipelineExecutableInternalRepresentationsKHR(device:%p, pExecutableInfo:%p, "
+        "pInternalRepresentationCount:%p, pInternalRepresentations:%p)",
+        device, pExecutableInfo, pInternalRepresentationCount, pInternalRepresentations);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkPipelineExecutableInfoKHR* local_pExecutableInfo;
+    local_device = device;
+    local_pExecutableInfo = nullptr;
+    if (pExecutableInfo) {
+        local_pExecutableInfo =
+            (VkPipelineExecutableInfoKHR*)pool->alloc(sizeof(const VkPipelineExecutableInfoKHR));
+        deepcopy_VkPipelineExecutableInfoKHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pExecutableInfo,
+                                             (VkPipelineExecutableInfoKHR*)(local_pExecutableInfo));
+    }
+    if (local_pExecutableInfo) {
+        transform_tohost_VkPipelineExecutableInfoKHR(
+            sResourceTracker, (VkPipelineExecutableInfoKHR*)(local_pExecutableInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPipelineExecutableInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkPipelineExecutableInfoKHR*)(local_pExecutableInfo),
+                                          countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pInternalRepresentationCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pInternalRepresentations) {
+            if (pInternalRepresentationCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pInternalRepresentationCount)); ++i) {
+                    count_VkPipelineExecutableInternalRepresentationKHR(
+                        sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                        (VkPipelineExecutableInternalRepresentationKHR*)(pInternalRepresentations +
+                                                                         i),
+                        countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetPipelineExecutableInternalRepresentationsKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPipelineExecutableInternalRepresentationsKHR);
+    uint8_t* streamPtr =
+        stream->reserve(packetSize_vkGetPipelineExecutableInternalRepresentationsKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPipelineExecutableInternalRepresentationsKHR =
+        OP_vkGetPipelineExecutableInternalRepresentationsKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPipelineExecutableInternalRepresentationsKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPipelineExecutableInternalRepresentationsKHR,
+           sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPipelineExecutableInfoKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkPipelineExecutableInfoKHR*)(local_pExecutableInfo),
+        streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pInternalRepresentationCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pInternalRepresentationCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pInternalRepresentationCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pInternalRepresentations;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pInternalRepresentations) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pInternalRepresentationCount)); ++i) {
+            reservedmarshal_VkPipelineExecutableInternalRepresentationKHR(
+                stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkPipelineExecutableInternalRepresentationKHR*)(pInternalRepresentations + i),
+                streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPipelineExecutableInternalRepresentationsKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pInternalRepresentationCount;
+    check_pInternalRepresentationCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pInternalRepresentationCount) {
+        if (!(check_pInternalRepresentationCount)) {
+            fprintf(stderr,
+                    "fatal: pInternalRepresentationCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pInternalRepresentationCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkPipelineExecutableInternalRepresentationKHR* check_pInternalRepresentations;
+    check_pInternalRepresentations =
+        (VkPipelineExecutableInternalRepresentationKHR*)(uintptr_t)stream->getBe64();
+    if (pInternalRepresentations) {
+        if (!(check_pInternalRepresentations)) {
+            fprintf(stderr,
+                    "fatal: pInternalRepresentations inconsistent between guest and host\n");
+        }
+        if (pInternalRepresentationCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pInternalRepresentationCount)); ++i) {
+                unmarshal_VkPipelineExecutableInternalRepresentationKHR(
+                    stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                    (VkPipelineExecutableInternalRepresentationKHR*)(pInternalRepresentations + i));
+            }
+        }
+    }
+    if (pInternalRepresentationCount) {
+        if (pInternalRepresentations) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pInternalRepresentationCount)); ++i) {
+                transform_fromhost_VkPipelineExecutableInternalRepresentationKHR(
+                    sResourceTracker,
+                    (VkPipelineExecutableInternalRepresentationKHR*)(pInternalRepresentations + i));
+            }
+        }
+    }
+    VkResult vkGetPipelineExecutableInternalRepresentationsKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetPipelineExecutableInternalRepresentationsKHR_VkResult_return,
+                 sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPipelineExecutableInternalRepresentationsKHR_VkResult_return;
+}
+
+#endif
+#ifdef VK_KHR_shader_integer_dot_product
+#endif
+#ifdef VK_KHR_pipeline_library
+#endif
+#ifdef VK_KHR_shader_non_semantic_info
+#endif
+#ifdef VK_KHR_present_id
+#endif
+#ifdef VK_KHR_video_encode_queue
+void VkEncoder::vkCmdEncodeVideoKHR(VkCommandBuffer commandBuffer,
+                                    const VkVideoEncodeInfoKHR* pEncodeInfo, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdEncodeVideoKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdEncodeVideoKHR(commandBuffer:%p, pEncodeInfo:%p)", commandBuffer,
+                      pEncodeInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkVideoEncodeInfoKHR* local_pEncodeInfo;
+    local_commandBuffer = commandBuffer;
+    local_pEncodeInfo = nullptr;
+    if (pEncodeInfo) {
+        local_pEncodeInfo = (VkVideoEncodeInfoKHR*)pool->alloc(sizeof(const VkVideoEncodeInfoKHR));
+        deepcopy_VkVideoEncodeInfoKHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pEncodeInfo,
+                                      (VkVideoEncodeInfoKHR*)(local_pEncodeInfo));
+    }
+    if (local_pEncodeInfo) {
+        transform_tohost_VkVideoEncodeInfoKHR(sResourceTracker,
+                                              (VkVideoEncodeInfoKHR*)(local_pEncodeInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkVideoEncodeInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                   (VkVideoEncodeInfoKHR*)(local_pEncodeInfo), countPtr);
+    }
+    uint32_t packetSize_vkCmdEncodeVideoKHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdEncodeVideoKHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdEncodeVideoKHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdEncodeVideoKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdEncodeVideoKHR = OP_vkCmdEncodeVideoKHR;
+    memcpy(streamPtr, &opcode_vkCmdEncodeVideoKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdEncodeVideoKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkVideoEncodeInfoKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkVideoEncodeInfoKHR*)(local_pEncodeInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdEncodeVideoKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_KHR_synchronization2
+void VkEncoder::vkCmdSetEvent2KHR(VkCommandBuffer commandBuffer, VkEvent event,
+                                  const VkDependencyInfoKHR* pDependencyInfo, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetEvent2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdSetEvent2KHR(commandBuffer:%p, event:%p, pDependencyInfo:%p)",
+                      commandBuffer, event, pDependencyInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkEvent local_event;
+    VkDependencyInfoKHR* local_pDependencyInfo;
+    local_commandBuffer = commandBuffer;
+    local_event = event;
+    local_pDependencyInfo = nullptr;
+    if (pDependencyInfo) {
+        local_pDependencyInfo =
+            (VkDependencyInfoKHR*)pool->alloc(sizeof(const VkDependencyInfoKHR));
+        deepcopy_VkDependencyInfoKHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pDependencyInfo,
+                                     (VkDependencyInfoKHR*)(local_pDependencyInfo));
+    }
+    if (local_pDependencyInfo) {
+        transform_tohost_VkDependencyInfoKHR(sResourceTracker,
+                                             (VkDependencyInfoKHR*)(local_pDependencyInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        count_VkDependencyInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                  (VkDependencyInfoKHR*)(local_pDependencyInfo), countPtr);
+    }
+    uint32_t packetSize_vkCmdSetEvent2KHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetEvent2KHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetEvent2KHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetEvent2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetEvent2KHR = OP_vkCmdSetEvent2KHR;
+    memcpy(streamPtr, &opcode_vkCmdSetEvent2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetEvent2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkEvent((*&local_event));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDependencyInfoKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkDependencyInfoKHR*)(local_pDependencyInfo),
+                                        streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdSetEvent2KHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdResetEvent2KHR(VkCommandBuffer commandBuffer, VkEvent event,
+                                    VkPipelineStageFlags2KHR stageMask, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdResetEvent2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdResetEvent2KHR(commandBuffer:%p, event:%p)", commandBuffer, event);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkEvent local_event;
+    VkPipelineStageFlags2KHR local_stageMask;
+    local_commandBuffer = commandBuffer;
+    local_event = event;
+    local_stageMask = stageMask;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkPipelineStageFlags2KHR);
+    }
+    uint32_t packetSize_vkCmdResetEvent2KHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdResetEvent2KHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdResetEvent2KHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdResetEvent2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdResetEvent2KHR = OP_vkCmdResetEvent2KHR;
+    memcpy(streamPtr, &opcode_vkCmdResetEvent2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdResetEvent2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkEvent((*&local_event));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkPipelineStageFlags2KHR*)&local_stageMask,
+           sizeof(VkPipelineStageFlags2KHR));
+    *streamPtrPtr += sizeof(VkPipelineStageFlags2KHR);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdResetEvent2KHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdWaitEvents2KHR(VkCommandBuffer commandBuffer, uint32_t eventCount,
+                                    const VkEvent* pEvents,
+                                    const VkDependencyInfoKHR* pDependencyInfos, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdWaitEvents2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdWaitEvents2KHR(commandBuffer:%p, eventCount:%d, pEvents:%p, pDependencyInfos:%p)",
+        commandBuffer, eventCount, pEvents, pDependencyInfos);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_eventCount;
+    VkEvent* local_pEvents;
+    VkDependencyInfoKHR* local_pDependencyInfos;
+    local_commandBuffer = commandBuffer;
+    local_eventCount = eventCount;
+    // Avoiding deepcopy for pEvents
+    local_pEvents = (VkEvent*)pEvents;
+    local_pDependencyInfos = nullptr;
+    if (pDependencyInfos) {
+        local_pDependencyInfos =
+            (VkDependencyInfoKHR*)pool->alloc(((eventCount)) * sizeof(const VkDependencyInfoKHR));
+        for (uint32_t i = 0; i < (uint32_t)((eventCount)); ++i) {
+            deepcopy_VkDependencyInfoKHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pDependencyInfos + i,
+                                         (VkDependencyInfoKHR*)(local_pDependencyInfos + i));
+        }
+    }
+    if (local_pDependencyInfos) {
+        for (uint32_t i = 0; i < (uint32_t)((eventCount)); ++i) {
+            transform_tohost_VkDependencyInfoKHR(
+                sResourceTracker, (VkDependencyInfoKHR*)(local_pDependencyInfos + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        if (((eventCount))) {
+            *countPtr += ((eventCount)) * 8;
+        }
+        for (uint32_t i = 0; i < (uint32_t)((eventCount)); ++i) {
+            count_VkDependencyInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                      (VkDependencyInfoKHR*)(local_pDependencyInfos + i), countPtr);
+        }
+    }
+    uint32_t packetSize_vkCmdWaitEvents2KHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdWaitEvents2KHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdWaitEvents2KHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdWaitEvents2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdWaitEvents2KHR = OP_vkCmdWaitEvents2KHR;
+    memcpy(streamPtr, &opcode_vkCmdWaitEvents2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdWaitEvents2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_eventCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (((eventCount))) {
+        uint8_t* cgen_var_0_ptr = (uint8_t*)(*streamPtrPtr);
+        for (uint32_t k = 0; k < ((eventCount)); ++k) {
+            uint64_t tmpval = get_host_u64_VkEvent(local_pEvents[k]);
+            memcpy(cgen_var_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+        }
+        *streamPtrPtr += 8 * ((eventCount));
+    }
+    for (uint32_t i = 0; i < (uint32_t)((eventCount)); ++i) {
+        reservedmarshal_VkDependencyInfoKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                            (VkDependencyInfoKHR*)(local_pDependencyInfos + i),
+                                            streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdWaitEvents2KHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdPipelineBarrier2KHR(VkCommandBuffer commandBuffer,
+                                         const VkDependencyInfoKHR* pDependencyInfo,
+                                         uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdPipelineBarrier2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdPipelineBarrier2KHR(commandBuffer:%p, pDependencyInfo:%p)",
+                      commandBuffer, pDependencyInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkDependencyInfoKHR* local_pDependencyInfo;
+    local_commandBuffer = commandBuffer;
+    local_pDependencyInfo = nullptr;
+    if (pDependencyInfo) {
+        local_pDependencyInfo =
+            (VkDependencyInfoKHR*)pool->alloc(sizeof(const VkDependencyInfoKHR));
+        deepcopy_VkDependencyInfoKHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pDependencyInfo,
+                                     (VkDependencyInfoKHR*)(local_pDependencyInfo));
+    }
+    if (local_pDependencyInfo) {
+        transform_tohost_VkDependencyInfoKHR(sResourceTracker,
+                                             (VkDependencyInfoKHR*)(local_pDependencyInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDependencyInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                  (VkDependencyInfoKHR*)(local_pDependencyInfo), countPtr);
+    }
+    uint32_t packetSize_vkCmdPipelineBarrier2KHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdPipelineBarrier2KHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdPipelineBarrier2KHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdPipelineBarrier2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdPipelineBarrier2KHR = OP_vkCmdPipelineBarrier2KHR;
+    memcpy(streamPtr, &opcode_vkCmdPipelineBarrier2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdPipelineBarrier2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkDependencyInfoKHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkDependencyInfoKHR*)(local_pDependencyInfo),
+                                        streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdPipelineBarrier2KHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdWriteTimestamp2KHR(VkCommandBuffer commandBuffer,
+                                        VkPipelineStageFlags2KHR stage, VkQueryPool queryPool,
+                                        uint32_t query, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdWriteTimestamp2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdWriteTimestamp2KHR(commandBuffer:%p, queryPool:%p, query:%d)",
+                      commandBuffer, queryPool, query);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkPipelineStageFlags2KHR local_stage;
+    VkQueryPool local_queryPool;
+    uint32_t local_query;
+    local_commandBuffer = commandBuffer;
+    local_stage = stage;
+    local_queryPool = queryPool;
+    local_query = query;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkPipelineStageFlags2KHR);
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdWriteTimestamp2KHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdWriteTimestamp2KHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdWriteTimestamp2KHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdWriteTimestamp2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdWriteTimestamp2KHR = OP_vkCmdWriteTimestamp2KHR;
+    memcpy(streamPtr, &opcode_vkCmdWriteTimestamp2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdWriteTimestamp2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkPipelineStageFlags2KHR*)&local_stage,
+           sizeof(VkPipelineStageFlags2KHR));
+    *streamPtrPtr += sizeof(VkPipelineStageFlags2KHR);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkQueryPool((*&local_queryPool));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_query, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdWriteTimestamp2KHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkQueueSubmit2KHR(VkQueue queue, uint32_t submitCount,
+                                      const VkSubmitInfo2KHR* pSubmits, VkFence fence,
+                                      uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkQueueSubmit2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkQueueSubmit2KHR(queue:%p, submitCount:%d, pSubmits:%p, fence:%p)", queue,
+                      submitCount, pSubmits, fence);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkQueue local_queue;
+    uint32_t local_submitCount;
+    VkSubmitInfo2KHR* local_pSubmits;
+    VkFence local_fence;
+    local_queue = queue;
+    local_submitCount = submitCount;
+    local_pSubmits = nullptr;
+    if (pSubmits) {
+        local_pSubmits =
+            (VkSubmitInfo2KHR*)pool->alloc(((submitCount)) * sizeof(const VkSubmitInfo2KHR));
+        for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) {
+            deepcopy_VkSubmitInfo2KHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pSubmits + i,
+                                      (VkSubmitInfo2KHR*)(local_pSubmits + i));
+        }
+    }
+    local_fence = fence;
+    if (local_pSubmits) {
+        for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) {
+            transform_tohost_VkSubmitInfo2KHR(sResourceTracker,
+                                              (VkSubmitInfo2KHR*)(local_pSubmits + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) {
+            count_VkSubmitInfo2KHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                   (VkSubmitInfo2KHR*)(local_pSubmits + i), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkQueueSubmit2KHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkQueueSubmit2KHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkQueueSubmit2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkQueueSubmit2KHR = OP_vkQueueSubmit2KHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkQueueSubmit2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkQueueSubmit2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkQueue((*&local_queue));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_submitCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) {
+        reservedmarshal_VkSubmitInfo2KHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkSubmitInfo2KHR*)(local_pSubmits + i), streamPtrPtr);
+    }
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkFence((*&local_fence));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkQueueSubmit2KHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkQueueSubmit2KHR_VkResult_return = (VkResult)0;
+    stream->read(&vkQueueSubmit2KHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkQueueSubmit2KHR_VkResult_return;
+}
+
+void VkEncoder::vkCmdWriteBufferMarker2AMD(VkCommandBuffer commandBuffer,
+                                           VkPipelineStageFlags2KHR stage, VkBuffer dstBuffer,
+                                           VkDeviceSize dstOffset, uint32_t marker,
+                                           uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdWriteBufferMarker2AMD in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdWriteBufferMarker2AMD(commandBuffer:%p, dstBuffer:%p, dstOffset:%ld, marker:%d)",
+        commandBuffer, dstBuffer, dstOffset, marker);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkPipelineStageFlags2KHR local_stage;
+    VkBuffer local_dstBuffer;
+    VkDeviceSize local_dstOffset;
+    uint32_t local_marker;
+    local_commandBuffer = commandBuffer;
+    local_stage = stage;
+    local_dstBuffer = dstBuffer;
+    local_dstOffset = dstOffset;
+    local_marker = marker;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkPipelineStageFlags2KHR);
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdWriteBufferMarker2AMD = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdWriteBufferMarker2AMD);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdWriteBufferMarker2AMD -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdWriteBufferMarker2AMD);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdWriteBufferMarker2AMD = OP_vkCmdWriteBufferMarker2AMD;
+    memcpy(streamPtr, &opcode_vkCmdWriteBufferMarker2AMD, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdWriteBufferMarker2AMD, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkPipelineStageFlags2KHR*)&local_stage,
+           sizeof(VkPipelineStageFlags2KHR));
+    *streamPtrPtr += sizeof(VkPipelineStageFlags2KHR);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&local_dstBuffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_marker, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdWriteBufferMarker2AMD), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetQueueCheckpointData2NV(VkQueue queue, uint32_t* pCheckpointDataCount,
+                                            VkCheckpointData2NV* pCheckpointData, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetQueueCheckpointData2NV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetQueueCheckpointData2NV(queue:%p, pCheckpointDataCount:%p, pCheckpointData:%p)", queue,
+        pCheckpointDataCount, pCheckpointData);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkQueue local_queue;
+    local_queue = queue;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pCheckpointDataCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pCheckpointData) {
+            if (pCheckpointDataCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) {
+                    count_VkCheckpointData2NV(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkCheckpointData2NV*)(pCheckpointData + i),
+                                              countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetQueueCheckpointData2NV =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetQueueCheckpointData2NV);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetQueueCheckpointData2NV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetQueueCheckpointData2NV = OP_vkGetQueueCheckpointData2NV;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetQueueCheckpointData2NV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetQueueCheckpointData2NV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkQueue((*&local_queue));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pCheckpointDataCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pCheckpointDataCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pCheckpointDataCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pCheckpointData;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pCheckpointData) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) {
+            reservedmarshal_VkCheckpointData2NV(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                (VkCheckpointData2NV*)(pCheckpointData + i),
+                                                streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetQueueCheckpointData2NV), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pCheckpointDataCount;
+    check_pCheckpointDataCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pCheckpointDataCount) {
+        if (!(check_pCheckpointDataCount)) {
+            fprintf(stderr, "fatal: pCheckpointDataCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pCheckpointDataCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkCheckpointData2NV* check_pCheckpointData;
+    check_pCheckpointData = (VkCheckpointData2NV*)(uintptr_t)stream->getBe64();
+    if (pCheckpointData) {
+        if (!(check_pCheckpointData)) {
+            fprintf(stderr, "fatal: pCheckpointData inconsistent between guest and host\n");
+        }
+        if (pCheckpointDataCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) {
+                unmarshal_VkCheckpointData2NV(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkCheckpointData2NV*)(pCheckpointData + i));
+            }
+        }
+    }
+    if (pCheckpointDataCount) {
+        if (pCheckpointData) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) {
+                transform_fromhost_VkCheckpointData2NV(sResourceTracker,
+                                                       (VkCheckpointData2NV*)(pCheckpointData + i));
+            }
+        }
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_KHR_shader_subgroup_uniform_control_flow
+#endif
+#ifdef VK_KHR_zero_initialize_workgroup_memory
+#endif
+#ifdef VK_KHR_workgroup_memory_explicit_layout
+#endif
+#ifdef VK_KHR_copy_commands2
+void VkEncoder::vkCmdCopyBuffer2KHR(VkCommandBuffer commandBuffer,
+                                    const VkCopyBufferInfo2KHR* pCopyBufferInfo, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdCopyBuffer2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdCopyBuffer2KHR(commandBuffer:%p, pCopyBufferInfo:%p)", commandBuffer,
+                      pCopyBufferInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkCopyBufferInfo2KHR* local_pCopyBufferInfo;
+    local_commandBuffer = commandBuffer;
+    local_pCopyBufferInfo = nullptr;
+    if (pCopyBufferInfo) {
+        local_pCopyBufferInfo =
+            (VkCopyBufferInfo2KHR*)pool->alloc(sizeof(const VkCopyBufferInfo2KHR));
+        deepcopy_VkCopyBufferInfo2KHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCopyBufferInfo,
+                                      (VkCopyBufferInfo2KHR*)(local_pCopyBufferInfo));
+    }
+    if (local_pCopyBufferInfo) {
+        transform_tohost_VkCopyBufferInfo2KHR(sResourceTracker,
+                                              (VkCopyBufferInfo2KHR*)(local_pCopyBufferInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkCopyBufferInfo2KHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                   (VkCopyBufferInfo2KHR*)(local_pCopyBufferInfo), countPtr);
+    }
+    uint32_t packetSize_vkCmdCopyBuffer2KHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdCopyBuffer2KHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdCopyBuffer2KHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdCopyBuffer2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdCopyBuffer2KHR = OP_vkCmdCopyBuffer2KHR;
+    memcpy(streamPtr, &opcode_vkCmdCopyBuffer2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdCopyBuffer2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkCopyBufferInfo2KHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkCopyBufferInfo2KHR*)(local_pCopyBufferInfo),
+                                         streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdCopyBuffer2KHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdCopyImage2KHR(VkCommandBuffer commandBuffer,
+                                   const VkCopyImageInfo2KHR* pCopyImageInfo, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdCopyImage2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdCopyImage2KHR(commandBuffer:%p, pCopyImageInfo:%p)", commandBuffer,
+                      pCopyImageInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkCopyImageInfo2KHR* local_pCopyImageInfo;
+    local_commandBuffer = commandBuffer;
+    local_pCopyImageInfo = nullptr;
+    if (pCopyImageInfo) {
+        local_pCopyImageInfo = (VkCopyImageInfo2KHR*)pool->alloc(sizeof(const VkCopyImageInfo2KHR));
+        deepcopy_VkCopyImageInfo2KHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCopyImageInfo,
+                                     (VkCopyImageInfo2KHR*)(local_pCopyImageInfo));
+    }
+    if (local_pCopyImageInfo) {
+        transform_tohost_VkCopyImageInfo2KHR(sResourceTracker,
+                                             (VkCopyImageInfo2KHR*)(local_pCopyImageInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkCopyImageInfo2KHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                  (VkCopyImageInfo2KHR*)(local_pCopyImageInfo), countPtr);
+    }
+    uint32_t packetSize_vkCmdCopyImage2KHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdCopyImage2KHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdCopyImage2KHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdCopyImage2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdCopyImage2KHR = OP_vkCmdCopyImage2KHR;
+    memcpy(streamPtr, &opcode_vkCmdCopyImage2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdCopyImage2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkCopyImageInfo2KHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkCopyImageInfo2KHR*)(local_pCopyImageInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdCopyImage2KHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdCopyBufferToImage2KHR(
+    VkCommandBuffer commandBuffer, const VkCopyBufferToImageInfo2KHR* pCopyBufferToImageInfo,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdCopyBufferToImage2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdCopyBufferToImage2KHR(commandBuffer:%p, pCopyBufferToImageInfo:%p)",
+                      commandBuffer, pCopyBufferToImageInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkCopyBufferToImageInfo2KHR* local_pCopyBufferToImageInfo;
+    local_commandBuffer = commandBuffer;
+    local_pCopyBufferToImageInfo = nullptr;
+    if (pCopyBufferToImageInfo) {
+        local_pCopyBufferToImageInfo =
+            (VkCopyBufferToImageInfo2KHR*)pool->alloc(sizeof(const VkCopyBufferToImageInfo2KHR));
+        deepcopy_VkCopyBufferToImageInfo2KHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCopyBufferToImageInfo,
+            (VkCopyBufferToImageInfo2KHR*)(local_pCopyBufferToImageInfo));
+    }
+    if (local_pCopyBufferToImageInfo) {
+        transform_tohost_VkCopyBufferToImageInfo2KHR(
+            sResourceTracker, (VkCopyBufferToImageInfo2KHR*)(local_pCopyBufferToImageInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkCopyBufferToImageInfo2KHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkCopyBufferToImageInfo2KHR*)(local_pCopyBufferToImageInfo), countPtr);
+    }
+    uint32_t packetSize_vkCmdCopyBufferToImage2KHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdCopyBufferToImage2KHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdCopyBufferToImage2KHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdCopyBufferToImage2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdCopyBufferToImage2KHR = OP_vkCmdCopyBufferToImage2KHR;
+    memcpy(streamPtr, &opcode_vkCmdCopyBufferToImage2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdCopyBufferToImage2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkCopyBufferToImageInfo2KHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkCopyBufferToImageInfo2KHR*)(local_pCopyBufferToImageInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdCopyBufferToImage2KHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdCopyImageToBuffer2KHR(
+    VkCommandBuffer commandBuffer, const VkCopyImageToBufferInfo2KHR* pCopyImageToBufferInfo,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdCopyImageToBuffer2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdCopyImageToBuffer2KHR(commandBuffer:%p, pCopyImageToBufferInfo:%p)",
+                      commandBuffer, pCopyImageToBufferInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkCopyImageToBufferInfo2KHR* local_pCopyImageToBufferInfo;
+    local_commandBuffer = commandBuffer;
+    local_pCopyImageToBufferInfo = nullptr;
+    if (pCopyImageToBufferInfo) {
+        local_pCopyImageToBufferInfo =
+            (VkCopyImageToBufferInfo2KHR*)pool->alloc(sizeof(const VkCopyImageToBufferInfo2KHR));
+        deepcopy_VkCopyImageToBufferInfo2KHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCopyImageToBufferInfo,
+            (VkCopyImageToBufferInfo2KHR*)(local_pCopyImageToBufferInfo));
+    }
+    if (local_pCopyImageToBufferInfo) {
+        transform_tohost_VkCopyImageToBufferInfo2KHR(
+            sResourceTracker, (VkCopyImageToBufferInfo2KHR*)(local_pCopyImageToBufferInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkCopyImageToBufferInfo2KHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkCopyImageToBufferInfo2KHR*)(local_pCopyImageToBufferInfo), countPtr);
+    }
+    uint32_t packetSize_vkCmdCopyImageToBuffer2KHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdCopyImageToBuffer2KHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdCopyImageToBuffer2KHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdCopyImageToBuffer2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdCopyImageToBuffer2KHR = OP_vkCmdCopyImageToBuffer2KHR;
+    memcpy(streamPtr, &opcode_vkCmdCopyImageToBuffer2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdCopyImageToBuffer2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkCopyImageToBufferInfo2KHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkCopyImageToBufferInfo2KHR*)(local_pCopyImageToBufferInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdCopyImageToBuffer2KHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdBlitImage2KHR(VkCommandBuffer commandBuffer,
+                                   const VkBlitImageInfo2KHR* pBlitImageInfo, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdBlitImage2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdBlitImage2KHR(commandBuffer:%p, pBlitImageInfo:%p)", commandBuffer,
+                      pBlitImageInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkBlitImageInfo2KHR* local_pBlitImageInfo;
+    local_commandBuffer = commandBuffer;
+    local_pBlitImageInfo = nullptr;
+    if (pBlitImageInfo) {
+        local_pBlitImageInfo = (VkBlitImageInfo2KHR*)pool->alloc(sizeof(const VkBlitImageInfo2KHR));
+        deepcopy_VkBlitImageInfo2KHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pBlitImageInfo,
+                                     (VkBlitImageInfo2KHR*)(local_pBlitImageInfo));
+    }
+    if (local_pBlitImageInfo) {
+        transform_tohost_VkBlitImageInfo2KHR(sResourceTracker,
+                                             (VkBlitImageInfo2KHR*)(local_pBlitImageInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkBlitImageInfo2KHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                  (VkBlitImageInfo2KHR*)(local_pBlitImageInfo), countPtr);
+    }
+    uint32_t packetSize_vkCmdBlitImage2KHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdBlitImage2KHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdBlitImage2KHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdBlitImage2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdBlitImage2KHR = OP_vkCmdBlitImage2KHR;
+    memcpy(streamPtr, &opcode_vkCmdBlitImage2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdBlitImage2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkBlitImageInfo2KHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkBlitImageInfo2KHR*)(local_pBlitImageInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdBlitImage2KHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdResolveImage2KHR(VkCommandBuffer commandBuffer,
+                                      const VkResolveImageInfo2KHR* pResolveImageInfo,
+                                      uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdResolveImage2KHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdResolveImage2KHR(commandBuffer:%p, pResolveImageInfo:%p)",
+                      commandBuffer, pResolveImageInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkResolveImageInfo2KHR* local_pResolveImageInfo;
+    local_commandBuffer = commandBuffer;
+    local_pResolveImageInfo = nullptr;
+    if (pResolveImageInfo) {
+        local_pResolveImageInfo =
+            (VkResolveImageInfo2KHR*)pool->alloc(sizeof(const VkResolveImageInfo2KHR));
+        deepcopy_VkResolveImageInfo2KHR(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pResolveImageInfo,
+                                        (VkResolveImageInfo2KHR*)(local_pResolveImageInfo));
+    }
+    if (local_pResolveImageInfo) {
+        transform_tohost_VkResolveImageInfo2KHR(sResourceTracker,
+                                                (VkResolveImageInfo2KHR*)(local_pResolveImageInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkResolveImageInfo2KHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                     (VkResolveImageInfo2KHR*)(local_pResolveImageInfo), countPtr);
+    }
+    uint32_t packetSize_vkCmdResolveImage2KHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdResolveImage2KHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdResolveImage2KHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdResolveImage2KHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdResolveImage2KHR = OP_vkCmdResolveImage2KHR;
+    memcpy(streamPtr, &opcode_vkCmdResolveImage2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdResolveImage2KHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkResolveImageInfo2KHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                           (VkResolveImageInfo2KHR*)(local_pResolveImageInfo),
+                                           streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdResolveImage2KHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_KHR_format_feature_flags2
+#endif
+#ifdef VK_KHR_maintenance4
+void VkEncoder::vkGetDeviceBufferMemoryRequirementsKHR(
+    VkDevice device, const VkDeviceBufferMemoryRequirementsKHR* pInfo,
+    VkMemoryRequirements2* pMemoryRequirements, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetDeviceBufferMemoryRequirementsKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetDeviceBufferMemoryRequirementsKHR(device:%p, pInfo:%p, pMemoryRequirements:%p)",
+        device, pInfo, pMemoryRequirements);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDeviceBufferMemoryRequirementsKHR* local_pInfo;
+    local_device = device;
+    local_pInfo = nullptr;
+    if (pInfo) {
+        local_pInfo = (VkDeviceBufferMemoryRequirementsKHR*)pool->alloc(
+            sizeof(const VkDeviceBufferMemoryRequirementsKHR));
+        deepcopy_VkDeviceBufferMemoryRequirementsKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfo,
+            (VkDeviceBufferMemoryRequirementsKHR*)(local_pInfo));
+    }
+    if (local_pInfo) {
+        transform_tohost_VkDeviceBufferMemoryRequirementsKHR(
+            sResourceTracker, (VkDeviceBufferMemoryRequirementsKHR*)(local_pInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDeviceBufferMemoryRequirementsKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkDeviceBufferMemoryRequirementsKHR*)(local_pInfo), countPtr);
+        count_VkMemoryRequirements2(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkMemoryRequirements2*)(pMemoryRequirements), countPtr);
+    }
+    uint32_t packetSize_vkGetDeviceBufferMemoryRequirementsKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetDeviceBufferMemoryRequirementsKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetDeviceBufferMemoryRequirementsKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetDeviceBufferMemoryRequirementsKHR =
+        OP_vkGetDeviceBufferMemoryRequirementsKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetDeviceBufferMemoryRequirementsKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetDeviceBufferMemoryRequirementsKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDeviceBufferMemoryRequirementsKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkDeviceBufferMemoryRequirementsKHR*)(local_pInfo),
+        streamPtrPtr);
+    reservedmarshal_VkMemoryRequirements2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkMemoryRequirements2*)(pMemoryRequirements),
+                                          streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetDeviceBufferMemoryRequirementsKHR),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkMemoryRequirements2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkMemoryRequirements2*)(pMemoryRequirements));
+    if (pMemoryRequirements) {
+        transform_fromhost_VkMemoryRequirements2(sResourceTracker,
+                                                 (VkMemoryRequirements2*)(pMemoryRequirements));
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetDeviceImageMemoryRequirementsKHR(
+    VkDevice device, const VkDeviceImageMemoryRequirementsKHR* pInfo,
+    VkMemoryRequirements2* pMemoryRequirements, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetDeviceImageMemoryRequirementsKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetDeviceImageMemoryRequirementsKHR(device:%p, pInfo:%p, pMemoryRequirements:%p)",
+        device, pInfo, pMemoryRequirements);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDeviceImageMemoryRequirementsKHR* local_pInfo;
+    local_device = device;
+    local_pInfo = nullptr;
+    if (pInfo) {
+        local_pInfo = (VkDeviceImageMemoryRequirementsKHR*)pool->alloc(
+            sizeof(const VkDeviceImageMemoryRequirementsKHR));
+        deepcopy_VkDeviceImageMemoryRequirementsKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfo,
+            (VkDeviceImageMemoryRequirementsKHR*)(local_pInfo));
+    }
+    if (local_pInfo) {
+        transform_tohost_VkDeviceImageMemoryRequirementsKHR(
+            sResourceTracker, (VkDeviceImageMemoryRequirementsKHR*)(local_pInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDeviceImageMemoryRequirementsKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                 (VkDeviceImageMemoryRequirementsKHR*)(local_pInfo),
+                                                 countPtr);
+        count_VkMemoryRequirements2(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkMemoryRequirements2*)(pMemoryRequirements), countPtr);
+    }
+    uint32_t packetSize_vkGetDeviceImageMemoryRequirementsKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetDeviceImageMemoryRequirementsKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetDeviceImageMemoryRequirementsKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetDeviceImageMemoryRequirementsKHR =
+        OP_vkGetDeviceImageMemoryRequirementsKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetDeviceImageMemoryRequirementsKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetDeviceImageMemoryRequirementsKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDeviceImageMemoryRequirementsKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkDeviceImageMemoryRequirementsKHR*)(local_pInfo),
+        streamPtrPtr);
+    reservedmarshal_VkMemoryRequirements2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkMemoryRequirements2*)(pMemoryRequirements),
+                                          streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetDeviceImageMemoryRequirementsKHR),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkMemoryRequirements2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkMemoryRequirements2*)(pMemoryRequirements));
+    if (pMemoryRequirements) {
+        transform_fromhost_VkMemoryRequirements2(sResourceTracker,
+                                                 (VkMemoryRequirements2*)(pMemoryRequirements));
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetDeviceImageSparseMemoryRequirementsKHR(
+    VkDevice device, const VkDeviceImageMemoryRequirementsKHR* pInfo,
+    uint32_t* pSparseMemoryRequirementCount,
+    VkSparseImageMemoryRequirements2* pSparseMemoryRequirements, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetDeviceImageSparseMemoryRequirementsKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetDeviceImageSparseMemoryRequirementsKHR(device:%p, pInfo:%p, "
+        "pSparseMemoryRequirementCount:%p, pSparseMemoryRequirements:%p)",
+        device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDeviceImageMemoryRequirementsKHR* local_pInfo;
+    local_device = device;
+    local_pInfo = nullptr;
+    if (pInfo) {
+        local_pInfo = (VkDeviceImageMemoryRequirementsKHR*)pool->alloc(
+            sizeof(const VkDeviceImageMemoryRequirementsKHR));
+        deepcopy_VkDeviceImageMemoryRequirementsKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfo,
+            (VkDeviceImageMemoryRequirementsKHR*)(local_pInfo));
+    }
+    if (local_pInfo) {
+        transform_tohost_VkDeviceImageMemoryRequirementsKHR(
+            sResourceTracker, (VkDeviceImageMemoryRequirementsKHR*)(local_pInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDeviceImageMemoryRequirementsKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                 (VkDeviceImageMemoryRequirementsKHR*)(local_pInfo),
+                                                 countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pSparseMemoryRequirementCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pSparseMemoryRequirements) {
+            if (pSparseMemoryRequirementCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) {
+                    count_VkSparseImageMemoryRequirements2(
+                        sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                        (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i),
+                        countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetDeviceImageSparseMemoryRequirementsKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetDeviceImageSparseMemoryRequirementsKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetDeviceImageSparseMemoryRequirementsKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetDeviceImageSparseMemoryRequirementsKHR =
+        OP_vkGetDeviceImageSparseMemoryRequirementsKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetDeviceImageSparseMemoryRequirementsKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetDeviceImageSparseMemoryRequirementsKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDeviceImageMemoryRequirementsKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkDeviceImageMemoryRequirementsKHR*)(local_pInfo),
+        streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pSparseMemoryRequirementCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pSparseMemoryRequirements;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pSparseMemoryRequirements) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) {
+            reservedmarshal_VkSparseImageMemoryRequirements2(
+                stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i), streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetDeviceImageSparseMemoryRequirementsKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pSparseMemoryRequirementCount;
+    check_pSparseMemoryRequirementCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pSparseMemoryRequirementCount) {
+        if (!(check_pSparseMemoryRequirementCount)) {
+            fprintf(stderr,
+                    "fatal: pSparseMemoryRequirementCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkSparseImageMemoryRequirements2* check_pSparseMemoryRequirements;
+    check_pSparseMemoryRequirements =
+        (VkSparseImageMemoryRequirements2*)(uintptr_t)stream->getBe64();
+    if (pSparseMemoryRequirements) {
+        if (!(check_pSparseMemoryRequirements)) {
+            fprintf(stderr,
+                    "fatal: pSparseMemoryRequirements inconsistent between guest and host\n");
+        }
+        if (pSparseMemoryRequirementCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) {
+                unmarshal_VkSparseImageMemoryRequirements2(
+                    stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                    (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i));
+            }
+        }
+    }
+    if (pSparseMemoryRequirementCount) {
+        if (pSparseMemoryRequirements) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) {
+                transform_fromhost_VkSparseImageMemoryRequirements2(
+                    sResourceTracker,
+                    (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i));
+            }
+        }
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_ANDROID_native_buffer
+VkResult VkEncoder::vkGetSwapchainGrallocUsageANDROID(VkDevice device, VkFormat format,
+                                                      VkImageUsageFlags imageUsage,
+                                                      int* grallocUsage, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetSwapchainGrallocUsageANDROID in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetSwapchainGrallocUsageANDROID(device:%p, format:%d, imageUsage:%d, grallocUsage:%p)",
+        device, format, imageUsage, grallocUsage);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkFormat local_format;
+    VkImageUsageFlags local_imageUsage;
+    local_device = device;
+    local_format = format;
+    local_imageUsage = imageUsage;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkFormat);
+        *countPtr += sizeof(VkImageUsageFlags);
+        *countPtr += sizeof(int);
+    }
+    uint32_t packetSize_vkGetSwapchainGrallocUsageANDROID =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetSwapchainGrallocUsageANDROID);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetSwapchainGrallocUsageANDROID);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetSwapchainGrallocUsageANDROID = OP_vkGetSwapchainGrallocUsageANDROID;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetSwapchainGrallocUsageANDROID, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetSwapchainGrallocUsageANDROID, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkFormat*)&local_format, sizeof(VkFormat));
+    *streamPtrPtr += sizeof(VkFormat);
+    memcpy(*streamPtrPtr, (VkImageUsageFlags*)&local_imageUsage, sizeof(VkImageUsageFlags));
+    *streamPtrPtr += sizeof(VkImageUsageFlags);
+    memcpy(*streamPtrPtr, (int*)grallocUsage, sizeof(int));
+    *streamPtrPtr += sizeof(int);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetSwapchainGrallocUsageANDROID), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((int*)grallocUsage, sizeof(int));
+    VkResult vkGetSwapchainGrallocUsageANDROID_VkResult_return = (VkResult)0;
+    stream->read(&vkGetSwapchainGrallocUsageANDROID_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetSwapchainGrallocUsageANDROID_VkResult_return;
+}
+
+VkResult VkEncoder::vkAcquireImageANDROID(VkDevice device, VkImage image, int nativeFenceFd,
+                                          VkSemaphore semaphore, VkFence fence, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkAcquireImageANDROID in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkImage local_image;
+    int local_nativeFenceFd;
+    VkSemaphore local_semaphore;
+    VkFence local_fence;
+    local_device = device;
+    local_image = image;
+    local_nativeFenceFd = nativeFenceFd;
+    local_semaphore = semaphore;
+    local_fence = fence;
+    sResourceTracker->unwrap_vkAcquireImageANDROID_nativeFenceFd(nativeFenceFd,
+                                                                 &local_nativeFenceFd);
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(int);
+        uint64_t cgen_var_2;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_3;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkAcquireImageANDROID =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkAcquireImageANDROID);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkAcquireImageANDROID);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkAcquireImageANDROID = OP_vkAcquireImageANDROID;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkAcquireImageANDROID, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkAcquireImageANDROID, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkImage((*&local_image));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (int*)&local_nativeFenceFd, sizeof(int));
+    *streamPtrPtr += sizeof(int);
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = get_host_u64_VkSemaphore((*&local_semaphore));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_3;
+    *&cgen_var_3 = get_host_u64_VkFence((*&local_fence));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_3, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkAcquireImageANDROID), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkAcquireImageANDROID_VkResult_return = (VkResult)0;
+    stream->read(&vkAcquireImageANDROID_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkAcquireImageANDROID_VkResult_return;
+}
+
+VkResult VkEncoder::vkQueueSignalReleaseImageANDROID(VkQueue queue, uint32_t waitSemaphoreCount,
+                                                     const VkSemaphore* pWaitSemaphores,
+                                                     VkImage image, int* pNativeFenceFd,
+                                                     uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkQueueSignalReleaseImageANDROID in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkQueueSignalReleaseImageANDROID(queue:%p, waitSemaphoreCount:%d, pWaitSemaphores:%p, "
+        "image:%p, pNativeFenceFd:%p)",
+        queue, waitSemaphoreCount, pWaitSemaphores, image, pNativeFenceFd);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkQueue local_queue;
+    uint32_t local_waitSemaphoreCount;
+    VkSemaphore* local_pWaitSemaphores;
+    VkImage local_image;
+    local_queue = queue;
+    local_waitSemaphoreCount = waitSemaphoreCount;
+    // Avoiding deepcopy for pWaitSemaphores
+    local_pWaitSemaphores = (VkSemaphore*)pWaitSemaphores;
+    local_image = image;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pWaitSemaphores) {
+            if (((waitSemaphoreCount))) {
+                *countPtr += ((waitSemaphoreCount)) * 8;
+            }
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(int);
+    }
+    uint32_t packetSize_vkQueueSignalReleaseImageANDROID =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkQueueSignalReleaseImageANDROID);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkQueueSignalReleaseImageANDROID);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkQueueSignalReleaseImageANDROID = OP_vkQueueSignalReleaseImageANDROID;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkQueueSignalReleaseImageANDROID, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkQueueSignalReleaseImageANDROID, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkQueue((*&local_queue));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_waitSemaphoreCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pWaitSemaphores;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pWaitSemaphores) {
+        if (((waitSemaphoreCount))) {
+            uint8_t* cgen_var_1_0_ptr = (uint8_t*)(*streamPtrPtr);
+            for (uint32_t k = 0; k < ((waitSemaphoreCount)); ++k) {
+                uint64_t tmpval = get_host_u64_VkSemaphore(local_pWaitSemaphores[k]);
+                memcpy(cgen_var_1_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+            }
+            *streamPtrPtr += 8 * ((waitSemaphoreCount));
+        }
+    }
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = get_host_u64_VkImage((*&local_image));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (int*)pNativeFenceFd, sizeof(int));
+    *streamPtrPtr += sizeof(int);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkQueueSignalReleaseImageANDROID), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((int*)pNativeFenceFd, sizeof(int));
+    VkResult vkQueueSignalReleaseImageANDROID_VkResult_return = (VkResult)0;
+    stream->read(&vkQueueSignalReleaseImageANDROID_VkResult_return, sizeof(VkResult));
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkQueueSignalReleaseImageANDROID_VkResult_return;
+}
+
+#endif
+#ifdef VK_EXT_debug_report
+VkResult VkEncoder::vkCreateDebugReportCallbackEXT(
+    VkInstance instance, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkDebugReportCallbackEXT* pCallback, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateDebugReportCallbackEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateDebugReportCallbackEXT(instance:%p, pCreateInfo:%p, pAllocator:%p, pCallback:%p)",
+        instance, pCreateInfo, pAllocator, pCallback);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkInstance local_instance;
+    VkDebugReportCallbackCreateInfoEXT* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_instance = instance;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkDebugReportCallbackCreateInfoEXT*)pool->alloc(
+            sizeof(const VkDebugReportCallbackCreateInfoEXT));
+        deepcopy_VkDebugReportCallbackCreateInfoEXT(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+            (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkDebugReportCallbackCreateInfoEXT(
+            sResourceTracker, (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDebugReportCallbackCreateInfoEXT(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateDebugReportCallbackEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCreateDebugReportCallbackEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateDebugReportCallbackEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateDebugReportCallbackEXT = OP_vkCreateDebugReportCallbackEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateDebugReportCallbackEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateDebugReportCallbackEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkInstance((*&local_instance));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDebugReportCallbackCreateInfoEXT(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo), streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pCallback));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateDebugReportCallbackEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkDebugReportCallbackEXT(
+        &cgen_var_3, (VkDebugReportCallbackEXT*)pCallback, 1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateDebugReportCallbackEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateDebugReportCallbackEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateDebugReportCallbackEXT_VkResult_return;
+}
+
+void VkEncoder::vkDestroyDebugReportCallbackEXT(VkInstance instance,
+                                                VkDebugReportCallbackEXT callback,
+                                                const VkAllocationCallbacks* pAllocator,
+                                                uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyDebugReportCallbackEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroyDebugReportCallbackEXT(instance:%p, callback:%p, pAllocator:%p)",
+                      instance, callback, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkInstance local_instance;
+    VkDebugReportCallbackEXT local_callback;
+    VkAllocationCallbacks* local_pAllocator;
+    local_instance = instance;
+    local_callback = callback;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyDebugReportCallbackEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkDestroyDebugReportCallbackEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyDebugReportCallbackEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyDebugReportCallbackEXT = OP_vkDestroyDebugReportCallbackEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyDebugReportCallbackEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyDebugReportCallbackEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkInstance((*&local_instance));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDebugReportCallbackEXT((*&local_callback));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroyDebugReportCallbackEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkDebugReportCallbackEXT(
+        (VkDebugReportCallbackEXT*)&callback);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkDebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags,
+                                        VkDebugReportObjectTypeEXT objectType, uint64_t object,
+                                        size_t location, int32_t messageCode,
+                                        const char* pLayerPrefix, const char* pMessage,
+                                        uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDebugReportMessageEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkDebugReportMessageEXT(instance:%p, object:%ld, location:%ld, messageCode:%d, "
+        "pLayerPrefix:%p, pMessage:%p)",
+        instance, object, location, messageCode, pLayerPrefix, pMessage);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkInstance local_instance;
+    VkDebugReportFlagsEXT local_flags;
+    VkDebugReportObjectTypeEXT local_objectType;
+    uint64_t local_object;
+    size_t local_location;
+    int32_t local_messageCode;
+    char* local_pLayerPrefix;
+    char* local_pMessage;
+    local_instance = instance;
+    local_flags = flags;
+    local_objectType = objectType;
+    local_object = object;
+    local_location = location;
+    local_messageCode = messageCode;
+    // Avoiding deepcopy for pLayerPrefix
+    local_pLayerPrefix = (char*)pLayerPrefix;
+    // Avoiding deepcopy for pMessage
+    local_pMessage = (char*)pMessage;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDebugReportFlagsEXT);
+        *countPtr += sizeof(VkDebugReportObjectTypeEXT);
+        *countPtr += sizeof(uint64_t);
+        *countPtr += 8;
+        *countPtr += sizeof(int32_t);
+        *countPtr += sizeof(uint32_t) + (local_pLayerPrefix ? strlen(local_pLayerPrefix) : 0);
+        *countPtr += sizeof(uint32_t) + (local_pMessage ? strlen(local_pMessage) : 0);
+    }
+    uint32_t packetSize_vkDebugReportMessageEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDebugReportMessageEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDebugReportMessageEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDebugReportMessageEXT = OP_vkDebugReportMessageEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDebugReportMessageEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDebugReportMessageEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkInstance((*&local_instance));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDebugReportFlagsEXT*)&local_flags, sizeof(VkDebugReportFlagsEXT));
+    *streamPtrPtr += sizeof(VkDebugReportFlagsEXT);
+    memcpy(*streamPtrPtr, (VkDebugReportObjectTypeEXT*)&local_objectType,
+           sizeof(VkDebugReportObjectTypeEXT));
+    *streamPtrPtr += sizeof(VkDebugReportObjectTypeEXT);
+    memcpy(*streamPtrPtr, (uint64_t*)&local_object, sizeof(uint64_t));
+    *streamPtrPtr += sizeof(uint64_t);
+    uint64_t cgen_var_1 = (uint64_t)local_location;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    memcpy(*streamPtrPtr, (int32_t*)&local_messageCode, sizeof(int32_t));
+    *streamPtrPtr += sizeof(int32_t);
+    {
+        uint32_t l = local_pLayerPrefix ? strlen(local_pLayerPrefix) : 0;
+        memcpy(*streamPtrPtr, (uint32_t*)&l, sizeof(uint32_t));
+        android::base::Stream::toBe32((uint8_t*)*streamPtrPtr);
+        *streamPtrPtr += sizeof(uint32_t);
+        memcpy(*streamPtrPtr, (char*)local_pLayerPrefix, l);
+        *streamPtrPtr += l;
+    }
+    {
+        uint32_t l = local_pMessage ? strlen(local_pMessage) : 0;
+        memcpy(*streamPtrPtr, (uint32_t*)&l, sizeof(uint32_t));
+        android::base::Stream::toBe32((uint8_t*)*streamPtrPtr);
+        *streamPtrPtr += sizeof(uint32_t);
+        memcpy(*streamPtrPtr, (char*)local_pMessage, l);
+        *streamPtrPtr += l;
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDebugReportMessageEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_NV_glsl_shader
+#endif
+#ifdef VK_EXT_depth_range_unrestricted
+#endif
+#ifdef VK_IMG_filter_cubic
+#endif
+#ifdef VK_AMD_rasterization_order
+#endif
+#ifdef VK_AMD_shader_trinary_minmax
+#endif
+#ifdef VK_AMD_shader_explicit_vertex_parameter
+#endif
+#ifdef VK_EXT_debug_marker
+VkResult VkEncoder::vkDebugMarkerSetObjectTagEXT(VkDevice device,
+                                                 const VkDebugMarkerObjectTagInfoEXT* pTagInfo,
+                                                 uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDebugMarkerSetObjectTagEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDebugMarkerSetObjectTagEXT(device:%p, pTagInfo:%p)", device, pTagInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDebugMarkerObjectTagInfoEXT* local_pTagInfo;
+    local_device = device;
+    local_pTagInfo = nullptr;
+    if (pTagInfo) {
+        local_pTagInfo = (VkDebugMarkerObjectTagInfoEXT*)pool->alloc(
+            sizeof(const VkDebugMarkerObjectTagInfoEXT));
+        deepcopy_VkDebugMarkerObjectTagInfoEXT(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pTagInfo,
+                                               (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo));
+    }
+    if (local_pTagInfo) {
+        transform_tohost_VkDebugMarkerObjectTagInfoEXT(
+            sResourceTracker, (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDebugMarkerObjectTagInfoEXT(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                            (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo),
+                                            countPtr);
+    }
+    uint32_t packetSize_vkDebugMarkerSetObjectTagEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkDebugMarkerSetObjectTagEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDebugMarkerSetObjectTagEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDebugMarkerSetObjectTagEXT = OP_vkDebugMarkerSetObjectTagEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDebugMarkerSetObjectTagEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDebugMarkerSetObjectTagEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDebugMarkerObjectTagInfoEXT(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                  (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo),
+                                                  streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDebugMarkerSetObjectTagEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkDebugMarkerSetObjectTagEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkDebugMarkerSetObjectTagEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkDebugMarkerSetObjectTagEXT_VkResult_return;
+}
+
+VkResult VkEncoder::vkDebugMarkerSetObjectNameEXT(VkDevice device,
+                                                  const VkDebugMarkerObjectNameInfoEXT* pNameInfo,
+                                                  uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDebugMarkerSetObjectNameEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDebugMarkerSetObjectNameEXT(device:%p, pNameInfo:%p)", device, pNameInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDebugMarkerObjectNameInfoEXT* local_pNameInfo;
+    local_device = device;
+    local_pNameInfo = nullptr;
+    if (pNameInfo) {
+        local_pNameInfo = (VkDebugMarkerObjectNameInfoEXT*)pool->alloc(
+            sizeof(const VkDebugMarkerObjectNameInfoEXT));
+        deepcopy_VkDebugMarkerObjectNameInfoEXT(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pNameInfo,
+                                                (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo));
+    }
+    if (local_pNameInfo) {
+        transform_tohost_VkDebugMarkerObjectNameInfoEXT(
+            sResourceTracker, (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDebugMarkerObjectNameInfoEXT(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                             (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo),
+                                             countPtr);
+    }
+    uint32_t packetSize_vkDebugMarkerSetObjectNameEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkDebugMarkerSetObjectNameEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDebugMarkerSetObjectNameEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDebugMarkerSetObjectNameEXT = OP_vkDebugMarkerSetObjectNameEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDebugMarkerSetObjectNameEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDebugMarkerSetObjectNameEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDebugMarkerObjectNameInfoEXT(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo),
+        streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDebugMarkerSetObjectNameEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkDebugMarkerSetObjectNameEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkDebugMarkerSetObjectNameEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkDebugMarkerSetObjectNameEXT_VkResult_return;
+}
+
+void VkEncoder::vkCmdDebugMarkerBeginEXT(VkCommandBuffer commandBuffer,
+                                         const VkDebugMarkerMarkerInfoEXT* pMarkerInfo,
+                                         uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdDebugMarkerBeginEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdDebugMarkerBeginEXT(commandBuffer:%p, pMarkerInfo:%p)", commandBuffer,
+                      pMarkerInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkDebugMarkerMarkerInfoEXT* local_pMarkerInfo;
+    local_commandBuffer = commandBuffer;
+    local_pMarkerInfo = nullptr;
+    if (pMarkerInfo) {
+        local_pMarkerInfo =
+            (VkDebugMarkerMarkerInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerMarkerInfoEXT));
+        deepcopy_VkDebugMarkerMarkerInfoEXT(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pMarkerInfo,
+                                            (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo));
+    }
+    if (local_pMarkerInfo) {
+        transform_tohost_VkDebugMarkerMarkerInfoEXT(
+            sResourceTracker, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDebugMarkerMarkerInfoEXT(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo),
+                                         countPtr);
+    }
+    uint32_t packetSize_vkCmdDebugMarkerBeginEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdDebugMarkerBeginEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdDebugMarkerBeginEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdDebugMarkerBeginEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdDebugMarkerBeginEXT = OP_vkCmdDebugMarkerBeginEXT;
+    memcpy(streamPtr, &opcode_vkCmdDebugMarkerBeginEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdDebugMarkerBeginEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkDebugMarkerMarkerInfoEXT(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                               (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo),
+                                               streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdDebugMarkerBeginEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdDebugMarkerEndEXT(VkCommandBuffer commandBuffer, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdDebugMarkerEndEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdDebugMarkerEndEXT(commandBuffer:%p)", commandBuffer);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    local_commandBuffer = commandBuffer;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkCmdDebugMarkerEndEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdDebugMarkerEndEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdDebugMarkerEndEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdDebugMarkerEndEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdDebugMarkerEndEXT = OP_vkCmdDebugMarkerEndEXT;
+    memcpy(streamPtr, &opcode_vkCmdDebugMarkerEndEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdDebugMarkerEndEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdDebugMarkerEndEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdDebugMarkerInsertEXT(VkCommandBuffer commandBuffer,
+                                          const VkDebugMarkerMarkerInfoEXT* pMarkerInfo,
+                                          uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdDebugMarkerInsertEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdDebugMarkerInsertEXT(commandBuffer:%p, pMarkerInfo:%p)", commandBuffer,
+                      pMarkerInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkDebugMarkerMarkerInfoEXT* local_pMarkerInfo;
+    local_commandBuffer = commandBuffer;
+    local_pMarkerInfo = nullptr;
+    if (pMarkerInfo) {
+        local_pMarkerInfo =
+            (VkDebugMarkerMarkerInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerMarkerInfoEXT));
+        deepcopy_VkDebugMarkerMarkerInfoEXT(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pMarkerInfo,
+                                            (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo));
+    }
+    if (local_pMarkerInfo) {
+        transform_tohost_VkDebugMarkerMarkerInfoEXT(
+            sResourceTracker, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDebugMarkerMarkerInfoEXT(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo),
+                                         countPtr);
+    }
+    uint32_t packetSize_vkCmdDebugMarkerInsertEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdDebugMarkerInsertEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdDebugMarkerInsertEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdDebugMarkerInsertEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdDebugMarkerInsertEXT = OP_vkCmdDebugMarkerInsertEXT;
+    memcpy(streamPtr, &opcode_vkCmdDebugMarkerInsertEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdDebugMarkerInsertEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkDebugMarkerMarkerInfoEXT(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                               (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo),
+                                               streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdDebugMarkerInsertEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_AMD_gcn_shader
+#endif
+#ifdef VK_NV_dedicated_allocation
+#endif
+#ifdef VK_EXT_transform_feedback
+void VkEncoder::vkCmdBindTransformFeedbackBuffersEXT(VkCommandBuffer commandBuffer,
+                                                     uint32_t firstBinding, uint32_t bindingCount,
+                                                     const VkBuffer* pBuffers,
+                                                     const VkDeviceSize* pOffsets,
+                                                     const VkDeviceSize* pSizes, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdBindTransformFeedbackBuffersEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdBindTransformFeedbackBuffersEXT(commandBuffer:%p, firstBinding:%d, bindingCount:%d, "
+        "pBuffers:%p, pOffsets:%p, pSizes:%p)",
+        commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets, pSizes);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_firstBinding;
+    uint32_t local_bindingCount;
+    VkBuffer* local_pBuffers;
+    VkDeviceSize* local_pOffsets;
+    VkDeviceSize* local_pSizes;
+    local_commandBuffer = commandBuffer;
+    local_firstBinding = firstBinding;
+    local_bindingCount = bindingCount;
+    // Avoiding deepcopy for pBuffers
+    local_pBuffers = (VkBuffer*)pBuffers;
+    // Avoiding deepcopy for pOffsets
+    local_pOffsets = (VkDeviceSize*)pOffsets;
+    // Avoiding deepcopy for pSizes
+    local_pSizes = (VkDeviceSize*)pSizes;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        if (((bindingCount))) {
+            *countPtr += ((bindingCount)) * 8;
+        }
+        *countPtr += ((bindingCount)) * sizeof(VkDeviceSize);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pSizes) {
+            *countPtr += ((bindingCount)) * sizeof(VkDeviceSize);
+        }
+    }
+    uint32_t packetSize_vkCmdBindTransformFeedbackBuffersEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdBindTransformFeedbackBuffersEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdBindTransformFeedbackBuffersEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdBindTransformFeedbackBuffersEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdBindTransformFeedbackBuffersEXT = OP_vkCmdBindTransformFeedbackBuffersEXT;
+    memcpy(streamPtr, &opcode_vkCmdBindTransformFeedbackBuffersEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdBindTransformFeedbackBuffersEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstBinding, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_bindingCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (((bindingCount))) {
+        uint8_t* cgen_var_0_ptr = (uint8_t*)(*streamPtrPtr);
+        for (uint32_t k = 0; k < ((bindingCount)); ++k) {
+            uint64_t tmpval = get_host_u64_VkBuffer(local_pBuffers[k]);
+            memcpy(cgen_var_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+        }
+        *streamPtrPtr += 8 * ((bindingCount));
+    }
+    memcpy(*streamPtrPtr, (VkDeviceSize*)local_pOffsets, ((bindingCount)) * sizeof(VkDeviceSize));
+    *streamPtrPtr += ((bindingCount)) * sizeof(VkDeviceSize);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pSizes;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pSizes) {
+        memcpy(*streamPtrPtr, (VkDeviceSize*)local_pSizes, ((bindingCount)) * sizeof(VkDeviceSize));
+        *streamPtrPtr += ((bindingCount)) * sizeof(VkDeviceSize);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdBindTransformFeedbackBuffersEXT),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdBeginTransformFeedbackEXT(
+    VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount,
+    const VkBuffer* pCounterBuffers, const VkDeviceSize* pCounterBufferOffsets, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdBeginTransformFeedbackEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdBeginTransformFeedbackEXT(commandBuffer:%p, firstCounterBuffer:%d, "
+        "counterBufferCount:%d, pCounterBuffers:%p, pCounterBufferOffsets:%p)",
+        commandBuffer, firstCounterBuffer, counterBufferCount, pCounterBuffers,
+        pCounterBufferOffsets);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_firstCounterBuffer;
+    uint32_t local_counterBufferCount;
+    VkBuffer* local_pCounterBuffers;
+    VkDeviceSize* local_pCounterBufferOffsets;
+    local_commandBuffer = commandBuffer;
+    local_firstCounterBuffer = firstCounterBuffer;
+    local_counterBufferCount = counterBufferCount;
+    // Avoiding deepcopy for pCounterBuffers
+    local_pCounterBuffers = (VkBuffer*)pCounterBuffers;
+    // Avoiding deepcopy for pCounterBufferOffsets
+    local_pCounterBufferOffsets = (VkDeviceSize*)pCounterBufferOffsets;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pCounterBuffers) {
+            if (((counterBufferCount))) {
+                *countPtr += ((counterBufferCount)) * 8;
+            }
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pCounterBufferOffsets) {
+            *countPtr += ((counterBufferCount)) * sizeof(VkDeviceSize);
+        }
+    }
+    uint32_t packetSize_vkCmdBeginTransformFeedbackEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdBeginTransformFeedbackEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdBeginTransformFeedbackEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdBeginTransformFeedbackEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdBeginTransformFeedbackEXT = OP_vkCmdBeginTransformFeedbackEXT;
+    memcpy(streamPtr, &opcode_vkCmdBeginTransformFeedbackEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdBeginTransformFeedbackEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstCounterBuffer, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_counterBufferCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)local_pCounterBuffers;
+    memcpy((*streamPtrPtr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pCounterBuffers) {
+        if (((counterBufferCount))) {
+            uint8_t* cgen_var_0_0_ptr = (uint8_t*)(*streamPtrPtr);
+            for (uint32_t k = 0; k < ((counterBufferCount)); ++k) {
+                uint64_t tmpval = get_host_u64_VkBuffer(local_pCounterBuffers[k]);
+                memcpy(cgen_var_0_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+            }
+            *streamPtrPtr += 8 * ((counterBufferCount));
+        }
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pCounterBufferOffsets;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pCounterBufferOffsets) {
+        memcpy(*streamPtrPtr, (VkDeviceSize*)local_pCounterBufferOffsets,
+               ((counterBufferCount)) * sizeof(VkDeviceSize));
+        *streamPtrPtr += ((counterBufferCount)) * sizeof(VkDeviceSize);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdBeginTransformFeedbackEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdEndTransformFeedbackEXT(
+    VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount,
+    const VkBuffer* pCounterBuffers, const VkDeviceSize* pCounterBufferOffsets, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdEndTransformFeedbackEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdEndTransformFeedbackEXT(commandBuffer:%p, firstCounterBuffer:%d, "
+        "counterBufferCount:%d, pCounterBuffers:%p, pCounterBufferOffsets:%p)",
+        commandBuffer, firstCounterBuffer, counterBufferCount, pCounterBuffers,
+        pCounterBufferOffsets);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_firstCounterBuffer;
+    uint32_t local_counterBufferCount;
+    VkBuffer* local_pCounterBuffers;
+    VkDeviceSize* local_pCounterBufferOffsets;
+    local_commandBuffer = commandBuffer;
+    local_firstCounterBuffer = firstCounterBuffer;
+    local_counterBufferCount = counterBufferCount;
+    // Avoiding deepcopy for pCounterBuffers
+    local_pCounterBuffers = (VkBuffer*)pCounterBuffers;
+    // Avoiding deepcopy for pCounterBufferOffsets
+    local_pCounterBufferOffsets = (VkDeviceSize*)pCounterBufferOffsets;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pCounterBuffers) {
+            if (((counterBufferCount))) {
+                *countPtr += ((counterBufferCount)) * 8;
+            }
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pCounterBufferOffsets) {
+            *countPtr += ((counterBufferCount)) * sizeof(VkDeviceSize);
+        }
+    }
+    uint32_t packetSize_vkCmdEndTransformFeedbackEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdEndTransformFeedbackEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdEndTransformFeedbackEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdEndTransformFeedbackEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdEndTransformFeedbackEXT = OP_vkCmdEndTransformFeedbackEXT;
+    memcpy(streamPtr, &opcode_vkCmdEndTransformFeedbackEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdEndTransformFeedbackEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstCounterBuffer, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_counterBufferCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)local_pCounterBuffers;
+    memcpy((*streamPtrPtr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pCounterBuffers) {
+        if (((counterBufferCount))) {
+            uint8_t* cgen_var_0_0_ptr = (uint8_t*)(*streamPtrPtr);
+            for (uint32_t k = 0; k < ((counterBufferCount)); ++k) {
+                uint64_t tmpval = get_host_u64_VkBuffer(local_pCounterBuffers[k]);
+                memcpy(cgen_var_0_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+            }
+            *streamPtrPtr += 8 * ((counterBufferCount));
+        }
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pCounterBufferOffsets;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pCounterBufferOffsets) {
+        memcpy(*streamPtrPtr, (VkDeviceSize*)local_pCounterBufferOffsets,
+               ((counterBufferCount)) * sizeof(VkDeviceSize));
+        *streamPtrPtr += ((counterBufferCount)) * sizeof(VkDeviceSize);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdEndTransformFeedbackEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdBeginQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool,
+                                          uint32_t query, VkQueryControlFlags flags, uint32_t index,
+                                          uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdBeginQueryIndexedEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdBeginQueryIndexedEXT(commandBuffer:%p, queryPool:%p, query:%d, flags:%d, index:%d)",
+        commandBuffer, queryPool, query, flags, index);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkQueryPool local_queryPool;
+    uint32_t local_query;
+    VkQueryControlFlags local_flags;
+    uint32_t local_index;
+    local_commandBuffer = commandBuffer;
+    local_queryPool = queryPool;
+    local_query = query;
+    local_flags = flags;
+    local_index = index;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(VkQueryControlFlags);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdBeginQueryIndexedEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdBeginQueryIndexedEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdBeginQueryIndexedEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdBeginQueryIndexedEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdBeginQueryIndexedEXT = OP_vkCmdBeginQueryIndexedEXT;
+    memcpy(streamPtr, &opcode_vkCmdBeginQueryIndexedEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdBeginQueryIndexedEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkQueryPool((*&local_queryPool));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_query, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (VkQueryControlFlags*)&local_flags, sizeof(VkQueryControlFlags));
+    *streamPtrPtr += sizeof(VkQueryControlFlags);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_index, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdBeginQueryIndexedEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdEndQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool,
+                                        uint32_t query, uint32_t index, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdEndQueryIndexedEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdEndQueryIndexedEXT(commandBuffer:%p, queryPool:%p, query:%d, index:%d)",
+                      commandBuffer, queryPool, query, index);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkQueryPool local_queryPool;
+    uint32_t local_query;
+    uint32_t local_index;
+    local_commandBuffer = commandBuffer;
+    local_queryPool = queryPool;
+    local_query = query;
+    local_index = index;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdEndQueryIndexedEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdEndQueryIndexedEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdEndQueryIndexedEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdEndQueryIndexedEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdEndQueryIndexedEXT = OP_vkCmdEndQueryIndexedEXT;
+    memcpy(streamPtr, &opcode_vkCmdEndQueryIndexedEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdEndQueryIndexedEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkQueryPool((*&local_queryPool));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_query, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_index, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdEndQueryIndexedEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdDrawIndirectByteCountEXT(VkCommandBuffer commandBuffer, uint32_t instanceCount,
+                                              uint32_t firstInstance, VkBuffer counterBuffer,
+                                              VkDeviceSize counterBufferOffset,
+                                              uint32_t counterOffset, uint32_t vertexStride,
+                                              uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdDrawIndirectByteCountEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdDrawIndirectByteCountEXT(commandBuffer:%p, instanceCount:%d, firstInstance:%d, "
+        "counterBuffer:%p, counterBufferOffset:%ld, counterOffset:%d, vertexStride:%d)",
+        commandBuffer, instanceCount, firstInstance, counterBuffer, counterBufferOffset,
+        counterOffset, vertexStride);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_instanceCount;
+    uint32_t local_firstInstance;
+    VkBuffer local_counterBuffer;
+    VkDeviceSize local_counterBufferOffset;
+    uint32_t local_counterOffset;
+    uint32_t local_vertexStride;
+    local_commandBuffer = commandBuffer;
+    local_instanceCount = instanceCount;
+    local_firstInstance = firstInstance;
+    local_counterBuffer = counterBuffer;
+    local_counterBufferOffset = counterBufferOffset;
+    local_counterOffset = counterOffset;
+    local_vertexStride = vertexStride;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdDrawIndirectByteCountEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdDrawIndirectByteCountEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdDrawIndirectByteCountEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdDrawIndirectByteCountEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdDrawIndirectByteCountEXT = OP_vkCmdDrawIndirectByteCountEXT;
+    memcpy(streamPtr, &opcode_vkCmdDrawIndirectByteCountEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdDrawIndirectByteCountEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_instanceCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstInstance, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&local_counterBuffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_counterBufferOffset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_counterOffset, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_vertexStride, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdDrawIndirectByteCountEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_NVX_binary_import
+VkResult VkEncoder::vkCreateCuModuleNVX(VkDevice device, const VkCuModuleCreateInfoNVX* pCreateInfo,
+                                        const VkAllocationCallbacks* pAllocator,
+                                        VkCuModuleNVX* pModule, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateCuModuleNVX in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCreateCuModuleNVX(device:%p, pCreateInfo:%p, pAllocator:%p, pModule:%p)",
+                      device, pCreateInfo, pAllocator, pModule);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkCuModuleCreateInfoNVX* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo =
+            (VkCuModuleCreateInfoNVX*)pool->alloc(sizeof(const VkCuModuleCreateInfoNVX));
+        deepcopy_VkCuModuleCreateInfoNVX(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                         (VkCuModuleCreateInfoNVX*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkCuModuleCreateInfoNVX(sResourceTracker,
+                                                 (VkCuModuleCreateInfoNVX*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkCuModuleCreateInfoNVX(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                      (VkCuModuleCreateInfoNVX*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateCuModuleNVX =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateCuModuleNVX);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateCuModuleNVX);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateCuModuleNVX = OP_vkCreateCuModuleNVX;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateCuModuleNVX, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateCuModuleNVX, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkCuModuleCreateInfoNVX(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                            (VkCuModuleCreateInfoNVX*)(local_pCreateInfo),
+                                            streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    uint64_t cgen_var_2 = (uint64_t)(*pModule);
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateCuModuleNVX), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    (*pModule) = (VkCuModuleNVX)stream->getBe64();
+    VkResult vkCreateCuModuleNVX_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateCuModuleNVX_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateCuModuleNVX_VkResult_return;
+}
+
+VkResult VkEncoder::vkCreateCuFunctionNVX(VkDevice device,
+                                          const VkCuFunctionCreateInfoNVX* pCreateInfo,
+                                          const VkAllocationCallbacks* pAllocator,
+                                          VkCuFunctionNVX* pFunction, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateCuFunctionNVX in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateCuFunctionNVX(device:%p, pCreateInfo:%p, pAllocator:%p, pFunction:%p)", device,
+        pCreateInfo, pAllocator, pFunction);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkCuFunctionCreateInfoNVX* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo =
+            (VkCuFunctionCreateInfoNVX*)pool->alloc(sizeof(const VkCuFunctionCreateInfoNVX));
+        deepcopy_VkCuFunctionCreateInfoNVX(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                           (VkCuFunctionCreateInfoNVX*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkCuFunctionCreateInfoNVX(sResourceTracker,
+                                                   (VkCuFunctionCreateInfoNVX*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkCuFunctionCreateInfoNVX(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkCuFunctionCreateInfoNVX*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateCuFunctionNVX =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateCuFunctionNVX);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateCuFunctionNVX);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateCuFunctionNVX = OP_vkCreateCuFunctionNVX;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateCuFunctionNVX, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateCuFunctionNVX, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkCuFunctionCreateInfoNVX(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkCuFunctionCreateInfoNVX*)(local_pCreateInfo),
+                                              streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    uint64_t cgen_var_2 = (uint64_t)(*pFunction);
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateCuFunctionNVX), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    (*pFunction) = (VkCuFunctionNVX)stream->getBe64();
+    VkResult vkCreateCuFunctionNVX_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateCuFunctionNVX_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateCuFunctionNVX_VkResult_return;
+}
+
+void VkEncoder::vkDestroyCuModuleNVX(VkDevice device, VkCuModuleNVX module,
+                                     const VkAllocationCallbacks* pAllocator, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyCuModuleNVX in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroyCuModuleNVX(device:%p, pAllocator:%p)", device, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkCuModuleNVX local_module;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_module = module;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyCuModuleNVX =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDestroyCuModuleNVX);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyCuModuleNVX);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyCuModuleNVX = OP_vkDestroyCuModuleNVX;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyCuModuleNVX, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyCuModuleNVX, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1 = (uint64_t)local_module;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroyCuModuleNVX), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkDestroyCuFunctionNVX(VkDevice device, VkCuFunctionNVX function,
+                                       const VkAllocationCallbacks* pAllocator, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyCuFunctionNVX in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroyCuFunctionNVX(device:%p, pAllocator:%p)", device, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkCuFunctionNVX local_function;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_function = function;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyCuFunctionNVX =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDestroyCuFunctionNVX);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyCuFunctionNVX);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyCuFunctionNVX = OP_vkDestroyCuFunctionNVX;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyCuFunctionNVX, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyCuFunctionNVX, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1 = (uint64_t)local_function;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroyCuFunctionNVX), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdCuLaunchKernelNVX(VkCommandBuffer commandBuffer,
+                                       const VkCuLaunchInfoNVX* pLaunchInfo, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdCuLaunchKernelNVX in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdCuLaunchKernelNVX(commandBuffer:%p, pLaunchInfo:%p)", commandBuffer,
+                      pLaunchInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkCuLaunchInfoNVX* local_pLaunchInfo;
+    local_commandBuffer = commandBuffer;
+    local_pLaunchInfo = nullptr;
+    if (pLaunchInfo) {
+        local_pLaunchInfo = (VkCuLaunchInfoNVX*)pool->alloc(sizeof(const VkCuLaunchInfoNVX));
+        deepcopy_VkCuLaunchInfoNVX(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pLaunchInfo,
+                                   (VkCuLaunchInfoNVX*)(local_pLaunchInfo));
+    }
+    if (local_pLaunchInfo) {
+        transform_tohost_VkCuLaunchInfoNVX(sResourceTracker,
+                                           (VkCuLaunchInfoNVX*)(local_pLaunchInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkCuLaunchInfoNVX(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                (VkCuLaunchInfoNVX*)(local_pLaunchInfo), countPtr);
+    }
+    uint32_t packetSize_vkCmdCuLaunchKernelNVX = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdCuLaunchKernelNVX);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdCuLaunchKernelNVX -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdCuLaunchKernelNVX);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdCuLaunchKernelNVX = OP_vkCmdCuLaunchKernelNVX;
+    memcpy(streamPtr, &opcode_vkCmdCuLaunchKernelNVX, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdCuLaunchKernelNVX, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkCuLaunchInfoNVX(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                      (VkCuLaunchInfoNVX*)(local_pLaunchInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdCuLaunchKernelNVX), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_NVX_image_view_handle
+uint32_t VkEncoder::vkGetImageViewHandleNVX(VkDevice device, const VkImageViewHandleInfoNVX* pInfo,
+                                            uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetImageViewHandleNVX in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetImageViewHandleNVX(device:%p, pInfo:%p)", device, pInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkImageViewHandleInfoNVX* local_pInfo;
+    local_device = device;
+    local_pInfo = nullptr;
+    if (pInfo) {
+        local_pInfo =
+            (VkImageViewHandleInfoNVX*)pool->alloc(sizeof(const VkImageViewHandleInfoNVX));
+        deepcopy_VkImageViewHandleInfoNVX(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfo,
+                                          (VkImageViewHandleInfoNVX*)(local_pInfo));
+    }
+    if (local_pInfo) {
+        transform_tohost_VkImageViewHandleInfoNVX(sResourceTracker,
+                                                  (VkImageViewHandleInfoNVX*)(local_pInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkImageViewHandleInfoNVX(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkImageViewHandleInfoNVX*)(local_pInfo), countPtr);
+    }
+    uint32_t packetSize_vkGetImageViewHandleNVX =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetImageViewHandleNVX);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetImageViewHandleNVX);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetImageViewHandleNVX = OP_vkGetImageViewHandleNVX;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetImageViewHandleNVX, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetImageViewHandleNVX, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkImageViewHandleInfoNVX(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkImageViewHandleInfoNVX*)(local_pInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetImageViewHandleNVX), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    uint32_t vkGetImageViewHandleNVX_uint32_t_return = (uint32_t)0;
+    stream->read(&vkGetImageViewHandleNVX_uint32_t_return, sizeof(uint32_t));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetImageViewHandleNVX_uint32_t_return;
+}
+
+VkResult VkEncoder::vkGetImageViewAddressNVX(VkDevice device, VkImageView imageView,
+                                             VkImageViewAddressPropertiesNVX* pProperties,
+                                             uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetImageViewAddressNVX in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetImageViewAddressNVX(device:%p, imageView:%p, pProperties:%p)", device,
+                      imageView, pProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkImageView local_imageView;
+    local_device = device;
+    local_imageView = imageView;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        count_VkImageViewAddressPropertiesNVX(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkImageViewAddressPropertiesNVX*)(pProperties),
+                                              countPtr);
+    }
+    uint32_t packetSize_vkGetImageViewAddressNVX =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetImageViewAddressNVX);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetImageViewAddressNVX);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetImageViewAddressNVX = OP_vkGetImageViewAddressNVX;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetImageViewAddressNVX, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetImageViewAddressNVX, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkImageView((*&local_imageView));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkImageViewAddressPropertiesNVX(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                    (VkImageViewAddressPropertiesNVX*)(pProperties),
+                                                    streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetImageViewAddressNVX), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkImageViewAddressPropertiesNVX(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkImageViewAddressPropertiesNVX*)(pProperties));
+    if (pProperties) {
+        transform_fromhost_VkImageViewAddressPropertiesNVX(
+            sResourceTracker, (VkImageViewAddressPropertiesNVX*)(pProperties));
+    }
+    VkResult vkGetImageViewAddressNVX_VkResult_return = (VkResult)0;
+    stream->read(&vkGetImageViewAddressNVX_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetImageViewAddressNVX_VkResult_return;
+}
+
+#endif
+#ifdef VK_AMD_draw_indirect_count
+void VkEncoder::vkCmdDrawIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                          VkDeviceSize offset, VkBuffer countBuffer,
+                                          VkDeviceSize countBufferOffset, uint32_t maxDrawCount,
+                                          uint32_t stride, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdDrawIndirectCountAMD in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdDrawIndirectCountAMD(commandBuffer:%p, buffer:%p, offset:%ld, countBuffer:%p, "
+        "countBufferOffset:%ld, maxDrawCount:%d, stride:%d)",
+        commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkBuffer local_buffer;
+    VkDeviceSize local_offset;
+    VkBuffer local_countBuffer;
+    VkDeviceSize local_countBufferOffset;
+    uint32_t local_maxDrawCount;
+    uint32_t local_stride;
+    local_commandBuffer = commandBuffer;
+    local_buffer = buffer;
+    local_offset = offset;
+    local_countBuffer = countBuffer;
+    local_countBufferOffset = countBufferOffset;
+    local_maxDrawCount = maxDrawCount;
+    local_stride = stride;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        uint64_t cgen_var_2;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdDrawIndirectCountAMD = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdDrawIndirectCountAMD);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdDrawIndirectCountAMD -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdDrawIndirectCountAMD);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdDrawIndirectCountAMD = OP_vkCmdDrawIndirectCountAMD;
+    memcpy(streamPtr, &opcode_vkCmdDrawIndirectCountAMD, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdDrawIndirectCountAMD, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&local_buffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkBuffer((*&local_countBuffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_stride, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdDrawIndirectCountAMD), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdDrawIndexedIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                                 VkDeviceSize offset, VkBuffer countBuffer,
+                                                 VkDeviceSize countBufferOffset,
+                                                 uint32_t maxDrawCount, uint32_t stride,
+                                                 uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdDrawIndexedIndirectCountAMD in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdDrawIndexedIndirectCountAMD(commandBuffer:%p, buffer:%p, offset:%ld, countBuffer:%p, "
+        "countBufferOffset:%ld, maxDrawCount:%d, stride:%d)",
+        commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkBuffer local_buffer;
+    VkDeviceSize local_offset;
+    VkBuffer local_countBuffer;
+    VkDeviceSize local_countBufferOffset;
+    uint32_t local_maxDrawCount;
+    uint32_t local_stride;
+    local_commandBuffer = commandBuffer;
+    local_buffer = buffer;
+    local_offset = offset;
+    local_countBuffer = countBuffer;
+    local_countBufferOffset = countBufferOffset;
+    local_maxDrawCount = maxDrawCount;
+    local_stride = stride;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        uint64_t cgen_var_2;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdDrawIndexedIndirectCountAMD = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdDrawIndexedIndirectCountAMD);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdDrawIndexedIndirectCountAMD -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdDrawIndexedIndirectCountAMD);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdDrawIndexedIndirectCountAMD = OP_vkCmdDrawIndexedIndirectCountAMD;
+    memcpy(streamPtr, &opcode_vkCmdDrawIndexedIndirectCountAMD, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdDrawIndexedIndirectCountAMD, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&local_buffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkBuffer((*&local_countBuffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_stride, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdDrawIndexedIndirectCountAMD), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_AMD_negative_viewport_height
+#endif
+#ifdef VK_AMD_gpu_shader_half_float
+#endif
+#ifdef VK_AMD_shader_ballot
+#endif
+#ifdef VK_EXT_video_encode_h264
+#endif
+#ifdef VK_EXT_video_encode_h265
+#endif
+#ifdef VK_EXT_video_decode_h264
+#endif
+#ifdef VK_AMD_texture_gather_bias_lod
+#endif
+#ifdef VK_AMD_shader_info
+VkResult VkEncoder::vkGetShaderInfoAMD(VkDevice device, VkPipeline pipeline,
+                                       VkShaderStageFlagBits shaderStage,
+                                       VkShaderInfoTypeAMD infoType, size_t* pInfoSize, void* pInfo,
+                                       uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetShaderInfoAMD in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetShaderInfoAMD(device:%p, pipeline:%p, pInfoSize:%p, pInfo:%p)", device,
+                      pipeline, pInfoSize, pInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkPipeline local_pipeline;
+    VkShaderStageFlagBits local_shaderStage;
+    VkShaderInfoTypeAMD local_infoType;
+    local_device = device;
+    local_pipeline = pipeline;
+    local_shaderStage = shaderStage;
+    local_infoType = infoType;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkShaderStageFlagBits);
+        *countPtr += sizeof(VkShaderInfoTypeAMD);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pInfoSize) {
+            *countPtr += 8;
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pInfo) {
+            if (pInfoSize) {
+                *countPtr += (*(pInfoSize)) * sizeof(uint8_t);
+            }
+        }
+    }
+    uint32_t packetSize_vkGetShaderInfoAMD =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetShaderInfoAMD);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetShaderInfoAMD);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetShaderInfoAMD = OP_vkGetShaderInfoAMD;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetShaderInfoAMD, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetShaderInfoAMD, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkPipeline((*&local_pipeline));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkShaderStageFlagBits*)&local_shaderStage,
+           sizeof(VkShaderStageFlagBits));
+    *streamPtrPtr += sizeof(VkShaderStageFlagBits);
+    memcpy(*streamPtrPtr, (VkShaderInfoTypeAMD*)&local_infoType, sizeof(VkShaderInfoTypeAMD));
+    *streamPtrPtr += sizeof(VkShaderInfoTypeAMD);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pInfoSize;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pInfoSize) {
+        uint64_t cgen_var_2_0 = (uint64_t)(*pInfoSize);
+        memcpy((*streamPtrPtr), &cgen_var_2_0, 8);
+        android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+        *streamPtrPtr += 8;
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_3 = (uint64_t)(uintptr_t)pInfo;
+    memcpy((*streamPtrPtr), &cgen_var_3, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pInfo) {
+        memcpy(*streamPtrPtr, (void*)pInfo, (*(pInfoSize)) * sizeof(uint8_t));
+        *streamPtrPtr += (*(pInfoSize)) * sizeof(uint8_t);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetShaderInfoAMD), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    size_t* check_pInfoSize;
+    check_pInfoSize = (size_t*)(uintptr_t)stream->getBe64();
+    if (pInfoSize) {
+        if (!(check_pInfoSize)) {
+            fprintf(stderr, "fatal: pInfoSize inconsistent between guest and host\n");
+        }
+        (*pInfoSize) = (size_t)stream->getBe64();
+    }
+    // WARNING PTR CHECK
+    void* check_pInfo;
+    check_pInfo = (void*)(uintptr_t)stream->getBe64();
+    if (pInfo) {
+        if (!(check_pInfo)) {
+            fprintf(stderr, "fatal: pInfo inconsistent between guest and host\n");
+        }
+        stream->read((void*)pInfo, (*(pInfoSize)) * sizeof(uint8_t));
+    }
+    VkResult vkGetShaderInfoAMD_VkResult_return = (VkResult)0;
+    stream->read(&vkGetShaderInfoAMD_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetShaderInfoAMD_VkResult_return;
+}
+
+#endif
+#ifdef VK_AMD_shader_image_load_store_lod
+#endif
+#ifdef VK_GGP_stream_descriptor_surface
+VkResult VkEncoder::vkCreateStreamDescriptorSurfaceGGP(
+    VkInstance instance, const VkStreamDescriptorSurfaceCreateInfoGGP* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateStreamDescriptorSurfaceGGP in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateStreamDescriptorSurfaceGGP(instance:%p, pCreateInfo:%p, pAllocator:%p, "
+        "pSurface:%p)",
+        instance, pCreateInfo, pAllocator, pSurface);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkInstance local_instance;
+    VkStreamDescriptorSurfaceCreateInfoGGP* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_instance = instance;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkStreamDescriptorSurfaceCreateInfoGGP*)pool->alloc(
+            sizeof(const VkStreamDescriptorSurfaceCreateInfoGGP));
+        deepcopy_VkStreamDescriptorSurfaceCreateInfoGGP(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+            (VkStreamDescriptorSurfaceCreateInfoGGP*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkStreamDescriptorSurfaceCreateInfoGGP(
+            sResourceTracker, (VkStreamDescriptorSurfaceCreateInfoGGP*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkStreamDescriptorSurfaceCreateInfoGGP(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkStreamDescriptorSurfaceCreateInfoGGP*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateStreamDescriptorSurfaceGGP =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCreateStreamDescriptorSurfaceGGP);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateStreamDescriptorSurfaceGGP);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateStreamDescriptorSurfaceGGP = OP_vkCreateStreamDescriptorSurfaceGGP;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateStreamDescriptorSurfaceGGP, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateStreamDescriptorSurfaceGGP, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkInstance((*&local_instance));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkStreamDescriptorSurfaceCreateInfoGGP(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkStreamDescriptorSurfaceCreateInfoGGP*)(local_pCreateInfo), streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pSurface));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateStreamDescriptorSurfaceGGP), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_3, (VkSurfaceKHR*)pSurface, 1);
+    VkResult vkCreateStreamDescriptorSurfaceGGP_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateStreamDescriptorSurfaceGGP_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateStreamDescriptorSurfaceGGP_VkResult_return;
+}
+
+#endif
+#ifdef VK_NV_corner_sampled_image
+#endif
+#ifdef VK_IMG_format_pvrtc
+#endif
+#ifdef VK_NV_external_memory_capabilities
+VkResult VkEncoder::vkGetPhysicalDeviceExternalImageFormatPropertiesNV(
+    VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling,
+    VkImageUsageFlags usage, VkImageCreateFlags flags,
+    VkExternalMemoryHandleTypeFlagsNV externalHandleType,
+    VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkGetPhysicalDeviceExternalImageFormatPropertiesNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceExternalImageFormatPropertiesNV(physicalDevice:%p, format:%d, "
+        "usage:%d, flags:%d, pExternalImageFormatProperties:%p)",
+        physicalDevice, format, usage, flags, pExternalImageFormatProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkFormat local_format;
+    VkImageType local_type;
+    VkImageTiling local_tiling;
+    VkImageUsageFlags local_usage;
+    VkImageCreateFlags local_flags;
+    VkExternalMemoryHandleTypeFlagsNV local_externalHandleType;
+    local_physicalDevice = physicalDevice;
+    local_format = format;
+    local_type = type;
+    local_tiling = tiling;
+    local_usage = usage;
+    local_flags = flags;
+    local_externalHandleType = externalHandleType;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkFormat);
+        *countPtr += sizeof(VkImageType);
+        *countPtr += sizeof(VkImageTiling);
+        *countPtr += sizeof(VkImageUsageFlags);
+        *countPtr += sizeof(VkImageCreateFlags);
+        *countPtr += sizeof(VkExternalMemoryHandleTypeFlagsNV);
+        count_VkExternalImageFormatPropertiesNV(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties), countPtr);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceExternalImageFormatPropertiesNV =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceExternalImageFormatPropertiesNV);
+    uint8_t* streamPtr =
+        stream->reserve(packetSize_vkGetPhysicalDeviceExternalImageFormatPropertiesNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceExternalImageFormatPropertiesNV =
+        OP_vkGetPhysicalDeviceExternalImageFormatPropertiesNV;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceExternalImageFormatPropertiesNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceExternalImageFormatPropertiesNV,
+           sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkFormat*)&local_format, sizeof(VkFormat));
+    *streamPtrPtr += sizeof(VkFormat);
+    memcpy(*streamPtrPtr, (VkImageType*)&local_type, sizeof(VkImageType));
+    *streamPtrPtr += sizeof(VkImageType);
+    memcpy(*streamPtrPtr, (VkImageTiling*)&local_tiling, sizeof(VkImageTiling));
+    *streamPtrPtr += sizeof(VkImageTiling);
+    memcpy(*streamPtrPtr, (VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags));
+    *streamPtrPtr += sizeof(VkImageUsageFlags);
+    memcpy(*streamPtrPtr, (VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags));
+    *streamPtrPtr += sizeof(VkImageCreateFlags);
+    memcpy(*streamPtrPtr, (VkExternalMemoryHandleTypeFlagsNV*)&local_externalHandleType,
+           sizeof(VkExternalMemoryHandleTypeFlagsNV));
+    *streamPtrPtr += sizeof(VkExternalMemoryHandleTypeFlagsNV);
+    reservedmarshal_VkExternalImageFormatPropertiesNV(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceExternalImageFormatPropertiesNV),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkExternalImageFormatPropertiesNV(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties));
+    if (pExternalImageFormatProperties) {
+        transform_fromhost_VkExternalImageFormatPropertiesNV(
+            sResourceTracker, (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties));
+    }
+    VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return = (VkResult)0;
+    stream->read(&vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return,
+                 sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return;
+}
+
+#endif
+#ifdef VK_NV_external_memory
+#endif
+#ifdef VK_NV_external_memory_win32
+VkResult VkEncoder::vkGetMemoryWin32HandleNV(VkDevice device, VkDeviceMemory memory,
+                                             VkExternalMemoryHandleTypeFlagsNV handleType,
+                                             HANDLE* pHandle, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetMemoryWin32HandleNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetMemoryWin32HandleNV(device:%p, memory:%p, pHandle:%p)", device, memory,
+                      pHandle);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDeviceMemory local_memory;
+    VkExternalMemoryHandleTypeFlagsNV local_handleType;
+    local_device = device;
+    local_memory = memory;
+    local_handleType = handleType;
+    sResourceTracker->deviceMemoryTransform_tohost(
+        (VkDeviceMemory*)&local_memory, 1, (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr, 0,
+        (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0);
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkExternalMemoryHandleTypeFlagsNV);
+        *countPtr += sizeof(HANDLE);
+    }
+    uint32_t packetSize_vkGetMemoryWin32HandleNV =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetMemoryWin32HandleNV);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetMemoryWin32HandleNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetMemoryWin32HandleNV = OP_vkGetMemoryWin32HandleNV;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetMemoryWin32HandleNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetMemoryWin32HandleNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDeviceMemory((*&local_memory));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkExternalMemoryHandleTypeFlagsNV*)&local_handleType,
+           sizeof(VkExternalMemoryHandleTypeFlagsNV));
+    *streamPtrPtr += sizeof(VkExternalMemoryHandleTypeFlagsNV);
+    memcpy(*streamPtrPtr, (HANDLE*)pHandle, sizeof(HANDLE));
+    *streamPtrPtr += sizeof(HANDLE);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetMemoryWin32HandleNV), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((HANDLE*)pHandle, sizeof(HANDLE));
+    VkResult vkGetMemoryWin32HandleNV_VkResult_return = (VkResult)0;
+    stream->read(&vkGetMemoryWin32HandleNV_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetMemoryWin32HandleNV_VkResult_return;
+}
+
+#endif
+#ifdef VK_NV_win32_keyed_mutex
+#endif
+#ifdef VK_EXT_validation_flags
+#endif
+#ifdef VK_NN_vi_surface
+VkResult VkEncoder::vkCreateViSurfaceNN(VkInstance instance,
+                                        const VkViSurfaceCreateInfoNN* pCreateInfo,
+                                        const VkAllocationCallbacks* pAllocator,
+                                        VkSurfaceKHR* pSurface, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateViSurfaceNN in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateViSurfaceNN(instance:%p, pCreateInfo:%p, pAllocator:%p, pSurface:%p)", instance,
+        pCreateInfo, pAllocator, pSurface);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkInstance local_instance;
+    VkViSurfaceCreateInfoNN* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_instance = instance;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo =
+            (VkViSurfaceCreateInfoNN*)pool->alloc(sizeof(const VkViSurfaceCreateInfoNN));
+        deepcopy_VkViSurfaceCreateInfoNN(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                         (VkViSurfaceCreateInfoNN*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkViSurfaceCreateInfoNN(sResourceTracker,
+                                                 (VkViSurfaceCreateInfoNN*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkViSurfaceCreateInfoNN(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                      (VkViSurfaceCreateInfoNN*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateViSurfaceNN =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateViSurfaceNN);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateViSurfaceNN);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateViSurfaceNN = OP_vkCreateViSurfaceNN;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateViSurfaceNN, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateViSurfaceNN, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkInstance((*&local_instance));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkViSurfaceCreateInfoNN(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                            (VkViSurfaceCreateInfoNN*)(local_pCreateInfo),
+                                            streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pSurface));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateViSurfaceNN), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_3, (VkSurfaceKHR*)pSurface, 1);
+    VkResult vkCreateViSurfaceNN_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateViSurfaceNN_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateViSurfaceNN_VkResult_return;
+}
+
+#endif
+#ifdef VK_EXT_shader_subgroup_ballot
+#endif
+#ifdef VK_EXT_shader_subgroup_vote
+#endif
+#ifdef VK_EXT_texture_compression_astc_hdr
+#endif
+#ifdef VK_EXT_astc_decode_mode
+#endif
+#ifdef VK_EXT_conditional_rendering
+void VkEncoder::vkCmdBeginConditionalRenderingEXT(
+    VkCommandBuffer commandBuffer,
+    const VkConditionalRenderingBeginInfoEXT* pConditionalRenderingBegin, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdBeginConditionalRenderingEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdBeginConditionalRenderingEXT(commandBuffer:%p, pConditionalRenderingBegin:%p)",
+        commandBuffer, pConditionalRenderingBegin);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkConditionalRenderingBeginInfoEXT* local_pConditionalRenderingBegin;
+    local_commandBuffer = commandBuffer;
+    local_pConditionalRenderingBegin = nullptr;
+    if (pConditionalRenderingBegin) {
+        local_pConditionalRenderingBegin = (VkConditionalRenderingBeginInfoEXT*)pool->alloc(
+            sizeof(const VkConditionalRenderingBeginInfoEXT));
+        deepcopy_VkConditionalRenderingBeginInfoEXT(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pConditionalRenderingBegin,
+            (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin));
+    }
+    if (local_pConditionalRenderingBegin) {
+        transform_tohost_VkConditionalRenderingBeginInfoEXT(
+            sResourceTracker,
+            (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkConditionalRenderingBeginInfoEXT(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin), countPtr);
+    }
+    uint32_t packetSize_vkCmdBeginConditionalRenderingEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdBeginConditionalRenderingEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdBeginConditionalRenderingEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdBeginConditionalRenderingEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdBeginConditionalRenderingEXT = OP_vkCmdBeginConditionalRenderingEXT;
+    memcpy(streamPtr, &opcode_vkCmdBeginConditionalRenderingEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdBeginConditionalRenderingEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkConditionalRenderingBeginInfoEXT(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdBeginConditionalRenderingEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdEndConditionalRenderingEXT(VkCommandBuffer commandBuffer, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdEndConditionalRenderingEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdEndConditionalRenderingEXT(commandBuffer:%p)", commandBuffer);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    local_commandBuffer = commandBuffer;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkCmdEndConditionalRenderingEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdEndConditionalRenderingEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdEndConditionalRenderingEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdEndConditionalRenderingEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdEndConditionalRenderingEXT = OP_vkCmdEndConditionalRenderingEXT;
+    memcpy(streamPtr, &opcode_vkCmdEndConditionalRenderingEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdEndConditionalRenderingEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdEndConditionalRenderingEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+void VkEncoder::vkCmdSetViewportWScalingNV(VkCommandBuffer commandBuffer, uint32_t firstViewport,
+                                           uint32_t viewportCount,
+                                           const VkViewportWScalingNV* pViewportWScalings,
+                                           uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetViewportWScalingNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdSetViewportWScalingNV(commandBuffer:%p, firstViewport:%d, viewportCount:%d, "
+        "pViewportWScalings:%p)",
+        commandBuffer, firstViewport, viewportCount, pViewportWScalings);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_firstViewport;
+    uint32_t local_viewportCount;
+    VkViewportWScalingNV* local_pViewportWScalings;
+    local_commandBuffer = commandBuffer;
+    local_firstViewport = firstViewport;
+    local_viewportCount = viewportCount;
+    local_pViewportWScalings = nullptr;
+    if (pViewportWScalings) {
+        local_pViewportWScalings = (VkViewportWScalingNV*)pool->alloc(
+            ((viewportCount)) * sizeof(const VkViewportWScalingNV));
+        for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) {
+            deepcopy_VkViewportWScalingNV(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pViewportWScalings + i,
+                                          (VkViewportWScalingNV*)(local_pViewportWScalings + i));
+        }
+    }
+    if (local_pViewportWScalings) {
+        for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) {
+            transform_tohost_VkViewportWScalingNV(
+                sResourceTracker, (VkViewportWScalingNV*)(local_pViewportWScalings + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) {
+            count_VkViewportWScalingNV(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkViewportWScalingNV*)(local_pViewportWScalings + i),
+                                       countPtr);
+        }
+    }
+    uint32_t packetSize_vkCmdSetViewportWScalingNV = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetViewportWScalingNV);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetViewportWScalingNV -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetViewportWScalingNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetViewportWScalingNV = OP_vkCmdSetViewportWScalingNV;
+    memcpy(streamPtr, &opcode_vkCmdSetViewportWScalingNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetViewportWScalingNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstViewport, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_viewportCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) {
+        reservedmarshal_VkViewportWScalingNV(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                             (VkViewportWScalingNV*)(local_pViewportWScalings + i),
+                                             streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetViewportWScalingNV), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_EXT_direct_mode_display
+VkResult VkEncoder::vkReleaseDisplayEXT(VkPhysicalDevice physicalDevice, VkDisplayKHR display,
+                                        uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkReleaseDisplayEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkReleaseDisplayEXT(physicalDevice:%p, display:%p)", physicalDevice,
+                      display);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkDisplayKHR local_display;
+    local_physicalDevice = physicalDevice;
+    local_display = display;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkReleaseDisplayEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkReleaseDisplayEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkReleaseDisplayEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkReleaseDisplayEXT = OP_vkReleaseDisplayEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkReleaseDisplayEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkReleaseDisplayEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDisplayKHR((*&local_display));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkReleaseDisplayEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkReleaseDisplayEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkReleaseDisplayEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkReleaseDisplayEXT_VkResult_return;
+}
+
+#endif
+#ifdef VK_EXT_acquire_xlib_display
+VkResult VkEncoder::vkAcquireXlibDisplayEXT(VkPhysicalDevice physicalDevice, Display* dpy,
+                                            VkDisplayKHR display, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkAcquireXlibDisplayEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkAcquireXlibDisplayEXT(physicalDevice:%p, dpy:%p, display:%p)",
+                      physicalDevice, dpy, display);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkDisplayKHR local_display;
+    local_physicalDevice = physicalDevice;
+    local_display = display;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(Display);
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkAcquireXlibDisplayEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkAcquireXlibDisplayEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkAcquireXlibDisplayEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkAcquireXlibDisplayEXT = OP_vkAcquireXlibDisplayEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkAcquireXlibDisplayEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkAcquireXlibDisplayEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (Display*)dpy, sizeof(Display));
+    *streamPtrPtr += sizeof(Display);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDisplayKHR((*&local_display));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkAcquireXlibDisplayEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((Display*)dpy, sizeof(Display));
+    VkResult vkAcquireXlibDisplayEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkAcquireXlibDisplayEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkAcquireXlibDisplayEXT_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetRandROutputDisplayEXT(VkPhysicalDevice physicalDevice, Display* dpy,
+                                               RROutput rrOutput, VkDisplayKHR* pDisplay,
+                                               uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetRandROutputDisplayEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetRandROutputDisplayEXT(physicalDevice:%p, dpy:%p, pDisplay:%p)",
+                      physicalDevice, dpy, pDisplay);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    RROutput local_rrOutput;
+    local_physicalDevice = physicalDevice;
+    local_rrOutput = rrOutput;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(Display);
+        *countPtr += sizeof(RROutput);
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkGetRandROutputDisplayEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetRandROutputDisplayEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetRandROutputDisplayEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetRandROutputDisplayEXT = OP_vkGetRandROutputDisplayEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetRandROutputDisplayEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetRandROutputDisplayEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (Display*)dpy, sizeof(Display));
+    *streamPtrPtr += sizeof(Display);
+    memcpy(*streamPtrPtr, (RROutput*)&local_rrOutput, sizeof(RROutput));
+    *streamPtrPtr += sizeof(RROutput);
+    /* is handle, possibly out */;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = (uint64_t)((*pDisplay));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetRandROutputDisplayEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((Display*)dpy, sizeof(Display));
+    uint64_t cgen_var_2;
+    stream->read((uint64_t*)&cgen_var_2, 8);
+    stream->handleMapping()->mapHandles_u64_VkDisplayKHR(&cgen_var_2, (VkDisplayKHR*)pDisplay, 1);
+    VkResult vkGetRandROutputDisplayEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkGetRandROutputDisplayEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetRandROutputDisplayEXT_VkResult_return;
+}
+
+#endif
+#ifdef VK_EXT_display_surface_counter
+VkResult VkEncoder::vkGetPhysicalDeviceSurfaceCapabilities2EXT(
+    VkPhysicalDevice physicalDevice, VkSurfaceKHR surface,
+    VkSurfaceCapabilities2EXT* pSurfaceCapabilities, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceSurfaceCapabilities2EXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceSurfaceCapabilities2EXT(physicalDevice:%p, surface:%p, "
+        "pSurfaceCapabilities:%p)",
+        physicalDevice, surface, pSurfaceCapabilities);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkSurfaceKHR local_surface;
+    local_physicalDevice = physicalDevice;
+    local_surface = surface;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        count_VkSurfaceCapabilities2EXT(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities),
+                                        countPtr);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceSurfaceCapabilities2EXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceSurfaceCapabilities2EXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceSurfaceCapabilities2EXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilities2EXT =
+        OP_vkGetPhysicalDeviceSurfaceCapabilities2EXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceSurfaceCapabilities2EXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceSurfaceCapabilities2EXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkSurfaceKHR((*&local_surface));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkSurfaceCapabilities2EXT(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities),
+                                              streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceSurfaceCapabilities2EXT),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkSurfaceCapabilities2EXT(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities));
+    if (pSurfaceCapabilities) {
+        transform_fromhost_VkSurfaceCapabilities2EXT(
+            sResourceTracker, (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities));
+    }
+    VkResult vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return = (VkResult)0;
+    stream->read(&vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return;
+}
+
+#endif
+#ifdef VK_EXT_display_control
+VkResult VkEncoder::vkDisplayPowerControlEXT(VkDevice device, VkDisplayKHR display,
+                                             const VkDisplayPowerInfoEXT* pDisplayPowerInfo,
+                                             uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDisplayPowerControlEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDisplayPowerControlEXT(device:%p, display:%p, pDisplayPowerInfo:%p)",
+                      device, display, pDisplayPowerInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDisplayKHR local_display;
+    VkDisplayPowerInfoEXT* local_pDisplayPowerInfo;
+    local_device = device;
+    local_display = display;
+    local_pDisplayPowerInfo = nullptr;
+    if (pDisplayPowerInfo) {
+        local_pDisplayPowerInfo =
+            (VkDisplayPowerInfoEXT*)pool->alloc(sizeof(const VkDisplayPowerInfoEXT));
+        deepcopy_VkDisplayPowerInfoEXT(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pDisplayPowerInfo,
+                                       (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo));
+    }
+    if (local_pDisplayPowerInfo) {
+        transform_tohost_VkDisplayPowerInfoEXT(sResourceTracker,
+                                               (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        count_VkDisplayPowerInfoEXT(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo), countPtr);
+    }
+    uint32_t packetSize_vkDisplayPowerControlEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDisplayPowerControlEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDisplayPowerControlEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDisplayPowerControlEXT = OP_vkDisplayPowerControlEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDisplayPowerControlEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDisplayPowerControlEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDisplayKHR((*&local_display));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDisplayPowerInfoEXT(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo),
+                                          streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDisplayPowerControlEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkDisplayPowerControlEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkDisplayPowerControlEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkDisplayPowerControlEXT_VkResult_return;
+}
+
+VkResult VkEncoder::vkRegisterDeviceEventEXT(VkDevice device,
+                                             const VkDeviceEventInfoEXT* pDeviceEventInfo,
+                                             const VkAllocationCallbacks* pAllocator,
+                                             VkFence* pFence, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkRegisterDeviceEventEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkRegisterDeviceEventEXT(device:%p, pDeviceEventInfo:%p, pAllocator:%p, pFence:%p)",
+        device, pDeviceEventInfo, pAllocator, pFence);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDeviceEventInfoEXT* local_pDeviceEventInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pDeviceEventInfo = nullptr;
+    if (pDeviceEventInfo) {
+        local_pDeviceEventInfo =
+            (VkDeviceEventInfoEXT*)pool->alloc(sizeof(const VkDeviceEventInfoEXT));
+        deepcopy_VkDeviceEventInfoEXT(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pDeviceEventInfo,
+                                      (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pDeviceEventInfo) {
+        transform_tohost_VkDeviceEventInfoEXT(sResourceTracker,
+                                              (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDeviceEventInfoEXT(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                   (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkRegisterDeviceEventEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkRegisterDeviceEventEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkRegisterDeviceEventEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkRegisterDeviceEventEXT = OP_vkRegisterDeviceEventEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkRegisterDeviceEventEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkRegisterDeviceEventEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDeviceEventInfoEXT(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo),
+                                         streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pFence));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkRegisterDeviceEventEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkFence(&cgen_var_3, (VkFence*)pFence, 1);
+    VkResult vkRegisterDeviceEventEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkRegisterDeviceEventEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkRegisterDeviceEventEXT_VkResult_return;
+}
+
+VkResult VkEncoder::vkRegisterDisplayEventEXT(VkDevice device, VkDisplayKHR display,
+                                              const VkDisplayEventInfoEXT* pDisplayEventInfo,
+                                              const VkAllocationCallbacks* pAllocator,
+                                              VkFence* pFence, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkRegisterDisplayEventEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkRegisterDisplayEventEXT(device:%p, display:%p, pDisplayEventInfo:%p, pAllocator:%p, "
+        "pFence:%p)",
+        device, display, pDisplayEventInfo, pAllocator, pFence);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDisplayKHR local_display;
+    VkDisplayEventInfoEXT* local_pDisplayEventInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_display = display;
+    local_pDisplayEventInfo = nullptr;
+    if (pDisplayEventInfo) {
+        local_pDisplayEventInfo =
+            (VkDisplayEventInfoEXT*)pool->alloc(sizeof(const VkDisplayEventInfoEXT));
+        deepcopy_VkDisplayEventInfoEXT(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pDisplayEventInfo,
+                                       (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pDisplayEventInfo) {
+        transform_tohost_VkDisplayEventInfoEXT(sResourceTracker,
+                                               (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        count_VkDisplayEventInfoEXT(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_2;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkRegisterDisplayEventEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkRegisterDisplayEventEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkRegisterDisplayEventEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkRegisterDisplayEventEXT = OP_vkRegisterDisplayEventEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkRegisterDisplayEventEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkRegisterDisplayEventEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDisplayKHR((*&local_display));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDisplayEventInfoEXT(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo),
+                                          streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_3;
+    *&cgen_var_3 = (uint64_t)((*pFence));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_3, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkRegisterDisplayEventEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    uint64_t cgen_var_4;
+    stream->read((uint64_t*)&cgen_var_4, 8);
+    stream->handleMapping()->mapHandles_u64_VkFence(&cgen_var_4, (VkFence*)pFence, 1);
+    VkResult vkRegisterDisplayEventEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkRegisterDisplayEventEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkRegisterDisplayEventEXT_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetSwapchainCounterEXT(VkDevice device, VkSwapchainKHR swapchain,
+                                             VkSurfaceCounterFlagBitsEXT counter,
+                                             uint64_t* pCounterValue, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetSwapchainCounterEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetSwapchainCounterEXT(device:%p, swapchain:%p, pCounterValue:%p)", device,
+                      swapchain, pCounterValue);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSwapchainKHR local_swapchain;
+    VkSurfaceCounterFlagBitsEXT local_counter;
+    local_device = device;
+    local_swapchain = swapchain;
+    local_counter = counter;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkSurfaceCounterFlagBitsEXT);
+        *countPtr += sizeof(uint64_t);
+    }
+    uint32_t packetSize_vkGetSwapchainCounterEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetSwapchainCounterEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetSwapchainCounterEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetSwapchainCounterEXT = OP_vkGetSwapchainCounterEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetSwapchainCounterEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetSwapchainCounterEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkSwapchainKHR((*&local_swapchain));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkSurfaceCounterFlagBitsEXT*)&local_counter,
+           sizeof(VkSurfaceCounterFlagBitsEXT));
+    *streamPtrPtr += sizeof(VkSurfaceCounterFlagBitsEXT);
+    memcpy(*streamPtrPtr, (uint64_t*)pCounterValue, sizeof(uint64_t));
+    *streamPtrPtr += sizeof(uint64_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetSwapchainCounterEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((uint64_t*)pCounterValue, sizeof(uint64_t));
+    VkResult vkGetSwapchainCounterEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkGetSwapchainCounterEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetSwapchainCounterEXT_VkResult_return;
+}
+
+#endif
+#ifdef VK_GOOGLE_display_timing
+VkResult VkEncoder::vkGetRefreshCycleDurationGOOGLE(
+    VkDevice device, VkSwapchainKHR swapchain,
+    VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetRefreshCycleDurationGOOGLE in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetRefreshCycleDurationGOOGLE(device:%p, swapchain:%p, pDisplayTimingProperties:%p)",
+        device, swapchain, pDisplayTimingProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSwapchainKHR local_swapchain;
+    local_device = device;
+    local_swapchain = swapchain;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        count_VkRefreshCycleDurationGOOGLE(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties), countPtr);
+    }
+    uint32_t packetSize_vkGetRefreshCycleDurationGOOGLE =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetRefreshCycleDurationGOOGLE);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetRefreshCycleDurationGOOGLE);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetRefreshCycleDurationGOOGLE = OP_vkGetRefreshCycleDurationGOOGLE;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetRefreshCycleDurationGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetRefreshCycleDurationGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkSwapchainKHR((*&local_swapchain));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkRefreshCycleDurationGOOGLE(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetRefreshCycleDurationGOOGLE), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkRefreshCycleDurationGOOGLE(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties));
+    if (pDisplayTimingProperties) {
+        transform_fromhost_VkRefreshCycleDurationGOOGLE(
+            sResourceTracker, (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties));
+    }
+    VkResult vkGetRefreshCycleDurationGOOGLE_VkResult_return = (VkResult)0;
+    stream->read(&vkGetRefreshCycleDurationGOOGLE_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetRefreshCycleDurationGOOGLE_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetPastPresentationTimingGOOGLE(
+    VkDevice device, VkSwapchainKHR swapchain, uint32_t* pPresentationTimingCount,
+    VkPastPresentationTimingGOOGLE* pPresentationTimings, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPastPresentationTimingGOOGLE in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPastPresentationTimingGOOGLE(device:%p, swapchain:%p, pPresentationTimingCount:%p, "
+        "pPresentationTimings:%p)",
+        device, swapchain, pPresentationTimingCount, pPresentationTimings);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSwapchainKHR local_swapchain;
+    local_device = device;
+    local_swapchain = swapchain;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pPresentationTimingCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pPresentationTimings) {
+            if (pPresentationTimingCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i) {
+                    count_VkPastPresentationTimingGOOGLE(
+                        sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                        (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i), countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetPastPresentationTimingGOOGLE =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPastPresentationTimingGOOGLE);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPastPresentationTimingGOOGLE);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPastPresentationTimingGOOGLE = OP_vkGetPastPresentationTimingGOOGLE;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPastPresentationTimingGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPastPresentationTimingGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkSwapchainKHR((*&local_swapchain));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pPresentationTimingCount;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pPresentationTimingCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pPresentationTimingCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_3 = (uint64_t)(uintptr_t)pPresentationTimings;
+    memcpy((*streamPtrPtr), &cgen_var_3, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pPresentationTimings) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i) {
+            reservedmarshal_VkPastPresentationTimingGOOGLE(
+                stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i), streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPastPresentationTimingGOOGLE), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pPresentationTimingCount;
+    check_pPresentationTimingCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pPresentationTimingCount) {
+        if (!(check_pPresentationTimingCount)) {
+            fprintf(stderr,
+                    "fatal: pPresentationTimingCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pPresentationTimingCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkPastPresentationTimingGOOGLE* check_pPresentationTimings;
+    check_pPresentationTimings = (VkPastPresentationTimingGOOGLE*)(uintptr_t)stream->getBe64();
+    if (pPresentationTimings) {
+        if (!(check_pPresentationTimings)) {
+            fprintf(stderr, "fatal: pPresentationTimings inconsistent between guest and host\n");
+        }
+        if (pPresentationTimingCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i) {
+                unmarshal_VkPastPresentationTimingGOOGLE(
+                    stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                    (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i));
+            }
+        }
+    }
+    if (pPresentationTimingCount) {
+        if (pPresentationTimings) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i) {
+                transform_fromhost_VkPastPresentationTimingGOOGLE(
+                    sResourceTracker, (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i));
+            }
+        }
+    }
+    VkResult vkGetPastPresentationTimingGOOGLE_VkResult_return = (VkResult)0;
+    stream->read(&vkGetPastPresentationTimingGOOGLE_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPastPresentationTimingGOOGLE_VkResult_return;
+}
+
+#endif
+#ifdef VK_NV_sample_mask_override_coverage
+#endif
+#ifdef VK_NV_geometry_shader_passthrough
+#endif
+#ifdef VK_NV_viewport_array2
+#endif
+#ifdef VK_NVX_multiview_per_view_attributes
+#endif
+#ifdef VK_NV_viewport_swizzle
+#endif
+#ifdef VK_EXT_discard_rectangles
+void VkEncoder::vkCmdSetDiscardRectangleEXT(VkCommandBuffer commandBuffer,
+                                            uint32_t firstDiscardRectangle,
+                                            uint32_t discardRectangleCount,
+                                            const VkRect2D* pDiscardRectangles, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetDiscardRectangleEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdSetDiscardRectangleEXT(commandBuffer:%p, firstDiscardRectangle:%d, "
+        "discardRectangleCount:%d, pDiscardRectangles:%p)",
+        commandBuffer, firstDiscardRectangle, discardRectangleCount, pDiscardRectangles);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_firstDiscardRectangle;
+    uint32_t local_discardRectangleCount;
+    VkRect2D* local_pDiscardRectangles;
+    local_commandBuffer = commandBuffer;
+    local_firstDiscardRectangle = firstDiscardRectangle;
+    local_discardRectangleCount = discardRectangleCount;
+    local_pDiscardRectangles = nullptr;
+    if (pDiscardRectangles) {
+        local_pDiscardRectangles =
+            (VkRect2D*)pool->alloc(((discardRectangleCount)) * sizeof(const VkRect2D));
+        for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i) {
+            deepcopy_VkRect2D(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pDiscardRectangles + i,
+                              (VkRect2D*)(local_pDiscardRectangles + i));
+        }
+    }
+    if (local_pDiscardRectangles) {
+        for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i) {
+            transform_tohost_VkRect2D(sResourceTracker, (VkRect2D*)(local_pDiscardRectangles + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i) {
+            count_VkRect2D(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                           (VkRect2D*)(local_pDiscardRectangles + i), countPtr);
+        }
+    }
+    uint32_t packetSize_vkCmdSetDiscardRectangleEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetDiscardRectangleEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetDiscardRectangleEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetDiscardRectangleEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetDiscardRectangleEXT = OP_vkCmdSetDiscardRectangleEXT;
+    memcpy(streamPtr, &opcode_vkCmdSetDiscardRectangleEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetDiscardRectangleEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstDiscardRectangle, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_discardRectangleCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i) {
+        reservedmarshal_VkRect2D(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                 (VkRect2D*)(local_pDiscardRectangles + i), streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetDiscardRectangleEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_EXT_conservative_rasterization
+#endif
+#ifdef VK_EXT_depth_clip_enable
+#endif
+#ifdef VK_EXT_swapchain_colorspace
+#endif
+#ifdef VK_EXT_hdr_metadata
+void VkEncoder::vkSetHdrMetadataEXT(VkDevice device, uint32_t swapchainCount,
+                                    const VkSwapchainKHR* pSwapchains,
+                                    const VkHdrMetadataEXT* pMetadata, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkSetHdrMetadataEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkSetHdrMetadataEXT(device:%p, swapchainCount:%d, pSwapchains:%p, pMetadata:%p)", device,
+        swapchainCount, pSwapchains, pMetadata);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    uint32_t local_swapchainCount;
+    VkSwapchainKHR* local_pSwapchains;
+    VkHdrMetadataEXT* local_pMetadata;
+    local_device = device;
+    local_swapchainCount = swapchainCount;
+    // Avoiding deepcopy for pSwapchains
+    local_pSwapchains = (VkSwapchainKHR*)pSwapchains;
+    local_pMetadata = nullptr;
+    if (pMetadata) {
+        local_pMetadata =
+            (VkHdrMetadataEXT*)pool->alloc(((swapchainCount)) * sizeof(const VkHdrMetadataEXT));
+        for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) {
+            deepcopy_VkHdrMetadataEXT(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pMetadata + i,
+                                      (VkHdrMetadataEXT*)(local_pMetadata + i));
+        }
+    }
+    if (local_pMetadata) {
+        for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) {
+            transform_tohost_VkHdrMetadataEXT(sResourceTracker,
+                                              (VkHdrMetadataEXT*)(local_pMetadata + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        if (((swapchainCount))) {
+            *countPtr += ((swapchainCount)) * 8;
+        }
+        for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) {
+            count_VkHdrMetadataEXT(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                   (VkHdrMetadataEXT*)(local_pMetadata + i), countPtr);
+        }
+    }
+    uint32_t packetSize_vkSetHdrMetadataEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkSetHdrMetadataEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkSetHdrMetadataEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkSetHdrMetadataEXT = OP_vkSetHdrMetadataEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkSetHdrMetadataEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkSetHdrMetadataEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_swapchainCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (((swapchainCount))) {
+        uint8_t* cgen_var_1_ptr = (uint8_t*)(*streamPtrPtr);
+        for (uint32_t k = 0; k < ((swapchainCount)); ++k) {
+            uint64_t tmpval = get_host_u64_VkSwapchainKHR(local_pSwapchains[k]);
+            memcpy(cgen_var_1_ptr + k * 8, &tmpval, sizeof(uint64_t));
+        }
+        *streamPtrPtr += 8 * ((swapchainCount));
+    }
+    for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) {
+        reservedmarshal_VkHdrMetadataEXT(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkHdrMetadataEXT*)(local_pMetadata + i), streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkSetHdrMetadataEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_MVK_ios_surface
+VkResult VkEncoder::vkCreateIOSSurfaceMVK(VkInstance instance,
+                                          const VkIOSSurfaceCreateInfoMVK* pCreateInfo,
+                                          const VkAllocationCallbacks* pAllocator,
+                                          VkSurfaceKHR* pSurface, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateIOSSurfaceMVK in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateIOSSurfaceMVK(instance:%p, pCreateInfo:%p, pAllocator:%p, pSurface:%p)", instance,
+        pCreateInfo, pAllocator, pSurface);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkInstance local_instance;
+    VkIOSSurfaceCreateInfoMVK* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_instance = instance;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo =
+            (VkIOSSurfaceCreateInfoMVK*)pool->alloc(sizeof(const VkIOSSurfaceCreateInfoMVK));
+        deepcopy_VkIOSSurfaceCreateInfoMVK(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                           (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkIOSSurfaceCreateInfoMVK(sResourceTracker,
+                                                   (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkIOSSurfaceCreateInfoMVK(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateIOSSurfaceMVK =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateIOSSurfaceMVK);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateIOSSurfaceMVK);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateIOSSurfaceMVK = OP_vkCreateIOSSurfaceMVK;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateIOSSurfaceMVK, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateIOSSurfaceMVK, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkInstance((*&local_instance));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkIOSSurfaceCreateInfoMVK(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo),
+                                              streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pSurface));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateIOSSurfaceMVK), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_3, (VkSurfaceKHR*)pSurface, 1);
+    VkResult vkCreateIOSSurfaceMVK_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateIOSSurfaceMVK_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateIOSSurfaceMVK_VkResult_return;
+}
+
+#endif
+#ifdef VK_MVK_macos_surface
+VkResult VkEncoder::vkCreateMacOSSurfaceMVK(VkInstance instance,
+                                            const VkMacOSSurfaceCreateInfoMVK* pCreateInfo,
+                                            const VkAllocationCallbacks* pAllocator,
+                                            VkSurfaceKHR* pSurface, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateMacOSSurfaceMVK in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateMacOSSurfaceMVK(instance:%p, pCreateInfo:%p, pAllocator:%p, pSurface:%p)",
+        instance, pCreateInfo, pAllocator, pSurface);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkInstance local_instance;
+    VkMacOSSurfaceCreateInfoMVK* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_instance = instance;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo =
+            (VkMacOSSurfaceCreateInfoMVK*)pool->alloc(sizeof(const VkMacOSSurfaceCreateInfoMVK));
+        deepcopy_VkMacOSSurfaceCreateInfoMVK(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                             (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkMacOSSurfaceCreateInfoMVK(
+            sResourceTracker, (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkMacOSSurfaceCreateInfoMVK(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo),
+                                          countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateMacOSSurfaceMVK =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateMacOSSurfaceMVK);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateMacOSSurfaceMVK);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateMacOSSurfaceMVK = OP_vkCreateMacOSSurfaceMVK;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateMacOSSurfaceMVK, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateMacOSSurfaceMVK, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkInstance((*&local_instance));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkMacOSSurfaceCreateInfoMVK(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo),
+                                                streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pSurface));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateMacOSSurfaceMVK), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_3, (VkSurfaceKHR*)pSurface, 1);
+    VkResult vkCreateMacOSSurfaceMVK_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateMacOSSurfaceMVK_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateMacOSSurfaceMVK_VkResult_return;
+}
+
+#endif
+#ifdef VK_MVK_moltenvk
+void VkEncoder::vkGetMTLDeviceMVK(VkPhysicalDevice physicalDevice, void** pMTLDevice,
+                                  uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetMTLDeviceMVK in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetMTLDeviceMVK(physicalDevice:%p, pMTLDevice:%p)", physicalDevice,
+                      pMTLDevice);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    local_physicalDevice = physicalDevice;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(void*);
+    }
+    uint32_t packetSize_vkGetMTLDeviceMVK =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetMTLDeviceMVK);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetMTLDeviceMVK);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetMTLDeviceMVK = OP_vkGetMTLDeviceMVK;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetMTLDeviceMVK, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetMTLDeviceMVK, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (void**)pMTLDevice, sizeof(void*));
+    *streamPtrPtr += sizeof(void*);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetMTLDeviceMVK), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((void**)pMTLDevice, sizeof(void*));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkSetMTLTextureMVK(VkImage image, void* mtlTexture, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkSetMTLTextureMVK in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkSetMTLTextureMVK(image:%p, mtlTexture:%p)", image, mtlTexture);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkImage local_image;
+    local_image = image;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint8_t);
+    }
+    uint32_t packetSize_vkSetMTLTextureMVK =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkSetMTLTextureMVK);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkSetMTLTextureMVK);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkSetMTLTextureMVK = OP_vkSetMTLTextureMVK;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkSetMTLTextureMVK, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkSetMTLTextureMVK, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImage((*&local_image));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (void*)mtlTexture, sizeof(uint8_t));
+    *streamPtrPtr += sizeof(uint8_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkSetMTLTextureMVK), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((void*)mtlTexture, sizeof(uint8_t));
+    VkResult vkSetMTLTextureMVK_VkResult_return = (VkResult)0;
+    stream->read(&vkSetMTLTextureMVK_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkSetMTLTextureMVK_VkResult_return;
+}
+
+void VkEncoder::vkGetMTLTextureMVK(VkImage image, void** pMTLTexture, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetMTLTextureMVK in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetMTLTextureMVK(image:%p, pMTLTexture:%p)", image, pMTLTexture);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkImage local_image;
+    local_image = image;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(void*);
+    }
+    uint32_t packetSize_vkGetMTLTextureMVK =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetMTLTextureMVK);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetMTLTextureMVK);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetMTLTextureMVK = OP_vkGetMTLTextureMVK;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetMTLTextureMVK, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetMTLTextureMVK, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImage((*&local_image));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (void**)pMTLTexture, sizeof(void*));
+    *streamPtrPtr += sizeof(void*);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetMTLTextureMVK), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((void**)pMTLTexture, sizeof(void*));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetMTLBufferMVK(VkBuffer buffer, void** pMTLBuffer, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetMTLBufferMVK in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetMTLBufferMVK(buffer:%p, pMTLBuffer:%p)", buffer, pMTLBuffer);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkBuffer local_buffer;
+    local_buffer = buffer;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(void*);
+    }
+    uint32_t packetSize_vkGetMTLBufferMVK =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetMTLBufferMVK);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetMTLBufferMVK);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetMTLBufferMVK = OP_vkGetMTLBufferMVK;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetMTLBufferMVK, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetMTLBufferMVK, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&local_buffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (void**)pMTLBuffer, sizeof(void*));
+    *streamPtrPtr += sizeof(void*);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetMTLBufferMVK), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((void**)pMTLBuffer, sizeof(void*));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkUseIOSurfaceMVK(VkImage image, void* ioSurface, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkUseIOSurfaceMVK in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkUseIOSurfaceMVK(image:%p, ioSurface:%p)", image, ioSurface);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkImage local_image;
+    local_image = image;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint8_t);
+    }
+    uint32_t packetSize_vkUseIOSurfaceMVK =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkUseIOSurfaceMVK);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkUseIOSurfaceMVK);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkUseIOSurfaceMVK = OP_vkUseIOSurfaceMVK;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkUseIOSurfaceMVK, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkUseIOSurfaceMVK, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImage((*&local_image));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (void*)ioSurface, sizeof(uint8_t));
+    *streamPtrPtr += sizeof(uint8_t);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkUseIOSurfaceMVK), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((void*)ioSurface, sizeof(uint8_t));
+    VkResult vkUseIOSurfaceMVK_VkResult_return = (VkResult)0;
+    stream->read(&vkUseIOSurfaceMVK_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkUseIOSurfaceMVK_VkResult_return;
+}
+
+void VkEncoder::vkGetIOSurfaceMVK(VkImage image, void** pIOSurface, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetIOSurfaceMVK in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetIOSurfaceMVK(image:%p, pIOSurface:%p)", image, pIOSurface);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkImage local_image;
+    local_image = image;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(void*);
+    }
+    uint32_t packetSize_vkGetIOSurfaceMVK =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetIOSurfaceMVK);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetIOSurfaceMVK);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetIOSurfaceMVK = OP_vkGetIOSurfaceMVK;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetIOSurfaceMVK, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetIOSurfaceMVK, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImage((*&local_image));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (void**)pIOSurface, sizeof(void*));
+    *streamPtrPtr += sizeof(void*);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetIOSurfaceMVK), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((void**)pIOSurface, sizeof(void*));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_EXT_external_memory_dma_buf
+#endif
+#ifdef VK_EXT_queue_family_foreign
+#endif
+#ifdef VK_EXT_debug_utils
+VkResult VkEncoder::vkSetDebugUtilsObjectNameEXT(VkDevice device,
+                                                 const VkDebugUtilsObjectNameInfoEXT* pNameInfo,
+                                                 uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkSetDebugUtilsObjectNameEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkSetDebugUtilsObjectNameEXT(device:%p, pNameInfo:%p)", device, pNameInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDebugUtilsObjectNameInfoEXT* local_pNameInfo;
+    local_device = device;
+    local_pNameInfo = nullptr;
+    if (pNameInfo) {
+        local_pNameInfo = (VkDebugUtilsObjectNameInfoEXT*)pool->alloc(
+            sizeof(const VkDebugUtilsObjectNameInfoEXT));
+        deepcopy_VkDebugUtilsObjectNameInfoEXT(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pNameInfo,
+                                               (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo));
+    }
+    if (local_pNameInfo) {
+        transform_tohost_VkDebugUtilsObjectNameInfoEXT(
+            sResourceTracker, (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDebugUtilsObjectNameInfoEXT(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                            (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo),
+                                            countPtr);
+    }
+    uint32_t packetSize_vkSetDebugUtilsObjectNameEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkSetDebugUtilsObjectNameEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkSetDebugUtilsObjectNameEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkSetDebugUtilsObjectNameEXT = OP_vkSetDebugUtilsObjectNameEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkSetDebugUtilsObjectNameEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkSetDebugUtilsObjectNameEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDebugUtilsObjectNameInfoEXT(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                  (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo),
+                                                  streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkSetDebugUtilsObjectNameEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkSetDebugUtilsObjectNameEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkSetDebugUtilsObjectNameEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkSetDebugUtilsObjectNameEXT_VkResult_return;
+}
+
+VkResult VkEncoder::vkSetDebugUtilsObjectTagEXT(VkDevice device,
+                                                const VkDebugUtilsObjectTagInfoEXT* pTagInfo,
+                                                uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkSetDebugUtilsObjectTagEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkSetDebugUtilsObjectTagEXT(device:%p, pTagInfo:%p)", device, pTagInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDebugUtilsObjectTagInfoEXT* local_pTagInfo;
+    local_device = device;
+    local_pTagInfo = nullptr;
+    if (pTagInfo) {
+        local_pTagInfo =
+            (VkDebugUtilsObjectTagInfoEXT*)pool->alloc(sizeof(const VkDebugUtilsObjectTagInfoEXT));
+        deepcopy_VkDebugUtilsObjectTagInfoEXT(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pTagInfo,
+                                              (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo));
+    }
+    if (local_pTagInfo) {
+        transform_tohost_VkDebugUtilsObjectTagInfoEXT(
+            sResourceTracker, (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDebugUtilsObjectTagInfoEXT(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                           (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo),
+                                           countPtr);
+    }
+    uint32_t packetSize_vkSetDebugUtilsObjectTagEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkSetDebugUtilsObjectTagEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkSetDebugUtilsObjectTagEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkSetDebugUtilsObjectTagEXT = OP_vkSetDebugUtilsObjectTagEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkSetDebugUtilsObjectTagEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkSetDebugUtilsObjectTagEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDebugUtilsObjectTagInfoEXT(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                 (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo),
+                                                 streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkSetDebugUtilsObjectTagEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkSetDebugUtilsObjectTagEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkSetDebugUtilsObjectTagEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkSetDebugUtilsObjectTagEXT_VkResult_return;
+}
+
+void VkEncoder::vkQueueBeginDebugUtilsLabelEXT(VkQueue queue,
+                                               const VkDebugUtilsLabelEXT* pLabelInfo,
+                                               uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkQueueBeginDebugUtilsLabelEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkQueueBeginDebugUtilsLabelEXT(queue:%p, pLabelInfo:%p)", queue, pLabelInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkQueue local_queue;
+    VkDebugUtilsLabelEXT* local_pLabelInfo;
+    local_queue = queue;
+    local_pLabelInfo = nullptr;
+    if (pLabelInfo) {
+        local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT));
+        deepcopy_VkDebugUtilsLabelEXT(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pLabelInfo,
+                                      (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
+    }
+    if (local_pLabelInfo) {
+        transform_tohost_VkDebugUtilsLabelEXT(sResourceTracker,
+                                              (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDebugUtilsLabelEXT(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                   (VkDebugUtilsLabelEXT*)(local_pLabelInfo), countPtr);
+    }
+    uint32_t packetSize_vkQueueBeginDebugUtilsLabelEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkQueueBeginDebugUtilsLabelEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkQueueBeginDebugUtilsLabelEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkQueueBeginDebugUtilsLabelEXT = OP_vkQueueBeginDebugUtilsLabelEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkQueueBeginDebugUtilsLabelEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkQueueBeginDebugUtilsLabelEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkQueue((*&local_queue));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDebugUtilsLabelEXT(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkDebugUtilsLabelEXT*)(local_pLabelInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkQueueBeginDebugUtilsLabelEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkQueueEndDebugUtilsLabelEXT(VkQueue queue, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkQueueEndDebugUtilsLabelEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkQueueEndDebugUtilsLabelEXT(queue:%p)", queue);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkQueue local_queue;
+    local_queue = queue;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkQueueEndDebugUtilsLabelEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkQueueEndDebugUtilsLabelEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkQueueEndDebugUtilsLabelEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkQueueEndDebugUtilsLabelEXT = OP_vkQueueEndDebugUtilsLabelEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkQueueEndDebugUtilsLabelEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkQueueEndDebugUtilsLabelEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkQueue((*&local_queue));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkQueueEndDebugUtilsLabelEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkQueueInsertDebugUtilsLabelEXT(VkQueue queue,
+                                                const VkDebugUtilsLabelEXT* pLabelInfo,
+                                                uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkQueueInsertDebugUtilsLabelEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkQueueInsertDebugUtilsLabelEXT(queue:%p, pLabelInfo:%p)", queue,
+                      pLabelInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkQueue local_queue;
+    VkDebugUtilsLabelEXT* local_pLabelInfo;
+    local_queue = queue;
+    local_pLabelInfo = nullptr;
+    if (pLabelInfo) {
+        local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT));
+        deepcopy_VkDebugUtilsLabelEXT(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pLabelInfo,
+                                      (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
+    }
+    if (local_pLabelInfo) {
+        transform_tohost_VkDebugUtilsLabelEXT(sResourceTracker,
+                                              (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDebugUtilsLabelEXT(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                   (VkDebugUtilsLabelEXT*)(local_pLabelInfo), countPtr);
+    }
+    uint32_t packetSize_vkQueueInsertDebugUtilsLabelEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkQueueInsertDebugUtilsLabelEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkQueueInsertDebugUtilsLabelEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkQueueInsertDebugUtilsLabelEXT = OP_vkQueueInsertDebugUtilsLabelEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkQueueInsertDebugUtilsLabelEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkQueueInsertDebugUtilsLabelEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkQueue((*&local_queue));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDebugUtilsLabelEXT(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkDebugUtilsLabelEXT*)(local_pLabelInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkQueueInsertDebugUtilsLabelEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdBeginDebugUtilsLabelEXT(VkCommandBuffer commandBuffer,
+                                             const VkDebugUtilsLabelEXT* pLabelInfo,
+                                             uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdBeginDebugUtilsLabelEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdBeginDebugUtilsLabelEXT(commandBuffer:%p, pLabelInfo:%p)",
+                      commandBuffer, pLabelInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkDebugUtilsLabelEXT* local_pLabelInfo;
+    local_commandBuffer = commandBuffer;
+    local_pLabelInfo = nullptr;
+    if (pLabelInfo) {
+        local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT));
+        deepcopy_VkDebugUtilsLabelEXT(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pLabelInfo,
+                                      (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
+    }
+    if (local_pLabelInfo) {
+        transform_tohost_VkDebugUtilsLabelEXT(sResourceTracker,
+                                              (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDebugUtilsLabelEXT(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                   (VkDebugUtilsLabelEXT*)(local_pLabelInfo), countPtr);
+    }
+    uint32_t packetSize_vkCmdBeginDebugUtilsLabelEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdBeginDebugUtilsLabelEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdBeginDebugUtilsLabelEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdBeginDebugUtilsLabelEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdBeginDebugUtilsLabelEXT = OP_vkCmdBeginDebugUtilsLabelEXT;
+    memcpy(streamPtr, &opcode_vkCmdBeginDebugUtilsLabelEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdBeginDebugUtilsLabelEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkDebugUtilsLabelEXT(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkDebugUtilsLabelEXT*)(local_pLabelInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdBeginDebugUtilsLabelEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdEndDebugUtilsLabelEXT(VkCommandBuffer commandBuffer, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdEndDebugUtilsLabelEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdEndDebugUtilsLabelEXT(commandBuffer:%p)", commandBuffer);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    local_commandBuffer = commandBuffer;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkCmdEndDebugUtilsLabelEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdEndDebugUtilsLabelEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdEndDebugUtilsLabelEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdEndDebugUtilsLabelEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdEndDebugUtilsLabelEXT = OP_vkCmdEndDebugUtilsLabelEXT;
+    memcpy(streamPtr, &opcode_vkCmdEndDebugUtilsLabelEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdEndDebugUtilsLabelEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdEndDebugUtilsLabelEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdInsertDebugUtilsLabelEXT(VkCommandBuffer commandBuffer,
+                                              const VkDebugUtilsLabelEXT* pLabelInfo,
+                                              uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdInsertDebugUtilsLabelEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdInsertDebugUtilsLabelEXT(commandBuffer:%p, pLabelInfo:%p)",
+                      commandBuffer, pLabelInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkDebugUtilsLabelEXT* local_pLabelInfo;
+    local_commandBuffer = commandBuffer;
+    local_pLabelInfo = nullptr;
+    if (pLabelInfo) {
+        local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT));
+        deepcopy_VkDebugUtilsLabelEXT(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pLabelInfo,
+                                      (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
+    }
+    if (local_pLabelInfo) {
+        transform_tohost_VkDebugUtilsLabelEXT(sResourceTracker,
+                                              (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDebugUtilsLabelEXT(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                   (VkDebugUtilsLabelEXT*)(local_pLabelInfo), countPtr);
+    }
+    uint32_t packetSize_vkCmdInsertDebugUtilsLabelEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdInsertDebugUtilsLabelEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdInsertDebugUtilsLabelEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdInsertDebugUtilsLabelEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdInsertDebugUtilsLabelEXT = OP_vkCmdInsertDebugUtilsLabelEXT;
+    memcpy(streamPtr, &opcode_vkCmdInsertDebugUtilsLabelEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdInsertDebugUtilsLabelEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkDebugUtilsLabelEXT(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkDebugUtilsLabelEXT*)(local_pLabelInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdInsertDebugUtilsLabelEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkCreateDebugUtilsMessengerEXT(
+    VkInstance instance, const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkDebugUtilsMessengerEXT* pMessenger,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateDebugUtilsMessengerEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateDebugUtilsMessengerEXT(instance:%p, pCreateInfo:%p, pAllocator:%p, pMessenger:%p)",
+        instance, pCreateInfo, pAllocator, pMessenger);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkInstance local_instance;
+    VkDebugUtilsMessengerCreateInfoEXT* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_instance = instance;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkDebugUtilsMessengerCreateInfoEXT*)pool->alloc(
+            sizeof(const VkDebugUtilsMessengerCreateInfoEXT));
+        deepcopy_VkDebugUtilsMessengerCreateInfoEXT(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+            (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkDebugUtilsMessengerCreateInfoEXT(
+            sResourceTracker, (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDebugUtilsMessengerCreateInfoEXT(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateDebugUtilsMessengerEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCreateDebugUtilsMessengerEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateDebugUtilsMessengerEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateDebugUtilsMessengerEXT = OP_vkCreateDebugUtilsMessengerEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateDebugUtilsMessengerEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateDebugUtilsMessengerEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkInstance((*&local_instance));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDebugUtilsMessengerCreateInfoEXT(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo), streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pMessenger));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateDebugUtilsMessengerEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkDebugUtilsMessengerEXT(
+        &cgen_var_3, (VkDebugUtilsMessengerEXT*)pMessenger, 1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateDebugUtilsMessengerEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateDebugUtilsMessengerEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateDebugUtilsMessengerEXT_VkResult_return;
+}
+
+void VkEncoder::vkDestroyDebugUtilsMessengerEXT(VkInstance instance,
+                                                VkDebugUtilsMessengerEXT messenger,
+                                                const VkAllocationCallbacks* pAllocator,
+                                                uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyDebugUtilsMessengerEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroyDebugUtilsMessengerEXT(instance:%p, messenger:%p, pAllocator:%p)",
+                      instance, messenger, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkInstance local_instance;
+    VkDebugUtilsMessengerEXT local_messenger;
+    VkAllocationCallbacks* local_pAllocator;
+    local_instance = instance;
+    local_messenger = messenger;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyDebugUtilsMessengerEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkDestroyDebugUtilsMessengerEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyDebugUtilsMessengerEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyDebugUtilsMessengerEXT = OP_vkDestroyDebugUtilsMessengerEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyDebugUtilsMessengerEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyDebugUtilsMessengerEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkInstance((*&local_instance));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDebugUtilsMessengerEXT((*&local_messenger));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroyDebugUtilsMessengerEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkDebugUtilsMessengerEXT(
+        (VkDebugUtilsMessengerEXT*)&messenger);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkSubmitDebugUtilsMessageEXT(
+    VkInstance instance, VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
+    VkDebugUtilsMessageTypeFlagsEXT messageTypes,
+    const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkSubmitDebugUtilsMessageEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkSubmitDebugUtilsMessageEXT(instance:%p, pCallbackData:%p)", instance,
+                      pCallbackData);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkInstance local_instance;
+    VkDebugUtilsMessageSeverityFlagBitsEXT local_messageSeverity;
+    VkDebugUtilsMessageTypeFlagsEXT local_messageTypes;
+    VkDebugUtilsMessengerCallbackDataEXT* local_pCallbackData;
+    local_instance = instance;
+    local_messageSeverity = messageSeverity;
+    local_messageTypes = messageTypes;
+    local_pCallbackData = nullptr;
+    if (pCallbackData) {
+        local_pCallbackData = (VkDebugUtilsMessengerCallbackDataEXT*)pool->alloc(
+            sizeof(const VkDebugUtilsMessengerCallbackDataEXT));
+        deepcopy_VkDebugUtilsMessengerCallbackDataEXT(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCallbackData,
+            (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData));
+    }
+    if (local_pCallbackData) {
+        transform_tohost_VkDebugUtilsMessengerCallbackDataEXT(
+            sResourceTracker, (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDebugUtilsMessageSeverityFlagBitsEXT);
+        *countPtr += sizeof(VkDebugUtilsMessageTypeFlagsEXT);
+        count_VkDebugUtilsMessengerCallbackDataEXT(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData), countPtr);
+    }
+    uint32_t packetSize_vkSubmitDebugUtilsMessageEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkSubmitDebugUtilsMessageEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkSubmitDebugUtilsMessageEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkSubmitDebugUtilsMessageEXT = OP_vkSubmitDebugUtilsMessageEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkSubmitDebugUtilsMessageEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkSubmitDebugUtilsMessageEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkInstance((*&local_instance));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDebugUtilsMessageSeverityFlagBitsEXT*)&local_messageSeverity,
+           sizeof(VkDebugUtilsMessageSeverityFlagBitsEXT));
+    *streamPtrPtr += sizeof(VkDebugUtilsMessageSeverityFlagBitsEXT);
+    memcpy(*streamPtrPtr, (VkDebugUtilsMessageTypeFlagsEXT*)&local_messageTypes,
+           sizeof(VkDebugUtilsMessageTypeFlagsEXT));
+    *streamPtrPtr += sizeof(VkDebugUtilsMessageTypeFlagsEXT);
+    reservedmarshal_VkDebugUtilsMessengerCallbackDataEXT(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkSubmitDebugUtilsMessageEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+VkResult VkEncoder::vkGetAndroidHardwareBufferPropertiesANDROID(
+    VkDevice device, const AHardwareBuffer* buffer,
+    VkAndroidHardwareBufferPropertiesANDROID* pProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetAndroidHardwareBufferPropertiesANDROID in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetAndroidHardwareBufferPropertiesANDROID(device:%p, buffer:%p, pProperties:%p)", device,
+        buffer, pProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    AHardwareBuffer* local_buffer;
+    local_device = device;
+    // Avoiding deepcopy for buffer
+    local_buffer = (AHardwareBuffer*)buffer;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(AHardwareBuffer);
+        count_VkAndroidHardwareBufferPropertiesANDROID(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties), countPtr);
+    }
+    uint32_t packetSize_vkGetAndroidHardwareBufferPropertiesANDROID =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetAndroidHardwareBufferPropertiesANDROID);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetAndroidHardwareBufferPropertiesANDROID);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetAndroidHardwareBufferPropertiesANDROID =
+        OP_vkGetAndroidHardwareBufferPropertiesANDROID;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetAndroidHardwareBufferPropertiesANDROID, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetAndroidHardwareBufferPropertiesANDROID, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (AHardwareBuffer*)local_buffer, sizeof(AHardwareBuffer));
+    *streamPtrPtr += sizeof(AHardwareBuffer);
+    reservedmarshal_VkAndroidHardwareBufferPropertiesANDROID(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetAndroidHardwareBufferPropertiesANDROID),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkAndroidHardwareBufferPropertiesANDROID(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties));
+    if (pProperties) {
+        transform_fromhost_VkAndroidHardwareBufferPropertiesANDROID(
+            sResourceTracker, (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties));
+    }
+    VkResult vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return = (VkResult)0;
+    stream->read(&vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetMemoryAndroidHardwareBufferANDROID(
+    VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo,
+    AHardwareBuffer** pBuffer, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetMemoryAndroidHardwareBufferANDROID in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetMemoryAndroidHardwareBufferANDROID(device:%p, pInfo:%p, pBuffer:%p)",
+                      device, pInfo, pBuffer);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkMemoryGetAndroidHardwareBufferInfoANDROID* local_pInfo;
+    local_device = device;
+    local_pInfo = nullptr;
+    if (pInfo) {
+        local_pInfo = (VkMemoryGetAndroidHardwareBufferInfoANDROID*)pool->alloc(
+            sizeof(const VkMemoryGetAndroidHardwareBufferInfoANDROID));
+        deepcopy_VkMemoryGetAndroidHardwareBufferInfoANDROID(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfo,
+            (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo));
+    }
+    if (local_pInfo) {
+        transform_tohost_VkMemoryGetAndroidHardwareBufferInfoANDROID(
+            sResourceTracker, (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkMemoryGetAndroidHardwareBufferInfoANDROID(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo), countPtr);
+        *countPtr += sizeof(AHardwareBuffer*);
+    }
+    uint32_t packetSize_vkGetMemoryAndroidHardwareBufferANDROID =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetMemoryAndroidHardwareBufferANDROID);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetMemoryAndroidHardwareBufferANDROID);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetMemoryAndroidHardwareBufferANDROID =
+        OP_vkGetMemoryAndroidHardwareBufferANDROID;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetMemoryAndroidHardwareBufferANDROID, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetMemoryAndroidHardwareBufferANDROID, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkMemoryGetAndroidHardwareBufferInfoANDROID(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo), streamPtrPtr);
+    memcpy(*streamPtrPtr, (AHardwareBuffer**)pBuffer, sizeof(AHardwareBuffer*));
+    *streamPtrPtr += sizeof(AHardwareBuffer*);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetMemoryAndroidHardwareBufferANDROID),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((AHardwareBuffer**)pBuffer, sizeof(AHardwareBuffer*));
+    VkResult vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return = (VkResult)0;
+    stream->read(&vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return;
+}
+
+#endif
+#ifdef VK_EXT_sampler_filter_minmax
+#endif
+#ifdef VK_AMD_gpu_shader_int16
+#endif
+#ifdef VK_AMD_mixed_attachment_samples
+#endif
+#ifdef VK_AMD_shader_fragment_mask
+#endif
+#ifdef VK_EXT_inline_uniform_block
+#endif
+#ifdef VK_EXT_shader_stencil_export
+#endif
+#ifdef VK_EXT_sample_locations
+void VkEncoder::vkCmdSetSampleLocationsEXT(VkCommandBuffer commandBuffer,
+                                           const VkSampleLocationsInfoEXT* pSampleLocationsInfo,
+                                           uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetSampleLocationsEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdSetSampleLocationsEXT(commandBuffer:%p, pSampleLocationsInfo:%p)",
+                      commandBuffer, pSampleLocationsInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkSampleLocationsInfoEXT* local_pSampleLocationsInfo;
+    local_commandBuffer = commandBuffer;
+    local_pSampleLocationsInfo = nullptr;
+    if (pSampleLocationsInfo) {
+        local_pSampleLocationsInfo =
+            (VkSampleLocationsInfoEXT*)pool->alloc(sizeof(const VkSampleLocationsInfoEXT));
+        deepcopy_VkSampleLocationsInfoEXT(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pSampleLocationsInfo,
+                                          (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo));
+    }
+    if (local_pSampleLocationsInfo) {
+        transform_tohost_VkSampleLocationsInfoEXT(
+            sResourceTracker, (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkSampleLocationsInfoEXT(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo),
+                                       countPtr);
+    }
+    uint32_t packetSize_vkCmdSetSampleLocationsEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetSampleLocationsEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetSampleLocationsEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetSampleLocationsEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetSampleLocationsEXT = OP_vkCmdSetSampleLocationsEXT;
+    memcpy(streamPtr, &opcode_vkCmdSetSampleLocationsEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetSampleLocationsEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkSampleLocationsInfoEXT(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo),
+        streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetSampleLocationsEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetPhysicalDeviceMultisamplePropertiesEXT(
+    VkPhysicalDevice physicalDevice, VkSampleCountFlagBits samples,
+    VkMultisamplePropertiesEXT* pMultisampleProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceMultisamplePropertiesEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceMultisamplePropertiesEXT(physicalDevice:%p, pMultisampleProperties:%p)",
+        physicalDevice, pMultisampleProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkSampleCountFlagBits local_samples;
+    local_physicalDevice = physicalDevice;
+    local_samples = samples;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkSampleCountFlagBits);
+        count_VkMultisamplePropertiesEXT(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkMultisamplePropertiesEXT*)(pMultisampleProperties),
+                                         countPtr);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceMultisamplePropertiesEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceMultisamplePropertiesEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceMultisamplePropertiesEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceMultisamplePropertiesEXT =
+        OP_vkGetPhysicalDeviceMultisamplePropertiesEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceMultisamplePropertiesEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceMultisamplePropertiesEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits));
+    *streamPtrPtr += sizeof(VkSampleCountFlagBits);
+    reservedmarshal_VkMultisamplePropertiesEXT(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkMultisamplePropertiesEXT*)(pMultisampleProperties),
+        streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceMultisamplePropertiesEXT),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkMultisamplePropertiesEXT(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkMultisamplePropertiesEXT*)(pMultisampleProperties));
+    if (pMultisampleProperties) {
+        transform_fromhost_VkMultisamplePropertiesEXT(
+            sResourceTracker, (VkMultisamplePropertiesEXT*)(pMultisampleProperties));
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_EXT_blend_operation_advanced
+#endif
+#ifdef VK_NV_fragment_coverage_to_color
+#endif
+#ifdef VK_NV_framebuffer_mixed_samples
+#endif
+#ifdef VK_NV_fill_rectangle
+#endif
+#ifdef VK_NV_shader_sm_builtins
+#endif
+#ifdef VK_EXT_post_depth_coverage
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+VkResult VkEncoder::vkGetImageDrmFormatModifierPropertiesEXT(
+    VkDevice device, VkImage image, VkImageDrmFormatModifierPropertiesEXT* pProperties,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetImageDrmFormatModifierPropertiesEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetImageDrmFormatModifierPropertiesEXT(device:%p, image:%p, pProperties:%p)", device,
+        image, pProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkImage local_image;
+    local_device = device;
+    local_image = image;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        count_VkImageDrmFormatModifierPropertiesEXT(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkImageDrmFormatModifierPropertiesEXT*)(pProperties), countPtr);
+    }
+    uint32_t packetSize_vkGetImageDrmFormatModifierPropertiesEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetImageDrmFormatModifierPropertiesEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetImageDrmFormatModifierPropertiesEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetImageDrmFormatModifierPropertiesEXT =
+        OP_vkGetImageDrmFormatModifierPropertiesEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetImageDrmFormatModifierPropertiesEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetImageDrmFormatModifierPropertiesEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkImage((*&local_image));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkImageDrmFormatModifierPropertiesEXT(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkImageDrmFormatModifierPropertiesEXT*)(pProperties),
+        streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetImageDrmFormatModifierPropertiesEXT),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkImageDrmFormatModifierPropertiesEXT(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkImageDrmFormatModifierPropertiesEXT*)(pProperties));
+    if (pProperties) {
+        transform_fromhost_VkImageDrmFormatModifierPropertiesEXT(
+            sResourceTracker, (VkImageDrmFormatModifierPropertiesEXT*)(pProperties));
+    }
+    VkResult vkGetImageDrmFormatModifierPropertiesEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkGetImageDrmFormatModifierPropertiesEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetImageDrmFormatModifierPropertiesEXT_VkResult_return;
+}
+
+#endif
+#ifdef VK_EXT_validation_cache
+VkResult VkEncoder::vkCreateValidationCacheEXT(VkDevice device,
+                                               const VkValidationCacheCreateInfoEXT* pCreateInfo,
+                                               const VkAllocationCallbacks* pAllocator,
+                                               VkValidationCacheEXT* pValidationCache,
+                                               uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateValidationCacheEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateValidationCacheEXT(device:%p, pCreateInfo:%p, pAllocator:%p, pValidationCache:%p)",
+        device, pCreateInfo, pAllocator, pValidationCache);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkValidationCacheCreateInfoEXT* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkValidationCacheCreateInfoEXT*)pool->alloc(
+            sizeof(const VkValidationCacheCreateInfoEXT));
+        deepcopy_VkValidationCacheCreateInfoEXT(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+            (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkValidationCacheCreateInfoEXT(
+            sResourceTracker, (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkValidationCacheCreateInfoEXT(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                             (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo),
+                                             countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateValidationCacheEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateValidationCacheEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateValidationCacheEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateValidationCacheEXT = OP_vkCreateValidationCacheEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateValidationCacheEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateValidationCacheEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkValidationCacheCreateInfoEXT(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo),
+        streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pValidationCache));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateValidationCacheEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkValidationCacheEXT(
+        &cgen_var_3, (VkValidationCacheEXT*)pValidationCache, 1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateValidationCacheEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateValidationCacheEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateValidationCacheEXT_VkResult_return;
+}
+
+void VkEncoder::vkDestroyValidationCacheEXT(VkDevice device, VkValidationCacheEXT validationCache,
+                                            const VkAllocationCallbacks* pAllocator,
+                                            uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyValidationCacheEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroyValidationCacheEXT(device:%p, validationCache:%p, pAllocator:%p)",
+                      device, validationCache, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkValidationCacheEXT local_validationCache;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_validationCache = validationCache;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyValidationCacheEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDestroyValidationCacheEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyValidationCacheEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyValidationCacheEXT = OP_vkDestroyValidationCacheEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyValidationCacheEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyValidationCacheEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkValidationCacheEXT((*&local_validationCache));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroyValidationCacheEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkValidationCacheEXT(
+        (VkValidationCacheEXT*)&validationCache);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkMergeValidationCachesEXT(VkDevice device, VkValidationCacheEXT dstCache,
+                                               uint32_t srcCacheCount,
+                                               const VkValidationCacheEXT* pSrcCaches,
+                                               uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkMergeValidationCachesEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkMergeValidationCachesEXT(device:%p, dstCache:%p, srcCacheCount:%d, pSrcCaches:%p)",
+        device, dstCache, srcCacheCount, pSrcCaches);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkValidationCacheEXT local_dstCache;
+    uint32_t local_srcCacheCount;
+    VkValidationCacheEXT* local_pSrcCaches;
+    local_device = device;
+    local_dstCache = dstCache;
+    local_srcCacheCount = srcCacheCount;
+    // Avoiding deepcopy for pSrcCaches
+    local_pSrcCaches = (VkValidationCacheEXT*)pSrcCaches;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        if (((srcCacheCount))) {
+            *countPtr += ((srcCacheCount)) * 8;
+        }
+    }
+    uint32_t packetSize_vkMergeValidationCachesEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkMergeValidationCachesEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkMergeValidationCachesEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkMergeValidationCachesEXT = OP_vkMergeValidationCachesEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkMergeValidationCachesEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkMergeValidationCachesEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkValidationCacheEXT((*&local_dstCache));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_srcCacheCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (((srcCacheCount))) {
+        uint8_t* cgen_var_2_ptr = (uint8_t*)(*streamPtrPtr);
+        for (uint32_t k = 0; k < ((srcCacheCount)); ++k) {
+            uint64_t tmpval = get_host_u64_VkValidationCacheEXT(local_pSrcCaches[k]);
+            memcpy(cgen_var_2_ptr + k * 8, &tmpval, sizeof(uint64_t));
+        }
+        *streamPtrPtr += 8 * ((srcCacheCount));
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkMergeValidationCachesEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkMergeValidationCachesEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkMergeValidationCachesEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkMergeValidationCachesEXT_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetValidationCacheDataEXT(VkDevice device,
+                                                VkValidationCacheEXT validationCache,
+                                                size_t* pDataSize, void* pData, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetValidationCacheDataEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetValidationCacheDataEXT(device:%p, validationCache:%p, pDataSize:%p, pData:%p)",
+        device, validationCache, pDataSize, pData);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkValidationCacheEXT local_validationCache;
+    local_device = device;
+    local_validationCache = validationCache;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pDataSize) {
+            *countPtr += 8;
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pData) {
+            if (pDataSize) {
+                *countPtr += (*(pDataSize)) * sizeof(uint8_t);
+            }
+        }
+    }
+    uint32_t packetSize_vkGetValidationCacheDataEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetValidationCacheDataEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetValidationCacheDataEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetValidationCacheDataEXT = OP_vkGetValidationCacheDataEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetValidationCacheDataEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetValidationCacheDataEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkValidationCacheEXT((*&local_validationCache));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pDataSize;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pDataSize) {
+        uint64_t cgen_var_2_0 = (uint64_t)(*pDataSize);
+        memcpy((*streamPtrPtr), &cgen_var_2_0, 8);
+        android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+        *streamPtrPtr += 8;
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_3 = (uint64_t)(uintptr_t)pData;
+    memcpy((*streamPtrPtr), &cgen_var_3, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pData) {
+        memcpy(*streamPtrPtr, (void*)pData, (*(pDataSize)) * sizeof(uint8_t));
+        *streamPtrPtr += (*(pDataSize)) * sizeof(uint8_t);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetValidationCacheDataEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    size_t* check_pDataSize;
+    check_pDataSize = (size_t*)(uintptr_t)stream->getBe64();
+    if (pDataSize) {
+        if (!(check_pDataSize)) {
+            fprintf(stderr, "fatal: pDataSize inconsistent between guest and host\n");
+        }
+        (*pDataSize) = (size_t)stream->getBe64();
+    }
+    // WARNING PTR CHECK
+    void* check_pData;
+    check_pData = (void*)(uintptr_t)stream->getBe64();
+    if (pData) {
+        if (!(check_pData)) {
+            fprintf(stderr, "fatal: pData inconsistent between guest and host\n");
+        }
+        stream->read((void*)pData, (*(pDataSize)) * sizeof(uint8_t));
+    }
+    VkResult vkGetValidationCacheDataEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkGetValidationCacheDataEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetValidationCacheDataEXT_VkResult_return;
+}
+
+#endif
+#ifdef VK_EXT_descriptor_indexing
+#endif
+#ifdef VK_EXT_shader_viewport_index_layer
+#endif
+#ifdef VK_NV_shading_rate_image
+void VkEncoder::vkCmdBindShadingRateImageNV(VkCommandBuffer commandBuffer, VkImageView imageView,
+                                            VkImageLayout imageLayout, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdBindShadingRateImageNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdBindShadingRateImageNV(commandBuffer:%p, imageView:%p, imageLayout:%d)",
+                      commandBuffer, imageView, imageLayout);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkImageView local_imageView;
+    VkImageLayout local_imageLayout;
+    local_commandBuffer = commandBuffer;
+    local_imageView = imageView;
+    local_imageLayout = imageLayout;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkImageLayout);
+    }
+    uint32_t packetSize_vkCmdBindShadingRateImageNV = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdBindShadingRateImageNV);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdBindShadingRateImageNV -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdBindShadingRateImageNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdBindShadingRateImageNV = OP_vkCmdBindShadingRateImageNV;
+    memcpy(streamPtr, &opcode_vkCmdBindShadingRateImageNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdBindShadingRateImageNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImageView((*&local_imageView));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout));
+    *streamPtrPtr += sizeof(VkImageLayout);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdBindShadingRateImageNV), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdSetViewportShadingRatePaletteNV(
+    VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount,
+    const VkShadingRatePaletteNV* pShadingRatePalettes, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetViewportShadingRatePaletteNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdSetViewportShadingRatePaletteNV(commandBuffer:%p, firstViewport:%d, "
+        "viewportCount:%d, pShadingRatePalettes:%p)",
+        commandBuffer, firstViewport, viewportCount, pShadingRatePalettes);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_firstViewport;
+    uint32_t local_viewportCount;
+    VkShadingRatePaletteNV* local_pShadingRatePalettes;
+    local_commandBuffer = commandBuffer;
+    local_firstViewport = firstViewport;
+    local_viewportCount = viewportCount;
+    local_pShadingRatePalettes = nullptr;
+    if (pShadingRatePalettes) {
+        local_pShadingRatePalettes = (VkShadingRatePaletteNV*)pool->alloc(
+            ((viewportCount)) * sizeof(const VkShadingRatePaletteNV));
+        for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) {
+            deepcopy_VkShadingRatePaletteNV(
+                pool, VK_STRUCTURE_TYPE_MAX_ENUM, pShadingRatePalettes + i,
+                (VkShadingRatePaletteNV*)(local_pShadingRatePalettes + i));
+        }
+    }
+    if (local_pShadingRatePalettes) {
+        for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) {
+            transform_tohost_VkShadingRatePaletteNV(
+                sResourceTracker, (VkShadingRatePaletteNV*)(local_pShadingRatePalettes + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) {
+            count_VkShadingRatePaletteNV(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkShadingRatePaletteNV*)(local_pShadingRatePalettes + i),
+                                         countPtr);
+        }
+    }
+    uint32_t packetSize_vkCmdSetViewportShadingRatePaletteNV = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdSetViewportShadingRatePaletteNV);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetViewportShadingRatePaletteNV -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetViewportShadingRatePaletteNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetViewportShadingRatePaletteNV = OP_vkCmdSetViewportShadingRatePaletteNV;
+    memcpy(streamPtr, &opcode_vkCmdSetViewportShadingRatePaletteNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetViewportShadingRatePaletteNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstViewport, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_viewportCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) {
+        reservedmarshal_VkShadingRatePaletteNV(
+            stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkShadingRatePaletteNV*)(local_pShadingRatePalettes + i), streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdSetViewportShadingRatePaletteNV),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdSetCoarseSampleOrderNV(VkCommandBuffer commandBuffer,
+                                            VkCoarseSampleOrderTypeNV sampleOrderType,
+                                            uint32_t customSampleOrderCount,
+                                            const VkCoarseSampleOrderCustomNV* pCustomSampleOrders,
+                                            uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetCoarseSampleOrderNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdSetCoarseSampleOrderNV(commandBuffer:%p, customSampleOrderCount:%d, "
+        "pCustomSampleOrders:%p)",
+        commandBuffer, customSampleOrderCount, pCustomSampleOrders);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkCoarseSampleOrderTypeNV local_sampleOrderType;
+    uint32_t local_customSampleOrderCount;
+    VkCoarseSampleOrderCustomNV* local_pCustomSampleOrders;
+    local_commandBuffer = commandBuffer;
+    local_sampleOrderType = sampleOrderType;
+    local_customSampleOrderCount = customSampleOrderCount;
+    local_pCustomSampleOrders = nullptr;
+    if (pCustomSampleOrders) {
+        local_pCustomSampleOrders = (VkCoarseSampleOrderCustomNV*)pool->alloc(
+            ((customSampleOrderCount)) * sizeof(const VkCoarseSampleOrderCustomNV));
+        for (uint32_t i = 0; i < (uint32_t)((customSampleOrderCount)); ++i) {
+            deepcopy_VkCoarseSampleOrderCustomNV(
+                pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCustomSampleOrders + i,
+                (VkCoarseSampleOrderCustomNV*)(local_pCustomSampleOrders + i));
+        }
+    }
+    if (local_pCustomSampleOrders) {
+        for (uint32_t i = 0; i < (uint32_t)((customSampleOrderCount)); ++i) {
+            transform_tohost_VkCoarseSampleOrderCustomNV(
+                sResourceTracker, (VkCoarseSampleOrderCustomNV*)(local_pCustomSampleOrders + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkCoarseSampleOrderTypeNV);
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((customSampleOrderCount)); ++i) {
+            count_VkCoarseSampleOrderCustomNV(
+                sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkCoarseSampleOrderCustomNV*)(local_pCustomSampleOrders + i), countPtr);
+        }
+    }
+    uint32_t packetSize_vkCmdSetCoarseSampleOrderNV = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetCoarseSampleOrderNV);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetCoarseSampleOrderNV -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetCoarseSampleOrderNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetCoarseSampleOrderNV = OP_vkCmdSetCoarseSampleOrderNV;
+    memcpy(streamPtr, &opcode_vkCmdSetCoarseSampleOrderNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetCoarseSampleOrderNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkCoarseSampleOrderTypeNV*)&local_sampleOrderType,
+           sizeof(VkCoarseSampleOrderTypeNV));
+    *streamPtrPtr += sizeof(VkCoarseSampleOrderTypeNV);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_customSampleOrderCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((customSampleOrderCount)); ++i) {
+        reservedmarshal_VkCoarseSampleOrderCustomNV(
+            stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkCoarseSampleOrderCustomNV*)(local_pCustomSampleOrders + i), streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetCoarseSampleOrderNV), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_NV_ray_tracing
+VkResult VkEncoder::vkCreateAccelerationStructureNV(
+    VkDevice device, const VkAccelerationStructureCreateInfoNV* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkAccelerationStructureNV* pAccelerationStructure,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateAccelerationStructureNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateAccelerationStructureNV(device:%p, pCreateInfo:%p, pAllocator:%p, "
+        "pAccelerationStructure:%p)",
+        device, pCreateInfo, pAllocator, pAccelerationStructure);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkAccelerationStructureCreateInfoNV* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkAccelerationStructureCreateInfoNV*)pool->alloc(
+            sizeof(const VkAccelerationStructureCreateInfoNV));
+        deepcopy_VkAccelerationStructureCreateInfoNV(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+            (VkAccelerationStructureCreateInfoNV*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkAccelerationStructureCreateInfoNV(
+            sResourceTracker, (VkAccelerationStructureCreateInfoNV*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkAccelerationStructureCreateInfoNV(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkAccelerationStructureCreateInfoNV*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateAccelerationStructureNV =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCreateAccelerationStructureNV);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateAccelerationStructureNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateAccelerationStructureNV = OP_vkCreateAccelerationStructureNV;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateAccelerationStructureNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateAccelerationStructureNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkAccelerationStructureCreateInfoNV(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkAccelerationStructureCreateInfoNV*)(local_pCreateInfo), streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pAccelerationStructure));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateAccelerationStructureNV), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkAccelerationStructureNV(
+        &cgen_var_3, (VkAccelerationStructureNV*)pAccelerationStructure, 1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateAccelerationStructureNV_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateAccelerationStructureNV_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateAccelerationStructureNV_VkResult_return;
+}
+
+void VkEncoder::vkDestroyAccelerationStructureNV(VkDevice device,
+                                                 VkAccelerationStructureNV accelerationStructure,
+                                                 const VkAllocationCallbacks* pAllocator,
+                                                 uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyAccelerationStructureNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkDestroyAccelerationStructureNV(device:%p, accelerationStructure:%p, pAllocator:%p)",
+        device, accelerationStructure, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkAccelerationStructureNV local_accelerationStructure;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_accelerationStructure = accelerationStructure;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyAccelerationStructureNV =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkDestroyAccelerationStructureNV);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyAccelerationStructureNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyAccelerationStructureNV = OP_vkDestroyAccelerationStructureNV;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyAccelerationStructureNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyAccelerationStructureNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkAccelerationStructureNV((*&local_accelerationStructure));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroyAccelerationStructureNV), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkAccelerationStructureNV(
+        (VkAccelerationStructureNV*)&accelerationStructure);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetAccelerationStructureMemoryRequirementsNV(
+    VkDevice device, const VkAccelerationStructureMemoryRequirementsInfoNV* pInfo,
+    VkMemoryRequirements2KHR* pMemoryRequirements, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkGetAccelerationStructureMemoryRequirementsNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetAccelerationStructureMemoryRequirementsNV(device:%p, pInfo:%p, "
+        "pMemoryRequirements:%p)",
+        device, pInfo, pMemoryRequirements);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkAccelerationStructureMemoryRequirementsInfoNV* local_pInfo;
+    local_device = device;
+    local_pInfo = nullptr;
+    if (pInfo) {
+        local_pInfo = (VkAccelerationStructureMemoryRequirementsInfoNV*)pool->alloc(
+            sizeof(const VkAccelerationStructureMemoryRequirementsInfoNV));
+        deepcopy_VkAccelerationStructureMemoryRequirementsInfoNV(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfo,
+            (VkAccelerationStructureMemoryRequirementsInfoNV*)(local_pInfo));
+    }
+    if (local_pInfo) {
+        transform_tohost_VkAccelerationStructureMemoryRequirementsInfoNV(
+            sResourceTracker, (VkAccelerationStructureMemoryRequirementsInfoNV*)(local_pInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkAccelerationStructureMemoryRequirementsInfoNV(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkAccelerationStructureMemoryRequirementsInfoNV*)(local_pInfo), countPtr);
+        count_VkMemoryRequirements2KHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkMemoryRequirements2KHR*)(pMemoryRequirements), countPtr);
+    }
+    uint32_t packetSize_vkGetAccelerationStructureMemoryRequirementsNV =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetAccelerationStructureMemoryRequirementsNV);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetAccelerationStructureMemoryRequirementsNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetAccelerationStructureMemoryRequirementsNV =
+        OP_vkGetAccelerationStructureMemoryRequirementsNV;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetAccelerationStructureMemoryRequirementsNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetAccelerationStructureMemoryRequirementsNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkAccelerationStructureMemoryRequirementsInfoNV(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkAccelerationStructureMemoryRequirementsInfoNV*)(local_pInfo), streamPtrPtr);
+    reservedmarshal_VkMemoryRequirements2KHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                             (VkMemoryRequirements2KHR*)(pMemoryRequirements),
+                                             streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetAccelerationStructureMemoryRequirementsNV),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkMemoryRequirements2KHR(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkMemoryRequirements2KHR*)(pMemoryRequirements));
+    if (pMemoryRequirements) {
+        transform_fromhost_VkMemoryRequirements2KHR(
+            sResourceTracker, (VkMemoryRequirements2KHR*)(pMemoryRequirements));
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkBindAccelerationStructureMemoryNV(
+    VkDevice device, uint32_t bindInfoCount,
+    const VkBindAccelerationStructureMemoryInfoNV* pBindInfos, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkBindAccelerationStructureMemoryNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkBindAccelerationStructureMemoryNV(device:%p, bindInfoCount:%d, pBindInfos:%p)", device,
+        bindInfoCount, pBindInfos);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    uint32_t local_bindInfoCount;
+    VkBindAccelerationStructureMemoryInfoNV* local_pBindInfos;
+    local_device = device;
+    local_bindInfoCount = bindInfoCount;
+    local_pBindInfos = nullptr;
+    if (pBindInfos) {
+        local_pBindInfos = (VkBindAccelerationStructureMemoryInfoNV*)pool->alloc(
+            ((bindInfoCount)) * sizeof(const VkBindAccelerationStructureMemoryInfoNV));
+        for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) {
+            deepcopy_VkBindAccelerationStructureMemoryInfoNV(
+                pool, VK_STRUCTURE_TYPE_MAX_ENUM, pBindInfos + i,
+                (VkBindAccelerationStructureMemoryInfoNV*)(local_pBindInfos + i));
+        }
+    }
+    if (local_pBindInfos) {
+        for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) {
+            transform_tohost_VkBindAccelerationStructureMemoryInfoNV(
+                sResourceTracker, (VkBindAccelerationStructureMemoryInfoNV*)(local_pBindInfos + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) {
+            count_VkBindAccelerationStructureMemoryInfoNV(
+                sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkBindAccelerationStructureMemoryInfoNV*)(local_pBindInfos + i), countPtr);
+        }
+    }
+    uint32_t packetSize_vkBindAccelerationStructureMemoryNV =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkBindAccelerationStructureMemoryNV);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkBindAccelerationStructureMemoryNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkBindAccelerationStructureMemoryNV = OP_vkBindAccelerationStructureMemoryNV;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkBindAccelerationStructureMemoryNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkBindAccelerationStructureMemoryNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) {
+        reservedmarshal_VkBindAccelerationStructureMemoryInfoNV(
+            stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkBindAccelerationStructureMemoryInfoNV*)(local_pBindInfos + i), streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkBindAccelerationStructureMemoryNV),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkBindAccelerationStructureMemoryNV_VkResult_return = (VkResult)0;
+    stream->read(&vkBindAccelerationStructureMemoryNV_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkBindAccelerationStructureMemoryNV_VkResult_return;
+}
+
+void VkEncoder::vkCmdBuildAccelerationStructureNV(VkCommandBuffer commandBuffer,
+                                                  const VkAccelerationStructureInfoNV* pInfo,
+                                                  VkBuffer instanceData,
+                                                  VkDeviceSize instanceOffset, VkBool32 update,
+                                                  VkAccelerationStructureNV dst,
+                                                  VkAccelerationStructureNV src, VkBuffer scratch,
+                                                  VkDeviceSize scratchOffset, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdBuildAccelerationStructureNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdBuildAccelerationStructureNV(commandBuffer:%p, pInfo:%p, instanceData:%p, "
+        "instanceOffset:%ld, update:%d, dst:%p, src:%p, scratch:%p, scratchOffset:%ld)",
+        commandBuffer, pInfo, instanceData, instanceOffset, update, dst, src, scratch,
+        scratchOffset);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkAccelerationStructureInfoNV* local_pInfo;
+    VkBuffer local_instanceData;
+    VkDeviceSize local_instanceOffset;
+    VkBool32 local_update;
+    VkAccelerationStructureNV local_dst;
+    VkAccelerationStructureNV local_src;
+    VkBuffer local_scratch;
+    VkDeviceSize local_scratchOffset;
+    local_commandBuffer = commandBuffer;
+    local_pInfo = nullptr;
+    if (pInfo) {
+        local_pInfo = (VkAccelerationStructureInfoNV*)pool->alloc(
+            sizeof(const VkAccelerationStructureInfoNV));
+        deepcopy_VkAccelerationStructureInfoNV(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfo,
+                                               (VkAccelerationStructureInfoNV*)(local_pInfo));
+    }
+    local_instanceData = instanceData;
+    local_instanceOffset = instanceOffset;
+    local_update = update;
+    local_dst = dst;
+    local_src = src;
+    local_scratch = scratch;
+    local_scratchOffset = scratchOffset;
+    if (local_pInfo) {
+        transform_tohost_VkAccelerationStructureInfoNV(
+            sResourceTracker, (VkAccelerationStructureInfoNV*)(local_pInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkAccelerationStructureInfoNV(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                            (VkAccelerationStructureInfoNV*)(local_pInfo),
+                                            countPtr);
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        *countPtr += sizeof(VkBool32);
+        uint64_t cgen_var_2;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_3;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_4;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+    }
+    uint32_t packetSize_vkCmdBuildAccelerationStructureNV = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdBuildAccelerationStructureNV);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdBuildAccelerationStructureNV -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdBuildAccelerationStructureNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdBuildAccelerationStructureNV = OP_vkCmdBuildAccelerationStructureNV;
+    memcpy(streamPtr, &opcode_vkCmdBuildAccelerationStructureNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdBuildAccelerationStructureNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkAccelerationStructureInfoNV(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                  (VkAccelerationStructureInfoNV*)(local_pInfo),
+                                                  streamPtrPtr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&local_instanceData));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_instanceOffset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    memcpy(*streamPtrPtr, (VkBool32*)&local_update, sizeof(VkBool32));
+    *streamPtrPtr += sizeof(VkBool32);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkAccelerationStructureNV((*&local_dst));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = get_host_u64_VkAccelerationStructureNV((*&local_src));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_3;
+    *&cgen_var_3 = get_host_u64_VkBuffer((*&local_scratch));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_3, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_scratchOffset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdBuildAccelerationStructureNV), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdCopyAccelerationStructureNV(VkCommandBuffer commandBuffer,
+                                                 VkAccelerationStructureNV dst,
+                                                 VkAccelerationStructureNV src,
+                                                 VkCopyAccelerationStructureModeKHR mode,
+                                                 uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdCopyAccelerationStructureNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdCopyAccelerationStructureNV(commandBuffer:%p, dst:%p, src:%p)",
+                      commandBuffer, dst, src);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkAccelerationStructureNV local_dst;
+    VkAccelerationStructureNV local_src;
+    VkCopyAccelerationStructureModeKHR local_mode;
+    local_commandBuffer = commandBuffer;
+    local_dst = dst;
+    local_src = src;
+    local_mode = mode;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_2;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkCopyAccelerationStructureModeKHR);
+    }
+    uint32_t packetSize_vkCmdCopyAccelerationStructureNV = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdCopyAccelerationStructureNV);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdCopyAccelerationStructureNV -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdCopyAccelerationStructureNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdCopyAccelerationStructureNV = OP_vkCmdCopyAccelerationStructureNV;
+    memcpy(streamPtr, &opcode_vkCmdCopyAccelerationStructureNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdCopyAccelerationStructureNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkAccelerationStructureNV((*&local_dst));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkAccelerationStructureNV((*&local_src));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkCopyAccelerationStructureModeKHR*)&local_mode,
+           sizeof(VkCopyAccelerationStructureModeKHR));
+    *streamPtrPtr += sizeof(VkCopyAccelerationStructureModeKHR);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdCopyAccelerationStructureNV), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdTraceRaysNV(
+    VkCommandBuffer commandBuffer, VkBuffer raygenShaderBindingTableBuffer,
+    VkDeviceSize raygenShaderBindingOffset, VkBuffer missShaderBindingTableBuffer,
+    VkDeviceSize missShaderBindingOffset, VkDeviceSize missShaderBindingStride,
+    VkBuffer hitShaderBindingTableBuffer, VkDeviceSize hitShaderBindingOffset,
+    VkDeviceSize hitShaderBindingStride, VkBuffer callableShaderBindingTableBuffer,
+    VkDeviceSize callableShaderBindingOffset, VkDeviceSize callableShaderBindingStride,
+    uint32_t width, uint32_t height, uint32_t depth, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdTraceRaysNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdTraceRaysNV(commandBuffer:%p, raygenShaderBindingTableBuffer:%p, "
+        "raygenShaderBindingOffset:%ld, missShaderBindingTableBuffer:%p, "
+        "missShaderBindingOffset:%ld, missShaderBindingStride:%ld, hitShaderBindingTableBuffer:%p, "
+        "hitShaderBindingOffset:%ld, hitShaderBindingStride:%ld, "
+        "callableShaderBindingTableBuffer:%p, callableShaderBindingOffset:%ld, "
+        "callableShaderBindingStride:%ld, width:%d, height:%d, depth:%d)",
+        commandBuffer, raygenShaderBindingTableBuffer, raygenShaderBindingOffset,
+        missShaderBindingTableBuffer, missShaderBindingOffset, missShaderBindingStride,
+        hitShaderBindingTableBuffer, hitShaderBindingOffset, hitShaderBindingStride,
+        callableShaderBindingTableBuffer, callableShaderBindingOffset, callableShaderBindingStride,
+        width, height, depth);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkBuffer local_raygenShaderBindingTableBuffer;
+    VkDeviceSize local_raygenShaderBindingOffset;
+    VkBuffer local_missShaderBindingTableBuffer;
+    VkDeviceSize local_missShaderBindingOffset;
+    VkDeviceSize local_missShaderBindingStride;
+    VkBuffer local_hitShaderBindingTableBuffer;
+    VkDeviceSize local_hitShaderBindingOffset;
+    VkDeviceSize local_hitShaderBindingStride;
+    VkBuffer local_callableShaderBindingTableBuffer;
+    VkDeviceSize local_callableShaderBindingOffset;
+    VkDeviceSize local_callableShaderBindingStride;
+    uint32_t local_width;
+    uint32_t local_height;
+    uint32_t local_depth;
+    local_commandBuffer = commandBuffer;
+    local_raygenShaderBindingTableBuffer = raygenShaderBindingTableBuffer;
+    local_raygenShaderBindingOffset = raygenShaderBindingOffset;
+    local_missShaderBindingTableBuffer = missShaderBindingTableBuffer;
+    local_missShaderBindingOffset = missShaderBindingOffset;
+    local_missShaderBindingStride = missShaderBindingStride;
+    local_hitShaderBindingTableBuffer = hitShaderBindingTableBuffer;
+    local_hitShaderBindingOffset = hitShaderBindingOffset;
+    local_hitShaderBindingStride = hitShaderBindingStride;
+    local_callableShaderBindingTableBuffer = callableShaderBindingTableBuffer;
+    local_callableShaderBindingOffset = callableShaderBindingOffset;
+    local_callableShaderBindingStride = callableShaderBindingStride;
+    local_width = width;
+    local_height = height;
+    local_depth = depth;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        uint64_t cgen_var_2;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        *countPtr += sizeof(VkDeviceSize);
+        uint64_t cgen_var_3;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        *countPtr += sizeof(VkDeviceSize);
+        uint64_t cgen_var_4;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        *countPtr += sizeof(VkDeviceSize);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdTraceRaysNV = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdTraceRaysNV);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdTraceRaysNV -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdTraceRaysNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdTraceRaysNV = OP_vkCmdTraceRaysNV;
+    memcpy(streamPtr, &opcode_vkCmdTraceRaysNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdTraceRaysNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&local_raygenShaderBindingTableBuffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_raygenShaderBindingOffset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkBuffer((*&local_missShaderBindingTableBuffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_missShaderBindingOffset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_missShaderBindingStride, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = get_host_u64_VkBuffer((*&local_hitShaderBindingTableBuffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_hitShaderBindingOffset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_hitShaderBindingStride, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    uint64_t cgen_var_3;
+    *&cgen_var_3 = get_host_u64_VkBuffer((*&local_callableShaderBindingTableBuffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_3, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_callableShaderBindingOffset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_callableShaderBindingStride, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_width, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_height, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_depth, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdTraceRaysNV), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkCreateRayTracingPipelinesNV(
+    VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount,
+    const VkRayTracingPipelineCreateInfoNV* pCreateInfos, const VkAllocationCallbacks* pAllocator,
+    VkPipeline* pPipelines, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateRayTracingPipelinesNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateRayTracingPipelinesNV(device:%p, pipelineCache:%p, createInfoCount:%d, "
+        "pCreateInfos:%p, pAllocator:%p, pPipelines:%p)",
+        device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkPipelineCache local_pipelineCache;
+    uint32_t local_createInfoCount;
+    VkRayTracingPipelineCreateInfoNV* local_pCreateInfos;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pipelineCache = pipelineCache;
+    local_createInfoCount = createInfoCount;
+    local_pCreateInfos = nullptr;
+    if (pCreateInfos) {
+        local_pCreateInfos = (VkRayTracingPipelineCreateInfoNV*)pool->alloc(
+            ((createInfoCount)) * sizeof(const VkRayTracingPipelineCreateInfoNV));
+        for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) {
+            deepcopy_VkRayTracingPipelineCreateInfoNV(
+                pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfos + i,
+                (VkRayTracingPipelineCreateInfoNV*)(local_pCreateInfos + i));
+        }
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfos) {
+        for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) {
+            transform_tohost_VkRayTracingPipelineCreateInfoNV(
+                sResourceTracker, (VkRayTracingPipelineCreateInfoNV*)(local_pCreateInfos + i));
+        }
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) {
+            count_VkRayTracingPipelineCreateInfoNV(
+                sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkRayTracingPipelineCreateInfoNV*)(local_pCreateInfos + i), countPtr);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        if (((createInfoCount))) {
+            *countPtr += ((createInfoCount)) * 8;
+        }
+    }
+    uint32_t packetSize_vkCreateRayTracingPipelinesNV =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCreateRayTracingPipelinesNV);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateRayTracingPipelinesNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateRayTracingPipelinesNV = OP_vkCreateRayTracingPipelinesNV;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateRayTracingPipelinesNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateRayTracingPipelinesNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkPipelineCache((*&local_pipelineCache));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_createInfoCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) {
+        reservedmarshal_VkRayTracingPipelineCreateInfoNV(
+            stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkRayTracingPipelineCreateInfoNV*)(local_pCreateInfos + i), streamPtrPtr);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    if (((createInfoCount))) {
+        uint8_t* cgen_var_3_ptr = (uint8_t*)(*streamPtrPtr);
+        for (uint32_t k = 0; k < ((createInfoCount)); ++k) {
+            uint64_t tmpval = (uint64_t)(pPipelines[k]);
+            memcpy(cgen_var_3_ptr + k * 8, &tmpval, sizeof(uint64_t));
+        }
+        *streamPtrPtr += 8 * ((createInfoCount));
+    }
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateRayTracingPipelinesNV), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    if (((createInfoCount))) {
+        uint64_t* cgen_var_4;
+        stream->alloc((void**)&cgen_var_4, ((createInfoCount)) * 8);
+        stream->read((uint64_t*)cgen_var_4, ((createInfoCount)) * 8);
+        stream->handleMapping()->mapHandles_u64_VkPipeline(cgen_var_4, (VkPipeline*)pPipelines,
+                                                           ((createInfoCount)));
+    }
+    VkResult vkCreateRayTracingPipelinesNV_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateRayTracingPipelinesNV_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateRayTracingPipelinesNV_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetRayTracingShaderGroupHandlesKHR(VkDevice device, VkPipeline pipeline,
+                                                         uint32_t firstGroup, uint32_t groupCount,
+                                                         size_t dataSize, void* pData,
+                                                         uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetRayTracingShaderGroupHandlesKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetRayTracingShaderGroupHandlesKHR(device:%p, pipeline:%p, firstGroup:%d, "
+        "groupCount:%d, dataSize:%ld, pData:%p)",
+        device, pipeline, firstGroup, groupCount, dataSize, pData);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkPipeline local_pipeline;
+    uint32_t local_firstGroup;
+    uint32_t local_groupCount;
+    size_t local_dataSize;
+    local_device = device;
+    local_pipeline = pipeline;
+    local_firstGroup = firstGroup;
+    local_groupCount = groupCount;
+    local_dataSize = dataSize;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += 8;
+        *countPtr += ((dataSize)) * sizeof(uint8_t);
+    }
+    uint32_t packetSize_vkGetRayTracingShaderGroupHandlesKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetRayTracingShaderGroupHandlesKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetRayTracingShaderGroupHandlesKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetRayTracingShaderGroupHandlesKHR = OP_vkGetRayTracingShaderGroupHandlesKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetRayTracingShaderGroupHandlesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetRayTracingShaderGroupHandlesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkPipeline((*&local_pipeline));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstGroup, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_groupCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    uint64_t cgen_var_2 = (uint64_t)local_dataSize;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    memcpy(*streamPtrPtr, (void*)pData, ((dataSize)) * sizeof(uint8_t));
+    *streamPtrPtr += ((dataSize)) * sizeof(uint8_t);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetRayTracingShaderGroupHandlesKHR),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((void*)pData, ((dataSize)) * sizeof(uint8_t));
+    VkResult vkGetRayTracingShaderGroupHandlesKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetRayTracingShaderGroupHandlesKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetRayTracingShaderGroupHandlesKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetRayTracingShaderGroupHandlesNV(VkDevice device, VkPipeline pipeline,
+                                                        uint32_t firstGroup, uint32_t groupCount,
+                                                        size_t dataSize, void* pData,
+                                                        uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetRayTracingShaderGroupHandlesNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetRayTracingShaderGroupHandlesNV(device:%p, pipeline:%p, firstGroup:%d, groupCount:%d, "
+        "dataSize:%ld, pData:%p)",
+        device, pipeline, firstGroup, groupCount, dataSize, pData);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkPipeline local_pipeline;
+    uint32_t local_firstGroup;
+    uint32_t local_groupCount;
+    size_t local_dataSize;
+    local_device = device;
+    local_pipeline = pipeline;
+    local_firstGroup = firstGroup;
+    local_groupCount = groupCount;
+    local_dataSize = dataSize;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += 8;
+        *countPtr += ((dataSize)) * sizeof(uint8_t);
+    }
+    uint32_t packetSize_vkGetRayTracingShaderGroupHandlesNV =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetRayTracingShaderGroupHandlesNV);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetRayTracingShaderGroupHandlesNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetRayTracingShaderGroupHandlesNV = OP_vkGetRayTracingShaderGroupHandlesNV;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetRayTracingShaderGroupHandlesNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetRayTracingShaderGroupHandlesNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkPipeline((*&local_pipeline));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstGroup, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_groupCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    uint64_t cgen_var_2 = (uint64_t)local_dataSize;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    memcpy(*streamPtrPtr, (void*)pData, ((dataSize)) * sizeof(uint8_t));
+    *streamPtrPtr += ((dataSize)) * sizeof(uint8_t);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetRayTracingShaderGroupHandlesNV),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((void*)pData, ((dataSize)) * sizeof(uint8_t));
+    VkResult vkGetRayTracingShaderGroupHandlesNV_VkResult_return = (VkResult)0;
+    stream->read(&vkGetRayTracingShaderGroupHandlesNV_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetRayTracingShaderGroupHandlesNV_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetAccelerationStructureHandleNV(
+    VkDevice device, VkAccelerationStructureNV accelerationStructure, size_t dataSize, void* pData,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetAccelerationStructureHandleNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetAccelerationStructureHandleNV(device:%p, accelerationStructure:%p, dataSize:%ld, "
+        "pData:%p)",
+        device, accelerationStructure, dataSize, pData);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkAccelerationStructureNV local_accelerationStructure;
+    size_t local_dataSize;
+    local_device = device;
+    local_accelerationStructure = accelerationStructure;
+    local_dataSize = dataSize;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += 8;
+        *countPtr += ((dataSize)) * sizeof(uint8_t);
+    }
+    uint32_t packetSize_vkGetAccelerationStructureHandleNV =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetAccelerationStructureHandleNV);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetAccelerationStructureHandleNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetAccelerationStructureHandleNV = OP_vkGetAccelerationStructureHandleNV;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetAccelerationStructureHandleNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetAccelerationStructureHandleNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkAccelerationStructureNV((*&local_accelerationStructure));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_2 = (uint64_t)local_dataSize;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    memcpy(*streamPtrPtr, (void*)pData, ((dataSize)) * sizeof(uint8_t));
+    *streamPtrPtr += ((dataSize)) * sizeof(uint8_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetAccelerationStructureHandleNV), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((void*)pData, ((dataSize)) * sizeof(uint8_t));
+    VkResult vkGetAccelerationStructureHandleNV_VkResult_return = (VkResult)0;
+    stream->read(&vkGetAccelerationStructureHandleNV_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetAccelerationStructureHandleNV_VkResult_return;
+}
+
+void VkEncoder::vkCmdWriteAccelerationStructuresPropertiesNV(
+    VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount,
+    const VkAccelerationStructureNV* pAccelerationStructures, VkQueryType queryType,
+    VkQueryPool queryPool, uint32_t firstQuery, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkCmdWriteAccelerationStructuresPropertiesNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdWriteAccelerationStructuresPropertiesNV(commandBuffer:%p, "
+        "accelerationStructureCount:%d, pAccelerationStructures:%p, queryPool:%p, firstQuery:%d)",
+        commandBuffer, accelerationStructureCount, pAccelerationStructures, queryPool, firstQuery);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_accelerationStructureCount;
+    VkAccelerationStructureNV* local_pAccelerationStructures;
+    VkQueryType local_queryType;
+    VkQueryPool local_queryPool;
+    uint32_t local_firstQuery;
+    local_commandBuffer = commandBuffer;
+    local_accelerationStructureCount = accelerationStructureCount;
+    // Avoiding deepcopy for pAccelerationStructures
+    local_pAccelerationStructures = (VkAccelerationStructureNV*)pAccelerationStructures;
+    local_queryType = queryType;
+    local_queryPool = queryPool;
+    local_firstQuery = firstQuery;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        if (((accelerationStructureCount))) {
+            *countPtr += ((accelerationStructureCount)) * 8;
+        }
+        *countPtr += sizeof(VkQueryType);
+        uint64_t cgen_var_2;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdWriteAccelerationStructuresPropertiesNV = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdWriteAccelerationStructuresPropertiesNV);
+    if (queueSubmitWithCommandsEnabled)
+        packetSize_vkCmdWriteAccelerationStructuresPropertiesNV -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdWriteAccelerationStructuresPropertiesNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdWriteAccelerationStructuresPropertiesNV =
+        OP_vkCmdWriteAccelerationStructuresPropertiesNV;
+    memcpy(streamPtr, &opcode_vkCmdWriteAccelerationStructuresPropertiesNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdWriteAccelerationStructuresPropertiesNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_accelerationStructureCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (((accelerationStructureCount))) {
+        uint8_t* cgen_var_0_ptr = (uint8_t*)(*streamPtrPtr);
+        for (uint32_t k = 0; k < ((accelerationStructureCount)); ++k) {
+            uint64_t tmpval =
+                get_host_u64_VkAccelerationStructureNV(local_pAccelerationStructures[k]);
+            memcpy(cgen_var_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+        }
+        *streamPtrPtr += 8 * ((accelerationStructureCount));
+    }
+    memcpy(*streamPtrPtr, (VkQueryType*)&local_queryType, sizeof(VkQueryType));
+    *streamPtrPtr += sizeof(VkQueryType);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkQueryPool((*&local_queryPool));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstQuery, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdWriteAccelerationStructuresPropertiesNV),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkCompileDeferredNV(VkDevice device, VkPipeline pipeline, uint32_t shader,
+                                        uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCompileDeferredNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCompileDeferredNV(device:%p, pipeline:%p, shader:%d)", device, pipeline,
+                      shader);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkPipeline local_pipeline;
+    uint32_t local_shader;
+    local_device = device;
+    local_pipeline = pipeline;
+    local_shader = shader;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCompileDeferredNV =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCompileDeferredNV);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCompileDeferredNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCompileDeferredNV = OP_vkCompileDeferredNV;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCompileDeferredNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCompileDeferredNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkPipeline((*&local_pipeline));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_shader, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCompileDeferredNV), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkCompileDeferredNV_VkResult_return = (VkResult)0;
+    stream->read(&vkCompileDeferredNV_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCompileDeferredNV_VkResult_return;
+}
+
+#endif
+#ifdef VK_NV_representative_fragment_test
+#endif
+#ifdef VK_EXT_filter_cubic
+#endif
+#ifdef VK_QCOM_render_pass_shader_resolve
+#endif
+#ifdef VK_EXT_global_priority
+#endif
+#ifdef VK_EXT_external_memory_host
+VkResult VkEncoder::vkGetMemoryHostPointerPropertiesEXT(
+    VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void* pHostPointer,
+    VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetMemoryHostPointerPropertiesEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetMemoryHostPointerPropertiesEXT(device:%p, pHostPointer:%p, "
+        "pMemoryHostPointerProperties:%p)",
+        device, pHostPointer, pMemoryHostPointerProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkExternalMemoryHandleTypeFlagBits local_handleType;
+    void* local_pHostPointer;
+    local_device = device;
+    local_handleType = handleType;
+    // Avoiding deepcopy for pHostPointer
+    local_pHostPointer = (void*)pHostPointer;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkExternalMemoryHandleTypeFlagBits);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pHostPointer) {
+            *countPtr += sizeof(uint8_t);
+        }
+        count_VkMemoryHostPointerPropertiesEXT(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties), countPtr);
+    }
+    uint32_t packetSize_vkGetMemoryHostPointerPropertiesEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetMemoryHostPointerPropertiesEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetMemoryHostPointerPropertiesEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetMemoryHostPointerPropertiesEXT = OP_vkGetMemoryHostPointerPropertiesEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetMemoryHostPointerPropertiesEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetMemoryHostPointerPropertiesEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkExternalMemoryHandleTypeFlagBits*)&local_handleType,
+           sizeof(VkExternalMemoryHandleTypeFlagBits));
+    *streamPtrPtr += sizeof(VkExternalMemoryHandleTypeFlagBits);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pHostPointer;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pHostPointer) {
+        memcpy(*streamPtrPtr, (void*)local_pHostPointer, sizeof(uint8_t));
+        *streamPtrPtr += sizeof(uint8_t);
+    }
+    reservedmarshal_VkMemoryHostPointerPropertiesEXT(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetMemoryHostPointerPropertiesEXT),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkMemoryHostPointerPropertiesEXT(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties));
+    if (pMemoryHostPointerProperties) {
+        transform_fromhost_VkMemoryHostPointerPropertiesEXT(
+            sResourceTracker, (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties));
+    }
+    VkResult vkGetMemoryHostPointerPropertiesEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkGetMemoryHostPointerPropertiesEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetMemoryHostPointerPropertiesEXT_VkResult_return;
+}
+
+#endif
+#ifdef VK_AMD_buffer_marker
+void VkEncoder::vkCmdWriteBufferMarkerAMD(VkCommandBuffer commandBuffer,
+                                          VkPipelineStageFlagBits pipelineStage, VkBuffer dstBuffer,
+                                          VkDeviceSize dstOffset, uint32_t marker,
+                                          uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdWriteBufferMarkerAMD in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdWriteBufferMarkerAMD(commandBuffer:%p, dstBuffer:%p, dstOffset:%ld, marker:%d)",
+        commandBuffer, dstBuffer, dstOffset, marker);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkPipelineStageFlagBits local_pipelineStage;
+    VkBuffer local_dstBuffer;
+    VkDeviceSize local_dstOffset;
+    uint32_t local_marker;
+    local_commandBuffer = commandBuffer;
+    local_pipelineStage = pipelineStage;
+    local_dstBuffer = dstBuffer;
+    local_dstOffset = dstOffset;
+    local_marker = marker;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkPipelineStageFlagBits);
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdWriteBufferMarkerAMD = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdWriteBufferMarkerAMD);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdWriteBufferMarkerAMD -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdWriteBufferMarkerAMD);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdWriteBufferMarkerAMD = OP_vkCmdWriteBufferMarkerAMD;
+    memcpy(streamPtr, &opcode_vkCmdWriteBufferMarkerAMD, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdWriteBufferMarkerAMD, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkPipelineStageFlagBits*)&local_pipelineStage,
+           sizeof(VkPipelineStageFlagBits));
+    *streamPtrPtr += sizeof(VkPipelineStageFlagBits);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&local_dstBuffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_marker, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdWriteBufferMarkerAMD), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_AMD_pipeline_compiler_control
+#endif
+#ifdef VK_EXT_calibrated_timestamps
+VkResult VkEncoder::vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(VkPhysicalDevice physicalDevice,
+                                                                   uint32_t* pTimeDomainCount,
+                                                                   VkTimeDomainEXT* pTimeDomains,
+                                                                   uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkGetPhysicalDeviceCalibrateableTimeDomainsEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(physicalDevice:%p, pTimeDomainCount:%p, "
+        "pTimeDomains:%p)",
+        physicalDevice, pTimeDomainCount, pTimeDomains);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    local_physicalDevice = physicalDevice;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pTimeDomainCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pTimeDomains) {
+            if (pTimeDomainCount) {
+                *countPtr += (*(pTimeDomainCount)) * sizeof(VkTimeDomainEXT);
+            }
+        }
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT =
+        OP_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pTimeDomainCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pTimeDomainCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pTimeDomainCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pTimeDomains;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pTimeDomains) {
+        memcpy(*streamPtrPtr, (VkTimeDomainEXT*)pTimeDomains,
+               (*(pTimeDomainCount)) * sizeof(VkTimeDomainEXT));
+        *streamPtrPtr += (*(pTimeDomainCount)) * sizeof(VkTimeDomainEXT);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pTimeDomainCount;
+    check_pTimeDomainCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pTimeDomainCount) {
+        if (!(check_pTimeDomainCount)) {
+            fprintf(stderr, "fatal: pTimeDomainCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pTimeDomainCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkTimeDomainEXT* check_pTimeDomains;
+    check_pTimeDomains = (VkTimeDomainEXT*)(uintptr_t)stream->getBe64();
+    if (pTimeDomains) {
+        if (!(check_pTimeDomains)) {
+            fprintf(stderr, "fatal: pTimeDomains inconsistent between guest and host\n");
+        }
+        stream->read((VkTimeDomainEXT*)pTimeDomains,
+                     (*(pTimeDomainCount)) * sizeof(VkTimeDomainEXT));
+    }
+    VkResult vkGetPhysicalDeviceCalibrateableTimeDomainsEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkGetPhysicalDeviceCalibrateableTimeDomainsEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDeviceCalibrateableTimeDomainsEXT_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetCalibratedTimestampsEXT(
+    VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoEXT* pTimestampInfos,
+    uint64_t* pTimestamps, uint64_t* pMaxDeviation, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetCalibratedTimestampsEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetCalibratedTimestampsEXT(device:%p, timestampCount:%d, pTimestampInfos:%p, "
+        "pTimestamps:%p, pMaxDeviation:%p)",
+        device, timestampCount, pTimestampInfos, pTimestamps, pMaxDeviation);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    uint32_t local_timestampCount;
+    VkCalibratedTimestampInfoEXT* local_pTimestampInfos;
+    local_device = device;
+    local_timestampCount = timestampCount;
+    local_pTimestampInfos = nullptr;
+    if (pTimestampInfos) {
+        local_pTimestampInfos = (VkCalibratedTimestampInfoEXT*)pool->alloc(
+            ((timestampCount)) * sizeof(const VkCalibratedTimestampInfoEXT));
+        for (uint32_t i = 0; i < (uint32_t)((timestampCount)); ++i) {
+            deepcopy_VkCalibratedTimestampInfoEXT(
+                pool, VK_STRUCTURE_TYPE_MAX_ENUM, pTimestampInfos + i,
+                (VkCalibratedTimestampInfoEXT*)(local_pTimestampInfos + i));
+        }
+    }
+    if (local_pTimestampInfos) {
+        for (uint32_t i = 0; i < (uint32_t)((timestampCount)); ++i) {
+            transform_tohost_VkCalibratedTimestampInfoEXT(
+                sResourceTracker, (VkCalibratedTimestampInfoEXT*)(local_pTimestampInfos + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((timestampCount)); ++i) {
+            count_VkCalibratedTimestampInfoEXT(
+                sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkCalibratedTimestampInfoEXT*)(local_pTimestampInfos + i), countPtr);
+        }
+        *countPtr += ((timestampCount)) * sizeof(uint64_t);
+        *countPtr += sizeof(uint64_t);
+    }
+    uint32_t packetSize_vkGetCalibratedTimestampsEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetCalibratedTimestampsEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetCalibratedTimestampsEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetCalibratedTimestampsEXT = OP_vkGetCalibratedTimestampsEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetCalibratedTimestampsEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetCalibratedTimestampsEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_timestampCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((timestampCount)); ++i) {
+        reservedmarshal_VkCalibratedTimestampInfoEXT(
+            stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkCalibratedTimestampInfoEXT*)(local_pTimestampInfos + i), streamPtrPtr);
+    }
+    memcpy(*streamPtrPtr, (uint64_t*)pTimestamps, ((timestampCount)) * sizeof(uint64_t));
+    *streamPtrPtr += ((timestampCount)) * sizeof(uint64_t);
+    memcpy(*streamPtrPtr, (uint64_t*)pMaxDeviation, sizeof(uint64_t));
+    *streamPtrPtr += sizeof(uint64_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetCalibratedTimestampsEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((uint64_t*)pTimestamps, ((timestampCount)) * sizeof(uint64_t));
+    stream->read((uint64_t*)pMaxDeviation, sizeof(uint64_t));
+    VkResult vkGetCalibratedTimestampsEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkGetCalibratedTimestampsEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetCalibratedTimestampsEXT_VkResult_return;
+}
+
+#endif
+#ifdef VK_AMD_shader_core_properties
+#endif
+#ifdef VK_EXT_video_decode_h265
+#endif
+#ifdef VK_AMD_memory_overallocation_behavior
+#endif
+#ifdef VK_EXT_vertex_attribute_divisor
+#endif
+#ifdef VK_GGP_frame_token
+#endif
+#ifdef VK_EXT_pipeline_creation_feedback
+#endif
+#ifdef VK_NV_shader_subgroup_partitioned
+#endif
+#ifdef VK_NV_compute_shader_derivatives
+#endif
+#ifdef VK_NV_mesh_shader
+void VkEncoder::vkCmdDrawMeshTasksNV(VkCommandBuffer commandBuffer, uint32_t taskCount,
+                                     uint32_t firstTask, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdDrawMeshTasksNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdDrawMeshTasksNV(commandBuffer:%p, taskCount:%d, firstTask:%d)",
+                      commandBuffer, taskCount, firstTask);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_taskCount;
+    uint32_t local_firstTask;
+    local_commandBuffer = commandBuffer;
+    local_taskCount = taskCount;
+    local_firstTask = firstTask;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdDrawMeshTasksNV = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdDrawMeshTasksNV);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdDrawMeshTasksNV -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdDrawMeshTasksNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdDrawMeshTasksNV = OP_vkCmdDrawMeshTasksNV;
+    memcpy(streamPtr, &opcode_vkCmdDrawMeshTasksNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdDrawMeshTasksNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_taskCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstTask, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdDrawMeshTasksNV), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdDrawMeshTasksIndirectNV(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                             VkDeviceSize offset, uint32_t drawCount,
+                                             uint32_t stride, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdDrawMeshTasksIndirectNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdDrawMeshTasksIndirectNV(commandBuffer:%p, buffer:%p, offset:%ld, drawCount:%d, "
+        "stride:%d)",
+        commandBuffer, buffer, offset, drawCount, stride);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkBuffer local_buffer;
+    VkDeviceSize local_offset;
+    uint32_t local_drawCount;
+    uint32_t local_stride;
+    local_commandBuffer = commandBuffer;
+    local_buffer = buffer;
+    local_offset = offset;
+    local_drawCount = drawCount;
+    local_stride = stride;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdDrawMeshTasksIndirectNV = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdDrawMeshTasksIndirectNV);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdDrawMeshTasksIndirectNV -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdDrawMeshTasksIndirectNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdDrawMeshTasksIndirectNV = OP_vkCmdDrawMeshTasksIndirectNV;
+    memcpy(streamPtr, &opcode_vkCmdDrawMeshTasksIndirectNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdDrawMeshTasksIndirectNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&local_buffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_drawCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_stride, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdDrawMeshTasksIndirectNV), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdDrawMeshTasksIndirectCountNV(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                                  VkDeviceSize offset, VkBuffer countBuffer,
+                                                  VkDeviceSize countBufferOffset,
+                                                  uint32_t maxDrawCount, uint32_t stride,
+                                                  uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdDrawMeshTasksIndirectCountNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdDrawMeshTasksIndirectCountNV(commandBuffer:%p, buffer:%p, offset:%ld, "
+        "countBuffer:%p, countBufferOffset:%ld, maxDrawCount:%d, stride:%d)",
+        commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkBuffer local_buffer;
+    VkDeviceSize local_offset;
+    VkBuffer local_countBuffer;
+    VkDeviceSize local_countBufferOffset;
+    uint32_t local_maxDrawCount;
+    uint32_t local_stride;
+    local_commandBuffer = commandBuffer;
+    local_buffer = buffer;
+    local_offset = offset;
+    local_countBuffer = countBuffer;
+    local_countBufferOffset = countBufferOffset;
+    local_maxDrawCount = maxDrawCount;
+    local_stride = stride;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        uint64_t cgen_var_2;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdDrawMeshTasksIndirectCountNV = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdDrawMeshTasksIndirectCountNV);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdDrawMeshTasksIndirectCountNV -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdDrawMeshTasksIndirectCountNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdDrawMeshTasksIndirectCountNV = OP_vkCmdDrawMeshTasksIndirectCountNV;
+    memcpy(streamPtr, &opcode_vkCmdDrawMeshTasksIndirectCountNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdDrawMeshTasksIndirectCountNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&local_buffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkBuffer((*&local_countBuffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_stride, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdDrawMeshTasksIndirectCountNV), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_NV_fragment_shader_barycentric
+#endif
+#ifdef VK_NV_shader_image_footprint
+#endif
+#ifdef VK_NV_scissor_exclusive
+void VkEncoder::vkCmdSetExclusiveScissorNV(VkCommandBuffer commandBuffer,
+                                           uint32_t firstExclusiveScissor,
+                                           uint32_t exclusiveScissorCount,
+                                           const VkRect2D* pExclusiveScissors, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetExclusiveScissorNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdSetExclusiveScissorNV(commandBuffer:%p, firstExclusiveScissor:%d, "
+        "exclusiveScissorCount:%d, pExclusiveScissors:%p)",
+        commandBuffer, firstExclusiveScissor, exclusiveScissorCount, pExclusiveScissors);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_firstExclusiveScissor;
+    uint32_t local_exclusiveScissorCount;
+    VkRect2D* local_pExclusiveScissors;
+    local_commandBuffer = commandBuffer;
+    local_firstExclusiveScissor = firstExclusiveScissor;
+    local_exclusiveScissorCount = exclusiveScissorCount;
+    local_pExclusiveScissors = nullptr;
+    if (pExclusiveScissors) {
+        local_pExclusiveScissors =
+            (VkRect2D*)pool->alloc(((exclusiveScissorCount)) * sizeof(const VkRect2D));
+        for (uint32_t i = 0; i < (uint32_t)((exclusiveScissorCount)); ++i) {
+            deepcopy_VkRect2D(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pExclusiveScissors + i,
+                              (VkRect2D*)(local_pExclusiveScissors + i));
+        }
+    }
+    if (local_pExclusiveScissors) {
+        for (uint32_t i = 0; i < (uint32_t)((exclusiveScissorCount)); ++i) {
+            transform_tohost_VkRect2D(sResourceTracker, (VkRect2D*)(local_pExclusiveScissors + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((exclusiveScissorCount)); ++i) {
+            count_VkRect2D(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                           (VkRect2D*)(local_pExclusiveScissors + i), countPtr);
+        }
+    }
+    uint32_t packetSize_vkCmdSetExclusiveScissorNV = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetExclusiveScissorNV);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetExclusiveScissorNV -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetExclusiveScissorNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetExclusiveScissorNV = OP_vkCmdSetExclusiveScissorNV;
+    memcpy(streamPtr, &opcode_vkCmdSetExclusiveScissorNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetExclusiveScissorNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstExclusiveScissor, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_exclusiveScissorCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((exclusiveScissorCount)); ++i) {
+        reservedmarshal_VkRect2D(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                 (VkRect2D*)(local_pExclusiveScissors + i), streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetExclusiveScissorNV), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+void VkEncoder::vkCmdSetCheckpointNV(VkCommandBuffer commandBuffer, const void* pCheckpointMarker,
+                                     uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetCheckpointNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdSetCheckpointNV(commandBuffer:%p, pCheckpointMarker:%p)", commandBuffer,
+                      pCheckpointMarker);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    void* local_pCheckpointMarker;
+    local_commandBuffer = commandBuffer;
+    // Avoiding deepcopy for pCheckpointMarker
+    local_pCheckpointMarker = (void*)pCheckpointMarker;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pCheckpointMarker) {
+            *countPtr += sizeof(uint8_t);
+        }
+    }
+    uint32_t packetSize_vkCmdSetCheckpointNV = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetCheckpointNV);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetCheckpointNV -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetCheckpointNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetCheckpointNV = OP_vkCmdSetCheckpointNV;
+    memcpy(streamPtr, &opcode_vkCmdSetCheckpointNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetCheckpointNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)local_pCheckpointMarker;
+    memcpy((*streamPtrPtr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pCheckpointMarker) {
+        memcpy(*streamPtrPtr, (void*)local_pCheckpointMarker, sizeof(uint8_t));
+        *streamPtrPtr += sizeof(uint8_t);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetCheckpointNV), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetQueueCheckpointDataNV(VkQueue queue, uint32_t* pCheckpointDataCount,
+                                           VkCheckpointDataNV* pCheckpointData, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetQueueCheckpointDataNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetQueueCheckpointDataNV(queue:%p, pCheckpointDataCount:%p, pCheckpointData:%p)", queue,
+        pCheckpointDataCount, pCheckpointData);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkQueue local_queue;
+    local_queue = queue;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pCheckpointDataCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pCheckpointData) {
+            if (pCheckpointDataCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) {
+                    count_VkCheckpointDataNV(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                             (VkCheckpointDataNV*)(pCheckpointData + i), countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetQueueCheckpointDataNV =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetQueueCheckpointDataNV);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetQueueCheckpointDataNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetQueueCheckpointDataNV = OP_vkGetQueueCheckpointDataNV;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetQueueCheckpointDataNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetQueueCheckpointDataNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkQueue((*&local_queue));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pCheckpointDataCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pCheckpointDataCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pCheckpointDataCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pCheckpointData;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pCheckpointData) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) {
+            reservedmarshal_VkCheckpointDataNV(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                               (VkCheckpointDataNV*)(pCheckpointData + i),
+                                               streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetQueueCheckpointDataNV), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pCheckpointDataCount;
+    check_pCheckpointDataCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pCheckpointDataCount) {
+        if (!(check_pCheckpointDataCount)) {
+            fprintf(stderr, "fatal: pCheckpointDataCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pCheckpointDataCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkCheckpointDataNV* check_pCheckpointData;
+    check_pCheckpointData = (VkCheckpointDataNV*)(uintptr_t)stream->getBe64();
+    if (pCheckpointData) {
+        if (!(check_pCheckpointData)) {
+            fprintf(stderr, "fatal: pCheckpointData inconsistent between guest and host\n");
+        }
+        if (pCheckpointDataCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) {
+                unmarshal_VkCheckpointDataNV(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                             (VkCheckpointDataNV*)(pCheckpointData + i));
+            }
+        }
+    }
+    if (pCheckpointDataCount) {
+        if (pCheckpointData) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) {
+                transform_fromhost_VkCheckpointDataNV(sResourceTracker,
+                                                      (VkCheckpointDataNV*)(pCheckpointData + i));
+            }
+        }
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_INTEL_shader_integer_functions2
+#endif
+#ifdef VK_INTEL_performance_query
+VkResult VkEncoder::vkInitializePerformanceApiINTEL(
+    VkDevice device, const VkInitializePerformanceApiInfoINTEL* pInitializeInfo, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkInitializePerformanceApiINTEL in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkInitializePerformanceApiINTEL(device:%p, pInitializeInfo:%p)", device,
+                      pInitializeInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkInitializePerformanceApiInfoINTEL* local_pInitializeInfo;
+    local_device = device;
+    local_pInitializeInfo = nullptr;
+    if (pInitializeInfo) {
+        local_pInitializeInfo = (VkInitializePerformanceApiInfoINTEL*)pool->alloc(
+            sizeof(const VkInitializePerformanceApiInfoINTEL));
+        deepcopy_VkInitializePerformanceApiInfoINTEL(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInitializeInfo,
+            (VkInitializePerformanceApiInfoINTEL*)(local_pInitializeInfo));
+    }
+    if (local_pInitializeInfo) {
+        transform_tohost_VkInitializePerformanceApiInfoINTEL(
+            sResourceTracker, (VkInitializePerformanceApiInfoINTEL*)(local_pInitializeInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkInitializePerformanceApiInfoINTEL(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkInitializePerformanceApiInfoINTEL*)(local_pInitializeInfo), countPtr);
+    }
+    uint32_t packetSize_vkInitializePerformanceApiINTEL =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkInitializePerformanceApiINTEL);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkInitializePerformanceApiINTEL);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkInitializePerformanceApiINTEL = OP_vkInitializePerformanceApiINTEL;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkInitializePerformanceApiINTEL, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkInitializePerformanceApiINTEL, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkInitializePerformanceApiInfoINTEL(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkInitializePerformanceApiInfoINTEL*)(local_pInitializeInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkInitializePerformanceApiINTEL), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkInitializePerformanceApiINTEL_VkResult_return = (VkResult)0;
+    stream->read(&vkInitializePerformanceApiINTEL_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkInitializePerformanceApiINTEL_VkResult_return;
+}
+
+void VkEncoder::vkUninitializePerformanceApiINTEL(VkDevice device, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkUninitializePerformanceApiINTEL in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkUninitializePerformanceApiINTEL(device:%p)", device);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    local_device = device;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkUninitializePerformanceApiINTEL =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkUninitializePerformanceApiINTEL);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkUninitializePerformanceApiINTEL);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkUninitializePerformanceApiINTEL = OP_vkUninitializePerformanceApiINTEL;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkUninitializePerformanceApiINTEL, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkUninitializePerformanceApiINTEL, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkUninitializePerformanceApiINTEL), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkCmdSetPerformanceMarkerINTEL(VkCommandBuffer commandBuffer,
+                                                   const VkPerformanceMarkerInfoINTEL* pMarkerInfo,
+                                                   uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetPerformanceMarkerINTEL in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdSetPerformanceMarkerINTEL(commandBuffer:%p, pMarkerInfo:%p)",
+                      commandBuffer, pMarkerInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkPerformanceMarkerInfoINTEL* local_pMarkerInfo;
+    local_commandBuffer = commandBuffer;
+    local_pMarkerInfo = nullptr;
+    if (pMarkerInfo) {
+        local_pMarkerInfo =
+            (VkPerformanceMarkerInfoINTEL*)pool->alloc(sizeof(const VkPerformanceMarkerInfoINTEL));
+        deepcopy_VkPerformanceMarkerInfoINTEL(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pMarkerInfo,
+                                              (VkPerformanceMarkerInfoINTEL*)(local_pMarkerInfo));
+    }
+    if (local_pMarkerInfo) {
+        transform_tohost_VkPerformanceMarkerInfoINTEL(
+            sResourceTracker, (VkPerformanceMarkerInfoINTEL*)(local_pMarkerInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPerformanceMarkerInfoINTEL(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                           (VkPerformanceMarkerInfoINTEL*)(local_pMarkerInfo),
+                                           countPtr);
+    }
+    uint32_t packetSize_vkCmdSetPerformanceMarkerINTEL = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdSetPerformanceMarkerINTEL);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetPerformanceMarkerINTEL -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetPerformanceMarkerINTEL);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetPerformanceMarkerINTEL = OP_vkCmdSetPerformanceMarkerINTEL;
+    memcpy(streamPtr, &opcode_vkCmdSetPerformanceMarkerINTEL, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetPerformanceMarkerINTEL, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkPerformanceMarkerInfoINTEL(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                 (VkPerformanceMarkerInfoINTEL*)(local_pMarkerInfo),
+                                                 streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetPerformanceMarkerINTEL), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkCmdSetPerformanceMarkerINTEL_VkResult_return = (VkResult)0;
+    stream->read(&vkCmdSetPerformanceMarkerINTEL_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCmdSetPerformanceMarkerINTEL_VkResult_return;
+}
+
+VkResult VkEncoder::vkCmdSetPerformanceStreamMarkerINTEL(
+    VkCommandBuffer commandBuffer, const VkPerformanceStreamMarkerInfoINTEL* pMarkerInfo,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetPerformanceStreamMarkerINTEL in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdSetPerformanceStreamMarkerINTEL(commandBuffer:%p, pMarkerInfo:%p)",
+                      commandBuffer, pMarkerInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkPerformanceStreamMarkerInfoINTEL* local_pMarkerInfo;
+    local_commandBuffer = commandBuffer;
+    local_pMarkerInfo = nullptr;
+    if (pMarkerInfo) {
+        local_pMarkerInfo = (VkPerformanceStreamMarkerInfoINTEL*)pool->alloc(
+            sizeof(const VkPerformanceStreamMarkerInfoINTEL));
+        deepcopy_VkPerformanceStreamMarkerInfoINTEL(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pMarkerInfo,
+            (VkPerformanceStreamMarkerInfoINTEL*)(local_pMarkerInfo));
+    }
+    if (local_pMarkerInfo) {
+        transform_tohost_VkPerformanceStreamMarkerInfoINTEL(
+            sResourceTracker, (VkPerformanceStreamMarkerInfoINTEL*)(local_pMarkerInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPerformanceStreamMarkerInfoINTEL(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkPerformanceStreamMarkerInfoINTEL*)(local_pMarkerInfo), countPtr);
+    }
+    uint32_t packetSize_vkCmdSetPerformanceStreamMarkerINTEL = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdSetPerformanceStreamMarkerINTEL);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetPerformanceStreamMarkerINTEL -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetPerformanceStreamMarkerINTEL);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetPerformanceStreamMarkerINTEL = OP_vkCmdSetPerformanceStreamMarkerINTEL;
+    memcpy(streamPtr, &opcode_vkCmdSetPerformanceStreamMarkerINTEL, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetPerformanceStreamMarkerINTEL, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkPerformanceStreamMarkerInfoINTEL(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkPerformanceStreamMarkerInfoINTEL*)(local_pMarkerInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdSetPerformanceStreamMarkerINTEL),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkCmdSetPerformanceStreamMarkerINTEL_VkResult_return = (VkResult)0;
+    stream->read(&vkCmdSetPerformanceStreamMarkerINTEL_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCmdSetPerformanceStreamMarkerINTEL_VkResult_return;
+}
+
+VkResult VkEncoder::vkCmdSetPerformanceOverrideINTEL(
+    VkCommandBuffer commandBuffer, const VkPerformanceOverrideInfoINTEL* pOverrideInfo,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetPerformanceOverrideINTEL in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdSetPerformanceOverrideINTEL(commandBuffer:%p, pOverrideInfo:%p)",
+                      commandBuffer, pOverrideInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkPerformanceOverrideInfoINTEL* local_pOverrideInfo;
+    local_commandBuffer = commandBuffer;
+    local_pOverrideInfo = nullptr;
+    if (pOverrideInfo) {
+        local_pOverrideInfo = (VkPerformanceOverrideInfoINTEL*)pool->alloc(
+            sizeof(const VkPerformanceOverrideInfoINTEL));
+        deepcopy_VkPerformanceOverrideInfoINTEL(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pOverrideInfo,
+            (VkPerformanceOverrideInfoINTEL*)(local_pOverrideInfo));
+    }
+    if (local_pOverrideInfo) {
+        transform_tohost_VkPerformanceOverrideInfoINTEL(
+            sResourceTracker, (VkPerformanceOverrideInfoINTEL*)(local_pOverrideInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPerformanceOverrideInfoINTEL(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                             (VkPerformanceOverrideInfoINTEL*)(local_pOverrideInfo),
+                                             countPtr);
+    }
+    uint32_t packetSize_vkCmdSetPerformanceOverrideINTEL = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdSetPerformanceOverrideINTEL);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetPerformanceOverrideINTEL -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetPerformanceOverrideINTEL);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetPerformanceOverrideINTEL = OP_vkCmdSetPerformanceOverrideINTEL;
+    memcpy(streamPtr, &opcode_vkCmdSetPerformanceOverrideINTEL, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetPerformanceOverrideINTEL, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkPerformanceOverrideInfoINTEL(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkPerformanceOverrideInfoINTEL*)(local_pOverrideInfo),
+        streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetPerformanceOverrideINTEL), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkCmdSetPerformanceOverrideINTEL_VkResult_return = (VkResult)0;
+    stream->read(&vkCmdSetPerformanceOverrideINTEL_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCmdSetPerformanceOverrideINTEL_VkResult_return;
+}
+
+VkResult VkEncoder::vkAcquirePerformanceConfigurationINTEL(
+    VkDevice device, const VkPerformanceConfigurationAcquireInfoINTEL* pAcquireInfo,
+    VkPerformanceConfigurationINTEL* pConfiguration, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkAcquirePerformanceConfigurationINTEL in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkAcquirePerformanceConfigurationINTEL(device:%p, pAcquireInfo:%p, pConfiguration:%p)",
+        device, pAcquireInfo, pConfiguration);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkPerformanceConfigurationAcquireInfoINTEL* local_pAcquireInfo;
+    local_device = device;
+    local_pAcquireInfo = nullptr;
+    if (pAcquireInfo) {
+        local_pAcquireInfo = (VkPerformanceConfigurationAcquireInfoINTEL*)pool->alloc(
+            sizeof(const VkPerformanceConfigurationAcquireInfoINTEL));
+        deepcopy_VkPerformanceConfigurationAcquireInfoINTEL(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAcquireInfo,
+            (VkPerformanceConfigurationAcquireInfoINTEL*)(local_pAcquireInfo));
+    }
+    if (local_pAcquireInfo) {
+        transform_tohost_VkPerformanceConfigurationAcquireInfoINTEL(
+            sResourceTracker, (VkPerformanceConfigurationAcquireInfoINTEL*)(local_pAcquireInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPerformanceConfigurationAcquireInfoINTEL(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkPerformanceConfigurationAcquireInfoINTEL*)(local_pAcquireInfo), countPtr);
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkAcquirePerformanceConfigurationINTEL =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkAcquirePerformanceConfigurationINTEL);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkAcquirePerformanceConfigurationINTEL);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkAcquirePerformanceConfigurationINTEL =
+        OP_vkAcquirePerformanceConfigurationINTEL;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkAcquirePerformanceConfigurationINTEL, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkAcquirePerformanceConfigurationINTEL, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPerformanceConfigurationAcquireInfoINTEL(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkPerformanceConfigurationAcquireInfoINTEL*)(local_pAcquireInfo), streamPtrPtr);
+    uint64_t cgen_var_1 = (uint64_t)(*pConfiguration);
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkAcquirePerformanceConfigurationINTEL),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    (*pConfiguration) = (VkPerformanceConfigurationINTEL)stream->getBe64();
+    VkResult vkAcquirePerformanceConfigurationINTEL_VkResult_return = (VkResult)0;
+    stream->read(&vkAcquirePerformanceConfigurationINTEL_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkAcquirePerformanceConfigurationINTEL_VkResult_return;
+}
+
+VkResult VkEncoder::vkReleasePerformanceConfigurationINTEL(
+    VkDevice device, VkPerformanceConfigurationINTEL configuration, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkReleasePerformanceConfigurationINTEL in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkReleasePerformanceConfigurationINTEL(device:%p)", device);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkPerformanceConfigurationINTEL local_configuration;
+    local_device = device;
+    local_configuration = configuration;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkReleasePerformanceConfigurationINTEL =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkReleasePerformanceConfigurationINTEL);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkReleasePerformanceConfigurationINTEL);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkReleasePerformanceConfigurationINTEL =
+        OP_vkReleasePerformanceConfigurationINTEL;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkReleasePerformanceConfigurationINTEL, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkReleasePerformanceConfigurationINTEL, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1 = (uint64_t)local_configuration;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkReleasePerformanceConfigurationINTEL),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkReleasePerformanceConfigurationINTEL_VkResult_return = (VkResult)0;
+    stream->read(&vkReleasePerformanceConfigurationINTEL_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkReleasePerformanceConfigurationINTEL_VkResult_return;
+}
+
+VkResult VkEncoder::vkQueueSetPerformanceConfigurationINTEL(
+    VkQueue queue, VkPerformanceConfigurationINTEL configuration, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkQueueSetPerformanceConfigurationINTEL in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkQueueSetPerformanceConfigurationINTEL(queue:%p)", queue);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkQueue local_queue;
+    VkPerformanceConfigurationINTEL local_configuration;
+    local_queue = queue;
+    local_configuration = configuration;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkQueueSetPerformanceConfigurationINTEL =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkQueueSetPerformanceConfigurationINTEL);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkQueueSetPerformanceConfigurationINTEL);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkQueueSetPerformanceConfigurationINTEL =
+        OP_vkQueueSetPerformanceConfigurationINTEL;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkQueueSetPerformanceConfigurationINTEL, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkQueueSetPerformanceConfigurationINTEL, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkQueue((*&local_queue));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1 = (uint64_t)local_configuration;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkQueueSetPerformanceConfigurationINTEL),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkQueueSetPerformanceConfigurationINTEL_VkResult_return = (VkResult)0;
+    stream->read(&vkQueueSetPerformanceConfigurationINTEL_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkQueueSetPerformanceConfigurationINTEL_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetPerformanceParameterINTEL(VkDevice device,
+                                                   VkPerformanceParameterTypeINTEL parameter,
+                                                   VkPerformanceValueINTEL* pValue,
+                                                   uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPerformanceParameterINTEL in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetPerformanceParameterINTEL(device:%p, pValue:%p)", device, pValue);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkPerformanceParameterTypeINTEL local_parameter;
+    local_device = device;
+    local_parameter = parameter;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkPerformanceParameterTypeINTEL);
+        count_VkPerformanceValueINTEL(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                      (VkPerformanceValueINTEL*)(pValue), countPtr);
+    }
+    uint32_t packetSize_vkGetPerformanceParameterINTEL =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPerformanceParameterINTEL);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPerformanceParameterINTEL);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPerformanceParameterINTEL = OP_vkGetPerformanceParameterINTEL;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPerformanceParameterINTEL, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPerformanceParameterINTEL, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkPerformanceParameterTypeINTEL*)&local_parameter,
+           sizeof(VkPerformanceParameterTypeINTEL));
+    *streamPtrPtr += sizeof(VkPerformanceParameterTypeINTEL);
+    reservedmarshal_VkPerformanceValueINTEL(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                            (VkPerformanceValueINTEL*)(pValue), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPerformanceParameterINTEL), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkPerformanceValueINTEL(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                      (VkPerformanceValueINTEL*)(pValue));
+    if (pValue) {
+        transform_fromhost_VkPerformanceValueINTEL(sResourceTracker,
+                                                   (VkPerformanceValueINTEL*)(pValue));
+    }
+    VkResult vkGetPerformanceParameterINTEL_VkResult_return = (VkResult)0;
+    stream->read(&vkGetPerformanceParameterINTEL_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPerformanceParameterINTEL_VkResult_return;
+}
+
+#endif
+#ifdef VK_EXT_pci_bus_info
+#endif
+#ifdef VK_AMD_display_native_hdr
+void VkEncoder::vkSetLocalDimmingAMD(VkDevice device, VkSwapchainKHR swapChain,
+                                     VkBool32 localDimmingEnable, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkSetLocalDimmingAMD in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkSetLocalDimmingAMD(device:%p, swapChain:%p, localDimmingEnable:%d)",
+                      device, swapChain, localDimmingEnable);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSwapchainKHR local_swapChain;
+    VkBool32 local_localDimmingEnable;
+    local_device = device;
+    local_swapChain = swapChain;
+    local_localDimmingEnable = localDimmingEnable;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkBool32);
+    }
+    uint32_t packetSize_vkSetLocalDimmingAMD =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkSetLocalDimmingAMD);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkSetLocalDimmingAMD);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkSetLocalDimmingAMD = OP_vkSetLocalDimmingAMD;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkSetLocalDimmingAMD, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkSetLocalDimmingAMD, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkSwapchainKHR((*&local_swapChain));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkBool32*)&local_localDimmingEnable, sizeof(VkBool32));
+    *streamPtrPtr += sizeof(VkBool32);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkSetLocalDimmingAMD), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_FUCHSIA_imagepipe_surface
+VkResult VkEncoder::vkCreateImagePipeSurfaceFUCHSIA(
+    VkInstance instance, const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateImagePipeSurfaceFUCHSIA in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateImagePipeSurfaceFUCHSIA(instance:%p, pCreateInfo:%p, pAllocator:%p, pSurface:%p)",
+        instance, pCreateInfo, pAllocator, pSurface);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkInstance local_instance;
+    VkImagePipeSurfaceCreateInfoFUCHSIA* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_instance = instance;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkImagePipeSurfaceCreateInfoFUCHSIA*)pool->alloc(
+            sizeof(const VkImagePipeSurfaceCreateInfoFUCHSIA));
+        deepcopy_VkImagePipeSurfaceCreateInfoFUCHSIA(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+            (VkImagePipeSurfaceCreateInfoFUCHSIA*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkImagePipeSurfaceCreateInfoFUCHSIA(
+            sResourceTracker, (VkImagePipeSurfaceCreateInfoFUCHSIA*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkImagePipeSurfaceCreateInfoFUCHSIA(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkImagePipeSurfaceCreateInfoFUCHSIA*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateImagePipeSurfaceFUCHSIA =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCreateImagePipeSurfaceFUCHSIA);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateImagePipeSurfaceFUCHSIA);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateImagePipeSurfaceFUCHSIA = OP_vkCreateImagePipeSurfaceFUCHSIA;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateImagePipeSurfaceFUCHSIA, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateImagePipeSurfaceFUCHSIA, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkInstance((*&local_instance));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkImagePipeSurfaceCreateInfoFUCHSIA(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkImagePipeSurfaceCreateInfoFUCHSIA*)(local_pCreateInfo), streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pSurface));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateImagePipeSurfaceFUCHSIA), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_3, (VkSurfaceKHR*)pSurface, 1);
+    VkResult vkCreateImagePipeSurfaceFUCHSIA_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateImagePipeSurfaceFUCHSIA_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateImagePipeSurfaceFUCHSIA_VkResult_return;
+}
+
+#endif
+#ifdef VK_EXT_metal_surface
+VkResult VkEncoder::vkCreateMetalSurfaceEXT(VkInstance instance,
+                                            const VkMetalSurfaceCreateInfoEXT* pCreateInfo,
+                                            const VkAllocationCallbacks* pAllocator,
+                                            VkSurfaceKHR* pSurface, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateMetalSurfaceEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateMetalSurfaceEXT(instance:%p, pCreateInfo:%p, pAllocator:%p, pSurface:%p)",
+        instance, pCreateInfo, pAllocator, pSurface);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkInstance local_instance;
+    VkMetalSurfaceCreateInfoEXT* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_instance = instance;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo =
+            (VkMetalSurfaceCreateInfoEXT*)pool->alloc(sizeof(const VkMetalSurfaceCreateInfoEXT));
+        deepcopy_VkMetalSurfaceCreateInfoEXT(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                             (VkMetalSurfaceCreateInfoEXT*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkMetalSurfaceCreateInfoEXT(
+            sResourceTracker, (VkMetalSurfaceCreateInfoEXT*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkMetalSurfaceCreateInfoEXT(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkMetalSurfaceCreateInfoEXT*)(local_pCreateInfo),
+                                          countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateMetalSurfaceEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateMetalSurfaceEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateMetalSurfaceEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateMetalSurfaceEXT = OP_vkCreateMetalSurfaceEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateMetalSurfaceEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateMetalSurfaceEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkInstance((*&local_instance));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkMetalSurfaceCreateInfoEXT(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                (VkMetalSurfaceCreateInfoEXT*)(local_pCreateInfo),
+                                                streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pSurface));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateMetalSurfaceEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_3, (VkSurfaceKHR*)pSurface, 1);
+    VkResult vkCreateMetalSurfaceEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateMetalSurfaceEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateMetalSurfaceEXT_VkResult_return;
+}
+
+#endif
+#ifdef VK_EXT_fragment_density_map
+#endif
+#ifdef VK_EXT_scalar_block_layout
+#endif
+#ifdef VK_GOOGLE_hlsl_functionality1
+#endif
+#ifdef VK_GOOGLE_decorate_string
+#endif
+#ifdef VK_EXT_subgroup_size_control
+#endif
+#ifdef VK_AMD_shader_core_properties2
+#endif
+#ifdef VK_AMD_device_coherent_memory
+#endif
+#ifdef VK_EXT_shader_image_atomic_int64
+#endif
+#ifdef VK_EXT_memory_budget
+#endif
+#ifdef VK_EXT_memory_priority
+#endif
+#ifdef VK_NV_dedicated_allocation_image_aliasing
+#endif
+#ifdef VK_EXT_buffer_device_address
+VkDeviceAddress VkEncoder::vkGetBufferDeviceAddressEXT(VkDevice device,
+                                                       const VkBufferDeviceAddressInfo* pInfo,
+                                                       uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetBufferDeviceAddressEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetBufferDeviceAddressEXT(device:%p, pInfo:%p)", device, pInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkBufferDeviceAddressInfo* local_pInfo;
+    local_device = device;
+    local_pInfo = nullptr;
+    if (pInfo) {
+        local_pInfo =
+            (VkBufferDeviceAddressInfo*)pool->alloc(sizeof(const VkBufferDeviceAddressInfo));
+        deepcopy_VkBufferDeviceAddressInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfo,
+                                           (VkBufferDeviceAddressInfo*)(local_pInfo));
+    }
+    if (local_pInfo) {
+        transform_tohost_VkBufferDeviceAddressInfo(sResourceTracker,
+                                                   (VkBufferDeviceAddressInfo*)(local_pInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkBufferDeviceAddressInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkBufferDeviceAddressInfo*)(local_pInfo), countPtr);
+    }
+    uint32_t packetSize_vkGetBufferDeviceAddressEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetBufferDeviceAddressEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetBufferDeviceAddressEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetBufferDeviceAddressEXT = OP_vkGetBufferDeviceAddressEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetBufferDeviceAddressEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetBufferDeviceAddressEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkBufferDeviceAddressInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkBufferDeviceAddressInfo*)(local_pInfo),
+                                              streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetBufferDeviceAddressEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkDeviceAddress vkGetBufferDeviceAddressEXT_VkDeviceAddress_return = (VkDeviceAddress)0;
+    stream->read(&vkGetBufferDeviceAddressEXT_VkDeviceAddress_return, sizeof(VkDeviceAddress));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetBufferDeviceAddressEXT_VkDeviceAddress_return;
+}
+
+#endif
+#ifdef VK_EXT_tooling_info
+VkResult VkEncoder::vkGetPhysicalDeviceToolPropertiesEXT(
+    VkPhysicalDevice physicalDevice, uint32_t* pToolCount,
+    VkPhysicalDeviceToolPropertiesEXT* pToolProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceToolPropertiesEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceToolPropertiesEXT(physicalDevice:%p, pToolCount:%p, "
+        "pToolProperties:%p)",
+        physicalDevice, pToolCount, pToolProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    local_physicalDevice = physicalDevice;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pToolCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pToolProperties) {
+            if (pToolCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pToolCount)); ++i) {
+                    count_VkPhysicalDeviceToolPropertiesEXT(
+                        sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                        (VkPhysicalDeviceToolPropertiesEXT*)(pToolProperties + i), countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceToolPropertiesEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceToolPropertiesEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceToolPropertiesEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceToolPropertiesEXT = OP_vkGetPhysicalDeviceToolPropertiesEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceToolPropertiesEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceToolPropertiesEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pToolCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pToolCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pToolCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pToolProperties;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pToolProperties) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pToolCount)); ++i) {
+            reservedmarshal_VkPhysicalDeviceToolPropertiesEXT(
+                stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkPhysicalDeviceToolPropertiesEXT*)(pToolProperties + i), streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetPhysicalDeviceToolPropertiesEXT),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pToolCount;
+    check_pToolCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pToolCount) {
+        if (!(check_pToolCount)) {
+            fprintf(stderr, "fatal: pToolCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pToolCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkPhysicalDeviceToolPropertiesEXT* check_pToolProperties;
+    check_pToolProperties = (VkPhysicalDeviceToolPropertiesEXT*)(uintptr_t)stream->getBe64();
+    if (pToolProperties) {
+        if (!(check_pToolProperties)) {
+            fprintf(stderr, "fatal: pToolProperties inconsistent between guest and host\n");
+        }
+        if (pToolCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pToolCount)); ++i) {
+                unmarshal_VkPhysicalDeviceToolPropertiesEXT(
+                    stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                    (VkPhysicalDeviceToolPropertiesEXT*)(pToolProperties + i));
+            }
+        }
+    }
+    if (pToolCount) {
+        if (pToolProperties) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pToolCount)); ++i) {
+                transform_fromhost_VkPhysicalDeviceToolPropertiesEXT(
+                    sResourceTracker, (VkPhysicalDeviceToolPropertiesEXT*)(pToolProperties + i));
+            }
+        }
+    }
+    VkResult vkGetPhysicalDeviceToolPropertiesEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkGetPhysicalDeviceToolPropertiesEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDeviceToolPropertiesEXT_VkResult_return;
+}
+
+#endif
+#ifdef VK_EXT_separate_stencil_usage
+#endif
+#ifdef VK_EXT_validation_features
+#endif
+#ifdef VK_NV_cooperative_matrix
+VkResult VkEncoder::vkGetPhysicalDeviceCooperativeMatrixPropertiesNV(
+    VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount,
+    VkCooperativeMatrixPropertiesNV* pProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkGetPhysicalDeviceCooperativeMatrixPropertiesNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceCooperativeMatrixPropertiesNV(physicalDevice:%p, pPropertyCount:%p, "
+        "pProperties:%p)",
+        physicalDevice, pPropertyCount, pProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    local_physicalDevice = physicalDevice;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pPropertyCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pProperties) {
+            if (pPropertyCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                    count_VkCooperativeMatrixPropertiesNV(
+                        sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                        (VkCooperativeMatrixPropertiesNV*)(pProperties + i), countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV);
+    uint8_t* streamPtr =
+        stream->reserve(packetSize_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV =
+        OP_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV,
+           sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pPropertyCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pPropertyCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pPropertyCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pProperties;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pProperties) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+            reservedmarshal_VkCooperativeMatrixPropertiesNV(
+                stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkCooperativeMatrixPropertiesNV*)(pProperties + i), streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pPropertyCount;
+    check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pPropertyCount) {
+        if (!(check_pPropertyCount)) {
+            fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkCooperativeMatrixPropertiesNV* check_pProperties;
+    check_pProperties = (VkCooperativeMatrixPropertiesNV*)(uintptr_t)stream->getBe64();
+    if (pProperties) {
+        if (!(check_pProperties)) {
+            fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
+        }
+        if (pPropertyCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                unmarshal_VkCooperativeMatrixPropertiesNV(
+                    stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                    (VkCooperativeMatrixPropertiesNV*)(pProperties + i));
+            }
+        }
+    }
+    if (pPropertyCount) {
+        if (pProperties) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) {
+                transform_fromhost_VkCooperativeMatrixPropertiesNV(
+                    sResourceTracker, (VkCooperativeMatrixPropertiesNV*)(pProperties + i));
+            }
+        }
+    }
+    VkResult vkGetPhysicalDeviceCooperativeMatrixPropertiesNV_VkResult_return = (VkResult)0;
+    stream->read(&vkGetPhysicalDeviceCooperativeMatrixPropertiesNV_VkResult_return,
+                 sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDeviceCooperativeMatrixPropertiesNV_VkResult_return;
+}
+
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+VkResult VkEncoder::vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV(
+    VkPhysicalDevice physicalDevice, uint32_t* pCombinationCount,
+    VkFramebufferMixedSamplesCombinationNV* pCombinations, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(
+            mHealthMonitor,
+            "vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV(physicalDevice:%p, "
+        "pCombinationCount:%p, pCombinations:%p)",
+        physicalDevice, pCombinationCount, pCombinations);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    local_physicalDevice = physicalDevice;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pCombinationCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pCombinations) {
+            if (pCombinationCount) {
+                for (uint32_t i = 0; i < (uint32_t)(*(pCombinationCount)); ++i) {
+                    count_VkFramebufferMixedSamplesCombinationNV(
+                        sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                        (VkFramebufferMixedSamplesCombinationNV*)(pCombinations + i), countPtr);
+                }
+            }
+        }
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(
+        packetSize_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV);
+    uint8_t* streamPtr = stream->reserve(
+        packetSize_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV =
+        OP_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV,
+           sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV,
+           sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pCombinationCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pCombinationCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pCombinationCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pCombinations;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pCombinations) {
+        for (uint32_t i = 0; i < (uint32_t)(*(pCombinationCount)); ++i) {
+            reservedmarshal_VkFramebufferMixedSamplesCombinationNV(
+                stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkFramebufferMixedSamplesCombinationNV*)(pCombinations + i), streamPtrPtr);
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(
+                packetSize_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pCombinationCount;
+    check_pCombinationCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pCombinationCount) {
+        if (!(check_pCombinationCount)) {
+            fprintf(stderr, "fatal: pCombinationCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pCombinationCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkFramebufferMixedSamplesCombinationNV* check_pCombinations;
+    check_pCombinations = (VkFramebufferMixedSamplesCombinationNV*)(uintptr_t)stream->getBe64();
+    if (pCombinations) {
+        if (!(check_pCombinations)) {
+            fprintf(stderr, "fatal: pCombinations inconsistent between guest and host\n");
+        }
+        if (pCombinationCount) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pCombinationCount)); ++i) {
+                unmarshal_VkFramebufferMixedSamplesCombinationNV(
+                    stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                    (VkFramebufferMixedSamplesCombinationNV*)(pCombinations + i));
+            }
+        }
+    }
+    if (pCombinationCount) {
+        if (pCombinations) {
+            for (uint32_t i = 0; i < (uint32_t)(*(pCombinationCount)); ++i) {
+                transform_fromhost_VkFramebufferMixedSamplesCombinationNV(
+                    sResourceTracker, (VkFramebufferMixedSamplesCombinationNV*)(pCombinations + i));
+            }
+        }
+    }
+    VkResult vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV_VkResult_return =
+        (VkResult)0;
+    stream->read(&vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV_VkResult_return,
+                 sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV_VkResult_return;
+}
+
+#endif
+#ifdef VK_EXT_fragment_shader_interlock
+#endif
+#ifdef VK_EXT_ycbcr_image_arrays
+#endif
+#ifdef VK_EXT_provoking_vertex
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+VkResult VkEncoder::vkGetPhysicalDeviceSurfacePresentModes2EXT(
+    VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
+    uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPhysicalDeviceSurfacePresentModes2EXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceSurfacePresentModes2EXT(physicalDevice:%p, pSurfaceInfo:%p, "
+        "pPresentModeCount:%p, pPresentModes:%p)",
+        physicalDevice, pSurfaceInfo, pPresentModeCount, pPresentModes);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkPhysicalDeviceSurfaceInfo2KHR* local_pSurfaceInfo;
+    local_physicalDevice = physicalDevice;
+    local_pSurfaceInfo = nullptr;
+    if (pSurfaceInfo) {
+        local_pSurfaceInfo = (VkPhysicalDeviceSurfaceInfo2KHR*)pool->alloc(
+            sizeof(const VkPhysicalDeviceSurfaceInfo2KHR));
+        deepcopy_VkPhysicalDeviceSurfaceInfo2KHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pSurfaceInfo,
+            (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo));
+    }
+    if (local_pSurfaceInfo) {
+        transform_tohost_VkPhysicalDeviceSurfaceInfo2KHR(
+            sResourceTracker, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPhysicalDeviceSurfaceInfo2KHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pPresentModeCount) {
+            *countPtr += sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pPresentModes) {
+            if (pPresentModeCount) {
+                *countPtr += (*(pPresentModeCount)) * sizeof(VkPresentModeKHR);
+            }
+        }
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceSurfacePresentModes2EXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceSurfacePresentModes2EXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPhysicalDeviceSurfacePresentModes2EXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceSurfacePresentModes2EXT =
+        OP_vkGetPhysicalDeviceSurfacePresentModes2EXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceSurfacePresentModes2EXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceSurfacePresentModes2EXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPhysicalDeviceSurfaceInfo2KHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo),
+        streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pPresentModeCount;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pPresentModeCount) {
+        memcpy(*streamPtrPtr, (uint32_t*)pPresentModeCount, sizeof(uint32_t));
+        *streamPtrPtr += sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pPresentModes;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pPresentModes) {
+        memcpy(*streamPtrPtr, (VkPresentModeKHR*)pPresentModes,
+               (*(pPresentModeCount)) * sizeof(VkPresentModeKHR));
+        *streamPtrPtr += (*(pPresentModeCount)) * sizeof(VkPresentModeKHR);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceSurfacePresentModes2EXT),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint32_t* check_pPresentModeCount;
+    check_pPresentModeCount = (uint32_t*)(uintptr_t)stream->getBe64();
+    if (pPresentModeCount) {
+        if (!(check_pPresentModeCount)) {
+            fprintf(stderr, "fatal: pPresentModeCount inconsistent between guest and host\n");
+        }
+        stream->read((uint32_t*)pPresentModeCount, sizeof(uint32_t));
+    }
+    // WARNING PTR CHECK
+    VkPresentModeKHR* check_pPresentModes;
+    check_pPresentModes = (VkPresentModeKHR*)(uintptr_t)stream->getBe64();
+    if (pPresentModes) {
+        if (!(check_pPresentModes)) {
+            fprintf(stderr, "fatal: pPresentModes inconsistent between guest and host\n");
+        }
+        stream->read((VkPresentModeKHR*)pPresentModes,
+                     (*(pPresentModeCount)) * sizeof(VkPresentModeKHR));
+    }
+    VkResult vkGetPhysicalDeviceSurfacePresentModes2EXT_VkResult_return = (VkResult)0;
+    stream->read(&vkGetPhysicalDeviceSurfacePresentModes2EXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDeviceSurfacePresentModes2EXT_VkResult_return;
+}
+
+VkResult VkEncoder::vkAcquireFullScreenExclusiveModeEXT(VkDevice device, VkSwapchainKHR swapchain,
+                                                        uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkAcquireFullScreenExclusiveModeEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkAcquireFullScreenExclusiveModeEXT(device:%p, swapchain:%p)", device,
+                      swapchain);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSwapchainKHR local_swapchain;
+    local_device = device;
+    local_swapchain = swapchain;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkAcquireFullScreenExclusiveModeEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkAcquireFullScreenExclusiveModeEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkAcquireFullScreenExclusiveModeEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkAcquireFullScreenExclusiveModeEXT = OP_vkAcquireFullScreenExclusiveModeEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkAcquireFullScreenExclusiveModeEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkAcquireFullScreenExclusiveModeEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkSwapchainKHR((*&local_swapchain));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkAcquireFullScreenExclusiveModeEXT),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkAcquireFullScreenExclusiveModeEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkAcquireFullScreenExclusiveModeEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkAcquireFullScreenExclusiveModeEXT_VkResult_return;
+}
+
+VkResult VkEncoder::vkReleaseFullScreenExclusiveModeEXT(VkDevice device, VkSwapchainKHR swapchain,
+                                                        uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkReleaseFullScreenExclusiveModeEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkReleaseFullScreenExclusiveModeEXT(device:%p, swapchain:%p)", device,
+                      swapchain);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSwapchainKHR local_swapchain;
+    local_device = device;
+    local_swapchain = swapchain;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkReleaseFullScreenExclusiveModeEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkReleaseFullScreenExclusiveModeEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkReleaseFullScreenExclusiveModeEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkReleaseFullScreenExclusiveModeEXT = OP_vkReleaseFullScreenExclusiveModeEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkReleaseFullScreenExclusiveModeEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkReleaseFullScreenExclusiveModeEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkSwapchainKHR((*&local_swapchain));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkReleaseFullScreenExclusiveModeEXT),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkReleaseFullScreenExclusiveModeEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkReleaseFullScreenExclusiveModeEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkReleaseFullScreenExclusiveModeEXT_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetDeviceGroupSurfacePresentModes2EXT(
+    VkDevice device, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
+    VkDeviceGroupPresentModeFlagsKHR* pModes, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetDeviceGroupSurfacePresentModes2EXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetDeviceGroupSurfacePresentModes2EXT(device:%p, pSurfaceInfo:%p, pModes:%p)", device,
+        pSurfaceInfo, pModes);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkPhysicalDeviceSurfaceInfo2KHR* local_pSurfaceInfo;
+    local_device = device;
+    local_pSurfaceInfo = nullptr;
+    if (pSurfaceInfo) {
+        local_pSurfaceInfo = (VkPhysicalDeviceSurfaceInfo2KHR*)pool->alloc(
+            sizeof(const VkPhysicalDeviceSurfaceInfo2KHR));
+        deepcopy_VkPhysicalDeviceSurfaceInfo2KHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pSurfaceInfo,
+            (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo));
+    }
+    if (local_pSurfaceInfo) {
+        transform_tohost_VkPhysicalDeviceSurfaceInfo2KHR(
+            sResourceTracker, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPhysicalDeviceSurfaceInfo2KHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pModes) {
+            *countPtr += sizeof(VkDeviceGroupPresentModeFlagsKHR);
+        }
+    }
+    uint32_t packetSize_vkGetDeviceGroupSurfacePresentModes2EXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetDeviceGroupSurfacePresentModes2EXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetDeviceGroupSurfacePresentModes2EXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetDeviceGroupSurfacePresentModes2EXT =
+        OP_vkGetDeviceGroupSurfacePresentModes2EXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetDeviceGroupSurfacePresentModes2EXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetDeviceGroupSurfacePresentModes2EXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPhysicalDeviceSurfaceInfo2KHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo),
+        streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)pModes;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pModes) {
+        memcpy(*streamPtrPtr, (VkDeviceGroupPresentModeFlagsKHR*)pModes,
+               sizeof(VkDeviceGroupPresentModeFlagsKHR));
+        *streamPtrPtr += sizeof(VkDeviceGroupPresentModeFlagsKHR);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetDeviceGroupSurfacePresentModes2EXT),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    VkDeviceGroupPresentModeFlagsKHR* check_pModes;
+    check_pModes = (VkDeviceGroupPresentModeFlagsKHR*)(uintptr_t)stream->getBe64();
+    if (pModes) {
+        if (!(check_pModes)) {
+            fprintf(stderr, "fatal: pModes inconsistent between guest and host\n");
+        }
+        stream->read((VkDeviceGroupPresentModeFlagsKHR*)pModes,
+                     sizeof(VkDeviceGroupPresentModeFlagsKHR));
+    }
+    VkResult vkGetDeviceGroupSurfacePresentModes2EXT_VkResult_return = (VkResult)0;
+    stream->read(&vkGetDeviceGroupSurfacePresentModes2EXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetDeviceGroupSurfacePresentModes2EXT_VkResult_return;
+}
+
+#endif
+#ifdef VK_EXT_headless_surface
+VkResult VkEncoder::vkCreateHeadlessSurfaceEXT(VkInstance instance,
+                                               const VkHeadlessSurfaceCreateInfoEXT* pCreateInfo,
+                                               const VkAllocationCallbacks* pAllocator,
+                                               VkSurfaceKHR* pSurface, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateHeadlessSurfaceEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateHeadlessSurfaceEXT(instance:%p, pCreateInfo:%p, pAllocator:%p, pSurface:%p)",
+        instance, pCreateInfo, pAllocator, pSurface);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkInstance local_instance;
+    VkHeadlessSurfaceCreateInfoEXT* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_instance = instance;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkHeadlessSurfaceCreateInfoEXT*)pool->alloc(
+            sizeof(const VkHeadlessSurfaceCreateInfoEXT));
+        deepcopy_VkHeadlessSurfaceCreateInfoEXT(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+            (VkHeadlessSurfaceCreateInfoEXT*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkHeadlessSurfaceCreateInfoEXT(
+            sResourceTracker, (VkHeadlessSurfaceCreateInfoEXT*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkHeadlessSurfaceCreateInfoEXT(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                             (VkHeadlessSurfaceCreateInfoEXT*)(local_pCreateInfo),
+                                             countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateHeadlessSurfaceEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateHeadlessSurfaceEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateHeadlessSurfaceEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateHeadlessSurfaceEXT = OP_vkCreateHeadlessSurfaceEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateHeadlessSurfaceEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateHeadlessSurfaceEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkInstance((*&local_instance));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkHeadlessSurfaceCreateInfoEXT(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkHeadlessSurfaceCreateInfoEXT*)(local_pCreateInfo),
+        streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pSurface));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateHeadlessSurfaceEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_3, (VkSurfaceKHR*)pSurface, 1);
+    VkResult vkCreateHeadlessSurfaceEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateHeadlessSurfaceEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateHeadlessSurfaceEXT_VkResult_return;
+}
+
+#endif
+#ifdef VK_EXT_line_rasterization
+void VkEncoder::vkCmdSetLineStippleEXT(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor,
+                                       uint16_t lineStipplePattern, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetLineStippleEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdSetLineStippleEXT(commandBuffer:%p, lineStippleFactor:%d, lineStipplePattern:%d)",
+        commandBuffer, lineStippleFactor, lineStipplePattern);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_lineStippleFactor;
+    uint16_t local_lineStipplePattern;
+    local_commandBuffer = commandBuffer;
+    local_lineStippleFactor = lineStippleFactor;
+    local_lineStipplePattern = lineStipplePattern;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint16_t);
+    }
+    uint32_t packetSize_vkCmdSetLineStippleEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetLineStippleEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetLineStippleEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetLineStippleEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetLineStippleEXT = OP_vkCmdSetLineStippleEXT;
+    memcpy(streamPtr, &opcode_vkCmdSetLineStippleEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetLineStippleEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_lineStippleFactor, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint16_t*)&local_lineStipplePattern, sizeof(uint16_t));
+    *streamPtrPtr += sizeof(uint16_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetLineStippleEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_EXT_shader_atomic_float
+#endif
+#ifdef VK_EXT_host_query_reset
+void VkEncoder::vkResetQueryPoolEXT(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery,
+                                    uint32_t queryCount, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkResetQueryPoolEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkResetQueryPoolEXT(device:%p, queryPool:%p, firstQuery:%d, queryCount:%d)",
+                      device, queryPool, firstQuery, queryCount);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkQueryPool local_queryPool;
+    uint32_t local_firstQuery;
+    uint32_t local_queryCount;
+    local_device = device;
+    local_queryPool = queryPool;
+    local_firstQuery = firstQuery;
+    local_queryCount = queryCount;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkResetQueryPoolEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkResetQueryPoolEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkResetQueryPoolEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkResetQueryPoolEXT = OP_vkResetQueryPoolEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkResetQueryPoolEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkResetQueryPoolEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkQueryPool((*&local_queryPool));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstQuery, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_queryCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkResetQueryPoolEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_EXT_index_type_uint8
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+void VkEncoder::vkCmdSetCullModeEXT(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode,
+                                    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetCullModeEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdSetCullModeEXT(commandBuffer:%p, cullMode:%d)", commandBuffer,
+                      cullMode);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkCullModeFlags local_cullMode;
+    local_commandBuffer = commandBuffer;
+    local_cullMode = cullMode;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkCullModeFlags);
+    }
+    uint32_t packetSize_vkCmdSetCullModeEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetCullModeEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetCullModeEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetCullModeEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetCullModeEXT = OP_vkCmdSetCullModeEXT;
+    memcpy(streamPtr, &opcode_vkCmdSetCullModeEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetCullModeEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkCullModeFlags*)&local_cullMode, sizeof(VkCullModeFlags));
+    *streamPtrPtr += sizeof(VkCullModeFlags);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetCullModeEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdSetFrontFaceEXT(VkCommandBuffer commandBuffer, VkFrontFace frontFace,
+                                     uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetFrontFaceEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdSetFrontFaceEXT(commandBuffer:%p)", commandBuffer);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkFrontFace local_frontFace;
+    local_commandBuffer = commandBuffer;
+    local_frontFace = frontFace;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkFrontFace);
+    }
+    uint32_t packetSize_vkCmdSetFrontFaceEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetFrontFaceEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetFrontFaceEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetFrontFaceEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetFrontFaceEXT = OP_vkCmdSetFrontFaceEXT;
+    memcpy(streamPtr, &opcode_vkCmdSetFrontFaceEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetFrontFaceEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkFrontFace*)&local_frontFace, sizeof(VkFrontFace));
+    *streamPtrPtr += sizeof(VkFrontFace);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetFrontFaceEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdSetPrimitiveTopologyEXT(VkCommandBuffer commandBuffer,
+                                             VkPrimitiveTopology primitiveTopology,
+                                             uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetPrimitiveTopologyEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdSetPrimitiveTopologyEXT(commandBuffer:%p)", commandBuffer);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkPrimitiveTopology local_primitiveTopology;
+    local_commandBuffer = commandBuffer;
+    local_primitiveTopology = primitiveTopology;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkPrimitiveTopology);
+    }
+    uint32_t packetSize_vkCmdSetPrimitiveTopologyEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdSetPrimitiveTopologyEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetPrimitiveTopologyEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetPrimitiveTopologyEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetPrimitiveTopologyEXT = OP_vkCmdSetPrimitiveTopologyEXT;
+    memcpy(streamPtr, &opcode_vkCmdSetPrimitiveTopologyEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetPrimitiveTopologyEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkPrimitiveTopology*)&local_primitiveTopology,
+           sizeof(VkPrimitiveTopology));
+    *streamPtrPtr += sizeof(VkPrimitiveTopology);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetPrimitiveTopologyEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdSetViewportWithCountEXT(VkCommandBuffer commandBuffer, uint32_t viewportCount,
+                                             const VkViewport* pViewports, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetViewportWithCountEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdSetViewportWithCountEXT(commandBuffer:%p, viewportCount:%d, pViewports:%p)",
+        commandBuffer, viewportCount, pViewports);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_viewportCount;
+    VkViewport* local_pViewports;
+    local_commandBuffer = commandBuffer;
+    local_viewportCount = viewportCount;
+    local_pViewports = nullptr;
+    if (pViewports) {
+        local_pViewports = (VkViewport*)pool->alloc(((viewportCount)) * sizeof(const VkViewport));
+        for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) {
+            deepcopy_VkViewport(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pViewports + i,
+                                (VkViewport*)(local_pViewports + i));
+        }
+    }
+    if (local_pViewports) {
+        for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) {
+            transform_tohost_VkViewport(sResourceTracker, (VkViewport*)(local_pViewports + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) {
+            count_VkViewport(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                             (VkViewport*)(local_pViewports + i), countPtr);
+        }
+    }
+    uint32_t packetSize_vkCmdSetViewportWithCountEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdSetViewportWithCountEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetViewportWithCountEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetViewportWithCountEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetViewportWithCountEXT = OP_vkCmdSetViewportWithCountEXT;
+    memcpy(streamPtr, &opcode_vkCmdSetViewportWithCountEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetViewportWithCountEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_viewportCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) {
+        reservedmarshal_VkViewport(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                   (VkViewport*)(local_pViewports + i), streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetViewportWithCountEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdSetScissorWithCountEXT(VkCommandBuffer commandBuffer, uint32_t scissorCount,
+                                            const VkRect2D* pScissors, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetScissorWithCountEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdSetScissorWithCountEXT(commandBuffer:%p, scissorCount:%d, pScissors:%p)",
+        commandBuffer, scissorCount, pScissors);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_scissorCount;
+    VkRect2D* local_pScissors;
+    local_commandBuffer = commandBuffer;
+    local_scissorCount = scissorCount;
+    local_pScissors = nullptr;
+    if (pScissors) {
+        local_pScissors = (VkRect2D*)pool->alloc(((scissorCount)) * sizeof(const VkRect2D));
+        for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) {
+            deepcopy_VkRect2D(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pScissors + i,
+                              (VkRect2D*)(local_pScissors + i));
+        }
+    }
+    if (local_pScissors) {
+        for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) {
+            transform_tohost_VkRect2D(sResourceTracker, (VkRect2D*)(local_pScissors + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) {
+            count_VkRect2D(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                           (VkRect2D*)(local_pScissors + i), countPtr);
+        }
+    }
+    uint32_t packetSize_vkCmdSetScissorWithCountEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetScissorWithCountEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetScissorWithCountEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetScissorWithCountEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetScissorWithCountEXT = OP_vkCmdSetScissorWithCountEXT;
+    memcpy(streamPtr, &opcode_vkCmdSetScissorWithCountEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetScissorWithCountEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_scissorCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) {
+        reservedmarshal_VkRect2D(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                 (VkRect2D*)(local_pScissors + i), streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetScissorWithCountEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdBindVertexBuffers2EXT(VkCommandBuffer commandBuffer, uint32_t firstBinding,
+                                           uint32_t bindingCount, const VkBuffer* pBuffers,
+                                           const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes,
+                                           const VkDeviceSize* pStrides, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdBindVertexBuffers2EXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdBindVertexBuffers2EXT(commandBuffer:%p, firstBinding:%d, bindingCount:%d, "
+        "pBuffers:%p, pOffsets:%p, pSizes:%p, pStrides:%p)",
+        commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets, pSizes, pStrides);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_firstBinding;
+    uint32_t local_bindingCount;
+    VkBuffer* local_pBuffers;
+    VkDeviceSize* local_pOffsets;
+    VkDeviceSize* local_pSizes;
+    VkDeviceSize* local_pStrides;
+    local_commandBuffer = commandBuffer;
+    local_firstBinding = firstBinding;
+    local_bindingCount = bindingCount;
+    // Avoiding deepcopy for pBuffers
+    local_pBuffers = (VkBuffer*)pBuffers;
+    // Avoiding deepcopy for pOffsets
+    local_pOffsets = (VkDeviceSize*)pOffsets;
+    // Avoiding deepcopy for pSizes
+    local_pSizes = (VkDeviceSize*)pSizes;
+    // Avoiding deepcopy for pStrides
+    local_pStrides = (VkDeviceSize*)pStrides;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pBuffers) {
+            if (((bindingCount))) {
+                *countPtr += ((bindingCount)) * 8;
+            }
+        }
+        *countPtr += ((bindingCount)) * sizeof(VkDeviceSize);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pSizes) {
+            *countPtr += ((bindingCount)) * sizeof(VkDeviceSize);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pStrides) {
+            *countPtr += ((bindingCount)) * sizeof(VkDeviceSize);
+        }
+    }
+    uint32_t packetSize_vkCmdBindVertexBuffers2EXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdBindVertexBuffers2EXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdBindVertexBuffers2EXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdBindVertexBuffers2EXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdBindVertexBuffers2EXT = OP_vkCmdBindVertexBuffers2EXT;
+    memcpy(streamPtr, &opcode_vkCmdBindVertexBuffers2EXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdBindVertexBuffers2EXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstBinding, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_bindingCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)local_pBuffers;
+    memcpy((*streamPtrPtr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pBuffers) {
+        if (((bindingCount))) {
+            uint8_t* cgen_var_0_0_ptr = (uint8_t*)(*streamPtrPtr);
+            for (uint32_t k = 0; k < ((bindingCount)); ++k) {
+                uint64_t tmpval = get_host_u64_VkBuffer(local_pBuffers[k]);
+                memcpy(cgen_var_0_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+            }
+            *streamPtrPtr += 8 * ((bindingCount));
+        }
+    }
+    memcpy(*streamPtrPtr, (VkDeviceSize*)local_pOffsets, ((bindingCount)) * sizeof(VkDeviceSize));
+    *streamPtrPtr += ((bindingCount)) * sizeof(VkDeviceSize);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pSizes;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pSizes) {
+        memcpy(*streamPtrPtr, (VkDeviceSize*)local_pSizes, ((bindingCount)) * sizeof(VkDeviceSize));
+        *streamPtrPtr += ((bindingCount)) * sizeof(VkDeviceSize);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pStrides;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pStrides) {
+        memcpy(*streamPtrPtr, (VkDeviceSize*)local_pStrides,
+               ((bindingCount)) * sizeof(VkDeviceSize));
+        *streamPtrPtr += ((bindingCount)) * sizeof(VkDeviceSize);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdBindVertexBuffers2EXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdSetDepthTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthTestEnable,
+                                           uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetDepthTestEnableEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdSetDepthTestEnableEXT(commandBuffer:%p, depthTestEnable:%d)",
+                      commandBuffer, depthTestEnable);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkBool32 local_depthTestEnable;
+    local_commandBuffer = commandBuffer;
+    local_depthTestEnable = depthTestEnable;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkBool32);
+    }
+    uint32_t packetSize_vkCmdSetDepthTestEnableEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetDepthTestEnableEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetDepthTestEnableEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetDepthTestEnableEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetDepthTestEnableEXT = OP_vkCmdSetDepthTestEnableEXT;
+    memcpy(streamPtr, &opcode_vkCmdSetDepthTestEnableEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetDepthTestEnableEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkBool32*)&local_depthTestEnable, sizeof(VkBool32));
+    *streamPtrPtr += sizeof(VkBool32);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetDepthTestEnableEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdSetDepthWriteEnableEXT(VkCommandBuffer commandBuffer,
+                                            VkBool32 depthWriteEnable, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetDepthWriteEnableEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdSetDepthWriteEnableEXT(commandBuffer:%p, depthWriteEnable:%d)",
+                      commandBuffer, depthWriteEnable);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkBool32 local_depthWriteEnable;
+    local_commandBuffer = commandBuffer;
+    local_depthWriteEnable = depthWriteEnable;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkBool32);
+    }
+    uint32_t packetSize_vkCmdSetDepthWriteEnableEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetDepthWriteEnableEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetDepthWriteEnableEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetDepthWriteEnableEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetDepthWriteEnableEXT = OP_vkCmdSetDepthWriteEnableEXT;
+    memcpy(streamPtr, &opcode_vkCmdSetDepthWriteEnableEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetDepthWriteEnableEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkBool32*)&local_depthWriteEnable, sizeof(VkBool32));
+    *streamPtrPtr += sizeof(VkBool32);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetDepthWriteEnableEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdSetDepthCompareOpEXT(VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp,
+                                          uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetDepthCompareOpEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdSetDepthCompareOpEXT(commandBuffer:%p)", commandBuffer);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkCompareOp local_depthCompareOp;
+    local_commandBuffer = commandBuffer;
+    local_depthCompareOp = depthCompareOp;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkCompareOp);
+    }
+    uint32_t packetSize_vkCmdSetDepthCompareOpEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetDepthCompareOpEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetDepthCompareOpEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetDepthCompareOpEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetDepthCompareOpEXT = OP_vkCmdSetDepthCompareOpEXT;
+    memcpy(streamPtr, &opcode_vkCmdSetDepthCompareOpEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetDepthCompareOpEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkCompareOp*)&local_depthCompareOp, sizeof(VkCompareOp));
+    *streamPtrPtr += sizeof(VkCompareOp);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetDepthCompareOpEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdSetDepthBoundsTestEnableEXT(VkCommandBuffer commandBuffer,
+                                                 VkBool32 depthBoundsTestEnable, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetDepthBoundsTestEnableEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdSetDepthBoundsTestEnableEXT(commandBuffer:%p, depthBoundsTestEnable:%d)",
+        commandBuffer, depthBoundsTestEnable);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkBool32 local_depthBoundsTestEnable;
+    local_commandBuffer = commandBuffer;
+    local_depthBoundsTestEnable = depthBoundsTestEnable;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkBool32);
+    }
+    uint32_t packetSize_vkCmdSetDepthBoundsTestEnableEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdSetDepthBoundsTestEnableEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetDepthBoundsTestEnableEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetDepthBoundsTestEnableEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetDepthBoundsTestEnableEXT = OP_vkCmdSetDepthBoundsTestEnableEXT;
+    memcpy(streamPtr, &opcode_vkCmdSetDepthBoundsTestEnableEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetDepthBoundsTestEnableEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkBool32*)&local_depthBoundsTestEnable, sizeof(VkBool32));
+    *streamPtrPtr += sizeof(VkBool32);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetDepthBoundsTestEnableEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdSetStencilTestEnableEXT(VkCommandBuffer commandBuffer,
+                                             VkBool32 stencilTestEnable, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetStencilTestEnableEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdSetStencilTestEnableEXT(commandBuffer:%p, stencilTestEnable:%d)",
+                      commandBuffer, stencilTestEnable);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkBool32 local_stencilTestEnable;
+    local_commandBuffer = commandBuffer;
+    local_stencilTestEnable = stencilTestEnable;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkBool32);
+    }
+    uint32_t packetSize_vkCmdSetStencilTestEnableEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdSetStencilTestEnableEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetStencilTestEnableEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetStencilTestEnableEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetStencilTestEnableEXT = OP_vkCmdSetStencilTestEnableEXT;
+    memcpy(streamPtr, &opcode_vkCmdSetStencilTestEnableEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetStencilTestEnableEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkBool32*)&local_stencilTestEnable, sizeof(VkBool32));
+    *streamPtrPtr += sizeof(VkBool32);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetStencilTestEnableEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdSetStencilOpEXT(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask,
+                                     VkStencilOp failOp, VkStencilOp passOp,
+                                     VkStencilOp depthFailOp, VkCompareOp compareOp,
+                                     uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetStencilOpEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdSetStencilOpEXT(commandBuffer:%p, faceMask:%d)", commandBuffer,
+                      faceMask);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkStencilFaceFlags local_faceMask;
+    VkStencilOp local_failOp;
+    VkStencilOp local_passOp;
+    VkStencilOp local_depthFailOp;
+    VkCompareOp local_compareOp;
+    local_commandBuffer = commandBuffer;
+    local_faceMask = faceMask;
+    local_failOp = failOp;
+    local_passOp = passOp;
+    local_depthFailOp = depthFailOp;
+    local_compareOp = compareOp;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkStencilFaceFlags);
+        *countPtr += sizeof(VkStencilOp);
+        *countPtr += sizeof(VkStencilOp);
+        *countPtr += sizeof(VkStencilOp);
+        *countPtr += sizeof(VkCompareOp);
+    }
+    uint32_t packetSize_vkCmdSetStencilOpEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetStencilOpEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetStencilOpEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetStencilOpEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetStencilOpEXT = OP_vkCmdSetStencilOpEXT;
+    memcpy(streamPtr, &opcode_vkCmdSetStencilOpEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetStencilOpEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags));
+    *streamPtrPtr += sizeof(VkStencilFaceFlags);
+    memcpy(*streamPtrPtr, (VkStencilOp*)&local_failOp, sizeof(VkStencilOp));
+    *streamPtrPtr += sizeof(VkStencilOp);
+    memcpy(*streamPtrPtr, (VkStencilOp*)&local_passOp, sizeof(VkStencilOp));
+    *streamPtrPtr += sizeof(VkStencilOp);
+    memcpy(*streamPtrPtr, (VkStencilOp*)&local_depthFailOp, sizeof(VkStencilOp));
+    *streamPtrPtr += sizeof(VkStencilOp);
+    memcpy(*streamPtrPtr, (VkCompareOp*)&local_compareOp, sizeof(VkCompareOp));
+    *streamPtrPtr += sizeof(VkCompareOp);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetStencilOpEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_EXT_shader_atomic_float2
+#endif
+#ifdef VK_EXT_shader_demote_to_helper_invocation
+#endif
+#ifdef VK_NV_device_generated_commands
+void VkEncoder::vkGetGeneratedCommandsMemoryRequirementsNV(
+    VkDevice device, const VkGeneratedCommandsMemoryRequirementsInfoNV* pInfo,
+    VkMemoryRequirements2* pMemoryRequirements, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetGeneratedCommandsMemoryRequirementsNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetGeneratedCommandsMemoryRequirementsNV(device:%p, pInfo:%p, pMemoryRequirements:%p)",
+        device, pInfo, pMemoryRequirements);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkGeneratedCommandsMemoryRequirementsInfoNV* local_pInfo;
+    local_device = device;
+    local_pInfo = nullptr;
+    if (pInfo) {
+        local_pInfo = (VkGeneratedCommandsMemoryRequirementsInfoNV*)pool->alloc(
+            sizeof(const VkGeneratedCommandsMemoryRequirementsInfoNV));
+        deepcopy_VkGeneratedCommandsMemoryRequirementsInfoNV(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfo,
+            (VkGeneratedCommandsMemoryRequirementsInfoNV*)(local_pInfo));
+    }
+    if (local_pInfo) {
+        transform_tohost_VkGeneratedCommandsMemoryRequirementsInfoNV(
+            sResourceTracker, (VkGeneratedCommandsMemoryRequirementsInfoNV*)(local_pInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkGeneratedCommandsMemoryRequirementsInfoNV(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkGeneratedCommandsMemoryRequirementsInfoNV*)(local_pInfo), countPtr);
+        count_VkMemoryRequirements2(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkMemoryRequirements2*)(pMemoryRequirements), countPtr);
+    }
+    uint32_t packetSize_vkGetGeneratedCommandsMemoryRequirementsNV =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetGeneratedCommandsMemoryRequirementsNV);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetGeneratedCommandsMemoryRequirementsNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetGeneratedCommandsMemoryRequirementsNV =
+        OP_vkGetGeneratedCommandsMemoryRequirementsNV;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetGeneratedCommandsMemoryRequirementsNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetGeneratedCommandsMemoryRequirementsNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkGeneratedCommandsMemoryRequirementsInfoNV(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkGeneratedCommandsMemoryRequirementsInfoNV*)(local_pInfo), streamPtrPtr);
+    reservedmarshal_VkMemoryRequirements2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                          (VkMemoryRequirements2*)(pMemoryRequirements),
+                                          streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetGeneratedCommandsMemoryRequirementsNV),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkMemoryRequirements2(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                    (VkMemoryRequirements2*)(pMemoryRequirements));
+    if (pMemoryRequirements) {
+        transform_fromhost_VkMemoryRequirements2(sResourceTracker,
+                                                 (VkMemoryRequirements2*)(pMemoryRequirements));
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdPreprocessGeneratedCommandsNV(
+    VkCommandBuffer commandBuffer, const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdPreprocessGeneratedCommandsNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdPreprocessGeneratedCommandsNV(commandBuffer:%p, pGeneratedCommandsInfo:%p)",
+        commandBuffer, pGeneratedCommandsInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkGeneratedCommandsInfoNV* local_pGeneratedCommandsInfo;
+    local_commandBuffer = commandBuffer;
+    local_pGeneratedCommandsInfo = nullptr;
+    if (pGeneratedCommandsInfo) {
+        local_pGeneratedCommandsInfo =
+            (VkGeneratedCommandsInfoNV*)pool->alloc(sizeof(const VkGeneratedCommandsInfoNV));
+        deepcopy_VkGeneratedCommandsInfoNV(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pGeneratedCommandsInfo,
+            (VkGeneratedCommandsInfoNV*)(local_pGeneratedCommandsInfo));
+    }
+    if (local_pGeneratedCommandsInfo) {
+        transform_tohost_VkGeneratedCommandsInfoNV(
+            sResourceTracker, (VkGeneratedCommandsInfoNV*)(local_pGeneratedCommandsInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkGeneratedCommandsInfoNV(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkGeneratedCommandsInfoNV*)(local_pGeneratedCommandsInfo),
+                                        countPtr);
+    }
+    uint32_t packetSize_vkCmdPreprocessGeneratedCommandsNV = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdPreprocessGeneratedCommandsNV);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdPreprocessGeneratedCommandsNV -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdPreprocessGeneratedCommandsNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdPreprocessGeneratedCommandsNV = OP_vkCmdPreprocessGeneratedCommandsNV;
+    memcpy(streamPtr, &opcode_vkCmdPreprocessGeneratedCommandsNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdPreprocessGeneratedCommandsNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkGeneratedCommandsInfoNV(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkGeneratedCommandsInfoNV*)(local_pGeneratedCommandsInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdPreprocessGeneratedCommandsNV), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdExecuteGeneratedCommandsNV(
+    VkCommandBuffer commandBuffer, VkBool32 isPreprocessed,
+    const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdExecuteGeneratedCommandsNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdExecuteGeneratedCommandsNV(commandBuffer:%p, isPreprocessed:%d, "
+        "pGeneratedCommandsInfo:%p)",
+        commandBuffer, isPreprocessed, pGeneratedCommandsInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkBool32 local_isPreprocessed;
+    VkGeneratedCommandsInfoNV* local_pGeneratedCommandsInfo;
+    local_commandBuffer = commandBuffer;
+    local_isPreprocessed = isPreprocessed;
+    local_pGeneratedCommandsInfo = nullptr;
+    if (pGeneratedCommandsInfo) {
+        local_pGeneratedCommandsInfo =
+            (VkGeneratedCommandsInfoNV*)pool->alloc(sizeof(const VkGeneratedCommandsInfoNV));
+        deepcopy_VkGeneratedCommandsInfoNV(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pGeneratedCommandsInfo,
+            (VkGeneratedCommandsInfoNV*)(local_pGeneratedCommandsInfo));
+    }
+    if (local_pGeneratedCommandsInfo) {
+        transform_tohost_VkGeneratedCommandsInfoNV(
+            sResourceTracker, (VkGeneratedCommandsInfoNV*)(local_pGeneratedCommandsInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkBool32);
+        count_VkGeneratedCommandsInfoNV(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkGeneratedCommandsInfoNV*)(local_pGeneratedCommandsInfo),
+                                        countPtr);
+    }
+    uint32_t packetSize_vkCmdExecuteGeneratedCommandsNV = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdExecuteGeneratedCommandsNV);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdExecuteGeneratedCommandsNV -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdExecuteGeneratedCommandsNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdExecuteGeneratedCommandsNV = OP_vkCmdExecuteGeneratedCommandsNV;
+    memcpy(streamPtr, &opcode_vkCmdExecuteGeneratedCommandsNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdExecuteGeneratedCommandsNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkBool32*)&local_isPreprocessed, sizeof(VkBool32));
+    *streamPtrPtr += sizeof(VkBool32);
+    reservedmarshal_VkGeneratedCommandsInfoNV(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkGeneratedCommandsInfoNV*)(local_pGeneratedCommandsInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdExecuteGeneratedCommandsNV), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdBindPipelineShaderGroupNV(VkCommandBuffer commandBuffer,
+                                               VkPipelineBindPoint pipelineBindPoint,
+                                               VkPipeline pipeline, uint32_t groupIndex,
+                                               uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdBindPipelineShaderGroupNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdBindPipelineShaderGroupNV(commandBuffer:%p, pipeline:%p, groupIndex:%d)",
+        commandBuffer, pipeline, groupIndex);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkPipelineBindPoint local_pipelineBindPoint;
+    VkPipeline local_pipeline;
+    uint32_t local_groupIndex;
+    local_commandBuffer = commandBuffer;
+    local_pipelineBindPoint = pipelineBindPoint;
+    local_pipeline = pipeline;
+    local_groupIndex = groupIndex;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkPipelineBindPoint);
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdBindPipelineShaderGroupNV = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdBindPipelineShaderGroupNV);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdBindPipelineShaderGroupNV -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdBindPipelineShaderGroupNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdBindPipelineShaderGroupNV = OP_vkCmdBindPipelineShaderGroupNV;
+    memcpy(streamPtr, &opcode_vkCmdBindPipelineShaderGroupNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdBindPipelineShaderGroupNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkPipelineBindPoint*)&local_pipelineBindPoint,
+           sizeof(VkPipelineBindPoint));
+    *streamPtrPtr += sizeof(VkPipelineBindPoint);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPipeline((*&local_pipeline));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_groupIndex, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdBindPipelineShaderGroupNV), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkCreateIndirectCommandsLayoutNV(
+    VkDevice device, const VkIndirectCommandsLayoutCreateInfoNV* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkIndirectCommandsLayoutNV* pIndirectCommandsLayout,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateIndirectCommandsLayoutNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateIndirectCommandsLayoutNV(device:%p, pCreateInfo:%p, pAllocator:%p, "
+        "pIndirectCommandsLayout:%p)",
+        device, pCreateInfo, pAllocator, pIndirectCommandsLayout);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkIndirectCommandsLayoutCreateInfoNV* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkIndirectCommandsLayoutCreateInfoNV*)pool->alloc(
+            sizeof(const VkIndirectCommandsLayoutCreateInfoNV));
+        deepcopy_VkIndirectCommandsLayoutCreateInfoNV(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+            (VkIndirectCommandsLayoutCreateInfoNV*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkIndirectCommandsLayoutCreateInfoNV(
+            sResourceTracker, (VkIndirectCommandsLayoutCreateInfoNV*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkIndirectCommandsLayoutCreateInfoNV(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkIndirectCommandsLayoutCreateInfoNV*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateIndirectCommandsLayoutNV =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCreateIndirectCommandsLayoutNV);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateIndirectCommandsLayoutNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateIndirectCommandsLayoutNV = OP_vkCreateIndirectCommandsLayoutNV;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateIndirectCommandsLayoutNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateIndirectCommandsLayoutNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkIndirectCommandsLayoutCreateInfoNV(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkIndirectCommandsLayoutCreateInfoNV*)(local_pCreateInfo), streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pIndirectCommandsLayout));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateIndirectCommandsLayoutNV), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkIndirectCommandsLayoutNV(
+        &cgen_var_3, (VkIndirectCommandsLayoutNV*)pIndirectCommandsLayout, 1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateIndirectCommandsLayoutNV_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateIndirectCommandsLayoutNV_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateIndirectCommandsLayoutNV_VkResult_return;
+}
+
+void VkEncoder::vkDestroyIndirectCommandsLayoutNV(VkDevice device,
+                                                  VkIndirectCommandsLayoutNV indirectCommandsLayout,
+                                                  const VkAllocationCallbacks* pAllocator,
+                                                  uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyIndirectCommandsLayoutNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkDestroyIndirectCommandsLayoutNV(device:%p, indirectCommandsLayout:%p, pAllocator:%p)",
+        device, indirectCommandsLayout, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkIndirectCommandsLayoutNV local_indirectCommandsLayout;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_indirectCommandsLayout = indirectCommandsLayout;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyIndirectCommandsLayoutNV =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkDestroyIndirectCommandsLayoutNV);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyIndirectCommandsLayoutNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyIndirectCommandsLayoutNV = OP_vkDestroyIndirectCommandsLayoutNV;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyIndirectCommandsLayoutNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyIndirectCommandsLayoutNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkIndirectCommandsLayoutNV((*&local_indirectCommandsLayout));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroyIndirectCommandsLayoutNV), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkIndirectCommandsLayoutNV(
+        (VkIndirectCommandsLayoutNV*)&indirectCommandsLayout);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_NV_inherited_viewport_scissor
+#endif
+#ifdef VK_EXT_texel_buffer_alignment
+#endif
+#ifdef VK_QCOM_render_pass_transform
+#endif
+#ifdef VK_EXT_device_memory_report
+#endif
+#ifdef VK_EXT_acquire_drm_display
+VkResult VkEncoder::vkAcquireDrmDisplayEXT(VkPhysicalDevice physicalDevice, int32_t drmFd,
+                                           VkDisplayKHR display, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkAcquireDrmDisplayEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkAcquireDrmDisplayEXT(physicalDevice:%p, drmFd:%d, display:%p)",
+                      physicalDevice, drmFd, display);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    int32_t local_drmFd;
+    VkDisplayKHR local_display;
+    local_physicalDevice = physicalDevice;
+    local_drmFd = drmFd;
+    local_display = display;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(int32_t);
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkAcquireDrmDisplayEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkAcquireDrmDisplayEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkAcquireDrmDisplayEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkAcquireDrmDisplayEXT = OP_vkAcquireDrmDisplayEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkAcquireDrmDisplayEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkAcquireDrmDisplayEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (int32_t*)&local_drmFd, sizeof(int32_t));
+    *streamPtrPtr += sizeof(int32_t);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDisplayKHR((*&local_display));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkAcquireDrmDisplayEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkAcquireDrmDisplayEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkAcquireDrmDisplayEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkAcquireDrmDisplayEXT_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetDrmDisplayEXT(VkPhysicalDevice physicalDevice, int32_t drmFd,
+                                       uint32_t connectorId, VkDisplayKHR* display,
+                                       uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetDrmDisplayEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetDrmDisplayEXT(physicalDevice:%p, drmFd:%d, connectorId:%d, display:%p)",
+                      physicalDevice, drmFd, connectorId, display);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    int32_t local_drmFd;
+    uint32_t local_connectorId;
+    local_physicalDevice = physicalDevice;
+    local_drmFd = drmFd;
+    local_connectorId = connectorId;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(int32_t);
+        *countPtr += sizeof(uint32_t);
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkGetDrmDisplayEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetDrmDisplayEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetDrmDisplayEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetDrmDisplayEXT = OP_vkGetDrmDisplayEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetDrmDisplayEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetDrmDisplayEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (int32_t*)&local_drmFd, sizeof(int32_t));
+    *streamPtrPtr += sizeof(int32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_connectorId, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    /* is handle, possibly out */;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = (uint64_t)((*display));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetDrmDisplayEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    uint64_t cgen_var_2;
+    stream->read((uint64_t*)&cgen_var_2, 8);
+    stream->handleMapping()->mapHandles_u64_VkDisplayKHR(&cgen_var_2, (VkDisplayKHR*)display, 1);
+    VkResult vkGetDrmDisplayEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkGetDrmDisplayEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetDrmDisplayEXT_VkResult_return;
+}
+
+#endif
+#ifdef VK_EXT_robustness2
+#endif
+#ifdef VK_EXT_custom_border_color
+#endif
+#ifdef VK_GOOGLE_user_type
+#endif
+#ifdef VK_EXT_private_data
+VkResult VkEncoder::vkCreatePrivateDataSlotEXT(VkDevice device,
+                                               const VkPrivateDataSlotCreateInfoEXT* pCreateInfo,
+                                               const VkAllocationCallbacks* pAllocator,
+                                               VkPrivateDataSlotEXT* pPrivateDataSlot,
+                                               uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreatePrivateDataSlotEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreatePrivateDataSlotEXT(device:%p, pCreateInfo:%p, pAllocator:%p, pPrivateDataSlot:%p)",
+        device, pCreateInfo, pAllocator, pPrivateDataSlot);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkPrivateDataSlotCreateInfoEXT* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkPrivateDataSlotCreateInfoEXT*)pool->alloc(
+            sizeof(const VkPrivateDataSlotCreateInfoEXT));
+        deepcopy_VkPrivateDataSlotCreateInfoEXT(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+            (VkPrivateDataSlotCreateInfoEXT*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkPrivateDataSlotCreateInfoEXT(
+            sResourceTracker, (VkPrivateDataSlotCreateInfoEXT*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkPrivateDataSlotCreateInfoEXT(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                             (VkPrivateDataSlotCreateInfoEXT*)(local_pCreateInfo),
+                                             countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreatePrivateDataSlotEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreatePrivateDataSlotEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreatePrivateDataSlotEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreatePrivateDataSlotEXT = OP_vkCreatePrivateDataSlotEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreatePrivateDataSlotEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreatePrivateDataSlotEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkPrivateDataSlotCreateInfoEXT(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkPrivateDataSlotCreateInfoEXT*)(local_pCreateInfo),
+        streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    uint64_t cgen_var_2 = (uint64_t)(*pPrivateDataSlot);
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreatePrivateDataSlotEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    (*pPrivateDataSlot) = (VkPrivateDataSlotEXT)stream->getBe64();
+    VkResult vkCreatePrivateDataSlotEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkCreatePrivateDataSlotEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreatePrivateDataSlotEXT_VkResult_return;
+}
+
+void VkEncoder::vkDestroyPrivateDataSlotEXT(VkDevice device, VkPrivateDataSlotEXT privateDataSlot,
+                                            const VkAllocationCallbacks* pAllocator,
+                                            uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyPrivateDataSlotEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroyPrivateDataSlotEXT(device:%p, pAllocator:%p)", device, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkPrivateDataSlotEXT local_privateDataSlot;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_privateDataSlot = privateDataSlot;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyPrivateDataSlotEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkDestroyPrivateDataSlotEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyPrivateDataSlotEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyPrivateDataSlotEXT = OP_vkDestroyPrivateDataSlotEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyPrivateDataSlotEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyPrivateDataSlotEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1 = (uint64_t)local_privateDataSlot;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroyPrivateDataSlotEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkSetPrivateDataEXT(VkDevice device, VkObjectType objectType,
+                                        uint64_t objectHandle, VkPrivateDataSlotEXT privateDataSlot,
+                                        uint64_t data, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkSetPrivateDataEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkSetPrivateDataEXT(device:%p, objectHandle:%ld, data:%ld)", device,
+                      objectHandle, data);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkObjectType local_objectType;
+    uint64_t local_objectHandle;
+    VkPrivateDataSlotEXT local_privateDataSlot;
+    uint64_t local_data;
+    local_device = device;
+    local_objectType = objectType;
+    local_objectHandle = objectHandle;
+    local_privateDataSlot = privateDataSlot;
+    local_data = data;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkObjectType);
+        *countPtr += sizeof(uint64_t);
+        *countPtr += 8;
+        *countPtr += sizeof(uint64_t);
+    }
+    uint32_t packetSize_vkSetPrivateDataEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkSetPrivateDataEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkSetPrivateDataEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkSetPrivateDataEXT = OP_vkSetPrivateDataEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkSetPrivateDataEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkSetPrivateDataEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkObjectType*)&local_objectType, sizeof(VkObjectType));
+    *streamPtrPtr += sizeof(VkObjectType);
+    memcpy(*streamPtrPtr, (uint64_t*)&local_objectHandle, sizeof(uint64_t));
+    *streamPtrPtr += sizeof(uint64_t);
+    uint64_t cgen_var_1 = (uint64_t)local_privateDataSlot;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    memcpy(*streamPtrPtr, (uint64_t*)&local_data, sizeof(uint64_t));
+    *streamPtrPtr += sizeof(uint64_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkSetPrivateDataEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkSetPrivateDataEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkSetPrivateDataEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkSetPrivateDataEXT_VkResult_return;
+}
+
+void VkEncoder::vkGetPrivateDataEXT(VkDevice device, VkObjectType objectType, uint64_t objectHandle,
+                                    VkPrivateDataSlotEXT privateDataSlot, uint64_t* pData,
+                                    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetPrivateDataEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetPrivateDataEXT(device:%p, objectHandle:%ld, pData:%p)", device,
+                      objectHandle, pData);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkObjectType local_objectType;
+    uint64_t local_objectHandle;
+    VkPrivateDataSlotEXT local_privateDataSlot;
+    local_device = device;
+    local_objectType = objectType;
+    local_objectHandle = objectHandle;
+    local_privateDataSlot = privateDataSlot;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkObjectType);
+        *countPtr += sizeof(uint64_t);
+        *countPtr += 8;
+        *countPtr += sizeof(uint64_t);
+    }
+    uint32_t packetSize_vkGetPrivateDataEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetPrivateDataEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetPrivateDataEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPrivateDataEXT = OP_vkGetPrivateDataEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPrivateDataEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPrivateDataEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkObjectType*)&local_objectType, sizeof(VkObjectType));
+    *streamPtrPtr += sizeof(VkObjectType);
+    memcpy(*streamPtrPtr, (uint64_t*)&local_objectHandle, sizeof(uint64_t));
+    *streamPtrPtr += sizeof(uint64_t);
+    uint64_t cgen_var_1 = (uint64_t)local_privateDataSlot;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    memcpy(*streamPtrPtr, (uint64_t*)pData, sizeof(uint64_t));
+    *streamPtrPtr += sizeof(uint64_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPrivateDataEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((uint64_t*)pData, sizeof(uint64_t));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_EXT_pipeline_creation_cache_control
+#endif
+#ifdef VK_NV_device_diagnostics_config
+#endif
+#ifdef VK_QCOM_render_pass_store_ops
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+void VkEncoder::vkCmdSetFragmentShadingRateEnumNV(
+    VkCommandBuffer commandBuffer, VkFragmentShadingRateNV shadingRate,
+    const VkFragmentShadingRateCombinerOpKHR combinerOps[2], uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetFragmentShadingRateEnumNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdSetFragmentShadingRateEnumNV(commandBuffer:%p)", commandBuffer);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkFragmentShadingRateNV local_shadingRate;
+    VkFragmentShadingRateCombinerOpKHR local_combinerOps[2];
+    local_commandBuffer = commandBuffer;
+    local_shadingRate = shadingRate;
+    memcpy(local_combinerOps, combinerOps, 2 * sizeof(const VkFragmentShadingRateCombinerOpKHR));
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkFragmentShadingRateNV);
+        *countPtr += 2 * sizeof(VkFragmentShadingRateCombinerOpKHR);
+    }
+    uint32_t packetSize_vkCmdSetFragmentShadingRateEnumNV = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdSetFragmentShadingRateEnumNV);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetFragmentShadingRateEnumNV -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetFragmentShadingRateEnumNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetFragmentShadingRateEnumNV = OP_vkCmdSetFragmentShadingRateEnumNV;
+    memcpy(streamPtr, &opcode_vkCmdSetFragmentShadingRateEnumNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetFragmentShadingRateEnumNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkFragmentShadingRateNV*)&local_shadingRate,
+           sizeof(VkFragmentShadingRateNV));
+    *streamPtrPtr += sizeof(VkFragmentShadingRateNV);
+    memcpy(*streamPtrPtr, (VkFragmentShadingRateCombinerOpKHR*)local_combinerOps,
+           2 * sizeof(VkFragmentShadingRateCombinerOpKHR));
+    *streamPtrPtr += 2 * sizeof(VkFragmentShadingRateCombinerOpKHR);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetFragmentShadingRateEnumNV), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_NV_ray_tracing_motion_blur
+#endif
+#ifdef VK_EXT_ycbcr_2plane_444_formats
+#endif
+#ifdef VK_EXT_fragment_density_map2
+#endif
+#ifdef VK_QCOM_rotated_copy_commands
+#endif
+#ifdef VK_EXT_image_robustness
+#endif
+#ifdef VK_EXT_4444_formats
+#endif
+#ifdef VK_EXT_rgba10x6_formats
+#endif
+#ifdef VK_NV_acquire_winrt_display
+VkResult VkEncoder::vkAcquireWinrtDisplayNV(VkPhysicalDevice physicalDevice, VkDisplayKHR display,
+                                            uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkAcquireWinrtDisplayNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkAcquireWinrtDisplayNV(physicalDevice:%p, display:%p)", physicalDevice,
+                      display);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    VkDisplayKHR local_display;
+    local_physicalDevice = physicalDevice;
+    local_display = display;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkAcquireWinrtDisplayNV =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkAcquireWinrtDisplayNV);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkAcquireWinrtDisplayNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkAcquireWinrtDisplayNV = OP_vkAcquireWinrtDisplayNV;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkAcquireWinrtDisplayNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkAcquireWinrtDisplayNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDisplayKHR((*&local_display));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkAcquireWinrtDisplayNV), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkAcquireWinrtDisplayNV_VkResult_return = (VkResult)0;
+    stream->read(&vkAcquireWinrtDisplayNV_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkAcquireWinrtDisplayNV_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetWinrtDisplayNV(VkPhysicalDevice physicalDevice, uint32_t deviceRelativeId,
+                                        VkDisplayKHR* pDisplay, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetWinrtDisplayNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetWinrtDisplayNV(physicalDevice:%p, deviceRelativeId:%d, pDisplay:%p)",
+                      physicalDevice, deviceRelativeId, pDisplay);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    uint32_t local_deviceRelativeId;
+    local_physicalDevice = physicalDevice;
+    local_deviceRelativeId = deviceRelativeId;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkGetWinrtDisplayNV =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetWinrtDisplayNV);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetWinrtDisplayNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetWinrtDisplayNV = OP_vkGetWinrtDisplayNV;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetWinrtDisplayNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetWinrtDisplayNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_deviceRelativeId, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    /* is handle, possibly out */;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = (uint64_t)((*pDisplay));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetWinrtDisplayNV), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    uint64_t cgen_var_2;
+    stream->read((uint64_t*)&cgen_var_2, 8);
+    stream->handleMapping()->mapHandles_u64_VkDisplayKHR(&cgen_var_2, (VkDisplayKHR*)pDisplay, 1);
+    VkResult vkGetWinrtDisplayNV_VkResult_return = (VkResult)0;
+    stream->read(&vkGetWinrtDisplayNV_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetWinrtDisplayNV_VkResult_return;
+}
+
+#endif
+#ifdef VK_EXT_directfb_surface
+VkResult VkEncoder::vkCreateDirectFBSurfaceEXT(VkInstance instance,
+                                               const VkDirectFBSurfaceCreateInfoEXT* pCreateInfo,
+                                               const VkAllocationCallbacks* pAllocator,
+                                               VkSurfaceKHR* pSurface, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateDirectFBSurfaceEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateDirectFBSurfaceEXT(instance:%p, pCreateInfo:%p, pAllocator:%p, pSurface:%p)",
+        instance, pCreateInfo, pAllocator, pSurface);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkInstance local_instance;
+    VkDirectFBSurfaceCreateInfoEXT* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_instance = instance;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkDirectFBSurfaceCreateInfoEXT*)pool->alloc(
+            sizeof(const VkDirectFBSurfaceCreateInfoEXT));
+        deepcopy_VkDirectFBSurfaceCreateInfoEXT(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+            (VkDirectFBSurfaceCreateInfoEXT*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkDirectFBSurfaceCreateInfoEXT(
+            sResourceTracker, (VkDirectFBSurfaceCreateInfoEXT*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkDirectFBSurfaceCreateInfoEXT(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                             (VkDirectFBSurfaceCreateInfoEXT*)(local_pCreateInfo),
+                                             countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateDirectFBSurfaceEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateDirectFBSurfaceEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateDirectFBSurfaceEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateDirectFBSurfaceEXT = OP_vkCreateDirectFBSurfaceEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateDirectFBSurfaceEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateDirectFBSurfaceEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkInstance((*&local_instance));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkDirectFBSurfaceCreateInfoEXT(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkDirectFBSurfaceCreateInfoEXT*)(local_pCreateInfo),
+        streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pSurface));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateDirectFBSurfaceEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_3, (VkSurfaceKHR*)pSurface, 1);
+    VkResult vkCreateDirectFBSurfaceEXT_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateDirectFBSurfaceEXT_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateDirectFBSurfaceEXT_VkResult_return;
+}
+
+VkBool32 VkEncoder::vkGetPhysicalDeviceDirectFBPresentationSupportEXT(
+    VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, IDirectFB* dfb, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkGetPhysicalDeviceDirectFBPresentationSupportEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceDirectFBPresentationSupportEXT(physicalDevice:%p, queueFamilyIndex:%d, "
+        "dfb:%p)",
+        physicalDevice, queueFamilyIndex, dfb);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    uint32_t local_queueFamilyIndex;
+    local_physicalDevice = physicalDevice;
+    local_queueFamilyIndex = queueFamilyIndex;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(IDirectFB);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceDirectFBPresentationSupportEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceDirectFBPresentationSupportEXT);
+    uint8_t* streamPtr =
+        stream->reserve(packetSize_vkGetPhysicalDeviceDirectFBPresentationSupportEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceDirectFBPresentationSupportEXT =
+        OP_vkGetPhysicalDeviceDirectFBPresentationSupportEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceDirectFBPresentationSupportEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceDirectFBPresentationSupportEXT,
+           sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (IDirectFB*)dfb, sizeof(IDirectFB));
+    *streamPtrPtr += sizeof(IDirectFB);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceDirectFBPresentationSupportEXT),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((IDirectFB*)dfb, sizeof(IDirectFB));
+    VkBool32 vkGetPhysicalDeviceDirectFBPresentationSupportEXT_VkBool32_return = (VkBool32)0;
+    stream->read(&vkGetPhysicalDeviceDirectFBPresentationSupportEXT_VkBool32_return,
+                 sizeof(VkBool32));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDeviceDirectFBPresentationSupportEXT_VkBool32_return;
+}
+
+#endif
+#ifdef VK_VALVE_mutable_descriptor_type
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+void VkEncoder::vkCmdSetVertexInputEXT(
+    VkCommandBuffer commandBuffer, uint32_t vertexBindingDescriptionCount,
+    const VkVertexInputBindingDescription2EXT* pVertexBindingDescriptions,
+    uint32_t vertexAttributeDescriptionCount,
+    const VkVertexInputAttributeDescription2EXT* pVertexAttributeDescriptions, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetVertexInputEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdSetVertexInputEXT(commandBuffer:%p, vertexBindingDescriptionCount:%d, "
+        "pVertexBindingDescriptions:%p, vertexAttributeDescriptionCount:%d, "
+        "pVertexAttributeDescriptions:%p)",
+        commandBuffer, vertexBindingDescriptionCount, pVertexBindingDescriptions,
+        vertexAttributeDescriptionCount, pVertexAttributeDescriptions);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_vertexBindingDescriptionCount;
+    VkVertexInputBindingDescription2EXT* local_pVertexBindingDescriptions;
+    uint32_t local_vertexAttributeDescriptionCount;
+    VkVertexInputAttributeDescription2EXT* local_pVertexAttributeDescriptions;
+    local_commandBuffer = commandBuffer;
+    local_vertexBindingDescriptionCount = vertexBindingDescriptionCount;
+    local_pVertexBindingDescriptions = nullptr;
+    if (pVertexBindingDescriptions) {
+        local_pVertexBindingDescriptions = (VkVertexInputBindingDescription2EXT*)pool->alloc(
+            ((vertexBindingDescriptionCount)) * sizeof(const VkVertexInputBindingDescription2EXT));
+        for (uint32_t i = 0; i < (uint32_t)((vertexBindingDescriptionCount)); ++i) {
+            deepcopy_VkVertexInputBindingDescription2EXT(
+                pool, VK_STRUCTURE_TYPE_MAX_ENUM, pVertexBindingDescriptions + i,
+                (VkVertexInputBindingDescription2EXT*)(local_pVertexBindingDescriptions + i));
+        }
+    }
+    local_vertexAttributeDescriptionCount = vertexAttributeDescriptionCount;
+    local_pVertexAttributeDescriptions = nullptr;
+    if (pVertexAttributeDescriptions) {
+        local_pVertexAttributeDescriptions = (VkVertexInputAttributeDescription2EXT*)pool->alloc(
+            ((vertexAttributeDescriptionCount)) *
+            sizeof(const VkVertexInputAttributeDescription2EXT));
+        for (uint32_t i = 0; i < (uint32_t)((vertexAttributeDescriptionCount)); ++i) {
+            deepcopy_VkVertexInputAttributeDescription2EXT(
+                pool, VK_STRUCTURE_TYPE_MAX_ENUM, pVertexAttributeDescriptions + i,
+                (VkVertexInputAttributeDescription2EXT*)(local_pVertexAttributeDescriptions + i));
+        }
+    }
+    if (local_pVertexBindingDescriptions) {
+        for (uint32_t i = 0; i < (uint32_t)((vertexBindingDescriptionCount)); ++i) {
+            transform_tohost_VkVertexInputBindingDescription2EXT(
+                sResourceTracker,
+                (VkVertexInputBindingDescription2EXT*)(local_pVertexBindingDescriptions + i));
+        }
+    }
+    if (local_pVertexAttributeDescriptions) {
+        for (uint32_t i = 0; i < (uint32_t)((vertexAttributeDescriptionCount)); ++i) {
+            transform_tohost_VkVertexInputAttributeDescription2EXT(
+                sResourceTracker,
+                (VkVertexInputAttributeDescription2EXT*)(local_pVertexAttributeDescriptions + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((vertexBindingDescriptionCount)); ++i) {
+            count_VkVertexInputBindingDescription2EXT(
+                sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkVertexInputBindingDescription2EXT*)(local_pVertexBindingDescriptions + i),
+                countPtr);
+        }
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((vertexAttributeDescriptionCount)); ++i) {
+            count_VkVertexInputAttributeDescription2EXT(
+                sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkVertexInputAttributeDescription2EXT*)(local_pVertexAttributeDescriptions + i),
+                countPtr);
+        }
+    }
+    uint32_t packetSize_vkCmdSetVertexInputEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetVertexInputEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetVertexInputEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetVertexInputEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetVertexInputEXT = OP_vkCmdSetVertexInputEXT;
+    memcpy(streamPtr, &opcode_vkCmdSetVertexInputEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetVertexInputEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_vertexBindingDescriptionCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((vertexBindingDescriptionCount)); ++i) {
+        reservedmarshal_VkVertexInputBindingDescription2EXT(
+            stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkVertexInputBindingDescription2EXT*)(local_pVertexBindingDescriptions + i),
+            streamPtrPtr);
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_vertexAttributeDescriptionCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((vertexAttributeDescriptionCount)); ++i) {
+        reservedmarshal_VkVertexInputAttributeDescription2EXT(
+            stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkVertexInputAttributeDescription2EXT*)(local_pVertexAttributeDescriptions + i),
+            streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetVertexInputEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_EXT_physical_device_drm
+#endif
+#ifdef VK_EXT_primitive_topology_list_restart
+#endif
+#ifdef VK_FUCHSIA_external_memory
+VkResult VkEncoder::vkGetMemoryZirconHandleFUCHSIA(
+    VkDevice device, const VkMemoryGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo,
+    zx_handle_t* pZirconHandle, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetMemoryZirconHandleFUCHSIA in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetMemoryZirconHandleFUCHSIA(device:%p, pGetZirconHandleInfo:%p, pZirconHandle:%p)",
+        device, pGetZirconHandleInfo, pZirconHandle);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkMemoryGetZirconHandleInfoFUCHSIA* local_pGetZirconHandleInfo;
+    local_device = device;
+    local_pGetZirconHandleInfo = nullptr;
+    if (pGetZirconHandleInfo) {
+        local_pGetZirconHandleInfo = (VkMemoryGetZirconHandleInfoFUCHSIA*)pool->alloc(
+            sizeof(const VkMemoryGetZirconHandleInfoFUCHSIA));
+        deepcopy_VkMemoryGetZirconHandleInfoFUCHSIA(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pGetZirconHandleInfo,
+            (VkMemoryGetZirconHandleInfoFUCHSIA*)(local_pGetZirconHandleInfo));
+    }
+    if (local_pGetZirconHandleInfo) {
+        transform_tohost_VkMemoryGetZirconHandleInfoFUCHSIA(
+            sResourceTracker, (VkMemoryGetZirconHandleInfoFUCHSIA*)(local_pGetZirconHandleInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkMemoryGetZirconHandleInfoFUCHSIA(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkMemoryGetZirconHandleInfoFUCHSIA*)(local_pGetZirconHandleInfo), countPtr);
+        *countPtr += sizeof(zx_handle_t);
+    }
+    uint32_t packetSize_vkGetMemoryZirconHandleFUCHSIA =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetMemoryZirconHandleFUCHSIA);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetMemoryZirconHandleFUCHSIA);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetMemoryZirconHandleFUCHSIA = OP_vkGetMemoryZirconHandleFUCHSIA;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetMemoryZirconHandleFUCHSIA, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetMemoryZirconHandleFUCHSIA, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkMemoryGetZirconHandleInfoFUCHSIA(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkMemoryGetZirconHandleInfoFUCHSIA*)(local_pGetZirconHandleInfo), streamPtrPtr);
+    memcpy(*streamPtrPtr, (zx_handle_t*)pZirconHandle, sizeof(zx_handle_t));
+    *streamPtrPtr += sizeof(zx_handle_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetMemoryZirconHandleFUCHSIA), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((zx_handle_t*)pZirconHandle, sizeof(zx_handle_t));
+    VkResult vkGetMemoryZirconHandleFUCHSIA_VkResult_return = (VkResult)0;
+    stream->read(&vkGetMemoryZirconHandleFUCHSIA_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetMemoryZirconHandleFUCHSIA_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetMemoryZirconHandlePropertiesFUCHSIA(
+    VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, zx_handle_t zirconHandle,
+    VkMemoryZirconHandlePropertiesFUCHSIA* pMemoryZirconHandleProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetMemoryZirconHandlePropertiesFUCHSIA in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetMemoryZirconHandlePropertiesFUCHSIA(device:%p, pMemoryZirconHandleProperties:%p)",
+        device, pMemoryZirconHandleProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkExternalMemoryHandleTypeFlagBits local_handleType;
+    zx_handle_t local_zirconHandle;
+    local_device = device;
+    local_handleType = handleType;
+    local_zirconHandle = zirconHandle;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkExternalMemoryHandleTypeFlagBits);
+        *countPtr += sizeof(zx_handle_t);
+        count_VkMemoryZirconHandlePropertiesFUCHSIA(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkMemoryZirconHandlePropertiesFUCHSIA*)(pMemoryZirconHandleProperties), countPtr);
+    }
+    uint32_t packetSize_vkGetMemoryZirconHandlePropertiesFUCHSIA =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetMemoryZirconHandlePropertiesFUCHSIA);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetMemoryZirconHandlePropertiesFUCHSIA);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetMemoryZirconHandlePropertiesFUCHSIA =
+        OP_vkGetMemoryZirconHandlePropertiesFUCHSIA;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetMemoryZirconHandlePropertiesFUCHSIA, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetMemoryZirconHandlePropertiesFUCHSIA, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkExternalMemoryHandleTypeFlagBits*)&local_handleType,
+           sizeof(VkExternalMemoryHandleTypeFlagBits));
+    *streamPtrPtr += sizeof(VkExternalMemoryHandleTypeFlagBits);
+    memcpy(*streamPtrPtr, (zx_handle_t*)&local_zirconHandle, sizeof(zx_handle_t));
+    *streamPtrPtr += sizeof(zx_handle_t);
+    reservedmarshal_VkMemoryZirconHandlePropertiesFUCHSIA(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkMemoryZirconHandlePropertiesFUCHSIA*)(pMemoryZirconHandleProperties), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetMemoryZirconHandlePropertiesFUCHSIA),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkMemoryZirconHandlePropertiesFUCHSIA(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkMemoryZirconHandlePropertiesFUCHSIA*)(pMemoryZirconHandleProperties));
+    if (pMemoryZirconHandleProperties) {
+        transform_fromhost_VkMemoryZirconHandlePropertiesFUCHSIA(
+            sResourceTracker,
+            (VkMemoryZirconHandlePropertiesFUCHSIA*)(pMemoryZirconHandleProperties));
+    }
+    VkResult vkGetMemoryZirconHandlePropertiesFUCHSIA_VkResult_return = (VkResult)0;
+    stream->read(&vkGetMemoryZirconHandlePropertiesFUCHSIA_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetMemoryZirconHandlePropertiesFUCHSIA_VkResult_return;
+}
+
+#endif
+#ifdef VK_FUCHSIA_external_semaphore
+VkResult VkEncoder::vkImportSemaphoreZirconHandleFUCHSIA(
+    VkDevice device,
+    const VkImportSemaphoreZirconHandleInfoFUCHSIA* pImportSemaphoreZirconHandleInfo,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkImportSemaphoreZirconHandleFUCHSIA in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkImportSemaphoreZirconHandleFUCHSIA(device:%p, pImportSemaphoreZirconHandleInfo:%p)",
+        device, pImportSemaphoreZirconHandleInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkImportSemaphoreZirconHandleInfoFUCHSIA* local_pImportSemaphoreZirconHandleInfo;
+    local_device = device;
+    local_pImportSemaphoreZirconHandleInfo = nullptr;
+    if (pImportSemaphoreZirconHandleInfo) {
+        local_pImportSemaphoreZirconHandleInfo =
+            (VkImportSemaphoreZirconHandleInfoFUCHSIA*)pool->alloc(
+                sizeof(const VkImportSemaphoreZirconHandleInfoFUCHSIA));
+        deepcopy_VkImportSemaphoreZirconHandleInfoFUCHSIA(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pImportSemaphoreZirconHandleInfo,
+            (VkImportSemaphoreZirconHandleInfoFUCHSIA*)(local_pImportSemaphoreZirconHandleInfo));
+    }
+    if (local_pImportSemaphoreZirconHandleInfo) {
+        transform_tohost_VkImportSemaphoreZirconHandleInfoFUCHSIA(
+            sResourceTracker,
+            (VkImportSemaphoreZirconHandleInfoFUCHSIA*)(local_pImportSemaphoreZirconHandleInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkImportSemaphoreZirconHandleInfoFUCHSIA(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkImportSemaphoreZirconHandleInfoFUCHSIA*)(local_pImportSemaphoreZirconHandleInfo),
+            countPtr);
+    }
+    uint32_t packetSize_vkImportSemaphoreZirconHandleFUCHSIA =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkImportSemaphoreZirconHandleFUCHSIA);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkImportSemaphoreZirconHandleFUCHSIA);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkImportSemaphoreZirconHandleFUCHSIA = OP_vkImportSemaphoreZirconHandleFUCHSIA;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkImportSemaphoreZirconHandleFUCHSIA, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkImportSemaphoreZirconHandleFUCHSIA, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkImportSemaphoreZirconHandleInfoFUCHSIA(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkImportSemaphoreZirconHandleInfoFUCHSIA*)(local_pImportSemaphoreZirconHandleInfo),
+        streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkImportSemaphoreZirconHandleFUCHSIA),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkImportSemaphoreZirconHandleFUCHSIA_VkResult_return = (VkResult)0;
+    stream->read(&vkImportSemaphoreZirconHandleFUCHSIA_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkImportSemaphoreZirconHandleFUCHSIA_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetSemaphoreZirconHandleFUCHSIA(
+    VkDevice device, const VkSemaphoreGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo,
+    zx_handle_t* pZirconHandle, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetSemaphoreZirconHandleFUCHSIA in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetSemaphoreZirconHandleFUCHSIA(device:%p, pGetZirconHandleInfo:%p, pZirconHandle:%p)",
+        device, pGetZirconHandleInfo, pZirconHandle);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkSemaphoreGetZirconHandleInfoFUCHSIA* local_pGetZirconHandleInfo;
+    local_device = device;
+    local_pGetZirconHandleInfo = nullptr;
+    if (pGetZirconHandleInfo) {
+        local_pGetZirconHandleInfo = (VkSemaphoreGetZirconHandleInfoFUCHSIA*)pool->alloc(
+            sizeof(const VkSemaphoreGetZirconHandleInfoFUCHSIA));
+        deepcopy_VkSemaphoreGetZirconHandleInfoFUCHSIA(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pGetZirconHandleInfo,
+            (VkSemaphoreGetZirconHandleInfoFUCHSIA*)(local_pGetZirconHandleInfo));
+    }
+    if (local_pGetZirconHandleInfo) {
+        transform_tohost_VkSemaphoreGetZirconHandleInfoFUCHSIA(
+            sResourceTracker, (VkSemaphoreGetZirconHandleInfoFUCHSIA*)(local_pGetZirconHandleInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkSemaphoreGetZirconHandleInfoFUCHSIA(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkSemaphoreGetZirconHandleInfoFUCHSIA*)(local_pGetZirconHandleInfo), countPtr);
+        *countPtr += sizeof(zx_handle_t);
+    }
+    uint32_t packetSize_vkGetSemaphoreZirconHandleFUCHSIA =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetSemaphoreZirconHandleFUCHSIA);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetSemaphoreZirconHandleFUCHSIA);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetSemaphoreZirconHandleFUCHSIA = OP_vkGetSemaphoreZirconHandleFUCHSIA;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetSemaphoreZirconHandleFUCHSIA, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetSemaphoreZirconHandleFUCHSIA, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkSemaphoreGetZirconHandleInfoFUCHSIA(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkSemaphoreGetZirconHandleInfoFUCHSIA*)(local_pGetZirconHandleInfo), streamPtrPtr);
+    memcpy(*streamPtrPtr, (zx_handle_t*)pZirconHandle, sizeof(zx_handle_t));
+    *streamPtrPtr += sizeof(zx_handle_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetSemaphoreZirconHandleFUCHSIA), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((zx_handle_t*)pZirconHandle, sizeof(zx_handle_t));
+    VkResult vkGetSemaphoreZirconHandleFUCHSIA_VkResult_return = (VkResult)0;
+    stream->read(&vkGetSemaphoreZirconHandleFUCHSIA_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetSemaphoreZirconHandleFUCHSIA_VkResult_return;
+}
+
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+VkResult VkEncoder::vkCreateBufferCollectionFUCHSIA(
+    VkDevice device, const VkBufferCollectionCreateInfoFUCHSIA* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkBufferCollectionFUCHSIA* pCollection,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateBufferCollectionFUCHSIA in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateBufferCollectionFUCHSIA(device:%p, pCreateInfo:%p, pAllocator:%p, pCollection:%p)",
+        device, pCreateInfo, pAllocator, pCollection);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkBufferCollectionCreateInfoFUCHSIA* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkBufferCollectionCreateInfoFUCHSIA*)pool->alloc(
+            sizeof(const VkBufferCollectionCreateInfoFUCHSIA));
+        deepcopy_VkBufferCollectionCreateInfoFUCHSIA(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+            (VkBufferCollectionCreateInfoFUCHSIA*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkBufferCollectionCreateInfoFUCHSIA(
+            sResourceTracker, (VkBufferCollectionCreateInfoFUCHSIA*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkBufferCollectionCreateInfoFUCHSIA(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkBufferCollectionCreateInfoFUCHSIA*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateBufferCollectionFUCHSIA =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCreateBufferCollectionFUCHSIA);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateBufferCollectionFUCHSIA);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateBufferCollectionFUCHSIA = OP_vkCreateBufferCollectionFUCHSIA;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateBufferCollectionFUCHSIA, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateBufferCollectionFUCHSIA, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkBufferCollectionCreateInfoFUCHSIA(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkBufferCollectionCreateInfoFUCHSIA*)(local_pCreateInfo), streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    uint64_t cgen_var_2 = (uint64_t)(*pCollection);
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateBufferCollectionFUCHSIA), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    (*pCollection) = (VkBufferCollectionFUCHSIA)stream->getBe64();
+    VkResult vkCreateBufferCollectionFUCHSIA_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateBufferCollectionFUCHSIA_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateBufferCollectionFUCHSIA_VkResult_return;
+}
+
+VkResult VkEncoder::vkSetBufferCollectionImageConstraintsFUCHSIA(
+    VkDevice device, VkBufferCollectionFUCHSIA collection,
+    const VkImageConstraintsInfoFUCHSIA* pImageConstraintsInfo, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkSetBufferCollectionImageConstraintsFUCHSIA in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkSetBufferCollectionImageConstraintsFUCHSIA(device:%p, pImageConstraintsInfo:%p)", device,
+        pImageConstraintsInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkBufferCollectionFUCHSIA local_collection;
+    VkImageConstraintsInfoFUCHSIA* local_pImageConstraintsInfo;
+    local_device = device;
+    local_collection = collection;
+    local_pImageConstraintsInfo = nullptr;
+    if (pImageConstraintsInfo) {
+        local_pImageConstraintsInfo = (VkImageConstraintsInfoFUCHSIA*)pool->alloc(
+            sizeof(const VkImageConstraintsInfoFUCHSIA));
+        deepcopy_VkImageConstraintsInfoFUCHSIA(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pImageConstraintsInfo,
+            (VkImageConstraintsInfoFUCHSIA*)(local_pImageConstraintsInfo));
+    }
+    if (local_pImageConstraintsInfo) {
+        transform_tohost_VkImageConstraintsInfoFUCHSIA(
+            sResourceTracker, (VkImageConstraintsInfoFUCHSIA*)(local_pImageConstraintsInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += 8;
+        count_VkImageConstraintsInfoFUCHSIA(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkImageConstraintsInfoFUCHSIA*)(local_pImageConstraintsInfo), countPtr);
+    }
+    uint32_t packetSize_vkSetBufferCollectionImageConstraintsFUCHSIA =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkSetBufferCollectionImageConstraintsFUCHSIA);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkSetBufferCollectionImageConstraintsFUCHSIA);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkSetBufferCollectionImageConstraintsFUCHSIA =
+        OP_vkSetBufferCollectionImageConstraintsFUCHSIA;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkSetBufferCollectionImageConstraintsFUCHSIA, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkSetBufferCollectionImageConstraintsFUCHSIA, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1 = (uint64_t)local_collection;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    reservedmarshal_VkImageConstraintsInfoFUCHSIA(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkImageConstraintsInfoFUCHSIA*)(local_pImageConstraintsInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkSetBufferCollectionImageConstraintsFUCHSIA),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkSetBufferCollectionImageConstraintsFUCHSIA_VkResult_return = (VkResult)0;
+    stream->read(&vkSetBufferCollectionImageConstraintsFUCHSIA_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkSetBufferCollectionImageConstraintsFUCHSIA_VkResult_return;
+}
+
+VkResult VkEncoder::vkSetBufferCollectionBufferConstraintsFUCHSIA(
+    VkDevice device, VkBufferCollectionFUCHSIA collection,
+    const VkBufferConstraintsInfoFUCHSIA* pBufferConstraintsInfo, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkSetBufferCollectionBufferConstraintsFUCHSIA in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkSetBufferCollectionBufferConstraintsFUCHSIA(device:%p, pBufferConstraintsInfo:%p)",
+        device, pBufferConstraintsInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkBufferCollectionFUCHSIA local_collection;
+    VkBufferConstraintsInfoFUCHSIA* local_pBufferConstraintsInfo;
+    local_device = device;
+    local_collection = collection;
+    local_pBufferConstraintsInfo = nullptr;
+    if (pBufferConstraintsInfo) {
+        local_pBufferConstraintsInfo = (VkBufferConstraintsInfoFUCHSIA*)pool->alloc(
+            sizeof(const VkBufferConstraintsInfoFUCHSIA));
+        deepcopy_VkBufferConstraintsInfoFUCHSIA(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pBufferConstraintsInfo,
+            (VkBufferConstraintsInfoFUCHSIA*)(local_pBufferConstraintsInfo));
+    }
+    if (local_pBufferConstraintsInfo) {
+        transform_tohost_VkBufferConstraintsInfoFUCHSIA(
+            sResourceTracker, (VkBufferConstraintsInfoFUCHSIA*)(local_pBufferConstraintsInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += 8;
+        count_VkBufferConstraintsInfoFUCHSIA(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkBufferConstraintsInfoFUCHSIA*)(local_pBufferConstraintsInfo), countPtr);
+    }
+    uint32_t packetSize_vkSetBufferCollectionBufferConstraintsFUCHSIA =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkSetBufferCollectionBufferConstraintsFUCHSIA);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkSetBufferCollectionBufferConstraintsFUCHSIA);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkSetBufferCollectionBufferConstraintsFUCHSIA =
+        OP_vkSetBufferCollectionBufferConstraintsFUCHSIA;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkSetBufferCollectionBufferConstraintsFUCHSIA, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkSetBufferCollectionBufferConstraintsFUCHSIA, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1 = (uint64_t)local_collection;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    reservedmarshal_VkBufferConstraintsInfoFUCHSIA(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkBufferConstraintsInfoFUCHSIA*)(local_pBufferConstraintsInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkSetBufferCollectionBufferConstraintsFUCHSIA),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkSetBufferCollectionBufferConstraintsFUCHSIA_VkResult_return = (VkResult)0;
+    stream->read(&vkSetBufferCollectionBufferConstraintsFUCHSIA_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkSetBufferCollectionBufferConstraintsFUCHSIA_VkResult_return;
+}
+
+void VkEncoder::vkDestroyBufferCollectionFUCHSIA(VkDevice device,
+                                                 VkBufferCollectionFUCHSIA collection,
+                                                 const VkAllocationCallbacks* pAllocator,
+                                                 uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyBufferCollectionFUCHSIA in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkDestroyBufferCollectionFUCHSIA(device:%p, pAllocator:%p)", device,
+                      pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkBufferCollectionFUCHSIA local_collection;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_collection = collection;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyBufferCollectionFUCHSIA =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkDestroyBufferCollectionFUCHSIA);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyBufferCollectionFUCHSIA);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyBufferCollectionFUCHSIA = OP_vkDestroyBufferCollectionFUCHSIA;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyBufferCollectionFUCHSIA, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyBufferCollectionFUCHSIA, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1 = (uint64_t)local_collection;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroyBufferCollectionFUCHSIA), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkGetBufferCollectionPropertiesFUCHSIA(
+    VkDevice device, VkBufferCollectionFUCHSIA collection,
+    VkBufferCollectionPropertiesFUCHSIA* pProperties, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetBufferCollectionPropertiesFUCHSIA in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetBufferCollectionPropertiesFUCHSIA(device:%p, pProperties:%p)", device,
+                      pProperties);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkBufferCollectionFUCHSIA local_collection;
+    local_device = device;
+    local_collection = collection;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += 8;
+        count_VkBufferCollectionPropertiesFUCHSIA(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkBufferCollectionPropertiesFUCHSIA*)(pProperties), countPtr);
+    }
+    uint32_t packetSize_vkGetBufferCollectionPropertiesFUCHSIA =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetBufferCollectionPropertiesFUCHSIA);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetBufferCollectionPropertiesFUCHSIA);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetBufferCollectionPropertiesFUCHSIA =
+        OP_vkGetBufferCollectionPropertiesFUCHSIA;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetBufferCollectionPropertiesFUCHSIA, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetBufferCollectionPropertiesFUCHSIA, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1 = (uint64_t)local_collection;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    reservedmarshal_VkBufferCollectionPropertiesFUCHSIA(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkBufferCollectionPropertiesFUCHSIA*)(pProperties),
+        streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetBufferCollectionPropertiesFUCHSIA),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkBufferCollectionPropertiesFUCHSIA(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkBufferCollectionPropertiesFUCHSIA*)(pProperties));
+    if (pProperties) {
+        transform_fromhost_VkBufferCollectionPropertiesFUCHSIA(
+            sResourceTracker, (VkBufferCollectionPropertiesFUCHSIA*)(pProperties));
+    }
+    VkResult vkGetBufferCollectionPropertiesFUCHSIA_VkResult_return = (VkResult)0;
+    stream->read(&vkGetBufferCollectionPropertiesFUCHSIA_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetBufferCollectionPropertiesFUCHSIA_VkResult_return;
+}
+
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+VkResult VkEncoder::vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI(VkDevice device,
+                                                                    VkRenderPass renderpass,
+                                                                    VkExtent2D* pMaxWorkgroupSize,
+                                                                    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI(device:%p, renderpass:%p, "
+        "pMaxWorkgroupSize:%p)",
+        device, renderpass, pMaxWorkgroupSize);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkRenderPass local_renderpass;
+    local_device = device;
+    local_renderpass = renderpass;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        count_VkExtent2D(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM, (VkExtent2D*)(pMaxWorkgroupSize),
+                         countPtr);
+    }
+    uint32_t packetSize_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI);
+    uint8_t* streamPtr =
+        stream->reserve(packetSize_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI =
+        OP_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI,
+           sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkRenderPass((*&local_renderpass));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkExtent2D(stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkExtent2D*)(pMaxWorkgroupSize),
+                               streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkExtent2D(stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkExtent2D*)(pMaxWorkgroupSize));
+    if (pMaxWorkgroupSize) {
+        transform_fromhost_VkExtent2D(sResourceTracker, (VkExtent2D*)(pMaxWorkgroupSize));
+    }
+    VkResult vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI_VkResult_return = (VkResult)0;
+    stream->read(&vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI_VkResult_return,
+                 sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI_VkResult_return;
+}
+
+void VkEncoder::vkCmdSubpassShadingHUAWEI(VkCommandBuffer commandBuffer, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSubpassShadingHUAWEI in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdSubpassShadingHUAWEI(commandBuffer:%p)", commandBuffer);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    local_commandBuffer = commandBuffer;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkCmdSubpassShadingHUAWEI = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSubpassShadingHUAWEI);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSubpassShadingHUAWEI -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSubpassShadingHUAWEI);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSubpassShadingHUAWEI = OP_vkCmdSubpassShadingHUAWEI;
+    memcpy(streamPtr, &opcode_vkCmdSubpassShadingHUAWEI, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSubpassShadingHUAWEI, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSubpassShadingHUAWEI), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+void VkEncoder::vkCmdBindInvocationMaskHUAWEI(VkCommandBuffer commandBuffer, VkImageView imageView,
+                                              VkImageLayout imageLayout, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdBindInvocationMaskHUAWEI in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdBindInvocationMaskHUAWEI(commandBuffer:%p, imageView:%p, imageLayout:%d)",
+        commandBuffer, imageView, imageLayout);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkImageView local_imageView;
+    VkImageLayout local_imageLayout;
+    local_commandBuffer = commandBuffer;
+    local_imageView = imageView;
+    local_imageLayout = imageLayout;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkImageLayout);
+    }
+    uint32_t packetSize_vkCmdBindInvocationMaskHUAWEI = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdBindInvocationMaskHUAWEI);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdBindInvocationMaskHUAWEI -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdBindInvocationMaskHUAWEI);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdBindInvocationMaskHUAWEI = OP_vkCmdBindInvocationMaskHUAWEI;
+    memcpy(streamPtr, &opcode_vkCmdBindInvocationMaskHUAWEI, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdBindInvocationMaskHUAWEI, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImageView((*&local_imageView));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout));
+    *streamPtrPtr += sizeof(VkImageLayout);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdBindInvocationMaskHUAWEI), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_NV_external_memory_rdma
+VkResult VkEncoder::vkGetMemoryRemoteAddressNV(
+    VkDevice device, const VkMemoryGetRemoteAddressInfoNV* pMemoryGetRemoteAddressInfo,
+    VkRemoteAddressNV* pAddress, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetMemoryRemoteAddressNV in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetMemoryRemoteAddressNV(device:%p, pMemoryGetRemoteAddressInfo:%p, pAddress:%p)",
+        device, pMemoryGetRemoteAddressInfo, pAddress);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkMemoryGetRemoteAddressInfoNV* local_pMemoryGetRemoteAddressInfo;
+    local_device = device;
+    local_pMemoryGetRemoteAddressInfo = nullptr;
+    if (pMemoryGetRemoteAddressInfo) {
+        local_pMemoryGetRemoteAddressInfo = (VkMemoryGetRemoteAddressInfoNV*)pool->alloc(
+            sizeof(const VkMemoryGetRemoteAddressInfoNV));
+        deepcopy_VkMemoryGetRemoteAddressInfoNV(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pMemoryGetRemoteAddressInfo,
+            (VkMemoryGetRemoteAddressInfoNV*)(local_pMemoryGetRemoteAddressInfo));
+    }
+    if (local_pMemoryGetRemoteAddressInfo) {
+        transform_tohost_VkMemoryGetRemoteAddressInfoNV(
+            sResourceTracker, (VkMemoryGetRemoteAddressInfoNV*)(local_pMemoryGetRemoteAddressInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkMemoryGetRemoteAddressInfoNV(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkMemoryGetRemoteAddressInfoNV*)(local_pMemoryGetRemoteAddressInfo), countPtr);
+        *countPtr += sizeof(VkRemoteAddressNV);
+    }
+    uint32_t packetSize_vkGetMemoryRemoteAddressNV =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetMemoryRemoteAddressNV);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetMemoryRemoteAddressNV);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetMemoryRemoteAddressNV = OP_vkGetMemoryRemoteAddressNV;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetMemoryRemoteAddressNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetMemoryRemoteAddressNV, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkMemoryGetRemoteAddressInfoNV(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkMemoryGetRemoteAddressInfoNV*)(local_pMemoryGetRemoteAddressInfo), streamPtrPtr);
+    memcpy(*streamPtrPtr, (VkRemoteAddressNV*)pAddress, sizeof(VkRemoteAddressNV));
+    *streamPtrPtr += sizeof(VkRemoteAddressNV);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetMemoryRemoteAddressNV), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((VkRemoteAddressNV*)pAddress, sizeof(VkRemoteAddressNV));
+    VkResult vkGetMemoryRemoteAddressNV_VkResult_return = (VkResult)0;
+    stream->read(&vkGetMemoryRemoteAddressNV_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetMemoryRemoteAddressNV_VkResult_return;
+}
+
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+void VkEncoder::vkCmdSetPatchControlPointsEXT(VkCommandBuffer commandBuffer,
+                                              uint32_t patchControlPoints, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetPatchControlPointsEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdSetPatchControlPointsEXT(commandBuffer:%p, patchControlPoints:%d)",
+                      commandBuffer, patchControlPoints);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_patchControlPoints;
+    local_commandBuffer = commandBuffer;
+    local_patchControlPoints = patchControlPoints;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdSetPatchControlPointsEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdSetPatchControlPointsEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetPatchControlPointsEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetPatchControlPointsEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetPatchControlPointsEXT = OP_vkCmdSetPatchControlPointsEXT;
+    memcpy(streamPtr, &opcode_vkCmdSetPatchControlPointsEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetPatchControlPointsEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_patchControlPoints, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetPatchControlPointsEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdSetRasterizerDiscardEnableEXT(VkCommandBuffer commandBuffer,
+                                                   VkBool32 rasterizerDiscardEnable,
+                                                   uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetRasterizerDiscardEnableEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdSetRasterizerDiscardEnableEXT(commandBuffer:%p, rasterizerDiscardEnable:%d)",
+        commandBuffer, rasterizerDiscardEnable);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkBool32 local_rasterizerDiscardEnable;
+    local_commandBuffer = commandBuffer;
+    local_rasterizerDiscardEnable = rasterizerDiscardEnable;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkBool32);
+    }
+    uint32_t packetSize_vkCmdSetRasterizerDiscardEnableEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdSetRasterizerDiscardEnableEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetRasterizerDiscardEnableEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetRasterizerDiscardEnableEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetRasterizerDiscardEnableEXT = OP_vkCmdSetRasterizerDiscardEnableEXT;
+    memcpy(streamPtr, &opcode_vkCmdSetRasterizerDiscardEnableEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetRasterizerDiscardEnableEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkBool32*)&local_rasterizerDiscardEnable, sizeof(VkBool32));
+    *streamPtrPtr += sizeof(VkBool32);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetRasterizerDiscardEnableEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdSetDepthBiasEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthBiasEnable,
+                                           uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetDepthBiasEnableEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdSetDepthBiasEnableEXT(commandBuffer:%p, depthBiasEnable:%d)",
+                      commandBuffer, depthBiasEnable);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkBool32 local_depthBiasEnable;
+    local_commandBuffer = commandBuffer;
+    local_depthBiasEnable = depthBiasEnable;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkBool32);
+    }
+    uint32_t packetSize_vkCmdSetDepthBiasEnableEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetDepthBiasEnableEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetDepthBiasEnableEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetDepthBiasEnableEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetDepthBiasEnableEXT = OP_vkCmdSetDepthBiasEnableEXT;
+    memcpy(streamPtr, &opcode_vkCmdSetDepthBiasEnableEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetDepthBiasEnableEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkBool32*)&local_depthBiasEnable, sizeof(VkBool32));
+    *streamPtrPtr += sizeof(VkBool32);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetDepthBiasEnableEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdSetLogicOpEXT(VkCommandBuffer commandBuffer, VkLogicOp logicOp,
+                                   uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetLogicOpEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdSetLogicOpEXT(commandBuffer:%p)", commandBuffer);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkLogicOp local_logicOp;
+    local_commandBuffer = commandBuffer;
+    local_logicOp = logicOp;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkLogicOp);
+    }
+    uint32_t packetSize_vkCmdSetLogicOpEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetLogicOpEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetLogicOpEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetLogicOpEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetLogicOpEXT = OP_vkCmdSetLogicOpEXT;
+    memcpy(streamPtr, &opcode_vkCmdSetLogicOpEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetLogicOpEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkLogicOp*)&local_logicOp, sizeof(VkLogicOp));
+    *streamPtrPtr += sizeof(VkLogicOp);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetLogicOpEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdSetPrimitiveRestartEnableEXT(VkCommandBuffer commandBuffer,
+                                                  VkBool32 primitiveRestartEnable,
+                                                  uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetPrimitiveRestartEnableEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdSetPrimitiveRestartEnableEXT(commandBuffer:%p, primitiveRestartEnable:%d)",
+        commandBuffer, primitiveRestartEnable);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkBool32 local_primitiveRestartEnable;
+    local_commandBuffer = commandBuffer;
+    local_primitiveRestartEnable = primitiveRestartEnable;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkBool32);
+    }
+    uint32_t packetSize_vkCmdSetPrimitiveRestartEnableEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdSetPrimitiveRestartEnableEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetPrimitiveRestartEnableEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetPrimitiveRestartEnableEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetPrimitiveRestartEnableEXT = OP_vkCmdSetPrimitiveRestartEnableEXT;
+    memcpy(streamPtr, &opcode_vkCmdSetPrimitiveRestartEnableEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetPrimitiveRestartEnableEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkBool32*)&local_primitiveRestartEnable, sizeof(VkBool32));
+    *streamPtrPtr += sizeof(VkBool32);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetPrimitiveRestartEnableEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_QNX_screen_surface
+VkResult VkEncoder::vkCreateScreenSurfaceQNX(VkInstance instance,
+                                             const VkScreenSurfaceCreateInfoQNX* pCreateInfo,
+                                             const VkAllocationCallbacks* pAllocator,
+                                             VkSurfaceKHR* pSurface, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateScreenSurfaceQNX in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateScreenSurfaceQNX(instance:%p, pCreateInfo:%p, pAllocator:%p, pSurface:%p)",
+        instance, pCreateInfo, pAllocator, pSurface);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkInstance local_instance;
+    VkScreenSurfaceCreateInfoQNX* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_instance = instance;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo =
+            (VkScreenSurfaceCreateInfoQNX*)pool->alloc(sizeof(const VkScreenSurfaceCreateInfoQNX));
+        deepcopy_VkScreenSurfaceCreateInfoQNX(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                              (VkScreenSurfaceCreateInfoQNX*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkScreenSurfaceCreateInfoQNX(
+            sResourceTracker, (VkScreenSurfaceCreateInfoQNX*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkScreenSurfaceCreateInfoQNX(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                           (VkScreenSurfaceCreateInfoQNX*)(local_pCreateInfo),
+                                           countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateScreenSurfaceQNX =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCreateScreenSurfaceQNX);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateScreenSurfaceQNX);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateScreenSurfaceQNX = OP_vkCreateScreenSurfaceQNX;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateScreenSurfaceQNX, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateScreenSurfaceQNX, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkInstance((*&local_instance));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkScreenSurfaceCreateInfoQNX(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                 (VkScreenSurfaceCreateInfoQNX*)(local_pCreateInfo),
+                                                 streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pSurface));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateScreenSurfaceQNX), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_3, (VkSurfaceKHR*)pSurface, 1);
+    VkResult vkCreateScreenSurfaceQNX_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateScreenSurfaceQNX_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateScreenSurfaceQNX_VkResult_return;
+}
+
+VkBool32 VkEncoder::vkGetPhysicalDeviceScreenPresentationSupportQNX(VkPhysicalDevice physicalDevice,
+                                                                    uint32_t queueFamilyIndex,
+                                                                    _screen_window* window,
+                                                                    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkGetPhysicalDeviceScreenPresentationSupportQNX in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetPhysicalDeviceScreenPresentationSupportQNX(physicalDevice:%p, queueFamilyIndex:%d, "
+        "window:%p)",
+        physicalDevice, queueFamilyIndex, window);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkPhysicalDevice local_physicalDevice;
+    uint32_t local_queueFamilyIndex;
+    local_physicalDevice = physicalDevice;
+    local_queueFamilyIndex = queueFamilyIndex;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(_screen_window);
+    }
+    uint32_t packetSize_vkGetPhysicalDeviceScreenPresentationSupportQNX =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetPhysicalDeviceScreenPresentationSupportQNX);
+    uint8_t* streamPtr =
+        stream->reserve(packetSize_vkGetPhysicalDeviceScreenPresentationSupportQNX);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetPhysicalDeviceScreenPresentationSupportQNX =
+        OP_vkGetPhysicalDeviceScreenPresentationSupportQNX;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetPhysicalDeviceScreenPresentationSupportQNX, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetPhysicalDeviceScreenPresentationSupportQNX,
+           sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPhysicalDevice((*&local_physicalDevice));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (_screen_window*)window, sizeof(_screen_window));
+    *streamPtrPtr += sizeof(_screen_window);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetPhysicalDeviceScreenPresentationSupportQNX),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((_screen_window*)window, sizeof(_screen_window));
+    VkBool32 vkGetPhysicalDeviceScreenPresentationSupportQNX_VkBool32_return = (VkBool32)0;
+    stream->read(&vkGetPhysicalDeviceScreenPresentationSupportQNX_VkBool32_return,
+                 sizeof(VkBool32));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetPhysicalDeviceScreenPresentationSupportQNX_VkBool32_return;
+}
+
+#endif
+#ifdef VK_EXT_color_write_enable
+void VkEncoder::vkCmdSetColorWriteEnableEXT(VkCommandBuffer commandBuffer, uint32_t attachmentCount,
+                                            const VkBool32* pColorWriteEnables, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetColorWriteEnableEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdSetColorWriteEnableEXT(commandBuffer:%p, attachmentCount:%d, pColorWriteEnables:%p)",
+        commandBuffer, attachmentCount, pColorWriteEnables);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_attachmentCount;
+    VkBool32* local_pColorWriteEnables;
+    local_commandBuffer = commandBuffer;
+    local_attachmentCount = attachmentCount;
+    // Avoiding deepcopy for pColorWriteEnables
+    local_pColorWriteEnables = (VkBool32*)pColorWriteEnables;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += ((attachmentCount)) * sizeof(VkBool32);
+    }
+    uint32_t packetSize_vkCmdSetColorWriteEnableEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdSetColorWriteEnableEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetColorWriteEnableEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetColorWriteEnableEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetColorWriteEnableEXT = OP_vkCmdSetColorWriteEnableEXT;
+    memcpy(streamPtr, &opcode_vkCmdSetColorWriteEnableEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetColorWriteEnableEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_attachmentCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (VkBool32*)local_pColorWriteEnables,
+           ((attachmentCount)) * sizeof(VkBool32));
+    *streamPtrPtr += ((attachmentCount)) * sizeof(VkBool32);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdSetColorWriteEnableEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_GOOGLE_gfxstream
+VkResult VkEncoder::vkMapMemoryIntoAddressSpaceGOOGLE(VkDevice device, VkDeviceMemory memory,
+                                                      uint64_t* pAddress, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkMapMemoryIntoAddressSpaceGOOGLE in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkMapMemoryIntoAddressSpaceGOOGLE(device:%p, memory:%p, pAddress:%p)",
+                      device, memory, pAddress);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    sResourceTracker->on_vkMapMemoryIntoAddressSpaceGOOGLE_pre(this, VK_SUCCESS, device, memory,
+                                                               pAddress);
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDeviceMemory local_memory;
+    local_device = device;
+    local_memory = memory;
+    sResourceTracker->deviceMemoryTransform_tohost(
+        (VkDeviceMemory*)&local_memory, 1, (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr, 0,
+        (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0);
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pAddress) {
+            *countPtr += sizeof(uint64_t);
+        }
+    }
+    uint32_t packetSize_vkMapMemoryIntoAddressSpaceGOOGLE =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkMapMemoryIntoAddressSpaceGOOGLE);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkMapMemoryIntoAddressSpaceGOOGLE);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkMapMemoryIntoAddressSpaceGOOGLE = OP_vkMapMemoryIntoAddressSpaceGOOGLE;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkMapMemoryIntoAddressSpaceGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkMapMemoryIntoAddressSpaceGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDeviceMemory((*&local_memory));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pAddress;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pAddress) {
+        memcpy(*streamPtrPtr, (uint64_t*)pAddress, sizeof(uint64_t));
+        *streamPtrPtr += sizeof(uint64_t);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkMapMemoryIntoAddressSpaceGOOGLE), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint64_t* check_pAddress;
+    check_pAddress = (uint64_t*)(uintptr_t)stream->getBe64();
+    if (pAddress) {
+        if (!(check_pAddress)) {
+            fprintf(stderr, "fatal: pAddress inconsistent between guest and host\n");
+        }
+        stream->read((uint64_t*)pAddress, sizeof(uint64_t));
+    }
+    VkResult vkMapMemoryIntoAddressSpaceGOOGLE_VkResult_return = (VkResult)0;
+    stream->read(&vkMapMemoryIntoAddressSpaceGOOGLE_VkResult_return, sizeof(VkResult));
+    sResourceTracker->on_vkMapMemoryIntoAddressSpaceGOOGLE(
+        this, vkMapMemoryIntoAddressSpaceGOOGLE_VkResult_return, device, memory, pAddress);
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkMapMemoryIntoAddressSpaceGOOGLE_VkResult_return;
+}
+
+void VkEncoder::vkUpdateDescriptorSetWithTemplateSizedGOOGLE(
+    VkDevice device, VkDescriptorSet descriptorSet,
+    VkDescriptorUpdateTemplate descriptorUpdateTemplate, uint32_t imageInfoCount,
+    uint32_t bufferInfoCount, uint32_t bufferViewCount, const uint32_t* pImageInfoEntryIndices,
+    const uint32_t* pBufferInfoEntryIndices, const uint32_t* pBufferViewEntryIndices,
+    const VkDescriptorImageInfo* pImageInfos, const VkDescriptorBufferInfo* pBufferInfos,
+    const VkBufferView* pBufferViews, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkUpdateDescriptorSetWithTemplateSizedGOOGLE in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkUpdateDescriptorSetWithTemplateSizedGOOGLE(device:%p, descriptorSet:%p, "
+        "descriptorUpdateTemplate:%p, imageInfoCount:%d, bufferInfoCount:%d, bufferViewCount:%d, "
+        "pImageInfoEntryIndices:%p, pBufferInfoEntryIndices:%p, pBufferViewEntryIndices:%p, "
+        "pImageInfos:%p, pBufferInfos:%p, pBufferViews:%p)",
+        device, descriptorSet, descriptorUpdateTemplate, imageInfoCount, bufferInfoCount,
+        bufferViewCount, pImageInfoEntryIndices, pBufferInfoEntryIndices, pBufferViewEntryIndices,
+        pImageInfos, pBufferInfos, pBufferViews);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDescriptorSet local_descriptorSet;
+    VkDescriptorUpdateTemplate local_descriptorUpdateTemplate;
+    uint32_t local_imageInfoCount;
+    uint32_t local_bufferInfoCount;
+    uint32_t local_bufferViewCount;
+    uint32_t* local_pImageInfoEntryIndices;
+    uint32_t* local_pBufferInfoEntryIndices;
+    uint32_t* local_pBufferViewEntryIndices;
+    VkDescriptorImageInfo* local_pImageInfos;
+    VkDescriptorBufferInfo* local_pBufferInfos;
+    VkBufferView* local_pBufferViews;
+    local_device = device;
+    local_descriptorSet = descriptorSet;
+    local_descriptorUpdateTemplate = descriptorUpdateTemplate;
+    local_imageInfoCount = imageInfoCount;
+    local_bufferInfoCount = bufferInfoCount;
+    local_bufferViewCount = bufferViewCount;
+    // Avoiding deepcopy for pImageInfoEntryIndices
+    local_pImageInfoEntryIndices = (uint32_t*)pImageInfoEntryIndices;
+    // Avoiding deepcopy for pBufferInfoEntryIndices
+    local_pBufferInfoEntryIndices = (uint32_t*)pBufferInfoEntryIndices;
+    // Avoiding deepcopy for pBufferViewEntryIndices
+    local_pBufferViewEntryIndices = (uint32_t*)pBufferViewEntryIndices;
+    local_pImageInfos = nullptr;
+    if (pImageInfos) {
+        local_pImageInfos = (VkDescriptorImageInfo*)pool->alloc(
+            ((imageInfoCount)) * sizeof(const VkDescriptorImageInfo));
+        for (uint32_t i = 0; i < (uint32_t)((imageInfoCount)); ++i) {
+            deepcopy_VkDescriptorImageInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pImageInfos + i,
+                                           (VkDescriptorImageInfo*)(local_pImageInfos + i));
+        }
+    }
+    local_pBufferInfos = nullptr;
+    if (pBufferInfos) {
+        local_pBufferInfos = (VkDescriptorBufferInfo*)pool->alloc(
+            ((bufferInfoCount)) * sizeof(const VkDescriptorBufferInfo));
+        for (uint32_t i = 0; i < (uint32_t)((bufferInfoCount)); ++i) {
+            deepcopy_VkDescriptorBufferInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pBufferInfos + i,
+                                            (VkDescriptorBufferInfo*)(local_pBufferInfos + i));
+        }
+    }
+    // Avoiding deepcopy for pBufferViews
+    local_pBufferViews = (VkBufferView*)pBufferViews;
+    if (local_pImageInfos) {
+        for (uint32_t i = 0; i < (uint32_t)((imageInfoCount)); ++i) {
+            transform_tohost_VkDescriptorImageInfo(sResourceTracker,
+                                                   (VkDescriptorImageInfo*)(local_pImageInfos + i));
+        }
+    }
+    if (local_pBufferInfos) {
+        for (uint32_t i = 0; i < (uint32_t)((bufferInfoCount)); ++i) {
+            transform_tohost_VkDescriptorBufferInfo(
+                sResourceTracker, (VkDescriptorBufferInfo*)(local_pBufferInfos + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_2;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pImageInfoEntryIndices) {
+            *countPtr += ((imageInfoCount)) * sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pBufferInfoEntryIndices) {
+            *countPtr += ((bufferInfoCount)) * sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pBufferViewEntryIndices) {
+            *countPtr += ((bufferViewCount)) * sizeof(uint32_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pImageInfos) {
+            for (uint32_t i = 0; i < (uint32_t)((imageInfoCount)); ++i) {
+                count_VkDescriptorImageInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                            (VkDescriptorImageInfo*)(local_pImageInfos + i),
+                                            countPtr);
+            }
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pBufferInfos) {
+            for (uint32_t i = 0; i < (uint32_t)((bufferInfoCount)); ++i) {
+                count_VkDescriptorBufferInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                             (VkDescriptorBufferInfo*)(local_pBufferInfos + i),
+                                             countPtr);
+            }
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pBufferViews) {
+            if (((bufferViewCount))) {
+                *countPtr += ((bufferViewCount)) * 8;
+            }
+        }
+    }
+    uint32_t packetSize_vkUpdateDescriptorSetWithTemplateSizedGOOGLE =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkUpdateDescriptorSetWithTemplateSizedGOOGLE);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkUpdateDescriptorSetWithTemplateSizedGOOGLE);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkUpdateDescriptorSetWithTemplateSizedGOOGLE =
+        OP_vkUpdateDescriptorSetWithTemplateSizedGOOGLE;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkUpdateDescriptorSetWithTemplateSizedGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkUpdateDescriptorSetWithTemplateSizedGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDescriptorSet((*&local_descriptorSet));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = get_host_u64_VkDescriptorUpdateTemplate((*&local_descriptorUpdateTemplate));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_imageInfoCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_bufferInfoCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_bufferViewCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_3 = (uint64_t)(uintptr_t)local_pImageInfoEntryIndices;
+    memcpy((*streamPtrPtr), &cgen_var_3, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pImageInfoEntryIndices) {
+        memcpy(*streamPtrPtr, (uint32_t*)local_pImageInfoEntryIndices,
+               ((imageInfoCount)) * sizeof(uint32_t));
+        *streamPtrPtr += ((imageInfoCount)) * sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_4 = (uint64_t)(uintptr_t)local_pBufferInfoEntryIndices;
+    memcpy((*streamPtrPtr), &cgen_var_4, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pBufferInfoEntryIndices) {
+        memcpy(*streamPtrPtr, (uint32_t*)local_pBufferInfoEntryIndices,
+               ((bufferInfoCount)) * sizeof(uint32_t));
+        *streamPtrPtr += ((bufferInfoCount)) * sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_5 = (uint64_t)(uintptr_t)local_pBufferViewEntryIndices;
+    memcpy((*streamPtrPtr), &cgen_var_5, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pBufferViewEntryIndices) {
+        memcpy(*streamPtrPtr, (uint32_t*)local_pBufferViewEntryIndices,
+               ((bufferViewCount)) * sizeof(uint32_t));
+        *streamPtrPtr += ((bufferViewCount)) * sizeof(uint32_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_6 = (uint64_t)(uintptr_t)local_pImageInfos;
+    memcpy((*streamPtrPtr), &cgen_var_6, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pImageInfos) {
+        for (uint32_t i = 0; i < (uint32_t)((imageInfoCount)); ++i) {
+            reservedmarshal_VkDescriptorImageInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                  (VkDescriptorImageInfo*)(local_pImageInfos + i),
+                                                  streamPtrPtr);
+        }
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_7 = (uint64_t)(uintptr_t)local_pBufferInfos;
+    memcpy((*streamPtrPtr), &cgen_var_7, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pBufferInfos) {
+        for (uint32_t i = 0; i < (uint32_t)((bufferInfoCount)); ++i) {
+            reservedmarshal_VkDescriptorBufferInfo(
+                stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkDescriptorBufferInfo*)(local_pBufferInfos + i), streamPtrPtr);
+        }
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_8 = (uint64_t)(uintptr_t)local_pBufferViews;
+    memcpy((*streamPtrPtr), &cgen_var_8, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pBufferViews) {
+        if (((bufferViewCount))) {
+            uint8_t* cgen_var_8_0_ptr = (uint8_t*)(*streamPtrPtr);
+            for (uint32_t k = 0; k < ((bufferViewCount)); ++k) {
+                uint64_t tmpval = get_host_u64_VkBufferView(local_pBufferViews[k]);
+                memcpy(cgen_var_8_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+            }
+            *streamPtrPtr += 8 * ((bufferViewCount));
+        }
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkUpdateDescriptorSetWithTemplateSizedGOOGLE),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkBeginCommandBufferAsyncGOOGLE(VkCommandBuffer commandBuffer,
+                                                const VkCommandBufferBeginInfo* pBeginInfo,
+                                                uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkBeginCommandBufferAsyncGOOGLE in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkBeginCommandBufferAsyncGOOGLE(commandBuffer:%p, pBeginInfo:%p)",
+                      commandBuffer, pBeginInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkCommandBufferBeginInfo* local_pBeginInfo;
+    local_commandBuffer = commandBuffer;
+    local_pBeginInfo = nullptr;
+    if (pBeginInfo) {
+        local_pBeginInfo =
+            (VkCommandBufferBeginInfo*)pool->alloc(sizeof(const VkCommandBufferBeginInfo));
+        deepcopy_VkCommandBufferBeginInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pBeginInfo,
+                                          (VkCommandBufferBeginInfo*)(local_pBeginInfo));
+    }
+    if (local_pBeginInfo) {
+        transform_tohost_VkCommandBufferBeginInfo(sResourceTracker,
+                                                  (VkCommandBufferBeginInfo*)(local_pBeginInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkCommandBufferBeginInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkCommandBufferBeginInfo*)(local_pBeginInfo), countPtr);
+    }
+    uint32_t packetSize_vkBeginCommandBufferAsyncGOOGLE = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkBeginCommandBufferAsyncGOOGLE);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkBeginCommandBufferAsyncGOOGLE -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkBeginCommandBufferAsyncGOOGLE);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkBeginCommandBufferAsyncGOOGLE = OP_vkBeginCommandBufferAsyncGOOGLE;
+    memcpy(streamPtr, &opcode_vkBeginCommandBufferAsyncGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkBeginCommandBufferAsyncGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkCommandBufferBeginInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                             (VkCommandBufferBeginInfo*)(local_pBeginInfo),
+                                             streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkBeginCommandBufferAsyncGOOGLE), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkEndCommandBufferAsyncGOOGLE(VkCommandBuffer commandBuffer, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkEndCommandBufferAsyncGOOGLE in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkEndCommandBufferAsyncGOOGLE(commandBuffer:%p)", commandBuffer);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    local_commandBuffer = commandBuffer;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkEndCommandBufferAsyncGOOGLE = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkEndCommandBufferAsyncGOOGLE);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkEndCommandBufferAsyncGOOGLE -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkEndCommandBufferAsyncGOOGLE);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkEndCommandBufferAsyncGOOGLE = OP_vkEndCommandBufferAsyncGOOGLE;
+    memcpy(streamPtr, &opcode_vkEndCommandBufferAsyncGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkEndCommandBufferAsyncGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkEndCommandBufferAsyncGOOGLE), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkResetCommandBufferAsyncGOOGLE(VkCommandBuffer commandBuffer,
+                                                VkCommandBufferResetFlags flags, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkResetCommandBufferAsyncGOOGLE in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkResetCommandBufferAsyncGOOGLE(commandBuffer:%p, flags:%d)", commandBuffer,
+                      flags);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkCommandBufferResetFlags local_flags;
+    local_commandBuffer = commandBuffer;
+    local_flags = flags;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkCommandBufferResetFlags);
+    }
+    uint32_t packetSize_vkResetCommandBufferAsyncGOOGLE = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkResetCommandBufferAsyncGOOGLE);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkResetCommandBufferAsyncGOOGLE -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkResetCommandBufferAsyncGOOGLE);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkResetCommandBufferAsyncGOOGLE = OP_vkResetCommandBufferAsyncGOOGLE;
+    memcpy(streamPtr, &opcode_vkResetCommandBufferAsyncGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkResetCommandBufferAsyncGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (VkCommandBufferResetFlags*)&local_flags,
+           sizeof(VkCommandBufferResetFlags));
+    *streamPtrPtr += sizeof(VkCommandBufferResetFlags);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkResetCommandBufferAsyncGOOGLE), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCommandBufferHostSyncGOOGLE(VkCommandBuffer commandBuffer, uint32_t needHostSync,
+                                              uint32_t sequenceNumber, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCommandBufferHostSyncGOOGLE in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCommandBufferHostSyncGOOGLE(commandBuffer:%p, needHostSync:%d, sequenceNumber:%d)",
+        commandBuffer, needHostSync, sequenceNumber);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_needHostSync;
+    uint32_t local_sequenceNumber;
+    local_commandBuffer = commandBuffer;
+    local_needHostSync = needHostSync;
+    local_sequenceNumber = sequenceNumber;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCommandBufferHostSyncGOOGLE = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCommandBufferHostSyncGOOGLE);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCommandBufferHostSyncGOOGLE -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCommandBufferHostSyncGOOGLE);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCommandBufferHostSyncGOOGLE = OP_vkCommandBufferHostSyncGOOGLE;
+    memcpy(streamPtr, &opcode_vkCommandBufferHostSyncGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCommandBufferHostSyncGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_needHostSync, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_sequenceNumber, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCommandBufferHostSyncGOOGLE), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkCreateImageWithRequirementsGOOGLE(
+    VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator,
+    VkImage* pImage, VkMemoryRequirements* pMemoryRequirements, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateImageWithRequirementsGOOGLE in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkImageCreateInfo* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkImageCreateInfo*)pool->alloc(sizeof(const VkImageCreateInfo));
+        deepcopy_VkImageCreateInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                   (VkImageCreateInfo*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    sResourceTracker->unwrap_VkNativeBufferANDROID(pCreateInfo, local_pCreateInfo);
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        sResourceTracker->transformImpl_VkImageCreateInfo_tohost(local_pCreateInfo, 1);
+        transform_tohost_VkImageCreateInfo(sResourceTracker,
+                                           (VkImageCreateInfo*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkImageCreateInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                (VkImageCreateInfo*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+        count_VkMemoryRequirements(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                   (VkMemoryRequirements*)(pMemoryRequirements), countPtr);
+    }
+    uint32_t packetSize_vkCreateImageWithRequirementsGOOGLE =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCreateImageWithRequirementsGOOGLE);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateImageWithRequirementsGOOGLE);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateImageWithRequirementsGOOGLE = OP_vkCreateImageWithRequirementsGOOGLE;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateImageWithRequirementsGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateImageWithRequirementsGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkImageCreateInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                      (VkImageCreateInfo*)(local_pCreateInfo), streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pImage));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    reservedmarshal_VkMemoryRequirements(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkMemoryRequirements*)(pMemoryRequirements),
+                                         streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCreateImageWithRequirementsGOOGLE),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_3, (VkImage*)pImage, 1);
+    stream->unsetHandleMapping();
+    unmarshal_VkMemoryRequirements(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                   (VkMemoryRequirements*)(pMemoryRequirements));
+    if (pMemoryRequirements) {
+        transform_fromhost_VkMemoryRequirements(sResourceTracker,
+                                                (VkMemoryRequirements*)(pMemoryRequirements));
+    }
+    VkResult vkCreateImageWithRequirementsGOOGLE_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateImageWithRequirementsGOOGLE_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateImageWithRequirementsGOOGLE_VkResult_return;
+}
+
+VkResult VkEncoder::vkCreateBufferWithRequirementsGOOGLE(
+    VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator,
+    VkBuffer* pBuffer, VkMemoryRequirements* pMemoryRequirements, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateBufferWithRequirementsGOOGLE in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateBufferWithRequirementsGOOGLE(device:%p, pCreateInfo:%p, pAllocator:%p, "
+        "pBuffer:%p, pMemoryRequirements:%p)",
+        device, pCreateInfo, pAllocator, pBuffer, pMemoryRequirements);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkBufferCreateInfo* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkBufferCreateInfo*)pool->alloc(sizeof(const VkBufferCreateInfo));
+        deepcopy_VkBufferCreateInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                    (VkBufferCreateInfo*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkBufferCreateInfo(sResourceTracker,
+                                            (VkBufferCreateInfo*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkBufferCreateInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                 (VkBufferCreateInfo*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+        count_VkMemoryRequirements(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                   (VkMemoryRequirements*)(pMemoryRequirements), countPtr);
+    }
+    uint32_t packetSize_vkCreateBufferWithRequirementsGOOGLE =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCreateBufferWithRequirementsGOOGLE);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateBufferWithRequirementsGOOGLE);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateBufferWithRequirementsGOOGLE = OP_vkCreateBufferWithRequirementsGOOGLE;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateBufferWithRequirementsGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateBufferWithRequirementsGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkBufferCreateInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkBufferCreateInfo*)(local_pCreateInfo), streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pBuffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    reservedmarshal_VkMemoryRequirements(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkMemoryRequirements*)(pMemoryRequirements),
+                                         streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCreateBufferWithRequirementsGOOGLE),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_3, (VkBuffer*)pBuffer, 1);
+    stream->unsetHandleMapping();
+    unmarshal_VkMemoryRequirements(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                   (VkMemoryRequirements*)(pMemoryRequirements));
+    if (pMemoryRequirements) {
+        transform_fromhost_VkMemoryRequirements(sResourceTracker,
+                                                (VkMemoryRequirements*)(pMemoryRequirements));
+    }
+    VkResult vkCreateBufferWithRequirementsGOOGLE_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateBufferWithRequirementsGOOGLE_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateBufferWithRequirementsGOOGLE_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetMemoryHostAddressInfoGOOGLE(VkDevice device, VkDeviceMemory memory,
+                                                     uint64_t* pAddress, uint64_t* pSize,
+                                                     uint64_t* pHostmemId, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetMemoryHostAddressInfoGOOGLE in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetMemoryHostAddressInfoGOOGLE(device:%p, memory:%p, pAddress:%p, pSize:%p, "
+        "pHostmemId:%p)",
+        device, memory, pAddress, pSize, pHostmemId);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDeviceMemory local_memory;
+    local_device = device;
+    local_memory = memory;
+    sResourceTracker->deviceMemoryTransform_tohost(
+        (VkDeviceMemory*)&local_memory, 1, (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr, 0,
+        (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0);
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pAddress) {
+            *countPtr += sizeof(uint64_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pSize) {
+            *countPtr += sizeof(uint64_t);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pHostmemId) {
+            *countPtr += sizeof(uint64_t);
+        }
+    }
+    uint32_t packetSize_vkGetMemoryHostAddressInfoGOOGLE =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetMemoryHostAddressInfoGOOGLE);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetMemoryHostAddressInfoGOOGLE);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetMemoryHostAddressInfoGOOGLE = OP_vkGetMemoryHostAddressInfoGOOGLE;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetMemoryHostAddressInfoGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetMemoryHostAddressInfoGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDeviceMemory((*&local_memory));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pAddress;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pAddress) {
+        memcpy(*streamPtrPtr, (uint64_t*)pAddress, sizeof(uint64_t));
+        *streamPtrPtr += sizeof(uint64_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_3 = (uint64_t)(uintptr_t)pSize;
+    memcpy((*streamPtrPtr), &cgen_var_3, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pSize) {
+        memcpy(*streamPtrPtr, (uint64_t*)pSize, sizeof(uint64_t));
+        *streamPtrPtr += sizeof(uint64_t);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_4 = (uint64_t)(uintptr_t)pHostmemId;
+    memcpy((*streamPtrPtr), &cgen_var_4, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pHostmemId) {
+        memcpy(*streamPtrPtr, (uint64_t*)pHostmemId, sizeof(uint64_t));
+        *streamPtrPtr += sizeof(uint64_t);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetMemoryHostAddressInfoGOOGLE), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    // WARNING PTR CHECK
+    uint64_t* check_pAddress;
+    check_pAddress = (uint64_t*)(uintptr_t)stream->getBe64();
+    if (pAddress) {
+        if (!(check_pAddress)) {
+            fprintf(stderr, "fatal: pAddress inconsistent between guest and host\n");
+        }
+        stream->read((uint64_t*)pAddress, sizeof(uint64_t));
+    }
+    // WARNING PTR CHECK
+    uint64_t* check_pSize;
+    check_pSize = (uint64_t*)(uintptr_t)stream->getBe64();
+    if (pSize) {
+        if (!(check_pSize)) {
+            fprintf(stderr, "fatal: pSize inconsistent between guest and host\n");
+        }
+        stream->read((uint64_t*)pSize, sizeof(uint64_t));
+    }
+    // WARNING PTR CHECK
+    uint64_t* check_pHostmemId;
+    check_pHostmemId = (uint64_t*)(uintptr_t)stream->getBe64();
+    if (pHostmemId) {
+        if (!(check_pHostmemId)) {
+            fprintf(stderr, "fatal: pHostmemId inconsistent between guest and host\n");
+        }
+        stream->read((uint64_t*)pHostmemId, sizeof(uint64_t));
+    }
+    VkResult vkGetMemoryHostAddressInfoGOOGLE_VkResult_return = (VkResult)0;
+    stream->read(&vkGetMemoryHostAddressInfoGOOGLE_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetMemoryHostAddressInfoGOOGLE_VkResult_return;
+}
+
+VkResult VkEncoder::vkFreeMemorySyncGOOGLE(VkDevice device, VkDeviceMemory memory,
+                                           const VkAllocationCallbacks* pAllocator,
+                                           uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkFreeMemorySyncGOOGLE in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkFreeMemorySyncGOOGLE(device:%p, memory:%p, pAllocator:%p)", device, memory,
+                      pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDeviceMemory local_memory;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_memory = memory;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    sResourceTracker->deviceMemoryTransform_tohost(
+        (VkDeviceMemory*)&local_memory, 1, (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr, 0,
+        (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0);
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkFreeMemorySyncGOOGLE =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkFreeMemorySyncGOOGLE);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkFreeMemorySyncGOOGLE);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkFreeMemorySyncGOOGLE = OP_vkFreeMemorySyncGOOGLE;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkFreeMemorySyncGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkFreeMemorySyncGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDeviceMemory((*&local_memory));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkFreeMemorySyncGOOGLE), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkFreeMemorySyncGOOGLE_VkResult_return = (VkResult)0;
+    stream->read(&vkFreeMemorySyncGOOGLE_VkResult_return, sizeof(VkResult));
+    sResourceTracker->destroyMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)&memory);
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkFreeMemorySyncGOOGLE_VkResult_return;
+}
+
+void VkEncoder::vkQueueHostSyncGOOGLE(VkQueue queue, uint32_t needHostSync, uint32_t sequenceNumber,
+                                      uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkQueueHostSyncGOOGLE in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkQueueHostSyncGOOGLE(queue:%p, needHostSync:%d, sequenceNumber:%d)", queue,
+                      needHostSync, sequenceNumber);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkQueue local_queue;
+    uint32_t local_needHostSync;
+    uint32_t local_sequenceNumber;
+    local_queue = queue;
+    local_needHostSync = needHostSync;
+    local_sequenceNumber = sequenceNumber;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkQueueHostSyncGOOGLE =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkQueueHostSyncGOOGLE);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkQueueHostSyncGOOGLE);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkQueueHostSyncGOOGLE = OP_vkQueueHostSyncGOOGLE;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkQueueHostSyncGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkQueueHostSyncGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkQueue((*&local_queue));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_needHostSync, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_sequenceNumber, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkQueueHostSyncGOOGLE), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkQueueSubmitAsyncGOOGLE(VkQueue queue, uint32_t submitCount,
+                                         const VkSubmitInfo* pSubmits, VkFence fence,
+                                         uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkQueueSubmitAsyncGOOGLE in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkQueueSubmitAsyncGOOGLE(queue:%p, submitCount:%d, pSubmits:%p, fence:%p)",
+                      queue, submitCount, pSubmits, fence);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkQueue local_queue;
+    uint32_t local_submitCount;
+    VkSubmitInfo* local_pSubmits;
+    VkFence local_fence;
+    local_queue = queue;
+    local_submitCount = submitCount;
+    local_pSubmits = nullptr;
+    if (pSubmits) {
+        local_pSubmits = (VkSubmitInfo*)pool->alloc(((submitCount)) * sizeof(const VkSubmitInfo));
+        for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) {
+            deepcopy_VkSubmitInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pSubmits + i,
+                                  (VkSubmitInfo*)(local_pSubmits + i));
+        }
+    }
+    local_fence = fence;
+    if (local_pSubmits) {
+        for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) {
+            transform_tohost_VkSubmitInfo(sResourceTracker, (VkSubmitInfo*)(local_pSubmits + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) {
+            count_VkSubmitInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                               (VkSubmitInfo*)(local_pSubmits + i), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkQueueSubmitAsyncGOOGLE =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkQueueSubmitAsyncGOOGLE);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkQueueSubmitAsyncGOOGLE);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkQueueSubmitAsyncGOOGLE = OP_vkQueueSubmitAsyncGOOGLE;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkQueueSubmitAsyncGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkQueueSubmitAsyncGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkQueue((*&local_queue));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_submitCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) {
+        reservedmarshal_VkSubmitInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                     (VkSubmitInfo*)(local_pSubmits + i), streamPtrPtr);
+    }
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkFence((*&local_fence));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkQueueSubmitAsyncGOOGLE), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkQueueWaitIdleAsyncGOOGLE(VkQueue queue, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkQueueWaitIdleAsyncGOOGLE in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkQueueWaitIdleAsyncGOOGLE(queue:%p)", queue);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkQueue local_queue;
+    local_queue = queue;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkQueueWaitIdleAsyncGOOGLE =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkQueueWaitIdleAsyncGOOGLE);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkQueueWaitIdleAsyncGOOGLE);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkQueueWaitIdleAsyncGOOGLE = OP_vkQueueWaitIdleAsyncGOOGLE;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkQueueWaitIdleAsyncGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkQueueWaitIdleAsyncGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkQueue((*&local_queue));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkQueueWaitIdleAsyncGOOGLE), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkQueueBindSparseAsyncGOOGLE(VkQueue queue, uint32_t bindInfoCount,
+                                             const VkBindSparseInfo* pBindInfo, VkFence fence,
+                                             uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkQueueBindSparseAsyncGOOGLE in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkQueueBindSparseAsyncGOOGLE(queue:%p, bindInfoCount:%d, pBindInfo:%p, fence:%p)", queue,
+        bindInfoCount, pBindInfo, fence);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkQueue local_queue;
+    uint32_t local_bindInfoCount;
+    VkBindSparseInfo* local_pBindInfo;
+    VkFence local_fence;
+    local_queue = queue;
+    local_bindInfoCount = bindInfoCount;
+    local_pBindInfo = nullptr;
+    if (pBindInfo) {
+        local_pBindInfo =
+            (VkBindSparseInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindSparseInfo));
+        for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) {
+            deepcopy_VkBindSparseInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pBindInfo + i,
+                                      (VkBindSparseInfo*)(local_pBindInfo + i));
+        }
+    }
+    local_fence = fence;
+    if (local_pBindInfo) {
+        for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) {
+            transform_tohost_VkBindSparseInfo(sResourceTracker,
+                                              (VkBindSparseInfo*)(local_pBindInfo + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) {
+            count_VkBindSparseInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                   (VkBindSparseInfo*)(local_pBindInfo + i), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkQueueBindSparseAsyncGOOGLE =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkQueueBindSparseAsyncGOOGLE);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkQueueBindSparseAsyncGOOGLE);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkQueueBindSparseAsyncGOOGLE = OP_vkQueueBindSparseAsyncGOOGLE;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkQueueBindSparseAsyncGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkQueueBindSparseAsyncGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkQueue((*&local_queue));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) {
+        reservedmarshal_VkBindSparseInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkBindSparseInfo*)(local_pBindInfo + i), streamPtrPtr);
+    }
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkFence((*&local_fence));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkQueueBindSparseAsyncGOOGLE), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetLinearImageLayoutGOOGLE(VkDevice device, VkFormat format,
+                                             VkDeviceSize* pOffset,
+                                             VkDeviceSize* pRowPitchAlignment, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetLinearImageLayoutGOOGLE in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetLinearImageLayoutGOOGLE(device:%p, format:%d, pOffset:%p, pRowPitchAlignment:%p)",
+        device, format, pOffset, pRowPitchAlignment);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkFormat local_format;
+    local_device = device;
+    local_format = format;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkFormat);
+        *countPtr += sizeof(VkDeviceSize);
+        *countPtr += sizeof(VkDeviceSize);
+    }
+    uint32_t packetSize_vkGetLinearImageLayoutGOOGLE =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetLinearImageLayoutGOOGLE);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetLinearImageLayoutGOOGLE);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetLinearImageLayoutGOOGLE = OP_vkGetLinearImageLayoutGOOGLE;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetLinearImageLayoutGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetLinearImageLayoutGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkFormat*)&local_format, sizeof(VkFormat));
+    *streamPtrPtr += sizeof(VkFormat);
+    memcpy(*streamPtrPtr, (VkDeviceSize*)pOffset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    memcpy(*streamPtrPtr, (VkDeviceSize*)pRowPitchAlignment, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetLinearImageLayoutGOOGLE), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((VkDeviceSize*)pOffset, sizeof(VkDeviceSize));
+    stream->read((VkDeviceSize*)pRowPitchAlignment, sizeof(VkDeviceSize));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetLinearImageLayout2GOOGLE(VkDevice device, const VkImageCreateInfo* pCreateInfo,
+                                              VkDeviceSize* pOffset,
+                                              VkDeviceSize* pRowPitchAlignment, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetLinearImageLayout2GOOGLE in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetLinearImageLayout2GOOGLE(device:%p, pCreateInfo:%p, pOffset:%p, "
+        "pRowPitchAlignment:%p)",
+        device, pCreateInfo, pOffset, pRowPitchAlignment);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkImageCreateInfo* local_pCreateInfo;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkImageCreateInfo*)pool->alloc(sizeof(const VkImageCreateInfo));
+        deepcopy_VkImageCreateInfo(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+                                   (VkImageCreateInfo*)(local_pCreateInfo));
+    }
+    if (local_pCreateInfo) {
+        sResourceTracker->transformImpl_VkImageCreateInfo_tohost(local_pCreateInfo, 1);
+        transform_tohost_VkImageCreateInfo(sResourceTracker,
+                                           (VkImageCreateInfo*)(local_pCreateInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkImageCreateInfo(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                (VkImageCreateInfo*)(local_pCreateInfo), countPtr);
+        *countPtr += sizeof(VkDeviceSize);
+        *countPtr += sizeof(VkDeviceSize);
+    }
+    uint32_t packetSize_vkGetLinearImageLayout2GOOGLE =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetLinearImageLayout2GOOGLE);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetLinearImageLayout2GOOGLE);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetLinearImageLayout2GOOGLE = OP_vkGetLinearImageLayout2GOOGLE;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetLinearImageLayout2GOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetLinearImageLayout2GOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkImageCreateInfo(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                      (VkImageCreateInfo*)(local_pCreateInfo), streamPtrPtr);
+    memcpy(*streamPtrPtr, (VkDeviceSize*)pOffset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    memcpy(*streamPtrPtr, (VkDeviceSize*)pRowPitchAlignment, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetLinearImageLayout2GOOGLE), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((VkDeviceSize*)pOffset, sizeof(VkDeviceSize));
+    stream->read((VkDeviceSize*)pRowPitchAlignment, sizeof(VkDeviceSize));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkQueueFlushCommandsGOOGLE(VkQueue queue, VkCommandBuffer commandBuffer,
+                                           VkDeviceSize dataSize, const void* pData,
+                                           uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkQueueFlushCommandsGOOGLE in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+#include "vkQueueFlushCommandsGOOGLE_encode_impl.cpp.inl"
+}
+
+void VkEncoder::vkQueueCommitDescriptorSetUpdatesGOOGLE(
+    VkQueue queue, uint32_t descriptorPoolCount, const VkDescriptorPool* pDescriptorPools,
+    uint32_t descriptorSetCount, const VkDescriptorSetLayout* pSetLayouts,
+    const uint64_t* pDescriptorSetPoolIds, const uint32_t* pDescriptorSetWhichPool,
+    const uint32_t* pDescriptorSetPendingAllocation,
+    const uint32_t* pDescriptorWriteStartingIndices, uint32_t pendingDescriptorWriteCount,
+    const VkWriteDescriptorSet* pPendingDescriptorWrites, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkQueueCommitDescriptorSetUpdatesGOOGLE in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkQueueCommitDescriptorSetUpdatesGOOGLE(queue:%p, descriptorPoolCount:%d, "
+        "pDescriptorPools:%p, descriptorSetCount:%d, pSetLayouts:%p, pDescriptorSetPoolIds:%p, "
+        "pDescriptorSetWhichPool:%p, pDescriptorSetPendingAllocation:%p, "
+        "pDescriptorWriteStartingIndices:%p, pendingDescriptorWriteCount:%d, "
+        "pPendingDescriptorWrites:%p)",
+        queue, descriptorPoolCount, pDescriptorPools, descriptorSetCount, pSetLayouts,
+        pDescriptorSetPoolIds, pDescriptorSetWhichPool, pDescriptorSetPendingAllocation,
+        pDescriptorWriteStartingIndices, pendingDescriptorWriteCount, pPendingDescriptorWrites);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkQueue local_queue;
+    uint32_t local_descriptorPoolCount;
+    VkDescriptorPool* local_pDescriptorPools;
+    uint32_t local_descriptorSetCount;
+    VkDescriptorSetLayout* local_pSetLayouts;
+    uint64_t* local_pDescriptorSetPoolIds;
+    uint32_t* local_pDescriptorSetWhichPool;
+    uint32_t* local_pDescriptorSetPendingAllocation;
+    uint32_t* local_pDescriptorWriteStartingIndices;
+    uint32_t local_pendingDescriptorWriteCount;
+    VkWriteDescriptorSet* local_pPendingDescriptorWrites;
+    local_queue = queue;
+    local_descriptorPoolCount = descriptorPoolCount;
+    // Avoiding deepcopy for pDescriptorPools
+    local_pDescriptorPools = (VkDescriptorPool*)pDescriptorPools;
+    local_descriptorSetCount = descriptorSetCount;
+    // Avoiding deepcopy for pSetLayouts
+    local_pSetLayouts = (VkDescriptorSetLayout*)pSetLayouts;
+    // Avoiding deepcopy for pDescriptorSetPoolIds
+    local_pDescriptorSetPoolIds = (uint64_t*)pDescriptorSetPoolIds;
+    // Avoiding deepcopy for pDescriptorSetWhichPool
+    local_pDescriptorSetWhichPool = (uint32_t*)pDescriptorSetWhichPool;
+    // Avoiding deepcopy for pDescriptorSetPendingAllocation
+    local_pDescriptorSetPendingAllocation = (uint32_t*)pDescriptorSetPendingAllocation;
+    // Avoiding deepcopy for pDescriptorWriteStartingIndices
+    local_pDescriptorWriteStartingIndices = (uint32_t*)pDescriptorWriteStartingIndices;
+    local_pendingDescriptorWriteCount = pendingDescriptorWriteCount;
+    local_pPendingDescriptorWrites = nullptr;
+    if (pPendingDescriptorWrites) {
+        local_pPendingDescriptorWrites = (VkWriteDescriptorSet*)pool->alloc(
+            ((pendingDescriptorWriteCount)) * sizeof(const VkWriteDescriptorSet));
+        for (uint32_t i = 0; i < (uint32_t)((pendingDescriptorWriteCount)); ++i) {
+            deepcopy_VkWriteDescriptorSet(
+                pool, VK_STRUCTURE_TYPE_MAX_ENUM, pPendingDescriptorWrites + i,
+                (VkWriteDescriptorSet*)(local_pPendingDescriptorWrites + i));
+        }
+    }
+    if (local_pPendingDescriptorWrites) {
+        for (uint32_t i = 0; i < (uint32_t)((pendingDescriptorWriteCount)); ++i) {
+            transform_tohost_VkWriteDescriptorSet(
+                sResourceTracker, (VkWriteDescriptorSet*)(local_pPendingDescriptorWrites + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        if (((descriptorPoolCount))) {
+            *countPtr += ((descriptorPoolCount)) * 8;
+        }
+        *countPtr += sizeof(uint32_t);
+        if (((descriptorSetCount))) {
+            *countPtr += ((descriptorSetCount)) * 8;
+        }
+        *countPtr += ((descriptorSetCount)) * sizeof(uint64_t);
+        *countPtr += ((descriptorSetCount)) * sizeof(uint32_t);
+        *countPtr += ((descriptorSetCount)) * sizeof(uint32_t);
+        *countPtr += ((descriptorSetCount)) * sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((pendingDescriptorWriteCount)); ++i) {
+            count_VkWriteDescriptorSet(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                       (VkWriteDescriptorSet*)(local_pPendingDescriptorWrites + i),
+                                       countPtr);
+        }
+    }
+    uint32_t packetSize_vkQueueCommitDescriptorSetUpdatesGOOGLE =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkQueueCommitDescriptorSetUpdatesGOOGLE);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkQueueCommitDescriptorSetUpdatesGOOGLE);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkQueueCommitDescriptorSetUpdatesGOOGLE =
+        OP_vkQueueCommitDescriptorSetUpdatesGOOGLE;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkQueueCommitDescriptorSetUpdatesGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkQueueCommitDescriptorSetUpdatesGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkQueue((*&local_queue));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_descriptorPoolCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (((descriptorPoolCount))) {
+        uint8_t* cgen_var_1_ptr = (uint8_t*)(*streamPtrPtr);
+        for (uint32_t k = 0; k < ((descriptorPoolCount)); ++k) {
+            uint64_t tmpval = get_host_u64_VkDescriptorPool(local_pDescriptorPools[k]);
+            memcpy(cgen_var_1_ptr + k * 8, &tmpval, sizeof(uint64_t));
+        }
+        *streamPtrPtr += 8 * ((descriptorPoolCount));
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_descriptorSetCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (((descriptorSetCount))) {
+        uint8_t* cgen_var_2_ptr = (uint8_t*)(*streamPtrPtr);
+        for (uint32_t k = 0; k < ((descriptorSetCount)); ++k) {
+            uint64_t tmpval = get_host_u64_VkDescriptorSetLayout(local_pSetLayouts[k]);
+            memcpy(cgen_var_2_ptr + k * 8, &tmpval, sizeof(uint64_t));
+        }
+        *streamPtrPtr += 8 * ((descriptorSetCount));
+    }
+    memcpy(*streamPtrPtr, (uint64_t*)local_pDescriptorSetPoolIds,
+           ((descriptorSetCount)) * sizeof(uint64_t));
+    *streamPtrPtr += ((descriptorSetCount)) * sizeof(uint64_t);
+    memcpy(*streamPtrPtr, (uint32_t*)local_pDescriptorSetWhichPool,
+           ((descriptorSetCount)) * sizeof(uint32_t));
+    *streamPtrPtr += ((descriptorSetCount)) * sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)local_pDescriptorSetPendingAllocation,
+           ((descriptorSetCount)) * sizeof(uint32_t));
+    *streamPtrPtr += ((descriptorSetCount)) * sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)local_pDescriptorWriteStartingIndices,
+           ((descriptorSetCount)) * sizeof(uint32_t));
+    *streamPtrPtr += ((descriptorSetCount)) * sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_pendingDescriptorWriteCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((pendingDescriptorWriteCount)); ++i) {
+        reservedmarshal_VkWriteDescriptorSet(
+            stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkWriteDescriptorSet*)(local_pPendingDescriptorWrites + i), streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkQueueCommitDescriptorSetUpdatesGOOGLE),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCollectDescriptorPoolIdsGOOGLE(VkDevice device, VkDescriptorPool descriptorPool,
+                                                 uint32_t* pPoolIdCount, uint64_t* pPoolIds,
+                                                 uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCollectDescriptorPoolIdsGOOGLE in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCollectDescriptorPoolIdsGOOGLE(device:%p, descriptorPool:%p, pPoolIdCount:%p, "
+        "pPoolIds:%p)",
+        device, descriptorPool, pPoolIdCount, pPoolIds);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDescriptorPool local_descriptorPool;
+    local_device = device;
+    local_descriptorPool = descriptorPool;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (pPoolIds) {
+            if (pPoolIdCount) {
+                *countPtr += (*(pPoolIdCount)) * sizeof(uint64_t);
+            }
+        }
+    }
+    uint32_t packetSize_vkCollectDescriptorPoolIdsGOOGLE =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCollectDescriptorPoolIdsGOOGLE);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCollectDescriptorPoolIdsGOOGLE);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCollectDescriptorPoolIdsGOOGLE = OP_vkCollectDescriptorPoolIdsGOOGLE;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCollectDescriptorPoolIdsGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCollectDescriptorPoolIdsGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDescriptorPool((*&local_descriptorPool));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)pPoolIdCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)pPoolIds;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (pPoolIds) {
+        memcpy(*streamPtrPtr, (uint64_t*)pPoolIds, (*(pPoolIdCount)) * sizeof(uint64_t));
+        *streamPtrPtr += (*(pPoolIdCount)) * sizeof(uint64_t);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCollectDescriptorPoolIdsGOOGLE), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((uint32_t*)pPoolIdCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t* check_pPoolIds;
+    check_pPoolIds = (uint64_t*)(uintptr_t)stream->getBe64();
+    if (pPoolIds) {
+        if (!(check_pPoolIds)) {
+            fprintf(stderr, "fatal: pPoolIds inconsistent between guest and host\n");
+        }
+        stream->read((uint64_t*)pPoolIds, (*(pPoolIdCount)) * sizeof(uint64_t));
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkQueueSignalReleaseImageANDROIDAsyncGOOGLE(VkQueue queue,
+                                                            uint32_t waitSemaphoreCount,
+                                                            const VkSemaphore* pWaitSemaphores,
+                                                            VkImage image, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkQueueSignalReleaseImageANDROIDAsyncGOOGLE in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkQueueSignalReleaseImageANDROIDAsyncGOOGLE(queue:%p, waitSemaphoreCount:%d, "
+        "pWaitSemaphores:%p, image:%p)",
+        queue, waitSemaphoreCount, pWaitSemaphores, image);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkQueue local_queue;
+    uint32_t local_waitSemaphoreCount;
+    VkSemaphore* local_pWaitSemaphores;
+    VkImage local_image;
+    local_queue = queue;
+    local_waitSemaphoreCount = waitSemaphoreCount;
+    // Avoiding deepcopy for pWaitSemaphores
+    local_pWaitSemaphores = (VkSemaphore*)pWaitSemaphores;
+    local_image = image;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pWaitSemaphores) {
+            if (((waitSemaphoreCount))) {
+                *countPtr += ((waitSemaphoreCount)) * 8;
+            }
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkQueueSignalReleaseImageANDROIDAsyncGOOGLE =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkQueueSignalReleaseImageANDROIDAsyncGOOGLE);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkQueueSignalReleaseImageANDROIDAsyncGOOGLE);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkQueueSignalReleaseImageANDROIDAsyncGOOGLE =
+        OP_vkQueueSignalReleaseImageANDROIDAsyncGOOGLE;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkQueueSignalReleaseImageANDROIDAsyncGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkQueueSignalReleaseImageANDROIDAsyncGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkQueue((*&local_queue));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_waitSemaphoreCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pWaitSemaphores;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pWaitSemaphores) {
+        if (((waitSemaphoreCount))) {
+            uint8_t* cgen_var_1_0_ptr = (uint8_t*)(*streamPtrPtr);
+            for (uint32_t k = 0; k < ((waitSemaphoreCount)); ++k) {
+                uint64_t tmpval = get_host_u64_VkSemaphore(local_pWaitSemaphores[k]);
+                memcpy(cgen_var_1_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+            }
+            *streamPtrPtr += 8 * ((waitSemaphoreCount));
+        }
+    }
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = get_host_u64_VkImage((*&local_image));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkQueueSignalReleaseImageANDROIDAsyncGOOGLE),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkQueueFlushCommandsFromAuxMemoryGOOGLE(VkQueue queue,
+                                                        VkCommandBuffer commandBuffer,
+                                                        VkDeviceMemory deviceMemory,
+                                                        VkDeviceSize dataOffset,
+                                                        VkDeviceSize dataSize, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkQueueFlushCommandsFromAuxMemoryGOOGLE in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkQueueFlushCommandsFromAuxMemoryGOOGLE(queue:%p, commandBuffer:%p, deviceMemory:%p, "
+        "dataOffset:%ld, dataSize:%ld)",
+        queue, commandBuffer, deviceMemory, dataOffset, dataSize);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkQueue local_queue;
+    VkCommandBuffer local_commandBuffer;
+    VkDeviceMemory local_deviceMemory;
+    VkDeviceSize local_dataOffset;
+    VkDeviceSize local_dataSize;
+    local_queue = queue;
+    local_commandBuffer = commandBuffer;
+    local_deviceMemory = deviceMemory;
+    local_dataOffset = dataOffset;
+    local_dataSize = dataSize;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_2;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkDeviceSize);
+        *countPtr += sizeof(VkDeviceSize);
+    }
+    uint32_t packetSize_vkQueueFlushCommandsFromAuxMemoryGOOGLE =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkQueueFlushCommandsFromAuxMemoryGOOGLE);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkQueueFlushCommandsFromAuxMemoryGOOGLE);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkQueueFlushCommandsFromAuxMemoryGOOGLE =
+        OP_vkQueueFlushCommandsFromAuxMemoryGOOGLE;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkQueueFlushCommandsFromAuxMemoryGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkQueueFlushCommandsFromAuxMemoryGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkQueue((*&local_queue));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = get_host_u64_VkDeviceMemory((*&local_deviceMemory));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_dataOffset, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    memcpy(*streamPtrPtr, (VkDeviceSize*)&local_dataSize, sizeof(VkDeviceSize));
+    *streamPtrPtr += sizeof(VkDeviceSize);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkQueueFlushCommandsFromAuxMemoryGOOGLE),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkGetBlobGOOGLE(VkDevice device, VkDeviceMemory memory, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetBlobGOOGLE in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetBlobGOOGLE(device:%p, memory:%p)", device, memory);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDeviceMemory local_memory;
+    local_device = device;
+    local_memory = memory;
+    sResourceTracker->deviceMemoryTransform_tohost(
+        (VkDeviceMemory*)&local_memory, 1, (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr, 0,
+        (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0);
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+    }
+    uint32_t packetSize_vkGetBlobGOOGLE = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkGetBlobGOOGLE);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetBlobGOOGLE);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetBlobGOOGLE = OP_vkGetBlobGOOGLE;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetBlobGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetBlobGOOGLE, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDeviceMemory((*&local_memory));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetBlobGOOGLE), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkGetBlobGOOGLE_VkResult_return = (VkResult)0;
+    stream->read(&vkGetBlobGOOGLE_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetBlobGOOGLE_VkResult_return;
+}
+
+#endif
+#ifdef VK_EXT_global_priority_query
+#endif
+#ifdef VK_EXT_multi_draw
+void VkEncoder::vkCmdDrawMultiEXT(VkCommandBuffer commandBuffer, uint32_t drawCount,
+                                  const VkMultiDrawInfoEXT* pVertexInfo, uint32_t instanceCount,
+                                  uint32_t firstInstance, uint32_t stride, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdDrawMultiEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdDrawMultiEXT(commandBuffer:%p, drawCount:%d, pVertexInfo:%p, instanceCount:%d, "
+        "firstInstance:%d, stride:%d)",
+        commandBuffer, drawCount, pVertexInfo, instanceCount, firstInstance, stride);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_drawCount;
+    VkMultiDrawInfoEXT* local_pVertexInfo;
+    uint32_t local_instanceCount;
+    uint32_t local_firstInstance;
+    uint32_t local_stride;
+    local_commandBuffer = commandBuffer;
+    local_drawCount = drawCount;
+    local_pVertexInfo = nullptr;
+    if (pVertexInfo) {
+        local_pVertexInfo =
+            (VkMultiDrawInfoEXT*)pool->alloc(((drawCount)) * sizeof(const VkMultiDrawInfoEXT));
+        for (uint32_t i = 0; i < (uint32_t)((drawCount)); ++i) {
+            deepcopy_VkMultiDrawInfoEXT(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pVertexInfo + i,
+                                        (VkMultiDrawInfoEXT*)(local_pVertexInfo + i));
+        }
+    }
+    local_instanceCount = instanceCount;
+    local_firstInstance = firstInstance;
+    local_stride = stride;
+    if (local_pVertexInfo) {
+        for (uint32_t i = 0; i < (uint32_t)((drawCount)); ++i) {
+            transform_tohost_VkMultiDrawInfoEXT(sResourceTracker,
+                                                (VkMultiDrawInfoEXT*)(local_pVertexInfo + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pVertexInfo) {
+            for (uint32_t i = 0; i < (uint32_t)((drawCount)); ++i) {
+                count_VkMultiDrawInfoEXT(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                         (VkMultiDrawInfoEXT*)(local_pVertexInfo + i), countPtr);
+            }
+        }
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdDrawMultiEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdDrawMultiEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdDrawMultiEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdDrawMultiEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdDrawMultiEXT = OP_vkCmdDrawMultiEXT;
+    memcpy(streamPtr, &opcode_vkCmdDrawMultiEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdDrawMultiEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_drawCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)local_pVertexInfo;
+    memcpy((*streamPtrPtr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pVertexInfo) {
+        for (uint32_t i = 0; i < (uint32_t)((drawCount)); ++i) {
+            reservedmarshal_VkMultiDrawInfoEXT(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                               (VkMultiDrawInfoEXT*)(local_pVertexInfo + i),
+                                               streamPtrPtr);
+        }
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_instanceCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstInstance, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_stride, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdDrawMultiEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdDrawMultiIndexedEXT(VkCommandBuffer commandBuffer, uint32_t drawCount,
+                                         const VkMultiDrawIndexedInfoEXT* pIndexInfo,
+                                         uint32_t instanceCount, uint32_t firstInstance,
+                                         uint32_t stride, const int32_t* pVertexOffset,
+                                         uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdDrawMultiIndexedEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdDrawMultiIndexedEXT(commandBuffer:%p, drawCount:%d, pIndexInfo:%p, instanceCount:%d, "
+        "firstInstance:%d, stride:%d, pVertexOffset:%p)",
+        commandBuffer, drawCount, pIndexInfo, instanceCount, firstInstance, stride, pVertexOffset);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_drawCount;
+    VkMultiDrawIndexedInfoEXT* local_pIndexInfo;
+    uint32_t local_instanceCount;
+    uint32_t local_firstInstance;
+    uint32_t local_stride;
+    int32_t* local_pVertexOffset;
+    local_commandBuffer = commandBuffer;
+    local_drawCount = drawCount;
+    local_pIndexInfo = nullptr;
+    if (pIndexInfo) {
+        local_pIndexInfo = (VkMultiDrawIndexedInfoEXT*)pool->alloc(
+            ((drawCount)) * sizeof(const VkMultiDrawIndexedInfoEXT));
+        for (uint32_t i = 0; i < (uint32_t)((drawCount)); ++i) {
+            deepcopy_VkMultiDrawIndexedInfoEXT(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pIndexInfo + i,
+                                               (VkMultiDrawIndexedInfoEXT*)(local_pIndexInfo + i));
+        }
+    }
+    local_instanceCount = instanceCount;
+    local_firstInstance = firstInstance;
+    local_stride = stride;
+    // Avoiding deepcopy for pVertexOffset
+    local_pVertexOffset = (int32_t*)pVertexOffset;
+    if (local_pIndexInfo) {
+        for (uint32_t i = 0; i < (uint32_t)((drawCount)); ++i) {
+            transform_tohost_VkMultiDrawIndexedInfoEXT(
+                sResourceTracker, (VkMultiDrawIndexedInfoEXT*)(local_pIndexInfo + i));
+        }
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pIndexInfo) {
+            for (uint32_t i = 0; i < (uint32_t)((drawCount)); ++i) {
+                count_VkMultiDrawIndexedInfoEXT(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                (VkMultiDrawIndexedInfoEXT*)(local_pIndexInfo + i),
+                                                countPtr);
+            }
+        }
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pVertexOffset) {
+            *countPtr += sizeof(int32_t);
+        }
+    }
+    uint32_t packetSize_vkCmdDrawMultiIndexedEXT = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdDrawMultiIndexedEXT);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdDrawMultiIndexedEXT -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdDrawMultiIndexedEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdDrawMultiIndexedEXT = OP_vkCmdDrawMultiIndexedEXT;
+    memcpy(streamPtr, &opcode_vkCmdDrawMultiIndexedEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdDrawMultiIndexedEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_drawCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)local_pIndexInfo;
+    memcpy((*streamPtrPtr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pIndexInfo) {
+        for (uint32_t i = 0; i < (uint32_t)((drawCount)); ++i) {
+            reservedmarshal_VkMultiDrawIndexedInfoEXT(
+                stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkMultiDrawIndexedInfoEXT*)(local_pIndexInfo + i), streamPtrPtr);
+        }
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_instanceCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstInstance, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_stride, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pVertexOffset;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pVertexOffset) {
+        memcpy(*streamPtrPtr, (int32_t*)local_pVertexOffset, sizeof(int32_t));
+        *streamPtrPtr += sizeof(int32_t);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdDrawMultiIndexedEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_EXT_load_store_op_none
+#endif
+#ifdef VK_EXT_border_color_swizzle
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+void VkEncoder::vkSetDeviceMemoryPriorityEXT(VkDevice device, VkDeviceMemory memory, float priority,
+                                             uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkSetDeviceMemoryPriorityEXT in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkSetDeviceMemoryPriorityEXT(device:%p, memory:%p, priority:%f)", device,
+                      memory, priority);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDeviceMemory local_memory;
+    float local_priority;
+    local_device = device;
+    local_memory = memory;
+    local_priority = priority;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(float);
+    }
+    uint32_t packetSize_vkSetDeviceMemoryPriorityEXT =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkSetDeviceMemoryPriorityEXT);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkSetDeviceMemoryPriorityEXT);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkSetDeviceMemoryPriorityEXT = OP_vkSetDeviceMemoryPriorityEXT;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkSetDeviceMemoryPriorityEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkSetDeviceMemoryPriorityEXT, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDeviceMemory((*&local_memory));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (float*)&local_priority, sizeof(float));
+    *streamPtrPtr += sizeof(float);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkSetDeviceMemoryPriorityEXT), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_KHR_acceleration_structure
+VkResult VkEncoder::vkCreateAccelerationStructureKHR(
+    VkDevice device, const VkAccelerationStructureCreateInfoKHR* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkAccelerationStructureKHR* pAccelerationStructure,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateAccelerationStructureKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateAccelerationStructureKHR(device:%p, pCreateInfo:%p, pAllocator:%p, "
+        "pAccelerationStructure:%p)",
+        device, pCreateInfo, pAllocator, pAccelerationStructure);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkAccelerationStructureCreateInfoKHR* local_pCreateInfo;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_pCreateInfo = nullptr;
+    if (pCreateInfo) {
+        local_pCreateInfo = (VkAccelerationStructureCreateInfoKHR*)pool->alloc(
+            sizeof(const VkAccelerationStructureCreateInfoKHR));
+        deepcopy_VkAccelerationStructureCreateInfoKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+            (VkAccelerationStructureCreateInfoKHR*)(local_pCreateInfo));
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfo) {
+        transform_tohost_VkAccelerationStructureCreateInfoKHR(
+            sResourceTracker, (VkAccelerationStructureCreateInfoKHR*)(local_pCreateInfo));
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkAccelerationStructureCreateInfoKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkAccelerationStructureCreateInfoKHR*)(local_pCreateInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        uint64_t cgen_var_1;
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkCreateAccelerationStructureKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCreateAccelerationStructureKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateAccelerationStructureKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateAccelerationStructureKHR = OP_vkCreateAccelerationStructureKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateAccelerationStructureKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateAccelerationStructureKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkAccelerationStructureCreateInfoKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkAccelerationStructureCreateInfoKHR*)(local_pCreateInfo), streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = (uint64_t)((*pAccelerationStructure));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 8);
+    *streamPtrPtr += 8;
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateAccelerationStructureKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->setHandleMapping(sResourceTracker->createMapping());
+    uint64_t cgen_var_3;
+    stream->read((uint64_t*)&cgen_var_3, 8);
+    stream->handleMapping()->mapHandles_u64_VkAccelerationStructureKHR(
+        &cgen_var_3, (VkAccelerationStructureKHR*)pAccelerationStructure, 1);
+    stream->unsetHandleMapping();
+    VkResult vkCreateAccelerationStructureKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateAccelerationStructureKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateAccelerationStructureKHR_VkResult_return;
+}
+
+void VkEncoder::vkDestroyAccelerationStructureKHR(VkDevice device,
+                                                  VkAccelerationStructureKHR accelerationStructure,
+                                                  const VkAllocationCallbacks* pAllocator,
+                                                  uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkDestroyAccelerationStructureKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkDestroyAccelerationStructureKHR(device:%p, accelerationStructure:%p, pAllocator:%p)",
+        device, accelerationStructure, pAllocator);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkAccelerationStructureKHR local_accelerationStructure;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_accelerationStructure = accelerationStructure;
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+    }
+    uint32_t packetSize_vkDestroyAccelerationStructureKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkDestroyAccelerationStructureKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkDestroyAccelerationStructureKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkDestroyAccelerationStructureKHR = OP_vkDestroyAccelerationStructureKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkDestroyAccelerationStructureKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkDestroyAccelerationStructureKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkAccelerationStructureKHR((*&local_accelerationStructure));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkDestroyAccelerationStructureKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    sResourceTracker->destroyMapping()->mapHandles_VkAccelerationStructureKHR(
+        (VkAccelerationStructureKHR*)&accelerationStructure);
+    stream->flush();
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdBuildAccelerationStructuresKHR(
+    VkCommandBuffer commandBuffer, uint32_t infoCount,
+    const VkAccelerationStructureBuildGeometryInfoKHR* pInfos,
+    const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdBuildAccelerationStructuresKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdBuildAccelerationStructuresKHR(commandBuffer:%p, infoCount:%d, pInfos:%p, "
+        "ppBuildRangeInfos:%p)",
+        commandBuffer, infoCount, pInfos, ppBuildRangeInfos);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_infoCount;
+    VkAccelerationStructureBuildGeometryInfoKHR* local_pInfos;
+    VkAccelerationStructureBuildRangeInfoKHR** local_ppBuildRangeInfos;
+    local_commandBuffer = commandBuffer;
+    local_infoCount = infoCount;
+    local_pInfos = nullptr;
+    if (pInfos) {
+        local_pInfos = (VkAccelerationStructureBuildGeometryInfoKHR*)pool->alloc(
+            ((infoCount)) * sizeof(const VkAccelerationStructureBuildGeometryInfoKHR));
+        for (uint32_t i = 0; i < (uint32_t)((infoCount)); ++i) {
+            deepcopy_VkAccelerationStructureBuildGeometryInfoKHR(
+                pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfos + i,
+                (VkAccelerationStructureBuildGeometryInfoKHR*)(local_pInfos + i));
+        }
+    }
+    (void)ppBuildRangeInfos;
+    if (local_pInfos) {
+        for (uint32_t i = 0; i < (uint32_t)((infoCount)); ++i) {
+            transform_tohost_VkAccelerationStructureBuildGeometryInfoKHR(
+                sResourceTracker, (VkAccelerationStructureBuildGeometryInfoKHR*)(local_pInfos + i));
+        }
+    }
+    (void)local_ppBuildRangeInfos;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((infoCount)); ++i) {
+            count_VkAccelerationStructureBuildGeometryInfoKHR(
+                sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkAccelerationStructureBuildGeometryInfoKHR*)(local_pInfos + i), countPtr);
+        }
+        (void)local_ppBuildRangeInfos;
+    }
+    uint32_t packetSize_vkCmdBuildAccelerationStructuresKHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdBuildAccelerationStructuresKHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdBuildAccelerationStructuresKHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdBuildAccelerationStructuresKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdBuildAccelerationStructuresKHR = OP_vkCmdBuildAccelerationStructuresKHR;
+    memcpy(streamPtr, &opcode_vkCmdBuildAccelerationStructuresKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdBuildAccelerationStructuresKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_infoCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((infoCount)); ++i) {
+        reservedmarshal_VkAccelerationStructureBuildGeometryInfoKHR(
+            stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkAccelerationStructureBuildGeometryInfoKHR*)(local_pInfos + i), streamPtrPtr);
+    }
+    (void)local_ppBuildRangeInfos;
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdBuildAccelerationStructuresKHR),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdBuildAccelerationStructuresIndirectKHR(
+    VkCommandBuffer commandBuffer, uint32_t infoCount,
+    const VkAccelerationStructureBuildGeometryInfoKHR* pInfos,
+    const VkDeviceAddress* pIndirectDeviceAddresses, const uint32_t* pIndirectStrides,
+    const uint32_t* const* ppMaxPrimitiveCounts, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdBuildAccelerationStructuresIndirectKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdBuildAccelerationStructuresIndirectKHR(commandBuffer:%p, infoCount:%d, pInfos:%p, "
+        "pIndirectDeviceAddresses:%p, pIndirectStrides:%p, ppMaxPrimitiveCounts:%p)",
+        commandBuffer, infoCount, pInfos, pIndirectDeviceAddresses, pIndirectStrides,
+        ppMaxPrimitiveCounts);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_infoCount;
+    VkAccelerationStructureBuildGeometryInfoKHR* local_pInfos;
+    VkDeviceAddress* local_pIndirectDeviceAddresses;
+    uint32_t* local_pIndirectStrides;
+    uint32_t** local_ppMaxPrimitiveCounts;
+    local_commandBuffer = commandBuffer;
+    local_infoCount = infoCount;
+    local_pInfos = nullptr;
+    if (pInfos) {
+        local_pInfos = (VkAccelerationStructureBuildGeometryInfoKHR*)pool->alloc(
+            ((infoCount)) * sizeof(const VkAccelerationStructureBuildGeometryInfoKHR));
+        for (uint32_t i = 0; i < (uint32_t)((infoCount)); ++i) {
+            deepcopy_VkAccelerationStructureBuildGeometryInfoKHR(
+                pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfos + i,
+                (VkAccelerationStructureBuildGeometryInfoKHR*)(local_pInfos + i));
+        }
+    }
+    // Avoiding deepcopy for pIndirectDeviceAddresses
+    local_pIndirectDeviceAddresses = (VkDeviceAddress*)pIndirectDeviceAddresses;
+    // Avoiding deepcopy for pIndirectStrides
+    local_pIndirectStrides = (uint32_t*)pIndirectStrides;
+    (void)ppMaxPrimitiveCounts;
+    if (local_pInfos) {
+        for (uint32_t i = 0; i < (uint32_t)((infoCount)); ++i) {
+            transform_tohost_VkAccelerationStructureBuildGeometryInfoKHR(
+                sResourceTracker, (VkAccelerationStructureBuildGeometryInfoKHR*)(local_pInfos + i));
+        }
+    }
+    (void)local_ppMaxPrimitiveCounts;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((infoCount)); ++i) {
+            count_VkAccelerationStructureBuildGeometryInfoKHR(
+                sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkAccelerationStructureBuildGeometryInfoKHR*)(local_pInfos + i), countPtr);
+        }
+        *countPtr += ((infoCount)) * sizeof(VkDeviceAddress);
+        *countPtr += ((infoCount)) * sizeof(uint32_t);
+        (void)local_ppMaxPrimitiveCounts;
+    }
+    uint32_t packetSize_vkCmdBuildAccelerationStructuresIndirectKHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdBuildAccelerationStructuresIndirectKHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdBuildAccelerationStructuresIndirectKHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdBuildAccelerationStructuresIndirectKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdBuildAccelerationStructuresIndirectKHR =
+        OP_vkCmdBuildAccelerationStructuresIndirectKHR;
+    memcpy(streamPtr, &opcode_vkCmdBuildAccelerationStructuresIndirectKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdBuildAccelerationStructuresIndirectKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_infoCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((infoCount)); ++i) {
+        reservedmarshal_VkAccelerationStructureBuildGeometryInfoKHR(
+            stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkAccelerationStructureBuildGeometryInfoKHR*)(local_pInfos + i), streamPtrPtr);
+    }
+    memcpy(*streamPtrPtr, (VkDeviceAddress*)local_pIndirectDeviceAddresses,
+           ((infoCount)) * sizeof(VkDeviceAddress));
+    *streamPtrPtr += ((infoCount)) * sizeof(VkDeviceAddress);
+    memcpy(*streamPtrPtr, (uint32_t*)local_pIndirectStrides, ((infoCount)) * sizeof(uint32_t));
+    *streamPtrPtr += ((infoCount)) * sizeof(uint32_t);
+    (void)local_ppMaxPrimitiveCounts;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdBuildAccelerationStructuresIndirectKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkBuildAccelerationStructuresKHR(
+    VkDevice device, VkDeferredOperationKHR deferredOperation, uint32_t infoCount,
+    const VkAccelerationStructureBuildGeometryInfoKHR* pInfos,
+    const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkBuildAccelerationStructuresKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkBuildAccelerationStructuresKHR(device:%p, infoCount:%d, pInfos:%p, "
+        "ppBuildRangeInfos:%p)",
+        device, infoCount, pInfos, ppBuildRangeInfos);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDeferredOperationKHR local_deferredOperation;
+    uint32_t local_infoCount;
+    VkAccelerationStructureBuildGeometryInfoKHR* local_pInfos;
+    VkAccelerationStructureBuildRangeInfoKHR** local_ppBuildRangeInfos;
+    local_device = device;
+    local_deferredOperation = deferredOperation;
+    local_infoCount = infoCount;
+    local_pInfos = nullptr;
+    if (pInfos) {
+        local_pInfos = (VkAccelerationStructureBuildGeometryInfoKHR*)pool->alloc(
+            ((infoCount)) * sizeof(const VkAccelerationStructureBuildGeometryInfoKHR));
+        for (uint32_t i = 0; i < (uint32_t)((infoCount)); ++i) {
+            deepcopy_VkAccelerationStructureBuildGeometryInfoKHR(
+                pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfos + i,
+                (VkAccelerationStructureBuildGeometryInfoKHR*)(local_pInfos + i));
+        }
+    }
+    (void)ppBuildRangeInfos;
+    if (local_pInfos) {
+        for (uint32_t i = 0; i < (uint32_t)((infoCount)); ++i) {
+            transform_tohost_VkAccelerationStructureBuildGeometryInfoKHR(
+                sResourceTracker, (VkAccelerationStructureBuildGeometryInfoKHR*)(local_pInfos + i));
+        }
+    }
+    (void)local_ppBuildRangeInfos;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += 8;
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((infoCount)); ++i) {
+            count_VkAccelerationStructureBuildGeometryInfoKHR(
+                sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkAccelerationStructureBuildGeometryInfoKHR*)(local_pInfos + i), countPtr);
+        }
+        (void)local_ppBuildRangeInfos;
+    }
+    uint32_t packetSize_vkBuildAccelerationStructuresKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkBuildAccelerationStructuresKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkBuildAccelerationStructuresKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkBuildAccelerationStructuresKHR = OP_vkBuildAccelerationStructuresKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkBuildAccelerationStructuresKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkBuildAccelerationStructuresKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1 = (uint64_t)local_deferredOperation;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_infoCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((infoCount)); ++i) {
+        reservedmarshal_VkAccelerationStructureBuildGeometryInfoKHR(
+            stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkAccelerationStructureBuildGeometryInfoKHR*)(local_pInfos + i), streamPtrPtr);
+    }
+    (void)local_ppBuildRangeInfos;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkBuildAccelerationStructuresKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkBuildAccelerationStructuresKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkBuildAccelerationStructuresKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkBuildAccelerationStructuresKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkCopyAccelerationStructureKHR(VkDevice device,
+                                                   VkDeferredOperationKHR deferredOperation,
+                                                   const VkCopyAccelerationStructureInfoKHR* pInfo,
+                                                   uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCopyAccelerationStructureKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCopyAccelerationStructureKHR(device:%p, pInfo:%p)", device, pInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDeferredOperationKHR local_deferredOperation;
+    VkCopyAccelerationStructureInfoKHR* local_pInfo;
+    local_device = device;
+    local_deferredOperation = deferredOperation;
+    local_pInfo = nullptr;
+    if (pInfo) {
+        local_pInfo = (VkCopyAccelerationStructureInfoKHR*)pool->alloc(
+            sizeof(const VkCopyAccelerationStructureInfoKHR));
+        deepcopy_VkCopyAccelerationStructureInfoKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfo,
+            (VkCopyAccelerationStructureInfoKHR*)(local_pInfo));
+    }
+    if (local_pInfo) {
+        transform_tohost_VkCopyAccelerationStructureInfoKHR(
+            sResourceTracker, (VkCopyAccelerationStructureInfoKHR*)(local_pInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += 8;
+        count_VkCopyAccelerationStructureInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                 (VkCopyAccelerationStructureInfoKHR*)(local_pInfo),
+                                                 countPtr);
+    }
+    uint32_t packetSize_vkCopyAccelerationStructureKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCopyAccelerationStructureKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCopyAccelerationStructureKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCopyAccelerationStructureKHR = OP_vkCopyAccelerationStructureKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCopyAccelerationStructureKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCopyAccelerationStructureKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1 = (uint64_t)local_deferredOperation;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    reservedmarshal_VkCopyAccelerationStructureInfoKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkCopyAccelerationStructureInfoKHR*)(local_pInfo),
+        streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCopyAccelerationStructureKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkCopyAccelerationStructureKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkCopyAccelerationStructureKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCopyAccelerationStructureKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkCopyAccelerationStructureToMemoryKHR(
+    VkDevice device, VkDeferredOperationKHR deferredOperation,
+    const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCopyAccelerationStructureToMemoryKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCopyAccelerationStructureToMemoryKHR(device:%p, pInfo:%p)", device, pInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDeferredOperationKHR local_deferredOperation;
+    VkCopyAccelerationStructureToMemoryInfoKHR* local_pInfo;
+    local_device = device;
+    local_deferredOperation = deferredOperation;
+    local_pInfo = nullptr;
+    if (pInfo) {
+        local_pInfo = (VkCopyAccelerationStructureToMemoryInfoKHR*)pool->alloc(
+            sizeof(const VkCopyAccelerationStructureToMemoryInfoKHR));
+        deepcopy_VkCopyAccelerationStructureToMemoryInfoKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfo,
+            (VkCopyAccelerationStructureToMemoryInfoKHR*)(local_pInfo));
+    }
+    if (local_pInfo) {
+        transform_tohost_VkCopyAccelerationStructureToMemoryInfoKHR(
+            sResourceTracker, (VkCopyAccelerationStructureToMemoryInfoKHR*)(local_pInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += 8;
+        count_VkCopyAccelerationStructureToMemoryInfoKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkCopyAccelerationStructureToMemoryInfoKHR*)(local_pInfo), countPtr);
+    }
+    uint32_t packetSize_vkCopyAccelerationStructureToMemoryKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCopyAccelerationStructureToMemoryKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCopyAccelerationStructureToMemoryKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCopyAccelerationStructureToMemoryKHR =
+        OP_vkCopyAccelerationStructureToMemoryKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCopyAccelerationStructureToMemoryKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCopyAccelerationStructureToMemoryKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1 = (uint64_t)local_deferredOperation;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    reservedmarshal_VkCopyAccelerationStructureToMemoryInfoKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkCopyAccelerationStructureToMemoryInfoKHR*)(local_pInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCopyAccelerationStructureToMemoryKHR),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkCopyAccelerationStructureToMemoryKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkCopyAccelerationStructureToMemoryKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCopyAccelerationStructureToMemoryKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkCopyMemoryToAccelerationStructureKHR(
+    VkDevice device, VkDeferredOperationKHR deferredOperation,
+    const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCopyMemoryToAccelerationStructureKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCopyMemoryToAccelerationStructureKHR(device:%p, pInfo:%p)", device, pInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDeferredOperationKHR local_deferredOperation;
+    VkCopyMemoryToAccelerationStructureInfoKHR* local_pInfo;
+    local_device = device;
+    local_deferredOperation = deferredOperation;
+    local_pInfo = nullptr;
+    if (pInfo) {
+        local_pInfo = (VkCopyMemoryToAccelerationStructureInfoKHR*)pool->alloc(
+            sizeof(const VkCopyMemoryToAccelerationStructureInfoKHR));
+        deepcopy_VkCopyMemoryToAccelerationStructureInfoKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfo,
+            (VkCopyMemoryToAccelerationStructureInfoKHR*)(local_pInfo));
+    }
+    if (local_pInfo) {
+        transform_tohost_VkCopyMemoryToAccelerationStructureInfoKHR(
+            sResourceTracker, (VkCopyMemoryToAccelerationStructureInfoKHR*)(local_pInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += 8;
+        count_VkCopyMemoryToAccelerationStructureInfoKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkCopyMemoryToAccelerationStructureInfoKHR*)(local_pInfo), countPtr);
+    }
+    uint32_t packetSize_vkCopyMemoryToAccelerationStructureKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCopyMemoryToAccelerationStructureKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCopyMemoryToAccelerationStructureKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCopyMemoryToAccelerationStructureKHR =
+        OP_vkCopyMemoryToAccelerationStructureKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCopyMemoryToAccelerationStructureKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCopyMemoryToAccelerationStructureKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1 = (uint64_t)local_deferredOperation;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    reservedmarshal_VkCopyMemoryToAccelerationStructureInfoKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkCopyMemoryToAccelerationStructureInfoKHR*)(local_pInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCopyMemoryToAccelerationStructureKHR),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkResult vkCopyMemoryToAccelerationStructureKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkCopyMemoryToAccelerationStructureKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCopyMemoryToAccelerationStructureKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkWriteAccelerationStructuresPropertiesKHR(
+    VkDevice device, uint32_t accelerationStructureCount,
+    const VkAccelerationStructureKHR* pAccelerationStructures, VkQueryType queryType,
+    size_t dataSize, void* pData, size_t stride, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkWriteAccelerationStructuresPropertiesKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkWriteAccelerationStructuresPropertiesKHR(device:%p, accelerationStructureCount:%d, "
+        "pAccelerationStructures:%p, dataSize:%ld, pData:%p, stride:%ld)",
+        device, accelerationStructureCount, pAccelerationStructures, dataSize, pData, stride);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    uint32_t local_accelerationStructureCount;
+    VkAccelerationStructureKHR* local_pAccelerationStructures;
+    VkQueryType local_queryType;
+    size_t local_dataSize;
+    size_t local_stride;
+    local_device = device;
+    local_accelerationStructureCount = accelerationStructureCount;
+    // Avoiding deepcopy for pAccelerationStructures
+    local_pAccelerationStructures = (VkAccelerationStructureKHR*)pAccelerationStructures;
+    local_queryType = queryType;
+    local_dataSize = dataSize;
+    local_stride = stride;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        if (((accelerationStructureCount))) {
+            *countPtr += ((accelerationStructureCount)) * 8;
+        }
+        *countPtr += sizeof(VkQueryType);
+        *countPtr += 8;
+        *countPtr += ((dataSize)) * sizeof(uint8_t);
+        *countPtr += 8;
+    }
+    uint32_t packetSize_vkWriteAccelerationStructuresPropertiesKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkWriteAccelerationStructuresPropertiesKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkWriteAccelerationStructuresPropertiesKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkWriteAccelerationStructuresPropertiesKHR =
+        OP_vkWriteAccelerationStructuresPropertiesKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkWriteAccelerationStructuresPropertiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkWriteAccelerationStructuresPropertiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_accelerationStructureCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (((accelerationStructureCount))) {
+        uint8_t* cgen_var_1_ptr = (uint8_t*)(*streamPtrPtr);
+        for (uint32_t k = 0; k < ((accelerationStructureCount)); ++k) {
+            uint64_t tmpval =
+                get_host_u64_VkAccelerationStructureKHR(local_pAccelerationStructures[k]);
+            memcpy(cgen_var_1_ptr + k * 8, &tmpval, sizeof(uint64_t));
+        }
+        *streamPtrPtr += 8 * ((accelerationStructureCount));
+    }
+    memcpy(*streamPtrPtr, (VkQueryType*)&local_queryType, sizeof(VkQueryType));
+    *streamPtrPtr += sizeof(VkQueryType);
+    uint64_t cgen_var_2 = (uint64_t)local_dataSize;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    memcpy(*streamPtrPtr, (void*)pData, ((dataSize)) * sizeof(uint8_t));
+    *streamPtrPtr += ((dataSize)) * sizeof(uint8_t);
+    uint64_t cgen_var_3 = (uint64_t)local_stride;
+    memcpy((*streamPtrPtr), &cgen_var_3, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkWriteAccelerationStructuresPropertiesKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((void*)pData, ((dataSize)) * sizeof(uint8_t));
+    VkResult vkWriteAccelerationStructuresPropertiesKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkWriteAccelerationStructuresPropertiesKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkWriteAccelerationStructuresPropertiesKHR_VkResult_return;
+}
+
+void VkEncoder::vkCmdCopyAccelerationStructureKHR(VkCommandBuffer commandBuffer,
+                                                  const VkCopyAccelerationStructureInfoKHR* pInfo,
+                                                  uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdCopyAccelerationStructureKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdCopyAccelerationStructureKHR(commandBuffer:%p, pInfo:%p)",
+                      commandBuffer, pInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkCopyAccelerationStructureInfoKHR* local_pInfo;
+    local_commandBuffer = commandBuffer;
+    local_pInfo = nullptr;
+    if (pInfo) {
+        local_pInfo = (VkCopyAccelerationStructureInfoKHR*)pool->alloc(
+            sizeof(const VkCopyAccelerationStructureInfoKHR));
+        deepcopy_VkCopyAccelerationStructureInfoKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfo,
+            (VkCopyAccelerationStructureInfoKHR*)(local_pInfo));
+    }
+    if (local_pInfo) {
+        transform_tohost_VkCopyAccelerationStructureInfoKHR(
+            sResourceTracker, (VkCopyAccelerationStructureInfoKHR*)(local_pInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkCopyAccelerationStructureInfoKHR(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                                 (VkCopyAccelerationStructureInfoKHR*)(local_pInfo),
+                                                 countPtr);
+    }
+    uint32_t packetSize_vkCmdCopyAccelerationStructureKHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdCopyAccelerationStructureKHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdCopyAccelerationStructureKHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdCopyAccelerationStructureKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdCopyAccelerationStructureKHR = OP_vkCmdCopyAccelerationStructureKHR;
+    memcpy(streamPtr, &opcode_vkCmdCopyAccelerationStructureKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdCopyAccelerationStructureKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkCopyAccelerationStructureInfoKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkCopyAccelerationStructureInfoKHR*)(local_pInfo),
+        streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdCopyAccelerationStructureKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdCopyAccelerationStructureToMemoryKHR(
+    VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdCopyAccelerationStructureToMemoryKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdCopyAccelerationStructureToMemoryKHR(commandBuffer:%p, pInfo:%p)",
+                      commandBuffer, pInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkCopyAccelerationStructureToMemoryInfoKHR* local_pInfo;
+    local_commandBuffer = commandBuffer;
+    local_pInfo = nullptr;
+    if (pInfo) {
+        local_pInfo = (VkCopyAccelerationStructureToMemoryInfoKHR*)pool->alloc(
+            sizeof(const VkCopyAccelerationStructureToMemoryInfoKHR));
+        deepcopy_VkCopyAccelerationStructureToMemoryInfoKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfo,
+            (VkCopyAccelerationStructureToMemoryInfoKHR*)(local_pInfo));
+    }
+    if (local_pInfo) {
+        transform_tohost_VkCopyAccelerationStructureToMemoryInfoKHR(
+            sResourceTracker, (VkCopyAccelerationStructureToMemoryInfoKHR*)(local_pInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkCopyAccelerationStructureToMemoryInfoKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkCopyAccelerationStructureToMemoryInfoKHR*)(local_pInfo), countPtr);
+    }
+    uint32_t packetSize_vkCmdCopyAccelerationStructureToMemoryKHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdCopyAccelerationStructureToMemoryKHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdCopyAccelerationStructureToMemoryKHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdCopyAccelerationStructureToMemoryKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdCopyAccelerationStructureToMemoryKHR =
+        OP_vkCmdCopyAccelerationStructureToMemoryKHR;
+    memcpy(streamPtr, &opcode_vkCmdCopyAccelerationStructureToMemoryKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdCopyAccelerationStructureToMemoryKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkCopyAccelerationStructureToMemoryInfoKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkCopyAccelerationStructureToMemoryInfoKHR*)(local_pInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdCopyAccelerationStructureToMemoryKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkCmdCopyMemoryToAccelerationStructureKHR(
+    VkCommandBuffer commandBuffer, const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdCopyMemoryToAccelerationStructureKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkCmdCopyMemoryToAccelerationStructureKHR(commandBuffer:%p, pInfo:%p)",
+                      commandBuffer, pInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkCopyMemoryToAccelerationStructureInfoKHR* local_pInfo;
+    local_commandBuffer = commandBuffer;
+    local_pInfo = nullptr;
+    if (pInfo) {
+        local_pInfo = (VkCopyMemoryToAccelerationStructureInfoKHR*)pool->alloc(
+            sizeof(const VkCopyMemoryToAccelerationStructureInfoKHR));
+        deepcopy_VkCopyMemoryToAccelerationStructureInfoKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfo,
+            (VkCopyMemoryToAccelerationStructureInfoKHR*)(local_pInfo));
+    }
+    if (local_pInfo) {
+        transform_tohost_VkCopyMemoryToAccelerationStructureInfoKHR(
+            sResourceTracker, (VkCopyMemoryToAccelerationStructureInfoKHR*)(local_pInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkCopyMemoryToAccelerationStructureInfoKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkCopyMemoryToAccelerationStructureInfoKHR*)(local_pInfo), countPtr);
+    }
+    uint32_t packetSize_vkCmdCopyMemoryToAccelerationStructureKHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdCopyMemoryToAccelerationStructureKHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdCopyMemoryToAccelerationStructureKHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdCopyMemoryToAccelerationStructureKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdCopyMemoryToAccelerationStructureKHR =
+        OP_vkCmdCopyMemoryToAccelerationStructureKHR;
+    memcpy(streamPtr, &opcode_vkCmdCopyMemoryToAccelerationStructureKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdCopyMemoryToAccelerationStructureKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkCopyMemoryToAccelerationStructureInfoKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkCopyMemoryToAccelerationStructureInfoKHR*)(local_pInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdCopyMemoryToAccelerationStructureKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkDeviceAddress VkEncoder::vkGetAccelerationStructureDeviceAddressKHR(
+    VkDevice device, const VkAccelerationStructureDeviceAddressInfoKHR* pInfo, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetAccelerationStructureDeviceAddressKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetAccelerationStructureDeviceAddressKHR(device:%p, pInfo:%p)", device,
+                      pInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkAccelerationStructureDeviceAddressInfoKHR* local_pInfo;
+    local_device = device;
+    local_pInfo = nullptr;
+    if (pInfo) {
+        local_pInfo = (VkAccelerationStructureDeviceAddressInfoKHR*)pool->alloc(
+            sizeof(const VkAccelerationStructureDeviceAddressInfoKHR));
+        deepcopy_VkAccelerationStructureDeviceAddressInfoKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pInfo,
+            (VkAccelerationStructureDeviceAddressInfoKHR*)(local_pInfo));
+    }
+    if (local_pInfo) {
+        transform_tohost_VkAccelerationStructureDeviceAddressInfoKHR(
+            sResourceTracker, (VkAccelerationStructureDeviceAddressInfoKHR*)(local_pInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkAccelerationStructureDeviceAddressInfoKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkAccelerationStructureDeviceAddressInfoKHR*)(local_pInfo), countPtr);
+    }
+    uint32_t packetSize_vkGetAccelerationStructureDeviceAddressKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetAccelerationStructureDeviceAddressKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetAccelerationStructureDeviceAddressKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetAccelerationStructureDeviceAddressKHR =
+        OP_vkGetAccelerationStructureDeviceAddressKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetAccelerationStructureDeviceAddressKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetAccelerationStructureDeviceAddressKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkAccelerationStructureDeviceAddressInfoKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkAccelerationStructureDeviceAddressInfoKHR*)(local_pInfo), streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetAccelerationStructureDeviceAddressKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkDeviceAddress vkGetAccelerationStructureDeviceAddressKHR_VkDeviceAddress_return =
+        (VkDeviceAddress)0;
+    stream->read(&vkGetAccelerationStructureDeviceAddressKHR_VkDeviceAddress_return,
+                 sizeof(VkDeviceAddress));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetAccelerationStructureDeviceAddressKHR_VkDeviceAddress_return;
+}
+
+void VkEncoder::vkCmdWriteAccelerationStructuresPropertiesKHR(
+    VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount,
+    const VkAccelerationStructureKHR* pAccelerationStructures, VkQueryType queryType,
+    VkQueryPool queryPool, uint32_t firstQuery, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkCmdWriteAccelerationStructuresPropertiesKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdWriteAccelerationStructuresPropertiesKHR(commandBuffer:%p, "
+        "accelerationStructureCount:%d, pAccelerationStructures:%p, queryPool:%p, firstQuery:%d)",
+        commandBuffer, accelerationStructureCount, pAccelerationStructures, queryPool, firstQuery);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_accelerationStructureCount;
+    VkAccelerationStructureKHR* local_pAccelerationStructures;
+    VkQueryType local_queryType;
+    VkQueryPool local_queryPool;
+    uint32_t local_firstQuery;
+    local_commandBuffer = commandBuffer;
+    local_accelerationStructureCount = accelerationStructureCount;
+    // Avoiding deepcopy for pAccelerationStructures
+    local_pAccelerationStructures = (VkAccelerationStructureKHR*)pAccelerationStructures;
+    local_queryType = queryType;
+    local_queryPool = queryPool;
+    local_firstQuery = firstQuery;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        if (((accelerationStructureCount))) {
+            *countPtr += ((accelerationStructureCount)) * 8;
+        }
+        *countPtr += sizeof(VkQueryType);
+        uint64_t cgen_var_2;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdWriteAccelerationStructuresPropertiesKHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdWriteAccelerationStructuresPropertiesKHR);
+    if (queueSubmitWithCommandsEnabled)
+        packetSize_vkCmdWriteAccelerationStructuresPropertiesKHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdWriteAccelerationStructuresPropertiesKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdWriteAccelerationStructuresPropertiesKHR =
+        OP_vkCmdWriteAccelerationStructuresPropertiesKHR;
+    memcpy(streamPtr, &opcode_vkCmdWriteAccelerationStructuresPropertiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdWriteAccelerationStructuresPropertiesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_accelerationStructureCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (((accelerationStructureCount))) {
+        uint8_t* cgen_var_0_ptr = (uint8_t*)(*streamPtrPtr);
+        for (uint32_t k = 0; k < ((accelerationStructureCount)); ++k) {
+            uint64_t tmpval =
+                get_host_u64_VkAccelerationStructureKHR(local_pAccelerationStructures[k]);
+            memcpy(cgen_var_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+        }
+        *streamPtrPtr += 8 * ((accelerationStructureCount));
+    }
+    memcpy(*streamPtrPtr, (VkQueryType*)&local_queryType, sizeof(VkQueryType));
+    *streamPtrPtr += sizeof(VkQueryType);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkQueryPool((*&local_queryPool));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstQuery, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdWriteAccelerationStructuresPropertiesKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetDeviceAccelerationStructureCompatibilityKHR(
+    VkDevice device, const VkAccelerationStructureVersionInfoKHR* pVersionInfo,
+    VkAccelerationStructureCompatibilityKHR* pCompatibility, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkGetDeviceAccelerationStructureCompatibilityKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetDeviceAccelerationStructureCompatibilityKHR(device:%p, pVersionInfo:%p, "
+        "pCompatibility:%p)",
+        device, pVersionInfo, pCompatibility);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkAccelerationStructureVersionInfoKHR* local_pVersionInfo;
+    local_device = device;
+    local_pVersionInfo = nullptr;
+    if (pVersionInfo) {
+        local_pVersionInfo = (VkAccelerationStructureVersionInfoKHR*)pool->alloc(
+            sizeof(const VkAccelerationStructureVersionInfoKHR));
+        deepcopy_VkAccelerationStructureVersionInfoKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pVersionInfo,
+            (VkAccelerationStructureVersionInfoKHR*)(local_pVersionInfo));
+    }
+    if (local_pVersionInfo) {
+        transform_tohost_VkAccelerationStructureVersionInfoKHR(
+            sResourceTracker, (VkAccelerationStructureVersionInfoKHR*)(local_pVersionInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkAccelerationStructureVersionInfoKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkAccelerationStructureVersionInfoKHR*)(local_pVersionInfo), countPtr);
+        *countPtr += sizeof(VkAccelerationStructureCompatibilityKHR);
+    }
+    uint32_t packetSize_vkGetDeviceAccelerationStructureCompatibilityKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetDeviceAccelerationStructureCompatibilityKHR);
+    uint8_t* streamPtr =
+        stream->reserve(packetSize_vkGetDeviceAccelerationStructureCompatibilityKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetDeviceAccelerationStructureCompatibilityKHR =
+        OP_vkGetDeviceAccelerationStructureCompatibilityKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetDeviceAccelerationStructureCompatibilityKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetDeviceAccelerationStructureCompatibilityKHR,
+           sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    reservedmarshal_VkAccelerationStructureVersionInfoKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkAccelerationStructureVersionInfoKHR*)(local_pVersionInfo), streamPtrPtr);
+    memcpy(*streamPtrPtr, (VkAccelerationStructureCompatibilityKHR*)pCompatibility,
+           sizeof(VkAccelerationStructureCompatibilityKHR));
+    *streamPtrPtr += sizeof(VkAccelerationStructureCompatibilityKHR);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetDeviceAccelerationStructureCompatibilityKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((VkAccelerationStructureCompatibilityKHR*)pCompatibility,
+                 sizeof(VkAccelerationStructureCompatibilityKHR));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+void VkEncoder::vkGetAccelerationStructureBuildSizesKHR(
+    VkDevice device, VkAccelerationStructureBuildTypeKHR buildType,
+    const VkAccelerationStructureBuildGeometryInfoKHR* pBuildInfo,
+    const uint32_t* pMaxPrimitiveCounts, VkAccelerationStructureBuildSizesInfoKHR* pSizeInfo,
+    uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetAccelerationStructureBuildSizesKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetAccelerationStructureBuildSizesKHR(device:%p, pBuildInfo:%p, pMaxPrimitiveCounts:%p, "
+        "pSizeInfo:%p)",
+        device, pBuildInfo, pMaxPrimitiveCounts, pSizeInfo);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkAccelerationStructureBuildTypeKHR local_buildType;
+    VkAccelerationStructureBuildGeometryInfoKHR* local_pBuildInfo;
+    uint32_t* local_pMaxPrimitiveCounts;
+    local_device = device;
+    local_buildType = buildType;
+    local_pBuildInfo = nullptr;
+    if (pBuildInfo) {
+        local_pBuildInfo = (VkAccelerationStructureBuildGeometryInfoKHR*)pool->alloc(
+            sizeof(const VkAccelerationStructureBuildGeometryInfoKHR));
+        deepcopy_VkAccelerationStructureBuildGeometryInfoKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pBuildInfo,
+            (VkAccelerationStructureBuildGeometryInfoKHR*)(local_pBuildInfo));
+    }
+    // Avoiding deepcopy for pMaxPrimitiveCounts
+    local_pMaxPrimitiveCounts = (uint32_t*)pMaxPrimitiveCounts;
+    if (local_pBuildInfo) {
+        transform_tohost_VkAccelerationStructureBuildGeometryInfoKHR(
+            sResourceTracker, (VkAccelerationStructureBuildGeometryInfoKHR*)(local_pBuildInfo));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(VkAccelerationStructureBuildTypeKHR);
+        count_VkAccelerationStructureBuildGeometryInfoKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkAccelerationStructureBuildGeometryInfoKHR*)(local_pBuildInfo), countPtr);
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pMaxPrimitiveCounts) {
+            *countPtr += pBuildInfo->geometryCount * sizeof(uint32_t);
+        }
+        count_VkAccelerationStructureBuildSizesInfoKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkAccelerationStructureBuildSizesInfoKHR*)(pSizeInfo), countPtr);
+    }
+    uint32_t packetSize_vkGetAccelerationStructureBuildSizesKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetAccelerationStructureBuildSizesKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetAccelerationStructureBuildSizesKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetAccelerationStructureBuildSizesKHR =
+        OP_vkGetAccelerationStructureBuildSizesKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetAccelerationStructureBuildSizesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetAccelerationStructureBuildSizesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (VkAccelerationStructureBuildTypeKHR*)&local_buildType,
+           sizeof(VkAccelerationStructureBuildTypeKHR));
+    *streamPtrPtr += sizeof(VkAccelerationStructureBuildTypeKHR);
+    reservedmarshal_VkAccelerationStructureBuildGeometryInfoKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkAccelerationStructureBuildGeometryInfoKHR*)(local_pBuildInfo), streamPtrPtr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pMaxPrimitiveCounts;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pMaxPrimitiveCounts) {
+        memcpy(*streamPtrPtr, (uint32_t*)local_pMaxPrimitiveCounts,
+               pBuildInfo->geometryCount * sizeof(uint32_t));
+        *streamPtrPtr += pBuildInfo->geometryCount * sizeof(uint32_t);
+    }
+    reservedmarshal_VkAccelerationStructureBuildSizesInfoKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkAccelerationStructureBuildSizesInfoKHR*)(pSizeInfo),
+        streamPtrPtr);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetAccelerationStructureBuildSizesKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    unmarshal_VkAccelerationStructureBuildSizesInfoKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM, (VkAccelerationStructureBuildSizesInfoKHR*)(pSizeInfo));
+    if (pSizeInfo) {
+        transform_fromhost_VkAccelerationStructureBuildSizesInfoKHR(
+            sResourceTracker, (VkAccelerationStructureBuildSizesInfoKHR*)(pSizeInfo));
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+void VkEncoder::vkCmdTraceRaysKHR(
+    VkCommandBuffer commandBuffer, const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable,
+    const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable,
+    const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable,
+    const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable, uint32_t width,
+    uint32_t height, uint32_t depth, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdTraceRaysKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdTraceRaysKHR(commandBuffer:%p, pRaygenShaderBindingTable:%p, "
+        "pMissShaderBindingTable:%p, pHitShaderBindingTable:%p, pCallableShaderBindingTable:%p, "
+        "width:%d, height:%d, depth:%d)",
+        commandBuffer, pRaygenShaderBindingTable, pMissShaderBindingTable, pHitShaderBindingTable,
+        pCallableShaderBindingTable, width, height, depth);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkStridedDeviceAddressRegionKHR* local_pRaygenShaderBindingTable;
+    VkStridedDeviceAddressRegionKHR* local_pMissShaderBindingTable;
+    VkStridedDeviceAddressRegionKHR* local_pHitShaderBindingTable;
+    VkStridedDeviceAddressRegionKHR* local_pCallableShaderBindingTable;
+    uint32_t local_width;
+    uint32_t local_height;
+    uint32_t local_depth;
+    local_commandBuffer = commandBuffer;
+    local_pRaygenShaderBindingTable = nullptr;
+    if (pRaygenShaderBindingTable) {
+        local_pRaygenShaderBindingTable = (VkStridedDeviceAddressRegionKHR*)pool->alloc(
+            sizeof(const VkStridedDeviceAddressRegionKHR));
+        deepcopy_VkStridedDeviceAddressRegionKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pRaygenShaderBindingTable,
+            (VkStridedDeviceAddressRegionKHR*)(local_pRaygenShaderBindingTable));
+    }
+    local_pMissShaderBindingTable = nullptr;
+    if (pMissShaderBindingTable) {
+        local_pMissShaderBindingTable = (VkStridedDeviceAddressRegionKHR*)pool->alloc(
+            sizeof(const VkStridedDeviceAddressRegionKHR));
+        deepcopy_VkStridedDeviceAddressRegionKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pMissShaderBindingTable,
+            (VkStridedDeviceAddressRegionKHR*)(local_pMissShaderBindingTable));
+    }
+    local_pHitShaderBindingTable = nullptr;
+    if (pHitShaderBindingTable) {
+        local_pHitShaderBindingTable = (VkStridedDeviceAddressRegionKHR*)pool->alloc(
+            sizeof(const VkStridedDeviceAddressRegionKHR));
+        deepcopy_VkStridedDeviceAddressRegionKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pHitShaderBindingTable,
+            (VkStridedDeviceAddressRegionKHR*)(local_pHitShaderBindingTable));
+    }
+    local_pCallableShaderBindingTable = nullptr;
+    if (pCallableShaderBindingTable) {
+        local_pCallableShaderBindingTable = (VkStridedDeviceAddressRegionKHR*)pool->alloc(
+            sizeof(const VkStridedDeviceAddressRegionKHR));
+        deepcopy_VkStridedDeviceAddressRegionKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCallableShaderBindingTable,
+            (VkStridedDeviceAddressRegionKHR*)(local_pCallableShaderBindingTable));
+    }
+    local_width = width;
+    local_height = height;
+    local_depth = depth;
+    if (local_pRaygenShaderBindingTable) {
+        transform_tohost_VkStridedDeviceAddressRegionKHR(
+            sResourceTracker, (VkStridedDeviceAddressRegionKHR*)(local_pRaygenShaderBindingTable));
+    }
+    if (local_pMissShaderBindingTable) {
+        transform_tohost_VkStridedDeviceAddressRegionKHR(
+            sResourceTracker, (VkStridedDeviceAddressRegionKHR*)(local_pMissShaderBindingTable));
+    }
+    if (local_pHitShaderBindingTable) {
+        transform_tohost_VkStridedDeviceAddressRegionKHR(
+            sResourceTracker, (VkStridedDeviceAddressRegionKHR*)(local_pHitShaderBindingTable));
+    }
+    if (local_pCallableShaderBindingTable) {
+        transform_tohost_VkStridedDeviceAddressRegionKHR(
+            sResourceTracker,
+            (VkStridedDeviceAddressRegionKHR*)(local_pCallableShaderBindingTable));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkStridedDeviceAddressRegionKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkStridedDeviceAddressRegionKHR*)(local_pRaygenShaderBindingTable), countPtr);
+        count_VkStridedDeviceAddressRegionKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkStridedDeviceAddressRegionKHR*)(local_pMissShaderBindingTable), countPtr);
+        count_VkStridedDeviceAddressRegionKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkStridedDeviceAddressRegionKHR*)(local_pHitShaderBindingTable), countPtr);
+        count_VkStridedDeviceAddressRegionKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkStridedDeviceAddressRegionKHR*)(local_pCallableShaderBindingTable), countPtr);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdTraceRaysKHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdTraceRaysKHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdTraceRaysKHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdTraceRaysKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdTraceRaysKHR = OP_vkCmdTraceRaysKHR;
+    memcpy(streamPtr, &opcode_vkCmdTraceRaysKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdTraceRaysKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkStridedDeviceAddressRegionKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkStridedDeviceAddressRegionKHR*)(local_pRaygenShaderBindingTable), streamPtrPtr);
+    reservedmarshal_VkStridedDeviceAddressRegionKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkStridedDeviceAddressRegionKHR*)(local_pMissShaderBindingTable), streamPtrPtr);
+    reservedmarshal_VkStridedDeviceAddressRegionKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkStridedDeviceAddressRegionKHR*)(local_pHitShaderBindingTable), streamPtrPtr);
+    reservedmarshal_VkStridedDeviceAddressRegionKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkStridedDeviceAddressRegionKHR*)(local_pCallableShaderBindingTable), streamPtrPtr);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_width, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_height, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_depth, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdTraceRaysKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkResult VkEncoder::vkCreateRayTracingPipelinesKHR(
+    VkDevice device, VkDeferredOperationKHR deferredOperation, VkPipelineCache pipelineCache,
+    uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoKHR* pCreateInfos,
+    const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCreateRayTracingPipelinesKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCreateRayTracingPipelinesKHR(device:%p, pipelineCache:%p, createInfoCount:%d, "
+        "pCreateInfos:%p, pAllocator:%p, pPipelines:%p)",
+        device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkDeferredOperationKHR local_deferredOperation;
+    VkPipelineCache local_pipelineCache;
+    uint32_t local_createInfoCount;
+    VkRayTracingPipelineCreateInfoKHR* local_pCreateInfos;
+    VkAllocationCallbacks* local_pAllocator;
+    local_device = device;
+    local_deferredOperation = deferredOperation;
+    local_pipelineCache = pipelineCache;
+    local_createInfoCount = createInfoCount;
+    local_pCreateInfos = nullptr;
+    if (pCreateInfos) {
+        local_pCreateInfos = (VkRayTracingPipelineCreateInfoKHR*)pool->alloc(
+            ((createInfoCount)) * sizeof(const VkRayTracingPipelineCreateInfoKHR));
+        for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) {
+            deepcopy_VkRayTracingPipelineCreateInfoKHR(
+                pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfos + i,
+                (VkRayTracingPipelineCreateInfoKHR*)(local_pCreateInfos + i));
+        }
+    }
+    local_pAllocator = nullptr;
+    if (pAllocator) {
+        local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
+        deepcopy_VkAllocationCallbacks(pool, VK_STRUCTURE_TYPE_MAX_ENUM, pAllocator,
+                                       (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    local_pAllocator = nullptr;
+    if (local_pCreateInfos) {
+        for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) {
+            transform_tohost_VkRayTracingPipelineCreateInfoKHR(
+                sResourceTracker, (VkRayTracingPipelineCreateInfoKHR*)(local_pCreateInfos + i));
+        }
+    }
+    if (local_pAllocator) {
+        transform_tohost_VkAllocationCallbacks(sResourceTracker,
+                                               (VkAllocationCallbacks*)(local_pAllocator));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) {
+            count_VkRayTracingPipelineCreateInfoKHR(
+                sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                (VkRayTracingPipelineCreateInfoKHR*)(local_pCreateInfos + i), countPtr);
+        }
+        // WARNING PTR CHECK
+        *countPtr += 8;
+        if (local_pAllocator) {
+            count_VkAllocationCallbacks(sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                        (VkAllocationCallbacks*)(local_pAllocator), countPtr);
+        }
+        if (((createInfoCount))) {
+            *countPtr += ((createInfoCount)) * 8;
+        }
+    }
+    uint32_t packetSize_vkCreateRayTracingPipelinesKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCreateRayTracingPipelinesKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCreateRayTracingPipelinesKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCreateRayTracingPipelinesKHR = OP_vkCreateRayTracingPipelinesKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkCreateRayTracingPipelinesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCreateRayTracingPipelinesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1 = (uint64_t)local_deferredOperation;
+    memcpy((*streamPtrPtr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = get_host_u64_VkPipelineCache((*&local_pipelineCache));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_2, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_createInfoCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) {
+        reservedmarshal_VkRayTracingPipelineCreateInfoKHR(
+            stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkRayTracingPipelineCreateInfoKHR*)(local_pCreateInfos + i), streamPtrPtr);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_3 = (uint64_t)(uintptr_t)local_pAllocator;
+    memcpy((*streamPtrPtr), &cgen_var_3, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    if (local_pAllocator) {
+        reservedmarshal_VkAllocationCallbacks(stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+                                              (VkAllocationCallbacks*)(local_pAllocator),
+                                              streamPtrPtr);
+    }
+    /* is handle, possibly out */;
+    if (((createInfoCount))) {
+        uint8_t* cgen_var_4_ptr = (uint8_t*)(*streamPtrPtr);
+        for (uint32_t k = 0; k < ((createInfoCount)); ++k) {
+            uint64_t tmpval = (uint64_t)(pPipelines[k]);
+            memcpy(cgen_var_4_ptr + k * 8, &tmpval, sizeof(uint64_t));
+        }
+        *streamPtrPtr += 8 * ((createInfoCount));
+    }
+    /* is handle, possibly out */;
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCreateRayTracingPipelinesKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    if (((createInfoCount))) {
+        uint64_t* cgen_var_5;
+        stream->alloc((void**)&cgen_var_5, ((createInfoCount)) * 8);
+        stream->read((uint64_t*)cgen_var_5, ((createInfoCount)) * 8);
+        stream->handleMapping()->mapHandles_u64_VkPipeline(cgen_var_5, (VkPipeline*)pPipelines,
+                                                           ((createInfoCount)));
+    }
+    VkResult vkCreateRayTracingPipelinesKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkCreateRayTracingPipelinesKHR_VkResult_return, sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkCreateRayTracingPipelinesKHR_VkResult_return;
+}
+
+VkResult VkEncoder::vkGetRayTracingCaptureReplayShaderGroupHandlesKHR(
+    VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize,
+    void* pData, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor,
+                         "vkGetRayTracingCaptureReplayShaderGroupHandlesKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkGetRayTracingCaptureReplayShaderGroupHandlesKHR(device:%p, pipeline:%p, firstGroup:%d, "
+        "groupCount:%d, dataSize:%ld, pData:%p)",
+        device, pipeline, firstGroup, groupCount, dataSize, pData);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkPipeline local_pipeline;
+    uint32_t local_firstGroup;
+    uint32_t local_groupCount;
+    size_t local_dataSize;
+    local_device = device;
+    local_pipeline = pipeline;
+    local_firstGroup = firstGroup;
+    local_groupCount = groupCount;
+    local_dataSize = dataSize;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(uint32_t);
+        *countPtr += 8;
+        *countPtr += ((dataSize)) * sizeof(uint8_t);
+    }
+    uint32_t packetSize_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR);
+    uint8_t* streamPtr =
+        stream->reserve(packetSize_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR =
+        OP_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR,
+           sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkPipeline((*&local_pipeline));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_firstGroup, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (uint32_t*)&local_groupCount, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    uint64_t cgen_var_2 = (uint64_t)local_dataSize;
+    memcpy((*streamPtrPtr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*streamPtrPtr));
+    *streamPtrPtr += 8;
+    memcpy(*streamPtrPtr, (void*)pData, ((dataSize)) * sizeof(uint8_t));
+    *streamPtrPtr += ((dataSize)) * sizeof(uint8_t);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR),
+            kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    stream->read((void*)pData, ((dataSize)) * sizeof(uint8_t));
+    VkResult vkGetRayTracingCaptureReplayShaderGroupHandlesKHR_VkResult_return = (VkResult)0;
+    stream->read(&vkGetRayTracingCaptureReplayShaderGroupHandlesKHR_VkResult_return,
+                 sizeof(VkResult));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetRayTracingCaptureReplayShaderGroupHandlesKHR_VkResult_return;
+}
+
+void VkEncoder::vkCmdTraceRaysIndirectKHR(
+    VkCommandBuffer commandBuffer, const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable,
+    const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable,
+    const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable,
+    const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable,
+    VkDeviceAddress indirectDeviceAddress, uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdTraceRaysIndirectKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdTraceRaysIndirectKHR(commandBuffer:%p, pRaygenShaderBindingTable:%p, "
+        "pMissShaderBindingTable:%p, pHitShaderBindingTable:%p, pCallableShaderBindingTable:%p)",
+        commandBuffer, pRaygenShaderBindingTable, pMissShaderBindingTable, pHitShaderBindingTable,
+        pCallableShaderBindingTable);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    VkStridedDeviceAddressRegionKHR* local_pRaygenShaderBindingTable;
+    VkStridedDeviceAddressRegionKHR* local_pMissShaderBindingTable;
+    VkStridedDeviceAddressRegionKHR* local_pHitShaderBindingTable;
+    VkStridedDeviceAddressRegionKHR* local_pCallableShaderBindingTable;
+    VkDeviceAddress local_indirectDeviceAddress;
+    local_commandBuffer = commandBuffer;
+    local_pRaygenShaderBindingTable = nullptr;
+    if (pRaygenShaderBindingTable) {
+        local_pRaygenShaderBindingTable = (VkStridedDeviceAddressRegionKHR*)pool->alloc(
+            sizeof(const VkStridedDeviceAddressRegionKHR));
+        deepcopy_VkStridedDeviceAddressRegionKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pRaygenShaderBindingTable,
+            (VkStridedDeviceAddressRegionKHR*)(local_pRaygenShaderBindingTable));
+    }
+    local_pMissShaderBindingTable = nullptr;
+    if (pMissShaderBindingTable) {
+        local_pMissShaderBindingTable = (VkStridedDeviceAddressRegionKHR*)pool->alloc(
+            sizeof(const VkStridedDeviceAddressRegionKHR));
+        deepcopy_VkStridedDeviceAddressRegionKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pMissShaderBindingTable,
+            (VkStridedDeviceAddressRegionKHR*)(local_pMissShaderBindingTable));
+    }
+    local_pHitShaderBindingTable = nullptr;
+    if (pHitShaderBindingTable) {
+        local_pHitShaderBindingTable = (VkStridedDeviceAddressRegionKHR*)pool->alloc(
+            sizeof(const VkStridedDeviceAddressRegionKHR));
+        deepcopy_VkStridedDeviceAddressRegionKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pHitShaderBindingTable,
+            (VkStridedDeviceAddressRegionKHR*)(local_pHitShaderBindingTable));
+    }
+    local_pCallableShaderBindingTable = nullptr;
+    if (pCallableShaderBindingTable) {
+        local_pCallableShaderBindingTable = (VkStridedDeviceAddressRegionKHR*)pool->alloc(
+            sizeof(const VkStridedDeviceAddressRegionKHR));
+        deepcopy_VkStridedDeviceAddressRegionKHR(
+            pool, VK_STRUCTURE_TYPE_MAX_ENUM, pCallableShaderBindingTable,
+            (VkStridedDeviceAddressRegionKHR*)(local_pCallableShaderBindingTable));
+    }
+    local_indirectDeviceAddress = indirectDeviceAddress;
+    if (local_pRaygenShaderBindingTable) {
+        transform_tohost_VkStridedDeviceAddressRegionKHR(
+            sResourceTracker, (VkStridedDeviceAddressRegionKHR*)(local_pRaygenShaderBindingTable));
+    }
+    if (local_pMissShaderBindingTable) {
+        transform_tohost_VkStridedDeviceAddressRegionKHR(
+            sResourceTracker, (VkStridedDeviceAddressRegionKHR*)(local_pMissShaderBindingTable));
+    }
+    if (local_pHitShaderBindingTable) {
+        transform_tohost_VkStridedDeviceAddressRegionKHR(
+            sResourceTracker, (VkStridedDeviceAddressRegionKHR*)(local_pHitShaderBindingTable));
+    }
+    if (local_pCallableShaderBindingTable) {
+        transform_tohost_VkStridedDeviceAddressRegionKHR(
+            sResourceTracker,
+            (VkStridedDeviceAddressRegionKHR*)(local_pCallableShaderBindingTable));
+    }
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        count_VkStridedDeviceAddressRegionKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkStridedDeviceAddressRegionKHR*)(local_pRaygenShaderBindingTable), countPtr);
+        count_VkStridedDeviceAddressRegionKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkStridedDeviceAddressRegionKHR*)(local_pMissShaderBindingTable), countPtr);
+        count_VkStridedDeviceAddressRegionKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkStridedDeviceAddressRegionKHR*)(local_pHitShaderBindingTable), countPtr);
+        count_VkStridedDeviceAddressRegionKHR(
+            sFeatureBits, VK_STRUCTURE_TYPE_MAX_ENUM,
+            (VkStridedDeviceAddressRegionKHR*)(local_pCallableShaderBindingTable), countPtr);
+        *countPtr += sizeof(VkDeviceAddress);
+    }
+    uint32_t packetSize_vkCmdTraceRaysIndirectKHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize = std::make_optional(packetSize_vkCmdTraceRaysIndirectKHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdTraceRaysIndirectKHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdTraceRaysIndirectKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdTraceRaysIndirectKHR = OP_vkCmdTraceRaysIndirectKHR;
+    memcpy(streamPtr, &opcode_vkCmdTraceRaysIndirectKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdTraceRaysIndirectKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    reservedmarshal_VkStridedDeviceAddressRegionKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkStridedDeviceAddressRegionKHR*)(local_pRaygenShaderBindingTable), streamPtrPtr);
+    reservedmarshal_VkStridedDeviceAddressRegionKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkStridedDeviceAddressRegionKHR*)(local_pMissShaderBindingTable), streamPtrPtr);
+    reservedmarshal_VkStridedDeviceAddressRegionKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkStridedDeviceAddressRegionKHR*)(local_pHitShaderBindingTable), streamPtrPtr);
+    reservedmarshal_VkStridedDeviceAddressRegionKHR(
+        stream, VK_STRUCTURE_TYPE_MAX_ENUM,
+        (VkStridedDeviceAddressRegionKHR*)(local_pCallableShaderBindingTable), streamPtrPtr);
+    memcpy(*streamPtrPtr, (VkDeviceAddress*)&local_indirectDeviceAddress, sizeof(VkDeviceAddress));
+    *streamPtrPtr += sizeof(VkDeviceAddress);
+    if (watchdog) {
+        size_t watchdogBufSize = std::min<size_t>(
+            static_cast<size_t>(packetSize_vkCmdTraceRaysIndirectKHR), kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+VkDeviceSize VkEncoder::vkGetRayTracingShaderGroupStackSizeKHR(VkDevice device, VkPipeline pipeline,
+                                                               uint32_t group,
+                                                               VkShaderGroupShaderKHR groupShader,
+                                                               uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkGetRayTracingShaderGroupStackSizeKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG("vkGetRayTracingShaderGroupStackSizeKHR(device:%p, pipeline:%p, group:%d)",
+                      device, pipeline, group);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkDevice local_device;
+    VkPipeline local_pipeline;
+    uint32_t local_group;
+    VkShaderGroupShaderKHR local_groupShader;
+    local_device = device;
+    local_pipeline = pipeline;
+    local_group = group;
+    local_groupShader = groupShader;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        uint64_t cgen_var_1;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+        *countPtr += sizeof(VkShaderGroupShaderKHR);
+    }
+    uint32_t packetSize_vkGetRayTracingShaderGroupStackSizeKHR =
+        4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkGetRayTracingShaderGroupStackSizeKHR);
+    uint8_t* streamPtr = stream->reserve(packetSize_vkGetRayTracingShaderGroupStackSizeKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkGetRayTracingShaderGroupStackSizeKHR =
+        OP_vkGetRayTracingShaderGroupStackSizeKHR;
+    uint32_t seqno;
+    if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno();
+    healthMonitorAnnotation_seqno = std::make_optional(seqno);
+    memcpy(streamPtr, &opcode_vkGetRayTracingShaderGroupStackSizeKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkGetRayTracingShaderGroupStackSizeKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (queueSubmitWithCommandsEnabled) {
+        memcpy(streamPtr, &seqno, sizeof(uint32_t));
+        streamPtr += sizeof(uint32_t);
+    }
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDevice((*&local_device));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkPipeline((*&local_pipeline));
+    memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *streamPtrPtr += 1 * 8;
+    memcpy(*streamPtrPtr, (uint32_t*)&local_group, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    memcpy(*streamPtrPtr, (VkShaderGroupShaderKHR*)&local_groupShader,
+           sizeof(VkShaderGroupShaderKHR));
+    *streamPtrPtr += sizeof(VkShaderGroupShaderKHR);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkGetRayTracingShaderGroupStackSizeKHR),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    VkDeviceSize vkGetRayTracingShaderGroupStackSizeKHR_VkDeviceSize_return = (VkDeviceSize)0;
+    stream->read(&vkGetRayTracingShaderGroupStackSizeKHR_VkDeviceSize_return, sizeof(VkDeviceSize));
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+    return vkGetRayTracingShaderGroupStackSizeKHR_VkDeviceSize_return;
+}
+
+void VkEncoder::vkCmdSetRayTracingPipelineStackSizeKHR(VkCommandBuffer commandBuffer,
+                                                       uint32_t pipelineStackSize,
+                                                       uint32_t doLock) {
+    std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt;
+    std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt;
+    std::vector<uint8_t> healthMonitorAnnotation_packetContents;
+
+    auto watchdog =
+        WATCHDOG_BUILDER(mHealthMonitor, "vkCmdSetRayTracingPipelineStackSizeKHR in VkEncoder")
+            .setOnHangCallback([&]() {
+                auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+                if (healthMonitorAnnotation_seqno) {
+                    annotations->insert(
+                        {{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+                }
+                if (healthMonitorAnnotation_packetSize) {
+                    annotations->insert(
+                        {{"packetSize",
+                          std::to_string(healthMonitorAnnotation_packetSize.value())}});
+                }
+                if (!healthMonitorAnnotation_packetContents.empty()) {
+                    annotations->insert(
+                        {{"packetContents",
+                          getPacketContents(&healthMonitorAnnotation_packetContents[0],
+                                            healthMonitorAnnotation_packetContents.size())}});
+                }
+                return std::move(annotations);
+            })
+            .build();
+
+    ENCODER_DEBUG_LOG(
+        "vkCmdSetRayTracingPipelineStackSizeKHR(commandBuffer:%p, pipelineStackSize:%d)",
+        commandBuffer, pipelineStackSize);
+    (void)doLock;
+    bool queueSubmitWithCommandsEnabled =
+        sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+    if (!queueSubmitWithCommandsEnabled && doLock) this->lock();
+    auto stream = mImpl->stream();
+    auto pool = mImpl->pool();
+    VkCommandBuffer local_commandBuffer;
+    uint32_t local_pipelineStackSize;
+    local_commandBuffer = commandBuffer;
+    local_pipelineStackSize = pipelineStackSize;
+    size_t count = 0;
+    size_t* countPtr = &count;
+    {
+        uint64_t cgen_var_0;
+        *countPtr += 1 * 8;
+        *countPtr += sizeof(uint32_t);
+    }
+    uint32_t packetSize_vkCmdSetRayTracingPipelineStackSizeKHR = 4 + 4 + count;
+    healthMonitorAnnotation_packetSize =
+        std::make_optional(packetSize_vkCmdSetRayTracingPipelineStackSizeKHR);
+    if (queueSubmitWithCommandsEnabled) packetSize_vkCmdSetRayTracingPipelineStackSizeKHR -= 8;
+    uint8_t* streamPtr = stream->reserve(packetSize_vkCmdSetRayTracingPipelineStackSizeKHR);
+    uint8_t* packetBeginPtr = streamPtr;
+    uint8_t** streamPtrPtr = &streamPtr;
+    uint32_t opcode_vkCmdSetRayTracingPipelineStackSizeKHR =
+        OP_vkCmdSetRayTracingPipelineStackSizeKHR;
+    memcpy(streamPtr, &opcode_vkCmdSetRayTracingPipelineStackSizeKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    memcpy(streamPtr, &packetSize_vkCmdSetRayTracingPipelineStackSizeKHR, sizeof(uint32_t));
+    streamPtr += sizeof(uint32_t);
+    if (!queueSubmitWithCommandsEnabled) {
+        uint64_t cgen_var_0;
+        *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+        memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_0, 1 * 8);
+        *streamPtrPtr += 1 * 8;
+    }
+    memcpy(*streamPtrPtr, (uint32_t*)&local_pipelineStackSize, sizeof(uint32_t));
+    *streamPtrPtr += sizeof(uint32_t);
+    if (watchdog) {
+        size_t watchdogBufSize =
+            std::min<size_t>(static_cast<size_t>(packetSize_vkCmdSetRayTracingPipelineStackSizeKHR),
+                             kWatchdogBufferMax);
+        healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+        memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+    }
+    ++encodeCount;
+    ;
+    if (0 == encodeCount % POOL_CLEAR_INTERVAL) {
+        pool->freeAll();
+        stream->clearPool();
+    }
+    if (!queueSubmitWithCommandsEnabled && doLock) this->unlock();
+}
+
+#endif
+#ifdef VK_KHR_ray_query
+#endif
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/VkEncoder.cpp.inl b/system/vulkan_enc/VkEncoder.cpp.inl
new file mode 100644
index 0000000..97bc869
--- /dev/null
+++ b/system/vulkan_enc/VkEncoder.cpp.inl
@@ -0,0 +1,90 @@
+static ResourceTracker* sResourceTracker = nullptr;
+static uint32_t sFeatureBits = 0;
+static constexpr uint32_t kWatchdogBufferMax = 1'000;
+
+class VkEncoder::Impl {
+   public:
+    Impl(IOStream* stream) : m_stream(stream), m_logEncodes(false) {
+        if (!sResourceTracker) sResourceTracker = ResourceTracker::get();
+        m_stream.incStreamRef();
+        const char* emuVkLogEncodesPropName = "qemu.vk.log";
+        char encodeProp[PROPERTY_VALUE_MAX];
+        if (property_get(emuVkLogEncodesPropName, encodeProp, nullptr) > 0) {
+            m_logEncodes = atoi(encodeProp) > 0;
+        }
+        sFeatureBits = m_stream.getFeatureBits();
+    }
+
+    ~Impl() { m_stream.decStreamRef(); }
+
+    VulkanCountingStream* countingStream() { return &m_countingStream; }
+    VulkanStreamGuest* stream() { return &m_stream; }
+    BumpPool* pool() { return &m_pool; }
+    ResourceTracker* resources() { return ResourceTracker::get(); }
+    Validation* validation() { return &m_validation; }
+
+    void log(const char* text) {
+        if (!m_logEncodes) return;
+        ALOGD("encoder log: %s", text);
+    }
+
+    void flush() {
+        lock();
+        m_stream.flush();
+        unlock();
+    }
+
+    // can be recursive
+    void lock() {
+        while (mLock.test_and_set(std::memory_order_acquire))
+            ;
+    }
+
+    void unlock() { mLock.clear(std::memory_order_release); }
+
+   private:
+    VulkanCountingStream m_countingStream;
+    VulkanStreamGuest m_stream;
+    BumpPool m_pool;
+
+    Validation m_validation;
+    bool m_logEncodes;
+    std::atomic_flag mLock = ATOMIC_FLAG_INIT;
+};
+
+VkEncoder::~VkEncoder() {}
+
+struct EncoderAutoLock {
+    EncoderAutoLock(VkEncoder* enc) : mEnc(enc) { mEnc->lock(); }
+    ~EncoderAutoLock() { mEnc->unlock(); }
+    VkEncoder* mEnc;
+};
+
+VkEncoder::VkEncoder(IOStream* stream, android::base::guest::HealthMonitor<>* healthMonitor)
+    : mImpl(new VkEncoder::Impl(stream)), mHealthMonitor(healthMonitor) {}
+
+void VkEncoder::flush() { mImpl->flush(); }
+
+void VkEncoder::lock() { mImpl->lock(); }
+
+void VkEncoder::unlock() { mImpl->unlock(); }
+
+void VkEncoder::incRef() { __atomic_add_fetch(&refCount, 1, __ATOMIC_SEQ_CST); }
+
+bool VkEncoder::decRef() {
+    if (0 == __atomic_sub_fetch(&refCount, 1, __ATOMIC_SEQ_CST)) {
+        delete this;
+        return true;
+    }
+    return false;
+}
+
+std::string VkEncoder::getPacketContents(const uint8_t* ptr, size_t len) {
+  std::string result;
+  std::unique_ptr<char[]> buf(new char[3]);
+  for (size_t i = 0; i < len; i++) {
+    std::snprintf(buf.get(), 3, "%02X", ptr[i]);
+    result += " " + std::string(buf.get(), buf.get() + 2);
+  }
+  return result;
+}
diff --git a/system/vulkan_enc/VkEncoder.h b/system/vulkan_enc/VkEncoder.h
new file mode 100644
index 0000000..c09fa8b
--- /dev/null
+++ b/system/vulkan_enc/VkEncoder.h
@@ -0,0 +1,2158 @@
+// Copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2018 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Autogenerated module VkEncoder
+//
+// (header) generated by codegen/vulkan/scripts/genvk.py -registry codegen/vulkan/xml/vk.xml cereal
+// -o host/vulkan/cereal
+//
+// Please do not modify directly;
+// re-run gfxstream-protocols/scripts/generate-vulkan-sources.sh,
+// or directly from Python by defining:
+// VULKAN_REGISTRY_XML_DIR : Directory containing vk.xml
+// VULKAN_REGISTRY_SCRIPTS_DIR : Directory containing genvk.py
+// CEREAL_OUTPUT_DIR: Where to put the generated sources.
+//
+// python3 $VULKAN_REGISTRY_SCRIPTS_DIR/genvk.py -registry $VULKAN_REGISTRY_XML_DIR/vk.xml cereal -o
+// $CEREAL_OUTPUT_DIR
+//
+#pragma once
+#include <vulkan/vulkan.h>
+
+#include <memory>
+
+#include "aemu/base/AndroidHealthMonitor.h"
+#include "goldfish_vk_private_defs.h"
+#include "vulkan_gfxstream.h"
+
+namespace gfxstream {
+class IOStream;
+}
+
+namespace gfxstream {
+namespace vk {
+
+using android::base::guest::HealthMonitor;
+
+class VkEncoder {
+   public:
+    VkEncoder(IOStream* stream, HealthMonitor<>* healthMonitor = nullptr);
+    ~VkEncoder();
+
+#include "VkEncoder.h.inl"
+#ifdef VK_VERSION_1_0
+    VkResult vkCreateInstance(const VkInstanceCreateInfo* pCreateInfo,
+                              const VkAllocationCallbacks* pAllocator, VkInstance* pInstance,
+                              uint32_t doLock);
+    void vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks* pAllocator,
+                           uint32_t doLock);
+    VkResult vkEnumeratePhysicalDevices(VkInstance instance, uint32_t* pPhysicalDeviceCount,
+                                        VkPhysicalDevice* pPhysicalDevices, uint32_t doLock);
+    void vkGetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice,
+                                     VkPhysicalDeviceFeatures* pFeatures, uint32_t doLock);
+    void vkGetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format,
+                                             VkFormatProperties* pFormatProperties,
+                                             uint32_t doLock);
+    VkResult vkGetPhysicalDeviceImageFormatProperties(
+        VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling,
+        VkImageUsageFlags usage, VkImageCreateFlags flags,
+        VkImageFormatProperties* pImageFormatProperties, uint32_t doLock);
+    void vkGetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice,
+                                       VkPhysicalDeviceProperties* pProperties, uint32_t doLock);
+    void vkGetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice,
+                                                  uint32_t* pQueueFamilyPropertyCount,
+                                                  VkQueueFamilyProperties* pQueueFamilyProperties,
+                                                  uint32_t doLock);
+    void vkGetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice,
+                                             VkPhysicalDeviceMemoryProperties* pMemoryProperties,
+                                             uint32_t doLock);
+    PFN_vkVoidFunction vkGetInstanceProcAddr(VkInstance instance, const char* pName,
+                                             uint32_t doLock);
+    PFN_vkVoidFunction vkGetDeviceProcAddr(VkDevice device, const char* pName, uint32_t doLock);
+    VkResult vkCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo,
+                            const VkAllocationCallbacks* pAllocator, VkDevice* pDevice,
+                            uint32_t doLock);
+    void vkDestroyDevice(VkDevice device, const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    VkResult vkEnumerateInstanceExtensionProperties(const char* pLayerName,
+                                                    uint32_t* pPropertyCount,
+                                                    VkExtensionProperties* pProperties,
+                                                    uint32_t doLock);
+    VkResult vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice,
+                                                  const char* pLayerName, uint32_t* pPropertyCount,
+                                                  VkExtensionProperties* pProperties,
+                                                  uint32_t doLock);
+    VkResult vkEnumerateInstanceLayerProperties(uint32_t* pPropertyCount,
+                                                VkLayerProperties* pProperties, uint32_t doLock);
+    VkResult vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice,
+                                              uint32_t* pPropertyCount,
+                                              VkLayerProperties* pProperties, uint32_t doLock);
+    void vkGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex,
+                          VkQueue* pQueue, uint32_t doLock);
+    VkResult vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits,
+                           VkFence fence, uint32_t doLock);
+    VkResult vkQueueWaitIdle(VkQueue queue, uint32_t doLock);
+    VkResult vkDeviceWaitIdle(VkDevice device, uint32_t doLock);
+    VkResult vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo,
+                              const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory,
+                              uint32_t doLock);
+    void vkFreeMemory(VkDevice device, VkDeviceMemory memory,
+                      const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    VkResult vkMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset,
+                         VkDeviceSize size, VkMemoryMapFlags flags, void** ppData, uint32_t doLock);
+    void vkUnmapMemory(VkDevice device, VkDeviceMemory memory, uint32_t doLock);
+    VkResult vkFlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount,
+                                       const VkMappedMemoryRange* pMemoryRanges, uint32_t doLock);
+    VkResult vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount,
+                                            const VkMappedMemoryRange* pMemoryRanges,
+                                            uint32_t doLock);
+    void vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory,
+                                     VkDeviceSize* pCommittedMemoryInBytes, uint32_t doLock);
+    VkResult vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory memory,
+                                VkDeviceSize memoryOffset, uint32_t doLock);
+    VkResult vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory memory,
+                               VkDeviceSize memoryOffset, uint32_t doLock);
+    void vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer,
+                                       VkMemoryRequirements* pMemoryRequirements, uint32_t doLock);
+    void vkGetImageMemoryRequirements(VkDevice device, VkImage image,
+                                      VkMemoryRequirements* pMemoryRequirements, uint32_t doLock);
+    void vkGetImageSparseMemoryRequirements(
+        VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount,
+        VkSparseImageMemoryRequirements* pSparseMemoryRequirements, uint32_t doLock);
+    void vkGetPhysicalDeviceSparseImageFormatProperties(
+        VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type,
+        VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling,
+        uint32_t* pPropertyCount, VkSparseImageFormatProperties* pProperties, uint32_t doLock);
+    VkResult vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCount,
+                               const VkBindSparseInfo* pBindInfo, VkFence fence, uint32_t doLock);
+    VkResult vkCreateFence(VkDevice device, const VkFenceCreateInfo* pCreateInfo,
+                           const VkAllocationCallbacks* pAllocator, VkFence* pFence,
+                           uint32_t doLock);
+    void vkDestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks* pAllocator,
+                        uint32_t doLock);
+    VkResult vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences,
+                           uint32_t doLock);
+    VkResult vkGetFenceStatus(VkDevice device, VkFence fence, uint32_t doLock);
+    VkResult vkWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences,
+                             VkBool32 waitAll, uint64_t timeout, uint32_t doLock);
+    VkResult vkCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo,
+                               const VkAllocationCallbacks* pAllocator, VkSemaphore* pSemaphore,
+                               uint32_t doLock);
+    void vkDestroySemaphore(VkDevice device, VkSemaphore semaphore,
+                            const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    VkResult vkCreateEvent(VkDevice device, const VkEventCreateInfo* pCreateInfo,
+                           const VkAllocationCallbacks* pAllocator, VkEvent* pEvent,
+                           uint32_t doLock);
+    void vkDestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks* pAllocator,
+                        uint32_t doLock);
+    VkResult vkGetEventStatus(VkDevice device, VkEvent event, uint32_t doLock);
+    VkResult vkSetEvent(VkDevice device, VkEvent event, uint32_t doLock);
+    VkResult vkResetEvent(VkDevice device, VkEvent event, uint32_t doLock);
+    VkResult vkCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo,
+                               const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool,
+                               uint32_t doLock);
+    void vkDestroyQueryPool(VkDevice device, VkQueryPool queryPool,
+                            const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    VkResult vkGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery,
+                                   uint32_t queryCount, size_t dataSize, void* pData,
+                                   VkDeviceSize stride, VkQueryResultFlags flags, uint32_t doLock);
+    VkResult vkCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo,
+                            const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer,
+                            uint32_t doLock);
+    void vkDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator,
+                         uint32_t doLock);
+    VkResult vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo,
+                                const VkAllocationCallbacks* pAllocator, VkBufferView* pView,
+                                uint32_t doLock);
+    void vkDestroyBufferView(VkDevice device, VkBufferView bufferView,
+                             const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    VkResult vkCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo,
+                           const VkAllocationCallbacks* pAllocator, VkImage* pImage,
+                           uint32_t doLock);
+    void vkDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator,
+                        uint32_t doLock);
+    void vkGetImageSubresourceLayout(VkDevice device, VkImage image,
+                                     const VkImageSubresource* pSubresource,
+                                     VkSubresourceLayout* pLayout, uint32_t doLock);
+    VkResult vkCreateImageView(VkDevice device, const VkImageViewCreateInfo* pCreateInfo,
+                               const VkAllocationCallbacks* pAllocator, VkImageView* pView,
+                               uint32_t doLock);
+    void vkDestroyImageView(VkDevice device, VkImageView imageView,
+                            const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    VkResult vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo,
+                                  const VkAllocationCallbacks* pAllocator,
+                                  VkShaderModule* pShaderModule, uint32_t doLock);
+    void vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule,
+                               const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    VkResult vkCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo,
+                                   const VkAllocationCallbacks* pAllocator,
+                                   VkPipelineCache* pPipelineCache, uint32_t doLock);
+    void vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache,
+                                const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    VkResult vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache,
+                                    size_t* pDataSize, void* pData, uint32_t doLock);
+    VkResult vkMergePipelineCaches(VkDevice device, VkPipelineCache dstCache,
+                                   uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches,
+                                   uint32_t doLock);
+    VkResult vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache,
+                                       uint32_t createInfoCount,
+                                       const VkGraphicsPipelineCreateInfo* pCreateInfos,
+                                       const VkAllocationCallbacks* pAllocator,
+                                       VkPipeline* pPipelines, uint32_t doLock);
+    VkResult vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache,
+                                      uint32_t createInfoCount,
+                                      const VkComputePipelineCreateInfo* pCreateInfos,
+                                      const VkAllocationCallbacks* pAllocator,
+                                      VkPipeline* pPipelines, uint32_t doLock);
+    void vkDestroyPipeline(VkDevice device, VkPipeline pipeline,
+                           const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    VkResult vkCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo,
+                                    const VkAllocationCallbacks* pAllocator,
+                                    VkPipelineLayout* pPipelineLayout, uint32_t doLock);
+    void vkDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout,
+                                 const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    VkResult vkCreateSampler(VkDevice device, const VkSamplerCreateInfo* pCreateInfo,
+                             const VkAllocationCallbacks* pAllocator, VkSampler* pSampler,
+                             uint32_t doLock);
+    void vkDestroySampler(VkDevice device, VkSampler sampler,
+                          const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    VkResult vkCreateDescriptorSetLayout(VkDevice device,
+                                         const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
+                                         const VkAllocationCallbacks* pAllocator,
+                                         VkDescriptorSetLayout* pSetLayout, uint32_t doLock);
+    void vkDestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout,
+                                      const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    VkResult vkCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo,
+                                    const VkAllocationCallbacks* pAllocator,
+                                    VkDescriptorPool* pDescriptorPool, uint32_t doLock);
+    void vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool,
+                                 const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    VkResult vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool,
+                                   VkDescriptorPoolResetFlags flags, uint32_t doLock);
+    VkResult vkAllocateDescriptorSets(VkDevice device,
+                                      const VkDescriptorSetAllocateInfo* pAllocateInfo,
+                                      VkDescriptorSet* pDescriptorSets, uint32_t doLock);
+    VkResult vkFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool,
+                                  uint32_t descriptorSetCount,
+                                  const VkDescriptorSet* pDescriptorSets, uint32_t doLock);
+    void vkUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount,
+                                const VkWriteDescriptorSet* pDescriptorWrites,
+                                uint32_t descriptorCopyCount,
+                                const VkCopyDescriptorSet* pDescriptorCopies, uint32_t doLock);
+    VkResult vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo,
+                                 const VkAllocationCallbacks* pAllocator,
+                                 VkFramebuffer* pFramebuffer, uint32_t doLock);
+    void vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer,
+                              const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    VkResult vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo,
+                                const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass,
+                                uint32_t doLock);
+    void vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass,
+                             const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    void vkGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass,
+                                    VkExtent2D* pGranularity, uint32_t doLock);
+    VkResult vkCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo,
+                                 const VkAllocationCallbacks* pAllocator,
+                                 VkCommandPool* pCommandPool, uint32_t doLock);
+    void vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool,
+                              const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    VkResult vkResetCommandPool(VkDevice device, VkCommandPool commandPool,
+                                VkCommandPoolResetFlags flags, uint32_t doLock);
+    VkResult vkAllocateCommandBuffers(VkDevice device,
+                                      const VkCommandBufferAllocateInfo* pAllocateInfo,
+                                      VkCommandBuffer* pCommandBuffers, uint32_t doLock);
+    void vkFreeCommandBuffers(VkDevice device, VkCommandPool commandPool,
+                              uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers,
+                              uint32_t doLock);
+    VkResult vkBeginCommandBuffer(VkCommandBuffer commandBuffer,
+                                  const VkCommandBufferBeginInfo* pBeginInfo, uint32_t doLock);
+    VkResult vkEndCommandBuffer(VkCommandBuffer commandBuffer, uint32_t doLock);
+    VkResult vkResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags,
+                                  uint32_t doLock);
+    void vkCmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint,
+                           VkPipeline pipeline, uint32_t doLock);
+    void vkCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport,
+                          uint32_t viewportCount, const VkViewport* pViewports, uint32_t doLock);
+    void vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor,
+                         uint32_t scissorCount, const VkRect2D* pScissors, uint32_t doLock);
+    void vkCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth, uint32_t doLock);
+    void vkCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor,
+                           float depthBiasClamp, float depthBiasSlopeFactor, uint32_t doLock);
+    void vkCmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4],
+                                uint32_t doLock);
+    void vkCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds,
+                             float maxDepthBounds, uint32_t doLock);
+    void vkCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask,
+                                    uint32_t compareMask, uint32_t doLock);
+    void vkCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask,
+                                  uint32_t writeMask, uint32_t doLock);
+    void vkCmdSetStencilReference(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask,
+                                  uint32_t reference, uint32_t doLock);
+    void vkCmdBindDescriptorSets(VkCommandBuffer commandBuffer,
+                                 VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout,
+                                 uint32_t firstSet, uint32_t descriptorSetCount,
+                                 const VkDescriptorSet* pDescriptorSets,
+                                 uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets,
+                                 uint32_t doLock);
+    void vkCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset,
+                              VkIndexType indexType, uint32_t doLock);
+    void vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding,
+                                uint32_t bindingCount, const VkBuffer* pBuffers,
+                                const VkDeviceSize* pOffsets, uint32_t doLock);
+    void vkCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount,
+                   uint32_t firstVertex, uint32_t firstInstance, uint32_t doLock);
+    void vkCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount,
+                          uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset,
+                          uint32_t firstInstance, uint32_t doLock);
+    void vkCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset,
+                           uint32_t drawCount, uint32_t stride, uint32_t doLock);
+    void vkCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                  VkDeviceSize offset, uint32_t drawCount, uint32_t stride,
+                                  uint32_t doLock);
+    void vkCmdDispatch(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY,
+                       uint32_t groupCountZ, uint32_t doLock);
+    void vkCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset,
+                               uint32_t doLock);
+    void vkCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer,
+                         uint32_t regionCount, const VkBufferCopy* pRegions, uint32_t doLock);
+    void vkCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage,
+                        VkImageLayout srcImageLayout, VkImage dstImage,
+                        VkImageLayout dstImageLayout, uint32_t regionCount,
+                        const VkImageCopy* pRegions, uint32_t doLock);
+    void vkCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage,
+                        VkImageLayout srcImageLayout, VkImage dstImage,
+                        VkImageLayout dstImageLayout, uint32_t regionCount,
+                        const VkImageBlit* pRegions, VkFilter filter, uint32_t doLock);
+    void vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage,
+                                VkImageLayout dstImageLayout, uint32_t regionCount,
+                                const VkBufferImageCopy* pRegions, uint32_t doLock);
+    void vkCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage,
+                                VkImageLayout srcImageLayout, VkBuffer dstBuffer,
+                                uint32_t regionCount, const VkBufferImageCopy* pRegions,
+                                uint32_t doLock);
+    void vkCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer,
+                           VkDeviceSize dstOffset, VkDeviceSize dataSize, const void* pData,
+                           uint32_t doLock);
+    void vkCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset,
+                         VkDeviceSize size, uint32_t data, uint32_t doLock);
+    void vkCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image,
+                              VkImageLayout imageLayout, const VkClearColorValue* pColor,
+                              uint32_t rangeCount, const VkImageSubresourceRange* pRanges,
+                              uint32_t doLock);
+    void vkCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image,
+                                     VkImageLayout imageLayout,
+                                     const VkClearDepthStencilValue* pDepthStencil,
+                                     uint32_t rangeCount, const VkImageSubresourceRange* pRanges,
+                                     uint32_t doLock);
+    void vkCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount,
+                               const VkClearAttachment* pAttachments, uint32_t rectCount,
+                               const VkClearRect* pRects, uint32_t doLock);
+    void vkCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage,
+                           VkImageLayout srcImageLayout, VkImage dstImage,
+                           VkImageLayout dstImageLayout, uint32_t regionCount,
+                           const VkImageResolve* pRegions, uint32_t doLock);
+    void vkCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask,
+                       uint32_t doLock);
+    void vkCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event,
+                         VkPipelineStageFlags stageMask, uint32_t doLock);
+    void vkCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents,
+                         VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask,
+                         uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers,
+                         uint32_t bufferMemoryBarrierCount,
+                         const VkBufferMemoryBarrier* pBufferMemoryBarriers,
+                         uint32_t imageMemoryBarrierCount,
+                         const VkImageMemoryBarrier* pImageMemoryBarriers, uint32_t doLock);
+    void vkCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask,
+                              VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags,
+                              uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers,
+                              uint32_t bufferMemoryBarrierCount,
+                              const VkBufferMemoryBarrier* pBufferMemoryBarriers,
+                              uint32_t imageMemoryBarrierCount,
+                              const VkImageMemoryBarrier* pImageMemoryBarriers, uint32_t doLock);
+    void vkCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query,
+                         VkQueryControlFlags flags, uint32_t doLock);
+    void vkCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query,
+                       uint32_t doLock);
+    void vkCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool,
+                             uint32_t firstQuery, uint32_t queryCount, uint32_t doLock);
+    void vkCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage,
+                             VkQueryPool queryPool, uint32_t query, uint32_t doLock);
+    void vkCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool,
+                                   uint32_t firstQuery, uint32_t queryCount, VkBuffer dstBuffer,
+                                   VkDeviceSize dstOffset, VkDeviceSize stride,
+                                   VkQueryResultFlags flags, uint32_t doLock);
+    void vkCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout,
+                            VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size,
+                            const void* pValues, uint32_t doLock);
+    void vkCmdBeginRenderPass(VkCommandBuffer commandBuffer,
+                              const VkRenderPassBeginInfo* pRenderPassBegin,
+                              VkSubpassContents contents, uint32_t doLock);
+    void vkCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents,
+                          uint32_t doLock);
+    void vkCmdEndRenderPass(VkCommandBuffer commandBuffer, uint32_t doLock);
+    void vkCmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBufferCount,
+                              const VkCommandBuffer* pCommandBuffers, uint32_t doLock);
+#endif
+#ifdef VK_VERSION_1_1
+    VkResult vkEnumerateInstanceVersion(uint32_t* pApiVersion, uint32_t doLock);
+    VkResult vkBindBufferMemory2(VkDevice device, uint32_t bindInfoCount,
+                                 const VkBindBufferMemoryInfo* pBindInfos, uint32_t doLock);
+    VkResult vkBindImageMemory2(VkDevice device, uint32_t bindInfoCount,
+                                const VkBindImageMemoryInfo* pBindInfos, uint32_t doLock);
+    void vkGetDeviceGroupPeerMemoryFeatures(VkDevice device, uint32_t heapIndex,
+                                            uint32_t localDeviceIndex, uint32_t remoteDeviceIndex,
+                                            VkPeerMemoryFeatureFlags* pPeerMemoryFeatures,
+                                            uint32_t doLock);
+    void vkCmdSetDeviceMask(VkCommandBuffer commandBuffer, uint32_t deviceMask, uint32_t doLock);
+    void vkCmdDispatchBase(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY,
+                           uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY,
+                           uint32_t groupCountZ, uint32_t doLock);
+    VkResult vkEnumeratePhysicalDeviceGroups(
+        VkInstance instance, uint32_t* pPhysicalDeviceGroupCount,
+        VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties, uint32_t doLock);
+    void vkGetImageMemoryRequirements2(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo,
+                                       VkMemoryRequirements2* pMemoryRequirements, uint32_t doLock);
+    void vkGetBufferMemoryRequirements2(VkDevice device,
+                                        const VkBufferMemoryRequirementsInfo2* pInfo,
+                                        VkMemoryRequirements2* pMemoryRequirements,
+                                        uint32_t doLock);
+    void vkGetImageSparseMemoryRequirements2(
+        VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo,
+        uint32_t* pSparseMemoryRequirementCount,
+        VkSparseImageMemoryRequirements2* pSparseMemoryRequirements, uint32_t doLock);
+    void vkGetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
+                                      VkPhysicalDeviceFeatures2* pFeatures, uint32_t doLock);
+    void vkGetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice,
+                                        VkPhysicalDeviceProperties2* pProperties, uint32_t doLock);
+    void vkGetPhysicalDeviceFormatProperties2(VkPhysicalDevice physicalDevice, VkFormat format,
+                                              VkFormatProperties2* pFormatProperties,
+                                              uint32_t doLock);
+    VkResult vkGetPhysicalDeviceImageFormatProperties2(
+        VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
+        VkImageFormatProperties2* pImageFormatProperties, uint32_t doLock);
+    void vkGetPhysicalDeviceQueueFamilyProperties2(VkPhysicalDevice physicalDevice,
+                                                   uint32_t* pQueueFamilyPropertyCount,
+                                                   VkQueueFamilyProperties2* pQueueFamilyProperties,
+                                                   uint32_t doLock);
+    void vkGetPhysicalDeviceMemoryProperties2(VkPhysicalDevice physicalDevice,
+                                              VkPhysicalDeviceMemoryProperties2* pMemoryProperties,
+                                              uint32_t doLock);
+    void vkGetPhysicalDeviceSparseImageFormatProperties2(
+        VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo,
+        uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties, uint32_t doLock);
+    void vkTrimCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags,
+                           uint32_t doLock);
+    void vkGetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2* pQueueInfo, VkQueue* pQueue,
+                           uint32_t doLock);
+    VkResult vkCreateSamplerYcbcrConversion(VkDevice device,
+                                            const VkSamplerYcbcrConversionCreateInfo* pCreateInfo,
+                                            const VkAllocationCallbacks* pAllocator,
+                                            VkSamplerYcbcrConversion* pYcbcrConversion,
+                                            uint32_t doLock);
+    void vkDestroySamplerYcbcrConversion(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion,
+                                         const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    VkResult vkCreateDescriptorUpdateTemplate(
+        VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
+        const VkAllocationCallbacks* pAllocator,
+        VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate, uint32_t doLock);
+    void vkDestroyDescriptorUpdateTemplate(VkDevice device,
+                                           VkDescriptorUpdateTemplate descriptorUpdateTemplate,
+                                           const VkAllocationCallbacks* pAllocator,
+                                           uint32_t doLock);
+    void vkUpdateDescriptorSetWithTemplate(VkDevice device, VkDescriptorSet descriptorSet,
+                                           VkDescriptorUpdateTemplate descriptorUpdateTemplate,
+                                           const void* pData, uint32_t doLock);
+    void vkGetPhysicalDeviceExternalBufferProperties(
+        VkPhysicalDevice physicalDevice,
+        const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo,
+        VkExternalBufferProperties* pExternalBufferProperties, uint32_t doLock);
+    void vkGetPhysicalDeviceExternalFenceProperties(
+        VkPhysicalDevice physicalDevice,
+        const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo,
+        VkExternalFenceProperties* pExternalFenceProperties, uint32_t doLock);
+    void vkGetPhysicalDeviceExternalSemaphoreProperties(
+        VkPhysicalDevice physicalDevice,
+        const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo,
+        VkExternalSemaphoreProperties* pExternalSemaphoreProperties, uint32_t doLock);
+    void vkGetDescriptorSetLayoutSupport(VkDevice device,
+                                         const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
+                                         VkDescriptorSetLayoutSupport* pSupport, uint32_t doLock);
+#endif
+#ifdef VK_VERSION_1_2
+    void vkCmdDrawIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset,
+                                VkBuffer countBuffer, VkDeviceSize countBufferOffset,
+                                uint32_t maxDrawCount, uint32_t stride, uint32_t doLock);
+    void vkCmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                       VkDeviceSize offset, VkBuffer countBuffer,
+                                       VkDeviceSize countBufferOffset, uint32_t maxDrawCount,
+                                       uint32_t stride, uint32_t doLock);
+    VkResult vkCreateRenderPass2(VkDevice device, const VkRenderPassCreateInfo2* pCreateInfo,
+                                 const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass,
+                                 uint32_t doLock);
+    void vkCmdBeginRenderPass2(VkCommandBuffer commandBuffer,
+                               const VkRenderPassBeginInfo* pRenderPassBegin,
+                               const VkSubpassBeginInfo* pSubpassBeginInfo, uint32_t doLock);
+    void vkCmdNextSubpass2(VkCommandBuffer commandBuffer,
+                           const VkSubpassBeginInfo* pSubpassBeginInfo,
+                           const VkSubpassEndInfo* pSubpassEndInfo, uint32_t doLock);
+    void vkCmdEndRenderPass2(VkCommandBuffer commandBuffer, const VkSubpassEndInfo* pSubpassEndInfo,
+                             uint32_t doLock);
+    void vkResetQueryPool(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery,
+                          uint32_t queryCount, uint32_t doLock);
+    VkResult vkGetSemaphoreCounterValue(VkDevice device, VkSemaphore semaphore, uint64_t* pValue,
+                                        uint32_t doLock);
+    VkResult vkWaitSemaphores(VkDevice device, const VkSemaphoreWaitInfo* pWaitInfo,
+                              uint64_t timeout, uint32_t doLock);
+    VkResult vkSignalSemaphore(VkDevice device, const VkSemaphoreSignalInfo* pSignalInfo,
+                               uint32_t doLock);
+    VkDeviceAddress vkGetBufferDeviceAddress(VkDevice device,
+                                             const VkBufferDeviceAddressInfo* pInfo,
+                                             uint32_t doLock);
+    uint64_t vkGetBufferOpaqueCaptureAddress(VkDevice device,
+                                             const VkBufferDeviceAddressInfo* pInfo,
+                                             uint32_t doLock);
+    uint64_t vkGetDeviceMemoryOpaqueCaptureAddress(
+        VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo, uint32_t doLock);
+#endif
+#ifdef VK_KHR_surface
+    void vkDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface,
+                             const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    VkResult vkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice,
+                                                  uint32_t queueFamilyIndex, VkSurfaceKHR surface,
+                                                  VkBool32* pSupported, uint32_t doLock);
+    VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
+        VkPhysicalDevice physicalDevice, VkSurfaceKHR surface,
+        VkSurfaceCapabilitiesKHR* pSurfaceCapabilities, uint32_t doLock);
+    VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice,
+                                                  VkSurfaceKHR surface,
+                                                  uint32_t* pSurfaceFormatCount,
+                                                  VkSurfaceFormatKHR* pSurfaceFormats,
+                                                  uint32_t doLock);
+    VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice,
+                                                       VkSurfaceKHR surface,
+                                                       uint32_t* pPresentModeCount,
+                                                       VkPresentModeKHR* pPresentModes,
+                                                       uint32_t doLock);
+#endif
+#ifdef VK_KHR_swapchain
+    VkResult vkCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo,
+                                  const VkAllocationCallbacks* pAllocator,
+                                  VkSwapchainKHR* pSwapchain, uint32_t doLock);
+    void vkDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain,
+                               const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    VkResult vkGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain,
+                                     uint32_t* pSwapchainImageCount, VkImage* pSwapchainImages,
+                                     uint32_t doLock);
+    VkResult vkAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout,
+                                   VkSemaphore semaphore, VkFence fence, uint32_t* pImageIndex,
+                                   uint32_t doLock);
+    VkResult vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR* pPresentInfo,
+                               uint32_t doLock);
+    VkResult vkGetDeviceGroupPresentCapabilitiesKHR(
+        VkDevice device, VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities,
+        uint32_t doLock);
+    VkResult vkGetDeviceGroupSurfacePresentModesKHR(VkDevice device, VkSurfaceKHR surface,
+                                                    VkDeviceGroupPresentModeFlagsKHR* pModes,
+                                                    uint32_t doLock);
+    VkResult vkGetPhysicalDevicePresentRectanglesKHR(VkPhysicalDevice physicalDevice,
+                                                     VkSurfaceKHR surface, uint32_t* pRectCount,
+                                                     VkRect2D* pRects, uint32_t doLock);
+    VkResult vkAcquireNextImage2KHR(VkDevice device, const VkAcquireNextImageInfoKHR* pAcquireInfo,
+                                    uint32_t* pImageIndex, uint32_t doLock);
+#endif
+#ifdef VK_KHR_display
+    VkResult vkGetPhysicalDeviceDisplayPropertiesKHR(VkPhysicalDevice physicalDevice,
+                                                     uint32_t* pPropertyCount,
+                                                     VkDisplayPropertiesKHR* pProperties,
+                                                     uint32_t doLock);
+    VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR(VkPhysicalDevice physicalDevice,
+                                                          uint32_t* pPropertyCount,
+                                                          VkDisplayPlanePropertiesKHR* pProperties,
+                                                          uint32_t doLock);
+    VkResult vkGetDisplayPlaneSupportedDisplaysKHR(VkPhysicalDevice physicalDevice,
+                                                   uint32_t planeIndex, uint32_t* pDisplayCount,
+                                                   VkDisplayKHR* pDisplays, uint32_t doLock);
+    VkResult vkGetDisplayModePropertiesKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display,
+                                           uint32_t* pPropertyCount,
+                                           VkDisplayModePropertiesKHR* pProperties,
+                                           uint32_t doLock);
+    VkResult vkCreateDisplayModeKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display,
+                                    const VkDisplayModeCreateInfoKHR* pCreateInfo,
+                                    const VkAllocationCallbacks* pAllocator,
+                                    VkDisplayModeKHR* pMode, uint32_t doLock);
+    VkResult vkGetDisplayPlaneCapabilitiesKHR(VkPhysicalDevice physicalDevice,
+                                              VkDisplayModeKHR mode, uint32_t planeIndex,
+                                              VkDisplayPlaneCapabilitiesKHR* pCapabilities,
+                                              uint32_t doLock);
+    VkResult vkCreateDisplayPlaneSurfaceKHR(VkInstance instance,
+                                            const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
+                                            const VkAllocationCallbacks* pAllocator,
+                                            VkSurfaceKHR* pSurface, uint32_t doLock);
+#endif
+#ifdef VK_KHR_display_swapchain
+    VkResult vkCreateSharedSwapchainsKHR(VkDevice device, uint32_t swapchainCount,
+                                         const VkSwapchainCreateInfoKHR* pCreateInfos,
+                                         const VkAllocationCallbacks* pAllocator,
+                                         VkSwapchainKHR* pSwapchains, uint32_t doLock);
+#endif
+#ifdef VK_KHR_xlib_surface
+    VkResult vkCreateXlibSurfaceKHR(VkInstance instance,
+                                    const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
+                                    const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface,
+                                    uint32_t doLock);
+    VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR(VkPhysicalDevice physicalDevice,
+                                                           uint32_t queueFamilyIndex, Display* dpy,
+                                                           VisualID visualID, uint32_t doLock);
+#endif
+#ifdef VK_KHR_xcb_surface
+    VkResult vkCreateXcbSurfaceKHR(VkInstance instance,
+                                   const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
+                                   const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface,
+                                   uint32_t doLock);
+    VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR(VkPhysicalDevice physicalDevice,
+                                                          uint32_t queueFamilyIndex,
+                                                          xcb_connection_t* connection,
+                                                          xcb_visualid_t visual_id,
+                                                          uint32_t doLock);
+#endif
+#ifdef VK_KHR_wayland_surface
+    VkResult vkCreateWaylandSurfaceKHR(VkInstance instance,
+                                       const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
+                                       const VkAllocationCallbacks* pAllocator,
+                                       VkSurfaceKHR* pSurface, uint32_t doLock);
+    VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR(VkPhysicalDevice physicalDevice,
+                                                              uint32_t queueFamilyIndex,
+                                                              wl_display* display, uint32_t doLock);
+#endif
+#ifdef VK_KHR_android_surface
+    VkResult vkCreateAndroidSurfaceKHR(VkInstance instance,
+                                       const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
+                                       const VkAllocationCallbacks* pAllocator,
+                                       VkSurfaceKHR* pSurface, uint32_t doLock);
+#endif
+#ifdef VK_KHR_win32_surface
+    VkResult vkCreateWin32SurfaceKHR(VkInstance instance,
+                                     const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
+                                     const VkAllocationCallbacks* pAllocator,
+                                     VkSurfaceKHR* pSurface, uint32_t doLock);
+    VkBool32 vkGetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice,
+                                                            uint32_t queueFamilyIndex,
+                                                            uint32_t doLock);
+#endif
+#ifdef VK_KHR_sampler_mirror_clamp_to_edge
+#endif
+#ifdef VK_KHR_video_queue
+    VkResult vkGetPhysicalDeviceVideoCapabilitiesKHR(VkPhysicalDevice physicalDevice,
+                                                     const VkVideoProfileKHR* pVideoProfile,
+                                                     VkVideoCapabilitiesKHR* pCapabilities,
+                                                     uint32_t doLock);
+    VkResult vkGetPhysicalDeviceVideoFormatPropertiesKHR(
+        VkPhysicalDevice physicalDevice, const VkPhysicalDeviceVideoFormatInfoKHR* pVideoFormatInfo,
+        uint32_t* pVideoFormatPropertyCount, VkVideoFormatPropertiesKHR* pVideoFormatProperties,
+        uint32_t doLock);
+    VkResult vkCreateVideoSessionKHR(VkDevice device,
+                                     const VkVideoSessionCreateInfoKHR* pCreateInfo,
+                                     const VkAllocationCallbacks* pAllocator,
+                                     VkVideoSessionKHR* pVideoSession, uint32_t doLock);
+    void vkDestroyVideoSessionKHR(VkDevice device, VkVideoSessionKHR videoSession,
+                                  const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    VkResult vkGetVideoSessionMemoryRequirementsKHR(
+        VkDevice device, VkVideoSessionKHR videoSession,
+        uint32_t* pVideoSessionMemoryRequirementsCount,
+        VkVideoGetMemoryPropertiesKHR* pVideoSessionMemoryRequirements, uint32_t doLock);
+    VkResult vkBindVideoSessionMemoryKHR(VkDevice device, VkVideoSessionKHR videoSession,
+                                         uint32_t videoSessionBindMemoryCount,
+                                         const VkVideoBindMemoryKHR* pVideoSessionBindMemories,
+                                         uint32_t doLock);
+    VkResult vkCreateVideoSessionParametersKHR(
+        VkDevice device, const VkVideoSessionParametersCreateInfoKHR* pCreateInfo,
+        const VkAllocationCallbacks* pAllocator,
+        VkVideoSessionParametersKHR* pVideoSessionParameters, uint32_t doLock);
+    VkResult vkUpdateVideoSessionParametersKHR(
+        VkDevice device, VkVideoSessionParametersKHR videoSessionParameters,
+        const VkVideoSessionParametersUpdateInfoKHR* pUpdateInfo, uint32_t doLock);
+    void vkDestroyVideoSessionParametersKHR(VkDevice device,
+                                            VkVideoSessionParametersKHR videoSessionParameters,
+                                            const VkAllocationCallbacks* pAllocator,
+                                            uint32_t doLock);
+    void vkCmdBeginVideoCodingKHR(VkCommandBuffer commandBuffer,
+                                  const VkVideoBeginCodingInfoKHR* pBeginInfo, uint32_t doLock);
+    void vkCmdEndVideoCodingKHR(VkCommandBuffer commandBuffer,
+                                const VkVideoEndCodingInfoKHR* pEndCodingInfo, uint32_t doLock);
+    void vkCmdControlVideoCodingKHR(VkCommandBuffer commandBuffer,
+                                    const VkVideoCodingControlInfoKHR* pCodingControlInfo,
+                                    uint32_t doLock);
+#endif
+#ifdef VK_KHR_video_decode_queue
+    void vkCmdDecodeVideoKHR(VkCommandBuffer commandBuffer, const VkVideoDecodeInfoKHR* pFrameInfo,
+                             uint32_t doLock);
+#endif
+#ifdef VK_KHR_dynamic_rendering
+    void vkCmdBeginRenderingKHR(VkCommandBuffer commandBuffer,
+                                const VkRenderingInfoKHR* pRenderingInfo, uint32_t doLock);
+    void vkCmdEndRenderingKHR(VkCommandBuffer commandBuffer, uint32_t doLock);
+#endif
+#ifdef VK_KHR_multiview
+#endif
+#ifdef VK_KHR_get_physical_device_properties2
+    void vkGetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice,
+                                         VkPhysicalDeviceFeatures2* pFeatures, uint32_t doLock);
+    void vkGetPhysicalDeviceProperties2KHR(VkPhysicalDevice physicalDevice,
+                                           VkPhysicalDeviceProperties2* pProperties,
+                                           uint32_t doLock);
+    void vkGetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice, VkFormat format,
+                                                 VkFormatProperties2* pFormatProperties,
+                                                 uint32_t doLock);
+    VkResult vkGetPhysicalDeviceImageFormatProperties2KHR(
+        VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
+        VkImageFormatProperties2* pImageFormatProperties, uint32_t doLock);
+    void vkGetPhysicalDeviceQueueFamilyProperties2KHR(
+        VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount,
+        VkQueueFamilyProperties2* pQueueFamilyProperties, uint32_t doLock);
+    void vkGetPhysicalDeviceMemoryProperties2KHR(
+        VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2* pMemoryProperties,
+        uint32_t doLock);
+    void vkGetPhysicalDeviceSparseImageFormatProperties2KHR(
+        VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo,
+        uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties, uint32_t doLock);
+#endif
+#ifdef VK_KHR_device_group
+    void vkGetDeviceGroupPeerMemoryFeaturesKHR(VkDevice device, uint32_t heapIndex,
+                                               uint32_t localDeviceIndex,
+                                               uint32_t remoteDeviceIndex,
+                                               VkPeerMemoryFeatureFlags* pPeerMemoryFeatures,
+                                               uint32_t doLock);
+    void vkCmdSetDeviceMaskKHR(VkCommandBuffer commandBuffer, uint32_t deviceMask, uint32_t doLock);
+    void vkCmdDispatchBaseKHR(VkCommandBuffer commandBuffer, uint32_t baseGroupX,
+                              uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX,
+                              uint32_t groupCountY, uint32_t groupCountZ, uint32_t doLock);
+#endif
+#ifdef VK_KHR_shader_draw_parameters
+#endif
+#ifdef VK_KHR_maintenance1
+    void vkTrimCommandPoolKHR(VkDevice device, VkCommandPool commandPool,
+                              VkCommandPoolTrimFlags flags, uint32_t doLock);
+#endif
+#ifdef VK_KHR_device_group_creation
+    VkResult vkEnumeratePhysicalDeviceGroupsKHR(
+        VkInstance instance, uint32_t* pPhysicalDeviceGroupCount,
+        VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties, uint32_t doLock);
+#endif
+#ifdef VK_KHR_external_memory_capabilities
+    void vkGetPhysicalDeviceExternalBufferPropertiesKHR(
+        VkPhysicalDevice physicalDevice,
+        const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo,
+        VkExternalBufferProperties* pExternalBufferProperties, uint32_t doLock);
+#endif
+#ifdef VK_KHR_external_memory
+#endif
+#ifdef VK_KHR_external_memory_win32
+    VkResult vkGetMemoryWin32HandleKHR(VkDevice device,
+                                       const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo,
+                                       HANDLE* pHandle, uint32_t doLock);
+    VkResult vkGetMemoryWin32HandlePropertiesKHR(
+        VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE handle,
+        VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties, uint32_t doLock);
+#endif
+#ifdef VK_KHR_external_memory_fd
+    VkResult vkGetMemoryFdKHR(VkDevice device, const VkMemoryGetFdInfoKHR* pGetFdInfo, int* pFd,
+                              uint32_t doLock);
+    VkResult vkGetMemoryFdPropertiesKHR(VkDevice device,
+                                        VkExternalMemoryHandleTypeFlagBits handleType, int fd,
+                                        VkMemoryFdPropertiesKHR* pMemoryFdProperties,
+                                        uint32_t doLock);
+#endif
+#ifdef VK_KHR_win32_keyed_mutex
+#endif
+#ifdef VK_KHR_external_semaphore_capabilities
+    void vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(
+        VkPhysicalDevice physicalDevice,
+        const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo,
+        VkExternalSemaphoreProperties* pExternalSemaphoreProperties, uint32_t doLock);
+#endif
+#ifdef VK_KHR_external_semaphore
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+    VkResult vkImportSemaphoreWin32HandleKHR(
+        VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo,
+        uint32_t doLock);
+    VkResult vkGetSemaphoreWin32HandleKHR(
+        VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo,
+        HANDLE* pHandle, uint32_t doLock);
+#endif
+#ifdef VK_KHR_external_semaphore_fd
+    VkResult vkImportSemaphoreFdKHR(VkDevice device,
+                                    const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo,
+                                    uint32_t doLock);
+    VkResult vkGetSemaphoreFdKHR(VkDevice device, const VkSemaphoreGetFdInfoKHR* pGetFdInfo,
+                                 int* pFd, uint32_t doLock);
+#endif
+#ifdef VK_KHR_push_descriptor
+    void vkCmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer,
+                                   VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout,
+                                   uint32_t set, uint32_t descriptorWriteCount,
+                                   const VkWriteDescriptorSet* pDescriptorWrites, uint32_t doLock);
+    void vkCmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer commandBuffer,
+                                               VkDescriptorUpdateTemplate descriptorUpdateTemplate,
+                                               VkPipelineLayout layout, uint32_t set,
+                                               const void* pData, uint32_t doLock);
+#endif
+#ifdef VK_KHR_shader_float16_int8
+#endif
+#ifdef VK_KHR_16bit_storage
+#endif
+#ifdef VK_KHR_incremental_present
+#endif
+#ifdef VK_KHR_descriptor_update_template
+    VkResult vkCreateDescriptorUpdateTemplateKHR(
+        VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
+        const VkAllocationCallbacks* pAllocator,
+        VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate, uint32_t doLock);
+    void vkDestroyDescriptorUpdateTemplateKHR(VkDevice device,
+                                              VkDescriptorUpdateTemplate descriptorUpdateTemplate,
+                                              const VkAllocationCallbacks* pAllocator,
+                                              uint32_t doLock);
+    void vkUpdateDescriptorSetWithTemplateKHR(VkDevice device, VkDescriptorSet descriptorSet,
+                                              VkDescriptorUpdateTemplate descriptorUpdateTemplate,
+                                              const void* pData, uint32_t doLock);
+#endif
+#ifdef VK_KHR_imageless_framebuffer
+#endif
+#ifdef VK_KHR_create_renderpass2
+    VkResult vkCreateRenderPass2KHR(VkDevice device, const VkRenderPassCreateInfo2* pCreateInfo,
+                                    const VkAllocationCallbacks* pAllocator,
+                                    VkRenderPass* pRenderPass, uint32_t doLock);
+    void vkCmdBeginRenderPass2KHR(VkCommandBuffer commandBuffer,
+                                  const VkRenderPassBeginInfo* pRenderPassBegin,
+                                  const VkSubpassBeginInfo* pSubpassBeginInfo, uint32_t doLock);
+    void vkCmdNextSubpass2KHR(VkCommandBuffer commandBuffer,
+                              const VkSubpassBeginInfo* pSubpassBeginInfo,
+                              const VkSubpassEndInfo* pSubpassEndInfo, uint32_t doLock);
+    void vkCmdEndRenderPass2KHR(VkCommandBuffer commandBuffer,
+                                const VkSubpassEndInfo* pSubpassEndInfo, uint32_t doLock);
+#endif
+#ifdef VK_KHR_shared_presentable_image
+    VkResult vkGetSwapchainStatusKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t doLock);
+#endif
+#ifdef VK_KHR_external_fence_capabilities
+    void vkGetPhysicalDeviceExternalFencePropertiesKHR(
+        VkPhysicalDevice physicalDevice,
+        const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo,
+        VkExternalFenceProperties* pExternalFenceProperties, uint32_t doLock);
+#endif
+#ifdef VK_KHR_external_fence
+#endif
+#ifdef VK_KHR_external_fence_win32
+    VkResult vkImportFenceWin32HandleKHR(
+        VkDevice device, const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo,
+        uint32_t doLock);
+    VkResult vkGetFenceWin32HandleKHR(VkDevice device,
+                                      const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo,
+                                      HANDLE* pHandle, uint32_t doLock);
+#endif
+#ifdef VK_KHR_external_fence_fd
+    VkResult vkImportFenceFdKHR(VkDevice device, const VkImportFenceFdInfoKHR* pImportFenceFdInfo,
+                                uint32_t doLock);
+    VkResult vkGetFenceFdKHR(VkDevice device, const VkFenceGetFdInfoKHR* pGetFdInfo, int* pFd,
+                             uint32_t doLock);
+#endif
+#ifdef VK_KHR_performance_query
+    VkResult vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(
+        VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, uint32_t* pCounterCount,
+        VkPerformanceCounterKHR* pCounters,
+        VkPerformanceCounterDescriptionKHR* pCounterDescriptions, uint32_t doLock);
+    void vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(
+        VkPhysicalDevice physicalDevice,
+        const VkQueryPoolPerformanceCreateInfoKHR* pPerformanceQueryCreateInfo,
+        uint32_t* pNumPasses, uint32_t doLock);
+    VkResult vkAcquireProfilingLockKHR(VkDevice device, const VkAcquireProfilingLockInfoKHR* pInfo,
+                                       uint32_t doLock);
+    void vkReleaseProfilingLockKHR(VkDevice device, uint32_t doLock);
+#endif
+#ifdef VK_KHR_maintenance2
+#endif
+#ifdef VK_KHR_get_surface_capabilities2
+    VkResult vkGetPhysicalDeviceSurfaceCapabilities2KHR(
+        VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
+        VkSurfaceCapabilities2KHR* pSurfaceCapabilities, uint32_t doLock);
+    VkResult vkGetPhysicalDeviceSurfaceFormats2KHR(
+        VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
+        uint32_t* pSurfaceFormatCount, VkSurfaceFormat2KHR* pSurfaceFormats, uint32_t doLock);
+#endif
+#ifdef VK_KHR_variable_pointers
+#endif
+#ifdef VK_KHR_get_display_properties2
+    VkResult vkGetPhysicalDeviceDisplayProperties2KHR(VkPhysicalDevice physicalDevice,
+                                                      uint32_t* pPropertyCount,
+                                                      VkDisplayProperties2KHR* pProperties,
+                                                      uint32_t doLock);
+    VkResult vkGetPhysicalDeviceDisplayPlaneProperties2KHR(
+        VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount,
+        VkDisplayPlaneProperties2KHR* pProperties, uint32_t doLock);
+    VkResult vkGetDisplayModeProperties2KHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display,
+                                            uint32_t* pPropertyCount,
+                                            VkDisplayModeProperties2KHR* pProperties,
+                                            uint32_t doLock);
+    VkResult vkGetDisplayPlaneCapabilities2KHR(VkPhysicalDevice physicalDevice,
+                                               const VkDisplayPlaneInfo2KHR* pDisplayPlaneInfo,
+                                               VkDisplayPlaneCapabilities2KHR* pCapabilities,
+                                               uint32_t doLock);
+#endif
+#ifdef VK_KHR_dedicated_allocation
+#endif
+#ifdef VK_KHR_storage_buffer_storage_class
+#endif
+#ifdef VK_KHR_relaxed_block_layout
+#endif
+#ifdef VK_KHR_get_memory_requirements2
+    void vkGetImageMemoryRequirements2KHR(VkDevice device,
+                                          const VkImageMemoryRequirementsInfo2* pInfo,
+                                          VkMemoryRequirements2* pMemoryRequirements,
+                                          uint32_t doLock);
+    void vkGetBufferMemoryRequirements2KHR(VkDevice device,
+                                           const VkBufferMemoryRequirementsInfo2* pInfo,
+                                           VkMemoryRequirements2* pMemoryRequirements,
+                                           uint32_t doLock);
+    void vkGetImageSparseMemoryRequirements2KHR(
+        VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo,
+        uint32_t* pSparseMemoryRequirementCount,
+        VkSparseImageMemoryRequirements2* pSparseMemoryRequirements, uint32_t doLock);
+#endif
+#ifdef VK_KHR_image_format_list
+#endif
+#ifdef VK_KHR_sampler_ycbcr_conversion
+    VkResult vkCreateSamplerYcbcrConversionKHR(
+        VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo,
+        const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion,
+        uint32_t doLock);
+    void vkDestroySamplerYcbcrConversionKHR(VkDevice device,
+                                            VkSamplerYcbcrConversion ycbcrConversion,
+                                            const VkAllocationCallbacks* pAllocator,
+                                            uint32_t doLock);
+#endif
+#ifdef VK_KHR_bind_memory2
+    VkResult vkBindBufferMemory2KHR(VkDevice device, uint32_t bindInfoCount,
+                                    const VkBindBufferMemoryInfo* pBindInfos, uint32_t doLock);
+    VkResult vkBindImageMemory2KHR(VkDevice device, uint32_t bindInfoCount,
+                                   const VkBindImageMemoryInfo* pBindInfos, uint32_t doLock);
+#endif
+#ifdef VK_KHR_portability_subset
+#endif
+#ifdef VK_KHR_maintenance3
+    void vkGetDescriptorSetLayoutSupportKHR(VkDevice device,
+                                            const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
+                                            VkDescriptorSetLayoutSupport* pSupport,
+                                            uint32_t doLock);
+#endif
+#ifdef VK_KHR_draw_indirect_count
+    void vkCmdDrawIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                   VkDeviceSize offset, VkBuffer countBuffer,
+                                   VkDeviceSize countBufferOffset, uint32_t maxDrawCount,
+                                   uint32_t stride, uint32_t doLock);
+    void vkCmdDrawIndexedIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                          VkDeviceSize offset, VkBuffer countBuffer,
+                                          VkDeviceSize countBufferOffset, uint32_t maxDrawCount,
+                                          uint32_t stride, uint32_t doLock);
+#endif
+#ifdef VK_KHR_shader_subgroup_extended_types
+#endif
+#ifdef VK_KHR_8bit_storage
+#endif
+#ifdef VK_KHR_shader_atomic_int64
+#endif
+#ifdef VK_KHR_shader_clock
+#endif
+#ifdef VK_KHR_driver_properties
+#endif
+#ifdef VK_KHR_shader_float_controls
+#endif
+#ifdef VK_KHR_depth_stencil_resolve
+#endif
+#ifdef VK_KHR_swapchain_mutable_format
+#endif
+#ifdef VK_KHR_timeline_semaphore
+    VkResult vkGetSemaphoreCounterValueKHR(VkDevice device, VkSemaphore semaphore, uint64_t* pValue,
+                                           uint32_t doLock);
+    VkResult vkWaitSemaphoresKHR(VkDevice device, const VkSemaphoreWaitInfo* pWaitInfo,
+                                 uint64_t timeout, uint32_t doLock);
+    VkResult vkSignalSemaphoreKHR(VkDevice device, const VkSemaphoreSignalInfo* pSignalInfo,
+                                  uint32_t doLock);
+#endif
+#ifdef VK_KHR_vulkan_memory_model
+#endif
+#ifdef VK_KHR_shader_terminate_invocation
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+    VkResult vkGetPhysicalDeviceFragmentShadingRatesKHR(
+        VkPhysicalDevice physicalDevice, uint32_t* pFragmentShadingRateCount,
+        VkPhysicalDeviceFragmentShadingRateKHR* pFragmentShadingRates, uint32_t doLock);
+    void vkCmdSetFragmentShadingRateKHR(VkCommandBuffer commandBuffer,
+                                        const VkExtent2D* pFragmentSize,
+                                        const VkFragmentShadingRateCombinerOpKHR combinerOps[2],
+                                        uint32_t doLock);
+#endif
+#ifdef VK_KHR_spirv_1_4
+#endif
+#ifdef VK_KHR_surface_protected_capabilities
+#endif
+#ifdef VK_KHR_separate_depth_stencil_layouts
+#endif
+#ifdef VK_KHR_present_wait
+    VkResult vkWaitForPresentKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t presentId,
+                                 uint64_t timeout, uint32_t doLock);
+#endif
+#ifdef VK_KHR_uniform_buffer_standard_layout
+#endif
+#ifdef VK_KHR_buffer_device_address
+    VkDeviceAddress vkGetBufferDeviceAddressKHR(VkDevice device,
+                                                const VkBufferDeviceAddressInfo* pInfo,
+                                                uint32_t doLock);
+    uint64_t vkGetBufferOpaqueCaptureAddressKHR(VkDevice device,
+                                                const VkBufferDeviceAddressInfo* pInfo,
+                                                uint32_t doLock);
+    uint64_t vkGetDeviceMemoryOpaqueCaptureAddressKHR(
+        VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo, uint32_t doLock);
+#endif
+#ifdef VK_KHR_deferred_host_operations
+    VkResult vkCreateDeferredOperationKHR(VkDevice device, const VkAllocationCallbacks* pAllocator,
+                                          VkDeferredOperationKHR* pDeferredOperation,
+                                          uint32_t doLock);
+    void vkDestroyDeferredOperationKHR(VkDevice device, VkDeferredOperationKHR operation,
+                                       const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    uint32_t vkGetDeferredOperationMaxConcurrencyKHR(VkDevice device,
+                                                     VkDeferredOperationKHR operation,
+                                                     uint32_t doLock);
+    VkResult vkGetDeferredOperationResultKHR(VkDevice device, VkDeferredOperationKHR operation,
+                                             uint32_t doLock);
+    VkResult vkDeferredOperationJoinKHR(VkDevice device, VkDeferredOperationKHR operation,
+                                        uint32_t doLock);
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+    VkResult vkGetPipelineExecutablePropertiesKHR(VkDevice device,
+                                                  const VkPipelineInfoKHR* pPipelineInfo,
+                                                  uint32_t* pExecutableCount,
+                                                  VkPipelineExecutablePropertiesKHR* pProperties,
+                                                  uint32_t doLock);
+    VkResult vkGetPipelineExecutableStatisticsKHR(
+        VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo,
+        uint32_t* pStatisticCount, VkPipelineExecutableStatisticKHR* pStatistics, uint32_t doLock);
+    VkResult vkGetPipelineExecutableInternalRepresentationsKHR(
+        VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo,
+        uint32_t* pInternalRepresentationCount,
+        VkPipelineExecutableInternalRepresentationKHR* pInternalRepresentations, uint32_t doLock);
+#endif
+#ifdef VK_KHR_shader_integer_dot_product
+#endif
+#ifdef VK_KHR_pipeline_library
+#endif
+#ifdef VK_KHR_shader_non_semantic_info
+#endif
+#ifdef VK_KHR_present_id
+#endif
+#ifdef VK_KHR_video_encode_queue
+    void vkCmdEncodeVideoKHR(VkCommandBuffer commandBuffer, const VkVideoEncodeInfoKHR* pEncodeInfo,
+                             uint32_t doLock);
+#endif
+#ifdef VK_KHR_synchronization2
+    void vkCmdSetEvent2KHR(VkCommandBuffer commandBuffer, VkEvent event,
+                           const VkDependencyInfoKHR* pDependencyInfo, uint32_t doLock);
+    void vkCmdResetEvent2KHR(VkCommandBuffer commandBuffer, VkEvent event,
+                             VkPipelineStageFlags2KHR stageMask, uint32_t doLock);
+    void vkCmdWaitEvents2KHR(VkCommandBuffer commandBuffer, uint32_t eventCount,
+                             const VkEvent* pEvents, const VkDependencyInfoKHR* pDependencyInfos,
+                             uint32_t doLock);
+    void vkCmdPipelineBarrier2KHR(VkCommandBuffer commandBuffer,
+                                  const VkDependencyInfoKHR* pDependencyInfo, uint32_t doLock);
+    void vkCmdWriteTimestamp2KHR(VkCommandBuffer commandBuffer, VkPipelineStageFlags2KHR stage,
+                                 VkQueryPool queryPool, uint32_t query, uint32_t doLock);
+    VkResult vkQueueSubmit2KHR(VkQueue queue, uint32_t submitCount,
+                               const VkSubmitInfo2KHR* pSubmits, VkFence fence, uint32_t doLock);
+    void vkCmdWriteBufferMarker2AMD(VkCommandBuffer commandBuffer, VkPipelineStageFlags2KHR stage,
+                                    VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker,
+                                    uint32_t doLock);
+    void vkGetQueueCheckpointData2NV(VkQueue queue, uint32_t* pCheckpointDataCount,
+                                     VkCheckpointData2NV* pCheckpointData, uint32_t doLock);
+#endif
+#ifdef VK_KHR_shader_subgroup_uniform_control_flow
+#endif
+#ifdef VK_KHR_zero_initialize_workgroup_memory
+#endif
+#ifdef VK_KHR_workgroup_memory_explicit_layout
+#endif
+#ifdef VK_KHR_copy_commands2
+    void vkCmdCopyBuffer2KHR(VkCommandBuffer commandBuffer,
+                             const VkCopyBufferInfo2KHR* pCopyBufferInfo, uint32_t doLock);
+    void vkCmdCopyImage2KHR(VkCommandBuffer commandBuffer,
+                            const VkCopyImageInfo2KHR* pCopyImageInfo, uint32_t doLock);
+    void vkCmdCopyBufferToImage2KHR(VkCommandBuffer commandBuffer,
+                                    const VkCopyBufferToImageInfo2KHR* pCopyBufferToImageInfo,
+                                    uint32_t doLock);
+    void vkCmdCopyImageToBuffer2KHR(VkCommandBuffer commandBuffer,
+                                    const VkCopyImageToBufferInfo2KHR* pCopyImageToBufferInfo,
+                                    uint32_t doLock);
+    void vkCmdBlitImage2KHR(VkCommandBuffer commandBuffer,
+                            const VkBlitImageInfo2KHR* pBlitImageInfo, uint32_t doLock);
+    void vkCmdResolveImage2KHR(VkCommandBuffer commandBuffer,
+                               const VkResolveImageInfo2KHR* pResolveImageInfo, uint32_t doLock);
+#endif
+#ifdef VK_KHR_format_feature_flags2
+#endif
+#ifdef VK_KHR_maintenance4
+    void vkGetDeviceBufferMemoryRequirementsKHR(VkDevice device,
+                                                const VkDeviceBufferMemoryRequirementsKHR* pInfo,
+                                                VkMemoryRequirements2* pMemoryRequirements,
+                                                uint32_t doLock);
+    void vkGetDeviceImageMemoryRequirementsKHR(VkDevice device,
+                                               const VkDeviceImageMemoryRequirementsKHR* pInfo,
+                                               VkMemoryRequirements2* pMemoryRequirements,
+                                               uint32_t doLock);
+    void vkGetDeviceImageSparseMemoryRequirementsKHR(
+        VkDevice device, const VkDeviceImageMemoryRequirementsKHR* pInfo,
+        uint32_t* pSparseMemoryRequirementCount,
+        VkSparseImageMemoryRequirements2* pSparseMemoryRequirements, uint32_t doLock);
+#endif
+#ifdef VK_ANDROID_native_buffer
+    VkResult vkGetSwapchainGrallocUsageANDROID(VkDevice device, VkFormat format,
+                                               VkImageUsageFlags imageUsage, int* grallocUsage,
+                                               uint32_t doLock);
+    VkResult vkAcquireImageANDROID(VkDevice device, VkImage image, int nativeFenceFd,
+                                   VkSemaphore semaphore, VkFence fence, uint32_t doLock);
+    VkResult vkQueueSignalReleaseImageANDROID(VkQueue queue, uint32_t waitSemaphoreCount,
+                                              const VkSemaphore* pWaitSemaphores, VkImage image,
+                                              int* pNativeFenceFd, uint32_t doLock);
+#endif
+#ifdef VK_EXT_debug_report
+    VkResult vkCreateDebugReportCallbackEXT(VkInstance instance,
+                                            const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,
+                                            const VkAllocationCallbacks* pAllocator,
+                                            VkDebugReportCallbackEXT* pCallback, uint32_t doLock);
+    void vkDestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback,
+                                         const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    void vkDebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags,
+                                 VkDebugReportObjectTypeEXT objectType, uint64_t object,
+                                 size_t location, int32_t messageCode, const char* pLayerPrefix,
+                                 const char* pMessage, uint32_t doLock);
+#endif
+#ifdef VK_NV_glsl_shader
+#endif
+#ifdef VK_EXT_depth_range_unrestricted
+#endif
+#ifdef VK_IMG_filter_cubic
+#endif
+#ifdef VK_AMD_rasterization_order
+#endif
+#ifdef VK_AMD_shader_trinary_minmax
+#endif
+#ifdef VK_AMD_shader_explicit_vertex_parameter
+#endif
+#ifdef VK_EXT_debug_marker
+    VkResult vkDebugMarkerSetObjectTagEXT(VkDevice device,
+                                          const VkDebugMarkerObjectTagInfoEXT* pTagInfo,
+                                          uint32_t doLock);
+    VkResult vkDebugMarkerSetObjectNameEXT(VkDevice device,
+                                           const VkDebugMarkerObjectNameInfoEXT* pNameInfo,
+                                           uint32_t doLock);
+    void vkCmdDebugMarkerBeginEXT(VkCommandBuffer commandBuffer,
+                                  const VkDebugMarkerMarkerInfoEXT* pMarkerInfo, uint32_t doLock);
+    void vkCmdDebugMarkerEndEXT(VkCommandBuffer commandBuffer, uint32_t doLock);
+    void vkCmdDebugMarkerInsertEXT(VkCommandBuffer commandBuffer,
+                                   const VkDebugMarkerMarkerInfoEXT* pMarkerInfo, uint32_t doLock);
+#endif
+#ifdef VK_AMD_gcn_shader
+#endif
+#ifdef VK_NV_dedicated_allocation
+#endif
+#ifdef VK_EXT_transform_feedback
+    void vkCmdBindTransformFeedbackBuffersEXT(VkCommandBuffer commandBuffer, uint32_t firstBinding,
+                                              uint32_t bindingCount, const VkBuffer* pBuffers,
+                                              const VkDeviceSize* pOffsets,
+                                              const VkDeviceSize* pSizes, uint32_t doLock);
+    void vkCmdBeginTransformFeedbackEXT(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer,
+                                        uint32_t counterBufferCount,
+                                        const VkBuffer* pCounterBuffers,
+                                        const VkDeviceSize* pCounterBufferOffsets, uint32_t doLock);
+    void vkCmdEndTransformFeedbackEXT(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer,
+                                      uint32_t counterBufferCount, const VkBuffer* pCounterBuffers,
+                                      const VkDeviceSize* pCounterBufferOffsets, uint32_t doLock);
+    void vkCmdBeginQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool,
+                                   uint32_t query, VkQueryControlFlags flags, uint32_t index,
+                                   uint32_t doLock);
+    void vkCmdEndQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool,
+                                 uint32_t query, uint32_t index, uint32_t doLock);
+    void vkCmdDrawIndirectByteCountEXT(VkCommandBuffer commandBuffer, uint32_t instanceCount,
+                                       uint32_t firstInstance, VkBuffer counterBuffer,
+                                       VkDeviceSize counterBufferOffset, uint32_t counterOffset,
+                                       uint32_t vertexStride, uint32_t doLock);
+#endif
+#ifdef VK_NVX_binary_import
+    VkResult vkCreateCuModuleNVX(VkDevice device, const VkCuModuleCreateInfoNVX* pCreateInfo,
+                                 const VkAllocationCallbacks* pAllocator, VkCuModuleNVX* pModule,
+                                 uint32_t doLock);
+    VkResult vkCreateCuFunctionNVX(VkDevice device, const VkCuFunctionCreateInfoNVX* pCreateInfo,
+                                   const VkAllocationCallbacks* pAllocator,
+                                   VkCuFunctionNVX* pFunction, uint32_t doLock);
+    void vkDestroyCuModuleNVX(VkDevice device, VkCuModuleNVX module,
+                              const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    void vkDestroyCuFunctionNVX(VkDevice device, VkCuFunctionNVX function,
+                                const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    void vkCmdCuLaunchKernelNVX(VkCommandBuffer commandBuffer, const VkCuLaunchInfoNVX* pLaunchInfo,
+                                uint32_t doLock);
+#endif
+#ifdef VK_NVX_image_view_handle
+    uint32_t vkGetImageViewHandleNVX(VkDevice device, const VkImageViewHandleInfoNVX* pInfo,
+                                     uint32_t doLock);
+    VkResult vkGetImageViewAddressNVX(VkDevice device, VkImageView imageView,
+                                      VkImageViewAddressPropertiesNVX* pProperties,
+                                      uint32_t doLock);
+#endif
+#ifdef VK_AMD_draw_indirect_count
+    void vkCmdDrawIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                   VkDeviceSize offset, VkBuffer countBuffer,
+                                   VkDeviceSize countBufferOffset, uint32_t maxDrawCount,
+                                   uint32_t stride, uint32_t doLock);
+    void vkCmdDrawIndexedIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                          VkDeviceSize offset, VkBuffer countBuffer,
+                                          VkDeviceSize countBufferOffset, uint32_t maxDrawCount,
+                                          uint32_t stride, uint32_t doLock);
+#endif
+#ifdef VK_AMD_negative_viewport_height
+#endif
+#ifdef VK_AMD_gpu_shader_half_float
+#endif
+#ifdef VK_AMD_shader_ballot
+#endif
+#ifdef VK_EXT_video_encode_h264
+#endif
+#ifdef VK_EXT_video_encode_h265
+#endif
+#ifdef VK_EXT_video_decode_h264
+#endif
+#ifdef VK_AMD_texture_gather_bias_lod
+#endif
+#ifdef VK_AMD_shader_info
+    VkResult vkGetShaderInfoAMD(VkDevice device, VkPipeline pipeline,
+                                VkShaderStageFlagBits shaderStage, VkShaderInfoTypeAMD infoType,
+                                size_t* pInfoSize, void* pInfo, uint32_t doLock);
+#endif
+#ifdef VK_AMD_shader_image_load_store_lod
+#endif
+#ifdef VK_GGP_stream_descriptor_surface
+    VkResult vkCreateStreamDescriptorSurfaceGGP(
+        VkInstance instance, const VkStreamDescriptorSurfaceCreateInfoGGP* pCreateInfo,
+        const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, uint32_t doLock);
+#endif
+#ifdef VK_NV_corner_sampled_image
+#endif
+#ifdef VK_IMG_format_pvrtc
+#endif
+#ifdef VK_NV_external_memory_capabilities
+    VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV(
+        VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling,
+        VkImageUsageFlags usage, VkImageCreateFlags flags,
+        VkExternalMemoryHandleTypeFlagsNV externalHandleType,
+        VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties, uint32_t doLock);
+#endif
+#ifdef VK_NV_external_memory
+#endif
+#ifdef VK_NV_external_memory_win32
+    VkResult vkGetMemoryWin32HandleNV(VkDevice device, VkDeviceMemory memory,
+                                      VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle,
+                                      uint32_t doLock);
+#endif
+#ifdef VK_NV_win32_keyed_mutex
+#endif
+#ifdef VK_EXT_validation_flags
+#endif
+#ifdef VK_NN_vi_surface
+    VkResult vkCreateViSurfaceNN(VkInstance instance, const VkViSurfaceCreateInfoNN* pCreateInfo,
+                                 const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface,
+                                 uint32_t doLock);
+#endif
+#ifdef VK_EXT_shader_subgroup_ballot
+#endif
+#ifdef VK_EXT_shader_subgroup_vote
+#endif
+#ifdef VK_EXT_texture_compression_astc_hdr
+#endif
+#ifdef VK_EXT_astc_decode_mode
+#endif
+#ifdef VK_EXT_conditional_rendering
+    void vkCmdBeginConditionalRenderingEXT(
+        VkCommandBuffer commandBuffer,
+        const VkConditionalRenderingBeginInfoEXT* pConditionalRenderingBegin, uint32_t doLock);
+    void vkCmdEndConditionalRenderingEXT(VkCommandBuffer commandBuffer, uint32_t doLock);
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+    void vkCmdSetViewportWScalingNV(VkCommandBuffer commandBuffer, uint32_t firstViewport,
+                                    uint32_t viewportCount,
+                                    const VkViewportWScalingNV* pViewportWScalings,
+                                    uint32_t doLock);
+#endif
+#ifdef VK_EXT_direct_mode_display
+    VkResult vkReleaseDisplayEXT(VkPhysicalDevice physicalDevice, VkDisplayKHR display,
+                                 uint32_t doLock);
+#endif
+#ifdef VK_EXT_acquire_xlib_display
+    VkResult vkAcquireXlibDisplayEXT(VkPhysicalDevice physicalDevice, Display* dpy,
+                                     VkDisplayKHR display, uint32_t doLock);
+    VkResult vkGetRandROutputDisplayEXT(VkPhysicalDevice physicalDevice, Display* dpy,
+                                        RROutput rrOutput, VkDisplayKHR* pDisplay, uint32_t doLock);
+#endif
+#ifdef VK_EXT_display_surface_counter
+    VkResult vkGetPhysicalDeviceSurfaceCapabilities2EXT(
+        VkPhysicalDevice physicalDevice, VkSurfaceKHR surface,
+        VkSurfaceCapabilities2EXT* pSurfaceCapabilities, uint32_t doLock);
+#endif
+#ifdef VK_EXT_display_control
+    VkResult vkDisplayPowerControlEXT(VkDevice device, VkDisplayKHR display,
+                                      const VkDisplayPowerInfoEXT* pDisplayPowerInfo,
+                                      uint32_t doLock);
+    VkResult vkRegisterDeviceEventEXT(VkDevice device, const VkDeviceEventInfoEXT* pDeviceEventInfo,
+                                      const VkAllocationCallbacks* pAllocator, VkFence* pFence,
+                                      uint32_t doLock);
+    VkResult vkRegisterDisplayEventEXT(VkDevice device, VkDisplayKHR display,
+                                       const VkDisplayEventInfoEXT* pDisplayEventInfo,
+                                       const VkAllocationCallbacks* pAllocator, VkFence* pFence,
+                                       uint32_t doLock);
+    VkResult vkGetSwapchainCounterEXT(VkDevice device, VkSwapchainKHR swapchain,
+                                      VkSurfaceCounterFlagBitsEXT counter, uint64_t* pCounterValue,
+                                      uint32_t doLock);
+#endif
+#ifdef VK_GOOGLE_display_timing
+    VkResult vkGetRefreshCycleDurationGOOGLE(VkDevice device, VkSwapchainKHR swapchain,
+                                             VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties,
+                                             uint32_t doLock);
+    VkResult vkGetPastPresentationTimingGOOGLE(VkDevice device, VkSwapchainKHR swapchain,
+                                               uint32_t* pPresentationTimingCount,
+                                               VkPastPresentationTimingGOOGLE* pPresentationTimings,
+                                               uint32_t doLock);
+#endif
+#ifdef VK_NV_sample_mask_override_coverage
+#endif
+#ifdef VK_NV_geometry_shader_passthrough
+#endif
+#ifdef VK_NV_viewport_array2
+#endif
+#ifdef VK_NVX_multiview_per_view_attributes
+#endif
+#ifdef VK_NV_viewport_swizzle
+#endif
+#ifdef VK_EXT_discard_rectangles
+    void vkCmdSetDiscardRectangleEXT(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle,
+                                     uint32_t discardRectangleCount,
+                                     const VkRect2D* pDiscardRectangles, uint32_t doLock);
+#endif
+#ifdef VK_EXT_conservative_rasterization
+#endif
+#ifdef VK_EXT_depth_clip_enable
+#endif
+#ifdef VK_EXT_swapchain_colorspace
+#endif
+#ifdef VK_EXT_hdr_metadata
+    void vkSetHdrMetadataEXT(VkDevice device, uint32_t swapchainCount,
+                             const VkSwapchainKHR* pSwapchains, const VkHdrMetadataEXT* pMetadata,
+                             uint32_t doLock);
+#endif
+#ifdef VK_MVK_ios_surface
+    VkResult vkCreateIOSSurfaceMVK(VkInstance instance,
+                                   const VkIOSSurfaceCreateInfoMVK* pCreateInfo,
+                                   const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface,
+                                   uint32_t doLock);
+#endif
+#ifdef VK_MVK_macos_surface
+    VkResult vkCreateMacOSSurfaceMVK(VkInstance instance,
+                                     const VkMacOSSurfaceCreateInfoMVK* pCreateInfo,
+                                     const VkAllocationCallbacks* pAllocator,
+                                     VkSurfaceKHR* pSurface, uint32_t doLock);
+#endif
+#ifdef VK_MVK_moltenvk
+    void vkGetMTLDeviceMVK(VkPhysicalDevice physicalDevice, void** pMTLDevice, uint32_t doLock);
+    VkResult vkSetMTLTextureMVK(VkImage image, void* mtlTexture, uint32_t doLock);
+    void vkGetMTLTextureMVK(VkImage image, void** pMTLTexture, uint32_t doLock);
+    void vkGetMTLBufferMVK(VkBuffer buffer, void** pMTLBuffer, uint32_t doLock);
+    VkResult vkUseIOSurfaceMVK(VkImage image, void* ioSurface, uint32_t doLock);
+    void vkGetIOSurfaceMVK(VkImage image, void** pIOSurface, uint32_t doLock);
+#endif
+#ifdef VK_EXT_external_memory_dma_buf
+#endif
+#ifdef VK_EXT_queue_family_foreign
+#endif
+#ifdef VK_EXT_debug_utils
+    VkResult vkSetDebugUtilsObjectNameEXT(VkDevice device,
+                                          const VkDebugUtilsObjectNameInfoEXT* pNameInfo,
+                                          uint32_t doLock);
+    VkResult vkSetDebugUtilsObjectTagEXT(VkDevice device,
+                                         const VkDebugUtilsObjectTagInfoEXT* pTagInfo,
+                                         uint32_t doLock);
+    void vkQueueBeginDebugUtilsLabelEXT(VkQueue queue, const VkDebugUtilsLabelEXT* pLabelInfo,
+                                        uint32_t doLock);
+    void vkQueueEndDebugUtilsLabelEXT(VkQueue queue, uint32_t doLock);
+    void vkQueueInsertDebugUtilsLabelEXT(VkQueue queue, const VkDebugUtilsLabelEXT* pLabelInfo,
+                                         uint32_t doLock);
+    void vkCmdBeginDebugUtilsLabelEXT(VkCommandBuffer commandBuffer,
+                                      const VkDebugUtilsLabelEXT* pLabelInfo, uint32_t doLock);
+    void vkCmdEndDebugUtilsLabelEXT(VkCommandBuffer commandBuffer, uint32_t doLock);
+    void vkCmdInsertDebugUtilsLabelEXT(VkCommandBuffer commandBuffer,
+                                       const VkDebugUtilsLabelEXT* pLabelInfo, uint32_t doLock);
+    VkResult vkCreateDebugUtilsMessengerEXT(VkInstance instance,
+                                            const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo,
+                                            const VkAllocationCallbacks* pAllocator,
+                                            VkDebugUtilsMessengerEXT* pMessenger, uint32_t doLock);
+    void vkDestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT messenger,
+                                         const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    void vkSubmitDebugUtilsMessageEXT(VkInstance instance,
+                                      VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
+                                      VkDebugUtilsMessageTypeFlagsEXT messageTypes,
+                                      const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData,
+                                      uint32_t doLock);
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+    VkResult vkGetAndroidHardwareBufferPropertiesANDROID(
+        VkDevice device, const AHardwareBuffer* buffer,
+        VkAndroidHardwareBufferPropertiesANDROID* pProperties, uint32_t doLock);
+    VkResult vkGetMemoryAndroidHardwareBufferANDROID(
+        VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo,
+        AHardwareBuffer** pBuffer, uint32_t doLock);
+#endif
+#ifdef VK_EXT_sampler_filter_minmax
+#endif
+#ifdef VK_AMD_gpu_shader_int16
+#endif
+#ifdef VK_AMD_mixed_attachment_samples
+#endif
+#ifdef VK_AMD_shader_fragment_mask
+#endif
+#ifdef VK_EXT_inline_uniform_block
+#endif
+#ifdef VK_EXT_shader_stencil_export
+#endif
+#ifdef VK_EXT_sample_locations
+    void vkCmdSetSampleLocationsEXT(VkCommandBuffer commandBuffer,
+                                    const VkSampleLocationsInfoEXT* pSampleLocationsInfo,
+                                    uint32_t doLock);
+    void vkGetPhysicalDeviceMultisamplePropertiesEXT(
+        VkPhysicalDevice physicalDevice, VkSampleCountFlagBits samples,
+        VkMultisamplePropertiesEXT* pMultisampleProperties, uint32_t doLock);
+#endif
+#ifdef VK_EXT_blend_operation_advanced
+#endif
+#ifdef VK_NV_fragment_coverage_to_color
+#endif
+#ifdef VK_NV_framebuffer_mixed_samples
+#endif
+#ifdef VK_NV_fill_rectangle
+#endif
+#ifdef VK_NV_shader_sm_builtins
+#endif
+#ifdef VK_EXT_post_depth_coverage
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+    VkResult vkGetImageDrmFormatModifierPropertiesEXT(
+        VkDevice device, VkImage image, VkImageDrmFormatModifierPropertiesEXT* pProperties,
+        uint32_t doLock);
+#endif
+#ifdef VK_EXT_validation_cache
+    VkResult vkCreateValidationCacheEXT(VkDevice device,
+                                        const VkValidationCacheCreateInfoEXT* pCreateInfo,
+                                        const VkAllocationCallbacks* pAllocator,
+                                        VkValidationCacheEXT* pValidationCache, uint32_t doLock);
+    void vkDestroyValidationCacheEXT(VkDevice device, VkValidationCacheEXT validationCache,
+                                     const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    VkResult vkMergeValidationCachesEXT(VkDevice device, VkValidationCacheEXT dstCache,
+                                        uint32_t srcCacheCount,
+                                        const VkValidationCacheEXT* pSrcCaches, uint32_t doLock);
+    VkResult vkGetValidationCacheDataEXT(VkDevice device, VkValidationCacheEXT validationCache,
+                                         size_t* pDataSize, void* pData, uint32_t doLock);
+#endif
+#ifdef VK_EXT_descriptor_indexing
+#endif
+#ifdef VK_EXT_shader_viewport_index_layer
+#endif
+#ifdef VK_NV_shading_rate_image
+    void vkCmdBindShadingRateImageNV(VkCommandBuffer commandBuffer, VkImageView imageView,
+                                     VkImageLayout imageLayout, uint32_t doLock);
+    void vkCmdSetViewportShadingRatePaletteNV(VkCommandBuffer commandBuffer, uint32_t firstViewport,
+                                              uint32_t viewportCount,
+                                              const VkShadingRatePaletteNV* pShadingRatePalettes,
+                                              uint32_t doLock);
+    void vkCmdSetCoarseSampleOrderNV(VkCommandBuffer commandBuffer,
+                                     VkCoarseSampleOrderTypeNV sampleOrderType,
+                                     uint32_t customSampleOrderCount,
+                                     const VkCoarseSampleOrderCustomNV* pCustomSampleOrders,
+                                     uint32_t doLock);
+#endif
+#ifdef VK_NV_ray_tracing
+    VkResult vkCreateAccelerationStructureNV(VkDevice device,
+                                             const VkAccelerationStructureCreateInfoNV* pCreateInfo,
+                                             const VkAllocationCallbacks* pAllocator,
+                                             VkAccelerationStructureNV* pAccelerationStructure,
+                                             uint32_t doLock);
+    void vkDestroyAccelerationStructureNV(VkDevice device,
+                                          VkAccelerationStructureNV accelerationStructure,
+                                          const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    void vkGetAccelerationStructureMemoryRequirementsNV(
+        VkDevice device, const VkAccelerationStructureMemoryRequirementsInfoNV* pInfo,
+        VkMemoryRequirements2KHR* pMemoryRequirements, uint32_t doLock);
+    VkResult vkBindAccelerationStructureMemoryNV(
+        VkDevice device, uint32_t bindInfoCount,
+        const VkBindAccelerationStructureMemoryInfoNV* pBindInfos, uint32_t doLock);
+    void vkCmdBuildAccelerationStructureNV(VkCommandBuffer commandBuffer,
+                                           const VkAccelerationStructureInfoNV* pInfo,
+                                           VkBuffer instanceData, VkDeviceSize instanceOffset,
+                                           VkBool32 update, VkAccelerationStructureNV dst,
+                                           VkAccelerationStructureNV src, VkBuffer scratch,
+                                           VkDeviceSize scratchOffset, uint32_t doLock);
+    void vkCmdCopyAccelerationStructureNV(VkCommandBuffer commandBuffer,
+                                          VkAccelerationStructureNV dst,
+                                          VkAccelerationStructureNV src,
+                                          VkCopyAccelerationStructureModeKHR mode, uint32_t doLock);
+    void vkCmdTraceRaysNV(
+        VkCommandBuffer commandBuffer, VkBuffer raygenShaderBindingTableBuffer,
+        VkDeviceSize raygenShaderBindingOffset, VkBuffer missShaderBindingTableBuffer,
+        VkDeviceSize missShaderBindingOffset, VkDeviceSize missShaderBindingStride,
+        VkBuffer hitShaderBindingTableBuffer, VkDeviceSize hitShaderBindingOffset,
+        VkDeviceSize hitShaderBindingStride, VkBuffer callableShaderBindingTableBuffer,
+        VkDeviceSize callableShaderBindingOffset, VkDeviceSize callableShaderBindingStride,
+        uint32_t width, uint32_t height, uint32_t depth, uint32_t doLock);
+    VkResult vkCreateRayTracingPipelinesNV(VkDevice device, VkPipelineCache pipelineCache,
+                                           uint32_t createInfoCount,
+                                           const VkRayTracingPipelineCreateInfoNV* pCreateInfos,
+                                           const VkAllocationCallbacks* pAllocator,
+                                           VkPipeline* pPipelines, uint32_t doLock);
+    VkResult vkGetRayTracingShaderGroupHandlesKHR(VkDevice device, VkPipeline pipeline,
+                                                  uint32_t firstGroup, uint32_t groupCount,
+                                                  size_t dataSize, void* pData, uint32_t doLock);
+    VkResult vkGetRayTracingShaderGroupHandlesNV(VkDevice device, VkPipeline pipeline,
+                                                 uint32_t firstGroup, uint32_t groupCount,
+                                                 size_t dataSize, void* pData, uint32_t doLock);
+    VkResult vkGetAccelerationStructureHandleNV(VkDevice device,
+                                                VkAccelerationStructureNV accelerationStructure,
+                                                size_t dataSize, void* pData, uint32_t doLock);
+    void vkCmdWriteAccelerationStructuresPropertiesNV(
+        VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount,
+        const VkAccelerationStructureNV* pAccelerationStructures, VkQueryType queryType,
+        VkQueryPool queryPool, uint32_t firstQuery, uint32_t doLock);
+    VkResult vkCompileDeferredNV(VkDevice device, VkPipeline pipeline, uint32_t shader,
+                                 uint32_t doLock);
+#endif
+#ifdef VK_NV_representative_fragment_test
+#endif
+#ifdef VK_EXT_filter_cubic
+#endif
+#ifdef VK_QCOM_render_pass_shader_resolve
+#endif
+#ifdef VK_EXT_global_priority
+#endif
+#ifdef VK_EXT_external_memory_host
+    VkResult vkGetMemoryHostPointerPropertiesEXT(
+        VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void* pHostPointer,
+        VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties, uint32_t doLock);
+#endif
+#ifdef VK_AMD_buffer_marker
+    void vkCmdWriteBufferMarkerAMD(VkCommandBuffer commandBuffer,
+                                   VkPipelineStageFlagBits pipelineStage, VkBuffer dstBuffer,
+                                   VkDeviceSize dstOffset, uint32_t marker, uint32_t doLock);
+#endif
+#ifdef VK_AMD_pipeline_compiler_control
+#endif
+#ifdef VK_EXT_calibrated_timestamps
+    VkResult vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(VkPhysicalDevice physicalDevice,
+                                                            uint32_t* pTimeDomainCount,
+                                                            VkTimeDomainEXT* pTimeDomains,
+                                                            uint32_t doLock);
+    VkResult vkGetCalibratedTimestampsEXT(VkDevice device, uint32_t timestampCount,
+                                          const VkCalibratedTimestampInfoEXT* pTimestampInfos,
+                                          uint64_t* pTimestamps, uint64_t* pMaxDeviation,
+                                          uint32_t doLock);
+#endif
+#ifdef VK_AMD_shader_core_properties
+#endif
+#ifdef VK_EXT_video_decode_h265
+#endif
+#ifdef VK_AMD_memory_overallocation_behavior
+#endif
+#ifdef VK_EXT_vertex_attribute_divisor
+#endif
+#ifdef VK_GGP_frame_token
+#endif
+#ifdef VK_EXT_pipeline_creation_feedback
+#endif
+#ifdef VK_NV_shader_subgroup_partitioned
+#endif
+#ifdef VK_NV_compute_shader_derivatives
+#endif
+#ifdef VK_NV_mesh_shader
+    void vkCmdDrawMeshTasksNV(VkCommandBuffer commandBuffer, uint32_t taskCount, uint32_t firstTask,
+                              uint32_t doLock);
+    void vkCmdDrawMeshTasksIndirectNV(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                      VkDeviceSize offset, uint32_t drawCount, uint32_t stride,
+                                      uint32_t doLock);
+    void vkCmdDrawMeshTasksIndirectCountNV(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                           VkDeviceSize offset, VkBuffer countBuffer,
+                                           VkDeviceSize countBufferOffset, uint32_t maxDrawCount,
+                                           uint32_t stride, uint32_t doLock);
+#endif
+#ifdef VK_NV_fragment_shader_barycentric
+#endif
+#ifdef VK_NV_shader_image_footprint
+#endif
+#ifdef VK_NV_scissor_exclusive
+    void vkCmdSetExclusiveScissorNV(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor,
+                                    uint32_t exclusiveScissorCount,
+                                    const VkRect2D* pExclusiveScissors, uint32_t doLock);
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+    void vkCmdSetCheckpointNV(VkCommandBuffer commandBuffer, const void* pCheckpointMarker,
+                              uint32_t doLock);
+    void vkGetQueueCheckpointDataNV(VkQueue queue, uint32_t* pCheckpointDataCount,
+                                    VkCheckpointDataNV* pCheckpointData, uint32_t doLock);
+#endif
+#ifdef VK_INTEL_shader_integer_functions2
+#endif
+#ifdef VK_INTEL_performance_query
+    VkResult vkInitializePerformanceApiINTEL(
+        VkDevice device, const VkInitializePerformanceApiInfoINTEL* pInitializeInfo,
+        uint32_t doLock);
+    void vkUninitializePerformanceApiINTEL(VkDevice device, uint32_t doLock);
+    VkResult vkCmdSetPerformanceMarkerINTEL(VkCommandBuffer commandBuffer,
+                                            const VkPerformanceMarkerInfoINTEL* pMarkerInfo,
+                                            uint32_t doLock);
+    VkResult vkCmdSetPerformanceStreamMarkerINTEL(
+        VkCommandBuffer commandBuffer, const VkPerformanceStreamMarkerInfoINTEL* pMarkerInfo,
+        uint32_t doLock);
+    VkResult vkCmdSetPerformanceOverrideINTEL(VkCommandBuffer commandBuffer,
+                                              const VkPerformanceOverrideInfoINTEL* pOverrideInfo,
+                                              uint32_t doLock);
+    VkResult vkAcquirePerformanceConfigurationINTEL(
+        VkDevice device, const VkPerformanceConfigurationAcquireInfoINTEL* pAcquireInfo,
+        VkPerformanceConfigurationINTEL* pConfiguration, uint32_t doLock);
+    VkResult vkReleasePerformanceConfigurationINTEL(VkDevice device,
+                                                    VkPerformanceConfigurationINTEL configuration,
+                                                    uint32_t doLock);
+    VkResult vkQueueSetPerformanceConfigurationINTEL(VkQueue queue,
+                                                     VkPerformanceConfigurationINTEL configuration,
+                                                     uint32_t doLock);
+    VkResult vkGetPerformanceParameterINTEL(VkDevice device,
+                                            VkPerformanceParameterTypeINTEL parameter,
+                                            VkPerformanceValueINTEL* pValue, uint32_t doLock);
+#endif
+#ifdef VK_EXT_pci_bus_info
+#endif
+#ifdef VK_AMD_display_native_hdr
+    void vkSetLocalDimmingAMD(VkDevice device, VkSwapchainKHR swapChain,
+                              VkBool32 localDimmingEnable, uint32_t doLock);
+#endif
+#ifdef VK_FUCHSIA_imagepipe_surface
+    VkResult vkCreateImagePipeSurfaceFUCHSIA(VkInstance instance,
+                                             const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo,
+                                             const VkAllocationCallbacks* pAllocator,
+                                             VkSurfaceKHR* pSurface, uint32_t doLock);
+#endif
+#ifdef VK_EXT_metal_surface
+    VkResult vkCreateMetalSurfaceEXT(VkInstance instance,
+                                     const VkMetalSurfaceCreateInfoEXT* pCreateInfo,
+                                     const VkAllocationCallbacks* pAllocator,
+                                     VkSurfaceKHR* pSurface, uint32_t doLock);
+#endif
+#ifdef VK_EXT_fragment_density_map
+#endif
+#ifdef VK_EXT_scalar_block_layout
+#endif
+#ifdef VK_GOOGLE_hlsl_functionality1
+#endif
+#ifdef VK_GOOGLE_decorate_string
+#endif
+#ifdef VK_EXT_subgroup_size_control
+#endif
+#ifdef VK_AMD_shader_core_properties2
+#endif
+#ifdef VK_AMD_device_coherent_memory
+#endif
+#ifdef VK_EXT_shader_image_atomic_int64
+#endif
+#ifdef VK_EXT_memory_budget
+#endif
+#ifdef VK_EXT_memory_priority
+#endif
+#ifdef VK_NV_dedicated_allocation_image_aliasing
+#endif
+#ifdef VK_EXT_buffer_device_address
+    VkDeviceAddress vkGetBufferDeviceAddressEXT(VkDevice device,
+                                                const VkBufferDeviceAddressInfo* pInfo,
+                                                uint32_t doLock);
+#endif
+#ifdef VK_EXT_tooling_info
+    VkResult vkGetPhysicalDeviceToolPropertiesEXT(
+        VkPhysicalDevice physicalDevice, uint32_t* pToolCount,
+        VkPhysicalDeviceToolPropertiesEXT* pToolProperties, uint32_t doLock);
+#endif
+#ifdef VK_EXT_separate_stencil_usage
+#endif
+#ifdef VK_EXT_validation_features
+#endif
+#ifdef VK_NV_cooperative_matrix
+    VkResult vkGetPhysicalDeviceCooperativeMatrixPropertiesNV(
+        VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount,
+        VkCooperativeMatrixPropertiesNV* pProperties, uint32_t doLock);
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+    VkResult vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV(
+        VkPhysicalDevice physicalDevice, uint32_t* pCombinationCount,
+        VkFramebufferMixedSamplesCombinationNV* pCombinations, uint32_t doLock);
+#endif
+#ifdef VK_EXT_fragment_shader_interlock
+#endif
+#ifdef VK_EXT_ycbcr_image_arrays
+#endif
+#ifdef VK_EXT_provoking_vertex
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+    VkResult vkGetPhysicalDeviceSurfacePresentModes2EXT(
+        VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
+        uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes, uint32_t doLock);
+    VkResult vkAcquireFullScreenExclusiveModeEXT(VkDevice device, VkSwapchainKHR swapchain,
+                                                 uint32_t doLock);
+    VkResult vkReleaseFullScreenExclusiveModeEXT(VkDevice device, VkSwapchainKHR swapchain,
+                                                 uint32_t doLock);
+    VkResult vkGetDeviceGroupSurfacePresentModes2EXT(
+        VkDevice device, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
+        VkDeviceGroupPresentModeFlagsKHR* pModes, uint32_t doLock);
+#endif
+#ifdef VK_EXT_headless_surface
+    VkResult vkCreateHeadlessSurfaceEXT(VkInstance instance,
+                                        const VkHeadlessSurfaceCreateInfoEXT* pCreateInfo,
+                                        const VkAllocationCallbacks* pAllocator,
+                                        VkSurfaceKHR* pSurface, uint32_t doLock);
+#endif
+#ifdef VK_EXT_line_rasterization
+    void vkCmdSetLineStippleEXT(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor,
+                                uint16_t lineStipplePattern, uint32_t doLock);
+#endif
+#ifdef VK_EXT_shader_atomic_float
+#endif
+#ifdef VK_EXT_host_query_reset
+    void vkResetQueryPoolEXT(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery,
+                             uint32_t queryCount, uint32_t doLock);
+#endif
+#ifdef VK_EXT_index_type_uint8
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+    void vkCmdSetCullModeEXT(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode,
+                             uint32_t doLock);
+    void vkCmdSetFrontFaceEXT(VkCommandBuffer commandBuffer, VkFrontFace frontFace,
+                              uint32_t doLock);
+    void vkCmdSetPrimitiveTopologyEXT(VkCommandBuffer commandBuffer,
+                                      VkPrimitiveTopology primitiveTopology, uint32_t doLock);
+    void vkCmdSetViewportWithCountEXT(VkCommandBuffer commandBuffer, uint32_t viewportCount,
+                                      const VkViewport* pViewports, uint32_t doLock);
+    void vkCmdSetScissorWithCountEXT(VkCommandBuffer commandBuffer, uint32_t scissorCount,
+                                     const VkRect2D* pScissors, uint32_t doLock);
+    void vkCmdBindVertexBuffers2EXT(VkCommandBuffer commandBuffer, uint32_t firstBinding,
+                                    uint32_t bindingCount, const VkBuffer* pBuffers,
+                                    const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes,
+                                    const VkDeviceSize* pStrides, uint32_t doLock);
+    void vkCmdSetDepthTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthTestEnable,
+                                    uint32_t doLock);
+    void vkCmdSetDepthWriteEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable,
+                                     uint32_t doLock);
+    void vkCmdSetDepthCompareOpEXT(VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp,
+                                   uint32_t doLock);
+    void vkCmdSetDepthBoundsTestEnableEXT(VkCommandBuffer commandBuffer,
+                                          VkBool32 depthBoundsTestEnable, uint32_t doLock);
+    void vkCmdSetStencilTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable,
+                                      uint32_t doLock);
+    void vkCmdSetStencilOpEXT(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask,
+                              VkStencilOp failOp, VkStencilOp passOp, VkStencilOp depthFailOp,
+                              VkCompareOp compareOp, uint32_t doLock);
+#endif
+#ifdef VK_EXT_shader_atomic_float2
+#endif
+#ifdef VK_EXT_shader_demote_to_helper_invocation
+#endif
+#ifdef VK_NV_device_generated_commands
+    void vkGetGeneratedCommandsMemoryRequirementsNV(
+        VkDevice device, const VkGeneratedCommandsMemoryRequirementsInfoNV* pInfo,
+        VkMemoryRequirements2* pMemoryRequirements, uint32_t doLock);
+    void vkCmdPreprocessGeneratedCommandsNV(VkCommandBuffer commandBuffer,
+                                            const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo,
+                                            uint32_t doLock);
+    void vkCmdExecuteGeneratedCommandsNV(VkCommandBuffer commandBuffer, VkBool32 isPreprocessed,
+                                         const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo,
+                                         uint32_t doLock);
+    void vkCmdBindPipelineShaderGroupNV(VkCommandBuffer commandBuffer,
+                                        VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline,
+                                        uint32_t groupIndex, uint32_t doLock);
+    VkResult vkCreateIndirectCommandsLayoutNV(
+        VkDevice device, const VkIndirectCommandsLayoutCreateInfoNV* pCreateInfo,
+        const VkAllocationCallbacks* pAllocator,
+        VkIndirectCommandsLayoutNV* pIndirectCommandsLayout, uint32_t doLock);
+    void vkDestroyIndirectCommandsLayoutNV(VkDevice device,
+                                           VkIndirectCommandsLayoutNV indirectCommandsLayout,
+                                           const VkAllocationCallbacks* pAllocator,
+                                           uint32_t doLock);
+#endif
+#ifdef VK_NV_inherited_viewport_scissor
+#endif
+#ifdef VK_EXT_texel_buffer_alignment
+#endif
+#ifdef VK_QCOM_render_pass_transform
+#endif
+#ifdef VK_EXT_device_memory_report
+#endif
+#ifdef VK_EXT_acquire_drm_display
+    VkResult vkAcquireDrmDisplayEXT(VkPhysicalDevice physicalDevice, int32_t drmFd,
+                                    VkDisplayKHR display, uint32_t doLock);
+    VkResult vkGetDrmDisplayEXT(VkPhysicalDevice physicalDevice, int32_t drmFd,
+                                uint32_t connectorId, VkDisplayKHR* display, uint32_t doLock);
+#endif
+#ifdef VK_EXT_robustness2
+#endif
+#ifdef VK_EXT_custom_border_color
+#endif
+#ifdef VK_GOOGLE_user_type
+#endif
+#ifdef VK_EXT_private_data
+    VkResult vkCreatePrivateDataSlotEXT(VkDevice device,
+                                        const VkPrivateDataSlotCreateInfoEXT* pCreateInfo,
+                                        const VkAllocationCallbacks* pAllocator,
+                                        VkPrivateDataSlotEXT* pPrivateDataSlot, uint32_t doLock);
+    void vkDestroyPrivateDataSlotEXT(VkDevice device, VkPrivateDataSlotEXT privateDataSlot,
+                                     const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    VkResult vkSetPrivateDataEXT(VkDevice device, VkObjectType objectType, uint64_t objectHandle,
+                                 VkPrivateDataSlotEXT privateDataSlot, uint64_t data,
+                                 uint32_t doLock);
+    void vkGetPrivateDataEXT(VkDevice device, VkObjectType objectType, uint64_t objectHandle,
+                             VkPrivateDataSlotEXT privateDataSlot, uint64_t* pData,
+                             uint32_t doLock);
+#endif
+#ifdef VK_EXT_pipeline_creation_cache_control
+#endif
+#ifdef VK_NV_device_diagnostics_config
+#endif
+#ifdef VK_QCOM_render_pass_store_ops
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+    void vkCmdSetFragmentShadingRateEnumNV(VkCommandBuffer commandBuffer,
+                                           VkFragmentShadingRateNV shadingRate,
+                                           const VkFragmentShadingRateCombinerOpKHR combinerOps[2],
+                                           uint32_t doLock);
+#endif
+#ifdef VK_NV_ray_tracing_motion_blur
+#endif
+#ifdef VK_EXT_ycbcr_2plane_444_formats
+#endif
+#ifdef VK_EXT_fragment_density_map2
+#endif
+#ifdef VK_QCOM_rotated_copy_commands
+#endif
+#ifdef VK_EXT_image_robustness
+#endif
+#ifdef VK_EXT_4444_formats
+#endif
+#ifdef VK_EXT_rgba10x6_formats
+#endif
+#ifdef VK_NV_acquire_winrt_display
+    VkResult vkAcquireWinrtDisplayNV(VkPhysicalDevice physicalDevice, VkDisplayKHR display,
+                                     uint32_t doLock);
+    VkResult vkGetWinrtDisplayNV(VkPhysicalDevice physicalDevice, uint32_t deviceRelativeId,
+                                 VkDisplayKHR* pDisplay, uint32_t doLock);
+#endif
+#ifdef VK_EXT_directfb_surface
+    VkResult vkCreateDirectFBSurfaceEXT(VkInstance instance,
+                                        const VkDirectFBSurfaceCreateInfoEXT* pCreateInfo,
+                                        const VkAllocationCallbacks* pAllocator,
+                                        VkSurfaceKHR* pSurface, uint32_t doLock);
+    VkBool32 vkGetPhysicalDeviceDirectFBPresentationSupportEXT(VkPhysicalDevice physicalDevice,
+                                                               uint32_t queueFamilyIndex,
+                                                               IDirectFB* dfb, uint32_t doLock);
+#endif
+#ifdef VK_VALVE_mutable_descriptor_type
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+    void vkCmdSetVertexInputEXT(
+        VkCommandBuffer commandBuffer, uint32_t vertexBindingDescriptionCount,
+        const VkVertexInputBindingDescription2EXT* pVertexBindingDescriptions,
+        uint32_t vertexAttributeDescriptionCount,
+        const VkVertexInputAttributeDescription2EXT* pVertexAttributeDescriptions, uint32_t doLock);
+#endif
+#ifdef VK_EXT_physical_device_drm
+#endif
+#ifdef VK_EXT_primitive_topology_list_restart
+#endif
+#ifdef VK_FUCHSIA_external_memory
+    VkResult vkGetMemoryZirconHandleFUCHSIA(
+        VkDevice device, const VkMemoryGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo,
+        zx_handle_t* pZirconHandle, uint32_t doLock);
+    VkResult vkGetMemoryZirconHandlePropertiesFUCHSIA(
+        VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, zx_handle_t zirconHandle,
+        VkMemoryZirconHandlePropertiesFUCHSIA* pMemoryZirconHandleProperties, uint32_t doLock);
+#endif
+#ifdef VK_FUCHSIA_external_semaphore
+    VkResult vkImportSemaphoreZirconHandleFUCHSIA(
+        VkDevice device,
+        const VkImportSemaphoreZirconHandleInfoFUCHSIA* pImportSemaphoreZirconHandleInfo,
+        uint32_t doLock);
+    VkResult vkGetSemaphoreZirconHandleFUCHSIA(
+        VkDevice device, const VkSemaphoreGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo,
+        zx_handle_t* pZirconHandle, uint32_t doLock);
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+    VkResult vkCreateBufferCollectionFUCHSIA(VkDevice device,
+                                             const VkBufferCollectionCreateInfoFUCHSIA* pCreateInfo,
+                                             const VkAllocationCallbacks* pAllocator,
+                                             VkBufferCollectionFUCHSIA* pCollection,
+                                             uint32_t doLock);
+    VkResult vkSetBufferCollectionImageConstraintsFUCHSIA(
+        VkDevice device, VkBufferCollectionFUCHSIA collection,
+        const VkImageConstraintsInfoFUCHSIA* pImageConstraintsInfo, uint32_t doLock);
+    VkResult vkSetBufferCollectionBufferConstraintsFUCHSIA(
+        VkDevice device, VkBufferCollectionFUCHSIA collection,
+        const VkBufferConstraintsInfoFUCHSIA* pBufferConstraintsInfo, uint32_t doLock);
+    void vkDestroyBufferCollectionFUCHSIA(VkDevice device, VkBufferCollectionFUCHSIA collection,
+                                          const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    VkResult vkGetBufferCollectionPropertiesFUCHSIA(
+        VkDevice device, VkBufferCollectionFUCHSIA collection,
+        VkBufferCollectionPropertiesFUCHSIA* pProperties, uint32_t doLock);
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+    VkResult vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI(VkDevice device,
+                                                             VkRenderPass renderpass,
+                                                             VkExtent2D* pMaxWorkgroupSize,
+                                                             uint32_t doLock);
+    void vkCmdSubpassShadingHUAWEI(VkCommandBuffer commandBuffer, uint32_t doLock);
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+    void vkCmdBindInvocationMaskHUAWEI(VkCommandBuffer commandBuffer, VkImageView imageView,
+                                       VkImageLayout imageLayout, uint32_t doLock);
+#endif
+#ifdef VK_NV_external_memory_rdma
+    VkResult vkGetMemoryRemoteAddressNV(
+        VkDevice device, const VkMemoryGetRemoteAddressInfoNV* pMemoryGetRemoteAddressInfo,
+        VkRemoteAddressNV* pAddress, uint32_t doLock);
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+    void vkCmdSetPatchControlPointsEXT(VkCommandBuffer commandBuffer, uint32_t patchControlPoints,
+                                       uint32_t doLock);
+    void vkCmdSetRasterizerDiscardEnableEXT(VkCommandBuffer commandBuffer,
+                                            VkBool32 rasterizerDiscardEnable, uint32_t doLock);
+    void vkCmdSetDepthBiasEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthBiasEnable,
+                                    uint32_t doLock);
+    void vkCmdSetLogicOpEXT(VkCommandBuffer commandBuffer, VkLogicOp logicOp, uint32_t doLock);
+    void vkCmdSetPrimitiveRestartEnableEXT(VkCommandBuffer commandBuffer,
+                                           VkBool32 primitiveRestartEnable, uint32_t doLock);
+#endif
+#ifdef VK_QNX_screen_surface
+    VkResult vkCreateScreenSurfaceQNX(VkInstance instance,
+                                      const VkScreenSurfaceCreateInfoQNX* pCreateInfo,
+                                      const VkAllocationCallbacks* pAllocator,
+                                      VkSurfaceKHR* pSurface, uint32_t doLock);
+    VkBool32 vkGetPhysicalDeviceScreenPresentationSupportQNX(VkPhysicalDevice physicalDevice,
+                                                             uint32_t queueFamilyIndex,
+                                                             _screen_window* window,
+                                                             uint32_t doLock);
+#endif
+#ifdef VK_EXT_color_write_enable
+    void vkCmdSetColorWriteEnableEXT(VkCommandBuffer commandBuffer, uint32_t attachmentCount,
+                                     const VkBool32* pColorWriteEnables, uint32_t doLock);
+#endif
+#ifdef VK_GOOGLE_gfxstream
+    VkResult vkMapMemoryIntoAddressSpaceGOOGLE(VkDevice device, VkDeviceMemory memory,
+                                               uint64_t* pAddress, uint32_t doLock);
+    void vkUpdateDescriptorSetWithTemplateSizedGOOGLE(
+        VkDevice device, VkDescriptorSet descriptorSet,
+        VkDescriptorUpdateTemplate descriptorUpdateTemplate, uint32_t imageInfoCount,
+        uint32_t bufferInfoCount, uint32_t bufferViewCount, const uint32_t* pImageInfoEntryIndices,
+        const uint32_t* pBufferInfoEntryIndices, const uint32_t* pBufferViewEntryIndices,
+        const VkDescriptorImageInfo* pImageInfos, const VkDescriptorBufferInfo* pBufferInfos,
+        const VkBufferView* pBufferViews, uint32_t doLock);
+    void vkBeginCommandBufferAsyncGOOGLE(VkCommandBuffer commandBuffer,
+                                         const VkCommandBufferBeginInfo* pBeginInfo,
+                                         uint32_t doLock);
+    void vkEndCommandBufferAsyncGOOGLE(VkCommandBuffer commandBuffer, uint32_t doLock);
+    void vkResetCommandBufferAsyncGOOGLE(VkCommandBuffer commandBuffer,
+                                         VkCommandBufferResetFlags flags, uint32_t doLock);
+    void vkCommandBufferHostSyncGOOGLE(VkCommandBuffer commandBuffer, uint32_t needHostSync,
+                                       uint32_t sequenceNumber, uint32_t doLock);
+    VkResult vkCreateImageWithRequirementsGOOGLE(VkDevice device,
+                                                 const VkImageCreateInfo* pCreateInfo,
+                                                 const VkAllocationCallbacks* pAllocator,
+                                                 VkImage* pImage,
+                                                 VkMemoryRequirements* pMemoryRequirements,
+                                                 uint32_t doLock);
+    VkResult vkCreateBufferWithRequirementsGOOGLE(VkDevice device,
+                                                  const VkBufferCreateInfo* pCreateInfo,
+                                                  const VkAllocationCallbacks* pAllocator,
+                                                  VkBuffer* pBuffer,
+                                                  VkMemoryRequirements* pMemoryRequirements,
+                                                  uint32_t doLock);
+    VkResult vkGetMemoryHostAddressInfoGOOGLE(VkDevice device, VkDeviceMemory memory,
+                                              uint64_t* pAddress, uint64_t* pSize,
+                                              uint64_t* pHostmemId, uint32_t doLock);
+    VkResult vkFreeMemorySyncGOOGLE(VkDevice device, VkDeviceMemory memory,
+                                    const VkAllocationCallbacks* pAllocator, uint32_t doLock);
+    void vkQueueHostSyncGOOGLE(VkQueue queue, uint32_t needHostSync, uint32_t sequenceNumber,
+                               uint32_t doLock);
+    void vkQueueSubmitAsyncGOOGLE(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits,
+                                  VkFence fence, uint32_t doLock);
+    void vkQueueWaitIdleAsyncGOOGLE(VkQueue queue, uint32_t doLock);
+    void vkQueueBindSparseAsyncGOOGLE(VkQueue queue, uint32_t bindInfoCount,
+                                      const VkBindSparseInfo* pBindInfo, VkFence fence,
+                                      uint32_t doLock);
+    void vkGetLinearImageLayoutGOOGLE(VkDevice device, VkFormat format, VkDeviceSize* pOffset,
+                                      VkDeviceSize* pRowPitchAlignment, uint32_t doLock);
+    void vkGetLinearImageLayout2GOOGLE(VkDevice device, const VkImageCreateInfo* pCreateInfo,
+                                       VkDeviceSize* pOffset, VkDeviceSize* pRowPitchAlignment,
+                                       uint32_t doLock);
+    void vkQueueFlushCommandsGOOGLE(VkQueue queue, VkCommandBuffer commandBuffer,
+                                    VkDeviceSize dataSize, const void* pData, uint32_t doLock);
+    void vkQueueCommitDescriptorSetUpdatesGOOGLE(
+        VkQueue queue, uint32_t descriptorPoolCount, const VkDescriptorPool* pDescriptorPools,
+        uint32_t descriptorSetCount, const VkDescriptorSetLayout* pSetLayouts,
+        const uint64_t* pDescriptorSetPoolIds, const uint32_t* pDescriptorSetWhichPool,
+        const uint32_t* pDescriptorSetPendingAllocation,
+        const uint32_t* pDescriptorWriteStartingIndices, uint32_t pendingDescriptorWriteCount,
+        const VkWriteDescriptorSet* pPendingDescriptorWrites, uint32_t doLock);
+    void vkCollectDescriptorPoolIdsGOOGLE(VkDevice device, VkDescriptorPool descriptorPool,
+                                          uint32_t* pPoolIdCount, uint64_t* pPoolIds,
+                                          uint32_t doLock);
+    void vkQueueSignalReleaseImageANDROIDAsyncGOOGLE(VkQueue queue, uint32_t waitSemaphoreCount,
+                                                     const VkSemaphore* pWaitSemaphores,
+                                                     VkImage image, uint32_t doLock);
+    void vkQueueFlushCommandsFromAuxMemoryGOOGLE(VkQueue queue, VkCommandBuffer commandBuffer,
+                                                 VkDeviceMemory deviceMemory,
+                                                 VkDeviceSize dataOffset, VkDeviceSize dataSize,
+                                                 uint32_t doLock);
+    VkResult vkGetBlobGOOGLE(VkDevice device, VkDeviceMemory memory, uint32_t doLock);
+#endif
+#ifdef VK_EXT_global_priority_query
+#endif
+#ifdef VK_EXT_multi_draw
+    void vkCmdDrawMultiEXT(VkCommandBuffer commandBuffer, uint32_t drawCount,
+                           const VkMultiDrawInfoEXT* pVertexInfo, uint32_t instanceCount,
+                           uint32_t firstInstance, uint32_t stride, uint32_t doLock);
+    void vkCmdDrawMultiIndexedEXT(VkCommandBuffer commandBuffer, uint32_t drawCount,
+                                  const VkMultiDrawIndexedInfoEXT* pIndexInfo,
+                                  uint32_t instanceCount, uint32_t firstInstance, uint32_t stride,
+                                  const int32_t* pVertexOffset, uint32_t doLock);
+#endif
+#ifdef VK_EXT_load_store_op_none
+#endif
+#ifdef VK_EXT_border_color_swizzle
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+    void vkSetDeviceMemoryPriorityEXT(VkDevice device, VkDeviceMemory memory, float priority,
+                                      uint32_t doLock);
+#endif
+#ifdef VK_KHR_acceleration_structure
+    VkResult vkCreateAccelerationStructureKHR(
+        VkDevice device, const VkAccelerationStructureCreateInfoKHR* pCreateInfo,
+        const VkAllocationCallbacks* pAllocator, VkAccelerationStructureKHR* pAccelerationStructure,
+        uint32_t doLock);
+    void vkDestroyAccelerationStructureKHR(VkDevice device,
+                                           VkAccelerationStructureKHR accelerationStructure,
+                                           const VkAllocationCallbacks* pAllocator,
+                                           uint32_t doLock);
+    void vkCmdBuildAccelerationStructuresKHR(
+        VkCommandBuffer commandBuffer, uint32_t infoCount,
+        const VkAccelerationStructureBuildGeometryInfoKHR* pInfos,
+        const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos, uint32_t doLock);
+    void vkCmdBuildAccelerationStructuresIndirectKHR(
+        VkCommandBuffer commandBuffer, uint32_t infoCount,
+        const VkAccelerationStructureBuildGeometryInfoKHR* pInfos,
+        const VkDeviceAddress* pIndirectDeviceAddresses, const uint32_t* pIndirectStrides,
+        const uint32_t* const* ppMaxPrimitiveCounts, uint32_t doLock);
+    VkResult vkBuildAccelerationStructuresKHR(
+        VkDevice device, VkDeferredOperationKHR deferredOperation, uint32_t infoCount,
+        const VkAccelerationStructureBuildGeometryInfoKHR* pInfos,
+        const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos, uint32_t doLock);
+    VkResult vkCopyAccelerationStructureKHR(VkDevice device,
+                                            VkDeferredOperationKHR deferredOperation,
+                                            const VkCopyAccelerationStructureInfoKHR* pInfo,
+                                            uint32_t doLock);
+    VkResult vkCopyAccelerationStructureToMemoryKHR(
+        VkDevice device, VkDeferredOperationKHR deferredOperation,
+        const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo, uint32_t doLock);
+    VkResult vkCopyMemoryToAccelerationStructureKHR(
+        VkDevice device, VkDeferredOperationKHR deferredOperation,
+        const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo, uint32_t doLock);
+    VkResult vkWriteAccelerationStructuresPropertiesKHR(
+        VkDevice device, uint32_t accelerationStructureCount,
+        const VkAccelerationStructureKHR* pAccelerationStructures, VkQueryType queryType,
+        size_t dataSize, void* pData, size_t stride, uint32_t doLock);
+    void vkCmdCopyAccelerationStructureKHR(VkCommandBuffer commandBuffer,
+                                           const VkCopyAccelerationStructureInfoKHR* pInfo,
+                                           uint32_t doLock);
+    void vkCmdCopyAccelerationStructureToMemoryKHR(
+        VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo,
+        uint32_t doLock);
+    void vkCmdCopyMemoryToAccelerationStructureKHR(
+        VkCommandBuffer commandBuffer, const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo,
+        uint32_t doLock);
+    VkDeviceAddress vkGetAccelerationStructureDeviceAddressKHR(
+        VkDevice device, const VkAccelerationStructureDeviceAddressInfoKHR* pInfo, uint32_t doLock);
+    void vkCmdWriteAccelerationStructuresPropertiesKHR(
+        VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount,
+        const VkAccelerationStructureKHR* pAccelerationStructures, VkQueryType queryType,
+        VkQueryPool queryPool, uint32_t firstQuery, uint32_t doLock);
+    void vkGetDeviceAccelerationStructureCompatibilityKHR(
+        VkDevice device, const VkAccelerationStructureVersionInfoKHR* pVersionInfo,
+        VkAccelerationStructureCompatibilityKHR* pCompatibility, uint32_t doLock);
+    void vkGetAccelerationStructureBuildSizesKHR(
+        VkDevice device, VkAccelerationStructureBuildTypeKHR buildType,
+        const VkAccelerationStructureBuildGeometryInfoKHR* pBuildInfo,
+        const uint32_t* pMaxPrimitiveCounts, VkAccelerationStructureBuildSizesInfoKHR* pSizeInfo,
+        uint32_t doLock);
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+    void vkCmdTraceRaysKHR(VkCommandBuffer commandBuffer,
+                           const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable,
+                           const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable,
+                           const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable,
+                           const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable,
+                           uint32_t width, uint32_t height, uint32_t depth, uint32_t doLock);
+    VkResult vkCreateRayTracingPipelinesKHR(VkDevice device,
+                                            VkDeferredOperationKHR deferredOperation,
+                                            VkPipelineCache pipelineCache, uint32_t createInfoCount,
+                                            const VkRayTracingPipelineCreateInfoKHR* pCreateInfos,
+                                            const VkAllocationCallbacks* pAllocator,
+                                            VkPipeline* pPipelines, uint32_t doLock);
+    VkResult vkGetRayTracingCaptureReplayShaderGroupHandlesKHR(VkDevice device, VkPipeline pipeline,
+                                                               uint32_t firstGroup,
+                                                               uint32_t groupCount, size_t dataSize,
+                                                               void* pData, uint32_t doLock);
+    void vkCmdTraceRaysIndirectKHR(
+        VkCommandBuffer commandBuffer,
+        const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable,
+        const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable,
+        const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable,
+        const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable,
+        VkDeviceAddress indirectDeviceAddress, uint32_t doLock);
+    VkDeviceSize vkGetRayTracingShaderGroupStackSizeKHR(VkDevice device, VkPipeline pipeline,
+                                                        uint32_t group,
+                                                        VkShaderGroupShaderKHR groupShader,
+                                                        uint32_t doLock);
+    void vkCmdSetRayTracingPipelineStackSizeKHR(VkCommandBuffer commandBuffer,
+                                                uint32_t pipelineStackSize, uint32_t doLock);
+#endif
+#ifdef VK_KHR_ray_query
+#endif
+
+   private:
+    class Impl;
+    std::unique_ptr<Impl> mImpl;
+    HealthMonitor<>* mHealthMonitor;
+};
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/VkEncoder.h.inl b/system/vulkan_enc/VkEncoder.h.inl
new file mode 100644
index 0000000..fc698d4
--- /dev/null
+++ b/system/vulkan_enc/VkEncoder.h.inl
@@ -0,0 +1,10 @@
+    void flush();
+    void lock();
+    void unlock();
+    void incRef();
+    bool decRef();
+    std::string getPacketContents(const uint8_t* ptr, size_t len);
+    uint32_t refCount = 1;
+    #define POOL_CLEAR_INTERVAL 10
+    uint32_t encodeCount = 0;
+    uint32_t featureBits = 0;
diff --git a/system/vulkan_enc/VulkanHandleMapping.cpp b/system/vulkan_enc/VulkanHandleMapping.cpp
new file mode 100644
index 0000000..068e666
--- /dev/null
+++ b/system/vulkan_enc/VulkanHandleMapping.cpp
@@ -0,0 +1,35 @@
+// Copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2018 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include <vulkan/vulkan.h>
+
+#include "VulkanHandleMapping.h"
+
+namespace gfxstream {
+namespace vk {
+
+#define DEFAULT_HANDLE_MAP_DEFINE(type) \
+void DefaultHandleMapping::mapHandles_##type(type*, size_t) { return; } \
+void DefaultHandleMapping::mapHandles_##type##_u64(const type* handles, uint64_t* handle_u64s, size_t count) { \
+    for (size_t i = 0; i < count; ++i) { handle_u64s[i] = (uint64_t)(uintptr_t)handles[i]; } \
+} \
+void DefaultHandleMapping::mapHandles_u64_##type(const uint64_t* handle_u64s, type* handles, size_t count) { \
+    for (size_t i = 0; i < count; ++i) { handles[i] = (type)(uintptr_t)handle_u64s[i]; } \
+} \
+
+GOLDFISH_VK_LIST_HANDLE_TYPES(DEFAULT_HANDLE_MAP_DEFINE)
+
+}  // namespace vk
+}  // namespace gfxstream
+
diff --git a/system/vulkan_enc/VulkanHandleMapping.h b/system/vulkan_enc/VulkanHandleMapping.h
new file mode 100644
index 0000000..7c7fdbc
--- /dev/null
+++ b/system/vulkan_enc/VulkanHandleMapping.h
@@ -0,0 +1,50 @@
+// Copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2018 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#pragma once
+
+#include <vulkan/vulkan.h>
+
+#include "VulkanHandles.h"
+
+namespace gfxstream {
+namespace vk {
+
+class VulkanHandleMapping {
+public:
+    VulkanHandleMapping() = default;
+    virtual ~VulkanHandleMapping() { }
+
+#define DECLARE_HANDLE_MAP_PURE_VIRTUAL_METHOD(type) \
+    virtual void mapHandles_##type(type* handles, size_t count = 1) = 0; \
+    virtual void mapHandles_##type##_u64(const type* handles, uint64_t* handle_u64s, size_t count = 1) = 0; \
+    virtual void mapHandles_u64_##type(const uint64_t* handle_u64s, type* handles, size_t count = 1) = 0; \
+
+    GOLDFISH_VK_LIST_HANDLE_TYPES(DECLARE_HANDLE_MAP_PURE_VIRTUAL_METHOD)
+};
+
+class DefaultHandleMapping : public VulkanHandleMapping {
+public:
+    virtual ~DefaultHandleMapping() { }
+
+#define DECLARE_HANDLE_MAP_OVERRIDE(type) \
+    void mapHandles_##type(type* handles, size_t count) override; \
+    void mapHandles_##type##_u64(const type* handles, uint64_t* handle_u64s, size_t count) override; \
+    void mapHandles_u64_##type(const uint64_t* handle_u64s, type* handles, size_t count) override; \
+
+    GOLDFISH_VK_LIST_HANDLE_TYPES(DECLARE_HANDLE_MAP_OVERRIDE)
+};
+
+}  // namespace vk
+}  // namespace gfxstream
\ No newline at end of file
diff --git a/system/vulkan_enc/VulkanHandles.h b/system/vulkan_enc/VulkanHandles.h
new file mode 100644
index 0000000..1c1cbc3
--- /dev/null
+++ b/system/vulkan_enc/VulkanHandles.h
@@ -0,0 +1,172 @@
+// Copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2018 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#pragma once
+
+#include <vulkan/vulkan.h>
+
+namespace gfxstream {
+namespace vk {
+
+#define GOLDFISH_VK_LIST_TRIVIAL_DISPATCHABLE_HANDLE_TYPES(f) \
+    f(VkPhysicalDevice) \
+
+#define GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(f) \
+    f(VkInstance) \
+    f(VkDevice) \
+    f(VkCommandBuffer) \
+    f(VkQueue) \
+    GOLDFISH_VK_LIST_TRIVIAL_DISPATCHABLE_HANDLE_TYPES(f)
+
+#ifdef VK_NVX_binary_import
+
+#define __GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES_NVX_BINARY_IMPORT(f) \
+    f(VkCuModuleNVX) \
+    f(VkCuFunctionNVX) \
+
+#else
+
+#define __GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES_NVX_BINARY_IMPORT(f)
+
+#endif // VK_NVX_binary_import
+
+#ifdef VK_NVX_device_generated_commands
+
+#define __GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES_NVX_DEVICE_GENERATED_COMMANDS(f) \
+    f(VkObjectTableNVX) \
+    f(VkIndirectCommandsLayoutNVX) \
+
+#else
+
+#define __GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES_NVX_DEVICE_GENERATED_COMMANDS(f)
+
+#endif // VK_NVX_device_generated_commands
+
+#ifdef VK_NV_device_generated_commands
+
+#define __GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES_NV_DEVICE_GENERATED_COMMANDS(f) \
+    f(VkIndirectCommandsLayoutNV) \
+
+#else
+
+#define __GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES_NV_DEVICE_GENERATED_COMMANDS(f)
+
+#endif // VK_NV_device_generated_commands
+
+#ifdef VK_NV_ray_tracing
+
+#define __GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES_NV_RAY_TRACING(f) \
+    f(VkAccelerationStructureNV) \
+
+#else
+
+#define __GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES_NV_RAY_TRACING(f)
+
+#endif // VK_NV_ray_tracing
+
+#ifdef VK_KHR_acceleration_structure
+
+#define __GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES_KHR_ACCELERATION_STRUCTURE(f) \
+    f(VkAccelerationStructureKHR) \
+
+#else
+
+#define __GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES_KHR_ACCELERATION_STRUCTURE(f)
+
+#endif // VK_KHR_acceleration_structure
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+
+#define __GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES_FUCHSIA(f) \
+    f(VkBufferCollectionFUCHSIA)
+
+#else
+
+#define __GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES_FUCHSIA(f)
+
+#endif  // VK_USE_PLATFORM_FUCHSIA
+
+#define GOLDFISH_VK_LIST_TRIVIAL_NON_DISPATCHABLE_HANDLE_TYPES(f) \
+    f(VkBufferView) \
+    f(VkImageView) \
+    f(VkShaderModule) \
+    f(VkPipeline) \
+    f(VkPipelineCache) \
+    f(VkPipelineLayout) \
+    f(VkRenderPass) \
+    f(VkFramebuffer) \
+    f(VkEvent) \
+    f(VkQueryPool) \
+    f(VkSamplerYcbcrConversion) \
+    f(VkSurfaceKHR) \
+    f(VkSwapchainKHR) \
+    f(VkDisplayKHR) \
+    f(VkDisplayModeKHR) \
+    f(VkValidationCacheEXT) \
+    f(VkDebugReportCallbackEXT) \
+    f(VkDebugUtilsMessengerEXT) \
+    __GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES_NVX_BINARY_IMPORT(f) \
+    __GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES_NVX_DEVICE_GENERATED_COMMANDS(f) \
+    __GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES_NV_DEVICE_GENERATED_COMMANDS(f) \
+    __GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES_NV_RAY_TRACING(f) \
+    __GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES_KHR_ACCELERATION_STRUCTURE(f) \
+
+#define GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES(f) \
+    f(VkDeviceMemory) \
+    f(VkBuffer) \
+    f(VkImage) \
+    f(VkSemaphore) \
+    f(VkDescriptorUpdateTemplate) \
+    f(VkFence) \
+    f(VkDescriptorPool) \
+    f(VkDescriptorSet) \
+    f(VkDescriptorSetLayout) \
+    f(VkCommandPool) \
+    f(VkSampler) \
+    __GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES_FUCHSIA(f) \
+    GOLDFISH_VK_LIST_TRIVIAL_NON_DISPATCHABLE_HANDLE_TYPES(f) \
+
+#define GOLDFISH_VK_LIST_HANDLE_TYPES(f) \
+    GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(f) \
+    GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES(f)
+
+#define GOLDFISH_VK_LIST_TRIVIAL_HANDLE_TYPES(f) \
+    GOLDFISH_VK_LIST_TRIVIAL_DISPATCHABLE_HANDLE_TYPES(f) \
+    GOLDFISH_VK_LIST_TRIVIAL_NON_DISPATCHABLE_HANDLE_TYPES(f)
+
+#define GOLDFISH_VK_LIST_AUTODEFINED_STRUCT_DISPATCHABLE_HANDLE_TYPES(f) \
+    f(VkInstance) \
+    f(VkDevice) \
+    f(VkQueue) \
+    GOLDFISH_VK_LIST_TRIVIAL_DISPATCHABLE_HANDLE_TYPES(f)
+
+#define GOLDFISH_VK_LIST_AUTODEFINED_STRUCT_NON_DISPATCHABLE_HANDLE_TYPES(f) \
+    f(VkDeviceMemory) \
+    f(VkBuffer) \
+    f(VkImage) \
+    f(VkSemaphore) \
+    f(VkFence) \
+    f(VkDescriptorUpdateTemplate) \
+    f(VkCommandPool) \
+    f(VkSampler) \
+    __GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES_FUCHSIA(f) \
+    GOLDFISH_VK_LIST_TRIVIAL_NON_DISPATCHABLE_HANDLE_TYPES(f) \
+
+#define GOLDFISH_VK_LIST_MANUAL_STRUCT_NON_DISPATCHABLE_HANDLE_TYPES(f) \
+    f(VkDescriptorPool) \
+    f(VkDescriptorSetLayout) \
+    f(VkDescriptorSet) \
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/VulkanStreamGuest.cpp b/system/vulkan_enc/VulkanStreamGuest.cpp
new file mode 100644
index 0000000..3c11670
--- /dev/null
+++ b/system/vulkan_enc/VulkanStreamGuest.cpp
@@ -0,0 +1,176 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include "VulkanStreamGuest.h"
+
+namespace gfxstream {
+namespace vk {
+
+VulkanStreamGuest::VulkanStreamGuest(IOStream *stream): mStream(stream) {
+    unsetHandleMapping();
+    mFeatureBits = ResourceTracker::get()->getStreamFeatures();
+}
+
+VulkanStreamGuest::~VulkanStreamGuest() = default;
+
+bool VulkanStreamGuest::valid() {
+    return true;
+}
+
+void VulkanStreamGuest::alloc(void** ptrAddr, size_t bytes) {
+    if (!bytes) {
+        *ptrAddr = nullptr;
+        return;
+    }
+
+    *ptrAddr = mPool.alloc(bytes);
+}
+
+void VulkanStreamGuest::loadStringInPlace(char** forOutput) {
+    size_t len = getBe32();
+
+    alloc((void**)forOutput, len + 1);
+
+    memset(*forOutput, 0x0, len + 1);
+
+    if (len > 0) read(*forOutput, len);
+}
+
+void VulkanStreamGuest::loadStringArrayInPlace(char*** forOutput) {
+    size_t count = getBe32();
+
+    if (!count) {
+        *forOutput = nullptr;
+        return;
+    }
+
+    alloc((void**)forOutput, count * sizeof(char*));
+
+    char **stringsForOutput = *forOutput;
+
+    for (size_t i = 0; i < count; i++) {
+        loadStringInPlace(stringsForOutput + i);
+    }
+}
+
+void VulkanStreamGuest::loadStringInPlaceWithStreamPtr(char** forOutput, uint8_t** streamPtr) {
+    uint32_t len;
+    memcpy(&len, *streamPtr, sizeof(uint32_t));
+    *streamPtr += sizeof(uint32_t);
+    android::base::Stream::fromBe32((uint8_t*)&len);
+
+    alloc((void**)forOutput, len + 1);
+
+    memset(*forOutput, 0x0, len + 1);
+
+    if (len > 0) {
+        memcpy(*forOutput, *streamPtr, len);
+        *streamPtr += len;
+    }
+}
+
+void VulkanStreamGuest::loadStringArrayInPlaceWithStreamPtr(char*** forOutput, uint8_t** streamPtr) {
+ uint32_t count;
+    memcpy(&count, *streamPtr, sizeof(uint32_t));
+    *streamPtr += sizeof(uint32_t);
+    android::base::Stream::fromBe32((uint8_t*)&count);
+    if (!count) {
+        *forOutput = nullptr;
+        return;
+    }
+
+    alloc((void**)forOutput, count * sizeof(char*));
+
+    char **stringsForOutput = *forOutput;
+
+    for (size_t i = 0; i < count; i++) {
+        loadStringInPlaceWithStreamPtr(stringsForOutput + i, streamPtr);
+    }
+}
+
+
+ssize_t VulkanStreamGuest::read(void *buffer, size_t size) {
+    if (!mStream->readback(buffer, size)) {
+        ALOGE("FATAL: Could not read back %zu bytes", size);
+        abort();
+    }
+    return size;
+}
+
+ssize_t VulkanStreamGuest::write(const void *buffer, size_t size) {
+    uint8_t* streamBuf = (uint8_t*)mStream->alloc(size);
+    memcpy(streamBuf, buffer, size);
+    return size;
+}
+
+void VulkanStreamGuest::writeLarge(const void* buffer, size_t size) {
+    mStream->writeFullyAsync(buffer, size);
+}
+
+void VulkanStreamGuest::clearPool() {
+    mPool.freeAll();
+}
+
+void VulkanStreamGuest::setHandleMapping(VulkanHandleMapping* mapping) {
+    mCurrentHandleMapping = mapping;
+}
+
+void VulkanStreamGuest::unsetHandleMapping() {
+    mCurrentHandleMapping = &mDefaultHandleMapping;
+}
+
+VulkanHandleMapping* VulkanStreamGuest::handleMapping() const {
+    return mCurrentHandleMapping;
+}
+
+void VulkanStreamGuest::flush() {
+    AEMU_SCOPED_TRACE("VulkanStreamGuest device write");
+    mStream->flush();
+}
+
+uint32_t VulkanStreamGuest::getFeatureBits() const {
+    return mFeatureBits;
+}
+
+void VulkanStreamGuest::incStreamRef() {
+    mStream->incRef();
+}
+
+bool VulkanStreamGuest::decStreamRef() {
+    return mStream->decRef();
+}
+
+uint8_t* VulkanStreamGuest::reserve(size_t size) {
+    return (uint8_t*)mStream->alloc(size);
+}
+
+VulkanCountingStream::VulkanCountingStream() : VulkanStreamGuest(nullptr) { }
+VulkanCountingStream::~VulkanCountingStream() = default;
+
+ssize_t VulkanCountingStream::read(void*, size_t size) {
+    m_read += size;
+    return size;
+}
+
+ssize_t VulkanCountingStream::write(const void*, size_t size) {
+    m_written += size;
+    return size;
+}
+
+void VulkanCountingStream::rewind() {
+    m_written = 0;
+    m_read = 0;
+}
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/VulkanStreamGuest.h b/system/vulkan_enc/VulkanStreamGuest.h
new file mode 100644
index 0000000..48c5a61
--- /dev/null
+++ b/system/vulkan_enc/VulkanStreamGuest.h
@@ -0,0 +1,107 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#pragma once
+
+#include "aemu/base/files/Stream.h"
+#include "aemu/base/files/StreamSerializing.h"
+
+#include "goldfish_vk_private_defs.h"
+
+#include "VulkanHandleMapping.h"
+
+#include "IOStream.h"
+#include "ResourceTracker.h"
+
+#include "aemu/base/BumpPool.h"
+#include "aemu/base/Tracing.h"
+
+#include <vector>
+#include <memory>
+
+#include <log/log.h>
+#include <inttypes.h>
+
+class IOStream;
+
+namespace gfxstream {
+namespace vk {
+
+class VulkanStreamGuest : public android::base::Stream {
+public:
+    VulkanStreamGuest(IOStream* stream);
+    ~VulkanStreamGuest();
+
+    // Returns whether the connection is valid.
+    bool valid();
+
+    // General allocation function
+    void alloc(void** ptrAddr, size_t bytes);
+
+    // Utility functions to load strings or
+    // string arrays in place with allocation.
+    void loadStringInPlace(char** forOutput);
+    void loadStringArrayInPlace(char*** forOutput);
+
+    // When we load a string and are using a reserved pointer.
+    void loadStringInPlaceWithStreamPtr(char** forOutput, uint8_t** streamPtr);
+    void loadStringArrayInPlaceWithStreamPtr(char*** forOutput, uint8_t** streamPtr);
+
+    ssize_t read(void *buffer, size_t size) override;
+    ssize_t write(const void *buffer, size_t size) override;
+
+    void writeLarge(const void* buffer, size_t size);
+
+    // Frees everything that got alloc'ed.
+    void clearPool();
+
+    void setHandleMapping(VulkanHandleMapping* mapping);
+    void unsetHandleMapping();
+    VulkanHandleMapping* handleMapping() const;
+
+    void flush();
+
+    uint32_t getFeatureBits() const;
+
+    void incStreamRef();
+    bool decStreamRef();
+
+    uint8_t* reserve(size_t size);
+private:
+    android::base::BumpPool mPool;
+    std::vector<uint8_t> mWriteBuffer;
+    IOStream* mStream = nullptr;
+    DefaultHandleMapping mDefaultHandleMapping;
+    VulkanHandleMapping* mCurrentHandleMapping;
+    uint32_t mFeatureBits = 0;
+};
+
+class VulkanCountingStream : public VulkanStreamGuest {
+public:
+    VulkanCountingStream();
+    ~VulkanCountingStream();
+
+    ssize_t read(void *buffer, size_t size) override;
+    ssize_t write(const void *buffer, size_t size) override;
+
+    size_t bytesWritten() const { return m_written; }
+    size_t bytesRead() const { return m_read; }
+
+    void rewind();
+private:
+    size_t m_written = 0;
+    size_t m_read = 0;
+};
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/func_table.cpp b/system/vulkan_enc/func_table.cpp
new file mode 100644
index 0000000..b5052ec
--- /dev/null
+++ b/system/vulkan_enc/func_table.cpp
@@ -0,0 +1,15431 @@
+// Copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2018 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Autogenerated module func_table
+//
+// (impl) generated by codegen/vulkan/scripts/genvk.py -registry codegen/vulkan/xml/vk.xml cereal -o
+// host/vulkan/cereal
+//
+// Please do not modify directly;
+// re-run gfxstream-protocols/scripts/generate-vulkan-sources.sh,
+// or directly from Python by defining:
+// VULKAN_REGISTRY_XML_DIR : Directory containing vk.xml
+// VULKAN_REGISTRY_SCRIPTS_DIR : Directory containing genvk.py
+// CEREAL_OUTPUT_DIR: Where to put the generated sources.
+//
+// python3 $VULKAN_REGISTRY_SCRIPTS_DIR/genvk.py -registry $VULKAN_REGISTRY_XML_DIR/vk.xml cereal -o
+// $CEREAL_OUTPUT_DIR
+//
+
+#include "func_table.h"
+
+#include <log/log.h>
+
+#include <cstring>
+
+#include "../OpenglSystemCommon/HostConnection.h"
+#include "ResourceTracker.h"
+#include "VkEncoder.h"
+#include "goldfish_vk_private_defs.h"
+
+// Stuff we are not going to use but if included,
+// will cause compile errors. These are Android Vulkan
+// required extensions, but the approach will be to
+// implement them completely on the guest side.
+#undef VK_KHR_android_surface
+
+namespace gfxstream {
+namespace vk {
+
+static void sOnInvalidDynamicallyCheckedCall(const char* apiname, const char* neededFeature) {
+    ALOGE("invalid call to %s: %s not supported", apiname, neededFeature);
+    abort();
+}
+#ifdef VK_VERSION_1_0
+static VkResult entry_vkCreateInstance(const VkInstanceCreateInfo* pCreateInfo,
+                                       const VkAllocationCallbacks* pAllocator,
+                                       VkInstance* pInstance) {
+    AEMU_SCOPED_TRACE("vkCreateInstance");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateInstance_VkResult_return = (VkResult)0;
+    vkCreateInstance_VkResult_return =
+        vkEnc->vkCreateInstance(pCreateInfo, pAllocator, pInstance, true /* do lock */);
+    return vkCreateInstance_VkResult_return;
+}
+static void entry_vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyInstance");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyInstance(instance, pAllocator, true /* do lock */);
+}
+static VkResult entry_vkEnumeratePhysicalDevices(VkInstance instance,
+                                                 uint32_t* pPhysicalDeviceCount,
+                                                 VkPhysicalDevice* pPhysicalDevices) {
+    AEMU_SCOPED_TRACE("vkEnumeratePhysicalDevices");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkEnumeratePhysicalDevices_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkEnumeratePhysicalDevices_VkResult_return = resources->on_vkEnumeratePhysicalDevices(
+        vkEnc, VK_SUCCESS, instance, pPhysicalDeviceCount, pPhysicalDevices);
+    return vkEnumeratePhysicalDevices_VkResult_return;
+}
+static void entry_vkGetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice,
+                                              VkPhysicalDeviceFeatures* pFeatures) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFeatures");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetPhysicalDeviceFeatures(physicalDevice, pFeatures, true /* do lock */);
+}
+static void entry_vkGetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice,
+                                                      VkFormat format,
+                                                      VkFormatProperties* pFormatProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFormatProperties");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetPhysicalDeviceFormatProperties(physicalDevice, format, pFormatProperties,
+                                               true /* do lock */);
+}
+static VkResult entry_vkGetPhysicalDeviceImageFormatProperties(
+    VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling,
+    VkImageUsageFlags usage, VkImageCreateFlags flags,
+    VkImageFormatProperties* pImageFormatProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceImageFormatProperties");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPhysicalDeviceImageFormatProperties_VkResult_return = (VkResult)0;
+    vkGetPhysicalDeviceImageFormatProperties_VkResult_return =
+        vkEnc->vkGetPhysicalDeviceImageFormatProperties(physicalDevice, format, type, tiling, usage,
+                                                        flags, pImageFormatProperties,
+                                                        true /* do lock */);
+    return vkGetPhysicalDeviceImageFormatProperties_VkResult_return;
+}
+static void entry_vkGetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice,
+                                                VkPhysicalDeviceProperties* pProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceProperties");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetPhysicalDeviceProperties(physicalDevice, pProperties, true /* do lock */);
+}
+static void entry_vkGetPhysicalDeviceQueueFamilyProperties(
+    VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount,
+    VkQueueFamilyProperties* pQueueFamilyProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceQueueFamilyProperties");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetPhysicalDeviceQueueFamilyProperties(physicalDevice, pQueueFamilyPropertyCount,
+                                                    pQueueFamilyProperties, true /* do lock */);
+}
+static void entry_vkGetPhysicalDeviceMemoryProperties(
+    VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMemoryProperties");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperties,
+                                               true /* do lock */);
+}
+static PFN_vkVoidFunction entry_vkGetInstanceProcAddr(VkInstance instance, const char* pName) {
+    AEMU_SCOPED_TRACE("vkGetInstanceProcAddr");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    PFN_vkVoidFunction vkGetInstanceProcAddr_PFN_vkVoidFunction_return = (PFN_vkVoidFunction)0;
+    vkGetInstanceProcAddr_PFN_vkVoidFunction_return =
+        vkEnc->vkGetInstanceProcAddr(instance, pName, true /* do lock */);
+    return vkGetInstanceProcAddr_PFN_vkVoidFunction_return;
+}
+static PFN_vkVoidFunction entry_vkGetDeviceProcAddr(VkDevice device, const char* pName) {
+    AEMU_SCOPED_TRACE("vkGetDeviceProcAddr");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    PFN_vkVoidFunction vkGetDeviceProcAddr_PFN_vkVoidFunction_return = (PFN_vkVoidFunction)0;
+    vkGetDeviceProcAddr_PFN_vkVoidFunction_return =
+        vkEnc->vkGetDeviceProcAddr(device, pName, true /* do lock */);
+    return vkGetDeviceProcAddr_PFN_vkVoidFunction_return;
+}
+static VkResult entry_vkCreateDevice(VkPhysicalDevice physicalDevice,
+                                     const VkDeviceCreateInfo* pCreateInfo,
+                                     const VkAllocationCallbacks* pAllocator, VkDevice* pDevice) {
+    AEMU_SCOPED_TRACE("vkCreateDevice");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateDevice_VkResult_return = (VkResult)0;
+    vkCreateDevice_VkResult_return =
+        vkEnc->vkCreateDevice(physicalDevice, pCreateInfo, pAllocator, pDevice, true /* do lock */);
+    return vkCreateDevice_VkResult_return;
+}
+static void entry_vkDestroyDevice(VkDevice device, const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyDevice");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyDevice(device, pAllocator, true /* do lock */);
+}
+static VkResult entry_vkEnumerateInstanceExtensionProperties(const char* pLayerName,
+                                                             uint32_t* pPropertyCount,
+                                                             VkExtensionProperties* pProperties) {
+    AEMU_SCOPED_TRACE("vkEnumerateInstanceExtensionProperties");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkEnumerateInstanceExtensionProperties_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkEnumerateInstanceExtensionProperties_VkResult_return =
+        resources->on_vkEnumerateInstanceExtensionProperties(vkEnc, VK_SUCCESS, pLayerName,
+                                                             pPropertyCount, pProperties);
+    return vkEnumerateInstanceExtensionProperties_VkResult_return;
+}
+static VkResult entry_vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice,
+                                                           const char* pLayerName,
+                                                           uint32_t* pPropertyCount,
+                                                           VkExtensionProperties* pProperties) {
+    AEMU_SCOPED_TRACE("vkEnumerateDeviceExtensionProperties");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkEnumerateDeviceExtensionProperties_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkEnumerateDeviceExtensionProperties_VkResult_return =
+        resources->on_vkEnumerateDeviceExtensionProperties(vkEnc, VK_SUCCESS, physicalDevice,
+                                                           pLayerName, pPropertyCount, pProperties);
+    return vkEnumerateDeviceExtensionProperties_VkResult_return;
+}
+static VkResult entry_vkEnumerateInstanceLayerProperties(uint32_t* pPropertyCount,
+                                                         VkLayerProperties* pProperties) {
+    AEMU_SCOPED_TRACE("vkEnumerateInstanceLayerProperties");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkEnumerateInstanceLayerProperties_VkResult_return = (VkResult)0;
+    vkEnumerateInstanceLayerProperties_VkResult_return =
+        vkEnc->vkEnumerateInstanceLayerProperties(pPropertyCount, pProperties, true /* do lock */);
+    return vkEnumerateInstanceLayerProperties_VkResult_return;
+}
+static VkResult entry_vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice,
+                                                       uint32_t* pPropertyCount,
+                                                       VkLayerProperties* pProperties) {
+    AEMU_SCOPED_TRACE("vkEnumerateDeviceLayerProperties");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkEnumerateDeviceLayerProperties_VkResult_return = (VkResult)0;
+    vkEnumerateDeviceLayerProperties_VkResult_return = vkEnc->vkEnumerateDeviceLayerProperties(
+        physicalDevice, pPropertyCount, pProperties, true /* do lock */);
+    return vkEnumerateDeviceLayerProperties_VkResult_return;
+}
+static void entry_vkGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex,
+                                   VkQueue* pQueue) {
+    AEMU_SCOPED_TRACE("vkGetDeviceQueue");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetDeviceQueue(device, queueFamilyIndex, queueIndex, pQueue, true /* do lock */);
+}
+static VkResult entry_vkQueueSubmit(VkQueue queue, uint32_t submitCount,
+                                    const VkSubmitInfo* pSubmits, VkFence fence) {
+    AEMU_SCOPED_TRACE("vkQueueSubmit");
+    auto vkEnc = ResourceTracker::getQueueEncoder(queue);
+    VkResult vkQueueSubmit_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkQueueSubmit_VkResult_return =
+        resources->on_vkQueueSubmit(vkEnc, VK_SUCCESS, queue, submitCount, pSubmits, fence);
+    return vkQueueSubmit_VkResult_return;
+}
+static VkResult entry_vkQueueWaitIdle(VkQueue queue) {
+    AEMU_SCOPED_TRACE("vkQueueWaitIdle");
+    auto vkEnc = ResourceTracker::getQueueEncoder(queue);
+    VkResult vkQueueWaitIdle_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkQueueWaitIdle_VkResult_return = resources->on_vkQueueWaitIdle(vkEnc, VK_SUCCESS, queue);
+    return vkQueueWaitIdle_VkResult_return;
+}
+static VkResult entry_vkDeviceWaitIdle(VkDevice device) {
+    AEMU_SCOPED_TRACE("vkDeviceWaitIdle");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkDeviceWaitIdle_VkResult_return = (VkResult)0;
+    vkDeviceWaitIdle_VkResult_return = vkEnc->vkDeviceWaitIdle(device, true /* do lock */);
+    return vkDeviceWaitIdle_VkResult_return;
+}
+static VkResult entry_vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo,
+                                       const VkAllocationCallbacks* pAllocator,
+                                       VkDeviceMemory* pMemory) {
+    AEMU_SCOPED_TRACE("vkAllocateMemory");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkAllocateMemory_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkAllocateMemory_VkResult_return = resources->on_vkAllocateMemory(
+        vkEnc, VK_SUCCESS, device, pAllocateInfo, pAllocator, pMemory);
+    return vkAllocateMemory_VkResult_return;
+}
+static void entry_vkFreeMemory(VkDevice device, VkDeviceMemory memory,
+                               const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkFreeMemory");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    auto resources = ResourceTracker::get();
+    resources->on_vkFreeMemory(vkEnc, device, memory, pAllocator);
+}
+static VkResult entry_vkMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset,
+                                  VkDeviceSize size, VkMemoryMapFlags flags, void** ppData) {
+    AEMU_SCOPED_TRACE("vkMapMemory");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkMapMemory_VkResult_return = (VkResult)0;
+    vkMapMemory_VkResult_return =
+        vkEnc->vkMapMemory(device, memory, offset, size, flags, ppData, true /* do lock */);
+    return vkMapMemory_VkResult_return;
+}
+static void entry_vkUnmapMemory(VkDevice device, VkDeviceMemory memory) {
+    AEMU_SCOPED_TRACE("vkUnmapMemory");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkUnmapMemory(device, memory, true /* do lock */);
+}
+static VkResult entry_vkFlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount,
+                                                const VkMappedMemoryRange* pMemoryRanges) {
+    AEMU_SCOPED_TRACE("vkFlushMappedMemoryRanges");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkFlushMappedMemoryRanges_VkResult_return = (VkResult)0;
+    vkFlushMappedMemoryRanges_VkResult_return = vkEnc->vkFlushMappedMemoryRanges(
+        device, memoryRangeCount, pMemoryRanges, true /* do lock */);
+    return vkFlushMappedMemoryRanges_VkResult_return;
+}
+static VkResult entry_vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount,
+                                                     const VkMappedMemoryRange* pMemoryRanges) {
+    AEMU_SCOPED_TRACE("vkInvalidateMappedMemoryRanges");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkInvalidateMappedMemoryRanges_VkResult_return = (VkResult)0;
+    vkInvalidateMappedMemoryRanges_VkResult_return = vkEnc->vkInvalidateMappedMemoryRanges(
+        device, memoryRangeCount, pMemoryRanges, true /* do lock */);
+    return vkInvalidateMappedMemoryRanges_VkResult_return;
+}
+static void entry_vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory,
+                                              VkDeviceSize* pCommittedMemoryInBytes) {
+    AEMU_SCOPED_TRACE("vkGetDeviceMemoryCommitment");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes, true /* do lock */);
+}
+static VkResult entry_vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory memory,
+                                         VkDeviceSize memoryOffset) {
+    AEMU_SCOPED_TRACE("vkBindBufferMemory");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkBindBufferMemory_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkBindBufferMemory_VkResult_return =
+        resources->on_vkBindBufferMemory(vkEnc, VK_SUCCESS, device, buffer, memory, memoryOffset);
+    return vkBindBufferMemory_VkResult_return;
+}
+static VkResult entry_vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory memory,
+                                        VkDeviceSize memoryOffset) {
+    AEMU_SCOPED_TRACE("vkBindImageMemory");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkBindImageMemory_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkBindImageMemory_VkResult_return =
+        resources->on_vkBindImageMemory(vkEnc, VK_SUCCESS, device, image, memory, memoryOffset);
+    return vkBindImageMemory_VkResult_return;
+}
+static void entry_vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer,
+                                                VkMemoryRequirements* pMemoryRequirements) {
+    AEMU_SCOPED_TRACE("vkGetBufferMemoryRequirements");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    auto resources = ResourceTracker::get();
+    resources->on_vkGetBufferMemoryRequirements(vkEnc, device, buffer, pMemoryRequirements);
+}
+static void entry_vkGetImageMemoryRequirements(VkDevice device, VkImage image,
+                                               VkMemoryRequirements* pMemoryRequirements) {
+    AEMU_SCOPED_TRACE("vkGetImageMemoryRequirements");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    auto resources = ResourceTracker::get();
+    resources->on_vkGetImageMemoryRequirements(vkEnc, device, image, pMemoryRequirements);
+}
+static void entry_vkGetImageSparseMemoryRequirements(
+    VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount,
+    VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
+    AEMU_SCOPED_TRACE("vkGetImageSparseMemoryRequirements");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetImageSparseMemoryRequirements(device, image, pSparseMemoryRequirementCount,
+                                              pSparseMemoryRequirements, true /* do lock */);
+}
+static void entry_vkGetPhysicalDeviceSparseImageFormatProperties(
+    VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type,
+    VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling,
+    uint32_t* pPropertyCount, VkSparseImageFormatProperties* pProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSparseImageFormatProperties");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples,
+                                                          usage, tiling, pPropertyCount,
+                                                          pProperties, true /* do lock */);
+}
+static VkResult entry_vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCount,
+                                        const VkBindSparseInfo* pBindInfo, VkFence fence) {
+    AEMU_SCOPED_TRACE("vkQueueBindSparse");
+    auto vkEnc = ResourceTracker::getQueueEncoder(queue);
+    VkResult vkQueueBindSparse_VkResult_return = (VkResult)0;
+    vkQueueBindSparse_VkResult_return =
+        vkEnc->vkQueueBindSparse(queue, bindInfoCount, pBindInfo, fence, true /* do lock */);
+    return vkQueueBindSparse_VkResult_return;
+}
+static VkResult entry_vkCreateFence(VkDevice device, const VkFenceCreateInfo* pCreateInfo,
+                                    const VkAllocationCallbacks* pAllocator, VkFence* pFence) {
+    AEMU_SCOPED_TRACE("vkCreateFence");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateFence_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkCreateFence_VkResult_return =
+        resources->on_vkCreateFence(vkEnc, VK_SUCCESS, device, pCreateInfo, pAllocator, pFence);
+    return vkCreateFence_VkResult_return;
+}
+static void entry_vkDestroyFence(VkDevice device, VkFence fence,
+                                 const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyFence");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyFence(device, fence, pAllocator, true /* do lock */);
+}
+static VkResult entry_vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences) {
+    AEMU_SCOPED_TRACE("vkResetFences");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkResetFences_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkResetFences_VkResult_return =
+        resources->on_vkResetFences(vkEnc, VK_SUCCESS, device, fenceCount, pFences);
+    return vkResetFences_VkResult_return;
+}
+static VkResult entry_vkGetFenceStatus(VkDevice device, VkFence fence) {
+    AEMU_SCOPED_TRACE("vkGetFenceStatus");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetFenceStatus_VkResult_return = (VkResult)0;
+    vkGetFenceStatus_VkResult_return = vkEnc->vkGetFenceStatus(device, fence, true /* do lock */);
+    return vkGetFenceStatus_VkResult_return;
+}
+static VkResult entry_vkWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences,
+                                      VkBool32 waitAll, uint64_t timeout) {
+    AEMU_SCOPED_TRACE("vkWaitForFences");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkWaitForFences_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkWaitForFences_VkResult_return = resources->on_vkWaitForFences(
+        vkEnc, VK_SUCCESS, device, fenceCount, pFences, waitAll, timeout);
+    return vkWaitForFences_VkResult_return;
+}
+static VkResult entry_vkCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo,
+                                        const VkAllocationCallbacks* pAllocator,
+                                        VkSemaphore* pSemaphore) {
+    AEMU_SCOPED_TRACE("vkCreateSemaphore");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateSemaphore_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkCreateSemaphore_VkResult_return = resources->on_vkCreateSemaphore(
+        vkEnc, VK_SUCCESS, device, pCreateInfo, pAllocator, pSemaphore);
+    return vkCreateSemaphore_VkResult_return;
+}
+static void entry_vkDestroySemaphore(VkDevice device, VkSemaphore semaphore,
+                                     const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroySemaphore");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    auto resources = ResourceTracker::get();
+    resources->on_vkDestroySemaphore(vkEnc, device, semaphore, pAllocator);
+}
+static VkResult entry_vkCreateEvent(VkDevice device, const VkEventCreateInfo* pCreateInfo,
+                                    const VkAllocationCallbacks* pAllocator, VkEvent* pEvent) {
+    AEMU_SCOPED_TRACE("vkCreateEvent");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateEvent_VkResult_return = (VkResult)0;
+    vkCreateEvent_VkResult_return =
+        vkEnc->vkCreateEvent(device, pCreateInfo, pAllocator, pEvent, true /* do lock */);
+    return vkCreateEvent_VkResult_return;
+}
+static void entry_vkDestroyEvent(VkDevice device, VkEvent event,
+                                 const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyEvent");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyEvent(device, event, pAllocator, true /* do lock */);
+}
+static VkResult entry_vkGetEventStatus(VkDevice device, VkEvent event) {
+    AEMU_SCOPED_TRACE("vkGetEventStatus");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetEventStatus_VkResult_return = (VkResult)0;
+    vkGetEventStatus_VkResult_return = vkEnc->vkGetEventStatus(device, event, true /* do lock */);
+    return vkGetEventStatus_VkResult_return;
+}
+static VkResult entry_vkSetEvent(VkDevice device, VkEvent event) {
+    AEMU_SCOPED_TRACE("vkSetEvent");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkSetEvent_VkResult_return = (VkResult)0;
+    vkSetEvent_VkResult_return = vkEnc->vkSetEvent(device, event, true /* do lock */);
+    return vkSetEvent_VkResult_return;
+}
+static VkResult entry_vkResetEvent(VkDevice device, VkEvent event) {
+    AEMU_SCOPED_TRACE("vkResetEvent");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkResetEvent_VkResult_return = (VkResult)0;
+    vkResetEvent_VkResult_return = vkEnc->vkResetEvent(device, event, true /* do lock */);
+    return vkResetEvent_VkResult_return;
+}
+static VkResult entry_vkCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo,
+                                        const VkAllocationCallbacks* pAllocator,
+                                        VkQueryPool* pQueryPool) {
+    AEMU_SCOPED_TRACE("vkCreateQueryPool");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateQueryPool_VkResult_return = (VkResult)0;
+    vkCreateQueryPool_VkResult_return =
+        vkEnc->vkCreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool, true /* do lock */);
+    return vkCreateQueryPool_VkResult_return;
+}
+static void entry_vkDestroyQueryPool(VkDevice device, VkQueryPool queryPool,
+                                     const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyQueryPool");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyQueryPool(device, queryPool, pAllocator, true /* do lock */);
+}
+static VkResult entry_vkGetQueryPoolResults(VkDevice device, VkQueryPool queryPool,
+                                            uint32_t firstQuery, uint32_t queryCount,
+                                            size_t dataSize, void* pData, VkDeviceSize stride,
+                                            VkQueryResultFlags flags) {
+    AEMU_SCOPED_TRACE("vkGetQueryPoolResults");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetQueryPoolResults_VkResult_return = (VkResult)0;
+    vkGetQueryPoolResults_VkResult_return =
+        vkEnc->vkGetQueryPoolResults(device, queryPool, firstQuery, queryCount, dataSize, pData,
+                                     stride, flags, true /* do lock */);
+    return vkGetQueryPoolResults_VkResult_return;
+}
+static VkResult entry_vkCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo,
+                                     const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer) {
+    AEMU_SCOPED_TRACE("vkCreateBuffer");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateBuffer_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkCreateBuffer_VkResult_return =
+        resources->on_vkCreateBuffer(vkEnc, VK_SUCCESS, device, pCreateInfo, pAllocator, pBuffer);
+    return vkCreateBuffer_VkResult_return;
+}
+static void entry_vkDestroyBuffer(VkDevice device, VkBuffer buffer,
+                                  const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyBuffer");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    auto resources = ResourceTracker::get();
+    resources->on_vkDestroyBuffer(vkEnc, device, buffer, pAllocator);
+}
+static VkResult entry_vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo,
+                                         const VkAllocationCallbacks* pAllocator,
+                                         VkBufferView* pView) {
+    AEMU_SCOPED_TRACE("vkCreateBufferView");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateBufferView_VkResult_return = (VkResult)0;
+    vkCreateBufferView_VkResult_return =
+        vkEnc->vkCreateBufferView(device, pCreateInfo, pAllocator, pView, true /* do lock */);
+    return vkCreateBufferView_VkResult_return;
+}
+static void entry_vkDestroyBufferView(VkDevice device, VkBufferView bufferView,
+                                      const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyBufferView");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyBufferView(device, bufferView, pAllocator, true /* do lock */);
+}
+static VkResult entry_vkCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo,
+                                    const VkAllocationCallbacks* pAllocator, VkImage* pImage) {
+    AEMU_SCOPED_TRACE("vkCreateImage");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateImage_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkCreateImage_VkResult_return =
+        resources->on_vkCreateImage(vkEnc, VK_SUCCESS, device, pCreateInfo, pAllocator, pImage);
+    return vkCreateImage_VkResult_return;
+}
+static void entry_vkDestroyImage(VkDevice device, VkImage image,
+                                 const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyImage");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    auto resources = ResourceTracker::get();
+    resources->on_vkDestroyImage(vkEnc, device, image, pAllocator);
+}
+static void entry_vkGetImageSubresourceLayout(VkDevice device, VkImage image,
+                                              const VkImageSubresource* pSubresource,
+                                              VkSubresourceLayout* pLayout) {
+    AEMU_SCOPED_TRACE("vkGetImageSubresourceLayout");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetImageSubresourceLayout(device, image, pSubresource, pLayout, true /* do lock */);
+}
+static VkResult entry_vkCreateImageView(VkDevice device, const VkImageViewCreateInfo* pCreateInfo,
+                                        const VkAllocationCallbacks* pAllocator,
+                                        VkImageView* pView) {
+    AEMU_SCOPED_TRACE("vkCreateImageView");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateImageView_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkCreateImageView_VkResult_return =
+        resources->on_vkCreateImageView(vkEnc, VK_SUCCESS, device, pCreateInfo, pAllocator, pView);
+    return vkCreateImageView_VkResult_return;
+}
+static void entry_vkDestroyImageView(VkDevice device, VkImageView imageView,
+                                     const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyImageView");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyImageView(device, imageView, pAllocator, true /* do lock */);
+}
+static VkResult entry_vkCreateShaderModule(VkDevice device,
+                                           const VkShaderModuleCreateInfo* pCreateInfo,
+                                           const VkAllocationCallbacks* pAllocator,
+                                           VkShaderModule* pShaderModule) {
+    AEMU_SCOPED_TRACE("vkCreateShaderModule");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateShaderModule_VkResult_return = (VkResult)0;
+    vkCreateShaderModule_VkResult_return = vkEnc->vkCreateShaderModule(
+        device, pCreateInfo, pAllocator, pShaderModule, true /* do lock */);
+    return vkCreateShaderModule_VkResult_return;
+}
+static void entry_vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule,
+                                        const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyShaderModule");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyShaderModule(device, shaderModule, pAllocator, true /* do lock */);
+}
+static VkResult entry_vkCreatePipelineCache(VkDevice device,
+                                            const VkPipelineCacheCreateInfo* pCreateInfo,
+                                            const VkAllocationCallbacks* pAllocator,
+                                            VkPipelineCache* pPipelineCache) {
+    AEMU_SCOPED_TRACE("vkCreatePipelineCache");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreatePipelineCache_VkResult_return = (VkResult)0;
+    vkCreatePipelineCache_VkResult_return = vkEnc->vkCreatePipelineCache(
+        device, pCreateInfo, pAllocator, pPipelineCache, true /* do lock */);
+    return vkCreatePipelineCache_VkResult_return;
+}
+static void entry_vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache,
+                                         const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyPipelineCache");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyPipelineCache(device, pipelineCache, pAllocator, true /* do lock */);
+}
+static VkResult entry_vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache,
+                                             size_t* pDataSize, void* pData) {
+    AEMU_SCOPED_TRACE("vkGetPipelineCacheData");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPipelineCacheData_VkResult_return = (VkResult)0;
+    vkGetPipelineCacheData_VkResult_return =
+        vkEnc->vkGetPipelineCacheData(device, pipelineCache, pDataSize, pData, true /* do lock */);
+    return vkGetPipelineCacheData_VkResult_return;
+}
+static VkResult entry_vkMergePipelineCaches(VkDevice device, VkPipelineCache dstCache,
+                                            uint32_t srcCacheCount,
+                                            const VkPipelineCache* pSrcCaches) {
+    AEMU_SCOPED_TRACE("vkMergePipelineCaches");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkMergePipelineCaches_VkResult_return = (VkResult)0;
+    vkMergePipelineCaches_VkResult_return = vkEnc->vkMergePipelineCaches(
+        device, dstCache, srcCacheCount, pSrcCaches, true /* do lock */);
+    return vkMergePipelineCaches_VkResult_return;
+}
+static VkResult entry_vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache,
+                                                uint32_t createInfoCount,
+                                                const VkGraphicsPipelineCreateInfo* pCreateInfos,
+                                                const VkAllocationCallbacks* pAllocator,
+                                                VkPipeline* pPipelines) {
+    AEMU_SCOPED_TRACE("vkCreateGraphicsPipelines");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateGraphicsPipelines_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkCreateGraphicsPipelines_VkResult_return = resources->on_vkCreateGraphicsPipelines(
+        vkEnc, VK_SUCCESS, device, pipelineCache, createInfoCount, pCreateInfos, pAllocator,
+        pPipelines);
+    return vkCreateGraphicsPipelines_VkResult_return;
+}
+static VkResult entry_vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache,
+                                               uint32_t createInfoCount,
+                                               const VkComputePipelineCreateInfo* pCreateInfos,
+                                               const VkAllocationCallbacks* pAllocator,
+                                               VkPipeline* pPipelines) {
+    AEMU_SCOPED_TRACE("vkCreateComputePipelines");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateComputePipelines_VkResult_return = (VkResult)0;
+    vkCreateComputePipelines_VkResult_return =
+        vkEnc->vkCreateComputePipelines(device, pipelineCache, createInfoCount, pCreateInfos,
+                                        pAllocator, pPipelines, true /* do lock */);
+    return vkCreateComputePipelines_VkResult_return;
+}
+static void entry_vkDestroyPipeline(VkDevice device, VkPipeline pipeline,
+                                    const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyPipeline");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyPipeline(device, pipeline, pAllocator, true /* do lock */);
+}
+static VkResult entry_vkCreatePipelineLayout(VkDevice device,
+                                             const VkPipelineLayoutCreateInfo* pCreateInfo,
+                                             const VkAllocationCallbacks* pAllocator,
+                                             VkPipelineLayout* pPipelineLayout) {
+    AEMU_SCOPED_TRACE("vkCreatePipelineLayout");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreatePipelineLayout_VkResult_return = (VkResult)0;
+    vkCreatePipelineLayout_VkResult_return = vkEnc->vkCreatePipelineLayout(
+        device, pCreateInfo, pAllocator, pPipelineLayout, true /* do lock */);
+    return vkCreatePipelineLayout_VkResult_return;
+}
+static void entry_vkDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout,
+                                          const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyPipelineLayout");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyPipelineLayout(device, pipelineLayout, pAllocator, true /* do lock */);
+}
+static VkResult entry_vkCreateSampler(VkDevice device, const VkSamplerCreateInfo* pCreateInfo,
+                                      const VkAllocationCallbacks* pAllocator,
+                                      VkSampler* pSampler) {
+    AEMU_SCOPED_TRACE("vkCreateSampler");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateSampler_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkCreateSampler_VkResult_return =
+        resources->on_vkCreateSampler(vkEnc, VK_SUCCESS, device, pCreateInfo, pAllocator, pSampler);
+    return vkCreateSampler_VkResult_return;
+}
+static void entry_vkDestroySampler(VkDevice device, VkSampler sampler,
+                                   const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroySampler");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroySampler(device, sampler, pAllocator, true /* do lock */);
+}
+static VkResult entry_vkCreateDescriptorSetLayout(
+    VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkDescriptorSetLayout* pSetLayout) {
+    AEMU_SCOPED_TRACE("vkCreateDescriptorSetLayout");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateDescriptorSetLayout_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkCreateDescriptorSetLayout_VkResult_return = resources->on_vkCreateDescriptorSetLayout(
+        vkEnc, VK_SUCCESS, device, pCreateInfo, pAllocator, pSetLayout);
+    return vkCreateDescriptorSetLayout_VkResult_return;
+}
+static void entry_vkDestroyDescriptorSetLayout(VkDevice device,
+                                               VkDescriptorSetLayout descriptorSetLayout,
+                                               const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyDescriptorSetLayout");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    auto resources = ResourceTracker::get();
+    resources->on_vkDestroyDescriptorSetLayout(vkEnc, device, descriptorSetLayout, pAllocator);
+}
+static VkResult entry_vkCreateDescriptorPool(VkDevice device,
+                                             const VkDescriptorPoolCreateInfo* pCreateInfo,
+                                             const VkAllocationCallbacks* pAllocator,
+                                             VkDescriptorPool* pDescriptorPool) {
+    AEMU_SCOPED_TRACE("vkCreateDescriptorPool");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateDescriptorPool_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkCreateDescriptorPool_VkResult_return = resources->on_vkCreateDescriptorPool(
+        vkEnc, VK_SUCCESS, device, pCreateInfo, pAllocator, pDescriptorPool);
+    return vkCreateDescriptorPool_VkResult_return;
+}
+static void entry_vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool,
+                                          const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyDescriptorPool");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    auto resources = ResourceTracker::get();
+    resources->on_vkDestroyDescriptorPool(vkEnc, device, descriptorPool, pAllocator);
+}
+static VkResult entry_vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool,
+                                            VkDescriptorPoolResetFlags flags) {
+    AEMU_SCOPED_TRACE("vkResetDescriptorPool");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkResetDescriptorPool_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkResetDescriptorPool_VkResult_return =
+        resources->on_vkResetDescriptorPool(vkEnc, VK_SUCCESS, device, descriptorPool, flags);
+    return vkResetDescriptorPool_VkResult_return;
+}
+static VkResult entry_vkAllocateDescriptorSets(VkDevice device,
+                                               const VkDescriptorSetAllocateInfo* pAllocateInfo,
+                                               VkDescriptorSet* pDescriptorSets) {
+    AEMU_SCOPED_TRACE("vkAllocateDescriptorSets");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkAllocateDescriptorSets_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkAllocateDescriptorSets_VkResult_return = resources->on_vkAllocateDescriptorSets(
+        vkEnc, VK_SUCCESS, device, pAllocateInfo, pDescriptorSets);
+    return vkAllocateDescriptorSets_VkResult_return;
+}
+static VkResult entry_vkFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool,
+                                           uint32_t descriptorSetCount,
+                                           const VkDescriptorSet* pDescriptorSets) {
+    AEMU_SCOPED_TRACE("vkFreeDescriptorSets");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkFreeDescriptorSets_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkFreeDescriptorSets_VkResult_return = resources->on_vkFreeDescriptorSets(
+        vkEnc, VK_SUCCESS, device, descriptorPool, descriptorSetCount, pDescriptorSets);
+    return vkFreeDescriptorSets_VkResult_return;
+}
+static void entry_vkUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount,
+                                         const VkWriteDescriptorSet* pDescriptorWrites,
+                                         uint32_t descriptorCopyCount,
+                                         const VkCopyDescriptorSet* pDescriptorCopies) {
+    AEMU_SCOPED_TRACE("vkUpdateDescriptorSets");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    auto resources = ResourceTracker::get();
+    resources->on_vkUpdateDescriptorSets(vkEnc, device, descriptorWriteCount, pDescriptorWrites,
+                                         descriptorCopyCount, pDescriptorCopies);
+}
+static VkResult entry_vkCreateFramebuffer(VkDevice device,
+                                          const VkFramebufferCreateInfo* pCreateInfo,
+                                          const VkAllocationCallbacks* pAllocator,
+                                          VkFramebuffer* pFramebuffer) {
+    AEMU_SCOPED_TRACE("vkCreateFramebuffer");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateFramebuffer_VkResult_return = (VkResult)0;
+    vkCreateFramebuffer_VkResult_return = vkEnc->vkCreateFramebuffer(
+        device, pCreateInfo, pAllocator, pFramebuffer, true /* do lock */);
+    return vkCreateFramebuffer_VkResult_return;
+}
+static void entry_vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer,
+                                       const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyFramebuffer");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyFramebuffer(device, framebuffer, pAllocator, true /* do lock */);
+}
+static VkResult entry_vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo,
+                                         const VkAllocationCallbacks* pAllocator,
+                                         VkRenderPass* pRenderPass) {
+    AEMU_SCOPED_TRACE("vkCreateRenderPass");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateRenderPass_VkResult_return = (VkResult)0;
+    vkCreateRenderPass_VkResult_return =
+        vkEnc->vkCreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass, true /* do lock */);
+    return vkCreateRenderPass_VkResult_return;
+}
+static void entry_vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass,
+                                      const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyRenderPass");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyRenderPass(device, renderPass, pAllocator, true /* do lock */);
+}
+static void entry_vkGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass,
+                                             VkExtent2D* pGranularity) {
+    AEMU_SCOPED_TRACE("vkGetRenderAreaGranularity");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetRenderAreaGranularity(device, renderPass, pGranularity, true /* do lock */);
+}
+static VkResult entry_vkCreateCommandPool(VkDevice device,
+                                          const VkCommandPoolCreateInfo* pCreateInfo,
+                                          const VkAllocationCallbacks* pAllocator,
+                                          VkCommandPool* pCommandPool) {
+    AEMU_SCOPED_TRACE("vkCreateCommandPool");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateCommandPool_VkResult_return = (VkResult)0;
+    vkCreateCommandPool_VkResult_return = vkEnc->vkCreateCommandPool(
+        device, pCreateInfo, pAllocator, pCommandPool, true /* do lock */);
+    return vkCreateCommandPool_VkResult_return;
+}
+static void entry_vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool,
+                                       const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyCommandPool");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyCommandPool(device, commandPool, pAllocator, true /* do lock */);
+}
+static VkResult entry_vkResetCommandPool(VkDevice device, VkCommandPool commandPool,
+                                         VkCommandPoolResetFlags flags) {
+    AEMU_SCOPED_TRACE("vkResetCommandPool");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkResetCommandPool_VkResult_return = (VkResult)0;
+    vkResetCommandPool_VkResult_return =
+        vkEnc->vkResetCommandPool(device, commandPool, flags, true /* do lock */);
+    if (vkResetCommandPool_VkResult_return == VK_SUCCESS) {
+        ResourceTracker::get()->resetCommandPoolStagingInfo(commandPool);
+    }
+    return vkResetCommandPool_VkResult_return;
+}
+static VkResult entry_vkAllocateCommandBuffers(VkDevice device,
+                                               const VkCommandBufferAllocateInfo* pAllocateInfo,
+                                               VkCommandBuffer* pCommandBuffers) {
+    AEMU_SCOPED_TRACE("vkAllocateCommandBuffers");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkAllocateCommandBuffers_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkAllocateCommandBuffers_VkResult_return = resources->on_vkAllocateCommandBuffers(
+        vkEnc, VK_SUCCESS, device, pAllocateInfo, pCommandBuffers);
+    if (vkAllocateCommandBuffers_VkResult_return == VK_SUCCESS) {
+        ResourceTracker::get()->addToCommandPool(
+            pAllocateInfo->commandPool, pAllocateInfo->commandBufferCount, pCommandBuffers);
+    }
+    return vkAllocateCommandBuffers_VkResult_return;
+}
+static void entry_vkFreeCommandBuffers(VkDevice device, VkCommandPool commandPool,
+                                       uint32_t commandBufferCount,
+                                       const VkCommandBuffer* pCommandBuffers) {
+    AEMU_SCOPED_TRACE("vkFreeCommandBuffers");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkFreeCommandBuffers(device, commandPool, commandBufferCount, pCommandBuffers,
+                                true /* do lock */);
+}
+static VkResult entry_vkBeginCommandBuffer(VkCommandBuffer commandBuffer,
+                                           const VkCommandBufferBeginInfo* pBeginInfo) {
+    AEMU_SCOPED_TRACE("vkBeginCommandBuffer");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    VkResult vkBeginCommandBuffer_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkBeginCommandBuffer_VkResult_return =
+        resources->on_vkBeginCommandBuffer(vkEnc, VK_SUCCESS, commandBuffer, pBeginInfo);
+    return vkBeginCommandBuffer_VkResult_return;
+}
+static VkResult entry_vkEndCommandBuffer(VkCommandBuffer commandBuffer) {
+    AEMU_SCOPED_TRACE("vkEndCommandBuffer");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    VkResult vkEndCommandBuffer_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkEndCommandBuffer_VkResult_return =
+        resources->on_vkEndCommandBuffer(vkEnc, VK_SUCCESS, commandBuffer);
+    return vkEndCommandBuffer_VkResult_return;
+}
+static VkResult entry_vkResetCommandBuffer(VkCommandBuffer commandBuffer,
+                                           VkCommandBufferResetFlags flags) {
+    AEMU_SCOPED_TRACE("vkResetCommandBuffer");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    VkResult vkResetCommandBuffer_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkResetCommandBuffer_VkResult_return =
+        resources->on_vkResetCommandBuffer(vkEnc, VK_SUCCESS, commandBuffer, flags);
+    return vkResetCommandBuffer_VkResult_return;
+}
+static void entry_vkCmdBindPipeline(VkCommandBuffer commandBuffer,
+                                    VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) {
+    AEMU_SCOPED_TRACE("vkCmdBindPipeline");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBindPipeline(commandBuffer, pipelineBindPoint, pipeline, true /* do lock */);
+}
+static void entry_vkCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport,
+                                   uint32_t viewportCount, const VkViewport* pViewports) {
+    AEMU_SCOPED_TRACE("vkCmdSetViewport");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetViewport(commandBuffer, firstViewport, viewportCount, pViewports,
+                            true /* do lock */);
+}
+static void entry_vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor,
+                                  uint32_t scissorCount, const VkRect2D* pScissors) {
+    AEMU_SCOPED_TRACE("vkCmdSetScissor");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetScissor(commandBuffer, firstScissor, scissorCount, pScissors,
+                           true /* do lock */);
+}
+static void entry_vkCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth) {
+    AEMU_SCOPED_TRACE("vkCmdSetLineWidth");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetLineWidth(commandBuffer, lineWidth, true /* do lock */);
+}
+static void entry_vkCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor,
+                                    float depthBiasClamp, float depthBiasSlopeFactor) {
+    AEMU_SCOPED_TRACE("vkCmdSetDepthBias");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetDepthBias(commandBuffer, depthBiasConstantFactor, depthBiasClamp,
+                             depthBiasSlopeFactor, true /* do lock */);
+}
+static void entry_vkCmdSetBlendConstants(VkCommandBuffer commandBuffer,
+                                         const float blendConstants[4]) {
+    AEMU_SCOPED_TRACE("vkCmdSetBlendConstants");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetBlendConstants(commandBuffer, blendConstants, true /* do lock */);
+}
+static void entry_vkCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds,
+                                      float maxDepthBounds) {
+    AEMU_SCOPED_TRACE("vkCmdSetDepthBounds");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetDepthBounds(commandBuffer, minDepthBounds, maxDepthBounds, true /* do lock */);
+}
+static void entry_vkCmdSetStencilCompareMask(VkCommandBuffer commandBuffer,
+                                             VkStencilFaceFlags faceMask, uint32_t compareMask) {
+    AEMU_SCOPED_TRACE("vkCmdSetStencilCompareMask");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetStencilCompareMask(commandBuffer, faceMask, compareMask, true /* do lock */);
+}
+static void entry_vkCmdSetStencilWriteMask(VkCommandBuffer commandBuffer,
+                                           VkStencilFaceFlags faceMask, uint32_t writeMask) {
+    AEMU_SCOPED_TRACE("vkCmdSetStencilWriteMask");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetStencilWriteMask(commandBuffer, faceMask, writeMask, true /* do lock */);
+}
+static void entry_vkCmdSetStencilReference(VkCommandBuffer commandBuffer,
+                                           VkStencilFaceFlags faceMask, uint32_t reference) {
+    AEMU_SCOPED_TRACE("vkCmdSetStencilReference");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetStencilReference(commandBuffer, faceMask, reference, true /* do lock */);
+}
+static void entry_vkCmdBindDescriptorSets(
+    VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout,
+    uint32_t firstSet, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets,
+    uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets) {
+    AEMU_SCOPED_TRACE("vkCmdBindDescriptorSets");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    auto resources = ResourceTracker::get();
+    resources->on_vkCmdBindDescriptorSets(vkEnc, commandBuffer, pipelineBindPoint, layout, firstSet,
+                                          descriptorSetCount, pDescriptorSets, dynamicOffsetCount,
+                                          pDynamicOffsets);
+}
+static void entry_vkCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                       VkDeviceSize offset, VkIndexType indexType) {
+    AEMU_SCOPED_TRACE("vkCmdBindIndexBuffer");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBindIndexBuffer(commandBuffer, buffer, offset, indexType, true /* do lock */);
+}
+static void entry_vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding,
+                                         uint32_t bindingCount, const VkBuffer* pBuffers,
+                                         const VkDeviceSize* pOffsets) {
+    AEMU_SCOPED_TRACE("vkCmdBindVertexBuffers");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBindVertexBuffers(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets,
+                                  true /* do lock */);
+}
+static void entry_vkCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount,
+                            uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) {
+    AEMU_SCOPED_TRACE("vkCmdDraw");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance,
+                     true /* do lock */);
+}
+static void entry_vkCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount,
+                                   uint32_t instanceCount, uint32_t firstIndex,
+                                   int32_t vertexOffset, uint32_t firstInstance) {
+    AEMU_SCOPED_TRACE("vkCmdDrawIndexed");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDrawIndexed(commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset,
+                            firstInstance, true /* do lock */);
+}
+static void entry_vkCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                    VkDeviceSize offset, uint32_t drawCount, uint32_t stride) {
+    AEMU_SCOPED_TRACE("vkCmdDrawIndirect");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDrawIndirect(commandBuffer, buffer, offset, drawCount, stride, true /* do lock */);
+}
+static void entry_vkCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                           VkDeviceSize offset, uint32_t drawCount,
+                                           uint32_t stride) {
+    AEMU_SCOPED_TRACE("vkCmdDrawIndexedIndirect");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDrawIndexedIndirect(commandBuffer, buffer, offset, drawCount, stride,
+                                    true /* do lock */);
+}
+static void entry_vkCmdDispatch(VkCommandBuffer commandBuffer, uint32_t groupCountX,
+                                uint32_t groupCountY, uint32_t groupCountZ) {
+    AEMU_SCOPED_TRACE("vkCmdDispatch");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDispatch(commandBuffer, groupCountX, groupCountY, groupCountZ, true /* do lock */);
+}
+static void entry_vkCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                        VkDeviceSize offset) {
+    AEMU_SCOPED_TRACE("vkCmdDispatchIndirect");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDispatchIndirect(commandBuffer, buffer, offset, true /* do lock */);
+}
+static void entry_vkCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer,
+                                  VkBuffer dstBuffer, uint32_t regionCount,
+                                  const VkBufferCopy* pRegions) {
+    AEMU_SCOPED_TRACE("vkCmdCopyBuffer");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdCopyBuffer(commandBuffer, srcBuffer, dstBuffer, regionCount, pRegions,
+                           true /* do lock */);
+}
+static void entry_vkCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage,
+                                 VkImageLayout srcImageLayout, VkImage dstImage,
+                                 VkImageLayout dstImageLayout, uint32_t regionCount,
+                                 const VkImageCopy* pRegions) {
+    AEMU_SCOPED_TRACE("vkCmdCopyImage");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdCopyImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout,
+                          regionCount, pRegions, true /* do lock */);
+}
+static void entry_vkCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage,
+                                 VkImageLayout srcImageLayout, VkImage dstImage,
+                                 VkImageLayout dstImageLayout, uint32_t regionCount,
+                                 const VkImageBlit* pRegions, VkFilter filter) {
+    AEMU_SCOPED_TRACE("vkCmdBlitImage");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBlitImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout,
+                          regionCount, pRegions, filter, true /* do lock */);
+}
+static void entry_vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer,
+                                         VkImage dstImage, VkImageLayout dstImageLayout,
+                                         uint32_t regionCount, const VkBufferImageCopy* pRegions) {
+    AEMU_SCOPED_TRACE("vkCmdCopyBufferToImage");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdCopyBufferToImage(commandBuffer, srcBuffer, dstImage, dstImageLayout, regionCount,
+                                  pRegions, true /* do lock */);
+}
+static void entry_vkCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage,
+                                         VkImageLayout srcImageLayout, VkBuffer dstBuffer,
+                                         uint32_t regionCount, const VkBufferImageCopy* pRegions) {
+    AEMU_SCOPED_TRACE("vkCmdCopyImageToBuffer");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdCopyImageToBuffer(commandBuffer, srcImage, srcImageLayout, dstBuffer, regionCount,
+                                  pRegions, true /* do lock */);
+}
+static void entry_vkCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer,
+                                    VkDeviceSize dstOffset, VkDeviceSize dataSize,
+                                    const void* pData) {
+    AEMU_SCOPED_TRACE("vkCmdUpdateBuffer");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData,
+                             true /* do lock */);
+}
+static void entry_vkCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer,
+                                  VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data) {
+    AEMU_SCOPED_TRACE("vkCmdFillBuffer");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdFillBuffer(commandBuffer, dstBuffer, dstOffset, size, data, true /* do lock */);
+}
+static void entry_vkCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image,
+                                       VkImageLayout imageLayout, const VkClearColorValue* pColor,
+                                       uint32_t rangeCount,
+                                       const VkImageSubresourceRange* pRanges) {
+    AEMU_SCOPED_TRACE("vkCmdClearColorImage");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdClearColorImage(commandBuffer, image, imageLayout, pColor, rangeCount, pRanges,
+                                true /* do lock */);
+}
+static void entry_vkCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image,
+                                              VkImageLayout imageLayout,
+                                              const VkClearDepthStencilValue* pDepthStencil,
+                                              uint32_t rangeCount,
+                                              const VkImageSubresourceRange* pRanges) {
+    AEMU_SCOPED_TRACE("vkCmdClearDepthStencilImage");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdClearDepthStencilImage(commandBuffer, image, imageLayout, pDepthStencil, rangeCount,
+                                       pRanges, true /* do lock */);
+}
+static void entry_vkCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount,
+                                        const VkClearAttachment* pAttachments, uint32_t rectCount,
+                                        const VkClearRect* pRects) {
+    AEMU_SCOPED_TRACE("vkCmdClearAttachments");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdClearAttachments(commandBuffer, attachmentCount, pAttachments, rectCount, pRects,
+                                 true /* do lock */);
+}
+static void entry_vkCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage,
+                                    VkImageLayout srcImageLayout, VkImage dstImage,
+                                    VkImageLayout dstImageLayout, uint32_t regionCount,
+                                    const VkImageResolve* pRegions) {
+    AEMU_SCOPED_TRACE("vkCmdResolveImage");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdResolveImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout,
+                             regionCount, pRegions, true /* do lock */);
+}
+static void entry_vkCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event,
+                                VkPipelineStageFlags stageMask) {
+    AEMU_SCOPED_TRACE("vkCmdSetEvent");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetEvent(commandBuffer, event, stageMask, true /* do lock */);
+}
+static void entry_vkCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event,
+                                  VkPipelineStageFlags stageMask) {
+    AEMU_SCOPED_TRACE("vkCmdResetEvent");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdResetEvent(commandBuffer, event, stageMask, true /* do lock */);
+}
+static void entry_vkCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount,
+                                  const VkEvent* pEvents, VkPipelineStageFlags srcStageMask,
+                                  VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount,
+                                  const VkMemoryBarrier* pMemoryBarriers,
+                                  uint32_t bufferMemoryBarrierCount,
+                                  const VkBufferMemoryBarrier* pBufferMemoryBarriers,
+                                  uint32_t imageMemoryBarrierCount,
+                                  const VkImageMemoryBarrier* pImageMemoryBarriers) {
+    AEMU_SCOPED_TRACE("vkCmdWaitEvents");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdWaitEvents(commandBuffer, eventCount, pEvents, srcStageMask, dstStageMask,
+                           memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount,
+                           pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers,
+                           true /* do lock */);
+}
+static void entry_vkCmdPipelineBarrier(
+    VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask,
+    VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags,
+    uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers,
+    uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers,
+    uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers) {
+    AEMU_SCOPED_TRACE("vkCmdPipelineBarrier");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    auto resources = ResourceTracker::get();
+    resources->on_vkCmdPipelineBarrier(vkEnc, commandBuffer, srcStageMask, dstStageMask,
+                                       dependencyFlags, memoryBarrierCount, pMemoryBarriers,
+                                       bufferMemoryBarrierCount, pBufferMemoryBarriers,
+                                       imageMemoryBarrierCount, pImageMemoryBarriers);
+}
+static void entry_vkCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool,
+                                  uint32_t query, VkQueryControlFlags flags) {
+    AEMU_SCOPED_TRACE("vkCmdBeginQuery");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBeginQuery(commandBuffer, queryPool, query, flags, true /* do lock */);
+}
+static void entry_vkCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool,
+                                uint32_t query) {
+    AEMU_SCOPED_TRACE("vkCmdEndQuery");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdEndQuery(commandBuffer, queryPool, query, true /* do lock */);
+}
+static void entry_vkCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool,
+                                      uint32_t firstQuery, uint32_t queryCount) {
+    AEMU_SCOPED_TRACE("vkCmdResetQueryPool");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdResetQueryPool(commandBuffer, queryPool, firstQuery, queryCount,
+                               true /* do lock */);
+}
+static void entry_vkCmdWriteTimestamp(VkCommandBuffer commandBuffer,
+                                      VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool,
+                                      uint32_t query) {
+    AEMU_SCOPED_TRACE("vkCmdWriteTimestamp");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, query, true /* do lock */);
+}
+static void entry_vkCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool,
+                                            uint32_t firstQuery, uint32_t queryCount,
+                                            VkBuffer dstBuffer, VkDeviceSize dstOffset,
+                                            VkDeviceSize stride, VkQueryResultFlags flags) {
+    AEMU_SCOPED_TRACE("vkCmdCopyQueryPoolResults");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdCopyQueryPoolResults(commandBuffer, queryPool, firstQuery, queryCount, dstBuffer,
+                                     dstOffset, stride, flags, true /* do lock */);
+}
+static void entry_vkCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout,
+                                     VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size,
+                                     const void* pValues) {
+    AEMU_SCOPED_TRACE("vkCmdPushConstants");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdPushConstants(commandBuffer, layout, stageFlags, offset, size, pValues,
+                              true /* do lock */);
+}
+static void entry_vkCmdBeginRenderPass(VkCommandBuffer commandBuffer,
+                                       const VkRenderPassBeginInfo* pRenderPassBegin,
+                                       VkSubpassContents contents) {
+    AEMU_SCOPED_TRACE("vkCmdBeginRenderPass");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents, true /* do lock */);
+}
+static void entry_vkCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents) {
+    AEMU_SCOPED_TRACE("vkCmdNextSubpass");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdNextSubpass(commandBuffer, contents, true /* do lock */);
+}
+static void entry_vkCmdEndRenderPass(VkCommandBuffer commandBuffer) {
+    AEMU_SCOPED_TRACE("vkCmdEndRenderPass");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdEndRenderPass(commandBuffer, true /* do lock */);
+}
+static void entry_vkCmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBufferCount,
+                                       const VkCommandBuffer* pCommandBuffers) {
+    AEMU_SCOPED_TRACE("vkCmdExecuteCommands");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    auto resources = ResourceTracker::get();
+    resources->on_vkCmdExecuteCommands(vkEnc, commandBuffer, commandBufferCount, pCommandBuffers);
+}
+#endif
+#ifdef VK_VERSION_1_1
+static VkResult entry_vkEnumerateInstanceVersion(uint32_t* pApiVersion) {
+    AEMU_SCOPED_TRACE("vkEnumerateInstanceVersion");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkEnumerateInstanceVersion_VkResult_return = (VkResult)0;
+    vkEnumerateInstanceVersion_VkResult_return =
+        vkEnc->vkEnumerateInstanceVersion(pApiVersion, true /* do lock */);
+    return vkEnumerateInstanceVersion_VkResult_return;
+}
+static VkResult entry_vkBindBufferMemory2(VkDevice device, uint32_t bindInfoCount,
+                                          const VkBindBufferMemoryInfo* pBindInfos) {
+    AEMU_SCOPED_TRACE("vkBindBufferMemory2");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkBindBufferMemory2_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkBindBufferMemory2_VkResult_return =
+        resources->on_vkBindBufferMemory2(vkEnc, VK_SUCCESS, device, bindInfoCount, pBindInfos);
+    return vkBindBufferMemory2_VkResult_return;
+}
+static VkResult dynCheck_entry_vkBindBufferMemory2(VkDevice device, uint32_t bindInfoCount,
+                                                   const VkBindBufferMemoryInfo* pBindInfos) {
+    auto resources = ResourceTracker::get();
+    if (resources->getApiVersionFromDevice(device) < VK_API_VERSION_1_1) {
+        sOnInvalidDynamicallyCheckedCall("vkBindBufferMemory2", "VK_VERSION_1_1");
+    }
+    AEMU_SCOPED_TRACE("vkBindBufferMemory2");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkBindBufferMemory2_VkResult_return = (VkResult)0;
+    vkBindBufferMemory2_VkResult_return =
+        resources->on_vkBindBufferMemory2(vkEnc, VK_SUCCESS, device, bindInfoCount, pBindInfos);
+    return vkBindBufferMemory2_VkResult_return;
+}
+static VkResult entry_vkBindImageMemory2(VkDevice device, uint32_t bindInfoCount,
+                                         const VkBindImageMemoryInfo* pBindInfos) {
+    AEMU_SCOPED_TRACE("vkBindImageMemory2");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkBindImageMemory2_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkBindImageMemory2_VkResult_return =
+        resources->on_vkBindImageMemory2(vkEnc, VK_SUCCESS, device, bindInfoCount, pBindInfos);
+    return vkBindImageMemory2_VkResult_return;
+}
+static VkResult dynCheck_entry_vkBindImageMemory2(VkDevice device, uint32_t bindInfoCount,
+                                                  const VkBindImageMemoryInfo* pBindInfos) {
+    auto resources = ResourceTracker::get();
+    if (resources->getApiVersionFromDevice(device) < VK_API_VERSION_1_1) {
+        sOnInvalidDynamicallyCheckedCall("vkBindImageMemory2", "VK_VERSION_1_1");
+    }
+    AEMU_SCOPED_TRACE("vkBindImageMemory2");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkBindImageMemory2_VkResult_return = (VkResult)0;
+    vkBindImageMemory2_VkResult_return =
+        resources->on_vkBindImageMemory2(vkEnc, VK_SUCCESS, device, bindInfoCount, pBindInfos);
+    return vkBindImageMemory2_VkResult_return;
+}
+static void entry_vkGetDeviceGroupPeerMemoryFeatures(
+    VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex,
+    VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) {
+    AEMU_SCOPED_TRACE("vkGetDeviceGroupPeerMemoryFeatures");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetDeviceGroupPeerMemoryFeatures(device, heapIndex, localDeviceIndex,
+                                              remoteDeviceIndex, pPeerMemoryFeatures,
+                                              true /* do lock */);
+}
+static void dynCheck_entry_vkGetDeviceGroupPeerMemoryFeatures(
+    VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex,
+    VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) {
+    auto resources = ResourceTracker::get();
+    if (resources->getApiVersionFromDevice(device) < VK_API_VERSION_1_1) {
+        sOnInvalidDynamicallyCheckedCall("vkGetDeviceGroupPeerMemoryFeatures", "VK_VERSION_1_1");
+    }
+    AEMU_SCOPED_TRACE("vkGetDeviceGroupPeerMemoryFeatures");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetDeviceGroupPeerMemoryFeatures(device, heapIndex, localDeviceIndex,
+                                              remoteDeviceIndex, pPeerMemoryFeatures,
+                                              true /* do lock */);
+}
+static void entry_vkCmdSetDeviceMask(VkCommandBuffer commandBuffer, uint32_t deviceMask) {
+    AEMU_SCOPED_TRACE("vkCmdSetDeviceMask");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetDeviceMask(commandBuffer, deviceMask, true /* do lock */);
+}
+static void entry_vkCmdDispatchBase(VkCommandBuffer commandBuffer, uint32_t baseGroupX,
+                                    uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX,
+                                    uint32_t groupCountY, uint32_t groupCountZ) {
+    AEMU_SCOPED_TRACE("vkCmdDispatchBase");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDispatchBase(commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX,
+                             groupCountY, groupCountZ, true /* do lock */);
+}
+static VkResult entry_vkEnumeratePhysicalDeviceGroups(
+    VkInstance instance, uint32_t* pPhysicalDeviceGroupCount,
+    VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties) {
+    AEMU_SCOPED_TRACE("vkEnumeratePhysicalDeviceGroups");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkEnumeratePhysicalDeviceGroups_VkResult_return = (VkResult)0;
+    vkEnumeratePhysicalDeviceGroups_VkResult_return = vkEnc->vkEnumeratePhysicalDeviceGroups(
+        instance, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties, true /* do lock */);
+    return vkEnumeratePhysicalDeviceGroups_VkResult_return;
+}
+static void entry_vkGetImageMemoryRequirements2(VkDevice device,
+                                                const VkImageMemoryRequirementsInfo2* pInfo,
+                                                VkMemoryRequirements2* pMemoryRequirements) {
+    AEMU_SCOPED_TRACE("vkGetImageMemoryRequirements2");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    auto resources = ResourceTracker::get();
+    resources->on_vkGetImageMemoryRequirements2(vkEnc, device, pInfo, pMemoryRequirements);
+}
+static void dynCheck_entry_vkGetImageMemoryRequirements2(
+    VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo,
+    VkMemoryRequirements2* pMemoryRequirements) {
+    auto resources = ResourceTracker::get();
+    if (resources->getApiVersionFromDevice(device) < VK_API_VERSION_1_1) {
+        sOnInvalidDynamicallyCheckedCall("vkGetImageMemoryRequirements2", "VK_VERSION_1_1");
+    }
+    AEMU_SCOPED_TRACE("vkGetImageMemoryRequirements2");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    resources->on_vkGetImageMemoryRequirements2(vkEnc, device, pInfo, pMemoryRequirements);
+}
+static void entry_vkGetBufferMemoryRequirements2(VkDevice device,
+                                                 const VkBufferMemoryRequirementsInfo2* pInfo,
+                                                 VkMemoryRequirements2* pMemoryRequirements) {
+    AEMU_SCOPED_TRACE("vkGetBufferMemoryRequirements2");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    auto resources = ResourceTracker::get();
+    resources->on_vkGetBufferMemoryRequirements2(vkEnc, device, pInfo, pMemoryRequirements);
+}
+static void dynCheck_entry_vkGetBufferMemoryRequirements2(
+    VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo,
+    VkMemoryRequirements2* pMemoryRequirements) {
+    auto resources = ResourceTracker::get();
+    if (resources->getApiVersionFromDevice(device) < VK_API_VERSION_1_1) {
+        sOnInvalidDynamicallyCheckedCall("vkGetBufferMemoryRequirements2", "VK_VERSION_1_1");
+    }
+    AEMU_SCOPED_TRACE("vkGetBufferMemoryRequirements2");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    resources->on_vkGetBufferMemoryRequirements2(vkEnc, device, pInfo, pMemoryRequirements);
+}
+static void entry_vkGetImageSparseMemoryRequirements2(
+    VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo,
+    uint32_t* pSparseMemoryRequirementCount,
+    VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) {
+    AEMU_SCOPED_TRACE("vkGetImageSparseMemoryRequirements2");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetImageSparseMemoryRequirements2(device, pInfo, pSparseMemoryRequirementCount,
+                                               pSparseMemoryRequirements, true /* do lock */);
+}
+static void dynCheck_entry_vkGetImageSparseMemoryRequirements2(
+    VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo,
+    uint32_t* pSparseMemoryRequirementCount,
+    VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) {
+    auto resources = ResourceTracker::get();
+    if (resources->getApiVersionFromDevice(device) < VK_API_VERSION_1_1) {
+        sOnInvalidDynamicallyCheckedCall("vkGetImageSparseMemoryRequirements2", "VK_VERSION_1_1");
+    }
+    AEMU_SCOPED_TRACE("vkGetImageSparseMemoryRequirements2");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetImageSparseMemoryRequirements2(device, pInfo, pSparseMemoryRequirementCount,
+                                               pSparseMemoryRequirements, true /* do lock */);
+}
+static void entry_vkGetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
+                                               VkPhysicalDeviceFeatures2* pFeatures) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFeatures2");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetPhysicalDeviceFeatures2(physicalDevice, pFeatures, true /* do lock */);
+}
+static void entry_vkGetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice,
+                                                 VkPhysicalDeviceProperties2* pProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceProperties2");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetPhysicalDeviceProperties2(physicalDevice, pProperties, true /* do lock */);
+}
+static void entry_vkGetPhysicalDeviceFormatProperties2(VkPhysicalDevice physicalDevice,
+                                                       VkFormat format,
+                                                       VkFormatProperties2* pFormatProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFormatProperties2");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetPhysicalDeviceFormatProperties2(physicalDevice, format, pFormatProperties,
+                                                true /* do lock */);
+}
+static VkResult entry_vkGetPhysicalDeviceImageFormatProperties2(
+    VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
+    VkImageFormatProperties2* pImageFormatProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceImageFormatProperties2");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPhysicalDeviceImageFormatProperties2_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkGetPhysicalDeviceImageFormatProperties2_VkResult_return =
+        resources->on_vkGetPhysicalDeviceImageFormatProperties2(
+            vkEnc, VK_SUCCESS, physicalDevice, pImageFormatInfo, pImageFormatProperties);
+    return vkGetPhysicalDeviceImageFormatProperties2_VkResult_return;
+}
+static void entry_vkGetPhysicalDeviceQueueFamilyProperties2(
+    VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount,
+    VkQueueFamilyProperties2* pQueueFamilyProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceQueueFamilyProperties2");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetPhysicalDeviceQueueFamilyProperties2(physicalDevice, pQueueFamilyPropertyCount,
+                                                     pQueueFamilyProperties, true /* do lock */);
+}
+static void entry_vkGetPhysicalDeviceMemoryProperties2(
+    VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2* pMemoryProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMemoryProperties2");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetPhysicalDeviceMemoryProperties2(physicalDevice, pMemoryProperties,
+                                                true /* do lock */);
+}
+static void entry_vkGetPhysicalDeviceSparseImageFormatProperties2(
+    VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo,
+    uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSparseImageFormatProperties2");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetPhysicalDeviceSparseImageFormatProperties2(
+        physicalDevice, pFormatInfo, pPropertyCount, pProperties, true /* do lock */);
+}
+static void entry_vkTrimCommandPool(VkDevice device, VkCommandPool commandPool,
+                                    VkCommandPoolTrimFlags flags) {
+    AEMU_SCOPED_TRACE("vkTrimCommandPool");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkTrimCommandPool(device, commandPool, flags, true /* do lock */);
+}
+static void dynCheck_entry_vkTrimCommandPool(VkDevice device, VkCommandPool commandPool,
+                                             VkCommandPoolTrimFlags flags) {
+    auto resources = ResourceTracker::get();
+    if (resources->getApiVersionFromDevice(device) < VK_API_VERSION_1_1) {
+        sOnInvalidDynamicallyCheckedCall("vkTrimCommandPool", "VK_VERSION_1_1");
+    }
+    AEMU_SCOPED_TRACE("vkTrimCommandPool");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkTrimCommandPool(device, commandPool, flags, true /* do lock */);
+}
+static void entry_vkGetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2* pQueueInfo,
+                                    VkQueue* pQueue) {
+    AEMU_SCOPED_TRACE("vkGetDeviceQueue2");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetDeviceQueue2(device, pQueueInfo, pQueue, true /* do lock */);
+}
+static void dynCheck_entry_vkGetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2* pQueueInfo,
+                                             VkQueue* pQueue) {
+    auto resources = ResourceTracker::get();
+    if (resources->getApiVersionFromDevice(device) < VK_API_VERSION_1_1) {
+        sOnInvalidDynamicallyCheckedCall("vkGetDeviceQueue2", "VK_VERSION_1_1");
+    }
+    AEMU_SCOPED_TRACE("vkGetDeviceQueue2");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetDeviceQueue2(device, pQueueInfo, pQueue, true /* do lock */);
+}
+static VkResult entry_vkCreateSamplerYcbcrConversion(
+    VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion) {
+    AEMU_SCOPED_TRACE("vkCreateSamplerYcbcrConversion");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateSamplerYcbcrConversion_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkCreateSamplerYcbcrConversion_VkResult_return = resources->on_vkCreateSamplerYcbcrConversion(
+        vkEnc, VK_SUCCESS, device, pCreateInfo, pAllocator, pYcbcrConversion);
+    return vkCreateSamplerYcbcrConversion_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCreateSamplerYcbcrConversion(
+    VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion) {
+    auto resources = ResourceTracker::get();
+    if (resources->getApiVersionFromDevice(device) < VK_API_VERSION_1_1) {
+        sOnInvalidDynamicallyCheckedCall("vkCreateSamplerYcbcrConversion", "VK_VERSION_1_1");
+    }
+    AEMU_SCOPED_TRACE("vkCreateSamplerYcbcrConversion");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateSamplerYcbcrConversion_VkResult_return = (VkResult)0;
+    vkCreateSamplerYcbcrConversion_VkResult_return = resources->on_vkCreateSamplerYcbcrConversion(
+        vkEnc, VK_SUCCESS, device, pCreateInfo, pAllocator, pYcbcrConversion);
+    return vkCreateSamplerYcbcrConversion_VkResult_return;
+}
+static void entry_vkDestroySamplerYcbcrConversion(VkDevice device,
+                                                  VkSamplerYcbcrConversion ycbcrConversion,
+                                                  const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroySamplerYcbcrConversion");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    auto resources = ResourceTracker::get();
+    resources->on_vkDestroySamplerYcbcrConversion(vkEnc, device, ycbcrConversion, pAllocator);
+}
+static void dynCheck_entry_vkDestroySamplerYcbcrConversion(
+    VkDevice device, VkSamplerYcbcrConversion ycbcrConversion,
+    const VkAllocationCallbacks* pAllocator) {
+    auto resources = ResourceTracker::get();
+    if (resources->getApiVersionFromDevice(device) < VK_API_VERSION_1_1) {
+        sOnInvalidDynamicallyCheckedCall("vkDestroySamplerYcbcrConversion", "VK_VERSION_1_1");
+    }
+    AEMU_SCOPED_TRACE("vkDestroySamplerYcbcrConversion");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    resources->on_vkDestroySamplerYcbcrConversion(vkEnc, device, ycbcrConversion, pAllocator);
+}
+static VkResult entry_vkCreateDescriptorUpdateTemplate(
+    VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator,
+    VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) {
+    AEMU_SCOPED_TRACE("vkCreateDescriptorUpdateTemplate");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateDescriptorUpdateTemplate_VkResult_return = (VkResult)0;
+    vkCreateDescriptorUpdateTemplate_VkResult_return = vkEnc->vkCreateDescriptorUpdateTemplate(
+        device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate, true /* do lock */);
+    return vkCreateDescriptorUpdateTemplate_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCreateDescriptorUpdateTemplate(
+    VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator,
+    VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) {
+    auto resources = ResourceTracker::get();
+    if (resources->getApiVersionFromDevice(device) < VK_API_VERSION_1_1) {
+        sOnInvalidDynamicallyCheckedCall("vkCreateDescriptorUpdateTemplate", "VK_VERSION_1_1");
+    }
+    AEMU_SCOPED_TRACE("vkCreateDescriptorUpdateTemplate");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateDescriptorUpdateTemplate_VkResult_return = (VkResult)0;
+    vkCreateDescriptorUpdateTemplate_VkResult_return = vkEnc->vkCreateDescriptorUpdateTemplate(
+        device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate, true /* do lock */);
+    return vkCreateDescriptorUpdateTemplate_VkResult_return;
+}
+static void entry_vkDestroyDescriptorUpdateTemplate(
+    VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate,
+    const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyDescriptorUpdateTemplate");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyDescriptorUpdateTemplate(device, descriptorUpdateTemplate, pAllocator,
+                                             true /* do lock */);
+}
+static void dynCheck_entry_vkDestroyDescriptorUpdateTemplate(
+    VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate,
+    const VkAllocationCallbacks* pAllocator) {
+    auto resources = ResourceTracker::get();
+    if (resources->getApiVersionFromDevice(device) < VK_API_VERSION_1_1) {
+        sOnInvalidDynamicallyCheckedCall("vkDestroyDescriptorUpdateTemplate", "VK_VERSION_1_1");
+    }
+    AEMU_SCOPED_TRACE("vkDestroyDescriptorUpdateTemplate");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyDescriptorUpdateTemplate(device, descriptorUpdateTemplate, pAllocator,
+                                             true /* do lock */);
+}
+static void entry_vkUpdateDescriptorSetWithTemplate(
+    VkDevice device, VkDescriptorSet descriptorSet,
+    VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData) {
+    AEMU_SCOPED_TRACE("vkUpdateDescriptorSetWithTemplate");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    auto resources = ResourceTracker::get();
+    resources->on_vkUpdateDescriptorSetWithTemplate(vkEnc, device, descriptorSet,
+                                                    descriptorUpdateTemplate, pData);
+}
+static void dynCheck_entry_vkUpdateDescriptorSetWithTemplate(
+    VkDevice device, VkDescriptorSet descriptorSet,
+    VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData) {
+    auto resources = ResourceTracker::get();
+    if (resources->getApiVersionFromDevice(device) < VK_API_VERSION_1_1) {
+        sOnInvalidDynamicallyCheckedCall("vkUpdateDescriptorSetWithTemplate", "VK_VERSION_1_1");
+    }
+    AEMU_SCOPED_TRACE("vkUpdateDescriptorSetWithTemplate");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    resources->on_vkUpdateDescriptorSetWithTemplate(vkEnc, device, descriptorSet,
+                                                    descriptorUpdateTemplate, pData);
+}
+static void entry_vkGetPhysicalDeviceExternalBufferProperties(
+    VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo,
+    VkExternalBufferProperties* pExternalBufferProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalBufferProperties");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetPhysicalDeviceExternalBufferProperties(
+        physicalDevice, pExternalBufferInfo, pExternalBufferProperties, true /* do lock */);
+}
+static void entry_vkGetPhysicalDeviceExternalFenceProperties(
+    VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo,
+    VkExternalFenceProperties* pExternalFenceProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalFenceProperties");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    auto resources = ResourceTracker::get();
+    resources->on_vkGetPhysicalDeviceExternalFenceProperties(
+        vkEnc, physicalDevice, pExternalFenceInfo, pExternalFenceProperties);
+}
+static void entry_vkGetPhysicalDeviceExternalSemaphoreProperties(
+    VkPhysicalDevice physicalDevice,
+    const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo,
+    VkExternalSemaphoreProperties* pExternalSemaphoreProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalSemaphoreProperties");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetPhysicalDeviceExternalSemaphoreProperties(
+        physicalDevice, pExternalSemaphoreInfo, pExternalSemaphoreProperties, true /* do lock */);
+}
+static void entry_vkGetDescriptorSetLayoutSupport(
+    VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
+    VkDescriptorSetLayoutSupport* pSupport) {
+    AEMU_SCOPED_TRACE("vkGetDescriptorSetLayoutSupport");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetDescriptorSetLayoutSupport(device, pCreateInfo, pSupport, true /* do lock */);
+}
+static void dynCheck_entry_vkGetDescriptorSetLayoutSupport(
+    VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
+    VkDescriptorSetLayoutSupport* pSupport) {
+    auto resources = ResourceTracker::get();
+    if (resources->getApiVersionFromDevice(device) < VK_API_VERSION_1_1) {
+        sOnInvalidDynamicallyCheckedCall("vkGetDescriptorSetLayoutSupport", "VK_VERSION_1_1");
+    }
+    AEMU_SCOPED_TRACE("vkGetDescriptorSetLayoutSupport");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetDescriptorSetLayoutSupport(device, pCreateInfo, pSupport, true /* do lock */);
+}
+#endif
+#ifdef VK_VERSION_1_2
+static void entry_vkCmdDrawIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                         VkDeviceSize offset, VkBuffer countBuffer,
+                                         VkDeviceSize countBufferOffset, uint32_t maxDrawCount,
+                                         uint32_t stride) {
+    AEMU_SCOPED_TRACE("vkCmdDrawIndirectCount");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDrawIndirectCount(commandBuffer, buffer, offset, countBuffer, countBufferOffset,
+                                  maxDrawCount, stride, true /* do lock */);
+}
+static void entry_vkCmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                                VkDeviceSize offset, VkBuffer countBuffer,
+                                                VkDeviceSize countBufferOffset,
+                                                uint32_t maxDrawCount, uint32_t stride) {
+    AEMU_SCOPED_TRACE("vkCmdDrawIndexedIndirectCount");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDrawIndexedIndirectCount(commandBuffer, buffer, offset, countBuffer,
+                                         countBufferOffset, maxDrawCount, stride,
+                                         true /* do lock */);
+}
+static VkResult entry_vkCreateRenderPass2(VkDevice device,
+                                          const VkRenderPassCreateInfo2* pCreateInfo,
+                                          const VkAllocationCallbacks* pAllocator,
+                                          VkRenderPass* pRenderPass) {
+    AEMU_SCOPED_TRACE("vkCreateRenderPass2");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateRenderPass2_VkResult_return = (VkResult)0;
+    vkCreateRenderPass2_VkResult_return = vkEnc->vkCreateRenderPass2(
+        device, pCreateInfo, pAllocator, pRenderPass, true /* do lock */);
+    return vkCreateRenderPass2_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCreateRenderPass2(VkDevice device,
+                                                   const VkRenderPassCreateInfo2* pCreateInfo,
+                                                   const VkAllocationCallbacks* pAllocator,
+                                                   VkRenderPass* pRenderPass) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_VERSION_1_2")) {
+        sOnInvalidDynamicallyCheckedCall("vkCreateRenderPass2", "VK_VERSION_1_2");
+    }
+    AEMU_SCOPED_TRACE("vkCreateRenderPass2");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateRenderPass2_VkResult_return = (VkResult)0;
+    vkCreateRenderPass2_VkResult_return = vkEnc->vkCreateRenderPass2(
+        device, pCreateInfo, pAllocator, pRenderPass, true /* do lock */);
+    return vkCreateRenderPass2_VkResult_return;
+}
+static void entry_vkCmdBeginRenderPass2(VkCommandBuffer commandBuffer,
+                                        const VkRenderPassBeginInfo* pRenderPassBegin,
+                                        const VkSubpassBeginInfo* pSubpassBeginInfo) {
+    AEMU_SCOPED_TRACE("vkCmdBeginRenderPass2");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBeginRenderPass2(commandBuffer, pRenderPassBegin, pSubpassBeginInfo,
+                                 true /* do lock */);
+}
+static void entry_vkCmdNextSubpass2(VkCommandBuffer commandBuffer,
+                                    const VkSubpassBeginInfo* pSubpassBeginInfo,
+                                    const VkSubpassEndInfo* pSubpassEndInfo) {
+    AEMU_SCOPED_TRACE("vkCmdNextSubpass2");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdNextSubpass2(commandBuffer, pSubpassBeginInfo, pSubpassEndInfo, true /* do lock */);
+}
+static void entry_vkCmdEndRenderPass2(VkCommandBuffer commandBuffer,
+                                      const VkSubpassEndInfo* pSubpassEndInfo) {
+    AEMU_SCOPED_TRACE("vkCmdEndRenderPass2");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdEndRenderPass2(commandBuffer, pSubpassEndInfo, true /* do lock */);
+}
+static void entry_vkResetQueryPool(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery,
+                                   uint32_t queryCount) {
+    AEMU_SCOPED_TRACE("vkResetQueryPool");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkResetQueryPool(device, queryPool, firstQuery, queryCount, true /* do lock */);
+}
+static void dynCheck_entry_vkResetQueryPool(VkDevice device, VkQueryPool queryPool,
+                                            uint32_t firstQuery, uint32_t queryCount) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_VERSION_1_2")) {
+        sOnInvalidDynamicallyCheckedCall("vkResetQueryPool", "VK_VERSION_1_2");
+    }
+    AEMU_SCOPED_TRACE("vkResetQueryPool");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkResetQueryPool(device, queryPool, firstQuery, queryCount, true /* do lock */);
+}
+static VkResult entry_vkGetSemaphoreCounterValue(VkDevice device, VkSemaphore semaphore,
+                                                 uint64_t* pValue) {
+    AEMU_SCOPED_TRACE("vkGetSemaphoreCounterValue");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetSemaphoreCounterValue_VkResult_return = (VkResult)0;
+    vkGetSemaphoreCounterValue_VkResult_return =
+        vkEnc->vkGetSemaphoreCounterValue(device, semaphore, pValue, true /* do lock */);
+    return vkGetSemaphoreCounterValue_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetSemaphoreCounterValue(VkDevice device, VkSemaphore semaphore,
+                                                          uint64_t* pValue) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_VERSION_1_2")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetSemaphoreCounterValue", "VK_VERSION_1_2");
+    }
+    AEMU_SCOPED_TRACE("vkGetSemaphoreCounterValue");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetSemaphoreCounterValue_VkResult_return = (VkResult)0;
+    vkGetSemaphoreCounterValue_VkResult_return =
+        vkEnc->vkGetSemaphoreCounterValue(device, semaphore, pValue, true /* do lock */);
+    return vkGetSemaphoreCounterValue_VkResult_return;
+}
+static VkResult entry_vkWaitSemaphores(VkDevice device, const VkSemaphoreWaitInfo* pWaitInfo,
+                                       uint64_t timeout) {
+    AEMU_SCOPED_TRACE("vkWaitSemaphores");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkWaitSemaphores_VkResult_return = (VkResult)0;
+    vkWaitSemaphores_VkResult_return =
+        vkEnc->vkWaitSemaphores(device, pWaitInfo, timeout, true /* do lock */);
+    return vkWaitSemaphores_VkResult_return;
+}
+static VkResult dynCheck_entry_vkWaitSemaphores(VkDevice device,
+                                                const VkSemaphoreWaitInfo* pWaitInfo,
+                                                uint64_t timeout) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_VERSION_1_2")) {
+        sOnInvalidDynamicallyCheckedCall("vkWaitSemaphores", "VK_VERSION_1_2");
+    }
+    AEMU_SCOPED_TRACE("vkWaitSemaphores");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkWaitSemaphores_VkResult_return = (VkResult)0;
+    vkWaitSemaphores_VkResult_return =
+        vkEnc->vkWaitSemaphores(device, pWaitInfo, timeout, true /* do lock */);
+    return vkWaitSemaphores_VkResult_return;
+}
+static VkResult entry_vkSignalSemaphore(VkDevice device, const VkSemaphoreSignalInfo* pSignalInfo) {
+    AEMU_SCOPED_TRACE("vkSignalSemaphore");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkSignalSemaphore_VkResult_return = (VkResult)0;
+    vkSignalSemaphore_VkResult_return =
+        vkEnc->vkSignalSemaphore(device, pSignalInfo, true /* do lock */);
+    return vkSignalSemaphore_VkResult_return;
+}
+static VkResult dynCheck_entry_vkSignalSemaphore(VkDevice device,
+                                                 const VkSemaphoreSignalInfo* pSignalInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_VERSION_1_2")) {
+        sOnInvalidDynamicallyCheckedCall("vkSignalSemaphore", "VK_VERSION_1_2");
+    }
+    AEMU_SCOPED_TRACE("vkSignalSemaphore");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkSignalSemaphore_VkResult_return = (VkResult)0;
+    vkSignalSemaphore_VkResult_return =
+        vkEnc->vkSignalSemaphore(device, pSignalInfo, true /* do lock */);
+    return vkSignalSemaphore_VkResult_return;
+}
+static VkDeviceAddress entry_vkGetBufferDeviceAddress(VkDevice device,
+                                                      const VkBufferDeviceAddressInfo* pInfo) {
+    AEMU_SCOPED_TRACE("vkGetBufferDeviceAddress");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkDeviceAddress vkGetBufferDeviceAddress_VkDeviceAddress_return = (VkDeviceAddress)0;
+    vkGetBufferDeviceAddress_VkDeviceAddress_return =
+        vkEnc->vkGetBufferDeviceAddress(device, pInfo, true /* do lock */);
+    return vkGetBufferDeviceAddress_VkDeviceAddress_return;
+}
+static VkDeviceAddress dynCheck_entry_vkGetBufferDeviceAddress(
+    VkDevice device, const VkBufferDeviceAddressInfo* pInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_VERSION_1_2")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetBufferDeviceAddress", "VK_VERSION_1_2");
+    }
+    AEMU_SCOPED_TRACE("vkGetBufferDeviceAddress");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkDeviceAddress vkGetBufferDeviceAddress_VkDeviceAddress_return = (VkDeviceAddress)0;
+    vkGetBufferDeviceAddress_VkDeviceAddress_return =
+        vkEnc->vkGetBufferDeviceAddress(device, pInfo, true /* do lock */);
+    return vkGetBufferDeviceAddress_VkDeviceAddress_return;
+}
+static uint64_t entry_vkGetBufferOpaqueCaptureAddress(VkDevice device,
+                                                      const VkBufferDeviceAddressInfo* pInfo) {
+    AEMU_SCOPED_TRACE("vkGetBufferOpaqueCaptureAddress");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    uint64_t vkGetBufferOpaqueCaptureAddress_uint64_t_return = (uint64_t)0;
+    vkGetBufferOpaqueCaptureAddress_uint64_t_return =
+        vkEnc->vkGetBufferOpaqueCaptureAddress(device, pInfo, true /* do lock */);
+    return vkGetBufferOpaqueCaptureAddress_uint64_t_return;
+}
+static uint64_t dynCheck_entry_vkGetBufferOpaqueCaptureAddress(
+    VkDevice device, const VkBufferDeviceAddressInfo* pInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_VERSION_1_2")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetBufferOpaqueCaptureAddress", "VK_VERSION_1_2");
+    }
+    AEMU_SCOPED_TRACE("vkGetBufferOpaqueCaptureAddress");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    uint64_t vkGetBufferOpaqueCaptureAddress_uint64_t_return = (uint64_t)0;
+    vkGetBufferOpaqueCaptureAddress_uint64_t_return =
+        vkEnc->vkGetBufferOpaqueCaptureAddress(device, pInfo, true /* do lock */);
+    return vkGetBufferOpaqueCaptureAddress_uint64_t_return;
+}
+static uint64_t entry_vkGetDeviceMemoryOpaqueCaptureAddress(
+    VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo) {
+    AEMU_SCOPED_TRACE("vkGetDeviceMemoryOpaqueCaptureAddress");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    uint64_t vkGetDeviceMemoryOpaqueCaptureAddress_uint64_t_return = (uint64_t)0;
+    vkGetDeviceMemoryOpaqueCaptureAddress_uint64_t_return =
+        vkEnc->vkGetDeviceMemoryOpaqueCaptureAddress(device, pInfo, true /* do lock */);
+    return vkGetDeviceMemoryOpaqueCaptureAddress_uint64_t_return;
+}
+static uint64_t dynCheck_entry_vkGetDeviceMemoryOpaqueCaptureAddress(
+    VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_VERSION_1_2")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetDeviceMemoryOpaqueCaptureAddress", "VK_VERSION_1_2");
+    }
+    AEMU_SCOPED_TRACE("vkGetDeviceMemoryOpaqueCaptureAddress");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    uint64_t vkGetDeviceMemoryOpaqueCaptureAddress_uint64_t_return = (uint64_t)0;
+    vkGetDeviceMemoryOpaqueCaptureAddress_uint64_t_return =
+        vkEnc->vkGetDeviceMemoryOpaqueCaptureAddress(device, pInfo, true /* do lock */);
+    return vkGetDeviceMemoryOpaqueCaptureAddress_uint64_t_return;
+}
+#endif
+#ifdef VK_KHR_surface
+static void entry_vkDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface,
+                                      const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroySurfaceKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroySurfaceKHR(instance, surface, pAllocator, true /* do lock */);
+}
+static VkResult entry_vkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice,
+                                                           uint32_t queueFamilyIndex,
+                                                           VkSurfaceKHR surface,
+                                                           VkBool32* pSupported) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceSupportKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return = (VkResult)0;
+    vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return =
+        vkEnc->vkGetPhysicalDeviceSurfaceSupportKHR(physicalDevice, queueFamilyIndex, surface,
+                                                    pSupported, true /* do lock */);
+    return vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return;
+}
+static VkResult entry_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
+    VkPhysicalDevice physicalDevice, VkSurfaceKHR surface,
+    VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceCapabilitiesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return = (VkResult)0;
+    vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return =
+        vkEnc->vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice, surface,
+                                                         pSurfaceCapabilities, true /* do lock */);
+    return vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return;
+}
+static VkResult entry_vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice,
+                                                           VkSurfaceKHR surface,
+                                                           uint32_t* pSurfaceFormatCount,
+                                                           VkSurfaceFormatKHR* pSurfaceFormats) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceFormatsKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return = (VkResult)0;
+    vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return =
+        vkEnc->vkGetPhysicalDeviceSurfaceFormatsKHR(physicalDevice, surface, pSurfaceFormatCount,
+                                                    pSurfaceFormats, true /* do lock */);
+    return vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return;
+}
+static VkResult entry_vkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice,
+                                                                VkSurfaceKHR surface,
+                                                                uint32_t* pPresentModeCount,
+                                                                VkPresentModeKHR* pPresentModes) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfacePresentModesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return = (VkResult)0;
+    vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return =
+        vkEnc->vkGetPhysicalDeviceSurfacePresentModesKHR(physicalDevice, surface, pPresentModeCount,
+                                                         pPresentModes, true /* do lock */);
+    return vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return;
+}
+#endif
+#ifdef VK_KHR_swapchain
+static VkResult entry_vkCreateSwapchainKHR(VkDevice device,
+                                           const VkSwapchainCreateInfoKHR* pCreateInfo,
+                                           const VkAllocationCallbacks* pAllocator,
+                                           VkSwapchainKHR* pSwapchain) {
+    AEMU_SCOPED_TRACE("vkCreateSwapchainKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateSwapchainKHR_VkResult_return = (VkResult)0;
+    vkCreateSwapchainKHR_VkResult_return = vkEnc->vkCreateSwapchainKHR(
+        device, pCreateInfo, pAllocator, pSwapchain, true /* do lock */);
+    return vkCreateSwapchainKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCreateSwapchainKHR(VkDevice device,
+                                                    const VkSwapchainCreateInfoKHR* pCreateInfo,
+                                                    const VkAllocationCallbacks* pAllocator,
+                                                    VkSwapchainKHR* pSwapchain) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_swapchain")) {
+        sOnInvalidDynamicallyCheckedCall("vkCreateSwapchainKHR", "VK_KHR_swapchain");
+    }
+    AEMU_SCOPED_TRACE("vkCreateSwapchainKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateSwapchainKHR_VkResult_return = (VkResult)0;
+    vkCreateSwapchainKHR_VkResult_return = vkEnc->vkCreateSwapchainKHR(
+        device, pCreateInfo, pAllocator, pSwapchain, true /* do lock */);
+    return vkCreateSwapchainKHR_VkResult_return;
+}
+static void entry_vkDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain,
+                                        const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroySwapchainKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroySwapchainKHR(device, swapchain, pAllocator, true /* do lock */);
+}
+static void dynCheck_entry_vkDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain,
+                                                 const VkAllocationCallbacks* pAllocator) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_swapchain")) {
+        sOnInvalidDynamicallyCheckedCall("vkDestroySwapchainKHR", "VK_KHR_swapchain");
+    }
+    AEMU_SCOPED_TRACE("vkDestroySwapchainKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroySwapchainKHR(device, swapchain, pAllocator, true /* do lock */);
+}
+static VkResult entry_vkGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain,
+                                              uint32_t* pSwapchainImageCount,
+                                              VkImage* pSwapchainImages) {
+    AEMU_SCOPED_TRACE("vkGetSwapchainImagesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetSwapchainImagesKHR_VkResult_return = (VkResult)0;
+    vkGetSwapchainImagesKHR_VkResult_return = vkEnc->vkGetSwapchainImagesKHR(
+        device, swapchain, pSwapchainImageCount, pSwapchainImages, true /* do lock */);
+    return vkGetSwapchainImagesKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain,
+                                                       uint32_t* pSwapchainImageCount,
+                                                       VkImage* pSwapchainImages) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_swapchain")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetSwapchainImagesKHR", "VK_KHR_swapchain");
+    }
+    AEMU_SCOPED_TRACE("vkGetSwapchainImagesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetSwapchainImagesKHR_VkResult_return = (VkResult)0;
+    vkGetSwapchainImagesKHR_VkResult_return = vkEnc->vkGetSwapchainImagesKHR(
+        device, swapchain, pSwapchainImageCount, pSwapchainImages, true /* do lock */);
+    return vkGetSwapchainImagesKHR_VkResult_return;
+}
+static VkResult entry_vkAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain,
+                                            uint64_t timeout, VkSemaphore semaphore, VkFence fence,
+                                            uint32_t* pImageIndex) {
+    AEMU_SCOPED_TRACE("vkAcquireNextImageKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkAcquireNextImageKHR_VkResult_return = (VkResult)0;
+    vkAcquireNextImageKHR_VkResult_return = vkEnc->vkAcquireNextImageKHR(
+        device, swapchain, timeout, semaphore, fence, pImageIndex, true /* do lock */);
+    return vkAcquireNextImageKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain,
+                                                     uint64_t timeout, VkSemaphore semaphore,
+                                                     VkFence fence, uint32_t* pImageIndex) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_swapchain")) {
+        sOnInvalidDynamicallyCheckedCall("vkAcquireNextImageKHR", "VK_KHR_swapchain");
+    }
+    AEMU_SCOPED_TRACE("vkAcquireNextImageKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkAcquireNextImageKHR_VkResult_return = (VkResult)0;
+    vkAcquireNextImageKHR_VkResult_return = vkEnc->vkAcquireNextImageKHR(
+        device, swapchain, timeout, semaphore, fence, pImageIndex, true /* do lock */);
+    return vkAcquireNextImageKHR_VkResult_return;
+}
+static VkResult entry_vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR* pPresentInfo) {
+    AEMU_SCOPED_TRACE("vkQueuePresentKHR");
+    auto vkEnc = ResourceTracker::getQueueEncoder(queue);
+    VkResult vkQueuePresentKHR_VkResult_return = (VkResult)0;
+    vkQueuePresentKHR_VkResult_return =
+        vkEnc->vkQueuePresentKHR(queue, pPresentInfo, true /* do lock */);
+    return vkQueuePresentKHR_VkResult_return;
+}
+static VkResult entry_vkGetDeviceGroupPresentCapabilitiesKHR(
+    VkDevice device, VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities) {
+    AEMU_SCOPED_TRACE("vkGetDeviceGroupPresentCapabilitiesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return = (VkResult)0;
+    vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return =
+        vkEnc->vkGetDeviceGroupPresentCapabilitiesKHR(device, pDeviceGroupPresentCapabilities,
+                                                      true /* do lock */);
+    return vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetDeviceGroupPresentCapabilitiesKHR(
+    VkDevice device, VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_swapchain")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetDeviceGroupPresentCapabilitiesKHR",
+                                         "VK_KHR_swapchain");
+    }
+    AEMU_SCOPED_TRACE("vkGetDeviceGroupPresentCapabilitiesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return = (VkResult)0;
+    vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return =
+        vkEnc->vkGetDeviceGroupPresentCapabilitiesKHR(device, pDeviceGroupPresentCapabilities,
+                                                      true /* do lock */);
+    return vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return;
+}
+static VkResult entry_vkGetDeviceGroupSurfacePresentModesKHR(
+    VkDevice device, VkSurfaceKHR surface, VkDeviceGroupPresentModeFlagsKHR* pModes) {
+    AEMU_SCOPED_TRACE("vkGetDeviceGroupSurfacePresentModesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return = (VkResult)0;
+    vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return =
+        vkEnc->vkGetDeviceGroupSurfacePresentModesKHR(device, surface, pModes, true /* do lock */);
+    return vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetDeviceGroupSurfacePresentModesKHR(
+    VkDevice device, VkSurfaceKHR surface, VkDeviceGroupPresentModeFlagsKHR* pModes) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_swapchain")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetDeviceGroupSurfacePresentModesKHR",
+                                         "VK_KHR_swapchain");
+    }
+    AEMU_SCOPED_TRACE("vkGetDeviceGroupSurfacePresentModesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return = (VkResult)0;
+    vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return =
+        vkEnc->vkGetDeviceGroupSurfacePresentModesKHR(device, surface, pModes, true /* do lock */);
+    return vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return;
+}
+static VkResult entry_vkGetPhysicalDevicePresentRectanglesKHR(VkPhysicalDevice physicalDevice,
+                                                              VkSurfaceKHR surface,
+                                                              uint32_t* pRectCount,
+                                                              VkRect2D* pRects) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDevicePresentRectanglesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return = (VkResult)0;
+    vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return =
+        vkEnc->vkGetPhysicalDevicePresentRectanglesKHR(physicalDevice, surface, pRectCount, pRects,
+                                                       true /* do lock */);
+    return vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return;
+}
+static VkResult entry_vkAcquireNextImage2KHR(VkDevice device,
+                                             const VkAcquireNextImageInfoKHR* pAcquireInfo,
+                                             uint32_t* pImageIndex) {
+    AEMU_SCOPED_TRACE("vkAcquireNextImage2KHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkAcquireNextImage2KHR_VkResult_return = (VkResult)0;
+    vkAcquireNextImage2KHR_VkResult_return =
+        vkEnc->vkAcquireNextImage2KHR(device, pAcquireInfo, pImageIndex, true /* do lock */);
+    return vkAcquireNextImage2KHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkAcquireNextImage2KHR(VkDevice device,
+                                                      const VkAcquireNextImageInfoKHR* pAcquireInfo,
+                                                      uint32_t* pImageIndex) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_swapchain")) {
+        sOnInvalidDynamicallyCheckedCall("vkAcquireNextImage2KHR", "VK_KHR_swapchain");
+    }
+    AEMU_SCOPED_TRACE("vkAcquireNextImage2KHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkAcquireNextImage2KHR_VkResult_return = (VkResult)0;
+    vkAcquireNextImage2KHR_VkResult_return =
+        vkEnc->vkAcquireNextImage2KHR(device, pAcquireInfo, pImageIndex, true /* do lock */);
+    return vkAcquireNextImage2KHR_VkResult_return;
+}
+#endif
+#ifdef VK_KHR_display
+static VkResult entry_vkGetPhysicalDeviceDisplayPropertiesKHR(VkPhysicalDevice physicalDevice,
+                                                              uint32_t* pPropertyCount,
+                                                              VkDisplayPropertiesKHR* pProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceDisplayPropertiesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return = (VkResult)0;
+    vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return =
+        vkEnc->vkGetPhysicalDeviceDisplayPropertiesKHR(physicalDevice, pPropertyCount, pProperties,
+                                                       true /* do lock */);
+    return vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return;
+}
+static VkResult entry_vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
+    VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount,
+    VkDisplayPlanePropertiesKHR* pProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceDisplayPlanePropertiesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return = (VkResult)0;
+    vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return =
+        vkEnc->vkGetPhysicalDeviceDisplayPlanePropertiesKHR(physicalDevice, pPropertyCount,
+                                                            pProperties, true /* do lock */);
+    return vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return;
+}
+static VkResult entry_vkGetDisplayPlaneSupportedDisplaysKHR(VkPhysicalDevice physicalDevice,
+                                                            uint32_t planeIndex,
+                                                            uint32_t* pDisplayCount,
+                                                            VkDisplayKHR* pDisplays) {
+    AEMU_SCOPED_TRACE("vkGetDisplayPlaneSupportedDisplaysKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return = (VkResult)0;
+    vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return =
+        vkEnc->vkGetDisplayPlaneSupportedDisplaysKHR(physicalDevice, planeIndex, pDisplayCount,
+                                                     pDisplays, true /* do lock */);
+    return vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return;
+}
+static VkResult entry_vkGetDisplayModePropertiesKHR(VkPhysicalDevice physicalDevice,
+                                                    VkDisplayKHR display, uint32_t* pPropertyCount,
+                                                    VkDisplayModePropertiesKHR* pProperties) {
+    AEMU_SCOPED_TRACE("vkGetDisplayModePropertiesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetDisplayModePropertiesKHR_VkResult_return = (VkResult)0;
+    vkGetDisplayModePropertiesKHR_VkResult_return = vkEnc->vkGetDisplayModePropertiesKHR(
+        physicalDevice, display, pPropertyCount, pProperties, true /* do lock */);
+    return vkGetDisplayModePropertiesKHR_VkResult_return;
+}
+static VkResult entry_vkCreateDisplayModeKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display,
+                                             const VkDisplayModeCreateInfoKHR* pCreateInfo,
+                                             const VkAllocationCallbacks* pAllocator,
+                                             VkDisplayModeKHR* pMode) {
+    AEMU_SCOPED_TRACE("vkCreateDisplayModeKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateDisplayModeKHR_VkResult_return = (VkResult)0;
+    vkCreateDisplayModeKHR_VkResult_return = vkEnc->vkCreateDisplayModeKHR(
+        physicalDevice, display, pCreateInfo, pAllocator, pMode, true /* do lock */);
+    return vkCreateDisplayModeKHR_VkResult_return;
+}
+static VkResult entry_vkGetDisplayPlaneCapabilitiesKHR(
+    VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, uint32_t planeIndex,
+    VkDisplayPlaneCapabilitiesKHR* pCapabilities) {
+    AEMU_SCOPED_TRACE("vkGetDisplayPlaneCapabilitiesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetDisplayPlaneCapabilitiesKHR_VkResult_return = (VkResult)0;
+    vkGetDisplayPlaneCapabilitiesKHR_VkResult_return = vkEnc->vkGetDisplayPlaneCapabilitiesKHR(
+        physicalDevice, mode, planeIndex, pCapabilities, true /* do lock */);
+    return vkGetDisplayPlaneCapabilitiesKHR_VkResult_return;
+}
+static VkResult entry_vkCreateDisplayPlaneSurfaceKHR(
+    VkInstance instance, const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) {
+    AEMU_SCOPED_TRACE("vkCreateDisplayPlaneSurfaceKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateDisplayPlaneSurfaceKHR_VkResult_return = (VkResult)0;
+    vkCreateDisplayPlaneSurfaceKHR_VkResult_return = vkEnc->vkCreateDisplayPlaneSurfaceKHR(
+        instance, pCreateInfo, pAllocator, pSurface, true /* do lock */);
+    return vkCreateDisplayPlaneSurfaceKHR_VkResult_return;
+}
+#endif
+#ifdef VK_KHR_display_swapchain
+static VkResult entry_vkCreateSharedSwapchainsKHR(VkDevice device, uint32_t swapchainCount,
+                                                  const VkSwapchainCreateInfoKHR* pCreateInfos,
+                                                  const VkAllocationCallbacks* pAllocator,
+                                                  VkSwapchainKHR* pSwapchains) {
+    AEMU_SCOPED_TRACE("vkCreateSharedSwapchainsKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateSharedSwapchainsKHR_VkResult_return = (VkResult)0;
+    vkCreateSharedSwapchainsKHR_VkResult_return = vkEnc->vkCreateSharedSwapchainsKHR(
+        device, swapchainCount, pCreateInfos, pAllocator, pSwapchains, true /* do lock */);
+    return vkCreateSharedSwapchainsKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCreateSharedSwapchainsKHR(
+    VkDevice device, uint32_t swapchainCount, const VkSwapchainCreateInfoKHR* pCreateInfos,
+    const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchains) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_display_swapchain")) {
+        sOnInvalidDynamicallyCheckedCall("vkCreateSharedSwapchainsKHR", "VK_KHR_display_swapchain");
+    }
+    AEMU_SCOPED_TRACE("vkCreateSharedSwapchainsKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateSharedSwapchainsKHR_VkResult_return = (VkResult)0;
+    vkCreateSharedSwapchainsKHR_VkResult_return = vkEnc->vkCreateSharedSwapchainsKHR(
+        device, swapchainCount, pCreateInfos, pAllocator, pSwapchains, true /* do lock */);
+    return vkCreateSharedSwapchainsKHR_VkResult_return;
+}
+#endif
+#ifdef VK_KHR_xlib_surface
+static VkResult entry_vkCreateXlibSurfaceKHR(VkInstance instance,
+                                             const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
+                                             const VkAllocationCallbacks* pAllocator,
+                                             VkSurfaceKHR* pSurface) {
+    AEMU_SCOPED_TRACE("vkCreateXlibSurfaceKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateXlibSurfaceKHR_VkResult_return = (VkResult)0;
+    vkCreateXlibSurfaceKHR_VkResult_return = vkEnc->vkCreateXlibSurfaceKHR(
+        instance, pCreateInfo, pAllocator, pSurface, true /* do lock */);
+    return vkCreateXlibSurfaceKHR_VkResult_return;
+}
+static VkBool32 entry_vkGetPhysicalDeviceXlibPresentationSupportKHR(VkPhysicalDevice physicalDevice,
+                                                                    uint32_t queueFamilyIndex,
+                                                                    Display* dpy,
+                                                                    VisualID visualID) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceXlibPresentationSupportKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return = (VkBool32)0;
+    vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return =
+        vkEnc->vkGetPhysicalDeviceXlibPresentationSupportKHR(physicalDevice, queueFamilyIndex, dpy,
+                                                             visualID, true /* do lock */);
+    return vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return;
+}
+#endif
+#ifdef VK_KHR_xcb_surface
+static VkResult entry_vkCreateXcbSurfaceKHR(VkInstance instance,
+                                            const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
+                                            const VkAllocationCallbacks* pAllocator,
+                                            VkSurfaceKHR* pSurface) {
+    AEMU_SCOPED_TRACE("vkCreateXcbSurfaceKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateXcbSurfaceKHR_VkResult_return = (VkResult)0;
+    vkCreateXcbSurfaceKHR_VkResult_return = vkEnc->vkCreateXcbSurfaceKHR(
+        instance, pCreateInfo, pAllocator, pSurface, true /* do lock */);
+    return vkCreateXcbSurfaceKHR_VkResult_return;
+}
+static VkBool32 entry_vkGetPhysicalDeviceXcbPresentationSupportKHR(VkPhysicalDevice physicalDevice,
+                                                                   uint32_t queueFamilyIndex,
+                                                                   xcb_connection_t* connection,
+                                                                   xcb_visualid_t visual_id) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceXcbPresentationSupportKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return = (VkBool32)0;
+    vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return =
+        vkEnc->vkGetPhysicalDeviceXcbPresentationSupportKHR(
+            physicalDevice, queueFamilyIndex, connection, visual_id, true /* do lock */);
+    return vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return;
+}
+#endif
+#ifdef VK_KHR_wayland_surface
+static VkResult entry_vkCreateWaylandSurfaceKHR(VkInstance instance,
+                                                const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
+                                                const VkAllocationCallbacks* pAllocator,
+                                                VkSurfaceKHR* pSurface) {
+    AEMU_SCOPED_TRACE("vkCreateWaylandSurfaceKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateWaylandSurfaceKHR_VkResult_return = (VkResult)0;
+    vkCreateWaylandSurfaceKHR_VkResult_return = vkEnc->vkCreateWaylandSurfaceKHR(
+        instance, pCreateInfo, pAllocator, pSurface, true /* do lock */);
+    return vkCreateWaylandSurfaceKHR_VkResult_return;
+}
+static VkBool32 entry_vkGetPhysicalDeviceWaylandPresentationSupportKHR(
+    VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, wl_display* display) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceWaylandPresentationSupportKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return = (VkBool32)0;
+    vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return =
+        vkEnc->vkGetPhysicalDeviceWaylandPresentationSupportKHR(physicalDevice, queueFamilyIndex,
+                                                                display, true /* do lock */);
+    return vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return;
+}
+#endif
+#ifdef VK_KHR_android_surface
+static VkResult entry_vkCreateAndroidSurfaceKHR(VkInstance instance,
+                                                const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
+                                                const VkAllocationCallbacks* pAllocator,
+                                                VkSurfaceKHR* pSurface) {
+    AEMU_SCOPED_TRACE("vkCreateAndroidSurfaceKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateAndroidSurfaceKHR_VkResult_return = (VkResult)0;
+    vkCreateAndroidSurfaceKHR_VkResult_return = vkEnc->vkCreateAndroidSurfaceKHR(
+        instance, pCreateInfo, pAllocator, pSurface, true /* do lock */);
+    return vkCreateAndroidSurfaceKHR_VkResult_return;
+}
+#endif
+#ifdef VK_KHR_win32_surface
+static VkResult entry_vkCreateWin32SurfaceKHR(VkInstance instance,
+                                              const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
+                                              const VkAllocationCallbacks* pAllocator,
+                                              VkSurfaceKHR* pSurface) {
+    AEMU_SCOPED_TRACE("vkCreateWin32SurfaceKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateWin32SurfaceKHR_VkResult_return = (VkResult)0;
+    vkCreateWin32SurfaceKHR_VkResult_return = vkEnc->vkCreateWin32SurfaceKHR(
+        instance, pCreateInfo, pAllocator, pSurface, true /* do lock */);
+    return vkCreateWin32SurfaceKHR_VkResult_return;
+}
+static VkBool32 entry_vkGetPhysicalDeviceWin32PresentationSupportKHR(
+    VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceWin32PresentationSupportKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkBool32 vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return = (VkBool32)0;
+    vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return =
+        vkEnc->vkGetPhysicalDeviceWin32PresentationSupportKHR(physicalDevice, queueFamilyIndex,
+                                                              true /* do lock */);
+    return vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return;
+}
+#endif
+#ifdef VK_KHR_sampler_mirror_clamp_to_edge
+#endif
+#ifdef VK_KHR_video_queue
+static VkResult entry_vkGetPhysicalDeviceVideoCapabilitiesKHR(
+    VkPhysicalDevice physicalDevice, const VkVideoProfileKHR* pVideoProfile,
+    VkVideoCapabilitiesKHR* pCapabilities) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceVideoCapabilitiesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPhysicalDeviceVideoCapabilitiesKHR_VkResult_return = (VkResult)0;
+    vkGetPhysicalDeviceVideoCapabilitiesKHR_VkResult_return =
+        vkEnc->vkGetPhysicalDeviceVideoCapabilitiesKHR(physicalDevice, pVideoProfile, pCapabilities,
+                                                       true /* do lock */);
+    return vkGetPhysicalDeviceVideoCapabilitiesKHR_VkResult_return;
+}
+static VkResult entry_vkGetPhysicalDeviceVideoFormatPropertiesKHR(
+    VkPhysicalDevice physicalDevice, const VkPhysicalDeviceVideoFormatInfoKHR* pVideoFormatInfo,
+    uint32_t* pVideoFormatPropertyCount, VkVideoFormatPropertiesKHR* pVideoFormatProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceVideoFormatPropertiesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPhysicalDeviceVideoFormatPropertiesKHR_VkResult_return = (VkResult)0;
+    vkGetPhysicalDeviceVideoFormatPropertiesKHR_VkResult_return =
+        vkEnc->vkGetPhysicalDeviceVideoFormatPropertiesKHR(
+            physicalDevice, pVideoFormatInfo, pVideoFormatPropertyCount, pVideoFormatProperties,
+            true /* do lock */);
+    return vkGetPhysicalDeviceVideoFormatPropertiesKHR_VkResult_return;
+}
+static VkResult entry_vkCreateVideoSessionKHR(VkDevice device,
+                                              const VkVideoSessionCreateInfoKHR* pCreateInfo,
+                                              const VkAllocationCallbacks* pAllocator,
+                                              VkVideoSessionKHR* pVideoSession) {
+    AEMU_SCOPED_TRACE("vkCreateVideoSessionKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateVideoSessionKHR_VkResult_return = (VkResult)0;
+    vkCreateVideoSessionKHR_VkResult_return = vkEnc->vkCreateVideoSessionKHR(
+        device, pCreateInfo, pAllocator, pVideoSession, true /* do lock */);
+    return vkCreateVideoSessionKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCreateVideoSessionKHR(
+    VkDevice device, const VkVideoSessionCreateInfoKHR* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkVideoSessionKHR* pVideoSession) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_video_queue")) {
+        sOnInvalidDynamicallyCheckedCall("vkCreateVideoSessionKHR", "VK_KHR_video_queue");
+    }
+    AEMU_SCOPED_TRACE("vkCreateVideoSessionKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateVideoSessionKHR_VkResult_return = (VkResult)0;
+    vkCreateVideoSessionKHR_VkResult_return = vkEnc->vkCreateVideoSessionKHR(
+        device, pCreateInfo, pAllocator, pVideoSession, true /* do lock */);
+    return vkCreateVideoSessionKHR_VkResult_return;
+}
+static void entry_vkDestroyVideoSessionKHR(VkDevice device, VkVideoSessionKHR videoSession,
+                                           const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyVideoSessionKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyVideoSessionKHR(device, videoSession, pAllocator, true /* do lock */);
+}
+static void dynCheck_entry_vkDestroyVideoSessionKHR(VkDevice device, VkVideoSessionKHR videoSession,
+                                                    const VkAllocationCallbacks* pAllocator) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_video_queue")) {
+        sOnInvalidDynamicallyCheckedCall("vkDestroyVideoSessionKHR", "VK_KHR_video_queue");
+    }
+    AEMU_SCOPED_TRACE("vkDestroyVideoSessionKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyVideoSessionKHR(device, videoSession, pAllocator, true /* do lock */);
+}
+static VkResult entry_vkGetVideoSessionMemoryRequirementsKHR(
+    VkDevice device, VkVideoSessionKHR videoSession, uint32_t* pVideoSessionMemoryRequirementsCount,
+    VkVideoGetMemoryPropertiesKHR* pVideoSessionMemoryRequirements) {
+    AEMU_SCOPED_TRACE("vkGetVideoSessionMemoryRequirementsKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetVideoSessionMemoryRequirementsKHR_VkResult_return = (VkResult)0;
+    vkGetVideoSessionMemoryRequirementsKHR_VkResult_return =
+        vkEnc->vkGetVideoSessionMemoryRequirementsKHR(
+            device, videoSession, pVideoSessionMemoryRequirementsCount,
+            pVideoSessionMemoryRequirements, true /* do lock */);
+    return vkGetVideoSessionMemoryRequirementsKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetVideoSessionMemoryRequirementsKHR(
+    VkDevice device, VkVideoSessionKHR videoSession, uint32_t* pVideoSessionMemoryRequirementsCount,
+    VkVideoGetMemoryPropertiesKHR* pVideoSessionMemoryRequirements) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_video_queue")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetVideoSessionMemoryRequirementsKHR",
+                                         "VK_KHR_video_queue");
+    }
+    AEMU_SCOPED_TRACE("vkGetVideoSessionMemoryRequirementsKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetVideoSessionMemoryRequirementsKHR_VkResult_return = (VkResult)0;
+    vkGetVideoSessionMemoryRequirementsKHR_VkResult_return =
+        vkEnc->vkGetVideoSessionMemoryRequirementsKHR(
+            device, videoSession, pVideoSessionMemoryRequirementsCount,
+            pVideoSessionMemoryRequirements, true /* do lock */);
+    return vkGetVideoSessionMemoryRequirementsKHR_VkResult_return;
+}
+static VkResult entry_vkBindVideoSessionMemoryKHR(
+    VkDevice device, VkVideoSessionKHR videoSession, uint32_t videoSessionBindMemoryCount,
+    const VkVideoBindMemoryKHR* pVideoSessionBindMemories) {
+    AEMU_SCOPED_TRACE("vkBindVideoSessionMemoryKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkBindVideoSessionMemoryKHR_VkResult_return = (VkResult)0;
+    vkBindVideoSessionMemoryKHR_VkResult_return =
+        vkEnc->vkBindVideoSessionMemoryKHR(device, videoSession, videoSessionBindMemoryCount,
+                                           pVideoSessionBindMemories, true /* do lock */);
+    return vkBindVideoSessionMemoryKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkBindVideoSessionMemoryKHR(
+    VkDevice device, VkVideoSessionKHR videoSession, uint32_t videoSessionBindMemoryCount,
+    const VkVideoBindMemoryKHR* pVideoSessionBindMemories) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_video_queue")) {
+        sOnInvalidDynamicallyCheckedCall("vkBindVideoSessionMemoryKHR", "VK_KHR_video_queue");
+    }
+    AEMU_SCOPED_TRACE("vkBindVideoSessionMemoryKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkBindVideoSessionMemoryKHR_VkResult_return = (VkResult)0;
+    vkBindVideoSessionMemoryKHR_VkResult_return =
+        vkEnc->vkBindVideoSessionMemoryKHR(device, videoSession, videoSessionBindMemoryCount,
+                                           pVideoSessionBindMemories, true /* do lock */);
+    return vkBindVideoSessionMemoryKHR_VkResult_return;
+}
+static VkResult entry_vkCreateVideoSessionParametersKHR(
+    VkDevice device, const VkVideoSessionParametersCreateInfoKHR* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkVideoSessionParametersKHR* pVideoSessionParameters) {
+    AEMU_SCOPED_TRACE("vkCreateVideoSessionParametersKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateVideoSessionParametersKHR_VkResult_return = (VkResult)0;
+    vkCreateVideoSessionParametersKHR_VkResult_return = vkEnc->vkCreateVideoSessionParametersKHR(
+        device, pCreateInfo, pAllocator, pVideoSessionParameters, true /* do lock */);
+    return vkCreateVideoSessionParametersKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCreateVideoSessionParametersKHR(
+    VkDevice device, const VkVideoSessionParametersCreateInfoKHR* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkVideoSessionParametersKHR* pVideoSessionParameters) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_video_queue")) {
+        sOnInvalidDynamicallyCheckedCall("vkCreateVideoSessionParametersKHR", "VK_KHR_video_queue");
+    }
+    AEMU_SCOPED_TRACE("vkCreateVideoSessionParametersKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateVideoSessionParametersKHR_VkResult_return = (VkResult)0;
+    vkCreateVideoSessionParametersKHR_VkResult_return = vkEnc->vkCreateVideoSessionParametersKHR(
+        device, pCreateInfo, pAllocator, pVideoSessionParameters, true /* do lock */);
+    return vkCreateVideoSessionParametersKHR_VkResult_return;
+}
+static VkResult entry_vkUpdateVideoSessionParametersKHR(
+    VkDevice device, VkVideoSessionParametersKHR videoSessionParameters,
+    const VkVideoSessionParametersUpdateInfoKHR* pUpdateInfo) {
+    AEMU_SCOPED_TRACE("vkUpdateVideoSessionParametersKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkUpdateVideoSessionParametersKHR_VkResult_return = (VkResult)0;
+    vkUpdateVideoSessionParametersKHR_VkResult_return = vkEnc->vkUpdateVideoSessionParametersKHR(
+        device, videoSessionParameters, pUpdateInfo, true /* do lock */);
+    return vkUpdateVideoSessionParametersKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkUpdateVideoSessionParametersKHR(
+    VkDevice device, VkVideoSessionParametersKHR videoSessionParameters,
+    const VkVideoSessionParametersUpdateInfoKHR* pUpdateInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_video_queue")) {
+        sOnInvalidDynamicallyCheckedCall("vkUpdateVideoSessionParametersKHR", "VK_KHR_video_queue");
+    }
+    AEMU_SCOPED_TRACE("vkUpdateVideoSessionParametersKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkUpdateVideoSessionParametersKHR_VkResult_return = (VkResult)0;
+    vkUpdateVideoSessionParametersKHR_VkResult_return = vkEnc->vkUpdateVideoSessionParametersKHR(
+        device, videoSessionParameters, pUpdateInfo, true /* do lock */);
+    return vkUpdateVideoSessionParametersKHR_VkResult_return;
+}
+static void entry_vkDestroyVideoSessionParametersKHR(
+    VkDevice device, VkVideoSessionParametersKHR videoSessionParameters,
+    const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyVideoSessionParametersKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyVideoSessionParametersKHR(device, videoSessionParameters, pAllocator,
+                                              true /* do lock */);
+}
+static void dynCheck_entry_vkDestroyVideoSessionParametersKHR(
+    VkDevice device, VkVideoSessionParametersKHR videoSessionParameters,
+    const VkAllocationCallbacks* pAllocator) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_video_queue")) {
+        sOnInvalidDynamicallyCheckedCall("vkDestroyVideoSessionParametersKHR",
+                                         "VK_KHR_video_queue");
+    }
+    AEMU_SCOPED_TRACE("vkDestroyVideoSessionParametersKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyVideoSessionParametersKHR(device, videoSessionParameters, pAllocator,
+                                              true /* do lock */);
+}
+static void entry_vkCmdBeginVideoCodingKHR(VkCommandBuffer commandBuffer,
+                                           const VkVideoBeginCodingInfoKHR* pBeginInfo) {
+    AEMU_SCOPED_TRACE("vkCmdBeginVideoCodingKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBeginVideoCodingKHR(commandBuffer, pBeginInfo, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdBeginVideoCodingKHR(VkCommandBuffer commandBuffer,
+                                                    const VkVideoBeginCodingInfoKHR* pBeginInfo) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_video_queue")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdBeginVideoCodingKHR", "VK_KHR_video_queue");
+    }
+    AEMU_SCOPED_TRACE("vkCmdBeginVideoCodingKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBeginVideoCodingKHR(commandBuffer, pBeginInfo, true /* do lock */);
+}
+static void entry_vkCmdEndVideoCodingKHR(VkCommandBuffer commandBuffer,
+                                         const VkVideoEndCodingInfoKHR* pEndCodingInfo) {
+    AEMU_SCOPED_TRACE("vkCmdEndVideoCodingKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdEndVideoCodingKHR(commandBuffer, pEndCodingInfo, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdEndVideoCodingKHR(VkCommandBuffer commandBuffer,
+                                                  const VkVideoEndCodingInfoKHR* pEndCodingInfo) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_video_queue")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdEndVideoCodingKHR", "VK_KHR_video_queue");
+    }
+    AEMU_SCOPED_TRACE("vkCmdEndVideoCodingKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdEndVideoCodingKHR(commandBuffer, pEndCodingInfo, true /* do lock */);
+}
+static void entry_vkCmdControlVideoCodingKHR(
+    VkCommandBuffer commandBuffer, const VkVideoCodingControlInfoKHR* pCodingControlInfo) {
+    AEMU_SCOPED_TRACE("vkCmdControlVideoCodingKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdControlVideoCodingKHR(commandBuffer, pCodingControlInfo, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdControlVideoCodingKHR(
+    VkCommandBuffer commandBuffer, const VkVideoCodingControlInfoKHR* pCodingControlInfo) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_video_queue")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdControlVideoCodingKHR", "VK_KHR_video_queue");
+    }
+    AEMU_SCOPED_TRACE("vkCmdControlVideoCodingKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdControlVideoCodingKHR(commandBuffer, pCodingControlInfo, true /* do lock */);
+}
+#endif
+#ifdef VK_KHR_video_decode_queue
+static void entry_vkCmdDecodeVideoKHR(VkCommandBuffer commandBuffer,
+                                      const VkVideoDecodeInfoKHR* pFrameInfo) {
+    AEMU_SCOPED_TRACE("vkCmdDecodeVideoKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDecodeVideoKHR(commandBuffer, pFrameInfo, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdDecodeVideoKHR(VkCommandBuffer commandBuffer,
+                                               const VkVideoDecodeInfoKHR* pFrameInfo) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_video_decode_queue")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdDecodeVideoKHR", "VK_KHR_video_decode_queue");
+    }
+    AEMU_SCOPED_TRACE("vkCmdDecodeVideoKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDecodeVideoKHR(commandBuffer, pFrameInfo, true /* do lock */);
+}
+#endif
+#ifdef VK_KHR_dynamic_rendering
+static void entry_vkCmdBeginRenderingKHR(VkCommandBuffer commandBuffer,
+                                         const VkRenderingInfoKHR* pRenderingInfo) {
+    AEMU_SCOPED_TRACE("vkCmdBeginRenderingKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBeginRenderingKHR(commandBuffer, pRenderingInfo, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdBeginRenderingKHR(VkCommandBuffer commandBuffer,
+                                                  const VkRenderingInfoKHR* pRenderingInfo) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_dynamic_rendering")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdBeginRenderingKHR", "VK_KHR_dynamic_rendering");
+    }
+    AEMU_SCOPED_TRACE("vkCmdBeginRenderingKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBeginRenderingKHR(commandBuffer, pRenderingInfo, true /* do lock */);
+}
+static void entry_vkCmdEndRenderingKHR(VkCommandBuffer commandBuffer) {
+    AEMU_SCOPED_TRACE("vkCmdEndRenderingKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdEndRenderingKHR(commandBuffer, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdEndRenderingKHR(VkCommandBuffer commandBuffer) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_dynamic_rendering")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdEndRenderingKHR", "VK_KHR_dynamic_rendering");
+    }
+    AEMU_SCOPED_TRACE("vkCmdEndRenderingKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdEndRenderingKHR(commandBuffer, true /* do lock */);
+}
+#endif
+#ifdef VK_KHR_multiview
+#endif
+#ifdef VK_KHR_get_physical_device_properties2
+static void entry_vkGetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice,
+                                                  VkPhysicalDeviceFeatures2* pFeatures) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFeatures2KHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetPhysicalDeviceFeatures2KHR(physicalDevice, pFeatures, true /* do lock */);
+}
+static void entry_vkGetPhysicalDeviceProperties2KHR(VkPhysicalDevice physicalDevice,
+                                                    VkPhysicalDeviceProperties2* pProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceProperties2KHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetPhysicalDeviceProperties2KHR(physicalDevice, pProperties, true /* do lock */);
+}
+static void entry_vkGetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice,
+                                                          VkFormat format,
+                                                          VkFormatProperties2* pFormatProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFormatProperties2KHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetPhysicalDeviceFormatProperties2KHR(physicalDevice, format, pFormatProperties,
+                                                   true /* do lock */);
+}
+static VkResult entry_vkGetPhysicalDeviceImageFormatProperties2KHR(
+    VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
+    VkImageFormatProperties2* pImageFormatProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceImageFormatProperties2KHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return =
+        resources->on_vkGetPhysicalDeviceImageFormatProperties2KHR(
+            vkEnc, VK_SUCCESS, physicalDevice, pImageFormatInfo, pImageFormatProperties);
+    return vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return;
+}
+static void entry_vkGetPhysicalDeviceQueueFamilyProperties2KHR(
+    VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount,
+    VkQueueFamilyProperties2* pQueueFamilyProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceQueueFamilyProperties2KHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetPhysicalDeviceQueueFamilyProperties2KHR(physicalDevice, pQueueFamilyPropertyCount,
+                                                        pQueueFamilyProperties, true /* do lock */);
+}
+static void entry_vkGetPhysicalDeviceMemoryProperties2KHR(
+    VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2* pMemoryProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMemoryProperties2KHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetPhysicalDeviceMemoryProperties2KHR(physicalDevice, pMemoryProperties,
+                                                   true /* do lock */);
+}
+static void entry_vkGetPhysicalDeviceSparseImageFormatProperties2KHR(
+    VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo,
+    uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSparseImageFormatProperties2KHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetPhysicalDeviceSparseImageFormatProperties2KHR(
+        physicalDevice, pFormatInfo, pPropertyCount, pProperties, true /* do lock */);
+}
+#endif
+#ifdef VK_KHR_device_group
+static void entry_vkGetDeviceGroupPeerMemoryFeaturesKHR(
+    VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex,
+    VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) {
+    AEMU_SCOPED_TRACE("vkGetDeviceGroupPeerMemoryFeaturesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetDeviceGroupPeerMemoryFeaturesKHR(device, heapIndex, localDeviceIndex,
+                                                 remoteDeviceIndex, pPeerMemoryFeatures,
+                                                 true /* do lock */);
+}
+static void dynCheck_entry_vkGetDeviceGroupPeerMemoryFeaturesKHR(
+    VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex,
+    VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_device_group")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetDeviceGroupPeerMemoryFeaturesKHR",
+                                         "VK_KHR_device_group");
+    }
+    AEMU_SCOPED_TRACE("vkGetDeviceGroupPeerMemoryFeaturesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetDeviceGroupPeerMemoryFeaturesKHR(device, heapIndex, localDeviceIndex,
+                                                 remoteDeviceIndex, pPeerMemoryFeatures,
+                                                 true /* do lock */);
+}
+static void entry_vkCmdSetDeviceMaskKHR(VkCommandBuffer commandBuffer, uint32_t deviceMask) {
+    AEMU_SCOPED_TRACE("vkCmdSetDeviceMaskKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetDeviceMaskKHR(commandBuffer, deviceMask, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetDeviceMaskKHR(VkCommandBuffer commandBuffer,
+                                                 uint32_t deviceMask) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_device_group")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetDeviceMaskKHR", "VK_KHR_device_group");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetDeviceMaskKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetDeviceMaskKHR(commandBuffer, deviceMask, true /* do lock */);
+}
+static void entry_vkCmdDispatchBaseKHR(VkCommandBuffer commandBuffer, uint32_t baseGroupX,
+                                       uint32_t baseGroupY, uint32_t baseGroupZ,
+                                       uint32_t groupCountX, uint32_t groupCountY,
+                                       uint32_t groupCountZ) {
+    AEMU_SCOPED_TRACE("vkCmdDispatchBaseKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDispatchBaseKHR(commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX,
+                                groupCountY, groupCountZ, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdDispatchBaseKHR(VkCommandBuffer commandBuffer, uint32_t baseGroupX,
+                                                uint32_t baseGroupY, uint32_t baseGroupZ,
+                                                uint32_t groupCountX, uint32_t groupCountY,
+                                                uint32_t groupCountZ) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_device_group")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdDispatchBaseKHR", "VK_KHR_device_group");
+    }
+    AEMU_SCOPED_TRACE("vkCmdDispatchBaseKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDispatchBaseKHR(commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX,
+                                groupCountY, groupCountZ, true /* do lock */);
+}
+#endif
+#ifdef VK_KHR_shader_draw_parameters
+#endif
+#ifdef VK_KHR_maintenance1
+static void entry_vkTrimCommandPoolKHR(VkDevice device, VkCommandPool commandPool,
+                                       VkCommandPoolTrimFlags flags) {
+    AEMU_SCOPED_TRACE("vkTrimCommandPoolKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkTrimCommandPoolKHR(device, commandPool, flags, true /* do lock */);
+}
+static void dynCheck_entry_vkTrimCommandPoolKHR(VkDevice device, VkCommandPool commandPool,
+                                                VkCommandPoolTrimFlags flags) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_maintenance1")) {
+        sOnInvalidDynamicallyCheckedCall("vkTrimCommandPoolKHR", "VK_KHR_maintenance1");
+    }
+    AEMU_SCOPED_TRACE("vkTrimCommandPoolKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkTrimCommandPoolKHR(device, commandPool, flags, true /* do lock */);
+}
+#endif
+#ifdef VK_KHR_device_group_creation
+static VkResult entry_vkEnumeratePhysicalDeviceGroupsKHR(
+    VkInstance instance, uint32_t* pPhysicalDeviceGroupCount,
+    VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties) {
+    AEMU_SCOPED_TRACE("vkEnumeratePhysicalDeviceGroupsKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return = (VkResult)0;
+    vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return = vkEnc->vkEnumeratePhysicalDeviceGroupsKHR(
+        instance, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties, true /* do lock */);
+    return vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return;
+}
+#endif
+#ifdef VK_KHR_external_memory_capabilities
+static void entry_vkGetPhysicalDeviceExternalBufferPropertiesKHR(
+    VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo,
+    VkExternalBufferProperties* pExternalBufferProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalBufferPropertiesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetPhysicalDeviceExternalBufferPropertiesKHR(
+        physicalDevice, pExternalBufferInfo, pExternalBufferProperties, true /* do lock */);
+}
+#endif
+#ifdef VK_KHR_external_memory
+#endif
+#ifdef VK_KHR_external_memory_win32
+static VkResult entry_vkGetMemoryWin32HandleKHR(
+    VkDevice device, const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle) {
+    AEMU_SCOPED_TRACE("vkGetMemoryWin32HandleKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetMemoryWin32HandleKHR_VkResult_return = (VkResult)0;
+    vkGetMemoryWin32HandleKHR_VkResult_return =
+        vkEnc->vkGetMemoryWin32HandleKHR(device, pGetWin32HandleInfo, pHandle, true /* do lock */);
+    return vkGetMemoryWin32HandleKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetMemoryWin32HandleKHR(
+    VkDevice device, const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_external_memory_win32")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetMemoryWin32HandleKHR",
+                                         "VK_KHR_external_memory_win32");
+    }
+    AEMU_SCOPED_TRACE("vkGetMemoryWin32HandleKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetMemoryWin32HandleKHR_VkResult_return = (VkResult)0;
+    vkGetMemoryWin32HandleKHR_VkResult_return =
+        vkEnc->vkGetMemoryWin32HandleKHR(device, pGetWin32HandleInfo, pHandle, true /* do lock */);
+    return vkGetMemoryWin32HandleKHR_VkResult_return;
+}
+static VkResult entry_vkGetMemoryWin32HandlePropertiesKHR(
+    VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE handle,
+    VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties) {
+    AEMU_SCOPED_TRACE("vkGetMemoryWin32HandlePropertiesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetMemoryWin32HandlePropertiesKHR_VkResult_return = (VkResult)0;
+    vkGetMemoryWin32HandlePropertiesKHR_VkResult_return =
+        vkEnc->vkGetMemoryWin32HandlePropertiesKHR(
+            device, handleType, handle, pMemoryWin32HandleProperties, true /* do lock */);
+    return vkGetMemoryWin32HandlePropertiesKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetMemoryWin32HandlePropertiesKHR(
+    VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE handle,
+    VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_external_memory_win32")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetMemoryWin32HandlePropertiesKHR",
+                                         "VK_KHR_external_memory_win32");
+    }
+    AEMU_SCOPED_TRACE("vkGetMemoryWin32HandlePropertiesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetMemoryWin32HandlePropertiesKHR_VkResult_return = (VkResult)0;
+    vkGetMemoryWin32HandlePropertiesKHR_VkResult_return =
+        vkEnc->vkGetMemoryWin32HandlePropertiesKHR(
+            device, handleType, handle, pMemoryWin32HandleProperties, true /* do lock */);
+    return vkGetMemoryWin32HandlePropertiesKHR_VkResult_return;
+}
+#endif
+#ifdef VK_KHR_external_memory_fd
+static VkResult entry_vkGetMemoryFdKHR(VkDevice device, const VkMemoryGetFdInfoKHR* pGetFdInfo,
+                                       int* pFd) {
+    AEMU_SCOPED_TRACE("vkGetMemoryFdKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetMemoryFdKHR_VkResult_return = (VkResult)0;
+    vkGetMemoryFdKHR_VkResult_return =
+        vkEnc->vkGetMemoryFdKHR(device, pGetFdInfo, pFd, true /* do lock */);
+    return vkGetMemoryFdKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetMemoryFdKHR(VkDevice device,
+                                                const VkMemoryGetFdInfoKHR* pGetFdInfo, int* pFd) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_external_memory_fd")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetMemoryFdKHR", "VK_KHR_external_memory_fd");
+    }
+    AEMU_SCOPED_TRACE("vkGetMemoryFdKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetMemoryFdKHR_VkResult_return = (VkResult)0;
+    vkGetMemoryFdKHR_VkResult_return =
+        vkEnc->vkGetMemoryFdKHR(device, pGetFdInfo, pFd, true /* do lock */);
+    return vkGetMemoryFdKHR_VkResult_return;
+}
+static VkResult entry_vkGetMemoryFdPropertiesKHR(VkDevice device,
+                                                 VkExternalMemoryHandleTypeFlagBits handleType,
+                                                 int fd,
+                                                 VkMemoryFdPropertiesKHR* pMemoryFdProperties) {
+    AEMU_SCOPED_TRACE("vkGetMemoryFdPropertiesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetMemoryFdPropertiesKHR_VkResult_return = (VkResult)0;
+    vkGetMemoryFdPropertiesKHR_VkResult_return = vkEnc->vkGetMemoryFdPropertiesKHR(
+        device, handleType, fd, pMemoryFdProperties, true /* do lock */);
+    return vkGetMemoryFdPropertiesKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetMemoryFdPropertiesKHR(
+    VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, int fd,
+    VkMemoryFdPropertiesKHR* pMemoryFdProperties) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_external_memory_fd")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetMemoryFdPropertiesKHR", "VK_KHR_external_memory_fd");
+    }
+    AEMU_SCOPED_TRACE("vkGetMemoryFdPropertiesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetMemoryFdPropertiesKHR_VkResult_return = (VkResult)0;
+    vkGetMemoryFdPropertiesKHR_VkResult_return = vkEnc->vkGetMemoryFdPropertiesKHR(
+        device, handleType, fd, pMemoryFdProperties, true /* do lock */);
+    return vkGetMemoryFdPropertiesKHR_VkResult_return;
+}
+#endif
+#ifdef VK_KHR_win32_keyed_mutex
+#endif
+#ifdef VK_KHR_external_semaphore_capabilities
+static void entry_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(
+    VkPhysicalDevice physicalDevice,
+    const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo,
+    VkExternalSemaphoreProperties* pExternalSemaphoreProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalSemaphorePropertiesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(
+        physicalDevice, pExternalSemaphoreInfo, pExternalSemaphoreProperties, true /* do lock */);
+}
+#endif
+#ifdef VK_KHR_external_semaphore
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+static VkResult entry_vkImportSemaphoreWin32HandleKHR(
+    VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo) {
+    AEMU_SCOPED_TRACE("vkImportSemaphoreWin32HandleKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkImportSemaphoreWin32HandleKHR_VkResult_return = (VkResult)0;
+    vkImportSemaphoreWin32HandleKHR_VkResult_return = vkEnc->vkImportSemaphoreWin32HandleKHR(
+        device, pImportSemaphoreWin32HandleInfo, true /* do lock */);
+    return vkImportSemaphoreWin32HandleKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkImportSemaphoreWin32HandleKHR(
+    VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_external_semaphore_win32")) {
+        sOnInvalidDynamicallyCheckedCall("vkImportSemaphoreWin32HandleKHR",
+                                         "VK_KHR_external_semaphore_win32");
+    }
+    AEMU_SCOPED_TRACE("vkImportSemaphoreWin32HandleKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkImportSemaphoreWin32HandleKHR_VkResult_return = (VkResult)0;
+    vkImportSemaphoreWin32HandleKHR_VkResult_return = vkEnc->vkImportSemaphoreWin32HandleKHR(
+        device, pImportSemaphoreWin32HandleInfo, true /* do lock */);
+    return vkImportSemaphoreWin32HandleKHR_VkResult_return;
+}
+static VkResult entry_vkGetSemaphoreWin32HandleKHR(
+    VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle) {
+    AEMU_SCOPED_TRACE("vkGetSemaphoreWin32HandleKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetSemaphoreWin32HandleKHR_VkResult_return = (VkResult)0;
+    vkGetSemaphoreWin32HandleKHR_VkResult_return = vkEnc->vkGetSemaphoreWin32HandleKHR(
+        device, pGetWin32HandleInfo, pHandle, true /* do lock */);
+    return vkGetSemaphoreWin32HandleKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetSemaphoreWin32HandleKHR(
+    VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_external_semaphore_win32")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetSemaphoreWin32HandleKHR",
+                                         "VK_KHR_external_semaphore_win32");
+    }
+    AEMU_SCOPED_TRACE("vkGetSemaphoreWin32HandleKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetSemaphoreWin32HandleKHR_VkResult_return = (VkResult)0;
+    vkGetSemaphoreWin32HandleKHR_VkResult_return = vkEnc->vkGetSemaphoreWin32HandleKHR(
+        device, pGetWin32HandleInfo, pHandle, true /* do lock */);
+    return vkGetSemaphoreWin32HandleKHR_VkResult_return;
+}
+#endif
+#ifdef VK_KHR_external_semaphore_fd
+static VkResult entry_vkImportSemaphoreFdKHR(
+    VkDevice device, const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo) {
+    AEMU_SCOPED_TRACE("vkImportSemaphoreFdKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkImportSemaphoreFdKHR_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkImportSemaphoreFdKHR_VkResult_return =
+        resources->on_vkImportSemaphoreFdKHR(vkEnc, VK_SUCCESS, device, pImportSemaphoreFdInfo);
+    return vkImportSemaphoreFdKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkImportSemaphoreFdKHR(
+    VkDevice device, const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_external_semaphore_fd")) {
+        sOnInvalidDynamicallyCheckedCall("vkImportSemaphoreFdKHR", "VK_KHR_external_semaphore_fd");
+    }
+    AEMU_SCOPED_TRACE("vkImportSemaphoreFdKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkImportSemaphoreFdKHR_VkResult_return = (VkResult)0;
+    vkImportSemaphoreFdKHR_VkResult_return =
+        resources->on_vkImportSemaphoreFdKHR(vkEnc, VK_SUCCESS, device, pImportSemaphoreFdInfo);
+    return vkImportSemaphoreFdKHR_VkResult_return;
+}
+static VkResult entry_vkGetSemaphoreFdKHR(VkDevice device,
+                                          const VkSemaphoreGetFdInfoKHR* pGetFdInfo, int* pFd) {
+    AEMU_SCOPED_TRACE("vkGetSemaphoreFdKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetSemaphoreFdKHR_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkGetSemaphoreFdKHR_VkResult_return =
+        resources->on_vkGetSemaphoreFdKHR(vkEnc, VK_SUCCESS, device, pGetFdInfo, pFd);
+    return vkGetSemaphoreFdKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetSemaphoreFdKHR(VkDevice device,
+                                                   const VkSemaphoreGetFdInfoKHR* pGetFdInfo,
+                                                   int* pFd) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_external_semaphore_fd")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetSemaphoreFdKHR", "VK_KHR_external_semaphore_fd");
+    }
+    AEMU_SCOPED_TRACE("vkGetSemaphoreFdKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetSemaphoreFdKHR_VkResult_return = (VkResult)0;
+    vkGetSemaphoreFdKHR_VkResult_return =
+        resources->on_vkGetSemaphoreFdKHR(vkEnc, VK_SUCCESS, device, pGetFdInfo, pFd);
+    return vkGetSemaphoreFdKHR_VkResult_return;
+}
+#endif
+#ifdef VK_KHR_push_descriptor
+static void entry_vkCmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer,
+                                            VkPipelineBindPoint pipelineBindPoint,
+                                            VkPipelineLayout layout, uint32_t set,
+                                            uint32_t descriptorWriteCount,
+                                            const VkWriteDescriptorSet* pDescriptorWrites) {
+    AEMU_SCOPED_TRACE("vkCmdPushDescriptorSetKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdPushDescriptorSetKHR(commandBuffer, pipelineBindPoint, layout, set,
+                                     descriptorWriteCount, pDescriptorWrites, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdPushDescriptorSetKHR(
+    VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout,
+    uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_push_descriptor")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdPushDescriptorSetKHR", "VK_KHR_push_descriptor");
+    }
+    AEMU_SCOPED_TRACE("vkCmdPushDescriptorSetKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdPushDescriptorSetKHR(commandBuffer, pipelineBindPoint, layout, set,
+                                     descriptorWriteCount, pDescriptorWrites, true /* do lock */);
+}
+static void entry_vkCmdPushDescriptorSetWithTemplateKHR(
+    VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplate descriptorUpdateTemplate,
+    VkPipelineLayout layout, uint32_t set, const void* pData) {
+    AEMU_SCOPED_TRACE("vkCmdPushDescriptorSetWithTemplateKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdPushDescriptorSetWithTemplateKHR(commandBuffer, descriptorUpdateTemplate, layout,
+                                                 set, pData, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdPushDescriptorSetWithTemplateKHR(
+    VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplate descriptorUpdateTemplate,
+    VkPipelineLayout layout, uint32_t set, const void* pData) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_push_descriptor")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdPushDescriptorSetWithTemplateKHR",
+                                         "VK_KHR_push_descriptor");
+    }
+    AEMU_SCOPED_TRACE("vkCmdPushDescriptorSetWithTemplateKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdPushDescriptorSetWithTemplateKHR(commandBuffer, descriptorUpdateTemplate, layout,
+                                                 set, pData, true /* do lock */);
+}
+#endif
+#ifdef VK_KHR_shader_float16_int8
+#endif
+#ifdef VK_KHR_16bit_storage
+#endif
+#ifdef VK_KHR_incremental_present
+#endif
+#ifdef VK_KHR_descriptor_update_template
+static VkResult entry_vkCreateDescriptorUpdateTemplateKHR(
+    VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator,
+    VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) {
+    AEMU_SCOPED_TRACE("vkCreateDescriptorUpdateTemplateKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateDescriptorUpdateTemplateKHR_VkResult_return = (VkResult)0;
+    vkCreateDescriptorUpdateTemplateKHR_VkResult_return =
+        vkEnc->vkCreateDescriptorUpdateTemplateKHR(device, pCreateInfo, pAllocator,
+                                                   pDescriptorUpdateTemplate, true /* do lock */);
+    return vkCreateDescriptorUpdateTemplateKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCreateDescriptorUpdateTemplateKHR(
+    VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator,
+    VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_descriptor_update_template")) {
+        sOnInvalidDynamicallyCheckedCall("vkCreateDescriptorUpdateTemplateKHR",
+                                         "VK_KHR_descriptor_update_template");
+    }
+    AEMU_SCOPED_TRACE("vkCreateDescriptorUpdateTemplateKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateDescriptorUpdateTemplateKHR_VkResult_return = (VkResult)0;
+    vkCreateDescriptorUpdateTemplateKHR_VkResult_return =
+        vkEnc->vkCreateDescriptorUpdateTemplateKHR(device, pCreateInfo, pAllocator,
+                                                   pDescriptorUpdateTemplate, true /* do lock */);
+    return vkCreateDescriptorUpdateTemplateKHR_VkResult_return;
+}
+static void entry_vkDestroyDescriptorUpdateTemplateKHR(
+    VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate,
+    const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyDescriptorUpdateTemplateKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyDescriptorUpdateTemplateKHR(device, descriptorUpdateTemplate, pAllocator,
+                                                true /* do lock */);
+}
+static void dynCheck_entry_vkDestroyDescriptorUpdateTemplateKHR(
+    VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate,
+    const VkAllocationCallbacks* pAllocator) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_descriptor_update_template")) {
+        sOnInvalidDynamicallyCheckedCall("vkDestroyDescriptorUpdateTemplateKHR",
+                                         "VK_KHR_descriptor_update_template");
+    }
+    AEMU_SCOPED_TRACE("vkDestroyDescriptorUpdateTemplateKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyDescriptorUpdateTemplateKHR(device, descriptorUpdateTemplate, pAllocator,
+                                                true /* do lock */);
+}
+static void entry_vkUpdateDescriptorSetWithTemplateKHR(
+    VkDevice device, VkDescriptorSet descriptorSet,
+    VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData) {
+    AEMU_SCOPED_TRACE("vkUpdateDescriptorSetWithTemplateKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkUpdateDescriptorSetWithTemplateKHR(device, descriptorSet, descriptorUpdateTemplate,
+                                                pData, true /* do lock */);
+}
+static void dynCheck_entry_vkUpdateDescriptorSetWithTemplateKHR(
+    VkDevice device, VkDescriptorSet descriptorSet,
+    VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_descriptor_update_template")) {
+        sOnInvalidDynamicallyCheckedCall("vkUpdateDescriptorSetWithTemplateKHR",
+                                         "VK_KHR_descriptor_update_template");
+    }
+    AEMU_SCOPED_TRACE("vkUpdateDescriptorSetWithTemplateKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkUpdateDescriptorSetWithTemplateKHR(device, descriptorSet, descriptorUpdateTemplate,
+                                                pData, true /* do lock */);
+}
+#endif
+#ifdef VK_KHR_imageless_framebuffer
+#endif
+#ifdef VK_KHR_create_renderpass2
+static VkResult entry_vkCreateRenderPass2KHR(VkDevice device,
+                                             const VkRenderPassCreateInfo2* pCreateInfo,
+                                             const VkAllocationCallbacks* pAllocator,
+                                             VkRenderPass* pRenderPass) {
+    AEMU_SCOPED_TRACE("vkCreateRenderPass2KHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateRenderPass2KHR_VkResult_return = (VkResult)0;
+    vkCreateRenderPass2KHR_VkResult_return = vkEnc->vkCreateRenderPass2KHR(
+        device, pCreateInfo, pAllocator, pRenderPass, true /* do lock */);
+    return vkCreateRenderPass2KHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCreateRenderPass2KHR(VkDevice device,
+                                                      const VkRenderPassCreateInfo2* pCreateInfo,
+                                                      const VkAllocationCallbacks* pAllocator,
+                                                      VkRenderPass* pRenderPass) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_create_renderpass2")) {
+        sOnInvalidDynamicallyCheckedCall("vkCreateRenderPass2KHR", "VK_KHR_create_renderpass2");
+    }
+    AEMU_SCOPED_TRACE("vkCreateRenderPass2KHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateRenderPass2KHR_VkResult_return = (VkResult)0;
+    vkCreateRenderPass2KHR_VkResult_return = vkEnc->vkCreateRenderPass2KHR(
+        device, pCreateInfo, pAllocator, pRenderPass, true /* do lock */);
+    return vkCreateRenderPass2KHR_VkResult_return;
+}
+static void entry_vkCmdBeginRenderPass2KHR(VkCommandBuffer commandBuffer,
+                                           const VkRenderPassBeginInfo* pRenderPassBegin,
+                                           const VkSubpassBeginInfo* pSubpassBeginInfo) {
+    AEMU_SCOPED_TRACE("vkCmdBeginRenderPass2KHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBeginRenderPass2KHR(commandBuffer, pRenderPassBegin, pSubpassBeginInfo,
+                                    true /* do lock */);
+}
+static void dynCheck_entry_vkCmdBeginRenderPass2KHR(VkCommandBuffer commandBuffer,
+                                                    const VkRenderPassBeginInfo* pRenderPassBegin,
+                                                    const VkSubpassBeginInfo* pSubpassBeginInfo) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_create_renderpass2")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdBeginRenderPass2KHR", "VK_KHR_create_renderpass2");
+    }
+    AEMU_SCOPED_TRACE("vkCmdBeginRenderPass2KHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBeginRenderPass2KHR(commandBuffer, pRenderPassBegin, pSubpassBeginInfo,
+                                    true /* do lock */);
+}
+static void entry_vkCmdNextSubpass2KHR(VkCommandBuffer commandBuffer,
+                                       const VkSubpassBeginInfo* pSubpassBeginInfo,
+                                       const VkSubpassEndInfo* pSubpassEndInfo) {
+    AEMU_SCOPED_TRACE("vkCmdNextSubpass2KHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdNextSubpass2KHR(commandBuffer, pSubpassBeginInfo, pSubpassEndInfo,
+                                true /* do lock */);
+}
+static void dynCheck_entry_vkCmdNextSubpass2KHR(VkCommandBuffer commandBuffer,
+                                                const VkSubpassBeginInfo* pSubpassBeginInfo,
+                                                const VkSubpassEndInfo* pSubpassEndInfo) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_create_renderpass2")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdNextSubpass2KHR", "VK_KHR_create_renderpass2");
+    }
+    AEMU_SCOPED_TRACE("vkCmdNextSubpass2KHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdNextSubpass2KHR(commandBuffer, pSubpassBeginInfo, pSubpassEndInfo,
+                                true /* do lock */);
+}
+static void entry_vkCmdEndRenderPass2KHR(VkCommandBuffer commandBuffer,
+                                         const VkSubpassEndInfo* pSubpassEndInfo) {
+    AEMU_SCOPED_TRACE("vkCmdEndRenderPass2KHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdEndRenderPass2KHR(commandBuffer, pSubpassEndInfo, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdEndRenderPass2KHR(VkCommandBuffer commandBuffer,
+                                                  const VkSubpassEndInfo* pSubpassEndInfo) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_create_renderpass2")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdEndRenderPass2KHR", "VK_KHR_create_renderpass2");
+    }
+    AEMU_SCOPED_TRACE("vkCmdEndRenderPass2KHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdEndRenderPass2KHR(commandBuffer, pSubpassEndInfo, true /* do lock */);
+}
+#endif
+#ifdef VK_KHR_shared_presentable_image
+static VkResult entry_vkGetSwapchainStatusKHR(VkDevice device, VkSwapchainKHR swapchain) {
+    AEMU_SCOPED_TRACE("vkGetSwapchainStatusKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetSwapchainStatusKHR_VkResult_return = (VkResult)0;
+    vkGetSwapchainStatusKHR_VkResult_return =
+        vkEnc->vkGetSwapchainStatusKHR(device, swapchain, true /* do lock */);
+    return vkGetSwapchainStatusKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetSwapchainStatusKHR(VkDevice device, VkSwapchainKHR swapchain) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_shared_presentable_image")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetSwapchainStatusKHR",
+                                         "VK_KHR_shared_presentable_image");
+    }
+    AEMU_SCOPED_TRACE("vkGetSwapchainStatusKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetSwapchainStatusKHR_VkResult_return = (VkResult)0;
+    vkGetSwapchainStatusKHR_VkResult_return =
+        vkEnc->vkGetSwapchainStatusKHR(device, swapchain, true /* do lock */);
+    return vkGetSwapchainStatusKHR_VkResult_return;
+}
+#endif
+#ifdef VK_KHR_external_fence_capabilities
+static void entry_vkGetPhysicalDeviceExternalFencePropertiesKHR(
+    VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo,
+    VkExternalFenceProperties* pExternalFenceProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalFencePropertiesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    auto resources = ResourceTracker::get();
+    resources->on_vkGetPhysicalDeviceExternalFencePropertiesKHR(
+        vkEnc, physicalDevice, pExternalFenceInfo, pExternalFenceProperties);
+}
+#endif
+#ifdef VK_KHR_external_fence
+#endif
+#ifdef VK_KHR_external_fence_win32
+static VkResult entry_vkImportFenceWin32HandleKHR(
+    VkDevice device, const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo) {
+    AEMU_SCOPED_TRACE("vkImportFenceWin32HandleKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkImportFenceWin32HandleKHR_VkResult_return = (VkResult)0;
+    vkImportFenceWin32HandleKHR_VkResult_return =
+        vkEnc->vkImportFenceWin32HandleKHR(device, pImportFenceWin32HandleInfo, true /* do lock */);
+    return vkImportFenceWin32HandleKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkImportFenceWin32HandleKHR(
+    VkDevice device, const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_external_fence_win32")) {
+        sOnInvalidDynamicallyCheckedCall("vkImportFenceWin32HandleKHR",
+                                         "VK_KHR_external_fence_win32");
+    }
+    AEMU_SCOPED_TRACE("vkImportFenceWin32HandleKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkImportFenceWin32HandleKHR_VkResult_return = (VkResult)0;
+    vkImportFenceWin32HandleKHR_VkResult_return =
+        vkEnc->vkImportFenceWin32HandleKHR(device, pImportFenceWin32HandleInfo, true /* do lock */);
+    return vkImportFenceWin32HandleKHR_VkResult_return;
+}
+static VkResult entry_vkGetFenceWin32HandleKHR(
+    VkDevice device, const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle) {
+    AEMU_SCOPED_TRACE("vkGetFenceWin32HandleKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetFenceWin32HandleKHR_VkResult_return = (VkResult)0;
+    vkGetFenceWin32HandleKHR_VkResult_return =
+        vkEnc->vkGetFenceWin32HandleKHR(device, pGetWin32HandleInfo, pHandle, true /* do lock */);
+    return vkGetFenceWin32HandleKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetFenceWin32HandleKHR(
+    VkDevice device, const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_external_fence_win32")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetFenceWin32HandleKHR", "VK_KHR_external_fence_win32");
+    }
+    AEMU_SCOPED_TRACE("vkGetFenceWin32HandleKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetFenceWin32HandleKHR_VkResult_return = (VkResult)0;
+    vkGetFenceWin32HandleKHR_VkResult_return =
+        vkEnc->vkGetFenceWin32HandleKHR(device, pGetWin32HandleInfo, pHandle, true /* do lock */);
+    return vkGetFenceWin32HandleKHR_VkResult_return;
+}
+#endif
+#ifdef VK_KHR_external_fence_fd
+static VkResult entry_vkImportFenceFdKHR(VkDevice device,
+                                         const VkImportFenceFdInfoKHR* pImportFenceFdInfo) {
+    AEMU_SCOPED_TRACE("vkImportFenceFdKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkImportFenceFdKHR_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkImportFenceFdKHR_VkResult_return =
+        resources->on_vkImportFenceFdKHR(vkEnc, VK_SUCCESS, device, pImportFenceFdInfo);
+    return vkImportFenceFdKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkImportFenceFdKHR(
+    VkDevice device, const VkImportFenceFdInfoKHR* pImportFenceFdInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_external_fence_fd")) {
+        sOnInvalidDynamicallyCheckedCall("vkImportFenceFdKHR", "VK_KHR_external_fence_fd");
+    }
+    AEMU_SCOPED_TRACE("vkImportFenceFdKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkImportFenceFdKHR_VkResult_return = (VkResult)0;
+    vkImportFenceFdKHR_VkResult_return =
+        resources->on_vkImportFenceFdKHR(vkEnc, VK_SUCCESS, device, pImportFenceFdInfo);
+    return vkImportFenceFdKHR_VkResult_return;
+}
+static VkResult entry_vkGetFenceFdKHR(VkDevice device, const VkFenceGetFdInfoKHR* pGetFdInfo,
+                                      int* pFd) {
+    AEMU_SCOPED_TRACE("vkGetFenceFdKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetFenceFdKHR_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkGetFenceFdKHR_VkResult_return =
+        resources->on_vkGetFenceFdKHR(vkEnc, VK_SUCCESS, device, pGetFdInfo, pFd);
+    return vkGetFenceFdKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetFenceFdKHR(VkDevice device,
+                                               const VkFenceGetFdInfoKHR* pGetFdInfo, int* pFd) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_external_fence_fd")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetFenceFdKHR", "VK_KHR_external_fence_fd");
+    }
+    AEMU_SCOPED_TRACE("vkGetFenceFdKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetFenceFdKHR_VkResult_return = (VkResult)0;
+    vkGetFenceFdKHR_VkResult_return =
+        resources->on_vkGetFenceFdKHR(vkEnc, VK_SUCCESS, device, pGetFdInfo, pFd);
+    return vkGetFenceFdKHR_VkResult_return;
+}
+#endif
+#ifdef VK_KHR_performance_query
+static VkResult entry_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(
+    VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, uint32_t* pCounterCount,
+    VkPerformanceCounterKHR* pCounters, VkPerformanceCounterDescriptionKHR* pCounterDescriptions) {
+    AEMU_SCOPED_TRACE("vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR_VkResult_return =
+        (VkResult)0;
+    vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR_VkResult_return =
+        vkEnc->vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(
+            physicalDevice, queueFamilyIndex, pCounterCount, pCounters, pCounterDescriptions,
+            true /* do lock */);
+    return vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR_VkResult_return;
+}
+static void entry_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(
+    VkPhysicalDevice physicalDevice,
+    const VkQueryPoolPerformanceCreateInfoKHR* pPerformanceQueryCreateInfo, uint32_t* pNumPasses) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(
+        physicalDevice, pPerformanceQueryCreateInfo, pNumPasses, true /* do lock */);
+}
+static VkResult entry_vkAcquireProfilingLockKHR(VkDevice device,
+                                                const VkAcquireProfilingLockInfoKHR* pInfo) {
+    AEMU_SCOPED_TRACE("vkAcquireProfilingLockKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkAcquireProfilingLockKHR_VkResult_return = (VkResult)0;
+    vkAcquireProfilingLockKHR_VkResult_return =
+        vkEnc->vkAcquireProfilingLockKHR(device, pInfo, true /* do lock */);
+    return vkAcquireProfilingLockKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkAcquireProfilingLockKHR(
+    VkDevice device, const VkAcquireProfilingLockInfoKHR* pInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_performance_query")) {
+        sOnInvalidDynamicallyCheckedCall("vkAcquireProfilingLockKHR", "VK_KHR_performance_query");
+    }
+    AEMU_SCOPED_TRACE("vkAcquireProfilingLockKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkAcquireProfilingLockKHR_VkResult_return = (VkResult)0;
+    vkAcquireProfilingLockKHR_VkResult_return =
+        vkEnc->vkAcquireProfilingLockKHR(device, pInfo, true /* do lock */);
+    return vkAcquireProfilingLockKHR_VkResult_return;
+}
+static void entry_vkReleaseProfilingLockKHR(VkDevice device) {
+    AEMU_SCOPED_TRACE("vkReleaseProfilingLockKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkReleaseProfilingLockKHR(device, true /* do lock */);
+}
+static void dynCheck_entry_vkReleaseProfilingLockKHR(VkDevice device) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_performance_query")) {
+        sOnInvalidDynamicallyCheckedCall("vkReleaseProfilingLockKHR", "VK_KHR_performance_query");
+    }
+    AEMU_SCOPED_TRACE("vkReleaseProfilingLockKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkReleaseProfilingLockKHR(device, true /* do lock */);
+}
+#endif
+#ifdef VK_KHR_maintenance2
+#endif
+#ifdef VK_KHR_get_surface_capabilities2
+static VkResult entry_vkGetPhysicalDeviceSurfaceCapabilities2KHR(
+    VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
+    VkSurfaceCapabilities2KHR* pSurfaceCapabilities) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceCapabilities2KHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return = (VkResult)0;
+    vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return =
+        vkEnc->vkGetPhysicalDeviceSurfaceCapabilities2KHR(physicalDevice, pSurfaceInfo,
+                                                          pSurfaceCapabilities, true /* do lock */);
+    return vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return;
+}
+static VkResult entry_vkGetPhysicalDeviceSurfaceFormats2KHR(
+    VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
+    uint32_t* pSurfaceFormatCount, VkSurfaceFormat2KHR* pSurfaceFormats) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceFormats2KHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return = (VkResult)0;
+    vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return =
+        vkEnc->vkGetPhysicalDeviceSurfaceFormats2KHR(
+            physicalDevice, pSurfaceInfo, pSurfaceFormatCount, pSurfaceFormats, true /* do lock */);
+    return vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return;
+}
+#endif
+#ifdef VK_KHR_variable_pointers
+#endif
+#ifdef VK_KHR_get_display_properties2
+static VkResult entry_vkGetPhysicalDeviceDisplayProperties2KHR(
+    VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount,
+    VkDisplayProperties2KHR* pProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceDisplayProperties2KHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return = (VkResult)0;
+    vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return =
+        vkEnc->vkGetPhysicalDeviceDisplayProperties2KHR(physicalDevice, pPropertyCount, pProperties,
+                                                        true /* do lock */);
+    return vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return;
+}
+static VkResult entry_vkGetPhysicalDeviceDisplayPlaneProperties2KHR(
+    VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount,
+    VkDisplayPlaneProperties2KHR* pProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceDisplayPlaneProperties2KHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return = (VkResult)0;
+    vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return =
+        vkEnc->vkGetPhysicalDeviceDisplayPlaneProperties2KHR(physicalDevice, pPropertyCount,
+                                                             pProperties, true /* do lock */);
+    return vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return;
+}
+static VkResult entry_vkGetDisplayModeProperties2KHR(VkPhysicalDevice physicalDevice,
+                                                     VkDisplayKHR display, uint32_t* pPropertyCount,
+                                                     VkDisplayModeProperties2KHR* pProperties) {
+    AEMU_SCOPED_TRACE("vkGetDisplayModeProperties2KHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetDisplayModeProperties2KHR_VkResult_return = (VkResult)0;
+    vkGetDisplayModeProperties2KHR_VkResult_return = vkEnc->vkGetDisplayModeProperties2KHR(
+        physicalDevice, display, pPropertyCount, pProperties, true /* do lock */);
+    return vkGetDisplayModeProperties2KHR_VkResult_return;
+}
+static VkResult entry_vkGetDisplayPlaneCapabilities2KHR(
+    VkPhysicalDevice physicalDevice, const VkDisplayPlaneInfo2KHR* pDisplayPlaneInfo,
+    VkDisplayPlaneCapabilities2KHR* pCapabilities) {
+    AEMU_SCOPED_TRACE("vkGetDisplayPlaneCapabilities2KHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetDisplayPlaneCapabilities2KHR_VkResult_return = (VkResult)0;
+    vkGetDisplayPlaneCapabilities2KHR_VkResult_return = vkEnc->vkGetDisplayPlaneCapabilities2KHR(
+        physicalDevice, pDisplayPlaneInfo, pCapabilities, true /* do lock */);
+    return vkGetDisplayPlaneCapabilities2KHR_VkResult_return;
+}
+#endif
+#ifdef VK_KHR_dedicated_allocation
+#endif
+#ifdef VK_KHR_storage_buffer_storage_class
+#endif
+#ifdef VK_KHR_relaxed_block_layout
+#endif
+#ifdef VK_KHR_get_memory_requirements2
+static void entry_vkGetImageMemoryRequirements2KHR(VkDevice device,
+                                                   const VkImageMemoryRequirementsInfo2* pInfo,
+                                                   VkMemoryRequirements2* pMemoryRequirements) {
+    AEMU_SCOPED_TRACE("vkGetImageMemoryRequirements2KHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    auto resources = ResourceTracker::get();
+    resources->on_vkGetImageMemoryRequirements2KHR(vkEnc, device, pInfo, pMemoryRequirements);
+}
+static void dynCheck_entry_vkGetImageMemoryRequirements2KHR(
+    VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo,
+    VkMemoryRequirements2* pMemoryRequirements) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_get_memory_requirements2")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetImageMemoryRequirements2KHR",
+                                         "VK_KHR_get_memory_requirements2");
+    }
+    AEMU_SCOPED_TRACE("vkGetImageMemoryRequirements2KHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    resources->on_vkGetImageMemoryRequirements2KHR(vkEnc, device, pInfo, pMemoryRequirements);
+}
+static void entry_vkGetBufferMemoryRequirements2KHR(VkDevice device,
+                                                    const VkBufferMemoryRequirementsInfo2* pInfo,
+                                                    VkMemoryRequirements2* pMemoryRequirements) {
+    AEMU_SCOPED_TRACE("vkGetBufferMemoryRequirements2KHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    auto resources = ResourceTracker::get();
+    resources->on_vkGetBufferMemoryRequirements2KHR(vkEnc, device, pInfo, pMemoryRequirements);
+}
+static void dynCheck_entry_vkGetBufferMemoryRequirements2KHR(
+    VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo,
+    VkMemoryRequirements2* pMemoryRequirements) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_get_memory_requirements2")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetBufferMemoryRequirements2KHR",
+                                         "VK_KHR_get_memory_requirements2");
+    }
+    AEMU_SCOPED_TRACE("vkGetBufferMemoryRequirements2KHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    resources->on_vkGetBufferMemoryRequirements2KHR(vkEnc, device, pInfo, pMemoryRequirements);
+}
+static void entry_vkGetImageSparseMemoryRequirements2KHR(
+    VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo,
+    uint32_t* pSparseMemoryRequirementCount,
+    VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) {
+    AEMU_SCOPED_TRACE("vkGetImageSparseMemoryRequirements2KHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetImageSparseMemoryRequirements2KHR(device, pInfo, pSparseMemoryRequirementCount,
+                                                  pSparseMemoryRequirements, true /* do lock */);
+}
+static void dynCheck_entry_vkGetImageSparseMemoryRequirements2KHR(
+    VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo,
+    uint32_t* pSparseMemoryRequirementCount,
+    VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_get_memory_requirements2")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetImageSparseMemoryRequirements2KHR",
+                                         "VK_KHR_get_memory_requirements2");
+    }
+    AEMU_SCOPED_TRACE("vkGetImageSparseMemoryRequirements2KHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetImageSparseMemoryRequirements2KHR(device, pInfo, pSparseMemoryRequirementCount,
+                                                  pSparseMemoryRequirements, true /* do lock */);
+}
+#endif
+#ifdef VK_KHR_image_format_list
+#endif
+#ifdef VK_KHR_sampler_ycbcr_conversion
+static VkResult entry_vkCreateSamplerYcbcrConversionKHR(
+    VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion) {
+    AEMU_SCOPED_TRACE("vkCreateSamplerYcbcrConversionKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateSamplerYcbcrConversionKHR_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkCreateSamplerYcbcrConversionKHR_VkResult_return =
+        resources->on_vkCreateSamplerYcbcrConversionKHR(vkEnc, VK_SUCCESS, device, pCreateInfo,
+                                                        pAllocator, pYcbcrConversion);
+    return vkCreateSamplerYcbcrConversionKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCreateSamplerYcbcrConversionKHR(
+    VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_sampler_ycbcr_conversion")) {
+        sOnInvalidDynamicallyCheckedCall("vkCreateSamplerYcbcrConversionKHR",
+                                         "VK_KHR_sampler_ycbcr_conversion");
+    }
+    AEMU_SCOPED_TRACE("vkCreateSamplerYcbcrConversionKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateSamplerYcbcrConversionKHR_VkResult_return = (VkResult)0;
+    vkCreateSamplerYcbcrConversionKHR_VkResult_return =
+        resources->on_vkCreateSamplerYcbcrConversionKHR(vkEnc, VK_SUCCESS, device, pCreateInfo,
+                                                        pAllocator, pYcbcrConversion);
+    return vkCreateSamplerYcbcrConversionKHR_VkResult_return;
+}
+static void entry_vkDestroySamplerYcbcrConversionKHR(VkDevice device,
+                                                     VkSamplerYcbcrConversion ycbcrConversion,
+                                                     const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroySamplerYcbcrConversionKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    auto resources = ResourceTracker::get();
+    resources->on_vkDestroySamplerYcbcrConversionKHR(vkEnc, device, ycbcrConversion, pAllocator);
+}
+static void dynCheck_entry_vkDestroySamplerYcbcrConversionKHR(
+    VkDevice device, VkSamplerYcbcrConversion ycbcrConversion,
+    const VkAllocationCallbacks* pAllocator) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_sampler_ycbcr_conversion")) {
+        sOnInvalidDynamicallyCheckedCall("vkDestroySamplerYcbcrConversionKHR",
+                                         "VK_KHR_sampler_ycbcr_conversion");
+    }
+    AEMU_SCOPED_TRACE("vkDestroySamplerYcbcrConversionKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    resources->on_vkDestroySamplerYcbcrConversionKHR(vkEnc, device, ycbcrConversion, pAllocator);
+}
+#endif
+#ifdef VK_KHR_bind_memory2
+static VkResult entry_vkBindBufferMemory2KHR(VkDevice device, uint32_t bindInfoCount,
+                                             const VkBindBufferMemoryInfo* pBindInfos) {
+    AEMU_SCOPED_TRACE("vkBindBufferMemory2KHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkBindBufferMemory2KHR_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkBindBufferMemory2KHR_VkResult_return =
+        resources->on_vkBindBufferMemory2KHR(vkEnc, VK_SUCCESS, device, bindInfoCount, pBindInfos);
+    return vkBindBufferMemory2KHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkBindBufferMemory2KHR(VkDevice device, uint32_t bindInfoCount,
+                                                      const VkBindBufferMemoryInfo* pBindInfos) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_bind_memory2")) {
+        sOnInvalidDynamicallyCheckedCall("vkBindBufferMemory2KHR", "VK_KHR_bind_memory2");
+    }
+    AEMU_SCOPED_TRACE("vkBindBufferMemory2KHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkBindBufferMemory2KHR_VkResult_return = (VkResult)0;
+    vkBindBufferMemory2KHR_VkResult_return =
+        resources->on_vkBindBufferMemory2KHR(vkEnc, VK_SUCCESS, device, bindInfoCount, pBindInfos);
+    return vkBindBufferMemory2KHR_VkResult_return;
+}
+static VkResult entry_vkBindImageMemory2KHR(VkDevice device, uint32_t bindInfoCount,
+                                            const VkBindImageMemoryInfo* pBindInfos) {
+    AEMU_SCOPED_TRACE("vkBindImageMemory2KHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkBindImageMemory2KHR_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkBindImageMemory2KHR_VkResult_return =
+        resources->on_vkBindImageMemory2KHR(vkEnc, VK_SUCCESS, device, bindInfoCount, pBindInfos);
+    return vkBindImageMemory2KHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkBindImageMemory2KHR(VkDevice device, uint32_t bindInfoCount,
+                                                     const VkBindImageMemoryInfo* pBindInfos) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_bind_memory2")) {
+        sOnInvalidDynamicallyCheckedCall("vkBindImageMemory2KHR", "VK_KHR_bind_memory2");
+    }
+    AEMU_SCOPED_TRACE("vkBindImageMemory2KHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkBindImageMemory2KHR_VkResult_return = (VkResult)0;
+    vkBindImageMemory2KHR_VkResult_return =
+        resources->on_vkBindImageMemory2KHR(vkEnc, VK_SUCCESS, device, bindInfoCount, pBindInfos);
+    return vkBindImageMemory2KHR_VkResult_return;
+}
+#endif
+#ifdef VK_KHR_portability_subset
+#endif
+#ifdef VK_KHR_maintenance3
+static void entry_vkGetDescriptorSetLayoutSupportKHR(
+    VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
+    VkDescriptorSetLayoutSupport* pSupport) {
+    AEMU_SCOPED_TRACE("vkGetDescriptorSetLayoutSupportKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetDescriptorSetLayoutSupportKHR(device, pCreateInfo, pSupport, true /* do lock */);
+}
+static void dynCheck_entry_vkGetDescriptorSetLayoutSupportKHR(
+    VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
+    VkDescriptorSetLayoutSupport* pSupport) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_maintenance3")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetDescriptorSetLayoutSupportKHR",
+                                         "VK_KHR_maintenance3");
+    }
+    AEMU_SCOPED_TRACE("vkGetDescriptorSetLayoutSupportKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetDescriptorSetLayoutSupportKHR(device, pCreateInfo, pSupport, true /* do lock */);
+}
+#endif
+#ifdef VK_KHR_draw_indirect_count
+static void entry_vkCmdDrawIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                            VkDeviceSize offset, VkBuffer countBuffer,
+                                            VkDeviceSize countBufferOffset, uint32_t maxDrawCount,
+                                            uint32_t stride) {
+    AEMU_SCOPED_TRACE("vkCmdDrawIndirectCountKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDrawIndirectCountKHR(commandBuffer, buffer, offset, countBuffer, countBufferOffset,
+                                     maxDrawCount, stride, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdDrawIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                                     VkDeviceSize offset, VkBuffer countBuffer,
+                                                     VkDeviceSize countBufferOffset,
+                                                     uint32_t maxDrawCount, uint32_t stride) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_draw_indirect_count")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdDrawIndirectCountKHR", "VK_KHR_draw_indirect_count");
+    }
+    AEMU_SCOPED_TRACE("vkCmdDrawIndirectCountKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDrawIndirectCountKHR(commandBuffer, buffer, offset, countBuffer, countBufferOffset,
+                                     maxDrawCount, stride, true /* do lock */);
+}
+static void entry_vkCmdDrawIndexedIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                                   VkDeviceSize offset, VkBuffer countBuffer,
+                                                   VkDeviceSize countBufferOffset,
+                                                   uint32_t maxDrawCount, uint32_t stride) {
+    AEMU_SCOPED_TRACE("vkCmdDrawIndexedIndirectCountKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDrawIndexedIndirectCountKHR(commandBuffer, buffer, offset, countBuffer,
+                                            countBufferOffset, maxDrawCount, stride,
+                                            true /* do lock */);
+}
+static void dynCheck_entry_vkCmdDrawIndexedIndirectCountKHR(
+    VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer,
+    VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_draw_indirect_count")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdDrawIndexedIndirectCountKHR",
+                                         "VK_KHR_draw_indirect_count");
+    }
+    AEMU_SCOPED_TRACE("vkCmdDrawIndexedIndirectCountKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDrawIndexedIndirectCountKHR(commandBuffer, buffer, offset, countBuffer,
+                                            countBufferOffset, maxDrawCount, stride,
+                                            true /* do lock */);
+}
+#endif
+#ifdef VK_KHR_shader_subgroup_extended_types
+#endif
+#ifdef VK_KHR_8bit_storage
+#endif
+#ifdef VK_KHR_shader_atomic_int64
+#endif
+#ifdef VK_KHR_shader_clock
+#endif
+#ifdef VK_KHR_driver_properties
+#endif
+#ifdef VK_KHR_shader_float_controls
+#endif
+#ifdef VK_KHR_depth_stencil_resolve
+#endif
+#ifdef VK_KHR_swapchain_mutable_format
+#endif
+#ifdef VK_KHR_timeline_semaphore
+static VkResult entry_vkGetSemaphoreCounterValueKHR(VkDevice device, VkSemaphore semaphore,
+                                                    uint64_t* pValue) {
+    AEMU_SCOPED_TRACE("vkGetSemaphoreCounterValueKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetSemaphoreCounterValueKHR_VkResult_return = (VkResult)0;
+    vkGetSemaphoreCounterValueKHR_VkResult_return =
+        vkEnc->vkGetSemaphoreCounterValueKHR(device, semaphore, pValue, true /* do lock */);
+    return vkGetSemaphoreCounterValueKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetSemaphoreCounterValueKHR(VkDevice device, VkSemaphore semaphore,
+                                                             uint64_t* pValue) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_timeline_semaphore")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetSemaphoreCounterValueKHR",
+                                         "VK_KHR_timeline_semaphore");
+    }
+    AEMU_SCOPED_TRACE("vkGetSemaphoreCounterValueKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetSemaphoreCounterValueKHR_VkResult_return = (VkResult)0;
+    vkGetSemaphoreCounterValueKHR_VkResult_return =
+        vkEnc->vkGetSemaphoreCounterValueKHR(device, semaphore, pValue, true /* do lock */);
+    return vkGetSemaphoreCounterValueKHR_VkResult_return;
+}
+static VkResult entry_vkWaitSemaphoresKHR(VkDevice device, const VkSemaphoreWaitInfo* pWaitInfo,
+                                          uint64_t timeout) {
+    AEMU_SCOPED_TRACE("vkWaitSemaphoresKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkWaitSemaphoresKHR_VkResult_return = (VkResult)0;
+    vkWaitSemaphoresKHR_VkResult_return =
+        vkEnc->vkWaitSemaphoresKHR(device, pWaitInfo, timeout, true /* do lock */);
+    return vkWaitSemaphoresKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkWaitSemaphoresKHR(VkDevice device,
+                                                   const VkSemaphoreWaitInfo* pWaitInfo,
+                                                   uint64_t timeout) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_timeline_semaphore")) {
+        sOnInvalidDynamicallyCheckedCall("vkWaitSemaphoresKHR", "VK_KHR_timeline_semaphore");
+    }
+    AEMU_SCOPED_TRACE("vkWaitSemaphoresKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkWaitSemaphoresKHR_VkResult_return = (VkResult)0;
+    vkWaitSemaphoresKHR_VkResult_return =
+        vkEnc->vkWaitSemaphoresKHR(device, pWaitInfo, timeout, true /* do lock */);
+    return vkWaitSemaphoresKHR_VkResult_return;
+}
+static VkResult entry_vkSignalSemaphoreKHR(VkDevice device,
+                                           const VkSemaphoreSignalInfo* pSignalInfo) {
+    AEMU_SCOPED_TRACE("vkSignalSemaphoreKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkSignalSemaphoreKHR_VkResult_return = (VkResult)0;
+    vkSignalSemaphoreKHR_VkResult_return =
+        vkEnc->vkSignalSemaphoreKHR(device, pSignalInfo, true /* do lock */);
+    return vkSignalSemaphoreKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkSignalSemaphoreKHR(VkDevice device,
+                                                    const VkSemaphoreSignalInfo* pSignalInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_timeline_semaphore")) {
+        sOnInvalidDynamicallyCheckedCall("vkSignalSemaphoreKHR", "VK_KHR_timeline_semaphore");
+    }
+    AEMU_SCOPED_TRACE("vkSignalSemaphoreKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkSignalSemaphoreKHR_VkResult_return = (VkResult)0;
+    vkSignalSemaphoreKHR_VkResult_return =
+        vkEnc->vkSignalSemaphoreKHR(device, pSignalInfo, true /* do lock */);
+    return vkSignalSemaphoreKHR_VkResult_return;
+}
+#endif
+#ifdef VK_KHR_vulkan_memory_model
+#endif
+#ifdef VK_KHR_shader_terminate_invocation
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+static VkResult entry_vkGetPhysicalDeviceFragmentShadingRatesKHR(
+    VkPhysicalDevice physicalDevice, uint32_t* pFragmentShadingRateCount,
+    VkPhysicalDeviceFragmentShadingRateKHR* pFragmentShadingRates) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFragmentShadingRatesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPhysicalDeviceFragmentShadingRatesKHR_VkResult_return = (VkResult)0;
+    vkGetPhysicalDeviceFragmentShadingRatesKHR_VkResult_return =
+        vkEnc->vkGetPhysicalDeviceFragmentShadingRatesKHR(
+            physicalDevice, pFragmentShadingRateCount, pFragmentShadingRates, true /* do lock */);
+    return vkGetPhysicalDeviceFragmentShadingRatesKHR_VkResult_return;
+}
+static void entry_vkCmdSetFragmentShadingRateKHR(
+    VkCommandBuffer commandBuffer, const VkExtent2D* pFragmentSize,
+    const VkFragmentShadingRateCombinerOpKHR combinerOps[2]) {
+    AEMU_SCOPED_TRACE("vkCmdSetFragmentShadingRateKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetFragmentShadingRateKHR(commandBuffer, pFragmentSize, combinerOps,
+                                          true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetFragmentShadingRateKHR(
+    VkCommandBuffer commandBuffer, const VkExtent2D* pFragmentSize,
+    const VkFragmentShadingRateCombinerOpKHR combinerOps[2]) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_fragment_shading_rate")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetFragmentShadingRateKHR",
+                                         "VK_KHR_fragment_shading_rate");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetFragmentShadingRateKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetFragmentShadingRateKHR(commandBuffer, pFragmentSize, combinerOps,
+                                          true /* do lock */);
+}
+#endif
+#ifdef VK_KHR_spirv_1_4
+#endif
+#ifdef VK_KHR_surface_protected_capabilities
+#endif
+#ifdef VK_KHR_separate_depth_stencil_layouts
+#endif
+#ifdef VK_KHR_present_wait
+static VkResult entry_vkWaitForPresentKHR(VkDevice device, VkSwapchainKHR swapchain,
+                                          uint64_t presentId, uint64_t timeout) {
+    AEMU_SCOPED_TRACE("vkWaitForPresentKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkWaitForPresentKHR_VkResult_return = (VkResult)0;
+    vkWaitForPresentKHR_VkResult_return =
+        vkEnc->vkWaitForPresentKHR(device, swapchain, presentId, timeout, true /* do lock */);
+    return vkWaitForPresentKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkWaitForPresentKHR(VkDevice device, VkSwapchainKHR swapchain,
+                                                   uint64_t presentId, uint64_t timeout) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_present_wait")) {
+        sOnInvalidDynamicallyCheckedCall("vkWaitForPresentKHR", "VK_KHR_present_wait");
+    }
+    AEMU_SCOPED_TRACE("vkWaitForPresentKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkWaitForPresentKHR_VkResult_return = (VkResult)0;
+    vkWaitForPresentKHR_VkResult_return =
+        vkEnc->vkWaitForPresentKHR(device, swapchain, presentId, timeout, true /* do lock */);
+    return vkWaitForPresentKHR_VkResult_return;
+}
+#endif
+#ifdef VK_KHR_uniform_buffer_standard_layout
+#endif
+#ifdef VK_KHR_buffer_device_address
+static VkDeviceAddress entry_vkGetBufferDeviceAddressKHR(VkDevice device,
+                                                         const VkBufferDeviceAddressInfo* pInfo) {
+    AEMU_SCOPED_TRACE("vkGetBufferDeviceAddressKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkDeviceAddress vkGetBufferDeviceAddressKHR_VkDeviceAddress_return = (VkDeviceAddress)0;
+    vkGetBufferDeviceAddressKHR_VkDeviceAddress_return =
+        vkEnc->vkGetBufferDeviceAddressKHR(device, pInfo, true /* do lock */);
+    return vkGetBufferDeviceAddressKHR_VkDeviceAddress_return;
+}
+static VkDeviceAddress dynCheck_entry_vkGetBufferDeviceAddressKHR(
+    VkDevice device, const VkBufferDeviceAddressInfo* pInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_buffer_device_address")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetBufferDeviceAddressKHR",
+                                         "VK_KHR_buffer_device_address");
+    }
+    AEMU_SCOPED_TRACE("vkGetBufferDeviceAddressKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkDeviceAddress vkGetBufferDeviceAddressKHR_VkDeviceAddress_return = (VkDeviceAddress)0;
+    vkGetBufferDeviceAddressKHR_VkDeviceAddress_return =
+        vkEnc->vkGetBufferDeviceAddressKHR(device, pInfo, true /* do lock */);
+    return vkGetBufferDeviceAddressKHR_VkDeviceAddress_return;
+}
+static uint64_t entry_vkGetBufferOpaqueCaptureAddressKHR(VkDevice device,
+                                                         const VkBufferDeviceAddressInfo* pInfo) {
+    AEMU_SCOPED_TRACE("vkGetBufferOpaqueCaptureAddressKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    uint64_t vkGetBufferOpaqueCaptureAddressKHR_uint64_t_return = (uint64_t)0;
+    vkGetBufferOpaqueCaptureAddressKHR_uint64_t_return =
+        vkEnc->vkGetBufferOpaqueCaptureAddressKHR(device, pInfo, true /* do lock */);
+    return vkGetBufferOpaqueCaptureAddressKHR_uint64_t_return;
+}
+static uint64_t dynCheck_entry_vkGetBufferOpaqueCaptureAddressKHR(
+    VkDevice device, const VkBufferDeviceAddressInfo* pInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_buffer_device_address")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetBufferOpaqueCaptureAddressKHR",
+                                         "VK_KHR_buffer_device_address");
+    }
+    AEMU_SCOPED_TRACE("vkGetBufferOpaqueCaptureAddressKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    uint64_t vkGetBufferOpaqueCaptureAddressKHR_uint64_t_return = (uint64_t)0;
+    vkGetBufferOpaqueCaptureAddressKHR_uint64_t_return =
+        vkEnc->vkGetBufferOpaqueCaptureAddressKHR(device, pInfo, true /* do lock */);
+    return vkGetBufferOpaqueCaptureAddressKHR_uint64_t_return;
+}
+static uint64_t entry_vkGetDeviceMemoryOpaqueCaptureAddressKHR(
+    VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo) {
+    AEMU_SCOPED_TRACE("vkGetDeviceMemoryOpaqueCaptureAddressKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    uint64_t vkGetDeviceMemoryOpaqueCaptureAddressKHR_uint64_t_return = (uint64_t)0;
+    vkGetDeviceMemoryOpaqueCaptureAddressKHR_uint64_t_return =
+        vkEnc->vkGetDeviceMemoryOpaqueCaptureAddressKHR(device, pInfo, true /* do lock */);
+    return vkGetDeviceMemoryOpaqueCaptureAddressKHR_uint64_t_return;
+}
+static uint64_t dynCheck_entry_vkGetDeviceMemoryOpaqueCaptureAddressKHR(
+    VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_buffer_device_address")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetDeviceMemoryOpaqueCaptureAddressKHR",
+                                         "VK_KHR_buffer_device_address");
+    }
+    AEMU_SCOPED_TRACE("vkGetDeviceMemoryOpaqueCaptureAddressKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    uint64_t vkGetDeviceMemoryOpaqueCaptureAddressKHR_uint64_t_return = (uint64_t)0;
+    vkGetDeviceMemoryOpaqueCaptureAddressKHR_uint64_t_return =
+        vkEnc->vkGetDeviceMemoryOpaqueCaptureAddressKHR(device, pInfo, true /* do lock */);
+    return vkGetDeviceMemoryOpaqueCaptureAddressKHR_uint64_t_return;
+}
+#endif
+#ifdef VK_KHR_deferred_host_operations
+static VkResult entry_vkCreateDeferredOperationKHR(VkDevice device,
+                                                   const VkAllocationCallbacks* pAllocator,
+                                                   VkDeferredOperationKHR* pDeferredOperation) {
+    AEMU_SCOPED_TRACE("vkCreateDeferredOperationKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateDeferredOperationKHR_VkResult_return = (VkResult)0;
+    vkCreateDeferredOperationKHR_VkResult_return = vkEnc->vkCreateDeferredOperationKHR(
+        device, pAllocator, pDeferredOperation, true /* do lock */);
+    return vkCreateDeferredOperationKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCreateDeferredOperationKHR(
+    VkDevice device, const VkAllocationCallbacks* pAllocator,
+    VkDeferredOperationKHR* pDeferredOperation) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_deferred_host_operations")) {
+        sOnInvalidDynamicallyCheckedCall("vkCreateDeferredOperationKHR",
+                                         "VK_KHR_deferred_host_operations");
+    }
+    AEMU_SCOPED_TRACE("vkCreateDeferredOperationKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateDeferredOperationKHR_VkResult_return = (VkResult)0;
+    vkCreateDeferredOperationKHR_VkResult_return = vkEnc->vkCreateDeferredOperationKHR(
+        device, pAllocator, pDeferredOperation, true /* do lock */);
+    return vkCreateDeferredOperationKHR_VkResult_return;
+}
+static void entry_vkDestroyDeferredOperationKHR(VkDevice device, VkDeferredOperationKHR operation,
+                                                const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyDeferredOperationKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyDeferredOperationKHR(device, operation, pAllocator, true /* do lock */);
+}
+static void dynCheck_entry_vkDestroyDeferredOperationKHR(VkDevice device,
+                                                         VkDeferredOperationKHR operation,
+                                                         const VkAllocationCallbacks* pAllocator) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_deferred_host_operations")) {
+        sOnInvalidDynamicallyCheckedCall("vkDestroyDeferredOperationKHR",
+                                         "VK_KHR_deferred_host_operations");
+    }
+    AEMU_SCOPED_TRACE("vkDestroyDeferredOperationKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyDeferredOperationKHR(device, operation, pAllocator, true /* do lock */);
+}
+static uint32_t entry_vkGetDeferredOperationMaxConcurrencyKHR(VkDevice device,
+                                                              VkDeferredOperationKHR operation) {
+    AEMU_SCOPED_TRACE("vkGetDeferredOperationMaxConcurrencyKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    uint32_t vkGetDeferredOperationMaxConcurrencyKHR_uint32_t_return = (uint32_t)0;
+    vkGetDeferredOperationMaxConcurrencyKHR_uint32_t_return =
+        vkEnc->vkGetDeferredOperationMaxConcurrencyKHR(device, operation, true /* do lock */);
+    return vkGetDeferredOperationMaxConcurrencyKHR_uint32_t_return;
+}
+static uint32_t dynCheck_entry_vkGetDeferredOperationMaxConcurrencyKHR(
+    VkDevice device, VkDeferredOperationKHR operation) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_deferred_host_operations")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetDeferredOperationMaxConcurrencyKHR",
+                                         "VK_KHR_deferred_host_operations");
+    }
+    AEMU_SCOPED_TRACE("vkGetDeferredOperationMaxConcurrencyKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    uint32_t vkGetDeferredOperationMaxConcurrencyKHR_uint32_t_return = (uint32_t)0;
+    vkGetDeferredOperationMaxConcurrencyKHR_uint32_t_return =
+        vkEnc->vkGetDeferredOperationMaxConcurrencyKHR(device, operation, true /* do lock */);
+    return vkGetDeferredOperationMaxConcurrencyKHR_uint32_t_return;
+}
+static VkResult entry_vkGetDeferredOperationResultKHR(VkDevice device,
+                                                      VkDeferredOperationKHR operation) {
+    AEMU_SCOPED_TRACE("vkGetDeferredOperationResultKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetDeferredOperationResultKHR_VkResult_return = (VkResult)0;
+    vkGetDeferredOperationResultKHR_VkResult_return =
+        vkEnc->vkGetDeferredOperationResultKHR(device, operation, true /* do lock */);
+    return vkGetDeferredOperationResultKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetDeferredOperationResultKHR(VkDevice device,
+                                                               VkDeferredOperationKHR operation) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_deferred_host_operations")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetDeferredOperationResultKHR",
+                                         "VK_KHR_deferred_host_operations");
+    }
+    AEMU_SCOPED_TRACE("vkGetDeferredOperationResultKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetDeferredOperationResultKHR_VkResult_return = (VkResult)0;
+    vkGetDeferredOperationResultKHR_VkResult_return =
+        vkEnc->vkGetDeferredOperationResultKHR(device, operation, true /* do lock */);
+    return vkGetDeferredOperationResultKHR_VkResult_return;
+}
+static VkResult entry_vkDeferredOperationJoinKHR(VkDevice device,
+                                                 VkDeferredOperationKHR operation) {
+    AEMU_SCOPED_TRACE("vkDeferredOperationJoinKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkDeferredOperationJoinKHR_VkResult_return = (VkResult)0;
+    vkDeferredOperationJoinKHR_VkResult_return =
+        vkEnc->vkDeferredOperationJoinKHR(device, operation, true /* do lock */);
+    return vkDeferredOperationJoinKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkDeferredOperationJoinKHR(VkDevice device,
+                                                          VkDeferredOperationKHR operation) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_deferred_host_operations")) {
+        sOnInvalidDynamicallyCheckedCall("vkDeferredOperationJoinKHR",
+                                         "VK_KHR_deferred_host_operations");
+    }
+    AEMU_SCOPED_TRACE("vkDeferredOperationJoinKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkDeferredOperationJoinKHR_VkResult_return = (VkResult)0;
+    vkDeferredOperationJoinKHR_VkResult_return =
+        vkEnc->vkDeferredOperationJoinKHR(device, operation, true /* do lock */);
+    return vkDeferredOperationJoinKHR_VkResult_return;
+}
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+static VkResult entry_vkGetPipelineExecutablePropertiesKHR(
+    VkDevice device, const VkPipelineInfoKHR* pPipelineInfo, uint32_t* pExecutableCount,
+    VkPipelineExecutablePropertiesKHR* pProperties) {
+    AEMU_SCOPED_TRACE("vkGetPipelineExecutablePropertiesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPipelineExecutablePropertiesKHR_VkResult_return = (VkResult)0;
+    vkGetPipelineExecutablePropertiesKHR_VkResult_return =
+        vkEnc->vkGetPipelineExecutablePropertiesKHR(device, pPipelineInfo, pExecutableCount,
+                                                    pProperties, true /* do lock */);
+    return vkGetPipelineExecutablePropertiesKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetPipelineExecutablePropertiesKHR(
+    VkDevice device, const VkPipelineInfoKHR* pPipelineInfo, uint32_t* pExecutableCount,
+    VkPipelineExecutablePropertiesKHR* pProperties) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_pipeline_executable_properties")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetPipelineExecutablePropertiesKHR",
+                                         "VK_KHR_pipeline_executable_properties");
+    }
+    AEMU_SCOPED_TRACE("vkGetPipelineExecutablePropertiesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPipelineExecutablePropertiesKHR_VkResult_return = (VkResult)0;
+    vkGetPipelineExecutablePropertiesKHR_VkResult_return =
+        vkEnc->vkGetPipelineExecutablePropertiesKHR(device, pPipelineInfo, pExecutableCount,
+                                                    pProperties, true /* do lock */);
+    return vkGetPipelineExecutablePropertiesKHR_VkResult_return;
+}
+static VkResult entry_vkGetPipelineExecutableStatisticsKHR(
+    VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo, uint32_t* pStatisticCount,
+    VkPipelineExecutableStatisticKHR* pStatistics) {
+    AEMU_SCOPED_TRACE("vkGetPipelineExecutableStatisticsKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPipelineExecutableStatisticsKHR_VkResult_return = (VkResult)0;
+    vkGetPipelineExecutableStatisticsKHR_VkResult_return =
+        vkEnc->vkGetPipelineExecutableStatisticsKHR(device, pExecutableInfo, pStatisticCount,
+                                                    pStatistics, true /* do lock */);
+    return vkGetPipelineExecutableStatisticsKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetPipelineExecutableStatisticsKHR(
+    VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo, uint32_t* pStatisticCount,
+    VkPipelineExecutableStatisticKHR* pStatistics) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_pipeline_executable_properties")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetPipelineExecutableStatisticsKHR",
+                                         "VK_KHR_pipeline_executable_properties");
+    }
+    AEMU_SCOPED_TRACE("vkGetPipelineExecutableStatisticsKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPipelineExecutableStatisticsKHR_VkResult_return = (VkResult)0;
+    vkGetPipelineExecutableStatisticsKHR_VkResult_return =
+        vkEnc->vkGetPipelineExecutableStatisticsKHR(device, pExecutableInfo, pStatisticCount,
+                                                    pStatistics, true /* do lock */);
+    return vkGetPipelineExecutableStatisticsKHR_VkResult_return;
+}
+static VkResult entry_vkGetPipelineExecutableInternalRepresentationsKHR(
+    VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo,
+    uint32_t* pInternalRepresentationCount,
+    VkPipelineExecutableInternalRepresentationKHR* pInternalRepresentations) {
+    AEMU_SCOPED_TRACE("vkGetPipelineExecutableInternalRepresentationsKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPipelineExecutableInternalRepresentationsKHR_VkResult_return = (VkResult)0;
+    vkGetPipelineExecutableInternalRepresentationsKHR_VkResult_return =
+        vkEnc->vkGetPipelineExecutableInternalRepresentationsKHR(
+            device, pExecutableInfo, pInternalRepresentationCount, pInternalRepresentations,
+            true /* do lock */);
+    return vkGetPipelineExecutableInternalRepresentationsKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetPipelineExecutableInternalRepresentationsKHR(
+    VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo,
+    uint32_t* pInternalRepresentationCount,
+    VkPipelineExecutableInternalRepresentationKHR* pInternalRepresentations) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_pipeline_executable_properties")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetPipelineExecutableInternalRepresentationsKHR",
+                                         "VK_KHR_pipeline_executable_properties");
+    }
+    AEMU_SCOPED_TRACE("vkGetPipelineExecutableInternalRepresentationsKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPipelineExecutableInternalRepresentationsKHR_VkResult_return = (VkResult)0;
+    vkGetPipelineExecutableInternalRepresentationsKHR_VkResult_return =
+        vkEnc->vkGetPipelineExecutableInternalRepresentationsKHR(
+            device, pExecutableInfo, pInternalRepresentationCount, pInternalRepresentations,
+            true /* do lock */);
+    return vkGetPipelineExecutableInternalRepresentationsKHR_VkResult_return;
+}
+#endif
+#ifdef VK_KHR_shader_integer_dot_product
+#endif
+#ifdef VK_KHR_pipeline_library
+#endif
+#ifdef VK_KHR_shader_non_semantic_info
+#endif
+#ifdef VK_KHR_present_id
+#endif
+#ifdef VK_KHR_video_encode_queue
+static void entry_vkCmdEncodeVideoKHR(VkCommandBuffer commandBuffer,
+                                      const VkVideoEncodeInfoKHR* pEncodeInfo) {
+    AEMU_SCOPED_TRACE("vkCmdEncodeVideoKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdEncodeVideoKHR(commandBuffer, pEncodeInfo, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdEncodeVideoKHR(VkCommandBuffer commandBuffer,
+                                               const VkVideoEncodeInfoKHR* pEncodeInfo) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_video_encode_queue")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdEncodeVideoKHR", "VK_KHR_video_encode_queue");
+    }
+    AEMU_SCOPED_TRACE("vkCmdEncodeVideoKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdEncodeVideoKHR(commandBuffer, pEncodeInfo, true /* do lock */);
+}
+#endif
+#ifdef VK_KHR_synchronization2
+static void entry_vkCmdSetEvent2KHR(VkCommandBuffer commandBuffer, VkEvent event,
+                                    const VkDependencyInfoKHR* pDependencyInfo) {
+    AEMU_SCOPED_TRACE("vkCmdSetEvent2KHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetEvent2KHR(commandBuffer, event, pDependencyInfo, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetEvent2KHR(VkCommandBuffer commandBuffer, VkEvent event,
+                                             const VkDependencyInfoKHR* pDependencyInfo) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_synchronization2")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetEvent2KHR", "VK_KHR_synchronization2");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetEvent2KHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetEvent2KHR(commandBuffer, event, pDependencyInfo, true /* do lock */);
+}
+static void entry_vkCmdResetEvent2KHR(VkCommandBuffer commandBuffer, VkEvent event,
+                                      VkPipelineStageFlags2KHR stageMask) {
+    AEMU_SCOPED_TRACE("vkCmdResetEvent2KHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdResetEvent2KHR(commandBuffer, event, stageMask, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdResetEvent2KHR(VkCommandBuffer commandBuffer, VkEvent event,
+                                               VkPipelineStageFlags2KHR stageMask) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_synchronization2")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdResetEvent2KHR", "VK_KHR_synchronization2");
+    }
+    AEMU_SCOPED_TRACE("vkCmdResetEvent2KHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdResetEvent2KHR(commandBuffer, event, stageMask, true /* do lock */);
+}
+static void entry_vkCmdWaitEvents2KHR(VkCommandBuffer commandBuffer, uint32_t eventCount,
+                                      const VkEvent* pEvents,
+                                      const VkDependencyInfoKHR* pDependencyInfos) {
+    AEMU_SCOPED_TRACE("vkCmdWaitEvents2KHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdWaitEvents2KHR(commandBuffer, eventCount, pEvents, pDependencyInfos,
+                               true /* do lock */);
+}
+static void dynCheck_entry_vkCmdWaitEvents2KHR(VkCommandBuffer commandBuffer, uint32_t eventCount,
+                                               const VkEvent* pEvents,
+                                               const VkDependencyInfoKHR* pDependencyInfos) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_synchronization2")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdWaitEvents2KHR", "VK_KHR_synchronization2");
+    }
+    AEMU_SCOPED_TRACE("vkCmdWaitEvents2KHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdWaitEvents2KHR(commandBuffer, eventCount, pEvents, pDependencyInfos,
+                               true /* do lock */);
+}
+static void entry_vkCmdPipelineBarrier2KHR(VkCommandBuffer commandBuffer,
+                                           const VkDependencyInfoKHR* pDependencyInfo) {
+    AEMU_SCOPED_TRACE("vkCmdPipelineBarrier2KHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdPipelineBarrier2KHR(commandBuffer, pDependencyInfo, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdPipelineBarrier2KHR(VkCommandBuffer commandBuffer,
+                                                    const VkDependencyInfoKHR* pDependencyInfo) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_synchronization2")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdPipelineBarrier2KHR", "VK_KHR_synchronization2");
+    }
+    AEMU_SCOPED_TRACE("vkCmdPipelineBarrier2KHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdPipelineBarrier2KHR(commandBuffer, pDependencyInfo, true /* do lock */);
+}
+static void entry_vkCmdWriteTimestamp2KHR(VkCommandBuffer commandBuffer,
+                                          VkPipelineStageFlags2KHR stage, VkQueryPool queryPool,
+                                          uint32_t query) {
+    AEMU_SCOPED_TRACE("vkCmdWriteTimestamp2KHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdWriteTimestamp2KHR(commandBuffer, stage, queryPool, query, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdWriteTimestamp2KHR(VkCommandBuffer commandBuffer,
+                                                   VkPipelineStageFlags2KHR stage,
+                                                   VkQueryPool queryPool, uint32_t query) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_synchronization2")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdWriteTimestamp2KHR", "VK_KHR_synchronization2");
+    }
+    AEMU_SCOPED_TRACE("vkCmdWriteTimestamp2KHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdWriteTimestamp2KHR(commandBuffer, stage, queryPool, query, true /* do lock */);
+}
+static VkResult entry_vkQueueSubmit2KHR(VkQueue queue, uint32_t submitCount,
+                                        const VkSubmitInfo2KHR* pSubmits, VkFence fence) {
+    AEMU_SCOPED_TRACE("vkQueueSubmit2KHR");
+    auto vkEnc = ResourceTracker::getQueueEncoder(queue);
+    VkResult vkQueueSubmit2KHR_VkResult_return = (VkResult)0;
+    vkQueueSubmit2KHR_VkResult_return =
+        vkEnc->vkQueueSubmit2KHR(queue, submitCount, pSubmits, fence, true /* do lock */);
+    return vkQueueSubmit2KHR_VkResult_return;
+}
+static void entry_vkCmdWriteBufferMarker2AMD(VkCommandBuffer commandBuffer,
+                                             VkPipelineStageFlags2KHR stage, VkBuffer dstBuffer,
+                                             VkDeviceSize dstOffset, uint32_t marker) {
+    AEMU_SCOPED_TRACE("vkCmdWriteBufferMarker2AMD");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdWriteBufferMarker2AMD(commandBuffer, stage, dstBuffer, dstOffset, marker,
+                                      true /* do lock */);
+}
+static void dynCheck_entry_vkCmdWriteBufferMarker2AMD(VkCommandBuffer commandBuffer,
+                                                      VkPipelineStageFlags2KHR stage,
+                                                      VkBuffer dstBuffer, VkDeviceSize dstOffset,
+                                                      uint32_t marker) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_synchronization2")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdWriteBufferMarker2AMD", "VK_KHR_synchronization2");
+    }
+    AEMU_SCOPED_TRACE("vkCmdWriteBufferMarker2AMD");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdWriteBufferMarker2AMD(commandBuffer, stage, dstBuffer, dstOffset, marker,
+                                      true /* do lock */);
+}
+static void entry_vkGetQueueCheckpointData2NV(VkQueue queue, uint32_t* pCheckpointDataCount,
+                                              VkCheckpointData2NV* pCheckpointData) {
+    AEMU_SCOPED_TRACE("vkGetQueueCheckpointData2NV");
+    auto vkEnc = ResourceTracker::getQueueEncoder(queue);
+    vkEnc->vkGetQueueCheckpointData2NV(queue, pCheckpointDataCount, pCheckpointData,
+                                       true /* do lock */);
+}
+#endif
+#ifdef VK_KHR_shader_subgroup_uniform_control_flow
+#endif
+#ifdef VK_KHR_zero_initialize_workgroup_memory
+#endif
+#ifdef VK_KHR_workgroup_memory_explicit_layout
+#endif
+#ifdef VK_KHR_copy_commands2
+static void entry_vkCmdCopyBuffer2KHR(VkCommandBuffer commandBuffer,
+                                      const VkCopyBufferInfo2KHR* pCopyBufferInfo) {
+    AEMU_SCOPED_TRACE("vkCmdCopyBuffer2KHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdCopyBuffer2KHR(commandBuffer, pCopyBufferInfo, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdCopyBuffer2KHR(VkCommandBuffer commandBuffer,
+                                               const VkCopyBufferInfo2KHR* pCopyBufferInfo) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_copy_commands2")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdCopyBuffer2KHR", "VK_KHR_copy_commands2");
+    }
+    AEMU_SCOPED_TRACE("vkCmdCopyBuffer2KHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdCopyBuffer2KHR(commandBuffer, pCopyBufferInfo, true /* do lock */);
+}
+static void entry_vkCmdCopyImage2KHR(VkCommandBuffer commandBuffer,
+                                     const VkCopyImageInfo2KHR* pCopyImageInfo) {
+    AEMU_SCOPED_TRACE("vkCmdCopyImage2KHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdCopyImage2KHR(commandBuffer, pCopyImageInfo, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdCopyImage2KHR(VkCommandBuffer commandBuffer,
+                                              const VkCopyImageInfo2KHR* pCopyImageInfo) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_copy_commands2")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdCopyImage2KHR", "VK_KHR_copy_commands2");
+    }
+    AEMU_SCOPED_TRACE("vkCmdCopyImage2KHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdCopyImage2KHR(commandBuffer, pCopyImageInfo, true /* do lock */);
+}
+static void entry_vkCmdCopyBufferToImage2KHR(
+    VkCommandBuffer commandBuffer, const VkCopyBufferToImageInfo2KHR* pCopyBufferToImageInfo) {
+    AEMU_SCOPED_TRACE("vkCmdCopyBufferToImage2KHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdCopyBufferToImage2KHR(commandBuffer, pCopyBufferToImageInfo, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdCopyBufferToImage2KHR(
+    VkCommandBuffer commandBuffer, const VkCopyBufferToImageInfo2KHR* pCopyBufferToImageInfo) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_copy_commands2")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdCopyBufferToImage2KHR", "VK_KHR_copy_commands2");
+    }
+    AEMU_SCOPED_TRACE("vkCmdCopyBufferToImage2KHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdCopyBufferToImage2KHR(commandBuffer, pCopyBufferToImageInfo, true /* do lock */);
+}
+static void entry_vkCmdCopyImageToBuffer2KHR(
+    VkCommandBuffer commandBuffer, const VkCopyImageToBufferInfo2KHR* pCopyImageToBufferInfo) {
+    AEMU_SCOPED_TRACE("vkCmdCopyImageToBuffer2KHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdCopyImageToBuffer2KHR(commandBuffer, pCopyImageToBufferInfo, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdCopyImageToBuffer2KHR(
+    VkCommandBuffer commandBuffer, const VkCopyImageToBufferInfo2KHR* pCopyImageToBufferInfo) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_copy_commands2")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdCopyImageToBuffer2KHR", "VK_KHR_copy_commands2");
+    }
+    AEMU_SCOPED_TRACE("vkCmdCopyImageToBuffer2KHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdCopyImageToBuffer2KHR(commandBuffer, pCopyImageToBufferInfo, true /* do lock */);
+}
+static void entry_vkCmdBlitImage2KHR(VkCommandBuffer commandBuffer,
+                                     const VkBlitImageInfo2KHR* pBlitImageInfo) {
+    AEMU_SCOPED_TRACE("vkCmdBlitImage2KHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBlitImage2KHR(commandBuffer, pBlitImageInfo, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdBlitImage2KHR(VkCommandBuffer commandBuffer,
+                                              const VkBlitImageInfo2KHR* pBlitImageInfo) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_copy_commands2")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdBlitImage2KHR", "VK_KHR_copy_commands2");
+    }
+    AEMU_SCOPED_TRACE("vkCmdBlitImage2KHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBlitImage2KHR(commandBuffer, pBlitImageInfo, true /* do lock */);
+}
+static void entry_vkCmdResolveImage2KHR(VkCommandBuffer commandBuffer,
+                                        const VkResolveImageInfo2KHR* pResolveImageInfo) {
+    AEMU_SCOPED_TRACE("vkCmdResolveImage2KHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdResolveImage2KHR(commandBuffer, pResolveImageInfo, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdResolveImage2KHR(VkCommandBuffer commandBuffer,
+                                                 const VkResolveImageInfo2KHR* pResolveImageInfo) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_copy_commands2")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdResolveImage2KHR", "VK_KHR_copy_commands2");
+    }
+    AEMU_SCOPED_TRACE("vkCmdResolveImage2KHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdResolveImage2KHR(commandBuffer, pResolveImageInfo, true /* do lock */);
+}
+#endif
+#ifdef VK_KHR_format_feature_flags2
+#endif
+#ifdef VK_KHR_maintenance4
+static void entry_vkGetDeviceBufferMemoryRequirementsKHR(
+    VkDevice device, const VkDeviceBufferMemoryRequirementsKHR* pInfo,
+    VkMemoryRequirements2* pMemoryRequirements) {
+    AEMU_SCOPED_TRACE("vkGetDeviceBufferMemoryRequirementsKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetDeviceBufferMemoryRequirementsKHR(device, pInfo, pMemoryRequirements,
+                                                  true /* do lock */);
+}
+static void dynCheck_entry_vkGetDeviceBufferMemoryRequirementsKHR(
+    VkDevice device, const VkDeviceBufferMemoryRequirementsKHR* pInfo,
+    VkMemoryRequirements2* pMemoryRequirements) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_maintenance4")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetDeviceBufferMemoryRequirementsKHR",
+                                         "VK_KHR_maintenance4");
+    }
+    AEMU_SCOPED_TRACE("vkGetDeviceBufferMemoryRequirementsKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetDeviceBufferMemoryRequirementsKHR(device, pInfo, pMemoryRequirements,
+                                                  true /* do lock */);
+}
+static void entry_vkGetDeviceImageMemoryRequirementsKHR(
+    VkDevice device, const VkDeviceImageMemoryRequirementsKHR* pInfo,
+    VkMemoryRequirements2* pMemoryRequirements) {
+    AEMU_SCOPED_TRACE("vkGetDeviceImageMemoryRequirementsKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetDeviceImageMemoryRequirementsKHR(device, pInfo, pMemoryRequirements,
+                                                 true /* do lock */);
+}
+static void dynCheck_entry_vkGetDeviceImageMemoryRequirementsKHR(
+    VkDevice device, const VkDeviceImageMemoryRequirementsKHR* pInfo,
+    VkMemoryRequirements2* pMemoryRequirements) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_maintenance4")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetDeviceImageMemoryRequirementsKHR",
+                                         "VK_KHR_maintenance4");
+    }
+    AEMU_SCOPED_TRACE("vkGetDeviceImageMemoryRequirementsKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetDeviceImageMemoryRequirementsKHR(device, pInfo, pMemoryRequirements,
+                                                 true /* do lock */);
+}
+static void entry_vkGetDeviceImageSparseMemoryRequirementsKHR(
+    VkDevice device, const VkDeviceImageMemoryRequirementsKHR* pInfo,
+    uint32_t* pSparseMemoryRequirementCount,
+    VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) {
+    AEMU_SCOPED_TRACE("vkGetDeviceImageSparseMemoryRequirementsKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetDeviceImageSparseMemoryRequirementsKHR(device, pInfo, pSparseMemoryRequirementCount,
+                                                       pSparseMemoryRequirements,
+                                                       true /* do lock */);
+}
+static void dynCheck_entry_vkGetDeviceImageSparseMemoryRequirementsKHR(
+    VkDevice device, const VkDeviceImageMemoryRequirementsKHR* pInfo,
+    uint32_t* pSparseMemoryRequirementCount,
+    VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_maintenance4")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetDeviceImageSparseMemoryRequirementsKHR",
+                                         "VK_KHR_maintenance4");
+    }
+    AEMU_SCOPED_TRACE("vkGetDeviceImageSparseMemoryRequirementsKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetDeviceImageSparseMemoryRequirementsKHR(device, pInfo, pSparseMemoryRequirementCount,
+                                                       pSparseMemoryRequirements,
+                                                       true /* do lock */);
+}
+#endif
+#ifdef VK_ANDROID_native_buffer
+static VkResult entry_vkGetSwapchainGrallocUsageANDROID(VkDevice device, VkFormat format,
+                                                        VkImageUsageFlags imageUsage,
+                                                        int* grallocUsage) {
+    AEMU_SCOPED_TRACE("vkGetSwapchainGrallocUsageANDROID");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetSwapchainGrallocUsageANDROID_VkResult_return = (VkResult)0;
+    vkGetSwapchainGrallocUsageANDROID_VkResult_return = vkEnc->vkGetSwapchainGrallocUsageANDROID(
+        device, format, imageUsage, grallocUsage, true /* do lock */);
+    return vkGetSwapchainGrallocUsageANDROID_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetSwapchainGrallocUsageANDROID(VkDevice device, VkFormat format,
+                                                                 VkImageUsageFlags imageUsage,
+                                                                 int* grallocUsage) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_ANDROID_native_buffer")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetSwapchainGrallocUsageANDROID",
+                                         "VK_ANDROID_native_buffer");
+    }
+    AEMU_SCOPED_TRACE("vkGetSwapchainGrallocUsageANDROID");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetSwapchainGrallocUsageANDROID_VkResult_return = (VkResult)0;
+    vkGetSwapchainGrallocUsageANDROID_VkResult_return = vkEnc->vkGetSwapchainGrallocUsageANDROID(
+        device, format, imageUsage, grallocUsage, true /* do lock */);
+    return vkGetSwapchainGrallocUsageANDROID_VkResult_return;
+}
+static VkResult entry_vkAcquireImageANDROID(VkDevice device, VkImage image, int nativeFenceFd,
+                                            VkSemaphore semaphore, VkFence fence) {
+    AEMU_SCOPED_TRACE("vkAcquireImageANDROID");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkAcquireImageANDROID_VkResult_return = (VkResult)0;
+    vkAcquireImageANDROID_VkResult_return = vkEnc->vkAcquireImageANDROID(
+        device, image, nativeFenceFd, semaphore, fence, true /* do lock */);
+    return vkAcquireImageANDROID_VkResult_return;
+}
+static VkResult dynCheck_entry_vkAcquireImageANDROID(VkDevice device, VkImage image,
+                                                     int nativeFenceFd, VkSemaphore semaphore,
+                                                     VkFence fence) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_ANDROID_native_buffer")) {
+        sOnInvalidDynamicallyCheckedCall("vkAcquireImageANDROID", "VK_ANDROID_native_buffer");
+    }
+    AEMU_SCOPED_TRACE("vkAcquireImageANDROID");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkAcquireImageANDROID_VkResult_return = (VkResult)0;
+    vkAcquireImageANDROID_VkResult_return = vkEnc->vkAcquireImageANDROID(
+        device, image, nativeFenceFd, semaphore, fence, true /* do lock */);
+    return vkAcquireImageANDROID_VkResult_return;
+}
+static VkResult entry_vkQueueSignalReleaseImageANDROID(VkQueue queue, uint32_t waitSemaphoreCount,
+                                                       const VkSemaphore* pWaitSemaphores,
+                                                       VkImage image, int* pNativeFenceFd) {
+    AEMU_SCOPED_TRACE("vkQueueSignalReleaseImageANDROID");
+    auto vkEnc = ResourceTracker::getQueueEncoder(queue);
+    VkResult vkQueueSignalReleaseImageANDROID_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkQueueSignalReleaseImageANDROID_VkResult_return =
+        resources->on_vkQueueSignalReleaseImageANDROID(vkEnc, VK_SUCCESS, queue, waitSemaphoreCount,
+                                                       pWaitSemaphores, image, pNativeFenceFd);
+    return vkQueueSignalReleaseImageANDROID_VkResult_return;
+}
+#endif
+#ifdef VK_EXT_debug_report
+static VkResult entry_vkCreateDebugReportCallbackEXT(
+    VkInstance instance, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkDebugReportCallbackEXT* pCallback) {
+    AEMU_SCOPED_TRACE("vkCreateDebugReportCallbackEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateDebugReportCallbackEXT_VkResult_return = (VkResult)0;
+    vkCreateDebugReportCallbackEXT_VkResult_return = vkEnc->vkCreateDebugReportCallbackEXT(
+        instance, pCreateInfo, pAllocator, pCallback, true /* do lock */);
+    return vkCreateDebugReportCallbackEXT_VkResult_return;
+}
+static void entry_vkDestroyDebugReportCallbackEXT(VkInstance instance,
+                                                  VkDebugReportCallbackEXT callback,
+                                                  const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyDebugReportCallbackEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyDebugReportCallbackEXT(instance, callback, pAllocator, true /* do lock */);
+}
+static void entry_vkDebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags,
+                                          VkDebugReportObjectTypeEXT objectType, uint64_t object,
+                                          size_t location, int32_t messageCode,
+                                          const char* pLayerPrefix, const char* pMessage) {
+    AEMU_SCOPED_TRACE("vkDebugReportMessageEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDebugReportMessageEXT(instance, flags, objectType, object, location, messageCode,
+                                   pLayerPrefix, pMessage, true /* do lock */);
+}
+#endif
+#ifdef VK_NV_glsl_shader
+#endif
+#ifdef VK_EXT_depth_range_unrestricted
+#endif
+#ifdef VK_IMG_filter_cubic
+#endif
+#ifdef VK_AMD_rasterization_order
+#endif
+#ifdef VK_AMD_shader_trinary_minmax
+#endif
+#ifdef VK_AMD_shader_explicit_vertex_parameter
+#endif
+#ifdef VK_EXT_debug_marker
+static VkResult entry_vkDebugMarkerSetObjectTagEXT(VkDevice device,
+                                                   const VkDebugMarkerObjectTagInfoEXT* pTagInfo) {
+    AEMU_SCOPED_TRACE("vkDebugMarkerSetObjectTagEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkDebugMarkerSetObjectTagEXT_VkResult_return = (VkResult)0;
+    vkDebugMarkerSetObjectTagEXT_VkResult_return =
+        vkEnc->vkDebugMarkerSetObjectTagEXT(device, pTagInfo, true /* do lock */);
+    return vkDebugMarkerSetObjectTagEXT_VkResult_return;
+}
+static VkResult dynCheck_entry_vkDebugMarkerSetObjectTagEXT(
+    VkDevice device, const VkDebugMarkerObjectTagInfoEXT* pTagInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_EXT_debug_marker")) {
+        sOnInvalidDynamicallyCheckedCall("vkDebugMarkerSetObjectTagEXT", "VK_EXT_debug_marker");
+    }
+    AEMU_SCOPED_TRACE("vkDebugMarkerSetObjectTagEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkDebugMarkerSetObjectTagEXT_VkResult_return = (VkResult)0;
+    vkDebugMarkerSetObjectTagEXT_VkResult_return =
+        vkEnc->vkDebugMarkerSetObjectTagEXT(device, pTagInfo, true /* do lock */);
+    return vkDebugMarkerSetObjectTagEXT_VkResult_return;
+}
+static VkResult entry_vkDebugMarkerSetObjectNameEXT(
+    VkDevice device, const VkDebugMarkerObjectNameInfoEXT* pNameInfo) {
+    AEMU_SCOPED_TRACE("vkDebugMarkerSetObjectNameEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkDebugMarkerSetObjectNameEXT_VkResult_return = (VkResult)0;
+    vkDebugMarkerSetObjectNameEXT_VkResult_return =
+        vkEnc->vkDebugMarkerSetObjectNameEXT(device, pNameInfo, true /* do lock */);
+    return vkDebugMarkerSetObjectNameEXT_VkResult_return;
+}
+static VkResult dynCheck_entry_vkDebugMarkerSetObjectNameEXT(
+    VkDevice device, const VkDebugMarkerObjectNameInfoEXT* pNameInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_EXT_debug_marker")) {
+        sOnInvalidDynamicallyCheckedCall("vkDebugMarkerSetObjectNameEXT", "VK_EXT_debug_marker");
+    }
+    AEMU_SCOPED_TRACE("vkDebugMarkerSetObjectNameEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkDebugMarkerSetObjectNameEXT_VkResult_return = (VkResult)0;
+    vkDebugMarkerSetObjectNameEXT_VkResult_return =
+        vkEnc->vkDebugMarkerSetObjectNameEXT(device, pNameInfo, true /* do lock */);
+    return vkDebugMarkerSetObjectNameEXT_VkResult_return;
+}
+static void entry_vkCmdDebugMarkerBeginEXT(VkCommandBuffer commandBuffer,
+                                           const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
+    AEMU_SCOPED_TRACE("vkCmdDebugMarkerBeginEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDebugMarkerBeginEXT(commandBuffer, pMarkerInfo, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdDebugMarkerBeginEXT(VkCommandBuffer commandBuffer,
+                                                    const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_debug_marker")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdDebugMarkerBeginEXT", "VK_EXT_debug_marker");
+    }
+    AEMU_SCOPED_TRACE("vkCmdDebugMarkerBeginEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDebugMarkerBeginEXT(commandBuffer, pMarkerInfo, true /* do lock */);
+}
+static void entry_vkCmdDebugMarkerEndEXT(VkCommandBuffer commandBuffer) {
+    AEMU_SCOPED_TRACE("vkCmdDebugMarkerEndEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDebugMarkerEndEXT(commandBuffer, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdDebugMarkerEndEXT(VkCommandBuffer commandBuffer) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_debug_marker")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdDebugMarkerEndEXT", "VK_EXT_debug_marker");
+    }
+    AEMU_SCOPED_TRACE("vkCmdDebugMarkerEndEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDebugMarkerEndEXT(commandBuffer, true /* do lock */);
+}
+static void entry_vkCmdDebugMarkerInsertEXT(VkCommandBuffer commandBuffer,
+                                            const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
+    AEMU_SCOPED_TRACE("vkCmdDebugMarkerInsertEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDebugMarkerInsertEXT(commandBuffer, pMarkerInfo, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdDebugMarkerInsertEXT(
+    VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_debug_marker")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdDebugMarkerInsertEXT", "VK_EXT_debug_marker");
+    }
+    AEMU_SCOPED_TRACE("vkCmdDebugMarkerInsertEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDebugMarkerInsertEXT(commandBuffer, pMarkerInfo, true /* do lock */);
+}
+#endif
+#ifdef VK_AMD_gcn_shader
+#endif
+#ifdef VK_NV_dedicated_allocation
+#endif
+#ifdef VK_EXT_transform_feedback
+static void entry_vkCmdBindTransformFeedbackBuffersEXT(VkCommandBuffer commandBuffer,
+                                                       uint32_t firstBinding, uint32_t bindingCount,
+                                                       const VkBuffer* pBuffers,
+                                                       const VkDeviceSize* pOffsets,
+                                                       const VkDeviceSize* pSizes) {
+    AEMU_SCOPED_TRACE("vkCmdBindTransformFeedbackBuffersEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBindTransformFeedbackBuffersEXT(commandBuffer, firstBinding, bindingCount, pBuffers,
+                                                pOffsets, pSizes, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdBindTransformFeedbackBuffersEXT(
+    VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount,
+    const VkBuffer* pBuffers, const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_transform_feedback")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdBindTransformFeedbackBuffersEXT",
+                                         "VK_EXT_transform_feedback");
+    }
+    AEMU_SCOPED_TRACE("vkCmdBindTransformFeedbackBuffersEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBindTransformFeedbackBuffersEXT(commandBuffer, firstBinding, bindingCount, pBuffers,
+                                                pOffsets, pSizes, true /* do lock */);
+}
+static void entry_vkCmdBeginTransformFeedbackEXT(VkCommandBuffer commandBuffer,
+                                                 uint32_t firstCounterBuffer,
+                                                 uint32_t counterBufferCount,
+                                                 const VkBuffer* pCounterBuffers,
+                                                 const VkDeviceSize* pCounterBufferOffsets) {
+    AEMU_SCOPED_TRACE("vkCmdBeginTransformFeedbackEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBeginTransformFeedbackEXT(commandBuffer, firstCounterBuffer, counterBufferCount,
+                                          pCounterBuffers, pCounterBufferOffsets,
+                                          true /* do lock */);
+}
+static void dynCheck_entry_vkCmdBeginTransformFeedbackEXT(
+    VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount,
+    const VkBuffer* pCounterBuffers, const VkDeviceSize* pCounterBufferOffsets) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_transform_feedback")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdBeginTransformFeedbackEXT",
+                                         "VK_EXT_transform_feedback");
+    }
+    AEMU_SCOPED_TRACE("vkCmdBeginTransformFeedbackEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBeginTransformFeedbackEXT(commandBuffer, firstCounterBuffer, counterBufferCount,
+                                          pCounterBuffers, pCounterBufferOffsets,
+                                          true /* do lock */);
+}
+static void entry_vkCmdEndTransformFeedbackEXT(VkCommandBuffer commandBuffer,
+                                               uint32_t firstCounterBuffer,
+                                               uint32_t counterBufferCount,
+                                               const VkBuffer* pCounterBuffers,
+                                               const VkDeviceSize* pCounterBufferOffsets) {
+    AEMU_SCOPED_TRACE("vkCmdEndTransformFeedbackEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdEndTransformFeedbackEXT(commandBuffer, firstCounterBuffer, counterBufferCount,
+                                        pCounterBuffers, pCounterBufferOffsets, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdEndTransformFeedbackEXT(VkCommandBuffer commandBuffer,
+                                                        uint32_t firstCounterBuffer,
+                                                        uint32_t counterBufferCount,
+                                                        const VkBuffer* pCounterBuffers,
+                                                        const VkDeviceSize* pCounterBufferOffsets) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_transform_feedback")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdEndTransformFeedbackEXT",
+                                         "VK_EXT_transform_feedback");
+    }
+    AEMU_SCOPED_TRACE("vkCmdEndTransformFeedbackEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdEndTransformFeedbackEXT(commandBuffer, firstCounterBuffer, counterBufferCount,
+                                        pCounterBuffers, pCounterBufferOffsets, true /* do lock */);
+}
+static void entry_vkCmdBeginQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool,
+                                            uint32_t query, VkQueryControlFlags flags,
+                                            uint32_t index) {
+    AEMU_SCOPED_TRACE("vkCmdBeginQueryIndexedEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBeginQueryIndexedEXT(commandBuffer, queryPool, query, flags, index,
+                                     true /* do lock */);
+}
+static void dynCheck_entry_vkCmdBeginQueryIndexedEXT(VkCommandBuffer commandBuffer,
+                                                     VkQueryPool queryPool, uint32_t query,
+                                                     VkQueryControlFlags flags, uint32_t index) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_transform_feedback")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdBeginQueryIndexedEXT", "VK_EXT_transform_feedback");
+    }
+    AEMU_SCOPED_TRACE("vkCmdBeginQueryIndexedEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBeginQueryIndexedEXT(commandBuffer, queryPool, query, flags, index,
+                                     true /* do lock */);
+}
+static void entry_vkCmdEndQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool,
+                                          uint32_t query, uint32_t index) {
+    AEMU_SCOPED_TRACE("vkCmdEndQueryIndexedEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdEndQueryIndexedEXT(commandBuffer, queryPool, query, index, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdEndQueryIndexedEXT(VkCommandBuffer commandBuffer,
+                                                   VkQueryPool queryPool, uint32_t query,
+                                                   uint32_t index) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_transform_feedback")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdEndQueryIndexedEXT", "VK_EXT_transform_feedback");
+    }
+    AEMU_SCOPED_TRACE("vkCmdEndQueryIndexedEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdEndQueryIndexedEXT(commandBuffer, queryPool, query, index, true /* do lock */);
+}
+static void entry_vkCmdDrawIndirectByteCountEXT(VkCommandBuffer commandBuffer,
+                                                uint32_t instanceCount, uint32_t firstInstance,
+                                                VkBuffer counterBuffer,
+                                                VkDeviceSize counterBufferOffset,
+                                                uint32_t counterOffset, uint32_t vertexStride) {
+    AEMU_SCOPED_TRACE("vkCmdDrawIndirectByteCountEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDrawIndirectByteCountEXT(commandBuffer, instanceCount, firstInstance, counterBuffer,
+                                         counterBufferOffset, counterOffset, vertexStride,
+                                         true /* do lock */);
+}
+static void dynCheck_entry_vkCmdDrawIndirectByteCountEXT(
+    VkCommandBuffer commandBuffer, uint32_t instanceCount, uint32_t firstInstance,
+    VkBuffer counterBuffer, VkDeviceSize counterBufferOffset, uint32_t counterOffset,
+    uint32_t vertexStride) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_transform_feedback")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdDrawIndirectByteCountEXT",
+                                         "VK_EXT_transform_feedback");
+    }
+    AEMU_SCOPED_TRACE("vkCmdDrawIndirectByteCountEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDrawIndirectByteCountEXT(commandBuffer, instanceCount, firstInstance, counterBuffer,
+                                         counterBufferOffset, counterOffset, vertexStride,
+                                         true /* do lock */);
+}
+#endif
+#ifdef VK_NVX_binary_import
+static VkResult entry_vkCreateCuModuleNVX(VkDevice device,
+                                          const VkCuModuleCreateInfoNVX* pCreateInfo,
+                                          const VkAllocationCallbacks* pAllocator,
+                                          VkCuModuleNVX* pModule) {
+    AEMU_SCOPED_TRACE("vkCreateCuModuleNVX");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateCuModuleNVX_VkResult_return = (VkResult)0;
+    vkCreateCuModuleNVX_VkResult_return =
+        vkEnc->vkCreateCuModuleNVX(device, pCreateInfo, pAllocator, pModule, true /* do lock */);
+    return vkCreateCuModuleNVX_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCreateCuModuleNVX(VkDevice device,
+                                                   const VkCuModuleCreateInfoNVX* pCreateInfo,
+                                                   const VkAllocationCallbacks* pAllocator,
+                                                   VkCuModuleNVX* pModule) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_NVX_binary_import")) {
+        sOnInvalidDynamicallyCheckedCall("vkCreateCuModuleNVX", "VK_NVX_binary_import");
+    }
+    AEMU_SCOPED_TRACE("vkCreateCuModuleNVX");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateCuModuleNVX_VkResult_return = (VkResult)0;
+    vkCreateCuModuleNVX_VkResult_return =
+        vkEnc->vkCreateCuModuleNVX(device, pCreateInfo, pAllocator, pModule, true /* do lock */);
+    return vkCreateCuModuleNVX_VkResult_return;
+}
+static VkResult entry_vkCreateCuFunctionNVX(VkDevice device,
+                                            const VkCuFunctionCreateInfoNVX* pCreateInfo,
+                                            const VkAllocationCallbacks* pAllocator,
+                                            VkCuFunctionNVX* pFunction) {
+    AEMU_SCOPED_TRACE("vkCreateCuFunctionNVX");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateCuFunctionNVX_VkResult_return = (VkResult)0;
+    vkCreateCuFunctionNVX_VkResult_return = vkEnc->vkCreateCuFunctionNVX(
+        device, pCreateInfo, pAllocator, pFunction, true /* do lock */);
+    return vkCreateCuFunctionNVX_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCreateCuFunctionNVX(VkDevice device,
+                                                     const VkCuFunctionCreateInfoNVX* pCreateInfo,
+                                                     const VkAllocationCallbacks* pAllocator,
+                                                     VkCuFunctionNVX* pFunction) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_NVX_binary_import")) {
+        sOnInvalidDynamicallyCheckedCall("vkCreateCuFunctionNVX", "VK_NVX_binary_import");
+    }
+    AEMU_SCOPED_TRACE("vkCreateCuFunctionNVX");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateCuFunctionNVX_VkResult_return = (VkResult)0;
+    vkCreateCuFunctionNVX_VkResult_return = vkEnc->vkCreateCuFunctionNVX(
+        device, pCreateInfo, pAllocator, pFunction, true /* do lock */);
+    return vkCreateCuFunctionNVX_VkResult_return;
+}
+static void entry_vkDestroyCuModuleNVX(VkDevice device, VkCuModuleNVX module,
+                                       const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyCuModuleNVX");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyCuModuleNVX(device, module, pAllocator, true /* do lock */);
+}
+static void dynCheck_entry_vkDestroyCuModuleNVX(VkDevice device, VkCuModuleNVX module,
+                                                const VkAllocationCallbacks* pAllocator) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_NVX_binary_import")) {
+        sOnInvalidDynamicallyCheckedCall("vkDestroyCuModuleNVX", "VK_NVX_binary_import");
+    }
+    AEMU_SCOPED_TRACE("vkDestroyCuModuleNVX");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyCuModuleNVX(device, module, pAllocator, true /* do lock */);
+}
+static void entry_vkDestroyCuFunctionNVX(VkDevice device, VkCuFunctionNVX function,
+                                         const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyCuFunctionNVX");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyCuFunctionNVX(device, function, pAllocator, true /* do lock */);
+}
+static void dynCheck_entry_vkDestroyCuFunctionNVX(VkDevice device, VkCuFunctionNVX function,
+                                                  const VkAllocationCallbacks* pAllocator) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_NVX_binary_import")) {
+        sOnInvalidDynamicallyCheckedCall("vkDestroyCuFunctionNVX", "VK_NVX_binary_import");
+    }
+    AEMU_SCOPED_TRACE("vkDestroyCuFunctionNVX");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyCuFunctionNVX(device, function, pAllocator, true /* do lock */);
+}
+static void entry_vkCmdCuLaunchKernelNVX(VkCommandBuffer commandBuffer,
+                                         const VkCuLaunchInfoNVX* pLaunchInfo) {
+    AEMU_SCOPED_TRACE("vkCmdCuLaunchKernelNVX");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdCuLaunchKernelNVX(commandBuffer, pLaunchInfo, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdCuLaunchKernelNVX(VkCommandBuffer commandBuffer,
+                                                  const VkCuLaunchInfoNVX* pLaunchInfo) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_NVX_binary_import")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdCuLaunchKernelNVX", "VK_NVX_binary_import");
+    }
+    AEMU_SCOPED_TRACE("vkCmdCuLaunchKernelNVX");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdCuLaunchKernelNVX(commandBuffer, pLaunchInfo, true /* do lock */);
+}
+#endif
+#ifdef VK_NVX_image_view_handle
+static uint32_t entry_vkGetImageViewHandleNVX(VkDevice device,
+                                              const VkImageViewHandleInfoNVX* pInfo) {
+    AEMU_SCOPED_TRACE("vkGetImageViewHandleNVX");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    uint32_t vkGetImageViewHandleNVX_uint32_t_return = (uint32_t)0;
+    vkGetImageViewHandleNVX_uint32_t_return =
+        vkEnc->vkGetImageViewHandleNVX(device, pInfo, true /* do lock */);
+    return vkGetImageViewHandleNVX_uint32_t_return;
+}
+static uint32_t dynCheck_entry_vkGetImageViewHandleNVX(VkDevice device,
+                                                       const VkImageViewHandleInfoNVX* pInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_NVX_image_view_handle")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetImageViewHandleNVX", "VK_NVX_image_view_handle");
+    }
+    AEMU_SCOPED_TRACE("vkGetImageViewHandleNVX");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    uint32_t vkGetImageViewHandleNVX_uint32_t_return = (uint32_t)0;
+    vkGetImageViewHandleNVX_uint32_t_return =
+        vkEnc->vkGetImageViewHandleNVX(device, pInfo, true /* do lock */);
+    return vkGetImageViewHandleNVX_uint32_t_return;
+}
+static VkResult entry_vkGetImageViewAddressNVX(VkDevice device, VkImageView imageView,
+                                               VkImageViewAddressPropertiesNVX* pProperties) {
+    AEMU_SCOPED_TRACE("vkGetImageViewAddressNVX");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetImageViewAddressNVX_VkResult_return = (VkResult)0;
+    vkGetImageViewAddressNVX_VkResult_return =
+        vkEnc->vkGetImageViewAddressNVX(device, imageView, pProperties, true /* do lock */);
+    return vkGetImageViewAddressNVX_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetImageViewAddressNVX(
+    VkDevice device, VkImageView imageView, VkImageViewAddressPropertiesNVX* pProperties) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_NVX_image_view_handle")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetImageViewAddressNVX", "VK_NVX_image_view_handle");
+    }
+    AEMU_SCOPED_TRACE("vkGetImageViewAddressNVX");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetImageViewAddressNVX_VkResult_return = (VkResult)0;
+    vkGetImageViewAddressNVX_VkResult_return =
+        vkEnc->vkGetImageViewAddressNVX(device, imageView, pProperties, true /* do lock */);
+    return vkGetImageViewAddressNVX_VkResult_return;
+}
+#endif
+#ifdef VK_AMD_draw_indirect_count
+static void entry_vkCmdDrawIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                            VkDeviceSize offset, VkBuffer countBuffer,
+                                            VkDeviceSize countBufferOffset, uint32_t maxDrawCount,
+                                            uint32_t stride) {
+    AEMU_SCOPED_TRACE("vkCmdDrawIndirectCountAMD");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDrawIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset,
+                                     maxDrawCount, stride, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdDrawIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                                     VkDeviceSize offset, VkBuffer countBuffer,
+                                                     VkDeviceSize countBufferOffset,
+                                                     uint32_t maxDrawCount, uint32_t stride) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_AMD_draw_indirect_count")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdDrawIndirectCountAMD", "VK_AMD_draw_indirect_count");
+    }
+    AEMU_SCOPED_TRACE("vkCmdDrawIndirectCountAMD");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDrawIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset,
+                                     maxDrawCount, stride, true /* do lock */);
+}
+static void entry_vkCmdDrawIndexedIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                                   VkDeviceSize offset, VkBuffer countBuffer,
+                                                   VkDeviceSize countBufferOffset,
+                                                   uint32_t maxDrawCount, uint32_t stride) {
+    AEMU_SCOPED_TRACE("vkCmdDrawIndexedIndirectCountAMD");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDrawIndexedIndirectCountAMD(commandBuffer, buffer, offset, countBuffer,
+                                            countBufferOffset, maxDrawCount, stride,
+                                            true /* do lock */);
+}
+static void dynCheck_entry_vkCmdDrawIndexedIndirectCountAMD(
+    VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer,
+    VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_AMD_draw_indirect_count")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdDrawIndexedIndirectCountAMD",
+                                         "VK_AMD_draw_indirect_count");
+    }
+    AEMU_SCOPED_TRACE("vkCmdDrawIndexedIndirectCountAMD");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDrawIndexedIndirectCountAMD(commandBuffer, buffer, offset, countBuffer,
+                                            countBufferOffset, maxDrawCount, stride,
+                                            true /* do lock */);
+}
+#endif
+#ifdef VK_AMD_negative_viewport_height
+#endif
+#ifdef VK_AMD_gpu_shader_half_float
+#endif
+#ifdef VK_AMD_shader_ballot
+#endif
+#ifdef VK_EXT_video_encode_h264
+#endif
+#ifdef VK_EXT_video_encode_h265
+#endif
+#ifdef VK_EXT_video_decode_h264
+#endif
+#ifdef VK_AMD_texture_gather_bias_lod
+#endif
+#ifdef VK_AMD_shader_info
+static VkResult entry_vkGetShaderInfoAMD(VkDevice device, VkPipeline pipeline,
+                                         VkShaderStageFlagBits shaderStage,
+                                         VkShaderInfoTypeAMD infoType, size_t* pInfoSize,
+                                         void* pInfo) {
+    AEMU_SCOPED_TRACE("vkGetShaderInfoAMD");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetShaderInfoAMD_VkResult_return = (VkResult)0;
+    vkGetShaderInfoAMD_VkResult_return = vkEnc->vkGetShaderInfoAMD(
+        device, pipeline, shaderStage, infoType, pInfoSize, pInfo, true /* do lock */);
+    return vkGetShaderInfoAMD_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetShaderInfoAMD(VkDevice device, VkPipeline pipeline,
+                                                  VkShaderStageFlagBits shaderStage,
+                                                  VkShaderInfoTypeAMD infoType, size_t* pInfoSize,
+                                                  void* pInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_AMD_shader_info")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetShaderInfoAMD", "VK_AMD_shader_info");
+    }
+    AEMU_SCOPED_TRACE("vkGetShaderInfoAMD");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetShaderInfoAMD_VkResult_return = (VkResult)0;
+    vkGetShaderInfoAMD_VkResult_return = vkEnc->vkGetShaderInfoAMD(
+        device, pipeline, shaderStage, infoType, pInfoSize, pInfo, true /* do lock */);
+    return vkGetShaderInfoAMD_VkResult_return;
+}
+#endif
+#ifdef VK_AMD_shader_image_load_store_lod
+#endif
+#ifdef VK_GGP_stream_descriptor_surface
+static VkResult entry_vkCreateStreamDescriptorSurfaceGGP(
+    VkInstance instance, const VkStreamDescriptorSurfaceCreateInfoGGP* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) {
+    AEMU_SCOPED_TRACE("vkCreateStreamDescriptorSurfaceGGP");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateStreamDescriptorSurfaceGGP_VkResult_return = (VkResult)0;
+    vkCreateStreamDescriptorSurfaceGGP_VkResult_return = vkEnc->vkCreateStreamDescriptorSurfaceGGP(
+        instance, pCreateInfo, pAllocator, pSurface, true /* do lock */);
+    return vkCreateStreamDescriptorSurfaceGGP_VkResult_return;
+}
+#endif
+#ifdef VK_NV_corner_sampled_image
+#endif
+#ifdef VK_IMG_format_pvrtc
+#endif
+#ifdef VK_NV_external_memory_capabilities
+static VkResult entry_vkGetPhysicalDeviceExternalImageFormatPropertiesNV(
+    VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling,
+    VkImageUsageFlags usage, VkImageCreateFlags flags,
+    VkExternalMemoryHandleTypeFlagsNV externalHandleType,
+    VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalImageFormatPropertiesNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return = (VkResult)0;
+    vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return =
+        vkEnc->vkGetPhysicalDeviceExternalImageFormatPropertiesNV(
+            physicalDevice, format, type, tiling, usage, flags, externalHandleType,
+            pExternalImageFormatProperties, true /* do lock */);
+    return vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return;
+}
+#endif
+#ifdef VK_NV_external_memory
+#endif
+#ifdef VK_NV_external_memory_win32
+static VkResult entry_vkGetMemoryWin32HandleNV(VkDevice device, VkDeviceMemory memory,
+                                               VkExternalMemoryHandleTypeFlagsNV handleType,
+                                               HANDLE* pHandle) {
+    AEMU_SCOPED_TRACE("vkGetMemoryWin32HandleNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetMemoryWin32HandleNV_VkResult_return = (VkResult)0;
+    vkGetMemoryWin32HandleNV_VkResult_return =
+        vkEnc->vkGetMemoryWin32HandleNV(device, memory, handleType, pHandle, true /* do lock */);
+    return vkGetMemoryWin32HandleNV_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetMemoryWin32HandleNV(
+    VkDevice device, VkDeviceMemory memory, VkExternalMemoryHandleTypeFlagsNV handleType,
+    HANDLE* pHandle) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_NV_external_memory_win32")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetMemoryWin32HandleNV", "VK_NV_external_memory_win32");
+    }
+    AEMU_SCOPED_TRACE("vkGetMemoryWin32HandleNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetMemoryWin32HandleNV_VkResult_return = (VkResult)0;
+    vkGetMemoryWin32HandleNV_VkResult_return =
+        vkEnc->vkGetMemoryWin32HandleNV(device, memory, handleType, pHandle, true /* do lock */);
+    return vkGetMemoryWin32HandleNV_VkResult_return;
+}
+#endif
+#ifdef VK_NV_win32_keyed_mutex
+#endif
+#ifdef VK_EXT_validation_flags
+#endif
+#ifdef VK_NN_vi_surface
+static VkResult entry_vkCreateViSurfaceNN(VkInstance instance,
+                                          const VkViSurfaceCreateInfoNN* pCreateInfo,
+                                          const VkAllocationCallbacks* pAllocator,
+                                          VkSurfaceKHR* pSurface) {
+    AEMU_SCOPED_TRACE("vkCreateViSurfaceNN");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateViSurfaceNN_VkResult_return = (VkResult)0;
+    vkCreateViSurfaceNN_VkResult_return =
+        vkEnc->vkCreateViSurfaceNN(instance, pCreateInfo, pAllocator, pSurface, true /* do lock */);
+    return vkCreateViSurfaceNN_VkResult_return;
+}
+#endif
+#ifdef VK_EXT_shader_subgroup_ballot
+#endif
+#ifdef VK_EXT_shader_subgroup_vote
+#endif
+#ifdef VK_EXT_texture_compression_astc_hdr
+#endif
+#ifdef VK_EXT_astc_decode_mode
+#endif
+#ifdef VK_EXT_conditional_rendering
+static void entry_vkCmdBeginConditionalRenderingEXT(
+    VkCommandBuffer commandBuffer,
+    const VkConditionalRenderingBeginInfoEXT* pConditionalRenderingBegin) {
+    AEMU_SCOPED_TRACE("vkCmdBeginConditionalRenderingEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBeginConditionalRenderingEXT(commandBuffer, pConditionalRenderingBegin,
+                                             true /* do lock */);
+}
+static void dynCheck_entry_vkCmdBeginConditionalRenderingEXT(
+    VkCommandBuffer commandBuffer,
+    const VkConditionalRenderingBeginInfoEXT* pConditionalRenderingBegin) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_conditional_rendering")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdBeginConditionalRenderingEXT",
+                                         "VK_EXT_conditional_rendering");
+    }
+    AEMU_SCOPED_TRACE("vkCmdBeginConditionalRenderingEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBeginConditionalRenderingEXT(commandBuffer, pConditionalRenderingBegin,
+                                             true /* do lock */);
+}
+static void entry_vkCmdEndConditionalRenderingEXT(VkCommandBuffer commandBuffer) {
+    AEMU_SCOPED_TRACE("vkCmdEndConditionalRenderingEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdEndConditionalRenderingEXT(commandBuffer, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdEndConditionalRenderingEXT(VkCommandBuffer commandBuffer) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_conditional_rendering")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdEndConditionalRenderingEXT",
+                                         "VK_EXT_conditional_rendering");
+    }
+    AEMU_SCOPED_TRACE("vkCmdEndConditionalRenderingEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdEndConditionalRenderingEXT(commandBuffer, true /* do lock */);
+}
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+static void entry_vkCmdSetViewportWScalingNV(VkCommandBuffer commandBuffer, uint32_t firstViewport,
+                                             uint32_t viewportCount,
+                                             const VkViewportWScalingNV* pViewportWScalings) {
+    AEMU_SCOPED_TRACE("vkCmdSetViewportWScalingNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetViewportWScalingNV(commandBuffer, firstViewport, viewportCount,
+                                      pViewportWScalings, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetViewportWScalingNV(
+    VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount,
+    const VkViewportWScalingNV* pViewportWScalings) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_NV_clip_space_w_scaling")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetViewportWScalingNV",
+                                         "VK_NV_clip_space_w_scaling");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetViewportWScalingNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetViewportWScalingNV(commandBuffer, firstViewport, viewportCount,
+                                      pViewportWScalings, true /* do lock */);
+}
+#endif
+#ifdef VK_EXT_direct_mode_display
+static VkResult entry_vkReleaseDisplayEXT(VkPhysicalDevice physicalDevice, VkDisplayKHR display) {
+    AEMU_SCOPED_TRACE("vkReleaseDisplayEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkReleaseDisplayEXT_VkResult_return = (VkResult)0;
+    vkReleaseDisplayEXT_VkResult_return =
+        vkEnc->vkReleaseDisplayEXT(physicalDevice, display, true /* do lock */);
+    return vkReleaseDisplayEXT_VkResult_return;
+}
+#endif
+#ifdef VK_EXT_acquire_xlib_display
+static VkResult entry_vkAcquireXlibDisplayEXT(VkPhysicalDevice physicalDevice, Display* dpy,
+                                              VkDisplayKHR display) {
+    AEMU_SCOPED_TRACE("vkAcquireXlibDisplayEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkAcquireXlibDisplayEXT_VkResult_return = (VkResult)0;
+    vkAcquireXlibDisplayEXT_VkResult_return =
+        vkEnc->vkAcquireXlibDisplayEXT(physicalDevice, dpy, display, true /* do lock */);
+    return vkAcquireXlibDisplayEXT_VkResult_return;
+}
+static VkResult entry_vkGetRandROutputDisplayEXT(VkPhysicalDevice physicalDevice, Display* dpy,
+                                                 RROutput rrOutput, VkDisplayKHR* pDisplay) {
+    AEMU_SCOPED_TRACE("vkGetRandROutputDisplayEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetRandROutputDisplayEXT_VkResult_return = (VkResult)0;
+    vkGetRandROutputDisplayEXT_VkResult_return = vkEnc->vkGetRandROutputDisplayEXT(
+        physicalDevice, dpy, rrOutput, pDisplay, true /* do lock */);
+    return vkGetRandROutputDisplayEXT_VkResult_return;
+}
+#endif
+#ifdef VK_EXT_display_surface_counter
+static VkResult entry_vkGetPhysicalDeviceSurfaceCapabilities2EXT(
+    VkPhysicalDevice physicalDevice, VkSurfaceKHR surface,
+    VkSurfaceCapabilities2EXT* pSurfaceCapabilities) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceCapabilities2EXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return = (VkResult)0;
+    vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return =
+        vkEnc->vkGetPhysicalDeviceSurfaceCapabilities2EXT(physicalDevice, surface,
+                                                          pSurfaceCapabilities, true /* do lock */);
+    return vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return;
+}
+#endif
+#ifdef VK_EXT_display_control
+static VkResult entry_vkDisplayPowerControlEXT(VkDevice device, VkDisplayKHR display,
+                                               const VkDisplayPowerInfoEXT* pDisplayPowerInfo) {
+    AEMU_SCOPED_TRACE("vkDisplayPowerControlEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkDisplayPowerControlEXT_VkResult_return = (VkResult)0;
+    vkDisplayPowerControlEXT_VkResult_return =
+        vkEnc->vkDisplayPowerControlEXT(device, display, pDisplayPowerInfo, true /* do lock */);
+    return vkDisplayPowerControlEXT_VkResult_return;
+}
+static VkResult dynCheck_entry_vkDisplayPowerControlEXT(
+    VkDevice device, VkDisplayKHR display, const VkDisplayPowerInfoEXT* pDisplayPowerInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_EXT_display_control")) {
+        sOnInvalidDynamicallyCheckedCall("vkDisplayPowerControlEXT", "VK_EXT_display_control");
+    }
+    AEMU_SCOPED_TRACE("vkDisplayPowerControlEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkDisplayPowerControlEXT_VkResult_return = (VkResult)0;
+    vkDisplayPowerControlEXT_VkResult_return =
+        vkEnc->vkDisplayPowerControlEXT(device, display, pDisplayPowerInfo, true /* do lock */);
+    return vkDisplayPowerControlEXT_VkResult_return;
+}
+static VkResult entry_vkRegisterDeviceEventEXT(VkDevice device,
+                                               const VkDeviceEventInfoEXT* pDeviceEventInfo,
+                                               const VkAllocationCallbacks* pAllocator,
+                                               VkFence* pFence) {
+    AEMU_SCOPED_TRACE("vkRegisterDeviceEventEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkRegisterDeviceEventEXT_VkResult_return = (VkResult)0;
+    vkRegisterDeviceEventEXT_VkResult_return = vkEnc->vkRegisterDeviceEventEXT(
+        device, pDeviceEventInfo, pAllocator, pFence, true /* do lock */);
+    return vkRegisterDeviceEventEXT_VkResult_return;
+}
+static VkResult dynCheck_entry_vkRegisterDeviceEventEXT(
+    VkDevice device, const VkDeviceEventInfoEXT* pDeviceEventInfo,
+    const VkAllocationCallbacks* pAllocator, VkFence* pFence) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_EXT_display_control")) {
+        sOnInvalidDynamicallyCheckedCall("vkRegisterDeviceEventEXT", "VK_EXT_display_control");
+    }
+    AEMU_SCOPED_TRACE("vkRegisterDeviceEventEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkRegisterDeviceEventEXT_VkResult_return = (VkResult)0;
+    vkRegisterDeviceEventEXT_VkResult_return = vkEnc->vkRegisterDeviceEventEXT(
+        device, pDeviceEventInfo, pAllocator, pFence, true /* do lock */);
+    return vkRegisterDeviceEventEXT_VkResult_return;
+}
+static VkResult entry_vkRegisterDisplayEventEXT(VkDevice device, VkDisplayKHR display,
+                                                const VkDisplayEventInfoEXT* pDisplayEventInfo,
+                                                const VkAllocationCallbacks* pAllocator,
+                                                VkFence* pFence) {
+    AEMU_SCOPED_TRACE("vkRegisterDisplayEventEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkRegisterDisplayEventEXT_VkResult_return = (VkResult)0;
+    vkRegisterDisplayEventEXT_VkResult_return = vkEnc->vkRegisterDisplayEventEXT(
+        device, display, pDisplayEventInfo, pAllocator, pFence, true /* do lock */);
+    return vkRegisterDisplayEventEXT_VkResult_return;
+}
+static VkResult dynCheck_entry_vkRegisterDisplayEventEXT(
+    VkDevice device, VkDisplayKHR display, const VkDisplayEventInfoEXT* pDisplayEventInfo,
+    const VkAllocationCallbacks* pAllocator, VkFence* pFence) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_EXT_display_control")) {
+        sOnInvalidDynamicallyCheckedCall("vkRegisterDisplayEventEXT", "VK_EXT_display_control");
+    }
+    AEMU_SCOPED_TRACE("vkRegisterDisplayEventEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkRegisterDisplayEventEXT_VkResult_return = (VkResult)0;
+    vkRegisterDisplayEventEXT_VkResult_return = vkEnc->vkRegisterDisplayEventEXT(
+        device, display, pDisplayEventInfo, pAllocator, pFence, true /* do lock */);
+    return vkRegisterDisplayEventEXT_VkResult_return;
+}
+static VkResult entry_vkGetSwapchainCounterEXT(VkDevice device, VkSwapchainKHR swapchain,
+                                               VkSurfaceCounterFlagBitsEXT counter,
+                                               uint64_t* pCounterValue) {
+    AEMU_SCOPED_TRACE("vkGetSwapchainCounterEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetSwapchainCounterEXT_VkResult_return = (VkResult)0;
+    vkGetSwapchainCounterEXT_VkResult_return = vkEnc->vkGetSwapchainCounterEXT(
+        device, swapchain, counter, pCounterValue, true /* do lock */);
+    return vkGetSwapchainCounterEXT_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetSwapchainCounterEXT(VkDevice device, VkSwapchainKHR swapchain,
+                                                        VkSurfaceCounterFlagBitsEXT counter,
+                                                        uint64_t* pCounterValue) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_EXT_display_control")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetSwapchainCounterEXT", "VK_EXT_display_control");
+    }
+    AEMU_SCOPED_TRACE("vkGetSwapchainCounterEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetSwapchainCounterEXT_VkResult_return = (VkResult)0;
+    vkGetSwapchainCounterEXT_VkResult_return = vkEnc->vkGetSwapchainCounterEXT(
+        device, swapchain, counter, pCounterValue, true /* do lock */);
+    return vkGetSwapchainCounterEXT_VkResult_return;
+}
+#endif
+#ifdef VK_GOOGLE_display_timing
+static VkResult entry_vkGetRefreshCycleDurationGOOGLE(
+    VkDevice device, VkSwapchainKHR swapchain,
+    VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties) {
+    AEMU_SCOPED_TRACE("vkGetRefreshCycleDurationGOOGLE");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetRefreshCycleDurationGOOGLE_VkResult_return = (VkResult)0;
+    vkGetRefreshCycleDurationGOOGLE_VkResult_return = vkEnc->vkGetRefreshCycleDurationGOOGLE(
+        device, swapchain, pDisplayTimingProperties, true /* do lock */);
+    return vkGetRefreshCycleDurationGOOGLE_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetRefreshCycleDurationGOOGLE(
+    VkDevice device, VkSwapchainKHR swapchain,
+    VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_GOOGLE_display_timing")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetRefreshCycleDurationGOOGLE",
+                                         "VK_GOOGLE_display_timing");
+    }
+    AEMU_SCOPED_TRACE("vkGetRefreshCycleDurationGOOGLE");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetRefreshCycleDurationGOOGLE_VkResult_return = (VkResult)0;
+    vkGetRefreshCycleDurationGOOGLE_VkResult_return = vkEnc->vkGetRefreshCycleDurationGOOGLE(
+        device, swapchain, pDisplayTimingProperties, true /* do lock */);
+    return vkGetRefreshCycleDurationGOOGLE_VkResult_return;
+}
+static VkResult entry_vkGetPastPresentationTimingGOOGLE(
+    VkDevice device, VkSwapchainKHR swapchain, uint32_t* pPresentationTimingCount,
+    VkPastPresentationTimingGOOGLE* pPresentationTimings) {
+    AEMU_SCOPED_TRACE("vkGetPastPresentationTimingGOOGLE");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPastPresentationTimingGOOGLE_VkResult_return = (VkResult)0;
+    vkGetPastPresentationTimingGOOGLE_VkResult_return = vkEnc->vkGetPastPresentationTimingGOOGLE(
+        device, swapchain, pPresentationTimingCount, pPresentationTimings, true /* do lock */);
+    return vkGetPastPresentationTimingGOOGLE_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetPastPresentationTimingGOOGLE(
+    VkDevice device, VkSwapchainKHR swapchain, uint32_t* pPresentationTimingCount,
+    VkPastPresentationTimingGOOGLE* pPresentationTimings) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_GOOGLE_display_timing")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetPastPresentationTimingGOOGLE",
+                                         "VK_GOOGLE_display_timing");
+    }
+    AEMU_SCOPED_TRACE("vkGetPastPresentationTimingGOOGLE");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPastPresentationTimingGOOGLE_VkResult_return = (VkResult)0;
+    vkGetPastPresentationTimingGOOGLE_VkResult_return = vkEnc->vkGetPastPresentationTimingGOOGLE(
+        device, swapchain, pPresentationTimingCount, pPresentationTimings, true /* do lock */);
+    return vkGetPastPresentationTimingGOOGLE_VkResult_return;
+}
+#endif
+#ifdef VK_NV_sample_mask_override_coverage
+#endif
+#ifdef VK_NV_geometry_shader_passthrough
+#endif
+#ifdef VK_NV_viewport_array2
+#endif
+#ifdef VK_NVX_multiview_per_view_attributes
+#endif
+#ifdef VK_NV_viewport_swizzle
+#endif
+#ifdef VK_EXT_discard_rectangles
+static void entry_vkCmdSetDiscardRectangleEXT(VkCommandBuffer commandBuffer,
+                                              uint32_t firstDiscardRectangle,
+                                              uint32_t discardRectangleCount,
+                                              const VkRect2D* pDiscardRectangles) {
+    AEMU_SCOPED_TRACE("vkCmdSetDiscardRectangleEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetDiscardRectangleEXT(commandBuffer, firstDiscardRectangle, discardRectangleCount,
+                                       pDiscardRectangles, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetDiscardRectangleEXT(VkCommandBuffer commandBuffer,
+                                                       uint32_t firstDiscardRectangle,
+                                                       uint32_t discardRectangleCount,
+                                                       const VkRect2D* pDiscardRectangles) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_discard_rectangles")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetDiscardRectangleEXT",
+                                         "VK_EXT_discard_rectangles");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetDiscardRectangleEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetDiscardRectangleEXT(commandBuffer, firstDiscardRectangle, discardRectangleCount,
+                                       pDiscardRectangles, true /* do lock */);
+}
+#endif
+#ifdef VK_EXT_conservative_rasterization
+#endif
+#ifdef VK_EXT_depth_clip_enable
+#endif
+#ifdef VK_EXT_swapchain_colorspace
+#endif
+#ifdef VK_EXT_hdr_metadata
+static void entry_vkSetHdrMetadataEXT(VkDevice device, uint32_t swapchainCount,
+                                      const VkSwapchainKHR* pSwapchains,
+                                      const VkHdrMetadataEXT* pMetadata) {
+    AEMU_SCOPED_TRACE("vkSetHdrMetadataEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkSetHdrMetadataEXT(device, swapchainCount, pSwapchains, pMetadata, true /* do lock */);
+}
+static void dynCheck_entry_vkSetHdrMetadataEXT(VkDevice device, uint32_t swapchainCount,
+                                               const VkSwapchainKHR* pSwapchains,
+                                               const VkHdrMetadataEXT* pMetadata) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_EXT_hdr_metadata")) {
+        sOnInvalidDynamicallyCheckedCall("vkSetHdrMetadataEXT", "VK_EXT_hdr_metadata");
+    }
+    AEMU_SCOPED_TRACE("vkSetHdrMetadataEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkSetHdrMetadataEXT(device, swapchainCount, pSwapchains, pMetadata, true /* do lock */);
+}
+#endif
+#ifdef VK_MVK_ios_surface
+static VkResult entry_vkCreateIOSSurfaceMVK(VkInstance instance,
+                                            const VkIOSSurfaceCreateInfoMVK* pCreateInfo,
+                                            const VkAllocationCallbacks* pAllocator,
+                                            VkSurfaceKHR* pSurface) {
+    AEMU_SCOPED_TRACE("vkCreateIOSSurfaceMVK");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateIOSSurfaceMVK_VkResult_return = (VkResult)0;
+    vkCreateIOSSurfaceMVK_VkResult_return = vkEnc->vkCreateIOSSurfaceMVK(
+        instance, pCreateInfo, pAllocator, pSurface, true /* do lock */);
+    return vkCreateIOSSurfaceMVK_VkResult_return;
+}
+#endif
+#ifdef VK_MVK_macos_surface
+static VkResult entry_vkCreateMacOSSurfaceMVK(VkInstance instance,
+                                              const VkMacOSSurfaceCreateInfoMVK* pCreateInfo,
+                                              const VkAllocationCallbacks* pAllocator,
+                                              VkSurfaceKHR* pSurface) {
+    AEMU_SCOPED_TRACE("vkCreateMacOSSurfaceMVK");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateMacOSSurfaceMVK_VkResult_return = (VkResult)0;
+    vkCreateMacOSSurfaceMVK_VkResult_return = vkEnc->vkCreateMacOSSurfaceMVK(
+        instance, pCreateInfo, pAllocator, pSurface, true /* do lock */);
+    return vkCreateMacOSSurfaceMVK_VkResult_return;
+}
+#endif
+#ifdef VK_MVK_moltenvk
+static void entry_vkGetMTLDeviceMVK(VkPhysicalDevice physicalDevice, void** pMTLDevice) {
+    AEMU_SCOPED_TRACE("vkGetMTLDeviceMVK");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetMTLDeviceMVK(physicalDevice, pMTLDevice, true /* do lock */);
+}
+static VkResult entry_vkSetMTLTextureMVK(VkImage image, void* mtlTexture) {
+    AEMU_SCOPED_TRACE("vkSetMTLTextureMVK");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkSetMTLTextureMVK_VkResult_return = (VkResult)0;
+    vkSetMTLTextureMVK_VkResult_return =
+        vkEnc->vkSetMTLTextureMVK(image, mtlTexture, true /* do lock */);
+    return vkSetMTLTextureMVK_VkResult_return;
+}
+static void entry_vkGetMTLTextureMVK(VkImage image, void** pMTLTexture) {
+    AEMU_SCOPED_TRACE("vkGetMTLTextureMVK");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetMTLTextureMVK(image, pMTLTexture, true /* do lock */);
+}
+static void entry_vkGetMTLBufferMVK(VkBuffer buffer, void** pMTLBuffer) {
+    AEMU_SCOPED_TRACE("vkGetMTLBufferMVK");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetMTLBufferMVK(buffer, pMTLBuffer, true /* do lock */);
+}
+static VkResult entry_vkUseIOSurfaceMVK(VkImage image, void* ioSurface) {
+    AEMU_SCOPED_TRACE("vkUseIOSurfaceMVK");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkUseIOSurfaceMVK_VkResult_return = (VkResult)0;
+    vkUseIOSurfaceMVK_VkResult_return =
+        vkEnc->vkUseIOSurfaceMVK(image, ioSurface, true /* do lock */);
+    return vkUseIOSurfaceMVK_VkResult_return;
+}
+static void entry_vkGetIOSurfaceMVK(VkImage image, void** pIOSurface) {
+    AEMU_SCOPED_TRACE("vkGetIOSurfaceMVK");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetIOSurfaceMVK(image, pIOSurface, true /* do lock */);
+}
+#endif
+#ifdef VK_EXT_external_memory_dma_buf
+#endif
+#ifdef VK_EXT_queue_family_foreign
+#endif
+#ifdef VK_EXT_debug_utils
+static VkResult entry_vkSetDebugUtilsObjectNameEXT(VkDevice device,
+                                                   const VkDebugUtilsObjectNameInfoEXT* pNameInfo) {
+    AEMU_SCOPED_TRACE("vkSetDebugUtilsObjectNameEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkSetDebugUtilsObjectNameEXT_VkResult_return = (VkResult)0;
+    vkSetDebugUtilsObjectNameEXT_VkResult_return =
+        vkEnc->vkSetDebugUtilsObjectNameEXT(device, pNameInfo, true /* do lock */);
+    return vkSetDebugUtilsObjectNameEXT_VkResult_return;
+}
+static VkResult dynCheck_entry_vkSetDebugUtilsObjectNameEXT(
+    VkDevice device, const VkDebugUtilsObjectNameInfoEXT* pNameInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_EXT_debug_utils")) {
+        sOnInvalidDynamicallyCheckedCall("vkSetDebugUtilsObjectNameEXT", "VK_EXT_debug_utils");
+    }
+    AEMU_SCOPED_TRACE("vkSetDebugUtilsObjectNameEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkSetDebugUtilsObjectNameEXT_VkResult_return = (VkResult)0;
+    vkSetDebugUtilsObjectNameEXT_VkResult_return =
+        vkEnc->vkSetDebugUtilsObjectNameEXT(device, pNameInfo, true /* do lock */);
+    return vkSetDebugUtilsObjectNameEXT_VkResult_return;
+}
+static VkResult entry_vkSetDebugUtilsObjectTagEXT(VkDevice device,
+                                                  const VkDebugUtilsObjectTagInfoEXT* pTagInfo) {
+    AEMU_SCOPED_TRACE("vkSetDebugUtilsObjectTagEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkSetDebugUtilsObjectTagEXT_VkResult_return = (VkResult)0;
+    vkSetDebugUtilsObjectTagEXT_VkResult_return =
+        vkEnc->vkSetDebugUtilsObjectTagEXT(device, pTagInfo, true /* do lock */);
+    return vkSetDebugUtilsObjectTagEXT_VkResult_return;
+}
+static VkResult dynCheck_entry_vkSetDebugUtilsObjectTagEXT(
+    VkDevice device, const VkDebugUtilsObjectTagInfoEXT* pTagInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_EXT_debug_utils")) {
+        sOnInvalidDynamicallyCheckedCall("vkSetDebugUtilsObjectTagEXT", "VK_EXT_debug_utils");
+    }
+    AEMU_SCOPED_TRACE("vkSetDebugUtilsObjectTagEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkSetDebugUtilsObjectTagEXT_VkResult_return = (VkResult)0;
+    vkSetDebugUtilsObjectTagEXT_VkResult_return =
+        vkEnc->vkSetDebugUtilsObjectTagEXT(device, pTagInfo, true /* do lock */);
+    return vkSetDebugUtilsObjectTagEXT_VkResult_return;
+}
+static void entry_vkQueueBeginDebugUtilsLabelEXT(VkQueue queue,
+                                                 const VkDebugUtilsLabelEXT* pLabelInfo) {
+    AEMU_SCOPED_TRACE("vkQueueBeginDebugUtilsLabelEXT");
+    auto vkEnc = ResourceTracker::getQueueEncoder(queue);
+    vkEnc->vkQueueBeginDebugUtilsLabelEXT(queue, pLabelInfo, true /* do lock */);
+}
+static void entry_vkQueueEndDebugUtilsLabelEXT(VkQueue queue) {
+    AEMU_SCOPED_TRACE("vkQueueEndDebugUtilsLabelEXT");
+    auto vkEnc = ResourceTracker::getQueueEncoder(queue);
+    vkEnc->vkQueueEndDebugUtilsLabelEXT(queue, true /* do lock */);
+}
+static void entry_vkQueueInsertDebugUtilsLabelEXT(VkQueue queue,
+                                                  const VkDebugUtilsLabelEXT* pLabelInfo) {
+    AEMU_SCOPED_TRACE("vkQueueInsertDebugUtilsLabelEXT");
+    auto vkEnc = ResourceTracker::getQueueEncoder(queue);
+    vkEnc->vkQueueInsertDebugUtilsLabelEXT(queue, pLabelInfo, true /* do lock */);
+}
+static void entry_vkCmdBeginDebugUtilsLabelEXT(VkCommandBuffer commandBuffer,
+                                               const VkDebugUtilsLabelEXT* pLabelInfo) {
+    AEMU_SCOPED_TRACE("vkCmdBeginDebugUtilsLabelEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBeginDebugUtilsLabelEXT(commandBuffer, pLabelInfo, true /* do lock */);
+}
+static void entry_vkCmdEndDebugUtilsLabelEXT(VkCommandBuffer commandBuffer) {
+    AEMU_SCOPED_TRACE("vkCmdEndDebugUtilsLabelEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdEndDebugUtilsLabelEXT(commandBuffer, true /* do lock */);
+}
+static void entry_vkCmdInsertDebugUtilsLabelEXT(VkCommandBuffer commandBuffer,
+                                                const VkDebugUtilsLabelEXT* pLabelInfo) {
+    AEMU_SCOPED_TRACE("vkCmdInsertDebugUtilsLabelEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdInsertDebugUtilsLabelEXT(commandBuffer, pLabelInfo, true /* do lock */);
+}
+static VkResult entry_vkCreateDebugUtilsMessengerEXT(
+    VkInstance instance, const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkDebugUtilsMessengerEXT* pMessenger) {
+    AEMU_SCOPED_TRACE("vkCreateDebugUtilsMessengerEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateDebugUtilsMessengerEXT_VkResult_return = (VkResult)0;
+    vkCreateDebugUtilsMessengerEXT_VkResult_return = vkEnc->vkCreateDebugUtilsMessengerEXT(
+        instance, pCreateInfo, pAllocator, pMessenger, true /* do lock */);
+    return vkCreateDebugUtilsMessengerEXT_VkResult_return;
+}
+static void entry_vkDestroyDebugUtilsMessengerEXT(VkInstance instance,
+                                                  VkDebugUtilsMessengerEXT messenger,
+                                                  const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyDebugUtilsMessengerEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyDebugUtilsMessengerEXT(instance, messenger, pAllocator, true /* do lock */);
+}
+static void entry_vkSubmitDebugUtilsMessageEXT(
+    VkInstance instance, VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
+    VkDebugUtilsMessageTypeFlagsEXT messageTypes,
+    const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData) {
+    AEMU_SCOPED_TRACE("vkSubmitDebugUtilsMessageEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkSubmitDebugUtilsMessageEXT(instance, messageSeverity, messageTypes, pCallbackData,
+                                        true /* do lock */);
+}
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+static VkResult entry_vkGetAndroidHardwareBufferPropertiesANDROID(
+    VkDevice device, const AHardwareBuffer* buffer,
+    VkAndroidHardwareBufferPropertiesANDROID* pProperties) {
+    AEMU_SCOPED_TRACE("vkGetAndroidHardwareBufferPropertiesANDROID");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return =
+        resources->on_vkGetAndroidHardwareBufferPropertiesANDROID(vkEnc, VK_SUCCESS, device, buffer,
+                                                                  pProperties);
+    return vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetAndroidHardwareBufferPropertiesANDROID(
+    VkDevice device, const AHardwareBuffer* buffer,
+    VkAndroidHardwareBufferPropertiesANDROID* pProperties) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device,
+                                       "VK_ANDROID_external_memory_android_hardware_buffer")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetAndroidHardwareBufferPropertiesANDROID",
+                                         "VK_ANDROID_external_memory_android_hardware_buffer");
+    }
+    AEMU_SCOPED_TRACE("vkGetAndroidHardwareBufferPropertiesANDROID");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return = (VkResult)0;
+    vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return =
+        resources->on_vkGetAndroidHardwareBufferPropertiesANDROID(vkEnc, VK_SUCCESS, device, buffer,
+                                                                  pProperties);
+    return vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return;
+}
+static VkResult entry_vkGetMemoryAndroidHardwareBufferANDROID(
+    VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo,
+    AHardwareBuffer** pBuffer) {
+    AEMU_SCOPED_TRACE("vkGetMemoryAndroidHardwareBufferANDROID");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return = (VkResult)0;
+    auto resources = ResourceTracker::get();
+    vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return =
+        resources->on_vkGetMemoryAndroidHardwareBufferANDROID(vkEnc, VK_SUCCESS, device, pInfo,
+                                                              pBuffer);
+    return vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetMemoryAndroidHardwareBufferANDROID(
+    VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo,
+    AHardwareBuffer** pBuffer) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device,
+                                       "VK_ANDROID_external_memory_android_hardware_buffer")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetMemoryAndroidHardwareBufferANDROID",
+                                         "VK_ANDROID_external_memory_android_hardware_buffer");
+    }
+    AEMU_SCOPED_TRACE("vkGetMemoryAndroidHardwareBufferANDROID");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return = (VkResult)0;
+    vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return =
+        resources->on_vkGetMemoryAndroidHardwareBufferANDROID(vkEnc, VK_SUCCESS, device, pInfo,
+                                                              pBuffer);
+    return vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return;
+}
+#endif
+#ifdef VK_EXT_sampler_filter_minmax
+#endif
+#ifdef VK_AMD_gpu_shader_int16
+#endif
+#ifdef VK_AMD_mixed_attachment_samples
+#endif
+#ifdef VK_AMD_shader_fragment_mask
+#endif
+#ifdef VK_EXT_inline_uniform_block
+#endif
+#ifdef VK_EXT_shader_stencil_export
+#endif
+#ifdef VK_EXT_sample_locations
+static void entry_vkCmdSetSampleLocationsEXT(VkCommandBuffer commandBuffer,
+                                             const VkSampleLocationsInfoEXT* pSampleLocationsInfo) {
+    AEMU_SCOPED_TRACE("vkCmdSetSampleLocationsEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetSampleLocationsEXT(commandBuffer, pSampleLocationsInfo, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetSampleLocationsEXT(
+    VkCommandBuffer commandBuffer, const VkSampleLocationsInfoEXT* pSampleLocationsInfo) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_sample_locations")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetSampleLocationsEXT", "VK_EXT_sample_locations");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetSampleLocationsEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetSampleLocationsEXT(commandBuffer, pSampleLocationsInfo, true /* do lock */);
+}
+static void entry_vkGetPhysicalDeviceMultisamplePropertiesEXT(
+    VkPhysicalDevice physicalDevice, VkSampleCountFlagBits samples,
+    VkMultisamplePropertiesEXT* pMultisampleProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMultisamplePropertiesEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetPhysicalDeviceMultisamplePropertiesEXT(physicalDevice, samples,
+                                                       pMultisampleProperties, true /* do lock */);
+}
+#endif
+#ifdef VK_EXT_blend_operation_advanced
+#endif
+#ifdef VK_NV_fragment_coverage_to_color
+#endif
+#ifdef VK_NV_framebuffer_mixed_samples
+#endif
+#ifdef VK_NV_fill_rectangle
+#endif
+#ifdef VK_NV_shader_sm_builtins
+#endif
+#ifdef VK_EXT_post_depth_coverage
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+static VkResult entry_vkGetImageDrmFormatModifierPropertiesEXT(
+    VkDevice device, VkImage image, VkImageDrmFormatModifierPropertiesEXT* pProperties) {
+    AEMU_SCOPED_TRACE("vkGetImageDrmFormatModifierPropertiesEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetImageDrmFormatModifierPropertiesEXT_VkResult_return = (VkResult)0;
+    vkGetImageDrmFormatModifierPropertiesEXT_VkResult_return =
+        vkEnc->vkGetImageDrmFormatModifierPropertiesEXT(device, image, pProperties,
+                                                        true /* do lock */);
+    return vkGetImageDrmFormatModifierPropertiesEXT_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetImageDrmFormatModifierPropertiesEXT(
+    VkDevice device, VkImage image, VkImageDrmFormatModifierPropertiesEXT* pProperties) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_EXT_image_drm_format_modifier")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetImageDrmFormatModifierPropertiesEXT",
+                                         "VK_EXT_image_drm_format_modifier");
+    }
+    AEMU_SCOPED_TRACE("vkGetImageDrmFormatModifierPropertiesEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetImageDrmFormatModifierPropertiesEXT_VkResult_return = (VkResult)0;
+    vkGetImageDrmFormatModifierPropertiesEXT_VkResult_return =
+        vkEnc->vkGetImageDrmFormatModifierPropertiesEXT(device, image, pProperties,
+                                                        true /* do lock */);
+    return vkGetImageDrmFormatModifierPropertiesEXT_VkResult_return;
+}
+#endif
+#ifdef VK_EXT_validation_cache
+static VkResult entry_vkCreateValidationCacheEXT(VkDevice device,
+                                                 const VkValidationCacheCreateInfoEXT* pCreateInfo,
+                                                 const VkAllocationCallbacks* pAllocator,
+                                                 VkValidationCacheEXT* pValidationCache) {
+    AEMU_SCOPED_TRACE("vkCreateValidationCacheEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateValidationCacheEXT_VkResult_return = (VkResult)0;
+    vkCreateValidationCacheEXT_VkResult_return = vkEnc->vkCreateValidationCacheEXT(
+        device, pCreateInfo, pAllocator, pValidationCache, true /* do lock */);
+    return vkCreateValidationCacheEXT_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCreateValidationCacheEXT(
+    VkDevice device, const VkValidationCacheCreateInfoEXT* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkValidationCacheEXT* pValidationCache) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_EXT_validation_cache")) {
+        sOnInvalidDynamicallyCheckedCall("vkCreateValidationCacheEXT", "VK_EXT_validation_cache");
+    }
+    AEMU_SCOPED_TRACE("vkCreateValidationCacheEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateValidationCacheEXT_VkResult_return = (VkResult)0;
+    vkCreateValidationCacheEXT_VkResult_return = vkEnc->vkCreateValidationCacheEXT(
+        device, pCreateInfo, pAllocator, pValidationCache, true /* do lock */);
+    return vkCreateValidationCacheEXT_VkResult_return;
+}
+static void entry_vkDestroyValidationCacheEXT(VkDevice device, VkValidationCacheEXT validationCache,
+                                              const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyValidationCacheEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyValidationCacheEXT(device, validationCache, pAllocator, true /* do lock */);
+}
+static void dynCheck_entry_vkDestroyValidationCacheEXT(VkDevice device,
+                                                       VkValidationCacheEXT validationCache,
+                                                       const VkAllocationCallbacks* pAllocator) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_EXT_validation_cache")) {
+        sOnInvalidDynamicallyCheckedCall("vkDestroyValidationCacheEXT", "VK_EXT_validation_cache");
+    }
+    AEMU_SCOPED_TRACE("vkDestroyValidationCacheEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyValidationCacheEXT(device, validationCache, pAllocator, true /* do lock */);
+}
+static VkResult entry_vkMergeValidationCachesEXT(VkDevice device, VkValidationCacheEXT dstCache,
+                                                 uint32_t srcCacheCount,
+                                                 const VkValidationCacheEXT* pSrcCaches) {
+    AEMU_SCOPED_TRACE("vkMergeValidationCachesEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkMergeValidationCachesEXT_VkResult_return = (VkResult)0;
+    vkMergeValidationCachesEXT_VkResult_return = vkEnc->vkMergeValidationCachesEXT(
+        device, dstCache, srcCacheCount, pSrcCaches, true /* do lock */);
+    return vkMergeValidationCachesEXT_VkResult_return;
+}
+static VkResult dynCheck_entry_vkMergeValidationCachesEXT(VkDevice device,
+                                                          VkValidationCacheEXT dstCache,
+                                                          uint32_t srcCacheCount,
+                                                          const VkValidationCacheEXT* pSrcCaches) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_EXT_validation_cache")) {
+        sOnInvalidDynamicallyCheckedCall("vkMergeValidationCachesEXT", "VK_EXT_validation_cache");
+    }
+    AEMU_SCOPED_TRACE("vkMergeValidationCachesEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkMergeValidationCachesEXT_VkResult_return = (VkResult)0;
+    vkMergeValidationCachesEXT_VkResult_return = vkEnc->vkMergeValidationCachesEXT(
+        device, dstCache, srcCacheCount, pSrcCaches, true /* do lock */);
+    return vkMergeValidationCachesEXT_VkResult_return;
+}
+static VkResult entry_vkGetValidationCacheDataEXT(VkDevice device,
+                                                  VkValidationCacheEXT validationCache,
+                                                  size_t* pDataSize, void* pData) {
+    AEMU_SCOPED_TRACE("vkGetValidationCacheDataEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetValidationCacheDataEXT_VkResult_return = (VkResult)0;
+    vkGetValidationCacheDataEXT_VkResult_return = vkEnc->vkGetValidationCacheDataEXT(
+        device, validationCache, pDataSize, pData, true /* do lock */);
+    return vkGetValidationCacheDataEXT_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetValidationCacheDataEXT(VkDevice device,
+                                                           VkValidationCacheEXT validationCache,
+                                                           size_t* pDataSize, void* pData) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_EXT_validation_cache")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetValidationCacheDataEXT", "VK_EXT_validation_cache");
+    }
+    AEMU_SCOPED_TRACE("vkGetValidationCacheDataEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetValidationCacheDataEXT_VkResult_return = (VkResult)0;
+    vkGetValidationCacheDataEXT_VkResult_return = vkEnc->vkGetValidationCacheDataEXT(
+        device, validationCache, pDataSize, pData, true /* do lock */);
+    return vkGetValidationCacheDataEXT_VkResult_return;
+}
+#endif
+#ifdef VK_EXT_descriptor_indexing
+#endif
+#ifdef VK_EXT_shader_viewport_index_layer
+#endif
+#ifdef VK_NV_shading_rate_image
+static void entry_vkCmdBindShadingRateImageNV(VkCommandBuffer commandBuffer, VkImageView imageView,
+                                              VkImageLayout imageLayout) {
+    AEMU_SCOPED_TRACE("vkCmdBindShadingRateImageNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBindShadingRateImageNV(commandBuffer, imageView, imageLayout, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdBindShadingRateImageNV(VkCommandBuffer commandBuffer,
+                                                       VkImageView imageView,
+                                                       VkImageLayout imageLayout) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_NV_shading_rate_image")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdBindShadingRateImageNV", "VK_NV_shading_rate_image");
+    }
+    AEMU_SCOPED_TRACE("vkCmdBindShadingRateImageNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBindShadingRateImageNV(commandBuffer, imageView, imageLayout, true /* do lock */);
+}
+static void entry_vkCmdSetViewportShadingRatePaletteNV(
+    VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount,
+    const VkShadingRatePaletteNV* pShadingRatePalettes) {
+    AEMU_SCOPED_TRACE("vkCmdSetViewportShadingRatePaletteNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetViewportShadingRatePaletteNV(commandBuffer, firstViewport, viewportCount,
+                                                pShadingRatePalettes, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetViewportShadingRatePaletteNV(
+    VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount,
+    const VkShadingRatePaletteNV* pShadingRatePalettes) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_NV_shading_rate_image")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetViewportShadingRatePaletteNV",
+                                         "VK_NV_shading_rate_image");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetViewportShadingRatePaletteNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetViewportShadingRatePaletteNV(commandBuffer, firstViewport, viewportCount,
+                                                pShadingRatePalettes, true /* do lock */);
+}
+static void entry_vkCmdSetCoarseSampleOrderNV(
+    VkCommandBuffer commandBuffer, VkCoarseSampleOrderTypeNV sampleOrderType,
+    uint32_t customSampleOrderCount, const VkCoarseSampleOrderCustomNV* pCustomSampleOrders) {
+    AEMU_SCOPED_TRACE("vkCmdSetCoarseSampleOrderNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetCoarseSampleOrderNV(commandBuffer, sampleOrderType, customSampleOrderCount,
+                                       pCustomSampleOrders, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetCoarseSampleOrderNV(
+    VkCommandBuffer commandBuffer, VkCoarseSampleOrderTypeNV sampleOrderType,
+    uint32_t customSampleOrderCount, const VkCoarseSampleOrderCustomNV* pCustomSampleOrders) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_NV_shading_rate_image")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetCoarseSampleOrderNV", "VK_NV_shading_rate_image");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetCoarseSampleOrderNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetCoarseSampleOrderNV(commandBuffer, sampleOrderType, customSampleOrderCount,
+                                       pCustomSampleOrders, true /* do lock */);
+}
+#endif
+#ifdef VK_NV_ray_tracing
+static VkResult entry_vkCreateAccelerationStructureNV(
+    VkDevice device, const VkAccelerationStructureCreateInfoNV* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkAccelerationStructureNV* pAccelerationStructure) {
+    AEMU_SCOPED_TRACE("vkCreateAccelerationStructureNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateAccelerationStructureNV_VkResult_return = (VkResult)0;
+    vkCreateAccelerationStructureNV_VkResult_return = vkEnc->vkCreateAccelerationStructureNV(
+        device, pCreateInfo, pAllocator, pAccelerationStructure, true /* do lock */);
+    return vkCreateAccelerationStructureNV_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCreateAccelerationStructureNV(
+    VkDevice device, const VkAccelerationStructureCreateInfoNV* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkAccelerationStructureNV* pAccelerationStructure) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_NV_ray_tracing")) {
+        sOnInvalidDynamicallyCheckedCall("vkCreateAccelerationStructureNV", "VK_NV_ray_tracing");
+    }
+    AEMU_SCOPED_TRACE("vkCreateAccelerationStructureNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateAccelerationStructureNV_VkResult_return = (VkResult)0;
+    vkCreateAccelerationStructureNV_VkResult_return = vkEnc->vkCreateAccelerationStructureNV(
+        device, pCreateInfo, pAllocator, pAccelerationStructure, true /* do lock */);
+    return vkCreateAccelerationStructureNV_VkResult_return;
+}
+static void entry_vkDestroyAccelerationStructureNV(VkDevice device,
+                                                   VkAccelerationStructureNV accelerationStructure,
+                                                   const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyAccelerationStructureNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyAccelerationStructureNV(device, accelerationStructure, pAllocator,
+                                            true /* do lock */);
+}
+static void dynCheck_entry_vkDestroyAccelerationStructureNV(
+    VkDevice device, VkAccelerationStructureNV accelerationStructure,
+    const VkAllocationCallbacks* pAllocator) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_NV_ray_tracing")) {
+        sOnInvalidDynamicallyCheckedCall("vkDestroyAccelerationStructureNV", "VK_NV_ray_tracing");
+    }
+    AEMU_SCOPED_TRACE("vkDestroyAccelerationStructureNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyAccelerationStructureNV(device, accelerationStructure, pAllocator,
+                                            true /* do lock */);
+}
+static void entry_vkGetAccelerationStructureMemoryRequirementsNV(
+    VkDevice device, const VkAccelerationStructureMemoryRequirementsInfoNV* pInfo,
+    VkMemoryRequirements2KHR* pMemoryRequirements) {
+    AEMU_SCOPED_TRACE("vkGetAccelerationStructureMemoryRequirementsNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetAccelerationStructureMemoryRequirementsNV(device, pInfo, pMemoryRequirements,
+                                                          true /* do lock */);
+}
+static void dynCheck_entry_vkGetAccelerationStructureMemoryRequirementsNV(
+    VkDevice device, const VkAccelerationStructureMemoryRequirementsInfoNV* pInfo,
+    VkMemoryRequirements2KHR* pMemoryRequirements) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_NV_ray_tracing")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetAccelerationStructureMemoryRequirementsNV",
+                                         "VK_NV_ray_tracing");
+    }
+    AEMU_SCOPED_TRACE("vkGetAccelerationStructureMemoryRequirementsNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetAccelerationStructureMemoryRequirementsNV(device, pInfo, pMemoryRequirements,
+                                                          true /* do lock */);
+}
+static VkResult entry_vkBindAccelerationStructureMemoryNV(
+    VkDevice device, uint32_t bindInfoCount,
+    const VkBindAccelerationStructureMemoryInfoNV* pBindInfos) {
+    AEMU_SCOPED_TRACE("vkBindAccelerationStructureMemoryNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkBindAccelerationStructureMemoryNV_VkResult_return = (VkResult)0;
+    vkBindAccelerationStructureMemoryNV_VkResult_return =
+        vkEnc->vkBindAccelerationStructureMemoryNV(device, bindInfoCount, pBindInfos,
+                                                   true /* do lock */);
+    return vkBindAccelerationStructureMemoryNV_VkResult_return;
+}
+static VkResult dynCheck_entry_vkBindAccelerationStructureMemoryNV(
+    VkDevice device, uint32_t bindInfoCount,
+    const VkBindAccelerationStructureMemoryInfoNV* pBindInfos) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_NV_ray_tracing")) {
+        sOnInvalidDynamicallyCheckedCall("vkBindAccelerationStructureMemoryNV",
+                                         "VK_NV_ray_tracing");
+    }
+    AEMU_SCOPED_TRACE("vkBindAccelerationStructureMemoryNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkBindAccelerationStructureMemoryNV_VkResult_return = (VkResult)0;
+    vkBindAccelerationStructureMemoryNV_VkResult_return =
+        vkEnc->vkBindAccelerationStructureMemoryNV(device, bindInfoCount, pBindInfos,
+                                                   true /* do lock */);
+    return vkBindAccelerationStructureMemoryNV_VkResult_return;
+}
+static void entry_vkCmdBuildAccelerationStructureNV(VkCommandBuffer commandBuffer,
+                                                    const VkAccelerationStructureInfoNV* pInfo,
+                                                    VkBuffer instanceData,
+                                                    VkDeviceSize instanceOffset, VkBool32 update,
+                                                    VkAccelerationStructureNV dst,
+                                                    VkAccelerationStructureNV src, VkBuffer scratch,
+                                                    VkDeviceSize scratchOffset) {
+    AEMU_SCOPED_TRACE("vkCmdBuildAccelerationStructureNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBuildAccelerationStructureNV(commandBuffer, pInfo, instanceData, instanceOffset,
+                                             update, dst, src, scratch, scratchOffset,
+                                             true /* do lock */);
+}
+static void dynCheck_entry_vkCmdBuildAccelerationStructureNV(
+    VkCommandBuffer commandBuffer, const VkAccelerationStructureInfoNV* pInfo,
+    VkBuffer instanceData, VkDeviceSize instanceOffset, VkBool32 update,
+    VkAccelerationStructureNV dst, VkAccelerationStructureNV src, VkBuffer scratch,
+    VkDeviceSize scratchOffset) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_NV_ray_tracing")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdBuildAccelerationStructureNV", "VK_NV_ray_tracing");
+    }
+    AEMU_SCOPED_TRACE("vkCmdBuildAccelerationStructureNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBuildAccelerationStructureNV(commandBuffer, pInfo, instanceData, instanceOffset,
+                                             update, dst, src, scratch, scratchOffset,
+                                             true /* do lock */);
+}
+static void entry_vkCmdCopyAccelerationStructureNV(VkCommandBuffer commandBuffer,
+                                                   VkAccelerationStructureNV dst,
+                                                   VkAccelerationStructureNV src,
+                                                   VkCopyAccelerationStructureModeKHR mode) {
+    AEMU_SCOPED_TRACE("vkCmdCopyAccelerationStructureNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdCopyAccelerationStructureNV(commandBuffer, dst, src, mode, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdCopyAccelerationStructureNV(
+    VkCommandBuffer commandBuffer, VkAccelerationStructureNV dst, VkAccelerationStructureNV src,
+    VkCopyAccelerationStructureModeKHR mode) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_NV_ray_tracing")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdCopyAccelerationStructureNV", "VK_NV_ray_tracing");
+    }
+    AEMU_SCOPED_TRACE("vkCmdCopyAccelerationStructureNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdCopyAccelerationStructureNV(commandBuffer, dst, src, mode, true /* do lock */);
+}
+static void entry_vkCmdTraceRaysNV(
+    VkCommandBuffer commandBuffer, VkBuffer raygenShaderBindingTableBuffer,
+    VkDeviceSize raygenShaderBindingOffset, VkBuffer missShaderBindingTableBuffer,
+    VkDeviceSize missShaderBindingOffset, VkDeviceSize missShaderBindingStride,
+    VkBuffer hitShaderBindingTableBuffer, VkDeviceSize hitShaderBindingOffset,
+    VkDeviceSize hitShaderBindingStride, VkBuffer callableShaderBindingTableBuffer,
+    VkDeviceSize callableShaderBindingOffset, VkDeviceSize callableShaderBindingStride,
+    uint32_t width, uint32_t height, uint32_t depth) {
+    AEMU_SCOPED_TRACE("vkCmdTraceRaysNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdTraceRaysNV(
+        commandBuffer, raygenShaderBindingTableBuffer, raygenShaderBindingOffset,
+        missShaderBindingTableBuffer, missShaderBindingOffset, missShaderBindingStride,
+        hitShaderBindingTableBuffer, hitShaderBindingOffset, hitShaderBindingStride,
+        callableShaderBindingTableBuffer, callableShaderBindingOffset, callableShaderBindingStride,
+        width, height, depth, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdTraceRaysNV(
+    VkCommandBuffer commandBuffer, VkBuffer raygenShaderBindingTableBuffer,
+    VkDeviceSize raygenShaderBindingOffset, VkBuffer missShaderBindingTableBuffer,
+    VkDeviceSize missShaderBindingOffset, VkDeviceSize missShaderBindingStride,
+    VkBuffer hitShaderBindingTableBuffer, VkDeviceSize hitShaderBindingOffset,
+    VkDeviceSize hitShaderBindingStride, VkBuffer callableShaderBindingTableBuffer,
+    VkDeviceSize callableShaderBindingOffset, VkDeviceSize callableShaderBindingStride,
+    uint32_t width, uint32_t height, uint32_t depth) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_NV_ray_tracing")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdTraceRaysNV", "VK_NV_ray_tracing");
+    }
+    AEMU_SCOPED_TRACE("vkCmdTraceRaysNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdTraceRaysNV(
+        commandBuffer, raygenShaderBindingTableBuffer, raygenShaderBindingOffset,
+        missShaderBindingTableBuffer, missShaderBindingOffset, missShaderBindingStride,
+        hitShaderBindingTableBuffer, hitShaderBindingOffset, hitShaderBindingStride,
+        callableShaderBindingTableBuffer, callableShaderBindingOffset, callableShaderBindingStride,
+        width, height, depth, true /* do lock */);
+}
+static VkResult entry_vkCreateRayTracingPipelinesNV(
+    VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount,
+    const VkRayTracingPipelineCreateInfoNV* pCreateInfos, const VkAllocationCallbacks* pAllocator,
+    VkPipeline* pPipelines) {
+    AEMU_SCOPED_TRACE("vkCreateRayTracingPipelinesNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateRayTracingPipelinesNV_VkResult_return = (VkResult)0;
+    vkCreateRayTracingPipelinesNV_VkResult_return =
+        vkEnc->vkCreateRayTracingPipelinesNV(device, pipelineCache, createInfoCount, pCreateInfos,
+                                             pAllocator, pPipelines, true /* do lock */);
+    return vkCreateRayTracingPipelinesNV_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCreateRayTracingPipelinesNV(
+    VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount,
+    const VkRayTracingPipelineCreateInfoNV* pCreateInfos, const VkAllocationCallbacks* pAllocator,
+    VkPipeline* pPipelines) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_NV_ray_tracing")) {
+        sOnInvalidDynamicallyCheckedCall("vkCreateRayTracingPipelinesNV", "VK_NV_ray_tracing");
+    }
+    AEMU_SCOPED_TRACE("vkCreateRayTracingPipelinesNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateRayTracingPipelinesNV_VkResult_return = (VkResult)0;
+    vkCreateRayTracingPipelinesNV_VkResult_return =
+        vkEnc->vkCreateRayTracingPipelinesNV(device, pipelineCache, createInfoCount, pCreateInfos,
+                                             pAllocator, pPipelines, true /* do lock */);
+    return vkCreateRayTracingPipelinesNV_VkResult_return;
+}
+static VkResult entry_vkGetRayTracingShaderGroupHandlesKHR(VkDevice device, VkPipeline pipeline,
+                                                           uint32_t firstGroup, uint32_t groupCount,
+                                                           size_t dataSize, void* pData) {
+    AEMU_SCOPED_TRACE("vkGetRayTracingShaderGroupHandlesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetRayTracingShaderGroupHandlesKHR_VkResult_return = (VkResult)0;
+    vkGetRayTracingShaderGroupHandlesKHR_VkResult_return =
+        vkEnc->vkGetRayTracingShaderGroupHandlesKHR(device, pipeline, firstGroup, groupCount,
+                                                    dataSize, pData, true /* do lock */);
+    return vkGetRayTracingShaderGroupHandlesKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetRayTracingShaderGroupHandlesKHR(VkDevice device,
+                                                                    VkPipeline pipeline,
+                                                                    uint32_t firstGroup,
+                                                                    uint32_t groupCount,
+                                                                    size_t dataSize, void* pData) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_NV_ray_tracing")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetRayTracingShaderGroupHandlesKHR",
+                                         "VK_NV_ray_tracing");
+    }
+    AEMU_SCOPED_TRACE("vkGetRayTracingShaderGroupHandlesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetRayTracingShaderGroupHandlesKHR_VkResult_return = (VkResult)0;
+    vkGetRayTracingShaderGroupHandlesKHR_VkResult_return =
+        vkEnc->vkGetRayTracingShaderGroupHandlesKHR(device, pipeline, firstGroup, groupCount,
+                                                    dataSize, pData, true /* do lock */);
+    return vkGetRayTracingShaderGroupHandlesKHR_VkResult_return;
+}
+static VkResult entry_vkGetRayTracingShaderGroupHandlesNV(VkDevice device, VkPipeline pipeline,
+                                                          uint32_t firstGroup, uint32_t groupCount,
+                                                          size_t dataSize, void* pData) {
+    AEMU_SCOPED_TRACE("vkGetRayTracingShaderGroupHandlesNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetRayTracingShaderGroupHandlesNV_VkResult_return = (VkResult)0;
+    vkGetRayTracingShaderGroupHandlesNV_VkResult_return =
+        vkEnc->vkGetRayTracingShaderGroupHandlesNV(device, pipeline, firstGroup, groupCount,
+                                                   dataSize, pData, true /* do lock */);
+    return vkGetRayTracingShaderGroupHandlesNV_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetRayTracingShaderGroupHandlesNV(VkDevice device,
+                                                                   VkPipeline pipeline,
+                                                                   uint32_t firstGroup,
+                                                                   uint32_t groupCount,
+                                                                   size_t dataSize, void* pData) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_NV_ray_tracing")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetRayTracingShaderGroupHandlesNV",
+                                         "VK_NV_ray_tracing");
+    }
+    AEMU_SCOPED_TRACE("vkGetRayTracingShaderGroupHandlesNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetRayTracingShaderGroupHandlesNV_VkResult_return = (VkResult)0;
+    vkGetRayTracingShaderGroupHandlesNV_VkResult_return =
+        vkEnc->vkGetRayTracingShaderGroupHandlesNV(device, pipeline, firstGroup, groupCount,
+                                                   dataSize, pData, true /* do lock */);
+    return vkGetRayTracingShaderGroupHandlesNV_VkResult_return;
+}
+static VkResult entry_vkGetAccelerationStructureHandleNV(
+    VkDevice device, VkAccelerationStructureNV accelerationStructure, size_t dataSize,
+    void* pData) {
+    AEMU_SCOPED_TRACE("vkGetAccelerationStructureHandleNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetAccelerationStructureHandleNV_VkResult_return = (VkResult)0;
+    vkGetAccelerationStructureHandleNV_VkResult_return = vkEnc->vkGetAccelerationStructureHandleNV(
+        device, accelerationStructure, dataSize, pData, true /* do lock */);
+    return vkGetAccelerationStructureHandleNV_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetAccelerationStructureHandleNV(
+    VkDevice device, VkAccelerationStructureNV accelerationStructure, size_t dataSize,
+    void* pData) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_NV_ray_tracing")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetAccelerationStructureHandleNV", "VK_NV_ray_tracing");
+    }
+    AEMU_SCOPED_TRACE("vkGetAccelerationStructureHandleNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetAccelerationStructureHandleNV_VkResult_return = (VkResult)0;
+    vkGetAccelerationStructureHandleNV_VkResult_return = vkEnc->vkGetAccelerationStructureHandleNV(
+        device, accelerationStructure, dataSize, pData, true /* do lock */);
+    return vkGetAccelerationStructureHandleNV_VkResult_return;
+}
+static void entry_vkCmdWriteAccelerationStructuresPropertiesNV(
+    VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount,
+    const VkAccelerationStructureNV* pAccelerationStructures, VkQueryType queryType,
+    VkQueryPool queryPool, uint32_t firstQuery) {
+    AEMU_SCOPED_TRACE("vkCmdWriteAccelerationStructuresPropertiesNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdWriteAccelerationStructuresPropertiesNV(commandBuffer, accelerationStructureCount,
+                                                        pAccelerationStructures, queryType,
+                                                        queryPool, firstQuery, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdWriteAccelerationStructuresPropertiesNV(
+    VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount,
+    const VkAccelerationStructureNV* pAccelerationStructures, VkQueryType queryType,
+    VkQueryPool queryPool, uint32_t firstQuery) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_NV_ray_tracing")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdWriteAccelerationStructuresPropertiesNV",
+                                         "VK_NV_ray_tracing");
+    }
+    AEMU_SCOPED_TRACE("vkCmdWriteAccelerationStructuresPropertiesNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdWriteAccelerationStructuresPropertiesNV(commandBuffer, accelerationStructureCount,
+                                                        pAccelerationStructures, queryType,
+                                                        queryPool, firstQuery, true /* do lock */);
+}
+static VkResult entry_vkCompileDeferredNV(VkDevice device, VkPipeline pipeline, uint32_t shader) {
+    AEMU_SCOPED_TRACE("vkCompileDeferredNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCompileDeferredNV_VkResult_return = (VkResult)0;
+    vkCompileDeferredNV_VkResult_return =
+        vkEnc->vkCompileDeferredNV(device, pipeline, shader, true /* do lock */);
+    return vkCompileDeferredNV_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCompileDeferredNV(VkDevice device, VkPipeline pipeline,
+                                                   uint32_t shader) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_NV_ray_tracing")) {
+        sOnInvalidDynamicallyCheckedCall("vkCompileDeferredNV", "VK_NV_ray_tracing");
+    }
+    AEMU_SCOPED_TRACE("vkCompileDeferredNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCompileDeferredNV_VkResult_return = (VkResult)0;
+    vkCompileDeferredNV_VkResult_return =
+        vkEnc->vkCompileDeferredNV(device, pipeline, shader, true /* do lock */);
+    return vkCompileDeferredNV_VkResult_return;
+}
+#endif
+#ifdef VK_NV_representative_fragment_test
+#endif
+#ifdef VK_EXT_filter_cubic
+#endif
+#ifdef VK_QCOM_render_pass_shader_resolve
+#endif
+#ifdef VK_EXT_global_priority
+#endif
+#ifdef VK_EXT_external_memory_host
+static VkResult entry_vkGetMemoryHostPointerPropertiesEXT(
+    VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void* pHostPointer,
+    VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties) {
+    AEMU_SCOPED_TRACE("vkGetMemoryHostPointerPropertiesEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetMemoryHostPointerPropertiesEXT_VkResult_return = (VkResult)0;
+    vkGetMemoryHostPointerPropertiesEXT_VkResult_return =
+        vkEnc->vkGetMemoryHostPointerPropertiesEXT(
+            device, handleType, pHostPointer, pMemoryHostPointerProperties, true /* do lock */);
+    return vkGetMemoryHostPointerPropertiesEXT_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetMemoryHostPointerPropertiesEXT(
+    VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void* pHostPointer,
+    VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_EXT_external_memory_host")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetMemoryHostPointerPropertiesEXT",
+                                         "VK_EXT_external_memory_host");
+    }
+    AEMU_SCOPED_TRACE("vkGetMemoryHostPointerPropertiesEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetMemoryHostPointerPropertiesEXT_VkResult_return = (VkResult)0;
+    vkGetMemoryHostPointerPropertiesEXT_VkResult_return =
+        vkEnc->vkGetMemoryHostPointerPropertiesEXT(
+            device, handleType, pHostPointer, pMemoryHostPointerProperties, true /* do lock */);
+    return vkGetMemoryHostPointerPropertiesEXT_VkResult_return;
+}
+#endif
+#ifdef VK_AMD_buffer_marker
+static void entry_vkCmdWriteBufferMarkerAMD(VkCommandBuffer commandBuffer,
+                                            VkPipelineStageFlagBits pipelineStage,
+                                            VkBuffer dstBuffer, VkDeviceSize dstOffset,
+                                            uint32_t marker) {
+    AEMU_SCOPED_TRACE("vkCmdWriteBufferMarkerAMD");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdWriteBufferMarkerAMD(commandBuffer, pipelineStage, dstBuffer, dstOffset, marker,
+                                     true /* do lock */);
+}
+static void dynCheck_entry_vkCmdWriteBufferMarkerAMD(VkCommandBuffer commandBuffer,
+                                                     VkPipelineStageFlagBits pipelineStage,
+                                                     VkBuffer dstBuffer, VkDeviceSize dstOffset,
+                                                     uint32_t marker) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_AMD_buffer_marker")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdWriteBufferMarkerAMD", "VK_AMD_buffer_marker");
+    }
+    AEMU_SCOPED_TRACE("vkCmdWriteBufferMarkerAMD");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdWriteBufferMarkerAMD(commandBuffer, pipelineStage, dstBuffer, dstOffset, marker,
+                                     true /* do lock */);
+}
+#endif
+#ifdef VK_AMD_pipeline_compiler_control
+#endif
+#ifdef VK_EXT_calibrated_timestamps
+static VkResult entry_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(
+    VkPhysicalDevice physicalDevice, uint32_t* pTimeDomainCount, VkTimeDomainEXT* pTimeDomains) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceCalibrateableTimeDomainsEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPhysicalDeviceCalibrateableTimeDomainsEXT_VkResult_return = (VkResult)0;
+    vkGetPhysicalDeviceCalibrateableTimeDomainsEXT_VkResult_return =
+        vkEnc->vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(physicalDevice, pTimeDomainCount,
+                                                              pTimeDomains, true /* do lock */);
+    return vkGetPhysicalDeviceCalibrateableTimeDomainsEXT_VkResult_return;
+}
+static VkResult entry_vkGetCalibratedTimestampsEXT(
+    VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoEXT* pTimestampInfos,
+    uint64_t* pTimestamps, uint64_t* pMaxDeviation) {
+    AEMU_SCOPED_TRACE("vkGetCalibratedTimestampsEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetCalibratedTimestampsEXT_VkResult_return = (VkResult)0;
+    vkGetCalibratedTimestampsEXT_VkResult_return = vkEnc->vkGetCalibratedTimestampsEXT(
+        device, timestampCount, pTimestampInfos, pTimestamps, pMaxDeviation, true /* do lock */);
+    return vkGetCalibratedTimestampsEXT_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetCalibratedTimestampsEXT(
+    VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoEXT* pTimestampInfos,
+    uint64_t* pTimestamps, uint64_t* pMaxDeviation) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_EXT_calibrated_timestamps")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetCalibratedTimestampsEXT",
+                                         "VK_EXT_calibrated_timestamps");
+    }
+    AEMU_SCOPED_TRACE("vkGetCalibratedTimestampsEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetCalibratedTimestampsEXT_VkResult_return = (VkResult)0;
+    vkGetCalibratedTimestampsEXT_VkResult_return = vkEnc->vkGetCalibratedTimestampsEXT(
+        device, timestampCount, pTimestampInfos, pTimestamps, pMaxDeviation, true /* do lock */);
+    return vkGetCalibratedTimestampsEXT_VkResult_return;
+}
+#endif
+#ifdef VK_AMD_shader_core_properties
+#endif
+#ifdef VK_EXT_video_decode_h265
+#endif
+#ifdef VK_AMD_memory_overallocation_behavior
+#endif
+#ifdef VK_EXT_vertex_attribute_divisor
+#endif
+#ifdef VK_GGP_frame_token
+#endif
+#ifdef VK_EXT_pipeline_creation_feedback
+#endif
+#ifdef VK_NV_shader_subgroup_partitioned
+#endif
+#ifdef VK_NV_compute_shader_derivatives
+#endif
+#ifdef VK_NV_mesh_shader
+static void entry_vkCmdDrawMeshTasksNV(VkCommandBuffer commandBuffer, uint32_t taskCount,
+                                       uint32_t firstTask) {
+    AEMU_SCOPED_TRACE("vkCmdDrawMeshTasksNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDrawMeshTasksNV(commandBuffer, taskCount, firstTask, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdDrawMeshTasksNV(VkCommandBuffer commandBuffer, uint32_t taskCount,
+                                                uint32_t firstTask) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_NV_mesh_shader")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdDrawMeshTasksNV", "VK_NV_mesh_shader");
+    }
+    AEMU_SCOPED_TRACE("vkCmdDrawMeshTasksNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDrawMeshTasksNV(commandBuffer, taskCount, firstTask, true /* do lock */);
+}
+static void entry_vkCmdDrawMeshTasksIndirectNV(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                               VkDeviceSize offset, uint32_t drawCount,
+                                               uint32_t stride) {
+    AEMU_SCOPED_TRACE("vkCmdDrawMeshTasksIndirectNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDrawMeshTasksIndirectNV(commandBuffer, buffer, offset, drawCount, stride,
+                                        true /* do lock */);
+}
+static void dynCheck_entry_vkCmdDrawMeshTasksIndirectNV(VkCommandBuffer commandBuffer,
+                                                        VkBuffer buffer, VkDeviceSize offset,
+                                                        uint32_t drawCount, uint32_t stride) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_NV_mesh_shader")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdDrawMeshTasksIndirectNV", "VK_NV_mesh_shader");
+    }
+    AEMU_SCOPED_TRACE("vkCmdDrawMeshTasksIndirectNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDrawMeshTasksIndirectNV(commandBuffer, buffer, offset, drawCount, stride,
+                                        true /* do lock */);
+}
+static void entry_vkCmdDrawMeshTasksIndirectCountNV(VkCommandBuffer commandBuffer, VkBuffer buffer,
+                                                    VkDeviceSize offset, VkBuffer countBuffer,
+                                                    VkDeviceSize countBufferOffset,
+                                                    uint32_t maxDrawCount, uint32_t stride) {
+    AEMU_SCOPED_TRACE("vkCmdDrawMeshTasksIndirectCountNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDrawMeshTasksIndirectCountNV(commandBuffer, buffer, offset, countBuffer,
+                                             countBufferOffset, maxDrawCount, stride,
+                                             true /* do lock */);
+}
+static void dynCheck_entry_vkCmdDrawMeshTasksIndirectCountNV(
+    VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer,
+    VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_NV_mesh_shader")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdDrawMeshTasksIndirectCountNV", "VK_NV_mesh_shader");
+    }
+    AEMU_SCOPED_TRACE("vkCmdDrawMeshTasksIndirectCountNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDrawMeshTasksIndirectCountNV(commandBuffer, buffer, offset, countBuffer,
+                                             countBufferOffset, maxDrawCount, stride,
+                                             true /* do lock */);
+}
+#endif
+#ifdef VK_NV_fragment_shader_barycentric
+#endif
+#ifdef VK_NV_shader_image_footprint
+#endif
+#ifdef VK_NV_scissor_exclusive
+static void entry_vkCmdSetExclusiveScissorNV(VkCommandBuffer commandBuffer,
+                                             uint32_t firstExclusiveScissor,
+                                             uint32_t exclusiveScissorCount,
+                                             const VkRect2D* pExclusiveScissors) {
+    AEMU_SCOPED_TRACE("vkCmdSetExclusiveScissorNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetExclusiveScissorNV(commandBuffer, firstExclusiveScissor, exclusiveScissorCount,
+                                      pExclusiveScissors, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetExclusiveScissorNV(VkCommandBuffer commandBuffer,
+                                                      uint32_t firstExclusiveScissor,
+                                                      uint32_t exclusiveScissorCount,
+                                                      const VkRect2D* pExclusiveScissors) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_NV_scissor_exclusive")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetExclusiveScissorNV", "VK_NV_scissor_exclusive");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetExclusiveScissorNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetExclusiveScissorNV(commandBuffer, firstExclusiveScissor, exclusiveScissorCount,
+                                      pExclusiveScissors, true /* do lock */);
+}
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+static void entry_vkCmdSetCheckpointNV(VkCommandBuffer commandBuffer,
+                                       const void* pCheckpointMarker) {
+    AEMU_SCOPED_TRACE("vkCmdSetCheckpointNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetCheckpointNV(commandBuffer, pCheckpointMarker, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetCheckpointNV(VkCommandBuffer commandBuffer,
+                                                const void* pCheckpointMarker) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_NV_device_diagnostic_checkpoints")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetCheckpointNV",
+                                         "VK_NV_device_diagnostic_checkpoints");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetCheckpointNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetCheckpointNV(commandBuffer, pCheckpointMarker, true /* do lock */);
+}
+static void entry_vkGetQueueCheckpointDataNV(VkQueue queue, uint32_t* pCheckpointDataCount,
+                                             VkCheckpointDataNV* pCheckpointData) {
+    AEMU_SCOPED_TRACE("vkGetQueueCheckpointDataNV");
+    auto vkEnc = ResourceTracker::getQueueEncoder(queue);
+    vkEnc->vkGetQueueCheckpointDataNV(queue, pCheckpointDataCount, pCheckpointData,
+                                      true /* do lock */);
+}
+#endif
+#ifdef VK_INTEL_shader_integer_functions2
+#endif
+#ifdef VK_INTEL_performance_query
+static VkResult entry_vkInitializePerformanceApiINTEL(
+    VkDevice device, const VkInitializePerformanceApiInfoINTEL* pInitializeInfo) {
+    AEMU_SCOPED_TRACE("vkInitializePerformanceApiINTEL");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkInitializePerformanceApiINTEL_VkResult_return = (VkResult)0;
+    vkInitializePerformanceApiINTEL_VkResult_return =
+        vkEnc->vkInitializePerformanceApiINTEL(device, pInitializeInfo, true /* do lock */);
+    return vkInitializePerformanceApiINTEL_VkResult_return;
+}
+static VkResult dynCheck_entry_vkInitializePerformanceApiINTEL(
+    VkDevice device, const VkInitializePerformanceApiInfoINTEL* pInitializeInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_INTEL_performance_query")) {
+        sOnInvalidDynamicallyCheckedCall("vkInitializePerformanceApiINTEL",
+                                         "VK_INTEL_performance_query");
+    }
+    AEMU_SCOPED_TRACE("vkInitializePerformanceApiINTEL");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkInitializePerformanceApiINTEL_VkResult_return = (VkResult)0;
+    vkInitializePerformanceApiINTEL_VkResult_return =
+        vkEnc->vkInitializePerformanceApiINTEL(device, pInitializeInfo, true /* do lock */);
+    return vkInitializePerformanceApiINTEL_VkResult_return;
+}
+static void entry_vkUninitializePerformanceApiINTEL(VkDevice device) {
+    AEMU_SCOPED_TRACE("vkUninitializePerformanceApiINTEL");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkUninitializePerformanceApiINTEL(device, true /* do lock */);
+}
+static void dynCheck_entry_vkUninitializePerformanceApiINTEL(VkDevice device) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_INTEL_performance_query")) {
+        sOnInvalidDynamicallyCheckedCall("vkUninitializePerformanceApiINTEL",
+                                         "VK_INTEL_performance_query");
+    }
+    AEMU_SCOPED_TRACE("vkUninitializePerformanceApiINTEL");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkUninitializePerformanceApiINTEL(device, true /* do lock */);
+}
+static VkResult entry_vkCmdSetPerformanceMarkerINTEL(
+    VkCommandBuffer commandBuffer, const VkPerformanceMarkerInfoINTEL* pMarkerInfo) {
+    AEMU_SCOPED_TRACE("vkCmdSetPerformanceMarkerINTEL");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    VkResult vkCmdSetPerformanceMarkerINTEL_VkResult_return = (VkResult)0;
+    vkCmdSetPerformanceMarkerINTEL_VkResult_return =
+        vkEnc->vkCmdSetPerformanceMarkerINTEL(commandBuffer, pMarkerInfo, true /* do lock */);
+    return vkCmdSetPerformanceMarkerINTEL_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCmdSetPerformanceMarkerINTEL(
+    VkCommandBuffer commandBuffer, const VkPerformanceMarkerInfoINTEL* pMarkerInfo) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_INTEL_performance_query")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetPerformanceMarkerINTEL",
+                                         "VK_INTEL_performance_query");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetPerformanceMarkerINTEL");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    VkResult vkCmdSetPerformanceMarkerINTEL_VkResult_return = (VkResult)0;
+    vkCmdSetPerformanceMarkerINTEL_VkResult_return =
+        vkEnc->vkCmdSetPerformanceMarkerINTEL(commandBuffer, pMarkerInfo, true /* do lock */);
+    return vkCmdSetPerformanceMarkerINTEL_VkResult_return;
+}
+static VkResult entry_vkCmdSetPerformanceStreamMarkerINTEL(
+    VkCommandBuffer commandBuffer, const VkPerformanceStreamMarkerInfoINTEL* pMarkerInfo) {
+    AEMU_SCOPED_TRACE("vkCmdSetPerformanceStreamMarkerINTEL");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    VkResult vkCmdSetPerformanceStreamMarkerINTEL_VkResult_return = (VkResult)0;
+    vkCmdSetPerformanceStreamMarkerINTEL_VkResult_return =
+        vkEnc->vkCmdSetPerformanceStreamMarkerINTEL(commandBuffer, pMarkerInfo, true /* do lock */);
+    return vkCmdSetPerformanceStreamMarkerINTEL_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCmdSetPerformanceStreamMarkerINTEL(
+    VkCommandBuffer commandBuffer, const VkPerformanceStreamMarkerInfoINTEL* pMarkerInfo) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_INTEL_performance_query")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetPerformanceStreamMarkerINTEL",
+                                         "VK_INTEL_performance_query");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetPerformanceStreamMarkerINTEL");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    VkResult vkCmdSetPerformanceStreamMarkerINTEL_VkResult_return = (VkResult)0;
+    vkCmdSetPerformanceStreamMarkerINTEL_VkResult_return =
+        vkEnc->vkCmdSetPerformanceStreamMarkerINTEL(commandBuffer, pMarkerInfo, true /* do lock */);
+    return vkCmdSetPerformanceStreamMarkerINTEL_VkResult_return;
+}
+static VkResult entry_vkCmdSetPerformanceOverrideINTEL(
+    VkCommandBuffer commandBuffer, const VkPerformanceOverrideInfoINTEL* pOverrideInfo) {
+    AEMU_SCOPED_TRACE("vkCmdSetPerformanceOverrideINTEL");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    VkResult vkCmdSetPerformanceOverrideINTEL_VkResult_return = (VkResult)0;
+    vkCmdSetPerformanceOverrideINTEL_VkResult_return =
+        vkEnc->vkCmdSetPerformanceOverrideINTEL(commandBuffer, pOverrideInfo, true /* do lock */);
+    return vkCmdSetPerformanceOverrideINTEL_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCmdSetPerformanceOverrideINTEL(
+    VkCommandBuffer commandBuffer, const VkPerformanceOverrideInfoINTEL* pOverrideInfo) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_INTEL_performance_query")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetPerformanceOverrideINTEL",
+                                         "VK_INTEL_performance_query");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetPerformanceOverrideINTEL");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    VkResult vkCmdSetPerformanceOverrideINTEL_VkResult_return = (VkResult)0;
+    vkCmdSetPerformanceOverrideINTEL_VkResult_return =
+        vkEnc->vkCmdSetPerformanceOverrideINTEL(commandBuffer, pOverrideInfo, true /* do lock */);
+    return vkCmdSetPerformanceOverrideINTEL_VkResult_return;
+}
+static VkResult entry_vkAcquirePerformanceConfigurationINTEL(
+    VkDevice device, const VkPerformanceConfigurationAcquireInfoINTEL* pAcquireInfo,
+    VkPerformanceConfigurationINTEL* pConfiguration) {
+    AEMU_SCOPED_TRACE("vkAcquirePerformanceConfigurationINTEL");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkAcquirePerformanceConfigurationINTEL_VkResult_return = (VkResult)0;
+    vkAcquirePerformanceConfigurationINTEL_VkResult_return =
+        vkEnc->vkAcquirePerformanceConfigurationINTEL(device, pAcquireInfo, pConfiguration,
+                                                      true /* do lock */);
+    return vkAcquirePerformanceConfigurationINTEL_VkResult_return;
+}
+static VkResult dynCheck_entry_vkAcquirePerformanceConfigurationINTEL(
+    VkDevice device, const VkPerformanceConfigurationAcquireInfoINTEL* pAcquireInfo,
+    VkPerformanceConfigurationINTEL* pConfiguration) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_INTEL_performance_query")) {
+        sOnInvalidDynamicallyCheckedCall("vkAcquirePerformanceConfigurationINTEL",
+                                         "VK_INTEL_performance_query");
+    }
+    AEMU_SCOPED_TRACE("vkAcquirePerformanceConfigurationINTEL");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkAcquirePerformanceConfigurationINTEL_VkResult_return = (VkResult)0;
+    vkAcquirePerformanceConfigurationINTEL_VkResult_return =
+        vkEnc->vkAcquirePerformanceConfigurationINTEL(device, pAcquireInfo, pConfiguration,
+                                                      true /* do lock */);
+    return vkAcquirePerformanceConfigurationINTEL_VkResult_return;
+}
+static VkResult entry_vkReleasePerformanceConfigurationINTEL(
+    VkDevice device, VkPerformanceConfigurationINTEL configuration) {
+    AEMU_SCOPED_TRACE("vkReleasePerformanceConfigurationINTEL");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkReleasePerformanceConfigurationINTEL_VkResult_return = (VkResult)0;
+    vkReleasePerformanceConfigurationINTEL_VkResult_return =
+        vkEnc->vkReleasePerformanceConfigurationINTEL(device, configuration, true /* do lock */);
+    return vkReleasePerformanceConfigurationINTEL_VkResult_return;
+}
+static VkResult dynCheck_entry_vkReleasePerformanceConfigurationINTEL(
+    VkDevice device, VkPerformanceConfigurationINTEL configuration) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_INTEL_performance_query")) {
+        sOnInvalidDynamicallyCheckedCall("vkReleasePerformanceConfigurationINTEL",
+                                         "VK_INTEL_performance_query");
+    }
+    AEMU_SCOPED_TRACE("vkReleasePerformanceConfigurationINTEL");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkReleasePerformanceConfigurationINTEL_VkResult_return = (VkResult)0;
+    vkReleasePerformanceConfigurationINTEL_VkResult_return =
+        vkEnc->vkReleasePerformanceConfigurationINTEL(device, configuration, true /* do lock */);
+    return vkReleasePerformanceConfigurationINTEL_VkResult_return;
+}
+static VkResult entry_vkQueueSetPerformanceConfigurationINTEL(
+    VkQueue queue, VkPerformanceConfigurationINTEL configuration) {
+    AEMU_SCOPED_TRACE("vkQueueSetPerformanceConfigurationINTEL");
+    auto vkEnc = ResourceTracker::getQueueEncoder(queue);
+    VkResult vkQueueSetPerformanceConfigurationINTEL_VkResult_return = (VkResult)0;
+    vkQueueSetPerformanceConfigurationINTEL_VkResult_return =
+        vkEnc->vkQueueSetPerformanceConfigurationINTEL(queue, configuration, true /* do lock */);
+    return vkQueueSetPerformanceConfigurationINTEL_VkResult_return;
+}
+static VkResult entry_vkGetPerformanceParameterINTEL(VkDevice device,
+                                                     VkPerformanceParameterTypeINTEL parameter,
+                                                     VkPerformanceValueINTEL* pValue) {
+    AEMU_SCOPED_TRACE("vkGetPerformanceParameterINTEL");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPerformanceParameterINTEL_VkResult_return = (VkResult)0;
+    vkGetPerformanceParameterINTEL_VkResult_return =
+        vkEnc->vkGetPerformanceParameterINTEL(device, parameter, pValue, true /* do lock */);
+    return vkGetPerformanceParameterINTEL_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetPerformanceParameterINTEL(
+    VkDevice device, VkPerformanceParameterTypeINTEL parameter, VkPerformanceValueINTEL* pValue) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_INTEL_performance_query")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetPerformanceParameterINTEL",
+                                         "VK_INTEL_performance_query");
+    }
+    AEMU_SCOPED_TRACE("vkGetPerformanceParameterINTEL");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPerformanceParameterINTEL_VkResult_return = (VkResult)0;
+    vkGetPerformanceParameterINTEL_VkResult_return =
+        vkEnc->vkGetPerformanceParameterINTEL(device, parameter, pValue, true /* do lock */);
+    return vkGetPerformanceParameterINTEL_VkResult_return;
+}
+#endif
+#ifdef VK_EXT_pci_bus_info
+#endif
+#ifdef VK_AMD_display_native_hdr
+static void entry_vkSetLocalDimmingAMD(VkDevice device, VkSwapchainKHR swapChain,
+                                       VkBool32 localDimmingEnable) {
+    AEMU_SCOPED_TRACE("vkSetLocalDimmingAMD");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkSetLocalDimmingAMD(device, swapChain, localDimmingEnable, true /* do lock */);
+}
+static void dynCheck_entry_vkSetLocalDimmingAMD(VkDevice device, VkSwapchainKHR swapChain,
+                                                VkBool32 localDimmingEnable) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_AMD_display_native_hdr")) {
+        sOnInvalidDynamicallyCheckedCall("vkSetLocalDimmingAMD", "VK_AMD_display_native_hdr");
+    }
+    AEMU_SCOPED_TRACE("vkSetLocalDimmingAMD");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkSetLocalDimmingAMD(device, swapChain, localDimmingEnable, true /* do lock */);
+}
+#endif
+#ifdef VK_FUCHSIA_imagepipe_surface
+static VkResult entry_vkCreateImagePipeSurfaceFUCHSIA(
+    VkInstance instance, const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) {
+    AEMU_SCOPED_TRACE("vkCreateImagePipeSurfaceFUCHSIA");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateImagePipeSurfaceFUCHSIA_VkResult_return = (VkResult)0;
+    vkCreateImagePipeSurfaceFUCHSIA_VkResult_return = vkEnc->vkCreateImagePipeSurfaceFUCHSIA(
+        instance, pCreateInfo, pAllocator, pSurface, true /* do lock */);
+    return vkCreateImagePipeSurfaceFUCHSIA_VkResult_return;
+}
+#endif
+#ifdef VK_EXT_metal_surface
+static VkResult entry_vkCreateMetalSurfaceEXT(VkInstance instance,
+                                              const VkMetalSurfaceCreateInfoEXT* pCreateInfo,
+                                              const VkAllocationCallbacks* pAllocator,
+                                              VkSurfaceKHR* pSurface) {
+    AEMU_SCOPED_TRACE("vkCreateMetalSurfaceEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateMetalSurfaceEXT_VkResult_return = (VkResult)0;
+    vkCreateMetalSurfaceEXT_VkResult_return = vkEnc->vkCreateMetalSurfaceEXT(
+        instance, pCreateInfo, pAllocator, pSurface, true /* do lock */);
+    return vkCreateMetalSurfaceEXT_VkResult_return;
+}
+#endif
+#ifdef VK_EXT_fragment_density_map
+#endif
+#ifdef VK_EXT_scalar_block_layout
+#endif
+#ifdef VK_GOOGLE_hlsl_functionality1
+#endif
+#ifdef VK_GOOGLE_decorate_string
+#endif
+#ifdef VK_EXT_subgroup_size_control
+#endif
+#ifdef VK_AMD_shader_core_properties2
+#endif
+#ifdef VK_AMD_device_coherent_memory
+#endif
+#ifdef VK_EXT_shader_image_atomic_int64
+#endif
+#ifdef VK_EXT_memory_budget
+#endif
+#ifdef VK_EXT_memory_priority
+#endif
+#ifdef VK_NV_dedicated_allocation_image_aliasing
+#endif
+#ifdef VK_EXT_buffer_device_address
+static VkDeviceAddress entry_vkGetBufferDeviceAddressEXT(VkDevice device,
+                                                         const VkBufferDeviceAddressInfo* pInfo) {
+    AEMU_SCOPED_TRACE("vkGetBufferDeviceAddressEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkDeviceAddress vkGetBufferDeviceAddressEXT_VkDeviceAddress_return = (VkDeviceAddress)0;
+    vkGetBufferDeviceAddressEXT_VkDeviceAddress_return =
+        vkEnc->vkGetBufferDeviceAddressEXT(device, pInfo, true /* do lock */);
+    return vkGetBufferDeviceAddressEXT_VkDeviceAddress_return;
+}
+static VkDeviceAddress dynCheck_entry_vkGetBufferDeviceAddressEXT(
+    VkDevice device, const VkBufferDeviceAddressInfo* pInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_EXT_buffer_device_address")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetBufferDeviceAddressEXT",
+                                         "VK_EXT_buffer_device_address");
+    }
+    AEMU_SCOPED_TRACE("vkGetBufferDeviceAddressEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkDeviceAddress vkGetBufferDeviceAddressEXT_VkDeviceAddress_return = (VkDeviceAddress)0;
+    vkGetBufferDeviceAddressEXT_VkDeviceAddress_return =
+        vkEnc->vkGetBufferDeviceAddressEXT(device, pInfo, true /* do lock */);
+    return vkGetBufferDeviceAddressEXT_VkDeviceAddress_return;
+}
+#endif
+#ifdef VK_EXT_tooling_info
+static VkResult entry_vkGetPhysicalDeviceToolPropertiesEXT(
+    VkPhysicalDevice physicalDevice, uint32_t* pToolCount,
+    VkPhysicalDeviceToolPropertiesEXT* pToolProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceToolPropertiesEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPhysicalDeviceToolPropertiesEXT_VkResult_return = (VkResult)0;
+    vkGetPhysicalDeviceToolPropertiesEXT_VkResult_return =
+        vkEnc->vkGetPhysicalDeviceToolPropertiesEXT(physicalDevice, pToolCount, pToolProperties,
+                                                    true /* do lock */);
+    return vkGetPhysicalDeviceToolPropertiesEXT_VkResult_return;
+}
+#endif
+#ifdef VK_EXT_separate_stencil_usage
+#endif
+#ifdef VK_EXT_validation_features
+#endif
+#ifdef VK_NV_cooperative_matrix
+static VkResult entry_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV(
+    VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount,
+    VkCooperativeMatrixPropertiesNV* pProperties) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceCooperativeMatrixPropertiesNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPhysicalDeviceCooperativeMatrixPropertiesNV_VkResult_return = (VkResult)0;
+    vkGetPhysicalDeviceCooperativeMatrixPropertiesNV_VkResult_return =
+        vkEnc->vkGetPhysicalDeviceCooperativeMatrixPropertiesNV(physicalDevice, pPropertyCount,
+                                                                pProperties, true /* do lock */);
+    return vkGetPhysicalDeviceCooperativeMatrixPropertiesNV_VkResult_return;
+}
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+static VkResult entry_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV(
+    VkPhysicalDevice physicalDevice, uint32_t* pCombinationCount,
+    VkFramebufferMixedSamplesCombinationNV* pCombinations) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV_VkResult_return =
+        (VkResult)0;
+    vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV_VkResult_return =
+        vkEnc->vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV(
+            physicalDevice, pCombinationCount, pCombinations, true /* do lock */);
+    return vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV_VkResult_return;
+}
+#endif
+#ifdef VK_EXT_fragment_shader_interlock
+#endif
+#ifdef VK_EXT_ycbcr_image_arrays
+#endif
+#ifdef VK_EXT_provoking_vertex
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+static VkResult entry_vkGetPhysicalDeviceSurfacePresentModes2EXT(
+    VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
+    uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfacePresentModes2EXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetPhysicalDeviceSurfacePresentModes2EXT_VkResult_return = (VkResult)0;
+    vkGetPhysicalDeviceSurfacePresentModes2EXT_VkResult_return =
+        vkEnc->vkGetPhysicalDeviceSurfacePresentModes2EXT(
+            physicalDevice, pSurfaceInfo, pPresentModeCount, pPresentModes, true /* do lock */);
+    return vkGetPhysicalDeviceSurfacePresentModes2EXT_VkResult_return;
+}
+static VkResult entry_vkAcquireFullScreenExclusiveModeEXT(VkDevice device,
+                                                          VkSwapchainKHR swapchain) {
+    AEMU_SCOPED_TRACE("vkAcquireFullScreenExclusiveModeEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkAcquireFullScreenExclusiveModeEXT_VkResult_return = (VkResult)0;
+    vkAcquireFullScreenExclusiveModeEXT_VkResult_return =
+        vkEnc->vkAcquireFullScreenExclusiveModeEXT(device, swapchain, true /* do lock */);
+    return vkAcquireFullScreenExclusiveModeEXT_VkResult_return;
+}
+static VkResult dynCheck_entry_vkAcquireFullScreenExclusiveModeEXT(VkDevice device,
+                                                                   VkSwapchainKHR swapchain) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_EXT_full_screen_exclusive")) {
+        sOnInvalidDynamicallyCheckedCall("vkAcquireFullScreenExclusiveModeEXT",
+                                         "VK_EXT_full_screen_exclusive");
+    }
+    AEMU_SCOPED_TRACE("vkAcquireFullScreenExclusiveModeEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkAcquireFullScreenExclusiveModeEXT_VkResult_return = (VkResult)0;
+    vkAcquireFullScreenExclusiveModeEXT_VkResult_return =
+        vkEnc->vkAcquireFullScreenExclusiveModeEXT(device, swapchain, true /* do lock */);
+    return vkAcquireFullScreenExclusiveModeEXT_VkResult_return;
+}
+static VkResult entry_vkReleaseFullScreenExclusiveModeEXT(VkDevice device,
+                                                          VkSwapchainKHR swapchain) {
+    AEMU_SCOPED_TRACE("vkReleaseFullScreenExclusiveModeEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkReleaseFullScreenExclusiveModeEXT_VkResult_return = (VkResult)0;
+    vkReleaseFullScreenExclusiveModeEXT_VkResult_return =
+        vkEnc->vkReleaseFullScreenExclusiveModeEXT(device, swapchain, true /* do lock */);
+    return vkReleaseFullScreenExclusiveModeEXT_VkResult_return;
+}
+static VkResult dynCheck_entry_vkReleaseFullScreenExclusiveModeEXT(VkDevice device,
+                                                                   VkSwapchainKHR swapchain) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_EXT_full_screen_exclusive")) {
+        sOnInvalidDynamicallyCheckedCall("vkReleaseFullScreenExclusiveModeEXT",
+                                         "VK_EXT_full_screen_exclusive");
+    }
+    AEMU_SCOPED_TRACE("vkReleaseFullScreenExclusiveModeEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkReleaseFullScreenExclusiveModeEXT_VkResult_return = (VkResult)0;
+    vkReleaseFullScreenExclusiveModeEXT_VkResult_return =
+        vkEnc->vkReleaseFullScreenExclusiveModeEXT(device, swapchain, true /* do lock */);
+    return vkReleaseFullScreenExclusiveModeEXT_VkResult_return;
+}
+static VkResult entry_vkGetDeviceGroupSurfacePresentModes2EXT(
+    VkDevice device, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
+    VkDeviceGroupPresentModeFlagsKHR* pModes) {
+    AEMU_SCOPED_TRACE("vkGetDeviceGroupSurfacePresentModes2EXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetDeviceGroupSurfacePresentModes2EXT_VkResult_return = (VkResult)0;
+    vkGetDeviceGroupSurfacePresentModes2EXT_VkResult_return =
+        vkEnc->vkGetDeviceGroupSurfacePresentModes2EXT(device, pSurfaceInfo, pModes,
+                                                       true /* do lock */);
+    return vkGetDeviceGroupSurfacePresentModes2EXT_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetDeviceGroupSurfacePresentModes2EXT(
+    VkDevice device, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
+    VkDeviceGroupPresentModeFlagsKHR* pModes) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_EXT_full_screen_exclusive")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetDeviceGroupSurfacePresentModes2EXT",
+                                         "VK_EXT_full_screen_exclusive");
+    }
+    AEMU_SCOPED_TRACE("vkGetDeviceGroupSurfacePresentModes2EXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetDeviceGroupSurfacePresentModes2EXT_VkResult_return = (VkResult)0;
+    vkGetDeviceGroupSurfacePresentModes2EXT_VkResult_return =
+        vkEnc->vkGetDeviceGroupSurfacePresentModes2EXT(device, pSurfaceInfo, pModes,
+                                                       true /* do lock */);
+    return vkGetDeviceGroupSurfacePresentModes2EXT_VkResult_return;
+}
+#endif
+#ifdef VK_EXT_headless_surface
+static VkResult entry_vkCreateHeadlessSurfaceEXT(VkInstance instance,
+                                                 const VkHeadlessSurfaceCreateInfoEXT* pCreateInfo,
+                                                 const VkAllocationCallbacks* pAllocator,
+                                                 VkSurfaceKHR* pSurface) {
+    AEMU_SCOPED_TRACE("vkCreateHeadlessSurfaceEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateHeadlessSurfaceEXT_VkResult_return = (VkResult)0;
+    vkCreateHeadlessSurfaceEXT_VkResult_return = vkEnc->vkCreateHeadlessSurfaceEXT(
+        instance, pCreateInfo, pAllocator, pSurface, true /* do lock */);
+    return vkCreateHeadlessSurfaceEXT_VkResult_return;
+}
+#endif
+#ifdef VK_EXT_line_rasterization
+static void entry_vkCmdSetLineStippleEXT(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor,
+                                         uint16_t lineStipplePattern) {
+    AEMU_SCOPED_TRACE("vkCmdSetLineStippleEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetLineStippleEXT(commandBuffer, lineStippleFactor, lineStipplePattern,
+                                  true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetLineStippleEXT(VkCommandBuffer commandBuffer,
+                                                  uint32_t lineStippleFactor,
+                                                  uint16_t lineStipplePattern) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_line_rasterization")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetLineStippleEXT", "VK_EXT_line_rasterization");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetLineStippleEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetLineStippleEXT(commandBuffer, lineStippleFactor, lineStipplePattern,
+                                  true /* do lock */);
+}
+#endif
+#ifdef VK_EXT_shader_atomic_float
+#endif
+#ifdef VK_EXT_host_query_reset
+static void entry_vkResetQueryPoolEXT(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery,
+                                      uint32_t queryCount) {
+    AEMU_SCOPED_TRACE("vkResetQueryPoolEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkResetQueryPoolEXT(device, queryPool, firstQuery, queryCount, true /* do lock */);
+}
+static void dynCheck_entry_vkResetQueryPoolEXT(VkDevice device, VkQueryPool queryPool,
+                                               uint32_t firstQuery, uint32_t queryCount) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_EXT_host_query_reset")) {
+        sOnInvalidDynamicallyCheckedCall("vkResetQueryPoolEXT", "VK_EXT_host_query_reset");
+    }
+    AEMU_SCOPED_TRACE("vkResetQueryPoolEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkResetQueryPoolEXT(device, queryPool, firstQuery, queryCount, true /* do lock */);
+}
+#endif
+#ifdef VK_EXT_index_type_uint8
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+static void entry_vkCmdSetCullModeEXT(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode) {
+    AEMU_SCOPED_TRACE("vkCmdSetCullModeEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetCullModeEXT(commandBuffer, cullMode, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetCullModeEXT(VkCommandBuffer commandBuffer,
+                                               VkCullModeFlags cullMode) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetCullModeEXT", "VK_EXT_extended_dynamic_state");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetCullModeEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetCullModeEXT(commandBuffer, cullMode, true /* do lock */);
+}
+static void entry_vkCmdSetFrontFaceEXT(VkCommandBuffer commandBuffer, VkFrontFace frontFace) {
+    AEMU_SCOPED_TRACE("vkCmdSetFrontFaceEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetFrontFaceEXT(commandBuffer, frontFace, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetFrontFaceEXT(VkCommandBuffer commandBuffer,
+                                                VkFrontFace frontFace) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetFrontFaceEXT", "VK_EXT_extended_dynamic_state");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetFrontFaceEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetFrontFaceEXT(commandBuffer, frontFace, true /* do lock */);
+}
+static void entry_vkCmdSetPrimitiveTopologyEXT(VkCommandBuffer commandBuffer,
+                                               VkPrimitiveTopology primitiveTopology) {
+    AEMU_SCOPED_TRACE("vkCmdSetPrimitiveTopologyEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetPrimitiveTopologyEXT(commandBuffer, primitiveTopology, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetPrimitiveTopologyEXT(VkCommandBuffer commandBuffer,
+                                                        VkPrimitiveTopology primitiveTopology) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetPrimitiveTopologyEXT",
+                                         "VK_EXT_extended_dynamic_state");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetPrimitiveTopologyEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetPrimitiveTopologyEXT(commandBuffer, primitiveTopology, true /* do lock */);
+}
+static void entry_vkCmdSetViewportWithCountEXT(VkCommandBuffer commandBuffer,
+                                               uint32_t viewportCount,
+                                               const VkViewport* pViewports) {
+    AEMU_SCOPED_TRACE("vkCmdSetViewportWithCountEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetViewportWithCountEXT(commandBuffer, viewportCount, pViewports,
+                                        true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetViewportWithCountEXT(VkCommandBuffer commandBuffer,
+                                                        uint32_t viewportCount,
+                                                        const VkViewport* pViewports) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetViewportWithCountEXT",
+                                         "VK_EXT_extended_dynamic_state");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetViewportWithCountEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetViewportWithCountEXT(commandBuffer, viewportCount, pViewports,
+                                        true /* do lock */);
+}
+static void entry_vkCmdSetScissorWithCountEXT(VkCommandBuffer commandBuffer, uint32_t scissorCount,
+                                              const VkRect2D* pScissors) {
+    AEMU_SCOPED_TRACE("vkCmdSetScissorWithCountEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetScissorWithCountEXT(commandBuffer, scissorCount, pScissors, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetScissorWithCountEXT(VkCommandBuffer commandBuffer,
+                                                       uint32_t scissorCount,
+                                                       const VkRect2D* pScissors) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetScissorWithCountEXT",
+                                         "VK_EXT_extended_dynamic_state");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetScissorWithCountEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetScissorWithCountEXT(commandBuffer, scissorCount, pScissors, true /* do lock */);
+}
+static void entry_vkCmdBindVertexBuffers2EXT(VkCommandBuffer commandBuffer, uint32_t firstBinding,
+                                             uint32_t bindingCount, const VkBuffer* pBuffers,
+                                             const VkDeviceSize* pOffsets,
+                                             const VkDeviceSize* pSizes,
+                                             const VkDeviceSize* pStrides) {
+    AEMU_SCOPED_TRACE("vkCmdBindVertexBuffers2EXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBindVertexBuffers2EXT(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets,
+                                      pSizes, pStrides, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdBindVertexBuffers2EXT(VkCommandBuffer commandBuffer,
+                                                      uint32_t firstBinding, uint32_t bindingCount,
+                                                      const VkBuffer* pBuffers,
+                                                      const VkDeviceSize* pOffsets,
+                                                      const VkDeviceSize* pSizes,
+                                                      const VkDeviceSize* pStrides) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdBindVertexBuffers2EXT",
+                                         "VK_EXT_extended_dynamic_state");
+    }
+    AEMU_SCOPED_TRACE("vkCmdBindVertexBuffers2EXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBindVertexBuffers2EXT(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets,
+                                      pSizes, pStrides, true /* do lock */);
+}
+static void entry_vkCmdSetDepthTestEnableEXT(VkCommandBuffer commandBuffer,
+                                             VkBool32 depthTestEnable) {
+    AEMU_SCOPED_TRACE("vkCmdSetDepthTestEnableEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetDepthTestEnableEXT(commandBuffer, depthTestEnable, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetDepthTestEnableEXT(VkCommandBuffer commandBuffer,
+                                                      VkBool32 depthTestEnable) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetDepthTestEnableEXT",
+                                         "VK_EXT_extended_dynamic_state");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetDepthTestEnableEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetDepthTestEnableEXT(commandBuffer, depthTestEnable, true /* do lock */);
+}
+static void entry_vkCmdSetDepthWriteEnableEXT(VkCommandBuffer commandBuffer,
+                                              VkBool32 depthWriteEnable) {
+    AEMU_SCOPED_TRACE("vkCmdSetDepthWriteEnableEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetDepthWriteEnableEXT(commandBuffer, depthWriteEnable, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetDepthWriteEnableEXT(VkCommandBuffer commandBuffer,
+                                                       VkBool32 depthWriteEnable) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetDepthWriteEnableEXT",
+                                         "VK_EXT_extended_dynamic_state");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetDepthWriteEnableEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetDepthWriteEnableEXT(commandBuffer, depthWriteEnable, true /* do lock */);
+}
+static void entry_vkCmdSetDepthCompareOpEXT(VkCommandBuffer commandBuffer,
+                                            VkCompareOp depthCompareOp) {
+    AEMU_SCOPED_TRACE("vkCmdSetDepthCompareOpEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetDepthCompareOpEXT(commandBuffer, depthCompareOp, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetDepthCompareOpEXT(VkCommandBuffer commandBuffer,
+                                                     VkCompareOp depthCompareOp) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetDepthCompareOpEXT",
+                                         "VK_EXT_extended_dynamic_state");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetDepthCompareOpEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetDepthCompareOpEXT(commandBuffer, depthCompareOp, true /* do lock */);
+}
+static void entry_vkCmdSetDepthBoundsTestEnableEXT(VkCommandBuffer commandBuffer,
+                                                   VkBool32 depthBoundsTestEnable) {
+    AEMU_SCOPED_TRACE("vkCmdSetDepthBoundsTestEnableEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetDepthBoundsTestEnableEXT(commandBuffer, depthBoundsTestEnable,
+                                            true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetDepthBoundsTestEnableEXT(VkCommandBuffer commandBuffer,
+                                                            VkBool32 depthBoundsTestEnable) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetDepthBoundsTestEnableEXT",
+                                         "VK_EXT_extended_dynamic_state");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetDepthBoundsTestEnableEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetDepthBoundsTestEnableEXT(commandBuffer, depthBoundsTestEnable,
+                                            true /* do lock */);
+}
+static void entry_vkCmdSetStencilTestEnableEXT(VkCommandBuffer commandBuffer,
+                                               VkBool32 stencilTestEnable) {
+    AEMU_SCOPED_TRACE("vkCmdSetStencilTestEnableEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetStencilTestEnableEXT(commandBuffer, stencilTestEnable, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetStencilTestEnableEXT(VkCommandBuffer commandBuffer,
+                                                        VkBool32 stencilTestEnable) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetStencilTestEnableEXT",
+                                         "VK_EXT_extended_dynamic_state");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetStencilTestEnableEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetStencilTestEnableEXT(commandBuffer, stencilTestEnable, true /* do lock */);
+}
+static void entry_vkCmdSetStencilOpEXT(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask,
+                                       VkStencilOp failOp, VkStencilOp passOp,
+                                       VkStencilOp depthFailOp, VkCompareOp compareOp) {
+    AEMU_SCOPED_TRACE("vkCmdSetStencilOpEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetStencilOpEXT(commandBuffer, faceMask, failOp, passOp, depthFailOp, compareOp,
+                                true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetStencilOpEXT(VkCommandBuffer commandBuffer,
+                                                VkStencilFaceFlags faceMask, VkStencilOp failOp,
+                                                VkStencilOp passOp, VkStencilOp depthFailOp,
+                                                VkCompareOp compareOp) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetStencilOpEXT", "VK_EXT_extended_dynamic_state");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetStencilOpEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetStencilOpEXT(commandBuffer, faceMask, failOp, passOp, depthFailOp, compareOp,
+                                true /* do lock */);
+}
+#endif
+#ifdef VK_EXT_shader_atomic_float2
+#endif
+#ifdef VK_EXT_shader_demote_to_helper_invocation
+#endif
+#ifdef VK_NV_device_generated_commands
+static void entry_vkGetGeneratedCommandsMemoryRequirementsNV(
+    VkDevice device, const VkGeneratedCommandsMemoryRequirementsInfoNV* pInfo,
+    VkMemoryRequirements2* pMemoryRequirements) {
+    AEMU_SCOPED_TRACE("vkGetGeneratedCommandsMemoryRequirementsNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetGeneratedCommandsMemoryRequirementsNV(device, pInfo, pMemoryRequirements,
+                                                      true /* do lock */);
+}
+static void dynCheck_entry_vkGetGeneratedCommandsMemoryRequirementsNV(
+    VkDevice device, const VkGeneratedCommandsMemoryRequirementsInfoNV* pInfo,
+    VkMemoryRequirements2* pMemoryRequirements) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_NV_device_generated_commands")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetGeneratedCommandsMemoryRequirementsNV",
+                                         "VK_NV_device_generated_commands");
+    }
+    AEMU_SCOPED_TRACE("vkGetGeneratedCommandsMemoryRequirementsNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetGeneratedCommandsMemoryRequirementsNV(device, pInfo, pMemoryRequirements,
+                                                      true /* do lock */);
+}
+static void entry_vkCmdPreprocessGeneratedCommandsNV(
+    VkCommandBuffer commandBuffer, const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo) {
+    AEMU_SCOPED_TRACE("vkCmdPreprocessGeneratedCommandsNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdPreprocessGeneratedCommandsNV(commandBuffer, pGeneratedCommandsInfo,
+                                              true /* do lock */);
+}
+static void dynCheck_entry_vkCmdPreprocessGeneratedCommandsNV(
+    VkCommandBuffer commandBuffer, const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_NV_device_generated_commands")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdPreprocessGeneratedCommandsNV",
+                                         "VK_NV_device_generated_commands");
+    }
+    AEMU_SCOPED_TRACE("vkCmdPreprocessGeneratedCommandsNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdPreprocessGeneratedCommandsNV(commandBuffer, pGeneratedCommandsInfo,
+                                              true /* do lock */);
+}
+static void entry_vkCmdExecuteGeneratedCommandsNV(
+    VkCommandBuffer commandBuffer, VkBool32 isPreprocessed,
+    const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo) {
+    AEMU_SCOPED_TRACE("vkCmdExecuteGeneratedCommandsNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdExecuteGeneratedCommandsNV(commandBuffer, isPreprocessed, pGeneratedCommandsInfo,
+                                           true /* do lock */);
+}
+static void dynCheck_entry_vkCmdExecuteGeneratedCommandsNV(
+    VkCommandBuffer commandBuffer, VkBool32 isPreprocessed,
+    const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_NV_device_generated_commands")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdExecuteGeneratedCommandsNV",
+                                         "VK_NV_device_generated_commands");
+    }
+    AEMU_SCOPED_TRACE("vkCmdExecuteGeneratedCommandsNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdExecuteGeneratedCommandsNV(commandBuffer, isPreprocessed, pGeneratedCommandsInfo,
+                                           true /* do lock */);
+}
+static void entry_vkCmdBindPipelineShaderGroupNV(VkCommandBuffer commandBuffer,
+                                                 VkPipelineBindPoint pipelineBindPoint,
+                                                 VkPipeline pipeline, uint32_t groupIndex) {
+    AEMU_SCOPED_TRACE("vkCmdBindPipelineShaderGroupNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBindPipelineShaderGroupNV(commandBuffer, pipelineBindPoint, pipeline, groupIndex,
+                                          true /* do lock */);
+}
+static void dynCheck_entry_vkCmdBindPipelineShaderGroupNV(VkCommandBuffer commandBuffer,
+                                                          VkPipelineBindPoint pipelineBindPoint,
+                                                          VkPipeline pipeline,
+                                                          uint32_t groupIndex) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_NV_device_generated_commands")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdBindPipelineShaderGroupNV",
+                                         "VK_NV_device_generated_commands");
+    }
+    AEMU_SCOPED_TRACE("vkCmdBindPipelineShaderGroupNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBindPipelineShaderGroupNV(commandBuffer, pipelineBindPoint, pipeline, groupIndex,
+                                          true /* do lock */);
+}
+static VkResult entry_vkCreateIndirectCommandsLayoutNV(
+    VkDevice device, const VkIndirectCommandsLayoutCreateInfoNV* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkIndirectCommandsLayoutNV* pIndirectCommandsLayout) {
+    AEMU_SCOPED_TRACE("vkCreateIndirectCommandsLayoutNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateIndirectCommandsLayoutNV_VkResult_return = (VkResult)0;
+    vkCreateIndirectCommandsLayoutNV_VkResult_return = vkEnc->vkCreateIndirectCommandsLayoutNV(
+        device, pCreateInfo, pAllocator, pIndirectCommandsLayout, true /* do lock */);
+    return vkCreateIndirectCommandsLayoutNV_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCreateIndirectCommandsLayoutNV(
+    VkDevice device, const VkIndirectCommandsLayoutCreateInfoNV* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkIndirectCommandsLayoutNV* pIndirectCommandsLayout) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_NV_device_generated_commands")) {
+        sOnInvalidDynamicallyCheckedCall("vkCreateIndirectCommandsLayoutNV",
+                                         "VK_NV_device_generated_commands");
+    }
+    AEMU_SCOPED_TRACE("vkCreateIndirectCommandsLayoutNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateIndirectCommandsLayoutNV_VkResult_return = (VkResult)0;
+    vkCreateIndirectCommandsLayoutNV_VkResult_return = vkEnc->vkCreateIndirectCommandsLayoutNV(
+        device, pCreateInfo, pAllocator, pIndirectCommandsLayout, true /* do lock */);
+    return vkCreateIndirectCommandsLayoutNV_VkResult_return;
+}
+static void entry_vkDestroyIndirectCommandsLayoutNV(
+    VkDevice device, VkIndirectCommandsLayoutNV indirectCommandsLayout,
+    const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyIndirectCommandsLayoutNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyIndirectCommandsLayoutNV(device, indirectCommandsLayout, pAllocator,
+                                             true /* do lock */);
+}
+static void dynCheck_entry_vkDestroyIndirectCommandsLayoutNV(
+    VkDevice device, VkIndirectCommandsLayoutNV indirectCommandsLayout,
+    const VkAllocationCallbacks* pAllocator) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_NV_device_generated_commands")) {
+        sOnInvalidDynamicallyCheckedCall("vkDestroyIndirectCommandsLayoutNV",
+                                         "VK_NV_device_generated_commands");
+    }
+    AEMU_SCOPED_TRACE("vkDestroyIndirectCommandsLayoutNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyIndirectCommandsLayoutNV(device, indirectCommandsLayout, pAllocator,
+                                             true /* do lock */);
+}
+#endif
+#ifdef VK_NV_inherited_viewport_scissor
+#endif
+#ifdef VK_EXT_texel_buffer_alignment
+#endif
+#ifdef VK_QCOM_render_pass_transform
+#endif
+#ifdef VK_EXT_device_memory_report
+#endif
+#ifdef VK_EXT_acquire_drm_display
+static VkResult entry_vkAcquireDrmDisplayEXT(VkPhysicalDevice physicalDevice, int32_t drmFd,
+                                             VkDisplayKHR display) {
+    AEMU_SCOPED_TRACE("vkAcquireDrmDisplayEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkAcquireDrmDisplayEXT_VkResult_return = (VkResult)0;
+    vkAcquireDrmDisplayEXT_VkResult_return =
+        vkEnc->vkAcquireDrmDisplayEXT(physicalDevice, drmFd, display, true /* do lock */);
+    return vkAcquireDrmDisplayEXT_VkResult_return;
+}
+static VkResult entry_vkGetDrmDisplayEXT(VkPhysicalDevice physicalDevice, int32_t drmFd,
+                                         uint32_t connectorId, VkDisplayKHR* display) {
+    AEMU_SCOPED_TRACE("vkGetDrmDisplayEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetDrmDisplayEXT_VkResult_return = (VkResult)0;
+    vkGetDrmDisplayEXT_VkResult_return =
+        vkEnc->vkGetDrmDisplayEXT(physicalDevice, drmFd, connectorId, display, true /* do lock */);
+    return vkGetDrmDisplayEXT_VkResult_return;
+}
+#endif
+#ifdef VK_EXT_robustness2
+#endif
+#ifdef VK_EXT_custom_border_color
+#endif
+#ifdef VK_GOOGLE_user_type
+#endif
+#ifdef VK_EXT_private_data
+static VkResult entry_vkCreatePrivateDataSlotEXT(VkDevice device,
+                                                 const VkPrivateDataSlotCreateInfoEXT* pCreateInfo,
+                                                 const VkAllocationCallbacks* pAllocator,
+                                                 VkPrivateDataSlotEXT* pPrivateDataSlot) {
+    AEMU_SCOPED_TRACE("vkCreatePrivateDataSlotEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreatePrivateDataSlotEXT_VkResult_return = (VkResult)0;
+    vkCreatePrivateDataSlotEXT_VkResult_return = vkEnc->vkCreatePrivateDataSlotEXT(
+        device, pCreateInfo, pAllocator, pPrivateDataSlot, true /* do lock */);
+    return vkCreatePrivateDataSlotEXT_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCreatePrivateDataSlotEXT(
+    VkDevice device, const VkPrivateDataSlotCreateInfoEXT* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkPrivateDataSlotEXT* pPrivateDataSlot) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_EXT_private_data")) {
+        sOnInvalidDynamicallyCheckedCall("vkCreatePrivateDataSlotEXT", "VK_EXT_private_data");
+    }
+    AEMU_SCOPED_TRACE("vkCreatePrivateDataSlotEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreatePrivateDataSlotEXT_VkResult_return = (VkResult)0;
+    vkCreatePrivateDataSlotEXT_VkResult_return = vkEnc->vkCreatePrivateDataSlotEXT(
+        device, pCreateInfo, pAllocator, pPrivateDataSlot, true /* do lock */);
+    return vkCreatePrivateDataSlotEXT_VkResult_return;
+}
+static void entry_vkDestroyPrivateDataSlotEXT(VkDevice device, VkPrivateDataSlotEXT privateDataSlot,
+                                              const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyPrivateDataSlotEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyPrivateDataSlotEXT(device, privateDataSlot, pAllocator, true /* do lock */);
+}
+static void dynCheck_entry_vkDestroyPrivateDataSlotEXT(VkDevice device,
+                                                       VkPrivateDataSlotEXT privateDataSlot,
+                                                       const VkAllocationCallbacks* pAllocator) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_EXT_private_data")) {
+        sOnInvalidDynamicallyCheckedCall("vkDestroyPrivateDataSlotEXT", "VK_EXT_private_data");
+    }
+    AEMU_SCOPED_TRACE("vkDestroyPrivateDataSlotEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyPrivateDataSlotEXT(device, privateDataSlot, pAllocator, true /* do lock */);
+}
+static VkResult entry_vkSetPrivateDataEXT(VkDevice device, VkObjectType objectType,
+                                          uint64_t objectHandle,
+                                          VkPrivateDataSlotEXT privateDataSlot, uint64_t data) {
+    AEMU_SCOPED_TRACE("vkSetPrivateDataEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkSetPrivateDataEXT_VkResult_return = (VkResult)0;
+    vkSetPrivateDataEXT_VkResult_return = vkEnc->vkSetPrivateDataEXT(
+        device, objectType, objectHandle, privateDataSlot, data, true /* do lock */);
+    return vkSetPrivateDataEXT_VkResult_return;
+}
+static VkResult dynCheck_entry_vkSetPrivateDataEXT(VkDevice device, VkObjectType objectType,
+                                                   uint64_t objectHandle,
+                                                   VkPrivateDataSlotEXT privateDataSlot,
+                                                   uint64_t data) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_EXT_private_data")) {
+        sOnInvalidDynamicallyCheckedCall("vkSetPrivateDataEXT", "VK_EXT_private_data");
+    }
+    AEMU_SCOPED_TRACE("vkSetPrivateDataEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkSetPrivateDataEXT_VkResult_return = (VkResult)0;
+    vkSetPrivateDataEXT_VkResult_return = vkEnc->vkSetPrivateDataEXT(
+        device, objectType, objectHandle, privateDataSlot, data, true /* do lock */);
+    return vkSetPrivateDataEXT_VkResult_return;
+}
+static void entry_vkGetPrivateDataEXT(VkDevice device, VkObjectType objectType,
+                                      uint64_t objectHandle, VkPrivateDataSlotEXT privateDataSlot,
+                                      uint64_t* pData) {
+    AEMU_SCOPED_TRACE("vkGetPrivateDataEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetPrivateDataEXT(device, objectType, objectHandle, privateDataSlot, pData,
+                               true /* do lock */);
+}
+static void dynCheck_entry_vkGetPrivateDataEXT(VkDevice device, VkObjectType objectType,
+                                               uint64_t objectHandle,
+                                               VkPrivateDataSlotEXT privateDataSlot,
+                                               uint64_t* pData) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_EXT_private_data")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetPrivateDataEXT", "VK_EXT_private_data");
+    }
+    AEMU_SCOPED_TRACE("vkGetPrivateDataEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetPrivateDataEXT(device, objectType, objectHandle, privateDataSlot, pData,
+                               true /* do lock */);
+}
+#endif
+#ifdef VK_EXT_pipeline_creation_cache_control
+#endif
+#ifdef VK_NV_device_diagnostics_config
+#endif
+#ifdef VK_QCOM_render_pass_store_ops
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+static void entry_vkCmdSetFragmentShadingRateEnumNV(
+    VkCommandBuffer commandBuffer, VkFragmentShadingRateNV shadingRate,
+    const VkFragmentShadingRateCombinerOpKHR combinerOps[2]) {
+    AEMU_SCOPED_TRACE("vkCmdSetFragmentShadingRateEnumNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetFragmentShadingRateEnumNV(commandBuffer, shadingRate, combinerOps,
+                                             true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetFragmentShadingRateEnumNV(
+    VkCommandBuffer commandBuffer, VkFragmentShadingRateNV shadingRate,
+    const VkFragmentShadingRateCombinerOpKHR combinerOps[2]) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_NV_fragment_shading_rate_enums")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetFragmentShadingRateEnumNV",
+                                         "VK_NV_fragment_shading_rate_enums");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetFragmentShadingRateEnumNV");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetFragmentShadingRateEnumNV(commandBuffer, shadingRate, combinerOps,
+                                             true /* do lock */);
+}
+#endif
+#ifdef VK_NV_ray_tracing_motion_blur
+#endif
+#ifdef VK_EXT_ycbcr_2plane_444_formats
+#endif
+#ifdef VK_EXT_fragment_density_map2
+#endif
+#ifdef VK_QCOM_rotated_copy_commands
+#endif
+#ifdef VK_EXT_image_robustness
+#endif
+#ifdef VK_EXT_4444_formats
+#endif
+#ifdef VK_EXT_rgba10x6_formats
+#endif
+#ifdef VK_NV_acquire_winrt_display
+static VkResult entry_vkAcquireWinrtDisplayNV(VkPhysicalDevice physicalDevice,
+                                              VkDisplayKHR display) {
+    AEMU_SCOPED_TRACE("vkAcquireWinrtDisplayNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkAcquireWinrtDisplayNV_VkResult_return = (VkResult)0;
+    vkAcquireWinrtDisplayNV_VkResult_return =
+        vkEnc->vkAcquireWinrtDisplayNV(physicalDevice, display, true /* do lock */);
+    return vkAcquireWinrtDisplayNV_VkResult_return;
+}
+static VkResult entry_vkGetWinrtDisplayNV(VkPhysicalDevice physicalDevice,
+                                          uint32_t deviceRelativeId, VkDisplayKHR* pDisplay) {
+    AEMU_SCOPED_TRACE("vkGetWinrtDisplayNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetWinrtDisplayNV_VkResult_return = (VkResult)0;
+    vkGetWinrtDisplayNV_VkResult_return =
+        vkEnc->vkGetWinrtDisplayNV(physicalDevice, deviceRelativeId, pDisplay, true /* do lock */);
+    return vkGetWinrtDisplayNV_VkResult_return;
+}
+#endif
+#ifdef VK_EXT_directfb_surface
+static VkResult entry_vkCreateDirectFBSurfaceEXT(VkInstance instance,
+                                                 const VkDirectFBSurfaceCreateInfoEXT* pCreateInfo,
+                                                 const VkAllocationCallbacks* pAllocator,
+                                                 VkSurfaceKHR* pSurface) {
+    AEMU_SCOPED_TRACE("vkCreateDirectFBSurfaceEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateDirectFBSurfaceEXT_VkResult_return = (VkResult)0;
+    vkCreateDirectFBSurfaceEXT_VkResult_return = vkEnc->vkCreateDirectFBSurfaceEXT(
+        instance, pCreateInfo, pAllocator, pSurface, true /* do lock */);
+    return vkCreateDirectFBSurfaceEXT_VkResult_return;
+}
+static VkBool32 entry_vkGetPhysicalDeviceDirectFBPresentationSupportEXT(
+    VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, IDirectFB* dfb) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceDirectFBPresentationSupportEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkBool32 vkGetPhysicalDeviceDirectFBPresentationSupportEXT_VkBool32_return = (VkBool32)0;
+    vkGetPhysicalDeviceDirectFBPresentationSupportEXT_VkBool32_return =
+        vkEnc->vkGetPhysicalDeviceDirectFBPresentationSupportEXT(physicalDevice, queueFamilyIndex,
+                                                                 dfb, true /* do lock */);
+    return vkGetPhysicalDeviceDirectFBPresentationSupportEXT_VkBool32_return;
+}
+#endif
+#ifdef VK_VALVE_mutable_descriptor_type
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+static void entry_vkCmdSetVertexInputEXT(
+    VkCommandBuffer commandBuffer, uint32_t vertexBindingDescriptionCount,
+    const VkVertexInputBindingDescription2EXT* pVertexBindingDescriptions,
+    uint32_t vertexAttributeDescriptionCount,
+    const VkVertexInputAttributeDescription2EXT* pVertexAttributeDescriptions) {
+    AEMU_SCOPED_TRACE("vkCmdSetVertexInputEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetVertexInputEXT(commandBuffer, vertexBindingDescriptionCount,
+                                  pVertexBindingDescriptions, vertexAttributeDescriptionCount,
+                                  pVertexAttributeDescriptions, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetVertexInputEXT(
+    VkCommandBuffer commandBuffer, uint32_t vertexBindingDescriptionCount,
+    const VkVertexInputBindingDescription2EXT* pVertexBindingDescriptions,
+    uint32_t vertexAttributeDescriptionCount,
+    const VkVertexInputAttributeDescription2EXT* pVertexAttributeDescriptions) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_vertex_input_dynamic_state")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetVertexInputEXT",
+                                         "VK_EXT_vertex_input_dynamic_state");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetVertexInputEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetVertexInputEXT(commandBuffer, vertexBindingDescriptionCount,
+                                  pVertexBindingDescriptions, vertexAttributeDescriptionCount,
+                                  pVertexAttributeDescriptions, true /* do lock */);
+}
+#endif
+#ifdef VK_EXT_physical_device_drm
+#endif
+#ifdef VK_EXT_primitive_topology_list_restart
+#endif
+#ifdef VK_FUCHSIA_external_memory
+static VkResult entry_vkGetMemoryZirconHandleFUCHSIA(
+    VkDevice device, const VkMemoryGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo,
+    zx_handle_t* pZirconHandle) {
+    AEMU_SCOPED_TRACE("vkGetMemoryZirconHandleFUCHSIA");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetMemoryZirconHandleFUCHSIA_VkResult_return = (VkResult)0;
+    vkGetMemoryZirconHandleFUCHSIA_VkResult_return = vkEnc->vkGetMemoryZirconHandleFUCHSIA(
+        device, pGetZirconHandleInfo, pZirconHandle, true /* do lock */);
+    return vkGetMemoryZirconHandleFUCHSIA_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetMemoryZirconHandleFUCHSIA(
+    VkDevice device, const VkMemoryGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo,
+    zx_handle_t* pZirconHandle) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_FUCHSIA_external_memory")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetMemoryZirconHandleFUCHSIA",
+                                         "VK_FUCHSIA_external_memory");
+    }
+    AEMU_SCOPED_TRACE("vkGetMemoryZirconHandleFUCHSIA");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetMemoryZirconHandleFUCHSIA_VkResult_return = (VkResult)0;
+    vkGetMemoryZirconHandleFUCHSIA_VkResult_return = vkEnc->vkGetMemoryZirconHandleFUCHSIA(
+        device, pGetZirconHandleInfo, pZirconHandle, true /* do lock */);
+    return vkGetMemoryZirconHandleFUCHSIA_VkResult_return;
+}
+static VkResult entry_vkGetMemoryZirconHandlePropertiesFUCHSIA(
+    VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, zx_handle_t zirconHandle,
+    VkMemoryZirconHandlePropertiesFUCHSIA* pMemoryZirconHandleProperties) {
+    AEMU_SCOPED_TRACE("vkGetMemoryZirconHandlePropertiesFUCHSIA");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetMemoryZirconHandlePropertiesFUCHSIA_VkResult_return = (VkResult)0;
+    vkGetMemoryZirconHandlePropertiesFUCHSIA_VkResult_return =
+        vkEnc->vkGetMemoryZirconHandlePropertiesFUCHSIA(
+            device, handleType, zirconHandle, pMemoryZirconHandleProperties, true /* do lock */);
+    return vkGetMemoryZirconHandlePropertiesFUCHSIA_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetMemoryZirconHandlePropertiesFUCHSIA(
+    VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, zx_handle_t zirconHandle,
+    VkMemoryZirconHandlePropertiesFUCHSIA* pMemoryZirconHandleProperties) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_FUCHSIA_external_memory")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetMemoryZirconHandlePropertiesFUCHSIA",
+                                         "VK_FUCHSIA_external_memory");
+    }
+    AEMU_SCOPED_TRACE("vkGetMemoryZirconHandlePropertiesFUCHSIA");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetMemoryZirconHandlePropertiesFUCHSIA_VkResult_return = (VkResult)0;
+    vkGetMemoryZirconHandlePropertiesFUCHSIA_VkResult_return =
+        vkEnc->vkGetMemoryZirconHandlePropertiesFUCHSIA(
+            device, handleType, zirconHandle, pMemoryZirconHandleProperties, true /* do lock */);
+    return vkGetMemoryZirconHandlePropertiesFUCHSIA_VkResult_return;
+}
+#endif
+#ifdef VK_FUCHSIA_external_semaphore
+static VkResult entry_vkImportSemaphoreZirconHandleFUCHSIA(
+    VkDevice device,
+    const VkImportSemaphoreZirconHandleInfoFUCHSIA* pImportSemaphoreZirconHandleInfo) {
+    AEMU_SCOPED_TRACE("vkImportSemaphoreZirconHandleFUCHSIA");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkImportSemaphoreZirconHandleFUCHSIA_VkResult_return = (VkResult)0;
+    vkImportSemaphoreZirconHandleFUCHSIA_VkResult_return =
+        vkEnc->vkImportSemaphoreZirconHandleFUCHSIA(device, pImportSemaphoreZirconHandleInfo,
+                                                    true /* do lock */);
+    return vkImportSemaphoreZirconHandleFUCHSIA_VkResult_return;
+}
+static VkResult dynCheck_entry_vkImportSemaphoreZirconHandleFUCHSIA(
+    VkDevice device,
+    const VkImportSemaphoreZirconHandleInfoFUCHSIA* pImportSemaphoreZirconHandleInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_FUCHSIA_external_semaphore")) {
+        sOnInvalidDynamicallyCheckedCall("vkImportSemaphoreZirconHandleFUCHSIA",
+                                         "VK_FUCHSIA_external_semaphore");
+    }
+    AEMU_SCOPED_TRACE("vkImportSemaphoreZirconHandleFUCHSIA");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkImportSemaphoreZirconHandleFUCHSIA_VkResult_return = (VkResult)0;
+    vkImportSemaphoreZirconHandleFUCHSIA_VkResult_return =
+        vkEnc->vkImportSemaphoreZirconHandleFUCHSIA(device, pImportSemaphoreZirconHandleInfo,
+                                                    true /* do lock */);
+    return vkImportSemaphoreZirconHandleFUCHSIA_VkResult_return;
+}
+static VkResult entry_vkGetSemaphoreZirconHandleFUCHSIA(
+    VkDevice device, const VkSemaphoreGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo,
+    zx_handle_t* pZirconHandle) {
+    AEMU_SCOPED_TRACE("vkGetSemaphoreZirconHandleFUCHSIA");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetSemaphoreZirconHandleFUCHSIA_VkResult_return = (VkResult)0;
+    vkGetSemaphoreZirconHandleFUCHSIA_VkResult_return = vkEnc->vkGetSemaphoreZirconHandleFUCHSIA(
+        device, pGetZirconHandleInfo, pZirconHandle, true /* do lock */);
+    return vkGetSemaphoreZirconHandleFUCHSIA_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetSemaphoreZirconHandleFUCHSIA(
+    VkDevice device, const VkSemaphoreGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo,
+    zx_handle_t* pZirconHandle) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_FUCHSIA_external_semaphore")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetSemaphoreZirconHandleFUCHSIA",
+                                         "VK_FUCHSIA_external_semaphore");
+    }
+    AEMU_SCOPED_TRACE("vkGetSemaphoreZirconHandleFUCHSIA");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetSemaphoreZirconHandleFUCHSIA_VkResult_return = (VkResult)0;
+    vkGetSemaphoreZirconHandleFUCHSIA_VkResult_return = vkEnc->vkGetSemaphoreZirconHandleFUCHSIA(
+        device, pGetZirconHandleInfo, pZirconHandle, true /* do lock */);
+    return vkGetSemaphoreZirconHandleFUCHSIA_VkResult_return;
+}
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+static VkResult entry_vkCreateBufferCollectionFUCHSIA(
+    VkDevice device, const VkBufferCollectionCreateInfoFUCHSIA* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkBufferCollectionFUCHSIA* pCollection) {
+    AEMU_SCOPED_TRACE("vkCreateBufferCollectionFUCHSIA");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateBufferCollectionFUCHSIA_VkResult_return = (VkResult)0;
+    vkCreateBufferCollectionFUCHSIA_VkResult_return = vkEnc->vkCreateBufferCollectionFUCHSIA(
+        device, pCreateInfo, pAllocator, pCollection, true /* do lock */);
+    return vkCreateBufferCollectionFUCHSIA_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCreateBufferCollectionFUCHSIA(
+    VkDevice device, const VkBufferCollectionCreateInfoFUCHSIA* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkBufferCollectionFUCHSIA* pCollection) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_FUCHSIA_buffer_collection")) {
+        sOnInvalidDynamicallyCheckedCall("vkCreateBufferCollectionFUCHSIA",
+                                         "VK_FUCHSIA_buffer_collection");
+    }
+    AEMU_SCOPED_TRACE("vkCreateBufferCollectionFUCHSIA");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateBufferCollectionFUCHSIA_VkResult_return = (VkResult)0;
+    vkCreateBufferCollectionFUCHSIA_VkResult_return = vkEnc->vkCreateBufferCollectionFUCHSIA(
+        device, pCreateInfo, pAllocator, pCollection, true /* do lock */);
+    return vkCreateBufferCollectionFUCHSIA_VkResult_return;
+}
+static VkResult entry_vkSetBufferCollectionImageConstraintsFUCHSIA(
+    VkDevice device, VkBufferCollectionFUCHSIA collection,
+    const VkImageConstraintsInfoFUCHSIA* pImageConstraintsInfo) {
+    AEMU_SCOPED_TRACE("vkSetBufferCollectionImageConstraintsFUCHSIA");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkSetBufferCollectionImageConstraintsFUCHSIA_VkResult_return = (VkResult)0;
+    vkSetBufferCollectionImageConstraintsFUCHSIA_VkResult_return =
+        vkEnc->vkSetBufferCollectionImageConstraintsFUCHSIA(
+            device, collection, pImageConstraintsInfo, true /* do lock */);
+    return vkSetBufferCollectionImageConstraintsFUCHSIA_VkResult_return;
+}
+static VkResult dynCheck_entry_vkSetBufferCollectionImageConstraintsFUCHSIA(
+    VkDevice device, VkBufferCollectionFUCHSIA collection,
+    const VkImageConstraintsInfoFUCHSIA* pImageConstraintsInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_FUCHSIA_buffer_collection")) {
+        sOnInvalidDynamicallyCheckedCall("vkSetBufferCollectionImageConstraintsFUCHSIA",
+                                         "VK_FUCHSIA_buffer_collection");
+    }
+    AEMU_SCOPED_TRACE("vkSetBufferCollectionImageConstraintsFUCHSIA");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkSetBufferCollectionImageConstraintsFUCHSIA_VkResult_return = (VkResult)0;
+    vkSetBufferCollectionImageConstraintsFUCHSIA_VkResult_return =
+        vkEnc->vkSetBufferCollectionImageConstraintsFUCHSIA(
+            device, collection, pImageConstraintsInfo, true /* do lock */);
+    return vkSetBufferCollectionImageConstraintsFUCHSIA_VkResult_return;
+}
+static VkResult entry_vkSetBufferCollectionBufferConstraintsFUCHSIA(
+    VkDevice device, VkBufferCollectionFUCHSIA collection,
+    const VkBufferConstraintsInfoFUCHSIA* pBufferConstraintsInfo) {
+    AEMU_SCOPED_TRACE("vkSetBufferCollectionBufferConstraintsFUCHSIA");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkSetBufferCollectionBufferConstraintsFUCHSIA_VkResult_return = (VkResult)0;
+    vkSetBufferCollectionBufferConstraintsFUCHSIA_VkResult_return =
+        vkEnc->vkSetBufferCollectionBufferConstraintsFUCHSIA(
+            device, collection, pBufferConstraintsInfo, true /* do lock */);
+    return vkSetBufferCollectionBufferConstraintsFUCHSIA_VkResult_return;
+}
+static VkResult dynCheck_entry_vkSetBufferCollectionBufferConstraintsFUCHSIA(
+    VkDevice device, VkBufferCollectionFUCHSIA collection,
+    const VkBufferConstraintsInfoFUCHSIA* pBufferConstraintsInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_FUCHSIA_buffer_collection")) {
+        sOnInvalidDynamicallyCheckedCall("vkSetBufferCollectionBufferConstraintsFUCHSIA",
+                                         "VK_FUCHSIA_buffer_collection");
+    }
+    AEMU_SCOPED_TRACE("vkSetBufferCollectionBufferConstraintsFUCHSIA");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkSetBufferCollectionBufferConstraintsFUCHSIA_VkResult_return = (VkResult)0;
+    vkSetBufferCollectionBufferConstraintsFUCHSIA_VkResult_return =
+        vkEnc->vkSetBufferCollectionBufferConstraintsFUCHSIA(
+            device, collection, pBufferConstraintsInfo, true /* do lock */);
+    return vkSetBufferCollectionBufferConstraintsFUCHSIA_VkResult_return;
+}
+static void entry_vkDestroyBufferCollectionFUCHSIA(VkDevice device,
+                                                   VkBufferCollectionFUCHSIA collection,
+                                                   const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyBufferCollectionFUCHSIA");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyBufferCollectionFUCHSIA(device, collection, pAllocator, true /* do lock */);
+}
+static void dynCheck_entry_vkDestroyBufferCollectionFUCHSIA(
+    VkDevice device, VkBufferCollectionFUCHSIA collection,
+    const VkAllocationCallbacks* pAllocator) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_FUCHSIA_buffer_collection")) {
+        sOnInvalidDynamicallyCheckedCall("vkDestroyBufferCollectionFUCHSIA",
+                                         "VK_FUCHSIA_buffer_collection");
+    }
+    AEMU_SCOPED_TRACE("vkDestroyBufferCollectionFUCHSIA");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyBufferCollectionFUCHSIA(device, collection, pAllocator, true /* do lock */);
+}
+static VkResult entry_vkGetBufferCollectionPropertiesFUCHSIA(
+    VkDevice device, VkBufferCollectionFUCHSIA collection,
+    VkBufferCollectionPropertiesFUCHSIA* pProperties) {
+    AEMU_SCOPED_TRACE("vkGetBufferCollectionPropertiesFUCHSIA");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetBufferCollectionPropertiesFUCHSIA_VkResult_return = (VkResult)0;
+    vkGetBufferCollectionPropertiesFUCHSIA_VkResult_return =
+        vkEnc->vkGetBufferCollectionPropertiesFUCHSIA(device, collection, pProperties,
+                                                      true /* do lock */);
+    return vkGetBufferCollectionPropertiesFUCHSIA_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetBufferCollectionPropertiesFUCHSIA(
+    VkDevice device, VkBufferCollectionFUCHSIA collection,
+    VkBufferCollectionPropertiesFUCHSIA* pProperties) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_FUCHSIA_buffer_collection")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetBufferCollectionPropertiesFUCHSIA",
+                                         "VK_FUCHSIA_buffer_collection");
+    }
+    AEMU_SCOPED_TRACE("vkGetBufferCollectionPropertiesFUCHSIA");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetBufferCollectionPropertiesFUCHSIA_VkResult_return = (VkResult)0;
+    vkGetBufferCollectionPropertiesFUCHSIA_VkResult_return =
+        vkEnc->vkGetBufferCollectionPropertiesFUCHSIA(device, collection, pProperties,
+                                                      true /* do lock */);
+    return vkGetBufferCollectionPropertiesFUCHSIA_VkResult_return;
+}
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+static VkResult entry_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI(
+    VkDevice device, VkRenderPass renderpass, VkExtent2D* pMaxWorkgroupSize) {
+    AEMU_SCOPED_TRACE("vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI_VkResult_return = (VkResult)0;
+    vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI_VkResult_return =
+        vkEnc->vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI(
+            device, renderpass, pMaxWorkgroupSize, true /* do lock */);
+    return vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI(
+    VkDevice device, VkRenderPass renderpass, VkExtent2D* pMaxWorkgroupSize) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_HUAWEI_subpass_shading")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI",
+                                         "VK_HUAWEI_subpass_shading");
+    }
+    AEMU_SCOPED_TRACE("vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI_VkResult_return = (VkResult)0;
+    vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI_VkResult_return =
+        vkEnc->vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI(
+            device, renderpass, pMaxWorkgroupSize, true /* do lock */);
+    return vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI_VkResult_return;
+}
+static void entry_vkCmdSubpassShadingHUAWEI(VkCommandBuffer commandBuffer) {
+    AEMU_SCOPED_TRACE("vkCmdSubpassShadingHUAWEI");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSubpassShadingHUAWEI(commandBuffer, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSubpassShadingHUAWEI(VkCommandBuffer commandBuffer) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_HUAWEI_subpass_shading")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSubpassShadingHUAWEI", "VK_HUAWEI_subpass_shading");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSubpassShadingHUAWEI");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSubpassShadingHUAWEI(commandBuffer, true /* do lock */);
+}
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+static void entry_vkCmdBindInvocationMaskHUAWEI(VkCommandBuffer commandBuffer,
+                                                VkImageView imageView, VkImageLayout imageLayout) {
+    AEMU_SCOPED_TRACE("vkCmdBindInvocationMaskHUAWEI");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBindInvocationMaskHUAWEI(commandBuffer, imageView, imageLayout, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdBindInvocationMaskHUAWEI(VkCommandBuffer commandBuffer,
+                                                         VkImageView imageView,
+                                                         VkImageLayout imageLayout) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_HUAWEI_invocation_mask")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdBindInvocationMaskHUAWEI",
+                                         "VK_HUAWEI_invocation_mask");
+    }
+    AEMU_SCOPED_TRACE("vkCmdBindInvocationMaskHUAWEI");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBindInvocationMaskHUAWEI(commandBuffer, imageView, imageLayout, true /* do lock */);
+}
+#endif
+#ifdef VK_NV_external_memory_rdma
+static VkResult entry_vkGetMemoryRemoteAddressNV(
+    VkDevice device, const VkMemoryGetRemoteAddressInfoNV* pMemoryGetRemoteAddressInfo,
+    VkRemoteAddressNV* pAddress) {
+    AEMU_SCOPED_TRACE("vkGetMemoryRemoteAddressNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetMemoryRemoteAddressNV_VkResult_return = (VkResult)0;
+    vkGetMemoryRemoteAddressNV_VkResult_return = vkEnc->vkGetMemoryRemoteAddressNV(
+        device, pMemoryGetRemoteAddressInfo, pAddress, true /* do lock */);
+    return vkGetMemoryRemoteAddressNV_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetMemoryRemoteAddressNV(
+    VkDevice device, const VkMemoryGetRemoteAddressInfoNV* pMemoryGetRemoteAddressInfo,
+    VkRemoteAddressNV* pAddress) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_NV_external_memory_rdma")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetMemoryRemoteAddressNV",
+                                         "VK_NV_external_memory_rdma");
+    }
+    AEMU_SCOPED_TRACE("vkGetMemoryRemoteAddressNV");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetMemoryRemoteAddressNV_VkResult_return = (VkResult)0;
+    vkGetMemoryRemoteAddressNV_VkResult_return = vkEnc->vkGetMemoryRemoteAddressNV(
+        device, pMemoryGetRemoteAddressInfo, pAddress, true /* do lock */);
+    return vkGetMemoryRemoteAddressNV_VkResult_return;
+}
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+static void entry_vkCmdSetPatchControlPointsEXT(VkCommandBuffer commandBuffer,
+                                                uint32_t patchControlPoints) {
+    AEMU_SCOPED_TRACE("vkCmdSetPatchControlPointsEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetPatchControlPointsEXT(commandBuffer, patchControlPoints, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetPatchControlPointsEXT(VkCommandBuffer commandBuffer,
+                                                         uint32_t patchControlPoints) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state2")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetPatchControlPointsEXT",
+                                         "VK_EXT_extended_dynamic_state2");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetPatchControlPointsEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetPatchControlPointsEXT(commandBuffer, patchControlPoints, true /* do lock */);
+}
+static void entry_vkCmdSetRasterizerDiscardEnableEXT(VkCommandBuffer commandBuffer,
+                                                     VkBool32 rasterizerDiscardEnable) {
+    AEMU_SCOPED_TRACE("vkCmdSetRasterizerDiscardEnableEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetRasterizerDiscardEnableEXT(commandBuffer, rasterizerDiscardEnable,
+                                              true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetRasterizerDiscardEnableEXT(VkCommandBuffer commandBuffer,
+                                                              VkBool32 rasterizerDiscardEnable) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state2")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetRasterizerDiscardEnableEXT",
+                                         "VK_EXT_extended_dynamic_state2");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetRasterizerDiscardEnableEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetRasterizerDiscardEnableEXT(commandBuffer, rasterizerDiscardEnable,
+                                              true /* do lock */);
+}
+static void entry_vkCmdSetDepthBiasEnableEXT(VkCommandBuffer commandBuffer,
+                                             VkBool32 depthBiasEnable) {
+    AEMU_SCOPED_TRACE("vkCmdSetDepthBiasEnableEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetDepthBiasEnableEXT(commandBuffer, depthBiasEnable, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetDepthBiasEnableEXT(VkCommandBuffer commandBuffer,
+                                                      VkBool32 depthBiasEnable) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state2")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetDepthBiasEnableEXT",
+                                         "VK_EXT_extended_dynamic_state2");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetDepthBiasEnableEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetDepthBiasEnableEXT(commandBuffer, depthBiasEnable, true /* do lock */);
+}
+static void entry_vkCmdSetLogicOpEXT(VkCommandBuffer commandBuffer, VkLogicOp logicOp) {
+    AEMU_SCOPED_TRACE("vkCmdSetLogicOpEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetLogicOpEXT(commandBuffer, logicOp, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetLogicOpEXT(VkCommandBuffer commandBuffer, VkLogicOp logicOp) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state2")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetLogicOpEXT", "VK_EXT_extended_dynamic_state2");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetLogicOpEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetLogicOpEXT(commandBuffer, logicOp, true /* do lock */);
+}
+static void entry_vkCmdSetPrimitiveRestartEnableEXT(VkCommandBuffer commandBuffer,
+                                                    VkBool32 primitiveRestartEnable) {
+    AEMU_SCOPED_TRACE("vkCmdSetPrimitiveRestartEnableEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetPrimitiveRestartEnableEXT(commandBuffer, primitiveRestartEnable,
+                                             true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetPrimitiveRestartEnableEXT(VkCommandBuffer commandBuffer,
+                                                             VkBool32 primitiveRestartEnable) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state2")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetPrimitiveRestartEnableEXT",
+                                         "VK_EXT_extended_dynamic_state2");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetPrimitiveRestartEnableEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetPrimitiveRestartEnableEXT(commandBuffer, primitiveRestartEnable,
+                                             true /* do lock */);
+}
+#endif
+#ifdef VK_QNX_screen_surface
+static VkResult entry_vkCreateScreenSurfaceQNX(VkInstance instance,
+                                               const VkScreenSurfaceCreateInfoQNX* pCreateInfo,
+                                               const VkAllocationCallbacks* pAllocator,
+                                               VkSurfaceKHR* pSurface) {
+    AEMU_SCOPED_TRACE("vkCreateScreenSurfaceQNX");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateScreenSurfaceQNX_VkResult_return = (VkResult)0;
+    vkCreateScreenSurfaceQNX_VkResult_return = vkEnc->vkCreateScreenSurfaceQNX(
+        instance, pCreateInfo, pAllocator, pSurface, true /* do lock */);
+    return vkCreateScreenSurfaceQNX_VkResult_return;
+}
+static VkBool32 entry_vkGetPhysicalDeviceScreenPresentationSupportQNX(
+    VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, _screen_window* window) {
+    AEMU_SCOPED_TRACE("vkGetPhysicalDeviceScreenPresentationSupportQNX");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkBool32 vkGetPhysicalDeviceScreenPresentationSupportQNX_VkBool32_return = (VkBool32)0;
+    vkGetPhysicalDeviceScreenPresentationSupportQNX_VkBool32_return =
+        vkEnc->vkGetPhysicalDeviceScreenPresentationSupportQNX(physicalDevice, queueFamilyIndex,
+                                                               window, true /* do lock */);
+    return vkGetPhysicalDeviceScreenPresentationSupportQNX_VkBool32_return;
+}
+#endif
+#ifdef VK_EXT_color_write_enable
+static void entry_vkCmdSetColorWriteEnableEXT(VkCommandBuffer commandBuffer,
+                                              uint32_t attachmentCount,
+                                              const VkBool32* pColorWriteEnables) {
+    AEMU_SCOPED_TRACE("vkCmdSetColorWriteEnableEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetColorWriteEnableEXT(commandBuffer, attachmentCount, pColorWriteEnables,
+                                       true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetColorWriteEnableEXT(VkCommandBuffer commandBuffer,
+                                                       uint32_t attachmentCount,
+                                                       const VkBool32* pColorWriteEnables) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_color_write_enable")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetColorWriteEnableEXT",
+                                         "VK_EXT_color_write_enable");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetColorWriteEnableEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetColorWriteEnableEXT(commandBuffer, attachmentCount, pColorWriteEnables,
+                                       true /* do lock */);
+}
+#endif
+#ifdef VK_GOOGLE_gfxstream
+static VkResult entry_vkMapMemoryIntoAddressSpaceGOOGLE(VkDevice device, VkDeviceMemory memory,
+                                                        uint64_t* pAddress) {
+    AEMU_SCOPED_TRACE("vkMapMemoryIntoAddressSpaceGOOGLE");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkMapMemoryIntoAddressSpaceGOOGLE_VkResult_return = (VkResult)0;
+    vkMapMemoryIntoAddressSpaceGOOGLE_VkResult_return =
+        vkEnc->vkMapMemoryIntoAddressSpaceGOOGLE(device, memory, pAddress, true /* do lock */);
+    return vkMapMemoryIntoAddressSpaceGOOGLE_VkResult_return;
+}
+static VkResult dynCheck_entry_vkMapMemoryIntoAddressSpaceGOOGLE(VkDevice device,
+                                                                 VkDeviceMemory memory,
+                                                                 uint64_t* pAddress) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream")) {
+        sOnInvalidDynamicallyCheckedCall("vkMapMemoryIntoAddressSpaceGOOGLE",
+                                         "VK_GOOGLE_gfxstream");
+    }
+    AEMU_SCOPED_TRACE("vkMapMemoryIntoAddressSpaceGOOGLE");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkMapMemoryIntoAddressSpaceGOOGLE_VkResult_return = (VkResult)0;
+    vkMapMemoryIntoAddressSpaceGOOGLE_VkResult_return =
+        vkEnc->vkMapMemoryIntoAddressSpaceGOOGLE(device, memory, pAddress, true /* do lock */);
+    return vkMapMemoryIntoAddressSpaceGOOGLE_VkResult_return;
+}
+static void entry_vkUpdateDescriptorSetWithTemplateSizedGOOGLE(
+    VkDevice device, VkDescriptorSet descriptorSet,
+    VkDescriptorUpdateTemplate descriptorUpdateTemplate, uint32_t imageInfoCount,
+    uint32_t bufferInfoCount, uint32_t bufferViewCount, const uint32_t* pImageInfoEntryIndices,
+    const uint32_t* pBufferInfoEntryIndices, const uint32_t* pBufferViewEntryIndices,
+    const VkDescriptorImageInfo* pImageInfos, const VkDescriptorBufferInfo* pBufferInfos,
+    const VkBufferView* pBufferViews) {
+    AEMU_SCOPED_TRACE("vkUpdateDescriptorSetWithTemplateSizedGOOGLE");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkUpdateDescriptorSetWithTemplateSizedGOOGLE(
+        device, descriptorSet, descriptorUpdateTemplate, imageInfoCount, bufferInfoCount,
+        bufferViewCount, pImageInfoEntryIndices, pBufferInfoEntryIndices, pBufferViewEntryIndices,
+        pImageInfos, pBufferInfos, pBufferViews, true /* do lock */);
+}
+static void dynCheck_entry_vkUpdateDescriptorSetWithTemplateSizedGOOGLE(
+    VkDevice device, VkDescriptorSet descriptorSet,
+    VkDescriptorUpdateTemplate descriptorUpdateTemplate, uint32_t imageInfoCount,
+    uint32_t bufferInfoCount, uint32_t bufferViewCount, const uint32_t* pImageInfoEntryIndices,
+    const uint32_t* pBufferInfoEntryIndices, const uint32_t* pBufferViewEntryIndices,
+    const VkDescriptorImageInfo* pImageInfos, const VkDescriptorBufferInfo* pBufferInfos,
+    const VkBufferView* pBufferViews) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream")) {
+        sOnInvalidDynamicallyCheckedCall("vkUpdateDescriptorSetWithTemplateSizedGOOGLE",
+                                         "VK_GOOGLE_gfxstream");
+    }
+    AEMU_SCOPED_TRACE("vkUpdateDescriptorSetWithTemplateSizedGOOGLE");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkUpdateDescriptorSetWithTemplateSizedGOOGLE(
+        device, descriptorSet, descriptorUpdateTemplate, imageInfoCount, bufferInfoCount,
+        bufferViewCount, pImageInfoEntryIndices, pBufferInfoEntryIndices, pBufferViewEntryIndices,
+        pImageInfos, pBufferInfos, pBufferViews, true /* do lock */);
+}
+static void entry_vkBeginCommandBufferAsyncGOOGLE(VkCommandBuffer commandBuffer,
+                                                  const VkCommandBufferBeginInfo* pBeginInfo) {
+    AEMU_SCOPED_TRACE("vkBeginCommandBufferAsyncGOOGLE");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkBeginCommandBufferAsyncGOOGLE(commandBuffer, pBeginInfo, true /* do lock */);
+}
+static void entry_vkEndCommandBufferAsyncGOOGLE(VkCommandBuffer commandBuffer) {
+    AEMU_SCOPED_TRACE("vkEndCommandBufferAsyncGOOGLE");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkEndCommandBufferAsyncGOOGLE(commandBuffer, true /* do lock */);
+}
+static void entry_vkResetCommandBufferAsyncGOOGLE(VkCommandBuffer commandBuffer,
+                                                  VkCommandBufferResetFlags flags) {
+    AEMU_SCOPED_TRACE("vkResetCommandBufferAsyncGOOGLE");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkResetCommandBufferAsyncGOOGLE(commandBuffer, flags, true /* do lock */);
+}
+static void entry_vkCommandBufferHostSyncGOOGLE(VkCommandBuffer commandBuffer,
+                                                uint32_t needHostSync, uint32_t sequenceNumber) {
+    AEMU_SCOPED_TRACE("vkCommandBufferHostSyncGOOGLE");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCommandBufferHostSyncGOOGLE(commandBuffer, needHostSync, sequenceNumber,
+                                         true /* do lock */);
+}
+static VkResult entry_vkCreateImageWithRequirementsGOOGLE(
+    VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator,
+    VkImage* pImage, VkMemoryRequirements* pMemoryRequirements) {
+    AEMU_SCOPED_TRACE("vkCreateImageWithRequirementsGOOGLE");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateImageWithRequirementsGOOGLE_VkResult_return = (VkResult)0;
+    vkCreateImageWithRequirementsGOOGLE_VkResult_return =
+        vkEnc->vkCreateImageWithRequirementsGOOGLE(device, pCreateInfo, pAllocator, pImage,
+                                                   pMemoryRequirements, true /* do lock */);
+    return vkCreateImageWithRequirementsGOOGLE_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCreateImageWithRequirementsGOOGLE(
+    VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator,
+    VkImage* pImage, VkMemoryRequirements* pMemoryRequirements) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream")) {
+        sOnInvalidDynamicallyCheckedCall("vkCreateImageWithRequirementsGOOGLE",
+                                         "VK_GOOGLE_gfxstream");
+    }
+    AEMU_SCOPED_TRACE("vkCreateImageWithRequirementsGOOGLE");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateImageWithRequirementsGOOGLE_VkResult_return = (VkResult)0;
+    vkCreateImageWithRequirementsGOOGLE_VkResult_return =
+        vkEnc->vkCreateImageWithRequirementsGOOGLE(device, pCreateInfo, pAllocator, pImage,
+                                                   pMemoryRequirements, true /* do lock */);
+    return vkCreateImageWithRequirementsGOOGLE_VkResult_return;
+}
+static VkResult entry_vkCreateBufferWithRequirementsGOOGLE(
+    VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator,
+    VkBuffer* pBuffer, VkMemoryRequirements* pMemoryRequirements) {
+    AEMU_SCOPED_TRACE("vkCreateBufferWithRequirementsGOOGLE");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateBufferWithRequirementsGOOGLE_VkResult_return = (VkResult)0;
+    vkCreateBufferWithRequirementsGOOGLE_VkResult_return =
+        vkEnc->vkCreateBufferWithRequirementsGOOGLE(device, pCreateInfo, pAllocator, pBuffer,
+                                                    pMemoryRequirements, true /* do lock */);
+    return vkCreateBufferWithRequirementsGOOGLE_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCreateBufferWithRequirementsGOOGLE(
+    VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator,
+    VkBuffer* pBuffer, VkMemoryRequirements* pMemoryRequirements) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream")) {
+        sOnInvalidDynamicallyCheckedCall("vkCreateBufferWithRequirementsGOOGLE",
+                                         "VK_GOOGLE_gfxstream");
+    }
+    AEMU_SCOPED_TRACE("vkCreateBufferWithRequirementsGOOGLE");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateBufferWithRequirementsGOOGLE_VkResult_return = (VkResult)0;
+    vkCreateBufferWithRequirementsGOOGLE_VkResult_return =
+        vkEnc->vkCreateBufferWithRequirementsGOOGLE(device, pCreateInfo, pAllocator, pBuffer,
+                                                    pMemoryRequirements, true /* do lock */);
+    return vkCreateBufferWithRequirementsGOOGLE_VkResult_return;
+}
+static VkResult entry_vkGetMemoryHostAddressInfoGOOGLE(VkDevice device, VkDeviceMemory memory,
+                                                       uint64_t* pAddress, uint64_t* pSize,
+                                                       uint64_t* pHostmemId) {
+    AEMU_SCOPED_TRACE("vkGetMemoryHostAddressInfoGOOGLE");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetMemoryHostAddressInfoGOOGLE_VkResult_return = (VkResult)0;
+    vkGetMemoryHostAddressInfoGOOGLE_VkResult_return = vkEnc->vkGetMemoryHostAddressInfoGOOGLE(
+        device, memory, pAddress, pSize, pHostmemId, true /* do lock */);
+    return vkGetMemoryHostAddressInfoGOOGLE_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetMemoryHostAddressInfoGOOGLE(VkDevice device,
+                                                                VkDeviceMemory memory,
+                                                                uint64_t* pAddress, uint64_t* pSize,
+                                                                uint64_t* pHostmemId) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetMemoryHostAddressInfoGOOGLE", "VK_GOOGLE_gfxstream");
+    }
+    AEMU_SCOPED_TRACE("vkGetMemoryHostAddressInfoGOOGLE");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetMemoryHostAddressInfoGOOGLE_VkResult_return = (VkResult)0;
+    vkGetMemoryHostAddressInfoGOOGLE_VkResult_return = vkEnc->vkGetMemoryHostAddressInfoGOOGLE(
+        device, memory, pAddress, pSize, pHostmemId, true /* do lock */);
+    return vkGetMemoryHostAddressInfoGOOGLE_VkResult_return;
+}
+static VkResult entry_vkFreeMemorySyncGOOGLE(VkDevice device, VkDeviceMemory memory,
+                                             const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkFreeMemorySyncGOOGLE");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkFreeMemorySyncGOOGLE_VkResult_return = (VkResult)0;
+    vkFreeMemorySyncGOOGLE_VkResult_return =
+        vkEnc->vkFreeMemorySyncGOOGLE(device, memory, pAllocator, true /* do lock */);
+    return vkFreeMemorySyncGOOGLE_VkResult_return;
+}
+static VkResult dynCheck_entry_vkFreeMemorySyncGOOGLE(VkDevice device, VkDeviceMemory memory,
+                                                      const VkAllocationCallbacks* pAllocator) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream")) {
+        sOnInvalidDynamicallyCheckedCall("vkFreeMemorySyncGOOGLE", "VK_GOOGLE_gfxstream");
+    }
+    AEMU_SCOPED_TRACE("vkFreeMemorySyncGOOGLE");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkFreeMemorySyncGOOGLE_VkResult_return = (VkResult)0;
+    vkFreeMemorySyncGOOGLE_VkResult_return =
+        vkEnc->vkFreeMemorySyncGOOGLE(device, memory, pAllocator, true /* do lock */);
+    return vkFreeMemorySyncGOOGLE_VkResult_return;
+}
+static void entry_vkQueueHostSyncGOOGLE(VkQueue queue, uint32_t needHostSync,
+                                        uint32_t sequenceNumber) {
+    AEMU_SCOPED_TRACE("vkQueueHostSyncGOOGLE");
+    auto vkEnc = ResourceTracker::getQueueEncoder(queue);
+    vkEnc->vkQueueHostSyncGOOGLE(queue, needHostSync, sequenceNumber, true /* do lock */);
+}
+static void entry_vkQueueSubmitAsyncGOOGLE(VkQueue queue, uint32_t submitCount,
+                                           const VkSubmitInfo* pSubmits, VkFence fence) {
+    AEMU_SCOPED_TRACE("vkQueueSubmitAsyncGOOGLE");
+    auto vkEnc = ResourceTracker::getQueueEncoder(queue);
+    vkEnc->vkQueueSubmitAsyncGOOGLE(queue, submitCount, pSubmits, fence, true /* do lock */);
+}
+static void entry_vkQueueWaitIdleAsyncGOOGLE(VkQueue queue) {
+    AEMU_SCOPED_TRACE("vkQueueWaitIdleAsyncGOOGLE");
+    auto vkEnc = ResourceTracker::getQueueEncoder(queue);
+    vkEnc->vkQueueWaitIdleAsyncGOOGLE(queue, true /* do lock */);
+}
+static void entry_vkQueueBindSparseAsyncGOOGLE(VkQueue queue, uint32_t bindInfoCount,
+                                               const VkBindSparseInfo* pBindInfo, VkFence fence) {
+    AEMU_SCOPED_TRACE("vkQueueBindSparseAsyncGOOGLE");
+    auto vkEnc = ResourceTracker::getQueueEncoder(queue);
+    vkEnc->vkQueueBindSparseAsyncGOOGLE(queue, bindInfoCount, pBindInfo, fence, true /* do lock */);
+}
+static void entry_vkGetLinearImageLayoutGOOGLE(VkDevice device, VkFormat format,
+                                               VkDeviceSize* pOffset,
+                                               VkDeviceSize* pRowPitchAlignment) {
+    AEMU_SCOPED_TRACE("vkGetLinearImageLayoutGOOGLE");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetLinearImageLayoutGOOGLE(device, format, pOffset, pRowPitchAlignment,
+                                        true /* do lock */);
+}
+static void dynCheck_entry_vkGetLinearImageLayoutGOOGLE(VkDevice device, VkFormat format,
+                                                        VkDeviceSize* pOffset,
+                                                        VkDeviceSize* pRowPitchAlignment) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetLinearImageLayoutGOOGLE", "VK_GOOGLE_gfxstream");
+    }
+    AEMU_SCOPED_TRACE("vkGetLinearImageLayoutGOOGLE");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetLinearImageLayoutGOOGLE(device, format, pOffset, pRowPitchAlignment,
+                                        true /* do lock */);
+}
+static void entry_vkGetLinearImageLayout2GOOGLE(VkDevice device,
+                                                const VkImageCreateInfo* pCreateInfo,
+                                                VkDeviceSize* pOffset,
+                                                VkDeviceSize* pRowPitchAlignment) {
+    AEMU_SCOPED_TRACE("vkGetLinearImageLayout2GOOGLE");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetLinearImageLayout2GOOGLE(device, pCreateInfo, pOffset, pRowPitchAlignment,
+                                         true /* do lock */);
+}
+static void dynCheck_entry_vkGetLinearImageLayout2GOOGLE(VkDevice device,
+                                                         const VkImageCreateInfo* pCreateInfo,
+                                                         VkDeviceSize* pOffset,
+                                                         VkDeviceSize* pRowPitchAlignment) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetLinearImageLayout2GOOGLE", "VK_GOOGLE_gfxstream");
+    }
+    AEMU_SCOPED_TRACE("vkGetLinearImageLayout2GOOGLE");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetLinearImageLayout2GOOGLE(device, pCreateInfo, pOffset, pRowPitchAlignment,
+                                         true /* do lock */);
+}
+static void entry_vkQueueFlushCommandsGOOGLE(VkQueue queue, VkCommandBuffer commandBuffer,
+                                             VkDeviceSize dataSize, const void* pData) {
+    AEMU_SCOPED_TRACE("vkQueueFlushCommandsGOOGLE");
+    auto vkEnc = ResourceTracker::getQueueEncoder(queue);
+    vkEnc->vkQueueFlushCommandsGOOGLE(queue, commandBuffer, dataSize, pData, true /* do lock */);
+}
+static void entry_vkQueueCommitDescriptorSetUpdatesGOOGLE(
+    VkQueue queue, uint32_t descriptorPoolCount, const VkDescriptorPool* pDescriptorPools,
+    uint32_t descriptorSetCount, const VkDescriptorSetLayout* pSetLayouts,
+    const uint64_t* pDescriptorSetPoolIds, const uint32_t* pDescriptorSetWhichPool,
+    const uint32_t* pDescriptorSetPendingAllocation,
+    const uint32_t* pDescriptorWriteStartingIndices, uint32_t pendingDescriptorWriteCount,
+    const VkWriteDescriptorSet* pPendingDescriptorWrites) {
+    AEMU_SCOPED_TRACE("vkQueueCommitDescriptorSetUpdatesGOOGLE");
+    auto vkEnc = ResourceTracker::getQueueEncoder(queue);
+    vkEnc->vkQueueCommitDescriptorSetUpdatesGOOGLE(
+        queue, descriptorPoolCount, pDescriptorPools, descriptorSetCount, pSetLayouts,
+        pDescriptorSetPoolIds, pDescriptorSetWhichPool, pDescriptorSetPendingAllocation,
+        pDescriptorWriteStartingIndices, pendingDescriptorWriteCount, pPendingDescriptorWrites,
+        true /* do lock */);
+}
+static void entry_vkCollectDescriptorPoolIdsGOOGLE(VkDevice device, VkDescriptorPool descriptorPool,
+                                                   uint32_t* pPoolIdCount, uint64_t* pPoolIds) {
+    AEMU_SCOPED_TRACE("vkCollectDescriptorPoolIdsGOOGLE");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkCollectDescriptorPoolIdsGOOGLE(device, descriptorPool, pPoolIdCount, pPoolIds,
+                                            true /* do lock */);
+}
+static void dynCheck_entry_vkCollectDescriptorPoolIdsGOOGLE(VkDevice device,
+                                                            VkDescriptorPool descriptorPool,
+                                                            uint32_t* pPoolIdCount,
+                                                            uint64_t* pPoolIds) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream")) {
+        sOnInvalidDynamicallyCheckedCall("vkCollectDescriptorPoolIdsGOOGLE", "VK_GOOGLE_gfxstream");
+    }
+    AEMU_SCOPED_TRACE("vkCollectDescriptorPoolIdsGOOGLE");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkCollectDescriptorPoolIdsGOOGLE(device, descriptorPool, pPoolIdCount, pPoolIds,
+                                            true /* do lock */);
+}
+static void entry_vkQueueSignalReleaseImageANDROIDAsyncGOOGLE(VkQueue queue,
+                                                              uint32_t waitSemaphoreCount,
+                                                              const VkSemaphore* pWaitSemaphores,
+                                                              VkImage image) {
+    AEMU_SCOPED_TRACE("vkQueueSignalReleaseImageANDROIDAsyncGOOGLE");
+    auto vkEnc = ResourceTracker::getQueueEncoder(queue);
+    vkEnc->vkQueueSignalReleaseImageANDROIDAsyncGOOGLE(queue, waitSemaphoreCount, pWaitSemaphores,
+                                                       image, true /* do lock */);
+}
+static void entry_vkQueueFlushCommandsFromAuxMemoryGOOGLE(VkQueue queue,
+                                                          VkCommandBuffer commandBuffer,
+                                                          VkDeviceMemory deviceMemory,
+                                                          VkDeviceSize dataOffset,
+                                                          VkDeviceSize dataSize) {
+    AEMU_SCOPED_TRACE("vkQueueFlushCommandsFromAuxMemoryGOOGLE");
+    auto vkEnc = ResourceTracker::getQueueEncoder(queue);
+    vkEnc->vkQueueFlushCommandsFromAuxMemoryGOOGLE(queue, commandBuffer, deviceMemory, dataOffset,
+                                                   dataSize, true /* do lock */);
+}
+static VkResult entry_vkGetBlobGOOGLE(VkDevice device, VkDeviceMemory memory) {
+    AEMU_SCOPED_TRACE("vkGetBlobGOOGLE");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetBlobGOOGLE_VkResult_return = (VkResult)0;
+    vkGetBlobGOOGLE_VkResult_return = vkEnc->vkGetBlobGOOGLE(device, memory, true /* do lock */);
+    return vkGetBlobGOOGLE_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetBlobGOOGLE(VkDevice device, VkDeviceMemory memory) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetBlobGOOGLE", "VK_GOOGLE_gfxstream");
+    }
+    AEMU_SCOPED_TRACE("vkGetBlobGOOGLE");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetBlobGOOGLE_VkResult_return = (VkResult)0;
+    vkGetBlobGOOGLE_VkResult_return = vkEnc->vkGetBlobGOOGLE(device, memory, true /* do lock */);
+    return vkGetBlobGOOGLE_VkResult_return;
+}
+#endif
+#ifdef VK_EXT_global_priority_query
+#endif
+#ifdef VK_EXT_multi_draw
+static void entry_vkCmdDrawMultiEXT(VkCommandBuffer commandBuffer, uint32_t drawCount,
+                                    const VkMultiDrawInfoEXT* pVertexInfo, uint32_t instanceCount,
+                                    uint32_t firstInstance, uint32_t stride) {
+    AEMU_SCOPED_TRACE("vkCmdDrawMultiEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDrawMultiEXT(commandBuffer, drawCount, pVertexInfo, instanceCount, firstInstance,
+                             stride, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdDrawMultiEXT(VkCommandBuffer commandBuffer, uint32_t drawCount,
+                                             const VkMultiDrawInfoEXT* pVertexInfo,
+                                             uint32_t instanceCount, uint32_t firstInstance,
+                                             uint32_t stride) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_multi_draw")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdDrawMultiEXT", "VK_EXT_multi_draw");
+    }
+    AEMU_SCOPED_TRACE("vkCmdDrawMultiEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDrawMultiEXT(commandBuffer, drawCount, pVertexInfo, instanceCount, firstInstance,
+                             stride, true /* do lock */);
+}
+static void entry_vkCmdDrawMultiIndexedEXT(VkCommandBuffer commandBuffer, uint32_t drawCount,
+                                           const VkMultiDrawIndexedInfoEXT* pIndexInfo,
+                                           uint32_t instanceCount, uint32_t firstInstance,
+                                           uint32_t stride, const int32_t* pVertexOffset) {
+    AEMU_SCOPED_TRACE("vkCmdDrawMultiIndexedEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDrawMultiIndexedEXT(commandBuffer, drawCount, pIndexInfo, instanceCount,
+                                    firstInstance, stride, pVertexOffset, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdDrawMultiIndexedEXT(VkCommandBuffer commandBuffer,
+                                                    uint32_t drawCount,
+                                                    const VkMultiDrawIndexedInfoEXT* pIndexInfo,
+                                                    uint32_t instanceCount, uint32_t firstInstance,
+                                                    uint32_t stride, const int32_t* pVertexOffset) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_EXT_multi_draw")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdDrawMultiIndexedEXT", "VK_EXT_multi_draw");
+    }
+    AEMU_SCOPED_TRACE("vkCmdDrawMultiIndexedEXT");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdDrawMultiIndexedEXT(commandBuffer, drawCount, pIndexInfo, instanceCount,
+                                    firstInstance, stride, pVertexOffset, true /* do lock */);
+}
+#endif
+#ifdef VK_EXT_load_store_op_none
+#endif
+#ifdef VK_EXT_border_color_swizzle
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+static void entry_vkSetDeviceMemoryPriorityEXT(VkDevice device, VkDeviceMemory memory,
+                                               float priority) {
+    AEMU_SCOPED_TRACE("vkSetDeviceMemoryPriorityEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkSetDeviceMemoryPriorityEXT(device, memory, priority, true /* do lock */);
+}
+static void dynCheck_entry_vkSetDeviceMemoryPriorityEXT(VkDevice device, VkDeviceMemory memory,
+                                                        float priority) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_EXT_pageable_device_local_memory")) {
+        sOnInvalidDynamicallyCheckedCall("vkSetDeviceMemoryPriorityEXT",
+                                         "VK_EXT_pageable_device_local_memory");
+    }
+    AEMU_SCOPED_TRACE("vkSetDeviceMemoryPriorityEXT");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkSetDeviceMemoryPriorityEXT(device, memory, priority, true /* do lock */);
+}
+#endif
+#ifdef VK_KHR_acceleration_structure
+static VkResult entry_vkCreateAccelerationStructureKHR(
+    VkDevice device, const VkAccelerationStructureCreateInfoKHR* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkAccelerationStructureKHR* pAccelerationStructure) {
+    AEMU_SCOPED_TRACE("vkCreateAccelerationStructureKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateAccelerationStructureKHR_VkResult_return = (VkResult)0;
+    vkCreateAccelerationStructureKHR_VkResult_return = vkEnc->vkCreateAccelerationStructureKHR(
+        device, pCreateInfo, pAllocator, pAccelerationStructure, true /* do lock */);
+    return vkCreateAccelerationStructureKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCreateAccelerationStructureKHR(
+    VkDevice device, const VkAccelerationStructureCreateInfoKHR* pCreateInfo,
+    const VkAllocationCallbacks* pAllocator, VkAccelerationStructureKHR* pAccelerationStructure) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure")) {
+        sOnInvalidDynamicallyCheckedCall("vkCreateAccelerationStructureKHR",
+                                         "VK_KHR_acceleration_structure");
+    }
+    AEMU_SCOPED_TRACE("vkCreateAccelerationStructureKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateAccelerationStructureKHR_VkResult_return = (VkResult)0;
+    vkCreateAccelerationStructureKHR_VkResult_return = vkEnc->vkCreateAccelerationStructureKHR(
+        device, pCreateInfo, pAllocator, pAccelerationStructure, true /* do lock */);
+    return vkCreateAccelerationStructureKHR_VkResult_return;
+}
+static void entry_vkDestroyAccelerationStructureKHR(
+    VkDevice device, VkAccelerationStructureKHR accelerationStructure,
+    const VkAllocationCallbacks* pAllocator) {
+    AEMU_SCOPED_TRACE("vkDestroyAccelerationStructureKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyAccelerationStructureKHR(device, accelerationStructure, pAllocator,
+                                             true /* do lock */);
+}
+static void dynCheck_entry_vkDestroyAccelerationStructureKHR(
+    VkDevice device, VkAccelerationStructureKHR accelerationStructure,
+    const VkAllocationCallbacks* pAllocator) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure")) {
+        sOnInvalidDynamicallyCheckedCall("vkDestroyAccelerationStructureKHR",
+                                         "VK_KHR_acceleration_structure");
+    }
+    AEMU_SCOPED_TRACE("vkDestroyAccelerationStructureKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkDestroyAccelerationStructureKHR(device, accelerationStructure, pAllocator,
+                                             true /* do lock */);
+}
+static void entry_vkCmdBuildAccelerationStructuresKHR(
+    VkCommandBuffer commandBuffer, uint32_t infoCount,
+    const VkAccelerationStructureBuildGeometryInfoKHR* pInfos,
+    const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos) {
+    AEMU_SCOPED_TRACE("vkCmdBuildAccelerationStructuresKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBuildAccelerationStructuresKHR(commandBuffer, infoCount, pInfos, ppBuildRangeInfos,
+                                               true /* do lock */);
+}
+static void dynCheck_entry_vkCmdBuildAccelerationStructuresKHR(
+    VkCommandBuffer commandBuffer, uint32_t infoCount,
+    const VkAccelerationStructureBuildGeometryInfoKHR* pInfos,
+    const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdBuildAccelerationStructuresKHR",
+                                         "VK_KHR_acceleration_structure");
+    }
+    AEMU_SCOPED_TRACE("vkCmdBuildAccelerationStructuresKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBuildAccelerationStructuresKHR(commandBuffer, infoCount, pInfos, ppBuildRangeInfos,
+                                               true /* do lock */);
+}
+static void entry_vkCmdBuildAccelerationStructuresIndirectKHR(
+    VkCommandBuffer commandBuffer, uint32_t infoCount,
+    const VkAccelerationStructureBuildGeometryInfoKHR* pInfos,
+    const VkDeviceAddress* pIndirectDeviceAddresses, const uint32_t* pIndirectStrides,
+    const uint32_t* const* ppMaxPrimitiveCounts) {
+    AEMU_SCOPED_TRACE("vkCmdBuildAccelerationStructuresIndirectKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBuildAccelerationStructuresIndirectKHR(commandBuffer, infoCount, pInfos,
+                                                       pIndirectDeviceAddresses, pIndirectStrides,
+                                                       ppMaxPrimitiveCounts, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdBuildAccelerationStructuresIndirectKHR(
+    VkCommandBuffer commandBuffer, uint32_t infoCount,
+    const VkAccelerationStructureBuildGeometryInfoKHR* pInfos,
+    const VkDeviceAddress* pIndirectDeviceAddresses, const uint32_t* pIndirectStrides,
+    const uint32_t* const* ppMaxPrimitiveCounts) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdBuildAccelerationStructuresIndirectKHR",
+                                         "VK_KHR_acceleration_structure");
+    }
+    AEMU_SCOPED_TRACE("vkCmdBuildAccelerationStructuresIndirectKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdBuildAccelerationStructuresIndirectKHR(commandBuffer, infoCount, pInfos,
+                                                       pIndirectDeviceAddresses, pIndirectStrides,
+                                                       ppMaxPrimitiveCounts, true /* do lock */);
+}
+static VkResult entry_vkBuildAccelerationStructuresKHR(
+    VkDevice device, VkDeferredOperationKHR deferredOperation, uint32_t infoCount,
+    const VkAccelerationStructureBuildGeometryInfoKHR* pInfos,
+    const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos) {
+    AEMU_SCOPED_TRACE("vkBuildAccelerationStructuresKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkBuildAccelerationStructuresKHR_VkResult_return = (VkResult)0;
+    vkBuildAccelerationStructuresKHR_VkResult_return = vkEnc->vkBuildAccelerationStructuresKHR(
+        device, deferredOperation, infoCount, pInfos, ppBuildRangeInfos, true /* do lock */);
+    return vkBuildAccelerationStructuresKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkBuildAccelerationStructuresKHR(
+    VkDevice device, VkDeferredOperationKHR deferredOperation, uint32_t infoCount,
+    const VkAccelerationStructureBuildGeometryInfoKHR* pInfos,
+    const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure")) {
+        sOnInvalidDynamicallyCheckedCall("vkBuildAccelerationStructuresKHR",
+                                         "VK_KHR_acceleration_structure");
+    }
+    AEMU_SCOPED_TRACE("vkBuildAccelerationStructuresKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkBuildAccelerationStructuresKHR_VkResult_return = (VkResult)0;
+    vkBuildAccelerationStructuresKHR_VkResult_return = vkEnc->vkBuildAccelerationStructuresKHR(
+        device, deferredOperation, infoCount, pInfos, ppBuildRangeInfos, true /* do lock */);
+    return vkBuildAccelerationStructuresKHR_VkResult_return;
+}
+static VkResult entry_vkCopyAccelerationStructureKHR(
+    VkDevice device, VkDeferredOperationKHR deferredOperation,
+    const VkCopyAccelerationStructureInfoKHR* pInfo) {
+    AEMU_SCOPED_TRACE("vkCopyAccelerationStructureKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCopyAccelerationStructureKHR_VkResult_return = (VkResult)0;
+    vkCopyAccelerationStructureKHR_VkResult_return =
+        vkEnc->vkCopyAccelerationStructureKHR(device, deferredOperation, pInfo, true /* do lock */);
+    return vkCopyAccelerationStructureKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCopyAccelerationStructureKHR(
+    VkDevice device, VkDeferredOperationKHR deferredOperation,
+    const VkCopyAccelerationStructureInfoKHR* pInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure")) {
+        sOnInvalidDynamicallyCheckedCall("vkCopyAccelerationStructureKHR",
+                                         "VK_KHR_acceleration_structure");
+    }
+    AEMU_SCOPED_TRACE("vkCopyAccelerationStructureKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCopyAccelerationStructureKHR_VkResult_return = (VkResult)0;
+    vkCopyAccelerationStructureKHR_VkResult_return =
+        vkEnc->vkCopyAccelerationStructureKHR(device, deferredOperation, pInfo, true /* do lock */);
+    return vkCopyAccelerationStructureKHR_VkResult_return;
+}
+static VkResult entry_vkCopyAccelerationStructureToMemoryKHR(
+    VkDevice device, VkDeferredOperationKHR deferredOperation,
+    const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo) {
+    AEMU_SCOPED_TRACE("vkCopyAccelerationStructureToMemoryKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCopyAccelerationStructureToMemoryKHR_VkResult_return = (VkResult)0;
+    vkCopyAccelerationStructureToMemoryKHR_VkResult_return =
+        vkEnc->vkCopyAccelerationStructureToMemoryKHR(device, deferredOperation, pInfo,
+                                                      true /* do lock */);
+    return vkCopyAccelerationStructureToMemoryKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCopyAccelerationStructureToMemoryKHR(
+    VkDevice device, VkDeferredOperationKHR deferredOperation,
+    const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure")) {
+        sOnInvalidDynamicallyCheckedCall("vkCopyAccelerationStructureToMemoryKHR",
+                                         "VK_KHR_acceleration_structure");
+    }
+    AEMU_SCOPED_TRACE("vkCopyAccelerationStructureToMemoryKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCopyAccelerationStructureToMemoryKHR_VkResult_return = (VkResult)0;
+    vkCopyAccelerationStructureToMemoryKHR_VkResult_return =
+        vkEnc->vkCopyAccelerationStructureToMemoryKHR(device, deferredOperation, pInfo,
+                                                      true /* do lock */);
+    return vkCopyAccelerationStructureToMemoryKHR_VkResult_return;
+}
+static VkResult entry_vkCopyMemoryToAccelerationStructureKHR(
+    VkDevice device, VkDeferredOperationKHR deferredOperation,
+    const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo) {
+    AEMU_SCOPED_TRACE("vkCopyMemoryToAccelerationStructureKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCopyMemoryToAccelerationStructureKHR_VkResult_return = (VkResult)0;
+    vkCopyMemoryToAccelerationStructureKHR_VkResult_return =
+        vkEnc->vkCopyMemoryToAccelerationStructureKHR(device, deferredOperation, pInfo,
+                                                      true /* do lock */);
+    return vkCopyMemoryToAccelerationStructureKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCopyMemoryToAccelerationStructureKHR(
+    VkDevice device, VkDeferredOperationKHR deferredOperation,
+    const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure")) {
+        sOnInvalidDynamicallyCheckedCall("vkCopyMemoryToAccelerationStructureKHR",
+                                         "VK_KHR_acceleration_structure");
+    }
+    AEMU_SCOPED_TRACE("vkCopyMemoryToAccelerationStructureKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCopyMemoryToAccelerationStructureKHR_VkResult_return = (VkResult)0;
+    vkCopyMemoryToAccelerationStructureKHR_VkResult_return =
+        vkEnc->vkCopyMemoryToAccelerationStructureKHR(device, deferredOperation, pInfo,
+                                                      true /* do lock */);
+    return vkCopyMemoryToAccelerationStructureKHR_VkResult_return;
+}
+static VkResult entry_vkWriteAccelerationStructuresPropertiesKHR(
+    VkDevice device, uint32_t accelerationStructureCount,
+    const VkAccelerationStructureKHR* pAccelerationStructures, VkQueryType queryType,
+    size_t dataSize, void* pData, size_t stride) {
+    AEMU_SCOPED_TRACE("vkWriteAccelerationStructuresPropertiesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkWriteAccelerationStructuresPropertiesKHR_VkResult_return = (VkResult)0;
+    vkWriteAccelerationStructuresPropertiesKHR_VkResult_return =
+        vkEnc->vkWriteAccelerationStructuresPropertiesKHR(
+            device, accelerationStructureCount, pAccelerationStructures, queryType, dataSize, pData,
+            stride, true /* do lock */);
+    return vkWriteAccelerationStructuresPropertiesKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkWriteAccelerationStructuresPropertiesKHR(
+    VkDevice device, uint32_t accelerationStructureCount,
+    const VkAccelerationStructureKHR* pAccelerationStructures, VkQueryType queryType,
+    size_t dataSize, void* pData, size_t stride) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure")) {
+        sOnInvalidDynamicallyCheckedCall("vkWriteAccelerationStructuresPropertiesKHR",
+                                         "VK_KHR_acceleration_structure");
+    }
+    AEMU_SCOPED_TRACE("vkWriteAccelerationStructuresPropertiesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkWriteAccelerationStructuresPropertiesKHR_VkResult_return = (VkResult)0;
+    vkWriteAccelerationStructuresPropertiesKHR_VkResult_return =
+        vkEnc->vkWriteAccelerationStructuresPropertiesKHR(
+            device, accelerationStructureCount, pAccelerationStructures, queryType, dataSize, pData,
+            stride, true /* do lock */);
+    return vkWriteAccelerationStructuresPropertiesKHR_VkResult_return;
+}
+static void entry_vkCmdCopyAccelerationStructureKHR(
+    VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureInfoKHR* pInfo) {
+    AEMU_SCOPED_TRACE("vkCmdCopyAccelerationStructureKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdCopyAccelerationStructureKHR(commandBuffer, pInfo, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdCopyAccelerationStructureKHR(
+    VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureInfoKHR* pInfo) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdCopyAccelerationStructureKHR",
+                                         "VK_KHR_acceleration_structure");
+    }
+    AEMU_SCOPED_TRACE("vkCmdCopyAccelerationStructureKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdCopyAccelerationStructureKHR(commandBuffer, pInfo, true /* do lock */);
+}
+static void entry_vkCmdCopyAccelerationStructureToMemoryKHR(
+    VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo) {
+    AEMU_SCOPED_TRACE("vkCmdCopyAccelerationStructureToMemoryKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdCopyAccelerationStructureToMemoryKHR(commandBuffer, pInfo, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdCopyAccelerationStructureToMemoryKHR(
+    VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdCopyAccelerationStructureToMemoryKHR",
+                                         "VK_KHR_acceleration_structure");
+    }
+    AEMU_SCOPED_TRACE("vkCmdCopyAccelerationStructureToMemoryKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdCopyAccelerationStructureToMemoryKHR(commandBuffer, pInfo, true /* do lock */);
+}
+static void entry_vkCmdCopyMemoryToAccelerationStructureKHR(
+    VkCommandBuffer commandBuffer, const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo) {
+    AEMU_SCOPED_TRACE("vkCmdCopyMemoryToAccelerationStructureKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdCopyMemoryToAccelerationStructureKHR(commandBuffer, pInfo, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdCopyMemoryToAccelerationStructureKHR(
+    VkCommandBuffer commandBuffer, const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdCopyMemoryToAccelerationStructureKHR",
+                                         "VK_KHR_acceleration_structure");
+    }
+    AEMU_SCOPED_TRACE("vkCmdCopyMemoryToAccelerationStructureKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdCopyMemoryToAccelerationStructureKHR(commandBuffer, pInfo, true /* do lock */);
+}
+static VkDeviceAddress entry_vkGetAccelerationStructureDeviceAddressKHR(
+    VkDevice device, const VkAccelerationStructureDeviceAddressInfoKHR* pInfo) {
+    AEMU_SCOPED_TRACE("vkGetAccelerationStructureDeviceAddressKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkDeviceAddress vkGetAccelerationStructureDeviceAddressKHR_VkDeviceAddress_return =
+        (VkDeviceAddress)0;
+    vkGetAccelerationStructureDeviceAddressKHR_VkDeviceAddress_return =
+        vkEnc->vkGetAccelerationStructureDeviceAddressKHR(device, pInfo, true /* do lock */);
+    return vkGetAccelerationStructureDeviceAddressKHR_VkDeviceAddress_return;
+}
+static VkDeviceAddress dynCheck_entry_vkGetAccelerationStructureDeviceAddressKHR(
+    VkDevice device, const VkAccelerationStructureDeviceAddressInfoKHR* pInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetAccelerationStructureDeviceAddressKHR",
+                                         "VK_KHR_acceleration_structure");
+    }
+    AEMU_SCOPED_TRACE("vkGetAccelerationStructureDeviceAddressKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkDeviceAddress vkGetAccelerationStructureDeviceAddressKHR_VkDeviceAddress_return =
+        (VkDeviceAddress)0;
+    vkGetAccelerationStructureDeviceAddressKHR_VkDeviceAddress_return =
+        vkEnc->vkGetAccelerationStructureDeviceAddressKHR(device, pInfo, true /* do lock */);
+    return vkGetAccelerationStructureDeviceAddressKHR_VkDeviceAddress_return;
+}
+static void entry_vkCmdWriteAccelerationStructuresPropertiesKHR(
+    VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount,
+    const VkAccelerationStructureKHR* pAccelerationStructures, VkQueryType queryType,
+    VkQueryPool queryPool, uint32_t firstQuery) {
+    AEMU_SCOPED_TRACE("vkCmdWriteAccelerationStructuresPropertiesKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdWriteAccelerationStructuresPropertiesKHR(commandBuffer, accelerationStructureCount,
+                                                         pAccelerationStructures, queryType,
+                                                         queryPool, firstQuery, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdWriteAccelerationStructuresPropertiesKHR(
+    VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount,
+    const VkAccelerationStructureKHR* pAccelerationStructures, VkQueryType queryType,
+    VkQueryPool queryPool, uint32_t firstQuery) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdWriteAccelerationStructuresPropertiesKHR",
+                                         "VK_KHR_acceleration_structure");
+    }
+    AEMU_SCOPED_TRACE("vkCmdWriteAccelerationStructuresPropertiesKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdWriteAccelerationStructuresPropertiesKHR(commandBuffer, accelerationStructureCount,
+                                                         pAccelerationStructures, queryType,
+                                                         queryPool, firstQuery, true /* do lock */);
+}
+static void entry_vkGetDeviceAccelerationStructureCompatibilityKHR(
+    VkDevice device, const VkAccelerationStructureVersionInfoKHR* pVersionInfo,
+    VkAccelerationStructureCompatibilityKHR* pCompatibility) {
+    AEMU_SCOPED_TRACE("vkGetDeviceAccelerationStructureCompatibilityKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetDeviceAccelerationStructureCompatibilityKHR(device, pVersionInfo, pCompatibility,
+                                                            true /* do lock */);
+}
+static void dynCheck_entry_vkGetDeviceAccelerationStructureCompatibilityKHR(
+    VkDevice device, const VkAccelerationStructureVersionInfoKHR* pVersionInfo,
+    VkAccelerationStructureCompatibilityKHR* pCompatibility) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetDeviceAccelerationStructureCompatibilityKHR",
+                                         "VK_KHR_acceleration_structure");
+    }
+    AEMU_SCOPED_TRACE("vkGetDeviceAccelerationStructureCompatibilityKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetDeviceAccelerationStructureCompatibilityKHR(device, pVersionInfo, pCompatibility,
+                                                            true /* do lock */);
+}
+static void entry_vkGetAccelerationStructureBuildSizesKHR(
+    VkDevice device, VkAccelerationStructureBuildTypeKHR buildType,
+    const VkAccelerationStructureBuildGeometryInfoKHR* pBuildInfo,
+    const uint32_t* pMaxPrimitiveCounts, VkAccelerationStructureBuildSizesInfoKHR* pSizeInfo) {
+    AEMU_SCOPED_TRACE("vkGetAccelerationStructureBuildSizesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetAccelerationStructureBuildSizesKHR(
+        device, buildType, pBuildInfo, pMaxPrimitiveCounts, pSizeInfo, true /* do lock */);
+}
+static void dynCheck_entry_vkGetAccelerationStructureBuildSizesKHR(
+    VkDevice device, VkAccelerationStructureBuildTypeKHR buildType,
+    const VkAccelerationStructureBuildGeometryInfoKHR* pBuildInfo,
+    const uint32_t* pMaxPrimitiveCounts, VkAccelerationStructureBuildSizesInfoKHR* pSizeInfo) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetAccelerationStructureBuildSizesKHR",
+                                         "VK_KHR_acceleration_structure");
+    }
+    AEMU_SCOPED_TRACE("vkGetAccelerationStructureBuildSizesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    vkEnc->vkGetAccelerationStructureBuildSizesKHR(
+        device, buildType, pBuildInfo, pMaxPrimitiveCounts, pSizeInfo, true /* do lock */);
+}
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+static void entry_vkCmdTraceRaysKHR(
+    VkCommandBuffer commandBuffer, const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable,
+    const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable,
+    const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable,
+    const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable, uint32_t width,
+    uint32_t height, uint32_t depth) {
+    AEMU_SCOPED_TRACE("vkCmdTraceRaysKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdTraceRaysKHR(commandBuffer, pRaygenShaderBindingTable, pMissShaderBindingTable,
+                             pHitShaderBindingTable, pCallableShaderBindingTable, width, height,
+                             depth, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdTraceRaysKHR(
+    VkCommandBuffer commandBuffer, const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable,
+    const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable,
+    const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable,
+    const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable, uint32_t width,
+    uint32_t height, uint32_t depth) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_ray_tracing_pipeline")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdTraceRaysKHR", "VK_KHR_ray_tracing_pipeline");
+    }
+    AEMU_SCOPED_TRACE("vkCmdTraceRaysKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdTraceRaysKHR(commandBuffer, pRaygenShaderBindingTable, pMissShaderBindingTable,
+                             pHitShaderBindingTable, pCallableShaderBindingTable, width, height,
+                             depth, true /* do lock */);
+}
+static VkResult entry_vkCreateRayTracingPipelinesKHR(
+    VkDevice device, VkDeferredOperationKHR deferredOperation, VkPipelineCache pipelineCache,
+    uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoKHR* pCreateInfos,
+    const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines) {
+    AEMU_SCOPED_TRACE("vkCreateRayTracingPipelinesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateRayTracingPipelinesKHR_VkResult_return = (VkResult)0;
+    vkCreateRayTracingPipelinesKHR_VkResult_return = vkEnc->vkCreateRayTracingPipelinesKHR(
+        device, deferredOperation, pipelineCache, createInfoCount, pCreateInfos, pAllocator,
+        pPipelines, true /* do lock */);
+    return vkCreateRayTracingPipelinesKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkCreateRayTracingPipelinesKHR(
+    VkDevice device, VkDeferredOperationKHR deferredOperation, VkPipelineCache pipelineCache,
+    uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoKHR* pCreateInfos,
+    const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_ray_tracing_pipeline")) {
+        sOnInvalidDynamicallyCheckedCall("vkCreateRayTracingPipelinesKHR",
+                                         "VK_KHR_ray_tracing_pipeline");
+    }
+    AEMU_SCOPED_TRACE("vkCreateRayTracingPipelinesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkCreateRayTracingPipelinesKHR_VkResult_return = (VkResult)0;
+    vkCreateRayTracingPipelinesKHR_VkResult_return = vkEnc->vkCreateRayTracingPipelinesKHR(
+        device, deferredOperation, pipelineCache, createInfoCount, pCreateInfos, pAllocator,
+        pPipelines, true /* do lock */);
+    return vkCreateRayTracingPipelinesKHR_VkResult_return;
+}
+static VkResult entry_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR(
+    VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize,
+    void* pData) {
+    AEMU_SCOPED_TRACE("vkGetRayTracingCaptureReplayShaderGroupHandlesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetRayTracingCaptureReplayShaderGroupHandlesKHR_VkResult_return = (VkResult)0;
+    vkGetRayTracingCaptureReplayShaderGroupHandlesKHR_VkResult_return =
+        vkEnc->vkGetRayTracingCaptureReplayShaderGroupHandlesKHR(
+            device, pipeline, firstGroup, groupCount, dataSize, pData, true /* do lock */);
+    return vkGetRayTracingCaptureReplayShaderGroupHandlesKHR_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR(
+    VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize,
+    void* pData) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_ray_tracing_pipeline")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetRayTracingCaptureReplayShaderGroupHandlesKHR",
+                                         "VK_KHR_ray_tracing_pipeline");
+    }
+    AEMU_SCOPED_TRACE("vkGetRayTracingCaptureReplayShaderGroupHandlesKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkResult vkGetRayTracingCaptureReplayShaderGroupHandlesKHR_VkResult_return = (VkResult)0;
+    vkGetRayTracingCaptureReplayShaderGroupHandlesKHR_VkResult_return =
+        vkEnc->vkGetRayTracingCaptureReplayShaderGroupHandlesKHR(
+            device, pipeline, firstGroup, groupCount, dataSize, pData, true /* do lock */);
+    return vkGetRayTracingCaptureReplayShaderGroupHandlesKHR_VkResult_return;
+}
+static void entry_vkCmdTraceRaysIndirectKHR(
+    VkCommandBuffer commandBuffer, const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable,
+    const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable,
+    const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable,
+    const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable,
+    VkDeviceAddress indirectDeviceAddress) {
+    AEMU_SCOPED_TRACE("vkCmdTraceRaysIndirectKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdTraceRaysIndirectKHR(
+        commandBuffer, pRaygenShaderBindingTable, pMissShaderBindingTable, pHitShaderBindingTable,
+        pCallableShaderBindingTable, indirectDeviceAddress, true /* do lock */);
+}
+static void dynCheck_entry_vkCmdTraceRaysIndirectKHR(
+    VkCommandBuffer commandBuffer, const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable,
+    const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable,
+    const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable,
+    const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable,
+    VkDeviceAddress indirectDeviceAddress) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_ray_tracing_pipeline")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdTraceRaysIndirectKHR",
+                                         "VK_KHR_ray_tracing_pipeline");
+    }
+    AEMU_SCOPED_TRACE("vkCmdTraceRaysIndirectKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdTraceRaysIndirectKHR(
+        commandBuffer, pRaygenShaderBindingTable, pMissShaderBindingTable, pHitShaderBindingTable,
+        pCallableShaderBindingTable, indirectDeviceAddress, true /* do lock */);
+}
+static VkDeviceSize entry_vkGetRayTracingShaderGroupStackSizeKHR(
+    VkDevice device, VkPipeline pipeline, uint32_t group, VkShaderGroupShaderKHR groupShader) {
+    AEMU_SCOPED_TRACE("vkGetRayTracingShaderGroupStackSizeKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkDeviceSize vkGetRayTracingShaderGroupStackSizeKHR_VkDeviceSize_return = (VkDeviceSize)0;
+    vkGetRayTracingShaderGroupStackSizeKHR_VkDeviceSize_return =
+        vkEnc->vkGetRayTracingShaderGroupStackSizeKHR(device, pipeline, group, groupShader,
+                                                      true /* do lock */);
+    return vkGetRayTracingShaderGroupStackSizeKHR_VkDeviceSize_return;
+}
+static VkDeviceSize dynCheck_entry_vkGetRayTracingShaderGroupStackSizeKHR(
+    VkDevice device, VkPipeline pipeline, uint32_t group, VkShaderGroupShaderKHR groupShader) {
+    auto resources = ResourceTracker::get();
+    if (!resources->hasDeviceExtension(device, "VK_KHR_ray_tracing_pipeline")) {
+        sOnInvalidDynamicallyCheckedCall("vkGetRayTracingShaderGroupStackSizeKHR",
+                                         "VK_KHR_ray_tracing_pipeline");
+    }
+    AEMU_SCOPED_TRACE("vkGetRayTracingShaderGroupStackSizeKHR");
+    auto vkEnc = ResourceTracker::getThreadLocalEncoder();
+    VkDeviceSize vkGetRayTracingShaderGroupStackSizeKHR_VkDeviceSize_return = (VkDeviceSize)0;
+    vkGetRayTracingShaderGroupStackSizeKHR_VkDeviceSize_return =
+        vkEnc->vkGetRayTracingShaderGroupStackSizeKHR(device, pipeline, group, groupShader,
+                                                      true /* do lock */);
+    return vkGetRayTracingShaderGroupStackSizeKHR_VkDeviceSize_return;
+}
+static void entry_vkCmdSetRayTracingPipelineStackSizeKHR(VkCommandBuffer commandBuffer,
+                                                         uint32_t pipelineStackSize) {
+    AEMU_SCOPED_TRACE("vkCmdSetRayTracingPipelineStackSizeKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetRayTracingPipelineStackSizeKHR(commandBuffer, pipelineStackSize,
+                                                  true /* do lock */);
+}
+static void dynCheck_entry_vkCmdSetRayTracingPipelineStackSizeKHR(VkCommandBuffer commandBuffer,
+                                                                  uint32_t pipelineStackSize) {
+    auto resources = ResourceTracker::get();
+    VkDevice device = resources->getDevice(commandBuffer);
+    ;
+    if (!resources->hasDeviceExtension(device, "VK_KHR_ray_tracing_pipeline")) {
+        sOnInvalidDynamicallyCheckedCall("vkCmdSetRayTracingPipelineStackSizeKHR",
+                                         "VK_KHR_ray_tracing_pipeline");
+    }
+    AEMU_SCOPED_TRACE("vkCmdSetRayTracingPipelineStackSizeKHR");
+    auto vkEnc = ResourceTracker::getCommandBufferEncoder(commandBuffer);
+    vkEnc->vkCmdSetRayTracingPipelineStackSizeKHR(commandBuffer, pipelineStackSize,
+                                                  true /* do lock */);
+}
+#endif
+#ifdef VK_KHR_ray_query
+#endif
+void* goldfish_vulkan_get_proc_address(const char* name) {
+#ifdef VK_VERSION_1_0
+    if (!strcmp(name, "vkCreateInstance")) {
+        return (void*)entry_vkCreateInstance;
+    }
+    if (!strcmp(name, "vkDestroyInstance")) {
+        return (void*)entry_vkDestroyInstance;
+    }
+    if (!strcmp(name, "vkEnumeratePhysicalDevices")) {
+        return (void*)entry_vkEnumeratePhysicalDevices;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceFeatures")) {
+        return (void*)entry_vkGetPhysicalDeviceFeatures;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceFormatProperties")) {
+        return (void*)entry_vkGetPhysicalDeviceFormatProperties;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceImageFormatProperties")) {
+        return (void*)entry_vkGetPhysicalDeviceImageFormatProperties;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceProperties")) {
+        return (void*)entry_vkGetPhysicalDeviceProperties;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceQueueFamilyProperties")) {
+        return (void*)entry_vkGetPhysicalDeviceQueueFamilyProperties;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceMemoryProperties")) {
+        return (void*)entry_vkGetPhysicalDeviceMemoryProperties;
+    }
+    if (!strcmp(name, "vkGetInstanceProcAddr")) {
+        return (void*)entry_vkGetInstanceProcAddr;
+    }
+    if (!strcmp(name, "vkGetDeviceProcAddr")) {
+        return (void*)entry_vkGetDeviceProcAddr;
+    }
+    if (!strcmp(name, "vkCreateDevice")) {
+        return (void*)entry_vkCreateDevice;
+    }
+    if (!strcmp(name, "vkDestroyDevice")) {
+        return (void*)entry_vkDestroyDevice;
+    }
+    if (!strcmp(name, "vkEnumerateInstanceExtensionProperties")) {
+        return (void*)entry_vkEnumerateInstanceExtensionProperties;
+    }
+    if (!strcmp(name, "vkEnumerateDeviceExtensionProperties")) {
+        return (void*)entry_vkEnumerateDeviceExtensionProperties;
+    }
+    if (!strcmp(name, "vkEnumerateInstanceLayerProperties")) {
+        return (void*)entry_vkEnumerateInstanceLayerProperties;
+    }
+    if (!strcmp(name, "vkEnumerateDeviceLayerProperties")) {
+        return (void*)entry_vkEnumerateDeviceLayerProperties;
+    }
+    if (!strcmp(name, "vkGetDeviceQueue")) {
+        return (void*)entry_vkGetDeviceQueue;
+    }
+    if (!strcmp(name, "vkQueueSubmit")) {
+        return (void*)entry_vkQueueSubmit;
+    }
+    if (!strcmp(name, "vkQueueWaitIdle")) {
+        return (void*)entry_vkQueueWaitIdle;
+    }
+    if (!strcmp(name, "vkDeviceWaitIdle")) {
+        return (void*)entry_vkDeviceWaitIdle;
+    }
+    if (!strcmp(name, "vkAllocateMemory")) {
+        return (void*)entry_vkAllocateMemory;
+    }
+    if (!strcmp(name, "vkFreeMemory")) {
+        return (void*)entry_vkFreeMemory;
+    }
+    if (!strcmp(name, "vkMapMemory")) {
+        return (void*)entry_vkMapMemory;
+    }
+    if (!strcmp(name, "vkUnmapMemory")) {
+        return (void*)entry_vkUnmapMemory;
+    }
+    if (!strcmp(name, "vkFlushMappedMemoryRanges")) {
+        return (void*)entry_vkFlushMappedMemoryRanges;
+    }
+    if (!strcmp(name, "vkInvalidateMappedMemoryRanges")) {
+        return (void*)entry_vkInvalidateMappedMemoryRanges;
+    }
+    if (!strcmp(name, "vkGetDeviceMemoryCommitment")) {
+        return (void*)entry_vkGetDeviceMemoryCommitment;
+    }
+    if (!strcmp(name, "vkBindBufferMemory")) {
+        return (void*)entry_vkBindBufferMemory;
+    }
+    if (!strcmp(name, "vkBindImageMemory")) {
+        return (void*)entry_vkBindImageMemory;
+    }
+    if (!strcmp(name, "vkGetBufferMemoryRequirements")) {
+        return (void*)entry_vkGetBufferMemoryRequirements;
+    }
+    if (!strcmp(name, "vkGetImageMemoryRequirements")) {
+        return (void*)entry_vkGetImageMemoryRequirements;
+    }
+    if (!strcmp(name, "vkGetImageSparseMemoryRequirements")) {
+        return (void*)entry_vkGetImageSparseMemoryRequirements;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceSparseImageFormatProperties")) {
+        return (void*)entry_vkGetPhysicalDeviceSparseImageFormatProperties;
+    }
+    if (!strcmp(name, "vkQueueBindSparse")) {
+        return (void*)entry_vkQueueBindSparse;
+    }
+    if (!strcmp(name, "vkCreateFence")) {
+        return (void*)entry_vkCreateFence;
+    }
+    if (!strcmp(name, "vkDestroyFence")) {
+        return (void*)entry_vkDestroyFence;
+    }
+    if (!strcmp(name, "vkResetFences")) {
+        return (void*)entry_vkResetFences;
+    }
+    if (!strcmp(name, "vkGetFenceStatus")) {
+        return (void*)entry_vkGetFenceStatus;
+    }
+    if (!strcmp(name, "vkWaitForFences")) {
+        return (void*)entry_vkWaitForFences;
+    }
+    if (!strcmp(name, "vkCreateSemaphore")) {
+        return (void*)entry_vkCreateSemaphore;
+    }
+    if (!strcmp(name, "vkDestroySemaphore")) {
+        return (void*)entry_vkDestroySemaphore;
+    }
+    if (!strcmp(name, "vkCreateEvent")) {
+        return (void*)entry_vkCreateEvent;
+    }
+    if (!strcmp(name, "vkDestroyEvent")) {
+        return (void*)entry_vkDestroyEvent;
+    }
+    if (!strcmp(name, "vkGetEventStatus")) {
+        return (void*)entry_vkGetEventStatus;
+    }
+    if (!strcmp(name, "vkSetEvent")) {
+        return (void*)entry_vkSetEvent;
+    }
+    if (!strcmp(name, "vkResetEvent")) {
+        return (void*)entry_vkResetEvent;
+    }
+    if (!strcmp(name, "vkCreateQueryPool")) {
+        return (void*)entry_vkCreateQueryPool;
+    }
+    if (!strcmp(name, "vkDestroyQueryPool")) {
+        return (void*)entry_vkDestroyQueryPool;
+    }
+    if (!strcmp(name, "vkGetQueryPoolResults")) {
+        return (void*)entry_vkGetQueryPoolResults;
+    }
+    if (!strcmp(name, "vkCreateBuffer")) {
+        return (void*)entry_vkCreateBuffer;
+    }
+    if (!strcmp(name, "vkDestroyBuffer")) {
+        return (void*)entry_vkDestroyBuffer;
+    }
+    if (!strcmp(name, "vkCreateBufferView")) {
+        return (void*)entry_vkCreateBufferView;
+    }
+    if (!strcmp(name, "vkDestroyBufferView")) {
+        return (void*)entry_vkDestroyBufferView;
+    }
+    if (!strcmp(name, "vkCreateImage")) {
+        return (void*)entry_vkCreateImage;
+    }
+    if (!strcmp(name, "vkDestroyImage")) {
+        return (void*)entry_vkDestroyImage;
+    }
+    if (!strcmp(name, "vkGetImageSubresourceLayout")) {
+        return (void*)entry_vkGetImageSubresourceLayout;
+    }
+    if (!strcmp(name, "vkCreateImageView")) {
+        return (void*)entry_vkCreateImageView;
+    }
+    if (!strcmp(name, "vkDestroyImageView")) {
+        return (void*)entry_vkDestroyImageView;
+    }
+    if (!strcmp(name, "vkCreateShaderModule")) {
+        return (void*)entry_vkCreateShaderModule;
+    }
+    if (!strcmp(name, "vkDestroyShaderModule")) {
+        return (void*)entry_vkDestroyShaderModule;
+    }
+    if (!strcmp(name, "vkCreatePipelineCache")) {
+        return (void*)entry_vkCreatePipelineCache;
+    }
+    if (!strcmp(name, "vkDestroyPipelineCache")) {
+        return (void*)entry_vkDestroyPipelineCache;
+    }
+    if (!strcmp(name, "vkGetPipelineCacheData")) {
+        return (void*)entry_vkGetPipelineCacheData;
+    }
+    if (!strcmp(name, "vkMergePipelineCaches")) {
+        return (void*)entry_vkMergePipelineCaches;
+    }
+    if (!strcmp(name, "vkCreateGraphicsPipelines")) {
+        return (void*)entry_vkCreateGraphicsPipelines;
+    }
+    if (!strcmp(name, "vkCreateComputePipelines")) {
+        return (void*)entry_vkCreateComputePipelines;
+    }
+    if (!strcmp(name, "vkDestroyPipeline")) {
+        return (void*)entry_vkDestroyPipeline;
+    }
+    if (!strcmp(name, "vkCreatePipelineLayout")) {
+        return (void*)entry_vkCreatePipelineLayout;
+    }
+    if (!strcmp(name, "vkDestroyPipelineLayout")) {
+        return (void*)entry_vkDestroyPipelineLayout;
+    }
+    if (!strcmp(name, "vkCreateSampler")) {
+        return (void*)entry_vkCreateSampler;
+    }
+    if (!strcmp(name, "vkDestroySampler")) {
+        return (void*)entry_vkDestroySampler;
+    }
+    if (!strcmp(name, "vkCreateDescriptorSetLayout")) {
+        return (void*)entry_vkCreateDescriptorSetLayout;
+    }
+    if (!strcmp(name, "vkDestroyDescriptorSetLayout")) {
+        return (void*)entry_vkDestroyDescriptorSetLayout;
+    }
+    if (!strcmp(name, "vkCreateDescriptorPool")) {
+        return (void*)entry_vkCreateDescriptorPool;
+    }
+    if (!strcmp(name, "vkDestroyDescriptorPool")) {
+        return (void*)entry_vkDestroyDescriptorPool;
+    }
+    if (!strcmp(name, "vkResetDescriptorPool")) {
+        return (void*)entry_vkResetDescriptorPool;
+    }
+    if (!strcmp(name, "vkAllocateDescriptorSets")) {
+        return (void*)entry_vkAllocateDescriptorSets;
+    }
+    if (!strcmp(name, "vkFreeDescriptorSets")) {
+        return (void*)entry_vkFreeDescriptorSets;
+    }
+    if (!strcmp(name, "vkUpdateDescriptorSets")) {
+        return (void*)entry_vkUpdateDescriptorSets;
+    }
+    if (!strcmp(name, "vkCreateFramebuffer")) {
+        return (void*)entry_vkCreateFramebuffer;
+    }
+    if (!strcmp(name, "vkDestroyFramebuffer")) {
+        return (void*)entry_vkDestroyFramebuffer;
+    }
+    if (!strcmp(name, "vkCreateRenderPass")) {
+        return (void*)entry_vkCreateRenderPass;
+    }
+    if (!strcmp(name, "vkDestroyRenderPass")) {
+        return (void*)entry_vkDestroyRenderPass;
+    }
+    if (!strcmp(name, "vkGetRenderAreaGranularity")) {
+        return (void*)entry_vkGetRenderAreaGranularity;
+    }
+    if (!strcmp(name, "vkCreateCommandPool")) {
+        return (void*)entry_vkCreateCommandPool;
+    }
+    if (!strcmp(name, "vkDestroyCommandPool")) {
+        return (void*)entry_vkDestroyCommandPool;
+    }
+    if (!strcmp(name, "vkResetCommandPool")) {
+        return (void*)entry_vkResetCommandPool;
+    }
+    if (!strcmp(name, "vkAllocateCommandBuffers")) {
+        return (void*)entry_vkAllocateCommandBuffers;
+    }
+    if (!strcmp(name, "vkFreeCommandBuffers")) {
+        return (void*)entry_vkFreeCommandBuffers;
+    }
+    if (!strcmp(name, "vkBeginCommandBuffer")) {
+        return (void*)entry_vkBeginCommandBuffer;
+    }
+    if (!strcmp(name, "vkEndCommandBuffer")) {
+        return (void*)entry_vkEndCommandBuffer;
+    }
+    if (!strcmp(name, "vkResetCommandBuffer")) {
+        return (void*)entry_vkResetCommandBuffer;
+    }
+    if (!strcmp(name, "vkCmdBindPipeline")) {
+        return (void*)entry_vkCmdBindPipeline;
+    }
+    if (!strcmp(name, "vkCmdSetViewport")) {
+        return (void*)entry_vkCmdSetViewport;
+    }
+    if (!strcmp(name, "vkCmdSetScissor")) {
+        return (void*)entry_vkCmdSetScissor;
+    }
+    if (!strcmp(name, "vkCmdSetLineWidth")) {
+        return (void*)entry_vkCmdSetLineWidth;
+    }
+    if (!strcmp(name, "vkCmdSetDepthBias")) {
+        return (void*)entry_vkCmdSetDepthBias;
+    }
+    if (!strcmp(name, "vkCmdSetBlendConstants")) {
+        return (void*)entry_vkCmdSetBlendConstants;
+    }
+    if (!strcmp(name, "vkCmdSetDepthBounds")) {
+        return (void*)entry_vkCmdSetDepthBounds;
+    }
+    if (!strcmp(name, "vkCmdSetStencilCompareMask")) {
+        return (void*)entry_vkCmdSetStencilCompareMask;
+    }
+    if (!strcmp(name, "vkCmdSetStencilWriteMask")) {
+        return (void*)entry_vkCmdSetStencilWriteMask;
+    }
+    if (!strcmp(name, "vkCmdSetStencilReference")) {
+        return (void*)entry_vkCmdSetStencilReference;
+    }
+    if (!strcmp(name, "vkCmdBindDescriptorSets")) {
+        return (void*)entry_vkCmdBindDescriptorSets;
+    }
+    if (!strcmp(name, "vkCmdBindIndexBuffer")) {
+        return (void*)entry_vkCmdBindIndexBuffer;
+    }
+    if (!strcmp(name, "vkCmdBindVertexBuffers")) {
+        return (void*)entry_vkCmdBindVertexBuffers;
+    }
+    if (!strcmp(name, "vkCmdDraw")) {
+        return (void*)entry_vkCmdDraw;
+    }
+    if (!strcmp(name, "vkCmdDrawIndexed")) {
+        return (void*)entry_vkCmdDrawIndexed;
+    }
+    if (!strcmp(name, "vkCmdDrawIndirect")) {
+        return (void*)entry_vkCmdDrawIndirect;
+    }
+    if (!strcmp(name, "vkCmdDrawIndexedIndirect")) {
+        return (void*)entry_vkCmdDrawIndexedIndirect;
+    }
+    if (!strcmp(name, "vkCmdDispatch")) {
+        return (void*)entry_vkCmdDispatch;
+    }
+    if (!strcmp(name, "vkCmdDispatchIndirect")) {
+        return (void*)entry_vkCmdDispatchIndirect;
+    }
+    if (!strcmp(name, "vkCmdCopyBuffer")) {
+        return (void*)entry_vkCmdCopyBuffer;
+    }
+    if (!strcmp(name, "vkCmdCopyImage")) {
+        return (void*)entry_vkCmdCopyImage;
+    }
+    if (!strcmp(name, "vkCmdBlitImage")) {
+        return (void*)entry_vkCmdBlitImage;
+    }
+    if (!strcmp(name, "vkCmdCopyBufferToImage")) {
+        return (void*)entry_vkCmdCopyBufferToImage;
+    }
+    if (!strcmp(name, "vkCmdCopyImageToBuffer")) {
+        return (void*)entry_vkCmdCopyImageToBuffer;
+    }
+    if (!strcmp(name, "vkCmdUpdateBuffer")) {
+        return (void*)entry_vkCmdUpdateBuffer;
+    }
+    if (!strcmp(name, "vkCmdFillBuffer")) {
+        return (void*)entry_vkCmdFillBuffer;
+    }
+    if (!strcmp(name, "vkCmdClearColorImage")) {
+        return (void*)entry_vkCmdClearColorImage;
+    }
+    if (!strcmp(name, "vkCmdClearDepthStencilImage")) {
+        return (void*)entry_vkCmdClearDepthStencilImage;
+    }
+    if (!strcmp(name, "vkCmdClearAttachments")) {
+        return (void*)entry_vkCmdClearAttachments;
+    }
+    if (!strcmp(name, "vkCmdResolveImage")) {
+        return (void*)entry_vkCmdResolveImage;
+    }
+    if (!strcmp(name, "vkCmdSetEvent")) {
+        return (void*)entry_vkCmdSetEvent;
+    }
+    if (!strcmp(name, "vkCmdResetEvent")) {
+        return (void*)entry_vkCmdResetEvent;
+    }
+    if (!strcmp(name, "vkCmdWaitEvents")) {
+        return (void*)entry_vkCmdWaitEvents;
+    }
+    if (!strcmp(name, "vkCmdPipelineBarrier")) {
+        return (void*)entry_vkCmdPipelineBarrier;
+    }
+    if (!strcmp(name, "vkCmdBeginQuery")) {
+        return (void*)entry_vkCmdBeginQuery;
+    }
+    if (!strcmp(name, "vkCmdEndQuery")) {
+        return (void*)entry_vkCmdEndQuery;
+    }
+    if (!strcmp(name, "vkCmdResetQueryPool")) {
+        return (void*)entry_vkCmdResetQueryPool;
+    }
+    if (!strcmp(name, "vkCmdWriteTimestamp")) {
+        return (void*)entry_vkCmdWriteTimestamp;
+    }
+    if (!strcmp(name, "vkCmdCopyQueryPoolResults")) {
+        return (void*)entry_vkCmdCopyQueryPoolResults;
+    }
+    if (!strcmp(name, "vkCmdPushConstants")) {
+        return (void*)entry_vkCmdPushConstants;
+    }
+    if (!strcmp(name, "vkCmdBeginRenderPass")) {
+        return (void*)entry_vkCmdBeginRenderPass;
+    }
+    if (!strcmp(name, "vkCmdNextSubpass")) {
+        return (void*)entry_vkCmdNextSubpass;
+    }
+    if (!strcmp(name, "vkCmdEndRenderPass")) {
+        return (void*)entry_vkCmdEndRenderPass;
+    }
+    if (!strcmp(name, "vkCmdExecuteCommands")) {
+        return (void*)entry_vkCmdExecuteCommands;
+    }
+#endif
+#ifdef VK_VERSION_1_1
+    if (!strcmp(name, "vkEnumerateInstanceVersion")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkBindBufferMemory2")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkBindImageMemory2")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetDeviceGroupPeerMemoryFeatures")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetDeviceMask")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdDispatchBase")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkEnumeratePhysicalDeviceGroups")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetImageMemoryRequirements2")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetBufferMemoryRequirements2")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetImageSparseMemoryRequirements2")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceFeatures2")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceProperties2")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceFormatProperties2")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceImageFormatProperties2")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceQueueFamilyProperties2")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceMemoryProperties2")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceSparseImageFormatProperties2")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkTrimCommandPool")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetDeviceQueue2")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCreateSamplerYcbcrConversion")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkDestroySamplerYcbcrConversion")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCreateDescriptorUpdateTemplate")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkDestroyDescriptorUpdateTemplate")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkUpdateDescriptorSetWithTemplate")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceExternalBufferProperties")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceExternalFenceProperties")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceExternalSemaphoreProperties")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetDescriptorSetLayoutSupport")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_VERSION_1_2
+    if (!strcmp(name, "vkCmdDrawIndirectCount")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdDrawIndexedIndirectCount")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCreateRenderPass2")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdBeginRenderPass2")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdNextSubpass2")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdEndRenderPass2")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkResetQueryPool")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetSemaphoreCounterValue")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkWaitSemaphores")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkSignalSemaphore")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetBufferDeviceAddress")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetBufferOpaqueCaptureAddress")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetDeviceMemoryOpaqueCaptureAddress")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_surface
+    if (!strcmp(name, "vkDestroySurfaceKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceSurfaceSupportKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceSurfaceFormatsKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceSurfacePresentModesKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_swapchain
+    if (!strcmp(name, "vkCreateSwapchainKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkDestroySwapchainKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetSwapchainImagesKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkAcquireNextImageKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkQueuePresentKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetDeviceGroupPresentCapabilitiesKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetDeviceGroupSurfacePresentModesKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDevicePresentRectanglesKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkAcquireNextImage2KHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_display
+    if (!strcmp(name, "vkGetPhysicalDeviceDisplayPropertiesKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceDisplayPlanePropertiesKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetDisplayPlaneSupportedDisplaysKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetDisplayModePropertiesKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCreateDisplayModeKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetDisplayPlaneCapabilitiesKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCreateDisplayPlaneSurfaceKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_display_swapchain
+    if (!strcmp(name, "vkCreateSharedSwapchainsKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_xlib_surface
+    if (!strcmp(name, "vkCreateXlibSurfaceKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceXlibPresentationSupportKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_xcb_surface
+    if (!strcmp(name, "vkCreateXcbSurfaceKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceXcbPresentationSupportKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_wayland_surface
+    if (!strcmp(name, "vkCreateWaylandSurfaceKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceWaylandPresentationSupportKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_android_surface
+    if (!strcmp(name, "vkCreateAndroidSurfaceKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_win32_surface
+    if (!strcmp(name, "vkCreateWin32SurfaceKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceWin32PresentationSupportKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_video_queue
+    if (!strcmp(name, "vkGetPhysicalDeviceVideoCapabilitiesKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceVideoFormatPropertiesKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCreateVideoSessionKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkDestroyVideoSessionKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetVideoSessionMemoryRequirementsKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkBindVideoSessionMemoryKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCreateVideoSessionParametersKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkUpdateVideoSessionParametersKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkDestroyVideoSessionParametersKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdBeginVideoCodingKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdEndVideoCodingKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdControlVideoCodingKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_video_decode_queue
+    if (!strcmp(name, "vkCmdDecodeVideoKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_dynamic_rendering
+    if (!strcmp(name, "vkCmdBeginRenderingKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdEndRenderingKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_get_physical_device_properties2
+    if (!strcmp(name, "vkGetPhysicalDeviceFeatures2KHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceProperties2KHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceFormatProperties2KHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceImageFormatProperties2KHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceQueueFamilyProperties2KHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceMemoryProperties2KHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceSparseImageFormatProperties2KHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_device_group
+    if (!strcmp(name, "vkGetDeviceGroupPeerMemoryFeaturesKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetDeviceMaskKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdDispatchBaseKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_maintenance1
+    if (!strcmp(name, "vkTrimCommandPoolKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_device_group_creation
+    if (!strcmp(name, "vkEnumeratePhysicalDeviceGroupsKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_external_memory_capabilities
+    if (!strcmp(name, "vkGetPhysicalDeviceExternalBufferPropertiesKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_external_memory_win32
+    if (!strcmp(name, "vkGetMemoryWin32HandleKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetMemoryWin32HandlePropertiesKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_external_memory_fd
+    if (!strcmp(name, "vkGetMemoryFdKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetMemoryFdPropertiesKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_external_semaphore_capabilities
+    if (!strcmp(name, "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+    if (!strcmp(name, "vkImportSemaphoreWin32HandleKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetSemaphoreWin32HandleKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_external_semaphore_fd
+    if (!strcmp(name, "vkImportSemaphoreFdKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetSemaphoreFdKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_push_descriptor
+    if (!strcmp(name, "vkCmdPushDescriptorSetKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdPushDescriptorSetWithTemplateKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_descriptor_update_template
+    if (!strcmp(name, "vkCreateDescriptorUpdateTemplateKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkDestroyDescriptorUpdateTemplateKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkUpdateDescriptorSetWithTemplateKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_create_renderpass2
+    if (!strcmp(name, "vkCreateRenderPass2KHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdBeginRenderPass2KHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdNextSubpass2KHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdEndRenderPass2KHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_shared_presentable_image
+    if (!strcmp(name, "vkGetSwapchainStatusKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_external_fence_capabilities
+    if (!strcmp(name, "vkGetPhysicalDeviceExternalFencePropertiesKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_external_fence_win32
+    if (!strcmp(name, "vkImportFenceWin32HandleKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetFenceWin32HandleKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_external_fence_fd
+    if (!strcmp(name, "vkImportFenceFdKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetFenceFdKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_performance_query
+    if (!strcmp(name, "vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkAcquireProfilingLockKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkReleaseProfilingLockKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_get_surface_capabilities2
+    if (!strcmp(name, "vkGetPhysicalDeviceSurfaceCapabilities2KHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceSurfaceFormats2KHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_get_display_properties2
+    if (!strcmp(name, "vkGetPhysicalDeviceDisplayProperties2KHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceDisplayPlaneProperties2KHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetDisplayModeProperties2KHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetDisplayPlaneCapabilities2KHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_get_memory_requirements2
+    if (!strcmp(name, "vkGetImageMemoryRequirements2KHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetBufferMemoryRequirements2KHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetImageSparseMemoryRequirements2KHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_sampler_ycbcr_conversion
+    if (!strcmp(name, "vkCreateSamplerYcbcrConversionKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkDestroySamplerYcbcrConversionKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_bind_memory2
+    if (!strcmp(name, "vkBindBufferMemory2KHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkBindImageMemory2KHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_maintenance3
+    if (!strcmp(name, "vkGetDescriptorSetLayoutSupportKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_draw_indirect_count
+    if (!strcmp(name, "vkCmdDrawIndirectCountKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdDrawIndexedIndirectCountKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_timeline_semaphore
+    if (!strcmp(name, "vkGetSemaphoreCounterValueKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkWaitSemaphoresKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkSignalSemaphoreKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+    if (!strcmp(name, "vkGetPhysicalDeviceFragmentShadingRatesKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetFragmentShadingRateKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_present_wait
+    if (!strcmp(name, "vkWaitForPresentKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_buffer_device_address
+    if (!strcmp(name, "vkGetBufferDeviceAddressKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetBufferOpaqueCaptureAddressKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetDeviceMemoryOpaqueCaptureAddressKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_deferred_host_operations
+    if (!strcmp(name, "vkCreateDeferredOperationKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkDestroyDeferredOperationKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetDeferredOperationMaxConcurrencyKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetDeferredOperationResultKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkDeferredOperationJoinKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+    if (!strcmp(name, "vkGetPipelineExecutablePropertiesKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPipelineExecutableStatisticsKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPipelineExecutableInternalRepresentationsKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_video_encode_queue
+    if (!strcmp(name, "vkCmdEncodeVideoKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_synchronization2
+    if (!strcmp(name, "vkCmdSetEvent2KHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdResetEvent2KHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdWaitEvents2KHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdPipelineBarrier2KHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdWriteTimestamp2KHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkQueueSubmit2KHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdWriteBufferMarker2AMD")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetQueueCheckpointData2NV")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_copy_commands2
+    if (!strcmp(name, "vkCmdCopyBuffer2KHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdCopyImage2KHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdCopyBufferToImage2KHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdCopyImageToBuffer2KHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdBlitImage2KHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdResolveImage2KHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_maintenance4
+    if (!strcmp(name, "vkGetDeviceBufferMemoryRequirementsKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetDeviceImageMemoryRequirementsKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetDeviceImageSparseMemoryRequirementsKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_ANDROID_native_buffer
+    if (!strcmp(name, "vkGetSwapchainGrallocUsageANDROID")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkAcquireImageANDROID")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkQueueSignalReleaseImageANDROID")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_debug_report
+    if (!strcmp(name, "vkCreateDebugReportCallbackEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkDestroyDebugReportCallbackEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkDebugReportMessageEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_debug_marker
+    if (!strcmp(name, "vkDebugMarkerSetObjectTagEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkDebugMarkerSetObjectNameEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdDebugMarkerBeginEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdDebugMarkerEndEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdDebugMarkerInsertEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_transform_feedback
+    if (!strcmp(name, "vkCmdBindTransformFeedbackBuffersEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdBeginTransformFeedbackEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdEndTransformFeedbackEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdBeginQueryIndexedEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdEndQueryIndexedEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdDrawIndirectByteCountEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_NVX_binary_import
+    if (!strcmp(name, "vkCreateCuModuleNVX")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCreateCuFunctionNVX")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkDestroyCuModuleNVX")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkDestroyCuFunctionNVX")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdCuLaunchKernelNVX")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_NVX_image_view_handle
+    if (!strcmp(name, "vkGetImageViewHandleNVX")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetImageViewAddressNVX")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_AMD_draw_indirect_count
+    if (!strcmp(name, "vkCmdDrawIndirectCountAMD")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdDrawIndexedIndirectCountAMD")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_AMD_shader_info
+    if (!strcmp(name, "vkGetShaderInfoAMD")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_GGP_stream_descriptor_surface
+    if (!strcmp(name, "vkCreateStreamDescriptorSurfaceGGP")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_NV_external_memory_capabilities
+    if (!strcmp(name, "vkGetPhysicalDeviceExternalImageFormatPropertiesNV")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_NV_external_memory_win32
+    if (!strcmp(name, "vkGetMemoryWin32HandleNV")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_NN_vi_surface
+    if (!strcmp(name, "vkCreateViSurfaceNN")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_conditional_rendering
+    if (!strcmp(name, "vkCmdBeginConditionalRenderingEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdEndConditionalRenderingEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+    if (!strcmp(name, "vkCmdSetViewportWScalingNV")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_direct_mode_display
+    if (!strcmp(name, "vkReleaseDisplayEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_acquire_xlib_display
+    if (!strcmp(name, "vkAcquireXlibDisplayEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetRandROutputDisplayEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_display_surface_counter
+    if (!strcmp(name, "vkGetPhysicalDeviceSurfaceCapabilities2EXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_display_control
+    if (!strcmp(name, "vkDisplayPowerControlEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkRegisterDeviceEventEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkRegisterDisplayEventEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetSwapchainCounterEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_GOOGLE_display_timing
+    if (!strcmp(name, "vkGetRefreshCycleDurationGOOGLE")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPastPresentationTimingGOOGLE")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_discard_rectangles
+    if (!strcmp(name, "vkCmdSetDiscardRectangleEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_hdr_metadata
+    if (!strcmp(name, "vkSetHdrMetadataEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_MVK_ios_surface
+    if (!strcmp(name, "vkCreateIOSSurfaceMVK")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_MVK_macos_surface
+    if (!strcmp(name, "vkCreateMacOSSurfaceMVK")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_MVK_moltenvk
+    if (!strcmp(name, "vkGetMTLDeviceMVK")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkSetMTLTextureMVK")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetMTLTextureMVK")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetMTLBufferMVK")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkUseIOSurfaceMVK")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetIOSurfaceMVK")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_debug_utils
+    if (!strcmp(name, "vkSetDebugUtilsObjectNameEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkSetDebugUtilsObjectTagEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkQueueBeginDebugUtilsLabelEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkQueueEndDebugUtilsLabelEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkQueueInsertDebugUtilsLabelEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdBeginDebugUtilsLabelEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdEndDebugUtilsLabelEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdInsertDebugUtilsLabelEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCreateDebugUtilsMessengerEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkDestroyDebugUtilsMessengerEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkSubmitDebugUtilsMessageEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+    if (!strcmp(name, "vkGetAndroidHardwareBufferPropertiesANDROID")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetMemoryAndroidHardwareBufferANDROID")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_sample_locations
+    if (!strcmp(name, "vkCmdSetSampleLocationsEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceMultisamplePropertiesEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+    if (!strcmp(name, "vkGetImageDrmFormatModifierPropertiesEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_validation_cache
+    if (!strcmp(name, "vkCreateValidationCacheEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkDestroyValidationCacheEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkMergeValidationCachesEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetValidationCacheDataEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_NV_shading_rate_image
+    if (!strcmp(name, "vkCmdBindShadingRateImageNV")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetViewportShadingRatePaletteNV")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetCoarseSampleOrderNV")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_NV_ray_tracing
+    if (!strcmp(name, "vkCreateAccelerationStructureNV")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkDestroyAccelerationStructureNV")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetAccelerationStructureMemoryRequirementsNV")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkBindAccelerationStructureMemoryNV")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdBuildAccelerationStructureNV")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdCopyAccelerationStructureNV")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdTraceRaysNV")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCreateRayTracingPipelinesNV")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetRayTracingShaderGroupHandlesKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetRayTracingShaderGroupHandlesNV")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetAccelerationStructureHandleNV")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdWriteAccelerationStructuresPropertiesNV")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCompileDeferredNV")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_external_memory_host
+    if (!strcmp(name, "vkGetMemoryHostPointerPropertiesEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_AMD_buffer_marker
+    if (!strcmp(name, "vkCmdWriteBufferMarkerAMD")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_calibrated_timestamps
+    if (!strcmp(name, "vkGetPhysicalDeviceCalibrateableTimeDomainsEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetCalibratedTimestampsEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_NV_mesh_shader
+    if (!strcmp(name, "vkCmdDrawMeshTasksNV")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdDrawMeshTasksIndirectNV")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdDrawMeshTasksIndirectCountNV")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_NV_scissor_exclusive
+    if (!strcmp(name, "vkCmdSetExclusiveScissorNV")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+    if (!strcmp(name, "vkCmdSetCheckpointNV")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetQueueCheckpointDataNV")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_INTEL_performance_query
+    if (!strcmp(name, "vkInitializePerformanceApiINTEL")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkUninitializePerformanceApiINTEL")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetPerformanceMarkerINTEL")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetPerformanceStreamMarkerINTEL")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetPerformanceOverrideINTEL")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkAcquirePerformanceConfigurationINTEL")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkReleasePerformanceConfigurationINTEL")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkQueueSetPerformanceConfigurationINTEL")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPerformanceParameterINTEL")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_AMD_display_native_hdr
+    if (!strcmp(name, "vkSetLocalDimmingAMD")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_FUCHSIA_imagepipe_surface
+    if (!strcmp(name, "vkCreateImagePipeSurfaceFUCHSIA")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_metal_surface
+    if (!strcmp(name, "vkCreateMetalSurfaceEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_buffer_device_address
+    if (!strcmp(name, "vkGetBufferDeviceAddressEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_tooling_info
+    if (!strcmp(name, "vkGetPhysicalDeviceToolPropertiesEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_NV_cooperative_matrix
+    if (!strcmp(name, "vkGetPhysicalDeviceCooperativeMatrixPropertiesNV")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+    if (!strcmp(name, "vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+    if (!strcmp(name, "vkGetPhysicalDeviceSurfacePresentModes2EXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkAcquireFullScreenExclusiveModeEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkReleaseFullScreenExclusiveModeEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetDeviceGroupSurfacePresentModes2EXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_headless_surface
+    if (!strcmp(name, "vkCreateHeadlessSurfaceEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_line_rasterization
+    if (!strcmp(name, "vkCmdSetLineStippleEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_host_query_reset
+    if (!strcmp(name, "vkResetQueryPoolEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+    if (!strcmp(name, "vkCmdSetCullModeEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetFrontFaceEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetPrimitiveTopologyEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetViewportWithCountEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetScissorWithCountEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdBindVertexBuffers2EXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetDepthTestEnableEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetDepthWriteEnableEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetDepthCompareOpEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetDepthBoundsTestEnableEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetStencilTestEnableEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetStencilOpEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_NV_device_generated_commands
+    if (!strcmp(name, "vkGetGeneratedCommandsMemoryRequirementsNV")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdPreprocessGeneratedCommandsNV")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdExecuteGeneratedCommandsNV")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdBindPipelineShaderGroupNV")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCreateIndirectCommandsLayoutNV")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkDestroyIndirectCommandsLayoutNV")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_acquire_drm_display
+    if (!strcmp(name, "vkAcquireDrmDisplayEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetDrmDisplayEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_private_data
+    if (!strcmp(name, "vkCreatePrivateDataSlotEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkDestroyPrivateDataSlotEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkSetPrivateDataEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPrivateDataEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+    if (!strcmp(name, "vkCmdSetFragmentShadingRateEnumNV")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_NV_acquire_winrt_display
+    if (!strcmp(name, "vkAcquireWinrtDisplayNV")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetWinrtDisplayNV")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_directfb_surface
+    if (!strcmp(name, "vkCreateDirectFBSurfaceEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceDirectFBPresentationSupportEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+    if (!strcmp(name, "vkCmdSetVertexInputEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_FUCHSIA_external_memory
+    if (!strcmp(name, "vkGetMemoryZirconHandleFUCHSIA")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetMemoryZirconHandlePropertiesFUCHSIA")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_FUCHSIA_external_semaphore
+    if (!strcmp(name, "vkImportSemaphoreZirconHandleFUCHSIA")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetSemaphoreZirconHandleFUCHSIA")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+    if (!strcmp(name, "vkCreateBufferCollectionFUCHSIA")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkSetBufferCollectionImageConstraintsFUCHSIA")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkSetBufferCollectionBufferConstraintsFUCHSIA")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkDestroyBufferCollectionFUCHSIA")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetBufferCollectionPropertiesFUCHSIA")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+    if (!strcmp(name, "vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdSubpassShadingHUAWEI")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+    if (!strcmp(name, "vkCmdBindInvocationMaskHUAWEI")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_NV_external_memory_rdma
+    if (!strcmp(name, "vkGetMemoryRemoteAddressNV")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+    if (!strcmp(name, "vkCmdSetPatchControlPointsEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetRasterizerDiscardEnableEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetDepthBiasEnableEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetLogicOpEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetPrimitiveRestartEnableEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_QNX_screen_surface
+    if (!strcmp(name, "vkCreateScreenSurfaceQNX")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceScreenPresentationSupportQNX")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_color_write_enable
+    if (!strcmp(name, "vkCmdSetColorWriteEnableEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_GOOGLE_gfxstream
+    if (!strcmp(name, "vkMapMemoryIntoAddressSpaceGOOGLE")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkUpdateDescriptorSetWithTemplateSizedGOOGLE")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkBeginCommandBufferAsyncGOOGLE")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkEndCommandBufferAsyncGOOGLE")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkResetCommandBufferAsyncGOOGLE")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCommandBufferHostSyncGOOGLE")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCreateImageWithRequirementsGOOGLE")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCreateBufferWithRequirementsGOOGLE")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetMemoryHostAddressInfoGOOGLE")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkFreeMemorySyncGOOGLE")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkQueueHostSyncGOOGLE")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkQueueSubmitAsyncGOOGLE")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkQueueWaitIdleAsyncGOOGLE")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkQueueBindSparseAsyncGOOGLE")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetLinearImageLayoutGOOGLE")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetLinearImageLayout2GOOGLE")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkQueueFlushCommandsGOOGLE")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkQueueCommitDescriptorSetUpdatesGOOGLE")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCollectDescriptorPoolIdsGOOGLE")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkQueueSignalReleaseImageANDROIDAsyncGOOGLE")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkQueueFlushCommandsFromAuxMemoryGOOGLE")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetBlobGOOGLE")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_multi_draw
+    if (!strcmp(name, "vkCmdDrawMultiEXT")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdDrawMultiIndexedEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+    if (!strcmp(name, "vkSetDeviceMemoryPriorityEXT")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_acceleration_structure
+    if (!strcmp(name, "vkCreateAccelerationStructureKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkDestroyAccelerationStructureKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdBuildAccelerationStructuresKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdBuildAccelerationStructuresIndirectKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkBuildAccelerationStructuresKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCopyAccelerationStructureKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCopyAccelerationStructureToMemoryKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCopyMemoryToAccelerationStructureKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkWriteAccelerationStructuresPropertiesKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdCopyAccelerationStructureKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdCopyAccelerationStructureToMemoryKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdCopyMemoryToAccelerationStructureKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetAccelerationStructureDeviceAddressKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdWriteAccelerationStructuresPropertiesKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetDeviceAccelerationStructureCompatibilityKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetAccelerationStructureBuildSizesKHR")) {
+        return nullptr;
+    }
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+    if (!strcmp(name, "vkCmdTraceRaysKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCreateRayTracingPipelinesKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetRayTracingCaptureReplayShaderGroupHandlesKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdTraceRaysIndirectKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetRayTracingShaderGroupStackSizeKHR")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetRayTracingPipelineStackSizeKHR")) {
+        return nullptr;
+    }
+#endif
+    return nullptr;
+}
+void* goldfish_vulkan_get_instance_proc_address(VkInstance instance, const char* name) {
+    auto resources = ResourceTracker::get();
+    bool has1_1OrHigher = resources->getApiVersionFromInstance(instance) >= VK_API_VERSION_1_1;
+    bool has1_2OrHigher = resources->getApiVersionFromInstance(instance) >= VK_API_VERSION_1_2;
+#ifdef VK_VERSION_1_0
+    if (!strcmp(name, "vkCreateInstance")) {
+        return (void*)entry_vkCreateInstance;
+    }
+    if (!strcmp(name, "vkDestroyInstance")) {
+        return (void*)entry_vkDestroyInstance;
+    }
+    if (!strcmp(name, "vkEnumeratePhysicalDevices")) {
+        return (void*)entry_vkEnumeratePhysicalDevices;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceFeatures")) {
+        return (void*)entry_vkGetPhysicalDeviceFeatures;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceFormatProperties")) {
+        return (void*)entry_vkGetPhysicalDeviceFormatProperties;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceImageFormatProperties")) {
+        return (void*)entry_vkGetPhysicalDeviceImageFormatProperties;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceProperties")) {
+        return (void*)entry_vkGetPhysicalDeviceProperties;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceQueueFamilyProperties")) {
+        return (void*)entry_vkGetPhysicalDeviceQueueFamilyProperties;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceMemoryProperties")) {
+        return (void*)entry_vkGetPhysicalDeviceMemoryProperties;
+    }
+    if (!strcmp(name, "vkGetInstanceProcAddr")) {
+        return (void*)entry_vkGetInstanceProcAddr;
+    }
+    if (!strcmp(name, "vkGetDeviceProcAddr")) {
+        return (void*)entry_vkGetDeviceProcAddr;
+    }
+    if (!strcmp(name, "vkCreateDevice")) {
+        return (void*)entry_vkCreateDevice;
+    }
+    if (!strcmp(name, "vkDestroyDevice")) {
+        return (void*)entry_vkDestroyDevice;
+    }
+    if (!strcmp(name, "vkEnumerateInstanceExtensionProperties")) {
+        return (void*)entry_vkEnumerateInstanceExtensionProperties;
+    }
+    if (!strcmp(name, "vkEnumerateDeviceExtensionProperties")) {
+        return (void*)entry_vkEnumerateDeviceExtensionProperties;
+    }
+    if (!strcmp(name, "vkEnumerateInstanceLayerProperties")) {
+        return (void*)entry_vkEnumerateInstanceLayerProperties;
+    }
+    if (!strcmp(name, "vkEnumerateDeviceLayerProperties")) {
+        return (void*)entry_vkEnumerateDeviceLayerProperties;
+    }
+    if (!strcmp(name, "vkGetDeviceQueue")) {
+        return (void*)entry_vkGetDeviceQueue;
+    }
+    if (!strcmp(name, "vkQueueSubmit")) {
+        return (void*)entry_vkQueueSubmit;
+    }
+    if (!strcmp(name, "vkQueueWaitIdle")) {
+        return (void*)entry_vkQueueWaitIdle;
+    }
+    if (!strcmp(name, "vkDeviceWaitIdle")) {
+        return (void*)entry_vkDeviceWaitIdle;
+    }
+    if (!strcmp(name, "vkAllocateMemory")) {
+        return (void*)entry_vkAllocateMemory;
+    }
+    if (!strcmp(name, "vkFreeMemory")) {
+        return (void*)entry_vkFreeMemory;
+    }
+    if (!strcmp(name, "vkMapMemory")) {
+        return (void*)entry_vkMapMemory;
+    }
+    if (!strcmp(name, "vkUnmapMemory")) {
+        return (void*)entry_vkUnmapMemory;
+    }
+    if (!strcmp(name, "vkFlushMappedMemoryRanges")) {
+        return (void*)entry_vkFlushMappedMemoryRanges;
+    }
+    if (!strcmp(name, "vkInvalidateMappedMemoryRanges")) {
+        return (void*)entry_vkInvalidateMappedMemoryRanges;
+    }
+    if (!strcmp(name, "vkGetDeviceMemoryCommitment")) {
+        return (void*)entry_vkGetDeviceMemoryCommitment;
+    }
+    if (!strcmp(name, "vkBindBufferMemory")) {
+        return (void*)entry_vkBindBufferMemory;
+    }
+    if (!strcmp(name, "vkBindImageMemory")) {
+        return (void*)entry_vkBindImageMemory;
+    }
+    if (!strcmp(name, "vkGetBufferMemoryRequirements")) {
+        return (void*)entry_vkGetBufferMemoryRequirements;
+    }
+    if (!strcmp(name, "vkGetImageMemoryRequirements")) {
+        return (void*)entry_vkGetImageMemoryRequirements;
+    }
+    if (!strcmp(name, "vkGetImageSparseMemoryRequirements")) {
+        return (void*)entry_vkGetImageSparseMemoryRequirements;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceSparseImageFormatProperties")) {
+        return (void*)entry_vkGetPhysicalDeviceSparseImageFormatProperties;
+    }
+    if (!strcmp(name, "vkQueueBindSparse")) {
+        return (void*)entry_vkQueueBindSparse;
+    }
+    if (!strcmp(name, "vkCreateFence")) {
+        return (void*)entry_vkCreateFence;
+    }
+    if (!strcmp(name, "vkDestroyFence")) {
+        return (void*)entry_vkDestroyFence;
+    }
+    if (!strcmp(name, "vkResetFences")) {
+        return (void*)entry_vkResetFences;
+    }
+    if (!strcmp(name, "vkGetFenceStatus")) {
+        return (void*)entry_vkGetFenceStatus;
+    }
+    if (!strcmp(name, "vkWaitForFences")) {
+        return (void*)entry_vkWaitForFences;
+    }
+    if (!strcmp(name, "vkCreateSemaphore")) {
+        return (void*)entry_vkCreateSemaphore;
+    }
+    if (!strcmp(name, "vkDestroySemaphore")) {
+        return (void*)entry_vkDestroySemaphore;
+    }
+    if (!strcmp(name, "vkCreateEvent")) {
+        return (void*)entry_vkCreateEvent;
+    }
+    if (!strcmp(name, "vkDestroyEvent")) {
+        return (void*)entry_vkDestroyEvent;
+    }
+    if (!strcmp(name, "vkGetEventStatus")) {
+        return (void*)entry_vkGetEventStatus;
+    }
+    if (!strcmp(name, "vkSetEvent")) {
+        return (void*)entry_vkSetEvent;
+    }
+    if (!strcmp(name, "vkResetEvent")) {
+        return (void*)entry_vkResetEvent;
+    }
+    if (!strcmp(name, "vkCreateQueryPool")) {
+        return (void*)entry_vkCreateQueryPool;
+    }
+    if (!strcmp(name, "vkDestroyQueryPool")) {
+        return (void*)entry_vkDestroyQueryPool;
+    }
+    if (!strcmp(name, "vkGetQueryPoolResults")) {
+        return (void*)entry_vkGetQueryPoolResults;
+    }
+    if (!strcmp(name, "vkCreateBuffer")) {
+        return (void*)entry_vkCreateBuffer;
+    }
+    if (!strcmp(name, "vkDestroyBuffer")) {
+        return (void*)entry_vkDestroyBuffer;
+    }
+    if (!strcmp(name, "vkCreateBufferView")) {
+        return (void*)entry_vkCreateBufferView;
+    }
+    if (!strcmp(name, "vkDestroyBufferView")) {
+        return (void*)entry_vkDestroyBufferView;
+    }
+    if (!strcmp(name, "vkCreateImage")) {
+        return (void*)entry_vkCreateImage;
+    }
+    if (!strcmp(name, "vkDestroyImage")) {
+        return (void*)entry_vkDestroyImage;
+    }
+    if (!strcmp(name, "vkGetImageSubresourceLayout")) {
+        return (void*)entry_vkGetImageSubresourceLayout;
+    }
+    if (!strcmp(name, "vkCreateImageView")) {
+        return (void*)entry_vkCreateImageView;
+    }
+    if (!strcmp(name, "vkDestroyImageView")) {
+        return (void*)entry_vkDestroyImageView;
+    }
+    if (!strcmp(name, "vkCreateShaderModule")) {
+        return (void*)entry_vkCreateShaderModule;
+    }
+    if (!strcmp(name, "vkDestroyShaderModule")) {
+        return (void*)entry_vkDestroyShaderModule;
+    }
+    if (!strcmp(name, "vkCreatePipelineCache")) {
+        return (void*)entry_vkCreatePipelineCache;
+    }
+    if (!strcmp(name, "vkDestroyPipelineCache")) {
+        return (void*)entry_vkDestroyPipelineCache;
+    }
+    if (!strcmp(name, "vkGetPipelineCacheData")) {
+        return (void*)entry_vkGetPipelineCacheData;
+    }
+    if (!strcmp(name, "vkMergePipelineCaches")) {
+        return (void*)entry_vkMergePipelineCaches;
+    }
+    if (!strcmp(name, "vkCreateGraphicsPipelines")) {
+        return (void*)entry_vkCreateGraphicsPipelines;
+    }
+    if (!strcmp(name, "vkCreateComputePipelines")) {
+        return (void*)entry_vkCreateComputePipelines;
+    }
+    if (!strcmp(name, "vkDestroyPipeline")) {
+        return (void*)entry_vkDestroyPipeline;
+    }
+    if (!strcmp(name, "vkCreatePipelineLayout")) {
+        return (void*)entry_vkCreatePipelineLayout;
+    }
+    if (!strcmp(name, "vkDestroyPipelineLayout")) {
+        return (void*)entry_vkDestroyPipelineLayout;
+    }
+    if (!strcmp(name, "vkCreateSampler")) {
+        return (void*)entry_vkCreateSampler;
+    }
+    if (!strcmp(name, "vkDestroySampler")) {
+        return (void*)entry_vkDestroySampler;
+    }
+    if (!strcmp(name, "vkCreateDescriptorSetLayout")) {
+        return (void*)entry_vkCreateDescriptorSetLayout;
+    }
+    if (!strcmp(name, "vkDestroyDescriptorSetLayout")) {
+        return (void*)entry_vkDestroyDescriptorSetLayout;
+    }
+    if (!strcmp(name, "vkCreateDescriptorPool")) {
+        return (void*)entry_vkCreateDescriptorPool;
+    }
+    if (!strcmp(name, "vkDestroyDescriptorPool")) {
+        return (void*)entry_vkDestroyDescriptorPool;
+    }
+    if (!strcmp(name, "vkResetDescriptorPool")) {
+        return (void*)entry_vkResetDescriptorPool;
+    }
+    if (!strcmp(name, "vkAllocateDescriptorSets")) {
+        return (void*)entry_vkAllocateDescriptorSets;
+    }
+    if (!strcmp(name, "vkFreeDescriptorSets")) {
+        return (void*)entry_vkFreeDescriptorSets;
+    }
+    if (!strcmp(name, "vkUpdateDescriptorSets")) {
+        return (void*)entry_vkUpdateDescriptorSets;
+    }
+    if (!strcmp(name, "vkCreateFramebuffer")) {
+        return (void*)entry_vkCreateFramebuffer;
+    }
+    if (!strcmp(name, "vkDestroyFramebuffer")) {
+        return (void*)entry_vkDestroyFramebuffer;
+    }
+    if (!strcmp(name, "vkCreateRenderPass")) {
+        return (void*)entry_vkCreateRenderPass;
+    }
+    if (!strcmp(name, "vkDestroyRenderPass")) {
+        return (void*)entry_vkDestroyRenderPass;
+    }
+    if (!strcmp(name, "vkGetRenderAreaGranularity")) {
+        return (void*)entry_vkGetRenderAreaGranularity;
+    }
+    if (!strcmp(name, "vkCreateCommandPool")) {
+        return (void*)entry_vkCreateCommandPool;
+    }
+    if (!strcmp(name, "vkDestroyCommandPool")) {
+        return (void*)entry_vkDestroyCommandPool;
+    }
+    if (!strcmp(name, "vkResetCommandPool")) {
+        return (void*)entry_vkResetCommandPool;
+    }
+    if (!strcmp(name, "vkAllocateCommandBuffers")) {
+        return (void*)entry_vkAllocateCommandBuffers;
+    }
+    if (!strcmp(name, "vkFreeCommandBuffers")) {
+        return (void*)entry_vkFreeCommandBuffers;
+    }
+    if (!strcmp(name, "vkBeginCommandBuffer")) {
+        return (void*)entry_vkBeginCommandBuffer;
+    }
+    if (!strcmp(name, "vkEndCommandBuffer")) {
+        return (void*)entry_vkEndCommandBuffer;
+    }
+    if (!strcmp(name, "vkResetCommandBuffer")) {
+        return (void*)entry_vkResetCommandBuffer;
+    }
+    if (!strcmp(name, "vkCmdBindPipeline")) {
+        return (void*)entry_vkCmdBindPipeline;
+    }
+    if (!strcmp(name, "vkCmdSetViewport")) {
+        return (void*)entry_vkCmdSetViewport;
+    }
+    if (!strcmp(name, "vkCmdSetScissor")) {
+        return (void*)entry_vkCmdSetScissor;
+    }
+    if (!strcmp(name, "vkCmdSetLineWidth")) {
+        return (void*)entry_vkCmdSetLineWidth;
+    }
+    if (!strcmp(name, "vkCmdSetDepthBias")) {
+        return (void*)entry_vkCmdSetDepthBias;
+    }
+    if (!strcmp(name, "vkCmdSetBlendConstants")) {
+        return (void*)entry_vkCmdSetBlendConstants;
+    }
+    if (!strcmp(name, "vkCmdSetDepthBounds")) {
+        return (void*)entry_vkCmdSetDepthBounds;
+    }
+    if (!strcmp(name, "vkCmdSetStencilCompareMask")) {
+        return (void*)entry_vkCmdSetStencilCompareMask;
+    }
+    if (!strcmp(name, "vkCmdSetStencilWriteMask")) {
+        return (void*)entry_vkCmdSetStencilWriteMask;
+    }
+    if (!strcmp(name, "vkCmdSetStencilReference")) {
+        return (void*)entry_vkCmdSetStencilReference;
+    }
+    if (!strcmp(name, "vkCmdBindDescriptorSets")) {
+        return (void*)entry_vkCmdBindDescriptorSets;
+    }
+    if (!strcmp(name, "vkCmdBindIndexBuffer")) {
+        return (void*)entry_vkCmdBindIndexBuffer;
+    }
+    if (!strcmp(name, "vkCmdBindVertexBuffers")) {
+        return (void*)entry_vkCmdBindVertexBuffers;
+    }
+    if (!strcmp(name, "vkCmdDraw")) {
+        return (void*)entry_vkCmdDraw;
+    }
+    if (!strcmp(name, "vkCmdDrawIndexed")) {
+        return (void*)entry_vkCmdDrawIndexed;
+    }
+    if (!strcmp(name, "vkCmdDrawIndirect")) {
+        return (void*)entry_vkCmdDrawIndirect;
+    }
+    if (!strcmp(name, "vkCmdDrawIndexedIndirect")) {
+        return (void*)entry_vkCmdDrawIndexedIndirect;
+    }
+    if (!strcmp(name, "vkCmdDispatch")) {
+        return (void*)entry_vkCmdDispatch;
+    }
+    if (!strcmp(name, "vkCmdDispatchIndirect")) {
+        return (void*)entry_vkCmdDispatchIndirect;
+    }
+    if (!strcmp(name, "vkCmdCopyBuffer")) {
+        return (void*)entry_vkCmdCopyBuffer;
+    }
+    if (!strcmp(name, "vkCmdCopyImage")) {
+        return (void*)entry_vkCmdCopyImage;
+    }
+    if (!strcmp(name, "vkCmdBlitImage")) {
+        return (void*)entry_vkCmdBlitImage;
+    }
+    if (!strcmp(name, "vkCmdCopyBufferToImage")) {
+        return (void*)entry_vkCmdCopyBufferToImage;
+    }
+    if (!strcmp(name, "vkCmdCopyImageToBuffer")) {
+        return (void*)entry_vkCmdCopyImageToBuffer;
+    }
+    if (!strcmp(name, "vkCmdUpdateBuffer")) {
+        return (void*)entry_vkCmdUpdateBuffer;
+    }
+    if (!strcmp(name, "vkCmdFillBuffer")) {
+        return (void*)entry_vkCmdFillBuffer;
+    }
+    if (!strcmp(name, "vkCmdClearColorImage")) {
+        return (void*)entry_vkCmdClearColorImage;
+    }
+    if (!strcmp(name, "vkCmdClearDepthStencilImage")) {
+        return (void*)entry_vkCmdClearDepthStencilImage;
+    }
+    if (!strcmp(name, "vkCmdClearAttachments")) {
+        return (void*)entry_vkCmdClearAttachments;
+    }
+    if (!strcmp(name, "vkCmdResolveImage")) {
+        return (void*)entry_vkCmdResolveImage;
+    }
+    if (!strcmp(name, "vkCmdSetEvent")) {
+        return (void*)entry_vkCmdSetEvent;
+    }
+    if (!strcmp(name, "vkCmdResetEvent")) {
+        return (void*)entry_vkCmdResetEvent;
+    }
+    if (!strcmp(name, "vkCmdWaitEvents")) {
+        return (void*)entry_vkCmdWaitEvents;
+    }
+    if (!strcmp(name, "vkCmdPipelineBarrier")) {
+        return (void*)entry_vkCmdPipelineBarrier;
+    }
+    if (!strcmp(name, "vkCmdBeginQuery")) {
+        return (void*)entry_vkCmdBeginQuery;
+    }
+    if (!strcmp(name, "vkCmdEndQuery")) {
+        return (void*)entry_vkCmdEndQuery;
+    }
+    if (!strcmp(name, "vkCmdResetQueryPool")) {
+        return (void*)entry_vkCmdResetQueryPool;
+    }
+    if (!strcmp(name, "vkCmdWriteTimestamp")) {
+        return (void*)entry_vkCmdWriteTimestamp;
+    }
+    if (!strcmp(name, "vkCmdCopyQueryPoolResults")) {
+        return (void*)entry_vkCmdCopyQueryPoolResults;
+    }
+    if (!strcmp(name, "vkCmdPushConstants")) {
+        return (void*)entry_vkCmdPushConstants;
+    }
+    if (!strcmp(name, "vkCmdBeginRenderPass")) {
+        return (void*)entry_vkCmdBeginRenderPass;
+    }
+    if (!strcmp(name, "vkCmdNextSubpass")) {
+        return (void*)entry_vkCmdNextSubpass;
+    }
+    if (!strcmp(name, "vkCmdEndRenderPass")) {
+        return (void*)entry_vkCmdEndRenderPass;
+    }
+    if (!strcmp(name, "vkCmdExecuteCommands")) {
+        return (void*)entry_vkCmdExecuteCommands;
+    }
+#endif
+#ifdef VK_VERSION_1_1
+    if (!strcmp(name, "vkEnumerateInstanceVersion")) {
+        return has1_1OrHigher ? (void*)entry_vkEnumerateInstanceVersion : nullptr;
+    }
+    if (!strcmp(name, "vkBindBufferMemory2")) {
+        return (void*)dynCheck_entry_vkBindBufferMemory2;
+    }
+    if (!strcmp(name, "vkBindImageMemory2")) {
+        return (void*)dynCheck_entry_vkBindImageMemory2;
+    }
+    if (!strcmp(name, "vkGetDeviceGroupPeerMemoryFeatures")) {
+        return (void*)dynCheck_entry_vkGetDeviceGroupPeerMemoryFeatures;
+    }
+    if (!strcmp(name, "vkCmdSetDeviceMask")) {
+        return has1_1OrHigher ? (void*)entry_vkCmdSetDeviceMask : nullptr;
+    }
+    if (!strcmp(name, "vkCmdDispatchBase")) {
+        return has1_1OrHigher ? (void*)entry_vkCmdDispatchBase : nullptr;
+    }
+    if (!strcmp(name, "vkEnumeratePhysicalDeviceGroups")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetImageMemoryRequirements2")) {
+        return (void*)dynCheck_entry_vkGetImageMemoryRequirements2;
+    }
+    if (!strcmp(name, "vkGetBufferMemoryRequirements2")) {
+        return (void*)dynCheck_entry_vkGetBufferMemoryRequirements2;
+    }
+    if (!strcmp(name, "vkGetImageSparseMemoryRequirements2")) {
+        return (void*)dynCheck_entry_vkGetImageSparseMemoryRequirements2;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceFeatures2")) {
+        return has1_1OrHigher ? (void*)entry_vkGetPhysicalDeviceFeatures2 : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceProperties2")) {
+        return has1_1OrHigher ? (void*)entry_vkGetPhysicalDeviceProperties2 : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceFormatProperties2")) {
+        return has1_1OrHigher ? (void*)entry_vkGetPhysicalDeviceFormatProperties2 : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceImageFormatProperties2")) {
+        return has1_1OrHigher ? (void*)entry_vkGetPhysicalDeviceImageFormatProperties2 : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceQueueFamilyProperties2")) {
+        return has1_1OrHigher ? (void*)entry_vkGetPhysicalDeviceQueueFamilyProperties2 : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceMemoryProperties2")) {
+        return has1_1OrHigher ? (void*)entry_vkGetPhysicalDeviceMemoryProperties2 : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceSparseImageFormatProperties2")) {
+        return has1_1OrHigher ? (void*)entry_vkGetPhysicalDeviceSparseImageFormatProperties2
+                              : nullptr;
+    }
+    if (!strcmp(name, "vkTrimCommandPool")) {
+        return (void*)dynCheck_entry_vkTrimCommandPool;
+    }
+    if (!strcmp(name, "vkGetDeviceQueue2")) {
+        return (void*)dynCheck_entry_vkGetDeviceQueue2;
+    }
+    if (!strcmp(name, "vkCreateSamplerYcbcrConversion")) {
+        return (void*)dynCheck_entry_vkCreateSamplerYcbcrConversion;
+    }
+    if (!strcmp(name, "vkDestroySamplerYcbcrConversion")) {
+        return (void*)dynCheck_entry_vkDestroySamplerYcbcrConversion;
+    }
+    if (!strcmp(name, "vkCreateDescriptorUpdateTemplate")) {
+        return (void*)dynCheck_entry_vkCreateDescriptorUpdateTemplate;
+    }
+    if (!strcmp(name, "vkDestroyDescriptorUpdateTemplate")) {
+        return (void*)dynCheck_entry_vkDestroyDescriptorUpdateTemplate;
+    }
+    if (!strcmp(name, "vkUpdateDescriptorSetWithTemplate")) {
+        return (void*)dynCheck_entry_vkUpdateDescriptorSetWithTemplate;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceExternalBufferProperties")) {
+        return has1_1OrHigher ? (void*)entry_vkGetPhysicalDeviceExternalBufferProperties : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceExternalFenceProperties")) {
+        return has1_1OrHigher ? (void*)entry_vkGetPhysicalDeviceExternalFenceProperties : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceExternalSemaphoreProperties")) {
+        return has1_1OrHigher ? (void*)entry_vkGetPhysicalDeviceExternalSemaphoreProperties
+                              : nullptr;
+    }
+    if (!strcmp(name, "vkGetDescriptorSetLayoutSupport")) {
+        return (void*)dynCheck_entry_vkGetDescriptorSetLayoutSupport;
+    }
+#endif
+#ifdef VK_VERSION_1_2
+    if (!strcmp(name, "vkCmdDrawIndirectCount")) {
+        return has1_2OrHigher ? (void*)entry_vkCmdDrawIndirectCount : nullptr;
+    }
+    if (!strcmp(name, "vkCmdDrawIndexedIndirectCount")) {
+        return has1_2OrHigher ? (void*)entry_vkCmdDrawIndexedIndirectCount : nullptr;
+    }
+    if (!strcmp(name, "vkCreateRenderPass2")) {
+        return (void*)dynCheck_entry_vkCreateRenderPass2;
+    }
+    if (!strcmp(name, "vkCmdBeginRenderPass2")) {
+        return has1_2OrHigher ? (void*)entry_vkCmdBeginRenderPass2 : nullptr;
+    }
+    if (!strcmp(name, "vkCmdNextSubpass2")) {
+        return has1_2OrHigher ? (void*)entry_vkCmdNextSubpass2 : nullptr;
+    }
+    if (!strcmp(name, "vkCmdEndRenderPass2")) {
+        return has1_2OrHigher ? (void*)entry_vkCmdEndRenderPass2 : nullptr;
+    }
+    if (!strcmp(name, "vkResetQueryPool")) {
+        return (void*)dynCheck_entry_vkResetQueryPool;
+    }
+    if (!strcmp(name, "vkGetSemaphoreCounterValue")) {
+        return (void*)dynCheck_entry_vkGetSemaphoreCounterValue;
+    }
+    if (!strcmp(name, "vkWaitSemaphores")) {
+        return (void*)dynCheck_entry_vkWaitSemaphores;
+    }
+    if (!strcmp(name, "vkSignalSemaphore")) {
+        return (void*)dynCheck_entry_vkSignalSemaphore;
+    }
+    if (!strcmp(name, "vkGetBufferDeviceAddress")) {
+        return (void*)dynCheck_entry_vkGetBufferDeviceAddress;
+    }
+    if (!strcmp(name, "vkGetBufferOpaqueCaptureAddress")) {
+        return (void*)dynCheck_entry_vkGetBufferOpaqueCaptureAddress;
+    }
+    if (!strcmp(name, "vkGetDeviceMemoryOpaqueCaptureAddress")) {
+        return (void*)dynCheck_entry_vkGetDeviceMemoryOpaqueCaptureAddress;
+    }
+#endif
+#ifdef VK_KHR_surface
+    if (!strcmp(name, "vkDestroySurfaceKHR")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_KHR_surface");
+        return hasExt ? (void*)entry_vkDestroySurfaceKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceSurfaceSupportKHR")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_KHR_surface");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceSurfaceSupportKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_KHR_surface");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceSurfaceCapabilitiesKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceSurfaceFormatsKHR")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_KHR_surface");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceSurfaceFormatsKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceSurfacePresentModesKHR")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_KHR_surface");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceSurfacePresentModesKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_swapchain
+    if (!strcmp(name, "vkCreateSwapchainKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCreateSwapchainKHR;
+    }
+    if (!strcmp(name, "vkDestroySwapchainKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkDestroySwapchainKHR;
+    }
+    if (!strcmp(name, "vkGetSwapchainImagesKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetSwapchainImagesKHR;
+    }
+    if (!strcmp(name, "vkAcquireNextImageKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkAcquireNextImageKHR;
+    }
+    if (!strcmp(name, "vkQueuePresentKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)entry_vkQueuePresentKHR;
+    }
+    if (!strcmp(name, "vkGetDeviceGroupPresentCapabilitiesKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetDeviceGroupPresentCapabilitiesKHR;
+    }
+    if (!strcmp(name, "vkGetDeviceGroupSurfacePresentModesKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetDeviceGroupSurfacePresentModesKHR;
+    }
+    if (!strcmp(name, "vkGetPhysicalDevicePresentRectanglesKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)entry_vkGetPhysicalDevicePresentRectanglesKHR;
+    }
+    if (!strcmp(name, "vkAcquireNextImage2KHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkAcquireNextImage2KHR;
+    }
+#endif
+#ifdef VK_KHR_display
+    if (!strcmp(name, "vkGetPhysicalDeviceDisplayPropertiesKHR")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_KHR_display");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceDisplayPropertiesKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceDisplayPlanePropertiesKHR")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_KHR_display");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceDisplayPlanePropertiesKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetDisplayPlaneSupportedDisplaysKHR")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_KHR_display");
+        return hasExt ? (void*)entry_vkGetDisplayPlaneSupportedDisplaysKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetDisplayModePropertiesKHR")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_KHR_display");
+        return hasExt ? (void*)entry_vkGetDisplayModePropertiesKHR : nullptr;
+    }
+    if (!strcmp(name, "vkCreateDisplayModeKHR")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_KHR_display");
+        return hasExt ? (void*)entry_vkCreateDisplayModeKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetDisplayPlaneCapabilitiesKHR")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_KHR_display");
+        return hasExt ? (void*)entry_vkGetDisplayPlaneCapabilitiesKHR : nullptr;
+    }
+    if (!strcmp(name, "vkCreateDisplayPlaneSurfaceKHR")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_KHR_display");
+        return hasExt ? (void*)entry_vkCreateDisplayPlaneSurfaceKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_display_swapchain
+    if (!strcmp(name, "vkCreateSharedSwapchainsKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCreateSharedSwapchainsKHR;
+    }
+#endif
+#ifdef VK_KHR_xlib_surface
+    if (!strcmp(name, "vkCreateXlibSurfaceKHR")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_KHR_xlib_surface");
+        return hasExt ? (void*)entry_vkCreateXlibSurfaceKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceXlibPresentationSupportKHR")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_KHR_xlib_surface");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceXlibPresentationSupportKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_xcb_surface
+    if (!strcmp(name, "vkCreateXcbSurfaceKHR")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_KHR_xcb_surface");
+        return hasExt ? (void*)entry_vkCreateXcbSurfaceKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceXcbPresentationSupportKHR")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_KHR_xcb_surface");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceXcbPresentationSupportKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_wayland_surface
+    if (!strcmp(name, "vkCreateWaylandSurfaceKHR")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_KHR_wayland_surface");
+        return hasExt ? (void*)entry_vkCreateWaylandSurfaceKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceWaylandPresentationSupportKHR")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_KHR_wayland_surface");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceWaylandPresentationSupportKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_android_surface
+    if (!strcmp(name, "vkCreateAndroidSurfaceKHR")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_KHR_android_surface");
+        return hasExt ? (void*)entry_vkCreateAndroidSurfaceKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_win32_surface
+    if (!strcmp(name, "vkCreateWin32SurfaceKHR")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_KHR_win32_surface");
+        return hasExt ? (void*)entry_vkCreateWin32SurfaceKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceWin32PresentationSupportKHR")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_KHR_win32_surface");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceWin32PresentationSupportKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_video_queue
+    if (!strcmp(name, "vkGetPhysicalDeviceVideoCapabilitiesKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)entry_vkGetPhysicalDeviceVideoCapabilitiesKHR;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceVideoFormatPropertiesKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)entry_vkGetPhysicalDeviceVideoFormatPropertiesKHR;
+    }
+    if (!strcmp(name, "vkCreateVideoSessionKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCreateVideoSessionKHR;
+    }
+    if (!strcmp(name, "vkDestroyVideoSessionKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkDestroyVideoSessionKHR;
+    }
+    if (!strcmp(name, "vkGetVideoSessionMemoryRequirementsKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetVideoSessionMemoryRequirementsKHR;
+    }
+    if (!strcmp(name, "vkBindVideoSessionMemoryKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkBindVideoSessionMemoryKHR;
+    }
+    if (!strcmp(name, "vkCreateVideoSessionParametersKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCreateVideoSessionParametersKHR;
+    }
+    if (!strcmp(name, "vkUpdateVideoSessionParametersKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkUpdateVideoSessionParametersKHR;
+    }
+    if (!strcmp(name, "vkDestroyVideoSessionParametersKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkDestroyVideoSessionParametersKHR;
+    }
+    if (!strcmp(name, "vkCmdBeginVideoCodingKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdBeginVideoCodingKHR;
+    }
+    if (!strcmp(name, "vkCmdEndVideoCodingKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdEndVideoCodingKHR;
+    }
+    if (!strcmp(name, "vkCmdControlVideoCodingKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdControlVideoCodingKHR;
+    }
+#endif
+#ifdef VK_KHR_video_decode_queue
+    if (!strcmp(name, "vkCmdDecodeVideoKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdDecodeVideoKHR;
+    }
+#endif
+#ifdef VK_KHR_dynamic_rendering
+    if (!strcmp(name, "vkCmdBeginRenderingKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdBeginRenderingKHR;
+    }
+    if (!strcmp(name, "vkCmdEndRenderingKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdEndRenderingKHR;
+    }
+#endif
+#ifdef VK_KHR_get_physical_device_properties2
+    if (!strcmp(name, "vkGetPhysicalDeviceFeatures2KHR")) {
+        bool hasExt =
+            resources->hasInstanceExtension(instance, "VK_KHR_get_physical_device_properties2");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceFeatures2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceProperties2KHR")) {
+        bool hasExt =
+            resources->hasInstanceExtension(instance, "VK_KHR_get_physical_device_properties2");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceProperties2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceFormatProperties2KHR")) {
+        bool hasExt =
+            resources->hasInstanceExtension(instance, "VK_KHR_get_physical_device_properties2");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceFormatProperties2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceImageFormatProperties2KHR")) {
+        bool hasExt =
+            resources->hasInstanceExtension(instance, "VK_KHR_get_physical_device_properties2");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceImageFormatProperties2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceQueueFamilyProperties2KHR")) {
+        bool hasExt =
+            resources->hasInstanceExtension(instance, "VK_KHR_get_physical_device_properties2");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceQueueFamilyProperties2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceMemoryProperties2KHR")) {
+        bool hasExt =
+            resources->hasInstanceExtension(instance, "VK_KHR_get_physical_device_properties2");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceMemoryProperties2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceSparseImageFormatProperties2KHR")) {
+        bool hasExt =
+            resources->hasInstanceExtension(instance, "VK_KHR_get_physical_device_properties2");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceSparseImageFormatProperties2KHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_device_group
+    if (!strcmp(name, "vkGetDeviceGroupPeerMemoryFeaturesKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetDeviceGroupPeerMemoryFeaturesKHR;
+    }
+    if (!strcmp(name, "vkCmdSetDeviceMaskKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetDeviceMaskKHR;
+    }
+    if (!strcmp(name, "vkCmdDispatchBaseKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdDispatchBaseKHR;
+    }
+#endif
+#ifdef VK_KHR_maintenance1
+    if (!strcmp(name, "vkTrimCommandPoolKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkTrimCommandPoolKHR;
+    }
+#endif
+#ifdef VK_KHR_device_group_creation
+    if (!strcmp(name, "vkEnumeratePhysicalDeviceGroupsKHR")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_KHR_device_group_creation");
+        return hasExt ? (void*)entry_vkEnumeratePhysicalDeviceGroupsKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_external_memory_capabilities
+    if (!strcmp(name, "vkGetPhysicalDeviceExternalBufferPropertiesKHR")) {
+        bool hasExt =
+            resources->hasInstanceExtension(instance, "VK_KHR_external_memory_capabilities");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceExternalBufferPropertiesKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_external_memory_win32
+    if (!strcmp(name, "vkGetMemoryWin32HandleKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetMemoryWin32HandleKHR;
+    }
+    if (!strcmp(name, "vkGetMemoryWin32HandlePropertiesKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetMemoryWin32HandlePropertiesKHR;
+    }
+#endif
+#ifdef VK_KHR_external_memory_fd
+    if (!strcmp(name, "vkGetMemoryFdKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetMemoryFdKHR;
+    }
+    if (!strcmp(name, "vkGetMemoryFdPropertiesKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetMemoryFdPropertiesKHR;
+    }
+#endif
+#ifdef VK_KHR_external_semaphore_capabilities
+    if (!strcmp(name, "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR")) {
+        bool hasExt =
+            resources->hasInstanceExtension(instance, "VK_KHR_external_semaphore_capabilities");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+    if (!strcmp(name, "vkImportSemaphoreWin32HandleKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkImportSemaphoreWin32HandleKHR;
+    }
+    if (!strcmp(name, "vkGetSemaphoreWin32HandleKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetSemaphoreWin32HandleKHR;
+    }
+#endif
+#ifdef VK_KHR_external_semaphore_fd
+    if (!strcmp(name, "vkImportSemaphoreFdKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkImportSemaphoreFdKHR;
+    }
+    if (!strcmp(name, "vkGetSemaphoreFdKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetSemaphoreFdKHR;
+    }
+#endif
+#ifdef VK_KHR_push_descriptor
+    if (!strcmp(name, "vkCmdPushDescriptorSetKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdPushDescriptorSetKHR;
+    }
+    if (!strcmp(name, "vkCmdPushDescriptorSetWithTemplateKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdPushDescriptorSetWithTemplateKHR;
+    }
+#endif
+#ifdef VK_KHR_descriptor_update_template
+    if (!strcmp(name, "vkCreateDescriptorUpdateTemplateKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCreateDescriptorUpdateTemplateKHR;
+    }
+    if (!strcmp(name, "vkDestroyDescriptorUpdateTemplateKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkDestroyDescriptorUpdateTemplateKHR;
+    }
+    if (!strcmp(name, "vkUpdateDescriptorSetWithTemplateKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkUpdateDescriptorSetWithTemplateKHR;
+    }
+#endif
+#ifdef VK_KHR_create_renderpass2
+    if (!strcmp(name, "vkCreateRenderPass2KHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCreateRenderPass2KHR;
+    }
+    if (!strcmp(name, "vkCmdBeginRenderPass2KHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdBeginRenderPass2KHR;
+    }
+    if (!strcmp(name, "vkCmdNextSubpass2KHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdNextSubpass2KHR;
+    }
+    if (!strcmp(name, "vkCmdEndRenderPass2KHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdEndRenderPass2KHR;
+    }
+#endif
+#ifdef VK_KHR_shared_presentable_image
+    if (!strcmp(name, "vkGetSwapchainStatusKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetSwapchainStatusKHR;
+    }
+#endif
+#ifdef VK_KHR_external_fence_capabilities
+    if (!strcmp(name, "vkGetPhysicalDeviceExternalFencePropertiesKHR")) {
+        bool hasExt =
+            resources->hasInstanceExtension(instance, "VK_KHR_external_fence_capabilities");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceExternalFencePropertiesKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_external_fence_win32
+    if (!strcmp(name, "vkImportFenceWin32HandleKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkImportFenceWin32HandleKHR;
+    }
+    if (!strcmp(name, "vkGetFenceWin32HandleKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetFenceWin32HandleKHR;
+    }
+#endif
+#ifdef VK_KHR_external_fence_fd
+    if (!strcmp(name, "vkImportFenceFdKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkImportFenceFdKHR;
+    }
+    if (!strcmp(name, "vkGetFenceFdKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetFenceFdKHR;
+    }
+#endif
+#ifdef VK_KHR_performance_query
+    if (!strcmp(name, "vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)entry_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)entry_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR;
+    }
+    if (!strcmp(name, "vkAcquireProfilingLockKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkAcquireProfilingLockKHR;
+    }
+    if (!strcmp(name, "vkReleaseProfilingLockKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkReleaseProfilingLockKHR;
+    }
+#endif
+#ifdef VK_KHR_get_surface_capabilities2
+    if (!strcmp(name, "vkGetPhysicalDeviceSurfaceCapabilities2KHR")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_KHR_get_surface_capabilities2");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceSurfaceCapabilities2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceSurfaceFormats2KHR")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_KHR_get_surface_capabilities2");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceSurfaceFormats2KHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_get_display_properties2
+    if (!strcmp(name, "vkGetPhysicalDeviceDisplayProperties2KHR")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_KHR_get_display_properties2");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceDisplayProperties2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceDisplayPlaneProperties2KHR")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_KHR_get_display_properties2");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceDisplayPlaneProperties2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetDisplayModeProperties2KHR")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_KHR_get_display_properties2");
+        return hasExt ? (void*)entry_vkGetDisplayModeProperties2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetDisplayPlaneCapabilities2KHR")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_KHR_get_display_properties2");
+        return hasExt ? (void*)entry_vkGetDisplayPlaneCapabilities2KHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_get_memory_requirements2
+    if (!strcmp(name, "vkGetImageMemoryRequirements2KHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetImageMemoryRequirements2KHR;
+    }
+    if (!strcmp(name, "vkGetBufferMemoryRequirements2KHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetBufferMemoryRequirements2KHR;
+    }
+    if (!strcmp(name, "vkGetImageSparseMemoryRequirements2KHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetImageSparseMemoryRequirements2KHR;
+    }
+#endif
+#ifdef VK_KHR_sampler_ycbcr_conversion
+    if (!strcmp(name, "vkCreateSamplerYcbcrConversionKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCreateSamplerYcbcrConversionKHR;
+    }
+    if (!strcmp(name, "vkDestroySamplerYcbcrConversionKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkDestroySamplerYcbcrConversionKHR;
+    }
+#endif
+#ifdef VK_KHR_bind_memory2
+    if (!strcmp(name, "vkBindBufferMemory2KHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkBindBufferMemory2KHR;
+    }
+    if (!strcmp(name, "vkBindImageMemory2KHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkBindImageMemory2KHR;
+    }
+#endif
+#ifdef VK_KHR_maintenance3
+    if (!strcmp(name, "vkGetDescriptorSetLayoutSupportKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetDescriptorSetLayoutSupportKHR;
+    }
+#endif
+#ifdef VK_KHR_draw_indirect_count
+    if (!strcmp(name, "vkCmdDrawIndirectCountKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdDrawIndirectCountKHR;
+    }
+    if (!strcmp(name, "vkCmdDrawIndexedIndirectCountKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdDrawIndexedIndirectCountKHR;
+    }
+#endif
+#ifdef VK_KHR_timeline_semaphore
+    if (!strcmp(name, "vkGetSemaphoreCounterValueKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetSemaphoreCounterValueKHR;
+    }
+    if (!strcmp(name, "vkWaitSemaphoresKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkWaitSemaphoresKHR;
+    }
+    if (!strcmp(name, "vkSignalSemaphoreKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkSignalSemaphoreKHR;
+    }
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+    if (!strcmp(name, "vkGetPhysicalDeviceFragmentShadingRatesKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)entry_vkGetPhysicalDeviceFragmentShadingRatesKHR;
+    }
+    if (!strcmp(name, "vkCmdSetFragmentShadingRateKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetFragmentShadingRateKHR;
+    }
+#endif
+#ifdef VK_KHR_present_wait
+    if (!strcmp(name, "vkWaitForPresentKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkWaitForPresentKHR;
+    }
+#endif
+#ifdef VK_KHR_buffer_device_address
+    if (!strcmp(name, "vkGetBufferDeviceAddressKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetBufferDeviceAddressKHR;
+    }
+    if (!strcmp(name, "vkGetBufferOpaqueCaptureAddressKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetBufferOpaqueCaptureAddressKHR;
+    }
+    if (!strcmp(name, "vkGetDeviceMemoryOpaqueCaptureAddressKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetDeviceMemoryOpaqueCaptureAddressKHR;
+    }
+#endif
+#ifdef VK_KHR_deferred_host_operations
+    if (!strcmp(name, "vkCreateDeferredOperationKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCreateDeferredOperationKHR;
+    }
+    if (!strcmp(name, "vkDestroyDeferredOperationKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkDestroyDeferredOperationKHR;
+    }
+    if (!strcmp(name, "vkGetDeferredOperationMaxConcurrencyKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetDeferredOperationMaxConcurrencyKHR;
+    }
+    if (!strcmp(name, "vkGetDeferredOperationResultKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetDeferredOperationResultKHR;
+    }
+    if (!strcmp(name, "vkDeferredOperationJoinKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkDeferredOperationJoinKHR;
+    }
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+    if (!strcmp(name, "vkGetPipelineExecutablePropertiesKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetPipelineExecutablePropertiesKHR;
+    }
+    if (!strcmp(name, "vkGetPipelineExecutableStatisticsKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetPipelineExecutableStatisticsKHR;
+    }
+    if (!strcmp(name, "vkGetPipelineExecutableInternalRepresentationsKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetPipelineExecutableInternalRepresentationsKHR;
+    }
+#endif
+#ifdef VK_KHR_video_encode_queue
+    if (!strcmp(name, "vkCmdEncodeVideoKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdEncodeVideoKHR;
+    }
+#endif
+#ifdef VK_KHR_synchronization2
+    if (!strcmp(name, "vkCmdSetEvent2KHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetEvent2KHR;
+    }
+    if (!strcmp(name, "vkCmdResetEvent2KHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdResetEvent2KHR;
+    }
+    if (!strcmp(name, "vkCmdWaitEvents2KHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdWaitEvents2KHR;
+    }
+    if (!strcmp(name, "vkCmdPipelineBarrier2KHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdPipelineBarrier2KHR;
+    }
+    if (!strcmp(name, "vkCmdWriteTimestamp2KHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdWriteTimestamp2KHR;
+    }
+    if (!strcmp(name, "vkQueueSubmit2KHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)entry_vkQueueSubmit2KHR;
+    }
+    if (!strcmp(name, "vkCmdWriteBufferMarker2AMD")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdWriteBufferMarker2AMD;
+    }
+    if (!strcmp(name, "vkGetQueueCheckpointData2NV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)entry_vkGetQueueCheckpointData2NV;
+    }
+#endif
+#ifdef VK_KHR_copy_commands2
+    if (!strcmp(name, "vkCmdCopyBuffer2KHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdCopyBuffer2KHR;
+    }
+    if (!strcmp(name, "vkCmdCopyImage2KHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdCopyImage2KHR;
+    }
+    if (!strcmp(name, "vkCmdCopyBufferToImage2KHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdCopyBufferToImage2KHR;
+    }
+    if (!strcmp(name, "vkCmdCopyImageToBuffer2KHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdCopyImageToBuffer2KHR;
+    }
+    if (!strcmp(name, "vkCmdBlitImage2KHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdBlitImage2KHR;
+    }
+    if (!strcmp(name, "vkCmdResolveImage2KHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdResolveImage2KHR;
+    }
+#endif
+#ifdef VK_KHR_maintenance4
+    if (!strcmp(name, "vkGetDeviceBufferMemoryRequirementsKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetDeviceBufferMemoryRequirementsKHR;
+    }
+    if (!strcmp(name, "vkGetDeviceImageMemoryRequirementsKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetDeviceImageMemoryRequirementsKHR;
+    }
+    if (!strcmp(name, "vkGetDeviceImageSparseMemoryRequirementsKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetDeviceImageSparseMemoryRequirementsKHR;
+    }
+#endif
+#ifdef VK_ANDROID_native_buffer
+    if (!strcmp(name, "vkGetSwapchainGrallocUsageANDROID")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetSwapchainGrallocUsageANDROID;
+    }
+    if (!strcmp(name, "vkAcquireImageANDROID")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkAcquireImageANDROID;
+    }
+    if (!strcmp(name, "vkQueueSignalReleaseImageANDROID")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)entry_vkQueueSignalReleaseImageANDROID;
+    }
+#endif
+#ifdef VK_EXT_debug_report
+    if (!strcmp(name, "vkCreateDebugReportCallbackEXT")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_EXT_debug_report");
+        return hasExt ? (void*)entry_vkCreateDebugReportCallbackEXT : nullptr;
+    }
+    if (!strcmp(name, "vkDestroyDebugReportCallbackEXT")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_EXT_debug_report");
+        return hasExt ? (void*)entry_vkDestroyDebugReportCallbackEXT : nullptr;
+    }
+    if (!strcmp(name, "vkDebugReportMessageEXT")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_EXT_debug_report");
+        return hasExt ? (void*)entry_vkDebugReportMessageEXT : nullptr;
+    }
+#endif
+#ifdef VK_EXT_debug_marker
+    if (!strcmp(name, "vkDebugMarkerSetObjectTagEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkDebugMarkerSetObjectTagEXT;
+    }
+    if (!strcmp(name, "vkDebugMarkerSetObjectNameEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkDebugMarkerSetObjectNameEXT;
+    }
+    if (!strcmp(name, "vkCmdDebugMarkerBeginEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdDebugMarkerBeginEXT;
+    }
+    if (!strcmp(name, "vkCmdDebugMarkerEndEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdDebugMarkerEndEXT;
+    }
+    if (!strcmp(name, "vkCmdDebugMarkerInsertEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdDebugMarkerInsertEXT;
+    }
+#endif
+#ifdef VK_EXT_transform_feedback
+    if (!strcmp(name, "vkCmdBindTransformFeedbackBuffersEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdBindTransformFeedbackBuffersEXT;
+    }
+    if (!strcmp(name, "vkCmdBeginTransformFeedbackEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdBeginTransformFeedbackEXT;
+    }
+    if (!strcmp(name, "vkCmdEndTransformFeedbackEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdEndTransformFeedbackEXT;
+    }
+    if (!strcmp(name, "vkCmdBeginQueryIndexedEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdBeginQueryIndexedEXT;
+    }
+    if (!strcmp(name, "vkCmdEndQueryIndexedEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdEndQueryIndexedEXT;
+    }
+    if (!strcmp(name, "vkCmdDrawIndirectByteCountEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdDrawIndirectByteCountEXT;
+    }
+#endif
+#ifdef VK_NVX_binary_import
+    if (!strcmp(name, "vkCreateCuModuleNVX")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCreateCuModuleNVX;
+    }
+    if (!strcmp(name, "vkCreateCuFunctionNVX")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCreateCuFunctionNVX;
+    }
+    if (!strcmp(name, "vkDestroyCuModuleNVX")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkDestroyCuModuleNVX;
+    }
+    if (!strcmp(name, "vkDestroyCuFunctionNVX")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkDestroyCuFunctionNVX;
+    }
+    if (!strcmp(name, "vkCmdCuLaunchKernelNVX")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdCuLaunchKernelNVX;
+    }
+#endif
+#ifdef VK_NVX_image_view_handle
+    if (!strcmp(name, "vkGetImageViewHandleNVX")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetImageViewHandleNVX;
+    }
+    if (!strcmp(name, "vkGetImageViewAddressNVX")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetImageViewAddressNVX;
+    }
+#endif
+#ifdef VK_AMD_draw_indirect_count
+    if (!strcmp(name, "vkCmdDrawIndirectCountAMD")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdDrawIndirectCountAMD;
+    }
+    if (!strcmp(name, "vkCmdDrawIndexedIndirectCountAMD")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdDrawIndexedIndirectCountAMD;
+    }
+#endif
+#ifdef VK_AMD_shader_info
+    if (!strcmp(name, "vkGetShaderInfoAMD")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetShaderInfoAMD;
+    }
+#endif
+#ifdef VK_GGP_stream_descriptor_surface
+    if (!strcmp(name, "vkCreateStreamDescriptorSurfaceGGP")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_GGP_stream_descriptor_surface");
+        return hasExt ? (void*)entry_vkCreateStreamDescriptorSurfaceGGP : nullptr;
+    }
+#endif
+#ifdef VK_NV_external_memory_capabilities
+    if (!strcmp(name, "vkGetPhysicalDeviceExternalImageFormatPropertiesNV")) {
+        bool hasExt =
+            resources->hasInstanceExtension(instance, "VK_NV_external_memory_capabilities");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceExternalImageFormatPropertiesNV : nullptr;
+    }
+#endif
+#ifdef VK_NV_external_memory_win32
+    if (!strcmp(name, "vkGetMemoryWin32HandleNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetMemoryWin32HandleNV;
+    }
+#endif
+#ifdef VK_NN_vi_surface
+    if (!strcmp(name, "vkCreateViSurfaceNN")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_NN_vi_surface");
+        return hasExt ? (void*)entry_vkCreateViSurfaceNN : nullptr;
+    }
+#endif
+#ifdef VK_EXT_conditional_rendering
+    if (!strcmp(name, "vkCmdBeginConditionalRenderingEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdBeginConditionalRenderingEXT;
+    }
+    if (!strcmp(name, "vkCmdEndConditionalRenderingEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdEndConditionalRenderingEXT;
+    }
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+    if (!strcmp(name, "vkCmdSetViewportWScalingNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetViewportWScalingNV;
+    }
+#endif
+#ifdef VK_EXT_direct_mode_display
+    if (!strcmp(name, "vkReleaseDisplayEXT")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_EXT_direct_mode_display");
+        return hasExt ? (void*)entry_vkReleaseDisplayEXT : nullptr;
+    }
+#endif
+#ifdef VK_EXT_acquire_xlib_display
+    if (!strcmp(name, "vkAcquireXlibDisplayEXT")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_EXT_acquire_xlib_display");
+        return hasExt ? (void*)entry_vkAcquireXlibDisplayEXT : nullptr;
+    }
+    if (!strcmp(name, "vkGetRandROutputDisplayEXT")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_EXT_acquire_xlib_display");
+        return hasExt ? (void*)entry_vkGetRandROutputDisplayEXT : nullptr;
+    }
+#endif
+#ifdef VK_EXT_display_surface_counter
+    if (!strcmp(name, "vkGetPhysicalDeviceSurfaceCapabilities2EXT")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_EXT_display_surface_counter");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceSurfaceCapabilities2EXT : nullptr;
+    }
+#endif
+#ifdef VK_EXT_display_control
+    if (!strcmp(name, "vkDisplayPowerControlEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkDisplayPowerControlEXT;
+    }
+    if (!strcmp(name, "vkRegisterDeviceEventEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkRegisterDeviceEventEXT;
+    }
+    if (!strcmp(name, "vkRegisterDisplayEventEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkRegisterDisplayEventEXT;
+    }
+    if (!strcmp(name, "vkGetSwapchainCounterEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetSwapchainCounterEXT;
+    }
+#endif
+#ifdef VK_GOOGLE_display_timing
+    if (!strcmp(name, "vkGetRefreshCycleDurationGOOGLE")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetRefreshCycleDurationGOOGLE;
+    }
+    if (!strcmp(name, "vkGetPastPresentationTimingGOOGLE")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetPastPresentationTimingGOOGLE;
+    }
+#endif
+#ifdef VK_EXT_discard_rectangles
+    if (!strcmp(name, "vkCmdSetDiscardRectangleEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetDiscardRectangleEXT;
+    }
+#endif
+#ifdef VK_EXT_hdr_metadata
+    if (!strcmp(name, "vkSetHdrMetadataEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkSetHdrMetadataEXT;
+    }
+#endif
+#ifdef VK_MVK_ios_surface
+    if (!strcmp(name, "vkCreateIOSSurfaceMVK")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_MVK_ios_surface");
+        return hasExt ? (void*)entry_vkCreateIOSSurfaceMVK : nullptr;
+    }
+#endif
+#ifdef VK_MVK_macos_surface
+    if (!strcmp(name, "vkCreateMacOSSurfaceMVK")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_MVK_macos_surface");
+        return hasExt ? (void*)entry_vkCreateMacOSSurfaceMVK : nullptr;
+    }
+#endif
+#ifdef VK_MVK_moltenvk
+    if (!strcmp(name, "vkGetMTLDeviceMVK")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_MVK_moltenvk");
+        return hasExt ? (void*)entry_vkGetMTLDeviceMVK : nullptr;
+    }
+    if (!strcmp(name, "vkSetMTLTextureMVK")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_MVK_moltenvk");
+        return hasExt ? (void*)entry_vkSetMTLTextureMVK : nullptr;
+    }
+    if (!strcmp(name, "vkGetMTLTextureMVK")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_MVK_moltenvk");
+        return hasExt ? (void*)entry_vkGetMTLTextureMVK : nullptr;
+    }
+    if (!strcmp(name, "vkGetMTLBufferMVK")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_MVK_moltenvk");
+        return hasExt ? (void*)entry_vkGetMTLBufferMVK : nullptr;
+    }
+    if (!strcmp(name, "vkUseIOSurfaceMVK")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_MVK_moltenvk");
+        return hasExt ? (void*)entry_vkUseIOSurfaceMVK : nullptr;
+    }
+    if (!strcmp(name, "vkGetIOSurfaceMVK")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_MVK_moltenvk");
+        return hasExt ? (void*)entry_vkGetIOSurfaceMVK : nullptr;
+    }
+#endif
+#ifdef VK_EXT_debug_utils
+    if (!strcmp(name, "vkSetDebugUtilsObjectNameEXT")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_EXT_debug_utils");
+        return hasExt ? (void*)dynCheck_entry_vkSetDebugUtilsObjectNameEXT : nullptr;
+    }
+    if (!strcmp(name, "vkSetDebugUtilsObjectTagEXT")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_EXT_debug_utils");
+        return hasExt ? (void*)dynCheck_entry_vkSetDebugUtilsObjectTagEXT : nullptr;
+    }
+    if (!strcmp(name, "vkQueueBeginDebugUtilsLabelEXT")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_EXT_debug_utils");
+        return hasExt ? (void*)entry_vkQueueBeginDebugUtilsLabelEXT : nullptr;
+    }
+    if (!strcmp(name, "vkQueueEndDebugUtilsLabelEXT")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_EXT_debug_utils");
+        return hasExt ? (void*)entry_vkQueueEndDebugUtilsLabelEXT : nullptr;
+    }
+    if (!strcmp(name, "vkQueueInsertDebugUtilsLabelEXT")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_EXT_debug_utils");
+        return hasExt ? (void*)entry_vkQueueInsertDebugUtilsLabelEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdBeginDebugUtilsLabelEXT")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_EXT_debug_utils");
+        return hasExt ? (void*)entry_vkCmdBeginDebugUtilsLabelEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdEndDebugUtilsLabelEXT")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_EXT_debug_utils");
+        return hasExt ? (void*)entry_vkCmdEndDebugUtilsLabelEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdInsertDebugUtilsLabelEXT")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_EXT_debug_utils");
+        return hasExt ? (void*)entry_vkCmdInsertDebugUtilsLabelEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCreateDebugUtilsMessengerEXT")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_EXT_debug_utils");
+        return hasExt ? (void*)entry_vkCreateDebugUtilsMessengerEXT : nullptr;
+    }
+    if (!strcmp(name, "vkDestroyDebugUtilsMessengerEXT")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_EXT_debug_utils");
+        return hasExt ? (void*)entry_vkDestroyDebugUtilsMessengerEXT : nullptr;
+    }
+    if (!strcmp(name, "vkSubmitDebugUtilsMessageEXT")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_EXT_debug_utils");
+        return hasExt ? (void*)entry_vkSubmitDebugUtilsMessageEXT : nullptr;
+    }
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+    if (!strcmp(name, "vkGetAndroidHardwareBufferPropertiesANDROID")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetAndroidHardwareBufferPropertiesANDROID;
+    }
+    if (!strcmp(name, "vkGetMemoryAndroidHardwareBufferANDROID")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetMemoryAndroidHardwareBufferANDROID;
+    }
+#endif
+#ifdef VK_EXT_sample_locations
+    if (!strcmp(name, "vkCmdSetSampleLocationsEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetSampleLocationsEXT;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceMultisamplePropertiesEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)entry_vkGetPhysicalDeviceMultisamplePropertiesEXT;
+    }
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+    if (!strcmp(name, "vkGetImageDrmFormatModifierPropertiesEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetImageDrmFormatModifierPropertiesEXT;
+    }
+#endif
+#ifdef VK_EXT_validation_cache
+    if (!strcmp(name, "vkCreateValidationCacheEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCreateValidationCacheEXT;
+    }
+    if (!strcmp(name, "vkDestroyValidationCacheEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkDestroyValidationCacheEXT;
+    }
+    if (!strcmp(name, "vkMergeValidationCachesEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkMergeValidationCachesEXT;
+    }
+    if (!strcmp(name, "vkGetValidationCacheDataEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetValidationCacheDataEXT;
+    }
+#endif
+#ifdef VK_NV_shading_rate_image
+    if (!strcmp(name, "vkCmdBindShadingRateImageNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdBindShadingRateImageNV;
+    }
+    if (!strcmp(name, "vkCmdSetViewportShadingRatePaletteNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetViewportShadingRatePaletteNV;
+    }
+    if (!strcmp(name, "vkCmdSetCoarseSampleOrderNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetCoarseSampleOrderNV;
+    }
+#endif
+#ifdef VK_NV_ray_tracing
+    if (!strcmp(name, "vkCreateAccelerationStructureNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCreateAccelerationStructureNV;
+    }
+    if (!strcmp(name, "vkDestroyAccelerationStructureNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkDestroyAccelerationStructureNV;
+    }
+    if (!strcmp(name, "vkGetAccelerationStructureMemoryRequirementsNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetAccelerationStructureMemoryRequirementsNV;
+    }
+    if (!strcmp(name, "vkBindAccelerationStructureMemoryNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkBindAccelerationStructureMemoryNV;
+    }
+    if (!strcmp(name, "vkCmdBuildAccelerationStructureNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdBuildAccelerationStructureNV;
+    }
+    if (!strcmp(name, "vkCmdCopyAccelerationStructureNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdCopyAccelerationStructureNV;
+    }
+    if (!strcmp(name, "vkCmdTraceRaysNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdTraceRaysNV;
+    }
+    if (!strcmp(name, "vkCreateRayTracingPipelinesNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCreateRayTracingPipelinesNV;
+    }
+    if (!strcmp(name, "vkGetRayTracingShaderGroupHandlesKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetRayTracingShaderGroupHandlesKHR;
+    }
+    if (!strcmp(name, "vkGetRayTracingShaderGroupHandlesNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetRayTracingShaderGroupHandlesNV;
+    }
+    if (!strcmp(name, "vkGetAccelerationStructureHandleNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetAccelerationStructureHandleNV;
+    }
+    if (!strcmp(name, "vkCmdWriteAccelerationStructuresPropertiesNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdWriteAccelerationStructuresPropertiesNV;
+    }
+    if (!strcmp(name, "vkCompileDeferredNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCompileDeferredNV;
+    }
+#endif
+#ifdef VK_EXT_external_memory_host
+    if (!strcmp(name, "vkGetMemoryHostPointerPropertiesEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetMemoryHostPointerPropertiesEXT;
+    }
+#endif
+#ifdef VK_AMD_buffer_marker
+    if (!strcmp(name, "vkCmdWriteBufferMarkerAMD")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdWriteBufferMarkerAMD;
+    }
+#endif
+#ifdef VK_EXT_calibrated_timestamps
+    if (!strcmp(name, "vkGetPhysicalDeviceCalibrateableTimeDomainsEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)entry_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT;
+    }
+    if (!strcmp(name, "vkGetCalibratedTimestampsEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetCalibratedTimestampsEXT;
+    }
+#endif
+#ifdef VK_NV_mesh_shader
+    if (!strcmp(name, "vkCmdDrawMeshTasksNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdDrawMeshTasksNV;
+    }
+    if (!strcmp(name, "vkCmdDrawMeshTasksIndirectNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdDrawMeshTasksIndirectNV;
+    }
+    if (!strcmp(name, "vkCmdDrawMeshTasksIndirectCountNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdDrawMeshTasksIndirectCountNV;
+    }
+#endif
+#ifdef VK_NV_scissor_exclusive
+    if (!strcmp(name, "vkCmdSetExclusiveScissorNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetExclusiveScissorNV;
+    }
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+    if (!strcmp(name, "vkCmdSetCheckpointNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetCheckpointNV;
+    }
+    if (!strcmp(name, "vkGetQueueCheckpointDataNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)entry_vkGetQueueCheckpointDataNV;
+    }
+#endif
+#ifdef VK_INTEL_performance_query
+    if (!strcmp(name, "vkInitializePerformanceApiINTEL")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkInitializePerformanceApiINTEL;
+    }
+    if (!strcmp(name, "vkUninitializePerformanceApiINTEL")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkUninitializePerformanceApiINTEL;
+    }
+    if (!strcmp(name, "vkCmdSetPerformanceMarkerINTEL")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetPerformanceMarkerINTEL;
+    }
+    if (!strcmp(name, "vkCmdSetPerformanceStreamMarkerINTEL")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetPerformanceStreamMarkerINTEL;
+    }
+    if (!strcmp(name, "vkCmdSetPerformanceOverrideINTEL")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetPerformanceOverrideINTEL;
+    }
+    if (!strcmp(name, "vkAcquirePerformanceConfigurationINTEL")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkAcquirePerformanceConfigurationINTEL;
+    }
+    if (!strcmp(name, "vkReleasePerformanceConfigurationINTEL")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkReleasePerformanceConfigurationINTEL;
+    }
+    if (!strcmp(name, "vkQueueSetPerformanceConfigurationINTEL")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)entry_vkQueueSetPerformanceConfigurationINTEL;
+    }
+    if (!strcmp(name, "vkGetPerformanceParameterINTEL")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetPerformanceParameterINTEL;
+    }
+#endif
+#ifdef VK_AMD_display_native_hdr
+    if (!strcmp(name, "vkSetLocalDimmingAMD")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkSetLocalDimmingAMD;
+    }
+#endif
+#ifdef VK_FUCHSIA_imagepipe_surface
+    if (!strcmp(name, "vkCreateImagePipeSurfaceFUCHSIA")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_FUCHSIA_imagepipe_surface");
+        return hasExt ? (void*)entry_vkCreateImagePipeSurfaceFUCHSIA : nullptr;
+    }
+#endif
+#ifdef VK_EXT_metal_surface
+    if (!strcmp(name, "vkCreateMetalSurfaceEXT")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_EXT_metal_surface");
+        return hasExt ? (void*)entry_vkCreateMetalSurfaceEXT : nullptr;
+    }
+#endif
+#ifdef VK_EXT_buffer_device_address
+    if (!strcmp(name, "vkGetBufferDeviceAddressEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetBufferDeviceAddressEXT;
+    }
+#endif
+#ifdef VK_EXT_tooling_info
+    if (!strcmp(name, "vkGetPhysicalDeviceToolPropertiesEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)entry_vkGetPhysicalDeviceToolPropertiesEXT;
+    }
+#endif
+#ifdef VK_NV_cooperative_matrix
+    if (!strcmp(name, "vkGetPhysicalDeviceCooperativeMatrixPropertiesNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)entry_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV;
+    }
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+    if (!strcmp(name, "vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)entry_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV;
+    }
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+    if (!strcmp(name, "vkGetPhysicalDeviceSurfacePresentModes2EXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)entry_vkGetPhysicalDeviceSurfacePresentModes2EXT;
+    }
+    if (!strcmp(name, "vkAcquireFullScreenExclusiveModeEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkAcquireFullScreenExclusiveModeEXT;
+    }
+    if (!strcmp(name, "vkReleaseFullScreenExclusiveModeEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkReleaseFullScreenExclusiveModeEXT;
+    }
+    if (!strcmp(name, "vkGetDeviceGroupSurfacePresentModes2EXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetDeviceGroupSurfacePresentModes2EXT;
+    }
+#endif
+#ifdef VK_EXT_headless_surface
+    if (!strcmp(name, "vkCreateHeadlessSurfaceEXT")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_EXT_headless_surface");
+        return hasExt ? (void*)entry_vkCreateHeadlessSurfaceEXT : nullptr;
+    }
+#endif
+#ifdef VK_EXT_line_rasterization
+    if (!strcmp(name, "vkCmdSetLineStippleEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetLineStippleEXT;
+    }
+#endif
+#ifdef VK_EXT_host_query_reset
+    if (!strcmp(name, "vkResetQueryPoolEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkResetQueryPoolEXT;
+    }
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+    if (!strcmp(name, "vkCmdSetCullModeEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetCullModeEXT;
+    }
+    if (!strcmp(name, "vkCmdSetFrontFaceEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetFrontFaceEXT;
+    }
+    if (!strcmp(name, "vkCmdSetPrimitiveTopologyEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetPrimitiveTopologyEXT;
+    }
+    if (!strcmp(name, "vkCmdSetViewportWithCountEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetViewportWithCountEXT;
+    }
+    if (!strcmp(name, "vkCmdSetScissorWithCountEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetScissorWithCountEXT;
+    }
+    if (!strcmp(name, "vkCmdBindVertexBuffers2EXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdBindVertexBuffers2EXT;
+    }
+    if (!strcmp(name, "vkCmdSetDepthTestEnableEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetDepthTestEnableEXT;
+    }
+    if (!strcmp(name, "vkCmdSetDepthWriteEnableEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetDepthWriteEnableEXT;
+    }
+    if (!strcmp(name, "vkCmdSetDepthCompareOpEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetDepthCompareOpEXT;
+    }
+    if (!strcmp(name, "vkCmdSetDepthBoundsTestEnableEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetDepthBoundsTestEnableEXT;
+    }
+    if (!strcmp(name, "vkCmdSetStencilTestEnableEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetStencilTestEnableEXT;
+    }
+    if (!strcmp(name, "vkCmdSetStencilOpEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetStencilOpEXT;
+    }
+#endif
+#ifdef VK_NV_device_generated_commands
+    if (!strcmp(name, "vkGetGeneratedCommandsMemoryRequirementsNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetGeneratedCommandsMemoryRequirementsNV;
+    }
+    if (!strcmp(name, "vkCmdPreprocessGeneratedCommandsNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdPreprocessGeneratedCommandsNV;
+    }
+    if (!strcmp(name, "vkCmdExecuteGeneratedCommandsNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdExecuteGeneratedCommandsNV;
+    }
+    if (!strcmp(name, "vkCmdBindPipelineShaderGroupNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdBindPipelineShaderGroupNV;
+    }
+    if (!strcmp(name, "vkCreateIndirectCommandsLayoutNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCreateIndirectCommandsLayoutNV;
+    }
+    if (!strcmp(name, "vkDestroyIndirectCommandsLayoutNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkDestroyIndirectCommandsLayoutNV;
+    }
+#endif
+#ifdef VK_EXT_acquire_drm_display
+    if (!strcmp(name, "vkAcquireDrmDisplayEXT")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_EXT_acquire_drm_display");
+        return hasExt ? (void*)entry_vkAcquireDrmDisplayEXT : nullptr;
+    }
+    if (!strcmp(name, "vkGetDrmDisplayEXT")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_EXT_acquire_drm_display");
+        return hasExt ? (void*)entry_vkGetDrmDisplayEXT : nullptr;
+    }
+#endif
+#ifdef VK_EXT_private_data
+    if (!strcmp(name, "vkCreatePrivateDataSlotEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCreatePrivateDataSlotEXT;
+    }
+    if (!strcmp(name, "vkDestroyPrivateDataSlotEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkDestroyPrivateDataSlotEXT;
+    }
+    if (!strcmp(name, "vkSetPrivateDataEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkSetPrivateDataEXT;
+    }
+    if (!strcmp(name, "vkGetPrivateDataEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetPrivateDataEXT;
+    }
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+    if (!strcmp(name, "vkCmdSetFragmentShadingRateEnumNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetFragmentShadingRateEnumNV;
+    }
+#endif
+#ifdef VK_NV_acquire_winrt_display
+    if (!strcmp(name, "vkAcquireWinrtDisplayNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)entry_vkAcquireWinrtDisplayNV;
+    }
+    if (!strcmp(name, "vkGetWinrtDisplayNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)entry_vkGetWinrtDisplayNV;
+    }
+#endif
+#ifdef VK_EXT_directfb_surface
+    if (!strcmp(name, "vkCreateDirectFBSurfaceEXT")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_EXT_directfb_surface");
+        return hasExt ? (void*)entry_vkCreateDirectFBSurfaceEXT : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceDirectFBPresentationSupportEXT")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_EXT_directfb_surface");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceDirectFBPresentationSupportEXT : nullptr;
+    }
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+    if (!strcmp(name, "vkCmdSetVertexInputEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetVertexInputEXT;
+    }
+#endif
+#ifdef VK_FUCHSIA_external_memory
+    if (!strcmp(name, "vkGetMemoryZirconHandleFUCHSIA")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetMemoryZirconHandleFUCHSIA;
+    }
+    if (!strcmp(name, "vkGetMemoryZirconHandlePropertiesFUCHSIA")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetMemoryZirconHandlePropertiesFUCHSIA;
+    }
+#endif
+#ifdef VK_FUCHSIA_external_semaphore
+    if (!strcmp(name, "vkImportSemaphoreZirconHandleFUCHSIA")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkImportSemaphoreZirconHandleFUCHSIA;
+    }
+    if (!strcmp(name, "vkGetSemaphoreZirconHandleFUCHSIA")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetSemaphoreZirconHandleFUCHSIA;
+    }
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+    if (!strcmp(name, "vkCreateBufferCollectionFUCHSIA")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCreateBufferCollectionFUCHSIA;
+    }
+    if (!strcmp(name, "vkSetBufferCollectionImageConstraintsFUCHSIA")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkSetBufferCollectionImageConstraintsFUCHSIA;
+    }
+    if (!strcmp(name, "vkSetBufferCollectionBufferConstraintsFUCHSIA")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkSetBufferCollectionBufferConstraintsFUCHSIA;
+    }
+    if (!strcmp(name, "vkDestroyBufferCollectionFUCHSIA")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkDestroyBufferCollectionFUCHSIA;
+    }
+    if (!strcmp(name, "vkGetBufferCollectionPropertiesFUCHSIA")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetBufferCollectionPropertiesFUCHSIA;
+    }
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+    if (!strcmp(name, "vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI;
+    }
+    if (!strcmp(name, "vkCmdSubpassShadingHUAWEI")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSubpassShadingHUAWEI;
+    }
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+    if (!strcmp(name, "vkCmdBindInvocationMaskHUAWEI")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdBindInvocationMaskHUAWEI;
+    }
+#endif
+#ifdef VK_NV_external_memory_rdma
+    if (!strcmp(name, "vkGetMemoryRemoteAddressNV")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetMemoryRemoteAddressNV;
+    }
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+    if (!strcmp(name, "vkCmdSetPatchControlPointsEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetPatchControlPointsEXT;
+    }
+    if (!strcmp(name, "vkCmdSetRasterizerDiscardEnableEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetRasterizerDiscardEnableEXT;
+    }
+    if (!strcmp(name, "vkCmdSetDepthBiasEnableEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetDepthBiasEnableEXT;
+    }
+    if (!strcmp(name, "vkCmdSetLogicOpEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetLogicOpEXT;
+    }
+    if (!strcmp(name, "vkCmdSetPrimitiveRestartEnableEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetPrimitiveRestartEnableEXT;
+    }
+#endif
+#ifdef VK_QNX_screen_surface
+    if (!strcmp(name, "vkCreateScreenSurfaceQNX")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_QNX_screen_surface");
+        return hasExt ? (void*)entry_vkCreateScreenSurfaceQNX : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceScreenPresentationSupportQNX")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_QNX_screen_surface");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceScreenPresentationSupportQNX : nullptr;
+    }
+#endif
+#ifdef VK_EXT_color_write_enable
+    if (!strcmp(name, "vkCmdSetColorWriteEnableEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetColorWriteEnableEXT;
+    }
+#endif
+#ifdef VK_GOOGLE_gfxstream
+    if (!strcmp(name, "vkMapMemoryIntoAddressSpaceGOOGLE")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)dynCheck_entry_vkMapMemoryIntoAddressSpaceGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkUpdateDescriptorSetWithTemplateSizedGOOGLE")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)dynCheck_entry_vkUpdateDescriptorSetWithTemplateSizedGOOGLE
+                      : nullptr;
+    }
+    if (!strcmp(name, "vkBeginCommandBufferAsyncGOOGLE")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkBeginCommandBufferAsyncGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkEndCommandBufferAsyncGOOGLE")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkEndCommandBufferAsyncGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkResetCommandBufferAsyncGOOGLE")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkResetCommandBufferAsyncGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkCommandBufferHostSyncGOOGLE")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkCommandBufferHostSyncGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkCreateImageWithRequirementsGOOGLE")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)dynCheck_entry_vkCreateImageWithRequirementsGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkCreateBufferWithRequirementsGOOGLE")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)dynCheck_entry_vkCreateBufferWithRequirementsGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkGetMemoryHostAddressInfoGOOGLE")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)dynCheck_entry_vkGetMemoryHostAddressInfoGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkFreeMemorySyncGOOGLE")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)dynCheck_entry_vkFreeMemorySyncGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkQueueHostSyncGOOGLE")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkQueueHostSyncGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkQueueSubmitAsyncGOOGLE")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkQueueSubmitAsyncGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkQueueWaitIdleAsyncGOOGLE")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkQueueWaitIdleAsyncGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkQueueBindSparseAsyncGOOGLE")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkQueueBindSparseAsyncGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkGetLinearImageLayoutGOOGLE")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)dynCheck_entry_vkGetLinearImageLayoutGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkGetLinearImageLayout2GOOGLE")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)dynCheck_entry_vkGetLinearImageLayout2GOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkQueueFlushCommandsGOOGLE")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkQueueFlushCommandsGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkQueueCommitDescriptorSetUpdatesGOOGLE")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkQueueCommitDescriptorSetUpdatesGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkCollectDescriptorPoolIdsGOOGLE")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)dynCheck_entry_vkCollectDescriptorPoolIdsGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkQueueSignalReleaseImageANDROIDAsyncGOOGLE")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkQueueSignalReleaseImageANDROIDAsyncGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkQueueFlushCommandsFromAuxMemoryGOOGLE")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkQueueFlushCommandsFromAuxMemoryGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkGetBlobGOOGLE")) {
+        bool hasExt = resources->hasInstanceExtension(instance, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)dynCheck_entry_vkGetBlobGOOGLE : nullptr;
+    }
+#endif
+#ifdef VK_EXT_multi_draw
+    if (!strcmp(name, "vkCmdDrawMultiEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdDrawMultiEXT;
+    }
+    if (!strcmp(name, "vkCmdDrawMultiIndexedEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdDrawMultiIndexedEXT;
+    }
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+    if (!strcmp(name, "vkSetDeviceMemoryPriorityEXT")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkSetDeviceMemoryPriorityEXT;
+    }
+#endif
+#ifdef VK_KHR_acceleration_structure
+    if (!strcmp(name, "vkCreateAccelerationStructureKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCreateAccelerationStructureKHR;
+    }
+    if (!strcmp(name, "vkDestroyAccelerationStructureKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkDestroyAccelerationStructureKHR;
+    }
+    if (!strcmp(name, "vkCmdBuildAccelerationStructuresKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdBuildAccelerationStructuresKHR;
+    }
+    if (!strcmp(name, "vkCmdBuildAccelerationStructuresIndirectKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdBuildAccelerationStructuresIndirectKHR;
+    }
+    if (!strcmp(name, "vkBuildAccelerationStructuresKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkBuildAccelerationStructuresKHR;
+    }
+    if (!strcmp(name, "vkCopyAccelerationStructureKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCopyAccelerationStructureKHR;
+    }
+    if (!strcmp(name, "vkCopyAccelerationStructureToMemoryKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCopyAccelerationStructureToMemoryKHR;
+    }
+    if (!strcmp(name, "vkCopyMemoryToAccelerationStructureKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCopyMemoryToAccelerationStructureKHR;
+    }
+    if (!strcmp(name, "vkWriteAccelerationStructuresPropertiesKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkWriteAccelerationStructuresPropertiesKHR;
+    }
+    if (!strcmp(name, "vkCmdCopyAccelerationStructureKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdCopyAccelerationStructureKHR;
+    }
+    if (!strcmp(name, "vkCmdCopyAccelerationStructureToMemoryKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdCopyAccelerationStructureToMemoryKHR;
+    }
+    if (!strcmp(name, "vkCmdCopyMemoryToAccelerationStructureKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdCopyMemoryToAccelerationStructureKHR;
+    }
+    if (!strcmp(name, "vkGetAccelerationStructureDeviceAddressKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetAccelerationStructureDeviceAddressKHR;
+    }
+    if (!strcmp(name, "vkCmdWriteAccelerationStructuresPropertiesKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdWriteAccelerationStructuresPropertiesKHR;
+    }
+    if (!strcmp(name, "vkGetDeviceAccelerationStructureCompatibilityKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetDeviceAccelerationStructureCompatibilityKHR;
+    }
+    if (!strcmp(name, "vkGetAccelerationStructureBuildSizesKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetAccelerationStructureBuildSizesKHR;
+    }
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+    if (!strcmp(name, "vkCmdTraceRaysKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdTraceRaysKHR;
+    }
+    if (!strcmp(name, "vkCreateRayTracingPipelinesKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCreateRayTracingPipelinesKHR;
+    }
+    if (!strcmp(name, "vkGetRayTracingCaptureReplayShaderGroupHandlesKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR;
+    }
+    if (!strcmp(name, "vkCmdTraceRaysIndirectKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdTraceRaysIndirectKHR;
+    }
+    if (!strcmp(name, "vkGetRayTracingShaderGroupStackSizeKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkGetRayTracingShaderGroupStackSizeKHR;
+    }
+    if (!strcmp(name, "vkCmdSetRayTracingPipelineStackSizeKHR")) {
+        // TODO(b/236246382): Check support for device extension;
+        return (void*)dynCheck_entry_vkCmdSetRayTracingPipelineStackSizeKHR;
+    }
+#endif
+    return nullptr;
+}
+void* goldfish_vulkan_get_device_proc_address(VkDevice device, const char* name) {
+    auto resources = ResourceTracker::get();
+    bool has1_1OrHigher = resources->getApiVersionFromDevice(device) >= VK_API_VERSION_1_1;
+#ifdef VK_VERSION_1_0
+    if (!strcmp(name, "vkCreateInstance")) {
+        return (void*)entry_vkCreateInstance;
+    }
+    if (!strcmp(name, "vkDestroyInstance")) {
+        return (void*)entry_vkDestroyInstance;
+    }
+    if (!strcmp(name, "vkEnumeratePhysicalDevices")) {
+        return (void*)entry_vkEnumeratePhysicalDevices;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceFeatures")) {
+        return (void*)entry_vkGetPhysicalDeviceFeatures;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceFormatProperties")) {
+        return (void*)entry_vkGetPhysicalDeviceFormatProperties;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceImageFormatProperties")) {
+        return (void*)entry_vkGetPhysicalDeviceImageFormatProperties;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceProperties")) {
+        return (void*)entry_vkGetPhysicalDeviceProperties;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceQueueFamilyProperties")) {
+        return (void*)entry_vkGetPhysicalDeviceQueueFamilyProperties;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceMemoryProperties")) {
+        return (void*)entry_vkGetPhysicalDeviceMemoryProperties;
+    }
+    if (!strcmp(name, "vkGetInstanceProcAddr")) {
+        return (void*)entry_vkGetInstanceProcAddr;
+    }
+    if (!strcmp(name, "vkGetDeviceProcAddr")) {
+        return (void*)entry_vkGetDeviceProcAddr;
+    }
+    if (!strcmp(name, "vkCreateDevice")) {
+        return (void*)entry_vkCreateDevice;
+    }
+    if (!strcmp(name, "vkDestroyDevice")) {
+        return (void*)entry_vkDestroyDevice;
+    }
+    if (!strcmp(name, "vkEnumerateInstanceExtensionProperties")) {
+        return (void*)entry_vkEnumerateInstanceExtensionProperties;
+    }
+    if (!strcmp(name, "vkEnumerateDeviceExtensionProperties")) {
+        return (void*)entry_vkEnumerateDeviceExtensionProperties;
+    }
+    if (!strcmp(name, "vkEnumerateInstanceLayerProperties")) {
+        return (void*)entry_vkEnumerateInstanceLayerProperties;
+    }
+    if (!strcmp(name, "vkEnumerateDeviceLayerProperties")) {
+        return (void*)entry_vkEnumerateDeviceLayerProperties;
+    }
+    if (!strcmp(name, "vkGetDeviceQueue")) {
+        return (void*)entry_vkGetDeviceQueue;
+    }
+    if (!strcmp(name, "vkQueueSubmit")) {
+        return (void*)entry_vkQueueSubmit;
+    }
+    if (!strcmp(name, "vkQueueWaitIdle")) {
+        return (void*)entry_vkQueueWaitIdle;
+    }
+    if (!strcmp(name, "vkDeviceWaitIdle")) {
+        return (void*)entry_vkDeviceWaitIdle;
+    }
+    if (!strcmp(name, "vkAllocateMemory")) {
+        return (void*)entry_vkAllocateMemory;
+    }
+    if (!strcmp(name, "vkFreeMemory")) {
+        return (void*)entry_vkFreeMemory;
+    }
+    if (!strcmp(name, "vkMapMemory")) {
+        return (void*)entry_vkMapMemory;
+    }
+    if (!strcmp(name, "vkUnmapMemory")) {
+        return (void*)entry_vkUnmapMemory;
+    }
+    if (!strcmp(name, "vkFlushMappedMemoryRanges")) {
+        return (void*)entry_vkFlushMappedMemoryRanges;
+    }
+    if (!strcmp(name, "vkInvalidateMappedMemoryRanges")) {
+        return (void*)entry_vkInvalidateMappedMemoryRanges;
+    }
+    if (!strcmp(name, "vkGetDeviceMemoryCommitment")) {
+        return (void*)entry_vkGetDeviceMemoryCommitment;
+    }
+    if (!strcmp(name, "vkBindBufferMemory")) {
+        return (void*)entry_vkBindBufferMemory;
+    }
+    if (!strcmp(name, "vkBindImageMemory")) {
+        return (void*)entry_vkBindImageMemory;
+    }
+    if (!strcmp(name, "vkGetBufferMemoryRequirements")) {
+        return (void*)entry_vkGetBufferMemoryRequirements;
+    }
+    if (!strcmp(name, "vkGetImageMemoryRequirements")) {
+        return (void*)entry_vkGetImageMemoryRequirements;
+    }
+    if (!strcmp(name, "vkGetImageSparseMemoryRequirements")) {
+        return (void*)entry_vkGetImageSparseMemoryRequirements;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceSparseImageFormatProperties")) {
+        return (void*)entry_vkGetPhysicalDeviceSparseImageFormatProperties;
+    }
+    if (!strcmp(name, "vkQueueBindSparse")) {
+        return (void*)entry_vkQueueBindSparse;
+    }
+    if (!strcmp(name, "vkCreateFence")) {
+        return (void*)entry_vkCreateFence;
+    }
+    if (!strcmp(name, "vkDestroyFence")) {
+        return (void*)entry_vkDestroyFence;
+    }
+    if (!strcmp(name, "vkResetFences")) {
+        return (void*)entry_vkResetFences;
+    }
+    if (!strcmp(name, "vkGetFenceStatus")) {
+        return (void*)entry_vkGetFenceStatus;
+    }
+    if (!strcmp(name, "vkWaitForFences")) {
+        return (void*)entry_vkWaitForFences;
+    }
+    if (!strcmp(name, "vkCreateSemaphore")) {
+        return (void*)entry_vkCreateSemaphore;
+    }
+    if (!strcmp(name, "vkDestroySemaphore")) {
+        return (void*)entry_vkDestroySemaphore;
+    }
+    if (!strcmp(name, "vkCreateEvent")) {
+        return (void*)entry_vkCreateEvent;
+    }
+    if (!strcmp(name, "vkDestroyEvent")) {
+        return (void*)entry_vkDestroyEvent;
+    }
+    if (!strcmp(name, "vkGetEventStatus")) {
+        return (void*)entry_vkGetEventStatus;
+    }
+    if (!strcmp(name, "vkSetEvent")) {
+        return (void*)entry_vkSetEvent;
+    }
+    if (!strcmp(name, "vkResetEvent")) {
+        return (void*)entry_vkResetEvent;
+    }
+    if (!strcmp(name, "vkCreateQueryPool")) {
+        return (void*)entry_vkCreateQueryPool;
+    }
+    if (!strcmp(name, "vkDestroyQueryPool")) {
+        return (void*)entry_vkDestroyQueryPool;
+    }
+    if (!strcmp(name, "vkGetQueryPoolResults")) {
+        return (void*)entry_vkGetQueryPoolResults;
+    }
+    if (!strcmp(name, "vkCreateBuffer")) {
+        return (void*)entry_vkCreateBuffer;
+    }
+    if (!strcmp(name, "vkDestroyBuffer")) {
+        return (void*)entry_vkDestroyBuffer;
+    }
+    if (!strcmp(name, "vkCreateBufferView")) {
+        return (void*)entry_vkCreateBufferView;
+    }
+    if (!strcmp(name, "vkDestroyBufferView")) {
+        return (void*)entry_vkDestroyBufferView;
+    }
+    if (!strcmp(name, "vkCreateImage")) {
+        return (void*)entry_vkCreateImage;
+    }
+    if (!strcmp(name, "vkDestroyImage")) {
+        return (void*)entry_vkDestroyImage;
+    }
+    if (!strcmp(name, "vkGetImageSubresourceLayout")) {
+        return (void*)entry_vkGetImageSubresourceLayout;
+    }
+    if (!strcmp(name, "vkCreateImageView")) {
+        return (void*)entry_vkCreateImageView;
+    }
+    if (!strcmp(name, "vkDestroyImageView")) {
+        return (void*)entry_vkDestroyImageView;
+    }
+    if (!strcmp(name, "vkCreateShaderModule")) {
+        return (void*)entry_vkCreateShaderModule;
+    }
+    if (!strcmp(name, "vkDestroyShaderModule")) {
+        return (void*)entry_vkDestroyShaderModule;
+    }
+    if (!strcmp(name, "vkCreatePipelineCache")) {
+        return (void*)entry_vkCreatePipelineCache;
+    }
+    if (!strcmp(name, "vkDestroyPipelineCache")) {
+        return (void*)entry_vkDestroyPipelineCache;
+    }
+    if (!strcmp(name, "vkGetPipelineCacheData")) {
+        return (void*)entry_vkGetPipelineCacheData;
+    }
+    if (!strcmp(name, "vkMergePipelineCaches")) {
+        return (void*)entry_vkMergePipelineCaches;
+    }
+    if (!strcmp(name, "vkCreateGraphicsPipelines")) {
+        return (void*)entry_vkCreateGraphicsPipelines;
+    }
+    if (!strcmp(name, "vkCreateComputePipelines")) {
+        return (void*)entry_vkCreateComputePipelines;
+    }
+    if (!strcmp(name, "vkDestroyPipeline")) {
+        return (void*)entry_vkDestroyPipeline;
+    }
+    if (!strcmp(name, "vkCreatePipelineLayout")) {
+        return (void*)entry_vkCreatePipelineLayout;
+    }
+    if (!strcmp(name, "vkDestroyPipelineLayout")) {
+        return (void*)entry_vkDestroyPipelineLayout;
+    }
+    if (!strcmp(name, "vkCreateSampler")) {
+        return (void*)entry_vkCreateSampler;
+    }
+    if (!strcmp(name, "vkDestroySampler")) {
+        return (void*)entry_vkDestroySampler;
+    }
+    if (!strcmp(name, "vkCreateDescriptorSetLayout")) {
+        return (void*)entry_vkCreateDescriptorSetLayout;
+    }
+    if (!strcmp(name, "vkDestroyDescriptorSetLayout")) {
+        return (void*)entry_vkDestroyDescriptorSetLayout;
+    }
+    if (!strcmp(name, "vkCreateDescriptorPool")) {
+        return (void*)entry_vkCreateDescriptorPool;
+    }
+    if (!strcmp(name, "vkDestroyDescriptorPool")) {
+        return (void*)entry_vkDestroyDescriptorPool;
+    }
+    if (!strcmp(name, "vkResetDescriptorPool")) {
+        return (void*)entry_vkResetDescriptorPool;
+    }
+    if (!strcmp(name, "vkAllocateDescriptorSets")) {
+        return (void*)entry_vkAllocateDescriptorSets;
+    }
+    if (!strcmp(name, "vkFreeDescriptorSets")) {
+        return (void*)entry_vkFreeDescriptorSets;
+    }
+    if (!strcmp(name, "vkUpdateDescriptorSets")) {
+        return (void*)entry_vkUpdateDescriptorSets;
+    }
+    if (!strcmp(name, "vkCreateFramebuffer")) {
+        return (void*)entry_vkCreateFramebuffer;
+    }
+    if (!strcmp(name, "vkDestroyFramebuffer")) {
+        return (void*)entry_vkDestroyFramebuffer;
+    }
+    if (!strcmp(name, "vkCreateRenderPass")) {
+        return (void*)entry_vkCreateRenderPass;
+    }
+    if (!strcmp(name, "vkDestroyRenderPass")) {
+        return (void*)entry_vkDestroyRenderPass;
+    }
+    if (!strcmp(name, "vkGetRenderAreaGranularity")) {
+        return (void*)entry_vkGetRenderAreaGranularity;
+    }
+    if (!strcmp(name, "vkCreateCommandPool")) {
+        return (void*)entry_vkCreateCommandPool;
+    }
+    if (!strcmp(name, "vkDestroyCommandPool")) {
+        return (void*)entry_vkDestroyCommandPool;
+    }
+    if (!strcmp(name, "vkResetCommandPool")) {
+        return (void*)entry_vkResetCommandPool;
+    }
+    if (!strcmp(name, "vkAllocateCommandBuffers")) {
+        return (void*)entry_vkAllocateCommandBuffers;
+    }
+    if (!strcmp(name, "vkFreeCommandBuffers")) {
+        return (void*)entry_vkFreeCommandBuffers;
+    }
+    if (!strcmp(name, "vkBeginCommandBuffer")) {
+        return (void*)entry_vkBeginCommandBuffer;
+    }
+    if (!strcmp(name, "vkEndCommandBuffer")) {
+        return (void*)entry_vkEndCommandBuffer;
+    }
+    if (!strcmp(name, "vkResetCommandBuffer")) {
+        return (void*)entry_vkResetCommandBuffer;
+    }
+    if (!strcmp(name, "vkCmdBindPipeline")) {
+        return (void*)entry_vkCmdBindPipeline;
+    }
+    if (!strcmp(name, "vkCmdSetViewport")) {
+        return (void*)entry_vkCmdSetViewport;
+    }
+    if (!strcmp(name, "vkCmdSetScissor")) {
+        return (void*)entry_vkCmdSetScissor;
+    }
+    if (!strcmp(name, "vkCmdSetLineWidth")) {
+        return (void*)entry_vkCmdSetLineWidth;
+    }
+    if (!strcmp(name, "vkCmdSetDepthBias")) {
+        return (void*)entry_vkCmdSetDepthBias;
+    }
+    if (!strcmp(name, "vkCmdSetBlendConstants")) {
+        return (void*)entry_vkCmdSetBlendConstants;
+    }
+    if (!strcmp(name, "vkCmdSetDepthBounds")) {
+        return (void*)entry_vkCmdSetDepthBounds;
+    }
+    if (!strcmp(name, "vkCmdSetStencilCompareMask")) {
+        return (void*)entry_vkCmdSetStencilCompareMask;
+    }
+    if (!strcmp(name, "vkCmdSetStencilWriteMask")) {
+        return (void*)entry_vkCmdSetStencilWriteMask;
+    }
+    if (!strcmp(name, "vkCmdSetStencilReference")) {
+        return (void*)entry_vkCmdSetStencilReference;
+    }
+    if (!strcmp(name, "vkCmdBindDescriptorSets")) {
+        return (void*)entry_vkCmdBindDescriptorSets;
+    }
+    if (!strcmp(name, "vkCmdBindIndexBuffer")) {
+        return (void*)entry_vkCmdBindIndexBuffer;
+    }
+    if (!strcmp(name, "vkCmdBindVertexBuffers")) {
+        return (void*)entry_vkCmdBindVertexBuffers;
+    }
+    if (!strcmp(name, "vkCmdDraw")) {
+        return (void*)entry_vkCmdDraw;
+    }
+    if (!strcmp(name, "vkCmdDrawIndexed")) {
+        return (void*)entry_vkCmdDrawIndexed;
+    }
+    if (!strcmp(name, "vkCmdDrawIndirect")) {
+        return (void*)entry_vkCmdDrawIndirect;
+    }
+    if (!strcmp(name, "vkCmdDrawIndexedIndirect")) {
+        return (void*)entry_vkCmdDrawIndexedIndirect;
+    }
+    if (!strcmp(name, "vkCmdDispatch")) {
+        return (void*)entry_vkCmdDispatch;
+    }
+    if (!strcmp(name, "vkCmdDispatchIndirect")) {
+        return (void*)entry_vkCmdDispatchIndirect;
+    }
+    if (!strcmp(name, "vkCmdCopyBuffer")) {
+        return (void*)entry_vkCmdCopyBuffer;
+    }
+    if (!strcmp(name, "vkCmdCopyImage")) {
+        return (void*)entry_vkCmdCopyImage;
+    }
+    if (!strcmp(name, "vkCmdBlitImage")) {
+        return (void*)entry_vkCmdBlitImage;
+    }
+    if (!strcmp(name, "vkCmdCopyBufferToImage")) {
+        return (void*)entry_vkCmdCopyBufferToImage;
+    }
+    if (!strcmp(name, "vkCmdCopyImageToBuffer")) {
+        return (void*)entry_vkCmdCopyImageToBuffer;
+    }
+    if (!strcmp(name, "vkCmdUpdateBuffer")) {
+        return (void*)entry_vkCmdUpdateBuffer;
+    }
+    if (!strcmp(name, "vkCmdFillBuffer")) {
+        return (void*)entry_vkCmdFillBuffer;
+    }
+    if (!strcmp(name, "vkCmdClearColorImage")) {
+        return (void*)entry_vkCmdClearColorImage;
+    }
+    if (!strcmp(name, "vkCmdClearDepthStencilImage")) {
+        return (void*)entry_vkCmdClearDepthStencilImage;
+    }
+    if (!strcmp(name, "vkCmdClearAttachments")) {
+        return (void*)entry_vkCmdClearAttachments;
+    }
+    if (!strcmp(name, "vkCmdResolveImage")) {
+        return (void*)entry_vkCmdResolveImage;
+    }
+    if (!strcmp(name, "vkCmdSetEvent")) {
+        return (void*)entry_vkCmdSetEvent;
+    }
+    if (!strcmp(name, "vkCmdResetEvent")) {
+        return (void*)entry_vkCmdResetEvent;
+    }
+    if (!strcmp(name, "vkCmdWaitEvents")) {
+        return (void*)entry_vkCmdWaitEvents;
+    }
+    if (!strcmp(name, "vkCmdPipelineBarrier")) {
+        return (void*)entry_vkCmdPipelineBarrier;
+    }
+    if (!strcmp(name, "vkCmdBeginQuery")) {
+        return (void*)entry_vkCmdBeginQuery;
+    }
+    if (!strcmp(name, "vkCmdEndQuery")) {
+        return (void*)entry_vkCmdEndQuery;
+    }
+    if (!strcmp(name, "vkCmdResetQueryPool")) {
+        return (void*)entry_vkCmdResetQueryPool;
+    }
+    if (!strcmp(name, "vkCmdWriteTimestamp")) {
+        return (void*)entry_vkCmdWriteTimestamp;
+    }
+    if (!strcmp(name, "vkCmdCopyQueryPoolResults")) {
+        return (void*)entry_vkCmdCopyQueryPoolResults;
+    }
+    if (!strcmp(name, "vkCmdPushConstants")) {
+        return (void*)entry_vkCmdPushConstants;
+    }
+    if (!strcmp(name, "vkCmdBeginRenderPass")) {
+        return (void*)entry_vkCmdBeginRenderPass;
+    }
+    if (!strcmp(name, "vkCmdNextSubpass")) {
+        return (void*)entry_vkCmdNextSubpass;
+    }
+    if (!strcmp(name, "vkCmdEndRenderPass")) {
+        return (void*)entry_vkCmdEndRenderPass;
+    }
+    if (!strcmp(name, "vkCmdExecuteCommands")) {
+        return (void*)entry_vkCmdExecuteCommands;
+    }
+#endif
+#ifdef VK_VERSION_1_1
+    if (!strcmp(name, "vkEnumerateInstanceVersion")) {
+        return has1_1OrHigher ? (void*)entry_vkEnumerateInstanceVersion : nullptr;
+    }
+    if (!strcmp(name, "vkBindBufferMemory2")) {
+        return has1_1OrHigher ? (void*)entry_vkBindBufferMemory2 : nullptr;
+    }
+    if (!strcmp(name, "vkBindImageMemory2")) {
+        return has1_1OrHigher ? (void*)entry_vkBindImageMemory2 : nullptr;
+    }
+    if (!strcmp(name, "vkGetDeviceGroupPeerMemoryFeatures")) {
+        return has1_1OrHigher ? (void*)entry_vkGetDeviceGroupPeerMemoryFeatures : nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetDeviceMask")) {
+        return has1_1OrHigher ? (void*)entry_vkCmdSetDeviceMask : nullptr;
+    }
+    if (!strcmp(name, "vkCmdDispatchBase")) {
+        return has1_1OrHigher ? (void*)entry_vkCmdDispatchBase : nullptr;
+    }
+    if (!strcmp(name, "vkEnumeratePhysicalDeviceGroups")) {
+        return nullptr;
+    }
+    if (!strcmp(name, "vkGetImageMemoryRequirements2")) {
+        return has1_1OrHigher ? (void*)entry_vkGetImageMemoryRequirements2 : nullptr;
+    }
+    if (!strcmp(name, "vkGetBufferMemoryRequirements2")) {
+        return has1_1OrHigher ? (void*)entry_vkGetBufferMemoryRequirements2 : nullptr;
+    }
+    if (!strcmp(name, "vkGetImageSparseMemoryRequirements2")) {
+        return has1_1OrHigher ? (void*)entry_vkGetImageSparseMemoryRequirements2 : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceFeatures2")) {
+        return has1_1OrHigher ? (void*)entry_vkGetPhysicalDeviceFeatures2 : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceProperties2")) {
+        return has1_1OrHigher ? (void*)entry_vkGetPhysicalDeviceProperties2 : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceFormatProperties2")) {
+        return has1_1OrHigher ? (void*)entry_vkGetPhysicalDeviceFormatProperties2 : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceImageFormatProperties2")) {
+        return has1_1OrHigher ? (void*)entry_vkGetPhysicalDeviceImageFormatProperties2 : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceQueueFamilyProperties2")) {
+        return has1_1OrHigher ? (void*)entry_vkGetPhysicalDeviceQueueFamilyProperties2 : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceMemoryProperties2")) {
+        return has1_1OrHigher ? (void*)entry_vkGetPhysicalDeviceMemoryProperties2 : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceSparseImageFormatProperties2")) {
+        return has1_1OrHigher ? (void*)entry_vkGetPhysicalDeviceSparseImageFormatProperties2
+                              : nullptr;
+    }
+    if (!strcmp(name, "vkTrimCommandPool")) {
+        return has1_1OrHigher ? (void*)entry_vkTrimCommandPool : nullptr;
+    }
+    if (!strcmp(name, "vkGetDeviceQueue2")) {
+        return has1_1OrHigher ? (void*)entry_vkGetDeviceQueue2 : nullptr;
+    }
+    if (!strcmp(name, "vkCreateSamplerYcbcrConversion")) {
+        return has1_1OrHigher ? (void*)entry_vkCreateSamplerYcbcrConversion : nullptr;
+    }
+    if (!strcmp(name, "vkDestroySamplerYcbcrConversion")) {
+        return has1_1OrHigher ? (void*)entry_vkDestroySamplerYcbcrConversion : nullptr;
+    }
+    if (!strcmp(name, "vkCreateDescriptorUpdateTemplate")) {
+        return has1_1OrHigher ? (void*)entry_vkCreateDescriptorUpdateTemplate : nullptr;
+    }
+    if (!strcmp(name, "vkDestroyDescriptorUpdateTemplate")) {
+        return has1_1OrHigher ? (void*)entry_vkDestroyDescriptorUpdateTemplate : nullptr;
+    }
+    if (!strcmp(name, "vkUpdateDescriptorSetWithTemplate")) {
+        return has1_1OrHigher ? (void*)entry_vkUpdateDescriptorSetWithTemplate : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceExternalBufferProperties")) {
+        return has1_1OrHigher ? (void*)entry_vkGetPhysicalDeviceExternalBufferProperties : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceExternalFenceProperties")) {
+        return has1_1OrHigher ? (void*)entry_vkGetPhysicalDeviceExternalFenceProperties : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceExternalSemaphoreProperties")) {
+        return has1_1OrHigher ? (void*)entry_vkGetPhysicalDeviceExternalSemaphoreProperties
+                              : nullptr;
+    }
+    if (!strcmp(name, "vkGetDescriptorSetLayoutSupport")) {
+        return has1_1OrHigher ? (void*)entry_vkGetDescriptorSetLayoutSupport : nullptr;
+    }
+#endif
+#ifdef VK_VERSION_1_2
+    if (!strcmp(name, "vkCmdDrawIndirectCount")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_VERSION_1_2");
+        return hasExt ? (void*)entry_vkCmdDrawIndirectCount : nullptr;
+    }
+    if (!strcmp(name, "vkCmdDrawIndexedIndirectCount")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_VERSION_1_2");
+        return hasExt ? (void*)entry_vkCmdDrawIndexedIndirectCount : nullptr;
+    }
+    if (!strcmp(name, "vkCreateRenderPass2")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_VERSION_1_2");
+        return hasExt ? (void*)entry_vkCreateRenderPass2 : nullptr;
+    }
+    if (!strcmp(name, "vkCmdBeginRenderPass2")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_VERSION_1_2");
+        return hasExt ? (void*)entry_vkCmdBeginRenderPass2 : nullptr;
+    }
+    if (!strcmp(name, "vkCmdNextSubpass2")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_VERSION_1_2");
+        return hasExt ? (void*)entry_vkCmdNextSubpass2 : nullptr;
+    }
+    if (!strcmp(name, "vkCmdEndRenderPass2")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_VERSION_1_2");
+        return hasExt ? (void*)entry_vkCmdEndRenderPass2 : nullptr;
+    }
+    if (!strcmp(name, "vkResetQueryPool")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_VERSION_1_2");
+        return hasExt ? (void*)entry_vkResetQueryPool : nullptr;
+    }
+    if (!strcmp(name, "vkGetSemaphoreCounterValue")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_VERSION_1_2");
+        return hasExt ? (void*)entry_vkGetSemaphoreCounterValue : nullptr;
+    }
+    if (!strcmp(name, "vkWaitSemaphores")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_VERSION_1_2");
+        return hasExt ? (void*)entry_vkWaitSemaphores : nullptr;
+    }
+    if (!strcmp(name, "vkSignalSemaphore")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_VERSION_1_2");
+        return hasExt ? (void*)entry_vkSignalSemaphore : nullptr;
+    }
+    if (!strcmp(name, "vkGetBufferDeviceAddress")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_VERSION_1_2");
+        return hasExt ? (void*)entry_vkGetBufferDeviceAddress : nullptr;
+    }
+    if (!strcmp(name, "vkGetBufferOpaqueCaptureAddress")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_VERSION_1_2");
+        return hasExt ? (void*)entry_vkGetBufferOpaqueCaptureAddress : nullptr;
+    }
+    if (!strcmp(name, "vkGetDeviceMemoryOpaqueCaptureAddress")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_VERSION_1_2");
+        return hasExt ? (void*)entry_vkGetDeviceMemoryOpaqueCaptureAddress : nullptr;
+    }
+#endif
+#ifdef VK_KHR_surface
+    if (!strcmp(name, "vkDestroySurfaceKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_surface");
+        return hasExt ? (void*)entry_vkDestroySurfaceKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceSurfaceSupportKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_surface");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceSurfaceSupportKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_surface");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceSurfaceCapabilitiesKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceSurfaceFormatsKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_surface");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceSurfaceFormatsKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceSurfacePresentModesKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_surface");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceSurfacePresentModesKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_swapchain
+    if (!strcmp(name, "vkCreateSwapchainKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_swapchain");
+        return hasExt ? (void*)entry_vkCreateSwapchainKHR : nullptr;
+    }
+    if (!strcmp(name, "vkDestroySwapchainKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_swapchain");
+        return hasExt ? (void*)entry_vkDestroySwapchainKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetSwapchainImagesKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_swapchain");
+        return hasExt ? (void*)entry_vkGetSwapchainImagesKHR : nullptr;
+    }
+    if (!strcmp(name, "vkAcquireNextImageKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_swapchain");
+        return hasExt ? (void*)entry_vkAcquireNextImageKHR : nullptr;
+    }
+    if (!strcmp(name, "vkQueuePresentKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_swapchain");
+        return hasExt ? (void*)entry_vkQueuePresentKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetDeviceGroupPresentCapabilitiesKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_swapchain");
+        return hasExt ? (void*)entry_vkGetDeviceGroupPresentCapabilitiesKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetDeviceGroupSurfacePresentModesKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_swapchain");
+        return hasExt ? (void*)entry_vkGetDeviceGroupSurfacePresentModesKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDevicePresentRectanglesKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_swapchain");
+        return hasExt ? (void*)entry_vkGetPhysicalDevicePresentRectanglesKHR : nullptr;
+    }
+    if (!strcmp(name, "vkAcquireNextImage2KHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_swapchain");
+        return hasExt ? (void*)entry_vkAcquireNextImage2KHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_display
+    if (!strcmp(name, "vkGetPhysicalDeviceDisplayPropertiesKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_display");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceDisplayPropertiesKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceDisplayPlanePropertiesKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_display");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceDisplayPlanePropertiesKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetDisplayPlaneSupportedDisplaysKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_display");
+        return hasExt ? (void*)entry_vkGetDisplayPlaneSupportedDisplaysKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetDisplayModePropertiesKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_display");
+        return hasExt ? (void*)entry_vkGetDisplayModePropertiesKHR : nullptr;
+    }
+    if (!strcmp(name, "vkCreateDisplayModeKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_display");
+        return hasExt ? (void*)entry_vkCreateDisplayModeKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetDisplayPlaneCapabilitiesKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_display");
+        return hasExt ? (void*)entry_vkGetDisplayPlaneCapabilitiesKHR : nullptr;
+    }
+    if (!strcmp(name, "vkCreateDisplayPlaneSurfaceKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_display");
+        return hasExt ? (void*)entry_vkCreateDisplayPlaneSurfaceKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_display_swapchain
+    if (!strcmp(name, "vkCreateSharedSwapchainsKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_display_swapchain");
+        return hasExt ? (void*)entry_vkCreateSharedSwapchainsKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_xlib_surface
+    if (!strcmp(name, "vkCreateXlibSurfaceKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_xlib_surface");
+        return hasExt ? (void*)entry_vkCreateXlibSurfaceKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceXlibPresentationSupportKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_xlib_surface");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceXlibPresentationSupportKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_xcb_surface
+    if (!strcmp(name, "vkCreateXcbSurfaceKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_xcb_surface");
+        return hasExt ? (void*)entry_vkCreateXcbSurfaceKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceXcbPresentationSupportKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_xcb_surface");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceXcbPresentationSupportKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_wayland_surface
+    if (!strcmp(name, "vkCreateWaylandSurfaceKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_wayland_surface");
+        return hasExt ? (void*)entry_vkCreateWaylandSurfaceKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceWaylandPresentationSupportKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_wayland_surface");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceWaylandPresentationSupportKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_android_surface
+    if (!strcmp(name, "vkCreateAndroidSurfaceKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_android_surface");
+        return hasExt ? (void*)entry_vkCreateAndroidSurfaceKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_win32_surface
+    if (!strcmp(name, "vkCreateWin32SurfaceKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_win32_surface");
+        return hasExt ? (void*)entry_vkCreateWin32SurfaceKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceWin32PresentationSupportKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_win32_surface");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceWin32PresentationSupportKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_video_queue
+    if (!strcmp(name, "vkGetPhysicalDeviceVideoCapabilitiesKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_video_queue");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceVideoCapabilitiesKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceVideoFormatPropertiesKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_video_queue");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceVideoFormatPropertiesKHR : nullptr;
+    }
+    if (!strcmp(name, "vkCreateVideoSessionKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_video_queue");
+        return hasExt ? (void*)entry_vkCreateVideoSessionKHR : nullptr;
+    }
+    if (!strcmp(name, "vkDestroyVideoSessionKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_video_queue");
+        return hasExt ? (void*)entry_vkDestroyVideoSessionKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetVideoSessionMemoryRequirementsKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_video_queue");
+        return hasExt ? (void*)entry_vkGetVideoSessionMemoryRequirementsKHR : nullptr;
+    }
+    if (!strcmp(name, "vkBindVideoSessionMemoryKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_video_queue");
+        return hasExt ? (void*)entry_vkBindVideoSessionMemoryKHR : nullptr;
+    }
+    if (!strcmp(name, "vkCreateVideoSessionParametersKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_video_queue");
+        return hasExt ? (void*)entry_vkCreateVideoSessionParametersKHR : nullptr;
+    }
+    if (!strcmp(name, "vkUpdateVideoSessionParametersKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_video_queue");
+        return hasExt ? (void*)entry_vkUpdateVideoSessionParametersKHR : nullptr;
+    }
+    if (!strcmp(name, "vkDestroyVideoSessionParametersKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_video_queue");
+        return hasExt ? (void*)entry_vkDestroyVideoSessionParametersKHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdBeginVideoCodingKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_video_queue");
+        return hasExt ? (void*)entry_vkCmdBeginVideoCodingKHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdEndVideoCodingKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_video_queue");
+        return hasExt ? (void*)entry_vkCmdEndVideoCodingKHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdControlVideoCodingKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_video_queue");
+        return hasExt ? (void*)entry_vkCmdControlVideoCodingKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_video_decode_queue
+    if (!strcmp(name, "vkCmdDecodeVideoKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_video_decode_queue");
+        return hasExt ? (void*)entry_vkCmdDecodeVideoKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_dynamic_rendering
+    if (!strcmp(name, "vkCmdBeginRenderingKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_dynamic_rendering");
+        return hasExt ? (void*)entry_vkCmdBeginRenderingKHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdEndRenderingKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_dynamic_rendering");
+        return hasExt ? (void*)entry_vkCmdEndRenderingKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_get_physical_device_properties2
+    if (!strcmp(name, "vkGetPhysicalDeviceFeatures2KHR")) {
+        bool hasExt =
+            resources->hasDeviceExtension(device, "VK_KHR_get_physical_device_properties2");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceFeatures2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceProperties2KHR")) {
+        bool hasExt =
+            resources->hasDeviceExtension(device, "VK_KHR_get_physical_device_properties2");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceProperties2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceFormatProperties2KHR")) {
+        bool hasExt =
+            resources->hasDeviceExtension(device, "VK_KHR_get_physical_device_properties2");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceFormatProperties2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceImageFormatProperties2KHR")) {
+        bool hasExt =
+            resources->hasDeviceExtension(device, "VK_KHR_get_physical_device_properties2");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceImageFormatProperties2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceQueueFamilyProperties2KHR")) {
+        bool hasExt =
+            resources->hasDeviceExtension(device, "VK_KHR_get_physical_device_properties2");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceQueueFamilyProperties2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceMemoryProperties2KHR")) {
+        bool hasExt =
+            resources->hasDeviceExtension(device, "VK_KHR_get_physical_device_properties2");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceMemoryProperties2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceSparseImageFormatProperties2KHR")) {
+        bool hasExt =
+            resources->hasDeviceExtension(device, "VK_KHR_get_physical_device_properties2");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceSparseImageFormatProperties2KHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_device_group
+    if (!strcmp(name, "vkGetDeviceGroupPeerMemoryFeaturesKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_device_group");
+        return hasExt ? (void*)entry_vkGetDeviceGroupPeerMemoryFeaturesKHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetDeviceMaskKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_device_group");
+        return hasExt ? (void*)entry_vkCmdSetDeviceMaskKHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdDispatchBaseKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_device_group");
+        return hasExt ? (void*)entry_vkCmdDispatchBaseKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_maintenance1
+    if (!strcmp(name, "vkTrimCommandPoolKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_maintenance1");
+        return hasExt ? (void*)entry_vkTrimCommandPoolKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_device_group_creation
+    if (!strcmp(name, "vkEnumeratePhysicalDeviceGroupsKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_device_group_creation");
+        return hasExt ? (void*)entry_vkEnumeratePhysicalDeviceGroupsKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_external_memory_capabilities
+    if (!strcmp(name, "vkGetPhysicalDeviceExternalBufferPropertiesKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_external_memory_capabilities");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceExternalBufferPropertiesKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_external_memory_win32
+    if (!strcmp(name, "vkGetMemoryWin32HandleKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_external_memory_win32");
+        return hasExt ? (void*)entry_vkGetMemoryWin32HandleKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetMemoryWin32HandlePropertiesKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_external_memory_win32");
+        return hasExt ? (void*)entry_vkGetMemoryWin32HandlePropertiesKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_external_memory_fd
+    if (!strcmp(name, "vkGetMemoryFdKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_external_memory_fd");
+        return hasExt ? (void*)entry_vkGetMemoryFdKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetMemoryFdPropertiesKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_external_memory_fd");
+        return hasExt ? (void*)entry_vkGetMemoryFdPropertiesKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_external_semaphore_capabilities
+    if (!strcmp(name, "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR")) {
+        bool hasExt =
+            resources->hasDeviceExtension(device, "VK_KHR_external_semaphore_capabilities");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+    if (!strcmp(name, "vkImportSemaphoreWin32HandleKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_external_semaphore_win32");
+        return hasExt ? (void*)entry_vkImportSemaphoreWin32HandleKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetSemaphoreWin32HandleKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_external_semaphore_win32");
+        return hasExt ? (void*)entry_vkGetSemaphoreWin32HandleKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_external_semaphore_fd
+    if (!strcmp(name, "vkImportSemaphoreFdKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_external_semaphore_fd");
+        return hasExt ? (void*)entry_vkImportSemaphoreFdKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetSemaphoreFdKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_external_semaphore_fd");
+        return hasExt ? (void*)entry_vkGetSemaphoreFdKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_push_descriptor
+    if (!strcmp(name, "vkCmdPushDescriptorSetKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_push_descriptor");
+        return hasExt ? (void*)entry_vkCmdPushDescriptorSetKHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdPushDescriptorSetWithTemplateKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_push_descriptor");
+        return hasExt ? (void*)entry_vkCmdPushDescriptorSetWithTemplateKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_descriptor_update_template
+    if (!strcmp(name, "vkCreateDescriptorUpdateTemplateKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_descriptor_update_template");
+        return hasExt ? (void*)entry_vkCreateDescriptorUpdateTemplateKHR : nullptr;
+    }
+    if (!strcmp(name, "vkDestroyDescriptorUpdateTemplateKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_descriptor_update_template");
+        return hasExt ? (void*)entry_vkDestroyDescriptorUpdateTemplateKHR : nullptr;
+    }
+    if (!strcmp(name, "vkUpdateDescriptorSetWithTemplateKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_descriptor_update_template");
+        return hasExt ? (void*)entry_vkUpdateDescriptorSetWithTemplateKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_create_renderpass2
+    if (!strcmp(name, "vkCreateRenderPass2KHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_create_renderpass2");
+        return hasExt ? (void*)entry_vkCreateRenderPass2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdBeginRenderPass2KHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_create_renderpass2");
+        return hasExt ? (void*)entry_vkCmdBeginRenderPass2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdNextSubpass2KHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_create_renderpass2");
+        return hasExt ? (void*)entry_vkCmdNextSubpass2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdEndRenderPass2KHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_create_renderpass2");
+        return hasExt ? (void*)entry_vkCmdEndRenderPass2KHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_shared_presentable_image
+    if (!strcmp(name, "vkGetSwapchainStatusKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_shared_presentable_image");
+        return hasExt ? (void*)entry_vkGetSwapchainStatusKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_external_fence_capabilities
+    if (!strcmp(name, "vkGetPhysicalDeviceExternalFencePropertiesKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_external_fence_capabilities");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceExternalFencePropertiesKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_external_fence_win32
+    if (!strcmp(name, "vkImportFenceWin32HandleKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_external_fence_win32");
+        return hasExt ? (void*)entry_vkImportFenceWin32HandleKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetFenceWin32HandleKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_external_fence_win32");
+        return hasExt ? (void*)entry_vkGetFenceWin32HandleKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_external_fence_fd
+    if (!strcmp(name, "vkImportFenceFdKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_external_fence_fd");
+        return hasExt ? (void*)entry_vkImportFenceFdKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetFenceFdKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_external_fence_fd");
+        return hasExt ? (void*)entry_vkGetFenceFdKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_performance_query
+    if (!strcmp(name, "vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_performance_query");
+        return hasExt ? (void*)entry_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR
+                      : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_performance_query");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR
+                      : nullptr;
+    }
+    if (!strcmp(name, "vkAcquireProfilingLockKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_performance_query");
+        return hasExt ? (void*)entry_vkAcquireProfilingLockKHR : nullptr;
+    }
+    if (!strcmp(name, "vkReleaseProfilingLockKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_performance_query");
+        return hasExt ? (void*)entry_vkReleaseProfilingLockKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_get_surface_capabilities2
+    if (!strcmp(name, "vkGetPhysicalDeviceSurfaceCapabilities2KHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_get_surface_capabilities2");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceSurfaceCapabilities2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceSurfaceFormats2KHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_get_surface_capabilities2");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceSurfaceFormats2KHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_get_display_properties2
+    if (!strcmp(name, "vkGetPhysicalDeviceDisplayProperties2KHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_get_display_properties2");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceDisplayProperties2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceDisplayPlaneProperties2KHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_get_display_properties2");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceDisplayPlaneProperties2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetDisplayModeProperties2KHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_get_display_properties2");
+        return hasExt ? (void*)entry_vkGetDisplayModeProperties2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetDisplayPlaneCapabilities2KHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_get_display_properties2");
+        return hasExt ? (void*)entry_vkGetDisplayPlaneCapabilities2KHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_get_memory_requirements2
+    if (!strcmp(name, "vkGetImageMemoryRequirements2KHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_get_memory_requirements2");
+        return hasExt ? (void*)entry_vkGetImageMemoryRequirements2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetBufferMemoryRequirements2KHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_get_memory_requirements2");
+        return hasExt ? (void*)entry_vkGetBufferMemoryRequirements2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetImageSparseMemoryRequirements2KHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_get_memory_requirements2");
+        return hasExt ? (void*)entry_vkGetImageSparseMemoryRequirements2KHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_sampler_ycbcr_conversion
+    if (!strcmp(name, "vkCreateSamplerYcbcrConversionKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_sampler_ycbcr_conversion");
+        return hasExt ? (void*)entry_vkCreateSamplerYcbcrConversionKHR : nullptr;
+    }
+    if (!strcmp(name, "vkDestroySamplerYcbcrConversionKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_sampler_ycbcr_conversion");
+        return hasExt ? (void*)entry_vkDestroySamplerYcbcrConversionKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_bind_memory2
+    if (!strcmp(name, "vkBindBufferMemory2KHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_bind_memory2");
+        return hasExt ? (void*)entry_vkBindBufferMemory2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkBindImageMemory2KHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_bind_memory2");
+        return hasExt ? (void*)entry_vkBindImageMemory2KHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_maintenance3
+    if (!strcmp(name, "vkGetDescriptorSetLayoutSupportKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_maintenance3");
+        return hasExt ? (void*)entry_vkGetDescriptorSetLayoutSupportKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_draw_indirect_count
+    if (!strcmp(name, "vkCmdDrawIndirectCountKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_draw_indirect_count");
+        return hasExt ? (void*)entry_vkCmdDrawIndirectCountKHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdDrawIndexedIndirectCountKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_draw_indirect_count");
+        return hasExt ? (void*)entry_vkCmdDrawIndexedIndirectCountKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_timeline_semaphore
+    if (!strcmp(name, "vkGetSemaphoreCounterValueKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_timeline_semaphore");
+        return hasExt ? (void*)entry_vkGetSemaphoreCounterValueKHR : nullptr;
+    }
+    if (!strcmp(name, "vkWaitSemaphoresKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_timeline_semaphore");
+        return hasExt ? (void*)entry_vkWaitSemaphoresKHR : nullptr;
+    }
+    if (!strcmp(name, "vkSignalSemaphoreKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_timeline_semaphore");
+        return hasExt ? (void*)entry_vkSignalSemaphoreKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+    if (!strcmp(name, "vkGetPhysicalDeviceFragmentShadingRatesKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_fragment_shading_rate");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceFragmentShadingRatesKHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetFragmentShadingRateKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_fragment_shading_rate");
+        return hasExt ? (void*)entry_vkCmdSetFragmentShadingRateKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_present_wait
+    if (!strcmp(name, "vkWaitForPresentKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_present_wait");
+        return hasExt ? (void*)entry_vkWaitForPresentKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_buffer_device_address
+    if (!strcmp(name, "vkGetBufferDeviceAddressKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_buffer_device_address");
+        return hasExt ? (void*)entry_vkGetBufferDeviceAddressKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetBufferOpaqueCaptureAddressKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_buffer_device_address");
+        return hasExt ? (void*)entry_vkGetBufferOpaqueCaptureAddressKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetDeviceMemoryOpaqueCaptureAddressKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_buffer_device_address");
+        return hasExt ? (void*)entry_vkGetDeviceMemoryOpaqueCaptureAddressKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_deferred_host_operations
+    if (!strcmp(name, "vkCreateDeferredOperationKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_deferred_host_operations");
+        return hasExt ? (void*)entry_vkCreateDeferredOperationKHR : nullptr;
+    }
+    if (!strcmp(name, "vkDestroyDeferredOperationKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_deferred_host_operations");
+        return hasExt ? (void*)entry_vkDestroyDeferredOperationKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetDeferredOperationMaxConcurrencyKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_deferred_host_operations");
+        return hasExt ? (void*)entry_vkGetDeferredOperationMaxConcurrencyKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetDeferredOperationResultKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_deferred_host_operations");
+        return hasExt ? (void*)entry_vkGetDeferredOperationResultKHR : nullptr;
+    }
+    if (!strcmp(name, "vkDeferredOperationJoinKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_deferred_host_operations");
+        return hasExt ? (void*)entry_vkDeferredOperationJoinKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+    if (!strcmp(name, "vkGetPipelineExecutablePropertiesKHR")) {
+        bool hasExt =
+            resources->hasDeviceExtension(device, "VK_KHR_pipeline_executable_properties");
+        return hasExt ? (void*)entry_vkGetPipelineExecutablePropertiesKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPipelineExecutableStatisticsKHR")) {
+        bool hasExt =
+            resources->hasDeviceExtension(device, "VK_KHR_pipeline_executable_properties");
+        return hasExt ? (void*)entry_vkGetPipelineExecutableStatisticsKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetPipelineExecutableInternalRepresentationsKHR")) {
+        bool hasExt =
+            resources->hasDeviceExtension(device, "VK_KHR_pipeline_executable_properties");
+        return hasExt ? (void*)entry_vkGetPipelineExecutableInternalRepresentationsKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_video_encode_queue
+    if (!strcmp(name, "vkCmdEncodeVideoKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_video_encode_queue");
+        return hasExt ? (void*)entry_vkCmdEncodeVideoKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_synchronization2
+    if (!strcmp(name, "vkCmdSetEvent2KHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_synchronization2");
+        return hasExt ? (void*)entry_vkCmdSetEvent2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdResetEvent2KHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_synchronization2");
+        return hasExt ? (void*)entry_vkCmdResetEvent2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdWaitEvents2KHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_synchronization2");
+        return hasExt ? (void*)entry_vkCmdWaitEvents2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdPipelineBarrier2KHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_synchronization2");
+        return hasExt ? (void*)entry_vkCmdPipelineBarrier2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdWriteTimestamp2KHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_synchronization2");
+        return hasExt ? (void*)entry_vkCmdWriteTimestamp2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkQueueSubmit2KHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_synchronization2");
+        return hasExt ? (void*)entry_vkQueueSubmit2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdWriteBufferMarker2AMD")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_synchronization2");
+        return hasExt ? (void*)entry_vkCmdWriteBufferMarker2AMD : nullptr;
+    }
+    if (!strcmp(name, "vkGetQueueCheckpointData2NV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_synchronization2");
+        return hasExt ? (void*)entry_vkGetQueueCheckpointData2NV : nullptr;
+    }
+#endif
+#ifdef VK_KHR_copy_commands2
+    if (!strcmp(name, "vkCmdCopyBuffer2KHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_copy_commands2");
+        return hasExt ? (void*)entry_vkCmdCopyBuffer2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdCopyImage2KHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_copy_commands2");
+        return hasExt ? (void*)entry_vkCmdCopyImage2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdCopyBufferToImage2KHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_copy_commands2");
+        return hasExt ? (void*)entry_vkCmdCopyBufferToImage2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdCopyImageToBuffer2KHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_copy_commands2");
+        return hasExt ? (void*)entry_vkCmdCopyImageToBuffer2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdBlitImage2KHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_copy_commands2");
+        return hasExt ? (void*)entry_vkCmdBlitImage2KHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdResolveImage2KHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_copy_commands2");
+        return hasExt ? (void*)entry_vkCmdResolveImage2KHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_maintenance4
+    if (!strcmp(name, "vkGetDeviceBufferMemoryRequirementsKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_maintenance4");
+        return hasExt ? (void*)entry_vkGetDeviceBufferMemoryRequirementsKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetDeviceImageMemoryRequirementsKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_maintenance4");
+        return hasExt ? (void*)entry_vkGetDeviceImageMemoryRequirementsKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetDeviceImageSparseMemoryRequirementsKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_maintenance4");
+        return hasExt ? (void*)entry_vkGetDeviceImageSparseMemoryRequirementsKHR : nullptr;
+    }
+#endif
+#ifdef VK_ANDROID_native_buffer
+    if (!strcmp(name, "vkGetSwapchainGrallocUsageANDROID")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_ANDROID_native_buffer");
+        return hasExt ? (void*)entry_vkGetSwapchainGrallocUsageANDROID : nullptr;
+    }
+    if (!strcmp(name, "vkAcquireImageANDROID")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_ANDROID_native_buffer");
+        return hasExt ? (void*)entry_vkAcquireImageANDROID : nullptr;
+    }
+    if (!strcmp(name, "vkQueueSignalReleaseImageANDROID")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_ANDROID_native_buffer");
+        return hasExt ? (void*)entry_vkQueueSignalReleaseImageANDROID : nullptr;
+    }
+#endif
+#ifdef VK_EXT_debug_report
+    if (!strcmp(name, "vkCreateDebugReportCallbackEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_debug_report");
+        return hasExt ? (void*)entry_vkCreateDebugReportCallbackEXT : nullptr;
+    }
+    if (!strcmp(name, "vkDestroyDebugReportCallbackEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_debug_report");
+        return hasExt ? (void*)entry_vkDestroyDebugReportCallbackEXT : nullptr;
+    }
+    if (!strcmp(name, "vkDebugReportMessageEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_debug_report");
+        return hasExt ? (void*)entry_vkDebugReportMessageEXT : nullptr;
+    }
+#endif
+#ifdef VK_EXT_debug_marker
+    if (!strcmp(name, "vkDebugMarkerSetObjectTagEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_debug_marker");
+        return hasExt ? (void*)entry_vkDebugMarkerSetObjectTagEXT : nullptr;
+    }
+    if (!strcmp(name, "vkDebugMarkerSetObjectNameEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_debug_marker");
+        return hasExt ? (void*)entry_vkDebugMarkerSetObjectNameEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdDebugMarkerBeginEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_debug_marker");
+        return hasExt ? (void*)entry_vkCmdDebugMarkerBeginEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdDebugMarkerEndEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_debug_marker");
+        return hasExt ? (void*)entry_vkCmdDebugMarkerEndEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdDebugMarkerInsertEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_debug_marker");
+        return hasExt ? (void*)entry_vkCmdDebugMarkerInsertEXT : nullptr;
+    }
+#endif
+#ifdef VK_EXT_transform_feedback
+    if (!strcmp(name, "vkCmdBindTransformFeedbackBuffersEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_transform_feedback");
+        return hasExt ? (void*)entry_vkCmdBindTransformFeedbackBuffersEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdBeginTransformFeedbackEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_transform_feedback");
+        return hasExt ? (void*)entry_vkCmdBeginTransformFeedbackEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdEndTransformFeedbackEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_transform_feedback");
+        return hasExt ? (void*)entry_vkCmdEndTransformFeedbackEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdBeginQueryIndexedEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_transform_feedback");
+        return hasExt ? (void*)entry_vkCmdBeginQueryIndexedEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdEndQueryIndexedEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_transform_feedback");
+        return hasExt ? (void*)entry_vkCmdEndQueryIndexedEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdDrawIndirectByteCountEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_transform_feedback");
+        return hasExt ? (void*)entry_vkCmdDrawIndirectByteCountEXT : nullptr;
+    }
+#endif
+#ifdef VK_NVX_binary_import
+    if (!strcmp(name, "vkCreateCuModuleNVX")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NVX_binary_import");
+        return hasExt ? (void*)entry_vkCreateCuModuleNVX : nullptr;
+    }
+    if (!strcmp(name, "vkCreateCuFunctionNVX")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NVX_binary_import");
+        return hasExt ? (void*)entry_vkCreateCuFunctionNVX : nullptr;
+    }
+    if (!strcmp(name, "vkDestroyCuModuleNVX")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NVX_binary_import");
+        return hasExt ? (void*)entry_vkDestroyCuModuleNVX : nullptr;
+    }
+    if (!strcmp(name, "vkDestroyCuFunctionNVX")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NVX_binary_import");
+        return hasExt ? (void*)entry_vkDestroyCuFunctionNVX : nullptr;
+    }
+    if (!strcmp(name, "vkCmdCuLaunchKernelNVX")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NVX_binary_import");
+        return hasExt ? (void*)entry_vkCmdCuLaunchKernelNVX : nullptr;
+    }
+#endif
+#ifdef VK_NVX_image_view_handle
+    if (!strcmp(name, "vkGetImageViewHandleNVX")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NVX_image_view_handle");
+        return hasExt ? (void*)entry_vkGetImageViewHandleNVX : nullptr;
+    }
+    if (!strcmp(name, "vkGetImageViewAddressNVX")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NVX_image_view_handle");
+        return hasExt ? (void*)entry_vkGetImageViewAddressNVX : nullptr;
+    }
+#endif
+#ifdef VK_AMD_draw_indirect_count
+    if (!strcmp(name, "vkCmdDrawIndirectCountAMD")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_AMD_draw_indirect_count");
+        return hasExt ? (void*)entry_vkCmdDrawIndirectCountAMD : nullptr;
+    }
+    if (!strcmp(name, "vkCmdDrawIndexedIndirectCountAMD")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_AMD_draw_indirect_count");
+        return hasExt ? (void*)entry_vkCmdDrawIndexedIndirectCountAMD : nullptr;
+    }
+#endif
+#ifdef VK_AMD_shader_info
+    if (!strcmp(name, "vkGetShaderInfoAMD")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_AMD_shader_info");
+        return hasExt ? (void*)entry_vkGetShaderInfoAMD : nullptr;
+    }
+#endif
+#ifdef VK_GGP_stream_descriptor_surface
+    if (!strcmp(name, "vkCreateStreamDescriptorSurfaceGGP")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_GGP_stream_descriptor_surface");
+        return hasExt ? (void*)entry_vkCreateStreamDescriptorSurfaceGGP : nullptr;
+    }
+#endif
+#ifdef VK_NV_external_memory_capabilities
+    if (!strcmp(name, "vkGetPhysicalDeviceExternalImageFormatPropertiesNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_external_memory_capabilities");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceExternalImageFormatPropertiesNV : nullptr;
+    }
+#endif
+#ifdef VK_NV_external_memory_win32
+    if (!strcmp(name, "vkGetMemoryWin32HandleNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_external_memory_win32");
+        return hasExt ? (void*)entry_vkGetMemoryWin32HandleNV : nullptr;
+    }
+#endif
+#ifdef VK_NN_vi_surface
+    if (!strcmp(name, "vkCreateViSurfaceNN")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NN_vi_surface");
+        return hasExt ? (void*)entry_vkCreateViSurfaceNN : nullptr;
+    }
+#endif
+#ifdef VK_EXT_conditional_rendering
+    if (!strcmp(name, "vkCmdBeginConditionalRenderingEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_conditional_rendering");
+        return hasExt ? (void*)entry_vkCmdBeginConditionalRenderingEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdEndConditionalRenderingEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_conditional_rendering");
+        return hasExt ? (void*)entry_vkCmdEndConditionalRenderingEXT : nullptr;
+    }
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+    if (!strcmp(name, "vkCmdSetViewportWScalingNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_clip_space_w_scaling");
+        return hasExt ? (void*)entry_vkCmdSetViewportWScalingNV : nullptr;
+    }
+#endif
+#ifdef VK_EXT_direct_mode_display
+    if (!strcmp(name, "vkReleaseDisplayEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_direct_mode_display");
+        return hasExt ? (void*)entry_vkReleaseDisplayEXT : nullptr;
+    }
+#endif
+#ifdef VK_EXT_acquire_xlib_display
+    if (!strcmp(name, "vkAcquireXlibDisplayEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_acquire_xlib_display");
+        return hasExt ? (void*)entry_vkAcquireXlibDisplayEXT : nullptr;
+    }
+    if (!strcmp(name, "vkGetRandROutputDisplayEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_acquire_xlib_display");
+        return hasExt ? (void*)entry_vkGetRandROutputDisplayEXT : nullptr;
+    }
+#endif
+#ifdef VK_EXT_display_surface_counter
+    if (!strcmp(name, "vkGetPhysicalDeviceSurfaceCapabilities2EXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_display_surface_counter");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceSurfaceCapabilities2EXT : nullptr;
+    }
+#endif
+#ifdef VK_EXT_display_control
+    if (!strcmp(name, "vkDisplayPowerControlEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_display_control");
+        return hasExt ? (void*)entry_vkDisplayPowerControlEXT : nullptr;
+    }
+    if (!strcmp(name, "vkRegisterDeviceEventEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_display_control");
+        return hasExt ? (void*)entry_vkRegisterDeviceEventEXT : nullptr;
+    }
+    if (!strcmp(name, "vkRegisterDisplayEventEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_display_control");
+        return hasExt ? (void*)entry_vkRegisterDisplayEventEXT : nullptr;
+    }
+    if (!strcmp(name, "vkGetSwapchainCounterEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_display_control");
+        return hasExt ? (void*)entry_vkGetSwapchainCounterEXT : nullptr;
+    }
+#endif
+#ifdef VK_GOOGLE_display_timing
+    if (!strcmp(name, "vkGetRefreshCycleDurationGOOGLE")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_GOOGLE_display_timing");
+        return hasExt ? (void*)entry_vkGetRefreshCycleDurationGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkGetPastPresentationTimingGOOGLE")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_GOOGLE_display_timing");
+        return hasExt ? (void*)entry_vkGetPastPresentationTimingGOOGLE : nullptr;
+    }
+#endif
+#ifdef VK_EXT_discard_rectangles
+    if (!strcmp(name, "vkCmdSetDiscardRectangleEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_discard_rectangles");
+        return hasExt ? (void*)entry_vkCmdSetDiscardRectangleEXT : nullptr;
+    }
+#endif
+#ifdef VK_EXT_hdr_metadata
+    if (!strcmp(name, "vkSetHdrMetadataEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_hdr_metadata");
+        return hasExt ? (void*)entry_vkSetHdrMetadataEXT : nullptr;
+    }
+#endif
+#ifdef VK_MVK_ios_surface
+    if (!strcmp(name, "vkCreateIOSSurfaceMVK")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_MVK_ios_surface");
+        return hasExt ? (void*)entry_vkCreateIOSSurfaceMVK : nullptr;
+    }
+#endif
+#ifdef VK_MVK_macos_surface
+    if (!strcmp(name, "vkCreateMacOSSurfaceMVK")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_MVK_macos_surface");
+        return hasExt ? (void*)entry_vkCreateMacOSSurfaceMVK : nullptr;
+    }
+#endif
+#ifdef VK_MVK_moltenvk
+    if (!strcmp(name, "vkGetMTLDeviceMVK")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_MVK_moltenvk");
+        return hasExt ? (void*)entry_vkGetMTLDeviceMVK : nullptr;
+    }
+    if (!strcmp(name, "vkSetMTLTextureMVK")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_MVK_moltenvk");
+        return hasExt ? (void*)entry_vkSetMTLTextureMVK : nullptr;
+    }
+    if (!strcmp(name, "vkGetMTLTextureMVK")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_MVK_moltenvk");
+        return hasExt ? (void*)entry_vkGetMTLTextureMVK : nullptr;
+    }
+    if (!strcmp(name, "vkGetMTLBufferMVK")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_MVK_moltenvk");
+        return hasExt ? (void*)entry_vkGetMTLBufferMVK : nullptr;
+    }
+    if (!strcmp(name, "vkUseIOSurfaceMVK")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_MVK_moltenvk");
+        return hasExt ? (void*)entry_vkUseIOSurfaceMVK : nullptr;
+    }
+    if (!strcmp(name, "vkGetIOSurfaceMVK")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_MVK_moltenvk");
+        return hasExt ? (void*)entry_vkGetIOSurfaceMVK : nullptr;
+    }
+#endif
+#ifdef VK_EXT_debug_utils
+    if (!strcmp(name, "vkSetDebugUtilsObjectNameEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_debug_utils");
+        return hasExt ? (void*)entry_vkSetDebugUtilsObjectNameEXT : nullptr;
+    }
+    if (!strcmp(name, "vkSetDebugUtilsObjectTagEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_debug_utils");
+        return hasExt ? (void*)entry_vkSetDebugUtilsObjectTagEXT : nullptr;
+    }
+    if (!strcmp(name, "vkQueueBeginDebugUtilsLabelEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_debug_utils");
+        return hasExt ? (void*)entry_vkQueueBeginDebugUtilsLabelEXT : nullptr;
+    }
+    if (!strcmp(name, "vkQueueEndDebugUtilsLabelEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_debug_utils");
+        return hasExt ? (void*)entry_vkQueueEndDebugUtilsLabelEXT : nullptr;
+    }
+    if (!strcmp(name, "vkQueueInsertDebugUtilsLabelEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_debug_utils");
+        return hasExt ? (void*)entry_vkQueueInsertDebugUtilsLabelEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdBeginDebugUtilsLabelEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_debug_utils");
+        return hasExt ? (void*)entry_vkCmdBeginDebugUtilsLabelEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdEndDebugUtilsLabelEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_debug_utils");
+        return hasExt ? (void*)entry_vkCmdEndDebugUtilsLabelEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdInsertDebugUtilsLabelEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_debug_utils");
+        return hasExt ? (void*)entry_vkCmdInsertDebugUtilsLabelEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCreateDebugUtilsMessengerEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_debug_utils");
+        return hasExt ? (void*)entry_vkCreateDebugUtilsMessengerEXT : nullptr;
+    }
+    if (!strcmp(name, "vkDestroyDebugUtilsMessengerEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_debug_utils");
+        return hasExt ? (void*)entry_vkDestroyDebugUtilsMessengerEXT : nullptr;
+    }
+    if (!strcmp(name, "vkSubmitDebugUtilsMessageEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_debug_utils");
+        return hasExt ? (void*)entry_vkSubmitDebugUtilsMessageEXT : nullptr;
+    }
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+    if (!strcmp(name, "vkGetAndroidHardwareBufferPropertiesANDROID")) {
+        bool hasExt = resources->hasDeviceExtension(
+            device, "VK_ANDROID_external_memory_android_hardware_buffer");
+        return hasExt ? (void*)entry_vkGetAndroidHardwareBufferPropertiesANDROID : nullptr;
+    }
+    if (!strcmp(name, "vkGetMemoryAndroidHardwareBufferANDROID")) {
+        bool hasExt = resources->hasDeviceExtension(
+            device, "VK_ANDROID_external_memory_android_hardware_buffer");
+        return hasExt ? (void*)entry_vkGetMemoryAndroidHardwareBufferANDROID : nullptr;
+    }
+#endif
+#ifdef VK_EXT_sample_locations
+    if (!strcmp(name, "vkCmdSetSampleLocationsEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_sample_locations");
+        return hasExt ? (void*)entry_vkCmdSetSampleLocationsEXT : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceMultisamplePropertiesEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_sample_locations");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceMultisamplePropertiesEXT : nullptr;
+    }
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+    if (!strcmp(name, "vkGetImageDrmFormatModifierPropertiesEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_image_drm_format_modifier");
+        return hasExt ? (void*)entry_vkGetImageDrmFormatModifierPropertiesEXT : nullptr;
+    }
+#endif
+#ifdef VK_EXT_validation_cache
+    if (!strcmp(name, "vkCreateValidationCacheEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_validation_cache");
+        return hasExt ? (void*)entry_vkCreateValidationCacheEXT : nullptr;
+    }
+    if (!strcmp(name, "vkDestroyValidationCacheEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_validation_cache");
+        return hasExt ? (void*)entry_vkDestroyValidationCacheEXT : nullptr;
+    }
+    if (!strcmp(name, "vkMergeValidationCachesEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_validation_cache");
+        return hasExt ? (void*)entry_vkMergeValidationCachesEXT : nullptr;
+    }
+    if (!strcmp(name, "vkGetValidationCacheDataEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_validation_cache");
+        return hasExt ? (void*)entry_vkGetValidationCacheDataEXT : nullptr;
+    }
+#endif
+#ifdef VK_NV_shading_rate_image
+    if (!strcmp(name, "vkCmdBindShadingRateImageNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_shading_rate_image");
+        return hasExt ? (void*)entry_vkCmdBindShadingRateImageNV : nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetViewportShadingRatePaletteNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_shading_rate_image");
+        return hasExt ? (void*)entry_vkCmdSetViewportShadingRatePaletteNV : nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetCoarseSampleOrderNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_shading_rate_image");
+        return hasExt ? (void*)entry_vkCmdSetCoarseSampleOrderNV : nullptr;
+    }
+#endif
+#ifdef VK_NV_ray_tracing
+    if (!strcmp(name, "vkCreateAccelerationStructureNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_ray_tracing");
+        return hasExt ? (void*)entry_vkCreateAccelerationStructureNV : nullptr;
+    }
+    if (!strcmp(name, "vkDestroyAccelerationStructureNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_ray_tracing");
+        return hasExt ? (void*)entry_vkDestroyAccelerationStructureNV : nullptr;
+    }
+    if (!strcmp(name, "vkGetAccelerationStructureMemoryRequirementsNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_ray_tracing");
+        return hasExt ? (void*)entry_vkGetAccelerationStructureMemoryRequirementsNV : nullptr;
+    }
+    if (!strcmp(name, "vkBindAccelerationStructureMemoryNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_ray_tracing");
+        return hasExt ? (void*)entry_vkBindAccelerationStructureMemoryNV : nullptr;
+    }
+    if (!strcmp(name, "vkCmdBuildAccelerationStructureNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_ray_tracing");
+        return hasExt ? (void*)entry_vkCmdBuildAccelerationStructureNV : nullptr;
+    }
+    if (!strcmp(name, "vkCmdCopyAccelerationStructureNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_ray_tracing");
+        return hasExt ? (void*)entry_vkCmdCopyAccelerationStructureNV : nullptr;
+    }
+    if (!strcmp(name, "vkCmdTraceRaysNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_ray_tracing");
+        return hasExt ? (void*)entry_vkCmdTraceRaysNV : nullptr;
+    }
+    if (!strcmp(name, "vkCreateRayTracingPipelinesNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_ray_tracing");
+        return hasExt ? (void*)entry_vkCreateRayTracingPipelinesNV : nullptr;
+    }
+    if (!strcmp(name, "vkGetRayTracingShaderGroupHandlesKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_ray_tracing");
+        return hasExt ? (void*)entry_vkGetRayTracingShaderGroupHandlesKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetRayTracingShaderGroupHandlesNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_ray_tracing");
+        return hasExt ? (void*)entry_vkGetRayTracingShaderGroupHandlesNV : nullptr;
+    }
+    if (!strcmp(name, "vkGetAccelerationStructureHandleNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_ray_tracing");
+        return hasExt ? (void*)entry_vkGetAccelerationStructureHandleNV : nullptr;
+    }
+    if (!strcmp(name, "vkCmdWriteAccelerationStructuresPropertiesNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_ray_tracing");
+        return hasExt ? (void*)entry_vkCmdWriteAccelerationStructuresPropertiesNV : nullptr;
+    }
+    if (!strcmp(name, "vkCompileDeferredNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_ray_tracing");
+        return hasExt ? (void*)entry_vkCompileDeferredNV : nullptr;
+    }
+#endif
+#ifdef VK_EXT_external_memory_host
+    if (!strcmp(name, "vkGetMemoryHostPointerPropertiesEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_external_memory_host");
+        return hasExt ? (void*)entry_vkGetMemoryHostPointerPropertiesEXT : nullptr;
+    }
+#endif
+#ifdef VK_AMD_buffer_marker
+    if (!strcmp(name, "vkCmdWriteBufferMarkerAMD")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_AMD_buffer_marker");
+        return hasExt ? (void*)entry_vkCmdWriteBufferMarkerAMD : nullptr;
+    }
+#endif
+#ifdef VK_EXT_calibrated_timestamps
+    if (!strcmp(name, "vkGetPhysicalDeviceCalibrateableTimeDomainsEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_calibrated_timestamps");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT : nullptr;
+    }
+    if (!strcmp(name, "vkGetCalibratedTimestampsEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_calibrated_timestamps");
+        return hasExt ? (void*)entry_vkGetCalibratedTimestampsEXT : nullptr;
+    }
+#endif
+#ifdef VK_NV_mesh_shader
+    if (!strcmp(name, "vkCmdDrawMeshTasksNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_mesh_shader");
+        return hasExt ? (void*)entry_vkCmdDrawMeshTasksNV : nullptr;
+    }
+    if (!strcmp(name, "vkCmdDrawMeshTasksIndirectNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_mesh_shader");
+        return hasExt ? (void*)entry_vkCmdDrawMeshTasksIndirectNV : nullptr;
+    }
+    if (!strcmp(name, "vkCmdDrawMeshTasksIndirectCountNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_mesh_shader");
+        return hasExt ? (void*)entry_vkCmdDrawMeshTasksIndirectCountNV : nullptr;
+    }
+#endif
+#ifdef VK_NV_scissor_exclusive
+    if (!strcmp(name, "vkCmdSetExclusiveScissorNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_scissor_exclusive");
+        return hasExt ? (void*)entry_vkCmdSetExclusiveScissorNV : nullptr;
+    }
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+    if (!strcmp(name, "vkCmdSetCheckpointNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_device_diagnostic_checkpoints");
+        return hasExt ? (void*)entry_vkCmdSetCheckpointNV : nullptr;
+    }
+    if (!strcmp(name, "vkGetQueueCheckpointDataNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_device_diagnostic_checkpoints");
+        return hasExt ? (void*)entry_vkGetQueueCheckpointDataNV : nullptr;
+    }
+#endif
+#ifdef VK_INTEL_performance_query
+    if (!strcmp(name, "vkInitializePerformanceApiINTEL")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_INTEL_performance_query");
+        return hasExt ? (void*)entry_vkInitializePerformanceApiINTEL : nullptr;
+    }
+    if (!strcmp(name, "vkUninitializePerformanceApiINTEL")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_INTEL_performance_query");
+        return hasExt ? (void*)entry_vkUninitializePerformanceApiINTEL : nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetPerformanceMarkerINTEL")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_INTEL_performance_query");
+        return hasExt ? (void*)entry_vkCmdSetPerformanceMarkerINTEL : nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetPerformanceStreamMarkerINTEL")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_INTEL_performance_query");
+        return hasExt ? (void*)entry_vkCmdSetPerformanceStreamMarkerINTEL : nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetPerformanceOverrideINTEL")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_INTEL_performance_query");
+        return hasExt ? (void*)entry_vkCmdSetPerformanceOverrideINTEL : nullptr;
+    }
+    if (!strcmp(name, "vkAcquirePerformanceConfigurationINTEL")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_INTEL_performance_query");
+        return hasExt ? (void*)entry_vkAcquirePerformanceConfigurationINTEL : nullptr;
+    }
+    if (!strcmp(name, "vkReleasePerformanceConfigurationINTEL")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_INTEL_performance_query");
+        return hasExt ? (void*)entry_vkReleasePerformanceConfigurationINTEL : nullptr;
+    }
+    if (!strcmp(name, "vkQueueSetPerformanceConfigurationINTEL")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_INTEL_performance_query");
+        return hasExt ? (void*)entry_vkQueueSetPerformanceConfigurationINTEL : nullptr;
+    }
+    if (!strcmp(name, "vkGetPerformanceParameterINTEL")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_INTEL_performance_query");
+        return hasExt ? (void*)entry_vkGetPerformanceParameterINTEL : nullptr;
+    }
+#endif
+#ifdef VK_AMD_display_native_hdr
+    if (!strcmp(name, "vkSetLocalDimmingAMD")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_AMD_display_native_hdr");
+        return hasExt ? (void*)entry_vkSetLocalDimmingAMD : nullptr;
+    }
+#endif
+#ifdef VK_FUCHSIA_imagepipe_surface
+    if (!strcmp(name, "vkCreateImagePipeSurfaceFUCHSIA")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_FUCHSIA_imagepipe_surface");
+        return hasExt ? (void*)entry_vkCreateImagePipeSurfaceFUCHSIA : nullptr;
+    }
+#endif
+#ifdef VK_EXT_metal_surface
+    if (!strcmp(name, "vkCreateMetalSurfaceEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_metal_surface");
+        return hasExt ? (void*)entry_vkCreateMetalSurfaceEXT : nullptr;
+    }
+#endif
+#ifdef VK_EXT_buffer_device_address
+    if (!strcmp(name, "vkGetBufferDeviceAddressEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_buffer_device_address");
+        return hasExt ? (void*)entry_vkGetBufferDeviceAddressEXT : nullptr;
+    }
+#endif
+#ifdef VK_EXT_tooling_info
+    if (!strcmp(name, "vkGetPhysicalDeviceToolPropertiesEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_tooling_info");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceToolPropertiesEXT : nullptr;
+    }
+#endif
+#ifdef VK_NV_cooperative_matrix
+    if (!strcmp(name, "vkGetPhysicalDeviceCooperativeMatrixPropertiesNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_cooperative_matrix");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV : nullptr;
+    }
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+    if (!strcmp(name, "vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_coverage_reduction_mode");
+        return hasExt
+                   ? (void*)entry_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV
+                   : nullptr;
+    }
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+    if (!strcmp(name, "vkGetPhysicalDeviceSurfacePresentModes2EXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_full_screen_exclusive");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceSurfacePresentModes2EXT : nullptr;
+    }
+    if (!strcmp(name, "vkAcquireFullScreenExclusiveModeEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_full_screen_exclusive");
+        return hasExt ? (void*)entry_vkAcquireFullScreenExclusiveModeEXT : nullptr;
+    }
+    if (!strcmp(name, "vkReleaseFullScreenExclusiveModeEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_full_screen_exclusive");
+        return hasExt ? (void*)entry_vkReleaseFullScreenExclusiveModeEXT : nullptr;
+    }
+    if (!strcmp(name, "vkGetDeviceGroupSurfacePresentModes2EXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_full_screen_exclusive");
+        return hasExt ? (void*)entry_vkGetDeviceGroupSurfacePresentModes2EXT : nullptr;
+    }
+#endif
+#ifdef VK_EXT_headless_surface
+    if (!strcmp(name, "vkCreateHeadlessSurfaceEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_headless_surface");
+        return hasExt ? (void*)entry_vkCreateHeadlessSurfaceEXT : nullptr;
+    }
+#endif
+#ifdef VK_EXT_line_rasterization
+    if (!strcmp(name, "vkCmdSetLineStippleEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_line_rasterization");
+        return hasExt ? (void*)entry_vkCmdSetLineStippleEXT : nullptr;
+    }
+#endif
+#ifdef VK_EXT_host_query_reset
+    if (!strcmp(name, "vkResetQueryPoolEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_host_query_reset");
+        return hasExt ? (void*)entry_vkResetQueryPoolEXT : nullptr;
+    }
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+    if (!strcmp(name, "vkCmdSetCullModeEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state");
+        return hasExt ? (void*)entry_vkCmdSetCullModeEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetFrontFaceEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state");
+        return hasExt ? (void*)entry_vkCmdSetFrontFaceEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetPrimitiveTopologyEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state");
+        return hasExt ? (void*)entry_vkCmdSetPrimitiveTopologyEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetViewportWithCountEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state");
+        return hasExt ? (void*)entry_vkCmdSetViewportWithCountEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetScissorWithCountEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state");
+        return hasExt ? (void*)entry_vkCmdSetScissorWithCountEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdBindVertexBuffers2EXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state");
+        return hasExt ? (void*)entry_vkCmdBindVertexBuffers2EXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetDepthTestEnableEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state");
+        return hasExt ? (void*)entry_vkCmdSetDepthTestEnableEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetDepthWriteEnableEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state");
+        return hasExt ? (void*)entry_vkCmdSetDepthWriteEnableEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetDepthCompareOpEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state");
+        return hasExt ? (void*)entry_vkCmdSetDepthCompareOpEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetDepthBoundsTestEnableEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state");
+        return hasExt ? (void*)entry_vkCmdSetDepthBoundsTestEnableEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetStencilTestEnableEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state");
+        return hasExt ? (void*)entry_vkCmdSetStencilTestEnableEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetStencilOpEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state");
+        return hasExt ? (void*)entry_vkCmdSetStencilOpEXT : nullptr;
+    }
+#endif
+#ifdef VK_NV_device_generated_commands
+    if (!strcmp(name, "vkGetGeneratedCommandsMemoryRequirementsNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_device_generated_commands");
+        return hasExt ? (void*)entry_vkGetGeneratedCommandsMemoryRequirementsNV : nullptr;
+    }
+    if (!strcmp(name, "vkCmdPreprocessGeneratedCommandsNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_device_generated_commands");
+        return hasExt ? (void*)entry_vkCmdPreprocessGeneratedCommandsNV : nullptr;
+    }
+    if (!strcmp(name, "vkCmdExecuteGeneratedCommandsNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_device_generated_commands");
+        return hasExt ? (void*)entry_vkCmdExecuteGeneratedCommandsNV : nullptr;
+    }
+    if (!strcmp(name, "vkCmdBindPipelineShaderGroupNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_device_generated_commands");
+        return hasExt ? (void*)entry_vkCmdBindPipelineShaderGroupNV : nullptr;
+    }
+    if (!strcmp(name, "vkCreateIndirectCommandsLayoutNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_device_generated_commands");
+        return hasExt ? (void*)entry_vkCreateIndirectCommandsLayoutNV : nullptr;
+    }
+    if (!strcmp(name, "vkDestroyIndirectCommandsLayoutNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_device_generated_commands");
+        return hasExt ? (void*)entry_vkDestroyIndirectCommandsLayoutNV : nullptr;
+    }
+#endif
+#ifdef VK_EXT_acquire_drm_display
+    if (!strcmp(name, "vkAcquireDrmDisplayEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_acquire_drm_display");
+        return hasExt ? (void*)entry_vkAcquireDrmDisplayEXT : nullptr;
+    }
+    if (!strcmp(name, "vkGetDrmDisplayEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_acquire_drm_display");
+        return hasExt ? (void*)entry_vkGetDrmDisplayEXT : nullptr;
+    }
+#endif
+#ifdef VK_EXT_private_data
+    if (!strcmp(name, "vkCreatePrivateDataSlotEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_private_data");
+        return hasExt ? (void*)entry_vkCreatePrivateDataSlotEXT : nullptr;
+    }
+    if (!strcmp(name, "vkDestroyPrivateDataSlotEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_private_data");
+        return hasExt ? (void*)entry_vkDestroyPrivateDataSlotEXT : nullptr;
+    }
+    if (!strcmp(name, "vkSetPrivateDataEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_private_data");
+        return hasExt ? (void*)entry_vkSetPrivateDataEXT : nullptr;
+    }
+    if (!strcmp(name, "vkGetPrivateDataEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_private_data");
+        return hasExt ? (void*)entry_vkGetPrivateDataEXT : nullptr;
+    }
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+    if (!strcmp(name, "vkCmdSetFragmentShadingRateEnumNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_fragment_shading_rate_enums");
+        return hasExt ? (void*)entry_vkCmdSetFragmentShadingRateEnumNV : nullptr;
+    }
+#endif
+#ifdef VK_NV_acquire_winrt_display
+    if (!strcmp(name, "vkAcquireWinrtDisplayNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_acquire_winrt_display");
+        return hasExt ? (void*)entry_vkAcquireWinrtDisplayNV : nullptr;
+    }
+    if (!strcmp(name, "vkGetWinrtDisplayNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_acquire_winrt_display");
+        return hasExt ? (void*)entry_vkGetWinrtDisplayNV : nullptr;
+    }
+#endif
+#ifdef VK_EXT_directfb_surface
+    if (!strcmp(name, "vkCreateDirectFBSurfaceEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_directfb_surface");
+        return hasExt ? (void*)entry_vkCreateDirectFBSurfaceEXT : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceDirectFBPresentationSupportEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_directfb_surface");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceDirectFBPresentationSupportEXT : nullptr;
+    }
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+    if (!strcmp(name, "vkCmdSetVertexInputEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_vertex_input_dynamic_state");
+        return hasExt ? (void*)entry_vkCmdSetVertexInputEXT : nullptr;
+    }
+#endif
+#ifdef VK_FUCHSIA_external_memory
+    if (!strcmp(name, "vkGetMemoryZirconHandleFUCHSIA")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_FUCHSIA_external_memory");
+        return hasExt ? (void*)entry_vkGetMemoryZirconHandleFUCHSIA : nullptr;
+    }
+    if (!strcmp(name, "vkGetMemoryZirconHandlePropertiesFUCHSIA")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_FUCHSIA_external_memory");
+        return hasExt ? (void*)entry_vkGetMemoryZirconHandlePropertiesFUCHSIA : nullptr;
+    }
+#endif
+#ifdef VK_FUCHSIA_external_semaphore
+    if (!strcmp(name, "vkImportSemaphoreZirconHandleFUCHSIA")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_FUCHSIA_external_semaphore");
+        return hasExt ? (void*)entry_vkImportSemaphoreZirconHandleFUCHSIA : nullptr;
+    }
+    if (!strcmp(name, "vkGetSemaphoreZirconHandleFUCHSIA")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_FUCHSIA_external_semaphore");
+        return hasExt ? (void*)entry_vkGetSemaphoreZirconHandleFUCHSIA : nullptr;
+    }
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+    if (!strcmp(name, "vkCreateBufferCollectionFUCHSIA")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_FUCHSIA_buffer_collection");
+        return hasExt ? (void*)entry_vkCreateBufferCollectionFUCHSIA : nullptr;
+    }
+    if (!strcmp(name, "vkSetBufferCollectionImageConstraintsFUCHSIA")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_FUCHSIA_buffer_collection");
+        return hasExt ? (void*)entry_vkSetBufferCollectionImageConstraintsFUCHSIA : nullptr;
+    }
+    if (!strcmp(name, "vkSetBufferCollectionBufferConstraintsFUCHSIA")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_FUCHSIA_buffer_collection");
+        return hasExt ? (void*)entry_vkSetBufferCollectionBufferConstraintsFUCHSIA : nullptr;
+    }
+    if (!strcmp(name, "vkDestroyBufferCollectionFUCHSIA")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_FUCHSIA_buffer_collection");
+        return hasExt ? (void*)entry_vkDestroyBufferCollectionFUCHSIA : nullptr;
+    }
+    if (!strcmp(name, "vkGetBufferCollectionPropertiesFUCHSIA")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_FUCHSIA_buffer_collection");
+        return hasExt ? (void*)entry_vkGetBufferCollectionPropertiesFUCHSIA : nullptr;
+    }
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+    if (!strcmp(name, "vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_HUAWEI_subpass_shading");
+        return hasExt ? (void*)entry_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI : nullptr;
+    }
+    if (!strcmp(name, "vkCmdSubpassShadingHUAWEI")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_HUAWEI_subpass_shading");
+        return hasExt ? (void*)entry_vkCmdSubpassShadingHUAWEI : nullptr;
+    }
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+    if (!strcmp(name, "vkCmdBindInvocationMaskHUAWEI")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_HUAWEI_invocation_mask");
+        return hasExt ? (void*)entry_vkCmdBindInvocationMaskHUAWEI : nullptr;
+    }
+#endif
+#ifdef VK_NV_external_memory_rdma
+    if (!strcmp(name, "vkGetMemoryRemoteAddressNV")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_NV_external_memory_rdma");
+        return hasExt ? (void*)entry_vkGetMemoryRemoteAddressNV : nullptr;
+    }
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+    if (!strcmp(name, "vkCmdSetPatchControlPointsEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state2");
+        return hasExt ? (void*)entry_vkCmdSetPatchControlPointsEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetRasterizerDiscardEnableEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state2");
+        return hasExt ? (void*)entry_vkCmdSetRasterizerDiscardEnableEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetDepthBiasEnableEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state2");
+        return hasExt ? (void*)entry_vkCmdSetDepthBiasEnableEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetLogicOpEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state2");
+        return hasExt ? (void*)entry_vkCmdSetLogicOpEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetPrimitiveRestartEnableEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_extended_dynamic_state2");
+        return hasExt ? (void*)entry_vkCmdSetPrimitiveRestartEnableEXT : nullptr;
+    }
+#endif
+#ifdef VK_QNX_screen_surface
+    if (!strcmp(name, "vkCreateScreenSurfaceQNX")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_QNX_screen_surface");
+        return hasExt ? (void*)entry_vkCreateScreenSurfaceQNX : nullptr;
+    }
+    if (!strcmp(name, "vkGetPhysicalDeviceScreenPresentationSupportQNX")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_QNX_screen_surface");
+        return hasExt ? (void*)entry_vkGetPhysicalDeviceScreenPresentationSupportQNX : nullptr;
+    }
+#endif
+#ifdef VK_EXT_color_write_enable
+    if (!strcmp(name, "vkCmdSetColorWriteEnableEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_color_write_enable");
+        return hasExt ? (void*)entry_vkCmdSetColorWriteEnableEXT : nullptr;
+    }
+#endif
+#ifdef VK_GOOGLE_gfxstream
+    if (!strcmp(name, "vkMapMemoryIntoAddressSpaceGOOGLE")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkMapMemoryIntoAddressSpaceGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkUpdateDescriptorSetWithTemplateSizedGOOGLE")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkUpdateDescriptorSetWithTemplateSizedGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkBeginCommandBufferAsyncGOOGLE")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkBeginCommandBufferAsyncGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkEndCommandBufferAsyncGOOGLE")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkEndCommandBufferAsyncGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkResetCommandBufferAsyncGOOGLE")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkResetCommandBufferAsyncGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkCommandBufferHostSyncGOOGLE")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkCommandBufferHostSyncGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkCreateImageWithRequirementsGOOGLE")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkCreateImageWithRequirementsGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkCreateBufferWithRequirementsGOOGLE")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkCreateBufferWithRequirementsGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkGetMemoryHostAddressInfoGOOGLE")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkGetMemoryHostAddressInfoGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkFreeMemorySyncGOOGLE")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkFreeMemorySyncGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkQueueHostSyncGOOGLE")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkQueueHostSyncGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkQueueSubmitAsyncGOOGLE")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkQueueSubmitAsyncGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkQueueWaitIdleAsyncGOOGLE")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkQueueWaitIdleAsyncGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkQueueBindSparseAsyncGOOGLE")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkQueueBindSparseAsyncGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkGetLinearImageLayoutGOOGLE")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkGetLinearImageLayoutGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkGetLinearImageLayout2GOOGLE")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkGetLinearImageLayout2GOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkQueueFlushCommandsGOOGLE")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkQueueFlushCommandsGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkQueueCommitDescriptorSetUpdatesGOOGLE")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkQueueCommitDescriptorSetUpdatesGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkCollectDescriptorPoolIdsGOOGLE")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkCollectDescriptorPoolIdsGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkQueueSignalReleaseImageANDROIDAsyncGOOGLE")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkQueueSignalReleaseImageANDROIDAsyncGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkQueueFlushCommandsFromAuxMemoryGOOGLE")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkQueueFlushCommandsFromAuxMemoryGOOGLE : nullptr;
+    }
+    if (!strcmp(name, "vkGetBlobGOOGLE")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_GOOGLE_gfxstream");
+        return hasExt ? (void*)entry_vkGetBlobGOOGLE : nullptr;
+    }
+#endif
+#ifdef VK_EXT_multi_draw
+    if (!strcmp(name, "vkCmdDrawMultiEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_multi_draw");
+        return hasExt ? (void*)entry_vkCmdDrawMultiEXT : nullptr;
+    }
+    if (!strcmp(name, "vkCmdDrawMultiIndexedEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_multi_draw");
+        return hasExt ? (void*)entry_vkCmdDrawMultiIndexedEXT : nullptr;
+    }
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+    if (!strcmp(name, "vkSetDeviceMemoryPriorityEXT")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_EXT_pageable_device_local_memory");
+        return hasExt ? (void*)entry_vkSetDeviceMemoryPriorityEXT : nullptr;
+    }
+#endif
+#ifdef VK_KHR_acceleration_structure
+    if (!strcmp(name, "vkCreateAccelerationStructureKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure");
+        return hasExt ? (void*)entry_vkCreateAccelerationStructureKHR : nullptr;
+    }
+    if (!strcmp(name, "vkDestroyAccelerationStructureKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure");
+        return hasExt ? (void*)entry_vkDestroyAccelerationStructureKHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdBuildAccelerationStructuresKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure");
+        return hasExt ? (void*)entry_vkCmdBuildAccelerationStructuresKHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdBuildAccelerationStructuresIndirectKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure");
+        return hasExt ? (void*)entry_vkCmdBuildAccelerationStructuresIndirectKHR : nullptr;
+    }
+    if (!strcmp(name, "vkBuildAccelerationStructuresKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure");
+        return hasExt ? (void*)entry_vkBuildAccelerationStructuresKHR : nullptr;
+    }
+    if (!strcmp(name, "vkCopyAccelerationStructureKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure");
+        return hasExt ? (void*)entry_vkCopyAccelerationStructureKHR : nullptr;
+    }
+    if (!strcmp(name, "vkCopyAccelerationStructureToMemoryKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure");
+        return hasExt ? (void*)entry_vkCopyAccelerationStructureToMemoryKHR : nullptr;
+    }
+    if (!strcmp(name, "vkCopyMemoryToAccelerationStructureKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure");
+        return hasExt ? (void*)entry_vkCopyMemoryToAccelerationStructureKHR : nullptr;
+    }
+    if (!strcmp(name, "vkWriteAccelerationStructuresPropertiesKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure");
+        return hasExt ? (void*)entry_vkWriteAccelerationStructuresPropertiesKHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdCopyAccelerationStructureKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure");
+        return hasExt ? (void*)entry_vkCmdCopyAccelerationStructureKHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdCopyAccelerationStructureToMemoryKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure");
+        return hasExt ? (void*)entry_vkCmdCopyAccelerationStructureToMemoryKHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdCopyMemoryToAccelerationStructureKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure");
+        return hasExt ? (void*)entry_vkCmdCopyMemoryToAccelerationStructureKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetAccelerationStructureDeviceAddressKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure");
+        return hasExt ? (void*)entry_vkGetAccelerationStructureDeviceAddressKHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdWriteAccelerationStructuresPropertiesKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure");
+        return hasExt ? (void*)entry_vkCmdWriteAccelerationStructuresPropertiesKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetDeviceAccelerationStructureCompatibilityKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure");
+        return hasExt ? (void*)entry_vkGetDeviceAccelerationStructureCompatibilityKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetAccelerationStructureBuildSizesKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_acceleration_structure");
+        return hasExt ? (void*)entry_vkGetAccelerationStructureBuildSizesKHR : nullptr;
+    }
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+    if (!strcmp(name, "vkCmdTraceRaysKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_ray_tracing_pipeline");
+        return hasExt ? (void*)entry_vkCmdTraceRaysKHR : nullptr;
+    }
+    if (!strcmp(name, "vkCreateRayTracingPipelinesKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_ray_tracing_pipeline");
+        return hasExt ? (void*)entry_vkCreateRayTracingPipelinesKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetRayTracingCaptureReplayShaderGroupHandlesKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_ray_tracing_pipeline");
+        return hasExt ? (void*)entry_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdTraceRaysIndirectKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_ray_tracing_pipeline");
+        return hasExt ? (void*)entry_vkCmdTraceRaysIndirectKHR : nullptr;
+    }
+    if (!strcmp(name, "vkGetRayTracingShaderGroupStackSizeKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_ray_tracing_pipeline");
+        return hasExt ? (void*)entry_vkGetRayTracingShaderGroupStackSizeKHR : nullptr;
+    }
+    if (!strcmp(name, "vkCmdSetRayTracingPipelineStackSizeKHR")) {
+        bool hasExt = resources->hasDeviceExtension(device, "VK_KHR_ray_tracing_pipeline");
+        return hasExt ? (void*)entry_vkCmdSetRayTracingPipelineStackSizeKHR : nullptr;
+    }
+#endif
+    return nullptr;
+}
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/func_table.h b/system/vulkan_enc/func_table.h
new file mode 100644
index 0000000..e9e4005
--- /dev/null
+++ b/system/vulkan_enc/func_table.h
@@ -0,0 +1,586 @@
+// Copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2018 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Autogenerated module func_table
+//
+// (header) generated by codegen/vulkan/scripts/genvk.py -registry codegen/vulkan/xml/vk.xml cereal
+// -o host/vulkan/cereal
+//
+// Please do not modify directly;
+// re-run gfxstream-protocols/scripts/generate-vulkan-sources.sh,
+// or directly from Python by defining:
+// VULKAN_REGISTRY_XML_DIR : Directory containing vk.xml
+// VULKAN_REGISTRY_SCRIPTS_DIR : Directory containing genvk.py
+// CEREAL_OUTPUT_DIR: Where to put the generated sources.
+//
+// python3 $VULKAN_REGISTRY_SCRIPTS_DIR/genvk.py -registry $VULKAN_REGISTRY_XML_DIR/vk.xml cereal -o
+// $CEREAL_OUTPUT_DIR
+//
+#pragma once
+#include <vulkan/vulkan.h>
+
+#include "vulkan_gfxstream.h"
+
+namespace gfxstream {
+namespace vk {
+
+#ifdef VK_VERSION_1_0
+#endif
+#ifdef VK_VERSION_1_1
+#endif
+#ifdef VK_VERSION_1_2
+#endif
+#ifdef VK_KHR_surface
+#endif
+#ifdef VK_KHR_swapchain
+#endif
+#ifdef VK_KHR_display
+#endif
+#ifdef VK_KHR_display_swapchain
+#endif
+#ifdef VK_KHR_xlib_surface
+#endif
+#ifdef VK_KHR_xcb_surface
+#endif
+#ifdef VK_KHR_wayland_surface
+#endif
+#ifdef VK_KHR_android_surface
+#endif
+#ifdef VK_KHR_win32_surface
+#endif
+#ifdef VK_KHR_sampler_mirror_clamp_to_edge
+#endif
+#ifdef VK_KHR_video_queue
+#endif
+#ifdef VK_KHR_video_decode_queue
+#endif
+#ifdef VK_KHR_dynamic_rendering
+#endif
+#ifdef VK_KHR_multiview
+#endif
+#ifdef VK_KHR_get_physical_device_properties2
+#endif
+#ifdef VK_KHR_device_group
+#endif
+#ifdef VK_KHR_shader_draw_parameters
+#endif
+#ifdef VK_KHR_maintenance1
+#endif
+#ifdef VK_KHR_device_group_creation
+#endif
+#ifdef VK_KHR_external_memory_capabilities
+#endif
+#ifdef VK_KHR_external_memory
+#endif
+#ifdef VK_KHR_external_memory_win32
+#endif
+#ifdef VK_KHR_external_memory_fd
+#endif
+#ifdef VK_KHR_win32_keyed_mutex
+#endif
+#ifdef VK_KHR_external_semaphore_capabilities
+#endif
+#ifdef VK_KHR_external_semaphore
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+#endif
+#ifdef VK_KHR_external_semaphore_fd
+#endif
+#ifdef VK_KHR_push_descriptor
+#endif
+#ifdef VK_KHR_shader_float16_int8
+#endif
+#ifdef VK_KHR_16bit_storage
+#endif
+#ifdef VK_KHR_incremental_present
+#endif
+#ifdef VK_KHR_descriptor_update_template
+#endif
+#ifdef VK_KHR_imageless_framebuffer
+#endif
+#ifdef VK_KHR_create_renderpass2
+#endif
+#ifdef VK_KHR_shared_presentable_image
+#endif
+#ifdef VK_KHR_external_fence_capabilities
+#endif
+#ifdef VK_KHR_external_fence
+#endif
+#ifdef VK_KHR_external_fence_win32
+#endif
+#ifdef VK_KHR_external_fence_fd
+#endif
+#ifdef VK_KHR_performance_query
+#endif
+#ifdef VK_KHR_maintenance2
+#endif
+#ifdef VK_KHR_get_surface_capabilities2
+#endif
+#ifdef VK_KHR_variable_pointers
+#endif
+#ifdef VK_KHR_get_display_properties2
+#endif
+#ifdef VK_KHR_dedicated_allocation
+#endif
+#ifdef VK_KHR_storage_buffer_storage_class
+#endif
+#ifdef VK_KHR_relaxed_block_layout
+#endif
+#ifdef VK_KHR_get_memory_requirements2
+#endif
+#ifdef VK_KHR_image_format_list
+#endif
+#ifdef VK_KHR_sampler_ycbcr_conversion
+#endif
+#ifdef VK_KHR_bind_memory2
+#endif
+#ifdef VK_KHR_portability_subset
+#endif
+#ifdef VK_KHR_maintenance3
+#endif
+#ifdef VK_KHR_draw_indirect_count
+#endif
+#ifdef VK_KHR_shader_subgroup_extended_types
+#endif
+#ifdef VK_KHR_8bit_storage
+#endif
+#ifdef VK_KHR_shader_atomic_int64
+#endif
+#ifdef VK_KHR_shader_clock
+#endif
+#ifdef VK_KHR_driver_properties
+#endif
+#ifdef VK_KHR_shader_float_controls
+#endif
+#ifdef VK_KHR_depth_stencil_resolve
+#endif
+#ifdef VK_KHR_swapchain_mutable_format
+#endif
+#ifdef VK_KHR_timeline_semaphore
+#endif
+#ifdef VK_KHR_vulkan_memory_model
+#endif
+#ifdef VK_KHR_shader_terminate_invocation
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+#endif
+#ifdef VK_KHR_spirv_1_4
+#endif
+#ifdef VK_KHR_surface_protected_capabilities
+#endif
+#ifdef VK_KHR_separate_depth_stencil_layouts
+#endif
+#ifdef VK_KHR_present_wait
+#endif
+#ifdef VK_KHR_uniform_buffer_standard_layout
+#endif
+#ifdef VK_KHR_buffer_device_address
+#endif
+#ifdef VK_KHR_deferred_host_operations
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+#endif
+#ifdef VK_KHR_shader_integer_dot_product
+#endif
+#ifdef VK_KHR_pipeline_library
+#endif
+#ifdef VK_KHR_shader_non_semantic_info
+#endif
+#ifdef VK_KHR_present_id
+#endif
+#ifdef VK_KHR_video_encode_queue
+#endif
+#ifdef VK_KHR_synchronization2
+#endif
+#ifdef VK_KHR_shader_subgroup_uniform_control_flow
+#endif
+#ifdef VK_KHR_zero_initialize_workgroup_memory
+#endif
+#ifdef VK_KHR_workgroup_memory_explicit_layout
+#endif
+#ifdef VK_KHR_copy_commands2
+#endif
+#ifdef VK_KHR_format_feature_flags2
+#endif
+#ifdef VK_KHR_maintenance4
+#endif
+#ifdef VK_ANDROID_native_buffer
+#endif
+#ifdef VK_EXT_debug_report
+#endif
+#ifdef VK_NV_glsl_shader
+#endif
+#ifdef VK_EXT_depth_range_unrestricted
+#endif
+#ifdef VK_IMG_filter_cubic
+#endif
+#ifdef VK_AMD_rasterization_order
+#endif
+#ifdef VK_AMD_shader_trinary_minmax
+#endif
+#ifdef VK_AMD_shader_explicit_vertex_parameter
+#endif
+#ifdef VK_EXT_debug_marker
+#endif
+#ifdef VK_AMD_gcn_shader
+#endif
+#ifdef VK_NV_dedicated_allocation
+#endif
+#ifdef VK_EXT_transform_feedback
+#endif
+#ifdef VK_NVX_binary_import
+#endif
+#ifdef VK_NVX_image_view_handle
+#endif
+#ifdef VK_AMD_draw_indirect_count
+#endif
+#ifdef VK_AMD_negative_viewport_height
+#endif
+#ifdef VK_AMD_gpu_shader_half_float
+#endif
+#ifdef VK_AMD_shader_ballot
+#endif
+#ifdef VK_EXT_video_encode_h264
+#endif
+#ifdef VK_EXT_video_encode_h265
+#endif
+#ifdef VK_EXT_video_decode_h264
+#endif
+#ifdef VK_AMD_texture_gather_bias_lod
+#endif
+#ifdef VK_AMD_shader_info
+#endif
+#ifdef VK_AMD_shader_image_load_store_lod
+#endif
+#ifdef VK_GGP_stream_descriptor_surface
+#endif
+#ifdef VK_NV_corner_sampled_image
+#endif
+#ifdef VK_IMG_format_pvrtc
+#endif
+#ifdef VK_NV_external_memory_capabilities
+#endif
+#ifdef VK_NV_external_memory
+#endif
+#ifdef VK_NV_external_memory_win32
+#endif
+#ifdef VK_NV_win32_keyed_mutex
+#endif
+#ifdef VK_EXT_validation_flags
+#endif
+#ifdef VK_NN_vi_surface
+#endif
+#ifdef VK_EXT_shader_subgroup_ballot
+#endif
+#ifdef VK_EXT_shader_subgroup_vote
+#endif
+#ifdef VK_EXT_texture_compression_astc_hdr
+#endif
+#ifdef VK_EXT_astc_decode_mode
+#endif
+#ifdef VK_EXT_conditional_rendering
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+#endif
+#ifdef VK_EXT_direct_mode_display
+#endif
+#ifdef VK_EXT_acquire_xlib_display
+#endif
+#ifdef VK_EXT_display_surface_counter
+#endif
+#ifdef VK_EXT_display_control
+#endif
+#ifdef VK_GOOGLE_display_timing
+#endif
+#ifdef VK_NV_sample_mask_override_coverage
+#endif
+#ifdef VK_NV_geometry_shader_passthrough
+#endif
+#ifdef VK_NV_viewport_array2
+#endif
+#ifdef VK_NVX_multiview_per_view_attributes
+#endif
+#ifdef VK_NV_viewport_swizzle
+#endif
+#ifdef VK_EXT_discard_rectangles
+#endif
+#ifdef VK_EXT_conservative_rasterization
+#endif
+#ifdef VK_EXT_depth_clip_enable
+#endif
+#ifdef VK_EXT_swapchain_colorspace
+#endif
+#ifdef VK_EXT_hdr_metadata
+#endif
+#ifdef VK_MVK_ios_surface
+#endif
+#ifdef VK_MVK_macos_surface
+#endif
+#ifdef VK_MVK_moltenvk
+#endif
+#ifdef VK_EXT_external_memory_dma_buf
+#endif
+#ifdef VK_EXT_queue_family_foreign
+#endif
+#ifdef VK_EXT_debug_utils
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+#endif
+#ifdef VK_EXT_sampler_filter_minmax
+#endif
+#ifdef VK_AMD_gpu_shader_int16
+#endif
+#ifdef VK_AMD_mixed_attachment_samples
+#endif
+#ifdef VK_AMD_shader_fragment_mask
+#endif
+#ifdef VK_EXT_inline_uniform_block
+#endif
+#ifdef VK_EXT_shader_stencil_export
+#endif
+#ifdef VK_EXT_sample_locations
+#endif
+#ifdef VK_EXT_blend_operation_advanced
+#endif
+#ifdef VK_NV_fragment_coverage_to_color
+#endif
+#ifdef VK_NV_framebuffer_mixed_samples
+#endif
+#ifdef VK_NV_fill_rectangle
+#endif
+#ifdef VK_NV_shader_sm_builtins
+#endif
+#ifdef VK_EXT_post_depth_coverage
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+#endif
+#ifdef VK_EXT_validation_cache
+#endif
+#ifdef VK_EXT_descriptor_indexing
+#endif
+#ifdef VK_EXT_shader_viewport_index_layer
+#endif
+#ifdef VK_NV_shading_rate_image
+#endif
+#ifdef VK_NV_ray_tracing
+#endif
+#ifdef VK_NV_representative_fragment_test
+#endif
+#ifdef VK_EXT_filter_cubic
+#endif
+#ifdef VK_QCOM_render_pass_shader_resolve
+#endif
+#ifdef VK_EXT_global_priority
+#endif
+#ifdef VK_EXT_external_memory_host
+#endif
+#ifdef VK_AMD_buffer_marker
+#endif
+#ifdef VK_AMD_pipeline_compiler_control
+#endif
+#ifdef VK_EXT_calibrated_timestamps
+#endif
+#ifdef VK_AMD_shader_core_properties
+#endif
+#ifdef VK_EXT_video_decode_h265
+#endif
+#ifdef VK_AMD_memory_overallocation_behavior
+#endif
+#ifdef VK_EXT_vertex_attribute_divisor
+#endif
+#ifdef VK_GGP_frame_token
+#endif
+#ifdef VK_EXT_pipeline_creation_feedback
+#endif
+#ifdef VK_NV_shader_subgroup_partitioned
+#endif
+#ifdef VK_NV_compute_shader_derivatives
+#endif
+#ifdef VK_NV_mesh_shader
+#endif
+#ifdef VK_NV_fragment_shader_barycentric
+#endif
+#ifdef VK_NV_shader_image_footprint
+#endif
+#ifdef VK_NV_scissor_exclusive
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+#endif
+#ifdef VK_INTEL_shader_integer_functions2
+#endif
+#ifdef VK_INTEL_performance_query
+#endif
+#ifdef VK_EXT_pci_bus_info
+#endif
+#ifdef VK_AMD_display_native_hdr
+#endif
+#ifdef VK_FUCHSIA_imagepipe_surface
+#endif
+#ifdef VK_EXT_metal_surface
+#endif
+#ifdef VK_EXT_fragment_density_map
+#endif
+#ifdef VK_EXT_scalar_block_layout
+#endif
+#ifdef VK_GOOGLE_hlsl_functionality1
+#endif
+#ifdef VK_GOOGLE_decorate_string
+#endif
+#ifdef VK_EXT_subgroup_size_control
+#endif
+#ifdef VK_AMD_shader_core_properties2
+#endif
+#ifdef VK_AMD_device_coherent_memory
+#endif
+#ifdef VK_EXT_shader_image_atomic_int64
+#endif
+#ifdef VK_EXT_memory_budget
+#endif
+#ifdef VK_EXT_memory_priority
+#endif
+#ifdef VK_NV_dedicated_allocation_image_aliasing
+#endif
+#ifdef VK_EXT_buffer_device_address
+#endif
+#ifdef VK_EXT_tooling_info
+#endif
+#ifdef VK_EXT_separate_stencil_usage
+#endif
+#ifdef VK_EXT_validation_features
+#endif
+#ifdef VK_NV_cooperative_matrix
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+#endif
+#ifdef VK_EXT_fragment_shader_interlock
+#endif
+#ifdef VK_EXT_ycbcr_image_arrays
+#endif
+#ifdef VK_EXT_provoking_vertex
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+#endif
+#ifdef VK_EXT_headless_surface
+#endif
+#ifdef VK_EXT_line_rasterization
+#endif
+#ifdef VK_EXT_shader_atomic_float
+#endif
+#ifdef VK_EXT_host_query_reset
+#endif
+#ifdef VK_EXT_index_type_uint8
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+#endif
+#ifdef VK_EXT_shader_atomic_float2
+#endif
+#ifdef VK_EXT_shader_demote_to_helper_invocation
+#endif
+#ifdef VK_NV_device_generated_commands
+#endif
+#ifdef VK_NV_inherited_viewport_scissor
+#endif
+#ifdef VK_EXT_texel_buffer_alignment
+#endif
+#ifdef VK_QCOM_render_pass_transform
+#endif
+#ifdef VK_EXT_device_memory_report
+#endif
+#ifdef VK_EXT_acquire_drm_display
+#endif
+#ifdef VK_EXT_robustness2
+#endif
+#ifdef VK_EXT_custom_border_color
+#endif
+#ifdef VK_GOOGLE_user_type
+#endif
+#ifdef VK_EXT_private_data
+#endif
+#ifdef VK_EXT_pipeline_creation_cache_control
+#endif
+#ifdef VK_NV_device_diagnostics_config
+#endif
+#ifdef VK_QCOM_render_pass_store_ops
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+#endif
+#ifdef VK_NV_ray_tracing_motion_blur
+#endif
+#ifdef VK_EXT_ycbcr_2plane_444_formats
+#endif
+#ifdef VK_EXT_fragment_density_map2
+#endif
+#ifdef VK_QCOM_rotated_copy_commands
+#endif
+#ifdef VK_EXT_image_robustness
+#endif
+#ifdef VK_EXT_4444_formats
+#endif
+#ifdef VK_EXT_rgba10x6_formats
+#endif
+#ifdef VK_NV_acquire_winrt_display
+#endif
+#ifdef VK_EXT_directfb_surface
+#endif
+#ifdef VK_VALVE_mutable_descriptor_type
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+#endif
+#ifdef VK_EXT_physical_device_drm
+#endif
+#ifdef VK_EXT_primitive_topology_list_restart
+#endif
+#ifdef VK_FUCHSIA_external_memory
+#endif
+#ifdef VK_FUCHSIA_external_semaphore
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+#endif
+#ifdef VK_NV_external_memory_rdma
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+#endif
+#ifdef VK_QNX_screen_surface
+#endif
+#ifdef VK_EXT_color_write_enable
+#endif
+#ifdef VK_GOOGLE_gfxstream
+#endif
+#ifdef VK_EXT_global_priority_query
+#endif
+#ifdef VK_EXT_multi_draw
+#endif
+#ifdef VK_EXT_load_store_op_none
+#endif
+#ifdef VK_EXT_border_color_swizzle
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+#endif
+#ifdef VK_KHR_acceleration_structure
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+#endif
+#ifdef VK_KHR_ray_query
+#endif
+void* goldfish_vulkan_get_proc_address(const char* name);
+void* goldfish_vulkan_get_instance_proc_address(VkInstance instance, const char* name);
+void* goldfish_vulkan_get_device_proc_address(VkDevice device, const char* name);
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/goldfish_vk_counting_guest.cpp b/system/vulkan_enc/goldfish_vk_counting_guest.cpp
new file mode 100644
index 0000000..9250f3d
--- /dev/null
+++ b/system/vulkan_enc/goldfish_vk_counting_guest.cpp
@@ -0,0 +1,17413 @@
+// Copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2018 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Autogenerated module goldfish_vk_counting_guest
+//
+// (impl) generated by codegen/vulkan/scripts/genvk.py -registry codegen/vulkan/xml/vk.xml cereal -o
+// host/vulkan/cereal
+//
+// Please do not modify directly;
+// re-run gfxstream-protocols/scripts/generate-vulkan-sources.sh,
+// or directly from Python by defining:
+// VULKAN_REGISTRY_XML_DIR : Directory containing vk.xml
+// VULKAN_REGISTRY_SCRIPTS_DIR : Directory containing genvk.py
+// CEREAL_OUTPUT_DIR: Where to put the generated sources.
+//
+// python3 $VULKAN_REGISTRY_SCRIPTS_DIR/genvk.py -registry $VULKAN_REGISTRY_XML_DIR/vk.xml cereal -o
+// $CEREAL_OUTPUT_DIR
+//
+
+#include "goldfish_vk_counting_guest.h"
+
+#include <cstring>
+
+#include "goldfish_vk_extension_structs_guest.h"
+#include "goldfish_vk_private_defs.h"
+
+namespace gfxstream {
+namespace vk {
+
+void count_extension_struct(uint32_t featureBits, VkStructureType rootType,
+                            const void* structExtension, size_t* count);
+
+#ifdef VK_VERSION_1_0
+void count_VkExtent2D(uint32_t featureBits, VkStructureType rootType, const VkExtent2D* toCount,
+                      size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkExtent3D(uint32_t featureBits, VkStructureType rootType, const VkExtent3D* toCount,
+                      size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkOffset2D(uint32_t featureBits, VkStructureType rootType, const VkOffset2D* toCount,
+                      size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(int32_t);
+    *count += sizeof(int32_t);
+}
+
+void count_VkOffset3D(uint32_t featureBits, VkStructureType rootType, const VkOffset3D* toCount,
+                      size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(int32_t);
+    *count += sizeof(int32_t);
+    *count += sizeof(int32_t);
+}
+
+void count_VkRect2D(uint32_t featureBits, VkStructureType rootType, const VkRect2D* toCount,
+                    size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    count_VkOffset2D(featureBits, rootType, (VkOffset2D*)(&toCount->offset), count);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->extent), count);
+}
+
+void count_VkBaseInStructure(uint32_t featureBits, VkStructureType rootType,
+                             const VkBaseInStructure* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+}
+
+void count_VkBaseOutStructure(uint32_t featureBits, VkStructureType rootType,
+                              const VkBaseOutStructure* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+}
+
+void count_VkBufferMemoryBarrier(uint32_t featureBits, VkStructureType rootType,
+                                 const VkBufferMemoryBarrier* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkAccessFlags);
+    *count += sizeof(VkAccessFlags);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+}
+
+void count_VkDispatchIndirectCommand(uint32_t featureBits, VkStructureType rootType,
+                                     const VkDispatchIndirectCommand* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkDrawIndexedIndirectCommand(uint32_t featureBits, VkStructureType rootType,
+                                        const VkDrawIndexedIndirectCommand* toCount,
+                                        size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(int32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkDrawIndirectCommand(uint32_t featureBits, VkStructureType rootType,
+                                 const VkDrawIndirectCommand* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkImageSubresourceRange(uint32_t featureBits, VkStructureType rootType,
+                                   const VkImageSubresourceRange* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkImageAspectFlags);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkImageMemoryBarrier(uint32_t featureBits, VkStructureType rootType,
+                                const VkImageMemoryBarrier* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkAccessFlags);
+    *count += sizeof(VkAccessFlags);
+    *count += sizeof(VkImageLayout);
+    *count += sizeof(VkImageLayout);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    count_VkImageSubresourceRange(featureBits, rootType,
+                                  (VkImageSubresourceRange*)(&toCount->subresourceRange), count);
+}
+
+void count_VkMemoryBarrier(uint32_t featureBits, VkStructureType rootType,
+                           const VkMemoryBarrier* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkAccessFlags);
+    *count += sizeof(VkAccessFlags);
+}
+
+void count_VkPipelineCacheHeaderVersionOne(uint32_t featureBits, VkStructureType rootType,
+                                           const VkPipelineCacheHeaderVersionOne* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkPipelineCacheHeaderVersion);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += VK_UUID_SIZE * sizeof(uint8_t);
+}
+
+void count_VkAllocationCallbacks(uint32_t featureBits, VkStructureType rootType,
+                                 const VkAllocationCallbacks* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pUserData) {
+        *count += sizeof(uint8_t);
+    }
+    *count += 8;
+    *count += 8;
+    *count += 8;
+    *count += 8;
+    *count += 8;
+}
+
+void count_VkApplicationInfo(uint32_t featureBits, VkStructureType rootType,
+                             const VkApplicationInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    if (featureBits & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) {
+        // WARNING PTR CHECK
+        *count += 8;
+        if (toCount->pApplicationName) {
+            *count += sizeof(uint32_t) +
+                      (toCount->pApplicationName ? strlen(toCount->pApplicationName) : 0);
+        }
+    } else {
+        *count +=
+            sizeof(uint32_t) + (toCount->pApplicationName ? strlen(toCount->pApplicationName) : 0);
+    }
+    *count += sizeof(uint32_t);
+    if (featureBits & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) {
+        // WARNING PTR CHECK
+        *count += 8;
+        if (toCount->pEngineName) {
+            *count += sizeof(uint32_t) + (toCount->pEngineName ? strlen(toCount->pEngineName) : 0);
+        }
+    } else {
+        *count += sizeof(uint32_t) + (toCount->pEngineName ? strlen(toCount->pEngineName) : 0);
+    }
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkFormatProperties(uint32_t featureBits, VkStructureType rootType,
+                              const VkFormatProperties* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkFormatFeatureFlags);
+    *count += sizeof(VkFormatFeatureFlags);
+    *count += sizeof(VkFormatFeatureFlags);
+}
+
+void count_VkImageFormatProperties(uint32_t featureBits, VkStructureType rootType,
+                                   const VkImageFormatProperties* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    count_VkExtent3D(featureBits, rootType, (VkExtent3D*)(&toCount->maxExtent), count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkSampleCountFlags);
+    *count += sizeof(VkDeviceSize);
+}
+
+void count_VkInstanceCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                const VkInstanceCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkInstanceCreateFlags);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pApplicationInfo) {
+        count_VkApplicationInfo(featureBits, rootType,
+                                (const VkApplicationInfo*)(toCount->pApplicationInfo), count);
+    }
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < toCount->enabledLayerCount; ++i) {
+            size_t l =
+                toCount->ppEnabledLayerNames[i] ? strlen(toCount->ppEnabledLayerNames[i]) : 0;
+            *count +=
+                sizeof(uint32_t) +
+                (toCount->ppEnabledLayerNames[i] ? strlen(toCount->ppEnabledLayerNames[i]) : 0);
+        }
+    }
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < toCount->enabledExtensionCount; ++i) {
+            size_t l = toCount->ppEnabledExtensionNames[i]
+                           ? strlen(toCount->ppEnabledExtensionNames[i])
+                           : 0;
+            *count += sizeof(uint32_t) + (toCount->ppEnabledExtensionNames[i]
+                                              ? strlen(toCount->ppEnabledExtensionNames[i])
+                                              : 0);
+        }
+    }
+}
+
+void count_VkMemoryHeap(uint32_t featureBits, VkStructureType rootType, const VkMemoryHeap* toCount,
+                        size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkMemoryHeapFlags);
+}
+
+void count_VkMemoryType(uint32_t featureBits, VkStructureType rootType, const VkMemoryType* toCount,
+                        size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkMemoryPropertyFlags);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkPhysicalDeviceFeatures(uint32_t featureBits, VkStructureType rootType,
+                                    const VkPhysicalDeviceFeatures* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceLimits(uint32_t featureBits, VkStructureType rootType,
+                                  const VkPhysicalDeviceLimits* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += 3 * sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += 3 * sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(uint32_t);
+    *count += 2 * sizeof(uint32_t);
+    *count += 2 * sizeof(float);
+    *count += sizeof(uint32_t);
+    *count += 8;
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(int32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(int32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkSampleCountFlags);
+    *count += sizeof(VkSampleCountFlags);
+    *count += sizeof(VkSampleCountFlags);
+    *count += sizeof(VkSampleCountFlags);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkSampleCountFlags);
+    *count += sizeof(VkSampleCountFlags);
+    *count += sizeof(VkSampleCountFlags);
+    *count += sizeof(VkSampleCountFlags);
+    *count += sizeof(VkSampleCountFlags);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkBool32);
+    *count += sizeof(float);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += 2 * sizeof(float);
+    *count += 2 * sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+}
+
+void count_VkPhysicalDeviceMemoryProperties(uint32_t featureBits, VkStructureType rootType,
+                                            const VkPhysicalDeviceMemoryProperties* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)VK_MAX_MEMORY_TYPES; ++i) {
+        count_VkMemoryType(featureBits, rootType, (VkMemoryType*)(toCount->memoryTypes + i), count);
+    }
+    *count += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)VK_MAX_MEMORY_HEAPS; ++i) {
+        count_VkMemoryHeap(featureBits, rootType, (VkMemoryHeap*)(toCount->memoryHeaps + i), count);
+    }
+}
+
+void count_VkPhysicalDeviceSparseProperties(uint32_t featureBits, VkStructureType rootType,
+                                            const VkPhysicalDeviceSparseProperties* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceProperties(uint32_t featureBits, VkStructureType rootType,
+                                      const VkPhysicalDeviceProperties* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkPhysicalDeviceType);
+    *count += VK_MAX_PHYSICAL_DEVICE_NAME_SIZE * sizeof(char);
+    *count += VK_UUID_SIZE * sizeof(uint8_t);
+    count_VkPhysicalDeviceLimits(featureBits, rootType, (VkPhysicalDeviceLimits*)(&toCount->limits),
+                                 count);
+    count_VkPhysicalDeviceSparseProperties(
+        featureBits, rootType, (VkPhysicalDeviceSparseProperties*)(&toCount->sparseProperties),
+        count);
+}
+
+void count_VkQueueFamilyProperties(uint32_t featureBits, VkStructureType rootType,
+                                   const VkQueueFamilyProperties* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkQueueFlags);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    count_VkExtent3D(featureBits, rootType, (VkExtent3D*)(&toCount->minImageTransferGranularity),
+                     count);
+}
+
+void count_VkDeviceQueueCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                   const VkDeviceQueueCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDeviceQueueCreateFlags);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->queueCount * sizeof(const float);
+    }
+}
+
+void count_VkDeviceCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                              const VkDeviceCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDeviceCreateFlags);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->queueCreateInfoCount; ++i) {
+            count_VkDeviceQueueCreateInfo(
+                featureBits, rootType,
+                (const VkDeviceQueueCreateInfo*)(toCount->pQueueCreateInfos + i), count);
+        }
+    }
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < toCount->enabledLayerCount; ++i) {
+            size_t l =
+                toCount->ppEnabledLayerNames[i] ? strlen(toCount->ppEnabledLayerNames[i]) : 0;
+            *count +=
+                sizeof(uint32_t) +
+                (toCount->ppEnabledLayerNames[i] ? strlen(toCount->ppEnabledLayerNames[i]) : 0);
+        }
+    }
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < toCount->enabledExtensionCount; ++i) {
+            size_t l = toCount->ppEnabledExtensionNames[i]
+                           ? strlen(toCount->ppEnabledExtensionNames[i])
+                           : 0;
+            *count += sizeof(uint32_t) + (toCount->ppEnabledExtensionNames[i]
+                                              ? strlen(toCount->ppEnabledExtensionNames[i])
+                                              : 0);
+        }
+    }
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pEnabledFeatures) {
+        count_VkPhysicalDeviceFeatures(featureBits, rootType,
+                                       (const VkPhysicalDeviceFeatures*)(toCount->pEnabledFeatures),
+                                       count);
+    }
+}
+
+void count_VkExtensionProperties(uint32_t featureBits, VkStructureType rootType,
+                                 const VkExtensionProperties* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += VK_MAX_EXTENSION_NAME_SIZE * sizeof(char);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkLayerProperties(uint32_t featureBits, VkStructureType rootType,
+                             const VkLayerProperties* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += VK_MAX_EXTENSION_NAME_SIZE * sizeof(char);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += VK_MAX_DESCRIPTION_SIZE * sizeof(char);
+}
+
+void count_VkSubmitInfo(uint32_t featureBits, VkStructureType rootType, const VkSubmitInfo* toCount,
+                        size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    if (toCount->waitSemaphoreCount) {
+        *count += toCount->waitSemaphoreCount * 8;
+    }
+    if (toCount) {
+        *count += toCount->waitSemaphoreCount * sizeof(const VkPipelineStageFlags);
+    }
+    *count += sizeof(uint32_t);
+    if (toCount->commandBufferCount) {
+        *count += toCount->commandBufferCount * 8;
+    }
+    *count += sizeof(uint32_t);
+    if (toCount->signalSemaphoreCount) {
+        *count += toCount->signalSemaphoreCount * 8;
+    }
+}
+
+void count_VkMappedMemoryRange(uint32_t featureBits, VkStructureType rootType,
+                               const VkMappedMemoryRange* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+}
+
+void count_VkMemoryAllocateInfo(uint32_t featureBits, VkStructureType rootType,
+                                const VkMemoryAllocateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkMemoryRequirements(uint32_t featureBits, VkStructureType rootType,
+                                const VkMemoryRequirements* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkSparseMemoryBind(uint32_t featureBits, VkStructureType rootType,
+                              const VkSparseMemoryBind* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkSparseMemoryBindFlags);
+}
+
+void count_VkSparseBufferMemoryBindInfo(uint32_t featureBits, VkStructureType rootType,
+                                        const VkSparseBufferMemoryBindInfo* toCount,
+                                        size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->bindCount; ++i) {
+            count_VkSparseMemoryBind(featureBits, rootType,
+                                     (const VkSparseMemoryBind*)(toCount->pBinds + i), count);
+        }
+    }
+}
+
+void count_VkSparseImageOpaqueMemoryBindInfo(uint32_t featureBits, VkStructureType rootType,
+                                             const VkSparseImageOpaqueMemoryBindInfo* toCount,
+                                             size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->bindCount; ++i) {
+            count_VkSparseMemoryBind(featureBits, rootType,
+                                     (const VkSparseMemoryBind*)(toCount->pBinds + i), count);
+        }
+    }
+}
+
+void count_VkImageSubresource(uint32_t featureBits, VkStructureType rootType,
+                              const VkImageSubresource* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkImageAspectFlags);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkSparseImageMemoryBind(uint32_t featureBits, VkStructureType rootType,
+                                   const VkSparseImageMemoryBind* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    count_VkImageSubresource(featureBits, rootType, (VkImageSubresource*)(&toCount->subresource),
+                             count);
+    count_VkOffset3D(featureBits, rootType, (VkOffset3D*)(&toCount->offset), count);
+    count_VkExtent3D(featureBits, rootType, (VkExtent3D*)(&toCount->extent), count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkSparseMemoryBindFlags);
+}
+
+void count_VkSparseImageMemoryBindInfo(uint32_t featureBits, VkStructureType rootType,
+                                       const VkSparseImageMemoryBindInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->bindCount; ++i) {
+            count_VkSparseImageMemoryBind(featureBits, rootType,
+                                          (const VkSparseImageMemoryBind*)(toCount->pBinds + i),
+                                          count);
+        }
+    }
+}
+
+void count_VkBindSparseInfo(uint32_t featureBits, VkStructureType rootType,
+                            const VkBindSparseInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    if (toCount->waitSemaphoreCount) {
+        *count += toCount->waitSemaphoreCount * 8;
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->bufferBindCount; ++i) {
+            count_VkSparseBufferMemoryBindInfo(
+                featureBits, rootType,
+                (const VkSparseBufferMemoryBindInfo*)(toCount->pBufferBinds + i), count);
+        }
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->imageOpaqueBindCount; ++i) {
+            count_VkSparseImageOpaqueMemoryBindInfo(
+                featureBits, rootType,
+                (const VkSparseImageOpaqueMemoryBindInfo*)(toCount->pImageOpaqueBinds + i), count);
+        }
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->imageBindCount; ++i) {
+            count_VkSparseImageMemoryBindInfo(
+                featureBits, rootType,
+                (const VkSparseImageMemoryBindInfo*)(toCount->pImageBinds + i), count);
+        }
+    }
+    *count += sizeof(uint32_t);
+    if (toCount->signalSemaphoreCount) {
+        *count += toCount->signalSemaphoreCount * 8;
+    }
+}
+
+void count_VkSparseImageFormatProperties(uint32_t featureBits, VkStructureType rootType,
+                                         const VkSparseImageFormatProperties* toCount,
+                                         size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkImageAspectFlags);
+    count_VkExtent3D(featureBits, rootType, (VkExtent3D*)(&toCount->imageGranularity), count);
+    *count += sizeof(VkSparseImageFormatFlags);
+}
+
+void count_VkSparseImageMemoryRequirements(uint32_t featureBits, VkStructureType rootType,
+                                           const VkSparseImageMemoryRequirements* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    count_VkSparseImageFormatProperties(
+        featureBits, rootType, (VkSparseImageFormatProperties*)(&toCount->formatProperties), count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+}
+
+void count_VkFenceCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                             const VkFenceCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkFenceCreateFlags);
+}
+
+void count_VkSemaphoreCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                 const VkSemaphoreCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkSemaphoreCreateFlags);
+}
+
+void count_VkEventCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                             const VkEventCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkEventCreateFlags);
+}
+
+void count_VkQueryPoolCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                 const VkQueryPoolCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkQueryPoolCreateFlags);
+    *count += sizeof(VkQueryType);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkQueryPipelineStatisticFlags);
+}
+
+void count_VkBufferCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                              const VkBufferCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBufferCreateFlags);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkBufferUsageFlags);
+    *count += sizeof(VkSharingMode);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pQueueFamilyIndices) {
+        if (toCount) {
+            *count += toCount->queueFamilyIndexCount * sizeof(const uint32_t);
+        }
+    }
+}
+
+void count_VkBufferViewCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                  const VkBufferViewCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBufferViewCreateFlags);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkFormat);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+}
+
+void count_VkImageCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                             const VkImageCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkImageCreateFlags);
+    *count += sizeof(VkImageType);
+    *count += sizeof(VkFormat);
+    count_VkExtent3D(featureBits, rootType, (VkExtent3D*)(&toCount->extent), count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkSampleCountFlagBits);
+    *count += sizeof(VkImageTiling);
+    *count += sizeof(VkImageUsageFlags);
+    *count += sizeof(VkSharingMode);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pQueueFamilyIndices) {
+        if (toCount) {
+            *count += toCount->queueFamilyIndexCount * sizeof(const uint32_t);
+        }
+    }
+    *count += sizeof(VkImageLayout);
+}
+
+void count_VkSubresourceLayout(uint32_t featureBits, VkStructureType rootType,
+                               const VkSubresourceLayout* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+}
+
+void count_VkComponentMapping(uint32_t featureBits, VkStructureType rootType,
+                              const VkComponentMapping* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkComponentSwizzle);
+    *count += sizeof(VkComponentSwizzle);
+    *count += sizeof(VkComponentSwizzle);
+    *count += sizeof(VkComponentSwizzle);
+}
+
+void count_VkImageViewCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                 const VkImageViewCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkImageViewCreateFlags);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkImageViewType);
+    *count += sizeof(VkFormat);
+    count_VkComponentMapping(featureBits, rootType, (VkComponentMapping*)(&toCount->components),
+                             count);
+    count_VkImageSubresourceRange(featureBits, rootType,
+                                  (VkImageSubresourceRange*)(&toCount->subresourceRange), count);
+}
+
+void count_VkShaderModuleCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                    const VkShaderModuleCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkShaderModuleCreateFlags);
+    *count += 8;
+    if (toCount) {
+        *count += (toCount->codeSize / 4) * sizeof(const uint32_t);
+    }
+}
+
+void count_VkPipelineCacheCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                     const VkPipelineCacheCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineCacheCreateFlags);
+    *count += 8;
+    if (toCount) {
+        *count += toCount->initialDataSize * sizeof(const uint8_t);
+    }
+}
+
+void count_VkSpecializationMapEntry(uint32_t featureBits, VkStructureType rootType,
+                                    const VkSpecializationMapEntry* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += 8;
+}
+
+void count_VkSpecializationInfo(uint32_t featureBits, VkStructureType rootType,
+                                const VkSpecializationInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->mapEntryCount; ++i) {
+            count_VkSpecializationMapEntry(
+                featureBits, rootType, (const VkSpecializationMapEntry*)(toCount->pMapEntries + i),
+                count);
+        }
+    }
+    *count += 8;
+    if (toCount) {
+        *count += toCount->dataSize * sizeof(const uint8_t);
+    }
+}
+
+void count_VkPipelineShaderStageCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                           const VkPipelineShaderStageCreateInfo* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineShaderStageCreateFlags);
+    *count += sizeof(VkShaderStageFlagBits);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(uint32_t) + (toCount->pName ? strlen(toCount->pName) : 0);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pSpecializationInfo) {
+        count_VkSpecializationInfo(featureBits, rootType,
+                                   (const VkSpecializationInfo*)(toCount->pSpecializationInfo),
+                                   count);
+    }
+}
+
+void count_VkComputePipelineCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                       const VkComputePipelineCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineCreateFlags);
+    count_VkPipelineShaderStageCreateInfo(
+        featureBits, rootType, (VkPipelineShaderStageCreateInfo*)(&toCount->stage), count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    uint64_t cgen_var_1;
+    *count += 1 * 8;
+    *count += sizeof(int32_t);
+}
+
+void count_VkVertexInputBindingDescription(uint32_t featureBits, VkStructureType rootType,
+                                           const VkVertexInputBindingDescription* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkVertexInputRate);
+}
+
+void count_VkVertexInputAttributeDescription(uint32_t featureBits, VkStructureType rootType,
+                                             const VkVertexInputAttributeDescription* toCount,
+                                             size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkFormat);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkPipelineVertexInputStateCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                                const VkPipelineVertexInputStateCreateInfo* toCount,
+                                                size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineVertexInputStateCreateFlags);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->vertexBindingDescriptionCount; ++i) {
+            count_VkVertexInputBindingDescription(
+                featureBits, rootType,
+                (const VkVertexInputBindingDescription*)(toCount->pVertexBindingDescriptions + i),
+                count);
+        }
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->vertexAttributeDescriptionCount; ++i) {
+            count_VkVertexInputAttributeDescription(
+                featureBits, rootType,
+                (const VkVertexInputAttributeDescription*)(toCount->pVertexAttributeDescriptions +
+                                                           i),
+                count);
+        }
+    }
+}
+
+void count_VkPipelineInputAssemblyStateCreateInfo(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineInputAssemblyStateCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineInputAssemblyStateCreateFlags);
+    *count += sizeof(VkPrimitiveTopology);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPipelineTessellationStateCreateInfo(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineTessellationStateCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineTessellationStateCreateFlags);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkViewport(uint32_t featureBits, VkStructureType rootType, const VkViewport* toCount,
+                      size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(float);
+}
+
+void count_VkPipelineViewportStateCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                             const VkPipelineViewportStateCreateInfo* toCount,
+                                             size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineViewportStateCreateFlags);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pViewports) {
+        if (toCount) {
+            for (uint32_t i = 0; i < (uint32_t)toCount->viewportCount; ++i) {
+                count_VkViewport(featureBits, rootType,
+                                 (const VkViewport*)(toCount->pViewports + i), count);
+            }
+        }
+    }
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pScissors) {
+        if (toCount) {
+            for (uint32_t i = 0; i < (uint32_t)toCount->scissorCount; ++i) {
+                count_VkRect2D(featureBits, rootType, (const VkRect2D*)(toCount->pScissors + i),
+                               count);
+            }
+        }
+    }
+}
+
+void count_VkPipelineRasterizationStateCreateInfo(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineRasterizationStateCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineRasterizationStateCreateFlags);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkPolygonMode);
+    *count += sizeof(VkCullModeFlags);
+    *count += sizeof(VkFrontFace);
+    *count += sizeof(VkBool32);
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(float);
+}
+
+void count_VkPipelineMultisampleStateCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                                const VkPipelineMultisampleStateCreateInfo* toCount,
+                                                size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineMultisampleStateCreateFlags);
+    *count += sizeof(VkSampleCountFlagBits);
+    *count += sizeof(VkBool32);
+    *count += sizeof(float);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pSampleMask) {
+        if (toCount) {
+            *count += (((toCount->rasterizationSamples) + 31) / 32) * sizeof(const VkSampleMask);
+        }
+    }
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkStencilOpState(uint32_t featureBits, VkStructureType rootType,
+                            const VkStencilOpState* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStencilOp);
+    *count += sizeof(VkStencilOp);
+    *count += sizeof(VkStencilOp);
+    *count += sizeof(VkCompareOp);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkPipelineDepthStencilStateCreateInfo(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineDepthStencilStateCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineDepthStencilStateCreateFlags);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkCompareOp);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    count_VkStencilOpState(featureBits, rootType, (VkStencilOpState*)(&toCount->front), count);
+    count_VkStencilOpState(featureBits, rootType, (VkStencilOpState*)(&toCount->back), count);
+    *count += sizeof(float);
+    *count += sizeof(float);
+}
+
+void count_VkPipelineColorBlendAttachmentState(uint32_t featureBits, VkStructureType rootType,
+                                               const VkPipelineColorBlendAttachmentState* toCount,
+                                               size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBlendFactor);
+    *count += sizeof(VkBlendFactor);
+    *count += sizeof(VkBlendOp);
+    *count += sizeof(VkBlendFactor);
+    *count += sizeof(VkBlendFactor);
+    *count += sizeof(VkBlendOp);
+    *count += sizeof(VkColorComponentFlags);
+}
+
+void count_VkPipelineColorBlendStateCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                               const VkPipelineColorBlendStateCreateInfo* toCount,
+                                               size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineColorBlendStateCreateFlags);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkLogicOp);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->attachmentCount; ++i) {
+            count_VkPipelineColorBlendAttachmentState(
+                featureBits, rootType,
+                (const VkPipelineColorBlendAttachmentState*)(toCount->pAttachments + i), count);
+        }
+    }
+    *count += 4 * sizeof(float);
+}
+
+void count_VkPipelineDynamicStateCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                            const VkPipelineDynamicStateCreateInfo* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineDynamicStateCreateFlags);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->dynamicStateCount * sizeof(const VkDynamicState);
+    }
+}
+
+void count_VkGraphicsPipelineCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                        const VkGraphicsPipelineCreateInfo* toCount,
+                                        size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    uint32_t hasRasterization = 1;
+    if (featureBits & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) {
+        hasRasterization = (((0 == toCount->pRasterizationState))
+                                ? (0)
+                                : (!((*(toCount->pRasterizationState)).rasterizerDiscardEnable)));
+        *count += 4;
+    }
+    uint32_t hasTessellation = 1;
+    if (featureBits & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) {
+        hasTessellation = arrayany(
+            toCount->pStages, 0, toCount->stageCount, [](VkPipelineShaderStageCreateInfo s) {
+                return ((s.stage == VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT) ||
+                        (s.stage == VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT));
+            });
+        *count += 4;
+    }
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineCreateFlags);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->stageCount; ++i) {
+            count_VkPipelineShaderStageCreateInfo(
+                featureBits, rootType,
+                (const VkPipelineShaderStageCreateInfo*)(toCount->pStages + i), count);
+        }
+    }
+    // WARNING PTR CHECK
+    if (featureBits & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) {
+        *count += 8;
+    }
+    if ((!(featureBits & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) ||
+         toCount->pVertexInputState)) {
+        count_VkPipelineVertexInputStateCreateInfo(
+            featureBits, rootType,
+            (const VkPipelineVertexInputStateCreateInfo*)(toCount->pVertexInputState), count);
+    }
+    // WARNING PTR CHECK
+    if (featureBits & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) {
+        *count += 8;
+    }
+    if ((!(featureBits & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) ||
+         toCount->pInputAssemblyState)) {
+        count_VkPipelineInputAssemblyStateCreateInfo(
+            featureBits, rootType,
+            (const VkPipelineInputAssemblyStateCreateInfo*)(toCount->pInputAssemblyState), count);
+    }
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pTessellationState) {
+        if (hasTessellation) {
+            count_VkPipelineTessellationStateCreateInfo(
+                featureBits, rootType,
+                (const VkPipelineTessellationStateCreateInfo*)(toCount->pTessellationState), count);
+        }
+    }
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pViewportState) {
+        if (hasRasterization) {
+            count_VkPipelineViewportStateCreateInfo(
+                featureBits, rootType,
+                (const VkPipelineViewportStateCreateInfo*)(toCount->pViewportState), count);
+        }
+    }
+    // WARNING PTR CHECK
+    if (featureBits & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) {
+        *count += 8;
+    }
+    if ((!(featureBits & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) ||
+         toCount->pRasterizationState)) {
+        count_VkPipelineRasterizationStateCreateInfo(
+            featureBits, rootType,
+            (const VkPipelineRasterizationStateCreateInfo*)(toCount->pRasterizationState), count);
+    }
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pMultisampleState) {
+        if (hasRasterization) {
+            count_VkPipelineMultisampleStateCreateInfo(
+                featureBits, rootType,
+                (const VkPipelineMultisampleStateCreateInfo*)(toCount->pMultisampleState), count);
+        }
+    }
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pDepthStencilState) {
+        if (hasRasterization) {
+            count_VkPipelineDepthStencilStateCreateInfo(
+                featureBits, rootType,
+                (const VkPipelineDepthStencilStateCreateInfo*)(toCount->pDepthStencilState), count);
+        }
+    }
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pColorBlendState) {
+        if (hasRasterization) {
+            count_VkPipelineColorBlendStateCreateInfo(
+                featureBits, rootType,
+                (const VkPipelineColorBlendStateCreateInfo*)(toCount->pColorBlendState), count);
+        }
+    }
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pDynamicState) {
+        count_VkPipelineDynamicStateCreateInfo(
+            featureBits, rootType,
+            (const VkPipelineDynamicStateCreateInfo*)(toCount->pDynamicState), count);
+    }
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    uint64_t cgen_var_1;
+    *count += 1 * 8;
+    *count += sizeof(uint32_t);
+    uint64_t cgen_var_2;
+    *count += 1 * 8;
+    *count += sizeof(int32_t);
+}
+
+void count_VkPushConstantRange(uint32_t featureBits, VkStructureType rootType,
+                               const VkPushConstantRange* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkShaderStageFlags);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkPipelineLayoutCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                      const VkPipelineLayoutCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineLayoutCreateFlags);
+    *count += sizeof(uint32_t);
+    if (toCount->setLayoutCount) {
+        *count += toCount->setLayoutCount * 8;
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->pushConstantRangeCount; ++i) {
+            count_VkPushConstantRange(
+                featureBits, rootType,
+                (const VkPushConstantRange*)(toCount->pPushConstantRanges + i), count);
+        }
+    }
+}
+
+void count_VkSamplerCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                               const VkSamplerCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkSamplerCreateFlags);
+    *count += sizeof(VkFilter);
+    *count += sizeof(VkFilter);
+    *count += sizeof(VkSamplerMipmapMode);
+    *count += sizeof(VkSamplerAddressMode);
+    *count += sizeof(VkSamplerAddressMode);
+    *count += sizeof(VkSamplerAddressMode);
+    *count += sizeof(float);
+    *count += sizeof(VkBool32);
+    *count += sizeof(float);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkCompareOp);
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(VkBorderColor);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkCopyDescriptorSet(uint32_t featureBits, VkStructureType rootType,
+                               const VkCopyDescriptorSet* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    uint64_t cgen_var_1;
+    *count += 1 * 8;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkDescriptorBufferInfo(uint32_t featureBits, VkStructureType rootType,
+                                  const VkDescriptorBufferInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+}
+
+void count_VkDescriptorImageInfo(uint32_t featureBits, VkStructureType rootType,
+                                 const VkDescriptorImageInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    uint64_t cgen_var_1;
+    *count += 1 * 8;
+    *count += sizeof(VkImageLayout);
+}
+
+void count_VkDescriptorPoolSize(uint32_t featureBits, VkStructureType rootType,
+                                const VkDescriptorPoolSize* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkDescriptorType);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkDescriptorPoolCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                      const VkDescriptorPoolCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDescriptorPoolCreateFlags);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->poolSizeCount; ++i) {
+            count_VkDescriptorPoolSize(featureBits, rootType,
+                                       (const VkDescriptorPoolSize*)(toCount->pPoolSizes + i),
+                                       count);
+        }
+    }
+}
+
+void count_VkDescriptorSetAllocateInfo(uint32_t featureBits, VkStructureType rootType,
+                                       const VkDescriptorSetAllocateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(uint32_t);
+    if (toCount->descriptorSetCount) {
+        *count += toCount->descriptorSetCount * 8;
+    }
+}
+
+void count_VkDescriptorSetLayoutBinding(uint32_t featureBits, VkStructureType rootType,
+                                        const VkDescriptorSetLayoutBinding* toCount,
+                                        size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkDescriptorType);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkShaderStageFlags);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pImmutableSamplers) {
+        if (toCount->descriptorCount) {
+            *count += toCount->descriptorCount * 8;
+        }
+    }
+}
+
+void count_VkDescriptorSetLayoutCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                           const VkDescriptorSetLayoutCreateInfo* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDescriptorSetLayoutCreateFlags);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->bindingCount; ++i) {
+            count_VkDescriptorSetLayoutBinding(
+                featureBits, rootType,
+                (const VkDescriptorSetLayoutBinding*)(toCount->pBindings + i), count);
+        }
+    }
+}
+
+void count_VkWriteDescriptorSet(uint32_t featureBits, VkStructureType rootType,
+                                const VkWriteDescriptorSet* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkDescriptorType);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pImageInfo) {
+        if ((!(featureBits & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) ||
+             ((VK_DESCRIPTOR_TYPE_SAMPLER == toCount->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER == toCount->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE == toCount->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_STORAGE_IMAGE == toCount->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT == toCount->descriptorType)))) {
+            if (toCount) {
+                for (uint32_t i = 0; i < (uint32_t)toCount->descriptorCount; ++i) {
+                    count_VkDescriptorImageInfo(
+                        featureBits, rootType,
+                        (const VkDescriptorImageInfo*)(toCount->pImageInfo + i), count);
+                }
+            }
+        }
+    }
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pBufferInfo) {
+        if ((!(featureBits & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) ||
+             ((VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER == toCount->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC == toCount->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_STORAGE_BUFFER == toCount->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC == toCount->descriptorType)))) {
+            if (toCount) {
+                for (uint32_t i = 0; i < (uint32_t)toCount->descriptorCount; ++i) {
+                    count_VkDescriptorBufferInfo(
+                        featureBits, rootType,
+                        (const VkDescriptorBufferInfo*)(toCount->pBufferInfo + i), count);
+                }
+            }
+        }
+    }
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pTexelBufferView) {
+        if ((!(featureBits & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) ||
+             ((VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER == toCount->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER == toCount->descriptorType)))) {
+            if (toCount->descriptorCount) {
+                *count += toCount->descriptorCount * 8;
+            }
+        }
+    }
+}
+
+void count_VkAttachmentDescription(uint32_t featureBits, VkStructureType rootType,
+                                   const VkAttachmentDescription* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkAttachmentDescriptionFlags);
+    *count += sizeof(VkFormat);
+    *count += sizeof(VkSampleCountFlagBits);
+    *count += sizeof(VkAttachmentLoadOp);
+    *count += sizeof(VkAttachmentStoreOp);
+    *count += sizeof(VkAttachmentLoadOp);
+    *count += sizeof(VkAttachmentStoreOp);
+    *count += sizeof(VkImageLayout);
+    *count += sizeof(VkImageLayout);
+}
+
+void count_VkAttachmentReference(uint32_t featureBits, VkStructureType rootType,
+                                 const VkAttachmentReference* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkImageLayout);
+}
+
+void count_VkFramebufferCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                   const VkFramebufferCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkFramebufferCreateFlags);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(uint32_t);
+    if ((!(featureBits & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) ||
+         (((toCount->flags & VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT) == 0)))) {
+        if (toCount->attachmentCount) {
+            *count += toCount->attachmentCount * 8;
+        }
+    }
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkSubpassDescription(uint32_t featureBits, VkStructureType rootType,
+                                const VkSubpassDescription* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkSubpassDescriptionFlags);
+    *count += sizeof(VkPipelineBindPoint);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->inputAttachmentCount; ++i) {
+            count_VkAttachmentReference(
+                featureBits, rootType,
+                (const VkAttachmentReference*)(toCount->pInputAttachments + i), count);
+        }
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->colorAttachmentCount; ++i) {
+            count_VkAttachmentReference(
+                featureBits, rootType,
+                (const VkAttachmentReference*)(toCount->pColorAttachments + i), count);
+        }
+    }
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pResolveAttachments) {
+        if (toCount) {
+            for (uint32_t i = 0; i < (uint32_t)toCount->colorAttachmentCount; ++i) {
+                count_VkAttachmentReference(
+                    featureBits, rootType,
+                    (const VkAttachmentReference*)(toCount->pResolveAttachments + i), count);
+            }
+        }
+    }
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pDepthStencilAttachment) {
+        count_VkAttachmentReference(
+            featureBits, rootType, (const VkAttachmentReference*)(toCount->pDepthStencilAttachment),
+            count);
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->preserveAttachmentCount * sizeof(const uint32_t);
+    }
+}
+
+void count_VkSubpassDependency(uint32_t featureBits, VkStructureType rootType,
+                               const VkSubpassDependency* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkPipelineStageFlags);
+    *count += sizeof(VkPipelineStageFlags);
+    *count += sizeof(VkAccessFlags);
+    *count += sizeof(VkAccessFlags);
+    *count += sizeof(VkDependencyFlags);
+}
+
+void count_VkRenderPassCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                  const VkRenderPassCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkRenderPassCreateFlags);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->attachmentCount; ++i) {
+            count_VkAttachmentDescription(
+                featureBits, rootType, (const VkAttachmentDescription*)(toCount->pAttachments + i),
+                count);
+        }
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->subpassCount; ++i) {
+            count_VkSubpassDescription(featureBits, rootType,
+                                       (const VkSubpassDescription*)(toCount->pSubpasses + i),
+                                       count);
+        }
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->dependencyCount; ++i) {
+            count_VkSubpassDependency(featureBits, rootType,
+                                      (const VkSubpassDependency*)(toCount->pDependencies + i),
+                                      count);
+        }
+    }
+}
+
+void count_VkCommandPoolCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                   const VkCommandPoolCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkCommandPoolCreateFlags);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkCommandBufferAllocateInfo(uint32_t featureBits, VkStructureType rootType,
+                                       const VkCommandBufferAllocateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkCommandBufferLevel);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkCommandBufferInheritanceInfo(uint32_t featureBits, VkStructureType rootType,
+                                          const VkCommandBufferInheritanceInfo* toCount,
+                                          size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(uint32_t);
+    uint64_t cgen_var_1;
+    *count += 1 * 8;
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkQueryControlFlags);
+    *count += sizeof(VkQueryPipelineStatisticFlags);
+}
+
+void count_VkCommandBufferBeginInfo(uint32_t featureBits, VkStructureType rootType,
+                                    const VkCommandBufferBeginInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkCommandBufferUsageFlags);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pInheritanceInfo) {
+        count_VkCommandBufferInheritanceInfo(
+            featureBits, rootType,
+            (const VkCommandBufferInheritanceInfo*)(toCount->pInheritanceInfo), count);
+    }
+}
+
+void count_VkBufferCopy(uint32_t featureBits, VkStructureType rootType, const VkBufferCopy* toCount,
+                        size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+}
+
+void count_VkImageSubresourceLayers(uint32_t featureBits, VkStructureType rootType,
+                                    const VkImageSubresourceLayers* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkImageAspectFlags);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkBufferImageCopy(uint32_t featureBits, VkStructureType rootType,
+                             const VkBufferImageCopy* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    count_VkImageSubresourceLayers(featureBits, rootType,
+                                   (VkImageSubresourceLayers*)(&toCount->imageSubresource), count);
+    count_VkOffset3D(featureBits, rootType, (VkOffset3D*)(&toCount->imageOffset), count);
+    count_VkExtent3D(featureBits, rootType, (VkExtent3D*)(&toCount->imageExtent), count);
+}
+
+void count_VkClearColorValue(uint32_t featureBits, VkStructureType rootType,
+                             const VkClearColorValue* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += 4 * sizeof(float);
+}
+
+void count_VkClearDepthStencilValue(uint32_t featureBits, VkStructureType rootType,
+                                    const VkClearDepthStencilValue* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(float);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkClearValue(uint32_t featureBits, VkStructureType rootType, const VkClearValue* toCount,
+                        size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    count_VkClearColorValue(featureBits, rootType, (VkClearColorValue*)(&toCount->color), count);
+}
+
+void count_VkClearAttachment(uint32_t featureBits, VkStructureType rootType,
+                             const VkClearAttachment* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkImageAspectFlags);
+    *count += sizeof(uint32_t);
+    count_VkClearValue(featureBits, rootType, (VkClearValue*)(&toCount->clearValue), count);
+}
+
+void count_VkClearRect(uint32_t featureBits, VkStructureType rootType, const VkClearRect* toCount,
+                       size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    count_VkRect2D(featureBits, rootType, (VkRect2D*)(&toCount->rect), count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkImageBlit(uint32_t featureBits, VkStructureType rootType, const VkImageBlit* toCount,
+                       size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    count_VkImageSubresourceLayers(featureBits, rootType,
+                                   (VkImageSubresourceLayers*)(&toCount->srcSubresource), count);
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        count_VkOffset3D(featureBits, rootType, (VkOffset3D*)(toCount->srcOffsets + i), count);
+    }
+    count_VkImageSubresourceLayers(featureBits, rootType,
+                                   (VkImageSubresourceLayers*)(&toCount->dstSubresource), count);
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        count_VkOffset3D(featureBits, rootType, (VkOffset3D*)(toCount->dstOffsets + i), count);
+    }
+}
+
+void count_VkImageCopy(uint32_t featureBits, VkStructureType rootType, const VkImageCopy* toCount,
+                       size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    count_VkImageSubresourceLayers(featureBits, rootType,
+                                   (VkImageSubresourceLayers*)(&toCount->srcSubresource), count);
+    count_VkOffset3D(featureBits, rootType, (VkOffset3D*)(&toCount->srcOffset), count);
+    count_VkImageSubresourceLayers(featureBits, rootType,
+                                   (VkImageSubresourceLayers*)(&toCount->dstSubresource), count);
+    count_VkOffset3D(featureBits, rootType, (VkOffset3D*)(&toCount->dstOffset), count);
+    count_VkExtent3D(featureBits, rootType, (VkExtent3D*)(&toCount->extent), count);
+}
+
+void count_VkImageResolve(uint32_t featureBits, VkStructureType rootType,
+                          const VkImageResolve* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    count_VkImageSubresourceLayers(featureBits, rootType,
+                                   (VkImageSubresourceLayers*)(&toCount->srcSubresource), count);
+    count_VkOffset3D(featureBits, rootType, (VkOffset3D*)(&toCount->srcOffset), count);
+    count_VkImageSubresourceLayers(featureBits, rootType,
+                                   (VkImageSubresourceLayers*)(&toCount->dstSubresource), count);
+    count_VkOffset3D(featureBits, rootType, (VkOffset3D*)(&toCount->dstOffset), count);
+    count_VkExtent3D(featureBits, rootType, (VkExtent3D*)(&toCount->extent), count);
+}
+
+void count_VkRenderPassBeginInfo(uint32_t featureBits, VkStructureType rootType,
+                                 const VkRenderPassBeginInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    uint64_t cgen_var_1;
+    *count += 1 * 8;
+    count_VkRect2D(featureBits, rootType, (VkRect2D*)(&toCount->renderArea), count);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pClearValues) {
+        if (toCount) {
+            for (uint32_t i = 0; i < (uint32_t)toCount->clearValueCount; ++i) {
+                count_VkClearValue(featureBits, rootType,
+                                   (const VkClearValue*)(toCount->pClearValues + i), count);
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_VERSION_1_1
+void count_VkPhysicalDeviceSubgroupProperties(uint32_t featureBits, VkStructureType rootType,
+                                              const VkPhysicalDeviceSubgroupProperties* toCount,
+                                              size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkShaderStageFlags);
+    *count += sizeof(VkSubgroupFeatureFlags);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkBindBufferMemoryInfo(uint32_t featureBits, VkStructureType rootType,
+                                  const VkBindBufferMemoryInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    uint64_t cgen_var_1;
+    *count += 1 * 8;
+    *count += sizeof(VkDeviceSize);
+}
+
+void count_VkBindImageMemoryInfo(uint32_t featureBits, VkStructureType rootType,
+                                 const VkBindImageMemoryInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    uint64_t cgen_var_1;
+    *count += 1 * 8;
+    *count += sizeof(VkDeviceSize);
+}
+
+void count_VkPhysicalDevice16BitStorageFeatures(uint32_t featureBits, VkStructureType rootType,
+                                                const VkPhysicalDevice16BitStorageFeatures* toCount,
+                                                size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkMemoryDedicatedRequirements(uint32_t featureBits, VkStructureType rootType,
+                                         const VkMemoryDedicatedRequirements* toCount,
+                                         size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkMemoryDedicatedAllocateInfo(uint32_t featureBits, VkStructureType rootType,
+                                         const VkMemoryDedicatedAllocateInfo* toCount,
+                                         size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    uint64_t cgen_var_1;
+    *count += 1 * 8;
+}
+
+void count_VkMemoryAllocateFlagsInfo(uint32_t featureBits, VkStructureType rootType,
+                                     const VkMemoryAllocateFlagsInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkMemoryAllocateFlags);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkDeviceGroupRenderPassBeginInfo(uint32_t featureBits, VkStructureType rootType,
+                                            const VkDeviceGroupRenderPassBeginInfo* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->deviceRenderAreaCount; ++i) {
+            count_VkRect2D(featureBits, rootType,
+                           (const VkRect2D*)(toCount->pDeviceRenderAreas + i), count);
+        }
+    }
+}
+
+void count_VkDeviceGroupCommandBufferBeginInfo(uint32_t featureBits, VkStructureType rootType,
+                                               const VkDeviceGroupCommandBufferBeginInfo* toCount,
+                                               size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkDeviceGroupSubmitInfo(uint32_t featureBits, VkStructureType rootType,
+                                   const VkDeviceGroupSubmitInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->waitSemaphoreCount * sizeof(const uint32_t);
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->commandBufferCount * sizeof(const uint32_t);
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->signalSemaphoreCount * sizeof(const uint32_t);
+    }
+}
+
+void count_VkDeviceGroupBindSparseInfo(uint32_t featureBits, VkStructureType rootType,
+                                       const VkDeviceGroupBindSparseInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkBindBufferMemoryDeviceGroupInfo(uint32_t featureBits, VkStructureType rootType,
+                                             const VkBindBufferMemoryDeviceGroupInfo* toCount,
+                                             size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->deviceIndexCount * sizeof(const uint32_t);
+    }
+}
+
+void count_VkBindImageMemoryDeviceGroupInfo(uint32_t featureBits, VkStructureType rootType,
+                                            const VkBindImageMemoryDeviceGroupInfo* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->deviceIndexCount * sizeof(const uint32_t);
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->splitInstanceBindRegionCount; ++i) {
+            count_VkRect2D(featureBits, rootType,
+                           (const VkRect2D*)(toCount->pSplitInstanceBindRegions + i), count);
+        }
+    }
+}
+
+void count_VkPhysicalDeviceGroupProperties(uint32_t featureBits, VkStructureType rootType,
+                                           const VkPhysicalDeviceGroupProperties* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += VK_MAX_DEVICE_GROUP_SIZE * sizeof(VkPhysicalDevice);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkDeviceGroupDeviceCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                         const VkDeviceGroupDeviceCreateInfo* toCount,
+                                         size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    if (toCount->physicalDeviceCount) {
+        *count += toCount->physicalDeviceCount * 8;
+    }
+}
+
+void count_VkBufferMemoryRequirementsInfo2(uint32_t featureBits, VkStructureType rootType,
+                                           const VkBufferMemoryRequirementsInfo2* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+}
+
+void count_VkImageMemoryRequirementsInfo2(uint32_t featureBits, VkStructureType rootType,
+                                          const VkImageMemoryRequirementsInfo2* toCount,
+                                          size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+}
+
+void count_VkImageSparseMemoryRequirementsInfo2(uint32_t featureBits, VkStructureType rootType,
+                                                const VkImageSparseMemoryRequirementsInfo2* toCount,
+                                                size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+}
+
+void count_VkMemoryRequirements2(uint32_t featureBits, VkStructureType rootType,
+                                 const VkMemoryRequirements2* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkMemoryRequirements(featureBits, rootType,
+                               (VkMemoryRequirements*)(&toCount->memoryRequirements), count);
+}
+
+void count_VkSparseImageMemoryRequirements2(uint32_t featureBits, VkStructureType rootType,
+                                            const VkSparseImageMemoryRequirements2* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkSparseImageMemoryRequirements(
+        featureBits, rootType, (VkSparseImageMemoryRequirements*)(&toCount->memoryRequirements),
+        count);
+}
+
+void count_VkPhysicalDeviceFeatures2(uint32_t featureBits, VkStructureType rootType,
+                                     const VkPhysicalDeviceFeatures2* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkPhysicalDeviceFeatures(featureBits, rootType,
+                                   (VkPhysicalDeviceFeatures*)(&toCount->features), count);
+}
+
+void count_VkPhysicalDeviceProperties2(uint32_t featureBits, VkStructureType rootType,
+                                       const VkPhysicalDeviceProperties2* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkPhysicalDeviceProperties(featureBits, rootType,
+                                     (VkPhysicalDeviceProperties*)(&toCount->properties), count);
+}
+
+void count_VkFormatProperties2(uint32_t featureBits, VkStructureType rootType,
+                               const VkFormatProperties2* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkFormatProperties(featureBits, rootType,
+                             (VkFormatProperties*)(&toCount->formatProperties), count);
+}
+
+void count_VkImageFormatProperties2(uint32_t featureBits, VkStructureType rootType,
+                                    const VkImageFormatProperties2* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkImageFormatProperties(
+        featureBits, rootType, (VkImageFormatProperties*)(&toCount->imageFormatProperties), count);
+}
+
+void count_VkPhysicalDeviceImageFormatInfo2(uint32_t featureBits, VkStructureType rootType,
+                                            const VkPhysicalDeviceImageFormatInfo2* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkFormat);
+    *count += sizeof(VkImageType);
+    *count += sizeof(VkImageTiling);
+    *count += sizeof(VkImageUsageFlags);
+    *count += sizeof(VkImageCreateFlags);
+}
+
+void count_VkQueueFamilyProperties2(uint32_t featureBits, VkStructureType rootType,
+                                    const VkQueueFamilyProperties2* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkQueueFamilyProperties(
+        featureBits, rootType, (VkQueueFamilyProperties*)(&toCount->queueFamilyProperties), count);
+}
+
+void count_VkPhysicalDeviceMemoryProperties2(uint32_t featureBits, VkStructureType rootType,
+                                             const VkPhysicalDeviceMemoryProperties2* toCount,
+                                             size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkPhysicalDeviceMemoryProperties(
+        featureBits, rootType, (VkPhysicalDeviceMemoryProperties*)(&toCount->memoryProperties),
+        count);
+}
+
+void count_VkSparseImageFormatProperties2(uint32_t featureBits, VkStructureType rootType,
+                                          const VkSparseImageFormatProperties2* toCount,
+                                          size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkSparseImageFormatProperties(
+        featureBits, rootType, (VkSparseImageFormatProperties*)(&toCount->properties), count);
+}
+
+void count_VkPhysicalDeviceSparseImageFormatInfo2(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceSparseImageFormatInfo2* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkFormat);
+    *count += sizeof(VkImageType);
+    *count += sizeof(VkSampleCountFlagBits);
+    *count += sizeof(VkImageUsageFlags);
+    *count += sizeof(VkImageTiling);
+}
+
+void count_VkPhysicalDevicePointClippingProperties(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDevicePointClippingProperties* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPointClippingBehavior);
+}
+
+void count_VkInputAttachmentAspectReference(uint32_t featureBits, VkStructureType rootType,
+                                            const VkInputAttachmentAspectReference* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkImageAspectFlags);
+}
+
+void count_VkRenderPassInputAttachmentAspectCreateInfo(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkRenderPassInputAttachmentAspectCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->aspectReferenceCount; ++i) {
+            count_VkInputAttachmentAspectReference(
+                featureBits, rootType,
+                (const VkInputAttachmentAspectReference*)(toCount->pAspectReferences + i), count);
+        }
+    }
+}
+
+void count_VkImageViewUsageCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                      const VkImageViewUsageCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkImageUsageFlags);
+}
+
+void count_VkPipelineTessellationDomainOriginStateCreateInfo(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineTessellationDomainOriginStateCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkTessellationDomainOrigin);
+}
+
+void count_VkRenderPassMultiviewCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                           const VkRenderPassMultiviewCreateInfo* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->subpassCount * sizeof(const uint32_t);
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->dependencyCount * sizeof(const int32_t);
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->correlationMaskCount * sizeof(const uint32_t);
+    }
+}
+
+void count_VkPhysicalDeviceMultiviewFeatures(uint32_t featureBits, VkStructureType rootType,
+                                             const VkPhysicalDeviceMultiviewFeatures* toCount,
+                                             size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceMultiviewProperties(uint32_t featureBits, VkStructureType rootType,
+                                               const VkPhysicalDeviceMultiviewProperties* toCount,
+                                               size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkPhysicalDeviceVariablePointersFeatures(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceVariablePointersFeatures* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceProtectedMemoryFeatures(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceProtectedMemoryFeatures* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceProtectedMemoryProperties(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceProtectedMemoryProperties* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkDeviceQueueInfo2(uint32_t featureBits, VkStructureType rootType,
+                              const VkDeviceQueueInfo2* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDeviceQueueCreateFlags);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkProtectedSubmitInfo(uint32_t featureBits, VkStructureType rootType,
+                                 const VkProtectedSubmitInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkSamplerYcbcrConversionCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                              const VkSamplerYcbcrConversionCreateInfo* toCount,
+                                              size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkFormat);
+    *count += sizeof(VkSamplerYcbcrModelConversion);
+    *count += sizeof(VkSamplerYcbcrRange);
+    count_VkComponentMapping(featureBits, rootType, (VkComponentMapping*)(&toCount->components),
+                             count);
+    *count += sizeof(VkChromaLocation);
+    *count += sizeof(VkChromaLocation);
+    *count += sizeof(VkFilter);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkSamplerYcbcrConversionInfo(uint32_t featureBits, VkStructureType rootType,
+                                        const VkSamplerYcbcrConversionInfo* toCount,
+                                        size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+}
+
+void count_VkBindImagePlaneMemoryInfo(uint32_t featureBits, VkStructureType rootType,
+                                      const VkBindImagePlaneMemoryInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkImageAspectFlagBits);
+}
+
+void count_VkImagePlaneMemoryRequirementsInfo(uint32_t featureBits, VkStructureType rootType,
+                                              const VkImagePlaneMemoryRequirementsInfo* toCount,
+                                              size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkImageAspectFlagBits);
+}
+
+void count_VkPhysicalDeviceSamplerYcbcrConversionFeatures(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceSamplerYcbcrConversionFeatures* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkSamplerYcbcrConversionImageFormatProperties(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkSamplerYcbcrConversionImageFormatProperties* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkDescriptorUpdateTemplateEntry(uint32_t featureBits, VkStructureType rootType,
+                                           const VkDescriptorUpdateTemplateEntry* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkDescriptorType);
+    *count += 8;
+    *count += 8;
+}
+
+void count_VkDescriptorUpdateTemplateCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                                const VkDescriptorUpdateTemplateCreateInfo* toCount,
+                                                size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDescriptorUpdateTemplateCreateFlags);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->descriptorUpdateEntryCount; ++i) {
+            count_VkDescriptorUpdateTemplateEntry(
+                featureBits, rootType,
+                (const VkDescriptorUpdateTemplateEntry*)(toCount->pDescriptorUpdateEntries + i),
+                count);
+        }
+    }
+    *count += sizeof(VkDescriptorUpdateTemplateType);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkPipelineBindPoint);
+    uint64_t cgen_var_1;
+    *count += 1 * 8;
+    *count += sizeof(uint32_t);
+}
+
+void count_VkExternalMemoryProperties(uint32_t featureBits, VkStructureType rootType,
+                                      const VkExternalMemoryProperties* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkExternalMemoryFeatureFlags);
+    *count += sizeof(VkExternalMemoryHandleTypeFlags);
+    *count += sizeof(VkExternalMemoryHandleTypeFlags);
+}
+
+void count_VkPhysicalDeviceExternalImageFormatInfo(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceExternalImageFormatInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkExternalMemoryHandleTypeFlagBits);
+}
+
+void count_VkExternalImageFormatProperties(uint32_t featureBits, VkStructureType rootType,
+                                           const VkExternalImageFormatProperties* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkExternalMemoryProperties(
+        featureBits, rootType, (VkExternalMemoryProperties*)(&toCount->externalMemoryProperties),
+        count);
+}
+
+void count_VkPhysicalDeviceExternalBufferInfo(uint32_t featureBits, VkStructureType rootType,
+                                              const VkPhysicalDeviceExternalBufferInfo* toCount,
+                                              size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBufferCreateFlags);
+    *count += sizeof(VkBufferUsageFlags);
+    *count += sizeof(VkExternalMemoryHandleTypeFlagBits);
+}
+
+void count_VkExternalBufferProperties(uint32_t featureBits, VkStructureType rootType,
+                                      const VkExternalBufferProperties* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkExternalMemoryProperties(
+        featureBits, rootType, (VkExternalMemoryProperties*)(&toCount->externalMemoryProperties),
+        count);
+}
+
+void count_VkPhysicalDeviceIDProperties(uint32_t featureBits, VkStructureType rootType,
+                                        const VkPhysicalDeviceIDProperties* toCount,
+                                        size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += VK_UUID_SIZE * sizeof(uint8_t);
+    *count += VK_UUID_SIZE * sizeof(uint8_t);
+    *count += VK_LUID_SIZE * sizeof(uint8_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkExternalMemoryImageCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                           const VkExternalMemoryImageCreateInfo* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkExternalMemoryHandleTypeFlags);
+}
+
+void count_VkExternalMemoryBufferCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                            const VkExternalMemoryBufferCreateInfo* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkExternalMemoryHandleTypeFlags);
+}
+
+void count_VkExportMemoryAllocateInfo(uint32_t featureBits, VkStructureType rootType,
+                                      const VkExportMemoryAllocateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkExternalMemoryHandleTypeFlags);
+}
+
+void count_VkPhysicalDeviceExternalFenceInfo(uint32_t featureBits, VkStructureType rootType,
+                                             const VkPhysicalDeviceExternalFenceInfo* toCount,
+                                             size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkExternalFenceHandleTypeFlagBits);
+}
+
+void count_VkExternalFenceProperties(uint32_t featureBits, VkStructureType rootType,
+                                     const VkExternalFenceProperties* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkExternalFenceHandleTypeFlags);
+    *count += sizeof(VkExternalFenceHandleTypeFlags);
+    *count += sizeof(VkExternalFenceFeatureFlags);
+}
+
+void count_VkExportFenceCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                   const VkExportFenceCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkExternalFenceHandleTypeFlags);
+}
+
+void count_VkExportSemaphoreCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                       const VkExportSemaphoreCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkExternalSemaphoreHandleTypeFlags);
+}
+
+void count_VkPhysicalDeviceExternalSemaphoreInfo(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceExternalSemaphoreInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkExternalSemaphoreHandleTypeFlagBits);
+}
+
+void count_VkExternalSemaphoreProperties(uint32_t featureBits, VkStructureType rootType,
+                                         const VkExternalSemaphoreProperties* toCount,
+                                         size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkExternalSemaphoreHandleTypeFlags);
+    *count += sizeof(VkExternalSemaphoreHandleTypeFlags);
+    *count += sizeof(VkExternalSemaphoreFeatureFlags);
+}
+
+void count_VkPhysicalDeviceMaintenance3Properties(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceMaintenance3Properties* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkDeviceSize);
+}
+
+void count_VkDescriptorSetLayoutSupport(uint32_t featureBits, VkStructureType rootType,
+                                        const VkDescriptorSetLayoutSupport* toCount,
+                                        size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceShaderDrawParametersFeatures(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderDrawParametersFeatures* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_VERSION_1_2
+void count_VkPhysicalDeviceVulkan11Features(uint32_t featureBits, VkStructureType rootType,
+                                            const VkPhysicalDeviceVulkan11Features* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceVulkan11Properties(uint32_t featureBits, VkStructureType rootType,
+                                              const VkPhysicalDeviceVulkan11Properties* toCount,
+                                              size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += VK_UUID_SIZE * sizeof(uint8_t);
+    *count += VK_UUID_SIZE * sizeof(uint8_t);
+    *count += VK_LUID_SIZE * sizeof(uint8_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkBool32);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkShaderStageFlags);
+    *count += sizeof(VkSubgroupFeatureFlags);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkPointClippingBehavior);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkBool32);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkDeviceSize);
+}
+
+void count_VkPhysicalDeviceVulkan12Features(uint32_t featureBits, VkStructureType rootType,
+                                            const VkPhysicalDeviceVulkan12Features* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkConformanceVersion(uint32_t featureBits, VkStructureType rootType,
+                                const VkConformanceVersion* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint8_t);
+    *count += sizeof(uint8_t);
+    *count += sizeof(uint8_t);
+    *count += sizeof(uint8_t);
+}
+
+void count_VkPhysicalDeviceVulkan12Properties(uint32_t featureBits, VkStructureType rootType,
+                                              const VkPhysicalDeviceVulkan12Properties* toCount,
+                                              size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDriverId);
+    *count += VK_MAX_DRIVER_NAME_SIZE * sizeof(char);
+    *count += VK_MAX_DRIVER_INFO_SIZE * sizeof(char);
+    count_VkConformanceVersion(featureBits, rootType,
+                               (VkConformanceVersion*)(&toCount->conformanceVersion), count);
+    *count += sizeof(VkShaderFloatControlsIndependence);
+    *count += sizeof(VkShaderFloatControlsIndependence);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkResolveModeFlags);
+    *count += sizeof(VkResolveModeFlags);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(uint64_t);
+    *count += sizeof(VkSampleCountFlags);
+}
+
+void count_VkImageFormatListCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                       const VkImageFormatListCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->viewFormatCount * sizeof(const VkFormat);
+    }
+}
+
+void count_VkAttachmentDescription2(uint32_t featureBits, VkStructureType rootType,
+                                    const VkAttachmentDescription2* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkAttachmentDescriptionFlags);
+    *count += sizeof(VkFormat);
+    *count += sizeof(VkSampleCountFlagBits);
+    *count += sizeof(VkAttachmentLoadOp);
+    *count += sizeof(VkAttachmentStoreOp);
+    *count += sizeof(VkAttachmentLoadOp);
+    *count += sizeof(VkAttachmentStoreOp);
+    *count += sizeof(VkImageLayout);
+    *count += sizeof(VkImageLayout);
+}
+
+void count_VkAttachmentReference2(uint32_t featureBits, VkStructureType rootType,
+                                  const VkAttachmentReference2* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkImageLayout);
+    *count += sizeof(VkImageAspectFlags);
+}
+
+void count_VkSubpassDescription2(uint32_t featureBits, VkStructureType rootType,
+                                 const VkSubpassDescription2* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkSubpassDescriptionFlags);
+    *count += sizeof(VkPipelineBindPoint);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->inputAttachmentCount; ++i) {
+            count_VkAttachmentReference2(
+                featureBits, rootType,
+                (const VkAttachmentReference2*)(toCount->pInputAttachments + i), count);
+        }
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->colorAttachmentCount; ++i) {
+            count_VkAttachmentReference2(
+                featureBits, rootType,
+                (const VkAttachmentReference2*)(toCount->pColorAttachments + i), count);
+        }
+    }
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pResolveAttachments) {
+        if (toCount) {
+            for (uint32_t i = 0; i < (uint32_t)toCount->colorAttachmentCount; ++i) {
+                count_VkAttachmentReference2(
+                    featureBits, rootType,
+                    (const VkAttachmentReference2*)(toCount->pResolveAttachments + i), count);
+            }
+        }
+    }
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pDepthStencilAttachment) {
+        count_VkAttachmentReference2(
+            featureBits, rootType,
+            (const VkAttachmentReference2*)(toCount->pDepthStencilAttachment), count);
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->preserveAttachmentCount * sizeof(const uint32_t);
+    }
+}
+
+void count_VkSubpassDependency2(uint32_t featureBits, VkStructureType rootType,
+                                const VkSubpassDependency2* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkPipelineStageFlags);
+    *count += sizeof(VkPipelineStageFlags);
+    *count += sizeof(VkAccessFlags);
+    *count += sizeof(VkAccessFlags);
+    *count += sizeof(VkDependencyFlags);
+    *count += sizeof(int32_t);
+}
+
+void count_VkRenderPassCreateInfo2(uint32_t featureBits, VkStructureType rootType,
+                                   const VkRenderPassCreateInfo2* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkRenderPassCreateFlags);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->attachmentCount; ++i) {
+            count_VkAttachmentDescription2(
+                featureBits, rootType, (const VkAttachmentDescription2*)(toCount->pAttachments + i),
+                count);
+        }
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->subpassCount; ++i) {
+            count_VkSubpassDescription2(featureBits, rootType,
+                                        (const VkSubpassDescription2*)(toCount->pSubpasses + i),
+                                        count);
+        }
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->dependencyCount; ++i) {
+            count_VkSubpassDependency2(featureBits, rootType,
+                                       (const VkSubpassDependency2*)(toCount->pDependencies + i),
+                                       count);
+        }
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->correlatedViewMaskCount * sizeof(const uint32_t);
+    }
+}
+
+void count_VkSubpassBeginInfo(uint32_t featureBits, VkStructureType rootType,
+                              const VkSubpassBeginInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkSubpassContents);
+}
+
+void count_VkSubpassEndInfo(uint32_t featureBits, VkStructureType rootType,
+                            const VkSubpassEndInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+}
+
+void count_VkPhysicalDevice8BitStorageFeatures(uint32_t featureBits, VkStructureType rootType,
+                                               const VkPhysicalDevice8BitStorageFeatures* toCount,
+                                               size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceDriverProperties(uint32_t featureBits, VkStructureType rootType,
+                                            const VkPhysicalDeviceDriverProperties* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDriverId);
+    *count += VK_MAX_DRIVER_NAME_SIZE * sizeof(char);
+    *count += VK_MAX_DRIVER_INFO_SIZE * sizeof(char);
+    count_VkConformanceVersion(featureBits, rootType,
+                               (VkConformanceVersion*)(&toCount->conformanceVersion), count);
+}
+
+void count_VkPhysicalDeviceShaderAtomicInt64Features(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderAtomicInt64Features* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceShaderFloat16Int8Features(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderFloat16Int8Features* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceFloatControlsProperties(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceFloatControlsProperties* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkShaderFloatControlsIndependence);
+    *count += sizeof(VkShaderFloatControlsIndependence);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkDescriptorSetLayoutBindingFlagsCreateInfo(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkDescriptorSetLayoutBindingFlagsCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pBindingFlags) {
+        if (toCount) {
+            *count += toCount->bindingCount * sizeof(const VkDescriptorBindingFlags);
+        }
+    }
+}
+
+void count_VkPhysicalDeviceDescriptorIndexingFeatures(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceDescriptorIndexingFeatures* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceDescriptorIndexingProperties(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceDescriptorIndexingProperties* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkDescriptorSetVariableDescriptorCountAllocateInfo(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkDescriptorSetVariableDescriptorCountAllocateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->descriptorSetCount * sizeof(const uint32_t);
+    }
+}
+
+void count_VkDescriptorSetVariableDescriptorCountLayoutSupport(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkDescriptorSetVariableDescriptorCountLayoutSupport* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkSubpassDescriptionDepthStencilResolve(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkSubpassDescriptionDepthStencilResolve* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkResolveModeFlagBits);
+    *count += sizeof(VkResolveModeFlagBits);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pDepthStencilResolveAttachment) {
+        count_VkAttachmentReference2(
+            featureBits, rootType,
+            (const VkAttachmentReference2*)(toCount->pDepthStencilResolveAttachment), count);
+    }
+}
+
+void count_VkPhysicalDeviceDepthStencilResolveProperties(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceDepthStencilResolveProperties* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkResolveModeFlags);
+    *count += sizeof(VkResolveModeFlags);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceScalarBlockLayoutFeatures(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceScalarBlockLayoutFeatures* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkImageStencilUsageCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                         const VkImageStencilUsageCreateInfo* toCount,
+                                         size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkImageUsageFlags);
+}
+
+void count_VkSamplerReductionModeCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                            const VkSamplerReductionModeCreateInfo* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkSamplerReductionMode);
+}
+
+void count_VkPhysicalDeviceSamplerFilterMinmaxProperties(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceSamplerFilterMinmaxProperties* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceVulkanMemoryModelFeatures(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceVulkanMemoryModelFeatures* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceImagelessFramebufferFeatures(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceImagelessFramebufferFeatures* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkFramebufferAttachmentImageInfo(uint32_t featureBits, VkStructureType rootType,
+                                            const VkFramebufferAttachmentImageInfo* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkImageCreateFlags);
+    *count += sizeof(VkImageUsageFlags);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->viewFormatCount * sizeof(const VkFormat);
+    }
+}
+
+void count_VkFramebufferAttachmentsCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                              const VkFramebufferAttachmentsCreateInfo* toCount,
+                                              size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->attachmentImageInfoCount; ++i) {
+            count_VkFramebufferAttachmentImageInfo(
+                featureBits, rootType,
+                (const VkFramebufferAttachmentImageInfo*)(toCount->pAttachmentImageInfos + i),
+                count);
+        }
+    }
+}
+
+void count_VkRenderPassAttachmentBeginInfo(uint32_t featureBits, VkStructureType rootType,
+                                           const VkRenderPassAttachmentBeginInfo* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    if (toCount->attachmentCount) {
+        *count += toCount->attachmentCount * 8;
+    }
+}
+
+void count_VkPhysicalDeviceUniformBufferStandardLayoutFeatures(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceUniformBufferStandardLayoutFeatures* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkAttachmentReferenceStencilLayout(uint32_t featureBits, VkStructureType rootType,
+                                              const VkAttachmentReferenceStencilLayout* toCount,
+                                              size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkImageLayout);
+}
+
+void count_VkAttachmentDescriptionStencilLayout(uint32_t featureBits, VkStructureType rootType,
+                                                const VkAttachmentDescriptionStencilLayout* toCount,
+                                                size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkImageLayout);
+    *count += sizeof(VkImageLayout);
+}
+
+void count_VkPhysicalDeviceHostQueryResetFeatures(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceHostQueryResetFeatures* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceTimelineSemaphoreFeatures(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceTimelineSemaphoreFeatures* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceTimelineSemaphoreProperties(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceTimelineSemaphoreProperties* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint64_t);
+}
+
+void count_VkSemaphoreTypeCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                     const VkSemaphoreTypeCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkSemaphoreType);
+    *count += sizeof(uint64_t);
+}
+
+void count_VkTimelineSemaphoreSubmitInfo(uint32_t featureBits, VkStructureType rootType,
+                                         const VkTimelineSemaphoreSubmitInfo* toCount,
+                                         size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pWaitSemaphoreValues) {
+        if (toCount) {
+            *count += toCount->waitSemaphoreValueCount * sizeof(const uint64_t);
+        }
+    }
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pSignalSemaphoreValues) {
+        if (toCount) {
+            *count += toCount->signalSemaphoreValueCount * sizeof(const uint64_t);
+        }
+    }
+}
+
+void count_VkSemaphoreWaitInfo(uint32_t featureBits, VkStructureType rootType,
+                               const VkSemaphoreWaitInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkSemaphoreWaitFlags);
+    *count += sizeof(uint32_t);
+    if (toCount->semaphoreCount) {
+        *count += toCount->semaphoreCount * 8;
+    }
+    if (toCount) {
+        *count += toCount->semaphoreCount * sizeof(const uint64_t);
+    }
+}
+
+void count_VkSemaphoreSignalInfo(uint32_t featureBits, VkStructureType rootType,
+                                 const VkSemaphoreSignalInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(uint64_t);
+}
+
+void count_VkPhysicalDeviceBufferDeviceAddressFeatures(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceBufferDeviceAddressFeatures* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkBufferDeviceAddressInfo(uint32_t featureBits, VkStructureType rootType,
+                                     const VkBufferDeviceAddressInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+}
+
+void count_VkBufferOpaqueCaptureAddressCreateInfo(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkBufferOpaqueCaptureAddressCreateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint64_t);
+}
+
+void count_VkMemoryOpaqueCaptureAddressAllocateInfo(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkMemoryOpaqueCaptureAddressAllocateInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint64_t);
+}
+
+void count_VkDeviceMemoryOpaqueCaptureAddressInfo(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkDeviceMemoryOpaqueCaptureAddressInfo* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+}
+
+#endif
+#ifdef VK_KHR_surface
+void count_VkSurfaceCapabilitiesKHR(uint32_t featureBits, VkStructureType rootType,
+                                    const VkSurfaceCapabilitiesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->currentExtent), count);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->minImageExtent), count);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->maxImageExtent), count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkSurfaceTransformFlagsKHR);
+    *count += sizeof(VkSurfaceTransformFlagBitsKHR);
+    *count += sizeof(VkCompositeAlphaFlagsKHR);
+    *count += sizeof(VkImageUsageFlags);
+}
+
+void count_VkSurfaceFormatKHR(uint32_t featureBits, VkStructureType rootType,
+                              const VkSurfaceFormatKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkFormat);
+    *count += sizeof(VkColorSpaceKHR);
+}
+
+#endif
+#ifdef VK_KHR_swapchain
+void count_VkSwapchainCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                    const VkSwapchainCreateInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkSwapchainCreateFlagsKHR);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkFormat);
+    *count += sizeof(VkColorSpaceKHR);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->imageExtent), count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkImageUsageFlags);
+    *count += sizeof(VkSharingMode);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pQueueFamilyIndices) {
+        if (toCount) {
+            *count += toCount->queueFamilyIndexCount * sizeof(const uint32_t);
+        }
+    }
+    *count += sizeof(VkSurfaceTransformFlagBitsKHR);
+    *count += sizeof(VkCompositeAlphaFlagBitsKHR);
+    *count += sizeof(VkPresentModeKHR);
+    *count += sizeof(VkBool32);
+    uint64_t cgen_var_1;
+    *count += 1 * 8;
+}
+
+void count_VkPresentInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                            const VkPresentInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    if (toCount->waitSemaphoreCount) {
+        *count += toCount->waitSemaphoreCount * 8;
+    }
+    *count += sizeof(uint32_t);
+    if (toCount->swapchainCount) {
+        *count += toCount->swapchainCount * 8;
+    }
+    if (toCount) {
+        *count += toCount->swapchainCount * sizeof(const uint32_t);
+    }
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pResults) {
+        if (toCount) {
+            *count += toCount->swapchainCount * sizeof(VkResult);
+        }
+    }
+}
+
+void count_VkImageSwapchainCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                         const VkImageSwapchainCreateInfoKHR* toCount,
+                                         size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+}
+
+void count_VkBindImageMemorySwapchainInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                             const VkBindImageMemorySwapchainInfoKHR* toCount,
+                                             size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(uint32_t);
+}
+
+void count_VkAcquireNextImageInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                     const VkAcquireNextImageInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(uint64_t);
+    uint64_t cgen_var_1;
+    *count += 1 * 8;
+    uint64_t cgen_var_2;
+    *count += 1 * 8;
+    *count += sizeof(uint32_t);
+}
+
+void count_VkDeviceGroupPresentCapabilitiesKHR(uint32_t featureBits, VkStructureType rootType,
+                                               const VkDeviceGroupPresentCapabilitiesKHR* toCount,
+                                               size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += VK_MAX_DEVICE_GROUP_SIZE * sizeof(uint32_t);
+    *count += sizeof(VkDeviceGroupPresentModeFlagsKHR);
+}
+
+void count_VkDeviceGroupPresentInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                       const VkDeviceGroupPresentInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->swapchainCount * sizeof(const uint32_t);
+    }
+    *count += sizeof(VkDeviceGroupPresentModeFlagBitsKHR);
+}
+
+void count_VkDeviceGroupSwapchainCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                               const VkDeviceGroupSwapchainCreateInfoKHR* toCount,
+                                               size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDeviceGroupPresentModeFlagsKHR);
+}
+
+#endif
+#ifdef VK_KHR_display
+void count_VkDisplayModeParametersKHR(uint32_t featureBits, VkStructureType rootType,
+                                      const VkDisplayModeParametersKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->visibleRegion), count);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkDisplayModeCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                      const VkDisplayModeCreateInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDisplayModeCreateFlagsKHR);
+    count_VkDisplayModeParametersKHR(featureBits, rootType,
+                                     (VkDisplayModeParametersKHR*)(&toCount->parameters), count);
+}
+
+void count_VkDisplayModePropertiesKHR(uint32_t featureBits, VkStructureType rootType,
+                                      const VkDisplayModePropertiesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    count_VkDisplayModeParametersKHR(featureBits, rootType,
+                                     (VkDisplayModeParametersKHR*)(&toCount->parameters), count);
+}
+
+void count_VkDisplayPlaneCapabilitiesKHR(uint32_t featureBits, VkStructureType rootType,
+                                         const VkDisplayPlaneCapabilitiesKHR* toCount,
+                                         size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkDisplayPlaneAlphaFlagsKHR);
+    count_VkOffset2D(featureBits, rootType, (VkOffset2D*)(&toCount->minSrcPosition), count);
+    count_VkOffset2D(featureBits, rootType, (VkOffset2D*)(&toCount->maxSrcPosition), count);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->minSrcExtent), count);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->maxSrcExtent), count);
+    count_VkOffset2D(featureBits, rootType, (VkOffset2D*)(&toCount->minDstPosition), count);
+    count_VkOffset2D(featureBits, rootType, (VkOffset2D*)(&toCount->maxDstPosition), count);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->minDstExtent), count);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->maxDstExtent), count);
+}
+
+void count_VkDisplayPlanePropertiesKHR(uint32_t featureBits, VkStructureType rootType,
+                                       const VkDisplayPlanePropertiesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(uint32_t);
+}
+
+void count_VkDisplayPropertiesKHR(uint32_t featureBits, VkStructureType rootType,
+                                  const VkDisplayPropertiesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(uint32_t) + (toCount->displayName ? strlen(toCount->displayName) : 0);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->physicalDimensions), count);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->physicalResolution), count);
+    *count += sizeof(VkSurfaceTransformFlagsKHR);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkDisplaySurfaceCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                         const VkDisplaySurfaceCreateInfoKHR* toCount,
+                                         size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDisplaySurfaceCreateFlagsKHR);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkSurfaceTransformFlagBitsKHR);
+    *count += sizeof(float);
+    *count += sizeof(VkDisplayPlaneAlphaFlagBitsKHR);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->imageExtent), count);
+}
+
+#endif
+#ifdef VK_KHR_display_swapchain
+void count_VkDisplayPresentInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                   const VkDisplayPresentInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkRect2D(featureBits, rootType, (VkRect2D*)(&toCount->srcRect), count);
+    count_VkRect2D(featureBits, rootType, (VkRect2D*)(&toCount->dstRect), count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_KHR_xlib_surface
+void count_VkXlibSurfaceCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                      const VkXlibSurfaceCreateInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkXlibSurfaceCreateFlagsKHR);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->dpy) {
+        *count += sizeof(Display);
+    }
+    *count += sizeof(Window);
+}
+
+#endif
+#ifdef VK_KHR_xcb_surface
+void count_VkXcbSurfaceCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                     const VkXcbSurfaceCreateInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkXcbSurfaceCreateFlagsKHR);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->connection) {
+        *count += sizeof(xcb_connection_t);
+    }
+    *count += sizeof(xcb_window_t);
+}
+
+#endif
+#ifdef VK_KHR_wayland_surface
+void count_VkWaylandSurfaceCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                         const VkWaylandSurfaceCreateInfoKHR* toCount,
+                                         size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkWaylandSurfaceCreateFlagsKHR);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->display) {
+        *count += sizeof(wl_display);
+    }
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->surface) {
+        *count += sizeof(wl_surface);
+    }
+}
+
+#endif
+#ifdef VK_KHR_android_surface
+void count_VkAndroidSurfaceCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                         const VkAndroidSurfaceCreateInfoKHR* toCount,
+                                         size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkAndroidSurfaceCreateFlagsKHR);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->window) {
+        *count += sizeof(ANativeWindow);
+    }
+}
+
+#endif
+#ifdef VK_KHR_win32_surface
+void count_VkWin32SurfaceCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                       const VkWin32SurfaceCreateInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkWin32SurfaceCreateFlagsKHR);
+    *count += sizeof(HINSTANCE);
+    *count += sizeof(HWND);
+}
+
+#endif
+#ifdef VK_KHR_sampler_mirror_clamp_to_edge
+#endif
+#ifdef VK_KHR_video_queue
+void count_VkVideoQueueFamilyProperties2KHR(uint32_t featureBits, VkStructureType rootType,
+                                            const VkVideoQueueFamilyProperties2KHR* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkVideoCodecOperationFlagsKHR);
+}
+
+void count_VkVideoProfileKHR(uint32_t featureBits, VkStructureType rootType,
+                             const VkVideoProfileKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkVideoCodecOperationFlagBitsKHR);
+    *count += sizeof(VkVideoChromaSubsamplingFlagsKHR);
+    *count += sizeof(VkVideoComponentBitDepthFlagsKHR);
+    *count += sizeof(VkVideoComponentBitDepthFlagsKHR);
+}
+
+void count_VkVideoProfilesKHR(uint32_t featureBits, VkStructureType rootType,
+                              const VkVideoProfilesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    count_VkVideoProfileKHR(featureBits, rootType, (const VkVideoProfileKHR*)(toCount->pProfiles),
+                            count);
+}
+
+void count_VkVideoCapabilitiesKHR(uint32_t featureBits, VkStructureType rootType,
+                                  const VkVideoCapabilitiesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkVideoCapabilityFlagsKHR);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->videoPictureExtentGranularity),
+                     count);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->minExtent), count);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->maxExtent), count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkPhysicalDeviceVideoFormatInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                              const VkPhysicalDeviceVideoFormatInfoKHR* toCount,
+                                              size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkImageUsageFlags);
+    count_VkVideoProfilesKHR(featureBits, rootType,
+                             (const VkVideoProfilesKHR*)(toCount->pVideoProfiles), count);
+}
+
+void count_VkVideoFormatPropertiesKHR(uint32_t featureBits, VkStructureType rootType,
+                                      const VkVideoFormatPropertiesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkFormat);
+}
+
+void count_VkVideoPictureResourceKHR(uint32_t featureBits, VkStructureType rootType,
+                                     const VkVideoPictureResourceKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkOffset2D(featureBits, rootType, (VkOffset2D*)(&toCount->codedOffset), count);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->codedExtent), count);
+    *count += sizeof(uint32_t);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+}
+
+void count_VkVideoReferenceSlotKHR(uint32_t featureBits, VkStructureType rootType,
+                                   const VkVideoReferenceSlotKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(int8_t);
+    count_VkVideoPictureResourceKHR(featureBits, rootType,
+                                    (const VkVideoPictureResourceKHR*)(toCount->pPictureResource),
+                                    count);
+}
+
+void count_VkVideoGetMemoryPropertiesKHR(uint32_t featureBits, VkStructureType rootType,
+                                         const VkVideoGetMemoryPropertiesKHR* toCount,
+                                         size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    count_VkMemoryRequirements2(featureBits, rootType,
+                                (VkMemoryRequirements2*)(toCount->pMemoryRequirements), count);
+}
+
+void count_VkVideoBindMemoryKHR(uint32_t featureBits, VkStructureType rootType,
+                                const VkVideoBindMemoryKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+}
+
+void count_VkVideoSessionCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                       const VkVideoSessionCreateInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkVideoSessionCreateFlagsKHR);
+    count_VkVideoProfileKHR(featureBits, rootType,
+                            (const VkVideoProfileKHR*)(toCount->pVideoProfile), count);
+    *count += sizeof(VkFormat);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->maxCodedExtent), count);
+    *count += sizeof(VkFormat);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkVideoSessionParametersCreateInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoSessionParametersCreateInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += 8;
+    *count += 8;
+}
+
+void count_VkVideoSessionParametersUpdateInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoSessionParametersUpdateInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkVideoBeginCodingInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                     const VkVideoBeginCodingInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkVideoBeginCodingFlagsKHR);
+    *count += sizeof(VkVideoCodingQualityPresetFlagsKHR);
+    *count += 8;
+    *count += 8;
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->referenceSlotCount; ++i) {
+            count_VkVideoReferenceSlotKHR(
+                featureBits, rootType,
+                (const VkVideoReferenceSlotKHR*)(toCount->pReferenceSlots + i), count);
+        }
+    }
+}
+
+void count_VkVideoEndCodingInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                   const VkVideoEndCodingInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkVideoEndCodingFlagsKHR);
+}
+
+void count_VkVideoCodingControlInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                       const VkVideoCodingControlInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkVideoCodingControlFlagsKHR);
+}
+
+#endif
+#ifdef VK_KHR_video_decode_queue
+void count_VkVideoDecodeInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                const VkVideoDecodeInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkVideoDecodeFlagsKHR);
+    count_VkOffset2D(featureBits, rootType, (VkOffset2D*)(&toCount->codedOffset), count);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->codedExtent), count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+    count_VkVideoPictureResourceKHR(
+        featureBits, rootType, (VkVideoPictureResourceKHR*)(&toCount->dstPictureResource), count);
+    count_VkVideoReferenceSlotKHR(featureBits, rootType,
+                                  (const VkVideoReferenceSlotKHR*)(toCount->pSetupReferenceSlot),
+                                  count);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->referenceSlotCount; ++i) {
+            count_VkVideoReferenceSlotKHR(
+                featureBits, rootType,
+                (const VkVideoReferenceSlotKHR*)(toCount->pReferenceSlots + i), count);
+        }
+    }
+}
+
+#endif
+#ifdef VK_KHR_dynamic_rendering
+void count_VkRenderingAttachmentInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                        const VkRenderingAttachmentInfoKHR* toCount,
+                                        size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkImageLayout);
+    *count += sizeof(VkResolveModeFlagBits);
+    uint64_t cgen_var_1;
+    *count += 1 * 8;
+    *count += sizeof(VkImageLayout);
+    *count += sizeof(VkAttachmentLoadOp);
+    *count += sizeof(VkAttachmentStoreOp);
+    count_VkClearValue(featureBits, rootType, (VkClearValue*)(&toCount->clearValue), count);
+}
+
+void count_VkRenderingInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                              const VkRenderingInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkRenderingFlagsKHR);
+    count_VkRect2D(featureBits, rootType, (VkRect2D*)(&toCount->renderArea), count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->colorAttachmentCount; ++i) {
+            count_VkRenderingAttachmentInfoKHR(
+                featureBits, rootType,
+                (const VkRenderingAttachmentInfoKHR*)(toCount->pColorAttachments + i), count);
+        }
+    }
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pDepthAttachment) {
+        count_VkRenderingAttachmentInfoKHR(
+            featureBits, rootType, (const VkRenderingAttachmentInfoKHR*)(toCount->pDepthAttachment),
+            count);
+    }
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pStencilAttachment) {
+        count_VkRenderingAttachmentInfoKHR(
+            featureBits, rootType,
+            (const VkRenderingAttachmentInfoKHR*)(toCount->pStencilAttachment), count);
+    }
+}
+
+void count_VkPipelineRenderingCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                            const VkPipelineRenderingCreateInfoKHR* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->colorAttachmentCount * sizeof(const VkFormat);
+    }
+    *count += sizeof(VkFormat);
+    *count += sizeof(VkFormat);
+}
+
+void count_VkPhysicalDeviceDynamicRenderingFeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceDynamicRenderingFeaturesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkCommandBufferInheritanceRenderingInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkCommandBufferInheritanceRenderingInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkRenderingFlagsKHR);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->colorAttachmentCount * sizeof(const VkFormat);
+    }
+    *count += sizeof(VkFormat);
+    *count += sizeof(VkFormat);
+    *count += sizeof(VkSampleCountFlagBits);
+}
+
+void count_VkRenderingFragmentShadingRateAttachmentInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkRenderingFragmentShadingRateAttachmentInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkImageLayout);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->shadingRateAttachmentTexelSize),
+                     count);
+}
+
+void count_VkRenderingFragmentDensityMapAttachmentInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkRenderingFragmentDensityMapAttachmentInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkImageLayout);
+}
+
+void count_VkAttachmentSampleCountInfoAMD(uint32_t featureBits, VkStructureType rootType,
+                                          const VkAttachmentSampleCountInfoAMD* toCount,
+                                          size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pColorAttachmentSamples) {
+        if (toCount) {
+            *count += toCount->colorAttachmentCount * sizeof(const VkSampleCountFlagBits);
+        }
+    }
+    *count += sizeof(VkSampleCountFlagBits);
+}
+
+void count_VkMultiviewPerViewAttributesInfoNVX(uint32_t featureBits, VkStructureType rootType,
+                                               const VkMultiviewPerViewAttributesInfoNVX* toCount,
+                                               size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_KHR_multiview
+#endif
+#ifdef VK_KHR_get_physical_device_properties2
+#endif
+#ifdef VK_KHR_device_group
+#endif
+#ifdef VK_KHR_shader_draw_parameters
+#endif
+#ifdef VK_KHR_maintenance1
+#endif
+#ifdef VK_KHR_device_group_creation
+#endif
+#ifdef VK_KHR_external_memory_capabilities
+#endif
+#ifdef VK_KHR_external_memory
+#endif
+#ifdef VK_KHR_external_memory_win32
+void count_VkImportMemoryWin32HandleInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                            const VkImportMemoryWin32HandleInfoKHR* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkExternalMemoryHandleTypeFlagBits);
+    *count += sizeof(HANDLE);
+    *count += sizeof(LPCWSTR);
+}
+
+void count_VkExportMemoryWin32HandleInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                            const VkExportMemoryWin32HandleInfoKHR* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pAttributes) {
+        *count += sizeof(const SECURITY_ATTRIBUTES);
+    }
+    *count += sizeof(DWORD);
+    *count += sizeof(LPCWSTR);
+}
+
+void count_VkMemoryWin32HandlePropertiesKHR(uint32_t featureBits, VkStructureType rootType,
+                                            const VkMemoryWin32HandlePropertiesKHR* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkMemoryGetWin32HandleInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                         const VkMemoryGetWin32HandleInfoKHR* toCount,
+                                         size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkExternalMemoryHandleTypeFlagBits);
+}
+
+#endif
+#ifdef VK_KHR_external_memory_fd
+void count_VkImportMemoryFdInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                   const VkImportMemoryFdInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkExternalMemoryHandleTypeFlagBits);
+    *count += sizeof(int);
+}
+
+void count_VkMemoryFdPropertiesKHR(uint32_t featureBits, VkStructureType rootType,
+                                   const VkMemoryFdPropertiesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkMemoryGetFdInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                const VkMemoryGetFdInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkExternalMemoryHandleTypeFlagBits);
+}
+
+#endif
+#ifdef VK_KHR_win32_keyed_mutex
+void count_VkWin32KeyedMutexAcquireReleaseInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkWin32KeyedMutexAcquireReleaseInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    if (toCount->acquireCount) {
+        *count += toCount->acquireCount * 8;
+    }
+    if (toCount) {
+        *count += toCount->acquireCount * sizeof(const uint64_t);
+    }
+    if (toCount) {
+        *count += toCount->acquireCount * sizeof(const uint32_t);
+    }
+    *count += sizeof(uint32_t);
+    if (toCount->releaseCount) {
+        *count += toCount->releaseCount * 8;
+    }
+    if (toCount) {
+        *count += toCount->releaseCount * sizeof(const uint64_t);
+    }
+}
+
+#endif
+#ifdef VK_KHR_external_semaphore_capabilities
+#endif
+#ifdef VK_KHR_external_semaphore
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+void count_VkImportSemaphoreWin32HandleInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                               const VkImportSemaphoreWin32HandleInfoKHR* toCount,
+                                               size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkSemaphoreImportFlags);
+    *count += sizeof(VkExternalSemaphoreHandleTypeFlagBits);
+    *count += sizeof(HANDLE);
+    *count += sizeof(LPCWSTR);
+}
+
+void count_VkExportSemaphoreWin32HandleInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                               const VkExportSemaphoreWin32HandleInfoKHR* toCount,
+                                               size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pAttributes) {
+        *count += sizeof(const SECURITY_ATTRIBUTES);
+    }
+    *count += sizeof(DWORD);
+    *count += sizeof(LPCWSTR);
+}
+
+void count_VkD3D12FenceSubmitInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                     const VkD3D12FenceSubmitInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pWaitSemaphoreValues) {
+        if (toCount) {
+            *count += toCount->waitSemaphoreValuesCount * sizeof(const uint64_t);
+        }
+    }
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pSignalSemaphoreValues) {
+        if (toCount) {
+            *count += toCount->signalSemaphoreValuesCount * sizeof(const uint64_t);
+        }
+    }
+}
+
+void count_VkSemaphoreGetWin32HandleInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                            const VkSemaphoreGetWin32HandleInfoKHR* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkExternalSemaphoreHandleTypeFlagBits);
+}
+
+#endif
+#ifdef VK_KHR_external_semaphore_fd
+void count_VkImportSemaphoreFdInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                      const VkImportSemaphoreFdInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkSemaphoreImportFlags);
+    *count += sizeof(VkExternalSemaphoreHandleTypeFlagBits);
+    *count += sizeof(int);
+}
+
+void count_VkSemaphoreGetFdInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                   const VkSemaphoreGetFdInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkExternalSemaphoreHandleTypeFlagBits);
+}
+
+#endif
+#ifdef VK_KHR_push_descriptor
+void count_VkPhysicalDevicePushDescriptorPropertiesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDevicePushDescriptorPropertiesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_KHR_shader_float16_int8
+#endif
+#ifdef VK_KHR_16bit_storage
+#endif
+#ifdef VK_KHR_incremental_present
+void count_VkRectLayerKHR(uint32_t featureBits, VkStructureType rootType,
+                          const VkRectLayerKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    count_VkOffset2D(featureBits, rootType, (VkOffset2D*)(&toCount->offset), count);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->extent), count);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkPresentRegionKHR(uint32_t featureBits, VkStructureType rootType,
+                              const VkPresentRegionKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pRectangles) {
+        if (toCount) {
+            for (uint32_t i = 0; i < (uint32_t)toCount->rectangleCount; ++i) {
+                count_VkRectLayerKHR(featureBits, rootType,
+                                     (const VkRectLayerKHR*)(toCount->pRectangles + i), count);
+            }
+        }
+    }
+}
+
+void count_VkPresentRegionsKHR(uint32_t featureBits, VkStructureType rootType,
+                               const VkPresentRegionsKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pRegions) {
+        if (toCount) {
+            for (uint32_t i = 0; i < (uint32_t)toCount->swapchainCount; ++i) {
+                count_VkPresentRegionKHR(featureBits, rootType,
+                                         (const VkPresentRegionKHR*)(toCount->pRegions + i), count);
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_KHR_descriptor_update_template
+#endif
+#ifdef VK_KHR_imageless_framebuffer
+#endif
+#ifdef VK_KHR_create_renderpass2
+#endif
+#ifdef VK_KHR_shared_presentable_image
+void count_VkSharedPresentSurfaceCapabilitiesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkSharedPresentSurfaceCapabilitiesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkImageUsageFlags);
+}
+
+#endif
+#ifdef VK_KHR_external_fence_capabilities
+#endif
+#ifdef VK_KHR_external_fence
+#endif
+#ifdef VK_KHR_external_fence_win32
+void count_VkImportFenceWin32HandleInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                           const VkImportFenceWin32HandleInfoKHR* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkFenceImportFlags);
+    *count += sizeof(VkExternalFenceHandleTypeFlagBits);
+    *count += sizeof(HANDLE);
+    *count += sizeof(LPCWSTR);
+}
+
+void count_VkExportFenceWin32HandleInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                           const VkExportFenceWin32HandleInfoKHR* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pAttributes) {
+        *count += sizeof(const SECURITY_ATTRIBUTES);
+    }
+    *count += sizeof(DWORD);
+    *count += sizeof(LPCWSTR);
+}
+
+void count_VkFenceGetWin32HandleInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                        const VkFenceGetWin32HandleInfoKHR* toCount,
+                                        size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkExternalFenceHandleTypeFlagBits);
+}
+
+#endif
+#ifdef VK_KHR_external_fence_fd
+void count_VkImportFenceFdInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                  const VkImportFenceFdInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkFenceImportFlags);
+    *count += sizeof(VkExternalFenceHandleTypeFlagBits);
+    *count += sizeof(int);
+}
+
+void count_VkFenceGetFdInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                               const VkFenceGetFdInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkExternalFenceHandleTypeFlagBits);
+}
+
+#endif
+#ifdef VK_KHR_performance_query
+void count_VkPhysicalDevicePerformanceQueryFeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDevicePerformanceQueryFeaturesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDevicePerformanceQueryPropertiesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDevicePerformanceQueryPropertiesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPerformanceCounterKHR(uint32_t featureBits, VkStructureType rootType,
+                                   const VkPerformanceCounterKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPerformanceCounterUnitKHR);
+    *count += sizeof(VkPerformanceCounterScopeKHR);
+    *count += sizeof(VkPerformanceCounterStorageKHR);
+    *count += VK_UUID_SIZE * sizeof(uint8_t);
+}
+
+void count_VkPerformanceCounterDescriptionKHR(uint32_t featureBits, VkStructureType rootType,
+                                              const VkPerformanceCounterDescriptionKHR* toCount,
+                                              size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPerformanceCounterDescriptionFlagsKHR);
+    *count += VK_MAX_DESCRIPTION_SIZE * sizeof(char);
+    *count += VK_MAX_DESCRIPTION_SIZE * sizeof(char);
+    *count += VK_MAX_DESCRIPTION_SIZE * sizeof(char);
+}
+
+void count_VkQueryPoolPerformanceCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                               const VkQueryPoolPerformanceCreateInfoKHR* toCount,
+                                               size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->counterIndexCount * sizeof(const uint32_t);
+    }
+}
+
+void count_VkPerformanceCounterResultKHR(uint32_t featureBits, VkStructureType rootType,
+                                         const VkPerformanceCounterResultKHR* toCount,
+                                         size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(int32_t);
+}
+
+void count_VkAcquireProfilingLockInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                         const VkAcquireProfilingLockInfoKHR* toCount,
+                                         size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkAcquireProfilingLockFlagsKHR);
+    *count += sizeof(uint64_t);
+}
+
+void count_VkPerformanceQuerySubmitInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                           const VkPerformanceQuerySubmitInfoKHR* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_KHR_maintenance2
+#endif
+#ifdef VK_KHR_get_surface_capabilities2
+void count_VkPhysicalDeviceSurfaceInfo2KHR(uint32_t featureBits, VkStructureType rootType,
+                                           const VkPhysicalDeviceSurfaceInfo2KHR* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+}
+
+void count_VkSurfaceCapabilities2KHR(uint32_t featureBits, VkStructureType rootType,
+                                     const VkSurfaceCapabilities2KHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkSurfaceCapabilitiesKHR(
+        featureBits, rootType, (VkSurfaceCapabilitiesKHR*)(&toCount->surfaceCapabilities), count);
+}
+
+void count_VkSurfaceFormat2KHR(uint32_t featureBits, VkStructureType rootType,
+                               const VkSurfaceFormat2KHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkSurfaceFormatKHR(featureBits, rootType, (VkSurfaceFormatKHR*)(&toCount->surfaceFormat),
+                             count);
+}
+
+#endif
+#ifdef VK_KHR_variable_pointers
+#endif
+#ifdef VK_KHR_get_display_properties2
+void count_VkDisplayProperties2KHR(uint32_t featureBits, VkStructureType rootType,
+                                   const VkDisplayProperties2KHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkDisplayPropertiesKHR(featureBits, rootType,
+                                 (VkDisplayPropertiesKHR*)(&toCount->displayProperties), count);
+}
+
+void count_VkDisplayPlaneProperties2KHR(uint32_t featureBits, VkStructureType rootType,
+                                        const VkDisplayPlaneProperties2KHR* toCount,
+                                        size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkDisplayPlanePropertiesKHR(
+        featureBits, rootType, (VkDisplayPlanePropertiesKHR*)(&toCount->displayPlaneProperties),
+        count);
+}
+
+void count_VkDisplayModeProperties2KHR(uint32_t featureBits, VkStructureType rootType,
+                                       const VkDisplayModeProperties2KHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkDisplayModePropertiesKHR(featureBits, rootType,
+                                     (VkDisplayModePropertiesKHR*)(&toCount->displayModeProperties),
+                                     count);
+}
+
+void count_VkDisplayPlaneInfo2KHR(uint32_t featureBits, VkStructureType rootType,
+                                  const VkDisplayPlaneInfo2KHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(uint32_t);
+}
+
+void count_VkDisplayPlaneCapabilities2KHR(uint32_t featureBits, VkStructureType rootType,
+                                          const VkDisplayPlaneCapabilities2KHR* toCount,
+                                          size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkDisplayPlaneCapabilitiesKHR(
+        featureBits, rootType, (VkDisplayPlaneCapabilitiesKHR*)(&toCount->capabilities), count);
+}
+
+#endif
+#ifdef VK_KHR_dedicated_allocation
+#endif
+#ifdef VK_KHR_storage_buffer_storage_class
+#endif
+#ifdef VK_KHR_relaxed_block_layout
+#endif
+#ifdef VK_KHR_get_memory_requirements2
+#endif
+#ifdef VK_KHR_image_format_list
+#endif
+#ifdef VK_KHR_sampler_ycbcr_conversion
+#endif
+#ifdef VK_KHR_bind_memory2
+#endif
+#ifdef VK_KHR_portability_subset
+void count_VkPhysicalDevicePortabilitySubsetFeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDevicePortabilitySubsetFeaturesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDevicePortabilitySubsetPropertiesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDevicePortabilitySubsetPropertiesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_KHR_maintenance3
+#endif
+#ifdef VK_KHR_draw_indirect_count
+#endif
+#ifdef VK_KHR_shader_subgroup_extended_types
+#endif
+#ifdef VK_KHR_8bit_storage
+#endif
+#ifdef VK_KHR_shader_atomic_int64
+#endif
+#ifdef VK_KHR_shader_clock
+void count_VkPhysicalDeviceShaderClockFeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderClockFeaturesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_KHR_driver_properties
+#endif
+#ifdef VK_KHR_shader_float_controls
+#endif
+#ifdef VK_KHR_depth_stencil_resolve
+#endif
+#ifdef VK_KHR_swapchain_mutable_format
+#endif
+#ifdef VK_KHR_timeline_semaphore
+#endif
+#ifdef VK_KHR_vulkan_memory_model
+#endif
+#ifdef VK_KHR_shader_terminate_invocation
+void count_VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+void count_VkFragmentShadingRateAttachmentInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkFragmentShadingRateAttachmentInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pFragmentShadingRateAttachment) {
+        count_VkAttachmentReference2(
+            featureBits, rootType,
+            (const VkAttachmentReference2*)(toCount->pFragmentShadingRateAttachment), count);
+    }
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->shadingRateAttachmentTexelSize),
+                     count);
+}
+
+void count_VkPipelineFragmentShadingRateStateCreateInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineFragmentShadingRateStateCreateInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->fragmentSize), count);
+    *count += 2 * sizeof(VkFragmentShadingRateCombinerOpKHR);
+}
+
+void count_VkPhysicalDeviceFragmentShadingRateFeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateFeaturesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceFragmentShadingRatePropertiesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRatePropertiesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkExtent2D(featureBits, rootType,
+                     (VkExtent2D*)(&toCount->minFragmentShadingRateAttachmentTexelSize), count);
+    count_VkExtent2D(featureBits, rootType,
+                     (VkExtent2D*)(&toCount->maxFragmentShadingRateAttachmentTexelSize), count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->maxFragmentSize), count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkSampleCountFlagBits);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceFragmentShadingRateKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkSampleCountFlags);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->fragmentSize), count);
+}
+
+#endif
+#ifdef VK_KHR_spirv_1_4
+#endif
+#ifdef VK_KHR_surface_protected_capabilities
+void count_VkSurfaceProtectedCapabilitiesKHR(uint32_t featureBits, VkStructureType rootType,
+                                             const VkSurfaceProtectedCapabilitiesKHR* toCount,
+                                             size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_KHR_separate_depth_stencil_layouts
+#endif
+#ifdef VK_KHR_present_wait
+void count_VkPhysicalDevicePresentWaitFeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDevicePresentWaitFeaturesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_KHR_uniform_buffer_standard_layout
+#endif
+#ifdef VK_KHR_buffer_device_address
+#endif
+#ifdef VK_KHR_deferred_host_operations
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+void count_VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPipelineInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                             const VkPipelineInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+}
+
+void count_VkPipelineExecutablePropertiesKHR(uint32_t featureBits, VkStructureType rootType,
+                                             const VkPipelineExecutablePropertiesKHR* toCount,
+                                             size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkShaderStageFlags);
+    *count += VK_MAX_DESCRIPTION_SIZE * sizeof(char);
+    *count += VK_MAX_DESCRIPTION_SIZE * sizeof(char);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkPipelineExecutableInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                       const VkPipelineExecutableInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(uint32_t);
+}
+
+void count_VkPipelineExecutableStatisticValueKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineExecutableStatisticValueKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPipelineExecutableStatisticKHR(uint32_t featureBits, VkStructureType rootType,
+                                            const VkPipelineExecutableStatisticKHR* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += VK_MAX_DESCRIPTION_SIZE * sizeof(char);
+    *count += VK_MAX_DESCRIPTION_SIZE * sizeof(char);
+    *count += sizeof(VkPipelineExecutableStatisticFormatKHR);
+    count_VkPipelineExecutableStatisticValueKHR(
+        featureBits, rootType, (VkPipelineExecutableStatisticValueKHR*)(&toCount->value), count);
+}
+
+void count_VkPipelineExecutableInternalRepresentationKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineExecutableInternalRepresentationKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += VK_MAX_DESCRIPTION_SIZE * sizeof(char);
+    *count += VK_MAX_DESCRIPTION_SIZE * sizeof(char);
+    *count += sizeof(VkBool32);
+    *count += 8;
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pData) {
+        if (toCount) {
+            *count += toCount->dataSize * sizeof(uint8_t);
+        }
+    }
+}
+
+#endif
+#ifdef VK_KHR_shader_integer_dot_product
+void count_VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_KHR_pipeline_library
+void count_VkPipelineLibraryCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                          const VkPipelineLibraryCreateInfoKHR* toCount,
+                                          size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    if (toCount->libraryCount) {
+        *count += toCount->libraryCount * 8;
+    }
+}
+
+#endif
+#ifdef VK_KHR_shader_non_semantic_info
+#endif
+#ifdef VK_KHR_present_id
+void count_VkPresentIdKHR(uint32_t featureBits, VkStructureType rootType,
+                          const VkPresentIdKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pPresentIds) {
+        if (toCount) {
+            *count += toCount->swapchainCount * sizeof(const uint64_t);
+        }
+    }
+}
+
+void count_VkPhysicalDevicePresentIdFeaturesKHR(uint32_t featureBits, VkStructureType rootType,
+                                                const VkPhysicalDevicePresentIdFeaturesKHR* toCount,
+                                                size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_KHR_video_encode_queue
+void count_VkVideoEncodeInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                const VkVideoEncodeInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkVideoEncodeFlagsKHR);
+    *count += sizeof(uint32_t);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->codedExtent), count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+    count_VkVideoPictureResourceKHR(
+        featureBits, rootType, (VkVideoPictureResourceKHR*)(&toCount->srcPictureResource), count);
+    count_VkVideoReferenceSlotKHR(featureBits, rootType,
+                                  (const VkVideoReferenceSlotKHR*)(toCount->pSetupReferenceSlot),
+                                  count);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->referenceSlotCount; ++i) {
+            count_VkVideoReferenceSlotKHR(
+                featureBits, rootType,
+                (const VkVideoReferenceSlotKHR*)(toCount->pReferenceSlots + i), count);
+        }
+    }
+}
+
+void count_VkVideoEncodeRateControlInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                           const VkVideoEncodeRateControlInfoKHR* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkVideoEncodeRateControlFlagsKHR);
+    *count += sizeof(VkVideoEncodeRateControlModeFlagBitsKHR);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint16_t);
+    *count += sizeof(uint16_t);
+    *count += sizeof(uint16_t);
+    *count += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_KHR_synchronization2
+void count_VkMemoryBarrier2KHR(uint32_t featureBits, VkStructureType rootType,
+                               const VkMemoryBarrier2KHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineStageFlags2KHR);
+    *count += sizeof(VkAccessFlags2KHR);
+    *count += sizeof(VkPipelineStageFlags2KHR);
+    *count += sizeof(VkAccessFlags2KHR);
+}
+
+void count_VkBufferMemoryBarrier2KHR(uint32_t featureBits, VkStructureType rootType,
+                                     const VkBufferMemoryBarrier2KHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineStageFlags2KHR);
+    *count += sizeof(VkAccessFlags2KHR);
+    *count += sizeof(VkPipelineStageFlags2KHR);
+    *count += sizeof(VkAccessFlags2KHR);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+}
+
+void count_VkImageMemoryBarrier2KHR(uint32_t featureBits, VkStructureType rootType,
+                                    const VkImageMemoryBarrier2KHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineStageFlags2KHR);
+    *count += sizeof(VkAccessFlags2KHR);
+    *count += sizeof(VkPipelineStageFlags2KHR);
+    *count += sizeof(VkAccessFlags2KHR);
+    *count += sizeof(VkImageLayout);
+    *count += sizeof(VkImageLayout);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    count_VkImageSubresourceRange(featureBits, rootType,
+                                  (VkImageSubresourceRange*)(&toCount->subresourceRange), count);
+}
+
+void count_VkDependencyInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                               const VkDependencyInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDependencyFlags);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->memoryBarrierCount; ++i) {
+            count_VkMemoryBarrier2KHR(featureBits, rootType,
+                                      (const VkMemoryBarrier2KHR*)(toCount->pMemoryBarriers + i),
+                                      count);
+        }
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->bufferMemoryBarrierCount; ++i) {
+            count_VkBufferMemoryBarrier2KHR(
+                featureBits, rootType,
+                (const VkBufferMemoryBarrier2KHR*)(toCount->pBufferMemoryBarriers + i), count);
+        }
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->imageMemoryBarrierCount; ++i) {
+            count_VkImageMemoryBarrier2KHR(
+                featureBits, rootType,
+                (const VkImageMemoryBarrier2KHR*)(toCount->pImageMemoryBarriers + i), count);
+        }
+    }
+}
+
+void count_VkSemaphoreSubmitInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                    const VkSemaphoreSubmitInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(uint64_t);
+    *count += sizeof(VkPipelineStageFlags2KHR);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkCommandBufferSubmitInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                        const VkCommandBufferSubmitInfoKHR* toCount,
+                                        size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(uint32_t);
+}
+
+void count_VkSubmitInfo2KHR(uint32_t featureBits, VkStructureType rootType,
+                            const VkSubmitInfo2KHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkSubmitFlagsKHR);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->waitSemaphoreInfoCount; ++i) {
+            count_VkSemaphoreSubmitInfoKHR(
+                featureBits, rootType,
+                (const VkSemaphoreSubmitInfoKHR*)(toCount->pWaitSemaphoreInfos + i), count);
+        }
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->commandBufferInfoCount; ++i) {
+            count_VkCommandBufferSubmitInfoKHR(
+                featureBits, rootType,
+                (const VkCommandBufferSubmitInfoKHR*)(toCount->pCommandBufferInfos + i), count);
+        }
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->signalSemaphoreInfoCount; ++i) {
+            count_VkSemaphoreSubmitInfoKHR(
+                featureBits, rootType,
+                (const VkSemaphoreSubmitInfoKHR*)(toCount->pSignalSemaphoreInfos + i), count);
+        }
+    }
+}
+
+void count_VkPhysicalDeviceSynchronization2FeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceSynchronization2FeaturesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkQueueFamilyCheckpointProperties2NV(uint32_t featureBits, VkStructureType rootType,
+                                                const VkQueueFamilyCheckpointProperties2NV* toCount,
+                                                size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineStageFlags2KHR);
+}
+
+void count_VkCheckpointData2NV(uint32_t featureBits, VkStructureType rootType,
+                               const VkCheckpointData2NV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineStageFlags2KHR);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pCheckpointMarker) {
+        *count += sizeof(uint8_t);
+    }
+}
+
+#endif
+#ifdef VK_KHR_shader_subgroup_uniform_control_flow
+void count_VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_KHR_zero_initialize_workgroup_memory
+void count_VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_KHR_workgroup_memory_explicit_layout
+void count_VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_KHR_copy_commands2
+void count_VkBufferCopy2KHR(uint32_t featureBits, VkStructureType rootType,
+                            const VkBufferCopy2KHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+}
+
+void count_VkCopyBufferInfo2KHR(uint32_t featureBits, VkStructureType rootType,
+                                const VkCopyBufferInfo2KHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    uint64_t cgen_var_1;
+    *count += 1 * 8;
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->regionCount; ++i) {
+            count_VkBufferCopy2KHR(featureBits, rootType,
+                                   (const VkBufferCopy2KHR*)(toCount->pRegions + i), count);
+        }
+    }
+}
+
+void count_VkImageCopy2KHR(uint32_t featureBits, VkStructureType rootType,
+                           const VkImageCopy2KHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkImageSubresourceLayers(featureBits, rootType,
+                                   (VkImageSubresourceLayers*)(&toCount->srcSubresource), count);
+    count_VkOffset3D(featureBits, rootType, (VkOffset3D*)(&toCount->srcOffset), count);
+    count_VkImageSubresourceLayers(featureBits, rootType,
+                                   (VkImageSubresourceLayers*)(&toCount->dstSubresource), count);
+    count_VkOffset3D(featureBits, rootType, (VkOffset3D*)(&toCount->dstOffset), count);
+    count_VkExtent3D(featureBits, rootType, (VkExtent3D*)(&toCount->extent), count);
+}
+
+void count_VkCopyImageInfo2KHR(uint32_t featureBits, VkStructureType rootType,
+                               const VkCopyImageInfo2KHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkImageLayout);
+    uint64_t cgen_var_1;
+    *count += 1 * 8;
+    *count += sizeof(VkImageLayout);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->regionCount; ++i) {
+            count_VkImageCopy2KHR(featureBits, rootType,
+                                  (const VkImageCopy2KHR*)(toCount->pRegions + i), count);
+        }
+    }
+}
+
+void count_VkBufferImageCopy2KHR(uint32_t featureBits, VkStructureType rootType,
+                                 const VkBufferImageCopy2KHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    count_VkImageSubresourceLayers(featureBits, rootType,
+                                   (VkImageSubresourceLayers*)(&toCount->imageSubresource), count);
+    count_VkOffset3D(featureBits, rootType, (VkOffset3D*)(&toCount->imageOffset), count);
+    count_VkExtent3D(featureBits, rootType, (VkExtent3D*)(&toCount->imageExtent), count);
+}
+
+void count_VkCopyBufferToImageInfo2KHR(uint32_t featureBits, VkStructureType rootType,
+                                       const VkCopyBufferToImageInfo2KHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    uint64_t cgen_var_1;
+    *count += 1 * 8;
+    *count += sizeof(VkImageLayout);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->regionCount; ++i) {
+            count_VkBufferImageCopy2KHR(featureBits, rootType,
+                                        (const VkBufferImageCopy2KHR*)(toCount->pRegions + i),
+                                        count);
+        }
+    }
+}
+
+void count_VkCopyImageToBufferInfo2KHR(uint32_t featureBits, VkStructureType rootType,
+                                       const VkCopyImageToBufferInfo2KHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkImageLayout);
+    uint64_t cgen_var_1;
+    *count += 1 * 8;
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->regionCount; ++i) {
+            count_VkBufferImageCopy2KHR(featureBits, rootType,
+                                        (const VkBufferImageCopy2KHR*)(toCount->pRegions + i),
+                                        count);
+        }
+    }
+}
+
+void count_VkImageBlit2KHR(uint32_t featureBits, VkStructureType rootType,
+                           const VkImageBlit2KHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkImageSubresourceLayers(featureBits, rootType,
+                                   (VkImageSubresourceLayers*)(&toCount->srcSubresource), count);
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        count_VkOffset3D(featureBits, rootType, (VkOffset3D*)(toCount->srcOffsets + i), count);
+    }
+    count_VkImageSubresourceLayers(featureBits, rootType,
+                                   (VkImageSubresourceLayers*)(&toCount->dstSubresource), count);
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        count_VkOffset3D(featureBits, rootType, (VkOffset3D*)(toCount->dstOffsets + i), count);
+    }
+}
+
+void count_VkBlitImageInfo2KHR(uint32_t featureBits, VkStructureType rootType,
+                               const VkBlitImageInfo2KHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkImageLayout);
+    uint64_t cgen_var_1;
+    *count += 1 * 8;
+    *count += sizeof(VkImageLayout);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->regionCount; ++i) {
+            count_VkImageBlit2KHR(featureBits, rootType,
+                                  (const VkImageBlit2KHR*)(toCount->pRegions + i), count);
+        }
+    }
+    *count += sizeof(VkFilter);
+}
+
+void count_VkImageResolve2KHR(uint32_t featureBits, VkStructureType rootType,
+                              const VkImageResolve2KHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkImageSubresourceLayers(featureBits, rootType,
+                                   (VkImageSubresourceLayers*)(&toCount->srcSubresource), count);
+    count_VkOffset3D(featureBits, rootType, (VkOffset3D*)(&toCount->srcOffset), count);
+    count_VkImageSubresourceLayers(featureBits, rootType,
+                                   (VkImageSubresourceLayers*)(&toCount->dstSubresource), count);
+    count_VkOffset3D(featureBits, rootType, (VkOffset3D*)(&toCount->dstOffset), count);
+    count_VkExtent3D(featureBits, rootType, (VkExtent3D*)(&toCount->extent), count);
+}
+
+void count_VkResolveImageInfo2KHR(uint32_t featureBits, VkStructureType rootType,
+                                  const VkResolveImageInfo2KHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkImageLayout);
+    uint64_t cgen_var_1;
+    *count += 1 * 8;
+    *count += sizeof(VkImageLayout);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->regionCount; ++i) {
+            count_VkImageResolve2KHR(featureBits, rootType,
+                                     (const VkImageResolve2KHR*)(toCount->pRegions + i), count);
+        }
+    }
+}
+
+#endif
+#ifdef VK_KHR_format_feature_flags2
+void count_VkFormatProperties3KHR(uint32_t featureBits, VkStructureType rootType,
+                                  const VkFormatProperties3KHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkFormatFeatureFlags2KHR);
+    *count += sizeof(VkFormatFeatureFlags2KHR);
+    *count += sizeof(VkFormatFeatureFlags2KHR);
+}
+
+#endif
+#ifdef VK_KHR_maintenance4
+void count_VkPhysicalDeviceMaintenance4FeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceMaintenance4FeaturesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceMaintenance4PropertiesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceMaintenance4PropertiesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDeviceSize);
+}
+
+void count_VkDeviceBufferMemoryRequirementsKHR(uint32_t featureBits, VkStructureType rootType,
+                                               const VkDeviceBufferMemoryRequirementsKHR* toCount,
+                                               size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkBufferCreateInfo(featureBits, rootType,
+                             (const VkBufferCreateInfo*)(toCount->pCreateInfo), count);
+}
+
+void count_VkDeviceImageMemoryRequirementsKHR(uint32_t featureBits, VkStructureType rootType,
+                                              const VkDeviceImageMemoryRequirementsKHR* toCount,
+                                              size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkImageCreateInfo(featureBits, rootType, (const VkImageCreateInfo*)(toCount->pCreateInfo),
+                            count);
+    *count += sizeof(VkImageAspectFlagBits);
+}
+
+#endif
+#ifdef VK_ANDROID_native_buffer
+void count_VkNativeBufferANDROID(uint32_t featureBits, VkStructureType rootType,
+                                 const VkNativeBufferANDROID* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->handle) {
+        *count += sizeof(const uint32_t);
+    }
+    *count += sizeof(int);
+    *count += sizeof(int);
+    *count += sizeof(int);
+    *count += sizeof(uint64_t);
+    *count += sizeof(uint64_t);
+}
+
+#endif
+#ifdef VK_EXT_debug_report
+void count_VkDebugReportCallbackCreateInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                              const VkDebugReportCallbackCreateInfoEXT* toCount,
+                                              size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDebugReportFlagsEXT);
+    *count += 8;
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pUserData) {
+        *count += sizeof(uint8_t);
+    }
+}
+
+#endif
+#ifdef VK_NV_glsl_shader
+#endif
+#ifdef VK_EXT_depth_range_unrestricted
+#endif
+#ifdef VK_IMG_filter_cubic
+#endif
+#ifdef VK_AMD_rasterization_order
+void count_VkPipelineRasterizationStateRasterizationOrderAMD(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineRasterizationStateRasterizationOrderAMD* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkRasterizationOrderAMD);
+}
+
+#endif
+#ifdef VK_AMD_shader_trinary_minmax
+#endif
+#ifdef VK_AMD_shader_explicit_vertex_parameter
+#endif
+#ifdef VK_EXT_debug_marker
+void count_VkDebugMarkerObjectNameInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                          const VkDebugMarkerObjectNameInfoEXT* toCount,
+                                          size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDebugReportObjectTypeEXT);
+    *count += sizeof(uint64_t);
+    *count += sizeof(uint32_t) + (toCount->pObjectName ? strlen(toCount->pObjectName) : 0);
+}
+
+void count_VkDebugMarkerObjectTagInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                         const VkDebugMarkerObjectTagInfoEXT* toCount,
+                                         size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDebugReportObjectTypeEXT);
+    *count += sizeof(uint64_t);
+    *count += sizeof(uint64_t);
+    *count += 8;
+    if (toCount) {
+        *count += toCount->tagSize * sizeof(const uint8_t);
+    }
+}
+
+void count_VkDebugMarkerMarkerInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                      const VkDebugMarkerMarkerInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t) + (toCount->pMarkerName ? strlen(toCount->pMarkerName) : 0);
+    *count += 4 * sizeof(float);
+}
+
+#endif
+#ifdef VK_AMD_gcn_shader
+#endif
+#ifdef VK_NV_dedicated_allocation
+void count_VkDedicatedAllocationImageCreateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkDedicatedAllocationImageCreateInfoNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkDedicatedAllocationBufferCreateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkDedicatedAllocationBufferCreateInfoNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkDedicatedAllocationMemoryAllocateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkDedicatedAllocationMemoryAllocateInfoNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    uint64_t cgen_var_1;
+    *count += 1 * 8;
+}
+
+#endif
+#ifdef VK_EXT_transform_feedback
+void count_VkPhysicalDeviceTransformFeedbackFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceTransformFeedbackFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceTransformFeedbackPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceTransformFeedbackPropertiesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPipelineRasterizationStateStreamCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineRasterizationStateStreamCreateInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineRasterizationStateStreamCreateFlagsEXT);
+    *count += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_NVX_binary_import
+void count_VkCuModuleCreateInfoNVX(uint32_t featureBits, VkStructureType rootType,
+                                   const VkCuModuleCreateInfoNVX* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += 8;
+    if (toCount) {
+        *count += toCount->dataSize * sizeof(const uint8_t);
+    }
+}
+
+void count_VkCuFunctionCreateInfoNVX(uint32_t featureBits, VkStructureType rootType,
+                                     const VkCuFunctionCreateInfoNVX* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += 8;
+    *count += sizeof(uint32_t) + (toCount->pName ? strlen(toCount->pName) : 0);
+}
+
+void count_VkCuLaunchInfoNVX(uint32_t featureBits, VkStructureType rootType,
+                             const VkCuLaunchInfoNVX* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += 8;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += 8;
+    *count += 8;
+}
+
+#endif
+#ifdef VK_NVX_image_view_handle
+void count_VkImageViewHandleInfoNVX(uint32_t featureBits, VkStructureType rootType,
+                                    const VkImageViewHandleInfoNVX* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkDescriptorType);
+    uint64_t cgen_var_1;
+    *count += 1 * 8;
+}
+
+void count_VkImageViewAddressPropertiesNVX(uint32_t featureBits, VkStructureType rootType,
+                                           const VkImageViewAddressPropertiesNVX* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDeviceAddress);
+    *count += sizeof(VkDeviceSize);
+}
+
+#endif
+#ifdef VK_AMD_draw_indirect_count
+#endif
+#ifdef VK_AMD_negative_viewport_height
+#endif
+#ifdef VK_AMD_gpu_shader_half_float
+#endif
+#ifdef VK_AMD_shader_ballot
+#endif
+#ifdef VK_EXT_video_encode_h264
+void count_VkVideoEncodeH264CapabilitiesEXT(uint32_t featureBits, VkStructureType rootType,
+                                            const VkVideoEncodeH264CapabilitiesEXT* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkVideoEncodeH264CapabilityFlagsEXT);
+    *count += sizeof(VkVideoEncodeH264InputModeFlagsEXT);
+    *count += sizeof(VkVideoEncodeH264OutputModeFlagsEXT);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->minPictureSizeInMbs), count);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->maxPictureSizeInMbs), count);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->inputImageDataAlignment),
+                     count);
+    *count += sizeof(uint8_t);
+    *count += sizeof(uint8_t);
+    *count += sizeof(uint8_t);
+    *count += sizeof(uint8_t);
+    count_VkExtensionProperties(featureBits, rootType,
+                                (VkExtensionProperties*)(&toCount->stdExtensionVersion), count);
+}
+
+void count_VkVideoEncodeH264SessionCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoEncodeH264SessionCreateInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkVideoEncodeH264CreateFlagsEXT);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->maxPictureSizeInMbs), count);
+    count_VkExtensionProperties(featureBits, rootType,
+                                (const VkExtensionProperties*)(toCount->pStdExtensionVersion),
+                                count);
+}
+
+void count_VkVideoEncodeH264SessionParametersAddInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoEncodeH264SessionParametersAddInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pSpsStd) {
+        if (toCount) {
+            *count += toCount->spsStdCount * sizeof(const StdVideoH264SequenceParameterSet);
+        }
+    }
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pPpsStd) {
+        if (toCount) {
+            *count += toCount->ppsStdCount * sizeof(const StdVideoH264PictureParameterSet);
+        }
+    }
+}
+
+void count_VkVideoEncodeH264SessionParametersCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoEncodeH264SessionParametersCreateInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pParametersAddInfo) {
+        count_VkVideoEncodeH264SessionParametersAddInfoEXT(
+            featureBits, rootType,
+            (const VkVideoEncodeH264SessionParametersAddInfoEXT*)(toCount->pParametersAddInfo),
+            count);
+    }
+}
+
+void count_VkVideoEncodeH264DpbSlotInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                           const VkVideoEncodeH264DpbSlotInfoEXT* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(int8_t);
+    *count += sizeof(const StdVideoEncodeH264PictureInfo);
+}
+
+void count_VkVideoEncodeH264NaluSliceEXT(uint32_t featureBits, VkStructureType rootType,
+                                         const VkVideoEncodeH264NaluSliceEXT* toCount,
+                                         size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(const StdVideoEncodeH264SliceHeader);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint8_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->refFinalList0EntryCount; ++i) {
+            count_VkVideoEncodeH264DpbSlotInfoEXT(
+                featureBits, rootType,
+                (const VkVideoEncodeH264DpbSlotInfoEXT*)(toCount->pRefFinalList0Entries + i),
+                count);
+        }
+    }
+    *count += sizeof(uint8_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->refFinalList1EntryCount; ++i) {
+            count_VkVideoEncodeH264DpbSlotInfoEXT(
+                featureBits, rootType,
+                (const VkVideoEncodeH264DpbSlotInfoEXT*)(toCount->pRefFinalList1Entries + i),
+                count);
+        }
+    }
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint8_t);
+    *count += sizeof(uint8_t);
+}
+
+void count_VkVideoEncodeH264VclFrameInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                            const VkVideoEncodeH264VclFrameInfoEXT* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint8_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->refDefaultFinalList0EntryCount; ++i) {
+            count_VkVideoEncodeH264DpbSlotInfoEXT(
+                featureBits, rootType,
+                (const VkVideoEncodeH264DpbSlotInfoEXT*)(toCount->pRefDefaultFinalList0Entries + i),
+                count);
+        }
+    }
+    *count += sizeof(uint8_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->refDefaultFinalList1EntryCount; ++i) {
+            count_VkVideoEncodeH264DpbSlotInfoEXT(
+                featureBits, rootType,
+                (const VkVideoEncodeH264DpbSlotInfoEXT*)(toCount->pRefDefaultFinalList1Entries + i),
+                count);
+        }
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->naluSliceEntryCount; ++i) {
+            count_VkVideoEncodeH264NaluSliceEXT(
+                featureBits, rootType,
+                (const VkVideoEncodeH264NaluSliceEXT*)(toCount->pNaluSliceEntries + i), count);
+        }
+    }
+    count_VkVideoEncodeH264DpbSlotInfoEXT(
+        featureBits, rootType,
+        (const VkVideoEncodeH264DpbSlotInfoEXT*)(toCount->pCurrentPictureInfo), count);
+}
+
+void count_VkVideoEncodeH264EmitPictureParametersEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoEncodeH264EmitPictureParametersEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint8_t);
+    *count += sizeof(VkBool32);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->ppsIdEntryCount * sizeof(const uint8_t);
+    }
+}
+
+void count_VkVideoEncodeH264ProfileEXT(uint32_t featureBits, VkStructureType rootType,
+                                       const VkVideoEncodeH264ProfileEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(StdVideoH264ProfileIdc);
+}
+
+#endif
+#ifdef VK_EXT_video_encode_h265
+void count_VkVideoEncodeH265CapabilitiesEXT(uint32_t featureBits, VkStructureType rootType,
+                                            const VkVideoEncodeH265CapabilitiesEXT* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkVideoEncodeH265CapabilityFlagsEXT);
+    *count += sizeof(VkVideoEncodeH265InputModeFlagsEXT);
+    *count += sizeof(VkVideoEncodeH265OutputModeFlagsEXT);
+    *count += sizeof(VkVideoEncodeH265CtbSizeFlagsEXT);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->inputImageDataAlignment),
+                     count);
+    *count += sizeof(uint8_t);
+    *count += sizeof(uint8_t);
+    *count += sizeof(uint8_t);
+    *count += sizeof(uint8_t);
+    *count += sizeof(uint8_t);
+    count_VkExtensionProperties(featureBits, rootType,
+                                (VkExtensionProperties*)(&toCount->stdExtensionVersion), count);
+}
+
+void count_VkVideoEncodeH265SessionCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoEncodeH265SessionCreateInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkVideoEncodeH265CreateFlagsEXT);
+    count_VkExtensionProperties(featureBits, rootType,
+                                (const VkExtensionProperties*)(toCount->pStdExtensionVersion),
+                                count);
+}
+
+void count_VkVideoEncodeH265SessionParametersAddInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoEncodeH265SessionParametersAddInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pVpsStd) {
+        if (toCount) {
+            *count += toCount->vpsStdCount * sizeof(const StdVideoH265VideoParameterSet);
+        }
+    }
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pSpsStd) {
+        if (toCount) {
+            *count += toCount->spsStdCount * sizeof(const StdVideoH265SequenceParameterSet);
+        }
+    }
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pPpsStd) {
+        if (toCount) {
+            *count += toCount->ppsStdCount * sizeof(const StdVideoH265PictureParameterSet);
+        }
+    }
+}
+
+void count_VkVideoEncodeH265SessionParametersCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoEncodeH265SessionParametersCreateInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pParametersAddInfo) {
+        count_VkVideoEncodeH265SessionParametersAddInfoEXT(
+            featureBits, rootType,
+            (const VkVideoEncodeH265SessionParametersAddInfoEXT*)(toCount->pParametersAddInfo),
+            count);
+    }
+}
+
+void count_VkVideoEncodeH265DpbSlotInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                           const VkVideoEncodeH265DpbSlotInfoEXT* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(int8_t);
+    *count += sizeof(const StdVideoEncodeH265ReferenceInfo);
+}
+
+void count_VkVideoEncodeH265ReferenceListsEXT(uint32_t featureBits, VkStructureType rootType,
+                                              const VkVideoEncodeH265ReferenceListsEXT* toCount,
+                                              size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint8_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->referenceList0EntryCount; ++i) {
+            count_VkVideoEncodeH265DpbSlotInfoEXT(
+                featureBits, rootType,
+                (const VkVideoEncodeH265DpbSlotInfoEXT*)(toCount->pReferenceList0Entries + i),
+                count);
+        }
+    }
+    *count += sizeof(uint8_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->referenceList1EntryCount; ++i) {
+            count_VkVideoEncodeH265DpbSlotInfoEXT(
+                featureBits, rootType,
+                (const VkVideoEncodeH265DpbSlotInfoEXT*)(toCount->pReferenceList1Entries + i),
+                count);
+        }
+    }
+    *count += sizeof(const StdVideoEncodeH265ReferenceModifications);
+}
+
+void count_VkVideoEncodeH265NaluSliceEXT(uint32_t featureBits, VkStructureType rootType,
+                                         const VkVideoEncodeH265NaluSliceEXT* toCount,
+                                         size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pReferenceFinalLists) {
+        count_VkVideoEncodeH265ReferenceListsEXT(
+            featureBits, rootType,
+            (const VkVideoEncodeH265ReferenceListsEXT*)(toCount->pReferenceFinalLists), count);
+    }
+    *count += sizeof(const StdVideoEncodeH265SliceHeader);
+}
+
+void count_VkVideoEncodeH265VclFrameInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                            const VkVideoEncodeH265VclFrameInfoEXT* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pReferenceFinalLists) {
+        count_VkVideoEncodeH265ReferenceListsEXT(
+            featureBits, rootType,
+            (const VkVideoEncodeH265ReferenceListsEXT*)(toCount->pReferenceFinalLists), count);
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->naluSliceEntryCount; ++i) {
+            count_VkVideoEncodeH265NaluSliceEXT(
+                featureBits, rootType,
+                (const VkVideoEncodeH265NaluSliceEXT*)(toCount->pNaluSliceEntries + i), count);
+        }
+    }
+    *count += sizeof(const StdVideoEncodeH265PictureInfo);
+}
+
+void count_VkVideoEncodeH265EmitPictureParametersEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoEncodeH265EmitPictureParametersEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint8_t);
+    *count += sizeof(uint8_t);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->ppsIdEntryCount * sizeof(const uint8_t);
+    }
+}
+
+void count_VkVideoEncodeH265ProfileEXT(uint32_t featureBits, VkStructureType rootType,
+                                       const VkVideoEncodeH265ProfileEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(StdVideoH265ProfileIdc);
+}
+
+#endif
+#ifdef VK_EXT_video_decode_h264
+void count_VkVideoDecodeH264ProfileEXT(uint32_t featureBits, VkStructureType rootType,
+                                       const VkVideoDecodeH264ProfileEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(StdVideoH264ProfileIdc);
+    *count += sizeof(VkVideoDecodeH264PictureLayoutFlagsEXT);
+}
+
+void count_VkVideoDecodeH264CapabilitiesEXT(uint32_t featureBits, VkStructureType rootType,
+                                            const VkVideoDecodeH264CapabilitiesEXT* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    count_VkOffset2D(featureBits, rootType, (VkOffset2D*)(&toCount->fieldOffsetGranularity), count);
+    count_VkExtensionProperties(featureBits, rootType,
+                                (VkExtensionProperties*)(&toCount->stdExtensionVersion), count);
+}
+
+void count_VkVideoDecodeH264SessionCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoDecodeH264SessionCreateInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkVideoDecodeH264CreateFlagsEXT);
+    count_VkExtensionProperties(featureBits, rootType,
+                                (const VkExtensionProperties*)(toCount->pStdExtensionVersion),
+                                count);
+}
+
+void count_VkVideoDecodeH264SessionParametersAddInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoDecodeH264SessionParametersAddInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pSpsStd) {
+        if (toCount) {
+            *count += toCount->spsStdCount * sizeof(const StdVideoH264SequenceParameterSet);
+        }
+    }
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pPpsStd) {
+        if (toCount) {
+            *count += toCount->ppsStdCount * sizeof(const StdVideoH264PictureParameterSet);
+        }
+    }
+}
+
+void count_VkVideoDecodeH264SessionParametersCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoDecodeH264SessionParametersCreateInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pParametersAddInfo) {
+        count_VkVideoDecodeH264SessionParametersAddInfoEXT(
+            featureBits, rootType,
+            (const VkVideoDecodeH264SessionParametersAddInfoEXT*)(toCount->pParametersAddInfo),
+            count);
+    }
+}
+
+void count_VkVideoDecodeH264PictureInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                           const VkVideoDecodeH264PictureInfoEXT* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(const StdVideoDecodeH264PictureInfo);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->slicesCount * sizeof(const uint32_t);
+    }
+}
+
+void count_VkVideoDecodeH264MvcEXT(uint32_t featureBits, VkStructureType rootType,
+                                   const VkVideoDecodeH264MvcEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(const StdVideoDecodeH264Mvc);
+}
+
+void count_VkVideoDecodeH264DpbSlotInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                           const VkVideoDecodeH264DpbSlotInfoEXT* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(const StdVideoDecodeH264ReferenceInfo);
+}
+
+#endif
+#ifdef VK_AMD_texture_gather_bias_lod
+void count_VkTextureLODGatherFormatPropertiesAMD(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkTextureLODGatherFormatPropertiesAMD* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_AMD_shader_info
+void count_VkShaderResourceUsageAMD(uint32_t featureBits, VkStructureType rootType,
+                                    const VkShaderResourceUsageAMD* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += 8;
+    *count += 8;
+}
+
+void count_VkShaderStatisticsInfoAMD(uint32_t featureBits, VkStructureType rootType,
+                                     const VkShaderStatisticsInfoAMD* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkShaderStageFlags);
+    count_VkShaderResourceUsageAMD(featureBits, rootType,
+                                   (VkShaderResourceUsageAMD*)(&toCount->resourceUsage), count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += 3 * sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_AMD_shader_image_load_store_lod
+#endif
+#ifdef VK_GGP_stream_descriptor_surface
+void count_VkStreamDescriptorSurfaceCreateInfoGGP(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkStreamDescriptorSurfaceCreateInfoGGP* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkStreamDescriptorSurfaceCreateFlagsGGP);
+    *count += sizeof(GgpStreamDescriptor);
+}
+
+#endif
+#ifdef VK_NV_corner_sampled_image
+void count_VkPhysicalDeviceCornerSampledImageFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceCornerSampledImageFeaturesNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_IMG_format_pvrtc
+#endif
+#ifdef VK_NV_external_memory_capabilities
+void count_VkExternalImageFormatPropertiesNV(uint32_t featureBits, VkStructureType rootType,
+                                             const VkExternalImageFormatPropertiesNV* toCount,
+                                             size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    count_VkImageFormatProperties(
+        featureBits, rootType, (VkImageFormatProperties*)(&toCount->imageFormatProperties), count);
+    *count += sizeof(VkExternalMemoryFeatureFlagsNV);
+    *count += sizeof(VkExternalMemoryHandleTypeFlagsNV);
+    *count += sizeof(VkExternalMemoryHandleTypeFlagsNV);
+}
+
+#endif
+#ifdef VK_NV_external_memory
+void count_VkExternalMemoryImageCreateInfoNV(uint32_t featureBits, VkStructureType rootType,
+                                             const VkExternalMemoryImageCreateInfoNV* toCount,
+                                             size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkExternalMemoryHandleTypeFlagsNV);
+}
+
+void count_VkExportMemoryAllocateInfoNV(uint32_t featureBits, VkStructureType rootType,
+                                        const VkExportMemoryAllocateInfoNV* toCount,
+                                        size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkExternalMemoryHandleTypeFlagsNV);
+}
+
+#endif
+#ifdef VK_NV_external_memory_win32
+void count_VkImportMemoryWin32HandleInfoNV(uint32_t featureBits, VkStructureType rootType,
+                                           const VkImportMemoryWin32HandleInfoNV* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkExternalMemoryHandleTypeFlagsNV);
+    *count += sizeof(HANDLE);
+}
+
+void count_VkExportMemoryWin32HandleInfoNV(uint32_t featureBits, VkStructureType rootType,
+                                           const VkExportMemoryWin32HandleInfoNV* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pAttributes) {
+        *count += sizeof(const SECURITY_ATTRIBUTES);
+    }
+    *count += sizeof(DWORD);
+}
+
+#endif
+#ifdef VK_NV_win32_keyed_mutex
+void count_VkWin32KeyedMutexAcquireReleaseInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkWin32KeyedMutexAcquireReleaseInfoNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    if (toCount->acquireCount) {
+        *count += toCount->acquireCount * 8;
+    }
+    if (toCount) {
+        *count += toCount->acquireCount * sizeof(const uint64_t);
+    }
+    if (toCount) {
+        *count += toCount->acquireCount * sizeof(const uint32_t);
+    }
+    *count += sizeof(uint32_t);
+    if (toCount->releaseCount) {
+        *count += toCount->releaseCount * 8;
+    }
+    if (toCount) {
+        *count += toCount->releaseCount * sizeof(const uint64_t);
+    }
+}
+
+#endif
+#ifdef VK_EXT_validation_flags
+void count_VkValidationFlagsEXT(uint32_t featureBits, VkStructureType rootType,
+                                const VkValidationFlagsEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->disabledValidationCheckCount * sizeof(const VkValidationCheckEXT);
+    }
+}
+
+#endif
+#ifdef VK_NN_vi_surface
+void count_VkViSurfaceCreateInfoNN(uint32_t featureBits, VkStructureType rootType,
+                                   const VkViSurfaceCreateInfoNN* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkViSurfaceCreateFlagsNN);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->window) {
+        *count += sizeof(uint8_t);
+    }
+}
+
+#endif
+#ifdef VK_EXT_shader_subgroup_ballot
+#endif
+#ifdef VK_EXT_shader_subgroup_vote
+#endif
+#ifdef VK_EXT_texture_compression_astc_hdr
+void count_VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_astc_decode_mode
+void count_VkImageViewASTCDecodeModeEXT(uint32_t featureBits, VkStructureType rootType,
+                                        const VkImageViewASTCDecodeModeEXT* toCount,
+                                        size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkFormat);
+}
+
+void count_VkPhysicalDeviceASTCDecodeFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceASTCDecodeFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_conditional_rendering
+void count_VkConditionalRenderingBeginInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                              const VkConditionalRenderingBeginInfoEXT* toCount,
+                                              size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkConditionalRenderingFlagsEXT);
+}
+
+void count_VkPhysicalDeviceConditionalRenderingFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceConditionalRenderingFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkCommandBufferInheritanceConditionalRenderingInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkCommandBufferInheritanceConditionalRenderingInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+void count_VkViewportWScalingNV(uint32_t featureBits, VkStructureType rootType,
+                                const VkViewportWScalingNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(float);
+    *count += sizeof(float);
+}
+
+void count_VkPipelineViewportWScalingStateCreateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineViewportWScalingStateCreateInfoNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pViewportWScalings) {
+        if (toCount) {
+            for (uint32_t i = 0; i < (uint32_t)toCount->viewportCount; ++i) {
+                count_VkViewportWScalingNV(
+                    featureBits, rootType,
+                    (const VkViewportWScalingNV*)(toCount->pViewportWScalings + i), count);
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_EXT_direct_mode_display
+#endif
+#ifdef VK_EXT_acquire_xlib_display
+#endif
+#ifdef VK_EXT_display_surface_counter
+void count_VkSurfaceCapabilities2EXT(uint32_t featureBits, VkStructureType rootType,
+                                     const VkSurfaceCapabilities2EXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->currentExtent), count);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->minImageExtent), count);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->maxImageExtent), count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkSurfaceTransformFlagsKHR);
+    *count += sizeof(VkSurfaceTransformFlagBitsKHR);
+    *count += sizeof(VkCompositeAlphaFlagsKHR);
+    *count += sizeof(VkImageUsageFlags);
+    *count += sizeof(VkSurfaceCounterFlagsEXT);
+}
+
+#endif
+#ifdef VK_EXT_display_control
+void count_VkDisplayPowerInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                 const VkDisplayPowerInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDisplayPowerStateEXT);
+}
+
+void count_VkDeviceEventInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                const VkDeviceEventInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDeviceEventTypeEXT);
+}
+
+void count_VkDisplayEventInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                 const VkDisplayEventInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDisplayEventTypeEXT);
+}
+
+void count_VkSwapchainCounterCreateInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                           const VkSwapchainCounterCreateInfoEXT* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkSurfaceCounterFlagsEXT);
+}
+
+#endif
+#ifdef VK_GOOGLE_display_timing
+void count_VkRefreshCycleDurationGOOGLE(uint32_t featureBits, VkStructureType rootType,
+                                        const VkRefreshCycleDurationGOOGLE* toCount,
+                                        size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint64_t);
+}
+
+void count_VkPastPresentationTimingGOOGLE(uint32_t featureBits, VkStructureType rootType,
+                                          const VkPastPresentationTimingGOOGLE* toCount,
+                                          size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint64_t);
+    *count += sizeof(uint64_t);
+    *count += sizeof(uint64_t);
+    *count += sizeof(uint64_t);
+}
+
+void count_VkPresentTimeGOOGLE(uint32_t featureBits, VkStructureType rootType,
+                               const VkPresentTimeGOOGLE* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint64_t);
+}
+
+void count_VkPresentTimesInfoGOOGLE(uint32_t featureBits, VkStructureType rootType,
+                                    const VkPresentTimesInfoGOOGLE* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pTimes) {
+        if (toCount) {
+            for (uint32_t i = 0; i < (uint32_t)toCount->swapchainCount; ++i) {
+                count_VkPresentTimeGOOGLE(featureBits, rootType,
+                                          (const VkPresentTimeGOOGLE*)(toCount->pTimes + i), count);
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_NV_sample_mask_override_coverage
+#endif
+#ifdef VK_NV_geometry_shader_passthrough
+#endif
+#ifdef VK_NV_viewport_array2
+#endif
+#ifdef VK_NVX_multiview_per_view_attributes
+void count_VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_NV_viewport_swizzle
+void count_VkViewportSwizzleNV(uint32_t featureBits, VkStructureType rootType,
+                               const VkViewportSwizzleNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkViewportCoordinateSwizzleNV);
+    *count += sizeof(VkViewportCoordinateSwizzleNV);
+    *count += sizeof(VkViewportCoordinateSwizzleNV);
+    *count += sizeof(VkViewportCoordinateSwizzleNV);
+}
+
+void count_VkPipelineViewportSwizzleStateCreateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineViewportSwizzleStateCreateInfoNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineViewportSwizzleStateCreateFlagsNV);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pViewportSwizzles) {
+        if (toCount) {
+            for (uint32_t i = 0; i < (uint32_t)toCount->viewportCount; ++i) {
+                count_VkViewportSwizzleNV(
+                    featureBits, rootType,
+                    (const VkViewportSwizzleNV*)(toCount->pViewportSwizzles + i), count);
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_EXT_discard_rectangles
+void count_VkPhysicalDeviceDiscardRectanglePropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceDiscardRectanglePropertiesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkPipelineDiscardRectangleStateCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineDiscardRectangleStateCreateInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineDiscardRectangleStateCreateFlagsEXT);
+    *count += sizeof(VkDiscardRectangleModeEXT);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pDiscardRectangles) {
+        if (toCount) {
+            for (uint32_t i = 0; i < (uint32_t)toCount->discardRectangleCount; ++i) {
+                count_VkRect2D(featureBits, rootType,
+                               (const VkRect2D*)(toCount->pDiscardRectangles + i), count);
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_EXT_conservative_rasterization
+void count_VkPhysicalDeviceConservativeRasterizationPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceConservativeRasterizationPropertiesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPipelineRasterizationConservativeStateCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineRasterizationConservativeStateCreateInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineRasterizationConservativeStateCreateFlagsEXT);
+    *count += sizeof(VkConservativeRasterizationModeEXT);
+    *count += sizeof(float);
+}
+
+#endif
+#ifdef VK_EXT_depth_clip_enable
+void count_VkPhysicalDeviceDepthClipEnableFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceDepthClipEnableFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPipelineRasterizationDepthClipStateCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineRasterizationDepthClipStateCreateInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineRasterizationDepthClipStateCreateFlagsEXT);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_swapchain_colorspace
+#endif
+#ifdef VK_EXT_hdr_metadata
+void count_VkXYColorEXT(uint32_t featureBits, VkStructureType rootType, const VkXYColorEXT* toCount,
+                        size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(float);
+    *count += sizeof(float);
+}
+
+void count_VkHdrMetadataEXT(uint32_t featureBits, VkStructureType rootType,
+                            const VkHdrMetadataEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkXYColorEXT(featureBits, rootType, (VkXYColorEXT*)(&toCount->displayPrimaryRed), count);
+    count_VkXYColorEXT(featureBits, rootType, (VkXYColorEXT*)(&toCount->displayPrimaryGreen),
+                       count);
+    count_VkXYColorEXT(featureBits, rootType, (VkXYColorEXT*)(&toCount->displayPrimaryBlue), count);
+    count_VkXYColorEXT(featureBits, rootType, (VkXYColorEXT*)(&toCount->whitePoint), count);
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(float);
+}
+
+#endif
+#ifdef VK_MVK_ios_surface
+void count_VkIOSSurfaceCreateInfoMVK(uint32_t featureBits, VkStructureType rootType,
+                                     const VkIOSSurfaceCreateInfoMVK* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkIOSSurfaceCreateFlagsMVK);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pView) {
+        *count += sizeof(const uint8_t);
+    }
+}
+
+#endif
+#ifdef VK_MVK_macos_surface
+void count_VkMacOSSurfaceCreateInfoMVK(uint32_t featureBits, VkStructureType rootType,
+                                       const VkMacOSSurfaceCreateInfoMVK* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkMacOSSurfaceCreateFlagsMVK);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pView) {
+        *count += sizeof(const uint8_t);
+    }
+}
+
+#endif
+#ifdef VK_MVK_moltenvk
+#endif
+#ifdef VK_EXT_external_memory_dma_buf
+#endif
+#ifdef VK_EXT_queue_family_foreign
+#endif
+#ifdef VK_EXT_debug_utils
+void count_VkDebugUtilsLabelEXT(uint32_t featureBits, VkStructureType rootType,
+                                const VkDebugUtilsLabelEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t) + (toCount->pLabelName ? strlen(toCount->pLabelName) : 0);
+    *count += 4 * sizeof(float);
+}
+
+void count_VkDebugUtilsObjectNameInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                         const VkDebugUtilsObjectNameInfoEXT* toCount,
+                                         size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkObjectType);
+    *count += sizeof(uint64_t);
+    if (featureBits & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) {
+        // WARNING PTR CHECK
+        *count += 8;
+        if (toCount->pObjectName) {
+            *count += sizeof(uint32_t) + (toCount->pObjectName ? strlen(toCount->pObjectName) : 0);
+        }
+    } else {
+        *count += sizeof(uint32_t) + (toCount->pObjectName ? strlen(toCount->pObjectName) : 0);
+    }
+}
+
+void count_VkDebugUtilsMessengerCallbackDataEXT(uint32_t featureBits, VkStructureType rootType,
+                                                const VkDebugUtilsMessengerCallbackDataEXT* toCount,
+                                                size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDebugUtilsMessengerCallbackDataFlagsEXT);
+    if (featureBits & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) {
+        // WARNING PTR CHECK
+        *count += 8;
+        if (toCount->pMessageIdName) {
+            *count +=
+                sizeof(uint32_t) + (toCount->pMessageIdName ? strlen(toCount->pMessageIdName) : 0);
+        }
+    } else {
+        *count +=
+            sizeof(uint32_t) + (toCount->pMessageIdName ? strlen(toCount->pMessageIdName) : 0);
+    }
+    *count += sizeof(int32_t);
+    *count += sizeof(uint32_t) + (toCount->pMessage ? strlen(toCount->pMessage) : 0);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pQueueLabels) {
+        if (toCount) {
+            for (uint32_t i = 0; i < (uint32_t)toCount->queueLabelCount; ++i) {
+                count_VkDebugUtilsLabelEXT(featureBits, rootType,
+                                           (VkDebugUtilsLabelEXT*)(toCount->pQueueLabels + i),
+                                           count);
+            }
+        }
+    }
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pCmdBufLabels) {
+        if (toCount) {
+            for (uint32_t i = 0; i < (uint32_t)toCount->cmdBufLabelCount; ++i) {
+                count_VkDebugUtilsLabelEXT(featureBits, rootType,
+                                           (VkDebugUtilsLabelEXT*)(toCount->pCmdBufLabels + i),
+                                           count);
+            }
+        }
+    }
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pObjects) {
+        if (toCount) {
+            for (uint32_t i = 0; i < (uint32_t)toCount->objectCount; ++i) {
+                count_VkDebugUtilsObjectNameInfoEXT(
+                    featureBits, rootType, (VkDebugUtilsObjectNameInfoEXT*)(toCount->pObjects + i),
+                    count);
+            }
+        }
+    }
+}
+
+void count_VkDebugUtilsMessengerCreateInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                              const VkDebugUtilsMessengerCreateInfoEXT* toCount,
+                                              size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDebugUtilsMessengerCreateFlagsEXT);
+    *count += sizeof(VkDebugUtilsMessageSeverityFlagsEXT);
+    *count += sizeof(VkDebugUtilsMessageTypeFlagsEXT);
+    *count += 8;
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pUserData) {
+        *count += sizeof(uint8_t);
+    }
+}
+
+void count_VkDebugUtilsObjectTagInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                        const VkDebugUtilsObjectTagInfoEXT* toCount,
+                                        size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkObjectType);
+    *count += sizeof(uint64_t);
+    *count += sizeof(uint64_t);
+    *count += 8;
+    if (toCount) {
+        *count += toCount->tagSize * sizeof(const uint8_t);
+    }
+}
+
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+void count_VkAndroidHardwareBufferUsageANDROID(uint32_t featureBits, VkStructureType rootType,
+                                               const VkAndroidHardwareBufferUsageANDROID* toCount,
+                                               size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint64_t);
+}
+
+void count_VkAndroidHardwareBufferPropertiesANDROID(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAndroidHardwareBufferPropertiesANDROID* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkAndroidHardwareBufferFormatPropertiesANDROID(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAndroidHardwareBufferFormatPropertiesANDROID* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkFormat);
+    *count += sizeof(uint64_t);
+    *count += sizeof(VkFormatFeatureFlags);
+    count_VkComponentMapping(featureBits, rootType,
+                             (VkComponentMapping*)(&toCount->samplerYcbcrConversionComponents),
+                             count);
+    *count += sizeof(VkSamplerYcbcrModelConversion);
+    *count += sizeof(VkSamplerYcbcrRange);
+    *count += sizeof(VkChromaLocation);
+    *count += sizeof(VkChromaLocation);
+}
+
+void count_VkImportAndroidHardwareBufferInfoANDROID(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkImportAndroidHardwareBufferInfoANDROID* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(AHardwareBuffer);
+}
+
+void count_VkMemoryGetAndroidHardwareBufferInfoANDROID(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkMemoryGetAndroidHardwareBufferInfoANDROID* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+}
+
+void count_VkExternalFormatANDROID(uint32_t featureBits, VkStructureType rootType,
+                                   const VkExternalFormatANDROID* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint64_t);
+}
+
+void count_VkAndroidHardwareBufferFormatProperties2ANDROID(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAndroidHardwareBufferFormatProperties2ANDROID* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkFormat);
+    *count += sizeof(uint64_t);
+    *count += sizeof(VkFormatFeatureFlags2KHR);
+    count_VkComponentMapping(featureBits, rootType,
+                             (VkComponentMapping*)(&toCount->samplerYcbcrConversionComponents),
+                             count);
+    *count += sizeof(VkSamplerYcbcrModelConversion);
+    *count += sizeof(VkSamplerYcbcrRange);
+    *count += sizeof(VkChromaLocation);
+    *count += sizeof(VkChromaLocation);
+}
+
+#endif
+#ifdef VK_EXT_sampler_filter_minmax
+#endif
+#ifdef VK_AMD_gpu_shader_int16
+#endif
+#ifdef VK_AMD_mixed_attachment_samples
+#endif
+#ifdef VK_AMD_shader_fragment_mask
+#endif
+#ifdef VK_EXT_inline_uniform_block
+void count_VkPhysicalDeviceInlineUniformBlockFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceInlineUniformBlockFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceInlineUniformBlockPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceInlineUniformBlockPropertiesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkWriteDescriptorSetInlineUniformBlockEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkWriteDescriptorSetInlineUniformBlockEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->dataSize * sizeof(const uint8_t);
+    }
+}
+
+void count_VkDescriptorPoolInlineUniformBlockCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkDescriptorPoolInlineUniformBlockCreateInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_EXT_shader_stencil_export
+#endif
+#ifdef VK_EXT_sample_locations
+void count_VkSampleLocationEXT(uint32_t featureBits, VkStructureType rootType,
+                               const VkSampleLocationEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(float);
+    *count += sizeof(float);
+}
+
+void count_VkSampleLocationsInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                    const VkSampleLocationsInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkSampleCountFlagBits);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->sampleLocationGridSize), count);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->sampleLocationsCount; ++i) {
+            count_VkSampleLocationEXT(featureBits, rootType,
+                                      (const VkSampleLocationEXT*)(toCount->pSampleLocations + i),
+                                      count);
+        }
+    }
+}
+
+void count_VkAttachmentSampleLocationsEXT(uint32_t featureBits, VkStructureType rootType,
+                                          const VkAttachmentSampleLocationsEXT* toCount,
+                                          size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    count_VkSampleLocationsInfoEXT(
+        featureBits, rootType, (VkSampleLocationsInfoEXT*)(&toCount->sampleLocationsInfo), count);
+}
+
+void count_VkSubpassSampleLocationsEXT(uint32_t featureBits, VkStructureType rootType,
+                                       const VkSubpassSampleLocationsEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    count_VkSampleLocationsInfoEXT(
+        featureBits, rootType, (VkSampleLocationsInfoEXT*)(&toCount->sampleLocationsInfo), count);
+}
+
+void count_VkRenderPassSampleLocationsBeginInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkRenderPassSampleLocationsBeginInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->attachmentInitialSampleLocationsCount; ++i) {
+            count_VkAttachmentSampleLocationsEXT(
+                featureBits, rootType,
+                (const VkAttachmentSampleLocationsEXT*)(toCount->pAttachmentInitialSampleLocations +
+                                                        i),
+                count);
+        }
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->postSubpassSampleLocationsCount; ++i) {
+            count_VkSubpassSampleLocationsEXT(
+                featureBits, rootType,
+                (const VkSubpassSampleLocationsEXT*)(toCount->pPostSubpassSampleLocations + i),
+                count);
+        }
+    }
+}
+
+void count_VkPipelineSampleLocationsStateCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineSampleLocationsStateCreateInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    count_VkSampleLocationsInfoEXT(
+        featureBits, rootType, (VkSampleLocationsInfoEXT*)(&toCount->sampleLocationsInfo), count);
+}
+
+void count_VkPhysicalDeviceSampleLocationsPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceSampleLocationsPropertiesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkSampleCountFlags);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->maxSampleLocationGridSize),
+                     count);
+    *count += 2 * sizeof(float);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkMultisamplePropertiesEXT(uint32_t featureBits, VkStructureType rootType,
+                                      const VkMultisamplePropertiesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->maxSampleLocationGridSize),
+                     count);
+}
+
+#endif
+#ifdef VK_EXT_blend_operation_advanced
+void count_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPipelineColorBlendAdvancedStateCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineColorBlendAdvancedStateCreateInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBlendOverlapEXT);
+}
+
+#endif
+#ifdef VK_NV_fragment_coverage_to_color
+void count_VkPipelineCoverageToColorStateCreateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineCoverageToColorStateCreateInfoNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineCoverageToColorStateCreateFlagsNV);
+    *count += sizeof(VkBool32);
+    *count += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_NV_framebuffer_mixed_samples
+void count_VkPipelineCoverageModulationStateCreateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineCoverageModulationStateCreateInfoNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineCoverageModulationStateCreateFlagsNV);
+    *count += sizeof(VkCoverageModulationModeNV);
+    *count += sizeof(VkBool32);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pCoverageModulationTable) {
+        if (toCount) {
+            *count += toCount->coverageModulationTableCount * sizeof(const float);
+        }
+    }
+}
+
+#endif
+#ifdef VK_NV_fill_rectangle
+#endif
+#ifdef VK_NV_shader_sm_builtins
+void count_VkPhysicalDeviceShaderSMBuiltinsPropertiesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSMBuiltinsPropertiesNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkPhysicalDeviceShaderSMBuiltinsFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSMBuiltinsFeaturesNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_post_depth_coverage
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+void count_VkDrmFormatModifierPropertiesEXT(uint32_t featureBits, VkStructureType rootType,
+                                            const VkDrmFormatModifierPropertiesEXT* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint64_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkFormatFeatureFlags);
+}
+
+void count_VkDrmFormatModifierPropertiesListEXT(uint32_t featureBits, VkStructureType rootType,
+                                                const VkDrmFormatModifierPropertiesListEXT* toCount,
+                                                size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pDrmFormatModifierProperties) {
+        if (toCount) {
+            for (uint32_t i = 0; i < (uint32_t)toCount->drmFormatModifierCount; ++i) {
+                count_VkDrmFormatModifierPropertiesEXT(
+                    featureBits, rootType,
+                    (VkDrmFormatModifierPropertiesEXT*)(toCount->pDrmFormatModifierProperties + i),
+                    count);
+            }
+        }
+    }
+}
+
+void count_VkPhysicalDeviceImageDrmFormatModifierInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceImageDrmFormatModifierInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint64_t);
+    *count += sizeof(VkSharingMode);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pQueueFamilyIndices) {
+        if (toCount) {
+            *count += toCount->queueFamilyIndexCount * sizeof(const uint32_t);
+        }
+    }
+}
+
+void count_VkImageDrmFormatModifierListCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkImageDrmFormatModifierListCreateInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->drmFormatModifierCount * sizeof(const uint64_t);
+    }
+}
+
+void count_VkImageDrmFormatModifierExplicitCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkImageDrmFormatModifierExplicitCreateInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint64_t);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->drmFormatModifierPlaneCount; ++i) {
+            count_VkSubresourceLayout(featureBits, rootType,
+                                      (const VkSubresourceLayout*)(toCount->pPlaneLayouts + i),
+                                      count);
+        }
+    }
+}
+
+void count_VkImageDrmFormatModifierPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkImageDrmFormatModifierPropertiesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint64_t);
+}
+
+void count_VkDrmFormatModifierProperties2EXT(uint32_t featureBits, VkStructureType rootType,
+                                             const VkDrmFormatModifierProperties2EXT* toCount,
+                                             size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint64_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkFormatFeatureFlags2KHR);
+}
+
+void count_VkDrmFormatModifierPropertiesList2EXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkDrmFormatModifierPropertiesList2EXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pDrmFormatModifierProperties) {
+        if (toCount) {
+            for (uint32_t i = 0; i < (uint32_t)toCount->drmFormatModifierCount; ++i) {
+                count_VkDrmFormatModifierProperties2EXT(
+                    featureBits, rootType,
+                    (VkDrmFormatModifierProperties2EXT*)(toCount->pDrmFormatModifierProperties + i),
+                    count);
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_EXT_validation_cache
+void count_VkValidationCacheCreateInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                          const VkValidationCacheCreateInfoEXT* toCount,
+                                          size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkValidationCacheCreateFlagsEXT);
+    *count += 8;
+    if (toCount) {
+        *count += toCount->initialDataSize * sizeof(const uint8_t);
+    }
+}
+
+void count_VkShaderModuleValidationCacheCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkShaderModuleValidationCacheCreateInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+}
+
+#endif
+#ifdef VK_EXT_descriptor_indexing
+#endif
+#ifdef VK_EXT_shader_viewport_index_layer
+#endif
+#ifdef VK_NV_shading_rate_image
+void count_VkShadingRatePaletteNV(uint32_t featureBits, VkStructureType rootType,
+                                  const VkShadingRatePaletteNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->shadingRatePaletteEntryCount * sizeof(const VkShadingRatePaletteEntryNV);
+    }
+}
+
+void count_VkPipelineViewportShadingRateImageStateCreateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineViewportShadingRateImageStateCreateInfoNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pShadingRatePalettes) {
+        if (toCount) {
+            for (uint32_t i = 0; i < (uint32_t)toCount->viewportCount; ++i) {
+                count_VkShadingRatePaletteNV(
+                    featureBits, rootType,
+                    (const VkShadingRatePaletteNV*)(toCount->pShadingRatePalettes + i), count);
+            }
+        }
+    }
+}
+
+void count_VkPhysicalDeviceShadingRateImageFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShadingRateImageFeaturesNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceShadingRateImagePropertiesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShadingRateImagePropertiesNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->shadingRateTexelSize), count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkCoarseSampleLocationNV(uint32_t featureBits, VkStructureType rootType,
+                                    const VkCoarseSampleLocationNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkCoarseSampleOrderCustomNV(uint32_t featureBits, VkStructureType rootType,
+                                       const VkCoarseSampleOrderCustomNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkShadingRatePaletteEntryNV);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->sampleLocationCount; ++i) {
+            count_VkCoarseSampleLocationNV(
+                featureBits, rootType,
+                (const VkCoarseSampleLocationNV*)(toCount->pSampleLocations + i), count);
+        }
+    }
+}
+
+void count_VkPipelineViewportCoarseSampleOrderStateCreateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineViewportCoarseSampleOrderStateCreateInfoNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkCoarseSampleOrderTypeNV);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->customSampleOrderCount; ++i) {
+            count_VkCoarseSampleOrderCustomNV(
+                featureBits, rootType,
+                (const VkCoarseSampleOrderCustomNV*)(toCount->pCustomSampleOrders + i), count);
+        }
+    }
+}
+
+#endif
+#ifdef VK_NV_ray_tracing
+void count_VkRayTracingShaderGroupCreateInfoNV(uint32_t featureBits, VkStructureType rootType,
+                                               const VkRayTracingShaderGroupCreateInfoNV* toCount,
+                                               size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkRayTracingShaderGroupTypeKHR);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkRayTracingPipelineCreateInfoNV(uint32_t featureBits, VkStructureType rootType,
+                                            const VkRayTracingPipelineCreateInfoNV* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineCreateFlags);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->stageCount; ++i) {
+            count_VkPipelineShaderStageCreateInfo(
+                featureBits, rootType,
+                (const VkPipelineShaderStageCreateInfo*)(toCount->pStages + i), count);
+        }
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->groupCount; ++i) {
+            count_VkRayTracingShaderGroupCreateInfoNV(
+                featureBits, rootType,
+                (const VkRayTracingShaderGroupCreateInfoNV*)(toCount->pGroups + i), count);
+        }
+    }
+    *count += sizeof(uint32_t);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    uint64_t cgen_var_1;
+    *count += 1 * 8;
+    *count += sizeof(int32_t);
+}
+
+void count_VkGeometryTrianglesNV(uint32_t featureBits, VkStructureType rootType,
+                                 const VkGeometryTrianglesNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkFormat);
+    uint64_t cgen_var_1;
+    *count += 1 * 8;
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkIndexType);
+    uint64_t cgen_var_2;
+    *count += 1 * 8;
+    *count += sizeof(VkDeviceSize);
+}
+
+void count_VkGeometryAABBNV(uint32_t featureBits, VkStructureType rootType,
+                            const VkGeometryAABBNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkDeviceSize);
+}
+
+void count_VkGeometryDataNV(uint32_t featureBits, VkStructureType rootType,
+                            const VkGeometryDataNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    count_VkGeometryTrianglesNV(featureBits, rootType,
+                                (VkGeometryTrianglesNV*)(&toCount->triangles), count);
+    count_VkGeometryAABBNV(featureBits, rootType, (VkGeometryAABBNV*)(&toCount->aabbs), count);
+}
+
+void count_VkGeometryNV(uint32_t featureBits, VkStructureType rootType, const VkGeometryNV* toCount,
+                        size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkGeometryTypeKHR);
+    count_VkGeometryDataNV(featureBits, rootType, (VkGeometryDataNV*)(&toCount->geometry), count);
+    *count += sizeof(VkGeometryFlagsKHR);
+}
+
+void count_VkAccelerationStructureInfoNV(uint32_t featureBits, VkStructureType rootType,
+                                         const VkAccelerationStructureInfoNV* toCount,
+                                         size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkAccelerationStructureTypeNV);
+    *count += sizeof(VkBuildAccelerationStructureFlagsNV);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->geometryCount; ++i) {
+            count_VkGeometryNV(featureBits, rootType,
+                               (const VkGeometryNV*)(toCount->pGeometries + i), count);
+        }
+    }
+}
+
+void count_VkAccelerationStructureCreateInfoNV(uint32_t featureBits, VkStructureType rootType,
+                                               const VkAccelerationStructureCreateInfoNV* toCount,
+                                               size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDeviceSize);
+    count_VkAccelerationStructureInfoNV(featureBits, rootType,
+                                        (VkAccelerationStructureInfoNV*)(&toCount->info), count);
+}
+
+void count_VkBindAccelerationStructureMemoryInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkBindAccelerationStructureMemoryInfoNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    uint64_t cgen_var_1;
+    *count += 1 * 8;
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->deviceIndexCount * sizeof(const uint32_t);
+    }
+}
+
+void count_VkWriteDescriptorSetAccelerationStructureNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkWriteDescriptorSetAccelerationStructureNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pAccelerationStructures) {
+        if (toCount->accelerationStructureCount) {
+            *count += toCount->accelerationStructureCount * 8;
+        }
+    }
+}
+
+void count_VkAccelerationStructureMemoryRequirementsInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureMemoryRequirementsInfoNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkAccelerationStructureMemoryRequirementsTypeNV);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+}
+
+void count_VkPhysicalDeviceRayTracingPropertiesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingPropertiesNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint64_t);
+    *count += sizeof(uint64_t);
+    *count += sizeof(uint64_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkTransformMatrixKHR(uint32_t featureBits, VkStructureType rootType,
+                                const VkTransformMatrixKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += ((3) * (4)) * sizeof(float);
+}
+
+void count_VkAabbPositionsKHR(uint32_t featureBits, VkStructureType rootType,
+                              const VkAabbPositionsKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(float);
+}
+
+void count_VkAccelerationStructureInstanceKHR(uint32_t featureBits, VkStructureType rootType,
+                                              const VkAccelerationStructureInstanceKHR* toCount,
+                                              size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    count_VkTransformMatrixKHR(featureBits, rootType, (VkTransformMatrixKHR*)(&toCount->transform),
+                               count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkGeometryInstanceFlagsKHR);
+    *count += sizeof(uint64_t);
+}
+
+#endif
+#ifdef VK_NV_representative_fragment_test
+void count_VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPipelineRepresentativeFragmentTestStateCreateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineRepresentativeFragmentTestStateCreateInfoNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_filter_cubic
+void count_VkPhysicalDeviceImageViewImageFormatInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceImageViewImageFormatInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkImageViewType);
+}
+
+void count_VkFilterCubicImageViewImageFormatPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkFilterCubicImageViewImageFormatPropertiesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_QCOM_render_pass_shader_resolve
+#endif
+#ifdef VK_EXT_global_priority
+void count_VkDeviceQueueGlobalPriorityCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkDeviceQueueGlobalPriorityCreateInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkQueueGlobalPriorityEXT);
+}
+
+#endif
+#ifdef VK_EXT_external_memory_host
+void count_VkImportMemoryHostPointerInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                            const VkImportMemoryHostPointerInfoEXT* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkExternalMemoryHandleTypeFlagBits);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pHostPointer) {
+        *count += sizeof(uint8_t);
+    }
+}
+
+void count_VkMemoryHostPointerPropertiesEXT(uint32_t featureBits, VkStructureType rootType,
+                                            const VkMemoryHostPointerPropertiesEXT* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkPhysicalDeviceExternalMemoryHostPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceExternalMemoryHostPropertiesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDeviceSize);
+}
+
+#endif
+#ifdef VK_AMD_buffer_marker
+#endif
+#ifdef VK_AMD_pipeline_compiler_control
+void count_VkPipelineCompilerControlCreateInfoAMD(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineCompilerControlCreateInfoAMD* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineCompilerControlFlagsAMD);
+}
+
+#endif
+#ifdef VK_EXT_calibrated_timestamps
+void count_VkCalibratedTimestampInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                        const VkCalibratedTimestampInfoEXT* toCount,
+                                        size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkTimeDomainEXT);
+}
+
+#endif
+#ifdef VK_AMD_shader_core_properties
+void count_VkPhysicalDeviceShaderCorePropertiesAMD(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderCorePropertiesAMD* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_EXT_video_decode_h265
+void count_VkVideoDecodeH265ProfileEXT(uint32_t featureBits, VkStructureType rootType,
+                                       const VkVideoDecodeH265ProfileEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(StdVideoH265ProfileIdc);
+}
+
+void count_VkVideoDecodeH265CapabilitiesEXT(uint32_t featureBits, VkStructureType rootType,
+                                            const VkVideoDecodeH265CapabilitiesEXT* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    count_VkExtensionProperties(featureBits, rootType,
+                                (VkExtensionProperties*)(&toCount->stdExtensionVersion), count);
+}
+
+void count_VkVideoDecodeH265SessionCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoDecodeH265SessionCreateInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkVideoDecodeH265CreateFlagsEXT);
+    count_VkExtensionProperties(featureBits, rootType,
+                                (const VkExtensionProperties*)(toCount->pStdExtensionVersion),
+                                count);
+}
+
+void count_VkVideoDecodeH265SessionParametersAddInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoDecodeH265SessionParametersAddInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pSpsStd) {
+        if (toCount) {
+            *count += toCount->spsStdCount * sizeof(const StdVideoH265SequenceParameterSet);
+        }
+    }
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pPpsStd) {
+        if (toCount) {
+            *count += toCount->ppsStdCount * sizeof(const StdVideoH265PictureParameterSet);
+        }
+    }
+}
+
+void count_VkVideoDecodeH265SessionParametersCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoDecodeH265SessionParametersCreateInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pParametersAddInfo) {
+        count_VkVideoDecodeH265SessionParametersAddInfoEXT(
+            featureBits, rootType,
+            (const VkVideoDecodeH265SessionParametersAddInfoEXT*)(toCount->pParametersAddInfo),
+            count);
+    }
+}
+
+void count_VkVideoDecodeH265PictureInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                           const VkVideoDecodeH265PictureInfoEXT* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(StdVideoDecodeH265PictureInfo);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->slicesCount * sizeof(const uint32_t);
+    }
+}
+
+void count_VkVideoDecodeH265DpbSlotInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                           const VkVideoDecodeH265DpbSlotInfoEXT* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(const StdVideoDecodeH265ReferenceInfo);
+}
+
+#endif
+#ifdef VK_AMD_memory_overallocation_behavior
+void count_VkDeviceMemoryOverallocationCreateInfoAMD(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkDeviceMemoryOverallocationCreateInfoAMD* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkMemoryOverallocationBehaviorAMD);
+}
+
+#endif
+#ifdef VK_EXT_vertex_attribute_divisor
+void count_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkVertexInputBindingDivisorDescriptionEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVertexInputBindingDivisorDescriptionEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkPipelineVertexInputDivisorStateCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineVertexInputDivisorStateCreateInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->vertexBindingDivisorCount; ++i) {
+            count_VkVertexInputBindingDivisorDescriptionEXT(
+                featureBits, rootType,
+                (const VkVertexInputBindingDivisorDescriptionEXT*)(toCount->pVertexBindingDivisors +
+                                                                   i),
+                count);
+        }
+    }
+}
+
+void count_VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_GGP_frame_token
+void count_VkPresentFrameTokenGGP(uint32_t featureBits, VkStructureType rootType,
+                                  const VkPresentFrameTokenGGP* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(GgpFrameToken);
+}
+
+#endif
+#ifdef VK_EXT_pipeline_creation_feedback
+void count_VkPipelineCreationFeedbackEXT(uint32_t featureBits, VkStructureType rootType,
+                                         const VkPipelineCreationFeedbackEXT* toCount,
+                                         size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkPipelineCreationFeedbackFlagsEXT);
+    *count += sizeof(uint64_t);
+}
+
+void count_VkPipelineCreationFeedbackCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineCreationFeedbackCreateInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkPipelineCreationFeedbackEXT(
+        featureBits, rootType, (VkPipelineCreationFeedbackEXT*)(toCount->pPipelineCreationFeedback),
+        count);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->pipelineStageCreationFeedbackCount; ++i) {
+            count_VkPipelineCreationFeedbackEXT(
+                featureBits, rootType,
+                (VkPipelineCreationFeedbackEXT*)(toCount->pPipelineStageCreationFeedbacks + i),
+                count);
+        }
+    }
+}
+
+#endif
+#ifdef VK_NV_shader_subgroup_partitioned
+#endif
+#ifdef VK_NV_compute_shader_derivatives
+void count_VkPhysicalDeviceComputeShaderDerivativesFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceComputeShaderDerivativesFeaturesNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_NV_mesh_shader
+void count_VkPhysicalDeviceMeshShaderFeaturesNV(uint32_t featureBits, VkStructureType rootType,
+                                                const VkPhysicalDeviceMeshShaderFeaturesNV* toCount,
+                                                size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceMeshShaderPropertiesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceMeshShaderPropertiesNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += 3 * sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += 3 * sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkDrawMeshTasksIndirectCommandNV(uint32_t featureBits, VkStructureType rootType,
+                                            const VkDrawMeshTasksIndirectCommandNV* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_NV_fragment_shader_barycentric
+void count_VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_NV_shader_image_footprint
+void count_VkPhysicalDeviceShaderImageFootprintFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderImageFootprintFeaturesNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_NV_scissor_exclusive
+void count_VkPipelineViewportExclusiveScissorStateCreateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineViewportExclusiveScissorStateCreateInfoNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pExclusiveScissors) {
+        if (toCount) {
+            for (uint32_t i = 0; i < (uint32_t)toCount->exclusiveScissorCount; ++i) {
+                count_VkRect2D(featureBits, rootType,
+                               (const VkRect2D*)(toCount->pExclusiveScissors + i), count);
+            }
+        }
+    }
+}
+
+void count_VkPhysicalDeviceExclusiveScissorFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceExclusiveScissorFeaturesNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+void count_VkQueueFamilyCheckpointPropertiesNV(uint32_t featureBits, VkStructureType rootType,
+                                               const VkQueueFamilyCheckpointPropertiesNV* toCount,
+                                               size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineStageFlags);
+}
+
+void count_VkCheckpointDataNV(uint32_t featureBits, VkStructureType rootType,
+                              const VkCheckpointDataNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineStageFlagBits);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pCheckpointMarker) {
+        *count += sizeof(uint8_t);
+    }
+}
+
+#endif
+#ifdef VK_INTEL_shader_integer_functions2
+void count_VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_INTEL_performance_query
+void count_VkPerformanceValueDataINTEL(uint32_t featureBits, VkStructureType rootType,
+                                       const VkPerformanceValueDataINTEL* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+}
+
+void count_VkPerformanceValueINTEL(uint32_t featureBits, VkStructureType rootType,
+                                   const VkPerformanceValueINTEL* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkPerformanceValueTypeINTEL);
+    count_VkPerformanceValueDataINTEL(featureBits, rootType,
+                                      (VkPerformanceValueDataINTEL*)(&toCount->data), count);
+}
+
+void count_VkInitializePerformanceApiInfoINTEL(uint32_t featureBits, VkStructureType rootType,
+                                               const VkInitializePerformanceApiInfoINTEL* toCount,
+                                               size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pUserData) {
+        *count += sizeof(uint8_t);
+    }
+}
+
+void count_VkQueryPoolPerformanceQueryCreateInfoINTEL(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkQueryPoolPerformanceQueryCreateInfoINTEL* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkQueryPoolSamplingModeINTEL);
+}
+
+void count_VkPerformanceMarkerInfoINTEL(uint32_t featureBits, VkStructureType rootType,
+                                        const VkPerformanceMarkerInfoINTEL* toCount,
+                                        size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint64_t);
+}
+
+void count_VkPerformanceStreamMarkerInfoINTEL(uint32_t featureBits, VkStructureType rootType,
+                                              const VkPerformanceStreamMarkerInfoINTEL* toCount,
+                                              size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkPerformanceOverrideInfoINTEL(uint32_t featureBits, VkStructureType rootType,
+                                          const VkPerformanceOverrideInfoINTEL* toCount,
+                                          size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPerformanceOverrideTypeINTEL);
+    *count += sizeof(VkBool32);
+    *count += sizeof(uint64_t);
+}
+
+void count_VkPerformanceConfigurationAcquireInfoINTEL(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPerformanceConfigurationAcquireInfoINTEL* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPerformanceConfigurationTypeINTEL);
+}
+
+#endif
+#ifdef VK_EXT_pci_bus_info
+void count_VkPhysicalDevicePCIBusInfoPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDevicePCIBusInfoPropertiesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_AMD_display_native_hdr
+void count_VkDisplayNativeHdrSurfaceCapabilitiesAMD(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkDisplayNativeHdrSurfaceCapabilitiesAMD* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkSwapchainDisplayNativeHdrCreateInfoAMD(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkSwapchainDisplayNativeHdrCreateInfoAMD* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_FUCHSIA_imagepipe_surface
+void count_VkImagePipeSurfaceCreateInfoFUCHSIA(uint32_t featureBits, VkStructureType rootType,
+                                               const VkImagePipeSurfaceCreateInfoFUCHSIA* toCount,
+                                               size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkImagePipeSurfaceCreateFlagsFUCHSIA);
+    *count += sizeof(zx_handle_t);
+}
+
+#endif
+#ifdef VK_EXT_metal_surface
+void count_VkMetalSurfaceCreateInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                       const VkMetalSurfaceCreateInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkMetalSurfaceCreateFlagsEXT);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pLayer) {
+        *count += sizeof(const CAMetalLayer);
+    }
+}
+
+#endif
+#ifdef VK_EXT_fragment_density_map
+void count_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMapFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMapPropertiesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->minFragmentDensityTexelSize),
+                     count);
+    count_VkExtent2D(featureBits, rootType, (VkExtent2D*)(&toCount->maxFragmentDensityTexelSize),
+                     count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkRenderPassFragmentDensityMapCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkRenderPassFragmentDensityMapCreateInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkAttachmentReference(featureBits, rootType,
+                                (VkAttachmentReference*)(&toCount->fragmentDensityMapAttachment),
+                                count);
+}
+
+#endif
+#ifdef VK_EXT_scalar_block_layout
+#endif
+#ifdef VK_GOOGLE_hlsl_functionality1
+#endif
+#ifdef VK_GOOGLE_decorate_string
+#endif
+#ifdef VK_EXT_subgroup_size_control
+void count_VkPhysicalDeviceSubgroupSizeControlFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceSubgroupSizeControlFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceSubgroupSizeControlPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceSubgroupSizeControlPropertiesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkShaderStageFlags);
+}
+
+void count_VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_AMD_shader_core_properties2
+void count_VkPhysicalDeviceShaderCoreProperties2AMD(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderCoreProperties2AMD* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkShaderCorePropertiesFlagsAMD);
+    *count += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_AMD_device_coherent_memory
+void count_VkPhysicalDeviceCoherentMemoryFeaturesAMD(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceCoherentMemoryFeaturesAMD* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_shader_image_atomic_int64
+void count_VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_memory_budget
+void count_VkPhysicalDeviceMemoryBudgetPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceMemoryBudgetPropertiesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += VK_MAX_MEMORY_HEAPS * sizeof(VkDeviceSize);
+    *count += VK_MAX_MEMORY_HEAPS * sizeof(VkDeviceSize);
+}
+
+#endif
+#ifdef VK_EXT_memory_priority
+void count_VkPhysicalDeviceMemoryPriorityFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceMemoryPriorityFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkMemoryPriorityAllocateInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                           const VkMemoryPriorityAllocateInfoEXT* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(float);
+}
+
+#endif
+#ifdef VK_NV_dedicated_allocation_image_aliasing
+void count_VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_buffer_device_address
+void count_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkBufferDeviceAddressCreateInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                              const VkBufferDeviceAddressCreateInfoEXT* toCount,
+                                              size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDeviceAddress);
+}
+
+#endif
+#ifdef VK_EXT_tooling_info
+void count_VkPhysicalDeviceToolPropertiesEXT(uint32_t featureBits, VkStructureType rootType,
+                                             const VkPhysicalDeviceToolPropertiesEXT* toCount,
+                                             size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += VK_MAX_EXTENSION_NAME_SIZE * sizeof(char);
+    *count += VK_MAX_EXTENSION_NAME_SIZE * sizeof(char);
+    *count += sizeof(VkToolPurposeFlagsEXT);
+    *count += VK_MAX_DESCRIPTION_SIZE * sizeof(char);
+    *count += VK_MAX_EXTENSION_NAME_SIZE * sizeof(char);
+}
+
+#endif
+#ifdef VK_EXT_separate_stencil_usage
+#endif
+#ifdef VK_EXT_validation_features
+void count_VkValidationFeaturesEXT(uint32_t featureBits, VkStructureType rootType,
+                                   const VkValidationFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count +=
+            toCount->enabledValidationFeatureCount * sizeof(const VkValidationFeatureEnableEXT);
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count +=
+            toCount->disabledValidationFeatureCount * sizeof(const VkValidationFeatureDisableEXT);
+    }
+}
+
+#endif
+#ifdef VK_NV_cooperative_matrix
+void count_VkCooperativeMatrixPropertiesNV(uint32_t featureBits, VkStructureType rootType,
+                                           const VkCooperativeMatrixPropertiesNV* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkComponentTypeNV);
+    *count += sizeof(VkComponentTypeNV);
+    *count += sizeof(VkComponentTypeNV);
+    *count += sizeof(VkComponentTypeNV);
+    *count += sizeof(VkScopeNV);
+}
+
+void count_VkPhysicalDeviceCooperativeMatrixFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceCooperativeMatrixFeaturesNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceCooperativeMatrixPropertiesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceCooperativeMatrixPropertiesNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkShaderStageFlags);
+}
+
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+void count_VkPhysicalDeviceCoverageReductionModeFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceCoverageReductionModeFeaturesNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPipelineCoverageReductionStateCreateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineCoverageReductionStateCreateInfoNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineCoverageReductionStateCreateFlagsNV);
+    *count += sizeof(VkCoverageReductionModeNV);
+}
+
+void count_VkFramebufferMixedSamplesCombinationNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkFramebufferMixedSamplesCombinationNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkCoverageReductionModeNV);
+    *count += sizeof(VkSampleCountFlagBits);
+    *count += sizeof(VkSampleCountFlags);
+    *count += sizeof(VkSampleCountFlags);
+}
+
+#endif
+#ifdef VK_EXT_fragment_shader_interlock
+void count_VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_ycbcr_image_arrays
+void count_VkPhysicalDeviceYcbcrImageArraysFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_provoking_vertex
+void count_VkPhysicalDeviceProvokingVertexFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceProvokingVertexFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceProvokingVertexPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceProvokingVertexPropertiesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkProvokingVertexModeEXT);
+}
+
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+void count_VkSurfaceFullScreenExclusiveInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                               const VkSurfaceFullScreenExclusiveInfoEXT* toCount,
+                                               size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkFullScreenExclusiveEXT);
+}
+
+void count_VkSurfaceCapabilitiesFullScreenExclusiveEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkSurfaceCapabilitiesFullScreenExclusiveEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkSurfaceFullScreenExclusiveWin32InfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkSurfaceFullScreenExclusiveWin32InfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(HMONITOR);
+}
+
+#endif
+#ifdef VK_EXT_headless_surface
+void count_VkHeadlessSurfaceCreateInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                          const VkHeadlessSurfaceCreateInfoEXT* toCount,
+                                          size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkHeadlessSurfaceCreateFlagsEXT);
+}
+
+#endif
+#ifdef VK_EXT_line_rasterization
+void count_VkPhysicalDeviceLineRasterizationFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceLineRasterizationFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceLineRasterizationPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceLineRasterizationPropertiesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkPipelineRasterizationLineStateCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineRasterizationLineStateCreateInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkLineRasterizationModeEXT);
+    *count += sizeof(VkBool32);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint16_t);
+}
+
+#endif
+#ifdef VK_EXT_shader_atomic_float
+void count_VkPhysicalDeviceShaderAtomicFloatFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_host_query_reset
+#endif
+#ifdef VK_EXT_index_type_uint8
+void count_VkPhysicalDeviceIndexTypeUint8FeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceIndexTypeUint8FeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+void count_VkPhysicalDeviceExtendedDynamicStateFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_shader_atomic_float2
+void count_VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_shader_demote_to_helper_invocation
+void count_VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_NV_device_generated_commands
+void count_VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkGraphicsShaderGroupCreateInfoNV(uint32_t featureBits, VkStructureType rootType,
+                                             const VkGraphicsShaderGroupCreateInfoNV* toCount,
+                                             size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->stageCount; ++i) {
+            count_VkPipelineShaderStageCreateInfo(
+                featureBits, rootType,
+                (const VkPipelineShaderStageCreateInfo*)(toCount->pStages + i), count);
+        }
+    }
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pVertexInputState) {
+        count_VkPipelineVertexInputStateCreateInfo(
+            featureBits, rootType,
+            (const VkPipelineVertexInputStateCreateInfo*)(toCount->pVertexInputState), count);
+    }
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pTessellationState) {
+        count_VkPipelineTessellationStateCreateInfo(
+            featureBits, rootType,
+            (const VkPipelineTessellationStateCreateInfo*)(toCount->pTessellationState), count);
+    }
+}
+
+void count_VkGraphicsPipelineShaderGroupsCreateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkGraphicsPipelineShaderGroupsCreateInfoNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->groupCount; ++i) {
+            count_VkGraphicsShaderGroupCreateInfoNV(
+                featureBits, rootType,
+                (const VkGraphicsShaderGroupCreateInfoNV*)(toCount->pGroups + i), count);
+        }
+    }
+    *count += sizeof(uint32_t);
+    if (toCount->pipelineCount) {
+        *count += toCount->pipelineCount * 8;
+    }
+}
+
+void count_VkBindShaderGroupIndirectCommandNV(uint32_t featureBits, VkStructureType rootType,
+                                              const VkBindShaderGroupIndirectCommandNV* toCount,
+                                              size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+}
+
+void count_VkBindIndexBufferIndirectCommandNV(uint32_t featureBits, VkStructureType rootType,
+                                              const VkBindIndexBufferIndirectCommandNV* toCount,
+                                              size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkDeviceAddress);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkIndexType);
+}
+
+void count_VkBindVertexBufferIndirectCommandNV(uint32_t featureBits, VkStructureType rootType,
+                                               const VkBindVertexBufferIndirectCommandNV* toCount,
+                                               size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkDeviceAddress);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkSetStateFlagsIndirectCommandNV(uint32_t featureBits, VkStructureType rootType,
+                                            const VkSetStateFlagsIndirectCommandNV* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+}
+
+void count_VkIndirectCommandsStreamNV(uint32_t featureBits, VkStructureType rootType,
+                                      const VkIndirectCommandsStreamNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkDeviceSize);
+}
+
+void count_VkIndirectCommandsLayoutTokenNV(uint32_t featureBits, VkStructureType rootType,
+                                           const VkIndirectCommandsLayoutTokenNV* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkIndirectCommandsTokenTypeNV);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkBool32);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkShaderStageFlags);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkIndirectStateFlagsNV);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->indexTypeCount * sizeof(const VkIndexType);
+    }
+    if (toCount) {
+        *count += toCount->indexTypeCount * sizeof(const uint32_t);
+    }
+}
+
+void count_VkIndirectCommandsLayoutCreateInfoNV(uint32_t featureBits, VkStructureType rootType,
+                                                const VkIndirectCommandsLayoutCreateInfoNV* toCount,
+                                                size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkIndirectCommandsLayoutUsageFlagsNV);
+    *count += sizeof(VkPipelineBindPoint);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->tokenCount; ++i) {
+            count_VkIndirectCommandsLayoutTokenNV(
+                featureBits, rootType,
+                (const VkIndirectCommandsLayoutTokenNV*)(toCount->pTokens + i), count);
+        }
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->streamCount * sizeof(const uint32_t);
+    }
+}
+
+void count_VkGeneratedCommandsInfoNV(uint32_t featureBits, VkStructureType rootType,
+                                     const VkGeneratedCommandsInfoNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineBindPoint);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    uint64_t cgen_var_1;
+    *count += 1 * 8;
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->streamCount; ++i) {
+            count_VkIndirectCommandsStreamNV(
+                featureBits, rootType, (const VkIndirectCommandsStreamNV*)(toCount->pStreams + i),
+                count);
+        }
+    }
+    *count += sizeof(uint32_t);
+    uint64_t cgen_var_2;
+    *count += 1 * 8;
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+    uint64_t cgen_var_3;
+    *count += 1 * 8;
+    *count += sizeof(VkDeviceSize);
+    uint64_t cgen_var_4;
+    *count += 1 * 8;
+    *count += sizeof(VkDeviceSize);
+}
+
+void count_VkGeneratedCommandsMemoryRequirementsInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkGeneratedCommandsMemoryRequirementsInfoNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineBindPoint);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    uint64_t cgen_var_1;
+    *count += 1 * 8;
+    *count += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_NV_inherited_viewport_scissor
+void count_VkPhysicalDeviceInheritedViewportScissorFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceInheritedViewportScissorFeaturesNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkCommandBufferInheritanceViewportScissorInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkCommandBufferInheritanceViewportScissorInfoNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pViewportDepths) {
+        count_VkViewport(featureBits, rootType, (const VkViewport*)(toCount->pViewportDepths),
+                         count);
+    }
+}
+
+#endif
+#ifdef VK_EXT_texel_buffer_alignment
+void count_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_QCOM_render_pass_transform
+void count_VkRenderPassTransformBeginInfoQCOM(uint32_t featureBits, VkStructureType rootType,
+                                              const VkRenderPassTransformBeginInfoQCOM* toCount,
+                                              size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkSurfaceTransformFlagBitsKHR);
+}
+
+void count_VkCommandBufferInheritanceRenderPassTransformInfoQCOM(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkCommandBufferInheritanceRenderPassTransformInfoQCOM* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkSurfaceTransformFlagBitsKHR);
+    count_VkRect2D(featureBits, rootType, (VkRect2D*)(&toCount->renderArea), count);
+}
+
+#endif
+#ifdef VK_EXT_device_memory_report
+void count_VkPhysicalDeviceDeviceMemoryReportFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceDeviceMemoryReportFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkDeviceMemoryReportCallbackDataEXT(uint32_t featureBits, VkStructureType rootType,
+                                               const VkDeviceMemoryReportCallbackDataEXT* toCount,
+                                               size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDeviceMemoryReportFlagsEXT);
+    *count += sizeof(VkDeviceMemoryReportEventTypeEXT);
+    *count += sizeof(uint64_t);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkObjectType);
+    *count += sizeof(uint64_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkDeviceDeviceMemoryReportCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkDeviceDeviceMemoryReportCreateInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDeviceMemoryReportFlagsEXT);
+    *count += 8;
+    *count += sizeof(uint8_t);
+}
+
+#endif
+#ifdef VK_EXT_acquire_drm_display
+#endif
+#ifdef VK_EXT_robustness2
+void count_VkPhysicalDeviceRobustness2FeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceRobustness2FeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceRobustness2PropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceRobustness2PropertiesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+}
+
+#endif
+#ifdef VK_EXT_custom_border_color
+void count_VkSamplerCustomBorderColorCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkSamplerCustomBorderColorCreateInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkClearColorValue(featureBits, rootType,
+                            (VkClearColorValue*)(&toCount->customBorderColor), count);
+    *count += sizeof(VkFormat);
+}
+
+void count_VkPhysicalDeviceCustomBorderColorPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceCustomBorderColorPropertiesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkPhysicalDeviceCustomBorderColorFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceCustomBorderColorFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_GOOGLE_user_type
+#endif
+#ifdef VK_EXT_private_data
+void count_VkPhysicalDevicePrivateDataFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDevicePrivateDataFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkDevicePrivateDataCreateInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                            const VkDevicePrivateDataCreateInfoEXT* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkPrivateDataSlotCreateInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                          const VkPrivateDataSlotCreateInfoEXT* toCount,
+                                          size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPrivateDataSlotCreateFlagsEXT);
+}
+
+#endif
+#ifdef VK_EXT_pipeline_creation_cache_control
+void count_VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_NV_device_diagnostics_config
+void count_VkPhysicalDeviceDiagnosticsConfigFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceDiagnosticsConfigFeaturesNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkDeviceDiagnosticsConfigCreateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkDeviceDiagnosticsConfigCreateInfoNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDeviceDiagnosticsConfigFlagsNV);
+}
+
+#endif
+#ifdef VK_QCOM_render_pass_store_ops
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+void count_VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkSampleCountFlagBits);
+}
+
+void count_VkPipelineFragmentShadingRateEnumStateCreateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineFragmentShadingRateEnumStateCreateInfoNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkFragmentShadingRateTypeNV);
+    *count += sizeof(VkFragmentShadingRateNV);
+    *count += 2 * sizeof(VkFragmentShadingRateCombinerOpKHR);
+}
+
+#endif
+#ifdef VK_NV_ray_tracing_motion_blur
+void count_VkDeviceOrHostAddressConstKHR(uint32_t featureBits, VkStructureType rootType,
+                                         const VkDeviceOrHostAddressConstKHR* toCount,
+                                         size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkDeviceAddress);
+}
+
+void count_VkAccelerationStructureGeometryMotionTrianglesDataNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureGeometryMotionTrianglesDataNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkDeviceOrHostAddressConstKHR(
+        featureBits, rootType, (VkDeviceOrHostAddressConstKHR*)(&toCount->vertexData), count);
+}
+
+void count_VkAccelerationStructureMotionInfoNV(uint32_t featureBits, VkStructureType rootType,
+                                               const VkAccelerationStructureMotionInfoNV* toCount,
+                                               size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkAccelerationStructureMotionInfoFlagsNV);
+}
+
+void count_VkAccelerationStructureMatrixMotionInstanceNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureMatrixMotionInstanceNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    count_VkTransformMatrixKHR(featureBits, rootType,
+                               (VkTransformMatrixKHR*)(&toCount->transformT0), count);
+    count_VkTransformMatrixKHR(featureBits, rootType,
+                               (VkTransformMatrixKHR*)(&toCount->transformT1), count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkGeometryInstanceFlagsKHR);
+    *count += sizeof(uint64_t);
+}
+
+void count_VkSRTDataNV(uint32_t featureBits, VkStructureType rootType, const VkSRTDataNV* toCount,
+                       size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(float);
+    *count += sizeof(float);
+}
+
+void count_VkAccelerationStructureSRTMotionInstanceNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureSRTMotionInstanceNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    count_VkSRTDataNV(featureBits, rootType, (VkSRTDataNV*)(&toCount->transformT0), count);
+    count_VkSRTDataNV(featureBits, rootType, (VkSRTDataNV*)(&toCount->transformT1), count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkGeometryInstanceFlagsKHR);
+    *count += sizeof(uint64_t);
+}
+
+void count_VkAccelerationStructureMotionInstanceDataNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureMotionInstanceDataNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    count_VkAccelerationStructureInstanceKHR(
+        featureBits, rootType, (VkAccelerationStructureInstanceKHR*)(&toCount->staticInstance),
+        count);
+}
+
+void count_VkAccelerationStructureMotionInstanceNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureMotionInstanceNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkAccelerationStructureMotionInstanceTypeNV);
+    *count += sizeof(VkAccelerationStructureMotionInstanceFlagsNV);
+    count_VkAccelerationStructureMotionInstanceDataNV(
+        featureBits, rootType, (VkAccelerationStructureMotionInstanceDataNV*)(&toCount->data),
+        count);
+}
+
+void count_VkPhysicalDeviceRayTracingMotionBlurFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingMotionBlurFeaturesNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_ycbcr_2plane_444_formats
+void count_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_fragment_density_map2
+void count_VkPhysicalDeviceFragmentDensityMap2FeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceFragmentDensityMap2PropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMap2PropertiesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_QCOM_rotated_copy_commands
+void count_VkCopyCommandTransformInfoQCOM(uint32_t featureBits, VkStructureType rootType,
+                                          const VkCopyCommandTransformInfoQCOM* toCount,
+                                          size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkSurfaceTransformFlagBitsKHR);
+}
+
+#endif
+#ifdef VK_EXT_image_robustness
+void count_VkPhysicalDeviceImageRobustnessFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceImageRobustnessFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_4444_formats
+void count_VkPhysicalDevice4444FormatsFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDevice4444FormatsFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_rgba10x6_formats
+void count_VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_NV_acquire_winrt_display
+#endif
+#ifdef VK_EXT_directfb_surface
+void count_VkDirectFBSurfaceCreateInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                          const VkDirectFBSurfaceCreateInfoEXT* toCount,
+                                          size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDirectFBSurfaceCreateFlagsEXT);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->dfb) {
+        *count += sizeof(IDirectFB);
+    }
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->surface) {
+        *count += sizeof(IDirectFBSurface);
+    }
+}
+
+#endif
+#ifdef VK_VALVE_mutable_descriptor_type
+void count_VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkMutableDescriptorTypeListVALVE(uint32_t featureBits, VkStructureType rootType,
+                                            const VkMutableDescriptorTypeListVALVE* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->descriptorTypeCount * sizeof(const VkDescriptorType);
+    }
+}
+
+void count_VkMutableDescriptorTypeCreateInfoVALVE(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkMutableDescriptorTypeCreateInfoVALVE* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->mutableDescriptorTypeListCount; ++i) {
+            count_VkMutableDescriptorTypeListVALVE(
+                featureBits, rootType,
+                (const VkMutableDescriptorTypeListVALVE*)(toCount->pMutableDescriptorTypeLists + i),
+                count);
+        }
+    }
+}
+
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+void count_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkVertexInputBindingDescription2EXT(uint32_t featureBits, VkStructureType rootType,
+                                               const VkVertexInputBindingDescription2EXT* toCount,
+                                               size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkVertexInputRate);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkVertexInputAttributeDescription2EXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVertexInputAttributeDescription2EXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkFormat);
+    *count += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_EXT_physical_device_drm
+void count_VkPhysicalDeviceDrmPropertiesEXT(uint32_t featureBits, VkStructureType rootType,
+                                            const VkPhysicalDeviceDrmPropertiesEXT* toCount,
+                                            size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(int64_t);
+    *count += sizeof(int64_t);
+    *count += sizeof(int64_t);
+    *count += sizeof(int64_t);
+}
+
+#endif
+#ifdef VK_EXT_primitive_topology_list_restart
+void count_VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_FUCHSIA_external_memory
+void count_VkImportMemoryZirconHandleInfoFUCHSIA(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkImportMemoryZirconHandleInfoFUCHSIA* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkExternalMemoryHandleTypeFlagBits);
+    *count += sizeof(zx_handle_t);
+}
+
+void count_VkMemoryZirconHandlePropertiesFUCHSIA(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkMemoryZirconHandlePropertiesFUCHSIA* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkMemoryGetZirconHandleInfoFUCHSIA(uint32_t featureBits, VkStructureType rootType,
+                                              const VkMemoryGetZirconHandleInfoFUCHSIA* toCount,
+                                              size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkExternalMemoryHandleTypeFlagBits);
+}
+
+#endif
+#ifdef VK_FUCHSIA_external_semaphore
+void count_VkImportSemaphoreZirconHandleInfoFUCHSIA(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkImportSemaphoreZirconHandleInfoFUCHSIA* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkSemaphoreImportFlags);
+    *count += sizeof(VkExternalSemaphoreHandleTypeFlagBits);
+    *count += sizeof(zx_handle_t);
+}
+
+void count_VkSemaphoreGetZirconHandleInfoFUCHSIA(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkSemaphoreGetZirconHandleInfoFUCHSIA* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkExternalSemaphoreHandleTypeFlagBits);
+}
+
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+void count_VkBufferCollectionCreateInfoFUCHSIA(uint32_t featureBits, VkStructureType rootType,
+                                               const VkBufferCollectionCreateInfoFUCHSIA* toCount,
+                                               size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(zx_handle_t);
+}
+
+void count_VkImportMemoryBufferCollectionFUCHSIA(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkImportMemoryBufferCollectionFUCHSIA* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += 8;
+    *count += sizeof(uint32_t);
+}
+
+void count_VkBufferCollectionImageCreateInfoFUCHSIA(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkBufferCollectionImageCreateInfoFUCHSIA* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += 8;
+    *count += sizeof(uint32_t);
+}
+
+void count_VkBufferCollectionConstraintsInfoFUCHSIA(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkBufferCollectionConstraintsInfoFUCHSIA* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkBufferConstraintsInfoFUCHSIA(uint32_t featureBits, VkStructureType rootType,
+                                          const VkBufferConstraintsInfoFUCHSIA* toCount,
+                                          size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkBufferCreateInfo(featureBits, rootType, (VkBufferCreateInfo*)(&toCount->createInfo),
+                             count);
+    *count += sizeof(VkFormatFeatureFlags);
+    count_VkBufferCollectionConstraintsInfoFUCHSIA(
+        featureBits, rootType,
+        (VkBufferCollectionConstraintsInfoFUCHSIA*)(&toCount->bufferCollectionConstraints), count);
+}
+
+void count_VkBufferCollectionBufferCreateInfoFUCHSIA(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkBufferCollectionBufferCreateInfoFUCHSIA* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += 8;
+    *count += sizeof(uint32_t);
+}
+
+void count_VkSysmemColorSpaceFUCHSIA(uint32_t featureBits, VkStructureType rootType,
+                                     const VkSysmemColorSpaceFUCHSIA* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkBufferCollectionPropertiesFUCHSIA(uint32_t featureBits, VkStructureType rootType,
+                                               const VkBufferCollectionPropertiesFUCHSIA* toCount,
+                                               size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint64_t);
+    *count += sizeof(VkFormatFeatureFlags);
+    count_VkSysmemColorSpaceFUCHSIA(featureBits, rootType,
+                                    (VkSysmemColorSpaceFUCHSIA*)(&toCount->sysmemColorSpaceIndex),
+                                    count);
+    count_VkComponentMapping(featureBits, rootType,
+                             (VkComponentMapping*)(&toCount->samplerYcbcrConversionComponents),
+                             count);
+    *count += sizeof(VkSamplerYcbcrModelConversion);
+    *count += sizeof(VkSamplerYcbcrRange);
+    *count += sizeof(VkChromaLocation);
+    *count += sizeof(VkChromaLocation);
+}
+
+void count_VkImageFormatConstraintsInfoFUCHSIA(uint32_t featureBits, VkStructureType rootType,
+                                               const VkImageFormatConstraintsInfoFUCHSIA* toCount,
+                                               size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkImageCreateInfo(featureBits, rootType, (VkImageCreateInfo*)(&toCount->imageCreateInfo),
+                            count);
+    *count += sizeof(VkFormatFeatureFlags);
+    *count += sizeof(VkImageFormatConstraintsFlagsFUCHSIA);
+    *count += sizeof(uint64_t);
+    *count += sizeof(uint32_t);
+    count_VkSysmemColorSpaceFUCHSIA(
+        featureBits, rootType, (const VkSysmemColorSpaceFUCHSIA*)(toCount->pColorSpaces), count);
+}
+
+void count_VkImageConstraintsInfoFUCHSIA(uint32_t featureBits, VkStructureType rootType,
+                                         const VkImageConstraintsInfoFUCHSIA* toCount,
+                                         size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->formatConstraintsCount; ++i) {
+            count_VkImageFormatConstraintsInfoFUCHSIA(
+                featureBits, rootType,
+                (const VkImageFormatConstraintsInfoFUCHSIA*)(toCount->pFormatConstraints + i),
+                count);
+        }
+    }
+    count_VkBufferCollectionConstraintsInfoFUCHSIA(
+        featureBits, rootType,
+        (VkBufferCollectionConstraintsInfoFUCHSIA*)(&toCount->bufferCollectionConstraints), count);
+    *count += sizeof(VkImageConstraintsInfoFlagsFUCHSIA);
+}
+
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+void count_VkSubpassShadingPipelineCreateInfoHUAWEI(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkSubpassShadingPipelineCreateInfoHUAWEI* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(uint32_t);
+}
+
+void count_VkPhysicalDeviceSubpassShadingFeaturesHUAWEI(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceSubpassShadingFeaturesHUAWEI* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceSubpassShadingPropertiesHUAWEI(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceSubpassShadingPropertiesHUAWEI* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+void count_VkPhysicalDeviceInvocationMaskFeaturesHUAWEI(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceInvocationMaskFeaturesHUAWEI* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_NV_external_memory_rdma
+void count_VkMemoryGetRemoteAddressInfoNV(uint32_t featureBits, VkStructureType rootType,
+                                          const VkMemoryGetRemoteAddressInfoNV* toCount,
+                                          size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkExternalMemoryHandleTypeFlagBits);
+}
+
+void count_VkPhysicalDeviceExternalMemoryRDMAFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceExternalMemoryRDMAFeaturesNV* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+void count_VkPhysicalDeviceExtendedDynamicState2FeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_QNX_screen_surface
+void count_VkScreenSurfaceCreateInfoQNX(uint32_t featureBits, VkStructureType rootType,
+                                        const VkScreenSurfaceCreateInfoQNX* toCount,
+                                        size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkScreenSurfaceCreateFlagsQNX);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->context) {
+        *count += sizeof(_screen_context);
+    }
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->window) {
+        *count += sizeof(_screen_window);
+    }
+}
+
+#endif
+#ifdef VK_EXT_color_write_enable
+void count_VkPhysicalDeviceColorWriteEnableFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceColorWriteEnableFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPipelineColorWriteCreateInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                             const VkPipelineColorWriteCreateInfoEXT* toCount,
+                                             size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        *count += toCount->attachmentCount * sizeof(const VkBool32);
+    }
+}
+
+#endif
+#ifdef VK_GOOGLE_gfxstream
+void count_VkImportColorBufferGOOGLE(uint32_t featureBits, VkStructureType rootType,
+                                     const VkImportColorBufferGOOGLE* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkImportBufferGOOGLE(uint32_t featureBits, VkStructureType rootType,
+                                const VkImportBufferGOOGLE* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkCreateBlobGOOGLE(uint32_t featureBits, VkStructureType rootType,
+                              const VkCreateBlobGOOGLE* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint64_t);
+}
+
+#endif
+#ifdef VK_EXT_global_priority_query
+void count_VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkQueueFamilyGlobalPriorityPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkQueueFamilyGlobalPriorityPropertiesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += VK_MAX_GLOBAL_PRIORITY_SIZE_EXT * sizeof(VkQueueGlobalPriorityEXT);
+}
+
+#endif
+#ifdef VK_EXT_multi_draw
+void count_VkPhysicalDeviceMultiDrawFeaturesEXT(uint32_t featureBits, VkStructureType rootType,
+                                                const VkPhysicalDeviceMultiDrawFeaturesEXT* toCount,
+                                                size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceMultiDrawPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceMultiDrawPropertiesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkMultiDrawInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                              const VkMultiDrawInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkMultiDrawIndexedInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                     const VkMultiDrawIndexedInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(int32_t);
+}
+
+#endif
+#ifdef VK_EXT_load_store_op_none
+#endif
+#ifdef VK_EXT_border_color_swizzle
+void count_VkPhysicalDeviceBorderColorSwizzleFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkSamplerBorderColorComponentMappingCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkSamplerBorderColorComponentMappingCreateInfoEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkComponentMapping(featureBits, rootType, (VkComponentMapping*)(&toCount->components),
+                             count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+void count_VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_KHR_acceleration_structure
+void count_VkDeviceOrHostAddressKHR(uint32_t featureBits, VkStructureType rootType,
+                                    const VkDeviceOrHostAddressKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkDeviceAddress);
+}
+
+void count_VkAccelerationStructureBuildRangeInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureBuildRangeInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkAccelerationStructureGeometryTrianglesDataKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureGeometryTrianglesDataKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkFormat);
+    count_VkDeviceOrHostAddressConstKHR(
+        featureBits, rootType, (VkDeviceOrHostAddressConstKHR*)(&toCount->vertexData), count);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(uint32_t);
+    *count += sizeof(VkIndexType);
+    count_VkDeviceOrHostAddressConstKHR(
+        featureBits, rootType, (VkDeviceOrHostAddressConstKHR*)(&toCount->indexData), count);
+    count_VkDeviceOrHostAddressConstKHR(
+        featureBits, rootType, (VkDeviceOrHostAddressConstKHR*)(&toCount->transformData), count);
+}
+
+void count_VkAccelerationStructureGeometryAabbsDataKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureGeometryAabbsDataKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkDeviceOrHostAddressConstKHR(featureBits, rootType,
+                                        (VkDeviceOrHostAddressConstKHR*)(&toCount->data), count);
+    *count += sizeof(VkDeviceSize);
+}
+
+void count_VkAccelerationStructureGeometryInstancesDataKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureGeometryInstancesDataKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    count_VkDeviceOrHostAddressConstKHR(featureBits, rootType,
+                                        (VkDeviceOrHostAddressConstKHR*)(&toCount->data), count);
+}
+
+void count_VkAccelerationStructureGeometryDataKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureGeometryDataKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    count_VkAccelerationStructureGeometryTrianglesDataKHR(
+        featureBits, rootType,
+        (VkAccelerationStructureGeometryTrianglesDataKHR*)(&toCount->triangles), count);
+}
+
+void count_VkAccelerationStructureGeometryKHR(uint32_t featureBits, VkStructureType rootType,
+                                              const VkAccelerationStructureGeometryKHR* toCount,
+                                              size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkGeometryTypeKHR);
+    count_VkAccelerationStructureGeometryDataKHR(
+        featureBits, rootType, (VkAccelerationStructureGeometryDataKHR*)(&toCount->geometry),
+        count);
+    *count += sizeof(VkGeometryFlagsKHR);
+}
+
+void count_VkAccelerationStructureBuildGeometryInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureBuildGeometryInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkAccelerationStructureTypeKHR);
+    *count += sizeof(VkBuildAccelerationStructureFlagsKHR);
+    *count += sizeof(VkBuildAccelerationStructureModeKHR);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    uint64_t cgen_var_1;
+    *count += 1 * 8;
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pGeometries) {
+        if (toCount) {
+            for (uint32_t i = 0; i < (uint32_t)toCount->geometryCount; ++i) {
+                count_VkAccelerationStructureGeometryKHR(
+                    featureBits, rootType,
+                    (const VkAccelerationStructureGeometryKHR*)(toCount->pGeometries + i), count);
+            }
+        }
+    }
+    count_VkDeviceOrHostAddressKHR(featureBits, rootType,
+                                   (VkDeviceOrHostAddressKHR*)(&toCount->scratchData), count);
+}
+
+void count_VkAccelerationStructureCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                                const VkAccelerationStructureCreateInfoKHR* toCount,
+                                                size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkAccelerationStructureCreateFlagsKHR);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkAccelerationStructureTypeKHR);
+    *count += sizeof(VkDeviceAddress);
+}
+
+void count_VkWriteDescriptorSetAccelerationStructureKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkWriteDescriptorSetAccelerationStructureKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pAccelerationStructures) {
+        if (toCount->accelerationStructureCount) {
+            *count += toCount->accelerationStructureCount * 8;
+        }
+    }
+}
+
+void count_VkPhysicalDeviceAccelerationStructureFeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceAccelerationStructureFeaturesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceAccelerationStructurePropertiesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceAccelerationStructurePropertiesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint64_t);
+    *count += sizeof(uint64_t);
+    *count += sizeof(uint64_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkAccelerationStructureDeviceAddressInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureDeviceAddressInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+}
+
+void count_VkAccelerationStructureVersionInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureVersionInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    if (toCount) {
+        *count += 2 * VK_UUID_SIZE * sizeof(const uint8_t);
+    }
+}
+
+void count_VkCopyAccelerationStructureToMemoryInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkCopyAccelerationStructureToMemoryInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    count_VkDeviceOrHostAddressKHR(featureBits, rootType,
+                                   (VkDeviceOrHostAddressKHR*)(&toCount->dst), count);
+    *count += sizeof(VkCopyAccelerationStructureModeKHR);
+}
+
+void count_VkCopyMemoryToAccelerationStructureInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkCopyMemoryToAccelerationStructureInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    count_VkDeviceOrHostAddressConstKHR(featureBits, rootType,
+                                        (VkDeviceOrHostAddressConstKHR*)(&toCount->src), count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    *count += sizeof(VkCopyAccelerationStructureModeKHR);
+}
+
+void count_VkCopyAccelerationStructureInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                              const VkCopyAccelerationStructureInfoKHR* toCount,
+                                              size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    uint64_t cgen_var_1;
+    *count += 1 * 8;
+    *count += sizeof(VkCopyAccelerationStructureModeKHR);
+}
+
+void count_VkAccelerationStructureBuildSizesInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureBuildSizesInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+}
+
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+void count_VkRayTracingShaderGroupCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                                const VkRayTracingShaderGroupCreateInfoKHR* toCount,
+                                                size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkRayTracingShaderGroupTypeKHR);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pShaderGroupCaptureReplayHandle) {
+        *count += sizeof(const uint8_t);
+    }
+}
+
+void count_VkRayTracingPipelineInterfaceCreateInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkRayTracingPipelineInterfaceCreateInfoKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkRayTracingPipelineCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                             const VkRayTracingPipelineCreateInfoKHR* toCount,
+                                             size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkPipelineCreateFlags);
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->stageCount; ++i) {
+            count_VkPipelineShaderStageCreateInfo(
+                featureBits, rootType,
+                (const VkPipelineShaderStageCreateInfo*)(toCount->pStages + i), count);
+        }
+    }
+    *count += sizeof(uint32_t);
+    if (toCount) {
+        for (uint32_t i = 0; i < (uint32_t)toCount->groupCount; ++i) {
+            count_VkRayTracingShaderGroupCreateInfoKHR(
+                featureBits, rootType,
+                (const VkRayTracingShaderGroupCreateInfoKHR*)(toCount->pGroups + i), count);
+        }
+    }
+    *count += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pLibraryInfo) {
+        count_VkPipelineLibraryCreateInfoKHR(
+            featureBits, rootType, (const VkPipelineLibraryCreateInfoKHR*)(toCount->pLibraryInfo),
+            count);
+    }
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pLibraryInterface) {
+        count_VkRayTracingPipelineInterfaceCreateInfoKHR(
+            featureBits, rootType,
+            (const VkRayTracingPipelineInterfaceCreateInfoKHR*)(toCount->pLibraryInterface), count);
+    }
+    // WARNING PTR CHECK
+    *count += 8;
+    if (toCount->pDynamicState) {
+        count_VkPipelineDynamicStateCreateInfo(
+            featureBits, rootType,
+            (const VkPipelineDynamicStateCreateInfo*)(toCount->pDynamicState), count);
+    }
+    uint64_t cgen_var_0;
+    *count += 1 * 8;
+    uint64_t cgen_var_1;
+    *count += 1 * 8;
+    *count += sizeof(int32_t);
+}
+
+void count_VkPhysicalDeviceRayTracingPipelineFeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingPipelineFeaturesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+    *count += sizeof(VkBool32);
+}
+
+void count_VkPhysicalDeviceRayTracingPipelinePropertiesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingPipelinePropertiesKHR* toCount, size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+void count_VkStridedDeviceAddressRegionKHR(uint32_t featureBits, VkStructureType rootType,
+                                           const VkStridedDeviceAddressRegionKHR* toCount,
+                                           size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkDeviceAddress);
+    *count += sizeof(VkDeviceSize);
+    *count += sizeof(VkDeviceSize);
+}
+
+void count_VkTraceRaysIndirectCommandKHR(uint32_t featureBits, VkStructureType rootType,
+                                         const VkTraceRaysIndirectCommandKHR* toCount,
+                                         size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+    *count += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_KHR_ray_query
+void count_VkPhysicalDeviceRayQueryFeaturesKHR(uint32_t featureBits, VkStructureType rootType,
+                                               const VkPhysicalDeviceRayQueryFeaturesKHR* toCount,
+                                               size_t* count) {
+    (void)featureBits;
+    (void)rootType;
+    (void)toCount;
+    (void)count;
+    *count += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = toCount->sType;
+    }
+    count_extension_struct(featureBits, rootType, toCount->pNext, count);
+    *count += sizeof(VkBool32);
+}
+
+#endif
+void count_extension_struct(uint32_t featureBits, VkStructureType rootType,
+                            const void* structExtension, size_t* count) {
+    VkInstanceCreateInfo* structAccess = (VkInstanceCreateInfo*)(structExtension);
+    size_t currExtSize = goldfish_vk_extension_struct_size_with_stream_features(
+        featureBits, rootType, structExtension);
+    if (!currExtSize && structExtension) {
+        // unknown struct extension; skip and call on its pNext field
+        count_extension_struct(featureBits, rootType, (void*)structAccess->pNext, count);
+        return;
+    } else {
+        // known or null extension struct
+        *count += sizeof(uint32_t);
+        if (!currExtSize) {
+            // exit if this was a null extension struct (size == 0 in this branch)
+            return;
+        }
+    }
+    *count += sizeof(VkStructureType);
+    if (!structExtension) {
+        return;
+    }
+    uint32_t structType = (uint32_t)goldfish_vk_struct_type(structExtension);
+    switch (structType) {
+#ifdef VK_VERSION_1_1
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES: {
+            count_VkPhysicalDeviceSubgroupProperties(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSubgroupProperties*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: {
+            count_VkPhysicalDevice16BitStorageFeatures(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDevice16BitStorageFeatures*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS: {
+            count_VkMemoryDedicatedRequirements(
+                featureBits, rootType,
+                reinterpret_cast<const VkMemoryDedicatedRequirements*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO: {
+            count_VkMemoryDedicatedAllocateInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkMemoryDedicatedAllocateInfo*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO: {
+            count_VkMemoryAllocateFlagsInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkMemoryAllocateFlagsInfo*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO: {
+            count_VkDeviceGroupRenderPassBeginInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkDeviceGroupRenderPassBeginInfo*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO: {
+            count_VkDeviceGroupCommandBufferBeginInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkDeviceGroupCommandBufferBeginInfo*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO: {
+            count_VkDeviceGroupSubmitInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkDeviceGroupSubmitInfo*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO: {
+            count_VkDeviceGroupBindSparseInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkDeviceGroupBindSparseInfo*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO: {
+            count_VkBindBufferMemoryDeviceGroupInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkBindBufferMemoryDeviceGroupInfo*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO: {
+            count_VkBindImageMemoryDeviceGroupInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkBindImageMemoryDeviceGroupInfo*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO: {
+            count_VkDeviceGroupDeviceCreateInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkDeviceGroupDeviceCreateInfo*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: {
+            count_VkPhysicalDeviceFeatures2(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFeatures2*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES: {
+            count_VkPhysicalDevicePointClippingProperties(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDevicePointClippingProperties*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO: {
+            count_VkRenderPassInputAttachmentAspectCreateInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkRenderPassInputAttachmentAspectCreateInfo*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO: {
+            count_VkImageViewUsageCreateInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkImageViewUsageCreateInfo*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO: {
+            count_VkPipelineTessellationDomainOriginStateCreateInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkPipelineTessellationDomainOriginStateCreateInfo*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO: {
+            count_VkRenderPassMultiviewCreateInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkRenderPassMultiviewCreateInfo*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES: {
+            count_VkPhysicalDeviceMultiviewFeatures(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMultiviewFeatures*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES: {
+            count_VkPhysicalDeviceMultiviewProperties(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMultiviewProperties*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES: {
+            count_VkPhysicalDeviceVariablePointersFeatures(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVariablePointersFeatures*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES: {
+            count_VkPhysicalDeviceProtectedMemoryFeatures(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceProtectedMemoryFeatures*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES: {
+            count_VkPhysicalDeviceProtectedMemoryProperties(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceProtectedMemoryProperties*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO: {
+            count_VkProtectedSubmitInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkProtectedSubmitInfo*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO: {
+            count_VkSamplerYcbcrConversionInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkSamplerYcbcrConversionInfo*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO: {
+            count_VkBindImagePlaneMemoryInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkBindImagePlaneMemoryInfo*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO: {
+            count_VkImagePlaneMemoryRequirementsInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkImagePlaneMemoryRequirementsInfo*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: {
+            count_VkPhysicalDeviceSamplerYcbcrConversionFeatures(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSamplerYcbcrConversionFeatures*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES: {
+            count_VkSamplerYcbcrConversionImageFormatProperties(
+                featureBits, rootType,
+                reinterpret_cast<const VkSamplerYcbcrConversionImageFormatProperties*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO: {
+            count_VkPhysicalDeviceExternalImageFormatInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceExternalImageFormatInfo*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES: {
+            count_VkExternalImageFormatProperties(
+                featureBits, rootType,
+                reinterpret_cast<const VkExternalImageFormatProperties*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES: {
+            count_VkPhysicalDeviceIDProperties(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceIDProperties*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO: {
+            count_VkExternalMemoryImageCreateInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkExternalMemoryImageCreateInfo*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO: {
+            count_VkExternalMemoryBufferCreateInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkExternalMemoryBufferCreateInfo*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO: {
+            count_VkExportMemoryAllocateInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkExportMemoryAllocateInfo*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO: {
+            count_VkExportFenceCreateInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkExportFenceCreateInfo*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO: {
+            count_VkExportSemaphoreCreateInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkExportSemaphoreCreateInfo*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES: {
+            count_VkPhysicalDeviceMaintenance3Properties(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMaintenance3Properties*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES: {
+            count_VkPhysicalDeviceShaderDrawParametersFeatures(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderDrawParametersFeatures*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_VERSION_1_2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES: {
+            count_VkPhysicalDeviceVulkan11Features(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVulkan11Features*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES: {
+            count_VkPhysicalDeviceVulkan11Properties(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVulkan11Properties*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES: {
+            count_VkPhysicalDeviceVulkan12Features(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVulkan12Features*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES: {
+            count_VkPhysicalDeviceVulkan12Properties(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVulkan12Properties*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO: {
+            count_VkImageFormatListCreateInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkImageFormatListCreateInfo*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES: {
+            count_VkPhysicalDevice8BitStorageFeatures(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDevice8BitStorageFeatures*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES: {
+            count_VkPhysicalDeviceDriverProperties(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDriverProperties*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES: {
+            count_VkPhysicalDeviceShaderAtomicInt64Features(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderAtomicInt64Features*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES: {
+            count_VkPhysicalDeviceShaderFloat16Int8Features(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderFloat16Int8Features*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES: {
+            count_VkPhysicalDeviceFloatControlsProperties(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFloatControlsProperties*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO: {
+            count_VkDescriptorSetLayoutBindingFlagsCreateInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkDescriptorSetLayoutBindingFlagsCreateInfo*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES: {
+            count_VkPhysicalDeviceDescriptorIndexingFeatures(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDescriptorIndexingFeatures*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES: {
+            count_VkPhysicalDeviceDescriptorIndexingProperties(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDescriptorIndexingProperties*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO: {
+            count_VkDescriptorSetVariableDescriptorCountAllocateInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkDescriptorSetVariableDescriptorCountAllocateInfo*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT: {
+            count_VkDescriptorSetVariableDescriptorCountLayoutSupport(
+                featureBits, rootType,
+                reinterpret_cast<const VkDescriptorSetVariableDescriptorCountLayoutSupport*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE: {
+            count_VkSubpassDescriptionDepthStencilResolve(
+                featureBits, rootType,
+                reinterpret_cast<const VkSubpassDescriptionDepthStencilResolve*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES: {
+            count_VkPhysicalDeviceDepthStencilResolveProperties(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDepthStencilResolveProperties*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES: {
+            count_VkPhysicalDeviceScalarBlockLayoutFeatures(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceScalarBlockLayoutFeatures*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO: {
+            count_VkImageStencilUsageCreateInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkImageStencilUsageCreateInfo*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO: {
+            count_VkSamplerReductionModeCreateInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkSamplerReductionModeCreateInfo*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES: {
+            count_VkPhysicalDeviceSamplerFilterMinmaxProperties(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSamplerFilterMinmaxProperties*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES: {
+            count_VkPhysicalDeviceVulkanMemoryModelFeatures(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVulkanMemoryModelFeatures*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES: {
+            count_VkPhysicalDeviceImagelessFramebufferFeatures(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceImagelessFramebufferFeatures*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO: {
+            count_VkFramebufferAttachmentsCreateInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkFramebufferAttachmentsCreateInfo*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO: {
+            count_VkRenderPassAttachmentBeginInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkRenderPassAttachmentBeginInfo*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES: {
+            count_VkPhysicalDeviceUniformBufferStandardLayoutFeatures(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceUniformBufferStandardLayoutFeatures*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES: {
+            count_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES: {
+            count_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT: {
+            count_VkAttachmentReferenceStencilLayout(
+                featureBits, rootType,
+                reinterpret_cast<const VkAttachmentReferenceStencilLayout*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT: {
+            count_VkAttachmentDescriptionStencilLayout(
+                featureBits, rootType,
+                reinterpret_cast<const VkAttachmentDescriptionStencilLayout*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES: {
+            count_VkPhysicalDeviceHostQueryResetFeatures(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceHostQueryResetFeatures*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES: {
+            count_VkPhysicalDeviceTimelineSemaphoreFeatures(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceTimelineSemaphoreFeatures*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES: {
+            count_VkPhysicalDeviceTimelineSemaphoreProperties(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceTimelineSemaphoreProperties*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO: {
+            count_VkSemaphoreTypeCreateInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkSemaphoreTypeCreateInfo*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO: {
+            count_VkTimelineSemaphoreSubmitInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkTimelineSemaphoreSubmitInfo*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES: {
+            count_VkPhysicalDeviceBufferDeviceAddressFeatures(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceBufferDeviceAddressFeatures*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO: {
+            count_VkBufferOpaqueCaptureAddressCreateInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkBufferOpaqueCaptureAddressCreateInfo*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO: {
+            count_VkMemoryOpaqueCaptureAddressAllocateInfo(
+                featureBits, rootType,
+                reinterpret_cast<const VkMemoryOpaqueCaptureAddressAllocateInfo*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_swapchain
+        case VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR: {
+            count_VkImageSwapchainCreateInfoKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkImageSwapchainCreateInfoKHR*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR: {
+            count_VkBindImageMemorySwapchainInfoKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkBindImageMemorySwapchainInfoKHR*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR: {
+            count_VkDeviceGroupPresentInfoKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkDeviceGroupPresentInfoKHR*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR: {
+            count_VkDeviceGroupSwapchainCreateInfoKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkDeviceGroupSwapchainCreateInfoKHR*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_display_swapchain
+        case VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR: {
+            count_VkDisplayPresentInfoKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkDisplayPresentInfoKHR*>(structExtension), count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_video_queue
+        case VK_STRUCTURE_TYPE_VIDEO_QUEUE_FAMILY_PROPERTIES_2_KHR: {
+            count_VkVideoQueueFamilyProperties2KHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoQueueFamilyProperties2KHR*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_PROFILE_KHR: {
+            count_VkVideoProfileKHR(featureBits, rootType,
+                                    reinterpret_cast<const VkVideoProfileKHR*>(structExtension),
+                                    count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_PROFILES_KHR: {
+            count_VkVideoProfilesKHR(featureBits, rootType,
+                                     reinterpret_cast<const VkVideoProfilesKHR*>(structExtension),
+                                     count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_dynamic_rendering
+        case VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO_KHR: {
+            count_VkPipelineRenderingCreateInfoKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkPipelineRenderingCreateInfoKHR*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR: {
+            count_VkPhysicalDeviceDynamicRenderingFeaturesKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDynamicRenderingFeaturesKHR*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO_KHR: {
+            count_VkCommandBufferInheritanceRenderingInfoKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkCommandBufferInheritanceRenderingInfoKHR*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR: {
+            count_VkRenderingFragmentShadingRateAttachmentInfoKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkRenderingFragmentShadingRateAttachmentInfoKHR*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT: {
+            count_VkRenderingFragmentDensityMapAttachmentInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkRenderingFragmentDensityMapAttachmentInfoEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD: {
+            count_VkAttachmentSampleCountInfoAMD(
+                featureBits, rootType,
+                reinterpret_cast<const VkAttachmentSampleCountInfoAMD*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX: {
+            count_VkMultiviewPerViewAttributesInfoNVX(
+                featureBits, rootType,
+                reinterpret_cast<const VkMultiviewPerViewAttributesInfoNVX*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_memory_win32
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR: {
+            count_VkImportMemoryWin32HandleInfoKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkImportMemoryWin32HandleInfoKHR*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR: {
+            count_VkExportMemoryWin32HandleInfoKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkExportMemoryWin32HandleInfoKHR*>(structExtension), count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_memory_fd
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR: {
+            count_VkImportMemoryFdInfoKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkImportMemoryFdInfoKHR*>(structExtension), count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_win32_keyed_mutex
+        case VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR: {
+            count_VkWin32KeyedMutexAcquireReleaseInfoKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkWin32KeyedMutexAcquireReleaseInfoKHR*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+        case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR: {
+            count_VkExportSemaphoreWin32HandleInfoKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkExportSemaphoreWin32HandleInfoKHR*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR: {
+            count_VkD3D12FenceSubmitInfoKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkD3D12FenceSubmitInfoKHR*>(structExtension), count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_push_descriptor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR: {
+            count_VkPhysicalDevicePushDescriptorPropertiesKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDevicePushDescriptorPropertiesKHR*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_incremental_present
+        case VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR: {
+            count_VkPresentRegionsKHR(featureBits, rootType,
+                                      reinterpret_cast<const VkPresentRegionsKHR*>(structExtension),
+                                      count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_shared_presentable_image
+        case VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR: {
+            count_VkSharedPresentSurfaceCapabilitiesKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkSharedPresentSurfaceCapabilitiesKHR*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_fence_win32
+        case VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR: {
+            count_VkExportFenceWin32HandleInfoKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkExportFenceWin32HandleInfoKHR*>(structExtension), count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_performance_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR: {
+            count_VkPhysicalDevicePerformanceQueryFeaturesKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDevicePerformanceQueryFeaturesKHR*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR: {
+            count_VkPhysicalDevicePerformanceQueryPropertiesKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDevicePerformanceQueryPropertiesKHR*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR: {
+            count_VkQueryPoolPerformanceCreateInfoKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkQueryPoolPerformanceCreateInfoKHR*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR: {
+            count_VkPerformanceQuerySubmitInfoKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkPerformanceQuerySubmitInfoKHR*>(structExtension), count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_portability_subset
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR: {
+            count_VkPhysicalDevicePortabilitySubsetFeaturesKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDevicePortabilitySubsetFeaturesKHR*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR: {
+            count_VkPhysicalDevicePortabilitySubsetPropertiesKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDevicePortabilitySubsetPropertiesKHR*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_clock
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR: {
+            count_VkPhysicalDeviceShaderClockFeaturesKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderClockFeaturesKHR*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_terminate_invocation
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR: {
+            count_VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+        case VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR: {
+            count_VkFragmentShadingRateAttachmentInfoKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkFragmentShadingRateAttachmentInfoKHR*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR: {
+            count_VkPipelineFragmentShadingRateStateCreateInfoKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkPipelineFragmentShadingRateStateCreateInfoKHR*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR: {
+            count_VkPhysicalDeviceFragmentShadingRateFeaturesKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentShadingRateFeaturesKHR*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR: {
+            count_VkPhysicalDeviceFragmentShadingRatePropertiesKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentShadingRatePropertiesKHR*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_surface_protected_capabilities
+        case VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR: {
+            count_VkSurfaceProtectedCapabilitiesKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkSurfaceProtectedCapabilitiesKHR*>(structExtension), count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_present_wait
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR: {
+            count_VkPhysicalDevicePresentWaitFeaturesKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDevicePresentWaitFeaturesKHR*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR: {
+            count_VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_integer_dot_product
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR: {
+            count_VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR: {
+            count_VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_present_id
+        case VK_STRUCTURE_TYPE_PRESENT_ID_KHR: {
+            count_VkPresentIdKHR(featureBits, rootType,
+                                 reinterpret_cast<const VkPresentIdKHR*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR: {
+            count_VkPhysicalDevicePresentIdFeaturesKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDevicePresentIdFeaturesKHR*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_video_encode_queue
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_INFO_KHR: {
+            count_VkVideoEncodeRateControlInfoKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoEncodeRateControlInfoKHR*>(structExtension), count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_synchronization2
+        case VK_STRUCTURE_TYPE_MEMORY_BARRIER_2_KHR: {
+            count_VkMemoryBarrier2KHR(featureBits, rootType,
+                                      reinterpret_cast<const VkMemoryBarrier2KHR*>(structExtension),
+                                      count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR: {
+            count_VkPhysicalDeviceSynchronization2FeaturesKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSynchronization2FeaturesKHR*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV: {
+            count_VkQueueFamilyCheckpointProperties2NV(
+                featureBits, rootType,
+                reinterpret_cast<const VkQueueFamilyCheckpointProperties2NV*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_subgroup_uniform_control_flow
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR: {
+            count_VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR(
+                featureBits, rootType,
+                reinterpret_cast<
+                    const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_zero_initialize_workgroup_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES_KHR: {
+            count_VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_workgroup_memory_explicit_layout
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR: {
+            count_VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_format_feature_flags2
+        case VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3_KHR: {
+            count_VkFormatProperties3KHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkFormatProperties3KHR*>(structExtension), count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_maintenance4
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES_KHR: {
+            count_VkPhysicalDeviceMaintenance4FeaturesKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMaintenance4FeaturesKHR*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES_KHR: {
+            count_VkPhysicalDeviceMaintenance4PropertiesKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMaintenance4PropertiesKHR*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_ANDROID_native_buffer
+        case VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID: {
+            count_VkNativeBufferANDROID(
+                featureBits, rootType,
+                reinterpret_cast<const VkNativeBufferANDROID*>(structExtension), count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_debug_report
+        case VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT: {
+            count_VkDebugReportCallbackCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkDebugReportCallbackCreateInfoEXT*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_AMD_rasterization_order
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD: {
+            count_VkPipelineRasterizationStateRasterizationOrderAMD(
+                featureBits, rootType,
+                reinterpret_cast<const VkPipelineRasterizationStateRasterizationOrderAMD*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_NV_dedicated_allocation
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV: {
+            count_VkDedicatedAllocationImageCreateInfoNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkDedicatedAllocationImageCreateInfoNV*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV: {
+            count_VkDedicatedAllocationBufferCreateInfoNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkDedicatedAllocationBufferCreateInfoNV*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV: {
+            count_VkDedicatedAllocationMemoryAllocateInfoNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkDedicatedAllocationMemoryAllocateInfoNV*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_transform_feedback
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT: {
+            count_VkPhysicalDeviceTransformFeedbackFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceTransformFeedbackFeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT: {
+            count_VkPhysicalDeviceTransformFeedbackPropertiesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceTransformFeedbackPropertiesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT: {
+            count_VkPipelineRasterizationStateStreamCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPipelineRasterizationStateStreamCreateInfoEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_encode_h264
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_EXT: {
+            count_VkVideoEncodeH264CapabilitiesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoEncodeH264CapabilitiesEXT*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_CREATE_INFO_EXT: {
+            count_VkVideoEncodeH264SessionCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoEncodeH264SessionCreateInfoEXT*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            count_VkVideoEncodeH264SessionParametersAddInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoEncodeH264SessionParametersAddInfoEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            count_VkVideoEncodeH264SessionParametersCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoEncodeH264SessionParametersCreateInfoEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_VCL_FRAME_INFO_EXT: {
+            count_VkVideoEncodeH264VclFrameInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoEncodeH264VclFrameInfoEXT*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_EMIT_PICTURE_PARAMETERS_EXT: {
+            count_VkVideoEncodeH264EmitPictureParametersEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoEncodeH264EmitPictureParametersEXT*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_EXT: {
+            count_VkVideoEncodeH264ProfileEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoEncodeH264ProfileEXT*>(structExtension), count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_encode_h265
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_EXT: {
+            count_VkVideoEncodeH265CapabilitiesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoEncodeH265CapabilitiesEXT*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_CREATE_INFO_EXT: {
+            count_VkVideoEncodeH265SessionCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoEncodeH265SessionCreateInfoEXT*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            count_VkVideoEncodeH265SessionParametersAddInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoEncodeH265SessionParametersAddInfoEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            count_VkVideoEncodeH265SessionParametersCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoEncodeH265SessionParametersCreateInfoEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_VCL_FRAME_INFO_EXT: {
+            count_VkVideoEncodeH265VclFrameInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoEncodeH265VclFrameInfoEXT*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_EMIT_PICTURE_PARAMETERS_EXT: {
+            count_VkVideoEncodeH265EmitPictureParametersEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoEncodeH265EmitPictureParametersEXT*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_EXT: {
+            count_VkVideoEncodeH265ProfileEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoEncodeH265ProfileEXT*>(structExtension), count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_decode_h264
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_EXT: {
+            count_VkVideoDecodeH264ProfileEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoDecodeH264ProfileEXT*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_EXT: {
+            count_VkVideoDecodeH264CapabilitiesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoDecodeH264CapabilitiesEXT*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_CREATE_INFO_EXT: {
+            count_VkVideoDecodeH264SessionCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoDecodeH264SessionCreateInfoEXT*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            count_VkVideoDecodeH264SessionParametersAddInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoDecodeH264SessionParametersAddInfoEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            count_VkVideoDecodeH264SessionParametersCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoDecodeH264SessionParametersCreateInfoEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PICTURE_INFO_EXT: {
+            count_VkVideoDecodeH264PictureInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoDecodeH264PictureInfoEXT*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_MVC_EXT: {
+            count_VkVideoDecodeH264MvcEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoDecodeH264MvcEXT*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_EXT: {
+            count_VkVideoDecodeH264DpbSlotInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoDecodeH264DpbSlotInfoEXT*>(structExtension), count);
+            break;
+        }
+#endif
+#ifdef VK_AMD_texture_gather_bias_lod
+        case VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD: {
+            count_VkTextureLODGatherFormatPropertiesAMD(
+                featureBits, rootType,
+                reinterpret_cast<const VkTextureLODGatherFormatPropertiesAMD*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_NV_corner_sampled_image
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV: {
+            count_VkPhysicalDeviceCornerSampledImageFeaturesNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceCornerSampledImageFeaturesNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_NV_external_memory
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV: {
+            count_VkExternalMemoryImageCreateInfoNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkExternalMemoryImageCreateInfoNV*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV: {
+            count_VkExportMemoryAllocateInfoNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkExportMemoryAllocateInfoNV*>(structExtension), count);
+            break;
+        }
+#endif
+#ifdef VK_NV_external_memory_win32
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV: {
+            count_VkImportMemoryWin32HandleInfoNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkImportMemoryWin32HandleInfoNV*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV: {
+            count_VkExportMemoryWin32HandleInfoNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkExportMemoryWin32HandleInfoNV*>(structExtension), count);
+            break;
+        }
+#endif
+#ifdef VK_NV_win32_keyed_mutex
+        case VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV: {
+            count_VkWin32KeyedMutexAcquireReleaseInfoNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkWin32KeyedMutexAcquireReleaseInfoNV*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_validation_flags
+        case VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT: {
+            count_VkValidationFlagsEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkValidationFlagsEXT*>(structExtension), count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_texture_compression_astc_hdr
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES_EXT: {
+            count_VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_astc_decode_mode
+        case VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT: {
+            count_VkImageViewASTCDecodeModeEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkImageViewASTCDecodeModeEXT*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT: {
+            count_VkPhysicalDeviceASTCDecodeFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceASTCDecodeFeaturesEXT*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_conditional_rendering
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT: {
+            count_VkPhysicalDeviceConditionalRenderingFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceConditionalRenderingFeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT: {
+            count_VkCommandBufferInheritanceConditionalRenderingInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkCommandBufferInheritanceConditionalRenderingInfoEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV: {
+            count_VkPipelineViewportWScalingStateCreateInfoNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPipelineViewportWScalingStateCreateInfoNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_display_control
+        case VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT: {
+            count_VkSwapchainCounterCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkSwapchainCounterCreateInfoEXT*>(structExtension), count);
+            break;
+        }
+#endif
+#ifdef VK_GOOGLE_display_timing
+        case VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE: {
+            count_VkPresentTimesInfoGOOGLE(
+                featureBits, rootType,
+                reinterpret_cast<const VkPresentTimesInfoGOOGLE*>(structExtension), count);
+            break;
+        }
+#endif
+#ifdef VK_NVX_multiview_per_view_attributes
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX: {
+            count_VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_NV_viewport_swizzle
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV: {
+            count_VkPipelineViewportSwizzleStateCreateInfoNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPipelineViewportSwizzleStateCreateInfoNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_discard_rectangles
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT: {
+            count_VkPhysicalDeviceDiscardRectanglePropertiesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDiscardRectanglePropertiesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT: {
+            count_VkPipelineDiscardRectangleStateCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPipelineDiscardRectangleStateCreateInfoEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_conservative_rasterization
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT: {
+            count_VkPhysicalDeviceConservativeRasterizationPropertiesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceConservativeRasterizationPropertiesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT: {
+            count_VkPipelineRasterizationConservativeStateCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPipelineRasterizationConservativeStateCreateInfoEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_depth_clip_enable
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT: {
+            count_VkPhysicalDeviceDepthClipEnableFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDepthClipEnableFeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT: {
+            count_VkPipelineRasterizationDepthClipStateCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPipelineRasterizationDepthClipStateCreateInfoEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_debug_utils
+        case VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT: {
+            count_VkDebugUtilsMessengerCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkDebugUtilsMessengerCreateInfoEXT*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID: {
+            count_VkAndroidHardwareBufferUsageANDROID(
+                featureBits, rootType,
+                reinterpret_cast<const VkAndroidHardwareBufferUsageANDROID*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID: {
+            count_VkAndroidHardwareBufferFormatPropertiesANDROID(
+                featureBits, rootType,
+                reinterpret_cast<const VkAndroidHardwareBufferFormatPropertiesANDROID*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID: {
+            count_VkImportAndroidHardwareBufferInfoANDROID(
+                featureBits, rootType,
+                reinterpret_cast<const VkImportAndroidHardwareBufferInfoANDROID*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID: {
+            count_VkExternalFormatANDROID(
+                featureBits, rootType,
+                reinterpret_cast<const VkExternalFormatANDROID*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID: {
+            count_VkAndroidHardwareBufferFormatProperties2ANDROID(
+                featureBits, rootType,
+                reinterpret_cast<const VkAndroidHardwareBufferFormatProperties2ANDROID*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_inline_uniform_block
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT: {
+            count_VkPhysicalDeviceInlineUniformBlockFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceInlineUniformBlockFeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT: {
+            count_VkPhysicalDeviceInlineUniformBlockPropertiesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceInlineUniformBlockPropertiesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT: {
+            count_VkWriteDescriptorSetInlineUniformBlockEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkWriteDescriptorSetInlineUniformBlockEXT*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO_EXT: {
+            count_VkDescriptorPoolInlineUniformBlockCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkDescriptorPoolInlineUniformBlockCreateInfoEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_sample_locations
+        case VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT: {
+            count_VkSampleLocationsInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkSampleLocationsInfoEXT*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT: {
+            count_VkRenderPassSampleLocationsBeginInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkRenderPassSampleLocationsBeginInfoEXT*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT: {
+            count_VkPipelineSampleLocationsStateCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPipelineSampleLocationsStateCreateInfoEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT: {
+            count_VkPhysicalDeviceSampleLocationsPropertiesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSampleLocationsPropertiesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_blend_operation_advanced
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT: {
+            count_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT: {
+            count_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT: {
+            count_VkPipelineColorBlendAdvancedStateCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPipelineColorBlendAdvancedStateCreateInfoEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_NV_fragment_coverage_to_color
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV: {
+            count_VkPipelineCoverageToColorStateCreateInfoNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPipelineCoverageToColorStateCreateInfoNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_NV_framebuffer_mixed_samples
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV: {
+            count_VkPipelineCoverageModulationStateCreateInfoNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPipelineCoverageModulationStateCreateInfoNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_NV_shader_sm_builtins
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV: {
+            count_VkPhysicalDeviceShaderSMBuiltinsPropertiesNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderSMBuiltinsPropertiesNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV: {
+            count_VkPhysicalDeviceShaderSMBuiltinsFeaturesNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderSMBuiltinsFeaturesNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+        case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT: {
+            count_VkDrmFormatModifierPropertiesListEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkDrmFormatModifierPropertiesListEXT*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT: {
+            count_VkPhysicalDeviceImageDrmFormatModifierInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceImageDrmFormatModifierInfoEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT: {
+            count_VkImageDrmFormatModifierListCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkImageDrmFormatModifierListCreateInfoEXT*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT: {
+            count_VkImageDrmFormatModifierExplicitCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkImageDrmFormatModifierExplicitCreateInfoEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT: {
+            count_VkDrmFormatModifierPropertiesList2EXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkDrmFormatModifierPropertiesList2EXT*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_validation_cache
+        case VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT: {
+            count_VkShaderModuleValidationCacheCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkShaderModuleValidationCacheCreateInfoEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_NV_shading_rate_image
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV: {
+            count_VkPipelineViewportShadingRateImageStateCreateInfoNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPipelineViewportShadingRateImageStateCreateInfoNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV: {
+            count_VkPhysicalDeviceShadingRateImageFeaturesNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShadingRateImageFeaturesNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV: {
+            count_VkPhysicalDeviceShadingRateImagePropertiesNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShadingRateImagePropertiesNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV: {
+            count_VkPipelineViewportCoarseSampleOrderStateCreateInfoNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPipelineViewportCoarseSampleOrderStateCreateInfoNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_NV_ray_tracing
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV: {
+            count_VkWriteDescriptorSetAccelerationStructureNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkWriteDescriptorSetAccelerationStructureNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV: {
+            count_VkPhysicalDeviceRayTracingPropertiesNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRayTracingPropertiesNV*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_NV_representative_fragment_test
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV: {
+            count_VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV: {
+            count_VkPipelineRepresentativeFragmentTestStateCreateInfoNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPipelineRepresentativeFragmentTestStateCreateInfoNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_filter_cubic
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT: {
+            count_VkPhysicalDeviceImageViewImageFormatInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceImageViewImageFormatInfoEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT: {
+            count_VkFilterCubicImageViewImageFormatPropertiesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkFilterCubicImageViewImageFormatPropertiesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_global_priority
+        case VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT: {
+            count_VkDeviceQueueGlobalPriorityCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkDeviceQueueGlobalPriorityCreateInfoEXT*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_external_memory_host
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT: {
+            count_VkImportMemoryHostPointerInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkImportMemoryHostPointerInfoEXT*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT: {
+            count_VkPhysicalDeviceExternalMemoryHostPropertiesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceExternalMemoryHostPropertiesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_AMD_pipeline_compiler_control
+        case VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD: {
+            count_VkPipelineCompilerControlCreateInfoAMD(
+                featureBits, rootType,
+                reinterpret_cast<const VkPipelineCompilerControlCreateInfoAMD*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_AMD_shader_core_properties
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD: {
+            count_VkPhysicalDeviceShaderCorePropertiesAMD(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderCorePropertiesAMD*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_decode_h265
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_EXT: {
+            count_VkVideoDecodeH265ProfileEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoDecodeH265ProfileEXT*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_EXT: {
+            count_VkVideoDecodeH265CapabilitiesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoDecodeH265CapabilitiesEXT*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_CREATE_INFO_EXT: {
+            count_VkVideoDecodeH265SessionCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoDecodeH265SessionCreateInfoEXT*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            count_VkVideoDecodeH265SessionParametersAddInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoDecodeH265SessionParametersAddInfoEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            count_VkVideoDecodeH265SessionParametersCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoDecodeH265SessionParametersCreateInfoEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PICTURE_INFO_EXT: {
+            count_VkVideoDecodeH265PictureInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoDecodeH265PictureInfoEXT*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_EXT: {
+            count_VkVideoDecodeH265DpbSlotInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkVideoDecodeH265DpbSlotInfoEXT*>(structExtension), count);
+            break;
+        }
+#endif
+#ifdef VK_AMD_memory_overallocation_behavior
+        case VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD: {
+            count_VkDeviceMemoryOverallocationCreateInfoAMD(
+                featureBits, rootType,
+                reinterpret_cast<const VkDeviceMemoryOverallocationCreateInfoAMD*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_vertex_attribute_divisor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT: {
+            count_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT: {
+            count_VkPipelineVertexInputDivisorStateCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPipelineVertexInputDivisorStateCreateInfoEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT: {
+            count_VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_GGP_frame_token
+        case VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP: {
+            count_VkPresentFrameTokenGGP(
+                featureBits, rootType,
+                reinterpret_cast<const VkPresentFrameTokenGGP*>(structExtension), count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_pipeline_creation_feedback
+        case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT: {
+            count_VkPipelineCreationFeedbackCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPipelineCreationFeedbackCreateInfoEXT*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_NV_compute_shader_derivatives
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV: {
+            count_VkPhysicalDeviceComputeShaderDerivativesFeaturesNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceComputeShaderDerivativesFeaturesNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_NV_mesh_shader
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV: {
+            count_VkPhysicalDeviceMeshShaderFeaturesNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMeshShaderFeaturesNV*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV: {
+            count_VkPhysicalDeviceMeshShaderPropertiesNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMeshShaderPropertiesNV*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_NV_fragment_shader_barycentric
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV: {
+            count_VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_NV_shader_image_footprint
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV: {
+            count_VkPhysicalDeviceShaderImageFootprintFeaturesNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderImageFootprintFeaturesNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_NV_scissor_exclusive
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV: {
+            count_VkPipelineViewportExclusiveScissorStateCreateInfoNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPipelineViewportExclusiveScissorStateCreateInfoNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV: {
+            count_VkPhysicalDeviceExclusiveScissorFeaturesNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceExclusiveScissorFeaturesNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV: {
+            count_VkQueueFamilyCheckpointPropertiesNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkQueueFamilyCheckpointPropertiesNV*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_INTEL_shader_integer_functions2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL: {
+            count_VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_INTEL_performance_query
+        case VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL: {
+            count_VkQueryPoolPerformanceQueryCreateInfoINTEL(
+                featureBits, rootType,
+                reinterpret_cast<const VkQueryPoolPerformanceQueryCreateInfoINTEL*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_pci_bus_info
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT: {
+            count_VkPhysicalDevicePCIBusInfoPropertiesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDevicePCIBusInfoPropertiesEXT*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_AMD_display_native_hdr
+        case VK_STRUCTURE_TYPE_DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD: {
+            count_VkDisplayNativeHdrSurfaceCapabilitiesAMD(
+                featureBits, rootType,
+                reinterpret_cast<const VkDisplayNativeHdrSurfaceCapabilitiesAMD*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD: {
+            count_VkSwapchainDisplayNativeHdrCreateInfoAMD(
+                featureBits, rootType,
+                reinterpret_cast<const VkSwapchainDisplayNativeHdrCreateInfoAMD*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_fragment_density_map
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT: {
+            switch (rootType) {
+                case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: {
+                    count_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+                        featureBits, rootType,
+                        reinterpret_cast<const VkPhysicalDeviceFragmentDensityMapFeaturesEXT*>(
+                            structExtension),
+                        count);
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO: {
+                    count_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+                        featureBits, rootType,
+                        reinterpret_cast<const VkPhysicalDeviceFragmentDensityMapFeaturesEXT*>(
+                            structExtension),
+                        count);
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO: {
+                    count_VkImportColorBufferGOOGLE(
+                        featureBits, rootType,
+                        reinterpret_cast<const VkImportColorBufferGOOGLE*>(structExtension), count);
+                    break;
+                }
+                default: {
+                    count_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+                        featureBits, rootType,
+                        reinterpret_cast<const VkPhysicalDeviceFragmentDensityMapFeaturesEXT*>(
+                            structExtension),
+                        count);
+                    break;
+                }
+            }
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT: {
+            switch (rootType) {
+                case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2: {
+                    count_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
+                        featureBits, rootType,
+                        reinterpret_cast<const VkPhysicalDeviceFragmentDensityMapPropertiesEXT*>(
+                            structExtension),
+                        count);
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO: {
+                    count_VkCreateBlobGOOGLE(
+                        featureBits, rootType,
+                        reinterpret_cast<const VkCreateBlobGOOGLE*>(structExtension), count);
+                    break;
+                }
+                default: {
+                    count_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
+                        featureBits, rootType,
+                        reinterpret_cast<const VkPhysicalDeviceFragmentDensityMapPropertiesEXT*>(
+                            structExtension),
+                        count);
+                    break;
+                }
+            }
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT: {
+            switch (rootType) {
+                case VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO: {
+                    count_VkRenderPassFragmentDensityMapCreateInfoEXT(
+                        featureBits, rootType,
+                        reinterpret_cast<const VkRenderPassFragmentDensityMapCreateInfoEXT*>(
+                            structExtension),
+                        count);
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2: {
+                    count_VkRenderPassFragmentDensityMapCreateInfoEXT(
+                        featureBits, rootType,
+                        reinterpret_cast<const VkRenderPassFragmentDensityMapCreateInfoEXT*>(
+                            structExtension),
+                        count);
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO: {
+                    count_VkImportBufferGOOGLE(
+                        featureBits, rootType,
+                        reinterpret_cast<const VkImportBufferGOOGLE*>(structExtension), count);
+                    break;
+                }
+                default: {
+                    count_VkRenderPassFragmentDensityMapCreateInfoEXT(
+                        featureBits, rootType,
+                        reinterpret_cast<const VkRenderPassFragmentDensityMapCreateInfoEXT*>(
+                            structExtension),
+                        count);
+                    break;
+                }
+            }
+            break;
+        }
+#endif
+#ifdef VK_EXT_subgroup_size_control
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT: {
+            count_VkPhysicalDeviceSubgroupSizeControlFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSubgroupSizeControlFeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT: {
+            count_VkPhysicalDeviceSubgroupSizeControlPropertiesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSubgroupSizeControlPropertiesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT: {
+            count_VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_AMD_shader_core_properties2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD: {
+            count_VkPhysicalDeviceShaderCoreProperties2AMD(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderCoreProperties2AMD*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_AMD_device_coherent_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD: {
+            count_VkPhysicalDeviceCoherentMemoryFeaturesAMD(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceCoherentMemoryFeaturesAMD*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_image_atomic_int64
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT: {
+            count_VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_memory_budget
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT: {
+            count_VkPhysicalDeviceMemoryBudgetPropertiesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMemoryBudgetPropertiesEXT*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_memory_priority
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT: {
+            count_VkPhysicalDeviceMemoryPriorityFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMemoryPriorityFeaturesEXT*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT: {
+            count_VkMemoryPriorityAllocateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkMemoryPriorityAllocateInfoEXT*>(structExtension), count);
+            break;
+        }
+#endif
+#ifdef VK_NV_dedicated_allocation_image_aliasing
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV: {
+            count_VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_buffer_device_address
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT: {
+            count_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT: {
+            count_VkBufferDeviceAddressCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkBufferDeviceAddressCreateInfoEXT*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_validation_features
+        case VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT: {
+            count_VkValidationFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkValidationFeaturesEXT*>(structExtension), count);
+            break;
+        }
+#endif
+#ifdef VK_NV_cooperative_matrix
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV: {
+            count_VkPhysicalDeviceCooperativeMatrixFeaturesNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceCooperativeMatrixFeaturesNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV: {
+            count_VkPhysicalDeviceCooperativeMatrixPropertiesNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceCooperativeMatrixPropertiesNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV: {
+            count_VkPhysicalDeviceCoverageReductionModeFeaturesNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceCoverageReductionModeFeaturesNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV: {
+            count_VkPipelineCoverageReductionStateCreateInfoNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPipelineCoverageReductionStateCreateInfoNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_fragment_shader_interlock
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT: {
+            count_VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_ycbcr_image_arrays
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT: {
+            count_VkPhysicalDeviceYcbcrImageArraysFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_provoking_vertex
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: {
+            count_VkPhysicalDeviceProvokingVertexFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceProvokingVertexFeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT: {
+            count_VkPhysicalDeviceProvokingVertexPropertiesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceProvokingVertexPropertiesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT: {
+            count_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+        case VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT: {
+            count_VkSurfaceFullScreenExclusiveInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkSurfaceFullScreenExclusiveInfoEXT*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT: {
+            count_VkSurfaceCapabilitiesFullScreenExclusiveEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkSurfaceCapabilitiesFullScreenExclusiveEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT: {
+            count_VkSurfaceFullScreenExclusiveWin32InfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkSurfaceFullScreenExclusiveWin32InfoEXT*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_line_rasterization
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT: {
+            count_VkPhysicalDeviceLineRasterizationFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceLineRasterizationFeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT: {
+            count_VkPhysicalDeviceLineRasterizationPropertiesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceLineRasterizationPropertiesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT: {
+            count_VkPipelineRasterizationLineStateCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPipelineRasterizationLineStateCreateInfoEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_atomic_float
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT: {
+            count_VkPhysicalDeviceShaderAtomicFloatFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_index_type_uint8
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT: {
+            count_VkPhysicalDeviceIndexTypeUint8FeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceIndexTypeUint8FeaturesEXT*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT: {
+            count_VkPhysicalDeviceExtendedDynamicStateFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_atomic_float2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT: {
+            count_VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_demote_to_helper_invocation
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT: {
+            count_VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_NV_device_generated_commands
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV: {
+            count_VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV: {
+            count_VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV: {
+            count_VkGraphicsPipelineShaderGroupsCreateInfoNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkGraphicsPipelineShaderGroupsCreateInfoNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_NV_inherited_viewport_scissor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV: {
+            count_VkPhysicalDeviceInheritedViewportScissorFeaturesNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceInheritedViewportScissorFeaturesNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV: {
+            count_VkCommandBufferInheritanceViewportScissorInfoNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkCommandBufferInheritanceViewportScissorInfoNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_texel_buffer_alignment
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT: {
+            count_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT: {
+            count_VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_QCOM_render_pass_transform
+        case VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM: {
+            count_VkRenderPassTransformBeginInfoQCOM(
+                featureBits, rootType,
+                reinterpret_cast<const VkRenderPassTransformBeginInfoQCOM*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM: {
+            count_VkCommandBufferInheritanceRenderPassTransformInfoQCOM(
+                featureBits, rootType,
+                reinterpret_cast<const VkCommandBufferInheritanceRenderPassTransformInfoQCOM*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_device_memory_report
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT: {
+            count_VkPhysicalDeviceDeviceMemoryReportFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDeviceMemoryReportFeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT: {
+            count_VkDeviceDeviceMemoryReportCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkDeviceDeviceMemoryReportCreateInfoEXT*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_robustness2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT: {
+            count_VkPhysicalDeviceRobustness2FeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRobustness2FeaturesEXT*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT: {
+            count_VkPhysicalDeviceRobustness2PropertiesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRobustness2PropertiesEXT*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_custom_border_color
+        case VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT: {
+            count_VkSamplerCustomBorderColorCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkSamplerCustomBorderColorCreateInfoEXT*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT: {
+            count_VkPhysicalDeviceCustomBorderColorPropertiesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceCustomBorderColorPropertiesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT: {
+            count_VkPhysicalDeviceCustomBorderColorFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceCustomBorderColorFeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_private_data
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT: {
+            count_VkPhysicalDevicePrivateDataFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDevicePrivateDataFeaturesEXT*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO_EXT: {
+            count_VkDevicePrivateDataCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkDevicePrivateDataCreateInfoEXT*>(structExtension), count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_pipeline_creation_cache_control
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES_EXT: {
+            count_VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_NV_device_diagnostics_config
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV: {
+            count_VkPhysicalDeviceDiagnosticsConfigFeaturesNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDiagnosticsConfigFeaturesNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV: {
+            count_VkDeviceDiagnosticsConfigCreateInfoNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkDeviceDiagnosticsConfigCreateInfoNV*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV: {
+            count_VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV: {
+            count_VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV: {
+            count_VkPipelineFragmentShadingRateEnumStateCreateInfoNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPipelineFragmentShadingRateEnumStateCreateInfoNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_NV_ray_tracing_motion_blur
+        case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV: {
+            count_VkAccelerationStructureGeometryMotionTrianglesDataNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkAccelerationStructureGeometryMotionTrianglesDataNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV: {
+            count_VkAccelerationStructureMotionInfoNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkAccelerationStructureMotionInfoNV*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV: {
+            count_VkPhysicalDeviceRayTracingMotionBlurFeaturesNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRayTracingMotionBlurFeaturesNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_ycbcr_2plane_444_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT: {
+            count_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_fragment_density_map2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT: {
+            count_VkPhysicalDeviceFragmentDensityMap2FeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT: {
+            count_VkPhysicalDeviceFragmentDensityMap2PropertiesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentDensityMap2PropertiesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_QCOM_rotated_copy_commands
+        case VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM: {
+            count_VkCopyCommandTransformInfoQCOM(
+                featureBits, rootType,
+                reinterpret_cast<const VkCopyCommandTransformInfoQCOM*>(structExtension), count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_image_robustness
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES_EXT: {
+            count_VkPhysicalDeviceImageRobustnessFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceImageRobustnessFeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_4444_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT: {
+            count_VkPhysicalDevice4444FormatsFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDevice4444FormatsFeaturesEXT*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_rgba10x6_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT: {
+            count_VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_VALVE_mutable_descriptor_type
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE: {
+            count_VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE: {
+            count_VkMutableDescriptorTypeCreateInfoVALVE(
+                featureBits, rootType,
+                reinterpret_cast<const VkMutableDescriptorTypeCreateInfoVALVE*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT: {
+            count_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_physical_device_drm
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT: {
+            count_VkPhysicalDeviceDrmPropertiesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDrmPropertiesEXT*>(structExtension), count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_primitive_topology_list_restart
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT: {
+            count_VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_FUCHSIA_external_memory
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA: {
+            count_VkImportMemoryZirconHandleInfoFUCHSIA(
+                featureBits, rootType,
+                reinterpret_cast<const VkImportMemoryZirconHandleInfoFUCHSIA*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA: {
+            count_VkImportMemoryBufferCollectionFUCHSIA(
+                featureBits, rootType,
+                reinterpret_cast<const VkImportMemoryBufferCollectionFUCHSIA*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA: {
+            count_VkBufferCollectionImageCreateInfoFUCHSIA(
+                featureBits, rootType,
+                reinterpret_cast<const VkBufferCollectionImageCreateInfoFUCHSIA*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA: {
+            count_VkBufferCollectionBufferCreateInfoFUCHSIA(
+                featureBits, rootType,
+                reinterpret_cast<const VkBufferCollectionBufferCreateInfoFUCHSIA*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+        case VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI: {
+            count_VkSubpassShadingPipelineCreateInfoHUAWEI(
+                featureBits, rootType,
+                reinterpret_cast<const VkSubpassShadingPipelineCreateInfoHUAWEI*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI: {
+            count_VkPhysicalDeviceSubpassShadingFeaturesHUAWEI(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSubpassShadingFeaturesHUAWEI*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI: {
+            count_VkPhysicalDeviceSubpassShadingPropertiesHUAWEI(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSubpassShadingPropertiesHUAWEI*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI: {
+            count_VkPhysicalDeviceInvocationMaskFeaturesHUAWEI(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceInvocationMaskFeaturesHUAWEI*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_NV_external_memory_rdma
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_RDMA_FEATURES_NV: {
+            count_VkPhysicalDeviceExternalMemoryRDMAFeaturesNV(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceExternalMemoryRDMAFeaturesNV*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT: {
+            count_VkPhysicalDeviceExtendedDynamicState2FeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_color_write_enable
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT: {
+            count_VkPhysicalDeviceColorWriteEnableFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceColorWriteEnableFeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT: {
+            count_VkPipelineColorWriteCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPipelineColorWriteCreateInfoEXT*>(structExtension), count);
+            break;
+        }
+#endif
+#ifdef VK_GOOGLE_gfxstream
+        case VK_STRUCTURE_TYPE_IMPORT_COLOR_BUFFER_GOOGLE: {
+            count_VkImportColorBufferGOOGLE(
+                featureBits, rootType,
+                reinterpret_cast<const VkImportColorBufferGOOGLE*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMPORT_BUFFER_GOOGLE: {
+            count_VkImportBufferGOOGLE(
+                featureBits, rootType,
+                reinterpret_cast<const VkImportBufferGOOGLE*>(structExtension), count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_CREATE_BLOB_GOOGLE: {
+            count_VkCreateBlobGOOGLE(featureBits, rootType,
+                                     reinterpret_cast<const VkCreateBlobGOOGLE*>(structExtension),
+                                     count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_global_priority_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_EXT: {
+            count_VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_EXT: {
+            count_VkQueueFamilyGlobalPriorityPropertiesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkQueueFamilyGlobalPriorityPropertiesEXT*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_multi_draw
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT: {
+            count_VkPhysicalDeviceMultiDrawFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMultiDrawFeaturesEXT*>(structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT: {
+            count_VkPhysicalDeviceMultiDrawPropertiesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMultiDrawPropertiesEXT*>(structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_border_color_swizzle
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT: {
+            count_VkPhysicalDeviceBorderColorSwizzleFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT: {
+            count_VkSamplerBorderColorComponentMappingCreateInfoEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkSamplerBorderColorComponentMappingCreateInfoEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT: {
+            count_VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_acceleration_structure
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR: {
+            count_VkWriteDescriptorSetAccelerationStructureKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkWriteDescriptorSetAccelerationStructureKHR*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR: {
+            count_VkPhysicalDeviceAccelerationStructureFeaturesKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceAccelerationStructureFeaturesKHR*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR: {
+            count_VkPhysicalDeviceAccelerationStructurePropertiesKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceAccelerationStructurePropertiesKHR*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR: {
+            count_VkPhysicalDeviceRayTracingPipelineFeaturesKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRayTracingPipelineFeaturesKHR*>(
+                    structExtension),
+                count);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR: {
+            count_VkPhysicalDeviceRayTracingPipelinePropertiesKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRayTracingPipelinePropertiesKHR*>(
+                    structExtension),
+                count);
+            break;
+        }
+#endif
+#ifdef VK_KHR_ray_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR: {
+            count_VkPhysicalDeviceRayQueryFeaturesKHR(
+                featureBits, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRayQueryFeaturesKHR*>(structExtension),
+                count);
+            break;
+        }
+#endif
+        default: {
+            // fatal; the switch is only taken if the extension struct is known
+            abort();
+        }
+    }
+}
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/goldfish_vk_counting_guest.h b/system/vulkan_enc/goldfish_vk_counting_guest.h
new file mode 100644
index 0000000..56cba64
--- /dev/null
+++ b/system/vulkan_enc/goldfish_vk_counting_guest.h
@@ -0,0 +1,3579 @@
+// Copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2018 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Autogenerated module goldfish_vk_counting_guest
+//
+// (header) generated by codegen/vulkan/scripts/genvk.py -registry codegen/vulkan/xml/vk.xml cereal
+// -o host/vulkan/cereal
+//
+// Please do not modify directly;
+// re-run gfxstream-protocols/scripts/generate-vulkan-sources.sh,
+// or directly from Python by defining:
+// VULKAN_REGISTRY_XML_DIR : Directory containing vk.xml
+// VULKAN_REGISTRY_SCRIPTS_DIR : Directory containing genvk.py
+// CEREAL_OUTPUT_DIR: Where to put the generated sources.
+//
+// python3 $VULKAN_REGISTRY_SCRIPTS_DIR/genvk.py -registry $VULKAN_REGISTRY_XML_DIR/vk.xml cereal -o
+// $CEREAL_OUTPUT_DIR
+//
+#pragma once
+#include <vulkan/vulkan.h>
+
+#include "goldfish_vk_private_defs.h"
+#include "vk_platform_compat.h"
+#include "vulkan_gfxstream.h"
+
+namespace gfxstream {
+namespace vk {
+
+#ifdef VK_VERSION_1_0
+void count_VkExtent2D(uint32_t featureBits, VkStructureType rootType, const VkExtent2D* toCount,
+                      size_t* count);
+
+void count_VkExtent3D(uint32_t featureBits, VkStructureType rootType, const VkExtent3D* toCount,
+                      size_t* count);
+
+void count_VkOffset2D(uint32_t featureBits, VkStructureType rootType, const VkOffset2D* toCount,
+                      size_t* count);
+
+void count_VkOffset3D(uint32_t featureBits, VkStructureType rootType, const VkOffset3D* toCount,
+                      size_t* count);
+
+void count_VkRect2D(uint32_t featureBits, VkStructureType rootType, const VkRect2D* toCount,
+                    size_t* count);
+
+void count_VkBaseInStructure(uint32_t featureBits, VkStructureType rootType,
+                             const VkBaseInStructure* toCount, size_t* count);
+
+void count_VkBaseOutStructure(uint32_t featureBits, VkStructureType rootType,
+                              const VkBaseOutStructure* toCount, size_t* count);
+
+void count_VkBufferMemoryBarrier(uint32_t featureBits, VkStructureType rootType,
+                                 const VkBufferMemoryBarrier* toCount, size_t* count);
+
+void count_VkDispatchIndirectCommand(uint32_t featureBits, VkStructureType rootType,
+                                     const VkDispatchIndirectCommand* toCount, size_t* count);
+
+void count_VkDrawIndexedIndirectCommand(uint32_t featureBits, VkStructureType rootType,
+                                        const VkDrawIndexedIndirectCommand* toCount, size_t* count);
+
+void count_VkDrawIndirectCommand(uint32_t featureBits, VkStructureType rootType,
+                                 const VkDrawIndirectCommand* toCount, size_t* count);
+
+void count_VkImageSubresourceRange(uint32_t featureBits, VkStructureType rootType,
+                                   const VkImageSubresourceRange* toCount, size_t* count);
+
+void count_VkImageMemoryBarrier(uint32_t featureBits, VkStructureType rootType,
+                                const VkImageMemoryBarrier* toCount, size_t* count);
+
+void count_VkMemoryBarrier(uint32_t featureBits, VkStructureType rootType,
+                           const VkMemoryBarrier* toCount, size_t* count);
+
+void count_VkPipelineCacheHeaderVersionOne(uint32_t featureBits, VkStructureType rootType,
+                                           const VkPipelineCacheHeaderVersionOne* toCount,
+                                           size_t* count);
+
+void count_VkAllocationCallbacks(uint32_t featureBits, VkStructureType rootType,
+                                 const VkAllocationCallbacks* toCount, size_t* count);
+
+void count_VkApplicationInfo(uint32_t featureBits, VkStructureType rootType,
+                             const VkApplicationInfo* toCount, size_t* count);
+
+void count_VkFormatProperties(uint32_t featureBits, VkStructureType rootType,
+                              const VkFormatProperties* toCount, size_t* count);
+
+void count_VkImageFormatProperties(uint32_t featureBits, VkStructureType rootType,
+                                   const VkImageFormatProperties* toCount, size_t* count);
+
+void count_VkInstanceCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                const VkInstanceCreateInfo* toCount, size_t* count);
+
+void count_VkMemoryHeap(uint32_t featureBits, VkStructureType rootType, const VkMemoryHeap* toCount,
+                        size_t* count);
+
+void count_VkMemoryType(uint32_t featureBits, VkStructureType rootType, const VkMemoryType* toCount,
+                        size_t* count);
+
+void count_VkPhysicalDeviceFeatures(uint32_t featureBits, VkStructureType rootType,
+                                    const VkPhysicalDeviceFeatures* toCount, size_t* count);
+
+void count_VkPhysicalDeviceLimits(uint32_t featureBits, VkStructureType rootType,
+                                  const VkPhysicalDeviceLimits* toCount, size_t* count);
+
+void count_VkPhysicalDeviceMemoryProperties(uint32_t featureBits, VkStructureType rootType,
+                                            const VkPhysicalDeviceMemoryProperties* toCount,
+                                            size_t* count);
+
+void count_VkPhysicalDeviceSparseProperties(uint32_t featureBits, VkStructureType rootType,
+                                            const VkPhysicalDeviceSparseProperties* toCount,
+                                            size_t* count);
+
+void count_VkPhysicalDeviceProperties(uint32_t featureBits, VkStructureType rootType,
+                                      const VkPhysicalDeviceProperties* toCount, size_t* count);
+
+void count_VkQueueFamilyProperties(uint32_t featureBits, VkStructureType rootType,
+                                   const VkQueueFamilyProperties* toCount, size_t* count);
+
+void count_VkDeviceQueueCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                   const VkDeviceQueueCreateInfo* toCount, size_t* count);
+
+void count_VkDeviceCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                              const VkDeviceCreateInfo* toCount, size_t* count);
+
+void count_VkExtensionProperties(uint32_t featureBits, VkStructureType rootType,
+                                 const VkExtensionProperties* toCount, size_t* count);
+
+void count_VkLayerProperties(uint32_t featureBits, VkStructureType rootType,
+                             const VkLayerProperties* toCount, size_t* count);
+
+void count_VkSubmitInfo(uint32_t featureBits, VkStructureType rootType, const VkSubmitInfo* toCount,
+                        size_t* count);
+
+void count_VkMappedMemoryRange(uint32_t featureBits, VkStructureType rootType,
+                               const VkMappedMemoryRange* toCount, size_t* count);
+
+void count_VkMemoryAllocateInfo(uint32_t featureBits, VkStructureType rootType,
+                                const VkMemoryAllocateInfo* toCount, size_t* count);
+
+void count_VkMemoryRequirements(uint32_t featureBits, VkStructureType rootType,
+                                const VkMemoryRequirements* toCount, size_t* count);
+
+void count_VkSparseMemoryBind(uint32_t featureBits, VkStructureType rootType,
+                              const VkSparseMemoryBind* toCount, size_t* count);
+
+void count_VkSparseBufferMemoryBindInfo(uint32_t featureBits, VkStructureType rootType,
+                                        const VkSparseBufferMemoryBindInfo* toCount, size_t* count);
+
+void count_VkSparseImageOpaqueMemoryBindInfo(uint32_t featureBits, VkStructureType rootType,
+                                             const VkSparseImageOpaqueMemoryBindInfo* toCount,
+                                             size_t* count);
+
+void count_VkImageSubresource(uint32_t featureBits, VkStructureType rootType,
+                              const VkImageSubresource* toCount, size_t* count);
+
+void count_VkSparseImageMemoryBind(uint32_t featureBits, VkStructureType rootType,
+                                   const VkSparseImageMemoryBind* toCount, size_t* count);
+
+void count_VkSparseImageMemoryBindInfo(uint32_t featureBits, VkStructureType rootType,
+                                       const VkSparseImageMemoryBindInfo* toCount, size_t* count);
+
+void count_VkBindSparseInfo(uint32_t featureBits, VkStructureType rootType,
+                            const VkBindSparseInfo* toCount, size_t* count);
+
+void count_VkSparseImageFormatProperties(uint32_t featureBits, VkStructureType rootType,
+                                         const VkSparseImageFormatProperties* toCount,
+                                         size_t* count);
+
+void count_VkSparseImageMemoryRequirements(uint32_t featureBits, VkStructureType rootType,
+                                           const VkSparseImageMemoryRequirements* toCount,
+                                           size_t* count);
+
+void count_VkFenceCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                             const VkFenceCreateInfo* toCount, size_t* count);
+
+void count_VkSemaphoreCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                 const VkSemaphoreCreateInfo* toCount, size_t* count);
+
+void count_VkEventCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                             const VkEventCreateInfo* toCount, size_t* count);
+
+void count_VkQueryPoolCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                 const VkQueryPoolCreateInfo* toCount, size_t* count);
+
+void count_VkBufferCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                              const VkBufferCreateInfo* toCount, size_t* count);
+
+void count_VkBufferViewCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                  const VkBufferViewCreateInfo* toCount, size_t* count);
+
+void count_VkImageCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                             const VkImageCreateInfo* toCount, size_t* count);
+
+void count_VkSubresourceLayout(uint32_t featureBits, VkStructureType rootType,
+                               const VkSubresourceLayout* toCount, size_t* count);
+
+void count_VkComponentMapping(uint32_t featureBits, VkStructureType rootType,
+                              const VkComponentMapping* toCount, size_t* count);
+
+void count_VkImageViewCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                 const VkImageViewCreateInfo* toCount, size_t* count);
+
+void count_VkShaderModuleCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                    const VkShaderModuleCreateInfo* toCount, size_t* count);
+
+void count_VkPipelineCacheCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                     const VkPipelineCacheCreateInfo* toCount, size_t* count);
+
+void count_VkSpecializationMapEntry(uint32_t featureBits, VkStructureType rootType,
+                                    const VkSpecializationMapEntry* toCount, size_t* count);
+
+void count_VkSpecializationInfo(uint32_t featureBits, VkStructureType rootType,
+                                const VkSpecializationInfo* toCount, size_t* count);
+
+void count_VkPipelineShaderStageCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                           const VkPipelineShaderStageCreateInfo* toCount,
+                                           size_t* count);
+
+void count_VkComputePipelineCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                       const VkComputePipelineCreateInfo* toCount, size_t* count);
+
+void count_VkVertexInputBindingDescription(uint32_t featureBits, VkStructureType rootType,
+                                           const VkVertexInputBindingDescription* toCount,
+                                           size_t* count);
+
+void count_VkVertexInputAttributeDescription(uint32_t featureBits, VkStructureType rootType,
+                                             const VkVertexInputAttributeDescription* toCount,
+                                             size_t* count);
+
+void count_VkPipelineVertexInputStateCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                                const VkPipelineVertexInputStateCreateInfo* toCount,
+                                                size_t* count);
+
+void count_VkPipelineInputAssemblyStateCreateInfo(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineInputAssemblyStateCreateInfo* toCount, size_t* count);
+
+void count_VkPipelineTessellationStateCreateInfo(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineTessellationStateCreateInfo* toCount, size_t* count);
+
+void count_VkViewport(uint32_t featureBits, VkStructureType rootType, const VkViewport* toCount,
+                      size_t* count);
+
+void count_VkPipelineViewportStateCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                             const VkPipelineViewportStateCreateInfo* toCount,
+                                             size_t* count);
+
+void count_VkPipelineRasterizationStateCreateInfo(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineRasterizationStateCreateInfo* toCount, size_t* count);
+
+void count_VkPipelineMultisampleStateCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                                const VkPipelineMultisampleStateCreateInfo* toCount,
+                                                size_t* count);
+
+void count_VkStencilOpState(uint32_t featureBits, VkStructureType rootType,
+                            const VkStencilOpState* toCount, size_t* count);
+
+void count_VkPipelineDepthStencilStateCreateInfo(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineDepthStencilStateCreateInfo* toCount, size_t* count);
+
+void count_VkPipelineColorBlendAttachmentState(uint32_t featureBits, VkStructureType rootType,
+                                               const VkPipelineColorBlendAttachmentState* toCount,
+                                               size_t* count);
+
+void count_VkPipelineColorBlendStateCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                               const VkPipelineColorBlendStateCreateInfo* toCount,
+                                               size_t* count);
+
+void count_VkPipelineDynamicStateCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                            const VkPipelineDynamicStateCreateInfo* toCount,
+                                            size_t* count);
+
+void count_VkGraphicsPipelineCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                        const VkGraphicsPipelineCreateInfo* toCount, size_t* count);
+
+void count_VkPushConstantRange(uint32_t featureBits, VkStructureType rootType,
+                               const VkPushConstantRange* toCount, size_t* count);
+
+void count_VkPipelineLayoutCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                      const VkPipelineLayoutCreateInfo* toCount, size_t* count);
+
+void count_VkSamplerCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                               const VkSamplerCreateInfo* toCount, size_t* count);
+
+void count_VkCopyDescriptorSet(uint32_t featureBits, VkStructureType rootType,
+                               const VkCopyDescriptorSet* toCount, size_t* count);
+
+void count_VkDescriptorBufferInfo(uint32_t featureBits, VkStructureType rootType,
+                                  const VkDescriptorBufferInfo* toCount, size_t* count);
+
+void count_VkDescriptorImageInfo(uint32_t featureBits, VkStructureType rootType,
+                                 const VkDescriptorImageInfo* toCount, size_t* count);
+
+void count_VkDescriptorPoolSize(uint32_t featureBits, VkStructureType rootType,
+                                const VkDescriptorPoolSize* toCount, size_t* count);
+
+void count_VkDescriptorPoolCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                      const VkDescriptorPoolCreateInfo* toCount, size_t* count);
+
+void count_VkDescriptorSetAllocateInfo(uint32_t featureBits, VkStructureType rootType,
+                                       const VkDescriptorSetAllocateInfo* toCount, size_t* count);
+
+void count_VkDescriptorSetLayoutBinding(uint32_t featureBits, VkStructureType rootType,
+                                        const VkDescriptorSetLayoutBinding* toCount, size_t* count);
+
+void count_VkDescriptorSetLayoutCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                           const VkDescriptorSetLayoutCreateInfo* toCount,
+                                           size_t* count);
+
+void count_VkWriteDescriptorSet(uint32_t featureBits, VkStructureType rootType,
+                                const VkWriteDescriptorSet* toCount, size_t* count);
+
+void count_VkAttachmentDescription(uint32_t featureBits, VkStructureType rootType,
+                                   const VkAttachmentDescription* toCount, size_t* count);
+
+void count_VkAttachmentReference(uint32_t featureBits, VkStructureType rootType,
+                                 const VkAttachmentReference* toCount, size_t* count);
+
+void count_VkFramebufferCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                   const VkFramebufferCreateInfo* toCount, size_t* count);
+
+void count_VkSubpassDescription(uint32_t featureBits, VkStructureType rootType,
+                                const VkSubpassDescription* toCount, size_t* count);
+
+void count_VkSubpassDependency(uint32_t featureBits, VkStructureType rootType,
+                               const VkSubpassDependency* toCount, size_t* count);
+
+void count_VkRenderPassCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                  const VkRenderPassCreateInfo* toCount, size_t* count);
+
+void count_VkCommandPoolCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                   const VkCommandPoolCreateInfo* toCount, size_t* count);
+
+void count_VkCommandBufferAllocateInfo(uint32_t featureBits, VkStructureType rootType,
+                                       const VkCommandBufferAllocateInfo* toCount, size_t* count);
+
+void count_VkCommandBufferInheritanceInfo(uint32_t featureBits, VkStructureType rootType,
+                                          const VkCommandBufferInheritanceInfo* toCount,
+                                          size_t* count);
+
+void count_VkCommandBufferBeginInfo(uint32_t featureBits, VkStructureType rootType,
+                                    const VkCommandBufferBeginInfo* toCount, size_t* count);
+
+void count_VkBufferCopy(uint32_t featureBits, VkStructureType rootType, const VkBufferCopy* toCount,
+                        size_t* count);
+
+void count_VkImageSubresourceLayers(uint32_t featureBits, VkStructureType rootType,
+                                    const VkImageSubresourceLayers* toCount, size_t* count);
+
+void count_VkBufferImageCopy(uint32_t featureBits, VkStructureType rootType,
+                             const VkBufferImageCopy* toCount, size_t* count);
+
+void count_VkClearColorValue(uint32_t featureBits, VkStructureType rootType,
+                             const VkClearColorValue* toCount, size_t* count);
+
+void count_VkClearDepthStencilValue(uint32_t featureBits, VkStructureType rootType,
+                                    const VkClearDepthStencilValue* toCount, size_t* count);
+
+void count_VkClearValue(uint32_t featureBits, VkStructureType rootType, const VkClearValue* toCount,
+                        size_t* count);
+
+void count_VkClearAttachment(uint32_t featureBits, VkStructureType rootType,
+                             const VkClearAttachment* toCount, size_t* count);
+
+void count_VkClearRect(uint32_t featureBits, VkStructureType rootType, const VkClearRect* toCount,
+                       size_t* count);
+
+void count_VkImageBlit(uint32_t featureBits, VkStructureType rootType, const VkImageBlit* toCount,
+                       size_t* count);
+
+void count_VkImageCopy(uint32_t featureBits, VkStructureType rootType, const VkImageCopy* toCount,
+                       size_t* count);
+
+void count_VkImageResolve(uint32_t featureBits, VkStructureType rootType,
+                          const VkImageResolve* toCount, size_t* count);
+
+void count_VkRenderPassBeginInfo(uint32_t featureBits, VkStructureType rootType,
+                                 const VkRenderPassBeginInfo* toCount, size_t* count);
+
+#endif
+#ifdef VK_VERSION_1_1
+void count_VkPhysicalDeviceSubgroupProperties(uint32_t featureBits, VkStructureType rootType,
+                                              const VkPhysicalDeviceSubgroupProperties* toCount,
+                                              size_t* count);
+
+void count_VkBindBufferMemoryInfo(uint32_t featureBits, VkStructureType rootType,
+                                  const VkBindBufferMemoryInfo* toCount, size_t* count);
+
+void count_VkBindImageMemoryInfo(uint32_t featureBits, VkStructureType rootType,
+                                 const VkBindImageMemoryInfo* toCount, size_t* count);
+
+void count_VkPhysicalDevice16BitStorageFeatures(uint32_t featureBits, VkStructureType rootType,
+                                                const VkPhysicalDevice16BitStorageFeatures* toCount,
+                                                size_t* count);
+
+void count_VkMemoryDedicatedRequirements(uint32_t featureBits, VkStructureType rootType,
+                                         const VkMemoryDedicatedRequirements* toCount,
+                                         size_t* count);
+
+void count_VkMemoryDedicatedAllocateInfo(uint32_t featureBits, VkStructureType rootType,
+                                         const VkMemoryDedicatedAllocateInfo* toCount,
+                                         size_t* count);
+
+void count_VkMemoryAllocateFlagsInfo(uint32_t featureBits, VkStructureType rootType,
+                                     const VkMemoryAllocateFlagsInfo* toCount, size_t* count);
+
+void count_VkDeviceGroupRenderPassBeginInfo(uint32_t featureBits, VkStructureType rootType,
+                                            const VkDeviceGroupRenderPassBeginInfo* toCount,
+                                            size_t* count);
+
+void count_VkDeviceGroupCommandBufferBeginInfo(uint32_t featureBits, VkStructureType rootType,
+                                               const VkDeviceGroupCommandBufferBeginInfo* toCount,
+                                               size_t* count);
+
+void count_VkDeviceGroupSubmitInfo(uint32_t featureBits, VkStructureType rootType,
+                                   const VkDeviceGroupSubmitInfo* toCount, size_t* count);
+
+void count_VkDeviceGroupBindSparseInfo(uint32_t featureBits, VkStructureType rootType,
+                                       const VkDeviceGroupBindSparseInfo* toCount, size_t* count);
+
+void count_VkBindBufferMemoryDeviceGroupInfo(uint32_t featureBits, VkStructureType rootType,
+                                             const VkBindBufferMemoryDeviceGroupInfo* toCount,
+                                             size_t* count);
+
+void count_VkBindImageMemoryDeviceGroupInfo(uint32_t featureBits, VkStructureType rootType,
+                                            const VkBindImageMemoryDeviceGroupInfo* toCount,
+                                            size_t* count);
+
+void count_VkPhysicalDeviceGroupProperties(uint32_t featureBits, VkStructureType rootType,
+                                           const VkPhysicalDeviceGroupProperties* toCount,
+                                           size_t* count);
+
+void count_VkDeviceGroupDeviceCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                         const VkDeviceGroupDeviceCreateInfo* toCount,
+                                         size_t* count);
+
+void count_VkBufferMemoryRequirementsInfo2(uint32_t featureBits, VkStructureType rootType,
+                                           const VkBufferMemoryRequirementsInfo2* toCount,
+                                           size_t* count);
+
+void count_VkImageMemoryRequirementsInfo2(uint32_t featureBits, VkStructureType rootType,
+                                          const VkImageMemoryRequirementsInfo2* toCount,
+                                          size_t* count);
+
+void count_VkImageSparseMemoryRequirementsInfo2(uint32_t featureBits, VkStructureType rootType,
+                                                const VkImageSparseMemoryRequirementsInfo2* toCount,
+                                                size_t* count);
+
+void count_VkMemoryRequirements2(uint32_t featureBits, VkStructureType rootType,
+                                 const VkMemoryRequirements2* toCount, size_t* count);
+
+void count_VkSparseImageMemoryRequirements2(uint32_t featureBits, VkStructureType rootType,
+                                            const VkSparseImageMemoryRequirements2* toCount,
+                                            size_t* count);
+
+void count_VkPhysicalDeviceFeatures2(uint32_t featureBits, VkStructureType rootType,
+                                     const VkPhysicalDeviceFeatures2* toCount, size_t* count);
+
+void count_VkPhysicalDeviceProperties2(uint32_t featureBits, VkStructureType rootType,
+                                       const VkPhysicalDeviceProperties2* toCount, size_t* count);
+
+void count_VkFormatProperties2(uint32_t featureBits, VkStructureType rootType,
+                               const VkFormatProperties2* toCount, size_t* count);
+
+void count_VkImageFormatProperties2(uint32_t featureBits, VkStructureType rootType,
+                                    const VkImageFormatProperties2* toCount, size_t* count);
+
+void count_VkPhysicalDeviceImageFormatInfo2(uint32_t featureBits, VkStructureType rootType,
+                                            const VkPhysicalDeviceImageFormatInfo2* toCount,
+                                            size_t* count);
+
+void count_VkQueueFamilyProperties2(uint32_t featureBits, VkStructureType rootType,
+                                    const VkQueueFamilyProperties2* toCount, size_t* count);
+
+void count_VkPhysicalDeviceMemoryProperties2(uint32_t featureBits, VkStructureType rootType,
+                                             const VkPhysicalDeviceMemoryProperties2* toCount,
+                                             size_t* count);
+
+void count_VkSparseImageFormatProperties2(uint32_t featureBits, VkStructureType rootType,
+                                          const VkSparseImageFormatProperties2* toCount,
+                                          size_t* count);
+
+void count_VkPhysicalDeviceSparseImageFormatInfo2(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceSparseImageFormatInfo2* toCount, size_t* count);
+
+void count_VkPhysicalDevicePointClippingProperties(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDevicePointClippingProperties* toCount, size_t* count);
+
+void count_VkInputAttachmentAspectReference(uint32_t featureBits, VkStructureType rootType,
+                                            const VkInputAttachmentAspectReference* toCount,
+                                            size_t* count);
+
+void count_VkRenderPassInputAttachmentAspectCreateInfo(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkRenderPassInputAttachmentAspectCreateInfo* toCount, size_t* count);
+
+void count_VkImageViewUsageCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                      const VkImageViewUsageCreateInfo* toCount, size_t* count);
+
+void count_VkPipelineTessellationDomainOriginStateCreateInfo(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineTessellationDomainOriginStateCreateInfo* toCount, size_t* count);
+
+void count_VkRenderPassMultiviewCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                           const VkRenderPassMultiviewCreateInfo* toCount,
+                                           size_t* count);
+
+void count_VkPhysicalDeviceMultiviewFeatures(uint32_t featureBits, VkStructureType rootType,
+                                             const VkPhysicalDeviceMultiviewFeatures* toCount,
+                                             size_t* count);
+
+void count_VkPhysicalDeviceMultiviewProperties(uint32_t featureBits, VkStructureType rootType,
+                                               const VkPhysicalDeviceMultiviewProperties* toCount,
+                                               size_t* count);
+
+void count_VkPhysicalDeviceVariablePointersFeatures(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceVariablePointersFeatures* toCount, size_t* count);
+
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceVariablePointersFeatures,
+                      count_VkPhysicalDeviceVariablePointerFeatures)
+
+void count_VkPhysicalDeviceProtectedMemoryFeatures(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceProtectedMemoryFeatures* toCount, size_t* count);
+
+void count_VkPhysicalDeviceProtectedMemoryProperties(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceProtectedMemoryProperties* toCount, size_t* count);
+
+void count_VkDeviceQueueInfo2(uint32_t featureBits, VkStructureType rootType,
+                              const VkDeviceQueueInfo2* toCount, size_t* count);
+
+void count_VkProtectedSubmitInfo(uint32_t featureBits, VkStructureType rootType,
+                                 const VkProtectedSubmitInfo* toCount, size_t* count);
+
+void count_VkSamplerYcbcrConversionCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                              const VkSamplerYcbcrConversionCreateInfo* toCount,
+                                              size_t* count);
+
+void count_VkSamplerYcbcrConversionInfo(uint32_t featureBits, VkStructureType rootType,
+                                        const VkSamplerYcbcrConversionInfo* toCount, size_t* count);
+
+void count_VkBindImagePlaneMemoryInfo(uint32_t featureBits, VkStructureType rootType,
+                                      const VkBindImagePlaneMemoryInfo* toCount, size_t* count);
+
+void count_VkImagePlaneMemoryRequirementsInfo(uint32_t featureBits, VkStructureType rootType,
+                                              const VkImagePlaneMemoryRequirementsInfo* toCount,
+                                              size_t* count);
+
+void count_VkPhysicalDeviceSamplerYcbcrConversionFeatures(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceSamplerYcbcrConversionFeatures* toCount, size_t* count);
+
+void count_VkSamplerYcbcrConversionImageFormatProperties(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkSamplerYcbcrConversionImageFormatProperties* toCount, size_t* count);
+
+void count_VkDescriptorUpdateTemplateEntry(uint32_t featureBits, VkStructureType rootType,
+                                           const VkDescriptorUpdateTemplateEntry* toCount,
+                                           size_t* count);
+
+void count_VkDescriptorUpdateTemplateCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                                const VkDescriptorUpdateTemplateCreateInfo* toCount,
+                                                size_t* count);
+
+void count_VkExternalMemoryProperties(uint32_t featureBits, VkStructureType rootType,
+                                      const VkExternalMemoryProperties* toCount, size_t* count);
+
+void count_VkPhysicalDeviceExternalImageFormatInfo(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceExternalImageFormatInfo* toCount, size_t* count);
+
+void count_VkExternalImageFormatProperties(uint32_t featureBits, VkStructureType rootType,
+                                           const VkExternalImageFormatProperties* toCount,
+                                           size_t* count);
+
+void count_VkPhysicalDeviceExternalBufferInfo(uint32_t featureBits, VkStructureType rootType,
+                                              const VkPhysicalDeviceExternalBufferInfo* toCount,
+                                              size_t* count);
+
+void count_VkExternalBufferProperties(uint32_t featureBits, VkStructureType rootType,
+                                      const VkExternalBufferProperties* toCount, size_t* count);
+
+void count_VkPhysicalDeviceIDProperties(uint32_t featureBits, VkStructureType rootType,
+                                        const VkPhysicalDeviceIDProperties* toCount, size_t* count);
+
+void count_VkExternalMemoryImageCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                           const VkExternalMemoryImageCreateInfo* toCount,
+                                           size_t* count);
+
+void count_VkExternalMemoryBufferCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                            const VkExternalMemoryBufferCreateInfo* toCount,
+                                            size_t* count);
+
+void count_VkExportMemoryAllocateInfo(uint32_t featureBits, VkStructureType rootType,
+                                      const VkExportMemoryAllocateInfo* toCount, size_t* count);
+
+void count_VkPhysicalDeviceExternalFenceInfo(uint32_t featureBits, VkStructureType rootType,
+                                             const VkPhysicalDeviceExternalFenceInfo* toCount,
+                                             size_t* count);
+
+void count_VkExternalFenceProperties(uint32_t featureBits, VkStructureType rootType,
+                                     const VkExternalFenceProperties* toCount, size_t* count);
+
+void count_VkExportFenceCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                   const VkExportFenceCreateInfo* toCount, size_t* count);
+
+void count_VkExportSemaphoreCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                       const VkExportSemaphoreCreateInfo* toCount, size_t* count);
+
+void count_VkPhysicalDeviceExternalSemaphoreInfo(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceExternalSemaphoreInfo* toCount, size_t* count);
+
+void count_VkExternalSemaphoreProperties(uint32_t featureBits, VkStructureType rootType,
+                                         const VkExternalSemaphoreProperties* toCount,
+                                         size_t* count);
+
+void count_VkPhysicalDeviceMaintenance3Properties(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceMaintenance3Properties* toCount, size_t* count);
+
+void count_VkDescriptorSetLayoutSupport(uint32_t featureBits, VkStructureType rootType,
+                                        const VkDescriptorSetLayoutSupport* toCount, size_t* count);
+
+void count_VkPhysicalDeviceShaderDrawParametersFeatures(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderDrawParametersFeatures* toCount, size_t* count);
+
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceShaderDrawParametersFeatures,
+                      count_VkPhysicalDeviceShaderDrawParameterFeatures)
+
+#endif
+#ifdef VK_VERSION_1_2
+void count_VkPhysicalDeviceVulkan11Features(uint32_t featureBits, VkStructureType rootType,
+                                            const VkPhysicalDeviceVulkan11Features* toCount,
+                                            size_t* count);
+
+void count_VkPhysicalDeviceVulkan11Properties(uint32_t featureBits, VkStructureType rootType,
+                                              const VkPhysicalDeviceVulkan11Properties* toCount,
+                                              size_t* count);
+
+void count_VkPhysicalDeviceVulkan12Features(uint32_t featureBits, VkStructureType rootType,
+                                            const VkPhysicalDeviceVulkan12Features* toCount,
+                                            size_t* count);
+
+void count_VkConformanceVersion(uint32_t featureBits, VkStructureType rootType,
+                                const VkConformanceVersion* toCount, size_t* count);
+
+void count_VkPhysicalDeviceVulkan12Properties(uint32_t featureBits, VkStructureType rootType,
+                                              const VkPhysicalDeviceVulkan12Properties* toCount,
+                                              size_t* count);
+
+void count_VkImageFormatListCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                       const VkImageFormatListCreateInfo* toCount, size_t* count);
+
+void count_VkAttachmentDescription2(uint32_t featureBits, VkStructureType rootType,
+                                    const VkAttachmentDescription2* toCount, size_t* count);
+
+void count_VkAttachmentReference2(uint32_t featureBits, VkStructureType rootType,
+                                  const VkAttachmentReference2* toCount, size_t* count);
+
+void count_VkSubpassDescription2(uint32_t featureBits, VkStructureType rootType,
+                                 const VkSubpassDescription2* toCount, size_t* count);
+
+void count_VkSubpassDependency2(uint32_t featureBits, VkStructureType rootType,
+                                const VkSubpassDependency2* toCount, size_t* count);
+
+void count_VkRenderPassCreateInfo2(uint32_t featureBits, VkStructureType rootType,
+                                   const VkRenderPassCreateInfo2* toCount, size_t* count);
+
+void count_VkSubpassBeginInfo(uint32_t featureBits, VkStructureType rootType,
+                              const VkSubpassBeginInfo* toCount, size_t* count);
+
+void count_VkSubpassEndInfo(uint32_t featureBits, VkStructureType rootType,
+                            const VkSubpassEndInfo* toCount, size_t* count);
+
+void count_VkPhysicalDevice8BitStorageFeatures(uint32_t featureBits, VkStructureType rootType,
+                                               const VkPhysicalDevice8BitStorageFeatures* toCount,
+                                               size_t* count);
+
+void count_VkPhysicalDeviceDriverProperties(uint32_t featureBits, VkStructureType rootType,
+                                            const VkPhysicalDeviceDriverProperties* toCount,
+                                            size_t* count);
+
+void count_VkPhysicalDeviceShaderAtomicInt64Features(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderAtomicInt64Features* toCount, size_t* count);
+
+void count_VkPhysicalDeviceShaderFloat16Int8Features(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderFloat16Int8Features* toCount, size_t* count);
+
+void count_VkPhysicalDeviceFloatControlsProperties(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceFloatControlsProperties* toCount, size_t* count);
+
+void count_VkDescriptorSetLayoutBindingFlagsCreateInfo(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkDescriptorSetLayoutBindingFlagsCreateInfo* toCount, size_t* count);
+
+void count_VkPhysicalDeviceDescriptorIndexingFeatures(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceDescriptorIndexingFeatures* toCount, size_t* count);
+
+void count_VkPhysicalDeviceDescriptorIndexingProperties(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceDescriptorIndexingProperties* toCount, size_t* count);
+
+void count_VkDescriptorSetVariableDescriptorCountAllocateInfo(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkDescriptorSetVariableDescriptorCountAllocateInfo* toCount, size_t* count);
+
+void count_VkDescriptorSetVariableDescriptorCountLayoutSupport(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkDescriptorSetVariableDescriptorCountLayoutSupport* toCount, size_t* count);
+
+void count_VkSubpassDescriptionDepthStencilResolve(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkSubpassDescriptionDepthStencilResolve* toCount, size_t* count);
+
+void count_VkPhysicalDeviceDepthStencilResolveProperties(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceDepthStencilResolveProperties* toCount, size_t* count);
+
+void count_VkPhysicalDeviceScalarBlockLayoutFeatures(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceScalarBlockLayoutFeatures* toCount, size_t* count);
+
+void count_VkImageStencilUsageCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                         const VkImageStencilUsageCreateInfo* toCount,
+                                         size_t* count);
+
+void count_VkSamplerReductionModeCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                            const VkSamplerReductionModeCreateInfo* toCount,
+                                            size_t* count);
+
+void count_VkPhysicalDeviceSamplerFilterMinmaxProperties(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceSamplerFilterMinmaxProperties* toCount, size_t* count);
+
+void count_VkPhysicalDeviceVulkanMemoryModelFeatures(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceVulkanMemoryModelFeatures* toCount, size_t* count);
+
+void count_VkPhysicalDeviceImagelessFramebufferFeatures(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceImagelessFramebufferFeatures* toCount, size_t* count);
+
+void count_VkFramebufferAttachmentImageInfo(uint32_t featureBits, VkStructureType rootType,
+                                            const VkFramebufferAttachmentImageInfo* toCount,
+                                            size_t* count);
+
+void count_VkFramebufferAttachmentsCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                              const VkFramebufferAttachmentsCreateInfo* toCount,
+                                              size_t* count);
+
+void count_VkRenderPassAttachmentBeginInfo(uint32_t featureBits, VkStructureType rootType,
+                                           const VkRenderPassAttachmentBeginInfo* toCount,
+                                           size_t* count);
+
+void count_VkPhysicalDeviceUniformBufferStandardLayoutFeatures(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceUniformBufferStandardLayoutFeatures* toCount, size_t* count);
+
+void count_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures* toCount, size_t* count);
+
+void count_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures* toCount, size_t* count);
+
+void count_VkAttachmentReferenceStencilLayout(uint32_t featureBits, VkStructureType rootType,
+                                              const VkAttachmentReferenceStencilLayout* toCount,
+                                              size_t* count);
+
+void count_VkAttachmentDescriptionStencilLayout(uint32_t featureBits, VkStructureType rootType,
+                                                const VkAttachmentDescriptionStencilLayout* toCount,
+                                                size_t* count);
+
+void count_VkPhysicalDeviceHostQueryResetFeatures(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceHostQueryResetFeatures* toCount, size_t* count);
+
+void count_VkPhysicalDeviceTimelineSemaphoreFeatures(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceTimelineSemaphoreFeatures* toCount, size_t* count);
+
+void count_VkPhysicalDeviceTimelineSemaphoreProperties(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceTimelineSemaphoreProperties* toCount, size_t* count);
+
+void count_VkSemaphoreTypeCreateInfo(uint32_t featureBits, VkStructureType rootType,
+                                     const VkSemaphoreTypeCreateInfo* toCount, size_t* count);
+
+void count_VkTimelineSemaphoreSubmitInfo(uint32_t featureBits, VkStructureType rootType,
+                                         const VkTimelineSemaphoreSubmitInfo* toCount,
+                                         size_t* count);
+
+void count_VkSemaphoreWaitInfo(uint32_t featureBits, VkStructureType rootType,
+                               const VkSemaphoreWaitInfo* toCount, size_t* count);
+
+void count_VkSemaphoreSignalInfo(uint32_t featureBits, VkStructureType rootType,
+                                 const VkSemaphoreSignalInfo* toCount, size_t* count);
+
+void count_VkPhysicalDeviceBufferDeviceAddressFeatures(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceBufferDeviceAddressFeatures* toCount, size_t* count);
+
+void count_VkBufferDeviceAddressInfo(uint32_t featureBits, VkStructureType rootType,
+                                     const VkBufferDeviceAddressInfo* toCount, size_t* count);
+
+void count_VkBufferOpaqueCaptureAddressCreateInfo(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkBufferOpaqueCaptureAddressCreateInfo* toCount, size_t* count);
+
+void count_VkMemoryOpaqueCaptureAddressAllocateInfo(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkMemoryOpaqueCaptureAddressAllocateInfo* toCount, size_t* count);
+
+void count_VkDeviceMemoryOpaqueCaptureAddressInfo(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkDeviceMemoryOpaqueCaptureAddressInfo* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_surface
+void count_VkSurfaceCapabilitiesKHR(uint32_t featureBits, VkStructureType rootType,
+                                    const VkSurfaceCapabilitiesKHR* toCount, size_t* count);
+
+void count_VkSurfaceFormatKHR(uint32_t featureBits, VkStructureType rootType,
+                              const VkSurfaceFormatKHR* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_swapchain
+void count_VkSwapchainCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                    const VkSwapchainCreateInfoKHR* toCount, size_t* count);
+
+void count_VkPresentInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                            const VkPresentInfoKHR* toCount, size_t* count);
+
+void count_VkImageSwapchainCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                         const VkImageSwapchainCreateInfoKHR* toCount,
+                                         size_t* count);
+
+void count_VkBindImageMemorySwapchainInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                             const VkBindImageMemorySwapchainInfoKHR* toCount,
+                                             size_t* count);
+
+void count_VkAcquireNextImageInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                     const VkAcquireNextImageInfoKHR* toCount, size_t* count);
+
+void count_VkDeviceGroupPresentCapabilitiesKHR(uint32_t featureBits, VkStructureType rootType,
+                                               const VkDeviceGroupPresentCapabilitiesKHR* toCount,
+                                               size_t* count);
+
+void count_VkDeviceGroupPresentInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                       const VkDeviceGroupPresentInfoKHR* toCount, size_t* count);
+
+void count_VkDeviceGroupSwapchainCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                               const VkDeviceGroupSwapchainCreateInfoKHR* toCount,
+                                               size_t* count);
+
+#endif
+#ifdef VK_KHR_display
+void count_VkDisplayModeParametersKHR(uint32_t featureBits, VkStructureType rootType,
+                                      const VkDisplayModeParametersKHR* toCount, size_t* count);
+
+void count_VkDisplayModeCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                      const VkDisplayModeCreateInfoKHR* toCount, size_t* count);
+
+void count_VkDisplayModePropertiesKHR(uint32_t featureBits, VkStructureType rootType,
+                                      const VkDisplayModePropertiesKHR* toCount, size_t* count);
+
+void count_VkDisplayPlaneCapabilitiesKHR(uint32_t featureBits, VkStructureType rootType,
+                                         const VkDisplayPlaneCapabilitiesKHR* toCount,
+                                         size_t* count);
+
+void count_VkDisplayPlanePropertiesKHR(uint32_t featureBits, VkStructureType rootType,
+                                       const VkDisplayPlanePropertiesKHR* toCount, size_t* count);
+
+void count_VkDisplayPropertiesKHR(uint32_t featureBits, VkStructureType rootType,
+                                  const VkDisplayPropertiesKHR* toCount, size_t* count);
+
+void count_VkDisplaySurfaceCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                         const VkDisplaySurfaceCreateInfoKHR* toCount,
+                                         size_t* count);
+
+#endif
+#ifdef VK_KHR_display_swapchain
+void count_VkDisplayPresentInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                   const VkDisplayPresentInfoKHR* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_xlib_surface
+void count_VkXlibSurfaceCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                      const VkXlibSurfaceCreateInfoKHR* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_xcb_surface
+void count_VkXcbSurfaceCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                     const VkXcbSurfaceCreateInfoKHR* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_wayland_surface
+void count_VkWaylandSurfaceCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                         const VkWaylandSurfaceCreateInfoKHR* toCount,
+                                         size_t* count);
+
+#endif
+#ifdef VK_KHR_android_surface
+void count_VkAndroidSurfaceCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                         const VkAndroidSurfaceCreateInfoKHR* toCount,
+                                         size_t* count);
+
+#endif
+#ifdef VK_KHR_win32_surface
+void count_VkWin32SurfaceCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                       const VkWin32SurfaceCreateInfoKHR* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_sampler_mirror_clamp_to_edge
+#endif
+#ifdef VK_KHR_video_queue
+void count_VkVideoQueueFamilyProperties2KHR(uint32_t featureBits, VkStructureType rootType,
+                                            const VkVideoQueueFamilyProperties2KHR* toCount,
+                                            size_t* count);
+
+void count_VkVideoProfileKHR(uint32_t featureBits, VkStructureType rootType,
+                             const VkVideoProfileKHR* toCount, size_t* count);
+
+void count_VkVideoProfilesKHR(uint32_t featureBits, VkStructureType rootType,
+                              const VkVideoProfilesKHR* toCount, size_t* count);
+
+void count_VkVideoCapabilitiesKHR(uint32_t featureBits, VkStructureType rootType,
+                                  const VkVideoCapabilitiesKHR* toCount, size_t* count);
+
+void count_VkPhysicalDeviceVideoFormatInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                              const VkPhysicalDeviceVideoFormatInfoKHR* toCount,
+                                              size_t* count);
+
+void count_VkVideoFormatPropertiesKHR(uint32_t featureBits, VkStructureType rootType,
+                                      const VkVideoFormatPropertiesKHR* toCount, size_t* count);
+
+void count_VkVideoPictureResourceKHR(uint32_t featureBits, VkStructureType rootType,
+                                     const VkVideoPictureResourceKHR* toCount, size_t* count);
+
+void count_VkVideoReferenceSlotKHR(uint32_t featureBits, VkStructureType rootType,
+                                   const VkVideoReferenceSlotKHR* toCount, size_t* count);
+
+void count_VkVideoGetMemoryPropertiesKHR(uint32_t featureBits, VkStructureType rootType,
+                                         const VkVideoGetMemoryPropertiesKHR* toCount,
+                                         size_t* count);
+
+void count_VkVideoBindMemoryKHR(uint32_t featureBits, VkStructureType rootType,
+                                const VkVideoBindMemoryKHR* toCount, size_t* count);
+
+void count_VkVideoSessionCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                       const VkVideoSessionCreateInfoKHR* toCount, size_t* count);
+
+void count_VkVideoSessionParametersCreateInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoSessionParametersCreateInfoKHR* toCount, size_t* count);
+
+void count_VkVideoSessionParametersUpdateInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoSessionParametersUpdateInfoKHR* toCount, size_t* count);
+
+void count_VkVideoBeginCodingInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                     const VkVideoBeginCodingInfoKHR* toCount, size_t* count);
+
+void count_VkVideoEndCodingInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                   const VkVideoEndCodingInfoKHR* toCount, size_t* count);
+
+void count_VkVideoCodingControlInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                       const VkVideoCodingControlInfoKHR* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_video_decode_queue
+void count_VkVideoDecodeInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                const VkVideoDecodeInfoKHR* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_dynamic_rendering
+void count_VkRenderingAttachmentInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                        const VkRenderingAttachmentInfoKHR* toCount, size_t* count);
+
+void count_VkRenderingInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                              const VkRenderingInfoKHR* toCount, size_t* count);
+
+void count_VkPipelineRenderingCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                            const VkPipelineRenderingCreateInfoKHR* toCount,
+                                            size_t* count);
+
+void count_VkPhysicalDeviceDynamicRenderingFeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceDynamicRenderingFeaturesKHR* toCount, size_t* count);
+
+void count_VkCommandBufferInheritanceRenderingInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkCommandBufferInheritanceRenderingInfoKHR* toCount, size_t* count);
+
+void count_VkRenderingFragmentShadingRateAttachmentInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkRenderingFragmentShadingRateAttachmentInfoKHR* toCount, size_t* count);
+
+void count_VkRenderingFragmentDensityMapAttachmentInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkRenderingFragmentDensityMapAttachmentInfoEXT* toCount, size_t* count);
+
+void count_VkAttachmentSampleCountInfoAMD(uint32_t featureBits, VkStructureType rootType,
+                                          const VkAttachmentSampleCountInfoAMD* toCount,
+                                          size_t* count);
+
+DEFINE_ALIAS_FUNCTION(count_VkAttachmentSampleCountInfoAMD, count_VkAttachmentSampleCountInfoNV)
+
+void count_VkMultiviewPerViewAttributesInfoNVX(uint32_t featureBits, VkStructureType rootType,
+                                               const VkMultiviewPerViewAttributesInfoNVX* toCount,
+                                               size_t* count);
+
+#endif
+#ifdef VK_KHR_multiview
+DEFINE_ALIAS_FUNCTION(count_VkRenderPassMultiviewCreateInfo,
+                      count_VkRenderPassMultiviewCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceMultiviewFeatures,
+                      count_VkPhysicalDeviceMultiviewFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceMultiviewProperties,
+                      count_VkPhysicalDeviceMultiviewPropertiesKHR)
+
+#endif
+#ifdef VK_KHR_get_physical_device_properties2
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceFeatures2, count_VkPhysicalDeviceFeatures2KHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceProperties2, count_VkPhysicalDeviceProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkFormatProperties2, count_VkFormatProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkImageFormatProperties2, count_VkImageFormatProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceImageFormatInfo2,
+                      count_VkPhysicalDeviceImageFormatInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkQueueFamilyProperties2, count_VkQueueFamilyProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceMemoryProperties2,
+                      count_VkPhysicalDeviceMemoryProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkSparseImageFormatProperties2, count_VkSparseImageFormatProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceSparseImageFormatInfo2,
+                      count_VkPhysicalDeviceSparseImageFormatInfo2KHR)
+
+#endif
+#ifdef VK_KHR_device_group
+DEFINE_ALIAS_FUNCTION(count_VkMemoryAllocateFlagsInfo, count_VkMemoryAllocateFlagsInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkDeviceGroupRenderPassBeginInfo,
+                      count_VkDeviceGroupRenderPassBeginInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkDeviceGroupCommandBufferBeginInfo,
+                      count_VkDeviceGroupCommandBufferBeginInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkDeviceGroupSubmitInfo, count_VkDeviceGroupSubmitInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkDeviceGroupBindSparseInfo, count_VkDeviceGroupBindSparseInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkBindBufferMemoryDeviceGroupInfo,
+                      count_VkBindBufferMemoryDeviceGroupInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkBindImageMemoryDeviceGroupInfo,
+                      count_VkBindImageMemoryDeviceGroupInfoKHR)
+
+#endif
+#ifdef VK_KHR_shader_draw_parameters
+#endif
+#ifdef VK_KHR_maintenance1
+#endif
+#ifdef VK_KHR_device_group_creation
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceGroupProperties,
+                      count_VkPhysicalDeviceGroupPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkDeviceGroupDeviceCreateInfo, count_VkDeviceGroupDeviceCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_external_memory_capabilities
+DEFINE_ALIAS_FUNCTION(count_VkExternalMemoryProperties, count_VkExternalMemoryPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceExternalImageFormatInfo,
+                      count_VkPhysicalDeviceExternalImageFormatInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkExternalImageFormatProperties,
+                      count_VkExternalImageFormatPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceExternalBufferInfo,
+                      count_VkPhysicalDeviceExternalBufferInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkExternalBufferProperties, count_VkExternalBufferPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceIDProperties, count_VkPhysicalDeviceIDPropertiesKHR)
+
+#endif
+#ifdef VK_KHR_external_memory
+DEFINE_ALIAS_FUNCTION(count_VkExternalMemoryImageCreateInfo,
+                      count_VkExternalMemoryImageCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkExternalMemoryBufferCreateInfo,
+                      count_VkExternalMemoryBufferCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkExportMemoryAllocateInfo, count_VkExportMemoryAllocateInfoKHR)
+
+#endif
+#ifdef VK_KHR_external_memory_win32
+void count_VkImportMemoryWin32HandleInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                            const VkImportMemoryWin32HandleInfoKHR* toCount,
+                                            size_t* count);
+
+void count_VkExportMemoryWin32HandleInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                            const VkExportMemoryWin32HandleInfoKHR* toCount,
+                                            size_t* count);
+
+void count_VkMemoryWin32HandlePropertiesKHR(uint32_t featureBits, VkStructureType rootType,
+                                            const VkMemoryWin32HandlePropertiesKHR* toCount,
+                                            size_t* count);
+
+void count_VkMemoryGetWin32HandleInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                         const VkMemoryGetWin32HandleInfoKHR* toCount,
+                                         size_t* count);
+
+#endif
+#ifdef VK_KHR_external_memory_fd
+void count_VkImportMemoryFdInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                   const VkImportMemoryFdInfoKHR* toCount, size_t* count);
+
+void count_VkMemoryFdPropertiesKHR(uint32_t featureBits, VkStructureType rootType,
+                                   const VkMemoryFdPropertiesKHR* toCount, size_t* count);
+
+void count_VkMemoryGetFdInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                const VkMemoryGetFdInfoKHR* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_win32_keyed_mutex
+void count_VkWin32KeyedMutexAcquireReleaseInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkWin32KeyedMutexAcquireReleaseInfoKHR* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_external_semaphore_capabilities
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceExternalSemaphoreInfo,
+                      count_VkPhysicalDeviceExternalSemaphoreInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkExternalSemaphoreProperties, count_VkExternalSemaphorePropertiesKHR)
+
+#endif
+#ifdef VK_KHR_external_semaphore
+DEFINE_ALIAS_FUNCTION(count_VkExportSemaphoreCreateInfo, count_VkExportSemaphoreCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+void count_VkImportSemaphoreWin32HandleInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                               const VkImportSemaphoreWin32HandleInfoKHR* toCount,
+                                               size_t* count);
+
+void count_VkExportSemaphoreWin32HandleInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                               const VkExportSemaphoreWin32HandleInfoKHR* toCount,
+                                               size_t* count);
+
+void count_VkD3D12FenceSubmitInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                     const VkD3D12FenceSubmitInfoKHR* toCount, size_t* count);
+
+void count_VkSemaphoreGetWin32HandleInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                            const VkSemaphoreGetWin32HandleInfoKHR* toCount,
+                                            size_t* count);
+
+#endif
+#ifdef VK_KHR_external_semaphore_fd
+void count_VkImportSemaphoreFdInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                      const VkImportSemaphoreFdInfoKHR* toCount, size_t* count);
+
+void count_VkSemaphoreGetFdInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                   const VkSemaphoreGetFdInfoKHR* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_push_descriptor
+void count_VkPhysicalDevicePushDescriptorPropertiesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDevicePushDescriptorPropertiesKHR* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_shader_float16_int8
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceShaderFloat16Int8Features,
+                      count_VkPhysicalDeviceShaderFloat16Int8FeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceShaderFloat16Int8Features,
+                      count_VkPhysicalDeviceFloat16Int8FeaturesKHR)
+
+#endif
+#ifdef VK_KHR_16bit_storage
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDevice16BitStorageFeatures,
+                      count_VkPhysicalDevice16BitStorageFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_incremental_present
+void count_VkRectLayerKHR(uint32_t featureBits, VkStructureType rootType,
+                          const VkRectLayerKHR* toCount, size_t* count);
+
+void count_VkPresentRegionKHR(uint32_t featureBits, VkStructureType rootType,
+                              const VkPresentRegionKHR* toCount, size_t* count);
+
+void count_VkPresentRegionsKHR(uint32_t featureBits, VkStructureType rootType,
+                               const VkPresentRegionsKHR* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_descriptor_update_template
+DEFINE_ALIAS_FUNCTION(count_VkDescriptorUpdateTemplateEntry,
+                      count_VkDescriptorUpdateTemplateEntryKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkDescriptorUpdateTemplateCreateInfo,
+                      count_VkDescriptorUpdateTemplateCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_imageless_framebuffer
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceImagelessFramebufferFeatures,
+                      count_VkPhysicalDeviceImagelessFramebufferFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkFramebufferAttachmentsCreateInfo,
+                      count_VkFramebufferAttachmentsCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkFramebufferAttachmentImageInfo,
+                      count_VkFramebufferAttachmentImageInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkRenderPassAttachmentBeginInfo,
+                      count_VkRenderPassAttachmentBeginInfoKHR)
+
+#endif
+#ifdef VK_KHR_create_renderpass2
+DEFINE_ALIAS_FUNCTION(count_VkRenderPassCreateInfo2, count_VkRenderPassCreateInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkAttachmentDescription2, count_VkAttachmentDescription2KHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkAttachmentReference2, count_VkAttachmentReference2KHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkSubpassDescription2, count_VkSubpassDescription2KHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkSubpassDependency2, count_VkSubpassDependency2KHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkSubpassBeginInfo, count_VkSubpassBeginInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkSubpassEndInfo, count_VkSubpassEndInfoKHR)
+
+#endif
+#ifdef VK_KHR_shared_presentable_image
+void count_VkSharedPresentSurfaceCapabilitiesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkSharedPresentSurfaceCapabilitiesKHR* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_external_fence_capabilities
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceExternalFenceInfo,
+                      count_VkPhysicalDeviceExternalFenceInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkExternalFenceProperties, count_VkExternalFencePropertiesKHR)
+
+#endif
+#ifdef VK_KHR_external_fence
+DEFINE_ALIAS_FUNCTION(count_VkExportFenceCreateInfo, count_VkExportFenceCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_external_fence_win32
+void count_VkImportFenceWin32HandleInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                           const VkImportFenceWin32HandleInfoKHR* toCount,
+                                           size_t* count);
+
+void count_VkExportFenceWin32HandleInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                           const VkExportFenceWin32HandleInfoKHR* toCount,
+                                           size_t* count);
+
+void count_VkFenceGetWin32HandleInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                        const VkFenceGetWin32HandleInfoKHR* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_external_fence_fd
+void count_VkImportFenceFdInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                  const VkImportFenceFdInfoKHR* toCount, size_t* count);
+
+void count_VkFenceGetFdInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                               const VkFenceGetFdInfoKHR* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_performance_query
+void count_VkPhysicalDevicePerformanceQueryFeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDevicePerformanceQueryFeaturesKHR* toCount, size_t* count);
+
+void count_VkPhysicalDevicePerformanceQueryPropertiesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDevicePerformanceQueryPropertiesKHR* toCount, size_t* count);
+
+void count_VkPerformanceCounterKHR(uint32_t featureBits, VkStructureType rootType,
+                                   const VkPerformanceCounterKHR* toCount, size_t* count);
+
+void count_VkPerformanceCounterDescriptionKHR(uint32_t featureBits, VkStructureType rootType,
+                                              const VkPerformanceCounterDescriptionKHR* toCount,
+                                              size_t* count);
+
+void count_VkQueryPoolPerformanceCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                               const VkQueryPoolPerformanceCreateInfoKHR* toCount,
+                                               size_t* count);
+
+void count_VkPerformanceCounterResultKHR(uint32_t featureBits, VkStructureType rootType,
+                                         const VkPerformanceCounterResultKHR* toCount,
+                                         size_t* count);
+
+void count_VkAcquireProfilingLockInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                         const VkAcquireProfilingLockInfoKHR* toCount,
+                                         size_t* count);
+
+void count_VkPerformanceQuerySubmitInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                           const VkPerformanceQuerySubmitInfoKHR* toCount,
+                                           size_t* count);
+
+#endif
+#ifdef VK_KHR_maintenance2
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDevicePointClippingProperties,
+                      count_VkPhysicalDevicePointClippingPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkRenderPassInputAttachmentAspectCreateInfo,
+                      count_VkRenderPassInputAttachmentAspectCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkInputAttachmentAspectReference,
+                      count_VkInputAttachmentAspectReferenceKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkImageViewUsageCreateInfo, count_VkImageViewUsageCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkPipelineTessellationDomainOriginStateCreateInfo,
+                      count_VkPipelineTessellationDomainOriginStateCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_get_surface_capabilities2
+void count_VkPhysicalDeviceSurfaceInfo2KHR(uint32_t featureBits, VkStructureType rootType,
+                                           const VkPhysicalDeviceSurfaceInfo2KHR* toCount,
+                                           size_t* count);
+
+void count_VkSurfaceCapabilities2KHR(uint32_t featureBits, VkStructureType rootType,
+                                     const VkSurfaceCapabilities2KHR* toCount, size_t* count);
+
+void count_VkSurfaceFormat2KHR(uint32_t featureBits, VkStructureType rootType,
+                               const VkSurfaceFormat2KHR* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_variable_pointers
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceVariablePointersFeatures,
+                      count_VkPhysicalDeviceVariablePointerFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceVariablePointersFeatures,
+                      count_VkPhysicalDeviceVariablePointersFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_get_display_properties2
+void count_VkDisplayProperties2KHR(uint32_t featureBits, VkStructureType rootType,
+                                   const VkDisplayProperties2KHR* toCount, size_t* count);
+
+void count_VkDisplayPlaneProperties2KHR(uint32_t featureBits, VkStructureType rootType,
+                                        const VkDisplayPlaneProperties2KHR* toCount, size_t* count);
+
+void count_VkDisplayModeProperties2KHR(uint32_t featureBits, VkStructureType rootType,
+                                       const VkDisplayModeProperties2KHR* toCount, size_t* count);
+
+void count_VkDisplayPlaneInfo2KHR(uint32_t featureBits, VkStructureType rootType,
+                                  const VkDisplayPlaneInfo2KHR* toCount, size_t* count);
+
+void count_VkDisplayPlaneCapabilities2KHR(uint32_t featureBits, VkStructureType rootType,
+                                          const VkDisplayPlaneCapabilities2KHR* toCount,
+                                          size_t* count);
+
+#endif
+#ifdef VK_KHR_dedicated_allocation
+DEFINE_ALIAS_FUNCTION(count_VkMemoryDedicatedRequirements, count_VkMemoryDedicatedRequirementsKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkMemoryDedicatedAllocateInfo, count_VkMemoryDedicatedAllocateInfoKHR)
+
+#endif
+#ifdef VK_KHR_storage_buffer_storage_class
+#endif
+#ifdef VK_KHR_relaxed_block_layout
+#endif
+#ifdef VK_KHR_get_memory_requirements2
+DEFINE_ALIAS_FUNCTION(count_VkBufferMemoryRequirementsInfo2,
+                      count_VkBufferMemoryRequirementsInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkImageMemoryRequirementsInfo2, count_VkImageMemoryRequirementsInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkImageSparseMemoryRequirementsInfo2,
+                      count_VkImageSparseMemoryRequirementsInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkMemoryRequirements2, count_VkMemoryRequirements2KHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkSparseImageMemoryRequirements2,
+                      count_VkSparseImageMemoryRequirements2KHR)
+
+#endif
+#ifdef VK_KHR_image_format_list
+DEFINE_ALIAS_FUNCTION(count_VkImageFormatListCreateInfo, count_VkImageFormatListCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_sampler_ycbcr_conversion
+DEFINE_ALIAS_FUNCTION(count_VkSamplerYcbcrConversionCreateInfo,
+                      count_VkSamplerYcbcrConversionCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkSamplerYcbcrConversionInfo, count_VkSamplerYcbcrConversionInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkBindImagePlaneMemoryInfo, count_VkBindImagePlaneMemoryInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkImagePlaneMemoryRequirementsInfo,
+                      count_VkImagePlaneMemoryRequirementsInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceSamplerYcbcrConversionFeatures,
+                      count_VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkSamplerYcbcrConversionImageFormatProperties,
+                      count_VkSamplerYcbcrConversionImageFormatPropertiesKHR)
+
+#endif
+#ifdef VK_KHR_bind_memory2
+DEFINE_ALIAS_FUNCTION(count_VkBindBufferMemoryInfo, count_VkBindBufferMemoryInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkBindImageMemoryInfo, count_VkBindImageMemoryInfoKHR)
+
+#endif
+#ifdef VK_KHR_portability_subset
+void count_VkPhysicalDevicePortabilitySubsetFeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDevicePortabilitySubsetFeaturesKHR* toCount, size_t* count);
+
+void count_VkPhysicalDevicePortabilitySubsetPropertiesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDevicePortabilitySubsetPropertiesKHR* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_maintenance3
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceMaintenance3Properties,
+                      count_VkPhysicalDeviceMaintenance3PropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkDescriptorSetLayoutSupport, count_VkDescriptorSetLayoutSupportKHR)
+
+#endif
+#ifdef VK_KHR_draw_indirect_count
+#endif
+#ifdef VK_KHR_shader_subgroup_extended_types
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures,
+                      count_VkPhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_8bit_storage
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDevice8BitStorageFeatures,
+                      count_VkPhysicalDevice8BitStorageFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_shader_atomic_int64
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceShaderAtomicInt64Features,
+                      count_VkPhysicalDeviceShaderAtomicInt64FeaturesKHR)
+
+#endif
+#ifdef VK_KHR_shader_clock
+void count_VkPhysicalDeviceShaderClockFeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderClockFeaturesKHR* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_driver_properties
+DEFINE_ALIAS_FUNCTION(count_VkConformanceVersion, count_VkConformanceVersionKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceDriverProperties,
+                      count_VkPhysicalDeviceDriverPropertiesKHR)
+
+#endif
+#ifdef VK_KHR_shader_float_controls
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceFloatControlsProperties,
+                      count_VkPhysicalDeviceFloatControlsPropertiesKHR)
+
+#endif
+#ifdef VK_KHR_depth_stencil_resolve
+DEFINE_ALIAS_FUNCTION(count_VkSubpassDescriptionDepthStencilResolve,
+                      count_VkSubpassDescriptionDepthStencilResolveKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceDepthStencilResolveProperties,
+                      count_VkPhysicalDeviceDepthStencilResolvePropertiesKHR)
+
+#endif
+#ifdef VK_KHR_swapchain_mutable_format
+#endif
+#ifdef VK_KHR_timeline_semaphore
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceTimelineSemaphoreFeatures,
+                      count_VkPhysicalDeviceTimelineSemaphoreFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceTimelineSemaphoreProperties,
+                      count_VkPhysicalDeviceTimelineSemaphorePropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkSemaphoreTypeCreateInfo, count_VkSemaphoreTypeCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkTimelineSemaphoreSubmitInfo, count_VkTimelineSemaphoreSubmitInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkSemaphoreWaitInfo, count_VkSemaphoreWaitInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkSemaphoreSignalInfo, count_VkSemaphoreSignalInfoKHR)
+
+#endif
+#ifdef VK_KHR_vulkan_memory_model
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceVulkanMemoryModelFeatures,
+                      count_VkPhysicalDeviceVulkanMemoryModelFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_shader_terminate_invocation
+void count_VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+void count_VkFragmentShadingRateAttachmentInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkFragmentShadingRateAttachmentInfoKHR* toCount, size_t* count);
+
+void count_VkPipelineFragmentShadingRateStateCreateInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineFragmentShadingRateStateCreateInfoKHR* toCount, size_t* count);
+
+void count_VkPhysicalDeviceFragmentShadingRateFeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateFeaturesKHR* toCount, size_t* count);
+
+void count_VkPhysicalDeviceFragmentShadingRatePropertiesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRatePropertiesKHR* toCount, size_t* count);
+
+void count_VkPhysicalDeviceFragmentShadingRateKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateKHR* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_spirv_1_4
+#endif
+#ifdef VK_KHR_surface_protected_capabilities
+void count_VkSurfaceProtectedCapabilitiesKHR(uint32_t featureBits, VkStructureType rootType,
+                                             const VkSurfaceProtectedCapabilitiesKHR* toCount,
+                                             size_t* count);
+
+#endif
+#ifdef VK_KHR_separate_depth_stencil_layouts
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures,
+                      count_VkPhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkAttachmentReferenceStencilLayout,
+                      count_VkAttachmentReferenceStencilLayoutKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkAttachmentDescriptionStencilLayout,
+                      count_VkAttachmentDescriptionStencilLayoutKHR)
+
+#endif
+#ifdef VK_KHR_present_wait
+void count_VkPhysicalDevicePresentWaitFeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDevicePresentWaitFeaturesKHR* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_uniform_buffer_standard_layout
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceUniformBufferStandardLayoutFeatures,
+                      count_VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_buffer_device_address
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceBufferDeviceAddressFeatures,
+                      count_VkPhysicalDeviceBufferDeviceAddressFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkBufferDeviceAddressInfo, count_VkBufferDeviceAddressInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkBufferOpaqueCaptureAddressCreateInfo,
+                      count_VkBufferOpaqueCaptureAddressCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkMemoryOpaqueCaptureAddressAllocateInfo,
+                      count_VkMemoryOpaqueCaptureAddressAllocateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(count_VkDeviceMemoryOpaqueCaptureAddressInfo,
+                      count_VkDeviceMemoryOpaqueCaptureAddressInfoKHR)
+
+#endif
+#ifdef VK_KHR_deferred_host_operations
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+void count_VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR* toCount, size_t* count);
+
+void count_VkPipelineInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                             const VkPipelineInfoKHR* toCount, size_t* count);
+
+void count_VkPipelineExecutablePropertiesKHR(uint32_t featureBits, VkStructureType rootType,
+                                             const VkPipelineExecutablePropertiesKHR* toCount,
+                                             size_t* count);
+
+void count_VkPipelineExecutableInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                       const VkPipelineExecutableInfoKHR* toCount, size_t* count);
+
+void count_VkPipelineExecutableStatisticValueKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineExecutableStatisticValueKHR* toCount, size_t* count);
+
+void count_VkPipelineExecutableStatisticKHR(uint32_t featureBits, VkStructureType rootType,
+                                            const VkPipelineExecutableStatisticKHR* toCount,
+                                            size_t* count);
+
+void count_VkPipelineExecutableInternalRepresentationKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineExecutableInternalRepresentationKHR* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_shader_integer_dot_product
+void count_VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR* toCount, size_t* count);
+
+void count_VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_pipeline_library
+void count_VkPipelineLibraryCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                          const VkPipelineLibraryCreateInfoKHR* toCount,
+                                          size_t* count);
+
+#endif
+#ifdef VK_KHR_shader_non_semantic_info
+#endif
+#ifdef VK_KHR_present_id
+void count_VkPresentIdKHR(uint32_t featureBits, VkStructureType rootType,
+                          const VkPresentIdKHR* toCount, size_t* count);
+
+void count_VkPhysicalDevicePresentIdFeaturesKHR(uint32_t featureBits, VkStructureType rootType,
+                                                const VkPhysicalDevicePresentIdFeaturesKHR* toCount,
+                                                size_t* count);
+
+#endif
+#ifdef VK_KHR_video_encode_queue
+void count_VkVideoEncodeInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                const VkVideoEncodeInfoKHR* toCount, size_t* count);
+
+void count_VkVideoEncodeRateControlInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                           const VkVideoEncodeRateControlInfoKHR* toCount,
+                                           size_t* count);
+
+#endif
+#ifdef VK_KHR_synchronization2
+void count_VkMemoryBarrier2KHR(uint32_t featureBits, VkStructureType rootType,
+                               const VkMemoryBarrier2KHR* toCount, size_t* count);
+
+void count_VkBufferMemoryBarrier2KHR(uint32_t featureBits, VkStructureType rootType,
+                                     const VkBufferMemoryBarrier2KHR* toCount, size_t* count);
+
+void count_VkImageMemoryBarrier2KHR(uint32_t featureBits, VkStructureType rootType,
+                                    const VkImageMemoryBarrier2KHR* toCount, size_t* count);
+
+void count_VkDependencyInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                               const VkDependencyInfoKHR* toCount, size_t* count);
+
+void count_VkSemaphoreSubmitInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                    const VkSemaphoreSubmitInfoKHR* toCount, size_t* count);
+
+void count_VkCommandBufferSubmitInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                        const VkCommandBufferSubmitInfoKHR* toCount, size_t* count);
+
+void count_VkSubmitInfo2KHR(uint32_t featureBits, VkStructureType rootType,
+                            const VkSubmitInfo2KHR* toCount, size_t* count);
+
+void count_VkPhysicalDeviceSynchronization2FeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceSynchronization2FeaturesKHR* toCount, size_t* count);
+
+void count_VkQueueFamilyCheckpointProperties2NV(uint32_t featureBits, VkStructureType rootType,
+                                                const VkQueueFamilyCheckpointProperties2NV* toCount,
+                                                size_t* count);
+
+void count_VkCheckpointData2NV(uint32_t featureBits, VkStructureType rootType,
+                               const VkCheckpointData2NV* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_shader_subgroup_uniform_control_flow
+void count_VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_zero_initialize_workgroup_memory
+void count_VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_workgroup_memory_explicit_layout
+void count_VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_copy_commands2
+void count_VkBufferCopy2KHR(uint32_t featureBits, VkStructureType rootType,
+                            const VkBufferCopy2KHR* toCount, size_t* count);
+
+void count_VkCopyBufferInfo2KHR(uint32_t featureBits, VkStructureType rootType,
+                                const VkCopyBufferInfo2KHR* toCount, size_t* count);
+
+void count_VkImageCopy2KHR(uint32_t featureBits, VkStructureType rootType,
+                           const VkImageCopy2KHR* toCount, size_t* count);
+
+void count_VkCopyImageInfo2KHR(uint32_t featureBits, VkStructureType rootType,
+                               const VkCopyImageInfo2KHR* toCount, size_t* count);
+
+void count_VkBufferImageCopy2KHR(uint32_t featureBits, VkStructureType rootType,
+                                 const VkBufferImageCopy2KHR* toCount, size_t* count);
+
+void count_VkCopyBufferToImageInfo2KHR(uint32_t featureBits, VkStructureType rootType,
+                                       const VkCopyBufferToImageInfo2KHR* toCount, size_t* count);
+
+void count_VkCopyImageToBufferInfo2KHR(uint32_t featureBits, VkStructureType rootType,
+                                       const VkCopyImageToBufferInfo2KHR* toCount, size_t* count);
+
+void count_VkImageBlit2KHR(uint32_t featureBits, VkStructureType rootType,
+                           const VkImageBlit2KHR* toCount, size_t* count);
+
+void count_VkBlitImageInfo2KHR(uint32_t featureBits, VkStructureType rootType,
+                               const VkBlitImageInfo2KHR* toCount, size_t* count);
+
+void count_VkImageResolve2KHR(uint32_t featureBits, VkStructureType rootType,
+                              const VkImageResolve2KHR* toCount, size_t* count);
+
+void count_VkResolveImageInfo2KHR(uint32_t featureBits, VkStructureType rootType,
+                                  const VkResolveImageInfo2KHR* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_format_feature_flags2
+void count_VkFormatProperties3KHR(uint32_t featureBits, VkStructureType rootType,
+                                  const VkFormatProperties3KHR* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_maintenance4
+void count_VkPhysicalDeviceMaintenance4FeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceMaintenance4FeaturesKHR* toCount, size_t* count);
+
+void count_VkPhysicalDeviceMaintenance4PropertiesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceMaintenance4PropertiesKHR* toCount, size_t* count);
+
+void count_VkDeviceBufferMemoryRequirementsKHR(uint32_t featureBits, VkStructureType rootType,
+                                               const VkDeviceBufferMemoryRequirementsKHR* toCount,
+                                               size_t* count);
+
+void count_VkDeviceImageMemoryRequirementsKHR(uint32_t featureBits, VkStructureType rootType,
+                                              const VkDeviceImageMemoryRequirementsKHR* toCount,
+                                              size_t* count);
+
+#endif
+#ifdef VK_ANDROID_native_buffer
+void count_VkNativeBufferANDROID(uint32_t featureBits, VkStructureType rootType,
+                                 const VkNativeBufferANDROID* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_debug_report
+void count_VkDebugReportCallbackCreateInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                              const VkDebugReportCallbackCreateInfoEXT* toCount,
+                                              size_t* count);
+
+#endif
+#ifdef VK_NV_glsl_shader
+#endif
+#ifdef VK_EXT_depth_range_unrestricted
+#endif
+#ifdef VK_IMG_filter_cubic
+#endif
+#ifdef VK_AMD_rasterization_order
+void count_VkPipelineRasterizationStateRasterizationOrderAMD(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineRasterizationStateRasterizationOrderAMD* toCount, size_t* count);
+
+#endif
+#ifdef VK_AMD_shader_trinary_minmax
+#endif
+#ifdef VK_AMD_shader_explicit_vertex_parameter
+#endif
+#ifdef VK_EXT_debug_marker
+void count_VkDebugMarkerObjectNameInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                          const VkDebugMarkerObjectNameInfoEXT* toCount,
+                                          size_t* count);
+
+void count_VkDebugMarkerObjectTagInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                         const VkDebugMarkerObjectTagInfoEXT* toCount,
+                                         size_t* count);
+
+void count_VkDebugMarkerMarkerInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                      const VkDebugMarkerMarkerInfoEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_AMD_gcn_shader
+#endif
+#ifdef VK_NV_dedicated_allocation
+void count_VkDedicatedAllocationImageCreateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkDedicatedAllocationImageCreateInfoNV* toCount, size_t* count);
+
+void count_VkDedicatedAllocationBufferCreateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkDedicatedAllocationBufferCreateInfoNV* toCount, size_t* count);
+
+void count_VkDedicatedAllocationMemoryAllocateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkDedicatedAllocationMemoryAllocateInfoNV* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_transform_feedback
+void count_VkPhysicalDeviceTransformFeedbackFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceTransformFeedbackFeaturesEXT* toCount, size_t* count);
+
+void count_VkPhysicalDeviceTransformFeedbackPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceTransformFeedbackPropertiesEXT* toCount, size_t* count);
+
+void count_VkPipelineRasterizationStateStreamCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineRasterizationStateStreamCreateInfoEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_NVX_binary_import
+void count_VkCuModuleCreateInfoNVX(uint32_t featureBits, VkStructureType rootType,
+                                   const VkCuModuleCreateInfoNVX* toCount, size_t* count);
+
+void count_VkCuFunctionCreateInfoNVX(uint32_t featureBits, VkStructureType rootType,
+                                     const VkCuFunctionCreateInfoNVX* toCount, size_t* count);
+
+void count_VkCuLaunchInfoNVX(uint32_t featureBits, VkStructureType rootType,
+                             const VkCuLaunchInfoNVX* toCount, size_t* count);
+
+#endif
+#ifdef VK_NVX_image_view_handle
+void count_VkImageViewHandleInfoNVX(uint32_t featureBits, VkStructureType rootType,
+                                    const VkImageViewHandleInfoNVX* toCount, size_t* count);
+
+void count_VkImageViewAddressPropertiesNVX(uint32_t featureBits, VkStructureType rootType,
+                                           const VkImageViewAddressPropertiesNVX* toCount,
+                                           size_t* count);
+
+#endif
+#ifdef VK_AMD_draw_indirect_count
+#endif
+#ifdef VK_AMD_negative_viewport_height
+#endif
+#ifdef VK_AMD_gpu_shader_half_float
+#endif
+#ifdef VK_AMD_shader_ballot
+#endif
+#ifdef VK_EXT_video_encode_h264
+void count_VkVideoEncodeH264CapabilitiesEXT(uint32_t featureBits, VkStructureType rootType,
+                                            const VkVideoEncodeH264CapabilitiesEXT* toCount,
+                                            size_t* count);
+
+void count_VkVideoEncodeH264SessionCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoEncodeH264SessionCreateInfoEXT* toCount, size_t* count);
+
+void count_VkVideoEncodeH264SessionParametersAddInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoEncodeH264SessionParametersAddInfoEXT* toCount, size_t* count);
+
+void count_VkVideoEncodeH264SessionParametersCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoEncodeH264SessionParametersCreateInfoEXT* toCount, size_t* count);
+
+void count_VkVideoEncodeH264DpbSlotInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                           const VkVideoEncodeH264DpbSlotInfoEXT* toCount,
+                                           size_t* count);
+
+void count_VkVideoEncodeH264NaluSliceEXT(uint32_t featureBits, VkStructureType rootType,
+                                         const VkVideoEncodeH264NaluSliceEXT* toCount,
+                                         size_t* count);
+
+void count_VkVideoEncodeH264VclFrameInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                            const VkVideoEncodeH264VclFrameInfoEXT* toCount,
+                                            size_t* count);
+
+void count_VkVideoEncodeH264EmitPictureParametersEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoEncodeH264EmitPictureParametersEXT* toCount, size_t* count);
+
+void count_VkVideoEncodeH264ProfileEXT(uint32_t featureBits, VkStructureType rootType,
+                                       const VkVideoEncodeH264ProfileEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_video_encode_h265
+void count_VkVideoEncodeH265CapabilitiesEXT(uint32_t featureBits, VkStructureType rootType,
+                                            const VkVideoEncodeH265CapabilitiesEXT* toCount,
+                                            size_t* count);
+
+void count_VkVideoEncodeH265SessionCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoEncodeH265SessionCreateInfoEXT* toCount, size_t* count);
+
+void count_VkVideoEncodeH265SessionParametersAddInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoEncodeH265SessionParametersAddInfoEXT* toCount, size_t* count);
+
+void count_VkVideoEncodeH265SessionParametersCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoEncodeH265SessionParametersCreateInfoEXT* toCount, size_t* count);
+
+void count_VkVideoEncodeH265DpbSlotInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                           const VkVideoEncodeH265DpbSlotInfoEXT* toCount,
+                                           size_t* count);
+
+void count_VkVideoEncodeH265ReferenceListsEXT(uint32_t featureBits, VkStructureType rootType,
+                                              const VkVideoEncodeH265ReferenceListsEXT* toCount,
+                                              size_t* count);
+
+void count_VkVideoEncodeH265NaluSliceEXT(uint32_t featureBits, VkStructureType rootType,
+                                         const VkVideoEncodeH265NaluSliceEXT* toCount,
+                                         size_t* count);
+
+void count_VkVideoEncodeH265VclFrameInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                            const VkVideoEncodeH265VclFrameInfoEXT* toCount,
+                                            size_t* count);
+
+void count_VkVideoEncodeH265EmitPictureParametersEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoEncodeH265EmitPictureParametersEXT* toCount, size_t* count);
+
+void count_VkVideoEncodeH265ProfileEXT(uint32_t featureBits, VkStructureType rootType,
+                                       const VkVideoEncodeH265ProfileEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_video_decode_h264
+void count_VkVideoDecodeH264ProfileEXT(uint32_t featureBits, VkStructureType rootType,
+                                       const VkVideoDecodeH264ProfileEXT* toCount, size_t* count);
+
+void count_VkVideoDecodeH264CapabilitiesEXT(uint32_t featureBits, VkStructureType rootType,
+                                            const VkVideoDecodeH264CapabilitiesEXT* toCount,
+                                            size_t* count);
+
+void count_VkVideoDecodeH264SessionCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoDecodeH264SessionCreateInfoEXT* toCount, size_t* count);
+
+void count_VkVideoDecodeH264SessionParametersAddInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoDecodeH264SessionParametersAddInfoEXT* toCount, size_t* count);
+
+void count_VkVideoDecodeH264SessionParametersCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoDecodeH264SessionParametersCreateInfoEXT* toCount, size_t* count);
+
+void count_VkVideoDecodeH264PictureInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                           const VkVideoDecodeH264PictureInfoEXT* toCount,
+                                           size_t* count);
+
+void count_VkVideoDecodeH264MvcEXT(uint32_t featureBits, VkStructureType rootType,
+                                   const VkVideoDecodeH264MvcEXT* toCount, size_t* count);
+
+void count_VkVideoDecodeH264DpbSlotInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                           const VkVideoDecodeH264DpbSlotInfoEXT* toCount,
+                                           size_t* count);
+
+#endif
+#ifdef VK_AMD_texture_gather_bias_lod
+void count_VkTextureLODGatherFormatPropertiesAMD(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkTextureLODGatherFormatPropertiesAMD* toCount, size_t* count);
+
+#endif
+#ifdef VK_AMD_shader_info
+void count_VkShaderResourceUsageAMD(uint32_t featureBits, VkStructureType rootType,
+                                    const VkShaderResourceUsageAMD* toCount, size_t* count);
+
+void count_VkShaderStatisticsInfoAMD(uint32_t featureBits, VkStructureType rootType,
+                                     const VkShaderStatisticsInfoAMD* toCount, size_t* count);
+
+#endif
+#ifdef VK_AMD_shader_image_load_store_lod
+#endif
+#ifdef VK_GGP_stream_descriptor_surface
+void count_VkStreamDescriptorSurfaceCreateInfoGGP(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkStreamDescriptorSurfaceCreateInfoGGP* toCount, size_t* count);
+
+#endif
+#ifdef VK_NV_corner_sampled_image
+void count_VkPhysicalDeviceCornerSampledImageFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceCornerSampledImageFeaturesNV* toCount, size_t* count);
+
+#endif
+#ifdef VK_IMG_format_pvrtc
+#endif
+#ifdef VK_NV_external_memory_capabilities
+void count_VkExternalImageFormatPropertiesNV(uint32_t featureBits, VkStructureType rootType,
+                                             const VkExternalImageFormatPropertiesNV* toCount,
+                                             size_t* count);
+
+#endif
+#ifdef VK_NV_external_memory
+void count_VkExternalMemoryImageCreateInfoNV(uint32_t featureBits, VkStructureType rootType,
+                                             const VkExternalMemoryImageCreateInfoNV* toCount,
+                                             size_t* count);
+
+void count_VkExportMemoryAllocateInfoNV(uint32_t featureBits, VkStructureType rootType,
+                                        const VkExportMemoryAllocateInfoNV* toCount, size_t* count);
+
+#endif
+#ifdef VK_NV_external_memory_win32
+void count_VkImportMemoryWin32HandleInfoNV(uint32_t featureBits, VkStructureType rootType,
+                                           const VkImportMemoryWin32HandleInfoNV* toCount,
+                                           size_t* count);
+
+void count_VkExportMemoryWin32HandleInfoNV(uint32_t featureBits, VkStructureType rootType,
+                                           const VkExportMemoryWin32HandleInfoNV* toCount,
+                                           size_t* count);
+
+#endif
+#ifdef VK_NV_win32_keyed_mutex
+void count_VkWin32KeyedMutexAcquireReleaseInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkWin32KeyedMutexAcquireReleaseInfoNV* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_validation_flags
+void count_VkValidationFlagsEXT(uint32_t featureBits, VkStructureType rootType,
+                                const VkValidationFlagsEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_NN_vi_surface
+void count_VkViSurfaceCreateInfoNN(uint32_t featureBits, VkStructureType rootType,
+                                   const VkViSurfaceCreateInfoNN* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_shader_subgroup_ballot
+#endif
+#ifdef VK_EXT_shader_subgroup_vote
+#endif
+#ifdef VK_EXT_texture_compression_astc_hdr
+void count_VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_astc_decode_mode
+void count_VkImageViewASTCDecodeModeEXT(uint32_t featureBits, VkStructureType rootType,
+                                        const VkImageViewASTCDecodeModeEXT* toCount, size_t* count);
+
+void count_VkPhysicalDeviceASTCDecodeFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceASTCDecodeFeaturesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_conditional_rendering
+void count_VkConditionalRenderingBeginInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                              const VkConditionalRenderingBeginInfoEXT* toCount,
+                                              size_t* count);
+
+void count_VkPhysicalDeviceConditionalRenderingFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceConditionalRenderingFeaturesEXT* toCount, size_t* count);
+
+void count_VkCommandBufferInheritanceConditionalRenderingInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkCommandBufferInheritanceConditionalRenderingInfoEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+void count_VkViewportWScalingNV(uint32_t featureBits, VkStructureType rootType,
+                                const VkViewportWScalingNV* toCount, size_t* count);
+
+void count_VkPipelineViewportWScalingStateCreateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineViewportWScalingStateCreateInfoNV* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_direct_mode_display
+#endif
+#ifdef VK_EXT_acquire_xlib_display
+#endif
+#ifdef VK_EXT_display_surface_counter
+void count_VkSurfaceCapabilities2EXT(uint32_t featureBits, VkStructureType rootType,
+                                     const VkSurfaceCapabilities2EXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_display_control
+void count_VkDisplayPowerInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                 const VkDisplayPowerInfoEXT* toCount, size_t* count);
+
+void count_VkDeviceEventInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                const VkDeviceEventInfoEXT* toCount, size_t* count);
+
+void count_VkDisplayEventInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                 const VkDisplayEventInfoEXT* toCount, size_t* count);
+
+void count_VkSwapchainCounterCreateInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                           const VkSwapchainCounterCreateInfoEXT* toCount,
+                                           size_t* count);
+
+#endif
+#ifdef VK_GOOGLE_display_timing
+void count_VkRefreshCycleDurationGOOGLE(uint32_t featureBits, VkStructureType rootType,
+                                        const VkRefreshCycleDurationGOOGLE* toCount, size_t* count);
+
+void count_VkPastPresentationTimingGOOGLE(uint32_t featureBits, VkStructureType rootType,
+                                          const VkPastPresentationTimingGOOGLE* toCount,
+                                          size_t* count);
+
+void count_VkPresentTimeGOOGLE(uint32_t featureBits, VkStructureType rootType,
+                               const VkPresentTimeGOOGLE* toCount, size_t* count);
+
+void count_VkPresentTimesInfoGOOGLE(uint32_t featureBits, VkStructureType rootType,
+                                    const VkPresentTimesInfoGOOGLE* toCount, size_t* count);
+
+#endif
+#ifdef VK_NV_sample_mask_override_coverage
+#endif
+#ifdef VK_NV_geometry_shader_passthrough
+#endif
+#ifdef VK_NV_viewport_array2
+#endif
+#ifdef VK_NVX_multiview_per_view_attributes
+void count_VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX* toCount, size_t* count);
+
+#endif
+#ifdef VK_NV_viewport_swizzle
+void count_VkViewportSwizzleNV(uint32_t featureBits, VkStructureType rootType,
+                               const VkViewportSwizzleNV* toCount, size_t* count);
+
+void count_VkPipelineViewportSwizzleStateCreateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineViewportSwizzleStateCreateInfoNV* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_discard_rectangles
+void count_VkPhysicalDeviceDiscardRectanglePropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceDiscardRectanglePropertiesEXT* toCount, size_t* count);
+
+void count_VkPipelineDiscardRectangleStateCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineDiscardRectangleStateCreateInfoEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_conservative_rasterization
+void count_VkPhysicalDeviceConservativeRasterizationPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceConservativeRasterizationPropertiesEXT* toCount, size_t* count);
+
+void count_VkPipelineRasterizationConservativeStateCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineRasterizationConservativeStateCreateInfoEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_depth_clip_enable
+void count_VkPhysicalDeviceDepthClipEnableFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceDepthClipEnableFeaturesEXT* toCount, size_t* count);
+
+void count_VkPipelineRasterizationDepthClipStateCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineRasterizationDepthClipStateCreateInfoEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_swapchain_colorspace
+#endif
+#ifdef VK_EXT_hdr_metadata
+void count_VkXYColorEXT(uint32_t featureBits, VkStructureType rootType, const VkXYColorEXT* toCount,
+                        size_t* count);
+
+void count_VkHdrMetadataEXT(uint32_t featureBits, VkStructureType rootType,
+                            const VkHdrMetadataEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_MVK_ios_surface
+void count_VkIOSSurfaceCreateInfoMVK(uint32_t featureBits, VkStructureType rootType,
+                                     const VkIOSSurfaceCreateInfoMVK* toCount, size_t* count);
+
+#endif
+#ifdef VK_MVK_macos_surface
+void count_VkMacOSSurfaceCreateInfoMVK(uint32_t featureBits, VkStructureType rootType,
+                                       const VkMacOSSurfaceCreateInfoMVK* toCount, size_t* count);
+
+#endif
+#ifdef VK_MVK_moltenvk
+#endif
+#ifdef VK_EXT_external_memory_dma_buf
+#endif
+#ifdef VK_EXT_queue_family_foreign
+#endif
+#ifdef VK_EXT_debug_utils
+void count_VkDebugUtilsLabelEXT(uint32_t featureBits, VkStructureType rootType,
+                                const VkDebugUtilsLabelEXT* toCount, size_t* count);
+
+void count_VkDebugUtilsObjectNameInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                         const VkDebugUtilsObjectNameInfoEXT* toCount,
+                                         size_t* count);
+
+void count_VkDebugUtilsMessengerCallbackDataEXT(uint32_t featureBits, VkStructureType rootType,
+                                                const VkDebugUtilsMessengerCallbackDataEXT* toCount,
+                                                size_t* count);
+
+void count_VkDebugUtilsMessengerCreateInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                              const VkDebugUtilsMessengerCreateInfoEXT* toCount,
+                                              size_t* count);
+
+void count_VkDebugUtilsObjectTagInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                        const VkDebugUtilsObjectTagInfoEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+void count_VkAndroidHardwareBufferUsageANDROID(uint32_t featureBits, VkStructureType rootType,
+                                               const VkAndroidHardwareBufferUsageANDROID* toCount,
+                                               size_t* count);
+
+void count_VkAndroidHardwareBufferPropertiesANDROID(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAndroidHardwareBufferPropertiesANDROID* toCount, size_t* count);
+
+void count_VkAndroidHardwareBufferFormatPropertiesANDROID(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAndroidHardwareBufferFormatPropertiesANDROID* toCount, size_t* count);
+
+void count_VkImportAndroidHardwareBufferInfoANDROID(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkImportAndroidHardwareBufferInfoANDROID* toCount, size_t* count);
+
+void count_VkMemoryGetAndroidHardwareBufferInfoANDROID(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkMemoryGetAndroidHardwareBufferInfoANDROID* toCount, size_t* count);
+
+void count_VkExternalFormatANDROID(uint32_t featureBits, VkStructureType rootType,
+                                   const VkExternalFormatANDROID* toCount, size_t* count);
+
+void count_VkAndroidHardwareBufferFormatProperties2ANDROID(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAndroidHardwareBufferFormatProperties2ANDROID* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_sampler_filter_minmax
+DEFINE_ALIAS_FUNCTION(count_VkSamplerReductionModeCreateInfo,
+                      count_VkSamplerReductionModeCreateInfoEXT)
+
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceSamplerFilterMinmaxProperties,
+                      count_VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT)
+
+#endif
+#ifdef VK_AMD_gpu_shader_int16
+#endif
+#ifdef VK_AMD_mixed_attachment_samples
+#endif
+#ifdef VK_AMD_shader_fragment_mask
+#endif
+#ifdef VK_EXT_inline_uniform_block
+void count_VkPhysicalDeviceInlineUniformBlockFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceInlineUniformBlockFeaturesEXT* toCount, size_t* count);
+
+void count_VkPhysicalDeviceInlineUniformBlockPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceInlineUniformBlockPropertiesEXT* toCount, size_t* count);
+
+void count_VkWriteDescriptorSetInlineUniformBlockEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkWriteDescriptorSetInlineUniformBlockEXT* toCount, size_t* count);
+
+void count_VkDescriptorPoolInlineUniformBlockCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkDescriptorPoolInlineUniformBlockCreateInfoEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_shader_stencil_export
+#endif
+#ifdef VK_EXT_sample_locations
+void count_VkSampleLocationEXT(uint32_t featureBits, VkStructureType rootType,
+                               const VkSampleLocationEXT* toCount, size_t* count);
+
+void count_VkSampleLocationsInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                    const VkSampleLocationsInfoEXT* toCount, size_t* count);
+
+void count_VkAttachmentSampleLocationsEXT(uint32_t featureBits, VkStructureType rootType,
+                                          const VkAttachmentSampleLocationsEXT* toCount,
+                                          size_t* count);
+
+void count_VkSubpassSampleLocationsEXT(uint32_t featureBits, VkStructureType rootType,
+                                       const VkSubpassSampleLocationsEXT* toCount, size_t* count);
+
+void count_VkRenderPassSampleLocationsBeginInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkRenderPassSampleLocationsBeginInfoEXT* toCount, size_t* count);
+
+void count_VkPipelineSampleLocationsStateCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineSampleLocationsStateCreateInfoEXT* toCount, size_t* count);
+
+void count_VkPhysicalDeviceSampleLocationsPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceSampleLocationsPropertiesEXT* toCount, size_t* count);
+
+void count_VkMultisamplePropertiesEXT(uint32_t featureBits, VkStructureType rootType,
+                                      const VkMultisamplePropertiesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_blend_operation_advanced
+void count_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT* toCount, size_t* count);
+
+void count_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT* toCount, size_t* count);
+
+void count_VkPipelineColorBlendAdvancedStateCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineColorBlendAdvancedStateCreateInfoEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_NV_fragment_coverage_to_color
+void count_VkPipelineCoverageToColorStateCreateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineCoverageToColorStateCreateInfoNV* toCount, size_t* count);
+
+#endif
+#ifdef VK_NV_framebuffer_mixed_samples
+void count_VkPipelineCoverageModulationStateCreateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineCoverageModulationStateCreateInfoNV* toCount, size_t* count);
+
+#endif
+#ifdef VK_NV_fill_rectangle
+#endif
+#ifdef VK_NV_shader_sm_builtins
+void count_VkPhysicalDeviceShaderSMBuiltinsPropertiesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSMBuiltinsPropertiesNV* toCount, size_t* count);
+
+void count_VkPhysicalDeviceShaderSMBuiltinsFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSMBuiltinsFeaturesNV* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_post_depth_coverage
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+void count_VkDrmFormatModifierPropertiesEXT(uint32_t featureBits, VkStructureType rootType,
+                                            const VkDrmFormatModifierPropertiesEXT* toCount,
+                                            size_t* count);
+
+void count_VkDrmFormatModifierPropertiesListEXT(uint32_t featureBits, VkStructureType rootType,
+                                                const VkDrmFormatModifierPropertiesListEXT* toCount,
+                                                size_t* count);
+
+void count_VkPhysicalDeviceImageDrmFormatModifierInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceImageDrmFormatModifierInfoEXT* toCount, size_t* count);
+
+void count_VkImageDrmFormatModifierListCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkImageDrmFormatModifierListCreateInfoEXT* toCount, size_t* count);
+
+void count_VkImageDrmFormatModifierExplicitCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkImageDrmFormatModifierExplicitCreateInfoEXT* toCount, size_t* count);
+
+void count_VkImageDrmFormatModifierPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkImageDrmFormatModifierPropertiesEXT* toCount, size_t* count);
+
+void count_VkDrmFormatModifierProperties2EXT(uint32_t featureBits, VkStructureType rootType,
+                                             const VkDrmFormatModifierProperties2EXT* toCount,
+                                             size_t* count);
+
+void count_VkDrmFormatModifierPropertiesList2EXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkDrmFormatModifierPropertiesList2EXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_validation_cache
+void count_VkValidationCacheCreateInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                          const VkValidationCacheCreateInfoEXT* toCount,
+                                          size_t* count);
+
+void count_VkShaderModuleValidationCacheCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkShaderModuleValidationCacheCreateInfoEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_descriptor_indexing
+DEFINE_ALIAS_FUNCTION(count_VkDescriptorSetLayoutBindingFlagsCreateInfo,
+                      count_VkDescriptorSetLayoutBindingFlagsCreateInfoEXT)
+
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceDescriptorIndexingFeatures,
+                      count_VkPhysicalDeviceDescriptorIndexingFeaturesEXT)
+
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceDescriptorIndexingProperties,
+                      count_VkPhysicalDeviceDescriptorIndexingPropertiesEXT)
+
+DEFINE_ALIAS_FUNCTION(count_VkDescriptorSetVariableDescriptorCountAllocateInfo,
+                      count_VkDescriptorSetVariableDescriptorCountAllocateInfoEXT)
+
+DEFINE_ALIAS_FUNCTION(count_VkDescriptorSetVariableDescriptorCountLayoutSupport,
+                      count_VkDescriptorSetVariableDescriptorCountLayoutSupportEXT)
+
+#endif
+#ifdef VK_EXT_shader_viewport_index_layer
+#endif
+#ifdef VK_NV_shading_rate_image
+void count_VkShadingRatePaletteNV(uint32_t featureBits, VkStructureType rootType,
+                                  const VkShadingRatePaletteNV* toCount, size_t* count);
+
+void count_VkPipelineViewportShadingRateImageStateCreateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineViewportShadingRateImageStateCreateInfoNV* toCount, size_t* count);
+
+void count_VkPhysicalDeviceShadingRateImageFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShadingRateImageFeaturesNV* toCount, size_t* count);
+
+void count_VkPhysicalDeviceShadingRateImagePropertiesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShadingRateImagePropertiesNV* toCount, size_t* count);
+
+void count_VkCoarseSampleLocationNV(uint32_t featureBits, VkStructureType rootType,
+                                    const VkCoarseSampleLocationNV* toCount, size_t* count);
+
+void count_VkCoarseSampleOrderCustomNV(uint32_t featureBits, VkStructureType rootType,
+                                       const VkCoarseSampleOrderCustomNV* toCount, size_t* count);
+
+void count_VkPipelineViewportCoarseSampleOrderStateCreateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineViewportCoarseSampleOrderStateCreateInfoNV* toCount, size_t* count);
+
+#endif
+#ifdef VK_NV_ray_tracing
+void count_VkRayTracingShaderGroupCreateInfoNV(uint32_t featureBits, VkStructureType rootType,
+                                               const VkRayTracingShaderGroupCreateInfoNV* toCount,
+                                               size_t* count);
+
+void count_VkRayTracingPipelineCreateInfoNV(uint32_t featureBits, VkStructureType rootType,
+                                            const VkRayTracingPipelineCreateInfoNV* toCount,
+                                            size_t* count);
+
+void count_VkGeometryTrianglesNV(uint32_t featureBits, VkStructureType rootType,
+                                 const VkGeometryTrianglesNV* toCount, size_t* count);
+
+void count_VkGeometryAABBNV(uint32_t featureBits, VkStructureType rootType,
+                            const VkGeometryAABBNV* toCount, size_t* count);
+
+void count_VkGeometryDataNV(uint32_t featureBits, VkStructureType rootType,
+                            const VkGeometryDataNV* toCount, size_t* count);
+
+void count_VkGeometryNV(uint32_t featureBits, VkStructureType rootType, const VkGeometryNV* toCount,
+                        size_t* count);
+
+void count_VkAccelerationStructureInfoNV(uint32_t featureBits, VkStructureType rootType,
+                                         const VkAccelerationStructureInfoNV* toCount,
+                                         size_t* count);
+
+void count_VkAccelerationStructureCreateInfoNV(uint32_t featureBits, VkStructureType rootType,
+                                               const VkAccelerationStructureCreateInfoNV* toCount,
+                                               size_t* count);
+
+void count_VkBindAccelerationStructureMemoryInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkBindAccelerationStructureMemoryInfoNV* toCount, size_t* count);
+
+void count_VkWriteDescriptorSetAccelerationStructureNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkWriteDescriptorSetAccelerationStructureNV* toCount, size_t* count);
+
+void count_VkAccelerationStructureMemoryRequirementsInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureMemoryRequirementsInfoNV* toCount, size_t* count);
+
+void count_VkPhysicalDeviceRayTracingPropertiesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingPropertiesNV* toCount, size_t* count);
+
+void count_VkTransformMatrixKHR(uint32_t featureBits, VkStructureType rootType,
+                                const VkTransformMatrixKHR* toCount, size_t* count);
+
+DEFINE_ALIAS_FUNCTION(count_VkTransformMatrixKHR, count_VkTransformMatrixNV)
+
+void count_VkAabbPositionsKHR(uint32_t featureBits, VkStructureType rootType,
+                              const VkAabbPositionsKHR* toCount, size_t* count);
+
+DEFINE_ALIAS_FUNCTION(count_VkAabbPositionsKHR, count_VkAabbPositionsNV)
+
+void count_VkAccelerationStructureInstanceKHR(uint32_t featureBits, VkStructureType rootType,
+                                              const VkAccelerationStructureInstanceKHR* toCount,
+                                              size_t* count);
+
+DEFINE_ALIAS_FUNCTION(count_VkAccelerationStructureInstanceKHR,
+                      count_VkAccelerationStructureInstanceNV)
+
+#endif
+#ifdef VK_NV_representative_fragment_test
+void count_VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV* toCount, size_t* count);
+
+void count_VkPipelineRepresentativeFragmentTestStateCreateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineRepresentativeFragmentTestStateCreateInfoNV* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_filter_cubic
+void count_VkPhysicalDeviceImageViewImageFormatInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceImageViewImageFormatInfoEXT* toCount, size_t* count);
+
+void count_VkFilterCubicImageViewImageFormatPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkFilterCubicImageViewImageFormatPropertiesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_QCOM_render_pass_shader_resolve
+#endif
+#ifdef VK_EXT_global_priority
+void count_VkDeviceQueueGlobalPriorityCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkDeviceQueueGlobalPriorityCreateInfoEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_external_memory_host
+void count_VkImportMemoryHostPointerInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                            const VkImportMemoryHostPointerInfoEXT* toCount,
+                                            size_t* count);
+
+void count_VkMemoryHostPointerPropertiesEXT(uint32_t featureBits, VkStructureType rootType,
+                                            const VkMemoryHostPointerPropertiesEXT* toCount,
+                                            size_t* count);
+
+void count_VkPhysicalDeviceExternalMemoryHostPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceExternalMemoryHostPropertiesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_AMD_buffer_marker
+#endif
+#ifdef VK_AMD_pipeline_compiler_control
+void count_VkPipelineCompilerControlCreateInfoAMD(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineCompilerControlCreateInfoAMD* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_calibrated_timestamps
+void count_VkCalibratedTimestampInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                        const VkCalibratedTimestampInfoEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_AMD_shader_core_properties
+void count_VkPhysicalDeviceShaderCorePropertiesAMD(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderCorePropertiesAMD* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_video_decode_h265
+void count_VkVideoDecodeH265ProfileEXT(uint32_t featureBits, VkStructureType rootType,
+                                       const VkVideoDecodeH265ProfileEXT* toCount, size_t* count);
+
+void count_VkVideoDecodeH265CapabilitiesEXT(uint32_t featureBits, VkStructureType rootType,
+                                            const VkVideoDecodeH265CapabilitiesEXT* toCount,
+                                            size_t* count);
+
+void count_VkVideoDecodeH265SessionCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoDecodeH265SessionCreateInfoEXT* toCount, size_t* count);
+
+void count_VkVideoDecodeH265SessionParametersAddInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoDecodeH265SessionParametersAddInfoEXT* toCount, size_t* count);
+
+void count_VkVideoDecodeH265SessionParametersCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVideoDecodeH265SessionParametersCreateInfoEXT* toCount, size_t* count);
+
+void count_VkVideoDecodeH265PictureInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                           const VkVideoDecodeH265PictureInfoEXT* toCount,
+                                           size_t* count);
+
+void count_VkVideoDecodeH265DpbSlotInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                           const VkVideoDecodeH265DpbSlotInfoEXT* toCount,
+                                           size_t* count);
+
+#endif
+#ifdef VK_AMD_memory_overallocation_behavior
+void count_VkDeviceMemoryOverallocationCreateInfoAMD(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkDeviceMemoryOverallocationCreateInfoAMD* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_vertex_attribute_divisor
+void count_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT* toCount, size_t* count);
+
+void count_VkVertexInputBindingDivisorDescriptionEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVertexInputBindingDivisorDescriptionEXT* toCount, size_t* count);
+
+void count_VkPipelineVertexInputDivisorStateCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineVertexInputDivisorStateCreateInfoEXT* toCount, size_t* count);
+
+void count_VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_GGP_frame_token
+void count_VkPresentFrameTokenGGP(uint32_t featureBits, VkStructureType rootType,
+                                  const VkPresentFrameTokenGGP* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_pipeline_creation_feedback
+void count_VkPipelineCreationFeedbackEXT(uint32_t featureBits, VkStructureType rootType,
+                                         const VkPipelineCreationFeedbackEXT* toCount,
+                                         size_t* count);
+
+void count_VkPipelineCreationFeedbackCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineCreationFeedbackCreateInfoEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_NV_shader_subgroup_partitioned
+#endif
+#ifdef VK_NV_compute_shader_derivatives
+void count_VkPhysicalDeviceComputeShaderDerivativesFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceComputeShaderDerivativesFeaturesNV* toCount, size_t* count);
+
+#endif
+#ifdef VK_NV_mesh_shader
+void count_VkPhysicalDeviceMeshShaderFeaturesNV(uint32_t featureBits, VkStructureType rootType,
+                                                const VkPhysicalDeviceMeshShaderFeaturesNV* toCount,
+                                                size_t* count);
+
+void count_VkPhysicalDeviceMeshShaderPropertiesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceMeshShaderPropertiesNV* toCount, size_t* count);
+
+void count_VkDrawMeshTasksIndirectCommandNV(uint32_t featureBits, VkStructureType rootType,
+                                            const VkDrawMeshTasksIndirectCommandNV* toCount,
+                                            size_t* count);
+
+#endif
+#ifdef VK_NV_fragment_shader_barycentric
+void count_VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV* toCount, size_t* count);
+
+#endif
+#ifdef VK_NV_shader_image_footprint
+void count_VkPhysicalDeviceShaderImageFootprintFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderImageFootprintFeaturesNV* toCount, size_t* count);
+
+#endif
+#ifdef VK_NV_scissor_exclusive
+void count_VkPipelineViewportExclusiveScissorStateCreateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineViewportExclusiveScissorStateCreateInfoNV* toCount, size_t* count);
+
+void count_VkPhysicalDeviceExclusiveScissorFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceExclusiveScissorFeaturesNV* toCount, size_t* count);
+
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+void count_VkQueueFamilyCheckpointPropertiesNV(uint32_t featureBits, VkStructureType rootType,
+                                               const VkQueueFamilyCheckpointPropertiesNV* toCount,
+                                               size_t* count);
+
+void count_VkCheckpointDataNV(uint32_t featureBits, VkStructureType rootType,
+                              const VkCheckpointDataNV* toCount, size_t* count);
+
+#endif
+#ifdef VK_INTEL_shader_integer_functions2
+void count_VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL* toCount, size_t* count);
+
+#endif
+#ifdef VK_INTEL_performance_query
+void count_VkPerformanceValueDataINTEL(uint32_t featureBits, VkStructureType rootType,
+                                       const VkPerformanceValueDataINTEL* toCount, size_t* count);
+
+void count_VkPerformanceValueINTEL(uint32_t featureBits, VkStructureType rootType,
+                                   const VkPerformanceValueINTEL* toCount, size_t* count);
+
+void count_VkInitializePerformanceApiInfoINTEL(uint32_t featureBits, VkStructureType rootType,
+                                               const VkInitializePerformanceApiInfoINTEL* toCount,
+                                               size_t* count);
+
+void count_VkQueryPoolPerformanceQueryCreateInfoINTEL(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkQueryPoolPerformanceQueryCreateInfoINTEL* toCount, size_t* count);
+
+DEFINE_ALIAS_FUNCTION(count_VkQueryPoolPerformanceQueryCreateInfoINTEL,
+                      count_VkQueryPoolCreateInfoINTEL)
+
+void count_VkPerformanceMarkerInfoINTEL(uint32_t featureBits, VkStructureType rootType,
+                                        const VkPerformanceMarkerInfoINTEL* toCount, size_t* count);
+
+void count_VkPerformanceStreamMarkerInfoINTEL(uint32_t featureBits, VkStructureType rootType,
+                                              const VkPerformanceStreamMarkerInfoINTEL* toCount,
+                                              size_t* count);
+
+void count_VkPerformanceOverrideInfoINTEL(uint32_t featureBits, VkStructureType rootType,
+                                          const VkPerformanceOverrideInfoINTEL* toCount,
+                                          size_t* count);
+
+void count_VkPerformanceConfigurationAcquireInfoINTEL(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPerformanceConfigurationAcquireInfoINTEL* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_pci_bus_info
+void count_VkPhysicalDevicePCIBusInfoPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDevicePCIBusInfoPropertiesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_AMD_display_native_hdr
+void count_VkDisplayNativeHdrSurfaceCapabilitiesAMD(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkDisplayNativeHdrSurfaceCapabilitiesAMD* toCount, size_t* count);
+
+void count_VkSwapchainDisplayNativeHdrCreateInfoAMD(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkSwapchainDisplayNativeHdrCreateInfoAMD* toCount, size_t* count);
+
+#endif
+#ifdef VK_FUCHSIA_imagepipe_surface
+void count_VkImagePipeSurfaceCreateInfoFUCHSIA(uint32_t featureBits, VkStructureType rootType,
+                                               const VkImagePipeSurfaceCreateInfoFUCHSIA* toCount,
+                                               size_t* count);
+
+#endif
+#ifdef VK_EXT_metal_surface
+void count_VkMetalSurfaceCreateInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                       const VkMetalSurfaceCreateInfoEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_fragment_density_map
+void count_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMapFeaturesEXT* toCount, size_t* count);
+
+void count_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMapPropertiesEXT* toCount, size_t* count);
+
+void count_VkRenderPassFragmentDensityMapCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkRenderPassFragmentDensityMapCreateInfoEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_scalar_block_layout
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceScalarBlockLayoutFeatures,
+                      count_VkPhysicalDeviceScalarBlockLayoutFeaturesEXT)
+
+#endif
+#ifdef VK_GOOGLE_hlsl_functionality1
+#endif
+#ifdef VK_GOOGLE_decorate_string
+#endif
+#ifdef VK_EXT_subgroup_size_control
+void count_VkPhysicalDeviceSubgroupSizeControlFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceSubgroupSizeControlFeaturesEXT* toCount, size_t* count);
+
+void count_VkPhysicalDeviceSubgroupSizeControlPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceSubgroupSizeControlPropertiesEXT* toCount, size_t* count);
+
+void count_VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_AMD_shader_core_properties2
+void count_VkPhysicalDeviceShaderCoreProperties2AMD(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderCoreProperties2AMD* toCount, size_t* count);
+
+#endif
+#ifdef VK_AMD_device_coherent_memory
+void count_VkPhysicalDeviceCoherentMemoryFeaturesAMD(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceCoherentMemoryFeaturesAMD* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_shader_image_atomic_int64
+void count_VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_memory_budget
+void count_VkPhysicalDeviceMemoryBudgetPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceMemoryBudgetPropertiesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_memory_priority
+void count_VkPhysicalDeviceMemoryPriorityFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceMemoryPriorityFeaturesEXT* toCount, size_t* count);
+
+void count_VkMemoryPriorityAllocateInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                           const VkMemoryPriorityAllocateInfoEXT* toCount,
+                                           size_t* count);
+
+#endif
+#ifdef VK_NV_dedicated_allocation_image_aliasing
+void count_VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_buffer_device_address
+void count_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT* toCount, size_t* count);
+
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT,
+                      count_VkPhysicalDeviceBufferAddressFeaturesEXT)
+
+DEFINE_ALIAS_FUNCTION(count_VkBufferDeviceAddressInfo, count_VkBufferDeviceAddressInfoEXT)
+
+void count_VkBufferDeviceAddressCreateInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                              const VkBufferDeviceAddressCreateInfoEXT* toCount,
+                                              size_t* count);
+
+#endif
+#ifdef VK_EXT_tooling_info
+void count_VkPhysicalDeviceToolPropertiesEXT(uint32_t featureBits, VkStructureType rootType,
+                                             const VkPhysicalDeviceToolPropertiesEXT* toCount,
+                                             size_t* count);
+
+#endif
+#ifdef VK_EXT_separate_stencil_usage
+DEFINE_ALIAS_FUNCTION(count_VkImageStencilUsageCreateInfo, count_VkImageStencilUsageCreateInfoEXT)
+
+#endif
+#ifdef VK_EXT_validation_features
+void count_VkValidationFeaturesEXT(uint32_t featureBits, VkStructureType rootType,
+                                   const VkValidationFeaturesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_NV_cooperative_matrix
+void count_VkCooperativeMatrixPropertiesNV(uint32_t featureBits, VkStructureType rootType,
+                                           const VkCooperativeMatrixPropertiesNV* toCount,
+                                           size_t* count);
+
+void count_VkPhysicalDeviceCooperativeMatrixFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceCooperativeMatrixFeaturesNV* toCount, size_t* count);
+
+void count_VkPhysicalDeviceCooperativeMatrixPropertiesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceCooperativeMatrixPropertiesNV* toCount, size_t* count);
+
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+void count_VkPhysicalDeviceCoverageReductionModeFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceCoverageReductionModeFeaturesNV* toCount, size_t* count);
+
+void count_VkPipelineCoverageReductionStateCreateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineCoverageReductionStateCreateInfoNV* toCount, size_t* count);
+
+void count_VkFramebufferMixedSamplesCombinationNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkFramebufferMixedSamplesCombinationNV* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_fragment_shader_interlock
+void count_VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_ycbcr_image_arrays
+void count_VkPhysicalDeviceYcbcrImageArraysFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_provoking_vertex
+void count_VkPhysicalDeviceProvokingVertexFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceProvokingVertexFeaturesEXT* toCount, size_t* count);
+
+void count_VkPhysicalDeviceProvokingVertexPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceProvokingVertexPropertiesEXT* toCount, size_t* count);
+
+void count_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+void count_VkSurfaceFullScreenExclusiveInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                               const VkSurfaceFullScreenExclusiveInfoEXT* toCount,
+                                               size_t* count);
+
+void count_VkSurfaceCapabilitiesFullScreenExclusiveEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkSurfaceCapabilitiesFullScreenExclusiveEXT* toCount, size_t* count);
+
+void count_VkSurfaceFullScreenExclusiveWin32InfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkSurfaceFullScreenExclusiveWin32InfoEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_headless_surface
+void count_VkHeadlessSurfaceCreateInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                          const VkHeadlessSurfaceCreateInfoEXT* toCount,
+                                          size_t* count);
+
+#endif
+#ifdef VK_EXT_line_rasterization
+void count_VkPhysicalDeviceLineRasterizationFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceLineRasterizationFeaturesEXT* toCount, size_t* count);
+
+void count_VkPhysicalDeviceLineRasterizationPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceLineRasterizationPropertiesEXT* toCount, size_t* count);
+
+void count_VkPipelineRasterizationLineStateCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineRasterizationLineStateCreateInfoEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_shader_atomic_float
+void count_VkPhysicalDeviceShaderAtomicFloatFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_host_query_reset
+DEFINE_ALIAS_FUNCTION(count_VkPhysicalDeviceHostQueryResetFeatures,
+                      count_VkPhysicalDeviceHostQueryResetFeaturesEXT)
+
+#endif
+#ifdef VK_EXT_index_type_uint8
+void count_VkPhysicalDeviceIndexTypeUint8FeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceIndexTypeUint8FeaturesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+void count_VkPhysicalDeviceExtendedDynamicStateFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_shader_atomic_float2
+void count_VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_shader_demote_to_helper_invocation
+void count_VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_NV_device_generated_commands
+void count_VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV* toCount, size_t* count);
+
+void count_VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV* toCount, size_t* count);
+
+void count_VkGraphicsShaderGroupCreateInfoNV(uint32_t featureBits, VkStructureType rootType,
+                                             const VkGraphicsShaderGroupCreateInfoNV* toCount,
+                                             size_t* count);
+
+void count_VkGraphicsPipelineShaderGroupsCreateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkGraphicsPipelineShaderGroupsCreateInfoNV* toCount, size_t* count);
+
+void count_VkBindShaderGroupIndirectCommandNV(uint32_t featureBits, VkStructureType rootType,
+                                              const VkBindShaderGroupIndirectCommandNV* toCount,
+                                              size_t* count);
+
+void count_VkBindIndexBufferIndirectCommandNV(uint32_t featureBits, VkStructureType rootType,
+                                              const VkBindIndexBufferIndirectCommandNV* toCount,
+                                              size_t* count);
+
+void count_VkBindVertexBufferIndirectCommandNV(uint32_t featureBits, VkStructureType rootType,
+                                               const VkBindVertexBufferIndirectCommandNV* toCount,
+                                               size_t* count);
+
+void count_VkSetStateFlagsIndirectCommandNV(uint32_t featureBits, VkStructureType rootType,
+                                            const VkSetStateFlagsIndirectCommandNV* toCount,
+                                            size_t* count);
+
+void count_VkIndirectCommandsStreamNV(uint32_t featureBits, VkStructureType rootType,
+                                      const VkIndirectCommandsStreamNV* toCount, size_t* count);
+
+void count_VkIndirectCommandsLayoutTokenNV(uint32_t featureBits, VkStructureType rootType,
+                                           const VkIndirectCommandsLayoutTokenNV* toCount,
+                                           size_t* count);
+
+void count_VkIndirectCommandsLayoutCreateInfoNV(uint32_t featureBits, VkStructureType rootType,
+                                                const VkIndirectCommandsLayoutCreateInfoNV* toCount,
+                                                size_t* count);
+
+void count_VkGeneratedCommandsInfoNV(uint32_t featureBits, VkStructureType rootType,
+                                     const VkGeneratedCommandsInfoNV* toCount, size_t* count);
+
+void count_VkGeneratedCommandsMemoryRequirementsInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkGeneratedCommandsMemoryRequirementsInfoNV* toCount, size_t* count);
+
+#endif
+#ifdef VK_NV_inherited_viewport_scissor
+void count_VkPhysicalDeviceInheritedViewportScissorFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceInheritedViewportScissorFeaturesNV* toCount, size_t* count);
+
+void count_VkCommandBufferInheritanceViewportScissorInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkCommandBufferInheritanceViewportScissorInfoNV* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_texel_buffer_alignment
+void count_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT* toCount, size_t* count);
+
+void count_VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_QCOM_render_pass_transform
+void count_VkRenderPassTransformBeginInfoQCOM(uint32_t featureBits, VkStructureType rootType,
+                                              const VkRenderPassTransformBeginInfoQCOM* toCount,
+                                              size_t* count);
+
+void count_VkCommandBufferInheritanceRenderPassTransformInfoQCOM(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkCommandBufferInheritanceRenderPassTransformInfoQCOM* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_device_memory_report
+void count_VkPhysicalDeviceDeviceMemoryReportFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceDeviceMemoryReportFeaturesEXT* toCount, size_t* count);
+
+void count_VkDeviceMemoryReportCallbackDataEXT(uint32_t featureBits, VkStructureType rootType,
+                                               const VkDeviceMemoryReportCallbackDataEXT* toCount,
+                                               size_t* count);
+
+void count_VkDeviceDeviceMemoryReportCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkDeviceDeviceMemoryReportCreateInfoEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_acquire_drm_display
+#endif
+#ifdef VK_EXT_robustness2
+void count_VkPhysicalDeviceRobustness2FeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceRobustness2FeaturesEXT* toCount, size_t* count);
+
+void count_VkPhysicalDeviceRobustness2PropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceRobustness2PropertiesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_custom_border_color
+void count_VkSamplerCustomBorderColorCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkSamplerCustomBorderColorCreateInfoEXT* toCount, size_t* count);
+
+void count_VkPhysicalDeviceCustomBorderColorPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceCustomBorderColorPropertiesEXT* toCount, size_t* count);
+
+void count_VkPhysicalDeviceCustomBorderColorFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceCustomBorderColorFeaturesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_GOOGLE_user_type
+#endif
+#ifdef VK_EXT_private_data
+void count_VkPhysicalDevicePrivateDataFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDevicePrivateDataFeaturesEXT* toCount, size_t* count);
+
+void count_VkDevicePrivateDataCreateInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                            const VkDevicePrivateDataCreateInfoEXT* toCount,
+                                            size_t* count);
+
+void count_VkPrivateDataSlotCreateInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                          const VkPrivateDataSlotCreateInfoEXT* toCount,
+                                          size_t* count);
+
+#endif
+#ifdef VK_EXT_pipeline_creation_cache_control
+void count_VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_NV_device_diagnostics_config
+void count_VkPhysicalDeviceDiagnosticsConfigFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceDiagnosticsConfigFeaturesNV* toCount, size_t* count);
+
+void count_VkDeviceDiagnosticsConfigCreateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkDeviceDiagnosticsConfigCreateInfoNV* toCount, size_t* count);
+
+#endif
+#ifdef VK_QCOM_render_pass_store_ops
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+void count_VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV* toCount, size_t* count);
+
+void count_VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV* toCount, size_t* count);
+
+void count_VkPipelineFragmentShadingRateEnumStateCreateInfoNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPipelineFragmentShadingRateEnumStateCreateInfoNV* toCount, size_t* count);
+
+#endif
+#ifdef VK_NV_ray_tracing_motion_blur
+void count_VkDeviceOrHostAddressConstKHR(uint32_t featureBits, VkStructureType rootType,
+                                         const VkDeviceOrHostAddressConstKHR* toCount,
+                                         size_t* count);
+
+void count_VkAccelerationStructureGeometryMotionTrianglesDataNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureGeometryMotionTrianglesDataNV* toCount, size_t* count);
+
+void count_VkAccelerationStructureMotionInfoNV(uint32_t featureBits, VkStructureType rootType,
+                                               const VkAccelerationStructureMotionInfoNV* toCount,
+                                               size_t* count);
+
+void count_VkAccelerationStructureMatrixMotionInstanceNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureMatrixMotionInstanceNV* toCount, size_t* count);
+
+void count_VkSRTDataNV(uint32_t featureBits, VkStructureType rootType, const VkSRTDataNV* toCount,
+                       size_t* count);
+
+void count_VkAccelerationStructureSRTMotionInstanceNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureSRTMotionInstanceNV* toCount, size_t* count);
+
+void count_VkAccelerationStructureMotionInstanceDataNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureMotionInstanceDataNV* toCount, size_t* count);
+
+void count_VkAccelerationStructureMotionInstanceNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureMotionInstanceNV* toCount, size_t* count);
+
+void count_VkPhysicalDeviceRayTracingMotionBlurFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingMotionBlurFeaturesNV* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_ycbcr_2plane_444_formats
+void count_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_fragment_density_map2
+void count_VkPhysicalDeviceFragmentDensityMap2FeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT* toCount, size_t* count);
+
+void count_VkPhysicalDeviceFragmentDensityMap2PropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMap2PropertiesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_QCOM_rotated_copy_commands
+void count_VkCopyCommandTransformInfoQCOM(uint32_t featureBits, VkStructureType rootType,
+                                          const VkCopyCommandTransformInfoQCOM* toCount,
+                                          size_t* count);
+
+#endif
+#ifdef VK_EXT_image_robustness
+void count_VkPhysicalDeviceImageRobustnessFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceImageRobustnessFeaturesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_4444_formats
+void count_VkPhysicalDevice4444FormatsFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDevice4444FormatsFeaturesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_rgba10x6_formats
+void count_VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_NV_acquire_winrt_display
+#endif
+#ifdef VK_EXT_directfb_surface
+void count_VkDirectFBSurfaceCreateInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                          const VkDirectFBSurfaceCreateInfoEXT* toCount,
+                                          size_t* count);
+
+#endif
+#ifdef VK_VALVE_mutable_descriptor_type
+void count_VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE* toCount, size_t* count);
+
+void count_VkMutableDescriptorTypeListVALVE(uint32_t featureBits, VkStructureType rootType,
+                                            const VkMutableDescriptorTypeListVALVE* toCount,
+                                            size_t* count);
+
+void count_VkMutableDescriptorTypeCreateInfoVALVE(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkMutableDescriptorTypeCreateInfoVALVE* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+void count_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT* toCount, size_t* count);
+
+void count_VkVertexInputBindingDescription2EXT(uint32_t featureBits, VkStructureType rootType,
+                                               const VkVertexInputBindingDescription2EXT* toCount,
+                                               size_t* count);
+
+void count_VkVertexInputAttributeDescription2EXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkVertexInputAttributeDescription2EXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_physical_device_drm
+void count_VkPhysicalDeviceDrmPropertiesEXT(uint32_t featureBits, VkStructureType rootType,
+                                            const VkPhysicalDeviceDrmPropertiesEXT* toCount,
+                                            size_t* count);
+
+#endif
+#ifdef VK_EXT_primitive_topology_list_restart
+void count_VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_FUCHSIA_external_memory
+void count_VkImportMemoryZirconHandleInfoFUCHSIA(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkImportMemoryZirconHandleInfoFUCHSIA* toCount, size_t* count);
+
+void count_VkMemoryZirconHandlePropertiesFUCHSIA(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkMemoryZirconHandlePropertiesFUCHSIA* toCount, size_t* count);
+
+void count_VkMemoryGetZirconHandleInfoFUCHSIA(uint32_t featureBits, VkStructureType rootType,
+                                              const VkMemoryGetZirconHandleInfoFUCHSIA* toCount,
+                                              size_t* count);
+
+#endif
+#ifdef VK_FUCHSIA_external_semaphore
+void count_VkImportSemaphoreZirconHandleInfoFUCHSIA(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkImportSemaphoreZirconHandleInfoFUCHSIA* toCount, size_t* count);
+
+void count_VkSemaphoreGetZirconHandleInfoFUCHSIA(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkSemaphoreGetZirconHandleInfoFUCHSIA* toCount, size_t* count);
+
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+void count_VkBufferCollectionCreateInfoFUCHSIA(uint32_t featureBits, VkStructureType rootType,
+                                               const VkBufferCollectionCreateInfoFUCHSIA* toCount,
+                                               size_t* count);
+
+void count_VkImportMemoryBufferCollectionFUCHSIA(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkImportMemoryBufferCollectionFUCHSIA* toCount, size_t* count);
+
+void count_VkBufferCollectionImageCreateInfoFUCHSIA(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkBufferCollectionImageCreateInfoFUCHSIA* toCount, size_t* count);
+
+void count_VkBufferCollectionConstraintsInfoFUCHSIA(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkBufferCollectionConstraintsInfoFUCHSIA* toCount, size_t* count);
+
+void count_VkBufferConstraintsInfoFUCHSIA(uint32_t featureBits, VkStructureType rootType,
+                                          const VkBufferConstraintsInfoFUCHSIA* toCount,
+                                          size_t* count);
+
+void count_VkBufferCollectionBufferCreateInfoFUCHSIA(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkBufferCollectionBufferCreateInfoFUCHSIA* toCount, size_t* count);
+
+void count_VkSysmemColorSpaceFUCHSIA(uint32_t featureBits, VkStructureType rootType,
+                                     const VkSysmemColorSpaceFUCHSIA* toCount, size_t* count);
+
+void count_VkBufferCollectionPropertiesFUCHSIA(uint32_t featureBits, VkStructureType rootType,
+                                               const VkBufferCollectionPropertiesFUCHSIA* toCount,
+                                               size_t* count);
+
+void count_VkImageFormatConstraintsInfoFUCHSIA(uint32_t featureBits, VkStructureType rootType,
+                                               const VkImageFormatConstraintsInfoFUCHSIA* toCount,
+                                               size_t* count);
+
+void count_VkImageConstraintsInfoFUCHSIA(uint32_t featureBits, VkStructureType rootType,
+                                         const VkImageConstraintsInfoFUCHSIA* toCount,
+                                         size_t* count);
+
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+void count_VkSubpassShadingPipelineCreateInfoHUAWEI(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkSubpassShadingPipelineCreateInfoHUAWEI* toCount, size_t* count);
+
+void count_VkPhysicalDeviceSubpassShadingFeaturesHUAWEI(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceSubpassShadingFeaturesHUAWEI* toCount, size_t* count);
+
+void count_VkPhysicalDeviceSubpassShadingPropertiesHUAWEI(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceSubpassShadingPropertiesHUAWEI* toCount, size_t* count);
+
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+void count_VkPhysicalDeviceInvocationMaskFeaturesHUAWEI(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceInvocationMaskFeaturesHUAWEI* toCount, size_t* count);
+
+#endif
+#ifdef VK_NV_external_memory_rdma
+void count_VkMemoryGetRemoteAddressInfoNV(uint32_t featureBits, VkStructureType rootType,
+                                          const VkMemoryGetRemoteAddressInfoNV* toCount,
+                                          size_t* count);
+
+void count_VkPhysicalDeviceExternalMemoryRDMAFeaturesNV(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceExternalMemoryRDMAFeaturesNV* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+void count_VkPhysicalDeviceExtendedDynamicState2FeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_QNX_screen_surface
+void count_VkScreenSurfaceCreateInfoQNX(uint32_t featureBits, VkStructureType rootType,
+                                        const VkScreenSurfaceCreateInfoQNX* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_color_write_enable
+void count_VkPhysicalDeviceColorWriteEnableFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceColorWriteEnableFeaturesEXT* toCount, size_t* count);
+
+void count_VkPipelineColorWriteCreateInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                             const VkPipelineColorWriteCreateInfoEXT* toCount,
+                                             size_t* count);
+
+#endif
+#ifdef VK_GOOGLE_gfxstream
+void count_VkImportColorBufferGOOGLE(uint32_t featureBits, VkStructureType rootType,
+                                     const VkImportColorBufferGOOGLE* toCount, size_t* count);
+
+void count_VkImportBufferGOOGLE(uint32_t featureBits, VkStructureType rootType,
+                                const VkImportBufferGOOGLE* toCount, size_t* count);
+
+void count_VkCreateBlobGOOGLE(uint32_t featureBits, VkStructureType rootType,
+                              const VkCreateBlobGOOGLE* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_global_priority_query
+void count_VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT* toCount, size_t* count);
+
+void count_VkQueueFamilyGlobalPriorityPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkQueueFamilyGlobalPriorityPropertiesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_multi_draw
+void count_VkPhysicalDeviceMultiDrawFeaturesEXT(uint32_t featureBits, VkStructureType rootType,
+                                                const VkPhysicalDeviceMultiDrawFeaturesEXT* toCount,
+                                                size_t* count);
+
+void count_VkPhysicalDeviceMultiDrawPropertiesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceMultiDrawPropertiesEXT* toCount, size_t* count);
+
+void count_VkMultiDrawInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                              const VkMultiDrawInfoEXT* toCount, size_t* count);
+
+void count_VkMultiDrawIndexedInfoEXT(uint32_t featureBits, VkStructureType rootType,
+                                     const VkMultiDrawIndexedInfoEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_load_store_op_none
+#endif
+#ifdef VK_EXT_border_color_swizzle
+void count_VkPhysicalDeviceBorderColorSwizzleFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT* toCount, size_t* count);
+
+void count_VkSamplerBorderColorComponentMappingCreateInfoEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkSamplerBorderColorComponentMappingCreateInfoEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+void count_VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_acceleration_structure
+void count_VkDeviceOrHostAddressKHR(uint32_t featureBits, VkStructureType rootType,
+                                    const VkDeviceOrHostAddressKHR* toCount, size_t* count);
+
+void count_VkAccelerationStructureBuildRangeInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureBuildRangeInfoKHR* toCount, size_t* count);
+
+void count_VkAccelerationStructureGeometryTrianglesDataKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureGeometryTrianglesDataKHR* toCount, size_t* count);
+
+void count_VkAccelerationStructureGeometryAabbsDataKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureGeometryAabbsDataKHR* toCount, size_t* count);
+
+void count_VkAccelerationStructureGeometryInstancesDataKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureGeometryInstancesDataKHR* toCount, size_t* count);
+
+void count_VkAccelerationStructureGeometryDataKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureGeometryDataKHR* toCount, size_t* count);
+
+void count_VkAccelerationStructureGeometryKHR(uint32_t featureBits, VkStructureType rootType,
+                                              const VkAccelerationStructureGeometryKHR* toCount,
+                                              size_t* count);
+
+void count_VkAccelerationStructureBuildGeometryInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureBuildGeometryInfoKHR* toCount, size_t* count);
+
+void count_VkAccelerationStructureCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                                const VkAccelerationStructureCreateInfoKHR* toCount,
+                                                size_t* count);
+
+void count_VkWriteDescriptorSetAccelerationStructureKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkWriteDescriptorSetAccelerationStructureKHR* toCount, size_t* count);
+
+void count_VkPhysicalDeviceAccelerationStructureFeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceAccelerationStructureFeaturesKHR* toCount, size_t* count);
+
+void count_VkPhysicalDeviceAccelerationStructurePropertiesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceAccelerationStructurePropertiesKHR* toCount, size_t* count);
+
+void count_VkAccelerationStructureDeviceAddressInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureDeviceAddressInfoKHR* toCount, size_t* count);
+
+void count_VkAccelerationStructureVersionInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureVersionInfoKHR* toCount, size_t* count);
+
+void count_VkCopyAccelerationStructureToMemoryInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkCopyAccelerationStructureToMemoryInfoKHR* toCount, size_t* count);
+
+void count_VkCopyMemoryToAccelerationStructureInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkCopyMemoryToAccelerationStructureInfoKHR* toCount, size_t* count);
+
+void count_VkCopyAccelerationStructureInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                              const VkCopyAccelerationStructureInfoKHR* toCount,
+                                              size_t* count);
+
+void count_VkAccelerationStructureBuildSizesInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkAccelerationStructureBuildSizesInfoKHR* toCount, size_t* count);
+
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+void count_VkRayTracingShaderGroupCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                                const VkRayTracingShaderGroupCreateInfoKHR* toCount,
+                                                size_t* count);
+
+void count_VkRayTracingPipelineInterfaceCreateInfoKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkRayTracingPipelineInterfaceCreateInfoKHR* toCount, size_t* count);
+
+void count_VkRayTracingPipelineCreateInfoKHR(uint32_t featureBits, VkStructureType rootType,
+                                             const VkRayTracingPipelineCreateInfoKHR* toCount,
+                                             size_t* count);
+
+void count_VkPhysicalDeviceRayTracingPipelineFeaturesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingPipelineFeaturesKHR* toCount, size_t* count);
+
+void count_VkPhysicalDeviceRayTracingPipelinePropertiesKHR(
+    uint32_t featureBits, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingPipelinePropertiesKHR* toCount, size_t* count);
+
+void count_VkStridedDeviceAddressRegionKHR(uint32_t featureBits, VkStructureType rootType,
+                                           const VkStridedDeviceAddressRegionKHR* toCount,
+                                           size_t* count);
+
+void count_VkTraceRaysIndirectCommandKHR(uint32_t featureBits, VkStructureType rootType,
+                                         const VkTraceRaysIndirectCommandKHR* toCount,
+                                         size_t* count);
+
+#endif
+#ifdef VK_KHR_ray_query
+void count_VkPhysicalDeviceRayQueryFeaturesKHR(uint32_t featureBits, VkStructureType rootType,
+                                               const VkPhysicalDeviceRayQueryFeaturesKHR* toCount,
+                                               size_t* count);
+
+#endif
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/goldfish_vk_deepcopy_guest.cpp b/system/vulkan_enc/goldfish_vk_deepcopy_guest.cpp
new file mode 100644
index 0000000..e937dae
--- /dev/null
+++ b/system/vulkan_enc/goldfish_vk_deepcopy_guest.cpp
@@ -0,0 +1,21060 @@
+// Copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2018 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Autogenerated module goldfish_vk_deepcopy_guest
+//
+// (impl) generated by codegen/vulkan/scripts/genvk.py -registry codegen/vulkan/xml/vk.xml cereal -o
+// host/vulkan/cereal
+//
+// Please do not modify directly;
+// re-run gfxstream-protocols/scripts/generate-vulkan-sources.sh,
+// or directly from Python by defining:
+// VULKAN_REGISTRY_XML_DIR : Directory containing vk.xml
+// VULKAN_REGISTRY_SCRIPTS_DIR : Directory containing genvk.py
+// CEREAL_OUTPUT_DIR: Where to put the generated sources.
+//
+// python3 $VULKAN_REGISTRY_SCRIPTS_DIR/genvk.py -registry $VULKAN_REGISTRY_XML_DIR/vk.xml cereal -o
+// $CEREAL_OUTPUT_DIR
+//
+
+#include "goldfish_vk_deepcopy_guest.h"
+
+#include <cstring>
+
+#include "goldfish_vk_extension_structs_guest.h"
+#include "goldfish_vk_private_defs.h"
+#include "vk_util.h"
+
+namespace gfxstream {
+namespace vk {
+
+void deepcopy_extension_struct(Allocator* alloc, VkStructureType rootType,
+                               const void* structExtension, void* structExtension_out);
+
+#ifdef VK_VERSION_1_0
+void deepcopy_VkExtent2D(Allocator* alloc, VkStructureType rootType, const VkExtent2D* from,
+                         VkExtent2D* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkExtent3D(Allocator* alloc, VkStructureType rootType, const VkExtent3D* from,
+                         VkExtent3D* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkOffset2D(Allocator* alloc, VkStructureType rootType, const VkOffset2D* from,
+                         VkOffset2D* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkOffset3D(Allocator* alloc, VkStructureType rootType, const VkOffset3D* from,
+                         VkOffset3D* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkRect2D(Allocator* alloc, VkStructureType rootType, const VkRect2D* from,
+                       VkRect2D* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkOffset2D(alloc, rootType, &from->offset, (VkOffset2D*)(&to->offset));
+    deepcopy_VkExtent2D(alloc, rootType, &from->extent, (VkExtent2D*)(&to->extent));
+}
+
+void deepcopy_VkBaseInStructure(Allocator* alloc, VkStructureType rootType,
+                                const VkBaseInStructure* from, VkBaseInStructure* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (VkBaseInStructure*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkBaseOutStructure(Allocator* alloc, VkStructureType rootType,
+                                 const VkBaseOutStructure* from, VkBaseOutStructure* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (VkBaseOutStructure*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkBufferMemoryBarrier(Allocator* alloc, VkStructureType rootType,
+                                    const VkBufferMemoryBarrier* from, VkBufferMemoryBarrier* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkDispatchIndirectCommand(Allocator* alloc, VkStructureType rootType,
+                                        const VkDispatchIndirectCommand* from,
+                                        VkDispatchIndirectCommand* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkDrawIndexedIndirectCommand(Allocator* alloc, VkStructureType rootType,
+                                           const VkDrawIndexedIndirectCommand* from,
+                                           VkDrawIndexedIndirectCommand* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkDrawIndirectCommand(Allocator* alloc, VkStructureType rootType,
+                                    const VkDrawIndirectCommand* from, VkDrawIndirectCommand* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkImageSubresourceRange(Allocator* alloc, VkStructureType rootType,
+                                      const VkImageSubresourceRange* from,
+                                      VkImageSubresourceRange* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkImageMemoryBarrier(Allocator* alloc, VkStructureType rootType,
+                                   const VkImageMemoryBarrier* from, VkImageMemoryBarrier* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkImageSubresourceRange(alloc, rootType, &from->subresourceRange,
+                                     (VkImageSubresourceRange*)(&to->subresourceRange));
+}
+
+void deepcopy_VkMemoryBarrier(Allocator* alloc, VkStructureType rootType,
+                              const VkMemoryBarrier* from, VkMemoryBarrier* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPipelineCacheHeaderVersionOne(Allocator* alloc, VkStructureType rootType,
+                                              const VkPipelineCacheHeaderVersionOne* from,
+                                              VkPipelineCacheHeaderVersionOne* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    memcpy(to->pipelineCacheUUID, from->pipelineCacheUUID, VK_UUID_SIZE * sizeof(uint8_t));
+}
+
+void deepcopy_VkAllocationCallbacks(Allocator* alloc, VkStructureType rootType,
+                                    const VkAllocationCallbacks* from, VkAllocationCallbacks* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    to->pUserData = nullptr;
+    if (from->pUserData) {
+        to->pUserData = (void*)alloc->dupArray(from->pUserData, sizeof(uint8_t));
+    }
+}
+
+void deepcopy_VkApplicationInfo(Allocator* alloc, VkStructureType rootType,
+                                const VkApplicationInfo* from, VkApplicationInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pApplicationName = nullptr;
+    if (from->pApplicationName) {
+        to->pApplicationName = alloc->strDup(from->pApplicationName);
+    }
+    to->pEngineName = nullptr;
+    if (from->pEngineName) {
+        to->pEngineName = alloc->strDup(from->pEngineName);
+    }
+}
+
+void deepcopy_VkFormatProperties(Allocator* alloc, VkStructureType rootType,
+                                 const VkFormatProperties* from, VkFormatProperties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkImageFormatProperties(Allocator* alloc, VkStructureType rootType,
+                                      const VkImageFormatProperties* from,
+                                      VkImageFormatProperties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkExtent3D(alloc, rootType, &from->maxExtent, (VkExtent3D*)(&to->maxExtent));
+}
+
+void deepcopy_VkInstanceCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                   const VkInstanceCreateInfo* from, VkInstanceCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pApplicationInfo = nullptr;
+    if (from->pApplicationInfo) {
+        to->pApplicationInfo = (VkApplicationInfo*)alloc->alloc(sizeof(const VkApplicationInfo));
+        deepcopy_VkApplicationInfo(alloc, rootType, from->pApplicationInfo,
+                                   (VkApplicationInfo*)(to->pApplicationInfo));
+    }
+    to->ppEnabledLayerNames = nullptr;
+    if (from->ppEnabledLayerNames && from->enabledLayerCount) {
+        to->ppEnabledLayerNames =
+            alloc->strDupArray(from->ppEnabledLayerNames, from->enabledLayerCount);
+    }
+    to->ppEnabledExtensionNames = nullptr;
+    if (from->ppEnabledExtensionNames && from->enabledExtensionCount) {
+        to->ppEnabledExtensionNames =
+            alloc->strDupArray(from->ppEnabledExtensionNames, from->enabledExtensionCount);
+    }
+}
+
+void deepcopy_VkMemoryHeap(Allocator* alloc, VkStructureType rootType, const VkMemoryHeap* from,
+                           VkMemoryHeap* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkMemoryType(Allocator* alloc, VkStructureType rootType, const VkMemoryType* from,
+                           VkMemoryType* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkPhysicalDeviceFeatures(Allocator* alloc, VkStructureType rootType,
+                                       const VkPhysicalDeviceFeatures* from,
+                                       VkPhysicalDeviceFeatures* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkPhysicalDeviceLimits(Allocator* alloc, VkStructureType rootType,
+                                     const VkPhysicalDeviceLimits* from,
+                                     VkPhysicalDeviceLimits* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    memcpy(to->maxComputeWorkGroupCount, from->maxComputeWorkGroupCount, 3 * sizeof(uint32_t));
+    memcpy(to->maxComputeWorkGroupSize, from->maxComputeWorkGroupSize, 3 * sizeof(uint32_t));
+    memcpy(to->maxViewportDimensions, from->maxViewportDimensions, 2 * sizeof(uint32_t));
+    memcpy(to->viewportBoundsRange, from->viewportBoundsRange, 2 * sizeof(float));
+    memcpy(to->pointSizeRange, from->pointSizeRange, 2 * sizeof(float));
+    memcpy(to->lineWidthRange, from->lineWidthRange, 2 * sizeof(float));
+}
+
+void deepcopy_VkPhysicalDeviceMemoryProperties(Allocator* alloc, VkStructureType rootType,
+                                               const VkPhysicalDeviceMemoryProperties* from,
+                                               VkPhysicalDeviceMemoryProperties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    for (uint32_t i = 0; i < (uint32_t)VK_MAX_MEMORY_TYPES; ++i) {
+        deepcopy_VkMemoryType(alloc, rootType, from->memoryTypes + i,
+                              (VkMemoryType*)(to->memoryTypes + i));
+    }
+    for (uint32_t i = 0; i < (uint32_t)VK_MAX_MEMORY_HEAPS; ++i) {
+        deepcopy_VkMemoryHeap(alloc, rootType, from->memoryHeaps + i,
+                              (VkMemoryHeap*)(to->memoryHeaps + i));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceSparseProperties(Allocator* alloc, VkStructureType rootType,
+                                               const VkPhysicalDeviceSparseProperties* from,
+                                               VkPhysicalDeviceSparseProperties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkPhysicalDeviceProperties(Allocator* alloc, VkStructureType rootType,
+                                         const VkPhysicalDeviceProperties* from,
+                                         VkPhysicalDeviceProperties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    memcpy(to->deviceName, from->deviceName, VK_MAX_PHYSICAL_DEVICE_NAME_SIZE * sizeof(char));
+    memcpy(to->pipelineCacheUUID, from->pipelineCacheUUID, VK_UUID_SIZE * sizeof(uint8_t));
+    deepcopy_VkPhysicalDeviceLimits(alloc, rootType, &from->limits,
+                                    (VkPhysicalDeviceLimits*)(&to->limits));
+    deepcopy_VkPhysicalDeviceSparseProperties(
+        alloc, rootType, &from->sparseProperties,
+        (VkPhysicalDeviceSparseProperties*)(&to->sparseProperties));
+}
+
+void deepcopy_VkQueueFamilyProperties(Allocator* alloc, VkStructureType rootType,
+                                      const VkQueueFamilyProperties* from,
+                                      VkQueueFamilyProperties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkExtent3D(alloc, rootType, &from->minImageTransferGranularity,
+                        (VkExtent3D*)(&to->minImageTransferGranularity));
+}
+
+void deepcopy_VkDeviceQueueCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                      const VkDeviceQueueCreateInfo* from,
+                                      VkDeviceQueueCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pQueuePriorities = nullptr;
+    if (from->pQueuePriorities) {
+        to->pQueuePriorities =
+            (float*)alloc->dupArray(from->pQueuePriorities, from->queueCount * sizeof(const float));
+    }
+}
+
+void deepcopy_VkDeviceCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                 const VkDeviceCreateInfo* from, VkDeviceCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pQueueCreateInfos = nullptr;
+        if (from->pQueueCreateInfos) {
+            to->pQueueCreateInfos = (VkDeviceQueueCreateInfo*)alloc->alloc(
+                from->queueCreateInfoCount * sizeof(const VkDeviceQueueCreateInfo));
+            to->queueCreateInfoCount = from->queueCreateInfoCount;
+            for (uint32_t i = 0; i < (uint32_t)from->queueCreateInfoCount; ++i) {
+                deepcopy_VkDeviceQueueCreateInfo(
+                    alloc, rootType, from->pQueueCreateInfos + i,
+                    (VkDeviceQueueCreateInfo*)(to->pQueueCreateInfos + i));
+            }
+        }
+    }
+    to->ppEnabledLayerNames = nullptr;
+    if (from->ppEnabledLayerNames && from->enabledLayerCount) {
+        to->ppEnabledLayerNames =
+            alloc->strDupArray(from->ppEnabledLayerNames, from->enabledLayerCount);
+    }
+    to->ppEnabledExtensionNames = nullptr;
+    if (from->ppEnabledExtensionNames && from->enabledExtensionCount) {
+        to->ppEnabledExtensionNames =
+            alloc->strDupArray(from->ppEnabledExtensionNames, from->enabledExtensionCount);
+    }
+    to->pEnabledFeatures = nullptr;
+    if (from->pEnabledFeatures) {
+        to->pEnabledFeatures =
+            (VkPhysicalDeviceFeatures*)alloc->alloc(sizeof(const VkPhysicalDeviceFeatures));
+        deepcopy_VkPhysicalDeviceFeatures(alloc, rootType, from->pEnabledFeatures,
+                                          (VkPhysicalDeviceFeatures*)(to->pEnabledFeatures));
+    }
+}
+
+void deepcopy_VkExtensionProperties(Allocator* alloc, VkStructureType rootType,
+                                    const VkExtensionProperties* from, VkExtensionProperties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    memcpy(to->extensionName, from->extensionName, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
+}
+
+void deepcopy_VkLayerProperties(Allocator* alloc, VkStructureType rootType,
+                                const VkLayerProperties* from, VkLayerProperties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    memcpy(to->layerName, from->layerName, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
+    memcpy(to->description, from->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+}
+
+void deepcopy_VkSubmitInfo(Allocator* alloc, VkStructureType rootType, const VkSubmitInfo* from,
+                           VkSubmitInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pWaitSemaphores = nullptr;
+    if (from->pWaitSemaphores) {
+        to->pWaitSemaphores = (VkSemaphore*)alloc->dupArray(
+            from->pWaitSemaphores, from->waitSemaphoreCount * sizeof(const VkSemaphore));
+    }
+    to->pWaitDstStageMask = nullptr;
+    if (from->pWaitDstStageMask) {
+        to->pWaitDstStageMask = (VkPipelineStageFlags*)alloc->dupArray(
+            from->pWaitDstStageMask, from->waitSemaphoreCount * sizeof(const VkPipelineStageFlags));
+    }
+    to->pCommandBuffers = nullptr;
+    if (from->pCommandBuffers) {
+        to->pCommandBuffers = (VkCommandBuffer*)alloc->dupArray(
+            from->pCommandBuffers, from->commandBufferCount * sizeof(const VkCommandBuffer));
+    }
+    to->pSignalSemaphores = nullptr;
+    if (from->pSignalSemaphores) {
+        to->pSignalSemaphores = (VkSemaphore*)alloc->dupArray(
+            from->pSignalSemaphores, from->signalSemaphoreCount * sizeof(const VkSemaphore));
+    }
+}
+
+void deepcopy_VkMappedMemoryRange(Allocator* alloc, VkStructureType rootType,
+                                  const VkMappedMemoryRange* from, VkMappedMemoryRange* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkMemoryAllocateInfo(Allocator* alloc, VkStructureType rootType,
+                                   const VkMemoryAllocateInfo* from, VkMemoryAllocateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkMemoryRequirements(Allocator* alloc, VkStructureType rootType,
+                                   const VkMemoryRequirements* from, VkMemoryRequirements* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkSparseMemoryBind(Allocator* alloc, VkStructureType rootType,
+                                 const VkSparseMemoryBind* from, VkSparseMemoryBind* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkSparseBufferMemoryBindInfo(Allocator* alloc, VkStructureType rootType,
+                                           const VkSparseBufferMemoryBindInfo* from,
+                                           VkSparseBufferMemoryBindInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (from) {
+        to->pBinds = nullptr;
+        if (from->pBinds) {
+            to->pBinds = (VkSparseMemoryBind*)alloc->alloc(from->bindCount *
+                                                           sizeof(const VkSparseMemoryBind));
+            to->bindCount = from->bindCount;
+            for (uint32_t i = 0; i < (uint32_t)from->bindCount; ++i) {
+                deepcopy_VkSparseMemoryBind(alloc, rootType, from->pBinds + i,
+                                            (VkSparseMemoryBind*)(to->pBinds + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkSparseImageOpaqueMemoryBindInfo(Allocator* alloc, VkStructureType rootType,
+                                                const VkSparseImageOpaqueMemoryBindInfo* from,
+                                                VkSparseImageOpaqueMemoryBindInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (from) {
+        to->pBinds = nullptr;
+        if (from->pBinds) {
+            to->pBinds = (VkSparseMemoryBind*)alloc->alloc(from->bindCount *
+                                                           sizeof(const VkSparseMemoryBind));
+            to->bindCount = from->bindCount;
+            for (uint32_t i = 0; i < (uint32_t)from->bindCount; ++i) {
+                deepcopy_VkSparseMemoryBind(alloc, rootType, from->pBinds + i,
+                                            (VkSparseMemoryBind*)(to->pBinds + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkImageSubresource(Allocator* alloc, VkStructureType rootType,
+                                 const VkImageSubresource* from, VkImageSubresource* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkSparseImageMemoryBind(Allocator* alloc, VkStructureType rootType,
+                                      const VkSparseImageMemoryBind* from,
+                                      VkSparseImageMemoryBind* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkImageSubresource(alloc, rootType, &from->subresource,
+                                (VkImageSubresource*)(&to->subresource));
+    deepcopy_VkOffset3D(alloc, rootType, &from->offset, (VkOffset3D*)(&to->offset));
+    deepcopy_VkExtent3D(alloc, rootType, &from->extent, (VkExtent3D*)(&to->extent));
+}
+
+void deepcopy_VkSparseImageMemoryBindInfo(Allocator* alloc, VkStructureType rootType,
+                                          const VkSparseImageMemoryBindInfo* from,
+                                          VkSparseImageMemoryBindInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (from) {
+        to->pBinds = nullptr;
+        if (from->pBinds) {
+            to->pBinds = (VkSparseImageMemoryBind*)alloc->alloc(
+                from->bindCount * sizeof(const VkSparseImageMemoryBind));
+            to->bindCount = from->bindCount;
+            for (uint32_t i = 0; i < (uint32_t)from->bindCount; ++i) {
+                deepcopy_VkSparseImageMemoryBind(alloc, rootType, from->pBinds + i,
+                                                 (VkSparseImageMemoryBind*)(to->pBinds + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkBindSparseInfo(Allocator* alloc, VkStructureType rootType,
+                               const VkBindSparseInfo* from, VkBindSparseInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pWaitSemaphores = nullptr;
+    if (from->pWaitSemaphores) {
+        to->pWaitSemaphores = (VkSemaphore*)alloc->dupArray(
+            from->pWaitSemaphores, from->waitSemaphoreCount * sizeof(const VkSemaphore));
+    }
+    if (from) {
+        to->pBufferBinds = nullptr;
+        if (from->pBufferBinds) {
+            to->pBufferBinds = (VkSparseBufferMemoryBindInfo*)alloc->alloc(
+                from->bufferBindCount * sizeof(const VkSparseBufferMemoryBindInfo));
+            to->bufferBindCount = from->bufferBindCount;
+            for (uint32_t i = 0; i < (uint32_t)from->bufferBindCount; ++i) {
+                deepcopy_VkSparseBufferMemoryBindInfo(
+                    alloc, rootType, from->pBufferBinds + i,
+                    (VkSparseBufferMemoryBindInfo*)(to->pBufferBinds + i));
+            }
+        }
+    }
+    if (from) {
+        to->pImageOpaqueBinds = nullptr;
+        if (from->pImageOpaqueBinds) {
+            to->pImageOpaqueBinds = (VkSparseImageOpaqueMemoryBindInfo*)alloc->alloc(
+                from->imageOpaqueBindCount * sizeof(const VkSparseImageOpaqueMemoryBindInfo));
+            to->imageOpaqueBindCount = from->imageOpaqueBindCount;
+            for (uint32_t i = 0; i < (uint32_t)from->imageOpaqueBindCount; ++i) {
+                deepcopy_VkSparseImageOpaqueMemoryBindInfo(
+                    alloc, rootType, from->pImageOpaqueBinds + i,
+                    (VkSparseImageOpaqueMemoryBindInfo*)(to->pImageOpaqueBinds + i));
+            }
+        }
+    }
+    if (from) {
+        to->pImageBinds = nullptr;
+        if (from->pImageBinds) {
+            to->pImageBinds = (VkSparseImageMemoryBindInfo*)alloc->alloc(
+                from->imageBindCount * sizeof(const VkSparseImageMemoryBindInfo));
+            to->imageBindCount = from->imageBindCount;
+            for (uint32_t i = 0; i < (uint32_t)from->imageBindCount; ++i) {
+                deepcopy_VkSparseImageMemoryBindInfo(
+                    alloc, rootType, from->pImageBinds + i,
+                    (VkSparseImageMemoryBindInfo*)(to->pImageBinds + i));
+            }
+        }
+    }
+    to->pSignalSemaphores = nullptr;
+    if (from->pSignalSemaphores) {
+        to->pSignalSemaphores = (VkSemaphore*)alloc->dupArray(
+            from->pSignalSemaphores, from->signalSemaphoreCount * sizeof(const VkSemaphore));
+    }
+}
+
+void deepcopy_VkSparseImageFormatProperties(Allocator* alloc, VkStructureType rootType,
+                                            const VkSparseImageFormatProperties* from,
+                                            VkSparseImageFormatProperties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkExtent3D(alloc, rootType, &from->imageGranularity,
+                        (VkExtent3D*)(&to->imageGranularity));
+}
+
+void deepcopy_VkSparseImageMemoryRequirements(Allocator* alloc, VkStructureType rootType,
+                                              const VkSparseImageMemoryRequirements* from,
+                                              VkSparseImageMemoryRequirements* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkSparseImageFormatProperties(alloc, rootType, &from->formatProperties,
+                                           (VkSparseImageFormatProperties*)(&to->formatProperties));
+}
+
+void deepcopy_VkFenceCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                const VkFenceCreateInfo* from, VkFenceCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkSemaphoreCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                    const VkSemaphoreCreateInfo* from, VkSemaphoreCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkEventCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                const VkEventCreateInfo* from, VkEventCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkQueryPoolCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                    const VkQueryPoolCreateInfo* from, VkQueryPoolCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkBufferCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                 const VkBufferCreateInfo* from, VkBufferCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pQueueFamilyIndices = nullptr;
+    if (from->pQueueFamilyIndices) {
+        to->pQueueFamilyIndices = (uint32_t*)alloc->dupArray(
+            from->pQueueFamilyIndices, from->queueFamilyIndexCount * sizeof(const uint32_t));
+    }
+}
+
+void deepcopy_VkBufferViewCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                     const VkBufferViewCreateInfo* from,
+                                     VkBufferViewCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkImageCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                const VkImageCreateInfo* from, VkImageCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkExtent3D(alloc, rootType, &from->extent, (VkExtent3D*)(&to->extent));
+    to->pQueueFamilyIndices = nullptr;
+    if (from->pQueueFamilyIndices) {
+        to->pQueueFamilyIndices = (uint32_t*)alloc->dupArray(
+            from->pQueueFamilyIndices, from->queueFamilyIndexCount * sizeof(const uint32_t));
+    }
+}
+
+void deepcopy_VkSubresourceLayout(Allocator* alloc, VkStructureType rootType,
+                                  const VkSubresourceLayout* from, VkSubresourceLayout* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkComponentMapping(Allocator* alloc, VkStructureType rootType,
+                                 const VkComponentMapping* from, VkComponentMapping* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkImageViewCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                    const VkImageViewCreateInfo* from, VkImageViewCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkComponentMapping(alloc, rootType, &from->components,
+                                (VkComponentMapping*)(&to->components));
+    deepcopy_VkImageSubresourceRange(alloc, rootType, &from->subresourceRange,
+                                     (VkImageSubresourceRange*)(&to->subresourceRange));
+}
+
+void deepcopy_VkShaderModuleCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                       const VkShaderModuleCreateInfo* from,
+                                       VkShaderModuleCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pCode = nullptr;
+    if (from->pCode) {
+        to->pCode =
+            (uint32_t*)alloc->dupArray(from->pCode, (from->codeSize / 4) * sizeof(const uint32_t));
+    }
+}
+
+void deepcopy_VkPipelineCacheCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                        const VkPipelineCacheCreateInfo* from,
+                                        VkPipelineCacheCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pInitialData = nullptr;
+    if (from->pInitialData) {
+        to->pInitialData = (void*)alloc->dupArray(from->pInitialData,
+                                                  from->initialDataSize * sizeof(const uint8_t));
+    }
+}
+
+void deepcopy_VkSpecializationMapEntry(Allocator* alloc, VkStructureType rootType,
+                                       const VkSpecializationMapEntry* from,
+                                       VkSpecializationMapEntry* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkSpecializationInfo(Allocator* alloc, VkStructureType rootType,
+                                   const VkSpecializationInfo* from, VkSpecializationInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (from) {
+        to->pMapEntries = nullptr;
+        if (from->pMapEntries) {
+            to->pMapEntries = (VkSpecializationMapEntry*)alloc->alloc(
+                from->mapEntryCount * sizeof(const VkSpecializationMapEntry));
+            to->mapEntryCount = from->mapEntryCount;
+            for (uint32_t i = 0; i < (uint32_t)from->mapEntryCount; ++i) {
+                deepcopy_VkSpecializationMapEntry(alloc, rootType, from->pMapEntries + i,
+                                                  (VkSpecializationMapEntry*)(to->pMapEntries + i));
+            }
+        }
+    }
+    to->pData = nullptr;
+    if (from->pData) {
+        to->pData = (void*)alloc->dupArray(from->pData, from->dataSize * sizeof(const uint8_t));
+    }
+}
+
+void deepcopy_VkPipelineShaderStageCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                              const VkPipelineShaderStageCreateInfo* from,
+                                              VkPipelineShaderStageCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pName = nullptr;
+    if (from->pName) {
+        to->pName = alloc->strDup(from->pName);
+    }
+    to->pSpecializationInfo = nullptr;
+    if (from->pSpecializationInfo) {
+        to->pSpecializationInfo =
+            (VkSpecializationInfo*)alloc->alloc(sizeof(const VkSpecializationInfo));
+        deepcopy_VkSpecializationInfo(alloc, rootType, from->pSpecializationInfo,
+                                      (VkSpecializationInfo*)(to->pSpecializationInfo));
+    }
+}
+
+void deepcopy_VkComputePipelineCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                          const VkComputePipelineCreateInfo* from,
+                                          VkComputePipelineCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkPipelineShaderStageCreateInfo(alloc, rootType, &from->stage,
+                                             (VkPipelineShaderStageCreateInfo*)(&to->stage));
+}
+
+void deepcopy_VkVertexInputBindingDescription(Allocator* alloc, VkStructureType rootType,
+                                              const VkVertexInputBindingDescription* from,
+                                              VkVertexInputBindingDescription* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkVertexInputAttributeDescription(Allocator* alloc, VkStructureType rootType,
+                                                const VkVertexInputAttributeDescription* from,
+                                                VkVertexInputAttributeDescription* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkPipelineVertexInputStateCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                                   const VkPipelineVertexInputStateCreateInfo* from,
+                                                   VkPipelineVertexInputStateCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pVertexBindingDescriptions = nullptr;
+        if (from->pVertexBindingDescriptions) {
+            to->pVertexBindingDescriptions = (VkVertexInputBindingDescription*)alloc->alloc(
+                from->vertexBindingDescriptionCount *
+                sizeof(const VkVertexInputBindingDescription));
+            to->vertexBindingDescriptionCount = from->vertexBindingDescriptionCount;
+            for (uint32_t i = 0; i < (uint32_t)from->vertexBindingDescriptionCount; ++i) {
+                deepcopy_VkVertexInputBindingDescription(
+                    alloc, rootType, from->pVertexBindingDescriptions + i,
+                    (VkVertexInputBindingDescription*)(to->pVertexBindingDescriptions + i));
+            }
+        }
+    }
+    if (from) {
+        to->pVertexAttributeDescriptions = nullptr;
+        if (from->pVertexAttributeDescriptions) {
+            to->pVertexAttributeDescriptions = (VkVertexInputAttributeDescription*)alloc->alloc(
+                from->vertexAttributeDescriptionCount *
+                sizeof(const VkVertexInputAttributeDescription));
+            to->vertexAttributeDescriptionCount = from->vertexAttributeDescriptionCount;
+            for (uint32_t i = 0; i < (uint32_t)from->vertexAttributeDescriptionCount; ++i) {
+                deepcopy_VkVertexInputAttributeDescription(
+                    alloc, rootType, from->pVertexAttributeDescriptions + i,
+                    (VkVertexInputAttributeDescription*)(to->pVertexAttributeDescriptions + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkPipelineInputAssemblyStateCreateInfo(
+    Allocator* alloc, VkStructureType rootType, const VkPipelineInputAssemblyStateCreateInfo* from,
+    VkPipelineInputAssemblyStateCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPipelineTessellationStateCreateInfo(
+    Allocator* alloc, VkStructureType rootType, const VkPipelineTessellationStateCreateInfo* from,
+    VkPipelineTessellationStateCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkViewport(Allocator* alloc, VkStructureType rootType, const VkViewport* from,
+                         VkViewport* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkPipelineViewportStateCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                                const VkPipelineViewportStateCreateInfo* from,
+                                                VkPipelineViewportStateCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pViewports = nullptr;
+        if (from->pViewports) {
+            to->pViewports =
+                (VkViewport*)alloc->alloc(from->viewportCount * sizeof(const VkViewport));
+            to->viewportCount = from->viewportCount;
+            for (uint32_t i = 0; i < (uint32_t)from->viewportCount; ++i) {
+                deepcopy_VkViewport(alloc, rootType, from->pViewports + i,
+                                    (VkViewport*)(to->pViewports + i));
+            }
+        }
+    }
+    if (from) {
+        to->pScissors = nullptr;
+        if (from->pScissors) {
+            to->pScissors = (VkRect2D*)alloc->alloc(from->scissorCount * sizeof(const VkRect2D));
+            to->scissorCount = from->scissorCount;
+            for (uint32_t i = 0; i < (uint32_t)from->scissorCount; ++i) {
+                deepcopy_VkRect2D(alloc, rootType, from->pScissors + i,
+                                  (VkRect2D*)(to->pScissors + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkPipelineRasterizationStateCreateInfo(
+    Allocator* alloc, VkStructureType rootType, const VkPipelineRasterizationStateCreateInfo* from,
+    VkPipelineRasterizationStateCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPipelineMultisampleStateCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                                   const VkPipelineMultisampleStateCreateInfo* from,
+                                                   VkPipelineMultisampleStateCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pSampleMask = nullptr;
+    if (from->pSampleMask) {
+        to->pSampleMask = (VkSampleMask*)alloc->dupArray(
+            from->pSampleMask,
+            (((from->rasterizationSamples) + 31) / 32) * sizeof(const VkSampleMask));
+    }
+}
+
+void deepcopy_VkStencilOpState(Allocator* alloc, VkStructureType rootType,
+                               const VkStencilOpState* from, VkStencilOpState* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkPipelineDepthStencilStateCreateInfo(
+    Allocator* alloc, VkStructureType rootType, const VkPipelineDepthStencilStateCreateInfo* from,
+    VkPipelineDepthStencilStateCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkStencilOpState(alloc, rootType, &from->front, (VkStencilOpState*)(&to->front));
+    deepcopy_VkStencilOpState(alloc, rootType, &from->back, (VkStencilOpState*)(&to->back));
+}
+
+void deepcopy_VkPipelineColorBlendAttachmentState(Allocator* alloc, VkStructureType rootType,
+                                                  const VkPipelineColorBlendAttachmentState* from,
+                                                  VkPipelineColorBlendAttachmentState* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkPipelineColorBlendStateCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                                  const VkPipelineColorBlendStateCreateInfo* from,
+                                                  VkPipelineColorBlendStateCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pAttachments = nullptr;
+        if (from->pAttachments) {
+            to->pAttachments = (VkPipelineColorBlendAttachmentState*)alloc->alloc(
+                from->attachmentCount * sizeof(const VkPipelineColorBlendAttachmentState));
+            to->attachmentCount = from->attachmentCount;
+            for (uint32_t i = 0; i < (uint32_t)from->attachmentCount; ++i) {
+                deepcopy_VkPipelineColorBlendAttachmentState(
+                    alloc, rootType, from->pAttachments + i,
+                    (VkPipelineColorBlendAttachmentState*)(to->pAttachments + i));
+            }
+        }
+    }
+    memcpy(to->blendConstants, from->blendConstants, 4 * sizeof(float));
+}
+
+void deepcopy_VkPipelineDynamicStateCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                               const VkPipelineDynamicStateCreateInfo* from,
+                                               VkPipelineDynamicStateCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pDynamicStates = nullptr;
+    if (from->pDynamicStates) {
+        to->pDynamicStates = (VkDynamicState*)alloc->dupArray(
+            from->pDynamicStates, from->dynamicStateCount * sizeof(const VkDynamicState));
+    }
+}
+
+void deepcopy_VkGraphicsPipelineCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                           const VkGraphicsPipelineCreateInfo* from,
+                                           VkGraphicsPipelineCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pStages = nullptr;
+        if (from->pStages) {
+            to->pStages = (VkPipelineShaderStageCreateInfo*)alloc->alloc(
+                from->stageCount * sizeof(const VkPipelineShaderStageCreateInfo));
+            to->stageCount = from->stageCount;
+            for (uint32_t i = 0; i < (uint32_t)from->stageCount; ++i) {
+                deepcopy_VkPipelineShaderStageCreateInfo(
+                    alloc, rootType, from->pStages + i,
+                    (VkPipelineShaderStageCreateInfo*)(to->pStages + i));
+            }
+        }
+    }
+    to->pVertexInputState = nullptr;
+    if (from->pVertexInputState) {
+        to->pVertexInputState = (VkPipelineVertexInputStateCreateInfo*)alloc->alloc(
+            sizeof(const VkPipelineVertexInputStateCreateInfo));
+        deepcopy_VkPipelineVertexInputStateCreateInfo(
+            alloc, rootType, from->pVertexInputState,
+            (VkPipelineVertexInputStateCreateInfo*)(to->pVertexInputState));
+    }
+    to->pInputAssemblyState = nullptr;
+    if (from->pInputAssemblyState) {
+        to->pInputAssemblyState = (VkPipelineInputAssemblyStateCreateInfo*)alloc->alloc(
+            sizeof(const VkPipelineInputAssemblyStateCreateInfo));
+        deepcopy_VkPipelineInputAssemblyStateCreateInfo(
+            alloc, rootType, from->pInputAssemblyState,
+            (VkPipelineInputAssemblyStateCreateInfo*)(to->pInputAssemblyState));
+    }
+    to->pTessellationState = nullptr;
+    if (from->pTessellationState) {
+        to->pTessellationState = (VkPipelineTessellationStateCreateInfo*)alloc->alloc(
+            sizeof(const VkPipelineTessellationStateCreateInfo));
+        deepcopy_VkPipelineTessellationStateCreateInfo(
+            alloc, rootType, from->pTessellationState,
+            (VkPipelineTessellationStateCreateInfo*)(to->pTessellationState));
+    }
+    to->pViewportState = nullptr;
+    if (from->pViewportState) {
+        to->pViewportState = (VkPipelineViewportStateCreateInfo*)alloc->alloc(
+            sizeof(const VkPipelineViewportStateCreateInfo));
+        deepcopy_VkPipelineViewportStateCreateInfo(
+            alloc, rootType, from->pViewportState,
+            (VkPipelineViewportStateCreateInfo*)(to->pViewportState));
+    }
+    to->pRasterizationState = nullptr;
+    if (from->pRasterizationState) {
+        to->pRasterizationState = (VkPipelineRasterizationStateCreateInfo*)alloc->alloc(
+            sizeof(const VkPipelineRasterizationStateCreateInfo));
+        deepcopy_VkPipelineRasterizationStateCreateInfo(
+            alloc, rootType, from->pRasterizationState,
+            (VkPipelineRasterizationStateCreateInfo*)(to->pRasterizationState));
+    }
+    to->pMultisampleState = nullptr;
+    if (from->pMultisampleState) {
+        to->pMultisampleState = (VkPipelineMultisampleStateCreateInfo*)alloc->alloc(
+            sizeof(const VkPipelineMultisampleStateCreateInfo));
+        deepcopy_VkPipelineMultisampleStateCreateInfo(
+            alloc, rootType, from->pMultisampleState,
+            (VkPipelineMultisampleStateCreateInfo*)(to->pMultisampleState));
+    }
+    to->pDepthStencilState = nullptr;
+    if (from->pDepthStencilState) {
+        to->pDepthStencilState = (VkPipelineDepthStencilStateCreateInfo*)alloc->alloc(
+            sizeof(const VkPipelineDepthStencilStateCreateInfo));
+        deepcopy_VkPipelineDepthStencilStateCreateInfo(
+            alloc, rootType, from->pDepthStencilState,
+            (VkPipelineDepthStencilStateCreateInfo*)(to->pDepthStencilState));
+    }
+    to->pColorBlendState = nullptr;
+    if (from->pColorBlendState) {
+        to->pColorBlendState = (VkPipelineColorBlendStateCreateInfo*)alloc->alloc(
+            sizeof(const VkPipelineColorBlendStateCreateInfo));
+        deepcopy_VkPipelineColorBlendStateCreateInfo(
+            alloc, rootType, from->pColorBlendState,
+            (VkPipelineColorBlendStateCreateInfo*)(to->pColorBlendState));
+    }
+    to->pDynamicState = nullptr;
+    if (from->pDynamicState) {
+        to->pDynamicState = (VkPipelineDynamicStateCreateInfo*)alloc->alloc(
+            sizeof(const VkPipelineDynamicStateCreateInfo));
+        deepcopy_VkPipelineDynamicStateCreateInfo(
+            alloc, rootType, from->pDynamicState,
+            (VkPipelineDynamicStateCreateInfo*)(to->pDynamicState));
+    }
+}
+
+void deepcopy_VkPushConstantRange(Allocator* alloc, VkStructureType rootType,
+                                  const VkPushConstantRange* from, VkPushConstantRange* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkPipelineLayoutCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                         const VkPipelineLayoutCreateInfo* from,
+                                         VkPipelineLayoutCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pSetLayouts = nullptr;
+    if (from->pSetLayouts) {
+        to->pSetLayouts = (VkDescriptorSetLayout*)alloc->dupArray(
+            from->pSetLayouts, from->setLayoutCount * sizeof(const VkDescriptorSetLayout));
+    }
+    if (from) {
+        to->pPushConstantRanges = nullptr;
+        if (from->pPushConstantRanges) {
+            to->pPushConstantRanges = (VkPushConstantRange*)alloc->alloc(
+                from->pushConstantRangeCount * sizeof(const VkPushConstantRange));
+            to->pushConstantRangeCount = from->pushConstantRangeCount;
+            for (uint32_t i = 0; i < (uint32_t)from->pushConstantRangeCount; ++i) {
+                deepcopy_VkPushConstantRange(alloc, rootType, from->pPushConstantRanges + i,
+                                             (VkPushConstantRange*)(to->pPushConstantRanges + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkSamplerCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                  const VkSamplerCreateInfo* from, VkSamplerCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkCopyDescriptorSet(Allocator* alloc, VkStructureType rootType,
+                                  const VkCopyDescriptorSet* from, VkCopyDescriptorSet* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkDescriptorBufferInfo(Allocator* alloc, VkStructureType rootType,
+                                     const VkDescriptorBufferInfo* from,
+                                     VkDescriptorBufferInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkDescriptorImageInfo(Allocator* alloc, VkStructureType rootType,
+                                    const VkDescriptorImageInfo* from, VkDescriptorImageInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkDescriptorPoolSize(Allocator* alloc, VkStructureType rootType,
+                                   const VkDescriptorPoolSize* from, VkDescriptorPoolSize* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkDescriptorPoolCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                         const VkDescriptorPoolCreateInfo* from,
+                                         VkDescriptorPoolCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pPoolSizes = nullptr;
+        if (from->pPoolSizes) {
+            to->pPoolSizes = (VkDescriptorPoolSize*)alloc->alloc(
+                from->poolSizeCount * sizeof(const VkDescriptorPoolSize));
+            to->poolSizeCount = from->poolSizeCount;
+            for (uint32_t i = 0; i < (uint32_t)from->poolSizeCount; ++i) {
+                deepcopy_VkDescriptorPoolSize(alloc, rootType, from->pPoolSizes + i,
+                                              (VkDescriptorPoolSize*)(to->pPoolSizes + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkDescriptorSetAllocateInfo(Allocator* alloc, VkStructureType rootType,
+                                          const VkDescriptorSetAllocateInfo* from,
+                                          VkDescriptorSetAllocateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pSetLayouts = nullptr;
+    if (from->pSetLayouts) {
+        to->pSetLayouts = (VkDescriptorSetLayout*)alloc->dupArray(
+            from->pSetLayouts, from->descriptorSetCount * sizeof(const VkDescriptorSetLayout));
+    }
+}
+
+void deepcopy_VkDescriptorSetLayoutBinding(Allocator* alloc, VkStructureType rootType,
+                                           const VkDescriptorSetLayoutBinding* from,
+                                           VkDescriptorSetLayoutBinding* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    to->pImmutableSamplers = nullptr;
+    if (from->pImmutableSamplers) {
+        to->pImmutableSamplers = (VkSampler*)alloc->dupArray(
+            from->pImmutableSamplers, from->descriptorCount * sizeof(const VkSampler));
+    }
+}
+
+void deepcopy_VkDescriptorSetLayoutCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                              const VkDescriptorSetLayoutCreateInfo* from,
+                                              VkDescriptorSetLayoutCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pBindings = nullptr;
+        if (from->pBindings) {
+            to->pBindings = (VkDescriptorSetLayoutBinding*)alloc->alloc(
+                from->bindingCount * sizeof(const VkDescriptorSetLayoutBinding));
+            to->bindingCount = from->bindingCount;
+            for (uint32_t i = 0; i < (uint32_t)from->bindingCount; ++i) {
+                deepcopy_VkDescriptorSetLayoutBinding(
+                    alloc, rootType, from->pBindings + i,
+                    (VkDescriptorSetLayoutBinding*)(to->pBindings + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkWriteDescriptorSet(Allocator* alloc, VkStructureType rootType,
+                                   const VkWriteDescriptorSet* from, VkWriteDescriptorSet* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pImageInfo = nullptr;
+        if (from->pImageInfo) {
+            to->pImageInfo = (VkDescriptorImageInfo*)alloc->alloc(
+                from->descriptorCount * sizeof(const VkDescriptorImageInfo));
+            to->descriptorCount = from->descriptorCount;
+            for (uint32_t i = 0; i < (uint32_t)from->descriptorCount; ++i) {
+                deepcopy_VkDescriptorImageInfo(alloc, rootType, from->pImageInfo + i,
+                                               (VkDescriptorImageInfo*)(to->pImageInfo + i));
+            }
+        }
+    }
+    if (from) {
+        to->pBufferInfo = nullptr;
+        if (from->pBufferInfo) {
+            to->pBufferInfo = (VkDescriptorBufferInfo*)alloc->alloc(
+                from->descriptorCount * sizeof(const VkDescriptorBufferInfo));
+            to->descriptorCount = from->descriptorCount;
+            for (uint32_t i = 0; i < (uint32_t)from->descriptorCount; ++i) {
+                deepcopy_VkDescriptorBufferInfo(alloc, rootType, from->pBufferInfo + i,
+                                                (VkDescriptorBufferInfo*)(to->pBufferInfo + i));
+            }
+        }
+    }
+    to->pTexelBufferView = nullptr;
+    if (from->pTexelBufferView) {
+        to->pTexelBufferView = (VkBufferView*)alloc->dupArray(
+            from->pTexelBufferView, from->descriptorCount * sizeof(const VkBufferView));
+    }
+}
+
+void deepcopy_VkAttachmentDescription(Allocator* alloc, VkStructureType rootType,
+                                      const VkAttachmentDescription* from,
+                                      VkAttachmentDescription* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkAttachmentReference(Allocator* alloc, VkStructureType rootType,
+                                    const VkAttachmentReference* from, VkAttachmentReference* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkFramebufferCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                      const VkFramebufferCreateInfo* from,
+                                      VkFramebufferCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pAttachments = nullptr;
+    if (from->pAttachments) {
+        to->pAttachments = (VkImageView*)alloc->dupArray(
+            from->pAttachments, from->attachmentCount * sizeof(const VkImageView));
+    }
+}
+
+void deepcopy_VkSubpassDescription(Allocator* alloc, VkStructureType rootType,
+                                   const VkSubpassDescription* from, VkSubpassDescription* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (from) {
+        to->pInputAttachments = nullptr;
+        if (from->pInputAttachments) {
+            to->pInputAttachments = (VkAttachmentReference*)alloc->alloc(
+                from->inputAttachmentCount * sizeof(const VkAttachmentReference));
+            to->inputAttachmentCount = from->inputAttachmentCount;
+            for (uint32_t i = 0; i < (uint32_t)from->inputAttachmentCount; ++i) {
+                deepcopy_VkAttachmentReference(alloc, rootType, from->pInputAttachments + i,
+                                               (VkAttachmentReference*)(to->pInputAttachments + i));
+            }
+        }
+    }
+    if (from) {
+        to->pColorAttachments = nullptr;
+        if (from->pColorAttachments) {
+            to->pColorAttachments = (VkAttachmentReference*)alloc->alloc(
+                from->colorAttachmentCount * sizeof(const VkAttachmentReference));
+            to->colorAttachmentCount = from->colorAttachmentCount;
+            for (uint32_t i = 0; i < (uint32_t)from->colorAttachmentCount; ++i) {
+                deepcopy_VkAttachmentReference(alloc, rootType, from->pColorAttachments + i,
+                                               (VkAttachmentReference*)(to->pColorAttachments + i));
+            }
+        }
+    }
+    if (from) {
+        to->pResolveAttachments = nullptr;
+        if (from->pResolveAttachments) {
+            to->pResolveAttachments = (VkAttachmentReference*)alloc->alloc(
+                from->colorAttachmentCount * sizeof(const VkAttachmentReference));
+            to->colorAttachmentCount = from->colorAttachmentCount;
+            for (uint32_t i = 0; i < (uint32_t)from->colorAttachmentCount; ++i) {
+                deepcopy_VkAttachmentReference(
+                    alloc, rootType, from->pResolveAttachments + i,
+                    (VkAttachmentReference*)(to->pResolveAttachments + i));
+            }
+        }
+    }
+    to->pDepthStencilAttachment = nullptr;
+    if (from->pDepthStencilAttachment) {
+        to->pDepthStencilAttachment =
+            (VkAttachmentReference*)alloc->alloc(sizeof(const VkAttachmentReference));
+        deepcopy_VkAttachmentReference(alloc, rootType, from->pDepthStencilAttachment,
+                                       (VkAttachmentReference*)(to->pDepthStencilAttachment));
+    }
+    to->pPreserveAttachments = nullptr;
+    if (from->pPreserveAttachments) {
+        to->pPreserveAttachments = (uint32_t*)alloc->dupArray(
+            from->pPreserveAttachments, from->preserveAttachmentCount * sizeof(const uint32_t));
+    }
+}
+
+void deepcopy_VkSubpassDependency(Allocator* alloc, VkStructureType rootType,
+                                  const VkSubpassDependency* from, VkSubpassDependency* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkRenderPassCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                     const VkRenderPassCreateInfo* from,
+                                     VkRenderPassCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pAttachments = nullptr;
+        if (from->pAttachments) {
+            to->pAttachments = (VkAttachmentDescription*)alloc->alloc(
+                from->attachmentCount * sizeof(const VkAttachmentDescription));
+            to->attachmentCount = from->attachmentCount;
+            for (uint32_t i = 0; i < (uint32_t)from->attachmentCount; ++i) {
+                deepcopy_VkAttachmentDescription(alloc, rootType, from->pAttachments + i,
+                                                 (VkAttachmentDescription*)(to->pAttachments + i));
+            }
+        }
+    }
+    if (from) {
+        to->pSubpasses = nullptr;
+        if (from->pSubpasses) {
+            to->pSubpasses = (VkSubpassDescription*)alloc->alloc(
+                from->subpassCount * sizeof(const VkSubpassDescription));
+            to->subpassCount = from->subpassCount;
+            for (uint32_t i = 0; i < (uint32_t)from->subpassCount; ++i) {
+                deepcopy_VkSubpassDescription(alloc, rootType, from->pSubpasses + i,
+                                              (VkSubpassDescription*)(to->pSubpasses + i));
+            }
+        }
+    }
+    if (from) {
+        to->pDependencies = nullptr;
+        if (from->pDependencies) {
+            to->pDependencies = (VkSubpassDependency*)alloc->alloc(
+                from->dependencyCount * sizeof(const VkSubpassDependency));
+            to->dependencyCount = from->dependencyCount;
+            for (uint32_t i = 0; i < (uint32_t)from->dependencyCount; ++i) {
+                deepcopy_VkSubpassDependency(alloc, rootType, from->pDependencies + i,
+                                             (VkSubpassDependency*)(to->pDependencies + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkCommandPoolCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                      const VkCommandPoolCreateInfo* from,
+                                      VkCommandPoolCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkCommandBufferAllocateInfo(Allocator* alloc, VkStructureType rootType,
+                                          const VkCommandBufferAllocateInfo* from,
+                                          VkCommandBufferAllocateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkCommandBufferInheritanceInfo(Allocator* alloc, VkStructureType rootType,
+                                             const VkCommandBufferInheritanceInfo* from,
+                                             VkCommandBufferInheritanceInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkCommandBufferBeginInfo(Allocator* alloc, VkStructureType rootType,
+                                       const VkCommandBufferBeginInfo* from,
+                                       VkCommandBufferBeginInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pInheritanceInfo = nullptr;
+    if (from->pInheritanceInfo) {
+        to->pInheritanceInfo = (VkCommandBufferInheritanceInfo*)alloc->alloc(
+            sizeof(const VkCommandBufferInheritanceInfo));
+        deepcopy_VkCommandBufferInheritanceInfo(
+            alloc, rootType, from->pInheritanceInfo,
+            (VkCommandBufferInheritanceInfo*)(to->pInheritanceInfo));
+    }
+}
+
+void deepcopy_VkBufferCopy(Allocator* alloc, VkStructureType rootType, const VkBufferCopy* from,
+                           VkBufferCopy* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkImageSubresourceLayers(Allocator* alloc, VkStructureType rootType,
+                                       const VkImageSubresourceLayers* from,
+                                       VkImageSubresourceLayers* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkBufferImageCopy(Allocator* alloc, VkStructureType rootType,
+                                const VkBufferImageCopy* from, VkBufferImageCopy* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->imageSubresource,
+                                      (VkImageSubresourceLayers*)(&to->imageSubresource));
+    deepcopy_VkOffset3D(alloc, rootType, &from->imageOffset, (VkOffset3D*)(&to->imageOffset));
+    deepcopy_VkExtent3D(alloc, rootType, &from->imageExtent, (VkExtent3D*)(&to->imageExtent));
+}
+
+void deepcopy_VkClearColorValue(Allocator* alloc, VkStructureType rootType,
+                                const VkClearColorValue* from, VkClearColorValue* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    memcpy(to->float32, from->float32, 4 * sizeof(float));
+    memcpy(to->int32, from->int32, 4 * sizeof(int32_t));
+    memcpy(to->uint32, from->uint32, 4 * sizeof(uint32_t));
+}
+
+void deepcopy_VkClearDepthStencilValue(Allocator* alloc, VkStructureType rootType,
+                                       const VkClearDepthStencilValue* from,
+                                       VkClearDepthStencilValue* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkClearValue(Allocator* alloc, VkStructureType rootType, const VkClearValue* from,
+                           VkClearValue* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkClearColorValue(alloc, rootType, &from->color, (VkClearColorValue*)(&to->color));
+    deepcopy_VkClearDepthStencilValue(alloc, rootType, &from->depthStencil,
+                                      (VkClearDepthStencilValue*)(&to->depthStencil));
+}
+
+void deepcopy_VkClearAttachment(Allocator* alloc, VkStructureType rootType,
+                                const VkClearAttachment* from, VkClearAttachment* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkClearValue(alloc, rootType, &from->clearValue, (VkClearValue*)(&to->clearValue));
+}
+
+void deepcopy_VkClearRect(Allocator* alloc, VkStructureType rootType, const VkClearRect* from,
+                          VkClearRect* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkRect2D(alloc, rootType, &from->rect, (VkRect2D*)(&to->rect));
+}
+
+void deepcopy_VkImageBlit(Allocator* alloc, VkStructureType rootType, const VkImageBlit* from,
+                          VkImageBlit* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->srcSubresource,
+                                      (VkImageSubresourceLayers*)(&to->srcSubresource));
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        deepcopy_VkOffset3D(alloc, rootType, from->srcOffsets + i,
+                            (VkOffset3D*)(to->srcOffsets + i));
+    }
+    deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->dstSubresource,
+                                      (VkImageSubresourceLayers*)(&to->dstSubresource));
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        deepcopy_VkOffset3D(alloc, rootType, from->dstOffsets + i,
+                            (VkOffset3D*)(to->dstOffsets + i));
+    }
+}
+
+void deepcopy_VkImageCopy(Allocator* alloc, VkStructureType rootType, const VkImageCopy* from,
+                          VkImageCopy* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->srcSubresource,
+                                      (VkImageSubresourceLayers*)(&to->srcSubresource));
+    deepcopy_VkOffset3D(alloc, rootType, &from->srcOffset, (VkOffset3D*)(&to->srcOffset));
+    deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->dstSubresource,
+                                      (VkImageSubresourceLayers*)(&to->dstSubresource));
+    deepcopy_VkOffset3D(alloc, rootType, &from->dstOffset, (VkOffset3D*)(&to->dstOffset));
+    deepcopy_VkExtent3D(alloc, rootType, &from->extent, (VkExtent3D*)(&to->extent));
+}
+
+void deepcopy_VkImageResolve(Allocator* alloc, VkStructureType rootType, const VkImageResolve* from,
+                             VkImageResolve* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->srcSubresource,
+                                      (VkImageSubresourceLayers*)(&to->srcSubresource));
+    deepcopy_VkOffset3D(alloc, rootType, &from->srcOffset, (VkOffset3D*)(&to->srcOffset));
+    deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->dstSubresource,
+                                      (VkImageSubresourceLayers*)(&to->dstSubresource));
+    deepcopy_VkOffset3D(alloc, rootType, &from->dstOffset, (VkOffset3D*)(&to->dstOffset));
+    deepcopy_VkExtent3D(alloc, rootType, &from->extent, (VkExtent3D*)(&to->extent));
+}
+
+void deepcopy_VkRenderPassBeginInfo(Allocator* alloc, VkStructureType rootType,
+                                    const VkRenderPassBeginInfo* from, VkRenderPassBeginInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkRect2D(alloc, rootType, &from->renderArea, (VkRect2D*)(&to->renderArea));
+    if (from) {
+        to->pClearValues = nullptr;
+        if (from->pClearValues) {
+            to->pClearValues =
+                (VkClearValue*)alloc->alloc(from->clearValueCount * sizeof(const VkClearValue));
+            to->clearValueCount = from->clearValueCount;
+            for (uint32_t i = 0; i < (uint32_t)from->clearValueCount; ++i) {
+                deepcopy_VkClearValue(alloc, rootType, from->pClearValues + i,
+                                      (VkClearValue*)(to->pClearValues + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_VERSION_1_1
+void deepcopy_VkPhysicalDeviceSubgroupProperties(Allocator* alloc, VkStructureType rootType,
+                                                 const VkPhysicalDeviceSubgroupProperties* from,
+                                                 VkPhysicalDeviceSubgroupProperties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkBindBufferMemoryInfo(Allocator* alloc, VkStructureType rootType,
+                                     const VkBindBufferMemoryInfo* from,
+                                     VkBindBufferMemoryInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkBindImageMemoryInfo(Allocator* alloc, VkStructureType rootType,
+                                    const VkBindImageMemoryInfo* from, VkBindImageMemoryInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDevice16BitStorageFeatures(Allocator* alloc, VkStructureType rootType,
+                                                   const VkPhysicalDevice16BitStorageFeatures* from,
+                                                   VkPhysicalDevice16BitStorageFeatures* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkMemoryDedicatedRequirements(Allocator* alloc, VkStructureType rootType,
+                                            const VkMemoryDedicatedRequirements* from,
+                                            VkMemoryDedicatedRequirements* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkMemoryDedicatedAllocateInfo(Allocator* alloc, VkStructureType rootType,
+                                            const VkMemoryDedicatedAllocateInfo* from,
+                                            VkMemoryDedicatedAllocateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkMemoryAllocateFlagsInfo(Allocator* alloc, VkStructureType rootType,
+                                        const VkMemoryAllocateFlagsInfo* from,
+                                        VkMemoryAllocateFlagsInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkDeviceGroupRenderPassBeginInfo(Allocator* alloc, VkStructureType rootType,
+                                               const VkDeviceGroupRenderPassBeginInfo* from,
+                                               VkDeviceGroupRenderPassBeginInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pDeviceRenderAreas = nullptr;
+        if (from->pDeviceRenderAreas) {
+            to->pDeviceRenderAreas =
+                (VkRect2D*)alloc->alloc(from->deviceRenderAreaCount * sizeof(const VkRect2D));
+            to->deviceRenderAreaCount = from->deviceRenderAreaCount;
+            for (uint32_t i = 0; i < (uint32_t)from->deviceRenderAreaCount; ++i) {
+                deepcopy_VkRect2D(alloc, rootType, from->pDeviceRenderAreas + i,
+                                  (VkRect2D*)(to->pDeviceRenderAreas + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkDeviceGroupCommandBufferBeginInfo(Allocator* alloc, VkStructureType rootType,
+                                                  const VkDeviceGroupCommandBufferBeginInfo* from,
+                                                  VkDeviceGroupCommandBufferBeginInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkDeviceGroupSubmitInfo(Allocator* alloc, VkStructureType rootType,
+                                      const VkDeviceGroupSubmitInfo* from,
+                                      VkDeviceGroupSubmitInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pWaitSemaphoreDeviceIndices = nullptr;
+    if (from->pWaitSemaphoreDeviceIndices) {
+        to->pWaitSemaphoreDeviceIndices = (uint32_t*)alloc->dupArray(
+            from->pWaitSemaphoreDeviceIndices, from->waitSemaphoreCount * sizeof(const uint32_t));
+    }
+    to->pCommandBufferDeviceMasks = nullptr;
+    if (from->pCommandBufferDeviceMasks) {
+        to->pCommandBufferDeviceMasks = (uint32_t*)alloc->dupArray(
+            from->pCommandBufferDeviceMasks, from->commandBufferCount * sizeof(const uint32_t));
+    }
+    to->pSignalSemaphoreDeviceIndices = nullptr;
+    if (from->pSignalSemaphoreDeviceIndices) {
+        to->pSignalSemaphoreDeviceIndices =
+            (uint32_t*)alloc->dupArray(from->pSignalSemaphoreDeviceIndices,
+                                       from->signalSemaphoreCount * sizeof(const uint32_t));
+    }
+}
+
+void deepcopy_VkDeviceGroupBindSparseInfo(Allocator* alloc, VkStructureType rootType,
+                                          const VkDeviceGroupBindSparseInfo* from,
+                                          VkDeviceGroupBindSparseInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkBindBufferMemoryDeviceGroupInfo(Allocator* alloc, VkStructureType rootType,
+                                                const VkBindBufferMemoryDeviceGroupInfo* from,
+                                                VkBindBufferMemoryDeviceGroupInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pDeviceIndices = nullptr;
+    if (from->pDeviceIndices) {
+        to->pDeviceIndices = (uint32_t*)alloc->dupArray(
+            from->pDeviceIndices, from->deviceIndexCount * sizeof(const uint32_t));
+    }
+}
+
+void deepcopy_VkBindImageMemoryDeviceGroupInfo(Allocator* alloc, VkStructureType rootType,
+                                               const VkBindImageMemoryDeviceGroupInfo* from,
+                                               VkBindImageMemoryDeviceGroupInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pDeviceIndices = nullptr;
+    if (from->pDeviceIndices) {
+        to->pDeviceIndices = (uint32_t*)alloc->dupArray(
+            from->pDeviceIndices, from->deviceIndexCount * sizeof(const uint32_t));
+    }
+    if (from) {
+        to->pSplitInstanceBindRegions = nullptr;
+        if (from->pSplitInstanceBindRegions) {
+            to->pSplitInstanceBindRegions = (VkRect2D*)alloc->alloc(
+                from->splitInstanceBindRegionCount * sizeof(const VkRect2D));
+            to->splitInstanceBindRegionCount = from->splitInstanceBindRegionCount;
+            for (uint32_t i = 0; i < (uint32_t)from->splitInstanceBindRegionCount; ++i) {
+                deepcopy_VkRect2D(alloc, rootType, from->pSplitInstanceBindRegions + i,
+                                  (VkRect2D*)(to->pSplitInstanceBindRegions + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkPhysicalDeviceGroupProperties(Allocator* alloc, VkStructureType rootType,
+                                              const VkPhysicalDeviceGroupProperties* from,
+                                              VkPhysicalDeviceGroupProperties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    memcpy(to->physicalDevices, from->physicalDevices,
+           VK_MAX_DEVICE_GROUP_SIZE * sizeof(VkPhysicalDevice));
+}
+
+void deepcopy_VkDeviceGroupDeviceCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                            const VkDeviceGroupDeviceCreateInfo* from,
+                                            VkDeviceGroupDeviceCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pPhysicalDevices = nullptr;
+    if (from->pPhysicalDevices) {
+        to->pPhysicalDevices = (VkPhysicalDevice*)alloc->dupArray(
+            from->pPhysicalDevices, from->physicalDeviceCount * sizeof(const VkPhysicalDevice));
+    }
+}
+
+void deepcopy_VkBufferMemoryRequirementsInfo2(Allocator* alloc, VkStructureType rootType,
+                                              const VkBufferMemoryRequirementsInfo2* from,
+                                              VkBufferMemoryRequirementsInfo2* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkImageMemoryRequirementsInfo2(Allocator* alloc, VkStructureType rootType,
+                                             const VkImageMemoryRequirementsInfo2* from,
+                                             VkImageMemoryRequirementsInfo2* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkImageSparseMemoryRequirementsInfo2(Allocator* alloc, VkStructureType rootType,
+                                                   const VkImageSparseMemoryRequirementsInfo2* from,
+                                                   VkImageSparseMemoryRequirementsInfo2* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkMemoryRequirements2(Allocator* alloc, VkStructureType rootType,
+                                    const VkMemoryRequirements2* from, VkMemoryRequirements2* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkMemoryRequirements(alloc, rootType, &from->memoryRequirements,
+                                  (VkMemoryRequirements*)(&to->memoryRequirements));
+}
+
+void deepcopy_VkSparseImageMemoryRequirements2(Allocator* alloc, VkStructureType rootType,
+                                               const VkSparseImageMemoryRequirements2* from,
+                                               VkSparseImageMemoryRequirements2* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkSparseImageMemoryRequirements(
+        alloc, rootType, &from->memoryRequirements,
+        (VkSparseImageMemoryRequirements*)(&to->memoryRequirements));
+}
+
+void deepcopy_VkPhysicalDeviceFeatures2(Allocator* alloc, VkStructureType rootType,
+                                        const VkPhysicalDeviceFeatures2* from,
+                                        VkPhysicalDeviceFeatures2* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkPhysicalDeviceFeatures(alloc, rootType, &from->features,
+                                      (VkPhysicalDeviceFeatures*)(&to->features));
+}
+
+void deepcopy_VkPhysicalDeviceProperties2(Allocator* alloc, VkStructureType rootType,
+                                          const VkPhysicalDeviceProperties2* from,
+                                          VkPhysicalDeviceProperties2* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkPhysicalDeviceProperties(alloc, rootType, &from->properties,
+                                        (VkPhysicalDeviceProperties*)(&to->properties));
+}
+
+void deepcopy_VkFormatProperties2(Allocator* alloc, VkStructureType rootType,
+                                  const VkFormatProperties2* from, VkFormatProperties2* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkFormatProperties(alloc, rootType, &from->formatProperties,
+                                (VkFormatProperties*)(&to->formatProperties));
+}
+
+void deepcopy_VkImageFormatProperties2(Allocator* alloc, VkStructureType rootType,
+                                       const VkImageFormatProperties2* from,
+                                       VkImageFormatProperties2* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkImageFormatProperties(alloc, rootType, &from->imageFormatProperties,
+                                     (VkImageFormatProperties*)(&to->imageFormatProperties));
+}
+
+void deepcopy_VkPhysicalDeviceImageFormatInfo2(Allocator* alloc, VkStructureType rootType,
+                                               const VkPhysicalDeviceImageFormatInfo2* from,
+                                               VkPhysicalDeviceImageFormatInfo2* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkQueueFamilyProperties2(Allocator* alloc, VkStructureType rootType,
+                                       const VkQueueFamilyProperties2* from,
+                                       VkQueueFamilyProperties2* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkQueueFamilyProperties(alloc, rootType, &from->queueFamilyProperties,
+                                     (VkQueueFamilyProperties*)(&to->queueFamilyProperties));
+}
+
+void deepcopy_VkPhysicalDeviceMemoryProperties2(Allocator* alloc, VkStructureType rootType,
+                                                const VkPhysicalDeviceMemoryProperties2* from,
+                                                VkPhysicalDeviceMemoryProperties2* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkPhysicalDeviceMemoryProperties(
+        alloc, rootType, &from->memoryProperties,
+        (VkPhysicalDeviceMemoryProperties*)(&to->memoryProperties));
+}
+
+void deepcopy_VkSparseImageFormatProperties2(Allocator* alloc, VkStructureType rootType,
+                                             const VkSparseImageFormatProperties2* from,
+                                             VkSparseImageFormatProperties2* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkSparseImageFormatProperties(alloc, rootType, &from->properties,
+                                           (VkSparseImageFormatProperties*)(&to->properties));
+}
+
+void deepcopy_VkPhysicalDeviceSparseImageFormatInfo2(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceSparseImageFormatInfo2* from,
+    VkPhysicalDeviceSparseImageFormatInfo2* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDevicePointClippingProperties(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDevicePointClippingProperties* from,
+    VkPhysicalDevicePointClippingProperties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkInputAttachmentAspectReference(Allocator* alloc, VkStructureType rootType,
+                                               const VkInputAttachmentAspectReference* from,
+                                               VkInputAttachmentAspectReference* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkRenderPassInputAttachmentAspectCreateInfo(
+    Allocator* alloc, VkStructureType rootType,
+    const VkRenderPassInputAttachmentAspectCreateInfo* from,
+    VkRenderPassInputAttachmentAspectCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pAspectReferences = nullptr;
+        if (from->pAspectReferences) {
+            to->pAspectReferences = (VkInputAttachmentAspectReference*)alloc->alloc(
+                from->aspectReferenceCount * sizeof(const VkInputAttachmentAspectReference));
+            to->aspectReferenceCount = from->aspectReferenceCount;
+            for (uint32_t i = 0; i < (uint32_t)from->aspectReferenceCount; ++i) {
+                deepcopy_VkInputAttachmentAspectReference(
+                    alloc, rootType, from->pAspectReferences + i,
+                    (VkInputAttachmentAspectReference*)(to->pAspectReferences + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkImageViewUsageCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                         const VkImageViewUsageCreateInfo* from,
+                                         VkImageViewUsageCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPipelineTessellationDomainOriginStateCreateInfo(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineTessellationDomainOriginStateCreateInfo* from,
+    VkPipelineTessellationDomainOriginStateCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkRenderPassMultiviewCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                              const VkRenderPassMultiviewCreateInfo* from,
+                                              VkRenderPassMultiviewCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pViewMasks = nullptr;
+    if (from->pViewMasks) {
+        to->pViewMasks = (uint32_t*)alloc->dupArray(from->pViewMasks,
+                                                    from->subpassCount * sizeof(const uint32_t));
+    }
+    to->pViewOffsets = nullptr;
+    if (from->pViewOffsets) {
+        to->pViewOffsets = (int32_t*)alloc->dupArray(from->pViewOffsets,
+                                                     from->dependencyCount * sizeof(const int32_t));
+    }
+    to->pCorrelationMasks = nullptr;
+    if (from->pCorrelationMasks) {
+        to->pCorrelationMasks = (uint32_t*)alloc->dupArray(
+            from->pCorrelationMasks, from->correlationMaskCount * sizeof(const uint32_t));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceMultiviewFeatures(Allocator* alloc, VkStructureType rootType,
+                                                const VkPhysicalDeviceMultiviewFeatures* from,
+                                                VkPhysicalDeviceMultiviewFeatures* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceMultiviewProperties(Allocator* alloc, VkStructureType rootType,
+                                                  const VkPhysicalDeviceMultiviewProperties* from,
+                                                  VkPhysicalDeviceMultiviewProperties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceVariablePointersFeatures(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceVariablePointersFeatures* from,
+    VkPhysicalDeviceVariablePointersFeatures* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceProtectedMemoryFeatures(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceProtectedMemoryFeatures* from,
+    VkPhysicalDeviceProtectedMemoryFeatures* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceProtectedMemoryProperties(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceProtectedMemoryProperties* from,
+    VkPhysicalDeviceProtectedMemoryProperties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkDeviceQueueInfo2(Allocator* alloc, VkStructureType rootType,
+                                 const VkDeviceQueueInfo2* from, VkDeviceQueueInfo2* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkProtectedSubmitInfo(Allocator* alloc, VkStructureType rootType,
+                                    const VkProtectedSubmitInfo* from, VkProtectedSubmitInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkSamplerYcbcrConversionCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                                 const VkSamplerYcbcrConversionCreateInfo* from,
+                                                 VkSamplerYcbcrConversionCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkComponentMapping(alloc, rootType, &from->components,
+                                (VkComponentMapping*)(&to->components));
+}
+
+void deepcopy_VkSamplerYcbcrConversionInfo(Allocator* alloc, VkStructureType rootType,
+                                           const VkSamplerYcbcrConversionInfo* from,
+                                           VkSamplerYcbcrConversionInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkBindImagePlaneMemoryInfo(Allocator* alloc, VkStructureType rootType,
+                                         const VkBindImagePlaneMemoryInfo* from,
+                                         VkBindImagePlaneMemoryInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkImagePlaneMemoryRequirementsInfo(Allocator* alloc, VkStructureType rootType,
+                                                 const VkImagePlaneMemoryRequirementsInfo* from,
+                                                 VkImagePlaneMemoryRequirementsInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceSamplerYcbcrConversionFeatures(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceSamplerYcbcrConversionFeatures* from,
+    VkPhysicalDeviceSamplerYcbcrConversionFeatures* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkSamplerYcbcrConversionImageFormatProperties(
+    Allocator* alloc, VkStructureType rootType,
+    const VkSamplerYcbcrConversionImageFormatProperties* from,
+    VkSamplerYcbcrConversionImageFormatProperties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkDescriptorUpdateTemplateEntry(Allocator* alloc, VkStructureType rootType,
+                                              const VkDescriptorUpdateTemplateEntry* from,
+                                              VkDescriptorUpdateTemplateEntry* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkDescriptorUpdateTemplateCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                                   const VkDescriptorUpdateTemplateCreateInfo* from,
+                                                   VkDescriptorUpdateTemplateCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pDescriptorUpdateEntries = nullptr;
+        if (from->pDescriptorUpdateEntries) {
+            to->pDescriptorUpdateEntries = (VkDescriptorUpdateTemplateEntry*)alloc->alloc(
+                from->descriptorUpdateEntryCount * sizeof(const VkDescriptorUpdateTemplateEntry));
+            to->descriptorUpdateEntryCount = from->descriptorUpdateEntryCount;
+            for (uint32_t i = 0; i < (uint32_t)from->descriptorUpdateEntryCount; ++i) {
+                deepcopy_VkDescriptorUpdateTemplateEntry(
+                    alloc, rootType, from->pDescriptorUpdateEntries + i,
+                    (VkDescriptorUpdateTemplateEntry*)(to->pDescriptorUpdateEntries + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkExternalMemoryProperties(Allocator* alloc, VkStructureType rootType,
+                                         const VkExternalMemoryProperties* from,
+                                         VkExternalMemoryProperties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkPhysicalDeviceExternalImageFormatInfo(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceExternalImageFormatInfo* from,
+    VkPhysicalDeviceExternalImageFormatInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkExternalImageFormatProperties(Allocator* alloc, VkStructureType rootType,
+                                              const VkExternalImageFormatProperties* from,
+                                              VkExternalImageFormatProperties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkExternalMemoryProperties(
+        alloc, rootType, &from->externalMemoryProperties,
+        (VkExternalMemoryProperties*)(&to->externalMemoryProperties));
+}
+
+void deepcopy_VkPhysicalDeviceExternalBufferInfo(Allocator* alloc, VkStructureType rootType,
+                                                 const VkPhysicalDeviceExternalBufferInfo* from,
+                                                 VkPhysicalDeviceExternalBufferInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkExternalBufferProperties(Allocator* alloc, VkStructureType rootType,
+                                         const VkExternalBufferProperties* from,
+                                         VkExternalBufferProperties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkExternalMemoryProperties(
+        alloc, rootType, &from->externalMemoryProperties,
+        (VkExternalMemoryProperties*)(&to->externalMemoryProperties));
+}
+
+void deepcopy_VkPhysicalDeviceIDProperties(Allocator* alloc, VkStructureType rootType,
+                                           const VkPhysicalDeviceIDProperties* from,
+                                           VkPhysicalDeviceIDProperties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    memcpy(to->deviceUUID, from->deviceUUID, VK_UUID_SIZE * sizeof(uint8_t));
+    memcpy(to->driverUUID, from->driverUUID, VK_UUID_SIZE * sizeof(uint8_t));
+    memcpy(to->deviceLUID, from->deviceLUID, VK_LUID_SIZE * sizeof(uint8_t));
+}
+
+void deepcopy_VkExternalMemoryImageCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                              const VkExternalMemoryImageCreateInfo* from,
+                                              VkExternalMemoryImageCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkExternalMemoryBufferCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                               const VkExternalMemoryBufferCreateInfo* from,
+                                               VkExternalMemoryBufferCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkExportMemoryAllocateInfo(Allocator* alloc, VkStructureType rootType,
+                                         const VkExportMemoryAllocateInfo* from,
+                                         VkExportMemoryAllocateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceExternalFenceInfo(Allocator* alloc, VkStructureType rootType,
+                                                const VkPhysicalDeviceExternalFenceInfo* from,
+                                                VkPhysicalDeviceExternalFenceInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkExternalFenceProperties(Allocator* alloc, VkStructureType rootType,
+                                        const VkExternalFenceProperties* from,
+                                        VkExternalFenceProperties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkExportFenceCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                      const VkExportFenceCreateInfo* from,
+                                      VkExportFenceCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkExportSemaphoreCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                          const VkExportSemaphoreCreateInfo* from,
+                                          VkExportSemaphoreCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceExternalSemaphoreInfo(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceExternalSemaphoreInfo* from,
+    VkPhysicalDeviceExternalSemaphoreInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkExternalSemaphoreProperties(Allocator* alloc, VkStructureType rootType,
+                                            const VkExternalSemaphoreProperties* from,
+                                            VkExternalSemaphoreProperties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceMaintenance3Properties(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceMaintenance3Properties* from,
+    VkPhysicalDeviceMaintenance3Properties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkDescriptorSetLayoutSupport(Allocator* alloc, VkStructureType rootType,
+                                           const VkDescriptorSetLayoutSupport* from,
+                                           VkDescriptorSetLayoutSupport* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceShaderDrawParametersFeatures(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderDrawParametersFeatures* from,
+    VkPhysicalDeviceShaderDrawParametersFeatures* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_VERSION_1_2
+void deepcopy_VkPhysicalDeviceVulkan11Features(Allocator* alloc, VkStructureType rootType,
+                                               const VkPhysicalDeviceVulkan11Features* from,
+                                               VkPhysicalDeviceVulkan11Features* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceVulkan11Properties(Allocator* alloc, VkStructureType rootType,
+                                                 const VkPhysicalDeviceVulkan11Properties* from,
+                                                 VkPhysicalDeviceVulkan11Properties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    memcpy(to->deviceUUID, from->deviceUUID, VK_UUID_SIZE * sizeof(uint8_t));
+    memcpy(to->driverUUID, from->driverUUID, VK_UUID_SIZE * sizeof(uint8_t));
+    memcpy(to->deviceLUID, from->deviceLUID, VK_LUID_SIZE * sizeof(uint8_t));
+}
+
+void deepcopy_VkPhysicalDeviceVulkan12Features(Allocator* alloc, VkStructureType rootType,
+                                               const VkPhysicalDeviceVulkan12Features* from,
+                                               VkPhysicalDeviceVulkan12Features* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkConformanceVersion(Allocator* alloc, VkStructureType rootType,
+                                   const VkConformanceVersion* from, VkConformanceVersion* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkPhysicalDeviceVulkan12Properties(Allocator* alloc, VkStructureType rootType,
+                                                 const VkPhysicalDeviceVulkan12Properties* from,
+                                                 VkPhysicalDeviceVulkan12Properties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    memcpy(to->driverName, from->driverName, VK_MAX_DRIVER_NAME_SIZE * sizeof(char));
+    memcpy(to->driverInfo, from->driverInfo, VK_MAX_DRIVER_INFO_SIZE * sizeof(char));
+    deepcopy_VkConformanceVersion(alloc, rootType, &from->conformanceVersion,
+                                  (VkConformanceVersion*)(&to->conformanceVersion));
+}
+
+void deepcopy_VkImageFormatListCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                          const VkImageFormatListCreateInfo* from,
+                                          VkImageFormatListCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pViewFormats = nullptr;
+    if (from->pViewFormats) {
+        to->pViewFormats = (VkFormat*)alloc->dupArray(
+            from->pViewFormats, from->viewFormatCount * sizeof(const VkFormat));
+    }
+}
+
+void deepcopy_VkAttachmentDescription2(Allocator* alloc, VkStructureType rootType,
+                                       const VkAttachmentDescription2* from,
+                                       VkAttachmentDescription2* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkAttachmentReference2(Allocator* alloc, VkStructureType rootType,
+                                     const VkAttachmentReference2* from,
+                                     VkAttachmentReference2* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkSubpassDescription2(Allocator* alloc, VkStructureType rootType,
+                                    const VkSubpassDescription2* from, VkSubpassDescription2* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pInputAttachments = nullptr;
+        if (from->pInputAttachments) {
+            to->pInputAttachments = (VkAttachmentReference2*)alloc->alloc(
+                from->inputAttachmentCount * sizeof(const VkAttachmentReference2));
+            to->inputAttachmentCount = from->inputAttachmentCount;
+            for (uint32_t i = 0; i < (uint32_t)from->inputAttachmentCount; ++i) {
+                deepcopy_VkAttachmentReference2(
+                    alloc, rootType, from->pInputAttachments + i,
+                    (VkAttachmentReference2*)(to->pInputAttachments + i));
+            }
+        }
+    }
+    if (from) {
+        to->pColorAttachments = nullptr;
+        if (from->pColorAttachments) {
+            to->pColorAttachments = (VkAttachmentReference2*)alloc->alloc(
+                from->colorAttachmentCount * sizeof(const VkAttachmentReference2));
+            to->colorAttachmentCount = from->colorAttachmentCount;
+            for (uint32_t i = 0; i < (uint32_t)from->colorAttachmentCount; ++i) {
+                deepcopy_VkAttachmentReference2(
+                    alloc, rootType, from->pColorAttachments + i,
+                    (VkAttachmentReference2*)(to->pColorAttachments + i));
+            }
+        }
+    }
+    if (from) {
+        to->pResolveAttachments = nullptr;
+        if (from->pResolveAttachments) {
+            to->pResolveAttachments = (VkAttachmentReference2*)alloc->alloc(
+                from->colorAttachmentCount * sizeof(const VkAttachmentReference2));
+            to->colorAttachmentCount = from->colorAttachmentCount;
+            for (uint32_t i = 0; i < (uint32_t)from->colorAttachmentCount; ++i) {
+                deepcopy_VkAttachmentReference2(
+                    alloc, rootType, from->pResolveAttachments + i,
+                    (VkAttachmentReference2*)(to->pResolveAttachments + i));
+            }
+        }
+    }
+    to->pDepthStencilAttachment = nullptr;
+    if (from->pDepthStencilAttachment) {
+        to->pDepthStencilAttachment =
+            (VkAttachmentReference2*)alloc->alloc(sizeof(const VkAttachmentReference2));
+        deepcopy_VkAttachmentReference2(alloc, rootType, from->pDepthStencilAttachment,
+                                        (VkAttachmentReference2*)(to->pDepthStencilAttachment));
+    }
+    to->pPreserveAttachments = nullptr;
+    if (from->pPreserveAttachments) {
+        to->pPreserveAttachments = (uint32_t*)alloc->dupArray(
+            from->pPreserveAttachments, from->preserveAttachmentCount * sizeof(const uint32_t));
+    }
+}
+
+void deepcopy_VkSubpassDependency2(Allocator* alloc, VkStructureType rootType,
+                                   const VkSubpassDependency2* from, VkSubpassDependency2* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkRenderPassCreateInfo2(Allocator* alloc, VkStructureType rootType,
+                                      const VkRenderPassCreateInfo2* from,
+                                      VkRenderPassCreateInfo2* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pAttachments = nullptr;
+        if (from->pAttachments) {
+            to->pAttachments = (VkAttachmentDescription2*)alloc->alloc(
+                from->attachmentCount * sizeof(const VkAttachmentDescription2));
+            to->attachmentCount = from->attachmentCount;
+            for (uint32_t i = 0; i < (uint32_t)from->attachmentCount; ++i) {
+                deepcopy_VkAttachmentDescription2(
+                    alloc, rootType, from->pAttachments + i,
+                    (VkAttachmentDescription2*)(to->pAttachments + i));
+            }
+        }
+    }
+    if (from) {
+        to->pSubpasses = nullptr;
+        if (from->pSubpasses) {
+            to->pSubpasses = (VkSubpassDescription2*)alloc->alloc(
+                from->subpassCount * sizeof(const VkSubpassDescription2));
+            to->subpassCount = from->subpassCount;
+            for (uint32_t i = 0; i < (uint32_t)from->subpassCount; ++i) {
+                deepcopy_VkSubpassDescription2(alloc, rootType, from->pSubpasses + i,
+                                               (VkSubpassDescription2*)(to->pSubpasses + i));
+            }
+        }
+    }
+    if (from) {
+        to->pDependencies = nullptr;
+        if (from->pDependencies) {
+            to->pDependencies = (VkSubpassDependency2*)alloc->alloc(
+                from->dependencyCount * sizeof(const VkSubpassDependency2));
+            to->dependencyCount = from->dependencyCount;
+            for (uint32_t i = 0; i < (uint32_t)from->dependencyCount; ++i) {
+                deepcopy_VkSubpassDependency2(alloc, rootType, from->pDependencies + i,
+                                              (VkSubpassDependency2*)(to->pDependencies + i));
+            }
+        }
+    }
+    to->pCorrelatedViewMasks = nullptr;
+    if (from->pCorrelatedViewMasks) {
+        to->pCorrelatedViewMasks = (uint32_t*)alloc->dupArray(
+            from->pCorrelatedViewMasks, from->correlatedViewMaskCount * sizeof(const uint32_t));
+    }
+}
+
+void deepcopy_VkSubpassBeginInfo(Allocator* alloc, VkStructureType rootType,
+                                 const VkSubpassBeginInfo* from, VkSubpassBeginInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkSubpassEndInfo(Allocator* alloc, VkStructureType rootType,
+                               const VkSubpassEndInfo* from, VkSubpassEndInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDevice8BitStorageFeatures(Allocator* alloc, VkStructureType rootType,
+                                                  const VkPhysicalDevice8BitStorageFeatures* from,
+                                                  VkPhysicalDevice8BitStorageFeatures* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceDriverProperties(Allocator* alloc, VkStructureType rootType,
+                                               const VkPhysicalDeviceDriverProperties* from,
+                                               VkPhysicalDeviceDriverProperties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    memcpy(to->driverName, from->driverName, VK_MAX_DRIVER_NAME_SIZE * sizeof(char));
+    memcpy(to->driverInfo, from->driverInfo, VK_MAX_DRIVER_INFO_SIZE * sizeof(char));
+    deepcopy_VkConformanceVersion(alloc, rootType, &from->conformanceVersion,
+                                  (VkConformanceVersion*)(&to->conformanceVersion));
+}
+
+void deepcopy_VkPhysicalDeviceShaderAtomicInt64Features(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderAtomicInt64Features* from,
+    VkPhysicalDeviceShaderAtomicInt64Features* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceShaderFloat16Int8Features(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderFloat16Int8Features* from,
+    VkPhysicalDeviceShaderFloat16Int8Features* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceFloatControlsProperties(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceFloatControlsProperties* from,
+    VkPhysicalDeviceFloatControlsProperties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkDescriptorSetLayoutBindingFlagsCreateInfo(
+    Allocator* alloc, VkStructureType rootType,
+    const VkDescriptorSetLayoutBindingFlagsCreateInfo* from,
+    VkDescriptorSetLayoutBindingFlagsCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pBindingFlags = nullptr;
+    if (from->pBindingFlags) {
+        to->pBindingFlags = (VkDescriptorBindingFlags*)alloc->dupArray(
+            from->pBindingFlags, from->bindingCount * sizeof(const VkDescriptorBindingFlags));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceDescriptorIndexingFeatures(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceDescriptorIndexingFeatures* from,
+    VkPhysicalDeviceDescriptorIndexingFeatures* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceDescriptorIndexingProperties(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceDescriptorIndexingProperties* from,
+    VkPhysicalDeviceDescriptorIndexingProperties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkDescriptorSetVariableDescriptorCountAllocateInfo(
+    Allocator* alloc, VkStructureType rootType,
+    const VkDescriptorSetVariableDescriptorCountAllocateInfo* from,
+    VkDescriptorSetVariableDescriptorCountAllocateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pDescriptorCounts = nullptr;
+    if (from->pDescriptorCounts) {
+        to->pDescriptorCounts = (uint32_t*)alloc->dupArray(
+            from->pDescriptorCounts, from->descriptorSetCount * sizeof(const uint32_t));
+    }
+}
+
+void deepcopy_VkDescriptorSetVariableDescriptorCountLayoutSupport(
+    Allocator* alloc, VkStructureType rootType,
+    const VkDescriptorSetVariableDescriptorCountLayoutSupport* from,
+    VkDescriptorSetVariableDescriptorCountLayoutSupport* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkSubpassDescriptionDepthStencilResolve(
+    Allocator* alloc, VkStructureType rootType, const VkSubpassDescriptionDepthStencilResolve* from,
+    VkSubpassDescriptionDepthStencilResolve* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pDepthStencilResolveAttachment = nullptr;
+    if (from->pDepthStencilResolveAttachment) {
+        to->pDepthStencilResolveAttachment =
+            (VkAttachmentReference2*)alloc->alloc(sizeof(const VkAttachmentReference2));
+        deepcopy_VkAttachmentReference2(
+            alloc, rootType, from->pDepthStencilResolveAttachment,
+            (VkAttachmentReference2*)(to->pDepthStencilResolveAttachment));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceDepthStencilResolveProperties(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceDepthStencilResolveProperties* from,
+    VkPhysicalDeviceDepthStencilResolveProperties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceScalarBlockLayoutFeatures(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceScalarBlockLayoutFeatures* from,
+    VkPhysicalDeviceScalarBlockLayoutFeatures* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkImageStencilUsageCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                            const VkImageStencilUsageCreateInfo* from,
+                                            VkImageStencilUsageCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkSamplerReductionModeCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                               const VkSamplerReductionModeCreateInfo* from,
+                                               VkSamplerReductionModeCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceSamplerFilterMinmaxProperties(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceSamplerFilterMinmaxProperties* from,
+    VkPhysicalDeviceSamplerFilterMinmaxProperties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceVulkanMemoryModelFeatures(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceVulkanMemoryModelFeatures* from,
+    VkPhysicalDeviceVulkanMemoryModelFeatures* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceImagelessFramebufferFeatures(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceImagelessFramebufferFeatures* from,
+    VkPhysicalDeviceImagelessFramebufferFeatures* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkFramebufferAttachmentImageInfo(Allocator* alloc, VkStructureType rootType,
+                                               const VkFramebufferAttachmentImageInfo* from,
+                                               VkFramebufferAttachmentImageInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pViewFormats = nullptr;
+    if (from->pViewFormats) {
+        to->pViewFormats = (VkFormat*)alloc->dupArray(
+            from->pViewFormats, from->viewFormatCount * sizeof(const VkFormat));
+    }
+}
+
+void deepcopy_VkFramebufferAttachmentsCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                                 const VkFramebufferAttachmentsCreateInfo* from,
+                                                 VkFramebufferAttachmentsCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pAttachmentImageInfos = nullptr;
+        if (from->pAttachmentImageInfos) {
+            to->pAttachmentImageInfos = (VkFramebufferAttachmentImageInfo*)alloc->alloc(
+                from->attachmentImageInfoCount * sizeof(const VkFramebufferAttachmentImageInfo));
+            to->attachmentImageInfoCount = from->attachmentImageInfoCount;
+            for (uint32_t i = 0; i < (uint32_t)from->attachmentImageInfoCount; ++i) {
+                deepcopy_VkFramebufferAttachmentImageInfo(
+                    alloc, rootType, from->pAttachmentImageInfos + i,
+                    (VkFramebufferAttachmentImageInfo*)(to->pAttachmentImageInfos + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkRenderPassAttachmentBeginInfo(Allocator* alloc, VkStructureType rootType,
+                                              const VkRenderPassAttachmentBeginInfo* from,
+                                              VkRenderPassAttachmentBeginInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pAttachments = nullptr;
+    if (from->pAttachments) {
+        to->pAttachments = (VkImageView*)alloc->dupArray(
+            from->pAttachments, from->attachmentCount * sizeof(const VkImageView));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceUniformBufferStandardLayoutFeatures(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceUniformBufferStandardLayoutFeatures* from,
+    VkPhysicalDeviceUniformBufferStandardLayoutFeatures* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures* from,
+    VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures* from,
+    VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkAttachmentReferenceStencilLayout(Allocator* alloc, VkStructureType rootType,
+                                                 const VkAttachmentReferenceStencilLayout* from,
+                                                 VkAttachmentReferenceStencilLayout* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkAttachmentDescriptionStencilLayout(Allocator* alloc, VkStructureType rootType,
+                                                   const VkAttachmentDescriptionStencilLayout* from,
+                                                   VkAttachmentDescriptionStencilLayout* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceHostQueryResetFeatures(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceHostQueryResetFeatures* from,
+    VkPhysicalDeviceHostQueryResetFeatures* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceTimelineSemaphoreFeatures(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceTimelineSemaphoreFeatures* from,
+    VkPhysicalDeviceTimelineSemaphoreFeatures* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceTimelineSemaphoreProperties(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceTimelineSemaphoreProperties* from,
+    VkPhysicalDeviceTimelineSemaphoreProperties* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkSemaphoreTypeCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                        const VkSemaphoreTypeCreateInfo* from,
+                                        VkSemaphoreTypeCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkTimelineSemaphoreSubmitInfo(Allocator* alloc, VkStructureType rootType,
+                                            const VkTimelineSemaphoreSubmitInfo* from,
+                                            VkTimelineSemaphoreSubmitInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pWaitSemaphoreValues = nullptr;
+    if (from->pWaitSemaphoreValues) {
+        to->pWaitSemaphoreValues = (uint64_t*)alloc->dupArray(
+            from->pWaitSemaphoreValues, from->waitSemaphoreValueCount * sizeof(const uint64_t));
+    }
+    to->pSignalSemaphoreValues = nullptr;
+    if (from->pSignalSemaphoreValues) {
+        to->pSignalSemaphoreValues = (uint64_t*)alloc->dupArray(
+            from->pSignalSemaphoreValues, from->signalSemaphoreValueCount * sizeof(const uint64_t));
+    }
+}
+
+void deepcopy_VkSemaphoreWaitInfo(Allocator* alloc, VkStructureType rootType,
+                                  const VkSemaphoreWaitInfo* from, VkSemaphoreWaitInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pSemaphores = nullptr;
+    if (from->pSemaphores) {
+        to->pSemaphores = (VkSemaphore*)alloc->dupArray(
+            from->pSemaphores, from->semaphoreCount * sizeof(const VkSemaphore));
+    }
+    to->pValues = nullptr;
+    if (from->pValues) {
+        to->pValues = (uint64_t*)alloc->dupArray(from->pValues,
+                                                 from->semaphoreCount * sizeof(const uint64_t));
+    }
+}
+
+void deepcopy_VkSemaphoreSignalInfo(Allocator* alloc, VkStructureType rootType,
+                                    const VkSemaphoreSignalInfo* from, VkSemaphoreSignalInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceBufferDeviceAddressFeatures(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceBufferDeviceAddressFeatures* from,
+    VkPhysicalDeviceBufferDeviceAddressFeatures* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkBufferDeviceAddressInfo(Allocator* alloc, VkStructureType rootType,
+                                        const VkBufferDeviceAddressInfo* from,
+                                        VkBufferDeviceAddressInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkBufferOpaqueCaptureAddressCreateInfo(
+    Allocator* alloc, VkStructureType rootType, const VkBufferOpaqueCaptureAddressCreateInfo* from,
+    VkBufferOpaqueCaptureAddressCreateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkMemoryOpaqueCaptureAddressAllocateInfo(
+    Allocator* alloc, VkStructureType rootType,
+    const VkMemoryOpaqueCaptureAddressAllocateInfo* from,
+    VkMemoryOpaqueCaptureAddressAllocateInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkDeviceMemoryOpaqueCaptureAddressInfo(
+    Allocator* alloc, VkStructureType rootType, const VkDeviceMemoryOpaqueCaptureAddressInfo* from,
+    VkDeviceMemoryOpaqueCaptureAddressInfo* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_surface
+void deepcopy_VkSurfaceCapabilitiesKHR(Allocator* alloc, VkStructureType rootType,
+                                       const VkSurfaceCapabilitiesKHR* from,
+                                       VkSurfaceCapabilitiesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkExtent2D(alloc, rootType, &from->currentExtent, (VkExtent2D*)(&to->currentExtent));
+    deepcopy_VkExtent2D(alloc, rootType, &from->minImageExtent, (VkExtent2D*)(&to->minImageExtent));
+    deepcopy_VkExtent2D(alloc, rootType, &from->maxImageExtent, (VkExtent2D*)(&to->maxImageExtent));
+}
+
+void deepcopy_VkSurfaceFormatKHR(Allocator* alloc, VkStructureType rootType,
+                                 const VkSurfaceFormatKHR* from, VkSurfaceFormatKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+#endif
+#ifdef VK_KHR_swapchain
+void deepcopy_VkSwapchainCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                       const VkSwapchainCreateInfoKHR* from,
+                                       VkSwapchainCreateInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkExtent2D(alloc, rootType, &from->imageExtent, (VkExtent2D*)(&to->imageExtent));
+    to->pQueueFamilyIndices = nullptr;
+    if (from->pQueueFamilyIndices) {
+        to->pQueueFamilyIndices = (uint32_t*)alloc->dupArray(
+            from->pQueueFamilyIndices, from->queueFamilyIndexCount * sizeof(const uint32_t));
+    }
+}
+
+void deepcopy_VkPresentInfoKHR(Allocator* alloc, VkStructureType rootType,
+                               const VkPresentInfoKHR* from, VkPresentInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pWaitSemaphores = nullptr;
+    if (from->pWaitSemaphores) {
+        to->pWaitSemaphores = (VkSemaphore*)alloc->dupArray(
+            from->pWaitSemaphores, from->waitSemaphoreCount * sizeof(const VkSemaphore));
+    }
+    to->pSwapchains = nullptr;
+    if (from->pSwapchains) {
+        to->pSwapchains = (VkSwapchainKHR*)alloc->dupArray(
+            from->pSwapchains, from->swapchainCount * sizeof(const VkSwapchainKHR));
+    }
+    to->pImageIndices = nullptr;
+    if (from->pImageIndices) {
+        to->pImageIndices = (uint32_t*)alloc->dupArray(
+            from->pImageIndices, from->swapchainCount * sizeof(const uint32_t));
+    }
+    to->pResults = nullptr;
+    if (from->pResults) {
+        to->pResults =
+            (VkResult*)alloc->dupArray(from->pResults, from->swapchainCount * sizeof(VkResult));
+    }
+}
+
+void deepcopy_VkImageSwapchainCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                            const VkImageSwapchainCreateInfoKHR* from,
+                                            VkImageSwapchainCreateInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkBindImageMemorySwapchainInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                                const VkBindImageMemorySwapchainInfoKHR* from,
+                                                VkBindImageMemorySwapchainInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkAcquireNextImageInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                        const VkAcquireNextImageInfoKHR* from,
+                                        VkAcquireNextImageInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkDeviceGroupPresentCapabilitiesKHR(Allocator* alloc, VkStructureType rootType,
+                                                  const VkDeviceGroupPresentCapabilitiesKHR* from,
+                                                  VkDeviceGroupPresentCapabilitiesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    memcpy(to->presentMask, from->presentMask, VK_MAX_DEVICE_GROUP_SIZE * sizeof(uint32_t));
+}
+
+void deepcopy_VkDeviceGroupPresentInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                          const VkDeviceGroupPresentInfoKHR* from,
+                                          VkDeviceGroupPresentInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pDeviceMasks = nullptr;
+    if (from->pDeviceMasks) {
+        to->pDeviceMasks = (uint32_t*)alloc->dupArray(
+            from->pDeviceMasks, from->swapchainCount * sizeof(const uint32_t));
+    }
+}
+
+void deepcopy_VkDeviceGroupSwapchainCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                                  const VkDeviceGroupSwapchainCreateInfoKHR* from,
+                                                  VkDeviceGroupSwapchainCreateInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_display
+void deepcopy_VkDisplayModeParametersKHR(Allocator* alloc, VkStructureType rootType,
+                                         const VkDisplayModeParametersKHR* from,
+                                         VkDisplayModeParametersKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkExtent2D(alloc, rootType, &from->visibleRegion, (VkExtent2D*)(&to->visibleRegion));
+}
+
+void deepcopy_VkDisplayModeCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                         const VkDisplayModeCreateInfoKHR* from,
+                                         VkDisplayModeCreateInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkDisplayModeParametersKHR(alloc, rootType, &from->parameters,
+                                        (VkDisplayModeParametersKHR*)(&to->parameters));
+}
+
+void deepcopy_VkDisplayModePropertiesKHR(Allocator* alloc, VkStructureType rootType,
+                                         const VkDisplayModePropertiesKHR* from,
+                                         VkDisplayModePropertiesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkDisplayModeParametersKHR(alloc, rootType, &from->parameters,
+                                        (VkDisplayModeParametersKHR*)(&to->parameters));
+}
+
+void deepcopy_VkDisplayPlaneCapabilitiesKHR(Allocator* alloc, VkStructureType rootType,
+                                            const VkDisplayPlaneCapabilitiesKHR* from,
+                                            VkDisplayPlaneCapabilitiesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkOffset2D(alloc, rootType, &from->minSrcPosition, (VkOffset2D*)(&to->minSrcPosition));
+    deepcopy_VkOffset2D(alloc, rootType, &from->maxSrcPosition, (VkOffset2D*)(&to->maxSrcPosition));
+    deepcopy_VkExtent2D(alloc, rootType, &from->minSrcExtent, (VkExtent2D*)(&to->minSrcExtent));
+    deepcopy_VkExtent2D(alloc, rootType, &from->maxSrcExtent, (VkExtent2D*)(&to->maxSrcExtent));
+    deepcopy_VkOffset2D(alloc, rootType, &from->minDstPosition, (VkOffset2D*)(&to->minDstPosition));
+    deepcopy_VkOffset2D(alloc, rootType, &from->maxDstPosition, (VkOffset2D*)(&to->maxDstPosition));
+    deepcopy_VkExtent2D(alloc, rootType, &from->minDstExtent, (VkExtent2D*)(&to->minDstExtent));
+    deepcopy_VkExtent2D(alloc, rootType, &from->maxDstExtent, (VkExtent2D*)(&to->maxDstExtent));
+}
+
+void deepcopy_VkDisplayPlanePropertiesKHR(Allocator* alloc, VkStructureType rootType,
+                                          const VkDisplayPlanePropertiesKHR* from,
+                                          VkDisplayPlanePropertiesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkDisplayPropertiesKHR(Allocator* alloc, VkStructureType rootType,
+                                     const VkDisplayPropertiesKHR* from,
+                                     VkDisplayPropertiesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    to->displayName = nullptr;
+    if (from->displayName) {
+        to->displayName = alloc->strDup(from->displayName);
+    }
+    deepcopy_VkExtent2D(alloc, rootType, &from->physicalDimensions,
+                        (VkExtent2D*)(&to->physicalDimensions));
+    deepcopy_VkExtent2D(alloc, rootType, &from->physicalResolution,
+                        (VkExtent2D*)(&to->physicalResolution));
+}
+
+void deepcopy_VkDisplaySurfaceCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                            const VkDisplaySurfaceCreateInfoKHR* from,
+                                            VkDisplaySurfaceCreateInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkExtent2D(alloc, rootType, &from->imageExtent, (VkExtent2D*)(&to->imageExtent));
+}
+
+#endif
+#ifdef VK_KHR_display_swapchain
+void deepcopy_VkDisplayPresentInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                      const VkDisplayPresentInfoKHR* from,
+                                      VkDisplayPresentInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkRect2D(alloc, rootType, &from->srcRect, (VkRect2D*)(&to->srcRect));
+    deepcopy_VkRect2D(alloc, rootType, &from->dstRect, (VkRect2D*)(&to->dstRect));
+}
+
+#endif
+#ifdef VK_KHR_xlib_surface
+void deepcopy_VkXlibSurfaceCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                         const VkXlibSurfaceCreateInfoKHR* from,
+                                         VkXlibSurfaceCreateInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->dpy = nullptr;
+    if (from->dpy) {
+        to->dpy = (Display*)alloc->dupArray(from->dpy, sizeof(Display));
+    }
+}
+
+#endif
+#ifdef VK_KHR_xcb_surface
+void deepcopy_VkXcbSurfaceCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                        const VkXcbSurfaceCreateInfoKHR* from,
+                                        VkXcbSurfaceCreateInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->connection = nullptr;
+    if (from->connection) {
+        to->connection =
+            (xcb_connection_t*)alloc->dupArray(from->connection, sizeof(xcb_connection_t));
+    }
+}
+
+#endif
+#ifdef VK_KHR_wayland_surface
+void deepcopy_VkWaylandSurfaceCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                            const VkWaylandSurfaceCreateInfoKHR* from,
+                                            VkWaylandSurfaceCreateInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->display = nullptr;
+    if (from->display) {
+        to->display = (wl_display*)alloc->dupArray(from->display, sizeof(wl_display));
+    }
+    to->surface = nullptr;
+    if (from->surface) {
+        to->surface = (wl_surface*)alloc->dupArray(from->surface, sizeof(wl_surface));
+    }
+}
+
+#endif
+#ifdef VK_KHR_android_surface
+void deepcopy_VkAndroidSurfaceCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                            const VkAndroidSurfaceCreateInfoKHR* from,
+                                            VkAndroidSurfaceCreateInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->window = nullptr;
+    if (from->window) {
+        to->window = (ANativeWindow*)alloc->dupArray(from->window, sizeof(ANativeWindow));
+    }
+}
+
+#endif
+#ifdef VK_KHR_win32_surface
+void deepcopy_VkWin32SurfaceCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                          const VkWin32SurfaceCreateInfoKHR* from,
+                                          VkWin32SurfaceCreateInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_sampler_mirror_clamp_to_edge
+#endif
+#ifdef VK_KHR_video_queue
+void deepcopy_VkVideoQueueFamilyProperties2KHR(Allocator* alloc, VkStructureType rootType,
+                                               const VkVideoQueueFamilyProperties2KHR* from,
+                                               VkVideoQueueFamilyProperties2KHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkVideoProfileKHR(Allocator* alloc, VkStructureType rootType,
+                                const VkVideoProfileKHR* from, VkVideoProfileKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkVideoProfilesKHR(Allocator* alloc, VkStructureType rootType,
+                                 const VkVideoProfilesKHR* from, VkVideoProfilesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pProfiles = nullptr;
+    if (from->pProfiles) {
+        to->pProfiles = (VkVideoProfileKHR*)alloc->alloc(sizeof(const VkVideoProfileKHR));
+        deepcopy_VkVideoProfileKHR(alloc, rootType, from->pProfiles,
+                                   (VkVideoProfileKHR*)(to->pProfiles));
+    }
+}
+
+void deepcopy_VkVideoCapabilitiesKHR(Allocator* alloc, VkStructureType rootType,
+                                     const VkVideoCapabilitiesKHR* from,
+                                     VkVideoCapabilitiesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkExtent2D(alloc, rootType, &from->videoPictureExtentGranularity,
+                        (VkExtent2D*)(&to->videoPictureExtentGranularity));
+    deepcopy_VkExtent2D(alloc, rootType, &from->minExtent, (VkExtent2D*)(&to->minExtent));
+    deepcopy_VkExtent2D(alloc, rootType, &from->maxExtent, (VkExtent2D*)(&to->maxExtent));
+}
+
+void deepcopy_VkPhysicalDeviceVideoFormatInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                                 const VkPhysicalDeviceVideoFormatInfoKHR* from,
+                                                 VkPhysicalDeviceVideoFormatInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pVideoProfiles = nullptr;
+    if (from->pVideoProfiles) {
+        to->pVideoProfiles = (VkVideoProfilesKHR*)alloc->alloc(sizeof(const VkVideoProfilesKHR));
+        deepcopy_VkVideoProfilesKHR(alloc, rootType, from->pVideoProfiles,
+                                    (VkVideoProfilesKHR*)(to->pVideoProfiles));
+    }
+}
+
+void deepcopy_VkVideoFormatPropertiesKHR(Allocator* alloc, VkStructureType rootType,
+                                         const VkVideoFormatPropertiesKHR* from,
+                                         VkVideoFormatPropertiesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkVideoPictureResourceKHR(Allocator* alloc, VkStructureType rootType,
+                                        const VkVideoPictureResourceKHR* from,
+                                        VkVideoPictureResourceKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkOffset2D(alloc, rootType, &from->codedOffset, (VkOffset2D*)(&to->codedOffset));
+    deepcopy_VkExtent2D(alloc, rootType, &from->codedExtent, (VkExtent2D*)(&to->codedExtent));
+}
+
+void deepcopy_VkVideoReferenceSlotKHR(Allocator* alloc, VkStructureType rootType,
+                                      const VkVideoReferenceSlotKHR* from,
+                                      VkVideoReferenceSlotKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pPictureResource = nullptr;
+    if (from->pPictureResource) {
+        to->pPictureResource =
+            (VkVideoPictureResourceKHR*)alloc->alloc(sizeof(const VkVideoPictureResourceKHR));
+        deepcopy_VkVideoPictureResourceKHR(alloc, rootType, from->pPictureResource,
+                                           (VkVideoPictureResourceKHR*)(to->pPictureResource));
+    }
+}
+
+void deepcopy_VkVideoGetMemoryPropertiesKHR(Allocator* alloc, VkStructureType rootType,
+                                            const VkVideoGetMemoryPropertiesKHR* from,
+                                            VkVideoGetMemoryPropertiesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pMemoryRequirements = nullptr;
+    if (from->pMemoryRequirements) {
+        to->pMemoryRequirements =
+            (VkMemoryRequirements2*)alloc->alloc(sizeof(VkMemoryRequirements2));
+        deepcopy_VkMemoryRequirements2(alloc, rootType, from->pMemoryRequirements,
+                                       (VkMemoryRequirements2*)(to->pMemoryRequirements));
+    }
+}
+
+void deepcopy_VkVideoBindMemoryKHR(Allocator* alloc, VkStructureType rootType,
+                                   const VkVideoBindMemoryKHR* from, VkVideoBindMemoryKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkVideoSessionCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                          const VkVideoSessionCreateInfoKHR* from,
+                                          VkVideoSessionCreateInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pVideoProfile = nullptr;
+    if (from->pVideoProfile) {
+        to->pVideoProfile = (VkVideoProfileKHR*)alloc->alloc(sizeof(const VkVideoProfileKHR));
+        deepcopy_VkVideoProfileKHR(alloc, rootType, from->pVideoProfile,
+                                   (VkVideoProfileKHR*)(to->pVideoProfile));
+    }
+    deepcopy_VkExtent2D(alloc, rootType, &from->maxCodedExtent, (VkExtent2D*)(&to->maxCodedExtent));
+}
+
+void deepcopy_VkVideoSessionParametersCreateInfoKHR(
+    Allocator* alloc, VkStructureType rootType, const VkVideoSessionParametersCreateInfoKHR* from,
+    VkVideoSessionParametersCreateInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkVideoSessionParametersUpdateInfoKHR(
+    Allocator* alloc, VkStructureType rootType, const VkVideoSessionParametersUpdateInfoKHR* from,
+    VkVideoSessionParametersUpdateInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkVideoBeginCodingInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                        const VkVideoBeginCodingInfoKHR* from,
+                                        VkVideoBeginCodingInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pReferenceSlots = nullptr;
+        if (from->pReferenceSlots) {
+            to->pReferenceSlots = (VkVideoReferenceSlotKHR*)alloc->alloc(
+                from->referenceSlotCount * sizeof(const VkVideoReferenceSlotKHR));
+            to->referenceSlotCount = from->referenceSlotCount;
+            for (uint32_t i = 0; i < (uint32_t)from->referenceSlotCount; ++i) {
+                deepcopy_VkVideoReferenceSlotKHR(
+                    alloc, rootType, from->pReferenceSlots + i,
+                    (VkVideoReferenceSlotKHR*)(to->pReferenceSlots + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkVideoEndCodingInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                      const VkVideoEndCodingInfoKHR* from,
+                                      VkVideoEndCodingInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkVideoCodingControlInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                          const VkVideoCodingControlInfoKHR* from,
+                                          VkVideoCodingControlInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_video_decode_queue
+void deepcopy_VkVideoDecodeInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                   const VkVideoDecodeInfoKHR* from, VkVideoDecodeInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkOffset2D(alloc, rootType, &from->codedOffset, (VkOffset2D*)(&to->codedOffset));
+    deepcopy_VkExtent2D(alloc, rootType, &from->codedExtent, (VkExtent2D*)(&to->codedExtent));
+    deepcopy_VkVideoPictureResourceKHR(alloc, rootType, &from->dstPictureResource,
+                                       (VkVideoPictureResourceKHR*)(&to->dstPictureResource));
+    to->pSetupReferenceSlot = nullptr;
+    if (from->pSetupReferenceSlot) {
+        to->pSetupReferenceSlot =
+            (VkVideoReferenceSlotKHR*)alloc->alloc(sizeof(const VkVideoReferenceSlotKHR));
+        deepcopy_VkVideoReferenceSlotKHR(alloc, rootType, from->pSetupReferenceSlot,
+                                         (VkVideoReferenceSlotKHR*)(to->pSetupReferenceSlot));
+    }
+    if (from) {
+        to->pReferenceSlots = nullptr;
+        if (from->pReferenceSlots) {
+            to->pReferenceSlots = (VkVideoReferenceSlotKHR*)alloc->alloc(
+                from->referenceSlotCount * sizeof(const VkVideoReferenceSlotKHR));
+            to->referenceSlotCount = from->referenceSlotCount;
+            for (uint32_t i = 0; i < (uint32_t)from->referenceSlotCount; ++i) {
+                deepcopy_VkVideoReferenceSlotKHR(
+                    alloc, rootType, from->pReferenceSlots + i,
+                    (VkVideoReferenceSlotKHR*)(to->pReferenceSlots + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_KHR_dynamic_rendering
+void deepcopy_VkRenderingAttachmentInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                           const VkRenderingAttachmentInfoKHR* from,
+                                           VkRenderingAttachmentInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkClearValue(alloc, rootType, &from->clearValue, (VkClearValue*)(&to->clearValue));
+}
+
+void deepcopy_VkRenderingInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                 const VkRenderingInfoKHR* from, VkRenderingInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkRect2D(alloc, rootType, &from->renderArea, (VkRect2D*)(&to->renderArea));
+    if (from) {
+        to->pColorAttachments = nullptr;
+        if (from->pColorAttachments) {
+            to->pColorAttachments = (VkRenderingAttachmentInfoKHR*)alloc->alloc(
+                from->colorAttachmentCount * sizeof(const VkRenderingAttachmentInfoKHR));
+            to->colorAttachmentCount = from->colorAttachmentCount;
+            for (uint32_t i = 0; i < (uint32_t)from->colorAttachmentCount; ++i) {
+                deepcopy_VkRenderingAttachmentInfoKHR(
+                    alloc, rootType, from->pColorAttachments + i,
+                    (VkRenderingAttachmentInfoKHR*)(to->pColorAttachments + i));
+            }
+        }
+    }
+    to->pDepthAttachment = nullptr;
+    if (from->pDepthAttachment) {
+        to->pDepthAttachment =
+            (VkRenderingAttachmentInfoKHR*)alloc->alloc(sizeof(const VkRenderingAttachmentInfoKHR));
+        deepcopy_VkRenderingAttachmentInfoKHR(
+            alloc, rootType, from->pDepthAttachment,
+            (VkRenderingAttachmentInfoKHR*)(to->pDepthAttachment));
+    }
+    to->pStencilAttachment = nullptr;
+    if (from->pStencilAttachment) {
+        to->pStencilAttachment =
+            (VkRenderingAttachmentInfoKHR*)alloc->alloc(sizeof(const VkRenderingAttachmentInfoKHR));
+        deepcopy_VkRenderingAttachmentInfoKHR(
+            alloc, rootType, from->pStencilAttachment,
+            (VkRenderingAttachmentInfoKHR*)(to->pStencilAttachment));
+    }
+}
+
+void deepcopy_VkPipelineRenderingCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                               const VkPipelineRenderingCreateInfoKHR* from,
+                                               VkPipelineRenderingCreateInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pColorAttachmentFormats = nullptr;
+    if (from->pColorAttachmentFormats) {
+        to->pColorAttachmentFormats = (VkFormat*)alloc->dupArray(
+            from->pColorAttachmentFormats, from->colorAttachmentCount * sizeof(const VkFormat));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceDynamicRenderingFeaturesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceDynamicRenderingFeaturesKHR* from,
+    VkPhysicalDeviceDynamicRenderingFeaturesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkCommandBufferInheritanceRenderingInfoKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkCommandBufferInheritanceRenderingInfoKHR* from,
+    VkCommandBufferInheritanceRenderingInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pColorAttachmentFormats = nullptr;
+    if (from->pColorAttachmentFormats) {
+        to->pColorAttachmentFormats = (VkFormat*)alloc->dupArray(
+            from->pColorAttachmentFormats, from->colorAttachmentCount * sizeof(const VkFormat));
+    }
+}
+
+void deepcopy_VkRenderingFragmentShadingRateAttachmentInfoKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkRenderingFragmentShadingRateAttachmentInfoKHR* from,
+    VkRenderingFragmentShadingRateAttachmentInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkExtent2D(alloc, rootType, &from->shadingRateAttachmentTexelSize,
+                        (VkExtent2D*)(&to->shadingRateAttachmentTexelSize));
+}
+
+void deepcopy_VkRenderingFragmentDensityMapAttachmentInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkRenderingFragmentDensityMapAttachmentInfoEXT* from,
+    VkRenderingFragmentDensityMapAttachmentInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkAttachmentSampleCountInfoAMD(Allocator* alloc, VkStructureType rootType,
+                                             const VkAttachmentSampleCountInfoAMD* from,
+                                             VkAttachmentSampleCountInfoAMD* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pColorAttachmentSamples = nullptr;
+    if (from->pColorAttachmentSamples) {
+        to->pColorAttachmentSamples = (VkSampleCountFlagBits*)alloc->dupArray(
+            from->pColorAttachmentSamples,
+            from->colorAttachmentCount * sizeof(const VkSampleCountFlagBits));
+    }
+}
+
+void deepcopy_VkMultiviewPerViewAttributesInfoNVX(Allocator* alloc, VkStructureType rootType,
+                                                  const VkMultiviewPerViewAttributesInfoNVX* from,
+                                                  VkMultiviewPerViewAttributesInfoNVX* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_multiview
+#endif
+#ifdef VK_KHR_get_physical_device_properties2
+#endif
+#ifdef VK_KHR_device_group
+#endif
+#ifdef VK_KHR_shader_draw_parameters
+#endif
+#ifdef VK_KHR_maintenance1
+#endif
+#ifdef VK_KHR_device_group_creation
+#endif
+#ifdef VK_KHR_external_memory_capabilities
+#endif
+#ifdef VK_KHR_external_memory
+#endif
+#ifdef VK_KHR_external_memory_win32
+void deepcopy_VkImportMemoryWin32HandleInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                               const VkImportMemoryWin32HandleInfoKHR* from,
+                                               VkImportMemoryWin32HandleInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkExportMemoryWin32HandleInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                               const VkExportMemoryWin32HandleInfoKHR* from,
+                                               VkExportMemoryWin32HandleInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pAttributes = nullptr;
+    if (from->pAttributes) {
+        to->pAttributes = (SECURITY_ATTRIBUTES*)alloc->dupArray(from->pAttributes,
+                                                                sizeof(const SECURITY_ATTRIBUTES));
+    }
+}
+
+void deepcopy_VkMemoryWin32HandlePropertiesKHR(Allocator* alloc, VkStructureType rootType,
+                                               const VkMemoryWin32HandlePropertiesKHR* from,
+                                               VkMemoryWin32HandlePropertiesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkMemoryGetWin32HandleInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                            const VkMemoryGetWin32HandleInfoKHR* from,
+                                            VkMemoryGetWin32HandleInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_external_memory_fd
+void deepcopy_VkImportMemoryFdInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                      const VkImportMemoryFdInfoKHR* from,
+                                      VkImportMemoryFdInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkMemoryFdPropertiesKHR(Allocator* alloc, VkStructureType rootType,
+                                      const VkMemoryFdPropertiesKHR* from,
+                                      VkMemoryFdPropertiesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkMemoryGetFdInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                   const VkMemoryGetFdInfoKHR* from, VkMemoryGetFdInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_win32_keyed_mutex
+void deepcopy_VkWin32KeyedMutexAcquireReleaseInfoKHR(
+    Allocator* alloc, VkStructureType rootType, const VkWin32KeyedMutexAcquireReleaseInfoKHR* from,
+    VkWin32KeyedMutexAcquireReleaseInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pAcquireSyncs = nullptr;
+    if (from->pAcquireSyncs) {
+        to->pAcquireSyncs = (VkDeviceMemory*)alloc->dupArray(
+            from->pAcquireSyncs, from->acquireCount * sizeof(const VkDeviceMemory));
+    }
+    to->pAcquireKeys = nullptr;
+    if (from->pAcquireKeys) {
+        to->pAcquireKeys = (uint64_t*)alloc->dupArray(from->pAcquireKeys,
+                                                      from->acquireCount * sizeof(const uint64_t));
+    }
+    to->pAcquireTimeouts = nullptr;
+    if (from->pAcquireTimeouts) {
+        to->pAcquireTimeouts = (uint32_t*)alloc->dupArray(
+            from->pAcquireTimeouts, from->acquireCount * sizeof(const uint32_t));
+    }
+    to->pReleaseSyncs = nullptr;
+    if (from->pReleaseSyncs) {
+        to->pReleaseSyncs = (VkDeviceMemory*)alloc->dupArray(
+            from->pReleaseSyncs, from->releaseCount * sizeof(const VkDeviceMemory));
+    }
+    to->pReleaseKeys = nullptr;
+    if (from->pReleaseKeys) {
+        to->pReleaseKeys = (uint64_t*)alloc->dupArray(from->pReleaseKeys,
+                                                      from->releaseCount * sizeof(const uint64_t));
+    }
+}
+
+#endif
+#ifdef VK_KHR_external_semaphore_capabilities
+#endif
+#ifdef VK_KHR_external_semaphore
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+void deepcopy_VkImportSemaphoreWin32HandleInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                                  const VkImportSemaphoreWin32HandleInfoKHR* from,
+                                                  VkImportSemaphoreWin32HandleInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkExportSemaphoreWin32HandleInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                                  const VkExportSemaphoreWin32HandleInfoKHR* from,
+                                                  VkExportSemaphoreWin32HandleInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pAttributes = nullptr;
+    if (from->pAttributes) {
+        to->pAttributes = (SECURITY_ATTRIBUTES*)alloc->dupArray(from->pAttributes,
+                                                                sizeof(const SECURITY_ATTRIBUTES));
+    }
+}
+
+void deepcopy_VkD3D12FenceSubmitInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                        const VkD3D12FenceSubmitInfoKHR* from,
+                                        VkD3D12FenceSubmitInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pWaitSemaphoreValues = nullptr;
+    if (from->pWaitSemaphoreValues) {
+        to->pWaitSemaphoreValues = (uint64_t*)alloc->dupArray(
+            from->pWaitSemaphoreValues, from->waitSemaphoreValuesCount * sizeof(const uint64_t));
+    }
+    to->pSignalSemaphoreValues = nullptr;
+    if (from->pSignalSemaphoreValues) {
+        to->pSignalSemaphoreValues =
+            (uint64_t*)alloc->dupArray(from->pSignalSemaphoreValues,
+                                       from->signalSemaphoreValuesCount * sizeof(const uint64_t));
+    }
+}
+
+void deepcopy_VkSemaphoreGetWin32HandleInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                               const VkSemaphoreGetWin32HandleInfoKHR* from,
+                                               VkSemaphoreGetWin32HandleInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_external_semaphore_fd
+void deepcopy_VkImportSemaphoreFdInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                         const VkImportSemaphoreFdInfoKHR* from,
+                                         VkImportSemaphoreFdInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkSemaphoreGetFdInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                      const VkSemaphoreGetFdInfoKHR* from,
+                                      VkSemaphoreGetFdInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_push_descriptor
+void deepcopy_VkPhysicalDevicePushDescriptorPropertiesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDevicePushDescriptorPropertiesKHR* from,
+    VkPhysicalDevicePushDescriptorPropertiesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_shader_float16_int8
+#endif
+#ifdef VK_KHR_16bit_storage
+#endif
+#ifdef VK_KHR_incremental_present
+void deepcopy_VkRectLayerKHR(Allocator* alloc, VkStructureType rootType, const VkRectLayerKHR* from,
+                             VkRectLayerKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkOffset2D(alloc, rootType, &from->offset, (VkOffset2D*)(&to->offset));
+    deepcopy_VkExtent2D(alloc, rootType, &from->extent, (VkExtent2D*)(&to->extent));
+}
+
+void deepcopy_VkPresentRegionKHR(Allocator* alloc, VkStructureType rootType,
+                                 const VkPresentRegionKHR* from, VkPresentRegionKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (from) {
+        to->pRectangles = nullptr;
+        if (from->pRectangles) {
+            to->pRectangles =
+                (VkRectLayerKHR*)alloc->alloc(from->rectangleCount * sizeof(const VkRectLayerKHR));
+            to->rectangleCount = from->rectangleCount;
+            for (uint32_t i = 0; i < (uint32_t)from->rectangleCount; ++i) {
+                deepcopy_VkRectLayerKHR(alloc, rootType, from->pRectangles + i,
+                                        (VkRectLayerKHR*)(to->pRectangles + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkPresentRegionsKHR(Allocator* alloc, VkStructureType rootType,
+                                  const VkPresentRegionsKHR* from, VkPresentRegionsKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pRegions = nullptr;
+        if (from->pRegions) {
+            to->pRegions = (VkPresentRegionKHR*)alloc->alloc(from->swapchainCount *
+                                                             sizeof(const VkPresentRegionKHR));
+            to->swapchainCount = from->swapchainCount;
+            for (uint32_t i = 0; i < (uint32_t)from->swapchainCount; ++i) {
+                deepcopy_VkPresentRegionKHR(alloc, rootType, from->pRegions + i,
+                                            (VkPresentRegionKHR*)(to->pRegions + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_KHR_descriptor_update_template
+#endif
+#ifdef VK_KHR_imageless_framebuffer
+#endif
+#ifdef VK_KHR_create_renderpass2
+#endif
+#ifdef VK_KHR_shared_presentable_image
+void deepcopy_VkSharedPresentSurfaceCapabilitiesKHR(
+    Allocator* alloc, VkStructureType rootType, const VkSharedPresentSurfaceCapabilitiesKHR* from,
+    VkSharedPresentSurfaceCapabilitiesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_external_fence_capabilities
+#endif
+#ifdef VK_KHR_external_fence
+#endif
+#ifdef VK_KHR_external_fence_win32
+void deepcopy_VkImportFenceWin32HandleInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                              const VkImportFenceWin32HandleInfoKHR* from,
+                                              VkImportFenceWin32HandleInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkExportFenceWin32HandleInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                              const VkExportFenceWin32HandleInfoKHR* from,
+                                              VkExportFenceWin32HandleInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pAttributes = nullptr;
+    if (from->pAttributes) {
+        to->pAttributes = (SECURITY_ATTRIBUTES*)alloc->dupArray(from->pAttributes,
+                                                                sizeof(const SECURITY_ATTRIBUTES));
+    }
+}
+
+void deepcopy_VkFenceGetWin32HandleInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                           const VkFenceGetWin32HandleInfoKHR* from,
+                                           VkFenceGetWin32HandleInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_external_fence_fd
+void deepcopy_VkImportFenceFdInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                     const VkImportFenceFdInfoKHR* from,
+                                     VkImportFenceFdInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkFenceGetFdInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                  const VkFenceGetFdInfoKHR* from, VkFenceGetFdInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_performance_query
+void deepcopy_VkPhysicalDevicePerformanceQueryFeaturesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDevicePerformanceQueryFeaturesKHR* from,
+    VkPhysicalDevicePerformanceQueryFeaturesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDevicePerformanceQueryPropertiesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDevicePerformanceQueryPropertiesKHR* from,
+    VkPhysicalDevicePerformanceQueryPropertiesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPerformanceCounterKHR(Allocator* alloc, VkStructureType rootType,
+                                      const VkPerformanceCounterKHR* from,
+                                      VkPerformanceCounterKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    memcpy(to->uuid, from->uuid, VK_UUID_SIZE * sizeof(uint8_t));
+}
+
+void deepcopy_VkPerformanceCounterDescriptionKHR(Allocator* alloc, VkStructureType rootType,
+                                                 const VkPerformanceCounterDescriptionKHR* from,
+                                                 VkPerformanceCounterDescriptionKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    memcpy(to->name, from->name, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    memcpy(to->category, from->category, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    memcpy(to->description, from->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+}
+
+void deepcopy_VkQueryPoolPerformanceCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                                  const VkQueryPoolPerformanceCreateInfoKHR* from,
+                                                  VkQueryPoolPerformanceCreateInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pCounterIndices = nullptr;
+    if (from->pCounterIndices) {
+        to->pCounterIndices = (uint32_t*)alloc->dupArray(
+            from->pCounterIndices, from->counterIndexCount * sizeof(const uint32_t));
+    }
+}
+
+void deepcopy_VkPerformanceCounterResultKHR(Allocator* alloc, VkStructureType rootType,
+                                            const VkPerformanceCounterResultKHR* from,
+                                            VkPerformanceCounterResultKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkAcquireProfilingLockInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                            const VkAcquireProfilingLockInfoKHR* from,
+                                            VkAcquireProfilingLockInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPerformanceQuerySubmitInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                              const VkPerformanceQuerySubmitInfoKHR* from,
+                                              VkPerformanceQuerySubmitInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_maintenance2
+#endif
+#ifdef VK_KHR_get_surface_capabilities2
+void deepcopy_VkPhysicalDeviceSurfaceInfo2KHR(Allocator* alloc, VkStructureType rootType,
+                                              const VkPhysicalDeviceSurfaceInfo2KHR* from,
+                                              VkPhysicalDeviceSurfaceInfo2KHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkSurfaceCapabilities2KHR(Allocator* alloc, VkStructureType rootType,
+                                        const VkSurfaceCapabilities2KHR* from,
+                                        VkSurfaceCapabilities2KHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkSurfaceCapabilitiesKHR(alloc, rootType, &from->surfaceCapabilities,
+                                      (VkSurfaceCapabilitiesKHR*)(&to->surfaceCapabilities));
+}
+
+void deepcopy_VkSurfaceFormat2KHR(Allocator* alloc, VkStructureType rootType,
+                                  const VkSurfaceFormat2KHR* from, VkSurfaceFormat2KHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkSurfaceFormatKHR(alloc, rootType, &from->surfaceFormat,
+                                (VkSurfaceFormatKHR*)(&to->surfaceFormat));
+}
+
+#endif
+#ifdef VK_KHR_variable_pointers
+#endif
+#ifdef VK_KHR_get_display_properties2
+void deepcopy_VkDisplayProperties2KHR(Allocator* alloc, VkStructureType rootType,
+                                      const VkDisplayProperties2KHR* from,
+                                      VkDisplayProperties2KHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkDisplayPropertiesKHR(alloc, rootType, &from->displayProperties,
+                                    (VkDisplayPropertiesKHR*)(&to->displayProperties));
+}
+
+void deepcopy_VkDisplayPlaneProperties2KHR(Allocator* alloc, VkStructureType rootType,
+                                           const VkDisplayPlaneProperties2KHR* from,
+                                           VkDisplayPlaneProperties2KHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkDisplayPlanePropertiesKHR(
+        alloc, rootType, &from->displayPlaneProperties,
+        (VkDisplayPlanePropertiesKHR*)(&to->displayPlaneProperties));
+}
+
+void deepcopy_VkDisplayModeProperties2KHR(Allocator* alloc, VkStructureType rootType,
+                                          const VkDisplayModeProperties2KHR* from,
+                                          VkDisplayModeProperties2KHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkDisplayModePropertiesKHR(alloc, rootType, &from->displayModeProperties,
+                                        (VkDisplayModePropertiesKHR*)(&to->displayModeProperties));
+}
+
+void deepcopy_VkDisplayPlaneInfo2KHR(Allocator* alloc, VkStructureType rootType,
+                                     const VkDisplayPlaneInfo2KHR* from,
+                                     VkDisplayPlaneInfo2KHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkDisplayPlaneCapabilities2KHR(Allocator* alloc, VkStructureType rootType,
+                                             const VkDisplayPlaneCapabilities2KHR* from,
+                                             VkDisplayPlaneCapabilities2KHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkDisplayPlaneCapabilitiesKHR(alloc, rootType, &from->capabilities,
+                                           (VkDisplayPlaneCapabilitiesKHR*)(&to->capabilities));
+}
+
+#endif
+#ifdef VK_KHR_dedicated_allocation
+#endif
+#ifdef VK_KHR_storage_buffer_storage_class
+#endif
+#ifdef VK_KHR_relaxed_block_layout
+#endif
+#ifdef VK_KHR_get_memory_requirements2
+#endif
+#ifdef VK_KHR_image_format_list
+#endif
+#ifdef VK_KHR_sampler_ycbcr_conversion
+#endif
+#ifdef VK_KHR_bind_memory2
+#endif
+#ifdef VK_KHR_portability_subset
+void deepcopy_VkPhysicalDevicePortabilitySubsetFeaturesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDevicePortabilitySubsetFeaturesKHR* from,
+    VkPhysicalDevicePortabilitySubsetFeaturesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDevicePortabilitySubsetPropertiesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDevicePortabilitySubsetPropertiesKHR* from,
+    VkPhysicalDevicePortabilitySubsetPropertiesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_maintenance3
+#endif
+#ifdef VK_KHR_draw_indirect_count
+#endif
+#ifdef VK_KHR_shader_subgroup_extended_types
+#endif
+#ifdef VK_KHR_8bit_storage
+#endif
+#ifdef VK_KHR_shader_atomic_int64
+#endif
+#ifdef VK_KHR_shader_clock
+void deepcopy_VkPhysicalDeviceShaderClockFeaturesKHR(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceShaderClockFeaturesKHR* from,
+    VkPhysicalDeviceShaderClockFeaturesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_driver_properties
+#endif
+#ifdef VK_KHR_shader_float_controls
+#endif
+#ifdef VK_KHR_depth_stencil_resolve
+#endif
+#ifdef VK_KHR_swapchain_mutable_format
+#endif
+#ifdef VK_KHR_timeline_semaphore
+#endif
+#ifdef VK_KHR_vulkan_memory_model
+#endif
+#ifdef VK_KHR_shader_terminate_invocation
+void deepcopy_VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR* from,
+    VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+void deepcopy_VkFragmentShadingRateAttachmentInfoKHR(
+    Allocator* alloc, VkStructureType rootType, const VkFragmentShadingRateAttachmentInfoKHR* from,
+    VkFragmentShadingRateAttachmentInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pFragmentShadingRateAttachment = nullptr;
+    if (from->pFragmentShadingRateAttachment) {
+        to->pFragmentShadingRateAttachment =
+            (VkAttachmentReference2*)alloc->alloc(sizeof(const VkAttachmentReference2));
+        deepcopy_VkAttachmentReference2(
+            alloc, rootType, from->pFragmentShadingRateAttachment,
+            (VkAttachmentReference2*)(to->pFragmentShadingRateAttachment));
+    }
+    deepcopy_VkExtent2D(alloc, rootType, &from->shadingRateAttachmentTexelSize,
+                        (VkExtent2D*)(&to->shadingRateAttachmentTexelSize));
+}
+
+void deepcopy_VkPipelineFragmentShadingRateStateCreateInfoKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineFragmentShadingRateStateCreateInfoKHR* from,
+    VkPipelineFragmentShadingRateStateCreateInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkExtent2D(alloc, rootType, &from->fragmentSize, (VkExtent2D*)(&to->fragmentSize));
+    memcpy(to->combinerOps, from->combinerOps, 2 * sizeof(VkFragmentShadingRateCombinerOpKHR));
+}
+
+void deepcopy_VkPhysicalDeviceFragmentShadingRateFeaturesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateFeaturesKHR* from,
+    VkPhysicalDeviceFragmentShadingRateFeaturesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceFragmentShadingRatePropertiesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRatePropertiesKHR* from,
+    VkPhysicalDeviceFragmentShadingRatePropertiesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkExtent2D(alloc, rootType, &from->minFragmentShadingRateAttachmentTexelSize,
+                        (VkExtent2D*)(&to->minFragmentShadingRateAttachmentTexelSize));
+    deepcopy_VkExtent2D(alloc, rootType, &from->maxFragmentShadingRateAttachmentTexelSize,
+                        (VkExtent2D*)(&to->maxFragmentShadingRateAttachmentTexelSize));
+    deepcopy_VkExtent2D(alloc, rootType, &from->maxFragmentSize,
+                        (VkExtent2D*)(&to->maxFragmentSize));
+}
+
+void deepcopy_VkPhysicalDeviceFragmentShadingRateKHR(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceFragmentShadingRateKHR* from,
+    VkPhysicalDeviceFragmentShadingRateKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkExtent2D(alloc, rootType, &from->fragmentSize, (VkExtent2D*)(&to->fragmentSize));
+}
+
+#endif
+#ifdef VK_KHR_spirv_1_4
+#endif
+#ifdef VK_KHR_surface_protected_capabilities
+void deepcopy_VkSurfaceProtectedCapabilitiesKHR(Allocator* alloc, VkStructureType rootType,
+                                                const VkSurfaceProtectedCapabilitiesKHR* from,
+                                                VkSurfaceProtectedCapabilitiesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_separate_depth_stencil_layouts
+#endif
+#ifdef VK_KHR_present_wait
+void deepcopy_VkPhysicalDevicePresentWaitFeaturesKHR(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDevicePresentWaitFeaturesKHR* from,
+    VkPhysicalDevicePresentWaitFeaturesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_uniform_buffer_standard_layout
+#endif
+#ifdef VK_KHR_buffer_device_address
+#endif
+#ifdef VK_KHR_deferred_host_operations
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+void deepcopy_VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR* from,
+    VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPipelineInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                const VkPipelineInfoKHR* from, VkPipelineInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPipelineExecutablePropertiesKHR(Allocator* alloc, VkStructureType rootType,
+                                                const VkPipelineExecutablePropertiesKHR* from,
+                                                VkPipelineExecutablePropertiesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    memcpy(to->name, from->name, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    memcpy(to->description, from->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+}
+
+void deepcopy_VkPipelineExecutableInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                          const VkPipelineExecutableInfoKHR* from,
+                                          VkPipelineExecutableInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPipelineExecutableStatisticValueKHR(
+    Allocator* alloc, VkStructureType rootType, const VkPipelineExecutableStatisticValueKHR* from,
+    VkPipelineExecutableStatisticValueKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkPipelineExecutableStatisticKHR(Allocator* alloc, VkStructureType rootType,
+                                               const VkPipelineExecutableStatisticKHR* from,
+                                               VkPipelineExecutableStatisticKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    memcpy(to->name, from->name, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    memcpy(to->description, from->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    deepcopy_VkPipelineExecutableStatisticValueKHR(
+        alloc, rootType, &from->value, (VkPipelineExecutableStatisticValueKHR*)(&to->value));
+}
+
+void deepcopy_VkPipelineExecutableInternalRepresentationKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineExecutableInternalRepresentationKHR* from,
+    VkPipelineExecutableInternalRepresentationKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    memcpy(to->name, from->name, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    memcpy(to->description, from->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    to->pData = nullptr;
+    if (from->pData) {
+        to->pData = (void*)alloc->dupArray(from->pData, from->dataSize * sizeof(uint8_t));
+    }
+}
+
+#endif
+#ifdef VK_KHR_shader_integer_dot_product
+void deepcopy_VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR* from,
+    VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR* from,
+    VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_pipeline_library
+void deepcopy_VkPipelineLibraryCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                             const VkPipelineLibraryCreateInfoKHR* from,
+                                             VkPipelineLibraryCreateInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pLibraries = nullptr;
+    if (from->pLibraries) {
+        to->pLibraries = (VkPipeline*)alloc->dupArray(
+            from->pLibraries, from->libraryCount * sizeof(const VkPipeline));
+    }
+}
+
+#endif
+#ifdef VK_KHR_shader_non_semantic_info
+#endif
+#ifdef VK_KHR_present_id
+void deepcopy_VkPresentIdKHR(Allocator* alloc, VkStructureType rootType, const VkPresentIdKHR* from,
+                             VkPresentIdKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pPresentIds = nullptr;
+    if (from->pPresentIds) {
+        to->pPresentIds = (uint64_t*)alloc->dupArray(from->pPresentIds,
+                                                     from->swapchainCount * sizeof(const uint64_t));
+    }
+}
+
+void deepcopy_VkPhysicalDevicePresentIdFeaturesKHR(Allocator* alloc, VkStructureType rootType,
+                                                   const VkPhysicalDevicePresentIdFeaturesKHR* from,
+                                                   VkPhysicalDevicePresentIdFeaturesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_video_encode_queue
+void deepcopy_VkVideoEncodeInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                   const VkVideoEncodeInfoKHR* from, VkVideoEncodeInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkExtent2D(alloc, rootType, &from->codedExtent, (VkExtent2D*)(&to->codedExtent));
+    deepcopy_VkVideoPictureResourceKHR(alloc, rootType, &from->srcPictureResource,
+                                       (VkVideoPictureResourceKHR*)(&to->srcPictureResource));
+    to->pSetupReferenceSlot = nullptr;
+    if (from->pSetupReferenceSlot) {
+        to->pSetupReferenceSlot =
+            (VkVideoReferenceSlotKHR*)alloc->alloc(sizeof(const VkVideoReferenceSlotKHR));
+        deepcopy_VkVideoReferenceSlotKHR(alloc, rootType, from->pSetupReferenceSlot,
+                                         (VkVideoReferenceSlotKHR*)(to->pSetupReferenceSlot));
+    }
+    if (from) {
+        to->pReferenceSlots = nullptr;
+        if (from->pReferenceSlots) {
+            to->pReferenceSlots = (VkVideoReferenceSlotKHR*)alloc->alloc(
+                from->referenceSlotCount * sizeof(const VkVideoReferenceSlotKHR));
+            to->referenceSlotCount = from->referenceSlotCount;
+            for (uint32_t i = 0; i < (uint32_t)from->referenceSlotCount; ++i) {
+                deepcopy_VkVideoReferenceSlotKHR(
+                    alloc, rootType, from->pReferenceSlots + i,
+                    (VkVideoReferenceSlotKHR*)(to->pReferenceSlots + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkVideoEncodeRateControlInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                              const VkVideoEncodeRateControlInfoKHR* from,
+                                              VkVideoEncodeRateControlInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_synchronization2
+void deepcopy_VkMemoryBarrier2KHR(Allocator* alloc, VkStructureType rootType,
+                                  const VkMemoryBarrier2KHR* from, VkMemoryBarrier2KHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkBufferMemoryBarrier2KHR(Allocator* alloc, VkStructureType rootType,
+                                        const VkBufferMemoryBarrier2KHR* from,
+                                        VkBufferMemoryBarrier2KHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkImageMemoryBarrier2KHR(Allocator* alloc, VkStructureType rootType,
+                                       const VkImageMemoryBarrier2KHR* from,
+                                       VkImageMemoryBarrier2KHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkImageSubresourceRange(alloc, rootType, &from->subresourceRange,
+                                     (VkImageSubresourceRange*)(&to->subresourceRange));
+}
+
+void deepcopy_VkDependencyInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                  const VkDependencyInfoKHR* from, VkDependencyInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pMemoryBarriers = nullptr;
+        if (from->pMemoryBarriers) {
+            to->pMemoryBarriers = (VkMemoryBarrier2KHR*)alloc->alloc(
+                from->memoryBarrierCount * sizeof(const VkMemoryBarrier2KHR));
+            to->memoryBarrierCount = from->memoryBarrierCount;
+            for (uint32_t i = 0; i < (uint32_t)from->memoryBarrierCount; ++i) {
+                deepcopy_VkMemoryBarrier2KHR(alloc, rootType, from->pMemoryBarriers + i,
+                                             (VkMemoryBarrier2KHR*)(to->pMemoryBarriers + i));
+            }
+        }
+    }
+    if (from) {
+        to->pBufferMemoryBarriers = nullptr;
+        if (from->pBufferMemoryBarriers) {
+            to->pBufferMemoryBarriers = (VkBufferMemoryBarrier2KHR*)alloc->alloc(
+                from->bufferMemoryBarrierCount * sizeof(const VkBufferMemoryBarrier2KHR));
+            to->bufferMemoryBarrierCount = from->bufferMemoryBarrierCount;
+            for (uint32_t i = 0; i < (uint32_t)from->bufferMemoryBarrierCount; ++i) {
+                deepcopy_VkBufferMemoryBarrier2KHR(
+                    alloc, rootType, from->pBufferMemoryBarriers + i,
+                    (VkBufferMemoryBarrier2KHR*)(to->pBufferMemoryBarriers + i));
+            }
+        }
+    }
+    if (from) {
+        to->pImageMemoryBarriers = nullptr;
+        if (from->pImageMemoryBarriers) {
+            to->pImageMemoryBarriers = (VkImageMemoryBarrier2KHR*)alloc->alloc(
+                from->imageMemoryBarrierCount * sizeof(const VkImageMemoryBarrier2KHR));
+            to->imageMemoryBarrierCount = from->imageMemoryBarrierCount;
+            for (uint32_t i = 0; i < (uint32_t)from->imageMemoryBarrierCount; ++i) {
+                deepcopy_VkImageMemoryBarrier2KHR(
+                    alloc, rootType, from->pImageMemoryBarriers + i,
+                    (VkImageMemoryBarrier2KHR*)(to->pImageMemoryBarriers + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkSemaphoreSubmitInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                       const VkSemaphoreSubmitInfoKHR* from,
+                                       VkSemaphoreSubmitInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkCommandBufferSubmitInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                           const VkCommandBufferSubmitInfoKHR* from,
+                                           VkCommandBufferSubmitInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkSubmitInfo2KHR(Allocator* alloc, VkStructureType rootType,
+                               const VkSubmitInfo2KHR* from, VkSubmitInfo2KHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pWaitSemaphoreInfos = nullptr;
+        if (from->pWaitSemaphoreInfos) {
+            to->pWaitSemaphoreInfos = (VkSemaphoreSubmitInfoKHR*)alloc->alloc(
+                from->waitSemaphoreInfoCount * sizeof(const VkSemaphoreSubmitInfoKHR));
+            to->waitSemaphoreInfoCount = from->waitSemaphoreInfoCount;
+            for (uint32_t i = 0; i < (uint32_t)from->waitSemaphoreInfoCount; ++i) {
+                deepcopy_VkSemaphoreSubmitInfoKHR(
+                    alloc, rootType, from->pWaitSemaphoreInfos + i,
+                    (VkSemaphoreSubmitInfoKHR*)(to->pWaitSemaphoreInfos + i));
+            }
+        }
+    }
+    if (from) {
+        to->pCommandBufferInfos = nullptr;
+        if (from->pCommandBufferInfos) {
+            to->pCommandBufferInfos = (VkCommandBufferSubmitInfoKHR*)alloc->alloc(
+                from->commandBufferInfoCount * sizeof(const VkCommandBufferSubmitInfoKHR));
+            to->commandBufferInfoCount = from->commandBufferInfoCount;
+            for (uint32_t i = 0; i < (uint32_t)from->commandBufferInfoCount; ++i) {
+                deepcopy_VkCommandBufferSubmitInfoKHR(
+                    alloc, rootType, from->pCommandBufferInfos + i,
+                    (VkCommandBufferSubmitInfoKHR*)(to->pCommandBufferInfos + i));
+            }
+        }
+    }
+    if (from) {
+        to->pSignalSemaphoreInfos = nullptr;
+        if (from->pSignalSemaphoreInfos) {
+            to->pSignalSemaphoreInfos = (VkSemaphoreSubmitInfoKHR*)alloc->alloc(
+                from->signalSemaphoreInfoCount * sizeof(const VkSemaphoreSubmitInfoKHR));
+            to->signalSemaphoreInfoCount = from->signalSemaphoreInfoCount;
+            for (uint32_t i = 0; i < (uint32_t)from->signalSemaphoreInfoCount; ++i) {
+                deepcopy_VkSemaphoreSubmitInfoKHR(
+                    alloc, rootType, from->pSignalSemaphoreInfos + i,
+                    (VkSemaphoreSubmitInfoKHR*)(to->pSignalSemaphoreInfos + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkPhysicalDeviceSynchronization2FeaturesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceSynchronization2FeaturesKHR* from,
+    VkPhysicalDeviceSynchronization2FeaturesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkQueueFamilyCheckpointProperties2NV(Allocator* alloc, VkStructureType rootType,
+                                                   const VkQueueFamilyCheckpointProperties2NV* from,
+                                                   VkQueueFamilyCheckpointProperties2NV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkCheckpointData2NV(Allocator* alloc, VkStructureType rootType,
+                                  const VkCheckpointData2NV* from, VkCheckpointData2NV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pCheckpointMarker = nullptr;
+    if (from->pCheckpointMarker) {
+        to->pCheckpointMarker = (void*)alloc->dupArray(from->pCheckpointMarker, sizeof(uint8_t));
+    }
+}
+
+#endif
+#ifdef VK_KHR_shader_subgroup_uniform_control_flow
+void deepcopy_VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR* from,
+    VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_zero_initialize_workgroup_memory
+void deepcopy_VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR* from,
+    VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_workgroup_memory_explicit_layout
+void deepcopy_VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR* from,
+    VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_copy_commands2
+void deepcopy_VkBufferCopy2KHR(Allocator* alloc, VkStructureType rootType,
+                               const VkBufferCopy2KHR* from, VkBufferCopy2KHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkCopyBufferInfo2KHR(Allocator* alloc, VkStructureType rootType,
+                                   const VkCopyBufferInfo2KHR* from, VkCopyBufferInfo2KHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pRegions = nullptr;
+        if (from->pRegions) {
+            to->pRegions =
+                (VkBufferCopy2KHR*)alloc->alloc(from->regionCount * sizeof(const VkBufferCopy2KHR));
+            to->regionCount = from->regionCount;
+            for (uint32_t i = 0; i < (uint32_t)from->regionCount; ++i) {
+                deepcopy_VkBufferCopy2KHR(alloc, rootType, from->pRegions + i,
+                                          (VkBufferCopy2KHR*)(to->pRegions + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkImageCopy2KHR(Allocator* alloc, VkStructureType rootType,
+                              const VkImageCopy2KHR* from, VkImageCopy2KHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->srcSubresource,
+                                      (VkImageSubresourceLayers*)(&to->srcSubresource));
+    deepcopy_VkOffset3D(alloc, rootType, &from->srcOffset, (VkOffset3D*)(&to->srcOffset));
+    deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->dstSubresource,
+                                      (VkImageSubresourceLayers*)(&to->dstSubresource));
+    deepcopy_VkOffset3D(alloc, rootType, &from->dstOffset, (VkOffset3D*)(&to->dstOffset));
+    deepcopy_VkExtent3D(alloc, rootType, &from->extent, (VkExtent3D*)(&to->extent));
+}
+
+void deepcopy_VkCopyImageInfo2KHR(Allocator* alloc, VkStructureType rootType,
+                                  const VkCopyImageInfo2KHR* from, VkCopyImageInfo2KHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pRegions = nullptr;
+        if (from->pRegions) {
+            to->pRegions =
+                (VkImageCopy2KHR*)alloc->alloc(from->regionCount * sizeof(const VkImageCopy2KHR));
+            to->regionCount = from->regionCount;
+            for (uint32_t i = 0; i < (uint32_t)from->regionCount; ++i) {
+                deepcopy_VkImageCopy2KHR(alloc, rootType, from->pRegions + i,
+                                         (VkImageCopy2KHR*)(to->pRegions + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkBufferImageCopy2KHR(Allocator* alloc, VkStructureType rootType,
+                                    const VkBufferImageCopy2KHR* from, VkBufferImageCopy2KHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->imageSubresource,
+                                      (VkImageSubresourceLayers*)(&to->imageSubresource));
+    deepcopy_VkOffset3D(alloc, rootType, &from->imageOffset, (VkOffset3D*)(&to->imageOffset));
+    deepcopy_VkExtent3D(alloc, rootType, &from->imageExtent, (VkExtent3D*)(&to->imageExtent));
+}
+
+void deepcopy_VkCopyBufferToImageInfo2KHR(Allocator* alloc, VkStructureType rootType,
+                                          const VkCopyBufferToImageInfo2KHR* from,
+                                          VkCopyBufferToImageInfo2KHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pRegions = nullptr;
+        if (from->pRegions) {
+            to->pRegions = (VkBufferImageCopy2KHR*)alloc->alloc(
+                from->regionCount * sizeof(const VkBufferImageCopy2KHR));
+            to->regionCount = from->regionCount;
+            for (uint32_t i = 0; i < (uint32_t)from->regionCount; ++i) {
+                deepcopy_VkBufferImageCopy2KHR(alloc, rootType, from->pRegions + i,
+                                               (VkBufferImageCopy2KHR*)(to->pRegions + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkCopyImageToBufferInfo2KHR(Allocator* alloc, VkStructureType rootType,
+                                          const VkCopyImageToBufferInfo2KHR* from,
+                                          VkCopyImageToBufferInfo2KHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pRegions = nullptr;
+        if (from->pRegions) {
+            to->pRegions = (VkBufferImageCopy2KHR*)alloc->alloc(
+                from->regionCount * sizeof(const VkBufferImageCopy2KHR));
+            to->regionCount = from->regionCount;
+            for (uint32_t i = 0; i < (uint32_t)from->regionCount; ++i) {
+                deepcopy_VkBufferImageCopy2KHR(alloc, rootType, from->pRegions + i,
+                                               (VkBufferImageCopy2KHR*)(to->pRegions + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkImageBlit2KHR(Allocator* alloc, VkStructureType rootType,
+                              const VkImageBlit2KHR* from, VkImageBlit2KHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->srcSubresource,
+                                      (VkImageSubresourceLayers*)(&to->srcSubresource));
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        deepcopy_VkOffset3D(alloc, rootType, from->srcOffsets + i,
+                            (VkOffset3D*)(to->srcOffsets + i));
+    }
+    deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->dstSubresource,
+                                      (VkImageSubresourceLayers*)(&to->dstSubresource));
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        deepcopy_VkOffset3D(alloc, rootType, from->dstOffsets + i,
+                            (VkOffset3D*)(to->dstOffsets + i));
+    }
+}
+
+void deepcopy_VkBlitImageInfo2KHR(Allocator* alloc, VkStructureType rootType,
+                                  const VkBlitImageInfo2KHR* from, VkBlitImageInfo2KHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pRegions = nullptr;
+        if (from->pRegions) {
+            to->pRegions =
+                (VkImageBlit2KHR*)alloc->alloc(from->regionCount * sizeof(const VkImageBlit2KHR));
+            to->regionCount = from->regionCount;
+            for (uint32_t i = 0; i < (uint32_t)from->regionCount; ++i) {
+                deepcopy_VkImageBlit2KHR(alloc, rootType, from->pRegions + i,
+                                         (VkImageBlit2KHR*)(to->pRegions + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkImageResolve2KHR(Allocator* alloc, VkStructureType rootType,
+                                 const VkImageResolve2KHR* from, VkImageResolve2KHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->srcSubresource,
+                                      (VkImageSubresourceLayers*)(&to->srcSubresource));
+    deepcopy_VkOffset3D(alloc, rootType, &from->srcOffset, (VkOffset3D*)(&to->srcOffset));
+    deepcopy_VkImageSubresourceLayers(alloc, rootType, &from->dstSubresource,
+                                      (VkImageSubresourceLayers*)(&to->dstSubresource));
+    deepcopy_VkOffset3D(alloc, rootType, &from->dstOffset, (VkOffset3D*)(&to->dstOffset));
+    deepcopy_VkExtent3D(alloc, rootType, &from->extent, (VkExtent3D*)(&to->extent));
+}
+
+void deepcopy_VkResolveImageInfo2KHR(Allocator* alloc, VkStructureType rootType,
+                                     const VkResolveImageInfo2KHR* from,
+                                     VkResolveImageInfo2KHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pRegions = nullptr;
+        if (from->pRegions) {
+            to->pRegions = (VkImageResolve2KHR*)alloc->alloc(from->regionCount *
+                                                             sizeof(const VkImageResolve2KHR));
+            to->regionCount = from->regionCount;
+            for (uint32_t i = 0; i < (uint32_t)from->regionCount; ++i) {
+                deepcopy_VkImageResolve2KHR(alloc, rootType, from->pRegions + i,
+                                            (VkImageResolve2KHR*)(to->pRegions + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_KHR_format_feature_flags2
+void deepcopy_VkFormatProperties3KHR(Allocator* alloc, VkStructureType rootType,
+                                     const VkFormatProperties3KHR* from,
+                                     VkFormatProperties3KHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_maintenance4
+void deepcopy_VkPhysicalDeviceMaintenance4FeaturesKHR(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceMaintenance4FeaturesKHR* from,
+    VkPhysicalDeviceMaintenance4FeaturesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceMaintenance4PropertiesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceMaintenance4PropertiesKHR* from,
+    VkPhysicalDeviceMaintenance4PropertiesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkDeviceBufferMemoryRequirementsKHR(Allocator* alloc, VkStructureType rootType,
+                                                  const VkDeviceBufferMemoryRequirementsKHR* from,
+                                                  VkDeviceBufferMemoryRequirementsKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pCreateInfo = nullptr;
+    if (from->pCreateInfo) {
+        to->pCreateInfo = (VkBufferCreateInfo*)alloc->alloc(sizeof(const VkBufferCreateInfo));
+        deepcopy_VkBufferCreateInfo(alloc, rootType, from->pCreateInfo,
+                                    (VkBufferCreateInfo*)(to->pCreateInfo));
+    }
+}
+
+void deepcopy_VkDeviceImageMemoryRequirementsKHR(Allocator* alloc, VkStructureType rootType,
+                                                 const VkDeviceImageMemoryRequirementsKHR* from,
+                                                 VkDeviceImageMemoryRequirementsKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pCreateInfo = nullptr;
+    if (from->pCreateInfo) {
+        to->pCreateInfo = (VkImageCreateInfo*)alloc->alloc(sizeof(const VkImageCreateInfo));
+        deepcopy_VkImageCreateInfo(alloc, rootType, from->pCreateInfo,
+                                   (VkImageCreateInfo*)(to->pCreateInfo));
+    }
+}
+
+#endif
+#ifdef VK_ANDROID_native_buffer
+void deepcopy_VkNativeBufferANDROID(Allocator* alloc, VkStructureType rootType,
+                                    const VkNativeBufferANDROID* from, VkNativeBufferANDROID* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->handle = nullptr;
+    if (from->handle) {
+        to->handle = (uint32_t*)alloc->dupArray(from->handle, sizeof(const uint32_t));
+    }
+}
+
+#endif
+#ifdef VK_EXT_debug_report
+void deepcopy_VkDebugReportCallbackCreateInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                                 const VkDebugReportCallbackCreateInfoEXT* from,
+                                                 VkDebugReportCallbackCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pUserData = nullptr;
+    if (from->pUserData) {
+        to->pUserData = (void*)alloc->dupArray(from->pUserData, sizeof(uint8_t));
+    }
+}
+
+#endif
+#ifdef VK_NV_glsl_shader
+#endif
+#ifdef VK_EXT_depth_range_unrestricted
+#endif
+#ifdef VK_IMG_filter_cubic
+#endif
+#ifdef VK_AMD_rasterization_order
+void deepcopy_VkPipelineRasterizationStateRasterizationOrderAMD(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineRasterizationStateRasterizationOrderAMD* from,
+    VkPipelineRasterizationStateRasterizationOrderAMD* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_shader_trinary_minmax
+#endif
+#ifdef VK_AMD_shader_explicit_vertex_parameter
+#endif
+#ifdef VK_EXT_debug_marker
+void deepcopy_VkDebugMarkerObjectNameInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                             const VkDebugMarkerObjectNameInfoEXT* from,
+                                             VkDebugMarkerObjectNameInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pObjectName = nullptr;
+    if (from->pObjectName) {
+        to->pObjectName = alloc->strDup(from->pObjectName);
+    }
+}
+
+void deepcopy_VkDebugMarkerObjectTagInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                            const VkDebugMarkerObjectTagInfoEXT* from,
+                                            VkDebugMarkerObjectTagInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pTag = nullptr;
+    if (from->pTag) {
+        to->pTag = (void*)alloc->dupArray(from->pTag, from->tagSize * sizeof(const uint8_t));
+    }
+}
+
+void deepcopy_VkDebugMarkerMarkerInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                         const VkDebugMarkerMarkerInfoEXT* from,
+                                         VkDebugMarkerMarkerInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pMarkerName = nullptr;
+    if (from->pMarkerName) {
+        to->pMarkerName = alloc->strDup(from->pMarkerName);
+    }
+    memcpy(to->color, from->color, 4 * sizeof(float));
+}
+
+#endif
+#ifdef VK_AMD_gcn_shader
+#endif
+#ifdef VK_NV_dedicated_allocation
+void deepcopy_VkDedicatedAllocationImageCreateInfoNV(
+    Allocator* alloc, VkStructureType rootType, const VkDedicatedAllocationImageCreateInfoNV* from,
+    VkDedicatedAllocationImageCreateInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkDedicatedAllocationBufferCreateInfoNV(
+    Allocator* alloc, VkStructureType rootType, const VkDedicatedAllocationBufferCreateInfoNV* from,
+    VkDedicatedAllocationBufferCreateInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkDedicatedAllocationMemoryAllocateInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkDedicatedAllocationMemoryAllocateInfoNV* from,
+    VkDedicatedAllocationMemoryAllocateInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_transform_feedback
+void deepcopy_VkPhysicalDeviceTransformFeedbackFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceTransformFeedbackFeaturesEXT* from,
+    VkPhysicalDeviceTransformFeedbackFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceTransformFeedbackPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceTransformFeedbackPropertiesEXT* from,
+    VkPhysicalDeviceTransformFeedbackPropertiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPipelineRasterizationStateStreamCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineRasterizationStateStreamCreateInfoEXT* from,
+    VkPipelineRasterizationStateStreamCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NVX_binary_import
+void deepcopy_VkCuModuleCreateInfoNVX(Allocator* alloc, VkStructureType rootType,
+                                      const VkCuModuleCreateInfoNVX* from,
+                                      VkCuModuleCreateInfoNVX* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pData = nullptr;
+    if (from->pData) {
+        to->pData = (void*)alloc->dupArray(from->pData, from->dataSize * sizeof(const uint8_t));
+    }
+}
+
+void deepcopy_VkCuFunctionCreateInfoNVX(Allocator* alloc, VkStructureType rootType,
+                                        const VkCuFunctionCreateInfoNVX* from,
+                                        VkCuFunctionCreateInfoNVX* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pName = nullptr;
+    if (from->pName) {
+        to->pName = alloc->strDup(from->pName);
+    }
+}
+
+void deepcopy_VkCuLaunchInfoNVX(Allocator* alloc, VkStructureType rootType,
+                                const VkCuLaunchInfoNVX* from, VkCuLaunchInfoNVX* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NVX_image_view_handle
+void deepcopy_VkImageViewHandleInfoNVX(Allocator* alloc, VkStructureType rootType,
+                                       const VkImageViewHandleInfoNVX* from,
+                                       VkImageViewHandleInfoNVX* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkImageViewAddressPropertiesNVX(Allocator* alloc, VkStructureType rootType,
+                                              const VkImageViewAddressPropertiesNVX* from,
+                                              VkImageViewAddressPropertiesNVX* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_draw_indirect_count
+#endif
+#ifdef VK_AMD_negative_viewport_height
+#endif
+#ifdef VK_AMD_gpu_shader_half_float
+#endif
+#ifdef VK_AMD_shader_ballot
+#endif
+#ifdef VK_EXT_video_encode_h264
+void deepcopy_VkVideoEncodeH264CapabilitiesEXT(Allocator* alloc, VkStructureType rootType,
+                                               const VkVideoEncodeH264CapabilitiesEXT* from,
+                                               VkVideoEncodeH264CapabilitiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkExtent2D(alloc, rootType, &from->minPictureSizeInMbs,
+                        (VkExtent2D*)(&to->minPictureSizeInMbs));
+    deepcopy_VkExtent2D(alloc, rootType, &from->maxPictureSizeInMbs,
+                        (VkExtent2D*)(&to->maxPictureSizeInMbs));
+    deepcopy_VkExtent2D(alloc, rootType, &from->inputImageDataAlignment,
+                        (VkExtent2D*)(&to->inputImageDataAlignment));
+    deepcopy_VkExtensionProperties(alloc, rootType, &from->stdExtensionVersion,
+                                   (VkExtensionProperties*)(&to->stdExtensionVersion));
+}
+
+void deepcopy_VkVideoEncodeH264SessionCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType, const VkVideoEncodeH264SessionCreateInfoEXT* from,
+    VkVideoEncodeH264SessionCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkExtent2D(alloc, rootType, &from->maxPictureSizeInMbs,
+                        (VkExtent2D*)(&to->maxPictureSizeInMbs));
+    to->pStdExtensionVersion = nullptr;
+    if (from->pStdExtensionVersion) {
+        to->pStdExtensionVersion =
+            (VkExtensionProperties*)alloc->alloc(sizeof(const VkExtensionProperties));
+        deepcopy_VkExtensionProperties(alloc, rootType, from->pStdExtensionVersion,
+                                       (VkExtensionProperties*)(to->pStdExtensionVersion));
+    }
+}
+
+void deepcopy_VkVideoEncodeH264SessionParametersAddInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkVideoEncodeH264SessionParametersAddInfoEXT* from,
+    VkVideoEncodeH264SessionParametersAddInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pSpsStd = nullptr;
+    if (from->pSpsStd) {
+        to->pSpsStd = (StdVideoH264SequenceParameterSet*)alloc->dupArray(
+            from->pSpsStd, from->spsStdCount * sizeof(const StdVideoH264SequenceParameterSet));
+    }
+    to->pPpsStd = nullptr;
+    if (from->pPpsStd) {
+        to->pPpsStd = (StdVideoH264PictureParameterSet*)alloc->dupArray(
+            from->pPpsStd, from->ppsStdCount * sizeof(const StdVideoH264PictureParameterSet));
+    }
+}
+
+void deepcopy_VkVideoEncodeH264SessionParametersCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkVideoEncodeH264SessionParametersCreateInfoEXT* from,
+    VkVideoEncodeH264SessionParametersCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pParametersAddInfo = nullptr;
+    if (from->pParametersAddInfo) {
+        to->pParametersAddInfo = (VkVideoEncodeH264SessionParametersAddInfoEXT*)alloc->alloc(
+            sizeof(const VkVideoEncodeH264SessionParametersAddInfoEXT));
+        deepcopy_VkVideoEncodeH264SessionParametersAddInfoEXT(
+            alloc, rootType, from->pParametersAddInfo,
+            (VkVideoEncodeH264SessionParametersAddInfoEXT*)(to->pParametersAddInfo));
+    }
+}
+
+void deepcopy_VkVideoEncodeH264DpbSlotInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                              const VkVideoEncodeH264DpbSlotInfoEXT* from,
+                                              VkVideoEncodeH264DpbSlotInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pStdPictureInfo = nullptr;
+    if (from->pStdPictureInfo) {
+        to->pStdPictureInfo = (StdVideoEncodeH264PictureInfo*)alloc->dupArray(
+            from->pStdPictureInfo, sizeof(const StdVideoEncodeH264PictureInfo));
+    }
+}
+
+void deepcopy_VkVideoEncodeH264NaluSliceEXT(Allocator* alloc, VkStructureType rootType,
+                                            const VkVideoEncodeH264NaluSliceEXT* from,
+                                            VkVideoEncodeH264NaluSliceEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pSliceHeaderStd = nullptr;
+    if (from->pSliceHeaderStd) {
+        to->pSliceHeaderStd = (StdVideoEncodeH264SliceHeader*)alloc->dupArray(
+            from->pSliceHeaderStd, sizeof(const StdVideoEncodeH264SliceHeader));
+    }
+    if (from) {
+        to->pRefFinalList0Entries = nullptr;
+        if (from->pRefFinalList0Entries) {
+            to->pRefFinalList0Entries = (VkVideoEncodeH264DpbSlotInfoEXT*)alloc->alloc(
+                from->refFinalList0EntryCount * sizeof(const VkVideoEncodeH264DpbSlotInfoEXT));
+            to->refFinalList0EntryCount = from->refFinalList0EntryCount;
+            for (uint32_t i = 0; i < (uint32_t)from->refFinalList0EntryCount; ++i) {
+                deepcopy_VkVideoEncodeH264DpbSlotInfoEXT(
+                    alloc, rootType, from->pRefFinalList0Entries + i,
+                    (VkVideoEncodeH264DpbSlotInfoEXT*)(to->pRefFinalList0Entries + i));
+            }
+        }
+    }
+    if (from) {
+        to->pRefFinalList1Entries = nullptr;
+        if (from->pRefFinalList1Entries) {
+            to->pRefFinalList1Entries = (VkVideoEncodeH264DpbSlotInfoEXT*)alloc->alloc(
+                from->refFinalList1EntryCount * sizeof(const VkVideoEncodeH264DpbSlotInfoEXT));
+            to->refFinalList1EntryCount = from->refFinalList1EntryCount;
+            for (uint32_t i = 0; i < (uint32_t)from->refFinalList1EntryCount; ++i) {
+                deepcopy_VkVideoEncodeH264DpbSlotInfoEXT(
+                    alloc, rootType, from->pRefFinalList1Entries + i,
+                    (VkVideoEncodeH264DpbSlotInfoEXT*)(to->pRefFinalList1Entries + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkVideoEncodeH264VclFrameInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                               const VkVideoEncodeH264VclFrameInfoEXT* from,
+                                               VkVideoEncodeH264VclFrameInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pRefDefaultFinalList0Entries = nullptr;
+        if (from->pRefDefaultFinalList0Entries) {
+            to->pRefDefaultFinalList0Entries = (VkVideoEncodeH264DpbSlotInfoEXT*)alloc->alloc(
+                from->refDefaultFinalList0EntryCount *
+                sizeof(const VkVideoEncodeH264DpbSlotInfoEXT));
+            to->refDefaultFinalList0EntryCount = from->refDefaultFinalList0EntryCount;
+            for (uint32_t i = 0; i < (uint32_t)from->refDefaultFinalList0EntryCount; ++i) {
+                deepcopy_VkVideoEncodeH264DpbSlotInfoEXT(
+                    alloc, rootType, from->pRefDefaultFinalList0Entries + i,
+                    (VkVideoEncodeH264DpbSlotInfoEXT*)(to->pRefDefaultFinalList0Entries + i));
+            }
+        }
+    }
+    if (from) {
+        to->pRefDefaultFinalList1Entries = nullptr;
+        if (from->pRefDefaultFinalList1Entries) {
+            to->pRefDefaultFinalList1Entries = (VkVideoEncodeH264DpbSlotInfoEXT*)alloc->alloc(
+                from->refDefaultFinalList1EntryCount *
+                sizeof(const VkVideoEncodeH264DpbSlotInfoEXT));
+            to->refDefaultFinalList1EntryCount = from->refDefaultFinalList1EntryCount;
+            for (uint32_t i = 0; i < (uint32_t)from->refDefaultFinalList1EntryCount; ++i) {
+                deepcopy_VkVideoEncodeH264DpbSlotInfoEXT(
+                    alloc, rootType, from->pRefDefaultFinalList1Entries + i,
+                    (VkVideoEncodeH264DpbSlotInfoEXT*)(to->pRefDefaultFinalList1Entries + i));
+            }
+        }
+    }
+    if (from) {
+        to->pNaluSliceEntries = nullptr;
+        if (from->pNaluSliceEntries) {
+            to->pNaluSliceEntries = (VkVideoEncodeH264NaluSliceEXT*)alloc->alloc(
+                from->naluSliceEntryCount * sizeof(const VkVideoEncodeH264NaluSliceEXT));
+            to->naluSliceEntryCount = from->naluSliceEntryCount;
+            for (uint32_t i = 0; i < (uint32_t)from->naluSliceEntryCount; ++i) {
+                deepcopy_VkVideoEncodeH264NaluSliceEXT(
+                    alloc, rootType, from->pNaluSliceEntries + i,
+                    (VkVideoEncodeH264NaluSliceEXT*)(to->pNaluSliceEntries + i));
+            }
+        }
+    }
+    to->pCurrentPictureInfo = nullptr;
+    if (from->pCurrentPictureInfo) {
+        to->pCurrentPictureInfo = (VkVideoEncodeH264DpbSlotInfoEXT*)alloc->alloc(
+            sizeof(const VkVideoEncodeH264DpbSlotInfoEXT));
+        deepcopy_VkVideoEncodeH264DpbSlotInfoEXT(
+            alloc, rootType, from->pCurrentPictureInfo,
+            (VkVideoEncodeH264DpbSlotInfoEXT*)(to->pCurrentPictureInfo));
+    }
+}
+
+void deepcopy_VkVideoEncodeH264EmitPictureParametersEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkVideoEncodeH264EmitPictureParametersEXT* from,
+    VkVideoEncodeH264EmitPictureParametersEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->ppsIdEntries = nullptr;
+    if (from->ppsIdEntries) {
+        to->ppsIdEntries = (uint8_t*)alloc->dupArray(from->ppsIdEntries,
+                                                     from->ppsIdEntryCount * sizeof(const uint8_t));
+    }
+}
+
+void deepcopy_VkVideoEncodeH264ProfileEXT(Allocator* alloc, VkStructureType rootType,
+                                          const VkVideoEncodeH264ProfileEXT* from,
+                                          VkVideoEncodeH264ProfileEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_video_encode_h265
+void deepcopy_VkVideoEncodeH265CapabilitiesEXT(Allocator* alloc, VkStructureType rootType,
+                                               const VkVideoEncodeH265CapabilitiesEXT* from,
+                                               VkVideoEncodeH265CapabilitiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkExtent2D(alloc, rootType, &from->inputImageDataAlignment,
+                        (VkExtent2D*)(&to->inputImageDataAlignment));
+    deepcopy_VkExtensionProperties(alloc, rootType, &from->stdExtensionVersion,
+                                   (VkExtensionProperties*)(&to->stdExtensionVersion));
+}
+
+void deepcopy_VkVideoEncodeH265SessionCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType, const VkVideoEncodeH265SessionCreateInfoEXT* from,
+    VkVideoEncodeH265SessionCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pStdExtensionVersion = nullptr;
+    if (from->pStdExtensionVersion) {
+        to->pStdExtensionVersion =
+            (VkExtensionProperties*)alloc->alloc(sizeof(const VkExtensionProperties));
+        deepcopy_VkExtensionProperties(alloc, rootType, from->pStdExtensionVersion,
+                                       (VkExtensionProperties*)(to->pStdExtensionVersion));
+    }
+}
+
+void deepcopy_VkVideoEncodeH265SessionParametersAddInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkVideoEncodeH265SessionParametersAddInfoEXT* from,
+    VkVideoEncodeH265SessionParametersAddInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pVpsStd = nullptr;
+    if (from->pVpsStd) {
+        to->pVpsStd = (StdVideoH265VideoParameterSet*)alloc->dupArray(
+            from->pVpsStd, from->vpsStdCount * sizeof(const StdVideoH265VideoParameterSet));
+    }
+    to->pSpsStd = nullptr;
+    if (from->pSpsStd) {
+        to->pSpsStd = (StdVideoH265SequenceParameterSet*)alloc->dupArray(
+            from->pSpsStd, from->spsStdCount * sizeof(const StdVideoH265SequenceParameterSet));
+    }
+    to->pPpsStd = nullptr;
+    if (from->pPpsStd) {
+        to->pPpsStd = (StdVideoH265PictureParameterSet*)alloc->dupArray(
+            from->pPpsStd, from->ppsStdCount * sizeof(const StdVideoH265PictureParameterSet));
+    }
+}
+
+void deepcopy_VkVideoEncodeH265SessionParametersCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkVideoEncodeH265SessionParametersCreateInfoEXT* from,
+    VkVideoEncodeH265SessionParametersCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pParametersAddInfo = nullptr;
+    if (from->pParametersAddInfo) {
+        to->pParametersAddInfo = (VkVideoEncodeH265SessionParametersAddInfoEXT*)alloc->alloc(
+            sizeof(const VkVideoEncodeH265SessionParametersAddInfoEXT));
+        deepcopy_VkVideoEncodeH265SessionParametersAddInfoEXT(
+            alloc, rootType, from->pParametersAddInfo,
+            (VkVideoEncodeH265SessionParametersAddInfoEXT*)(to->pParametersAddInfo));
+    }
+}
+
+void deepcopy_VkVideoEncodeH265DpbSlotInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                              const VkVideoEncodeH265DpbSlotInfoEXT* from,
+                                              VkVideoEncodeH265DpbSlotInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pStdReferenceInfo = nullptr;
+    if (from->pStdReferenceInfo) {
+        to->pStdReferenceInfo = (StdVideoEncodeH265ReferenceInfo*)alloc->dupArray(
+            from->pStdReferenceInfo, sizeof(const StdVideoEncodeH265ReferenceInfo));
+    }
+}
+
+void deepcopy_VkVideoEncodeH265ReferenceListsEXT(Allocator* alloc, VkStructureType rootType,
+                                                 const VkVideoEncodeH265ReferenceListsEXT* from,
+                                                 VkVideoEncodeH265ReferenceListsEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pReferenceList0Entries = nullptr;
+        if (from->pReferenceList0Entries) {
+            to->pReferenceList0Entries = (VkVideoEncodeH265DpbSlotInfoEXT*)alloc->alloc(
+                from->referenceList0EntryCount * sizeof(const VkVideoEncodeH265DpbSlotInfoEXT));
+            to->referenceList0EntryCount = from->referenceList0EntryCount;
+            for (uint32_t i = 0; i < (uint32_t)from->referenceList0EntryCount; ++i) {
+                deepcopy_VkVideoEncodeH265DpbSlotInfoEXT(
+                    alloc, rootType, from->pReferenceList0Entries + i,
+                    (VkVideoEncodeH265DpbSlotInfoEXT*)(to->pReferenceList0Entries + i));
+            }
+        }
+    }
+    if (from) {
+        to->pReferenceList1Entries = nullptr;
+        if (from->pReferenceList1Entries) {
+            to->pReferenceList1Entries = (VkVideoEncodeH265DpbSlotInfoEXT*)alloc->alloc(
+                from->referenceList1EntryCount * sizeof(const VkVideoEncodeH265DpbSlotInfoEXT));
+            to->referenceList1EntryCount = from->referenceList1EntryCount;
+            for (uint32_t i = 0; i < (uint32_t)from->referenceList1EntryCount; ++i) {
+                deepcopy_VkVideoEncodeH265DpbSlotInfoEXT(
+                    alloc, rootType, from->pReferenceList1Entries + i,
+                    (VkVideoEncodeH265DpbSlotInfoEXT*)(to->pReferenceList1Entries + i));
+            }
+        }
+    }
+    to->pReferenceModifications = nullptr;
+    if (from->pReferenceModifications) {
+        to->pReferenceModifications = (StdVideoEncodeH265ReferenceModifications*)alloc->dupArray(
+            from->pReferenceModifications, sizeof(const StdVideoEncodeH265ReferenceModifications));
+    }
+}
+
+void deepcopy_VkVideoEncodeH265NaluSliceEXT(Allocator* alloc, VkStructureType rootType,
+                                            const VkVideoEncodeH265NaluSliceEXT* from,
+                                            VkVideoEncodeH265NaluSliceEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pReferenceFinalLists = nullptr;
+    if (from->pReferenceFinalLists) {
+        to->pReferenceFinalLists = (VkVideoEncodeH265ReferenceListsEXT*)alloc->alloc(
+            sizeof(const VkVideoEncodeH265ReferenceListsEXT));
+        deepcopy_VkVideoEncodeH265ReferenceListsEXT(
+            alloc, rootType, from->pReferenceFinalLists,
+            (VkVideoEncodeH265ReferenceListsEXT*)(to->pReferenceFinalLists));
+    }
+    to->pSliceHeaderStd = nullptr;
+    if (from->pSliceHeaderStd) {
+        to->pSliceHeaderStd = (StdVideoEncodeH265SliceHeader*)alloc->dupArray(
+            from->pSliceHeaderStd, sizeof(const StdVideoEncodeH265SliceHeader));
+    }
+}
+
+void deepcopy_VkVideoEncodeH265VclFrameInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                               const VkVideoEncodeH265VclFrameInfoEXT* from,
+                                               VkVideoEncodeH265VclFrameInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pReferenceFinalLists = nullptr;
+    if (from->pReferenceFinalLists) {
+        to->pReferenceFinalLists = (VkVideoEncodeH265ReferenceListsEXT*)alloc->alloc(
+            sizeof(const VkVideoEncodeH265ReferenceListsEXT));
+        deepcopy_VkVideoEncodeH265ReferenceListsEXT(
+            alloc, rootType, from->pReferenceFinalLists,
+            (VkVideoEncodeH265ReferenceListsEXT*)(to->pReferenceFinalLists));
+    }
+    if (from) {
+        to->pNaluSliceEntries = nullptr;
+        if (from->pNaluSliceEntries) {
+            to->pNaluSliceEntries = (VkVideoEncodeH265NaluSliceEXT*)alloc->alloc(
+                from->naluSliceEntryCount * sizeof(const VkVideoEncodeH265NaluSliceEXT));
+            to->naluSliceEntryCount = from->naluSliceEntryCount;
+            for (uint32_t i = 0; i < (uint32_t)from->naluSliceEntryCount; ++i) {
+                deepcopy_VkVideoEncodeH265NaluSliceEXT(
+                    alloc, rootType, from->pNaluSliceEntries + i,
+                    (VkVideoEncodeH265NaluSliceEXT*)(to->pNaluSliceEntries + i));
+            }
+        }
+    }
+    to->pCurrentPictureInfo = nullptr;
+    if (from->pCurrentPictureInfo) {
+        to->pCurrentPictureInfo = (StdVideoEncodeH265PictureInfo*)alloc->dupArray(
+            from->pCurrentPictureInfo, sizeof(const StdVideoEncodeH265PictureInfo));
+    }
+}
+
+void deepcopy_VkVideoEncodeH265EmitPictureParametersEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkVideoEncodeH265EmitPictureParametersEXT* from,
+    VkVideoEncodeH265EmitPictureParametersEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->ppsIdEntries = nullptr;
+    if (from->ppsIdEntries) {
+        to->ppsIdEntries = (uint8_t*)alloc->dupArray(from->ppsIdEntries,
+                                                     from->ppsIdEntryCount * sizeof(const uint8_t));
+    }
+}
+
+void deepcopy_VkVideoEncodeH265ProfileEXT(Allocator* alloc, VkStructureType rootType,
+                                          const VkVideoEncodeH265ProfileEXT* from,
+                                          VkVideoEncodeH265ProfileEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_video_decode_h264
+void deepcopy_VkVideoDecodeH264ProfileEXT(Allocator* alloc, VkStructureType rootType,
+                                          const VkVideoDecodeH264ProfileEXT* from,
+                                          VkVideoDecodeH264ProfileEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkVideoDecodeH264CapabilitiesEXT(Allocator* alloc, VkStructureType rootType,
+                                               const VkVideoDecodeH264CapabilitiesEXT* from,
+                                               VkVideoDecodeH264CapabilitiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkOffset2D(alloc, rootType, &from->fieldOffsetGranularity,
+                        (VkOffset2D*)(&to->fieldOffsetGranularity));
+    deepcopy_VkExtensionProperties(alloc, rootType, &from->stdExtensionVersion,
+                                   (VkExtensionProperties*)(&to->stdExtensionVersion));
+}
+
+void deepcopy_VkVideoDecodeH264SessionCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType, const VkVideoDecodeH264SessionCreateInfoEXT* from,
+    VkVideoDecodeH264SessionCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pStdExtensionVersion = nullptr;
+    if (from->pStdExtensionVersion) {
+        to->pStdExtensionVersion =
+            (VkExtensionProperties*)alloc->alloc(sizeof(const VkExtensionProperties));
+        deepcopy_VkExtensionProperties(alloc, rootType, from->pStdExtensionVersion,
+                                       (VkExtensionProperties*)(to->pStdExtensionVersion));
+    }
+}
+
+void deepcopy_VkVideoDecodeH264SessionParametersAddInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkVideoDecodeH264SessionParametersAddInfoEXT* from,
+    VkVideoDecodeH264SessionParametersAddInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pSpsStd = nullptr;
+    if (from->pSpsStd) {
+        to->pSpsStd = (StdVideoH264SequenceParameterSet*)alloc->dupArray(
+            from->pSpsStd, from->spsStdCount * sizeof(const StdVideoH264SequenceParameterSet));
+    }
+    to->pPpsStd = nullptr;
+    if (from->pPpsStd) {
+        to->pPpsStd = (StdVideoH264PictureParameterSet*)alloc->dupArray(
+            from->pPpsStd, from->ppsStdCount * sizeof(const StdVideoH264PictureParameterSet));
+    }
+}
+
+void deepcopy_VkVideoDecodeH264SessionParametersCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkVideoDecodeH264SessionParametersCreateInfoEXT* from,
+    VkVideoDecodeH264SessionParametersCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pParametersAddInfo = nullptr;
+    if (from->pParametersAddInfo) {
+        to->pParametersAddInfo = (VkVideoDecodeH264SessionParametersAddInfoEXT*)alloc->alloc(
+            sizeof(const VkVideoDecodeH264SessionParametersAddInfoEXT));
+        deepcopy_VkVideoDecodeH264SessionParametersAddInfoEXT(
+            alloc, rootType, from->pParametersAddInfo,
+            (VkVideoDecodeH264SessionParametersAddInfoEXT*)(to->pParametersAddInfo));
+    }
+}
+
+void deepcopy_VkVideoDecodeH264PictureInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                              const VkVideoDecodeH264PictureInfoEXT* from,
+                                              VkVideoDecodeH264PictureInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pStdPictureInfo = nullptr;
+    if (from->pStdPictureInfo) {
+        to->pStdPictureInfo = (StdVideoDecodeH264PictureInfo*)alloc->dupArray(
+            from->pStdPictureInfo, sizeof(const StdVideoDecodeH264PictureInfo));
+    }
+    to->pSlicesDataOffsets = nullptr;
+    if (from->pSlicesDataOffsets) {
+        to->pSlicesDataOffsets = (uint32_t*)alloc->dupArray(
+            from->pSlicesDataOffsets, from->slicesCount * sizeof(const uint32_t));
+    }
+}
+
+void deepcopy_VkVideoDecodeH264MvcEXT(Allocator* alloc, VkStructureType rootType,
+                                      const VkVideoDecodeH264MvcEXT* from,
+                                      VkVideoDecodeH264MvcEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pStdMvc = nullptr;
+    if (from->pStdMvc) {
+        to->pStdMvc = (StdVideoDecodeH264Mvc*)alloc->dupArray(from->pStdMvc,
+                                                              sizeof(const StdVideoDecodeH264Mvc));
+    }
+}
+
+void deepcopy_VkVideoDecodeH264DpbSlotInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                              const VkVideoDecodeH264DpbSlotInfoEXT* from,
+                                              VkVideoDecodeH264DpbSlotInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pStdReferenceInfo = nullptr;
+    if (from->pStdReferenceInfo) {
+        to->pStdReferenceInfo = (StdVideoDecodeH264ReferenceInfo*)alloc->dupArray(
+            from->pStdReferenceInfo, sizeof(const StdVideoDecodeH264ReferenceInfo));
+    }
+}
+
+#endif
+#ifdef VK_AMD_texture_gather_bias_lod
+void deepcopy_VkTextureLODGatherFormatPropertiesAMD(
+    Allocator* alloc, VkStructureType rootType, const VkTextureLODGatherFormatPropertiesAMD* from,
+    VkTextureLODGatherFormatPropertiesAMD* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_shader_info
+void deepcopy_VkShaderResourceUsageAMD(Allocator* alloc, VkStructureType rootType,
+                                       const VkShaderResourceUsageAMD* from,
+                                       VkShaderResourceUsageAMD* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkShaderStatisticsInfoAMD(Allocator* alloc, VkStructureType rootType,
+                                        const VkShaderStatisticsInfoAMD* from,
+                                        VkShaderStatisticsInfoAMD* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkShaderResourceUsageAMD(alloc, rootType, &from->resourceUsage,
+                                      (VkShaderResourceUsageAMD*)(&to->resourceUsage));
+    memcpy(to->computeWorkGroupSize, from->computeWorkGroupSize, 3 * sizeof(uint32_t));
+}
+
+#endif
+#ifdef VK_AMD_shader_image_load_store_lod
+#endif
+#ifdef VK_GGP_stream_descriptor_surface
+void deepcopy_VkStreamDescriptorSurfaceCreateInfoGGP(
+    Allocator* alloc, VkStructureType rootType, const VkStreamDescriptorSurfaceCreateInfoGGP* from,
+    VkStreamDescriptorSurfaceCreateInfoGGP* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_corner_sampled_image
+void deepcopy_VkPhysicalDeviceCornerSampledImageFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceCornerSampledImageFeaturesNV* from,
+    VkPhysicalDeviceCornerSampledImageFeaturesNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_IMG_format_pvrtc
+#endif
+#ifdef VK_NV_external_memory_capabilities
+void deepcopy_VkExternalImageFormatPropertiesNV(Allocator* alloc, VkStructureType rootType,
+                                                const VkExternalImageFormatPropertiesNV* from,
+                                                VkExternalImageFormatPropertiesNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkImageFormatProperties(alloc, rootType, &from->imageFormatProperties,
+                                     (VkImageFormatProperties*)(&to->imageFormatProperties));
+}
+
+#endif
+#ifdef VK_NV_external_memory
+void deepcopy_VkExternalMemoryImageCreateInfoNV(Allocator* alloc, VkStructureType rootType,
+                                                const VkExternalMemoryImageCreateInfoNV* from,
+                                                VkExternalMemoryImageCreateInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkExportMemoryAllocateInfoNV(Allocator* alloc, VkStructureType rootType,
+                                           const VkExportMemoryAllocateInfoNV* from,
+                                           VkExportMemoryAllocateInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_external_memory_win32
+void deepcopy_VkImportMemoryWin32HandleInfoNV(Allocator* alloc, VkStructureType rootType,
+                                              const VkImportMemoryWin32HandleInfoNV* from,
+                                              VkImportMemoryWin32HandleInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkExportMemoryWin32HandleInfoNV(Allocator* alloc, VkStructureType rootType,
+                                              const VkExportMemoryWin32HandleInfoNV* from,
+                                              VkExportMemoryWin32HandleInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pAttributes = nullptr;
+    if (from->pAttributes) {
+        to->pAttributes = (SECURITY_ATTRIBUTES*)alloc->dupArray(from->pAttributes,
+                                                                sizeof(const SECURITY_ATTRIBUTES));
+    }
+}
+
+#endif
+#ifdef VK_NV_win32_keyed_mutex
+void deepcopy_VkWin32KeyedMutexAcquireReleaseInfoNV(
+    Allocator* alloc, VkStructureType rootType, const VkWin32KeyedMutexAcquireReleaseInfoNV* from,
+    VkWin32KeyedMutexAcquireReleaseInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pAcquireSyncs = nullptr;
+    if (from->pAcquireSyncs) {
+        to->pAcquireSyncs = (VkDeviceMemory*)alloc->dupArray(
+            from->pAcquireSyncs, from->acquireCount * sizeof(const VkDeviceMemory));
+    }
+    to->pAcquireKeys = nullptr;
+    if (from->pAcquireKeys) {
+        to->pAcquireKeys = (uint64_t*)alloc->dupArray(from->pAcquireKeys,
+                                                      from->acquireCount * sizeof(const uint64_t));
+    }
+    to->pAcquireTimeoutMilliseconds = nullptr;
+    if (from->pAcquireTimeoutMilliseconds) {
+        to->pAcquireTimeoutMilliseconds = (uint32_t*)alloc->dupArray(
+            from->pAcquireTimeoutMilliseconds, from->acquireCount * sizeof(const uint32_t));
+    }
+    to->pReleaseSyncs = nullptr;
+    if (from->pReleaseSyncs) {
+        to->pReleaseSyncs = (VkDeviceMemory*)alloc->dupArray(
+            from->pReleaseSyncs, from->releaseCount * sizeof(const VkDeviceMemory));
+    }
+    to->pReleaseKeys = nullptr;
+    if (from->pReleaseKeys) {
+        to->pReleaseKeys = (uint64_t*)alloc->dupArray(from->pReleaseKeys,
+                                                      from->releaseCount * sizeof(const uint64_t));
+    }
+}
+
+#endif
+#ifdef VK_EXT_validation_flags
+void deepcopy_VkValidationFlagsEXT(Allocator* alloc, VkStructureType rootType,
+                                   const VkValidationFlagsEXT* from, VkValidationFlagsEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pDisabledValidationChecks = nullptr;
+    if (from->pDisabledValidationChecks) {
+        to->pDisabledValidationChecks = (VkValidationCheckEXT*)alloc->dupArray(
+            from->pDisabledValidationChecks,
+            from->disabledValidationCheckCount * sizeof(const VkValidationCheckEXT));
+    }
+}
+
+#endif
+#ifdef VK_NN_vi_surface
+void deepcopy_VkViSurfaceCreateInfoNN(Allocator* alloc, VkStructureType rootType,
+                                      const VkViSurfaceCreateInfoNN* from,
+                                      VkViSurfaceCreateInfoNN* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->window = nullptr;
+    if (from->window) {
+        to->window = (void*)alloc->dupArray(from->window, sizeof(uint8_t));
+    }
+}
+
+#endif
+#ifdef VK_EXT_shader_subgroup_ballot
+#endif
+#ifdef VK_EXT_shader_subgroup_vote
+#endif
+#ifdef VK_EXT_texture_compression_astc_hdr
+void deepcopy_VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT* from,
+    VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_astc_decode_mode
+void deepcopy_VkImageViewASTCDecodeModeEXT(Allocator* alloc, VkStructureType rootType,
+                                           const VkImageViewASTCDecodeModeEXT* from,
+                                           VkImageViewASTCDecodeModeEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceASTCDecodeFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceASTCDecodeFeaturesEXT* from,
+    VkPhysicalDeviceASTCDecodeFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_conditional_rendering
+void deepcopy_VkConditionalRenderingBeginInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                                 const VkConditionalRenderingBeginInfoEXT* from,
+                                                 VkConditionalRenderingBeginInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceConditionalRenderingFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceConditionalRenderingFeaturesEXT* from,
+    VkPhysicalDeviceConditionalRenderingFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkCommandBufferInheritanceConditionalRenderingInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkCommandBufferInheritanceConditionalRenderingInfoEXT* from,
+    VkCommandBufferInheritanceConditionalRenderingInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+void deepcopy_VkViewportWScalingNV(Allocator* alloc, VkStructureType rootType,
+                                   const VkViewportWScalingNV* from, VkViewportWScalingNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkPipelineViewportWScalingStateCreateInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineViewportWScalingStateCreateInfoNV* from,
+    VkPipelineViewportWScalingStateCreateInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pViewportWScalings = nullptr;
+        if (from->pViewportWScalings) {
+            to->pViewportWScalings = (VkViewportWScalingNV*)alloc->alloc(
+                from->viewportCount * sizeof(const VkViewportWScalingNV));
+            to->viewportCount = from->viewportCount;
+            for (uint32_t i = 0; i < (uint32_t)from->viewportCount; ++i) {
+                deepcopy_VkViewportWScalingNV(alloc, rootType, from->pViewportWScalings + i,
+                                              (VkViewportWScalingNV*)(to->pViewportWScalings + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_EXT_direct_mode_display
+#endif
+#ifdef VK_EXT_acquire_xlib_display
+#endif
+#ifdef VK_EXT_display_surface_counter
+void deepcopy_VkSurfaceCapabilities2EXT(Allocator* alloc, VkStructureType rootType,
+                                        const VkSurfaceCapabilities2EXT* from,
+                                        VkSurfaceCapabilities2EXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkExtent2D(alloc, rootType, &from->currentExtent, (VkExtent2D*)(&to->currentExtent));
+    deepcopy_VkExtent2D(alloc, rootType, &from->minImageExtent, (VkExtent2D*)(&to->minImageExtent));
+    deepcopy_VkExtent2D(alloc, rootType, &from->maxImageExtent, (VkExtent2D*)(&to->maxImageExtent));
+}
+
+#endif
+#ifdef VK_EXT_display_control
+void deepcopy_VkDisplayPowerInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                    const VkDisplayPowerInfoEXT* from, VkDisplayPowerInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkDeviceEventInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                   const VkDeviceEventInfoEXT* from, VkDeviceEventInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkDisplayEventInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                    const VkDisplayEventInfoEXT* from, VkDisplayEventInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkSwapchainCounterCreateInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                              const VkSwapchainCounterCreateInfoEXT* from,
+                                              VkSwapchainCounterCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_GOOGLE_display_timing
+void deepcopy_VkRefreshCycleDurationGOOGLE(Allocator* alloc, VkStructureType rootType,
+                                           const VkRefreshCycleDurationGOOGLE* from,
+                                           VkRefreshCycleDurationGOOGLE* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkPastPresentationTimingGOOGLE(Allocator* alloc, VkStructureType rootType,
+                                             const VkPastPresentationTimingGOOGLE* from,
+                                             VkPastPresentationTimingGOOGLE* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkPresentTimeGOOGLE(Allocator* alloc, VkStructureType rootType,
+                                  const VkPresentTimeGOOGLE* from, VkPresentTimeGOOGLE* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkPresentTimesInfoGOOGLE(Allocator* alloc, VkStructureType rootType,
+                                       const VkPresentTimesInfoGOOGLE* from,
+                                       VkPresentTimesInfoGOOGLE* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pTimes = nullptr;
+        if (from->pTimes) {
+            to->pTimes = (VkPresentTimeGOOGLE*)alloc->alloc(from->swapchainCount *
+                                                            sizeof(const VkPresentTimeGOOGLE));
+            to->swapchainCount = from->swapchainCount;
+            for (uint32_t i = 0; i < (uint32_t)from->swapchainCount; ++i) {
+                deepcopy_VkPresentTimeGOOGLE(alloc, rootType, from->pTimes + i,
+                                             (VkPresentTimeGOOGLE*)(to->pTimes + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_NV_sample_mask_override_coverage
+#endif
+#ifdef VK_NV_geometry_shader_passthrough
+#endif
+#ifdef VK_NV_viewport_array2
+#endif
+#ifdef VK_NVX_multiview_per_view_attributes
+void deepcopy_VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX* from,
+    VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_viewport_swizzle
+void deepcopy_VkViewportSwizzleNV(Allocator* alloc, VkStructureType rootType,
+                                  const VkViewportSwizzleNV* from, VkViewportSwizzleNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkPipelineViewportSwizzleStateCreateInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineViewportSwizzleStateCreateInfoNV* from,
+    VkPipelineViewportSwizzleStateCreateInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pViewportSwizzles = nullptr;
+        if (from->pViewportSwizzles) {
+            to->pViewportSwizzles = (VkViewportSwizzleNV*)alloc->alloc(
+                from->viewportCount * sizeof(const VkViewportSwizzleNV));
+            to->viewportCount = from->viewportCount;
+            for (uint32_t i = 0; i < (uint32_t)from->viewportCount; ++i) {
+                deepcopy_VkViewportSwizzleNV(alloc, rootType, from->pViewportSwizzles + i,
+                                             (VkViewportSwizzleNV*)(to->pViewportSwizzles + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_EXT_discard_rectangles
+void deepcopy_VkPhysicalDeviceDiscardRectanglePropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceDiscardRectanglePropertiesEXT* from,
+    VkPhysicalDeviceDiscardRectanglePropertiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPipelineDiscardRectangleStateCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineDiscardRectangleStateCreateInfoEXT* from,
+    VkPipelineDiscardRectangleStateCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pDiscardRectangles = nullptr;
+        if (from->pDiscardRectangles) {
+            to->pDiscardRectangles =
+                (VkRect2D*)alloc->alloc(from->discardRectangleCount * sizeof(const VkRect2D));
+            to->discardRectangleCount = from->discardRectangleCount;
+            for (uint32_t i = 0; i < (uint32_t)from->discardRectangleCount; ++i) {
+                deepcopy_VkRect2D(alloc, rootType, from->pDiscardRectangles + i,
+                                  (VkRect2D*)(to->pDiscardRectangles + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_EXT_conservative_rasterization
+void deepcopy_VkPhysicalDeviceConservativeRasterizationPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceConservativeRasterizationPropertiesEXT* from,
+    VkPhysicalDeviceConservativeRasterizationPropertiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPipelineRasterizationConservativeStateCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineRasterizationConservativeStateCreateInfoEXT* from,
+    VkPipelineRasterizationConservativeStateCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_depth_clip_enable
+void deepcopy_VkPhysicalDeviceDepthClipEnableFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceDepthClipEnableFeaturesEXT* from,
+    VkPhysicalDeviceDepthClipEnableFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPipelineRasterizationDepthClipStateCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineRasterizationDepthClipStateCreateInfoEXT* from,
+    VkPipelineRasterizationDepthClipStateCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_swapchain_colorspace
+#endif
+#ifdef VK_EXT_hdr_metadata
+void deepcopy_VkXYColorEXT(Allocator* alloc, VkStructureType rootType, const VkXYColorEXT* from,
+                           VkXYColorEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkHdrMetadataEXT(Allocator* alloc, VkStructureType rootType,
+                               const VkHdrMetadataEXT* from, VkHdrMetadataEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkXYColorEXT(alloc, rootType, &from->displayPrimaryRed,
+                          (VkXYColorEXT*)(&to->displayPrimaryRed));
+    deepcopy_VkXYColorEXT(alloc, rootType, &from->displayPrimaryGreen,
+                          (VkXYColorEXT*)(&to->displayPrimaryGreen));
+    deepcopy_VkXYColorEXT(alloc, rootType, &from->displayPrimaryBlue,
+                          (VkXYColorEXT*)(&to->displayPrimaryBlue));
+    deepcopy_VkXYColorEXT(alloc, rootType, &from->whitePoint, (VkXYColorEXT*)(&to->whitePoint));
+}
+
+#endif
+#ifdef VK_MVK_ios_surface
+void deepcopy_VkIOSSurfaceCreateInfoMVK(Allocator* alloc, VkStructureType rootType,
+                                        const VkIOSSurfaceCreateInfoMVK* from,
+                                        VkIOSSurfaceCreateInfoMVK* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pView = nullptr;
+    if (from->pView) {
+        to->pView = (void*)alloc->dupArray(from->pView, sizeof(const uint8_t));
+    }
+}
+
+#endif
+#ifdef VK_MVK_macos_surface
+void deepcopy_VkMacOSSurfaceCreateInfoMVK(Allocator* alloc, VkStructureType rootType,
+                                          const VkMacOSSurfaceCreateInfoMVK* from,
+                                          VkMacOSSurfaceCreateInfoMVK* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pView = nullptr;
+    if (from->pView) {
+        to->pView = (void*)alloc->dupArray(from->pView, sizeof(const uint8_t));
+    }
+}
+
+#endif
+#ifdef VK_MVK_moltenvk
+#endif
+#ifdef VK_EXT_external_memory_dma_buf
+#endif
+#ifdef VK_EXT_queue_family_foreign
+#endif
+#ifdef VK_EXT_debug_utils
+void deepcopy_VkDebugUtilsLabelEXT(Allocator* alloc, VkStructureType rootType,
+                                   const VkDebugUtilsLabelEXT* from, VkDebugUtilsLabelEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pLabelName = nullptr;
+    if (from->pLabelName) {
+        to->pLabelName = alloc->strDup(from->pLabelName);
+    }
+    memcpy(to->color, from->color, 4 * sizeof(float));
+}
+
+void deepcopy_VkDebugUtilsObjectNameInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                            const VkDebugUtilsObjectNameInfoEXT* from,
+                                            VkDebugUtilsObjectNameInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pObjectName = nullptr;
+    if (from->pObjectName) {
+        to->pObjectName = alloc->strDup(from->pObjectName);
+    }
+}
+
+void deepcopy_VkDebugUtilsMessengerCallbackDataEXT(Allocator* alloc, VkStructureType rootType,
+                                                   const VkDebugUtilsMessengerCallbackDataEXT* from,
+                                                   VkDebugUtilsMessengerCallbackDataEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pMessageIdName = nullptr;
+    if (from->pMessageIdName) {
+        to->pMessageIdName = alloc->strDup(from->pMessageIdName);
+    }
+    to->pMessage = nullptr;
+    if (from->pMessage) {
+        to->pMessage = alloc->strDup(from->pMessage);
+    }
+    if (from) {
+        to->pQueueLabels = nullptr;
+        if (from->pQueueLabels) {
+            to->pQueueLabels = (VkDebugUtilsLabelEXT*)alloc->alloc(from->queueLabelCount *
+                                                                   sizeof(VkDebugUtilsLabelEXT));
+            to->queueLabelCount = from->queueLabelCount;
+            for (uint32_t i = 0; i < (uint32_t)from->queueLabelCount; ++i) {
+                deepcopy_VkDebugUtilsLabelEXT(alloc, rootType, from->pQueueLabels + i,
+                                              (VkDebugUtilsLabelEXT*)(to->pQueueLabels + i));
+            }
+        }
+    }
+    if (from) {
+        to->pCmdBufLabels = nullptr;
+        if (from->pCmdBufLabels) {
+            to->pCmdBufLabels = (VkDebugUtilsLabelEXT*)alloc->alloc(from->cmdBufLabelCount *
+                                                                    sizeof(VkDebugUtilsLabelEXT));
+            to->cmdBufLabelCount = from->cmdBufLabelCount;
+            for (uint32_t i = 0; i < (uint32_t)from->cmdBufLabelCount; ++i) {
+                deepcopy_VkDebugUtilsLabelEXT(alloc, rootType, from->pCmdBufLabels + i,
+                                              (VkDebugUtilsLabelEXT*)(to->pCmdBufLabels + i));
+            }
+        }
+    }
+    if (from) {
+        to->pObjects = nullptr;
+        if (from->pObjects) {
+            to->pObjects = (VkDebugUtilsObjectNameInfoEXT*)alloc->alloc(
+                from->objectCount * sizeof(VkDebugUtilsObjectNameInfoEXT));
+            to->objectCount = from->objectCount;
+            for (uint32_t i = 0; i < (uint32_t)from->objectCount; ++i) {
+                deepcopy_VkDebugUtilsObjectNameInfoEXT(
+                    alloc, rootType, from->pObjects + i,
+                    (VkDebugUtilsObjectNameInfoEXT*)(to->pObjects + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkDebugUtilsMessengerCreateInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                                 const VkDebugUtilsMessengerCreateInfoEXT* from,
+                                                 VkDebugUtilsMessengerCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pUserData = nullptr;
+    if (from->pUserData) {
+        to->pUserData = (void*)alloc->dupArray(from->pUserData, sizeof(uint8_t));
+    }
+}
+
+void deepcopy_VkDebugUtilsObjectTagInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                           const VkDebugUtilsObjectTagInfoEXT* from,
+                                           VkDebugUtilsObjectTagInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pTag = nullptr;
+    if (from->pTag) {
+        to->pTag = (void*)alloc->dupArray(from->pTag, from->tagSize * sizeof(const uint8_t));
+    }
+}
+
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+void deepcopy_VkAndroidHardwareBufferUsageANDROID(Allocator* alloc, VkStructureType rootType,
+                                                  const VkAndroidHardwareBufferUsageANDROID* from,
+                                                  VkAndroidHardwareBufferUsageANDROID* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkAndroidHardwareBufferPropertiesANDROID(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAndroidHardwareBufferPropertiesANDROID* from,
+    VkAndroidHardwareBufferPropertiesANDROID* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkAndroidHardwareBufferFormatPropertiesANDROID(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAndroidHardwareBufferFormatPropertiesANDROID* from,
+    VkAndroidHardwareBufferFormatPropertiesANDROID* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkComponentMapping(alloc, rootType, &from->samplerYcbcrConversionComponents,
+                                (VkComponentMapping*)(&to->samplerYcbcrConversionComponents));
+}
+
+void deepcopy_VkImportAndroidHardwareBufferInfoANDROID(
+    Allocator* alloc, VkStructureType rootType,
+    const VkImportAndroidHardwareBufferInfoANDROID* from,
+    VkImportAndroidHardwareBufferInfoANDROID* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->buffer = nullptr;
+    if (from->buffer) {
+        to->buffer = (AHardwareBuffer*)alloc->dupArray(from->buffer, sizeof(AHardwareBuffer));
+    }
+}
+
+void deepcopy_VkMemoryGetAndroidHardwareBufferInfoANDROID(
+    Allocator* alloc, VkStructureType rootType,
+    const VkMemoryGetAndroidHardwareBufferInfoANDROID* from,
+    VkMemoryGetAndroidHardwareBufferInfoANDROID* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkExternalFormatANDROID(Allocator* alloc, VkStructureType rootType,
+                                      const VkExternalFormatANDROID* from,
+                                      VkExternalFormatANDROID* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkAndroidHardwareBufferFormatProperties2ANDROID(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAndroidHardwareBufferFormatProperties2ANDROID* from,
+    VkAndroidHardwareBufferFormatProperties2ANDROID* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkComponentMapping(alloc, rootType, &from->samplerYcbcrConversionComponents,
+                                (VkComponentMapping*)(&to->samplerYcbcrConversionComponents));
+}
+
+#endif
+#ifdef VK_EXT_sampler_filter_minmax
+#endif
+#ifdef VK_AMD_gpu_shader_int16
+#endif
+#ifdef VK_AMD_mixed_attachment_samples
+#endif
+#ifdef VK_AMD_shader_fragment_mask
+#endif
+#ifdef VK_EXT_inline_uniform_block
+void deepcopy_VkPhysicalDeviceInlineUniformBlockFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceInlineUniformBlockFeaturesEXT* from,
+    VkPhysicalDeviceInlineUniformBlockFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceInlineUniformBlockPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceInlineUniformBlockPropertiesEXT* from,
+    VkPhysicalDeviceInlineUniformBlockPropertiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkWriteDescriptorSetInlineUniformBlockEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkWriteDescriptorSetInlineUniformBlockEXT* from,
+    VkWriteDescriptorSetInlineUniformBlockEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pData = nullptr;
+    if (from->pData) {
+        to->pData = (void*)alloc->dupArray(from->pData, from->dataSize * sizeof(const uint8_t));
+    }
+}
+
+void deepcopy_VkDescriptorPoolInlineUniformBlockCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkDescriptorPoolInlineUniformBlockCreateInfoEXT* from,
+    VkDescriptorPoolInlineUniformBlockCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_shader_stencil_export
+#endif
+#ifdef VK_EXT_sample_locations
+void deepcopy_VkSampleLocationEXT(Allocator* alloc, VkStructureType rootType,
+                                  const VkSampleLocationEXT* from, VkSampleLocationEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkSampleLocationsInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                       const VkSampleLocationsInfoEXT* from,
+                                       VkSampleLocationsInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkExtent2D(alloc, rootType, &from->sampleLocationGridSize,
+                        (VkExtent2D*)(&to->sampleLocationGridSize));
+    if (from) {
+        to->pSampleLocations = nullptr;
+        if (from->pSampleLocations) {
+            to->pSampleLocations = (VkSampleLocationEXT*)alloc->alloc(
+                from->sampleLocationsCount * sizeof(const VkSampleLocationEXT));
+            to->sampleLocationsCount = from->sampleLocationsCount;
+            for (uint32_t i = 0; i < (uint32_t)from->sampleLocationsCount; ++i) {
+                deepcopy_VkSampleLocationEXT(alloc, rootType, from->pSampleLocations + i,
+                                             (VkSampleLocationEXT*)(to->pSampleLocations + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkAttachmentSampleLocationsEXT(Allocator* alloc, VkStructureType rootType,
+                                             const VkAttachmentSampleLocationsEXT* from,
+                                             VkAttachmentSampleLocationsEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkSampleLocationsInfoEXT(alloc, rootType, &from->sampleLocationsInfo,
+                                      (VkSampleLocationsInfoEXT*)(&to->sampleLocationsInfo));
+}
+
+void deepcopy_VkSubpassSampleLocationsEXT(Allocator* alloc, VkStructureType rootType,
+                                          const VkSubpassSampleLocationsEXT* from,
+                                          VkSubpassSampleLocationsEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkSampleLocationsInfoEXT(alloc, rootType, &from->sampleLocationsInfo,
+                                      (VkSampleLocationsInfoEXT*)(&to->sampleLocationsInfo));
+}
+
+void deepcopy_VkRenderPassSampleLocationsBeginInfoEXT(
+    Allocator* alloc, VkStructureType rootType, const VkRenderPassSampleLocationsBeginInfoEXT* from,
+    VkRenderPassSampleLocationsBeginInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pAttachmentInitialSampleLocations = nullptr;
+        if (from->pAttachmentInitialSampleLocations) {
+            to->pAttachmentInitialSampleLocations = (VkAttachmentSampleLocationsEXT*)alloc->alloc(
+                from->attachmentInitialSampleLocationsCount *
+                sizeof(const VkAttachmentSampleLocationsEXT));
+            to->attachmentInitialSampleLocationsCount = from->attachmentInitialSampleLocationsCount;
+            for (uint32_t i = 0; i < (uint32_t)from->attachmentInitialSampleLocationsCount; ++i) {
+                deepcopy_VkAttachmentSampleLocationsEXT(
+                    alloc, rootType, from->pAttachmentInitialSampleLocations + i,
+                    (VkAttachmentSampleLocationsEXT*)(to->pAttachmentInitialSampleLocations + i));
+            }
+        }
+    }
+    if (from) {
+        to->pPostSubpassSampleLocations = nullptr;
+        if (from->pPostSubpassSampleLocations) {
+            to->pPostSubpassSampleLocations = (VkSubpassSampleLocationsEXT*)alloc->alloc(
+                from->postSubpassSampleLocationsCount * sizeof(const VkSubpassSampleLocationsEXT));
+            to->postSubpassSampleLocationsCount = from->postSubpassSampleLocationsCount;
+            for (uint32_t i = 0; i < (uint32_t)from->postSubpassSampleLocationsCount; ++i) {
+                deepcopy_VkSubpassSampleLocationsEXT(
+                    alloc, rootType, from->pPostSubpassSampleLocations + i,
+                    (VkSubpassSampleLocationsEXT*)(to->pPostSubpassSampleLocations + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkPipelineSampleLocationsStateCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineSampleLocationsStateCreateInfoEXT* from,
+    VkPipelineSampleLocationsStateCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkSampleLocationsInfoEXT(alloc, rootType, &from->sampleLocationsInfo,
+                                      (VkSampleLocationsInfoEXT*)(&to->sampleLocationsInfo));
+}
+
+void deepcopy_VkPhysicalDeviceSampleLocationsPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceSampleLocationsPropertiesEXT* from,
+    VkPhysicalDeviceSampleLocationsPropertiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkExtent2D(alloc, rootType, &from->maxSampleLocationGridSize,
+                        (VkExtent2D*)(&to->maxSampleLocationGridSize));
+    memcpy(to->sampleLocationCoordinateRange, from->sampleLocationCoordinateRange,
+           2 * sizeof(float));
+}
+
+void deepcopy_VkMultisamplePropertiesEXT(Allocator* alloc, VkStructureType rootType,
+                                         const VkMultisamplePropertiesEXT* from,
+                                         VkMultisamplePropertiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkExtent2D(alloc, rootType, &from->maxSampleLocationGridSize,
+                        (VkExtent2D*)(&to->maxSampleLocationGridSize));
+}
+
+#endif
+#ifdef VK_EXT_blend_operation_advanced
+void deepcopy_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT* from,
+    VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT* from,
+    VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPipelineColorBlendAdvancedStateCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineColorBlendAdvancedStateCreateInfoEXT* from,
+    VkPipelineColorBlendAdvancedStateCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_fragment_coverage_to_color
+void deepcopy_VkPipelineCoverageToColorStateCreateInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineCoverageToColorStateCreateInfoNV* from,
+    VkPipelineCoverageToColorStateCreateInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_framebuffer_mixed_samples
+void deepcopy_VkPipelineCoverageModulationStateCreateInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineCoverageModulationStateCreateInfoNV* from,
+    VkPipelineCoverageModulationStateCreateInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pCoverageModulationTable = nullptr;
+    if (from->pCoverageModulationTable) {
+        to->pCoverageModulationTable =
+            (float*)alloc->dupArray(from->pCoverageModulationTable,
+                                    from->coverageModulationTableCount * sizeof(const float));
+    }
+}
+
+#endif
+#ifdef VK_NV_fill_rectangle
+#endif
+#ifdef VK_NV_shader_sm_builtins
+void deepcopy_VkPhysicalDeviceShaderSMBuiltinsPropertiesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSMBuiltinsPropertiesNV* from,
+    VkPhysicalDeviceShaderSMBuiltinsPropertiesNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceShaderSMBuiltinsFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSMBuiltinsFeaturesNV* from,
+    VkPhysicalDeviceShaderSMBuiltinsFeaturesNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_post_depth_coverage
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+void deepcopy_VkDrmFormatModifierPropertiesEXT(Allocator* alloc, VkStructureType rootType,
+                                               const VkDrmFormatModifierPropertiesEXT* from,
+                                               VkDrmFormatModifierPropertiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkDrmFormatModifierPropertiesListEXT(Allocator* alloc, VkStructureType rootType,
+                                                   const VkDrmFormatModifierPropertiesListEXT* from,
+                                                   VkDrmFormatModifierPropertiesListEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pDrmFormatModifierProperties = nullptr;
+        if (from->pDrmFormatModifierProperties) {
+            to->pDrmFormatModifierProperties = (VkDrmFormatModifierPropertiesEXT*)alloc->alloc(
+                from->drmFormatModifierCount * sizeof(VkDrmFormatModifierPropertiesEXT));
+            to->drmFormatModifierCount = from->drmFormatModifierCount;
+            for (uint32_t i = 0; i < (uint32_t)from->drmFormatModifierCount; ++i) {
+                deepcopy_VkDrmFormatModifierPropertiesEXT(
+                    alloc, rootType, from->pDrmFormatModifierProperties + i,
+                    (VkDrmFormatModifierPropertiesEXT*)(to->pDrmFormatModifierProperties + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkPhysicalDeviceImageDrmFormatModifierInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceImageDrmFormatModifierInfoEXT* from,
+    VkPhysicalDeviceImageDrmFormatModifierInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pQueueFamilyIndices = nullptr;
+    if (from->pQueueFamilyIndices) {
+        to->pQueueFamilyIndices = (uint32_t*)alloc->dupArray(
+            from->pQueueFamilyIndices, from->queueFamilyIndexCount * sizeof(const uint32_t));
+    }
+}
+
+void deepcopy_VkImageDrmFormatModifierListCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkImageDrmFormatModifierListCreateInfoEXT* from,
+    VkImageDrmFormatModifierListCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pDrmFormatModifiers = nullptr;
+    if (from->pDrmFormatModifiers) {
+        to->pDrmFormatModifiers = (uint64_t*)alloc->dupArray(
+            from->pDrmFormatModifiers, from->drmFormatModifierCount * sizeof(const uint64_t));
+    }
+}
+
+void deepcopy_VkImageDrmFormatModifierExplicitCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkImageDrmFormatModifierExplicitCreateInfoEXT* from,
+    VkImageDrmFormatModifierExplicitCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pPlaneLayouts = nullptr;
+        if (from->pPlaneLayouts) {
+            to->pPlaneLayouts = (VkSubresourceLayout*)alloc->alloc(
+                from->drmFormatModifierPlaneCount * sizeof(const VkSubresourceLayout));
+            to->drmFormatModifierPlaneCount = from->drmFormatModifierPlaneCount;
+            for (uint32_t i = 0; i < (uint32_t)from->drmFormatModifierPlaneCount; ++i) {
+                deepcopy_VkSubresourceLayout(alloc, rootType, from->pPlaneLayouts + i,
+                                             (VkSubresourceLayout*)(to->pPlaneLayouts + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkImageDrmFormatModifierPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType, const VkImageDrmFormatModifierPropertiesEXT* from,
+    VkImageDrmFormatModifierPropertiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkDrmFormatModifierProperties2EXT(Allocator* alloc, VkStructureType rootType,
+                                                const VkDrmFormatModifierProperties2EXT* from,
+                                                VkDrmFormatModifierProperties2EXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkDrmFormatModifierPropertiesList2EXT(
+    Allocator* alloc, VkStructureType rootType, const VkDrmFormatModifierPropertiesList2EXT* from,
+    VkDrmFormatModifierPropertiesList2EXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pDrmFormatModifierProperties = nullptr;
+        if (from->pDrmFormatModifierProperties) {
+            to->pDrmFormatModifierProperties = (VkDrmFormatModifierProperties2EXT*)alloc->alloc(
+                from->drmFormatModifierCount * sizeof(VkDrmFormatModifierProperties2EXT));
+            to->drmFormatModifierCount = from->drmFormatModifierCount;
+            for (uint32_t i = 0; i < (uint32_t)from->drmFormatModifierCount; ++i) {
+                deepcopy_VkDrmFormatModifierProperties2EXT(
+                    alloc, rootType, from->pDrmFormatModifierProperties + i,
+                    (VkDrmFormatModifierProperties2EXT*)(to->pDrmFormatModifierProperties + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_EXT_validation_cache
+void deepcopy_VkValidationCacheCreateInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                             const VkValidationCacheCreateInfoEXT* from,
+                                             VkValidationCacheCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pInitialData = nullptr;
+    if (from->pInitialData) {
+        to->pInitialData = (void*)alloc->dupArray(from->pInitialData,
+                                                  from->initialDataSize * sizeof(const uint8_t));
+    }
+}
+
+void deepcopy_VkShaderModuleValidationCacheCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkShaderModuleValidationCacheCreateInfoEXT* from,
+    VkShaderModuleValidationCacheCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_descriptor_indexing
+#endif
+#ifdef VK_EXT_shader_viewport_index_layer
+#endif
+#ifdef VK_NV_shading_rate_image
+void deepcopy_VkShadingRatePaletteNV(Allocator* alloc, VkStructureType rootType,
+                                     const VkShadingRatePaletteNV* from,
+                                     VkShadingRatePaletteNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    to->pShadingRatePaletteEntries = nullptr;
+    if (from->pShadingRatePaletteEntries) {
+        to->pShadingRatePaletteEntries = (VkShadingRatePaletteEntryNV*)alloc->dupArray(
+            from->pShadingRatePaletteEntries,
+            from->shadingRatePaletteEntryCount * sizeof(const VkShadingRatePaletteEntryNV));
+    }
+}
+
+void deepcopy_VkPipelineViewportShadingRateImageStateCreateInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineViewportShadingRateImageStateCreateInfoNV* from,
+    VkPipelineViewportShadingRateImageStateCreateInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pShadingRatePalettes = nullptr;
+        if (from->pShadingRatePalettes) {
+            to->pShadingRatePalettes = (VkShadingRatePaletteNV*)alloc->alloc(
+                from->viewportCount * sizeof(const VkShadingRatePaletteNV));
+            to->viewportCount = from->viewportCount;
+            for (uint32_t i = 0; i < (uint32_t)from->viewportCount; ++i) {
+                deepcopy_VkShadingRatePaletteNV(
+                    alloc, rootType, from->pShadingRatePalettes + i,
+                    (VkShadingRatePaletteNV*)(to->pShadingRatePalettes + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkPhysicalDeviceShadingRateImageFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShadingRateImageFeaturesNV* from,
+    VkPhysicalDeviceShadingRateImageFeaturesNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceShadingRateImagePropertiesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShadingRateImagePropertiesNV* from,
+    VkPhysicalDeviceShadingRateImagePropertiesNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkExtent2D(alloc, rootType, &from->shadingRateTexelSize,
+                        (VkExtent2D*)(&to->shadingRateTexelSize));
+}
+
+void deepcopy_VkCoarseSampleLocationNV(Allocator* alloc, VkStructureType rootType,
+                                       const VkCoarseSampleLocationNV* from,
+                                       VkCoarseSampleLocationNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkCoarseSampleOrderCustomNV(Allocator* alloc, VkStructureType rootType,
+                                          const VkCoarseSampleOrderCustomNV* from,
+                                          VkCoarseSampleOrderCustomNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (from) {
+        to->pSampleLocations = nullptr;
+        if (from->pSampleLocations) {
+            to->pSampleLocations = (VkCoarseSampleLocationNV*)alloc->alloc(
+                from->sampleLocationCount * sizeof(const VkCoarseSampleLocationNV));
+            to->sampleLocationCount = from->sampleLocationCount;
+            for (uint32_t i = 0; i < (uint32_t)from->sampleLocationCount; ++i) {
+                deepcopy_VkCoarseSampleLocationNV(
+                    alloc, rootType, from->pSampleLocations + i,
+                    (VkCoarseSampleLocationNV*)(to->pSampleLocations + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkPipelineViewportCoarseSampleOrderStateCreateInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineViewportCoarseSampleOrderStateCreateInfoNV* from,
+    VkPipelineViewportCoarseSampleOrderStateCreateInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pCustomSampleOrders = nullptr;
+        if (from->pCustomSampleOrders) {
+            to->pCustomSampleOrders = (VkCoarseSampleOrderCustomNV*)alloc->alloc(
+                from->customSampleOrderCount * sizeof(const VkCoarseSampleOrderCustomNV));
+            to->customSampleOrderCount = from->customSampleOrderCount;
+            for (uint32_t i = 0; i < (uint32_t)from->customSampleOrderCount; ++i) {
+                deepcopy_VkCoarseSampleOrderCustomNV(
+                    alloc, rootType, from->pCustomSampleOrders + i,
+                    (VkCoarseSampleOrderCustomNV*)(to->pCustomSampleOrders + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_NV_ray_tracing
+void deepcopy_VkRayTracingShaderGroupCreateInfoNV(Allocator* alloc, VkStructureType rootType,
+                                                  const VkRayTracingShaderGroupCreateInfoNV* from,
+                                                  VkRayTracingShaderGroupCreateInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkRayTracingPipelineCreateInfoNV(Allocator* alloc, VkStructureType rootType,
+                                               const VkRayTracingPipelineCreateInfoNV* from,
+                                               VkRayTracingPipelineCreateInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pStages = nullptr;
+        if (from->pStages) {
+            to->pStages = (VkPipelineShaderStageCreateInfo*)alloc->alloc(
+                from->stageCount * sizeof(const VkPipelineShaderStageCreateInfo));
+            to->stageCount = from->stageCount;
+            for (uint32_t i = 0; i < (uint32_t)from->stageCount; ++i) {
+                deepcopy_VkPipelineShaderStageCreateInfo(
+                    alloc, rootType, from->pStages + i,
+                    (VkPipelineShaderStageCreateInfo*)(to->pStages + i));
+            }
+        }
+    }
+    if (from) {
+        to->pGroups = nullptr;
+        if (from->pGroups) {
+            to->pGroups = (VkRayTracingShaderGroupCreateInfoNV*)alloc->alloc(
+                from->groupCount * sizeof(const VkRayTracingShaderGroupCreateInfoNV));
+            to->groupCount = from->groupCount;
+            for (uint32_t i = 0; i < (uint32_t)from->groupCount; ++i) {
+                deepcopy_VkRayTracingShaderGroupCreateInfoNV(
+                    alloc, rootType, from->pGroups + i,
+                    (VkRayTracingShaderGroupCreateInfoNV*)(to->pGroups + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkGeometryTrianglesNV(Allocator* alloc, VkStructureType rootType,
+                                    const VkGeometryTrianglesNV* from, VkGeometryTrianglesNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkGeometryAABBNV(Allocator* alloc, VkStructureType rootType,
+                               const VkGeometryAABBNV* from, VkGeometryAABBNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkGeometryDataNV(Allocator* alloc, VkStructureType rootType,
+                               const VkGeometryDataNV* from, VkGeometryDataNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkGeometryTrianglesNV(alloc, rootType, &from->triangles,
+                                   (VkGeometryTrianglesNV*)(&to->triangles));
+    deepcopy_VkGeometryAABBNV(alloc, rootType, &from->aabbs, (VkGeometryAABBNV*)(&to->aabbs));
+}
+
+void deepcopy_VkGeometryNV(Allocator* alloc, VkStructureType rootType, const VkGeometryNV* from,
+                           VkGeometryNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkGeometryDataNV(alloc, rootType, &from->geometry, (VkGeometryDataNV*)(&to->geometry));
+}
+
+void deepcopy_VkAccelerationStructureInfoNV(Allocator* alloc, VkStructureType rootType,
+                                            const VkAccelerationStructureInfoNV* from,
+                                            VkAccelerationStructureInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pGeometries = nullptr;
+        if (from->pGeometries) {
+            to->pGeometries =
+                (VkGeometryNV*)alloc->alloc(from->geometryCount * sizeof(const VkGeometryNV));
+            to->geometryCount = from->geometryCount;
+            for (uint32_t i = 0; i < (uint32_t)from->geometryCount; ++i) {
+                deepcopy_VkGeometryNV(alloc, rootType, from->pGeometries + i,
+                                      (VkGeometryNV*)(to->pGeometries + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkAccelerationStructureCreateInfoNV(Allocator* alloc, VkStructureType rootType,
+                                                  const VkAccelerationStructureCreateInfoNV* from,
+                                                  VkAccelerationStructureCreateInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkAccelerationStructureInfoNV(alloc, rootType, &from->info,
+                                           (VkAccelerationStructureInfoNV*)(&to->info));
+}
+
+void deepcopy_VkBindAccelerationStructureMemoryInfoNV(
+    Allocator* alloc, VkStructureType rootType, const VkBindAccelerationStructureMemoryInfoNV* from,
+    VkBindAccelerationStructureMemoryInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pDeviceIndices = nullptr;
+    if (from->pDeviceIndices) {
+        to->pDeviceIndices = (uint32_t*)alloc->dupArray(
+            from->pDeviceIndices, from->deviceIndexCount * sizeof(const uint32_t));
+    }
+}
+
+void deepcopy_VkWriteDescriptorSetAccelerationStructureNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkWriteDescriptorSetAccelerationStructureNV* from,
+    VkWriteDescriptorSetAccelerationStructureNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pAccelerationStructures = nullptr;
+    if (from->pAccelerationStructures) {
+        to->pAccelerationStructures = (VkAccelerationStructureNV*)alloc->dupArray(
+            from->pAccelerationStructures,
+            from->accelerationStructureCount * sizeof(const VkAccelerationStructureNV));
+    }
+}
+
+void deepcopy_VkAccelerationStructureMemoryRequirementsInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAccelerationStructureMemoryRequirementsInfoNV* from,
+    VkAccelerationStructureMemoryRequirementsInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceRayTracingPropertiesNV(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceRayTracingPropertiesNV* from,
+    VkPhysicalDeviceRayTracingPropertiesNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkTransformMatrixKHR(Allocator* alloc, VkStructureType rootType,
+                                   const VkTransformMatrixKHR* from, VkTransformMatrixKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    memcpy(to->matrix, from->matrix, ((3) * (4)) * sizeof(float));
+}
+
+void deepcopy_VkAabbPositionsKHR(Allocator* alloc, VkStructureType rootType,
+                                 const VkAabbPositionsKHR* from, VkAabbPositionsKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkAccelerationStructureInstanceKHR(Allocator* alloc, VkStructureType rootType,
+                                                 const VkAccelerationStructureInstanceKHR* from,
+                                                 VkAccelerationStructureInstanceKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkTransformMatrixKHR(alloc, rootType, &from->transform,
+                                  (VkTransformMatrixKHR*)(&to->transform));
+}
+
+#endif
+#ifdef VK_NV_representative_fragment_test
+void deepcopy_VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV* from,
+    VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPipelineRepresentativeFragmentTestStateCreateInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineRepresentativeFragmentTestStateCreateInfoNV* from,
+    VkPipelineRepresentativeFragmentTestStateCreateInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_filter_cubic
+void deepcopy_VkPhysicalDeviceImageViewImageFormatInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceImageViewImageFormatInfoEXT* from,
+    VkPhysicalDeviceImageViewImageFormatInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkFilterCubicImageViewImageFormatPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkFilterCubicImageViewImageFormatPropertiesEXT* from,
+    VkFilterCubicImageViewImageFormatPropertiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_QCOM_render_pass_shader_resolve
+#endif
+#ifdef VK_EXT_global_priority
+void deepcopy_VkDeviceQueueGlobalPriorityCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkDeviceQueueGlobalPriorityCreateInfoEXT* from,
+    VkDeviceQueueGlobalPriorityCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_external_memory_host
+void deepcopy_VkImportMemoryHostPointerInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                               const VkImportMemoryHostPointerInfoEXT* from,
+                                               VkImportMemoryHostPointerInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pHostPointer = nullptr;
+    if (from->pHostPointer) {
+        to->pHostPointer = (void*)alloc->dupArray(from->pHostPointer, sizeof(uint8_t));
+    }
+}
+
+void deepcopy_VkMemoryHostPointerPropertiesEXT(Allocator* alloc, VkStructureType rootType,
+                                               const VkMemoryHostPointerPropertiesEXT* from,
+                                               VkMemoryHostPointerPropertiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceExternalMemoryHostPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceExternalMemoryHostPropertiesEXT* from,
+    VkPhysicalDeviceExternalMemoryHostPropertiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_buffer_marker
+#endif
+#ifdef VK_AMD_pipeline_compiler_control
+void deepcopy_VkPipelineCompilerControlCreateInfoAMD(
+    Allocator* alloc, VkStructureType rootType, const VkPipelineCompilerControlCreateInfoAMD* from,
+    VkPipelineCompilerControlCreateInfoAMD* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_calibrated_timestamps
+void deepcopy_VkCalibratedTimestampInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                           const VkCalibratedTimestampInfoEXT* from,
+                                           VkCalibratedTimestampInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_shader_core_properties
+void deepcopy_VkPhysicalDeviceShaderCorePropertiesAMD(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceShaderCorePropertiesAMD* from,
+    VkPhysicalDeviceShaderCorePropertiesAMD* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_video_decode_h265
+void deepcopy_VkVideoDecodeH265ProfileEXT(Allocator* alloc, VkStructureType rootType,
+                                          const VkVideoDecodeH265ProfileEXT* from,
+                                          VkVideoDecodeH265ProfileEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkVideoDecodeH265CapabilitiesEXT(Allocator* alloc, VkStructureType rootType,
+                                               const VkVideoDecodeH265CapabilitiesEXT* from,
+                                               VkVideoDecodeH265CapabilitiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkExtensionProperties(alloc, rootType, &from->stdExtensionVersion,
+                                   (VkExtensionProperties*)(&to->stdExtensionVersion));
+}
+
+void deepcopy_VkVideoDecodeH265SessionCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType, const VkVideoDecodeH265SessionCreateInfoEXT* from,
+    VkVideoDecodeH265SessionCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pStdExtensionVersion = nullptr;
+    if (from->pStdExtensionVersion) {
+        to->pStdExtensionVersion =
+            (VkExtensionProperties*)alloc->alloc(sizeof(const VkExtensionProperties));
+        deepcopy_VkExtensionProperties(alloc, rootType, from->pStdExtensionVersion,
+                                       (VkExtensionProperties*)(to->pStdExtensionVersion));
+    }
+}
+
+void deepcopy_VkVideoDecodeH265SessionParametersAddInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkVideoDecodeH265SessionParametersAddInfoEXT* from,
+    VkVideoDecodeH265SessionParametersAddInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pSpsStd = nullptr;
+    if (from->pSpsStd) {
+        to->pSpsStd = (StdVideoH265SequenceParameterSet*)alloc->dupArray(
+            from->pSpsStd, from->spsStdCount * sizeof(const StdVideoH265SequenceParameterSet));
+    }
+    to->pPpsStd = nullptr;
+    if (from->pPpsStd) {
+        to->pPpsStd = (StdVideoH265PictureParameterSet*)alloc->dupArray(
+            from->pPpsStd, from->ppsStdCount * sizeof(const StdVideoH265PictureParameterSet));
+    }
+}
+
+void deepcopy_VkVideoDecodeH265SessionParametersCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkVideoDecodeH265SessionParametersCreateInfoEXT* from,
+    VkVideoDecodeH265SessionParametersCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pParametersAddInfo = nullptr;
+    if (from->pParametersAddInfo) {
+        to->pParametersAddInfo = (VkVideoDecodeH265SessionParametersAddInfoEXT*)alloc->alloc(
+            sizeof(const VkVideoDecodeH265SessionParametersAddInfoEXT));
+        deepcopy_VkVideoDecodeH265SessionParametersAddInfoEXT(
+            alloc, rootType, from->pParametersAddInfo,
+            (VkVideoDecodeH265SessionParametersAddInfoEXT*)(to->pParametersAddInfo));
+    }
+}
+
+void deepcopy_VkVideoDecodeH265PictureInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                              const VkVideoDecodeH265PictureInfoEXT* from,
+                                              VkVideoDecodeH265PictureInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pStdPictureInfo = nullptr;
+    if (from->pStdPictureInfo) {
+        to->pStdPictureInfo = (StdVideoDecodeH265PictureInfo*)alloc->dupArray(
+            from->pStdPictureInfo, sizeof(StdVideoDecodeH265PictureInfo));
+    }
+    to->pSlicesDataOffsets = nullptr;
+    if (from->pSlicesDataOffsets) {
+        to->pSlicesDataOffsets = (uint32_t*)alloc->dupArray(
+            from->pSlicesDataOffsets, from->slicesCount * sizeof(const uint32_t));
+    }
+}
+
+void deepcopy_VkVideoDecodeH265DpbSlotInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                              const VkVideoDecodeH265DpbSlotInfoEXT* from,
+                                              VkVideoDecodeH265DpbSlotInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pStdReferenceInfo = nullptr;
+    if (from->pStdReferenceInfo) {
+        to->pStdReferenceInfo = (StdVideoDecodeH265ReferenceInfo*)alloc->dupArray(
+            from->pStdReferenceInfo, sizeof(const StdVideoDecodeH265ReferenceInfo));
+    }
+}
+
+#endif
+#ifdef VK_AMD_memory_overallocation_behavior
+void deepcopy_VkDeviceMemoryOverallocationCreateInfoAMD(
+    Allocator* alloc, VkStructureType rootType,
+    const VkDeviceMemoryOverallocationCreateInfoAMD* from,
+    VkDeviceMemoryOverallocationCreateInfoAMD* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_vertex_attribute_divisor
+void deepcopy_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT* from,
+    VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkVertexInputBindingDivisorDescriptionEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkVertexInputBindingDivisorDescriptionEXT* from,
+    VkVertexInputBindingDivisorDescriptionEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkPipelineVertexInputDivisorStateCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineVertexInputDivisorStateCreateInfoEXT* from,
+    VkPipelineVertexInputDivisorStateCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pVertexBindingDivisors = nullptr;
+        if (from->pVertexBindingDivisors) {
+            to->pVertexBindingDivisors = (VkVertexInputBindingDivisorDescriptionEXT*)alloc->alloc(
+                from->vertexBindingDivisorCount *
+                sizeof(const VkVertexInputBindingDivisorDescriptionEXT));
+            to->vertexBindingDivisorCount = from->vertexBindingDivisorCount;
+            for (uint32_t i = 0; i < (uint32_t)from->vertexBindingDivisorCount; ++i) {
+                deepcopy_VkVertexInputBindingDivisorDescriptionEXT(
+                    alloc, rootType, from->pVertexBindingDivisors + i,
+                    (VkVertexInputBindingDivisorDescriptionEXT*)(to->pVertexBindingDivisors + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT* from,
+    VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_GGP_frame_token
+void deepcopy_VkPresentFrameTokenGGP(Allocator* alloc, VkStructureType rootType,
+                                     const VkPresentFrameTokenGGP* from,
+                                     VkPresentFrameTokenGGP* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_pipeline_creation_feedback
+void deepcopy_VkPipelineCreationFeedbackEXT(Allocator* alloc, VkStructureType rootType,
+                                            const VkPipelineCreationFeedbackEXT* from,
+                                            VkPipelineCreationFeedbackEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkPipelineCreationFeedbackCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType, const VkPipelineCreationFeedbackCreateInfoEXT* from,
+    VkPipelineCreationFeedbackCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pPipelineCreationFeedback = nullptr;
+    if (from->pPipelineCreationFeedback) {
+        to->pPipelineCreationFeedback =
+            (VkPipelineCreationFeedbackEXT*)alloc->alloc(sizeof(VkPipelineCreationFeedbackEXT));
+        deepcopy_VkPipelineCreationFeedbackEXT(
+            alloc, rootType, from->pPipelineCreationFeedback,
+            (VkPipelineCreationFeedbackEXT*)(to->pPipelineCreationFeedback));
+    }
+    if (from) {
+        to->pPipelineStageCreationFeedbacks = nullptr;
+        if (from->pPipelineStageCreationFeedbacks) {
+            to->pPipelineStageCreationFeedbacks = (VkPipelineCreationFeedbackEXT*)alloc->alloc(
+                from->pipelineStageCreationFeedbackCount * sizeof(VkPipelineCreationFeedbackEXT));
+            to->pipelineStageCreationFeedbackCount = from->pipelineStageCreationFeedbackCount;
+            for (uint32_t i = 0; i < (uint32_t)from->pipelineStageCreationFeedbackCount; ++i) {
+                deepcopy_VkPipelineCreationFeedbackEXT(
+                    alloc, rootType, from->pPipelineStageCreationFeedbacks + i,
+                    (VkPipelineCreationFeedbackEXT*)(to->pPipelineStageCreationFeedbacks + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_NV_shader_subgroup_partitioned
+#endif
+#ifdef VK_NV_compute_shader_derivatives
+void deepcopy_VkPhysicalDeviceComputeShaderDerivativesFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceComputeShaderDerivativesFeaturesNV* from,
+    VkPhysicalDeviceComputeShaderDerivativesFeaturesNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_mesh_shader
+void deepcopy_VkPhysicalDeviceMeshShaderFeaturesNV(Allocator* alloc, VkStructureType rootType,
+                                                   const VkPhysicalDeviceMeshShaderFeaturesNV* from,
+                                                   VkPhysicalDeviceMeshShaderFeaturesNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceMeshShaderPropertiesNV(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceMeshShaderPropertiesNV* from,
+    VkPhysicalDeviceMeshShaderPropertiesNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    memcpy(to->maxTaskWorkGroupSize, from->maxTaskWorkGroupSize, 3 * sizeof(uint32_t));
+    memcpy(to->maxMeshWorkGroupSize, from->maxMeshWorkGroupSize, 3 * sizeof(uint32_t));
+}
+
+void deepcopy_VkDrawMeshTasksIndirectCommandNV(Allocator* alloc, VkStructureType rootType,
+                                               const VkDrawMeshTasksIndirectCommandNV* from,
+                                               VkDrawMeshTasksIndirectCommandNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+#endif
+#ifdef VK_NV_fragment_shader_barycentric
+void deepcopy_VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV* from,
+    VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_shader_image_footprint
+void deepcopy_VkPhysicalDeviceShaderImageFootprintFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderImageFootprintFeaturesNV* from,
+    VkPhysicalDeviceShaderImageFootprintFeaturesNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_scissor_exclusive
+void deepcopy_VkPipelineViewportExclusiveScissorStateCreateInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineViewportExclusiveScissorStateCreateInfoNV* from,
+    VkPipelineViewportExclusiveScissorStateCreateInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pExclusiveScissors = nullptr;
+        if (from->pExclusiveScissors) {
+            to->pExclusiveScissors =
+                (VkRect2D*)alloc->alloc(from->exclusiveScissorCount * sizeof(const VkRect2D));
+            to->exclusiveScissorCount = from->exclusiveScissorCount;
+            for (uint32_t i = 0; i < (uint32_t)from->exclusiveScissorCount; ++i) {
+                deepcopy_VkRect2D(alloc, rootType, from->pExclusiveScissors + i,
+                                  (VkRect2D*)(to->pExclusiveScissors + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkPhysicalDeviceExclusiveScissorFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceExclusiveScissorFeaturesNV* from,
+    VkPhysicalDeviceExclusiveScissorFeaturesNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+void deepcopy_VkQueueFamilyCheckpointPropertiesNV(Allocator* alloc, VkStructureType rootType,
+                                                  const VkQueueFamilyCheckpointPropertiesNV* from,
+                                                  VkQueueFamilyCheckpointPropertiesNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkCheckpointDataNV(Allocator* alloc, VkStructureType rootType,
+                                 const VkCheckpointDataNV* from, VkCheckpointDataNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pCheckpointMarker = nullptr;
+    if (from->pCheckpointMarker) {
+        to->pCheckpointMarker = (void*)alloc->dupArray(from->pCheckpointMarker, sizeof(uint8_t));
+    }
+}
+
+#endif
+#ifdef VK_INTEL_shader_integer_functions2
+void deepcopy_VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL* from,
+    VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_INTEL_performance_query
+void deepcopy_VkPerformanceValueDataINTEL(Allocator* alloc, VkStructureType rootType,
+                                          const VkPerformanceValueDataINTEL* from,
+                                          VkPerformanceValueDataINTEL* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    to->valueString = nullptr;
+    if (from->valueString) {
+        to->valueString = alloc->strDup(from->valueString);
+    }
+}
+
+void deepcopy_VkPerformanceValueINTEL(Allocator* alloc, VkStructureType rootType,
+                                      const VkPerformanceValueINTEL* from,
+                                      VkPerformanceValueINTEL* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkPerformanceValueDataINTEL(alloc, rootType, &from->data,
+                                         (VkPerformanceValueDataINTEL*)(&to->data));
+}
+
+void deepcopy_VkInitializePerformanceApiInfoINTEL(Allocator* alloc, VkStructureType rootType,
+                                                  const VkInitializePerformanceApiInfoINTEL* from,
+                                                  VkInitializePerformanceApiInfoINTEL* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pUserData = nullptr;
+    if (from->pUserData) {
+        to->pUserData = (void*)alloc->dupArray(from->pUserData, sizeof(uint8_t));
+    }
+}
+
+void deepcopy_VkQueryPoolPerformanceQueryCreateInfoINTEL(
+    Allocator* alloc, VkStructureType rootType,
+    const VkQueryPoolPerformanceQueryCreateInfoINTEL* from,
+    VkQueryPoolPerformanceQueryCreateInfoINTEL* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPerformanceMarkerInfoINTEL(Allocator* alloc, VkStructureType rootType,
+                                           const VkPerformanceMarkerInfoINTEL* from,
+                                           VkPerformanceMarkerInfoINTEL* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPerformanceStreamMarkerInfoINTEL(Allocator* alloc, VkStructureType rootType,
+                                                 const VkPerformanceStreamMarkerInfoINTEL* from,
+                                                 VkPerformanceStreamMarkerInfoINTEL* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPerformanceOverrideInfoINTEL(Allocator* alloc, VkStructureType rootType,
+                                             const VkPerformanceOverrideInfoINTEL* from,
+                                             VkPerformanceOverrideInfoINTEL* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPerformanceConfigurationAcquireInfoINTEL(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPerformanceConfigurationAcquireInfoINTEL* from,
+    VkPerformanceConfigurationAcquireInfoINTEL* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_pci_bus_info
+void deepcopy_VkPhysicalDevicePCIBusInfoPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDevicePCIBusInfoPropertiesEXT* from,
+    VkPhysicalDevicePCIBusInfoPropertiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_display_native_hdr
+void deepcopy_VkDisplayNativeHdrSurfaceCapabilitiesAMD(
+    Allocator* alloc, VkStructureType rootType,
+    const VkDisplayNativeHdrSurfaceCapabilitiesAMD* from,
+    VkDisplayNativeHdrSurfaceCapabilitiesAMD* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkSwapchainDisplayNativeHdrCreateInfoAMD(
+    Allocator* alloc, VkStructureType rootType,
+    const VkSwapchainDisplayNativeHdrCreateInfoAMD* from,
+    VkSwapchainDisplayNativeHdrCreateInfoAMD* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_FUCHSIA_imagepipe_surface
+void deepcopy_VkImagePipeSurfaceCreateInfoFUCHSIA(Allocator* alloc, VkStructureType rootType,
+                                                  const VkImagePipeSurfaceCreateInfoFUCHSIA* from,
+                                                  VkImagePipeSurfaceCreateInfoFUCHSIA* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_metal_surface
+void deepcopy_VkMetalSurfaceCreateInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                          const VkMetalSurfaceCreateInfoEXT* from,
+                                          VkMetalSurfaceCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pLayer = nullptr;
+    if (from->pLayer) {
+        to->pLayer = (CAMetalLayer*)alloc->dupArray(from->pLayer, sizeof(const CAMetalLayer));
+    }
+}
+
+#endif
+#ifdef VK_EXT_fragment_density_map
+void deepcopy_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMapFeaturesEXT* from,
+    VkPhysicalDeviceFragmentDensityMapFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMapPropertiesEXT* from,
+    VkPhysicalDeviceFragmentDensityMapPropertiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkExtent2D(alloc, rootType, &from->minFragmentDensityTexelSize,
+                        (VkExtent2D*)(&to->minFragmentDensityTexelSize));
+    deepcopy_VkExtent2D(alloc, rootType, &from->maxFragmentDensityTexelSize,
+                        (VkExtent2D*)(&to->maxFragmentDensityTexelSize));
+}
+
+void deepcopy_VkRenderPassFragmentDensityMapCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkRenderPassFragmentDensityMapCreateInfoEXT* from,
+    VkRenderPassFragmentDensityMapCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkAttachmentReference(alloc, rootType, &from->fragmentDensityMapAttachment,
+                                   (VkAttachmentReference*)(&to->fragmentDensityMapAttachment));
+}
+
+#endif
+#ifdef VK_EXT_scalar_block_layout
+#endif
+#ifdef VK_GOOGLE_hlsl_functionality1
+#endif
+#ifdef VK_GOOGLE_decorate_string
+#endif
+#ifdef VK_EXT_subgroup_size_control
+void deepcopy_VkPhysicalDeviceSubgroupSizeControlFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceSubgroupSizeControlFeaturesEXT* from,
+    VkPhysicalDeviceSubgroupSizeControlFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceSubgroupSizeControlPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceSubgroupSizeControlPropertiesEXT* from,
+    VkPhysicalDeviceSubgroupSizeControlPropertiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT* from,
+    VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_shader_core_properties2
+void deepcopy_VkPhysicalDeviceShaderCoreProperties2AMD(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderCoreProperties2AMD* from,
+    VkPhysicalDeviceShaderCoreProperties2AMD* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_device_coherent_memory
+void deepcopy_VkPhysicalDeviceCoherentMemoryFeaturesAMD(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceCoherentMemoryFeaturesAMD* from,
+    VkPhysicalDeviceCoherentMemoryFeaturesAMD* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_shader_image_atomic_int64
+void deepcopy_VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT* from,
+    VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_memory_budget
+void deepcopy_VkPhysicalDeviceMemoryBudgetPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceMemoryBudgetPropertiesEXT* from,
+    VkPhysicalDeviceMemoryBudgetPropertiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    memcpy(to->heapBudget, from->heapBudget, VK_MAX_MEMORY_HEAPS * sizeof(VkDeviceSize));
+    memcpy(to->heapUsage, from->heapUsage, VK_MAX_MEMORY_HEAPS * sizeof(VkDeviceSize));
+}
+
+#endif
+#ifdef VK_EXT_memory_priority
+void deepcopy_VkPhysicalDeviceMemoryPriorityFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceMemoryPriorityFeaturesEXT* from,
+    VkPhysicalDeviceMemoryPriorityFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkMemoryPriorityAllocateInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                              const VkMemoryPriorityAllocateInfoEXT* from,
+                                              VkMemoryPriorityAllocateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_dedicated_allocation_image_aliasing
+void deepcopy_VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV* from,
+    VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_buffer_device_address
+void deepcopy_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT* from,
+    VkPhysicalDeviceBufferDeviceAddressFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkBufferDeviceAddressCreateInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                                 const VkBufferDeviceAddressCreateInfoEXT* from,
+                                                 VkBufferDeviceAddressCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_tooling_info
+void deepcopy_VkPhysicalDeviceToolPropertiesEXT(Allocator* alloc, VkStructureType rootType,
+                                                const VkPhysicalDeviceToolPropertiesEXT* from,
+                                                VkPhysicalDeviceToolPropertiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    memcpy(to->name, from->name, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
+    memcpy(to->version, from->version, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
+    memcpy(to->description, from->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    memcpy(to->layer, from->layer, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
+}
+
+#endif
+#ifdef VK_EXT_separate_stencil_usage
+#endif
+#ifdef VK_EXT_validation_features
+void deepcopy_VkValidationFeaturesEXT(Allocator* alloc, VkStructureType rootType,
+                                      const VkValidationFeaturesEXT* from,
+                                      VkValidationFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pEnabledValidationFeatures = nullptr;
+    if (from->pEnabledValidationFeatures) {
+        to->pEnabledValidationFeatures = (VkValidationFeatureEnableEXT*)alloc->dupArray(
+            from->pEnabledValidationFeatures,
+            from->enabledValidationFeatureCount * sizeof(const VkValidationFeatureEnableEXT));
+    }
+    to->pDisabledValidationFeatures = nullptr;
+    if (from->pDisabledValidationFeatures) {
+        to->pDisabledValidationFeatures = (VkValidationFeatureDisableEXT*)alloc->dupArray(
+            from->pDisabledValidationFeatures,
+            from->disabledValidationFeatureCount * sizeof(const VkValidationFeatureDisableEXT));
+    }
+}
+
+#endif
+#ifdef VK_NV_cooperative_matrix
+void deepcopy_VkCooperativeMatrixPropertiesNV(Allocator* alloc, VkStructureType rootType,
+                                              const VkCooperativeMatrixPropertiesNV* from,
+                                              VkCooperativeMatrixPropertiesNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceCooperativeMatrixFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceCooperativeMatrixFeaturesNV* from,
+    VkPhysicalDeviceCooperativeMatrixFeaturesNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceCooperativeMatrixPropertiesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceCooperativeMatrixPropertiesNV* from,
+    VkPhysicalDeviceCooperativeMatrixPropertiesNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+void deepcopy_VkPhysicalDeviceCoverageReductionModeFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceCoverageReductionModeFeaturesNV* from,
+    VkPhysicalDeviceCoverageReductionModeFeaturesNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPipelineCoverageReductionStateCreateInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineCoverageReductionStateCreateInfoNV* from,
+    VkPipelineCoverageReductionStateCreateInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkFramebufferMixedSamplesCombinationNV(
+    Allocator* alloc, VkStructureType rootType, const VkFramebufferMixedSamplesCombinationNV* from,
+    VkFramebufferMixedSamplesCombinationNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_fragment_shader_interlock
+void deepcopy_VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT* from,
+    VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_ycbcr_image_arrays
+void deepcopy_VkPhysicalDeviceYcbcrImageArraysFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT* from,
+    VkPhysicalDeviceYcbcrImageArraysFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_provoking_vertex
+void deepcopy_VkPhysicalDeviceProvokingVertexFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceProvokingVertexFeaturesEXT* from,
+    VkPhysicalDeviceProvokingVertexFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceProvokingVertexPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceProvokingVertexPropertiesEXT* from,
+    VkPhysicalDeviceProvokingVertexPropertiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT* from,
+    VkPipelineRasterizationProvokingVertexStateCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+void deepcopy_VkSurfaceFullScreenExclusiveInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                                  const VkSurfaceFullScreenExclusiveInfoEXT* from,
+                                                  VkSurfaceFullScreenExclusiveInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkSurfaceCapabilitiesFullScreenExclusiveEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkSurfaceCapabilitiesFullScreenExclusiveEXT* from,
+    VkSurfaceCapabilitiesFullScreenExclusiveEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkSurfaceFullScreenExclusiveWin32InfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkSurfaceFullScreenExclusiveWin32InfoEXT* from,
+    VkSurfaceFullScreenExclusiveWin32InfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_headless_surface
+void deepcopy_VkHeadlessSurfaceCreateInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                             const VkHeadlessSurfaceCreateInfoEXT* from,
+                                             VkHeadlessSurfaceCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_line_rasterization
+void deepcopy_VkPhysicalDeviceLineRasterizationFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceLineRasterizationFeaturesEXT* from,
+    VkPhysicalDeviceLineRasterizationFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceLineRasterizationPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceLineRasterizationPropertiesEXT* from,
+    VkPhysicalDeviceLineRasterizationPropertiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPipelineRasterizationLineStateCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineRasterizationLineStateCreateInfoEXT* from,
+    VkPipelineRasterizationLineStateCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_shader_atomic_float
+void deepcopy_VkPhysicalDeviceShaderAtomicFloatFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT* from,
+    VkPhysicalDeviceShaderAtomicFloatFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_host_query_reset
+#endif
+#ifdef VK_EXT_index_type_uint8
+void deepcopy_VkPhysicalDeviceIndexTypeUint8FeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceIndexTypeUint8FeaturesEXT* from,
+    VkPhysicalDeviceIndexTypeUint8FeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+void deepcopy_VkPhysicalDeviceExtendedDynamicStateFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT* from,
+    VkPhysicalDeviceExtendedDynamicStateFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_shader_atomic_float2
+void deepcopy_VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT* from,
+    VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_shader_demote_to_helper_invocation
+void deepcopy_VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT* from,
+    VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_device_generated_commands
+void deepcopy_VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV* from,
+    VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV* from,
+    VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkGraphicsShaderGroupCreateInfoNV(Allocator* alloc, VkStructureType rootType,
+                                                const VkGraphicsShaderGroupCreateInfoNV* from,
+                                                VkGraphicsShaderGroupCreateInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pStages = nullptr;
+        if (from->pStages) {
+            to->pStages = (VkPipelineShaderStageCreateInfo*)alloc->alloc(
+                from->stageCount * sizeof(const VkPipelineShaderStageCreateInfo));
+            to->stageCount = from->stageCount;
+            for (uint32_t i = 0; i < (uint32_t)from->stageCount; ++i) {
+                deepcopy_VkPipelineShaderStageCreateInfo(
+                    alloc, rootType, from->pStages + i,
+                    (VkPipelineShaderStageCreateInfo*)(to->pStages + i));
+            }
+        }
+    }
+    to->pVertexInputState = nullptr;
+    if (from->pVertexInputState) {
+        to->pVertexInputState = (VkPipelineVertexInputStateCreateInfo*)alloc->alloc(
+            sizeof(const VkPipelineVertexInputStateCreateInfo));
+        deepcopy_VkPipelineVertexInputStateCreateInfo(
+            alloc, rootType, from->pVertexInputState,
+            (VkPipelineVertexInputStateCreateInfo*)(to->pVertexInputState));
+    }
+    to->pTessellationState = nullptr;
+    if (from->pTessellationState) {
+        to->pTessellationState = (VkPipelineTessellationStateCreateInfo*)alloc->alloc(
+            sizeof(const VkPipelineTessellationStateCreateInfo));
+        deepcopy_VkPipelineTessellationStateCreateInfo(
+            alloc, rootType, from->pTessellationState,
+            (VkPipelineTessellationStateCreateInfo*)(to->pTessellationState));
+    }
+}
+
+void deepcopy_VkGraphicsPipelineShaderGroupsCreateInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkGraphicsPipelineShaderGroupsCreateInfoNV* from,
+    VkGraphicsPipelineShaderGroupsCreateInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pGroups = nullptr;
+        if (from->pGroups) {
+            to->pGroups = (VkGraphicsShaderGroupCreateInfoNV*)alloc->alloc(
+                from->groupCount * sizeof(const VkGraphicsShaderGroupCreateInfoNV));
+            to->groupCount = from->groupCount;
+            for (uint32_t i = 0; i < (uint32_t)from->groupCount; ++i) {
+                deepcopy_VkGraphicsShaderGroupCreateInfoNV(
+                    alloc, rootType, from->pGroups + i,
+                    (VkGraphicsShaderGroupCreateInfoNV*)(to->pGroups + i));
+            }
+        }
+    }
+    to->pPipelines = nullptr;
+    if (from->pPipelines) {
+        to->pPipelines = (VkPipeline*)alloc->dupArray(
+            from->pPipelines, from->pipelineCount * sizeof(const VkPipeline));
+    }
+}
+
+void deepcopy_VkBindShaderGroupIndirectCommandNV(Allocator* alloc, VkStructureType rootType,
+                                                 const VkBindShaderGroupIndirectCommandNV* from,
+                                                 VkBindShaderGroupIndirectCommandNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkBindIndexBufferIndirectCommandNV(Allocator* alloc, VkStructureType rootType,
+                                                 const VkBindIndexBufferIndirectCommandNV* from,
+                                                 VkBindIndexBufferIndirectCommandNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkBindVertexBufferIndirectCommandNV(Allocator* alloc, VkStructureType rootType,
+                                                  const VkBindVertexBufferIndirectCommandNV* from,
+                                                  VkBindVertexBufferIndirectCommandNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkSetStateFlagsIndirectCommandNV(Allocator* alloc, VkStructureType rootType,
+                                               const VkSetStateFlagsIndirectCommandNV* from,
+                                               VkSetStateFlagsIndirectCommandNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkIndirectCommandsStreamNV(Allocator* alloc, VkStructureType rootType,
+                                         const VkIndirectCommandsStreamNV* from,
+                                         VkIndirectCommandsStreamNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkIndirectCommandsLayoutTokenNV(Allocator* alloc, VkStructureType rootType,
+                                              const VkIndirectCommandsLayoutTokenNV* from,
+                                              VkIndirectCommandsLayoutTokenNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pIndexTypes = nullptr;
+    if (from->pIndexTypes) {
+        to->pIndexTypes = (VkIndexType*)alloc->dupArray(
+            from->pIndexTypes, from->indexTypeCount * sizeof(const VkIndexType));
+    }
+    to->pIndexTypeValues = nullptr;
+    if (from->pIndexTypeValues) {
+        to->pIndexTypeValues = (uint32_t*)alloc->dupArray(
+            from->pIndexTypeValues, from->indexTypeCount * sizeof(const uint32_t));
+    }
+}
+
+void deepcopy_VkIndirectCommandsLayoutCreateInfoNV(Allocator* alloc, VkStructureType rootType,
+                                                   const VkIndirectCommandsLayoutCreateInfoNV* from,
+                                                   VkIndirectCommandsLayoutCreateInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pTokens = nullptr;
+        if (from->pTokens) {
+            to->pTokens = (VkIndirectCommandsLayoutTokenNV*)alloc->alloc(
+                from->tokenCount * sizeof(const VkIndirectCommandsLayoutTokenNV));
+            to->tokenCount = from->tokenCount;
+            for (uint32_t i = 0; i < (uint32_t)from->tokenCount; ++i) {
+                deepcopy_VkIndirectCommandsLayoutTokenNV(
+                    alloc, rootType, from->pTokens + i,
+                    (VkIndirectCommandsLayoutTokenNV*)(to->pTokens + i));
+            }
+        }
+    }
+    to->pStreamStrides = nullptr;
+    if (from->pStreamStrides) {
+        to->pStreamStrides = (uint32_t*)alloc->dupArray(from->pStreamStrides,
+                                                        from->streamCount * sizeof(const uint32_t));
+    }
+}
+
+void deepcopy_VkGeneratedCommandsInfoNV(Allocator* alloc, VkStructureType rootType,
+                                        const VkGeneratedCommandsInfoNV* from,
+                                        VkGeneratedCommandsInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pStreams = nullptr;
+        if (from->pStreams) {
+            to->pStreams = (VkIndirectCommandsStreamNV*)alloc->alloc(
+                from->streamCount * sizeof(const VkIndirectCommandsStreamNV));
+            to->streamCount = from->streamCount;
+            for (uint32_t i = 0; i < (uint32_t)from->streamCount; ++i) {
+                deepcopy_VkIndirectCommandsStreamNV(
+                    alloc, rootType, from->pStreams + i,
+                    (VkIndirectCommandsStreamNV*)(to->pStreams + i));
+            }
+        }
+    }
+}
+
+void deepcopy_VkGeneratedCommandsMemoryRequirementsInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkGeneratedCommandsMemoryRequirementsInfoNV* from,
+    VkGeneratedCommandsMemoryRequirementsInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_inherited_viewport_scissor
+void deepcopy_VkPhysicalDeviceInheritedViewportScissorFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceInheritedViewportScissorFeaturesNV* from,
+    VkPhysicalDeviceInheritedViewportScissorFeaturesNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkCommandBufferInheritanceViewportScissorInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkCommandBufferInheritanceViewportScissorInfoNV* from,
+    VkCommandBufferInheritanceViewportScissorInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pViewportDepths = nullptr;
+    if (from->pViewportDepths) {
+        to->pViewportDepths = (VkViewport*)alloc->alloc(sizeof(const VkViewport));
+        deepcopy_VkViewport(alloc, rootType, from->pViewportDepths,
+                            (VkViewport*)(to->pViewportDepths));
+    }
+}
+
+#endif
+#ifdef VK_EXT_texel_buffer_alignment
+void deepcopy_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT* from,
+    VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT* from,
+    VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_QCOM_render_pass_transform
+void deepcopy_VkRenderPassTransformBeginInfoQCOM(Allocator* alloc, VkStructureType rootType,
+                                                 const VkRenderPassTransformBeginInfoQCOM* from,
+                                                 VkRenderPassTransformBeginInfoQCOM* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkCommandBufferInheritanceRenderPassTransformInfoQCOM(
+    Allocator* alloc, VkStructureType rootType,
+    const VkCommandBufferInheritanceRenderPassTransformInfoQCOM* from,
+    VkCommandBufferInheritanceRenderPassTransformInfoQCOM* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkRect2D(alloc, rootType, &from->renderArea, (VkRect2D*)(&to->renderArea));
+}
+
+#endif
+#ifdef VK_EXT_device_memory_report
+void deepcopy_VkPhysicalDeviceDeviceMemoryReportFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceDeviceMemoryReportFeaturesEXT* from,
+    VkPhysicalDeviceDeviceMemoryReportFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkDeviceMemoryReportCallbackDataEXT(Allocator* alloc, VkStructureType rootType,
+                                                  const VkDeviceMemoryReportCallbackDataEXT* from,
+                                                  VkDeviceMemoryReportCallbackDataEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkDeviceDeviceMemoryReportCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType, const VkDeviceDeviceMemoryReportCreateInfoEXT* from,
+    VkDeviceDeviceMemoryReportCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pUserData = nullptr;
+    if (from->pUserData) {
+        to->pUserData = (void*)alloc->dupArray(from->pUserData, sizeof(uint8_t));
+    }
+}
+
+#endif
+#ifdef VK_EXT_acquire_drm_display
+#endif
+#ifdef VK_EXT_robustness2
+void deepcopy_VkPhysicalDeviceRobustness2FeaturesEXT(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceRobustness2FeaturesEXT* from,
+    VkPhysicalDeviceRobustness2FeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceRobustness2PropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceRobustness2PropertiesEXT* from,
+    VkPhysicalDeviceRobustness2PropertiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_custom_border_color
+void deepcopy_VkSamplerCustomBorderColorCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType, const VkSamplerCustomBorderColorCreateInfoEXT* from,
+    VkSamplerCustomBorderColorCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkClearColorValue(alloc, rootType, &from->customBorderColor,
+                               (VkClearColorValue*)(&to->customBorderColor));
+}
+
+void deepcopy_VkPhysicalDeviceCustomBorderColorPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceCustomBorderColorPropertiesEXT* from,
+    VkPhysicalDeviceCustomBorderColorPropertiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceCustomBorderColorFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceCustomBorderColorFeaturesEXT* from,
+    VkPhysicalDeviceCustomBorderColorFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_GOOGLE_user_type
+#endif
+#ifdef VK_EXT_private_data
+void deepcopy_VkPhysicalDevicePrivateDataFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDevicePrivateDataFeaturesEXT* from,
+    VkPhysicalDevicePrivateDataFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkDevicePrivateDataCreateInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                               const VkDevicePrivateDataCreateInfoEXT* from,
+                                               VkDevicePrivateDataCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPrivateDataSlotCreateInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                             const VkPrivateDataSlotCreateInfoEXT* from,
+                                             VkPrivateDataSlotCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_pipeline_creation_cache_control
+void deepcopy_VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT* from,
+    VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_device_diagnostics_config
+void deepcopy_VkPhysicalDeviceDiagnosticsConfigFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceDiagnosticsConfigFeaturesNV* from,
+    VkPhysicalDeviceDiagnosticsConfigFeaturesNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkDeviceDiagnosticsConfigCreateInfoNV(
+    Allocator* alloc, VkStructureType rootType, const VkDeviceDiagnosticsConfigCreateInfoNV* from,
+    VkDeviceDiagnosticsConfigCreateInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_QCOM_render_pass_store_ops
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+void deepcopy_VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV* from,
+    VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV* from,
+    VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPipelineFragmentShadingRateEnumStateCreateInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineFragmentShadingRateEnumStateCreateInfoNV* from,
+    VkPipelineFragmentShadingRateEnumStateCreateInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    memcpy(to->combinerOps, from->combinerOps, 2 * sizeof(VkFragmentShadingRateCombinerOpKHR));
+}
+
+#endif
+#ifdef VK_NV_ray_tracing_motion_blur
+void deepcopy_VkDeviceOrHostAddressConstKHR(Allocator* alloc, VkStructureType rootType,
+                                            const VkDeviceOrHostAddressConstKHR* from,
+                                            VkDeviceOrHostAddressConstKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    to->hostAddress = nullptr;
+    if (from->hostAddress) {
+        to->hostAddress = (void*)alloc->dupArray(from->hostAddress, sizeof(const uint8_t));
+    }
+}
+
+void deepcopy_VkAccelerationStructureGeometryMotionTrianglesDataNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAccelerationStructureGeometryMotionTrianglesDataNV* from,
+    VkAccelerationStructureGeometryMotionTrianglesDataNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkDeviceOrHostAddressConstKHR(alloc, rootType, &from->vertexData,
+                                           (VkDeviceOrHostAddressConstKHR*)(&to->vertexData));
+}
+
+void deepcopy_VkAccelerationStructureMotionInfoNV(Allocator* alloc, VkStructureType rootType,
+                                                  const VkAccelerationStructureMotionInfoNV* from,
+                                                  VkAccelerationStructureMotionInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkAccelerationStructureMatrixMotionInstanceNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAccelerationStructureMatrixMotionInstanceNV* from,
+    VkAccelerationStructureMatrixMotionInstanceNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkTransformMatrixKHR(alloc, rootType, &from->transformT0,
+                                  (VkTransformMatrixKHR*)(&to->transformT0));
+    deepcopy_VkTransformMatrixKHR(alloc, rootType, &from->transformT1,
+                                  (VkTransformMatrixKHR*)(&to->transformT1));
+}
+
+void deepcopy_VkSRTDataNV(Allocator* alloc, VkStructureType rootType, const VkSRTDataNV* from,
+                          VkSRTDataNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkAccelerationStructureSRTMotionInstanceNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAccelerationStructureSRTMotionInstanceNV* from,
+    VkAccelerationStructureSRTMotionInstanceNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkSRTDataNV(alloc, rootType, &from->transformT0, (VkSRTDataNV*)(&to->transformT0));
+    deepcopy_VkSRTDataNV(alloc, rootType, &from->transformT1, (VkSRTDataNV*)(&to->transformT1));
+}
+
+void deepcopy_VkAccelerationStructureMotionInstanceDataNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAccelerationStructureMotionInstanceDataNV* from,
+    VkAccelerationStructureMotionInstanceDataNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkAccelerationStructureInstanceKHR(
+        alloc, rootType, &from->staticInstance,
+        (VkAccelerationStructureInstanceKHR*)(&to->staticInstance));
+    deepcopy_VkAccelerationStructureMatrixMotionInstanceNV(
+        alloc, rootType, &from->matrixMotionInstance,
+        (VkAccelerationStructureMatrixMotionInstanceNV*)(&to->matrixMotionInstance));
+    deepcopy_VkAccelerationStructureSRTMotionInstanceNV(
+        alloc, rootType, &from->srtMotionInstance,
+        (VkAccelerationStructureSRTMotionInstanceNV*)(&to->srtMotionInstance));
+}
+
+void deepcopy_VkAccelerationStructureMotionInstanceNV(
+    Allocator* alloc, VkStructureType rootType, const VkAccelerationStructureMotionInstanceNV* from,
+    VkAccelerationStructureMotionInstanceNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkAccelerationStructureMotionInstanceDataNV(
+        alloc, rootType, &from->data, (VkAccelerationStructureMotionInstanceDataNV*)(&to->data));
+}
+
+void deepcopy_VkPhysicalDeviceRayTracingMotionBlurFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingMotionBlurFeaturesNV* from,
+    VkPhysicalDeviceRayTracingMotionBlurFeaturesNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_ycbcr_2plane_444_formats
+void deepcopy_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT* from,
+    VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_fragment_density_map2
+void deepcopy_VkPhysicalDeviceFragmentDensityMap2FeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT* from,
+    VkPhysicalDeviceFragmentDensityMap2FeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceFragmentDensityMap2PropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMap2PropertiesEXT* from,
+    VkPhysicalDeviceFragmentDensityMap2PropertiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_QCOM_rotated_copy_commands
+void deepcopy_VkCopyCommandTransformInfoQCOM(Allocator* alloc, VkStructureType rootType,
+                                             const VkCopyCommandTransformInfoQCOM* from,
+                                             VkCopyCommandTransformInfoQCOM* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_image_robustness
+void deepcopy_VkPhysicalDeviceImageRobustnessFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceImageRobustnessFeaturesEXT* from,
+    VkPhysicalDeviceImageRobustnessFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_4444_formats
+void deepcopy_VkPhysicalDevice4444FormatsFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDevice4444FormatsFeaturesEXT* from,
+    VkPhysicalDevice4444FormatsFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_rgba10x6_formats
+void deepcopy_VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT* from,
+    VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_acquire_winrt_display
+#endif
+#ifdef VK_EXT_directfb_surface
+void deepcopy_VkDirectFBSurfaceCreateInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                             const VkDirectFBSurfaceCreateInfoEXT* from,
+                                             VkDirectFBSurfaceCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->dfb = nullptr;
+    if (from->dfb) {
+        to->dfb = (IDirectFB*)alloc->dupArray(from->dfb, sizeof(IDirectFB));
+    }
+    to->surface = nullptr;
+    if (from->surface) {
+        to->surface = (IDirectFBSurface*)alloc->dupArray(from->surface, sizeof(IDirectFBSurface));
+    }
+}
+
+#endif
+#ifdef VK_VALVE_mutable_descriptor_type
+void deepcopy_VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE* from,
+    VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkMutableDescriptorTypeListVALVE(Allocator* alloc, VkStructureType rootType,
+                                               const VkMutableDescriptorTypeListVALVE* from,
+                                               VkMutableDescriptorTypeListVALVE* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    to->pDescriptorTypes = nullptr;
+    if (from->pDescriptorTypes) {
+        to->pDescriptorTypes = (VkDescriptorType*)alloc->dupArray(
+            from->pDescriptorTypes, from->descriptorTypeCount * sizeof(const VkDescriptorType));
+    }
+}
+
+void deepcopy_VkMutableDescriptorTypeCreateInfoVALVE(
+    Allocator* alloc, VkStructureType rootType, const VkMutableDescriptorTypeCreateInfoVALVE* from,
+    VkMutableDescriptorTypeCreateInfoVALVE* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pMutableDescriptorTypeLists = nullptr;
+        if (from->pMutableDescriptorTypeLists) {
+            to->pMutableDescriptorTypeLists = (VkMutableDescriptorTypeListVALVE*)alloc->alloc(
+                from->mutableDescriptorTypeListCount *
+                sizeof(const VkMutableDescriptorTypeListVALVE));
+            to->mutableDescriptorTypeListCount = from->mutableDescriptorTypeListCount;
+            for (uint32_t i = 0; i < (uint32_t)from->mutableDescriptorTypeListCount; ++i) {
+                deepcopy_VkMutableDescriptorTypeListVALVE(
+                    alloc, rootType, from->pMutableDescriptorTypeLists + i,
+                    (VkMutableDescriptorTypeListVALVE*)(to->pMutableDescriptorTypeLists + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+void deepcopy_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT* from,
+    VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkVertexInputBindingDescription2EXT(Allocator* alloc, VkStructureType rootType,
+                                                  const VkVertexInputBindingDescription2EXT* from,
+                                                  VkVertexInputBindingDescription2EXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkVertexInputAttributeDescription2EXT(
+    Allocator* alloc, VkStructureType rootType, const VkVertexInputAttributeDescription2EXT* from,
+    VkVertexInputAttributeDescription2EXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_physical_device_drm
+void deepcopy_VkPhysicalDeviceDrmPropertiesEXT(Allocator* alloc, VkStructureType rootType,
+                                               const VkPhysicalDeviceDrmPropertiesEXT* from,
+                                               VkPhysicalDeviceDrmPropertiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_primitive_topology_list_restart
+void deepcopy_VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT* from,
+    VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_FUCHSIA_external_memory
+void deepcopy_VkImportMemoryZirconHandleInfoFUCHSIA(
+    Allocator* alloc, VkStructureType rootType, const VkImportMemoryZirconHandleInfoFUCHSIA* from,
+    VkImportMemoryZirconHandleInfoFUCHSIA* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkMemoryZirconHandlePropertiesFUCHSIA(
+    Allocator* alloc, VkStructureType rootType, const VkMemoryZirconHandlePropertiesFUCHSIA* from,
+    VkMemoryZirconHandlePropertiesFUCHSIA* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkMemoryGetZirconHandleInfoFUCHSIA(Allocator* alloc, VkStructureType rootType,
+                                                 const VkMemoryGetZirconHandleInfoFUCHSIA* from,
+                                                 VkMemoryGetZirconHandleInfoFUCHSIA* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_FUCHSIA_external_semaphore
+void deepcopy_VkImportSemaphoreZirconHandleInfoFUCHSIA(
+    Allocator* alloc, VkStructureType rootType,
+    const VkImportSemaphoreZirconHandleInfoFUCHSIA* from,
+    VkImportSemaphoreZirconHandleInfoFUCHSIA* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkSemaphoreGetZirconHandleInfoFUCHSIA(
+    Allocator* alloc, VkStructureType rootType, const VkSemaphoreGetZirconHandleInfoFUCHSIA* from,
+    VkSemaphoreGetZirconHandleInfoFUCHSIA* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+void deepcopy_VkBufferCollectionCreateInfoFUCHSIA(Allocator* alloc, VkStructureType rootType,
+                                                  const VkBufferCollectionCreateInfoFUCHSIA* from,
+                                                  VkBufferCollectionCreateInfoFUCHSIA* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkImportMemoryBufferCollectionFUCHSIA(
+    Allocator* alloc, VkStructureType rootType, const VkImportMemoryBufferCollectionFUCHSIA* from,
+    VkImportMemoryBufferCollectionFUCHSIA* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkBufferCollectionImageCreateInfoFUCHSIA(
+    Allocator* alloc, VkStructureType rootType,
+    const VkBufferCollectionImageCreateInfoFUCHSIA* from,
+    VkBufferCollectionImageCreateInfoFUCHSIA* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkBufferCollectionConstraintsInfoFUCHSIA(
+    Allocator* alloc, VkStructureType rootType,
+    const VkBufferCollectionConstraintsInfoFUCHSIA* from,
+    VkBufferCollectionConstraintsInfoFUCHSIA* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkBufferConstraintsInfoFUCHSIA(Allocator* alloc, VkStructureType rootType,
+                                             const VkBufferConstraintsInfoFUCHSIA* from,
+                                             VkBufferConstraintsInfoFUCHSIA* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkBufferCreateInfo(alloc, rootType, &from->createInfo,
+                                (VkBufferCreateInfo*)(&to->createInfo));
+    deepcopy_VkBufferCollectionConstraintsInfoFUCHSIA(
+        alloc, rootType, &from->bufferCollectionConstraints,
+        (VkBufferCollectionConstraintsInfoFUCHSIA*)(&to->bufferCollectionConstraints));
+}
+
+void deepcopy_VkBufferCollectionBufferCreateInfoFUCHSIA(
+    Allocator* alloc, VkStructureType rootType,
+    const VkBufferCollectionBufferCreateInfoFUCHSIA* from,
+    VkBufferCollectionBufferCreateInfoFUCHSIA* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkSysmemColorSpaceFUCHSIA(Allocator* alloc, VkStructureType rootType,
+                                        const VkSysmemColorSpaceFUCHSIA* from,
+                                        VkSysmemColorSpaceFUCHSIA* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkBufferCollectionPropertiesFUCHSIA(Allocator* alloc, VkStructureType rootType,
+                                                  const VkBufferCollectionPropertiesFUCHSIA* from,
+                                                  VkBufferCollectionPropertiesFUCHSIA* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkSysmemColorSpaceFUCHSIA(alloc, rootType, &from->sysmemColorSpaceIndex,
+                                       (VkSysmemColorSpaceFUCHSIA*)(&to->sysmemColorSpaceIndex));
+    deepcopy_VkComponentMapping(alloc, rootType, &from->samplerYcbcrConversionComponents,
+                                (VkComponentMapping*)(&to->samplerYcbcrConversionComponents));
+}
+
+void deepcopy_VkImageFormatConstraintsInfoFUCHSIA(Allocator* alloc, VkStructureType rootType,
+                                                  const VkImageFormatConstraintsInfoFUCHSIA* from,
+                                                  VkImageFormatConstraintsInfoFUCHSIA* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkImageCreateInfo(alloc, rootType, &from->imageCreateInfo,
+                               (VkImageCreateInfo*)(&to->imageCreateInfo));
+    to->pColorSpaces = nullptr;
+    if (from->pColorSpaces) {
+        to->pColorSpaces =
+            (VkSysmemColorSpaceFUCHSIA*)alloc->alloc(sizeof(const VkSysmemColorSpaceFUCHSIA));
+        deepcopy_VkSysmemColorSpaceFUCHSIA(alloc, rootType, from->pColorSpaces,
+                                           (VkSysmemColorSpaceFUCHSIA*)(to->pColorSpaces));
+    }
+}
+
+void deepcopy_VkImageConstraintsInfoFUCHSIA(Allocator* alloc, VkStructureType rootType,
+                                            const VkImageConstraintsInfoFUCHSIA* from,
+                                            VkImageConstraintsInfoFUCHSIA* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pFormatConstraints = nullptr;
+        if (from->pFormatConstraints) {
+            to->pFormatConstraints = (VkImageFormatConstraintsInfoFUCHSIA*)alloc->alloc(
+                from->formatConstraintsCount * sizeof(const VkImageFormatConstraintsInfoFUCHSIA));
+            to->formatConstraintsCount = from->formatConstraintsCount;
+            for (uint32_t i = 0; i < (uint32_t)from->formatConstraintsCount; ++i) {
+                deepcopy_VkImageFormatConstraintsInfoFUCHSIA(
+                    alloc, rootType, from->pFormatConstraints + i,
+                    (VkImageFormatConstraintsInfoFUCHSIA*)(to->pFormatConstraints + i));
+            }
+        }
+    }
+    deepcopy_VkBufferCollectionConstraintsInfoFUCHSIA(
+        alloc, rootType, &from->bufferCollectionConstraints,
+        (VkBufferCollectionConstraintsInfoFUCHSIA*)(&to->bufferCollectionConstraints));
+}
+
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+void deepcopy_VkSubpassShadingPipelineCreateInfoHUAWEI(
+    Allocator* alloc, VkStructureType rootType,
+    const VkSubpassShadingPipelineCreateInfoHUAWEI* from,
+    VkSubpassShadingPipelineCreateInfoHUAWEI* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceSubpassShadingFeaturesHUAWEI(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceSubpassShadingFeaturesHUAWEI* from,
+    VkPhysicalDeviceSubpassShadingFeaturesHUAWEI* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceSubpassShadingPropertiesHUAWEI(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceSubpassShadingPropertiesHUAWEI* from,
+    VkPhysicalDeviceSubpassShadingPropertiesHUAWEI* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+void deepcopy_VkPhysicalDeviceInvocationMaskFeaturesHUAWEI(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceInvocationMaskFeaturesHUAWEI* from,
+    VkPhysicalDeviceInvocationMaskFeaturesHUAWEI* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_external_memory_rdma
+void deepcopy_VkMemoryGetRemoteAddressInfoNV(Allocator* alloc, VkStructureType rootType,
+                                             const VkMemoryGetRemoteAddressInfoNV* from,
+                                             VkMemoryGetRemoteAddressInfoNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceExternalMemoryRDMAFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceExternalMemoryRDMAFeaturesNV* from,
+    VkPhysicalDeviceExternalMemoryRDMAFeaturesNV* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+void deepcopy_VkPhysicalDeviceExtendedDynamicState2FeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT* from,
+    VkPhysicalDeviceExtendedDynamicState2FeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_QNX_screen_surface
+void deepcopy_VkScreenSurfaceCreateInfoQNX(Allocator* alloc, VkStructureType rootType,
+                                           const VkScreenSurfaceCreateInfoQNX* from,
+                                           VkScreenSurfaceCreateInfoQNX* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->context = nullptr;
+    if (from->context) {
+        to->context = (_screen_context*)alloc->dupArray(from->context, sizeof(_screen_context));
+    }
+    to->window = nullptr;
+    if (from->window) {
+        to->window = (_screen_window*)alloc->dupArray(from->window, sizeof(_screen_window));
+    }
+}
+
+#endif
+#ifdef VK_EXT_color_write_enable
+void deepcopy_VkPhysicalDeviceColorWriteEnableFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceColorWriteEnableFeaturesEXT* from,
+    VkPhysicalDeviceColorWriteEnableFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPipelineColorWriteCreateInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                                const VkPipelineColorWriteCreateInfoEXT* from,
+                                                VkPipelineColorWriteCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pColorWriteEnables = nullptr;
+    if (from->pColorWriteEnables) {
+        to->pColorWriteEnables = (VkBool32*)alloc->dupArray(
+            from->pColorWriteEnables, from->attachmentCount * sizeof(const VkBool32));
+    }
+}
+
+#endif
+#ifdef VK_GOOGLE_gfxstream
+void deepcopy_VkImportColorBufferGOOGLE(Allocator* alloc, VkStructureType rootType,
+                                        const VkImportColorBufferGOOGLE* from,
+                                        VkImportColorBufferGOOGLE* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkImportBufferGOOGLE(Allocator* alloc, VkStructureType rootType,
+                                   const VkImportBufferGOOGLE* from, VkImportBufferGOOGLE* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkCreateBlobGOOGLE(Allocator* alloc, VkStructureType rootType,
+                                 const VkCreateBlobGOOGLE* from, VkCreateBlobGOOGLE* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_global_priority_query
+void deepcopy_VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT* from,
+    VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkQueueFamilyGlobalPriorityPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkQueueFamilyGlobalPriorityPropertiesEXT* from,
+    VkQueueFamilyGlobalPriorityPropertiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    memcpy(to->priorities, from->priorities,
+           VK_MAX_GLOBAL_PRIORITY_SIZE_EXT * sizeof(VkQueueGlobalPriorityEXT));
+}
+
+#endif
+#ifdef VK_EXT_multi_draw
+void deepcopy_VkPhysicalDeviceMultiDrawFeaturesEXT(Allocator* alloc, VkStructureType rootType,
+                                                   const VkPhysicalDeviceMultiDrawFeaturesEXT* from,
+                                                   VkPhysicalDeviceMultiDrawFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceMultiDrawPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceMultiDrawPropertiesEXT* from,
+    VkPhysicalDeviceMultiDrawPropertiesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkMultiDrawInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                 const VkMultiDrawInfoEXT* from, VkMultiDrawInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkMultiDrawIndexedInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                        const VkMultiDrawIndexedInfoEXT* from,
+                                        VkMultiDrawIndexedInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+#endif
+#ifdef VK_EXT_load_store_op_none
+#endif
+#ifdef VK_EXT_border_color_swizzle
+void deepcopy_VkPhysicalDeviceBorderColorSwizzleFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT* from,
+    VkPhysicalDeviceBorderColorSwizzleFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkSamplerBorderColorComponentMappingCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkSamplerBorderColorComponentMappingCreateInfoEXT* from,
+    VkSamplerBorderColorComponentMappingCreateInfoEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkComponentMapping(alloc, rootType, &from->components,
+                                (VkComponentMapping*)(&to->components));
+}
+
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+void deepcopy_VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT* from,
+    VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_acceleration_structure
+void deepcopy_VkDeviceOrHostAddressKHR(Allocator* alloc, VkStructureType rootType,
+                                       const VkDeviceOrHostAddressKHR* from,
+                                       VkDeviceOrHostAddressKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    to->hostAddress = nullptr;
+    if (from->hostAddress) {
+        to->hostAddress = (void*)alloc->dupArray(from->hostAddress, sizeof(uint8_t));
+    }
+}
+
+void deepcopy_VkAccelerationStructureBuildRangeInfoKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAccelerationStructureBuildRangeInfoKHR* from,
+    VkAccelerationStructureBuildRangeInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkAccelerationStructureGeometryTrianglesDataKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAccelerationStructureGeometryTrianglesDataKHR* from,
+    VkAccelerationStructureGeometryTrianglesDataKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkDeviceOrHostAddressConstKHR(alloc, rootType, &from->vertexData,
+                                           (VkDeviceOrHostAddressConstKHR*)(&to->vertexData));
+    deepcopy_VkDeviceOrHostAddressConstKHR(alloc, rootType, &from->indexData,
+                                           (VkDeviceOrHostAddressConstKHR*)(&to->indexData));
+    deepcopy_VkDeviceOrHostAddressConstKHR(alloc, rootType, &from->transformData,
+                                           (VkDeviceOrHostAddressConstKHR*)(&to->transformData));
+}
+
+void deepcopy_VkAccelerationStructureGeometryAabbsDataKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAccelerationStructureGeometryAabbsDataKHR* from,
+    VkAccelerationStructureGeometryAabbsDataKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkDeviceOrHostAddressConstKHR(alloc, rootType, &from->data,
+                                           (VkDeviceOrHostAddressConstKHR*)(&to->data));
+}
+
+void deepcopy_VkAccelerationStructureGeometryInstancesDataKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAccelerationStructureGeometryInstancesDataKHR* from,
+    VkAccelerationStructureGeometryInstancesDataKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkDeviceOrHostAddressConstKHR(alloc, rootType, &from->data,
+                                           (VkDeviceOrHostAddressConstKHR*)(&to->data));
+}
+
+void deepcopy_VkAccelerationStructureGeometryDataKHR(
+    Allocator* alloc, VkStructureType rootType, const VkAccelerationStructureGeometryDataKHR* from,
+    VkAccelerationStructureGeometryDataKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    deepcopy_VkAccelerationStructureGeometryTrianglesDataKHR(
+        alloc, rootType, &from->triangles,
+        (VkAccelerationStructureGeometryTrianglesDataKHR*)(&to->triangles));
+    deepcopy_VkAccelerationStructureGeometryAabbsDataKHR(
+        alloc, rootType, &from->aabbs, (VkAccelerationStructureGeometryAabbsDataKHR*)(&to->aabbs));
+    deepcopy_VkAccelerationStructureGeometryInstancesDataKHR(
+        alloc, rootType, &from->instances,
+        (VkAccelerationStructureGeometryInstancesDataKHR*)(&to->instances));
+}
+
+void deepcopy_VkAccelerationStructureGeometryKHR(Allocator* alloc, VkStructureType rootType,
+                                                 const VkAccelerationStructureGeometryKHR* from,
+                                                 VkAccelerationStructureGeometryKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkAccelerationStructureGeometryDataKHR(
+        alloc, rootType, &from->geometry, (VkAccelerationStructureGeometryDataKHR*)(&to->geometry));
+}
+
+void deepcopy_VkAccelerationStructureBuildGeometryInfoKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAccelerationStructureBuildGeometryInfoKHR* from,
+    VkAccelerationStructureBuildGeometryInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pGeometries = nullptr;
+        if (from->pGeometries) {
+            to->pGeometries = (VkAccelerationStructureGeometryKHR*)alloc->alloc(
+                from->geometryCount * sizeof(const VkAccelerationStructureGeometryKHR));
+            to->geometryCount = from->geometryCount;
+            for (uint32_t i = 0; i < (uint32_t)from->geometryCount; ++i) {
+                deepcopy_VkAccelerationStructureGeometryKHR(
+                    alloc, rootType, from->pGeometries + i,
+                    (VkAccelerationStructureGeometryKHR*)(to->pGeometries + i));
+            }
+        }
+    }
+    deepcopy_VkDeviceOrHostAddressKHR(alloc, rootType, &from->scratchData,
+                                      (VkDeviceOrHostAddressKHR*)(&to->scratchData));
+}
+
+void deepcopy_VkAccelerationStructureCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                                   const VkAccelerationStructureCreateInfoKHR* from,
+                                                   VkAccelerationStructureCreateInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkWriteDescriptorSetAccelerationStructureKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkWriteDescriptorSetAccelerationStructureKHR* from,
+    VkWriteDescriptorSetAccelerationStructureKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pAccelerationStructures = nullptr;
+    if (from->pAccelerationStructures) {
+        to->pAccelerationStructures = (VkAccelerationStructureKHR*)alloc->dupArray(
+            from->pAccelerationStructures,
+            from->accelerationStructureCount * sizeof(const VkAccelerationStructureKHR));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceAccelerationStructureFeaturesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceAccelerationStructureFeaturesKHR* from,
+    VkPhysicalDeviceAccelerationStructureFeaturesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceAccelerationStructurePropertiesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceAccelerationStructurePropertiesKHR* from,
+    VkPhysicalDeviceAccelerationStructurePropertiesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkAccelerationStructureDeviceAddressInfoKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAccelerationStructureDeviceAddressInfoKHR* from,
+    VkAccelerationStructureDeviceAddressInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkAccelerationStructureVersionInfoKHR(
+    Allocator* alloc, VkStructureType rootType, const VkAccelerationStructureVersionInfoKHR* from,
+    VkAccelerationStructureVersionInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pVersionData = nullptr;
+    if (from->pVersionData) {
+        to->pVersionData =
+            (uint8_t*)alloc->dupArray(from->pVersionData, 2 * VK_UUID_SIZE * sizeof(const uint8_t));
+    }
+}
+
+void deepcopy_VkCopyAccelerationStructureToMemoryInfoKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkCopyAccelerationStructureToMemoryInfoKHR* from,
+    VkCopyAccelerationStructureToMemoryInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkDeviceOrHostAddressKHR(alloc, rootType, &from->dst,
+                                      (VkDeviceOrHostAddressKHR*)(&to->dst));
+}
+
+void deepcopy_VkCopyMemoryToAccelerationStructureInfoKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkCopyMemoryToAccelerationStructureInfoKHR* from,
+    VkCopyMemoryToAccelerationStructureInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    deepcopy_VkDeviceOrHostAddressConstKHR(alloc, rootType, &from->src,
+                                           (VkDeviceOrHostAddressConstKHR*)(&to->src));
+}
+
+void deepcopy_VkCopyAccelerationStructureInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                                 const VkCopyAccelerationStructureInfoKHR* from,
+                                                 VkCopyAccelerationStructureInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkAccelerationStructureBuildSizesInfoKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAccelerationStructureBuildSizesInfoKHR* from,
+    VkAccelerationStructureBuildSizesInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+void deepcopy_VkRayTracingShaderGroupCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                                   const VkRayTracingShaderGroupCreateInfoKHR* from,
+                                                   VkRayTracingShaderGroupCreateInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    to->pShaderGroupCaptureReplayHandle = nullptr;
+    if (from->pShaderGroupCaptureReplayHandle) {
+        to->pShaderGroupCaptureReplayHandle =
+            (void*)alloc->dupArray(from->pShaderGroupCaptureReplayHandle, sizeof(const uint8_t));
+    }
+}
+
+void deepcopy_VkRayTracingPipelineInterfaceCreateInfoKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkRayTracingPipelineInterfaceCreateInfoKHR* from,
+    VkRayTracingPipelineInterfaceCreateInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkRayTracingPipelineCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                                const VkRayTracingPipelineCreateInfoKHR* from,
+                                                VkRayTracingPipelineCreateInfoKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+    if (from) {
+        to->pStages = nullptr;
+        if (from->pStages) {
+            to->pStages = (VkPipelineShaderStageCreateInfo*)alloc->alloc(
+                from->stageCount * sizeof(const VkPipelineShaderStageCreateInfo));
+            to->stageCount = from->stageCount;
+            for (uint32_t i = 0; i < (uint32_t)from->stageCount; ++i) {
+                deepcopy_VkPipelineShaderStageCreateInfo(
+                    alloc, rootType, from->pStages + i,
+                    (VkPipelineShaderStageCreateInfo*)(to->pStages + i));
+            }
+        }
+    }
+    if (from) {
+        to->pGroups = nullptr;
+        if (from->pGroups) {
+            to->pGroups = (VkRayTracingShaderGroupCreateInfoKHR*)alloc->alloc(
+                from->groupCount * sizeof(const VkRayTracingShaderGroupCreateInfoKHR));
+            to->groupCount = from->groupCount;
+            for (uint32_t i = 0; i < (uint32_t)from->groupCount; ++i) {
+                deepcopy_VkRayTracingShaderGroupCreateInfoKHR(
+                    alloc, rootType, from->pGroups + i,
+                    (VkRayTracingShaderGroupCreateInfoKHR*)(to->pGroups + i));
+            }
+        }
+    }
+    to->pLibraryInfo = nullptr;
+    if (from->pLibraryInfo) {
+        to->pLibraryInfo = (VkPipelineLibraryCreateInfoKHR*)alloc->alloc(
+            sizeof(const VkPipelineLibraryCreateInfoKHR));
+        deepcopy_VkPipelineLibraryCreateInfoKHR(
+            alloc, rootType, from->pLibraryInfo,
+            (VkPipelineLibraryCreateInfoKHR*)(to->pLibraryInfo));
+    }
+    to->pLibraryInterface = nullptr;
+    if (from->pLibraryInterface) {
+        to->pLibraryInterface = (VkRayTracingPipelineInterfaceCreateInfoKHR*)alloc->alloc(
+            sizeof(const VkRayTracingPipelineInterfaceCreateInfoKHR));
+        deepcopy_VkRayTracingPipelineInterfaceCreateInfoKHR(
+            alloc, rootType, from->pLibraryInterface,
+            (VkRayTracingPipelineInterfaceCreateInfoKHR*)(to->pLibraryInterface));
+    }
+    to->pDynamicState = nullptr;
+    if (from->pDynamicState) {
+        to->pDynamicState = (VkPipelineDynamicStateCreateInfo*)alloc->alloc(
+            sizeof(const VkPipelineDynamicStateCreateInfo));
+        deepcopy_VkPipelineDynamicStateCreateInfo(
+            alloc, rootType, from->pDynamicState,
+            (VkPipelineDynamicStateCreateInfo*)(to->pDynamicState));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceRayTracingPipelineFeaturesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingPipelineFeaturesKHR* from,
+    VkPhysicalDeviceRayTracingPipelineFeaturesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkPhysicalDeviceRayTracingPipelinePropertiesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingPipelinePropertiesKHR* from,
+    VkPhysicalDeviceRayTracingPipelinePropertiesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+void deepcopy_VkStridedDeviceAddressRegionKHR(Allocator* alloc, VkStructureType rootType,
+                                              const VkStridedDeviceAddressRegionKHR* from,
+                                              VkStridedDeviceAddressRegionKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+void deepcopy_VkTraceRaysIndirectCommandKHR(Allocator* alloc, VkStructureType rootType,
+                                            const VkTraceRaysIndirectCommandKHR* from,
+                                            VkTraceRaysIndirectCommandKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+}
+
+#endif
+#ifdef VK_KHR_ray_query
+void deepcopy_VkPhysicalDeviceRayQueryFeaturesKHR(Allocator* alloc, VkStructureType rootType,
+                                                  const VkPhysicalDeviceRayQueryFeaturesKHR* from,
+                                                  VkPhysicalDeviceRayQueryFeaturesKHR* to) {
+    (void)alloc;
+    (void)rootType;
+    *to = *from;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = from->sType;
+    }
+    const void* from_pNext = from;
+    size_t pNext_size = 0u;
+    while (!pNext_size && from_pNext) {
+        from_pNext = static_cast<const vk_struct_common*>(from_pNext)->pNext;
+        pNext_size = goldfish_vk_extension_struct_size(rootType, from_pNext);
+    }
+    to->pNext = nullptr;
+    if (pNext_size) {
+        to->pNext = (void*)alloc->alloc(pNext_size);
+        deepcopy_extension_struct(alloc, rootType, from_pNext, (void*)(to->pNext));
+    }
+}
+
+#endif
+void deepcopy_extension_struct(Allocator* alloc, VkStructureType rootType,
+                               const void* structExtension, void* structExtension_out) {
+    if (!structExtension) {
+        return;
+    }
+    uint32_t structType = (uint32_t)goldfish_vk_struct_type(structExtension);
+    switch (structType) {
+#ifdef VK_VERSION_1_1
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES: {
+            deepcopy_VkPhysicalDeviceSubgroupProperties(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSubgroupProperties*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceSubgroupProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: {
+            deepcopy_VkPhysicalDevice16BitStorageFeatures(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDevice16BitStorageFeatures*>(structExtension),
+                reinterpret_cast<VkPhysicalDevice16BitStorageFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS: {
+            deepcopy_VkMemoryDedicatedRequirements(
+                alloc, rootType,
+                reinterpret_cast<const VkMemoryDedicatedRequirements*>(structExtension),
+                reinterpret_cast<VkMemoryDedicatedRequirements*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO: {
+            deepcopy_VkMemoryDedicatedAllocateInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkMemoryDedicatedAllocateInfo*>(structExtension),
+                reinterpret_cast<VkMemoryDedicatedAllocateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO: {
+            deepcopy_VkMemoryAllocateFlagsInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkMemoryAllocateFlagsInfo*>(structExtension),
+                reinterpret_cast<VkMemoryAllocateFlagsInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO: {
+            deepcopy_VkDeviceGroupRenderPassBeginInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkDeviceGroupRenderPassBeginInfo*>(structExtension),
+                reinterpret_cast<VkDeviceGroupRenderPassBeginInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO: {
+            deepcopy_VkDeviceGroupCommandBufferBeginInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkDeviceGroupCommandBufferBeginInfo*>(structExtension),
+                reinterpret_cast<VkDeviceGroupCommandBufferBeginInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO: {
+            deepcopy_VkDeviceGroupSubmitInfo(
+                alloc, rootType, reinterpret_cast<const VkDeviceGroupSubmitInfo*>(structExtension),
+                reinterpret_cast<VkDeviceGroupSubmitInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO: {
+            deepcopy_VkDeviceGroupBindSparseInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkDeviceGroupBindSparseInfo*>(structExtension),
+                reinterpret_cast<VkDeviceGroupBindSparseInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO: {
+            deepcopy_VkBindBufferMemoryDeviceGroupInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkBindBufferMemoryDeviceGroupInfo*>(structExtension),
+                reinterpret_cast<VkBindBufferMemoryDeviceGroupInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO: {
+            deepcopy_VkBindImageMemoryDeviceGroupInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkBindImageMemoryDeviceGroupInfo*>(structExtension),
+                reinterpret_cast<VkBindImageMemoryDeviceGroupInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO: {
+            deepcopy_VkDeviceGroupDeviceCreateInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkDeviceGroupDeviceCreateInfo*>(structExtension),
+                reinterpret_cast<VkDeviceGroupDeviceCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: {
+            deepcopy_VkPhysicalDeviceFeatures2(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFeatures2*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceFeatures2*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES: {
+            deepcopy_VkPhysicalDevicePointClippingProperties(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDevicePointClippingProperties*>(structExtension),
+                reinterpret_cast<VkPhysicalDevicePointClippingProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO: {
+            deepcopy_VkRenderPassInputAttachmentAspectCreateInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkRenderPassInputAttachmentAspectCreateInfo*>(
+                    structExtension),
+                reinterpret_cast<VkRenderPassInputAttachmentAspectCreateInfo*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO: {
+            deepcopy_VkImageViewUsageCreateInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkImageViewUsageCreateInfo*>(structExtension),
+                reinterpret_cast<VkImageViewUsageCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO: {
+            deepcopy_VkPipelineTessellationDomainOriginStateCreateInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkPipelineTessellationDomainOriginStateCreateInfo*>(
+                    structExtension),
+                reinterpret_cast<VkPipelineTessellationDomainOriginStateCreateInfo*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO: {
+            deepcopy_VkRenderPassMultiviewCreateInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkRenderPassMultiviewCreateInfo*>(structExtension),
+                reinterpret_cast<VkRenderPassMultiviewCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES: {
+            deepcopy_VkPhysicalDeviceMultiviewFeatures(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMultiviewFeatures*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceMultiviewFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES: {
+            deepcopy_VkPhysicalDeviceMultiviewProperties(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMultiviewProperties*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceMultiviewProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES: {
+            deepcopy_VkPhysicalDeviceVariablePointersFeatures(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVariablePointersFeatures*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceVariablePointersFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES: {
+            deepcopy_VkPhysicalDeviceProtectedMemoryFeatures(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceProtectedMemoryFeatures*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceProtectedMemoryFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES: {
+            deepcopy_VkPhysicalDeviceProtectedMemoryProperties(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceProtectedMemoryProperties*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceProtectedMemoryProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO: {
+            deepcopy_VkProtectedSubmitInfo(
+                alloc, rootType, reinterpret_cast<const VkProtectedSubmitInfo*>(structExtension),
+                reinterpret_cast<VkProtectedSubmitInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO: {
+            deepcopy_VkSamplerYcbcrConversionInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkSamplerYcbcrConversionInfo*>(structExtension),
+                reinterpret_cast<VkSamplerYcbcrConversionInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO: {
+            deepcopy_VkBindImagePlaneMemoryInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkBindImagePlaneMemoryInfo*>(structExtension),
+                reinterpret_cast<VkBindImagePlaneMemoryInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO: {
+            deepcopy_VkImagePlaneMemoryRequirementsInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkImagePlaneMemoryRequirementsInfo*>(structExtension),
+                reinterpret_cast<VkImagePlaneMemoryRequirementsInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: {
+            deepcopy_VkPhysicalDeviceSamplerYcbcrConversionFeatures(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSamplerYcbcrConversionFeatures*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceSamplerYcbcrConversionFeatures*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES: {
+            deepcopy_VkSamplerYcbcrConversionImageFormatProperties(
+                alloc, rootType,
+                reinterpret_cast<const VkSamplerYcbcrConversionImageFormatProperties*>(
+                    structExtension),
+                reinterpret_cast<VkSamplerYcbcrConversionImageFormatProperties*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO: {
+            deepcopy_VkPhysicalDeviceExternalImageFormatInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceExternalImageFormatInfo*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceExternalImageFormatInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES: {
+            deepcopy_VkExternalImageFormatProperties(
+                alloc, rootType,
+                reinterpret_cast<const VkExternalImageFormatProperties*>(structExtension),
+                reinterpret_cast<VkExternalImageFormatProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES: {
+            deepcopy_VkPhysicalDeviceIDProperties(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceIDProperties*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceIDProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO: {
+            deepcopy_VkExternalMemoryImageCreateInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkExternalMemoryImageCreateInfo*>(structExtension),
+                reinterpret_cast<VkExternalMemoryImageCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO: {
+            deepcopy_VkExternalMemoryBufferCreateInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkExternalMemoryBufferCreateInfo*>(structExtension),
+                reinterpret_cast<VkExternalMemoryBufferCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO: {
+            deepcopy_VkExportMemoryAllocateInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkExportMemoryAllocateInfo*>(structExtension),
+                reinterpret_cast<VkExportMemoryAllocateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO: {
+            deepcopy_VkExportFenceCreateInfo(
+                alloc, rootType, reinterpret_cast<const VkExportFenceCreateInfo*>(structExtension),
+                reinterpret_cast<VkExportFenceCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO: {
+            deepcopy_VkExportSemaphoreCreateInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkExportSemaphoreCreateInfo*>(structExtension),
+                reinterpret_cast<VkExportSemaphoreCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES: {
+            deepcopy_VkPhysicalDeviceMaintenance3Properties(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMaintenance3Properties*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceMaintenance3Properties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES: {
+            deepcopy_VkPhysicalDeviceShaderDrawParametersFeatures(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderDrawParametersFeatures*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceShaderDrawParametersFeatures*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_VERSION_1_2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES: {
+            deepcopy_VkPhysicalDeviceVulkan11Features(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVulkan11Features*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceVulkan11Features*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES: {
+            deepcopy_VkPhysicalDeviceVulkan11Properties(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVulkan11Properties*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceVulkan11Properties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES: {
+            deepcopy_VkPhysicalDeviceVulkan12Features(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVulkan12Features*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceVulkan12Features*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES: {
+            deepcopy_VkPhysicalDeviceVulkan12Properties(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVulkan12Properties*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceVulkan12Properties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO: {
+            deepcopy_VkImageFormatListCreateInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkImageFormatListCreateInfo*>(structExtension),
+                reinterpret_cast<VkImageFormatListCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES: {
+            deepcopy_VkPhysicalDevice8BitStorageFeatures(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDevice8BitStorageFeatures*>(structExtension),
+                reinterpret_cast<VkPhysicalDevice8BitStorageFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES: {
+            deepcopy_VkPhysicalDeviceDriverProperties(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDriverProperties*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceDriverProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES: {
+            deepcopy_VkPhysicalDeviceShaderAtomicInt64Features(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderAtomicInt64Features*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceShaderAtomicInt64Features*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES: {
+            deepcopy_VkPhysicalDeviceShaderFloat16Int8Features(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderFloat16Int8Features*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceShaderFloat16Int8Features*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES: {
+            deepcopy_VkPhysicalDeviceFloatControlsProperties(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFloatControlsProperties*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceFloatControlsProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO: {
+            deepcopy_VkDescriptorSetLayoutBindingFlagsCreateInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkDescriptorSetLayoutBindingFlagsCreateInfo*>(
+                    structExtension),
+                reinterpret_cast<VkDescriptorSetLayoutBindingFlagsCreateInfo*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES: {
+            deepcopy_VkPhysicalDeviceDescriptorIndexingFeatures(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDescriptorIndexingFeatures*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceDescriptorIndexingFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES: {
+            deepcopy_VkPhysicalDeviceDescriptorIndexingProperties(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDescriptorIndexingProperties*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceDescriptorIndexingProperties*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO: {
+            deepcopy_VkDescriptorSetVariableDescriptorCountAllocateInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkDescriptorSetVariableDescriptorCountAllocateInfo*>(
+                    structExtension),
+                reinterpret_cast<VkDescriptorSetVariableDescriptorCountAllocateInfo*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT: {
+            deepcopy_VkDescriptorSetVariableDescriptorCountLayoutSupport(
+                alloc, rootType,
+                reinterpret_cast<const VkDescriptorSetVariableDescriptorCountLayoutSupport*>(
+                    structExtension),
+                reinterpret_cast<VkDescriptorSetVariableDescriptorCountLayoutSupport*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE: {
+            deepcopy_VkSubpassDescriptionDepthStencilResolve(
+                alloc, rootType,
+                reinterpret_cast<const VkSubpassDescriptionDepthStencilResolve*>(structExtension),
+                reinterpret_cast<VkSubpassDescriptionDepthStencilResolve*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES: {
+            deepcopy_VkPhysicalDeviceDepthStencilResolveProperties(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDepthStencilResolveProperties*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceDepthStencilResolveProperties*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES: {
+            deepcopy_VkPhysicalDeviceScalarBlockLayoutFeatures(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceScalarBlockLayoutFeatures*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceScalarBlockLayoutFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO: {
+            deepcopy_VkImageStencilUsageCreateInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkImageStencilUsageCreateInfo*>(structExtension),
+                reinterpret_cast<VkImageStencilUsageCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO: {
+            deepcopy_VkSamplerReductionModeCreateInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkSamplerReductionModeCreateInfo*>(structExtension),
+                reinterpret_cast<VkSamplerReductionModeCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES: {
+            deepcopy_VkPhysicalDeviceSamplerFilterMinmaxProperties(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSamplerFilterMinmaxProperties*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceSamplerFilterMinmaxProperties*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES: {
+            deepcopy_VkPhysicalDeviceVulkanMemoryModelFeatures(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVulkanMemoryModelFeatures*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceVulkanMemoryModelFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES: {
+            deepcopy_VkPhysicalDeviceImagelessFramebufferFeatures(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceImagelessFramebufferFeatures*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceImagelessFramebufferFeatures*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO: {
+            deepcopy_VkFramebufferAttachmentsCreateInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkFramebufferAttachmentsCreateInfo*>(structExtension),
+                reinterpret_cast<VkFramebufferAttachmentsCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO: {
+            deepcopy_VkRenderPassAttachmentBeginInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkRenderPassAttachmentBeginInfo*>(structExtension),
+                reinterpret_cast<VkRenderPassAttachmentBeginInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES: {
+            deepcopy_VkPhysicalDeviceUniformBufferStandardLayoutFeatures(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceUniformBufferStandardLayoutFeatures*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceUniformBufferStandardLayoutFeatures*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES: {
+            deepcopy_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES: {
+            deepcopy_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT: {
+            deepcopy_VkAttachmentReferenceStencilLayout(
+                alloc, rootType,
+                reinterpret_cast<const VkAttachmentReferenceStencilLayout*>(structExtension),
+                reinterpret_cast<VkAttachmentReferenceStencilLayout*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT: {
+            deepcopy_VkAttachmentDescriptionStencilLayout(
+                alloc, rootType,
+                reinterpret_cast<const VkAttachmentDescriptionStencilLayout*>(structExtension),
+                reinterpret_cast<VkAttachmentDescriptionStencilLayout*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES: {
+            deepcopy_VkPhysicalDeviceHostQueryResetFeatures(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceHostQueryResetFeatures*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceHostQueryResetFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES: {
+            deepcopy_VkPhysicalDeviceTimelineSemaphoreFeatures(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceTimelineSemaphoreFeatures*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceTimelineSemaphoreFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES: {
+            deepcopy_VkPhysicalDeviceTimelineSemaphoreProperties(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceTimelineSemaphoreProperties*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceTimelineSemaphoreProperties*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO: {
+            deepcopy_VkSemaphoreTypeCreateInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkSemaphoreTypeCreateInfo*>(structExtension),
+                reinterpret_cast<VkSemaphoreTypeCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO: {
+            deepcopy_VkTimelineSemaphoreSubmitInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkTimelineSemaphoreSubmitInfo*>(structExtension),
+                reinterpret_cast<VkTimelineSemaphoreSubmitInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES: {
+            deepcopy_VkPhysicalDeviceBufferDeviceAddressFeatures(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceBufferDeviceAddressFeatures*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceBufferDeviceAddressFeatures*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO: {
+            deepcopy_VkBufferOpaqueCaptureAddressCreateInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkBufferOpaqueCaptureAddressCreateInfo*>(structExtension),
+                reinterpret_cast<VkBufferOpaqueCaptureAddressCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO: {
+            deepcopy_VkMemoryOpaqueCaptureAddressAllocateInfo(
+                alloc, rootType,
+                reinterpret_cast<const VkMemoryOpaqueCaptureAddressAllocateInfo*>(structExtension),
+                reinterpret_cast<VkMemoryOpaqueCaptureAddressAllocateInfo*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_swapchain
+        case VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR: {
+            deepcopy_VkImageSwapchainCreateInfoKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkImageSwapchainCreateInfoKHR*>(structExtension),
+                reinterpret_cast<VkImageSwapchainCreateInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR: {
+            deepcopy_VkBindImageMemorySwapchainInfoKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkBindImageMemorySwapchainInfoKHR*>(structExtension),
+                reinterpret_cast<VkBindImageMemorySwapchainInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR: {
+            deepcopy_VkDeviceGroupPresentInfoKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkDeviceGroupPresentInfoKHR*>(structExtension),
+                reinterpret_cast<VkDeviceGroupPresentInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR: {
+            deepcopy_VkDeviceGroupSwapchainCreateInfoKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkDeviceGroupSwapchainCreateInfoKHR*>(structExtension),
+                reinterpret_cast<VkDeviceGroupSwapchainCreateInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_display_swapchain
+        case VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR: {
+            deepcopy_VkDisplayPresentInfoKHR(
+                alloc, rootType, reinterpret_cast<const VkDisplayPresentInfoKHR*>(structExtension),
+                reinterpret_cast<VkDisplayPresentInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_video_queue
+        case VK_STRUCTURE_TYPE_VIDEO_QUEUE_FAMILY_PROPERTIES_2_KHR: {
+            deepcopy_VkVideoQueueFamilyProperties2KHR(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoQueueFamilyProperties2KHR*>(structExtension),
+                reinterpret_cast<VkVideoQueueFamilyProperties2KHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_PROFILE_KHR: {
+            deepcopy_VkVideoProfileKHR(alloc, rootType,
+                                       reinterpret_cast<const VkVideoProfileKHR*>(structExtension),
+                                       reinterpret_cast<VkVideoProfileKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_PROFILES_KHR: {
+            deepcopy_VkVideoProfilesKHR(
+                alloc, rootType, reinterpret_cast<const VkVideoProfilesKHR*>(structExtension),
+                reinterpret_cast<VkVideoProfilesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_dynamic_rendering
+        case VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO_KHR: {
+            deepcopy_VkPipelineRenderingCreateInfoKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkPipelineRenderingCreateInfoKHR*>(structExtension),
+                reinterpret_cast<VkPipelineRenderingCreateInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR: {
+            deepcopy_VkPhysicalDeviceDynamicRenderingFeaturesKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDynamicRenderingFeaturesKHR*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceDynamicRenderingFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO_KHR: {
+            deepcopy_VkCommandBufferInheritanceRenderingInfoKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkCommandBufferInheritanceRenderingInfoKHR*>(
+                    structExtension),
+                reinterpret_cast<VkCommandBufferInheritanceRenderingInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR: {
+            deepcopy_VkRenderingFragmentShadingRateAttachmentInfoKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkRenderingFragmentShadingRateAttachmentInfoKHR*>(
+                    structExtension),
+                reinterpret_cast<VkRenderingFragmentShadingRateAttachmentInfoKHR*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT: {
+            deepcopy_VkRenderingFragmentDensityMapAttachmentInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkRenderingFragmentDensityMapAttachmentInfoEXT*>(
+                    structExtension),
+                reinterpret_cast<VkRenderingFragmentDensityMapAttachmentInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD: {
+            deepcopy_VkAttachmentSampleCountInfoAMD(
+                alloc, rootType,
+                reinterpret_cast<const VkAttachmentSampleCountInfoAMD*>(structExtension),
+                reinterpret_cast<VkAttachmentSampleCountInfoAMD*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX: {
+            deepcopy_VkMultiviewPerViewAttributesInfoNVX(
+                alloc, rootType,
+                reinterpret_cast<const VkMultiviewPerViewAttributesInfoNVX*>(structExtension),
+                reinterpret_cast<VkMultiviewPerViewAttributesInfoNVX*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_memory_win32
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR: {
+            deepcopy_VkImportMemoryWin32HandleInfoKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkImportMemoryWin32HandleInfoKHR*>(structExtension),
+                reinterpret_cast<VkImportMemoryWin32HandleInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR: {
+            deepcopy_VkExportMemoryWin32HandleInfoKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkExportMemoryWin32HandleInfoKHR*>(structExtension),
+                reinterpret_cast<VkExportMemoryWin32HandleInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_memory_fd
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR: {
+            deepcopy_VkImportMemoryFdInfoKHR(
+                alloc, rootType, reinterpret_cast<const VkImportMemoryFdInfoKHR*>(structExtension),
+                reinterpret_cast<VkImportMemoryFdInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_win32_keyed_mutex
+        case VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR: {
+            deepcopy_VkWin32KeyedMutexAcquireReleaseInfoKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkWin32KeyedMutexAcquireReleaseInfoKHR*>(structExtension),
+                reinterpret_cast<VkWin32KeyedMutexAcquireReleaseInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+        case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR: {
+            deepcopy_VkExportSemaphoreWin32HandleInfoKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkExportSemaphoreWin32HandleInfoKHR*>(structExtension),
+                reinterpret_cast<VkExportSemaphoreWin32HandleInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR: {
+            deepcopy_VkD3D12FenceSubmitInfoKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkD3D12FenceSubmitInfoKHR*>(structExtension),
+                reinterpret_cast<VkD3D12FenceSubmitInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_push_descriptor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR: {
+            deepcopy_VkPhysicalDevicePushDescriptorPropertiesKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDevicePushDescriptorPropertiesKHR*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDevicePushDescriptorPropertiesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_incremental_present
+        case VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR: {
+            deepcopy_VkPresentRegionsKHR(
+                alloc, rootType, reinterpret_cast<const VkPresentRegionsKHR*>(structExtension),
+                reinterpret_cast<VkPresentRegionsKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shared_presentable_image
+        case VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR: {
+            deepcopy_VkSharedPresentSurfaceCapabilitiesKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkSharedPresentSurfaceCapabilitiesKHR*>(structExtension),
+                reinterpret_cast<VkSharedPresentSurfaceCapabilitiesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_fence_win32
+        case VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR: {
+            deepcopy_VkExportFenceWin32HandleInfoKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkExportFenceWin32HandleInfoKHR*>(structExtension),
+                reinterpret_cast<VkExportFenceWin32HandleInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_performance_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR: {
+            deepcopy_VkPhysicalDevicePerformanceQueryFeaturesKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDevicePerformanceQueryFeaturesKHR*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDevicePerformanceQueryFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR: {
+            deepcopy_VkPhysicalDevicePerformanceQueryPropertiesKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDevicePerformanceQueryPropertiesKHR*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDevicePerformanceQueryPropertiesKHR*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR: {
+            deepcopy_VkQueryPoolPerformanceCreateInfoKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkQueryPoolPerformanceCreateInfoKHR*>(structExtension),
+                reinterpret_cast<VkQueryPoolPerformanceCreateInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR: {
+            deepcopy_VkPerformanceQuerySubmitInfoKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkPerformanceQuerySubmitInfoKHR*>(structExtension),
+                reinterpret_cast<VkPerformanceQuerySubmitInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_portability_subset
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR: {
+            deepcopy_VkPhysicalDevicePortabilitySubsetFeaturesKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDevicePortabilitySubsetFeaturesKHR*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDevicePortabilitySubsetFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR: {
+            deepcopy_VkPhysicalDevicePortabilitySubsetPropertiesKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDevicePortabilitySubsetPropertiesKHR*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDevicePortabilitySubsetPropertiesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_clock
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR: {
+            deepcopy_VkPhysicalDeviceShaderClockFeaturesKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderClockFeaturesKHR*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceShaderClockFeaturesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_terminate_invocation
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR: {
+            deepcopy_VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+        case VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR: {
+            deepcopy_VkFragmentShadingRateAttachmentInfoKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkFragmentShadingRateAttachmentInfoKHR*>(structExtension),
+                reinterpret_cast<VkFragmentShadingRateAttachmentInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR: {
+            deepcopy_VkPipelineFragmentShadingRateStateCreateInfoKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkPipelineFragmentShadingRateStateCreateInfoKHR*>(
+                    structExtension),
+                reinterpret_cast<VkPipelineFragmentShadingRateStateCreateInfoKHR*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR: {
+            deepcopy_VkPhysicalDeviceFragmentShadingRateFeaturesKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentShadingRateFeaturesKHR*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceFragmentShadingRateFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR: {
+            deepcopy_VkPhysicalDeviceFragmentShadingRatePropertiesKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentShadingRatePropertiesKHR*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceFragmentShadingRatePropertiesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_surface_protected_capabilities
+        case VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR: {
+            deepcopy_VkSurfaceProtectedCapabilitiesKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkSurfaceProtectedCapabilitiesKHR*>(structExtension),
+                reinterpret_cast<VkSurfaceProtectedCapabilitiesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_present_wait
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR: {
+            deepcopy_VkPhysicalDevicePresentWaitFeaturesKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDevicePresentWaitFeaturesKHR*>(structExtension),
+                reinterpret_cast<VkPhysicalDevicePresentWaitFeaturesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR: {
+            deepcopy_VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_integer_dot_product
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR: {
+            deepcopy_VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR: {
+            deepcopy_VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_present_id
+        case VK_STRUCTURE_TYPE_PRESENT_ID_KHR: {
+            deepcopy_VkPresentIdKHR(alloc, rootType,
+                                    reinterpret_cast<const VkPresentIdKHR*>(structExtension),
+                                    reinterpret_cast<VkPresentIdKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR: {
+            deepcopy_VkPhysicalDevicePresentIdFeaturesKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDevicePresentIdFeaturesKHR*>(structExtension),
+                reinterpret_cast<VkPhysicalDevicePresentIdFeaturesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_video_encode_queue
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_INFO_KHR: {
+            deepcopy_VkVideoEncodeRateControlInfoKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoEncodeRateControlInfoKHR*>(structExtension),
+                reinterpret_cast<VkVideoEncodeRateControlInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_synchronization2
+        case VK_STRUCTURE_TYPE_MEMORY_BARRIER_2_KHR: {
+            deepcopy_VkMemoryBarrier2KHR(
+                alloc, rootType, reinterpret_cast<const VkMemoryBarrier2KHR*>(structExtension),
+                reinterpret_cast<VkMemoryBarrier2KHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR: {
+            deepcopy_VkPhysicalDeviceSynchronization2FeaturesKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSynchronization2FeaturesKHR*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceSynchronization2FeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV: {
+            deepcopy_VkQueueFamilyCheckpointProperties2NV(
+                alloc, rootType,
+                reinterpret_cast<const VkQueueFamilyCheckpointProperties2NV*>(structExtension),
+                reinterpret_cast<VkQueueFamilyCheckpointProperties2NV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_subgroup_uniform_control_flow
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR: {
+            deepcopy_VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR(
+                alloc, rootType,
+                reinterpret_cast<
+                    const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_zero_initialize_workgroup_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES_KHR: {
+            deepcopy_VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_workgroup_memory_explicit_layout
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR: {
+            deepcopy_VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_format_feature_flags2
+        case VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3_KHR: {
+            deepcopy_VkFormatProperties3KHR(
+                alloc, rootType, reinterpret_cast<const VkFormatProperties3KHR*>(structExtension),
+                reinterpret_cast<VkFormatProperties3KHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_maintenance4
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES_KHR: {
+            deepcopy_VkPhysicalDeviceMaintenance4FeaturesKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMaintenance4FeaturesKHR*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceMaintenance4FeaturesKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES_KHR: {
+            deepcopy_VkPhysicalDeviceMaintenance4PropertiesKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMaintenance4PropertiesKHR*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceMaintenance4PropertiesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_ANDROID_native_buffer
+        case VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID: {
+            deepcopy_VkNativeBufferANDROID(
+                alloc, rootType, reinterpret_cast<const VkNativeBufferANDROID*>(structExtension),
+                reinterpret_cast<VkNativeBufferANDROID*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_debug_report
+        case VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT: {
+            deepcopy_VkDebugReportCallbackCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkDebugReportCallbackCreateInfoEXT*>(structExtension),
+                reinterpret_cast<VkDebugReportCallbackCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_rasterization_order
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD: {
+            deepcopy_VkPipelineRasterizationStateRasterizationOrderAMD(
+                alloc, rootType,
+                reinterpret_cast<const VkPipelineRasterizationStateRasterizationOrderAMD*>(
+                    structExtension),
+                reinterpret_cast<VkPipelineRasterizationStateRasterizationOrderAMD*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_dedicated_allocation
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV: {
+            deepcopy_VkDedicatedAllocationImageCreateInfoNV(
+                alloc, rootType,
+                reinterpret_cast<const VkDedicatedAllocationImageCreateInfoNV*>(structExtension),
+                reinterpret_cast<VkDedicatedAllocationImageCreateInfoNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV: {
+            deepcopy_VkDedicatedAllocationBufferCreateInfoNV(
+                alloc, rootType,
+                reinterpret_cast<const VkDedicatedAllocationBufferCreateInfoNV*>(structExtension),
+                reinterpret_cast<VkDedicatedAllocationBufferCreateInfoNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV: {
+            deepcopy_VkDedicatedAllocationMemoryAllocateInfoNV(
+                alloc, rootType,
+                reinterpret_cast<const VkDedicatedAllocationMemoryAllocateInfoNV*>(structExtension),
+                reinterpret_cast<VkDedicatedAllocationMemoryAllocateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_transform_feedback
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceTransformFeedbackFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceTransformFeedbackFeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceTransformFeedbackFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT: {
+            deepcopy_VkPhysicalDeviceTransformFeedbackPropertiesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceTransformFeedbackPropertiesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceTransformFeedbackPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT: {
+            deepcopy_VkPipelineRasterizationStateStreamCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPipelineRasterizationStateStreamCreateInfoEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPipelineRasterizationStateStreamCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_encode_h264
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_EXT: {
+            deepcopy_VkVideoEncodeH264CapabilitiesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoEncodeH264CapabilitiesEXT*>(structExtension),
+                reinterpret_cast<VkVideoEncodeH264CapabilitiesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_CREATE_INFO_EXT: {
+            deepcopy_VkVideoEncodeH264SessionCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoEncodeH264SessionCreateInfoEXT*>(structExtension),
+                reinterpret_cast<VkVideoEncodeH264SessionCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            deepcopy_VkVideoEncodeH264SessionParametersAddInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoEncodeH264SessionParametersAddInfoEXT*>(
+                    structExtension),
+                reinterpret_cast<VkVideoEncodeH264SessionParametersAddInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            deepcopy_VkVideoEncodeH264SessionParametersCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoEncodeH264SessionParametersCreateInfoEXT*>(
+                    structExtension),
+                reinterpret_cast<VkVideoEncodeH264SessionParametersCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_VCL_FRAME_INFO_EXT: {
+            deepcopy_VkVideoEncodeH264VclFrameInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoEncodeH264VclFrameInfoEXT*>(structExtension),
+                reinterpret_cast<VkVideoEncodeH264VclFrameInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_EMIT_PICTURE_PARAMETERS_EXT: {
+            deepcopy_VkVideoEncodeH264EmitPictureParametersEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoEncodeH264EmitPictureParametersEXT*>(structExtension),
+                reinterpret_cast<VkVideoEncodeH264EmitPictureParametersEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_EXT: {
+            deepcopy_VkVideoEncodeH264ProfileEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoEncodeH264ProfileEXT*>(structExtension),
+                reinterpret_cast<VkVideoEncodeH264ProfileEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_encode_h265
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_EXT: {
+            deepcopy_VkVideoEncodeH265CapabilitiesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoEncodeH265CapabilitiesEXT*>(structExtension),
+                reinterpret_cast<VkVideoEncodeH265CapabilitiesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_CREATE_INFO_EXT: {
+            deepcopy_VkVideoEncodeH265SessionCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoEncodeH265SessionCreateInfoEXT*>(structExtension),
+                reinterpret_cast<VkVideoEncodeH265SessionCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            deepcopy_VkVideoEncodeH265SessionParametersAddInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoEncodeH265SessionParametersAddInfoEXT*>(
+                    structExtension),
+                reinterpret_cast<VkVideoEncodeH265SessionParametersAddInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            deepcopy_VkVideoEncodeH265SessionParametersCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoEncodeH265SessionParametersCreateInfoEXT*>(
+                    structExtension),
+                reinterpret_cast<VkVideoEncodeH265SessionParametersCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_VCL_FRAME_INFO_EXT: {
+            deepcopy_VkVideoEncodeH265VclFrameInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoEncodeH265VclFrameInfoEXT*>(structExtension),
+                reinterpret_cast<VkVideoEncodeH265VclFrameInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_EMIT_PICTURE_PARAMETERS_EXT: {
+            deepcopy_VkVideoEncodeH265EmitPictureParametersEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoEncodeH265EmitPictureParametersEXT*>(structExtension),
+                reinterpret_cast<VkVideoEncodeH265EmitPictureParametersEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_EXT: {
+            deepcopy_VkVideoEncodeH265ProfileEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoEncodeH265ProfileEXT*>(structExtension),
+                reinterpret_cast<VkVideoEncodeH265ProfileEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_decode_h264
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_EXT: {
+            deepcopy_VkVideoDecodeH264ProfileEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoDecodeH264ProfileEXT*>(structExtension),
+                reinterpret_cast<VkVideoDecodeH264ProfileEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_EXT: {
+            deepcopy_VkVideoDecodeH264CapabilitiesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoDecodeH264CapabilitiesEXT*>(structExtension),
+                reinterpret_cast<VkVideoDecodeH264CapabilitiesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_CREATE_INFO_EXT: {
+            deepcopy_VkVideoDecodeH264SessionCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoDecodeH264SessionCreateInfoEXT*>(structExtension),
+                reinterpret_cast<VkVideoDecodeH264SessionCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            deepcopy_VkVideoDecodeH264SessionParametersAddInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoDecodeH264SessionParametersAddInfoEXT*>(
+                    structExtension),
+                reinterpret_cast<VkVideoDecodeH264SessionParametersAddInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            deepcopy_VkVideoDecodeH264SessionParametersCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoDecodeH264SessionParametersCreateInfoEXT*>(
+                    structExtension),
+                reinterpret_cast<VkVideoDecodeH264SessionParametersCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PICTURE_INFO_EXT: {
+            deepcopy_VkVideoDecodeH264PictureInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoDecodeH264PictureInfoEXT*>(structExtension),
+                reinterpret_cast<VkVideoDecodeH264PictureInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_MVC_EXT: {
+            deepcopy_VkVideoDecodeH264MvcEXT(
+                alloc, rootType, reinterpret_cast<const VkVideoDecodeH264MvcEXT*>(structExtension),
+                reinterpret_cast<VkVideoDecodeH264MvcEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_EXT: {
+            deepcopy_VkVideoDecodeH264DpbSlotInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoDecodeH264DpbSlotInfoEXT*>(structExtension),
+                reinterpret_cast<VkVideoDecodeH264DpbSlotInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_texture_gather_bias_lod
+        case VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD: {
+            deepcopy_VkTextureLODGatherFormatPropertiesAMD(
+                alloc, rootType,
+                reinterpret_cast<const VkTextureLODGatherFormatPropertiesAMD*>(structExtension),
+                reinterpret_cast<VkTextureLODGatherFormatPropertiesAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_corner_sampled_image
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV: {
+            deepcopy_VkPhysicalDeviceCornerSampledImageFeaturesNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceCornerSampledImageFeaturesNV*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceCornerSampledImageFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_external_memory
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV: {
+            deepcopy_VkExternalMemoryImageCreateInfoNV(
+                alloc, rootType,
+                reinterpret_cast<const VkExternalMemoryImageCreateInfoNV*>(structExtension),
+                reinterpret_cast<VkExternalMemoryImageCreateInfoNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV: {
+            deepcopy_VkExportMemoryAllocateInfoNV(
+                alloc, rootType,
+                reinterpret_cast<const VkExportMemoryAllocateInfoNV*>(structExtension),
+                reinterpret_cast<VkExportMemoryAllocateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_external_memory_win32
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV: {
+            deepcopy_VkImportMemoryWin32HandleInfoNV(
+                alloc, rootType,
+                reinterpret_cast<const VkImportMemoryWin32HandleInfoNV*>(structExtension),
+                reinterpret_cast<VkImportMemoryWin32HandleInfoNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV: {
+            deepcopy_VkExportMemoryWin32HandleInfoNV(
+                alloc, rootType,
+                reinterpret_cast<const VkExportMemoryWin32HandleInfoNV*>(structExtension),
+                reinterpret_cast<VkExportMemoryWin32HandleInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_win32_keyed_mutex
+        case VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV: {
+            deepcopy_VkWin32KeyedMutexAcquireReleaseInfoNV(
+                alloc, rootType,
+                reinterpret_cast<const VkWin32KeyedMutexAcquireReleaseInfoNV*>(structExtension),
+                reinterpret_cast<VkWin32KeyedMutexAcquireReleaseInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_validation_flags
+        case VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT: {
+            deepcopy_VkValidationFlagsEXT(
+                alloc, rootType, reinterpret_cast<const VkValidationFlagsEXT*>(structExtension),
+                reinterpret_cast<VkValidationFlagsEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_texture_compression_astc_hdr
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_astc_decode_mode
+        case VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT: {
+            deepcopy_VkImageViewASTCDecodeModeEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkImageViewASTCDecodeModeEXT*>(structExtension),
+                reinterpret_cast<VkImageViewASTCDecodeModeEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceASTCDecodeFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceASTCDecodeFeaturesEXT*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceASTCDecodeFeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_conditional_rendering
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceConditionalRenderingFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceConditionalRenderingFeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceConditionalRenderingFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT: {
+            deepcopy_VkCommandBufferInheritanceConditionalRenderingInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkCommandBufferInheritanceConditionalRenderingInfoEXT*>(
+                    structExtension),
+                reinterpret_cast<VkCommandBufferInheritanceConditionalRenderingInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV: {
+            deepcopy_VkPipelineViewportWScalingStateCreateInfoNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPipelineViewportWScalingStateCreateInfoNV*>(
+                    structExtension),
+                reinterpret_cast<VkPipelineViewportWScalingStateCreateInfoNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_display_control
+        case VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT: {
+            deepcopy_VkSwapchainCounterCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkSwapchainCounterCreateInfoEXT*>(structExtension),
+                reinterpret_cast<VkSwapchainCounterCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_GOOGLE_display_timing
+        case VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE: {
+            deepcopy_VkPresentTimesInfoGOOGLE(
+                alloc, rootType, reinterpret_cast<const VkPresentTimesInfoGOOGLE*>(structExtension),
+                reinterpret_cast<VkPresentTimesInfoGOOGLE*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NVX_multiview_per_view_attributes
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX: {
+            deepcopy_VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_viewport_swizzle
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV: {
+            deepcopy_VkPipelineViewportSwizzleStateCreateInfoNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPipelineViewportSwizzleStateCreateInfoNV*>(
+                    structExtension),
+                reinterpret_cast<VkPipelineViewportSwizzleStateCreateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_discard_rectangles
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT: {
+            deepcopy_VkPhysicalDeviceDiscardRectanglePropertiesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDiscardRectanglePropertiesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceDiscardRectanglePropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT: {
+            deepcopy_VkPipelineDiscardRectangleStateCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPipelineDiscardRectangleStateCreateInfoEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPipelineDiscardRectangleStateCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_conservative_rasterization
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT: {
+            deepcopy_VkPhysicalDeviceConservativeRasterizationPropertiesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceConservativeRasterizationPropertiesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceConservativeRasterizationPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT: {
+            deepcopy_VkPipelineRasterizationConservativeStateCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPipelineRasterizationConservativeStateCreateInfoEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPipelineRasterizationConservativeStateCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_depth_clip_enable
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceDepthClipEnableFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDepthClipEnableFeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceDepthClipEnableFeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT: {
+            deepcopy_VkPipelineRasterizationDepthClipStateCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPipelineRasterizationDepthClipStateCreateInfoEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPipelineRasterizationDepthClipStateCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_debug_utils
+        case VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT: {
+            deepcopy_VkDebugUtilsMessengerCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkDebugUtilsMessengerCreateInfoEXT*>(structExtension),
+                reinterpret_cast<VkDebugUtilsMessengerCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID: {
+            deepcopy_VkAndroidHardwareBufferUsageANDROID(
+                alloc, rootType,
+                reinterpret_cast<const VkAndroidHardwareBufferUsageANDROID*>(structExtension),
+                reinterpret_cast<VkAndroidHardwareBufferUsageANDROID*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID: {
+            deepcopy_VkAndroidHardwareBufferFormatPropertiesANDROID(
+                alloc, rootType,
+                reinterpret_cast<const VkAndroidHardwareBufferFormatPropertiesANDROID*>(
+                    structExtension),
+                reinterpret_cast<VkAndroidHardwareBufferFormatPropertiesANDROID*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID: {
+            deepcopy_VkImportAndroidHardwareBufferInfoANDROID(
+                alloc, rootType,
+                reinterpret_cast<const VkImportAndroidHardwareBufferInfoANDROID*>(structExtension),
+                reinterpret_cast<VkImportAndroidHardwareBufferInfoANDROID*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID: {
+            deepcopy_VkExternalFormatANDROID(
+                alloc, rootType, reinterpret_cast<const VkExternalFormatANDROID*>(structExtension),
+                reinterpret_cast<VkExternalFormatANDROID*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID: {
+            deepcopy_VkAndroidHardwareBufferFormatProperties2ANDROID(
+                alloc, rootType,
+                reinterpret_cast<const VkAndroidHardwareBufferFormatProperties2ANDROID*>(
+                    structExtension),
+                reinterpret_cast<VkAndroidHardwareBufferFormatProperties2ANDROID*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_inline_uniform_block
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceInlineUniformBlockFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceInlineUniformBlockFeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceInlineUniformBlockFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT: {
+            deepcopy_VkPhysicalDeviceInlineUniformBlockPropertiesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceInlineUniformBlockPropertiesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceInlineUniformBlockPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT: {
+            deepcopy_VkWriteDescriptorSetInlineUniformBlockEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkWriteDescriptorSetInlineUniformBlockEXT*>(structExtension),
+                reinterpret_cast<VkWriteDescriptorSetInlineUniformBlockEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO_EXT: {
+            deepcopy_VkDescriptorPoolInlineUniformBlockCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkDescriptorPoolInlineUniformBlockCreateInfoEXT*>(
+                    structExtension),
+                reinterpret_cast<VkDescriptorPoolInlineUniformBlockCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_sample_locations
+        case VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT: {
+            deepcopy_VkSampleLocationsInfoEXT(
+                alloc, rootType, reinterpret_cast<const VkSampleLocationsInfoEXT*>(structExtension),
+                reinterpret_cast<VkSampleLocationsInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT: {
+            deepcopy_VkRenderPassSampleLocationsBeginInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkRenderPassSampleLocationsBeginInfoEXT*>(structExtension),
+                reinterpret_cast<VkRenderPassSampleLocationsBeginInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT: {
+            deepcopy_VkPipelineSampleLocationsStateCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPipelineSampleLocationsStateCreateInfoEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPipelineSampleLocationsStateCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT: {
+            deepcopy_VkPhysicalDeviceSampleLocationsPropertiesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSampleLocationsPropertiesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceSampleLocationsPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_blend_operation_advanced
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT: {
+            deepcopy_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT: {
+            deepcopy_VkPipelineColorBlendAdvancedStateCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPipelineColorBlendAdvancedStateCreateInfoEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPipelineColorBlendAdvancedStateCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_fragment_coverage_to_color
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV: {
+            deepcopy_VkPipelineCoverageToColorStateCreateInfoNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPipelineCoverageToColorStateCreateInfoNV*>(
+                    structExtension),
+                reinterpret_cast<VkPipelineCoverageToColorStateCreateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_framebuffer_mixed_samples
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV: {
+            deepcopy_VkPipelineCoverageModulationStateCreateInfoNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPipelineCoverageModulationStateCreateInfoNV*>(
+                    structExtension),
+                reinterpret_cast<VkPipelineCoverageModulationStateCreateInfoNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_shader_sm_builtins
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV: {
+            deepcopy_VkPhysicalDeviceShaderSMBuiltinsPropertiesNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderSMBuiltinsPropertiesNV*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceShaderSMBuiltinsPropertiesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV: {
+            deepcopy_VkPhysicalDeviceShaderSMBuiltinsFeaturesNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderSMBuiltinsFeaturesNV*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceShaderSMBuiltinsFeaturesNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+        case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT: {
+            deepcopy_VkDrmFormatModifierPropertiesListEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkDrmFormatModifierPropertiesListEXT*>(structExtension),
+                reinterpret_cast<VkDrmFormatModifierPropertiesListEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT: {
+            deepcopy_VkPhysicalDeviceImageDrmFormatModifierInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceImageDrmFormatModifierInfoEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceImageDrmFormatModifierInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT: {
+            deepcopy_VkImageDrmFormatModifierListCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkImageDrmFormatModifierListCreateInfoEXT*>(structExtension),
+                reinterpret_cast<VkImageDrmFormatModifierListCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT: {
+            deepcopy_VkImageDrmFormatModifierExplicitCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkImageDrmFormatModifierExplicitCreateInfoEXT*>(
+                    structExtension),
+                reinterpret_cast<VkImageDrmFormatModifierExplicitCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT: {
+            deepcopy_VkDrmFormatModifierPropertiesList2EXT(
+                alloc, rootType,
+                reinterpret_cast<const VkDrmFormatModifierPropertiesList2EXT*>(structExtension),
+                reinterpret_cast<VkDrmFormatModifierPropertiesList2EXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_validation_cache
+        case VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT: {
+            deepcopy_VkShaderModuleValidationCacheCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkShaderModuleValidationCacheCreateInfoEXT*>(
+                    structExtension),
+                reinterpret_cast<VkShaderModuleValidationCacheCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_shading_rate_image
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV: {
+            deepcopy_VkPipelineViewportShadingRateImageStateCreateInfoNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPipelineViewportShadingRateImageStateCreateInfoNV*>(
+                    structExtension),
+                reinterpret_cast<VkPipelineViewportShadingRateImageStateCreateInfoNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV: {
+            deepcopy_VkPhysicalDeviceShadingRateImageFeaturesNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShadingRateImageFeaturesNV*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceShadingRateImageFeaturesNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV: {
+            deepcopy_VkPhysicalDeviceShadingRateImagePropertiesNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShadingRateImagePropertiesNV*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceShadingRateImagePropertiesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV: {
+            deepcopy_VkPipelineViewportCoarseSampleOrderStateCreateInfoNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPipelineViewportCoarseSampleOrderStateCreateInfoNV*>(
+                    structExtension),
+                reinterpret_cast<VkPipelineViewportCoarseSampleOrderStateCreateInfoNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_ray_tracing
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV: {
+            deepcopy_VkWriteDescriptorSetAccelerationStructureNV(
+                alloc, rootType,
+                reinterpret_cast<const VkWriteDescriptorSetAccelerationStructureNV*>(
+                    structExtension),
+                reinterpret_cast<VkWriteDescriptorSetAccelerationStructureNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV: {
+            deepcopy_VkPhysicalDeviceRayTracingPropertiesNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRayTracingPropertiesNV*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceRayTracingPropertiesNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_representative_fragment_test
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV: {
+            deepcopy_VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV: {
+            deepcopy_VkPipelineRepresentativeFragmentTestStateCreateInfoNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPipelineRepresentativeFragmentTestStateCreateInfoNV*>(
+                    structExtension),
+                reinterpret_cast<VkPipelineRepresentativeFragmentTestStateCreateInfoNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_filter_cubic
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT: {
+            deepcopy_VkPhysicalDeviceImageViewImageFormatInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceImageViewImageFormatInfoEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceImageViewImageFormatInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT: {
+            deepcopy_VkFilterCubicImageViewImageFormatPropertiesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkFilterCubicImageViewImageFormatPropertiesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkFilterCubicImageViewImageFormatPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_global_priority
+        case VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT: {
+            deepcopy_VkDeviceQueueGlobalPriorityCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkDeviceQueueGlobalPriorityCreateInfoEXT*>(structExtension),
+                reinterpret_cast<VkDeviceQueueGlobalPriorityCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_external_memory_host
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT: {
+            deepcopy_VkImportMemoryHostPointerInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkImportMemoryHostPointerInfoEXT*>(structExtension),
+                reinterpret_cast<VkImportMemoryHostPointerInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT: {
+            deepcopy_VkPhysicalDeviceExternalMemoryHostPropertiesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceExternalMemoryHostPropertiesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceExternalMemoryHostPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_pipeline_compiler_control
+        case VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD: {
+            deepcopy_VkPipelineCompilerControlCreateInfoAMD(
+                alloc, rootType,
+                reinterpret_cast<const VkPipelineCompilerControlCreateInfoAMD*>(structExtension),
+                reinterpret_cast<VkPipelineCompilerControlCreateInfoAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_shader_core_properties
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD: {
+            deepcopy_VkPhysicalDeviceShaderCorePropertiesAMD(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderCorePropertiesAMD*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceShaderCorePropertiesAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_decode_h265
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_EXT: {
+            deepcopy_VkVideoDecodeH265ProfileEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoDecodeH265ProfileEXT*>(structExtension),
+                reinterpret_cast<VkVideoDecodeH265ProfileEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_EXT: {
+            deepcopy_VkVideoDecodeH265CapabilitiesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoDecodeH265CapabilitiesEXT*>(structExtension),
+                reinterpret_cast<VkVideoDecodeH265CapabilitiesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_CREATE_INFO_EXT: {
+            deepcopy_VkVideoDecodeH265SessionCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoDecodeH265SessionCreateInfoEXT*>(structExtension),
+                reinterpret_cast<VkVideoDecodeH265SessionCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            deepcopy_VkVideoDecodeH265SessionParametersAddInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoDecodeH265SessionParametersAddInfoEXT*>(
+                    structExtension),
+                reinterpret_cast<VkVideoDecodeH265SessionParametersAddInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            deepcopy_VkVideoDecodeH265SessionParametersCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoDecodeH265SessionParametersCreateInfoEXT*>(
+                    structExtension),
+                reinterpret_cast<VkVideoDecodeH265SessionParametersCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PICTURE_INFO_EXT: {
+            deepcopy_VkVideoDecodeH265PictureInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoDecodeH265PictureInfoEXT*>(structExtension),
+                reinterpret_cast<VkVideoDecodeH265PictureInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_EXT: {
+            deepcopy_VkVideoDecodeH265DpbSlotInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkVideoDecodeH265DpbSlotInfoEXT*>(structExtension),
+                reinterpret_cast<VkVideoDecodeH265DpbSlotInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_memory_overallocation_behavior
+        case VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD: {
+            deepcopy_VkDeviceMemoryOverallocationCreateInfoAMD(
+                alloc, rootType,
+                reinterpret_cast<const VkDeviceMemoryOverallocationCreateInfoAMD*>(structExtension),
+                reinterpret_cast<VkDeviceMemoryOverallocationCreateInfoAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_vertex_attribute_divisor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT: {
+            deepcopy_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT: {
+            deepcopy_VkPipelineVertexInputDivisorStateCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPipelineVertexInputDivisorStateCreateInfoEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPipelineVertexInputDivisorStateCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_GGP_frame_token
+        case VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP: {
+            deepcopy_VkPresentFrameTokenGGP(
+                alloc, rootType, reinterpret_cast<const VkPresentFrameTokenGGP*>(structExtension),
+                reinterpret_cast<VkPresentFrameTokenGGP*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_pipeline_creation_feedback
+        case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT: {
+            deepcopy_VkPipelineCreationFeedbackCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPipelineCreationFeedbackCreateInfoEXT*>(structExtension),
+                reinterpret_cast<VkPipelineCreationFeedbackCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_compute_shader_derivatives
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV: {
+            deepcopy_VkPhysicalDeviceComputeShaderDerivativesFeaturesNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceComputeShaderDerivativesFeaturesNV*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceComputeShaderDerivativesFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_mesh_shader
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV: {
+            deepcopy_VkPhysicalDeviceMeshShaderFeaturesNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMeshShaderFeaturesNV*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceMeshShaderFeaturesNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV: {
+            deepcopy_VkPhysicalDeviceMeshShaderPropertiesNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMeshShaderPropertiesNV*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceMeshShaderPropertiesNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_fragment_shader_barycentric
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV: {
+            deepcopy_VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_shader_image_footprint
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV: {
+            deepcopy_VkPhysicalDeviceShaderImageFootprintFeaturesNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderImageFootprintFeaturesNV*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceShaderImageFootprintFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_scissor_exclusive
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV: {
+            deepcopy_VkPipelineViewportExclusiveScissorStateCreateInfoNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPipelineViewportExclusiveScissorStateCreateInfoNV*>(
+                    structExtension),
+                reinterpret_cast<VkPipelineViewportExclusiveScissorStateCreateInfoNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV: {
+            deepcopy_VkPhysicalDeviceExclusiveScissorFeaturesNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceExclusiveScissorFeaturesNV*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceExclusiveScissorFeaturesNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV: {
+            deepcopy_VkQueueFamilyCheckpointPropertiesNV(
+                alloc, rootType,
+                reinterpret_cast<const VkQueueFamilyCheckpointPropertiesNV*>(structExtension),
+                reinterpret_cast<VkQueueFamilyCheckpointPropertiesNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_INTEL_shader_integer_functions2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL: {
+            deepcopy_VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_INTEL_performance_query
+        case VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL: {
+            deepcopy_VkQueryPoolPerformanceQueryCreateInfoINTEL(
+                alloc, rootType,
+                reinterpret_cast<const VkQueryPoolPerformanceQueryCreateInfoINTEL*>(
+                    structExtension),
+                reinterpret_cast<VkQueryPoolPerformanceQueryCreateInfoINTEL*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_pci_bus_info
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT: {
+            deepcopy_VkPhysicalDevicePCIBusInfoPropertiesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDevicePCIBusInfoPropertiesEXT*>(structExtension),
+                reinterpret_cast<VkPhysicalDevicePCIBusInfoPropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_display_native_hdr
+        case VK_STRUCTURE_TYPE_DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD: {
+            deepcopy_VkDisplayNativeHdrSurfaceCapabilitiesAMD(
+                alloc, rootType,
+                reinterpret_cast<const VkDisplayNativeHdrSurfaceCapabilitiesAMD*>(structExtension),
+                reinterpret_cast<VkDisplayNativeHdrSurfaceCapabilitiesAMD*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD: {
+            deepcopy_VkSwapchainDisplayNativeHdrCreateInfoAMD(
+                alloc, rootType,
+                reinterpret_cast<const VkSwapchainDisplayNativeHdrCreateInfoAMD*>(structExtension),
+                reinterpret_cast<VkSwapchainDisplayNativeHdrCreateInfoAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_fragment_density_map
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT: {
+            switch (rootType) {
+                case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: {
+                    deepcopy_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+                        alloc, rootType,
+                        reinterpret_cast<const VkPhysicalDeviceFragmentDensityMapFeaturesEXT*>(
+                            structExtension),
+                        reinterpret_cast<VkPhysicalDeviceFragmentDensityMapFeaturesEXT*>(
+                            structExtension_out));
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO: {
+                    deepcopy_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+                        alloc, rootType,
+                        reinterpret_cast<const VkPhysicalDeviceFragmentDensityMapFeaturesEXT*>(
+                            structExtension),
+                        reinterpret_cast<VkPhysicalDeviceFragmentDensityMapFeaturesEXT*>(
+                            structExtension_out));
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO: {
+                    deepcopy_VkImportColorBufferGOOGLE(
+                        alloc, rootType,
+                        reinterpret_cast<const VkImportColorBufferGOOGLE*>(structExtension),
+                        reinterpret_cast<VkImportColorBufferGOOGLE*>(structExtension_out));
+                    break;
+                }
+                default: {
+                    deepcopy_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+                        alloc, rootType,
+                        reinterpret_cast<const VkPhysicalDeviceFragmentDensityMapFeaturesEXT*>(
+                            structExtension),
+                        reinterpret_cast<VkPhysicalDeviceFragmentDensityMapFeaturesEXT*>(
+                            structExtension_out));
+                    break;
+                }
+            }
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT: {
+            switch (rootType) {
+                case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2: {
+                    deepcopy_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
+                        alloc, rootType,
+                        reinterpret_cast<const VkPhysicalDeviceFragmentDensityMapPropertiesEXT*>(
+                            structExtension),
+                        reinterpret_cast<VkPhysicalDeviceFragmentDensityMapPropertiesEXT*>(
+                            structExtension_out));
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO: {
+                    deepcopy_VkCreateBlobGOOGLE(
+                        alloc, rootType,
+                        reinterpret_cast<const VkCreateBlobGOOGLE*>(structExtension),
+                        reinterpret_cast<VkCreateBlobGOOGLE*>(structExtension_out));
+                    break;
+                }
+                default: {
+                    deepcopy_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
+                        alloc, rootType,
+                        reinterpret_cast<const VkPhysicalDeviceFragmentDensityMapPropertiesEXT*>(
+                            structExtension),
+                        reinterpret_cast<VkPhysicalDeviceFragmentDensityMapPropertiesEXT*>(
+                            structExtension_out));
+                    break;
+                }
+            }
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT: {
+            switch (rootType) {
+                case VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO: {
+                    deepcopy_VkRenderPassFragmentDensityMapCreateInfoEXT(
+                        alloc, rootType,
+                        reinterpret_cast<const VkRenderPassFragmentDensityMapCreateInfoEXT*>(
+                            structExtension),
+                        reinterpret_cast<VkRenderPassFragmentDensityMapCreateInfoEXT*>(
+                            structExtension_out));
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2: {
+                    deepcopy_VkRenderPassFragmentDensityMapCreateInfoEXT(
+                        alloc, rootType,
+                        reinterpret_cast<const VkRenderPassFragmentDensityMapCreateInfoEXT*>(
+                            structExtension),
+                        reinterpret_cast<VkRenderPassFragmentDensityMapCreateInfoEXT*>(
+                            structExtension_out));
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO: {
+                    deepcopy_VkImportBufferGOOGLE(
+                        alloc, rootType,
+                        reinterpret_cast<const VkImportBufferGOOGLE*>(structExtension),
+                        reinterpret_cast<VkImportBufferGOOGLE*>(structExtension_out));
+                    break;
+                }
+                default: {
+                    deepcopy_VkRenderPassFragmentDensityMapCreateInfoEXT(
+                        alloc, rootType,
+                        reinterpret_cast<const VkRenderPassFragmentDensityMapCreateInfoEXT*>(
+                            structExtension),
+                        reinterpret_cast<VkRenderPassFragmentDensityMapCreateInfoEXT*>(
+                            structExtension_out));
+                    break;
+                }
+            }
+            break;
+        }
+#endif
+#ifdef VK_EXT_subgroup_size_control
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceSubgroupSizeControlFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSubgroupSizeControlFeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceSubgroupSizeControlFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT: {
+            deepcopy_VkPhysicalDeviceSubgroupSizeControlPropertiesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSubgroupSizeControlPropertiesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceSubgroupSizeControlPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT: {
+            deepcopy_VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_shader_core_properties2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD: {
+            deepcopy_VkPhysicalDeviceShaderCoreProperties2AMD(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderCoreProperties2AMD*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceShaderCoreProperties2AMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_device_coherent_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD: {
+            deepcopy_VkPhysicalDeviceCoherentMemoryFeaturesAMD(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceCoherentMemoryFeaturesAMD*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceCoherentMemoryFeaturesAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_image_atomic_int64
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_memory_budget
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT: {
+            deepcopy_VkPhysicalDeviceMemoryBudgetPropertiesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMemoryBudgetPropertiesEXT*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceMemoryBudgetPropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_memory_priority
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceMemoryPriorityFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMemoryPriorityFeaturesEXT*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceMemoryPriorityFeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT: {
+            deepcopy_VkMemoryPriorityAllocateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkMemoryPriorityAllocateInfoEXT*>(structExtension),
+                reinterpret_cast<VkMemoryPriorityAllocateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_dedicated_allocation_image_aliasing
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV: {
+            deepcopy_VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_buffer_device_address
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceBufferDeviceAddressFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT: {
+            deepcopy_VkBufferDeviceAddressCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkBufferDeviceAddressCreateInfoEXT*>(structExtension),
+                reinterpret_cast<VkBufferDeviceAddressCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_validation_features
+        case VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT: {
+            deepcopy_VkValidationFeaturesEXT(
+                alloc, rootType, reinterpret_cast<const VkValidationFeaturesEXT*>(structExtension),
+                reinterpret_cast<VkValidationFeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_cooperative_matrix
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV: {
+            deepcopy_VkPhysicalDeviceCooperativeMatrixFeaturesNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceCooperativeMatrixFeaturesNV*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceCooperativeMatrixFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV: {
+            deepcopy_VkPhysicalDeviceCooperativeMatrixPropertiesNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceCooperativeMatrixPropertiesNV*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceCooperativeMatrixPropertiesNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV: {
+            deepcopy_VkPhysicalDeviceCoverageReductionModeFeaturesNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceCoverageReductionModeFeaturesNV*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceCoverageReductionModeFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV: {
+            deepcopy_VkPipelineCoverageReductionStateCreateInfoNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPipelineCoverageReductionStateCreateInfoNV*>(
+                    structExtension),
+                reinterpret_cast<VkPipelineCoverageReductionStateCreateInfoNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_fragment_shader_interlock
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_ycbcr_image_arrays
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceYcbcrImageArraysFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceYcbcrImageArraysFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_provoking_vertex
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceProvokingVertexFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceProvokingVertexFeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceProvokingVertexFeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT: {
+            deepcopy_VkPhysicalDeviceProvokingVertexPropertiesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceProvokingVertexPropertiesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceProvokingVertexPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT: {
+            deepcopy_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPipelineRasterizationProvokingVertexStateCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+        case VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT: {
+            deepcopy_VkSurfaceFullScreenExclusiveInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkSurfaceFullScreenExclusiveInfoEXT*>(structExtension),
+                reinterpret_cast<VkSurfaceFullScreenExclusiveInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT: {
+            deepcopy_VkSurfaceCapabilitiesFullScreenExclusiveEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkSurfaceCapabilitiesFullScreenExclusiveEXT*>(
+                    structExtension),
+                reinterpret_cast<VkSurfaceCapabilitiesFullScreenExclusiveEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT: {
+            deepcopy_VkSurfaceFullScreenExclusiveWin32InfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkSurfaceFullScreenExclusiveWin32InfoEXT*>(structExtension),
+                reinterpret_cast<VkSurfaceFullScreenExclusiveWin32InfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_line_rasterization
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceLineRasterizationFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceLineRasterizationFeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceLineRasterizationFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT: {
+            deepcopy_VkPhysicalDeviceLineRasterizationPropertiesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceLineRasterizationPropertiesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceLineRasterizationPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT: {
+            deepcopy_VkPipelineRasterizationLineStateCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPipelineRasterizationLineStateCreateInfoEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPipelineRasterizationLineStateCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_atomic_float
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceShaderAtomicFloatFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceShaderAtomicFloatFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_index_type_uint8
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceIndexTypeUint8FeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceIndexTypeUint8FeaturesEXT*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceIndexTypeUint8FeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceExtendedDynamicStateFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceExtendedDynamicStateFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_atomic_float2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_demote_to_helper_invocation
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_device_generated_commands
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV: {
+            deepcopy_VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV: {
+            deepcopy_VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV: {
+            deepcopy_VkGraphicsPipelineShaderGroupsCreateInfoNV(
+                alloc, rootType,
+                reinterpret_cast<const VkGraphicsPipelineShaderGroupsCreateInfoNV*>(
+                    structExtension),
+                reinterpret_cast<VkGraphicsPipelineShaderGroupsCreateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_inherited_viewport_scissor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV: {
+            deepcopy_VkPhysicalDeviceInheritedViewportScissorFeaturesNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceInheritedViewportScissorFeaturesNV*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceInheritedViewportScissorFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV: {
+            deepcopy_VkCommandBufferInheritanceViewportScissorInfoNV(
+                alloc, rootType,
+                reinterpret_cast<const VkCommandBufferInheritanceViewportScissorInfoNV*>(
+                    structExtension),
+                reinterpret_cast<VkCommandBufferInheritanceViewportScissorInfoNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_texel_buffer_alignment
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT: {
+            deepcopy_VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_QCOM_render_pass_transform
+        case VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM: {
+            deepcopy_VkRenderPassTransformBeginInfoQCOM(
+                alloc, rootType,
+                reinterpret_cast<const VkRenderPassTransformBeginInfoQCOM*>(structExtension),
+                reinterpret_cast<VkRenderPassTransformBeginInfoQCOM*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM: {
+            deepcopy_VkCommandBufferInheritanceRenderPassTransformInfoQCOM(
+                alloc, rootType,
+                reinterpret_cast<const VkCommandBufferInheritanceRenderPassTransformInfoQCOM*>(
+                    structExtension),
+                reinterpret_cast<VkCommandBufferInheritanceRenderPassTransformInfoQCOM*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_device_memory_report
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceDeviceMemoryReportFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDeviceMemoryReportFeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceDeviceMemoryReportFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT: {
+            deepcopy_VkDeviceDeviceMemoryReportCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkDeviceDeviceMemoryReportCreateInfoEXT*>(structExtension),
+                reinterpret_cast<VkDeviceDeviceMemoryReportCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_robustness2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceRobustness2FeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRobustness2FeaturesEXT*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceRobustness2FeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT: {
+            deepcopy_VkPhysicalDeviceRobustness2PropertiesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRobustness2PropertiesEXT*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceRobustness2PropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_custom_border_color
+        case VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT: {
+            deepcopy_VkSamplerCustomBorderColorCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkSamplerCustomBorderColorCreateInfoEXT*>(structExtension),
+                reinterpret_cast<VkSamplerCustomBorderColorCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT: {
+            deepcopy_VkPhysicalDeviceCustomBorderColorPropertiesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceCustomBorderColorPropertiesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceCustomBorderColorPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceCustomBorderColorFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceCustomBorderColorFeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceCustomBorderColorFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_private_data
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT: {
+            deepcopy_VkPhysicalDevicePrivateDataFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDevicePrivateDataFeaturesEXT*>(structExtension),
+                reinterpret_cast<VkPhysicalDevicePrivateDataFeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO_EXT: {
+            deepcopy_VkDevicePrivateDataCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkDevicePrivateDataCreateInfoEXT*>(structExtension),
+                reinterpret_cast<VkDevicePrivateDataCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_pipeline_creation_cache_control
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES_EXT: {
+            deepcopy_VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_device_diagnostics_config
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV: {
+            deepcopy_VkPhysicalDeviceDiagnosticsConfigFeaturesNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDiagnosticsConfigFeaturesNV*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceDiagnosticsConfigFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV: {
+            deepcopy_VkDeviceDiagnosticsConfigCreateInfoNV(
+                alloc, rootType,
+                reinterpret_cast<const VkDeviceDiagnosticsConfigCreateInfoNV*>(structExtension),
+                reinterpret_cast<VkDeviceDiagnosticsConfigCreateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV: {
+            deepcopy_VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV: {
+            deepcopy_VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV: {
+            deepcopy_VkPipelineFragmentShadingRateEnumStateCreateInfoNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPipelineFragmentShadingRateEnumStateCreateInfoNV*>(
+                    structExtension),
+                reinterpret_cast<VkPipelineFragmentShadingRateEnumStateCreateInfoNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_ray_tracing_motion_blur
+        case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV: {
+            deepcopy_VkAccelerationStructureGeometryMotionTrianglesDataNV(
+                alloc, rootType,
+                reinterpret_cast<const VkAccelerationStructureGeometryMotionTrianglesDataNV*>(
+                    structExtension),
+                reinterpret_cast<VkAccelerationStructureGeometryMotionTrianglesDataNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV: {
+            deepcopy_VkAccelerationStructureMotionInfoNV(
+                alloc, rootType,
+                reinterpret_cast<const VkAccelerationStructureMotionInfoNV*>(structExtension),
+                reinterpret_cast<VkAccelerationStructureMotionInfoNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV: {
+            deepcopy_VkPhysicalDeviceRayTracingMotionBlurFeaturesNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRayTracingMotionBlurFeaturesNV*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceRayTracingMotionBlurFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_ycbcr_2plane_444_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_fragment_density_map2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceFragmentDensityMap2FeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceFragmentDensityMap2FeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT: {
+            deepcopy_VkPhysicalDeviceFragmentDensityMap2PropertiesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentDensityMap2PropertiesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceFragmentDensityMap2PropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_QCOM_rotated_copy_commands
+        case VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM: {
+            deepcopy_VkCopyCommandTransformInfoQCOM(
+                alloc, rootType,
+                reinterpret_cast<const VkCopyCommandTransformInfoQCOM*>(structExtension),
+                reinterpret_cast<VkCopyCommandTransformInfoQCOM*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_image_robustness
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceImageRobustnessFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceImageRobustnessFeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceImageRobustnessFeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_4444_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT: {
+            deepcopy_VkPhysicalDevice4444FormatsFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDevice4444FormatsFeaturesEXT*>(structExtension),
+                reinterpret_cast<VkPhysicalDevice4444FormatsFeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_rgba10x6_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_VALVE_mutable_descriptor_type
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE: {
+            deepcopy_VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE: {
+            deepcopy_VkMutableDescriptorTypeCreateInfoVALVE(
+                alloc, rootType,
+                reinterpret_cast<const VkMutableDescriptorTypeCreateInfoVALVE*>(structExtension),
+                reinterpret_cast<VkMutableDescriptorTypeCreateInfoVALVE*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_physical_device_drm
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT: {
+            deepcopy_VkPhysicalDeviceDrmPropertiesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDrmPropertiesEXT*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceDrmPropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_primitive_topology_list_restart
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT: {
+            deepcopy_VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_FUCHSIA_external_memory
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA: {
+            deepcopy_VkImportMemoryZirconHandleInfoFUCHSIA(
+                alloc, rootType,
+                reinterpret_cast<const VkImportMemoryZirconHandleInfoFUCHSIA*>(structExtension),
+                reinterpret_cast<VkImportMemoryZirconHandleInfoFUCHSIA*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA: {
+            deepcopy_VkImportMemoryBufferCollectionFUCHSIA(
+                alloc, rootType,
+                reinterpret_cast<const VkImportMemoryBufferCollectionFUCHSIA*>(structExtension),
+                reinterpret_cast<VkImportMemoryBufferCollectionFUCHSIA*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA: {
+            deepcopy_VkBufferCollectionImageCreateInfoFUCHSIA(
+                alloc, rootType,
+                reinterpret_cast<const VkBufferCollectionImageCreateInfoFUCHSIA*>(structExtension),
+                reinterpret_cast<VkBufferCollectionImageCreateInfoFUCHSIA*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA: {
+            deepcopy_VkBufferCollectionBufferCreateInfoFUCHSIA(
+                alloc, rootType,
+                reinterpret_cast<const VkBufferCollectionBufferCreateInfoFUCHSIA*>(structExtension),
+                reinterpret_cast<VkBufferCollectionBufferCreateInfoFUCHSIA*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+        case VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI: {
+            deepcopy_VkSubpassShadingPipelineCreateInfoHUAWEI(
+                alloc, rootType,
+                reinterpret_cast<const VkSubpassShadingPipelineCreateInfoHUAWEI*>(structExtension),
+                reinterpret_cast<VkSubpassShadingPipelineCreateInfoHUAWEI*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI: {
+            deepcopy_VkPhysicalDeviceSubpassShadingFeaturesHUAWEI(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSubpassShadingFeaturesHUAWEI*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceSubpassShadingFeaturesHUAWEI*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI: {
+            deepcopy_VkPhysicalDeviceSubpassShadingPropertiesHUAWEI(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSubpassShadingPropertiesHUAWEI*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceSubpassShadingPropertiesHUAWEI*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI: {
+            deepcopy_VkPhysicalDeviceInvocationMaskFeaturesHUAWEI(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceInvocationMaskFeaturesHUAWEI*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceInvocationMaskFeaturesHUAWEI*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_external_memory_rdma
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_RDMA_FEATURES_NV: {
+            deepcopy_VkPhysicalDeviceExternalMemoryRDMAFeaturesNV(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceExternalMemoryRDMAFeaturesNV*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceExternalMemoryRDMAFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceExtendedDynamicState2FeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceExtendedDynamicState2FeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_color_write_enable
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceColorWriteEnableFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceColorWriteEnableFeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceColorWriteEnableFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT: {
+            deepcopy_VkPipelineColorWriteCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPipelineColorWriteCreateInfoEXT*>(structExtension),
+                reinterpret_cast<VkPipelineColorWriteCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_GOOGLE_gfxstream
+        case VK_STRUCTURE_TYPE_IMPORT_COLOR_BUFFER_GOOGLE: {
+            deepcopy_VkImportColorBufferGOOGLE(
+                alloc, rootType,
+                reinterpret_cast<const VkImportColorBufferGOOGLE*>(structExtension),
+                reinterpret_cast<VkImportColorBufferGOOGLE*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMPORT_BUFFER_GOOGLE: {
+            deepcopy_VkImportBufferGOOGLE(
+                alloc, rootType, reinterpret_cast<const VkImportBufferGOOGLE*>(structExtension),
+                reinterpret_cast<VkImportBufferGOOGLE*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_CREATE_BLOB_GOOGLE: {
+            deepcopy_VkCreateBlobGOOGLE(
+                alloc, rootType, reinterpret_cast<const VkCreateBlobGOOGLE*>(structExtension),
+                reinterpret_cast<VkCreateBlobGOOGLE*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_global_priority_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_EXT: {
+            deepcopy_VkQueueFamilyGlobalPriorityPropertiesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkQueueFamilyGlobalPriorityPropertiesEXT*>(structExtension),
+                reinterpret_cast<VkQueueFamilyGlobalPriorityPropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_multi_draw
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceMultiDrawFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMultiDrawFeaturesEXT*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceMultiDrawFeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT: {
+            deepcopy_VkPhysicalDeviceMultiDrawPropertiesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMultiDrawPropertiesEXT*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceMultiDrawPropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_border_color_swizzle
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT: {
+            deepcopy_VkPhysicalDeviceBorderColorSwizzleFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceBorderColorSwizzleFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT: {
+            deepcopy_VkSamplerBorderColorComponentMappingCreateInfoEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkSamplerBorderColorComponentMappingCreateInfoEXT*>(
+                    structExtension),
+                reinterpret_cast<VkSamplerBorderColorComponentMappingCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT: {
+            deepcopy_VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_acceleration_structure
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR: {
+            deepcopy_VkWriteDescriptorSetAccelerationStructureKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkWriteDescriptorSetAccelerationStructureKHR*>(
+                    structExtension),
+                reinterpret_cast<VkWriteDescriptorSetAccelerationStructureKHR*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR: {
+            deepcopy_VkPhysicalDeviceAccelerationStructureFeaturesKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceAccelerationStructureFeaturesKHR*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceAccelerationStructureFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR: {
+            deepcopy_VkPhysicalDeviceAccelerationStructurePropertiesKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceAccelerationStructurePropertiesKHR*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceAccelerationStructurePropertiesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR: {
+            deepcopy_VkPhysicalDeviceRayTracingPipelineFeaturesKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRayTracingPipelineFeaturesKHR*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceRayTracingPipelineFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR: {
+            deepcopy_VkPhysicalDeviceRayTracingPipelinePropertiesKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRayTracingPipelinePropertiesKHR*>(
+                    structExtension),
+                reinterpret_cast<VkPhysicalDeviceRayTracingPipelinePropertiesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_ray_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR: {
+            deepcopy_VkPhysicalDeviceRayQueryFeaturesKHR(
+                alloc, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRayQueryFeaturesKHR*>(structExtension),
+                reinterpret_cast<VkPhysicalDeviceRayQueryFeaturesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+        default: {
+            return;
+        }
+    }
+}
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/goldfish_vk_deepcopy_guest.h b/system/vulkan_enc/goldfish_vk_deepcopy_guest.h
new file mode 100644
index 0000000..7aee0c5
--- /dev/null
+++ b/system/vulkan_enc/goldfish_vk_deepcopy_guest.h
@@ -0,0 +1,3960 @@
+// Copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2018 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Autogenerated module goldfish_vk_deepcopy_guest
+//
+// (header) generated by codegen/vulkan/scripts/genvk.py -registry codegen/vulkan/xml/vk.xml cereal
+// -o host/vulkan/cereal
+//
+// Please do not modify directly;
+// re-run gfxstream-protocols/scripts/generate-vulkan-sources.sh,
+// or directly from Python by defining:
+// VULKAN_REGISTRY_XML_DIR : Directory containing vk.xml
+// VULKAN_REGISTRY_SCRIPTS_DIR : Directory containing genvk.py
+// CEREAL_OUTPUT_DIR: Where to put the generated sources.
+//
+// python3 $VULKAN_REGISTRY_SCRIPTS_DIR/genvk.py -registry $VULKAN_REGISTRY_XML_DIR/vk.xml cereal -o
+// $CEREAL_OUTPUT_DIR
+//
+#pragma once
+#include <vulkan/vulkan.h>
+
+#include "aemu/base/BumpPool.h"
+#include "goldfish_vk_private_defs.h"
+#include "vk_platform_compat.h"
+#include "vulkan_gfxstream.h"
+using android::base::Allocator;
+using android::base::BumpPool;
+// Stuff we are not going to use but if included,
+// will cause compile errors. These are Android Vulkan
+// required extensions, but the approach will be to
+// implement them completely on the guest side.
+#undef VK_KHR_android_surface
+#undef VK_ANDROID_external_memory_android_hardware_buffer
+
+namespace gfxstream {
+namespace vk {
+
+#ifdef VK_VERSION_1_0
+void deepcopy_VkExtent2D(Allocator* alloc, VkStructureType rootType, const VkExtent2D* from,
+                         VkExtent2D* to);
+
+void deepcopy_VkExtent3D(Allocator* alloc, VkStructureType rootType, const VkExtent3D* from,
+                         VkExtent3D* to);
+
+void deepcopy_VkOffset2D(Allocator* alloc, VkStructureType rootType, const VkOffset2D* from,
+                         VkOffset2D* to);
+
+void deepcopy_VkOffset3D(Allocator* alloc, VkStructureType rootType, const VkOffset3D* from,
+                         VkOffset3D* to);
+
+void deepcopy_VkRect2D(Allocator* alloc, VkStructureType rootType, const VkRect2D* from,
+                       VkRect2D* to);
+
+void deepcopy_VkBaseInStructure(Allocator* alloc, VkStructureType rootType,
+                                const VkBaseInStructure* from, VkBaseInStructure* to);
+
+void deepcopy_VkBaseOutStructure(Allocator* alloc, VkStructureType rootType,
+                                 const VkBaseOutStructure* from, VkBaseOutStructure* to);
+
+void deepcopy_VkBufferMemoryBarrier(Allocator* alloc, VkStructureType rootType,
+                                    const VkBufferMemoryBarrier* from, VkBufferMemoryBarrier* to);
+
+void deepcopy_VkDispatchIndirectCommand(Allocator* alloc, VkStructureType rootType,
+                                        const VkDispatchIndirectCommand* from,
+                                        VkDispatchIndirectCommand* to);
+
+void deepcopy_VkDrawIndexedIndirectCommand(Allocator* alloc, VkStructureType rootType,
+                                           const VkDrawIndexedIndirectCommand* from,
+                                           VkDrawIndexedIndirectCommand* to);
+
+void deepcopy_VkDrawIndirectCommand(Allocator* alloc, VkStructureType rootType,
+                                    const VkDrawIndirectCommand* from, VkDrawIndirectCommand* to);
+
+void deepcopy_VkImageSubresourceRange(Allocator* alloc, VkStructureType rootType,
+                                      const VkImageSubresourceRange* from,
+                                      VkImageSubresourceRange* to);
+
+void deepcopy_VkImageMemoryBarrier(Allocator* alloc, VkStructureType rootType,
+                                   const VkImageMemoryBarrier* from, VkImageMemoryBarrier* to);
+
+void deepcopy_VkMemoryBarrier(Allocator* alloc, VkStructureType rootType,
+                              const VkMemoryBarrier* from, VkMemoryBarrier* to);
+
+void deepcopy_VkPipelineCacheHeaderVersionOne(Allocator* alloc, VkStructureType rootType,
+                                              const VkPipelineCacheHeaderVersionOne* from,
+                                              VkPipelineCacheHeaderVersionOne* to);
+
+void deepcopy_VkAllocationCallbacks(Allocator* alloc, VkStructureType rootType,
+                                    const VkAllocationCallbacks* from, VkAllocationCallbacks* to);
+
+void deepcopy_VkApplicationInfo(Allocator* alloc, VkStructureType rootType,
+                                const VkApplicationInfo* from, VkApplicationInfo* to);
+
+void deepcopy_VkFormatProperties(Allocator* alloc, VkStructureType rootType,
+                                 const VkFormatProperties* from, VkFormatProperties* to);
+
+void deepcopy_VkImageFormatProperties(Allocator* alloc, VkStructureType rootType,
+                                      const VkImageFormatProperties* from,
+                                      VkImageFormatProperties* to);
+
+void deepcopy_VkInstanceCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                   const VkInstanceCreateInfo* from, VkInstanceCreateInfo* to);
+
+void deepcopy_VkMemoryHeap(Allocator* alloc, VkStructureType rootType, const VkMemoryHeap* from,
+                           VkMemoryHeap* to);
+
+void deepcopy_VkMemoryType(Allocator* alloc, VkStructureType rootType, const VkMemoryType* from,
+                           VkMemoryType* to);
+
+void deepcopy_VkPhysicalDeviceFeatures(Allocator* alloc, VkStructureType rootType,
+                                       const VkPhysicalDeviceFeatures* from,
+                                       VkPhysicalDeviceFeatures* to);
+
+void deepcopy_VkPhysicalDeviceLimits(Allocator* alloc, VkStructureType rootType,
+                                     const VkPhysicalDeviceLimits* from,
+                                     VkPhysicalDeviceLimits* to);
+
+void deepcopy_VkPhysicalDeviceMemoryProperties(Allocator* alloc, VkStructureType rootType,
+                                               const VkPhysicalDeviceMemoryProperties* from,
+                                               VkPhysicalDeviceMemoryProperties* to);
+
+void deepcopy_VkPhysicalDeviceSparseProperties(Allocator* alloc, VkStructureType rootType,
+                                               const VkPhysicalDeviceSparseProperties* from,
+                                               VkPhysicalDeviceSparseProperties* to);
+
+void deepcopy_VkPhysicalDeviceProperties(Allocator* alloc, VkStructureType rootType,
+                                         const VkPhysicalDeviceProperties* from,
+                                         VkPhysicalDeviceProperties* to);
+
+void deepcopy_VkQueueFamilyProperties(Allocator* alloc, VkStructureType rootType,
+                                      const VkQueueFamilyProperties* from,
+                                      VkQueueFamilyProperties* to);
+
+void deepcopy_VkDeviceQueueCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                      const VkDeviceQueueCreateInfo* from,
+                                      VkDeviceQueueCreateInfo* to);
+
+void deepcopy_VkDeviceCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                 const VkDeviceCreateInfo* from, VkDeviceCreateInfo* to);
+
+void deepcopy_VkExtensionProperties(Allocator* alloc, VkStructureType rootType,
+                                    const VkExtensionProperties* from, VkExtensionProperties* to);
+
+void deepcopy_VkLayerProperties(Allocator* alloc, VkStructureType rootType,
+                                const VkLayerProperties* from, VkLayerProperties* to);
+
+void deepcopy_VkSubmitInfo(Allocator* alloc, VkStructureType rootType, const VkSubmitInfo* from,
+                           VkSubmitInfo* to);
+
+void deepcopy_VkMappedMemoryRange(Allocator* alloc, VkStructureType rootType,
+                                  const VkMappedMemoryRange* from, VkMappedMemoryRange* to);
+
+void deepcopy_VkMemoryAllocateInfo(Allocator* alloc, VkStructureType rootType,
+                                   const VkMemoryAllocateInfo* from, VkMemoryAllocateInfo* to);
+
+void deepcopy_VkMemoryRequirements(Allocator* alloc, VkStructureType rootType,
+                                   const VkMemoryRequirements* from, VkMemoryRequirements* to);
+
+void deepcopy_VkSparseMemoryBind(Allocator* alloc, VkStructureType rootType,
+                                 const VkSparseMemoryBind* from, VkSparseMemoryBind* to);
+
+void deepcopy_VkSparseBufferMemoryBindInfo(Allocator* alloc, VkStructureType rootType,
+                                           const VkSparseBufferMemoryBindInfo* from,
+                                           VkSparseBufferMemoryBindInfo* to);
+
+void deepcopy_VkSparseImageOpaqueMemoryBindInfo(Allocator* alloc, VkStructureType rootType,
+                                                const VkSparseImageOpaqueMemoryBindInfo* from,
+                                                VkSparseImageOpaqueMemoryBindInfo* to);
+
+void deepcopy_VkImageSubresource(Allocator* alloc, VkStructureType rootType,
+                                 const VkImageSubresource* from, VkImageSubresource* to);
+
+void deepcopy_VkSparseImageMemoryBind(Allocator* alloc, VkStructureType rootType,
+                                      const VkSparseImageMemoryBind* from,
+                                      VkSparseImageMemoryBind* to);
+
+void deepcopy_VkSparseImageMemoryBindInfo(Allocator* alloc, VkStructureType rootType,
+                                          const VkSparseImageMemoryBindInfo* from,
+                                          VkSparseImageMemoryBindInfo* to);
+
+void deepcopy_VkBindSparseInfo(Allocator* alloc, VkStructureType rootType,
+                               const VkBindSparseInfo* from, VkBindSparseInfo* to);
+
+void deepcopy_VkSparseImageFormatProperties(Allocator* alloc, VkStructureType rootType,
+                                            const VkSparseImageFormatProperties* from,
+                                            VkSparseImageFormatProperties* to);
+
+void deepcopy_VkSparseImageMemoryRequirements(Allocator* alloc, VkStructureType rootType,
+                                              const VkSparseImageMemoryRequirements* from,
+                                              VkSparseImageMemoryRequirements* to);
+
+void deepcopy_VkFenceCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                const VkFenceCreateInfo* from, VkFenceCreateInfo* to);
+
+void deepcopy_VkSemaphoreCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                    const VkSemaphoreCreateInfo* from, VkSemaphoreCreateInfo* to);
+
+void deepcopy_VkEventCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                const VkEventCreateInfo* from, VkEventCreateInfo* to);
+
+void deepcopy_VkQueryPoolCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                    const VkQueryPoolCreateInfo* from, VkQueryPoolCreateInfo* to);
+
+void deepcopy_VkBufferCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                 const VkBufferCreateInfo* from, VkBufferCreateInfo* to);
+
+void deepcopy_VkBufferViewCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                     const VkBufferViewCreateInfo* from,
+                                     VkBufferViewCreateInfo* to);
+
+void deepcopy_VkImageCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                const VkImageCreateInfo* from, VkImageCreateInfo* to);
+
+void deepcopy_VkSubresourceLayout(Allocator* alloc, VkStructureType rootType,
+                                  const VkSubresourceLayout* from, VkSubresourceLayout* to);
+
+void deepcopy_VkComponentMapping(Allocator* alloc, VkStructureType rootType,
+                                 const VkComponentMapping* from, VkComponentMapping* to);
+
+void deepcopy_VkImageViewCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                    const VkImageViewCreateInfo* from, VkImageViewCreateInfo* to);
+
+void deepcopy_VkShaderModuleCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                       const VkShaderModuleCreateInfo* from,
+                                       VkShaderModuleCreateInfo* to);
+
+void deepcopy_VkPipelineCacheCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                        const VkPipelineCacheCreateInfo* from,
+                                        VkPipelineCacheCreateInfo* to);
+
+void deepcopy_VkSpecializationMapEntry(Allocator* alloc, VkStructureType rootType,
+                                       const VkSpecializationMapEntry* from,
+                                       VkSpecializationMapEntry* to);
+
+void deepcopy_VkSpecializationInfo(Allocator* alloc, VkStructureType rootType,
+                                   const VkSpecializationInfo* from, VkSpecializationInfo* to);
+
+void deepcopy_VkPipelineShaderStageCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                              const VkPipelineShaderStageCreateInfo* from,
+                                              VkPipelineShaderStageCreateInfo* to);
+
+void deepcopy_VkComputePipelineCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                          const VkComputePipelineCreateInfo* from,
+                                          VkComputePipelineCreateInfo* to);
+
+void deepcopy_VkVertexInputBindingDescription(Allocator* alloc, VkStructureType rootType,
+                                              const VkVertexInputBindingDescription* from,
+                                              VkVertexInputBindingDescription* to);
+
+void deepcopy_VkVertexInputAttributeDescription(Allocator* alloc, VkStructureType rootType,
+                                                const VkVertexInputAttributeDescription* from,
+                                                VkVertexInputAttributeDescription* to);
+
+void deepcopy_VkPipelineVertexInputStateCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                                   const VkPipelineVertexInputStateCreateInfo* from,
+                                                   VkPipelineVertexInputStateCreateInfo* to);
+
+void deepcopy_VkPipelineInputAssemblyStateCreateInfo(
+    Allocator* alloc, VkStructureType rootType, const VkPipelineInputAssemblyStateCreateInfo* from,
+    VkPipelineInputAssemblyStateCreateInfo* to);
+
+void deepcopy_VkPipelineTessellationStateCreateInfo(
+    Allocator* alloc, VkStructureType rootType, const VkPipelineTessellationStateCreateInfo* from,
+    VkPipelineTessellationStateCreateInfo* to);
+
+void deepcopy_VkViewport(Allocator* alloc, VkStructureType rootType, const VkViewport* from,
+                         VkViewport* to);
+
+void deepcopy_VkPipelineViewportStateCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                                const VkPipelineViewportStateCreateInfo* from,
+                                                VkPipelineViewportStateCreateInfo* to);
+
+void deepcopy_VkPipelineRasterizationStateCreateInfo(
+    Allocator* alloc, VkStructureType rootType, const VkPipelineRasterizationStateCreateInfo* from,
+    VkPipelineRasterizationStateCreateInfo* to);
+
+void deepcopy_VkPipelineMultisampleStateCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                                   const VkPipelineMultisampleStateCreateInfo* from,
+                                                   VkPipelineMultisampleStateCreateInfo* to);
+
+void deepcopy_VkStencilOpState(Allocator* alloc, VkStructureType rootType,
+                               const VkStencilOpState* from, VkStencilOpState* to);
+
+void deepcopy_VkPipelineDepthStencilStateCreateInfo(
+    Allocator* alloc, VkStructureType rootType, const VkPipelineDepthStencilStateCreateInfo* from,
+    VkPipelineDepthStencilStateCreateInfo* to);
+
+void deepcopy_VkPipelineColorBlendAttachmentState(Allocator* alloc, VkStructureType rootType,
+                                                  const VkPipelineColorBlendAttachmentState* from,
+                                                  VkPipelineColorBlendAttachmentState* to);
+
+void deepcopy_VkPipelineColorBlendStateCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                                  const VkPipelineColorBlendStateCreateInfo* from,
+                                                  VkPipelineColorBlendStateCreateInfo* to);
+
+void deepcopy_VkPipelineDynamicStateCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                               const VkPipelineDynamicStateCreateInfo* from,
+                                               VkPipelineDynamicStateCreateInfo* to);
+
+void deepcopy_VkGraphicsPipelineCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                           const VkGraphicsPipelineCreateInfo* from,
+                                           VkGraphicsPipelineCreateInfo* to);
+
+void deepcopy_VkPushConstantRange(Allocator* alloc, VkStructureType rootType,
+                                  const VkPushConstantRange* from, VkPushConstantRange* to);
+
+void deepcopy_VkPipelineLayoutCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                         const VkPipelineLayoutCreateInfo* from,
+                                         VkPipelineLayoutCreateInfo* to);
+
+void deepcopy_VkSamplerCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                  const VkSamplerCreateInfo* from, VkSamplerCreateInfo* to);
+
+void deepcopy_VkCopyDescriptorSet(Allocator* alloc, VkStructureType rootType,
+                                  const VkCopyDescriptorSet* from, VkCopyDescriptorSet* to);
+
+void deepcopy_VkDescriptorBufferInfo(Allocator* alloc, VkStructureType rootType,
+                                     const VkDescriptorBufferInfo* from,
+                                     VkDescriptorBufferInfo* to);
+
+void deepcopy_VkDescriptorImageInfo(Allocator* alloc, VkStructureType rootType,
+                                    const VkDescriptorImageInfo* from, VkDescriptorImageInfo* to);
+
+void deepcopy_VkDescriptorPoolSize(Allocator* alloc, VkStructureType rootType,
+                                   const VkDescriptorPoolSize* from, VkDescriptorPoolSize* to);
+
+void deepcopy_VkDescriptorPoolCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                         const VkDescriptorPoolCreateInfo* from,
+                                         VkDescriptorPoolCreateInfo* to);
+
+void deepcopy_VkDescriptorSetAllocateInfo(Allocator* alloc, VkStructureType rootType,
+                                          const VkDescriptorSetAllocateInfo* from,
+                                          VkDescriptorSetAllocateInfo* to);
+
+void deepcopy_VkDescriptorSetLayoutBinding(Allocator* alloc, VkStructureType rootType,
+                                           const VkDescriptorSetLayoutBinding* from,
+                                           VkDescriptorSetLayoutBinding* to);
+
+void deepcopy_VkDescriptorSetLayoutCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                              const VkDescriptorSetLayoutCreateInfo* from,
+                                              VkDescriptorSetLayoutCreateInfo* to);
+
+void deepcopy_VkWriteDescriptorSet(Allocator* alloc, VkStructureType rootType,
+                                   const VkWriteDescriptorSet* from, VkWriteDescriptorSet* to);
+
+void deepcopy_VkAttachmentDescription(Allocator* alloc, VkStructureType rootType,
+                                      const VkAttachmentDescription* from,
+                                      VkAttachmentDescription* to);
+
+void deepcopy_VkAttachmentReference(Allocator* alloc, VkStructureType rootType,
+                                    const VkAttachmentReference* from, VkAttachmentReference* to);
+
+void deepcopy_VkFramebufferCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                      const VkFramebufferCreateInfo* from,
+                                      VkFramebufferCreateInfo* to);
+
+void deepcopy_VkSubpassDescription(Allocator* alloc, VkStructureType rootType,
+                                   const VkSubpassDescription* from, VkSubpassDescription* to);
+
+void deepcopy_VkSubpassDependency(Allocator* alloc, VkStructureType rootType,
+                                  const VkSubpassDependency* from, VkSubpassDependency* to);
+
+void deepcopy_VkRenderPassCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                     const VkRenderPassCreateInfo* from,
+                                     VkRenderPassCreateInfo* to);
+
+void deepcopy_VkCommandPoolCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                      const VkCommandPoolCreateInfo* from,
+                                      VkCommandPoolCreateInfo* to);
+
+void deepcopy_VkCommandBufferAllocateInfo(Allocator* alloc, VkStructureType rootType,
+                                          const VkCommandBufferAllocateInfo* from,
+                                          VkCommandBufferAllocateInfo* to);
+
+void deepcopy_VkCommandBufferInheritanceInfo(Allocator* alloc, VkStructureType rootType,
+                                             const VkCommandBufferInheritanceInfo* from,
+                                             VkCommandBufferInheritanceInfo* to);
+
+void deepcopy_VkCommandBufferBeginInfo(Allocator* alloc, VkStructureType rootType,
+                                       const VkCommandBufferBeginInfo* from,
+                                       VkCommandBufferBeginInfo* to);
+
+void deepcopy_VkBufferCopy(Allocator* alloc, VkStructureType rootType, const VkBufferCopy* from,
+                           VkBufferCopy* to);
+
+void deepcopy_VkImageSubresourceLayers(Allocator* alloc, VkStructureType rootType,
+                                       const VkImageSubresourceLayers* from,
+                                       VkImageSubresourceLayers* to);
+
+void deepcopy_VkBufferImageCopy(Allocator* alloc, VkStructureType rootType,
+                                const VkBufferImageCopy* from, VkBufferImageCopy* to);
+
+void deepcopy_VkClearColorValue(Allocator* alloc, VkStructureType rootType,
+                                const VkClearColorValue* from, VkClearColorValue* to);
+
+void deepcopy_VkClearDepthStencilValue(Allocator* alloc, VkStructureType rootType,
+                                       const VkClearDepthStencilValue* from,
+                                       VkClearDepthStencilValue* to);
+
+void deepcopy_VkClearValue(Allocator* alloc, VkStructureType rootType, const VkClearValue* from,
+                           VkClearValue* to);
+
+void deepcopy_VkClearAttachment(Allocator* alloc, VkStructureType rootType,
+                                const VkClearAttachment* from, VkClearAttachment* to);
+
+void deepcopy_VkClearRect(Allocator* alloc, VkStructureType rootType, const VkClearRect* from,
+                          VkClearRect* to);
+
+void deepcopy_VkImageBlit(Allocator* alloc, VkStructureType rootType, const VkImageBlit* from,
+                          VkImageBlit* to);
+
+void deepcopy_VkImageCopy(Allocator* alloc, VkStructureType rootType, const VkImageCopy* from,
+                          VkImageCopy* to);
+
+void deepcopy_VkImageResolve(Allocator* alloc, VkStructureType rootType, const VkImageResolve* from,
+                             VkImageResolve* to);
+
+void deepcopy_VkRenderPassBeginInfo(Allocator* alloc, VkStructureType rootType,
+                                    const VkRenderPassBeginInfo* from, VkRenderPassBeginInfo* to);
+
+#endif
+#ifdef VK_VERSION_1_1
+void deepcopy_VkPhysicalDeviceSubgroupProperties(Allocator* alloc, VkStructureType rootType,
+                                                 const VkPhysicalDeviceSubgroupProperties* from,
+                                                 VkPhysicalDeviceSubgroupProperties* to);
+
+void deepcopy_VkBindBufferMemoryInfo(Allocator* alloc, VkStructureType rootType,
+                                     const VkBindBufferMemoryInfo* from,
+                                     VkBindBufferMemoryInfo* to);
+
+void deepcopy_VkBindImageMemoryInfo(Allocator* alloc, VkStructureType rootType,
+                                    const VkBindImageMemoryInfo* from, VkBindImageMemoryInfo* to);
+
+void deepcopy_VkPhysicalDevice16BitStorageFeatures(Allocator* alloc, VkStructureType rootType,
+                                                   const VkPhysicalDevice16BitStorageFeatures* from,
+                                                   VkPhysicalDevice16BitStorageFeatures* to);
+
+void deepcopy_VkMemoryDedicatedRequirements(Allocator* alloc, VkStructureType rootType,
+                                            const VkMemoryDedicatedRequirements* from,
+                                            VkMemoryDedicatedRequirements* to);
+
+void deepcopy_VkMemoryDedicatedAllocateInfo(Allocator* alloc, VkStructureType rootType,
+                                            const VkMemoryDedicatedAllocateInfo* from,
+                                            VkMemoryDedicatedAllocateInfo* to);
+
+void deepcopy_VkMemoryAllocateFlagsInfo(Allocator* alloc, VkStructureType rootType,
+                                        const VkMemoryAllocateFlagsInfo* from,
+                                        VkMemoryAllocateFlagsInfo* to);
+
+void deepcopy_VkDeviceGroupRenderPassBeginInfo(Allocator* alloc, VkStructureType rootType,
+                                               const VkDeviceGroupRenderPassBeginInfo* from,
+                                               VkDeviceGroupRenderPassBeginInfo* to);
+
+void deepcopy_VkDeviceGroupCommandBufferBeginInfo(Allocator* alloc, VkStructureType rootType,
+                                                  const VkDeviceGroupCommandBufferBeginInfo* from,
+                                                  VkDeviceGroupCommandBufferBeginInfo* to);
+
+void deepcopy_VkDeviceGroupSubmitInfo(Allocator* alloc, VkStructureType rootType,
+                                      const VkDeviceGroupSubmitInfo* from,
+                                      VkDeviceGroupSubmitInfo* to);
+
+void deepcopy_VkDeviceGroupBindSparseInfo(Allocator* alloc, VkStructureType rootType,
+                                          const VkDeviceGroupBindSparseInfo* from,
+                                          VkDeviceGroupBindSparseInfo* to);
+
+void deepcopy_VkBindBufferMemoryDeviceGroupInfo(Allocator* alloc, VkStructureType rootType,
+                                                const VkBindBufferMemoryDeviceGroupInfo* from,
+                                                VkBindBufferMemoryDeviceGroupInfo* to);
+
+void deepcopy_VkBindImageMemoryDeviceGroupInfo(Allocator* alloc, VkStructureType rootType,
+                                               const VkBindImageMemoryDeviceGroupInfo* from,
+                                               VkBindImageMemoryDeviceGroupInfo* to);
+
+void deepcopy_VkPhysicalDeviceGroupProperties(Allocator* alloc, VkStructureType rootType,
+                                              const VkPhysicalDeviceGroupProperties* from,
+                                              VkPhysicalDeviceGroupProperties* to);
+
+void deepcopy_VkDeviceGroupDeviceCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                            const VkDeviceGroupDeviceCreateInfo* from,
+                                            VkDeviceGroupDeviceCreateInfo* to);
+
+void deepcopy_VkBufferMemoryRequirementsInfo2(Allocator* alloc, VkStructureType rootType,
+                                              const VkBufferMemoryRequirementsInfo2* from,
+                                              VkBufferMemoryRequirementsInfo2* to);
+
+void deepcopy_VkImageMemoryRequirementsInfo2(Allocator* alloc, VkStructureType rootType,
+                                             const VkImageMemoryRequirementsInfo2* from,
+                                             VkImageMemoryRequirementsInfo2* to);
+
+void deepcopy_VkImageSparseMemoryRequirementsInfo2(Allocator* alloc, VkStructureType rootType,
+                                                   const VkImageSparseMemoryRequirementsInfo2* from,
+                                                   VkImageSparseMemoryRequirementsInfo2* to);
+
+void deepcopy_VkMemoryRequirements2(Allocator* alloc, VkStructureType rootType,
+                                    const VkMemoryRequirements2* from, VkMemoryRequirements2* to);
+
+void deepcopy_VkSparseImageMemoryRequirements2(Allocator* alloc, VkStructureType rootType,
+                                               const VkSparseImageMemoryRequirements2* from,
+                                               VkSparseImageMemoryRequirements2* to);
+
+void deepcopy_VkPhysicalDeviceFeatures2(Allocator* alloc, VkStructureType rootType,
+                                        const VkPhysicalDeviceFeatures2* from,
+                                        VkPhysicalDeviceFeatures2* to);
+
+void deepcopy_VkPhysicalDeviceProperties2(Allocator* alloc, VkStructureType rootType,
+                                          const VkPhysicalDeviceProperties2* from,
+                                          VkPhysicalDeviceProperties2* to);
+
+void deepcopy_VkFormatProperties2(Allocator* alloc, VkStructureType rootType,
+                                  const VkFormatProperties2* from, VkFormatProperties2* to);
+
+void deepcopy_VkImageFormatProperties2(Allocator* alloc, VkStructureType rootType,
+                                       const VkImageFormatProperties2* from,
+                                       VkImageFormatProperties2* to);
+
+void deepcopy_VkPhysicalDeviceImageFormatInfo2(Allocator* alloc, VkStructureType rootType,
+                                               const VkPhysicalDeviceImageFormatInfo2* from,
+                                               VkPhysicalDeviceImageFormatInfo2* to);
+
+void deepcopy_VkQueueFamilyProperties2(Allocator* alloc, VkStructureType rootType,
+                                       const VkQueueFamilyProperties2* from,
+                                       VkQueueFamilyProperties2* to);
+
+void deepcopy_VkPhysicalDeviceMemoryProperties2(Allocator* alloc, VkStructureType rootType,
+                                                const VkPhysicalDeviceMemoryProperties2* from,
+                                                VkPhysicalDeviceMemoryProperties2* to);
+
+void deepcopy_VkSparseImageFormatProperties2(Allocator* alloc, VkStructureType rootType,
+                                             const VkSparseImageFormatProperties2* from,
+                                             VkSparseImageFormatProperties2* to);
+
+void deepcopy_VkPhysicalDeviceSparseImageFormatInfo2(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceSparseImageFormatInfo2* from,
+    VkPhysicalDeviceSparseImageFormatInfo2* to);
+
+void deepcopy_VkPhysicalDevicePointClippingProperties(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDevicePointClippingProperties* from,
+    VkPhysicalDevicePointClippingProperties* to);
+
+void deepcopy_VkInputAttachmentAspectReference(Allocator* alloc, VkStructureType rootType,
+                                               const VkInputAttachmentAspectReference* from,
+                                               VkInputAttachmentAspectReference* to);
+
+void deepcopy_VkRenderPassInputAttachmentAspectCreateInfo(
+    Allocator* alloc, VkStructureType rootType,
+    const VkRenderPassInputAttachmentAspectCreateInfo* from,
+    VkRenderPassInputAttachmentAspectCreateInfo* to);
+
+void deepcopy_VkImageViewUsageCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                         const VkImageViewUsageCreateInfo* from,
+                                         VkImageViewUsageCreateInfo* to);
+
+void deepcopy_VkPipelineTessellationDomainOriginStateCreateInfo(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineTessellationDomainOriginStateCreateInfo* from,
+    VkPipelineTessellationDomainOriginStateCreateInfo* to);
+
+void deepcopy_VkRenderPassMultiviewCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                              const VkRenderPassMultiviewCreateInfo* from,
+                                              VkRenderPassMultiviewCreateInfo* to);
+
+void deepcopy_VkPhysicalDeviceMultiviewFeatures(Allocator* alloc, VkStructureType rootType,
+                                                const VkPhysicalDeviceMultiviewFeatures* from,
+                                                VkPhysicalDeviceMultiviewFeatures* to);
+
+void deepcopy_VkPhysicalDeviceMultiviewProperties(Allocator* alloc, VkStructureType rootType,
+                                                  const VkPhysicalDeviceMultiviewProperties* from,
+                                                  VkPhysicalDeviceMultiviewProperties* to);
+
+void deepcopy_VkPhysicalDeviceVariablePointersFeatures(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceVariablePointersFeatures* from,
+    VkPhysicalDeviceVariablePointersFeatures* to);
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceVariablePointersFeatures,
+                      deepcopy_VkPhysicalDeviceVariablePointerFeatures)
+
+void deepcopy_VkPhysicalDeviceProtectedMemoryFeatures(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceProtectedMemoryFeatures* from,
+    VkPhysicalDeviceProtectedMemoryFeatures* to);
+
+void deepcopy_VkPhysicalDeviceProtectedMemoryProperties(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceProtectedMemoryProperties* from,
+    VkPhysicalDeviceProtectedMemoryProperties* to);
+
+void deepcopy_VkDeviceQueueInfo2(Allocator* alloc, VkStructureType rootType,
+                                 const VkDeviceQueueInfo2* from, VkDeviceQueueInfo2* to);
+
+void deepcopy_VkProtectedSubmitInfo(Allocator* alloc, VkStructureType rootType,
+                                    const VkProtectedSubmitInfo* from, VkProtectedSubmitInfo* to);
+
+void deepcopy_VkSamplerYcbcrConversionCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                                 const VkSamplerYcbcrConversionCreateInfo* from,
+                                                 VkSamplerYcbcrConversionCreateInfo* to);
+
+void deepcopy_VkSamplerYcbcrConversionInfo(Allocator* alloc, VkStructureType rootType,
+                                           const VkSamplerYcbcrConversionInfo* from,
+                                           VkSamplerYcbcrConversionInfo* to);
+
+void deepcopy_VkBindImagePlaneMemoryInfo(Allocator* alloc, VkStructureType rootType,
+                                         const VkBindImagePlaneMemoryInfo* from,
+                                         VkBindImagePlaneMemoryInfo* to);
+
+void deepcopy_VkImagePlaneMemoryRequirementsInfo(Allocator* alloc, VkStructureType rootType,
+                                                 const VkImagePlaneMemoryRequirementsInfo* from,
+                                                 VkImagePlaneMemoryRequirementsInfo* to);
+
+void deepcopy_VkPhysicalDeviceSamplerYcbcrConversionFeatures(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceSamplerYcbcrConversionFeatures* from,
+    VkPhysicalDeviceSamplerYcbcrConversionFeatures* to);
+
+void deepcopy_VkSamplerYcbcrConversionImageFormatProperties(
+    Allocator* alloc, VkStructureType rootType,
+    const VkSamplerYcbcrConversionImageFormatProperties* from,
+    VkSamplerYcbcrConversionImageFormatProperties* to);
+
+void deepcopy_VkDescriptorUpdateTemplateEntry(Allocator* alloc, VkStructureType rootType,
+                                              const VkDescriptorUpdateTemplateEntry* from,
+                                              VkDescriptorUpdateTemplateEntry* to);
+
+void deepcopy_VkDescriptorUpdateTemplateCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                                   const VkDescriptorUpdateTemplateCreateInfo* from,
+                                                   VkDescriptorUpdateTemplateCreateInfo* to);
+
+void deepcopy_VkExternalMemoryProperties(Allocator* alloc, VkStructureType rootType,
+                                         const VkExternalMemoryProperties* from,
+                                         VkExternalMemoryProperties* to);
+
+void deepcopy_VkPhysicalDeviceExternalImageFormatInfo(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceExternalImageFormatInfo* from,
+    VkPhysicalDeviceExternalImageFormatInfo* to);
+
+void deepcopy_VkExternalImageFormatProperties(Allocator* alloc, VkStructureType rootType,
+                                              const VkExternalImageFormatProperties* from,
+                                              VkExternalImageFormatProperties* to);
+
+void deepcopy_VkPhysicalDeviceExternalBufferInfo(Allocator* alloc, VkStructureType rootType,
+                                                 const VkPhysicalDeviceExternalBufferInfo* from,
+                                                 VkPhysicalDeviceExternalBufferInfo* to);
+
+void deepcopy_VkExternalBufferProperties(Allocator* alloc, VkStructureType rootType,
+                                         const VkExternalBufferProperties* from,
+                                         VkExternalBufferProperties* to);
+
+void deepcopy_VkPhysicalDeviceIDProperties(Allocator* alloc, VkStructureType rootType,
+                                           const VkPhysicalDeviceIDProperties* from,
+                                           VkPhysicalDeviceIDProperties* to);
+
+void deepcopy_VkExternalMemoryImageCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                              const VkExternalMemoryImageCreateInfo* from,
+                                              VkExternalMemoryImageCreateInfo* to);
+
+void deepcopy_VkExternalMemoryBufferCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                               const VkExternalMemoryBufferCreateInfo* from,
+                                               VkExternalMemoryBufferCreateInfo* to);
+
+void deepcopy_VkExportMemoryAllocateInfo(Allocator* alloc, VkStructureType rootType,
+                                         const VkExportMemoryAllocateInfo* from,
+                                         VkExportMemoryAllocateInfo* to);
+
+void deepcopy_VkPhysicalDeviceExternalFenceInfo(Allocator* alloc, VkStructureType rootType,
+                                                const VkPhysicalDeviceExternalFenceInfo* from,
+                                                VkPhysicalDeviceExternalFenceInfo* to);
+
+void deepcopy_VkExternalFenceProperties(Allocator* alloc, VkStructureType rootType,
+                                        const VkExternalFenceProperties* from,
+                                        VkExternalFenceProperties* to);
+
+void deepcopy_VkExportFenceCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                      const VkExportFenceCreateInfo* from,
+                                      VkExportFenceCreateInfo* to);
+
+void deepcopy_VkExportSemaphoreCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                          const VkExportSemaphoreCreateInfo* from,
+                                          VkExportSemaphoreCreateInfo* to);
+
+void deepcopy_VkPhysicalDeviceExternalSemaphoreInfo(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceExternalSemaphoreInfo* from,
+    VkPhysicalDeviceExternalSemaphoreInfo* to);
+
+void deepcopy_VkExternalSemaphoreProperties(Allocator* alloc, VkStructureType rootType,
+                                            const VkExternalSemaphoreProperties* from,
+                                            VkExternalSemaphoreProperties* to);
+
+void deepcopy_VkPhysicalDeviceMaintenance3Properties(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceMaintenance3Properties* from,
+    VkPhysicalDeviceMaintenance3Properties* to);
+
+void deepcopy_VkDescriptorSetLayoutSupport(Allocator* alloc, VkStructureType rootType,
+                                           const VkDescriptorSetLayoutSupport* from,
+                                           VkDescriptorSetLayoutSupport* to);
+
+void deepcopy_VkPhysicalDeviceShaderDrawParametersFeatures(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderDrawParametersFeatures* from,
+    VkPhysicalDeviceShaderDrawParametersFeatures* to);
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceShaderDrawParametersFeatures,
+                      deepcopy_VkPhysicalDeviceShaderDrawParameterFeatures)
+
+#endif
+#ifdef VK_VERSION_1_2
+void deepcopy_VkPhysicalDeviceVulkan11Features(Allocator* alloc, VkStructureType rootType,
+                                               const VkPhysicalDeviceVulkan11Features* from,
+                                               VkPhysicalDeviceVulkan11Features* to);
+
+void deepcopy_VkPhysicalDeviceVulkan11Properties(Allocator* alloc, VkStructureType rootType,
+                                                 const VkPhysicalDeviceVulkan11Properties* from,
+                                                 VkPhysicalDeviceVulkan11Properties* to);
+
+void deepcopy_VkPhysicalDeviceVulkan12Features(Allocator* alloc, VkStructureType rootType,
+                                               const VkPhysicalDeviceVulkan12Features* from,
+                                               VkPhysicalDeviceVulkan12Features* to);
+
+void deepcopy_VkConformanceVersion(Allocator* alloc, VkStructureType rootType,
+                                   const VkConformanceVersion* from, VkConformanceVersion* to);
+
+void deepcopy_VkPhysicalDeviceVulkan12Properties(Allocator* alloc, VkStructureType rootType,
+                                                 const VkPhysicalDeviceVulkan12Properties* from,
+                                                 VkPhysicalDeviceVulkan12Properties* to);
+
+void deepcopy_VkImageFormatListCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                          const VkImageFormatListCreateInfo* from,
+                                          VkImageFormatListCreateInfo* to);
+
+void deepcopy_VkAttachmentDescription2(Allocator* alloc, VkStructureType rootType,
+                                       const VkAttachmentDescription2* from,
+                                       VkAttachmentDescription2* to);
+
+void deepcopy_VkAttachmentReference2(Allocator* alloc, VkStructureType rootType,
+                                     const VkAttachmentReference2* from,
+                                     VkAttachmentReference2* to);
+
+void deepcopy_VkSubpassDescription2(Allocator* alloc, VkStructureType rootType,
+                                    const VkSubpassDescription2* from, VkSubpassDescription2* to);
+
+void deepcopy_VkSubpassDependency2(Allocator* alloc, VkStructureType rootType,
+                                   const VkSubpassDependency2* from, VkSubpassDependency2* to);
+
+void deepcopy_VkRenderPassCreateInfo2(Allocator* alloc, VkStructureType rootType,
+                                      const VkRenderPassCreateInfo2* from,
+                                      VkRenderPassCreateInfo2* to);
+
+void deepcopy_VkSubpassBeginInfo(Allocator* alloc, VkStructureType rootType,
+                                 const VkSubpassBeginInfo* from, VkSubpassBeginInfo* to);
+
+void deepcopy_VkSubpassEndInfo(Allocator* alloc, VkStructureType rootType,
+                               const VkSubpassEndInfo* from, VkSubpassEndInfo* to);
+
+void deepcopy_VkPhysicalDevice8BitStorageFeatures(Allocator* alloc, VkStructureType rootType,
+                                                  const VkPhysicalDevice8BitStorageFeatures* from,
+                                                  VkPhysicalDevice8BitStorageFeatures* to);
+
+void deepcopy_VkPhysicalDeviceDriverProperties(Allocator* alloc, VkStructureType rootType,
+                                               const VkPhysicalDeviceDriverProperties* from,
+                                               VkPhysicalDeviceDriverProperties* to);
+
+void deepcopy_VkPhysicalDeviceShaderAtomicInt64Features(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderAtomicInt64Features* from,
+    VkPhysicalDeviceShaderAtomicInt64Features* to);
+
+void deepcopy_VkPhysicalDeviceShaderFloat16Int8Features(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderFloat16Int8Features* from,
+    VkPhysicalDeviceShaderFloat16Int8Features* to);
+
+void deepcopy_VkPhysicalDeviceFloatControlsProperties(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceFloatControlsProperties* from,
+    VkPhysicalDeviceFloatControlsProperties* to);
+
+void deepcopy_VkDescriptorSetLayoutBindingFlagsCreateInfo(
+    Allocator* alloc, VkStructureType rootType,
+    const VkDescriptorSetLayoutBindingFlagsCreateInfo* from,
+    VkDescriptorSetLayoutBindingFlagsCreateInfo* to);
+
+void deepcopy_VkPhysicalDeviceDescriptorIndexingFeatures(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceDescriptorIndexingFeatures* from,
+    VkPhysicalDeviceDescriptorIndexingFeatures* to);
+
+void deepcopy_VkPhysicalDeviceDescriptorIndexingProperties(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceDescriptorIndexingProperties* from,
+    VkPhysicalDeviceDescriptorIndexingProperties* to);
+
+void deepcopy_VkDescriptorSetVariableDescriptorCountAllocateInfo(
+    Allocator* alloc, VkStructureType rootType,
+    const VkDescriptorSetVariableDescriptorCountAllocateInfo* from,
+    VkDescriptorSetVariableDescriptorCountAllocateInfo* to);
+
+void deepcopy_VkDescriptorSetVariableDescriptorCountLayoutSupport(
+    Allocator* alloc, VkStructureType rootType,
+    const VkDescriptorSetVariableDescriptorCountLayoutSupport* from,
+    VkDescriptorSetVariableDescriptorCountLayoutSupport* to);
+
+void deepcopy_VkSubpassDescriptionDepthStencilResolve(
+    Allocator* alloc, VkStructureType rootType, const VkSubpassDescriptionDepthStencilResolve* from,
+    VkSubpassDescriptionDepthStencilResolve* to);
+
+void deepcopy_VkPhysicalDeviceDepthStencilResolveProperties(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceDepthStencilResolveProperties* from,
+    VkPhysicalDeviceDepthStencilResolveProperties* to);
+
+void deepcopy_VkPhysicalDeviceScalarBlockLayoutFeatures(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceScalarBlockLayoutFeatures* from,
+    VkPhysicalDeviceScalarBlockLayoutFeatures* to);
+
+void deepcopy_VkImageStencilUsageCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                            const VkImageStencilUsageCreateInfo* from,
+                                            VkImageStencilUsageCreateInfo* to);
+
+void deepcopy_VkSamplerReductionModeCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                               const VkSamplerReductionModeCreateInfo* from,
+                                               VkSamplerReductionModeCreateInfo* to);
+
+void deepcopy_VkPhysicalDeviceSamplerFilterMinmaxProperties(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceSamplerFilterMinmaxProperties* from,
+    VkPhysicalDeviceSamplerFilterMinmaxProperties* to);
+
+void deepcopy_VkPhysicalDeviceVulkanMemoryModelFeatures(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceVulkanMemoryModelFeatures* from,
+    VkPhysicalDeviceVulkanMemoryModelFeatures* to);
+
+void deepcopy_VkPhysicalDeviceImagelessFramebufferFeatures(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceImagelessFramebufferFeatures* from,
+    VkPhysicalDeviceImagelessFramebufferFeatures* to);
+
+void deepcopy_VkFramebufferAttachmentImageInfo(Allocator* alloc, VkStructureType rootType,
+                                               const VkFramebufferAttachmentImageInfo* from,
+                                               VkFramebufferAttachmentImageInfo* to);
+
+void deepcopy_VkFramebufferAttachmentsCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                                 const VkFramebufferAttachmentsCreateInfo* from,
+                                                 VkFramebufferAttachmentsCreateInfo* to);
+
+void deepcopy_VkRenderPassAttachmentBeginInfo(Allocator* alloc, VkStructureType rootType,
+                                              const VkRenderPassAttachmentBeginInfo* from,
+                                              VkRenderPassAttachmentBeginInfo* to);
+
+void deepcopy_VkPhysicalDeviceUniformBufferStandardLayoutFeatures(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceUniformBufferStandardLayoutFeatures* from,
+    VkPhysicalDeviceUniformBufferStandardLayoutFeatures* to);
+
+void deepcopy_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures* from,
+    VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures* to);
+
+void deepcopy_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures* from,
+    VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures* to);
+
+void deepcopy_VkAttachmentReferenceStencilLayout(Allocator* alloc, VkStructureType rootType,
+                                                 const VkAttachmentReferenceStencilLayout* from,
+                                                 VkAttachmentReferenceStencilLayout* to);
+
+void deepcopy_VkAttachmentDescriptionStencilLayout(Allocator* alloc, VkStructureType rootType,
+                                                   const VkAttachmentDescriptionStencilLayout* from,
+                                                   VkAttachmentDescriptionStencilLayout* to);
+
+void deepcopy_VkPhysicalDeviceHostQueryResetFeatures(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceHostQueryResetFeatures* from,
+    VkPhysicalDeviceHostQueryResetFeatures* to);
+
+void deepcopy_VkPhysicalDeviceTimelineSemaphoreFeatures(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceTimelineSemaphoreFeatures* from,
+    VkPhysicalDeviceTimelineSemaphoreFeatures* to);
+
+void deepcopy_VkPhysicalDeviceTimelineSemaphoreProperties(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceTimelineSemaphoreProperties* from,
+    VkPhysicalDeviceTimelineSemaphoreProperties* to);
+
+void deepcopy_VkSemaphoreTypeCreateInfo(Allocator* alloc, VkStructureType rootType,
+                                        const VkSemaphoreTypeCreateInfo* from,
+                                        VkSemaphoreTypeCreateInfo* to);
+
+void deepcopy_VkTimelineSemaphoreSubmitInfo(Allocator* alloc, VkStructureType rootType,
+                                            const VkTimelineSemaphoreSubmitInfo* from,
+                                            VkTimelineSemaphoreSubmitInfo* to);
+
+void deepcopy_VkSemaphoreWaitInfo(Allocator* alloc, VkStructureType rootType,
+                                  const VkSemaphoreWaitInfo* from, VkSemaphoreWaitInfo* to);
+
+void deepcopy_VkSemaphoreSignalInfo(Allocator* alloc, VkStructureType rootType,
+                                    const VkSemaphoreSignalInfo* from, VkSemaphoreSignalInfo* to);
+
+void deepcopy_VkPhysicalDeviceBufferDeviceAddressFeatures(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceBufferDeviceAddressFeatures* from,
+    VkPhysicalDeviceBufferDeviceAddressFeatures* to);
+
+void deepcopy_VkBufferDeviceAddressInfo(Allocator* alloc, VkStructureType rootType,
+                                        const VkBufferDeviceAddressInfo* from,
+                                        VkBufferDeviceAddressInfo* to);
+
+void deepcopy_VkBufferOpaqueCaptureAddressCreateInfo(
+    Allocator* alloc, VkStructureType rootType, const VkBufferOpaqueCaptureAddressCreateInfo* from,
+    VkBufferOpaqueCaptureAddressCreateInfo* to);
+
+void deepcopy_VkMemoryOpaqueCaptureAddressAllocateInfo(
+    Allocator* alloc, VkStructureType rootType,
+    const VkMemoryOpaqueCaptureAddressAllocateInfo* from,
+    VkMemoryOpaqueCaptureAddressAllocateInfo* to);
+
+void deepcopy_VkDeviceMemoryOpaqueCaptureAddressInfo(
+    Allocator* alloc, VkStructureType rootType, const VkDeviceMemoryOpaqueCaptureAddressInfo* from,
+    VkDeviceMemoryOpaqueCaptureAddressInfo* to);
+
+#endif
+#ifdef VK_KHR_surface
+void deepcopy_VkSurfaceCapabilitiesKHR(Allocator* alloc, VkStructureType rootType,
+                                       const VkSurfaceCapabilitiesKHR* from,
+                                       VkSurfaceCapabilitiesKHR* to);
+
+void deepcopy_VkSurfaceFormatKHR(Allocator* alloc, VkStructureType rootType,
+                                 const VkSurfaceFormatKHR* from, VkSurfaceFormatKHR* to);
+
+#endif
+#ifdef VK_KHR_swapchain
+void deepcopy_VkSwapchainCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                       const VkSwapchainCreateInfoKHR* from,
+                                       VkSwapchainCreateInfoKHR* to);
+
+void deepcopy_VkPresentInfoKHR(Allocator* alloc, VkStructureType rootType,
+                               const VkPresentInfoKHR* from, VkPresentInfoKHR* to);
+
+void deepcopy_VkImageSwapchainCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                            const VkImageSwapchainCreateInfoKHR* from,
+                                            VkImageSwapchainCreateInfoKHR* to);
+
+void deepcopy_VkBindImageMemorySwapchainInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                                const VkBindImageMemorySwapchainInfoKHR* from,
+                                                VkBindImageMemorySwapchainInfoKHR* to);
+
+void deepcopy_VkAcquireNextImageInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                        const VkAcquireNextImageInfoKHR* from,
+                                        VkAcquireNextImageInfoKHR* to);
+
+void deepcopy_VkDeviceGroupPresentCapabilitiesKHR(Allocator* alloc, VkStructureType rootType,
+                                                  const VkDeviceGroupPresentCapabilitiesKHR* from,
+                                                  VkDeviceGroupPresentCapabilitiesKHR* to);
+
+void deepcopy_VkDeviceGroupPresentInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                          const VkDeviceGroupPresentInfoKHR* from,
+                                          VkDeviceGroupPresentInfoKHR* to);
+
+void deepcopy_VkDeviceGroupSwapchainCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                                  const VkDeviceGroupSwapchainCreateInfoKHR* from,
+                                                  VkDeviceGroupSwapchainCreateInfoKHR* to);
+
+#endif
+#ifdef VK_KHR_display
+void deepcopy_VkDisplayModeParametersKHR(Allocator* alloc, VkStructureType rootType,
+                                         const VkDisplayModeParametersKHR* from,
+                                         VkDisplayModeParametersKHR* to);
+
+void deepcopy_VkDisplayModeCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                         const VkDisplayModeCreateInfoKHR* from,
+                                         VkDisplayModeCreateInfoKHR* to);
+
+void deepcopy_VkDisplayModePropertiesKHR(Allocator* alloc, VkStructureType rootType,
+                                         const VkDisplayModePropertiesKHR* from,
+                                         VkDisplayModePropertiesKHR* to);
+
+void deepcopy_VkDisplayPlaneCapabilitiesKHR(Allocator* alloc, VkStructureType rootType,
+                                            const VkDisplayPlaneCapabilitiesKHR* from,
+                                            VkDisplayPlaneCapabilitiesKHR* to);
+
+void deepcopy_VkDisplayPlanePropertiesKHR(Allocator* alloc, VkStructureType rootType,
+                                          const VkDisplayPlanePropertiesKHR* from,
+                                          VkDisplayPlanePropertiesKHR* to);
+
+void deepcopy_VkDisplayPropertiesKHR(Allocator* alloc, VkStructureType rootType,
+                                     const VkDisplayPropertiesKHR* from,
+                                     VkDisplayPropertiesKHR* to);
+
+void deepcopy_VkDisplaySurfaceCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                            const VkDisplaySurfaceCreateInfoKHR* from,
+                                            VkDisplaySurfaceCreateInfoKHR* to);
+
+#endif
+#ifdef VK_KHR_display_swapchain
+void deepcopy_VkDisplayPresentInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                      const VkDisplayPresentInfoKHR* from,
+                                      VkDisplayPresentInfoKHR* to);
+
+#endif
+#ifdef VK_KHR_xlib_surface
+void deepcopy_VkXlibSurfaceCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                         const VkXlibSurfaceCreateInfoKHR* from,
+                                         VkXlibSurfaceCreateInfoKHR* to);
+
+#endif
+#ifdef VK_KHR_xcb_surface
+void deepcopy_VkXcbSurfaceCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                        const VkXcbSurfaceCreateInfoKHR* from,
+                                        VkXcbSurfaceCreateInfoKHR* to);
+
+#endif
+#ifdef VK_KHR_wayland_surface
+void deepcopy_VkWaylandSurfaceCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                            const VkWaylandSurfaceCreateInfoKHR* from,
+                                            VkWaylandSurfaceCreateInfoKHR* to);
+
+#endif
+#ifdef VK_KHR_android_surface
+void deepcopy_VkAndroidSurfaceCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                            const VkAndroidSurfaceCreateInfoKHR* from,
+                                            VkAndroidSurfaceCreateInfoKHR* to);
+
+#endif
+#ifdef VK_KHR_win32_surface
+void deepcopy_VkWin32SurfaceCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                          const VkWin32SurfaceCreateInfoKHR* from,
+                                          VkWin32SurfaceCreateInfoKHR* to);
+
+#endif
+#ifdef VK_KHR_sampler_mirror_clamp_to_edge
+#endif
+#ifdef VK_KHR_video_queue
+void deepcopy_VkVideoQueueFamilyProperties2KHR(Allocator* alloc, VkStructureType rootType,
+                                               const VkVideoQueueFamilyProperties2KHR* from,
+                                               VkVideoQueueFamilyProperties2KHR* to);
+
+void deepcopy_VkVideoProfileKHR(Allocator* alloc, VkStructureType rootType,
+                                const VkVideoProfileKHR* from, VkVideoProfileKHR* to);
+
+void deepcopy_VkVideoProfilesKHR(Allocator* alloc, VkStructureType rootType,
+                                 const VkVideoProfilesKHR* from, VkVideoProfilesKHR* to);
+
+void deepcopy_VkVideoCapabilitiesKHR(Allocator* alloc, VkStructureType rootType,
+                                     const VkVideoCapabilitiesKHR* from,
+                                     VkVideoCapabilitiesKHR* to);
+
+void deepcopy_VkPhysicalDeviceVideoFormatInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                                 const VkPhysicalDeviceVideoFormatInfoKHR* from,
+                                                 VkPhysicalDeviceVideoFormatInfoKHR* to);
+
+void deepcopy_VkVideoFormatPropertiesKHR(Allocator* alloc, VkStructureType rootType,
+                                         const VkVideoFormatPropertiesKHR* from,
+                                         VkVideoFormatPropertiesKHR* to);
+
+void deepcopy_VkVideoPictureResourceKHR(Allocator* alloc, VkStructureType rootType,
+                                        const VkVideoPictureResourceKHR* from,
+                                        VkVideoPictureResourceKHR* to);
+
+void deepcopy_VkVideoReferenceSlotKHR(Allocator* alloc, VkStructureType rootType,
+                                      const VkVideoReferenceSlotKHR* from,
+                                      VkVideoReferenceSlotKHR* to);
+
+void deepcopy_VkVideoGetMemoryPropertiesKHR(Allocator* alloc, VkStructureType rootType,
+                                            const VkVideoGetMemoryPropertiesKHR* from,
+                                            VkVideoGetMemoryPropertiesKHR* to);
+
+void deepcopy_VkVideoBindMemoryKHR(Allocator* alloc, VkStructureType rootType,
+                                   const VkVideoBindMemoryKHR* from, VkVideoBindMemoryKHR* to);
+
+void deepcopy_VkVideoSessionCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                          const VkVideoSessionCreateInfoKHR* from,
+                                          VkVideoSessionCreateInfoKHR* to);
+
+void deepcopy_VkVideoSessionParametersCreateInfoKHR(
+    Allocator* alloc, VkStructureType rootType, const VkVideoSessionParametersCreateInfoKHR* from,
+    VkVideoSessionParametersCreateInfoKHR* to);
+
+void deepcopy_VkVideoSessionParametersUpdateInfoKHR(
+    Allocator* alloc, VkStructureType rootType, const VkVideoSessionParametersUpdateInfoKHR* from,
+    VkVideoSessionParametersUpdateInfoKHR* to);
+
+void deepcopy_VkVideoBeginCodingInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                        const VkVideoBeginCodingInfoKHR* from,
+                                        VkVideoBeginCodingInfoKHR* to);
+
+void deepcopy_VkVideoEndCodingInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                      const VkVideoEndCodingInfoKHR* from,
+                                      VkVideoEndCodingInfoKHR* to);
+
+void deepcopy_VkVideoCodingControlInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                          const VkVideoCodingControlInfoKHR* from,
+                                          VkVideoCodingControlInfoKHR* to);
+
+#endif
+#ifdef VK_KHR_video_decode_queue
+void deepcopy_VkVideoDecodeInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                   const VkVideoDecodeInfoKHR* from, VkVideoDecodeInfoKHR* to);
+
+#endif
+#ifdef VK_KHR_dynamic_rendering
+void deepcopy_VkRenderingAttachmentInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                           const VkRenderingAttachmentInfoKHR* from,
+                                           VkRenderingAttachmentInfoKHR* to);
+
+void deepcopy_VkRenderingInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                 const VkRenderingInfoKHR* from, VkRenderingInfoKHR* to);
+
+void deepcopy_VkPipelineRenderingCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                               const VkPipelineRenderingCreateInfoKHR* from,
+                                               VkPipelineRenderingCreateInfoKHR* to);
+
+void deepcopy_VkPhysicalDeviceDynamicRenderingFeaturesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceDynamicRenderingFeaturesKHR* from,
+    VkPhysicalDeviceDynamicRenderingFeaturesKHR* to);
+
+void deepcopy_VkCommandBufferInheritanceRenderingInfoKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkCommandBufferInheritanceRenderingInfoKHR* from,
+    VkCommandBufferInheritanceRenderingInfoKHR* to);
+
+void deepcopy_VkRenderingFragmentShadingRateAttachmentInfoKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkRenderingFragmentShadingRateAttachmentInfoKHR* from,
+    VkRenderingFragmentShadingRateAttachmentInfoKHR* to);
+
+void deepcopy_VkRenderingFragmentDensityMapAttachmentInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkRenderingFragmentDensityMapAttachmentInfoEXT* from,
+    VkRenderingFragmentDensityMapAttachmentInfoEXT* to);
+
+void deepcopy_VkAttachmentSampleCountInfoAMD(Allocator* alloc, VkStructureType rootType,
+                                             const VkAttachmentSampleCountInfoAMD* from,
+                                             VkAttachmentSampleCountInfoAMD* to);
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkAttachmentSampleCountInfoAMD,
+                      deepcopy_VkAttachmentSampleCountInfoNV)
+
+void deepcopy_VkMultiviewPerViewAttributesInfoNVX(Allocator* alloc, VkStructureType rootType,
+                                                  const VkMultiviewPerViewAttributesInfoNVX* from,
+                                                  VkMultiviewPerViewAttributesInfoNVX* to);
+
+#endif
+#ifdef VK_KHR_multiview
+DEFINE_ALIAS_FUNCTION(deepcopy_VkRenderPassMultiviewCreateInfo,
+                      deepcopy_VkRenderPassMultiviewCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceMultiviewFeatures,
+                      deepcopy_VkPhysicalDeviceMultiviewFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceMultiviewProperties,
+                      deepcopy_VkPhysicalDeviceMultiviewPropertiesKHR)
+
+#endif
+#ifdef VK_KHR_get_physical_device_properties2
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceFeatures2, deepcopy_VkPhysicalDeviceFeatures2KHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceProperties2, deepcopy_VkPhysicalDeviceProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkFormatProperties2, deepcopy_VkFormatProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkImageFormatProperties2, deepcopy_VkImageFormatProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceImageFormatInfo2,
+                      deepcopy_VkPhysicalDeviceImageFormatInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkQueueFamilyProperties2, deepcopy_VkQueueFamilyProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceMemoryProperties2,
+                      deepcopy_VkPhysicalDeviceMemoryProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkSparseImageFormatProperties2,
+                      deepcopy_VkSparseImageFormatProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceSparseImageFormatInfo2,
+                      deepcopy_VkPhysicalDeviceSparseImageFormatInfo2KHR)
+
+#endif
+#ifdef VK_KHR_device_group
+DEFINE_ALIAS_FUNCTION(deepcopy_VkMemoryAllocateFlagsInfo, deepcopy_VkMemoryAllocateFlagsInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkDeviceGroupRenderPassBeginInfo,
+                      deepcopy_VkDeviceGroupRenderPassBeginInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkDeviceGroupCommandBufferBeginInfo,
+                      deepcopy_VkDeviceGroupCommandBufferBeginInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkDeviceGroupSubmitInfo, deepcopy_VkDeviceGroupSubmitInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkDeviceGroupBindSparseInfo, deepcopy_VkDeviceGroupBindSparseInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkBindBufferMemoryDeviceGroupInfo,
+                      deepcopy_VkBindBufferMemoryDeviceGroupInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkBindImageMemoryDeviceGroupInfo,
+                      deepcopy_VkBindImageMemoryDeviceGroupInfoKHR)
+
+#endif
+#ifdef VK_KHR_shader_draw_parameters
+#endif
+#ifdef VK_KHR_maintenance1
+#endif
+#ifdef VK_KHR_device_group_creation
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceGroupProperties,
+                      deepcopy_VkPhysicalDeviceGroupPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkDeviceGroupDeviceCreateInfo,
+                      deepcopy_VkDeviceGroupDeviceCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_external_memory_capabilities
+DEFINE_ALIAS_FUNCTION(deepcopy_VkExternalMemoryProperties, deepcopy_VkExternalMemoryPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceExternalImageFormatInfo,
+                      deepcopy_VkPhysicalDeviceExternalImageFormatInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkExternalImageFormatProperties,
+                      deepcopy_VkExternalImageFormatPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceExternalBufferInfo,
+                      deepcopy_VkPhysicalDeviceExternalBufferInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkExternalBufferProperties, deepcopy_VkExternalBufferPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceIDProperties,
+                      deepcopy_VkPhysicalDeviceIDPropertiesKHR)
+
+#endif
+#ifdef VK_KHR_external_memory
+DEFINE_ALIAS_FUNCTION(deepcopy_VkExternalMemoryImageCreateInfo,
+                      deepcopy_VkExternalMemoryImageCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkExternalMemoryBufferCreateInfo,
+                      deepcopy_VkExternalMemoryBufferCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkExportMemoryAllocateInfo, deepcopy_VkExportMemoryAllocateInfoKHR)
+
+#endif
+#ifdef VK_KHR_external_memory_win32
+void deepcopy_VkImportMemoryWin32HandleInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                               const VkImportMemoryWin32HandleInfoKHR* from,
+                                               VkImportMemoryWin32HandleInfoKHR* to);
+
+void deepcopy_VkExportMemoryWin32HandleInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                               const VkExportMemoryWin32HandleInfoKHR* from,
+                                               VkExportMemoryWin32HandleInfoKHR* to);
+
+void deepcopy_VkMemoryWin32HandlePropertiesKHR(Allocator* alloc, VkStructureType rootType,
+                                               const VkMemoryWin32HandlePropertiesKHR* from,
+                                               VkMemoryWin32HandlePropertiesKHR* to);
+
+void deepcopy_VkMemoryGetWin32HandleInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                            const VkMemoryGetWin32HandleInfoKHR* from,
+                                            VkMemoryGetWin32HandleInfoKHR* to);
+
+#endif
+#ifdef VK_KHR_external_memory_fd
+void deepcopy_VkImportMemoryFdInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                      const VkImportMemoryFdInfoKHR* from,
+                                      VkImportMemoryFdInfoKHR* to);
+
+void deepcopy_VkMemoryFdPropertiesKHR(Allocator* alloc, VkStructureType rootType,
+                                      const VkMemoryFdPropertiesKHR* from,
+                                      VkMemoryFdPropertiesKHR* to);
+
+void deepcopy_VkMemoryGetFdInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                   const VkMemoryGetFdInfoKHR* from, VkMemoryGetFdInfoKHR* to);
+
+#endif
+#ifdef VK_KHR_win32_keyed_mutex
+void deepcopy_VkWin32KeyedMutexAcquireReleaseInfoKHR(
+    Allocator* alloc, VkStructureType rootType, const VkWin32KeyedMutexAcquireReleaseInfoKHR* from,
+    VkWin32KeyedMutexAcquireReleaseInfoKHR* to);
+
+#endif
+#ifdef VK_KHR_external_semaphore_capabilities
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceExternalSemaphoreInfo,
+                      deepcopy_VkPhysicalDeviceExternalSemaphoreInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkExternalSemaphoreProperties,
+                      deepcopy_VkExternalSemaphorePropertiesKHR)
+
+#endif
+#ifdef VK_KHR_external_semaphore
+DEFINE_ALIAS_FUNCTION(deepcopy_VkExportSemaphoreCreateInfo, deepcopy_VkExportSemaphoreCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+void deepcopy_VkImportSemaphoreWin32HandleInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                                  const VkImportSemaphoreWin32HandleInfoKHR* from,
+                                                  VkImportSemaphoreWin32HandleInfoKHR* to);
+
+void deepcopy_VkExportSemaphoreWin32HandleInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                                  const VkExportSemaphoreWin32HandleInfoKHR* from,
+                                                  VkExportSemaphoreWin32HandleInfoKHR* to);
+
+void deepcopy_VkD3D12FenceSubmitInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                        const VkD3D12FenceSubmitInfoKHR* from,
+                                        VkD3D12FenceSubmitInfoKHR* to);
+
+void deepcopy_VkSemaphoreGetWin32HandleInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                               const VkSemaphoreGetWin32HandleInfoKHR* from,
+                                               VkSemaphoreGetWin32HandleInfoKHR* to);
+
+#endif
+#ifdef VK_KHR_external_semaphore_fd
+void deepcopy_VkImportSemaphoreFdInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                         const VkImportSemaphoreFdInfoKHR* from,
+                                         VkImportSemaphoreFdInfoKHR* to);
+
+void deepcopy_VkSemaphoreGetFdInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                      const VkSemaphoreGetFdInfoKHR* from,
+                                      VkSemaphoreGetFdInfoKHR* to);
+
+#endif
+#ifdef VK_KHR_push_descriptor
+void deepcopy_VkPhysicalDevicePushDescriptorPropertiesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDevicePushDescriptorPropertiesKHR* from,
+    VkPhysicalDevicePushDescriptorPropertiesKHR* to);
+
+#endif
+#ifdef VK_KHR_shader_float16_int8
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceShaderFloat16Int8Features,
+                      deepcopy_VkPhysicalDeviceShaderFloat16Int8FeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceShaderFloat16Int8Features,
+                      deepcopy_VkPhysicalDeviceFloat16Int8FeaturesKHR)
+
+#endif
+#ifdef VK_KHR_16bit_storage
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDevice16BitStorageFeatures,
+                      deepcopy_VkPhysicalDevice16BitStorageFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_incremental_present
+void deepcopy_VkRectLayerKHR(Allocator* alloc, VkStructureType rootType, const VkRectLayerKHR* from,
+                             VkRectLayerKHR* to);
+
+void deepcopy_VkPresentRegionKHR(Allocator* alloc, VkStructureType rootType,
+                                 const VkPresentRegionKHR* from, VkPresentRegionKHR* to);
+
+void deepcopy_VkPresentRegionsKHR(Allocator* alloc, VkStructureType rootType,
+                                  const VkPresentRegionsKHR* from, VkPresentRegionsKHR* to);
+
+#endif
+#ifdef VK_KHR_descriptor_update_template
+DEFINE_ALIAS_FUNCTION(deepcopy_VkDescriptorUpdateTemplateEntry,
+                      deepcopy_VkDescriptorUpdateTemplateEntryKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkDescriptorUpdateTemplateCreateInfo,
+                      deepcopy_VkDescriptorUpdateTemplateCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_imageless_framebuffer
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceImagelessFramebufferFeatures,
+                      deepcopy_VkPhysicalDeviceImagelessFramebufferFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkFramebufferAttachmentsCreateInfo,
+                      deepcopy_VkFramebufferAttachmentsCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkFramebufferAttachmentImageInfo,
+                      deepcopy_VkFramebufferAttachmentImageInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkRenderPassAttachmentBeginInfo,
+                      deepcopy_VkRenderPassAttachmentBeginInfoKHR)
+
+#endif
+#ifdef VK_KHR_create_renderpass2
+DEFINE_ALIAS_FUNCTION(deepcopy_VkRenderPassCreateInfo2, deepcopy_VkRenderPassCreateInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkAttachmentDescription2, deepcopy_VkAttachmentDescription2KHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkAttachmentReference2, deepcopy_VkAttachmentReference2KHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkSubpassDescription2, deepcopy_VkSubpassDescription2KHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkSubpassDependency2, deepcopy_VkSubpassDependency2KHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkSubpassBeginInfo, deepcopy_VkSubpassBeginInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkSubpassEndInfo, deepcopy_VkSubpassEndInfoKHR)
+
+#endif
+#ifdef VK_KHR_shared_presentable_image
+void deepcopy_VkSharedPresentSurfaceCapabilitiesKHR(
+    Allocator* alloc, VkStructureType rootType, const VkSharedPresentSurfaceCapabilitiesKHR* from,
+    VkSharedPresentSurfaceCapabilitiesKHR* to);
+
+#endif
+#ifdef VK_KHR_external_fence_capabilities
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceExternalFenceInfo,
+                      deepcopy_VkPhysicalDeviceExternalFenceInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkExternalFenceProperties, deepcopy_VkExternalFencePropertiesKHR)
+
+#endif
+#ifdef VK_KHR_external_fence
+DEFINE_ALIAS_FUNCTION(deepcopy_VkExportFenceCreateInfo, deepcopy_VkExportFenceCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_external_fence_win32
+void deepcopy_VkImportFenceWin32HandleInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                              const VkImportFenceWin32HandleInfoKHR* from,
+                                              VkImportFenceWin32HandleInfoKHR* to);
+
+void deepcopy_VkExportFenceWin32HandleInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                              const VkExportFenceWin32HandleInfoKHR* from,
+                                              VkExportFenceWin32HandleInfoKHR* to);
+
+void deepcopy_VkFenceGetWin32HandleInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                           const VkFenceGetWin32HandleInfoKHR* from,
+                                           VkFenceGetWin32HandleInfoKHR* to);
+
+#endif
+#ifdef VK_KHR_external_fence_fd
+void deepcopy_VkImportFenceFdInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                     const VkImportFenceFdInfoKHR* from,
+                                     VkImportFenceFdInfoKHR* to);
+
+void deepcopy_VkFenceGetFdInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                  const VkFenceGetFdInfoKHR* from, VkFenceGetFdInfoKHR* to);
+
+#endif
+#ifdef VK_KHR_performance_query
+void deepcopy_VkPhysicalDevicePerformanceQueryFeaturesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDevicePerformanceQueryFeaturesKHR* from,
+    VkPhysicalDevicePerformanceQueryFeaturesKHR* to);
+
+void deepcopy_VkPhysicalDevicePerformanceQueryPropertiesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDevicePerformanceQueryPropertiesKHR* from,
+    VkPhysicalDevicePerformanceQueryPropertiesKHR* to);
+
+void deepcopy_VkPerformanceCounterKHR(Allocator* alloc, VkStructureType rootType,
+                                      const VkPerformanceCounterKHR* from,
+                                      VkPerformanceCounterKHR* to);
+
+void deepcopy_VkPerformanceCounterDescriptionKHR(Allocator* alloc, VkStructureType rootType,
+                                                 const VkPerformanceCounterDescriptionKHR* from,
+                                                 VkPerformanceCounterDescriptionKHR* to);
+
+void deepcopy_VkQueryPoolPerformanceCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                                  const VkQueryPoolPerformanceCreateInfoKHR* from,
+                                                  VkQueryPoolPerformanceCreateInfoKHR* to);
+
+void deepcopy_VkPerformanceCounterResultKHR(Allocator* alloc, VkStructureType rootType,
+                                            const VkPerformanceCounterResultKHR* from,
+                                            VkPerformanceCounterResultKHR* to);
+
+void deepcopy_VkAcquireProfilingLockInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                            const VkAcquireProfilingLockInfoKHR* from,
+                                            VkAcquireProfilingLockInfoKHR* to);
+
+void deepcopy_VkPerformanceQuerySubmitInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                              const VkPerformanceQuerySubmitInfoKHR* from,
+                                              VkPerformanceQuerySubmitInfoKHR* to);
+
+#endif
+#ifdef VK_KHR_maintenance2
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDevicePointClippingProperties,
+                      deepcopy_VkPhysicalDevicePointClippingPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkRenderPassInputAttachmentAspectCreateInfo,
+                      deepcopy_VkRenderPassInputAttachmentAspectCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkInputAttachmentAspectReference,
+                      deepcopy_VkInputAttachmentAspectReferenceKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkImageViewUsageCreateInfo, deepcopy_VkImageViewUsageCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPipelineTessellationDomainOriginStateCreateInfo,
+                      deepcopy_VkPipelineTessellationDomainOriginStateCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_get_surface_capabilities2
+void deepcopy_VkPhysicalDeviceSurfaceInfo2KHR(Allocator* alloc, VkStructureType rootType,
+                                              const VkPhysicalDeviceSurfaceInfo2KHR* from,
+                                              VkPhysicalDeviceSurfaceInfo2KHR* to);
+
+void deepcopy_VkSurfaceCapabilities2KHR(Allocator* alloc, VkStructureType rootType,
+                                        const VkSurfaceCapabilities2KHR* from,
+                                        VkSurfaceCapabilities2KHR* to);
+
+void deepcopy_VkSurfaceFormat2KHR(Allocator* alloc, VkStructureType rootType,
+                                  const VkSurfaceFormat2KHR* from, VkSurfaceFormat2KHR* to);
+
+#endif
+#ifdef VK_KHR_variable_pointers
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceVariablePointersFeatures,
+                      deepcopy_VkPhysicalDeviceVariablePointerFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceVariablePointersFeatures,
+                      deepcopy_VkPhysicalDeviceVariablePointersFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_get_display_properties2
+void deepcopy_VkDisplayProperties2KHR(Allocator* alloc, VkStructureType rootType,
+                                      const VkDisplayProperties2KHR* from,
+                                      VkDisplayProperties2KHR* to);
+
+void deepcopy_VkDisplayPlaneProperties2KHR(Allocator* alloc, VkStructureType rootType,
+                                           const VkDisplayPlaneProperties2KHR* from,
+                                           VkDisplayPlaneProperties2KHR* to);
+
+void deepcopy_VkDisplayModeProperties2KHR(Allocator* alloc, VkStructureType rootType,
+                                          const VkDisplayModeProperties2KHR* from,
+                                          VkDisplayModeProperties2KHR* to);
+
+void deepcopy_VkDisplayPlaneInfo2KHR(Allocator* alloc, VkStructureType rootType,
+                                     const VkDisplayPlaneInfo2KHR* from,
+                                     VkDisplayPlaneInfo2KHR* to);
+
+void deepcopy_VkDisplayPlaneCapabilities2KHR(Allocator* alloc, VkStructureType rootType,
+                                             const VkDisplayPlaneCapabilities2KHR* from,
+                                             VkDisplayPlaneCapabilities2KHR* to);
+
+#endif
+#ifdef VK_KHR_dedicated_allocation
+DEFINE_ALIAS_FUNCTION(deepcopy_VkMemoryDedicatedRequirements,
+                      deepcopy_VkMemoryDedicatedRequirementsKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkMemoryDedicatedAllocateInfo,
+                      deepcopy_VkMemoryDedicatedAllocateInfoKHR)
+
+#endif
+#ifdef VK_KHR_storage_buffer_storage_class
+#endif
+#ifdef VK_KHR_relaxed_block_layout
+#endif
+#ifdef VK_KHR_get_memory_requirements2
+DEFINE_ALIAS_FUNCTION(deepcopy_VkBufferMemoryRequirementsInfo2,
+                      deepcopy_VkBufferMemoryRequirementsInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkImageMemoryRequirementsInfo2,
+                      deepcopy_VkImageMemoryRequirementsInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkImageSparseMemoryRequirementsInfo2,
+                      deepcopy_VkImageSparseMemoryRequirementsInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkMemoryRequirements2, deepcopy_VkMemoryRequirements2KHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkSparseImageMemoryRequirements2,
+                      deepcopy_VkSparseImageMemoryRequirements2KHR)
+
+#endif
+#ifdef VK_KHR_image_format_list
+DEFINE_ALIAS_FUNCTION(deepcopy_VkImageFormatListCreateInfo, deepcopy_VkImageFormatListCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_sampler_ycbcr_conversion
+DEFINE_ALIAS_FUNCTION(deepcopy_VkSamplerYcbcrConversionCreateInfo,
+                      deepcopy_VkSamplerYcbcrConversionCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkSamplerYcbcrConversionInfo,
+                      deepcopy_VkSamplerYcbcrConversionInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkBindImagePlaneMemoryInfo, deepcopy_VkBindImagePlaneMemoryInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkImagePlaneMemoryRequirementsInfo,
+                      deepcopy_VkImagePlaneMemoryRequirementsInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceSamplerYcbcrConversionFeatures,
+                      deepcopy_VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkSamplerYcbcrConversionImageFormatProperties,
+                      deepcopy_VkSamplerYcbcrConversionImageFormatPropertiesKHR)
+
+#endif
+#ifdef VK_KHR_bind_memory2
+DEFINE_ALIAS_FUNCTION(deepcopy_VkBindBufferMemoryInfo, deepcopy_VkBindBufferMemoryInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkBindImageMemoryInfo, deepcopy_VkBindImageMemoryInfoKHR)
+
+#endif
+#ifdef VK_KHR_portability_subset
+void deepcopy_VkPhysicalDevicePortabilitySubsetFeaturesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDevicePortabilitySubsetFeaturesKHR* from,
+    VkPhysicalDevicePortabilitySubsetFeaturesKHR* to);
+
+void deepcopy_VkPhysicalDevicePortabilitySubsetPropertiesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDevicePortabilitySubsetPropertiesKHR* from,
+    VkPhysicalDevicePortabilitySubsetPropertiesKHR* to);
+
+#endif
+#ifdef VK_KHR_maintenance3
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceMaintenance3Properties,
+                      deepcopy_VkPhysicalDeviceMaintenance3PropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkDescriptorSetLayoutSupport,
+                      deepcopy_VkDescriptorSetLayoutSupportKHR)
+
+#endif
+#ifdef VK_KHR_draw_indirect_count
+#endif
+#ifdef VK_KHR_shader_subgroup_extended_types
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures,
+                      deepcopy_VkPhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_8bit_storage
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDevice8BitStorageFeatures,
+                      deepcopy_VkPhysicalDevice8BitStorageFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_shader_atomic_int64
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceShaderAtomicInt64Features,
+                      deepcopy_VkPhysicalDeviceShaderAtomicInt64FeaturesKHR)
+
+#endif
+#ifdef VK_KHR_shader_clock
+void deepcopy_VkPhysicalDeviceShaderClockFeaturesKHR(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceShaderClockFeaturesKHR* from,
+    VkPhysicalDeviceShaderClockFeaturesKHR* to);
+
+#endif
+#ifdef VK_KHR_driver_properties
+DEFINE_ALIAS_FUNCTION(deepcopy_VkConformanceVersion, deepcopy_VkConformanceVersionKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceDriverProperties,
+                      deepcopy_VkPhysicalDeviceDriverPropertiesKHR)
+
+#endif
+#ifdef VK_KHR_shader_float_controls
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceFloatControlsProperties,
+                      deepcopy_VkPhysicalDeviceFloatControlsPropertiesKHR)
+
+#endif
+#ifdef VK_KHR_depth_stencil_resolve
+DEFINE_ALIAS_FUNCTION(deepcopy_VkSubpassDescriptionDepthStencilResolve,
+                      deepcopy_VkSubpassDescriptionDepthStencilResolveKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceDepthStencilResolveProperties,
+                      deepcopy_VkPhysicalDeviceDepthStencilResolvePropertiesKHR)
+
+#endif
+#ifdef VK_KHR_swapchain_mutable_format
+#endif
+#ifdef VK_KHR_timeline_semaphore
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceTimelineSemaphoreFeatures,
+                      deepcopy_VkPhysicalDeviceTimelineSemaphoreFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceTimelineSemaphoreProperties,
+                      deepcopy_VkPhysicalDeviceTimelineSemaphorePropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkSemaphoreTypeCreateInfo, deepcopy_VkSemaphoreTypeCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkTimelineSemaphoreSubmitInfo,
+                      deepcopy_VkTimelineSemaphoreSubmitInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkSemaphoreWaitInfo, deepcopy_VkSemaphoreWaitInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkSemaphoreSignalInfo, deepcopy_VkSemaphoreSignalInfoKHR)
+
+#endif
+#ifdef VK_KHR_vulkan_memory_model
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceVulkanMemoryModelFeatures,
+                      deepcopy_VkPhysicalDeviceVulkanMemoryModelFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_shader_terminate_invocation
+void deepcopy_VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR* from,
+    VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR* to);
+
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+void deepcopy_VkFragmentShadingRateAttachmentInfoKHR(
+    Allocator* alloc, VkStructureType rootType, const VkFragmentShadingRateAttachmentInfoKHR* from,
+    VkFragmentShadingRateAttachmentInfoKHR* to);
+
+void deepcopy_VkPipelineFragmentShadingRateStateCreateInfoKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineFragmentShadingRateStateCreateInfoKHR* from,
+    VkPipelineFragmentShadingRateStateCreateInfoKHR* to);
+
+void deepcopy_VkPhysicalDeviceFragmentShadingRateFeaturesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateFeaturesKHR* from,
+    VkPhysicalDeviceFragmentShadingRateFeaturesKHR* to);
+
+void deepcopy_VkPhysicalDeviceFragmentShadingRatePropertiesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRatePropertiesKHR* from,
+    VkPhysicalDeviceFragmentShadingRatePropertiesKHR* to);
+
+void deepcopy_VkPhysicalDeviceFragmentShadingRateKHR(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceFragmentShadingRateKHR* from,
+    VkPhysicalDeviceFragmentShadingRateKHR* to);
+
+#endif
+#ifdef VK_KHR_spirv_1_4
+#endif
+#ifdef VK_KHR_surface_protected_capabilities
+void deepcopy_VkSurfaceProtectedCapabilitiesKHR(Allocator* alloc, VkStructureType rootType,
+                                                const VkSurfaceProtectedCapabilitiesKHR* from,
+                                                VkSurfaceProtectedCapabilitiesKHR* to);
+
+#endif
+#ifdef VK_KHR_separate_depth_stencil_layouts
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures,
+                      deepcopy_VkPhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkAttachmentReferenceStencilLayout,
+                      deepcopy_VkAttachmentReferenceStencilLayoutKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkAttachmentDescriptionStencilLayout,
+                      deepcopy_VkAttachmentDescriptionStencilLayoutKHR)
+
+#endif
+#ifdef VK_KHR_present_wait
+void deepcopy_VkPhysicalDevicePresentWaitFeaturesKHR(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDevicePresentWaitFeaturesKHR* from,
+    VkPhysicalDevicePresentWaitFeaturesKHR* to);
+
+#endif
+#ifdef VK_KHR_uniform_buffer_standard_layout
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceUniformBufferStandardLayoutFeatures,
+                      deepcopy_VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_buffer_device_address
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceBufferDeviceAddressFeatures,
+                      deepcopy_VkPhysicalDeviceBufferDeviceAddressFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkBufferDeviceAddressInfo, deepcopy_VkBufferDeviceAddressInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkBufferOpaqueCaptureAddressCreateInfo,
+                      deepcopy_VkBufferOpaqueCaptureAddressCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkMemoryOpaqueCaptureAddressAllocateInfo,
+                      deepcopy_VkMemoryOpaqueCaptureAddressAllocateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkDeviceMemoryOpaqueCaptureAddressInfo,
+                      deepcopy_VkDeviceMemoryOpaqueCaptureAddressInfoKHR)
+
+#endif
+#ifdef VK_KHR_deferred_host_operations
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+void deepcopy_VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR* from,
+    VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR* to);
+
+void deepcopy_VkPipelineInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                const VkPipelineInfoKHR* from, VkPipelineInfoKHR* to);
+
+void deepcopy_VkPipelineExecutablePropertiesKHR(Allocator* alloc, VkStructureType rootType,
+                                                const VkPipelineExecutablePropertiesKHR* from,
+                                                VkPipelineExecutablePropertiesKHR* to);
+
+void deepcopy_VkPipelineExecutableInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                          const VkPipelineExecutableInfoKHR* from,
+                                          VkPipelineExecutableInfoKHR* to);
+
+void deepcopy_VkPipelineExecutableStatisticValueKHR(
+    Allocator* alloc, VkStructureType rootType, const VkPipelineExecutableStatisticValueKHR* from,
+    VkPipelineExecutableStatisticValueKHR* to);
+
+void deepcopy_VkPipelineExecutableStatisticKHR(Allocator* alloc, VkStructureType rootType,
+                                               const VkPipelineExecutableStatisticKHR* from,
+                                               VkPipelineExecutableStatisticKHR* to);
+
+void deepcopy_VkPipelineExecutableInternalRepresentationKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineExecutableInternalRepresentationKHR* from,
+    VkPipelineExecutableInternalRepresentationKHR* to);
+
+#endif
+#ifdef VK_KHR_shader_integer_dot_product
+void deepcopy_VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR* from,
+    VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR* to);
+
+void deepcopy_VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR* from,
+    VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR* to);
+
+#endif
+#ifdef VK_KHR_pipeline_library
+void deepcopy_VkPipelineLibraryCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                             const VkPipelineLibraryCreateInfoKHR* from,
+                                             VkPipelineLibraryCreateInfoKHR* to);
+
+#endif
+#ifdef VK_KHR_shader_non_semantic_info
+#endif
+#ifdef VK_KHR_present_id
+void deepcopy_VkPresentIdKHR(Allocator* alloc, VkStructureType rootType, const VkPresentIdKHR* from,
+                             VkPresentIdKHR* to);
+
+void deepcopy_VkPhysicalDevicePresentIdFeaturesKHR(Allocator* alloc, VkStructureType rootType,
+                                                   const VkPhysicalDevicePresentIdFeaturesKHR* from,
+                                                   VkPhysicalDevicePresentIdFeaturesKHR* to);
+
+#endif
+#ifdef VK_KHR_video_encode_queue
+void deepcopy_VkVideoEncodeInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                   const VkVideoEncodeInfoKHR* from, VkVideoEncodeInfoKHR* to);
+
+void deepcopy_VkVideoEncodeRateControlInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                              const VkVideoEncodeRateControlInfoKHR* from,
+                                              VkVideoEncodeRateControlInfoKHR* to);
+
+#endif
+#ifdef VK_KHR_synchronization2
+void deepcopy_VkMemoryBarrier2KHR(Allocator* alloc, VkStructureType rootType,
+                                  const VkMemoryBarrier2KHR* from, VkMemoryBarrier2KHR* to);
+
+void deepcopy_VkBufferMemoryBarrier2KHR(Allocator* alloc, VkStructureType rootType,
+                                        const VkBufferMemoryBarrier2KHR* from,
+                                        VkBufferMemoryBarrier2KHR* to);
+
+void deepcopy_VkImageMemoryBarrier2KHR(Allocator* alloc, VkStructureType rootType,
+                                       const VkImageMemoryBarrier2KHR* from,
+                                       VkImageMemoryBarrier2KHR* to);
+
+void deepcopy_VkDependencyInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                  const VkDependencyInfoKHR* from, VkDependencyInfoKHR* to);
+
+void deepcopy_VkSemaphoreSubmitInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                       const VkSemaphoreSubmitInfoKHR* from,
+                                       VkSemaphoreSubmitInfoKHR* to);
+
+void deepcopy_VkCommandBufferSubmitInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                           const VkCommandBufferSubmitInfoKHR* from,
+                                           VkCommandBufferSubmitInfoKHR* to);
+
+void deepcopy_VkSubmitInfo2KHR(Allocator* alloc, VkStructureType rootType,
+                               const VkSubmitInfo2KHR* from, VkSubmitInfo2KHR* to);
+
+void deepcopy_VkPhysicalDeviceSynchronization2FeaturesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceSynchronization2FeaturesKHR* from,
+    VkPhysicalDeviceSynchronization2FeaturesKHR* to);
+
+void deepcopy_VkQueueFamilyCheckpointProperties2NV(Allocator* alloc, VkStructureType rootType,
+                                                   const VkQueueFamilyCheckpointProperties2NV* from,
+                                                   VkQueueFamilyCheckpointProperties2NV* to);
+
+void deepcopy_VkCheckpointData2NV(Allocator* alloc, VkStructureType rootType,
+                                  const VkCheckpointData2NV* from, VkCheckpointData2NV* to);
+
+#endif
+#ifdef VK_KHR_shader_subgroup_uniform_control_flow
+void deepcopy_VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR* from,
+    VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR* to);
+
+#endif
+#ifdef VK_KHR_zero_initialize_workgroup_memory
+void deepcopy_VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR* from,
+    VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR* to);
+
+#endif
+#ifdef VK_KHR_workgroup_memory_explicit_layout
+void deepcopy_VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR* from,
+    VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR* to);
+
+#endif
+#ifdef VK_KHR_copy_commands2
+void deepcopy_VkBufferCopy2KHR(Allocator* alloc, VkStructureType rootType,
+                               const VkBufferCopy2KHR* from, VkBufferCopy2KHR* to);
+
+void deepcopy_VkCopyBufferInfo2KHR(Allocator* alloc, VkStructureType rootType,
+                                   const VkCopyBufferInfo2KHR* from, VkCopyBufferInfo2KHR* to);
+
+void deepcopy_VkImageCopy2KHR(Allocator* alloc, VkStructureType rootType,
+                              const VkImageCopy2KHR* from, VkImageCopy2KHR* to);
+
+void deepcopy_VkCopyImageInfo2KHR(Allocator* alloc, VkStructureType rootType,
+                                  const VkCopyImageInfo2KHR* from, VkCopyImageInfo2KHR* to);
+
+void deepcopy_VkBufferImageCopy2KHR(Allocator* alloc, VkStructureType rootType,
+                                    const VkBufferImageCopy2KHR* from, VkBufferImageCopy2KHR* to);
+
+void deepcopy_VkCopyBufferToImageInfo2KHR(Allocator* alloc, VkStructureType rootType,
+                                          const VkCopyBufferToImageInfo2KHR* from,
+                                          VkCopyBufferToImageInfo2KHR* to);
+
+void deepcopy_VkCopyImageToBufferInfo2KHR(Allocator* alloc, VkStructureType rootType,
+                                          const VkCopyImageToBufferInfo2KHR* from,
+                                          VkCopyImageToBufferInfo2KHR* to);
+
+void deepcopy_VkImageBlit2KHR(Allocator* alloc, VkStructureType rootType,
+                              const VkImageBlit2KHR* from, VkImageBlit2KHR* to);
+
+void deepcopy_VkBlitImageInfo2KHR(Allocator* alloc, VkStructureType rootType,
+                                  const VkBlitImageInfo2KHR* from, VkBlitImageInfo2KHR* to);
+
+void deepcopy_VkImageResolve2KHR(Allocator* alloc, VkStructureType rootType,
+                                 const VkImageResolve2KHR* from, VkImageResolve2KHR* to);
+
+void deepcopy_VkResolveImageInfo2KHR(Allocator* alloc, VkStructureType rootType,
+                                     const VkResolveImageInfo2KHR* from,
+                                     VkResolveImageInfo2KHR* to);
+
+#endif
+#ifdef VK_KHR_format_feature_flags2
+void deepcopy_VkFormatProperties3KHR(Allocator* alloc, VkStructureType rootType,
+                                     const VkFormatProperties3KHR* from,
+                                     VkFormatProperties3KHR* to);
+
+#endif
+#ifdef VK_KHR_maintenance4
+void deepcopy_VkPhysicalDeviceMaintenance4FeaturesKHR(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceMaintenance4FeaturesKHR* from,
+    VkPhysicalDeviceMaintenance4FeaturesKHR* to);
+
+void deepcopy_VkPhysicalDeviceMaintenance4PropertiesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceMaintenance4PropertiesKHR* from,
+    VkPhysicalDeviceMaintenance4PropertiesKHR* to);
+
+void deepcopy_VkDeviceBufferMemoryRequirementsKHR(Allocator* alloc, VkStructureType rootType,
+                                                  const VkDeviceBufferMemoryRequirementsKHR* from,
+                                                  VkDeviceBufferMemoryRequirementsKHR* to);
+
+void deepcopy_VkDeviceImageMemoryRequirementsKHR(Allocator* alloc, VkStructureType rootType,
+                                                 const VkDeviceImageMemoryRequirementsKHR* from,
+                                                 VkDeviceImageMemoryRequirementsKHR* to);
+
+#endif
+#ifdef VK_ANDROID_native_buffer
+void deepcopy_VkNativeBufferANDROID(Allocator* alloc, VkStructureType rootType,
+                                    const VkNativeBufferANDROID* from, VkNativeBufferANDROID* to);
+
+#endif
+#ifdef VK_EXT_debug_report
+void deepcopy_VkDebugReportCallbackCreateInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                                 const VkDebugReportCallbackCreateInfoEXT* from,
+                                                 VkDebugReportCallbackCreateInfoEXT* to);
+
+#endif
+#ifdef VK_NV_glsl_shader
+#endif
+#ifdef VK_EXT_depth_range_unrestricted
+#endif
+#ifdef VK_IMG_filter_cubic
+#endif
+#ifdef VK_AMD_rasterization_order
+void deepcopy_VkPipelineRasterizationStateRasterizationOrderAMD(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineRasterizationStateRasterizationOrderAMD* from,
+    VkPipelineRasterizationStateRasterizationOrderAMD* to);
+
+#endif
+#ifdef VK_AMD_shader_trinary_minmax
+#endif
+#ifdef VK_AMD_shader_explicit_vertex_parameter
+#endif
+#ifdef VK_EXT_debug_marker
+void deepcopy_VkDebugMarkerObjectNameInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                             const VkDebugMarkerObjectNameInfoEXT* from,
+                                             VkDebugMarkerObjectNameInfoEXT* to);
+
+void deepcopy_VkDebugMarkerObjectTagInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                            const VkDebugMarkerObjectTagInfoEXT* from,
+                                            VkDebugMarkerObjectTagInfoEXT* to);
+
+void deepcopy_VkDebugMarkerMarkerInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                         const VkDebugMarkerMarkerInfoEXT* from,
+                                         VkDebugMarkerMarkerInfoEXT* to);
+
+#endif
+#ifdef VK_AMD_gcn_shader
+#endif
+#ifdef VK_NV_dedicated_allocation
+void deepcopy_VkDedicatedAllocationImageCreateInfoNV(
+    Allocator* alloc, VkStructureType rootType, const VkDedicatedAllocationImageCreateInfoNV* from,
+    VkDedicatedAllocationImageCreateInfoNV* to);
+
+void deepcopy_VkDedicatedAllocationBufferCreateInfoNV(
+    Allocator* alloc, VkStructureType rootType, const VkDedicatedAllocationBufferCreateInfoNV* from,
+    VkDedicatedAllocationBufferCreateInfoNV* to);
+
+void deepcopy_VkDedicatedAllocationMemoryAllocateInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkDedicatedAllocationMemoryAllocateInfoNV* from,
+    VkDedicatedAllocationMemoryAllocateInfoNV* to);
+
+#endif
+#ifdef VK_EXT_transform_feedback
+void deepcopy_VkPhysicalDeviceTransformFeedbackFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceTransformFeedbackFeaturesEXT* from,
+    VkPhysicalDeviceTransformFeedbackFeaturesEXT* to);
+
+void deepcopy_VkPhysicalDeviceTransformFeedbackPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceTransformFeedbackPropertiesEXT* from,
+    VkPhysicalDeviceTransformFeedbackPropertiesEXT* to);
+
+void deepcopy_VkPipelineRasterizationStateStreamCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineRasterizationStateStreamCreateInfoEXT* from,
+    VkPipelineRasterizationStateStreamCreateInfoEXT* to);
+
+#endif
+#ifdef VK_NVX_binary_import
+void deepcopy_VkCuModuleCreateInfoNVX(Allocator* alloc, VkStructureType rootType,
+                                      const VkCuModuleCreateInfoNVX* from,
+                                      VkCuModuleCreateInfoNVX* to);
+
+void deepcopy_VkCuFunctionCreateInfoNVX(Allocator* alloc, VkStructureType rootType,
+                                        const VkCuFunctionCreateInfoNVX* from,
+                                        VkCuFunctionCreateInfoNVX* to);
+
+void deepcopy_VkCuLaunchInfoNVX(Allocator* alloc, VkStructureType rootType,
+                                const VkCuLaunchInfoNVX* from, VkCuLaunchInfoNVX* to);
+
+#endif
+#ifdef VK_NVX_image_view_handle
+void deepcopy_VkImageViewHandleInfoNVX(Allocator* alloc, VkStructureType rootType,
+                                       const VkImageViewHandleInfoNVX* from,
+                                       VkImageViewHandleInfoNVX* to);
+
+void deepcopy_VkImageViewAddressPropertiesNVX(Allocator* alloc, VkStructureType rootType,
+                                              const VkImageViewAddressPropertiesNVX* from,
+                                              VkImageViewAddressPropertiesNVX* to);
+
+#endif
+#ifdef VK_AMD_draw_indirect_count
+#endif
+#ifdef VK_AMD_negative_viewport_height
+#endif
+#ifdef VK_AMD_gpu_shader_half_float
+#endif
+#ifdef VK_AMD_shader_ballot
+#endif
+#ifdef VK_EXT_video_encode_h264
+void deepcopy_VkVideoEncodeH264CapabilitiesEXT(Allocator* alloc, VkStructureType rootType,
+                                               const VkVideoEncodeH264CapabilitiesEXT* from,
+                                               VkVideoEncodeH264CapabilitiesEXT* to);
+
+void deepcopy_VkVideoEncodeH264SessionCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType, const VkVideoEncodeH264SessionCreateInfoEXT* from,
+    VkVideoEncodeH264SessionCreateInfoEXT* to);
+
+void deepcopy_VkVideoEncodeH264SessionParametersAddInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkVideoEncodeH264SessionParametersAddInfoEXT* from,
+    VkVideoEncodeH264SessionParametersAddInfoEXT* to);
+
+void deepcopy_VkVideoEncodeH264SessionParametersCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkVideoEncodeH264SessionParametersCreateInfoEXT* from,
+    VkVideoEncodeH264SessionParametersCreateInfoEXT* to);
+
+void deepcopy_VkVideoEncodeH264DpbSlotInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                              const VkVideoEncodeH264DpbSlotInfoEXT* from,
+                                              VkVideoEncodeH264DpbSlotInfoEXT* to);
+
+void deepcopy_VkVideoEncodeH264NaluSliceEXT(Allocator* alloc, VkStructureType rootType,
+                                            const VkVideoEncodeH264NaluSliceEXT* from,
+                                            VkVideoEncodeH264NaluSliceEXT* to);
+
+void deepcopy_VkVideoEncodeH264VclFrameInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                               const VkVideoEncodeH264VclFrameInfoEXT* from,
+                                               VkVideoEncodeH264VclFrameInfoEXT* to);
+
+void deepcopy_VkVideoEncodeH264EmitPictureParametersEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkVideoEncodeH264EmitPictureParametersEXT* from,
+    VkVideoEncodeH264EmitPictureParametersEXT* to);
+
+void deepcopy_VkVideoEncodeH264ProfileEXT(Allocator* alloc, VkStructureType rootType,
+                                          const VkVideoEncodeH264ProfileEXT* from,
+                                          VkVideoEncodeH264ProfileEXT* to);
+
+#endif
+#ifdef VK_EXT_video_encode_h265
+void deepcopy_VkVideoEncodeH265CapabilitiesEXT(Allocator* alloc, VkStructureType rootType,
+                                               const VkVideoEncodeH265CapabilitiesEXT* from,
+                                               VkVideoEncodeH265CapabilitiesEXT* to);
+
+void deepcopy_VkVideoEncodeH265SessionCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType, const VkVideoEncodeH265SessionCreateInfoEXT* from,
+    VkVideoEncodeH265SessionCreateInfoEXT* to);
+
+void deepcopy_VkVideoEncodeH265SessionParametersAddInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkVideoEncodeH265SessionParametersAddInfoEXT* from,
+    VkVideoEncodeH265SessionParametersAddInfoEXT* to);
+
+void deepcopy_VkVideoEncodeH265SessionParametersCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkVideoEncodeH265SessionParametersCreateInfoEXT* from,
+    VkVideoEncodeH265SessionParametersCreateInfoEXT* to);
+
+void deepcopy_VkVideoEncodeH265DpbSlotInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                              const VkVideoEncodeH265DpbSlotInfoEXT* from,
+                                              VkVideoEncodeH265DpbSlotInfoEXT* to);
+
+void deepcopy_VkVideoEncodeH265ReferenceListsEXT(Allocator* alloc, VkStructureType rootType,
+                                                 const VkVideoEncodeH265ReferenceListsEXT* from,
+                                                 VkVideoEncodeH265ReferenceListsEXT* to);
+
+void deepcopy_VkVideoEncodeH265NaluSliceEXT(Allocator* alloc, VkStructureType rootType,
+                                            const VkVideoEncodeH265NaluSliceEXT* from,
+                                            VkVideoEncodeH265NaluSliceEXT* to);
+
+void deepcopy_VkVideoEncodeH265VclFrameInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                               const VkVideoEncodeH265VclFrameInfoEXT* from,
+                                               VkVideoEncodeH265VclFrameInfoEXT* to);
+
+void deepcopy_VkVideoEncodeH265EmitPictureParametersEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkVideoEncodeH265EmitPictureParametersEXT* from,
+    VkVideoEncodeH265EmitPictureParametersEXT* to);
+
+void deepcopy_VkVideoEncodeH265ProfileEXT(Allocator* alloc, VkStructureType rootType,
+                                          const VkVideoEncodeH265ProfileEXT* from,
+                                          VkVideoEncodeH265ProfileEXT* to);
+
+#endif
+#ifdef VK_EXT_video_decode_h264
+void deepcopy_VkVideoDecodeH264ProfileEXT(Allocator* alloc, VkStructureType rootType,
+                                          const VkVideoDecodeH264ProfileEXT* from,
+                                          VkVideoDecodeH264ProfileEXT* to);
+
+void deepcopy_VkVideoDecodeH264CapabilitiesEXT(Allocator* alloc, VkStructureType rootType,
+                                               const VkVideoDecodeH264CapabilitiesEXT* from,
+                                               VkVideoDecodeH264CapabilitiesEXT* to);
+
+void deepcopy_VkVideoDecodeH264SessionCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType, const VkVideoDecodeH264SessionCreateInfoEXT* from,
+    VkVideoDecodeH264SessionCreateInfoEXT* to);
+
+void deepcopy_VkVideoDecodeH264SessionParametersAddInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkVideoDecodeH264SessionParametersAddInfoEXT* from,
+    VkVideoDecodeH264SessionParametersAddInfoEXT* to);
+
+void deepcopy_VkVideoDecodeH264SessionParametersCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkVideoDecodeH264SessionParametersCreateInfoEXT* from,
+    VkVideoDecodeH264SessionParametersCreateInfoEXT* to);
+
+void deepcopy_VkVideoDecodeH264PictureInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                              const VkVideoDecodeH264PictureInfoEXT* from,
+                                              VkVideoDecodeH264PictureInfoEXT* to);
+
+void deepcopy_VkVideoDecodeH264MvcEXT(Allocator* alloc, VkStructureType rootType,
+                                      const VkVideoDecodeH264MvcEXT* from,
+                                      VkVideoDecodeH264MvcEXT* to);
+
+void deepcopy_VkVideoDecodeH264DpbSlotInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                              const VkVideoDecodeH264DpbSlotInfoEXT* from,
+                                              VkVideoDecodeH264DpbSlotInfoEXT* to);
+
+#endif
+#ifdef VK_AMD_texture_gather_bias_lod
+void deepcopy_VkTextureLODGatherFormatPropertiesAMD(
+    Allocator* alloc, VkStructureType rootType, const VkTextureLODGatherFormatPropertiesAMD* from,
+    VkTextureLODGatherFormatPropertiesAMD* to);
+
+#endif
+#ifdef VK_AMD_shader_info
+void deepcopy_VkShaderResourceUsageAMD(Allocator* alloc, VkStructureType rootType,
+                                       const VkShaderResourceUsageAMD* from,
+                                       VkShaderResourceUsageAMD* to);
+
+void deepcopy_VkShaderStatisticsInfoAMD(Allocator* alloc, VkStructureType rootType,
+                                        const VkShaderStatisticsInfoAMD* from,
+                                        VkShaderStatisticsInfoAMD* to);
+
+#endif
+#ifdef VK_AMD_shader_image_load_store_lod
+#endif
+#ifdef VK_GGP_stream_descriptor_surface
+void deepcopy_VkStreamDescriptorSurfaceCreateInfoGGP(
+    Allocator* alloc, VkStructureType rootType, const VkStreamDescriptorSurfaceCreateInfoGGP* from,
+    VkStreamDescriptorSurfaceCreateInfoGGP* to);
+
+#endif
+#ifdef VK_NV_corner_sampled_image
+void deepcopy_VkPhysicalDeviceCornerSampledImageFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceCornerSampledImageFeaturesNV* from,
+    VkPhysicalDeviceCornerSampledImageFeaturesNV* to);
+
+#endif
+#ifdef VK_IMG_format_pvrtc
+#endif
+#ifdef VK_NV_external_memory_capabilities
+void deepcopy_VkExternalImageFormatPropertiesNV(Allocator* alloc, VkStructureType rootType,
+                                                const VkExternalImageFormatPropertiesNV* from,
+                                                VkExternalImageFormatPropertiesNV* to);
+
+#endif
+#ifdef VK_NV_external_memory
+void deepcopy_VkExternalMemoryImageCreateInfoNV(Allocator* alloc, VkStructureType rootType,
+                                                const VkExternalMemoryImageCreateInfoNV* from,
+                                                VkExternalMemoryImageCreateInfoNV* to);
+
+void deepcopy_VkExportMemoryAllocateInfoNV(Allocator* alloc, VkStructureType rootType,
+                                           const VkExportMemoryAllocateInfoNV* from,
+                                           VkExportMemoryAllocateInfoNV* to);
+
+#endif
+#ifdef VK_NV_external_memory_win32
+void deepcopy_VkImportMemoryWin32HandleInfoNV(Allocator* alloc, VkStructureType rootType,
+                                              const VkImportMemoryWin32HandleInfoNV* from,
+                                              VkImportMemoryWin32HandleInfoNV* to);
+
+void deepcopy_VkExportMemoryWin32HandleInfoNV(Allocator* alloc, VkStructureType rootType,
+                                              const VkExportMemoryWin32HandleInfoNV* from,
+                                              VkExportMemoryWin32HandleInfoNV* to);
+
+#endif
+#ifdef VK_NV_win32_keyed_mutex
+void deepcopy_VkWin32KeyedMutexAcquireReleaseInfoNV(
+    Allocator* alloc, VkStructureType rootType, const VkWin32KeyedMutexAcquireReleaseInfoNV* from,
+    VkWin32KeyedMutexAcquireReleaseInfoNV* to);
+
+#endif
+#ifdef VK_EXT_validation_flags
+void deepcopy_VkValidationFlagsEXT(Allocator* alloc, VkStructureType rootType,
+                                   const VkValidationFlagsEXT* from, VkValidationFlagsEXT* to);
+
+#endif
+#ifdef VK_NN_vi_surface
+void deepcopy_VkViSurfaceCreateInfoNN(Allocator* alloc, VkStructureType rootType,
+                                      const VkViSurfaceCreateInfoNN* from,
+                                      VkViSurfaceCreateInfoNN* to);
+
+#endif
+#ifdef VK_EXT_shader_subgroup_ballot
+#endif
+#ifdef VK_EXT_shader_subgroup_vote
+#endif
+#ifdef VK_EXT_texture_compression_astc_hdr
+void deepcopy_VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT* from,
+    VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT* to);
+
+#endif
+#ifdef VK_EXT_astc_decode_mode
+void deepcopy_VkImageViewASTCDecodeModeEXT(Allocator* alloc, VkStructureType rootType,
+                                           const VkImageViewASTCDecodeModeEXT* from,
+                                           VkImageViewASTCDecodeModeEXT* to);
+
+void deepcopy_VkPhysicalDeviceASTCDecodeFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceASTCDecodeFeaturesEXT* from,
+    VkPhysicalDeviceASTCDecodeFeaturesEXT* to);
+
+#endif
+#ifdef VK_EXT_conditional_rendering
+void deepcopy_VkConditionalRenderingBeginInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                                 const VkConditionalRenderingBeginInfoEXT* from,
+                                                 VkConditionalRenderingBeginInfoEXT* to);
+
+void deepcopy_VkPhysicalDeviceConditionalRenderingFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceConditionalRenderingFeaturesEXT* from,
+    VkPhysicalDeviceConditionalRenderingFeaturesEXT* to);
+
+void deepcopy_VkCommandBufferInheritanceConditionalRenderingInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkCommandBufferInheritanceConditionalRenderingInfoEXT* from,
+    VkCommandBufferInheritanceConditionalRenderingInfoEXT* to);
+
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+void deepcopy_VkViewportWScalingNV(Allocator* alloc, VkStructureType rootType,
+                                   const VkViewportWScalingNV* from, VkViewportWScalingNV* to);
+
+void deepcopy_VkPipelineViewportWScalingStateCreateInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineViewportWScalingStateCreateInfoNV* from,
+    VkPipelineViewportWScalingStateCreateInfoNV* to);
+
+#endif
+#ifdef VK_EXT_direct_mode_display
+#endif
+#ifdef VK_EXT_acquire_xlib_display
+#endif
+#ifdef VK_EXT_display_surface_counter
+void deepcopy_VkSurfaceCapabilities2EXT(Allocator* alloc, VkStructureType rootType,
+                                        const VkSurfaceCapabilities2EXT* from,
+                                        VkSurfaceCapabilities2EXT* to);
+
+#endif
+#ifdef VK_EXT_display_control
+void deepcopy_VkDisplayPowerInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                    const VkDisplayPowerInfoEXT* from, VkDisplayPowerInfoEXT* to);
+
+void deepcopy_VkDeviceEventInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                   const VkDeviceEventInfoEXT* from, VkDeviceEventInfoEXT* to);
+
+void deepcopy_VkDisplayEventInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                    const VkDisplayEventInfoEXT* from, VkDisplayEventInfoEXT* to);
+
+void deepcopy_VkSwapchainCounterCreateInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                              const VkSwapchainCounterCreateInfoEXT* from,
+                                              VkSwapchainCounterCreateInfoEXT* to);
+
+#endif
+#ifdef VK_GOOGLE_display_timing
+void deepcopy_VkRefreshCycleDurationGOOGLE(Allocator* alloc, VkStructureType rootType,
+                                           const VkRefreshCycleDurationGOOGLE* from,
+                                           VkRefreshCycleDurationGOOGLE* to);
+
+void deepcopy_VkPastPresentationTimingGOOGLE(Allocator* alloc, VkStructureType rootType,
+                                             const VkPastPresentationTimingGOOGLE* from,
+                                             VkPastPresentationTimingGOOGLE* to);
+
+void deepcopy_VkPresentTimeGOOGLE(Allocator* alloc, VkStructureType rootType,
+                                  const VkPresentTimeGOOGLE* from, VkPresentTimeGOOGLE* to);
+
+void deepcopy_VkPresentTimesInfoGOOGLE(Allocator* alloc, VkStructureType rootType,
+                                       const VkPresentTimesInfoGOOGLE* from,
+                                       VkPresentTimesInfoGOOGLE* to);
+
+#endif
+#ifdef VK_NV_sample_mask_override_coverage
+#endif
+#ifdef VK_NV_geometry_shader_passthrough
+#endif
+#ifdef VK_NV_viewport_array2
+#endif
+#ifdef VK_NVX_multiview_per_view_attributes
+void deepcopy_VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX* from,
+    VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX* to);
+
+#endif
+#ifdef VK_NV_viewport_swizzle
+void deepcopy_VkViewportSwizzleNV(Allocator* alloc, VkStructureType rootType,
+                                  const VkViewportSwizzleNV* from, VkViewportSwizzleNV* to);
+
+void deepcopy_VkPipelineViewportSwizzleStateCreateInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineViewportSwizzleStateCreateInfoNV* from,
+    VkPipelineViewportSwizzleStateCreateInfoNV* to);
+
+#endif
+#ifdef VK_EXT_discard_rectangles
+void deepcopy_VkPhysicalDeviceDiscardRectanglePropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceDiscardRectanglePropertiesEXT* from,
+    VkPhysicalDeviceDiscardRectanglePropertiesEXT* to);
+
+void deepcopy_VkPipelineDiscardRectangleStateCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineDiscardRectangleStateCreateInfoEXT* from,
+    VkPipelineDiscardRectangleStateCreateInfoEXT* to);
+
+#endif
+#ifdef VK_EXT_conservative_rasterization
+void deepcopy_VkPhysicalDeviceConservativeRasterizationPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceConservativeRasterizationPropertiesEXT* from,
+    VkPhysicalDeviceConservativeRasterizationPropertiesEXT* to);
+
+void deepcopy_VkPipelineRasterizationConservativeStateCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineRasterizationConservativeStateCreateInfoEXT* from,
+    VkPipelineRasterizationConservativeStateCreateInfoEXT* to);
+
+#endif
+#ifdef VK_EXT_depth_clip_enable
+void deepcopy_VkPhysicalDeviceDepthClipEnableFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceDepthClipEnableFeaturesEXT* from,
+    VkPhysicalDeviceDepthClipEnableFeaturesEXT* to);
+
+void deepcopy_VkPipelineRasterizationDepthClipStateCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineRasterizationDepthClipStateCreateInfoEXT* from,
+    VkPipelineRasterizationDepthClipStateCreateInfoEXT* to);
+
+#endif
+#ifdef VK_EXT_swapchain_colorspace
+#endif
+#ifdef VK_EXT_hdr_metadata
+void deepcopy_VkXYColorEXT(Allocator* alloc, VkStructureType rootType, const VkXYColorEXT* from,
+                           VkXYColorEXT* to);
+
+void deepcopy_VkHdrMetadataEXT(Allocator* alloc, VkStructureType rootType,
+                               const VkHdrMetadataEXT* from, VkHdrMetadataEXT* to);
+
+#endif
+#ifdef VK_MVK_ios_surface
+void deepcopy_VkIOSSurfaceCreateInfoMVK(Allocator* alloc, VkStructureType rootType,
+                                        const VkIOSSurfaceCreateInfoMVK* from,
+                                        VkIOSSurfaceCreateInfoMVK* to);
+
+#endif
+#ifdef VK_MVK_macos_surface
+void deepcopy_VkMacOSSurfaceCreateInfoMVK(Allocator* alloc, VkStructureType rootType,
+                                          const VkMacOSSurfaceCreateInfoMVK* from,
+                                          VkMacOSSurfaceCreateInfoMVK* to);
+
+#endif
+#ifdef VK_MVK_moltenvk
+#endif
+#ifdef VK_EXT_external_memory_dma_buf
+#endif
+#ifdef VK_EXT_queue_family_foreign
+#endif
+#ifdef VK_EXT_debug_utils
+void deepcopy_VkDebugUtilsLabelEXT(Allocator* alloc, VkStructureType rootType,
+                                   const VkDebugUtilsLabelEXT* from, VkDebugUtilsLabelEXT* to);
+
+void deepcopy_VkDebugUtilsObjectNameInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                            const VkDebugUtilsObjectNameInfoEXT* from,
+                                            VkDebugUtilsObjectNameInfoEXT* to);
+
+void deepcopy_VkDebugUtilsMessengerCallbackDataEXT(Allocator* alloc, VkStructureType rootType,
+                                                   const VkDebugUtilsMessengerCallbackDataEXT* from,
+                                                   VkDebugUtilsMessengerCallbackDataEXT* to);
+
+void deepcopy_VkDebugUtilsMessengerCreateInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                                 const VkDebugUtilsMessengerCreateInfoEXT* from,
+                                                 VkDebugUtilsMessengerCreateInfoEXT* to);
+
+void deepcopy_VkDebugUtilsObjectTagInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                           const VkDebugUtilsObjectTagInfoEXT* from,
+                                           VkDebugUtilsObjectTagInfoEXT* to);
+
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+void deepcopy_VkAndroidHardwareBufferUsageANDROID(Allocator* alloc, VkStructureType rootType,
+                                                  const VkAndroidHardwareBufferUsageANDROID* from,
+                                                  VkAndroidHardwareBufferUsageANDROID* to);
+
+void deepcopy_VkAndroidHardwareBufferPropertiesANDROID(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAndroidHardwareBufferPropertiesANDROID* from,
+    VkAndroidHardwareBufferPropertiesANDROID* to);
+
+void deepcopy_VkAndroidHardwareBufferFormatPropertiesANDROID(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAndroidHardwareBufferFormatPropertiesANDROID* from,
+    VkAndroidHardwareBufferFormatPropertiesANDROID* to);
+
+void deepcopy_VkImportAndroidHardwareBufferInfoANDROID(
+    Allocator* alloc, VkStructureType rootType,
+    const VkImportAndroidHardwareBufferInfoANDROID* from,
+    VkImportAndroidHardwareBufferInfoANDROID* to);
+
+void deepcopy_VkMemoryGetAndroidHardwareBufferInfoANDROID(
+    Allocator* alloc, VkStructureType rootType,
+    const VkMemoryGetAndroidHardwareBufferInfoANDROID* from,
+    VkMemoryGetAndroidHardwareBufferInfoANDROID* to);
+
+void deepcopy_VkExternalFormatANDROID(Allocator* alloc, VkStructureType rootType,
+                                      const VkExternalFormatANDROID* from,
+                                      VkExternalFormatANDROID* to);
+
+void deepcopy_VkAndroidHardwareBufferFormatProperties2ANDROID(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAndroidHardwareBufferFormatProperties2ANDROID* from,
+    VkAndroidHardwareBufferFormatProperties2ANDROID* to);
+
+#endif
+#ifdef VK_EXT_sampler_filter_minmax
+DEFINE_ALIAS_FUNCTION(deepcopy_VkSamplerReductionModeCreateInfo,
+                      deepcopy_VkSamplerReductionModeCreateInfoEXT)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceSamplerFilterMinmaxProperties,
+                      deepcopy_VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT)
+
+#endif
+#ifdef VK_AMD_gpu_shader_int16
+#endif
+#ifdef VK_AMD_mixed_attachment_samples
+#endif
+#ifdef VK_AMD_shader_fragment_mask
+#endif
+#ifdef VK_EXT_inline_uniform_block
+void deepcopy_VkPhysicalDeviceInlineUniformBlockFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceInlineUniformBlockFeaturesEXT* from,
+    VkPhysicalDeviceInlineUniformBlockFeaturesEXT* to);
+
+void deepcopy_VkPhysicalDeviceInlineUniformBlockPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceInlineUniformBlockPropertiesEXT* from,
+    VkPhysicalDeviceInlineUniformBlockPropertiesEXT* to);
+
+void deepcopy_VkWriteDescriptorSetInlineUniformBlockEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkWriteDescriptorSetInlineUniformBlockEXT* from,
+    VkWriteDescriptorSetInlineUniformBlockEXT* to);
+
+void deepcopy_VkDescriptorPoolInlineUniformBlockCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkDescriptorPoolInlineUniformBlockCreateInfoEXT* from,
+    VkDescriptorPoolInlineUniformBlockCreateInfoEXT* to);
+
+#endif
+#ifdef VK_EXT_shader_stencil_export
+#endif
+#ifdef VK_EXT_sample_locations
+void deepcopy_VkSampleLocationEXT(Allocator* alloc, VkStructureType rootType,
+                                  const VkSampleLocationEXT* from, VkSampleLocationEXT* to);
+
+void deepcopy_VkSampleLocationsInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                       const VkSampleLocationsInfoEXT* from,
+                                       VkSampleLocationsInfoEXT* to);
+
+void deepcopy_VkAttachmentSampleLocationsEXT(Allocator* alloc, VkStructureType rootType,
+                                             const VkAttachmentSampleLocationsEXT* from,
+                                             VkAttachmentSampleLocationsEXT* to);
+
+void deepcopy_VkSubpassSampleLocationsEXT(Allocator* alloc, VkStructureType rootType,
+                                          const VkSubpassSampleLocationsEXT* from,
+                                          VkSubpassSampleLocationsEXT* to);
+
+void deepcopy_VkRenderPassSampleLocationsBeginInfoEXT(
+    Allocator* alloc, VkStructureType rootType, const VkRenderPassSampleLocationsBeginInfoEXT* from,
+    VkRenderPassSampleLocationsBeginInfoEXT* to);
+
+void deepcopy_VkPipelineSampleLocationsStateCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineSampleLocationsStateCreateInfoEXT* from,
+    VkPipelineSampleLocationsStateCreateInfoEXT* to);
+
+void deepcopy_VkPhysicalDeviceSampleLocationsPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceSampleLocationsPropertiesEXT* from,
+    VkPhysicalDeviceSampleLocationsPropertiesEXT* to);
+
+void deepcopy_VkMultisamplePropertiesEXT(Allocator* alloc, VkStructureType rootType,
+                                         const VkMultisamplePropertiesEXT* from,
+                                         VkMultisamplePropertiesEXT* to);
+
+#endif
+#ifdef VK_EXT_blend_operation_advanced
+void deepcopy_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT* from,
+    VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT* to);
+
+void deepcopy_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT* from,
+    VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT* to);
+
+void deepcopy_VkPipelineColorBlendAdvancedStateCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineColorBlendAdvancedStateCreateInfoEXT* from,
+    VkPipelineColorBlendAdvancedStateCreateInfoEXT* to);
+
+#endif
+#ifdef VK_NV_fragment_coverage_to_color
+void deepcopy_VkPipelineCoverageToColorStateCreateInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineCoverageToColorStateCreateInfoNV* from,
+    VkPipelineCoverageToColorStateCreateInfoNV* to);
+
+#endif
+#ifdef VK_NV_framebuffer_mixed_samples
+void deepcopy_VkPipelineCoverageModulationStateCreateInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineCoverageModulationStateCreateInfoNV* from,
+    VkPipelineCoverageModulationStateCreateInfoNV* to);
+
+#endif
+#ifdef VK_NV_fill_rectangle
+#endif
+#ifdef VK_NV_shader_sm_builtins
+void deepcopy_VkPhysicalDeviceShaderSMBuiltinsPropertiesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSMBuiltinsPropertiesNV* from,
+    VkPhysicalDeviceShaderSMBuiltinsPropertiesNV* to);
+
+void deepcopy_VkPhysicalDeviceShaderSMBuiltinsFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSMBuiltinsFeaturesNV* from,
+    VkPhysicalDeviceShaderSMBuiltinsFeaturesNV* to);
+
+#endif
+#ifdef VK_EXT_post_depth_coverage
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+void deepcopy_VkDrmFormatModifierPropertiesEXT(Allocator* alloc, VkStructureType rootType,
+                                               const VkDrmFormatModifierPropertiesEXT* from,
+                                               VkDrmFormatModifierPropertiesEXT* to);
+
+void deepcopy_VkDrmFormatModifierPropertiesListEXT(Allocator* alloc, VkStructureType rootType,
+                                                   const VkDrmFormatModifierPropertiesListEXT* from,
+                                                   VkDrmFormatModifierPropertiesListEXT* to);
+
+void deepcopy_VkPhysicalDeviceImageDrmFormatModifierInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceImageDrmFormatModifierInfoEXT* from,
+    VkPhysicalDeviceImageDrmFormatModifierInfoEXT* to);
+
+void deepcopy_VkImageDrmFormatModifierListCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkImageDrmFormatModifierListCreateInfoEXT* from,
+    VkImageDrmFormatModifierListCreateInfoEXT* to);
+
+void deepcopy_VkImageDrmFormatModifierExplicitCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkImageDrmFormatModifierExplicitCreateInfoEXT* from,
+    VkImageDrmFormatModifierExplicitCreateInfoEXT* to);
+
+void deepcopy_VkImageDrmFormatModifierPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType, const VkImageDrmFormatModifierPropertiesEXT* from,
+    VkImageDrmFormatModifierPropertiesEXT* to);
+
+void deepcopy_VkDrmFormatModifierProperties2EXT(Allocator* alloc, VkStructureType rootType,
+                                                const VkDrmFormatModifierProperties2EXT* from,
+                                                VkDrmFormatModifierProperties2EXT* to);
+
+void deepcopy_VkDrmFormatModifierPropertiesList2EXT(
+    Allocator* alloc, VkStructureType rootType, const VkDrmFormatModifierPropertiesList2EXT* from,
+    VkDrmFormatModifierPropertiesList2EXT* to);
+
+#endif
+#ifdef VK_EXT_validation_cache
+void deepcopy_VkValidationCacheCreateInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                             const VkValidationCacheCreateInfoEXT* from,
+                                             VkValidationCacheCreateInfoEXT* to);
+
+void deepcopy_VkShaderModuleValidationCacheCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkShaderModuleValidationCacheCreateInfoEXT* from,
+    VkShaderModuleValidationCacheCreateInfoEXT* to);
+
+#endif
+#ifdef VK_EXT_descriptor_indexing
+DEFINE_ALIAS_FUNCTION(deepcopy_VkDescriptorSetLayoutBindingFlagsCreateInfo,
+                      deepcopy_VkDescriptorSetLayoutBindingFlagsCreateInfoEXT)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceDescriptorIndexingFeatures,
+                      deepcopy_VkPhysicalDeviceDescriptorIndexingFeaturesEXT)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceDescriptorIndexingProperties,
+                      deepcopy_VkPhysicalDeviceDescriptorIndexingPropertiesEXT)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkDescriptorSetVariableDescriptorCountAllocateInfo,
+                      deepcopy_VkDescriptorSetVariableDescriptorCountAllocateInfoEXT)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkDescriptorSetVariableDescriptorCountLayoutSupport,
+                      deepcopy_VkDescriptorSetVariableDescriptorCountLayoutSupportEXT)
+
+#endif
+#ifdef VK_EXT_shader_viewport_index_layer
+#endif
+#ifdef VK_NV_shading_rate_image
+void deepcopy_VkShadingRatePaletteNV(Allocator* alloc, VkStructureType rootType,
+                                     const VkShadingRatePaletteNV* from,
+                                     VkShadingRatePaletteNV* to);
+
+void deepcopy_VkPipelineViewportShadingRateImageStateCreateInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineViewportShadingRateImageStateCreateInfoNV* from,
+    VkPipelineViewportShadingRateImageStateCreateInfoNV* to);
+
+void deepcopy_VkPhysicalDeviceShadingRateImageFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShadingRateImageFeaturesNV* from,
+    VkPhysicalDeviceShadingRateImageFeaturesNV* to);
+
+void deepcopy_VkPhysicalDeviceShadingRateImagePropertiesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShadingRateImagePropertiesNV* from,
+    VkPhysicalDeviceShadingRateImagePropertiesNV* to);
+
+void deepcopy_VkCoarseSampleLocationNV(Allocator* alloc, VkStructureType rootType,
+                                       const VkCoarseSampleLocationNV* from,
+                                       VkCoarseSampleLocationNV* to);
+
+void deepcopy_VkCoarseSampleOrderCustomNV(Allocator* alloc, VkStructureType rootType,
+                                          const VkCoarseSampleOrderCustomNV* from,
+                                          VkCoarseSampleOrderCustomNV* to);
+
+void deepcopy_VkPipelineViewportCoarseSampleOrderStateCreateInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineViewportCoarseSampleOrderStateCreateInfoNV* from,
+    VkPipelineViewportCoarseSampleOrderStateCreateInfoNV* to);
+
+#endif
+#ifdef VK_NV_ray_tracing
+void deepcopy_VkRayTracingShaderGroupCreateInfoNV(Allocator* alloc, VkStructureType rootType,
+                                                  const VkRayTracingShaderGroupCreateInfoNV* from,
+                                                  VkRayTracingShaderGroupCreateInfoNV* to);
+
+void deepcopy_VkRayTracingPipelineCreateInfoNV(Allocator* alloc, VkStructureType rootType,
+                                               const VkRayTracingPipelineCreateInfoNV* from,
+                                               VkRayTracingPipelineCreateInfoNV* to);
+
+void deepcopy_VkGeometryTrianglesNV(Allocator* alloc, VkStructureType rootType,
+                                    const VkGeometryTrianglesNV* from, VkGeometryTrianglesNV* to);
+
+void deepcopy_VkGeometryAABBNV(Allocator* alloc, VkStructureType rootType,
+                               const VkGeometryAABBNV* from, VkGeometryAABBNV* to);
+
+void deepcopy_VkGeometryDataNV(Allocator* alloc, VkStructureType rootType,
+                               const VkGeometryDataNV* from, VkGeometryDataNV* to);
+
+void deepcopy_VkGeometryNV(Allocator* alloc, VkStructureType rootType, const VkGeometryNV* from,
+                           VkGeometryNV* to);
+
+void deepcopy_VkAccelerationStructureInfoNV(Allocator* alloc, VkStructureType rootType,
+                                            const VkAccelerationStructureInfoNV* from,
+                                            VkAccelerationStructureInfoNV* to);
+
+void deepcopy_VkAccelerationStructureCreateInfoNV(Allocator* alloc, VkStructureType rootType,
+                                                  const VkAccelerationStructureCreateInfoNV* from,
+                                                  VkAccelerationStructureCreateInfoNV* to);
+
+void deepcopy_VkBindAccelerationStructureMemoryInfoNV(
+    Allocator* alloc, VkStructureType rootType, const VkBindAccelerationStructureMemoryInfoNV* from,
+    VkBindAccelerationStructureMemoryInfoNV* to);
+
+void deepcopy_VkWriteDescriptorSetAccelerationStructureNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkWriteDescriptorSetAccelerationStructureNV* from,
+    VkWriteDescriptorSetAccelerationStructureNV* to);
+
+void deepcopy_VkAccelerationStructureMemoryRequirementsInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAccelerationStructureMemoryRequirementsInfoNV* from,
+    VkAccelerationStructureMemoryRequirementsInfoNV* to);
+
+void deepcopy_VkPhysicalDeviceRayTracingPropertiesNV(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceRayTracingPropertiesNV* from,
+    VkPhysicalDeviceRayTracingPropertiesNV* to);
+
+void deepcopy_VkTransformMatrixKHR(Allocator* alloc, VkStructureType rootType,
+                                   const VkTransformMatrixKHR* from, VkTransformMatrixKHR* to);
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkTransformMatrixKHR, deepcopy_VkTransformMatrixNV)
+
+void deepcopy_VkAabbPositionsKHR(Allocator* alloc, VkStructureType rootType,
+                                 const VkAabbPositionsKHR* from, VkAabbPositionsKHR* to);
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkAabbPositionsKHR, deepcopy_VkAabbPositionsNV)
+
+void deepcopy_VkAccelerationStructureInstanceKHR(Allocator* alloc, VkStructureType rootType,
+                                                 const VkAccelerationStructureInstanceKHR* from,
+                                                 VkAccelerationStructureInstanceKHR* to);
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkAccelerationStructureInstanceKHR,
+                      deepcopy_VkAccelerationStructureInstanceNV)
+
+#endif
+#ifdef VK_NV_representative_fragment_test
+void deepcopy_VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV* from,
+    VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV* to);
+
+void deepcopy_VkPipelineRepresentativeFragmentTestStateCreateInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineRepresentativeFragmentTestStateCreateInfoNV* from,
+    VkPipelineRepresentativeFragmentTestStateCreateInfoNV* to);
+
+#endif
+#ifdef VK_EXT_filter_cubic
+void deepcopy_VkPhysicalDeviceImageViewImageFormatInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceImageViewImageFormatInfoEXT* from,
+    VkPhysicalDeviceImageViewImageFormatInfoEXT* to);
+
+void deepcopy_VkFilterCubicImageViewImageFormatPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkFilterCubicImageViewImageFormatPropertiesEXT* from,
+    VkFilterCubicImageViewImageFormatPropertiesEXT* to);
+
+#endif
+#ifdef VK_QCOM_render_pass_shader_resolve
+#endif
+#ifdef VK_EXT_global_priority
+void deepcopy_VkDeviceQueueGlobalPriorityCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkDeviceQueueGlobalPriorityCreateInfoEXT* from,
+    VkDeviceQueueGlobalPriorityCreateInfoEXT* to);
+
+#endif
+#ifdef VK_EXT_external_memory_host
+void deepcopy_VkImportMemoryHostPointerInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                               const VkImportMemoryHostPointerInfoEXT* from,
+                                               VkImportMemoryHostPointerInfoEXT* to);
+
+void deepcopy_VkMemoryHostPointerPropertiesEXT(Allocator* alloc, VkStructureType rootType,
+                                               const VkMemoryHostPointerPropertiesEXT* from,
+                                               VkMemoryHostPointerPropertiesEXT* to);
+
+void deepcopy_VkPhysicalDeviceExternalMemoryHostPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceExternalMemoryHostPropertiesEXT* from,
+    VkPhysicalDeviceExternalMemoryHostPropertiesEXT* to);
+
+#endif
+#ifdef VK_AMD_buffer_marker
+#endif
+#ifdef VK_AMD_pipeline_compiler_control
+void deepcopy_VkPipelineCompilerControlCreateInfoAMD(
+    Allocator* alloc, VkStructureType rootType, const VkPipelineCompilerControlCreateInfoAMD* from,
+    VkPipelineCompilerControlCreateInfoAMD* to);
+
+#endif
+#ifdef VK_EXT_calibrated_timestamps
+void deepcopy_VkCalibratedTimestampInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                           const VkCalibratedTimestampInfoEXT* from,
+                                           VkCalibratedTimestampInfoEXT* to);
+
+#endif
+#ifdef VK_AMD_shader_core_properties
+void deepcopy_VkPhysicalDeviceShaderCorePropertiesAMD(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceShaderCorePropertiesAMD* from,
+    VkPhysicalDeviceShaderCorePropertiesAMD* to);
+
+#endif
+#ifdef VK_EXT_video_decode_h265
+void deepcopy_VkVideoDecodeH265ProfileEXT(Allocator* alloc, VkStructureType rootType,
+                                          const VkVideoDecodeH265ProfileEXT* from,
+                                          VkVideoDecodeH265ProfileEXT* to);
+
+void deepcopy_VkVideoDecodeH265CapabilitiesEXT(Allocator* alloc, VkStructureType rootType,
+                                               const VkVideoDecodeH265CapabilitiesEXT* from,
+                                               VkVideoDecodeH265CapabilitiesEXT* to);
+
+void deepcopy_VkVideoDecodeH265SessionCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType, const VkVideoDecodeH265SessionCreateInfoEXT* from,
+    VkVideoDecodeH265SessionCreateInfoEXT* to);
+
+void deepcopy_VkVideoDecodeH265SessionParametersAddInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkVideoDecodeH265SessionParametersAddInfoEXT* from,
+    VkVideoDecodeH265SessionParametersAddInfoEXT* to);
+
+void deepcopy_VkVideoDecodeH265SessionParametersCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkVideoDecodeH265SessionParametersCreateInfoEXT* from,
+    VkVideoDecodeH265SessionParametersCreateInfoEXT* to);
+
+void deepcopy_VkVideoDecodeH265PictureInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                              const VkVideoDecodeH265PictureInfoEXT* from,
+                                              VkVideoDecodeH265PictureInfoEXT* to);
+
+void deepcopy_VkVideoDecodeH265DpbSlotInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                              const VkVideoDecodeH265DpbSlotInfoEXT* from,
+                                              VkVideoDecodeH265DpbSlotInfoEXT* to);
+
+#endif
+#ifdef VK_AMD_memory_overallocation_behavior
+void deepcopy_VkDeviceMemoryOverallocationCreateInfoAMD(
+    Allocator* alloc, VkStructureType rootType,
+    const VkDeviceMemoryOverallocationCreateInfoAMD* from,
+    VkDeviceMemoryOverallocationCreateInfoAMD* to);
+
+#endif
+#ifdef VK_EXT_vertex_attribute_divisor
+void deepcopy_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT* from,
+    VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT* to);
+
+void deepcopy_VkVertexInputBindingDivisorDescriptionEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkVertexInputBindingDivisorDescriptionEXT* from,
+    VkVertexInputBindingDivisorDescriptionEXT* to);
+
+void deepcopy_VkPipelineVertexInputDivisorStateCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineVertexInputDivisorStateCreateInfoEXT* from,
+    VkPipelineVertexInputDivisorStateCreateInfoEXT* to);
+
+void deepcopy_VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT* from,
+    VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT* to);
+
+#endif
+#ifdef VK_GGP_frame_token
+void deepcopy_VkPresentFrameTokenGGP(Allocator* alloc, VkStructureType rootType,
+                                     const VkPresentFrameTokenGGP* from,
+                                     VkPresentFrameTokenGGP* to);
+
+#endif
+#ifdef VK_EXT_pipeline_creation_feedback
+void deepcopy_VkPipelineCreationFeedbackEXT(Allocator* alloc, VkStructureType rootType,
+                                            const VkPipelineCreationFeedbackEXT* from,
+                                            VkPipelineCreationFeedbackEXT* to);
+
+void deepcopy_VkPipelineCreationFeedbackCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType, const VkPipelineCreationFeedbackCreateInfoEXT* from,
+    VkPipelineCreationFeedbackCreateInfoEXT* to);
+
+#endif
+#ifdef VK_NV_shader_subgroup_partitioned
+#endif
+#ifdef VK_NV_compute_shader_derivatives
+void deepcopy_VkPhysicalDeviceComputeShaderDerivativesFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceComputeShaderDerivativesFeaturesNV* from,
+    VkPhysicalDeviceComputeShaderDerivativesFeaturesNV* to);
+
+#endif
+#ifdef VK_NV_mesh_shader
+void deepcopy_VkPhysicalDeviceMeshShaderFeaturesNV(Allocator* alloc, VkStructureType rootType,
+                                                   const VkPhysicalDeviceMeshShaderFeaturesNV* from,
+                                                   VkPhysicalDeviceMeshShaderFeaturesNV* to);
+
+void deepcopy_VkPhysicalDeviceMeshShaderPropertiesNV(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceMeshShaderPropertiesNV* from,
+    VkPhysicalDeviceMeshShaderPropertiesNV* to);
+
+void deepcopy_VkDrawMeshTasksIndirectCommandNV(Allocator* alloc, VkStructureType rootType,
+                                               const VkDrawMeshTasksIndirectCommandNV* from,
+                                               VkDrawMeshTasksIndirectCommandNV* to);
+
+#endif
+#ifdef VK_NV_fragment_shader_barycentric
+void deepcopy_VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV* from,
+    VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV* to);
+
+#endif
+#ifdef VK_NV_shader_image_footprint
+void deepcopy_VkPhysicalDeviceShaderImageFootprintFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderImageFootprintFeaturesNV* from,
+    VkPhysicalDeviceShaderImageFootprintFeaturesNV* to);
+
+#endif
+#ifdef VK_NV_scissor_exclusive
+void deepcopy_VkPipelineViewportExclusiveScissorStateCreateInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineViewportExclusiveScissorStateCreateInfoNV* from,
+    VkPipelineViewportExclusiveScissorStateCreateInfoNV* to);
+
+void deepcopy_VkPhysicalDeviceExclusiveScissorFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceExclusiveScissorFeaturesNV* from,
+    VkPhysicalDeviceExclusiveScissorFeaturesNV* to);
+
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+void deepcopy_VkQueueFamilyCheckpointPropertiesNV(Allocator* alloc, VkStructureType rootType,
+                                                  const VkQueueFamilyCheckpointPropertiesNV* from,
+                                                  VkQueueFamilyCheckpointPropertiesNV* to);
+
+void deepcopy_VkCheckpointDataNV(Allocator* alloc, VkStructureType rootType,
+                                 const VkCheckpointDataNV* from, VkCheckpointDataNV* to);
+
+#endif
+#ifdef VK_INTEL_shader_integer_functions2
+void deepcopy_VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL* from,
+    VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL* to);
+
+#endif
+#ifdef VK_INTEL_performance_query
+void deepcopy_VkPerformanceValueDataINTEL(Allocator* alloc, VkStructureType rootType,
+                                          const VkPerformanceValueDataINTEL* from,
+                                          VkPerformanceValueDataINTEL* to);
+
+void deepcopy_VkPerformanceValueINTEL(Allocator* alloc, VkStructureType rootType,
+                                      const VkPerformanceValueINTEL* from,
+                                      VkPerformanceValueINTEL* to);
+
+void deepcopy_VkInitializePerformanceApiInfoINTEL(Allocator* alloc, VkStructureType rootType,
+                                                  const VkInitializePerformanceApiInfoINTEL* from,
+                                                  VkInitializePerformanceApiInfoINTEL* to);
+
+void deepcopy_VkQueryPoolPerformanceQueryCreateInfoINTEL(
+    Allocator* alloc, VkStructureType rootType,
+    const VkQueryPoolPerformanceQueryCreateInfoINTEL* from,
+    VkQueryPoolPerformanceQueryCreateInfoINTEL* to);
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkQueryPoolPerformanceQueryCreateInfoINTEL,
+                      deepcopy_VkQueryPoolCreateInfoINTEL)
+
+void deepcopy_VkPerformanceMarkerInfoINTEL(Allocator* alloc, VkStructureType rootType,
+                                           const VkPerformanceMarkerInfoINTEL* from,
+                                           VkPerformanceMarkerInfoINTEL* to);
+
+void deepcopy_VkPerformanceStreamMarkerInfoINTEL(Allocator* alloc, VkStructureType rootType,
+                                                 const VkPerformanceStreamMarkerInfoINTEL* from,
+                                                 VkPerformanceStreamMarkerInfoINTEL* to);
+
+void deepcopy_VkPerformanceOverrideInfoINTEL(Allocator* alloc, VkStructureType rootType,
+                                             const VkPerformanceOverrideInfoINTEL* from,
+                                             VkPerformanceOverrideInfoINTEL* to);
+
+void deepcopy_VkPerformanceConfigurationAcquireInfoINTEL(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPerformanceConfigurationAcquireInfoINTEL* from,
+    VkPerformanceConfigurationAcquireInfoINTEL* to);
+
+#endif
+#ifdef VK_EXT_pci_bus_info
+void deepcopy_VkPhysicalDevicePCIBusInfoPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDevicePCIBusInfoPropertiesEXT* from,
+    VkPhysicalDevicePCIBusInfoPropertiesEXT* to);
+
+#endif
+#ifdef VK_AMD_display_native_hdr
+void deepcopy_VkDisplayNativeHdrSurfaceCapabilitiesAMD(
+    Allocator* alloc, VkStructureType rootType,
+    const VkDisplayNativeHdrSurfaceCapabilitiesAMD* from,
+    VkDisplayNativeHdrSurfaceCapabilitiesAMD* to);
+
+void deepcopy_VkSwapchainDisplayNativeHdrCreateInfoAMD(
+    Allocator* alloc, VkStructureType rootType,
+    const VkSwapchainDisplayNativeHdrCreateInfoAMD* from,
+    VkSwapchainDisplayNativeHdrCreateInfoAMD* to);
+
+#endif
+#ifdef VK_FUCHSIA_imagepipe_surface
+void deepcopy_VkImagePipeSurfaceCreateInfoFUCHSIA(Allocator* alloc, VkStructureType rootType,
+                                                  const VkImagePipeSurfaceCreateInfoFUCHSIA* from,
+                                                  VkImagePipeSurfaceCreateInfoFUCHSIA* to);
+
+#endif
+#ifdef VK_EXT_metal_surface
+void deepcopy_VkMetalSurfaceCreateInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                          const VkMetalSurfaceCreateInfoEXT* from,
+                                          VkMetalSurfaceCreateInfoEXT* to);
+
+#endif
+#ifdef VK_EXT_fragment_density_map
+void deepcopy_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMapFeaturesEXT* from,
+    VkPhysicalDeviceFragmentDensityMapFeaturesEXT* to);
+
+void deepcopy_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMapPropertiesEXT* from,
+    VkPhysicalDeviceFragmentDensityMapPropertiesEXT* to);
+
+void deepcopy_VkRenderPassFragmentDensityMapCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkRenderPassFragmentDensityMapCreateInfoEXT* from,
+    VkRenderPassFragmentDensityMapCreateInfoEXT* to);
+
+#endif
+#ifdef VK_EXT_scalar_block_layout
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceScalarBlockLayoutFeatures,
+                      deepcopy_VkPhysicalDeviceScalarBlockLayoutFeaturesEXT)
+
+#endif
+#ifdef VK_GOOGLE_hlsl_functionality1
+#endif
+#ifdef VK_GOOGLE_decorate_string
+#endif
+#ifdef VK_EXT_subgroup_size_control
+void deepcopy_VkPhysicalDeviceSubgroupSizeControlFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceSubgroupSizeControlFeaturesEXT* from,
+    VkPhysicalDeviceSubgroupSizeControlFeaturesEXT* to);
+
+void deepcopy_VkPhysicalDeviceSubgroupSizeControlPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceSubgroupSizeControlPropertiesEXT* from,
+    VkPhysicalDeviceSubgroupSizeControlPropertiesEXT* to);
+
+void deepcopy_VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT* from,
+    VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT* to);
+
+#endif
+#ifdef VK_AMD_shader_core_properties2
+void deepcopy_VkPhysicalDeviceShaderCoreProperties2AMD(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderCoreProperties2AMD* from,
+    VkPhysicalDeviceShaderCoreProperties2AMD* to);
+
+#endif
+#ifdef VK_AMD_device_coherent_memory
+void deepcopy_VkPhysicalDeviceCoherentMemoryFeaturesAMD(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceCoherentMemoryFeaturesAMD* from,
+    VkPhysicalDeviceCoherentMemoryFeaturesAMD* to);
+
+#endif
+#ifdef VK_EXT_shader_image_atomic_int64
+void deepcopy_VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT* from,
+    VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT* to);
+
+#endif
+#ifdef VK_EXT_memory_budget
+void deepcopy_VkPhysicalDeviceMemoryBudgetPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceMemoryBudgetPropertiesEXT* from,
+    VkPhysicalDeviceMemoryBudgetPropertiesEXT* to);
+
+#endif
+#ifdef VK_EXT_memory_priority
+void deepcopy_VkPhysicalDeviceMemoryPriorityFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceMemoryPriorityFeaturesEXT* from,
+    VkPhysicalDeviceMemoryPriorityFeaturesEXT* to);
+
+void deepcopy_VkMemoryPriorityAllocateInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                              const VkMemoryPriorityAllocateInfoEXT* from,
+                                              VkMemoryPriorityAllocateInfoEXT* to);
+
+#endif
+#ifdef VK_NV_dedicated_allocation_image_aliasing
+void deepcopy_VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV* from,
+    VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV* to);
+
+#endif
+#ifdef VK_EXT_buffer_device_address
+void deepcopy_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT* from,
+    VkPhysicalDeviceBufferDeviceAddressFeaturesEXT* to);
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT,
+                      deepcopy_VkPhysicalDeviceBufferAddressFeaturesEXT)
+
+DEFINE_ALIAS_FUNCTION(deepcopy_VkBufferDeviceAddressInfo, deepcopy_VkBufferDeviceAddressInfoEXT)
+
+void deepcopy_VkBufferDeviceAddressCreateInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                                 const VkBufferDeviceAddressCreateInfoEXT* from,
+                                                 VkBufferDeviceAddressCreateInfoEXT* to);
+
+#endif
+#ifdef VK_EXT_tooling_info
+void deepcopy_VkPhysicalDeviceToolPropertiesEXT(Allocator* alloc, VkStructureType rootType,
+                                                const VkPhysicalDeviceToolPropertiesEXT* from,
+                                                VkPhysicalDeviceToolPropertiesEXT* to);
+
+#endif
+#ifdef VK_EXT_separate_stencil_usage
+DEFINE_ALIAS_FUNCTION(deepcopy_VkImageStencilUsageCreateInfo,
+                      deepcopy_VkImageStencilUsageCreateInfoEXT)
+
+#endif
+#ifdef VK_EXT_validation_features
+void deepcopy_VkValidationFeaturesEXT(Allocator* alloc, VkStructureType rootType,
+                                      const VkValidationFeaturesEXT* from,
+                                      VkValidationFeaturesEXT* to);
+
+#endif
+#ifdef VK_NV_cooperative_matrix
+void deepcopy_VkCooperativeMatrixPropertiesNV(Allocator* alloc, VkStructureType rootType,
+                                              const VkCooperativeMatrixPropertiesNV* from,
+                                              VkCooperativeMatrixPropertiesNV* to);
+
+void deepcopy_VkPhysicalDeviceCooperativeMatrixFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceCooperativeMatrixFeaturesNV* from,
+    VkPhysicalDeviceCooperativeMatrixFeaturesNV* to);
+
+void deepcopy_VkPhysicalDeviceCooperativeMatrixPropertiesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceCooperativeMatrixPropertiesNV* from,
+    VkPhysicalDeviceCooperativeMatrixPropertiesNV* to);
+
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+void deepcopy_VkPhysicalDeviceCoverageReductionModeFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceCoverageReductionModeFeaturesNV* from,
+    VkPhysicalDeviceCoverageReductionModeFeaturesNV* to);
+
+void deepcopy_VkPipelineCoverageReductionStateCreateInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineCoverageReductionStateCreateInfoNV* from,
+    VkPipelineCoverageReductionStateCreateInfoNV* to);
+
+void deepcopy_VkFramebufferMixedSamplesCombinationNV(
+    Allocator* alloc, VkStructureType rootType, const VkFramebufferMixedSamplesCombinationNV* from,
+    VkFramebufferMixedSamplesCombinationNV* to);
+
+#endif
+#ifdef VK_EXT_fragment_shader_interlock
+void deepcopy_VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT* from,
+    VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT* to);
+
+#endif
+#ifdef VK_EXT_ycbcr_image_arrays
+void deepcopy_VkPhysicalDeviceYcbcrImageArraysFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT* from,
+    VkPhysicalDeviceYcbcrImageArraysFeaturesEXT* to);
+
+#endif
+#ifdef VK_EXT_provoking_vertex
+void deepcopy_VkPhysicalDeviceProvokingVertexFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceProvokingVertexFeaturesEXT* from,
+    VkPhysicalDeviceProvokingVertexFeaturesEXT* to);
+
+void deepcopy_VkPhysicalDeviceProvokingVertexPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceProvokingVertexPropertiesEXT* from,
+    VkPhysicalDeviceProvokingVertexPropertiesEXT* to);
+
+void deepcopy_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT* from,
+    VkPipelineRasterizationProvokingVertexStateCreateInfoEXT* to);
+
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+void deepcopy_VkSurfaceFullScreenExclusiveInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                                  const VkSurfaceFullScreenExclusiveInfoEXT* from,
+                                                  VkSurfaceFullScreenExclusiveInfoEXT* to);
+
+void deepcopy_VkSurfaceCapabilitiesFullScreenExclusiveEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkSurfaceCapabilitiesFullScreenExclusiveEXT* from,
+    VkSurfaceCapabilitiesFullScreenExclusiveEXT* to);
+
+void deepcopy_VkSurfaceFullScreenExclusiveWin32InfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkSurfaceFullScreenExclusiveWin32InfoEXT* from,
+    VkSurfaceFullScreenExclusiveWin32InfoEXT* to);
+
+#endif
+#ifdef VK_EXT_headless_surface
+void deepcopy_VkHeadlessSurfaceCreateInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                             const VkHeadlessSurfaceCreateInfoEXT* from,
+                                             VkHeadlessSurfaceCreateInfoEXT* to);
+
+#endif
+#ifdef VK_EXT_line_rasterization
+void deepcopy_VkPhysicalDeviceLineRasterizationFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceLineRasterizationFeaturesEXT* from,
+    VkPhysicalDeviceLineRasterizationFeaturesEXT* to);
+
+void deepcopy_VkPhysicalDeviceLineRasterizationPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceLineRasterizationPropertiesEXT* from,
+    VkPhysicalDeviceLineRasterizationPropertiesEXT* to);
+
+void deepcopy_VkPipelineRasterizationLineStateCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineRasterizationLineStateCreateInfoEXT* from,
+    VkPipelineRasterizationLineStateCreateInfoEXT* to);
+
+#endif
+#ifdef VK_EXT_shader_atomic_float
+void deepcopy_VkPhysicalDeviceShaderAtomicFloatFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT* from,
+    VkPhysicalDeviceShaderAtomicFloatFeaturesEXT* to);
+
+#endif
+#ifdef VK_EXT_host_query_reset
+DEFINE_ALIAS_FUNCTION(deepcopy_VkPhysicalDeviceHostQueryResetFeatures,
+                      deepcopy_VkPhysicalDeviceHostQueryResetFeaturesEXT)
+
+#endif
+#ifdef VK_EXT_index_type_uint8
+void deepcopy_VkPhysicalDeviceIndexTypeUint8FeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceIndexTypeUint8FeaturesEXT* from,
+    VkPhysicalDeviceIndexTypeUint8FeaturesEXT* to);
+
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+void deepcopy_VkPhysicalDeviceExtendedDynamicStateFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT* from,
+    VkPhysicalDeviceExtendedDynamicStateFeaturesEXT* to);
+
+#endif
+#ifdef VK_EXT_shader_atomic_float2
+void deepcopy_VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT* from,
+    VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT* to);
+
+#endif
+#ifdef VK_EXT_shader_demote_to_helper_invocation
+void deepcopy_VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT* from,
+    VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT* to);
+
+#endif
+#ifdef VK_NV_device_generated_commands
+void deepcopy_VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV* from,
+    VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV* to);
+
+void deepcopy_VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV* from,
+    VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV* to);
+
+void deepcopy_VkGraphicsShaderGroupCreateInfoNV(Allocator* alloc, VkStructureType rootType,
+                                                const VkGraphicsShaderGroupCreateInfoNV* from,
+                                                VkGraphicsShaderGroupCreateInfoNV* to);
+
+void deepcopy_VkGraphicsPipelineShaderGroupsCreateInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkGraphicsPipelineShaderGroupsCreateInfoNV* from,
+    VkGraphicsPipelineShaderGroupsCreateInfoNV* to);
+
+void deepcopy_VkBindShaderGroupIndirectCommandNV(Allocator* alloc, VkStructureType rootType,
+                                                 const VkBindShaderGroupIndirectCommandNV* from,
+                                                 VkBindShaderGroupIndirectCommandNV* to);
+
+void deepcopy_VkBindIndexBufferIndirectCommandNV(Allocator* alloc, VkStructureType rootType,
+                                                 const VkBindIndexBufferIndirectCommandNV* from,
+                                                 VkBindIndexBufferIndirectCommandNV* to);
+
+void deepcopy_VkBindVertexBufferIndirectCommandNV(Allocator* alloc, VkStructureType rootType,
+                                                  const VkBindVertexBufferIndirectCommandNV* from,
+                                                  VkBindVertexBufferIndirectCommandNV* to);
+
+void deepcopy_VkSetStateFlagsIndirectCommandNV(Allocator* alloc, VkStructureType rootType,
+                                               const VkSetStateFlagsIndirectCommandNV* from,
+                                               VkSetStateFlagsIndirectCommandNV* to);
+
+void deepcopy_VkIndirectCommandsStreamNV(Allocator* alloc, VkStructureType rootType,
+                                         const VkIndirectCommandsStreamNV* from,
+                                         VkIndirectCommandsStreamNV* to);
+
+void deepcopy_VkIndirectCommandsLayoutTokenNV(Allocator* alloc, VkStructureType rootType,
+                                              const VkIndirectCommandsLayoutTokenNV* from,
+                                              VkIndirectCommandsLayoutTokenNV* to);
+
+void deepcopy_VkIndirectCommandsLayoutCreateInfoNV(Allocator* alloc, VkStructureType rootType,
+                                                   const VkIndirectCommandsLayoutCreateInfoNV* from,
+                                                   VkIndirectCommandsLayoutCreateInfoNV* to);
+
+void deepcopy_VkGeneratedCommandsInfoNV(Allocator* alloc, VkStructureType rootType,
+                                        const VkGeneratedCommandsInfoNV* from,
+                                        VkGeneratedCommandsInfoNV* to);
+
+void deepcopy_VkGeneratedCommandsMemoryRequirementsInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkGeneratedCommandsMemoryRequirementsInfoNV* from,
+    VkGeneratedCommandsMemoryRequirementsInfoNV* to);
+
+#endif
+#ifdef VK_NV_inherited_viewport_scissor
+void deepcopy_VkPhysicalDeviceInheritedViewportScissorFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceInheritedViewportScissorFeaturesNV* from,
+    VkPhysicalDeviceInheritedViewportScissorFeaturesNV* to);
+
+void deepcopy_VkCommandBufferInheritanceViewportScissorInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkCommandBufferInheritanceViewportScissorInfoNV* from,
+    VkCommandBufferInheritanceViewportScissorInfoNV* to);
+
+#endif
+#ifdef VK_EXT_texel_buffer_alignment
+void deepcopy_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT* from,
+    VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT* to);
+
+void deepcopy_VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT* from,
+    VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT* to);
+
+#endif
+#ifdef VK_QCOM_render_pass_transform
+void deepcopy_VkRenderPassTransformBeginInfoQCOM(Allocator* alloc, VkStructureType rootType,
+                                                 const VkRenderPassTransformBeginInfoQCOM* from,
+                                                 VkRenderPassTransformBeginInfoQCOM* to);
+
+void deepcopy_VkCommandBufferInheritanceRenderPassTransformInfoQCOM(
+    Allocator* alloc, VkStructureType rootType,
+    const VkCommandBufferInheritanceRenderPassTransformInfoQCOM* from,
+    VkCommandBufferInheritanceRenderPassTransformInfoQCOM* to);
+
+#endif
+#ifdef VK_EXT_device_memory_report
+void deepcopy_VkPhysicalDeviceDeviceMemoryReportFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceDeviceMemoryReportFeaturesEXT* from,
+    VkPhysicalDeviceDeviceMemoryReportFeaturesEXT* to);
+
+void deepcopy_VkDeviceMemoryReportCallbackDataEXT(Allocator* alloc, VkStructureType rootType,
+                                                  const VkDeviceMemoryReportCallbackDataEXT* from,
+                                                  VkDeviceMemoryReportCallbackDataEXT* to);
+
+void deepcopy_VkDeviceDeviceMemoryReportCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType, const VkDeviceDeviceMemoryReportCreateInfoEXT* from,
+    VkDeviceDeviceMemoryReportCreateInfoEXT* to);
+
+#endif
+#ifdef VK_EXT_acquire_drm_display
+#endif
+#ifdef VK_EXT_robustness2
+void deepcopy_VkPhysicalDeviceRobustness2FeaturesEXT(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceRobustness2FeaturesEXT* from,
+    VkPhysicalDeviceRobustness2FeaturesEXT* to);
+
+void deepcopy_VkPhysicalDeviceRobustness2PropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceRobustness2PropertiesEXT* from,
+    VkPhysicalDeviceRobustness2PropertiesEXT* to);
+
+#endif
+#ifdef VK_EXT_custom_border_color
+void deepcopy_VkSamplerCustomBorderColorCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType, const VkSamplerCustomBorderColorCreateInfoEXT* from,
+    VkSamplerCustomBorderColorCreateInfoEXT* to);
+
+void deepcopy_VkPhysicalDeviceCustomBorderColorPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceCustomBorderColorPropertiesEXT* from,
+    VkPhysicalDeviceCustomBorderColorPropertiesEXT* to);
+
+void deepcopy_VkPhysicalDeviceCustomBorderColorFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceCustomBorderColorFeaturesEXT* from,
+    VkPhysicalDeviceCustomBorderColorFeaturesEXT* to);
+
+#endif
+#ifdef VK_GOOGLE_user_type
+#endif
+#ifdef VK_EXT_private_data
+void deepcopy_VkPhysicalDevicePrivateDataFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDevicePrivateDataFeaturesEXT* from,
+    VkPhysicalDevicePrivateDataFeaturesEXT* to);
+
+void deepcopy_VkDevicePrivateDataCreateInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                               const VkDevicePrivateDataCreateInfoEXT* from,
+                                               VkDevicePrivateDataCreateInfoEXT* to);
+
+void deepcopy_VkPrivateDataSlotCreateInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                             const VkPrivateDataSlotCreateInfoEXT* from,
+                                             VkPrivateDataSlotCreateInfoEXT* to);
+
+#endif
+#ifdef VK_EXT_pipeline_creation_cache_control
+void deepcopy_VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT* from,
+    VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT* to);
+
+#endif
+#ifdef VK_NV_device_diagnostics_config
+void deepcopy_VkPhysicalDeviceDiagnosticsConfigFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceDiagnosticsConfigFeaturesNV* from,
+    VkPhysicalDeviceDiagnosticsConfigFeaturesNV* to);
+
+void deepcopy_VkDeviceDiagnosticsConfigCreateInfoNV(
+    Allocator* alloc, VkStructureType rootType, const VkDeviceDiagnosticsConfigCreateInfoNV* from,
+    VkDeviceDiagnosticsConfigCreateInfoNV* to);
+
+#endif
+#ifdef VK_QCOM_render_pass_store_ops
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+void deepcopy_VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV* from,
+    VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV* to);
+
+void deepcopy_VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV* from,
+    VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV* to);
+
+void deepcopy_VkPipelineFragmentShadingRateEnumStateCreateInfoNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPipelineFragmentShadingRateEnumStateCreateInfoNV* from,
+    VkPipelineFragmentShadingRateEnumStateCreateInfoNV* to);
+
+#endif
+#ifdef VK_NV_ray_tracing_motion_blur
+void deepcopy_VkDeviceOrHostAddressConstKHR(Allocator* alloc, VkStructureType rootType,
+                                            const VkDeviceOrHostAddressConstKHR* from,
+                                            VkDeviceOrHostAddressConstKHR* to);
+
+void deepcopy_VkAccelerationStructureGeometryMotionTrianglesDataNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAccelerationStructureGeometryMotionTrianglesDataNV* from,
+    VkAccelerationStructureGeometryMotionTrianglesDataNV* to);
+
+void deepcopy_VkAccelerationStructureMotionInfoNV(Allocator* alloc, VkStructureType rootType,
+                                                  const VkAccelerationStructureMotionInfoNV* from,
+                                                  VkAccelerationStructureMotionInfoNV* to);
+
+void deepcopy_VkAccelerationStructureMatrixMotionInstanceNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAccelerationStructureMatrixMotionInstanceNV* from,
+    VkAccelerationStructureMatrixMotionInstanceNV* to);
+
+void deepcopy_VkSRTDataNV(Allocator* alloc, VkStructureType rootType, const VkSRTDataNV* from,
+                          VkSRTDataNV* to);
+
+void deepcopy_VkAccelerationStructureSRTMotionInstanceNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAccelerationStructureSRTMotionInstanceNV* from,
+    VkAccelerationStructureSRTMotionInstanceNV* to);
+
+void deepcopy_VkAccelerationStructureMotionInstanceDataNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAccelerationStructureMotionInstanceDataNV* from,
+    VkAccelerationStructureMotionInstanceDataNV* to);
+
+void deepcopy_VkAccelerationStructureMotionInstanceNV(
+    Allocator* alloc, VkStructureType rootType, const VkAccelerationStructureMotionInstanceNV* from,
+    VkAccelerationStructureMotionInstanceNV* to);
+
+void deepcopy_VkPhysicalDeviceRayTracingMotionBlurFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingMotionBlurFeaturesNV* from,
+    VkPhysicalDeviceRayTracingMotionBlurFeaturesNV* to);
+
+#endif
+#ifdef VK_EXT_ycbcr_2plane_444_formats
+void deepcopy_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT* from,
+    VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT* to);
+
+#endif
+#ifdef VK_EXT_fragment_density_map2
+void deepcopy_VkPhysicalDeviceFragmentDensityMap2FeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT* from,
+    VkPhysicalDeviceFragmentDensityMap2FeaturesEXT* to);
+
+void deepcopy_VkPhysicalDeviceFragmentDensityMap2PropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMap2PropertiesEXT* from,
+    VkPhysicalDeviceFragmentDensityMap2PropertiesEXT* to);
+
+#endif
+#ifdef VK_QCOM_rotated_copy_commands
+void deepcopy_VkCopyCommandTransformInfoQCOM(Allocator* alloc, VkStructureType rootType,
+                                             const VkCopyCommandTransformInfoQCOM* from,
+                                             VkCopyCommandTransformInfoQCOM* to);
+
+#endif
+#ifdef VK_EXT_image_robustness
+void deepcopy_VkPhysicalDeviceImageRobustnessFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceImageRobustnessFeaturesEXT* from,
+    VkPhysicalDeviceImageRobustnessFeaturesEXT* to);
+
+#endif
+#ifdef VK_EXT_4444_formats
+void deepcopy_VkPhysicalDevice4444FormatsFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDevice4444FormatsFeaturesEXT* from,
+    VkPhysicalDevice4444FormatsFeaturesEXT* to);
+
+#endif
+#ifdef VK_EXT_rgba10x6_formats
+void deepcopy_VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT* from,
+    VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT* to);
+
+#endif
+#ifdef VK_NV_acquire_winrt_display
+#endif
+#ifdef VK_EXT_directfb_surface
+void deepcopy_VkDirectFBSurfaceCreateInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                             const VkDirectFBSurfaceCreateInfoEXT* from,
+                                             VkDirectFBSurfaceCreateInfoEXT* to);
+
+#endif
+#ifdef VK_VALVE_mutable_descriptor_type
+void deepcopy_VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE* from,
+    VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE* to);
+
+void deepcopy_VkMutableDescriptorTypeListVALVE(Allocator* alloc, VkStructureType rootType,
+                                               const VkMutableDescriptorTypeListVALVE* from,
+                                               VkMutableDescriptorTypeListVALVE* to);
+
+void deepcopy_VkMutableDescriptorTypeCreateInfoVALVE(
+    Allocator* alloc, VkStructureType rootType, const VkMutableDescriptorTypeCreateInfoVALVE* from,
+    VkMutableDescriptorTypeCreateInfoVALVE* to);
+
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+void deepcopy_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT* from,
+    VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT* to);
+
+void deepcopy_VkVertexInputBindingDescription2EXT(Allocator* alloc, VkStructureType rootType,
+                                                  const VkVertexInputBindingDescription2EXT* from,
+                                                  VkVertexInputBindingDescription2EXT* to);
+
+void deepcopy_VkVertexInputAttributeDescription2EXT(
+    Allocator* alloc, VkStructureType rootType, const VkVertexInputAttributeDescription2EXT* from,
+    VkVertexInputAttributeDescription2EXT* to);
+
+#endif
+#ifdef VK_EXT_physical_device_drm
+void deepcopy_VkPhysicalDeviceDrmPropertiesEXT(Allocator* alloc, VkStructureType rootType,
+                                               const VkPhysicalDeviceDrmPropertiesEXT* from,
+                                               VkPhysicalDeviceDrmPropertiesEXT* to);
+
+#endif
+#ifdef VK_EXT_primitive_topology_list_restart
+void deepcopy_VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT* from,
+    VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT* to);
+
+#endif
+#ifdef VK_FUCHSIA_external_memory
+void deepcopy_VkImportMemoryZirconHandleInfoFUCHSIA(
+    Allocator* alloc, VkStructureType rootType, const VkImportMemoryZirconHandleInfoFUCHSIA* from,
+    VkImportMemoryZirconHandleInfoFUCHSIA* to);
+
+void deepcopy_VkMemoryZirconHandlePropertiesFUCHSIA(
+    Allocator* alloc, VkStructureType rootType, const VkMemoryZirconHandlePropertiesFUCHSIA* from,
+    VkMemoryZirconHandlePropertiesFUCHSIA* to);
+
+void deepcopy_VkMemoryGetZirconHandleInfoFUCHSIA(Allocator* alloc, VkStructureType rootType,
+                                                 const VkMemoryGetZirconHandleInfoFUCHSIA* from,
+                                                 VkMemoryGetZirconHandleInfoFUCHSIA* to);
+
+#endif
+#ifdef VK_FUCHSIA_external_semaphore
+void deepcopy_VkImportSemaphoreZirconHandleInfoFUCHSIA(
+    Allocator* alloc, VkStructureType rootType,
+    const VkImportSemaphoreZirconHandleInfoFUCHSIA* from,
+    VkImportSemaphoreZirconHandleInfoFUCHSIA* to);
+
+void deepcopy_VkSemaphoreGetZirconHandleInfoFUCHSIA(
+    Allocator* alloc, VkStructureType rootType, const VkSemaphoreGetZirconHandleInfoFUCHSIA* from,
+    VkSemaphoreGetZirconHandleInfoFUCHSIA* to);
+
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+void deepcopy_VkBufferCollectionCreateInfoFUCHSIA(Allocator* alloc, VkStructureType rootType,
+                                                  const VkBufferCollectionCreateInfoFUCHSIA* from,
+                                                  VkBufferCollectionCreateInfoFUCHSIA* to);
+
+void deepcopy_VkImportMemoryBufferCollectionFUCHSIA(
+    Allocator* alloc, VkStructureType rootType, const VkImportMemoryBufferCollectionFUCHSIA* from,
+    VkImportMemoryBufferCollectionFUCHSIA* to);
+
+void deepcopy_VkBufferCollectionImageCreateInfoFUCHSIA(
+    Allocator* alloc, VkStructureType rootType,
+    const VkBufferCollectionImageCreateInfoFUCHSIA* from,
+    VkBufferCollectionImageCreateInfoFUCHSIA* to);
+
+void deepcopy_VkBufferCollectionConstraintsInfoFUCHSIA(
+    Allocator* alloc, VkStructureType rootType,
+    const VkBufferCollectionConstraintsInfoFUCHSIA* from,
+    VkBufferCollectionConstraintsInfoFUCHSIA* to);
+
+void deepcopy_VkBufferConstraintsInfoFUCHSIA(Allocator* alloc, VkStructureType rootType,
+                                             const VkBufferConstraintsInfoFUCHSIA* from,
+                                             VkBufferConstraintsInfoFUCHSIA* to);
+
+void deepcopy_VkBufferCollectionBufferCreateInfoFUCHSIA(
+    Allocator* alloc, VkStructureType rootType,
+    const VkBufferCollectionBufferCreateInfoFUCHSIA* from,
+    VkBufferCollectionBufferCreateInfoFUCHSIA* to);
+
+void deepcopy_VkSysmemColorSpaceFUCHSIA(Allocator* alloc, VkStructureType rootType,
+                                        const VkSysmemColorSpaceFUCHSIA* from,
+                                        VkSysmemColorSpaceFUCHSIA* to);
+
+void deepcopy_VkBufferCollectionPropertiesFUCHSIA(Allocator* alloc, VkStructureType rootType,
+                                                  const VkBufferCollectionPropertiesFUCHSIA* from,
+                                                  VkBufferCollectionPropertiesFUCHSIA* to);
+
+void deepcopy_VkImageFormatConstraintsInfoFUCHSIA(Allocator* alloc, VkStructureType rootType,
+                                                  const VkImageFormatConstraintsInfoFUCHSIA* from,
+                                                  VkImageFormatConstraintsInfoFUCHSIA* to);
+
+void deepcopy_VkImageConstraintsInfoFUCHSIA(Allocator* alloc, VkStructureType rootType,
+                                            const VkImageConstraintsInfoFUCHSIA* from,
+                                            VkImageConstraintsInfoFUCHSIA* to);
+
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+void deepcopy_VkSubpassShadingPipelineCreateInfoHUAWEI(
+    Allocator* alloc, VkStructureType rootType,
+    const VkSubpassShadingPipelineCreateInfoHUAWEI* from,
+    VkSubpassShadingPipelineCreateInfoHUAWEI* to);
+
+void deepcopy_VkPhysicalDeviceSubpassShadingFeaturesHUAWEI(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceSubpassShadingFeaturesHUAWEI* from,
+    VkPhysicalDeviceSubpassShadingFeaturesHUAWEI* to);
+
+void deepcopy_VkPhysicalDeviceSubpassShadingPropertiesHUAWEI(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceSubpassShadingPropertiesHUAWEI* from,
+    VkPhysicalDeviceSubpassShadingPropertiesHUAWEI* to);
+
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+void deepcopy_VkPhysicalDeviceInvocationMaskFeaturesHUAWEI(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceInvocationMaskFeaturesHUAWEI* from,
+    VkPhysicalDeviceInvocationMaskFeaturesHUAWEI* to);
+
+#endif
+#ifdef VK_NV_external_memory_rdma
+void deepcopy_VkMemoryGetRemoteAddressInfoNV(Allocator* alloc, VkStructureType rootType,
+                                             const VkMemoryGetRemoteAddressInfoNV* from,
+                                             VkMemoryGetRemoteAddressInfoNV* to);
+
+void deepcopy_VkPhysicalDeviceExternalMemoryRDMAFeaturesNV(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceExternalMemoryRDMAFeaturesNV* from,
+    VkPhysicalDeviceExternalMemoryRDMAFeaturesNV* to);
+
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+void deepcopy_VkPhysicalDeviceExtendedDynamicState2FeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT* from,
+    VkPhysicalDeviceExtendedDynamicState2FeaturesEXT* to);
+
+#endif
+#ifdef VK_QNX_screen_surface
+void deepcopy_VkScreenSurfaceCreateInfoQNX(Allocator* alloc, VkStructureType rootType,
+                                           const VkScreenSurfaceCreateInfoQNX* from,
+                                           VkScreenSurfaceCreateInfoQNX* to);
+
+#endif
+#ifdef VK_EXT_color_write_enable
+void deepcopy_VkPhysicalDeviceColorWriteEnableFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceColorWriteEnableFeaturesEXT* from,
+    VkPhysicalDeviceColorWriteEnableFeaturesEXT* to);
+
+void deepcopy_VkPipelineColorWriteCreateInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                                const VkPipelineColorWriteCreateInfoEXT* from,
+                                                VkPipelineColorWriteCreateInfoEXT* to);
+
+#endif
+#ifdef VK_GOOGLE_gfxstream
+void deepcopy_VkImportColorBufferGOOGLE(Allocator* alloc, VkStructureType rootType,
+                                        const VkImportColorBufferGOOGLE* from,
+                                        VkImportColorBufferGOOGLE* to);
+
+void deepcopy_VkImportBufferGOOGLE(Allocator* alloc, VkStructureType rootType,
+                                   const VkImportBufferGOOGLE* from, VkImportBufferGOOGLE* to);
+
+void deepcopy_VkCreateBlobGOOGLE(Allocator* alloc, VkStructureType rootType,
+                                 const VkCreateBlobGOOGLE* from, VkCreateBlobGOOGLE* to);
+
+#endif
+#ifdef VK_EXT_global_priority_query
+void deepcopy_VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT* from,
+    VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT* to);
+
+void deepcopy_VkQueueFamilyGlobalPriorityPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkQueueFamilyGlobalPriorityPropertiesEXT* from,
+    VkQueueFamilyGlobalPriorityPropertiesEXT* to);
+
+#endif
+#ifdef VK_EXT_multi_draw
+void deepcopy_VkPhysicalDeviceMultiDrawFeaturesEXT(Allocator* alloc, VkStructureType rootType,
+                                                   const VkPhysicalDeviceMultiDrawFeaturesEXT* from,
+                                                   VkPhysicalDeviceMultiDrawFeaturesEXT* to);
+
+void deepcopy_VkPhysicalDeviceMultiDrawPropertiesEXT(
+    Allocator* alloc, VkStructureType rootType, const VkPhysicalDeviceMultiDrawPropertiesEXT* from,
+    VkPhysicalDeviceMultiDrawPropertiesEXT* to);
+
+void deepcopy_VkMultiDrawInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                 const VkMultiDrawInfoEXT* from, VkMultiDrawInfoEXT* to);
+
+void deepcopy_VkMultiDrawIndexedInfoEXT(Allocator* alloc, VkStructureType rootType,
+                                        const VkMultiDrawIndexedInfoEXT* from,
+                                        VkMultiDrawIndexedInfoEXT* to);
+
+#endif
+#ifdef VK_EXT_load_store_op_none
+#endif
+#ifdef VK_EXT_border_color_swizzle
+void deepcopy_VkPhysicalDeviceBorderColorSwizzleFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT* from,
+    VkPhysicalDeviceBorderColorSwizzleFeaturesEXT* to);
+
+void deepcopy_VkSamplerBorderColorComponentMappingCreateInfoEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkSamplerBorderColorComponentMappingCreateInfoEXT* from,
+    VkSamplerBorderColorComponentMappingCreateInfoEXT* to);
+
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+void deepcopy_VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT* from,
+    VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT* to);
+
+#endif
+#ifdef VK_KHR_acceleration_structure
+void deepcopy_VkDeviceOrHostAddressKHR(Allocator* alloc, VkStructureType rootType,
+                                       const VkDeviceOrHostAddressKHR* from,
+                                       VkDeviceOrHostAddressKHR* to);
+
+void deepcopy_VkAccelerationStructureBuildRangeInfoKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAccelerationStructureBuildRangeInfoKHR* from,
+    VkAccelerationStructureBuildRangeInfoKHR* to);
+
+void deepcopy_VkAccelerationStructureGeometryTrianglesDataKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAccelerationStructureGeometryTrianglesDataKHR* from,
+    VkAccelerationStructureGeometryTrianglesDataKHR* to);
+
+void deepcopy_VkAccelerationStructureGeometryAabbsDataKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAccelerationStructureGeometryAabbsDataKHR* from,
+    VkAccelerationStructureGeometryAabbsDataKHR* to);
+
+void deepcopy_VkAccelerationStructureGeometryInstancesDataKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAccelerationStructureGeometryInstancesDataKHR* from,
+    VkAccelerationStructureGeometryInstancesDataKHR* to);
+
+void deepcopy_VkAccelerationStructureGeometryDataKHR(
+    Allocator* alloc, VkStructureType rootType, const VkAccelerationStructureGeometryDataKHR* from,
+    VkAccelerationStructureGeometryDataKHR* to);
+
+void deepcopy_VkAccelerationStructureGeometryKHR(Allocator* alloc, VkStructureType rootType,
+                                                 const VkAccelerationStructureGeometryKHR* from,
+                                                 VkAccelerationStructureGeometryKHR* to);
+
+void deepcopy_VkAccelerationStructureBuildGeometryInfoKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAccelerationStructureBuildGeometryInfoKHR* from,
+    VkAccelerationStructureBuildGeometryInfoKHR* to);
+
+void deepcopy_VkAccelerationStructureCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                                   const VkAccelerationStructureCreateInfoKHR* from,
+                                                   VkAccelerationStructureCreateInfoKHR* to);
+
+void deepcopy_VkWriteDescriptorSetAccelerationStructureKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkWriteDescriptorSetAccelerationStructureKHR* from,
+    VkWriteDescriptorSetAccelerationStructureKHR* to);
+
+void deepcopy_VkPhysicalDeviceAccelerationStructureFeaturesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceAccelerationStructureFeaturesKHR* from,
+    VkPhysicalDeviceAccelerationStructureFeaturesKHR* to);
+
+void deepcopy_VkPhysicalDeviceAccelerationStructurePropertiesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceAccelerationStructurePropertiesKHR* from,
+    VkPhysicalDeviceAccelerationStructurePropertiesKHR* to);
+
+void deepcopy_VkAccelerationStructureDeviceAddressInfoKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAccelerationStructureDeviceAddressInfoKHR* from,
+    VkAccelerationStructureDeviceAddressInfoKHR* to);
+
+void deepcopy_VkAccelerationStructureVersionInfoKHR(
+    Allocator* alloc, VkStructureType rootType, const VkAccelerationStructureVersionInfoKHR* from,
+    VkAccelerationStructureVersionInfoKHR* to);
+
+void deepcopy_VkCopyAccelerationStructureToMemoryInfoKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkCopyAccelerationStructureToMemoryInfoKHR* from,
+    VkCopyAccelerationStructureToMemoryInfoKHR* to);
+
+void deepcopy_VkCopyMemoryToAccelerationStructureInfoKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkCopyMemoryToAccelerationStructureInfoKHR* from,
+    VkCopyMemoryToAccelerationStructureInfoKHR* to);
+
+void deepcopy_VkCopyAccelerationStructureInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                                 const VkCopyAccelerationStructureInfoKHR* from,
+                                                 VkCopyAccelerationStructureInfoKHR* to);
+
+void deepcopy_VkAccelerationStructureBuildSizesInfoKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkAccelerationStructureBuildSizesInfoKHR* from,
+    VkAccelerationStructureBuildSizesInfoKHR* to);
+
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+void deepcopy_VkRayTracingShaderGroupCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                                   const VkRayTracingShaderGroupCreateInfoKHR* from,
+                                                   VkRayTracingShaderGroupCreateInfoKHR* to);
+
+void deepcopy_VkRayTracingPipelineInterfaceCreateInfoKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkRayTracingPipelineInterfaceCreateInfoKHR* from,
+    VkRayTracingPipelineInterfaceCreateInfoKHR* to);
+
+void deepcopy_VkRayTracingPipelineCreateInfoKHR(Allocator* alloc, VkStructureType rootType,
+                                                const VkRayTracingPipelineCreateInfoKHR* from,
+                                                VkRayTracingPipelineCreateInfoKHR* to);
+
+void deepcopy_VkPhysicalDeviceRayTracingPipelineFeaturesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingPipelineFeaturesKHR* from,
+    VkPhysicalDeviceRayTracingPipelineFeaturesKHR* to);
+
+void deepcopy_VkPhysicalDeviceRayTracingPipelinePropertiesKHR(
+    Allocator* alloc, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingPipelinePropertiesKHR* from,
+    VkPhysicalDeviceRayTracingPipelinePropertiesKHR* to);
+
+void deepcopy_VkStridedDeviceAddressRegionKHR(Allocator* alloc, VkStructureType rootType,
+                                              const VkStridedDeviceAddressRegionKHR* from,
+                                              VkStridedDeviceAddressRegionKHR* to);
+
+void deepcopy_VkTraceRaysIndirectCommandKHR(Allocator* alloc, VkStructureType rootType,
+                                            const VkTraceRaysIndirectCommandKHR* from,
+                                            VkTraceRaysIndirectCommandKHR* to);
+
+#endif
+#ifdef VK_KHR_ray_query
+void deepcopy_VkPhysicalDeviceRayQueryFeaturesKHR(Allocator* alloc, VkStructureType rootType,
+                                                  const VkPhysicalDeviceRayQueryFeaturesKHR* from,
+                                                  VkPhysicalDeviceRayQueryFeaturesKHR* to);
+
+#endif
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/goldfish_vk_extension_structs_guest.cpp b/system/vulkan_enc/goldfish_vk_extension_structs_guest.cpp
new file mode 100644
index 0000000..6758d9f
--- /dev/null
+++ b/system/vulkan_enc/goldfish_vk_extension_structs_guest.cpp
@@ -0,0 +1,3443 @@
+// Copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2018 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Autogenerated module goldfish_vk_extension_structs_guest
+//
+// (impl) generated by codegen/vulkan/scripts/genvk.py -registry codegen/vulkan/xml/vk.xml cereal -o
+// host/vulkan/cereal
+//
+// Please do not modify directly;
+// re-run gfxstream-protocols/scripts/generate-vulkan-sources.sh,
+// or directly from Python by defining:
+// VULKAN_REGISTRY_XML_DIR : Directory containing vk.xml
+// VULKAN_REGISTRY_SCRIPTS_DIR : Directory containing genvk.py
+// CEREAL_OUTPUT_DIR: Where to put the generated sources.
+//
+// python3 $VULKAN_REGISTRY_SCRIPTS_DIR/genvk.py -registry $VULKAN_REGISTRY_XML_DIR/vk.xml cereal -o
+// $CEREAL_OUTPUT_DIR
+//
+
+#include "goldfish_vk_extension_structs_guest.h"
+
+namespace gfxstream {
+namespace vk {
+
+#ifdef VK_VERSION_1_0
+#endif
+#ifdef VK_VERSION_1_1
+#endif
+#ifdef VK_VERSION_1_2
+#endif
+#ifdef VK_KHR_surface
+#endif
+#ifdef VK_KHR_swapchain
+#endif
+#ifdef VK_KHR_display
+#endif
+#ifdef VK_KHR_display_swapchain
+#endif
+#ifdef VK_KHR_xlib_surface
+#endif
+#ifdef VK_KHR_xcb_surface
+#endif
+#ifdef VK_KHR_wayland_surface
+#endif
+#ifdef VK_KHR_android_surface
+#endif
+#ifdef VK_KHR_win32_surface
+#endif
+#ifdef VK_KHR_sampler_mirror_clamp_to_edge
+#endif
+#ifdef VK_KHR_video_queue
+#endif
+#ifdef VK_KHR_video_decode_queue
+#endif
+#ifdef VK_KHR_dynamic_rendering
+#endif
+#ifdef VK_KHR_multiview
+#endif
+#ifdef VK_KHR_get_physical_device_properties2
+#endif
+#ifdef VK_KHR_device_group
+#endif
+#ifdef VK_KHR_shader_draw_parameters
+#endif
+#ifdef VK_KHR_maintenance1
+#endif
+#ifdef VK_KHR_device_group_creation
+#endif
+#ifdef VK_KHR_external_memory_capabilities
+#endif
+#ifdef VK_KHR_external_memory
+#endif
+#ifdef VK_KHR_external_memory_win32
+#endif
+#ifdef VK_KHR_external_memory_fd
+#endif
+#ifdef VK_KHR_win32_keyed_mutex
+#endif
+#ifdef VK_KHR_external_semaphore_capabilities
+#endif
+#ifdef VK_KHR_external_semaphore
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+#endif
+#ifdef VK_KHR_external_semaphore_fd
+#endif
+#ifdef VK_KHR_push_descriptor
+#endif
+#ifdef VK_KHR_shader_float16_int8
+#endif
+#ifdef VK_KHR_16bit_storage
+#endif
+#ifdef VK_KHR_incremental_present
+#endif
+#ifdef VK_KHR_descriptor_update_template
+#endif
+#ifdef VK_KHR_imageless_framebuffer
+#endif
+#ifdef VK_KHR_create_renderpass2
+#endif
+#ifdef VK_KHR_shared_presentable_image
+#endif
+#ifdef VK_KHR_external_fence_capabilities
+#endif
+#ifdef VK_KHR_external_fence
+#endif
+#ifdef VK_KHR_external_fence_win32
+#endif
+#ifdef VK_KHR_external_fence_fd
+#endif
+#ifdef VK_KHR_performance_query
+#endif
+#ifdef VK_KHR_maintenance2
+#endif
+#ifdef VK_KHR_get_surface_capabilities2
+#endif
+#ifdef VK_KHR_variable_pointers
+#endif
+#ifdef VK_KHR_get_display_properties2
+#endif
+#ifdef VK_KHR_dedicated_allocation
+#endif
+#ifdef VK_KHR_storage_buffer_storage_class
+#endif
+#ifdef VK_KHR_relaxed_block_layout
+#endif
+#ifdef VK_KHR_get_memory_requirements2
+#endif
+#ifdef VK_KHR_image_format_list
+#endif
+#ifdef VK_KHR_sampler_ycbcr_conversion
+#endif
+#ifdef VK_KHR_bind_memory2
+#endif
+#ifdef VK_KHR_portability_subset
+#endif
+#ifdef VK_KHR_maintenance3
+#endif
+#ifdef VK_KHR_draw_indirect_count
+#endif
+#ifdef VK_KHR_shader_subgroup_extended_types
+#endif
+#ifdef VK_KHR_8bit_storage
+#endif
+#ifdef VK_KHR_shader_atomic_int64
+#endif
+#ifdef VK_KHR_shader_clock
+#endif
+#ifdef VK_KHR_driver_properties
+#endif
+#ifdef VK_KHR_shader_float_controls
+#endif
+#ifdef VK_KHR_depth_stencil_resolve
+#endif
+#ifdef VK_KHR_swapchain_mutable_format
+#endif
+#ifdef VK_KHR_timeline_semaphore
+#endif
+#ifdef VK_KHR_vulkan_memory_model
+#endif
+#ifdef VK_KHR_shader_terminate_invocation
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+#endif
+#ifdef VK_KHR_spirv_1_4
+#endif
+#ifdef VK_KHR_surface_protected_capabilities
+#endif
+#ifdef VK_KHR_separate_depth_stencil_layouts
+#endif
+#ifdef VK_KHR_present_wait
+#endif
+#ifdef VK_KHR_uniform_buffer_standard_layout
+#endif
+#ifdef VK_KHR_buffer_device_address
+#endif
+#ifdef VK_KHR_deferred_host_operations
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+#endif
+#ifdef VK_KHR_shader_integer_dot_product
+#endif
+#ifdef VK_KHR_pipeline_library
+#endif
+#ifdef VK_KHR_shader_non_semantic_info
+#endif
+#ifdef VK_KHR_present_id
+#endif
+#ifdef VK_KHR_video_encode_queue
+#endif
+#ifdef VK_KHR_synchronization2
+#endif
+#ifdef VK_KHR_shader_subgroup_uniform_control_flow
+#endif
+#ifdef VK_KHR_zero_initialize_workgroup_memory
+#endif
+#ifdef VK_KHR_workgroup_memory_explicit_layout
+#endif
+#ifdef VK_KHR_copy_commands2
+#endif
+#ifdef VK_KHR_format_feature_flags2
+#endif
+#ifdef VK_KHR_maintenance4
+#endif
+#ifdef VK_ANDROID_native_buffer
+#endif
+#ifdef VK_EXT_debug_report
+#endif
+#ifdef VK_NV_glsl_shader
+#endif
+#ifdef VK_EXT_depth_range_unrestricted
+#endif
+#ifdef VK_IMG_filter_cubic
+#endif
+#ifdef VK_AMD_rasterization_order
+#endif
+#ifdef VK_AMD_shader_trinary_minmax
+#endif
+#ifdef VK_AMD_shader_explicit_vertex_parameter
+#endif
+#ifdef VK_EXT_debug_marker
+#endif
+#ifdef VK_AMD_gcn_shader
+#endif
+#ifdef VK_NV_dedicated_allocation
+#endif
+#ifdef VK_EXT_transform_feedback
+#endif
+#ifdef VK_NVX_binary_import
+#endif
+#ifdef VK_NVX_image_view_handle
+#endif
+#ifdef VK_AMD_draw_indirect_count
+#endif
+#ifdef VK_AMD_negative_viewport_height
+#endif
+#ifdef VK_AMD_gpu_shader_half_float
+#endif
+#ifdef VK_AMD_shader_ballot
+#endif
+#ifdef VK_EXT_video_encode_h264
+#endif
+#ifdef VK_EXT_video_encode_h265
+#endif
+#ifdef VK_EXT_video_decode_h264
+#endif
+#ifdef VK_AMD_texture_gather_bias_lod
+#endif
+#ifdef VK_AMD_shader_info
+#endif
+#ifdef VK_AMD_shader_image_load_store_lod
+#endif
+#ifdef VK_GGP_stream_descriptor_surface
+#endif
+#ifdef VK_NV_corner_sampled_image
+#endif
+#ifdef VK_IMG_format_pvrtc
+#endif
+#ifdef VK_NV_external_memory_capabilities
+#endif
+#ifdef VK_NV_external_memory
+#endif
+#ifdef VK_NV_external_memory_win32
+#endif
+#ifdef VK_NV_win32_keyed_mutex
+#endif
+#ifdef VK_EXT_validation_flags
+#endif
+#ifdef VK_NN_vi_surface
+#endif
+#ifdef VK_EXT_shader_subgroup_ballot
+#endif
+#ifdef VK_EXT_shader_subgroup_vote
+#endif
+#ifdef VK_EXT_texture_compression_astc_hdr
+#endif
+#ifdef VK_EXT_astc_decode_mode
+#endif
+#ifdef VK_EXT_conditional_rendering
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+#endif
+#ifdef VK_EXT_direct_mode_display
+#endif
+#ifdef VK_EXT_acquire_xlib_display
+#endif
+#ifdef VK_EXT_display_surface_counter
+#endif
+#ifdef VK_EXT_display_control
+#endif
+#ifdef VK_GOOGLE_display_timing
+#endif
+#ifdef VK_NV_sample_mask_override_coverage
+#endif
+#ifdef VK_NV_geometry_shader_passthrough
+#endif
+#ifdef VK_NV_viewport_array2
+#endif
+#ifdef VK_NVX_multiview_per_view_attributes
+#endif
+#ifdef VK_NV_viewport_swizzle
+#endif
+#ifdef VK_EXT_discard_rectangles
+#endif
+#ifdef VK_EXT_conservative_rasterization
+#endif
+#ifdef VK_EXT_depth_clip_enable
+#endif
+#ifdef VK_EXT_swapchain_colorspace
+#endif
+#ifdef VK_EXT_hdr_metadata
+#endif
+#ifdef VK_MVK_ios_surface
+#endif
+#ifdef VK_MVK_macos_surface
+#endif
+#ifdef VK_MVK_moltenvk
+#endif
+#ifdef VK_EXT_external_memory_dma_buf
+#endif
+#ifdef VK_EXT_queue_family_foreign
+#endif
+#ifdef VK_EXT_debug_utils
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+#endif
+#ifdef VK_EXT_sampler_filter_minmax
+#endif
+#ifdef VK_AMD_gpu_shader_int16
+#endif
+#ifdef VK_AMD_mixed_attachment_samples
+#endif
+#ifdef VK_AMD_shader_fragment_mask
+#endif
+#ifdef VK_EXT_inline_uniform_block
+#endif
+#ifdef VK_EXT_shader_stencil_export
+#endif
+#ifdef VK_EXT_sample_locations
+#endif
+#ifdef VK_EXT_blend_operation_advanced
+#endif
+#ifdef VK_NV_fragment_coverage_to_color
+#endif
+#ifdef VK_NV_framebuffer_mixed_samples
+#endif
+#ifdef VK_NV_fill_rectangle
+#endif
+#ifdef VK_NV_shader_sm_builtins
+#endif
+#ifdef VK_EXT_post_depth_coverage
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+#endif
+#ifdef VK_EXT_validation_cache
+#endif
+#ifdef VK_EXT_descriptor_indexing
+#endif
+#ifdef VK_EXT_shader_viewport_index_layer
+#endif
+#ifdef VK_NV_shading_rate_image
+#endif
+#ifdef VK_NV_ray_tracing
+#endif
+#ifdef VK_NV_representative_fragment_test
+#endif
+#ifdef VK_EXT_filter_cubic
+#endif
+#ifdef VK_QCOM_render_pass_shader_resolve
+#endif
+#ifdef VK_EXT_global_priority
+#endif
+#ifdef VK_EXT_external_memory_host
+#endif
+#ifdef VK_AMD_buffer_marker
+#endif
+#ifdef VK_AMD_pipeline_compiler_control
+#endif
+#ifdef VK_EXT_calibrated_timestamps
+#endif
+#ifdef VK_AMD_shader_core_properties
+#endif
+#ifdef VK_EXT_video_decode_h265
+#endif
+#ifdef VK_AMD_memory_overallocation_behavior
+#endif
+#ifdef VK_EXT_vertex_attribute_divisor
+#endif
+#ifdef VK_GGP_frame_token
+#endif
+#ifdef VK_EXT_pipeline_creation_feedback
+#endif
+#ifdef VK_NV_shader_subgroup_partitioned
+#endif
+#ifdef VK_NV_compute_shader_derivatives
+#endif
+#ifdef VK_NV_mesh_shader
+#endif
+#ifdef VK_NV_fragment_shader_barycentric
+#endif
+#ifdef VK_NV_shader_image_footprint
+#endif
+#ifdef VK_NV_scissor_exclusive
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+#endif
+#ifdef VK_INTEL_shader_integer_functions2
+#endif
+#ifdef VK_INTEL_performance_query
+#endif
+#ifdef VK_EXT_pci_bus_info
+#endif
+#ifdef VK_AMD_display_native_hdr
+#endif
+#ifdef VK_FUCHSIA_imagepipe_surface
+#endif
+#ifdef VK_EXT_metal_surface
+#endif
+#ifdef VK_EXT_fragment_density_map
+#endif
+#ifdef VK_EXT_scalar_block_layout
+#endif
+#ifdef VK_GOOGLE_hlsl_functionality1
+#endif
+#ifdef VK_GOOGLE_decorate_string
+#endif
+#ifdef VK_EXT_subgroup_size_control
+#endif
+#ifdef VK_AMD_shader_core_properties2
+#endif
+#ifdef VK_AMD_device_coherent_memory
+#endif
+#ifdef VK_EXT_shader_image_atomic_int64
+#endif
+#ifdef VK_EXT_memory_budget
+#endif
+#ifdef VK_EXT_memory_priority
+#endif
+#ifdef VK_NV_dedicated_allocation_image_aliasing
+#endif
+#ifdef VK_EXT_buffer_device_address
+#endif
+#ifdef VK_EXT_tooling_info
+#endif
+#ifdef VK_EXT_separate_stencil_usage
+#endif
+#ifdef VK_EXT_validation_features
+#endif
+#ifdef VK_NV_cooperative_matrix
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+#endif
+#ifdef VK_EXT_fragment_shader_interlock
+#endif
+#ifdef VK_EXT_ycbcr_image_arrays
+#endif
+#ifdef VK_EXT_provoking_vertex
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+#endif
+#ifdef VK_EXT_headless_surface
+#endif
+#ifdef VK_EXT_line_rasterization
+#endif
+#ifdef VK_EXT_shader_atomic_float
+#endif
+#ifdef VK_EXT_host_query_reset
+#endif
+#ifdef VK_EXT_index_type_uint8
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+#endif
+#ifdef VK_EXT_shader_atomic_float2
+#endif
+#ifdef VK_EXT_shader_demote_to_helper_invocation
+#endif
+#ifdef VK_NV_device_generated_commands
+#endif
+#ifdef VK_NV_inherited_viewport_scissor
+#endif
+#ifdef VK_EXT_texel_buffer_alignment
+#endif
+#ifdef VK_QCOM_render_pass_transform
+#endif
+#ifdef VK_EXT_device_memory_report
+#endif
+#ifdef VK_EXT_acquire_drm_display
+#endif
+#ifdef VK_EXT_robustness2
+#endif
+#ifdef VK_EXT_custom_border_color
+#endif
+#ifdef VK_GOOGLE_user_type
+#endif
+#ifdef VK_EXT_private_data
+#endif
+#ifdef VK_EXT_pipeline_creation_cache_control
+#endif
+#ifdef VK_NV_device_diagnostics_config
+#endif
+#ifdef VK_QCOM_render_pass_store_ops
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+#endif
+#ifdef VK_NV_ray_tracing_motion_blur
+#endif
+#ifdef VK_EXT_ycbcr_2plane_444_formats
+#endif
+#ifdef VK_EXT_fragment_density_map2
+#endif
+#ifdef VK_QCOM_rotated_copy_commands
+#endif
+#ifdef VK_EXT_image_robustness
+#endif
+#ifdef VK_EXT_4444_formats
+#endif
+#ifdef VK_EXT_rgba10x6_formats
+#endif
+#ifdef VK_NV_acquire_winrt_display
+#endif
+#ifdef VK_EXT_directfb_surface
+#endif
+#ifdef VK_VALVE_mutable_descriptor_type
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+#endif
+#ifdef VK_EXT_physical_device_drm
+#endif
+#ifdef VK_EXT_primitive_topology_list_restart
+#endif
+#ifdef VK_FUCHSIA_external_memory
+#endif
+#ifdef VK_FUCHSIA_external_semaphore
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+#endif
+#ifdef VK_NV_external_memory_rdma
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+#endif
+#ifdef VK_QNX_screen_surface
+#endif
+#ifdef VK_EXT_color_write_enable
+#endif
+#ifdef VK_GOOGLE_gfxstream
+#endif
+#ifdef VK_EXT_global_priority_query
+#endif
+#ifdef VK_EXT_multi_draw
+#endif
+#ifdef VK_EXT_load_store_op_none
+#endif
+#ifdef VK_EXT_border_color_swizzle
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+#endif
+#ifdef VK_KHR_acceleration_structure
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+#endif
+#ifdef VK_KHR_ray_query
+#endif
+uint32_t goldfish_vk_struct_type(const void* structExtension) {
+    const uint32_t asStructType = *(reinterpret_cast<const uint32_t*>(structExtension));
+    return asStructType;
+}
+
+size_t goldfish_vk_extension_struct_size(VkStructureType rootType, const void* structExtension) {
+    if (!structExtension) {
+        return (size_t)0;
+    }
+    uint32_t structType = (uint32_t)goldfish_vk_struct_type(structExtension);
+    switch (structType) {
+#ifdef VK_VERSION_1_1
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES: {
+            return sizeof(VkPhysicalDeviceSubgroupProperties);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: {
+            return sizeof(VkPhysicalDevice16BitStorageFeatures);
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS: {
+            return sizeof(VkMemoryDedicatedRequirements);
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO: {
+            return sizeof(VkMemoryDedicatedAllocateInfo);
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO: {
+            return sizeof(VkMemoryAllocateFlagsInfo);
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO: {
+            return sizeof(VkDeviceGroupRenderPassBeginInfo);
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO: {
+            return sizeof(VkDeviceGroupCommandBufferBeginInfo);
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO: {
+            return sizeof(VkDeviceGroupSubmitInfo);
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO: {
+            return sizeof(VkDeviceGroupBindSparseInfo);
+        }
+        case VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO: {
+            return sizeof(VkBindBufferMemoryDeviceGroupInfo);
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO: {
+            return sizeof(VkBindImageMemoryDeviceGroupInfo);
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO: {
+            return sizeof(VkDeviceGroupDeviceCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: {
+            return sizeof(VkPhysicalDeviceFeatures2);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES: {
+            return sizeof(VkPhysicalDevicePointClippingProperties);
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO: {
+            return sizeof(VkRenderPassInputAttachmentAspectCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO: {
+            return sizeof(VkImageViewUsageCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO: {
+            return sizeof(VkPipelineTessellationDomainOriginStateCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO: {
+            return sizeof(VkRenderPassMultiviewCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES: {
+            return sizeof(VkPhysicalDeviceMultiviewFeatures);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES: {
+            return sizeof(VkPhysicalDeviceMultiviewProperties);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES: {
+            return sizeof(VkPhysicalDeviceVariablePointersFeatures);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES: {
+            return sizeof(VkPhysicalDeviceProtectedMemoryFeatures);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES: {
+            return sizeof(VkPhysicalDeviceProtectedMemoryProperties);
+        }
+        case VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO: {
+            return sizeof(VkProtectedSubmitInfo);
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO: {
+            return sizeof(VkSamplerYcbcrConversionInfo);
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO: {
+            return sizeof(VkBindImagePlaneMemoryInfo);
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO: {
+            return sizeof(VkImagePlaneMemoryRequirementsInfo);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: {
+            return sizeof(VkPhysicalDeviceSamplerYcbcrConversionFeatures);
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES: {
+            return sizeof(VkSamplerYcbcrConversionImageFormatProperties);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO: {
+            return sizeof(VkPhysicalDeviceExternalImageFormatInfo);
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES: {
+            return sizeof(VkExternalImageFormatProperties);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES: {
+            return sizeof(VkPhysicalDeviceIDProperties);
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO: {
+            return sizeof(VkExternalMemoryImageCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO: {
+            return sizeof(VkExternalMemoryBufferCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO: {
+            return sizeof(VkExportMemoryAllocateInfo);
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO: {
+            return sizeof(VkExportFenceCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO: {
+            return sizeof(VkExportSemaphoreCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES: {
+            return sizeof(VkPhysicalDeviceMaintenance3Properties);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES: {
+            return sizeof(VkPhysicalDeviceShaderDrawParametersFeatures);
+        }
+#endif
+#ifdef VK_VERSION_1_2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES: {
+            return sizeof(VkPhysicalDeviceVulkan11Features);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES: {
+            return sizeof(VkPhysicalDeviceVulkan11Properties);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES: {
+            return sizeof(VkPhysicalDeviceVulkan12Features);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES: {
+            return sizeof(VkPhysicalDeviceVulkan12Properties);
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO: {
+            return sizeof(VkImageFormatListCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES: {
+            return sizeof(VkPhysicalDevice8BitStorageFeatures);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES: {
+            return sizeof(VkPhysicalDeviceDriverProperties);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES: {
+            return sizeof(VkPhysicalDeviceShaderAtomicInt64Features);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES: {
+            return sizeof(VkPhysicalDeviceShaderFloat16Int8Features);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES: {
+            return sizeof(VkPhysicalDeviceFloatControlsProperties);
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO: {
+            return sizeof(VkDescriptorSetLayoutBindingFlagsCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES: {
+            return sizeof(VkPhysicalDeviceDescriptorIndexingFeatures);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES: {
+            return sizeof(VkPhysicalDeviceDescriptorIndexingProperties);
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO: {
+            return sizeof(VkDescriptorSetVariableDescriptorCountAllocateInfo);
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT: {
+            return sizeof(VkDescriptorSetVariableDescriptorCountLayoutSupport);
+        }
+        case VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE: {
+            return sizeof(VkSubpassDescriptionDepthStencilResolve);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES: {
+            return sizeof(VkPhysicalDeviceDepthStencilResolveProperties);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES: {
+            return sizeof(VkPhysicalDeviceScalarBlockLayoutFeatures);
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO: {
+            return sizeof(VkImageStencilUsageCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO: {
+            return sizeof(VkSamplerReductionModeCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES: {
+            return sizeof(VkPhysicalDeviceSamplerFilterMinmaxProperties);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES: {
+            return sizeof(VkPhysicalDeviceVulkanMemoryModelFeatures);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES: {
+            return sizeof(VkPhysicalDeviceImagelessFramebufferFeatures);
+        }
+        case VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO: {
+            return sizeof(VkFramebufferAttachmentsCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO: {
+            return sizeof(VkRenderPassAttachmentBeginInfo);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES: {
+            return sizeof(VkPhysicalDeviceUniformBufferStandardLayoutFeatures);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES: {
+            return sizeof(VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES: {
+            return sizeof(VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures);
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT: {
+            return sizeof(VkAttachmentReferenceStencilLayout);
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT: {
+            return sizeof(VkAttachmentDescriptionStencilLayout);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES: {
+            return sizeof(VkPhysicalDeviceHostQueryResetFeatures);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES: {
+            return sizeof(VkPhysicalDeviceTimelineSemaphoreFeatures);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES: {
+            return sizeof(VkPhysicalDeviceTimelineSemaphoreProperties);
+        }
+        case VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO: {
+            return sizeof(VkSemaphoreTypeCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO: {
+            return sizeof(VkTimelineSemaphoreSubmitInfo);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES: {
+            return sizeof(VkPhysicalDeviceBufferDeviceAddressFeatures);
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO: {
+            return sizeof(VkBufferOpaqueCaptureAddressCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO: {
+            return sizeof(VkMemoryOpaqueCaptureAddressAllocateInfo);
+        }
+#endif
+#ifdef VK_KHR_swapchain
+        case VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR: {
+            return sizeof(VkImageSwapchainCreateInfoKHR);
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR: {
+            return sizeof(VkBindImageMemorySwapchainInfoKHR);
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR: {
+            return sizeof(VkDeviceGroupPresentInfoKHR);
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR: {
+            return sizeof(VkDeviceGroupSwapchainCreateInfoKHR);
+        }
+#endif
+#ifdef VK_KHR_display_swapchain
+        case VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR: {
+            return sizeof(VkDisplayPresentInfoKHR);
+        }
+#endif
+#ifdef VK_KHR_video_queue
+        case VK_STRUCTURE_TYPE_VIDEO_QUEUE_FAMILY_PROPERTIES_2_KHR: {
+            return sizeof(VkVideoQueueFamilyProperties2KHR);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_PROFILE_KHR: {
+            return sizeof(VkVideoProfileKHR);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_PROFILES_KHR: {
+            return sizeof(VkVideoProfilesKHR);
+        }
+#endif
+#ifdef VK_KHR_dynamic_rendering
+        case VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO_KHR: {
+            return sizeof(VkPipelineRenderingCreateInfoKHR);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR: {
+            return sizeof(VkPhysicalDeviceDynamicRenderingFeaturesKHR);
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO_KHR: {
+            return sizeof(VkCommandBufferInheritanceRenderingInfoKHR);
+        }
+        case VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR: {
+            return sizeof(VkRenderingFragmentShadingRateAttachmentInfoKHR);
+        }
+        case VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT: {
+            return sizeof(VkRenderingFragmentDensityMapAttachmentInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD: {
+            return sizeof(VkAttachmentSampleCountInfoAMD);
+        }
+        case VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX: {
+            return sizeof(VkMultiviewPerViewAttributesInfoNVX);
+        }
+#endif
+#ifdef VK_KHR_external_memory_win32
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR: {
+            return sizeof(VkImportMemoryWin32HandleInfoKHR);
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR: {
+            return sizeof(VkExportMemoryWin32HandleInfoKHR);
+        }
+#endif
+#ifdef VK_KHR_external_memory_fd
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR: {
+            return sizeof(VkImportMemoryFdInfoKHR);
+        }
+#endif
+#ifdef VK_KHR_win32_keyed_mutex
+        case VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR: {
+            return sizeof(VkWin32KeyedMutexAcquireReleaseInfoKHR);
+        }
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+        case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR: {
+            return sizeof(VkExportSemaphoreWin32HandleInfoKHR);
+        }
+        case VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR: {
+            return sizeof(VkD3D12FenceSubmitInfoKHR);
+        }
+#endif
+#ifdef VK_KHR_push_descriptor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR: {
+            return sizeof(VkPhysicalDevicePushDescriptorPropertiesKHR);
+        }
+#endif
+#ifdef VK_KHR_incremental_present
+        case VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR: {
+            return sizeof(VkPresentRegionsKHR);
+        }
+#endif
+#ifdef VK_KHR_shared_presentable_image
+        case VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR: {
+            return sizeof(VkSharedPresentSurfaceCapabilitiesKHR);
+        }
+#endif
+#ifdef VK_KHR_external_fence_win32
+        case VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR: {
+            return sizeof(VkExportFenceWin32HandleInfoKHR);
+        }
+#endif
+#ifdef VK_KHR_performance_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR: {
+            return sizeof(VkPhysicalDevicePerformanceQueryFeaturesKHR);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR: {
+            return sizeof(VkPhysicalDevicePerformanceQueryPropertiesKHR);
+        }
+        case VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR: {
+            return sizeof(VkQueryPoolPerformanceCreateInfoKHR);
+        }
+        case VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR: {
+            return sizeof(VkPerformanceQuerySubmitInfoKHR);
+        }
+#endif
+#ifdef VK_KHR_portability_subset
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR: {
+            return sizeof(VkPhysicalDevicePortabilitySubsetFeaturesKHR);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR: {
+            return sizeof(VkPhysicalDevicePortabilitySubsetPropertiesKHR);
+        }
+#endif
+#ifdef VK_KHR_shader_clock
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR: {
+            return sizeof(VkPhysicalDeviceShaderClockFeaturesKHR);
+        }
+#endif
+#ifdef VK_KHR_shader_terminate_invocation
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR: {
+            return sizeof(VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR);
+        }
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+        case VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR: {
+            return sizeof(VkFragmentShadingRateAttachmentInfoKHR);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR: {
+            return sizeof(VkPipelineFragmentShadingRateStateCreateInfoKHR);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR: {
+            return sizeof(VkPhysicalDeviceFragmentShadingRateFeaturesKHR);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR: {
+            return sizeof(VkPhysicalDeviceFragmentShadingRatePropertiesKHR);
+        }
+#endif
+#ifdef VK_KHR_surface_protected_capabilities
+        case VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR: {
+            return sizeof(VkSurfaceProtectedCapabilitiesKHR);
+        }
+#endif
+#ifdef VK_KHR_present_wait
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR: {
+            return sizeof(VkPhysicalDevicePresentWaitFeaturesKHR);
+        }
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR: {
+            return sizeof(VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR);
+        }
+#endif
+#ifdef VK_KHR_shader_integer_dot_product
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR: {
+            return sizeof(VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR: {
+            return sizeof(VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR);
+        }
+#endif
+#ifdef VK_KHR_present_id
+        case VK_STRUCTURE_TYPE_PRESENT_ID_KHR: {
+            return sizeof(VkPresentIdKHR);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR: {
+            return sizeof(VkPhysicalDevicePresentIdFeaturesKHR);
+        }
+#endif
+#ifdef VK_KHR_video_encode_queue
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_INFO_KHR: {
+            return sizeof(VkVideoEncodeRateControlInfoKHR);
+        }
+#endif
+#ifdef VK_KHR_synchronization2
+        case VK_STRUCTURE_TYPE_MEMORY_BARRIER_2_KHR: {
+            return sizeof(VkMemoryBarrier2KHR);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR: {
+            return sizeof(VkPhysicalDeviceSynchronization2FeaturesKHR);
+        }
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV: {
+            return sizeof(VkQueueFamilyCheckpointProperties2NV);
+        }
+#endif
+#ifdef VK_KHR_shader_subgroup_uniform_control_flow
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR: {
+            return sizeof(VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR);
+        }
+#endif
+#ifdef VK_KHR_zero_initialize_workgroup_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES_KHR: {
+            return sizeof(VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR);
+        }
+#endif
+#ifdef VK_KHR_workgroup_memory_explicit_layout
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR: {
+            return sizeof(VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR);
+        }
+#endif
+#ifdef VK_KHR_format_feature_flags2
+        case VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3_KHR: {
+            return sizeof(VkFormatProperties3KHR);
+        }
+#endif
+#ifdef VK_KHR_maintenance4
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES_KHR: {
+            return sizeof(VkPhysicalDeviceMaintenance4FeaturesKHR);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES_KHR: {
+            return sizeof(VkPhysicalDeviceMaintenance4PropertiesKHR);
+        }
+#endif
+#ifdef VK_ANDROID_native_buffer
+        case VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID: {
+            return sizeof(VkNativeBufferANDROID);
+        }
+#endif
+#ifdef VK_EXT_debug_report
+        case VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT: {
+            return sizeof(VkDebugReportCallbackCreateInfoEXT);
+        }
+#endif
+#ifdef VK_AMD_rasterization_order
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD: {
+            return sizeof(VkPipelineRasterizationStateRasterizationOrderAMD);
+        }
+#endif
+#ifdef VK_NV_dedicated_allocation
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV: {
+            return sizeof(VkDedicatedAllocationImageCreateInfoNV);
+        }
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV: {
+            return sizeof(VkDedicatedAllocationBufferCreateInfoNV);
+        }
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV: {
+            return sizeof(VkDedicatedAllocationMemoryAllocateInfoNV);
+        }
+#endif
+#ifdef VK_EXT_transform_feedback
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceTransformFeedbackFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceTransformFeedbackPropertiesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT: {
+            return sizeof(VkPipelineRasterizationStateStreamCreateInfoEXT);
+        }
+#endif
+#ifdef VK_EXT_video_encode_h264
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_EXT: {
+            return sizeof(VkVideoEncodeH264CapabilitiesEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_CREATE_INFO_EXT: {
+            return sizeof(VkVideoEncodeH264SessionCreateInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            return sizeof(VkVideoEncodeH264SessionParametersAddInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            return sizeof(VkVideoEncodeH264SessionParametersCreateInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_VCL_FRAME_INFO_EXT: {
+            return sizeof(VkVideoEncodeH264VclFrameInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_EMIT_PICTURE_PARAMETERS_EXT: {
+            return sizeof(VkVideoEncodeH264EmitPictureParametersEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_EXT: {
+            return sizeof(VkVideoEncodeH264ProfileEXT);
+        }
+#endif
+#ifdef VK_EXT_video_encode_h265
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_EXT: {
+            return sizeof(VkVideoEncodeH265CapabilitiesEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_CREATE_INFO_EXT: {
+            return sizeof(VkVideoEncodeH265SessionCreateInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            return sizeof(VkVideoEncodeH265SessionParametersAddInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            return sizeof(VkVideoEncodeH265SessionParametersCreateInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_VCL_FRAME_INFO_EXT: {
+            return sizeof(VkVideoEncodeH265VclFrameInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_EMIT_PICTURE_PARAMETERS_EXT: {
+            return sizeof(VkVideoEncodeH265EmitPictureParametersEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_EXT: {
+            return sizeof(VkVideoEncodeH265ProfileEXT);
+        }
+#endif
+#ifdef VK_EXT_video_decode_h264
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_EXT: {
+            return sizeof(VkVideoDecodeH264ProfileEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_EXT: {
+            return sizeof(VkVideoDecodeH264CapabilitiesEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_CREATE_INFO_EXT: {
+            return sizeof(VkVideoDecodeH264SessionCreateInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            return sizeof(VkVideoDecodeH264SessionParametersAddInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            return sizeof(VkVideoDecodeH264SessionParametersCreateInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PICTURE_INFO_EXT: {
+            return sizeof(VkVideoDecodeH264PictureInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_MVC_EXT: {
+            return sizeof(VkVideoDecodeH264MvcEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_EXT: {
+            return sizeof(VkVideoDecodeH264DpbSlotInfoEXT);
+        }
+#endif
+#ifdef VK_AMD_texture_gather_bias_lod
+        case VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD: {
+            return sizeof(VkTextureLODGatherFormatPropertiesAMD);
+        }
+#endif
+#ifdef VK_NV_corner_sampled_image
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceCornerSampledImageFeaturesNV);
+        }
+#endif
+#ifdef VK_NV_external_memory
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV: {
+            return sizeof(VkExternalMemoryImageCreateInfoNV);
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV: {
+            return sizeof(VkExportMemoryAllocateInfoNV);
+        }
+#endif
+#ifdef VK_NV_external_memory_win32
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV: {
+            return sizeof(VkImportMemoryWin32HandleInfoNV);
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV: {
+            return sizeof(VkExportMemoryWin32HandleInfoNV);
+        }
+#endif
+#ifdef VK_NV_win32_keyed_mutex
+        case VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV: {
+            return sizeof(VkWin32KeyedMutexAcquireReleaseInfoNV);
+        }
+#endif
+#ifdef VK_EXT_validation_flags
+        case VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT: {
+            return sizeof(VkValidationFlagsEXT);
+        }
+#endif
+#ifdef VK_EXT_texture_compression_astc_hdr
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_astc_decode_mode
+        case VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT: {
+            return sizeof(VkImageViewASTCDecodeModeEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceASTCDecodeFeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_conditional_rendering
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceConditionalRenderingFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT: {
+            return sizeof(VkCommandBufferInheritanceConditionalRenderingInfoEXT);
+        }
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV: {
+            return sizeof(VkPipelineViewportWScalingStateCreateInfoNV);
+        }
+#endif
+#ifdef VK_EXT_display_control
+        case VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT: {
+            return sizeof(VkSwapchainCounterCreateInfoEXT);
+        }
+#endif
+#ifdef VK_GOOGLE_display_timing
+        case VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE: {
+            return sizeof(VkPresentTimesInfoGOOGLE);
+        }
+#endif
+#ifdef VK_NVX_multiview_per_view_attributes
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX: {
+            return sizeof(VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX);
+        }
+#endif
+#ifdef VK_NV_viewport_swizzle
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV: {
+            return sizeof(VkPipelineViewportSwizzleStateCreateInfoNV);
+        }
+#endif
+#ifdef VK_EXT_discard_rectangles
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceDiscardRectanglePropertiesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT: {
+            return sizeof(VkPipelineDiscardRectangleStateCreateInfoEXT);
+        }
+#endif
+#ifdef VK_EXT_conservative_rasterization
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceConservativeRasterizationPropertiesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT: {
+            return sizeof(VkPipelineRasterizationConservativeStateCreateInfoEXT);
+        }
+#endif
+#ifdef VK_EXT_depth_clip_enable
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceDepthClipEnableFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT: {
+            return sizeof(VkPipelineRasterizationDepthClipStateCreateInfoEXT);
+        }
+#endif
+#ifdef VK_EXT_debug_utils
+        case VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT: {
+            return sizeof(VkDebugUtilsMessengerCreateInfoEXT);
+        }
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID: {
+            return sizeof(VkAndroidHardwareBufferUsageANDROID);
+        }
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID: {
+            return sizeof(VkAndroidHardwareBufferFormatPropertiesANDROID);
+        }
+        case VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID: {
+            return sizeof(VkImportAndroidHardwareBufferInfoANDROID);
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID: {
+            return sizeof(VkExternalFormatANDROID);
+        }
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID: {
+            return sizeof(VkAndroidHardwareBufferFormatProperties2ANDROID);
+        }
+#endif
+#ifdef VK_EXT_inline_uniform_block
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceInlineUniformBlockFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceInlineUniformBlockPropertiesEXT);
+        }
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT: {
+            return sizeof(VkWriteDescriptorSetInlineUniformBlockEXT);
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO_EXT: {
+            return sizeof(VkDescriptorPoolInlineUniformBlockCreateInfoEXT);
+        }
+#endif
+#ifdef VK_EXT_sample_locations
+        case VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT: {
+            return sizeof(VkSampleLocationsInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT: {
+            return sizeof(VkRenderPassSampleLocationsBeginInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT: {
+            return sizeof(VkPipelineSampleLocationsStateCreateInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceSampleLocationsPropertiesEXT);
+        }
+#endif
+#ifdef VK_EXT_blend_operation_advanced
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT: {
+            return sizeof(VkPipelineColorBlendAdvancedStateCreateInfoEXT);
+        }
+#endif
+#ifdef VK_NV_fragment_coverage_to_color
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV: {
+            return sizeof(VkPipelineCoverageToColorStateCreateInfoNV);
+        }
+#endif
+#ifdef VK_NV_framebuffer_mixed_samples
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV: {
+            return sizeof(VkPipelineCoverageModulationStateCreateInfoNV);
+        }
+#endif
+#ifdef VK_NV_shader_sm_builtins
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV: {
+            return sizeof(VkPhysicalDeviceShaderSMBuiltinsPropertiesNV);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceShaderSMBuiltinsFeaturesNV);
+        }
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+        case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT: {
+            return sizeof(VkDrmFormatModifierPropertiesListEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT: {
+            return sizeof(VkPhysicalDeviceImageDrmFormatModifierInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT: {
+            return sizeof(VkImageDrmFormatModifierListCreateInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT: {
+            return sizeof(VkImageDrmFormatModifierExplicitCreateInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT: {
+            return sizeof(VkDrmFormatModifierPropertiesList2EXT);
+        }
+#endif
+#ifdef VK_EXT_validation_cache
+        case VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT: {
+            return sizeof(VkShaderModuleValidationCacheCreateInfoEXT);
+        }
+#endif
+#ifdef VK_NV_shading_rate_image
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV: {
+            return sizeof(VkPipelineViewportShadingRateImageStateCreateInfoNV);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceShadingRateImageFeaturesNV);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV: {
+            return sizeof(VkPhysicalDeviceShadingRateImagePropertiesNV);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV: {
+            return sizeof(VkPipelineViewportCoarseSampleOrderStateCreateInfoNV);
+        }
+#endif
+#ifdef VK_NV_ray_tracing
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV: {
+            return sizeof(VkWriteDescriptorSetAccelerationStructureNV);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV: {
+            return sizeof(VkPhysicalDeviceRayTracingPropertiesNV);
+        }
+#endif
+#ifdef VK_NV_representative_fragment_test
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV: {
+            return sizeof(VkPipelineRepresentativeFragmentTestStateCreateInfoNV);
+        }
+#endif
+#ifdef VK_EXT_filter_cubic
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT: {
+            return sizeof(VkPhysicalDeviceImageViewImageFormatInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT: {
+            return sizeof(VkFilterCubicImageViewImageFormatPropertiesEXT);
+        }
+#endif
+#ifdef VK_EXT_global_priority
+        case VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT: {
+            return sizeof(VkDeviceQueueGlobalPriorityCreateInfoEXT);
+        }
+#endif
+#ifdef VK_EXT_external_memory_host
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT: {
+            return sizeof(VkImportMemoryHostPointerInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceExternalMemoryHostPropertiesEXT);
+        }
+#endif
+#ifdef VK_AMD_pipeline_compiler_control
+        case VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD: {
+            return sizeof(VkPipelineCompilerControlCreateInfoAMD);
+        }
+#endif
+#ifdef VK_AMD_shader_core_properties
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD: {
+            return sizeof(VkPhysicalDeviceShaderCorePropertiesAMD);
+        }
+#endif
+#ifdef VK_EXT_video_decode_h265
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_EXT: {
+            return sizeof(VkVideoDecodeH265ProfileEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_EXT: {
+            return sizeof(VkVideoDecodeH265CapabilitiesEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_CREATE_INFO_EXT: {
+            return sizeof(VkVideoDecodeH265SessionCreateInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            return sizeof(VkVideoDecodeH265SessionParametersAddInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            return sizeof(VkVideoDecodeH265SessionParametersCreateInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PICTURE_INFO_EXT: {
+            return sizeof(VkVideoDecodeH265PictureInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_EXT: {
+            return sizeof(VkVideoDecodeH265DpbSlotInfoEXT);
+        }
+#endif
+#ifdef VK_AMD_memory_overallocation_behavior
+        case VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD: {
+            return sizeof(VkDeviceMemoryOverallocationCreateInfoAMD);
+        }
+#endif
+#ifdef VK_EXT_vertex_attribute_divisor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT: {
+            return sizeof(VkPipelineVertexInputDivisorStateCreateInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT);
+        }
+#endif
+#ifdef VK_GGP_frame_token
+        case VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP: {
+            return sizeof(VkPresentFrameTokenGGP);
+        }
+#endif
+#ifdef VK_EXT_pipeline_creation_feedback
+        case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT: {
+            return sizeof(VkPipelineCreationFeedbackCreateInfoEXT);
+        }
+#endif
+#ifdef VK_NV_compute_shader_derivatives
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceComputeShaderDerivativesFeaturesNV);
+        }
+#endif
+#ifdef VK_NV_mesh_shader
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceMeshShaderFeaturesNV);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV: {
+            return sizeof(VkPhysicalDeviceMeshShaderPropertiesNV);
+        }
+#endif
+#ifdef VK_NV_fragment_shader_barycentric
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV);
+        }
+#endif
+#ifdef VK_NV_shader_image_footprint
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceShaderImageFootprintFeaturesNV);
+        }
+#endif
+#ifdef VK_NV_scissor_exclusive
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV: {
+            return sizeof(VkPipelineViewportExclusiveScissorStateCreateInfoNV);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceExclusiveScissorFeaturesNV);
+        }
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV: {
+            return sizeof(VkQueueFamilyCheckpointPropertiesNV);
+        }
+#endif
+#ifdef VK_INTEL_shader_integer_functions2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL: {
+            return sizeof(VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL);
+        }
+#endif
+#ifdef VK_INTEL_performance_query
+        case VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL: {
+            return sizeof(VkQueryPoolPerformanceQueryCreateInfoINTEL);
+        }
+#endif
+#ifdef VK_EXT_pci_bus_info
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDevicePCIBusInfoPropertiesEXT);
+        }
+#endif
+#ifdef VK_AMD_display_native_hdr
+        case VK_STRUCTURE_TYPE_DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD: {
+            return sizeof(VkDisplayNativeHdrSurfaceCapabilitiesAMD);
+        }
+        case VK_STRUCTURE_TYPE_SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD: {
+            return sizeof(VkSwapchainDisplayNativeHdrCreateInfoAMD);
+        }
+#endif
+#ifdef VK_EXT_fragment_density_map
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT: {
+            switch (rootType) {
+                case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: {
+                    return sizeof(VkPhysicalDeviceFragmentDensityMapFeaturesEXT);
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO: {
+                    return sizeof(VkPhysicalDeviceFragmentDensityMapFeaturesEXT);
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO: {
+                    return sizeof(VkImportColorBufferGOOGLE);
+                    break;
+                }
+                default: {
+                    return sizeof(VkPhysicalDeviceFragmentDensityMapFeaturesEXT);
+                    break;
+                }
+            }
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT: {
+            switch (rootType) {
+                case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2: {
+                    return sizeof(VkPhysicalDeviceFragmentDensityMapPropertiesEXT);
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO: {
+                    return sizeof(VkCreateBlobGOOGLE);
+                    break;
+                }
+                default: {
+                    return sizeof(VkPhysicalDeviceFragmentDensityMapPropertiesEXT);
+                    break;
+                }
+            }
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT: {
+            switch (rootType) {
+                case VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO: {
+                    return sizeof(VkRenderPassFragmentDensityMapCreateInfoEXT);
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2: {
+                    return sizeof(VkRenderPassFragmentDensityMapCreateInfoEXT);
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO: {
+                    return sizeof(VkImportBufferGOOGLE);
+                    break;
+                }
+                default: {
+                    return sizeof(VkRenderPassFragmentDensityMapCreateInfoEXT);
+                    break;
+                }
+            }
+        }
+#endif
+#ifdef VK_EXT_subgroup_size_control
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceSubgroupSizeControlFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceSubgroupSizeControlPropertiesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT: {
+            return sizeof(VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT);
+        }
+#endif
+#ifdef VK_AMD_shader_core_properties2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD: {
+            return sizeof(VkPhysicalDeviceShaderCoreProperties2AMD);
+        }
+#endif
+#ifdef VK_AMD_device_coherent_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD: {
+            return sizeof(VkPhysicalDeviceCoherentMemoryFeaturesAMD);
+        }
+#endif
+#ifdef VK_EXT_shader_image_atomic_int64
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_memory_budget
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceMemoryBudgetPropertiesEXT);
+        }
+#endif
+#ifdef VK_EXT_memory_priority
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceMemoryPriorityFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT: {
+            return sizeof(VkMemoryPriorityAllocateInfoEXT);
+        }
+#endif
+#ifdef VK_NV_dedicated_allocation_image_aliasing
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV);
+        }
+#endif
+#ifdef VK_EXT_buffer_device_address
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceBufferDeviceAddressFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT: {
+            return sizeof(VkBufferDeviceAddressCreateInfoEXT);
+        }
+#endif
+#ifdef VK_EXT_validation_features
+        case VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT: {
+            return sizeof(VkValidationFeaturesEXT);
+        }
+#endif
+#ifdef VK_NV_cooperative_matrix
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceCooperativeMatrixFeaturesNV);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV: {
+            return sizeof(VkPhysicalDeviceCooperativeMatrixPropertiesNV);
+        }
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceCoverageReductionModeFeaturesNV);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV: {
+            return sizeof(VkPipelineCoverageReductionStateCreateInfoNV);
+        }
+#endif
+#ifdef VK_EXT_fragment_shader_interlock
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_ycbcr_image_arrays
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceYcbcrImageArraysFeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_provoking_vertex
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceProvokingVertexFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceProvokingVertexPropertiesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT: {
+            return sizeof(VkPipelineRasterizationProvokingVertexStateCreateInfoEXT);
+        }
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+        case VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT: {
+            return sizeof(VkSurfaceFullScreenExclusiveInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT: {
+            return sizeof(VkSurfaceCapabilitiesFullScreenExclusiveEXT);
+        }
+        case VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT: {
+            return sizeof(VkSurfaceFullScreenExclusiveWin32InfoEXT);
+        }
+#endif
+#ifdef VK_EXT_line_rasterization
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceLineRasterizationFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceLineRasterizationPropertiesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT: {
+            return sizeof(VkPipelineRasterizationLineStateCreateInfoEXT);
+        }
+#endif
+#ifdef VK_EXT_shader_atomic_float
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceShaderAtomicFloatFeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_index_type_uint8
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceIndexTypeUint8FeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceExtendedDynamicStateFeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_shader_atomic_float2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_shader_demote_to_helper_invocation
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT);
+        }
+#endif
+#ifdef VK_NV_device_generated_commands
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV: {
+            return sizeof(VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV);
+        }
+        case VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV: {
+            return sizeof(VkGraphicsPipelineShaderGroupsCreateInfoNV);
+        }
+#endif
+#ifdef VK_NV_inherited_viewport_scissor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceInheritedViewportScissorFeaturesNV);
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV: {
+            return sizeof(VkCommandBufferInheritanceViewportScissorInfoNV);
+        }
+#endif
+#ifdef VK_EXT_texel_buffer_alignment
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT);
+        }
+#endif
+#ifdef VK_QCOM_render_pass_transform
+        case VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM: {
+            return sizeof(VkRenderPassTransformBeginInfoQCOM);
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM: {
+            return sizeof(VkCommandBufferInheritanceRenderPassTransformInfoQCOM);
+        }
+#endif
+#ifdef VK_EXT_device_memory_report
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceDeviceMemoryReportFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT: {
+            return sizeof(VkDeviceDeviceMemoryReportCreateInfoEXT);
+        }
+#endif
+#ifdef VK_EXT_robustness2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceRobustness2FeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceRobustness2PropertiesEXT);
+        }
+#endif
+#ifdef VK_EXT_custom_border_color
+        case VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT: {
+            return sizeof(VkSamplerCustomBorderColorCreateInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceCustomBorderColorPropertiesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceCustomBorderColorFeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_private_data
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT: {
+            return sizeof(VkPhysicalDevicePrivateDataFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO_EXT: {
+            return sizeof(VkDevicePrivateDataCreateInfoEXT);
+        }
+#endif
+#ifdef VK_EXT_pipeline_creation_cache_control
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES_EXT: {
+            return sizeof(VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT);
+        }
+#endif
+#ifdef VK_NV_device_diagnostics_config
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceDiagnosticsConfigFeaturesNV);
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV: {
+            return sizeof(VkDeviceDiagnosticsConfigCreateInfoNV);
+        }
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV: {
+            return sizeof(VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV: {
+            return sizeof(VkPipelineFragmentShadingRateEnumStateCreateInfoNV);
+        }
+#endif
+#ifdef VK_NV_ray_tracing_motion_blur
+        case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV: {
+            return sizeof(VkAccelerationStructureGeometryMotionTrianglesDataNV);
+        }
+        case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV: {
+            return sizeof(VkAccelerationStructureMotionInfoNV);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceRayTracingMotionBlurFeaturesNV);
+        }
+#endif
+#ifdef VK_EXT_ycbcr_2plane_444_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_fragment_density_map2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceFragmentDensityMap2FeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceFragmentDensityMap2PropertiesEXT);
+        }
+#endif
+#ifdef VK_QCOM_rotated_copy_commands
+        case VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM: {
+            return sizeof(VkCopyCommandTransformInfoQCOM);
+        }
+#endif
+#ifdef VK_EXT_image_robustness
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceImageRobustnessFeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_4444_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT: {
+            return sizeof(VkPhysicalDevice4444FormatsFeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_rgba10x6_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT);
+        }
+#endif
+#ifdef VK_VALVE_mutable_descriptor_type
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE: {
+            return sizeof(VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE);
+        }
+        case VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE: {
+            return sizeof(VkMutableDescriptorTypeCreateInfoVALVE);
+        }
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_physical_device_drm
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceDrmPropertiesEXT);
+        }
+#endif
+#ifdef VK_EXT_primitive_topology_list_restart
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT: {
+            return sizeof(VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT);
+        }
+#endif
+#ifdef VK_FUCHSIA_external_memory
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA: {
+            return sizeof(VkImportMemoryZirconHandleInfoFUCHSIA);
+        }
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA: {
+            return sizeof(VkImportMemoryBufferCollectionFUCHSIA);
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA: {
+            return sizeof(VkBufferCollectionImageCreateInfoFUCHSIA);
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA: {
+            return sizeof(VkBufferCollectionBufferCreateInfoFUCHSIA);
+        }
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+        case VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI: {
+            return sizeof(VkSubpassShadingPipelineCreateInfoHUAWEI);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI: {
+            return sizeof(VkPhysicalDeviceSubpassShadingFeaturesHUAWEI);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI: {
+            return sizeof(VkPhysicalDeviceSubpassShadingPropertiesHUAWEI);
+        }
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI: {
+            return sizeof(VkPhysicalDeviceInvocationMaskFeaturesHUAWEI);
+        }
+#endif
+#ifdef VK_NV_external_memory_rdma
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_RDMA_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceExternalMemoryRDMAFeaturesNV);
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceExtendedDynamicState2FeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_color_write_enable
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceColorWriteEnableFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT: {
+            return sizeof(VkPipelineColorWriteCreateInfoEXT);
+        }
+#endif
+#ifdef VK_GOOGLE_gfxstream
+        case VK_STRUCTURE_TYPE_IMPORT_COLOR_BUFFER_GOOGLE: {
+            return sizeof(VkImportColorBufferGOOGLE);
+        }
+        case VK_STRUCTURE_TYPE_IMPORT_BUFFER_GOOGLE: {
+            return sizeof(VkImportBufferGOOGLE);
+        }
+        case VK_STRUCTURE_TYPE_CREATE_BLOB_GOOGLE: {
+            return sizeof(VkCreateBlobGOOGLE);
+        }
+#endif
+#ifdef VK_EXT_global_priority_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_EXT: {
+            return sizeof(VkQueueFamilyGlobalPriorityPropertiesEXT);
+        }
+#endif
+#ifdef VK_EXT_multi_draw
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceMultiDrawFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceMultiDrawPropertiesEXT);
+        }
+#endif
+#ifdef VK_EXT_border_color_swizzle
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceBorderColorSwizzleFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT: {
+            return sizeof(VkSamplerBorderColorComponentMappingCreateInfoEXT);
+        }
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT: {
+            return sizeof(VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT);
+        }
+#endif
+#ifdef VK_KHR_acceleration_structure
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR: {
+            return sizeof(VkWriteDescriptorSetAccelerationStructureKHR);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR: {
+            return sizeof(VkPhysicalDeviceAccelerationStructureFeaturesKHR);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR: {
+            return sizeof(VkPhysicalDeviceAccelerationStructurePropertiesKHR);
+        }
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR: {
+            return sizeof(VkPhysicalDeviceRayTracingPipelineFeaturesKHR);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR: {
+            return sizeof(VkPhysicalDeviceRayTracingPipelinePropertiesKHR);
+        }
+#endif
+#ifdef VK_KHR_ray_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR: {
+            return sizeof(VkPhysicalDeviceRayQueryFeaturesKHR);
+        }
+#endif
+        default: {
+            return (size_t)0;
+        }
+    }
+}
+
+size_t goldfish_vk_extension_struct_size_with_stream_features(uint32_t streamFeatures,
+                                                              VkStructureType rootType,
+                                                              const void* structExtension) {
+    if (!structExtension) {
+        return (size_t)0;
+    }
+    uint32_t structType = (uint32_t)goldfish_vk_struct_type(structExtension);
+    switch (structType) {
+#ifdef VK_VERSION_1_1
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES: {
+            return sizeof(VkPhysicalDeviceSubgroupProperties);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: {
+            return sizeof(VkPhysicalDevice16BitStorageFeatures);
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS: {
+            return sizeof(VkMemoryDedicatedRequirements);
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO: {
+            return sizeof(VkMemoryDedicatedAllocateInfo);
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO: {
+            return sizeof(VkMemoryAllocateFlagsInfo);
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO: {
+            return sizeof(VkDeviceGroupRenderPassBeginInfo);
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO: {
+            return sizeof(VkDeviceGroupCommandBufferBeginInfo);
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO: {
+            return sizeof(VkDeviceGroupSubmitInfo);
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO: {
+            return sizeof(VkDeviceGroupBindSparseInfo);
+        }
+        case VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO: {
+            return sizeof(VkBindBufferMemoryDeviceGroupInfo);
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO: {
+            return sizeof(VkBindImageMemoryDeviceGroupInfo);
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO: {
+            return sizeof(VkDeviceGroupDeviceCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: {
+            return sizeof(VkPhysicalDeviceFeatures2);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES: {
+            return sizeof(VkPhysicalDevicePointClippingProperties);
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO: {
+            return sizeof(VkRenderPassInputAttachmentAspectCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO: {
+            return sizeof(VkImageViewUsageCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO: {
+            return sizeof(VkPipelineTessellationDomainOriginStateCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO: {
+            return sizeof(VkRenderPassMultiviewCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES: {
+            return sizeof(VkPhysicalDeviceMultiviewFeatures);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES: {
+            return sizeof(VkPhysicalDeviceMultiviewProperties);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES: {
+            return sizeof(VkPhysicalDeviceVariablePointersFeatures);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES: {
+            return sizeof(VkPhysicalDeviceProtectedMemoryFeatures);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES: {
+            return sizeof(VkPhysicalDeviceProtectedMemoryProperties);
+        }
+        case VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO: {
+            return sizeof(VkProtectedSubmitInfo);
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO: {
+            return sizeof(VkSamplerYcbcrConversionInfo);
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO: {
+            return sizeof(VkBindImagePlaneMemoryInfo);
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO: {
+            return sizeof(VkImagePlaneMemoryRequirementsInfo);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: {
+            return sizeof(VkPhysicalDeviceSamplerYcbcrConversionFeatures);
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES: {
+            return sizeof(VkSamplerYcbcrConversionImageFormatProperties);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO: {
+            return sizeof(VkPhysicalDeviceExternalImageFormatInfo);
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES: {
+            return sizeof(VkExternalImageFormatProperties);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES: {
+            return sizeof(VkPhysicalDeviceIDProperties);
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO: {
+            return sizeof(VkExternalMemoryImageCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO: {
+            return sizeof(VkExternalMemoryBufferCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO: {
+            return sizeof(VkExportMemoryAllocateInfo);
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO: {
+            return sizeof(VkExportFenceCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO: {
+            return sizeof(VkExportSemaphoreCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES: {
+            return sizeof(VkPhysicalDeviceMaintenance3Properties);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES: {
+            return sizeof(VkPhysicalDeviceShaderDrawParametersFeatures);
+        }
+#endif
+#ifdef VK_VERSION_1_2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES: {
+            return sizeof(VkPhysicalDeviceVulkan11Features);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES: {
+            return sizeof(VkPhysicalDeviceVulkan11Properties);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES: {
+            return sizeof(VkPhysicalDeviceVulkan12Features);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES: {
+            return sizeof(VkPhysicalDeviceVulkan12Properties);
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO: {
+            return sizeof(VkImageFormatListCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES: {
+            return sizeof(VkPhysicalDevice8BitStorageFeatures);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES: {
+            return sizeof(VkPhysicalDeviceDriverProperties);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES: {
+            return sizeof(VkPhysicalDeviceShaderAtomicInt64Features);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES: {
+            if (streamFeatures & VULKAN_STREAM_FEATURE_SHADER_FLOAT16_INT8_BIT) {
+                return sizeof(VkPhysicalDeviceShaderFloat16Int8Features);
+            } else {
+                return 0;
+            }
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES: {
+            return sizeof(VkPhysicalDeviceFloatControlsProperties);
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO: {
+            return sizeof(VkDescriptorSetLayoutBindingFlagsCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES: {
+            return sizeof(VkPhysicalDeviceDescriptorIndexingFeatures);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES: {
+            return sizeof(VkPhysicalDeviceDescriptorIndexingProperties);
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO: {
+            return sizeof(VkDescriptorSetVariableDescriptorCountAllocateInfo);
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT: {
+            return sizeof(VkDescriptorSetVariableDescriptorCountLayoutSupport);
+        }
+        case VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE: {
+            return sizeof(VkSubpassDescriptionDepthStencilResolve);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES: {
+            return sizeof(VkPhysicalDeviceDepthStencilResolveProperties);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES: {
+            return sizeof(VkPhysicalDeviceScalarBlockLayoutFeatures);
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO: {
+            return sizeof(VkImageStencilUsageCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO: {
+            return sizeof(VkSamplerReductionModeCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES: {
+            return sizeof(VkPhysicalDeviceSamplerFilterMinmaxProperties);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES: {
+            return sizeof(VkPhysicalDeviceVulkanMemoryModelFeatures);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES: {
+            return sizeof(VkPhysicalDeviceImagelessFramebufferFeatures);
+        }
+        case VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO: {
+            return sizeof(VkFramebufferAttachmentsCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO: {
+            return sizeof(VkRenderPassAttachmentBeginInfo);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES: {
+            return sizeof(VkPhysicalDeviceUniformBufferStandardLayoutFeatures);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES: {
+            return sizeof(VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES: {
+            return sizeof(VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures);
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT: {
+            return sizeof(VkAttachmentReferenceStencilLayout);
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT: {
+            return sizeof(VkAttachmentDescriptionStencilLayout);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES: {
+            return sizeof(VkPhysicalDeviceHostQueryResetFeatures);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES: {
+            return sizeof(VkPhysicalDeviceTimelineSemaphoreFeatures);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES: {
+            return sizeof(VkPhysicalDeviceTimelineSemaphoreProperties);
+        }
+        case VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO: {
+            return sizeof(VkSemaphoreTypeCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO: {
+            return sizeof(VkTimelineSemaphoreSubmitInfo);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES: {
+            return sizeof(VkPhysicalDeviceBufferDeviceAddressFeatures);
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO: {
+            return sizeof(VkBufferOpaqueCaptureAddressCreateInfo);
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO: {
+            return sizeof(VkMemoryOpaqueCaptureAddressAllocateInfo);
+        }
+#endif
+#ifdef VK_KHR_swapchain
+        case VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR: {
+            return sizeof(VkImageSwapchainCreateInfoKHR);
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR: {
+            return sizeof(VkBindImageMemorySwapchainInfoKHR);
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR: {
+            return sizeof(VkDeviceGroupPresentInfoKHR);
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR: {
+            return sizeof(VkDeviceGroupSwapchainCreateInfoKHR);
+        }
+#endif
+#ifdef VK_KHR_display_swapchain
+        case VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR: {
+            return sizeof(VkDisplayPresentInfoKHR);
+        }
+#endif
+#ifdef VK_KHR_video_queue
+        case VK_STRUCTURE_TYPE_VIDEO_QUEUE_FAMILY_PROPERTIES_2_KHR: {
+            return sizeof(VkVideoQueueFamilyProperties2KHR);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_PROFILE_KHR: {
+            return sizeof(VkVideoProfileKHR);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_PROFILES_KHR: {
+            return sizeof(VkVideoProfilesKHR);
+        }
+#endif
+#ifdef VK_KHR_dynamic_rendering
+        case VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO_KHR: {
+            return sizeof(VkPipelineRenderingCreateInfoKHR);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR: {
+            return sizeof(VkPhysicalDeviceDynamicRenderingFeaturesKHR);
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO_KHR: {
+            return sizeof(VkCommandBufferInheritanceRenderingInfoKHR);
+        }
+        case VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR: {
+            return sizeof(VkRenderingFragmentShadingRateAttachmentInfoKHR);
+        }
+        case VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT: {
+            return sizeof(VkRenderingFragmentDensityMapAttachmentInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD: {
+            return sizeof(VkAttachmentSampleCountInfoAMD);
+        }
+        case VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX: {
+            return sizeof(VkMultiviewPerViewAttributesInfoNVX);
+        }
+#endif
+#ifdef VK_KHR_external_memory_win32
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR: {
+            return sizeof(VkImportMemoryWin32HandleInfoKHR);
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR: {
+            return sizeof(VkExportMemoryWin32HandleInfoKHR);
+        }
+#endif
+#ifdef VK_KHR_external_memory_fd
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR: {
+            return sizeof(VkImportMemoryFdInfoKHR);
+        }
+#endif
+#ifdef VK_KHR_win32_keyed_mutex
+        case VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR: {
+            return sizeof(VkWin32KeyedMutexAcquireReleaseInfoKHR);
+        }
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+        case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR: {
+            return sizeof(VkExportSemaphoreWin32HandleInfoKHR);
+        }
+        case VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR: {
+            return sizeof(VkD3D12FenceSubmitInfoKHR);
+        }
+#endif
+#ifdef VK_KHR_push_descriptor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR: {
+            return sizeof(VkPhysicalDevicePushDescriptorPropertiesKHR);
+        }
+#endif
+#ifdef VK_KHR_incremental_present
+        case VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR: {
+            return sizeof(VkPresentRegionsKHR);
+        }
+#endif
+#ifdef VK_KHR_shared_presentable_image
+        case VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR: {
+            return sizeof(VkSharedPresentSurfaceCapabilitiesKHR);
+        }
+#endif
+#ifdef VK_KHR_external_fence_win32
+        case VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR: {
+            return sizeof(VkExportFenceWin32HandleInfoKHR);
+        }
+#endif
+#ifdef VK_KHR_performance_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR: {
+            return sizeof(VkPhysicalDevicePerformanceQueryFeaturesKHR);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR: {
+            return sizeof(VkPhysicalDevicePerformanceQueryPropertiesKHR);
+        }
+        case VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR: {
+            return sizeof(VkQueryPoolPerformanceCreateInfoKHR);
+        }
+        case VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR: {
+            return sizeof(VkPerformanceQuerySubmitInfoKHR);
+        }
+#endif
+#ifdef VK_KHR_portability_subset
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR: {
+            return sizeof(VkPhysicalDevicePortabilitySubsetFeaturesKHR);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR: {
+            return sizeof(VkPhysicalDevicePortabilitySubsetPropertiesKHR);
+        }
+#endif
+#ifdef VK_KHR_shader_clock
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR: {
+            return sizeof(VkPhysicalDeviceShaderClockFeaturesKHR);
+        }
+#endif
+#ifdef VK_KHR_shader_terminate_invocation
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR: {
+            return sizeof(VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR);
+        }
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+        case VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR: {
+            return sizeof(VkFragmentShadingRateAttachmentInfoKHR);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR: {
+            return sizeof(VkPipelineFragmentShadingRateStateCreateInfoKHR);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR: {
+            return sizeof(VkPhysicalDeviceFragmentShadingRateFeaturesKHR);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR: {
+            return sizeof(VkPhysicalDeviceFragmentShadingRatePropertiesKHR);
+        }
+#endif
+#ifdef VK_KHR_surface_protected_capabilities
+        case VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR: {
+            return sizeof(VkSurfaceProtectedCapabilitiesKHR);
+        }
+#endif
+#ifdef VK_KHR_present_wait
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR: {
+            return sizeof(VkPhysicalDevicePresentWaitFeaturesKHR);
+        }
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR: {
+            return sizeof(VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR);
+        }
+#endif
+#ifdef VK_KHR_shader_integer_dot_product
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR: {
+            return sizeof(VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR: {
+            return sizeof(VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR);
+        }
+#endif
+#ifdef VK_KHR_present_id
+        case VK_STRUCTURE_TYPE_PRESENT_ID_KHR: {
+            return sizeof(VkPresentIdKHR);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR: {
+            return sizeof(VkPhysicalDevicePresentIdFeaturesKHR);
+        }
+#endif
+#ifdef VK_KHR_video_encode_queue
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_INFO_KHR: {
+            return sizeof(VkVideoEncodeRateControlInfoKHR);
+        }
+#endif
+#ifdef VK_KHR_synchronization2
+        case VK_STRUCTURE_TYPE_MEMORY_BARRIER_2_KHR: {
+            return sizeof(VkMemoryBarrier2KHR);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR: {
+            return sizeof(VkPhysicalDeviceSynchronization2FeaturesKHR);
+        }
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV: {
+            return sizeof(VkQueueFamilyCheckpointProperties2NV);
+        }
+#endif
+#ifdef VK_KHR_shader_subgroup_uniform_control_flow
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR: {
+            return sizeof(VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR);
+        }
+#endif
+#ifdef VK_KHR_zero_initialize_workgroup_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES_KHR: {
+            return sizeof(VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR);
+        }
+#endif
+#ifdef VK_KHR_workgroup_memory_explicit_layout
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR: {
+            return sizeof(VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR);
+        }
+#endif
+#ifdef VK_KHR_format_feature_flags2
+        case VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3_KHR: {
+            return sizeof(VkFormatProperties3KHR);
+        }
+#endif
+#ifdef VK_KHR_maintenance4
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES_KHR: {
+            return sizeof(VkPhysicalDeviceMaintenance4FeaturesKHR);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES_KHR: {
+            return sizeof(VkPhysicalDeviceMaintenance4PropertiesKHR);
+        }
+#endif
+#ifdef VK_ANDROID_native_buffer
+        case VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID: {
+            return sizeof(VkNativeBufferANDROID);
+        }
+#endif
+#ifdef VK_EXT_debug_report
+        case VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT: {
+            return sizeof(VkDebugReportCallbackCreateInfoEXT);
+        }
+#endif
+#ifdef VK_AMD_rasterization_order
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD: {
+            return sizeof(VkPipelineRasterizationStateRasterizationOrderAMD);
+        }
+#endif
+#ifdef VK_NV_dedicated_allocation
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV: {
+            return sizeof(VkDedicatedAllocationImageCreateInfoNV);
+        }
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV: {
+            return sizeof(VkDedicatedAllocationBufferCreateInfoNV);
+        }
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV: {
+            return sizeof(VkDedicatedAllocationMemoryAllocateInfoNV);
+        }
+#endif
+#ifdef VK_EXT_transform_feedback
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceTransformFeedbackFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceTransformFeedbackPropertiesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT: {
+            return sizeof(VkPipelineRasterizationStateStreamCreateInfoEXT);
+        }
+#endif
+#ifdef VK_EXT_video_encode_h264
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_EXT: {
+            return sizeof(VkVideoEncodeH264CapabilitiesEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_CREATE_INFO_EXT: {
+            return sizeof(VkVideoEncodeH264SessionCreateInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            return sizeof(VkVideoEncodeH264SessionParametersAddInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            return sizeof(VkVideoEncodeH264SessionParametersCreateInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_VCL_FRAME_INFO_EXT: {
+            return sizeof(VkVideoEncodeH264VclFrameInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_EMIT_PICTURE_PARAMETERS_EXT: {
+            return sizeof(VkVideoEncodeH264EmitPictureParametersEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_EXT: {
+            return sizeof(VkVideoEncodeH264ProfileEXT);
+        }
+#endif
+#ifdef VK_EXT_video_encode_h265
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_EXT: {
+            return sizeof(VkVideoEncodeH265CapabilitiesEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_CREATE_INFO_EXT: {
+            return sizeof(VkVideoEncodeH265SessionCreateInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            return sizeof(VkVideoEncodeH265SessionParametersAddInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            return sizeof(VkVideoEncodeH265SessionParametersCreateInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_VCL_FRAME_INFO_EXT: {
+            return sizeof(VkVideoEncodeH265VclFrameInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_EMIT_PICTURE_PARAMETERS_EXT: {
+            return sizeof(VkVideoEncodeH265EmitPictureParametersEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_EXT: {
+            return sizeof(VkVideoEncodeH265ProfileEXT);
+        }
+#endif
+#ifdef VK_EXT_video_decode_h264
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_EXT: {
+            return sizeof(VkVideoDecodeH264ProfileEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_EXT: {
+            return sizeof(VkVideoDecodeH264CapabilitiesEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_CREATE_INFO_EXT: {
+            return sizeof(VkVideoDecodeH264SessionCreateInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            return sizeof(VkVideoDecodeH264SessionParametersAddInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            return sizeof(VkVideoDecodeH264SessionParametersCreateInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PICTURE_INFO_EXT: {
+            return sizeof(VkVideoDecodeH264PictureInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_MVC_EXT: {
+            return sizeof(VkVideoDecodeH264MvcEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_EXT: {
+            return sizeof(VkVideoDecodeH264DpbSlotInfoEXT);
+        }
+#endif
+#ifdef VK_AMD_texture_gather_bias_lod
+        case VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD: {
+            return sizeof(VkTextureLODGatherFormatPropertiesAMD);
+        }
+#endif
+#ifdef VK_NV_corner_sampled_image
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceCornerSampledImageFeaturesNV);
+        }
+#endif
+#ifdef VK_NV_external_memory
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV: {
+            return sizeof(VkExternalMemoryImageCreateInfoNV);
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV: {
+            return sizeof(VkExportMemoryAllocateInfoNV);
+        }
+#endif
+#ifdef VK_NV_external_memory_win32
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV: {
+            return sizeof(VkImportMemoryWin32HandleInfoNV);
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV: {
+            return sizeof(VkExportMemoryWin32HandleInfoNV);
+        }
+#endif
+#ifdef VK_NV_win32_keyed_mutex
+        case VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV: {
+            return sizeof(VkWin32KeyedMutexAcquireReleaseInfoNV);
+        }
+#endif
+#ifdef VK_EXT_validation_flags
+        case VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT: {
+            return sizeof(VkValidationFlagsEXT);
+        }
+#endif
+#ifdef VK_EXT_texture_compression_astc_hdr
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_astc_decode_mode
+        case VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT: {
+            return sizeof(VkImageViewASTCDecodeModeEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceASTCDecodeFeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_conditional_rendering
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceConditionalRenderingFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT: {
+            return sizeof(VkCommandBufferInheritanceConditionalRenderingInfoEXT);
+        }
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV: {
+            return sizeof(VkPipelineViewportWScalingStateCreateInfoNV);
+        }
+#endif
+#ifdef VK_EXT_display_control
+        case VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT: {
+            return sizeof(VkSwapchainCounterCreateInfoEXT);
+        }
+#endif
+#ifdef VK_GOOGLE_display_timing
+        case VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE: {
+            return sizeof(VkPresentTimesInfoGOOGLE);
+        }
+#endif
+#ifdef VK_NVX_multiview_per_view_attributes
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX: {
+            return sizeof(VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX);
+        }
+#endif
+#ifdef VK_NV_viewport_swizzle
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV: {
+            return sizeof(VkPipelineViewportSwizzleStateCreateInfoNV);
+        }
+#endif
+#ifdef VK_EXT_discard_rectangles
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceDiscardRectanglePropertiesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT: {
+            return sizeof(VkPipelineDiscardRectangleStateCreateInfoEXT);
+        }
+#endif
+#ifdef VK_EXT_conservative_rasterization
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceConservativeRasterizationPropertiesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT: {
+            return sizeof(VkPipelineRasterizationConservativeStateCreateInfoEXT);
+        }
+#endif
+#ifdef VK_EXT_depth_clip_enable
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceDepthClipEnableFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT: {
+            return sizeof(VkPipelineRasterizationDepthClipStateCreateInfoEXT);
+        }
+#endif
+#ifdef VK_EXT_debug_utils
+        case VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT: {
+            return sizeof(VkDebugUtilsMessengerCreateInfoEXT);
+        }
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID: {
+            return sizeof(VkAndroidHardwareBufferUsageANDROID);
+        }
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID: {
+            return sizeof(VkAndroidHardwareBufferFormatPropertiesANDROID);
+        }
+        case VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID: {
+            return sizeof(VkImportAndroidHardwareBufferInfoANDROID);
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID: {
+            return sizeof(VkExternalFormatANDROID);
+        }
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID: {
+            return sizeof(VkAndroidHardwareBufferFormatProperties2ANDROID);
+        }
+#endif
+#ifdef VK_EXT_inline_uniform_block
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceInlineUniformBlockFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceInlineUniformBlockPropertiesEXT);
+        }
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT: {
+            return sizeof(VkWriteDescriptorSetInlineUniformBlockEXT);
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO_EXT: {
+            return sizeof(VkDescriptorPoolInlineUniformBlockCreateInfoEXT);
+        }
+#endif
+#ifdef VK_EXT_sample_locations
+        case VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT: {
+            return sizeof(VkSampleLocationsInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT: {
+            return sizeof(VkRenderPassSampleLocationsBeginInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT: {
+            return sizeof(VkPipelineSampleLocationsStateCreateInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceSampleLocationsPropertiesEXT);
+        }
+#endif
+#ifdef VK_EXT_blend_operation_advanced
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT: {
+            return sizeof(VkPipelineColorBlendAdvancedStateCreateInfoEXT);
+        }
+#endif
+#ifdef VK_NV_fragment_coverage_to_color
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV: {
+            return sizeof(VkPipelineCoverageToColorStateCreateInfoNV);
+        }
+#endif
+#ifdef VK_NV_framebuffer_mixed_samples
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV: {
+            return sizeof(VkPipelineCoverageModulationStateCreateInfoNV);
+        }
+#endif
+#ifdef VK_NV_shader_sm_builtins
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV: {
+            return sizeof(VkPhysicalDeviceShaderSMBuiltinsPropertiesNV);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceShaderSMBuiltinsFeaturesNV);
+        }
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+        case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT: {
+            return sizeof(VkDrmFormatModifierPropertiesListEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT: {
+            return sizeof(VkPhysicalDeviceImageDrmFormatModifierInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT: {
+            return sizeof(VkImageDrmFormatModifierListCreateInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT: {
+            return sizeof(VkImageDrmFormatModifierExplicitCreateInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT: {
+            return sizeof(VkDrmFormatModifierPropertiesList2EXT);
+        }
+#endif
+#ifdef VK_EXT_validation_cache
+        case VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT: {
+            return sizeof(VkShaderModuleValidationCacheCreateInfoEXT);
+        }
+#endif
+#ifdef VK_NV_shading_rate_image
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV: {
+            return sizeof(VkPipelineViewportShadingRateImageStateCreateInfoNV);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceShadingRateImageFeaturesNV);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV: {
+            return sizeof(VkPhysicalDeviceShadingRateImagePropertiesNV);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV: {
+            return sizeof(VkPipelineViewportCoarseSampleOrderStateCreateInfoNV);
+        }
+#endif
+#ifdef VK_NV_ray_tracing
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV: {
+            return sizeof(VkWriteDescriptorSetAccelerationStructureNV);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV: {
+            return sizeof(VkPhysicalDeviceRayTracingPropertiesNV);
+        }
+#endif
+#ifdef VK_NV_representative_fragment_test
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV: {
+            return sizeof(VkPipelineRepresentativeFragmentTestStateCreateInfoNV);
+        }
+#endif
+#ifdef VK_EXT_filter_cubic
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT: {
+            return sizeof(VkPhysicalDeviceImageViewImageFormatInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT: {
+            return sizeof(VkFilterCubicImageViewImageFormatPropertiesEXT);
+        }
+#endif
+#ifdef VK_EXT_global_priority
+        case VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT: {
+            return sizeof(VkDeviceQueueGlobalPriorityCreateInfoEXT);
+        }
+#endif
+#ifdef VK_EXT_external_memory_host
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT: {
+            return sizeof(VkImportMemoryHostPointerInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceExternalMemoryHostPropertiesEXT);
+        }
+#endif
+#ifdef VK_AMD_pipeline_compiler_control
+        case VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD: {
+            return sizeof(VkPipelineCompilerControlCreateInfoAMD);
+        }
+#endif
+#ifdef VK_AMD_shader_core_properties
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD: {
+            return sizeof(VkPhysicalDeviceShaderCorePropertiesAMD);
+        }
+#endif
+#ifdef VK_EXT_video_decode_h265
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_EXT: {
+            return sizeof(VkVideoDecodeH265ProfileEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_EXT: {
+            return sizeof(VkVideoDecodeH265CapabilitiesEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_CREATE_INFO_EXT: {
+            return sizeof(VkVideoDecodeH265SessionCreateInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            return sizeof(VkVideoDecodeH265SessionParametersAddInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            return sizeof(VkVideoDecodeH265SessionParametersCreateInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PICTURE_INFO_EXT: {
+            return sizeof(VkVideoDecodeH265PictureInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_EXT: {
+            return sizeof(VkVideoDecodeH265DpbSlotInfoEXT);
+        }
+#endif
+#ifdef VK_AMD_memory_overallocation_behavior
+        case VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD: {
+            return sizeof(VkDeviceMemoryOverallocationCreateInfoAMD);
+        }
+#endif
+#ifdef VK_EXT_vertex_attribute_divisor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT: {
+            return sizeof(VkPipelineVertexInputDivisorStateCreateInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT);
+        }
+#endif
+#ifdef VK_GGP_frame_token
+        case VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP: {
+            return sizeof(VkPresentFrameTokenGGP);
+        }
+#endif
+#ifdef VK_EXT_pipeline_creation_feedback
+        case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT: {
+            return sizeof(VkPipelineCreationFeedbackCreateInfoEXT);
+        }
+#endif
+#ifdef VK_NV_compute_shader_derivatives
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceComputeShaderDerivativesFeaturesNV);
+        }
+#endif
+#ifdef VK_NV_mesh_shader
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceMeshShaderFeaturesNV);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV: {
+            return sizeof(VkPhysicalDeviceMeshShaderPropertiesNV);
+        }
+#endif
+#ifdef VK_NV_fragment_shader_barycentric
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV);
+        }
+#endif
+#ifdef VK_NV_shader_image_footprint
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceShaderImageFootprintFeaturesNV);
+        }
+#endif
+#ifdef VK_NV_scissor_exclusive
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV: {
+            return sizeof(VkPipelineViewportExclusiveScissorStateCreateInfoNV);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceExclusiveScissorFeaturesNV);
+        }
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV: {
+            return sizeof(VkQueueFamilyCheckpointPropertiesNV);
+        }
+#endif
+#ifdef VK_INTEL_shader_integer_functions2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL: {
+            return sizeof(VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL);
+        }
+#endif
+#ifdef VK_INTEL_performance_query
+        case VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL: {
+            return sizeof(VkQueryPoolPerformanceQueryCreateInfoINTEL);
+        }
+#endif
+#ifdef VK_EXT_pci_bus_info
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDevicePCIBusInfoPropertiesEXT);
+        }
+#endif
+#ifdef VK_AMD_display_native_hdr
+        case VK_STRUCTURE_TYPE_DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD: {
+            return sizeof(VkDisplayNativeHdrSurfaceCapabilitiesAMD);
+        }
+        case VK_STRUCTURE_TYPE_SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD: {
+            return sizeof(VkSwapchainDisplayNativeHdrCreateInfoAMD);
+        }
+#endif
+#ifdef VK_EXT_fragment_density_map
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT: {
+            switch (rootType) {
+                case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: {
+                    return sizeof(VkPhysicalDeviceFragmentDensityMapFeaturesEXT);
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO: {
+                    return sizeof(VkPhysicalDeviceFragmentDensityMapFeaturesEXT);
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO: {
+                    return sizeof(VkImportColorBufferGOOGLE);
+                    break;
+                }
+                default: {
+                    return sizeof(VkPhysicalDeviceFragmentDensityMapFeaturesEXT);
+                    break;
+                }
+            }
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT: {
+            switch (rootType) {
+                case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2: {
+                    return sizeof(VkPhysicalDeviceFragmentDensityMapPropertiesEXT);
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO: {
+                    return sizeof(VkCreateBlobGOOGLE);
+                    break;
+                }
+                default: {
+                    return sizeof(VkPhysicalDeviceFragmentDensityMapPropertiesEXT);
+                    break;
+                }
+            }
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT: {
+            switch (rootType) {
+                case VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO: {
+                    return sizeof(VkRenderPassFragmentDensityMapCreateInfoEXT);
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2: {
+                    return sizeof(VkRenderPassFragmentDensityMapCreateInfoEXT);
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO: {
+                    return sizeof(VkImportBufferGOOGLE);
+                    break;
+                }
+                default: {
+                    return sizeof(VkRenderPassFragmentDensityMapCreateInfoEXT);
+                    break;
+                }
+            }
+        }
+#endif
+#ifdef VK_EXT_subgroup_size_control
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceSubgroupSizeControlFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceSubgroupSizeControlPropertiesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT: {
+            return sizeof(VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT);
+        }
+#endif
+#ifdef VK_AMD_shader_core_properties2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD: {
+            return sizeof(VkPhysicalDeviceShaderCoreProperties2AMD);
+        }
+#endif
+#ifdef VK_AMD_device_coherent_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD: {
+            return sizeof(VkPhysicalDeviceCoherentMemoryFeaturesAMD);
+        }
+#endif
+#ifdef VK_EXT_shader_image_atomic_int64
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_memory_budget
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceMemoryBudgetPropertiesEXT);
+        }
+#endif
+#ifdef VK_EXT_memory_priority
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceMemoryPriorityFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT: {
+            return sizeof(VkMemoryPriorityAllocateInfoEXT);
+        }
+#endif
+#ifdef VK_NV_dedicated_allocation_image_aliasing
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV);
+        }
+#endif
+#ifdef VK_EXT_buffer_device_address
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceBufferDeviceAddressFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT: {
+            return sizeof(VkBufferDeviceAddressCreateInfoEXT);
+        }
+#endif
+#ifdef VK_EXT_validation_features
+        case VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT: {
+            return sizeof(VkValidationFeaturesEXT);
+        }
+#endif
+#ifdef VK_NV_cooperative_matrix
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceCooperativeMatrixFeaturesNV);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV: {
+            return sizeof(VkPhysicalDeviceCooperativeMatrixPropertiesNV);
+        }
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceCoverageReductionModeFeaturesNV);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV: {
+            return sizeof(VkPipelineCoverageReductionStateCreateInfoNV);
+        }
+#endif
+#ifdef VK_EXT_fragment_shader_interlock
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_ycbcr_image_arrays
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceYcbcrImageArraysFeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_provoking_vertex
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceProvokingVertexFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceProvokingVertexPropertiesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT: {
+            return sizeof(VkPipelineRasterizationProvokingVertexStateCreateInfoEXT);
+        }
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+        case VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT: {
+            return sizeof(VkSurfaceFullScreenExclusiveInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT: {
+            return sizeof(VkSurfaceCapabilitiesFullScreenExclusiveEXT);
+        }
+        case VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT: {
+            return sizeof(VkSurfaceFullScreenExclusiveWin32InfoEXT);
+        }
+#endif
+#ifdef VK_EXT_line_rasterization
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceLineRasterizationFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceLineRasterizationPropertiesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT: {
+            return sizeof(VkPipelineRasterizationLineStateCreateInfoEXT);
+        }
+#endif
+#ifdef VK_EXT_shader_atomic_float
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceShaderAtomicFloatFeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_index_type_uint8
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceIndexTypeUint8FeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceExtendedDynamicStateFeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_shader_atomic_float2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_shader_demote_to_helper_invocation
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT);
+        }
+#endif
+#ifdef VK_NV_device_generated_commands
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV: {
+            return sizeof(VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV);
+        }
+        case VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV: {
+            return sizeof(VkGraphicsPipelineShaderGroupsCreateInfoNV);
+        }
+#endif
+#ifdef VK_NV_inherited_viewport_scissor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceInheritedViewportScissorFeaturesNV);
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV: {
+            return sizeof(VkCommandBufferInheritanceViewportScissorInfoNV);
+        }
+#endif
+#ifdef VK_EXT_texel_buffer_alignment
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT);
+        }
+#endif
+#ifdef VK_QCOM_render_pass_transform
+        case VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM: {
+            return sizeof(VkRenderPassTransformBeginInfoQCOM);
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM: {
+            return sizeof(VkCommandBufferInheritanceRenderPassTransformInfoQCOM);
+        }
+#endif
+#ifdef VK_EXT_device_memory_report
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceDeviceMemoryReportFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT: {
+            return sizeof(VkDeviceDeviceMemoryReportCreateInfoEXT);
+        }
+#endif
+#ifdef VK_EXT_robustness2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceRobustness2FeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceRobustness2PropertiesEXT);
+        }
+#endif
+#ifdef VK_EXT_custom_border_color
+        case VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT: {
+            return sizeof(VkSamplerCustomBorderColorCreateInfoEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceCustomBorderColorPropertiesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceCustomBorderColorFeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_private_data
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT: {
+            return sizeof(VkPhysicalDevicePrivateDataFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO_EXT: {
+            return sizeof(VkDevicePrivateDataCreateInfoEXT);
+        }
+#endif
+#ifdef VK_EXT_pipeline_creation_cache_control
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES_EXT: {
+            return sizeof(VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT);
+        }
+#endif
+#ifdef VK_NV_device_diagnostics_config
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceDiagnosticsConfigFeaturesNV);
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV: {
+            return sizeof(VkDeviceDiagnosticsConfigCreateInfoNV);
+        }
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV: {
+            return sizeof(VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV: {
+            return sizeof(VkPipelineFragmentShadingRateEnumStateCreateInfoNV);
+        }
+#endif
+#ifdef VK_NV_ray_tracing_motion_blur
+        case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV: {
+            return sizeof(VkAccelerationStructureGeometryMotionTrianglesDataNV);
+        }
+        case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV: {
+            return sizeof(VkAccelerationStructureMotionInfoNV);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceRayTracingMotionBlurFeaturesNV);
+        }
+#endif
+#ifdef VK_EXT_ycbcr_2plane_444_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_fragment_density_map2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceFragmentDensityMap2FeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceFragmentDensityMap2PropertiesEXT);
+        }
+#endif
+#ifdef VK_QCOM_rotated_copy_commands
+        case VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM: {
+            return sizeof(VkCopyCommandTransformInfoQCOM);
+        }
+#endif
+#ifdef VK_EXT_image_robustness
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceImageRobustnessFeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_4444_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT: {
+            return sizeof(VkPhysicalDevice4444FormatsFeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_rgba10x6_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT);
+        }
+#endif
+#ifdef VK_VALVE_mutable_descriptor_type
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE: {
+            return sizeof(VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE);
+        }
+        case VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE: {
+            return sizeof(VkMutableDescriptorTypeCreateInfoVALVE);
+        }
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_physical_device_drm
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceDrmPropertiesEXT);
+        }
+#endif
+#ifdef VK_EXT_primitive_topology_list_restart
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT: {
+            return sizeof(VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT);
+        }
+#endif
+#ifdef VK_FUCHSIA_external_memory
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA: {
+            return sizeof(VkImportMemoryZirconHandleInfoFUCHSIA);
+        }
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA: {
+            return sizeof(VkImportMemoryBufferCollectionFUCHSIA);
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA: {
+            return sizeof(VkBufferCollectionImageCreateInfoFUCHSIA);
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA: {
+            return sizeof(VkBufferCollectionBufferCreateInfoFUCHSIA);
+        }
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+        case VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI: {
+            return sizeof(VkSubpassShadingPipelineCreateInfoHUAWEI);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI: {
+            return sizeof(VkPhysicalDeviceSubpassShadingFeaturesHUAWEI);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI: {
+            return sizeof(VkPhysicalDeviceSubpassShadingPropertiesHUAWEI);
+        }
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI: {
+            return sizeof(VkPhysicalDeviceInvocationMaskFeaturesHUAWEI);
+        }
+#endif
+#ifdef VK_NV_external_memory_rdma
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_RDMA_FEATURES_NV: {
+            return sizeof(VkPhysicalDeviceExternalMemoryRDMAFeaturesNV);
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceExtendedDynamicState2FeaturesEXT);
+        }
+#endif
+#ifdef VK_EXT_color_write_enable
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceColorWriteEnableFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT: {
+            return sizeof(VkPipelineColorWriteCreateInfoEXT);
+        }
+#endif
+#ifdef VK_GOOGLE_gfxstream
+        case VK_STRUCTURE_TYPE_IMPORT_COLOR_BUFFER_GOOGLE: {
+            return sizeof(VkImportColorBufferGOOGLE);
+        }
+        case VK_STRUCTURE_TYPE_IMPORT_BUFFER_GOOGLE: {
+            return sizeof(VkImportBufferGOOGLE);
+        }
+        case VK_STRUCTURE_TYPE_CREATE_BLOB_GOOGLE: {
+            return sizeof(VkCreateBlobGOOGLE);
+        }
+#endif
+#ifdef VK_EXT_global_priority_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_EXT: {
+            return sizeof(VkQueueFamilyGlobalPriorityPropertiesEXT);
+        }
+#endif
+#ifdef VK_EXT_multi_draw
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceMultiDrawFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT: {
+            return sizeof(VkPhysicalDeviceMultiDrawPropertiesEXT);
+        }
+#endif
+#ifdef VK_EXT_border_color_swizzle
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT: {
+            return sizeof(VkPhysicalDeviceBorderColorSwizzleFeaturesEXT);
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT: {
+            return sizeof(VkSamplerBorderColorComponentMappingCreateInfoEXT);
+        }
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT: {
+            return sizeof(VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT);
+        }
+#endif
+#ifdef VK_KHR_acceleration_structure
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR: {
+            return sizeof(VkWriteDescriptorSetAccelerationStructureKHR);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR: {
+            return sizeof(VkPhysicalDeviceAccelerationStructureFeaturesKHR);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR: {
+            return sizeof(VkPhysicalDeviceAccelerationStructurePropertiesKHR);
+        }
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR: {
+            return sizeof(VkPhysicalDeviceRayTracingPipelineFeaturesKHR);
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR: {
+            return sizeof(VkPhysicalDeviceRayTracingPipelinePropertiesKHR);
+        }
+#endif
+#ifdef VK_KHR_ray_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR: {
+            return sizeof(VkPhysicalDeviceRayQueryFeaturesKHR);
+        }
+#endif
+        default: {
+            return (size_t)0;
+        }
+    }
+}
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/goldfish_vk_extension_structs_guest.h b/system/vulkan_enc/goldfish_vk_extension_structs_guest.h
new file mode 100644
index 0000000..ac5ab79
--- /dev/null
+++ b/system/vulkan_enc/goldfish_vk_extension_structs_guest.h
@@ -0,0 +1,599 @@
+// Copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2018 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Autogenerated module goldfish_vk_extension_structs_guest
+//
+// (header) generated by codegen/vulkan/scripts/genvk.py -registry codegen/vulkan/xml/vk.xml cereal
+// -o host/vulkan/cereal
+//
+// Please do not modify directly;
+// re-run gfxstream-protocols/scripts/generate-vulkan-sources.sh,
+// or directly from Python by defining:
+// VULKAN_REGISTRY_XML_DIR : Directory containing vk.xml
+// VULKAN_REGISTRY_SCRIPTS_DIR : Directory containing genvk.py
+// CEREAL_OUTPUT_DIR: Where to put the generated sources.
+//
+// python3 $VULKAN_REGISTRY_SCRIPTS_DIR/genvk.py -registry $VULKAN_REGISTRY_XML_DIR/vk.xml cereal -o
+// $CEREAL_OUTPUT_DIR
+//
+#pragma once
+#include <vulkan/vulkan.h>
+
+#include "goldfish_vk_private_defs.h"
+#include "vk_platform_compat.h"
+#include "vulkan_gfxstream.h"
+// Stuff we are not going to use but if included,
+// will cause compile errors. These are Android Vulkan
+// required extensions, but the approach will be to
+// implement them completely on the guest side.
+#undef VK_KHR_android_surface
+#undef VK_ANDROID_external_memory_android_hardware_buffer
+
+namespace gfxstream {
+namespace vk {
+
+uint32_t goldfish_vk_struct_type(const void* structExtension);
+
+size_t goldfish_vk_extension_struct_size(VkStructureType rootType, const void* structExtension);
+
+size_t goldfish_vk_extension_struct_size_with_stream_features(uint32_t streamFeatures,
+                                                              VkStructureType rootType,
+                                                              const void* structExtension);
+
+#ifdef VK_VERSION_1_0
+#endif
+#ifdef VK_VERSION_1_1
+#endif
+#ifdef VK_VERSION_1_2
+#endif
+#ifdef VK_KHR_surface
+#endif
+#ifdef VK_KHR_swapchain
+#endif
+#ifdef VK_KHR_display
+#endif
+#ifdef VK_KHR_display_swapchain
+#endif
+#ifdef VK_KHR_xlib_surface
+#endif
+#ifdef VK_KHR_xcb_surface
+#endif
+#ifdef VK_KHR_wayland_surface
+#endif
+#ifdef VK_KHR_android_surface
+#endif
+#ifdef VK_KHR_win32_surface
+#endif
+#ifdef VK_KHR_sampler_mirror_clamp_to_edge
+#endif
+#ifdef VK_KHR_video_queue
+#endif
+#ifdef VK_KHR_video_decode_queue
+#endif
+#ifdef VK_KHR_dynamic_rendering
+#endif
+#ifdef VK_KHR_multiview
+#endif
+#ifdef VK_KHR_get_physical_device_properties2
+#endif
+#ifdef VK_KHR_device_group
+#endif
+#ifdef VK_KHR_shader_draw_parameters
+#endif
+#ifdef VK_KHR_maintenance1
+#endif
+#ifdef VK_KHR_device_group_creation
+#endif
+#ifdef VK_KHR_external_memory_capabilities
+#endif
+#ifdef VK_KHR_external_memory
+#endif
+#ifdef VK_KHR_external_memory_win32
+#endif
+#ifdef VK_KHR_external_memory_fd
+#endif
+#ifdef VK_KHR_win32_keyed_mutex
+#endif
+#ifdef VK_KHR_external_semaphore_capabilities
+#endif
+#ifdef VK_KHR_external_semaphore
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+#endif
+#ifdef VK_KHR_external_semaphore_fd
+#endif
+#ifdef VK_KHR_push_descriptor
+#endif
+#ifdef VK_KHR_shader_float16_int8
+#endif
+#ifdef VK_KHR_16bit_storage
+#endif
+#ifdef VK_KHR_incremental_present
+#endif
+#ifdef VK_KHR_descriptor_update_template
+#endif
+#ifdef VK_KHR_imageless_framebuffer
+#endif
+#ifdef VK_KHR_create_renderpass2
+#endif
+#ifdef VK_KHR_shared_presentable_image
+#endif
+#ifdef VK_KHR_external_fence_capabilities
+#endif
+#ifdef VK_KHR_external_fence
+#endif
+#ifdef VK_KHR_external_fence_win32
+#endif
+#ifdef VK_KHR_external_fence_fd
+#endif
+#ifdef VK_KHR_performance_query
+#endif
+#ifdef VK_KHR_maintenance2
+#endif
+#ifdef VK_KHR_get_surface_capabilities2
+#endif
+#ifdef VK_KHR_variable_pointers
+#endif
+#ifdef VK_KHR_get_display_properties2
+#endif
+#ifdef VK_KHR_dedicated_allocation
+#endif
+#ifdef VK_KHR_storage_buffer_storage_class
+#endif
+#ifdef VK_KHR_relaxed_block_layout
+#endif
+#ifdef VK_KHR_get_memory_requirements2
+#endif
+#ifdef VK_KHR_image_format_list
+#endif
+#ifdef VK_KHR_sampler_ycbcr_conversion
+#endif
+#ifdef VK_KHR_bind_memory2
+#endif
+#ifdef VK_KHR_portability_subset
+#endif
+#ifdef VK_KHR_maintenance3
+#endif
+#ifdef VK_KHR_draw_indirect_count
+#endif
+#ifdef VK_KHR_shader_subgroup_extended_types
+#endif
+#ifdef VK_KHR_8bit_storage
+#endif
+#ifdef VK_KHR_shader_atomic_int64
+#endif
+#ifdef VK_KHR_shader_clock
+#endif
+#ifdef VK_KHR_driver_properties
+#endif
+#ifdef VK_KHR_shader_float_controls
+#endif
+#ifdef VK_KHR_depth_stencil_resolve
+#endif
+#ifdef VK_KHR_swapchain_mutable_format
+#endif
+#ifdef VK_KHR_timeline_semaphore
+#endif
+#ifdef VK_KHR_vulkan_memory_model
+#endif
+#ifdef VK_KHR_shader_terminate_invocation
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+#endif
+#ifdef VK_KHR_spirv_1_4
+#endif
+#ifdef VK_KHR_surface_protected_capabilities
+#endif
+#ifdef VK_KHR_separate_depth_stencil_layouts
+#endif
+#ifdef VK_KHR_present_wait
+#endif
+#ifdef VK_KHR_uniform_buffer_standard_layout
+#endif
+#ifdef VK_KHR_buffer_device_address
+#endif
+#ifdef VK_KHR_deferred_host_operations
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+#endif
+#ifdef VK_KHR_shader_integer_dot_product
+#endif
+#ifdef VK_KHR_pipeline_library
+#endif
+#ifdef VK_KHR_shader_non_semantic_info
+#endif
+#ifdef VK_KHR_present_id
+#endif
+#ifdef VK_KHR_video_encode_queue
+#endif
+#ifdef VK_KHR_synchronization2
+#endif
+#ifdef VK_KHR_shader_subgroup_uniform_control_flow
+#endif
+#ifdef VK_KHR_zero_initialize_workgroup_memory
+#endif
+#ifdef VK_KHR_workgroup_memory_explicit_layout
+#endif
+#ifdef VK_KHR_copy_commands2
+#endif
+#ifdef VK_KHR_format_feature_flags2
+#endif
+#ifdef VK_KHR_maintenance4
+#endif
+#ifdef VK_ANDROID_native_buffer
+#endif
+#ifdef VK_EXT_debug_report
+#endif
+#ifdef VK_NV_glsl_shader
+#endif
+#ifdef VK_EXT_depth_range_unrestricted
+#endif
+#ifdef VK_IMG_filter_cubic
+#endif
+#ifdef VK_AMD_rasterization_order
+#endif
+#ifdef VK_AMD_shader_trinary_minmax
+#endif
+#ifdef VK_AMD_shader_explicit_vertex_parameter
+#endif
+#ifdef VK_EXT_debug_marker
+#endif
+#ifdef VK_AMD_gcn_shader
+#endif
+#ifdef VK_NV_dedicated_allocation
+#endif
+#ifdef VK_EXT_transform_feedback
+#endif
+#ifdef VK_NVX_binary_import
+#endif
+#ifdef VK_NVX_image_view_handle
+#endif
+#ifdef VK_AMD_draw_indirect_count
+#endif
+#ifdef VK_AMD_negative_viewport_height
+#endif
+#ifdef VK_AMD_gpu_shader_half_float
+#endif
+#ifdef VK_AMD_shader_ballot
+#endif
+#ifdef VK_EXT_video_encode_h264
+#endif
+#ifdef VK_EXT_video_encode_h265
+#endif
+#ifdef VK_EXT_video_decode_h264
+#endif
+#ifdef VK_AMD_texture_gather_bias_lod
+#endif
+#ifdef VK_AMD_shader_info
+#endif
+#ifdef VK_AMD_shader_image_load_store_lod
+#endif
+#ifdef VK_GGP_stream_descriptor_surface
+#endif
+#ifdef VK_NV_corner_sampled_image
+#endif
+#ifdef VK_IMG_format_pvrtc
+#endif
+#ifdef VK_NV_external_memory_capabilities
+#endif
+#ifdef VK_NV_external_memory
+#endif
+#ifdef VK_NV_external_memory_win32
+#endif
+#ifdef VK_NV_win32_keyed_mutex
+#endif
+#ifdef VK_EXT_validation_flags
+#endif
+#ifdef VK_NN_vi_surface
+#endif
+#ifdef VK_EXT_shader_subgroup_ballot
+#endif
+#ifdef VK_EXT_shader_subgroup_vote
+#endif
+#ifdef VK_EXT_texture_compression_astc_hdr
+#endif
+#ifdef VK_EXT_astc_decode_mode
+#endif
+#ifdef VK_EXT_conditional_rendering
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+#endif
+#ifdef VK_EXT_direct_mode_display
+#endif
+#ifdef VK_EXT_acquire_xlib_display
+#endif
+#ifdef VK_EXT_display_surface_counter
+#endif
+#ifdef VK_EXT_display_control
+#endif
+#ifdef VK_GOOGLE_display_timing
+#endif
+#ifdef VK_NV_sample_mask_override_coverage
+#endif
+#ifdef VK_NV_geometry_shader_passthrough
+#endif
+#ifdef VK_NV_viewport_array2
+#endif
+#ifdef VK_NVX_multiview_per_view_attributes
+#endif
+#ifdef VK_NV_viewport_swizzle
+#endif
+#ifdef VK_EXT_discard_rectangles
+#endif
+#ifdef VK_EXT_conservative_rasterization
+#endif
+#ifdef VK_EXT_depth_clip_enable
+#endif
+#ifdef VK_EXT_swapchain_colorspace
+#endif
+#ifdef VK_EXT_hdr_metadata
+#endif
+#ifdef VK_MVK_ios_surface
+#endif
+#ifdef VK_MVK_macos_surface
+#endif
+#ifdef VK_MVK_moltenvk
+#endif
+#ifdef VK_EXT_external_memory_dma_buf
+#endif
+#ifdef VK_EXT_queue_family_foreign
+#endif
+#ifdef VK_EXT_debug_utils
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+#endif
+#ifdef VK_EXT_sampler_filter_minmax
+#endif
+#ifdef VK_AMD_gpu_shader_int16
+#endif
+#ifdef VK_AMD_mixed_attachment_samples
+#endif
+#ifdef VK_AMD_shader_fragment_mask
+#endif
+#ifdef VK_EXT_inline_uniform_block
+#endif
+#ifdef VK_EXT_shader_stencil_export
+#endif
+#ifdef VK_EXT_sample_locations
+#endif
+#ifdef VK_EXT_blend_operation_advanced
+#endif
+#ifdef VK_NV_fragment_coverage_to_color
+#endif
+#ifdef VK_NV_framebuffer_mixed_samples
+#endif
+#ifdef VK_NV_fill_rectangle
+#endif
+#ifdef VK_NV_shader_sm_builtins
+#endif
+#ifdef VK_EXT_post_depth_coverage
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+#endif
+#ifdef VK_EXT_validation_cache
+#endif
+#ifdef VK_EXT_descriptor_indexing
+#endif
+#ifdef VK_EXT_shader_viewport_index_layer
+#endif
+#ifdef VK_NV_shading_rate_image
+#endif
+#ifdef VK_NV_ray_tracing
+#endif
+#ifdef VK_NV_representative_fragment_test
+#endif
+#ifdef VK_EXT_filter_cubic
+#endif
+#ifdef VK_QCOM_render_pass_shader_resolve
+#endif
+#ifdef VK_EXT_global_priority
+#endif
+#ifdef VK_EXT_external_memory_host
+#endif
+#ifdef VK_AMD_buffer_marker
+#endif
+#ifdef VK_AMD_pipeline_compiler_control
+#endif
+#ifdef VK_EXT_calibrated_timestamps
+#endif
+#ifdef VK_AMD_shader_core_properties
+#endif
+#ifdef VK_EXT_video_decode_h265
+#endif
+#ifdef VK_AMD_memory_overallocation_behavior
+#endif
+#ifdef VK_EXT_vertex_attribute_divisor
+#endif
+#ifdef VK_GGP_frame_token
+#endif
+#ifdef VK_EXT_pipeline_creation_feedback
+#endif
+#ifdef VK_NV_shader_subgroup_partitioned
+#endif
+#ifdef VK_NV_compute_shader_derivatives
+#endif
+#ifdef VK_NV_mesh_shader
+#endif
+#ifdef VK_NV_fragment_shader_barycentric
+#endif
+#ifdef VK_NV_shader_image_footprint
+#endif
+#ifdef VK_NV_scissor_exclusive
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+#endif
+#ifdef VK_INTEL_shader_integer_functions2
+#endif
+#ifdef VK_INTEL_performance_query
+#endif
+#ifdef VK_EXT_pci_bus_info
+#endif
+#ifdef VK_AMD_display_native_hdr
+#endif
+#ifdef VK_FUCHSIA_imagepipe_surface
+#endif
+#ifdef VK_EXT_metal_surface
+#endif
+#ifdef VK_EXT_fragment_density_map
+#endif
+#ifdef VK_EXT_scalar_block_layout
+#endif
+#ifdef VK_GOOGLE_hlsl_functionality1
+#endif
+#ifdef VK_GOOGLE_decorate_string
+#endif
+#ifdef VK_EXT_subgroup_size_control
+#endif
+#ifdef VK_AMD_shader_core_properties2
+#endif
+#ifdef VK_AMD_device_coherent_memory
+#endif
+#ifdef VK_EXT_shader_image_atomic_int64
+#endif
+#ifdef VK_EXT_memory_budget
+#endif
+#ifdef VK_EXT_memory_priority
+#endif
+#ifdef VK_NV_dedicated_allocation_image_aliasing
+#endif
+#ifdef VK_EXT_buffer_device_address
+#endif
+#ifdef VK_EXT_tooling_info
+#endif
+#ifdef VK_EXT_separate_stencil_usage
+#endif
+#ifdef VK_EXT_validation_features
+#endif
+#ifdef VK_NV_cooperative_matrix
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+#endif
+#ifdef VK_EXT_fragment_shader_interlock
+#endif
+#ifdef VK_EXT_ycbcr_image_arrays
+#endif
+#ifdef VK_EXT_provoking_vertex
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+#endif
+#ifdef VK_EXT_headless_surface
+#endif
+#ifdef VK_EXT_line_rasterization
+#endif
+#ifdef VK_EXT_shader_atomic_float
+#endif
+#ifdef VK_EXT_host_query_reset
+#endif
+#ifdef VK_EXT_index_type_uint8
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+#endif
+#ifdef VK_EXT_shader_atomic_float2
+#endif
+#ifdef VK_EXT_shader_demote_to_helper_invocation
+#endif
+#ifdef VK_NV_device_generated_commands
+#endif
+#ifdef VK_NV_inherited_viewport_scissor
+#endif
+#ifdef VK_EXT_texel_buffer_alignment
+#endif
+#ifdef VK_QCOM_render_pass_transform
+#endif
+#ifdef VK_EXT_device_memory_report
+#endif
+#ifdef VK_EXT_acquire_drm_display
+#endif
+#ifdef VK_EXT_robustness2
+#endif
+#ifdef VK_EXT_custom_border_color
+#endif
+#ifdef VK_GOOGLE_user_type
+#endif
+#ifdef VK_EXT_private_data
+#endif
+#ifdef VK_EXT_pipeline_creation_cache_control
+#endif
+#ifdef VK_NV_device_diagnostics_config
+#endif
+#ifdef VK_QCOM_render_pass_store_ops
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+#endif
+#ifdef VK_NV_ray_tracing_motion_blur
+#endif
+#ifdef VK_EXT_ycbcr_2plane_444_formats
+#endif
+#ifdef VK_EXT_fragment_density_map2
+#endif
+#ifdef VK_QCOM_rotated_copy_commands
+#endif
+#ifdef VK_EXT_image_robustness
+#endif
+#ifdef VK_EXT_4444_formats
+#endif
+#ifdef VK_EXT_rgba10x6_formats
+#endif
+#ifdef VK_NV_acquire_winrt_display
+#endif
+#ifdef VK_EXT_directfb_surface
+#endif
+#ifdef VK_VALVE_mutable_descriptor_type
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+#endif
+#ifdef VK_EXT_physical_device_drm
+#endif
+#ifdef VK_EXT_primitive_topology_list_restart
+#endif
+#ifdef VK_FUCHSIA_external_memory
+#endif
+#ifdef VK_FUCHSIA_external_semaphore
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+#endif
+#ifdef VK_NV_external_memory_rdma
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+#endif
+#ifdef VK_QNX_screen_surface
+#endif
+#ifdef VK_EXT_color_write_enable
+#endif
+#ifdef VK_GOOGLE_gfxstream
+#endif
+#ifdef VK_EXT_global_priority_query
+#endif
+#ifdef VK_EXT_multi_draw
+#endif
+#ifdef VK_EXT_load_store_op_none
+#endif
+#ifdef VK_EXT_border_color_swizzle
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+#endif
+#ifdef VK_KHR_acceleration_structure
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+#endif
+#ifdef VK_KHR_ray_query
+#endif
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/goldfish_vk_handlemap_guest.cpp b/system/vulkan_enc/goldfish_vk_handlemap_guest.cpp
new file mode 100644
index 0000000..16e5019
--- /dev/null
+++ b/system/vulkan_enc/goldfish_vk_handlemap_guest.cpp
@@ -0,0 +1,10592 @@
+// Copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2018 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Autogenerated module goldfish_vk_handlemap_guest
+//
+// (impl) generated by codegen/vulkan/scripts/genvk.py -registry codegen/vulkan/xml/vk.xml cereal -o
+// host/vulkan/cereal
+//
+// Please do not modify directly;
+// re-run gfxstream-protocols/scripts/generate-vulkan-sources.sh,
+// or directly from Python by defining:
+// VULKAN_REGISTRY_XML_DIR : Directory containing vk.xml
+// VULKAN_REGISTRY_SCRIPTS_DIR : Directory containing genvk.py
+// CEREAL_OUTPUT_DIR: Where to put the generated sources.
+//
+// python3 $VULKAN_REGISTRY_SCRIPTS_DIR/genvk.py -registry $VULKAN_REGISTRY_XML_DIR/vk.xml cereal -o
+// $CEREAL_OUTPUT_DIR
+//
+
+#include "goldfish_vk_handlemap_guest.h"
+
+#include <cstring>
+
+#include "goldfish_vk_extension_structs_guest.h"
+#include "goldfish_vk_private_defs.h"
+
+namespace gfxstream {
+namespace vk {
+
+void handlemap_extension_struct(VulkanHandleMapping* handlemap, void* structExtension_out);
+
+#ifdef VK_VERSION_1_0
+void handlemap_VkExtent2D(VulkanHandleMapping* handlemap, VkExtent2D* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkExtent3D(VulkanHandleMapping* handlemap, VkExtent3D* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkOffset2D(VulkanHandleMapping* handlemap, VkOffset2D* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkOffset3D(VulkanHandleMapping* handlemap, VkOffset3D* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkRect2D(VulkanHandleMapping* handlemap, VkRect2D* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkOffset2D(handlemap, (VkOffset2D*)(&toMap->offset));
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->extent));
+}
+
+void handlemap_VkBaseInStructure(VulkanHandleMapping* handlemap, VkBaseInStructure* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkBaseOutStructure(VulkanHandleMapping* handlemap, VkBaseOutStructure* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkBufferMemoryBarrier(VulkanHandleMapping* handlemap, VkBufferMemoryBarrier* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkBuffer((VkBuffer*)&toMap->buffer);
+}
+
+void handlemap_VkDispatchIndirectCommand(VulkanHandleMapping* handlemap,
+                                         VkDispatchIndirectCommand* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkDrawIndexedIndirectCommand(VulkanHandleMapping* handlemap,
+                                            VkDrawIndexedIndirectCommand* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkDrawIndirectCommand(VulkanHandleMapping* handlemap, VkDrawIndirectCommand* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkImageSubresourceRange(VulkanHandleMapping* handlemap,
+                                       VkImageSubresourceRange* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkImageMemoryBarrier(VulkanHandleMapping* handlemap, VkImageMemoryBarrier* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkImage((VkImage*)&toMap->image);
+    handlemap_VkImageSubresourceRange(handlemap,
+                                      (VkImageSubresourceRange*)(&toMap->subresourceRange));
+}
+
+void handlemap_VkMemoryBarrier(VulkanHandleMapping* handlemap, VkMemoryBarrier* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPipelineCacheHeaderVersionOne(VulkanHandleMapping* handlemap,
+                                               VkPipelineCacheHeaderVersionOne* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkAllocationCallbacks(VulkanHandleMapping* handlemap, VkAllocationCallbacks* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkApplicationInfo(VulkanHandleMapping* handlemap, VkApplicationInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkFormatProperties(VulkanHandleMapping* handlemap, VkFormatProperties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkImageFormatProperties(VulkanHandleMapping* handlemap,
+                                       VkImageFormatProperties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkExtent3D(handlemap, (VkExtent3D*)(&toMap->maxExtent));
+}
+
+void handlemap_VkInstanceCreateInfo(VulkanHandleMapping* handlemap, VkInstanceCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pApplicationInfo) {
+        handlemap_VkApplicationInfo(handlemap, (VkApplicationInfo*)(toMap->pApplicationInfo));
+    }
+}
+
+void handlemap_VkMemoryHeap(VulkanHandleMapping* handlemap, VkMemoryHeap* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkMemoryType(VulkanHandleMapping* handlemap, VkMemoryType* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkPhysicalDeviceFeatures(VulkanHandleMapping* handlemap,
+                                        VkPhysicalDeviceFeatures* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkPhysicalDeviceLimits(VulkanHandleMapping* handlemap,
+                                      VkPhysicalDeviceLimits* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkPhysicalDeviceMemoryProperties(VulkanHandleMapping* handlemap,
+                                                VkPhysicalDeviceMemoryProperties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    for (uint32_t i = 0; i < (uint32_t)VK_MAX_MEMORY_TYPES; ++i) {
+        handlemap_VkMemoryType(handlemap, (VkMemoryType*)(toMap->memoryTypes + i));
+    }
+    for (uint32_t i = 0; i < (uint32_t)VK_MAX_MEMORY_HEAPS; ++i) {
+        handlemap_VkMemoryHeap(handlemap, (VkMemoryHeap*)(toMap->memoryHeaps + i));
+    }
+}
+
+void handlemap_VkPhysicalDeviceSparseProperties(VulkanHandleMapping* handlemap,
+                                                VkPhysicalDeviceSparseProperties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkPhysicalDeviceProperties(VulkanHandleMapping* handlemap,
+                                          VkPhysicalDeviceProperties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkPhysicalDeviceLimits(handlemap, (VkPhysicalDeviceLimits*)(&toMap->limits));
+    handlemap_VkPhysicalDeviceSparseProperties(
+        handlemap, (VkPhysicalDeviceSparseProperties*)(&toMap->sparseProperties));
+}
+
+void handlemap_VkQueueFamilyProperties(VulkanHandleMapping* handlemap,
+                                       VkQueueFamilyProperties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkExtent3D(handlemap, (VkExtent3D*)(&toMap->minImageTransferGranularity));
+}
+
+void handlemap_VkDeviceQueueCreateInfo(VulkanHandleMapping* handlemap,
+                                       VkDeviceQueueCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDeviceCreateInfo(VulkanHandleMapping* handlemap, VkDeviceCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pQueueCreateInfos) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->queueCreateInfoCount; ++i) {
+                handlemap_VkDeviceQueueCreateInfo(
+                    handlemap, (VkDeviceQueueCreateInfo*)(toMap->pQueueCreateInfos + i));
+            }
+        }
+    }
+    if (toMap->pEnabledFeatures) {
+        handlemap_VkPhysicalDeviceFeatures(handlemap,
+                                           (VkPhysicalDeviceFeatures*)(toMap->pEnabledFeatures));
+    }
+}
+
+void handlemap_VkExtensionProperties(VulkanHandleMapping* handlemap, VkExtensionProperties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkLayerProperties(VulkanHandleMapping* handlemap, VkLayerProperties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkSubmitInfo(VulkanHandleMapping* handlemap, VkSubmitInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pWaitSemaphores) {
+        handlemap->mapHandles_VkSemaphore((VkSemaphore*)toMap->pWaitSemaphores,
+                                          toMap->waitSemaphoreCount);
+    }
+    if (toMap->pCommandBuffers) {
+        handlemap->mapHandles_VkCommandBuffer((VkCommandBuffer*)toMap->pCommandBuffers,
+                                              toMap->commandBufferCount);
+    }
+    if (toMap->pSignalSemaphores) {
+        handlemap->mapHandles_VkSemaphore((VkSemaphore*)toMap->pSignalSemaphores,
+                                          toMap->signalSemaphoreCount);
+    }
+}
+
+void handlemap_VkMappedMemoryRange(VulkanHandleMapping* handlemap, VkMappedMemoryRange* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkDeviceMemory((VkDeviceMemory*)&toMap->memory);
+}
+
+void handlemap_VkMemoryAllocateInfo(VulkanHandleMapping* handlemap, VkMemoryAllocateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkMemoryRequirements(VulkanHandleMapping* handlemap, VkMemoryRequirements* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkSparseMemoryBind(VulkanHandleMapping* handlemap, VkSparseMemoryBind* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap->mapHandles_VkDeviceMemory((VkDeviceMemory*)&toMap->memory);
+}
+
+void handlemap_VkSparseBufferMemoryBindInfo(VulkanHandleMapping* handlemap,
+                                            VkSparseBufferMemoryBindInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap->mapHandles_VkBuffer((VkBuffer*)&toMap->buffer);
+    if (toMap) {
+        if (toMap->pBinds) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->bindCount; ++i) {
+                handlemap_VkSparseMemoryBind(handlemap, (VkSparseMemoryBind*)(toMap->pBinds + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkSparseImageOpaqueMemoryBindInfo(VulkanHandleMapping* handlemap,
+                                                 VkSparseImageOpaqueMemoryBindInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap->mapHandles_VkImage((VkImage*)&toMap->image);
+    if (toMap) {
+        if (toMap->pBinds) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->bindCount; ++i) {
+                handlemap_VkSparseMemoryBind(handlemap, (VkSparseMemoryBind*)(toMap->pBinds + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkImageSubresource(VulkanHandleMapping* handlemap, VkImageSubresource* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkSparseImageMemoryBind(VulkanHandleMapping* handlemap,
+                                       VkSparseImageMemoryBind* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkImageSubresource(handlemap, (VkImageSubresource*)(&toMap->subresource));
+    handlemap_VkOffset3D(handlemap, (VkOffset3D*)(&toMap->offset));
+    handlemap_VkExtent3D(handlemap, (VkExtent3D*)(&toMap->extent));
+    handlemap->mapHandles_VkDeviceMemory((VkDeviceMemory*)&toMap->memory);
+}
+
+void handlemap_VkSparseImageMemoryBindInfo(VulkanHandleMapping* handlemap,
+                                           VkSparseImageMemoryBindInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap->mapHandles_VkImage((VkImage*)&toMap->image);
+    if (toMap) {
+        if (toMap->pBinds) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->bindCount; ++i) {
+                handlemap_VkSparseImageMemoryBind(handlemap,
+                                                  (VkSparseImageMemoryBind*)(toMap->pBinds + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkBindSparseInfo(VulkanHandleMapping* handlemap, VkBindSparseInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pWaitSemaphores) {
+        handlemap->mapHandles_VkSemaphore((VkSemaphore*)toMap->pWaitSemaphores,
+                                          toMap->waitSemaphoreCount);
+    }
+    if (toMap) {
+        if (toMap->pBufferBinds) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->bufferBindCount; ++i) {
+                handlemap_VkSparseBufferMemoryBindInfo(
+                    handlemap, (VkSparseBufferMemoryBindInfo*)(toMap->pBufferBinds + i));
+            }
+        }
+    }
+    if (toMap) {
+        if (toMap->pImageOpaqueBinds) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->imageOpaqueBindCount; ++i) {
+                handlemap_VkSparseImageOpaqueMemoryBindInfo(
+                    handlemap, (VkSparseImageOpaqueMemoryBindInfo*)(toMap->pImageOpaqueBinds + i));
+            }
+        }
+    }
+    if (toMap) {
+        if (toMap->pImageBinds) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->imageBindCount; ++i) {
+                handlemap_VkSparseImageMemoryBindInfo(
+                    handlemap, (VkSparseImageMemoryBindInfo*)(toMap->pImageBinds + i));
+            }
+        }
+    }
+    if (toMap->pSignalSemaphores) {
+        handlemap->mapHandles_VkSemaphore((VkSemaphore*)toMap->pSignalSemaphores,
+                                          toMap->signalSemaphoreCount);
+    }
+}
+
+void handlemap_VkSparseImageFormatProperties(VulkanHandleMapping* handlemap,
+                                             VkSparseImageFormatProperties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkExtent3D(handlemap, (VkExtent3D*)(&toMap->imageGranularity));
+}
+
+void handlemap_VkSparseImageMemoryRequirements(VulkanHandleMapping* handlemap,
+                                               VkSparseImageMemoryRequirements* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkSparseImageFormatProperties(
+        handlemap, (VkSparseImageFormatProperties*)(&toMap->formatProperties));
+}
+
+void handlemap_VkFenceCreateInfo(VulkanHandleMapping* handlemap, VkFenceCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkSemaphoreCreateInfo(VulkanHandleMapping* handlemap, VkSemaphoreCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkEventCreateInfo(VulkanHandleMapping* handlemap, VkEventCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkQueryPoolCreateInfo(VulkanHandleMapping* handlemap, VkQueryPoolCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkBufferCreateInfo(VulkanHandleMapping* handlemap, VkBufferCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkBufferViewCreateInfo(VulkanHandleMapping* handlemap,
+                                      VkBufferViewCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkBuffer((VkBuffer*)&toMap->buffer);
+}
+
+void handlemap_VkImageCreateInfo(VulkanHandleMapping* handlemap, VkImageCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkExtent3D(handlemap, (VkExtent3D*)(&toMap->extent));
+}
+
+void handlemap_VkSubresourceLayout(VulkanHandleMapping* handlemap, VkSubresourceLayout* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkComponentMapping(VulkanHandleMapping* handlemap, VkComponentMapping* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkImageViewCreateInfo(VulkanHandleMapping* handlemap, VkImageViewCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkImage((VkImage*)&toMap->image);
+    handlemap_VkComponentMapping(handlemap, (VkComponentMapping*)(&toMap->components));
+    handlemap_VkImageSubresourceRange(handlemap,
+                                      (VkImageSubresourceRange*)(&toMap->subresourceRange));
+}
+
+void handlemap_VkShaderModuleCreateInfo(VulkanHandleMapping* handlemap,
+                                        VkShaderModuleCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPipelineCacheCreateInfo(VulkanHandleMapping* handlemap,
+                                         VkPipelineCacheCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkSpecializationMapEntry(VulkanHandleMapping* handlemap,
+                                        VkSpecializationMapEntry* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkSpecializationInfo(VulkanHandleMapping* handlemap, VkSpecializationInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap) {
+        if (toMap->pMapEntries) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->mapEntryCount; ++i) {
+                handlemap_VkSpecializationMapEntry(
+                    handlemap, (VkSpecializationMapEntry*)(toMap->pMapEntries + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkPipelineShaderStageCreateInfo(VulkanHandleMapping* handlemap,
+                                               VkPipelineShaderStageCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkShaderModule((VkShaderModule*)&toMap->module);
+    if (toMap->pSpecializationInfo) {
+        handlemap_VkSpecializationInfo(handlemap,
+                                       (VkSpecializationInfo*)(toMap->pSpecializationInfo));
+    }
+}
+
+void handlemap_VkComputePipelineCreateInfo(VulkanHandleMapping* handlemap,
+                                           VkComputePipelineCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkPipelineShaderStageCreateInfo(handlemap,
+                                              (VkPipelineShaderStageCreateInfo*)(&toMap->stage));
+    handlemap->mapHandles_VkPipelineLayout((VkPipelineLayout*)&toMap->layout);
+    handlemap->mapHandles_VkPipeline((VkPipeline*)&toMap->basePipelineHandle);
+}
+
+void handlemap_VkVertexInputBindingDescription(VulkanHandleMapping* handlemap,
+                                               VkVertexInputBindingDescription* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkVertexInputAttributeDescription(VulkanHandleMapping* handlemap,
+                                                 VkVertexInputAttributeDescription* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkPipelineVertexInputStateCreateInfo(VulkanHandleMapping* handlemap,
+                                                    VkPipelineVertexInputStateCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pVertexBindingDescriptions) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->vertexBindingDescriptionCount; ++i) {
+                handlemap_VkVertexInputBindingDescription(
+                    handlemap,
+                    (VkVertexInputBindingDescription*)(toMap->pVertexBindingDescriptions + i));
+            }
+        }
+    }
+    if (toMap) {
+        if (toMap->pVertexAttributeDescriptions) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->vertexAttributeDescriptionCount; ++i) {
+                handlemap_VkVertexInputAttributeDescription(
+                    handlemap,
+                    (VkVertexInputAttributeDescription*)(toMap->pVertexAttributeDescriptions + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkPipelineInputAssemblyStateCreateInfo(
+    VulkanHandleMapping* handlemap, VkPipelineInputAssemblyStateCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPipelineTessellationStateCreateInfo(VulkanHandleMapping* handlemap,
+                                                     VkPipelineTessellationStateCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkViewport(VulkanHandleMapping* handlemap, VkViewport* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkPipelineViewportStateCreateInfo(VulkanHandleMapping* handlemap,
+                                                 VkPipelineViewportStateCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pViewports) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->viewportCount; ++i) {
+                handlemap_VkViewport(handlemap, (VkViewport*)(toMap->pViewports + i));
+            }
+        }
+    }
+    if (toMap) {
+        if (toMap->pScissors) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->scissorCount; ++i) {
+                handlemap_VkRect2D(handlemap, (VkRect2D*)(toMap->pScissors + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkPipelineRasterizationStateCreateInfo(
+    VulkanHandleMapping* handlemap, VkPipelineRasterizationStateCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPipelineMultisampleStateCreateInfo(VulkanHandleMapping* handlemap,
+                                                    VkPipelineMultisampleStateCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkStencilOpState(VulkanHandleMapping* handlemap, VkStencilOpState* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkPipelineDepthStencilStateCreateInfo(VulkanHandleMapping* handlemap,
+                                                     VkPipelineDepthStencilStateCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkStencilOpState(handlemap, (VkStencilOpState*)(&toMap->front));
+    handlemap_VkStencilOpState(handlemap, (VkStencilOpState*)(&toMap->back));
+}
+
+void handlemap_VkPipelineColorBlendAttachmentState(VulkanHandleMapping* handlemap,
+                                                   VkPipelineColorBlendAttachmentState* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkPipelineColorBlendStateCreateInfo(VulkanHandleMapping* handlemap,
+                                                   VkPipelineColorBlendStateCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->attachmentCount; ++i) {
+                handlemap_VkPipelineColorBlendAttachmentState(
+                    handlemap, (VkPipelineColorBlendAttachmentState*)(toMap->pAttachments + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkPipelineDynamicStateCreateInfo(VulkanHandleMapping* handlemap,
+                                                VkPipelineDynamicStateCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkGraphicsPipelineCreateInfo(VulkanHandleMapping* handlemap,
+                                            VkGraphicsPipelineCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pStages) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->stageCount; ++i) {
+                handlemap_VkPipelineShaderStageCreateInfo(
+                    handlemap, (VkPipelineShaderStageCreateInfo*)(toMap->pStages + i));
+            }
+        }
+    }
+    if (toMap->pVertexInputState) {
+        handlemap_VkPipelineVertexInputStateCreateInfo(
+            handlemap, (VkPipelineVertexInputStateCreateInfo*)(toMap->pVertexInputState));
+    }
+    if (toMap->pInputAssemblyState) {
+        handlemap_VkPipelineInputAssemblyStateCreateInfo(
+            handlemap, (VkPipelineInputAssemblyStateCreateInfo*)(toMap->pInputAssemblyState));
+    }
+    if (toMap->pTessellationState) {
+        handlemap_VkPipelineTessellationStateCreateInfo(
+            handlemap, (VkPipelineTessellationStateCreateInfo*)(toMap->pTessellationState));
+    }
+    if (toMap->pViewportState) {
+        handlemap_VkPipelineViewportStateCreateInfo(
+            handlemap, (VkPipelineViewportStateCreateInfo*)(toMap->pViewportState));
+    }
+    if (toMap->pRasterizationState) {
+        handlemap_VkPipelineRasterizationStateCreateInfo(
+            handlemap, (VkPipelineRasterizationStateCreateInfo*)(toMap->pRasterizationState));
+    }
+    if (toMap->pMultisampleState) {
+        handlemap_VkPipelineMultisampleStateCreateInfo(
+            handlemap, (VkPipelineMultisampleStateCreateInfo*)(toMap->pMultisampleState));
+    }
+    if (toMap->pDepthStencilState) {
+        handlemap_VkPipelineDepthStencilStateCreateInfo(
+            handlemap, (VkPipelineDepthStencilStateCreateInfo*)(toMap->pDepthStencilState));
+    }
+    if (toMap->pColorBlendState) {
+        handlemap_VkPipelineColorBlendStateCreateInfo(
+            handlemap, (VkPipelineColorBlendStateCreateInfo*)(toMap->pColorBlendState));
+    }
+    if (toMap->pDynamicState) {
+        handlemap_VkPipelineDynamicStateCreateInfo(
+            handlemap, (VkPipelineDynamicStateCreateInfo*)(toMap->pDynamicState));
+    }
+    handlemap->mapHandles_VkPipelineLayout((VkPipelineLayout*)&toMap->layout);
+    handlemap->mapHandles_VkRenderPass((VkRenderPass*)&toMap->renderPass);
+    handlemap->mapHandles_VkPipeline((VkPipeline*)&toMap->basePipelineHandle);
+}
+
+void handlemap_VkPushConstantRange(VulkanHandleMapping* handlemap, VkPushConstantRange* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkPipelineLayoutCreateInfo(VulkanHandleMapping* handlemap,
+                                          VkPipelineLayoutCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pSetLayouts) {
+        handlemap->mapHandles_VkDescriptorSetLayout((VkDescriptorSetLayout*)toMap->pSetLayouts,
+                                                    toMap->setLayoutCount);
+    }
+    if (toMap) {
+        if (toMap->pPushConstantRanges) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->pushConstantRangeCount; ++i) {
+                handlemap_VkPushConstantRange(
+                    handlemap, (VkPushConstantRange*)(toMap->pPushConstantRanges + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkSamplerCreateInfo(VulkanHandleMapping* handlemap, VkSamplerCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkCopyDescriptorSet(VulkanHandleMapping* handlemap, VkCopyDescriptorSet* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkDescriptorSet((VkDescriptorSet*)&toMap->srcSet);
+    handlemap->mapHandles_VkDescriptorSet((VkDescriptorSet*)&toMap->dstSet);
+}
+
+void handlemap_VkDescriptorBufferInfo(VulkanHandleMapping* handlemap,
+                                      VkDescriptorBufferInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap->mapHandles_VkBuffer((VkBuffer*)&toMap->buffer);
+}
+
+void handlemap_VkDescriptorImageInfo(VulkanHandleMapping* handlemap, VkDescriptorImageInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap->mapHandles_VkSampler((VkSampler*)&toMap->sampler);
+    handlemap->mapHandles_VkImageView((VkImageView*)&toMap->imageView);
+}
+
+void handlemap_VkDescriptorPoolSize(VulkanHandleMapping* handlemap, VkDescriptorPoolSize* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkDescriptorPoolCreateInfo(VulkanHandleMapping* handlemap,
+                                          VkDescriptorPoolCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pPoolSizes) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->poolSizeCount; ++i) {
+                handlemap_VkDescriptorPoolSize(handlemap,
+                                               (VkDescriptorPoolSize*)(toMap->pPoolSizes + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkDescriptorSetAllocateInfo(VulkanHandleMapping* handlemap,
+                                           VkDescriptorSetAllocateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkDescriptorPool((VkDescriptorPool*)&toMap->descriptorPool);
+    if (toMap->pSetLayouts) {
+        handlemap->mapHandles_VkDescriptorSetLayout((VkDescriptorSetLayout*)toMap->pSetLayouts,
+                                                    toMap->descriptorSetCount);
+    }
+}
+
+void handlemap_VkDescriptorSetLayoutBinding(VulkanHandleMapping* handlemap,
+                                            VkDescriptorSetLayoutBinding* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pImmutableSamplers) {
+        handlemap->mapHandles_VkSampler((VkSampler*)toMap->pImmutableSamplers,
+                                        toMap->descriptorCount);
+    }
+}
+
+void handlemap_VkDescriptorSetLayoutCreateInfo(VulkanHandleMapping* handlemap,
+                                               VkDescriptorSetLayoutCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pBindings) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->bindingCount; ++i) {
+                handlemap_VkDescriptorSetLayoutBinding(
+                    handlemap, (VkDescriptorSetLayoutBinding*)(toMap->pBindings + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkWriteDescriptorSet(VulkanHandleMapping* handlemap, VkWriteDescriptorSet* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkDescriptorSet((VkDescriptorSet*)&toMap->dstSet);
+    if (toMap) {
+        if (toMap->pImageInfo) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->descriptorCount; ++i) {
+                handlemap_VkDescriptorImageInfo(handlemap,
+                                                (VkDescriptorImageInfo*)(toMap->pImageInfo + i));
+            }
+        }
+    }
+    if (toMap) {
+        if (toMap->pBufferInfo) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->descriptorCount; ++i) {
+                handlemap_VkDescriptorBufferInfo(handlemap,
+                                                 (VkDescriptorBufferInfo*)(toMap->pBufferInfo + i));
+            }
+        }
+    }
+    if (toMap->pTexelBufferView) {
+        handlemap->mapHandles_VkBufferView((VkBufferView*)toMap->pTexelBufferView,
+                                           toMap->descriptorCount);
+    }
+}
+
+void handlemap_VkAttachmentDescription(VulkanHandleMapping* handlemap,
+                                       VkAttachmentDescription* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkAttachmentReference(VulkanHandleMapping* handlemap, VkAttachmentReference* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkFramebufferCreateInfo(VulkanHandleMapping* handlemap,
+                                       VkFramebufferCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkRenderPass((VkRenderPass*)&toMap->renderPass);
+    if (toMap->pAttachments) {
+        handlemap->mapHandles_VkImageView((VkImageView*)toMap->pAttachments,
+                                          toMap->attachmentCount);
+    }
+}
+
+void handlemap_VkSubpassDescription(VulkanHandleMapping* handlemap, VkSubpassDescription* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap) {
+        if (toMap->pInputAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->inputAttachmentCount; ++i) {
+                handlemap_VkAttachmentReference(
+                    handlemap, (VkAttachmentReference*)(toMap->pInputAttachments + i));
+            }
+        }
+    }
+    if (toMap) {
+        if (toMap->pColorAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->colorAttachmentCount; ++i) {
+                handlemap_VkAttachmentReference(
+                    handlemap, (VkAttachmentReference*)(toMap->pColorAttachments + i));
+            }
+        }
+    }
+    if (toMap) {
+        if (toMap->pResolveAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->colorAttachmentCount; ++i) {
+                handlemap_VkAttachmentReference(
+                    handlemap, (VkAttachmentReference*)(toMap->pResolveAttachments + i));
+            }
+        }
+    }
+    if (toMap->pDepthStencilAttachment) {
+        handlemap_VkAttachmentReference(handlemap,
+                                        (VkAttachmentReference*)(toMap->pDepthStencilAttachment));
+    }
+}
+
+void handlemap_VkSubpassDependency(VulkanHandleMapping* handlemap, VkSubpassDependency* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkRenderPassCreateInfo(VulkanHandleMapping* handlemap,
+                                      VkRenderPassCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->attachmentCount; ++i) {
+                handlemap_VkAttachmentDescription(
+                    handlemap, (VkAttachmentDescription*)(toMap->pAttachments + i));
+            }
+        }
+    }
+    if (toMap) {
+        if (toMap->pSubpasses) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->subpassCount; ++i) {
+                handlemap_VkSubpassDescription(handlemap,
+                                               (VkSubpassDescription*)(toMap->pSubpasses + i));
+            }
+        }
+    }
+    if (toMap) {
+        if (toMap->pDependencies) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->dependencyCount; ++i) {
+                handlemap_VkSubpassDependency(handlemap,
+                                              (VkSubpassDependency*)(toMap->pDependencies + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkCommandPoolCreateInfo(VulkanHandleMapping* handlemap,
+                                       VkCommandPoolCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkCommandBufferAllocateInfo(VulkanHandleMapping* handlemap,
+                                           VkCommandBufferAllocateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkCommandPool((VkCommandPool*)&toMap->commandPool);
+}
+
+void handlemap_VkCommandBufferInheritanceInfo(VulkanHandleMapping* handlemap,
+                                              VkCommandBufferInheritanceInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkRenderPass((VkRenderPass*)&toMap->renderPass);
+    handlemap->mapHandles_VkFramebuffer((VkFramebuffer*)&toMap->framebuffer);
+}
+
+void handlemap_VkCommandBufferBeginInfo(VulkanHandleMapping* handlemap,
+                                        VkCommandBufferBeginInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pInheritanceInfo) {
+        handlemap_VkCommandBufferInheritanceInfo(
+            handlemap, (VkCommandBufferInheritanceInfo*)(toMap->pInheritanceInfo));
+    }
+}
+
+void handlemap_VkBufferCopy(VulkanHandleMapping* handlemap, VkBufferCopy* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkImageSubresourceLayers(VulkanHandleMapping* handlemap,
+                                        VkImageSubresourceLayers* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkBufferImageCopy(VulkanHandleMapping* handlemap, VkBufferImageCopy* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkImageSubresourceLayers(handlemap,
+                                       (VkImageSubresourceLayers*)(&toMap->imageSubresource));
+    handlemap_VkOffset3D(handlemap, (VkOffset3D*)(&toMap->imageOffset));
+    handlemap_VkExtent3D(handlemap, (VkExtent3D*)(&toMap->imageExtent));
+}
+
+void handlemap_VkClearColorValue(VulkanHandleMapping* handlemap, VkClearColorValue* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkClearDepthStencilValue(VulkanHandleMapping* handlemap,
+                                        VkClearDepthStencilValue* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkClearValue(VulkanHandleMapping* handlemap, VkClearValue* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkClearColorValue(handlemap, (VkClearColorValue*)(&toMap->color));
+    handlemap_VkClearDepthStencilValue(handlemap,
+                                       (VkClearDepthStencilValue*)(&toMap->depthStencil));
+}
+
+void handlemap_VkClearAttachment(VulkanHandleMapping* handlemap, VkClearAttachment* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkClearValue(handlemap, (VkClearValue*)(&toMap->clearValue));
+}
+
+void handlemap_VkClearRect(VulkanHandleMapping* handlemap, VkClearRect* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkRect2D(handlemap, (VkRect2D*)(&toMap->rect));
+}
+
+void handlemap_VkImageBlit(VulkanHandleMapping* handlemap, VkImageBlit* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkImageSubresourceLayers(handlemap,
+                                       (VkImageSubresourceLayers*)(&toMap->srcSubresource));
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        handlemap_VkOffset3D(handlemap, (VkOffset3D*)(toMap->srcOffsets + i));
+    }
+    handlemap_VkImageSubresourceLayers(handlemap,
+                                       (VkImageSubresourceLayers*)(&toMap->dstSubresource));
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        handlemap_VkOffset3D(handlemap, (VkOffset3D*)(toMap->dstOffsets + i));
+    }
+}
+
+void handlemap_VkImageCopy(VulkanHandleMapping* handlemap, VkImageCopy* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkImageSubresourceLayers(handlemap,
+                                       (VkImageSubresourceLayers*)(&toMap->srcSubresource));
+    handlemap_VkOffset3D(handlemap, (VkOffset3D*)(&toMap->srcOffset));
+    handlemap_VkImageSubresourceLayers(handlemap,
+                                       (VkImageSubresourceLayers*)(&toMap->dstSubresource));
+    handlemap_VkOffset3D(handlemap, (VkOffset3D*)(&toMap->dstOffset));
+    handlemap_VkExtent3D(handlemap, (VkExtent3D*)(&toMap->extent));
+}
+
+void handlemap_VkImageResolve(VulkanHandleMapping* handlemap, VkImageResolve* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkImageSubresourceLayers(handlemap,
+                                       (VkImageSubresourceLayers*)(&toMap->srcSubresource));
+    handlemap_VkOffset3D(handlemap, (VkOffset3D*)(&toMap->srcOffset));
+    handlemap_VkImageSubresourceLayers(handlemap,
+                                       (VkImageSubresourceLayers*)(&toMap->dstSubresource));
+    handlemap_VkOffset3D(handlemap, (VkOffset3D*)(&toMap->dstOffset));
+    handlemap_VkExtent3D(handlemap, (VkExtent3D*)(&toMap->extent));
+}
+
+void handlemap_VkRenderPassBeginInfo(VulkanHandleMapping* handlemap, VkRenderPassBeginInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkRenderPass((VkRenderPass*)&toMap->renderPass);
+    handlemap->mapHandles_VkFramebuffer((VkFramebuffer*)&toMap->framebuffer);
+    handlemap_VkRect2D(handlemap, (VkRect2D*)(&toMap->renderArea));
+    if (toMap) {
+        if (toMap->pClearValues) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->clearValueCount; ++i) {
+                handlemap_VkClearValue(handlemap, (VkClearValue*)(toMap->pClearValues + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_VERSION_1_1
+void handlemap_VkPhysicalDeviceSubgroupProperties(VulkanHandleMapping* handlemap,
+                                                  VkPhysicalDeviceSubgroupProperties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkBindBufferMemoryInfo(VulkanHandleMapping* handlemap,
+                                      VkBindBufferMemoryInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkBuffer((VkBuffer*)&toMap->buffer);
+    handlemap->mapHandles_VkDeviceMemory((VkDeviceMemory*)&toMap->memory);
+}
+
+void handlemap_VkBindImageMemoryInfo(VulkanHandleMapping* handlemap, VkBindImageMemoryInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkImage((VkImage*)&toMap->image);
+    handlemap->mapHandles_VkDeviceMemory((VkDeviceMemory*)&toMap->memory);
+}
+
+void handlemap_VkPhysicalDevice16BitStorageFeatures(VulkanHandleMapping* handlemap,
+                                                    VkPhysicalDevice16BitStorageFeatures* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkMemoryDedicatedRequirements(VulkanHandleMapping* handlemap,
+                                             VkMemoryDedicatedRequirements* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkMemoryDedicatedAllocateInfo(VulkanHandleMapping* handlemap,
+                                             VkMemoryDedicatedAllocateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkImage((VkImage*)&toMap->image);
+    handlemap->mapHandles_VkBuffer((VkBuffer*)&toMap->buffer);
+}
+
+void handlemap_VkMemoryAllocateFlagsInfo(VulkanHandleMapping* handlemap,
+                                         VkMemoryAllocateFlagsInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDeviceGroupRenderPassBeginInfo(VulkanHandleMapping* handlemap,
+                                                VkDeviceGroupRenderPassBeginInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pDeviceRenderAreas) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->deviceRenderAreaCount; ++i) {
+                handlemap_VkRect2D(handlemap, (VkRect2D*)(toMap->pDeviceRenderAreas + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkDeviceGroupCommandBufferBeginInfo(VulkanHandleMapping* handlemap,
+                                                   VkDeviceGroupCommandBufferBeginInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDeviceGroupSubmitInfo(VulkanHandleMapping* handlemap,
+                                       VkDeviceGroupSubmitInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDeviceGroupBindSparseInfo(VulkanHandleMapping* handlemap,
+                                           VkDeviceGroupBindSparseInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkBindBufferMemoryDeviceGroupInfo(VulkanHandleMapping* handlemap,
+                                                 VkBindBufferMemoryDeviceGroupInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkBindImageMemoryDeviceGroupInfo(VulkanHandleMapping* handlemap,
+                                                VkBindImageMemoryDeviceGroupInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pSplitInstanceBindRegions) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->splitInstanceBindRegionCount; ++i) {
+                handlemap_VkRect2D(handlemap, (VkRect2D*)(toMap->pSplitInstanceBindRegions + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkPhysicalDeviceGroupProperties(VulkanHandleMapping* handlemap,
+                                               VkPhysicalDeviceGroupProperties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)toMap->physicalDevices,
+                                           VK_MAX_DEVICE_GROUP_SIZE);
+}
+
+void handlemap_VkDeviceGroupDeviceCreateInfo(VulkanHandleMapping* handlemap,
+                                             VkDeviceGroupDeviceCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pPhysicalDevices) {
+        handlemap->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)toMap->pPhysicalDevices,
+                                               toMap->physicalDeviceCount);
+    }
+}
+
+void handlemap_VkBufferMemoryRequirementsInfo2(VulkanHandleMapping* handlemap,
+                                               VkBufferMemoryRequirementsInfo2* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkBuffer((VkBuffer*)&toMap->buffer);
+}
+
+void handlemap_VkImageMemoryRequirementsInfo2(VulkanHandleMapping* handlemap,
+                                              VkImageMemoryRequirementsInfo2* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkImage((VkImage*)&toMap->image);
+}
+
+void handlemap_VkImageSparseMemoryRequirementsInfo2(VulkanHandleMapping* handlemap,
+                                                    VkImageSparseMemoryRequirementsInfo2* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkImage((VkImage*)&toMap->image);
+}
+
+void handlemap_VkMemoryRequirements2(VulkanHandleMapping* handlemap, VkMemoryRequirements2* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkMemoryRequirements(handlemap, (VkMemoryRequirements*)(&toMap->memoryRequirements));
+}
+
+void handlemap_VkSparseImageMemoryRequirements2(VulkanHandleMapping* handlemap,
+                                                VkSparseImageMemoryRequirements2* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkSparseImageMemoryRequirements(
+        handlemap, (VkSparseImageMemoryRequirements*)(&toMap->memoryRequirements));
+}
+
+void handlemap_VkPhysicalDeviceFeatures2(VulkanHandleMapping* handlemap,
+                                         VkPhysicalDeviceFeatures2* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkPhysicalDeviceFeatures(handlemap, (VkPhysicalDeviceFeatures*)(&toMap->features));
+}
+
+void handlemap_VkPhysicalDeviceProperties2(VulkanHandleMapping* handlemap,
+                                           VkPhysicalDeviceProperties2* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkPhysicalDeviceProperties(handlemap,
+                                         (VkPhysicalDeviceProperties*)(&toMap->properties));
+}
+
+void handlemap_VkFormatProperties2(VulkanHandleMapping* handlemap, VkFormatProperties2* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkFormatProperties(handlemap, (VkFormatProperties*)(&toMap->formatProperties));
+}
+
+void handlemap_VkImageFormatProperties2(VulkanHandleMapping* handlemap,
+                                        VkImageFormatProperties2* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkImageFormatProperties(handlemap,
+                                      (VkImageFormatProperties*)(&toMap->imageFormatProperties));
+}
+
+void handlemap_VkPhysicalDeviceImageFormatInfo2(VulkanHandleMapping* handlemap,
+                                                VkPhysicalDeviceImageFormatInfo2* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkQueueFamilyProperties2(VulkanHandleMapping* handlemap,
+                                        VkQueueFamilyProperties2* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkQueueFamilyProperties(handlemap,
+                                      (VkQueueFamilyProperties*)(&toMap->queueFamilyProperties));
+}
+
+void handlemap_VkPhysicalDeviceMemoryProperties2(VulkanHandleMapping* handlemap,
+                                                 VkPhysicalDeviceMemoryProperties2* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkPhysicalDeviceMemoryProperties(
+        handlemap, (VkPhysicalDeviceMemoryProperties*)(&toMap->memoryProperties));
+}
+
+void handlemap_VkSparseImageFormatProperties2(VulkanHandleMapping* handlemap,
+                                              VkSparseImageFormatProperties2* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkSparseImageFormatProperties(handlemap,
+                                            (VkSparseImageFormatProperties*)(&toMap->properties));
+}
+
+void handlemap_VkPhysicalDeviceSparseImageFormatInfo2(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceSparseImageFormatInfo2* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDevicePointClippingProperties(
+    VulkanHandleMapping* handlemap, VkPhysicalDevicePointClippingProperties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkInputAttachmentAspectReference(VulkanHandleMapping* handlemap,
+                                                VkInputAttachmentAspectReference* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkRenderPassInputAttachmentAspectCreateInfo(
+    VulkanHandleMapping* handlemap, VkRenderPassInputAttachmentAspectCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pAspectReferences) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->aspectReferenceCount; ++i) {
+                handlemap_VkInputAttachmentAspectReference(
+                    handlemap, (VkInputAttachmentAspectReference*)(toMap->pAspectReferences + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkImageViewUsageCreateInfo(VulkanHandleMapping* handlemap,
+                                          VkImageViewUsageCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPipelineTessellationDomainOriginStateCreateInfo(
+    VulkanHandleMapping* handlemap, VkPipelineTessellationDomainOriginStateCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkRenderPassMultiviewCreateInfo(VulkanHandleMapping* handlemap,
+                                               VkRenderPassMultiviewCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceMultiviewFeatures(VulkanHandleMapping* handlemap,
+                                                 VkPhysicalDeviceMultiviewFeatures* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceMultiviewProperties(VulkanHandleMapping* handlemap,
+                                                   VkPhysicalDeviceMultiviewProperties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceVariablePointersFeatures(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceVariablePointersFeatures* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceProtectedMemoryFeatures(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceProtectedMemoryFeatures* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceProtectedMemoryProperties(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceProtectedMemoryProperties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDeviceQueueInfo2(VulkanHandleMapping* handlemap, VkDeviceQueueInfo2* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkProtectedSubmitInfo(VulkanHandleMapping* handlemap, VkProtectedSubmitInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkSamplerYcbcrConversionCreateInfo(VulkanHandleMapping* handlemap,
+                                                  VkSamplerYcbcrConversionCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkComponentMapping(handlemap, (VkComponentMapping*)(&toMap->components));
+}
+
+void handlemap_VkSamplerYcbcrConversionInfo(VulkanHandleMapping* handlemap,
+                                            VkSamplerYcbcrConversionInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkSamplerYcbcrConversion((VkSamplerYcbcrConversion*)&toMap->conversion);
+}
+
+void handlemap_VkBindImagePlaneMemoryInfo(VulkanHandleMapping* handlemap,
+                                          VkBindImagePlaneMemoryInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkImagePlaneMemoryRequirementsInfo(VulkanHandleMapping* handlemap,
+                                                  VkImagePlaneMemoryRequirementsInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceSamplerYcbcrConversionFeatures(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceSamplerYcbcrConversionFeatures* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkSamplerYcbcrConversionImageFormatProperties(
+    VulkanHandleMapping* handlemap, VkSamplerYcbcrConversionImageFormatProperties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDescriptorUpdateTemplateEntry(VulkanHandleMapping* handlemap,
+                                               VkDescriptorUpdateTemplateEntry* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkDescriptorUpdateTemplateCreateInfo(VulkanHandleMapping* handlemap,
+                                                    VkDescriptorUpdateTemplateCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pDescriptorUpdateEntries) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->descriptorUpdateEntryCount; ++i) {
+                handlemap_VkDescriptorUpdateTemplateEntry(
+                    handlemap,
+                    (VkDescriptorUpdateTemplateEntry*)(toMap->pDescriptorUpdateEntries + i));
+            }
+        }
+    }
+    handlemap->mapHandles_VkDescriptorSetLayout(
+        (VkDescriptorSetLayout*)&toMap->descriptorSetLayout);
+    handlemap->mapHandles_VkPipelineLayout((VkPipelineLayout*)&toMap->pipelineLayout);
+}
+
+void handlemap_VkExternalMemoryProperties(VulkanHandleMapping* handlemap,
+                                          VkExternalMemoryProperties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkPhysicalDeviceExternalImageFormatInfo(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceExternalImageFormatInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkExternalImageFormatProperties(VulkanHandleMapping* handlemap,
+                                               VkExternalImageFormatProperties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkExternalMemoryProperties(
+        handlemap, (VkExternalMemoryProperties*)(&toMap->externalMemoryProperties));
+}
+
+void handlemap_VkPhysicalDeviceExternalBufferInfo(VulkanHandleMapping* handlemap,
+                                                  VkPhysicalDeviceExternalBufferInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkExternalBufferProperties(VulkanHandleMapping* handlemap,
+                                          VkExternalBufferProperties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkExternalMemoryProperties(
+        handlemap, (VkExternalMemoryProperties*)(&toMap->externalMemoryProperties));
+}
+
+void handlemap_VkPhysicalDeviceIDProperties(VulkanHandleMapping* handlemap,
+                                            VkPhysicalDeviceIDProperties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkExternalMemoryImageCreateInfo(VulkanHandleMapping* handlemap,
+                                               VkExternalMemoryImageCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkExternalMemoryBufferCreateInfo(VulkanHandleMapping* handlemap,
+                                                VkExternalMemoryBufferCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkExportMemoryAllocateInfo(VulkanHandleMapping* handlemap,
+                                          VkExportMemoryAllocateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceExternalFenceInfo(VulkanHandleMapping* handlemap,
+                                                 VkPhysicalDeviceExternalFenceInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkExternalFenceProperties(VulkanHandleMapping* handlemap,
+                                         VkExternalFenceProperties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkExportFenceCreateInfo(VulkanHandleMapping* handlemap,
+                                       VkExportFenceCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkExportSemaphoreCreateInfo(VulkanHandleMapping* handlemap,
+                                           VkExportSemaphoreCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceExternalSemaphoreInfo(VulkanHandleMapping* handlemap,
+                                                     VkPhysicalDeviceExternalSemaphoreInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkExternalSemaphoreProperties(VulkanHandleMapping* handlemap,
+                                             VkExternalSemaphoreProperties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceMaintenance3Properties(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceMaintenance3Properties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDescriptorSetLayoutSupport(VulkanHandleMapping* handlemap,
+                                            VkDescriptorSetLayoutSupport* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceShaderDrawParametersFeatures(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderDrawParametersFeatures* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_VERSION_1_2
+void handlemap_VkPhysicalDeviceVulkan11Features(VulkanHandleMapping* handlemap,
+                                                VkPhysicalDeviceVulkan11Features* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceVulkan11Properties(VulkanHandleMapping* handlemap,
+                                                  VkPhysicalDeviceVulkan11Properties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceVulkan12Features(VulkanHandleMapping* handlemap,
+                                                VkPhysicalDeviceVulkan12Features* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkConformanceVersion(VulkanHandleMapping* handlemap, VkConformanceVersion* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkPhysicalDeviceVulkan12Properties(VulkanHandleMapping* handlemap,
+                                                  VkPhysicalDeviceVulkan12Properties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkConformanceVersion(handlemap, (VkConformanceVersion*)(&toMap->conformanceVersion));
+}
+
+void handlemap_VkImageFormatListCreateInfo(VulkanHandleMapping* handlemap,
+                                           VkImageFormatListCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkAttachmentDescription2(VulkanHandleMapping* handlemap,
+                                        VkAttachmentDescription2* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkAttachmentReference2(VulkanHandleMapping* handlemap,
+                                      VkAttachmentReference2* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkSubpassDescription2(VulkanHandleMapping* handlemap, VkSubpassDescription2* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pInputAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->inputAttachmentCount; ++i) {
+                handlemap_VkAttachmentReference2(
+                    handlemap, (VkAttachmentReference2*)(toMap->pInputAttachments + i));
+            }
+        }
+    }
+    if (toMap) {
+        if (toMap->pColorAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->colorAttachmentCount; ++i) {
+                handlemap_VkAttachmentReference2(
+                    handlemap, (VkAttachmentReference2*)(toMap->pColorAttachments + i));
+            }
+        }
+    }
+    if (toMap) {
+        if (toMap->pResolveAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->colorAttachmentCount; ++i) {
+                handlemap_VkAttachmentReference2(
+                    handlemap, (VkAttachmentReference2*)(toMap->pResolveAttachments + i));
+            }
+        }
+    }
+    if (toMap->pDepthStencilAttachment) {
+        handlemap_VkAttachmentReference2(handlemap,
+                                         (VkAttachmentReference2*)(toMap->pDepthStencilAttachment));
+    }
+}
+
+void handlemap_VkSubpassDependency2(VulkanHandleMapping* handlemap, VkSubpassDependency2* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkRenderPassCreateInfo2(VulkanHandleMapping* handlemap,
+                                       VkRenderPassCreateInfo2* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->attachmentCount; ++i) {
+                handlemap_VkAttachmentDescription2(
+                    handlemap, (VkAttachmentDescription2*)(toMap->pAttachments + i));
+            }
+        }
+    }
+    if (toMap) {
+        if (toMap->pSubpasses) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->subpassCount; ++i) {
+                handlemap_VkSubpassDescription2(handlemap,
+                                                (VkSubpassDescription2*)(toMap->pSubpasses + i));
+            }
+        }
+    }
+    if (toMap) {
+        if (toMap->pDependencies) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->dependencyCount; ++i) {
+                handlemap_VkSubpassDependency2(handlemap,
+                                               (VkSubpassDependency2*)(toMap->pDependencies + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkSubpassBeginInfo(VulkanHandleMapping* handlemap, VkSubpassBeginInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkSubpassEndInfo(VulkanHandleMapping* handlemap, VkSubpassEndInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDevice8BitStorageFeatures(VulkanHandleMapping* handlemap,
+                                                   VkPhysicalDevice8BitStorageFeatures* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceDriverProperties(VulkanHandleMapping* handlemap,
+                                                VkPhysicalDeviceDriverProperties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkConformanceVersion(handlemap, (VkConformanceVersion*)(&toMap->conformanceVersion));
+}
+
+void handlemap_VkPhysicalDeviceShaderAtomicInt64Features(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderAtomicInt64Features* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceShaderFloat16Int8Features(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderFloat16Int8Features* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceFloatControlsProperties(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceFloatControlsProperties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDescriptorSetLayoutBindingFlagsCreateInfo(
+    VulkanHandleMapping* handlemap, VkDescriptorSetLayoutBindingFlagsCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceDescriptorIndexingFeatures(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceDescriptorIndexingFeatures* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceDescriptorIndexingProperties(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceDescriptorIndexingProperties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDescriptorSetVariableDescriptorCountAllocateInfo(
+    VulkanHandleMapping* handlemap, VkDescriptorSetVariableDescriptorCountAllocateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDescriptorSetVariableDescriptorCountLayoutSupport(
+    VulkanHandleMapping* handlemap, VkDescriptorSetVariableDescriptorCountLayoutSupport* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkSubpassDescriptionDepthStencilResolve(
+    VulkanHandleMapping* handlemap, VkSubpassDescriptionDepthStencilResolve* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pDepthStencilResolveAttachment) {
+        handlemap_VkAttachmentReference2(
+            handlemap, (VkAttachmentReference2*)(toMap->pDepthStencilResolveAttachment));
+    }
+}
+
+void handlemap_VkPhysicalDeviceDepthStencilResolveProperties(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceDepthStencilResolveProperties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceScalarBlockLayoutFeatures(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceScalarBlockLayoutFeatures* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkImageStencilUsageCreateInfo(VulkanHandleMapping* handlemap,
+                                             VkImageStencilUsageCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkSamplerReductionModeCreateInfo(VulkanHandleMapping* handlemap,
+                                                VkSamplerReductionModeCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceSamplerFilterMinmaxProperties(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceSamplerFilterMinmaxProperties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceVulkanMemoryModelFeatures(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceVulkanMemoryModelFeatures* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceImagelessFramebufferFeatures(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceImagelessFramebufferFeatures* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkFramebufferAttachmentImageInfo(VulkanHandleMapping* handlemap,
+                                                VkFramebufferAttachmentImageInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkFramebufferAttachmentsCreateInfo(VulkanHandleMapping* handlemap,
+                                                  VkFramebufferAttachmentsCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pAttachmentImageInfos) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->attachmentImageInfoCount; ++i) {
+                handlemap_VkFramebufferAttachmentImageInfo(
+                    handlemap,
+                    (VkFramebufferAttachmentImageInfo*)(toMap->pAttachmentImageInfos + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkRenderPassAttachmentBeginInfo(VulkanHandleMapping* handlemap,
+                                               VkRenderPassAttachmentBeginInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pAttachments) {
+        handlemap->mapHandles_VkImageView((VkImageView*)toMap->pAttachments,
+                                          toMap->attachmentCount);
+    }
+}
+
+void handlemap_VkPhysicalDeviceUniformBufferStandardLayoutFeatures(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceUniformBufferStandardLayoutFeatures* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkAttachmentReferenceStencilLayout(VulkanHandleMapping* handlemap,
+                                                  VkAttachmentReferenceStencilLayout* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkAttachmentDescriptionStencilLayout(VulkanHandleMapping* handlemap,
+                                                    VkAttachmentDescriptionStencilLayout* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceHostQueryResetFeatures(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceHostQueryResetFeatures* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceTimelineSemaphoreFeatures(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceTimelineSemaphoreFeatures* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceTimelineSemaphoreProperties(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceTimelineSemaphoreProperties* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkSemaphoreTypeCreateInfo(VulkanHandleMapping* handlemap,
+                                         VkSemaphoreTypeCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkTimelineSemaphoreSubmitInfo(VulkanHandleMapping* handlemap,
+                                             VkTimelineSemaphoreSubmitInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkSemaphoreWaitInfo(VulkanHandleMapping* handlemap, VkSemaphoreWaitInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pSemaphores) {
+        handlemap->mapHandles_VkSemaphore((VkSemaphore*)toMap->pSemaphores, toMap->semaphoreCount);
+    }
+}
+
+void handlemap_VkSemaphoreSignalInfo(VulkanHandleMapping* handlemap, VkSemaphoreSignalInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkSemaphore((VkSemaphore*)&toMap->semaphore);
+}
+
+void handlemap_VkPhysicalDeviceBufferDeviceAddressFeatures(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceBufferDeviceAddressFeatures* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkBufferDeviceAddressInfo(VulkanHandleMapping* handlemap,
+                                         VkBufferDeviceAddressInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkBuffer((VkBuffer*)&toMap->buffer);
+}
+
+void handlemap_VkBufferOpaqueCaptureAddressCreateInfo(
+    VulkanHandleMapping* handlemap, VkBufferOpaqueCaptureAddressCreateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkMemoryOpaqueCaptureAddressAllocateInfo(
+    VulkanHandleMapping* handlemap, VkMemoryOpaqueCaptureAddressAllocateInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDeviceMemoryOpaqueCaptureAddressInfo(
+    VulkanHandleMapping* handlemap, VkDeviceMemoryOpaqueCaptureAddressInfo* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkDeviceMemory((VkDeviceMemory*)&toMap->memory);
+}
+
+#endif
+#ifdef VK_KHR_surface
+void handlemap_VkSurfaceCapabilitiesKHR(VulkanHandleMapping* handlemap,
+                                        VkSurfaceCapabilitiesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->currentExtent));
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->minImageExtent));
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->maxImageExtent));
+}
+
+void handlemap_VkSurfaceFormatKHR(VulkanHandleMapping* handlemap, VkSurfaceFormatKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+#endif
+#ifdef VK_KHR_swapchain
+void handlemap_VkSwapchainCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                        VkSwapchainCreateInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&toMap->surface);
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->imageExtent));
+    handlemap->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&toMap->oldSwapchain);
+}
+
+void handlemap_VkPresentInfoKHR(VulkanHandleMapping* handlemap, VkPresentInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pWaitSemaphores) {
+        handlemap->mapHandles_VkSemaphore((VkSemaphore*)toMap->pWaitSemaphores,
+                                          toMap->waitSemaphoreCount);
+    }
+    if (toMap->pSwapchains) {
+        handlemap->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)toMap->pSwapchains,
+                                             toMap->swapchainCount);
+    }
+}
+
+void handlemap_VkImageSwapchainCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                             VkImageSwapchainCreateInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&toMap->swapchain);
+}
+
+void handlemap_VkBindImageMemorySwapchainInfoKHR(VulkanHandleMapping* handlemap,
+                                                 VkBindImageMemorySwapchainInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&toMap->swapchain);
+}
+
+void handlemap_VkAcquireNextImageInfoKHR(VulkanHandleMapping* handlemap,
+                                         VkAcquireNextImageInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&toMap->swapchain);
+    handlemap->mapHandles_VkSemaphore((VkSemaphore*)&toMap->semaphore);
+    handlemap->mapHandles_VkFence((VkFence*)&toMap->fence);
+}
+
+void handlemap_VkDeviceGroupPresentCapabilitiesKHR(VulkanHandleMapping* handlemap,
+                                                   VkDeviceGroupPresentCapabilitiesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDeviceGroupPresentInfoKHR(VulkanHandleMapping* handlemap,
+                                           VkDeviceGroupPresentInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDeviceGroupSwapchainCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                                   VkDeviceGroupSwapchainCreateInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_display
+void handlemap_VkDisplayModeParametersKHR(VulkanHandleMapping* handlemap,
+                                          VkDisplayModeParametersKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->visibleRegion));
+}
+
+void handlemap_VkDisplayModeCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                          VkDisplayModeCreateInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkDisplayModeParametersKHR(handlemap,
+                                         (VkDisplayModeParametersKHR*)(&toMap->parameters));
+}
+
+void handlemap_VkDisplayModePropertiesKHR(VulkanHandleMapping* handlemap,
+                                          VkDisplayModePropertiesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap->mapHandles_VkDisplayModeKHR((VkDisplayModeKHR*)&toMap->displayMode);
+    handlemap_VkDisplayModeParametersKHR(handlemap,
+                                         (VkDisplayModeParametersKHR*)(&toMap->parameters));
+}
+
+void handlemap_VkDisplayPlaneCapabilitiesKHR(VulkanHandleMapping* handlemap,
+                                             VkDisplayPlaneCapabilitiesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkOffset2D(handlemap, (VkOffset2D*)(&toMap->minSrcPosition));
+    handlemap_VkOffset2D(handlemap, (VkOffset2D*)(&toMap->maxSrcPosition));
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->minSrcExtent));
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->maxSrcExtent));
+    handlemap_VkOffset2D(handlemap, (VkOffset2D*)(&toMap->minDstPosition));
+    handlemap_VkOffset2D(handlemap, (VkOffset2D*)(&toMap->maxDstPosition));
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->minDstExtent));
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->maxDstExtent));
+}
+
+void handlemap_VkDisplayPlanePropertiesKHR(VulkanHandleMapping* handlemap,
+                                           VkDisplayPlanePropertiesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap->mapHandles_VkDisplayKHR((VkDisplayKHR*)&toMap->currentDisplay);
+}
+
+void handlemap_VkDisplayPropertiesKHR(VulkanHandleMapping* handlemap,
+                                      VkDisplayPropertiesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap->mapHandles_VkDisplayKHR((VkDisplayKHR*)&toMap->display);
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->physicalDimensions));
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->physicalResolution));
+}
+
+void handlemap_VkDisplaySurfaceCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                             VkDisplaySurfaceCreateInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkDisplayModeKHR((VkDisplayModeKHR*)&toMap->displayMode);
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->imageExtent));
+}
+
+#endif
+#ifdef VK_KHR_display_swapchain
+void handlemap_VkDisplayPresentInfoKHR(VulkanHandleMapping* handlemap,
+                                       VkDisplayPresentInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkRect2D(handlemap, (VkRect2D*)(&toMap->srcRect));
+    handlemap_VkRect2D(handlemap, (VkRect2D*)(&toMap->dstRect));
+}
+
+#endif
+#ifdef VK_KHR_xlib_surface
+void handlemap_VkXlibSurfaceCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                          VkXlibSurfaceCreateInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_xcb_surface
+void handlemap_VkXcbSurfaceCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                         VkXcbSurfaceCreateInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_wayland_surface
+void handlemap_VkWaylandSurfaceCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                             VkWaylandSurfaceCreateInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_android_surface
+void handlemap_VkAndroidSurfaceCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                             VkAndroidSurfaceCreateInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_win32_surface
+void handlemap_VkWin32SurfaceCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                           VkWin32SurfaceCreateInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_sampler_mirror_clamp_to_edge
+#endif
+#ifdef VK_KHR_video_queue
+void handlemap_VkVideoQueueFamilyProperties2KHR(VulkanHandleMapping* handlemap,
+                                                VkVideoQueueFamilyProperties2KHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkVideoProfileKHR(VulkanHandleMapping* handlemap, VkVideoProfileKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkVideoProfilesKHR(VulkanHandleMapping* handlemap, VkVideoProfilesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pProfiles) {
+        handlemap_VkVideoProfileKHR(handlemap, (VkVideoProfileKHR*)(toMap->pProfiles));
+    }
+}
+
+void handlemap_VkVideoCapabilitiesKHR(VulkanHandleMapping* handlemap,
+                                      VkVideoCapabilitiesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->videoPictureExtentGranularity));
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->minExtent));
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->maxExtent));
+}
+
+void handlemap_VkPhysicalDeviceVideoFormatInfoKHR(VulkanHandleMapping* handlemap,
+                                                  VkPhysicalDeviceVideoFormatInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pVideoProfiles) {
+        handlemap_VkVideoProfilesKHR(handlemap, (VkVideoProfilesKHR*)(toMap->pVideoProfiles));
+    }
+}
+
+void handlemap_VkVideoFormatPropertiesKHR(VulkanHandleMapping* handlemap,
+                                          VkVideoFormatPropertiesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkVideoPictureResourceKHR(VulkanHandleMapping* handlemap,
+                                         VkVideoPictureResourceKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkOffset2D(handlemap, (VkOffset2D*)(&toMap->codedOffset));
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->codedExtent));
+    handlemap->mapHandles_VkImageView((VkImageView*)&toMap->imageViewBinding);
+}
+
+void handlemap_VkVideoReferenceSlotKHR(VulkanHandleMapping* handlemap,
+                                       VkVideoReferenceSlotKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pPictureResource) {
+        handlemap_VkVideoPictureResourceKHR(handlemap,
+                                            (VkVideoPictureResourceKHR*)(toMap->pPictureResource));
+    }
+}
+
+void handlemap_VkVideoGetMemoryPropertiesKHR(VulkanHandleMapping* handlemap,
+                                             VkVideoGetMemoryPropertiesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pMemoryRequirements) {
+        handlemap_VkMemoryRequirements2(handlemap,
+                                        (VkMemoryRequirements2*)(toMap->pMemoryRequirements));
+    }
+}
+
+void handlemap_VkVideoBindMemoryKHR(VulkanHandleMapping* handlemap, VkVideoBindMemoryKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkDeviceMemory((VkDeviceMemory*)&toMap->memory);
+}
+
+void handlemap_VkVideoSessionCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                           VkVideoSessionCreateInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pVideoProfile) {
+        handlemap_VkVideoProfileKHR(handlemap, (VkVideoProfileKHR*)(toMap->pVideoProfile));
+    }
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->maxCodedExtent));
+}
+
+void handlemap_VkVideoSessionParametersCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                                     VkVideoSessionParametersCreateInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkVideoSessionParametersKHR(
+        (VkVideoSessionParametersKHR*)&toMap->videoSessionParametersTemplate);
+    handlemap->mapHandles_VkVideoSessionKHR((VkVideoSessionKHR*)&toMap->videoSession);
+}
+
+void handlemap_VkVideoSessionParametersUpdateInfoKHR(VulkanHandleMapping* handlemap,
+                                                     VkVideoSessionParametersUpdateInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkVideoBeginCodingInfoKHR(VulkanHandleMapping* handlemap,
+                                         VkVideoBeginCodingInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkVideoSessionKHR((VkVideoSessionKHR*)&toMap->videoSession);
+    handlemap->mapHandles_VkVideoSessionParametersKHR(
+        (VkVideoSessionParametersKHR*)&toMap->videoSessionParameters);
+    if (toMap) {
+        if (toMap->pReferenceSlots) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->referenceSlotCount; ++i) {
+                handlemap_VkVideoReferenceSlotKHR(
+                    handlemap, (VkVideoReferenceSlotKHR*)(toMap->pReferenceSlots + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkVideoEndCodingInfoKHR(VulkanHandleMapping* handlemap,
+                                       VkVideoEndCodingInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkVideoCodingControlInfoKHR(VulkanHandleMapping* handlemap,
+                                           VkVideoCodingControlInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_video_decode_queue
+void handlemap_VkVideoDecodeInfoKHR(VulkanHandleMapping* handlemap, VkVideoDecodeInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkOffset2D(handlemap, (VkOffset2D*)(&toMap->codedOffset));
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->codedExtent));
+    handlemap->mapHandles_VkBuffer((VkBuffer*)&toMap->srcBuffer);
+    handlemap_VkVideoPictureResourceKHR(handlemap,
+                                        (VkVideoPictureResourceKHR*)(&toMap->dstPictureResource));
+    if (toMap->pSetupReferenceSlot) {
+        handlemap_VkVideoReferenceSlotKHR(handlemap,
+                                          (VkVideoReferenceSlotKHR*)(toMap->pSetupReferenceSlot));
+    }
+    if (toMap) {
+        if (toMap->pReferenceSlots) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->referenceSlotCount; ++i) {
+                handlemap_VkVideoReferenceSlotKHR(
+                    handlemap, (VkVideoReferenceSlotKHR*)(toMap->pReferenceSlots + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_KHR_dynamic_rendering
+void handlemap_VkRenderingAttachmentInfoKHR(VulkanHandleMapping* handlemap,
+                                            VkRenderingAttachmentInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkImageView((VkImageView*)&toMap->imageView);
+    handlemap->mapHandles_VkImageView((VkImageView*)&toMap->resolveImageView);
+    handlemap_VkClearValue(handlemap, (VkClearValue*)(&toMap->clearValue));
+}
+
+void handlemap_VkRenderingInfoKHR(VulkanHandleMapping* handlemap, VkRenderingInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkRect2D(handlemap, (VkRect2D*)(&toMap->renderArea));
+    if (toMap) {
+        if (toMap->pColorAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->colorAttachmentCount; ++i) {
+                handlemap_VkRenderingAttachmentInfoKHR(
+                    handlemap, (VkRenderingAttachmentInfoKHR*)(toMap->pColorAttachments + i));
+            }
+        }
+    }
+    if (toMap->pDepthAttachment) {
+        handlemap_VkRenderingAttachmentInfoKHR(
+            handlemap, (VkRenderingAttachmentInfoKHR*)(toMap->pDepthAttachment));
+    }
+    if (toMap->pStencilAttachment) {
+        handlemap_VkRenderingAttachmentInfoKHR(
+            handlemap, (VkRenderingAttachmentInfoKHR*)(toMap->pStencilAttachment));
+    }
+}
+
+void handlemap_VkPipelineRenderingCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                                VkPipelineRenderingCreateInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceDynamicRenderingFeaturesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceDynamicRenderingFeaturesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkCommandBufferInheritanceRenderingInfoKHR(
+    VulkanHandleMapping* handlemap, VkCommandBufferInheritanceRenderingInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkRenderingFragmentShadingRateAttachmentInfoKHR(
+    VulkanHandleMapping* handlemap, VkRenderingFragmentShadingRateAttachmentInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkImageView((VkImageView*)&toMap->imageView);
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->shadingRateAttachmentTexelSize));
+}
+
+void handlemap_VkRenderingFragmentDensityMapAttachmentInfoEXT(
+    VulkanHandleMapping* handlemap, VkRenderingFragmentDensityMapAttachmentInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkImageView((VkImageView*)&toMap->imageView);
+}
+
+void handlemap_VkAttachmentSampleCountInfoAMD(VulkanHandleMapping* handlemap,
+                                              VkAttachmentSampleCountInfoAMD* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkMultiviewPerViewAttributesInfoNVX(VulkanHandleMapping* handlemap,
+                                                   VkMultiviewPerViewAttributesInfoNVX* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_multiview
+#endif
+#ifdef VK_KHR_get_physical_device_properties2
+#endif
+#ifdef VK_KHR_device_group
+#endif
+#ifdef VK_KHR_shader_draw_parameters
+#endif
+#ifdef VK_KHR_maintenance1
+#endif
+#ifdef VK_KHR_device_group_creation
+#endif
+#ifdef VK_KHR_external_memory_capabilities
+#endif
+#ifdef VK_KHR_external_memory
+#endif
+#ifdef VK_KHR_external_memory_win32
+void handlemap_VkImportMemoryWin32HandleInfoKHR(VulkanHandleMapping* handlemap,
+                                                VkImportMemoryWin32HandleInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkExportMemoryWin32HandleInfoKHR(VulkanHandleMapping* handlemap,
+                                                VkExportMemoryWin32HandleInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkMemoryWin32HandlePropertiesKHR(VulkanHandleMapping* handlemap,
+                                                VkMemoryWin32HandlePropertiesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkMemoryGetWin32HandleInfoKHR(VulkanHandleMapping* handlemap,
+                                             VkMemoryGetWin32HandleInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkDeviceMemory((VkDeviceMemory*)&toMap->memory);
+}
+
+#endif
+#ifdef VK_KHR_external_memory_fd
+void handlemap_VkImportMemoryFdInfoKHR(VulkanHandleMapping* handlemap,
+                                       VkImportMemoryFdInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkMemoryFdPropertiesKHR(VulkanHandleMapping* handlemap,
+                                       VkMemoryFdPropertiesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkMemoryGetFdInfoKHR(VulkanHandleMapping* handlemap, VkMemoryGetFdInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkDeviceMemory((VkDeviceMemory*)&toMap->memory);
+}
+
+#endif
+#ifdef VK_KHR_win32_keyed_mutex
+void handlemap_VkWin32KeyedMutexAcquireReleaseInfoKHR(
+    VulkanHandleMapping* handlemap, VkWin32KeyedMutexAcquireReleaseInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pAcquireSyncs) {
+        handlemap->mapHandles_VkDeviceMemory((VkDeviceMemory*)toMap->pAcquireSyncs,
+                                             toMap->acquireCount);
+    }
+    if (toMap->pReleaseSyncs) {
+        handlemap->mapHandles_VkDeviceMemory((VkDeviceMemory*)toMap->pReleaseSyncs,
+                                             toMap->releaseCount);
+    }
+}
+
+#endif
+#ifdef VK_KHR_external_semaphore_capabilities
+#endif
+#ifdef VK_KHR_external_semaphore
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+void handlemap_VkImportSemaphoreWin32HandleInfoKHR(VulkanHandleMapping* handlemap,
+                                                   VkImportSemaphoreWin32HandleInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkSemaphore((VkSemaphore*)&toMap->semaphore);
+}
+
+void handlemap_VkExportSemaphoreWin32HandleInfoKHR(VulkanHandleMapping* handlemap,
+                                                   VkExportSemaphoreWin32HandleInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkD3D12FenceSubmitInfoKHR(VulkanHandleMapping* handlemap,
+                                         VkD3D12FenceSubmitInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkSemaphoreGetWin32HandleInfoKHR(VulkanHandleMapping* handlemap,
+                                                VkSemaphoreGetWin32HandleInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkSemaphore((VkSemaphore*)&toMap->semaphore);
+}
+
+#endif
+#ifdef VK_KHR_external_semaphore_fd
+void handlemap_VkImportSemaphoreFdInfoKHR(VulkanHandleMapping* handlemap,
+                                          VkImportSemaphoreFdInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkSemaphore((VkSemaphore*)&toMap->semaphore);
+}
+
+void handlemap_VkSemaphoreGetFdInfoKHR(VulkanHandleMapping* handlemap,
+                                       VkSemaphoreGetFdInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkSemaphore((VkSemaphore*)&toMap->semaphore);
+}
+
+#endif
+#ifdef VK_KHR_push_descriptor
+void handlemap_VkPhysicalDevicePushDescriptorPropertiesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDevicePushDescriptorPropertiesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_shader_float16_int8
+#endif
+#ifdef VK_KHR_16bit_storage
+#endif
+#ifdef VK_KHR_incremental_present
+void handlemap_VkRectLayerKHR(VulkanHandleMapping* handlemap, VkRectLayerKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkOffset2D(handlemap, (VkOffset2D*)(&toMap->offset));
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->extent));
+}
+
+void handlemap_VkPresentRegionKHR(VulkanHandleMapping* handlemap, VkPresentRegionKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap) {
+        if (toMap->pRectangles) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->rectangleCount; ++i) {
+                handlemap_VkRectLayerKHR(handlemap, (VkRectLayerKHR*)(toMap->pRectangles + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkPresentRegionsKHR(VulkanHandleMapping* handlemap, VkPresentRegionsKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pRegions) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->swapchainCount; ++i) {
+                handlemap_VkPresentRegionKHR(handlemap, (VkPresentRegionKHR*)(toMap->pRegions + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_KHR_descriptor_update_template
+#endif
+#ifdef VK_KHR_imageless_framebuffer
+#endif
+#ifdef VK_KHR_create_renderpass2
+#endif
+#ifdef VK_KHR_shared_presentable_image
+void handlemap_VkSharedPresentSurfaceCapabilitiesKHR(VulkanHandleMapping* handlemap,
+                                                     VkSharedPresentSurfaceCapabilitiesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_external_fence_capabilities
+#endif
+#ifdef VK_KHR_external_fence
+#endif
+#ifdef VK_KHR_external_fence_win32
+void handlemap_VkImportFenceWin32HandleInfoKHR(VulkanHandleMapping* handlemap,
+                                               VkImportFenceWin32HandleInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkFence((VkFence*)&toMap->fence);
+}
+
+void handlemap_VkExportFenceWin32HandleInfoKHR(VulkanHandleMapping* handlemap,
+                                               VkExportFenceWin32HandleInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkFenceGetWin32HandleInfoKHR(VulkanHandleMapping* handlemap,
+                                            VkFenceGetWin32HandleInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkFence((VkFence*)&toMap->fence);
+}
+
+#endif
+#ifdef VK_KHR_external_fence_fd
+void handlemap_VkImportFenceFdInfoKHR(VulkanHandleMapping* handlemap,
+                                      VkImportFenceFdInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkFence((VkFence*)&toMap->fence);
+}
+
+void handlemap_VkFenceGetFdInfoKHR(VulkanHandleMapping* handlemap, VkFenceGetFdInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkFence((VkFence*)&toMap->fence);
+}
+
+#endif
+#ifdef VK_KHR_performance_query
+void handlemap_VkPhysicalDevicePerformanceQueryFeaturesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDevicePerformanceQueryFeaturesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDevicePerformanceQueryPropertiesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDevicePerformanceQueryPropertiesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPerformanceCounterKHR(VulkanHandleMapping* handlemap,
+                                       VkPerformanceCounterKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPerformanceCounterDescriptionKHR(VulkanHandleMapping* handlemap,
+                                                  VkPerformanceCounterDescriptionKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkQueryPoolPerformanceCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                                   VkQueryPoolPerformanceCreateInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPerformanceCounterResultKHR(VulkanHandleMapping* handlemap,
+                                             VkPerformanceCounterResultKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkAcquireProfilingLockInfoKHR(VulkanHandleMapping* handlemap,
+                                             VkAcquireProfilingLockInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPerformanceQuerySubmitInfoKHR(VulkanHandleMapping* handlemap,
+                                               VkPerformanceQuerySubmitInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_maintenance2
+#endif
+#ifdef VK_KHR_get_surface_capabilities2
+void handlemap_VkPhysicalDeviceSurfaceInfo2KHR(VulkanHandleMapping* handlemap,
+                                               VkPhysicalDeviceSurfaceInfo2KHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&toMap->surface);
+}
+
+void handlemap_VkSurfaceCapabilities2KHR(VulkanHandleMapping* handlemap,
+                                         VkSurfaceCapabilities2KHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkSurfaceCapabilitiesKHR(handlemap,
+                                       (VkSurfaceCapabilitiesKHR*)(&toMap->surfaceCapabilities));
+}
+
+void handlemap_VkSurfaceFormat2KHR(VulkanHandleMapping* handlemap, VkSurfaceFormat2KHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkSurfaceFormatKHR(handlemap, (VkSurfaceFormatKHR*)(&toMap->surfaceFormat));
+}
+
+#endif
+#ifdef VK_KHR_variable_pointers
+#endif
+#ifdef VK_KHR_get_display_properties2
+void handlemap_VkDisplayProperties2KHR(VulkanHandleMapping* handlemap,
+                                       VkDisplayProperties2KHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkDisplayPropertiesKHR(handlemap,
+                                     (VkDisplayPropertiesKHR*)(&toMap->displayProperties));
+}
+
+void handlemap_VkDisplayPlaneProperties2KHR(VulkanHandleMapping* handlemap,
+                                            VkDisplayPlaneProperties2KHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkDisplayPlanePropertiesKHR(
+        handlemap, (VkDisplayPlanePropertiesKHR*)(&toMap->displayPlaneProperties));
+}
+
+void handlemap_VkDisplayModeProperties2KHR(VulkanHandleMapping* handlemap,
+                                           VkDisplayModeProperties2KHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkDisplayModePropertiesKHR(
+        handlemap, (VkDisplayModePropertiesKHR*)(&toMap->displayModeProperties));
+}
+
+void handlemap_VkDisplayPlaneInfo2KHR(VulkanHandleMapping* handlemap,
+                                      VkDisplayPlaneInfo2KHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkDisplayModeKHR((VkDisplayModeKHR*)&toMap->mode);
+}
+
+void handlemap_VkDisplayPlaneCapabilities2KHR(VulkanHandleMapping* handlemap,
+                                              VkDisplayPlaneCapabilities2KHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkDisplayPlaneCapabilitiesKHR(handlemap,
+                                            (VkDisplayPlaneCapabilitiesKHR*)(&toMap->capabilities));
+}
+
+#endif
+#ifdef VK_KHR_dedicated_allocation
+#endif
+#ifdef VK_KHR_storage_buffer_storage_class
+#endif
+#ifdef VK_KHR_relaxed_block_layout
+#endif
+#ifdef VK_KHR_get_memory_requirements2
+#endif
+#ifdef VK_KHR_image_format_list
+#endif
+#ifdef VK_KHR_sampler_ycbcr_conversion
+#endif
+#ifdef VK_KHR_bind_memory2
+#endif
+#ifdef VK_KHR_portability_subset
+void handlemap_VkPhysicalDevicePortabilitySubsetFeaturesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDevicePortabilitySubsetFeaturesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDevicePortabilitySubsetPropertiesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDevicePortabilitySubsetPropertiesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_maintenance3
+#endif
+#ifdef VK_KHR_draw_indirect_count
+#endif
+#ifdef VK_KHR_shader_subgroup_extended_types
+#endif
+#ifdef VK_KHR_8bit_storage
+#endif
+#ifdef VK_KHR_shader_atomic_int64
+#endif
+#ifdef VK_KHR_shader_clock
+void handlemap_VkPhysicalDeviceShaderClockFeaturesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderClockFeaturesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_driver_properties
+#endif
+#ifdef VK_KHR_shader_float_controls
+#endif
+#ifdef VK_KHR_depth_stencil_resolve
+#endif
+#ifdef VK_KHR_swapchain_mutable_format
+#endif
+#ifdef VK_KHR_timeline_semaphore
+#endif
+#ifdef VK_KHR_vulkan_memory_model
+#endif
+#ifdef VK_KHR_shader_terminate_invocation
+void handlemap_VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+void handlemap_VkFragmentShadingRateAttachmentInfoKHR(
+    VulkanHandleMapping* handlemap, VkFragmentShadingRateAttachmentInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pFragmentShadingRateAttachment) {
+        handlemap_VkAttachmentReference2(
+            handlemap, (VkAttachmentReference2*)(toMap->pFragmentShadingRateAttachment));
+    }
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->shadingRateAttachmentTexelSize));
+}
+
+void handlemap_VkPipelineFragmentShadingRateStateCreateInfoKHR(
+    VulkanHandleMapping* handlemap, VkPipelineFragmentShadingRateStateCreateInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->fragmentSize));
+}
+
+void handlemap_VkPhysicalDeviceFragmentShadingRateFeaturesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceFragmentShadingRateFeaturesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceFragmentShadingRatePropertiesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceFragmentShadingRatePropertiesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkExtent2D(handlemap,
+                         (VkExtent2D*)(&toMap->minFragmentShadingRateAttachmentTexelSize));
+    handlemap_VkExtent2D(handlemap,
+                         (VkExtent2D*)(&toMap->maxFragmentShadingRateAttachmentTexelSize));
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->maxFragmentSize));
+}
+
+void handlemap_VkPhysicalDeviceFragmentShadingRateKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceFragmentShadingRateKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->fragmentSize));
+}
+
+#endif
+#ifdef VK_KHR_spirv_1_4
+#endif
+#ifdef VK_KHR_surface_protected_capabilities
+void handlemap_VkSurfaceProtectedCapabilitiesKHR(VulkanHandleMapping* handlemap,
+                                                 VkSurfaceProtectedCapabilitiesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_separate_depth_stencil_layouts
+#endif
+#ifdef VK_KHR_present_wait
+void handlemap_VkPhysicalDevicePresentWaitFeaturesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDevicePresentWaitFeaturesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_uniform_buffer_standard_layout
+#endif
+#ifdef VK_KHR_buffer_device_address
+#endif
+#ifdef VK_KHR_deferred_host_operations
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+void handlemap_VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR(
+    VulkanHandleMapping* handlemap,
+    VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPipelineInfoKHR(VulkanHandleMapping* handlemap, VkPipelineInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkPipeline((VkPipeline*)&toMap->pipeline);
+}
+
+void handlemap_VkPipelineExecutablePropertiesKHR(VulkanHandleMapping* handlemap,
+                                                 VkPipelineExecutablePropertiesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPipelineExecutableInfoKHR(VulkanHandleMapping* handlemap,
+                                           VkPipelineExecutableInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkPipeline((VkPipeline*)&toMap->pipeline);
+}
+
+void handlemap_VkPipelineExecutableStatisticValueKHR(VulkanHandleMapping* handlemap,
+                                                     VkPipelineExecutableStatisticValueKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkPipelineExecutableStatisticKHR(VulkanHandleMapping* handlemap,
+                                                VkPipelineExecutableStatisticKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkPipelineExecutableStatisticValueKHR(
+        handlemap, (VkPipelineExecutableStatisticValueKHR*)(&toMap->value));
+}
+
+void handlemap_VkPipelineExecutableInternalRepresentationKHR(
+    VulkanHandleMapping* handlemap, VkPipelineExecutableInternalRepresentationKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_shader_integer_dot_product
+void handlemap_VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_pipeline_library
+void handlemap_VkPipelineLibraryCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                              VkPipelineLibraryCreateInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pLibraries) {
+        handlemap->mapHandles_VkPipeline((VkPipeline*)toMap->pLibraries, toMap->libraryCount);
+    }
+}
+
+#endif
+#ifdef VK_KHR_shader_non_semantic_info
+#endif
+#ifdef VK_KHR_present_id
+void handlemap_VkPresentIdKHR(VulkanHandleMapping* handlemap, VkPresentIdKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDevicePresentIdFeaturesKHR(VulkanHandleMapping* handlemap,
+                                                    VkPhysicalDevicePresentIdFeaturesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_video_encode_queue
+void handlemap_VkVideoEncodeInfoKHR(VulkanHandleMapping* handlemap, VkVideoEncodeInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->codedExtent));
+    handlemap->mapHandles_VkBuffer((VkBuffer*)&toMap->dstBitstreamBuffer);
+    handlemap_VkVideoPictureResourceKHR(handlemap,
+                                        (VkVideoPictureResourceKHR*)(&toMap->srcPictureResource));
+    if (toMap->pSetupReferenceSlot) {
+        handlemap_VkVideoReferenceSlotKHR(handlemap,
+                                          (VkVideoReferenceSlotKHR*)(toMap->pSetupReferenceSlot));
+    }
+    if (toMap) {
+        if (toMap->pReferenceSlots) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->referenceSlotCount; ++i) {
+                handlemap_VkVideoReferenceSlotKHR(
+                    handlemap, (VkVideoReferenceSlotKHR*)(toMap->pReferenceSlots + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkVideoEncodeRateControlInfoKHR(VulkanHandleMapping* handlemap,
+                                               VkVideoEncodeRateControlInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_synchronization2
+void handlemap_VkMemoryBarrier2KHR(VulkanHandleMapping* handlemap, VkMemoryBarrier2KHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkBufferMemoryBarrier2KHR(VulkanHandleMapping* handlemap,
+                                         VkBufferMemoryBarrier2KHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkBuffer((VkBuffer*)&toMap->buffer);
+}
+
+void handlemap_VkImageMemoryBarrier2KHR(VulkanHandleMapping* handlemap,
+                                        VkImageMemoryBarrier2KHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkImage((VkImage*)&toMap->image);
+    handlemap_VkImageSubresourceRange(handlemap,
+                                      (VkImageSubresourceRange*)(&toMap->subresourceRange));
+}
+
+void handlemap_VkDependencyInfoKHR(VulkanHandleMapping* handlemap, VkDependencyInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pMemoryBarriers) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->memoryBarrierCount; ++i) {
+                handlemap_VkMemoryBarrier2KHR(handlemap,
+                                              (VkMemoryBarrier2KHR*)(toMap->pMemoryBarriers + i));
+            }
+        }
+    }
+    if (toMap) {
+        if (toMap->pBufferMemoryBarriers) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->bufferMemoryBarrierCount; ++i) {
+                handlemap_VkBufferMemoryBarrier2KHR(
+                    handlemap, (VkBufferMemoryBarrier2KHR*)(toMap->pBufferMemoryBarriers + i));
+            }
+        }
+    }
+    if (toMap) {
+        if (toMap->pImageMemoryBarriers) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->imageMemoryBarrierCount; ++i) {
+                handlemap_VkImageMemoryBarrier2KHR(
+                    handlemap, (VkImageMemoryBarrier2KHR*)(toMap->pImageMemoryBarriers + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkSemaphoreSubmitInfoKHR(VulkanHandleMapping* handlemap,
+                                        VkSemaphoreSubmitInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkSemaphore((VkSemaphore*)&toMap->semaphore);
+}
+
+void handlemap_VkCommandBufferSubmitInfoKHR(VulkanHandleMapping* handlemap,
+                                            VkCommandBufferSubmitInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkCommandBuffer((VkCommandBuffer*)&toMap->commandBuffer);
+}
+
+void handlemap_VkSubmitInfo2KHR(VulkanHandleMapping* handlemap, VkSubmitInfo2KHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pWaitSemaphoreInfos) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->waitSemaphoreInfoCount; ++i) {
+                handlemap_VkSemaphoreSubmitInfoKHR(
+                    handlemap, (VkSemaphoreSubmitInfoKHR*)(toMap->pWaitSemaphoreInfos + i));
+            }
+        }
+    }
+    if (toMap) {
+        if (toMap->pCommandBufferInfos) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->commandBufferInfoCount; ++i) {
+                handlemap_VkCommandBufferSubmitInfoKHR(
+                    handlemap, (VkCommandBufferSubmitInfoKHR*)(toMap->pCommandBufferInfos + i));
+            }
+        }
+    }
+    if (toMap) {
+        if (toMap->pSignalSemaphoreInfos) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->signalSemaphoreInfoCount; ++i) {
+                handlemap_VkSemaphoreSubmitInfoKHR(
+                    handlemap, (VkSemaphoreSubmitInfoKHR*)(toMap->pSignalSemaphoreInfos + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkPhysicalDeviceSynchronization2FeaturesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceSynchronization2FeaturesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkQueueFamilyCheckpointProperties2NV(VulkanHandleMapping* handlemap,
+                                                    VkQueueFamilyCheckpointProperties2NV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkCheckpointData2NV(VulkanHandleMapping* handlemap, VkCheckpointData2NV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_shader_subgroup_uniform_control_flow
+void handlemap_VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR(
+    VulkanHandleMapping* handlemap,
+    VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_zero_initialize_workgroup_memory
+void handlemap_VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR(
+    VulkanHandleMapping* handlemap,
+    VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_workgroup_memory_explicit_layout
+void handlemap_VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR(
+    VulkanHandleMapping* handlemap,
+    VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_copy_commands2
+void handlemap_VkBufferCopy2KHR(VulkanHandleMapping* handlemap, VkBufferCopy2KHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkCopyBufferInfo2KHR(VulkanHandleMapping* handlemap, VkCopyBufferInfo2KHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkBuffer((VkBuffer*)&toMap->srcBuffer);
+    handlemap->mapHandles_VkBuffer((VkBuffer*)&toMap->dstBuffer);
+    if (toMap) {
+        if (toMap->pRegions) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->regionCount; ++i) {
+                handlemap_VkBufferCopy2KHR(handlemap, (VkBufferCopy2KHR*)(toMap->pRegions + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkImageCopy2KHR(VulkanHandleMapping* handlemap, VkImageCopy2KHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkImageSubresourceLayers(handlemap,
+                                       (VkImageSubresourceLayers*)(&toMap->srcSubresource));
+    handlemap_VkOffset3D(handlemap, (VkOffset3D*)(&toMap->srcOffset));
+    handlemap_VkImageSubresourceLayers(handlemap,
+                                       (VkImageSubresourceLayers*)(&toMap->dstSubresource));
+    handlemap_VkOffset3D(handlemap, (VkOffset3D*)(&toMap->dstOffset));
+    handlemap_VkExtent3D(handlemap, (VkExtent3D*)(&toMap->extent));
+}
+
+void handlemap_VkCopyImageInfo2KHR(VulkanHandleMapping* handlemap, VkCopyImageInfo2KHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkImage((VkImage*)&toMap->srcImage);
+    handlemap->mapHandles_VkImage((VkImage*)&toMap->dstImage);
+    if (toMap) {
+        if (toMap->pRegions) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->regionCount; ++i) {
+                handlemap_VkImageCopy2KHR(handlemap, (VkImageCopy2KHR*)(toMap->pRegions + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkBufferImageCopy2KHR(VulkanHandleMapping* handlemap, VkBufferImageCopy2KHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkImageSubresourceLayers(handlemap,
+                                       (VkImageSubresourceLayers*)(&toMap->imageSubresource));
+    handlemap_VkOffset3D(handlemap, (VkOffset3D*)(&toMap->imageOffset));
+    handlemap_VkExtent3D(handlemap, (VkExtent3D*)(&toMap->imageExtent));
+}
+
+void handlemap_VkCopyBufferToImageInfo2KHR(VulkanHandleMapping* handlemap,
+                                           VkCopyBufferToImageInfo2KHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkBuffer((VkBuffer*)&toMap->srcBuffer);
+    handlemap->mapHandles_VkImage((VkImage*)&toMap->dstImage);
+    if (toMap) {
+        if (toMap->pRegions) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->regionCount; ++i) {
+                handlemap_VkBufferImageCopy2KHR(handlemap,
+                                                (VkBufferImageCopy2KHR*)(toMap->pRegions + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkCopyImageToBufferInfo2KHR(VulkanHandleMapping* handlemap,
+                                           VkCopyImageToBufferInfo2KHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkImage((VkImage*)&toMap->srcImage);
+    handlemap->mapHandles_VkBuffer((VkBuffer*)&toMap->dstBuffer);
+    if (toMap) {
+        if (toMap->pRegions) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->regionCount; ++i) {
+                handlemap_VkBufferImageCopy2KHR(handlemap,
+                                                (VkBufferImageCopy2KHR*)(toMap->pRegions + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkImageBlit2KHR(VulkanHandleMapping* handlemap, VkImageBlit2KHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkImageSubresourceLayers(handlemap,
+                                       (VkImageSubresourceLayers*)(&toMap->srcSubresource));
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        handlemap_VkOffset3D(handlemap, (VkOffset3D*)(toMap->srcOffsets + i));
+    }
+    handlemap_VkImageSubresourceLayers(handlemap,
+                                       (VkImageSubresourceLayers*)(&toMap->dstSubresource));
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        handlemap_VkOffset3D(handlemap, (VkOffset3D*)(toMap->dstOffsets + i));
+    }
+}
+
+void handlemap_VkBlitImageInfo2KHR(VulkanHandleMapping* handlemap, VkBlitImageInfo2KHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkImage((VkImage*)&toMap->srcImage);
+    handlemap->mapHandles_VkImage((VkImage*)&toMap->dstImage);
+    if (toMap) {
+        if (toMap->pRegions) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->regionCount; ++i) {
+                handlemap_VkImageBlit2KHR(handlemap, (VkImageBlit2KHR*)(toMap->pRegions + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkImageResolve2KHR(VulkanHandleMapping* handlemap, VkImageResolve2KHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkImageSubresourceLayers(handlemap,
+                                       (VkImageSubresourceLayers*)(&toMap->srcSubresource));
+    handlemap_VkOffset3D(handlemap, (VkOffset3D*)(&toMap->srcOffset));
+    handlemap_VkImageSubresourceLayers(handlemap,
+                                       (VkImageSubresourceLayers*)(&toMap->dstSubresource));
+    handlemap_VkOffset3D(handlemap, (VkOffset3D*)(&toMap->dstOffset));
+    handlemap_VkExtent3D(handlemap, (VkExtent3D*)(&toMap->extent));
+}
+
+void handlemap_VkResolveImageInfo2KHR(VulkanHandleMapping* handlemap,
+                                      VkResolveImageInfo2KHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkImage((VkImage*)&toMap->srcImage);
+    handlemap->mapHandles_VkImage((VkImage*)&toMap->dstImage);
+    if (toMap) {
+        if (toMap->pRegions) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->regionCount; ++i) {
+                handlemap_VkImageResolve2KHR(handlemap, (VkImageResolve2KHR*)(toMap->pRegions + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_KHR_format_feature_flags2
+void handlemap_VkFormatProperties3KHR(VulkanHandleMapping* handlemap,
+                                      VkFormatProperties3KHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_maintenance4
+void handlemap_VkPhysicalDeviceMaintenance4FeaturesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceMaintenance4FeaturesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceMaintenance4PropertiesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceMaintenance4PropertiesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDeviceBufferMemoryRequirementsKHR(VulkanHandleMapping* handlemap,
+                                                   VkDeviceBufferMemoryRequirementsKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pCreateInfo) {
+        handlemap_VkBufferCreateInfo(handlemap, (VkBufferCreateInfo*)(toMap->pCreateInfo));
+    }
+}
+
+void handlemap_VkDeviceImageMemoryRequirementsKHR(VulkanHandleMapping* handlemap,
+                                                  VkDeviceImageMemoryRequirementsKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pCreateInfo) {
+        handlemap_VkImageCreateInfo(handlemap, (VkImageCreateInfo*)(toMap->pCreateInfo));
+    }
+}
+
+#endif
+#ifdef VK_ANDROID_native_buffer
+void handlemap_VkNativeBufferANDROID(VulkanHandleMapping* handlemap, VkNativeBufferANDROID* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_debug_report
+void handlemap_VkDebugReportCallbackCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                                  VkDebugReportCallbackCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_glsl_shader
+#endif
+#ifdef VK_EXT_depth_range_unrestricted
+#endif
+#ifdef VK_IMG_filter_cubic
+#endif
+#ifdef VK_AMD_rasterization_order
+void handlemap_VkPipelineRasterizationStateRasterizationOrderAMD(
+    VulkanHandleMapping* handlemap, VkPipelineRasterizationStateRasterizationOrderAMD* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_shader_trinary_minmax
+#endif
+#ifdef VK_AMD_shader_explicit_vertex_parameter
+#endif
+#ifdef VK_EXT_debug_marker
+void handlemap_VkDebugMarkerObjectNameInfoEXT(VulkanHandleMapping* handlemap,
+                                              VkDebugMarkerObjectNameInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDebugMarkerObjectTagInfoEXT(VulkanHandleMapping* handlemap,
+                                             VkDebugMarkerObjectTagInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDebugMarkerMarkerInfoEXT(VulkanHandleMapping* handlemap,
+                                          VkDebugMarkerMarkerInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_gcn_shader
+#endif
+#ifdef VK_NV_dedicated_allocation
+void handlemap_VkDedicatedAllocationImageCreateInfoNV(
+    VulkanHandleMapping* handlemap, VkDedicatedAllocationImageCreateInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDedicatedAllocationBufferCreateInfoNV(
+    VulkanHandleMapping* handlemap, VkDedicatedAllocationBufferCreateInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDedicatedAllocationMemoryAllocateInfoNV(
+    VulkanHandleMapping* handlemap, VkDedicatedAllocationMemoryAllocateInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkImage((VkImage*)&toMap->image);
+    handlemap->mapHandles_VkBuffer((VkBuffer*)&toMap->buffer);
+}
+
+#endif
+#ifdef VK_EXT_transform_feedback
+void handlemap_VkPhysicalDeviceTransformFeedbackFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceTransformFeedbackFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceTransformFeedbackPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceTransformFeedbackPropertiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPipelineRasterizationStateStreamCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkPipelineRasterizationStateStreamCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NVX_binary_import
+void handlemap_VkCuModuleCreateInfoNVX(VulkanHandleMapping* handlemap,
+                                       VkCuModuleCreateInfoNVX* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkCuFunctionCreateInfoNVX(VulkanHandleMapping* handlemap,
+                                         VkCuFunctionCreateInfoNVX* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkCuModuleNVX((VkCuModuleNVX*)&toMap->module);
+}
+
+void handlemap_VkCuLaunchInfoNVX(VulkanHandleMapping* handlemap, VkCuLaunchInfoNVX* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkCuFunctionNVX((VkCuFunctionNVX*)&toMap->function);
+}
+
+#endif
+#ifdef VK_NVX_image_view_handle
+void handlemap_VkImageViewHandleInfoNVX(VulkanHandleMapping* handlemap,
+                                        VkImageViewHandleInfoNVX* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkImageView((VkImageView*)&toMap->imageView);
+    handlemap->mapHandles_VkSampler((VkSampler*)&toMap->sampler);
+}
+
+void handlemap_VkImageViewAddressPropertiesNVX(VulkanHandleMapping* handlemap,
+                                               VkImageViewAddressPropertiesNVX* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_draw_indirect_count
+#endif
+#ifdef VK_AMD_negative_viewport_height
+#endif
+#ifdef VK_AMD_gpu_shader_half_float
+#endif
+#ifdef VK_AMD_shader_ballot
+#endif
+#ifdef VK_EXT_video_encode_h264
+void handlemap_VkVideoEncodeH264CapabilitiesEXT(VulkanHandleMapping* handlemap,
+                                                VkVideoEncodeH264CapabilitiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->minPictureSizeInMbs));
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->maxPictureSizeInMbs));
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->inputImageDataAlignment));
+    handlemap_VkExtensionProperties(handlemap,
+                                    (VkExtensionProperties*)(&toMap->stdExtensionVersion));
+}
+
+void handlemap_VkVideoEncodeH264SessionCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                                     VkVideoEncodeH264SessionCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->maxPictureSizeInMbs));
+    if (toMap->pStdExtensionVersion) {
+        handlemap_VkExtensionProperties(handlemap,
+                                        (VkExtensionProperties*)(toMap->pStdExtensionVersion));
+    }
+}
+
+void handlemap_VkVideoEncodeH264SessionParametersAddInfoEXT(
+    VulkanHandleMapping* handlemap, VkVideoEncodeH264SessionParametersAddInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkVideoEncodeH264SessionParametersCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkVideoEncodeH264SessionParametersCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pParametersAddInfo) {
+        handlemap_VkVideoEncodeH264SessionParametersAddInfoEXT(
+            handlemap, (VkVideoEncodeH264SessionParametersAddInfoEXT*)(toMap->pParametersAddInfo));
+    }
+}
+
+void handlemap_VkVideoEncodeH264DpbSlotInfoEXT(VulkanHandleMapping* handlemap,
+                                               VkVideoEncodeH264DpbSlotInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkVideoEncodeH264NaluSliceEXT(VulkanHandleMapping* handlemap,
+                                             VkVideoEncodeH264NaluSliceEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pRefFinalList0Entries) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->refFinalList0EntryCount; ++i) {
+                handlemap_VkVideoEncodeH264DpbSlotInfoEXT(
+                    handlemap,
+                    (VkVideoEncodeH264DpbSlotInfoEXT*)(toMap->pRefFinalList0Entries + i));
+            }
+        }
+    }
+    if (toMap) {
+        if (toMap->pRefFinalList1Entries) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->refFinalList1EntryCount; ++i) {
+                handlemap_VkVideoEncodeH264DpbSlotInfoEXT(
+                    handlemap,
+                    (VkVideoEncodeH264DpbSlotInfoEXT*)(toMap->pRefFinalList1Entries + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkVideoEncodeH264VclFrameInfoEXT(VulkanHandleMapping* handlemap,
+                                                VkVideoEncodeH264VclFrameInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pRefDefaultFinalList0Entries) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->refDefaultFinalList0EntryCount; ++i) {
+                handlemap_VkVideoEncodeH264DpbSlotInfoEXT(
+                    handlemap,
+                    (VkVideoEncodeH264DpbSlotInfoEXT*)(toMap->pRefDefaultFinalList0Entries + i));
+            }
+        }
+    }
+    if (toMap) {
+        if (toMap->pRefDefaultFinalList1Entries) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->refDefaultFinalList1EntryCount; ++i) {
+                handlemap_VkVideoEncodeH264DpbSlotInfoEXT(
+                    handlemap,
+                    (VkVideoEncodeH264DpbSlotInfoEXT*)(toMap->pRefDefaultFinalList1Entries + i));
+            }
+        }
+    }
+    if (toMap) {
+        if (toMap->pNaluSliceEntries) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->naluSliceEntryCount; ++i) {
+                handlemap_VkVideoEncodeH264NaluSliceEXT(
+                    handlemap, (VkVideoEncodeH264NaluSliceEXT*)(toMap->pNaluSliceEntries + i));
+            }
+        }
+    }
+    if (toMap->pCurrentPictureInfo) {
+        handlemap_VkVideoEncodeH264DpbSlotInfoEXT(
+            handlemap, (VkVideoEncodeH264DpbSlotInfoEXT*)(toMap->pCurrentPictureInfo));
+    }
+}
+
+void handlemap_VkVideoEncodeH264EmitPictureParametersEXT(
+    VulkanHandleMapping* handlemap, VkVideoEncodeH264EmitPictureParametersEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkVideoEncodeH264ProfileEXT(VulkanHandleMapping* handlemap,
+                                           VkVideoEncodeH264ProfileEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_video_encode_h265
+void handlemap_VkVideoEncodeH265CapabilitiesEXT(VulkanHandleMapping* handlemap,
+                                                VkVideoEncodeH265CapabilitiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->inputImageDataAlignment));
+    handlemap_VkExtensionProperties(handlemap,
+                                    (VkExtensionProperties*)(&toMap->stdExtensionVersion));
+}
+
+void handlemap_VkVideoEncodeH265SessionCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                                     VkVideoEncodeH265SessionCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pStdExtensionVersion) {
+        handlemap_VkExtensionProperties(handlemap,
+                                        (VkExtensionProperties*)(toMap->pStdExtensionVersion));
+    }
+}
+
+void handlemap_VkVideoEncodeH265SessionParametersAddInfoEXT(
+    VulkanHandleMapping* handlemap, VkVideoEncodeH265SessionParametersAddInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkVideoEncodeH265SessionParametersCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkVideoEncodeH265SessionParametersCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pParametersAddInfo) {
+        handlemap_VkVideoEncodeH265SessionParametersAddInfoEXT(
+            handlemap, (VkVideoEncodeH265SessionParametersAddInfoEXT*)(toMap->pParametersAddInfo));
+    }
+}
+
+void handlemap_VkVideoEncodeH265DpbSlotInfoEXT(VulkanHandleMapping* handlemap,
+                                               VkVideoEncodeH265DpbSlotInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkVideoEncodeH265ReferenceListsEXT(VulkanHandleMapping* handlemap,
+                                                  VkVideoEncodeH265ReferenceListsEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pReferenceList0Entries) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->referenceList0EntryCount; ++i) {
+                handlemap_VkVideoEncodeH265DpbSlotInfoEXT(
+                    handlemap,
+                    (VkVideoEncodeH265DpbSlotInfoEXT*)(toMap->pReferenceList0Entries + i));
+            }
+        }
+    }
+    if (toMap) {
+        if (toMap->pReferenceList1Entries) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->referenceList1EntryCount; ++i) {
+                handlemap_VkVideoEncodeH265DpbSlotInfoEXT(
+                    handlemap,
+                    (VkVideoEncodeH265DpbSlotInfoEXT*)(toMap->pReferenceList1Entries + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkVideoEncodeH265NaluSliceEXT(VulkanHandleMapping* handlemap,
+                                             VkVideoEncodeH265NaluSliceEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pReferenceFinalLists) {
+        handlemap_VkVideoEncodeH265ReferenceListsEXT(
+            handlemap, (VkVideoEncodeH265ReferenceListsEXT*)(toMap->pReferenceFinalLists));
+    }
+}
+
+void handlemap_VkVideoEncodeH265VclFrameInfoEXT(VulkanHandleMapping* handlemap,
+                                                VkVideoEncodeH265VclFrameInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pReferenceFinalLists) {
+        handlemap_VkVideoEncodeH265ReferenceListsEXT(
+            handlemap, (VkVideoEncodeH265ReferenceListsEXT*)(toMap->pReferenceFinalLists));
+    }
+    if (toMap) {
+        if (toMap->pNaluSliceEntries) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->naluSliceEntryCount; ++i) {
+                handlemap_VkVideoEncodeH265NaluSliceEXT(
+                    handlemap, (VkVideoEncodeH265NaluSliceEXT*)(toMap->pNaluSliceEntries + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkVideoEncodeH265EmitPictureParametersEXT(
+    VulkanHandleMapping* handlemap, VkVideoEncodeH265EmitPictureParametersEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkVideoEncodeH265ProfileEXT(VulkanHandleMapping* handlemap,
+                                           VkVideoEncodeH265ProfileEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_video_decode_h264
+void handlemap_VkVideoDecodeH264ProfileEXT(VulkanHandleMapping* handlemap,
+                                           VkVideoDecodeH264ProfileEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkVideoDecodeH264CapabilitiesEXT(VulkanHandleMapping* handlemap,
+                                                VkVideoDecodeH264CapabilitiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkOffset2D(handlemap, (VkOffset2D*)(&toMap->fieldOffsetGranularity));
+    handlemap_VkExtensionProperties(handlemap,
+                                    (VkExtensionProperties*)(&toMap->stdExtensionVersion));
+}
+
+void handlemap_VkVideoDecodeH264SessionCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                                     VkVideoDecodeH264SessionCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pStdExtensionVersion) {
+        handlemap_VkExtensionProperties(handlemap,
+                                        (VkExtensionProperties*)(toMap->pStdExtensionVersion));
+    }
+}
+
+void handlemap_VkVideoDecodeH264SessionParametersAddInfoEXT(
+    VulkanHandleMapping* handlemap, VkVideoDecodeH264SessionParametersAddInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkVideoDecodeH264SessionParametersCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkVideoDecodeH264SessionParametersCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pParametersAddInfo) {
+        handlemap_VkVideoDecodeH264SessionParametersAddInfoEXT(
+            handlemap, (VkVideoDecodeH264SessionParametersAddInfoEXT*)(toMap->pParametersAddInfo));
+    }
+}
+
+void handlemap_VkVideoDecodeH264PictureInfoEXT(VulkanHandleMapping* handlemap,
+                                               VkVideoDecodeH264PictureInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkVideoDecodeH264MvcEXT(VulkanHandleMapping* handlemap,
+                                       VkVideoDecodeH264MvcEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkVideoDecodeH264DpbSlotInfoEXT(VulkanHandleMapping* handlemap,
+                                               VkVideoDecodeH264DpbSlotInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_texture_gather_bias_lod
+void handlemap_VkTextureLODGatherFormatPropertiesAMD(VulkanHandleMapping* handlemap,
+                                                     VkTextureLODGatherFormatPropertiesAMD* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_shader_info
+void handlemap_VkShaderResourceUsageAMD(VulkanHandleMapping* handlemap,
+                                        VkShaderResourceUsageAMD* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkShaderStatisticsInfoAMD(VulkanHandleMapping* handlemap,
+                                         VkShaderStatisticsInfoAMD* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkShaderResourceUsageAMD(handlemap,
+                                       (VkShaderResourceUsageAMD*)(&toMap->resourceUsage));
+}
+
+#endif
+#ifdef VK_AMD_shader_image_load_store_lod
+#endif
+#ifdef VK_GGP_stream_descriptor_surface
+void handlemap_VkStreamDescriptorSurfaceCreateInfoGGP(
+    VulkanHandleMapping* handlemap, VkStreamDescriptorSurfaceCreateInfoGGP* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_corner_sampled_image
+void handlemap_VkPhysicalDeviceCornerSampledImageFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceCornerSampledImageFeaturesNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_IMG_format_pvrtc
+#endif
+#ifdef VK_NV_external_memory_capabilities
+void handlemap_VkExternalImageFormatPropertiesNV(VulkanHandleMapping* handlemap,
+                                                 VkExternalImageFormatPropertiesNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkImageFormatProperties(handlemap,
+                                      (VkImageFormatProperties*)(&toMap->imageFormatProperties));
+}
+
+#endif
+#ifdef VK_NV_external_memory
+void handlemap_VkExternalMemoryImageCreateInfoNV(VulkanHandleMapping* handlemap,
+                                                 VkExternalMemoryImageCreateInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkExportMemoryAllocateInfoNV(VulkanHandleMapping* handlemap,
+                                            VkExportMemoryAllocateInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_external_memory_win32
+void handlemap_VkImportMemoryWin32HandleInfoNV(VulkanHandleMapping* handlemap,
+                                               VkImportMemoryWin32HandleInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkExportMemoryWin32HandleInfoNV(VulkanHandleMapping* handlemap,
+                                               VkExportMemoryWin32HandleInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_win32_keyed_mutex
+void handlemap_VkWin32KeyedMutexAcquireReleaseInfoNV(VulkanHandleMapping* handlemap,
+                                                     VkWin32KeyedMutexAcquireReleaseInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pAcquireSyncs) {
+        handlemap->mapHandles_VkDeviceMemory((VkDeviceMemory*)toMap->pAcquireSyncs,
+                                             toMap->acquireCount);
+    }
+    if (toMap->pReleaseSyncs) {
+        handlemap->mapHandles_VkDeviceMemory((VkDeviceMemory*)toMap->pReleaseSyncs,
+                                             toMap->releaseCount);
+    }
+}
+
+#endif
+#ifdef VK_EXT_validation_flags
+void handlemap_VkValidationFlagsEXT(VulkanHandleMapping* handlemap, VkValidationFlagsEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NN_vi_surface
+void handlemap_VkViSurfaceCreateInfoNN(VulkanHandleMapping* handlemap,
+                                       VkViSurfaceCreateInfoNN* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_shader_subgroup_ballot
+#endif
+#ifdef VK_EXT_shader_subgroup_vote
+#endif
+#ifdef VK_EXT_texture_compression_astc_hdr
+void handlemap_VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_astc_decode_mode
+void handlemap_VkImageViewASTCDecodeModeEXT(VulkanHandleMapping* handlemap,
+                                            VkImageViewASTCDecodeModeEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceASTCDecodeFeaturesEXT(VulkanHandleMapping* handlemap,
+                                                     VkPhysicalDeviceASTCDecodeFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_conditional_rendering
+void handlemap_VkConditionalRenderingBeginInfoEXT(VulkanHandleMapping* handlemap,
+                                                  VkConditionalRenderingBeginInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkBuffer((VkBuffer*)&toMap->buffer);
+}
+
+void handlemap_VkPhysicalDeviceConditionalRenderingFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceConditionalRenderingFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkCommandBufferInheritanceConditionalRenderingInfoEXT(
+    VulkanHandleMapping* handlemap, VkCommandBufferInheritanceConditionalRenderingInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+void handlemap_VkViewportWScalingNV(VulkanHandleMapping* handlemap, VkViewportWScalingNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkPipelineViewportWScalingStateCreateInfoNV(
+    VulkanHandleMapping* handlemap, VkPipelineViewportWScalingStateCreateInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pViewportWScalings) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->viewportCount; ++i) {
+                handlemap_VkViewportWScalingNV(
+                    handlemap, (VkViewportWScalingNV*)(toMap->pViewportWScalings + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_EXT_direct_mode_display
+#endif
+#ifdef VK_EXT_acquire_xlib_display
+#endif
+#ifdef VK_EXT_display_surface_counter
+void handlemap_VkSurfaceCapabilities2EXT(VulkanHandleMapping* handlemap,
+                                         VkSurfaceCapabilities2EXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->currentExtent));
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->minImageExtent));
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->maxImageExtent));
+}
+
+#endif
+#ifdef VK_EXT_display_control
+void handlemap_VkDisplayPowerInfoEXT(VulkanHandleMapping* handlemap, VkDisplayPowerInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDeviceEventInfoEXT(VulkanHandleMapping* handlemap, VkDeviceEventInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDisplayEventInfoEXT(VulkanHandleMapping* handlemap, VkDisplayEventInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkSwapchainCounterCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                               VkSwapchainCounterCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_GOOGLE_display_timing
+void handlemap_VkRefreshCycleDurationGOOGLE(VulkanHandleMapping* handlemap,
+                                            VkRefreshCycleDurationGOOGLE* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkPastPresentationTimingGOOGLE(VulkanHandleMapping* handlemap,
+                                              VkPastPresentationTimingGOOGLE* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkPresentTimeGOOGLE(VulkanHandleMapping* handlemap, VkPresentTimeGOOGLE* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkPresentTimesInfoGOOGLE(VulkanHandleMapping* handlemap,
+                                        VkPresentTimesInfoGOOGLE* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pTimes) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->swapchainCount; ++i) {
+                handlemap_VkPresentTimeGOOGLE(handlemap, (VkPresentTimeGOOGLE*)(toMap->pTimes + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_NV_sample_mask_override_coverage
+#endif
+#ifdef VK_NV_geometry_shader_passthrough
+#endif
+#ifdef VK_NV_viewport_array2
+#endif
+#ifdef VK_NVX_multiview_per_view_attributes
+void handlemap_VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX(
+    VulkanHandleMapping* handlemap,
+    VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_viewport_swizzle
+void handlemap_VkViewportSwizzleNV(VulkanHandleMapping* handlemap, VkViewportSwizzleNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkPipelineViewportSwizzleStateCreateInfoNV(
+    VulkanHandleMapping* handlemap, VkPipelineViewportSwizzleStateCreateInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pViewportSwizzles) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->viewportCount; ++i) {
+                handlemap_VkViewportSwizzleNV(handlemap,
+                                              (VkViewportSwizzleNV*)(toMap->pViewportSwizzles + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_EXT_discard_rectangles
+void handlemap_VkPhysicalDeviceDiscardRectanglePropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceDiscardRectanglePropertiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPipelineDiscardRectangleStateCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkPipelineDiscardRectangleStateCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pDiscardRectangles) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->discardRectangleCount; ++i) {
+                handlemap_VkRect2D(handlemap, (VkRect2D*)(toMap->pDiscardRectangles + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_EXT_conservative_rasterization
+void handlemap_VkPhysicalDeviceConservativeRasterizationPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceConservativeRasterizationPropertiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPipelineRasterizationConservativeStateCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkPipelineRasterizationConservativeStateCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_depth_clip_enable
+void handlemap_VkPhysicalDeviceDepthClipEnableFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceDepthClipEnableFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPipelineRasterizationDepthClipStateCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkPipelineRasterizationDepthClipStateCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_swapchain_colorspace
+#endif
+#ifdef VK_EXT_hdr_metadata
+void handlemap_VkXYColorEXT(VulkanHandleMapping* handlemap, VkXYColorEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkHdrMetadataEXT(VulkanHandleMapping* handlemap, VkHdrMetadataEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkXYColorEXT(handlemap, (VkXYColorEXT*)(&toMap->displayPrimaryRed));
+    handlemap_VkXYColorEXT(handlemap, (VkXYColorEXT*)(&toMap->displayPrimaryGreen));
+    handlemap_VkXYColorEXT(handlemap, (VkXYColorEXT*)(&toMap->displayPrimaryBlue));
+    handlemap_VkXYColorEXT(handlemap, (VkXYColorEXT*)(&toMap->whitePoint));
+}
+
+#endif
+#ifdef VK_MVK_ios_surface
+void handlemap_VkIOSSurfaceCreateInfoMVK(VulkanHandleMapping* handlemap,
+                                         VkIOSSurfaceCreateInfoMVK* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_MVK_macos_surface
+void handlemap_VkMacOSSurfaceCreateInfoMVK(VulkanHandleMapping* handlemap,
+                                           VkMacOSSurfaceCreateInfoMVK* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_MVK_moltenvk
+#endif
+#ifdef VK_EXT_external_memory_dma_buf
+#endif
+#ifdef VK_EXT_queue_family_foreign
+#endif
+#ifdef VK_EXT_debug_utils
+void handlemap_VkDebugUtilsLabelEXT(VulkanHandleMapping* handlemap, VkDebugUtilsLabelEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDebugUtilsObjectNameInfoEXT(VulkanHandleMapping* handlemap,
+                                             VkDebugUtilsObjectNameInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDebugUtilsMessengerCallbackDataEXT(VulkanHandleMapping* handlemap,
+                                                    VkDebugUtilsMessengerCallbackDataEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pQueueLabels) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->queueLabelCount; ++i) {
+                handlemap_VkDebugUtilsLabelEXT(handlemap,
+                                               (VkDebugUtilsLabelEXT*)(toMap->pQueueLabels + i));
+            }
+        }
+    }
+    if (toMap) {
+        if (toMap->pCmdBufLabels) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->cmdBufLabelCount; ++i) {
+                handlemap_VkDebugUtilsLabelEXT(handlemap,
+                                               (VkDebugUtilsLabelEXT*)(toMap->pCmdBufLabels + i));
+            }
+        }
+    }
+    if (toMap) {
+        if (toMap->pObjects) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->objectCount; ++i) {
+                handlemap_VkDebugUtilsObjectNameInfoEXT(
+                    handlemap, (VkDebugUtilsObjectNameInfoEXT*)(toMap->pObjects + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkDebugUtilsMessengerCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                                  VkDebugUtilsMessengerCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDebugUtilsObjectTagInfoEXT(VulkanHandleMapping* handlemap,
+                                            VkDebugUtilsObjectTagInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+void handlemap_VkAndroidHardwareBufferUsageANDROID(VulkanHandleMapping* handlemap,
+                                                   VkAndroidHardwareBufferUsageANDROID* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkAndroidHardwareBufferPropertiesANDROID(
+    VulkanHandleMapping* handlemap, VkAndroidHardwareBufferPropertiesANDROID* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkAndroidHardwareBufferFormatPropertiesANDROID(
+    VulkanHandleMapping* handlemap, VkAndroidHardwareBufferFormatPropertiesANDROID* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkComponentMapping(handlemap,
+                                 (VkComponentMapping*)(&toMap->samplerYcbcrConversionComponents));
+}
+
+void handlemap_VkImportAndroidHardwareBufferInfoANDROID(
+    VulkanHandleMapping* handlemap, VkImportAndroidHardwareBufferInfoANDROID* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkMemoryGetAndroidHardwareBufferInfoANDROID(
+    VulkanHandleMapping* handlemap, VkMemoryGetAndroidHardwareBufferInfoANDROID* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkDeviceMemory((VkDeviceMemory*)&toMap->memory);
+}
+
+void handlemap_VkExternalFormatANDROID(VulkanHandleMapping* handlemap,
+                                       VkExternalFormatANDROID* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkAndroidHardwareBufferFormatProperties2ANDROID(
+    VulkanHandleMapping* handlemap, VkAndroidHardwareBufferFormatProperties2ANDROID* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkComponentMapping(handlemap,
+                                 (VkComponentMapping*)(&toMap->samplerYcbcrConversionComponents));
+}
+
+#endif
+#ifdef VK_EXT_sampler_filter_minmax
+#endif
+#ifdef VK_AMD_gpu_shader_int16
+#endif
+#ifdef VK_AMD_mixed_attachment_samples
+#endif
+#ifdef VK_AMD_shader_fragment_mask
+#endif
+#ifdef VK_EXT_inline_uniform_block
+void handlemap_VkPhysicalDeviceInlineUniformBlockFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceInlineUniformBlockFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceInlineUniformBlockPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceInlineUniformBlockPropertiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkWriteDescriptorSetInlineUniformBlockEXT(
+    VulkanHandleMapping* handlemap, VkWriteDescriptorSetInlineUniformBlockEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDescriptorPoolInlineUniformBlockCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkDescriptorPoolInlineUniformBlockCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_shader_stencil_export
+#endif
+#ifdef VK_EXT_sample_locations
+void handlemap_VkSampleLocationEXT(VulkanHandleMapping* handlemap, VkSampleLocationEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkSampleLocationsInfoEXT(VulkanHandleMapping* handlemap,
+                                        VkSampleLocationsInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->sampleLocationGridSize));
+    if (toMap) {
+        if (toMap->pSampleLocations) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->sampleLocationsCount; ++i) {
+                handlemap_VkSampleLocationEXT(handlemap,
+                                              (VkSampleLocationEXT*)(toMap->pSampleLocations + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkAttachmentSampleLocationsEXT(VulkanHandleMapping* handlemap,
+                                              VkAttachmentSampleLocationsEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkSampleLocationsInfoEXT(handlemap,
+                                       (VkSampleLocationsInfoEXT*)(&toMap->sampleLocationsInfo));
+}
+
+void handlemap_VkSubpassSampleLocationsEXT(VulkanHandleMapping* handlemap,
+                                           VkSubpassSampleLocationsEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkSampleLocationsInfoEXT(handlemap,
+                                       (VkSampleLocationsInfoEXT*)(&toMap->sampleLocationsInfo));
+}
+
+void handlemap_VkRenderPassSampleLocationsBeginInfoEXT(
+    VulkanHandleMapping* handlemap, VkRenderPassSampleLocationsBeginInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pAttachmentInitialSampleLocations) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->attachmentInitialSampleLocationsCount; ++i) {
+                handlemap_VkAttachmentSampleLocationsEXT(
+                    handlemap,
+                    (VkAttachmentSampleLocationsEXT*)(toMap->pAttachmentInitialSampleLocations +
+                                                      i));
+            }
+        }
+    }
+    if (toMap) {
+        if (toMap->pPostSubpassSampleLocations) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->postSubpassSampleLocationsCount; ++i) {
+                handlemap_VkSubpassSampleLocationsEXT(
+                    handlemap,
+                    (VkSubpassSampleLocationsEXT*)(toMap->pPostSubpassSampleLocations + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkPipelineSampleLocationsStateCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkPipelineSampleLocationsStateCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkSampleLocationsInfoEXT(handlemap,
+                                       (VkSampleLocationsInfoEXT*)(&toMap->sampleLocationsInfo));
+}
+
+void handlemap_VkPhysicalDeviceSampleLocationsPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceSampleLocationsPropertiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->maxSampleLocationGridSize));
+}
+
+void handlemap_VkMultisamplePropertiesEXT(VulkanHandleMapping* handlemap,
+                                          VkMultisamplePropertiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->maxSampleLocationGridSize));
+}
+
+#endif
+#ifdef VK_EXT_blend_operation_advanced
+void handlemap_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPipelineColorBlendAdvancedStateCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkPipelineColorBlendAdvancedStateCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_fragment_coverage_to_color
+void handlemap_VkPipelineCoverageToColorStateCreateInfoNV(
+    VulkanHandleMapping* handlemap, VkPipelineCoverageToColorStateCreateInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_framebuffer_mixed_samples
+void handlemap_VkPipelineCoverageModulationStateCreateInfoNV(
+    VulkanHandleMapping* handlemap, VkPipelineCoverageModulationStateCreateInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_fill_rectangle
+#endif
+#ifdef VK_NV_shader_sm_builtins
+void handlemap_VkPhysicalDeviceShaderSMBuiltinsPropertiesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderSMBuiltinsPropertiesNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceShaderSMBuiltinsFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderSMBuiltinsFeaturesNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_post_depth_coverage
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+void handlemap_VkDrmFormatModifierPropertiesEXT(VulkanHandleMapping* handlemap,
+                                                VkDrmFormatModifierPropertiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkDrmFormatModifierPropertiesListEXT(VulkanHandleMapping* handlemap,
+                                                    VkDrmFormatModifierPropertiesListEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pDrmFormatModifierProperties) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->drmFormatModifierCount; ++i) {
+                handlemap_VkDrmFormatModifierPropertiesEXT(
+                    handlemap,
+                    (VkDrmFormatModifierPropertiesEXT*)(toMap->pDrmFormatModifierProperties + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkPhysicalDeviceImageDrmFormatModifierInfoEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceImageDrmFormatModifierInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkImageDrmFormatModifierListCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkImageDrmFormatModifierListCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkImageDrmFormatModifierExplicitCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkImageDrmFormatModifierExplicitCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pPlaneLayouts) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->drmFormatModifierPlaneCount; ++i) {
+                handlemap_VkSubresourceLayout(handlemap,
+                                              (VkSubresourceLayout*)(toMap->pPlaneLayouts + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkImageDrmFormatModifierPropertiesEXT(VulkanHandleMapping* handlemap,
+                                                     VkImageDrmFormatModifierPropertiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDrmFormatModifierProperties2EXT(VulkanHandleMapping* handlemap,
+                                                 VkDrmFormatModifierProperties2EXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkDrmFormatModifierPropertiesList2EXT(VulkanHandleMapping* handlemap,
+                                                     VkDrmFormatModifierPropertiesList2EXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pDrmFormatModifierProperties) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->drmFormatModifierCount; ++i) {
+                handlemap_VkDrmFormatModifierProperties2EXT(
+                    handlemap,
+                    (VkDrmFormatModifierProperties2EXT*)(toMap->pDrmFormatModifierProperties + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_EXT_validation_cache
+void handlemap_VkValidationCacheCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                              VkValidationCacheCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkShaderModuleValidationCacheCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkShaderModuleValidationCacheCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkValidationCacheEXT((VkValidationCacheEXT*)&toMap->validationCache);
+}
+
+#endif
+#ifdef VK_EXT_descriptor_indexing
+#endif
+#ifdef VK_EXT_shader_viewport_index_layer
+#endif
+#ifdef VK_NV_shading_rate_image
+void handlemap_VkShadingRatePaletteNV(VulkanHandleMapping* handlemap,
+                                      VkShadingRatePaletteNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkPipelineViewportShadingRateImageStateCreateInfoNV(
+    VulkanHandleMapping* handlemap, VkPipelineViewportShadingRateImageStateCreateInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pShadingRatePalettes) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->viewportCount; ++i) {
+                handlemap_VkShadingRatePaletteNV(
+                    handlemap, (VkShadingRatePaletteNV*)(toMap->pShadingRatePalettes + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkPhysicalDeviceShadingRateImageFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShadingRateImageFeaturesNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceShadingRateImagePropertiesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShadingRateImagePropertiesNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->shadingRateTexelSize));
+}
+
+void handlemap_VkCoarseSampleLocationNV(VulkanHandleMapping* handlemap,
+                                        VkCoarseSampleLocationNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkCoarseSampleOrderCustomNV(VulkanHandleMapping* handlemap,
+                                           VkCoarseSampleOrderCustomNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap) {
+        if (toMap->pSampleLocations) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->sampleLocationCount; ++i) {
+                handlemap_VkCoarseSampleLocationNV(
+                    handlemap, (VkCoarseSampleLocationNV*)(toMap->pSampleLocations + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkPipelineViewportCoarseSampleOrderStateCreateInfoNV(
+    VulkanHandleMapping* handlemap, VkPipelineViewportCoarseSampleOrderStateCreateInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pCustomSampleOrders) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->customSampleOrderCount; ++i) {
+                handlemap_VkCoarseSampleOrderCustomNV(
+                    handlemap, (VkCoarseSampleOrderCustomNV*)(toMap->pCustomSampleOrders + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_NV_ray_tracing
+void handlemap_VkRayTracingShaderGroupCreateInfoNV(VulkanHandleMapping* handlemap,
+                                                   VkRayTracingShaderGroupCreateInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkRayTracingPipelineCreateInfoNV(VulkanHandleMapping* handlemap,
+                                                VkRayTracingPipelineCreateInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pStages) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->stageCount; ++i) {
+                handlemap_VkPipelineShaderStageCreateInfo(
+                    handlemap, (VkPipelineShaderStageCreateInfo*)(toMap->pStages + i));
+            }
+        }
+    }
+    if (toMap) {
+        if (toMap->pGroups) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->groupCount; ++i) {
+                handlemap_VkRayTracingShaderGroupCreateInfoNV(
+                    handlemap, (VkRayTracingShaderGroupCreateInfoNV*)(toMap->pGroups + i));
+            }
+        }
+    }
+    handlemap->mapHandles_VkPipelineLayout((VkPipelineLayout*)&toMap->layout);
+    handlemap->mapHandles_VkPipeline((VkPipeline*)&toMap->basePipelineHandle);
+}
+
+void handlemap_VkGeometryTrianglesNV(VulkanHandleMapping* handlemap, VkGeometryTrianglesNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkBuffer((VkBuffer*)&toMap->vertexData);
+    handlemap->mapHandles_VkBuffer((VkBuffer*)&toMap->indexData);
+    handlemap->mapHandles_VkBuffer((VkBuffer*)&toMap->transformData);
+}
+
+void handlemap_VkGeometryAABBNV(VulkanHandleMapping* handlemap, VkGeometryAABBNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkBuffer((VkBuffer*)&toMap->aabbData);
+}
+
+void handlemap_VkGeometryDataNV(VulkanHandleMapping* handlemap, VkGeometryDataNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkGeometryTrianglesNV(handlemap, (VkGeometryTrianglesNV*)(&toMap->triangles));
+    handlemap_VkGeometryAABBNV(handlemap, (VkGeometryAABBNV*)(&toMap->aabbs));
+}
+
+void handlemap_VkGeometryNV(VulkanHandleMapping* handlemap, VkGeometryNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkGeometryDataNV(handlemap, (VkGeometryDataNV*)(&toMap->geometry));
+}
+
+void handlemap_VkAccelerationStructureInfoNV(VulkanHandleMapping* handlemap,
+                                             VkAccelerationStructureInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pGeometries) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->geometryCount; ++i) {
+                handlemap_VkGeometryNV(handlemap, (VkGeometryNV*)(toMap->pGeometries + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkAccelerationStructureCreateInfoNV(VulkanHandleMapping* handlemap,
+                                                   VkAccelerationStructureCreateInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkAccelerationStructureInfoNV(handlemap,
+                                            (VkAccelerationStructureInfoNV*)(&toMap->info));
+}
+
+void handlemap_VkBindAccelerationStructureMemoryInfoNV(
+    VulkanHandleMapping* handlemap, VkBindAccelerationStructureMemoryInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkAccelerationStructureNV(
+        (VkAccelerationStructureNV*)&toMap->accelerationStructure);
+    handlemap->mapHandles_VkDeviceMemory((VkDeviceMemory*)&toMap->memory);
+}
+
+void handlemap_VkWriteDescriptorSetAccelerationStructureNV(
+    VulkanHandleMapping* handlemap, VkWriteDescriptorSetAccelerationStructureNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pAccelerationStructures) {
+        handlemap->mapHandles_VkAccelerationStructureNV(
+            (VkAccelerationStructureNV*)toMap->pAccelerationStructures,
+            toMap->accelerationStructureCount);
+    }
+}
+
+void handlemap_VkAccelerationStructureMemoryRequirementsInfoNV(
+    VulkanHandleMapping* handlemap, VkAccelerationStructureMemoryRequirementsInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkAccelerationStructureNV(
+        (VkAccelerationStructureNV*)&toMap->accelerationStructure);
+}
+
+void handlemap_VkPhysicalDeviceRayTracingPropertiesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceRayTracingPropertiesNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkTransformMatrixKHR(VulkanHandleMapping* handlemap, VkTransformMatrixKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkAabbPositionsKHR(VulkanHandleMapping* handlemap, VkAabbPositionsKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkAccelerationStructureInstanceKHR(VulkanHandleMapping* handlemap,
+                                                  VkAccelerationStructureInstanceKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkTransformMatrixKHR(handlemap, (VkTransformMatrixKHR*)(&toMap->transform));
+}
+
+#endif
+#ifdef VK_NV_representative_fragment_test
+void handlemap_VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPipelineRepresentativeFragmentTestStateCreateInfoNV(
+    VulkanHandleMapping* handlemap, VkPipelineRepresentativeFragmentTestStateCreateInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_filter_cubic
+void handlemap_VkPhysicalDeviceImageViewImageFormatInfoEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceImageViewImageFormatInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkFilterCubicImageViewImageFormatPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkFilterCubicImageViewImageFormatPropertiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_QCOM_render_pass_shader_resolve
+#endif
+#ifdef VK_EXT_global_priority
+void handlemap_VkDeviceQueueGlobalPriorityCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkDeviceQueueGlobalPriorityCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_external_memory_host
+void handlemap_VkImportMemoryHostPointerInfoEXT(VulkanHandleMapping* handlemap,
+                                                VkImportMemoryHostPointerInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkMemoryHostPointerPropertiesEXT(VulkanHandleMapping* handlemap,
+                                                VkMemoryHostPointerPropertiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceExternalMemoryHostPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceExternalMemoryHostPropertiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_buffer_marker
+#endif
+#ifdef VK_AMD_pipeline_compiler_control
+void handlemap_VkPipelineCompilerControlCreateInfoAMD(
+    VulkanHandleMapping* handlemap, VkPipelineCompilerControlCreateInfoAMD* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_calibrated_timestamps
+void handlemap_VkCalibratedTimestampInfoEXT(VulkanHandleMapping* handlemap,
+                                            VkCalibratedTimestampInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_shader_core_properties
+void handlemap_VkPhysicalDeviceShaderCorePropertiesAMD(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderCorePropertiesAMD* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_video_decode_h265
+void handlemap_VkVideoDecodeH265ProfileEXT(VulkanHandleMapping* handlemap,
+                                           VkVideoDecodeH265ProfileEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkVideoDecodeH265CapabilitiesEXT(VulkanHandleMapping* handlemap,
+                                                VkVideoDecodeH265CapabilitiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkExtensionProperties(handlemap,
+                                    (VkExtensionProperties*)(&toMap->stdExtensionVersion));
+}
+
+void handlemap_VkVideoDecodeH265SessionCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                                     VkVideoDecodeH265SessionCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pStdExtensionVersion) {
+        handlemap_VkExtensionProperties(handlemap,
+                                        (VkExtensionProperties*)(toMap->pStdExtensionVersion));
+    }
+}
+
+void handlemap_VkVideoDecodeH265SessionParametersAddInfoEXT(
+    VulkanHandleMapping* handlemap, VkVideoDecodeH265SessionParametersAddInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkVideoDecodeH265SessionParametersCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkVideoDecodeH265SessionParametersCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pParametersAddInfo) {
+        handlemap_VkVideoDecodeH265SessionParametersAddInfoEXT(
+            handlemap, (VkVideoDecodeH265SessionParametersAddInfoEXT*)(toMap->pParametersAddInfo));
+    }
+}
+
+void handlemap_VkVideoDecodeH265PictureInfoEXT(VulkanHandleMapping* handlemap,
+                                               VkVideoDecodeH265PictureInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkVideoDecodeH265DpbSlotInfoEXT(VulkanHandleMapping* handlemap,
+                                               VkVideoDecodeH265DpbSlotInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_memory_overallocation_behavior
+void handlemap_VkDeviceMemoryOverallocationCreateInfoAMD(
+    VulkanHandleMapping* handlemap, VkDeviceMemoryOverallocationCreateInfoAMD* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_vertex_attribute_divisor
+void handlemap_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkVertexInputBindingDivisorDescriptionEXT(
+    VulkanHandleMapping* handlemap, VkVertexInputBindingDivisorDescriptionEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkPipelineVertexInputDivisorStateCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkPipelineVertexInputDivisorStateCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pVertexBindingDivisors) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->vertexBindingDivisorCount; ++i) {
+                handlemap_VkVertexInputBindingDivisorDescriptionEXT(
+                    handlemap,
+                    (VkVertexInputBindingDivisorDescriptionEXT*)(toMap->pVertexBindingDivisors +
+                                                                 i));
+            }
+        }
+    }
+}
+
+void handlemap_VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_GGP_frame_token
+void handlemap_VkPresentFrameTokenGGP(VulkanHandleMapping* handlemap,
+                                      VkPresentFrameTokenGGP* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_pipeline_creation_feedback
+void handlemap_VkPipelineCreationFeedbackEXT(VulkanHandleMapping* handlemap,
+                                             VkPipelineCreationFeedbackEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkPipelineCreationFeedbackCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkPipelineCreationFeedbackCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pPipelineCreationFeedback) {
+        handlemap_VkPipelineCreationFeedbackEXT(
+            handlemap, (VkPipelineCreationFeedbackEXT*)(toMap->pPipelineCreationFeedback));
+    }
+    if (toMap) {
+        if (toMap->pPipelineStageCreationFeedbacks) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->pipelineStageCreationFeedbackCount; ++i) {
+                handlemap_VkPipelineCreationFeedbackEXT(
+                    handlemap,
+                    (VkPipelineCreationFeedbackEXT*)(toMap->pPipelineStageCreationFeedbacks + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_NV_shader_subgroup_partitioned
+#endif
+#ifdef VK_NV_compute_shader_derivatives
+void handlemap_VkPhysicalDeviceComputeShaderDerivativesFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceComputeShaderDerivativesFeaturesNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_mesh_shader
+void handlemap_VkPhysicalDeviceMeshShaderFeaturesNV(VulkanHandleMapping* handlemap,
+                                                    VkPhysicalDeviceMeshShaderFeaturesNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceMeshShaderPropertiesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceMeshShaderPropertiesNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDrawMeshTasksIndirectCommandNV(VulkanHandleMapping* handlemap,
+                                                VkDrawMeshTasksIndirectCommandNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+#endif
+#ifdef VK_NV_fragment_shader_barycentric
+void handlemap_VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_shader_image_footprint
+void handlemap_VkPhysicalDeviceShaderImageFootprintFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderImageFootprintFeaturesNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_scissor_exclusive
+void handlemap_VkPipelineViewportExclusiveScissorStateCreateInfoNV(
+    VulkanHandleMapping* handlemap, VkPipelineViewportExclusiveScissorStateCreateInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pExclusiveScissors) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->exclusiveScissorCount; ++i) {
+                handlemap_VkRect2D(handlemap, (VkRect2D*)(toMap->pExclusiveScissors + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkPhysicalDeviceExclusiveScissorFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceExclusiveScissorFeaturesNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+void handlemap_VkQueueFamilyCheckpointPropertiesNV(VulkanHandleMapping* handlemap,
+                                                   VkQueueFamilyCheckpointPropertiesNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkCheckpointDataNV(VulkanHandleMapping* handlemap, VkCheckpointDataNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_INTEL_shader_integer_functions2
+void handlemap_VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_INTEL_performance_query
+void handlemap_VkPerformanceValueDataINTEL(VulkanHandleMapping* handlemap,
+                                           VkPerformanceValueDataINTEL* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkPerformanceValueINTEL(VulkanHandleMapping* handlemap,
+                                       VkPerformanceValueINTEL* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkPerformanceValueDataINTEL(handlemap, (VkPerformanceValueDataINTEL*)(&toMap->data));
+}
+
+void handlemap_VkInitializePerformanceApiInfoINTEL(VulkanHandleMapping* handlemap,
+                                                   VkInitializePerformanceApiInfoINTEL* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkQueryPoolPerformanceQueryCreateInfoINTEL(
+    VulkanHandleMapping* handlemap, VkQueryPoolPerformanceQueryCreateInfoINTEL* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPerformanceMarkerInfoINTEL(VulkanHandleMapping* handlemap,
+                                            VkPerformanceMarkerInfoINTEL* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPerformanceStreamMarkerInfoINTEL(VulkanHandleMapping* handlemap,
+                                                  VkPerformanceStreamMarkerInfoINTEL* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPerformanceOverrideInfoINTEL(VulkanHandleMapping* handlemap,
+                                              VkPerformanceOverrideInfoINTEL* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPerformanceConfigurationAcquireInfoINTEL(
+    VulkanHandleMapping* handlemap, VkPerformanceConfigurationAcquireInfoINTEL* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_pci_bus_info
+void handlemap_VkPhysicalDevicePCIBusInfoPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDevicePCIBusInfoPropertiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_display_native_hdr
+void handlemap_VkDisplayNativeHdrSurfaceCapabilitiesAMD(
+    VulkanHandleMapping* handlemap, VkDisplayNativeHdrSurfaceCapabilitiesAMD* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkSwapchainDisplayNativeHdrCreateInfoAMD(
+    VulkanHandleMapping* handlemap, VkSwapchainDisplayNativeHdrCreateInfoAMD* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_FUCHSIA_imagepipe_surface
+void handlemap_VkImagePipeSurfaceCreateInfoFUCHSIA(VulkanHandleMapping* handlemap,
+                                                   VkImagePipeSurfaceCreateInfoFUCHSIA* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_metal_surface
+void handlemap_VkMetalSurfaceCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                           VkMetalSurfaceCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_fragment_density_map
+void handlemap_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceFragmentDensityMapFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceFragmentDensityMapPropertiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->minFragmentDensityTexelSize));
+    handlemap_VkExtent2D(handlemap, (VkExtent2D*)(&toMap->maxFragmentDensityTexelSize));
+}
+
+void handlemap_VkRenderPassFragmentDensityMapCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkRenderPassFragmentDensityMapCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkAttachmentReference(handlemap,
+                                    (VkAttachmentReference*)(&toMap->fragmentDensityMapAttachment));
+}
+
+#endif
+#ifdef VK_EXT_scalar_block_layout
+#endif
+#ifdef VK_GOOGLE_hlsl_functionality1
+#endif
+#ifdef VK_GOOGLE_decorate_string
+#endif
+#ifdef VK_EXT_subgroup_size_control
+void handlemap_VkPhysicalDeviceSubgroupSizeControlFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceSubgroupSizeControlFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceSubgroupSizeControlPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceSubgroupSizeControlPropertiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_shader_core_properties2
+void handlemap_VkPhysicalDeviceShaderCoreProperties2AMD(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderCoreProperties2AMD* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_device_coherent_memory
+void handlemap_VkPhysicalDeviceCoherentMemoryFeaturesAMD(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceCoherentMemoryFeaturesAMD* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_shader_image_atomic_int64
+void handlemap_VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_memory_budget
+void handlemap_VkPhysicalDeviceMemoryBudgetPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceMemoryBudgetPropertiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_memory_priority
+void handlemap_VkPhysicalDeviceMemoryPriorityFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceMemoryPriorityFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkMemoryPriorityAllocateInfoEXT(VulkanHandleMapping* handlemap,
+                                               VkMemoryPriorityAllocateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_dedicated_allocation_image_aliasing
+void handlemap_VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV(
+    VulkanHandleMapping* handlemap,
+    VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_buffer_device_address
+void handlemap_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceBufferDeviceAddressFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkBufferDeviceAddressCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                                  VkBufferDeviceAddressCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_tooling_info
+void handlemap_VkPhysicalDeviceToolPropertiesEXT(VulkanHandleMapping* handlemap,
+                                                 VkPhysicalDeviceToolPropertiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_separate_stencil_usage
+#endif
+#ifdef VK_EXT_validation_features
+void handlemap_VkValidationFeaturesEXT(VulkanHandleMapping* handlemap,
+                                       VkValidationFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_cooperative_matrix
+void handlemap_VkCooperativeMatrixPropertiesNV(VulkanHandleMapping* handlemap,
+                                               VkCooperativeMatrixPropertiesNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceCooperativeMatrixFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceCooperativeMatrixFeaturesNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceCooperativeMatrixPropertiesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceCooperativeMatrixPropertiesNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+void handlemap_VkPhysicalDeviceCoverageReductionModeFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceCoverageReductionModeFeaturesNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPipelineCoverageReductionStateCreateInfoNV(
+    VulkanHandleMapping* handlemap, VkPipelineCoverageReductionStateCreateInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkFramebufferMixedSamplesCombinationNV(
+    VulkanHandleMapping* handlemap, VkFramebufferMixedSamplesCombinationNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_fragment_shader_interlock
+void handlemap_VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_ycbcr_image_arrays
+void handlemap_VkPhysicalDeviceYcbcrImageArraysFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceYcbcrImageArraysFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_provoking_vertex
+void handlemap_VkPhysicalDeviceProvokingVertexFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceProvokingVertexFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceProvokingVertexPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceProvokingVertexPropertiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT(
+    VulkanHandleMapping* handlemap,
+    VkPipelineRasterizationProvokingVertexStateCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+void handlemap_VkSurfaceFullScreenExclusiveInfoEXT(VulkanHandleMapping* handlemap,
+                                                   VkSurfaceFullScreenExclusiveInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkSurfaceCapabilitiesFullScreenExclusiveEXT(
+    VulkanHandleMapping* handlemap, VkSurfaceCapabilitiesFullScreenExclusiveEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkSurfaceFullScreenExclusiveWin32InfoEXT(
+    VulkanHandleMapping* handlemap, VkSurfaceFullScreenExclusiveWin32InfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_headless_surface
+void handlemap_VkHeadlessSurfaceCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                              VkHeadlessSurfaceCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_line_rasterization
+void handlemap_VkPhysicalDeviceLineRasterizationFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceLineRasterizationFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceLineRasterizationPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceLineRasterizationPropertiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPipelineRasterizationLineStateCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkPipelineRasterizationLineStateCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_shader_atomic_float
+void handlemap_VkPhysicalDeviceShaderAtomicFloatFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderAtomicFloatFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_host_query_reset
+#endif
+#ifdef VK_EXT_index_type_uint8
+void handlemap_VkPhysicalDeviceIndexTypeUint8FeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceIndexTypeUint8FeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+void handlemap_VkPhysicalDeviceExtendedDynamicStateFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceExtendedDynamicStateFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_shader_atomic_float2
+void handlemap_VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_shader_demote_to_helper_invocation
+void handlemap_VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT(
+    VulkanHandleMapping* handlemap,
+    VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_device_generated_commands
+void handlemap_VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkGraphicsShaderGroupCreateInfoNV(VulkanHandleMapping* handlemap,
+                                                 VkGraphicsShaderGroupCreateInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pStages) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->stageCount; ++i) {
+                handlemap_VkPipelineShaderStageCreateInfo(
+                    handlemap, (VkPipelineShaderStageCreateInfo*)(toMap->pStages + i));
+            }
+        }
+    }
+    if (toMap->pVertexInputState) {
+        handlemap_VkPipelineVertexInputStateCreateInfo(
+            handlemap, (VkPipelineVertexInputStateCreateInfo*)(toMap->pVertexInputState));
+    }
+    if (toMap->pTessellationState) {
+        handlemap_VkPipelineTessellationStateCreateInfo(
+            handlemap, (VkPipelineTessellationStateCreateInfo*)(toMap->pTessellationState));
+    }
+}
+
+void handlemap_VkGraphicsPipelineShaderGroupsCreateInfoNV(
+    VulkanHandleMapping* handlemap, VkGraphicsPipelineShaderGroupsCreateInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pGroups) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->groupCount; ++i) {
+                handlemap_VkGraphicsShaderGroupCreateInfoNV(
+                    handlemap, (VkGraphicsShaderGroupCreateInfoNV*)(toMap->pGroups + i));
+            }
+        }
+    }
+    if (toMap->pPipelines) {
+        handlemap->mapHandles_VkPipeline((VkPipeline*)toMap->pPipelines, toMap->pipelineCount);
+    }
+}
+
+void handlemap_VkBindShaderGroupIndirectCommandNV(VulkanHandleMapping* handlemap,
+                                                  VkBindShaderGroupIndirectCommandNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkBindIndexBufferIndirectCommandNV(VulkanHandleMapping* handlemap,
+                                                  VkBindIndexBufferIndirectCommandNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkBindVertexBufferIndirectCommandNV(VulkanHandleMapping* handlemap,
+                                                   VkBindVertexBufferIndirectCommandNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkSetStateFlagsIndirectCommandNV(VulkanHandleMapping* handlemap,
+                                                VkSetStateFlagsIndirectCommandNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkIndirectCommandsStreamNV(VulkanHandleMapping* handlemap,
+                                          VkIndirectCommandsStreamNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap->mapHandles_VkBuffer((VkBuffer*)&toMap->buffer);
+}
+
+void handlemap_VkIndirectCommandsLayoutTokenNV(VulkanHandleMapping* handlemap,
+                                               VkIndirectCommandsLayoutTokenNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkPipelineLayout((VkPipelineLayout*)&toMap->pushconstantPipelineLayout);
+}
+
+void handlemap_VkIndirectCommandsLayoutCreateInfoNV(VulkanHandleMapping* handlemap,
+                                                    VkIndirectCommandsLayoutCreateInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pTokens) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->tokenCount; ++i) {
+                handlemap_VkIndirectCommandsLayoutTokenNV(
+                    handlemap, (VkIndirectCommandsLayoutTokenNV*)(toMap->pTokens + i));
+            }
+        }
+    }
+}
+
+void handlemap_VkGeneratedCommandsInfoNV(VulkanHandleMapping* handlemap,
+                                         VkGeneratedCommandsInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkPipeline((VkPipeline*)&toMap->pipeline);
+    handlemap->mapHandles_VkIndirectCommandsLayoutNV(
+        (VkIndirectCommandsLayoutNV*)&toMap->indirectCommandsLayout);
+    if (toMap) {
+        if (toMap->pStreams) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->streamCount; ++i) {
+                handlemap_VkIndirectCommandsStreamNV(
+                    handlemap, (VkIndirectCommandsStreamNV*)(toMap->pStreams + i));
+            }
+        }
+    }
+    handlemap->mapHandles_VkBuffer((VkBuffer*)&toMap->preprocessBuffer);
+    handlemap->mapHandles_VkBuffer((VkBuffer*)&toMap->sequencesCountBuffer);
+    handlemap->mapHandles_VkBuffer((VkBuffer*)&toMap->sequencesIndexBuffer);
+}
+
+void handlemap_VkGeneratedCommandsMemoryRequirementsInfoNV(
+    VulkanHandleMapping* handlemap, VkGeneratedCommandsMemoryRequirementsInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkPipeline((VkPipeline*)&toMap->pipeline);
+    handlemap->mapHandles_VkIndirectCommandsLayoutNV(
+        (VkIndirectCommandsLayoutNV*)&toMap->indirectCommandsLayout);
+}
+
+#endif
+#ifdef VK_NV_inherited_viewport_scissor
+void handlemap_VkPhysicalDeviceInheritedViewportScissorFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceInheritedViewportScissorFeaturesNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkCommandBufferInheritanceViewportScissorInfoNV(
+    VulkanHandleMapping* handlemap, VkCommandBufferInheritanceViewportScissorInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pViewportDepths) {
+        handlemap_VkViewport(handlemap, (VkViewport*)(toMap->pViewportDepths));
+    }
+}
+
+#endif
+#ifdef VK_EXT_texel_buffer_alignment
+void handlemap_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_QCOM_render_pass_transform
+void handlemap_VkRenderPassTransformBeginInfoQCOM(VulkanHandleMapping* handlemap,
+                                                  VkRenderPassTransformBeginInfoQCOM* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkCommandBufferInheritanceRenderPassTransformInfoQCOM(
+    VulkanHandleMapping* handlemap, VkCommandBufferInheritanceRenderPassTransformInfoQCOM* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkRect2D(handlemap, (VkRect2D*)(&toMap->renderArea));
+}
+
+#endif
+#ifdef VK_EXT_device_memory_report
+void handlemap_VkPhysicalDeviceDeviceMemoryReportFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceDeviceMemoryReportFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDeviceMemoryReportCallbackDataEXT(VulkanHandleMapping* handlemap,
+                                                   VkDeviceMemoryReportCallbackDataEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDeviceDeviceMemoryReportCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkDeviceDeviceMemoryReportCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_acquire_drm_display
+#endif
+#ifdef VK_EXT_robustness2
+void handlemap_VkPhysicalDeviceRobustness2FeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceRobustness2FeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceRobustness2PropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceRobustness2PropertiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_custom_border_color
+void handlemap_VkSamplerCustomBorderColorCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkSamplerCustomBorderColorCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkClearColorValue(handlemap, (VkClearColorValue*)(&toMap->customBorderColor));
+}
+
+void handlemap_VkPhysicalDeviceCustomBorderColorPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceCustomBorderColorPropertiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceCustomBorderColorFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceCustomBorderColorFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_GOOGLE_user_type
+#endif
+#ifdef VK_EXT_private_data
+void handlemap_VkPhysicalDevicePrivateDataFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDevicePrivateDataFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDevicePrivateDataCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                                VkDevicePrivateDataCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPrivateDataSlotCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                              VkPrivateDataSlotCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_pipeline_creation_cache_control
+void handlemap_VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT(
+    VulkanHandleMapping* handlemap,
+    VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_device_diagnostics_config
+void handlemap_VkPhysicalDeviceDiagnosticsConfigFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceDiagnosticsConfigFeaturesNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkDeviceDiagnosticsConfigCreateInfoNV(VulkanHandleMapping* handlemap,
+                                                     VkDeviceDiagnosticsConfigCreateInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_QCOM_render_pass_store_ops
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+void handlemap_VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPipelineFragmentShadingRateEnumStateCreateInfoNV(
+    VulkanHandleMapping* handlemap, VkPipelineFragmentShadingRateEnumStateCreateInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_ray_tracing_motion_blur
+void handlemap_VkDeviceOrHostAddressConstKHR(VulkanHandleMapping* handlemap,
+                                             VkDeviceOrHostAddressConstKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkAccelerationStructureGeometryMotionTrianglesDataNV(
+    VulkanHandleMapping* handlemap, VkAccelerationStructureGeometryMotionTrianglesDataNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkDeviceOrHostAddressConstKHR(handlemap,
+                                            (VkDeviceOrHostAddressConstKHR*)(&toMap->vertexData));
+}
+
+void handlemap_VkAccelerationStructureMotionInfoNV(VulkanHandleMapping* handlemap,
+                                                   VkAccelerationStructureMotionInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkAccelerationStructureMatrixMotionInstanceNV(
+    VulkanHandleMapping* handlemap, VkAccelerationStructureMatrixMotionInstanceNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkTransformMatrixKHR(handlemap, (VkTransformMatrixKHR*)(&toMap->transformT0));
+    handlemap_VkTransformMatrixKHR(handlemap, (VkTransformMatrixKHR*)(&toMap->transformT1));
+}
+
+void handlemap_VkSRTDataNV(VulkanHandleMapping* handlemap, VkSRTDataNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkAccelerationStructureSRTMotionInstanceNV(
+    VulkanHandleMapping* handlemap, VkAccelerationStructureSRTMotionInstanceNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkSRTDataNV(handlemap, (VkSRTDataNV*)(&toMap->transformT0));
+    handlemap_VkSRTDataNV(handlemap, (VkSRTDataNV*)(&toMap->transformT1));
+}
+
+void handlemap_VkAccelerationStructureMotionInstanceDataNV(
+    VulkanHandleMapping* handlemap, VkAccelerationStructureMotionInstanceDataNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkAccelerationStructureInstanceKHR(
+        handlemap, (VkAccelerationStructureInstanceKHR*)(&toMap->staticInstance));
+    handlemap_VkAccelerationStructureMatrixMotionInstanceNV(
+        handlemap, (VkAccelerationStructureMatrixMotionInstanceNV*)(&toMap->matrixMotionInstance));
+    handlemap_VkAccelerationStructureSRTMotionInstanceNV(
+        handlemap, (VkAccelerationStructureSRTMotionInstanceNV*)(&toMap->srtMotionInstance));
+}
+
+void handlemap_VkAccelerationStructureMotionInstanceNV(
+    VulkanHandleMapping* handlemap, VkAccelerationStructureMotionInstanceNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkAccelerationStructureMotionInstanceDataNV(
+        handlemap, (VkAccelerationStructureMotionInstanceDataNV*)(&toMap->data));
+}
+
+void handlemap_VkPhysicalDeviceRayTracingMotionBlurFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceRayTracingMotionBlurFeaturesNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_ycbcr_2plane_444_formats
+void handlemap_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_fragment_density_map2
+void handlemap_VkPhysicalDeviceFragmentDensityMap2FeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceFragmentDensityMap2FeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceFragmentDensityMap2PropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceFragmentDensityMap2PropertiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_QCOM_rotated_copy_commands
+void handlemap_VkCopyCommandTransformInfoQCOM(VulkanHandleMapping* handlemap,
+                                              VkCopyCommandTransformInfoQCOM* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_image_robustness
+void handlemap_VkPhysicalDeviceImageRobustnessFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceImageRobustnessFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_4444_formats
+void handlemap_VkPhysicalDevice4444FormatsFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDevice4444FormatsFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_rgba10x6_formats
+void handlemap_VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_acquire_winrt_display
+#endif
+#ifdef VK_EXT_directfb_surface
+void handlemap_VkDirectFBSurfaceCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                              VkDirectFBSurfaceCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_VALVE_mutable_descriptor_type
+void handlemap_VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkMutableDescriptorTypeListVALVE(VulkanHandleMapping* handlemap,
+                                                VkMutableDescriptorTypeListVALVE* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkMutableDescriptorTypeCreateInfoVALVE(
+    VulkanHandleMapping* handlemap, VkMutableDescriptorTypeCreateInfoVALVE* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pMutableDescriptorTypeLists) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->mutableDescriptorTypeListCount; ++i) {
+                handlemap_VkMutableDescriptorTypeListVALVE(
+                    handlemap,
+                    (VkMutableDescriptorTypeListVALVE*)(toMap->pMutableDescriptorTypeLists + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+void handlemap_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkVertexInputBindingDescription2EXT(VulkanHandleMapping* handlemap,
+                                                   VkVertexInputBindingDescription2EXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkVertexInputAttributeDescription2EXT(VulkanHandleMapping* handlemap,
+                                                     VkVertexInputAttributeDescription2EXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_physical_device_drm
+void handlemap_VkPhysicalDeviceDrmPropertiesEXT(VulkanHandleMapping* handlemap,
+                                                VkPhysicalDeviceDrmPropertiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_primitive_topology_list_restart
+void handlemap_VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT(
+    VulkanHandleMapping* handlemap,
+    VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_FUCHSIA_external_memory
+void handlemap_VkImportMemoryZirconHandleInfoFUCHSIA(VulkanHandleMapping* handlemap,
+                                                     VkImportMemoryZirconHandleInfoFUCHSIA* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkMemoryZirconHandlePropertiesFUCHSIA(VulkanHandleMapping* handlemap,
+                                                     VkMemoryZirconHandlePropertiesFUCHSIA* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkMemoryGetZirconHandleInfoFUCHSIA(VulkanHandleMapping* handlemap,
+                                                  VkMemoryGetZirconHandleInfoFUCHSIA* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkDeviceMemory((VkDeviceMemory*)&toMap->memory);
+}
+
+#endif
+#ifdef VK_FUCHSIA_external_semaphore
+void handlemap_VkImportSemaphoreZirconHandleInfoFUCHSIA(
+    VulkanHandleMapping* handlemap, VkImportSemaphoreZirconHandleInfoFUCHSIA* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkSemaphore((VkSemaphore*)&toMap->semaphore);
+}
+
+void handlemap_VkSemaphoreGetZirconHandleInfoFUCHSIA(VulkanHandleMapping* handlemap,
+                                                     VkSemaphoreGetZirconHandleInfoFUCHSIA* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkSemaphore((VkSemaphore*)&toMap->semaphore);
+}
+
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+void handlemap_VkBufferCollectionCreateInfoFUCHSIA(VulkanHandleMapping* handlemap,
+                                                   VkBufferCollectionCreateInfoFUCHSIA* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkImportMemoryBufferCollectionFUCHSIA(VulkanHandleMapping* handlemap,
+                                                     VkImportMemoryBufferCollectionFUCHSIA* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkBufferCollectionFUCHSIA((VkBufferCollectionFUCHSIA*)&toMap->collection);
+}
+
+void handlemap_VkBufferCollectionImageCreateInfoFUCHSIA(
+    VulkanHandleMapping* handlemap, VkBufferCollectionImageCreateInfoFUCHSIA* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkBufferCollectionFUCHSIA((VkBufferCollectionFUCHSIA*)&toMap->collection);
+}
+
+void handlemap_VkBufferCollectionConstraintsInfoFUCHSIA(
+    VulkanHandleMapping* handlemap, VkBufferCollectionConstraintsInfoFUCHSIA* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkBufferConstraintsInfoFUCHSIA(VulkanHandleMapping* handlemap,
+                                              VkBufferConstraintsInfoFUCHSIA* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkBufferCreateInfo(handlemap, (VkBufferCreateInfo*)(&toMap->createInfo));
+    handlemap_VkBufferCollectionConstraintsInfoFUCHSIA(
+        handlemap,
+        (VkBufferCollectionConstraintsInfoFUCHSIA*)(&toMap->bufferCollectionConstraints));
+}
+
+void handlemap_VkBufferCollectionBufferCreateInfoFUCHSIA(
+    VulkanHandleMapping* handlemap, VkBufferCollectionBufferCreateInfoFUCHSIA* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkBufferCollectionFUCHSIA((VkBufferCollectionFUCHSIA*)&toMap->collection);
+}
+
+void handlemap_VkSysmemColorSpaceFUCHSIA(VulkanHandleMapping* handlemap,
+                                         VkSysmemColorSpaceFUCHSIA* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkBufferCollectionPropertiesFUCHSIA(VulkanHandleMapping* handlemap,
+                                                   VkBufferCollectionPropertiesFUCHSIA* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkSysmemColorSpaceFUCHSIA(
+        handlemap, (VkSysmemColorSpaceFUCHSIA*)(&toMap->sysmemColorSpaceIndex));
+    handlemap_VkComponentMapping(handlemap,
+                                 (VkComponentMapping*)(&toMap->samplerYcbcrConversionComponents));
+}
+
+void handlemap_VkImageFormatConstraintsInfoFUCHSIA(VulkanHandleMapping* handlemap,
+                                                   VkImageFormatConstraintsInfoFUCHSIA* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkImageCreateInfo(handlemap, (VkImageCreateInfo*)(&toMap->imageCreateInfo));
+    if (toMap->pColorSpaces) {
+        handlemap_VkSysmemColorSpaceFUCHSIA(handlemap,
+                                            (VkSysmemColorSpaceFUCHSIA*)(toMap->pColorSpaces));
+    }
+}
+
+void handlemap_VkImageConstraintsInfoFUCHSIA(VulkanHandleMapping* handlemap,
+                                             VkImageConstraintsInfoFUCHSIA* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pFormatConstraints) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->formatConstraintsCount; ++i) {
+                handlemap_VkImageFormatConstraintsInfoFUCHSIA(
+                    handlemap,
+                    (VkImageFormatConstraintsInfoFUCHSIA*)(toMap->pFormatConstraints + i));
+            }
+        }
+    }
+    handlemap_VkBufferCollectionConstraintsInfoFUCHSIA(
+        handlemap,
+        (VkBufferCollectionConstraintsInfoFUCHSIA*)(&toMap->bufferCollectionConstraints));
+}
+
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+void handlemap_VkSubpassShadingPipelineCreateInfoHUAWEI(
+    VulkanHandleMapping* handlemap, VkSubpassShadingPipelineCreateInfoHUAWEI* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkRenderPass((VkRenderPass*)&toMap->renderPass);
+}
+
+void handlemap_VkPhysicalDeviceSubpassShadingFeaturesHUAWEI(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceSubpassShadingFeaturesHUAWEI* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceSubpassShadingPropertiesHUAWEI(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceSubpassShadingPropertiesHUAWEI* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+void handlemap_VkPhysicalDeviceInvocationMaskFeaturesHUAWEI(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceInvocationMaskFeaturesHUAWEI* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_external_memory_rdma
+void handlemap_VkMemoryGetRemoteAddressInfoNV(VulkanHandleMapping* handlemap,
+                                              VkMemoryGetRemoteAddressInfoNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkDeviceMemory((VkDeviceMemory*)&toMap->memory);
+}
+
+void handlemap_VkPhysicalDeviceExternalMemoryRDMAFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceExternalMemoryRDMAFeaturesNV* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+void handlemap_VkPhysicalDeviceExtendedDynamicState2FeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceExtendedDynamicState2FeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_QNX_screen_surface
+void handlemap_VkScreenSurfaceCreateInfoQNX(VulkanHandleMapping* handlemap,
+                                            VkScreenSurfaceCreateInfoQNX* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_color_write_enable
+void handlemap_VkPhysicalDeviceColorWriteEnableFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceColorWriteEnableFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPipelineColorWriteCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                                 VkPipelineColorWriteCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_GOOGLE_gfxstream
+void handlemap_VkImportColorBufferGOOGLE(VulkanHandleMapping* handlemap,
+                                         VkImportColorBufferGOOGLE* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkImportBufferGOOGLE(VulkanHandleMapping* handlemap, VkImportBufferGOOGLE* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkCreateBlobGOOGLE(VulkanHandleMapping* handlemap, VkCreateBlobGOOGLE* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_global_priority_query
+void handlemap_VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkQueueFamilyGlobalPriorityPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkQueueFamilyGlobalPriorityPropertiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_multi_draw
+void handlemap_VkPhysicalDeviceMultiDrawFeaturesEXT(VulkanHandleMapping* handlemap,
+                                                    VkPhysicalDeviceMultiDrawFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceMultiDrawPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceMultiDrawPropertiesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkMultiDrawInfoEXT(VulkanHandleMapping* handlemap, VkMultiDrawInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkMultiDrawIndexedInfoEXT(VulkanHandleMapping* handlemap,
+                                         VkMultiDrawIndexedInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+#endif
+#ifdef VK_EXT_load_store_op_none
+#endif
+#ifdef VK_EXT_border_color_swizzle
+void handlemap_VkPhysicalDeviceBorderColorSwizzleFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceBorderColorSwizzleFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkSamplerBorderColorComponentMappingCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkSamplerBorderColorComponentMappingCreateInfoEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkComponentMapping(handlemap, (VkComponentMapping*)(&toMap->components));
+}
+
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+void handlemap_VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_acceleration_structure
+void handlemap_VkDeviceOrHostAddressKHR(VulkanHandleMapping* handlemap,
+                                        VkDeviceOrHostAddressKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkAccelerationStructureBuildRangeInfoKHR(
+    VulkanHandleMapping* handlemap, VkAccelerationStructureBuildRangeInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkAccelerationStructureGeometryTrianglesDataKHR(
+    VulkanHandleMapping* handlemap, VkAccelerationStructureGeometryTrianglesDataKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkDeviceOrHostAddressConstKHR(handlemap,
+                                            (VkDeviceOrHostAddressConstKHR*)(&toMap->vertexData));
+    handlemap_VkDeviceOrHostAddressConstKHR(handlemap,
+                                            (VkDeviceOrHostAddressConstKHR*)(&toMap->indexData));
+    handlemap_VkDeviceOrHostAddressConstKHR(
+        handlemap, (VkDeviceOrHostAddressConstKHR*)(&toMap->transformData));
+}
+
+void handlemap_VkAccelerationStructureGeometryAabbsDataKHR(
+    VulkanHandleMapping* handlemap, VkAccelerationStructureGeometryAabbsDataKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkDeviceOrHostAddressConstKHR(handlemap,
+                                            (VkDeviceOrHostAddressConstKHR*)(&toMap->data));
+}
+
+void handlemap_VkAccelerationStructureGeometryInstancesDataKHR(
+    VulkanHandleMapping* handlemap, VkAccelerationStructureGeometryInstancesDataKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkDeviceOrHostAddressConstKHR(handlemap,
+                                            (VkDeviceOrHostAddressConstKHR*)(&toMap->data));
+}
+
+void handlemap_VkAccelerationStructureGeometryDataKHR(
+    VulkanHandleMapping* handlemap, VkAccelerationStructureGeometryDataKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    handlemap_VkAccelerationStructureGeometryTrianglesDataKHR(
+        handlemap, (VkAccelerationStructureGeometryTrianglesDataKHR*)(&toMap->triangles));
+    handlemap_VkAccelerationStructureGeometryAabbsDataKHR(
+        handlemap, (VkAccelerationStructureGeometryAabbsDataKHR*)(&toMap->aabbs));
+    handlemap_VkAccelerationStructureGeometryInstancesDataKHR(
+        handlemap, (VkAccelerationStructureGeometryInstancesDataKHR*)(&toMap->instances));
+}
+
+void handlemap_VkAccelerationStructureGeometryKHR(VulkanHandleMapping* handlemap,
+                                                  VkAccelerationStructureGeometryKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkAccelerationStructureGeometryDataKHR(
+        handlemap, (VkAccelerationStructureGeometryDataKHR*)(&toMap->geometry));
+}
+
+void handlemap_VkAccelerationStructureBuildGeometryInfoKHR(
+    VulkanHandleMapping* handlemap, VkAccelerationStructureBuildGeometryInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkAccelerationStructureKHR(
+        (VkAccelerationStructureKHR*)&toMap->srcAccelerationStructure);
+    handlemap->mapHandles_VkAccelerationStructureKHR(
+        (VkAccelerationStructureKHR*)&toMap->dstAccelerationStructure);
+    if (toMap) {
+        if (toMap->pGeometries) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->geometryCount; ++i) {
+                handlemap_VkAccelerationStructureGeometryKHR(
+                    handlemap, (VkAccelerationStructureGeometryKHR*)(toMap->pGeometries + i));
+            }
+        }
+    }
+    handlemap_VkDeviceOrHostAddressKHR(handlemap, (VkDeviceOrHostAddressKHR*)(&toMap->scratchData));
+}
+
+void handlemap_VkAccelerationStructureCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                                    VkAccelerationStructureCreateInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkBuffer((VkBuffer*)&toMap->buffer);
+}
+
+void handlemap_VkWriteDescriptorSetAccelerationStructureKHR(
+    VulkanHandleMapping* handlemap, VkWriteDescriptorSetAccelerationStructureKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap->pAccelerationStructures) {
+        handlemap->mapHandles_VkAccelerationStructureKHR(
+            (VkAccelerationStructureKHR*)toMap->pAccelerationStructures,
+            toMap->accelerationStructureCount);
+    }
+}
+
+void handlemap_VkPhysicalDeviceAccelerationStructureFeaturesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceAccelerationStructureFeaturesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceAccelerationStructurePropertiesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceAccelerationStructurePropertiesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkAccelerationStructureDeviceAddressInfoKHR(
+    VulkanHandleMapping* handlemap, VkAccelerationStructureDeviceAddressInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkAccelerationStructureKHR(
+        (VkAccelerationStructureKHR*)&toMap->accelerationStructure);
+}
+
+void handlemap_VkAccelerationStructureVersionInfoKHR(VulkanHandleMapping* handlemap,
+                                                     VkAccelerationStructureVersionInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkCopyAccelerationStructureToMemoryInfoKHR(
+    VulkanHandleMapping* handlemap, VkCopyAccelerationStructureToMemoryInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkAccelerationStructureKHR((VkAccelerationStructureKHR*)&toMap->src);
+    handlemap_VkDeviceOrHostAddressKHR(handlemap, (VkDeviceOrHostAddressKHR*)(&toMap->dst));
+}
+
+void handlemap_VkCopyMemoryToAccelerationStructureInfoKHR(
+    VulkanHandleMapping* handlemap, VkCopyMemoryToAccelerationStructureInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap_VkDeviceOrHostAddressConstKHR(handlemap,
+                                            (VkDeviceOrHostAddressConstKHR*)(&toMap->src));
+    handlemap->mapHandles_VkAccelerationStructureKHR((VkAccelerationStructureKHR*)&toMap->dst);
+}
+
+void handlemap_VkCopyAccelerationStructureInfoKHR(VulkanHandleMapping* handlemap,
+                                                  VkCopyAccelerationStructureInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    handlemap->mapHandles_VkAccelerationStructureKHR((VkAccelerationStructureKHR*)&toMap->src);
+    handlemap->mapHandles_VkAccelerationStructureKHR((VkAccelerationStructureKHR*)&toMap->dst);
+}
+
+void handlemap_VkAccelerationStructureBuildSizesInfoKHR(
+    VulkanHandleMapping* handlemap, VkAccelerationStructureBuildSizesInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+void handlemap_VkRayTracingShaderGroupCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                                    VkRayTracingShaderGroupCreateInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkRayTracingPipelineInterfaceCreateInfoKHR(
+    VulkanHandleMapping* handlemap, VkRayTracingPipelineInterfaceCreateInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkRayTracingPipelineCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                                 VkRayTracingPipelineCreateInfoKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+    if (toMap) {
+        if (toMap->pStages) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->stageCount; ++i) {
+                handlemap_VkPipelineShaderStageCreateInfo(
+                    handlemap, (VkPipelineShaderStageCreateInfo*)(toMap->pStages + i));
+            }
+        }
+    }
+    if (toMap) {
+        if (toMap->pGroups) {
+            for (uint32_t i = 0; i < (uint32_t)toMap->groupCount; ++i) {
+                handlemap_VkRayTracingShaderGroupCreateInfoKHR(
+                    handlemap, (VkRayTracingShaderGroupCreateInfoKHR*)(toMap->pGroups + i));
+            }
+        }
+    }
+    if (toMap->pLibraryInfo) {
+        handlemap_VkPipelineLibraryCreateInfoKHR(
+            handlemap, (VkPipelineLibraryCreateInfoKHR*)(toMap->pLibraryInfo));
+    }
+    if (toMap->pLibraryInterface) {
+        handlemap_VkRayTracingPipelineInterfaceCreateInfoKHR(
+            handlemap, (VkRayTracingPipelineInterfaceCreateInfoKHR*)(toMap->pLibraryInterface));
+    }
+    if (toMap->pDynamicState) {
+        handlemap_VkPipelineDynamicStateCreateInfo(
+            handlemap, (VkPipelineDynamicStateCreateInfo*)(toMap->pDynamicState));
+    }
+    handlemap->mapHandles_VkPipelineLayout((VkPipelineLayout*)&toMap->layout);
+    handlemap->mapHandles_VkPipeline((VkPipeline*)&toMap->basePipelineHandle);
+}
+
+void handlemap_VkPhysicalDeviceRayTracingPipelineFeaturesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceRayTracingPipelineFeaturesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkPhysicalDeviceRayTracingPipelinePropertiesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceRayTracingPipelinePropertiesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+void handlemap_VkStridedDeviceAddressRegionKHR(VulkanHandleMapping* handlemap,
+                                               VkStridedDeviceAddressRegionKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+void handlemap_VkTraceRaysIndirectCommandKHR(VulkanHandleMapping* handlemap,
+                                             VkTraceRaysIndirectCommandKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+}
+
+#endif
+#ifdef VK_KHR_ray_query
+void handlemap_VkPhysicalDeviceRayQueryFeaturesKHR(VulkanHandleMapping* handlemap,
+                                                   VkPhysicalDeviceRayQueryFeaturesKHR* toMap) {
+    (void)handlemap;
+    (void)toMap;
+    if (toMap->pNext) {
+        handlemap_extension_struct(handlemap, (void*)(toMap->pNext));
+    }
+}
+
+#endif
+void handlemap_extension_struct(VulkanHandleMapping* handlemap, void* structExtension_out) {
+    if (!structExtension_out) {
+        return;
+    }
+    uint32_t structType = (uint32_t)goldfish_vk_struct_type(structExtension_out);
+    switch (structType) {
+#ifdef VK_VERSION_1_1
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES: {
+            handlemap_VkPhysicalDeviceSubgroupProperties(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceSubgroupProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: {
+            handlemap_VkPhysicalDevice16BitStorageFeatures(
+                handlemap,
+                reinterpret_cast<VkPhysicalDevice16BitStorageFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS: {
+            handlemap_VkMemoryDedicatedRequirements(
+                handlemap, reinterpret_cast<VkMemoryDedicatedRequirements*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO: {
+            handlemap_VkMemoryDedicatedAllocateInfo(
+                handlemap, reinterpret_cast<VkMemoryDedicatedAllocateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO: {
+            handlemap_VkMemoryAllocateFlagsInfo(
+                handlemap, reinterpret_cast<VkMemoryAllocateFlagsInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO: {
+            handlemap_VkDeviceGroupRenderPassBeginInfo(
+                handlemap,
+                reinterpret_cast<VkDeviceGroupRenderPassBeginInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO: {
+            handlemap_VkDeviceGroupCommandBufferBeginInfo(
+                handlemap,
+                reinterpret_cast<VkDeviceGroupCommandBufferBeginInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO: {
+            handlemap_VkDeviceGroupSubmitInfo(
+                handlemap, reinterpret_cast<VkDeviceGroupSubmitInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO: {
+            handlemap_VkDeviceGroupBindSparseInfo(
+                handlemap, reinterpret_cast<VkDeviceGroupBindSparseInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO: {
+            handlemap_VkBindBufferMemoryDeviceGroupInfo(
+                handlemap,
+                reinterpret_cast<VkBindBufferMemoryDeviceGroupInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO: {
+            handlemap_VkBindImageMemoryDeviceGroupInfo(
+                handlemap,
+                reinterpret_cast<VkBindImageMemoryDeviceGroupInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO: {
+            handlemap_VkDeviceGroupDeviceCreateInfo(
+                handlemap, reinterpret_cast<VkDeviceGroupDeviceCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: {
+            handlemap_VkPhysicalDeviceFeatures2(
+                handlemap, reinterpret_cast<VkPhysicalDeviceFeatures2*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES: {
+            handlemap_VkPhysicalDevicePointClippingProperties(
+                handlemap,
+                reinterpret_cast<VkPhysicalDevicePointClippingProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO: {
+            handlemap_VkRenderPassInputAttachmentAspectCreateInfo(
+                handlemap, reinterpret_cast<VkRenderPassInputAttachmentAspectCreateInfo*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO: {
+            handlemap_VkImageViewUsageCreateInfo(
+                handlemap, reinterpret_cast<VkImageViewUsageCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO: {
+            handlemap_VkPipelineTessellationDomainOriginStateCreateInfo(
+                handlemap, reinterpret_cast<VkPipelineTessellationDomainOriginStateCreateInfo*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO: {
+            handlemap_VkRenderPassMultiviewCreateInfo(
+                handlemap, reinterpret_cast<VkRenderPassMultiviewCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES: {
+            handlemap_VkPhysicalDeviceMultiviewFeatures(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceMultiviewFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES: {
+            handlemap_VkPhysicalDeviceMultiviewProperties(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceMultiviewProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES: {
+            handlemap_VkPhysicalDeviceVariablePointersFeatures(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceVariablePointersFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES: {
+            handlemap_VkPhysicalDeviceProtectedMemoryFeatures(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceProtectedMemoryFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES: {
+            handlemap_VkPhysicalDeviceProtectedMemoryProperties(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceProtectedMemoryProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO: {
+            handlemap_VkProtectedSubmitInfo(
+                handlemap, reinterpret_cast<VkProtectedSubmitInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO: {
+            handlemap_VkSamplerYcbcrConversionInfo(
+                handlemap, reinterpret_cast<VkSamplerYcbcrConversionInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO: {
+            handlemap_VkBindImagePlaneMemoryInfo(
+                handlemap, reinterpret_cast<VkBindImagePlaneMemoryInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO: {
+            handlemap_VkImagePlaneMemoryRequirementsInfo(
+                handlemap,
+                reinterpret_cast<VkImagePlaneMemoryRequirementsInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: {
+            handlemap_VkPhysicalDeviceSamplerYcbcrConversionFeatures(
+                handlemap, reinterpret_cast<VkPhysicalDeviceSamplerYcbcrConversionFeatures*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES: {
+            handlemap_VkSamplerYcbcrConversionImageFormatProperties(
+                handlemap, reinterpret_cast<VkSamplerYcbcrConversionImageFormatProperties*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO: {
+            handlemap_VkPhysicalDeviceExternalImageFormatInfo(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceExternalImageFormatInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES: {
+            handlemap_VkExternalImageFormatProperties(
+                handlemap, reinterpret_cast<VkExternalImageFormatProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES: {
+            handlemap_VkPhysicalDeviceIDProperties(
+                handlemap, reinterpret_cast<VkPhysicalDeviceIDProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO: {
+            handlemap_VkExternalMemoryImageCreateInfo(
+                handlemap, reinterpret_cast<VkExternalMemoryImageCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO: {
+            handlemap_VkExternalMemoryBufferCreateInfo(
+                handlemap,
+                reinterpret_cast<VkExternalMemoryBufferCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO: {
+            handlemap_VkExportMemoryAllocateInfo(
+                handlemap, reinterpret_cast<VkExportMemoryAllocateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO: {
+            handlemap_VkExportFenceCreateInfo(
+                handlemap, reinterpret_cast<VkExportFenceCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO: {
+            handlemap_VkExportSemaphoreCreateInfo(
+                handlemap, reinterpret_cast<VkExportSemaphoreCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES: {
+            handlemap_VkPhysicalDeviceMaintenance3Properties(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceMaintenance3Properties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES: {
+            handlemap_VkPhysicalDeviceShaderDrawParametersFeatures(
+                handlemap, reinterpret_cast<VkPhysicalDeviceShaderDrawParametersFeatures*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_VERSION_1_2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES: {
+            handlemap_VkPhysicalDeviceVulkan11Features(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceVulkan11Features*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES: {
+            handlemap_VkPhysicalDeviceVulkan11Properties(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceVulkan11Properties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES: {
+            handlemap_VkPhysicalDeviceVulkan12Features(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceVulkan12Features*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES: {
+            handlemap_VkPhysicalDeviceVulkan12Properties(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceVulkan12Properties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO: {
+            handlemap_VkImageFormatListCreateInfo(
+                handlemap, reinterpret_cast<VkImageFormatListCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES: {
+            handlemap_VkPhysicalDevice8BitStorageFeatures(
+                handlemap,
+                reinterpret_cast<VkPhysicalDevice8BitStorageFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES: {
+            handlemap_VkPhysicalDeviceDriverProperties(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceDriverProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES: {
+            handlemap_VkPhysicalDeviceShaderAtomicInt64Features(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceShaderAtomicInt64Features*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES: {
+            handlemap_VkPhysicalDeviceShaderFloat16Int8Features(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceShaderFloat16Int8Features*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES: {
+            handlemap_VkPhysicalDeviceFloatControlsProperties(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceFloatControlsProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO: {
+            handlemap_VkDescriptorSetLayoutBindingFlagsCreateInfo(
+                handlemap, reinterpret_cast<VkDescriptorSetLayoutBindingFlagsCreateInfo*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES: {
+            handlemap_VkPhysicalDeviceDescriptorIndexingFeatures(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceDescriptorIndexingFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES: {
+            handlemap_VkPhysicalDeviceDescriptorIndexingProperties(
+                handlemap, reinterpret_cast<VkPhysicalDeviceDescriptorIndexingProperties*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO: {
+            handlemap_VkDescriptorSetVariableDescriptorCountAllocateInfo(
+                handlemap, reinterpret_cast<VkDescriptorSetVariableDescriptorCountAllocateInfo*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT: {
+            handlemap_VkDescriptorSetVariableDescriptorCountLayoutSupport(
+                handlemap, reinterpret_cast<VkDescriptorSetVariableDescriptorCountLayoutSupport*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE: {
+            handlemap_VkSubpassDescriptionDepthStencilResolve(
+                handlemap,
+                reinterpret_cast<VkSubpassDescriptionDepthStencilResolve*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES: {
+            handlemap_VkPhysicalDeviceDepthStencilResolveProperties(
+                handlemap, reinterpret_cast<VkPhysicalDeviceDepthStencilResolveProperties*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES: {
+            handlemap_VkPhysicalDeviceScalarBlockLayoutFeatures(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceScalarBlockLayoutFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO: {
+            handlemap_VkImageStencilUsageCreateInfo(
+                handlemap, reinterpret_cast<VkImageStencilUsageCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO: {
+            handlemap_VkSamplerReductionModeCreateInfo(
+                handlemap,
+                reinterpret_cast<VkSamplerReductionModeCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES: {
+            handlemap_VkPhysicalDeviceSamplerFilterMinmaxProperties(
+                handlemap, reinterpret_cast<VkPhysicalDeviceSamplerFilterMinmaxProperties*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES: {
+            handlemap_VkPhysicalDeviceVulkanMemoryModelFeatures(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceVulkanMemoryModelFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES: {
+            handlemap_VkPhysicalDeviceImagelessFramebufferFeatures(
+                handlemap, reinterpret_cast<VkPhysicalDeviceImagelessFramebufferFeatures*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO: {
+            handlemap_VkFramebufferAttachmentsCreateInfo(
+                handlemap,
+                reinterpret_cast<VkFramebufferAttachmentsCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO: {
+            handlemap_VkRenderPassAttachmentBeginInfo(
+                handlemap, reinterpret_cast<VkRenderPassAttachmentBeginInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES: {
+            handlemap_VkPhysicalDeviceUniformBufferStandardLayoutFeatures(
+                handlemap, reinterpret_cast<VkPhysicalDeviceUniformBufferStandardLayoutFeatures*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES: {
+            handlemap_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures(
+                handlemap, reinterpret_cast<VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES: {
+            handlemap_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures(
+                handlemap, reinterpret_cast<VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT: {
+            handlemap_VkAttachmentReferenceStencilLayout(
+                handlemap,
+                reinterpret_cast<VkAttachmentReferenceStencilLayout*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT: {
+            handlemap_VkAttachmentDescriptionStencilLayout(
+                handlemap,
+                reinterpret_cast<VkAttachmentDescriptionStencilLayout*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES: {
+            handlemap_VkPhysicalDeviceHostQueryResetFeatures(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceHostQueryResetFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES: {
+            handlemap_VkPhysicalDeviceTimelineSemaphoreFeatures(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceTimelineSemaphoreFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES: {
+            handlemap_VkPhysicalDeviceTimelineSemaphoreProperties(
+                handlemap, reinterpret_cast<VkPhysicalDeviceTimelineSemaphoreProperties*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO: {
+            handlemap_VkSemaphoreTypeCreateInfo(
+                handlemap, reinterpret_cast<VkSemaphoreTypeCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO: {
+            handlemap_VkTimelineSemaphoreSubmitInfo(
+                handlemap, reinterpret_cast<VkTimelineSemaphoreSubmitInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES: {
+            handlemap_VkPhysicalDeviceBufferDeviceAddressFeatures(
+                handlemap, reinterpret_cast<VkPhysicalDeviceBufferDeviceAddressFeatures*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO: {
+            handlemap_VkBufferOpaqueCaptureAddressCreateInfo(
+                handlemap,
+                reinterpret_cast<VkBufferOpaqueCaptureAddressCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO: {
+            handlemap_VkMemoryOpaqueCaptureAddressAllocateInfo(
+                handlemap,
+                reinterpret_cast<VkMemoryOpaqueCaptureAddressAllocateInfo*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_swapchain
+        case VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR: {
+            handlemap_VkImageSwapchainCreateInfoKHR(
+                handlemap, reinterpret_cast<VkImageSwapchainCreateInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR: {
+            handlemap_VkBindImageMemorySwapchainInfoKHR(
+                handlemap,
+                reinterpret_cast<VkBindImageMemorySwapchainInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR: {
+            handlemap_VkDeviceGroupPresentInfoKHR(
+                handlemap, reinterpret_cast<VkDeviceGroupPresentInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR: {
+            handlemap_VkDeviceGroupSwapchainCreateInfoKHR(
+                handlemap,
+                reinterpret_cast<VkDeviceGroupSwapchainCreateInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_display_swapchain
+        case VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR: {
+            handlemap_VkDisplayPresentInfoKHR(
+                handlemap, reinterpret_cast<VkDisplayPresentInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_video_queue
+        case VK_STRUCTURE_TYPE_VIDEO_QUEUE_FAMILY_PROPERTIES_2_KHR: {
+            handlemap_VkVideoQueueFamilyProperties2KHR(
+                handlemap,
+                reinterpret_cast<VkVideoQueueFamilyProperties2KHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_PROFILE_KHR: {
+            handlemap_VkVideoProfileKHR(handlemap,
+                                        reinterpret_cast<VkVideoProfileKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_PROFILES_KHR: {
+            handlemap_VkVideoProfilesKHR(
+                handlemap, reinterpret_cast<VkVideoProfilesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_dynamic_rendering
+        case VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO_KHR: {
+            handlemap_VkPipelineRenderingCreateInfoKHR(
+                handlemap,
+                reinterpret_cast<VkPipelineRenderingCreateInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR: {
+            handlemap_VkPhysicalDeviceDynamicRenderingFeaturesKHR(
+                handlemap, reinterpret_cast<VkPhysicalDeviceDynamicRenderingFeaturesKHR*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO_KHR: {
+            handlemap_VkCommandBufferInheritanceRenderingInfoKHR(
+                handlemap,
+                reinterpret_cast<VkCommandBufferInheritanceRenderingInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR: {
+            handlemap_VkRenderingFragmentShadingRateAttachmentInfoKHR(
+                handlemap, reinterpret_cast<VkRenderingFragmentShadingRateAttachmentInfoKHR*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT: {
+            handlemap_VkRenderingFragmentDensityMapAttachmentInfoEXT(
+                handlemap, reinterpret_cast<VkRenderingFragmentDensityMapAttachmentInfoEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD: {
+            handlemap_VkAttachmentSampleCountInfoAMD(
+                handlemap, reinterpret_cast<VkAttachmentSampleCountInfoAMD*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX: {
+            handlemap_VkMultiviewPerViewAttributesInfoNVX(
+                handlemap,
+                reinterpret_cast<VkMultiviewPerViewAttributesInfoNVX*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_memory_win32
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR: {
+            handlemap_VkImportMemoryWin32HandleInfoKHR(
+                handlemap,
+                reinterpret_cast<VkImportMemoryWin32HandleInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR: {
+            handlemap_VkExportMemoryWin32HandleInfoKHR(
+                handlemap,
+                reinterpret_cast<VkExportMemoryWin32HandleInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_memory_fd
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR: {
+            handlemap_VkImportMemoryFdInfoKHR(
+                handlemap, reinterpret_cast<VkImportMemoryFdInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_win32_keyed_mutex
+        case VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR: {
+            handlemap_VkWin32KeyedMutexAcquireReleaseInfoKHR(
+                handlemap,
+                reinterpret_cast<VkWin32KeyedMutexAcquireReleaseInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+        case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR: {
+            handlemap_VkExportSemaphoreWin32HandleInfoKHR(
+                handlemap,
+                reinterpret_cast<VkExportSemaphoreWin32HandleInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR: {
+            handlemap_VkD3D12FenceSubmitInfoKHR(
+                handlemap, reinterpret_cast<VkD3D12FenceSubmitInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_push_descriptor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR: {
+            handlemap_VkPhysicalDevicePushDescriptorPropertiesKHR(
+                handlemap, reinterpret_cast<VkPhysicalDevicePushDescriptorPropertiesKHR*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_incremental_present
+        case VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR: {
+            handlemap_VkPresentRegionsKHR(
+                handlemap, reinterpret_cast<VkPresentRegionsKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shared_presentable_image
+        case VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR: {
+            handlemap_VkSharedPresentSurfaceCapabilitiesKHR(
+                handlemap,
+                reinterpret_cast<VkSharedPresentSurfaceCapabilitiesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_fence_win32
+        case VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR: {
+            handlemap_VkExportFenceWin32HandleInfoKHR(
+                handlemap, reinterpret_cast<VkExportFenceWin32HandleInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_performance_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR: {
+            handlemap_VkPhysicalDevicePerformanceQueryFeaturesKHR(
+                handlemap, reinterpret_cast<VkPhysicalDevicePerformanceQueryFeaturesKHR*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR: {
+            handlemap_VkPhysicalDevicePerformanceQueryPropertiesKHR(
+                handlemap, reinterpret_cast<VkPhysicalDevicePerformanceQueryPropertiesKHR*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR: {
+            handlemap_VkQueryPoolPerformanceCreateInfoKHR(
+                handlemap,
+                reinterpret_cast<VkQueryPoolPerformanceCreateInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR: {
+            handlemap_VkPerformanceQuerySubmitInfoKHR(
+                handlemap, reinterpret_cast<VkPerformanceQuerySubmitInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_portability_subset
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR: {
+            handlemap_VkPhysicalDevicePortabilitySubsetFeaturesKHR(
+                handlemap, reinterpret_cast<VkPhysicalDevicePortabilitySubsetFeaturesKHR*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR: {
+            handlemap_VkPhysicalDevicePortabilitySubsetPropertiesKHR(
+                handlemap, reinterpret_cast<VkPhysicalDevicePortabilitySubsetPropertiesKHR*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_clock
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR: {
+            handlemap_VkPhysicalDeviceShaderClockFeaturesKHR(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceShaderClockFeaturesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_terminate_invocation
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR: {
+            handlemap_VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR(
+                handlemap, reinterpret_cast<VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+        case VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR: {
+            handlemap_VkFragmentShadingRateAttachmentInfoKHR(
+                handlemap,
+                reinterpret_cast<VkFragmentShadingRateAttachmentInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR: {
+            handlemap_VkPipelineFragmentShadingRateStateCreateInfoKHR(
+                handlemap, reinterpret_cast<VkPipelineFragmentShadingRateStateCreateInfoKHR*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR: {
+            handlemap_VkPhysicalDeviceFragmentShadingRateFeaturesKHR(
+                handlemap, reinterpret_cast<VkPhysicalDeviceFragmentShadingRateFeaturesKHR*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR: {
+            handlemap_VkPhysicalDeviceFragmentShadingRatePropertiesKHR(
+                handlemap, reinterpret_cast<VkPhysicalDeviceFragmentShadingRatePropertiesKHR*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_surface_protected_capabilities
+        case VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR: {
+            handlemap_VkSurfaceProtectedCapabilitiesKHR(
+                handlemap,
+                reinterpret_cast<VkSurfaceProtectedCapabilitiesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_present_wait
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR: {
+            handlemap_VkPhysicalDevicePresentWaitFeaturesKHR(
+                handlemap,
+                reinterpret_cast<VkPhysicalDevicePresentWaitFeaturesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR: {
+            handlemap_VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR(
+                handlemap,
+                reinterpret_cast<VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_integer_dot_product
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR: {
+            handlemap_VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR(
+                handlemap, reinterpret_cast<VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR: {
+            handlemap_VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR(
+                handlemap, reinterpret_cast<VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_present_id
+        case VK_STRUCTURE_TYPE_PRESENT_ID_KHR: {
+            handlemap_VkPresentIdKHR(handlemap,
+                                     reinterpret_cast<VkPresentIdKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR: {
+            handlemap_VkPhysicalDevicePresentIdFeaturesKHR(
+                handlemap,
+                reinterpret_cast<VkPhysicalDevicePresentIdFeaturesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_video_encode_queue
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_INFO_KHR: {
+            handlemap_VkVideoEncodeRateControlInfoKHR(
+                handlemap, reinterpret_cast<VkVideoEncodeRateControlInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_synchronization2
+        case VK_STRUCTURE_TYPE_MEMORY_BARRIER_2_KHR: {
+            handlemap_VkMemoryBarrier2KHR(
+                handlemap, reinterpret_cast<VkMemoryBarrier2KHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR: {
+            handlemap_VkPhysicalDeviceSynchronization2FeaturesKHR(
+                handlemap, reinterpret_cast<VkPhysicalDeviceSynchronization2FeaturesKHR*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV: {
+            handlemap_VkQueueFamilyCheckpointProperties2NV(
+                handlemap,
+                reinterpret_cast<VkQueueFamilyCheckpointProperties2NV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_subgroup_uniform_control_flow
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR: {
+            handlemap_VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_zero_initialize_workgroup_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES_KHR: {
+            handlemap_VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_workgroup_memory_explicit_layout
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR: {
+            handlemap_VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_format_feature_flags2
+        case VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3_KHR: {
+            handlemap_VkFormatProperties3KHR(
+                handlemap, reinterpret_cast<VkFormatProperties3KHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_maintenance4
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES_KHR: {
+            handlemap_VkPhysicalDeviceMaintenance4FeaturesKHR(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceMaintenance4FeaturesKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES_KHR: {
+            handlemap_VkPhysicalDeviceMaintenance4PropertiesKHR(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceMaintenance4PropertiesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_ANDROID_native_buffer
+        case VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID: {
+            handlemap_VkNativeBufferANDROID(
+                handlemap, reinterpret_cast<VkNativeBufferANDROID*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_debug_report
+        case VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT: {
+            handlemap_VkDebugReportCallbackCreateInfoEXT(
+                handlemap,
+                reinterpret_cast<VkDebugReportCallbackCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_rasterization_order
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD: {
+            handlemap_VkPipelineRasterizationStateRasterizationOrderAMD(
+                handlemap, reinterpret_cast<VkPipelineRasterizationStateRasterizationOrderAMD*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_dedicated_allocation
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV: {
+            handlemap_VkDedicatedAllocationImageCreateInfoNV(
+                handlemap,
+                reinterpret_cast<VkDedicatedAllocationImageCreateInfoNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV: {
+            handlemap_VkDedicatedAllocationBufferCreateInfoNV(
+                handlemap,
+                reinterpret_cast<VkDedicatedAllocationBufferCreateInfoNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV: {
+            handlemap_VkDedicatedAllocationMemoryAllocateInfoNV(
+                handlemap,
+                reinterpret_cast<VkDedicatedAllocationMemoryAllocateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_transform_feedback
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceTransformFeedbackFeaturesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceTransformFeedbackFeaturesEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT: {
+            handlemap_VkPhysicalDeviceTransformFeedbackPropertiesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceTransformFeedbackPropertiesEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT: {
+            handlemap_VkPipelineRasterizationStateStreamCreateInfoEXT(
+                handlemap, reinterpret_cast<VkPipelineRasterizationStateStreamCreateInfoEXT*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_encode_h264
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_EXT: {
+            handlemap_VkVideoEncodeH264CapabilitiesEXT(
+                handlemap,
+                reinterpret_cast<VkVideoEncodeH264CapabilitiesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_CREATE_INFO_EXT: {
+            handlemap_VkVideoEncodeH264SessionCreateInfoEXT(
+                handlemap,
+                reinterpret_cast<VkVideoEncodeH264SessionCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            handlemap_VkVideoEncodeH264SessionParametersAddInfoEXT(
+                handlemap, reinterpret_cast<VkVideoEncodeH264SessionParametersAddInfoEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            handlemap_VkVideoEncodeH264SessionParametersCreateInfoEXT(
+                handlemap, reinterpret_cast<VkVideoEncodeH264SessionParametersCreateInfoEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_VCL_FRAME_INFO_EXT: {
+            handlemap_VkVideoEncodeH264VclFrameInfoEXT(
+                handlemap,
+                reinterpret_cast<VkVideoEncodeH264VclFrameInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_EMIT_PICTURE_PARAMETERS_EXT: {
+            handlemap_VkVideoEncodeH264EmitPictureParametersEXT(
+                handlemap,
+                reinterpret_cast<VkVideoEncodeH264EmitPictureParametersEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_EXT: {
+            handlemap_VkVideoEncodeH264ProfileEXT(
+                handlemap, reinterpret_cast<VkVideoEncodeH264ProfileEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_encode_h265
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_EXT: {
+            handlemap_VkVideoEncodeH265CapabilitiesEXT(
+                handlemap,
+                reinterpret_cast<VkVideoEncodeH265CapabilitiesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_CREATE_INFO_EXT: {
+            handlemap_VkVideoEncodeH265SessionCreateInfoEXT(
+                handlemap,
+                reinterpret_cast<VkVideoEncodeH265SessionCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            handlemap_VkVideoEncodeH265SessionParametersAddInfoEXT(
+                handlemap, reinterpret_cast<VkVideoEncodeH265SessionParametersAddInfoEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            handlemap_VkVideoEncodeH265SessionParametersCreateInfoEXT(
+                handlemap, reinterpret_cast<VkVideoEncodeH265SessionParametersCreateInfoEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_VCL_FRAME_INFO_EXT: {
+            handlemap_VkVideoEncodeH265VclFrameInfoEXT(
+                handlemap,
+                reinterpret_cast<VkVideoEncodeH265VclFrameInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_EMIT_PICTURE_PARAMETERS_EXT: {
+            handlemap_VkVideoEncodeH265EmitPictureParametersEXT(
+                handlemap,
+                reinterpret_cast<VkVideoEncodeH265EmitPictureParametersEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_EXT: {
+            handlemap_VkVideoEncodeH265ProfileEXT(
+                handlemap, reinterpret_cast<VkVideoEncodeH265ProfileEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_decode_h264
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_EXT: {
+            handlemap_VkVideoDecodeH264ProfileEXT(
+                handlemap, reinterpret_cast<VkVideoDecodeH264ProfileEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_EXT: {
+            handlemap_VkVideoDecodeH264CapabilitiesEXT(
+                handlemap,
+                reinterpret_cast<VkVideoDecodeH264CapabilitiesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_CREATE_INFO_EXT: {
+            handlemap_VkVideoDecodeH264SessionCreateInfoEXT(
+                handlemap,
+                reinterpret_cast<VkVideoDecodeH264SessionCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            handlemap_VkVideoDecodeH264SessionParametersAddInfoEXT(
+                handlemap, reinterpret_cast<VkVideoDecodeH264SessionParametersAddInfoEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            handlemap_VkVideoDecodeH264SessionParametersCreateInfoEXT(
+                handlemap, reinterpret_cast<VkVideoDecodeH264SessionParametersCreateInfoEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PICTURE_INFO_EXT: {
+            handlemap_VkVideoDecodeH264PictureInfoEXT(
+                handlemap, reinterpret_cast<VkVideoDecodeH264PictureInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_MVC_EXT: {
+            handlemap_VkVideoDecodeH264MvcEXT(
+                handlemap, reinterpret_cast<VkVideoDecodeH264MvcEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_EXT: {
+            handlemap_VkVideoDecodeH264DpbSlotInfoEXT(
+                handlemap, reinterpret_cast<VkVideoDecodeH264DpbSlotInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_texture_gather_bias_lod
+        case VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD: {
+            handlemap_VkTextureLODGatherFormatPropertiesAMD(
+                handlemap,
+                reinterpret_cast<VkTextureLODGatherFormatPropertiesAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_corner_sampled_image
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV: {
+            handlemap_VkPhysicalDeviceCornerSampledImageFeaturesNV(
+                handlemap, reinterpret_cast<VkPhysicalDeviceCornerSampledImageFeaturesNV*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_external_memory
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV: {
+            handlemap_VkExternalMemoryImageCreateInfoNV(
+                handlemap,
+                reinterpret_cast<VkExternalMemoryImageCreateInfoNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV: {
+            handlemap_VkExportMemoryAllocateInfoNV(
+                handlemap, reinterpret_cast<VkExportMemoryAllocateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_external_memory_win32
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV: {
+            handlemap_VkImportMemoryWin32HandleInfoNV(
+                handlemap, reinterpret_cast<VkImportMemoryWin32HandleInfoNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV: {
+            handlemap_VkExportMemoryWin32HandleInfoNV(
+                handlemap, reinterpret_cast<VkExportMemoryWin32HandleInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_win32_keyed_mutex
+        case VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV: {
+            handlemap_VkWin32KeyedMutexAcquireReleaseInfoNV(
+                handlemap,
+                reinterpret_cast<VkWin32KeyedMutexAcquireReleaseInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_validation_flags
+        case VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT: {
+            handlemap_VkValidationFlagsEXT(
+                handlemap, reinterpret_cast<VkValidationFlagsEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_texture_compression_astc_hdr
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_astc_decode_mode
+        case VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT: {
+            handlemap_VkImageViewASTCDecodeModeEXT(
+                handlemap, reinterpret_cast<VkImageViewASTCDecodeModeEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceASTCDecodeFeaturesEXT(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceASTCDecodeFeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_conditional_rendering
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceConditionalRenderingFeaturesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceConditionalRenderingFeaturesEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT: {
+            handlemap_VkCommandBufferInheritanceConditionalRenderingInfoEXT(
+                handlemap, reinterpret_cast<VkCommandBufferInheritanceConditionalRenderingInfoEXT*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV: {
+            handlemap_VkPipelineViewportWScalingStateCreateInfoNV(
+                handlemap, reinterpret_cast<VkPipelineViewportWScalingStateCreateInfoNV*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_display_control
+        case VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT: {
+            handlemap_VkSwapchainCounterCreateInfoEXT(
+                handlemap, reinterpret_cast<VkSwapchainCounterCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_GOOGLE_display_timing
+        case VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE: {
+            handlemap_VkPresentTimesInfoGOOGLE(
+                handlemap, reinterpret_cast<VkPresentTimesInfoGOOGLE*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NVX_multiview_per_view_attributes
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX: {
+            handlemap_VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_viewport_swizzle
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV: {
+            handlemap_VkPipelineViewportSwizzleStateCreateInfoNV(
+                handlemap,
+                reinterpret_cast<VkPipelineViewportSwizzleStateCreateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_discard_rectangles
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT: {
+            handlemap_VkPhysicalDeviceDiscardRectanglePropertiesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceDiscardRectanglePropertiesEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT: {
+            handlemap_VkPipelineDiscardRectangleStateCreateInfoEXT(
+                handlemap, reinterpret_cast<VkPipelineDiscardRectangleStateCreateInfoEXT*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_conservative_rasterization
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT: {
+            handlemap_VkPhysicalDeviceConservativeRasterizationPropertiesEXT(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceConservativeRasterizationPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT: {
+            handlemap_VkPipelineRasterizationConservativeStateCreateInfoEXT(
+                handlemap, reinterpret_cast<VkPipelineRasterizationConservativeStateCreateInfoEXT*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_depth_clip_enable
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceDepthClipEnableFeaturesEXT(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceDepthClipEnableFeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT: {
+            handlemap_VkPipelineRasterizationDepthClipStateCreateInfoEXT(
+                handlemap, reinterpret_cast<VkPipelineRasterizationDepthClipStateCreateInfoEXT*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_debug_utils
+        case VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT: {
+            handlemap_VkDebugUtilsMessengerCreateInfoEXT(
+                handlemap,
+                reinterpret_cast<VkDebugUtilsMessengerCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID: {
+            handlemap_VkAndroidHardwareBufferUsageANDROID(
+                handlemap,
+                reinterpret_cast<VkAndroidHardwareBufferUsageANDROID*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID: {
+            handlemap_VkAndroidHardwareBufferFormatPropertiesANDROID(
+                handlemap, reinterpret_cast<VkAndroidHardwareBufferFormatPropertiesANDROID*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID: {
+            handlemap_VkImportAndroidHardwareBufferInfoANDROID(
+                handlemap,
+                reinterpret_cast<VkImportAndroidHardwareBufferInfoANDROID*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID: {
+            handlemap_VkExternalFormatANDROID(
+                handlemap, reinterpret_cast<VkExternalFormatANDROID*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID: {
+            handlemap_VkAndroidHardwareBufferFormatProperties2ANDROID(
+                handlemap, reinterpret_cast<VkAndroidHardwareBufferFormatProperties2ANDROID*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_inline_uniform_block
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceInlineUniformBlockFeaturesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceInlineUniformBlockFeaturesEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT: {
+            handlemap_VkPhysicalDeviceInlineUniformBlockPropertiesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceInlineUniformBlockPropertiesEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT: {
+            handlemap_VkWriteDescriptorSetInlineUniformBlockEXT(
+                handlemap,
+                reinterpret_cast<VkWriteDescriptorSetInlineUniformBlockEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO_EXT: {
+            handlemap_VkDescriptorPoolInlineUniformBlockCreateInfoEXT(
+                handlemap, reinterpret_cast<VkDescriptorPoolInlineUniformBlockCreateInfoEXT*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_sample_locations
+        case VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT: {
+            handlemap_VkSampleLocationsInfoEXT(
+                handlemap, reinterpret_cast<VkSampleLocationsInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT: {
+            handlemap_VkRenderPassSampleLocationsBeginInfoEXT(
+                handlemap,
+                reinterpret_cast<VkRenderPassSampleLocationsBeginInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT: {
+            handlemap_VkPipelineSampleLocationsStateCreateInfoEXT(
+                handlemap, reinterpret_cast<VkPipelineSampleLocationsStateCreateInfoEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT: {
+            handlemap_VkPhysicalDeviceSampleLocationsPropertiesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceSampleLocationsPropertiesEXT*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_blend_operation_advanced
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT: {
+            handlemap_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT: {
+            handlemap_VkPipelineColorBlendAdvancedStateCreateInfoEXT(
+                handlemap, reinterpret_cast<VkPipelineColorBlendAdvancedStateCreateInfoEXT*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_fragment_coverage_to_color
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV: {
+            handlemap_VkPipelineCoverageToColorStateCreateInfoNV(
+                handlemap,
+                reinterpret_cast<VkPipelineCoverageToColorStateCreateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_framebuffer_mixed_samples
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV: {
+            handlemap_VkPipelineCoverageModulationStateCreateInfoNV(
+                handlemap, reinterpret_cast<VkPipelineCoverageModulationStateCreateInfoNV*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_shader_sm_builtins
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV: {
+            handlemap_VkPhysicalDeviceShaderSMBuiltinsPropertiesNV(
+                handlemap, reinterpret_cast<VkPhysicalDeviceShaderSMBuiltinsPropertiesNV*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV: {
+            handlemap_VkPhysicalDeviceShaderSMBuiltinsFeaturesNV(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceShaderSMBuiltinsFeaturesNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+        case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT: {
+            handlemap_VkDrmFormatModifierPropertiesListEXT(
+                handlemap,
+                reinterpret_cast<VkDrmFormatModifierPropertiesListEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT: {
+            handlemap_VkPhysicalDeviceImageDrmFormatModifierInfoEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceImageDrmFormatModifierInfoEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT: {
+            handlemap_VkImageDrmFormatModifierListCreateInfoEXT(
+                handlemap,
+                reinterpret_cast<VkImageDrmFormatModifierListCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT: {
+            handlemap_VkImageDrmFormatModifierExplicitCreateInfoEXT(
+                handlemap, reinterpret_cast<VkImageDrmFormatModifierExplicitCreateInfoEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT: {
+            handlemap_VkDrmFormatModifierPropertiesList2EXT(
+                handlemap,
+                reinterpret_cast<VkDrmFormatModifierPropertiesList2EXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_validation_cache
+        case VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT: {
+            handlemap_VkShaderModuleValidationCacheCreateInfoEXT(
+                handlemap,
+                reinterpret_cast<VkShaderModuleValidationCacheCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_shading_rate_image
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV: {
+            handlemap_VkPipelineViewportShadingRateImageStateCreateInfoNV(
+                handlemap, reinterpret_cast<VkPipelineViewportShadingRateImageStateCreateInfoNV*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV: {
+            handlemap_VkPhysicalDeviceShadingRateImageFeaturesNV(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceShadingRateImageFeaturesNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV: {
+            handlemap_VkPhysicalDeviceShadingRateImagePropertiesNV(
+                handlemap, reinterpret_cast<VkPhysicalDeviceShadingRateImagePropertiesNV*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV: {
+            handlemap_VkPipelineViewportCoarseSampleOrderStateCreateInfoNV(
+                handlemap, reinterpret_cast<VkPipelineViewportCoarseSampleOrderStateCreateInfoNV*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_ray_tracing
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV: {
+            handlemap_VkWriteDescriptorSetAccelerationStructureNV(
+                handlemap, reinterpret_cast<VkWriteDescriptorSetAccelerationStructureNV*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV: {
+            handlemap_VkPhysicalDeviceRayTracingPropertiesNV(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceRayTracingPropertiesNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_representative_fragment_test
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV: {
+            handlemap_VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV(
+                handlemap, reinterpret_cast<VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV: {
+            handlemap_VkPipelineRepresentativeFragmentTestStateCreateInfoNV(
+                handlemap, reinterpret_cast<VkPipelineRepresentativeFragmentTestStateCreateInfoNV*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_filter_cubic
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT: {
+            handlemap_VkPhysicalDeviceImageViewImageFormatInfoEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceImageViewImageFormatInfoEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT: {
+            handlemap_VkFilterCubicImageViewImageFormatPropertiesEXT(
+                handlemap, reinterpret_cast<VkFilterCubicImageViewImageFormatPropertiesEXT*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_global_priority
+        case VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT: {
+            handlemap_VkDeviceQueueGlobalPriorityCreateInfoEXT(
+                handlemap,
+                reinterpret_cast<VkDeviceQueueGlobalPriorityCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_external_memory_host
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT: {
+            handlemap_VkImportMemoryHostPointerInfoEXT(
+                handlemap,
+                reinterpret_cast<VkImportMemoryHostPointerInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT: {
+            handlemap_VkPhysicalDeviceExternalMemoryHostPropertiesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceExternalMemoryHostPropertiesEXT*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_pipeline_compiler_control
+        case VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD: {
+            handlemap_VkPipelineCompilerControlCreateInfoAMD(
+                handlemap,
+                reinterpret_cast<VkPipelineCompilerControlCreateInfoAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_shader_core_properties
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD: {
+            handlemap_VkPhysicalDeviceShaderCorePropertiesAMD(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceShaderCorePropertiesAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_decode_h265
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_EXT: {
+            handlemap_VkVideoDecodeH265ProfileEXT(
+                handlemap, reinterpret_cast<VkVideoDecodeH265ProfileEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_EXT: {
+            handlemap_VkVideoDecodeH265CapabilitiesEXT(
+                handlemap,
+                reinterpret_cast<VkVideoDecodeH265CapabilitiesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_CREATE_INFO_EXT: {
+            handlemap_VkVideoDecodeH265SessionCreateInfoEXT(
+                handlemap,
+                reinterpret_cast<VkVideoDecodeH265SessionCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            handlemap_VkVideoDecodeH265SessionParametersAddInfoEXT(
+                handlemap, reinterpret_cast<VkVideoDecodeH265SessionParametersAddInfoEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            handlemap_VkVideoDecodeH265SessionParametersCreateInfoEXT(
+                handlemap, reinterpret_cast<VkVideoDecodeH265SessionParametersCreateInfoEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PICTURE_INFO_EXT: {
+            handlemap_VkVideoDecodeH265PictureInfoEXT(
+                handlemap, reinterpret_cast<VkVideoDecodeH265PictureInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_EXT: {
+            handlemap_VkVideoDecodeH265DpbSlotInfoEXT(
+                handlemap, reinterpret_cast<VkVideoDecodeH265DpbSlotInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_memory_overallocation_behavior
+        case VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD: {
+            handlemap_VkDeviceMemoryOverallocationCreateInfoAMD(
+                handlemap,
+                reinterpret_cast<VkDeviceMemoryOverallocationCreateInfoAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_vertex_attribute_divisor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT: {
+            handlemap_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT: {
+            handlemap_VkPipelineVertexInputDivisorStateCreateInfoEXT(
+                handlemap, reinterpret_cast<VkPipelineVertexInputDivisorStateCreateInfoEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_GGP_frame_token
+        case VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP: {
+            handlemap_VkPresentFrameTokenGGP(
+                handlemap, reinterpret_cast<VkPresentFrameTokenGGP*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_pipeline_creation_feedback
+        case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT: {
+            handlemap_VkPipelineCreationFeedbackCreateInfoEXT(
+                handlemap,
+                reinterpret_cast<VkPipelineCreationFeedbackCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_compute_shader_derivatives
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV: {
+            handlemap_VkPhysicalDeviceComputeShaderDerivativesFeaturesNV(
+                handlemap, reinterpret_cast<VkPhysicalDeviceComputeShaderDerivativesFeaturesNV*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_mesh_shader
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV: {
+            handlemap_VkPhysicalDeviceMeshShaderFeaturesNV(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceMeshShaderFeaturesNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV: {
+            handlemap_VkPhysicalDeviceMeshShaderPropertiesNV(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceMeshShaderPropertiesNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_fragment_shader_barycentric
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV: {
+            handlemap_VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV(
+                handlemap, reinterpret_cast<VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_shader_image_footprint
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV: {
+            handlemap_VkPhysicalDeviceShaderImageFootprintFeaturesNV(
+                handlemap, reinterpret_cast<VkPhysicalDeviceShaderImageFootprintFeaturesNV*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_scissor_exclusive
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV: {
+            handlemap_VkPipelineViewportExclusiveScissorStateCreateInfoNV(
+                handlemap, reinterpret_cast<VkPipelineViewportExclusiveScissorStateCreateInfoNV*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV: {
+            handlemap_VkPhysicalDeviceExclusiveScissorFeaturesNV(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceExclusiveScissorFeaturesNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV: {
+            handlemap_VkQueueFamilyCheckpointPropertiesNV(
+                handlemap,
+                reinterpret_cast<VkQueueFamilyCheckpointPropertiesNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_INTEL_shader_integer_functions2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL: {
+            handlemap_VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL(
+                handlemap, reinterpret_cast<VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_INTEL_performance_query
+        case VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL: {
+            handlemap_VkQueryPoolPerformanceQueryCreateInfoINTEL(
+                handlemap,
+                reinterpret_cast<VkQueryPoolPerformanceQueryCreateInfoINTEL*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_pci_bus_info
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT: {
+            handlemap_VkPhysicalDevicePCIBusInfoPropertiesEXT(
+                handlemap,
+                reinterpret_cast<VkPhysicalDevicePCIBusInfoPropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_display_native_hdr
+        case VK_STRUCTURE_TYPE_DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD: {
+            handlemap_VkDisplayNativeHdrSurfaceCapabilitiesAMD(
+                handlemap,
+                reinterpret_cast<VkDisplayNativeHdrSurfaceCapabilitiesAMD*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD: {
+            handlemap_VkSwapchainDisplayNativeHdrCreateInfoAMD(
+                handlemap,
+                reinterpret_cast<VkSwapchainDisplayNativeHdrCreateInfoAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_fragment_density_map
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceFragmentDensityMapFeaturesEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT: {
+            handlemap_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceFragmentDensityMapPropertiesEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT: {
+            handlemap_VkRenderPassFragmentDensityMapCreateInfoEXT(
+                handlemap, reinterpret_cast<VkRenderPassFragmentDensityMapCreateInfoEXT*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_subgroup_size_control
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceSubgroupSizeControlFeaturesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceSubgroupSizeControlFeaturesEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT: {
+            handlemap_VkPhysicalDeviceSubgroupSizeControlPropertiesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceSubgroupSizeControlPropertiesEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT: {
+            handlemap_VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT(
+                handlemap,
+                reinterpret_cast<VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_shader_core_properties2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD: {
+            handlemap_VkPhysicalDeviceShaderCoreProperties2AMD(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceShaderCoreProperties2AMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_device_coherent_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD: {
+            handlemap_VkPhysicalDeviceCoherentMemoryFeaturesAMD(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceCoherentMemoryFeaturesAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_image_atomic_int64
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_memory_budget
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT: {
+            handlemap_VkPhysicalDeviceMemoryBudgetPropertiesEXT(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceMemoryBudgetPropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_memory_priority
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceMemoryPriorityFeaturesEXT(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceMemoryPriorityFeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT: {
+            handlemap_VkMemoryPriorityAllocateInfoEXT(
+                handlemap, reinterpret_cast<VkMemoryPriorityAllocateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_dedicated_allocation_image_aliasing
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV: {
+            handlemap_VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_buffer_device_address
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceBufferDeviceAddressFeaturesEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT: {
+            handlemap_VkBufferDeviceAddressCreateInfoEXT(
+                handlemap,
+                reinterpret_cast<VkBufferDeviceAddressCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_validation_features
+        case VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT: {
+            handlemap_VkValidationFeaturesEXT(
+                handlemap, reinterpret_cast<VkValidationFeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_cooperative_matrix
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV: {
+            handlemap_VkPhysicalDeviceCooperativeMatrixFeaturesNV(
+                handlemap, reinterpret_cast<VkPhysicalDeviceCooperativeMatrixFeaturesNV*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV: {
+            handlemap_VkPhysicalDeviceCooperativeMatrixPropertiesNV(
+                handlemap, reinterpret_cast<VkPhysicalDeviceCooperativeMatrixPropertiesNV*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV: {
+            handlemap_VkPhysicalDeviceCoverageReductionModeFeaturesNV(
+                handlemap, reinterpret_cast<VkPhysicalDeviceCoverageReductionModeFeaturesNV*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV: {
+            handlemap_VkPipelineCoverageReductionStateCreateInfoNV(
+                handlemap, reinterpret_cast<VkPipelineCoverageReductionStateCreateInfoNV*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_fragment_shader_interlock
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_ycbcr_image_arrays
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceYcbcrImageArraysFeaturesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceYcbcrImageArraysFeaturesEXT*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_provoking_vertex
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceProvokingVertexFeaturesEXT(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceProvokingVertexFeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT: {
+            handlemap_VkPhysicalDeviceProvokingVertexPropertiesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceProvokingVertexPropertiesEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT: {
+            handlemap_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT(
+                handlemap,
+                reinterpret_cast<VkPipelineRasterizationProvokingVertexStateCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+        case VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT: {
+            handlemap_VkSurfaceFullScreenExclusiveInfoEXT(
+                handlemap,
+                reinterpret_cast<VkSurfaceFullScreenExclusiveInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT: {
+            handlemap_VkSurfaceCapabilitiesFullScreenExclusiveEXT(
+                handlemap, reinterpret_cast<VkSurfaceCapabilitiesFullScreenExclusiveEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT: {
+            handlemap_VkSurfaceFullScreenExclusiveWin32InfoEXT(
+                handlemap,
+                reinterpret_cast<VkSurfaceFullScreenExclusiveWin32InfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_line_rasterization
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceLineRasterizationFeaturesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceLineRasterizationFeaturesEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT: {
+            handlemap_VkPhysicalDeviceLineRasterizationPropertiesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceLineRasterizationPropertiesEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT: {
+            handlemap_VkPipelineRasterizationLineStateCreateInfoEXT(
+                handlemap, reinterpret_cast<VkPipelineRasterizationLineStateCreateInfoEXT*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_atomic_float
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceShaderAtomicFloatFeaturesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceShaderAtomicFloatFeaturesEXT*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_index_type_uint8
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceIndexTypeUint8FeaturesEXT(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceIndexTypeUint8FeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceExtendedDynamicStateFeaturesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceExtendedDynamicStateFeaturesEXT*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_atomic_float2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_demote_to_helper_invocation
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_device_generated_commands
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV: {
+            handlemap_VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV(
+                handlemap, reinterpret_cast<VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV: {
+            handlemap_VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV(
+                handlemap, reinterpret_cast<VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV: {
+            handlemap_VkGraphicsPipelineShaderGroupsCreateInfoNV(
+                handlemap,
+                reinterpret_cast<VkGraphicsPipelineShaderGroupsCreateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_inherited_viewport_scissor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV: {
+            handlemap_VkPhysicalDeviceInheritedViewportScissorFeaturesNV(
+                handlemap, reinterpret_cast<VkPhysicalDeviceInheritedViewportScissorFeaturesNV*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV: {
+            handlemap_VkCommandBufferInheritanceViewportScissorInfoNV(
+                handlemap, reinterpret_cast<VkCommandBufferInheritanceViewportScissorInfoNV*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_texel_buffer_alignment
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT: {
+            handlemap_VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_QCOM_render_pass_transform
+        case VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM: {
+            handlemap_VkRenderPassTransformBeginInfoQCOM(
+                handlemap,
+                reinterpret_cast<VkRenderPassTransformBeginInfoQCOM*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM: {
+            handlemap_VkCommandBufferInheritanceRenderPassTransformInfoQCOM(
+                handlemap, reinterpret_cast<VkCommandBufferInheritanceRenderPassTransformInfoQCOM*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_device_memory_report
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceDeviceMemoryReportFeaturesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceDeviceMemoryReportFeaturesEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT: {
+            handlemap_VkDeviceDeviceMemoryReportCreateInfoEXT(
+                handlemap,
+                reinterpret_cast<VkDeviceDeviceMemoryReportCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_robustness2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceRobustness2FeaturesEXT(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceRobustness2FeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT: {
+            handlemap_VkPhysicalDeviceRobustness2PropertiesEXT(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceRobustness2PropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_custom_border_color
+        case VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT: {
+            handlemap_VkSamplerCustomBorderColorCreateInfoEXT(
+                handlemap,
+                reinterpret_cast<VkSamplerCustomBorderColorCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT: {
+            handlemap_VkPhysicalDeviceCustomBorderColorPropertiesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceCustomBorderColorPropertiesEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceCustomBorderColorFeaturesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceCustomBorderColorFeaturesEXT*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_private_data
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT: {
+            handlemap_VkPhysicalDevicePrivateDataFeaturesEXT(
+                handlemap,
+                reinterpret_cast<VkPhysicalDevicePrivateDataFeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO_EXT: {
+            handlemap_VkDevicePrivateDataCreateInfoEXT(
+                handlemap,
+                reinterpret_cast<VkDevicePrivateDataCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_pipeline_creation_cache_control
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES_EXT: {
+            handlemap_VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT(
+                handlemap,
+                reinterpret_cast<VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_device_diagnostics_config
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV: {
+            handlemap_VkPhysicalDeviceDiagnosticsConfigFeaturesNV(
+                handlemap, reinterpret_cast<VkPhysicalDeviceDiagnosticsConfigFeaturesNV*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV: {
+            handlemap_VkDeviceDiagnosticsConfigCreateInfoNV(
+                handlemap,
+                reinterpret_cast<VkDeviceDiagnosticsConfigCreateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV: {
+            handlemap_VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV(
+                handlemap, reinterpret_cast<VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV: {
+            handlemap_VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV(
+                handlemap, reinterpret_cast<VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV: {
+            handlemap_VkPipelineFragmentShadingRateEnumStateCreateInfoNV(
+                handlemap, reinterpret_cast<VkPipelineFragmentShadingRateEnumStateCreateInfoNV*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_ray_tracing_motion_blur
+        case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV: {
+            handlemap_VkAccelerationStructureGeometryMotionTrianglesDataNV(
+                handlemap, reinterpret_cast<VkAccelerationStructureGeometryMotionTrianglesDataNV*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV: {
+            handlemap_VkAccelerationStructureMotionInfoNV(
+                handlemap,
+                reinterpret_cast<VkAccelerationStructureMotionInfoNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV: {
+            handlemap_VkPhysicalDeviceRayTracingMotionBlurFeaturesNV(
+                handlemap, reinterpret_cast<VkPhysicalDeviceRayTracingMotionBlurFeaturesNV*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_ycbcr_2plane_444_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_fragment_density_map2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceFragmentDensityMap2FeaturesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceFragmentDensityMap2FeaturesEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT: {
+            handlemap_VkPhysicalDeviceFragmentDensityMap2PropertiesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceFragmentDensityMap2PropertiesEXT*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_QCOM_rotated_copy_commands
+        case VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM: {
+            handlemap_VkCopyCommandTransformInfoQCOM(
+                handlemap, reinterpret_cast<VkCopyCommandTransformInfoQCOM*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_image_robustness
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceImageRobustnessFeaturesEXT(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceImageRobustnessFeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_4444_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT: {
+            handlemap_VkPhysicalDevice4444FormatsFeaturesEXT(
+                handlemap,
+                reinterpret_cast<VkPhysicalDevice4444FormatsFeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_rgba10x6_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_VALVE_mutable_descriptor_type
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE: {
+            handlemap_VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE(
+                handlemap, reinterpret_cast<VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE: {
+            handlemap_VkMutableDescriptorTypeCreateInfoVALVE(
+                handlemap,
+                reinterpret_cast<VkMutableDescriptorTypeCreateInfoVALVE*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_physical_device_drm
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT: {
+            handlemap_VkPhysicalDeviceDrmPropertiesEXT(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceDrmPropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_primitive_topology_list_restart
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT: {
+            handlemap_VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT(
+                handlemap,
+                reinterpret_cast<VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_FUCHSIA_external_memory
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA: {
+            handlemap_VkImportMemoryZirconHandleInfoFUCHSIA(
+                handlemap,
+                reinterpret_cast<VkImportMemoryZirconHandleInfoFUCHSIA*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA: {
+            handlemap_VkImportMemoryBufferCollectionFUCHSIA(
+                handlemap,
+                reinterpret_cast<VkImportMemoryBufferCollectionFUCHSIA*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA: {
+            handlemap_VkBufferCollectionImageCreateInfoFUCHSIA(
+                handlemap,
+                reinterpret_cast<VkBufferCollectionImageCreateInfoFUCHSIA*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA: {
+            handlemap_VkBufferCollectionBufferCreateInfoFUCHSIA(
+                handlemap,
+                reinterpret_cast<VkBufferCollectionBufferCreateInfoFUCHSIA*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+        case VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI: {
+            handlemap_VkSubpassShadingPipelineCreateInfoHUAWEI(
+                handlemap,
+                reinterpret_cast<VkSubpassShadingPipelineCreateInfoHUAWEI*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI: {
+            handlemap_VkPhysicalDeviceSubpassShadingFeaturesHUAWEI(
+                handlemap, reinterpret_cast<VkPhysicalDeviceSubpassShadingFeaturesHUAWEI*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI: {
+            handlemap_VkPhysicalDeviceSubpassShadingPropertiesHUAWEI(
+                handlemap, reinterpret_cast<VkPhysicalDeviceSubpassShadingPropertiesHUAWEI*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI: {
+            handlemap_VkPhysicalDeviceInvocationMaskFeaturesHUAWEI(
+                handlemap, reinterpret_cast<VkPhysicalDeviceInvocationMaskFeaturesHUAWEI*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_external_memory_rdma
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_RDMA_FEATURES_NV: {
+            handlemap_VkPhysicalDeviceExternalMemoryRDMAFeaturesNV(
+                handlemap, reinterpret_cast<VkPhysicalDeviceExternalMemoryRDMAFeaturesNV*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceExtendedDynamicState2FeaturesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceExtendedDynamicState2FeaturesEXT*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_color_write_enable
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceColorWriteEnableFeaturesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceColorWriteEnableFeaturesEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT: {
+            handlemap_VkPipelineColorWriteCreateInfoEXT(
+                handlemap,
+                reinterpret_cast<VkPipelineColorWriteCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_GOOGLE_gfxstream
+        case VK_STRUCTURE_TYPE_IMPORT_COLOR_BUFFER_GOOGLE: {
+            handlemap_VkImportColorBufferGOOGLE(
+                handlemap, reinterpret_cast<VkImportColorBufferGOOGLE*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMPORT_BUFFER_GOOGLE: {
+            handlemap_VkImportBufferGOOGLE(
+                handlemap, reinterpret_cast<VkImportBufferGOOGLE*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_CREATE_BLOB_GOOGLE: {
+            handlemap_VkCreateBlobGOOGLE(
+                handlemap, reinterpret_cast<VkCreateBlobGOOGLE*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_global_priority_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_EXT: {
+            handlemap_VkQueueFamilyGlobalPriorityPropertiesEXT(
+                handlemap,
+                reinterpret_cast<VkQueueFamilyGlobalPriorityPropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_multi_draw
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceMultiDrawFeaturesEXT(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceMultiDrawFeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT: {
+            handlemap_VkPhysicalDeviceMultiDrawPropertiesEXT(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceMultiDrawPropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_border_color_swizzle
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT: {
+            handlemap_VkPhysicalDeviceBorderColorSwizzleFeaturesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDeviceBorderColorSwizzleFeaturesEXT*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT: {
+            handlemap_VkSamplerBorderColorComponentMappingCreateInfoEXT(
+                handlemap, reinterpret_cast<VkSamplerBorderColorComponentMappingCreateInfoEXT*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT: {
+            handlemap_VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT(
+                handlemap, reinterpret_cast<VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_acceleration_structure
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR: {
+            handlemap_VkWriteDescriptorSetAccelerationStructureKHR(
+                handlemap, reinterpret_cast<VkWriteDescriptorSetAccelerationStructureKHR*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR: {
+            handlemap_VkPhysicalDeviceAccelerationStructureFeaturesKHR(
+                handlemap, reinterpret_cast<VkPhysicalDeviceAccelerationStructureFeaturesKHR*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR: {
+            handlemap_VkPhysicalDeviceAccelerationStructurePropertiesKHR(
+                handlemap, reinterpret_cast<VkPhysicalDeviceAccelerationStructurePropertiesKHR*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR: {
+            handlemap_VkPhysicalDeviceRayTracingPipelineFeaturesKHR(
+                handlemap, reinterpret_cast<VkPhysicalDeviceRayTracingPipelineFeaturesKHR*>(
+                               structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR: {
+            handlemap_VkPhysicalDeviceRayTracingPipelinePropertiesKHR(
+                handlemap, reinterpret_cast<VkPhysicalDeviceRayTracingPipelinePropertiesKHR*>(
+                               structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_ray_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR: {
+            handlemap_VkPhysicalDeviceRayQueryFeaturesKHR(
+                handlemap,
+                reinterpret_cast<VkPhysicalDeviceRayQueryFeaturesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+        default: {
+            return;
+        }
+    }
+}
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/goldfish_vk_handlemap_guest.h b/system/vulkan_enc/goldfish_vk_handlemap_guest.h
new file mode 100644
index 0000000..e4ae110
--- /dev/null
+++ b/system/vulkan_enc/goldfish_vk_handlemap_guest.h
@@ -0,0 +1,3013 @@
+// Copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2018 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Autogenerated module goldfish_vk_handlemap_guest
+//
+// (header) generated by codegen/vulkan/scripts/genvk.py -registry codegen/vulkan/xml/vk.xml cereal
+// -o host/vulkan/cereal
+//
+// Please do not modify directly;
+// re-run gfxstream-protocols/scripts/generate-vulkan-sources.sh,
+// or directly from Python by defining:
+// VULKAN_REGISTRY_XML_DIR : Directory containing vk.xml
+// VULKAN_REGISTRY_SCRIPTS_DIR : Directory containing genvk.py
+// CEREAL_OUTPUT_DIR: Where to put the generated sources.
+//
+// python3 $VULKAN_REGISTRY_SCRIPTS_DIR/genvk.py -registry $VULKAN_REGISTRY_XML_DIR/vk.xml cereal -o
+// $CEREAL_OUTPUT_DIR
+//
+#pragma once
+#include <vulkan/vulkan.h>
+
+#include "VulkanHandleMapping.h"
+#include "goldfish_vk_private_defs.h"
+#include "vk_platform_compat.h"
+#include "vulkan_gfxstream.h"
+// Stuff we are not going to use but if included,
+// will cause compile errors. These are Android Vulkan
+// required extensions, but the approach will be to
+// implement them completely on the guest side.
+#undef VK_KHR_android_surface
+#undef VK_ANDROID_external_memory_android_hardware_buffer
+
+namespace gfxstream {
+namespace vk {
+
+#ifdef VK_VERSION_1_0
+void handlemap_VkExtent2D(VulkanHandleMapping* handlemap, VkExtent2D* toMap);
+
+void handlemap_VkExtent3D(VulkanHandleMapping* handlemap, VkExtent3D* toMap);
+
+void handlemap_VkOffset2D(VulkanHandleMapping* handlemap, VkOffset2D* toMap);
+
+void handlemap_VkOffset3D(VulkanHandleMapping* handlemap, VkOffset3D* toMap);
+
+void handlemap_VkRect2D(VulkanHandleMapping* handlemap, VkRect2D* toMap);
+
+void handlemap_VkBaseInStructure(VulkanHandleMapping* handlemap, VkBaseInStructure* toMap);
+
+void handlemap_VkBaseOutStructure(VulkanHandleMapping* handlemap, VkBaseOutStructure* toMap);
+
+void handlemap_VkBufferMemoryBarrier(VulkanHandleMapping* handlemap, VkBufferMemoryBarrier* toMap);
+
+void handlemap_VkDispatchIndirectCommand(VulkanHandleMapping* handlemap,
+                                         VkDispatchIndirectCommand* toMap);
+
+void handlemap_VkDrawIndexedIndirectCommand(VulkanHandleMapping* handlemap,
+                                            VkDrawIndexedIndirectCommand* toMap);
+
+void handlemap_VkDrawIndirectCommand(VulkanHandleMapping* handlemap, VkDrawIndirectCommand* toMap);
+
+void handlemap_VkImageSubresourceRange(VulkanHandleMapping* handlemap,
+                                       VkImageSubresourceRange* toMap);
+
+void handlemap_VkImageMemoryBarrier(VulkanHandleMapping* handlemap, VkImageMemoryBarrier* toMap);
+
+void handlemap_VkMemoryBarrier(VulkanHandleMapping* handlemap, VkMemoryBarrier* toMap);
+
+void handlemap_VkPipelineCacheHeaderVersionOne(VulkanHandleMapping* handlemap,
+                                               VkPipelineCacheHeaderVersionOne* toMap);
+
+void handlemap_VkAllocationCallbacks(VulkanHandleMapping* handlemap, VkAllocationCallbacks* toMap);
+
+void handlemap_VkApplicationInfo(VulkanHandleMapping* handlemap, VkApplicationInfo* toMap);
+
+void handlemap_VkFormatProperties(VulkanHandleMapping* handlemap, VkFormatProperties* toMap);
+
+void handlemap_VkImageFormatProperties(VulkanHandleMapping* handlemap,
+                                       VkImageFormatProperties* toMap);
+
+void handlemap_VkInstanceCreateInfo(VulkanHandleMapping* handlemap, VkInstanceCreateInfo* toMap);
+
+void handlemap_VkMemoryHeap(VulkanHandleMapping* handlemap, VkMemoryHeap* toMap);
+
+void handlemap_VkMemoryType(VulkanHandleMapping* handlemap, VkMemoryType* toMap);
+
+void handlemap_VkPhysicalDeviceFeatures(VulkanHandleMapping* handlemap,
+                                        VkPhysicalDeviceFeatures* toMap);
+
+void handlemap_VkPhysicalDeviceLimits(VulkanHandleMapping* handlemap,
+                                      VkPhysicalDeviceLimits* toMap);
+
+void handlemap_VkPhysicalDeviceMemoryProperties(VulkanHandleMapping* handlemap,
+                                                VkPhysicalDeviceMemoryProperties* toMap);
+
+void handlemap_VkPhysicalDeviceSparseProperties(VulkanHandleMapping* handlemap,
+                                                VkPhysicalDeviceSparseProperties* toMap);
+
+void handlemap_VkPhysicalDeviceProperties(VulkanHandleMapping* handlemap,
+                                          VkPhysicalDeviceProperties* toMap);
+
+void handlemap_VkQueueFamilyProperties(VulkanHandleMapping* handlemap,
+                                       VkQueueFamilyProperties* toMap);
+
+void handlemap_VkDeviceQueueCreateInfo(VulkanHandleMapping* handlemap,
+                                       VkDeviceQueueCreateInfo* toMap);
+
+void handlemap_VkDeviceCreateInfo(VulkanHandleMapping* handlemap, VkDeviceCreateInfo* toMap);
+
+void handlemap_VkExtensionProperties(VulkanHandleMapping* handlemap, VkExtensionProperties* toMap);
+
+void handlemap_VkLayerProperties(VulkanHandleMapping* handlemap, VkLayerProperties* toMap);
+
+void handlemap_VkSubmitInfo(VulkanHandleMapping* handlemap, VkSubmitInfo* toMap);
+
+void handlemap_VkMappedMemoryRange(VulkanHandleMapping* handlemap, VkMappedMemoryRange* toMap);
+
+void handlemap_VkMemoryAllocateInfo(VulkanHandleMapping* handlemap, VkMemoryAllocateInfo* toMap);
+
+void handlemap_VkMemoryRequirements(VulkanHandleMapping* handlemap, VkMemoryRequirements* toMap);
+
+void handlemap_VkSparseMemoryBind(VulkanHandleMapping* handlemap, VkSparseMemoryBind* toMap);
+
+void handlemap_VkSparseBufferMemoryBindInfo(VulkanHandleMapping* handlemap,
+                                            VkSparseBufferMemoryBindInfo* toMap);
+
+void handlemap_VkSparseImageOpaqueMemoryBindInfo(VulkanHandleMapping* handlemap,
+                                                 VkSparseImageOpaqueMemoryBindInfo* toMap);
+
+void handlemap_VkImageSubresource(VulkanHandleMapping* handlemap, VkImageSubresource* toMap);
+
+void handlemap_VkSparseImageMemoryBind(VulkanHandleMapping* handlemap,
+                                       VkSparseImageMemoryBind* toMap);
+
+void handlemap_VkSparseImageMemoryBindInfo(VulkanHandleMapping* handlemap,
+                                           VkSparseImageMemoryBindInfo* toMap);
+
+void handlemap_VkBindSparseInfo(VulkanHandleMapping* handlemap, VkBindSparseInfo* toMap);
+
+void handlemap_VkSparseImageFormatProperties(VulkanHandleMapping* handlemap,
+                                             VkSparseImageFormatProperties* toMap);
+
+void handlemap_VkSparseImageMemoryRequirements(VulkanHandleMapping* handlemap,
+                                               VkSparseImageMemoryRequirements* toMap);
+
+void handlemap_VkFenceCreateInfo(VulkanHandleMapping* handlemap, VkFenceCreateInfo* toMap);
+
+void handlemap_VkSemaphoreCreateInfo(VulkanHandleMapping* handlemap, VkSemaphoreCreateInfo* toMap);
+
+void handlemap_VkEventCreateInfo(VulkanHandleMapping* handlemap, VkEventCreateInfo* toMap);
+
+void handlemap_VkQueryPoolCreateInfo(VulkanHandleMapping* handlemap, VkQueryPoolCreateInfo* toMap);
+
+void handlemap_VkBufferCreateInfo(VulkanHandleMapping* handlemap, VkBufferCreateInfo* toMap);
+
+void handlemap_VkBufferViewCreateInfo(VulkanHandleMapping* handlemap,
+                                      VkBufferViewCreateInfo* toMap);
+
+void handlemap_VkImageCreateInfo(VulkanHandleMapping* handlemap, VkImageCreateInfo* toMap);
+
+void handlemap_VkSubresourceLayout(VulkanHandleMapping* handlemap, VkSubresourceLayout* toMap);
+
+void handlemap_VkComponentMapping(VulkanHandleMapping* handlemap, VkComponentMapping* toMap);
+
+void handlemap_VkImageViewCreateInfo(VulkanHandleMapping* handlemap, VkImageViewCreateInfo* toMap);
+
+void handlemap_VkShaderModuleCreateInfo(VulkanHandleMapping* handlemap,
+                                        VkShaderModuleCreateInfo* toMap);
+
+void handlemap_VkPipelineCacheCreateInfo(VulkanHandleMapping* handlemap,
+                                         VkPipelineCacheCreateInfo* toMap);
+
+void handlemap_VkSpecializationMapEntry(VulkanHandleMapping* handlemap,
+                                        VkSpecializationMapEntry* toMap);
+
+void handlemap_VkSpecializationInfo(VulkanHandleMapping* handlemap, VkSpecializationInfo* toMap);
+
+void handlemap_VkPipelineShaderStageCreateInfo(VulkanHandleMapping* handlemap,
+                                               VkPipelineShaderStageCreateInfo* toMap);
+
+void handlemap_VkComputePipelineCreateInfo(VulkanHandleMapping* handlemap,
+                                           VkComputePipelineCreateInfo* toMap);
+
+void handlemap_VkVertexInputBindingDescription(VulkanHandleMapping* handlemap,
+                                               VkVertexInputBindingDescription* toMap);
+
+void handlemap_VkVertexInputAttributeDescription(VulkanHandleMapping* handlemap,
+                                                 VkVertexInputAttributeDescription* toMap);
+
+void handlemap_VkPipelineVertexInputStateCreateInfo(VulkanHandleMapping* handlemap,
+                                                    VkPipelineVertexInputStateCreateInfo* toMap);
+
+void handlemap_VkPipelineInputAssemblyStateCreateInfo(
+    VulkanHandleMapping* handlemap, VkPipelineInputAssemblyStateCreateInfo* toMap);
+
+void handlemap_VkPipelineTessellationStateCreateInfo(VulkanHandleMapping* handlemap,
+                                                     VkPipelineTessellationStateCreateInfo* toMap);
+
+void handlemap_VkViewport(VulkanHandleMapping* handlemap, VkViewport* toMap);
+
+void handlemap_VkPipelineViewportStateCreateInfo(VulkanHandleMapping* handlemap,
+                                                 VkPipelineViewportStateCreateInfo* toMap);
+
+void handlemap_VkPipelineRasterizationStateCreateInfo(
+    VulkanHandleMapping* handlemap, VkPipelineRasterizationStateCreateInfo* toMap);
+
+void handlemap_VkPipelineMultisampleStateCreateInfo(VulkanHandleMapping* handlemap,
+                                                    VkPipelineMultisampleStateCreateInfo* toMap);
+
+void handlemap_VkStencilOpState(VulkanHandleMapping* handlemap, VkStencilOpState* toMap);
+
+void handlemap_VkPipelineDepthStencilStateCreateInfo(VulkanHandleMapping* handlemap,
+                                                     VkPipelineDepthStencilStateCreateInfo* toMap);
+
+void handlemap_VkPipelineColorBlendAttachmentState(VulkanHandleMapping* handlemap,
+                                                   VkPipelineColorBlendAttachmentState* toMap);
+
+void handlemap_VkPipelineColorBlendStateCreateInfo(VulkanHandleMapping* handlemap,
+                                                   VkPipelineColorBlendStateCreateInfo* toMap);
+
+void handlemap_VkPipelineDynamicStateCreateInfo(VulkanHandleMapping* handlemap,
+                                                VkPipelineDynamicStateCreateInfo* toMap);
+
+void handlemap_VkGraphicsPipelineCreateInfo(VulkanHandleMapping* handlemap,
+                                            VkGraphicsPipelineCreateInfo* toMap);
+
+void handlemap_VkPushConstantRange(VulkanHandleMapping* handlemap, VkPushConstantRange* toMap);
+
+void handlemap_VkPipelineLayoutCreateInfo(VulkanHandleMapping* handlemap,
+                                          VkPipelineLayoutCreateInfo* toMap);
+
+void handlemap_VkSamplerCreateInfo(VulkanHandleMapping* handlemap, VkSamplerCreateInfo* toMap);
+
+void handlemap_VkCopyDescriptorSet(VulkanHandleMapping* handlemap, VkCopyDescriptorSet* toMap);
+
+void handlemap_VkDescriptorBufferInfo(VulkanHandleMapping* handlemap,
+                                      VkDescriptorBufferInfo* toMap);
+
+void handlemap_VkDescriptorImageInfo(VulkanHandleMapping* handlemap, VkDescriptorImageInfo* toMap);
+
+void handlemap_VkDescriptorPoolSize(VulkanHandleMapping* handlemap, VkDescriptorPoolSize* toMap);
+
+void handlemap_VkDescriptorPoolCreateInfo(VulkanHandleMapping* handlemap,
+                                          VkDescriptorPoolCreateInfo* toMap);
+
+void handlemap_VkDescriptorSetAllocateInfo(VulkanHandleMapping* handlemap,
+                                           VkDescriptorSetAllocateInfo* toMap);
+
+void handlemap_VkDescriptorSetLayoutBinding(VulkanHandleMapping* handlemap,
+                                            VkDescriptorSetLayoutBinding* toMap);
+
+void handlemap_VkDescriptorSetLayoutCreateInfo(VulkanHandleMapping* handlemap,
+                                               VkDescriptorSetLayoutCreateInfo* toMap);
+
+void handlemap_VkWriteDescriptorSet(VulkanHandleMapping* handlemap, VkWriteDescriptorSet* toMap);
+
+void handlemap_VkAttachmentDescription(VulkanHandleMapping* handlemap,
+                                       VkAttachmentDescription* toMap);
+
+void handlemap_VkAttachmentReference(VulkanHandleMapping* handlemap, VkAttachmentReference* toMap);
+
+void handlemap_VkFramebufferCreateInfo(VulkanHandleMapping* handlemap,
+                                       VkFramebufferCreateInfo* toMap);
+
+void handlemap_VkSubpassDescription(VulkanHandleMapping* handlemap, VkSubpassDescription* toMap);
+
+void handlemap_VkSubpassDependency(VulkanHandleMapping* handlemap, VkSubpassDependency* toMap);
+
+void handlemap_VkRenderPassCreateInfo(VulkanHandleMapping* handlemap,
+                                      VkRenderPassCreateInfo* toMap);
+
+void handlemap_VkCommandPoolCreateInfo(VulkanHandleMapping* handlemap,
+                                       VkCommandPoolCreateInfo* toMap);
+
+void handlemap_VkCommandBufferAllocateInfo(VulkanHandleMapping* handlemap,
+                                           VkCommandBufferAllocateInfo* toMap);
+
+void handlemap_VkCommandBufferInheritanceInfo(VulkanHandleMapping* handlemap,
+                                              VkCommandBufferInheritanceInfo* toMap);
+
+void handlemap_VkCommandBufferBeginInfo(VulkanHandleMapping* handlemap,
+                                        VkCommandBufferBeginInfo* toMap);
+
+void handlemap_VkBufferCopy(VulkanHandleMapping* handlemap, VkBufferCopy* toMap);
+
+void handlemap_VkImageSubresourceLayers(VulkanHandleMapping* handlemap,
+                                        VkImageSubresourceLayers* toMap);
+
+void handlemap_VkBufferImageCopy(VulkanHandleMapping* handlemap, VkBufferImageCopy* toMap);
+
+void handlemap_VkClearColorValue(VulkanHandleMapping* handlemap, VkClearColorValue* toMap);
+
+void handlemap_VkClearDepthStencilValue(VulkanHandleMapping* handlemap,
+                                        VkClearDepthStencilValue* toMap);
+
+void handlemap_VkClearValue(VulkanHandleMapping* handlemap, VkClearValue* toMap);
+
+void handlemap_VkClearAttachment(VulkanHandleMapping* handlemap, VkClearAttachment* toMap);
+
+void handlemap_VkClearRect(VulkanHandleMapping* handlemap, VkClearRect* toMap);
+
+void handlemap_VkImageBlit(VulkanHandleMapping* handlemap, VkImageBlit* toMap);
+
+void handlemap_VkImageCopy(VulkanHandleMapping* handlemap, VkImageCopy* toMap);
+
+void handlemap_VkImageResolve(VulkanHandleMapping* handlemap, VkImageResolve* toMap);
+
+void handlemap_VkRenderPassBeginInfo(VulkanHandleMapping* handlemap, VkRenderPassBeginInfo* toMap);
+
+#endif
+#ifdef VK_VERSION_1_1
+void handlemap_VkPhysicalDeviceSubgroupProperties(VulkanHandleMapping* handlemap,
+                                                  VkPhysicalDeviceSubgroupProperties* toMap);
+
+void handlemap_VkBindBufferMemoryInfo(VulkanHandleMapping* handlemap,
+                                      VkBindBufferMemoryInfo* toMap);
+
+void handlemap_VkBindImageMemoryInfo(VulkanHandleMapping* handlemap, VkBindImageMemoryInfo* toMap);
+
+void handlemap_VkPhysicalDevice16BitStorageFeatures(VulkanHandleMapping* handlemap,
+                                                    VkPhysicalDevice16BitStorageFeatures* toMap);
+
+void handlemap_VkMemoryDedicatedRequirements(VulkanHandleMapping* handlemap,
+                                             VkMemoryDedicatedRequirements* toMap);
+
+void handlemap_VkMemoryDedicatedAllocateInfo(VulkanHandleMapping* handlemap,
+                                             VkMemoryDedicatedAllocateInfo* toMap);
+
+void handlemap_VkMemoryAllocateFlagsInfo(VulkanHandleMapping* handlemap,
+                                         VkMemoryAllocateFlagsInfo* toMap);
+
+void handlemap_VkDeviceGroupRenderPassBeginInfo(VulkanHandleMapping* handlemap,
+                                                VkDeviceGroupRenderPassBeginInfo* toMap);
+
+void handlemap_VkDeviceGroupCommandBufferBeginInfo(VulkanHandleMapping* handlemap,
+                                                   VkDeviceGroupCommandBufferBeginInfo* toMap);
+
+void handlemap_VkDeviceGroupSubmitInfo(VulkanHandleMapping* handlemap,
+                                       VkDeviceGroupSubmitInfo* toMap);
+
+void handlemap_VkDeviceGroupBindSparseInfo(VulkanHandleMapping* handlemap,
+                                           VkDeviceGroupBindSparseInfo* toMap);
+
+void handlemap_VkBindBufferMemoryDeviceGroupInfo(VulkanHandleMapping* handlemap,
+                                                 VkBindBufferMemoryDeviceGroupInfo* toMap);
+
+void handlemap_VkBindImageMemoryDeviceGroupInfo(VulkanHandleMapping* handlemap,
+                                                VkBindImageMemoryDeviceGroupInfo* toMap);
+
+void handlemap_VkPhysicalDeviceGroupProperties(VulkanHandleMapping* handlemap,
+                                               VkPhysicalDeviceGroupProperties* toMap);
+
+void handlemap_VkDeviceGroupDeviceCreateInfo(VulkanHandleMapping* handlemap,
+                                             VkDeviceGroupDeviceCreateInfo* toMap);
+
+void handlemap_VkBufferMemoryRequirementsInfo2(VulkanHandleMapping* handlemap,
+                                               VkBufferMemoryRequirementsInfo2* toMap);
+
+void handlemap_VkImageMemoryRequirementsInfo2(VulkanHandleMapping* handlemap,
+                                              VkImageMemoryRequirementsInfo2* toMap);
+
+void handlemap_VkImageSparseMemoryRequirementsInfo2(VulkanHandleMapping* handlemap,
+                                                    VkImageSparseMemoryRequirementsInfo2* toMap);
+
+void handlemap_VkMemoryRequirements2(VulkanHandleMapping* handlemap, VkMemoryRequirements2* toMap);
+
+void handlemap_VkSparseImageMemoryRequirements2(VulkanHandleMapping* handlemap,
+                                                VkSparseImageMemoryRequirements2* toMap);
+
+void handlemap_VkPhysicalDeviceFeatures2(VulkanHandleMapping* handlemap,
+                                         VkPhysicalDeviceFeatures2* toMap);
+
+void handlemap_VkPhysicalDeviceProperties2(VulkanHandleMapping* handlemap,
+                                           VkPhysicalDeviceProperties2* toMap);
+
+void handlemap_VkFormatProperties2(VulkanHandleMapping* handlemap, VkFormatProperties2* toMap);
+
+void handlemap_VkImageFormatProperties2(VulkanHandleMapping* handlemap,
+                                        VkImageFormatProperties2* toMap);
+
+void handlemap_VkPhysicalDeviceImageFormatInfo2(VulkanHandleMapping* handlemap,
+                                                VkPhysicalDeviceImageFormatInfo2* toMap);
+
+void handlemap_VkQueueFamilyProperties2(VulkanHandleMapping* handlemap,
+                                        VkQueueFamilyProperties2* toMap);
+
+void handlemap_VkPhysicalDeviceMemoryProperties2(VulkanHandleMapping* handlemap,
+                                                 VkPhysicalDeviceMemoryProperties2* toMap);
+
+void handlemap_VkSparseImageFormatProperties2(VulkanHandleMapping* handlemap,
+                                              VkSparseImageFormatProperties2* toMap);
+
+void handlemap_VkPhysicalDeviceSparseImageFormatInfo2(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceSparseImageFormatInfo2* toMap);
+
+void handlemap_VkPhysicalDevicePointClippingProperties(
+    VulkanHandleMapping* handlemap, VkPhysicalDevicePointClippingProperties* toMap);
+
+void handlemap_VkInputAttachmentAspectReference(VulkanHandleMapping* handlemap,
+                                                VkInputAttachmentAspectReference* toMap);
+
+void handlemap_VkRenderPassInputAttachmentAspectCreateInfo(
+    VulkanHandleMapping* handlemap, VkRenderPassInputAttachmentAspectCreateInfo* toMap);
+
+void handlemap_VkImageViewUsageCreateInfo(VulkanHandleMapping* handlemap,
+                                          VkImageViewUsageCreateInfo* toMap);
+
+void handlemap_VkPipelineTessellationDomainOriginStateCreateInfo(
+    VulkanHandleMapping* handlemap, VkPipelineTessellationDomainOriginStateCreateInfo* toMap);
+
+void handlemap_VkRenderPassMultiviewCreateInfo(VulkanHandleMapping* handlemap,
+                                               VkRenderPassMultiviewCreateInfo* toMap);
+
+void handlemap_VkPhysicalDeviceMultiviewFeatures(VulkanHandleMapping* handlemap,
+                                                 VkPhysicalDeviceMultiviewFeatures* toMap);
+
+void handlemap_VkPhysicalDeviceMultiviewProperties(VulkanHandleMapping* handlemap,
+                                                   VkPhysicalDeviceMultiviewProperties* toMap);
+
+void handlemap_VkPhysicalDeviceVariablePointersFeatures(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceVariablePointersFeatures* toMap);
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceVariablePointersFeatures,
+                      handlemap_VkPhysicalDeviceVariablePointerFeatures)
+
+void handlemap_VkPhysicalDeviceProtectedMemoryFeatures(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceProtectedMemoryFeatures* toMap);
+
+void handlemap_VkPhysicalDeviceProtectedMemoryProperties(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceProtectedMemoryProperties* toMap);
+
+void handlemap_VkDeviceQueueInfo2(VulkanHandleMapping* handlemap, VkDeviceQueueInfo2* toMap);
+
+void handlemap_VkProtectedSubmitInfo(VulkanHandleMapping* handlemap, VkProtectedSubmitInfo* toMap);
+
+void handlemap_VkSamplerYcbcrConversionCreateInfo(VulkanHandleMapping* handlemap,
+                                                  VkSamplerYcbcrConversionCreateInfo* toMap);
+
+void handlemap_VkSamplerYcbcrConversionInfo(VulkanHandleMapping* handlemap,
+                                            VkSamplerYcbcrConversionInfo* toMap);
+
+void handlemap_VkBindImagePlaneMemoryInfo(VulkanHandleMapping* handlemap,
+                                          VkBindImagePlaneMemoryInfo* toMap);
+
+void handlemap_VkImagePlaneMemoryRequirementsInfo(VulkanHandleMapping* handlemap,
+                                                  VkImagePlaneMemoryRequirementsInfo* toMap);
+
+void handlemap_VkPhysicalDeviceSamplerYcbcrConversionFeatures(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceSamplerYcbcrConversionFeatures* toMap);
+
+void handlemap_VkSamplerYcbcrConversionImageFormatProperties(
+    VulkanHandleMapping* handlemap, VkSamplerYcbcrConversionImageFormatProperties* toMap);
+
+void handlemap_VkDescriptorUpdateTemplateEntry(VulkanHandleMapping* handlemap,
+                                               VkDescriptorUpdateTemplateEntry* toMap);
+
+void handlemap_VkDescriptorUpdateTemplateCreateInfo(VulkanHandleMapping* handlemap,
+                                                    VkDescriptorUpdateTemplateCreateInfo* toMap);
+
+void handlemap_VkExternalMemoryProperties(VulkanHandleMapping* handlemap,
+                                          VkExternalMemoryProperties* toMap);
+
+void handlemap_VkPhysicalDeviceExternalImageFormatInfo(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceExternalImageFormatInfo* toMap);
+
+void handlemap_VkExternalImageFormatProperties(VulkanHandleMapping* handlemap,
+                                               VkExternalImageFormatProperties* toMap);
+
+void handlemap_VkPhysicalDeviceExternalBufferInfo(VulkanHandleMapping* handlemap,
+                                                  VkPhysicalDeviceExternalBufferInfo* toMap);
+
+void handlemap_VkExternalBufferProperties(VulkanHandleMapping* handlemap,
+                                          VkExternalBufferProperties* toMap);
+
+void handlemap_VkPhysicalDeviceIDProperties(VulkanHandleMapping* handlemap,
+                                            VkPhysicalDeviceIDProperties* toMap);
+
+void handlemap_VkExternalMemoryImageCreateInfo(VulkanHandleMapping* handlemap,
+                                               VkExternalMemoryImageCreateInfo* toMap);
+
+void handlemap_VkExternalMemoryBufferCreateInfo(VulkanHandleMapping* handlemap,
+                                                VkExternalMemoryBufferCreateInfo* toMap);
+
+void handlemap_VkExportMemoryAllocateInfo(VulkanHandleMapping* handlemap,
+                                          VkExportMemoryAllocateInfo* toMap);
+
+void handlemap_VkPhysicalDeviceExternalFenceInfo(VulkanHandleMapping* handlemap,
+                                                 VkPhysicalDeviceExternalFenceInfo* toMap);
+
+void handlemap_VkExternalFenceProperties(VulkanHandleMapping* handlemap,
+                                         VkExternalFenceProperties* toMap);
+
+void handlemap_VkExportFenceCreateInfo(VulkanHandleMapping* handlemap,
+                                       VkExportFenceCreateInfo* toMap);
+
+void handlemap_VkExportSemaphoreCreateInfo(VulkanHandleMapping* handlemap,
+                                           VkExportSemaphoreCreateInfo* toMap);
+
+void handlemap_VkPhysicalDeviceExternalSemaphoreInfo(VulkanHandleMapping* handlemap,
+                                                     VkPhysicalDeviceExternalSemaphoreInfo* toMap);
+
+void handlemap_VkExternalSemaphoreProperties(VulkanHandleMapping* handlemap,
+                                             VkExternalSemaphoreProperties* toMap);
+
+void handlemap_VkPhysicalDeviceMaintenance3Properties(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceMaintenance3Properties* toMap);
+
+void handlemap_VkDescriptorSetLayoutSupport(VulkanHandleMapping* handlemap,
+                                            VkDescriptorSetLayoutSupport* toMap);
+
+void handlemap_VkPhysicalDeviceShaderDrawParametersFeatures(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderDrawParametersFeatures* toMap);
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceShaderDrawParametersFeatures,
+                      handlemap_VkPhysicalDeviceShaderDrawParameterFeatures)
+
+#endif
+#ifdef VK_VERSION_1_2
+void handlemap_VkPhysicalDeviceVulkan11Features(VulkanHandleMapping* handlemap,
+                                                VkPhysicalDeviceVulkan11Features* toMap);
+
+void handlemap_VkPhysicalDeviceVulkan11Properties(VulkanHandleMapping* handlemap,
+                                                  VkPhysicalDeviceVulkan11Properties* toMap);
+
+void handlemap_VkPhysicalDeviceVulkan12Features(VulkanHandleMapping* handlemap,
+                                                VkPhysicalDeviceVulkan12Features* toMap);
+
+void handlemap_VkConformanceVersion(VulkanHandleMapping* handlemap, VkConformanceVersion* toMap);
+
+void handlemap_VkPhysicalDeviceVulkan12Properties(VulkanHandleMapping* handlemap,
+                                                  VkPhysicalDeviceVulkan12Properties* toMap);
+
+void handlemap_VkImageFormatListCreateInfo(VulkanHandleMapping* handlemap,
+                                           VkImageFormatListCreateInfo* toMap);
+
+void handlemap_VkAttachmentDescription2(VulkanHandleMapping* handlemap,
+                                        VkAttachmentDescription2* toMap);
+
+void handlemap_VkAttachmentReference2(VulkanHandleMapping* handlemap,
+                                      VkAttachmentReference2* toMap);
+
+void handlemap_VkSubpassDescription2(VulkanHandleMapping* handlemap, VkSubpassDescription2* toMap);
+
+void handlemap_VkSubpassDependency2(VulkanHandleMapping* handlemap, VkSubpassDependency2* toMap);
+
+void handlemap_VkRenderPassCreateInfo2(VulkanHandleMapping* handlemap,
+                                       VkRenderPassCreateInfo2* toMap);
+
+void handlemap_VkSubpassBeginInfo(VulkanHandleMapping* handlemap, VkSubpassBeginInfo* toMap);
+
+void handlemap_VkSubpassEndInfo(VulkanHandleMapping* handlemap, VkSubpassEndInfo* toMap);
+
+void handlemap_VkPhysicalDevice8BitStorageFeatures(VulkanHandleMapping* handlemap,
+                                                   VkPhysicalDevice8BitStorageFeatures* toMap);
+
+void handlemap_VkPhysicalDeviceDriverProperties(VulkanHandleMapping* handlemap,
+                                                VkPhysicalDeviceDriverProperties* toMap);
+
+void handlemap_VkPhysicalDeviceShaderAtomicInt64Features(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderAtomicInt64Features* toMap);
+
+void handlemap_VkPhysicalDeviceShaderFloat16Int8Features(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderFloat16Int8Features* toMap);
+
+void handlemap_VkPhysicalDeviceFloatControlsProperties(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceFloatControlsProperties* toMap);
+
+void handlemap_VkDescriptorSetLayoutBindingFlagsCreateInfo(
+    VulkanHandleMapping* handlemap, VkDescriptorSetLayoutBindingFlagsCreateInfo* toMap);
+
+void handlemap_VkPhysicalDeviceDescriptorIndexingFeatures(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceDescriptorIndexingFeatures* toMap);
+
+void handlemap_VkPhysicalDeviceDescriptorIndexingProperties(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceDescriptorIndexingProperties* toMap);
+
+void handlemap_VkDescriptorSetVariableDescriptorCountAllocateInfo(
+    VulkanHandleMapping* handlemap, VkDescriptorSetVariableDescriptorCountAllocateInfo* toMap);
+
+void handlemap_VkDescriptorSetVariableDescriptorCountLayoutSupport(
+    VulkanHandleMapping* handlemap, VkDescriptorSetVariableDescriptorCountLayoutSupport* toMap);
+
+void handlemap_VkSubpassDescriptionDepthStencilResolve(
+    VulkanHandleMapping* handlemap, VkSubpassDescriptionDepthStencilResolve* toMap);
+
+void handlemap_VkPhysicalDeviceDepthStencilResolveProperties(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceDepthStencilResolveProperties* toMap);
+
+void handlemap_VkPhysicalDeviceScalarBlockLayoutFeatures(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceScalarBlockLayoutFeatures* toMap);
+
+void handlemap_VkImageStencilUsageCreateInfo(VulkanHandleMapping* handlemap,
+                                             VkImageStencilUsageCreateInfo* toMap);
+
+void handlemap_VkSamplerReductionModeCreateInfo(VulkanHandleMapping* handlemap,
+                                                VkSamplerReductionModeCreateInfo* toMap);
+
+void handlemap_VkPhysicalDeviceSamplerFilterMinmaxProperties(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceSamplerFilterMinmaxProperties* toMap);
+
+void handlemap_VkPhysicalDeviceVulkanMemoryModelFeatures(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceVulkanMemoryModelFeatures* toMap);
+
+void handlemap_VkPhysicalDeviceImagelessFramebufferFeatures(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceImagelessFramebufferFeatures* toMap);
+
+void handlemap_VkFramebufferAttachmentImageInfo(VulkanHandleMapping* handlemap,
+                                                VkFramebufferAttachmentImageInfo* toMap);
+
+void handlemap_VkFramebufferAttachmentsCreateInfo(VulkanHandleMapping* handlemap,
+                                                  VkFramebufferAttachmentsCreateInfo* toMap);
+
+void handlemap_VkRenderPassAttachmentBeginInfo(VulkanHandleMapping* handlemap,
+                                               VkRenderPassAttachmentBeginInfo* toMap);
+
+void handlemap_VkPhysicalDeviceUniformBufferStandardLayoutFeatures(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceUniformBufferStandardLayoutFeatures* toMap);
+
+void handlemap_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures* toMap);
+
+void handlemap_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures* toMap);
+
+void handlemap_VkAttachmentReferenceStencilLayout(VulkanHandleMapping* handlemap,
+                                                  VkAttachmentReferenceStencilLayout* toMap);
+
+void handlemap_VkAttachmentDescriptionStencilLayout(VulkanHandleMapping* handlemap,
+                                                    VkAttachmentDescriptionStencilLayout* toMap);
+
+void handlemap_VkPhysicalDeviceHostQueryResetFeatures(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceHostQueryResetFeatures* toMap);
+
+void handlemap_VkPhysicalDeviceTimelineSemaphoreFeatures(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceTimelineSemaphoreFeatures* toMap);
+
+void handlemap_VkPhysicalDeviceTimelineSemaphoreProperties(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceTimelineSemaphoreProperties* toMap);
+
+void handlemap_VkSemaphoreTypeCreateInfo(VulkanHandleMapping* handlemap,
+                                         VkSemaphoreTypeCreateInfo* toMap);
+
+void handlemap_VkTimelineSemaphoreSubmitInfo(VulkanHandleMapping* handlemap,
+                                             VkTimelineSemaphoreSubmitInfo* toMap);
+
+void handlemap_VkSemaphoreWaitInfo(VulkanHandleMapping* handlemap, VkSemaphoreWaitInfo* toMap);
+
+void handlemap_VkSemaphoreSignalInfo(VulkanHandleMapping* handlemap, VkSemaphoreSignalInfo* toMap);
+
+void handlemap_VkPhysicalDeviceBufferDeviceAddressFeatures(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceBufferDeviceAddressFeatures* toMap);
+
+void handlemap_VkBufferDeviceAddressInfo(VulkanHandleMapping* handlemap,
+                                         VkBufferDeviceAddressInfo* toMap);
+
+void handlemap_VkBufferOpaqueCaptureAddressCreateInfo(
+    VulkanHandleMapping* handlemap, VkBufferOpaqueCaptureAddressCreateInfo* toMap);
+
+void handlemap_VkMemoryOpaqueCaptureAddressAllocateInfo(
+    VulkanHandleMapping* handlemap, VkMemoryOpaqueCaptureAddressAllocateInfo* toMap);
+
+void handlemap_VkDeviceMemoryOpaqueCaptureAddressInfo(
+    VulkanHandleMapping* handlemap, VkDeviceMemoryOpaqueCaptureAddressInfo* toMap);
+
+#endif
+#ifdef VK_KHR_surface
+void handlemap_VkSurfaceCapabilitiesKHR(VulkanHandleMapping* handlemap,
+                                        VkSurfaceCapabilitiesKHR* toMap);
+
+void handlemap_VkSurfaceFormatKHR(VulkanHandleMapping* handlemap, VkSurfaceFormatKHR* toMap);
+
+#endif
+#ifdef VK_KHR_swapchain
+void handlemap_VkSwapchainCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                        VkSwapchainCreateInfoKHR* toMap);
+
+void handlemap_VkPresentInfoKHR(VulkanHandleMapping* handlemap, VkPresentInfoKHR* toMap);
+
+void handlemap_VkImageSwapchainCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                             VkImageSwapchainCreateInfoKHR* toMap);
+
+void handlemap_VkBindImageMemorySwapchainInfoKHR(VulkanHandleMapping* handlemap,
+                                                 VkBindImageMemorySwapchainInfoKHR* toMap);
+
+void handlemap_VkAcquireNextImageInfoKHR(VulkanHandleMapping* handlemap,
+                                         VkAcquireNextImageInfoKHR* toMap);
+
+void handlemap_VkDeviceGroupPresentCapabilitiesKHR(VulkanHandleMapping* handlemap,
+                                                   VkDeviceGroupPresentCapabilitiesKHR* toMap);
+
+void handlemap_VkDeviceGroupPresentInfoKHR(VulkanHandleMapping* handlemap,
+                                           VkDeviceGroupPresentInfoKHR* toMap);
+
+void handlemap_VkDeviceGroupSwapchainCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                                   VkDeviceGroupSwapchainCreateInfoKHR* toMap);
+
+#endif
+#ifdef VK_KHR_display
+void handlemap_VkDisplayModeParametersKHR(VulkanHandleMapping* handlemap,
+                                          VkDisplayModeParametersKHR* toMap);
+
+void handlemap_VkDisplayModeCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                          VkDisplayModeCreateInfoKHR* toMap);
+
+void handlemap_VkDisplayModePropertiesKHR(VulkanHandleMapping* handlemap,
+                                          VkDisplayModePropertiesKHR* toMap);
+
+void handlemap_VkDisplayPlaneCapabilitiesKHR(VulkanHandleMapping* handlemap,
+                                             VkDisplayPlaneCapabilitiesKHR* toMap);
+
+void handlemap_VkDisplayPlanePropertiesKHR(VulkanHandleMapping* handlemap,
+                                           VkDisplayPlanePropertiesKHR* toMap);
+
+void handlemap_VkDisplayPropertiesKHR(VulkanHandleMapping* handlemap,
+                                      VkDisplayPropertiesKHR* toMap);
+
+void handlemap_VkDisplaySurfaceCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                             VkDisplaySurfaceCreateInfoKHR* toMap);
+
+#endif
+#ifdef VK_KHR_display_swapchain
+void handlemap_VkDisplayPresentInfoKHR(VulkanHandleMapping* handlemap,
+                                       VkDisplayPresentInfoKHR* toMap);
+
+#endif
+#ifdef VK_KHR_xlib_surface
+void handlemap_VkXlibSurfaceCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                          VkXlibSurfaceCreateInfoKHR* toMap);
+
+#endif
+#ifdef VK_KHR_xcb_surface
+void handlemap_VkXcbSurfaceCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                         VkXcbSurfaceCreateInfoKHR* toMap);
+
+#endif
+#ifdef VK_KHR_wayland_surface
+void handlemap_VkWaylandSurfaceCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                             VkWaylandSurfaceCreateInfoKHR* toMap);
+
+#endif
+#ifdef VK_KHR_android_surface
+void handlemap_VkAndroidSurfaceCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                             VkAndroidSurfaceCreateInfoKHR* toMap);
+
+#endif
+#ifdef VK_KHR_win32_surface
+void handlemap_VkWin32SurfaceCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                           VkWin32SurfaceCreateInfoKHR* toMap);
+
+#endif
+#ifdef VK_KHR_sampler_mirror_clamp_to_edge
+#endif
+#ifdef VK_KHR_video_queue
+void handlemap_VkVideoQueueFamilyProperties2KHR(VulkanHandleMapping* handlemap,
+                                                VkVideoQueueFamilyProperties2KHR* toMap);
+
+void handlemap_VkVideoProfileKHR(VulkanHandleMapping* handlemap, VkVideoProfileKHR* toMap);
+
+void handlemap_VkVideoProfilesKHR(VulkanHandleMapping* handlemap, VkVideoProfilesKHR* toMap);
+
+void handlemap_VkVideoCapabilitiesKHR(VulkanHandleMapping* handlemap,
+                                      VkVideoCapabilitiesKHR* toMap);
+
+void handlemap_VkPhysicalDeviceVideoFormatInfoKHR(VulkanHandleMapping* handlemap,
+                                                  VkPhysicalDeviceVideoFormatInfoKHR* toMap);
+
+void handlemap_VkVideoFormatPropertiesKHR(VulkanHandleMapping* handlemap,
+                                          VkVideoFormatPropertiesKHR* toMap);
+
+void handlemap_VkVideoPictureResourceKHR(VulkanHandleMapping* handlemap,
+                                         VkVideoPictureResourceKHR* toMap);
+
+void handlemap_VkVideoReferenceSlotKHR(VulkanHandleMapping* handlemap,
+                                       VkVideoReferenceSlotKHR* toMap);
+
+void handlemap_VkVideoGetMemoryPropertiesKHR(VulkanHandleMapping* handlemap,
+                                             VkVideoGetMemoryPropertiesKHR* toMap);
+
+void handlemap_VkVideoBindMemoryKHR(VulkanHandleMapping* handlemap, VkVideoBindMemoryKHR* toMap);
+
+void handlemap_VkVideoSessionCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                           VkVideoSessionCreateInfoKHR* toMap);
+
+void handlemap_VkVideoSessionParametersCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                                     VkVideoSessionParametersCreateInfoKHR* toMap);
+
+void handlemap_VkVideoSessionParametersUpdateInfoKHR(VulkanHandleMapping* handlemap,
+                                                     VkVideoSessionParametersUpdateInfoKHR* toMap);
+
+void handlemap_VkVideoBeginCodingInfoKHR(VulkanHandleMapping* handlemap,
+                                         VkVideoBeginCodingInfoKHR* toMap);
+
+void handlemap_VkVideoEndCodingInfoKHR(VulkanHandleMapping* handlemap,
+                                       VkVideoEndCodingInfoKHR* toMap);
+
+void handlemap_VkVideoCodingControlInfoKHR(VulkanHandleMapping* handlemap,
+                                           VkVideoCodingControlInfoKHR* toMap);
+
+#endif
+#ifdef VK_KHR_video_decode_queue
+void handlemap_VkVideoDecodeInfoKHR(VulkanHandleMapping* handlemap, VkVideoDecodeInfoKHR* toMap);
+
+#endif
+#ifdef VK_KHR_dynamic_rendering
+void handlemap_VkRenderingAttachmentInfoKHR(VulkanHandleMapping* handlemap,
+                                            VkRenderingAttachmentInfoKHR* toMap);
+
+void handlemap_VkRenderingInfoKHR(VulkanHandleMapping* handlemap, VkRenderingInfoKHR* toMap);
+
+void handlemap_VkPipelineRenderingCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                                VkPipelineRenderingCreateInfoKHR* toMap);
+
+void handlemap_VkPhysicalDeviceDynamicRenderingFeaturesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceDynamicRenderingFeaturesKHR* toMap);
+
+void handlemap_VkCommandBufferInheritanceRenderingInfoKHR(
+    VulkanHandleMapping* handlemap, VkCommandBufferInheritanceRenderingInfoKHR* toMap);
+
+void handlemap_VkRenderingFragmentShadingRateAttachmentInfoKHR(
+    VulkanHandleMapping* handlemap, VkRenderingFragmentShadingRateAttachmentInfoKHR* toMap);
+
+void handlemap_VkRenderingFragmentDensityMapAttachmentInfoEXT(
+    VulkanHandleMapping* handlemap, VkRenderingFragmentDensityMapAttachmentInfoEXT* toMap);
+
+void handlemap_VkAttachmentSampleCountInfoAMD(VulkanHandleMapping* handlemap,
+                                              VkAttachmentSampleCountInfoAMD* toMap);
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkAttachmentSampleCountInfoAMD,
+                      handlemap_VkAttachmentSampleCountInfoNV)
+
+void handlemap_VkMultiviewPerViewAttributesInfoNVX(VulkanHandleMapping* handlemap,
+                                                   VkMultiviewPerViewAttributesInfoNVX* toMap);
+
+#endif
+#ifdef VK_KHR_multiview
+DEFINE_ALIAS_FUNCTION(handlemap_VkRenderPassMultiviewCreateInfo,
+                      handlemap_VkRenderPassMultiviewCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceMultiviewFeatures,
+                      handlemap_VkPhysicalDeviceMultiviewFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceMultiviewProperties,
+                      handlemap_VkPhysicalDeviceMultiviewPropertiesKHR)
+
+#endif
+#ifdef VK_KHR_get_physical_device_properties2
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceFeatures2, handlemap_VkPhysicalDeviceFeatures2KHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceProperties2,
+                      handlemap_VkPhysicalDeviceProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkFormatProperties2, handlemap_VkFormatProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkImageFormatProperties2, handlemap_VkImageFormatProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceImageFormatInfo2,
+                      handlemap_VkPhysicalDeviceImageFormatInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkQueueFamilyProperties2, handlemap_VkQueueFamilyProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceMemoryProperties2,
+                      handlemap_VkPhysicalDeviceMemoryProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkSparseImageFormatProperties2,
+                      handlemap_VkSparseImageFormatProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceSparseImageFormatInfo2,
+                      handlemap_VkPhysicalDeviceSparseImageFormatInfo2KHR)
+
+#endif
+#ifdef VK_KHR_device_group
+DEFINE_ALIAS_FUNCTION(handlemap_VkMemoryAllocateFlagsInfo, handlemap_VkMemoryAllocateFlagsInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkDeviceGroupRenderPassBeginInfo,
+                      handlemap_VkDeviceGroupRenderPassBeginInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkDeviceGroupCommandBufferBeginInfo,
+                      handlemap_VkDeviceGroupCommandBufferBeginInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkDeviceGroupSubmitInfo, handlemap_VkDeviceGroupSubmitInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkDeviceGroupBindSparseInfo,
+                      handlemap_VkDeviceGroupBindSparseInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkBindBufferMemoryDeviceGroupInfo,
+                      handlemap_VkBindBufferMemoryDeviceGroupInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkBindImageMemoryDeviceGroupInfo,
+                      handlemap_VkBindImageMemoryDeviceGroupInfoKHR)
+
+#endif
+#ifdef VK_KHR_shader_draw_parameters
+#endif
+#ifdef VK_KHR_maintenance1
+#endif
+#ifdef VK_KHR_device_group_creation
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceGroupProperties,
+                      handlemap_VkPhysicalDeviceGroupPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkDeviceGroupDeviceCreateInfo,
+                      handlemap_VkDeviceGroupDeviceCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_external_memory_capabilities
+DEFINE_ALIAS_FUNCTION(handlemap_VkExternalMemoryProperties, handlemap_VkExternalMemoryPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceExternalImageFormatInfo,
+                      handlemap_VkPhysicalDeviceExternalImageFormatInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkExternalImageFormatProperties,
+                      handlemap_VkExternalImageFormatPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceExternalBufferInfo,
+                      handlemap_VkPhysicalDeviceExternalBufferInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkExternalBufferProperties, handlemap_VkExternalBufferPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceIDProperties,
+                      handlemap_VkPhysicalDeviceIDPropertiesKHR)
+
+#endif
+#ifdef VK_KHR_external_memory
+DEFINE_ALIAS_FUNCTION(handlemap_VkExternalMemoryImageCreateInfo,
+                      handlemap_VkExternalMemoryImageCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkExternalMemoryBufferCreateInfo,
+                      handlemap_VkExternalMemoryBufferCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkExportMemoryAllocateInfo, handlemap_VkExportMemoryAllocateInfoKHR)
+
+#endif
+#ifdef VK_KHR_external_memory_win32
+void handlemap_VkImportMemoryWin32HandleInfoKHR(VulkanHandleMapping* handlemap,
+                                                VkImportMemoryWin32HandleInfoKHR* toMap);
+
+void handlemap_VkExportMemoryWin32HandleInfoKHR(VulkanHandleMapping* handlemap,
+                                                VkExportMemoryWin32HandleInfoKHR* toMap);
+
+void handlemap_VkMemoryWin32HandlePropertiesKHR(VulkanHandleMapping* handlemap,
+                                                VkMemoryWin32HandlePropertiesKHR* toMap);
+
+void handlemap_VkMemoryGetWin32HandleInfoKHR(VulkanHandleMapping* handlemap,
+                                             VkMemoryGetWin32HandleInfoKHR* toMap);
+
+#endif
+#ifdef VK_KHR_external_memory_fd
+void handlemap_VkImportMemoryFdInfoKHR(VulkanHandleMapping* handlemap,
+                                       VkImportMemoryFdInfoKHR* toMap);
+
+void handlemap_VkMemoryFdPropertiesKHR(VulkanHandleMapping* handlemap,
+                                       VkMemoryFdPropertiesKHR* toMap);
+
+void handlemap_VkMemoryGetFdInfoKHR(VulkanHandleMapping* handlemap, VkMemoryGetFdInfoKHR* toMap);
+
+#endif
+#ifdef VK_KHR_win32_keyed_mutex
+void handlemap_VkWin32KeyedMutexAcquireReleaseInfoKHR(
+    VulkanHandleMapping* handlemap, VkWin32KeyedMutexAcquireReleaseInfoKHR* toMap);
+
+#endif
+#ifdef VK_KHR_external_semaphore_capabilities
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceExternalSemaphoreInfo,
+                      handlemap_VkPhysicalDeviceExternalSemaphoreInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkExternalSemaphoreProperties,
+                      handlemap_VkExternalSemaphorePropertiesKHR)
+
+#endif
+#ifdef VK_KHR_external_semaphore
+DEFINE_ALIAS_FUNCTION(handlemap_VkExportSemaphoreCreateInfo,
+                      handlemap_VkExportSemaphoreCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+void handlemap_VkImportSemaphoreWin32HandleInfoKHR(VulkanHandleMapping* handlemap,
+                                                   VkImportSemaphoreWin32HandleInfoKHR* toMap);
+
+void handlemap_VkExportSemaphoreWin32HandleInfoKHR(VulkanHandleMapping* handlemap,
+                                                   VkExportSemaphoreWin32HandleInfoKHR* toMap);
+
+void handlemap_VkD3D12FenceSubmitInfoKHR(VulkanHandleMapping* handlemap,
+                                         VkD3D12FenceSubmitInfoKHR* toMap);
+
+void handlemap_VkSemaphoreGetWin32HandleInfoKHR(VulkanHandleMapping* handlemap,
+                                                VkSemaphoreGetWin32HandleInfoKHR* toMap);
+
+#endif
+#ifdef VK_KHR_external_semaphore_fd
+void handlemap_VkImportSemaphoreFdInfoKHR(VulkanHandleMapping* handlemap,
+                                          VkImportSemaphoreFdInfoKHR* toMap);
+
+void handlemap_VkSemaphoreGetFdInfoKHR(VulkanHandleMapping* handlemap,
+                                       VkSemaphoreGetFdInfoKHR* toMap);
+
+#endif
+#ifdef VK_KHR_push_descriptor
+void handlemap_VkPhysicalDevicePushDescriptorPropertiesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDevicePushDescriptorPropertiesKHR* toMap);
+
+#endif
+#ifdef VK_KHR_shader_float16_int8
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceShaderFloat16Int8Features,
+                      handlemap_VkPhysicalDeviceShaderFloat16Int8FeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceShaderFloat16Int8Features,
+                      handlemap_VkPhysicalDeviceFloat16Int8FeaturesKHR)
+
+#endif
+#ifdef VK_KHR_16bit_storage
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDevice16BitStorageFeatures,
+                      handlemap_VkPhysicalDevice16BitStorageFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_incremental_present
+void handlemap_VkRectLayerKHR(VulkanHandleMapping* handlemap, VkRectLayerKHR* toMap);
+
+void handlemap_VkPresentRegionKHR(VulkanHandleMapping* handlemap, VkPresentRegionKHR* toMap);
+
+void handlemap_VkPresentRegionsKHR(VulkanHandleMapping* handlemap, VkPresentRegionsKHR* toMap);
+
+#endif
+#ifdef VK_KHR_descriptor_update_template
+DEFINE_ALIAS_FUNCTION(handlemap_VkDescriptorUpdateTemplateEntry,
+                      handlemap_VkDescriptorUpdateTemplateEntryKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkDescriptorUpdateTemplateCreateInfo,
+                      handlemap_VkDescriptorUpdateTemplateCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_imageless_framebuffer
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceImagelessFramebufferFeatures,
+                      handlemap_VkPhysicalDeviceImagelessFramebufferFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkFramebufferAttachmentsCreateInfo,
+                      handlemap_VkFramebufferAttachmentsCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkFramebufferAttachmentImageInfo,
+                      handlemap_VkFramebufferAttachmentImageInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkRenderPassAttachmentBeginInfo,
+                      handlemap_VkRenderPassAttachmentBeginInfoKHR)
+
+#endif
+#ifdef VK_KHR_create_renderpass2
+DEFINE_ALIAS_FUNCTION(handlemap_VkRenderPassCreateInfo2, handlemap_VkRenderPassCreateInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkAttachmentDescription2, handlemap_VkAttachmentDescription2KHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkAttachmentReference2, handlemap_VkAttachmentReference2KHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkSubpassDescription2, handlemap_VkSubpassDescription2KHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkSubpassDependency2, handlemap_VkSubpassDependency2KHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkSubpassBeginInfo, handlemap_VkSubpassBeginInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkSubpassEndInfo, handlemap_VkSubpassEndInfoKHR)
+
+#endif
+#ifdef VK_KHR_shared_presentable_image
+void handlemap_VkSharedPresentSurfaceCapabilitiesKHR(VulkanHandleMapping* handlemap,
+                                                     VkSharedPresentSurfaceCapabilitiesKHR* toMap);
+
+#endif
+#ifdef VK_KHR_external_fence_capabilities
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceExternalFenceInfo,
+                      handlemap_VkPhysicalDeviceExternalFenceInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkExternalFenceProperties, handlemap_VkExternalFencePropertiesKHR)
+
+#endif
+#ifdef VK_KHR_external_fence
+DEFINE_ALIAS_FUNCTION(handlemap_VkExportFenceCreateInfo, handlemap_VkExportFenceCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_external_fence_win32
+void handlemap_VkImportFenceWin32HandleInfoKHR(VulkanHandleMapping* handlemap,
+                                               VkImportFenceWin32HandleInfoKHR* toMap);
+
+void handlemap_VkExportFenceWin32HandleInfoKHR(VulkanHandleMapping* handlemap,
+                                               VkExportFenceWin32HandleInfoKHR* toMap);
+
+void handlemap_VkFenceGetWin32HandleInfoKHR(VulkanHandleMapping* handlemap,
+                                            VkFenceGetWin32HandleInfoKHR* toMap);
+
+#endif
+#ifdef VK_KHR_external_fence_fd
+void handlemap_VkImportFenceFdInfoKHR(VulkanHandleMapping* handlemap,
+                                      VkImportFenceFdInfoKHR* toMap);
+
+void handlemap_VkFenceGetFdInfoKHR(VulkanHandleMapping* handlemap, VkFenceGetFdInfoKHR* toMap);
+
+#endif
+#ifdef VK_KHR_performance_query
+void handlemap_VkPhysicalDevicePerformanceQueryFeaturesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDevicePerformanceQueryFeaturesKHR* toMap);
+
+void handlemap_VkPhysicalDevicePerformanceQueryPropertiesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDevicePerformanceQueryPropertiesKHR* toMap);
+
+void handlemap_VkPerformanceCounterKHR(VulkanHandleMapping* handlemap,
+                                       VkPerformanceCounterKHR* toMap);
+
+void handlemap_VkPerformanceCounterDescriptionKHR(VulkanHandleMapping* handlemap,
+                                                  VkPerformanceCounterDescriptionKHR* toMap);
+
+void handlemap_VkQueryPoolPerformanceCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                                   VkQueryPoolPerformanceCreateInfoKHR* toMap);
+
+void handlemap_VkPerformanceCounterResultKHR(VulkanHandleMapping* handlemap,
+                                             VkPerformanceCounterResultKHR* toMap);
+
+void handlemap_VkAcquireProfilingLockInfoKHR(VulkanHandleMapping* handlemap,
+                                             VkAcquireProfilingLockInfoKHR* toMap);
+
+void handlemap_VkPerformanceQuerySubmitInfoKHR(VulkanHandleMapping* handlemap,
+                                               VkPerformanceQuerySubmitInfoKHR* toMap);
+
+#endif
+#ifdef VK_KHR_maintenance2
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDevicePointClippingProperties,
+                      handlemap_VkPhysicalDevicePointClippingPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkRenderPassInputAttachmentAspectCreateInfo,
+                      handlemap_VkRenderPassInputAttachmentAspectCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkInputAttachmentAspectReference,
+                      handlemap_VkInputAttachmentAspectReferenceKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkImageViewUsageCreateInfo, handlemap_VkImageViewUsageCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkPipelineTessellationDomainOriginStateCreateInfo,
+                      handlemap_VkPipelineTessellationDomainOriginStateCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_get_surface_capabilities2
+void handlemap_VkPhysicalDeviceSurfaceInfo2KHR(VulkanHandleMapping* handlemap,
+                                               VkPhysicalDeviceSurfaceInfo2KHR* toMap);
+
+void handlemap_VkSurfaceCapabilities2KHR(VulkanHandleMapping* handlemap,
+                                         VkSurfaceCapabilities2KHR* toMap);
+
+void handlemap_VkSurfaceFormat2KHR(VulkanHandleMapping* handlemap, VkSurfaceFormat2KHR* toMap);
+
+#endif
+#ifdef VK_KHR_variable_pointers
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceVariablePointersFeatures,
+                      handlemap_VkPhysicalDeviceVariablePointerFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceVariablePointersFeatures,
+                      handlemap_VkPhysicalDeviceVariablePointersFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_get_display_properties2
+void handlemap_VkDisplayProperties2KHR(VulkanHandleMapping* handlemap,
+                                       VkDisplayProperties2KHR* toMap);
+
+void handlemap_VkDisplayPlaneProperties2KHR(VulkanHandleMapping* handlemap,
+                                            VkDisplayPlaneProperties2KHR* toMap);
+
+void handlemap_VkDisplayModeProperties2KHR(VulkanHandleMapping* handlemap,
+                                           VkDisplayModeProperties2KHR* toMap);
+
+void handlemap_VkDisplayPlaneInfo2KHR(VulkanHandleMapping* handlemap,
+                                      VkDisplayPlaneInfo2KHR* toMap);
+
+void handlemap_VkDisplayPlaneCapabilities2KHR(VulkanHandleMapping* handlemap,
+                                              VkDisplayPlaneCapabilities2KHR* toMap);
+
+#endif
+#ifdef VK_KHR_dedicated_allocation
+DEFINE_ALIAS_FUNCTION(handlemap_VkMemoryDedicatedRequirements,
+                      handlemap_VkMemoryDedicatedRequirementsKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkMemoryDedicatedAllocateInfo,
+                      handlemap_VkMemoryDedicatedAllocateInfoKHR)
+
+#endif
+#ifdef VK_KHR_storage_buffer_storage_class
+#endif
+#ifdef VK_KHR_relaxed_block_layout
+#endif
+#ifdef VK_KHR_get_memory_requirements2
+DEFINE_ALIAS_FUNCTION(handlemap_VkBufferMemoryRequirementsInfo2,
+                      handlemap_VkBufferMemoryRequirementsInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkImageMemoryRequirementsInfo2,
+                      handlemap_VkImageMemoryRequirementsInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkImageSparseMemoryRequirementsInfo2,
+                      handlemap_VkImageSparseMemoryRequirementsInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkMemoryRequirements2, handlemap_VkMemoryRequirements2KHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkSparseImageMemoryRequirements2,
+                      handlemap_VkSparseImageMemoryRequirements2KHR)
+
+#endif
+#ifdef VK_KHR_image_format_list
+DEFINE_ALIAS_FUNCTION(handlemap_VkImageFormatListCreateInfo,
+                      handlemap_VkImageFormatListCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_sampler_ycbcr_conversion
+DEFINE_ALIAS_FUNCTION(handlemap_VkSamplerYcbcrConversionCreateInfo,
+                      handlemap_VkSamplerYcbcrConversionCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkSamplerYcbcrConversionInfo,
+                      handlemap_VkSamplerYcbcrConversionInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkBindImagePlaneMemoryInfo, handlemap_VkBindImagePlaneMemoryInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkImagePlaneMemoryRequirementsInfo,
+                      handlemap_VkImagePlaneMemoryRequirementsInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceSamplerYcbcrConversionFeatures,
+                      handlemap_VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkSamplerYcbcrConversionImageFormatProperties,
+                      handlemap_VkSamplerYcbcrConversionImageFormatPropertiesKHR)
+
+#endif
+#ifdef VK_KHR_bind_memory2
+DEFINE_ALIAS_FUNCTION(handlemap_VkBindBufferMemoryInfo, handlemap_VkBindBufferMemoryInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkBindImageMemoryInfo, handlemap_VkBindImageMemoryInfoKHR)
+
+#endif
+#ifdef VK_KHR_portability_subset
+void handlemap_VkPhysicalDevicePortabilitySubsetFeaturesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDevicePortabilitySubsetFeaturesKHR* toMap);
+
+void handlemap_VkPhysicalDevicePortabilitySubsetPropertiesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDevicePortabilitySubsetPropertiesKHR* toMap);
+
+#endif
+#ifdef VK_KHR_maintenance3
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceMaintenance3Properties,
+                      handlemap_VkPhysicalDeviceMaintenance3PropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkDescriptorSetLayoutSupport,
+                      handlemap_VkDescriptorSetLayoutSupportKHR)
+
+#endif
+#ifdef VK_KHR_draw_indirect_count
+#endif
+#ifdef VK_KHR_shader_subgroup_extended_types
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures,
+                      handlemap_VkPhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_8bit_storage
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDevice8BitStorageFeatures,
+                      handlemap_VkPhysicalDevice8BitStorageFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_shader_atomic_int64
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceShaderAtomicInt64Features,
+                      handlemap_VkPhysicalDeviceShaderAtomicInt64FeaturesKHR)
+
+#endif
+#ifdef VK_KHR_shader_clock
+void handlemap_VkPhysicalDeviceShaderClockFeaturesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderClockFeaturesKHR* toMap);
+
+#endif
+#ifdef VK_KHR_driver_properties
+DEFINE_ALIAS_FUNCTION(handlemap_VkConformanceVersion, handlemap_VkConformanceVersionKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceDriverProperties,
+                      handlemap_VkPhysicalDeviceDriverPropertiesKHR)
+
+#endif
+#ifdef VK_KHR_shader_float_controls
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceFloatControlsProperties,
+                      handlemap_VkPhysicalDeviceFloatControlsPropertiesKHR)
+
+#endif
+#ifdef VK_KHR_depth_stencil_resolve
+DEFINE_ALIAS_FUNCTION(handlemap_VkSubpassDescriptionDepthStencilResolve,
+                      handlemap_VkSubpassDescriptionDepthStencilResolveKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceDepthStencilResolveProperties,
+                      handlemap_VkPhysicalDeviceDepthStencilResolvePropertiesKHR)
+
+#endif
+#ifdef VK_KHR_swapchain_mutable_format
+#endif
+#ifdef VK_KHR_timeline_semaphore
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceTimelineSemaphoreFeatures,
+                      handlemap_VkPhysicalDeviceTimelineSemaphoreFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceTimelineSemaphoreProperties,
+                      handlemap_VkPhysicalDeviceTimelineSemaphorePropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkSemaphoreTypeCreateInfo, handlemap_VkSemaphoreTypeCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkTimelineSemaphoreSubmitInfo,
+                      handlemap_VkTimelineSemaphoreSubmitInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkSemaphoreWaitInfo, handlemap_VkSemaphoreWaitInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkSemaphoreSignalInfo, handlemap_VkSemaphoreSignalInfoKHR)
+
+#endif
+#ifdef VK_KHR_vulkan_memory_model
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceVulkanMemoryModelFeatures,
+                      handlemap_VkPhysicalDeviceVulkanMemoryModelFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_shader_terminate_invocation
+void handlemap_VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR* toMap);
+
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+void handlemap_VkFragmentShadingRateAttachmentInfoKHR(
+    VulkanHandleMapping* handlemap, VkFragmentShadingRateAttachmentInfoKHR* toMap);
+
+void handlemap_VkPipelineFragmentShadingRateStateCreateInfoKHR(
+    VulkanHandleMapping* handlemap, VkPipelineFragmentShadingRateStateCreateInfoKHR* toMap);
+
+void handlemap_VkPhysicalDeviceFragmentShadingRateFeaturesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceFragmentShadingRateFeaturesKHR* toMap);
+
+void handlemap_VkPhysicalDeviceFragmentShadingRatePropertiesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceFragmentShadingRatePropertiesKHR* toMap);
+
+void handlemap_VkPhysicalDeviceFragmentShadingRateKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceFragmentShadingRateKHR* toMap);
+
+#endif
+#ifdef VK_KHR_spirv_1_4
+#endif
+#ifdef VK_KHR_surface_protected_capabilities
+void handlemap_VkSurfaceProtectedCapabilitiesKHR(VulkanHandleMapping* handlemap,
+                                                 VkSurfaceProtectedCapabilitiesKHR* toMap);
+
+#endif
+#ifdef VK_KHR_separate_depth_stencil_layouts
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures,
+                      handlemap_VkPhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkAttachmentReferenceStencilLayout,
+                      handlemap_VkAttachmentReferenceStencilLayoutKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkAttachmentDescriptionStencilLayout,
+                      handlemap_VkAttachmentDescriptionStencilLayoutKHR)
+
+#endif
+#ifdef VK_KHR_present_wait
+void handlemap_VkPhysicalDevicePresentWaitFeaturesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDevicePresentWaitFeaturesKHR* toMap);
+
+#endif
+#ifdef VK_KHR_uniform_buffer_standard_layout
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceUniformBufferStandardLayoutFeatures,
+                      handlemap_VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_buffer_device_address
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceBufferDeviceAddressFeatures,
+                      handlemap_VkPhysicalDeviceBufferDeviceAddressFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkBufferDeviceAddressInfo, handlemap_VkBufferDeviceAddressInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkBufferOpaqueCaptureAddressCreateInfo,
+                      handlemap_VkBufferOpaqueCaptureAddressCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkMemoryOpaqueCaptureAddressAllocateInfo,
+                      handlemap_VkMemoryOpaqueCaptureAddressAllocateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkDeviceMemoryOpaqueCaptureAddressInfo,
+                      handlemap_VkDeviceMemoryOpaqueCaptureAddressInfoKHR)
+
+#endif
+#ifdef VK_KHR_deferred_host_operations
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+void handlemap_VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR* toMap);
+
+void handlemap_VkPipelineInfoKHR(VulkanHandleMapping* handlemap, VkPipelineInfoKHR* toMap);
+
+void handlemap_VkPipelineExecutablePropertiesKHR(VulkanHandleMapping* handlemap,
+                                                 VkPipelineExecutablePropertiesKHR* toMap);
+
+void handlemap_VkPipelineExecutableInfoKHR(VulkanHandleMapping* handlemap,
+                                           VkPipelineExecutableInfoKHR* toMap);
+
+void handlemap_VkPipelineExecutableStatisticValueKHR(VulkanHandleMapping* handlemap,
+                                                     VkPipelineExecutableStatisticValueKHR* toMap);
+
+void handlemap_VkPipelineExecutableStatisticKHR(VulkanHandleMapping* handlemap,
+                                                VkPipelineExecutableStatisticKHR* toMap);
+
+void handlemap_VkPipelineExecutableInternalRepresentationKHR(
+    VulkanHandleMapping* handlemap, VkPipelineExecutableInternalRepresentationKHR* toMap);
+
+#endif
+#ifdef VK_KHR_shader_integer_dot_product
+void handlemap_VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR* toMap);
+
+void handlemap_VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR* toMap);
+
+#endif
+#ifdef VK_KHR_pipeline_library
+void handlemap_VkPipelineLibraryCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                              VkPipelineLibraryCreateInfoKHR* toMap);
+
+#endif
+#ifdef VK_KHR_shader_non_semantic_info
+#endif
+#ifdef VK_KHR_present_id
+void handlemap_VkPresentIdKHR(VulkanHandleMapping* handlemap, VkPresentIdKHR* toMap);
+
+void handlemap_VkPhysicalDevicePresentIdFeaturesKHR(VulkanHandleMapping* handlemap,
+                                                    VkPhysicalDevicePresentIdFeaturesKHR* toMap);
+
+#endif
+#ifdef VK_KHR_video_encode_queue
+void handlemap_VkVideoEncodeInfoKHR(VulkanHandleMapping* handlemap, VkVideoEncodeInfoKHR* toMap);
+
+void handlemap_VkVideoEncodeRateControlInfoKHR(VulkanHandleMapping* handlemap,
+                                               VkVideoEncodeRateControlInfoKHR* toMap);
+
+#endif
+#ifdef VK_KHR_synchronization2
+void handlemap_VkMemoryBarrier2KHR(VulkanHandleMapping* handlemap, VkMemoryBarrier2KHR* toMap);
+
+void handlemap_VkBufferMemoryBarrier2KHR(VulkanHandleMapping* handlemap,
+                                         VkBufferMemoryBarrier2KHR* toMap);
+
+void handlemap_VkImageMemoryBarrier2KHR(VulkanHandleMapping* handlemap,
+                                        VkImageMemoryBarrier2KHR* toMap);
+
+void handlemap_VkDependencyInfoKHR(VulkanHandleMapping* handlemap, VkDependencyInfoKHR* toMap);
+
+void handlemap_VkSemaphoreSubmitInfoKHR(VulkanHandleMapping* handlemap,
+                                        VkSemaphoreSubmitInfoKHR* toMap);
+
+void handlemap_VkCommandBufferSubmitInfoKHR(VulkanHandleMapping* handlemap,
+                                            VkCommandBufferSubmitInfoKHR* toMap);
+
+void handlemap_VkSubmitInfo2KHR(VulkanHandleMapping* handlemap, VkSubmitInfo2KHR* toMap);
+
+void handlemap_VkPhysicalDeviceSynchronization2FeaturesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceSynchronization2FeaturesKHR* toMap);
+
+void handlemap_VkQueueFamilyCheckpointProperties2NV(VulkanHandleMapping* handlemap,
+                                                    VkQueueFamilyCheckpointProperties2NV* toMap);
+
+void handlemap_VkCheckpointData2NV(VulkanHandleMapping* handlemap, VkCheckpointData2NV* toMap);
+
+#endif
+#ifdef VK_KHR_shader_subgroup_uniform_control_flow
+void handlemap_VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR(
+    VulkanHandleMapping* handlemap,
+    VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR* toMap);
+
+#endif
+#ifdef VK_KHR_zero_initialize_workgroup_memory
+void handlemap_VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR(
+    VulkanHandleMapping* handlemap,
+    VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR* toMap);
+
+#endif
+#ifdef VK_KHR_workgroup_memory_explicit_layout
+void handlemap_VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR(
+    VulkanHandleMapping* handlemap,
+    VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR* toMap);
+
+#endif
+#ifdef VK_KHR_copy_commands2
+void handlemap_VkBufferCopy2KHR(VulkanHandleMapping* handlemap, VkBufferCopy2KHR* toMap);
+
+void handlemap_VkCopyBufferInfo2KHR(VulkanHandleMapping* handlemap, VkCopyBufferInfo2KHR* toMap);
+
+void handlemap_VkImageCopy2KHR(VulkanHandleMapping* handlemap, VkImageCopy2KHR* toMap);
+
+void handlemap_VkCopyImageInfo2KHR(VulkanHandleMapping* handlemap, VkCopyImageInfo2KHR* toMap);
+
+void handlemap_VkBufferImageCopy2KHR(VulkanHandleMapping* handlemap, VkBufferImageCopy2KHR* toMap);
+
+void handlemap_VkCopyBufferToImageInfo2KHR(VulkanHandleMapping* handlemap,
+                                           VkCopyBufferToImageInfo2KHR* toMap);
+
+void handlemap_VkCopyImageToBufferInfo2KHR(VulkanHandleMapping* handlemap,
+                                           VkCopyImageToBufferInfo2KHR* toMap);
+
+void handlemap_VkImageBlit2KHR(VulkanHandleMapping* handlemap, VkImageBlit2KHR* toMap);
+
+void handlemap_VkBlitImageInfo2KHR(VulkanHandleMapping* handlemap, VkBlitImageInfo2KHR* toMap);
+
+void handlemap_VkImageResolve2KHR(VulkanHandleMapping* handlemap, VkImageResolve2KHR* toMap);
+
+void handlemap_VkResolveImageInfo2KHR(VulkanHandleMapping* handlemap,
+                                      VkResolveImageInfo2KHR* toMap);
+
+#endif
+#ifdef VK_KHR_format_feature_flags2
+void handlemap_VkFormatProperties3KHR(VulkanHandleMapping* handlemap,
+                                      VkFormatProperties3KHR* toMap);
+
+#endif
+#ifdef VK_KHR_maintenance4
+void handlemap_VkPhysicalDeviceMaintenance4FeaturesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceMaintenance4FeaturesKHR* toMap);
+
+void handlemap_VkPhysicalDeviceMaintenance4PropertiesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceMaintenance4PropertiesKHR* toMap);
+
+void handlemap_VkDeviceBufferMemoryRequirementsKHR(VulkanHandleMapping* handlemap,
+                                                   VkDeviceBufferMemoryRequirementsKHR* toMap);
+
+void handlemap_VkDeviceImageMemoryRequirementsKHR(VulkanHandleMapping* handlemap,
+                                                  VkDeviceImageMemoryRequirementsKHR* toMap);
+
+#endif
+#ifdef VK_ANDROID_native_buffer
+void handlemap_VkNativeBufferANDROID(VulkanHandleMapping* handlemap, VkNativeBufferANDROID* toMap);
+
+#endif
+#ifdef VK_EXT_debug_report
+void handlemap_VkDebugReportCallbackCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                                  VkDebugReportCallbackCreateInfoEXT* toMap);
+
+#endif
+#ifdef VK_NV_glsl_shader
+#endif
+#ifdef VK_EXT_depth_range_unrestricted
+#endif
+#ifdef VK_IMG_filter_cubic
+#endif
+#ifdef VK_AMD_rasterization_order
+void handlemap_VkPipelineRasterizationStateRasterizationOrderAMD(
+    VulkanHandleMapping* handlemap, VkPipelineRasterizationStateRasterizationOrderAMD* toMap);
+
+#endif
+#ifdef VK_AMD_shader_trinary_minmax
+#endif
+#ifdef VK_AMD_shader_explicit_vertex_parameter
+#endif
+#ifdef VK_EXT_debug_marker
+void handlemap_VkDebugMarkerObjectNameInfoEXT(VulkanHandleMapping* handlemap,
+                                              VkDebugMarkerObjectNameInfoEXT* toMap);
+
+void handlemap_VkDebugMarkerObjectTagInfoEXT(VulkanHandleMapping* handlemap,
+                                             VkDebugMarkerObjectTagInfoEXT* toMap);
+
+void handlemap_VkDebugMarkerMarkerInfoEXT(VulkanHandleMapping* handlemap,
+                                          VkDebugMarkerMarkerInfoEXT* toMap);
+
+#endif
+#ifdef VK_AMD_gcn_shader
+#endif
+#ifdef VK_NV_dedicated_allocation
+void handlemap_VkDedicatedAllocationImageCreateInfoNV(
+    VulkanHandleMapping* handlemap, VkDedicatedAllocationImageCreateInfoNV* toMap);
+
+void handlemap_VkDedicatedAllocationBufferCreateInfoNV(
+    VulkanHandleMapping* handlemap, VkDedicatedAllocationBufferCreateInfoNV* toMap);
+
+void handlemap_VkDedicatedAllocationMemoryAllocateInfoNV(
+    VulkanHandleMapping* handlemap, VkDedicatedAllocationMemoryAllocateInfoNV* toMap);
+
+#endif
+#ifdef VK_EXT_transform_feedback
+void handlemap_VkPhysicalDeviceTransformFeedbackFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceTransformFeedbackFeaturesEXT* toMap);
+
+void handlemap_VkPhysicalDeviceTransformFeedbackPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceTransformFeedbackPropertiesEXT* toMap);
+
+void handlemap_VkPipelineRasterizationStateStreamCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkPipelineRasterizationStateStreamCreateInfoEXT* toMap);
+
+#endif
+#ifdef VK_NVX_binary_import
+void handlemap_VkCuModuleCreateInfoNVX(VulkanHandleMapping* handlemap,
+                                       VkCuModuleCreateInfoNVX* toMap);
+
+void handlemap_VkCuFunctionCreateInfoNVX(VulkanHandleMapping* handlemap,
+                                         VkCuFunctionCreateInfoNVX* toMap);
+
+void handlemap_VkCuLaunchInfoNVX(VulkanHandleMapping* handlemap, VkCuLaunchInfoNVX* toMap);
+
+#endif
+#ifdef VK_NVX_image_view_handle
+void handlemap_VkImageViewHandleInfoNVX(VulkanHandleMapping* handlemap,
+                                        VkImageViewHandleInfoNVX* toMap);
+
+void handlemap_VkImageViewAddressPropertiesNVX(VulkanHandleMapping* handlemap,
+                                               VkImageViewAddressPropertiesNVX* toMap);
+
+#endif
+#ifdef VK_AMD_draw_indirect_count
+#endif
+#ifdef VK_AMD_negative_viewport_height
+#endif
+#ifdef VK_AMD_gpu_shader_half_float
+#endif
+#ifdef VK_AMD_shader_ballot
+#endif
+#ifdef VK_EXT_video_encode_h264
+void handlemap_VkVideoEncodeH264CapabilitiesEXT(VulkanHandleMapping* handlemap,
+                                                VkVideoEncodeH264CapabilitiesEXT* toMap);
+
+void handlemap_VkVideoEncodeH264SessionCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                                     VkVideoEncodeH264SessionCreateInfoEXT* toMap);
+
+void handlemap_VkVideoEncodeH264SessionParametersAddInfoEXT(
+    VulkanHandleMapping* handlemap, VkVideoEncodeH264SessionParametersAddInfoEXT* toMap);
+
+void handlemap_VkVideoEncodeH264SessionParametersCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkVideoEncodeH264SessionParametersCreateInfoEXT* toMap);
+
+void handlemap_VkVideoEncodeH264DpbSlotInfoEXT(VulkanHandleMapping* handlemap,
+                                               VkVideoEncodeH264DpbSlotInfoEXT* toMap);
+
+void handlemap_VkVideoEncodeH264NaluSliceEXT(VulkanHandleMapping* handlemap,
+                                             VkVideoEncodeH264NaluSliceEXT* toMap);
+
+void handlemap_VkVideoEncodeH264VclFrameInfoEXT(VulkanHandleMapping* handlemap,
+                                                VkVideoEncodeH264VclFrameInfoEXT* toMap);
+
+void handlemap_VkVideoEncodeH264EmitPictureParametersEXT(
+    VulkanHandleMapping* handlemap, VkVideoEncodeH264EmitPictureParametersEXT* toMap);
+
+void handlemap_VkVideoEncodeH264ProfileEXT(VulkanHandleMapping* handlemap,
+                                           VkVideoEncodeH264ProfileEXT* toMap);
+
+#endif
+#ifdef VK_EXT_video_encode_h265
+void handlemap_VkVideoEncodeH265CapabilitiesEXT(VulkanHandleMapping* handlemap,
+                                                VkVideoEncodeH265CapabilitiesEXT* toMap);
+
+void handlemap_VkVideoEncodeH265SessionCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                                     VkVideoEncodeH265SessionCreateInfoEXT* toMap);
+
+void handlemap_VkVideoEncodeH265SessionParametersAddInfoEXT(
+    VulkanHandleMapping* handlemap, VkVideoEncodeH265SessionParametersAddInfoEXT* toMap);
+
+void handlemap_VkVideoEncodeH265SessionParametersCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkVideoEncodeH265SessionParametersCreateInfoEXT* toMap);
+
+void handlemap_VkVideoEncodeH265DpbSlotInfoEXT(VulkanHandleMapping* handlemap,
+                                               VkVideoEncodeH265DpbSlotInfoEXT* toMap);
+
+void handlemap_VkVideoEncodeH265ReferenceListsEXT(VulkanHandleMapping* handlemap,
+                                                  VkVideoEncodeH265ReferenceListsEXT* toMap);
+
+void handlemap_VkVideoEncodeH265NaluSliceEXT(VulkanHandleMapping* handlemap,
+                                             VkVideoEncodeH265NaluSliceEXT* toMap);
+
+void handlemap_VkVideoEncodeH265VclFrameInfoEXT(VulkanHandleMapping* handlemap,
+                                                VkVideoEncodeH265VclFrameInfoEXT* toMap);
+
+void handlemap_VkVideoEncodeH265EmitPictureParametersEXT(
+    VulkanHandleMapping* handlemap, VkVideoEncodeH265EmitPictureParametersEXT* toMap);
+
+void handlemap_VkVideoEncodeH265ProfileEXT(VulkanHandleMapping* handlemap,
+                                           VkVideoEncodeH265ProfileEXT* toMap);
+
+#endif
+#ifdef VK_EXT_video_decode_h264
+void handlemap_VkVideoDecodeH264ProfileEXT(VulkanHandleMapping* handlemap,
+                                           VkVideoDecodeH264ProfileEXT* toMap);
+
+void handlemap_VkVideoDecodeH264CapabilitiesEXT(VulkanHandleMapping* handlemap,
+                                                VkVideoDecodeH264CapabilitiesEXT* toMap);
+
+void handlemap_VkVideoDecodeH264SessionCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                                     VkVideoDecodeH264SessionCreateInfoEXT* toMap);
+
+void handlemap_VkVideoDecodeH264SessionParametersAddInfoEXT(
+    VulkanHandleMapping* handlemap, VkVideoDecodeH264SessionParametersAddInfoEXT* toMap);
+
+void handlemap_VkVideoDecodeH264SessionParametersCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkVideoDecodeH264SessionParametersCreateInfoEXT* toMap);
+
+void handlemap_VkVideoDecodeH264PictureInfoEXT(VulkanHandleMapping* handlemap,
+                                               VkVideoDecodeH264PictureInfoEXT* toMap);
+
+void handlemap_VkVideoDecodeH264MvcEXT(VulkanHandleMapping* handlemap,
+                                       VkVideoDecodeH264MvcEXT* toMap);
+
+void handlemap_VkVideoDecodeH264DpbSlotInfoEXT(VulkanHandleMapping* handlemap,
+                                               VkVideoDecodeH264DpbSlotInfoEXT* toMap);
+
+#endif
+#ifdef VK_AMD_texture_gather_bias_lod
+void handlemap_VkTextureLODGatherFormatPropertiesAMD(VulkanHandleMapping* handlemap,
+                                                     VkTextureLODGatherFormatPropertiesAMD* toMap);
+
+#endif
+#ifdef VK_AMD_shader_info
+void handlemap_VkShaderResourceUsageAMD(VulkanHandleMapping* handlemap,
+                                        VkShaderResourceUsageAMD* toMap);
+
+void handlemap_VkShaderStatisticsInfoAMD(VulkanHandleMapping* handlemap,
+                                         VkShaderStatisticsInfoAMD* toMap);
+
+#endif
+#ifdef VK_AMD_shader_image_load_store_lod
+#endif
+#ifdef VK_GGP_stream_descriptor_surface
+void handlemap_VkStreamDescriptorSurfaceCreateInfoGGP(
+    VulkanHandleMapping* handlemap, VkStreamDescriptorSurfaceCreateInfoGGP* toMap);
+
+#endif
+#ifdef VK_NV_corner_sampled_image
+void handlemap_VkPhysicalDeviceCornerSampledImageFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceCornerSampledImageFeaturesNV* toMap);
+
+#endif
+#ifdef VK_IMG_format_pvrtc
+#endif
+#ifdef VK_NV_external_memory_capabilities
+void handlemap_VkExternalImageFormatPropertiesNV(VulkanHandleMapping* handlemap,
+                                                 VkExternalImageFormatPropertiesNV* toMap);
+
+#endif
+#ifdef VK_NV_external_memory
+void handlemap_VkExternalMemoryImageCreateInfoNV(VulkanHandleMapping* handlemap,
+                                                 VkExternalMemoryImageCreateInfoNV* toMap);
+
+void handlemap_VkExportMemoryAllocateInfoNV(VulkanHandleMapping* handlemap,
+                                            VkExportMemoryAllocateInfoNV* toMap);
+
+#endif
+#ifdef VK_NV_external_memory_win32
+void handlemap_VkImportMemoryWin32HandleInfoNV(VulkanHandleMapping* handlemap,
+                                               VkImportMemoryWin32HandleInfoNV* toMap);
+
+void handlemap_VkExportMemoryWin32HandleInfoNV(VulkanHandleMapping* handlemap,
+                                               VkExportMemoryWin32HandleInfoNV* toMap);
+
+#endif
+#ifdef VK_NV_win32_keyed_mutex
+void handlemap_VkWin32KeyedMutexAcquireReleaseInfoNV(VulkanHandleMapping* handlemap,
+                                                     VkWin32KeyedMutexAcquireReleaseInfoNV* toMap);
+
+#endif
+#ifdef VK_EXT_validation_flags
+void handlemap_VkValidationFlagsEXT(VulkanHandleMapping* handlemap, VkValidationFlagsEXT* toMap);
+
+#endif
+#ifdef VK_NN_vi_surface
+void handlemap_VkViSurfaceCreateInfoNN(VulkanHandleMapping* handlemap,
+                                       VkViSurfaceCreateInfoNN* toMap);
+
+#endif
+#ifdef VK_EXT_shader_subgroup_ballot
+#endif
+#ifdef VK_EXT_shader_subgroup_vote
+#endif
+#ifdef VK_EXT_texture_compression_astc_hdr
+void handlemap_VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT* toMap);
+
+#endif
+#ifdef VK_EXT_astc_decode_mode
+void handlemap_VkImageViewASTCDecodeModeEXT(VulkanHandleMapping* handlemap,
+                                            VkImageViewASTCDecodeModeEXT* toMap);
+
+void handlemap_VkPhysicalDeviceASTCDecodeFeaturesEXT(VulkanHandleMapping* handlemap,
+                                                     VkPhysicalDeviceASTCDecodeFeaturesEXT* toMap);
+
+#endif
+#ifdef VK_EXT_conditional_rendering
+void handlemap_VkConditionalRenderingBeginInfoEXT(VulkanHandleMapping* handlemap,
+                                                  VkConditionalRenderingBeginInfoEXT* toMap);
+
+void handlemap_VkPhysicalDeviceConditionalRenderingFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceConditionalRenderingFeaturesEXT* toMap);
+
+void handlemap_VkCommandBufferInheritanceConditionalRenderingInfoEXT(
+    VulkanHandleMapping* handlemap, VkCommandBufferInheritanceConditionalRenderingInfoEXT* toMap);
+
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+void handlemap_VkViewportWScalingNV(VulkanHandleMapping* handlemap, VkViewportWScalingNV* toMap);
+
+void handlemap_VkPipelineViewportWScalingStateCreateInfoNV(
+    VulkanHandleMapping* handlemap, VkPipelineViewportWScalingStateCreateInfoNV* toMap);
+
+#endif
+#ifdef VK_EXT_direct_mode_display
+#endif
+#ifdef VK_EXT_acquire_xlib_display
+#endif
+#ifdef VK_EXT_display_surface_counter
+void handlemap_VkSurfaceCapabilities2EXT(VulkanHandleMapping* handlemap,
+                                         VkSurfaceCapabilities2EXT* toMap);
+
+#endif
+#ifdef VK_EXT_display_control
+void handlemap_VkDisplayPowerInfoEXT(VulkanHandleMapping* handlemap, VkDisplayPowerInfoEXT* toMap);
+
+void handlemap_VkDeviceEventInfoEXT(VulkanHandleMapping* handlemap, VkDeviceEventInfoEXT* toMap);
+
+void handlemap_VkDisplayEventInfoEXT(VulkanHandleMapping* handlemap, VkDisplayEventInfoEXT* toMap);
+
+void handlemap_VkSwapchainCounterCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                               VkSwapchainCounterCreateInfoEXT* toMap);
+
+#endif
+#ifdef VK_GOOGLE_display_timing
+void handlemap_VkRefreshCycleDurationGOOGLE(VulkanHandleMapping* handlemap,
+                                            VkRefreshCycleDurationGOOGLE* toMap);
+
+void handlemap_VkPastPresentationTimingGOOGLE(VulkanHandleMapping* handlemap,
+                                              VkPastPresentationTimingGOOGLE* toMap);
+
+void handlemap_VkPresentTimeGOOGLE(VulkanHandleMapping* handlemap, VkPresentTimeGOOGLE* toMap);
+
+void handlemap_VkPresentTimesInfoGOOGLE(VulkanHandleMapping* handlemap,
+                                        VkPresentTimesInfoGOOGLE* toMap);
+
+#endif
+#ifdef VK_NV_sample_mask_override_coverage
+#endif
+#ifdef VK_NV_geometry_shader_passthrough
+#endif
+#ifdef VK_NV_viewport_array2
+#endif
+#ifdef VK_NVX_multiview_per_view_attributes
+void handlemap_VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX* toMap);
+
+#endif
+#ifdef VK_NV_viewport_swizzle
+void handlemap_VkViewportSwizzleNV(VulkanHandleMapping* handlemap, VkViewportSwizzleNV* toMap);
+
+void handlemap_VkPipelineViewportSwizzleStateCreateInfoNV(
+    VulkanHandleMapping* handlemap, VkPipelineViewportSwizzleStateCreateInfoNV* toMap);
+
+#endif
+#ifdef VK_EXT_discard_rectangles
+void handlemap_VkPhysicalDeviceDiscardRectanglePropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceDiscardRectanglePropertiesEXT* toMap);
+
+void handlemap_VkPipelineDiscardRectangleStateCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkPipelineDiscardRectangleStateCreateInfoEXT* toMap);
+
+#endif
+#ifdef VK_EXT_conservative_rasterization
+void handlemap_VkPhysicalDeviceConservativeRasterizationPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceConservativeRasterizationPropertiesEXT* toMap);
+
+void handlemap_VkPipelineRasterizationConservativeStateCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkPipelineRasterizationConservativeStateCreateInfoEXT* toMap);
+
+#endif
+#ifdef VK_EXT_depth_clip_enable
+void handlemap_VkPhysicalDeviceDepthClipEnableFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceDepthClipEnableFeaturesEXT* toMap);
+
+void handlemap_VkPipelineRasterizationDepthClipStateCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkPipelineRasterizationDepthClipStateCreateInfoEXT* toMap);
+
+#endif
+#ifdef VK_EXT_swapchain_colorspace
+#endif
+#ifdef VK_EXT_hdr_metadata
+void handlemap_VkXYColorEXT(VulkanHandleMapping* handlemap, VkXYColorEXT* toMap);
+
+void handlemap_VkHdrMetadataEXT(VulkanHandleMapping* handlemap, VkHdrMetadataEXT* toMap);
+
+#endif
+#ifdef VK_MVK_ios_surface
+void handlemap_VkIOSSurfaceCreateInfoMVK(VulkanHandleMapping* handlemap,
+                                         VkIOSSurfaceCreateInfoMVK* toMap);
+
+#endif
+#ifdef VK_MVK_macos_surface
+void handlemap_VkMacOSSurfaceCreateInfoMVK(VulkanHandleMapping* handlemap,
+                                           VkMacOSSurfaceCreateInfoMVK* toMap);
+
+#endif
+#ifdef VK_MVK_moltenvk
+#endif
+#ifdef VK_EXT_external_memory_dma_buf
+#endif
+#ifdef VK_EXT_queue_family_foreign
+#endif
+#ifdef VK_EXT_debug_utils
+void handlemap_VkDebugUtilsLabelEXT(VulkanHandleMapping* handlemap, VkDebugUtilsLabelEXT* toMap);
+
+void handlemap_VkDebugUtilsObjectNameInfoEXT(VulkanHandleMapping* handlemap,
+                                             VkDebugUtilsObjectNameInfoEXT* toMap);
+
+void handlemap_VkDebugUtilsMessengerCallbackDataEXT(VulkanHandleMapping* handlemap,
+                                                    VkDebugUtilsMessengerCallbackDataEXT* toMap);
+
+void handlemap_VkDebugUtilsMessengerCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                                  VkDebugUtilsMessengerCreateInfoEXT* toMap);
+
+void handlemap_VkDebugUtilsObjectTagInfoEXT(VulkanHandleMapping* handlemap,
+                                            VkDebugUtilsObjectTagInfoEXT* toMap);
+
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+void handlemap_VkAndroidHardwareBufferUsageANDROID(VulkanHandleMapping* handlemap,
+                                                   VkAndroidHardwareBufferUsageANDROID* toMap);
+
+void handlemap_VkAndroidHardwareBufferPropertiesANDROID(
+    VulkanHandleMapping* handlemap, VkAndroidHardwareBufferPropertiesANDROID* toMap);
+
+void handlemap_VkAndroidHardwareBufferFormatPropertiesANDROID(
+    VulkanHandleMapping* handlemap, VkAndroidHardwareBufferFormatPropertiesANDROID* toMap);
+
+void handlemap_VkImportAndroidHardwareBufferInfoANDROID(
+    VulkanHandleMapping* handlemap, VkImportAndroidHardwareBufferInfoANDROID* toMap);
+
+void handlemap_VkMemoryGetAndroidHardwareBufferInfoANDROID(
+    VulkanHandleMapping* handlemap, VkMemoryGetAndroidHardwareBufferInfoANDROID* toMap);
+
+void handlemap_VkExternalFormatANDROID(VulkanHandleMapping* handlemap,
+                                       VkExternalFormatANDROID* toMap);
+
+void handlemap_VkAndroidHardwareBufferFormatProperties2ANDROID(
+    VulkanHandleMapping* handlemap, VkAndroidHardwareBufferFormatProperties2ANDROID* toMap);
+
+#endif
+#ifdef VK_EXT_sampler_filter_minmax
+DEFINE_ALIAS_FUNCTION(handlemap_VkSamplerReductionModeCreateInfo,
+                      handlemap_VkSamplerReductionModeCreateInfoEXT)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceSamplerFilterMinmaxProperties,
+                      handlemap_VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT)
+
+#endif
+#ifdef VK_AMD_gpu_shader_int16
+#endif
+#ifdef VK_AMD_mixed_attachment_samples
+#endif
+#ifdef VK_AMD_shader_fragment_mask
+#endif
+#ifdef VK_EXT_inline_uniform_block
+void handlemap_VkPhysicalDeviceInlineUniformBlockFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceInlineUniformBlockFeaturesEXT* toMap);
+
+void handlemap_VkPhysicalDeviceInlineUniformBlockPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceInlineUniformBlockPropertiesEXT* toMap);
+
+void handlemap_VkWriteDescriptorSetInlineUniformBlockEXT(
+    VulkanHandleMapping* handlemap, VkWriteDescriptorSetInlineUniformBlockEXT* toMap);
+
+void handlemap_VkDescriptorPoolInlineUniformBlockCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkDescriptorPoolInlineUniformBlockCreateInfoEXT* toMap);
+
+#endif
+#ifdef VK_EXT_shader_stencil_export
+#endif
+#ifdef VK_EXT_sample_locations
+void handlemap_VkSampleLocationEXT(VulkanHandleMapping* handlemap, VkSampleLocationEXT* toMap);
+
+void handlemap_VkSampleLocationsInfoEXT(VulkanHandleMapping* handlemap,
+                                        VkSampleLocationsInfoEXT* toMap);
+
+void handlemap_VkAttachmentSampleLocationsEXT(VulkanHandleMapping* handlemap,
+                                              VkAttachmentSampleLocationsEXT* toMap);
+
+void handlemap_VkSubpassSampleLocationsEXT(VulkanHandleMapping* handlemap,
+                                           VkSubpassSampleLocationsEXT* toMap);
+
+void handlemap_VkRenderPassSampleLocationsBeginInfoEXT(
+    VulkanHandleMapping* handlemap, VkRenderPassSampleLocationsBeginInfoEXT* toMap);
+
+void handlemap_VkPipelineSampleLocationsStateCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkPipelineSampleLocationsStateCreateInfoEXT* toMap);
+
+void handlemap_VkPhysicalDeviceSampleLocationsPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceSampleLocationsPropertiesEXT* toMap);
+
+void handlemap_VkMultisamplePropertiesEXT(VulkanHandleMapping* handlemap,
+                                          VkMultisamplePropertiesEXT* toMap);
+
+#endif
+#ifdef VK_EXT_blend_operation_advanced
+void handlemap_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT* toMap);
+
+void handlemap_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT* toMap);
+
+void handlemap_VkPipelineColorBlendAdvancedStateCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkPipelineColorBlendAdvancedStateCreateInfoEXT* toMap);
+
+#endif
+#ifdef VK_NV_fragment_coverage_to_color
+void handlemap_VkPipelineCoverageToColorStateCreateInfoNV(
+    VulkanHandleMapping* handlemap, VkPipelineCoverageToColorStateCreateInfoNV* toMap);
+
+#endif
+#ifdef VK_NV_framebuffer_mixed_samples
+void handlemap_VkPipelineCoverageModulationStateCreateInfoNV(
+    VulkanHandleMapping* handlemap, VkPipelineCoverageModulationStateCreateInfoNV* toMap);
+
+#endif
+#ifdef VK_NV_fill_rectangle
+#endif
+#ifdef VK_NV_shader_sm_builtins
+void handlemap_VkPhysicalDeviceShaderSMBuiltinsPropertiesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderSMBuiltinsPropertiesNV* toMap);
+
+void handlemap_VkPhysicalDeviceShaderSMBuiltinsFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderSMBuiltinsFeaturesNV* toMap);
+
+#endif
+#ifdef VK_EXT_post_depth_coverage
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+void handlemap_VkDrmFormatModifierPropertiesEXT(VulkanHandleMapping* handlemap,
+                                                VkDrmFormatModifierPropertiesEXT* toMap);
+
+void handlemap_VkDrmFormatModifierPropertiesListEXT(VulkanHandleMapping* handlemap,
+                                                    VkDrmFormatModifierPropertiesListEXT* toMap);
+
+void handlemap_VkPhysicalDeviceImageDrmFormatModifierInfoEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceImageDrmFormatModifierInfoEXT* toMap);
+
+void handlemap_VkImageDrmFormatModifierListCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkImageDrmFormatModifierListCreateInfoEXT* toMap);
+
+void handlemap_VkImageDrmFormatModifierExplicitCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkImageDrmFormatModifierExplicitCreateInfoEXT* toMap);
+
+void handlemap_VkImageDrmFormatModifierPropertiesEXT(VulkanHandleMapping* handlemap,
+                                                     VkImageDrmFormatModifierPropertiesEXT* toMap);
+
+void handlemap_VkDrmFormatModifierProperties2EXT(VulkanHandleMapping* handlemap,
+                                                 VkDrmFormatModifierProperties2EXT* toMap);
+
+void handlemap_VkDrmFormatModifierPropertiesList2EXT(VulkanHandleMapping* handlemap,
+                                                     VkDrmFormatModifierPropertiesList2EXT* toMap);
+
+#endif
+#ifdef VK_EXT_validation_cache
+void handlemap_VkValidationCacheCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                              VkValidationCacheCreateInfoEXT* toMap);
+
+void handlemap_VkShaderModuleValidationCacheCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkShaderModuleValidationCacheCreateInfoEXT* toMap);
+
+#endif
+#ifdef VK_EXT_descriptor_indexing
+DEFINE_ALIAS_FUNCTION(handlemap_VkDescriptorSetLayoutBindingFlagsCreateInfo,
+                      handlemap_VkDescriptorSetLayoutBindingFlagsCreateInfoEXT)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceDescriptorIndexingFeatures,
+                      handlemap_VkPhysicalDeviceDescriptorIndexingFeaturesEXT)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceDescriptorIndexingProperties,
+                      handlemap_VkPhysicalDeviceDescriptorIndexingPropertiesEXT)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkDescriptorSetVariableDescriptorCountAllocateInfo,
+                      handlemap_VkDescriptorSetVariableDescriptorCountAllocateInfoEXT)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkDescriptorSetVariableDescriptorCountLayoutSupport,
+                      handlemap_VkDescriptorSetVariableDescriptorCountLayoutSupportEXT)
+
+#endif
+#ifdef VK_EXT_shader_viewport_index_layer
+#endif
+#ifdef VK_NV_shading_rate_image
+void handlemap_VkShadingRatePaletteNV(VulkanHandleMapping* handlemap,
+                                      VkShadingRatePaletteNV* toMap);
+
+void handlemap_VkPipelineViewportShadingRateImageStateCreateInfoNV(
+    VulkanHandleMapping* handlemap, VkPipelineViewportShadingRateImageStateCreateInfoNV* toMap);
+
+void handlemap_VkPhysicalDeviceShadingRateImageFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShadingRateImageFeaturesNV* toMap);
+
+void handlemap_VkPhysicalDeviceShadingRateImagePropertiesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShadingRateImagePropertiesNV* toMap);
+
+void handlemap_VkCoarseSampleLocationNV(VulkanHandleMapping* handlemap,
+                                        VkCoarseSampleLocationNV* toMap);
+
+void handlemap_VkCoarseSampleOrderCustomNV(VulkanHandleMapping* handlemap,
+                                           VkCoarseSampleOrderCustomNV* toMap);
+
+void handlemap_VkPipelineViewportCoarseSampleOrderStateCreateInfoNV(
+    VulkanHandleMapping* handlemap, VkPipelineViewportCoarseSampleOrderStateCreateInfoNV* toMap);
+
+#endif
+#ifdef VK_NV_ray_tracing
+void handlemap_VkRayTracingShaderGroupCreateInfoNV(VulkanHandleMapping* handlemap,
+                                                   VkRayTracingShaderGroupCreateInfoNV* toMap);
+
+void handlemap_VkRayTracingPipelineCreateInfoNV(VulkanHandleMapping* handlemap,
+                                                VkRayTracingPipelineCreateInfoNV* toMap);
+
+void handlemap_VkGeometryTrianglesNV(VulkanHandleMapping* handlemap, VkGeometryTrianglesNV* toMap);
+
+void handlemap_VkGeometryAABBNV(VulkanHandleMapping* handlemap, VkGeometryAABBNV* toMap);
+
+void handlemap_VkGeometryDataNV(VulkanHandleMapping* handlemap, VkGeometryDataNV* toMap);
+
+void handlemap_VkGeometryNV(VulkanHandleMapping* handlemap, VkGeometryNV* toMap);
+
+void handlemap_VkAccelerationStructureInfoNV(VulkanHandleMapping* handlemap,
+                                             VkAccelerationStructureInfoNV* toMap);
+
+void handlemap_VkAccelerationStructureCreateInfoNV(VulkanHandleMapping* handlemap,
+                                                   VkAccelerationStructureCreateInfoNV* toMap);
+
+void handlemap_VkBindAccelerationStructureMemoryInfoNV(
+    VulkanHandleMapping* handlemap, VkBindAccelerationStructureMemoryInfoNV* toMap);
+
+void handlemap_VkWriteDescriptorSetAccelerationStructureNV(
+    VulkanHandleMapping* handlemap, VkWriteDescriptorSetAccelerationStructureNV* toMap);
+
+void handlemap_VkAccelerationStructureMemoryRequirementsInfoNV(
+    VulkanHandleMapping* handlemap, VkAccelerationStructureMemoryRequirementsInfoNV* toMap);
+
+void handlemap_VkPhysicalDeviceRayTracingPropertiesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceRayTracingPropertiesNV* toMap);
+
+void handlemap_VkTransformMatrixKHR(VulkanHandleMapping* handlemap, VkTransformMatrixKHR* toMap);
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkTransformMatrixKHR, handlemap_VkTransformMatrixNV)
+
+void handlemap_VkAabbPositionsKHR(VulkanHandleMapping* handlemap, VkAabbPositionsKHR* toMap);
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkAabbPositionsKHR, handlemap_VkAabbPositionsNV)
+
+void handlemap_VkAccelerationStructureInstanceKHR(VulkanHandleMapping* handlemap,
+                                                  VkAccelerationStructureInstanceKHR* toMap);
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkAccelerationStructureInstanceKHR,
+                      handlemap_VkAccelerationStructureInstanceNV)
+
+#endif
+#ifdef VK_NV_representative_fragment_test
+void handlemap_VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV* toMap);
+
+void handlemap_VkPipelineRepresentativeFragmentTestStateCreateInfoNV(
+    VulkanHandleMapping* handlemap, VkPipelineRepresentativeFragmentTestStateCreateInfoNV* toMap);
+
+#endif
+#ifdef VK_EXT_filter_cubic
+void handlemap_VkPhysicalDeviceImageViewImageFormatInfoEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceImageViewImageFormatInfoEXT* toMap);
+
+void handlemap_VkFilterCubicImageViewImageFormatPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkFilterCubicImageViewImageFormatPropertiesEXT* toMap);
+
+#endif
+#ifdef VK_QCOM_render_pass_shader_resolve
+#endif
+#ifdef VK_EXT_global_priority
+void handlemap_VkDeviceQueueGlobalPriorityCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkDeviceQueueGlobalPriorityCreateInfoEXT* toMap);
+
+#endif
+#ifdef VK_EXT_external_memory_host
+void handlemap_VkImportMemoryHostPointerInfoEXT(VulkanHandleMapping* handlemap,
+                                                VkImportMemoryHostPointerInfoEXT* toMap);
+
+void handlemap_VkMemoryHostPointerPropertiesEXT(VulkanHandleMapping* handlemap,
+                                                VkMemoryHostPointerPropertiesEXT* toMap);
+
+void handlemap_VkPhysicalDeviceExternalMemoryHostPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceExternalMemoryHostPropertiesEXT* toMap);
+
+#endif
+#ifdef VK_AMD_buffer_marker
+#endif
+#ifdef VK_AMD_pipeline_compiler_control
+void handlemap_VkPipelineCompilerControlCreateInfoAMD(
+    VulkanHandleMapping* handlemap, VkPipelineCompilerControlCreateInfoAMD* toMap);
+
+#endif
+#ifdef VK_EXT_calibrated_timestamps
+void handlemap_VkCalibratedTimestampInfoEXT(VulkanHandleMapping* handlemap,
+                                            VkCalibratedTimestampInfoEXT* toMap);
+
+#endif
+#ifdef VK_AMD_shader_core_properties
+void handlemap_VkPhysicalDeviceShaderCorePropertiesAMD(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderCorePropertiesAMD* toMap);
+
+#endif
+#ifdef VK_EXT_video_decode_h265
+void handlemap_VkVideoDecodeH265ProfileEXT(VulkanHandleMapping* handlemap,
+                                           VkVideoDecodeH265ProfileEXT* toMap);
+
+void handlemap_VkVideoDecodeH265CapabilitiesEXT(VulkanHandleMapping* handlemap,
+                                                VkVideoDecodeH265CapabilitiesEXT* toMap);
+
+void handlemap_VkVideoDecodeH265SessionCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                                     VkVideoDecodeH265SessionCreateInfoEXT* toMap);
+
+void handlemap_VkVideoDecodeH265SessionParametersAddInfoEXT(
+    VulkanHandleMapping* handlemap, VkVideoDecodeH265SessionParametersAddInfoEXT* toMap);
+
+void handlemap_VkVideoDecodeH265SessionParametersCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkVideoDecodeH265SessionParametersCreateInfoEXT* toMap);
+
+void handlemap_VkVideoDecodeH265PictureInfoEXT(VulkanHandleMapping* handlemap,
+                                               VkVideoDecodeH265PictureInfoEXT* toMap);
+
+void handlemap_VkVideoDecodeH265DpbSlotInfoEXT(VulkanHandleMapping* handlemap,
+                                               VkVideoDecodeH265DpbSlotInfoEXT* toMap);
+
+#endif
+#ifdef VK_AMD_memory_overallocation_behavior
+void handlemap_VkDeviceMemoryOverallocationCreateInfoAMD(
+    VulkanHandleMapping* handlemap, VkDeviceMemoryOverallocationCreateInfoAMD* toMap);
+
+#endif
+#ifdef VK_EXT_vertex_attribute_divisor
+void handlemap_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT* toMap);
+
+void handlemap_VkVertexInputBindingDivisorDescriptionEXT(
+    VulkanHandleMapping* handlemap, VkVertexInputBindingDivisorDescriptionEXT* toMap);
+
+void handlemap_VkPipelineVertexInputDivisorStateCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkPipelineVertexInputDivisorStateCreateInfoEXT* toMap);
+
+void handlemap_VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT* toMap);
+
+#endif
+#ifdef VK_GGP_frame_token
+void handlemap_VkPresentFrameTokenGGP(VulkanHandleMapping* handlemap,
+                                      VkPresentFrameTokenGGP* toMap);
+
+#endif
+#ifdef VK_EXT_pipeline_creation_feedback
+void handlemap_VkPipelineCreationFeedbackEXT(VulkanHandleMapping* handlemap,
+                                             VkPipelineCreationFeedbackEXT* toMap);
+
+void handlemap_VkPipelineCreationFeedbackCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkPipelineCreationFeedbackCreateInfoEXT* toMap);
+
+#endif
+#ifdef VK_NV_shader_subgroup_partitioned
+#endif
+#ifdef VK_NV_compute_shader_derivatives
+void handlemap_VkPhysicalDeviceComputeShaderDerivativesFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceComputeShaderDerivativesFeaturesNV* toMap);
+
+#endif
+#ifdef VK_NV_mesh_shader
+void handlemap_VkPhysicalDeviceMeshShaderFeaturesNV(VulkanHandleMapping* handlemap,
+                                                    VkPhysicalDeviceMeshShaderFeaturesNV* toMap);
+
+void handlemap_VkPhysicalDeviceMeshShaderPropertiesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceMeshShaderPropertiesNV* toMap);
+
+void handlemap_VkDrawMeshTasksIndirectCommandNV(VulkanHandleMapping* handlemap,
+                                                VkDrawMeshTasksIndirectCommandNV* toMap);
+
+#endif
+#ifdef VK_NV_fragment_shader_barycentric
+void handlemap_VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV* toMap);
+
+#endif
+#ifdef VK_NV_shader_image_footprint
+void handlemap_VkPhysicalDeviceShaderImageFootprintFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderImageFootprintFeaturesNV* toMap);
+
+#endif
+#ifdef VK_NV_scissor_exclusive
+void handlemap_VkPipelineViewportExclusiveScissorStateCreateInfoNV(
+    VulkanHandleMapping* handlemap, VkPipelineViewportExclusiveScissorStateCreateInfoNV* toMap);
+
+void handlemap_VkPhysicalDeviceExclusiveScissorFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceExclusiveScissorFeaturesNV* toMap);
+
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+void handlemap_VkQueueFamilyCheckpointPropertiesNV(VulkanHandleMapping* handlemap,
+                                                   VkQueueFamilyCheckpointPropertiesNV* toMap);
+
+void handlemap_VkCheckpointDataNV(VulkanHandleMapping* handlemap, VkCheckpointDataNV* toMap);
+
+#endif
+#ifdef VK_INTEL_shader_integer_functions2
+void handlemap_VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL* toMap);
+
+#endif
+#ifdef VK_INTEL_performance_query
+void handlemap_VkPerformanceValueDataINTEL(VulkanHandleMapping* handlemap,
+                                           VkPerformanceValueDataINTEL* toMap);
+
+void handlemap_VkPerformanceValueINTEL(VulkanHandleMapping* handlemap,
+                                       VkPerformanceValueINTEL* toMap);
+
+void handlemap_VkInitializePerformanceApiInfoINTEL(VulkanHandleMapping* handlemap,
+                                                   VkInitializePerformanceApiInfoINTEL* toMap);
+
+void handlemap_VkQueryPoolPerformanceQueryCreateInfoINTEL(
+    VulkanHandleMapping* handlemap, VkQueryPoolPerformanceQueryCreateInfoINTEL* toMap);
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkQueryPoolPerformanceQueryCreateInfoINTEL,
+                      handlemap_VkQueryPoolCreateInfoINTEL)
+
+void handlemap_VkPerformanceMarkerInfoINTEL(VulkanHandleMapping* handlemap,
+                                            VkPerformanceMarkerInfoINTEL* toMap);
+
+void handlemap_VkPerformanceStreamMarkerInfoINTEL(VulkanHandleMapping* handlemap,
+                                                  VkPerformanceStreamMarkerInfoINTEL* toMap);
+
+void handlemap_VkPerformanceOverrideInfoINTEL(VulkanHandleMapping* handlemap,
+                                              VkPerformanceOverrideInfoINTEL* toMap);
+
+void handlemap_VkPerformanceConfigurationAcquireInfoINTEL(
+    VulkanHandleMapping* handlemap, VkPerformanceConfigurationAcquireInfoINTEL* toMap);
+
+#endif
+#ifdef VK_EXT_pci_bus_info
+void handlemap_VkPhysicalDevicePCIBusInfoPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDevicePCIBusInfoPropertiesEXT* toMap);
+
+#endif
+#ifdef VK_AMD_display_native_hdr
+void handlemap_VkDisplayNativeHdrSurfaceCapabilitiesAMD(
+    VulkanHandleMapping* handlemap, VkDisplayNativeHdrSurfaceCapabilitiesAMD* toMap);
+
+void handlemap_VkSwapchainDisplayNativeHdrCreateInfoAMD(
+    VulkanHandleMapping* handlemap, VkSwapchainDisplayNativeHdrCreateInfoAMD* toMap);
+
+#endif
+#ifdef VK_FUCHSIA_imagepipe_surface
+void handlemap_VkImagePipeSurfaceCreateInfoFUCHSIA(VulkanHandleMapping* handlemap,
+                                                   VkImagePipeSurfaceCreateInfoFUCHSIA* toMap);
+
+#endif
+#ifdef VK_EXT_metal_surface
+void handlemap_VkMetalSurfaceCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                           VkMetalSurfaceCreateInfoEXT* toMap);
+
+#endif
+#ifdef VK_EXT_fragment_density_map
+void handlemap_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceFragmentDensityMapFeaturesEXT* toMap);
+
+void handlemap_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceFragmentDensityMapPropertiesEXT* toMap);
+
+void handlemap_VkRenderPassFragmentDensityMapCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkRenderPassFragmentDensityMapCreateInfoEXT* toMap);
+
+#endif
+#ifdef VK_EXT_scalar_block_layout
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceScalarBlockLayoutFeatures,
+                      handlemap_VkPhysicalDeviceScalarBlockLayoutFeaturesEXT)
+
+#endif
+#ifdef VK_GOOGLE_hlsl_functionality1
+#endif
+#ifdef VK_GOOGLE_decorate_string
+#endif
+#ifdef VK_EXT_subgroup_size_control
+void handlemap_VkPhysicalDeviceSubgroupSizeControlFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceSubgroupSizeControlFeaturesEXT* toMap);
+
+void handlemap_VkPhysicalDeviceSubgroupSizeControlPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceSubgroupSizeControlPropertiesEXT* toMap);
+
+void handlemap_VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT* toMap);
+
+#endif
+#ifdef VK_AMD_shader_core_properties2
+void handlemap_VkPhysicalDeviceShaderCoreProperties2AMD(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderCoreProperties2AMD* toMap);
+
+#endif
+#ifdef VK_AMD_device_coherent_memory
+void handlemap_VkPhysicalDeviceCoherentMemoryFeaturesAMD(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceCoherentMemoryFeaturesAMD* toMap);
+
+#endif
+#ifdef VK_EXT_shader_image_atomic_int64
+void handlemap_VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT* toMap);
+
+#endif
+#ifdef VK_EXT_memory_budget
+void handlemap_VkPhysicalDeviceMemoryBudgetPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceMemoryBudgetPropertiesEXT* toMap);
+
+#endif
+#ifdef VK_EXT_memory_priority
+void handlemap_VkPhysicalDeviceMemoryPriorityFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceMemoryPriorityFeaturesEXT* toMap);
+
+void handlemap_VkMemoryPriorityAllocateInfoEXT(VulkanHandleMapping* handlemap,
+                                               VkMemoryPriorityAllocateInfoEXT* toMap);
+
+#endif
+#ifdef VK_NV_dedicated_allocation_image_aliasing
+void handlemap_VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV(
+    VulkanHandleMapping* handlemap,
+    VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV* toMap);
+
+#endif
+#ifdef VK_EXT_buffer_device_address
+void handlemap_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceBufferDeviceAddressFeaturesEXT* toMap);
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT,
+                      handlemap_VkPhysicalDeviceBufferAddressFeaturesEXT)
+
+DEFINE_ALIAS_FUNCTION(handlemap_VkBufferDeviceAddressInfo, handlemap_VkBufferDeviceAddressInfoEXT)
+
+void handlemap_VkBufferDeviceAddressCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                                  VkBufferDeviceAddressCreateInfoEXT* toMap);
+
+#endif
+#ifdef VK_EXT_tooling_info
+void handlemap_VkPhysicalDeviceToolPropertiesEXT(VulkanHandleMapping* handlemap,
+                                                 VkPhysicalDeviceToolPropertiesEXT* toMap);
+
+#endif
+#ifdef VK_EXT_separate_stencil_usage
+DEFINE_ALIAS_FUNCTION(handlemap_VkImageStencilUsageCreateInfo,
+                      handlemap_VkImageStencilUsageCreateInfoEXT)
+
+#endif
+#ifdef VK_EXT_validation_features
+void handlemap_VkValidationFeaturesEXT(VulkanHandleMapping* handlemap,
+                                       VkValidationFeaturesEXT* toMap);
+
+#endif
+#ifdef VK_NV_cooperative_matrix
+void handlemap_VkCooperativeMatrixPropertiesNV(VulkanHandleMapping* handlemap,
+                                               VkCooperativeMatrixPropertiesNV* toMap);
+
+void handlemap_VkPhysicalDeviceCooperativeMatrixFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceCooperativeMatrixFeaturesNV* toMap);
+
+void handlemap_VkPhysicalDeviceCooperativeMatrixPropertiesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceCooperativeMatrixPropertiesNV* toMap);
+
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+void handlemap_VkPhysicalDeviceCoverageReductionModeFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceCoverageReductionModeFeaturesNV* toMap);
+
+void handlemap_VkPipelineCoverageReductionStateCreateInfoNV(
+    VulkanHandleMapping* handlemap, VkPipelineCoverageReductionStateCreateInfoNV* toMap);
+
+void handlemap_VkFramebufferMixedSamplesCombinationNV(
+    VulkanHandleMapping* handlemap, VkFramebufferMixedSamplesCombinationNV* toMap);
+
+#endif
+#ifdef VK_EXT_fragment_shader_interlock
+void handlemap_VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT* toMap);
+
+#endif
+#ifdef VK_EXT_ycbcr_image_arrays
+void handlemap_VkPhysicalDeviceYcbcrImageArraysFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceYcbcrImageArraysFeaturesEXT* toMap);
+
+#endif
+#ifdef VK_EXT_provoking_vertex
+void handlemap_VkPhysicalDeviceProvokingVertexFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceProvokingVertexFeaturesEXT* toMap);
+
+void handlemap_VkPhysicalDeviceProvokingVertexPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceProvokingVertexPropertiesEXT* toMap);
+
+void handlemap_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT(
+    VulkanHandleMapping* handlemap,
+    VkPipelineRasterizationProvokingVertexStateCreateInfoEXT* toMap);
+
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+void handlemap_VkSurfaceFullScreenExclusiveInfoEXT(VulkanHandleMapping* handlemap,
+                                                   VkSurfaceFullScreenExclusiveInfoEXT* toMap);
+
+void handlemap_VkSurfaceCapabilitiesFullScreenExclusiveEXT(
+    VulkanHandleMapping* handlemap, VkSurfaceCapabilitiesFullScreenExclusiveEXT* toMap);
+
+void handlemap_VkSurfaceFullScreenExclusiveWin32InfoEXT(
+    VulkanHandleMapping* handlemap, VkSurfaceFullScreenExclusiveWin32InfoEXT* toMap);
+
+#endif
+#ifdef VK_EXT_headless_surface
+void handlemap_VkHeadlessSurfaceCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                              VkHeadlessSurfaceCreateInfoEXT* toMap);
+
+#endif
+#ifdef VK_EXT_line_rasterization
+void handlemap_VkPhysicalDeviceLineRasterizationFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceLineRasterizationFeaturesEXT* toMap);
+
+void handlemap_VkPhysicalDeviceLineRasterizationPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceLineRasterizationPropertiesEXT* toMap);
+
+void handlemap_VkPipelineRasterizationLineStateCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkPipelineRasterizationLineStateCreateInfoEXT* toMap);
+
+#endif
+#ifdef VK_EXT_shader_atomic_float
+void handlemap_VkPhysicalDeviceShaderAtomicFloatFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderAtomicFloatFeaturesEXT* toMap);
+
+#endif
+#ifdef VK_EXT_host_query_reset
+DEFINE_ALIAS_FUNCTION(handlemap_VkPhysicalDeviceHostQueryResetFeatures,
+                      handlemap_VkPhysicalDeviceHostQueryResetFeaturesEXT)
+
+#endif
+#ifdef VK_EXT_index_type_uint8
+void handlemap_VkPhysicalDeviceIndexTypeUint8FeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceIndexTypeUint8FeaturesEXT* toMap);
+
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+void handlemap_VkPhysicalDeviceExtendedDynamicStateFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceExtendedDynamicStateFeaturesEXT* toMap);
+
+#endif
+#ifdef VK_EXT_shader_atomic_float2
+void handlemap_VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT* toMap);
+
+#endif
+#ifdef VK_EXT_shader_demote_to_helper_invocation
+void handlemap_VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT(
+    VulkanHandleMapping* handlemap,
+    VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT* toMap);
+
+#endif
+#ifdef VK_NV_device_generated_commands
+void handlemap_VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV* toMap);
+
+void handlemap_VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV* toMap);
+
+void handlemap_VkGraphicsShaderGroupCreateInfoNV(VulkanHandleMapping* handlemap,
+                                                 VkGraphicsShaderGroupCreateInfoNV* toMap);
+
+void handlemap_VkGraphicsPipelineShaderGroupsCreateInfoNV(
+    VulkanHandleMapping* handlemap, VkGraphicsPipelineShaderGroupsCreateInfoNV* toMap);
+
+void handlemap_VkBindShaderGroupIndirectCommandNV(VulkanHandleMapping* handlemap,
+                                                  VkBindShaderGroupIndirectCommandNV* toMap);
+
+void handlemap_VkBindIndexBufferIndirectCommandNV(VulkanHandleMapping* handlemap,
+                                                  VkBindIndexBufferIndirectCommandNV* toMap);
+
+void handlemap_VkBindVertexBufferIndirectCommandNV(VulkanHandleMapping* handlemap,
+                                                   VkBindVertexBufferIndirectCommandNV* toMap);
+
+void handlemap_VkSetStateFlagsIndirectCommandNV(VulkanHandleMapping* handlemap,
+                                                VkSetStateFlagsIndirectCommandNV* toMap);
+
+void handlemap_VkIndirectCommandsStreamNV(VulkanHandleMapping* handlemap,
+                                          VkIndirectCommandsStreamNV* toMap);
+
+void handlemap_VkIndirectCommandsLayoutTokenNV(VulkanHandleMapping* handlemap,
+                                               VkIndirectCommandsLayoutTokenNV* toMap);
+
+void handlemap_VkIndirectCommandsLayoutCreateInfoNV(VulkanHandleMapping* handlemap,
+                                                    VkIndirectCommandsLayoutCreateInfoNV* toMap);
+
+void handlemap_VkGeneratedCommandsInfoNV(VulkanHandleMapping* handlemap,
+                                         VkGeneratedCommandsInfoNV* toMap);
+
+void handlemap_VkGeneratedCommandsMemoryRequirementsInfoNV(
+    VulkanHandleMapping* handlemap, VkGeneratedCommandsMemoryRequirementsInfoNV* toMap);
+
+#endif
+#ifdef VK_NV_inherited_viewport_scissor
+void handlemap_VkPhysicalDeviceInheritedViewportScissorFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceInheritedViewportScissorFeaturesNV* toMap);
+
+void handlemap_VkCommandBufferInheritanceViewportScissorInfoNV(
+    VulkanHandleMapping* handlemap, VkCommandBufferInheritanceViewportScissorInfoNV* toMap);
+
+#endif
+#ifdef VK_EXT_texel_buffer_alignment
+void handlemap_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT* toMap);
+
+void handlemap_VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT* toMap);
+
+#endif
+#ifdef VK_QCOM_render_pass_transform
+void handlemap_VkRenderPassTransformBeginInfoQCOM(VulkanHandleMapping* handlemap,
+                                                  VkRenderPassTransformBeginInfoQCOM* toMap);
+
+void handlemap_VkCommandBufferInheritanceRenderPassTransformInfoQCOM(
+    VulkanHandleMapping* handlemap, VkCommandBufferInheritanceRenderPassTransformInfoQCOM* toMap);
+
+#endif
+#ifdef VK_EXT_device_memory_report
+void handlemap_VkPhysicalDeviceDeviceMemoryReportFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceDeviceMemoryReportFeaturesEXT* toMap);
+
+void handlemap_VkDeviceMemoryReportCallbackDataEXT(VulkanHandleMapping* handlemap,
+                                                   VkDeviceMemoryReportCallbackDataEXT* toMap);
+
+void handlemap_VkDeviceDeviceMemoryReportCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkDeviceDeviceMemoryReportCreateInfoEXT* toMap);
+
+#endif
+#ifdef VK_EXT_acquire_drm_display
+#endif
+#ifdef VK_EXT_robustness2
+void handlemap_VkPhysicalDeviceRobustness2FeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceRobustness2FeaturesEXT* toMap);
+
+void handlemap_VkPhysicalDeviceRobustness2PropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceRobustness2PropertiesEXT* toMap);
+
+#endif
+#ifdef VK_EXT_custom_border_color
+void handlemap_VkSamplerCustomBorderColorCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkSamplerCustomBorderColorCreateInfoEXT* toMap);
+
+void handlemap_VkPhysicalDeviceCustomBorderColorPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceCustomBorderColorPropertiesEXT* toMap);
+
+void handlemap_VkPhysicalDeviceCustomBorderColorFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceCustomBorderColorFeaturesEXT* toMap);
+
+#endif
+#ifdef VK_GOOGLE_user_type
+#endif
+#ifdef VK_EXT_private_data
+void handlemap_VkPhysicalDevicePrivateDataFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDevicePrivateDataFeaturesEXT* toMap);
+
+void handlemap_VkDevicePrivateDataCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                                VkDevicePrivateDataCreateInfoEXT* toMap);
+
+void handlemap_VkPrivateDataSlotCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                              VkPrivateDataSlotCreateInfoEXT* toMap);
+
+#endif
+#ifdef VK_EXT_pipeline_creation_cache_control
+void handlemap_VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT* toMap);
+
+#endif
+#ifdef VK_NV_device_diagnostics_config
+void handlemap_VkPhysicalDeviceDiagnosticsConfigFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceDiagnosticsConfigFeaturesNV* toMap);
+
+void handlemap_VkDeviceDiagnosticsConfigCreateInfoNV(VulkanHandleMapping* handlemap,
+                                                     VkDeviceDiagnosticsConfigCreateInfoNV* toMap);
+
+#endif
+#ifdef VK_QCOM_render_pass_store_ops
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+void handlemap_VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV* toMap);
+
+void handlemap_VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV* toMap);
+
+void handlemap_VkPipelineFragmentShadingRateEnumStateCreateInfoNV(
+    VulkanHandleMapping* handlemap, VkPipelineFragmentShadingRateEnumStateCreateInfoNV* toMap);
+
+#endif
+#ifdef VK_NV_ray_tracing_motion_blur
+void handlemap_VkDeviceOrHostAddressConstKHR(VulkanHandleMapping* handlemap,
+                                             VkDeviceOrHostAddressConstKHR* toMap);
+
+void handlemap_VkAccelerationStructureGeometryMotionTrianglesDataNV(
+    VulkanHandleMapping* handlemap, VkAccelerationStructureGeometryMotionTrianglesDataNV* toMap);
+
+void handlemap_VkAccelerationStructureMotionInfoNV(VulkanHandleMapping* handlemap,
+                                                   VkAccelerationStructureMotionInfoNV* toMap);
+
+void handlemap_VkAccelerationStructureMatrixMotionInstanceNV(
+    VulkanHandleMapping* handlemap, VkAccelerationStructureMatrixMotionInstanceNV* toMap);
+
+void handlemap_VkSRTDataNV(VulkanHandleMapping* handlemap, VkSRTDataNV* toMap);
+
+void handlemap_VkAccelerationStructureSRTMotionInstanceNV(
+    VulkanHandleMapping* handlemap, VkAccelerationStructureSRTMotionInstanceNV* toMap);
+
+void handlemap_VkAccelerationStructureMotionInstanceDataNV(
+    VulkanHandleMapping* handlemap, VkAccelerationStructureMotionInstanceDataNV* toMap);
+
+void handlemap_VkAccelerationStructureMotionInstanceNV(
+    VulkanHandleMapping* handlemap, VkAccelerationStructureMotionInstanceNV* toMap);
+
+void handlemap_VkPhysicalDeviceRayTracingMotionBlurFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceRayTracingMotionBlurFeaturesNV* toMap);
+
+#endif
+#ifdef VK_EXT_ycbcr_2plane_444_formats
+void handlemap_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT* toMap);
+
+#endif
+#ifdef VK_EXT_fragment_density_map2
+void handlemap_VkPhysicalDeviceFragmentDensityMap2FeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceFragmentDensityMap2FeaturesEXT* toMap);
+
+void handlemap_VkPhysicalDeviceFragmentDensityMap2PropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceFragmentDensityMap2PropertiesEXT* toMap);
+
+#endif
+#ifdef VK_QCOM_rotated_copy_commands
+void handlemap_VkCopyCommandTransformInfoQCOM(VulkanHandleMapping* handlemap,
+                                              VkCopyCommandTransformInfoQCOM* toMap);
+
+#endif
+#ifdef VK_EXT_image_robustness
+void handlemap_VkPhysicalDeviceImageRobustnessFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceImageRobustnessFeaturesEXT* toMap);
+
+#endif
+#ifdef VK_EXT_4444_formats
+void handlemap_VkPhysicalDevice4444FormatsFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDevice4444FormatsFeaturesEXT* toMap);
+
+#endif
+#ifdef VK_EXT_rgba10x6_formats
+void handlemap_VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT* toMap);
+
+#endif
+#ifdef VK_NV_acquire_winrt_display
+#endif
+#ifdef VK_EXT_directfb_surface
+void handlemap_VkDirectFBSurfaceCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                              VkDirectFBSurfaceCreateInfoEXT* toMap);
+
+#endif
+#ifdef VK_VALVE_mutable_descriptor_type
+void handlemap_VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE* toMap);
+
+void handlemap_VkMutableDescriptorTypeListVALVE(VulkanHandleMapping* handlemap,
+                                                VkMutableDescriptorTypeListVALVE* toMap);
+
+void handlemap_VkMutableDescriptorTypeCreateInfoVALVE(
+    VulkanHandleMapping* handlemap, VkMutableDescriptorTypeCreateInfoVALVE* toMap);
+
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+void handlemap_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT* toMap);
+
+void handlemap_VkVertexInputBindingDescription2EXT(VulkanHandleMapping* handlemap,
+                                                   VkVertexInputBindingDescription2EXT* toMap);
+
+void handlemap_VkVertexInputAttributeDescription2EXT(VulkanHandleMapping* handlemap,
+                                                     VkVertexInputAttributeDescription2EXT* toMap);
+
+#endif
+#ifdef VK_EXT_physical_device_drm
+void handlemap_VkPhysicalDeviceDrmPropertiesEXT(VulkanHandleMapping* handlemap,
+                                                VkPhysicalDeviceDrmPropertiesEXT* toMap);
+
+#endif
+#ifdef VK_EXT_primitive_topology_list_restart
+void handlemap_VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT* toMap);
+
+#endif
+#ifdef VK_FUCHSIA_external_memory
+void handlemap_VkImportMemoryZirconHandleInfoFUCHSIA(VulkanHandleMapping* handlemap,
+                                                     VkImportMemoryZirconHandleInfoFUCHSIA* toMap);
+
+void handlemap_VkMemoryZirconHandlePropertiesFUCHSIA(VulkanHandleMapping* handlemap,
+                                                     VkMemoryZirconHandlePropertiesFUCHSIA* toMap);
+
+void handlemap_VkMemoryGetZirconHandleInfoFUCHSIA(VulkanHandleMapping* handlemap,
+                                                  VkMemoryGetZirconHandleInfoFUCHSIA* toMap);
+
+#endif
+#ifdef VK_FUCHSIA_external_semaphore
+void handlemap_VkImportSemaphoreZirconHandleInfoFUCHSIA(
+    VulkanHandleMapping* handlemap, VkImportSemaphoreZirconHandleInfoFUCHSIA* toMap);
+
+void handlemap_VkSemaphoreGetZirconHandleInfoFUCHSIA(VulkanHandleMapping* handlemap,
+                                                     VkSemaphoreGetZirconHandleInfoFUCHSIA* toMap);
+
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+void handlemap_VkBufferCollectionCreateInfoFUCHSIA(VulkanHandleMapping* handlemap,
+                                                   VkBufferCollectionCreateInfoFUCHSIA* toMap);
+
+void handlemap_VkImportMemoryBufferCollectionFUCHSIA(VulkanHandleMapping* handlemap,
+                                                     VkImportMemoryBufferCollectionFUCHSIA* toMap);
+
+void handlemap_VkBufferCollectionImageCreateInfoFUCHSIA(
+    VulkanHandleMapping* handlemap, VkBufferCollectionImageCreateInfoFUCHSIA* toMap);
+
+void handlemap_VkBufferCollectionConstraintsInfoFUCHSIA(
+    VulkanHandleMapping* handlemap, VkBufferCollectionConstraintsInfoFUCHSIA* toMap);
+
+void handlemap_VkBufferConstraintsInfoFUCHSIA(VulkanHandleMapping* handlemap,
+                                              VkBufferConstraintsInfoFUCHSIA* toMap);
+
+void handlemap_VkBufferCollectionBufferCreateInfoFUCHSIA(
+    VulkanHandleMapping* handlemap, VkBufferCollectionBufferCreateInfoFUCHSIA* toMap);
+
+void handlemap_VkSysmemColorSpaceFUCHSIA(VulkanHandleMapping* handlemap,
+                                         VkSysmemColorSpaceFUCHSIA* toMap);
+
+void handlemap_VkBufferCollectionPropertiesFUCHSIA(VulkanHandleMapping* handlemap,
+                                                   VkBufferCollectionPropertiesFUCHSIA* toMap);
+
+void handlemap_VkImageFormatConstraintsInfoFUCHSIA(VulkanHandleMapping* handlemap,
+                                                   VkImageFormatConstraintsInfoFUCHSIA* toMap);
+
+void handlemap_VkImageConstraintsInfoFUCHSIA(VulkanHandleMapping* handlemap,
+                                             VkImageConstraintsInfoFUCHSIA* toMap);
+
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+void handlemap_VkSubpassShadingPipelineCreateInfoHUAWEI(
+    VulkanHandleMapping* handlemap, VkSubpassShadingPipelineCreateInfoHUAWEI* toMap);
+
+void handlemap_VkPhysicalDeviceSubpassShadingFeaturesHUAWEI(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceSubpassShadingFeaturesHUAWEI* toMap);
+
+void handlemap_VkPhysicalDeviceSubpassShadingPropertiesHUAWEI(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceSubpassShadingPropertiesHUAWEI* toMap);
+
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+void handlemap_VkPhysicalDeviceInvocationMaskFeaturesHUAWEI(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceInvocationMaskFeaturesHUAWEI* toMap);
+
+#endif
+#ifdef VK_NV_external_memory_rdma
+void handlemap_VkMemoryGetRemoteAddressInfoNV(VulkanHandleMapping* handlemap,
+                                              VkMemoryGetRemoteAddressInfoNV* toMap);
+
+void handlemap_VkPhysicalDeviceExternalMemoryRDMAFeaturesNV(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceExternalMemoryRDMAFeaturesNV* toMap);
+
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+void handlemap_VkPhysicalDeviceExtendedDynamicState2FeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceExtendedDynamicState2FeaturesEXT* toMap);
+
+#endif
+#ifdef VK_QNX_screen_surface
+void handlemap_VkScreenSurfaceCreateInfoQNX(VulkanHandleMapping* handlemap,
+                                            VkScreenSurfaceCreateInfoQNX* toMap);
+
+#endif
+#ifdef VK_EXT_color_write_enable
+void handlemap_VkPhysicalDeviceColorWriteEnableFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceColorWriteEnableFeaturesEXT* toMap);
+
+void handlemap_VkPipelineColorWriteCreateInfoEXT(VulkanHandleMapping* handlemap,
+                                                 VkPipelineColorWriteCreateInfoEXT* toMap);
+
+#endif
+#ifdef VK_GOOGLE_gfxstream
+void handlemap_VkImportColorBufferGOOGLE(VulkanHandleMapping* handlemap,
+                                         VkImportColorBufferGOOGLE* toMap);
+
+void handlemap_VkImportBufferGOOGLE(VulkanHandleMapping* handlemap, VkImportBufferGOOGLE* toMap);
+
+void handlemap_VkCreateBlobGOOGLE(VulkanHandleMapping* handlemap, VkCreateBlobGOOGLE* toMap);
+
+#endif
+#ifdef VK_EXT_global_priority_query
+void handlemap_VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT* toMap);
+
+void handlemap_VkQueueFamilyGlobalPriorityPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkQueueFamilyGlobalPriorityPropertiesEXT* toMap);
+
+#endif
+#ifdef VK_EXT_multi_draw
+void handlemap_VkPhysicalDeviceMultiDrawFeaturesEXT(VulkanHandleMapping* handlemap,
+                                                    VkPhysicalDeviceMultiDrawFeaturesEXT* toMap);
+
+void handlemap_VkPhysicalDeviceMultiDrawPropertiesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceMultiDrawPropertiesEXT* toMap);
+
+void handlemap_VkMultiDrawInfoEXT(VulkanHandleMapping* handlemap, VkMultiDrawInfoEXT* toMap);
+
+void handlemap_VkMultiDrawIndexedInfoEXT(VulkanHandleMapping* handlemap,
+                                         VkMultiDrawIndexedInfoEXT* toMap);
+
+#endif
+#ifdef VK_EXT_load_store_op_none
+#endif
+#ifdef VK_EXT_border_color_swizzle
+void handlemap_VkPhysicalDeviceBorderColorSwizzleFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceBorderColorSwizzleFeaturesEXT* toMap);
+
+void handlemap_VkSamplerBorderColorComponentMappingCreateInfoEXT(
+    VulkanHandleMapping* handlemap, VkSamplerBorderColorComponentMappingCreateInfoEXT* toMap);
+
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+void handlemap_VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT(
+    VulkanHandleMapping* handlemap, VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT* toMap);
+
+#endif
+#ifdef VK_KHR_acceleration_structure
+void handlemap_VkDeviceOrHostAddressKHR(VulkanHandleMapping* handlemap,
+                                        VkDeviceOrHostAddressKHR* toMap);
+
+void handlemap_VkAccelerationStructureBuildRangeInfoKHR(
+    VulkanHandleMapping* handlemap, VkAccelerationStructureBuildRangeInfoKHR* toMap);
+
+void handlemap_VkAccelerationStructureGeometryTrianglesDataKHR(
+    VulkanHandleMapping* handlemap, VkAccelerationStructureGeometryTrianglesDataKHR* toMap);
+
+void handlemap_VkAccelerationStructureGeometryAabbsDataKHR(
+    VulkanHandleMapping* handlemap, VkAccelerationStructureGeometryAabbsDataKHR* toMap);
+
+void handlemap_VkAccelerationStructureGeometryInstancesDataKHR(
+    VulkanHandleMapping* handlemap, VkAccelerationStructureGeometryInstancesDataKHR* toMap);
+
+void handlemap_VkAccelerationStructureGeometryDataKHR(
+    VulkanHandleMapping* handlemap, VkAccelerationStructureGeometryDataKHR* toMap);
+
+void handlemap_VkAccelerationStructureGeometryKHR(VulkanHandleMapping* handlemap,
+                                                  VkAccelerationStructureGeometryKHR* toMap);
+
+void handlemap_VkAccelerationStructureBuildGeometryInfoKHR(
+    VulkanHandleMapping* handlemap, VkAccelerationStructureBuildGeometryInfoKHR* toMap);
+
+void handlemap_VkAccelerationStructureCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                                    VkAccelerationStructureCreateInfoKHR* toMap);
+
+void handlemap_VkWriteDescriptorSetAccelerationStructureKHR(
+    VulkanHandleMapping* handlemap, VkWriteDescriptorSetAccelerationStructureKHR* toMap);
+
+void handlemap_VkPhysicalDeviceAccelerationStructureFeaturesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceAccelerationStructureFeaturesKHR* toMap);
+
+void handlemap_VkPhysicalDeviceAccelerationStructurePropertiesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceAccelerationStructurePropertiesKHR* toMap);
+
+void handlemap_VkAccelerationStructureDeviceAddressInfoKHR(
+    VulkanHandleMapping* handlemap, VkAccelerationStructureDeviceAddressInfoKHR* toMap);
+
+void handlemap_VkAccelerationStructureVersionInfoKHR(VulkanHandleMapping* handlemap,
+                                                     VkAccelerationStructureVersionInfoKHR* toMap);
+
+void handlemap_VkCopyAccelerationStructureToMemoryInfoKHR(
+    VulkanHandleMapping* handlemap, VkCopyAccelerationStructureToMemoryInfoKHR* toMap);
+
+void handlemap_VkCopyMemoryToAccelerationStructureInfoKHR(
+    VulkanHandleMapping* handlemap, VkCopyMemoryToAccelerationStructureInfoKHR* toMap);
+
+void handlemap_VkCopyAccelerationStructureInfoKHR(VulkanHandleMapping* handlemap,
+                                                  VkCopyAccelerationStructureInfoKHR* toMap);
+
+void handlemap_VkAccelerationStructureBuildSizesInfoKHR(
+    VulkanHandleMapping* handlemap, VkAccelerationStructureBuildSizesInfoKHR* toMap);
+
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+void handlemap_VkRayTracingShaderGroupCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                                    VkRayTracingShaderGroupCreateInfoKHR* toMap);
+
+void handlemap_VkRayTracingPipelineInterfaceCreateInfoKHR(
+    VulkanHandleMapping* handlemap, VkRayTracingPipelineInterfaceCreateInfoKHR* toMap);
+
+void handlemap_VkRayTracingPipelineCreateInfoKHR(VulkanHandleMapping* handlemap,
+                                                 VkRayTracingPipelineCreateInfoKHR* toMap);
+
+void handlemap_VkPhysicalDeviceRayTracingPipelineFeaturesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceRayTracingPipelineFeaturesKHR* toMap);
+
+void handlemap_VkPhysicalDeviceRayTracingPipelinePropertiesKHR(
+    VulkanHandleMapping* handlemap, VkPhysicalDeviceRayTracingPipelinePropertiesKHR* toMap);
+
+void handlemap_VkStridedDeviceAddressRegionKHR(VulkanHandleMapping* handlemap,
+                                               VkStridedDeviceAddressRegionKHR* toMap);
+
+void handlemap_VkTraceRaysIndirectCommandKHR(VulkanHandleMapping* handlemap,
+                                             VkTraceRaysIndirectCommandKHR* toMap);
+
+#endif
+#ifdef VK_KHR_ray_query
+void handlemap_VkPhysicalDeviceRayQueryFeaturesKHR(VulkanHandleMapping* handlemap,
+                                                   VkPhysicalDeviceRayQueryFeaturesKHR* toMap);
+
+#endif
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/goldfish_vk_marshaling_guest.cpp b/system/vulkan_enc/goldfish_vk_marshaling_guest.cpp
new file mode 100644
index 0000000..85fa1e2
--- /dev/null
+++ b/system/vulkan_enc/goldfish_vk_marshaling_guest.cpp
@@ -0,0 +1,33696 @@
+// Copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2018 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Autogenerated module goldfish_vk_marshaling_guest
+//
+// (impl) generated by codegen/vulkan/scripts/genvk.py -registry codegen/vulkan/xml/vk.xml cereal -o
+// host/vulkan/cereal
+//
+// Please do not modify directly;
+// re-run gfxstream-protocols/scripts/generate-vulkan-sources.sh,
+// or directly from Python by defining:
+// VULKAN_REGISTRY_XML_DIR : Directory containing vk.xml
+// VULKAN_REGISTRY_SCRIPTS_DIR : Directory containing genvk.py
+// CEREAL_OUTPUT_DIR: Where to put the generated sources.
+//
+// python3 $VULKAN_REGISTRY_SCRIPTS_DIR/genvk.py -registry $VULKAN_REGISTRY_XML_DIR/vk.xml cereal -o
+// $CEREAL_OUTPUT_DIR
+//
+
+#include "goldfish_vk_marshaling_guest.h"
+
+#include <cstring>
+
+#include "goldfish_vk_extension_structs_guest.h"
+#include "goldfish_vk_private_defs.h"
+
+namespace gfxstream {
+namespace vk {
+
+void marshal_extension_struct(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                              const void* structExtension);
+
+void unmarshal_extension_struct(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                void* structExtension_out);
+
+#ifdef VK_VERSION_1_0
+void marshal_VkExtent2D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                        const VkExtent2D* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->width, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->height, sizeof(uint32_t));
+}
+
+void unmarshal_VkExtent2D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                          VkExtent2D* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->width, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->height, sizeof(uint32_t));
+}
+
+void marshal_VkExtent3D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                        const VkExtent3D* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->width, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->height, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->depth, sizeof(uint32_t));
+}
+
+void unmarshal_VkExtent3D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                          VkExtent3D* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->width, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->height, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->depth, sizeof(uint32_t));
+}
+
+void marshal_VkOffset2D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                        const VkOffset2D* forMarshaling) {
+    (void)rootType;
+    vkStream->write((int32_t*)&forMarshaling->x, sizeof(int32_t));
+    vkStream->write((int32_t*)&forMarshaling->y, sizeof(int32_t));
+}
+
+void unmarshal_VkOffset2D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                          VkOffset2D* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((int32_t*)&forUnmarshaling->x, sizeof(int32_t));
+    vkStream->read((int32_t*)&forUnmarshaling->y, sizeof(int32_t));
+}
+
+void marshal_VkOffset3D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                        const VkOffset3D* forMarshaling) {
+    (void)rootType;
+    vkStream->write((int32_t*)&forMarshaling->x, sizeof(int32_t));
+    vkStream->write((int32_t*)&forMarshaling->y, sizeof(int32_t));
+    vkStream->write((int32_t*)&forMarshaling->z, sizeof(int32_t));
+}
+
+void unmarshal_VkOffset3D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                          VkOffset3D* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((int32_t*)&forUnmarshaling->x, sizeof(int32_t));
+    vkStream->read((int32_t*)&forUnmarshaling->y, sizeof(int32_t));
+    vkStream->read((int32_t*)&forUnmarshaling->z, sizeof(int32_t));
+}
+
+void marshal_VkRect2D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                      const VkRect2D* forMarshaling) {
+    (void)rootType;
+    marshal_VkOffset2D(vkStream, rootType, (VkOffset2D*)(&forMarshaling->offset));
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->extent));
+}
+
+void unmarshal_VkRect2D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                        VkRect2D* forUnmarshaling) {
+    (void)rootType;
+    unmarshal_VkOffset2D(vkStream, rootType, (VkOffset2D*)(&forUnmarshaling->offset));
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->extent));
+}
+
+void marshal_VkBaseInStructure(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               const VkBaseInStructure* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+}
+
+void unmarshal_VkBaseInStructure(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 VkBaseInStructure* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+}
+
+void marshal_VkBaseOutStructure(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkBaseOutStructure* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+}
+
+void unmarshal_VkBaseOutStructure(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkBaseOutStructure* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+}
+
+void marshal_VkBufferMemoryBarrier(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkBufferMemoryBarrier* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkAccessFlags*)&forMarshaling->srcAccessMask, sizeof(VkAccessFlags));
+    vkStream->write((VkAccessFlags*)&forMarshaling->dstAccessMask, sizeof(VkAccessFlags));
+    vkStream->write((uint32_t*)&forMarshaling->srcQueueFamilyIndex, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->dstQueueFamilyIndex, sizeof(uint32_t));
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkBuffer_u64(&forMarshaling->buffer, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkDeviceSize*)&forMarshaling->offset, sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
+}
+
+void unmarshal_VkBufferMemoryBarrier(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkBufferMemoryBarrier* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkAccessFlags*)&forUnmarshaling->srcAccessMask, sizeof(VkAccessFlags));
+    vkStream->read((VkAccessFlags*)&forUnmarshaling->dstAccessMask, sizeof(VkAccessFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->srcQueueFamilyIndex, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->dstQueueFamilyIndex, sizeof(uint32_t));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_0,
+                                                       (VkBuffer*)&forUnmarshaling->buffer, 1);
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->offset, sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->size, sizeof(VkDeviceSize));
+}
+
+void marshal_VkDispatchIndirectCommand(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkDispatchIndirectCommand* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->x, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->y, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->z, sizeof(uint32_t));
+}
+
+void unmarshal_VkDispatchIndirectCommand(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkDispatchIndirectCommand* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->x, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->y, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->z, sizeof(uint32_t));
+}
+
+void marshal_VkDrawIndexedIndirectCommand(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkDrawIndexedIndirectCommand* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->indexCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->instanceCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->firstIndex, sizeof(uint32_t));
+    vkStream->write((int32_t*)&forMarshaling->vertexOffset, sizeof(int32_t));
+    vkStream->write((uint32_t*)&forMarshaling->firstInstance, sizeof(uint32_t));
+}
+
+void unmarshal_VkDrawIndexedIndirectCommand(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkDrawIndexedIndirectCommand* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->indexCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->instanceCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->firstIndex, sizeof(uint32_t));
+    vkStream->read((int32_t*)&forUnmarshaling->vertexOffset, sizeof(int32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->firstInstance, sizeof(uint32_t));
+}
+
+void marshal_VkDrawIndirectCommand(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkDrawIndirectCommand* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->vertexCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->instanceCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->firstVertex, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->firstInstance, sizeof(uint32_t));
+}
+
+void unmarshal_VkDrawIndirectCommand(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkDrawIndirectCommand* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->vertexCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->instanceCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->firstVertex, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->firstInstance, sizeof(uint32_t));
+}
+
+void marshal_VkImageSubresourceRange(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkImageSubresourceRange* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkImageAspectFlags*)&forMarshaling->aspectMask, sizeof(VkImageAspectFlags));
+    vkStream->write((uint32_t*)&forMarshaling->baseMipLevel, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->levelCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->baseArrayLayer, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->layerCount, sizeof(uint32_t));
+}
+
+void unmarshal_VkImageSubresourceRange(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkImageSubresourceRange* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkImageAspectFlags*)&forUnmarshaling->aspectMask, sizeof(VkImageAspectFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->baseMipLevel, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->levelCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->baseArrayLayer, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->layerCount, sizeof(uint32_t));
+}
+
+void marshal_VkImageMemoryBarrier(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkImageMemoryBarrier* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkAccessFlags*)&forMarshaling->srcAccessMask, sizeof(VkAccessFlags));
+    vkStream->write((VkAccessFlags*)&forMarshaling->dstAccessMask, sizeof(VkAccessFlags));
+    vkStream->write((VkImageLayout*)&forMarshaling->oldLayout, sizeof(VkImageLayout));
+    vkStream->write((VkImageLayout*)&forMarshaling->newLayout, sizeof(VkImageLayout));
+    vkStream->write((uint32_t*)&forMarshaling->srcQueueFamilyIndex, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->dstQueueFamilyIndex, sizeof(uint32_t));
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkImage_u64(&forMarshaling->image, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    marshal_VkImageSubresourceRange(vkStream, rootType,
+                                    (VkImageSubresourceRange*)(&forMarshaling->subresourceRange));
+}
+
+void unmarshal_VkImageMemoryBarrier(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkImageMemoryBarrier* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkAccessFlags*)&forUnmarshaling->srcAccessMask, sizeof(VkAccessFlags));
+    vkStream->read((VkAccessFlags*)&forUnmarshaling->dstAccessMask, sizeof(VkAccessFlags));
+    vkStream->read((VkImageLayout*)&forUnmarshaling->oldLayout, sizeof(VkImageLayout));
+    vkStream->read((VkImageLayout*)&forUnmarshaling->newLayout, sizeof(VkImageLayout));
+    vkStream->read((uint32_t*)&forUnmarshaling->srcQueueFamilyIndex, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->dstQueueFamilyIndex, sizeof(uint32_t));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_0,
+                                                      (VkImage*)&forUnmarshaling->image, 1);
+    unmarshal_VkImageSubresourceRange(
+        vkStream, rootType, (VkImageSubresourceRange*)(&forUnmarshaling->subresourceRange));
+}
+
+void marshal_VkMemoryBarrier(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                             const VkMemoryBarrier* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkAccessFlags*)&forMarshaling->srcAccessMask, sizeof(VkAccessFlags));
+    vkStream->write((VkAccessFlags*)&forMarshaling->dstAccessMask, sizeof(VkAccessFlags));
+}
+
+void unmarshal_VkMemoryBarrier(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               VkMemoryBarrier* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkAccessFlags*)&forUnmarshaling->srcAccessMask, sizeof(VkAccessFlags));
+    vkStream->read((VkAccessFlags*)&forUnmarshaling->dstAccessMask, sizeof(VkAccessFlags));
+}
+
+void marshal_VkPipelineCacheHeaderVersionOne(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkPipelineCacheHeaderVersionOne* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->headerSize, sizeof(uint32_t));
+    vkStream->write((VkPipelineCacheHeaderVersion*)&forMarshaling->headerVersion,
+                    sizeof(VkPipelineCacheHeaderVersion));
+    vkStream->write((uint32_t*)&forMarshaling->vendorID, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->deviceID, sizeof(uint32_t));
+    vkStream->write((uint8_t*)forMarshaling->pipelineCacheUUID, VK_UUID_SIZE * sizeof(uint8_t));
+}
+
+void unmarshal_VkPipelineCacheHeaderVersionOne(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkPipelineCacheHeaderVersionOne* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->headerSize, sizeof(uint32_t));
+    vkStream->read((VkPipelineCacheHeaderVersion*)&forUnmarshaling->headerVersion,
+                   sizeof(VkPipelineCacheHeaderVersion));
+    vkStream->read((uint32_t*)&forUnmarshaling->vendorID, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->deviceID, sizeof(uint32_t));
+    vkStream->read((uint8_t*)forUnmarshaling->pipelineCacheUUID, VK_UUID_SIZE * sizeof(uint8_t));
+}
+
+void marshal_VkAllocationCallbacks(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkAllocationCallbacks* forMarshaling) {
+    (void)rootType;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pUserData;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pUserData) {
+        vkStream->write((void*)forMarshaling->pUserData, sizeof(uint8_t));
+    }
+    uint64_t cgen_var_1 = (uint64_t)forMarshaling->pfnAllocation;
+    vkStream->putBe64(cgen_var_1);
+    uint64_t cgen_var_2 = (uint64_t)forMarshaling->pfnReallocation;
+    vkStream->putBe64(cgen_var_2);
+    uint64_t cgen_var_3 = (uint64_t)forMarshaling->pfnFree;
+    vkStream->putBe64(cgen_var_3);
+    uint64_t cgen_var_4 = (uint64_t)forMarshaling->pfnInternalAllocation;
+    vkStream->putBe64(cgen_var_4);
+    uint64_t cgen_var_5 = (uint64_t)forMarshaling->pfnInternalFree;
+    vkStream->putBe64(cgen_var_5);
+}
+
+void unmarshal_VkAllocationCallbacks(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkAllocationCallbacks* forUnmarshaling) {
+    (void)rootType;
+    // WARNING PTR CHECK
+    void* check_pUserData;
+    check_pUserData = (void*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pUserData) {
+        if (!(check_pUserData)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pUserData inconsistent between guest and host\n");
+        }
+        vkStream->read((void*)forUnmarshaling->pUserData, sizeof(uint8_t));
+    }
+    forUnmarshaling->pfnAllocation = (PFN_vkAllocationFunction)vkStream->getBe64();
+    forUnmarshaling->pfnReallocation = (PFN_vkReallocationFunction)vkStream->getBe64();
+    forUnmarshaling->pfnFree = (PFN_vkFreeFunction)vkStream->getBe64();
+    forUnmarshaling->pfnInternalAllocation =
+        (PFN_vkInternalAllocationNotification)vkStream->getBe64();
+    forUnmarshaling->pfnInternalFree = (PFN_vkInternalFreeNotification)vkStream->getBe64();
+}
+
+void marshal_VkApplicationInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               const VkApplicationInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) {
+        // WARNING PTR CHECK
+        uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pApplicationName;
+        vkStream->putBe64(cgen_var_0);
+        if (forMarshaling->pApplicationName) {
+            vkStream->putString(forMarshaling->pApplicationName);
+        }
+    } else {
+        vkStream->putString(forMarshaling->pApplicationName);
+    }
+    vkStream->write((uint32_t*)&forMarshaling->applicationVersion, sizeof(uint32_t));
+    if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) {
+        // WARNING PTR CHECK
+        uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pEngineName;
+        vkStream->putBe64(cgen_var_0);
+        if (forMarshaling->pEngineName) {
+            vkStream->putString(forMarshaling->pEngineName);
+        }
+    } else {
+        vkStream->putString(forMarshaling->pEngineName);
+    }
+    vkStream->write((uint32_t*)&forMarshaling->engineVersion, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->apiVersion, sizeof(uint32_t));
+}
+
+void unmarshal_VkApplicationInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 VkApplicationInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) {
+        // WARNING PTR CHECK
+        const char* check_pApplicationName;
+        check_pApplicationName = (const char*)(uintptr_t)vkStream->getBe64();
+        if (forUnmarshaling->pApplicationName) {
+            if (!(check_pApplicationName)) {
+                fprintf(stderr,
+                        "fatal: forUnmarshaling->pApplicationName inconsistent between guest and "
+                        "host\n");
+            }
+            vkStream->loadStringInPlace((char**)&forUnmarshaling->pApplicationName);
+        }
+    } else {
+        vkStream->loadStringInPlace((char**)&forUnmarshaling->pApplicationName);
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->applicationVersion, sizeof(uint32_t));
+    if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) {
+        // WARNING PTR CHECK
+        const char* check_pEngineName;
+        check_pEngineName = (const char*)(uintptr_t)vkStream->getBe64();
+        if (forUnmarshaling->pEngineName) {
+            if (!(check_pEngineName)) {
+                fprintf(
+                    stderr,
+                    "fatal: forUnmarshaling->pEngineName inconsistent between guest and host\n");
+            }
+            vkStream->loadStringInPlace((char**)&forUnmarshaling->pEngineName);
+        }
+    } else {
+        vkStream->loadStringInPlace((char**)&forUnmarshaling->pEngineName);
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->engineVersion, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->apiVersion, sizeof(uint32_t));
+}
+
+void marshal_VkFormatProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkFormatProperties* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkFormatFeatureFlags*)&forMarshaling->linearTilingFeatures,
+                    sizeof(VkFormatFeatureFlags));
+    vkStream->write((VkFormatFeatureFlags*)&forMarshaling->optimalTilingFeatures,
+                    sizeof(VkFormatFeatureFlags));
+    vkStream->write((VkFormatFeatureFlags*)&forMarshaling->bufferFeatures,
+                    sizeof(VkFormatFeatureFlags));
+}
+
+void unmarshal_VkFormatProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkFormatProperties* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkFormatFeatureFlags*)&forUnmarshaling->linearTilingFeatures,
+                   sizeof(VkFormatFeatureFlags));
+    vkStream->read((VkFormatFeatureFlags*)&forUnmarshaling->optimalTilingFeatures,
+                   sizeof(VkFormatFeatureFlags));
+    vkStream->read((VkFormatFeatureFlags*)&forUnmarshaling->bufferFeatures,
+                   sizeof(VkFormatFeatureFlags));
+}
+
+void marshal_VkImageFormatProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkImageFormatProperties* forMarshaling) {
+    (void)rootType;
+    marshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forMarshaling->maxExtent));
+    vkStream->write((uint32_t*)&forMarshaling->maxMipLevels, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxArrayLayers, sizeof(uint32_t));
+    vkStream->write((VkSampleCountFlags*)&forMarshaling->sampleCounts, sizeof(VkSampleCountFlags));
+    vkStream->write((VkDeviceSize*)&forMarshaling->maxResourceSize, sizeof(VkDeviceSize));
+}
+
+void unmarshal_VkImageFormatProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkImageFormatProperties* forUnmarshaling) {
+    (void)rootType;
+    unmarshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forUnmarshaling->maxExtent));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxMipLevels, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxArrayLayers, sizeof(uint32_t));
+    vkStream->read((VkSampleCountFlags*)&forUnmarshaling->sampleCounts, sizeof(VkSampleCountFlags));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->maxResourceSize, sizeof(VkDeviceSize));
+}
+
+void marshal_VkInstanceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkInstanceCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkInstanceCreateFlags*)&forMarshaling->flags, sizeof(VkInstanceCreateFlags));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pApplicationInfo;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pApplicationInfo) {
+        marshal_VkApplicationInfo(vkStream, rootType,
+                                  (const VkApplicationInfo*)(forMarshaling->pApplicationInfo));
+    }
+    vkStream->write((uint32_t*)&forMarshaling->enabledLayerCount, sizeof(uint32_t));
+    saveStringArray(vkStream, forMarshaling->ppEnabledLayerNames, forMarshaling->enabledLayerCount);
+    vkStream->write((uint32_t*)&forMarshaling->enabledExtensionCount, sizeof(uint32_t));
+    saveStringArray(vkStream, forMarshaling->ppEnabledExtensionNames,
+                    forMarshaling->enabledExtensionCount);
+}
+
+void unmarshal_VkInstanceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkInstanceCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkInstanceCreateFlags*)&forUnmarshaling->flags, sizeof(VkInstanceCreateFlags));
+    // WARNING PTR CHECK
+    const VkApplicationInfo* check_pApplicationInfo;
+    check_pApplicationInfo = (const VkApplicationInfo*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pApplicationInfo) {
+        if (!(check_pApplicationInfo)) {
+            fprintf(
+                stderr,
+                "fatal: forUnmarshaling->pApplicationInfo inconsistent between guest and host\n");
+        }
+        unmarshal_VkApplicationInfo(vkStream, rootType,
+                                    (VkApplicationInfo*)(forUnmarshaling->pApplicationInfo));
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->enabledLayerCount, sizeof(uint32_t));
+    vkStream->loadStringArrayInPlace((char***)&forUnmarshaling->ppEnabledLayerNames);
+    vkStream->read((uint32_t*)&forUnmarshaling->enabledExtensionCount, sizeof(uint32_t));
+    vkStream->loadStringArrayInPlace((char***)&forUnmarshaling->ppEnabledExtensionNames);
+}
+
+void marshal_VkMemoryHeap(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                          const VkMemoryHeap* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
+    vkStream->write((VkMemoryHeapFlags*)&forMarshaling->flags, sizeof(VkMemoryHeapFlags));
+}
+
+void unmarshal_VkMemoryHeap(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                            VkMemoryHeap* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->size, sizeof(VkDeviceSize));
+    vkStream->read((VkMemoryHeapFlags*)&forUnmarshaling->flags, sizeof(VkMemoryHeapFlags));
+}
+
+void marshal_VkMemoryType(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                          const VkMemoryType* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkMemoryPropertyFlags*)&forMarshaling->propertyFlags,
+                    sizeof(VkMemoryPropertyFlags));
+    vkStream->write((uint32_t*)&forMarshaling->heapIndex, sizeof(uint32_t));
+}
+
+void unmarshal_VkMemoryType(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                            VkMemoryType* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkMemoryPropertyFlags*)&forUnmarshaling->propertyFlags,
+                   sizeof(VkMemoryPropertyFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->heapIndex, sizeof(uint32_t));
+}
+
+void marshal_VkPhysicalDeviceFeatures(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkPhysicalDeviceFeatures* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkBool32*)&forMarshaling->robustBufferAccess, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->fullDrawIndexUint32, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->imageCubeArray, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->independentBlend, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->geometryShader, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->tessellationShader, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->sampleRateShading, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->dualSrcBlend, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->logicOp, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->multiDrawIndirect, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->drawIndirectFirstInstance, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->depthClamp, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->depthBiasClamp, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->fillModeNonSolid, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->depthBounds, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->wideLines, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->largePoints, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->alphaToOne, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->multiViewport, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->samplerAnisotropy, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->textureCompressionETC2, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->textureCompressionASTC_LDR, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->textureCompressionBC, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->occlusionQueryPrecise, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->pipelineStatisticsQuery, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->vertexPipelineStoresAndAtomics, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->fragmentStoresAndAtomics, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderTessellationAndGeometryPointSize,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderImageGatherExtended, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderStorageImageExtendedFormats, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderStorageImageMultisample, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderStorageImageReadWithoutFormat,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderStorageImageWriteWithoutFormat,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderUniformBufferArrayDynamicIndexing,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderSampledImageArrayDynamicIndexing,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderStorageBufferArrayDynamicIndexing,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderStorageImageArrayDynamicIndexing,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderClipDistance, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderCullDistance, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderFloat64, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderInt64, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderInt16, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderResourceResidency, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderResourceMinLod, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->sparseBinding, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->sparseResidencyBuffer, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->sparseResidencyImage2D, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->sparseResidencyImage3D, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->sparseResidency2Samples, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->sparseResidency4Samples, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->sparseResidency8Samples, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->sparseResidency16Samples, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->sparseResidencyAliased, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->variableMultisampleRate, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->inheritedQueries, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceFeatures(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkPhysicalDeviceFeatures* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkBool32*)&forUnmarshaling->robustBufferAccess, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->fullDrawIndexUint32, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->imageCubeArray, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->independentBlend, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->geometryShader, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->tessellationShader, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->sampleRateShading, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->dualSrcBlend, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->logicOp, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->multiDrawIndirect, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->drawIndirectFirstInstance, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->depthClamp, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->depthBiasClamp, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->fillModeNonSolid, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->depthBounds, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->wideLines, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->largePoints, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->alphaToOne, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->multiViewport, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->samplerAnisotropy, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->textureCompressionETC2, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->textureCompressionASTC_LDR, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->textureCompressionBC, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->occlusionQueryPrecise, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->pipelineStatisticsQuery, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->vertexPipelineStoresAndAtomics, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->fragmentStoresAndAtomics, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderTessellationAndGeometryPointSize,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderImageGatherExtended, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderStorageImageExtendedFormats,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderStorageImageMultisample, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderStorageImageReadWithoutFormat,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderStorageImageWriteWithoutFormat,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderUniformBufferArrayDynamicIndexing,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderSampledImageArrayDynamicIndexing,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderStorageBufferArrayDynamicIndexing,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderStorageImageArrayDynamicIndexing,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderClipDistance, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderCullDistance, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderFloat64, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderInt64, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderInt16, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderResourceResidency, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderResourceMinLod, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->sparseBinding, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->sparseResidencyBuffer, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->sparseResidencyImage2D, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->sparseResidencyImage3D, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->sparseResidency2Samples, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->sparseResidency4Samples, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->sparseResidency8Samples, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->sparseResidency16Samples, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->sparseResidencyAliased, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->variableMultisampleRate, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->inheritedQueries, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceLimits(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkPhysicalDeviceLimits* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->maxImageDimension1D, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxImageDimension2D, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxImageDimension3D, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxImageDimensionCube, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxImageArrayLayers, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxTexelBufferElements, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxUniformBufferRange, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxStorageBufferRange, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxPushConstantsSize, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxMemoryAllocationCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxSamplerAllocationCount, sizeof(uint32_t));
+    vkStream->write((VkDeviceSize*)&forMarshaling->bufferImageGranularity, sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->sparseAddressSpaceSize, sizeof(VkDeviceSize));
+    vkStream->write((uint32_t*)&forMarshaling->maxBoundDescriptorSets, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxPerStageDescriptorSamplers, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxPerStageDescriptorUniformBuffers,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxPerStageDescriptorStorageBuffers,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxPerStageDescriptorSampledImages,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxPerStageDescriptorStorageImages,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxPerStageDescriptorInputAttachments,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxPerStageResources, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetSamplers, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetUniformBuffers, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetUniformBuffersDynamic,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetStorageBuffers, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetStorageBuffersDynamic,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetSampledImages, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetStorageImages, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetInputAttachments, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxVertexInputAttributes, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxVertexInputBindings, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxVertexInputAttributeOffset, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxVertexInputBindingStride, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxVertexOutputComponents, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxTessellationGenerationLevel, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxTessellationPatchSize, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxTessellationControlPerVertexInputComponents,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxTessellationControlPerVertexOutputComponents,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxTessellationControlPerPatchOutputComponents,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxTessellationControlTotalOutputComponents,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxTessellationEvaluationInputComponents,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxTessellationEvaluationOutputComponents,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxGeometryShaderInvocations, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxGeometryInputComponents, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxGeometryOutputComponents, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxGeometryOutputVertices, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxGeometryTotalOutputComponents, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxFragmentInputComponents, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxFragmentOutputAttachments, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxFragmentDualSrcAttachments, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxFragmentCombinedOutputResources,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxComputeSharedMemorySize, sizeof(uint32_t));
+    vkStream->write((uint32_t*)forMarshaling->maxComputeWorkGroupCount, 3 * sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxComputeWorkGroupInvocations, sizeof(uint32_t));
+    vkStream->write((uint32_t*)forMarshaling->maxComputeWorkGroupSize, 3 * sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->subPixelPrecisionBits, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->subTexelPrecisionBits, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->mipmapPrecisionBits, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDrawIndexedIndexValue, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDrawIndirectCount, sizeof(uint32_t));
+    vkStream->write((float*)&forMarshaling->maxSamplerLodBias, sizeof(float));
+    vkStream->write((float*)&forMarshaling->maxSamplerAnisotropy, sizeof(float));
+    vkStream->write((uint32_t*)&forMarshaling->maxViewports, sizeof(uint32_t));
+    vkStream->write((uint32_t*)forMarshaling->maxViewportDimensions, 2 * sizeof(uint32_t));
+    vkStream->write((float*)forMarshaling->viewportBoundsRange, 2 * sizeof(float));
+    vkStream->write((uint32_t*)&forMarshaling->viewportSubPixelBits, sizeof(uint32_t));
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->minMemoryMapAlignment;
+    vkStream->putBe64(cgen_var_0);
+    vkStream->write((VkDeviceSize*)&forMarshaling->minTexelBufferOffsetAlignment,
+                    sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->minUniformBufferOffsetAlignment,
+                    sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->minStorageBufferOffsetAlignment,
+                    sizeof(VkDeviceSize));
+    vkStream->write((int32_t*)&forMarshaling->minTexelOffset, sizeof(int32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxTexelOffset, sizeof(uint32_t));
+    vkStream->write((int32_t*)&forMarshaling->minTexelGatherOffset, sizeof(int32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxTexelGatherOffset, sizeof(uint32_t));
+    vkStream->write((float*)&forMarshaling->minInterpolationOffset, sizeof(float));
+    vkStream->write((float*)&forMarshaling->maxInterpolationOffset, sizeof(float));
+    vkStream->write((uint32_t*)&forMarshaling->subPixelInterpolationOffsetBits, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxFramebufferWidth, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxFramebufferHeight, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxFramebufferLayers, sizeof(uint32_t));
+    vkStream->write((VkSampleCountFlags*)&forMarshaling->framebufferColorSampleCounts,
+                    sizeof(VkSampleCountFlags));
+    vkStream->write((VkSampleCountFlags*)&forMarshaling->framebufferDepthSampleCounts,
+                    sizeof(VkSampleCountFlags));
+    vkStream->write((VkSampleCountFlags*)&forMarshaling->framebufferStencilSampleCounts,
+                    sizeof(VkSampleCountFlags));
+    vkStream->write((VkSampleCountFlags*)&forMarshaling->framebufferNoAttachmentsSampleCounts,
+                    sizeof(VkSampleCountFlags));
+    vkStream->write((uint32_t*)&forMarshaling->maxColorAttachments, sizeof(uint32_t));
+    vkStream->write((VkSampleCountFlags*)&forMarshaling->sampledImageColorSampleCounts,
+                    sizeof(VkSampleCountFlags));
+    vkStream->write((VkSampleCountFlags*)&forMarshaling->sampledImageIntegerSampleCounts,
+                    sizeof(VkSampleCountFlags));
+    vkStream->write((VkSampleCountFlags*)&forMarshaling->sampledImageDepthSampleCounts,
+                    sizeof(VkSampleCountFlags));
+    vkStream->write((VkSampleCountFlags*)&forMarshaling->sampledImageStencilSampleCounts,
+                    sizeof(VkSampleCountFlags));
+    vkStream->write((VkSampleCountFlags*)&forMarshaling->storageImageSampleCounts,
+                    sizeof(VkSampleCountFlags));
+    vkStream->write((uint32_t*)&forMarshaling->maxSampleMaskWords, sizeof(uint32_t));
+    vkStream->write((VkBool32*)&forMarshaling->timestampComputeAndGraphics, sizeof(VkBool32));
+    vkStream->write((float*)&forMarshaling->timestampPeriod, sizeof(float));
+    vkStream->write((uint32_t*)&forMarshaling->maxClipDistances, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxCullDistances, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxCombinedClipAndCullDistances, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->discreteQueuePriorities, sizeof(uint32_t));
+    vkStream->write((float*)forMarshaling->pointSizeRange, 2 * sizeof(float));
+    vkStream->write((float*)forMarshaling->lineWidthRange, 2 * sizeof(float));
+    vkStream->write((float*)&forMarshaling->pointSizeGranularity, sizeof(float));
+    vkStream->write((float*)&forMarshaling->lineWidthGranularity, sizeof(float));
+    vkStream->write((VkBool32*)&forMarshaling->strictLines, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->standardSampleLocations, sizeof(VkBool32));
+    vkStream->write((VkDeviceSize*)&forMarshaling->optimalBufferCopyOffsetAlignment,
+                    sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->optimalBufferCopyRowPitchAlignment,
+                    sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->nonCoherentAtomSize, sizeof(VkDeviceSize));
+}
+
+void unmarshal_VkPhysicalDeviceLimits(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      VkPhysicalDeviceLimits* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->maxImageDimension1D, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxImageDimension2D, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxImageDimension3D, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxImageDimensionCube, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxImageArrayLayers, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxTexelBufferElements, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxUniformBufferRange, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxStorageBufferRange, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPushConstantsSize, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxMemoryAllocationCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxSamplerAllocationCount, sizeof(uint32_t));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->bufferImageGranularity, sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->sparseAddressSpaceSize, sizeof(VkDeviceSize));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxBoundDescriptorSets, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPerStageDescriptorSamplers, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPerStageDescriptorUniformBuffers,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPerStageDescriptorStorageBuffers,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPerStageDescriptorSampledImages,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPerStageDescriptorStorageImages,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPerStageDescriptorInputAttachments,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPerStageResources, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetSamplers, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetUniformBuffers, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetUniformBuffersDynamic,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetStorageBuffers, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetStorageBuffersDynamic,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetSampledImages, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetStorageImages, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetInputAttachments, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxVertexInputAttributes, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxVertexInputBindings, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxVertexInputAttributeOffset, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxVertexInputBindingStride, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxVertexOutputComponents, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxTessellationGenerationLevel, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxTessellationPatchSize, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxTessellationControlPerVertexInputComponents,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxTessellationControlPerVertexOutputComponents,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxTessellationControlPerPatchOutputComponents,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxTessellationControlTotalOutputComponents,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxTessellationEvaluationInputComponents,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxTessellationEvaluationOutputComponents,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxGeometryShaderInvocations, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxGeometryInputComponents, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxGeometryOutputComponents, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxGeometryOutputVertices, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxGeometryTotalOutputComponents, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxFragmentInputComponents, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxFragmentOutputAttachments, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxFragmentDualSrcAttachments, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxFragmentCombinedOutputResources,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxComputeSharedMemorySize, sizeof(uint32_t));
+    vkStream->read((uint32_t*)forUnmarshaling->maxComputeWorkGroupCount, 3 * sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxComputeWorkGroupInvocations, sizeof(uint32_t));
+    vkStream->read((uint32_t*)forUnmarshaling->maxComputeWorkGroupSize, 3 * sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->subPixelPrecisionBits, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->subTexelPrecisionBits, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->mipmapPrecisionBits, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxDrawIndexedIndexValue, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxDrawIndirectCount, sizeof(uint32_t));
+    vkStream->read((float*)&forUnmarshaling->maxSamplerLodBias, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->maxSamplerAnisotropy, sizeof(float));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxViewports, sizeof(uint32_t));
+    vkStream->read((uint32_t*)forUnmarshaling->maxViewportDimensions, 2 * sizeof(uint32_t));
+    vkStream->read((float*)forUnmarshaling->viewportBoundsRange, 2 * sizeof(float));
+    vkStream->read((uint32_t*)&forUnmarshaling->viewportSubPixelBits, sizeof(uint32_t));
+    forUnmarshaling->minMemoryMapAlignment = (size_t)vkStream->getBe64();
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->minTexelBufferOffsetAlignment,
+                   sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->minUniformBufferOffsetAlignment,
+                   sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->minStorageBufferOffsetAlignment,
+                   sizeof(VkDeviceSize));
+    vkStream->read((int32_t*)&forUnmarshaling->minTexelOffset, sizeof(int32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxTexelOffset, sizeof(uint32_t));
+    vkStream->read((int32_t*)&forUnmarshaling->minTexelGatherOffset, sizeof(int32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxTexelGatherOffset, sizeof(uint32_t));
+    vkStream->read((float*)&forUnmarshaling->minInterpolationOffset, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->maxInterpolationOffset, sizeof(float));
+    vkStream->read((uint32_t*)&forUnmarshaling->subPixelInterpolationOffsetBits, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxFramebufferWidth, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxFramebufferHeight, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxFramebufferLayers, sizeof(uint32_t));
+    vkStream->read((VkSampleCountFlags*)&forUnmarshaling->framebufferColorSampleCounts,
+                   sizeof(VkSampleCountFlags));
+    vkStream->read((VkSampleCountFlags*)&forUnmarshaling->framebufferDepthSampleCounts,
+                   sizeof(VkSampleCountFlags));
+    vkStream->read((VkSampleCountFlags*)&forUnmarshaling->framebufferStencilSampleCounts,
+                   sizeof(VkSampleCountFlags));
+    vkStream->read((VkSampleCountFlags*)&forUnmarshaling->framebufferNoAttachmentsSampleCounts,
+                   sizeof(VkSampleCountFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxColorAttachments, sizeof(uint32_t));
+    vkStream->read((VkSampleCountFlags*)&forUnmarshaling->sampledImageColorSampleCounts,
+                   sizeof(VkSampleCountFlags));
+    vkStream->read((VkSampleCountFlags*)&forUnmarshaling->sampledImageIntegerSampleCounts,
+                   sizeof(VkSampleCountFlags));
+    vkStream->read((VkSampleCountFlags*)&forUnmarshaling->sampledImageDepthSampleCounts,
+                   sizeof(VkSampleCountFlags));
+    vkStream->read((VkSampleCountFlags*)&forUnmarshaling->sampledImageStencilSampleCounts,
+                   sizeof(VkSampleCountFlags));
+    vkStream->read((VkSampleCountFlags*)&forUnmarshaling->storageImageSampleCounts,
+                   sizeof(VkSampleCountFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxSampleMaskWords, sizeof(uint32_t));
+    vkStream->read((VkBool32*)&forUnmarshaling->timestampComputeAndGraphics, sizeof(VkBool32));
+    vkStream->read((float*)&forUnmarshaling->timestampPeriod, sizeof(float));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxClipDistances, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxCullDistances, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxCombinedClipAndCullDistances, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->discreteQueuePriorities, sizeof(uint32_t));
+    vkStream->read((float*)forUnmarshaling->pointSizeRange, 2 * sizeof(float));
+    vkStream->read((float*)forUnmarshaling->lineWidthRange, 2 * sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->pointSizeGranularity, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->lineWidthGranularity, sizeof(float));
+    vkStream->read((VkBool32*)&forUnmarshaling->strictLines, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->standardSampleLocations, sizeof(VkBool32));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->optimalBufferCopyOffsetAlignment,
+                   sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->optimalBufferCopyRowPitchAlignment,
+                   sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->nonCoherentAtomSize, sizeof(VkDeviceSize));
+}
+
+void marshal_VkPhysicalDeviceMemoryProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMemoryProperties* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->memoryTypeCount, sizeof(uint32_t));
+    for (uint32_t i = 0; i < (uint32_t)VK_MAX_MEMORY_TYPES; ++i) {
+        marshal_VkMemoryType(vkStream, rootType, (VkMemoryType*)(forMarshaling->memoryTypes + i));
+    }
+    vkStream->write((uint32_t*)&forMarshaling->memoryHeapCount, sizeof(uint32_t));
+    for (uint32_t i = 0; i < (uint32_t)VK_MAX_MEMORY_HEAPS; ++i) {
+        marshal_VkMemoryHeap(vkStream, rootType, (VkMemoryHeap*)(forMarshaling->memoryHeaps + i));
+    }
+}
+
+void unmarshal_VkPhysicalDeviceMemoryProperties(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkPhysicalDeviceMemoryProperties* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->memoryTypeCount, sizeof(uint32_t));
+    for (uint32_t i = 0; i < (uint32_t)VK_MAX_MEMORY_TYPES; ++i) {
+        unmarshal_VkMemoryType(vkStream, rootType,
+                               (VkMemoryType*)(forUnmarshaling->memoryTypes + i));
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->memoryHeapCount, sizeof(uint32_t));
+    for (uint32_t i = 0; i < (uint32_t)VK_MAX_MEMORY_HEAPS; ++i) {
+        unmarshal_VkMemoryHeap(vkStream, rootType,
+                               (VkMemoryHeap*)(forUnmarshaling->memoryHeaps + i));
+    }
+}
+
+void marshal_VkPhysicalDeviceSparseProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSparseProperties* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkBool32*)&forMarshaling->residencyStandard2DBlockShape, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->residencyStandard2DMultisampleBlockShape,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->residencyStandard3DBlockShape, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->residencyAlignedMipSize, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->residencyNonResidentStrict, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceSparseProperties(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkPhysicalDeviceSparseProperties* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkBool32*)&forUnmarshaling->residencyStandard2DBlockShape, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->residencyStandard2DMultisampleBlockShape,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->residencyStandard3DBlockShape, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->residencyAlignedMipSize, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->residencyNonResidentStrict, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkPhysicalDeviceProperties* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->apiVersion, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->driverVersion, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->vendorID, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->deviceID, sizeof(uint32_t));
+    vkStream->write((VkPhysicalDeviceType*)&forMarshaling->deviceType,
+                    sizeof(VkPhysicalDeviceType));
+    vkStream->write((char*)forMarshaling->deviceName,
+                    VK_MAX_PHYSICAL_DEVICE_NAME_SIZE * sizeof(char));
+    vkStream->write((uint8_t*)forMarshaling->pipelineCacheUUID, VK_UUID_SIZE * sizeof(uint8_t));
+    marshal_VkPhysicalDeviceLimits(vkStream, rootType,
+                                   (VkPhysicalDeviceLimits*)(&forMarshaling->limits));
+    marshal_VkPhysicalDeviceSparseProperties(
+        vkStream, rootType, (VkPhysicalDeviceSparseProperties*)(&forMarshaling->sparseProperties));
+}
+
+void unmarshal_VkPhysicalDeviceProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkPhysicalDeviceProperties* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->apiVersion, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->driverVersion, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->vendorID, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->deviceID, sizeof(uint32_t));
+    vkStream->read((VkPhysicalDeviceType*)&forUnmarshaling->deviceType,
+                   sizeof(VkPhysicalDeviceType));
+    vkStream->read((char*)forUnmarshaling->deviceName,
+                   VK_MAX_PHYSICAL_DEVICE_NAME_SIZE * sizeof(char));
+    vkStream->read((uint8_t*)forUnmarshaling->pipelineCacheUUID, VK_UUID_SIZE * sizeof(uint8_t));
+    unmarshal_VkPhysicalDeviceLimits(vkStream, rootType,
+                                     (VkPhysicalDeviceLimits*)(&forUnmarshaling->limits));
+    unmarshal_VkPhysicalDeviceSparseProperties(
+        vkStream, rootType,
+        (VkPhysicalDeviceSparseProperties*)(&forUnmarshaling->sparseProperties));
+}
+
+void marshal_VkQueueFamilyProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkQueueFamilyProperties* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkQueueFlags*)&forMarshaling->queueFlags, sizeof(VkQueueFlags));
+    vkStream->write((uint32_t*)&forMarshaling->queueCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->timestampValidBits, sizeof(uint32_t));
+    marshal_VkExtent3D(vkStream, rootType,
+                       (VkExtent3D*)(&forMarshaling->minImageTransferGranularity));
+}
+
+void unmarshal_VkQueueFamilyProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkQueueFamilyProperties* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkQueueFlags*)&forUnmarshaling->queueFlags, sizeof(VkQueueFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->queueCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->timestampValidBits, sizeof(uint32_t));
+    unmarshal_VkExtent3D(vkStream, rootType,
+                         (VkExtent3D*)(&forUnmarshaling->minImageTransferGranularity));
+}
+
+void marshal_VkDeviceQueueCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkDeviceQueueCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDeviceQueueCreateFlags*)&forMarshaling->flags,
+                    sizeof(VkDeviceQueueCreateFlags));
+    vkStream->write((uint32_t*)&forMarshaling->queueFamilyIndex, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->queueCount, sizeof(uint32_t));
+    vkStream->write((const float*)forMarshaling->pQueuePriorities,
+                    forMarshaling->queueCount * sizeof(const float));
+}
+
+void unmarshal_VkDeviceQueueCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkDeviceQueueCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDeviceQueueCreateFlags*)&forUnmarshaling->flags,
+                   sizeof(VkDeviceQueueCreateFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->queueFamilyIndex, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->queueCount, sizeof(uint32_t));
+    vkStream->read((float*)forUnmarshaling->pQueuePriorities,
+                   forUnmarshaling->queueCount * sizeof(const float));
+}
+
+void marshal_VkDeviceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkDeviceCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDeviceCreateFlags*)&forMarshaling->flags, sizeof(VkDeviceCreateFlags));
+    vkStream->write((uint32_t*)&forMarshaling->queueCreateInfoCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->queueCreateInfoCount; ++i) {
+            marshal_VkDeviceQueueCreateInfo(
+                vkStream, rootType,
+                (const VkDeviceQueueCreateInfo*)(forMarshaling->pQueueCreateInfos + i));
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->enabledLayerCount, sizeof(uint32_t));
+    saveStringArray(vkStream, forMarshaling->ppEnabledLayerNames, forMarshaling->enabledLayerCount);
+    vkStream->write((uint32_t*)&forMarshaling->enabledExtensionCount, sizeof(uint32_t));
+    saveStringArray(vkStream, forMarshaling->ppEnabledExtensionNames,
+                    forMarshaling->enabledExtensionCount);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pEnabledFeatures;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pEnabledFeatures) {
+        marshal_VkPhysicalDeviceFeatures(
+            vkStream, rootType, (const VkPhysicalDeviceFeatures*)(forMarshaling->pEnabledFeatures));
+    }
+}
+
+void unmarshal_VkDeviceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkDeviceCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDeviceCreateFlags*)&forUnmarshaling->flags, sizeof(VkDeviceCreateFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->queueCreateInfoCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->queueCreateInfoCount; ++i) {
+            unmarshal_VkDeviceQueueCreateInfo(
+                vkStream, rootType,
+                (VkDeviceQueueCreateInfo*)(forUnmarshaling->pQueueCreateInfos + i));
+        }
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->enabledLayerCount, sizeof(uint32_t));
+    vkStream->loadStringArrayInPlace((char***)&forUnmarshaling->ppEnabledLayerNames);
+    vkStream->read((uint32_t*)&forUnmarshaling->enabledExtensionCount, sizeof(uint32_t));
+    vkStream->loadStringArrayInPlace((char***)&forUnmarshaling->ppEnabledExtensionNames);
+    // WARNING PTR CHECK
+    const VkPhysicalDeviceFeatures* check_pEnabledFeatures;
+    check_pEnabledFeatures = (const VkPhysicalDeviceFeatures*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pEnabledFeatures) {
+        if (!(check_pEnabledFeatures)) {
+            fprintf(
+                stderr,
+                "fatal: forUnmarshaling->pEnabledFeatures inconsistent between guest and host\n");
+        }
+        unmarshal_VkPhysicalDeviceFeatures(
+            vkStream, rootType, (VkPhysicalDeviceFeatures*)(forUnmarshaling->pEnabledFeatures));
+    }
+}
+
+void marshal_VkExtensionProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkExtensionProperties* forMarshaling) {
+    (void)rootType;
+    vkStream->write((char*)forMarshaling->extensionName, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
+    vkStream->write((uint32_t*)&forMarshaling->specVersion, sizeof(uint32_t));
+}
+
+void unmarshal_VkExtensionProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkExtensionProperties* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((char*)forUnmarshaling->extensionName,
+                   VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
+    vkStream->read((uint32_t*)&forUnmarshaling->specVersion, sizeof(uint32_t));
+}
+
+void marshal_VkLayerProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               const VkLayerProperties* forMarshaling) {
+    (void)rootType;
+    vkStream->write((char*)forMarshaling->layerName, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
+    vkStream->write((uint32_t*)&forMarshaling->specVersion, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->implementationVersion, sizeof(uint32_t));
+    vkStream->write((char*)forMarshaling->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+}
+
+void unmarshal_VkLayerProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 VkLayerProperties* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((char*)forUnmarshaling->layerName, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
+    vkStream->read((uint32_t*)&forUnmarshaling->specVersion, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->implementationVersion, sizeof(uint32_t));
+    vkStream->read((char*)forUnmarshaling->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+}
+
+void marshal_VkSubmitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                          const VkSubmitInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->waitSemaphoreCount, sizeof(uint32_t));
+    if (forMarshaling->waitSemaphoreCount) {
+        uint64_t* cgen_var_0;
+        vkStream->alloc((void**)&cgen_var_0, forMarshaling->waitSemaphoreCount * 8);
+        vkStream->handleMapping()->mapHandles_VkSemaphore_u64(
+            forMarshaling->pWaitSemaphores, cgen_var_0, forMarshaling->waitSemaphoreCount);
+        vkStream->write((uint64_t*)cgen_var_0, forMarshaling->waitSemaphoreCount * 8);
+    }
+    vkStream->write((const VkPipelineStageFlags*)forMarshaling->pWaitDstStageMask,
+                    forMarshaling->waitSemaphoreCount * sizeof(const VkPipelineStageFlags));
+    vkStream->write((uint32_t*)&forMarshaling->commandBufferCount, sizeof(uint32_t));
+    if (forMarshaling->commandBufferCount) {
+        uint64_t* cgen_var_1;
+        vkStream->alloc((void**)&cgen_var_1, forMarshaling->commandBufferCount * 8);
+        vkStream->handleMapping()->mapHandles_VkCommandBuffer_u64(
+            forMarshaling->pCommandBuffers, cgen_var_1, forMarshaling->commandBufferCount);
+        vkStream->write((uint64_t*)cgen_var_1, forMarshaling->commandBufferCount * 8);
+    }
+    vkStream->write((uint32_t*)&forMarshaling->signalSemaphoreCount, sizeof(uint32_t));
+    if (forMarshaling->signalSemaphoreCount) {
+        uint64_t* cgen_var_2;
+        vkStream->alloc((void**)&cgen_var_2, forMarshaling->signalSemaphoreCount * 8);
+        vkStream->handleMapping()->mapHandles_VkSemaphore_u64(
+            forMarshaling->pSignalSemaphores, cgen_var_2, forMarshaling->signalSemaphoreCount);
+        vkStream->write((uint64_t*)cgen_var_2, forMarshaling->signalSemaphoreCount * 8);
+    }
+}
+
+void unmarshal_VkSubmitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                            VkSubmitInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->waitSemaphoreCount, sizeof(uint32_t));
+    if (forUnmarshaling->waitSemaphoreCount) {
+        uint64_t* cgen_var_0;
+        vkStream->alloc((void**)&cgen_var_0, forUnmarshaling->waitSemaphoreCount * 8);
+        vkStream->read((uint64_t*)cgen_var_0, forUnmarshaling->waitSemaphoreCount * 8);
+        vkStream->handleMapping()->mapHandles_u64_VkSemaphore(
+            cgen_var_0, (VkSemaphore*)forUnmarshaling->pWaitSemaphores,
+            forUnmarshaling->waitSemaphoreCount);
+    }
+    vkStream->read((VkPipelineStageFlags*)forUnmarshaling->pWaitDstStageMask,
+                   forUnmarshaling->waitSemaphoreCount * sizeof(const VkPipelineStageFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->commandBufferCount, sizeof(uint32_t));
+    if (forUnmarshaling->commandBufferCount) {
+        uint64_t* cgen_var_1;
+        vkStream->alloc((void**)&cgen_var_1, forUnmarshaling->commandBufferCount * 8);
+        vkStream->read((uint64_t*)cgen_var_1, forUnmarshaling->commandBufferCount * 8);
+        vkStream->handleMapping()->mapHandles_u64_VkCommandBuffer(
+            cgen_var_1, (VkCommandBuffer*)forUnmarshaling->pCommandBuffers,
+            forUnmarshaling->commandBufferCount);
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->signalSemaphoreCount, sizeof(uint32_t));
+    if (forUnmarshaling->signalSemaphoreCount) {
+        uint64_t* cgen_var_2;
+        vkStream->alloc((void**)&cgen_var_2, forUnmarshaling->signalSemaphoreCount * 8);
+        vkStream->read((uint64_t*)cgen_var_2, forUnmarshaling->signalSemaphoreCount * 8);
+        vkStream->handleMapping()->mapHandles_u64_VkSemaphore(
+            cgen_var_2, (VkSemaphore*)forUnmarshaling->pSignalSemaphores,
+            forUnmarshaling->signalSemaphoreCount);
+    }
+}
+
+void marshal_VkMappedMemoryRange(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkMappedMemoryRange* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&forMarshaling->memory, &cgen_var_0,
+                                                             1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkDeviceSize*)&forMarshaling->offset, sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
+}
+
+void unmarshal_VkMappedMemoryRange(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkMappedMemoryRange* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkDeviceMemory(
+        &cgen_var_0, (VkDeviceMemory*)&forUnmarshaling->memory, 1);
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->offset, sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->size, sizeof(VkDeviceSize));
+}
+
+void marshal_VkMemoryAllocateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkMemoryAllocateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDeviceSize*)&forMarshaling->allocationSize, sizeof(VkDeviceSize));
+    vkStream->write((uint32_t*)&forMarshaling->memoryTypeIndex, sizeof(uint32_t));
+}
+
+void unmarshal_VkMemoryAllocateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkMemoryAllocateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->allocationSize, sizeof(VkDeviceSize));
+    vkStream->read((uint32_t*)&forUnmarshaling->memoryTypeIndex, sizeof(uint32_t));
+}
+
+void marshal_VkMemoryRequirements(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkMemoryRequirements* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->alignment, sizeof(VkDeviceSize));
+    vkStream->write((uint32_t*)&forMarshaling->memoryTypeBits, sizeof(uint32_t));
+}
+
+void unmarshal_VkMemoryRequirements(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkMemoryRequirements* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->size, sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->alignment, sizeof(VkDeviceSize));
+    vkStream->read((uint32_t*)&forUnmarshaling->memoryTypeBits, sizeof(uint32_t));
+}
+
+void marshal_VkSparseMemoryBind(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkSparseMemoryBind* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkDeviceSize*)&forMarshaling->resourceOffset, sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&forMarshaling->memory, &cgen_var_0,
+                                                             1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkDeviceSize*)&forMarshaling->memoryOffset, sizeof(VkDeviceSize));
+    vkStream->write((VkSparseMemoryBindFlags*)&forMarshaling->flags,
+                    sizeof(VkSparseMemoryBindFlags));
+}
+
+void unmarshal_VkSparseMemoryBind(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkSparseMemoryBind* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->resourceOffset, sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->size, sizeof(VkDeviceSize));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkDeviceMemory(
+        &cgen_var_0, (VkDeviceMemory*)&forUnmarshaling->memory, 1);
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->memoryOffset, sizeof(VkDeviceSize));
+    vkStream->read((VkSparseMemoryBindFlags*)&forUnmarshaling->flags,
+                   sizeof(VkSparseMemoryBindFlags));
+}
+
+void marshal_VkSparseBufferMemoryBindInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkSparseBufferMemoryBindInfo* forMarshaling) {
+    (void)rootType;
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkBuffer_u64(&forMarshaling->buffer, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((uint32_t*)&forMarshaling->bindCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->bindCount; ++i) {
+            marshal_VkSparseMemoryBind(vkStream, rootType,
+                                       (const VkSparseMemoryBind*)(forMarshaling->pBinds + i));
+        }
+    }
+}
+
+void unmarshal_VkSparseBufferMemoryBindInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkSparseBufferMemoryBindInfo* forUnmarshaling) {
+    (void)rootType;
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_0,
+                                                       (VkBuffer*)&forUnmarshaling->buffer, 1);
+    vkStream->read((uint32_t*)&forUnmarshaling->bindCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->bindCount; ++i) {
+            unmarshal_VkSparseMemoryBind(vkStream, rootType,
+                                         (VkSparseMemoryBind*)(forUnmarshaling->pBinds + i));
+        }
+    }
+}
+
+void marshal_VkSparseImageOpaqueMemoryBindInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSparseImageOpaqueMemoryBindInfo* forMarshaling) {
+    (void)rootType;
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkImage_u64(&forMarshaling->image, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((uint32_t*)&forMarshaling->bindCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->bindCount; ++i) {
+            marshal_VkSparseMemoryBind(vkStream, rootType,
+                                       (const VkSparseMemoryBind*)(forMarshaling->pBinds + i));
+        }
+    }
+}
+
+void unmarshal_VkSparseImageOpaqueMemoryBindInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkSparseImageOpaqueMemoryBindInfo* forUnmarshaling) {
+    (void)rootType;
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_0,
+                                                      (VkImage*)&forUnmarshaling->image, 1);
+    vkStream->read((uint32_t*)&forUnmarshaling->bindCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->bindCount; ++i) {
+            unmarshal_VkSparseMemoryBind(vkStream, rootType,
+                                         (VkSparseMemoryBind*)(forUnmarshaling->pBinds + i));
+        }
+    }
+}
+
+void marshal_VkImageSubresource(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkImageSubresource* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkImageAspectFlags*)&forMarshaling->aspectMask, sizeof(VkImageAspectFlags));
+    vkStream->write((uint32_t*)&forMarshaling->mipLevel, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->arrayLayer, sizeof(uint32_t));
+}
+
+void unmarshal_VkImageSubresource(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkImageSubresource* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkImageAspectFlags*)&forUnmarshaling->aspectMask, sizeof(VkImageAspectFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->mipLevel, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->arrayLayer, sizeof(uint32_t));
+}
+
+void marshal_VkSparseImageMemoryBind(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkSparseImageMemoryBind* forMarshaling) {
+    (void)rootType;
+    marshal_VkImageSubresource(vkStream, rootType,
+                               (VkImageSubresource*)(&forMarshaling->subresource));
+    marshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forMarshaling->offset));
+    marshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forMarshaling->extent));
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&forMarshaling->memory, &cgen_var_0,
+                                                             1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkDeviceSize*)&forMarshaling->memoryOffset, sizeof(VkDeviceSize));
+    vkStream->write((VkSparseMemoryBindFlags*)&forMarshaling->flags,
+                    sizeof(VkSparseMemoryBindFlags));
+}
+
+void unmarshal_VkSparseImageMemoryBind(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkSparseImageMemoryBind* forUnmarshaling) {
+    (void)rootType;
+    unmarshal_VkImageSubresource(vkStream, rootType,
+                                 (VkImageSubresource*)(&forUnmarshaling->subresource));
+    unmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forUnmarshaling->offset));
+    unmarshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forUnmarshaling->extent));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkDeviceMemory(
+        &cgen_var_0, (VkDeviceMemory*)&forUnmarshaling->memory, 1);
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->memoryOffset, sizeof(VkDeviceSize));
+    vkStream->read((VkSparseMemoryBindFlags*)&forUnmarshaling->flags,
+                   sizeof(VkSparseMemoryBindFlags));
+}
+
+void marshal_VkSparseImageMemoryBindInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkSparseImageMemoryBindInfo* forMarshaling) {
+    (void)rootType;
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkImage_u64(&forMarshaling->image, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((uint32_t*)&forMarshaling->bindCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->bindCount; ++i) {
+            marshal_VkSparseImageMemoryBind(
+                vkStream, rootType, (const VkSparseImageMemoryBind*)(forMarshaling->pBinds + i));
+        }
+    }
+}
+
+void unmarshal_VkSparseImageMemoryBindInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkSparseImageMemoryBindInfo* forUnmarshaling) {
+    (void)rootType;
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_0,
+                                                      (VkImage*)&forUnmarshaling->image, 1);
+    vkStream->read((uint32_t*)&forUnmarshaling->bindCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->bindCount; ++i) {
+            unmarshal_VkSparseImageMemoryBind(
+                vkStream, rootType, (VkSparseImageMemoryBind*)(forUnmarshaling->pBinds + i));
+        }
+    }
+}
+
+void marshal_VkBindSparseInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                              const VkBindSparseInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->waitSemaphoreCount, sizeof(uint32_t));
+    if (forMarshaling->waitSemaphoreCount) {
+        uint64_t* cgen_var_0;
+        vkStream->alloc((void**)&cgen_var_0, forMarshaling->waitSemaphoreCount * 8);
+        vkStream->handleMapping()->mapHandles_VkSemaphore_u64(
+            forMarshaling->pWaitSemaphores, cgen_var_0, forMarshaling->waitSemaphoreCount);
+        vkStream->write((uint64_t*)cgen_var_0, forMarshaling->waitSemaphoreCount * 8);
+    }
+    vkStream->write((uint32_t*)&forMarshaling->bufferBindCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->bufferBindCount; ++i) {
+            marshal_VkSparseBufferMemoryBindInfo(
+                vkStream, rootType,
+                (const VkSparseBufferMemoryBindInfo*)(forMarshaling->pBufferBinds + i));
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->imageOpaqueBindCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->imageOpaqueBindCount; ++i) {
+            marshal_VkSparseImageOpaqueMemoryBindInfo(
+                vkStream, rootType,
+                (const VkSparseImageOpaqueMemoryBindInfo*)(forMarshaling->pImageOpaqueBinds + i));
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->imageBindCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->imageBindCount; ++i) {
+            marshal_VkSparseImageMemoryBindInfo(
+                vkStream, rootType,
+                (const VkSparseImageMemoryBindInfo*)(forMarshaling->pImageBinds + i));
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->signalSemaphoreCount, sizeof(uint32_t));
+    if (forMarshaling->signalSemaphoreCount) {
+        uint64_t* cgen_var_1;
+        vkStream->alloc((void**)&cgen_var_1, forMarshaling->signalSemaphoreCount * 8);
+        vkStream->handleMapping()->mapHandles_VkSemaphore_u64(
+            forMarshaling->pSignalSemaphores, cgen_var_1, forMarshaling->signalSemaphoreCount);
+        vkStream->write((uint64_t*)cgen_var_1, forMarshaling->signalSemaphoreCount * 8);
+    }
+}
+
+void unmarshal_VkBindSparseInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                VkBindSparseInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->waitSemaphoreCount, sizeof(uint32_t));
+    if (forUnmarshaling->waitSemaphoreCount) {
+        uint64_t* cgen_var_0;
+        vkStream->alloc((void**)&cgen_var_0, forUnmarshaling->waitSemaphoreCount * 8);
+        vkStream->read((uint64_t*)cgen_var_0, forUnmarshaling->waitSemaphoreCount * 8);
+        vkStream->handleMapping()->mapHandles_u64_VkSemaphore(
+            cgen_var_0, (VkSemaphore*)forUnmarshaling->pWaitSemaphores,
+            forUnmarshaling->waitSemaphoreCount);
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->bufferBindCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->bufferBindCount; ++i) {
+            unmarshal_VkSparseBufferMemoryBindInfo(
+                vkStream, rootType,
+                (VkSparseBufferMemoryBindInfo*)(forUnmarshaling->pBufferBinds + i));
+        }
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->imageOpaqueBindCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->imageOpaqueBindCount; ++i) {
+            unmarshal_VkSparseImageOpaqueMemoryBindInfo(
+                vkStream, rootType,
+                (VkSparseImageOpaqueMemoryBindInfo*)(forUnmarshaling->pImageOpaqueBinds + i));
+        }
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->imageBindCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->imageBindCount; ++i) {
+            unmarshal_VkSparseImageMemoryBindInfo(
+                vkStream, rootType,
+                (VkSparseImageMemoryBindInfo*)(forUnmarshaling->pImageBinds + i));
+        }
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->signalSemaphoreCount, sizeof(uint32_t));
+    if (forUnmarshaling->signalSemaphoreCount) {
+        uint64_t* cgen_var_1;
+        vkStream->alloc((void**)&cgen_var_1, forUnmarshaling->signalSemaphoreCount * 8);
+        vkStream->read((uint64_t*)cgen_var_1, forUnmarshaling->signalSemaphoreCount * 8);
+        vkStream->handleMapping()->mapHandles_u64_VkSemaphore(
+            cgen_var_1, (VkSemaphore*)forUnmarshaling->pSignalSemaphores,
+            forUnmarshaling->signalSemaphoreCount);
+    }
+}
+
+void marshal_VkSparseImageFormatProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkSparseImageFormatProperties* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkImageAspectFlags*)&forMarshaling->aspectMask, sizeof(VkImageAspectFlags));
+    marshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forMarshaling->imageGranularity));
+    vkStream->write((VkSparseImageFormatFlags*)&forMarshaling->flags,
+                    sizeof(VkSparseImageFormatFlags));
+}
+
+void unmarshal_VkSparseImageFormatProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkSparseImageFormatProperties* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkImageAspectFlags*)&forUnmarshaling->aspectMask, sizeof(VkImageAspectFlags));
+    unmarshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forUnmarshaling->imageGranularity));
+    vkStream->read((VkSparseImageFormatFlags*)&forUnmarshaling->flags,
+                   sizeof(VkSparseImageFormatFlags));
+}
+
+void marshal_VkSparseImageMemoryRequirements(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkSparseImageMemoryRequirements* forMarshaling) {
+    (void)rootType;
+    marshal_VkSparseImageFormatProperties(
+        vkStream, rootType, (VkSparseImageFormatProperties*)(&forMarshaling->formatProperties));
+    vkStream->write((uint32_t*)&forMarshaling->imageMipTailFirstLod, sizeof(uint32_t));
+    vkStream->write((VkDeviceSize*)&forMarshaling->imageMipTailSize, sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->imageMipTailOffset, sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->imageMipTailStride, sizeof(VkDeviceSize));
+}
+
+void unmarshal_VkSparseImageMemoryRequirements(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkSparseImageMemoryRequirements* forUnmarshaling) {
+    (void)rootType;
+    unmarshal_VkSparseImageFormatProperties(
+        vkStream, rootType, (VkSparseImageFormatProperties*)(&forUnmarshaling->formatProperties));
+    vkStream->read((uint32_t*)&forUnmarshaling->imageMipTailFirstLod, sizeof(uint32_t));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->imageMipTailSize, sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->imageMipTailOffset, sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->imageMipTailStride, sizeof(VkDeviceSize));
+}
+
+void marshal_VkFenceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               const VkFenceCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkFenceCreateFlags*)&forMarshaling->flags, sizeof(VkFenceCreateFlags));
+}
+
+void unmarshal_VkFenceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 VkFenceCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkFenceCreateFlags*)&forUnmarshaling->flags, sizeof(VkFenceCreateFlags));
+}
+
+void marshal_VkSemaphoreCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkSemaphoreCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkSemaphoreCreateFlags*)&forMarshaling->flags, sizeof(VkSemaphoreCreateFlags));
+}
+
+void unmarshal_VkSemaphoreCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkSemaphoreCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkSemaphoreCreateFlags*)&forUnmarshaling->flags,
+                   sizeof(VkSemaphoreCreateFlags));
+}
+
+void marshal_VkEventCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               const VkEventCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkEventCreateFlags*)&forMarshaling->flags, sizeof(VkEventCreateFlags));
+}
+
+void unmarshal_VkEventCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 VkEventCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkEventCreateFlags*)&forUnmarshaling->flags, sizeof(VkEventCreateFlags));
+}
+
+void marshal_VkQueryPoolCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkQueryPoolCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkQueryPoolCreateFlags*)&forMarshaling->flags, sizeof(VkQueryPoolCreateFlags));
+    vkStream->write((VkQueryType*)&forMarshaling->queryType, sizeof(VkQueryType));
+    vkStream->write((uint32_t*)&forMarshaling->queryCount, sizeof(uint32_t));
+    vkStream->write((VkQueryPipelineStatisticFlags*)&forMarshaling->pipelineStatistics,
+                    sizeof(VkQueryPipelineStatisticFlags));
+}
+
+void unmarshal_VkQueryPoolCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkQueryPoolCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkQueryPoolCreateFlags*)&forUnmarshaling->flags,
+                   sizeof(VkQueryPoolCreateFlags));
+    vkStream->read((VkQueryType*)&forUnmarshaling->queryType, sizeof(VkQueryType));
+    vkStream->read((uint32_t*)&forUnmarshaling->queryCount, sizeof(uint32_t));
+    vkStream->read((VkQueryPipelineStatisticFlags*)&forUnmarshaling->pipelineStatistics,
+                   sizeof(VkQueryPipelineStatisticFlags));
+}
+
+void marshal_VkBufferCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkBufferCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBufferCreateFlags*)&forMarshaling->flags, sizeof(VkBufferCreateFlags));
+    vkStream->write((VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
+    vkStream->write((VkBufferUsageFlags*)&forMarshaling->usage, sizeof(VkBufferUsageFlags));
+    vkStream->write((VkSharingMode*)&forMarshaling->sharingMode, sizeof(VkSharingMode));
+    vkStream->write((uint32_t*)&forMarshaling->queueFamilyIndexCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pQueueFamilyIndices;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pQueueFamilyIndices) {
+        vkStream->write((const uint32_t*)forMarshaling->pQueueFamilyIndices,
+                        forMarshaling->queueFamilyIndexCount * sizeof(const uint32_t));
+    }
+}
+
+void unmarshal_VkBufferCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkBufferCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBufferCreateFlags*)&forUnmarshaling->flags, sizeof(VkBufferCreateFlags));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->size, sizeof(VkDeviceSize));
+    vkStream->read((VkBufferUsageFlags*)&forUnmarshaling->usage, sizeof(VkBufferUsageFlags));
+    vkStream->read((VkSharingMode*)&forUnmarshaling->sharingMode, sizeof(VkSharingMode));
+    vkStream->read((uint32_t*)&forUnmarshaling->queueFamilyIndexCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const uint32_t* check_pQueueFamilyIndices;
+    check_pQueueFamilyIndices = (const uint32_t*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pQueueFamilyIndices) {
+        if (!(check_pQueueFamilyIndices)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pQueueFamilyIndices inconsistent between guest and "
+                    "host\n");
+        }
+        vkStream->read((uint32_t*)forUnmarshaling->pQueueFamilyIndices,
+                       forUnmarshaling->queueFamilyIndexCount * sizeof(const uint32_t));
+    }
+}
+
+void marshal_VkBufferViewCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkBufferViewCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBufferViewCreateFlags*)&forMarshaling->flags,
+                    sizeof(VkBufferViewCreateFlags));
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkBuffer_u64(&forMarshaling->buffer, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+    vkStream->write((VkDeviceSize*)&forMarshaling->offset, sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->range, sizeof(VkDeviceSize));
+}
+
+void unmarshal_VkBufferViewCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      VkBufferViewCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBufferViewCreateFlags*)&forUnmarshaling->flags,
+                   sizeof(VkBufferViewCreateFlags));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_0,
+                                                       (VkBuffer*)&forUnmarshaling->buffer, 1);
+    vkStream->read((VkFormat*)&forUnmarshaling->format, sizeof(VkFormat));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->offset, sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->range, sizeof(VkDeviceSize));
+}
+
+void marshal_VkImageCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               const VkImageCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkImageCreateFlags*)&forMarshaling->flags, sizeof(VkImageCreateFlags));
+    vkStream->write((VkImageType*)&forMarshaling->imageType, sizeof(VkImageType));
+    vkStream->write((VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+    marshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forMarshaling->extent));
+    vkStream->write((uint32_t*)&forMarshaling->mipLevels, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->arrayLayers, sizeof(uint32_t));
+    vkStream->write((VkSampleCountFlagBits*)&forMarshaling->samples, sizeof(VkSampleCountFlagBits));
+    vkStream->write((VkImageTiling*)&forMarshaling->tiling, sizeof(VkImageTiling));
+    vkStream->write((VkImageUsageFlags*)&forMarshaling->usage, sizeof(VkImageUsageFlags));
+    vkStream->write((VkSharingMode*)&forMarshaling->sharingMode, sizeof(VkSharingMode));
+    vkStream->write((uint32_t*)&forMarshaling->queueFamilyIndexCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pQueueFamilyIndices;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pQueueFamilyIndices) {
+        vkStream->write((const uint32_t*)forMarshaling->pQueueFamilyIndices,
+                        forMarshaling->queueFamilyIndexCount * sizeof(const uint32_t));
+    }
+    vkStream->write((VkImageLayout*)&forMarshaling->initialLayout, sizeof(VkImageLayout));
+}
+
+void unmarshal_VkImageCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 VkImageCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkImageCreateFlags*)&forUnmarshaling->flags, sizeof(VkImageCreateFlags));
+    vkStream->read((VkImageType*)&forUnmarshaling->imageType, sizeof(VkImageType));
+    vkStream->read((VkFormat*)&forUnmarshaling->format, sizeof(VkFormat));
+    unmarshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forUnmarshaling->extent));
+    vkStream->read((uint32_t*)&forUnmarshaling->mipLevels, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->arrayLayers, sizeof(uint32_t));
+    vkStream->read((VkSampleCountFlagBits*)&forUnmarshaling->samples,
+                   sizeof(VkSampleCountFlagBits));
+    vkStream->read((VkImageTiling*)&forUnmarshaling->tiling, sizeof(VkImageTiling));
+    vkStream->read((VkImageUsageFlags*)&forUnmarshaling->usage, sizeof(VkImageUsageFlags));
+    vkStream->read((VkSharingMode*)&forUnmarshaling->sharingMode, sizeof(VkSharingMode));
+    vkStream->read((uint32_t*)&forUnmarshaling->queueFamilyIndexCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const uint32_t* check_pQueueFamilyIndices;
+    check_pQueueFamilyIndices = (const uint32_t*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pQueueFamilyIndices) {
+        if (!(check_pQueueFamilyIndices)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pQueueFamilyIndices inconsistent between guest and "
+                    "host\n");
+        }
+        vkStream->read((uint32_t*)forUnmarshaling->pQueueFamilyIndices,
+                       forUnmarshaling->queueFamilyIndexCount * sizeof(const uint32_t));
+    }
+    vkStream->read((VkImageLayout*)&forUnmarshaling->initialLayout, sizeof(VkImageLayout));
+}
+
+void marshal_VkSubresourceLayout(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkSubresourceLayout* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkDeviceSize*)&forMarshaling->offset, sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->rowPitch, sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->arrayPitch, sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->depthPitch, sizeof(VkDeviceSize));
+}
+
+void unmarshal_VkSubresourceLayout(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkSubresourceLayout* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->offset, sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->size, sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->rowPitch, sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->arrayPitch, sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->depthPitch, sizeof(VkDeviceSize));
+}
+
+void marshal_VkComponentMapping(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkComponentMapping* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkComponentSwizzle*)&forMarshaling->r, sizeof(VkComponentSwizzle));
+    vkStream->write((VkComponentSwizzle*)&forMarshaling->g, sizeof(VkComponentSwizzle));
+    vkStream->write((VkComponentSwizzle*)&forMarshaling->b, sizeof(VkComponentSwizzle));
+    vkStream->write((VkComponentSwizzle*)&forMarshaling->a, sizeof(VkComponentSwizzle));
+}
+
+void unmarshal_VkComponentMapping(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkComponentMapping* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkComponentSwizzle*)&forUnmarshaling->r, sizeof(VkComponentSwizzle));
+    vkStream->read((VkComponentSwizzle*)&forUnmarshaling->g, sizeof(VkComponentSwizzle));
+    vkStream->read((VkComponentSwizzle*)&forUnmarshaling->b, sizeof(VkComponentSwizzle));
+    vkStream->read((VkComponentSwizzle*)&forUnmarshaling->a, sizeof(VkComponentSwizzle));
+}
+
+void marshal_VkImageViewCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkImageViewCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkImageViewCreateFlags*)&forMarshaling->flags, sizeof(VkImageViewCreateFlags));
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkImage_u64(&forMarshaling->image, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkImageViewType*)&forMarshaling->viewType, sizeof(VkImageViewType));
+    vkStream->write((VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+    marshal_VkComponentMapping(vkStream, rootType,
+                               (VkComponentMapping*)(&forMarshaling->components));
+    marshal_VkImageSubresourceRange(vkStream, rootType,
+                                    (VkImageSubresourceRange*)(&forMarshaling->subresourceRange));
+}
+
+void unmarshal_VkImageViewCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkImageViewCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkImageViewCreateFlags*)&forUnmarshaling->flags,
+                   sizeof(VkImageViewCreateFlags));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_0,
+                                                      (VkImage*)&forUnmarshaling->image, 1);
+    vkStream->read((VkImageViewType*)&forUnmarshaling->viewType, sizeof(VkImageViewType));
+    vkStream->read((VkFormat*)&forUnmarshaling->format, sizeof(VkFormat));
+    unmarshal_VkComponentMapping(vkStream, rootType,
+                                 (VkComponentMapping*)(&forUnmarshaling->components));
+    unmarshal_VkImageSubresourceRange(
+        vkStream, rootType, (VkImageSubresourceRange*)(&forUnmarshaling->subresourceRange));
+}
+
+void marshal_VkShaderModuleCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkShaderModuleCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkShaderModuleCreateFlags*)&forMarshaling->flags,
+                    sizeof(VkShaderModuleCreateFlags));
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->codeSize;
+    vkStream->putBe64(cgen_var_0);
+    vkStream->write((const uint32_t*)forMarshaling->pCode,
+                    (forMarshaling->codeSize / 4) * sizeof(const uint32_t));
+}
+
+void unmarshal_VkShaderModuleCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkShaderModuleCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkShaderModuleCreateFlags*)&forUnmarshaling->flags,
+                   sizeof(VkShaderModuleCreateFlags));
+    forUnmarshaling->codeSize = (size_t)vkStream->getBe64();
+    vkStream->read((uint32_t*)forUnmarshaling->pCode,
+                   (forUnmarshaling->codeSize / 4) * sizeof(const uint32_t));
+}
+
+void marshal_VkPipelineCacheCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkPipelineCacheCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineCacheCreateFlags*)&forMarshaling->flags,
+                    sizeof(VkPipelineCacheCreateFlags));
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->initialDataSize;
+    vkStream->putBe64(cgen_var_0);
+    vkStream->write((const void*)forMarshaling->pInitialData,
+                    forMarshaling->initialDataSize * sizeof(const uint8_t));
+}
+
+void unmarshal_VkPipelineCacheCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkPipelineCacheCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineCacheCreateFlags*)&forUnmarshaling->flags,
+                   sizeof(VkPipelineCacheCreateFlags));
+    forUnmarshaling->initialDataSize = (size_t)vkStream->getBe64();
+    vkStream->read((void*)forUnmarshaling->pInitialData,
+                   forUnmarshaling->initialDataSize * sizeof(const uint8_t));
+}
+
+void marshal_VkSpecializationMapEntry(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkSpecializationMapEntry* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->constantID, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->offset, sizeof(uint32_t));
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->size;
+    vkStream->putBe64(cgen_var_0);
+}
+
+void unmarshal_VkSpecializationMapEntry(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkSpecializationMapEntry* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->constantID, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->offset, sizeof(uint32_t));
+    forUnmarshaling->size = (size_t)vkStream->getBe64();
+}
+
+void marshal_VkSpecializationInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkSpecializationInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->mapEntryCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->mapEntryCount; ++i) {
+            marshal_VkSpecializationMapEntry(
+                vkStream, rootType,
+                (const VkSpecializationMapEntry*)(forMarshaling->pMapEntries + i));
+        }
+    }
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->dataSize;
+    vkStream->putBe64(cgen_var_0);
+    vkStream->write((const void*)forMarshaling->pData,
+                    forMarshaling->dataSize * sizeof(const uint8_t));
+}
+
+void unmarshal_VkSpecializationInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkSpecializationInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->mapEntryCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->mapEntryCount; ++i) {
+            unmarshal_VkSpecializationMapEntry(
+                vkStream, rootType, (VkSpecializationMapEntry*)(forUnmarshaling->pMapEntries + i));
+        }
+    }
+    forUnmarshaling->dataSize = (size_t)vkStream->getBe64();
+    vkStream->read((void*)forUnmarshaling->pData,
+                   forUnmarshaling->dataSize * sizeof(const uint8_t));
+}
+
+void marshal_VkPipelineShaderStageCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkPipelineShaderStageCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineShaderStageCreateFlags*)&forMarshaling->flags,
+                    sizeof(VkPipelineShaderStageCreateFlags));
+    vkStream->write((VkShaderStageFlagBits*)&forMarshaling->stage, sizeof(VkShaderStageFlagBits));
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkShaderModule_u64(&forMarshaling->module, &cgen_var_0,
+                                                             1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->putString(forMarshaling->pName);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pSpecializationInfo;
+    vkStream->putBe64(cgen_var_1);
+    if (forMarshaling->pSpecializationInfo) {
+        marshal_VkSpecializationInfo(
+            vkStream, rootType, (const VkSpecializationInfo*)(forMarshaling->pSpecializationInfo));
+    }
+}
+
+void unmarshal_VkPipelineShaderStageCreateInfo(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkPipelineShaderStageCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineShaderStageCreateFlags*)&forUnmarshaling->flags,
+                   sizeof(VkPipelineShaderStageCreateFlags));
+    vkStream->read((VkShaderStageFlagBits*)&forUnmarshaling->stage, sizeof(VkShaderStageFlagBits));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkShaderModule(
+        &cgen_var_0, (VkShaderModule*)&forUnmarshaling->module, 1);
+    vkStream->loadStringInPlace((char**)&forUnmarshaling->pName);
+    // WARNING PTR CHECK
+    const VkSpecializationInfo* check_pSpecializationInfo;
+    check_pSpecializationInfo = (const VkSpecializationInfo*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pSpecializationInfo) {
+        if (!(check_pSpecializationInfo)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pSpecializationInfo inconsistent between guest and "
+                    "host\n");
+        }
+        unmarshal_VkSpecializationInfo(
+            vkStream, rootType, (VkSpecializationInfo*)(forUnmarshaling->pSpecializationInfo));
+    }
+}
+
+void marshal_VkComputePipelineCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkComputePipelineCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineCreateFlags*)&forMarshaling->flags, sizeof(VkPipelineCreateFlags));
+    marshal_VkPipelineShaderStageCreateInfo(
+        vkStream, rootType, (VkPipelineShaderStageCreateInfo*)(&forMarshaling->stage));
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&forMarshaling->layout, &cgen_var_0,
+                                                               1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    uint64_t cgen_var_1;
+    vkStream->handleMapping()->mapHandles_VkPipeline_u64(&forMarshaling->basePipelineHandle,
+                                                         &cgen_var_1, 1);
+    vkStream->write((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->write((int32_t*)&forMarshaling->basePipelineIndex, sizeof(int32_t));
+}
+
+void unmarshal_VkComputePipelineCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkComputePipelineCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineCreateFlags*)&forUnmarshaling->flags, sizeof(VkPipelineCreateFlags));
+    unmarshal_VkPipelineShaderStageCreateInfo(
+        vkStream, rootType, (VkPipelineShaderStageCreateInfo*)(&forUnmarshaling->stage));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkPipelineLayout(
+        &cgen_var_0, (VkPipelineLayout*)&forUnmarshaling->layout, 1);
+    uint64_t cgen_var_1;
+    vkStream->read((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkPipeline(
+        &cgen_var_1, (VkPipeline*)&forUnmarshaling->basePipelineHandle, 1);
+    vkStream->read((int32_t*)&forUnmarshaling->basePipelineIndex, sizeof(int32_t));
+}
+
+void marshal_VkVertexInputBindingDescription(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkVertexInputBindingDescription* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->binding, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->stride, sizeof(uint32_t));
+    vkStream->write((VkVertexInputRate*)&forMarshaling->inputRate, sizeof(VkVertexInputRate));
+}
+
+void unmarshal_VkVertexInputBindingDescription(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkVertexInputBindingDescription* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->binding, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->stride, sizeof(uint32_t));
+    vkStream->read((VkVertexInputRate*)&forUnmarshaling->inputRate, sizeof(VkVertexInputRate));
+}
+
+void marshal_VkVertexInputAttributeDescription(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVertexInputAttributeDescription* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->location, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->binding, sizeof(uint32_t));
+    vkStream->write((VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+    vkStream->write((uint32_t*)&forMarshaling->offset, sizeof(uint32_t));
+}
+
+void unmarshal_VkVertexInputAttributeDescription(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVertexInputAttributeDescription* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->location, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->binding, sizeof(uint32_t));
+    vkStream->read((VkFormat*)&forUnmarshaling->format, sizeof(VkFormat));
+    vkStream->read((uint32_t*)&forUnmarshaling->offset, sizeof(uint32_t));
+}
+
+void marshal_VkPipelineVertexInputStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineVertexInputStateCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineVertexInputStateCreateFlags*)&forMarshaling->flags,
+                    sizeof(VkPipelineVertexInputStateCreateFlags));
+    vkStream->write((uint32_t*)&forMarshaling->vertexBindingDescriptionCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->vertexBindingDescriptionCount; ++i) {
+            marshal_VkVertexInputBindingDescription(
+                vkStream, rootType,
+                (const VkVertexInputBindingDescription*)(forMarshaling->pVertexBindingDescriptions +
+                                                         i));
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->vertexAttributeDescriptionCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->vertexAttributeDescriptionCount; ++i) {
+            marshal_VkVertexInputAttributeDescription(
+                vkStream, rootType,
+                (const VkVertexInputAttributeDescription*)(forMarshaling
+                                                               ->pVertexAttributeDescriptions +
+                                                           i));
+        }
+    }
+}
+
+void unmarshal_VkPipelineVertexInputStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineVertexInputStateCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineVertexInputStateCreateFlags*)&forUnmarshaling->flags,
+                   sizeof(VkPipelineVertexInputStateCreateFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->vertexBindingDescriptionCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->vertexBindingDescriptionCount; ++i) {
+            unmarshal_VkVertexInputBindingDescription(
+                vkStream, rootType,
+                (VkVertexInputBindingDescription*)(forUnmarshaling->pVertexBindingDescriptions +
+                                                   i));
+        }
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->vertexAttributeDescriptionCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->vertexAttributeDescriptionCount; ++i) {
+            unmarshal_VkVertexInputAttributeDescription(
+                vkStream, rootType,
+                (VkVertexInputAttributeDescription*)(forUnmarshaling->pVertexAttributeDescriptions +
+                                                     i));
+        }
+    }
+}
+
+void marshal_VkPipelineInputAssemblyStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineInputAssemblyStateCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineInputAssemblyStateCreateFlags*)&forMarshaling->flags,
+                    sizeof(VkPipelineInputAssemblyStateCreateFlags));
+    vkStream->write((VkPrimitiveTopology*)&forMarshaling->topology, sizeof(VkPrimitiveTopology));
+    vkStream->write((VkBool32*)&forMarshaling->primitiveRestartEnable, sizeof(VkBool32));
+}
+
+void unmarshal_VkPipelineInputAssemblyStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineInputAssemblyStateCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineInputAssemblyStateCreateFlags*)&forUnmarshaling->flags,
+                   sizeof(VkPipelineInputAssemblyStateCreateFlags));
+    vkStream->read((VkPrimitiveTopology*)&forUnmarshaling->topology, sizeof(VkPrimitiveTopology));
+    vkStream->read((VkBool32*)&forUnmarshaling->primitiveRestartEnable, sizeof(VkBool32));
+}
+
+void marshal_VkPipelineTessellationStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineTessellationStateCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineTessellationStateCreateFlags*)&forMarshaling->flags,
+                    sizeof(VkPipelineTessellationStateCreateFlags));
+    vkStream->write((uint32_t*)&forMarshaling->patchControlPoints, sizeof(uint32_t));
+}
+
+void unmarshal_VkPipelineTessellationStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineTessellationStateCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineTessellationStateCreateFlags*)&forUnmarshaling->flags,
+                   sizeof(VkPipelineTessellationStateCreateFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->patchControlPoints, sizeof(uint32_t));
+}
+
+void marshal_VkViewport(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                        const VkViewport* forMarshaling) {
+    (void)rootType;
+    vkStream->write((float*)&forMarshaling->x, sizeof(float));
+    vkStream->write((float*)&forMarshaling->y, sizeof(float));
+    vkStream->write((float*)&forMarshaling->width, sizeof(float));
+    vkStream->write((float*)&forMarshaling->height, sizeof(float));
+    vkStream->write((float*)&forMarshaling->minDepth, sizeof(float));
+    vkStream->write((float*)&forMarshaling->maxDepth, sizeof(float));
+}
+
+void unmarshal_VkViewport(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                          VkViewport* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((float*)&forUnmarshaling->x, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->y, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->width, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->height, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->minDepth, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->maxDepth, sizeof(float));
+}
+
+void marshal_VkPipelineViewportStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineViewportStateCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineViewportStateCreateFlags*)&forMarshaling->flags,
+                    sizeof(VkPipelineViewportStateCreateFlags));
+    vkStream->write((uint32_t*)&forMarshaling->viewportCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pViewports;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pViewports) {
+        if (forMarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forMarshaling->viewportCount; ++i) {
+                marshal_VkViewport(vkStream, rootType,
+                                   (const VkViewport*)(forMarshaling->pViewports + i));
+            }
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->scissorCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pScissors;
+    vkStream->putBe64(cgen_var_1);
+    if (forMarshaling->pScissors) {
+        if (forMarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forMarshaling->scissorCount; ++i) {
+                marshal_VkRect2D(vkStream, rootType,
+                                 (const VkRect2D*)(forMarshaling->pScissors + i));
+            }
+        }
+    }
+}
+
+void unmarshal_VkPipelineViewportStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineViewportStateCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineViewportStateCreateFlags*)&forUnmarshaling->flags,
+                   sizeof(VkPipelineViewportStateCreateFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->viewportCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const VkViewport* check_pViewports;
+    check_pViewports = (const VkViewport*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pViewports) {
+        if (!(check_pViewports)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pViewports inconsistent between guest and host\n");
+        }
+        if (forUnmarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->viewportCount; ++i) {
+                unmarshal_VkViewport(vkStream, rootType,
+                                     (VkViewport*)(forUnmarshaling->pViewports + i));
+            }
+        }
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->scissorCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const VkRect2D* check_pScissors;
+    check_pScissors = (const VkRect2D*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pScissors) {
+        if (!(check_pScissors)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pScissors inconsistent between guest and host\n");
+        }
+        if (forUnmarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->scissorCount; ++i) {
+                unmarshal_VkRect2D(vkStream, rootType, (VkRect2D*)(forUnmarshaling->pScissors + i));
+            }
+        }
+    }
+}
+
+void marshal_VkPipelineRasterizationStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRasterizationStateCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineRasterizationStateCreateFlags*)&forMarshaling->flags,
+                    sizeof(VkPipelineRasterizationStateCreateFlags));
+    vkStream->write((VkBool32*)&forMarshaling->depthClampEnable, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->rasterizerDiscardEnable, sizeof(VkBool32));
+    vkStream->write((VkPolygonMode*)&forMarshaling->polygonMode, sizeof(VkPolygonMode));
+    vkStream->write((VkCullModeFlags*)&forMarshaling->cullMode, sizeof(VkCullModeFlags));
+    vkStream->write((VkFrontFace*)&forMarshaling->frontFace, sizeof(VkFrontFace));
+    vkStream->write((VkBool32*)&forMarshaling->depthBiasEnable, sizeof(VkBool32));
+    vkStream->write((float*)&forMarshaling->depthBiasConstantFactor, sizeof(float));
+    vkStream->write((float*)&forMarshaling->depthBiasClamp, sizeof(float));
+    vkStream->write((float*)&forMarshaling->depthBiasSlopeFactor, sizeof(float));
+    vkStream->write((float*)&forMarshaling->lineWidth, sizeof(float));
+}
+
+void unmarshal_VkPipelineRasterizationStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineRasterizationStateCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineRasterizationStateCreateFlags*)&forUnmarshaling->flags,
+                   sizeof(VkPipelineRasterizationStateCreateFlags));
+    vkStream->read((VkBool32*)&forUnmarshaling->depthClampEnable, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->rasterizerDiscardEnable, sizeof(VkBool32));
+    vkStream->read((VkPolygonMode*)&forUnmarshaling->polygonMode, sizeof(VkPolygonMode));
+    vkStream->read((VkCullModeFlags*)&forUnmarshaling->cullMode, sizeof(VkCullModeFlags));
+    vkStream->read((VkFrontFace*)&forUnmarshaling->frontFace, sizeof(VkFrontFace));
+    vkStream->read((VkBool32*)&forUnmarshaling->depthBiasEnable, sizeof(VkBool32));
+    vkStream->read((float*)&forUnmarshaling->depthBiasConstantFactor, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->depthBiasClamp, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->depthBiasSlopeFactor, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->lineWidth, sizeof(float));
+}
+
+void marshal_VkPipelineMultisampleStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineMultisampleStateCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineMultisampleStateCreateFlags*)&forMarshaling->flags,
+                    sizeof(VkPipelineMultisampleStateCreateFlags));
+    vkStream->write((VkSampleCountFlagBits*)&forMarshaling->rasterizationSamples,
+                    sizeof(VkSampleCountFlagBits));
+    vkStream->write((VkBool32*)&forMarshaling->sampleShadingEnable, sizeof(VkBool32));
+    vkStream->write((float*)&forMarshaling->minSampleShading, sizeof(float));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pSampleMask;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pSampleMask) {
+        vkStream->write(
+            (const VkSampleMask*)forMarshaling->pSampleMask,
+            (((forMarshaling->rasterizationSamples) + 31) / 32) * sizeof(const VkSampleMask));
+    }
+    vkStream->write((VkBool32*)&forMarshaling->alphaToCoverageEnable, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->alphaToOneEnable, sizeof(VkBool32));
+}
+
+void unmarshal_VkPipelineMultisampleStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineMultisampleStateCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineMultisampleStateCreateFlags*)&forUnmarshaling->flags,
+                   sizeof(VkPipelineMultisampleStateCreateFlags));
+    vkStream->read((VkSampleCountFlagBits*)&forUnmarshaling->rasterizationSamples,
+                   sizeof(VkSampleCountFlagBits));
+    vkStream->read((VkBool32*)&forUnmarshaling->sampleShadingEnable, sizeof(VkBool32));
+    vkStream->read((float*)&forUnmarshaling->minSampleShading, sizeof(float));
+    // WARNING PTR CHECK
+    const VkSampleMask* check_pSampleMask;
+    check_pSampleMask = (const VkSampleMask*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pSampleMask) {
+        if (!(check_pSampleMask)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pSampleMask inconsistent between guest and host\n");
+        }
+        vkStream->read(
+            (VkSampleMask*)forUnmarshaling->pSampleMask,
+            (((forUnmarshaling->rasterizationSamples) + 31) / 32) * sizeof(const VkSampleMask));
+    }
+    vkStream->read((VkBool32*)&forUnmarshaling->alphaToCoverageEnable, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->alphaToOneEnable, sizeof(VkBool32));
+}
+
+void marshal_VkStencilOpState(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                              const VkStencilOpState* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStencilOp*)&forMarshaling->failOp, sizeof(VkStencilOp));
+    vkStream->write((VkStencilOp*)&forMarshaling->passOp, sizeof(VkStencilOp));
+    vkStream->write((VkStencilOp*)&forMarshaling->depthFailOp, sizeof(VkStencilOp));
+    vkStream->write((VkCompareOp*)&forMarshaling->compareOp, sizeof(VkCompareOp));
+    vkStream->write((uint32_t*)&forMarshaling->compareMask, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->writeMask, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->reference, sizeof(uint32_t));
+}
+
+void unmarshal_VkStencilOpState(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                VkStencilOpState* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStencilOp*)&forUnmarshaling->failOp, sizeof(VkStencilOp));
+    vkStream->read((VkStencilOp*)&forUnmarshaling->passOp, sizeof(VkStencilOp));
+    vkStream->read((VkStencilOp*)&forUnmarshaling->depthFailOp, sizeof(VkStencilOp));
+    vkStream->read((VkCompareOp*)&forUnmarshaling->compareOp, sizeof(VkCompareOp));
+    vkStream->read((uint32_t*)&forUnmarshaling->compareMask, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->writeMask, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->reference, sizeof(uint32_t));
+}
+
+void marshal_VkPipelineDepthStencilStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineDepthStencilStateCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineDepthStencilStateCreateFlags*)&forMarshaling->flags,
+                    sizeof(VkPipelineDepthStencilStateCreateFlags));
+    vkStream->write((VkBool32*)&forMarshaling->depthTestEnable, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->depthWriteEnable, sizeof(VkBool32));
+    vkStream->write((VkCompareOp*)&forMarshaling->depthCompareOp, sizeof(VkCompareOp));
+    vkStream->write((VkBool32*)&forMarshaling->depthBoundsTestEnable, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->stencilTestEnable, sizeof(VkBool32));
+    marshal_VkStencilOpState(vkStream, rootType, (VkStencilOpState*)(&forMarshaling->front));
+    marshal_VkStencilOpState(vkStream, rootType, (VkStencilOpState*)(&forMarshaling->back));
+    vkStream->write((float*)&forMarshaling->minDepthBounds, sizeof(float));
+    vkStream->write((float*)&forMarshaling->maxDepthBounds, sizeof(float));
+}
+
+void unmarshal_VkPipelineDepthStencilStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineDepthStencilStateCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineDepthStencilStateCreateFlags*)&forUnmarshaling->flags,
+                   sizeof(VkPipelineDepthStencilStateCreateFlags));
+    vkStream->read((VkBool32*)&forUnmarshaling->depthTestEnable, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->depthWriteEnable, sizeof(VkBool32));
+    vkStream->read((VkCompareOp*)&forUnmarshaling->depthCompareOp, sizeof(VkCompareOp));
+    vkStream->read((VkBool32*)&forUnmarshaling->depthBoundsTestEnable, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->stencilTestEnable, sizeof(VkBool32));
+    unmarshal_VkStencilOpState(vkStream, rootType, (VkStencilOpState*)(&forUnmarshaling->front));
+    unmarshal_VkStencilOpState(vkStream, rootType, (VkStencilOpState*)(&forUnmarshaling->back));
+    vkStream->read((float*)&forUnmarshaling->minDepthBounds, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->maxDepthBounds, sizeof(float));
+}
+
+void marshal_VkPipelineColorBlendAttachmentState(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineColorBlendAttachmentState* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkBool32*)&forMarshaling->blendEnable, sizeof(VkBool32));
+    vkStream->write((VkBlendFactor*)&forMarshaling->srcColorBlendFactor, sizeof(VkBlendFactor));
+    vkStream->write((VkBlendFactor*)&forMarshaling->dstColorBlendFactor, sizeof(VkBlendFactor));
+    vkStream->write((VkBlendOp*)&forMarshaling->colorBlendOp, sizeof(VkBlendOp));
+    vkStream->write((VkBlendFactor*)&forMarshaling->srcAlphaBlendFactor, sizeof(VkBlendFactor));
+    vkStream->write((VkBlendFactor*)&forMarshaling->dstAlphaBlendFactor, sizeof(VkBlendFactor));
+    vkStream->write((VkBlendOp*)&forMarshaling->alphaBlendOp, sizeof(VkBlendOp));
+    vkStream->write((VkColorComponentFlags*)&forMarshaling->colorWriteMask,
+                    sizeof(VkColorComponentFlags));
+}
+
+void unmarshal_VkPipelineColorBlendAttachmentState(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineColorBlendAttachmentState* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkBool32*)&forUnmarshaling->blendEnable, sizeof(VkBool32));
+    vkStream->read((VkBlendFactor*)&forUnmarshaling->srcColorBlendFactor, sizeof(VkBlendFactor));
+    vkStream->read((VkBlendFactor*)&forUnmarshaling->dstColorBlendFactor, sizeof(VkBlendFactor));
+    vkStream->read((VkBlendOp*)&forUnmarshaling->colorBlendOp, sizeof(VkBlendOp));
+    vkStream->read((VkBlendFactor*)&forUnmarshaling->srcAlphaBlendFactor, sizeof(VkBlendFactor));
+    vkStream->read((VkBlendFactor*)&forUnmarshaling->dstAlphaBlendFactor, sizeof(VkBlendFactor));
+    vkStream->read((VkBlendOp*)&forUnmarshaling->alphaBlendOp, sizeof(VkBlendOp));
+    vkStream->read((VkColorComponentFlags*)&forUnmarshaling->colorWriteMask,
+                   sizeof(VkColorComponentFlags));
+}
+
+void marshal_VkPipelineColorBlendStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineColorBlendStateCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineColorBlendStateCreateFlags*)&forMarshaling->flags,
+                    sizeof(VkPipelineColorBlendStateCreateFlags));
+    vkStream->write((VkBool32*)&forMarshaling->logicOpEnable, sizeof(VkBool32));
+    vkStream->write((VkLogicOp*)&forMarshaling->logicOp, sizeof(VkLogicOp));
+    vkStream->write((uint32_t*)&forMarshaling->attachmentCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->attachmentCount; ++i) {
+            marshal_VkPipelineColorBlendAttachmentState(
+                vkStream, rootType,
+                (const VkPipelineColorBlendAttachmentState*)(forMarshaling->pAttachments + i));
+        }
+    }
+    vkStream->write((float*)forMarshaling->blendConstants, 4 * sizeof(float));
+}
+
+void unmarshal_VkPipelineColorBlendStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineColorBlendStateCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineColorBlendStateCreateFlags*)&forUnmarshaling->flags,
+                   sizeof(VkPipelineColorBlendStateCreateFlags));
+    vkStream->read((VkBool32*)&forUnmarshaling->logicOpEnable, sizeof(VkBool32));
+    vkStream->read((VkLogicOp*)&forUnmarshaling->logicOp, sizeof(VkLogicOp));
+    vkStream->read((uint32_t*)&forUnmarshaling->attachmentCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->attachmentCount; ++i) {
+            unmarshal_VkPipelineColorBlendAttachmentState(
+                vkStream, rootType,
+                (VkPipelineColorBlendAttachmentState*)(forUnmarshaling->pAttachments + i));
+        }
+    }
+    vkStream->read((float*)forUnmarshaling->blendConstants, 4 * sizeof(float));
+}
+
+void marshal_VkPipelineDynamicStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineDynamicStateCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineDynamicStateCreateFlags*)&forMarshaling->flags,
+                    sizeof(VkPipelineDynamicStateCreateFlags));
+    vkStream->write((uint32_t*)&forMarshaling->dynamicStateCount, sizeof(uint32_t));
+    vkStream->write((const VkDynamicState*)forMarshaling->pDynamicStates,
+                    forMarshaling->dynamicStateCount * sizeof(const VkDynamicState));
+}
+
+void unmarshal_VkPipelineDynamicStateCreateInfo(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkPipelineDynamicStateCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineDynamicStateCreateFlags*)&forUnmarshaling->flags,
+                   sizeof(VkPipelineDynamicStateCreateFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->dynamicStateCount, sizeof(uint32_t));
+    vkStream->read((VkDynamicState*)forUnmarshaling->pDynamicStates,
+                   forUnmarshaling->dynamicStateCount * sizeof(const VkDynamicState));
+}
+
+void marshal_VkGraphicsPipelineCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkGraphicsPipelineCreateInfo* forMarshaling) {
+    (void)rootType;
+    uint32_t hasRasterization = 1;
+    if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) {
+        hasRasterization =
+            (((0 == forMarshaling->pRasterizationState))
+                 ? (0)
+                 : (!((*(forMarshaling->pRasterizationState)).rasterizerDiscardEnable)));
+        uint32_t cgen_var_0 = (uint32_t)hasRasterization;
+        vkStream->putBe32(cgen_var_0);
+    }
+    uint32_t hasTessellation = 1;
+    if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) {
+        hasTessellation =
+            arrayany(forMarshaling->pStages, 0, forMarshaling->stageCount,
+                     [](VkPipelineShaderStageCreateInfo s) {
+                         return ((s.stage == VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT) ||
+                                 (s.stage == VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT));
+                     });
+        uint32_t cgen_var_0 = (uint32_t)hasTessellation;
+        vkStream->putBe32(cgen_var_0);
+    }
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineCreateFlags*)&forMarshaling->flags, sizeof(VkPipelineCreateFlags));
+    vkStream->write((uint32_t*)&forMarshaling->stageCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->stageCount; ++i) {
+            marshal_VkPipelineShaderStageCreateInfo(
+                vkStream, rootType,
+                (const VkPipelineShaderStageCreateInfo*)(forMarshaling->pStages + i));
+        }
+    }
+    // WARNING PTR CHECK
+    if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) {
+        uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pVertexInputState;
+        vkStream->putBe64(cgen_var_0);
+    }
+    if ((!(vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) ||
+         forMarshaling->pVertexInputState)) {
+        marshal_VkPipelineVertexInputStateCreateInfo(
+            vkStream, rootType,
+            (const VkPipelineVertexInputStateCreateInfo*)(forMarshaling->pVertexInputState));
+    }
+    // WARNING PTR CHECK
+    if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) {
+        uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pInputAssemblyState;
+        vkStream->putBe64(cgen_var_0);
+    }
+    if ((!(vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) ||
+         forMarshaling->pInputAssemblyState)) {
+        marshal_VkPipelineInputAssemblyStateCreateInfo(
+            vkStream, rootType,
+            (const VkPipelineInputAssemblyStateCreateInfo*)(forMarshaling->pInputAssemblyState));
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pTessellationState;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pTessellationState) {
+        if (hasTessellation) {
+            marshal_VkPipelineTessellationStateCreateInfo(
+                vkStream, rootType,
+                (const VkPipelineTessellationStateCreateInfo*)(forMarshaling->pTessellationState));
+        }
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pViewportState;
+    vkStream->putBe64(cgen_var_1);
+    if (forMarshaling->pViewportState) {
+        if (hasRasterization) {
+            marshal_VkPipelineViewportStateCreateInfo(
+                vkStream, rootType,
+                (const VkPipelineViewportStateCreateInfo*)(forMarshaling->pViewportState));
+        }
+    }
+    // WARNING PTR CHECK
+    if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) {
+        uint64_t cgen_var_1_0 = (uint64_t)(uintptr_t)forMarshaling->pRasterizationState;
+        vkStream->putBe64(cgen_var_1_0);
+    }
+    if ((!(vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) ||
+         forMarshaling->pRasterizationState)) {
+        marshal_VkPipelineRasterizationStateCreateInfo(
+            vkStream, rootType,
+            (const VkPipelineRasterizationStateCreateInfo*)(forMarshaling->pRasterizationState));
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)forMarshaling->pMultisampleState;
+    vkStream->putBe64(cgen_var_2);
+    if (forMarshaling->pMultisampleState) {
+        if (hasRasterization) {
+            marshal_VkPipelineMultisampleStateCreateInfo(
+                vkStream, rootType,
+                (const VkPipelineMultisampleStateCreateInfo*)(forMarshaling->pMultisampleState));
+        }
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_3 = (uint64_t)(uintptr_t)forMarshaling->pDepthStencilState;
+    vkStream->putBe64(cgen_var_3);
+    if (forMarshaling->pDepthStencilState) {
+        if (hasRasterization) {
+            marshal_VkPipelineDepthStencilStateCreateInfo(
+                vkStream, rootType,
+                (const VkPipelineDepthStencilStateCreateInfo*)(forMarshaling->pDepthStencilState));
+        }
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_4 = (uint64_t)(uintptr_t)forMarshaling->pColorBlendState;
+    vkStream->putBe64(cgen_var_4);
+    if (forMarshaling->pColorBlendState) {
+        if (hasRasterization) {
+            marshal_VkPipelineColorBlendStateCreateInfo(
+                vkStream, rootType,
+                (const VkPipelineColorBlendStateCreateInfo*)(forMarshaling->pColorBlendState));
+        }
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_5 = (uint64_t)(uintptr_t)forMarshaling->pDynamicState;
+    vkStream->putBe64(cgen_var_5);
+    if (forMarshaling->pDynamicState) {
+        marshal_VkPipelineDynamicStateCreateInfo(
+            vkStream, rootType,
+            (const VkPipelineDynamicStateCreateInfo*)(forMarshaling->pDynamicState));
+    }
+    uint64_t cgen_var_6;
+    vkStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&forMarshaling->layout, &cgen_var_6,
+                                                               1);
+    vkStream->write((uint64_t*)&cgen_var_6, 1 * 8);
+    uint64_t cgen_var_7;
+    vkStream->handleMapping()->mapHandles_VkRenderPass_u64(&forMarshaling->renderPass, &cgen_var_7,
+                                                           1);
+    vkStream->write((uint64_t*)&cgen_var_7, 1 * 8);
+    vkStream->write((uint32_t*)&forMarshaling->subpass, sizeof(uint32_t));
+    uint64_t cgen_var_8;
+    vkStream->handleMapping()->mapHandles_VkPipeline_u64(&forMarshaling->basePipelineHandle,
+                                                         &cgen_var_8, 1);
+    vkStream->write((uint64_t*)&cgen_var_8, 1 * 8);
+    vkStream->write((int32_t*)&forMarshaling->basePipelineIndex, sizeof(int32_t));
+}
+
+void unmarshal_VkGraphicsPipelineCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkGraphicsPipelineCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    uint32_t hasRasterization = 1;
+    if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) {
+        hasRasterization = (const uint32_t)vkStream->getBe32();
+    }
+    uint32_t hasTessellation = 1;
+    if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) {
+        hasTessellation = (const uint32_t)vkStream->getBe32();
+    }
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineCreateFlags*)&forUnmarshaling->flags, sizeof(VkPipelineCreateFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->stageCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->stageCount; ++i) {
+            unmarshal_VkPipelineShaderStageCreateInfo(
+                vkStream, rootType,
+                (VkPipelineShaderStageCreateInfo*)(forUnmarshaling->pStages + i));
+        }
+    }
+    // WARNING PTR CHECK
+    const VkPipelineVertexInputStateCreateInfo* check_pVertexInputState;
+    if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) {
+        check_pVertexInputState =
+            (const VkPipelineVertexInputStateCreateInfo*)(uintptr_t)vkStream->getBe64();
+    }
+    if ((!(vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) ||
+         forUnmarshaling->pVertexInputState)) {
+        unmarshal_VkPipelineVertexInputStateCreateInfo(
+            vkStream, rootType,
+            (VkPipelineVertexInputStateCreateInfo*)(forUnmarshaling->pVertexInputState));
+    }
+    // WARNING PTR CHECK
+    const VkPipelineInputAssemblyStateCreateInfo* check_pInputAssemblyState;
+    if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) {
+        check_pInputAssemblyState =
+            (const VkPipelineInputAssemblyStateCreateInfo*)(uintptr_t)vkStream->getBe64();
+    }
+    if ((!(vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) ||
+         forUnmarshaling->pInputAssemblyState)) {
+        unmarshal_VkPipelineInputAssemblyStateCreateInfo(
+            vkStream, rootType,
+            (VkPipelineInputAssemblyStateCreateInfo*)(forUnmarshaling->pInputAssemblyState));
+    }
+    // WARNING PTR CHECK
+    const VkPipelineTessellationStateCreateInfo* check_pTessellationState;
+    check_pTessellationState =
+        (const VkPipelineTessellationStateCreateInfo*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pTessellationState) {
+        if (!(check_pTessellationState)) {
+            fprintf(
+                stderr,
+                "fatal: forUnmarshaling->pTessellationState inconsistent between guest and host\n");
+        }
+        if (hasTessellation) {
+            unmarshal_VkPipelineTessellationStateCreateInfo(
+                vkStream, rootType,
+                (VkPipelineTessellationStateCreateInfo*)(forUnmarshaling->pTessellationState));
+        } else {
+            forUnmarshaling->pTessellationState = 0;
+        }
+    }
+    // WARNING PTR CHECK
+    const VkPipelineViewportStateCreateInfo* check_pViewportState;
+    check_pViewportState = (const VkPipelineViewportStateCreateInfo*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pViewportState) {
+        if (!(check_pViewportState)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pViewportState inconsistent between guest and host\n");
+        }
+        if (hasRasterization) {
+            unmarshal_VkPipelineViewportStateCreateInfo(
+                vkStream, rootType,
+                (VkPipelineViewportStateCreateInfo*)(forUnmarshaling->pViewportState));
+        } else {
+            forUnmarshaling->pViewportState = 0;
+        }
+    }
+    // WARNING PTR CHECK
+    const VkPipelineRasterizationStateCreateInfo* check_pRasterizationState;
+    if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) {
+        check_pRasterizationState =
+            (const VkPipelineRasterizationStateCreateInfo*)(uintptr_t)vkStream->getBe64();
+    }
+    if ((!(vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) ||
+         forUnmarshaling->pRasterizationState)) {
+        unmarshal_VkPipelineRasterizationStateCreateInfo(
+            vkStream, rootType,
+            (VkPipelineRasterizationStateCreateInfo*)(forUnmarshaling->pRasterizationState));
+    }
+    // WARNING PTR CHECK
+    const VkPipelineMultisampleStateCreateInfo* check_pMultisampleState;
+    check_pMultisampleState =
+        (const VkPipelineMultisampleStateCreateInfo*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pMultisampleState) {
+        if (!(check_pMultisampleState)) {
+            fprintf(
+                stderr,
+                "fatal: forUnmarshaling->pMultisampleState inconsistent between guest and host\n");
+        }
+        if (hasRasterization) {
+            unmarshal_VkPipelineMultisampleStateCreateInfo(
+                vkStream, rootType,
+                (VkPipelineMultisampleStateCreateInfo*)(forUnmarshaling->pMultisampleState));
+        } else {
+            forUnmarshaling->pMultisampleState = 0;
+        }
+    }
+    // WARNING PTR CHECK
+    const VkPipelineDepthStencilStateCreateInfo* check_pDepthStencilState;
+    check_pDepthStencilState =
+        (const VkPipelineDepthStencilStateCreateInfo*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pDepthStencilState) {
+        if (!(check_pDepthStencilState)) {
+            fprintf(
+                stderr,
+                "fatal: forUnmarshaling->pDepthStencilState inconsistent between guest and host\n");
+        }
+        if (hasRasterization) {
+            unmarshal_VkPipelineDepthStencilStateCreateInfo(
+                vkStream, rootType,
+                (VkPipelineDepthStencilStateCreateInfo*)(forUnmarshaling->pDepthStencilState));
+        } else {
+            forUnmarshaling->pDepthStencilState = 0;
+        }
+    }
+    // WARNING PTR CHECK
+    const VkPipelineColorBlendStateCreateInfo* check_pColorBlendState;
+    check_pColorBlendState =
+        (const VkPipelineColorBlendStateCreateInfo*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pColorBlendState) {
+        if (!(check_pColorBlendState)) {
+            fprintf(
+                stderr,
+                "fatal: forUnmarshaling->pColorBlendState inconsistent between guest and host\n");
+        }
+        if (hasRasterization) {
+            unmarshal_VkPipelineColorBlendStateCreateInfo(
+                vkStream, rootType,
+                (VkPipelineColorBlendStateCreateInfo*)(forUnmarshaling->pColorBlendState));
+        } else {
+            forUnmarshaling->pColorBlendState = 0;
+        }
+    }
+    // WARNING PTR CHECK
+    const VkPipelineDynamicStateCreateInfo* check_pDynamicState;
+    check_pDynamicState = (const VkPipelineDynamicStateCreateInfo*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pDynamicState) {
+        if (!(check_pDynamicState)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pDynamicState inconsistent between guest and host\n");
+        }
+        unmarshal_VkPipelineDynamicStateCreateInfo(
+            vkStream, rootType,
+            (VkPipelineDynamicStateCreateInfo*)(forUnmarshaling->pDynamicState));
+    }
+    uint64_t cgen_var_6;
+    vkStream->read((uint64_t*)&cgen_var_6, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkPipelineLayout(
+        &cgen_var_6, (VkPipelineLayout*)&forUnmarshaling->layout, 1);
+    uint64_t cgen_var_7;
+    vkStream->read((uint64_t*)&cgen_var_7, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkRenderPass(
+        &cgen_var_7, (VkRenderPass*)&forUnmarshaling->renderPass, 1);
+    vkStream->read((uint32_t*)&forUnmarshaling->subpass, sizeof(uint32_t));
+    uint64_t cgen_var_8;
+    vkStream->read((uint64_t*)&cgen_var_8, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkPipeline(
+        &cgen_var_8, (VkPipeline*)&forUnmarshaling->basePipelineHandle, 1);
+    vkStream->read((int32_t*)&forUnmarshaling->basePipelineIndex, sizeof(int32_t));
+}
+
+void marshal_VkPushConstantRange(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkPushConstantRange* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkShaderStageFlags*)&forMarshaling->stageFlags, sizeof(VkShaderStageFlags));
+    vkStream->write((uint32_t*)&forMarshaling->offset, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->size, sizeof(uint32_t));
+}
+
+void unmarshal_VkPushConstantRange(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkPushConstantRange* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkShaderStageFlags*)&forUnmarshaling->stageFlags, sizeof(VkShaderStageFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->offset, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->size, sizeof(uint32_t));
+}
+
+void marshal_VkPipelineLayoutCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkPipelineLayoutCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineLayoutCreateFlags*)&forMarshaling->flags,
+                    sizeof(VkPipelineLayoutCreateFlags));
+    vkStream->write((uint32_t*)&forMarshaling->setLayoutCount, sizeof(uint32_t));
+    if (forMarshaling->setLayoutCount) {
+        uint64_t* cgen_var_0;
+        vkStream->alloc((void**)&cgen_var_0, forMarshaling->setLayoutCount * 8);
+        vkStream->handleMapping()->mapHandles_VkDescriptorSetLayout_u64(
+            forMarshaling->pSetLayouts, cgen_var_0, forMarshaling->setLayoutCount);
+        vkStream->write((uint64_t*)cgen_var_0, forMarshaling->setLayoutCount * 8);
+    }
+    vkStream->write((uint32_t*)&forMarshaling->pushConstantRangeCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->pushConstantRangeCount; ++i) {
+            marshal_VkPushConstantRange(
+                vkStream, rootType,
+                (const VkPushConstantRange*)(forMarshaling->pPushConstantRanges + i));
+        }
+    }
+}
+
+void unmarshal_VkPipelineLayoutCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkPipelineLayoutCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineLayoutCreateFlags*)&forUnmarshaling->flags,
+                   sizeof(VkPipelineLayoutCreateFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->setLayoutCount, sizeof(uint32_t));
+    if (forUnmarshaling->setLayoutCount) {
+        uint64_t* cgen_var_0;
+        vkStream->alloc((void**)&cgen_var_0, forUnmarshaling->setLayoutCount * 8);
+        vkStream->read((uint64_t*)cgen_var_0, forUnmarshaling->setLayoutCount * 8);
+        vkStream->handleMapping()->mapHandles_u64_VkDescriptorSetLayout(
+            cgen_var_0, (VkDescriptorSetLayout*)forUnmarshaling->pSetLayouts,
+            forUnmarshaling->setLayoutCount);
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->pushConstantRangeCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->pushConstantRangeCount; ++i) {
+            unmarshal_VkPushConstantRange(
+                vkStream, rootType,
+                (VkPushConstantRange*)(forUnmarshaling->pPushConstantRanges + i));
+        }
+    }
+}
+
+void marshal_VkSamplerCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkSamplerCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkSamplerCreateFlags*)&forMarshaling->flags, sizeof(VkSamplerCreateFlags));
+    vkStream->write((VkFilter*)&forMarshaling->magFilter, sizeof(VkFilter));
+    vkStream->write((VkFilter*)&forMarshaling->minFilter, sizeof(VkFilter));
+    vkStream->write((VkSamplerMipmapMode*)&forMarshaling->mipmapMode, sizeof(VkSamplerMipmapMode));
+    vkStream->write((VkSamplerAddressMode*)&forMarshaling->addressModeU,
+                    sizeof(VkSamplerAddressMode));
+    vkStream->write((VkSamplerAddressMode*)&forMarshaling->addressModeV,
+                    sizeof(VkSamplerAddressMode));
+    vkStream->write((VkSamplerAddressMode*)&forMarshaling->addressModeW,
+                    sizeof(VkSamplerAddressMode));
+    vkStream->write((float*)&forMarshaling->mipLodBias, sizeof(float));
+    vkStream->write((VkBool32*)&forMarshaling->anisotropyEnable, sizeof(VkBool32));
+    vkStream->write((float*)&forMarshaling->maxAnisotropy, sizeof(float));
+    vkStream->write((VkBool32*)&forMarshaling->compareEnable, sizeof(VkBool32));
+    vkStream->write((VkCompareOp*)&forMarshaling->compareOp, sizeof(VkCompareOp));
+    vkStream->write((float*)&forMarshaling->minLod, sizeof(float));
+    vkStream->write((float*)&forMarshaling->maxLod, sizeof(float));
+    vkStream->write((VkBorderColor*)&forMarshaling->borderColor, sizeof(VkBorderColor));
+    vkStream->write((VkBool32*)&forMarshaling->unnormalizedCoordinates, sizeof(VkBool32));
+}
+
+void unmarshal_VkSamplerCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkSamplerCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkSamplerCreateFlags*)&forUnmarshaling->flags, sizeof(VkSamplerCreateFlags));
+    vkStream->read((VkFilter*)&forUnmarshaling->magFilter, sizeof(VkFilter));
+    vkStream->read((VkFilter*)&forUnmarshaling->minFilter, sizeof(VkFilter));
+    vkStream->read((VkSamplerMipmapMode*)&forUnmarshaling->mipmapMode, sizeof(VkSamplerMipmapMode));
+    vkStream->read((VkSamplerAddressMode*)&forUnmarshaling->addressModeU,
+                   sizeof(VkSamplerAddressMode));
+    vkStream->read((VkSamplerAddressMode*)&forUnmarshaling->addressModeV,
+                   sizeof(VkSamplerAddressMode));
+    vkStream->read((VkSamplerAddressMode*)&forUnmarshaling->addressModeW,
+                   sizeof(VkSamplerAddressMode));
+    vkStream->read((float*)&forUnmarshaling->mipLodBias, sizeof(float));
+    vkStream->read((VkBool32*)&forUnmarshaling->anisotropyEnable, sizeof(VkBool32));
+    vkStream->read((float*)&forUnmarshaling->maxAnisotropy, sizeof(float));
+    vkStream->read((VkBool32*)&forUnmarshaling->compareEnable, sizeof(VkBool32));
+    vkStream->read((VkCompareOp*)&forUnmarshaling->compareOp, sizeof(VkCompareOp));
+    vkStream->read((float*)&forUnmarshaling->minLod, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->maxLod, sizeof(float));
+    vkStream->read((VkBorderColor*)&forUnmarshaling->borderColor, sizeof(VkBorderColor));
+    vkStream->read((VkBool32*)&forUnmarshaling->unnormalizedCoordinates, sizeof(VkBool32));
+}
+
+void marshal_VkCopyDescriptorSet(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkCopyDescriptorSet* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkDescriptorSet_u64(&forMarshaling->srcSet, &cgen_var_0,
+                                                              1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((uint32_t*)&forMarshaling->srcBinding, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->srcArrayElement, sizeof(uint32_t));
+    uint64_t cgen_var_1;
+    vkStream->handleMapping()->mapHandles_VkDescriptorSet_u64(&forMarshaling->dstSet, &cgen_var_1,
+                                                              1);
+    vkStream->write((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->write((uint32_t*)&forMarshaling->dstBinding, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->dstArrayElement, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->descriptorCount, sizeof(uint32_t));
+}
+
+void unmarshal_VkCopyDescriptorSet(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkCopyDescriptorSet* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkDescriptorSet(
+        &cgen_var_0, (VkDescriptorSet*)&forUnmarshaling->srcSet, 1);
+    vkStream->read((uint32_t*)&forUnmarshaling->srcBinding, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->srcArrayElement, sizeof(uint32_t));
+    uint64_t cgen_var_1;
+    vkStream->read((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkDescriptorSet(
+        &cgen_var_1, (VkDescriptorSet*)&forUnmarshaling->dstSet, 1);
+    vkStream->read((uint32_t*)&forUnmarshaling->dstBinding, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->dstArrayElement, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->descriptorCount, sizeof(uint32_t));
+}
+
+void marshal_VkDescriptorBufferInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkDescriptorBufferInfo* forMarshaling) {
+    (void)rootType;
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkBuffer_u64(&forMarshaling->buffer, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkDeviceSize*)&forMarshaling->offset, sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->range, sizeof(VkDeviceSize));
+}
+
+void unmarshal_VkDescriptorBufferInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      VkDescriptorBufferInfo* forUnmarshaling) {
+    (void)rootType;
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_0,
+                                                       (VkBuffer*)&forUnmarshaling->buffer, 1);
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->offset, sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->range, sizeof(VkDeviceSize));
+}
+
+void marshal_VkDescriptorImageInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkDescriptorImageInfo* forMarshaling) {
+    (void)rootType;
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkSampler_u64(&forMarshaling->sampler, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    uint64_t cgen_var_1;
+    vkStream->handleMapping()->mapHandles_VkImageView_u64(&forMarshaling->imageView, &cgen_var_1,
+                                                          1);
+    vkStream->write((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->write((VkImageLayout*)&forMarshaling->imageLayout, sizeof(VkImageLayout));
+}
+
+void unmarshal_VkDescriptorImageInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkDescriptorImageInfo* forUnmarshaling) {
+    (void)rootType;
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkSampler(&cgen_var_0,
+                                                        (VkSampler*)&forUnmarshaling->sampler, 1);
+    uint64_t cgen_var_1;
+    vkStream->read((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkImageView(
+        &cgen_var_1, (VkImageView*)&forUnmarshaling->imageView, 1);
+    vkStream->read((VkImageLayout*)&forUnmarshaling->imageLayout, sizeof(VkImageLayout));
+}
+
+void marshal_VkDescriptorPoolSize(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkDescriptorPoolSize* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkDescriptorType*)&forMarshaling->type, sizeof(VkDescriptorType));
+    vkStream->write((uint32_t*)&forMarshaling->descriptorCount, sizeof(uint32_t));
+}
+
+void unmarshal_VkDescriptorPoolSize(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkDescriptorPoolSize* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkDescriptorType*)&forUnmarshaling->type, sizeof(VkDescriptorType));
+    vkStream->read((uint32_t*)&forUnmarshaling->descriptorCount, sizeof(uint32_t));
+}
+
+void marshal_VkDescriptorPoolCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkDescriptorPoolCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDescriptorPoolCreateFlags*)&forMarshaling->flags,
+                    sizeof(VkDescriptorPoolCreateFlags));
+    vkStream->write((uint32_t*)&forMarshaling->maxSets, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->poolSizeCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->poolSizeCount; ++i) {
+            marshal_VkDescriptorPoolSize(
+                vkStream, rootType, (const VkDescriptorPoolSize*)(forMarshaling->pPoolSizes + i));
+        }
+    }
+}
+
+void unmarshal_VkDescriptorPoolCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkDescriptorPoolCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDescriptorPoolCreateFlags*)&forUnmarshaling->flags,
+                   sizeof(VkDescriptorPoolCreateFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxSets, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->poolSizeCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->poolSizeCount; ++i) {
+            unmarshal_VkDescriptorPoolSize(
+                vkStream, rootType, (VkDescriptorPoolSize*)(forUnmarshaling->pPoolSizes + i));
+        }
+    }
+}
+
+void marshal_VkDescriptorSetAllocateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkDescriptorSetAllocateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkDescriptorPool_u64(&forMarshaling->descriptorPool,
+                                                               &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((uint32_t*)&forMarshaling->descriptorSetCount, sizeof(uint32_t));
+    if (forMarshaling->descriptorSetCount) {
+        uint64_t* cgen_var_1;
+        vkStream->alloc((void**)&cgen_var_1, forMarshaling->descriptorSetCount * 8);
+        vkStream->handleMapping()->mapHandles_VkDescriptorSetLayout_u64(
+            forMarshaling->pSetLayouts, cgen_var_1, forMarshaling->descriptorSetCount);
+        vkStream->write((uint64_t*)cgen_var_1, forMarshaling->descriptorSetCount * 8);
+    }
+}
+
+void unmarshal_VkDescriptorSetAllocateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkDescriptorSetAllocateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkDescriptorPool(
+        &cgen_var_0, (VkDescriptorPool*)&forUnmarshaling->descriptorPool, 1);
+    vkStream->read((uint32_t*)&forUnmarshaling->descriptorSetCount, sizeof(uint32_t));
+    if (forUnmarshaling->descriptorSetCount) {
+        uint64_t* cgen_var_1;
+        vkStream->alloc((void**)&cgen_var_1, forUnmarshaling->descriptorSetCount * 8);
+        vkStream->read((uint64_t*)cgen_var_1, forUnmarshaling->descriptorSetCount * 8);
+        vkStream->handleMapping()->mapHandles_u64_VkDescriptorSetLayout(
+            cgen_var_1, (VkDescriptorSetLayout*)forUnmarshaling->pSetLayouts,
+            forUnmarshaling->descriptorSetCount);
+    }
+}
+
+void marshal_VkDescriptorSetLayoutBinding(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkDescriptorSetLayoutBinding* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->binding, sizeof(uint32_t));
+    vkStream->write((VkDescriptorType*)&forMarshaling->descriptorType, sizeof(VkDescriptorType));
+    vkStream->write((uint32_t*)&forMarshaling->descriptorCount, sizeof(uint32_t));
+    vkStream->write((VkShaderStageFlags*)&forMarshaling->stageFlags, sizeof(VkShaderStageFlags));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pImmutableSamplers;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pImmutableSamplers) {
+        if (forMarshaling->descriptorCount) {
+            uint64_t* cgen_var_0_0;
+            vkStream->alloc((void**)&cgen_var_0_0, forMarshaling->descriptorCount * 8);
+            vkStream->handleMapping()->mapHandles_VkSampler_u64(
+                forMarshaling->pImmutableSamplers, cgen_var_0_0, forMarshaling->descriptorCount);
+            vkStream->write((uint64_t*)cgen_var_0_0, forMarshaling->descriptorCount * 8);
+        }
+    }
+}
+
+void unmarshal_VkDescriptorSetLayoutBinding(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkDescriptorSetLayoutBinding* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->binding, sizeof(uint32_t));
+    vkStream->read((VkDescriptorType*)&forUnmarshaling->descriptorType, sizeof(VkDescriptorType));
+    vkStream->read((uint32_t*)&forUnmarshaling->descriptorCount, sizeof(uint32_t));
+    vkStream->read((VkShaderStageFlags*)&forUnmarshaling->stageFlags, sizeof(VkShaderStageFlags));
+    // WARNING PTR CHECK
+    const VkSampler* check_pImmutableSamplers;
+    check_pImmutableSamplers = (const VkSampler*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pImmutableSamplers) {
+        if (!(check_pImmutableSamplers)) {
+            fprintf(
+                stderr,
+                "fatal: forUnmarshaling->pImmutableSamplers inconsistent between guest and host\n");
+        }
+        if (forUnmarshaling->descriptorCount) {
+            uint64_t* cgen_var_0_0;
+            vkStream->alloc((void**)&cgen_var_0_0, forUnmarshaling->descriptorCount * 8);
+            vkStream->read((uint64_t*)cgen_var_0_0, forUnmarshaling->descriptorCount * 8);
+            vkStream->handleMapping()->mapHandles_u64_VkSampler(
+                cgen_var_0_0, (VkSampler*)forUnmarshaling->pImmutableSamplers,
+                forUnmarshaling->descriptorCount);
+        }
+    }
+}
+
+void marshal_VkDescriptorSetLayoutCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkDescriptorSetLayoutCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDescriptorSetLayoutCreateFlags*)&forMarshaling->flags,
+                    sizeof(VkDescriptorSetLayoutCreateFlags));
+    vkStream->write((uint32_t*)&forMarshaling->bindingCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->bindingCount; ++i) {
+            marshal_VkDescriptorSetLayoutBinding(
+                vkStream, rootType,
+                (const VkDescriptorSetLayoutBinding*)(forMarshaling->pBindings + i));
+        }
+    }
+}
+
+void unmarshal_VkDescriptorSetLayoutCreateInfo(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkDescriptorSetLayoutCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDescriptorSetLayoutCreateFlags*)&forUnmarshaling->flags,
+                   sizeof(VkDescriptorSetLayoutCreateFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->bindingCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->bindingCount; ++i) {
+            unmarshal_VkDescriptorSetLayoutBinding(
+                vkStream, rootType,
+                (VkDescriptorSetLayoutBinding*)(forUnmarshaling->pBindings + i));
+        }
+    }
+}
+
+void marshal_VkWriteDescriptorSet(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkWriteDescriptorSet* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkDescriptorSet_u64(&forMarshaling->dstSet, &cgen_var_0,
+                                                              1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((uint32_t*)&forMarshaling->dstBinding, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->dstArrayElement, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->descriptorCount, sizeof(uint32_t));
+    vkStream->write((VkDescriptorType*)&forMarshaling->descriptorType, sizeof(VkDescriptorType));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pImageInfo;
+    vkStream->putBe64(cgen_var_1);
+    if (forMarshaling->pImageInfo) {
+        if ((!(vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) ||
+             ((VK_DESCRIPTOR_TYPE_SAMPLER == forMarshaling->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER == forMarshaling->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE == forMarshaling->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_STORAGE_IMAGE == forMarshaling->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT == forMarshaling->descriptorType)))) {
+            if (forMarshaling) {
+                for (uint32_t i = 0; i < (uint32_t)forMarshaling->descriptorCount; ++i) {
+                    marshal_VkDescriptorImageInfo(
+                        vkStream, rootType,
+                        (const VkDescriptorImageInfo*)(forMarshaling->pImageInfo + i));
+                }
+            }
+        }
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)forMarshaling->pBufferInfo;
+    vkStream->putBe64(cgen_var_2);
+    if (forMarshaling->pBufferInfo) {
+        if ((!(vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) ||
+             ((VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER == forMarshaling->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC == forMarshaling->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_STORAGE_BUFFER == forMarshaling->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC == forMarshaling->descriptorType)))) {
+            if (forMarshaling) {
+                for (uint32_t i = 0; i < (uint32_t)forMarshaling->descriptorCount; ++i) {
+                    marshal_VkDescriptorBufferInfo(
+                        vkStream, rootType,
+                        (const VkDescriptorBufferInfo*)(forMarshaling->pBufferInfo + i));
+                }
+            }
+        }
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_3 = (uint64_t)(uintptr_t)forMarshaling->pTexelBufferView;
+    vkStream->putBe64(cgen_var_3);
+    if (forMarshaling->pTexelBufferView) {
+        if ((!(vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) ||
+             ((VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER == forMarshaling->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER == forMarshaling->descriptorType)))) {
+            if (forMarshaling->descriptorCount) {
+                uint64_t* cgen_var_3_0;
+                vkStream->alloc((void**)&cgen_var_3_0, forMarshaling->descriptorCount * 8);
+                vkStream->handleMapping()->mapHandles_VkBufferView_u64(
+                    forMarshaling->pTexelBufferView, cgen_var_3_0, forMarshaling->descriptorCount);
+                vkStream->write((uint64_t*)cgen_var_3_0, forMarshaling->descriptorCount * 8);
+            }
+        }
+    }
+}
+
+void unmarshal_VkWriteDescriptorSet(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkWriteDescriptorSet* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkDescriptorSet(
+        &cgen_var_0, (VkDescriptorSet*)&forUnmarshaling->dstSet, 1);
+    vkStream->read((uint32_t*)&forUnmarshaling->dstBinding, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->dstArrayElement, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->descriptorCount, sizeof(uint32_t));
+    vkStream->read((VkDescriptorType*)&forUnmarshaling->descriptorType, sizeof(VkDescriptorType));
+    // WARNING PTR CHECK
+    const VkDescriptorImageInfo* check_pImageInfo;
+    check_pImageInfo = (const VkDescriptorImageInfo*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pImageInfo) {
+        if (!(check_pImageInfo)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pImageInfo inconsistent between guest and host\n");
+        }
+        if ((!(vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) ||
+             ((VK_DESCRIPTOR_TYPE_SAMPLER == forUnmarshaling->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER == forUnmarshaling->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE == forUnmarshaling->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_STORAGE_IMAGE == forUnmarshaling->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT == forUnmarshaling->descriptorType)))) {
+            if (forUnmarshaling) {
+                for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->descriptorCount; ++i) {
+                    unmarshal_VkDescriptorImageInfo(
+                        vkStream, rootType,
+                        (VkDescriptorImageInfo*)(forUnmarshaling->pImageInfo + i));
+                }
+            }
+        } else {
+            forUnmarshaling->pImageInfo = 0;
+        }
+    }
+    // WARNING PTR CHECK
+    const VkDescriptorBufferInfo* check_pBufferInfo;
+    check_pBufferInfo = (const VkDescriptorBufferInfo*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pBufferInfo) {
+        if (!(check_pBufferInfo)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pBufferInfo inconsistent between guest and host\n");
+        }
+        if ((!(vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) ||
+             ((VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER == forUnmarshaling->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC == forUnmarshaling->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_STORAGE_BUFFER == forUnmarshaling->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC == forUnmarshaling->descriptorType)))) {
+            if (forUnmarshaling) {
+                for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->descriptorCount; ++i) {
+                    unmarshal_VkDescriptorBufferInfo(
+                        vkStream, rootType,
+                        (VkDescriptorBufferInfo*)(forUnmarshaling->pBufferInfo + i));
+                }
+            }
+        } else {
+            forUnmarshaling->pBufferInfo = 0;
+        }
+    }
+    // WARNING PTR CHECK
+    const VkBufferView* check_pTexelBufferView;
+    check_pTexelBufferView = (const VkBufferView*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pTexelBufferView) {
+        if (!(check_pTexelBufferView)) {
+            fprintf(
+                stderr,
+                "fatal: forUnmarshaling->pTexelBufferView inconsistent between guest and host\n");
+        }
+        if ((!(vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) ||
+             ((VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER == forUnmarshaling->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER == forUnmarshaling->descriptorType)))) {
+            if (forUnmarshaling->descriptorCount) {
+                uint64_t* cgen_var_3_0;
+                vkStream->alloc((void**)&cgen_var_3_0, forUnmarshaling->descriptorCount * 8);
+                vkStream->read((uint64_t*)cgen_var_3_0, forUnmarshaling->descriptorCount * 8);
+                vkStream->handleMapping()->mapHandles_u64_VkBufferView(
+                    cgen_var_3_0, (VkBufferView*)forUnmarshaling->pTexelBufferView,
+                    forUnmarshaling->descriptorCount);
+            }
+        } else {
+            forUnmarshaling->pTexelBufferView = 0;
+        }
+    }
+}
+
+void marshal_VkAttachmentDescription(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkAttachmentDescription* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkAttachmentDescriptionFlags*)&forMarshaling->flags,
+                    sizeof(VkAttachmentDescriptionFlags));
+    vkStream->write((VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+    vkStream->write((VkSampleCountFlagBits*)&forMarshaling->samples, sizeof(VkSampleCountFlagBits));
+    vkStream->write((VkAttachmentLoadOp*)&forMarshaling->loadOp, sizeof(VkAttachmentLoadOp));
+    vkStream->write((VkAttachmentStoreOp*)&forMarshaling->storeOp, sizeof(VkAttachmentStoreOp));
+    vkStream->write((VkAttachmentLoadOp*)&forMarshaling->stencilLoadOp, sizeof(VkAttachmentLoadOp));
+    vkStream->write((VkAttachmentStoreOp*)&forMarshaling->stencilStoreOp,
+                    sizeof(VkAttachmentStoreOp));
+    vkStream->write((VkImageLayout*)&forMarshaling->initialLayout, sizeof(VkImageLayout));
+    vkStream->write((VkImageLayout*)&forMarshaling->finalLayout, sizeof(VkImageLayout));
+}
+
+void unmarshal_VkAttachmentDescription(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkAttachmentDescription* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkAttachmentDescriptionFlags*)&forUnmarshaling->flags,
+                   sizeof(VkAttachmentDescriptionFlags));
+    vkStream->read((VkFormat*)&forUnmarshaling->format, sizeof(VkFormat));
+    vkStream->read((VkSampleCountFlagBits*)&forUnmarshaling->samples,
+                   sizeof(VkSampleCountFlagBits));
+    vkStream->read((VkAttachmentLoadOp*)&forUnmarshaling->loadOp, sizeof(VkAttachmentLoadOp));
+    vkStream->read((VkAttachmentStoreOp*)&forUnmarshaling->storeOp, sizeof(VkAttachmentStoreOp));
+    vkStream->read((VkAttachmentLoadOp*)&forUnmarshaling->stencilLoadOp,
+                   sizeof(VkAttachmentLoadOp));
+    vkStream->read((VkAttachmentStoreOp*)&forUnmarshaling->stencilStoreOp,
+                   sizeof(VkAttachmentStoreOp));
+    vkStream->read((VkImageLayout*)&forUnmarshaling->initialLayout, sizeof(VkImageLayout));
+    vkStream->read((VkImageLayout*)&forUnmarshaling->finalLayout, sizeof(VkImageLayout));
+}
+
+void marshal_VkAttachmentReference(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkAttachmentReference* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->attachment, sizeof(uint32_t));
+    vkStream->write((VkImageLayout*)&forMarshaling->layout, sizeof(VkImageLayout));
+}
+
+void unmarshal_VkAttachmentReference(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkAttachmentReference* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->attachment, sizeof(uint32_t));
+    vkStream->read((VkImageLayout*)&forUnmarshaling->layout, sizeof(VkImageLayout));
+}
+
+void marshal_VkFramebufferCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkFramebufferCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkFramebufferCreateFlags*)&forMarshaling->flags,
+                    sizeof(VkFramebufferCreateFlags));
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkRenderPass_u64(&forMarshaling->renderPass, &cgen_var_0,
+                                                           1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((uint32_t*)&forMarshaling->attachmentCount, sizeof(uint32_t));
+    if ((!(vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) ||
+         (((forMarshaling->flags & VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT) == 0)))) {
+        if (forMarshaling->attachmentCount) {
+            uint64_t* cgen_var_0_0;
+            vkStream->alloc((void**)&cgen_var_0_0, forMarshaling->attachmentCount * 8);
+            vkStream->handleMapping()->mapHandles_VkImageView_u64(
+                forMarshaling->pAttachments, cgen_var_0_0, forMarshaling->attachmentCount);
+            vkStream->write((uint64_t*)cgen_var_0_0, forMarshaling->attachmentCount * 8);
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->width, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->height, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->layers, sizeof(uint32_t));
+}
+
+void unmarshal_VkFramebufferCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkFramebufferCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkFramebufferCreateFlags*)&forUnmarshaling->flags,
+                   sizeof(VkFramebufferCreateFlags));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkRenderPass(
+        &cgen_var_0, (VkRenderPass*)&forUnmarshaling->renderPass, 1);
+    vkStream->read((uint32_t*)&forUnmarshaling->attachmentCount, sizeof(uint32_t));
+    if ((!(vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) ||
+         (((forUnmarshaling->flags & VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT) == 0)))) {
+        if (forUnmarshaling->attachmentCount) {
+            uint64_t* cgen_var_0_0;
+            vkStream->alloc((void**)&cgen_var_0_0, forUnmarshaling->attachmentCount * 8);
+            vkStream->read((uint64_t*)cgen_var_0_0, forUnmarshaling->attachmentCount * 8);
+            vkStream->handleMapping()->mapHandles_u64_VkImageView(
+                cgen_var_0_0, (VkImageView*)forUnmarshaling->pAttachments,
+                forUnmarshaling->attachmentCount);
+        }
+    } else {
+        forUnmarshaling->pAttachments = 0;
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->width, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->height, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->layers, sizeof(uint32_t));
+}
+
+void marshal_VkSubpassDescription(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkSubpassDescription* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkSubpassDescriptionFlags*)&forMarshaling->flags,
+                    sizeof(VkSubpassDescriptionFlags));
+    vkStream->write((VkPipelineBindPoint*)&forMarshaling->pipelineBindPoint,
+                    sizeof(VkPipelineBindPoint));
+    vkStream->write((uint32_t*)&forMarshaling->inputAttachmentCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->inputAttachmentCount; ++i) {
+            marshal_VkAttachmentReference(
+                vkStream, rootType,
+                (const VkAttachmentReference*)(forMarshaling->pInputAttachments + i));
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->colorAttachmentCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->colorAttachmentCount; ++i) {
+            marshal_VkAttachmentReference(
+                vkStream, rootType,
+                (const VkAttachmentReference*)(forMarshaling->pColorAttachments + i));
+        }
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pResolveAttachments;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pResolveAttachments) {
+        if (forMarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forMarshaling->colorAttachmentCount; ++i) {
+                marshal_VkAttachmentReference(
+                    vkStream, rootType,
+                    (const VkAttachmentReference*)(forMarshaling->pResolveAttachments + i));
+            }
+        }
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pDepthStencilAttachment;
+    vkStream->putBe64(cgen_var_1);
+    if (forMarshaling->pDepthStencilAttachment) {
+        marshal_VkAttachmentReference(
+            vkStream, rootType,
+            (const VkAttachmentReference*)(forMarshaling->pDepthStencilAttachment));
+    }
+    vkStream->write((uint32_t*)&forMarshaling->preserveAttachmentCount, sizeof(uint32_t));
+    vkStream->write((const uint32_t*)forMarshaling->pPreserveAttachments,
+                    forMarshaling->preserveAttachmentCount * sizeof(const uint32_t));
+}
+
+void unmarshal_VkSubpassDescription(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkSubpassDescription* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkSubpassDescriptionFlags*)&forUnmarshaling->flags,
+                   sizeof(VkSubpassDescriptionFlags));
+    vkStream->read((VkPipelineBindPoint*)&forUnmarshaling->pipelineBindPoint,
+                   sizeof(VkPipelineBindPoint));
+    vkStream->read((uint32_t*)&forUnmarshaling->inputAttachmentCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->inputAttachmentCount; ++i) {
+            unmarshal_VkAttachmentReference(
+                vkStream, rootType,
+                (VkAttachmentReference*)(forUnmarshaling->pInputAttachments + i));
+        }
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->colorAttachmentCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->colorAttachmentCount; ++i) {
+            unmarshal_VkAttachmentReference(
+                vkStream, rootType,
+                (VkAttachmentReference*)(forUnmarshaling->pColorAttachments + i));
+        }
+    }
+    // WARNING PTR CHECK
+    const VkAttachmentReference* check_pResolveAttachments;
+    check_pResolveAttachments = (const VkAttachmentReference*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pResolveAttachments) {
+        if (!(check_pResolveAttachments)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pResolveAttachments inconsistent between guest and "
+                    "host\n");
+        }
+        if (forUnmarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->colorAttachmentCount; ++i) {
+                unmarshal_VkAttachmentReference(
+                    vkStream, rootType,
+                    (VkAttachmentReference*)(forUnmarshaling->pResolveAttachments + i));
+            }
+        }
+    }
+    // WARNING PTR CHECK
+    const VkAttachmentReference* check_pDepthStencilAttachment;
+    check_pDepthStencilAttachment = (const VkAttachmentReference*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pDepthStencilAttachment) {
+        if (!(check_pDepthStencilAttachment)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pDepthStencilAttachment inconsistent between guest "
+                    "and host\n");
+        }
+        unmarshal_VkAttachmentReference(
+            vkStream, rootType, (VkAttachmentReference*)(forUnmarshaling->pDepthStencilAttachment));
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->preserveAttachmentCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)forUnmarshaling->pPreserveAttachments,
+                   forUnmarshaling->preserveAttachmentCount * sizeof(const uint32_t));
+}
+
+void marshal_VkSubpassDependency(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkSubpassDependency* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->srcSubpass, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->dstSubpass, sizeof(uint32_t));
+    vkStream->write((VkPipelineStageFlags*)&forMarshaling->srcStageMask,
+                    sizeof(VkPipelineStageFlags));
+    vkStream->write((VkPipelineStageFlags*)&forMarshaling->dstStageMask,
+                    sizeof(VkPipelineStageFlags));
+    vkStream->write((VkAccessFlags*)&forMarshaling->srcAccessMask, sizeof(VkAccessFlags));
+    vkStream->write((VkAccessFlags*)&forMarshaling->dstAccessMask, sizeof(VkAccessFlags));
+    vkStream->write((VkDependencyFlags*)&forMarshaling->dependencyFlags, sizeof(VkDependencyFlags));
+}
+
+void unmarshal_VkSubpassDependency(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkSubpassDependency* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->srcSubpass, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->dstSubpass, sizeof(uint32_t));
+    vkStream->read((VkPipelineStageFlags*)&forUnmarshaling->srcStageMask,
+                   sizeof(VkPipelineStageFlags));
+    vkStream->read((VkPipelineStageFlags*)&forUnmarshaling->dstStageMask,
+                   sizeof(VkPipelineStageFlags));
+    vkStream->read((VkAccessFlags*)&forUnmarshaling->srcAccessMask, sizeof(VkAccessFlags));
+    vkStream->read((VkAccessFlags*)&forUnmarshaling->dstAccessMask, sizeof(VkAccessFlags));
+    vkStream->read((VkDependencyFlags*)&forUnmarshaling->dependencyFlags,
+                   sizeof(VkDependencyFlags));
+}
+
+void marshal_VkRenderPassCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkRenderPassCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkRenderPassCreateFlags*)&forMarshaling->flags,
+                    sizeof(VkRenderPassCreateFlags));
+    vkStream->write((uint32_t*)&forMarshaling->attachmentCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->attachmentCount; ++i) {
+            marshal_VkAttachmentDescription(
+                vkStream, rootType,
+                (const VkAttachmentDescription*)(forMarshaling->pAttachments + i));
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->subpassCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->subpassCount; ++i) {
+            marshal_VkSubpassDescription(
+                vkStream, rootType, (const VkSubpassDescription*)(forMarshaling->pSubpasses + i));
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->dependencyCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->dependencyCount; ++i) {
+            marshal_VkSubpassDependency(
+                vkStream, rootType, (const VkSubpassDependency*)(forMarshaling->pDependencies + i));
+        }
+    }
+}
+
+void unmarshal_VkRenderPassCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      VkRenderPassCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkRenderPassCreateFlags*)&forUnmarshaling->flags,
+                   sizeof(VkRenderPassCreateFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->attachmentCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->attachmentCount; ++i) {
+            unmarshal_VkAttachmentDescription(
+                vkStream, rootType, (VkAttachmentDescription*)(forUnmarshaling->pAttachments + i));
+        }
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->subpassCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->subpassCount; ++i) {
+            unmarshal_VkSubpassDescription(
+                vkStream, rootType, (VkSubpassDescription*)(forUnmarshaling->pSubpasses + i));
+        }
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->dependencyCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->dependencyCount; ++i) {
+            unmarshal_VkSubpassDependency(
+                vkStream, rootType, (VkSubpassDependency*)(forUnmarshaling->pDependencies + i));
+        }
+    }
+}
+
+void marshal_VkCommandPoolCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkCommandPoolCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkCommandPoolCreateFlags*)&forMarshaling->flags,
+                    sizeof(VkCommandPoolCreateFlags));
+    vkStream->write((uint32_t*)&forMarshaling->queueFamilyIndex, sizeof(uint32_t));
+}
+
+void unmarshal_VkCommandPoolCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkCommandPoolCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkCommandPoolCreateFlags*)&forUnmarshaling->flags,
+                   sizeof(VkCommandPoolCreateFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->queueFamilyIndex, sizeof(uint32_t));
+}
+
+void marshal_VkCommandBufferAllocateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkCommandBufferAllocateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkCommandPool_u64(&forMarshaling->commandPool,
+                                                            &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkCommandBufferLevel*)&forMarshaling->level, sizeof(VkCommandBufferLevel));
+    vkStream->write((uint32_t*)&forMarshaling->commandBufferCount, sizeof(uint32_t));
+}
+
+void unmarshal_VkCommandBufferAllocateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkCommandBufferAllocateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkCommandPool(
+        &cgen_var_0, (VkCommandPool*)&forUnmarshaling->commandPool, 1);
+    vkStream->read((VkCommandBufferLevel*)&forUnmarshaling->level, sizeof(VkCommandBufferLevel));
+    vkStream->read((uint32_t*)&forUnmarshaling->commandBufferCount, sizeof(uint32_t));
+}
+
+void marshal_VkCommandBufferInheritanceInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkCommandBufferInheritanceInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkRenderPass_u64(&forMarshaling->renderPass, &cgen_var_0,
+                                                           1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((uint32_t*)&forMarshaling->subpass, sizeof(uint32_t));
+    uint64_t cgen_var_1;
+    vkStream->handleMapping()->mapHandles_VkFramebuffer_u64(&forMarshaling->framebuffer,
+                                                            &cgen_var_1, 1);
+    vkStream->write((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->write((VkBool32*)&forMarshaling->occlusionQueryEnable, sizeof(VkBool32));
+    vkStream->write((VkQueryControlFlags*)&forMarshaling->queryFlags, sizeof(VkQueryControlFlags));
+    vkStream->write((VkQueryPipelineStatisticFlags*)&forMarshaling->pipelineStatistics,
+                    sizeof(VkQueryPipelineStatisticFlags));
+}
+
+void unmarshal_VkCommandBufferInheritanceInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkCommandBufferInheritanceInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkRenderPass(
+        &cgen_var_0, (VkRenderPass*)&forUnmarshaling->renderPass, 1);
+    vkStream->read((uint32_t*)&forUnmarshaling->subpass, sizeof(uint32_t));
+    uint64_t cgen_var_1;
+    vkStream->read((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkFramebuffer(
+        &cgen_var_1, (VkFramebuffer*)&forUnmarshaling->framebuffer, 1);
+    vkStream->read((VkBool32*)&forUnmarshaling->occlusionQueryEnable, sizeof(VkBool32));
+    vkStream->read((VkQueryControlFlags*)&forUnmarshaling->queryFlags, sizeof(VkQueryControlFlags));
+    vkStream->read((VkQueryPipelineStatisticFlags*)&forUnmarshaling->pipelineStatistics,
+                   sizeof(VkQueryPipelineStatisticFlags));
+}
+
+void marshal_VkCommandBufferBeginInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkCommandBufferBeginInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkCommandBufferUsageFlags*)&forMarshaling->flags,
+                    sizeof(VkCommandBufferUsageFlags));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pInheritanceInfo;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pInheritanceInfo) {
+        marshal_VkCommandBufferInheritanceInfo(
+            vkStream, rootType,
+            (const VkCommandBufferInheritanceInfo*)(forMarshaling->pInheritanceInfo));
+    }
+}
+
+void unmarshal_VkCommandBufferBeginInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkCommandBufferBeginInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkCommandBufferUsageFlags*)&forUnmarshaling->flags,
+                   sizeof(VkCommandBufferUsageFlags));
+    // WARNING PTR CHECK
+    const VkCommandBufferInheritanceInfo* check_pInheritanceInfo;
+    check_pInheritanceInfo = (const VkCommandBufferInheritanceInfo*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pInheritanceInfo) {
+        if (!(check_pInheritanceInfo)) {
+            fprintf(
+                stderr,
+                "fatal: forUnmarshaling->pInheritanceInfo inconsistent between guest and host\n");
+        }
+        unmarshal_VkCommandBufferInheritanceInfo(
+            vkStream, rootType,
+            (VkCommandBufferInheritanceInfo*)(forUnmarshaling->pInheritanceInfo));
+    }
+}
+
+void marshal_VkBufferCopy(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                          const VkBufferCopy* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkDeviceSize*)&forMarshaling->srcOffset, sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->dstOffset, sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
+}
+
+void unmarshal_VkBufferCopy(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                            VkBufferCopy* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->srcOffset, sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->dstOffset, sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->size, sizeof(VkDeviceSize));
+}
+
+void marshal_VkImageSubresourceLayers(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkImageSubresourceLayers* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkImageAspectFlags*)&forMarshaling->aspectMask, sizeof(VkImageAspectFlags));
+    vkStream->write((uint32_t*)&forMarshaling->mipLevel, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->baseArrayLayer, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->layerCount, sizeof(uint32_t));
+}
+
+void unmarshal_VkImageSubresourceLayers(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkImageSubresourceLayers* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkImageAspectFlags*)&forUnmarshaling->aspectMask, sizeof(VkImageAspectFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->mipLevel, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->baseArrayLayer, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->layerCount, sizeof(uint32_t));
+}
+
+void marshal_VkBufferImageCopy(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               const VkBufferImageCopy* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkDeviceSize*)&forMarshaling->bufferOffset, sizeof(VkDeviceSize));
+    vkStream->write((uint32_t*)&forMarshaling->bufferRowLength, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->bufferImageHeight, sizeof(uint32_t));
+    marshal_VkImageSubresourceLayers(vkStream, rootType,
+                                     (VkImageSubresourceLayers*)(&forMarshaling->imageSubresource));
+    marshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forMarshaling->imageOffset));
+    marshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forMarshaling->imageExtent));
+}
+
+void unmarshal_VkBufferImageCopy(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 VkBufferImageCopy* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->bufferOffset, sizeof(VkDeviceSize));
+    vkStream->read((uint32_t*)&forUnmarshaling->bufferRowLength, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->bufferImageHeight, sizeof(uint32_t));
+    unmarshal_VkImageSubresourceLayers(
+        vkStream, rootType, (VkImageSubresourceLayers*)(&forUnmarshaling->imageSubresource));
+    unmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forUnmarshaling->imageOffset));
+    unmarshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forUnmarshaling->imageExtent));
+}
+
+void marshal_VkClearColorValue(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               const VkClearColorValue* forMarshaling) {
+    (void)rootType;
+    vkStream->write((float*)forMarshaling->float32, 4 * sizeof(float));
+}
+
+void unmarshal_VkClearColorValue(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 VkClearColorValue* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((float*)forUnmarshaling->float32, 4 * sizeof(float));
+}
+
+void marshal_VkClearDepthStencilValue(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkClearDepthStencilValue* forMarshaling) {
+    (void)rootType;
+    vkStream->write((float*)&forMarshaling->depth, sizeof(float));
+    vkStream->write((uint32_t*)&forMarshaling->stencil, sizeof(uint32_t));
+}
+
+void unmarshal_VkClearDepthStencilValue(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkClearDepthStencilValue* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((float*)&forUnmarshaling->depth, sizeof(float));
+    vkStream->read((uint32_t*)&forUnmarshaling->stencil, sizeof(uint32_t));
+}
+
+void marshal_VkClearValue(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                          const VkClearValue* forMarshaling) {
+    (void)rootType;
+    marshal_VkClearColorValue(vkStream, rootType, (VkClearColorValue*)(&forMarshaling->color));
+}
+
+void unmarshal_VkClearValue(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                            VkClearValue* forUnmarshaling) {
+    (void)rootType;
+    unmarshal_VkClearColorValue(vkStream, rootType, (VkClearColorValue*)(&forUnmarshaling->color));
+}
+
+void marshal_VkClearAttachment(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               const VkClearAttachment* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkImageAspectFlags*)&forMarshaling->aspectMask, sizeof(VkImageAspectFlags));
+    vkStream->write((uint32_t*)&forMarshaling->colorAttachment, sizeof(uint32_t));
+    marshal_VkClearValue(vkStream, rootType, (VkClearValue*)(&forMarshaling->clearValue));
+}
+
+void unmarshal_VkClearAttachment(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 VkClearAttachment* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkImageAspectFlags*)&forUnmarshaling->aspectMask, sizeof(VkImageAspectFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->colorAttachment, sizeof(uint32_t));
+    unmarshal_VkClearValue(vkStream, rootType, (VkClearValue*)(&forUnmarshaling->clearValue));
+}
+
+void marshal_VkClearRect(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                         const VkClearRect* forMarshaling) {
+    (void)rootType;
+    marshal_VkRect2D(vkStream, rootType, (VkRect2D*)(&forMarshaling->rect));
+    vkStream->write((uint32_t*)&forMarshaling->baseArrayLayer, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->layerCount, sizeof(uint32_t));
+}
+
+void unmarshal_VkClearRect(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                           VkClearRect* forUnmarshaling) {
+    (void)rootType;
+    unmarshal_VkRect2D(vkStream, rootType, (VkRect2D*)(&forUnmarshaling->rect));
+    vkStream->read((uint32_t*)&forUnmarshaling->baseArrayLayer, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->layerCount, sizeof(uint32_t));
+}
+
+void marshal_VkImageBlit(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                         const VkImageBlit* forMarshaling) {
+    (void)rootType;
+    marshal_VkImageSubresourceLayers(vkStream, rootType,
+                                     (VkImageSubresourceLayers*)(&forMarshaling->srcSubresource));
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        marshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(forMarshaling->srcOffsets + i));
+    }
+    marshal_VkImageSubresourceLayers(vkStream, rootType,
+                                     (VkImageSubresourceLayers*)(&forMarshaling->dstSubresource));
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        marshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(forMarshaling->dstOffsets + i));
+    }
+}
+
+void unmarshal_VkImageBlit(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                           VkImageBlit* forUnmarshaling) {
+    (void)rootType;
+    unmarshal_VkImageSubresourceLayers(
+        vkStream, rootType, (VkImageSubresourceLayers*)(&forUnmarshaling->srcSubresource));
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        unmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(forUnmarshaling->srcOffsets + i));
+    }
+    unmarshal_VkImageSubresourceLayers(
+        vkStream, rootType, (VkImageSubresourceLayers*)(&forUnmarshaling->dstSubresource));
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        unmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(forUnmarshaling->dstOffsets + i));
+    }
+}
+
+void marshal_VkImageCopy(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                         const VkImageCopy* forMarshaling) {
+    (void)rootType;
+    marshal_VkImageSubresourceLayers(vkStream, rootType,
+                                     (VkImageSubresourceLayers*)(&forMarshaling->srcSubresource));
+    marshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forMarshaling->srcOffset));
+    marshal_VkImageSubresourceLayers(vkStream, rootType,
+                                     (VkImageSubresourceLayers*)(&forMarshaling->dstSubresource));
+    marshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forMarshaling->dstOffset));
+    marshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forMarshaling->extent));
+}
+
+void unmarshal_VkImageCopy(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                           VkImageCopy* forUnmarshaling) {
+    (void)rootType;
+    unmarshal_VkImageSubresourceLayers(
+        vkStream, rootType, (VkImageSubresourceLayers*)(&forUnmarshaling->srcSubresource));
+    unmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forUnmarshaling->srcOffset));
+    unmarshal_VkImageSubresourceLayers(
+        vkStream, rootType, (VkImageSubresourceLayers*)(&forUnmarshaling->dstSubresource));
+    unmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forUnmarshaling->dstOffset));
+    unmarshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forUnmarshaling->extent));
+}
+
+void marshal_VkImageResolve(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                            const VkImageResolve* forMarshaling) {
+    (void)rootType;
+    marshal_VkImageSubresourceLayers(vkStream, rootType,
+                                     (VkImageSubresourceLayers*)(&forMarshaling->srcSubresource));
+    marshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forMarshaling->srcOffset));
+    marshal_VkImageSubresourceLayers(vkStream, rootType,
+                                     (VkImageSubresourceLayers*)(&forMarshaling->dstSubresource));
+    marshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forMarshaling->dstOffset));
+    marshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forMarshaling->extent));
+}
+
+void unmarshal_VkImageResolve(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                              VkImageResolve* forUnmarshaling) {
+    (void)rootType;
+    unmarshal_VkImageSubresourceLayers(
+        vkStream, rootType, (VkImageSubresourceLayers*)(&forUnmarshaling->srcSubresource));
+    unmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forUnmarshaling->srcOffset));
+    unmarshal_VkImageSubresourceLayers(
+        vkStream, rootType, (VkImageSubresourceLayers*)(&forUnmarshaling->dstSubresource));
+    unmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forUnmarshaling->dstOffset));
+    unmarshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forUnmarshaling->extent));
+}
+
+void marshal_VkRenderPassBeginInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkRenderPassBeginInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkRenderPass_u64(&forMarshaling->renderPass, &cgen_var_0,
+                                                           1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    uint64_t cgen_var_1;
+    vkStream->handleMapping()->mapHandles_VkFramebuffer_u64(&forMarshaling->framebuffer,
+                                                            &cgen_var_1, 1);
+    vkStream->write((uint64_t*)&cgen_var_1, 1 * 8);
+    marshal_VkRect2D(vkStream, rootType, (VkRect2D*)(&forMarshaling->renderArea));
+    vkStream->write((uint32_t*)&forMarshaling->clearValueCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)forMarshaling->pClearValues;
+    vkStream->putBe64(cgen_var_2);
+    if (forMarshaling->pClearValues) {
+        if (forMarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forMarshaling->clearValueCount; ++i) {
+                marshal_VkClearValue(vkStream, rootType,
+                                     (const VkClearValue*)(forMarshaling->pClearValues + i));
+            }
+        }
+    }
+}
+
+void unmarshal_VkRenderPassBeginInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkRenderPassBeginInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkRenderPass(
+        &cgen_var_0, (VkRenderPass*)&forUnmarshaling->renderPass, 1);
+    uint64_t cgen_var_1;
+    vkStream->read((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkFramebuffer(
+        &cgen_var_1, (VkFramebuffer*)&forUnmarshaling->framebuffer, 1);
+    unmarshal_VkRect2D(vkStream, rootType, (VkRect2D*)(&forUnmarshaling->renderArea));
+    vkStream->read((uint32_t*)&forUnmarshaling->clearValueCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const VkClearValue* check_pClearValues;
+    check_pClearValues = (const VkClearValue*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pClearValues) {
+        if (!(check_pClearValues)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pClearValues inconsistent between guest and host\n");
+        }
+        if (forUnmarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->clearValueCount; ++i) {
+                unmarshal_VkClearValue(vkStream, rootType,
+                                       (VkClearValue*)(forUnmarshaling->pClearValues + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_VERSION_1_1
+void marshal_VkPhysicalDeviceSubgroupProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSubgroupProperties* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->subgroupSize, sizeof(uint32_t));
+    vkStream->write((VkShaderStageFlags*)&forMarshaling->supportedStages,
+                    sizeof(VkShaderStageFlags));
+    vkStream->write((VkSubgroupFeatureFlags*)&forMarshaling->supportedOperations,
+                    sizeof(VkSubgroupFeatureFlags));
+    vkStream->write((VkBool32*)&forMarshaling->quadOperationsInAllStages, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceSubgroupProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceSubgroupProperties* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->subgroupSize, sizeof(uint32_t));
+    vkStream->read((VkShaderStageFlags*)&forUnmarshaling->supportedStages,
+                   sizeof(VkShaderStageFlags));
+    vkStream->read((VkSubgroupFeatureFlags*)&forUnmarshaling->supportedOperations,
+                   sizeof(VkSubgroupFeatureFlags));
+    vkStream->read((VkBool32*)&forUnmarshaling->quadOperationsInAllStages, sizeof(VkBool32));
+}
+
+void marshal_VkBindBufferMemoryInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkBindBufferMemoryInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkBuffer_u64(&forMarshaling->buffer, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    uint64_t cgen_var_1;
+    vkStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&forMarshaling->memory, &cgen_var_1,
+                                                             1);
+    vkStream->write((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->write((VkDeviceSize*)&forMarshaling->memoryOffset, sizeof(VkDeviceSize));
+}
+
+void unmarshal_VkBindBufferMemoryInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      VkBindBufferMemoryInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_0,
+                                                       (VkBuffer*)&forUnmarshaling->buffer, 1);
+    uint64_t cgen_var_1;
+    vkStream->read((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkDeviceMemory(
+        &cgen_var_1, (VkDeviceMemory*)&forUnmarshaling->memory, 1);
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->memoryOffset, sizeof(VkDeviceSize));
+}
+
+void marshal_VkBindImageMemoryInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkBindImageMemoryInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkImage_u64(&forMarshaling->image, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    uint64_t cgen_var_1;
+    vkStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&forMarshaling->memory, &cgen_var_1,
+                                                             1);
+    vkStream->write((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->write((VkDeviceSize*)&forMarshaling->memoryOffset, sizeof(VkDeviceSize));
+}
+
+void unmarshal_VkBindImageMemoryInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkBindImageMemoryInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_0,
+                                                      (VkImage*)&forUnmarshaling->image, 1);
+    uint64_t cgen_var_1;
+    vkStream->read((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkDeviceMemory(
+        &cgen_var_1, (VkDeviceMemory*)&forUnmarshaling->memory, 1);
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->memoryOffset, sizeof(VkDeviceSize));
+}
+
+void marshal_VkPhysicalDevice16BitStorageFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevice16BitStorageFeatures* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->storageBuffer16BitAccess, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->uniformAndStorageBuffer16BitAccess,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->storagePushConstant16, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->storageInputOutput16, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDevice16BitStorageFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevice16BitStorageFeatures* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->storageBuffer16BitAccess, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->uniformAndStorageBuffer16BitAccess,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->storagePushConstant16, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->storageInputOutput16, sizeof(VkBool32));
+}
+
+void marshal_VkMemoryDedicatedRequirements(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkMemoryDedicatedRequirements* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->prefersDedicatedAllocation, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->requiresDedicatedAllocation, sizeof(VkBool32));
+}
+
+void unmarshal_VkMemoryDedicatedRequirements(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkMemoryDedicatedRequirements* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->prefersDedicatedAllocation, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->requiresDedicatedAllocation, sizeof(VkBool32));
+}
+
+void marshal_VkMemoryDedicatedAllocateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkMemoryDedicatedAllocateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkImage_u64(&forMarshaling->image, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    uint64_t cgen_var_1;
+    vkStream->handleMapping()->mapHandles_VkBuffer_u64(&forMarshaling->buffer, &cgen_var_1, 1);
+    vkStream->write((uint64_t*)&cgen_var_1, 1 * 8);
+}
+
+void unmarshal_VkMemoryDedicatedAllocateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkMemoryDedicatedAllocateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_0,
+                                                      (VkImage*)&forUnmarshaling->image, 1);
+    uint64_t cgen_var_1;
+    vkStream->read((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_1,
+                                                       (VkBuffer*)&forUnmarshaling->buffer, 1);
+}
+
+void marshal_VkMemoryAllocateFlagsInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkMemoryAllocateFlagsInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkMemoryAllocateFlags*)&forMarshaling->flags, sizeof(VkMemoryAllocateFlags));
+    vkStream->write((uint32_t*)&forMarshaling->deviceMask, sizeof(uint32_t));
+}
+
+void unmarshal_VkMemoryAllocateFlagsInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkMemoryAllocateFlagsInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkMemoryAllocateFlags*)&forUnmarshaling->flags, sizeof(VkMemoryAllocateFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->deviceMask, sizeof(uint32_t));
+}
+
+void marshal_VkDeviceGroupRenderPassBeginInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceGroupRenderPassBeginInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->deviceMask, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->deviceRenderAreaCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->deviceRenderAreaCount; ++i) {
+            marshal_VkRect2D(vkStream, rootType,
+                             (const VkRect2D*)(forMarshaling->pDeviceRenderAreas + i));
+        }
+    }
+}
+
+void unmarshal_VkDeviceGroupRenderPassBeginInfo(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkDeviceGroupRenderPassBeginInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->deviceMask, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->deviceRenderAreaCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->deviceRenderAreaCount; ++i) {
+            unmarshal_VkRect2D(vkStream, rootType,
+                               (VkRect2D*)(forUnmarshaling->pDeviceRenderAreas + i));
+        }
+    }
+}
+
+void marshal_VkDeviceGroupCommandBufferBeginInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceGroupCommandBufferBeginInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->deviceMask, sizeof(uint32_t));
+}
+
+void unmarshal_VkDeviceGroupCommandBufferBeginInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDeviceGroupCommandBufferBeginInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->deviceMask, sizeof(uint32_t));
+}
+
+void marshal_VkDeviceGroupSubmitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkDeviceGroupSubmitInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->waitSemaphoreCount, sizeof(uint32_t));
+    vkStream->write((const uint32_t*)forMarshaling->pWaitSemaphoreDeviceIndices,
+                    forMarshaling->waitSemaphoreCount * sizeof(const uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->commandBufferCount, sizeof(uint32_t));
+    vkStream->write((const uint32_t*)forMarshaling->pCommandBufferDeviceMasks,
+                    forMarshaling->commandBufferCount * sizeof(const uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->signalSemaphoreCount, sizeof(uint32_t));
+    vkStream->write((const uint32_t*)forMarshaling->pSignalSemaphoreDeviceIndices,
+                    forMarshaling->signalSemaphoreCount * sizeof(const uint32_t));
+}
+
+void unmarshal_VkDeviceGroupSubmitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkDeviceGroupSubmitInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->waitSemaphoreCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)forUnmarshaling->pWaitSemaphoreDeviceIndices,
+                   forUnmarshaling->waitSemaphoreCount * sizeof(const uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->commandBufferCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)forUnmarshaling->pCommandBufferDeviceMasks,
+                   forUnmarshaling->commandBufferCount * sizeof(const uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->signalSemaphoreCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)forUnmarshaling->pSignalSemaphoreDeviceIndices,
+                   forUnmarshaling->signalSemaphoreCount * sizeof(const uint32_t));
+}
+
+void marshal_VkDeviceGroupBindSparseInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkDeviceGroupBindSparseInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->resourceDeviceIndex, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->memoryDeviceIndex, sizeof(uint32_t));
+}
+
+void unmarshal_VkDeviceGroupBindSparseInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkDeviceGroupBindSparseInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->resourceDeviceIndex, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->memoryDeviceIndex, sizeof(uint32_t));
+}
+
+void marshal_VkBindBufferMemoryDeviceGroupInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBindBufferMemoryDeviceGroupInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->deviceIndexCount, sizeof(uint32_t));
+    vkStream->write((const uint32_t*)forMarshaling->pDeviceIndices,
+                    forMarshaling->deviceIndexCount * sizeof(const uint32_t));
+}
+
+void unmarshal_VkBindBufferMemoryDeviceGroupInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkBindBufferMemoryDeviceGroupInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->deviceIndexCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)forUnmarshaling->pDeviceIndices,
+                   forUnmarshaling->deviceIndexCount * sizeof(const uint32_t));
+}
+
+void marshal_VkBindImageMemoryDeviceGroupInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBindImageMemoryDeviceGroupInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->deviceIndexCount, sizeof(uint32_t));
+    vkStream->write((const uint32_t*)forMarshaling->pDeviceIndices,
+                    forMarshaling->deviceIndexCount * sizeof(const uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->splitInstanceBindRegionCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->splitInstanceBindRegionCount; ++i) {
+            marshal_VkRect2D(vkStream, rootType,
+                             (const VkRect2D*)(forMarshaling->pSplitInstanceBindRegions + i));
+        }
+    }
+}
+
+void unmarshal_VkBindImageMemoryDeviceGroupInfo(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkBindImageMemoryDeviceGroupInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->deviceIndexCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)forUnmarshaling->pDeviceIndices,
+                   forUnmarshaling->deviceIndexCount * sizeof(const uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->splitInstanceBindRegionCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->splitInstanceBindRegionCount; ++i) {
+            unmarshal_VkRect2D(vkStream, rootType,
+                               (VkRect2D*)(forUnmarshaling->pSplitInstanceBindRegions + i));
+        }
+    }
+}
+
+void marshal_VkPhysicalDeviceGroupProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkPhysicalDeviceGroupProperties* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->physicalDeviceCount, sizeof(uint32_t));
+    vkStream->write((VkPhysicalDevice*)forMarshaling->physicalDevices,
+                    VK_MAX_DEVICE_GROUP_SIZE * sizeof(VkPhysicalDevice));
+    vkStream->write((VkBool32*)&forMarshaling->subsetAllocation, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceGroupProperties(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkPhysicalDeviceGroupProperties* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->physicalDeviceCount, sizeof(uint32_t));
+    vkStream->read((VkPhysicalDevice*)forUnmarshaling->physicalDevices,
+                   VK_MAX_DEVICE_GROUP_SIZE * sizeof(VkPhysicalDevice));
+    vkStream->read((VkBool32*)&forUnmarshaling->subsetAllocation, sizeof(VkBool32));
+}
+
+void marshal_VkDeviceGroupDeviceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkDeviceGroupDeviceCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->physicalDeviceCount, sizeof(uint32_t));
+    if (forMarshaling->physicalDeviceCount) {
+        uint64_t* cgen_var_0;
+        vkStream->alloc((void**)&cgen_var_0, forMarshaling->physicalDeviceCount * 8);
+        vkStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(
+            forMarshaling->pPhysicalDevices, cgen_var_0, forMarshaling->physicalDeviceCount);
+        vkStream->write((uint64_t*)cgen_var_0, forMarshaling->physicalDeviceCount * 8);
+    }
+}
+
+void unmarshal_VkDeviceGroupDeviceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkDeviceGroupDeviceCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->physicalDeviceCount, sizeof(uint32_t));
+    if (forUnmarshaling->physicalDeviceCount) {
+        uint64_t* cgen_var_0;
+        vkStream->alloc((void**)&cgen_var_0, forUnmarshaling->physicalDeviceCount * 8);
+        vkStream->read((uint64_t*)cgen_var_0, forUnmarshaling->physicalDeviceCount * 8);
+        vkStream->handleMapping()->mapHandles_u64_VkPhysicalDevice(
+            cgen_var_0, (VkPhysicalDevice*)forUnmarshaling->pPhysicalDevices,
+            forUnmarshaling->physicalDeviceCount);
+    }
+}
+
+void marshal_VkBufferMemoryRequirementsInfo2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkBufferMemoryRequirementsInfo2* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkBuffer_u64(&forMarshaling->buffer, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+}
+
+void unmarshal_VkBufferMemoryRequirementsInfo2(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkBufferMemoryRequirementsInfo2* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_0,
+                                                       (VkBuffer*)&forUnmarshaling->buffer, 1);
+}
+
+void marshal_VkImageMemoryRequirementsInfo2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkImageMemoryRequirementsInfo2* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkImage_u64(&forMarshaling->image, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+}
+
+void unmarshal_VkImageMemoryRequirementsInfo2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkImageMemoryRequirementsInfo2* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_0,
+                                                      (VkImage*)&forUnmarshaling->image, 1);
+}
+
+void marshal_VkImageSparseMemoryRequirementsInfo2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageSparseMemoryRequirementsInfo2* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkImage_u64(&forMarshaling->image, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+}
+
+void unmarshal_VkImageSparseMemoryRequirementsInfo2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkImageSparseMemoryRequirementsInfo2* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_0,
+                                                      (VkImage*)&forUnmarshaling->image, 1);
+}
+
+void marshal_VkMemoryRequirements2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkMemoryRequirements2* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkMemoryRequirements(vkStream, rootType,
+                                 (VkMemoryRequirements*)(&forMarshaling->memoryRequirements));
+}
+
+void unmarshal_VkMemoryRequirements2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkMemoryRequirements2* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkMemoryRequirements(vkStream, rootType,
+                                   (VkMemoryRequirements*)(&forUnmarshaling->memoryRequirements));
+}
+
+void marshal_VkSparseImageMemoryRequirements2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSparseImageMemoryRequirements2* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkSparseImageMemoryRequirements(
+        vkStream, rootType, (VkSparseImageMemoryRequirements*)(&forMarshaling->memoryRequirements));
+}
+
+void unmarshal_VkSparseImageMemoryRequirements2(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkSparseImageMemoryRequirements2* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkSparseImageMemoryRequirements(
+        vkStream, rootType,
+        (VkSparseImageMemoryRequirements*)(&forUnmarshaling->memoryRequirements));
+}
+
+void marshal_VkPhysicalDeviceFeatures2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkPhysicalDeviceFeatures2* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkPhysicalDeviceFeatures(vkStream, rootType,
+                                     (VkPhysicalDeviceFeatures*)(&forMarshaling->features));
+}
+
+void unmarshal_VkPhysicalDeviceFeatures2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkPhysicalDeviceFeatures2* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkPhysicalDeviceFeatures(vkStream, rootType,
+                                       (VkPhysicalDeviceFeatures*)(&forUnmarshaling->features));
+}
+
+void marshal_VkPhysicalDeviceProperties2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkPhysicalDeviceProperties2* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkPhysicalDeviceProperties(vkStream, rootType,
+                                       (VkPhysicalDeviceProperties*)(&forMarshaling->properties));
+}
+
+void unmarshal_VkPhysicalDeviceProperties2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkPhysicalDeviceProperties2* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkPhysicalDeviceProperties(
+        vkStream, rootType, (VkPhysicalDeviceProperties*)(&forUnmarshaling->properties));
+}
+
+void marshal_VkFormatProperties2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkFormatProperties2* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkFormatProperties(vkStream, rootType,
+                               (VkFormatProperties*)(&forMarshaling->formatProperties));
+}
+
+void unmarshal_VkFormatProperties2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkFormatProperties2* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkFormatProperties(vkStream, rootType,
+                                 (VkFormatProperties*)(&forUnmarshaling->formatProperties));
+}
+
+void marshal_VkImageFormatProperties2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkImageFormatProperties2* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkImageFormatProperties(
+        vkStream, rootType, (VkImageFormatProperties*)(&forMarshaling->imageFormatProperties));
+}
+
+void unmarshal_VkImageFormatProperties2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkImageFormatProperties2* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkImageFormatProperties(
+        vkStream, rootType, (VkImageFormatProperties*)(&forUnmarshaling->imageFormatProperties));
+}
+
+void marshal_VkPhysicalDeviceImageFormatInfo2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceImageFormatInfo2* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+    vkStream->write((VkImageType*)&forMarshaling->type, sizeof(VkImageType));
+    vkStream->write((VkImageTiling*)&forMarshaling->tiling, sizeof(VkImageTiling));
+    vkStream->write((VkImageUsageFlags*)&forMarshaling->usage, sizeof(VkImageUsageFlags));
+    vkStream->write((VkImageCreateFlags*)&forMarshaling->flags, sizeof(VkImageCreateFlags));
+}
+
+void unmarshal_VkPhysicalDeviceImageFormatInfo2(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkPhysicalDeviceImageFormatInfo2* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkFormat*)&forUnmarshaling->format, sizeof(VkFormat));
+    vkStream->read((VkImageType*)&forUnmarshaling->type, sizeof(VkImageType));
+    vkStream->read((VkImageTiling*)&forUnmarshaling->tiling, sizeof(VkImageTiling));
+    vkStream->read((VkImageUsageFlags*)&forUnmarshaling->usage, sizeof(VkImageUsageFlags));
+    vkStream->read((VkImageCreateFlags*)&forUnmarshaling->flags, sizeof(VkImageCreateFlags));
+}
+
+void marshal_VkQueueFamilyProperties2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkQueueFamilyProperties2* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkQueueFamilyProperties(
+        vkStream, rootType, (VkQueueFamilyProperties*)(&forMarshaling->queueFamilyProperties));
+}
+
+void unmarshal_VkQueueFamilyProperties2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkQueueFamilyProperties2* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkQueueFamilyProperties(
+        vkStream, rootType, (VkQueueFamilyProperties*)(&forUnmarshaling->queueFamilyProperties));
+}
+
+void marshal_VkPhysicalDeviceMemoryProperties2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMemoryProperties2* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkPhysicalDeviceMemoryProperties(
+        vkStream, rootType, (VkPhysicalDeviceMemoryProperties*)(&forMarshaling->memoryProperties));
+}
+
+void unmarshal_VkPhysicalDeviceMemoryProperties2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceMemoryProperties2* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkPhysicalDeviceMemoryProperties(
+        vkStream, rootType,
+        (VkPhysicalDeviceMemoryProperties*)(&forUnmarshaling->memoryProperties));
+}
+
+void marshal_VkSparseImageFormatProperties2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkSparseImageFormatProperties2* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkSparseImageFormatProperties(
+        vkStream, rootType, (VkSparseImageFormatProperties*)(&forMarshaling->properties));
+}
+
+void unmarshal_VkSparseImageFormatProperties2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkSparseImageFormatProperties2* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkSparseImageFormatProperties(
+        vkStream, rootType, (VkSparseImageFormatProperties*)(&forUnmarshaling->properties));
+}
+
+void marshal_VkPhysicalDeviceSparseImageFormatInfo2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSparseImageFormatInfo2* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+    vkStream->write((VkImageType*)&forMarshaling->type, sizeof(VkImageType));
+    vkStream->write((VkSampleCountFlagBits*)&forMarshaling->samples, sizeof(VkSampleCountFlagBits));
+    vkStream->write((VkImageUsageFlags*)&forMarshaling->usage, sizeof(VkImageUsageFlags));
+    vkStream->write((VkImageTiling*)&forMarshaling->tiling, sizeof(VkImageTiling));
+}
+
+void unmarshal_VkPhysicalDeviceSparseImageFormatInfo2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceSparseImageFormatInfo2* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkFormat*)&forUnmarshaling->format, sizeof(VkFormat));
+    vkStream->read((VkImageType*)&forUnmarshaling->type, sizeof(VkImageType));
+    vkStream->read((VkSampleCountFlagBits*)&forUnmarshaling->samples,
+                   sizeof(VkSampleCountFlagBits));
+    vkStream->read((VkImageUsageFlags*)&forUnmarshaling->usage, sizeof(VkImageUsageFlags));
+    vkStream->read((VkImageTiling*)&forUnmarshaling->tiling, sizeof(VkImageTiling));
+}
+
+void marshal_VkPhysicalDevicePointClippingProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePointClippingProperties* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPointClippingBehavior*)&forMarshaling->pointClippingBehavior,
+                    sizeof(VkPointClippingBehavior));
+}
+
+void unmarshal_VkPhysicalDevicePointClippingProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevicePointClippingProperties* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPointClippingBehavior*)&forUnmarshaling->pointClippingBehavior,
+                   sizeof(VkPointClippingBehavior));
+}
+
+void marshal_VkInputAttachmentAspectReference(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkInputAttachmentAspectReference* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->subpass, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->inputAttachmentIndex, sizeof(uint32_t));
+    vkStream->write((VkImageAspectFlags*)&forMarshaling->aspectMask, sizeof(VkImageAspectFlags));
+}
+
+void unmarshal_VkInputAttachmentAspectReference(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkInputAttachmentAspectReference* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->subpass, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->inputAttachmentIndex, sizeof(uint32_t));
+    vkStream->read((VkImageAspectFlags*)&forUnmarshaling->aspectMask, sizeof(VkImageAspectFlags));
+}
+
+void marshal_VkRenderPassInputAttachmentAspectCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRenderPassInputAttachmentAspectCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->aspectReferenceCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->aspectReferenceCount; ++i) {
+            marshal_VkInputAttachmentAspectReference(
+                vkStream, rootType,
+                (const VkInputAttachmentAspectReference*)(forMarshaling->pAspectReferences + i));
+        }
+    }
+}
+
+void unmarshal_VkRenderPassInputAttachmentAspectCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkRenderPassInputAttachmentAspectCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->aspectReferenceCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->aspectReferenceCount; ++i) {
+            unmarshal_VkInputAttachmentAspectReference(
+                vkStream, rootType,
+                (VkInputAttachmentAspectReference*)(forUnmarshaling->pAspectReferences + i));
+        }
+    }
+}
+
+void marshal_VkImageViewUsageCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkImageViewUsageCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkImageUsageFlags*)&forMarshaling->usage, sizeof(VkImageUsageFlags));
+}
+
+void unmarshal_VkImageViewUsageCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkImageViewUsageCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkImageUsageFlags*)&forUnmarshaling->usage, sizeof(VkImageUsageFlags));
+}
+
+void marshal_VkPipelineTessellationDomainOriginStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineTessellationDomainOriginStateCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkTessellationDomainOrigin*)&forMarshaling->domainOrigin,
+                    sizeof(VkTessellationDomainOrigin));
+}
+
+void unmarshal_VkPipelineTessellationDomainOriginStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineTessellationDomainOriginStateCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkTessellationDomainOrigin*)&forUnmarshaling->domainOrigin,
+                   sizeof(VkTessellationDomainOrigin));
+}
+
+void marshal_VkRenderPassMultiviewCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkRenderPassMultiviewCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->subpassCount, sizeof(uint32_t));
+    vkStream->write((const uint32_t*)forMarshaling->pViewMasks,
+                    forMarshaling->subpassCount * sizeof(const uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->dependencyCount, sizeof(uint32_t));
+    vkStream->write((const int32_t*)forMarshaling->pViewOffsets,
+                    forMarshaling->dependencyCount * sizeof(const int32_t));
+    vkStream->write((uint32_t*)&forMarshaling->correlationMaskCount, sizeof(uint32_t));
+    vkStream->write((const uint32_t*)forMarshaling->pCorrelationMasks,
+                    forMarshaling->correlationMaskCount * sizeof(const uint32_t));
+}
+
+void unmarshal_VkRenderPassMultiviewCreateInfo(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkRenderPassMultiviewCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->subpassCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)forUnmarshaling->pViewMasks,
+                   forUnmarshaling->subpassCount * sizeof(const uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->dependencyCount, sizeof(uint32_t));
+    vkStream->read((int32_t*)forUnmarshaling->pViewOffsets,
+                   forUnmarshaling->dependencyCount * sizeof(const int32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->correlationMaskCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)forUnmarshaling->pCorrelationMasks,
+                   forUnmarshaling->correlationMaskCount * sizeof(const uint32_t));
+}
+
+void marshal_VkPhysicalDeviceMultiviewFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMultiviewFeatures* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->multiview, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->multiviewGeometryShader, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->multiviewTessellationShader, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceMultiviewFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceMultiviewFeatures* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->multiview, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->multiviewGeometryShader, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->multiviewTessellationShader, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceMultiviewProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMultiviewProperties* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->maxMultiviewViewCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxMultiviewInstanceIndex, sizeof(uint32_t));
+}
+
+void unmarshal_VkPhysicalDeviceMultiviewProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceMultiviewProperties* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxMultiviewViewCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxMultiviewInstanceIndex, sizeof(uint32_t));
+}
+
+void marshal_VkPhysicalDeviceVariablePointersFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVariablePointersFeatures* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->variablePointersStorageBuffer, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->variablePointers, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceVariablePointersFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceVariablePointersFeatures* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->variablePointersStorageBuffer, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->variablePointers, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceProtectedMemoryFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceProtectedMemoryFeatures* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->protectedMemory, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceProtectedMemoryFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceProtectedMemoryFeatures* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->protectedMemory, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceProtectedMemoryProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceProtectedMemoryProperties* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->protectedNoFault, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceProtectedMemoryProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceProtectedMemoryProperties* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->protectedNoFault, sizeof(VkBool32));
+}
+
+void marshal_VkDeviceQueueInfo2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkDeviceQueueInfo2* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDeviceQueueCreateFlags*)&forMarshaling->flags,
+                    sizeof(VkDeviceQueueCreateFlags));
+    vkStream->write((uint32_t*)&forMarshaling->queueFamilyIndex, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->queueIndex, sizeof(uint32_t));
+}
+
+void unmarshal_VkDeviceQueueInfo2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkDeviceQueueInfo2* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDeviceQueueCreateFlags*)&forUnmarshaling->flags,
+                   sizeof(VkDeviceQueueCreateFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->queueFamilyIndex, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->queueIndex, sizeof(uint32_t));
+}
+
+void marshal_VkProtectedSubmitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkProtectedSubmitInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->protectedSubmit, sizeof(VkBool32));
+}
+
+void unmarshal_VkProtectedSubmitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkProtectedSubmitInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->protectedSubmit, sizeof(VkBool32));
+}
+
+void marshal_VkSamplerYcbcrConversionCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSamplerYcbcrConversionCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+    vkStream->write((VkSamplerYcbcrModelConversion*)&forMarshaling->ycbcrModel,
+                    sizeof(VkSamplerYcbcrModelConversion));
+    vkStream->write((VkSamplerYcbcrRange*)&forMarshaling->ycbcrRange, sizeof(VkSamplerYcbcrRange));
+    marshal_VkComponentMapping(vkStream, rootType,
+                               (VkComponentMapping*)(&forMarshaling->components));
+    vkStream->write((VkChromaLocation*)&forMarshaling->xChromaOffset, sizeof(VkChromaLocation));
+    vkStream->write((VkChromaLocation*)&forMarshaling->yChromaOffset, sizeof(VkChromaLocation));
+    vkStream->write((VkFilter*)&forMarshaling->chromaFilter, sizeof(VkFilter));
+    vkStream->write((VkBool32*)&forMarshaling->forceExplicitReconstruction, sizeof(VkBool32));
+}
+
+void unmarshal_VkSamplerYcbcrConversionCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkSamplerYcbcrConversionCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkFormat*)&forUnmarshaling->format, sizeof(VkFormat));
+    vkStream->read((VkSamplerYcbcrModelConversion*)&forUnmarshaling->ycbcrModel,
+                   sizeof(VkSamplerYcbcrModelConversion));
+    vkStream->read((VkSamplerYcbcrRange*)&forUnmarshaling->ycbcrRange, sizeof(VkSamplerYcbcrRange));
+    unmarshal_VkComponentMapping(vkStream, rootType,
+                                 (VkComponentMapping*)(&forUnmarshaling->components));
+    vkStream->read((VkChromaLocation*)&forUnmarshaling->xChromaOffset, sizeof(VkChromaLocation));
+    vkStream->read((VkChromaLocation*)&forUnmarshaling->yChromaOffset, sizeof(VkChromaLocation));
+    vkStream->read((VkFilter*)&forUnmarshaling->chromaFilter, sizeof(VkFilter));
+    vkStream->read((VkBool32*)&forUnmarshaling->forceExplicitReconstruction, sizeof(VkBool32));
+}
+
+void marshal_VkSamplerYcbcrConversionInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkSamplerYcbcrConversionInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(&forMarshaling->conversion,
+                                                                       &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+}
+
+void unmarshal_VkSamplerYcbcrConversionInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkSamplerYcbcrConversionInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkSamplerYcbcrConversion(
+        &cgen_var_0, (VkSamplerYcbcrConversion*)&forUnmarshaling->conversion, 1);
+}
+
+void marshal_VkBindImagePlaneMemoryInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkBindImagePlaneMemoryInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkImageAspectFlagBits*)&forMarshaling->planeAspect,
+                    sizeof(VkImageAspectFlagBits));
+}
+
+void unmarshal_VkBindImagePlaneMemoryInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkBindImagePlaneMemoryInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkImageAspectFlagBits*)&forUnmarshaling->planeAspect,
+                   sizeof(VkImageAspectFlagBits));
+}
+
+void marshal_VkImagePlaneMemoryRequirementsInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImagePlaneMemoryRequirementsInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkImageAspectFlagBits*)&forMarshaling->planeAspect,
+                    sizeof(VkImageAspectFlagBits));
+}
+
+void unmarshal_VkImagePlaneMemoryRequirementsInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkImagePlaneMemoryRequirementsInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkImageAspectFlagBits*)&forUnmarshaling->planeAspect,
+                   sizeof(VkImageAspectFlagBits));
+}
+
+void marshal_VkPhysicalDeviceSamplerYcbcrConversionFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSamplerYcbcrConversionFeatures* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->samplerYcbcrConversion, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceSamplerYcbcrConversionFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceSamplerYcbcrConversionFeatures* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->samplerYcbcrConversion, sizeof(VkBool32));
+}
+
+void marshal_VkSamplerYcbcrConversionImageFormatProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSamplerYcbcrConversionImageFormatProperties* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->combinedImageSamplerDescriptorCount,
+                    sizeof(uint32_t));
+}
+
+void unmarshal_VkSamplerYcbcrConversionImageFormatProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkSamplerYcbcrConversionImageFormatProperties* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->combinedImageSamplerDescriptorCount,
+                   sizeof(uint32_t));
+}
+
+void marshal_VkDescriptorUpdateTemplateEntry(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkDescriptorUpdateTemplateEntry* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->dstBinding, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->dstArrayElement, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->descriptorCount, sizeof(uint32_t));
+    vkStream->write((VkDescriptorType*)&forMarshaling->descriptorType, sizeof(VkDescriptorType));
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->offset;
+    vkStream->putBe64(cgen_var_0);
+    uint64_t cgen_var_1 = (uint64_t)forMarshaling->stride;
+    vkStream->putBe64(cgen_var_1);
+}
+
+void unmarshal_VkDescriptorUpdateTemplateEntry(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkDescriptorUpdateTemplateEntry* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->dstBinding, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->dstArrayElement, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->descriptorCount, sizeof(uint32_t));
+    vkStream->read((VkDescriptorType*)&forUnmarshaling->descriptorType, sizeof(VkDescriptorType));
+    forUnmarshaling->offset = (size_t)vkStream->getBe64();
+    forUnmarshaling->stride = (size_t)vkStream->getBe64();
+}
+
+void marshal_VkDescriptorUpdateTemplateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDescriptorUpdateTemplateCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDescriptorUpdateTemplateCreateFlags*)&forMarshaling->flags,
+                    sizeof(VkDescriptorUpdateTemplateCreateFlags));
+    vkStream->write((uint32_t*)&forMarshaling->descriptorUpdateEntryCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->descriptorUpdateEntryCount; ++i) {
+            marshal_VkDescriptorUpdateTemplateEntry(
+                vkStream, rootType,
+                (const VkDescriptorUpdateTemplateEntry*)(forMarshaling->pDescriptorUpdateEntries +
+                                                         i));
+        }
+    }
+    vkStream->write((VkDescriptorUpdateTemplateType*)&forMarshaling->templateType,
+                    sizeof(VkDescriptorUpdateTemplateType));
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkDescriptorSetLayout_u64(
+        &forMarshaling->descriptorSetLayout, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkPipelineBindPoint*)&forMarshaling->pipelineBindPoint,
+                    sizeof(VkPipelineBindPoint));
+    uint64_t cgen_var_1;
+    vkStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&forMarshaling->pipelineLayout,
+                                                               &cgen_var_1, 1);
+    vkStream->write((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->write((uint32_t*)&forMarshaling->set, sizeof(uint32_t));
+}
+
+void unmarshal_VkDescriptorUpdateTemplateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDescriptorUpdateTemplateCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDescriptorUpdateTemplateCreateFlags*)&forUnmarshaling->flags,
+                   sizeof(VkDescriptorUpdateTemplateCreateFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->descriptorUpdateEntryCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->descriptorUpdateEntryCount; ++i) {
+            unmarshal_VkDescriptorUpdateTemplateEntry(
+                vkStream, rootType,
+                (VkDescriptorUpdateTemplateEntry*)(forUnmarshaling->pDescriptorUpdateEntries + i));
+        }
+    }
+    vkStream->read((VkDescriptorUpdateTemplateType*)&forUnmarshaling->templateType,
+                   sizeof(VkDescriptorUpdateTemplateType));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkDescriptorSetLayout(
+        &cgen_var_0, (VkDescriptorSetLayout*)&forUnmarshaling->descriptorSetLayout, 1);
+    vkStream->read((VkPipelineBindPoint*)&forUnmarshaling->pipelineBindPoint,
+                   sizeof(VkPipelineBindPoint));
+    uint64_t cgen_var_1;
+    vkStream->read((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkPipelineLayout(
+        &cgen_var_1, (VkPipelineLayout*)&forUnmarshaling->pipelineLayout, 1);
+    vkStream->read((uint32_t*)&forUnmarshaling->set, sizeof(uint32_t));
+}
+
+void marshal_VkExternalMemoryProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkExternalMemoryProperties* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkExternalMemoryFeatureFlags*)&forMarshaling->externalMemoryFeatures,
+                    sizeof(VkExternalMemoryFeatureFlags));
+    vkStream->write((VkExternalMemoryHandleTypeFlags*)&forMarshaling->exportFromImportedHandleTypes,
+                    sizeof(VkExternalMemoryHandleTypeFlags));
+    vkStream->write((VkExternalMemoryHandleTypeFlags*)&forMarshaling->compatibleHandleTypes,
+                    sizeof(VkExternalMemoryHandleTypeFlags));
+}
+
+void unmarshal_VkExternalMemoryProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkExternalMemoryProperties* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkExternalMemoryFeatureFlags*)&forUnmarshaling->externalMemoryFeatures,
+                   sizeof(VkExternalMemoryFeatureFlags));
+    vkStream->read(
+        (VkExternalMemoryHandleTypeFlags*)&forUnmarshaling->exportFromImportedHandleTypes,
+        sizeof(VkExternalMemoryHandleTypeFlags));
+    vkStream->read((VkExternalMemoryHandleTypeFlags*)&forUnmarshaling->compatibleHandleTypes,
+                   sizeof(VkExternalMemoryHandleTypeFlags));
+}
+
+void marshal_VkPhysicalDeviceExternalImageFormatInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExternalImageFormatInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkExternalMemoryHandleTypeFlagBits*)&forMarshaling->handleType,
+                    sizeof(VkExternalMemoryHandleTypeFlagBits));
+}
+
+void unmarshal_VkPhysicalDeviceExternalImageFormatInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceExternalImageFormatInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkExternalMemoryHandleTypeFlagBits*)&forUnmarshaling->handleType,
+                   sizeof(VkExternalMemoryHandleTypeFlagBits));
+}
+
+void marshal_VkExternalImageFormatProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkExternalImageFormatProperties* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkExternalMemoryProperties(
+        vkStream, rootType,
+        (VkExternalMemoryProperties*)(&forMarshaling->externalMemoryProperties));
+}
+
+void unmarshal_VkExternalImageFormatProperties(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkExternalImageFormatProperties* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkExternalMemoryProperties(
+        vkStream, rootType,
+        (VkExternalMemoryProperties*)(&forUnmarshaling->externalMemoryProperties));
+}
+
+void marshal_VkPhysicalDeviceExternalBufferInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExternalBufferInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBufferCreateFlags*)&forMarshaling->flags, sizeof(VkBufferCreateFlags));
+    vkStream->write((VkBufferUsageFlags*)&forMarshaling->usage, sizeof(VkBufferUsageFlags));
+    vkStream->write((VkExternalMemoryHandleTypeFlagBits*)&forMarshaling->handleType,
+                    sizeof(VkExternalMemoryHandleTypeFlagBits));
+}
+
+void unmarshal_VkPhysicalDeviceExternalBufferInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceExternalBufferInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBufferCreateFlags*)&forUnmarshaling->flags, sizeof(VkBufferCreateFlags));
+    vkStream->read((VkBufferUsageFlags*)&forUnmarshaling->usage, sizeof(VkBufferUsageFlags));
+    vkStream->read((VkExternalMemoryHandleTypeFlagBits*)&forUnmarshaling->handleType,
+                   sizeof(VkExternalMemoryHandleTypeFlagBits));
+}
+
+void marshal_VkExternalBufferProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkExternalBufferProperties* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkExternalMemoryProperties(
+        vkStream, rootType,
+        (VkExternalMemoryProperties*)(&forMarshaling->externalMemoryProperties));
+}
+
+void unmarshal_VkExternalBufferProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkExternalBufferProperties* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkExternalMemoryProperties(
+        vkStream, rootType,
+        (VkExternalMemoryProperties*)(&forUnmarshaling->externalMemoryProperties));
+}
+
+void marshal_VkPhysicalDeviceIDProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkPhysicalDeviceIDProperties* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint8_t*)forMarshaling->deviceUUID, VK_UUID_SIZE * sizeof(uint8_t));
+    vkStream->write((uint8_t*)forMarshaling->driverUUID, VK_UUID_SIZE * sizeof(uint8_t));
+    vkStream->write((uint8_t*)forMarshaling->deviceLUID, VK_LUID_SIZE * sizeof(uint8_t));
+    vkStream->write((uint32_t*)&forMarshaling->deviceNodeMask, sizeof(uint32_t));
+    vkStream->write((VkBool32*)&forMarshaling->deviceLUIDValid, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceIDProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkPhysicalDeviceIDProperties* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint8_t*)forUnmarshaling->deviceUUID, VK_UUID_SIZE * sizeof(uint8_t));
+    vkStream->read((uint8_t*)forUnmarshaling->driverUUID, VK_UUID_SIZE * sizeof(uint8_t));
+    vkStream->read((uint8_t*)forUnmarshaling->deviceLUID, VK_LUID_SIZE * sizeof(uint8_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->deviceNodeMask, sizeof(uint32_t));
+    vkStream->read((VkBool32*)&forUnmarshaling->deviceLUIDValid, sizeof(VkBool32));
+}
+
+void marshal_VkExternalMemoryImageCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkExternalMemoryImageCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkExternalMemoryHandleTypeFlags*)&forMarshaling->handleTypes,
+                    sizeof(VkExternalMemoryHandleTypeFlags));
+}
+
+void unmarshal_VkExternalMemoryImageCreateInfo(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkExternalMemoryImageCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkExternalMemoryHandleTypeFlags*)&forUnmarshaling->handleTypes,
+                   sizeof(VkExternalMemoryHandleTypeFlags));
+}
+
+void marshal_VkExternalMemoryBufferCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExternalMemoryBufferCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkExternalMemoryHandleTypeFlags*)&forMarshaling->handleTypes,
+                    sizeof(VkExternalMemoryHandleTypeFlags));
+}
+
+void unmarshal_VkExternalMemoryBufferCreateInfo(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkExternalMemoryBufferCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkExternalMemoryHandleTypeFlags*)&forUnmarshaling->handleTypes,
+                   sizeof(VkExternalMemoryHandleTypeFlags));
+}
+
+void marshal_VkExportMemoryAllocateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkExportMemoryAllocateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkExternalMemoryHandleTypeFlags*)&forMarshaling->handleTypes,
+                    sizeof(VkExternalMemoryHandleTypeFlags));
+}
+
+void unmarshal_VkExportMemoryAllocateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkExportMemoryAllocateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkExternalMemoryHandleTypeFlags*)&forUnmarshaling->handleTypes,
+                   sizeof(VkExternalMemoryHandleTypeFlags));
+}
+
+void marshal_VkPhysicalDeviceExternalFenceInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExternalFenceInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkExternalFenceHandleTypeFlagBits*)&forMarshaling->handleType,
+                    sizeof(VkExternalFenceHandleTypeFlagBits));
+}
+
+void unmarshal_VkPhysicalDeviceExternalFenceInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceExternalFenceInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkExternalFenceHandleTypeFlagBits*)&forUnmarshaling->handleType,
+                   sizeof(VkExternalFenceHandleTypeFlagBits));
+}
+
+void marshal_VkExternalFenceProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkExternalFenceProperties* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkExternalFenceHandleTypeFlags*)&forMarshaling->exportFromImportedHandleTypes,
+                    sizeof(VkExternalFenceHandleTypeFlags));
+    vkStream->write((VkExternalFenceHandleTypeFlags*)&forMarshaling->compatibleHandleTypes,
+                    sizeof(VkExternalFenceHandleTypeFlags));
+    vkStream->write((VkExternalFenceFeatureFlags*)&forMarshaling->externalFenceFeatures,
+                    sizeof(VkExternalFenceFeatureFlags));
+}
+
+void unmarshal_VkExternalFenceProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkExternalFenceProperties* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkExternalFenceHandleTypeFlags*)&forUnmarshaling->exportFromImportedHandleTypes,
+                   sizeof(VkExternalFenceHandleTypeFlags));
+    vkStream->read((VkExternalFenceHandleTypeFlags*)&forUnmarshaling->compatibleHandleTypes,
+                   sizeof(VkExternalFenceHandleTypeFlags));
+    vkStream->read((VkExternalFenceFeatureFlags*)&forUnmarshaling->externalFenceFeatures,
+                   sizeof(VkExternalFenceFeatureFlags));
+}
+
+void marshal_VkExportFenceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkExportFenceCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkExternalFenceHandleTypeFlags*)&forMarshaling->handleTypes,
+                    sizeof(VkExternalFenceHandleTypeFlags));
+}
+
+void unmarshal_VkExportFenceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkExportFenceCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkExternalFenceHandleTypeFlags*)&forUnmarshaling->handleTypes,
+                   sizeof(VkExternalFenceHandleTypeFlags));
+}
+
+void marshal_VkExportSemaphoreCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkExportSemaphoreCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkExternalSemaphoreHandleTypeFlags*)&forMarshaling->handleTypes,
+                    sizeof(VkExternalSemaphoreHandleTypeFlags));
+}
+
+void unmarshal_VkExportSemaphoreCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkExportSemaphoreCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkExternalSemaphoreHandleTypeFlags*)&forUnmarshaling->handleTypes,
+                   sizeof(VkExternalSemaphoreHandleTypeFlags));
+}
+
+void marshal_VkPhysicalDeviceExternalSemaphoreInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExternalSemaphoreInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkExternalSemaphoreHandleTypeFlagBits*)&forMarshaling->handleType,
+                    sizeof(VkExternalSemaphoreHandleTypeFlagBits));
+}
+
+void unmarshal_VkPhysicalDeviceExternalSemaphoreInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceExternalSemaphoreInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkExternalSemaphoreHandleTypeFlagBits*)&forUnmarshaling->handleType,
+                   sizeof(VkExternalSemaphoreHandleTypeFlagBits));
+}
+
+void marshal_VkExternalSemaphoreProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkExternalSemaphoreProperties* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write(
+        (VkExternalSemaphoreHandleTypeFlags*)&forMarshaling->exportFromImportedHandleTypes,
+        sizeof(VkExternalSemaphoreHandleTypeFlags));
+    vkStream->write((VkExternalSemaphoreHandleTypeFlags*)&forMarshaling->compatibleHandleTypes,
+                    sizeof(VkExternalSemaphoreHandleTypeFlags));
+    vkStream->write((VkExternalSemaphoreFeatureFlags*)&forMarshaling->externalSemaphoreFeatures,
+                    sizeof(VkExternalSemaphoreFeatureFlags));
+}
+
+void unmarshal_VkExternalSemaphoreProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkExternalSemaphoreProperties* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read(
+        (VkExternalSemaphoreHandleTypeFlags*)&forUnmarshaling->exportFromImportedHandleTypes,
+        sizeof(VkExternalSemaphoreHandleTypeFlags));
+    vkStream->read((VkExternalSemaphoreHandleTypeFlags*)&forUnmarshaling->compatibleHandleTypes,
+                   sizeof(VkExternalSemaphoreHandleTypeFlags));
+    vkStream->read((VkExternalSemaphoreFeatureFlags*)&forUnmarshaling->externalSemaphoreFeatures,
+                   sizeof(VkExternalSemaphoreFeatureFlags));
+}
+
+void marshal_VkPhysicalDeviceMaintenance3Properties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMaintenance3Properties* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->maxPerSetDescriptors, sizeof(uint32_t));
+    vkStream->write((VkDeviceSize*)&forMarshaling->maxMemoryAllocationSize, sizeof(VkDeviceSize));
+}
+
+void unmarshal_VkPhysicalDeviceMaintenance3Properties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceMaintenance3Properties* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPerSetDescriptors, sizeof(uint32_t));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->maxMemoryAllocationSize, sizeof(VkDeviceSize));
+}
+
+void marshal_VkDescriptorSetLayoutSupport(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkDescriptorSetLayoutSupport* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->supported, sizeof(VkBool32));
+}
+
+void unmarshal_VkDescriptorSetLayoutSupport(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkDescriptorSetLayoutSupport* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->supported, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceShaderDrawParametersFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderDrawParametersFeatures* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->shaderDrawParameters, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceShaderDrawParametersFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderDrawParametersFeatures* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderDrawParameters, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_VERSION_1_2
+void marshal_VkPhysicalDeviceVulkan11Features(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVulkan11Features* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->storageBuffer16BitAccess, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->uniformAndStorageBuffer16BitAccess,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->storagePushConstant16, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->storageInputOutput16, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->multiview, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->multiviewGeometryShader, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->multiviewTessellationShader, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->variablePointersStorageBuffer, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->variablePointers, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->protectedMemory, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->samplerYcbcrConversion, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderDrawParameters, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceVulkan11Features(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkPhysicalDeviceVulkan11Features* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->storageBuffer16BitAccess, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->uniformAndStorageBuffer16BitAccess,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->storagePushConstant16, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->storageInputOutput16, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->multiview, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->multiviewGeometryShader, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->multiviewTessellationShader, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->variablePointersStorageBuffer, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->variablePointers, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->protectedMemory, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->samplerYcbcrConversion, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderDrawParameters, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceVulkan11Properties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVulkan11Properties* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint8_t*)forMarshaling->deviceUUID, VK_UUID_SIZE * sizeof(uint8_t));
+    vkStream->write((uint8_t*)forMarshaling->driverUUID, VK_UUID_SIZE * sizeof(uint8_t));
+    vkStream->write((uint8_t*)forMarshaling->deviceLUID, VK_LUID_SIZE * sizeof(uint8_t));
+    vkStream->write((uint32_t*)&forMarshaling->deviceNodeMask, sizeof(uint32_t));
+    vkStream->write((VkBool32*)&forMarshaling->deviceLUIDValid, sizeof(VkBool32));
+    vkStream->write((uint32_t*)&forMarshaling->subgroupSize, sizeof(uint32_t));
+    vkStream->write((VkShaderStageFlags*)&forMarshaling->subgroupSupportedStages,
+                    sizeof(VkShaderStageFlags));
+    vkStream->write((VkSubgroupFeatureFlags*)&forMarshaling->subgroupSupportedOperations,
+                    sizeof(VkSubgroupFeatureFlags));
+    vkStream->write((VkBool32*)&forMarshaling->subgroupQuadOperationsInAllStages, sizeof(VkBool32));
+    vkStream->write((VkPointClippingBehavior*)&forMarshaling->pointClippingBehavior,
+                    sizeof(VkPointClippingBehavior));
+    vkStream->write((uint32_t*)&forMarshaling->maxMultiviewViewCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxMultiviewInstanceIndex, sizeof(uint32_t));
+    vkStream->write((VkBool32*)&forMarshaling->protectedNoFault, sizeof(VkBool32));
+    vkStream->write((uint32_t*)&forMarshaling->maxPerSetDescriptors, sizeof(uint32_t));
+    vkStream->write((VkDeviceSize*)&forMarshaling->maxMemoryAllocationSize, sizeof(VkDeviceSize));
+}
+
+void unmarshal_VkPhysicalDeviceVulkan11Properties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceVulkan11Properties* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint8_t*)forUnmarshaling->deviceUUID, VK_UUID_SIZE * sizeof(uint8_t));
+    vkStream->read((uint8_t*)forUnmarshaling->driverUUID, VK_UUID_SIZE * sizeof(uint8_t));
+    vkStream->read((uint8_t*)forUnmarshaling->deviceLUID, VK_LUID_SIZE * sizeof(uint8_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->deviceNodeMask, sizeof(uint32_t));
+    vkStream->read((VkBool32*)&forUnmarshaling->deviceLUIDValid, sizeof(VkBool32));
+    vkStream->read((uint32_t*)&forUnmarshaling->subgroupSize, sizeof(uint32_t));
+    vkStream->read((VkShaderStageFlags*)&forUnmarshaling->subgroupSupportedStages,
+                   sizeof(VkShaderStageFlags));
+    vkStream->read((VkSubgroupFeatureFlags*)&forUnmarshaling->subgroupSupportedOperations,
+                   sizeof(VkSubgroupFeatureFlags));
+    vkStream->read((VkBool32*)&forUnmarshaling->subgroupQuadOperationsInAllStages,
+                   sizeof(VkBool32));
+    vkStream->read((VkPointClippingBehavior*)&forUnmarshaling->pointClippingBehavior,
+                   sizeof(VkPointClippingBehavior));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxMultiviewViewCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxMultiviewInstanceIndex, sizeof(uint32_t));
+    vkStream->read((VkBool32*)&forUnmarshaling->protectedNoFault, sizeof(VkBool32));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPerSetDescriptors, sizeof(uint32_t));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->maxMemoryAllocationSize, sizeof(VkDeviceSize));
+}
+
+void marshal_VkPhysicalDeviceVulkan12Features(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVulkan12Features* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->samplerMirrorClampToEdge, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->drawIndirectCount, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->storageBuffer8BitAccess, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->uniformAndStorageBuffer8BitAccess, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->storagePushConstant8, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderBufferInt64Atomics, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderSharedInt64Atomics, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderFloat16, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderInt8, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->descriptorIndexing, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderInputAttachmentArrayDynamicIndexing,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderUniformTexelBufferArrayDynamicIndexing,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderStorageTexelBufferArrayDynamicIndexing,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderUniformBufferArrayNonUniformIndexing,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderSampledImageArrayNonUniformIndexing,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderStorageBufferArrayNonUniformIndexing,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderStorageImageArrayNonUniformIndexing,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderInputAttachmentArrayNonUniformIndexing,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderUniformTexelBufferArrayNonUniformIndexing,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderStorageTexelBufferArrayNonUniformIndexing,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->descriptorBindingUniformBufferUpdateAfterBind,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->descriptorBindingSampledImageUpdateAfterBind,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->descriptorBindingStorageImageUpdateAfterBind,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->descriptorBindingStorageBufferUpdateAfterBind,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->descriptorBindingUniformTexelBufferUpdateAfterBind,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->descriptorBindingStorageTexelBufferUpdateAfterBind,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->descriptorBindingUpdateUnusedWhilePending,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->descriptorBindingPartiallyBound, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->descriptorBindingVariableDescriptorCount,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->runtimeDescriptorArray, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->samplerFilterMinmax, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->scalarBlockLayout, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->imagelessFramebuffer, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->uniformBufferStandardLayout, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderSubgroupExtendedTypes, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->separateDepthStencilLayouts, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->hostQueryReset, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->timelineSemaphore, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->bufferDeviceAddress, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->bufferDeviceAddressCaptureReplay, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->bufferDeviceAddressMultiDevice, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->vulkanMemoryModel, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->vulkanMemoryModelDeviceScope, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->vulkanMemoryModelAvailabilityVisibilityChains,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderOutputViewportIndex, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderOutputLayer, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->subgroupBroadcastDynamicId, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceVulkan12Features(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkPhysicalDeviceVulkan12Features* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->samplerMirrorClampToEdge, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->drawIndirectCount, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->storageBuffer8BitAccess, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->uniformAndStorageBuffer8BitAccess,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->storagePushConstant8, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderBufferInt64Atomics, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderSharedInt64Atomics, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderFloat16, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderInt8, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->descriptorIndexing, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderInputAttachmentArrayDynamicIndexing,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderUniformTexelBufferArrayDynamicIndexing,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderStorageTexelBufferArrayDynamicIndexing,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderUniformBufferArrayNonUniformIndexing,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderSampledImageArrayNonUniformIndexing,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderStorageBufferArrayNonUniformIndexing,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderStorageImageArrayNonUniformIndexing,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderInputAttachmentArrayNonUniformIndexing,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderUniformTexelBufferArrayNonUniformIndexing,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderStorageTexelBufferArrayNonUniformIndexing,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->descriptorBindingUniformBufferUpdateAfterBind,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->descriptorBindingSampledImageUpdateAfterBind,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->descriptorBindingStorageImageUpdateAfterBind,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->descriptorBindingStorageBufferUpdateAfterBind,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->descriptorBindingUniformTexelBufferUpdateAfterBind,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->descriptorBindingStorageTexelBufferUpdateAfterBind,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->descriptorBindingUpdateUnusedWhilePending,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->descriptorBindingPartiallyBound, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->descriptorBindingVariableDescriptorCount,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->runtimeDescriptorArray, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->samplerFilterMinmax, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->scalarBlockLayout, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->imagelessFramebuffer, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->uniformBufferStandardLayout, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderSubgroupExtendedTypes, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->separateDepthStencilLayouts, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->hostQueryReset, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->timelineSemaphore, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->bufferDeviceAddress, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->bufferDeviceAddressCaptureReplay, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->bufferDeviceAddressMultiDevice, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->vulkanMemoryModel, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->vulkanMemoryModelDeviceScope, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->vulkanMemoryModelAvailabilityVisibilityChains,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderOutputViewportIndex, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderOutputLayer, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->subgroupBroadcastDynamicId, sizeof(VkBool32));
+}
+
+void marshal_VkConformanceVersion(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkConformanceVersion* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint8_t*)&forMarshaling->major, sizeof(uint8_t));
+    vkStream->write((uint8_t*)&forMarshaling->minor, sizeof(uint8_t));
+    vkStream->write((uint8_t*)&forMarshaling->subminor, sizeof(uint8_t));
+    vkStream->write((uint8_t*)&forMarshaling->patch, sizeof(uint8_t));
+}
+
+void unmarshal_VkConformanceVersion(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkConformanceVersion* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint8_t*)&forUnmarshaling->major, sizeof(uint8_t));
+    vkStream->read((uint8_t*)&forUnmarshaling->minor, sizeof(uint8_t));
+    vkStream->read((uint8_t*)&forUnmarshaling->subminor, sizeof(uint8_t));
+    vkStream->read((uint8_t*)&forUnmarshaling->patch, sizeof(uint8_t));
+}
+
+void marshal_VkPhysicalDeviceVulkan12Properties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVulkan12Properties* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDriverId*)&forMarshaling->driverID, sizeof(VkDriverId));
+    vkStream->write((char*)forMarshaling->driverName, VK_MAX_DRIVER_NAME_SIZE * sizeof(char));
+    vkStream->write((char*)forMarshaling->driverInfo, VK_MAX_DRIVER_INFO_SIZE * sizeof(char));
+    marshal_VkConformanceVersion(vkStream, rootType,
+                                 (VkConformanceVersion*)(&forMarshaling->conformanceVersion));
+    vkStream->write((VkShaderFloatControlsIndependence*)&forMarshaling->denormBehaviorIndependence,
+                    sizeof(VkShaderFloatControlsIndependence));
+    vkStream->write((VkShaderFloatControlsIndependence*)&forMarshaling->roundingModeIndependence,
+                    sizeof(VkShaderFloatControlsIndependence));
+    vkStream->write((VkBool32*)&forMarshaling->shaderSignedZeroInfNanPreserveFloat16,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderSignedZeroInfNanPreserveFloat32,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderSignedZeroInfNanPreserveFloat64,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderDenormPreserveFloat16, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderDenormPreserveFloat32, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderDenormPreserveFloat64, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderDenormFlushToZeroFloat16, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderDenormFlushToZeroFloat32, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderDenormFlushToZeroFloat64, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderRoundingModeRTEFloat16, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderRoundingModeRTEFloat32, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderRoundingModeRTEFloat64, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderRoundingModeRTZFloat16, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderRoundingModeRTZFloat32, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderRoundingModeRTZFloat64, sizeof(VkBool32));
+    vkStream->write((uint32_t*)&forMarshaling->maxUpdateAfterBindDescriptorsInAllPools,
+                    sizeof(uint32_t));
+    vkStream->write((VkBool32*)&forMarshaling->shaderUniformBufferArrayNonUniformIndexingNative,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderSampledImageArrayNonUniformIndexingNative,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderStorageBufferArrayNonUniformIndexingNative,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderStorageImageArrayNonUniformIndexingNative,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderInputAttachmentArrayNonUniformIndexingNative,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->robustBufferAccessUpdateAfterBind, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->quadDivergentImplicitLod, sizeof(VkBool32));
+    vkStream->write((uint32_t*)&forMarshaling->maxPerStageDescriptorUpdateAfterBindSamplers,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxPerStageDescriptorUpdateAfterBindUniformBuffers,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxPerStageDescriptorUpdateAfterBindStorageBuffers,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxPerStageDescriptorUpdateAfterBindSampledImages,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxPerStageDescriptorUpdateAfterBindStorageImages,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxPerStageDescriptorUpdateAfterBindInputAttachments,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxPerStageUpdateAfterBindResources,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindSamplers,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindUniformBuffers,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindUniformBuffersDynamic,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindStorageBuffers,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindStorageBuffersDynamic,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindSampledImages,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindStorageImages,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindInputAttachments,
+                    sizeof(uint32_t));
+    vkStream->write((VkResolveModeFlags*)&forMarshaling->supportedDepthResolveModes,
+                    sizeof(VkResolveModeFlags));
+    vkStream->write((VkResolveModeFlags*)&forMarshaling->supportedStencilResolveModes,
+                    sizeof(VkResolveModeFlags));
+    vkStream->write((VkBool32*)&forMarshaling->independentResolveNone, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->independentResolve, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->filterMinmaxSingleComponentFormats,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->filterMinmaxImageComponentMapping, sizeof(VkBool32));
+    vkStream->write((uint64_t*)&forMarshaling->maxTimelineSemaphoreValueDifference,
+                    sizeof(uint64_t));
+    vkStream->write((VkSampleCountFlags*)&forMarshaling->framebufferIntegerColorSampleCounts,
+                    sizeof(VkSampleCountFlags));
+}
+
+void unmarshal_VkPhysicalDeviceVulkan12Properties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceVulkan12Properties* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDriverId*)&forUnmarshaling->driverID, sizeof(VkDriverId));
+    vkStream->read((char*)forUnmarshaling->driverName, VK_MAX_DRIVER_NAME_SIZE * sizeof(char));
+    vkStream->read((char*)forUnmarshaling->driverInfo, VK_MAX_DRIVER_INFO_SIZE * sizeof(char));
+    unmarshal_VkConformanceVersion(vkStream, rootType,
+                                   (VkConformanceVersion*)(&forUnmarshaling->conformanceVersion));
+    vkStream->read((VkShaderFloatControlsIndependence*)&forUnmarshaling->denormBehaviorIndependence,
+                   sizeof(VkShaderFloatControlsIndependence));
+    vkStream->read((VkShaderFloatControlsIndependence*)&forUnmarshaling->roundingModeIndependence,
+                   sizeof(VkShaderFloatControlsIndependence));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderSignedZeroInfNanPreserveFloat16,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderSignedZeroInfNanPreserveFloat32,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderSignedZeroInfNanPreserveFloat64,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderDenormPreserveFloat16, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderDenormPreserveFloat32, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderDenormPreserveFloat64, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderDenormFlushToZeroFloat16, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderDenormFlushToZeroFloat32, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderDenormFlushToZeroFloat64, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderRoundingModeRTEFloat16, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderRoundingModeRTEFloat32, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderRoundingModeRTEFloat64, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderRoundingModeRTZFloat16, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderRoundingModeRTZFloat32, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderRoundingModeRTZFloat64, sizeof(VkBool32));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxUpdateAfterBindDescriptorsInAllPools,
+                   sizeof(uint32_t));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderUniformBufferArrayNonUniformIndexingNative,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderSampledImageArrayNonUniformIndexingNative,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderStorageBufferArrayNonUniformIndexingNative,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderStorageImageArrayNonUniformIndexingNative,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderInputAttachmentArrayNonUniformIndexingNative,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->robustBufferAccessUpdateAfterBind,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->quadDivergentImplicitLod, sizeof(VkBool32));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPerStageDescriptorUpdateAfterBindSamplers,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPerStageDescriptorUpdateAfterBindUniformBuffers,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPerStageDescriptorUpdateAfterBindStorageBuffers,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPerStageDescriptorUpdateAfterBindSampledImages,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPerStageDescriptorUpdateAfterBindStorageImages,
+                   sizeof(uint32_t));
+    vkStream->read(
+        (uint32_t*)&forUnmarshaling->maxPerStageDescriptorUpdateAfterBindInputAttachments,
+        sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPerStageUpdateAfterBindResources,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetUpdateAfterBindSamplers,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetUpdateAfterBindUniformBuffers,
+                   sizeof(uint32_t));
+    vkStream->read(
+        (uint32_t*)&forUnmarshaling->maxDescriptorSetUpdateAfterBindUniformBuffersDynamic,
+        sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetUpdateAfterBindStorageBuffers,
+                   sizeof(uint32_t));
+    vkStream->read(
+        (uint32_t*)&forUnmarshaling->maxDescriptorSetUpdateAfterBindStorageBuffersDynamic,
+        sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetUpdateAfterBindSampledImages,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetUpdateAfterBindStorageImages,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetUpdateAfterBindInputAttachments,
+                   sizeof(uint32_t));
+    vkStream->read((VkResolveModeFlags*)&forUnmarshaling->supportedDepthResolveModes,
+                   sizeof(VkResolveModeFlags));
+    vkStream->read((VkResolveModeFlags*)&forUnmarshaling->supportedStencilResolveModes,
+                   sizeof(VkResolveModeFlags));
+    vkStream->read((VkBool32*)&forUnmarshaling->independentResolveNone, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->independentResolve, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->filterMinmaxSingleComponentFormats,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->filterMinmaxImageComponentMapping,
+                   sizeof(VkBool32));
+    vkStream->read((uint64_t*)&forUnmarshaling->maxTimelineSemaphoreValueDifference,
+                   sizeof(uint64_t));
+    vkStream->read((VkSampleCountFlags*)&forUnmarshaling->framebufferIntegerColorSampleCounts,
+                   sizeof(VkSampleCountFlags));
+}
+
+void marshal_VkImageFormatListCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkImageFormatListCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->viewFormatCount, sizeof(uint32_t));
+    vkStream->write((const VkFormat*)forMarshaling->pViewFormats,
+                    forMarshaling->viewFormatCount * sizeof(const VkFormat));
+}
+
+void unmarshal_VkImageFormatListCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkImageFormatListCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->viewFormatCount, sizeof(uint32_t));
+    vkStream->read((VkFormat*)forUnmarshaling->pViewFormats,
+                   forUnmarshaling->viewFormatCount * sizeof(const VkFormat));
+}
+
+void marshal_VkAttachmentDescription2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkAttachmentDescription2* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkAttachmentDescriptionFlags*)&forMarshaling->flags,
+                    sizeof(VkAttachmentDescriptionFlags));
+    vkStream->write((VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+    vkStream->write((VkSampleCountFlagBits*)&forMarshaling->samples, sizeof(VkSampleCountFlagBits));
+    vkStream->write((VkAttachmentLoadOp*)&forMarshaling->loadOp, sizeof(VkAttachmentLoadOp));
+    vkStream->write((VkAttachmentStoreOp*)&forMarshaling->storeOp, sizeof(VkAttachmentStoreOp));
+    vkStream->write((VkAttachmentLoadOp*)&forMarshaling->stencilLoadOp, sizeof(VkAttachmentLoadOp));
+    vkStream->write((VkAttachmentStoreOp*)&forMarshaling->stencilStoreOp,
+                    sizeof(VkAttachmentStoreOp));
+    vkStream->write((VkImageLayout*)&forMarshaling->initialLayout, sizeof(VkImageLayout));
+    vkStream->write((VkImageLayout*)&forMarshaling->finalLayout, sizeof(VkImageLayout));
+}
+
+void unmarshal_VkAttachmentDescription2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkAttachmentDescription2* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkAttachmentDescriptionFlags*)&forUnmarshaling->flags,
+                   sizeof(VkAttachmentDescriptionFlags));
+    vkStream->read((VkFormat*)&forUnmarshaling->format, sizeof(VkFormat));
+    vkStream->read((VkSampleCountFlagBits*)&forUnmarshaling->samples,
+                   sizeof(VkSampleCountFlagBits));
+    vkStream->read((VkAttachmentLoadOp*)&forUnmarshaling->loadOp, sizeof(VkAttachmentLoadOp));
+    vkStream->read((VkAttachmentStoreOp*)&forUnmarshaling->storeOp, sizeof(VkAttachmentStoreOp));
+    vkStream->read((VkAttachmentLoadOp*)&forUnmarshaling->stencilLoadOp,
+                   sizeof(VkAttachmentLoadOp));
+    vkStream->read((VkAttachmentStoreOp*)&forUnmarshaling->stencilStoreOp,
+                   sizeof(VkAttachmentStoreOp));
+    vkStream->read((VkImageLayout*)&forUnmarshaling->initialLayout, sizeof(VkImageLayout));
+    vkStream->read((VkImageLayout*)&forUnmarshaling->finalLayout, sizeof(VkImageLayout));
+}
+
+void marshal_VkAttachmentReference2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkAttachmentReference2* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->attachment, sizeof(uint32_t));
+    vkStream->write((VkImageLayout*)&forMarshaling->layout, sizeof(VkImageLayout));
+    vkStream->write((VkImageAspectFlags*)&forMarshaling->aspectMask, sizeof(VkImageAspectFlags));
+}
+
+void unmarshal_VkAttachmentReference2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      VkAttachmentReference2* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->attachment, sizeof(uint32_t));
+    vkStream->read((VkImageLayout*)&forUnmarshaling->layout, sizeof(VkImageLayout));
+    vkStream->read((VkImageAspectFlags*)&forUnmarshaling->aspectMask, sizeof(VkImageAspectFlags));
+}
+
+void marshal_VkSubpassDescription2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkSubpassDescription2* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkSubpassDescriptionFlags*)&forMarshaling->flags,
+                    sizeof(VkSubpassDescriptionFlags));
+    vkStream->write((VkPipelineBindPoint*)&forMarshaling->pipelineBindPoint,
+                    sizeof(VkPipelineBindPoint));
+    vkStream->write((uint32_t*)&forMarshaling->viewMask, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->inputAttachmentCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->inputAttachmentCount; ++i) {
+            marshal_VkAttachmentReference2(
+                vkStream, rootType,
+                (const VkAttachmentReference2*)(forMarshaling->pInputAttachments + i));
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->colorAttachmentCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->colorAttachmentCount; ++i) {
+            marshal_VkAttachmentReference2(
+                vkStream, rootType,
+                (const VkAttachmentReference2*)(forMarshaling->pColorAttachments + i));
+        }
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pResolveAttachments;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pResolveAttachments) {
+        if (forMarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forMarshaling->colorAttachmentCount; ++i) {
+                marshal_VkAttachmentReference2(
+                    vkStream, rootType,
+                    (const VkAttachmentReference2*)(forMarshaling->pResolveAttachments + i));
+            }
+        }
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pDepthStencilAttachment;
+    vkStream->putBe64(cgen_var_1);
+    if (forMarshaling->pDepthStencilAttachment) {
+        marshal_VkAttachmentReference2(
+            vkStream, rootType,
+            (const VkAttachmentReference2*)(forMarshaling->pDepthStencilAttachment));
+    }
+    vkStream->write((uint32_t*)&forMarshaling->preserveAttachmentCount, sizeof(uint32_t));
+    vkStream->write((const uint32_t*)forMarshaling->pPreserveAttachments,
+                    forMarshaling->preserveAttachmentCount * sizeof(const uint32_t));
+}
+
+void unmarshal_VkSubpassDescription2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkSubpassDescription2* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkSubpassDescriptionFlags*)&forUnmarshaling->flags,
+                   sizeof(VkSubpassDescriptionFlags));
+    vkStream->read((VkPipelineBindPoint*)&forUnmarshaling->pipelineBindPoint,
+                   sizeof(VkPipelineBindPoint));
+    vkStream->read((uint32_t*)&forUnmarshaling->viewMask, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->inputAttachmentCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->inputAttachmentCount; ++i) {
+            unmarshal_VkAttachmentReference2(
+                vkStream, rootType,
+                (VkAttachmentReference2*)(forUnmarshaling->pInputAttachments + i));
+        }
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->colorAttachmentCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->colorAttachmentCount; ++i) {
+            unmarshal_VkAttachmentReference2(
+                vkStream, rootType,
+                (VkAttachmentReference2*)(forUnmarshaling->pColorAttachments + i));
+        }
+    }
+    // WARNING PTR CHECK
+    const VkAttachmentReference2* check_pResolveAttachments;
+    check_pResolveAttachments = (const VkAttachmentReference2*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pResolveAttachments) {
+        if (!(check_pResolveAttachments)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pResolveAttachments inconsistent between guest and "
+                    "host\n");
+        }
+        if (forUnmarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->colorAttachmentCount; ++i) {
+                unmarshal_VkAttachmentReference2(
+                    vkStream, rootType,
+                    (VkAttachmentReference2*)(forUnmarshaling->pResolveAttachments + i));
+            }
+        }
+    }
+    // WARNING PTR CHECK
+    const VkAttachmentReference2* check_pDepthStencilAttachment;
+    check_pDepthStencilAttachment = (const VkAttachmentReference2*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pDepthStencilAttachment) {
+        if (!(check_pDepthStencilAttachment)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pDepthStencilAttachment inconsistent between guest "
+                    "and host\n");
+        }
+        unmarshal_VkAttachmentReference2(
+            vkStream, rootType,
+            (VkAttachmentReference2*)(forUnmarshaling->pDepthStencilAttachment));
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->preserveAttachmentCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)forUnmarshaling->pPreserveAttachments,
+                   forUnmarshaling->preserveAttachmentCount * sizeof(const uint32_t));
+}
+
+void marshal_VkSubpassDependency2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkSubpassDependency2* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->srcSubpass, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->dstSubpass, sizeof(uint32_t));
+    vkStream->write((VkPipelineStageFlags*)&forMarshaling->srcStageMask,
+                    sizeof(VkPipelineStageFlags));
+    vkStream->write((VkPipelineStageFlags*)&forMarshaling->dstStageMask,
+                    sizeof(VkPipelineStageFlags));
+    vkStream->write((VkAccessFlags*)&forMarshaling->srcAccessMask, sizeof(VkAccessFlags));
+    vkStream->write((VkAccessFlags*)&forMarshaling->dstAccessMask, sizeof(VkAccessFlags));
+    vkStream->write((VkDependencyFlags*)&forMarshaling->dependencyFlags, sizeof(VkDependencyFlags));
+    vkStream->write((int32_t*)&forMarshaling->viewOffset, sizeof(int32_t));
+}
+
+void unmarshal_VkSubpassDependency2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkSubpassDependency2* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->srcSubpass, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->dstSubpass, sizeof(uint32_t));
+    vkStream->read((VkPipelineStageFlags*)&forUnmarshaling->srcStageMask,
+                   sizeof(VkPipelineStageFlags));
+    vkStream->read((VkPipelineStageFlags*)&forUnmarshaling->dstStageMask,
+                   sizeof(VkPipelineStageFlags));
+    vkStream->read((VkAccessFlags*)&forUnmarshaling->srcAccessMask, sizeof(VkAccessFlags));
+    vkStream->read((VkAccessFlags*)&forUnmarshaling->dstAccessMask, sizeof(VkAccessFlags));
+    vkStream->read((VkDependencyFlags*)&forUnmarshaling->dependencyFlags,
+                   sizeof(VkDependencyFlags));
+    vkStream->read((int32_t*)&forUnmarshaling->viewOffset, sizeof(int32_t));
+}
+
+void marshal_VkRenderPassCreateInfo2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkRenderPassCreateInfo2* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkRenderPassCreateFlags*)&forMarshaling->flags,
+                    sizeof(VkRenderPassCreateFlags));
+    vkStream->write((uint32_t*)&forMarshaling->attachmentCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->attachmentCount; ++i) {
+            marshal_VkAttachmentDescription2(
+                vkStream, rootType,
+                (const VkAttachmentDescription2*)(forMarshaling->pAttachments + i));
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->subpassCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->subpassCount; ++i) {
+            marshal_VkSubpassDescription2(
+                vkStream, rootType, (const VkSubpassDescription2*)(forMarshaling->pSubpasses + i));
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->dependencyCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->dependencyCount; ++i) {
+            marshal_VkSubpassDependency2(
+                vkStream, rootType,
+                (const VkSubpassDependency2*)(forMarshaling->pDependencies + i));
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->correlatedViewMaskCount, sizeof(uint32_t));
+    vkStream->write((const uint32_t*)forMarshaling->pCorrelatedViewMasks,
+                    forMarshaling->correlatedViewMaskCount * sizeof(const uint32_t));
+}
+
+void unmarshal_VkRenderPassCreateInfo2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkRenderPassCreateInfo2* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkRenderPassCreateFlags*)&forUnmarshaling->flags,
+                   sizeof(VkRenderPassCreateFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->attachmentCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->attachmentCount; ++i) {
+            unmarshal_VkAttachmentDescription2(
+                vkStream, rootType, (VkAttachmentDescription2*)(forUnmarshaling->pAttachments + i));
+        }
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->subpassCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->subpassCount; ++i) {
+            unmarshal_VkSubpassDescription2(
+                vkStream, rootType, (VkSubpassDescription2*)(forUnmarshaling->pSubpasses + i));
+        }
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->dependencyCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->dependencyCount; ++i) {
+            unmarshal_VkSubpassDependency2(
+                vkStream, rootType, (VkSubpassDependency2*)(forUnmarshaling->pDependencies + i));
+        }
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->correlatedViewMaskCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)forUnmarshaling->pCorrelatedViewMasks,
+                   forUnmarshaling->correlatedViewMaskCount * sizeof(const uint32_t));
+}
+
+void marshal_VkSubpassBeginInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkSubpassBeginInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkSubpassContents*)&forMarshaling->contents, sizeof(VkSubpassContents));
+}
+
+void unmarshal_VkSubpassBeginInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkSubpassBeginInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkSubpassContents*)&forUnmarshaling->contents, sizeof(VkSubpassContents));
+}
+
+void marshal_VkSubpassEndInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                              const VkSubpassEndInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+}
+
+void unmarshal_VkSubpassEndInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                VkSubpassEndInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+}
+
+void marshal_VkPhysicalDevice8BitStorageFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevice8BitStorageFeatures* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->storageBuffer8BitAccess, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->uniformAndStorageBuffer8BitAccess, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->storagePushConstant8, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDevice8BitStorageFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevice8BitStorageFeatures* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->storageBuffer8BitAccess, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->uniformAndStorageBuffer8BitAccess,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->storagePushConstant8, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceDriverProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDriverProperties* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDriverId*)&forMarshaling->driverID, sizeof(VkDriverId));
+    vkStream->write((char*)forMarshaling->driverName, VK_MAX_DRIVER_NAME_SIZE * sizeof(char));
+    vkStream->write((char*)forMarshaling->driverInfo, VK_MAX_DRIVER_INFO_SIZE * sizeof(char));
+    marshal_VkConformanceVersion(vkStream, rootType,
+                                 (VkConformanceVersion*)(&forMarshaling->conformanceVersion));
+}
+
+void unmarshal_VkPhysicalDeviceDriverProperties(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkPhysicalDeviceDriverProperties* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDriverId*)&forUnmarshaling->driverID, sizeof(VkDriverId));
+    vkStream->read((char*)forUnmarshaling->driverName, VK_MAX_DRIVER_NAME_SIZE * sizeof(char));
+    vkStream->read((char*)forUnmarshaling->driverInfo, VK_MAX_DRIVER_INFO_SIZE * sizeof(char));
+    unmarshal_VkConformanceVersion(vkStream, rootType,
+                                   (VkConformanceVersion*)(&forUnmarshaling->conformanceVersion));
+}
+
+void marshal_VkPhysicalDeviceShaderAtomicInt64Features(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderAtomicInt64Features* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->shaderBufferInt64Atomics, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderSharedInt64Atomics, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceShaderAtomicInt64Features(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderAtomicInt64Features* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderBufferInt64Atomics, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderSharedInt64Atomics, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceShaderFloat16Int8Features(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderFloat16Int8Features* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->shaderFloat16, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderInt8, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceShaderFloat16Int8Features(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderFloat16Int8Features* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderFloat16, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderInt8, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceFloatControlsProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFloatControlsProperties* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkShaderFloatControlsIndependence*)&forMarshaling->denormBehaviorIndependence,
+                    sizeof(VkShaderFloatControlsIndependence));
+    vkStream->write((VkShaderFloatControlsIndependence*)&forMarshaling->roundingModeIndependence,
+                    sizeof(VkShaderFloatControlsIndependence));
+    vkStream->write((VkBool32*)&forMarshaling->shaderSignedZeroInfNanPreserveFloat16,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderSignedZeroInfNanPreserveFloat32,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderSignedZeroInfNanPreserveFloat64,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderDenormPreserveFloat16, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderDenormPreserveFloat32, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderDenormPreserveFloat64, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderDenormFlushToZeroFloat16, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderDenormFlushToZeroFloat32, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderDenormFlushToZeroFloat64, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderRoundingModeRTEFloat16, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderRoundingModeRTEFloat32, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderRoundingModeRTEFloat64, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderRoundingModeRTZFloat16, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderRoundingModeRTZFloat32, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderRoundingModeRTZFloat64, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceFloatControlsProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceFloatControlsProperties* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkShaderFloatControlsIndependence*)&forUnmarshaling->denormBehaviorIndependence,
+                   sizeof(VkShaderFloatControlsIndependence));
+    vkStream->read((VkShaderFloatControlsIndependence*)&forUnmarshaling->roundingModeIndependence,
+                   sizeof(VkShaderFloatControlsIndependence));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderSignedZeroInfNanPreserveFloat16,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderSignedZeroInfNanPreserveFloat32,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderSignedZeroInfNanPreserveFloat64,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderDenormPreserveFloat16, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderDenormPreserveFloat32, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderDenormPreserveFloat64, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderDenormFlushToZeroFloat16, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderDenormFlushToZeroFloat32, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderDenormFlushToZeroFloat64, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderRoundingModeRTEFloat16, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderRoundingModeRTEFloat32, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderRoundingModeRTEFloat64, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderRoundingModeRTZFloat16, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderRoundingModeRTZFloat32, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderRoundingModeRTZFloat64, sizeof(VkBool32));
+}
+
+void marshal_VkDescriptorSetLayoutBindingFlagsCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDescriptorSetLayoutBindingFlagsCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->bindingCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pBindingFlags;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pBindingFlags) {
+        vkStream->write((const VkDescriptorBindingFlags*)forMarshaling->pBindingFlags,
+                        forMarshaling->bindingCount * sizeof(const VkDescriptorBindingFlags));
+    }
+}
+
+void unmarshal_VkDescriptorSetLayoutBindingFlagsCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDescriptorSetLayoutBindingFlagsCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->bindingCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const VkDescriptorBindingFlags* check_pBindingFlags;
+    check_pBindingFlags = (const VkDescriptorBindingFlags*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pBindingFlags) {
+        if (!(check_pBindingFlags)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pBindingFlags inconsistent between guest and host\n");
+        }
+        vkStream->read((VkDescriptorBindingFlags*)forUnmarshaling->pBindingFlags,
+                       forUnmarshaling->bindingCount * sizeof(const VkDescriptorBindingFlags));
+    }
+}
+
+void marshal_VkPhysicalDeviceDescriptorIndexingFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDescriptorIndexingFeatures* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->shaderInputAttachmentArrayDynamicIndexing,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderUniformTexelBufferArrayDynamicIndexing,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderStorageTexelBufferArrayDynamicIndexing,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderUniformBufferArrayNonUniformIndexing,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderSampledImageArrayNonUniformIndexing,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderStorageBufferArrayNonUniformIndexing,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderStorageImageArrayNonUniformIndexing,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderInputAttachmentArrayNonUniformIndexing,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderUniformTexelBufferArrayNonUniformIndexing,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderStorageTexelBufferArrayNonUniformIndexing,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->descriptorBindingUniformBufferUpdateAfterBind,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->descriptorBindingSampledImageUpdateAfterBind,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->descriptorBindingStorageImageUpdateAfterBind,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->descriptorBindingStorageBufferUpdateAfterBind,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->descriptorBindingUniformTexelBufferUpdateAfterBind,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->descriptorBindingStorageTexelBufferUpdateAfterBind,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->descriptorBindingUpdateUnusedWhilePending,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->descriptorBindingPartiallyBound, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->descriptorBindingVariableDescriptorCount,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->runtimeDescriptorArray, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceDescriptorIndexingFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceDescriptorIndexingFeatures* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderInputAttachmentArrayDynamicIndexing,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderUniformTexelBufferArrayDynamicIndexing,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderStorageTexelBufferArrayDynamicIndexing,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderUniformBufferArrayNonUniformIndexing,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderSampledImageArrayNonUniformIndexing,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderStorageBufferArrayNonUniformIndexing,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderStorageImageArrayNonUniformIndexing,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderInputAttachmentArrayNonUniformIndexing,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderUniformTexelBufferArrayNonUniformIndexing,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderStorageTexelBufferArrayNonUniformIndexing,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->descriptorBindingUniformBufferUpdateAfterBind,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->descriptorBindingSampledImageUpdateAfterBind,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->descriptorBindingStorageImageUpdateAfterBind,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->descriptorBindingStorageBufferUpdateAfterBind,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->descriptorBindingUniformTexelBufferUpdateAfterBind,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->descriptorBindingStorageTexelBufferUpdateAfterBind,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->descriptorBindingUpdateUnusedWhilePending,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->descriptorBindingPartiallyBound, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->descriptorBindingVariableDescriptorCount,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->runtimeDescriptorArray, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceDescriptorIndexingProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDescriptorIndexingProperties* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->maxUpdateAfterBindDescriptorsInAllPools,
+                    sizeof(uint32_t));
+    vkStream->write((VkBool32*)&forMarshaling->shaderUniformBufferArrayNonUniformIndexingNative,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderSampledImageArrayNonUniformIndexingNative,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderStorageBufferArrayNonUniformIndexingNative,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderStorageImageArrayNonUniformIndexingNative,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderInputAttachmentArrayNonUniformIndexingNative,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->robustBufferAccessUpdateAfterBind, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->quadDivergentImplicitLod, sizeof(VkBool32));
+    vkStream->write((uint32_t*)&forMarshaling->maxPerStageDescriptorUpdateAfterBindSamplers,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxPerStageDescriptorUpdateAfterBindUniformBuffers,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxPerStageDescriptorUpdateAfterBindStorageBuffers,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxPerStageDescriptorUpdateAfterBindSampledImages,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxPerStageDescriptorUpdateAfterBindStorageImages,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxPerStageDescriptorUpdateAfterBindInputAttachments,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxPerStageUpdateAfterBindResources,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindSamplers,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindUniformBuffers,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindUniformBuffersDynamic,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindStorageBuffers,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindStorageBuffersDynamic,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindSampledImages,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindStorageImages,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindInputAttachments,
+                    sizeof(uint32_t));
+}
+
+void unmarshal_VkPhysicalDeviceDescriptorIndexingProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceDescriptorIndexingProperties* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxUpdateAfterBindDescriptorsInAllPools,
+                   sizeof(uint32_t));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderUniformBufferArrayNonUniformIndexingNative,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderSampledImageArrayNonUniformIndexingNative,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderStorageBufferArrayNonUniformIndexingNative,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderStorageImageArrayNonUniformIndexingNative,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderInputAttachmentArrayNonUniformIndexingNative,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->robustBufferAccessUpdateAfterBind,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->quadDivergentImplicitLod, sizeof(VkBool32));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPerStageDescriptorUpdateAfterBindSamplers,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPerStageDescriptorUpdateAfterBindUniformBuffers,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPerStageDescriptorUpdateAfterBindStorageBuffers,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPerStageDescriptorUpdateAfterBindSampledImages,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPerStageDescriptorUpdateAfterBindStorageImages,
+                   sizeof(uint32_t));
+    vkStream->read(
+        (uint32_t*)&forUnmarshaling->maxPerStageDescriptorUpdateAfterBindInputAttachments,
+        sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPerStageUpdateAfterBindResources,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetUpdateAfterBindSamplers,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetUpdateAfterBindUniformBuffers,
+                   sizeof(uint32_t));
+    vkStream->read(
+        (uint32_t*)&forUnmarshaling->maxDescriptorSetUpdateAfterBindUniformBuffersDynamic,
+        sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetUpdateAfterBindStorageBuffers,
+                   sizeof(uint32_t));
+    vkStream->read(
+        (uint32_t*)&forUnmarshaling->maxDescriptorSetUpdateAfterBindStorageBuffersDynamic,
+        sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetUpdateAfterBindSampledImages,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetUpdateAfterBindStorageImages,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetUpdateAfterBindInputAttachments,
+                   sizeof(uint32_t));
+}
+
+void marshal_VkDescriptorSetVariableDescriptorCountAllocateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDescriptorSetVariableDescriptorCountAllocateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->descriptorSetCount, sizeof(uint32_t));
+    vkStream->write((const uint32_t*)forMarshaling->pDescriptorCounts,
+                    forMarshaling->descriptorSetCount * sizeof(const uint32_t));
+}
+
+void unmarshal_VkDescriptorSetVariableDescriptorCountAllocateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDescriptorSetVariableDescriptorCountAllocateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->descriptorSetCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)forUnmarshaling->pDescriptorCounts,
+                   forUnmarshaling->descriptorSetCount * sizeof(const uint32_t));
+}
+
+void marshal_VkDescriptorSetVariableDescriptorCountLayoutSupport(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDescriptorSetVariableDescriptorCountLayoutSupport* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->maxVariableDescriptorCount, sizeof(uint32_t));
+}
+
+void unmarshal_VkDescriptorSetVariableDescriptorCountLayoutSupport(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDescriptorSetVariableDescriptorCountLayoutSupport* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxVariableDescriptorCount, sizeof(uint32_t));
+}
+
+void marshal_VkSubpassDescriptionDepthStencilResolve(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSubpassDescriptionDepthStencilResolve* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkResolveModeFlagBits*)&forMarshaling->depthResolveMode,
+                    sizeof(VkResolveModeFlagBits));
+    vkStream->write((VkResolveModeFlagBits*)&forMarshaling->stencilResolveMode,
+                    sizeof(VkResolveModeFlagBits));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pDepthStencilResolveAttachment;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pDepthStencilResolveAttachment) {
+        marshal_VkAttachmentReference2(
+            vkStream, rootType,
+            (const VkAttachmentReference2*)(forMarshaling->pDepthStencilResolveAttachment));
+    }
+}
+
+void unmarshal_VkSubpassDescriptionDepthStencilResolve(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkSubpassDescriptionDepthStencilResolve* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkResolveModeFlagBits*)&forUnmarshaling->depthResolveMode,
+                   sizeof(VkResolveModeFlagBits));
+    vkStream->read((VkResolveModeFlagBits*)&forUnmarshaling->stencilResolveMode,
+                   sizeof(VkResolveModeFlagBits));
+    // WARNING PTR CHECK
+    const VkAttachmentReference2* check_pDepthStencilResolveAttachment;
+    check_pDepthStencilResolveAttachment =
+        (const VkAttachmentReference2*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pDepthStencilResolveAttachment) {
+        if (!(check_pDepthStencilResolveAttachment)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pDepthStencilResolveAttachment inconsistent between "
+                    "guest and host\n");
+        }
+        unmarshal_VkAttachmentReference2(
+            vkStream, rootType,
+            (VkAttachmentReference2*)(forUnmarshaling->pDepthStencilResolveAttachment));
+    }
+}
+
+void marshal_VkPhysicalDeviceDepthStencilResolveProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDepthStencilResolveProperties* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkResolveModeFlags*)&forMarshaling->supportedDepthResolveModes,
+                    sizeof(VkResolveModeFlags));
+    vkStream->write((VkResolveModeFlags*)&forMarshaling->supportedStencilResolveModes,
+                    sizeof(VkResolveModeFlags));
+    vkStream->write((VkBool32*)&forMarshaling->independentResolveNone, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->independentResolve, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceDepthStencilResolveProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceDepthStencilResolveProperties* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkResolveModeFlags*)&forUnmarshaling->supportedDepthResolveModes,
+                   sizeof(VkResolveModeFlags));
+    vkStream->read((VkResolveModeFlags*)&forUnmarshaling->supportedStencilResolveModes,
+                   sizeof(VkResolveModeFlags));
+    vkStream->read((VkBool32*)&forUnmarshaling->independentResolveNone, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->independentResolve, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceScalarBlockLayoutFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceScalarBlockLayoutFeatures* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->scalarBlockLayout, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceScalarBlockLayoutFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceScalarBlockLayoutFeatures* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->scalarBlockLayout, sizeof(VkBool32));
+}
+
+void marshal_VkImageStencilUsageCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkImageStencilUsageCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkImageUsageFlags*)&forMarshaling->stencilUsage, sizeof(VkImageUsageFlags));
+}
+
+void unmarshal_VkImageStencilUsageCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkImageStencilUsageCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkImageUsageFlags*)&forUnmarshaling->stencilUsage, sizeof(VkImageUsageFlags));
+}
+
+void marshal_VkSamplerReductionModeCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSamplerReductionModeCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkSamplerReductionMode*)&forMarshaling->reductionMode,
+                    sizeof(VkSamplerReductionMode));
+}
+
+void unmarshal_VkSamplerReductionModeCreateInfo(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkSamplerReductionModeCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkSamplerReductionMode*)&forUnmarshaling->reductionMode,
+                   sizeof(VkSamplerReductionMode));
+}
+
+void marshal_VkPhysicalDeviceSamplerFilterMinmaxProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSamplerFilterMinmaxProperties* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->filterMinmaxSingleComponentFormats,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->filterMinmaxImageComponentMapping, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceSamplerFilterMinmaxProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceSamplerFilterMinmaxProperties* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->filterMinmaxSingleComponentFormats,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->filterMinmaxImageComponentMapping,
+                   sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceVulkanMemoryModelFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVulkanMemoryModelFeatures* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->vulkanMemoryModel, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->vulkanMemoryModelDeviceScope, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->vulkanMemoryModelAvailabilityVisibilityChains,
+                    sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceVulkanMemoryModelFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceVulkanMemoryModelFeatures* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->vulkanMemoryModel, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->vulkanMemoryModelDeviceScope, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->vulkanMemoryModelAvailabilityVisibilityChains,
+                   sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceImagelessFramebufferFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceImagelessFramebufferFeatures* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->imagelessFramebuffer, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceImagelessFramebufferFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceImagelessFramebufferFeatures* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->imagelessFramebuffer, sizeof(VkBool32));
+}
+
+void marshal_VkFramebufferAttachmentImageInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkFramebufferAttachmentImageInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkImageCreateFlags*)&forMarshaling->flags, sizeof(VkImageCreateFlags));
+    vkStream->write((VkImageUsageFlags*)&forMarshaling->usage, sizeof(VkImageUsageFlags));
+    vkStream->write((uint32_t*)&forMarshaling->width, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->height, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->layerCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->viewFormatCount, sizeof(uint32_t));
+    vkStream->write((const VkFormat*)forMarshaling->pViewFormats,
+                    forMarshaling->viewFormatCount * sizeof(const VkFormat));
+}
+
+void unmarshal_VkFramebufferAttachmentImageInfo(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkFramebufferAttachmentImageInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkImageCreateFlags*)&forUnmarshaling->flags, sizeof(VkImageCreateFlags));
+    vkStream->read((VkImageUsageFlags*)&forUnmarshaling->usage, sizeof(VkImageUsageFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->width, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->height, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->layerCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->viewFormatCount, sizeof(uint32_t));
+    vkStream->read((VkFormat*)forUnmarshaling->pViewFormats,
+                   forUnmarshaling->viewFormatCount * sizeof(const VkFormat));
+}
+
+void marshal_VkFramebufferAttachmentsCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkFramebufferAttachmentsCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->attachmentImageInfoCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->attachmentImageInfoCount; ++i) {
+            marshal_VkFramebufferAttachmentImageInfo(
+                vkStream, rootType,
+                (const VkFramebufferAttachmentImageInfo*)(forMarshaling->pAttachmentImageInfos +
+                                                          i));
+        }
+    }
+}
+
+void unmarshal_VkFramebufferAttachmentsCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkFramebufferAttachmentsCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->attachmentImageInfoCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->attachmentImageInfoCount; ++i) {
+            unmarshal_VkFramebufferAttachmentImageInfo(
+                vkStream, rootType,
+                (VkFramebufferAttachmentImageInfo*)(forUnmarshaling->pAttachmentImageInfos + i));
+        }
+    }
+}
+
+void marshal_VkRenderPassAttachmentBeginInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkRenderPassAttachmentBeginInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->attachmentCount, sizeof(uint32_t));
+    if (forMarshaling->attachmentCount) {
+        uint64_t* cgen_var_0;
+        vkStream->alloc((void**)&cgen_var_0, forMarshaling->attachmentCount * 8);
+        vkStream->handleMapping()->mapHandles_VkImageView_u64(
+            forMarshaling->pAttachments, cgen_var_0, forMarshaling->attachmentCount);
+        vkStream->write((uint64_t*)cgen_var_0, forMarshaling->attachmentCount * 8);
+    }
+}
+
+void unmarshal_VkRenderPassAttachmentBeginInfo(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkRenderPassAttachmentBeginInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->attachmentCount, sizeof(uint32_t));
+    if (forUnmarshaling->attachmentCount) {
+        uint64_t* cgen_var_0;
+        vkStream->alloc((void**)&cgen_var_0, forUnmarshaling->attachmentCount * 8);
+        vkStream->read((uint64_t*)cgen_var_0, forUnmarshaling->attachmentCount * 8);
+        vkStream->handleMapping()->mapHandles_u64_VkImageView(
+            cgen_var_0, (VkImageView*)forUnmarshaling->pAttachments,
+            forUnmarshaling->attachmentCount);
+    }
+}
+
+void marshal_VkPhysicalDeviceUniformBufferStandardLayoutFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceUniformBufferStandardLayoutFeatures* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->uniformBufferStandardLayout, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceUniformBufferStandardLayoutFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceUniformBufferStandardLayoutFeatures* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->uniformBufferStandardLayout, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->shaderSubgroupExtendedTypes, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderSubgroupExtendedTypes, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->separateDepthStencilLayouts, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->separateDepthStencilLayouts, sizeof(VkBool32));
+}
+
+void marshal_VkAttachmentReferenceStencilLayout(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAttachmentReferenceStencilLayout* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkImageLayout*)&forMarshaling->stencilLayout, sizeof(VkImageLayout));
+}
+
+void unmarshal_VkAttachmentReferenceStencilLayout(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAttachmentReferenceStencilLayout* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkImageLayout*)&forUnmarshaling->stencilLayout, sizeof(VkImageLayout));
+}
+
+void marshal_VkAttachmentDescriptionStencilLayout(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAttachmentDescriptionStencilLayout* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkImageLayout*)&forMarshaling->stencilInitialLayout, sizeof(VkImageLayout));
+    vkStream->write((VkImageLayout*)&forMarshaling->stencilFinalLayout, sizeof(VkImageLayout));
+}
+
+void unmarshal_VkAttachmentDescriptionStencilLayout(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAttachmentDescriptionStencilLayout* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkImageLayout*)&forUnmarshaling->stencilInitialLayout, sizeof(VkImageLayout));
+    vkStream->read((VkImageLayout*)&forUnmarshaling->stencilFinalLayout, sizeof(VkImageLayout));
+}
+
+void marshal_VkPhysicalDeviceHostQueryResetFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceHostQueryResetFeatures* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->hostQueryReset, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceHostQueryResetFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceHostQueryResetFeatures* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->hostQueryReset, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceTimelineSemaphoreFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceTimelineSemaphoreFeatures* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->timelineSemaphore, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceTimelineSemaphoreFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceTimelineSemaphoreFeatures* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->timelineSemaphore, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceTimelineSemaphoreProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceTimelineSemaphoreProperties* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint64_t*)&forMarshaling->maxTimelineSemaphoreValueDifference,
+                    sizeof(uint64_t));
+}
+
+void unmarshal_VkPhysicalDeviceTimelineSemaphoreProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceTimelineSemaphoreProperties* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint64_t*)&forUnmarshaling->maxTimelineSemaphoreValueDifference,
+                   sizeof(uint64_t));
+}
+
+void marshal_VkSemaphoreTypeCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkSemaphoreTypeCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkSemaphoreType*)&forMarshaling->semaphoreType, sizeof(VkSemaphoreType));
+    vkStream->write((uint64_t*)&forMarshaling->initialValue, sizeof(uint64_t));
+}
+
+void unmarshal_VkSemaphoreTypeCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkSemaphoreTypeCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkSemaphoreType*)&forUnmarshaling->semaphoreType, sizeof(VkSemaphoreType));
+    vkStream->read((uint64_t*)&forUnmarshaling->initialValue, sizeof(uint64_t));
+}
+
+void marshal_VkTimelineSemaphoreSubmitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkTimelineSemaphoreSubmitInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->waitSemaphoreValueCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pWaitSemaphoreValues;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pWaitSemaphoreValues) {
+        vkStream->write((const uint64_t*)forMarshaling->pWaitSemaphoreValues,
+                        forMarshaling->waitSemaphoreValueCount * sizeof(const uint64_t));
+    }
+    vkStream->write((uint32_t*)&forMarshaling->signalSemaphoreValueCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pSignalSemaphoreValues;
+    vkStream->putBe64(cgen_var_1);
+    if (forMarshaling->pSignalSemaphoreValues) {
+        vkStream->write((const uint64_t*)forMarshaling->pSignalSemaphoreValues,
+                        forMarshaling->signalSemaphoreValueCount * sizeof(const uint64_t));
+    }
+}
+
+void unmarshal_VkTimelineSemaphoreSubmitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkTimelineSemaphoreSubmitInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->waitSemaphoreValueCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const uint64_t* check_pWaitSemaphoreValues;
+    check_pWaitSemaphoreValues = (const uint64_t*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pWaitSemaphoreValues) {
+        if (!(check_pWaitSemaphoreValues)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pWaitSemaphoreValues inconsistent between guest and "
+                    "host\n");
+        }
+        vkStream->read((uint64_t*)forUnmarshaling->pWaitSemaphoreValues,
+                       forUnmarshaling->waitSemaphoreValueCount * sizeof(const uint64_t));
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->signalSemaphoreValueCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const uint64_t* check_pSignalSemaphoreValues;
+    check_pSignalSemaphoreValues = (const uint64_t*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pSignalSemaphoreValues) {
+        if (!(check_pSignalSemaphoreValues)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pSignalSemaphoreValues inconsistent between guest and "
+                    "host\n");
+        }
+        vkStream->read((uint64_t*)forUnmarshaling->pSignalSemaphoreValues,
+                       forUnmarshaling->signalSemaphoreValueCount * sizeof(const uint64_t));
+    }
+}
+
+void marshal_VkSemaphoreWaitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkSemaphoreWaitInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkSemaphoreWaitFlags*)&forMarshaling->flags, sizeof(VkSemaphoreWaitFlags));
+    vkStream->write((uint32_t*)&forMarshaling->semaphoreCount, sizeof(uint32_t));
+    if (forMarshaling->semaphoreCount) {
+        uint64_t* cgen_var_0;
+        vkStream->alloc((void**)&cgen_var_0, forMarshaling->semaphoreCount * 8);
+        vkStream->handleMapping()->mapHandles_VkSemaphore_u64(
+            forMarshaling->pSemaphores, cgen_var_0, forMarshaling->semaphoreCount);
+        vkStream->write((uint64_t*)cgen_var_0, forMarshaling->semaphoreCount * 8);
+    }
+    vkStream->write((const uint64_t*)forMarshaling->pValues,
+                    forMarshaling->semaphoreCount * sizeof(const uint64_t));
+}
+
+void unmarshal_VkSemaphoreWaitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkSemaphoreWaitInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkSemaphoreWaitFlags*)&forUnmarshaling->flags, sizeof(VkSemaphoreWaitFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->semaphoreCount, sizeof(uint32_t));
+    if (forUnmarshaling->semaphoreCount) {
+        uint64_t* cgen_var_0;
+        vkStream->alloc((void**)&cgen_var_0, forUnmarshaling->semaphoreCount * 8);
+        vkStream->read((uint64_t*)cgen_var_0, forUnmarshaling->semaphoreCount * 8);
+        vkStream->handleMapping()->mapHandles_u64_VkSemaphore(
+            cgen_var_0, (VkSemaphore*)forUnmarshaling->pSemaphores,
+            forUnmarshaling->semaphoreCount);
+    }
+    vkStream->read((uint64_t*)forUnmarshaling->pValues,
+                   forUnmarshaling->semaphoreCount * sizeof(const uint64_t));
+}
+
+void marshal_VkSemaphoreSignalInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkSemaphoreSignalInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkSemaphore_u64(&forMarshaling->semaphore, &cgen_var_0,
+                                                          1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((uint64_t*)&forMarshaling->value, sizeof(uint64_t));
+}
+
+void unmarshal_VkSemaphoreSignalInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkSemaphoreSignalInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkSemaphore(
+        &cgen_var_0, (VkSemaphore*)&forUnmarshaling->semaphore, 1);
+    vkStream->read((uint64_t*)&forUnmarshaling->value, sizeof(uint64_t));
+}
+
+void marshal_VkPhysicalDeviceBufferDeviceAddressFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceBufferDeviceAddressFeatures* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->bufferDeviceAddress, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->bufferDeviceAddressCaptureReplay, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->bufferDeviceAddressMultiDevice, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceBufferDeviceAddressFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceBufferDeviceAddressFeatures* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->bufferDeviceAddress, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->bufferDeviceAddressCaptureReplay, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->bufferDeviceAddressMultiDevice, sizeof(VkBool32));
+}
+
+void marshal_VkBufferDeviceAddressInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkBufferDeviceAddressInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkBuffer_u64(&forMarshaling->buffer, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+}
+
+void unmarshal_VkBufferDeviceAddressInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkBufferDeviceAddressInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_0,
+                                                       (VkBuffer*)&forUnmarshaling->buffer, 1);
+}
+
+void marshal_VkBufferOpaqueCaptureAddressCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferOpaqueCaptureAddressCreateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint64_t*)&forMarshaling->opaqueCaptureAddress, sizeof(uint64_t));
+}
+
+void unmarshal_VkBufferOpaqueCaptureAddressCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkBufferOpaqueCaptureAddressCreateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint64_t*)&forUnmarshaling->opaqueCaptureAddress, sizeof(uint64_t));
+}
+
+void marshal_VkMemoryOpaqueCaptureAddressAllocateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryOpaqueCaptureAddressAllocateInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint64_t*)&forMarshaling->opaqueCaptureAddress, sizeof(uint64_t));
+}
+
+void unmarshal_VkMemoryOpaqueCaptureAddressAllocateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkMemoryOpaqueCaptureAddressAllocateInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint64_t*)&forUnmarshaling->opaqueCaptureAddress, sizeof(uint64_t));
+}
+
+void marshal_VkDeviceMemoryOpaqueCaptureAddressInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceMemoryOpaqueCaptureAddressInfo* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&forMarshaling->memory, &cgen_var_0,
+                                                             1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+}
+
+void unmarshal_VkDeviceMemoryOpaqueCaptureAddressInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDeviceMemoryOpaqueCaptureAddressInfo* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkDeviceMemory(
+        &cgen_var_0, (VkDeviceMemory*)&forUnmarshaling->memory, 1);
+}
+
+#endif
+#ifdef VK_KHR_surface
+void marshal_VkSurfaceCapabilitiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkSurfaceCapabilitiesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->minImageCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxImageCount, sizeof(uint32_t));
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->currentExtent));
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->minImageExtent));
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->maxImageExtent));
+    vkStream->write((uint32_t*)&forMarshaling->maxImageArrayLayers, sizeof(uint32_t));
+    vkStream->write((VkSurfaceTransformFlagsKHR*)&forMarshaling->supportedTransforms,
+                    sizeof(VkSurfaceTransformFlagsKHR));
+    vkStream->write((VkSurfaceTransformFlagBitsKHR*)&forMarshaling->currentTransform,
+                    sizeof(VkSurfaceTransformFlagBitsKHR));
+    vkStream->write((VkCompositeAlphaFlagsKHR*)&forMarshaling->supportedCompositeAlpha,
+                    sizeof(VkCompositeAlphaFlagsKHR));
+    vkStream->write((VkImageUsageFlags*)&forMarshaling->supportedUsageFlags,
+                    sizeof(VkImageUsageFlags));
+}
+
+void unmarshal_VkSurfaceCapabilitiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkSurfaceCapabilitiesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->minImageCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxImageCount, sizeof(uint32_t));
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->currentExtent));
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->minImageExtent));
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->maxImageExtent));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxImageArrayLayers, sizeof(uint32_t));
+    vkStream->read((VkSurfaceTransformFlagsKHR*)&forUnmarshaling->supportedTransforms,
+                   sizeof(VkSurfaceTransformFlagsKHR));
+    vkStream->read((VkSurfaceTransformFlagBitsKHR*)&forUnmarshaling->currentTransform,
+                   sizeof(VkSurfaceTransformFlagBitsKHR));
+    vkStream->read((VkCompositeAlphaFlagsKHR*)&forUnmarshaling->supportedCompositeAlpha,
+                   sizeof(VkCompositeAlphaFlagsKHR));
+    vkStream->read((VkImageUsageFlags*)&forUnmarshaling->supportedUsageFlags,
+                   sizeof(VkImageUsageFlags));
+}
+
+void marshal_VkSurfaceFormatKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkSurfaceFormatKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+    vkStream->write((VkColorSpaceKHR*)&forMarshaling->colorSpace, sizeof(VkColorSpaceKHR));
+}
+
+void unmarshal_VkSurfaceFormatKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkSurfaceFormatKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkFormat*)&forUnmarshaling->format, sizeof(VkFormat));
+    vkStream->read((VkColorSpaceKHR*)&forUnmarshaling->colorSpace, sizeof(VkColorSpaceKHR));
+}
+
+#endif
+#ifdef VK_KHR_swapchain
+void marshal_VkSwapchainCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkSwapchainCreateInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkSwapchainCreateFlagsKHR*)&forMarshaling->flags,
+                    sizeof(VkSwapchainCreateFlagsKHR));
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&forMarshaling->surface, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((uint32_t*)&forMarshaling->minImageCount, sizeof(uint32_t));
+    vkStream->write((VkFormat*)&forMarshaling->imageFormat, sizeof(VkFormat));
+    vkStream->write((VkColorSpaceKHR*)&forMarshaling->imageColorSpace, sizeof(VkColorSpaceKHR));
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->imageExtent));
+    vkStream->write((uint32_t*)&forMarshaling->imageArrayLayers, sizeof(uint32_t));
+    vkStream->write((VkImageUsageFlags*)&forMarshaling->imageUsage, sizeof(VkImageUsageFlags));
+    vkStream->write((VkSharingMode*)&forMarshaling->imageSharingMode, sizeof(VkSharingMode));
+    vkStream->write((uint32_t*)&forMarshaling->queueFamilyIndexCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pQueueFamilyIndices;
+    vkStream->putBe64(cgen_var_1);
+    if (forMarshaling->pQueueFamilyIndices) {
+        vkStream->write((const uint32_t*)forMarshaling->pQueueFamilyIndices,
+                        forMarshaling->queueFamilyIndexCount * sizeof(const uint32_t));
+    }
+    vkStream->write((VkSurfaceTransformFlagBitsKHR*)&forMarshaling->preTransform,
+                    sizeof(VkSurfaceTransformFlagBitsKHR));
+    vkStream->write((VkCompositeAlphaFlagBitsKHR*)&forMarshaling->compositeAlpha,
+                    sizeof(VkCompositeAlphaFlagBitsKHR));
+    vkStream->write((VkPresentModeKHR*)&forMarshaling->presentMode, sizeof(VkPresentModeKHR));
+    vkStream->write((VkBool32*)&forMarshaling->clipped, sizeof(VkBool32));
+    uint64_t cgen_var_2;
+    vkStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&forMarshaling->oldSwapchain,
+                                                             &cgen_var_2, 1);
+    vkStream->write((uint64_t*)&cgen_var_2, 1 * 8);
+}
+
+void unmarshal_VkSwapchainCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkSwapchainCreateInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkSwapchainCreateFlagsKHR*)&forUnmarshaling->flags,
+                   sizeof(VkSwapchainCreateFlagsKHR));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkSurfaceKHR(
+        &cgen_var_0, (VkSurfaceKHR*)&forUnmarshaling->surface, 1);
+    vkStream->read((uint32_t*)&forUnmarshaling->minImageCount, sizeof(uint32_t));
+    vkStream->read((VkFormat*)&forUnmarshaling->imageFormat, sizeof(VkFormat));
+    vkStream->read((VkColorSpaceKHR*)&forUnmarshaling->imageColorSpace, sizeof(VkColorSpaceKHR));
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->imageExtent));
+    vkStream->read((uint32_t*)&forUnmarshaling->imageArrayLayers, sizeof(uint32_t));
+    vkStream->read((VkImageUsageFlags*)&forUnmarshaling->imageUsage, sizeof(VkImageUsageFlags));
+    vkStream->read((VkSharingMode*)&forUnmarshaling->imageSharingMode, sizeof(VkSharingMode));
+    vkStream->read((uint32_t*)&forUnmarshaling->queueFamilyIndexCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const uint32_t* check_pQueueFamilyIndices;
+    check_pQueueFamilyIndices = (const uint32_t*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pQueueFamilyIndices) {
+        if (!(check_pQueueFamilyIndices)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pQueueFamilyIndices inconsistent between guest and "
+                    "host\n");
+        }
+        vkStream->read((uint32_t*)forUnmarshaling->pQueueFamilyIndices,
+                       forUnmarshaling->queueFamilyIndexCount * sizeof(const uint32_t));
+    }
+    vkStream->read((VkSurfaceTransformFlagBitsKHR*)&forUnmarshaling->preTransform,
+                   sizeof(VkSurfaceTransformFlagBitsKHR));
+    vkStream->read((VkCompositeAlphaFlagBitsKHR*)&forUnmarshaling->compositeAlpha,
+                   sizeof(VkCompositeAlphaFlagBitsKHR));
+    vkStream->read((VkPresentModeKHR*)&forUnmarshaling->presentMode, sizeof(VkPresentModeKHR));
+    vkStream->read((VkBool32*)&forUnmarshaling->clipped, sizeof(VkBool32));
+    uint64_t cgen_var_2;
+    vkStream->read((uint64_t*)&cgen_var_2, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkSwapchainKHR(
+        &cgen_var_2, (VkSwapchainKHR*)&forUnmarshaling->oldSwapchain, 1);
+}
+
+void marshal_VkPresentInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                              const VkPresentInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->waitSemaphoreCount, sizeof(uint32_t));
+    if (forMarshaling->waitSemaphoreCount) {
+        uint64_t* cgen_var_0;
+        vkStream->alloc((void**)&cgen_var_0, forMarshaling->waitSemaphoreCount * 8);
+        vkStream->handleMapping()->mapHandles_VkSemaphore_u64(
+            forMarshaling->pWaitSemaphores, cgen_var_0, forMarshaling->waitSemaphoreCount);
+        vkStream->write((uint64_t*)cgen_var_0, forMarshaling->waitSemaphoreCount * 8);
+    }
+    vkStream->write((uint32_t*)&forMarshaling->swapchainCount, sizeof(uint32_t));
+    if (forMarshaling->swapchainCount) {
+        uint64_t* cgen_var_1;
+        vkStream->alloc((void**)&cgen_var_1, forMarshaling->swapchainCount * 8);
+        vkStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(
+            forMarshaling->pSwapchains, cgen_var_1, forMarshaling->swapchainCount);
+        vkStream->write((uint64_t*)cgen_var_1, forMarshaling->swapchainCount * 8);
+    }
+    vkStream->write((const uint32_t*)forMarshaling->pImageIndices,
+                    forMarshaling->swapchainCount * sizeof(const uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)forMarshaling->pResults;
+    vkStream->putBe64(cgen_var_2);
+    if (forMarshaling->pResults) {
+        vkStream->write((VkResult*)forMarshaling->pResults,
+                        forMarshaling->swapchainCount * sizeof(VkResult));
+    }
+}
+
+void unmarshal_VkPresentInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                VkPresentInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->waitSemaphoreCount, sizeof(uint32_t));
+    if (forUnmarshaling->waitSemaphoreCount) {
+        uint64_t* cgen_var_0;
+        vkStream->alloc((void**)&cgen_var_0, forUnmarshaling->waitSemaphoreCount * 8);
+        vkStream->read((uint64_t*)cgen_var_0, forUnmarshaling->waitSemaphoreCount * 8);
+        vkStream->handleMapping()->mapHandles_u64_VkSemaphore(
+            cgen_var_0, (VkSemaphore*)forUnmarshaling->pWaitSemaphores,
+            forUnmarshaling->waitSemaphoreCount);
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->swapchainCount, sizeof(uint32_t));
+    if (forUnmarshaling->swapchainCount) {
+        uint64_t* cgen_var_1;
+        vkStream->alloc((void**)&cgen_var_1, forUnmarshaling->swapchainCount * 8);
+        vkStream->read((uint64_t*)cgen_var_1, forUnmarshaling->swapchainCount * 8);
+        vkStream->handleMapping()->mapHandles_u64_VkSwapchainKHR(
+            cgen_var_1, (VkSwapchainKHR*)forUnmarshaling->pSwapchains,
+            forUnmarshaling->swapchainCount);
+    }
+    vkStream->read((uint32_t*)forUnmarshaling->pImageIndices,
+                   forUnmarshaling->swapchainCount * sizeof(const uint32_t));
+    // WARNING PTR CHECK
+    VkResult* check_pResults;
+    check_pResults = (VkResult*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pResults) {
+        if (!(check_pResults)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pResults inconsistent between guest and host\n");
+        }
+        vkStream->read((VkResult*)forUnmarshaling->pResults,
+                       forUnmarshaling->swapchainCount * sizeof(VkResult));
+    }
+}
+
+void marshal_VkImageSwapchainCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkImageSwapchainCreateInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&forMarshaling->swapchain, &cgen_var_0,
+                                                             1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+}
+
+void unmarshal_VkImageSwapchainCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkImageSwapchainCreateInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkSwapchainKHR(
+        &cgen_var_0, (VkSwapchainKHR*)&forUnmarshaling->swapchain, 1);
+}
+
+void marshal_VkBindImageMemorySwapchainInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBindImageMemorySwapchainInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&forMarshaling->swapchain, &cgen_var_0,
+                                                             1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((uint32_t*)&forMarshaling->imageIndex, sizeof(uint32_t));
+}
+
+void unmarshal_VkBindImageMemorySwapchainInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkBindImageMemorySwapchainInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkSwapchainKHR(
+        &cgen_var_0, (VkSwapchainKHR*)&forUnmarshaling->swapchain, 1);
+    vkStream->read((uint32_t*)&forUnmarshaling->imageIndex, sizeof(uint32_t));
+}
+
+void marshal_VkAcquireNextImageInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkAcquireNextImageInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&forMarshaling->swapchain, &cgen_var_0,
+                                                             1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((uint64_t*)&forMarshaling->timeout, sizeof(uint64_t));
+    uint64_t cgen_var_1;
+    vkStream->handleMapping()->mapHandles_VkSemaphore_u64(&forMarshaling->semaphore, &cgen_var_1,
+                                                          1);
+    vkStream->write((uint64_t*)&cgen_var_1, 1 * 8);
+    uint64_t cgen_var_2;
+    vkStream->handleMapping()->mapHandles_VkFence_u64(&forMarshaling->fence, &cgen_var_2, 1);
+    vkStream->write((uint64_t*)&cgen_var_2, 1 * 8);
+    vkStream->write((uint32_t*)&forMarshaling->deviceMask, sizeof(uint32_t));
+}
+
+void unmarshal_VkAcquireNextImageInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkAcquireNextImageInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkSwapchainKHR(
+        &cgen_var_0, (VkSwapchainKHR*)&forUnmarshaling->swapchain, 1);
+    vkStream->read((uint64_t*)&forUnmarshaling->timeout, sizeof(uint64_t));
+    uint64_t cgen_var_1;
+    vkStream->read((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkSemaphore(
+        &cgen_var_1, (VkSemaphore*)&forUnmarshaling->semaphore, 1);
+    uint64_t cgen_var_2;
+    vkStream->read((uint64_t*)&cgen_var_2, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkFence(&cgen_var_2,
+                                                      (VkFence*)&forUnmarshaling->fence, 1);
+    vkStream->read((uint32_t*)&forUnmarshaling->deviceMask, sizeof(uint32_t));
+}
+
+void marshal_VkDeviceGroupPresentCapabilitiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceGroupPresentCapabilitiesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)forMarshaling->presentMask,
+                    VK_MAX_DEVICE_GROUP_SIZE * sizeof(uint32_t));
+    vkStream->write((VkDeviceGroupPresentModeFlagsKHR*)&forMarshaling->modes,
+                    sizeof(VkDeviceGroupPresentModeFlagsKHR));
+}
+
+void unmarshal_VkDeviceGroupPresentCapabilitiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDeviceGroupPresentCapabilitiesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)forUnmarshaling->presentMask,
+                   VK_MAX_DEVICE_GROUP_SIZE * sizeof(uint32_t));
+    vkStream->read((VkDeviceGroupPresentModeFlagsKHR*)&forUnmarshaling->modes,
+                   sizeof(VkDeviceGroupPresentModeFlagsKHR));
+}
+
+void marshal_VkDeviceGroupPresentInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkDeviceGroupPresentInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->swapchainCount, sizeof(uint32_t));
+    vkStream->write((const uint32_t*)forMarshaling->pDeviceMasks,
+                    forMarshaling->swapchainCount * sizeof(const uint32_t));
+    vkStream->write((VkDeviceGroupPresentModeFlagBitsKHR*)&forMarshaling->mode,
+                    sizeof(VkDeviceGroupPresentModeFlagBitsKHR));
+}
+
+void unmarshal_VkDeviceGroupPresentInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkDeviceGroupPresentInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->swapchainCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)forUnmarshaling->pDeviceMasks,
+                   forUnmarshaling->swapchainCount * sizeof(const uint32_t));
+    vkStream->read((VkDeviceGroupPresentModeFlagBitsKHR*)&forUnmarshaling->mode,
+                   sizeof(VkDeviceGroupPresentModeFlagBitsKHR));
+}
+
+void marshal_VkDeviceGroupSwapchainCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceGroupSwapchainCreateInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDeviceGroupPresentModeFlagsKHR*)&forMarshaling->modes,
+                    sizeof(VkDeviceGroupPresentModeFlagsKHR));
+}
+
+void unmarshal_VkDeviceGroupSwapchainCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDeviceGroupSwapchainCreateInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDeviceGroupPresentModeFlagsKHR*)&forUnmarshaling->modes,
+                   sizeof(VkDeviceGroupPresentModeFlagsKHR));
+}
+
+#endif
+#ifdef VK_KHR_display
+void marshal_VkDisplayModeParametersKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkDisplayModeParametersKHR* forMarshaling) {
+    (void)rootType;
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->visibleRegion));
+    vkStream->write((uint32_t*)&forMarshaling->refreshRate, sizeof(uint32_t));
+}
+
+void unmarshal_VkDisplayModeParametersKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkDisplayModeParametersKHR* forUnmarshaling) {
+    (void)rootType;
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->visibleRegion));
+    vkStream->read((uint32_t*)&forUnmarshaling->refreshRate, sizeof(uint32_t));
+}
+
+void marshal_VkDisplayModeCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkDisplayModeCreateInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDisplayModeCreateFlagsKHR*)&forMarshaling->flags,
+                    sizeof(VkDisplayModeCreateFlagsKHR));
+    marshal_VkDisplayModeParametersKHR(vkStream, rootType,
+                                       (VkDisplayModeParametersKHR*)(&forMarshaling->parameters));
+}
+
+void unmarshal_VkDisplayModeCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkDisplayModeCreateInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDisplayModeCreateFlagsKHR*)&forUnmarshaling->flags,
+                   sizeof(VkDisplayModeCreateFlagsKHR));
+    unmarshal_VkDisplayModeParametersKHR(
+        vkStream, rootType, (VkDisplayModeParametersKHR*)(&forUnmarshaling->parameters));
+}
+
+void marshal_VkDisplayModePropertiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkDisplayModePropertiesKHR* forMarshaling) {
+    (void)rootType;
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkDisplayModeKHR_u64(&forMarshaling->displayMode,
+                                                               &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    marshal_VkDisplayModeParametersKHR(vkStream, rootType,
+                                       (VkDisplayModeParametersKHR*)(&forMarshaling->parameters));
+}
+
+void unmarshal_VkDisplayModePropertiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkDisplayModePropertiesKHR* forUnmarshaling) {
+    (void)rootType;
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkDisplayModeKHR(
+        &cgen_var_0, (VkDisplayModeKHR*)&forUnmarshaling->displayMode, 1);
+    unmarshal_VkDisplayModeParametersKHR(
+        vkStream, rootType, (VkDisplayModeParametersKHR*)(&forUnmarshaling->parameters));
+}
+
+void marshal_VkDisplayPlaneCapabilitiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkDisplayPlaneCapabilitiesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkDisplayPlaneAlphaFlagsKHR*)&forMarshaling->supportedAlpha,
+                    sizeof(VkDisplayPlaneAlphaFlagsKHR));
+    marshal_VkOffset2D(vkStream, rootType, (VkOffset2D*)(&forMarshaling->minSrcPosition));
+    marshal_VkOffset2D(vkStream, rootType, (VkOffset2D*)(&forMarshaling->maxSrcPosition));
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->minSrcExtent));
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->maxSrcExtent));
+    marshal_VkOffset2D(vkStream, rootType, (VkOffset2D*)(&forMarshaling->minDstPosition));
+    marshal_VkOffset2D(vkStream, rootType, (VkOffset2D*)(&forMarshaling->maxDstPosition));
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->minDstExtent));
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->maxDstExtent));
+}
+
+void unmarshal_VkDisplayPlaneCapabilitiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkDisplayPlaneCapabilitiesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkDisplayPlaneAlphaFlagsKHR*)&forUnmarshaling->supportedAlpha,
+                   sizeof(VkDisplayPlaneAlphaFlagsKHR));
+    unmarshal_VkOffset2D(vkStream, rootType, (VkOffset2D*)(&forUnmarshaling->minSrcPosition));
+    unmarshal_VkOffset2D(vkStream, rootType, (VkOffset2D*)(&forUnmarshaling->maxSrcPosition));
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->minSrcExtent));
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->maxSrcExtent));
+    unmarshal_VkOffset2D(vkStream, rootType, (VkOffset2D*)(&forUnmarshaling->minDstPosition));
+    unmarshal_VkOffset2D(vkStream, rootType, (VkOffset2D*)(&forUnmarshaling->maxDstPosition));
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->minDstExtent));
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->maxDstExtent));
+}
+
+void marshal_VkDisplayPlanePropertiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkDisplayPlanePropertiesKHR* forMarshaling) {
+    (void)rootType;
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&forMarshaling->currentDisplay,
+                                                           &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((uint32_t*)&forMarshaling->currentStackIndex, sizeof(uint32_t));
+}
+
+void unmarshal_VkDisplayPlanePropertiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkDisplayPlanePropertiesKHR* forUnmarshaling) {
+    (void)rootType;
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkDisplayKHR(
+        &cgen_var_0, (VkDisplayKHR*)&forUnmarshaling->currentDisplay, 1);
+    vkStream->read((uint32_t*)&forUnmarshaling->currentStackIndex, sizeof(uint32_t));
+}
+
+void marshal_VkDisplayPropertiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkDisplayPropertiesKHR* forMarshaling) {
+    (void)rootType;
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&forMarshaling->display, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->putString(forMarshaling->displayName);
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->physicalDimensions));
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->physicalResolution));
+    vkStream->write((VkSurfaceTransformFlagsKHR*)&forMarshaling->supportedTransforms,
+                    sizeof(VkSurfaceTransformFlagsKHR));
+    vkStream->write((VkBool32*)&forMarshaling->planeReorderPossible, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->persistentContent, sizeof(VkBool32));
+}
+
+void unmarshal_VkDisplayPropertiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      VkDisplayPropertiesKHR* forUnmarshaling) {
+    (void)rootType;
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkDisplayKHR(
+        &cgen_var_0, (VkDisplayKHR*)&forUnmarshaling->display, 1);
+    vkStream->loadStringInPlace((char**)&forUnmarshaling->displayName);
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->physicalDimensions));
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->physicalResolution));
+    vkStream->read((VkSurfaceTransformFlagsKHR*)&forUnmarshaling->supportedTransforms,
+                   sizeof(VkSurfaceTransformFlagsKHR));
+    vkStream->read((VkBool32*)&forUnmarshaling->planeReorderPossible, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->persistentContent, sizeof(VkBool32));
+}
+
+void marshal_VkDisplaySurfaceCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkDisplaySurfaceCreateInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDisplaySurfaceCreateFlagsKHR*)&forMarshaling->flags,
+                    sizeof(VkDisplaySurfaceCreateFlagsKHR));
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkDisplayModeKHR_u64(&forMarshaling->displayMode,
+                                                               &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((uint32_t*)&forMarshaling->planeIndex, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->planeStackIndex, sizeof(uint32_t));
+    vkStream->write((VkSurfaceTransformFlagBitsKHR*)&forMarshaling->transform,
+                    sizeof(VkSurfaceTransformFlagBitsKHR));
+    vkStream->write((float*)&forMarshaling->globalAlpha, sizeof(float));
+    vkStream->write((VkDisplayPlaneAlphaFlagBitsKHR*)&forMarshaling->alphaMode,
+                    sizeof(VkDisplayPlaneAlphaFlagBitsKHR));
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->imageExtent));
+}
+
+void unmarshal_VkDisplaySurfaceCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkDisplaySurfaceCreateInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDisplaySurfaceCreateFlagsKHR*)&forUnmarshaling->flags,
+                   sizeof(VkDisplaySurfaceCreateFlagsKHR));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkDisplayModeKHR(
+        &cgen_var_0, (VkDisplayModeKHR*)&forUnmarshaling->displayMode, 1);
+    vkStream->read((uint32_t*)&forUnmarshaling->planeIndex, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->planeStackIndex, sizeof(uint32_t));
+    vkStream->read((VkSurfaceTransformFlagBitsKHR*)&forUnmarshaling->transform,
+                   sizeof(VkSurfaceTransformFlagBitsKHR));
+    vkStream->read((float*)&forUnmarshaling->globalAlpha, sizeof(float));
+    vkStream->read((VkDisplayPlaneAlphaFlagBitsKHR*)&forUnmarshaling->alphaMode,
+                   sizeof(VkDisplayPlaneAlphaFlagBitsKHR));
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->imageExtent));
+}
+
+#endif
+#ifdef VK_KHR_display_swapchain
+void marshal_VkDisplayPresentInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkDisplayPresentInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkRect2D(vkStream, rootType, (VkRect2D*)(&forMarshaling->srcRect));
+    marshal_VkRect2D(vkStream, rootType, (VkRect2D*)(&forMarshaling->dstRect));
+    vkStream->write((VkBool32*)&forMarshaling->persistent, sizeof(VkBool32));
+}
+
+void unmarshal_VkDisplayPresentInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkDisplayPresentInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkRect2D(vkStream, rootType, (VkRect2D*)(&forUnmarshaling->srcRect));
+    unmarshal_VkRect2D(vkStream, rootType, (VkRect2D*)(&forUnmarshaling->dstRect));
+    vkStream->read((VkBool32*)&forUnmarshaling->persistent, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_KHR_xlib_surface
+void marshal_VkXlibSurfaceCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkXlibSurfaceCreateInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkXlibSurfaceCreateFlagsKHR*)&forMarshaling->flags,
+                    sizeof(VkXlibSurfaceCreateFlagsKHR));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->dpy;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->dpy) {
+        vkStream->write((Display*)forMarshaling->dpy, sizeof(Display));
+    }
+    vkStream->write((Window*)&forMarshaling->window, sizeof(Window));
+}
+
+void unmarshal_VkXlibSurfaceCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkXlibSurfaceCreateInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkXlibSurfaceCreateFlagsKHR*)&forUnmarshaling->flags,
+                   sizeof(VkXlibSurfaceCreateFlagsKHR));
+    // WARNING PTR CHECK
+    Display* check_dpy;
+    check_dpy = (Display*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->dpy) {
+        if (!(check_dpy)) {
+            fprintf(stderr, "fatal: forUnmarshaling->dpy inconsistent between guest and host\n");
+        }
+        vkStream->read((Display*)forUnmarshaling->dpy, sizeof(Display));
+    }
+    vkStream->read((Window*)&forUnmarshaling->window, sizeof(Window));
+}
+
+#endif
+#ifdef VK_KHR_xcb_surface
+void marshal_VkXcbSurfaceCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkXcbSurfaceCreateInfoKHR* forMarshaling) {
+    (void)rootType;
+
+    // This struct should never be marshaled / unmarshaled.
+    __builtin_trap();
+}
+
+void unmarshal_VkXcbSurfaceCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkXcbSurfaceCreateInfoKHR* forUnmarshaling) {
+    (void)rootType;
+
+    // This struct should never be marshaled / unmarshaled.
+    __builtin_trap();
+}
+
+#endif
+#ifdef VK_KHR_wayland_surface
+void marshal_VkWaylandSurfaceCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkWaylandSurfaceCreateInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkWaylandSurfaceCreateFlagsKHR*)&forMarshaling->flags,
+                    sizeof(VkWaylandSurfaceCreateFlagsKHR));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->display;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->display) {
+        vkStream->write((wl_display*)forMarshaling->display, sizeof(wl_display));
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->surface;
+    vkStream->putBe64(cgen_var_1);
+    if (forMarshaling->surface) {
+        vkStream->write((wl_surface*)forMarshaling->surface, sizeof(wl_surface));
+    }
+}
+
+void unmarshal_VkWaylandSurfaceCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkWaylandSurfaceCreateInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkWaylandSurfaceCreateFlagsKHR*)&forUnmarshaling->flags,
+                   sizeof(VkWaylandSurfaceCreateFlagsKHR));
+    // WARNING PTR CHECK
+    wl_display* check_display;
+    check_display = (wl_display*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->display) {
+        if (!(check_display)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->display inconsistent between guest and host\n");
+        }
+        vkStream->read((wl_display*)forUnmarshaling->display, sizeof(wl_display));
+    }
+    // WARNING PTR CHECK
+    wl_surface* check_surface;
+    check_surface = (wl_surface*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->surface) {
+        if (!(check_surface)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->surface inconsistent between guest and host\n");
+        }
+        vkStream->read((wl_surface*)forUnmarshaling->surface, sizeof(wl_surface));
+    }
+}
+
+#endif
+#ifdef VK_KHR_android_surface
+void marshal_VkAndroidSurfaceCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkAndroidSurfaceCreateInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkAndroidSurfaceCreateFlagsKHR*)&forMarshaling->flags,
+                    sizeof(VkAndroidSurfaceCreateFlagsKHR));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->window;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->window) {
+        vkStream->write((ANativeWindow*)forMarshaling->window, sizeof(ANativeWindow));
+    }
+}
+
+void unmarshal_VkAndroidSurfaceCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkAndroidSurfaceCreateInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkAndroidSurfaceCreateFlagsKHR*)&forUnmarshaling->flags,
+                   sizeof(VkAndroidSurfaceCreateFlagsKHR));
+    // WARNING PTR CHECK
+    ANativeWindow* check_window;
+    check_window = (ANativeWindow*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->window) {
+        if (!(check_window)) {
+            fprintf(stderr, "fatal: forUnmarshaling->window inconsistent between guest and host\n");
+        }
+        vkStream->read((ANativeWindow*)forUnmarshaling->window, sizeof(ANativeWindow));
+    }
+}
+
+#endif
+#ifdef VK_KHR_win32_surface
+void marshal_VkWin32SurfaceCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkWin32SurfaceCreateInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkWin32SurfaceCreateFlagsKHR*)&forMarshaling->flags,
+                    sizeof(VkWin32SurfaceCreateFlagsKHR));
+    vkStream->write((HINSTANCE*)&forMarshaling->hinstance, sizeof(HINSTANCE));
+    vkStream->write((HWND*)&forMarshaling->hwnd, sizeof(HWND));
+}
+
+void unmarshal_VkWin32SurfaceCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkWin32SurfaceCreateInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkWin32SurfaceCreateFlagsKHR*)&forUnmarshaling->flags,
+                   sizeof(VkWin32SurfaceCreateFlagsKHR));
+    vkStream->read((HINSTANCE*)&forUnmarshaling->hinstance, sizeof(HINSTANCE));
+    vkStream->read((HWND*)&forUnmarshaling->hwnd, sizeof(HWND));
+}
+
+#endif
+#ifdef VK_KHR_sampler_mirror_clamp_to_edge
+#endif
+#ifdef VK_KHR_video_queue
+void marshal_VkVideoQueueFamilyProperties2KHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoQueueFamilyProperties2KHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkVideoCodecOperationFlagsKHR*)&forMarshaling->videoCodecOperations,
+                    sizeof(VkVideoCodecOperationFlagsKHR));
+}
+
+void unmarshal_VkVideoQueueFamilyProperties2KHR(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkVideoQueueFamilyProperties2KHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkVideoCodecOperationFlagsKHR*)&forUnmarshaling->videoCodecOperations,
+                   sizeof(VkVideoCodecOperationFlagsKHR));
+}
+
+void marshal_VkVideoProfileKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               const VkVideoProfileKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkVideoCodecOperationFlagBitsKHR*)&forMarshaling->videoCodecOperation,
+                    sizeof(VkVideoCodecOperationFlagBitsKHR));
+    vkStream->write((VkVideoChromaSubsamplingFlagsKHR*)&forMarshaling->chromaSubsampling,
+                    sizeof(VkVideoChromaSubsamplingFlagsKHR));
+    vkStream->write((VkVideoComponentBitDepthFlagsKHR*)&forMarshaling->lumaBitDepth,
+                    sizeof(VkVideoComponentBitDepthFlagsKHR));
+    vkStream->write((VkVideoComponentBitDepthFlagsKHR*)&forMarshaling->chromaBitDepth,
+                    sizeof(VkVideoComponentBitDepthFlagsKHR));
+}
+
+void unmarshal_VkVideoProfileKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 VkVideoProfileKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkVideoCodecOperationFlagBitsKHR*)&forUnmarshaling->videoCodecOperation,
+                   sizeof(VkVideoCodecOperationFlagBitsKHR));
+    vkStream->read((VkVideoChromaSubsamplingFlagsKHR*)&forUnmarshaling->chromaSubsampling,
+                   sizeof(VkVideoChromaSubsamplingFlagsKHR));
+    vkStream->read((VkVideoComponentBitDepthFlagsKHR*)&forUnmarshaling->lumaBitDepth,
+                   sizeof(VkVideoComponentBitDepthFlagsKHR));
+    vkStream->read((VkVideoComponentBitDepthFlagsKHR*)&forUnmarshaling->chromaBitDepth,
+                   sizeof(VkVideoComponentBitDepthFlagsKHR));
+}
+
+void marshal_VkVideoProfilesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkVideoProfilesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->profileCount, sizeof(uint32_t));
+    marshal_VkVideoProfileKHR(vkStream, rootType,
+                              (const VkVideoProfileKHR*)(forMarshaling->pProfiles));
+}
+
+void unmarshal_VkVideoProfilesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkVideoProfilesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->profileCount, sizeof(uint32_t));
+    unmarshal_VkVideoProfileKHR(vkStream, rootType,
+                                (VkVideoProfileKHR*)(forUnmarshaling->pProfiles));
+}
+
+void marshal_VkVideoCapabilitiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkVideoCapabilitiesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkVideoCapabilityFlagsKHR*)&forMarshaling->capabilityFlags,
+                    sizeof(VkVideoCapabilityFlagsKHR));
+    vkStream->write((VkDeviceSize*)&forMarshaling->minBitstreamBufferOffsetAlignment,
+                    sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->minBitstreamBufferSizeAlignment,
+                    sizeof(VkDeviceSize));
+    marshal_VkExtent2D(vkStream, rootType,
+                       (VkExtent2D*)(&forMarshaling->videoPictureExtentGranularity));
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->minExtent));
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->maxExtent));
+    vkStream->write((uint32_t*)&forMarshaling->maxReferencePicturesSlotsCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxReferencePicturesActiveCount, sizeof(uint32_t));
+}
+
+void unmarshal_VkVideoCapabilitiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      VkVideoCapabilitiesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkVideoCapabilityFlagsKHR*)&forUnmarshaling->capabilityFlags,
+                   sizeof(VkVideoCapabilityFlagsKHR));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->minBitstreamBufferOffsetAlignment,
+                   sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->minBitstreamBufferSizeAlignment,
+                   sizeof(VkDeviceSize));
+    unmarshal_VkExtent2D(vkStream, rootType,
+                         (VkExtent2D*)(&forUnmarshaling->videoPictureExtentGranularity));
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->minExtent));
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->maxExtent));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxReferencePicturesSlotsCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxReferencePicturesActiveCount, sizeof(uint32_t));
+}
+
+void marshal_VkPhysicalDeviceVideoFormatInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVideoFormatInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkImageUsageFlags*)&forMarshaling->imageUsage, sizeof(VkImageUsageFlags));
+    marshal_VkVideoProfilesKHR(vkStream, rootType,
+                               (const VkVideoProfilesKHR*)(forMarshaling->pVideoProfiles));
+}
+
+void unmarshal_VkPhysicalDeviceVideoFormatInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceVideoFormatInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkImageUsageFlags*)&forUnmarshaling->imageUsage, sizeof(VkImageUsageFlags));
+    unmarshal_VkVideoProfilesKHR(vkStream, rootType,
+                                 (VkVideoProfilesKHR*)(forUnmarshaling->pVideoProfiles));
+}
+
+void marshal_VkVideoFormatPropertiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkVideoFormatPropertiesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+}
+
+void unmarshal_VkVideoFormatPropertiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkVideoFormatPropertiesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkFormat*)&forUnmarshaling->format, sizeof(VkFormat));
+}
+
+void marshal_VkVideoPictureResourceKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkVideoPictureResourceKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkOffset2D(vkStream, rootType, (VkOffset2D*)(&forMarshaling->codedOffset));
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->codedExtent));
+    vkStream->write((uint32_t*)&forMarshaling->baseArrayLayer, sizeof(uint32_t));
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkImageView_u64(&forMarshaling->imageViewBinding,
+                                                          &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+}
+
+void unmarshal_VkVideoPictureResourceKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkVideoPictureResourceKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkOffset2D(vkStream, rootType, (VkOffset2D*)(&forUnmarshaling->codedOffset));
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->codedExtent));
+    vkStream->read((uint32_t*)&forUnmarshaling->baseArrayLayer, sizeof(uint32_t));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkImageView(
+        &cgen_var_0, (VkImageView*)&forUnmarshaling->imageViewBinding, 1);
+}
+
+void marshal_VkVideoReferenceSlotKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkVideoReferenceSlotKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((int8_t*)&forMarshaling->slotIndex, sizeof(int8_t));
+    marshal_VkVideoPictureResourceKHR(
+        vkStream, rootType, (const VkVideoPictureResourceKHR*)(forMarshaling->pPictureResource));
+}
+
+void unmarshal_VkVideoReferenceSlotKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkVideoReferenceSlotKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((int8_t*)&forUnmarshaling->slotIndex, sizeof(int8_t));
+    unmarshal_VkVideoPictureResourceKHR(
+        vkStream, rootType, (VkVideoPictureResourceKHR*)(forUnmarshaling->pPictureResource));
+}
+
+void marshal_VkVideoGetMemoryPropertiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkVideoGetMemoryPropertiesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->memoryBindIndex, sizeof(uint32_t));
+    marshal_VkMemoryRequirements2(vkStream, rootType,
+                                  (VkMemoryRequirements2*)(forMarshaling->pMemoryRequirements));
+}
+
+void unmarshal_VkVideoGetMemoryPropertiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkVideoGetMemoryPropertiesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->memoryBindIndex, sizeof(uint32_t));
+    unmarshal_VkMemoryRequirements2(vkStream, rootType,
+                                    (VkMemoryRequirements2*)(forUnmarshaling->pMemoryRequirements));
+}
+
+void marshal_VkVideoBindMemoryKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkVideoBindMemoryKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->memoryBindIndex, sizeof(uint32_t));
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&forMarshaling->memory, &cgen_var_0,
+                                                             1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkDeviceSize*)&forMarshaling->memoryOffset, sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->memorySize, sizeof(VkDeviceSize));
+}
+
+void unmarshal_VkVideoBindMemoryKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkVideoBindMemoryKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->memoryBindIndex, sizeof(uint32_t));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkDeviceMemory(
+        &cgen_var_0, (VkDeviceMemory*)&forUnmarshaling->memory, 1);
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->memoryOffset, sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->memorySize, sizeof(VkDeviceSize));
+}
+
+void marshal_VkVideoSessionCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkVideoSessionCreateInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->queueFamilyIndex, sizeof(uint32_t));
+    vkStream->write((VkVideoSessionCreateFlagsKHR*)&forMarshaling->flags,
+                    sizeof(VkVideoSessionCreateFlagsKHR));
+    marshal_VkVideoProfileKHR(vkStream, rootType,
+                              (const VkVideoProfileKHR*)(forMarshaling->pVideoProfile));
+    vkStream->write((VkFormat*)&forMarshaling->pictureFormat, sizeof(VkFormat));
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->maxCodedExtent));
+    vkStream->write((VkFormat*)&forMarshaling->referencePicturesFormat, sizeof(VkFormat));
+    vkStream->write((uint32_t*)&forMarshaling->maxReferencePicturesSlotsCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxReferencePicturesActiveCount, sizeof(uint32_t));
+}
+
+void unmarshal_VkVideoSessionCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkVideoSessionCreateInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->queueFamilyIndex, sizeof(uint32_t));
+    vkStream->read((VkVideoSessionCreateFlagsKHR*)&forUnmarshaling->flags,
+                   sizeof(VkVideoSessionCreateFlagsKHR));
+    unmarshal_VkVideoProfileKHR(vkStream, rootType,
+                                (VkVideoProfileKHR*)(forUnmarshaling->pVideoProfile));
+    vkStream->read((VkFormat*)&forUnmarshaling->pictureFormat, sizeof(VkFormat));
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->maxCodedExtent));
+    vkStream->read((VkFormat*)&forUnmarshaling->referencePicturesFormat, sizeof(VkFormat));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxReferencePicturesSlotsCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxReferencePicturesActiveCount, sizeof(uint32_t));
+}
+
+void marshal_VkVideoSessionParametersCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoSessionParametersCreateInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->videoSessionParametersTemplate;
+    vkStream->putBe64(cgen_var_0);
+    uint64_t cgen_var_1 = (uint64_t)forMarshaling->videoSession;
+    vkStream->putBe64(cgen_var_1);
+}
+
+void unmarshal_VkVideoSessionParametersCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoSessionParametersCreateInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    forUnmarshaling->videoSessionParametersTemplate =
+        (VkVideoSessionParametersKHR)vkStream->getBe64();
+    forUnmarshaling->videoSession = (VkVideoSessionKHR)vkStream->getBe64();
+}
+
+void marshal_VkVideoSessionParametersUpdateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoSessionParametersUpdateInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->updateSequenceCount, sizeof(uint32_t));
+}
+
+void unmarshal_VkVideoSessionParametersUpdateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoSessionParametersUpdateInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->updateSequenceCount, sizeof(uint32_t));
+}
+
+void marshal_VkVideoBeginCodingInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkVideoBeginCodingInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkVideoBeginCodingFlagsKHR*)&forMarshaling->flags,
+                    sizeof(VkVideoBeginCodingFlagsKHR));
+    vkStream->write((VkVideoCodingQualityPresetFlagsKHR*)&forMarshaling->codecQualityPreset,
+                    sizeof(VkVideoCodingQualityPresetFlagsKHR));
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->videoSession;
+    vkStream->putBe64(cgen_var_0);
+    uint64_t cgen_var_1 = (uint64_t)forMarshaling->videoSessionParameters;
+    vkStream->putBe64(cgen_var_1);
+    vkStream->write((uint32_t*)&forMarshaling->referenceSlotCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->referenceSlotCount; ++i) {
+            marshal_VkVideoReferenceSlotKHR(
+                vkStream, rootType,
+                (const VkVideoReferenceSlotKHR*)(forMarshaling->pReferenceSlots + i));
+        }
+    }
+}
+
+void unmarshal_VkVideoBeginCodingInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkVideoBeginCodingInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkVideoBeginCodingFlagsKHR*)&forUnmarshaling->flags,
+                   sizeof(VkVideoBeginCodingFlagsKHR));
+    vkStream->read((VkVideoCodingQualityPresetFlagsKHR*)&forUnmarshaling->codecQualityPreset,
+                   sizeof(VkVideoCodingQualityPresetFlagsKHR));
+    forUnmarshaling->videoSession = (VkVideoSessionKHR)vkStream->getBe64();
+    forUnmarshaling->videoSessionParameters = (VkVideoSessionParametersKHR)vkStream->getBe64();
+    vkStream->read((uint32_t*)&forUnmarshaling->referenceSlotCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->referenceSlotCount; ++i) {
+            unmarshal_VkVideoReferenceSlotKHR(
+                vkStream, rootType,
+                (VkVideoReferenceSlotKHR*)(forUnmarshaling->pReferenceSlots + i));
+        }
+    }
+}
+
+void marshal_VkVideoEndCodingInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkVideoEndCodingInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkVideoEndCodingFlagsKHR*)&forMarshaling->flags,
+                    sizeof(VkVideoEndCodingFlagsKHR));
+}
+
+void unmarshal_VkVideoEndCodingInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkVideoEndCodingInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkVideoEndCodingFlagsKHR*)&forUnmarshaling->flags,
+                   sizeof(VkVideoEndCodingFlagsKHR));
+}
+
+void marshal_VkVideoCodingControlInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkVideoCodingControlInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkVideoCodingControlFlagsKHR*)&forMarshaling->flags,
+                    sizeof(VkVideoCodingControlFlagsKHR));
+}
+
+void unmarshal_VkVideoCodingControlInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkVideoCodingControlInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkVideoCodingControlFlagsKHR*)&forUnmarshaling->flags,
+                   sizeof(VkVideoCodingControlFlagsKHR));
+}
+
+#endif
+#ifdef VK_KHR_video_decode_queue
+void marshal_VkVideoDecodeInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkVideoDecodeInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkVideoDecodeFlagsKHR*)&forMarshaling->flags, sizeof(VkVideoDecodeFlagsKHR));
+    marshal_VkOffset2D(vkStream, rootType, (VkOffset2D*)(&forMarshaling->codedOffset));
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->codedExtent));
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkBuffer_u64(&forMarshaling->srcBuffer, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkDeviceSize*)&forMarshaling->srcBufferOffset, sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->srcBufferRange, sizeof(VkDeviceSize));
+    marshal_VkVideoPictureResourceKHR(
+        vkStream, rootType, (VkVideoPictureResourceKHR*)(&forMarshaling->dstPictureResource));
+    marshal_VkVideoReferenceSlotKHR(
+        vkStream, rootType, (const VkVideoReferenceSlotKHR*)(forMarshaling->pSetupReferenceSlot));
+    vkStream->write((uint32_t*)&forMarshaling->referenceSlotCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->referenceSlotCount; ++i) {
+            marshal_VkVideoReferenceSlotKHR(
+                vkStream, rootType,
+                (const VkVideoReferenceSlotKHR*)(forMarshaling->pReferenceSlots + i));
+        }
+    }
+}
+
+void unmarshal_VkVideoDecodeInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkVideoDecodeInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkVideoDecodeFlagsKHR*)&forUnmarshaling->flags, sizeof(VkVideoDecodeFlagsKHR));
+    unmarshal_VkOffset2D(vkStream, rootType, (VkOffset2D*)(&forUnmarshaling->codedOffset));
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->codedExtent));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_0,
+                                                       (VkBuffer*)&forUnmarshaling->srcBuffer, 1);
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->srcBufferOffset, sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->srcBufferRange, sizeof(VkDeviceSize));
+    unmarshal_VkVideoPictureResourceKHR(
+        vkStream, rootType, (VkVideoPictureResourceKHR*)(&forUnmarshaling->dstPictureResource));
+    unmarshal_VkVideoReferenceSlotKHR(
+        vkStream, rootType, (VkVideoReferenceSlotKHR*)(forUnmarshaling->pSetupReferenceSlot));
+    vkStream->read((uint32_t*)&forUnmarshaling->referenceSlotCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->referenceSlotCount; ++i) {
+            unmarshal_VkVideoReferenceSlotKHR(
+                vkStream, rootType,
+                (VkVideoReferenceSlotKHR*)(forUnmarshaling->pReferenceSlots + i));
+        }
+    }
+}
+
+#endif
+#ifdef VK_KHR_dynamic_rendering
+void marshal_VkRenderingAttachmentInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkRenderingAttachmentInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkImageView_u64(&forMarshaling->imageView, &cgen_var_0,
+                                                          1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkImageLayout*)&forMarshaling->imageLayout, sizeof(VkImageLayout));
+    vkStream->write((VkResolveModeFlagBits*)&forMarshaling->resolveMode,
+                    sizeof(VkResolveModeFlagBits));
+    uint64_t cgen_var_1;
+    vkStream->handleMapping()->mapHandles_VkImageView_u64(&forMarshaling->resolveImageView,
+                                                          &cgen_var_1, 1);
+    vkStream->write((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->write((VkImageLayout*)&forMarshaling->resolveImageLayout, sizeof(VkImageLayout));
+    vkStream->write((VkAttachmentLoadOp*)&forMarshaling->loadOp, sizeof(VkAttachmentLoadOp));
+    vkStream->write((VkAttachmentStoreOp*)&forMarshaling->storeOp, sizeof(VkAttachmentStoreOp));
+    marshal_VkClearValue(vkStream, rootType, (VkClearValue*)(&forMarshaling->clearValue));
+}
+
+void unmarshal_VkRenderingAttachmentInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkRenderingAttachmentInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkImageView(
+        &cgen_var_0, (VkImageView*)&forUnmarshaling->imageView, 1);
+    vkStream->read((VkImageLayout*)&forUnmarshaling->imageLayout, sizeof(VkImageLayout));
+    vkStream->read((VkResolveModeFlagBits*)&forUnmarshaling->resolveMode,
+                   sizeof(VkResolveModeFlagBits));
+    uint64_t cgen_var_1;
+    vkStream->read((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkImageView(
+        &cgen_var_1, (VkImageView*)&forUnmarshaling->resolveImageView, 1);
+    vkStream->read((VkImageLayout*)&forUnmarshaling->resolveImageLayout, sizeof(VkImageLayout));
+    vkStream->read((VkAttachmentLoadOp*)&forUnmarshaling->loadOp, sizeof(VkAttachmentLoadOp));
+    vkStream->read((VkAttachmentStoreOp*)&forUnmarshaling->storeOp, sizeof(VkAttachmentStoreOp));
+    unmarshal_VkClearValue(vkStream, rootType, (VkClearValue*)(&forUnmarshaling->clearValue));
+}
+
+void marshal_VkRenderingInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkRenderingInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkRenderingFlagsKHR*)&forMarshaling->flags, sizeof(VkRenderingFlagsKHR));
+    marshal_VkRect2D(vkStream, rootType, (VkRect2D*)(&forMarshaling->renderArea));
+    vkStream->write((uint32_t*)&forMarshaling->layerCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->viewMask, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->colorAttachmentCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->colorAttachmentCount; ++i) {
+            marshal_VkRenderingAttachmentInfoKHR(
+                vkStream, rootType,
+                (const VkRenderingAttachmentInfoKHR*)(forMarshaling->pColorAttachments + i));
+        }
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pDepthAttachment;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pDepthAttachment) {
+        marshal_VkRenderingAttachmentInfoKHR(
+            vkStream, rootType,
+            (const VkRenderingAttachmentInfoKHR*)(forMarshaling->pDepthAttachment));
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pStencilAttachment;
+    vkStream->putBe64(cgen_var_1);
+    if (forMarshaling->pStencilAttachment) {
+        marshal_VkRenderingAttachmentInfoKHR(
+            vkStream, rootType,
+            (const VkRenderingAttachmentInfoKHR*)(forMarshaling->pStencilAttachment));
+    }
+}
+
+void unmarshal_VkRenderingInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkRenderingInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkRenderingFlagsKHR*)&forUnmarshaling->flags, sizeof(VkRenderingFlagsKHR));
+    unmarshal_VkRect2D(vkStream, rootType, (VkRect2D*)(&forUnmarshaling->renderArea));
+    vkStream->read((uint32_t*)&forUnmarshaling->layerCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->viewMask, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->colorAttachmentCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->colorAttachmentCount; ++i) {
+            unmarshal_VkRenderingAttachmentInfoKHR(
+                vkStream, rootType,
+                (VkRenderingAttachmentInfoKHR*)(forUnmarshaling->pColorAttachments + i));
+        }
+    }
+    // WARNING PTR CHECK
+    const VkRenderingAttachmentInfoKHR* check_pDepthAttachment;
+    check_pDepthAttachment = (const VkRenderingAttachmentInfoKHR*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pDepthAttachment) {
+        if (!(check_pDepthAttachment)) {
+            fprintf(
+                stderr,
+                "fatal: forUnmarshaling->pDepthAttachment inconsistent between guest and host\n");
+        }
+        unmarshal_VkRenderingAttachmentInfoKHR(
+            vkStream, rootType, (VkRenderingAttachmentInfoKHR*)(forUnmarshaling->pDepthAttachment));
+    }
+    // WARNING PTR CHECK
+    const VkRenderingAttachmentInfoKHR* check_pStencilAttachment;
+    check_pStencilAttachment = (const VkRenderingAttachmentInfoKHR*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pStencilAttachment) {
+        if (!(check_pStencilAttachment)) {
+            fprintf(
+                stderr,
+                "fatal: forUnmarshaling->pStencilAttachment inconsistent between guest and host\n");
+        }
+        unmarshal_VkRenderingAttachmentInfoKHR(
+            vkStream, rootType,
+            (VkRenderingAttachmentInfoKHR*)(forUnmarshaling->pStencilAttachment));
+    }
+}
+
+void marshal_VkPipelineRenderingCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRenderingCreateInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->viewMask, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->colorAttachmentCount, sizeof(uint32_t));
+    vkStream->write((const VkFormat*)forMarshaling->pColorAttachmentFormats,
+                    forMarshaling->colorAttachmentCount * sizeof(const VkFormat));
+    vkStream->write((VkFormat*)&forMarshaling->depthAttachmentFormat, sizeof(VkFormat));
+    vkStream->write((VkFormat*)&forMarshaling->stencilAttachmentFormat, sizeof(VkFormat));
+}
+
+void unmarshal_VkPipelineRenderingCreateInfoKHR(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkPipelineRenderingCreateInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->viewMask, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->colorAttachmentCount, sizeof(uint32_t));
+    vkStream->read((VkFormat*)forUnmarshaling->pColorAttachmentFormats,
+                   forUnmarshaling->colorAttachmentCount * sizeof(const VkFormat));
+    vkStream->read((VkFormat*)&forUnmarshaling->depthAttachmentFormat, sizeof(VkFormat));
+    vkStream->read((VkFormat*)&forUnmarshaling->stencilAttachmentFormat, sizeof(VkFormat));
+}
+
+void marshal_VkPhysicalDeviceDynamicRenderingFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDynamicRenderingFeaturesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->dynamicRendering, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceDynamicRenderingFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceDynamicRenderingFeaturesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->dynamicRendering, sizeof(VkBool32));
+}
+
+void marshal_VkCommandBufferInheritanceRenderingInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCommandBufferInheritanceRenderingInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkRenderingFlagsKHR*)&forMarshaling->flags, sizeof(VkRenderingFlagsKHR));
+    vkStream->write((uint32_t*)&forMarshaling->viewMask, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->colorAttachmentCount, sizeof(uint32_t));
+    vkStream->write((const VkFormat*)forMarshaling->pColorAttachmentFormats,
+                    forMarshaling->colorAttachmentCount * sizeof(const VkFormat));
+    vkStream->write((VkFormat*)&forMarshaling->depthAttachmentFormat, sizeof(VkFormat));
+    vkStream->write((VkFormat*)&forMarshaling->stencilAttachmentFormat, sizeof(VkFormat));
+    vkStream->write((VkSampleCountFlagBits*)&forMarshaling->rasterizationSamples,
+                    sizeof(VkSampleCountFlagBits));
+}
+
+void unmarshal_VkCommandBufferInheritanceRenderingInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkCommandBufferInheritanceRenderingInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkRenderingFlagsKHR*)&forUnmarshaling->flags, sizeof(VkRenderingFlagsKHR));
+    vkStream->read((uint32_t*)&forUnmarshaling->viewMask, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->colorAttachmentCount, sizeof(uint32_t));
+    vkStream->read((VkFormat*)forUnmarshaling->pColorAttachmentFormats,
+                   forUnmarshaling->colorAttachmentCount * sizeof(const VkFormat));
+    vkStream->read((VkFormat*)&forUnmarshaling->depthAttachmentFormat, sizeof(VkFormat));
+    vkStream->read((VkFormat*)&forUnmarshaling->stencilAttachmentFormat, sizeof(VkFormat));
+    vkStream->read((VkSampleCountFlagBits*)&forUnmarshaling->rasterizationSamples,
+                   sizeof(VkSampleCountFlagBits));
+}
+
+void marshal_VkRenderingFragmentShadingRateAttachmentInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRenderingFragmentShadingRateAttachmentInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkImageView_u64(&forMarshaling->imageView, &cgen_var_0,
+                                                          1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkImageLayout*)&forMarshaling->imageLayout, sizeof(VkImageLayout));
+    marshal_VkExtent2D(vkStream, rootType,
+                       (VkExtent2D*)(&forMarshaling->shadingRateAttachmentTexelSize));
+}
+
+void unmarshal_VkRenderingFragmentShadingRateAttachmentInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkRenderingFragmentShadingRateAttachmentInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkImageView(
+        &cgen_var_0, (VkImageView*)&forUnmarshaling->imageView, 1);
+    vkStream->read((VkImageLayout*)&forUnmarshaling->imageLayout, sizeof(VkImageLayout));
+    unmarshal_VkExtent2D(vkStream, rootType,
+                         (VkExtent2D*)(&forUnmarshaling->shadingRateAttachmentTexelSize));
+}
+
+void marshal_VkRenderingFragmentDensityMapAttachmentInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRenderingFragmentDensityMapAttachmentInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkImageView_u64(&forMarshaling->imageView, &cgen_var_0,
+                                                          1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkImageLayout*)&forMarshaling->imageLayout, sizeof(VkImageLayout));
+}
+
+void unmarshal_VkRenderingFragmentDensityMapAttachmentInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkRenderingFragmentDensityMapAttachmentInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkImageView(
+        &cgen_var_0, (VkImageView*)&forUnmarshaling->imageView, 1);
+    vkStream->read((VkImageLayout*)&forUnmarshaling->imageLayout, sizeof(VkImageLayout));
+}
+
+void marshal_VkAttachmentSampleCountInfoAMD(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkAttachmentSampleCountInfoAMD* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->colorAttachmentCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pColorAttachmentSamples;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pColorAttachmentSamples) {
+        vkStream->write((const VkSampleCountFlagBits*)forMarshaling->pColorAttachmentSamples,
+                        forMarshaling->colorAttachmentCount * sizeof(const VkSampleCountFlagBits));
+    }
+    vkStream->write((VkSampleCountFlagBits*)&forMarshaling->depthStencilAttachmentSamples,
+                    sizeof(VkSampleCountFlagBits));
+}
+
+void unmarshal_VkAttachmentSampleCountInfoAMD(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkAttachmentSampleCountInfoAMD* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->colorAttachmentCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const VkSampleCountFlagBits* check_pColorAttachmentSamples;
+    check_pColorAttachmentSamples = (const VkSampleCountFlagBits*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pColorAttachmentSamples) {
+        if (!(check_pColorAttachmentSamples)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pColorAttachmentSamples inconsistent between guest "
+                    "and host\n");
+        }
+        vkStream->read((VkSampleCountFlagBits*)forUnmarshaling->pColorAttachmentSamples,
+                       forUnmarshaling->colorAttachmentCount * sizeof(const VkSampleCountFlagBits));
+    }
+    vkStream->read((VkSampleCountFlagBits*)&forUnmarshaling->depthStencilAttachmentSamples,
+                   sizeof(VkSampleCountFlagBits));
+}
+
+void marshal_VkMultiviewPerViewAttributesInfoNVX(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMultiviewPerViewAttributesInfoNVX* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->perViewAttributes, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->perViewAttributesPositionXOnly, sizeof(VkBool32));
+}
+
+void unmarshal_VkMultiviewPerViewAttributesInfoNVX(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkMultiviewPerViewAttributesInfoNVX* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->perViewAttributes, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->perViewAttributesPositionXOnly, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_KHR_multiview
+#endif
+#ifdef VK_KHR_get_physical_device_properties2
+#endif
+#ifdef VK_KHR_device_group
+#endif
+#ifdef VK_KHR_shader_draw_parameters
+#endif
+#ifdef VK_KHR_maintenance1
+#endif
+#ifdef VK_KHR_device_group_creation
+#endif
+#ifdef VK_KHR_external_memory_capabilities
+#endif
+#ifdef VK_KHR_external_memory
+#endif
+#ifdef VK_KHR_external_memory_win32
+void marshal_VkImportMemoryWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportMemoryWin32HandleInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkExternalMemoryHandleTypeFlagBits*)&forMarshaling->handleType,
+                    sizeof(VkExternalMemoryHandleTypeFlagBits));
+    vkStream->write((HANDLE*)&forMarshaling->handle, sizeof(HANDLE));
+    vkStream->write((LPCWSTR*)&forMarshaling->name, sizeof(LPCWSTR));
+}
+
+void unmarshal_VkImportMemoryWin32HandleInfoKHR(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkImportMemoryWin32HandleInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkExternalMemoryHandleTypeFlagBits*)&forUnmarshaling->handleType,
+                   sizeof(VkExternalMemoryHandleTypeFlagBits));
+    vkStream->read((HANDLE*)&forUnmarshaling->handle, sizeof(HANDLE));
+    vkStream->read((LPCWSTR*)&forUnmarshaling->name, sizeof(LPCWSTR));
+}
+
+void marshal_VkExportMemoryWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExportMemoryWin32HandleInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pAttributes;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pAttributes) {
+        vkStream->write((const SECURITY_ATTRIBUTES*)forMarshaling->pAttributes,
+                        sizeof(const SECURITY_ATTRIBUTES));
+    }
+    vkStream->write((DWORD*)&forMarshaling->dwAccess, sizeof(DWORD));
+    vkStream->write((LPCWSTR*)&forMarshaling->name, sizeof(LPCWSTR));
+}
+
+void unmarshal_VkExportMemoryWin32HandleInfoKHR(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkExportMemoryWin32HandleInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    // WARNING PTR CHECK
+    const SECURITY_ATTRIBUTES* check_pAttributes;
+    check_pAttributes = (const SECURITY_ATTRIBUTES*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pAttributes) {
+        if (!(check_pAttributes)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pAttributes inconsistent between guest and host\n");
+        }
+        vkStream->read((SECURITY_ATTRIBUTES*)forUnmarshaling->pAttributes,
+                       sizeof(const SECURITY_ATTRIBUTES));
+    }
+    vkStream->read((DWORD*)&forUnmarshaling->dwAccess, sizeof(DWORD));
+    vkStream->read((LPCWSTR*)&forUnmarshaling->name, sizeof(LPCWSTR));
+}
+
+void marshal_VkMemoryWin32HandlePropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryWin32HandlePropertiesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->memoryTypeBits, sizeof(uint32_t));
+}
+
+void unmarshal_VkMemoryWin32HandlePropertiesKHR(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkMemoryWin32HandlePropertiesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->memoryTypeBits, sizeof(uint32_t));
+}
+
+void marshal_VkMemoryGetWin32HandleInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkMemoryGetWin32HandleInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&forMarshaling->memory, &cgen_var_0,
+                                                             1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkExternalMemoryHandleTypeFlagBits*)&forMarshaling->handleType,
+                    sizeof(VkExternalMemoryHandleTypeFlagBits));
+}
+
+void unmarshal_VkMemoryGetWin32HandleInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkMemoryGetWin32HandleInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkDeviceMemory(
+        &cgen_var_0, (VkDeviceMemory*)&forUnmarshaling->memory, 1);
+    vkStream->read((VkExternalMemoryHandleTypeFlagBits*)&forUnmarshaling->handleType,
+                   sizeof(VkExternalMemoryHandleTypeFlagBits));
+}
+
+#endif
+#ifdef VK_KHR_external_memory_fd
+void marshal_VkImportMemoryFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkImportMemoryFdInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkExternalMemoryHandleTypeFlagBits*)&forMarshaling->handleType,
+                    sizeof(VkExternalMemoryHandleTypeFlagBits));
+    vkStream->write((int*)&forMarshaling->fd, sizeof(int));
+}
+
+void unmarshal_VkImportMemoryFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkImportMemoryFdInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkExternalMemoryHandleTypeFlagBits*)&forUnmarshaling->handleType,
+                   sizeof(VkExternalMemoryHandleTypeFlagBits));
+    vkStream->read((int*)&forUnmarshaling->fd, sizeof(int));
+}
+
+void marshal_VkMemoryFdPropertiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkMemoryFdPropertiesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->memoryTypeBits, sizeof(uint32_t));
+}
+
+void unmarshal_VkMemoryFdPropertiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkMemoryFdPropertiesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->memoryTypeBits, sizeof(uint32_t));
+}
+
+void marshal_VkMemoryGetFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkMemoryGetFdInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&forMarshaling->memory, &cgen_var_0,
+                                                             1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkExternalMemoryHandleTypeFlagBits*)&forMarshaling->handleType,
+                    sizeof(VkExternalMemoryHandleTypeFlagBits));
+}
+
+void unmarshal_VkMemoryGetFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkMemoryGetFdInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkDeviceMemory(
+        &cgen_var_0, (VkDeviceMemory*)&forUnmarshaling->memory, 1);
+    vkStream->read((VkExternalMemoryHandleTypeFlagBits*)&forUnmarshaling->handleType,
+                   sizeof(VkExternalMemoryHandleTypeFlagBits));
+}
+
+#endif
+#ifdef VK_KHR_win32_keyed_mutex
+void marshal_VkWin32KeyedMutexAcquireReleaseInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkWin32KeyedMutexAcquireReleaseInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->acquireCount, sizeof(uint32_t));
+    if (forMarshaling->acquireCount) {
+        uint64_t* cgen_var_0;
+        vkStream->alloc((void**)&cgen_var_0, forMarshaling->acquireCount * 8);
+        vkStream->handleMapping()->mapHandles_VkDeviceMemory_u64(
+            forMarshaling->pAcquireSyncs, cgen_var_0, forMarshaling->acquireCount);
+        vkStream->write((uint64_t*)cgen_var_0, forMarshaling->acquireCount * 8);
+    }
+    vkStream->write((const uint64_t*)forMarshaling->pAcquireKeys,
+                    forMarshaling->acquireCount * sizeof(const uint64_t));
+    vkStream->write((const uint32_t*)forMarshaling->pAcquireTimeouts,
+                    forMarshaling->acquireCount * sizeof(const uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->releaseCount, sizeof(uint32_t));
+    if (forMarshaling->releaseCount) {
+        uint64_t* cgen_var_1;
+        vkStream->alloc((void**)&cgen_var_1, forMarshaling->releaseCount * 8);
+        vkStream->handleMapping()->mapHandles_VkDeviceMemory_u64(
+            forMarshaling->pReleaseSyncs, cgen_var_1, forMarshaling->releaseCount);
+        vkStream->write((uint64_t*)cgen_var_1, forMarshaling->releaseCount * 8);
+    }
+    vkStream->write((const uint64_t*)forMarshaling->pReleaseKeys,
+                    forMarshaling->releaseCount * sizeof(const uint64_t));
+}
+
+void unmarshal_VkWin32KeyedMutexAcquireReleaseInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkWin32KeyedMutexAcquireReleaseInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->acquireCount, sizeof(uint32_t));
+    if (forUnmarshaling->acquireCount) {
+        uint64_t* cgen_var_0;
+        vkStream->alloc((void**)&cgen_var_0, forUnmarshaling->acquireCount * 8);
+        vkStream->read((uint64_t*)cgen_var_0, forUnmarshaling->acquireCount * 8);
+        vkStream->handleMapping()->mapHandles_u64_VkDeviceMemory(
+            cgen_var_0, (VkDeviceMemory*)forUnmarshaling->pAcquireSyncs,
+            forUnmarshaling->acquireCount);
+    }
+    vkStream->read((uint64_t*)forUnmarshaling->pAcquireKeys,
+                   forUnmarshaling->acquireCount * sizeof(const uint64_t));
+    vkStream->read((uint32_t*)forUnmarshaling->pAcquireTimeouts,
+                   forUnmarshaling->acquireCount * sizeof(const uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->releaseCount, sizeof(uint32_t));
+    if (forUnmarshaling->releaseCount) {
+        uint64_t* cgen_var_1;
+        vkStream->alloc((void**)&cgen_var_1, forUnmarshaling->releaseCount * 8);
+        vkStream->read((uint64_t*)cgen_var_1, forUnmarshaling->releaseCount * 8);
+        vkStream->handleMapping()->mapHandles_u64_VkDeviceMemory(
+            cgen_var_1, (VkDeviceMemory*)forUnmarshaling->pReleaseSyncs,
+            forUnmarshaling->releaseCount);
+    }
+    vkStream->read((uint64_t*)forUnmarshaling->pReleaseKeys,
+                   forUnmarshaling->releaseCount * sizeof(const uint64_t));
+}
+
+#endif
+#ifdef VK_KHR_external_semaphore_capabilities
+#endif
+#ifdef VK_KHR_external_semaphore
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+void marshal_VkImportSemaphoreWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportSemaphoreWin32HandleInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkSemaphore_u64(&forMarshaling->semaphore, &cgen_var_0,
+                                                          1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkSemaphoreImportFlags*)&forMarshaling->flags, sizeof(VkSemaphoreImportFlags));
+    vkStream->write((VkExternalSemaphoreHandleTypeFlagBits*)&forMarshaling->handleType,
+                    sizeof(VkExternalSemaphoreHandleTypeFlagBits));
+    vkStream->write((HANDLE*)&forMarshaling->handle, sizeof(HANDLE));
+    vkStream->write((LPCWSTR*)&forMarshaling->name, sizeof(LPCWSTR));
+}
+
+void unmarshal_VkImportSemaphoreWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkImportSemaphoreWin32HandleInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkSemaphore(
+        &cgen_var_0, (VkSemaphore*)&forUnmarshaling->semaphore, 1);
+    vkStream->read((VkSemaphoreImportFlags*)&forUnmarshaling->flags,
+                   sizeof(VkSemaphoreImportFlags));
+    vkStream->read((VkExternalSemaphoreHandleTypeFlagBits*)&forUnmarshaling->handleType,
+                   sizeof(VkExternalSemaphoreHandleTypeFlagBits));
+    vkStream->read((HANDLE*)&forUnmarshaling->handle, sizeof(HANDLE));
+    vkStream->read((LPCWSTR*)&forUnmarshaling->name, sizeof(LPCWSTR));
+}
+
+void marshal_VkExportSemaphoreWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExportSemaphoreWin32HandleInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pAttributes;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pAttributes) {
+        vkStream->write((const SECURITY_ATTRIBUTES*)forMarshaling->pAttributes,
+                        sizeof(const SECURITY_ATTRIBUTES));
+    }
+    vkStream->write((DWORD*)&forMarshaling->dwAccess, sizeof(DWORD));
+    vkStream->write((LPCWSTR*)&forMarshaling->name, sizeof(LPCWSTR));
+}
+
+void unmarshal_VkExportSemaphoreWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkExportSemaphoreWin32HandleInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    // WARNING PTR CHECK
+    const SECURITY_ATTRIBUTES* check_pAttributes;
+    check_pAttributes = (const SECURITY_ATTRIBUTES*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pAttributes) {
+        if (!(check_pAttributes)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pAttributes inconsistent between guest and host\n");
+        }
+        vkStream->read((SECURITY_ATTRIBUTES*)forUnmarshaling->pAttributes,
+                       sizeof(const SECURITY_ATTRIBUTES));
+    }
+    vkStream->read((DWORD*)&forUnmarshaling->dwAccess, sizeof(DWORD));
+    vkStream->read((LPCWSTR*)&forUnmarshaling->name, sizeof(LPCWSTR));
+}
+
+void marshal_VkD3D12FenceSubmitInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkD3D12FenceSubmitInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->waitSemaphoreValuesCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pWaitSemaphoreValues;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pWaitSemaphoreValues) {
+        vkStream->write((const uint64_t*)forMarshaling->pWaitSemaphoreValues,
+                        forMarshaling->waitSemaphoreValuesCount * sizeof(const uint64_t));
+    }
+    vkStream->write((uint32_t*)&forMarshaling->signalSemaphoreValuesCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pSignalSemaphoreValues;
+    vkStream->putBe64(cgen_var_1);
+    if (forMarshaling->pSignalSemaphoreValues) {
+        vkStream->write((const uint64_t*)forMarshaling->pSignalSemaphoreValues,
+                        forMarshaling->signalSemaphoreValuesCount * sizeof(const uint64_t));
+    }
+}
+
+void unmarshal_VkD3D12FenceSubmitInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkD3D12FenceSubmitInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->waitSemaphoreValuesCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const uint64_t* check_pWaitSemaphoreValues;
+    check_pWaitSemaphoreValues = (const uint64_t*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pWaitSemaphoreValues) {
+        if (!(check_pWaitSemaphoreValues)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pWaitSemaphoreValues inconsistent between guest and "
+                    "host\n");
+        }
+        vkStream->read((uint64_t*)forUnmarshaling->pWaitSemaphoreValues,
+                       forUnmarshaling->waitSemaphoreValuesCount * sizeof(const uint64_t));
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->signalSemaphoreValuesCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const uint64_t* check_pSignalSemaphoreValues;
+    check_pSignalSemaphoreValues = (const uint64_t*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pSignalSemaphoreValues) {
+        if (!(check_pSignalSemaphoreValues)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pSignalSemaphoreValues inconsistent between guest and "
+                    "host\n");
+        }
+        vkStream->read((uint64_t*)forUnmarshaling->pSignalSemaphoreValues,
+                       forUnmarshaling->signalSemaphoreValuesCount * sizeof(const uint64_t));
+    }
+}
+
+void marshal_VkSemaphoreGetWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSemaphoreGetWin32HandleInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkSemaphore_u64(&forMarshaling->semaphore, &cgen_var_0,
+                                                          1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkExternalSemaphoreHandleTypeFlagBits*)&forMarshaling->handleType,
+                    sizeof(VkExternalSemaphoreHandleTypeFlagBits));
+}
+
+void unmarshal_VkSemaphoreGetWin32HandleInfoKHR(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkSemaphoreGetWin32HandleInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkSemaphore(
+        &cgen_var_0, (VkSemaphore*)&forUnmarshaling->semaphore, 1);
+    vkStream->read((VkExternalSemaphoreHandleTypeFlagBits*)&forUnmarshaling->handleType,
+                   sizeof(VkExternalSemaphoreHandleTypeFlagBits));
+}
+
+#endif
+#ifdef VK_KHR_external_semaphore_fd
+void marshal_VkImportSemaphoreFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkImportSemaphoreFdInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkSemaphore_u64(&forMarshaling->semaphore, &cgen_var_0,
+                                                          1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkSemaphoreImportFlags*)&forMarshaling->flags, sizeof(VkSemaphoreImportFlags));
+    vkStream->write((VkExternalSemaphoreHandleTypeFlagBits*)&forMarshaling->handleType,
+                    sizeof(VkExternalSemaphoreHandleTypeFlagBits));
+    vkStream->write((int*)&forMarshaling->fd, sizeof(int));
+}
+
+void unmarshal_VkImportSemaphoreFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkImportSemaphoreFdInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkSemaphore(
+        &cgen_var_0, (VkSemaphore*)&forUnmarshaling->semaphore, 1);
+    vkStream->read((VkSemaphoreImportFlags*)&forUnmarshaling->flags,
+                   sizeof(VkSemaphoreImportFlags));
+    vkStream->read((VkExternalSemaphoreHandleTypeFlagBits*)&forUnmarshaling->handleType,
+                   sizeof(VkExternalSemaphoreHandleTypeFlagBits));
+    vkStream->read((int*)&forUnmarshaling->fd, sizeof(int));
+}
+
+void marshal_VkSemaphoreGetFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkSemaphoreGetFdInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkSemaphore_u64(&forMarshaling->semaphore, &cgen_var_0,
+                                                          1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkExternalSemaphoreHandleTypeFlagBits*)&forMarshaling->handleType,
+                    sizeof(VkExternalSemaphoreHandleTypeFlagBits));
+}
+
+void unmarshal_VkSemaphoreGetFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkSemaphoreGetFdInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkSemaphore(
+        &cgen_var_0, (VkSemaphore*)&forUnmarshaling->semaphore, 1);
+    vkStream->read((VkExternalSemaphoreHandleTypeFlagBits*)&forUnmarshaling->handleType,
+                   sizeof(VkExternalSemaphoreHandleTypeFlagBits));
+}
+
+#endif
+#ifdef VK_KHR_push_descriptor
+void marshal_VkPhysicalDevicePushDescriptorPropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePushDescriptorPropertiesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->maxPushDescriptors, sizeof(uint32_t));
+}
+
+void unmarshal_VkPhysicalDevicePushDescriptorPropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevicePushDescriptorPropertiesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPushDescriptors, sizeof(uint32_t));
+}
+
+#endif
+#ifdef VK_KHR_shader_float16_int8
+#endif
+#ifdef VK_KHR_16bit_storage
+#endif
+#ifdef VK_KHR_incremental_present
+void marshal_VkRectLayerKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                            const VkRectLayerKHR* forMarshaling) {
+    (void)rootType;
+    marshal_VkOffset2D(vkStream, rootType, (VkOffset2D*)(&forMarshaling->offset));
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->extent));
+    vkStream->write((uint32_t*)&forMarshaling->layer, sizeof(uint32_t));
+}
+
+void unmarshal_VkRectLayerKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                              VkRectLayerKHR* forUnmarshaling) {
+    (void)rootType;
+    unmarshal_VkOffset2D(vkStream, rootType, (VkOffset2D*)(&forUnmarshaling->offset));
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->extent));
+    vkStream->read((uint32_t*)&forUnmarshaling->layer, sizeof(uint32_t));
+}
+
+void marshal_VkPresentRegionKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkPresentRegionKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->rectangleCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pRectangles;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pRectangles) {
+        if (forMarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forMarshaling->rectangleCount; ++i) {
+                marshal_VkRectLayerKHR(vkStream, rootType,
+                                       (const VkRectLayerKHR*)(forMarshaling->pRectangles + i));
+            }
+        }
+    }
+}
+
+void unmarshal_VkPresentRegionKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkPresentRegionKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->rectangleCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const VkRectLayerKHR* check_pRectangles;
+    check_pRectangles = (const VkRectLayerKHR*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pRectangles) {
+        if (!(check_pRectangles)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pRectangles inconsistent between guest and host\n");
+        }
+        if (forUnmarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->rectangleCount; ++i) {
+                unmarshal_VkRectLayerKHR(vkStream, rootType,
+                                         (VkRectLayerKHR*)(forUnmarshaling->pRectangles + i));
+            }
+        }
+    }
+}
+
+void marshal_VkPresentRegionsKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkPresentRegionsKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->swapchainCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pRegions;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pRegions) {
+        if (forMarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forMarshaling->swapchainCount; ++i) {
+                marshal_VkPresentRegionKHR(
+                    vkStream, rootType, (const VkPresentRegionKHR*)(forMarshaling->pRegions + i));
+            }
+        }
+    }
+}
+
+void unmarshal_VkPresentRegionsKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkPresentRegionsKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->swapchainCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const VkPresentRegionKHR* check_pRegions;
+    check_pRegions = (const VkPresentRegionKHR*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pRegions) {
+        if (!(check_pRegions)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pRegions inconsistent between guest and host\n");
+        }
+        if (forUnmarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->swapchainCount; ++i) {
+                unmarshal_VkPresentRegionKHR(vkStream, rootType,
+                                             (VkPresentRegionKHR*)(forUnmarshaling->pRegions + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_KHR_descriptor_update_template
+#endif
+#ifdef VK_KHR_imageless_framebuffer
+#endif
+#ifdef VK_KHR_create_renderpass2
+#endif
+#ifdef VK_KHR_shared_presentable_image
+void marshal_VkSharedPresentSurfaceCapabilitiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSharedPresentSurfaceCapabilitiesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkImageUsageFlags*)&forMarshaling->sharedPresentSupportedUsageFlags,
+                    sizeof(VkImageUsageFlags));
+}
+
+void unmarshal_VkSharedPresentSurfaceCapabilitiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkSharedPresentSurfaceCapabilitiesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkImageUsageFlags*)&forUnmarshaling->sharedPresentSupportedUsageFlags,
+                   sizeof(VkImageUsageFlags));
+}
+
+#endif
+#ifdef VK_KHR_external_fence_capabilities
+#endif
+#ifdef VK_KHR_external_fence
+#endif
+#ifdef VK_KHR_external_fence_win32
+void marshal_VkImportFenceWin32HandleInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkImportFenceWin32HandleInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkFence_u64(&forMarshaling->fence, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkFenceImportFlags*)&forMarshaling->flags, sizeof(VkFenceImportFlags));
+    vkStream->write((VkExternalFenceHandleTypeFlagBits*)&forMarshaling->handleType,
+                    sizeof(VkExternalFenceHandleTypeFlagBits));
+    vkStream->write((HANDLE*)&forMarshaling->handle, sizeof(HANDLE));
+    vkStream->write((LPCWSTR*)&forMarshaling->name, sizeof(LPCWSTR));
+}
+
+void unmarshal_VkImportFenceWin32HandleInfoKHR(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkImportFenceWin32HandleInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkFence(&cgen_var_0,
+                                                      (VkFence*)&forUnmarshaling->fence, 1);
+    vkStream->read((VkFenceImportFlags*)&forUnmarshaling->flags, sizeof(VkFenceImportFlags));
+    vkStream->read((VkExternalFenceHandleTypeFlagBits*)&forUnmarshaling->handleType,
+                   sizeof(VkExternalFenceHandleTypeFlagBits));
+    vkStream->read((HANDLE*)&forUnmarshaling->handle, sizeof(HANDLE));
+    vkStream->read((LPCWSTR*)&forUnmarshaling->name, sizeof(LPCWSTR));
+}
+
+void marshal_VkExportFenceWin32HandleInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkExportFenceWin32HandleInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pAttributes;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pAttributes) {
+        vkStream->write((const SECURITY_ATTRIBUTES*)forMarshaling->pAttributes,
+                        sizeof(const SECURITY_ATTRIBUTES));
+    }
+    vkStream->write((DWORD*)&forMarshaling->dwAccess, sizeof(DWORD));
+    vkStream->write((LPCWSTR*)&forMarshaling->name, sizeof(LPCWSTR));
+}
+
+void unmarshal_VkExportFenceWin32HandleInfoKHR(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkExportFenceWin32HandleInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    // WARNING PTR CHECK
+    const SECURITY_ATTRIBUTES* check_pAttributes;
+    check_pAttributes = (const SECURITY_ATTRIBUTES*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pAttributes) {
+        if (!(check_pAttributes)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pAttributes inconsistent between guest and host\n");
+        }
+        vkStream->read((SECURITY_ATTRIBUTES*)forUnmarshaling->pAttributes,
+                       sizeof(const SECURITY_ATTRIBUTES));
+    }
+    vkStream->read((DWORD*)&forUnmarshaling->dwAccess, sizeof(DWORD));
+    vkStream->read((LPCWSTR*)&forUnmarshaling->name, sizeof(LPCWSTR));
+}
+
+void marshal_VkFenceGetWin32HandleInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkFenceGetWin32HandleInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkFence_u64(&forMarshaling->fence, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkExternalFenceHandleTypeFlagBits*)&forMarshaling->handleType,
+                    sizeof(VkExternalFenceHandleTypeFlagBits));
+}
+
+void unmarshal_VkFenceGetWin32HandleInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkFenceGetWin32HandleInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkFence(&cgen_var_0,
+                                                      (VkFence*)&forUnmarshaling->fence, 1);
+    vkStream->read((VkExternalFenceHandleTypeFlagBits*)&forUnmarshaling->handleType,
+                   sizeof(VkExternalFenceHandleTypeFlagBits));
+}
+
+#endif
+#ifdef VK_KHR_external_fence_fd
+void marshal_VkImportFenceFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkImportFenceFdInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkFence_u64(&forMarshaling->fence, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkFenceImportFlags*)&forMarshaling->flags, sizeof(VkFenceImportFlags));
+    vkStream->write((VkExternalFenceHandleTypeFlagBits*)&forMarshaling->handleType,
+                    sizeof(VkExternalFenceHandleTypeFlagBits));
+    vkStream->write((int*)&forMarshaling->fd, sizeof(int));
+}
+
+void unmarshal_VkImportFenceFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      VkImportFenceFdInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkFence(&cgen_var_0,
+                                                      (VkFence*)&forUnmarshaling->fence, 1);
+    vkStream->read((VkFenceImportFlags*)&forUnmarshaling->flags, sizeof(VkFenceImportFlags));
+    vkStream->read((VkExternalFenceHandleTypeFlagBits*)&forUnmarshaling->handleType,
+                   sizeof(VkExternalFenceHandleTypeFlagBits));
+    vkStream->read((int*)&forUnmarshaling->fd, sizeof(int));
+}
+
+void marshal_VkFenceGetFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkFenceGetFdInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkFence_u64(&forMarshaling->fence, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkExternalFenceHandleTypeFlagBits*)&forMarshaling->handleType,
+                    sizeof(VkExternalFenceHandleTypeFlagBits));
+}
+
+void unmarshal_VkFenceGetFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkFenceGetFdInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkFence(&cgen_var_0,
+                                                      (VkFence*)&forUnmarshaling->fence, 1);
+    vkStream->read((VkExternalFenceHandleTypeFlagBits*)&forUnmarshaling->handleType,
+                   sizeof(VkExternalFenceHandleTypeFlagBits));
+}
+
+#endif
+#ifdef VK_KHR_performance_query
+void marshal_VkPhysicalDevicePerformanceQueryFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePerformanceQueryFeaturesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->performanceCounterQueryPools, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->performanceCounterMultipleQueryPools,
+                    sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDevicePerformanceQueryFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevicePerformanceQueryFeaturesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->performanceCounterQueryPools, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->performanceCounterMultipleQueryPools,
+                   sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDevicePerformanceQueryPropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePerformanceQueryPropertiesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->allowCommandBufferQueryCopies, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDevicePerformanceQueryPropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevicePerformanceQueryPropertiesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->allowCommandBufferQueryCopies, sizeof(VkBool32));
+}
+
+void marshal_VkPerformanceCounterKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkPerformanceCounterKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPerformanceCounterUnitKHR*)&forMarshaling->unit,
+                    sizeof(VkPerformanceCounterUnitKHR));
+    vkStream->write((VkPerformanceCounterScopeKHR*)&forMarshaling->scope,
+                    sizeof(VkPerformanceCounterScopeKHR));
+    vkStream->write((VkPerformanceCounterStorageKHR*)&forMarshaling->storage,
+                    sizeof(VkPerformanceCounterStorageKHR));
+    vkStream->write((uint8_t*)forMarshaling->uuid, VK_UUID_SIZE * sizeof(uint8_t));
+}
+
+void unmarshal_VkPerformanceCounterKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkPerformanceCounterKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPerformanceCounterUnitKHR*)&forUnmarshaling->unit,
+                   sizeof(VkPerformanceCounterUnitKHR));
+    vkStream->read((VkPerformanceCounterScopeKHR*)&forUnmarshaling->scope,
+                   sizeof(VkPerformanceCounterScopeKHR));
+    vkStream->read((VkPerformanceCounterStorageKHR*)&forUnmarshaling->storage,
+                   sizeof(VkPerformanceCounterStorageKHR));
+    vkStream->read((uint8_t*)forUnmarshaling->uuid, VK_UUID_SIZE * sizeof(uint8_t));
+}
+
+void marshal_VkPerformanceCounterDescriptionKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPerformanceCounterDescriptionKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPerformanceCounterDescriptionFlagsKHR*)&forMarshaling->flags,
+                    sizeof(VkPerformanceCounterDescriptionFlagsKHR));
+    vkStream->write((char*)forMarshaling->name, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    vkStream->write((char*)forMarshaling->category, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    vkStream->write((char*)forMarshaling->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+}
+
+void unmarshal_VkPerformanceCounterDescriptionKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPerformanceCounterDescriptionKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPerformanceCounterDescriptionFlagsKHR*)&forUnmarshaling->flags,
+                   sizeof(VkPerformanceCounterDescriptionFlagsKHR));
+    vkStream->read((char*)forUnmarshaling->name, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    vkStream->read((char*)forUnmarshaling->category, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    vkStream->read((char*)forUnmarshaling->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+}
+
+void marshal_VkQueryPoolPerformanceCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkQueryPoolPerformanceCreateInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->queueFamilyIndex, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->counterIndexCount, sizeof(uint32_t));
+    vkStream->write((const uint32_t*)forMarshaling->pCounterIndices,
+                    forMarshaling->counterIndexCount * sizeof(const uint32_t));
+}
+
+void unmarshal_VkQueryPoolPerformanceCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkQueryPoolPerformanceCreateInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->queueFamilyIndex, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->counterIndexCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)forUnmarshaling->pCounterIndices,
+                   forUnmarshaling->counterIndexCount * sizeof(const uint32_t));
+}
+
+void marshal_VkPerformanceCounterResultKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkPerformanceCounterResultKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((int32_t*)&forMarshaling->int32, sizeof(int32_t));
+}
+
+void unmarshal_VkPerformanceCounterResultKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkPerformanceCounterResultKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((int32_t*)&forUnmarshaling->int32, sizeof(int32_t));
+}
+
+void marshal_VkAcquireProfilingLockInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkAcquireProfilingLockInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkAcquireProfilingLockFlagsKHR*)&forMarshaling->flags,
+                    sizeof(VkAcquireProfilingLockFlagsKHR));
+    vkStream->write((uint64_t*)&forMarshaling->timeout, sizeof(uint64_t));
+}
+
+void unmarshal_VkAcquireProfilingLockInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkAcquireProfilingLockInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkAcquireProfilingLockFlagsKHR*)&forUnmarshaling->flags,
+                   sizeof(VkAcquireProfilingLockFlagsKHR));
+    vkStream->read((uint64_t*)&forUnmarshaling->timeout, sizeof(uint64_t));
+}
+
+void marshal_VkPerformanceQuerySubmitInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkPerformanceQuerySubmitInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->counterPassIndex, sizeof(uint32_t));
+}
+
+void unmarshal_VkPerformanceQuerySubmitInfoKHR(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkPerformanceQuerySubmitInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->counterPassIndex, sizeof(uint32_t));
+}
+
+#endif
+#ifdef VK_KHR_maintenance2
+#endif
+#ifdef VK_KHR_get_surface_capabilities2
+void marshal_VkPhysicalDeviceSurfaceInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkPhysicalDeviceSurfaceInfo2KHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&forMarshaling->surface, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+}
+
+void unmarshal_VkPhysicalDeviceSurfaceInfo2KHR(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkPhysicalDeviceSurfaceInfo2KHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkSurfaceKHR(
+        &cgen_var_0, (VkSurfaceKHR*)&forUnmarshaling->surface, 1);
+}
+
+void marshal_VkSurfaceCapabilities2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkSurfaceCapabilities2KHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkSurfaceCapabilitiesKHR(
+        vkStream, rootType, (VkSurfaceCapabilitiesKHR*)(&forMarshaling->surfaceCapabilities));
+}
+
+void unmarshal_VkSurfaceCapabilities2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkSurfaceCapabilities2KHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkSurfaceCapabilitiesKHR(
+        vkStream, rootType, (VkSurfaceCapabilitiesKHR*)(&forUnmarshaling->surfaceCapabilities));
+}
+
+void marshal_VkSurfaceFormat2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkSurfaceFormat2KHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkSurfaceFormatKHR(vkStream, rootType,
+                               (VkSurfaceFormatKHR*)(&forMarshaling->surfaceFormat));
+}
+
+void unmarshal_VkSurfaceFormat2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkSurfaceFormat2KHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkSurfaceFormatKHR(vkStream, rootType,
+                                 (VkSurfaceFormatKHR*)(&forUnmarshaling->surfaceFormat));
+}
+
+#endif
+#ifdef VK_KHR_variable_pointers
+#endif
+#ifdef VK_KHR_get_display_properties2
+void marshal_VkDisplayProperties2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkDisplayProperties2KHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkDisplayPropertiesKHR(vkStream, rootType,
+                                   (VkDisplayPropertiesKHR*)(&forMarshaling->displayProperties));
+}
+
+void unmarshal_VkDisplayProperties2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkDisplayProperties2KHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkDisplayPropertiesKHR(
+        vkStream, rootType, (VkDisplayPropertiesKHR*)(&forUnmarshaling->displayProperties));
+}
+
+void marshal_VkDisplayPlaneProperties2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkDisplayPlaneProperties2KHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkDisplayPlanePropertiesKHR(
+        vkStream, rootType, (VkDisplayPlanePropertiesKHR*)(&forMarshaling->displayPlaneProperties));
+}
+
+void unmarshal_VkDisplayPlaneProperties2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkDisplayPlaneProperties2KHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkDisplayPlanePropertiesKHR(
+        vkStream, rootType,
+        (VkDisplayPlanePropertiesKHR*)(&forUnmarshaling->displayPlaneProperties));
+}
+
+void marshal_VkDisplayModeProperties2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkDisplayModeProperties2KHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkDisplayModePropertiesKHR(
+        vkStream, rootType, (VkDisplayModePropertiesKHR*)(&forMarshaling->displayModeProperties));
+}
+
+void unmarshal_VkDisplayModeProperties2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkDisplayModeProperties2KHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkDisplayModePropertiesKHR(
+        vkStream, rootType, (VkDisplayModePropertiesKHR*)(&forUnmarshaling->displayModeProperties));
+}
+
+void marshal_VkDisplayPlaneInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkDisplayPlaneInfo2KHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkDisplayModeKHR_u64(&forMarshaling->mode, &cgen_var_0,
+                                                               1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((uint32_t*)&forMarshaling->planeIndex, sizeof(uint32_t));
+}
+
+void unmarshal_VkDisplayPlaneInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      VkDisplayPlaneInfo2KHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkDisplayModeKHR(
+        &cgen_var_0, (VkDisplayModeKHR*)&forUnmarshaling->mode, 1);
+    vkStream->read((uint32_t*)&forUnmarshaling->planeIndex, sizeof(uint32_t));
+}
+
+void marshal_VkDisplayPlaneCapabilities2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkDisplayPlaneCapabilities2KHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkDisplayPlaneCapabilitiesKHR(
+        vkStream, rootType, (VkDisplayPlaneCapabilitiesKHR*)(&forMarshaling->capabilities));
+}
+
+void unmarshal_VkDisplayPlaneCapabilities2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkDisplayPlaneCapabilities2KHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkDisplayPlaneCapabilitiesKHR(
+        vkStream, rootType, (VkDisplayPlaneCapabilitiesKHR*)(&forUnmarshaling->capabilities));
+}
+
+#endif
+#ifdef VK_KHR_dedicated_allocation
+#endif
+#ifdef VK_KHR_storage_buffer_storage_class
+#endif
+#ifdef VK_KHR_relaxed_block_layout
+#endif
+#ifdef VK_KHR_get_memory_requirements2
+#endif
+#ifdef VK_KHR_image_format_list
+#endif
+#ifdef VK_KHR_sampler_ycbcr_conversion
+#endif
+#ifdef VK_KHR_bind_memory2
+#endif
+#ifdef VK_KHR_portability_subset
+void marshal_VkPhysicalDevicePortabilitySubsetFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePortabilitySubsetFeaturesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->constantAlphaColorBlendFactors, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->events, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->imageViewFormatReinterpretation, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->imageViewFormatSwizzle, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->imageView2DOn3DImage, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->multisampleArrayImage, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->mutableComparisonSamplers, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->pointPolygons, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->samplerMipLodBias, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->separateStencilMaskRef, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderSampleRateInterpolationFunctions,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->tessellationIsolines, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->tessellationPointMode, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->triangleFans, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->vertexAttributeAccessBeyondStride, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDevicePortabilitySubsetFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevicePortabilitySubsetFeaturesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->constantAlphaColorBlendFactors, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->events, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->imageViewFormatReinterpretation, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->imageViewFormatSwizzle, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->imageView2DOn3DImage, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->multisampleArrayImage, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->mutableComparisonSamplers, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->pointPolygons, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->samplerMipLodBias, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->separateStencilMaskRef, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderSampleRateInterpolationFunctions,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->tessellationIsolines, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->tessellationPointMode, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->triangleFans, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->vertexAttributeAccessBeyondStride,
+                   sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDevicePortabilitySubsetPropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePortabilitySubsetPropertiesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->minVertexInputBindingStrideAlignment,
+                    sizeof(uint32_t));
+}
+
+void unmarshal_VkPhysicalDevicePortabilitySubsetPropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevicePortabilitySubsetPropertiesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->minVertexInputBindingStrideAlignment,
+                   sizeof(uint32_t));
+}
+
+#endif
+#ifdef VK_KHR_maintenance3
+#endif
+#ifdef VK_KHR_draw_indirect_count
+#endif
+#ifdef VK_KHR_shader_subgroup_extended_types
+#endif
+#ifdef VK_KHR_8bit_storage
+#endif
+#ifdef VK_KHR_shader_atomic_int64
+#endif
+#ifdef VK_KHR_shader_clock
+void marshal_VkPhysicalDeviceShaderClockFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderClockFeaturesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->shaderSubgroupClock, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderDeviceClock, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceShaderClockFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderClockFeaturesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderSubgroupClock, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderDeviceClock, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_KHR_driver_properties
+#endif
+#ifdef VK_KHR_shader_float_controls
+#endif
+#ifdef VK_KHR_depth_stencil_resolve
+#endif
+#ifdef VK_KHR_swapchain_mutable_format
+#endif
+#ifdef VK_KHR_timeline_semaphore
+#endif
+#ifdef VK_KHR_vulkan_memory_model
+#endif
+#ifdef VK_KHR_shader_terminate_invocation
+void marshal_VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->shaderTerminateInvocation, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderTerminateInvocation, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+void marshal_VkFragmentShadingRateAttachmentInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkFragmentShadingRateAttachmentInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pFragmentShadingRateAttachment;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pFragmentShadingRateAttachment) {
+        marshal_VkAttachmentReference2(
+            vkStream, rootType,
+            (const VkAttachmentReference2*)(forMarshaling->pFragmentShadingRateAttachment));
+    }
+    marshal_VkExtent2D(vkStream, rootType,
+                       (VkExtent2D*)(&forMarshaling->shadingRateAttachmentTexelSize));
+}
+
+void unmarshal_VkFragmentShadingRateAttachmentInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkFragmentShadingRateAttachmentInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    // WARNING PTR CHECK
+    const VkAttachmentReference2* check_pFragmentShadingRateAttachment;
+    check_pFragmentShadingRateAttachment =
+        (const VkAttachmentReference2*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pFragmentShadingRateAttachment) {
+        if (!(check_pFragmentShadingRateAttachment)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pFragmentShadingRateAttachment inconsistent between "
+                    "guest and host\n");
+        }
+        unmarshal_VkAttachmentReference2(
+            vkStream, rootType,
+            (VkAttachmentReference2*)(forUnmarshaling->pFragmentShadingRateAttachment));
+    }
+    unmarshal_VkExtent2D(vkStream, rootType,
+                         (VkExtent2D*)(&forUnmarshaling->shadingRateAttachmentTexelSize));
+}
+
+void marshal_VkPipelineFragmentShadingRateStateCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineFragmentShadingRateStateCreateInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->fragmentSize));
+    vkStream->write((VkFragmentShadingRateCombinerOpKHR*)forMarshaling->combinerOps,
+                    2 * sizeof(VkFragmentShadingRateCombinerOpKHR));
+}
+
+void unmarshal_VkPipelineFragmentShadingRateStateCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineFragmentShadingRateStateCreateInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->fragmentSize));
+    vkStream->read((VkFragmentShadingRateCombinerOpKHR*)forUnmarshaling->combinerOps,
+                   2 * sizeof(VkFragmentShadingRateCombinerOpKHR));
+}
+
+void marshal_VkPhysicalDeviceFragmentShadingRateFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateFeaturesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->pipelineFragmentShadingRate, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->primitiveFragmentShadingRate, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->attachmentFragmentShadingRate, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceFragmentShadingRateFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceFragmentShadingRateFeaturesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->pipelineFragmentShadingRate, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->primitiveFragmentShadingRate, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->attachmentFragmentShadingRate, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceFragmentShadingRatePropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRatePropertiesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkExtent2D(vkStream, rootType,
+                       (VkExtent2D*)(&forMarshaling->minFragmentShadingRateAttachmentTexelSize));
+    marshal_VkExtent2D(vkStream, rootType,
+                       (VkExtent2D*)(&forMarshaling->maxFragmentShadingRateAttachmentTexelSize));
+    vkStream->write((uint32_t*)&forMarshaling->maxFragmentShadingRateAttachmentTexelSizeAspectRatio,
+                    sizeof(uint32_t));
+    vkStream->write((VkBool32*)&forMarshaling->primitiveFragmentShadingRateWithMultipleViewports,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->layeredShadingRateAttachments, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->fragmentShadingRateNonTrivialCombinerOps,
+                    sizeof(VkBool32));
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->maxFragmentSize));
+    vkStream->write((uint32_t*)&forMarshaling->maxFragmentSizeAspectRatio, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxFragmentShadingRateCoverageSamples,
+                    sizeof(uint32_t));
+    vkStream->write(
+        (VkSampleCountFlagBits*)&forMarshaling->maxFragmentShadingRateRasterizationSamples,
+        sizeof(VkSampleCountFlagBits));
+    vkStream->write((VkBool32*)&forMarshaling->fragmentShadingRateWithShaderDepthStencilWrites,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->fragmentShadingRateWithSampleMask, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->fragmentShadingRateWithShaderSampleMask,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->fragmentShadingRateWithConservativeRasterization,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->fragmentShadingRateWithFragmentShaderInterlock,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->fragmentShadingRateWithCustomSampleLocations,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->fragmentShadingRateStrictMultiplyCombiner,
+                    sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceFragmentShadingRatePropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceFragmentShadingRatePropertiesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkExtent2D(
+        vkStream, rootType,
+        (VkExtent2D*)(&forUnmarshaling->minFragmentShadingRateAttachmentTexelSize));
+    unmarshal_VkExtent2D(
+        vkStream, rootType,
+        (VkExtent2D*)(&forUnmarshaling->maxFragmentShadingRateAttachmentTexelSize));
+    vkStream->read(
+        (uint32_t*)&forUnmarshaling->maxFragmentShadingRateAttachmentTexelSizeAspectRatio,
+        sizeof(uint32_t));
+    vkStream->read((VkBool32*)&forUnmarshaling->primitiveFragmentShadingRateWithMultipleViewports,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->layeredShadingRateAttachments, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->fragmentShadingRateNonTrivialCombinerOps,
+                   sizeof(VkBool32));
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->maxFragmentSize));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxFragmentSizeAspectRatio, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxFragmentShadingRateCoverageSamples,
+                   sizeof(uint32_t));
+    vkStream->read(
+        (VkSampleCountFlagBits*)&forUnmarshaling->maxFragmentShadingRateRasterizationSamples,
+        sizeof(VkSampleCountFlagBits));
+    vkStream->read((VkBool32*)&forUnmarshaling->fragmentShadingRateWithShaderDepthStencilWrites,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->fragmentShadingRateWithSampleMask,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->fragmentShadingRateWithShaderSampleMask,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->fragmentShadingRateWithConservativeRasterization,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->fragmentShadingRateWithFragmentShaderInterlock,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->fragmentShadingRateWithCustomSampleLocations,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->fragmentShadingRateStrictMultiplyCombiner,
+                   sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceFragmentShadingRateKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkSampleCountFlags*)&forMarshaling->sampleCounts, sizeof(VkSampleCountFlags));
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->fragmentSize));
+}
+
+void unmarshal_VkPhysicalDeviceFragmentShadingRateKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceFragmentShadingRateKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkSampleCountFlags*)&forUnmarshaling->sampleCounts, sizeof(VkSampleCountFlags));
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->fragmentSize));
+}
+
+#endif
+#ifdef VK_KHR_spirv_1_4
+#endif
+#ifdef VK_KHR_surface_protected_capabilities
+void marshal_VkSurfaceProtectedCapabilitiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSurfaceProtectedCapabilitiesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->supportsProtected, sizeof(VkBool32));
+}
+
+void unmarshal_VkSurfaceProtectedCapabilitiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkSurfaceProtectedCapabilitiesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->supportsProtected, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_KHR_separate_depth_stencil_layouts
+#endif
+#ifdef VK_KHR_present_wait
+void marshal_VkPhysicalDevicePresentWaitFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePresentWaitFeaturesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->presentWait, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDevicePresentWaitFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevicePresentWaitFeaturesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->presentWait, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_KHR_uniform_buffer_standard_layout
+#endif
+#ifdef VK_KHR_buffer_device_address
+#endif
+#ifdef VK_KHR_deferred_host_operations
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+void marshal_VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->pipelineExecutableInfo, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->pipelineExecutableInfo, sizeof(VkBool32));
+}
+
+void marshal_VkPipelineInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               const VkPipelineInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkPipeline_u64(&forMarshaling->pipeline, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+}
+
+void unmarshal_VkPipelineInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 VkPipelineInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkPipeline(
+        &cgen_var_0, (VkPipeline*)&forUnmarshaling->pipeline, 1);
+}
+
+void marshal_VkPipelineExecutablePropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineExecutablePropertiesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkShaderStageFlags*)&forMarshaling->stages, sizeof(VkShaderStageFlags));
+    vkStream->write((char*)forMarshaling->name, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    vkStream->write((char*)forMarshaling->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    vkStream->write((uint32_t*)&forMarshaling->subgroupSize, sizeof(uint32_t));
+}
+
+void unmarshal_VkPipelineExecutablePropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineExecutablePropertiesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkShaderStageFlags*)&forUnmarshaling->stages, sizeof(VkShaderStageFlags));
+    vkStream->read((char*)forUnmarshaling->name, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    vkStream->read((char*)forUnmarshaling->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    vkStream->read((uint32_t*)&forUnmarshaling->subgroupSize, sizeof(uint32_t));
+}
+
+void marshal_VkPipelineExecutableInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkPipelineExecutableInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkPipeline_u64(&forMarshaling->pipeline, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((uint32_t*)&forMarshaling->executableIndex, sizeof(uint32_t));
+}
+
+void unmarshal_VkPipelineExecutableInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkPipelineExecutableInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkPipeline(
+        &cgen_var_0, (VkPipeline*)&forUnmarshaling->pipeline, 1);
+    vkStream->read((uint32_t*)&forUnmarshaling->executableIndex, sizeof(uint32_t));
+}
+
+void marshal_VkPipelineExecutableStatisticValueKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineExecutableStatisticValueKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkBool32*)&forMarshaling->b32, sizeof(VkBool32));
+}
+
+void unmarshal_VkPipelineExecutableStatisticValueKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineExecutableStatisticValueKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkBool32*)&forUnmarshaling->b32, sizeof(VkBool32));
+}
+
+void marshal_VkPipelineExecutableStatisticKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineExecutableStatisticKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((char*)forMarshaling->name, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    vkStream->write((char*)forMarshaling->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    vkStream->write((VkPipelineExecutableStatisticFormatKHR*)&forMarshaling->format,
+                    sizeof(VkPipelineExecutableStatisticFormatKHR));
+    marshal_VkPipelineExecutableStatisticValueKHR(
+        vkStream, rootType, (VkPipelineExecutableStatisticValueKHR*)(&forMarshaling->value));
+}
+
+void unmarshal_VkPipelineExecutableStatisticKHR(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkPipelineExecutableStatisticKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((char*)forUnmarshaling->name, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    vkStream->read((char*)forUnmarshaling->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    vkStream->read((VkPipelineExecutableStatisticFormatKHR*)&forUnmarshaling->format,
+                   sizeof(VkPipelineExecutableStatisticFormatKHR));
+    unmarshal_VkPipelineExecutableStatisticValueKHR(
+        vkStream, rootType, (VkPipelineExecutableStatisticValueKHR*)(&forUnmarshaling->value));
+}
+
+void marshal_VkPipelineExecutableInternalRepresentationKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineExecutableInternalRepresentationKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((char*)forMarshaling->name, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    vkStream->write((char*)forMarshaling->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    vkStream->write((VkBool32*)&forMarshaling->isText, sizeof(VkBool32));
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->dataSize;
+    vkStream->putBe64(cgen_var_0);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pData;
+    vkStream->putBe64(cgen_var_1);
+    if (forMarshaling->pData) {
+        vkStream->write((void*)forMarshaling->pData, forMarshaling->dataSize * sizeof(uint8_t));
+    }
+}
+
+void unmarshal_VkPipelineExecutableInternalRepresentationKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineExecutableInternalRepresentationKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((char*)forUnmarshaling->name, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    vkStream->read((char*)forUnmarshaling->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    vkStream->read((VkBool32*)&forUnmarshaling->isText, sizeof(VkBool32));
+    forUnmarshaling->dataSize = (size_t)vkStream->getBe64();
+    // WARNING PTR CHECK
+    void* check_pData;
+    check_pData = (void*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pData) {
+        if (!(check_pData)) {
+            fprintf(stderr, "fatal: forUnmarshaling->pData inconsistent between guest and host\n");
+        }
+        vkStream->read((void*)forUnmarshaling->pData, forUnmarshaling->dataSize * sizeof(uint8_t));
+    }
+}
+
+#endif
+#ifdef VK_KHR_shader_integer_dot_product
+void marshal_VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->shaderIntegerDotProduct, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderIntegerDotProduct, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->integerDotProduct8BitUnsignedAccelerated,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->integerDotProduct8BitSignedAccelerated,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->integerDotProduct8BitMixedSignednessAccelerated,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->integerDotProduct4x8BitPackedUnsignedAccelerated,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->integerDotProduct4x8BitPackedSignedAccelerated,
+                    sizeof(VkBool32));
+    vkStream->write(
+        (VkBool32*)&forMarshaling->integerDotProduct4x8BitPackedMixedSignednessAccelerated,
+        sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->integerDotProduct16BitUnsignedAccelerated,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->integerDotProduct16BitSignedAccelerated,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->integerDotProduct16BitMixedSignednessAccelerated,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->integerDotProduct32BitUnsignedAccelerated,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->integerDotProduct32BitSignedAccelerated,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->integerDotProduct32BitMixedSignednessAccelerated,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->integerDotProduct64BitUnsignedAccelerated,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->integerDotProduct64BitSignedAccelerated,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->integerDotProduct64BitMixedSignednessAccelerated,
+                    sizeof(VkBool32));
+    vkStream->write(
+        (VkBool32*)&forMarshaling->integerDotProductAccumulatingSaturating8BitUnsignedAccelerated,
+        sizeof(VkBool32));
+    vkStream->write(
+        (VkBool32*)&forMarshaling->integerDotProductAccumulatingSaturating8BitSignedAccelerated,
+        sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling
+                        ->integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling
+                        ->integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling
+                        ->integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated,
+                    sizeof(VkBool32));
+    vkStream->write(
+        (VkBool32*)&forMarshaling
+            ->integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated,
+        sizeof(VkBool32));
+    vkStream->write(
+        (VkBool32*)&forMarshaling->integerDotProductAccumulatingSaturating16BitUnsignedAccelerated,
+        sizeof(VkBool32));
+    vkStream->write(
+        (VkBool32*)&forMarshaling->integerDotProductAccumulatingSaturating16BitSignedAccelerated,
+        sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling
+                        ->integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated,
+                    sizeof(VkBool32));
+    vkStream->write(
+        (VkBool32*)&forMarshaling->integerDotProductAccumulatingSaturating32BitUnsignedAccelerated,
+        sizeof(VkBool32));
+    vkStream->write(
+        (VkBool32*)&forMarshaling->integerDotProductAccumulatingSaturating32BitSignedAccelerated,
+        sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling
+                        ->integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated,
+                    sizeof(VkBool32));
+    vkStream->write(
+        (VkBool32*)&forMarshaling->integerDotProductAccumulatingSaturating64BitUnsignedAccelerated,
+        sizeof(VkBool32));
+    vkStream->write(
+        (VkBool32*)&forMarshaling->integerDotProductAccumulatingSaturating64BitSignedAccelerated,
+        sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling
+                        ->integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated,
+                    sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->integerDotProduct8BitUnsignedAccelerated,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->integerDotProduct8BitSignedAccelerated,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->integerDotProduct8BitMixedSignednessAccelerated,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->integerDotProduct4x8BitPackedUnsignedAccelerated,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->integerDotProduct4x8BitPackedSignedAccelerated,
+                   sizeof(VkBool32));
+    vkStream->read(
+        (VkBool32*)&forUnmarshaling->integerDotProduct4x8BitPackedMixedSignednessAccelerated,
+        sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->integerDotProduct16BitUnsignedAccelerated,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->integerDotProduct16BitSignedAccelerated,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->integerDotProduct16BitMixedSignednessAccelerated,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->integerDotProduct32BitUnsignedAccelerated,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->integerDotProduct32BitSignedAccelerated,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->integerDotProduct32BitMixedSignednessAccelerated,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->integerDotProduct64BitUnsignedAccelerated,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->integerDotProduct64BitSignedAccelerated,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->integerDotProduct64BitMixedSignednessAccelerated,
+                   sizeof(VkBool32));
+    vkStream->read(
+        (VkBool32*)&forUnmarshaling->integerDotProductAccumulatingSaturating8BitUnsignedAccelerated,
+        sizeof(VkBool32));
+    vkStream->read(
+        (VkBool32*)&forUnmarshaling->integerDotProductAccumulatingSaturating8BitSignedAccelerated,
+        sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling
+                       ->integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling
+                       ->integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling
+                       ->integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated,
+                   sizeof(VkBool32));
+    vkStream->read(
+        (VkBool32*)&forUnmarshaling
+            ->integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated,
+        sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling
+                       ->integerDotProductAccumulatingSaturating16BitUnsignedAccelerated,
+                   sizeof(VkBool32));
+    vkStream->read(
+        (VkBool32*)&forUnmarshaling->integerDotProductAccumulatingSaturating16BitSignedAccelerated,
+        sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling
+                       ->integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling
+                       ->integerDotProductAccumulatingSaturating32BitUnsignedAccelerated,
+                   sizeof(VkBool32));
+    vkStream->read(
+        (VkBool32*)&forUnmarshaling->integerDotProductAccumulatingSaturating32BitSignedAccelerated,
+        sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling
+                       ->integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling
+                       ->integerDotProductAccumulatingSaturating64BitUnsignedAccelerated,
+                   sizeof(VkBool32));
+    vkStream->read(
+        (VkBool32*)&forUnmarshaling->integerDotProductAccumulatingSaturating64BitSignedAccelerated,
+        sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling
+                       ->integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated,
+                   sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_KHR_pipeline_library
+void marshal_VkPipelineLibraryCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkPipelineLibraryCreateInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->libraryCount, sizeof(uint32_t));
+    if (forMarshaling->libraryCount) {
+        uint64_t* cgen_var_0;
+        vkStream->alloc((void**)&cgen_var_0, forMarshaling->libraryCount * 8);
+        vkStream->handleMapping()->mapHandles_VkPipeline_u64(forMarshaling->pLibraries, cgen_var_0,
+                                                             forMarshaling->libraryCount);
+        vkStream->write((uint64_t*)cgen_var_0, forMarshaling->libraryCount * 8);
+    }
+}
+
+void unmarshal_VkPipelineLibraryCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkPipelineLibraryCreateInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->libraryCount, sizeof(uint32_t));
+    if (forUnmarshaling->libraryCount) {
+        uint64_t* cgen_var_0;
+        vkStream->alloc((void**)&cgen_var_0, forUnmarshaling->libraryCount * 8);
+        vkStream->read((uint64_t*)cgen_var_0, forUnmarshaling->libraryCount * 8);
+        vkStream->handleMapping()->mapHandles_u64_VkPipeline(
+            cgen_var_0, (VkPipeline*)forUnmarshaling->pLibraries, forUnmarshaling->libraryCount);
+    }
+}
+
+#endif
+#ifdef VK_KHR_shader_non_semantic_info
+#endif
+#ifdef VK_KHR_present_id
+void marshal_VkPresentIdKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                            const VkPresentIdKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->swapchainCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pPresentIds;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pPresentIds) {
+        vkStream->write((const uint64_t*)forMarshaling->pPresentIds,
+                        forMarshaling->swapchainCount * sizeof(const uint64_t));
+    }
+}
+
+void unmarshal_VkPresentIdKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                              VkPresentIdKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->swapchainCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const uint64_t* check_pPresentIds;
+    check_pPresentIds = (const uint64_t*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pPresentIds) {
+        if (!(check_pPresentIds)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pPresentIds inconsistent between guest and host\n");
+        }
+        vkStream->read((uint64_t*)forUnmarshaling->pPresentIds,
+                       forUnmarshaling->swapchainCount * sizeof(const uint64_t));
+    }
+}
+
+void marshal_VkPhysicalDevicePresentIdFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePresentIdFeaturesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->presentId, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDevicePresentIdFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevicePresentIdFeaturesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->presentId, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_KHR_video_encode_queue
+void marshal_VkVideoEncodeInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkVideoEncodeInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkVideoEncodeFlagsKHR*)&forMarshaling->flags, sizeof(VkVideoEncodeFlagsKHR));
+    vkStream->write((uint32_t*)&forMarshaling->qualityLevel, sizeof(uint32_t));
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->codedExtent));
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkBuffer_u64(&forMarshaling->dstBitstreamBuffer,
+                                                       &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkDeviceSize*)&forMarshaling->dstBitstreamBufferOffset, sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->dstBitstreamBufferMaxRange,
+                    sizeof(VkDeviceSize));
+    marshal_VkVideoPictureResourceKHR(
+        vkStream, rootType, (VkVideoPictureResourceKHR*)(&forMarshaling->srcPictureResource));
+    marshal_VkVideoReferenceSlotKHR(
+        vkStream, rootType, (const VkVideoReferenceSlotKHR*)(forMarshaling->pSetupReferenceSlot));
+    vkStream->write((uint32_t*)&forMarshaling->referenceSlotCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->referenceSlotCount; ++i) {
+            marshal_VkVideoReferenceSlotKHR(
+                vkStream, rootType,
+                (const VkVideoReferenceSlotKHR*)(forMarshaling->pReferenceSlots + i));
+        }
+    }
+}
+
+void unmarshal_VkVideoEncodeInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkVideoEncodeInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkVideoEncodeFlagsKHR*)&forUnmarshaling->flags, sizeof(VkVideoEncodeFlagsKHR));
+    vkStream->read((uint32_t*)&forUnmarshaling->qualityLevel, sizeof(uint32_t));
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->codedExtent));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkBuffer(
+        &cgen_var_0, (VkBuffer*)&forUnmarshaling->dstBitstreamBuffer, 1);
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->dstBitstreamBufferOffset, sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->dstBitstreamBufferMaxRange,
+                   sizeof(VkDeviceSize));
+    unmarshal_VkVideoPictureResourceKHR(
+        vkStream, rootType, (VkVideoPictureResourceKHR*)(&forUnmarshaling->srcPictureResource));
+    unmarshal_VkVideoReferenceSlotKHR(
+        vkStream, rootType, (VkVideoReferenceSlotKHR*)(forUnmarshaling->pSetupReferenceSlot));
+    vkStream->read((uint32_t*)&forUnmarshaling->referenceSlotCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->referenceSlotCount; ++i) {
+            unmarshal_VkVideoReferenceSlotKHR(
+                vkStream, rootType,
+                (VkVideoReferenceSlotKHR*)(forUnmarshaling->pReferenceSlots + i));
+        }
+    }
+}
+
+void marshal_VkVideoEncodeRateControlInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkVideoEncodeRateControlInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkVideoEncodeRateControlFlagsKHR*)&forMarshaling->flags,
+                    sizeof(VkVideoEncodeRateControlFlagsKHR));
+    vkStream->write((VkVideoEncodeRateControlModeFlagBitsKHR*)&forMarshaling->rateControlMode,
+                    sizeof(VkVideoEncodeRateControlModeFlagBitsKHR));
+    vkStream->write((uint32_t*)&forMarshaling->averageBitrate, sizeof(uint32_t));
+    vkStream->write((uint16_t*)&forMarshaling->peakToAverageBitrateRatio, sizeof(uint16_t));
+    vkStream->write((uint16_t*)&forMarshaling->frameRateNumerator, sizeof(uint16_t));
+    vkStream->write((uint16_t*)&forMarshaling->frameRateDenominator, sizeof(uint16_t));
+    vkStream->write((uint32_t*)&forMarshaling->virtualBufferSizeInMs, sizeof(uint32_t));
+}
+
+void unmarshal_VkVideoEncodeRateControlInfoKHR(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkVideoEncodeRateControlInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkVideoEncodeRateControlFlagsKHR*)&forUnmarshaling->flags,
+                   sizeof(VkVideoEncodeRateControlFlagsKHR));
+    vkStream->read((VkVideoEncodeRateControlModeFlagBitsKHR*)&forUnmarshaling->rateControlMode,
+                   sizeof(VkVideoEncodeRateControlModeFlagBitsKHR));
+    vkStream->read((uint32_t*)&forUnmarshaling->averageBitrate, sizeof(uint32_t));
+    vkStream->read((uint16_t*)&forUnmarshaling->peakToAverageBitrateRatio, sizeof(uint16_t));
+    vkStream->read((uint16_t*)&forUnmarshaling->frameRateNumerator, sizeof(uint16_t));
+    vkStream->read((uint16_t*)&forUnmarshaling->frameRateDenominator, sizeof(uint16_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->virtualBufferSizeInMs, sizeof(uint32_t));
+}
+
+#endif
+#ifdef VK_KHR_synchronization2
+void marshal_VkMemoryBarrier2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkMemoryBarrier2KHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineStageFlags2KHR*)&forMarshaling->srcStageMask,
+                    sizeof(VkPipelineStageFlags2KHR));
+    vkStream->write((VkAccessFlags2KHR*)&forMarshaling->srcAccessMask, sizeof(VkAccessFlags2KHR));
+    vkStream->write((VkPipelineStageFlags2KHR*)&forMarshaling->dstStageMask,
+                    sizeof(VkPipelineStageFlags2KHR));
+    vkStream->write((VkAccessFlags2KHR*)&forMarshaling->dstAccessMask, sizeof(VkAccessFlags2KHR));
+}
+
+void unmarshal_VkMemoryBarrier2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkMemoryBarrier2KHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineStageFlags2KHR*)&forUnmarshaling->srcStageMask,
+                   sizeof(VkPipelineStageFlags2KHR));
+    vkStream->read((VkAccessFlags2KHR*)&forUnmarshaling->srcAccessMask, sizeof(VkAccessFlags2KHR));
+    vkStream->read((VkPipelineStageFlags2KHR*)&forUnmarshaling->dstStageMask,
+                   sizeof(VkPipelineStageFlags2KHR));
+    vkStream->read((VkAccessFlags2KHR*)&forUnmarshaling->dstAccessMask, sizeof(VkAccessFlags2KHR));
+}
+
+void marshal_VkBufferMemoryBarrier2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkBufferMemoryBarrier2KHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineStageFlags2KHR*)&forMarshaling->srcStageMask,
+                    sizeof(VkPipelineStageFlags2KHR));
+    vkStream->write((VkAccessFlags2KHR*)&forMarshaling->srcAccessMask, sizeof(VkAccessFlags2KHR));
+    vkStream->write((VkPipelineStageFlags2KHR*)&forMarshaling->dstStageMask,
+                    sizeof(VkPipelineStageFlags2KHR));
+    vkStream->write((VkAccessFlags2KHR*)&forMarshaling->dstAccessMask, sizeof(VkAccessFlags2KHR));
+    vkStream->write((uint32_t*)&forMarshaling->srcQueueFamilyIndex, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->dstQueueFamilyIndex, sizeof(uint32_t));
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkBuffer_u64(&forMarshaling->buffer, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkDeviceSize*)&forMarshaling->offset, sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
+}
+
+void unmarshal_VkBufferMemoryBarrier2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkBufferMemoryBarrier2KHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineStageFlags2KHR*)&forUnmarshaling->srcStageMask,
+                   sizeof(VkPipelineStageFlags2KHR));
+    vkStream->read((VkAccessFlags2KHR*)&forUnmarshaling->srcAccessMask, sizeof(VkAccessFlags2KHR));
+    vkStream->read((VkPipelineStageFlags2KHR*)&forUnmarshaling->dstStageMask,
+                   sizeof(VkPipelineStageFlags2KHR));
+    vkStream->read((VkAccessFlags2KHR*)&forUnmarshaling->dstAccessMask, sizeof(VkAccessFlags2KHR));
+    vkStream->read((uint32_t*)&forUnmarshaling->srcQueueFamilyIndex, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->dstQueueFamilyIndex, sizeof(uint32_t));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_0,
+                                                       (VkBuffer*)&forUnmarshaling->buffer, 1);
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->offset, sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->size, sizeof(VkDeviceSize));
+}
+
+void marshal_VkImageMemoryBarrier2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkImageMemoryBarrier2KHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineStageFlags2KHR*)&forMarshaling->srcStageMask,
+                    sizeof(VkPipelineStageFlags2KHR));
+    vkStream->write((VkAccessFlags2KHR*)&forMarshaling->srcAccessMask, sizeof(VkAccessFlags2KHR));
+    vkStream->write((VkPipelineStageFlags2KHR*)&forMarshaling->dstStageMask,
+                    sizeof(VkPipelineStageFlags2KHR));
+    vkStream->write((VkAccessFlags2KHR*)&forMarshaling->dstAccessMask, sizeof(VkAccessFlags2KHR));
+    vkStream->write((VkImageLayout*)&forMarshaling->oldLayout, sizeof(VkImageLayout));
+    vkStream->write((VkImageLayout*)&forMarshaling->newLayout, sizeof(VkImageLayout));
+    vkStream->write((uint32_t*)&forMarshaling->srcQueueFamilyIndex, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->dstQueueFamilyIndex, sizeof(uint32_t));
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkImage_u64(&forMarshaling->image, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    marshal_VkImageSubresourceRange(vkStream, rootType,
+                                    (VkImageSubresourceRange*)(&forMarshaling->subresourceRange));
+}
+
+void unmarshal_VkImageMemoryBarrier2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkImageMemoryBarrier2KHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineStageFlags2KHR*)&forUnmarshaling->srcStageMask,
+                   sizeof(VkPipelineStageFlags2KHR));
+    vkStream->read((VkAccessFlags2KHR*)&forUnmarshaling->srcAccessMask, sizeof(VkAccessFlags2KHR));
+    vkStream->read((VkPipelineStageFlags2KHR*)&forUnmarshaling->dstStageMask,
+                   sizeof(VkPipelineStageFlags2KHR));
+    vkStream->read((VkAccessFlags2KHR*)&forUnmarshaling->dstAccessMask, sizeof(VkAccessFlags2KHR));
+    vkStream->read((VkImageLayout*)&forUnmarshaling->oldLayout, sizeof(VkImageLayout));
+    vkStream->read((VkImageLayout*)&forUnmarshaling->newLayout, sizeof(VkImageLayout));
+    vkStream->read((uint32_t*)&forUnmarshaling->srcQueueFamilyIndex, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->dstQueueFamilyIndex, sizeof(uint32_t));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_0,
+                                                      (VkImage*)&forUnmarshaling->image, 1);
+    unmarshal_VkImageSubresourceRange(
+        vkStream, rootType, (VkImageSubresourceRange*)(&forUnmarshaling->subresourceRange));
+}
+
+void marshal_VkDependencyInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkDependencyInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDependencyFlags*)&forMarshaling->dependencyFlags, sizeof(VkDependencyFlags));
+    vkStream->write((uint32_t*)&forMarshaling->memoryBarrierCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->memoryBarrierCount; ++i) {
+            marshal_VkMemoryBarrier2KHR(
+                vkStream, rootType,
+                (const VkMemoryBarrier2KHR*)(forMarshaling->pMemoryBarriers + i));
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->bufferMemoryBarrierCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->bufferMemoryBarrierCount; ++i) {
+            marshal_VkBufferMemoryBarrier2KHR(
+                vkStream, rootType,
+                (const VkBufferMemoryBarrier2KHR*)(forMarshaling->pBufferMemoryBarriers + i));
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->imageMemoryBarrierCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->imageMemoryBarrierCount; ++i) {
+            marshal_VkImageMemoryBarrier2KHR(
+                vkStream, rootType,
+                (const VkImageMemoryBarrier2KHR*)(forMarshaling->pImageMemoryBarriers + i));
+        }
+    }
+}
+
+void unmarshal_VkDependencyInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkDependencyInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDependencyFlags*)&forUnmarshaling->dependencyFlags,
+                   sizeof(VkDependencyFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->memoryBarrierCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->memoryBarrierCount; ++i) {
+            unmarshal_VkMemoryBarrier2KHR(
+                vkStream, rootType, (VkMemoryBarrier2KHR*)(forUnmarshaling->pMemoryBarriers + i));
+        }
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->bufferMemoryBarrierCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->bufferMemoryBarrierCount; ++i) {
+            unmarshal_VkBufferMemoryBarrier2KHR(
+                vkStream, rootType,
+                (VkBufferMemoryBarrier2KHR*)(forUnmarshaling->pBufferMemoryBarriers + i));
+        }
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->imageMemoryBarrierCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->imageMemoryBarrierCount; ++i) {
+            unmarshal_VkImageMemoryBarrier2KHR(
+                vkStream, rootType,
+                (VkImageMemoryBarrier2KHR*)(forUnmarshaling->pImageMemoryBarriers + i));
+        }
+    }
+}
+
+void marshal_VkSemaphoreSubmitInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkSemaphoreSubmitInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkSemaphore_u64(&forMarshaling->semaphore, &cgen_var_0,
+                                                          1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((uint64_t*)&forMarshaling->value, sizeof(uint64_t));
+    vkStream->write((VkPipelineStageFlags2KHR*)&forMarshaling->stageMask,
+                    sizeof(VkPipelineStageFlags2KHR));
+    vkStream->write((uint32_t*)&forMarshaling->deviceIndex, sizeof(uint32_t));
+}
+
+void unmarshal_VkSemaphoreSubmitInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkSemaphoreSubmitInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkSemaphore(
+        &cgen_var_0, (VkSemaphore*)&forUnmarshaling->semaphore, 1);
+    vkStream->read((uint64_t*)&forUnmarshaling->value, sizeof(uint64_t));
+    vkStream->read((VkPipelineStageFlags2KHR*)&forUnmarshaling->stageMask,
+                   sizeof(VkPipelineStageFlags2KHR));
+    vkStream->read((uint32_t*)&forUnmarshaling->deviceIndex, sizeof(uint32_t));
+}
+
+void marshal_VkCommandBufferSubmitInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkCommandBufferSubmitInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&forMarshaling->commandBuffer,
+                                                              &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((uint32_t*)&forMarshaling->deviceMask, sizeof(uint32_t));
+}
+
+void unmarshal_VkCommandBufferSubmitInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkCommandBufferSubmitInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkCommandBuffer(
+        &cgen_var_0, (VkCommandBuffer*)&forUnmarshaling->commandBuffer, 1);
+    vkStream->read((uint32_t*)&forUnmarshaling->deviceMask, sizeof(uint32_t));
+}
+
+void marshal_VkSubmitInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                              const VkSubmitInfo2KHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkSubmitFlagsKHR*)&forMarshaling->flags, sizeof(VkSubmitFlagsKHR));
+    vkStream->write((uint32_t*)&forMarshaling->waitSemaphoreInfoCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->waitSemaphoreInfoCount; ++i) {
+            marshal_VkSemaphoreSubmitInfoKHR(
+                vkStream, rootType,
+                (const VkSemaphoreSubmitInfoKHR*)(forMarshaling->pWaitSemaphoreInfos + i));
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->commandBufferInfoCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->commandBufferInfoCount; ++i) {
+            marshal_VkCommandBufferSubmitInfoKHR(
+                vkStream, rootType,
+                (const VkCommandBufferSubmitInfoKHR*)(forMarshaling->pCommandBufferInfos + i));
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->signalSemaphoreInfoCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->signalSemaphoreInfoCount; ++i) {
+            marshal_VkSemaphoreSubmitInfoKHR(
+                vkStream, rootType,
+                (const VkSemaphoreSubmitInfoKHR*)(forMarshaling->pSignalSemaphoreInfos + i));
+        }
+    }
+}
+
+void unmarshal_VkSubmitInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                VkSubmitInfo2KHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkSubmitFlagsKHR*)&forUnmarshaling->flags, sizeof(VkSubmitFlagsKHR));
+    vkStream->read((uint32_t*)&forUnmarshaling->waitSemaphoreInfoCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->waitSemaphoreInfoCount; ++i) {
+            unmarshal_VkSemaphoreSubmitInfoKHR(
+                vkStream, rootType,
+                (VkSemaphoreSubmitInfoKHR*)(forUnmarshaling->pWaitSemaphoreInfos + i));
+        }
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->commandBufferInfoCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->commandBufferInfoCount; ++i) {
+            unmarshal_VkCommandBufferSubmitInfoKHR(
+                vkStream, rootType,
+                (VkCommandBufferSubmitInfoKHR*)(forUnmarshaling->pCommandBufferInfos + i));
+        }
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->signalSemaphoreInfoCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->signalSemaphoreInfoCount; ++i) {
+            unmarshal_VkSemaphoreSubmitInfoKHR(
+                vkStream, rootType,
+                (VkSemaphoreSubmitInfoKHR*)(forUnmarshaling->pSignalSemaphoreInfos + i));
+        }
+    }
+}
+
+void marshal_VkPhysicalDeviceSynchronization2FeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSynchronization2FeaturesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->synchronization2, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceSynchronization2FeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceSynchronization2FeaturesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->synchronization2, sizeof(VkBool32));
+}
+
+void marshal_VkQueueFamilyCheckpointProperties2NV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkQueueFamilyCheckpointProperties2NV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineStageFlags2KHR*)&forMarshaling->checkpointExecutionStageMask,
+                    sizeof(VkPipelineStageFlags2KHR));
+}
+
+void unmarshal_VkQueueFamilyCheckpointProperties2NV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkQueueFamilyCheckpointProperties2NV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineStageFlags2KHR*)&forUnmarshaling->checkpointExecutionStageMask,
+                   sizeof(VkPipelineStageFlags2KHR));
+}
+
+void marshal_VkCheckpointData2NV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkCheckpointData2NV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineStageFlags2KHR*)&forMarshaling->stage,
+                    sizeof(VkPipelineStageFlags2KHR));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pCheckpointMarker;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pCheckpointMarker) {
+        vkStream->write((void*)forMarshaling->pCheckpointMarker, sizeof(uint8_t));
+    }
+}
+
+void unmarshal_VkCheckpointData2NV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkCheckpointData2NV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineStageFlags2KHR*)&forUnmarshaling->stage,
+                   sizeof(VkPipelineStageFlags2KHR));
+    // WARNING PTR CHECK
+    void* check_pCheckpointMarker;
+    check_pCheckpointMarker = (void*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pCheckpointMarker) {
+        if (!(check_pCheckpointMarker)) {
+            fprintf(
+                stderr,
+                "fatal: forUnmarshaling->pCheckpointMarker inconsistent between guest and host\n");
+        }
+        vkStream->read((void*)forUnmarshaling->pCheckpointMarker, sizeof(uint8_t));
+    }
+}
+
+#endif
+#ifdef VK_KHR_shader_subgroup_uniform_control_flow
+void marshal_VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->shaderSubgroupUniformControlFlow, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderSubgroupUniformControlFlow, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_KHR_zero_initialize_workgroup_memory
+void marshal_VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->shaderZeroInitializeWorkgroupMemory,
+                    sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderZeroInitializeWorkgroupMemory,
+                   sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_KHR_workgroup_memory_explicit_layout
+void marshal_VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->workgroupMemoryExplicitLayout, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->workgroupMemoryExplicitLayoutScalarBlockLayout,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->workgroupMemoryExplicitLayout8BitAccess,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->workgroupMemoryExplicitLayout16BitAccess,
+                    sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->workgroupMemoryExplicitLayout, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->workgroupMemoryExplicitLayoutScalarBlockLayout,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->workgroupMemoryExplicitLayout8BitAccess,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->workgroupMemoryExplicitLayout16BitAccess,
+                   sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_KHR_copy_commands2
+void marshal_VkBufferCopy2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                              const VkBufferCopy2KHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDeviceSize*)&forMarshaling->srcOffset, sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->dstOffset, sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
+}
+
+void unmarshal_VkBufferCopy2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                VkBufferCopy2KHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->srcOffset, sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->dstOffset, sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->size, sizeof(VkDeviceSize));
+}
+
+void marshal_VkCopyBufferInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkCopyBufferInfo2KHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkBuffer_u64(&forMarshaling->srcBuffer, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    uint64_t cgen_var_1;
+    vkStream->handleMapping()->mapHandles_VkBuffer_u64(&forMarshaling->dstBuffer, &cgen_var_1, 1);
+    vkStream->write((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->write((uint32_t*)&forMarshaling->regionCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->regionCount; ++i) {
+            marshal_VkBufferCopy2KHR(vkStream, rootType,
+                                     (const VkBufferCopy2KHR*)(forMarshaling->pRegions + i));
+        }
+    }
+}
+
+void unmarshal_VkCopyBufferInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkCopyBufferInfo2KHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_0,
+                                                       (VkBuffer*)&forUnmarshaling->srcBuffer, 1);
+    uint64_t cgen_var_1;
+    vkStream->read((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_1,
+                                                       (VkBuffer*)&forUnmarshaling->dstBuffer, 1);
+    vkStream->read((uint32_t*)&forUnmarshaling->regionCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->regionCount; ++i) {
+            unmarshal_VkBufferCopy2KHR(vkStream, rootType,
+                                       (VkBufferCopy2KHR*)(forUnmarshaling->pRegions + i));
+        }
+    }
+}
+
+void marshal_VkImageCopy2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                             const VkImageCopy2KHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkImageSubresourceLayers(vkStream, rootType,
+                                     (VkImageSubresourceLayers*)(&forMarshaling->srcSubresource));
+    marshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forMarshaling->srcOffset));
+    marshal_VkImageSubresourceLayers(vkStream, rootType,
+                                     (VkImageSubresourceLayers*)(&forMarshaling->dstSubresource));
+    marshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forMarshaling->dstOffset));
+    marshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forMarshaling->extent));
+}
+
+void unmarshal_VkImageCopy2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               VkImageCopy2KHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkImageSubresourceLayers(
+        vkStream, rootType, (VkImageSubresourceLayers*)(&forUnmarshaling->srcSubresource));
+    unmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forUnmarshaling->srcOffset));
+    unmarshal_VkImageSubresourceLayers(
+        vkStream, rootType, (VkImageSubresourceLayers*)(&forUnmarshaling->dstSubresource));
+    unmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forUnmarshaling->dstOffset));
+    unmarshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forUnmarshaling->extent));
+}
+
+void marshal_VkCopyImageInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkCopyImageInfo2KHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkImage_u64(&forMarshaling->srcImage, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkImageLayout*)&forMarshaling->srcImageLayout, sizeof(VkImageLayout));
+    uint64_t cgen_var_1;
+    vkStream->handleMapping()->mapHandles_VkImage_u64(&forMarshaling->dstImage, &cgen_var_1, 1);
+    vkStream->write((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->write((VkImageLayout*)&forMarshaling->dstImageLayout, sizeof(VkImageLayout));
+    vkStream->write((uint32_t*)&forMarshaling->regionCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->regionCount; ++i) {
+            marshal_VkImageCopy2KHR(vkStream, rootType,
+                                    (const VkImageCopy2KHR*)(forMarshaling->pRegions + i));
+        }
+    }
+}
+
+void unmarshal_VkCopyImageInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkCopyImageInfo2KHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_0,
+                                                      (VkImage*)&forUnmarshaling->srcImage, 1);
+    vkStream->read((VkImageLayout*)&forUnmarshaling->srcImageLayout, sizeof(VkImageLayout));
+    uint64_t cgen_var_1;
+    vkStream->read((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_1,
+                                                      (VkImage*)&forUnmarshaling->dstImage, 1);
+    vkStream->read((VkImageLayout*)&forUnmarshaling->dstImageLayout, sizeof(VkImageLayout));
+    vkStream->read((uint32_t*)&forUnmarshaling->regionCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->regionCount; ++i) {
+            unmarshal_VkImageCopy2KHR(vkStream, rootType,
+                                      (VkImageCopy2KHR*)(forUnmarshaling->pRegions + i));
+        }
+    }
+}
+
+void marshal_VkBufferImageCopy2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkBufferImageCopy2KHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDeviceSize*)&forMarshaling->bufferOffset, sizeof(VkDeviceSize));
+    vkStream->write((uint32_t*)&forMarshaling->bufferRowLength, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->bufferImageHeight, sizeof(uint32_t));
+    marshal_VkImageSubresourceLayers(vkStream, rootType,
+                                     (VkImageSubresourceLayers*)(&forMarshaling->imageSubresource));
+    marshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forMarshaling->imageOffset));
+    marshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forMarshaling->imageExtent));
+}
+
+void unmarshal_VkBufferImageCopy2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkBufferImageCopy2KHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->bufferOffset, sizeof(VkDeviceSize));
+    vkStream->read((uint32_t*)&forUnmarshaling->bufferRowLength, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->bufferImageHeight, sizeof(uint32_t));
+    unmarshal_VkImageSubresourceLayers(
+        vkStream, rootType, (VkImageSubresourceLayers*)(&forUnmarshaling->imageSubresource));
+    unmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forUnmarshaling->imageOffset));
+    unmarshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forUnmarshaling->imageExtent));
+}
+
+void marshal_VkCopyBufferToImageInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkCopyBufferToImageInfo2KHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkBuffer_u64(&forMarshaling->srcBuffer, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    uint64_t cgen_var_1;
+    vkStream->handleMapping()->mapHandles_VkImage_u64(&forMarshaling->dstImage, &cgen_var_1, 1);
+    vkStream->write((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->write((VkImageLayout*)&forMarshaling->dstImageLayout, sizeof(VkImageLayout));
+    vkStream->write((uint32_t*)&forMarshaling->regionCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->regionCount; ++i) {
+            marshal_VkBufferImageCopy2KHR(
+                vkStream, rootType, (const VkBufferImageCopy2KHR*)(forMarshaling->pRegions + i));
+        }
+    }
+}
+
+void unmarshal_VkCopyBufferToImageInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkCopyBufferToImageInfo2KHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_0,
+                                                       (VkBuffer*)&forUnmarshaling->srcBuffer, 1);
+    uint64_t cgen_var_1;
+    vkStream->read((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_1,
+                                                      (VkImage*)&forUnmarshaling->dstImage, 1);
+    vkStream->read((VkImageLayout*)&forUnmarshaling->dstImageLayout, sizeof(VkImageLayout));
+    vkStream->read((uint32_t*)&forUnmarshaling->regionCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->regionCount; ++i) {
+            unmarshal_VkBufferImageCopy2KHR(
+                vkStream, rootType, (VkBufferImageCopy2KHR*)(forUnmarshaling->pRegions + i));
+        }
+    }
+}
+
+void marshal_VkCopyImageToBufferInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkCopyImageToBufferInfo2KHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkImage_u64(&forMarshaling->srcImage, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkImageLayout*)&forMarshaling->srcImageLayout, sizeof(VkImageLayout));
+    uint64_t cgen_var_1;
+    vkStream->handleMapping()->mapHandles_VkBuffer_u64(&forMarshaling->dstBuffer, &cgen_var_1, 1);
+    vkStream->write((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->write((uint32_t*)&forMarshaling->regionCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->regionCount; ++i) {
+            marshal_VkBufferImageCopy2KHR(
+                vkStream, rootType, (const VkBufferImageCopy2KHR*)(forMarshaling->pRegions + i));
+        }
+    }
+}
+
+void unmarshal_VkCopyImageToBufferInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkCopyImageToBufferInfo2KHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_0,
+                                                      (VkImage*)&forUnmarshaling->srcImage, 1);
+    vkStream->read((VkImageLayout*)&forUnmarshaling->srcImageLayout, sizeof(VkImageLayout));
+    uint64_t cgen_var_1;
+    vkStream->read((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_1,
+                                                       (VkBuffer*)&forUnmarshaling->dstBuffer, 1);
+    vkStream->read((uint32_t*)&forUnmarshaling->regionCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->regionCount; ++i) {
+            unmarshal_VkBufferImageCopy2KHR(
+                vkStream, rootType, (VkBufferImageCopy2KHR*)(forUnmarshaling->pRegions + i));
+        }
+    }
+}
+
+void marshal_VkImageBlit2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                             const VkImageBlit2KHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkImageSubresourceLayers(vkStream, rootType,
+                                     (VkImageSubresourceLayers*)(&forMarshaling->srcSubresource));
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        marshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(forMarshaling->srcOffsets + i));
+    }
+    marshal_VkImageSubresourceLayers(vkStream, rootType,
+                                     (VkImageSubresourceLayers*)(&forMarshaling->dstSubresource));
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        marshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(forMarshaling->dstOffsets + i));
+    }
+}
+
+void unmarshal_VkImageBlit2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               VkImageBlit2KHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkImageSubresourceLayers(
+        vkStream, rootType, (VkImageSubresourceLayers*)(&forUnmarshaling->srcSubresource));
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        unmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(forUnmarshaling->srcOffsets + i));
+    }
+    unmarshal_VkImageSubresourceLayers(
+        vkStream, rootType, (VkImageSubresourceLayers*)(&forUnmarshaling->dstSubresource));
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        unmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(forUnmarshaling->dstOffsets + i));
+    }
+}
+
+void marshal_VkBlitImageInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkBlitImageInfo2KHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkImage_u64(&forMarshaling->srcImage, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkImageLayout*)&forMarshaling->srcImageLayout, sizeof(VkImageLayout));
+    uint64_t cgen_var_1;
+    vkStream->handleMapping()->mapHandles_VkImage_u64(&forMarshaling->dstImage, &cgen_var_1, 1);
+    vkStream->write((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->write((VkImageLayout*)&forMarshaling->dstImageLayout, sizeof(VkImageLayout));
+    vkStream->write((uint32_t*)&forMarshaling->regionCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->regionCount; ++i) {
+            marshal_VkImageBlit2KHR(vkStream, rootType,
+                                    (const VkImageBlit2KHR*)(forMarshaling->pRegions + i));
+        }
+    }
+    vkStream->write((VkFilter*)&forMarshaling->filter, sizeof(VkFilter));
+}
+
+void unmarshal_VkBlitImageInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkBlitImageInfo2KHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_0,
+                                                      (VkImage*)&forUnmarshaling->srcImage, 1);
+    vkStream->read((VkImageLayout*)&forUnmarshaling->srcImageLayout, sizeof(VkImageLayout));
+    uint64_t cgen_var_1;
+    vkStream->read((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_1,
+                                                      (VkImage*)&forUnmarshaling->dstImage, 1);
+    vkStream->read((VkImageLayout*)&forUnmarshaling->dstImageLayout, sizeof(VkImageLayout));
+    vkStream->read((uint32_t*)&forUnmarshaling->regionCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->regionCount; ++i) {
+            unmarshal_VkImageBlit2KHR(vkStream, rootType,
+                                      (VkImageBlit2KHR*)(forUnmarshaling->pRegions + i));
+        }
+    }
+    vkStream->read((VkFilter*)&forUnmarshaling->filter, sizeof(VkFilter));
+}
+
+void marshal_VkImageResolve2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkImageResolve2KHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkImageSubresourceLayers(vkStream, rootType,
+                                     (VkImageSubresourceLayers*)(&forMarshaling->srcSubresource));
+    marshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forMarshaling->srcOffset));
+    marshal_VkImageSubresourceLayers(vkStream, rootType,
+                                     (VkImageSubresourceLayers*)(&forMarshaling->dstSubresource));
+    marshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forMarshaling->dstOffset));
+    marshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forMarshaling->extent));
+}
+
+void unmarshal_VkImageResolve2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkImageResolve2KHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkImageSubresourceLayers(
+        vkStream, rootType, (VkImageSubresourceLayers*)(&forUnmarshaling->srcSubresource));
+    unmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forUnmarshaling->srcOffset));
+    unmarshal_VkImageSubresourceLayers(
+        vkStream, rootType, (VkImageSubresourceLayers*)(&forUnmarshaling->dstSubresource));
+    unmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forUnmarshaling->dstOffset));
+    unmarshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forUnmarshaling->extent));
+}
+
+void marshal_VkResolveImageInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkResolveImageInfo2KHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkImage_u64(&forMarshaling->srcImage, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkImageLayout*)&forMarshaling->srcImageLayout, sizeof(VkImageLayout));
+    uint64_t cgen_var_1;
+    vkStream->handleMapping()->mapHandles_VkImage_u64(&forMarshaling->dstImage, &cgen_var_1, 1);
+    vkStream->write((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->write((VkImageLayout*)&forMarshaling->dstImageLayout, sizeof(VkImageLayout));
+    vkStream->write((uint32_t*)&forMarshaling->regionCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->regionCount; ++i) {
+            marshal_VkImageResolve2KHR(vkStream, rootType,
+                                       (const VkImageResolve2KHR*)(forMarshaling->pRegions + i));
+        }
+    }
+}
+
+void unmarshal_VkResolveImageInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      VkResolveImageInfo2KHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_0,
+                                                      (VkImage*)&forUnmarshaling->srcImage, 1);
+    vkStream->read((VkImageLayout*)&forUnmarshaling->srcImageLayout, sizeof(VkImageLayout));
+    uint64_t cgen_var_1;
+    vkStream->read((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_1,
+                                                      (VkImage*)&forUnmarshaling->dstImage, 1);
+    vkStream->read((VkImageLayout*)&forUnmarshaling->dstImageLayout, sizeof(VkImageLayout));
+    vkStream->read((uint32_t*)&forUnmarshaling->regionCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->regionCount; ++i) {
+            unmarshal_VkImageResolve2KHR(vkStream, rootType,
+                                         (VkImageResolve2KHR*)(forUnmarshaling->pRegions + i));
+        }
+    }
+}
+
+#endif
+#ifdef VK_KHR_format_feature_flags2
+void marshal_VkFormatProperties3KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkFormatProperties3KHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkFormatFeatureFlags2KHR*)&forMarshaling->linearTilingFeatures,
+                    sizeof(VkFormatFeatureFlags2KHR));
+    vkStream->write((VkFormatFeatureFlags2KHR*)&forMarshaling->optimalTilingFeatures,
+                    sizeof(VkFormatFeatureFlags2KHR));
+    vkStream->write((VkFormatFeatureFlags2KHR*)&forMarshaling->bufferFeatures,
+                    sizeof(VkFormatFeatureFlags2KHR));
+}
+
+void unmarshal_VkFormatProperties3KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      VkFormatProperties3KHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkFormatFeatureFlags2KHR*)&forUnmarshaling->linearTilingFeatures,
+                   sizeof(VkFormatFeatureFlags2KHR));
+    vkStream->read((VkFormatFeatureFlags2KHR*)&forUnmarshaling->optimalTilingFeatures,
+                   sizeof(VkFormatFeatureFlags2KHR));
+    vkStream->read((VkFormatFeatureFlags2KHR*)&forUnmarshaling->bufferFeatures,
+                   sizeof(VkFormatFeatureFlags2KHR));
+}
+
+#endif
+#ifdef VK_KHR_maintenance4
+void marshal_VkPhysicalDeviceMaintenance4FeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMaintenance4FeaturesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->maintenance4, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceMaintenance4FeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceMaintenance4FeaturesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->maintenance4, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceMaintenance4PropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMaintenance4PropertiesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDeviceSize*)&forMarshaling->maxBufferSize, sizeof(VkDeviceSize));
+}
+
+void unmarshal_VkPhysicalDeviceMaintenance4PropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceMaintenance4PropertiesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->maxBufferSize, sizeof(VkDeviceSize));
+}
+
+void marshal_VkDeviceBufferMemoryRequirementsKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceBufferMemoryRequirementsKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkBufferCreateInfo(vkStream, rootType,
+                               (const VkBufferCreateInfo*)(forMarshaling->pCreateInfo));
+}
+
+void unmarshal_VkDeviceBufferMemoryRequirementsKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDeviceBufferMemoryRequirementsKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkBufferCreateInfo(vkStream, rootType,
+                                 (VkBufferCreateInfo*)(forUnmarshaling->pCreateInfo));
+}
+
+void marshal_VkDeviceImageMemoryRequirementsKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceImageMemoryRequirementsKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkImageCreateInfo(vkStream, rootType,
+                              (const VkImageCreateInfo*)(forMarshaling->pCreateInfo));
+    vkStream->write((VkImageAspectFlagBits*)&forMarshaling->planeAspect,
+                    sizeof(VkImageAspectFlagBits));
+}
+
+void unmarshal_VkDeviceImageMemoryRequirementsKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDeviceImageMemoryRequirementsKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkImageCreateInfo(vkStream, rootType,
+                                (VkImageCreateInfo*)(forUnmarshaling->pCreateInfo));
+    vkStream->read((VkImageAspectFlagBits*)&forUnmarshaling->planeAspect,
+                   sizeof(VkImageAspectFlagBits));
+}
+
+#endif
+#ifdef VK_ANDROID_native_buffer
+void marshal_VkNativeBufferANDROID(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkNativeBufferANDROID* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->handle;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->handle) {
+        vkStream->write((const uint32_t*)forMarshaling->handle, sizeof(const uint32_t));
+    }
+    vkStream->write((int*)&forMarshaling->stride, sizeof(int));
+    vkStream->write((int*)&forMarshaling->format, sizeof(int));
+    vkStream->write((int*)&forMarshaling->usage, sizeof(int));
+    vkStream->write((uint64_t*)&forMarshaling->consumer, sizeof(uint64_t));
+    vkStream->write((uint64_t*)&forMarshaling->producer, sizeof(uint64_t));
+}
+
+void unmarshal_VkNativeBufferANDROID(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkNativeBufferANDROID* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    // WARNING PTR CHECK
+    const uint32_t* check_handle;
+    check_handle = (const uint32_t*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->handle) {
+        if (!(check_handle)) {
+            fprintf(stderr, "fatal: forUnmarshaling->handle inconsistent between guest and host\n");
+        }
+        vkStream->read((uint32_t*)forUnmarshaling->handle, sizeof(const uint32_t));
+    }
+    vkStream->read((int*)&forUnmarshaling->stride, sizeof(int));
+    vkStream->read((int*)&forUnmarshaling->format, sizeof(int));
+    vkStream->read((int*)&forUnmarshaling->usage, sizeof(int));
+    vkStream->read((uint64_t*)&forUnmarshaling->consumer, sizeof(uint64_t));
+    vkStream->read((uint64_t*)&forUnmarshaling->producer, sizeof(uint64_t));
+}
+
+#endif
+#ifdef VK_EXT_debug_report
+void marshal_VkDebugReportCallbackCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDebugReportCallbackCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDebugReportFlagsEXT*)&forMarshaling->flags, sizeof(VkDebugReportFlagsEXT));
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->pfnCallback;
+    vkStream->putBe64(cgen_var_0);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pUserData;
+    vkStream->putBe64(cgen_var_1);
+    if (forMarshaling->pUserData) {
+        vkStream->write((void*)forMarshaling->pUserData, sizeof(uint8_t));
+    }
+}
+
+void unmarshal_VkDebugReportCallbackCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDebugReportCallbackCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDebugReportFlagsEXT*)&forUnmarshaling->flags, sizeof(VkDebugReportFlagsEXT));
+    forUnmarshaling->pfnCallback = (PFN_vkDebugReportCallbackEXT)vkStream->getBe64();
+    // WARNING PTR CHECK
+    void* check_pUserData;
+    check_pUserData = (void*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pUserData) {
+        if (!(check_pUserData)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pUserData inconsistent between guest and host\n");
+        }
+        vkStream->read((void*)forUnmarshaling->pUserData, sizeof(uint8_t));
+    }
+}
+
+#endif
+#ifdef VK_NV_glsl_shader
+#endif
+#ifdef VK_EXT_depth_range_unrestricted
+#endif
+#ifdef VK_IMG_filter_cubic
+#endif
+#ifdef VK_AMD_rasterization_order
+void marshal_VkPipelineRasterizationStateRasterizationOrderAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRasterizationStateRasterizationOrderAMD* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkRasterizationOrderAMD*)&forMarshaling->rasterizationOrder,
+                    sizeof(VkRasterizationOrderAMD));
+}
+
+void unmarshal_VkPipelineRasterizationStateRasterizationOrderAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineRasterizationStateRasterizationOrderAMD* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkRasterizationOrderAMD*)&forUnmarshaling->rasterizationOrder,
+                   sizeof(VkRasterizationOrderAMD));
+}
+
+#endif
+#ifdef VK_AMD_shader_trinary_minmax
+#endif
+#ifdef VK_AMD_shader_explicit_vertex_parameter
+#endif
+#ifdef VK_EXT_debug_marker
+void marshal_VkDebugMarkerObjectNameInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkDebugMarkerObjectNameInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDebugReportObjectTypeEXT*)&forMarshaling->objectType,
+                    sizeof(VkDebugReportObjectTypeEXT));
+    vkStream->write((uint64_t*)&forMarshaling->object, sizeof(uint64_t));
+    vkStream->putString(forMarshaling->pObjectName);
+}
+
+void unmarshal_VkDebugMarkerObjectNameInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkDebugMarkerObjectNameInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDebugReportObjectTypeEXT*)&forUnmarshaling->objectType,
+                   sizeof(VkDebugReportObjectTypeEXT));
+    vkStream->read((uint64_t*)&forUnmarshaling->object, sizeof(uint64_t));
+    vkStream->loadStringInPlace((char**)&forUnmarshaling->pObjectName);
+}
+
+void marshal_VkDebugMarkerObjectTagInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkDebugMarkerObjectTagInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDebugReportObjectTypeEXT*)&forMarshaling->objectType,
+                    sizeof(VkDebugReportObjectTypeEXT));
+    vkStream->write((uint64_t*)&forMarshaling->object, sizeof(uint64_t));
+    vkStream->write((uint64_t*)&forMarshaling->tagName, sizeof(uint64_t));
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->tagSize;
+    vkStream->putBe64(cgen_var_0);
+    vkStream->write((const void*)forMarshaling->pTag,
+                    forMarshaling->tagSize * sizeof(const uint8_t));
+}
+
+void unmarshal_VkDebugMarkerObjectTagInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkDebugMarkerObjectTagInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDebugReportObjectTypeEXT*)&forUnmarshaling->objectType,
+                   sizeof(VkDebugReportObjectTypeEXT));
+    vkStream->read((uint64_t*)&forUnmarshaling->object, sizeof(uint64_t));
+    vkStream->read((uint64_t*)&forUnmarshaling->tagName, sizeof(uint64_t));
+    forUnmarshaling->tagSize = (size_t)vkStream->getBe64();
+    vkStream->read((void*)forUnmarshaling->pTag, forUnmarshaling->tagSize * sizeof(const uint8_t));
+}
+
+void marshal_VkDebugMarkerMarkerInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkDebugMarkerMarkerInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->putString(forMarshaling->pMarkerName);
+    vkStream->write((float*)forMarshaling->color, 4 * sizeof(float));
+}
+
+void unmarshal_VkDebugMarkerMarkerInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkDebugMarkerMarkerInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->loadStringInPlace((char**)&forUnmarshaling->pMarkerName);
+    vkStream->read((float*)forUnmarshaling->color, 4 * sizeof(float));
+}
+
+#endif
+#ifdef VK_AMD_gcn_shader
+#endif
+#ifdef VK_NV_dedicated_allocation
+void marshal_VkDedicatedAllocationImageCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDedicatedAllocationImageCreateInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->dedicatedAllocation, sizeof(VkBool32));
+}
+
+void unmarshal_VkDedicatedAllocationImageCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDedicatedAllocationImageCreateInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->dedicatedAllocation, sizeof(VkBool32));
+}
+
+void marshal_VkDedicatedAllocationBufferCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDedicatedAllocationBufferCreateInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->dedicatedAllocation, sizeof(VkBool32));
+}
+
+void unmarshal_VkDedicatedAllocationBufferCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDedicatedAllocationBufferCreateInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->dedicatedAllocation, sizeof(VkBool32));
+}
+
+void marshal_VkDedicatedAllocationMemoryAllocateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDedicatedAllocationMemoryAllocateInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkImage_u64(&forMarshaling->image, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    uint64_t cgen_var_1;
+    vkStream->handleMapping()->mapHandles_VkBuffer_u64(&forMarshaling->buffer, &cgen_var_1, 1);
+    vkStream->write((uint64_t*)&cgen_var_1, 1 * 8);
+}
+
+void unmarshal_VkDedicatedAllocationMemoryAllocateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDedicatedAllocationMemoryAllocateInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_0,
+                                                      (VkImage*)&forUnmarshaling->image, 1);
+    uint64_t cgen_var_1;
+    vkStream->read((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_1,
+                                                       (VkBuffer*)&forUnmarshaling->buffer, 1);
+}
+
+#endif
+#ifdef VK_EXT_transform_feedback
+void marshal_VkPhysicalDeviceTransformFeedbackFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceTransformFeedbackFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->transformFeedback, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->geometryStreams, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceTransformFeedbackFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceTransformFeedbackFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->transformFeedback, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->geometryStreams, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceTransformFeedbackPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceTransformFeedbackPropertiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->maxTransformFeedbackStreams, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxTransformFeedbackBuffers, sizeof(uint32_t));
+    vkStream->write((VkDeviceSize*)&forMarshaling->maxTransformFeedbackBufferSize,
+                    sizeof(VkDeviceSize));
+    vkStream->write((uint32_t*)&forMarshaling->maxTransformFeedbackStreamDataSize,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxTransformFeedbackBufferDataSize,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxTransformFeedbackBufferDataStride,
+                    sizeof(uint32_t));
+    vkStream->write((VkBool32*)&forMarshaling->transformFeedbackQueries, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->transformFeedbackStreamsLinesTriangles,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->transformFeedbackRasterizationStreamSelect,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->transformFeedbackDraw, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceTransformFeedbackPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceTransformFeedbackPropertiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxTransformFeedbackStreams, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxTransformFeedbackBuffers, sizeof(uint32_t));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->maxTransformFeedbackBufferSize,
+                   sizeof(VkDeviceSize));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxTransformFeedbackStreamDataSize,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxTransformFeedbackBufferDataSize,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxTransformFeedbackBufferDataStride,
+                   sizeof(uint32_t));
+    vkStream->read((VkBool32*)&forUnmarshaling->transformFeedbackQueries, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->transformFeedbackStreamsLinesTriangles,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->transformFeedbackRasterizationStreamSelect,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->transformFeedbackDraw, sizeof(VkBool32));
+}
+
+void marshal_VkPipelineRasterizationStateStreamCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRasterizationStateStreamCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineRasterizationStateStreamCreateFlagsEXT*)&forMarshaling->flags,
+                    sizeof(VkPipelineRasterizationStateStreamCreateFlagsEXT));
+    vkStream->write((uint32_t*)&forMarshaling->rasterizationStream, sizeof(uint32_t));
+}
+
+void unmarshal_VkPipelineRasterizationStateStreamCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineRasterizationStateStreamCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineRasterizationStateStreamCreateFlagsEXT*)&forUnmarshaling->flags,
+                   sizeof(VkPipelineRasterizationStateStreamCreateFlagsEXT));
+    vkStream->read((uint32_t*)&forUnmarshaling->rasterizationStream, sizeof(uint32_t));
+}
+
+#endif
+#ifdef VK_NVX_binary_import
+void marshal_VkCuModuleCreateInfoNVX(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkCuModuleCreateInfoNVX* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->dataSize;
+    vkStream->putBe64(cgen_var_0);
+    vkStream->write((const void*)forMarshaling->pData,
+                    forMarshaling->dataSize * sizeof(const uint8_t));
+}
+
+void unmarshal_VkCuModuleCreateInfoNVX(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkCuModuleCreateInfoNVX* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    forUnmarshaling->dataSize = (size_t)vkStream->getBe64();
+    vkStream->read((void*)forUnmarshaling->pData,
+                   forUnmarshaling->dataSize * sizeof(const uint8_t));
+}
+
+void marshal_VkCuFunctionCreateInfoNVX(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkCuFunctionCreateInfoNVX* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->module;
+    vkStream->putBe64(cgen_var_0);
+    vkStream->putString(forMarshaling->pName);
+}
+
+void unmarshal_VkCuFunctionCreateInfoNVX(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkCuFunctionCreateInfoNVX* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    forUnmarshaling->module = (VkCuModuleNVX)vkStream->getBe64();
+    vkStream->loadStringInPlace((char**)&forUnmarshaling->pName);
+}
+
+void marshal_VkCuLaunchInfoNVX(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               const VkCuLaunchInfoNVX* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->function;
+    vkStream->putBe64(cgen_var_0);
+    vkStream->write((uint32_t*)&forMarshaling->gridDimX, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->gridDimY, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->gridDimZ, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->blockDimX, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->blockDimY, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->blockDimZ, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->sharedMemBytes, sizeof(uint32_t));
+    uint64_t cgen_var_1 = (uint64_t)forMarshaling->paramCount;
+    vkStream->putBe64(cgen_var_1);
+    uint64_t cgen_var_2 = (uint64_t)forMarshaling->extraCount;
+    vkStream->putBe64(cgen_var_2);
+}
+
+void unmarshal_VkCuLaunchInfoNVX(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 VkCuLaunchInfoNVX* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    forUnmarshaling->function = (VkCuFunctionNVX)vkStream->getBe64();
+    vkStream->read((uint32_t*)&forUnmarshaling->gridDimX, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->gridDimY, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->gridDimZ, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->blockDimX, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->blockDimY, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->blockDimZ, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->sharedMemBytes, sizeof(uint32_t));
+    forUnmarshaling->paramCount = (size_t)vkStream->getBe64();
+    forUnmarshaling->extraCount = (size_t)vkStream->getBe64();
+}
+
+#endif
+#ifdef VK_NVX_image_view_handle
+void marshal_VkImageViewHandleInfoNVX(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkImageViewHandleInfoNVX* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkImageView_u64(&forMarshaling->imageView, &cgen_var_0,
+                                                          1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkDescriptorType*)&forMarshaling->descriptorType, sizeof(VkDescriptorType));
+    uint64_t cgen_var_1;
+    vkStream->handleMapping()->mapHandles_VkSampler_u64(&forMarshaling->sampler, &cgen_var_1, 1);
+    vkStream->write((uint64_t*)&cgen_var_1, 1 * 8);
+}
+
+void unmarshal_VkImageViewHandleInfoNVX(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkImageViewHandleInfoNVX* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkImageView(
+        &cgen_var_0, (VkImageView*)&forUnmarshaling->imageView, 1);
+    vkStream->read((VkDescriptorType*)&forUnmarshaling->descriptorType, sizeof(VkDescriptorType));
+    uint64_t cgen_var_1;
+    vkStream->read((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkSampler(&cgen_var_1,
+                                                        (VkSampler*)&forUnmarshaling->sampler, 1);
+}
+
+void marshal_VkImageViewAddressPropertiesNVX(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkImageViewAddressPropertiesNVX* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDeviceAddress*)&forMarshaling->deviceAddress, sizeof(VkDeviceAddress));
+    vkStream->write((VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
+}
+
+void unmarshal_VkImageViewAddressPropertiesNVX(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkImageViewAddressPropertiesNVX* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDeviceAddress*)&forUnmarshaling->deviceAddress, sizeof(VkDeviceAddress));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->size, sizeof(VkDeviceSize));
+}
+
+#endif
+#ifdef VK_AMD_draw_indirect_count
+#endif
+#ifdef VK_AMD_negative_viewport_height
+#endif
+#ifdef VK_AMD_gpu_shader_half_float
+#endif
+#ifdef VK_AMD_shader_ballot
+#endif
+#ifdef VK_EXT_video_encode_h264
+void marshal_VkVideoEncodeH264CapabilitiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH264CapabilitiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkVideoEncodeH264CapabilityFlagsEXT*)&forMarshaling->flags,
+                    sizeof(VkVideoEncodeH264CapabilityFlagsEXT));
+    vkStream->write((VkVideoEncodeH264InputModeFlagsEXT*)&forMarshaling->inputModeFlags,
+                    sizeof(VkVideoEncodeH264InputModeFlagsEXT));
+    vkStream->write((VkVideoEncodeH264OutputModeFlagsEXT*)&forMarshaling->outputModeFlags,
+                    sizeof(VkVideoEncodeH264OutputModeFlagsEXT));
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->minPictureSizeInMbs));
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->maxPictureSizeInMbs));
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->inputImageDataAlignment));
+    vkStream->write((uint8_t*)&forMarshaling->maxNumL0ReferenceForP, sizeof(uint8_t));
+    vkStream->write((uint8_t*)&forMarshaling->maxNumL0ReferenceForB, sizeof(uint8_t));
+    vkStream->write((uint8_t*)&forMarshaling->maxNumL1Reference, sizeof(uint8_t));
+    vkStream->write((uint8_t*)&forMarshaling->qualityLevelCount, sizeof(uint8_t));
+    marshal_VkExtensionProperties(vkStream, rootType,
+                                  (VkExtensionProperties*)(&forMarshaling->stdExtensionVersion));
+}
+
+void unmarshal_VkVideoEncodeH264CapabilitiesEXT(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkVideoEncodeH264CapabilitiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkVideoEncodeH264CapabilityFlagsEXT*)&forUnmarshaling->flags,
+                   sizeof(VkVideoEncodeH264CapabilityFlagsEXT));
+    vkStream->read((VkVideoEncodeH264InputModeFlagsEXT*)&forUnmarshaling->inputModeFlags,
+                   sizeof(VkVideoEncodeH264InputModeFlagsEXT));
+    vkStream->read((VkVideoEncodeH264OutputModeFlagsEXT*)&forUnmarshaling->outputModeFlags,
+                   sizeof(VkVideoEncodeH264OutputModeFlagsEXT));
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->minPictureSizeInMbs));
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->maxPictureSizeInMbs));
+    unmarshal_VkExtent2D(vkStream, rootType,
+                         (VkExtent2D*)(&forUnmarshaling->inputImageDataAlignment));
+    vkStream->read((uint8_t*)&forUnmarshaling->maxNumL0ReferenceForP, sizeof(uint8_t));
+    vkStream->read((uint8_t*)&forUnmarshaling->maxNumL0ReferenceForB, sizeof(uint8_t));
+    vkStream->read((uint8_t*)&forUnmarshaling->maxNumL1Reference, sizeof(uint8_t));
+    vkStream->read((uint8_t*)&forUnmarshaling->qualityLevelCount, sizeof(uint8_t));
+    unmarshal_VkExtensionProperties(
+        vkStream, rootType, (VkExtensionProperties*)(&forUnmarshaling->stdExtensionVersion));
+}
+
+void marshal_VkVideoEncodeH264SessionCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH264SessionCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkVideoEncodeH264CreateFlagsEXT*)&forMarshaling->flags,
+                    sizeof(VkVideoEncodeH264CreateFlagsEXT));
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->maxPictureSizeInMbs));
+    marshal_VkExtensionProperties(
+        vkStream, rootType, (const VkExtensionProperties*)(forMarshaling->pStdExtensionVersion));
+}
+
+void unmarshal_VkVideoEncodeH264SessionCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoEncodeH264SessionCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkVideoEncodeH264CreateFlagsEXT*)&forUnmarshaling->flags,
+                   sizeof(VkVideoEncodeH264CreateFlagsEXT));
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->maxPictureSizeInMbs));
+    unmarshal_VkExtensionProperties(
+        vkStream, rootType, (VkExtensionProperties*)(forUnmarshaling->pStdExtensionVersion));
+}
+
+void marshal_VkVideoEncodeH264SessionParametersAddInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH264SessionParametersAddInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->spsStdCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pSpsStd;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pSpsStd) {
+        vkStream->write(
+            (const StdVideoH264SequenceParameterSet*)forMarshaling->pSpsStd,
+            forMarshaling->spsStdCount * sizeof(const StdVideoH264SequenceParameterSet));
+    }
+    vkStream->write((uint32_t*)&forMarshaling->ppsStdCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pPpsStd;
+    vkStream->putBe64(cgen_var_1);
+    if (forMarshaling->pPpsStd) {
+        vkStream->write((const StdVideoH264PictureParameterSet*)forMarshaling->pPpsStd,
+                        forMarshaling->ppsStdCount * sizeof(const StdVideoH264PictureParameterSet));
+    }
+}
+
+void unmarshal_VkVideoEncodeH264SessionParametersAddInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoEncodeH264SessionParametersAddInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->spsStdCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const StdVideoH264SequenceParameterSet* check_pSpsStd;
+    check_pSpsStd = (const StdVideoH264SequenceParameterSet*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pSpsStd) {
+        if (!(check_pSpsStd)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pSpsStd inconsistent between guest and host\n");
+        }
+        vkStream->read(
+            (StdVideoH264SequenceParameterSet*)forUnmarshaling->pSpsStd,
+            forUnmarshaling->spsStdCount * sizeof(const StdVideoH264SequenceParameterSet));
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->ppsStdCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const StdVideoH264PictureParameterSet* check_pPpsStd;
+    check_pPpsStd = (const StdVideoH264PictureParameterSet*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pPpsStd) {
+        if (!(check_pPpsStd)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pPpsStd inconsistent between guest and host\n");
+        }
+        vkStream->read(
+            (StdVideoH264PictureParameterSet*)forUnmarshaling->pPpsStd,
+            forUnmarshaling->ppsStdCount * sizeof(const StdVideoH264PictureParameterSet));
+    }
+}
+
+void marshal_VkVideoEncodeH264SessionParametersCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH264SessionParametersCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->maxSpsStdCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxPpsStdCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pParametersAddInfo;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pParametersAddInfo) {
+        marshal_VkVideoEncodeH264SessionParametersAddInfoEXT(
+            vkStream, rootType,
+            (const VkVideoEncodeH264SessionParametersAddInfoEXT*)(forMarshaling
+                                                                      ->pParametersAddInfo));
+    }
+}
+
+void unmarshal_VkVideoEncodeH264SessionParametersCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoEncodeH264SessionParametersCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxSpsStdCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPpsStdCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const VkVideoEncodeH264SessionParametersAddInfoEXT* check_pParametersAddInfo;
+    check_pParametersAddInfo =
+        (const VkVideoEncodeH264SessionParametersAddInfoEXT*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pParametersAddInfo) {
+        if (!(check_pParametersAddInfo)) {
+            fprintf(
+                stderr,
+                "fatal: forUnmarshaling->pParametersAddInfo inconsistent between guest and host\n");
+        }
+        unmarshal_VkVideoEncodeH264SessionParametersAddInfoEXT(
+            vkStream, rootType,
+            (VkVideoEncodeH264SessionParametersAddInfoEXT*)(forUnmarshaling->pParametersAddInfo));
+    }
+}
+
+void marshal_VkVideoEncodeH264DpbSlotInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkVideoEncodeH264DpbSlotInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((int8_t*)&forMarshaling->slotIndex, sizeof(int8_t));
+    vkStream->write((const StdVideoEncodeH264PictureInfo*)forMarshaling->pStdPictureInfo,
+                    sizeof(const StdVideoEncodeH264PictureInfo));
+}
+
+void unmarshal_VkVideoEncodeH264DpbSlotInfoEXT(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkVideoEncodeH264DpbSlotInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((int8_t*)&forUnmarshaling->slotIndex, sizeof(int8_t));
+    vkStream->read((StdVideoEncodeH264PictureInfo*)forUnmarshaling->pStdPictureInfo,
+                   sizeof(const StdVideoEncodeH264PictureInfo));
+}
+
+void marshal_VkVideoEncodeH264NaluSliceEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkVideoEncodeH264NaluSliceEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((const StdVideoEncodeH264SliceHeader*)forMarshaling->pSliceHeaderStd,
+                    sizeof(const StdVideoEncodeH264SliceHeader));
+    vkStream->write((uint32_t*)&forMarshaling->mbCount, sizeof(uint32_t));
+    vkStream->write((uint8_t*)&forMarshaling->refFinalList0EntryCount, sizeof(uint8_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->refFinalList0EntryCount; ++i) {
+            marshal_VkVideoEncodeH264DpbSlotInfoEXT(
+                vkStream, rootType,
+                (const VkVideoEncodeH264DpbSlotInfoEXT*)(forMarshaling->pRefFinalList0Entries + i));
+        }
+    }
+    vkStream->write((uint8_t*)&forMarshaling->refFinalList1EntryCount, sizeof(uint8_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->refFinalList1EntryCount; ++i) {
+            marshal_VkVideoEncodeH264DpbSlotInfoEXT(
+                vkStream, rootType,
+                (const VkVideoEncodeH264DpbSlotInfoEXT*)(forMarshaling->pRefFinalList1Entries + i));
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->precedingNaluBytes, sizeof(uint32_t));
+    vkStream->write((uint8_t*)&forMarshaling->minQp, sizeof(uint8_t));
+    vkStream->write((uint8_t*)&forMarshaling->maxQp, sizeof(uint8_t));
+}
+
+void unmarshal_VkVideoEncodeH264NaluSliceEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkVideoEncodeH264NaluSliceEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((StdVideoEncodeH264SliceHeader*)forUnmarshaling->pSliceHeaderStd,
+                   sizeof(const StdVideoEncodeH264SliceHeader));
+    vkStream->read((uint32_t*)&forUnmarshaling->mbCount, sizeof(uint32_t));
+    vkStream->read((uint8_t*)&forUnmarshaling->refFinalList0EntryCount, sizeof(uint8_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->refFinalList0EntryCount; ++i) {
+            unmarshal_VkVideoEncodeH264DpbSlotInfoEXT(
+                vkStream, rootType,
+                (VkVideoEncodeH264DpbSlotInfoEXT*)(forUnmarshaling->pRefFinalList0Entries + i));
+        }
+    }
+    vkStream->read((uint8_t*)&forUnmarshaling->refFinalList1EntryCount, sizeof(uint8_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->refFinalList1EntryCount; ++i) {
+            unmarshal_VkVideoEncodeH264DpbSlotInfoEXT(
+                vkStream, rootType,
+                (VkVideoEncodeH264DpbSlotInfoEXT*)(forUnmarshaling->pRefFinalList1Entries + i));
+        }
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->precedingNaluBytes, sizeof(uint32_t));
+    vkStream->read((uint8_t*)&forUnmarshaling->minQp, sizeof(uint8_t));
+    vkStream->read((uint8_t*)&forUnmarshaling->maxQp, sizeof(uint8_t));
+}
+
+void marshal_VkVideoEncodeH264VclFrameInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH264VclFrameInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint8_t*)&forMarshaling->refDefaultFinalList0EntryCount, sizeof(uint8_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->refDefaultFinalList0EntryCount; ++i) {
+            marshal_VkVideoEncodeH264DpbSlotInfoEXT(
+                vkStream, rootType,
+                (const VkVideoEncodeH264DpbSlotInfoEXT*)(forMarshaling
+                                                             ->pRefDefaultFinalList0Entries +
+                                                         i));
+        }
+    }
+    vkStream->write((uint8_t*)&forMarshaling->refDefaultFinalList1EntryCount, sizeof(uint8_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->refDefaultFinalList1EntryCount; ++i) {
+            marshal_VkVideoEncodeH264DpbSlotInfoEXT(
+                vkStream, rootType,
+                (const VkVideoEncodeH264DpbSlotInfoEXT*)(forMarshaling
+                                                             ->pRefDefaultFinalList1Entries +
+                                                         i));
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->naluSliceEntryCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->naluSliceEntryCount; ++i) {
+            marshal_VkVideoEncodeH264NaluSliceEXT(
+                vkStream, rootType,
+                (const VkVideoEncodeH264NaluSliceEXT*)(forMarshaling->pNaluSliceEntries + i));
+        }
+    }
+    marshal_VkVideoEncodeH264DpbSlotInfoEXT(
+        vkStream, rootType,
+        (const VkVideoEncodeH264DpbSlotInfoEXT*)(forMarshaling->pCurrentPictureInfo));
+}
+
+void unmarshal_VkVideoEncodeH264VclFrameInfoEXT(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkVideoEncodeH264VclFrameInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint8_t*)&forUnmarshaling->refDefaultFinalList0EntryCount, sizeof(uint8_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->refDefaultFinalList0EntryCount; ++i) {
+            unmarshal_VkVideoEncodeH264DpbSlotInfoEXT(
+                vkStream, rootType,
+                (VkVideoEncodeH264DpbSlotInfoEXT*)(forUnmarshaling->pRefDefaultFinalList0Entries +
+                                                   i));
+        }
+    }
+    vkStream->read((uint8_t*)&forUnmarshaling->refDefaultFinalList1EntryCount, sizeof(uint8_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->refDefaultFinalList1EntryCount; ++i) {
+            unmarshal_VkVideoEncodeH264DpbSlotInfoEXT(
+                vkStream, rootType,
+                (VkVideoEncodeH264DpbSlotInfoEXT*)(forUnmarshaling->pRefDefaultFinalList1Entries +
+                                                   i));
+        }
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->naluSliceEntryCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->naluSliceEntryCount; ++i) {
+            unmarshal_VkVideoEncodeH264NaluSliceEXT(
+                vkStream, rootType,
+                (VkVideoEncodeH264NaluSliceEXT*)(forUnmarshaling->pNaluSliceEntries + i));
+        }
+    }
+    unmarshal_VkVideoEncodeH264DpbSlotInfoEXT(
+        vkStream, rootType,
+        (VkVideoEncodeH264DpbSlotInfoEXT*)(forUnmarshaling->pCurrentPictureInfo));
+}
+
+void marshal_VkVideoEncodeH264EmitPictureParametersEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH264EmitPictureParametersEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint8_t*)&forMarshaling->spsId, sizeof(uint8_t));
+    vkStream->write((VkBool32*)&forMarshaling->emitSpsEnable, sizeof(VkBool32));
+    vkStream->write((uint32_t*)&forMarshaling->ppsIdEntryCount, sizeof(uint32_t));
+    vkStream->write((const uint8_t*)forMarshaling->ppsIdEntries,
+                    forMarshaling->ppsIdEntryCount * sizeof(const uint8_t));
+}
+
+void unmarshal_VkVideoEncodeH264EmitPictureParametersEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoEncodeH264EmitPictureParametersEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint8_t*)&forUnmarshaling->spsId, sizeof(uint8_t));
+    vkStream->read((VkBool32*)&forUnmarshaling->emitSpsEnable, sizeof(VkBool32));
+    vkStream->read((uint32_t*)&forUnmarshaling->ppsIdEntryCount, sizeof(uint32_t));
+    vkStream->read((uint8_t*)forUnmarshaling->ppsIdEntries,
+                   forUnmarshaling->ppsIdEntryCount * sizeof(const uint8_t));
+}
+
+void marshal_VkVideoEncodeH264ProfileEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkVideoEncodeH264ProfileEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((StdVideoH264ProfileIdc*)&forMarshaling->stdProfileIdc,
+                    sizeof(StdVideoH264ProfileIdc));
+}
+
+void unmarshal_VkVideoEncodeH264ProfileEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkVideoEncodeH264ProfileEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((StdVideoH264ProfileIdc*)&forUnmarshaling->stdProfileIdc,
+                   sizeof(StdVideoH264ProfileIdc));
+}
+
+#endif
+#ifdef VK_EXT_video_encode_h265
+void marshal_VkVideoEncodeH265CapabilitiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265CapabilitiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkVideoEncodeH265CapabilityFlagsEXT*)&forMarshaling->flags,
+                    sizeof(VkVideoEncodeH265CapabilityFlagsEXT));
+    vkStream->write((VkVideoEncodeH265InputModeFlagsEXT*)&forMarshaling->inputModeFlags,
+                    sizeof(VkVideoEncodeH265InputModeFlagsEXT));
+    vkStream->write((VkVideoEncodeH265OutputModeFlagsEXT*)&forMarshaling->outputModeFlags,
+                    sizeof(VkVideoEncodeH265OutputModeFlagsEXT));
+    vkStream->write((VkVideoEncodeH265CtbSizeFlagsEXT*)&forMarshaling->ctbSizes,
+                    sizeof(VkVideoEncodeH265CtbSizeFlagsEXT));
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->inputImageDataAlignment));
+    vkStream->write((uint8_t*)&forMarshaling->maxNumL0ReferenceForP, sizeof(uint8_t));
+    vkStream->write((uint8_t*)&forMarshaling->maxNumL0ReferenceForB, sizeof(uint8_t));
+    vkStream->write((uint8_t*)&forMarshaling->maxNumL1Reference, sizeof(uint8_t));
+    vkStream->write((uint8_t*)&forMarshaling->maxNumSubLayers, sizeof(uint8_t));
+    vkStream->write((uint8_t*)&forMarshaling->qualityLevelCount, sizeof(uint8_t));
+    marshal_VkExtensionProperties(vkStream, rootType,
+                                  (VkExtensionProperties*)(&forMarshaling->stdExtensionVersion));
+}
+
+void unmarshal_VkVideoEncodeH265CapabilitiesEXT(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkVideoEncodeH265CapabilitiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkVideoEncodeH265CapabilityFlagsEXT*)&forUnmarshaling->flags,
+                   sizeof(VkVideoEncodeH265CapabilityFlagsEXT));
+    vkStream->read((VkVideoEncodeH265InputModeFlagsEXT*)&forUnmarshaling->inputModeFlags,
+                   sizeof(VkVideoEncodeH265InputModeFlagsEXT));
+    vkStream->read((VkVideoEncodeH265OutputModeFlagsEXT*)&forUnmarshaling->outputModeFlags,
+                   sizeof(VkVideoEncodeH265OutputModeFlagsEXT));
+    vkStream->read((VkVideoEncodeH265CtbSizeFlagsEXT*)&forUnmarshaling->ctbSizes,
+                   sizeof(VkVideoEncodeH265CtbSizeFlagsEXT));
+    unmarshal_VkExtent2D(vkStream, rootType,
+                         (VkExtent2D*)(&forUnmarshaling->inputImageDataAlignment));
+    vkStream->read((uint8_t*)&forUnmarshaling->maxNumL0ReferenceForP, sizeof(uint8_t));
+    vkStream->read((uint8_t*)&forUnmarshaling->maxNumL0ReferenceForB, sizeof(uint8_t));
+    vkStream->read((uint8_t*)&forUnmarshaling->maxNumL1Reference, sizeof(uint8_t));
+    vkStream->read((uint8_t*)&forUnmarshaling->maxNumSubLayers, sizeof(uint8_t));
+    vkStream->read((uint8_t*)&forUnmarshaling->qualityLevelCount, sizeof(uint8_t));
+    unmarshal_VkExtensionProperties(
+        vkStream, rootType, (VkExtensionProperties*)(&forUnmarshaling->stdExtensionVersion));
+}
+
+void marshal_VkVideoEncodeH265SessionCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265SessionCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkVideoEncodeH265CreateFlagsEXT*)&forMarshaling->flags,
+                    sizeof(VkVideoEncodeH265CreateFlagsEXT));
+    marshal_VkExtensionProperties(
+        vkStream, rootType, (const VkExtensionProperties*)(forMarshaling->pStdExtensionVersion));
+}
+
+void unmarshal_VkVideoEncodeH265SessionCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoEncodeH265SessionCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkVideoEncodeH265CreateFlagsEXT*)&forUnmarshaling->flags,
+                   sizeof(VkVideoEncodeH265CreateFlagsEXT));
+    unmarshal_VkExtensionProperties(
+        vkStream, rootType, (VkExtensionProperties*)(forUnmarshaling->pStdExtensionVersion));
+}
+
+void marshal_VkVideoEncodeH265SessionParametersAddInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265SessionParametersAddInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->vpsStdCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pVpsStd;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pVpsStd) {
+        vkStream->write((const StdVideoH265VideoParameterSet*)forMarshaling->pVpsStd,
+                        forMarshaling->vpsStdCount * sizeof(const StdVideoH265VideoParameterSet));
+    }
+    vkStream->write((uint32_t*)&forMarshaling->spsStdCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pSpsStd;
+    vkStream->putBe64(cgen_var_1);
+    if (forMarshaling->pSpsStd) {
+        vkStream->write(
+            (const StdVideoH265SequenceParameterSet*)forMarshaling->pSpsStd,
+            forMarshaling->spsStdCount * sizeof(const StdVideoH265SequenceParameterSet));
+    }
+    vkStream->write((uint32_t*)&forMarshaling->ppsStdCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)forMarshaling->pPpsStd;
+    vkStream->putBe64(cgen_var_2);
+    if (forMarshaling->pPpsStd) {
+        vkStream->write((const StdVideoH265PictureParameterSet*)forMarshaling->pPpsStd,
+                        forMarshaling->ppsStdCount * sizeof(const StdVideoH265PictureParameterSet));
+    }
+}
+
+void unmarshal_VkVideoEncodeH265SessionParametersAddInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoEncodeH265SessionParametersAddInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->vpsStdCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const StdVideoH265VideoParameterSet* check_pVpsStd;
+    check_pVpsStd = (const StdVideoH265VideoParameterSet*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pVpsStd) {
+        if (!(check_pVpsStd)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pVpsStd inconsistent between guest and host\n");
+        }
+        vkStream->read((StdVideoH265VideoParameterSet*)forUnmarshaling->pVpsStd,
+                       forUnmarshaling->vpsStdCount * sizeof(const StdVideoH265VideoParameterSet));
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->spsStdCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const StdVideoH265SequenceParameterSet* check_pSpsStd;
+    check_pSpsStd = (const StdVideoH265SequenceParameterSet*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pSpsStd) {
+        if (!(check_pSpsStd)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pSpsStd inconsistent between guest and host\n");
+        }
+        vkStream->read(
+            (StdVideoH265SequenceParameterSet*)forUnmarshaling->pSpsStd,
+            forUnmarshaling->spsStdCount * sizeof(const StdVideoH265SequenceParameterSet));
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->ppsStdCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const StdVideoH265PictureParameterSet* check_pPpsStd;
+    check_pPpsStd = (const StdVideoH265PictureParameterSet*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pPpsStd) {
+        if (!(check_pPpsStd)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pPpsStd inconsistent between guest and host\n");
+        }
+        vkStream->read(
+            (StdVideoH265PictureParameterSet*)forUnmarshaling->pPpsStd,
+            forUnmarshaling->ppsStdCount * sizeof(const StdVideoH265PictureParameterSet));
+    }
+}
+
+void marshal_VkVideoEncodeH265SessionParametersCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265SessionParametersCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->maxVpsStdCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxSpsStdCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxPpsStdCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pParametersAddInfo;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pParametersAddInfo) {
+        marshal_VkVideoEncodeH265SessionParametersAddInfoEXT(
+            vkStream, rootType,
+            (const VkVideoEncodeH265SessionParametersAddInfoEXT*)(forMarshaling
+                                                                      ->pParametersAddInfo));
+    }
+}
+
+void unmarshal_VkVideoEncodeH265SessionParametersCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoEncodeH265SessionParametersCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxVpsStdCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxSpsStdCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPpsStdCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const VkVideoEncodeH265SessionParametersAddInfoEXT* check_pParametersAddInfo;
+    check_pParametersAddInfo =
+        (const VkVideoEncodeH265SessionParametersAddInfoEXT*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pParametersAddInfo) {
+        if (!(check_pParametersAddInfo)) {
+            fprintf(
+                stderr,
+                "fatal: forUnmarshaling->pParametersAddInfo inconsistent between guest and host\n");
+        }
+        unmarshal_VkVideoEncodeH265SessionParametersAddInfoEXT(
+            vkStream, rootType,
+            (VkVideoEncodeH265SessionParametersAddInfoEXT*)(forUnmarshaling->pParametersAddInfo));
+    }
+}
+
+void marshal_VkVideoEncodeH265DpbSlotInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkVideoEncodeH265DpbSlotInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((int8_t*)&forMarshaling->slotIndex, sizeof(int8_t));
+    vkStream->write((const StdVideoEncodeH265ReferenceInfo*)forMarshaling->pStdReferenceInfo,
+                    sizeof(const StdVideoEncodeH265ReferenceInfo));
+}
+
+void unmarshal_VkVideoEncodeH265DpbSlotInfoEXT(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkVideoEncodeH265DpbSlotInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((int8_t*)&forUnmarshaling->slotIndex, sizeof(int8_t));
+    vkStream->read((StdVideoEncodeH265ReferenceInfo*)forUnmarshaling->pStdReferenceInfo,
+                   sizeof(const StdVideoEncodeH265ReferenceInfo));
+}
+
+void marshal_VkVideoEncodeH265ReferenceListsEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265ReferenceListsEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint8_t*)&forMarshaling->referenceList0EntryCount, sizeof(uint8_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->referenceList0EntryCount; ++i) {
+            marshal_VkVideoEncodeH265DpbSlotInfoEXT(
+                vkStream, rootType,
+                (const VkVideoEncodeH265DpbSlotInfoEXT*)(forMarshaling->pReferenceList0Entries +
+                                                         i));
+        }
+    }
+    vkStream->write((uint8_t*)&forMarshaling->referenceList1EntryCount, sizeof(uint8_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->referenceList1EntryCount; ++i) {
+            marshal_VkVideoEncodeH265DpbSlotInfoEXT(
+                vkStream, rootType,
+                (const VkVideoEncodeH265DpbSlotInfoEXT*)(forMarshaling->pReferenceList1Entries +
+                                                         i));
+        }
+    }
+    vkStream->write(
+        (const StdVideoEncodeH265ReferenceModifications*)forMarshaling->pReferenceModifications,
+        sizeof(const StdVideoEncodeH265ReferenceModifications));
+}
+
+void unmarshal_VkVideoEncodeH265ReferenceListsEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoEncodeH265ReferenceListsEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint8_t*)&forUnmarshaling->referenceList0EntryCount, sizeof(uint8_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->referenceList0EntryCount; ++i) {
+            unmarshal_VkVideoEncodeH265DpbSlotInfoEXT(
+                vkStream, rootType,
+                (VkVideoEncodeH265DpbSlotInfoEXT*)(forUnmarshaling->pReferenceList0Entries + i));
+        }
+    }
+    vkStream->read((uint8_t*)&forUnmarshaling->referenceList1EntryCount, sizeof(uint8_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->referenceList1EntryCount; ++i) {
+            unmarshal_VkVideoEncodeH265DpbSlotInfoEXT(
+                vkStream, rootType,
+                (VkVideoEncodeH265DpbSlotInfoEXT*)(forUnmarshaling->pReferenceList1Entries + i));
+        }
+    }
+    vkStream->read(
+        (StdVideoEncodeH265ReferenceModifications*)forUnmarshaling->pReferenceModifications,
+        sizeof(const StdVideoEncodeH265ReferenceModifications));
+}
+
+void marshal_VkVideoEncodeH265NaluSliceEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkVideoEncodeH265NaluSliceEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->ctbCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pReferenceFinalLists;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pReferenceFinalLists) {
+        marshal_VkVideoEncodeH265ReferenceListsEXT(
+            vkStream, rootType,
+            (const VkVideoEncodeH265ReferenceListsEXT*)(forMarshaling->pReferenceFinalLists));
+    }
+    vkStream->write((const StdVideoEncodeH265SliceHeader*)forMarshaling->pSliceHeaderStd,
+                    sizeof(const StdVideoEncodeH265SliceHeader));
+}
+
+void unmarshal_VkVideoEncodeH265NaluSliceEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkVideoEncodeH265NaluSliceEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->ctbCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const VkVideoEncodeH265ReferenceListsEXT* check_pReferenceFinalLists;
+    check_pReferenceFinalLists =
+        (const VkVideoEncodeH265ReferenceListsEXT*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pReferenceFinalLists) {
+        if (!(check_pReferenceFinalLists)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pReferenceFinalLists inconsistent between guest and "
+                    "host\n");
+        }
+        unmarshal_VkVideoEncodeH265ReferenceListsEXT(
+            vkStream, rootType,
+            (VkVideoEncodeH265ReferenceListsEXT*)(forUnmarshaling->pReferenceFinalLists));
+    }
+    vkStream->read((StdVideoEncodeH265SliceHeader*)forUnmarshaling->pSliceHeaderStd,
+                   sizeof(const StdVideoEncodeH265SliceHeader));
+}
+
+void marshal_VkVideoEncodeH265VclFrameInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265VclFrameInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pReferenceFinalLists;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pReferenceFinalLists) {
+        marshal_VkVideoEncodeH265ReferenceListsEXT(
+            vkStream, rootType,
+            (const VkVideoEncodeH265ReferenceListsEXT*)(forMarshaling->pReferenceFinalLists));
+    }
+    vkStream->write((uint32_t*)&forMarshaling->naluSliceEntryCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->naluSliceEntryCount; ++i) {
+            marshal_VkVideoEncodeH265NaluSliceEXT(
+                vkStream, rootType,
+                (const VkVideoEncodeH265NaluSliceEXT*)(forMarshaling->pNaluSliceEntries + i));
+        }
+    }
+    vkStream->write((const StdVideoEncodeH265PictureInfo*)forMarshaling->pCurrentPictureInfo,
+                    sizeof(const StdVideoEncodeH265PictureInfo));
+}
+
+void unmarshal_VkVideoEncodeH265VclFrameInfoEXT(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkVideoEncodeH265VclFrameInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    // WARNING PTR CHECK
+    const VkVideoEncodeH265ReferenceListsEXT* check_pReferenceFinalLists;
+    check_pReferenceFinalLists =
+        (const VkVideoEncodeH265ReferenceListsEXT*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pReferenceFinalLists) {
+        if (!(check_pReferenceFinalLists)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pReferenceFinalLists inconsistent between guest and "
+                    "host\n");
+        }
+        unmarshal_VkVideoEncodeH265ReferenceListsEXT(
+            vkStream, rootType,
+            (VkVideoEncodeH265ReferenceListsEXT*)(forUnmarshaling->pReferenceFinalLists));
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->naluSliceEntryCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->naluSliceEntryCount; ++i) {
+            unmarshal_VkVideoEncodeH265NaluSliceEXT(
+                vkStream, rootType,
+                (VkVideoEncodeH265NaluSliceEXT*)(forUnmarshaling->pNaluSliceEntries + i));
+        }
+    }
+    vkStream->read((StdVideoEncodeH265PictureInfo*)forUnmarshaling->pCurrentPictureInfo,
+                   sizeof(const StdVideoEncodeH265PictureInfo));
+}
+
+void marshal_VkVideoEncodeH265EmitPictureParametersEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265EmitPictureParametersEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint8_t*)&forMarshaling->vpsId, sizeof(uint8_t));
+    vkStream->write((uint8_t*)&forMarshaling->spsId, sizeof(uint8_t));
+    vkStream->write((VkBool32*)&forMarshaling->emitVpsEnable, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->emitSpsEnable, sizeof(VkBool32));
+    vkStream->write((uint32_t*)&forMarshaling->ppsIdEntryCount, sizeof(uint32_t));
+    vkStream->write((const uint8_t*)forMarshaling->ppsIdEntries,
+                    forMarshaling->ppsIdEntryCount * sizeof(const uint8_t));
+}
+
+void unmarshal_VkVideoEncodeH265EmitPictureParametersEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoEncodeH265EmitPictureParametersEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint8_t*)&forUnmarshaling->vpsId, sizeof(uint8_t));
+    vkStream->read((uint8_t*)&forUnmarshaling->spsId, sizeof(uint8_t));
+    vkStream->read((VkBool32*)&forUnmarshaling->emitVpsEnable, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->emitSpsEnable, sizeof(VkBool32));
+    vkStream->read((uint32_t*)&forUnmarshaling->ppsIdEntryCount, sizeof(uint32_t));
+    vkStream->read((uint8_t*)forUnmarshaling->ppsIdEntries,
+                   forUnmarshaling->ppsIdEntryCount * sizeof(const uint8_t));
+}
+
+void marshal_VkVideoEncodeH265ProfileEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkVideoEncodeH265ProfileEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((StdVideoH265ProfileIdc*)&forMarshaling->stdProfileIdc,
+                    sizeof(StdVideoH265ProfileIdc));
+}
+
+void unmarshal_VkVideoEncodeH265ProfileEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkVideoEncodeH265ProfileEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((StdVideoH265ProfileIdc*)&forUnmarshaling->stdProfileIdc,
+                   sizeof(StdVideoH265ProfileIdc));
+}
+
+#endif
+#ifdef VK_EXT_video_decode_h264
+void marshal_VkVideoDecodeH264ProfileEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkVideoDecodeH264ProfileEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((StdVideoH264ProfileIdc*)&forMarshaling->stdProfileIdc,
+                    sizeof(StdVideoH264ProfileIdc));
+    vkStream->write((VkVideoDecodeH264PictureLayoutFlagsEXT*)&forMarshaling->pictureLayout,
+                    sizeof(VkVideoDecodeH264PictureLayoutFlagsEXT));
+}
+
+void unmarshal_VkVideoDecodeH264ProfileEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkVideoDecodeH264ProfileEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((StdVideoH264ProfileIdc*)&forUnmarshaling->stdProfileIdc,
+                   sizeof(StdVideoH264ProfileIdc));
+    vkStream->read((VkVideoDecodeH264PictureLayoutFlagsEXT*)&forUnmarshaling->pictureLayout,
+                   sizeof(VkVideoDecodeH264PictureLayoutFlagsEXT));
+}
+
+void marshal_VkVideoDecodeH264CapabilitiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH264CapabilitiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->maxLevel, sizeof(uint32_t));
+    marshal_VkOffset2D(vkStream, rootType, (VkOffset2D*)(&forMarshaling->fieldOffsetGranularity));
+    marshal_VkExtensionProperties(vkStream, rootType,
+                                  (VkExtensionProperties*)(&forMarshaling->stdExtensionVersion));
+}
+
+void unmarshal_VkVideoDecodeH264CapabilitiesEXT(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkVideoDecodeH264CapabilitiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxLevel, sizeof(uint32_t));
+    unmarshal_VkOffset2D(vkStream, rootType,
+                         (VkOffset2D*)(&forUnmarshaling->fieldOffsetGranularity));
+    unmarshal_VkExtensionProperties(
+        vkStream, rootType, (VkExtensionProperties*)(&forUnmarshaling->stdExtensionVersion));
+}
+
+void marshal_VkVideoDecodeH264SessionCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH264SessionCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkVideoDecodeH264CreateFlagsEXT*)&forMarshaling->flags,
+                    sizeof(VkVideoDecodeH264CreateFlagsEXT));
+    marshal_VkExtensionProperties(
+        vkStream, rootType, (const VkExtensionProperties*)(forMarshaling->pStdExtensionVersion));
+}
+
+void unmarshal_VkVideoDecodeH264SessionCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoDecodeH264SessionCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkVideoDecodeH264CreateFlagsEXT*)&forUnmarshaling->flags,
+                   sizeof(VkVideoDecodeH264CreateFlagsEXT));
+    unmarshal_VkExtensionProperties(
+        vkStream, rootType, (VkExtensionProperties*)(forUnmarshaling->pStdExtensionVersion));
+}
+
+void marshal_VkVideoDecodeH264SessionParametersAddInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH264SessionParametersAddInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->spsStdCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pSpsStd;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pSpsStd) {
+        vkStream->write(
+            (const StdVideoH264SequenceParameterSet*)forMarshaling->pSpsStd,
+            forMarshaling->spsStdCount * sizeof(const StdVideoH264SequenceParameterSet));
+    }
+    vkStream->write((uint32_t*)&forMarshaling->ppsStdCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pPpsStd;
+    vkStream->putBe64(cgen_var_1);
+    if (forMarshaling->pPpsStd) {
+        vkStream->write((const StdVideoH264PictureParameterSet*)forMarshaling->pPpsStd,
+                        forMarshaling->ppsStdCount * sizeof(const StdVideoH264PictureParameterSet));
+    }
+}
+
+void unmarshal_VkVideoDecodeH264SessionParametersAddInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoDecodeH264SessionParametersAddInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->spsStdCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const StdVideoH264SequenceParameterSet* check_pSpsStd;
+    check_pSpsStd = (const StdVideoH264SequenceParameterSet*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pSpsStd) {
+        if (!(check_pSpsStd)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pSpsStd inconsistent between guest and host\n");
+        }
+        vkStream->read(
+            (StdVideoH264SequenceParameterSet*)forUnmarshaling->pSpsStd,
+            forUnmarshaling->spsStdCount * sizeof(const StdVideoH264SequenceParameterSet));
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->ppsStdCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const StdVideoH264PictureParameterSet* check_pPpsStd;
+    check_pPpsStd = (const StdVideoH264PictureParameterSet*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pPpsStd) {
+        if (!(check_pPpsStd)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pPpsStd inconsistent between guest and host\n");
+        }
+        vkStream->read(
+            (StdVideoH264PictureParameterSet*)forUnmarshaling->pPpsStd,
+            forUnmarshaling->ppsStdCount * sizeof(const StdVideoH264PictureParameterSet));
+    }
+}
+
+void marshal_VkVideoDecodeH264SessionParametersCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH264SessionParametersCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->maxSpsStdCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxPpsStdCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pParametersAddInfo;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pParametersAddInfo) {
+        marshal_VkVideoDecodeH264SessionParametersAddInfoEXT(
+            vkStream, rootType,
+            (const VkVideoDecodeH264SessionParametersAddInfoEXT*)(forMarshaling
+                                                                      ->pParametersAddInfo));
+    }
+}
+
+void unmarshal_VkVideoDecodeH264SessionParametersCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoDecodeH264SessionParametersCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxSpsStdCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPpsStdCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const VkVideoDecodeH264SessionParametersAddInfoEXT* check_pParametersAddInfo;
+    check_pParametersAddInfo =
+        (const VkVideoDecodeH264SessionParametersAddInfoEXT*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pParametersAddInfo) {
+        if (!(check_pParametersAddInfo)) {
+            fprintf(
+                stderr,
+                "fatal: forUnmarshaling->pParametersAddInfo inconsistent between guest and host\n");
+        }
+        unmarshal_VkVideoDecodeH264SessionParametersAddInfoEXT(
+            vkStream, rootType,
+            (VkVideoDecodeH264SessionParametersAddInfoEXT*)(forUnmarshaling->pParametersAddInfo));
+    }
+}
+
+void marshal_VkVideoDecodeH264PictureInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkVideoDecodeH264PictureInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((const StdVideoDecodeH264PictureInfo*)forMarshaling->pStdPictureInfo,
+                    sizeof(const StdVideoDecodeH264PictureInfo));
+    vkStream->write((uint32_t*)&forMarshaling->slicesCount, sizeof(uint32_t));
+    vkStream->write((const uint32_t*)forMarshaling->pSlicesDataOffsets,
+                    forMarshaling->slicesCount * sizeof(const uint32_t));
+}
+
+void unmarshal_VkVideoDecodeH264PictureInfoEXT(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkVideoDecodeH264PictureInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((StdVideoDecodeH264PictureInfo*)forUnmarshaling->pStdPictureInfo,
+                   sizeof(const StdVideoDecodeH264PictureInfo));
+    vkStream->read((uint32_t*)&forUnmarshaling->slicesCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)forUnmarshaling->pSlicesDataOffsets,
+                   forUnmarshaling->slicesCount * sizeof(const uint32_t));
+}
+
+void marshal_VkVideoDecodeH264MvcEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkVideoDecodeH264MvcEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((const StdVideoDecodeH264Mvc*)forMarshaling->pStdMvc,
+                    sizeof(const StdVideoDecodeH264Mvc));
+}
+
+void unmarshal_VkVideoDecodeH264MvcEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkVideoDecodeH264MvcEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((StdVideoDecodeH264Mvc*)forUnmarshaling->pStdMvc,
+                   sizeof(const StdVideoDecodeH264Mvc));
+}
+
+void marshal_VkVideoDecodeH264DpbSlotInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkVideoDecodeH264DpbSlotInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((const StdVideoDecodeH264ReferenceInfo*)forMarshaling->pStdReferenceInfo,
+                    sizeof(const StdVideoDecodeH264ReferenceInfo));
+}
+
+void unmarshal_VkVideoDecodeH264DpbSlotInfoEXT(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkVideoDecodeH264DpbSlotInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((StdVideoDecodeH264ReferenceInfo*)forUnmarshaling->pStdReferenceInfo,
+                   sizeof(const StdVideoDecodeH264ReferenceInfo));
+}
+
+#endif
+#ifdef VK_AMD_texture_gather_bias_lod
+void marshal_VkTextureLODGatherFormatPropertiesAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkTextureLODGatherFormatPropertiesAMD* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->supportsTextureGatherLODBiasAMD, sizeof(VkBool32));
+}
+
+void unmarshal_VkTextureLODGatherFormatPropertiesAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkTextureLODGatherFormatPropertiesAMD* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->supportsTextureGatherLODBiasAMD, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_AMD_shader_info
+void marshal_VkShaderResourceUsageAMD(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkShaderResourceUsageAMD* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->numUsedVgprs, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->numUsedSgprs, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->ldsSizePerLocalWorkGroup, sizeof(uint32_t));
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->ldsUsageSizeInBytes;
+    vkStream->putBe64(cgen_var_0);
+    uint64_t cgen_var_1 = (uint64_t)forMarshaling->scratchMemUsageInBytes;
+    vkStream->putBe64(cgen_var_1);
+}
+
+void unmarshal_VkShaderResourceUsageAMD(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkShaderResourceUsageAMD* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->numUsedVgprs, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->numUsedSgprs, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->ldsSizePerLocalWorkGroup, sizeof(uint32_t));
+    forUnmarshaling->ldsUsageSizeInBytes = (size_t)vkStream->getBe64();
+    forUnmarshaling->scratchMemUsageInBytes = (size_t)vkStream->getBe64();
+}
+
+void marshal_VkShaderStatisticsInfoAMD(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkShaderStatisticsInfoAMD* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkShaderStageFlags*)&forMarshaling->shaderStageMask,
+                    sizeof(VkShaderStageFlags));
+    marshal_VkShaderResourceUsageAMD(vkStream, rootType,
+                                     (VkShaderResourceUsageAMD*)(&forMarshaling->resourceUsage));
+    vkStream->write((uint32_t*)&forMarshaling->numPhysicalVgprs, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->numPhysicalSgprs, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->numAvailableVgprs, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->numAvailableSgprs, sizeof(uint32_t));
+    vkStream->write((uint32_t*)forMarshaling->computeWorkGroupSize, 3 * sizeof(uint32_t));
+}
+
+void unmarshal_VkShaderStatisticsInfoAMD(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkShaderStatisticsInfoAMD* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkShaderStageFlags*)&forUnmarshaling->shaderStageMask,
+                   sizeof(VkShaderStageFlags));
+    unmarshal_VkShaderResourceUsageAMD(
+        vkStream, rootType, (VkShaderResourceUsageAMD*)(&forUnmarshaling->resourceUsage));
+    vkStream->read((uint32_t*)&forUnmarshaling->numPhysicalVgprs, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->numPhysicalSgprs, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->numAvailableVgprs, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->numAvailableSgprs, sizeof(uint32_t));
+    vkStream->read((uint32_t*)forUnmarshaling->computeWorkGroupSize, 3 * sizeof(uint32_t));
+}
+
+#endif
+#ifdef VK_AMD_shader_image_load_store_lod
+#endif
+#ifdef VK_GGP_stream_descriptor_surface
+void marshal_VkStreamDescriptorSurfaceCreateInfoGGP(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkStreamDescriptorSurfaceCreateInfoGGP* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkStreamDescriptorSurfaceCreateFlagsGGP*)&forMarshaling->flags,
+                    sizeof(VkStreamDescriptorSurfaceCreateFlagsGGP));
+    vkStream->write((GgpStreamDescriptor*)&forMarshaling->streamDescriptor,
+                    sizeof(GgpStreamDescriptor));
+}
+
+void unmarshal_VkStreamDescriptorSurfaceCreateInfoGGP(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkStreamDescriptorSurfaceCreateInfoGGP* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkStreamDescriptorSurfaceCreateFlagsGGP*)&forUnmarshaling->flags,
+                   sizeof(VkStreamDescriptorSurfaceCreateFlagsGGP));
+    vkStream->read((GgpStreamDescriptor*)&forUnmarshaling->streamDescriptor,
+                   sizeof(GgpStreamDescriptor));
+}
+
+#endif
+#ifdef VK_NV_corner_sampled_image
+void marshal_VkPhysicalDeviceCornerSampledImageFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceCornerSampledImageFeaturesNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->cornerSampledImage, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceCornerSampledImageFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceCornerSampledImageFeaturesNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->cornerSampledImage, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_IMG_format_pvrtc
+#endif
+#ifdef VK_NV_external_memory_capabilities
+void marshal_VkExternalImageFormatPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExternalImageFormatPropertiesNV* forMarshaling) {
+    (void)rootType;
+    marshal_VkImageFormatProperties(
+        vkStream, rootType, (VkImageFormatProperties*)(&forMarshaling->imageFormatProperties));
+    vkStream->write((VkExternalMemoryFeatureFlagsNV*)&forMarshaling->externalMemoryFeatures,
+                    sizeof(VkExternalMemoryFeatureFlagsNV));
+    vkStream->write(
+        (VkExternalMemoryHandleTypeFlagsNV*)&forMarshaling->exportFromImportedHandleTypes,
+        sizeof(VkExternalMemoryHandleTypeFlagsNV));
+    vkStream->write((VkExternalMemoryHandleTypeFlagsNV*)&forMarshaling->compatibleHandleTypes,
+                    sizeof(VkExternalMemoryHandleTypeFlagsNV));
+}
+
+void unmarshal_VkExternalImageFormatPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkExternalImageFormatPropertiesNV* forUnmarshaling) {
+    (void)rootType;
+    unmarshal_VkImageFormatProperties(
+        vkStream, rootType, (VkImageFormatProperties*)(&forUnmarshaling->imageFormatProperties));
+    vkStream->read((VkExternalMemoryFeatureFlagsNV*)&forUnmarshaling->externalMemoryFeatures,
+                   sizeof(VkExternalMemoryFeatureFlagsNV));
+    vkStream->read(
+        (VkExternalMemoryHandleTypeFlagsNV*)&forUnmarshaling->exportFromImportedHandleTypes,
+        sizeof(VkExternalMemoryHandleTypeFlagsNV));
+    vkStream->read((VkExternalMemoryHandleTypeFlagsNV*)&forUnmarshaling->compatibleHandleTypes,
+                   sizeof(VkExternalMemoryHandleTypeFlagsNV));
+}
+
+#endif
+#ifdef VK_NV_external_memory
+void marshal_VkExternalMemoryImageCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExternalMemoryImageCreateInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkExternalMemoryHandleTypeFlagsNV*)&forMarshaling->handleTypes,
+                    sizeof(VkExternalMemoryHandleTypeFlagsNV));
+}
+
+void unmarshal_VkExternalMemoryImageCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkExternalMemoryImageCreateInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkExternalMemoryHandleTypeFlagsNV*)&forUnmarshaling->handleTypes,
+                   sizeof(VkExternalMemoryHandleTypeFlagsNV));
+}
+
+void marshal_VkExportMemoryAllocateInfoNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkExportMemoryAllocateInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkExternalMemoryHandleTypeFlagsNV*)&forMarshaling->handleTypes,
+                    sizeof(VkExternalMemoryHandleTypeFlagsNV));
+}
+
+void unmarshal_VkExportMemoryAllocateInfoNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkExportMemoryAllocateInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkExternalMemoryHandleTypeFlagsNV*)&forUnmarshaling->handleTypes,
+                   sizeof(VkExternalMemoryHandleTypeFlagsNV));
+}
+
+#endif
+#ifdef VK_NV_external_memory_win32
+void marshal_VkImportMemoryWin32HandleInfoNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkImportMemoryWin32HandleInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkExternalMemoryHandleTypeFlagsNV*)&forMarshaling->handleType,
+                    sizeof(VkExternalMemoryHandleTypeFlagsNV));
+    vkStream->write((HANDLE*)&forMarshaling->handle, sizeof(HANDLE));
+}
+
+void unmarshal_VkImportMemoryWin32HandleInfoNV(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkImportMemoryWin32HandleInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkExternalMemoryHandleTypeFlagsNV*)&forUnmarshaling->handleType,
+                   sizeof(VkExternalMemoryHandleTypeFlagsNV));
+    vkStream->read((HANDLE*)&forUnmarshaling->handle, sizeof(HANDLE));
+}
+
+void marshal_VkExportMemoryWin32HandleInfoNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkExportMemoryWin32HandleInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pAttributes;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pAttributes) {
+        vkStream->write((const SECURITY_ATTRIBUTES*)forMarshaling->pAttributes,
+                        sizeof(const SECURITY_ATTRIBUTES));
+    }
+    vkStream->write((DWORD*)&forMarshaling->dwAccess, sizeof(DWORD));
+}
+
+void unmarshal_VkExportMemoryWin32HandleInfoNV(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkExportMemoryWin32HandleInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    // WARNING PTR CHECK
+    const SECURITY_ATTRIBUTES* check_pAttributes;
+    check_pAttributes = (const SECURITY_ATTRIBUTES*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pAttributes) {
+        if (!(check_pAttributes)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pAttributes inconsistent between guest and host\n");
+        }
+        vkStream->read((SECURITY_ATTRIBUTES*)forUnmarshaling->pAttributes,
+                       sizeof(const SECURITY_ATTRIBUTES));
+    }
+    vkStream->read((DWORD*)&forUnmarshaling->dwAccess, sizeof(DWORD));
+}
+
+#endif
+#ifdef VK_NV_win32_keyed_mutex
+void marshal_VkWin32KeyedMutexAcquireReleaseInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkWin32KeyedMutexAcquireReleaseInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->acquireCount, sizeof(uint32_t));
+    if (forMarshaling->acquireCount) {
+        uint64_t* cgen_var_0;
+        vkStream->alloc((void**)&cgen_var_0, forMarshaling->acquireCount * 8);
+        vkStream->handleMapping()->mapHandles_VkDeviceMemory_u64(
+            forMarshaling->pAcquireSyncs, cgen_var_0, forMarshaling->acquireCount);
+        vkStream->write((uint64_t*)cgen_var_0, forMarshaling->acquireCount * 8);
+    }
+    vkStream->write((const uint64_t*)forMarshaling->pAcquireKeys,
+                    forMarshaling->acquireCount * sizeof(const uint64_t));
+    vkStream->write((const uint32_t*)forMarshaling->pAcquireTimeoutMilliseconds,
+                    forMarshaling->acquireCount * sizeof(const uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->releaseCount, sizeof(uint32_t));
+    if (forMarshaling->releaseCount) {
+        uint64_t* cgen_var_1;
+        vkStream->alloc((void**)&cgen_var_1, forMarshaling->releaseCount * 8);
+        vkStream->handleMapping()->mapHandles_VkDeviceMemory_u64(
+            forMarshaling->pReleaseSyncs, cgen_var_1, forMarshaling->releaseCount);
+        vkStream->write((uint64_t*)cgen_var_1, forMarshaling->releaseCount * 8);
+    }
+    vkStream->write((const uint64_t*)forMarshaling->pReleaseKeys,
+                    forMarshaling->releaseCount * sizeof(const uint64_t));
+}
+
+void unmarshal_VkWin32KeyedMutexAcquireReleaseInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkWin32KeyedMutexAcquireReleaseInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->acquireCount, sizeof(uint32_t));
+    if (forUnmarshaling->acquireCount) {
+        uint64_t* cgen_var_0;
+        vkStream->alloc((void**)&cgen_var_0, forUnmarshaling->acquireCount * 8);
+        vkStream->read((uint64_t*)cgen_var_0, forUnmarshaling->acquireCount * 8);
+        vkStream->handleMapping()->mapHandles_u64_VkDeviceMemory(
+            cgen_var_0, (VkDeviceMemory*)forUnmarshaling->pAcquireSyncs,
+            forUnmarshaling->acquireCount);
+    }
+    vkStream->read((uint64_t*)forUnmarshaling->pAcquireKeys,
+                   forUnmarshaling->acquireCount * sizeof(const uint64_t));
+    vkStream->read((uint32_t*)forUnmarshaling->pAcquireTimeoutMilliseconds,
+                   forUnmarshaling->acquireCount * sizeof(const uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->releaseCount, sizeof(uint32_t));
+    if (forUnmarshaling->releaseCount) {
+        uint64_t* cgen_var_1;
+        vkStream->alloc((void**)&cgen_var_1, forUnmarshaling->releaseCount * 8);
+        vkStream->read((uint64_t*)cgen_var_1, forUnmarshaling->releaseCount * 8);
+        vkStream->handleMapping()->mapHandles_u64_VkDeviceMemory(
+            cgen_var_1, (VkDeviceMemory*)forUnmarshaling->pReleaseSyncs,
+            forUnmarshaling->releaseCount);
+    }
+    vkStream->read((uint64_t*)forUnmarshaling->pReleaseKeys,
+                   forUnmarshaling->releaseCount * sizeof(const uint64_t));
+}
+
+#endif
+#ifdef VK_EXT_validation_flags
+void marshal_VkValidationFlagsEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkValidationFlagsEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->disabledValidationCheckCount, sizeof(uint32_t));
+    vkStream->write(
+        (const VkValidationCheckEXT*)forMarshaling->pDisabledValidationChecks,
+        forMarshaling->disabledValidationCheckCount * sizeof(const VkValidationCheckEXT));
+}
+
+void unmarshal_VkValidationFlagsEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkValidationFlagsEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->disabledValidationCheckCount, sizeof(uint32_t));
+    vkStream->read(
+        (VkValidationCheckEXT*)forUnmarshaling->pDisabledValidationChecks,
+        forUnmarshaling->disabledValidationCheckCount * sizeof(const VkValidationCheckEXT));
+}
+
+#endif
+#ifdef VK_NN_vi_surface
+void marshal_VkViSurfaceCreateInfoNN(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkViSurfaceCreateInfoNN* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkViSurfaceCreateFlagsNN*)&forMarshaling->flags,
+                    sizeof(VkViSurfaceCreateFlagsNN));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->window;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->window) {
+        vkStream->write((void*)forMarshaling->window, sizeof(uint8_t));
+    }
+}
+
+void unmarshal_VkViSurfaceCreateInfoNN(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkViSurfaceCreateInfoNN* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkViSurfaceCreateFlagsNN*)&forUnmarshaling->flags,
+                   sizeof(VkViSurfaceCreateFlagsNN));
+    // WARNING PTR CHECK
+    void* check_window;
+    check_window = (void*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->window) {
+        if (!(check_window)) {
+            fprintf(stderr, "fatal: forUnmarshaling->window inconsistent between guest and host\n");
+        }
+        vkStream->read((void*)forUnmarshaling->window, sizeof(uint8_t));
+    }
+}
+
+#endif
+#ifdef VK_EXT_shader_subgroup_ballot
+#endif
+#ifdef VK_EXT_shader_subgroup_vote
+#endif
+#ifdef VK_EXT_texture_compression_astc_hdr
+void marshal_VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->textureCompressionASTC_HDR, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->textureCompressionASTC_HDR, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_EXT_astc_decode_mode
+void marshal_VkImageViewASTCDecodeModeEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkImageViewASTCDecodeModeEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkFormat*)&forMarshaling->decodeMode, sizeof(VkFormat));
+}
+
+void unmarshal_VkImageViewASTCDecodeModeEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkImageViewASTCDecodeModeEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkFormat*)&forUnmarshaling->decodeMode, sizeof(VkFormat));
+}
+
+void marshal_VkPhysicalDeviceASTCDecodeFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceASTCDecodeFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->decodeModeSharedExponent, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceASTCDecodeFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceASTCDecodeFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->decodeModeSharedExponent, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_EXT_conditional_rendering
+void marshal_VkConditionalRenderingBeginInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkConditionalRenderingBeginInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkBuffer_u64(&forMarshaling->buffer, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkDeviceSize*)&forMarshaling->offset, sizeof(VkDeviceSize));
+    vkStream->write((VkConditionalRenderingFlagsEXT*)&forMarshaling->flags,
+                    sizeof(VkConditionalRenderingFlagsEXT));
+}
+
+void unmarshal_VkConditionalRenderingBeginInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkConditionalRenderingBeginInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_0,
+                                                       (VkBuffer*)&forUnmarshaling->buffer, 1);
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->offset, sizeof(VkDeviceSize));
+    vkStream->read((VkConditionalRenderingFlagsEXT*)&forUnmarshaling->flags,
+                   sizeof(VkConditionalRenderingFlagsEXT));
+}
+
+void marshal_VkPhysicalDeviceConditionalRenderingFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceConditionalRenderingFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->conditionalRendering, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->inheritedConditionalRendering, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceConditionalRenderingFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceConditionalRenderingFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->conditionalRendering, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->inheritedConditionalRendering, sizeof(VkBool32));
+}
+
+void marshal_VkCommandBufferInheritanceConditionalRenderingInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCommandBufferInheritanceConditionalRenderingInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->conditionalRenderingEnable, sizeof(VkBool32));
+}
+
+void unmarshal_VkCommandBufferInheritanceConditionalRenderingInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkCommandBufferInheritanceConditionalRenderingInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->conditionalRenderingEnable, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+void marshal_VkViewportWScalingNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkViewportWScalingNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((float*)&forMarshaling->xcoeff, sizeof(float));
+    vkStream->write((float*)&forMarshaling->ycoeff, sizeof(float));
+}
+
+void unmarshal_VkViewportWScalingNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkViewportWScalingNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((float*)&forUnmarshaling->xcoeff, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->ycoeff, sizeof(float));
+}
+
+void marshal_VkPipelineViewportWScalingStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineViewportWScalingStateCreateInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->viewportWScalingEnable, sizeof(VkBool32));
+    vkStream->write((uint32_t*)&forMarshaling->viewportCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pViewportWScalings;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pViewportWScalings) {
+        if (forMarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forMarshaling->viewportCount; ++i) {
+                marshal_VkViewportWScalingNV(
+                    vkStream, rootType,
+                    (const VkViewportWScalingNV*)(forMarshaling->pViewportWScalings + i));
+            }
+        }
+    }
+}
+
+void unmarshal_VkPipelineViewportWScalingStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineViewportWScalingStateCreateInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->viewportWScalingEnable, sizeof(VkBool32));
+    vkStream->read((uint32_t*)&forUnmarshaling->viewportCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const VkViewportWScalingNV* check_pViewportWScalings;
+    check_pViewportWScalings = (const VkViewportWScalingNV*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pViewportWScalings) {
+        if (!(check_pViewportWScalings)) {
+            fprintf(
+                stderr,
+                "fatal: forUnmarshaling->pViewportWScalings inconsistent between guest and host\n");
+        }
+        if (forUnmarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->viewportCount; ++i) {
+                unmarshal_VkViewportWScalingNV(
+                    vkStream, rootType,
+                    (VkViewportWScalingNV*)(forUnmarshaling->pViewportWScalings + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_EXT_direct_mode_display
+#endif
+#ifdef VK_EXT_acquire_xlib_display
+#endif
+#ifdef VK_EXT_display_surface_counter
+void marshal_VkSurfaceCapabilities2EXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkSurfaceCapabilities2EXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->minImageCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxImageCount, sizeof(uint32_t));
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->currentExtent));
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->minImageExtent));
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->maxImageExtent));
+    vkStream->write((uint32_t*)&forMarshaling->maxImageArrayLayers, sizeof(uint32_t));
+    vkStream->write((VkSurfaceTransformFlagsKHR*)&forMarshaling->supportedTransforms,
+                    sizeof(VkSurfaceTransformFlagsKHR));
+    vkStream->write((VkSurfaceTransformFlagBitsKHR*)&forMarshaling->currentTransform,
+                    sizeof(VkSurfaceTransformFlagBitsKHR));
+    vkStream->write((VkCompositeAlphaFlagsKHR*)&forMarshaling->supportedCompositeAlpha,
+                    sizeof(VkCompositeAlphaFlagsKHR));
+    vkStream->write((VkImageUsageFlags*)&forMarshaling->supportedUsageFlags,
+                    sizeof(VkImageUsageFlags));
+    vkStream->write((VkSurfaceCounterFlagsEXT*)&forMarshaling->supportedSurfaceCounters,
+                    sizeof(VkSurfaceCounterFlagsEXT));
+}
+
+void unmarshal_VkSurfaceCapabilities2EXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkSurfaceCapabilities2EXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->minImageCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxImageCount, sizeof(uint32_t));
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->currentExtent));
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->minImageExtent));
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->maxImageExtent));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxImageArrayLayers, sizeof(uint32_t));
+    vkStream->read((VkSurfaceTransformFlagsKHR*)&forUnmarshaling->supportedTransforms,
+                   sizeof(VkSurfaceTransformFlagsKHR));
+    vkStream->read((VkSurfaceTransformFlagBitsKHR*)&forUnmarshaling->currentTransform,
+                   sizeof(VkSurfaceTransformFlagBitsKHR));
+    vkStream->read((VkCompositeAlphaFlagsKHR*)&forUnmarshaling->supportedCompositeAlpha,
+                   sizeof(VkCompositeAlphaFlagsKHR));
+    vkStream->read((VkImageUsageFlags*)&forUnmarshaling->supportedUsageFlags,
+                   sizeof(VkImageUsageFlags));
+    vkStream->read((VkSurfaceCounterFlagsEXT*)&forUnmarshaling->supportedSurfaceCounters,
+                   sizeof(VkSurfaceCounterFlagsEXT));
+}
+
+#endif
+#ifdef VK_EXT_display_control
+void marshal_VkDisplayPowerInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkDisplayPowerInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDisplayPowerStateEXT*)&forMarshaling->powerState,
+                    sizeof(VkDisplayPowerStateEXT));
+}
+
+void unmarshal_VkDisplayPowerInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkDisplayPowerInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDisplayPowerStateEXT*)&forUnmarshaling->powerState,
+                   sizeof(VkDisplayPowerStateEXT));
+}
+
+void marshal_VkDeviceEventInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkDeviceEventInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDeviceEventTypeEXT*)&forMarshaling->deviceEvent,
+                    sizeof(VkDeviceEventTypeEXT));
+}
+
+void unmarshal_VkDeviceEventInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkDeviceEventInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDeviceEventTypeEXT*)&forUnmarshaling->deviceEvent,
+                   sizeof(VkDeviceEventTypeEXT));
+}
+
+void marshal_VkDisplayEventInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkDisplayEventInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDisplayEventTypeEXT*)&forMarshaling->displayEvent,
+                    sizeof(VkDisplayEventTypeEXT));
+}
+
+void unmarshal_VkDisplayEventInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkDisplayEventInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDisplayEventTypeEXT*)&forUnmarshaling->displayEvent,
+                   sizeof(VkDisplayEventTypeEXT));
+}
+
+void marshal_VkSwapchainCounterCreateInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkSwapchainCounterCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkSurfaceCounterFlagsEXT*)&forMarshaling->surfaceCounters,
+                    sizeof(VkSurfaceCounterFlagsEXT));
+}
+
+void unmarshal_VkSwapchainCounterCreateInfoEXT(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkSwapchainCounterCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkSurfaceCounterFlagsEXT*)&forUnmarshaling->surfaceCounters,
+                   sizeof(VkSurfaceCounterFlagsEXT));
+}
+
+#endif
+#ifdef VK_GOOGLE_display_timing
+void marshal_VkRefreshCycleDurationGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkRefreshCycleDurationGOOGLE* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint64_t*)&forMarshaling->refreshDuration, sizeof(uint64_t));
+}
+
+void unmarshal_VkRefreshCycleDurationGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkRefreshCycleDurationGOOGLE* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint64_t*)&forUnmarshaling->refreshDuration, sizeof(uint64_t));
+}
+
+void marshal_VkPastPresentationTimingGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkPastPresentationTimingGOOGLE* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->presentID, sizeof(uint32_t));
+    vkStream->write((uint64_t*)&forMarshaling->desiredPresentTime, sizeof(uint64_t));
+    vkStream->write((uint64_t*)&forMarshaling->actualPresentTime, sizeof(uint64_t));
+    vkStream->write((uint64_t*)&forMarshaling->earliestPresentTime, sizeof(uint64_t));
+    vkStream->write((uint64_t*)&forMarshaling->presentMargin, sizeof(uint64_t));
+}
+
+void unmarshal_VkPastPresentationTimingGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkPastPresentationTimingGOOGLE* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->presentID, sizeof(uint32_t));
+    vkStream->read((uint64_t*)&forUnmarshaling->desiredPresentTime, sizeof(uint64_t));
+    vkStream->read((uint64_t*)&forUnmarshaling->actualPresentTime, sizeof(uint64_t));
+    vkStream->read((uint64_t*)&forUnmarshaling->earliestPresentTime, sizeof(uint64_t));
+    vkStream->read((uint64_t*)&forUnmarshaling->presentMargin, sizeof(uint64_t));
+}
+
+void marshal_VkPresentTimeGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkPresentTimeGOOGLE* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->presentID, sizeof(uint32_t));
+    vkStream->write((uint64_t*)&forMarshaling->desiredPresentTime, sizeof(uint64_t));
+}
+
+void unmarshal_VkPresentTimeGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkPresentTimeGOOGLE* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->presentID, sizeof(uint32_t));
+    vkStream->read((uint64_t*)&forUnmarshaling->desiredPresentTime, sizeof(uint64_t));
+}
+
+void marshal_VkPresentTimesInfoGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkPresentTimesInfoGOOGLE* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->swapchainCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pTimes;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pTimes) {
+        if (forMarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forMarshaling->swapchainCount; ++i) {
+                marshal_VkPresentTimeGOOGLE(
+                    vkStream, rootType, (const VkPresentTimeGOOGLE*)(forMarshaling->pTimes + i));
+            }
+        }
+    }
+}
+
+void unmarshal_VkPresentTimesInfoGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkPresentTimesInfoGOOGLE* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->swapchainCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const VkPresentTimeGOOGLE* check_pTimes;
+    check_pTimes = (const VkPresentTimeGOOGLE*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pTimes) {
+        if (!(check_pTimes)) {
+            fprintf(stderr, "fatal: forUnmarshaling->pTimes inconsistent between guest and host\n");
+        }
+        if (forUnmarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->swapchainCount; ++i) {
+                unmarshal_VkPresentTimeGOOGLE(vkStream, rootType,
+                                              (VkPresentTimeGOOGLE*)(forUnmarshaling->pTimes + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_NV_sample_mask_override_coverage
+#endif
+#ifdef VK_NV_geometry_shader_passthrough
+#endif
+#ifdef VK_NV_viewport_array2
+#endif
+#ifdef VK_NVX_multiview_per_view_attributes
+void marshal_VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->perViewPositionAllComponents, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->perViewPositionAllComponents, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_NV_viewport_swizzle
+void marshal_VkViewportSwizzleNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkViewportSwizzleNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkViewportCoordinateSwizzleNV*)&forMarshaling->x,
+                    sizeof(VkViewportCoordinateSwizzleNV));
+    vkStream->write((VkViewportCoordinateSwizzleNV*)&forMarshaling->y,
+                    sizeof(VkViewportCoordinateSwizzleNV));
+    vkStream->write((VkViewportCoordinateSwizzleNV*)&forMarshaling->z,
+                    sizeof(VkViewportCoordinateSwizzleNV));
+    vkStream->write((VkViewportCoordinateSwizzleNV*)&forMarshaling->w,
+                    sizeof(VkViewportCoordinateSwizzleNV));
+}
+
+void unmarshal_VkViewportSwizzleNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkViewportSwizzleNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkViewportCoordinateSwizzleNV*)&forUnmarshaling->x,
+                   sizeof(VkViewportCoordinateSwizzleNV));
+    vkStream->read((VkViewportCoordinateSwizzleNV*)&forUnmarshaling->y,
+                   sizeof(VkViewportCoordinateSwizzleNV));
+    vkStream->read((VkViewportCoordinateSwizzleNV*)&forUnmarshaling->z,
+                   sizeof(VkViewportCoordinateSwizzleNV));
+    vkStream->read((VkViewportCoordinateSwizzleNV*)&forUnmarshaling->w,
+                   sizeof(VkViewportCoordinateSwizzleNV));
+}
+
+void marshal_VkPipelineViewportSwizzleStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineViewportSwizzleStateCreateInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineViewportSwizzleStateCreateFlagsNV*)&forMarshaling->flags,
+                    sizeof(VkPipelineViewportSwizzleStateCreateFlagsNV));
+    vkStream->write((uint32_t*)&forMarshaling->viewportCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pViewportSwizzles;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pViewportSwizzles) {
+        if (forMarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forMarshaling->viewportCount; ++i) {
+                marshal_VkViewportSwizzleNV(
+                    vkStream, rootType,
+                    (const VkViewportSwizzleNV*)(forMarshaling->pViewportSwizzles + i));
+            }
+        }
+    }
+}
+
+void unmarshal_VkPipelineViewportSwizzleStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineViewportSwizzleStateCreateInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineViewportSwizzleStateCreateFlagsNV*)&forUnmarshaling->flags,
+                   sizeof(VkPipelineViewportSwizzleStateCreateFlagsNV));
+    vkStream->read((uint32_t*)&forUnmarshaling->viewportCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const VkViewportSwizzleNV* check_pViewportSwizzles;
+    check_pViewportSwizzles = (const VkViewportSwizzleNV*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pViewportSwizzles) {
+        if (!(check_pViewportSwizzles)) {
+            fprintf(
+                stderr,
+                "fatal: forUnmarshaling->pViewportSwizzles inconsistent between guest and host\n");
+        }
+        if (forUnmarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->viewportCount; ++i) {
+                unmarshal_VkViewportSwizzleNV(
+                    vkStream, rootType,
+                    (VkViewportSwizzleNV*)(forUnmarshaling->pViewportSwizzles + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_EXT_discard_rectangles
+void marshal_VkPhysicalDeviceDiscardRectanglePropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDiscardRectanglePropertiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->maxDiscardRectangles, sizeof(uint32_t));
+}
+
+void unmarshal_VkPhysicalDeviceDiscardRectanglePropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceDiscardRectanglePropertiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxDiscardRectangles, sizeof(uint32_t));
+}
+
+void marshal_VkPipelineDiscardRectangleStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineDiscardRectangleStateCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineDiscardRectangleStateCreateFlagsEXT*)&forMarshaling->flags,
+                    sizeof(VkPipelineDiscardRectangleStateCreateFlagsEXT));
+    vkStream->write((VkDiscardRectangleModeEXT*)&forMarshaling->discardRectangleMode,
+                    sizeof(VkDiscardRectangleModeEXT));
+    vkStream->write((uint32_t*)&forMarshaling->discardRectangleCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pDiscardRectangles;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pDiscardRectangles) {
+        if (forMarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forMarshaling->discardRectangleCount; ++i) {
+                marshal_VkRect2D(vkStream, rootType,
+                                 (const VkRect2D*)(forMarshaling->pDiscardRectangles + i));
+            }
+        }
+    }
+}
+
+void unmarshal_VkPipelineDiscardRectangleStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineDiscardRectangleStateCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineDiscardRectangleStateCreateFlagsEXT*)&forUnmarshaling->flags,
+                   sizeof(VkPipelineDiscardRectangleStateCreateFlagsEXT));
+    vkStream->read((VkDiscardRectangleModeEXT*)&forUnmarshaling->discardRectangleMode,
+                   sizeof(VkDiscardRectangleModeEXT));
+    vkStream->read((uint32_t*)&forUnmarshaling->discardRectangleCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const VkRect2D* check_pDiscardRectangles;
+    check_pDiscardRectangles = (const VkRect2D*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pDiscardRectangles) {
+        if (!(check_pDiscardRectangles)) {
+            fprintf(
+                stderr,
+                "fatal: forUnmarshaling->pDiscardRectangles inconsistent between guest and host\n");
+        }
+        if (forUnmarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->discardRectangleCount; ++i) {
+                unmarshal_VkRect2D(vkStream, rootType,
+                                   (VkRect2D*)(forUnmarshaling->pDiscardRectangles + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_EXT_conservative_rasterization
+void marshal_VkPhysicalDeviceConservativeRasterizationPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceConservativeRasterizationPropertiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((float*)&forMarshaling->primitiveOverestimationSize, sizeof(float));
+    vkStream->write((float*)&forMarshaling->maxExtraPrimitiveOverestimationSize, sizeof(float));
+    vkStream->write((float*)&forMarshaling->extraPrimitiveOverestimationSizeGranularity,
+                    sizeof(float));
+    vkStream->write((VkBool32*)&forMarshaling->primitiveUnderestimation, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->conservativePointAndLineRasterization,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->degenerateTrianglesRasterized, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->degenerateLinesRasterized, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->fullyCoveredFragmentShaderInputVariable,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->conservativeRasterizationPostDepthCoverage,
+                    sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceConservativeRasterizationPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceConservativeRasterizationPropertiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((float*)&forUnmarshaling->primitiveOverestimationSize, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->maxExtraPrimitiveOverestimationSize, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->extraPrimitiveOverestimationSizeGranularity,
+                   sizeof(float));
+    vkStream->read((VkBool32*)&forUnmarshaling->primitiveUnderestimation, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->conservativePointAndLineRasterization,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->degenerateTrianglesRasterized, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->degenerateLinesRasterized, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->fullyCoveredFragmentShaderInputVariable,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->conservativeRasterizationPostDepthCoverage,
+                   sizeof(VkBool32));
+}
+
+void marshal_VkPipelineRasterizationConservativeStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRasterizationConservativeStateCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineRasterizationConservativeStateCreateFlagsEXT*)&forMarshaling->flags,
+                    sizeof(VkPipelineRasterizationConservativeStateCreateFlagsEXT));
+    vkStream->write(
+        (VkConservativeRasterizationModeEXT*)&forMarshaling->conservativeRasterizationMode,
+        sizeof(VkConservativeRasterizationModeEXT));
+    vkStream->write((float*)&forMarshaling->extraPrimitiveOverestimationSize, sizeof(float));
+}
+
+void unmarshal_VkPipelineRasterizationConservativeStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineRasterizationConservativeStateCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineRasterizationConservativeStateCreateFlagsEXT*)&forUnmarshaling->flags,
+                   sizeof(VkPipelineRasterizationConservativeStateCreateFlagsEXT));
+    vkStream->read(
+        (VkConservativeRasterizationModeEXT*)&forUnmarshaling->conservativeRasterizationMode,
+        sizeof(VkConservativeRasterizationModeEXT));
+    vkStream->read((float*)&forUnmarshaling->extraPrimitiveOverestimationSize, sizeof(float));
+}
+
+#endif
+#ifdef VK_EXT_depth_clip_enable
+void marshal_VkPhysicalDeviceDepthClipEnableFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDepthClipEnableFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->depthClipEnable, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceDepthClipEnableFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceDepthClipEnableFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->depthClipEnable, sizeof(VkBool32));
+}
+
+void marshal_VkPipelineRasterizationDepthClipStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRasterizationDepthClipStateCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineRasterizationDepthClipStateCreateFlagsEXT*)&forMarshaling->flags,
+                    sizeof(VkPipelineRasterizationDepthClipStateCreateFlagsEXT));
+    vkStream->write((VkBool32*)&forMarshaling->depthClipEnable, sizeof(VkBool32));
+}
+
+void unmarshal_VkPipelineRasterizationDepthClipStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineRasterizationDepthClipStateCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineRasterizationDepthClipStateCreateFlagsEXT*)&forUnmarshaling->flags,
+                   sizeof(VkPipelineRasterizationDepthClipStateCreateFlagsEXT));
+    vkStream->read((VkBool32*)&forUnmarshaling->depthClipEnable, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_EXT_swapchain_colorspace
+#endif
+#ifdef VK_EXT_hdr_metadata
+void marshal_VkXYColorEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                          const VkXYColorEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((float*)&forMarshaling->x, sizeof(float));
+    vkStream->write((float*)&forMarshaling->y, sizeof(float));
+}
+
+void unmarshal_VkXYColorEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                            VkXYColorEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((float*)&forUnmarshaling->x, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->y, sizeof(float));
+}
+
+void marshal_VkHdrMetadataEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                              const VkHdrMetadataEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkXYColorEXT(vkStream, rootType, (VkXYColorEXT*)(&forMarshaling->displayPrimaryRed));
+    marshal_VkXYColorEXT(vkStream, rootType, (VkXYColorEXT*)(&forMarshaling->displayPrimaryGreen));
+    marshal_VkXYColorEXT(vkStream, rootType, (VkXYColorEXT*)(&forMarshaling->displayPrimaryBlue));
+    marshal_VkXYColorEXT(vkStream, rootType, (VkXYColorEXT*)(&forMarshaling->whitePoint));
+    vkStream->write((float*)&forMarshaling->maxLuminance, sizeof(float));
+    vkStream->write((float*)&forMarshaling->minLuminance, sizeof(float));
+    vkStream->write((float*)&forMarshaling->maxContentLightLevel, sizeof(float));
+    vkStream->write((float*)&forMarshaling->maxFrameAverageLightLevel, sizeof(float));
+}
+
+void unmarshal_VkHdrMetadataEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                VkHdrMetadataEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkXYColorEXT(vkStream, rootType,
+                           (VkXYColorEXT*)(&forUnmarshaling->displayPrimaryRed));
+    unmarshal_VkXYColorEXT(vkStream, rootType,
+                           (VkXYColorEXT*)(&forUnmarshaling->displayPrimaryGreen));
+    unmarshal_VkXYColorEXT(vkStream, rootType,
+                           (VkXYColorEXT*)(&forUnmarshaling->displayPrimaryBlue));
+    unmarshal_VkXYColorEXT(vkStream, rootType, (VkXYColorEXT*)(&forUnmarshaling->whitePoint));
+    vkStream->read((float*)&forUnmarshaling->maxLuminance, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->minLuminance, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->maxContentLightLevel, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->maxFrameAverageLightLevel, sizeof(float));
+}
+
+#endif
+#ifdef VK_MVK_ios_surface
+void marshal_VkIOSSurfaceCreateInfoMVK(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkIOSSurfaceCreateInfoMVK* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkIOSSurfaceCreateFlagsMVK*)&forMarshaling->flags,
+                    sizeof(VkIOSSurfaceCreateFlagsMVK));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pView;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pView) {
+        vkStream->write((const void*)forMarshaling->pView, sizeof(const uint8_t));
+    }
+}
+
+void unmarshal_VkIOSSurfaceCreateInfoMVK(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkIOSSurfaceCreateInfoMVK* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkIOSSurfaceCreateFlagsMVK*)&forUnmarshaling->flags,
+                   sizeof(VkIOSSurfaceCreateFlagsMVK));
+    // WARNING PTR CHECK
+    const void* check_pView;
+    check_pView = (const void*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pView) {
+        if (!(check_pView)) {
+            fprintf(stderr, "fatal: forUnmarshaling->pView inconsistent between guest and host\n");
+        }
+        vkStream->read((void*)forUnmarshaling->pView, sizeof(const uint8_t));
+    }
+}
+
+#endif
+#ifdef VK_MVK_macos_surface
+void marshal_VkMacOSSurfaceCreateInfoMVK(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkMacOSSurfaceCreateInfoMVK* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkMacOSSurfaceCreateFlagsMVK*)&forMarshaling->flags,
+                    sizeof(VkMacOSSurfaceCreateFlagsMVK));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pView;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pView) {
+        vkStream->write((const void*)forMarshaling->pView, sizeof(const uint8_t));
+    }
+}
+
+void unmarshal_VkMacOSSurfaceCreateInfoMVK(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkMacOSSurfaceCreateInfoMVK* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkMacOSSurfaceCreateFlagsMVK*)&forUnmarshaling->flags,
+                   sizeof(VkMacOSSurfaceCreateFlagsMVK));
+    // WARNING PTR CHECK
+    const void* check_pView;
+    check_pView = (const void*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pView) {
+        if (!(check_pView)) {
+            fprintf(stderr, "fatal: forUnmarshaling->pView inconsistent between guest and host\n");
+        }
+        vkStream->read((void*)forUnmarshaling->pView, sizeof(const uint8_t));
+    }
+}
+
+#endif
+#ifdef VK_MVK_moltenvk
+#endif
+#ifdef VK_EXT_external_memory_dma_buf
+#endif
+#ifdef VK_EXT_queue_family_foreign
+#endif
+#ifdef VK_EXT_debug_utils
+void marshal_VkDebugUtilsLabelEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkDebugUtilsLabelEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->putString(forMarshaling->pLabelName);
+    vkStream->write((float*)forMarshaling->color, 4 * sizeof(float));
+}
+
+void unmarshal_VkDebugUtilsLabelEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkDebugUtilsLabelEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->loadStringInPlace((char**)&forUnmarshaling->pLabelName);
+    vkStream->read((float*)forUnmarshaling->color, 4 * sizeof(float));
+}
+
+void marshal_VkDebugUtilsObjectNameInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkDebugUtilsObjectNameInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkObjectType*)&forMarshaling->objectType, sizeof(VkObjectType));
+    vkStream->write((uint64_t*)&forMarshaling->objectHandle, sizeof(uint64_t));
+    if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) {
+        // WARNING PTR CHECK
+        uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pObjectName;
+        vkStream->putBe64(cgen_var_0);
+        if (forMarshaling->pObjectName) {
+            vkStream->putString(forMarshaling->pObjectName);
+        }
+    } else {
+        vkStream->putString(forMarshaling->pObjectName);
+    }
+}
+
+void unmarshal_VkDebugUtilsObjectNameInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkDebugUtilsObjectNameInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkObjectType*)&forUnmarshaling->objectType, sizeof(VkObjectType));
+    vkStream->read((uint64_t*)&forUnmarshaling->objectHandle, sizeof(uint64_t));
+    if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) {
+        // WARNING PTR CHECK
+        const char* check_pObjectName;
+        check_pObjectName = (const char*)(uintptr_t)vkStream->getBe64();
+        if (forUnmarshaling->pObjectName) {
+            if (!(check_pObjectName)) {
+                fprintf(
+                    stderr,
+                    "fatal: forUnmarshaling->pObjectName inconsistent between guest and host\n");
+            }
+            vkStream->loadStringInPlace((char**)&forUnmarshaling->pObjectName);
+        }
+    } else {
+        vkStream->loadStringInPlace((char**)&forUnmarshaling->pObjectName);
+    }
+}
+
+void marshal_VkDebugUtilsMessengerCallbackDataEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDebugUtilsMessengerCallbackDataEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDebugUtilsMessengerCallbackDataFlagsEXT*)&forMarshaling->flags,
+                    sizeof(VkDebugUtilsMessengerCallbackDataFlagsEXT));
+    if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) {
+        // WARNING PTR CHECK
+        uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pMessageIdName;
+        vkStream->putBe64(cgen_var_0);
+        if (forMarshaling->pMessageIdName) {
+            vkStream->putString(forMarshaling->pMessageIdName);
+        }
+    } else {
+        vkStream->putString(forMarshaling->pMessageIdName);
+    }
+    vkStream->write((int32_t*)&forMarshaling->messageIdNumber, sizeof(int32_t));
+    vkStream->putString(forMarshaling->pMessage);
+    vkStream->write((uint32_t*)&forMarshaling->queueLabelCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pQueueLabels;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pQueueLabels) {
+        if (forMarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forMarshaling->queueLabelCount; ++i) {
+                marshal_VkDebugUtilsLabelEXT(
+                    vkStream, rootType, (VkDebugUtilsLabelEXT*)(forMarshaling->pQueueLabels + i));
+            }
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->cmdBufLabelCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pCmdBufLabels;
+    vkStream->putBe64(cgen_var_1);
+    if (forMarshaling->pCmdBufLabels) {
+        if (forMarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forMarshaling->cmdBufLabelCount; ++i) {
+                marshal_VkDebugUtilsLabelEXT(
+                    vkStream, rootType, (VkDebugUtilsLabelEXT*)(forMarshaling->pCmdBufLabels + i));
+            }
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->objectCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)forMarshaling->pObjects;
+    vkStream->putBe64(cgen_var_2);
+    if (forMarshaling->pObjects) {
+        if (forMarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forMarshaling->objectCount; ++i) {
+                marshal_VkDebugUtilsObjectNameInfoEXT(
+                    vkStream, rootType,
+                    (VkDebugUtilsObjectNameInfoEXT*)(forMarshaling->pObjects + i));
+            }
+        }
+    }
+}
+
+void unmarshal_VkDebugUtilsMessengerCallbackDataEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDebugUtilsMessengerCallbackDataEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDebugUtilsMessengerCallbackDataFlagsEXT*)&forUnmarshaling->flags,
+                   sizeof(VkDebugUtilsMessengerCallbackDataFlagsEXT));
+    if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) {
+        // WARNING PTR CHECK
+        const char* check_pMessageIdName;
+        check_pMessageIdName = (const char*)(uintptr_t)vkStream->getBe64();
+        if (forUnmarshaling->pMessageIdName) {
+            if (!(check_pMessageIdName)) {
+                fprintf(
+                    stderr,
+                    "fatal: forUnmarshaling->pMessageIdName inconsistent between guest and host\n");
+            }
+            vkStream->loadStringInPlace((char**)&forUnmarshaling->pMessageIdName);
+        }
+    } else {
+        vkStream->loadStringInPlace((char**)&forUnmarshaling->pMessageIdName);
+    }
+    vkStream->read((int32_t*)&forUnmarshaling->messageIdNumber, sizeof(int32_t));
+    vkStream->loadStringInPlace((char**)&forUnmarshaling->pMessage);
+    vkStream->read((uint32_t*)&forUnmarshaling->queueLabelCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    VkDebugUtilsLabelEXT* check_pQueueLabels;
+    check_pQueueLabels = (VkDebugUtilsLabelEXT*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pQueueLabels) {
+        if (!(check_pQueueLabels)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pQueueLabels inconsistent between guest and host\n");
+        }
+        if (forUnmarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->queueLabelCount; ++i) {
+                unmarshal_VkDebugUtilsLabelEXT(
+                    vkStream, rootType, (VkDebugUtilsLabelEXT*)(forUnmarshaling->pQueueLabels + i));
+            }
+        }
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->cmdBufLabelCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    VkDebugUtilsLabelEXT* check_pCmdBufLabels;
+    check_pCmdBufLabels = (VkDebugUtilsLabelEXT*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pCmdBufLabels) {
+        if (!(check_pCmdBufLabels)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pCmdBufLabels inconsistent between guest and host\n");
+        }
+        if (forUnmarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->cmdBufLabelCount; ++i) {
+                unmarshal_VkDebugUtilsLabelEXT(
+                    vkStream, rootType,
+                    (VkDebugUtilsLabelEXT*)(forUnmarshaling->pCmdBufLabels + i));
+            }
+        }
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->objectCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    VkDebugUtilsObjectNameInfoEXT* check_pObjects;
+    check_pObjects = (VkDebugUtilsObjectNameInfoEXT*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pObjects) {
+        if (!(check_pObjects)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pObjects inconsistent between guest and host\n");
+        }
+        if (forUnmarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->objectCount; ++i) {
+                unmarshal_VkDebugUtilsObjectNameInfoEXT(
+                    vkStream, rootType,
+                    (VkDebugUtilsObjectNameInfoEXT*)(forUnmarshaling->pObjects + i));
+            }
+        }
+    }
+}
+
+void marshal_VkDebugUtilsMessengerCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDebugUtilsMessengerCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDebugUtilsMessengerCreateFlagsEXT*)&forMarshaling->flags,
+                    sizeof(VkDebugUtilsMessengerCreateFlagsEXT));
+    vkStream->write((VkDebugUtilsMessageSeverityFlagsEXT*)&forMarshaling->messageSeverity,
+                    sizeof(VkDebugUtilsMessageSeverityFlagsEXT));
+    vkStream->write((VkDebugUtilsMessageTypeFlagsEXT*)&forMarshaling->messageType,
+                    sizeof(VkDebugUtilsMessageTypeFlagsEXT));
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->pfnUserCallback;
+    vkStream->putBe64(cgen_var_0);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pUserData;
+    vkStream->putBe64(cgen_var_1);
+    if (forMarshaling->pUserData) {
+        vkStream->write((void*)forMarshaling->pUserData, sizeof(uint8_t));
+    }
+}
+
+void unmarshal_VkDebugUtilsMessengerCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDebugUtilsMessengerCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDebugUtilsMessengerCreateFlagsEXT*)&forUnmarshaling->flags,
+                   sizeof(VkDebugUtilsMessengerCreateFlagsEXT));
+    vkStream->read((VkDebugUtilsMessageSeverityFlagsEXT*)&forUnmarshaling->messageSeverity,
+                   sizeof(VkDebugUtilsMessageSeverityFlagsEXT));
+    vkStream->read((VkDebugUtilsMessageTypeFlagsEXT*)&forUnmarshaling->messageType,
+                   sizeof(VkDebugUtilsMessageTypeFlagsEXT));
+    forUnmarshaling->pfnUserCallback = (PFN_vkDebugUtilsMessengerCallbackEXT)vkStream->getBe64();
+    // WARNING PTR CHECK
+    void* check_pUserData;
+    check_pUserData = (void*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pUserData) {
+        if (!(check_pUserData)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pUserData inconsistent between guest and host\n");
+        }
+        vkStream->read((void*)forUnmarshaling->pUserData, sizeof(uint8_t));
+    }
+}
+
+void marshal_VkDebugUtilsObjectTagInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkDebugUtilsObjectTagInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkObjectType*)&forMarshaling->objectType, sizeof(VkObjectType));
+    vkStream->write((uint64_t*)&forMarshaling->objectHandle, sizeof(uint64_t));
+    vkStream->write((uint64_t*)&forMarshaling->tagName, sizeof(uint64_t));
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->tagSize;
+    vkStream->putBe64(cgen_var_0);
+    vkStream->write((const void*)forMarshaling->pTag,
+                    forMarshaling->tagSize * sizeof(const uint8_t));
+}
+
+void unmarshal_VkDebugUtilsObjectTagInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkDebugUtilsObjectTagInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkObjectType*)&forUnmarshaling->objectType, sizeof(VkObjectType));
+    vkStream->read((uint64_t*)&forUnmarshaling->objectHandle, sizeof(uint64_t));
+    vkStream->read((uint64_t*)&forUnmarshaling->tagName, sizeof(uint64_t));
+    forUnmarshaling->tagSize = (size_t)vkStream->getBe64();
+    vkStream->read((void*)forUnmarshaling->pTag, forUnmarshaling->tagSize * sizeof(const uint8_t));
+}
+
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+void marshal_VkAndroidHardwareBufferUsageANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAndroidHardwareBufferUsageANDROID* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint64_t*)&forMarshaling->androidHardwareBufferUsage, sizeof(uint64_t));
+}
+
+void unmarshal_VkAndroidHardwareBufferUsageANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAndroidHardwareBufferUsageANDROID* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint64_t*)&forUnmarshaling->androidHardwareBufferUsage, sizeof(uint64_t));
+}
+
+void marshal_VkAndroidHardwareBufferPropertiesANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAndroidHardwareBufferPropertiesANDROID* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDeviceSize*)&forMarshaling->allocationSize, sizeof(VkDeviceSize));
+    vkStream->write((uint32_t*)&forMarshaling->memoryTypeBits, sizeof(uint32_t));
+}
+
+void unmarshal_VkAndroidHardwareBufferPropertiesANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAndroidHardwareBufferPropertiesANDROID* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->allocationSize, sizeof(VkDeviceSize));
+    vkStream->read((uint32_t*)&forUnmarshaling->memoryTypeBits, sizeof(uint32_t));
+}
+
+void marshal_VkAndroidHardwareBufferFormatPropertiesANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAndroidHardwareBufferFormatPropertiesANDROID* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+    vkStream->write((uint64_t*)&forMarshaling->externalFormat, sizeof(uint64_t));
+    vkStream->write((VkFormatFeatureFlags*)&forMarshaling->formatFeatures,
+                    sizeof(VkFormatFeatureFlags));
+    marshal_VkComponentMapping(
+        vkStream, rootType,
+        (VkComponentMapping*)(&forMarshaling->samplerYcbcrConversionComponents));
+    vkStream->write((VkSamplerYcbcrModelConversion*)&forMarshaling->suggestedYcbcrModel,
+                    sizeof(VkSamplerYcbcrModelConversion));
+    vkStream->write((VkSamplerYcbcrRange*)&forMarshaling->suggestedYcbcrRange,
+                    sizeof(VkSamplerYcbcrRange));
+    vkStream->write((VkChromaLocation*)&forMarshaling->suggestedXChromaOffset,
+                    sizeof(VkChromaLocation));
+    vkStream->write((VkChromaLocation*)&forMarshaling->suggestedYChromaOffset,
+                    sizeof(VkChromaLocation));
+}
+
+void unmarshal_VkAndroidHardwareBufferFormatPropertiesANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAndroidHardwareBufferFormatPropertiesANDROID* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkFormat*)&forUnmarshaling->format, sizeof(VkFormat));
+    vkStream->read((uint64_t*)&forUnmarshaling->externalFormat, sizeof(uint64_t));
+    vkStream->read((VkFormatFeatureFlags*)&forUnmarshaling->formatFeatures,
+                   sizeof(VkFormatFeatureFlags));
+    unmarshal_VkComponentMapping(
+        vkStream, rootType,
+        (VkComponentMapping*)(&forUnmarshaling->samplerYcbcrConversionComponents));
+    vkStream->read((VkSamplerYcbcrModelConversion*)&forUnmarshaling->suggestedYcbcrModel,
+                   sizeof(VkSamplerYcbcrModelConversion));
+    vkStream->read((VkSamplerYcbcrRange*)&forUnmarshaling->suggestedYcbcrRange,
+                   sizeof(VkSamplerYcbcrRange));
+    vkStream->read((VkChromaLocation*)&forUnmarshaling->suggestedXChromaOffset,
+                   sizeof(VkChromaLocation));
+    vkStream->read((VkChromaLocation*)&forUnmarshaling->suggestedYChromaOffset,
+                   sizeof(VkChromaLocation));
+}
+
+void marshal_VkImportAndroidHardwareBufferInfoANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportAndroidHardwareBufferInfoANDROID* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((AHardwareBuffer*)forMarshaling->buffer, sizeof(AHardwareBuffer));
+}
+
+void unmarshal_VkImportAndroidHardwareBufferInfoANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkImportAndroidHardwareBufferInfoANDROID* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((AHardwareBuffer*)forUnmarshaling->buffer, sizeof(AHardwareBuffer));
+}
+
+void marshal_VkMemoryGetAndroidHardwareBufferInfoANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryGetAndroidHardwareBufferInfoANDROID* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&forMarshaling->memory, &cgen_var_0,
+                                                             1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+}
+
+void unmarshal_VkMemoryGetAndroidHardwareBufferInfoANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkMemoryGetAndroidHardwareBufferInfoANDROID* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkDeviceMemory(
+        &cgen_var_0, (VkDeviceMemory*)&forUnmarshaling->memory, 1);
+}
+
+void marshal_VkExternalFormatANDROID(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkExternalFormatANDROID* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint64_t*)&forMarshaling->externalFormat, sizeof(uint64_t));
+}
+
+void unmarshal_VkExternalFormatANDROID(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkExternalFormatANDROID* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint64_t*)&forUnmarshaling->externalFormat, sizeof(uint64_t));
+}
+
+void marshal_VkAndroidHardwareBufferFormatProperties2ANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAndroidHardwareBufferFormatProperties2ANDROID* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+    vkStream->write((uint64_t*)&forMarshaling->externalFormat, sizeof(uint64_t));
+    vkStream->write((VkFormatFeatureFlags2KHR*)&forMarshaling->formatFeatures,
+                    sizeof(VkFormatFeatureFlags2KHR));
+    marshal_VkComponentMapping(
+        vkStream, rootType,
+        (VkComponentMapping*)(&forMarshaling->samplerYcbcrConversionComponents));
+    vkStream->write((VkSamplerYcbcrModelConversion*)&forMarshaling->suggestedYcbcrModel,
+                    sizeof(VkSamplerYcbcrModelConversion));
+    vkStream->write((VkSamplerYcbcrRange*)&forMarshaling->suggestedYcbcrRange,
+                    sizeof(VkSamplerYcbcrRange));
+    vkStream->write((VkChromaLocation*)&forMarshaling->suggestedXChromaOffset,
+                    sizeof(VkChromaLocation));
+    vkStream->write((VkChromaLocation*)&forMarshaling->suggestedYChromaOffset,
+                    sizeof(VkChromaLocation));
+}
+
+void unmarshal_VkAndroidHardwareBufferFormatProperties2ANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAndroidHardwareBufferFormatProperties2ANDROID* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkFormat*)&forUnmarshaling->format, sizeof(VkFormat));
+    vkStream->read((uint64_t*)&forUnmarshaling->externalFormat, sizeof(uint64_t));
+    vkStream->read((VkFormatFeatureFlags2KHR*)&forUnmarshaling->formatFeatures,
+                   sizeof(VkFormatFeatureFlags2KHR));
+    unmarshal_VkComponentMapping(
+        vkStream, rootType,
+        (VkComponentMapping*)(&forUnmarshaling->samplerYcbcrConversionComponents));
+    vkStream->read((VkSamplerYcbcrModelConversion*)&forUnmarshaling->suggestedYcbcrModel,
+                   sizeof(VkSamplerYcbcrModelConversion));
+    vkStream->read((VkSamplerYcbcrRange*)&forUnmarshaling->suggestedYcbcrRange,
+                   sizeof(VkSamplerYcbcrRange));
+    vkStream->read((VkChromaLocation*)&forUnmarshaling->suggestedXChromaOffset,
+                   sizeof(VkChromaLocation));
+    vkStream->read((VkChromaLocation*)&forUnmarshaling->suggestedYChromaOffset,
+                   sizeof(VkChromaLocation));
+}
+
+#endif
+#ifdef VK_EXT_sampler_filter_minmax
+#endif
+#ifdef VK_AMD_gpu_shader_int16
+#endif
+#ifdef VK_AMD_mixed_attachment_samples
+#endif
+#ifdef VK_AMD_shader_fragment_mask
+#endif
+#ifdef VK_EXT_inline_uniform_block
+void marshal_VkPhysicalDeviceInlineUniformBlockFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceInlineUniformBlockFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->inlineUniformBlock, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->descriptorBindingInlineUniformBlockUpdateAfterBind,
+                    sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceInlineUniformBlockFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceInlineUniformBlockFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->inlineUniformBlock, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->descriptorBindingInlineUniformBlockUpdateAfterBind,
+                   sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceInlineUniformBlockPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceInlineUniformBlockPropertiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->maxInlineUniformBlockSize, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxPerStageDescriptorInlineUniformBlocks,
+                    sizeof(uint32_t));
+    vkStream->write(
+        (uint32_t*)&forMarshaling->maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks,
+        sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetInlineUniformBlocks,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindInlineUniformBlocks,
+                    sizeof(uint32_t));
+}
+
+void unmarshal_VkPhysicalDeviceInlineUniformBlockPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceInlineUniformBlockPropertiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxInlineUniformBlockSize, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPerStageDescriptorInlineUniformBlocks,
+                   sizeof(uint32_t));
+    vkStream->read(
+        (uint32_t*)&forUnmarshaling->maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks,
+        sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetInlineUniformBlocks,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetUpdateAfterBindInlineUniformBlocks,
+                   sizeof(uint32_t));
+}
+
+void marshal_VkWriteDescriptorSetInlineUniformBlockEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkWriteDescriptorSetInlineUniformBlockEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->dataSize, sizeof(uint32_t));
+    vkStream->write((const void*)forMarshaling->pData,
+                    forMarshaling->dataSize * sizeof(const uint8_t));
+}
+
+void unmarshal_VkWriteDescriptorSetInlineUniformBlockEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkWriteDescriptorSetInlineUniformBlockEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->dataSize, sizeof(uint32_t));
+    vkStream->read((void*)forUnmarshaling->pData,
+                   forUnmarshaling->dataSize * sizeof(const uint8_t));
+}
+
+void marshal_VkDescriptorPoolInlineUniformBlockCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDescriptorPoolInlineUniformBlockCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->maxInlineUniformBlockBindings, sizeof(uint32_t));
+}
+
+void unmarshal_VkDescriptorPoolInlineUniformBlockCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDescriptorPoolInlineUniformBlockCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxInlineUniformBlockBindings, sizeof(uint32_t));
+}
+
+#endif
+#ifdef VK_EXT_shader_stencil_export
+#endif
+#ifdef VK_EXT_sample_locations
+void marshal_VkSampleLocationEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkSampleLocationEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((float*)&forMarshaling->x, sizeof(float));
+    vkStream->write((float*)&forMarshaling->y, sizeof(float));
+}
+
+void unmarshal_VkSampleLocationEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkSampleLocationEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((float*)&forUnmarshaling->x, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->y, sizeof(float));
+}
+
+void marshal_VkSampleLocationsInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkSampleLocationsInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkSampleCountFlagBits*)&forMarshaling->sampleLocationsPerPixel,
+                    sizeof(VkSampleCountFlagBits));
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->sampleLocationGridSize));
+    vkStream->write((uint32_t*)&forMarshaling->sampleLocationsCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->sampleLocationsCount; ++i) {
+            marshal_VkSampleLocationEXT(
+                vkStream, rootType,
+                (const VkSampleLocationEXT*)(forMarshaling->pSampleLocations + i));
+        }
+    }
+}
+
+void unmarshal_VkSampleLocationsInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkSampleLocationsInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkSampleCountFlagBits*)&forUnmarshaling->sampleLocationsPerPixel,
+                   sizeof(VkSampleCountFlagBits));
+    unmarshal_VkExtent2D(vkStream, rootType,
+                         (VkExtent2D*)(&forUnmarshaling->sampleLocationGridSize));
+    vkStream->read((uint32_t*)&forUnmarshaling->sampleLocationsCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->sampleLocationsCount; ++i) {
+            unmarshal_VkSampleLocationEXT(
+                vkStream, rootType, (VkSampleLocationEXT*)(forUnmarshaling->pSampleLocations + i));
+        }
+    }
+}
+
+void marshal_VkAttachmentSampleLocationsEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkAttachmentSampleLocationsEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->attachmentIndex, sizeof(uint32_t));
+    marshal_VkSampleLocationsInfoEXT(
+        vkStream, rootType, (VkSampleLocationsInfoEXT*)(&forMarshaling->sampleLocationsInfo));
+}
+
+void unmarshal_VkAttachmentSampleLocationsEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkAttachmentSampleLocationsEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->attachmentIndex, sizeof(uint32_t));
+    unmarshal_VkSampleLocationsInfoEXT(
+        vkStream, rootType, (VkSampleLocationsInfoEXT*)(&forUnmarshaling->sampleLocationsInfo));
+}
+
+void marshal_VkSubpassSampleLocationsEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkSubpassSampleLocationsEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->subpassIndex, sizeof(uint32_t));
+    marshal_VkSampleLocationsInfoEXT(
+        vkStream, rootType, (VkSampleLocationsInfoEXT*)(&forMarshaling->sampleLocationsInfo));
+}
+
+void unmarshal_VkSubpassSampleLocationsEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkSubpassSampleLocationsEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->subpassIndex, sizeof(uint32_t));
+    unmarshal_VkSampleLocationsInfoEXT(
+        vkStream, rootType, (VkSampleLocationsInfoEXT*)(&forUnmarshaling->sampleLocationsInfo));
+}
+
+void marshal_VkRenderPassSampleLocationsBeginInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRenderPassSampleLocationsBeginInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->attachmentInitialSampleLocationsCount,
+                    sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->attachmentInitialSampleLocationsCount;
+             ++i) {
+            marshal_VkAttachmentSampleLocationsEXT(
+                vkStream, rootType,
+                (const VkAttachmentSampleLocationsEXT*)(forMarshaling
+                                                            ->pAttachmentInitialSampleLocations +
+                                                        i));
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->postSubpassSampleLocationsCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->postSubpassSampleLocationsCount; ++i) {
+            marshal_VkSubpassSampleLocationsEXT(
+                vkStream, rootType,
+                (const VkSubpassSampleLocationsEXT*)(forMarshaling->pPostSubpassSampleLocations +
+                                                     i));
+        }
+    }
+}
+
+void unmarshal_VkRenderPassSampleLocationsBeginInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkRenderPassSampleLocationsBeginInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->attachmentInitialSampleLocationsCount,
+                   sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->attachmentInitialSampleLocationsCount;
+             ++i) {
+            unmarshal_VkAttachmentSampleLocationsEXT(
+                vkStream, rootType,
+                (VkAttachmentSampleLocationsEXT*)(forUnmarshaling
+                                                      ->pAttachmentInitialSampleLocations +
+                                                  i));
+        }
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->postSubpassSampleLocationsCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->postSubpassSampleLocationsCount; ++i) {
+            unmarshal_VkSubpassSampleLocationsEXT(
+                vkStream, rootType,
+                (VkSubpassSampleLocationsEXT*)(forUnmarshaling->pPostSubpassSampleLocations + i));
+        }
+    }
+}
+
+void marshal_VkPipelineSampleLocationsStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineSampleLocationsStateCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->sampleLocationsEnable, sizeof(VkBool32));
+    marshal_VkSampleLocationsInfoEXT(
+        vkStream, rootType, (VkSampleLocationsInfoEXT*)(&forMarshaling->sampleLocationsInfo));
+}
+
+void unmarshal_VkPipelineSampleLocationsStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineSampleLocationsStateCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->sampleLocationsEnable, sizeof(VkBool32));
+    unmarshal_VkSampleLocationsInfoEXT(
+        vkStream, rootType, (VkSampleLocationsInfoEXT*)(&forUnmarshaling->sampleLocationsInfo));
+}
+
+void marshal_VkPhysicalDeviceSampleLocationsPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSampleLocationsPropertiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkSampleCountFlags*)&forMarshaling->sampleLocationSampleCounts,
+                    sizeof(VkSampleCountFlags));
+    marshal_VkExtent2D(vkStream, rootType,
+                       (VkExtent2D*)(&forMarshaling->maxSampleLocationGridSize));
+    vkStream->write((float*)forMarshaling->sampleLocationCoordinateRange, 2 * sizeof(float));
+    vkStream->write((uint32_t*)&forMarshaling->sampleLocationSubPixelBits, sizeof(uint32_t));
+    vkStream->write((VkBool32*)&forMarshaling->variableSampleLocations, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceSampleLocationsPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceSampleLocationsPropertiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkSampleCountFlags*)&forUnmarshaling->sampleLocationSampleCounts,
+                   sizeof(VkSampleCountFlags));
+    unmarshal_VkExtent2D(vkStream, rootType,
+                         (VkExtent2D*)(&forUnmarshaling->maxSampleLocationGridSize));
+    vkStream->read((float*)forUnmarshaling->sampleLocationCoordinateRange, 2 * sizeof(float));
+    vkStream->read((uint32_t*)&forUnmarshaling->sampleLocationSubPixelBits, sizeof(uint32_t));
+    vkStream->read((VkBool32*)&forUnmarshaling->variableSampleLocations, sizeof(VkBool32));
+}
+
+void marshal_VkMultisamplePropertiesEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkMultisamplePropertiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkExtent2D(vkStream, rootType,
+                       (VkExtent2D*)(&forMarshaling->maxSampleLocationGridSize));
+}
+
+void unmarshal_VkMultisamplePropertiesEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkMultisamplePropertiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkExtent2D(vkStream, rootType,
+                         (VkExtent2D*)(&forUnmarshaling->maxSampleLocationGridSize));
+}
+
+#endif
+#ifdef VK_EXT_blend_operation_advanced
+void marshal_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->advancedBlendCoherentOperations, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->advancedBlendCoherentOperations, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->advancedBlendMaxColorAttachments, sizeof(uint32_t));
+    vkStream->write((VkBool32*)&forMarshaling->advancedBlendIndependentBlend, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->advancedBlendNonPremultipliedSrcColor,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->advancedBlendNonPremultipliedDstColor,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->advancedBlendCorrelatedOverlap, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->advancedBlendAllOperations, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->advancedBlendMaxColorAttachments, sizeof(uint32_t));
+    vkStream->read((VkBool32*)&forUnmarshaling->advancedBlendIndependentBlend, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->advancedBlendNonPremultipliedSrcColor,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->advancedBlendNonPremultipliedDstColor,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->advancedBlendCorrelatedOverlap, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->advancedBlendAllOperations, sizeof(VkBool32));
+}
+
+void marshal_VkPipelineColorBlendAdvancedStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineColorBlendAdvancedStateCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->srcPremultiplied, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->dstPremultiplied, sizeof(VkBool32));
+    vkStream->write((VkBlendOverlapEXT*)&forMarshaling->blendOverlap, sizeof(VkBlendOverlapEXT));
+}
+
+void unmarshal_VkPipelineColorBlendAdvancedStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineColorBlendAdvancedStateCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->srcPremultiplied, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->dstPremultiplied, sizeof(VkBool32));
+    vkStream->read((VkBlendOverlapEXT*)&forUnmarshaling->blendOverlap, sizeof(VkBlendOverlapEXT));
+}
+
+#endif
+#ifdef VK_NV_fragment_coverage_to_color
+void marshal_VkPipelineCoverageToColorStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineCoverageToColorStateCreateInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineCoverageToColorStateCreateFlagsNV*)&forMarshaling->flags,
+                    sizeof(VkPipelineCoverageToColorStateCreateFlagsNV));
+    vkStream->write((VkBool32*)&forMarshaling->coverageToColorEnable, sizeof(VkBool32));
+    vkStream->write((uint32_t*)&forMarshaling->coverageToColorLocation, sizeof(uint32_t));
+}
+
+void unmarshal_VkPipelineCoverageToColorStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineCoverageToColorStateCreateInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineCoverageToColorStateCreateFlagsNV*)&forUnmarshaling->flags,
+                   sizeof(VkPipelineCoverageToColorStateCreateFlagsNV));
+    vkStream->read((VkBool32*)&forUnmarshaling->coverageToColorEnable, sizeof(VkBool32));
+    vkStream->read((uint32_t*)&forUnmarshaling->coverageToColorLocation, sizeof(uint32_t));
+}
+
+#endif
+#ifdef VK_NV_framebuffer_mixed_samples
+void marshal_VkPipelineCoverageModulationStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineCoverageModulationStateCreateInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineCoverageModulationStateCreateFlagsNV*)&forMarshaling->flags,
+                    sizeof(VkPipelineCoverageModulationStateCreateFlagsNV));
+    vkStream->write((VkCoverageModulationModeNV*)&forMarshaling->coverageModulationMode,
+                    sizeof(VkCoverageModulationModeNV));
+    vkStream->write((VkBool32*)&forMarshaling->coverageModulationTableEnable, sizeof(VkBool32));
+    vkStream->write((uint32_t*)&forMarshaling->coverageModulationTableCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pCoverageModulationTable;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pCoverageModulationTable) {
+        vkStream->write((const float*)forMarshaling->pCoverageModulationTable,
+                        forMarshaling->coverageModulationTableCount * sizeof(const float));
+    }
+}
+
+void unmarshal_VkPipelineCoverageModulationStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineCoverageModulationStateCreateInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineCoverageModulationStateCreateFlagsNV*)&forUnmarshaling->flags,
+                   sizeof(VkPipelineCoverageModulationStateCreateFlagsNV));
+    vkStream->read((VkCoverageModulationModeNV*)&forUnmarshaling->coverageModulationMode,
+                   sizeof(VkCoverageModulationModeNV));
+    vkStream->read((VkBool32*)&forUnmarshaling->coverageModulationTableEnable, sizeof(VkBool32));
+    vkStream->read((uint32_t*)&forUnmarshaling->coverageModulationTableCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const float* check_pCoverageModulationTable;
+    check_pCoverageModulationTable = (const float*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pCoverageModulationTable) {
+        if (!(check_pCoverageModulationTable)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pCoverageModulationTable inconsistent between guest "
+                    "and host\n");
+        }
+        vkStream->read((float*)forUnmarshaling->pCoverageModulationTable,
+                       forUnmarshaling->coverageModulationTableCount * sizeof(const float));
+    }
+}
+
+#endif
+#ifdef VK_NV_fill_rectangle
+#endif
+#ifdef VK_NV_shader_sm_builtins
+void marshal_VkPhysicalDeviceShaderSMBuiltinsPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSMBuiltinsPropertiesNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->shaderSMCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->shaderWarpsPerSM, sizeof(uint32_t));
+}
+
+void unmarshal_VkPhysicalDeviceShaderSMBuiltinsPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderSMBuiltinsPropertiesNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->shaderSMCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->shaderWarpsPerSM, sizeof(uint32_t));
+}
+
+void marshal_VkPhysicalDeviceShaderSMBuiltinsFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSMBuiltinsFeaturesNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->shaderSMBuiltins, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceShaderSMBuiltinsFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderSMBuiltinsFeaturesNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderSMBuiltins, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_EXT_post_depth_coverage
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+void marshal_VkDrmFormatModifierPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDrmFormatModifierPropertiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint64_t*)&forMarshaling->drmFormatModifier, sizeof(uint64_t));
+    vkStream->write((uint32_t*)&forMarshaling->drmFormatModifierPlaneCount, sizeof(uint32_t));
+    vkStream->write((VkFormatFeatureFlags*)&forMarshaling->drmFormatModifierTilingFeatures,
+                    sizeof(VkFormatFeatureFlags));
+}
+
+void unmarshal_VkDrmFormatModifierPropertiesEXT(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkDrmFormatModifierPropertiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint64_t*)&forUnmarshaling->drmFormatModifier, sizeof(uint64_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->drmFormatModifierPlaneCount, sizeof(uint32_t));
+    vkStream->read((VkFormatFeatureFlags*)&forUnmarshaling->drmFormatModifierTilingFeatures,
+                   sizeof(VkFormatFeatureFlags));
+}
+
+void marshal_VkDrmFormatModifierPropertiesListEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDrmFormatModifierPropertiesListEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->drmFormatModifierCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pDrmFormatModifierProperties;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pDrmFormatModifierProperties) {
+        if (forMarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forMarshaling->drmFormatModifierCount; ++i) {
+                marshal_VkDrmFormatModifierPropertiesEXT(
+                    vkStream, rootType,
+                    (VkDrmFormatModifierPropertiesEXT*)(forMarshaling
+                                                            ->pDrmFormatModifierProperties +
+                                                        i));
+            }
+        }
+    }
+}
+
+void unmarshal_VkDrmFormatModifierPropertiesListEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDrmFormatModifierPropertiesListEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->drmFormatModifierCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    VkDrmFormatModifierPropertiesEXT* check_pDrmFormatModifierProperties;
+    check_pDrmFormatModifierProperties =
+        (VkDrmFormatModifierPropertiesEXT*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pDrmFormatModifierProperties) {
+        if (!(check_pDrmFormatModifierProperties)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pDrmFormatModifierProperties inconsistent between "
+                    "guest and host\n");
+        }
+        if (forUnmarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->drmFormatModifierCount; ++i) {
+                unmarshal_VkDrmFormatModifierPropertiesEXT(
+                    vkStream, rootType,
+                    (VkDrmFormatModifierPropertiesEXT*)(forUnmarshaling
+                                                            ->pDrmFormatModifierProperties +
+                                                        i));
+            }
+        }
+    }
+}
+
+void marshal_VkPhysicalDeviceImageDrmFormatModifierInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceImageDrmFormatModifierInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint64_t*)&forMarshaling->drmFormatModifier, sizeof(uint64_t));
+    vkStream->write((VkSharingMode*)&forMarshaling->sharingMode, sizeof(VkSharingMode));
+    vkStream->write((uint32_t*)&forMarshaling->queueFamilyIndexCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pQueueFamilyIndices;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pQueueFamilyIndices) {
+        vkStream->write((const uint32_t*)forMarshaling->pQueueFamilyIndices,
+                        forMarshaling->queueFamilyIndexCount * sizeof(const uint32_t));
+    }
+}
+
+void unmarshal_VkPhysicalDeviceImageDrmFormatModifierInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceImageDrmFormatModifierInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint64_t*)&forUnmarshaling->drmFormatModifier, sizeof(uint64_t));
+    vkStream->read((VkSharingMode*)&forUnmarshaling->sharingMode, sizeof(VkSharingMode));
+    vkStream->read((uint32_t*)&forUnmarshaling->queueFamilyIndexCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const uint32_t* check_pQueueFamilyIndices;
+    check_pQueueFamilyIndices = (const uint32_t*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pQueueFamilyIndices) {
+        if (!(check_pQueueFamilyIndices)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pQueueFamilyIndices inconsistent between guest and "
+                    "host\n");
+        }
+        vkStream->read((uint32_t*)forUnmarshaling->pQueueFamilyIndices,
+                       forUnmarshaling->queueFamilyIndexCount * sizeof(const uint32_t));
+    }
+}
+
+void marshal_VkImageDrmFormatModifierListCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageDrmFormatModifierListCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->drmFormatModifierCount, sizeof(uint32_t));
+    vkStream->write((const uint64_t*)forMarshaling->pDrmFormatModifiers,
+                    forMarshaling->drmFormatModifierCount * sizeof(const uint64_t));
+}
+
+void unmarshal_VkImageDrmFormatModifierListCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkImageDrmFormatModifierListCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->drmFormatModifierCount, sizeof(uint32_t));
+    vkStream->read((uint64_t*)forUnmarshaling->pDrmFormatModifiers,
+                   forUnmarshaling->drmFormatModifierCount * sizeof(const uint64_t));
+}
+
+void marshal_VkImageDrmFormatModifierExplicitCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageDrmFormatModifierExplicitCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint64_t*)&forMarshaling->drmFormatModifier, sizeof(uint64_t));
+    vkStream->write((uint32_t*)&forMarshaling->drmFormatModifierPlaneCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->drmFormatModifierPlaneCount; ++i) {
+            marshal_VkSubresourceLayout(
+                vkStream, rootType, (const VkSubresourceLayout*)(forMarshaling->pPlaneLayouts + i));
+        }
+    }
+}
+
+void unmarshal_VkImageDrmFormatModifierExplicitCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkImageDrmFormatModifierExplicitCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint64_t*)&forUnmarshaling->drmFormatModifier, sizeof(uint64_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->drmFormatModifierPlaneCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->drmFormatModifierPlaneCount; ++i) {
+            unmarshal_VkSubresourceLayout(
+                vkStream, rootType, (VkSubresourceLayout*)(forUnmarshaling->pPlaneLayouts + i));
+        }
+    }
+}
+
+void marshal_VkImageDrmFormatModifierPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageDrmFormatModifierPropertiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint64_t*)&forMarshaling->drmFormatModifier, sizeof(uint64_t));
+}
+
+void unmarshal_VkImageDrmFormatModifierPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkImageDrmFormatModifierPropertiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint64_t*)&forUnmarshaling->drmFormatModifier, sizeof(uint64_t));
+}
+
+void marshal_VkDrmFormatModifierProperties2EXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDrmFormatModifierProperties2EXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint64_t*)&forMarshaling->drmFormatModifier, sizeof(uint64_t));
+    vkStream->write((uint32_t*)&forMarshaling->drmFormatModifierPlaneCount, sizeof(uint32_t));
+    vkStream->write((VkFormatFeatureFlags2KHR*)&forMarshaling->drmFormatModifierTilingFeatures,
+                    sizeof(VkFormatFeatureFlags2KHR));
+}
+
+void unmarshal_VkDrmFormatModifierProperties2EXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDrmFormatModifierProperties2EXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint64_t*)&forUnmarshaling->drmFormatModifier, sizeof(uint64_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->drmFormatModifierPlaneCount, sizeof(uint32_t));
+    vkStream->read((VkFormatFeatureFlags2KHR*)&forUnmarshaling->drmFormatModifierTilingFeatures,
+                   sizeof(VkFormatFeatureFlags2KHR));
+}
+
+void marshal_VkDrmFormatModifierPropertiesList2EXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDrmFormatModifierPropertiesList2EXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->drmFormatModifierCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pDrmFormatModifierProperties;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pDrmFormatModifierProperties) {
+        if (forMarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forMarshaling->drmFormatModifierCount; ++i) {
+                marshal_VkDrmFormatModifierProperties2EXT(
+                    vkStream, rootType,
+                    (VkDrmFormatModifierProperties2EXT*)(forMarshaling
+                                                             ->pDrmFormatModifierProperties +
+                                                         i));
+            }
+        }
+    }
+}
+
+void unmarshal_VkDrmFormatModifierPropertiesList2EXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDrmFormatModifierPropertiesList2EXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->drmFormatModifierCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    VkDrmFormatModifierProperties2EXT* check_pDrmFormatModifierProperties;
+    check_pDrmFormatModifierProperties =
+        (VkDrmFormatModifierProperties2EXT*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pDrmFormatModifierProperties) {
+        if (!(check_pDrmFormatModifierProperties)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pDrmFormatModifierProperties inconsistent between "
+                    "guest and host\n");
+        }
+        if (forUnmarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->drmFormatModifierCount; ++i) {
+                unmarshal_VkDrmFormatModifierProperties2EXT(
+                    vkStream, rootType,
+                    (VkDrmFormatModifierProperties2EXT*)(forUnmarshaling
+                                                             ->pDrmFormatModifierProperties +
+                                                         i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_EXT_validation_cache
+void marshal_VkValidationCacheCreateInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkValidationCacheCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkValidationCacheCreateFlagsEXT*)&forMarshaling->flags,
+                    sizeof(VkValidationCacheCreateFlagsEXT));
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->initialDataSize;
+    vkStream->putBe64(cgen_var_0);
+    vkStream->write((const void*)forMarshaling->pInitialData,
+                    forMarshaling->initialDataSize * sizeof(const uint8_t));
+}
+
+void unmarshal_VkValidationCacheCreateInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkValidationCacheCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkValidationCacheCreateFlagsEXT*)&forUnmarshaling->flags,
+                   sizeof(VkValidationCacheCreateFlagsEXT));
+    forUnmarshaling->initialDataSize = (size_t)vkStream->getBe64();
+    vkStream->read((void*)forUnmarshaling->pInitialData,
+                   forUnmarshaling->initialDataSize * sizeof(const uint8_t));
+}
+
+void marshal_VkShaderModuleValidationCacheCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkShaderModuleValidationCacheCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&forMarshaling->validationCache,
+                                                                   &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+}
+
+void unmarshal_VkShaderModuleValidationCacheCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkShaderModuleValidationCacheCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkValidationCacheEXT(
+        &cgen_var_0, (VkValidationCacheEXT*)&forUnmarshaling->validationCache, 1);
+}
+
+#endif
+#ifdef VK_EXT_descriptor_indexing
+#endif
+#ifdef VK_EXT_shader_viewport_index_layer
+#endif
+#ifdef VK_NV_shading_rate_image
+void marshal_VkShadingRatePaletteNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkShadingRatePaletteNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->shadingRatePaletteEntryCount, sizeof(uint32_t));
+    vkStream->write(
+        (const VkShadingRatePaletteEntryNV*)forMarshaling->pShadingRatePaletteEntries,
+        forMarshaling->shadingRatePaletteEntryCount * sizeof(const VkShadingRatePaletteEntryNV));
+}
+
+void unmarshal_VkShadingRatePaletteNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      VkShadingRatePaletteNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->shadingRatePaletteEntryCount, sizeof(uint32_t));
+    vkStream->read(
+        (VkShadingRatePaletteEntryNV*)forUnmarshaling->pShadingRatePaletteEntries,
+        forUnmarshaling->shadingRatePaletteEntryCount * sizeof(const VkShadingRatePaletteEntryNV));
+}
+
+void marshal_VkPipelineViewportShadingRateImageStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineViewportShadingRateImageStateCreateInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->shadingRateImageEnable, sizeof(VkBool32));
+    vkStream->write((uint32_t*)&forMarshaling->viewportCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pShadingRatePalettes;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pShadingRatePalettes) {
+        if (forMarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forMarshaling->viewportCount; ++i) {
+                marshal_VkShadingRatePaletteNV(
+                    vkStream, rootType,
+                    (const VkShadingRatePaletteNV*)(forMarshaling->pShadingRatePalettes + i));
+            }
+        }
+    }
+}
+
+void unmarshal_VkPipelineViewportShadingRateImageStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineViewportShadingRateImageStateCreateInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->shadingRateImageEnable, sizeof(VkBool32));
+    vkStream->read((uint32_t*)&forUnmarshaling->viewportCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const VkShadingRatePaletteNV* check_pShadingRatePalettes;
+    check_pShadingRatePalettes = (const VkShadingRatePaletteNV*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pShadingRatePalettes) {
+        if (!(check_pShadingRatePalettes)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pShadingRatePalettes inconsistent between guest and "
+                    "host\n");
+        }
+        if (forUnmarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->viewportCount; ++i) {
+                unmarshal_VkShadingRatePaletteNV(
+                    vkStream, rootType,
+                    (VkShadingRatePaletteNV*)(forUnmarshaling->pShadingRatePalettes + i));
+            }
+        }
+    }
+}
+
+void marshal_VkPhysicalDeviceShadingRateImageFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShadingRateImageFeaturesNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->shadingRateImage, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shadingRateCoarseSampleOrder, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceShadingRateImageFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShadingRateImageFeaturesNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->shadingRateImage, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shadingRateCoarseSampleOrder, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceShadingRateImagePropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShadingRateImagePropertiesNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->shadingRateTexelSize));
+    vkStream->write((uint32_t*)&forMarshaling->shadingRatePaletteSize, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->shadingRateMaxCoarseSamples, sizeof(uint32_t));
+}
+
+void unmarshal_VkPhysicalDeviceShadingRateImagePropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShadingRateImagePropertiesNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forUnmarshaling->shadingRateTexelSize));
+    vkStream->read((uint32_t*)&forUnmarshaling->shadingRatePaletteSize, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->shadingRateMaxCoarseSamples, sizeof(uint32_t));
+}
+
+void marshal_VkCoarseSampleLocationNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkCoarseSampleLocationNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->pixelX, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->pixelY, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->sample, sizeof(uint32_t));
+}
+
+void unmarshal_VkCoarseSampleLocationNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkCoarseSampleLocationNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->pixelX, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->pixelY, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->sample, sizeof(uint32_t));
+}
+
+void marshal_VkCoarseSampleOrderCustomNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkCoarseSampleOrderCustomNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkShadingRatePaletteEntryNV*)&forMarshaling->shadingRate,
+                    sizeof(VkShadingRatePaletteEntryNV));
+    vkStream->write((uint32_t*)&forMarshaling->sampleCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->sampleLocationCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->sampleLocationCount; ++i) {
+            marshal_VkCoarseSampleLocationNV(
+                vkStream, rootType,
+                (const VkCoarseSampleLocationNV*)(forMarshaling->pSampleLocations + i));
+        }
+    }
+}
+
+void unmarshal_VkCoarseSampleOrderCustomNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkCoarseSampleOrderCustomNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkShadingRatePaletteEntryNV*)&forUnmarshaling->shadingRate,
+                   sizeof(VkShadingRatePaletteEntryNV));
+    vkStream->read((uint32_t*)&forUnmarshaling->sampleCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->sampleLocationCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->sampleLocationCount; ++i) {
+            unmarshal_VkCoarseSampleLocationNV(
+                vkStream, rootType,
+                (VkCoarseSampleLocationNV*)(forUnmarshaling->pSampleLocations + i));
+        }
+    }
+}
+
+void marshal_VkPipelineViewportCoarseSampleOrderStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineViewportCoarseSampleOrderStateCreateInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkCoarseSampleOrderTypeNV*)&forMarshaling->sampleOrderType,
+                    sizeof(VkCoarseSampleOrderTypeNV));
+    vkStream->write((uint32_t*)&forMarshaling->customSampleOrderCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->customSampleOrderCount; ++i) {
+            marshal_VkCoarseSampleOrderCustomNV(
+                vkStream, rootType,
+                (const VkCoarseSampleOrderCustomNV*)(forMarshaling->pCustomSampleOrders + i));
+        }
+    }
+}
+
+void unmarshal_VkPipelineViewportCoarseSampleOrderStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineViewportCoarseSampleOrderStateCreateInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkCoarseSampleOrderTypeNV*)&forUnmarshaling->sampleOrderType,
+                   sizeof(VkCoarseSampleOrderTypeNV));
+    vkStream->read((uint32_t*)&forUnmarshaling->customSampleOrderCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->customSampleOrderCount; ++i) {
+            unmarshal_VkCoarseSampleOrderCustomNV(
+                vkStream, rootType,
+                (VkCoarseSampleOrderCustomNV*)(forUnmarshaling->pCustomSampleOrders + i));
+        }
+    }
+}
+
+#endif
+#ifdef VK_NV_ray_tracing
+void marshal_VkRayTracingShaderGroupCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRayTracingShaderGroupCreateInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkRayTracingShaderGroupTypeKHR*)&forMarshaling->type,
+                    sizeof(VkRayTracingShaderGroupTypeKHR));
+    vkStream->write((uint32_t*)&forMarshaling->generalShader, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->closestHitShader, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->anyHitShader, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->intersectionShader, sizeof(uint32_t));
+}
+
+void unmarshal_VkRayTracingShaderGroupCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkRayTracingShaderGroupCreateInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkRayTracingShaderGroupTypeKHR*)&forUnmarshaling->type,
+                   sizeof(VkRayTracingShaderGroupTypeKHR));
+    vkStream->read((uint32_t*)&forUnmarshaling->generalShader, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->closestHitShader, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->anyHitShader, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->intersectionShader, sizeof(uint32_t));
+}
+
+void marshal_VkRayTracingPipelineCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRayTracingPipelineCreateInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineCreateFlags*)&forMarshaling->flags, sizeof(VkPipelineCreateFlags));
+    vkStream->write((uint32_t*)&forMarshaling->stageCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->stageCount; ++i) {
+            marshal_VkPipelineShaderStageCreateInfo(
+                vkStream, rootType,
+                (const VkPipelineShaderStageCreateInfo*)(forMarshaling->pStages + i));
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->groupCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->groupCount; ++i) {
+            marshal_VkRayTracingShaderGroupCreateInfoNV(
+                vkStream, rootType,
+                (const VkRayTracingShaderGroupCreateInfoNV*)(forMarshaling->pGroups + i));
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->maxRecursionDepth, sizeof(uint32_t));
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&forMarshaling->layout, &cgen_var_0,
+                                                               1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    uint64_t cgen_var_1;
+    vkStream->handleMapping()->mapHandles_VkPipeline_u64(&forMarshaling->basePipelineHandle,
+                                                         &cgen_var_1, 1);
+    vkStream->write((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->write((int32_t*)&forMarshaling->basePipelineIndex, sizeof(int32_t));
+}
+
+void unmarshal_VkRayTracingPipelineCreateInfoNV(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkRayTracingPipelineCreateInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineCreateFlags*)&forUnmarshaling->flags, sizeof(VkPipelineCreateFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->stageCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->stageCount; ++i) {
+            unmarshal_VkPipelineShaderStageCreateInfo(
+                vkStream, rootType,
+                (VkPipelineShaderStageCreateInfo*)(forUnmarshaling->pStages + i));
+        }
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->groupCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->groupCount; ++i) {
+            unmarshal_VkRayTracingShaderGroupCreateInfoNV(
+                vkStream, rootType,
+                (VkRayTracingShaderGroupCreateInfoNV*)(forUnmarshaling->pGroups + i));
+        }
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->maxRecursionDepth, sizeof(uint32_t));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkPipelineLayout(
+        &cgen_var_0, (VkPipelineLayout*)&forUnmarshaling->layout, 1);
+    uint64_t cgen_var_1;
+    vkStream->read((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkPipeline(
+        &cgen_var_1, (VkPipeline*)&forUnmarshaling->basePipelineHandle, 1);
+    vkStream->read((int32_t*)&forUnmarshaling->basePipelineIndex, sizeof(int32_t));
+}
+
+void marshal_VkGeometryTrianglesNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkGeometryTrianglesNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkBuffer_u64(&forMarshaling->vertexData, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkDeviceSize*)&forMarshaling->vertexOffset, sizeof(VkDeviceSize));
+    vkStream->write((uint32_t*)&forMarshaling->vertexCount, sizeof(uint32_t));
+    vkStream->write((VkDeviceSize*)&forMarshaling->vertexStride, sizeof(VkDeviceSize));
+    vkStream->write((VkFormat*)&forMarshaling->vertexFormat, sizeof(VkFormat));
+    uint64_t cgen_var_1;
+    vkStream->handleMapping()->mapHandles_VkBuffer_u64(&forMarshaling->indexData, &cgen_var_1, 1);
+    vkStream->write((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->write((VkDeviceSize*)&forMarshaling->indexOffset, sizeof(VkDeviceSize));
+    vkStream->write((uint32_t*)&forMarshaling->indexCount, sizeof(uint32_t));
+    vkStream->write((VkIndexType*)&forMarshaling->indexType, sizeof(VkIndexType));
+    uint64_t cgen_var_2;
+    vkStream->handleMapping()->mapHandles_VkBuffer_u64(&forMarshaling->transformData, &cgen_var_2,
+                                                       1);
+    vkStream->write((uint64_t*)&cgen_var_2, 1 * 8);
+    vkStream->write((VkDeviceSize*)&forMarshaling->transformOffset, sizeof(VkDeviceSize));
+}
+
+void unmarshal_VkGeometryTrianglesNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkGeometryTrianglesNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_0,
+                                                       (VkBuffer*)&forUnmarshaling->vertexData, 1);
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->vertexOffset, sizeof(VkDeviceSize));
+    vkStream->read((uint32_t*)&forUnmarshaling->vertexCount, sizeof(uint32_t));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->vertexStride, sizeof(VkDeviceSize));
+    vkStream->read((VkFormat*)&forUnmarshaling->vertexFormat, sizeof(VkFormat));
+    uint64_t cgen_var_1;
+    vkStream->read((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_1,
+                                                       (VkBuffer*)&forUnmarshaling->indexData, 1);
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->indexOffset, sizeof(VkDeviceSize));
+    vkStream->read((uint32_t*)&forUnmarshaling->indexCount, sizeof(uint32_t));
+    vkStream->read((VkIndexType*)&forUnmarshaling->indexType, sizeof(VkIndexType));
+    uint64_t cgen_var_2;
+    vkStream->read((uint64_t*)&cgen_var_2, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkBuffer(
+        &cgen_var_2, (VkBuffer*)&forUnmarshaling->transformData, 1);
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->transformOffset, sizeof(VkDeviceSize));
+}
+
+void marshal_VkGeometryAABBNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                              const VkGeometryAABBNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkBuffer_u64(&forMarshaling->aabbData, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((uint32_t*)&forMarshaling->numAABBs, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->stride, sizeof(uint32_t));
+    vkStream->write((VkDeviceSize*)&forMarshaling->offset, sizeof(VkDeviceSize));
+}
+
+void unmarshal_VkGeometryAABBNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                VkGeometryAABBNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_0,
+                                                       (VkBuffer*)&forUnmarshaling->aabbData, 1);
+    vkStream->read((uint32_t*)&forUnmarshaling->numAABBs, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->stride, sizeof(uint32_t));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->offset, sizeof(VkDeviceSize));
+}
+
+void marshal_VkGeometryDataNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                              const VkGeometryDataNV* forMarshaling) {
+    (void)rootType;
+    marshal_VkGeometryTrianglesNV(vkStream, rootType,
+                                  (VkGeometryTrianglesNV*)(&forMarshaling->triangles));
+    marshal_VkGeometryAABBNV(vkStream, rootType, (VkGeometryAABBNV*)(&forMarshaling->aabbs));
+}
+
+void unmarshal_VkGeometryDataNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                VkGeometryDataNV* forUnmarshaling) {
+    (void)rootType;
+    unmarshal_VkGeometryTrianglesNV(vkStream, rootType,
+                                    (VkGeometryTrianglesNV*)(&forUnmarshaling->triangles));
+    unmarshal_VkGeometryAABBNV(vkStream, rootType, (VkGeometryAABBNV*)(&forUnmarshaling->aabbs));
+}
+
+void marshal_VkGeometryNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                          const VkGeometryNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkGeometryTypeKHR*)&forMarshaling->geometryType, sizeof(VkGeometryTypeKHR));
+    marshal_VkGeometryDataNV(vkStream, rootType, (VkGeometryDataNV*)(&forMarshaling->geometry));
+    vkStream->write((VkGeometryFlagsKHR*)&forMarshaling->flags, sizeof(VkGeometryFlagsKHR));
+}
+
+void unmarshal_VkGeometryNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                            VkGeometryNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkGeometryTypeKHR*)&forUnmarshaling->geometryType, sizeof(VkGeometryTypeKHR));
+    unmarshal_VkGeometryDataNV(vkStream, rootType, (VkGeometryDataNV*)(&forUnmarshaling->geometry));
+    vkStream->read((VkGeometryFlagsKHR*)&forUnmarshaling->flags, sizeof(VkGeometryFlagsKHR));
+}
+
+void marshal_VkAccelerationStructureInfoNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkAccelerationStructureInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkAccelerationStructureTypeNV*)&forMarshaling->type,
+                    sizeof(VkAccelerationStructureTypeNV));
+    vkStream->write((VkBuildAccelerationStructureFlagsNV*)&forMarshaling->flags,
+                    sizeof(VkBuildAccelerationStructureFlagsNV));
+    vkStream->write((uint32_t*)&forMarshaling->instanceCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->geometryCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->geometryCount; ++i) {
+            marshal_VkGeometryNV(vkStream, rootType,
+                                 (const VkGeometryNV*)(forMarshaling->pGeometries + i));
+        }
+    }
+}
+
+void unmarshal_VkAccelerationStructureInfoNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkAccelerationStructureInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkAccelerationStructureTypeNV*)&forUnmarshaling->type,
+                   sizeof(VkAccelerationStructureTypeNV));
+    vkStream->read((VkBuildAccelerationStructureFlagsNV*)&forUnmarshaling->flags,
+                   sizeof(VkBuildAccelerationStructureFlagsNV));
+    vkStream->read((uint32_t*)&forUnmarshaling->instanceCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->geometryCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->geometryCount; ++i) {
+            unmarshal_VkGeometryNV(vkStream, rootType,
+                                   (VkGeometryNV*)(forUnmarshaling->pGeometries + i));
+        }
+    }
+}
+
+void marshal_VkAccelerationStructureCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureCreateInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDeviceSize*)&forMarshaling->compactedSize, sizeof(VkDeviceSize));
+    marshal_VkAccelerationStructureInfoNV(vkStream, rootType,
+                                          (VkAccelerationStructureInfoNV*)(&forMarshaling->info));
+}
+
+void unmarshal_VkAccelerationStructureCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureCreateInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->compactedSize, sizeof(VkDeviceSize));
+    unmarshal_VkAccelerationStructureInfoNV(
+        vkStream, rootType, (VkAccelerationStructureInfoNV*)(&forUnmarshaling->info));
+}
+
+void marshal_VkBindAccelerationStructureMemoryInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBindAccelerationStructureMemoryInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkAccelerationStructureNV_u64(
+        &forMarshaling->accelerationStructure, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    uint64_t cgen_var_1;
+    vkStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&forMarshaling->memory, &cgen_var_1,
+                                                             1);
+    vkStream->write((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->write((VkDeviceSize*)&forMarshaling->memoryOffset, sizeof(VkDeviceSize));
+    vkStream->write((uint32_t*)&forMarshaling->deviceIndexCount, sizeof(uint32_t));
+    vkStream->write((const uint32_t*)forMarshaling->pDeviceIndices,
+                    forMarshaling->deviceIndexCount * sizeof(const uint32_t));
+}
+
+void unmarshal_VkBindAccelerationStructureMemoryInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkBindAccelerationStructureMemoryInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkAccelerationStructureNV(
+        &cgen_var_0, (VkAccelerationStructureNV*)&forUnmarshaling->accelerationStructure, 1);
+    uint64_t cgen_var_1;
+    vkStream->read((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkDeviceMemory(
+        &cgen_var_1, (VkDeviceMemory*)&forUnmarshaling->memory, 1);
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->memoryOffset, sizeof(VkDeviceSize));
+    vkStream->read((uint32_t*)&forUnmarshaling->deviceIndexCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)forUnmarshaling->pDeviceIndices,
+                   forUnmarshaling->deviceIndexCount * sizeof(const uint32_t));
+}
+
+void marshal_VkWriteDescriptorSetAccelerationStructureNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkWriteDescriptorSetAccelerationStructureNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->accelerationStructureCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pAccelerationStructures;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pAccelerationStructures) {
+        if (forMarshaling->accelerationStructureCount) {
+            uint64_t* cgen_var_0_0;
+            vkStream->alloc((void**)&cgen_var_0_0, forMarshaling->accelerationStructureCount * 8);
+            vkStream->handleMapping()->mapHandles_VkAccelerationStructureNV_u64(
+                forMarshaling->pAccelerationStructures, cgen_var_0_0,
+                forMarshaling->accelerationStructureCount);
+            vkStream->write((uint64_t*)cgen_var_0_0, forMarshaling->accelerationStructureCount * 8);
+        }
+    }
+}
+
+void unmarshal_VkWriteDescriptorSetAccelerationStructureNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkWriteDescriptorSetAccelerationStructureNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->accelerationStructureCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const VkAccelerationStructureNV* check_pAccelerationStructures;
+    check_pAccelerationStructures =
+        (const VkAccelerationStructureNV*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pAccelerationStructures) {
+        if (!(check_pAccelerationStructures)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pAccelerationStructures inconsistent between guest "
+                    "and host\n");
+        }
+        if (forUnmarshaling->accelerationStructureCount) {
+            uint64_t* cgen_var_0_0;
+            vkStream->alloc((void**)&cgen_var_0_0, forUnmarshaling->accelerationStructureCount * 8);
+            vkStream->read((uint64_t*)cgen_var_0_0,
+                           forUnmarshaling->accelerationStructureCount * 8);
+            vkStream->handleMapping()->mapHandles_u64_VkAccelerationStructureNV(
+                cgen_var_0_0, (VkAccelerationStructureNV*)forUnmarshaling->pAccelerationStructures,
+                forUnmarshaling->accelerationStructureCount);
+        }
+    }
+}
+
+void marshal_VkAccelerationStructureMemoryRequirementsInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureMemoryRequirementsInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkAccelerationStructureMemoryRequirementsTypeNV*)&forMarshaling->type,
+                    sizeof(VkAccelerationStructureMemoryRequirementsTypeNV));
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkAccelerationStructureNV_u64(
+        &forMarshaling->accelerationStructure, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+}
+
+void unmarshal_VkAccelerationStructureMemoryRequirementsInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureMemoryRequirementsInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkAccelerationStructureMemoryRequirementsTypeNV*)&forUnmarshaling->type,
+                   sizeof(VkAccelerationStructureMemoryRequirementsTypeNV));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkAccelerationStructureNV(
+        &cgen_var_0, (VkAccelerationStructureNV*)&forUnmarshaling->accelerationStructure, 1);
+}
+
+void marshal_VkPhysicalDeviceRayTracingPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingPropertiesNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->shaderGroupHandleSize, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxRecursionDepth, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxShaderGroupStride, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->shaderGroupBaseAlignment, sizeof(uint32_t));
+    vkStream->write((uint64_t*)&forMarshaling->maxGeometryCount, sizeof(uint64_t));
+    vkStream->write((uint64_t*)&forMarshaling->maxInstanceCount, sizeof(uint64_t));
+    vkStream->write((uint64_t*)&forMarshaling->maxTriangleCount, sizeof(uint64_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetAccelerationStructures,
+                    sizeof(uint32_t));
+}
+
+void unmarshal_VkPhysicalDeviceRayTracingPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceRayTracingPropertiesNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->shaderGroupHandleSize, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxRecursionDepth, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxShaderGroupStride, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->shaderGroupBaseAlignment, sizeof(uint32_t));
+    vkStream->read((uint64_t*)&forUnmarshaling->maxGeometryCount, sizeof(uint64_t));
+    vkStream->read((uint64_t*)&forUnmarshaling->maxInstanceCount, sizeof(uint64_t));
+    vkStream->read((uint64_t*)&forUnmarshaling->maxTriangleCount, sizeof(uint64_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetAccelerationStructures,
+                   sizeof(uint32_t));
+}
+
+void marshal_VkTransformMatrixKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkTransformMatrixKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((float*)forMarshaling->matrix, ((3) * (4)) * sizeof(float));
+}
+
+void unmarshal_VkTransformMatrixKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkTransformMatrixKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((float*)forUnmarshaling->matrix, ((3) * (4)) * sizeof(float));
+}
+
+void marshal_VkAabbPositionsKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkAabbPositionsKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((float*)&forMarshaling->minX, sizeof(float));
+    vkStream->write((float*)&forMarshaling->minY, sizeof(float));
+    vkStream->write((float*)&forMarshaling->minZ, sizeof(float));
+    vkStream->write((float*)&forMarshaling->maxX, sizeof(float));
+    vkStream->write((float*)&forMarshaling->maxY, sizeof(float));
+    vkStream->write((float*)&forMarshaling->maxZ, sizeof(float));
+}
+
+void unmarshal_VkAabbPositionsKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkAabbPositionsKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((float*)&forUnmarshaling->minX, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->minY, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->minZ, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->maxX, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->maxY, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->maxZ, sizeof(float));
+}
+
+void marshal_VkAccelerationStructureInstanceKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureInstanceKHR* forMarshaling) {
+    (void)rootType;
+
+    typedef struct VkAccelerationStructureInstanceKHRWithoutBitFields {
+        VkTransformMatrixKHR transform;
+        uint32_t dwords[2];
+        uint64_t accelerationStructureReference;
+    } VkAccelerationStructureInstanceKHRWithoutBitFields;
+
+    const VkAccelerationStructureInstanceKHRWithoutBitFields* forMarshaling_new =
+        (const VkAccelerationStructureInstanceKHRWithoutBitFields*)(forMarshaling);
+    marshal_VkTransformMatrixKHR(vkStream, rootType,
+                                 (VkTransformMatrixKHR*)(&forMarshaling_new->transform));
+    for (uint32_t i = 0; i < 2; i++) {
+        vkStream->write((uint32_t*)&(forMarshaling_new->dwords[i]), sizeof(uint32_t));
+    }
+    vkStream->write((uint64_t*)&forMarshaling_new->accelerationStructureReference,
+                    sizeof(uint64_t));
+}
+
+void unmarshal_VkAccelerationStructureInstanceKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureInstanceKHR* forUnmarshaling) {
+    (void)rootType;
+
+    typedef struct VkAccelerationStructureInstanceKHRWithoutBitFields {
+        VkTransformMatrixKHR transform;
+        uint32_t dwords[2];
+        uint64_t accelerationStructureReference;
+    } VkAccelerationStructureInstanceKHRWithoutBitFields;
+
+    VkAccelerationStructureInstanceKHRWithoutBitFields* forUnmarshaling_new =
+        (VkAccelerationStructureInstanceKHRWithoutBitFields*)(forUnmarshaling);
+    unmarshal_VkTransformMatrixKHR(vkStream, rootType,
+                                   (VkTransformMatrixKHR*)(&forUnmarshaling_new->transform));
+    for (uint32_t i = 0; i < 2; i++) {
+        vkStream->read((uint32_t*)&(forUnmarshaling_new->dwords[i]), sizeof(uint32_t));
+    }
+    vkStream->read((uint64_t*)&forUnmarshaling_new->accelerationStructureReference,
+                   sizeof(uint64_t));
+}
+
+#endif
+#ifdef VK_NV_representative_fragment_test
+void marshal_VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->representativeFragmentTest, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->representativeFragmentTest, sizeof(VkBool32));
+}
+
+void marshal_VkPipelineRepresentativeFragmentTestStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRepresentativeFragmentTestStateCreateInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->representativeFragmentTestEnable, sizeof(VkBool32));
+}
+
+void unmarshal_VkPipelineRepresentativeFragmentTestStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineRepresentativeFragmentTestStateCreateInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->representativeFragmentTestEnable, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_EXT_filter_cubic
+void marshal_VkPhysicalDeviceImageViewImageFormatInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceImageViewImageFormatInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkImageViewType*)&forMarshaling->imageViewType, sizeof(VkImageViewType));
+}
+
+void unmarshal_VkPhysicalDeviceImageViewImageFormatInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceImageViewImageFormatInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkImageViewType*)&forUnmarshaling->imageViewType, sizeof(VkImageViewType));
+}
+
+void marshal_VkFilterCubicImageViewImageFormatPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkFilterCubicImageViewImageFormatPropertiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->filterCubic, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->filterCubicMinmax, sizeof(VkBool32));
+}
+
+void unmarshal_VkFilterCubicImageViewImageFormatPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkFilterCubicImageViewImageFormatPropertiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->filterCubic, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->filterCubicMinmax, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_QCOM_render_pass_shader_resolve
+#endif
+#ifdef VK_EXT_global_priority
+void marshal_VkDeviceQueueGlobalPriorityCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceQueueGlobalPriorityCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkQueueGlobalPriorityEXT*)&forMarshaling->globalPriority,
+                    sizeof(VkQueueGlobalPriorityEXT));
+}
+
+void unmarshal_VkDeviceQueueGlobalPriorityCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDeviceQueueGlobalPriorityCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkQueueGlobalPriorityEXT*)&forUnmarshaling->globalPriority,
+                   sizeof(VkQueueGlobalPriorityEXT));
+}
+
+#endif
+#ifdef VK_EXT_external_memory_host
+void marshal_VkImportMemoryHostPointerInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportMemoryHostPointerInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkExternalMemoryHandleTypeFlagBits*)&forMarshaling->handleType,
+                    sizeof(VkExternalMemoryHandleTypeFlagBits));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pHostPointer;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pHostPointer) {
+        vkStream->write((void*)forMarshaling->pHostPointer, sizeof(uint8_t));
+    }
+}
+
+void unmarshal_VkImportMemoryHostPointerInfoEXT(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkImportMemoryHostPointerInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkExternalMemoryHandleTypeFlagBits*)&forUnmarshaling->handleType,
+                   sizeof(VkExternalMemoryHandleTypeFlagBits));
+    // WARNING PTR CHECK
+    void* check_pHostPointer;
+    check_pHostPointer = (void*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pHostPointer) {
+        if (!(check_pHostPointer)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pHostPointer inconsistent between guest and host\n");
+        }
+        vkStream->read((void*)forUnmarshaling->pHostPointer, sizeof(uint8_t));
+    }
+}
+
+void marshal_VkMemoryHostPointerPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryHostPointerPropertiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->memoryTypeBits, sizeof(uint32_t));
+}
+
+void unmarshal_VkMemoryHostPointerPropertiesEXT(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkMemoryHostPointerPropertiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->memoryTypeBits, sizeof(uint32_t));
+}
+
+void marshal_VkPhysicalDeviceExternalMemoryHostPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExternalMemoryHostPropertiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDeviceSize*)&forMarshaling->minImportedHostPointerAlignment,
+                    sizeof(VkDeviceSize));
+}
+
+void unmarshal_VkPhysicalDeviceExternalMemoryHostPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceExternalMemoryHostPropertiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->minImportedHostPointerAlignment,
+                   sizeof(VkDeviceSize));
+}
+
+#endif
+#ifdef VK_AMD_buffer_marker
+#endif
+#ifdef VK_AMD_pipeline_compiler_control
+void marshal_VkPipelineCompilerControlCreateInfoAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineCompilerControlCreateInfoAMD* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineCompilerControlFlagsAMD*)&forMarshaling->compilerControlFlags,
+                    sizeof(VkPipelineCompilerControlFlagsAMD));
+}
+
+void unmarshal_VkPipelineCompilerControlCreateInfoAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineCompilerControlCreateInfoAMD* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineCompilerControlFlagsAMD*)&forUnmarshaling->compilerControlFlags,
+                   sizeof(VkPipelineCompilerControlFlagsAMD));
+}
+
+#endif
+#ifdef VK_EXT_calibrated_timestamps
+void marshal_VkCalibratedTimestampInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkCalibratedTimestampInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkTimeDomainEXT*)&forMarshaling->timeDomain, sizeof(VkTimeDomainEXT));
+}
+
+void unmarshal_VkCalibratedTimestampInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkCalibratedTimestampInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkTimeDomainEXT*)&forUnmarshaling->timeDomain, sizeof(VkTimeDomainEXT));
+}
+
+#endif
+#ifdef VK_AMD_shader_core_properties
+void marshal_VkPhysicalDeviceShaderCorePropertiesAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderCorePropertiesAMD* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->shaderEngineCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->shaderArraysPerEngineCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->computeUnitsPerShaderArray, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->simdPerComputeUnit, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->wavefrontsPerSimd, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->wavefrontSize, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->sgprsPerSimd, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->minSgprAllocation, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxSgprAllocation, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->sgprAllocationGranularity, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->vgprsPerSimd, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->minVgprAllocation, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxVgprAllocation, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->vgprAllocationGranularity, sizeof(uint32_t));
+}
+
+void unmarshal_VkPhysicalDeviceShaderCorePropertiesAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderCorePropertiesAMD* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->shaderEngineCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->shaderArraysPerEngineCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->computeUnitsPerShaderArray, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->simdPerComputeUnit, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->wavefrontsPerSimd, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->wavefrontSize, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->sgprsPerSimd, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->minSgprAllocation, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxSgprAllocation, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->sgprAllocationGranularity, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->vgprsPerSimd, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->minVgprAllocation, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxVgprAllocation, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->vgprAllocationGranularity, sizeof(uint32_t));
+}
+
+#endif
+#ifdef VK_EXT_video_decode_h265
+void marshal_VkVideoDecodeH265ProfileEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkVideoDecodeH265ProfileEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((StdVideoH265ProfileIdc*)&forMarshaling->stdProfileIdc,
+                    sizeof(StdVideoH265ProfileIdc));
+}
+
+void unmarshal_VkVideoDecodeH265ProfileEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkVideoDecodeH265ProfileEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((StdVideoH265ProfileIdc*)&forUnmarshaling->stdProfileIdc,
+                   sizeof(StdVideoH265ProfileIdc));
+}
+
+void marshal_VkVideoDecodeH265CapabilitiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH265CapabilitiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->maxLevel, sizeof(uint32_t));
+    marshal_VkExtensionProperties(vkStream, rootType,
+                                  (VkExtensionProperties*)(&forMarshaling->stdExtensionVersion));
+}
+
+void unmarshal_VkVideoDecodeH265CapabilitiesEXT(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkVideoDecodeH265CapabilitiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxLevel, sizeof(uint32_t));
+    unmarshal_VkExtensionProperties(
+        vkStream, rootType, (VkExtensionProperties*)(&forUnmarshaling->stdExtensionVersion));
+}
+
+void marshal_VkVideoDecodeH265SessionCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH265SessionCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkVideoDecodeH265CreateFlagsEXT*)&forMarshaling->flags,
+                    sizeof(VkVideoDecodeH265CreateFlagsEXT));
+    marshal_VkExtensionProperties(
+        vkStream, rootType, (const VkExtensionProperties*)(forMarshaling->pStdExtensionVersion));
+}
+
+void unmarshal_VkVideoDecodeH265SessionCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoDecodeH265SessionCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkVideoDecodeH265CreateFlagsEXT*)&forUnmarshaling->flags,
+                   sizeof(VkVideoDecodeH265CreateFlagsEXT));
+    unmarshal_VkExtensionProperties(
+        vkStream, rootType, (VkExtensionProperties*)(forUnmarshaling->pStdExtensionVersion));
+}
+
+void marshal_VkVideoDecodeH265SessionParametersAddInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH265SessionParametersAddInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->spsStdCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pSpsStd;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pSpsStd) {
+        vkStream->write(
+            (const StdVideoH265SequenceParameterSet*)forMarshaling->pSpsStd,
+            forMarshaling->spsStdCount * sizeof(const StdVideoH265SequenceParameterSet));
+    }
+    vkStream->write((uint32_t*)&forMarshaling->ppsStdCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pPpsStd;
+    vkStream->putBe64(cgen_var_1);
+    if (forMarshaling->pPpsStd) {
+        vkStream->write((const StdVideoH265PictureParameterSet*)forMarshaling->pPpsStd,
+                        forMarshaling->ppsStdCount * sizeof(const StdVideoH265PictureParameterSet));
+    }
+}
+
+void unmarshal_VkVideoDecodeH265SessionParametersAddInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoDecodeH265SessionParametersAddInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->spsStdCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const StdVideoH265SequenceParameterSet* check_pSpsStd;
+    check_pSpsStd = (const StdVideoH265SequenceParameterSet*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pSpsStd) {
+        if (!(check_pSpsStd)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pSpsStd inconsistent between guest and host\n");
+        }
+        vkStream->read(
+            (StdVideoH265SequenceParameterSet*)forUnmarshaling->pSpsStd,
+            forUnmarshaling->spsStdCount * sizeof(const StdVideoH265SequenceParameterSet));
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->ppsStdCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const StdVideoH265PictureParameterSet* check_pPpsStd;
+    check_pPpsStd = (const StdVideoH265PictureParameterSet*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pPpsStd) {
+        if (!(check_pPpsStd)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pPpsStd inconsistent between guest and host\n");
+        }
+        vkStream->read(
+            (StdVideoH265PictureParameterSet*)forUnmarshaling->pPpsStd,
+            forUnmarshaling->ppsStdCount * sizeof(const StdVideoH265PictureParameterSet));
+    }
+}
+
+void marshal_VkVideoDecodeH265SessionParametersCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH265SessionParametersCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->maxSpsStdCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxPpsStdCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pParametersAddInfo;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pParametersAddInfo) {
+        marshal_VkVideoDecodeH265SessionParametersAddInfoEXT(
+            vkStream, rootType,
+            (const VkVideoDecodeH265SessionParametersAddInfoEXT*)(forMarshaling
+                                                                      ->pParametersAddInfo));
+    }
+}
+
+void unmarshal_VkVideoDecodeH265SessionParametersCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoDecodeH265SessionParametersCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxSpsStdCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPpsStdCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const VkVideoDecodeH265SessionParametersAddInfoEXT* check_pParametersAddInfo;
+    check_pParametersAddInfo =
+        (const VkVideoDecodeH265SessionParametersAddInfoEXT*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pParametersAddInfo) {
+        if (!(check_pParametersAddInfo)) {
+            fprintf(
+                stderr,
+                "fatal: forUnmarshaling->pParametersAddInfo inconsistent between guest and host\n");
+        }
+        unmarshal_VkVideoDecodeH265SessionParametersAddInfoEXT(
+            vkStream, rootType,
+            (VkVideoDecodeH265SessionParametersAddInfoEXT*)(forUnmarshaling->pParametersAddInfo));
+    }
+}
+
+void marshal_VkVideoDecodeH265PictureInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkVideoDecodeH265PictureInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((StdVideoDecodeH265PictureInfo*)forMarshaling->pStdPictureInfo,
+                    sizeof(StdVideoDecodeH265PictureInfo));
+    vkStream->write((uint32_t*)&forMarshaling->slicesCount, sizeof(uint32_t));
+    vkStream->write((const uint32_t*)forMarshaling->pSlicesDataOffsets,
+                    forMarshaling->slicesCount * sizeof(const uint32_t));
+}
+
+void unmarshal_VkVideoDecodeH265PictureInfoEXT(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkVideoDecodeH265PictureInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((StdVideoDecodeH265PictureInfo*)forUnmarshaling->pStdPictureInfo,
+                   sizeof(StdVideoDecodeH265PictureInfo));
+    vkStream->read((uint32_t*)&forUnmarshaling->slicesCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)forUnmarshaling->pSlicesDataOffsets,
+                   forUnmarshaling->slicesCount * sizeof(const uint32_t));
+}
+
+void marshal_VkVideoDecodeH265DpbSlotInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkVideoDecodeH265DpbSlotInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((const StdVideoDecodeH265ReferenceInfo*)forMarshaling->pStdReferenceInfo,
+                    sizeof(const StdVideoDecodeH265ReferenceInfo));
+}
+
+void unmarshal_VkVideoDecodeH265DpbSlotInfoEXT(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkVideoDecodeH265DpbSlotInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((StdVideoDecodeH265ReferenceInfo*)forUnmarshaling->pStdReferenceInfo,
+                   sizeof(const StdVideoDecodeH265ReferenceInfo));
+}
+
+#endif
+#ifdef VK_AMD_memory_overallocation_behavior
+void marshal_VkDeviceMemoryOverallocationCreateInfoAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceMemoryOverallocationCreateInfoAMD* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkMemoryOverallocationBehaviorAMD*)&forMarshaling->overallocationBehavior,
+                    sizeof(VkMemoryOverallocationBehaviorAMD));
+}
+
+void unmarshal_VkDeviceMemoryOverallocationCreateInfoAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDeviceMemoryOverallocationCreateInfoAMD* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkMemoryOverallocationBehaviorAMD*)&forUnmarshaling->overallocationBehavior,
+                   sizeof(VkMemoryOverallocationBehaviorAMD));
+}
+
+#endif
+#ifdef VK_EXT_vertex_attribute_divisor
+void marshal_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->maxVertexAttribDivisor, sizeof(uint32_t));
+}
+
+void unmarshal_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxVertexAttribDivisor, sizeof(uint32_t));
+}
+
+void marshal_VkVertexInputBindingDivisorDescriptionEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVertexInputBindingDivisorDescriptionEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->binding, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->divisor, sizeof(uint32_t));
+}
+
+void unmarshal_VkVertexInputBindingDivisorDescriptionEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVertexInputBindingDivisorDescriptionEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->binding, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->divisor, sizeof(uint32_t));
+}
+
+void marshal_VkPipelineVertexInputDivisorStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineVertexInputDivisorStateCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->vertexBindingDivisorCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->vertexBindingDivisorCount; ++i) {
+            marshal_VkVertexInputBindingDivisorDescriptionEXT(
+                vkStream, rootType,
+                (const VkVertexInputBindingDivisorDescriptionEXT*)(forMarshaling
+                                                                       ->pVertexBindingDivisors +
+                                                                   i));
+        }
+    }
+}
+
+void unmarshal_VkPipelineVertexInputDivisorStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineVertexInputDivisorStateCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->vertexBindingDivisorCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->vertexBindingDivisorCount; ++i) {
+            unmarshal_VkVertexInputBindingDivisorDescriptionEXT(
+                vkStream, rootType,
+                (VkVertexInputBindingDivisorDescriptionEXT*)(forUnmarshaling
+                                                                 ->pVertexBindingDivisors +
+                                                             i));
+        }
+    }
+}
+
+void marshal_VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->vertexAttributeInstanceRateDivisor,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->vertexAttributeInstanceRateZeroDivisor,
+                    sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->vertexAttributeInstanceRateDivisor,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->vertexAttributeInstanceRateZeroDivisor,
+                   sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_GGP_frame_token
+void marshal_VkPresentFrameTokenGGP(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkPresentFrameTokenGGP* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((GgpFrameToken*)&forMarshaling->frameToken, sizeof(GgpFrameToken));
+}
+
+void unmarshal_VkPresentFrameTokenGGP(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      VkPresentFrameTokenGGP* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((GgpFrameToken*)&forUnmarshaling->frameToken, sizeof(GgpFrameToken));
+}
+
+#endif
+#ifdef VK_EXT_pipeline_creation_feedback
+void marshal_VkPipelineCreationFeedbackEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkPipelineCreationFeedbackEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkPipelineCreationFeedbackFlagsEXT*)&forMarshaling->flags,
+                    sizeof(VkPipelineCreationFeedbackFlagsEXT));
+    vkStream->write((uint64_t*)&forMarshaling->duration, sizeof(uint64_t));
+}
+
+void unmarshal_VkPipelineCreationFeedbackEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkPipelineCreationFeedbackEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkPipelineCreationFeedbackFlagsEXT*)&forUnmarshaling->flags,
+                   sizeof(VkPipelineCreationFeedbackFlagsEXT));
+    vkStream->read((uint64_t*)&forUnmarshaling->duration, sizeof(uint64_t));
+}
+
+void marshal_VkPipelineCreationFeedbackCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineCreationFeedbackCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkPipelineCreationFeedbackEXT(
+        vkStream, rootType,
+        (VkPipelineCreationFeedbackEXT*)(forMarshaling->pPipelineCreationFeedback));
+    vkStream->write((uint32_t*)&forMarshaling->pipelineStageCreationFeedbackCount,
+                    sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->pipelineStageCreationFeedbackCount; ++i) {
+            marshal_VkPipelineCreationFeedbackEXT(
+                vkStream, rootType,
+                (VkPipelineCreationFeedbackEXT*)(forMarshaling->pPipelineStageCreationFeedbacks +
+                                                 i));
+        }
+    }
+}
+
+void unmarshal_VkPipelineCreationFeedbackCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineCreationFeedbackCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkPipelineCreationFeedbackEXT(
+        vkStream, rootType,
+        (VkPipelineCreationFeedbackEXT*)(forUnmarshaling->pPipelineCreationFeedback));
+    vkStream->read((uint32_t*)&forUnmarshaling->pipelineStageCreationFeedbackCount,
+                   sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->pipelineStageCreationFeedbackCount;
+             ++i) {
+            unmarshal_VkPipelineCreationFeedbackEXT(
+                vkStream, rootType,
+                (VkPipelineCreationFeedbackEXT*)(forUnmarshaling->pPipelineStageCreationFeedbacks +
+                                                 i));
+        }
+    }
+}
+
+#endif
+#ifdef VK_NV_shader_subgroup_partitioned
+#endif
+#ifdef VK_NV_compute_shader_derivatives
+void marshal_VkPhysicalDeviceComputeShaderDerivativesFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceComputeShaderDerivativesFeaturesNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->computeDerivativeGroupQuads, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->computeDerivativeGroupLinear, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceComputeShaderDerivativesFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceComputeShaderDerivativesFeaturesNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->computeDerivativeGroupQuads, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->computeDerivativeGroupLinear, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_NV_mesh_shader
+void marshal_VkPhysicalDeviceMeshShaderFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMeshShaderFeaturesNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->taskShader, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->meshShader, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceMeshShaderFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceMeshShaderFeaturesNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->taskShader, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->meshShader, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceMeshShaderPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMeshShaderPropertiesNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->maxDrawMeshTasksCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxTaskWorkGroupInvocations, sizeof(uint32_t));
+    vkStream->write((uint32_t*)forMarshaling->maxTaskWorkGroupSize, 3 * sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxTaskTotalMemorySize, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxTaskOutputCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxMeshWorkGroupInvocations, sizeof(uint32_t));
+    vkStream->write((uint32_t*)forMarshaling->maxMeshWorkGroupSize, 3 * sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxMeshTotalMemorySize, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxMeshOutputVertices, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxMeshOutputPrimitives, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxMeshMultiviewViewCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->meshOutputPerVertexGranularity, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->meshOutputPerPrimitiveGranularity, sizeof(uint32_t));
+}
+
+void unmarshal_VkPhysicalDeviceMeshShaderPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceMeshShaderPropertiesNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxDrawMeshTasksCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxTaskWorkGroupInvocations, sizeof(uint32_t));
+    vkStream->read((uint32_t*)forUnmarshaling->maxTaskWorkGroupSize, 3 * sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxTaskTotalMemorySize, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxTaskOutputCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxMeshWorkGroupInvocations, sizeof(uint32_t));
+    vkStream->read((uint32_t*)forUnmarshaling->maxMeshWorkGroupSize, 3 * sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxMeshTotalMemorySize, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxMeshOutputVertices, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxMeshOutputPrimitives, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxMeshMultiviewViewCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->meshOutputPerVertexGranularity, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->meshOutputPerPrimitiveGranularity,
+                   sizeof(uint32_t));
+}
+
+void marshal_VkDrawMeshTasksIndirectCommandNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDrawMeshTasksIndirectCommandNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->taskCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->firstTask, sizeof(uint32_t));
+}
+
+void unmarshal_VkDrawMeshTasksIndirectCommandNV(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkDrawMeshTasksIndirectCommandNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->taskCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->firstTask, sizeof(uint32_t));
+}
+
+#endif
+#ifdef VK_NV_fragment_shader_barycentric
+void marshal_VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->fragmentShaderBarycentric, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->fragmentShaderBarycentric, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_NV_shader_image_footprint
+void marshal_VkPhysicalDeviceShaderImageFootprintFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderImageFootprintFeaturesNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->imageFootprint, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceShaderImageFootprintFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderImageFootprintFeaturesNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->imageFootprint, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_NV_scissor_exclusive
+void marshal_VkPipelineViewportExclusiveScissorStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineViewportExclusiveScissorStateCreateInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->exclusiveScissorCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pExclusiveScissors;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pExclusiveScissors) {
+        if (forMarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forMarshaling->exclusiveScissorCount; ++i) {
+                marshal_VkRect2D(vkStream, rootType,
+                                 (const VkRect2D*)(forMarshaling->pExclusiveScissors + i));
+            }
+        }
+    }
+}
+
+void unmarshal_VkPipelineViewportExclusiveScissorStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineViewportExclusiveScissorStateCreateInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->exclusiveScissorCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const VkRect2D* check_pExclusiveScissors;
+    check_pExclusiveScissors = (const VkRect2D*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pExclusiveScissors) {
+        if (!(check_pExclusiveScissors)) {
+            fprintf(
+                stderr,
+                "fatal: forUnmarshaling->pExclusiveScissors inconsistent between guest and host\n");
+        }
+        if (forUnmarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->exclusiveScissorCount; ++i) {
+                unmarshal_VkRect2D(vkStream, rootType,
+                                   (VkRect2D*)(forUnmarshaling->pExclusiveScissors + i));
+            }
+        }
+    }
+}
+
+void marshal_VkPhysicalDeviceExclusiveScissorFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExclusiveScissorFeaturesNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->exclusiveScissor, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceExclusiveScissorFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceExclusiveScissorFeaturesNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->exclusiveScissor, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+void marshal_VkQueueFamilyCheckpointPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkQueueFamilyCheckpointPropertiesNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineStageFlags*)&forMarshaling->checkpointExecutionStageMask,
+                    sizeof(VkPipelineStageFlags));
+}
+
+void unmarshal_VkQueueFamilyCheckpointPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkQueueFamilyCheckpointPropertiesNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineStageFlags*)&forUnmarshaling->checkpointExecutionStageMask,
+                   sizeof(VkPipelineStageFlags));
+}
+
+void marshal_VkCheckpointDataNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkCheckpointDataNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineStageFlagBits*)&forMarshaling->stage,
+                    sizeof(VkPipelineStageFlagBits));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pCheckpointMarker;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pCheckpointMarker) {
+        vkStream->write((void*)forMarshaling->pCheckpointMarker, sizeof(uint8_t));
+    }
+}
+
+void unmarshal_VkCheckpointDataNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkCheckpointDataNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineStageFlagBits*)&forUnmarshaling->stage,
+                   sizeof(VkPipelineStageFlagBits));
+    // WARNING PTR CHECK
+    void* check_pCheckpointMarker;
+    check_pCheckpointMarker = (void*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pCheckpointMarker) {
+        if (!(check_pCheckpointMarker)) {
+            fprintf(
+                stderr,
+                "fatal: forUnmarshaling->pCheckpointMarker inconsistent between guest and host\n");
+        }
+        vkStream->read((void*)forUnmarshaling->pCheckpointMarker, sizeof(uint8_t));
+    }
+}
+
+#endif
+#ifdef VK_INTEL_shader_integer_functions2
+void marshal_VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->shaderIntegerFunctions2, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderIntegerFunctions2, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_INTEL_performance_query
+void marshal_VkPerformanceValueDataINTEL(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkPerformanceValueDataINTEL* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->value32, sizeof(uint32_t));
+}
+
+void unmarshal_VkPerformanceValueDataINTEL(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkPerformanceValueDataINTEL* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->value32, sizeof(uint32_t));
+}
+
+void marshal_VkPerformanceValueINTEL(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkPerformanceValueINTEL* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkPerformanceValueTypeINTEL*)&forMarshaling->type,
+                    sizeof(VkPerformanceValueTypeINTEL));
+    marshal_VkPerformanceValueDataINTEL(vkStream, rootType,
+                                        (VkPerformanceValueDataINTEL*)(&forMarshaling->data));
+}
+
+void unmarshal_VkPerformanceValueINTEL(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkPerformanceValueINTEL* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkPerformanceValueTypeINTEL*)&forUnmarshaling->type,
+                   sizeof(VkPerformanceValueTypeINTEL));
+    unmarshal_VkPerformanceValueDataINTEL(vkStream, rootType,
+                                          (VkPerformanceValueDataINTEL*)(&forUnmarshaling->data));
+}
+
+void marshal_VkInitializePerformanceApiInfoINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkInitializePerformanceApiInfoINTEL* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pUserData;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pUserData) {
+        vkStream->write((void*)forMarshaling->pUserData, sizeof(uint8_t));
+    }
+}
+
+void unmarshal_VkInitializePerformanceApiInfoINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkInitializePerformanceApiInfoINTEL* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    // WARNING PTR CHECK
+    void* check_pUserData;
+    check_pUserData = (void*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pUserData) {
+        if (!(check_pUserData)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pUserData inconsistent between guest and host\n");
+        }
+        vkStream->read((void*)forUnmarshaling->pUserData, sizeof(uint8_t));
+    }
+}
+
+void marshal_VkQueryPoolPerformanceQueryCreateInfoINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkQueryPoolPerformanceQueryCreateInfoINTEL* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkQueryPoolSamplingModeINTEL*)&forMarshaling->performanceCountersSampling,
+                    sizeof(VkQueryPoolSamplingModeINTEL));
+}
+
+void unmarshal_VkQueryPoolPerformanceQueryCreateInfoINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkQueryPoolPerformanceQueryCreateInfoINTEL* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkQueryPoolSamplingModeINTEL*)&forUnmarshaling->performanceCountersSampling,
+                   sizeof(VkQueryPoolSamplingModeINTEL));
+}
+
+void marshal_VkPerformanceMarkerInfoINTEL(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkPerformanceMarkerInfoINTEL* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint64_t*)&forMarshaling->marker, sizeof(uint64_t));
+}
+
+void unmarshal_VkPerformanceMarkerInfoINTEL(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkPerformanceMarkerInfoINTEL* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint64_t*)&forUnmarshaling->marker, sizeof(uint64_t));
+}
+
+void marshal_VkPerformanceStreamMarkerInfoINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPerformanceStreamMarkerInfoINTEL* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->marker, sizeof(uint32_t));
+}
+
+void unmarshal_VkPerformanceStreamMarkerInfoINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPerformanceStreamMarkerInfoINTEL* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->marker, sizeof(uint32_t));
+}
+
+void marshal_VkPerformanceOverrideInfoINTEL(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkPerformanceOverrideInfoINTEL* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPerformanceOverrideTypeINTEL*)&forMarshaling->type,
+                    sizeof(VkPerformanceOverrideTypeINTEL));
+    vkStream->write((VkBool32*)&forMarshaling->enable, sizeof(VkBool32));
+    vkStream->write((uint64_t*)&forMarshaling->parameter, sizeof(uint64_t));
+}
+
+void unmarshal_VkPerformanceOverrideInfoINTEL(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkPerformanceOverrideInfoINTEL* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPerformanceOverrideTypeINTEL*)&forUnmarshaling->type,
+                   sizeof(VkPerformanceOverrideTypeINTEL));
+    vkStream->read((VkBool32*)&forUnmarshaling->enable, sizeof(VkBool32));
+    vkStream->read((uint64_t*)&forUnmarshaling->parameter, sizeof(uint64_t));
+}
+
+void marshal_VkPerformanceConfigurationAcquireInfoINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPerformanceConfigurationAcquireInfoINTEL* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPerformanceConfigurationTypeINTEL*)&forMarshaling->type,
+                    sizeof(VkPerformanceConfigurationTypeINTEL));
+}
+
+void unmarshal_VkPerformanceConfigurationAcquireInfoINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPerformanceConfigurationAcquireInfoINTEL* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPerformanceConfigurationTypeINTEL*)&forUnmarshaling->type,
+                   sizeof(VkPerformanceConfigurationTypeINTEL));
+}
+
+#endif
+#ifdef VK_EXT_pci_bus_info
+void marshal_VkPhysicalDevicePCIBusInfoPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePCIBusInfoPropertiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->pciDomain, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->pciBus, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->pciDevice, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->pciFunction, sizeof(uint32_t));
+}
+
+void unmarshal_VkPhysicalDevicePCIBusInfoPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevicePCIBusInfoPropertiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->pciDomain, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->pciBus, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->pciDevice, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->pciFunction, sizeof(uint32_t));
+}
+
+#endif
+#ifdef VK_AMD_display_native_hdr
+void marshal_VkDisplayNativeHdrSurfaceCapabilitiesAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDisplayNativeHdrSurfaceCapabilitiesAMD* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->localDimmingSupport, sizeof(VkBool32));
+}
+
+void unmarshal_VkDisplayNativeHdrSurfaceCapabilitiesAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDisplayNativeHdrSurfaceCapabilitiesAMD* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->localDimmingSupport, sizeof(VkBool32));
+}
+
+void marshal_VkSwapchainDisplayNativeHdrCreateInfoAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSwapchainDisplayNativeHdrCreateInfoAMD* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->localDimmingEnable, sizeof(VkBool32));
+}
+
+void unmarshal_VkSwapchainDisplayNativeHdrCreateInfoAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkSwapchainDisplayNativeHdrCreateInfoAMD* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->localDimmingEnable, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_FUCHSIA_imagepipe_surface
+void marshal_VkImagePipeSurfaceCreateInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImagePipeSurfaceCreateInfoFUCHSIA* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkImagePipeSurfaceCreateFlagsFUCHSIA*)&forMarshaling->flags,
+                    sizeof(VkImagePipeSurfaceCreateFlagsFUCHSIA));
+    vkStream->write((zx_handle_t*)&forMarshaling->imagePipeHandle, sizeof(zx_handle_t));
+}
+
+void unmarshal_VkImagePipeSurfaceCreateInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkImagePipeSurfaceCreateInfoFUCHSIA* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkImagePipeSurfaceCreateFlagsFUCHSIA*)&forUnmarshaling->flags,
+                   sizeof(VkImagePipeSurfaceCreateFlagsFUCHSIA));
+    vkStream->read((zx_handle_t*)&forUnmarshaling->imagePipeHandle, sizeof(zx_handle_t));
+}
+
+#endif
+#ifdef VK_EXT_metal_surface
+void marshal_VkMetalSurfaceCreateInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkMetalSurfaceCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+
+    // This struct should never be marshaled / unmarshaled.
+    __builtin_trap();
+}
+
+void unmarshal_VkMetalSurfaceCreateInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkMetalSurfaceCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+
+    // This struct should never be marshaled / unmarshaled.
+    __builtin_trap();
+}
+
+#endif
+#ifdef VK_EXT_fragment_density_map
+void marshal_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMapFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->fragmentDensityMap, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->fragmentDensityMapDynamic, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->fragmentDensityMapNonSubsampledImages,
+                    sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceFragmentDensityMapFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    forUnmarshaling->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->fragmentDensityMap, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->fragmentDensityMapDynamic, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->fragmentDensityMapNonSubsampledImages,
+                   sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMapPropertiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkExtent2D(vkStream, rootType,
+                       (VkExtent2D*)(&forMarshaling->minFragmentDensityTexelSize));
+    marshal_VkExtent2D(vkStream, rootType,
+                       (VkExtent2D*)(&forMarshaling->maxFragmentDensityTexelSize));
+    vkStream->write((VkBool32*)&forMarshaling->fragmentDensityInvocations, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceFragmentDensityMapPropertiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    forUnmarshaling->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkExtent2D(vkStream, rootType,
+                         (VkExtent2D*)(&forUnmarshaling->minFragmentDensityTexelSize));
+    unmarshal_VkExtent2D(vkStream, rootType,
+                         (VkExtent2D*)(&forUnmarshaling->maxFragmentDensityTexelSize));
+    vkStream->read((VkBool32*)&forUnmarshaling->fragmentDensityInvocations, sizeof(VkBool32));
+}
+
+void marshal_VkRenderPassFragmentDensityMapCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRenderPassFragmentDensityMapCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkAttachmentReference(
+        vkStream, rootType, (VkAttachmentReference*)(&forMarshaling->fragmentDensityMapAttachment));
+}
+
+void unmarshal_VkRenderPassFragmentDensityMapCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkRenderPassFragmentDensityMapCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    forUnmarshaling->sType = VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkAttachmentReference(
+        vkStream, rootType,
+        (VkAttachmentReference*)(&forUnmarshaling->fragmentDensityMapAttachment));
+}
+
+#endif
+#ifdef VK_EXT_scalar_block_layout
+#endif
+#ifdef VK_GOOGLE_hlsl_functionality1
+#endif
+#ifdef VK_GOOGLE_decorate_string
+#endif
+#ifdef VK_EXT_subgroup_size_control
+void marshal_VkPhysicalDeviceSubgroupSizeControlFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSubgroupSizeControlFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->subgroupSizeControl, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->computeFullSubgroups, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceSubgroupSizeControlFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceSubgroupSizeControlFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->subgroupSizeControl, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->computeFullSubgroups, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceSubgroupSizeControlPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSubgroupSizeControlPropertiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->minSubgroupSize, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxSubgroupSize, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxComputeWorkgroupSubgroups, sizeof(uint32_t));
+    vkStream->write((VkShaderStageFlags*)&forMarshaling->requiredSubgroupSizeStages,
+                    sizeof(VkShaderStageFlags));
+}
+
+void unmarshal_VkPhysicalDeviceSubgroupSizeControlPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceSubgroupSizeControlPropertiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->minSubgroupSize, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxSubgroupSize, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxComputeWorkgroupSubgroups, sizeof(uint32_t));
+    vkStream->read((VkShaderStageFlags*)&forUnmarshaling->requiredSubgroupSizeStages,
+                   sizeof(VkShaderStageFlags));
+}
+
+void marshal_VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->requiredSubgroupSize, sizeof(uint32_t));
+}
+
+void unmarshal_VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->requiredSubgroupSize, sizeof(uint32_t));
+}
+
+#endif
+#ifdef VK_AMD_shader_core_properties2
+void marshal_VkPhysicalDeviceShaderCoreProperties2AMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderCoreProperties2AMD* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkShaderCorePropertiesFlagsAMD*)&forMarshaling->shaderCoreFeatures,
+                    sizeof(VkShaderCorePropertiesFlagsAMD));
+    vkStream->write((uint32_t*)&forMarshaling->activeComputeUnitCount, sizeof(uint32_t));
+}
+
+void unmarshal_VkPhysicalDeviceShaderCoreProperties2AMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderCoreProperties2AMD* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkShaderCorePropertiesFlagsAMD*)&forUnmarshaling->shaderCoreFeatures,
+                   sizeof(VkShaderCorePropertiesFlagsAMD));
+    vkStream->read((uint32_t*)&forUnmarshaling->activeComputeUnitCount, sizeof(uint32_t));
+}
+
+#endif
+#ifdef VK_AMD_device_coherent_memory
+void marshal_VkPhysicalDeviceCoherentMemoryFeaturesAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceCoherentMemoryFeaturesAMD* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->deviceCoherentMemory, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceCoherentMemoryFeaturesAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceCoherentMemoryFeaturesAMD* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->deviceCoherentMemory, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_EXT_shader_image_atomic_int64
+void marshal_VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->shaderImageInt64Atomics, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->sparseImageInt64Atomics, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderImageInt64Atomics, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->sparseImageInt64Atomics, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_EXT_memory_budget
+void marshal_VkPhysicalDeviceMemoryBudgetPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMemoryBudgetPropertiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDeviceSize*)forMarshaling->heapBudget,
+                    VK_MAX_MEMORY_HEAPS * sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)forMarshaling->heapUsage,
+                    VK_MAX_MEMORY_HEAPS * sizeof(VkDeviceSize));
+}
+
+void unmarshal_VkPhysicalDeviceMemoryBudgetPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceMemoryBudgetPropertiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDeviceSize*)forUnmarshaling->heapBudget,
+                   VK_MAX_MEMORY_HEAPS * sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)forUnmarshaling->heapUsage,
+                   VK_MAX_MEMORY_HEAPS * sizeof(VkDeviceSize));
+}
+
+#endif
+#ifdef VK_EXT_memory_priority
+void marshal_VkPhysicalDeviceMemoryPriorityFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMemoryPriorityFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->memoryPriority, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceMemoryPriorityFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceMemoryPriorityFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->memoryPriority, sizeof(VkBool32));
+}
+
+void marshal_VkMemoryPriorityAllocateInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkMemoryPriorityAllocateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((float*)&forMarshaling->priority, sizeof(float));
+}
+
+void unmarshal_VkMemoryPriorityAllocateInfoEXT(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkMemoryPriorityAllocateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((float*)&forUnmarshaling->priority, sizeof(float));
+}
+
+#endif
+#ifdef VK_NV_dedicated_allocation_image_aliasing
+void marshal_VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->dedicatedAllocationImageAliasing, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->dedicatedAllocationImageAliasing, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_EXT_buffer_device_address
+void marshal_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->bufferDeviceAddress, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->bufferDeviceAddressCaptureReplay, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->bufferDeviceAddressMultiDevice, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceBufferDeviceAddressFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->bufferDeviceAddress, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->bufferDeviceAddressCaptureReplay, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->bufferDeviceAddressMultiDevice, sizeof(VkBool32));
+}
+
+void marshal_VkBufferDeviceAddressCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferDeviceAddressCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDeviceAddress*)&forMarshaling->deviceAddress, sizeof(VkDeviceAddress));
+}
+
+void unmarshal_VkBufferDeviceAddressCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkBufferDeviceAddressCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDeviceAddress*)&forUnmarshaling->deviceAddress, sizeof(VkDeviceAddress));
+}
+
+#endif
+#ifdef VK_EXT_tooling_info
+void marshal_VkPhysicalDeviceToolPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceToolPropertiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((char*)forMarshaling->name, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
+    vkStream->write((char*)forMarshaling->version, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
+    vkStream->write((VkToolPurposeFlagsEXT*)&forMarshaling->purposes,
+                    sizeof(VkToolPurposeFlagsEXT));
+    vkStream->write((char*)forMarshaling->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    vkStream->write((char*)forMarshaling->layer, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
+}
+
+void unmarshal_VkPhysicalDeviceToolPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceToolPropertiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((char*)forUnmarshaling->name, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
+    vkStream->read((char*)forUnmarshaling->version, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
+    vkStream->read((VkToolPurposeFlagsEXT*)&forUnmarshaling->purposes,
+                   sizeof(VkToolPurposeFlagsEXT));
+    vkStream->read((char*)forUnmarshaling->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    vkStream->read((char*)forUnmarshaling->layer, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
+}
+
+#endif
+#ifdef VK_EXT_separate_stencil_usage
+#endif
+#ifdef VK_EXT_validation_features
+void marshal_VkValidationFeaturesEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkValidationFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->enabledValidationFeatureCount, sizeof(uint32_t));
+    vkStream->write(
+        (const VkValidationFeatureEnableEXT*)forMarshaling->pEnabledValidationFeatures,
+        forMarshaling->enabledValidationFeatureCount * sizeof(const VkValidationFeatureEnableEXT));
+    vkStream->write((uint32_t*)&forMarshaling->disabledValidationFeatureCount, sizeof(uint32_t));
+    vkStream->write(
+        (const VkValidationFeatureDisableEXT*)forMarshaling->pDisabledValidationFeatures,
+        forMarshaling->disabledValidationFeatureCount *
+            sizeof(const VkValidationFeatureDisableEXT));
+}
+
+void unmarshal_VkValidationFeaturesEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkValidationFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->enabledValidationFeatureCount, sizeof(uint32_t));
+    vkStream->read((VkValidationFeatureEnableEXT*)forUnmarshaling->pEnabledValidationFeatures,
+                   forUnmarshaling->enabledValidationFeatureCount *
+                       sizeof(const VkValidationFeatureEnableEXT));
+    vkStream->read((uint32_t*)&forUnmarshaling->disabledValidationFeatureCount, sizeof(uint32_t));
+    vkStream->read((VkValidationFeatureDisableEXT*)forUnmarshaling->pDisabledValidationFeatures,
+                   forUnmarshaling->disabledValidationFeatureCount *
+                       sizeof(const VkValidationFeatureDisableEXT));
+}
+
+#endif
+#ifdef VK_NV_cooperative_matrix
+void marshal_VkCooperativeMatrixPropertiesNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkCooperativeMatrixPropertiesNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->MSize, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->NSize, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->KSize, sizeof(uint32_t));
+    vkStream->write((VkComponentTypeNV*)&forMarshaling->AType, sizeof(VkComponentTypeNV));
+    vkStream->write((VkComponentTypeNV*)&forMarshaling->BType, sizeof(VkComponentTypeNV));
+    vkStream->write((VkComponentTypeNV*)&forMarshaling->CType, sizeof(VkComponentTypeNV));
+    vkStream->write((VkComponentTypeNV*)&forMarshaling->DType, sizeof(VkComponentTypeNV));
+    vkStream->write((VkScopeNV*)&forMarshaling->scope, sizeof(VkScopeNV));
+}
+
+void unmarshal_VkCooperativeMatrixPropertiesNV(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkCooperativeMatrixPropertiesNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->MSize, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->NSize, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->KSize, sizeof(uint32_t));
+    vkStream->read((VkComponentTypeNV*)&forUnmarshaling->AType, sizeof(VkComponentTypeNV));
+    vkStream->read((VkComponentTypeNV*)&forUnmarshaling->BType, sizeof(VkComponentTypeNV));
+    vkStream->read((VkComponentTypeNV*)&forUnmarshaling->CType, sizeof(VkComponentTypeNV));
+    vkStream->read((VkComponentTypeNV*)&forUnmarshaling->DType, sizeof(VkComponentTypeNV));
+    vkStream->read((VkScopeNV*)&forUnmarshaling->scope, sizeof(VkScopeNV));
+}
+
+void marshal_VkPhysicalDeviceCooperativeMatrixFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceCooperativeMatrixFeaturesNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->cooperativeMatrix, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->cooperativeMatrixRobustBufferAccess,
+                    sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceCooperativeMatrixFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceCooperativeMatrixFeaturesNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->cooperativeMatrix, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->cooperativeMatrixRobustBufferAccess,
+                   sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceCooperativeMatrixPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceCooperativeMatrixPropertiesNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkShaderStageFlags*)&forMarshaling->cooperativeMatrixSupportedStages,
+                    sizeof(VkShaderStageFlags));
+}
+
+void unmarshal_VkPhysicalDeviceCooperativeMatrixPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceCooperativeMatrixPropertiesNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkShaderStageFlags*)&forUnmarshaling->cooperativeMatrixSupportedStages,
+                   sizeof(VkShaderStageFlags));
+}
+
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+void marshal_VkPhysicalDeviceCoverageReductionModeFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceCoverageReductionModeFeaturesNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->coverageReductionMode, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceCoverageReductionModeFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceCoverageReductionModeFeaturesNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->coverageReductionMode, sizeof(VkBool32));
+}
+
+void marshal_VkPipelineCoverageReductionStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineCoverageReductionStateCreateInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineCoverageReductionStateCreateFlagsNV*)&forMarshaling->flags,
+                    sizeof(VkPipelineCoverageReductionStateCreateFlagsNV));
+    vkStream->write((VkCoverageReductionModeNV*)&forMarshaling->coverageReductionMode,
+                    sizeof(VkCoverageReductionModeNV));
+}
+
+void unmarshal_VkPipelineCoverageReductionStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineCoverageReductionStateCreateInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineCoverageReductionStateCreateFlagsNV*)&forUnmarshaling->flags,
+                   sizeof(VkPipelineCoverageReductionStateCreateFlagsNV));
+    vkStream->read((VkCoverageReductionModeNV*)&forUnmarshaling->coverageReductionMode,
+                   sizeof(VkCoverageReductionModeNV));
+}
+
+void marshal_VkFramebufferMixedSamplesCombinationNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkFramebufferMixedSamplesCombinationNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkCoverageReductionModeNV*)&forMarshaling->coverageReductionMode,
+                    sizeof(VkCoverageReductionModeNV));
+    vkStream->write((VkSampleCountFlagBits*)&forMarshaling->rasterizationSamples,
+                    sizeof(VkSampleCountFlagBits));
+    vkStream->write((VkSampleCountFlags*)&forMarshaling->depthStencilSamples,
+                    sizeof(VkSampleCountFlags));
+    vkStream->write((VkSampleCountFlags*)&forMarshaling->colorSamples, sizeof(VkSampleCountFlags));
+}
+
+void unmarshal_VkFramebufferMixedSamplesCombinationNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkFramebufferMixedSamplesCombinationNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkCoverageReductionModeNV*)&forUnmarshaling->coverageReductionMode,
+                   sizeof(VkCoverageReductionModeNV));
+    vkStream->read((VkSampleCountFlagBits*)&forUnmarshaling->rasterizationSamples,
+                   sizeof(VkSampleCountFlagBits));
+    vkStream->read((VkSampleCountFlags*)&forUnmarshaling->depthStencilSamples,
+                   sizeof(VkSampleCountFlags));
+    vkStream->read((VkSampleCountFlags*)&forUnmarshaling->colorSamples, sizeof(VkSampleCountFlags));
+}
+
+#endif
+#ifdef VK_EXT_fragment_shader_interlock
+void marshal_VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->fragmentShaderSampleInterlock, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->fragmentShaderPixelInterlock, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->fragmentShaderShadingRateInterlock,
+                    sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->fragmentShaderSampleInterlock, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->fragmentShaderPixelInterlock, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->fragmentShaderShadingRateInterlock,
+                   sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_EXT_ycbcr_image_arrays
+void marshal_VkPhysicalDeviceYcbcrImageArraysFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->ycbcrImageArrays, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceYcbcrImageArraysFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceYcbcrImageArraysFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->ycbcrImageArrays, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_EXT_provoking_vertex
+void marshal_VkPhysicalDeviceProvokingVertexFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceProvokingVertexFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->provokingVertexLast, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->transformFeedbackPreservesProvokingVertex,
+                    sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceProvokingVertexFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceProvokingVertexFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->provokingVertexLast, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->transformFeedbackPreservesProvokingVertex,
+                   sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceProvokingVertexPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceProvokingVertexPropertiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->provokingVertexModePerPipeline, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->transformFeedbackPreservesTriangleFanProvokingVertex,
+                    sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceProvokingVertexPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceProvokingVertexPropertiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->provokingVertexModePerPipeline, sizeof(VkBool32));
+    vkStream->read(
+        (VkBool32*)&forUnmarshaling->transformFeedbackPreservesTriangleFanProvokingVertex,
+        sizeof(VkBool32));
+}
+
+void marshal_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkProvokingVertexModeEXT*)&forMarshaling->provokingVertexMode,
+                    sizeof(VkProvokingVertexModeEXT));
+}
+
+void unmarshal_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineRasterizationProvokingVertexStateCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkProvokingVertexModeEXT*)&forUnmarshaling->provokingVertexMode,
+                   sizeof(VkProvokingVertexModeEXT));
+}
+
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+void marshal_VkSurfaceFullScreenExclusiveInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSurfaceFullScreenExclusiveInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkFullScreenExclusiveEXT*)&forMarshaling->fullScreenExclusive,
+                    sizeof(VkFullScreenExclusiveEXT));
+}
+
+void unmarshal_VkSurfaceFullScreenExclusiveInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkSurfaceFullScreenExclusiveInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkFullScreenExclusiveEXT*)&forUnmarshaling->fullScreenExclusive,
+                   sizeof(VkFullScreenExclusiveEXT));
+}
+
+void marshal_VkSurfaceCapabilitiesFullScreenExclusiveEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSurfaceCapabilitiesFullScreenExclusiveEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->fullScreenExclusiveSupported, sizeof(VkBool32));
+}
+
+void unmarshal_VkSurfaceCapabilitiesFullScreenExclusiveEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkSurfaceCapabilitiesFullScreenExclusiveEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->fullScreenExclusiveSupported, sizeof(VkBool32));
+}
+
+void marshal_VkSurfaceFullScreenExclusiveWin32InfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSurfaceFullScreenExclusiveWin32InfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((HMONITOR*)&forMarshaling->hmonitor, sizeof(HMONITOR));
+}
+
+void unmarshal_VkSurfaceFullScreenExclusiveWin32InfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkSurfaceFullScreenExclusiveWin32InfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((HMONITOR*)&forUnmarshaling->hmonitor, sizeof(HMONITOR));
+}
+
+#endif
+#ifdef VK_EXT_headless_surface
+void marshal_VkHeadlessSurfaceCreateInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkHeadlessSurfaceCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkHeadlessSurfaceCreateFlagsEXT*)&forMarshaling->flags,
+                    sizeof(VkHeadlessSurfaceCreateFlagsEXT));
+}
+
+void unmarshal_VkHeadlessSurfaceCreateInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkHeadlessSurfaceCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkHeadlessSurfaceCreateFlagsEXT*)&forUnmarshaling->flags,
+                   sizeof(VkHeadlessSurfaceCreateFlagsEXT));
+}
+
+#endif
+#ifdef VK_EXT_line_rasterization
+void marshal_VkPhysicalDeviceLineRasterizationFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceLineRasterizationFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->rectangularLines, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->bresenhamLines, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->smoothLines, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->stippledRectangularLines, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->stippledBresenhamLines, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->stippledSmoothLines, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceLineRasterizationFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceLineRasterizationFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->rectangularLines, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->bresenhamLines, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->smoothLines, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->stippledRectangularLines, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->stippledBresenhamLines, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->stippledSmoothLines, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceLineRasterizationPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceLineRasterizationPropertiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->lineSubPixelPrecisionBits, sizeof(uint32_t));
+}
+
+void unmarshal_VkPhysicalDeviceLineRasterizationPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceLineRasterizationPropertiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->lineSubPixelPrecisionBits, sizeof(uint32_t));
+}
+
+void marshal_VkPipelineRasterizationLineStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRasterizationLineStateCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkLineRasterizationModeEXT*)&forMarshaling->lineRasterizationMode,
+                    sizeof(VkLineRasterizationModeEXT));
+    vkStream->write((VkBool32*)&forMarshaling->stippledLineEnable, sizeof(VkBool32));
+    vkStream->write((uint32_t*)&forMarshaling->lineStippleFactor, sizeof(uint32_t));
+    vkStream->write((uint16_t*)&forMarshaling->lineStipplePattern, sizeof(uint16_t));
+}
+
+void unmarshal_VkPipelineRasterizationLineStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineRasterizationLineStateCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkLineRasterizationModeEXT*)&forUnmarshaling->lineRasterizationMode,
+                   sizeof(VkLineRasterizationModeEXT));
+    vkStream->read((VkBool32*)&forUnmarshaling->stippledLineEnable, sizeof(VkBool32));
+    vkStream->read((uint32_t*)&forUnmarshaling->lineStippleFactor, sizeof(uint32_t));
+    vkStream->read((uint16_t*)&forUnmarshaling->lineStipplePattern, sizeof(uint16_t));
+}
+
+#endif
+#ifdef VK_EXT_shader_atomic_float
+void marshal_VkPhysicalDeviceShaderAtomicFloatFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->shaderBufferFloat32Atomics, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderBufferFloat32AtomicAdd, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderBufferFloat64Atomics, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderBufferFloat64AtomicAdd, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderSharedFloat32Atomics, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderSharedFloat32AtomicAdd, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderSharedFloat64Atomics, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderSharedFloat64AtomicAdd, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderImageFloat32Atomics, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderImageFloat32AtomicAdd, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->sparseImageFloat32Atomics, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->sparseImageFloat32AtomicAdd, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceShaderAtomicFloatFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderAtomicFloatFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderBufferFloat32Atomics, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderBufferFloat32AtomicAdd, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderBufferFloat64Atomics, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderBufferFloat64AtomicAdd, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderSharedFloat32Atomics, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderSharedFloat32AtomicAdd, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderSharedFloat64Atomics, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderSharedFloat64AtomicAdd, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderImageFloat32Atomics, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderImageFloat32AtomicAdd, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->sparseImageFloat32Atomics, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->sparseImageFloat32AtomicAdd, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_EXT_host_query_reset
+#endif
+#ifdef VK_EXT_index_type_uint8
+void marshal_VkPhysicalDeviceIndexTypeUint8FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceIndexTypeUint8FeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->indexTypeUint8, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceIndexTypeUint8FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceIndexTypeUint8FeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->indexTypeUint8, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+void marshal_VkPhysicalDeviceExtendedDynamicStateFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->extendedDynamicState, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceExtendedDynamicStateFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceExtendedDynamicStateFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->extendedDynamicState, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_EXT_shader_atomic_float2
+void marshal_VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->shaderBufferFloat16Atomics, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderBufferFloat16AtomicAdd, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderBufferFloat16AtomicMinMax, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderBufferFloat32AtomicMinMax, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderBufferFloat64AtomicMinMax, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderSharedFloat16Atomics, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderSharedFloat16AtomicAdd, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderSharedFloat16AtomicMinMax, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderSharedFloat32AtomicMinMax, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderSharedFloat64AtomicMinMax, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->shaderImageFloat32AtomicMinMax, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->sparseImageFloat32AtomicMinMax, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderBufferFloat16Atomics, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderBufferFloat16AtomicAdd, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderBufferFloat16AtomicMinMax, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderBufferFloat32AtomicMinMax, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderBufferFloat64AtomicMinMax, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderSharedFloat16Atomics, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderSharedFloat16AtomicAdd, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderSharedFloat16AtomicMinMax, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderSharedFloat32AtomicMinMax, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderSharedFloat64AtomicMinMax, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderImageFloat32AtomicMinMax, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->sparseImageFloat32AtomicMinMax, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_EXT_shader_demote_to_helper_invocation
+void marshal_VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->shaderDemoteToHelperInvocation, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->shaderDemoteToHelperInvocation, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_NV_device_generated_commands
+void marshal_VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->maxGraphicsShaderGroupCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxIndirectSequenceCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxIndirectCommandsTokenCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxIndirectCommandsStreamCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxIndirectCommandsTokenOffset, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxIndirectCommandsStreamStride, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->minSequencesCountBufferOffsetAlignment,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->minSequencesIndexBufferOffsetAlignment,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->minIndirectCommandsBufferOffsetAlignment,
+                    sizeof(uint32_t));
+}
+
+void unmarshal_VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxGraphicsShaderGroupCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxIndirectSequenceCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxIndirectCommandsTokenCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxIndirectCommandsStreamCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxIndirectCommandsTokenOffset, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxIndirectCommandsStreamStride, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->minSequencesCountBufferOffsetAlignment,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->minSequencesIndexBufferOffsetAlignment,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->minIndirectCommandsBufferOffsetAlignment,
+                   sizeof(uint32_t));
+}
+
+void marshal_VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->deviceGeneratedCommands, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->deviceGeneratedCommands, sizeof(VkBool32));
+}
+
+void marshal_VkGraphicsShaderGroupCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkGraphicsShaderGroupCreateInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->stageCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->stageCount; ++i) {
+            marshal_VkPipelineShaderStageCreateInfo(
+                vkStream, rootType,
+                (const VkPipelineShaderStageCreateInfo*)(forMarshaling->pStages + i));
+        }
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pVertexInputState;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pVertexInputState) {
+        marshal_VkPipelineVertexInputStateCreateInfo(
+            vkStream, rootType,
+            (const VkPipelineVertexInputStateCreateInfo*)(forMarshaling->pVertexInputState));
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pTessellationState;
+    vkStream->putBe64(cgen_var_1);
+    if (forMarshaling->pTessellationState) {
+        marshal_VkPipelineTessellationStateCreateInfo(
+            vkStream, rootType,
+            (const VkPipelineTessellationStateCreateInfo*)(forMarshaling->pTessellationState));
+    }
+}
+
+void unmarshal_VkGraphicsShaderGroupCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkGraphicsShaderGroupCreateInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->stageCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->stageCount; ++i) {
+            unmarshal_VkPipelineShaderStageCreateInfo(
+                vkStream, rootType,
+                (VkPipelineShaderStageCreateInfo*)(forUnmarshaling->pStages + i));
+        }
+    }
+    // WARNING PTR CHECK
+    const VkPipelineVertexInputStateCreateInfo* check_pVertexInputState;
+    check_pVertexInputState =
+        (const VkPipelineVertexInputStateCreateInfo*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pVertexInputState) {
+        if (!(check_pVertexInputState)) {
+            fprintf(
+                stderr,
+                "fatal: forUnmarshaling->pVertexInputState inconsistent between guest and host\n");
+        }
+        unmarshal_VkPipelineVertexInputStateCreateInfo(
+            vkStream, rootType,
+            (VkPipelineVertexInputStateCreateInfo*)(forUnmarshaling->pVertexInputState));
+    }
+    // WARNING PTR CHECK
+    const VkPipelineTessellationStateCreateInfo* check_pTessellationState;
+    check_pTessellationState =
+        (const VkPipelineTessellationStateCreateInfo*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pTessellationState) {
+        if (!(check_pTessellationState)) {
+            fprintf(
+                stderr,
+                "fatal: forUnmarshaling->pTessellationState inconsistent between guest and host\n");
+        }
+        unmarshal_VkPipelineTessellationStateCreateInfo(
+            vkStream, rootType,
+            (VkPipelineTessellationStateCreateInfo*)(forUnmarshaling->pTessellationState));
+    }
+}
+
+void marshal_VkGraphicsPipelineShaderGroupsCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkGraphicsPipelineShaderGroupsCreateInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->groupCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->groupCount; ++i) {
+            marshal_VkGraphicsShaderGroupCreateInfoNV(
+                vkStream, rootType,
+                (const VkGraphicsShaderGroupCreateInfoNV*)(forMarshaling->pGroups + i));
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->pipelineCount, sizeof(uint32_t));
+    if (forMarshaling->pipelineCount) {
+        uint64_t* cgen_var_0;
+        vkStream->alloc((void**)&cgen_var_0, forMarshaling->pipelineCount * 8);
+        vkStream->handleMapping()->mapHandles_VkPipeline_u64(forMarshaling->pPipelines, cgen_var_0,
+                                                             forMarshaling->pipelineCount);
+        vkStream->write((uint64_t*)cgen_var_0, forMarshaling->pipelineCount * 8);
+    }
+}
+
+void unmarshal_VkGraphicsPipelineShaderGroupsCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkGraphicsPipelineShaderGroupsCreateInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->groupCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->groupCount; ++i) {
+            unmarshal_VkGraphicsShaderGroupCreateInfoNV(
+                vkStream, rootType,
+                (VkGraphicsShaderGroupCreateInfoNV*)(forUnmarshaling->pGroups + i));
+        }
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->pipelineCount, sizeof(uint32_t));
+    if (forUnmarshaling->pipelineCount) {
+        uint64_t* cgen_var_0;
+        vkStream->alloc((void**)&cgen_var_0, forUnmarshaling->pipelineCount * 8);
+        vkStream->read((uint64_t*)cgen_var_0, forUnmarshaling->pipelineCount * 8);
+        vkStream->handleMapping()->mapHandles_u64_VkPipeline(
+            cgen_var_0, (VkPipeline*)forUnmarshaling->pPipelines, forUnmarshaling->pipelineCount);
+    }
+}
+
+void marshal_VkBindShaderGroupIndirectCommandNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBindShaderGroupIndirectCommandNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->groupIndex, sizeof(uint32_t));
+}
+
+void unmarshal_VkBindShaderGroupIndirectCommandNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkBindShaderGroupIndirectCommandNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->groupIndex, sizeof(uint32_t));
+}
+
+void marshal_VkBindIndexBufferIndirectCommandNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBindIndexBufferIndirectCommandNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkDeviceAddress*)&forMarshaling->bufferAddress, sizeof(VkDeviceAddress));
+    vkStream->write((uint32_t*)&forMarshaling->size, sizeof(uint32_t));
+    vkStream->write((VkIndexType*)&forMarshaling->indexType, sizeof(VkIndexType));
+}
+
+void unmarshal_VkBindIndexBufferIndirectCommandNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkBindIndexBufferIndirectCommandNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkDeviceAddress*)&forUnmarshaling->bufferAddress, sizeof(VkDeviceAddress));
+    vkStream->read((uint32_t*)&forUnmarshaling->size, sizeof(uint32_t));
+    vkStream->read((VkIndexType*)&forUnmarshaling->indexType, sizeof(VkIndexType));
+}
+
+void marshal_VkBindVertexBufferIndirectCommandNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBindVertexBufferIndirectCommandNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkDeviceAddress*)&forMarshaling->bufferAddress, sizeof(VkDeviceAddress));
+    vkStream->write((uint32_t*)&forMarshaling->size, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->stride, sizeof(uint32_t));
+}
+
+void unmarshal_VkBindVertexBufferIndirectCommandNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkBindVertexBufferIndirectCommandNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkDeviceAddress*)&forUnmarshaling->bufferAddress, sizeof(VkDeviceAddress));
+    vkStream->read((uint32_t*)&forUnmarshaling->size, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->stride, sizeof(uint32_t));
+}
+
+void marshal_VkSetStateFlagsIndirectCommandNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSetStateFlagsIndirectCommandNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->data, sizeof(uint32_t));
+}
+
+void unmarshal_VkSetStateFlagsIndirectCommandNV(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkSetStateFlagsIndirectCommandNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->data, sizeof(uint32_t));
+}
+
+void marshal_VkIndirectCommandsStreamNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkIndirectCommandsStreamNV* forMarshaling) {
+    (void)rootType;
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkBuffer_u64(&forMarshaling->buffer, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkDeviceSize*)&forMarshaling->offset, sizeof(VkDeviceSize));
+}
+
+void unmarshal_VkIndirectCommandsStreamNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkIndirectCommandsStreamNV* forUnmarshaling) {
+    (void)rootType;
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_0,
+                                                       (VkBuffer*)&forUnmarshaling->buffer, 1);
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->offset, sizeof(VkDeviceSize));
+}
+
+void marshal_VkIndirectCommandsLayoutTokenNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkIndirectCommandsLayoutTokenNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkIndirectCommandsTokenTypeNV*)&forMarshaling->tokenType,
+                    sizeof(VkIndirectCommandsTokenTypeNV));
+    vkStream->write((uint32_t*)&forMarshaling->stream, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->offset, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->vertexBindingUnit, sizeof(uint32_t));
+    vkStream->write((VkBool32*)&forMarshaling->vertexDynamicStride, sizeof(VkBool32));
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkPipelineLayout_u64(
+        &forMarshaling->pushconstantPipelineLayout, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkShaderStageFlags*)&forMarshaling->pushconstantShaderStageFlags,
+                    sizeof(VkShaderStageFlags));
+    vkStream->write((uint32_t*)&forMarshaling->pushconstantOffset, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->pushconstantSize, sizeof(uint32_t));
+    vkStream->write((VkIndirectStateFlagsNV*)&forMarshaling->indirectStateFlags,
+                    sizeof(VkIndirectStateFlagsNV));
+    vkStream->write((uint32_t*)&forMarshaling->indexTypeCount, sizeof(uint32_t));
+    vkStream->write((const VkIndexType*)forMarshaling->pIndexTypes,
+                    forMarshaling->indexTypeCount * sizeof(const VkIndexType));
+    vkStream->write((const uint32_t*)forMarshaling->pIndexTypeValues,
+                    forMarshaling->indexTypeCount * sizeof(const uint32_t));
+}
+
+void unmarshal_VkIndirectCommandsLayoutTokenNV(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkIndirectCommandsLayoutTokenNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkIndirectCommandsTokenTypeNV*)&forUnmarshaling->tokenType,
+                   sizeof(VkIndirectCommandsTokenTypeNV));
+    vkStream->read((uint32_t*)&forUnmarshaling->stream, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->offset, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->vertexBindingUnit, sizeof(uint32_t));
+    vkStream->read((VkBool32*)&forUnmarshaling->vertexDynamicStride, sizeof(VkBool32));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkPipelineLayout(
+        &cgen_var_0, (VkPipelineLayout*)&forUnmarshaling->pushconstantPipelineLayout, 1);
+    vkStream->read((VkShaderStageFlags*)&forUnmarshaling->pushconstantShaderStageFlags,
+                   sizeof(VkShaderStageFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->pushconstantOffset, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->pushconstantSize, sizeof(uint32_t));
+    vkStream->read((VkIndirectStateFlagsNV*)&forUnmarshaling->indirectStateFlags,
+                   sizeof(VkIndirectStateFlagsNV));
+    vkStream->read((uint32_t*)&forUnmarshaling->indexTypeCount, sizeof(uint32_t));
+    vkStream->read((VkIndexType*)forUnmarshaling->pIndexTypes,
+                   forUnmarshaling->indexTypeCount * sizeof(const VkIndexType));
+    vkStream->read((uint32_t*)forUnmarshaling->pIndexTypeValues,
+                   forUnmarshaling->indexTypeCount * sizeof(const uint32_t));
+}
+
+void marshal_VkIndirectCommandsLayoutCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkIndirectCommandsLayoutCreateInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkIndirectCommandsLayoutUsageFlagsNV*)&forMarshaling->flags,
+                    sizeof(VkIndirectCommandsLayoutUsageFlagsNV));
+    vkStream->write((VkPipelineBindPoint*)&forMarshaling->pipelineBindPoint,
+                    sizeof(VkPipelineBindPoint));
+    vkStream->write((uint32_t*)&forMarshaling->tokenCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->tokenCount; ++i) {
+            marshal_VkIndirectCommandsLayoutTokenNV(
+                vkStream, rootType,
+                (const VkIndirectCommandsLayoutTokenNV*)(forMarshaling->pTokens + i));
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->streamCount, sizeof(uint32_t));
+    vkStream->write((const uint32_t*)forMarshaling->pStreamStrides,
+                    forMarshaling->streamCount * sizeof(const uint32_t));
+}
+
+void unmarshal_VkIndirectCommandsLayoutCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkIndirectCommandsLayoutCreateInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkIndirectCommandsLayoutUsageFlagsNV*)&forUnmarshaling->flags,
+                   sizeof(VkIndirectCommandsLayoutUsageFlagsNV));
+    vkStream->read((VkPipelineBindPoint*)&forUnmarshaling->pipelineBindPoint,
+                   sizeof(VkPipelineBindPoint));
+    vkStream->read((uint32_t*)&forUnmarshaling->tokenCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->tokenCount; ++i) {
+            unmarshal_VkIndirectCommandsLayoutTokenNV(
+                vkStream, rootType,
+                (VkIndirectCommandsLayoutTokenNV*)(forUnmarshaling->pTokens + i));
+        }
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->streamCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)forUnmarshaling->pStreamStrides,
+                   forUnmarshaling->streamCount * sizeof(const uint32_t));
+}
+
+void marshal_VkGeneratedCommandsInfoNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkGeneratedCommandsInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineBindPoint*)&forMarshaling->pipelineBindPoint,
+                    sizeof(VkPipelineBindPoint));
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkPipeline_u64(&forMarshaling->pipeline, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    uint64_t cgen_var_1;
+    vkStream->handleMapping()->mapHandles_VkIndirectCommandsLayoutNV_u64(
+        &forMarshaling->indirectCommandsLayout, &cgen_var_1, 1);
+    vkStream->write((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->write((uint32_t*)&forMarshaling->streamCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->streamCount; ++i) {
+            marshal_VkIndirectCommandsStreamNV(
+                vkStream, rootType,
+                (const VkIndirectCommandsStreamNV*)(forMarshaling->pStreams + i));
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->sequencesCount, sizeof(uint32_t));
+    uint64_t cgen_var_2;
+    vkStream->handleMapping()->mapHandles_VkBuffer_u64(&forMarshaling->preprocessBuffer,
+                                                       &cgen_var_2, 1);
+    vkStream->write((uint64_t*)&cgen_var_2, 1 * 8);
+    vkStream->write((VkDeviceSize*)&forMarshaling->preprocessOffset, sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->preprocessSize, sizeof(VkDeviceSize));
+    uint64_t cgen_var_3;
+    vkStream->handleMapping()->mapHandles_VkBuffer_u64(&forMarshaling->sequencesCountBuffer,
+                                                       &cgen_var_3, 1);
+    vkStream->write((uint64_t*)&cgen_var_3, 1 * 8);
+    vkStream->write((VkDeviceSize*)&forMarshaling->sequencesCountOffset, sizeof(VkDeviceSize));
+    uint64_t cgen_var_4;
+    vkStream->handleMapping()->mapHandles_VkBuffer_u64(&forMarshaling->sequencesIndexBuffer,
+                                                       &cgen_var_4, 1);
+    vkStream->write((uint64_t*)&cgen_var_4, 1 * 8);
+    vkStream->write((VkDeviceSize*)&forMarshaling->sequencesIndexOffset, sizeof(VkDeviceSize));
+}
+
+void unmarshal_VkGeneratedCommandsInfoNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkGeneratedCommandsInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineBindPoint*)&forUnmarshaling->pipelineBindPoint,
+                   sizeof(VkPipelineBindPoint));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkPipeline(
+        &cgen_var_0, (VkPipeline*)&forUnmarshaling->pipeline, 1);
+    uint64_t cgen_var_1;
+    vkStream->read((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkIndirectCommandsLayoutNV(
+        &cgen_var_1, (VkIndirectCommandsLayoutNV*)&forUnmarshaling->indirectCommandsLayout, 1);
+    vkStream->read((uint32_t*)&forUnmarshaling->streamCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->streamCount; ++i) {
+            unmarshal_VkIndirectCommandsStreamNV(
+                vkStream, rootType, (VkIndirectCommandsStreamNV*)(forUnmarshaling->pStreams + i));
+        }
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->sequencesCount, sizeof(uint32_t));
+    uint64_t cgen_var_2;
+    vkStream->read((uint64_t*)&cgen_var_2, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkBuffer(
+        &cgen_var_2, (VkBuffer*)&forUnmarshaling->preprocessBuffer, 1);
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->preprocessOffset, sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->preprocessSize, sizeof(VkDeviceSize));
+    uint64_t cgen_var_3;
+    vkStream->read((uint64_t*)&cgen_var_3, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkBuffer(
+        &cgen_var_3, (VkBuffer*)&forUnmarshaling->sequencesCountBuffer, 1);
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->sequencesCountOffset, sizeof(VkDeviceSize));
+    uint64_t cgen_var_4;
+    vkStream->read((uint64_t*)&cgen_var_4, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkBuffer(
+        &cgen_var_4, (VkBuffer*)&forUnmarshaling->sequencesIndexBuffer, 1);
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->sequencesIndexOffset, sizeof(VkDeviceSize));
+}
+
+void marshal_VkGeneratedCommandsMemoryRequirementsInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkGeneratedCommandsMemoryRequirementsInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineBindPoint*)&forMarshaling->pipelineBindPoint,
+                    sizeof(VkPipelineBindPoint));
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkPipeline_u64(&forMarshaling->pipeline, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    uint64_t cgen_var_1;
+    vkStream->handleMapping()->mapHandles_VkIndirectCommandsLayoutNV_u64(
+        &forMarshaling->indirectCommandsLayout, &cgen_var_1, 1);
+    vkStream->write((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->write((uint32_t*)&forMarshaling->maxSequencesCount, sizeof(uint32_t));
+}
+
+void unmarshal_VkGeneratedCommandsMemoryRequirementsInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkGeneratedCommandsMemoryRequirementsInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineBindPoint*)&forUnmarshaling->pipelineBindPoint,
+                   sizeof(VkPipelineBindPoint));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkPipeline(
+        &cgen_var_0, (VkPipeline*)&forUnmarshaling->pipeline, 1);
+    uint64_t cgen_var_1;
+    vkStream->read((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkIndirectCommandsLayoutNV(
+        &cgen_var_1, (VkIndirectCommandsLayoutNV*)&forUnmarshaling->indirectCommandsLayout, 1);
+    vkStream->read((uint32_t*)&forUnmarshaling->maxSequencesCount, sizeof(uint32_t));
+}
+
+#endif
+#ifdef VK_NV_inherited_viewport_scissor
+void marshal_VkPhysicalDeviceInheritedViewportScissorFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceInheritedViewportScissorFeaturesNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->inheritedViewportScissor2D, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceInheritedViewportScissorFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceInheritedViewportScissorFeaturesNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->inheritedViewportScissor2D, sizeof(VkBool32));
+}
+
+void marshal_VkCommandBufferInheritanceViewportScissorInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCommandBufferInheritanceViewportScissorInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->viewportScissor2D, sizeof(VkBool32));
+    vkStream->write((uint32_t*)&forMarshaling->viewportDepthCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pViewportDepths;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pViewportDepths) {
+        marshal_VkViewport(vkStream, rootType, (const VkViewport*)(forMarshaling->pViewportDepths));
+    }
+}
+
+void unmarshal_VkCommandBufferInheritanceViewportScissorInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkCommandBufferInheritanceViewportScissorInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->viewportScissor2D, sizeof(VkBool32));
+    vkStream->read((uint32_t*)&forUnmarshaling->viewportDepthCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const VkViewport* check_pViewportDepths;
+    check_pViewportDepths = (const VkViewport*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pViewportDepths) {
+        if (!(check_pViewportDepths)) {
+            fprintf(
+                stderr,
+                "fatal: forUnmarshaling->pViewportDepths inconsistent between guest and host\n");
+        }
+        unmarshal_VkViewport(vkStream, rootType, (VkViewport*)(forUnmarshaling->pViewportDepths));
+    }
+}
+
+#endif
+#ifdef VK_EXT_texel_buffer_alignment
+void marshal_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->texelBufferAlignment, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->texelBufferAlignment, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDeviceSize*)&forMarshaling->storageTexelBufferOffsetAlignmentBytes,
+                    sizeof(VkDeviceSize));
+    vkStream->write((VkBool32*)&forMarshaling->storageTexelBufferOffsetSingleTexelAlignment,
+                    sizeof(VkBool32));
+    vkStream->write((VkDeviceSize*)&forMarshaling->uniformTexelBufferOffsetAlignmentBytes,
+                    sizeof(VkDeviceSize));
+    vkStream->write((VkBool32*)&forMarshaling->uniformTexelBufferOffsetSingleTexelAlignment,
+                    sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->storageTexelBufferOffsetAlignmentBytes,
+                   sizeof(VkDeviceSize));
+    vkStream->read((VkBool32*)&forUnmarshaling->storageTexelBufferOffsetSingleTexelAlignment,
+                   sizeof(VkBool32));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->uniformTexelBufferOffsetAlignmentBytes,
+                   sizeof(VkDeviceSize));
+    vkStream->read((VkBool32*)&forUnmarshaling->uniformTexelBufferOffsetSingleTexelAlignment,
+                   sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_QCOM_render_pass_transform
+void marshal_VkRenderPassTransformBeginInfoQCOM(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRenderPassTransformBeginInfoQCOM* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkSurfaceTransformFlagBitsKHR*)&forMarshaling->transform,
+                    sizeof(VkSurfaceTransformFlagBitsKHR));
+}
+
+void unmarshal_VkRenderPassTransformBeginInfoQCOM(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkRenderPassTransformBeginInfoQCOM* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkSurfaceTransformFlagBitsKHR*)&forUnmarshaling->transform,
+                   sizeof(VkSurfaceTransformFlagBitsKHR));
+}
+
+void marshal_VkCommandBufferInheritanceRenderPassTransformInfoQCOM(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCommandBufferInheritanceRenderPassTransformInfoQCOM* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkSurfaceTransformFlagBitsKHR*)&forMarshaling->transform,
+                    sizeof(VkSurfaceTransformFlagBitsKHR));
+    marshal_VkRect2D(vkStream, rootType, (VkRect2D*)(&forMarshaling->renderArea));
+}
+
+void unmarshal_VkCommandBufferInheritanceRenderPassTransformInfoQCOM(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkCommandBufferInheritanceRenderPassTransformInfoQCOM* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkSurfaceTransformFlagBitsKHR*)&forUnmarshaling->transform,
+                   sizeof(VkSurfaceTransformFlagBitsKHR));
+    unmarshal_VkRect2D(vkStream, rootType, (VkRect2D*)(&forUnmarshaling->renderArea));
+}
+
+#endif
+#ifdef VK_EXT_device_memory_report
+void marshal_VkPhysicalDeviceDeviceMemoryReportFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDeviceMemoryReportFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->deviceMemoryReport, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceDeviceMemoryReportFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceDeviceMemoryReportFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->deviceMemoryReport, sizeof(VkBool32));
+}
+
+void marshal_VkDeviceMemoryReportCallbackDataEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceMemoryReportCallbackDataEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDeviceMemoryReportFlagsEXT*)&forMarshaling->flags,
+                    sizeof(VkDeviceMemoryReportFlagsEXT));
+    vkStream->write((VkDeviceMemoryReportEventTypeEXT*)&forMarshaling->type,
+                    sizeof(VkDeviceMemoryReportEventTypeEXT));
+    vkStream->write((uint64_t*)&forMarshaling->memoryObjectId, sizeof(uint64_t));
+    vkStream->write((VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
+    vkStream->write((VkObjectType*)&forMarshaling->objectType, sizeof(VkObjectType));
+    vkStream->write((uint64_t*)&forMarshaling->objectHandle, sizeof(uint64_t));
+    vkStream->write((uint32_t*)&forMarshaling->heapIndex, sizeof(uint32_t));
+}
+
+void unmarshal_VkDeviceMemoryReportCallbackDataEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDeviceMemoryReportCallbackDataEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDeviceMemoryReportFlagsEXT*)&forUnmarshaling->flags,
+                   sizeof(VkDeviceMemoryReportFlagsEXT));
+    vkStream->read((VkDeviceMemoryReportEventTypeEXT*)&forUnmarshaling->type,
+                   sizeof(VkDeviceMemoryReportEventTypeEXT));
+    vkStream->read((uint64_t*)&forUnmarshaling->memoryObjectId, sizeof(uint64_t));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->size, sizeof(VkDeviceSize));
+    vkStream->read((VkObjectType*)&forUnmarshaling->objectType, sizeof(VkObjectType));
+    vkStream->read((uint64_t*)&forUnmarshaling->objectHandle, sizeof(uint64_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->heapIndex, sizeof(uint32_t));
+}
+
+void marshal_VkDeviceDeviceMemoryReportCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceDeviceMemoryReportCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDeviceMemoryReportFlagsEXT*)&forMarshaling->flags,
+                    sizeof(VkDeviceMemoryReportFlagsEXT));
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->pfnUserCallback;
+    vkStream->putBe64(cgen_var_0);
+    vkStream->write((void*)forMarshaling->pUserData, sizeof(uint8_t));
+}
+
+void unmarshal_VkDeviceDeviceMemoryReportCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDeviceDeviceMemoryReportCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDeviceMemoryReportFlagsEXT*)&forUnmarshaling->flags,
+                   sizeof(VkDeviceMemoryReportFlagsEXT));
+    forUnmarshaling->pfnUserCallback = (PFN_vkDeviceMemoryReportCallbackEXT)vkStream->getBe64();
+    vkStream->read((void*)forUnmarshaling->pUserData, sizeof(uint8_t));
+}
+
+#endif
+#ifdef VK_EXT_acquire_drm_display
+#endif
+#ifdef VK_EXT_robustness2
+void marshal_VkPhysicalDeviceRobustness2FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRobustness2FeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->robustBufferAccess2, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->robustImageAccess2, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->nullDescriptor, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceRobustness2FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceRobustness2FeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->robustBufferAccess2, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->robustImageAccess2, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->nullDescriptor, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceRobustness2PropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRobustness2PropertiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDeviceSize*)&forMarshaling->robustStorageBufferAccessSizeAlignment,
+                    sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->robustUniformBufferAccessSizeAlignment,
+                    sizeof(VkDeviceSize));
+}
+
+void unmarshal_VkPhysicalDeviceRobustness2PropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceRobustness2PropertiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->robustStorageBufferAccessSizeAlignment,
+                   sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->robustUniformBufferAccessSizeAlignment,
+                   sizeof(VkDeviceSize));
+}
+
+#endif
+#ifdef VK_EXT_custom_border_color
+void marshal_VkSamplerCustomBorderColorCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSamplerCustomBorderColorCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkClearColorValue(vkStream, rootType,
+                              (VkClearColorValue*)(&forMarshaling->customBorderColor));
+    vkStream->write((VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+}
+
+void unmarshal_VkSamplerCustomBorderColorCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkSamplerCustomBorderColorCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkClearColorValue(vkStream, rootType,
+                                (VkClearColorValue*)(&forUnmarshaling->customBorderColor));
+    vkStream->read((VkFormat*)&forUnmarshaling->format, sizeof(VkFormat));
+}
+
+void marshal_VkPhysicalDeviceCustomBorderColorPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceCustomBorderColorPropertiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->maxCustomBorderColorSamplers, sizeof(uint32_t));
+}
+
+void unmarshal_VkPhysicalDeviceCustomBorderColorPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceCustomBorderColorPropertiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxCustomBorderColorSamplers, sizeof(uint32_t));
+}
+
+void marshal_VkPhysicalDeviceCustomBorderColorFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceCustomBorderColorFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->customBorderColors, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->customBorderColorWithoutFormat, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceCustomBorderColorFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceCustomBorderColorFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->customBorderColors, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->customBorderColorWithoutFormat, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_GOOGLE_user_type
+#endif
+#ifdef VK_EXT_private_data
+void marshal_VkPhysicalDevicePrivateDataFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePrivateDataFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->privateData, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDevicePrivateDataFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevicePrivateDataFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->privateData, sizeof(VkBool32));
+}
+
+void marshal_VkDevicePrivateDataCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDevicePrivateDataCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->privateDataSlotRequestCount, sizeof(uint32_t));
+}
+
+void unmarshal_VkDevicePrivateDataCreateInfoEXT(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkDevicePrivateDataCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->privateDataSlotRequestCount, sizeof(uint32_t));
+}
+
+void marshal_VkPrivateDataSlotCreateInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkPrivateDataSlotCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPrivateDataSlotCreateFlagsEXT*)&forMarshaling->flags,
+                    sizeof(VkPrivateDataSlotCreateFlagsEXT));
+}
+
+void unmarshal_VkPrivateDataSlotCreateInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkPrivateDataSlotCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPrivateDataSlotCreateFlagsEXT*)&forUnmarshaling->flags,
+                   sizeof(VkPrivateDataSlotCreateFlagsEXT));
+}
+
+#endif
+#ifdef VK_EXT_pipeline_creation_cache_control
+void marshal_VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->pipelineCreationCacheControl, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->pipelineCreationCacheControl, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_NV_device_diagnostics_config
+void marshal_VkPhysicalDeviceDiagnosticsConfigFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDiagnosticsConfigFeaturesNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->diagnosticsConfig, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceDiagnosticsConfigFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceDiagnosticsConfigFeaturesNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->diagnosticsConfig, sizeof(VkBool32));
+}
+
+void marshal_VkDeviceDiagnosticsConfigCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceDiagnosticsConfigCreateInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDeviceDiagnosticsConfigFlagsNV*)&forMarshaling->flags,
+                    sizeof(VkDeviceDiagnosticsConfigFlagsNV));
+}
+
+void unmarshal_VkDeviceDiagnosticsConfigCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDeviceDiagnosticsConfigCreateInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDeviceDiagnosticsConfigFlagsNV*)&forUnmarshaling->flags,
+                   sizeof(VkDeviceDiagnosticsConfigFlagsNV));
+}
+
+#endif
+#ifdef VK_QCOM_render_pass_store_ops
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+void marshal_VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->fragmentShadingRateEnums, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->supersampleFragmentShadingRates, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->noInvocationFragmentShadingRates, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->fragmentShadingRateEnums, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->supersampleFragmentShadingRates, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->noInvocationFragmentShadingRates, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkSampleCountFlagBits*)&forMarshaling->maxFragmentShadingRateInvocationCount,
+                    sizeof(VkSampleCountFlagBits));
+}
+
+void unmarshal_VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkSampleCountFlagBits*)&forUnmarshaling->maxFragmentShadingRateInvocationCount,
+                   sizeof(VkSampleCountFlagBits));
+}
+
+void marshal_VkPipelineFragmentShadingRateEnumStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineFragmentShadingRateEnumStateCreateInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkFragmentShadingRateTypeNV*)&forMarshaling->shadingRateType,
+                    sizeof(VkFragmentShadingRateTypeNV));
+    vkStream->write((VkFragmentShadingRateNV*)&forMarshaling->shadingRate,
+                    sizeof(VkFragmentShadingRateNV));
+    vkStream->write((VkFragmentShadingRateCombinerOpKHR*)forMarshaling->combinerOps,
+                    2 * sizeof(VkFragmentShadingRateCombinerOpKHR));
+}
+
+void unmarshal_VkPipelineFragmentShadingRateEnumStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineFragmentShadingRateEnumStateCreateInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkFragmentShadingRateTypeNV*)&forUnmarshaling->shadingRateType,
+                   sizeof(VkFragmentShadingRateTypeNV));
+    vkStream->read((VkFragmentShadingRateNV*)&forUnmarshaling->shadingRate,
+                   sizeof(VkFragmentShadingRateNV));
+    vkStream->read((VkFragmentShadingRateCombinerOpKHR*)forUnmarshaling->combinerOps,
+                   2 * sizeof(VkFragmentShadingRateCombinerOpKHR));
+}
+
+#endif
+#ifdef VK_NV_ray_tracing_motion_blur
+void marshal_VkDeviceOrHostAddressConstKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkDeviceOrHostAddressConstKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkDeviceAddress*)&forMarshaling->deviceAddress, sizeof(VkDeviceAddress));
+}
+
+void unmarshal_VkDeviceOrHostAddressConstKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkDeviceOrHostAddressConstKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkDeviceAddress*)&forUnmarshaling->deviceAddress, sizeof(VkDeviceAddress));
+}
+
+void marshal_VkAccelerationStructureGeometryMotionTrianglesDataNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureGeometryMotionTrianglesDataNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkDeviceOrHostAddressConstKHR(
+        vkStream, rootType, (VkDeviceOrHostAddressConstKHR*)(&forMarshaling->vertexData));
+}
+
+void unmarshal_VkAccelerationStructureGeometryMotionTrianglesDataNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureGeometryMotionTrianglesDataNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkDeviceOrHostAddressConstKHR(
+        vkStream, rootType, (VkDeviceOrHostAddressConstKHR*)(&forUnmarshaling->vertexData));
+}
+
+void marshal_VkAccelerationStructureMotionInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureMotionInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->maxInstances, sizeof(uint32_t));
+    vkStream->write((VkAccelerationStructureMotionInfoFlagsNV*)&forMarshaling->flags,
+                    sizeof(VkAccelerationStructureMotionInfoFlagsNV));
+}
+
+void unmarshal_VkAccelerationStructureMotionInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureMotionInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxInstances, sizeof(uint32_t));
+    vkStream->read((VkAccelerationStructureMotionInfoFlagsNV*)&forUnmarshaling->flags,
+                   sizeof(VkAccelerationStructureMotionInfoFlagsNV));
+}
+
+void marshal_VkAccelerationStructureMatrixMotionInstanceNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureMatrixMotionInstanceNV* forMarshaling) {
+    (void)rootType;
+
+    typedef struct VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields {
+        VkTransformMatrixKHR transformT0;
+        VkTransformMatrixKHR transformT1;
+        uint32_t dwords[2];
+        uint64_t accelerationStructureReference;
+    } VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields;
+
+    const VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields* forMarshaling_new =
+        (const VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields*)(forMarshaling);
+    marshal_VkTransformMatrixKHR(vkStream, rootType,
+                                 (VkTransformMatrixKHR*)(&forMarshaling_new->transformT0));
+    marshal_VkTransformMatrixKHR(vkStream, rootType,
+                                 (VkTransformMatrixKHR*)(&forMarshaling_new->transformT1));
+    for (uint32_t i = 0; i < 2; i++) {
+        vkStream->write((uint32_t*)&(forMarshaling_new->dwords[i]), sizeof(uint32_t));
+    }
+    vkStream->write((uint64_t*)&forMarshaling_new->accelerationStructureReference,
+                    sizeof(uint64_t));
+}
+
+void unmarshal_VkAccelerationStructureMatrixMotionInstanceNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureMatrixMotionInstanceNV* forUnmarshaling) {
+    (void)rootType;
+
+    typedef struct VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields {
+        VkTransformMatrixKHR transformT0;
+        VkTransformMatrixKHR transformT1;
+        uint32_t dwords[2];
+        uint64_t accelerationStructureReference;
+    } VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields;
+
+    VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields* forUnmarshaling_new =
+        (VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields*)(forUnmarshaling);
+    unmarshal_VkTransformMatrixKHR(vkStream, rootType,
+                                   (VkTransformMatrixKHR*)(&forUnmarshaling_new->transformT0));
+    unmarshal_VkTransformMatrixKHR(vkStream, rootType,
+                                   (VkTransformMatrixKHR*)(&forUnmarshaling_new->transformT1));
+    for (uint32_t i = 0; i < 2; i++) {
+        vkStream->read((uint32_t*)&(forUnmarshaling_new->dwords[i]), sizeof(uint32_t));
+    }
+    vkStream->read((uint64_t*)&forUnmarshaling_new->accelerationStructureReference,
+                   sizeof(uint64_t));
+}
+
+void marshal_VkSRTDataNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                         const VkSRTDataNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((float*)&forMarshaling->sx, sizeof(float));
+    vkStream->write((float*)&forMarshaling->a, sizeof(float));
+    vkStream->write((float*)&forMarshaling->b, sizeof(float));
+    vkStream->write((float*)&forMarshaling->pvx, sizeof(float));
+    vkStream->write((float*)&forMarshaling->sy, sizeof(float));
+    vkStream->write((float*)&forMarshaling->c, sizeof(float));
+    vkStream->write((float*)&forMarshaling->pvy, sizeof(float));
+    vkStream->write((float*)&forMarshaling->sz, sizeof(float));
+    vkStream->write((float*)&forMarshaling->pvz, sizeof(float));
+    vkStream->write((float*)&forMarshaling->qx, sizeof(float));
+    vkStream->write((float*)&forMarshaling->qy, sizeof(float));
+    vkStream->write((float*)&forMarshaling->qz, sizeof(float));
+    vkStream->write((float*)&forMarshaling->qw, sizeof(float));
+    vkStream->write((float*)&forMarshaling->tx, sizeof(float));
+    vkStream->write((float*)&forMarshaling->ty, sizeof(float));
+    vkStream->write((float*)&forMarshaling->tz, sizeof(float));
+}
+
+void unmarshal_VkSRTDataNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                           VkSRTDataNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((float*)&forUnmarshaling->sx, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->a, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->b, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->pvx, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->sy, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->c, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->pvy, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->sz, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->pvz, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->qx, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->qy, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->qz, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->qw, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->tx, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->ty, sizeof(float));
+    vkStream->read((float*)&forUnmarshaling->tz, sizeof(float));
+}
+
+void marshal_VkAccelerationStructureSRTMotionInstanceNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureSRTMotionInstanceNV* forMarshaling) {
+    (void)rootType;
+
+    typedef struct VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields {
+        VkSRTDataNV transformT0;
+        VkSRTDataNV transformT1;
+        uint32_t dwords[2];
+        uint64_t accelerationStructureReference;
+    } VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields;
+
+    const VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields* forMarshaling_new =
+        (const VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields*)(forMarshaling);
+    marshal_VkSRTDataNV(vkStream, rootType, (VkSRTDataNV*)(&forMarshaling_new->transformT0));
+    marshal_VkSRTDataNV(vkStream, rootType, (VkSRTDataNV*)(&forMarshaling_new->transformT1));
+    for (uint32_t i = 0; i < 2; i++) {
+        vkStream->write((uint32_t*)&(forMarshaling_new->dwords[i]), sizeof(uint32_t));
+    }
+    vkStream->write((uint64_t*)&forMarshaling_new->accelerationStructureReference,
+                    sizeof(uint64_t));
+}
+
+void unmarshal_VkAccelerationStructureSRTMotionInstanceNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureSRTMotionInstanceNV* forUnmarshaling) {
+    (void)rootType;
+
+    typedef struct VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields {
+        VkSRTDataNV transformT0;
+        VkSRTDataNV transformT1;
+        uint32_t dwords[2];
+        uint64_t accelerationStructureReference;
+    } VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields;
+
+    VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields* forUnmarshaling_new =
+        (VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields*)(forUnmarshaling);
+    unmarshal_VkSRTDataNV(vkStream, rootType, (VkSRTDataNV*)(&forUnmarshaling_new->transformT0));
+    unmarshal_VkSRTDataNV(vkStream, rootType, (VkSRTDataNV*)(&forUnmarshaling_new->transformT1));
+    for (uint32_t i = 0; i < 2; i++) {
+        vkStream->read((uint32_t*)&(forUnmarshaling_new->dwords[i]), sizeof(uint32_t));
+    }
+    vkStream->read((uint64_t*)&forUnmarshaling_new->accelerationStructureReference,
+                   sizeof(uint64_t));
+}
+
+void marshal_VkAccelerationStructureMotionInstanceDataNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureMotionInstanceDataNV* forMarshaling) {
+    (void)rootType;
+    marshal_VkAccelerationStructureInstanceKHR(
+        vkStream, rootType, (VkAccelerationStructureInstanceKHR*)(&forMarshaling->staticInstance));
+}
+
+void unmarshal_VkAccelerationStructureMotionInstanceDataNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureMotionInstanceDataNV* forUnmarshaling) {
+    (void)rootType;
+    unmarshal_VkAccelerationStructureInstanceKHR(
+        vkStream, rootType,
+        (VkAccelerationStructureInstanceKHR*)(&forUnmarshaling->staticInstance));
+}
+
+void marshal_VkAccelerationStructureMotionInstanceNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureMotionInstanceNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkAccelerationStructureMotionInstanceTypeNV*)&forMarshaling->type,
+                    sizeof(VkAccelerationStructureMotionInstanceTypeNV));
+    vkStream->write((VkAccelerationStructureMotionInstanceFlagsNV*)&forMarshaling->flags,
+                    sizeof(VkAccelerationStructureMotionInstanceFlagsNV));
+    marshal_VkAccelerationStructureMotionInstanceDataNV(
+        vkStream, rootType, (VkAccelerationStructureMotionInstanceDataNV*)(&forMarshaling->data));
+}
+
+void unmarshal_VkAccelerationStructureMotionInstanceNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureMotionInstanceNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkAccelerationStructureMotionInstanceTypeNV*)&forUnmarshaling->type,
+                   sizeof(VkAccelerationStructureMotionInstanceTypeNV));
+    vkStream->read((VkAccelerationStructureMotionInstanceFlagsNV*)&forUnmarshaling->flags,
+                   sizeof(VkAccelerationStructureMotionInstanceFlagsNV));
+    unmarshal_VkAccelerationStructureMotionInstanceDataNV(
+        vkStream, rootType, (VkAccelerationStructureMotionInstanceDataNV*)(&forUnmarshaling->data));
+}
+
+void marshal_VkPhysicalDeviceRayTracingMotionBlurFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingMotionBlurFeaturesNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->rayTracingMotionBlur, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->rayTracingMotionBlurPipelineTraceRaysIndirect,
+                    sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceRayTracingMotionBlurFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceRayTracingMotionBlurFeaturesNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->rayTracingMotionBlur, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->rayTracingMotionBlurPipelineTraceRaysIndirect,
+                   sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_EXT_ycbcr_2plane_444_formats
+void marshal_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->ycbcr2plane444Formats, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->ycbcr2plane444Formats, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_EXT_fragment_density_map2
+void marshal_VkPhysicalDeviceFragmentDensityMap2FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->fragmentDensityMapDeferred, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceFragmentDensityMap2FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceFragmentDensityMap2FeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->fragmentDensityMapDeferred, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceFragmentDensityMap2PropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMap2PropertiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->subsampledLoads, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->subsampledCoarseReconstructionEarlyAccess,
+                    sizeof(VkBool32));
+    vkStream->write((uint32_t*)&forMarshaling->maxSubsampledArrayLayers, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetSubsampledSamplers,
+                    sizeof(uint32_t));
+}
+
+void unmarshal_VkPhysicalDeviceFragmentDensityMap2PropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceFragmentDensityMap2PropertiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->subsampledLoads, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->subsampledCoarseReconstructionEarlyAccess,
+                   sizeof(VkBool32));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxSubsampledArrayLayers, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetSubsampledSamplers,
+                   sizeof(uint32_t));
+}
+
+#endif
+#ifdef VK_QCOM_rotated_copy_commands
+void marshal_VkCopyCommandTransformInfoQCOM(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkCopyCommandTransformInfoQCOM* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkSurfaceTransformFlagBitsKHR*)&forMarshaling->transform,
+                    sizeof(VkSurfaceTransformFlagBitsKHR));
+}
+
+void unmarshal_VkCopyCommandTransformInfoQCOM(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkCopyCommandTransformInfoQCOM* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkSurfaceTransformFlagBitsKHR*)&forUnmarshaling->transform,
+                   sizeof(VkSurfaceTransformFlagBitsKHR));
+}
+
+#endif
+#ifdef VK_EXT_image_robustness
+void marshal_VkPhysicalDeviceImageRobustnessFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceImageRobustnessFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->robustImageAccess, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceImageRobustnessFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceImageRobustnessFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->robustImageAccess, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_EXT_4444_formats
+void marshal_VkPhysicalDevice4444FormatsFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevice4444FormatsFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->formatA4R4G4B4, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->formatA4B4G4R4, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDevice4444FormatsFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevice4444FormatsFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->formatA4R4G4B4, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->formatA4B4G4R4, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_EXT_rgba10x6_formats
+void marshal_VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->formatRgba10x6WithoutYCbCrSampler, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->formatRgba10x6WithoutYCbCrSampler,
+                   sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_NV_acquire_winrt_display
+#endif
+#ifdef VK_EXT_directfb_surface
+void marshal_VkDirectFBSurfaceCreateInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkDirectFBSurfaceCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDirectFBSurfaceCreateFlagsEXT*)&forMarshaling->flags,
+                    sizeof(VkDirectFBSurfaceCreateFlagsEXT));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->dfb;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->dfb) {
+        vkStream->write((IDirectFB*)forMarshaling->dfb, sizeof(IDirectFB));
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->surface;
+    vkStream->putBe64(cgen_var_1);
+    if (forMarshaling->surface) {
+        vkStream->write((IDirectFBSurface*)forMarshaling->surface, sizeof(IDirectFBSurface));
+    }
+}
+
+void unmarshal_VkDirectFBSurfaceCreateInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkDirectFBSurfaceCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDirectFBSurfaceCreateFlagsEXT*)&forUnmarshaling->flags,
+                   sizeof(VkDirectFBSurfaceCreateFlagsEXT));
+    // WARNING PTR CHECK
+    IDirectFB* check_dfb;
+    check_dfb = (IDirectFB*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->dfb) {
+        if (!(check_dfb)) {
+            fprintf(stderr, "fatal: forUnmarshaling->dfb inconsistent between guest and host\n");
+        }
+        vkStream->read((IDirectFB*)forUnmarshaling->dfb, sizeof(IDirectFB));
+    }
+    // WARNING PTR CHECK
+    IDirectFBSurface* check_surface;
+    check_surface = (IDirectFBSurface*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->surface) {
+        if (!(check_surface)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->surface inconsistent between guest and host\n");
+        }
+        vkStream->read((IDirectFBSurface*)forUnmarshaling->surface, sizeof(IDirectFBSurface));
+    }
+}
+
+#endif
+#ifdef VK_VALVE_mutable_descriptor_type
+void marshal_VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->mutableDescriptorType, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->mutableDescriptorType, sizeof(VkBool32));
+}
+
+void marshal_VkMutableDescriptorTypeListVALVE(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMutableDescriptorTypeListVALVE* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->descriptorTypeCount, sizeof(uint32_t));
+    vkStream->write((const VkDescriptorType*)forMarshaling->pDescriptorTypes,
+                    forMarshaling->descriptorTypeCount * sizeof(const VkDescriptorType));
+}
+
+void unmarshal_VkMutableDescriptorTypeListVALVE(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkMutableDescriptorTypeListVALVE* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->descriptorTypeCount, sizeof(uint32_t));
+    vkStream->read((VkDescriptorType*)forUnmarshaling->pDescriptorTypes,
+                   forUnmarshaling->descriptorTypeCount * sizeof(const VkDescriptorType));
+}
+
+void marshal_VkMutableDescriptorTypeCreateInfoVALVE(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMutableDescriptorTypeCreateInfoVALVE* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->mutableDescriptorTypeListCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->mutableDescriptorTypeListCount; ++i) {
+            marshal_VkMutableDescriptorTypeListVALVE(
+                vkStream, rootType,
+                (const VkMutableDescriptorTypeListVALVE*)(forMarshaling
+                                                              ->pMutableDescriptorTypeLists +
+                                                          i));
+        }
+    }
+}
+
+void unmarshal_VkMutableDescriptorTypeCreateInfoVALVE(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkMutableDescriptorTypeCreateInfoVALVE* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->mutableDescriptorTypeListCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->mutableDescriptorTypeListCount; ++i) {
+            unmarshal_VkMutableDescriptorTypeListVALVE(
+                vkStream, rootType,
+                (VkMutableDescriptorTypeListVALVE*)(forUnmarshaling->pMutableDescriptorTypeLists +
+                                                    i));
+        }
+    }
+}
+
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+void marshal_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->vertexInputDynamicState, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->vertexInputDynamicState, sizeof(VkBool32));
+}
+
+void marshal_VkVertexInputBindingDescription2EXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVertexInputBindingDescription2EXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->binding, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->stride, sizeof(uint32_t));
+    vkStream->write((VkVertexInputRate*)&forMarshaling->inputRate, sizeof(VkVertexInputRate));
+    vkStream->write((uint32_t*)&forMarshaling->divisor, sizeof(uint32_t));
+}
+
+void unmarshal_VkVertexInputBindingDescription2EXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVertexInputBindingDescription2EXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->binding, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->stride, sizeof(uint32_t));
+    vkStream->read((VkVertexInputRate*)&forUnmarshaling->inputRate, sizeof(VkVertexInputRate));
+    vkStream->read((uint32_t*)&forUnmarshaling->divisor, sizeof(uint32_t));
+}
+
+void marshal_VkVertexInputAttributeDescription2EXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVertexInputAttributeDescription2EXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->location, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->binding, sizeof(uint32_t));
+    vkStream->write((VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+    vkStream->write((uint32_t*)&forMarshaling->offset, sizeof(uint32_t));
+}
+
+void unmarshal_VkVertexInputAttributeDescription2EXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVertexInputAttributeDescription2EXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->location, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->binding, sizeof(uint32_t));
+    vkStream->read((VkFormat*)&forUnmarshaling->format, sizeof(VkFormat));
+    vkStream->read((uint32_t*)&forUnmarshaling->offset, sizeof(uint32_t));
+}
+
+#endif
+#ifdef VK_EXT_physical_device_drm
+void marshal_VkPhysicalDeviceDrmPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDrmPropertiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->hasPrimary, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->hasRender, sizeof(VkBool32));
+    vkStream->write((int64_t*)&forMarshaling->primaryMajor, sizeof(int64_t));
+    vkStream->write((int64_t*)&forMarshaling->primaryMinor, sizeof(int64_t));
+    vkStream->write((int64_t*)&forMarshaling->renderMajor, sizeof(int64_t));
+    vkStream->write((int64_t*)&forMarshaling->renderMinor, sizeof(int64_t));
+}
+
+void unmarshal_VkPhysicalDeviceDrmPropertiesEXT(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkPhysicalDeviceDrmPropertiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->hasPrimary, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->hasRender, sizeof(VkBool32));
+    vkStream->read((int64_t*)&forUnmarshaling->primaryMajor, sizeof(int64_t));
+    vkStream->read((int64_t*)&forUnmarshaling->primaryMinor, sizeof(int64_t));
+    vkStream->read((int64_t*)&forUnmarshaling->renderMajor, sizeof(int64_t));
+    vkStream->read((int64_t*)&forUnmarshaling->renderMinor, sizeof(int64_t));
+}
+
+#endif
+#ifdef VK_EXT_primitive_topology_list_restart
+void marshal_VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->primitiveTopologyListRestart, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->primitiveTopologyPatchListRestart, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->primitiveTopologyListRestart, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->primitiveTopologyPatchListRestart,
+                   sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_FUCHSIA_external_memory
+void marshal_VkImportMemoryZirconHandleInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportMemoryZirconHandleInfoFUCHSIA* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkExternalMemoryHandleTypeFlagBits*)&forMarshaling->handleType,
+                    sizeof(VkExternalMemoryHandleTypeFlagBits));
+    vkStream->write((zx_handle_t*)&forMarshaling->handle, sizeof(zx_handle_t));
+}
+
+void unmarshal_VkImportMemoryZirconHandleInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkImportMemoryZirconHandleInfoFUCHSIA* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkExternalMemoryHandleTypeFlagBits*)&forUnmarshaling->handleType,
+                   sizeof(VkExternalMemoryHandleTypeFlagBits));
+    vkStream->read((zx_handle_t*)&forUnmarshaling->handle, sizeof(zx_handle_t));
+}
+
+void marshal_VkMemoryZirconHandlePropertiesFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryZirconHandlePropertiesFUCHSIA* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->memoryTypeBits, sizeof(uint32_t));
+}
+
+void unmarshal_VkMemoryZirconHandlePropertiesFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkMemoryZirconHandlePropertiesFUCHSIA* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->memoryTypeBits, sizeof(uint32_t));
+}
+
+void marshal_VkMemoryGetZirconHandleInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryGetZirconHandleInfoFUCHSIA* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&forMarshaling->memory, &cgen_var_0,
+                                                             1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkExternalMemoryHandleTypeFlagBits*)&forMarshaling->handleType,
+                    sizeof(VkExternalMemoryHandleTypeFlagBits));
+}
+
+void unmarshal_VkMemoryGetZirconHandleInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkMemoryGetZirconHandleInfoFUCHSIA* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkDeviceMemory(
+        &cgen_var_0, (VkDeviceMemory*)&forUnmarshaling->memory, 1);
+    vkStream->read((VkExternalMemoryHandleTypeFlagBits*)&forUnmarshaling->handleType,
+                   sizeof(VkExternalMemoryHandleTypeFlagBits));
+}
+
+#endif
+#ifdef VK_FUCHSIA_external_semaphore
+void marshal_VkImportSemaphoreZirconHandleInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportSemaphoreZirconHandleInfoFUCHSIA* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkSemaphore_u64(&forMarshaling->semaphore, &cgen_var_0,
+                                                          1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkSemaphoreImportFlags*)&forMarshaling->flags, sizeof(VkSemaphoreImportFlags));
+    vkStream->write((VkExternalSemaphoreHandleTypeFlagBits*)&forMarshaling->handleType,
+                    sizeof(VkExternalSemaphoreHandleTypeFlagBits));
+    vkStream->write((zx_handle_t*)&forMarshaling->zirconHandle, sizeof(zx_handle_t));
+}
+
+void unmarshal_VkImportSemaphoreZirconHandleInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkImportSemaphoreZirconHandleInfoFUCHSIA* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkSemaphore(
+        &cgen_var_0, (VkSemaphore*)&forUnmarshaling->semaphore, 1);
+    vkStream->read((VkSemaphoreImportFlags*)&forUnmarshaling->flags,
+                   sizeof(VkSemaphoreImportFlags));
+    vkStream->read((VkExternalSemaphoreHandleTypeFlagBits*)&forUnmarshaling->handleType,
+                   sizeof(VkExternalSemaphoreHandleTypeFlagBits));
+    vkStream->read((zx_handle_t*)&forUnmarshaling->zirconHandle, sizeof(zx_handle_t));
+}
+
+void marshal_VkSemaphoreGetZirconHandleInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSemaphoreGetZirconHandleInfoFUCHSIA* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkSemaphore_u64(&forMarshaling->semaphore, &cgen_var_0,
+                                                          1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkExternalSemaphoreHandleTypeFlagBits*)&forMarshaling->handleType,
+                    sizeof(VkExternalSemaphoreHandleTypeFlagBits));
+}
+
+void unmarshal_VkSemaphoreGetZirconHandleInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkSemaphoreGetZirconHandleInfoFUCHSIA* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkSemaphore(
+        &cgen_var_0, (VkSemaphore*)&forUnmarshaling->semaphore, 1);
+    vkStream->read((VkExternalSemaphoreHandleTypeFlagBits*)&forUnmarshaling->handleType,
+                   sizeof(VkExternalSemaphoreHandleTypeFlagBits));
+}
+
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+void marshal_VkBufferCollectionCreateInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferCollectionCreateInfoFUCHSIA* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((zx_handle_t*)&forMarshaling->collectionToken, sizeof(zx_handle_t));
+}
+
+void unmarshal_VkBufferCollectionCreateInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkBufferCollectionCreateInfoFUCHSIA* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((zx_handle_t*)&forUnmarshaling->collectionToken, sizeof(zx_handle_t));
+}
+
+void marshal_VkImportMemoryBufferCollectionFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportMemoryBufferCollectionFUCHSIA* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->collection;
+    vkStream->putBe64(cgen_var_0);
+    vkStream->write((uint32_t*)&forMarshaling->index, sizeof(uint32_t));
+}
+
+void unmarshal_VkImportMemoryBufferCollectionFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkImportMemoryBufferCollectionFUCHSIA* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    forUnmarshaling->collection = (VkBufferCollectionFUCHSIA)vkStream->getBe64();
+    vkStream->read((uint32_t*)&forUnmarshaling->index, sizeof(uint32_t));
+}
+
+void marshal_VkBufferCollectionImageCreateInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferCollectionImageCreateInfoFUCHSIA* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->collection;
+    vkStream->putBe64(cgen_var_0);
+    vkStream->write((uint32_t*)&forMarshaling->index, sizeof(uint32_t));
+}
+
+void unmarshal_VkBufferCollectionImageCreateInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkBufferCollectionImageCreateInfoFUCHSIA* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    forUnmarshaling->collection = (VkBufferCollectionFUCHSIA)vkStream->getBe64();
+    vkStream->read((uint32_t*)&forUnmarshaling->index, sizeof(uint32_t));
+}
+
+void marshal_VkBufferCollectionConstraintsInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferCollectionConstraintsInfoFUCHSIA* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->minBufferCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxBufferCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->minBufferCountForCamping, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->minBufferCountForDedicatedSlack, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->minBufferCountForSharedSlack, sizeof(uint32_t));
+}
+
+void unmarshal_VkBufferCollectionConstraintsInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkBufferCollectionConstraintsInfoFUCHSIA* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->minBufferCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxBufferCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->minBufferCountForCamping, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->minBufferCountForDedicatedSlack, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->minBufferCountForSharedSlack, sizeof(uint32_t));
+}
+
+void marshal_VkBufferConstraintsInfoFUCHSIA(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkBufferConstraintsInfoFUCHSIA* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkBufferCreateInfo(vkStream, rootType,
+                               (VkBufferCreateInfo*)(&forMarshaling->createInfo));
+    vkStream->write((VkFormatFeatureFlags*)&forMarshaling->requiredFormatFeatures,
+                    sizeof(VkFormatFeatureFlags));
+    marshal_VkBufferCollectionConstraintsInfoFUCHSIA(
+        vkStream, rootType,
+        (VkBufferCollectionConstraintsInfoFUCHSIA*)(&forMarshaling->bufferCollectionConstraints));
+}
+
+void unmarshal_VkBufferConstraintsInfoFUCHSIA(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkBufferConstraintsInfoFUCHSIA* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkBufferCreateInfo(vkStream, rootType,
+                                 (VkBufferCreateInfo*)(&forUnmarshaling->createInfo));
+    vkStream->read((VkFormatFeatureFlags*)&forUnmarshaling->requiredFormatFeatures,
+                   sizeof(VkFormatFeatureFlags));
+    unmarshal_VkBufferCollectionConstraintsInfoFUCHSIA(
+        vkStream, rootType,
+        (VkBufferCollectionConstraintsInfoFUCHSIA*)(&forUnmarshaling->bufferCollectionConstraints));
+}
+
+void marshal_VkBufferCollectionBufferCreateInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferCollectionBufferCreateInfoFUCHSIA* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->collection;
+    vkStream->putBe64(cgen_var_0);
+    vkStream->write((uint32_t*)&forMarshaling->index, sizeof(uint32_t));
+}
+
+void unmarshal_VkBufferCollectionBufferCreateInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkBufferCollectionBufferCreateInfoFUCHSIA* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    forUnmarshaling->collection = (VkBufferCollectionFUCHSIA)vkStream->getBe64();
+    vkStream->read((uint32_t*)&forUnmarshaling->index, sizeof(uint32_t));
+}
+
+void marshal_VkSysmemColorSpaceFUCHSIA(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkSysmemColorSpaceFUCHSIA* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->colorSpace, sizeof(uint32_t));
+}
+
+void unmarshal_VkSysmemColorSpaceFUCHSIA(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkSysmemColorSpaceFUCHSIA* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->colorSpace, sizeof(uint32_t));
+}
+
+void marshal_VkBufferCollectionPropertiesFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferCollectionPropertiesFUCHSIA* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->memoryTypeBits, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->bufferCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->createInfoIndex, sizeof(uint32_t));
+    vkStream->write((uint64_t*)&forMarshaling->sysmemPixelFormat, sizeof(uint64_t));
+    vkStream->write((VkFormatFeatureFlags*)&forMarshaling->formatFeatures,
+                    sizeof(VkFormatFeatureFlags));
+    marshal_VkSysmemColorSpaceFUCHSIA(
+        vkStream, rootType, (VkSysmemColorSpaceFUCHSIA*)(&forMarshaling->sysmemColorSpaceIndex));
+    marshal_VkComponentMapping(
+        vkStream, rootType,
+        (VkComponentMapping*)(&forMarshaling->samplerYcbcrConversionComponents));
+    vkStream->write((VkSamplerYcbcrModelConversion*)&forMarshaling->suggestedYcbcrModel,
+                    sizeof(VkSamplerYcbcrModelConversion));
+    vkStream->write((VkSamplerYcbcrRange*)&forMarshaling->suggestedYcbcrRange,
+                    sizeof(VkSamplerYcbcrRange));
+    vkStream->write((VkChromaLocation*)&forMarshaling->suggestedXChromaOffset,
+                    sizeof(VkChromaLocation));
+    vkStream->write((VkChromaLocation*)&forMarshaling->suggestedYChromaOffset,
+                    sizeof(VkChromaLocation));
+}
+
+void unmarshal_VkBufferCollectionPropertiesFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkBufferCollectionPropertiesFUCHSIA* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->memoryTypeBits, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->bufferCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->createInfoIndex, sizeof(uint32_t));
+    vkStream->read((uint64_t*)&forUnmarshaling->sysmemPixelFormat, sizeof(uint64_t));
+    vkStream->read((VkFormatFeatureFlags*)&forUnmarshaling->formatFeatures,
+                   sizeof(VkFormatFeatureFlags));
+    unmarshal_VkSysmemColorSpaceFUCHSIA(
+        vkStream, rootType, (VkSysmemColorSpaceFUCHSIA*)(&forUnmarshaling->sysmemColorSpaceIndex));
+    unmarshal_VkComponentMapping(
+        vkStream, rootType,
+        (VkComponentMapping*)(&forUnmarshaling->samplerYcbcrConversionComponents));
+    vkStream->read((VkSamplerYcbcrModelConversion*)&forUnmarshaling->suggestedYcbcrModel,
+                   sizeof(VkSamplerYcbcrModelConversion));
+    vkStream->read((VkSamplerYcbcrRange*)&forUnmarshaling->suggestedYcbcrRange,
+                   sizeof(VkSamplerYcbcrRange));
+    vkStream->read((VkChromaLocation*)&forUnmarshaling->suggestedXChromaOffset,
+                   sizeof(VkChromaLocation));
+    vkStream->read((VkChromaLocation*)&forUnmarshaling->suggestedYChromaOffset,
+                   sizeof(VkChromaLocation));
+}
+
+void marshal_VkImageFormatConstraintsInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageFormatConstraintsInfoFUCHSIA* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkImageCreateInfo(vkStream, rootType,
+                              (VkImageCreateInfo*)(&forMarshaling->imageCreateInfo));
+    vkStream->write((VkFormatFeatureFlags*)&forMarshaling->requiredFormatFeatures,
+                    sizeof(VkFormatFeatureFlags));
+    vkStream->write((VkImageFormatConstraintsFlagsFUCHSIA*)&forMarshaling->flags,
+                    sizeof(VkImageFormatConstraintsFlagsFUCHSIA));
+    vkStream->write((uint64_t*)&forMarshaling->sysmemPixelFormat, sizeof(uint64_t));
+    vkStream->write((uint32_t*)&forMarshaling->colorSpaceCount, sizeof(uint32_t));
+    marshal_VkSysmemColorSpaceFUCHSIA(
+        vkStream, rootType, (const VkSysmemColorSpaceFUCHSIA*)(forMarshaling->pColorSpaces));
+}
+
+void unmarshal_VkImageFormatConstraintsInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkImageFormatConstraintsInfoFUCHSIA* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkImageCreateInfo(vkStream, rootType,
+                                (VkImageCreateInfo*)(&forUnmarshaling->imageCreateInfo));
+    vkStream->read((VkFormatFeatureFlags*)&forUnmarshaling->requiredFormatFeatures,
+                   sizeof(VkFormatFeatureFlags));
+    vkStream->read((VkImageFormatConstraintsFlagsFUCHSIA*)&forUnmarshaling->flags,
+                   sizeof(VkImageFormatConstraintsFlagsFUCHSIA));
+    vkStream->read((uint64_t*)&forUnmarshaling->sysmemPixelFormat, sizeof(uint64_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->colorSpaceCount, sizeof(uint32_t));
+    unmarshal_VkSysmemColorSpaceFUCHSIA(
+        vkStream, rootType, (VkSysmemColorSpaceFUCHSIA*)(forUnmarshaling->pColorSpaces));
+}
+
+void marshal_VkImageConstraintsInfoFUCHSIA(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkImageConstraintsInfoFUCHSIA* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->formatConstraintsCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->formatConstraintsCount; ++i) {
+            marshal_VkImageFormatConstraintsInfoFUCHSIA(
+                vkStream, rootType,
+                (const VkImageFormatConstraintsInfoFUCHSIA*)(forMarshaling->pFormatConstraints +
+                                                             i));
+        }
+    }
+    marshal_VkBufferCollectionConstraintsInfoFUCHSIA(
+        vkStream, rootType,
+        (VkBufferCollectionConstraintsInfoFUCHSIA*)(&forMarshaling->bufferCollectionConstraints));
+    vkStream->write((VkImageConstraintsInfoFlagsFUCHSIA*)&forMarshaling->flags,
+                    sizeof(VkImageConstraintsInfoFlagsFUCHSIA));
+}
+
+void unmarshal_VkImageConstraintsInfoFUCHSIA(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkImageConstraintsInfoFUCHSIA* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->formatConstraintsCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->formatConstraintsCount; ++i) {
+            unmarshal_VkImageFormatConstraintsInfoFUCHSIA(
+                vkStream, rootType,
+                (VkImageFormatConstraintsInfoFUCHSIA*)(forUnmarshaling->pFormatConstraints + i));
+        }
+    }
+    unmarshal_VkBufferCollectionConstraintsInfoFUCHSIA(
+        vkStream, rootType,
+        (VkBufferCollectionConstraintsInfoFUCHSIA*)(&forUnmarshaling->bufferCollectionConstraints));
+    vkStream->read((VkImageConstraintsInfoFlagsFUCHSIA*)&forUnmarshaling->flags,
+                   sizeof(VkImageConstraintsInfoFlagsFUCHSIA));
+}
+
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+void marshal_VkSubpassShadingPipelineCreateInfoHUAWEI(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSubpassShadingPipelineCreateInfoHUAWEI* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkRenderPass_u64(&forMarshaling->renderPass, &cgen_var_0,
+                                                           1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((uint32_t*)&forMarshaling->subpass, sizeof(uint32_t));
+}
+
+void unmarshal_VkSubpassShadingPipelineCreateInfoHUAWEI(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkSubpassShadingPipelineCreateInfoHUAWEI* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkRenderPass(
+        &cgen_var_0, (VkRenderPass*)&forUnmarshaling->renderPass, 1);
+    vkStream->read((uint32_t*)&forUnmarshaling->subpass, sizeof(uint32_t));
+}
+
+void marshal_VkPhysicalDeviceSubpassShadingFeaturesHUAWEI(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSubpassShadingFeaturesHUAWEI* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->subpassShading, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceSubpassShadingFeaturesHUAWEI(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceSubpassShadingFeaturesHUAWEI* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->subpassShading, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceSubpassShadingPropertiesHUAWEI(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSubpassShadingPropertiesHUAWEI* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->maxSubpassShadingWorkgroupSizeAspectRatio,
+                    sizeof(uint32_t));
+}
+
+void unmarshal_VkPhysicalDeviceSubpassShadingPropertiesHUAWEI(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceSubpassShadingPropertiesHUAWEI* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxSubpassShadingWorkgroupSizeAspectRatio,
+                   sizeof(uint32_t));
+}
+
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+void marshal_VkPhysicalDeviceInvocationMaskFeaturesHUAWEI(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceInvocationMaskFeaturesHUAWEI* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->invocationMask, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceInvocationMaskFeaturesHUAWEI(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceInvocationMaskFeaturesHUAWEI* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->invocationMask, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_NV_external_memory_rdma
+void marshal_VkMemoryGetRemoteAddressInfoNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkMemoryGetRemoteAddressInfoNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&forMarshaling->memory, &cgen_var_0,
+                                                             1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkExternalMemoryHandleTypeFlagBits*)&forMarshaling->handleType,
+                    sizeof(VkExternalMemoryHandleTypeFlagBits));
+}
+
+void unmarshal_VkMemoryGetRemoteAddressInfoNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkMemoryGetRemoteAddressInfoNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkDeviceMemory(
+        &cgen_var_0, (VkDeviceMemory*)&forUnmarshaling->memory, 1);
+    vkStream->read((VkExternalMemoryHandleTypeFlagBits*)&forUnmarshaling->handleType,
+                   sizeof(VkExternalMemoryHandleTypeFlagBits));
+}
+
+void marshal_VkPhysicalDeviceExternalMemoryRDMAFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExternalMemoryRDMAFeaturesNV* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->externalMemoryRDMA, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceExternalMemoryRDMAFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceExternalMemoryRDMAFeaturesNV* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->externalMemoryRDMA, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+void marshal_VkPhysicalDeviceExtendedDynamicState2FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->extendedDynamicState2, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->extendedDynamicState2LogicOp, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->extendedDynamicState2PatchControlPoints,
+                    sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceExtendedDynamicState2FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceExtendedDynamicState2FeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->extendedDynamicState2, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->extendedDynamicState2LogicOp, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->extendedDynamicState2PatchControlPoints,
+                   sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_QNX_screen_surface
+void marshal_VkScreenSurfaceCreateInfoQNX(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkScreenSurfaceCreateInfoQNX* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkScreenSurfaceCreateFlagsQNX*)&forMarshaling->flags,
+                    sizeof(VkScreenSurfaceCreateFlagsQNX));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->context;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->context) {
+        vkStream->write((_screen_context*)forMarshaling->context, sizeof(_screen_context));
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->window;
+    vkStream->putBe64(cgen_var_1);
+    if (forMarshaling->window) {
+        vkStream->write((_screen_window*)forMarshaling->window, sizeof(_screen_window));
+    }
+}
+
+void unmarshal_VkScreenSurfaceCreateInfoQNX(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkScreenSurfaceCreateInfoQNX* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkScreenSurfaceCreateFlagsQNX*)&forUnmarshaling->flags,
+                   sizeof(VkScreenSurfaceCreateFlagsQNX));
+    // WARNING PTR CHECK
+    _screen_context* check_context;
+    check_context = (_screen_context*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->context) {
+        if (!(check_context)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->context inconsistent between guest and host\n");
+        }
+        vkStream->read((_screen_context*)forUnmarshaling->context, sizeof(_screen_context));
+    }
+    // WARNING PTR CHECK
+    _screen_window* check_window;
+    check_window = (_screen_window*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->window) {
+        if (!(check_window)) {
+            fprintf(stderr, "fatal: forUnmarshaling->window inconsistent between guest and host\n");
+        }
+        vkStream->read((_screen_window*)forUnmarshaling->window, sizeof(_screen_window));
+    }
+}
+
+#endif
+#ifdef VK_EXT_color_write_enable
+void marshal_VkPhysicalDeviceColorWriteEnableFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceColorWriteEnableFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->colorWriteEnable, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceColorWriteEnableFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceColorWriteEnableFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->colorWriteEnable, sizeof(VkBool32));
+}
+
+void marshal_VkPipelineColorWriteCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineColorWriteCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->attachmentCount, sizeof(uint32_t));
+    vkStream->write((const VkBool32*)forMarshaling->pColorWriteEnables,
+                    forMarshaling->attachmentCount * sizeof(const VkBool32));
+}
+
+void unmarshal_VkPipelineColorWriteCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineColorWriteCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->attachmentCount, sizeof(uint32_t));
+    vkStream->read((VkBool32*)forUnmarshaling->pColorWriteEnables,
+                   forUnmarshaling->attachmentCount * sizeof(const VkBool32));
+}
+
+#endif
+#ifdef VK_GOOGLE_gfxstream
+void marshal_VkImportColorBufferGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkImportColorBufferGOOGLE* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->colorBuffer, sizeof(uint32_t));
+}
+
+void unmarshal_VkImportColorBufferGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkImportColorBufferGOOGLE* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    forUnmarshaling->sType = VK_STRUCTURE_TYPE_IMPORT_COLOR_BUFFER_GOOGLE;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->colorBuffer, sizeof(uint32_t));
+}
+
+void marshal_VkImportBufferGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkImportBufferGOOGLE* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->buffer, sizeof(uint32_t));
+}
+
+void unmarshal_VkImportBufferGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkImportBufferGOOGLE* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    forUnmarshaling->sType = VK_STRUCTURE_TYPE_IMPORT_BUFFER_GOOGLE;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->buffer, sizeof(uint32_t));
+}
+
+void marshal_VkCreateBlobGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkCreateBlobGOOGLE* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->blobMem, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->blobFlags, sizeof(uint32_t));
+    vkStream->write((uint64_t*)&forMarshaling->blobId, sizeof(uint64_t));
+}
+
+void unmarshal_VkCreateBlobGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkCreateBlobGOOGLE* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    forUnmarshaling->sType = VK_STRUCTURE_TYPE_CREATE_BLOB_GOOGLE;
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->blobMem, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->blobFlags, sizeof(uint32_t));
+    vkStream->read((uint64_t*)&forUnmarshaling->blobId, sizeof(uint64_t));
+}
+
+#endif
+#ifdef VK_EXT_global_priority_query
+void marshal_VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->globalPriorityQuery, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->globalPriorityQuery, sizeof(VkBool32));
+}
+
+void marshal_VkQueueFamilyGlobalPriorityPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkQueueFamilyGlobalPriorityPropertiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->priorityCount, sizeof(uint32_t));
+    vkStream->write((VkQueueGlobalPriorityEXT*)forMarshaling->priorities,
+                    VK_MAX_GLOBAL_PRIORITY_SIZE_EXT * sizeof(VkQueueGlobalPriorityEXT));
+}
+
+void unmarshal_VkQueueFamilyGlobalPriorityPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkQueueFamilyGlobalPriorityPropertiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->priorityCount, sizeof(uint32_t));
+    vkStream->read((VkQueueGlobalPriorityEXT*)forUnmarshaling->priorities,
+                   VK_MAX_GLOBAL_PRIORITY_SIZE_EXT * sizeof(VkQueueGlobalPriorityEXT));
+}
+
+#endif
+#ifdef VK_EXT_multi_draw
+void marshal_VkPhysicalDeviceMultiDrawFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMultiDrawFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->multiDraw, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceMultiDrawFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceMultiDrawFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->multiDraw, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceMultiDrawPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMultiDrawPropertiesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->maxMultiDrawCount, sizeof(uint32_t));
+}
+
+void unmarshal_VkPhysicalDeviceMultiDrawPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceMultiDrawPropertiesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxMultiDrawCount, sizeof(uint32_t));
+}
+
+void marshal_VkMultiDrawInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkMultiDrawInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->firstVertex, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->vertexCount, sizeof(uint32_t));
+}
+
+void unmarshal_VkMultiDrawInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkMultiDrawInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->firstVertex, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->vertexCount, sizeof(uint32_t));
+}
+
+void marshal_VkMultiDrawIndexedInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkMultiDrawIndexedInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->firstIndex, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->indexCount, sizeof(uint32_t));
+    vkStream->write((int32_t*)&forMarshaling->vertexOffset, sizeof(int32_t));
+}
+
+void unmarshal_VkMultiDrawIndexedInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkMultiDrawIndexedInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->firstIndex, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->indexCount, sizeof(uint32_t));
+    vkStream->read((int32_t*)&forUnmarshaling->vertexOffset, sizeof(int32_t));
+}
+
+#endif
+#ifdef VK_EXT_load_store_op_none
+#endif
+#ifdef VK_EXT_border_color_swizzle
+void marshal_VkPhysicalDeviceBorderColorSwizzleFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->borderColorSwizzle, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->borderColorSwizzleFromImage, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceBorderColorSwizzleFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceBorderColorSwizzleFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->borderColorSwizzle, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->borderColorSwizzleFromImage, sizeof(VkBool32));
+}
+
+void marshal_VkSamplerBorderColorComponentMappingCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSamplerBorderColorComponentMappingCreateInfoEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkComponentMapping(vkStream, rootType,
+                               (VkComponentMapping*)(&forMarshaling->components));
+    vkStream->write((VkBool32*)&forMarshaling->srgb, sizeof(VkBool32));
+}
+
+void unmarshal_VkSamplerBorderColorComponentMappingCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkSamplerBorderColorComponentMappingCreateInfoEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkComponentMapping(vkStream, rootType,
+                                 (VkComponentMapping*)(&forUnmarshaling->components));
+    vkStream->read((VkBool32*)&forUnmarshaling->srgb, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+void marshal_VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->pageableDeviceLocalMemory, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->pageableDeviceLocalMemory, sizeof(VkBool32));
+}
+
+#endif
+#ifdef VK_KHR_acceleration_structure
+void marshal_VkDeviceOrHostAddressKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkDeviceOrHostAddressKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkDeviceAddress*)&forMarshaling->deviceAddress, sizeof(VkDeviceAddress));
+}
+
+void unmarshal_VkDeviceOrHostAddressKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkDeviceOrHostAddressKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkDeviceAddress*)&forUnmarshaling->deviceAddress, sizeof(VkDeviceAddress));
+}
+
+void marshal_VkAccelerationStructureBuildRangeInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureBuildRangeInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->primitiveCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->primitiveOffset, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->firstVertex, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->transformOffset, sizeof(uint32_t));
+}
+
+void unmarshal_VkAccelerationStructureBuildRangeInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureBuildRangeInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->primitiveCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->primitiveOffset, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->firstVertex, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->transformOffset, sizeof(uint32_t));
+}
+
+void marshal_VkAccelerationStructureGeometryTrianglesDataKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureGeometryTrianglesDataKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkFormat*)&forMarshaling->vertexFormat, sizeof(VkFormat));
+    marshal_VkDeviceOrHostAddressConstKHR(
+        vkStream, rootType, (VkDeviceOrHostAddressConstKHR*)(&forMarshaling->vertexData));
+    vkStream->write((VkDeviceSize*)&forMarshaling->vertexStride, sizeof(VkDeviceSize));
+    vkStream->write((uint32_t*)&forMarshaling->maxVertex, sizeof(uint32_t));
+    vkStream->write((VkIndexType*)&forMarshaling->indexType, sizeof(VkIndexType));
+    marshal_VkDeviceOrHostAddressConstKHR(
+        vkStream, rootType, (VkDeviceOrHostAddressConstKHR*)(&forMarshaling->indexData));
+    marshal_VkDeviceOrHostAddressConstKHR(
+        vkStream, rootType, (VkDeviceOrHostAddressConstKHR*)(&forMarshaling->transformData));
+}
+
+void unmarshal_VkAccelerationStructureGeometryTrianglesDataKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureGeometryTrianglesDataKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkFormat*)&forUnmarshaling->vertexFormat, sizeof(VkFormat));
+    unmarshal_VkDeviceOrHostAddressConstKHR(
+        vkStream, rootType, (VkDeviceOrHostAddressConstKHR*)(&forUnmarshaling->vertexData));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->vertexStride, sizeof(VkDeviceSize));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxVertex, sizeof(uint32_t));
+    vkStream->read((VkIndexType*)&forUnmarshaling->indexType, sizeof(VkIndexType));
+    unmarshal_VkDeviceOrHostAddressConstKHR(
+        vkStream, rootType, (VkDeviceOrHostAddressConstKHR*)(&forUnmarshaling->indexData));
+    unmarshal_VkDeviceOrHostAddressConstKHR(
+        vkStream, rootType, (VkDeviceOrHostAddressConstKHR*)(&forUnmarshaling->transformData));
+}
+
+void marshal_VkAccelerationStructureGeometryAabbsDataKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureGeometryAabbsDataKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkDeviceOrHostAddressConstKHR(vkStream, rootType,
+                                          (VkDeviceOrHostAddressConstKHR*)(&forMarshaling->data));
+    vkStream->write((VkDeviceSize*)&forMarshaling->stride, sizeof(VkDeviceSize));
+}
+
+void unmarshal_VkAccelerationStructureGeometryAabbsDataKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureGeometryAabbsDataKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkDeviceOrHostAddressConstKHR(
+        vkStream, rootType, (VkDeviceOrHostAddressConstKHR*)(&forUnmarshaling->data));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->stride, sizeof(VkDeviceSize));
+}
+
+void marshal_VkAccelerationStructureGeometryInstancesDataKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureGeometryInstancesDataKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->arrayOfPointers, sizeof(VkBool32));
+    marshal_VkDeviceOrHostAddressConstKHR(vkStream, rootType,
+                                          (VkDeviceOrHostAddressConstKHR*)(&forMarshaling->data));
+}
+
+void unmarshal_VkAccelerationStructureGeometryInstancesDataKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureGeometryInstancesDataKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->arrayOfPointers, sizeof(VkBool32));
+    unmarshal_VkDeviceOrHostAddressConstKHR(
+        vkStream, rootType, (VkDeviceOrHostAddressConstKHR*)(&forUnmarshaling->data));
+}
+
+void marshal_VkAccelerationStructureGeometryDataKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureGeometryDataKHR* forMarshaling) {
+    (void)rootType;
+    marshal_VkAccelerationStructureGeometryTrianglesDataKHR(
+        vkStream, rootType,
+        (VkAccelerationStructureGeometryTrianglesDataKHR*)(&forMarshaling->triangles));
+}
+
+void unmarshal_VkAccelerationStructureGeometryDataKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureGeometryDataKHR* forUnmarshaling) {
+    (void)rootType;
+    unmarshal_VkAccelerationStructureGeometryTrianglesDataKHR(
+        vkStream, rootType,
+        (VkAccelerationStructureGeometryTrianglesDataKHR*)(&forUnmarshaling->triangles));
+}
+
+void marshal_VkAccelerationStructureGeometryKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureGeometryKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkGeometryTypeKHR*)&forMarshaling->geometryType, sizeof(VkGeometryTypeKHR));
+    marshal_VkAccelerationStructureGeometryDataKHR(
+        vkStream, rootType, (VkAccelerationStructureGeometryDataKHR*)(&forMarshaling->geometry));
+    vkStream->write((VkGeometryFlagsKHR*)&forMarshaling->flags, sizeof(VkGeometryFlagsKHR));
+}
+
+void unmarshal_VkAccelerationStructureGeometryKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureGeometryKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkGeometryTypeKHR*)&forUnmarshaling->geometryType, sizeof(VkGeometryTypeKHR));
+    unmarshal_VkAccelerationStructureGeometryDataKHR(
+        vkStream, rootType, (VkAccelerationStructureGeometryDataKHR*)(&forUnmarshaling->geometry));
+    vkStream->read((VkGeometryFlagsKHR*)&forUnmarshaling->flags, sizeof(VkGeometryFlagsKHR));
+}
+
+void marshal_VkAccelerationStructureBuildGeometryInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureBuildGeometryInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkAccelerationStructureTypeKHR*)&forMarshaling->type,
+                    sizeof(VkAccelerationStructureTypeKHR));
+    vkStream->write((VkBuildAccelerationStructureFlagsKHR*)&forMarshaling->flags,
+                    sizeof(VkBuildAccelerationStructureFlagsKHR));
+    vkStream->write((VkBuildAccelerationStructureModeKHR*)&forMarshaling->mode,
+                    sizeof(VkBuildAccelerationStructureModeKHR));
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkAccelerationStructureKHR_u64(
+        &forMarshaling->srcAccelerationStructure, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    uint64_t cgen_var_1;
+    vkStream->handleMapping()->mapHandles_VkAccelerationStructureKHR_u64(
+        &forMarshaling->dstAccelerationStructure, &cgen_var_1, 1);
+    vkStream->write((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->write((uint32_t*)&forMarshaling->geometryCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)forMarshaling->pGeometries;
+    vkStream->putBe64(cgen_var_2);
+    if (forMarshaling->pGeometries) {
+        if (forMarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forMarshaling->geometryCount; ++i) {
+                marshal_VkAccelerationStructureGeometryKHR(
+                    vkStream, rootType,
+                    (const VkAccelerationStructureGeometryKHR*)(forMarshaling->pGeometries + i));
+            }
+        }
+    }
+    marshal_VkDeviceOrHostAddressKHR(vkStream, rootType,
+                                     (VkDeviceOrHostAddressKHR*)(&forMarshaling->scratchData));
+}
+
+void unmarshal_VkAccelerationStructureBuildGeometryInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureBuildGeometryInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkAccelerationStructureTypeKHR*)&forUnmarshaling->type,
+                   sizeof(VkAccelerationStructureTypeKHR));
+    vkStream->read((VkBuildAccelerationStructureFlagsKHR*)&forUnmarshaling->flags,
+                   sizeof(VkBuildAccelerationStructureFlagsKHR));
+    vkStream->read((VkBuildAccelerationStructureModeKHR*)&forUnmarshaling->mode,
+                   sizeof(VkBuildAccelerationStructureModeKHR));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkAccelerationStructureKHR(
+        &cgen_var_0, (VkAccelerationStructureKHR*)&forUnmarshaling->srcAccelerationStructure, 1);
+    uint64_t cgen_var_1;
+    vkStream->read((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkAccelerationStructureKHR(
+        &cgen_var_1, (VkAccelerationStructureKHR*)&forUnmarshaling->dstAccelerationStructure, 1);
+    vkStream->read((uint32_t*)&forUnmarshaling->geometryCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const VkAccelerationStructureGeometryKHR* check_pGeometries;
+    check_pGeometries = (const VkAccelerationStructureGeometryKHR*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pGeometries) {
+        if (!(check_pGeometries)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pGeometries inconsistent between guest and host\n");
+        }
+        if (forUnmarshaling) {
+            for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->geometryCount; ++i) {
+                unmarshal_VkAccelerationStructureGeometryKHR(
+                    vkStream, rootType,
+                    (VkAccelerationStructureGeometryKHR*)(forUnmarshaling->pGeometries + i));
+            }
+        }
+    }
+    unmarshal_VkDeviceOrHostAddressKHR(vkStream, rootType,
+                                       (VkDeviceOrHostAddressKHR*)(&forUnmarshaling->scratchData));
+}
+
+void marshal_VkAccelerationStructureCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureCreateInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkAccelerationStructureCreateFlagsKHR*)&forMarshaling->createFlags,
+                    sizeof(VkAccelerationStructureCreateFlagsKHR));
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkBuffer_u64(&forMarshaling->buffer, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkDeviceSize*)&forMarshaling->offset, sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
+    vkStream->write((VkAccelerationStructureTypeKHR*)&forMarshaling->type,
+                    sizeof(VkAccelerationStructureTypeKHR));
+    vkStream->write((VkDeviceAddress*)&forMarshaling->deviceAddress, sizeof(VkDeviceAddress));
+}
+
+void unmarshal_VkAccelerationStructureCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureCreateInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkAccelerationStructureCreateFlagsKHR*)&forUnmarshaling->createFlags,
+                   sizeof(VkAccelerationStructureCreateFlagsKHR));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_0,
+                                                       (VkBuffer*)&forUnmarshaling->buffer, 1);
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->offset, sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->size, sizeof(VkDeviceSize));
+    vkStream->read((VkAccelerationStructureTypeKHR*)&forUnmarshaling->type,
+                   sizeof(VkAccelerationStructureTypeKHR));
+    vkStream->read((VkDeviceAddress*)&forUnmarshaling->deviceAddress, sizeof(VkDeviceAddress));
+}
+
+void marshal_VkWriteDescriptorSetAccelerationStructureKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkWriteDescriptorSetAccelerationStructureKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->accelerationStructureCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pAccelerationStructures;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pAccelerationStructures) {
+        if (forMarshaling->accelerationStructureCount) {
+            uint64_t* cgen_var_0_0;
+            vkStream->alloc((void**)&cgen_var_0_0, forMarshaling->accelerationStructureCount * 8);
+            vkStream->handleMapping()->mapHandles_VkAccelerationStructureKHR_u64(
+                forMarshaling->pAccelerationStructures, cgen_var_0_0,
+                forMarshaling->accelerationStructureCount);
+            vkStream->write((uint64_t*)cgen_var_0_0, forMarshaling->accelerationStructureCount * 8);
+        }
+    }
+}
+
+void unmarshal_VkWriteDescriptorSetAccelerationStructureKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkWriteDescriptorSetAccelerationStructureKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->accelerationStructureCount, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const VkAccelerationStructureKHR* check_pAccelerationStructures;
+    check_pAccelerationStructures =
+        (const VkAccelerationStructureKHR*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pAccelerationStructures) {
+        if (!(check_pAccelerationStructures)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pAccelerationStructures inconsistent between guest "
+                    "and host\n");
+        }
+        if (forUnmarshaling->accelerationStructureCount) {
+            uint64_t* cgen_var_0_0;
+            vkStream->alloc((void**)&cgen_var_0_0, forUnmarshaling->accelerationStructureCount * 8);
+            vkStream->read((uint64_t*)cgen_var_0_0,
+                           forUnmarshaling->accelerationStructureCount * 8);
+            vkStream->handleMapping()->mapHandles_u64_VkAccelerationStructureKHR(
+                cgen_var_0_0, (VkAccelerationStructureKHR*)forUnmarshaling->pAccelerationStructures,
+                forUnmarshaling->accelerationStructureCount);
+        }
+    }
+}
+
+void marshal_VkPhysicalDeviceAccelerationStructureFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceAccelerationStructureFeaturesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->accelerationStructure, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->accelerationStructureCaptureReplay,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->accelerationStructureIndirectBuild,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->accelerationStructureHostCommands, sizeof(VkBool32));
+    vkStream->write(
+        (VkBool32*)&forMarshaling->descriptorBindingAccelerationStructureUpdateAfterBind,
+        sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceAccelerationStructureFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceAccelerationStructureFeaturesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->accelerationStructure, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->accelerationStructureCaptureReplay,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->accelerationStructureIndirectBuild,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->accelerationStructureHostCommands,
+                   sizeof(VkBool32));
+    vkStream->read(
+        (VkBool32*)&forUnmarshaling->descriptorBindingAccelerationStructureUpdateAfterBind,
+        sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceAccelerationStructurePropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceAccelerationStructurePropertiesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint64_t*)&forMarshaling->maxGeometryCount, sizeof(uint64_t));
+    vkStream->write((uint64_t*)&forMarshaling->maxInstanceCount, sizeof(uint64_t));
+    vkStream->write((uint64_t*)&forMarshaling->maxPrimitiveCount, sizeof(uint64_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxPerStageDescriptorAccelerationStructures,
+                    sizeof(uint32_t));
+    vkStream->write(
+        (uint32_t*)&forMarshaling->maxPerStageDescriptorUpdateAfterBindAccelerationStructures,
+        sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxDescriptorSetAccelerationStructures,
+                    sizeof(uint32_t));
+    vkStream->write(
+        (uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindAccelerationStructures,
+        sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->minAccelerationStructureScratchOffsetAlignment,
+                    sizeof(uint32_t));
+}
+
+void unmarshal_VkPhysicalDeviceAccelerationStructurePropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceAccelerationStructurePropertiesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint64_t*)&forUnmarshaling->maxGeometryCount, sizeof(uint64_t));
+    vkStream->read((uint64_t*)&forUnmarshaling->maxInstanceCount, sizeof(uint64_t));
+    vkStream->read((uint64_t*)&forUnmarshaling->maxPrimitiveCount, sizeof(uint64_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPerStageDescriptorAccelerationStructures,
+                   sizeof(uint32_t));
+    vkStream->read(
+        (uint32_t*)&forUnmarshaling->maxPerStageDescriptorUpdateAfterBindAccelerationStructures,
+        sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxDescriptorSetAccelerationStructures,
+                   sizeof(uint32_t));
+    vkStream->read(
+        (uint32_t*)&forUnmarshaling->maxDescriptorSetUpdateAfterBindAccelerationStructures,
+        sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->minAccelerationStructureScratchOffsetAlignment,
+                   sizeof(uint32_t));
+}
+
+void marshal_VkAccelerationStructureDeviceAddressInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureDeviceAddressInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkAccelerationStructureKHR_u64(
+        &forMarshaling->accelerationStructure, &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+}
+
+void unmarshal_VkAccelerationStructureDeviceAddressInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureDeviceAddressInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkAccelerationStructureKHR(
+        &cgen_var_0, (VkAccelerationStructureKHR*)&forUnmarshaling->accelerationStructure, 1);
+}
+
+void marshal_VkAccelerationStructureVersionInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureVersionInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((const uint8_t*)forMarshaling->pVersionData,
+                    2 * VK_UUID_SIZE * sizeof(const uint8_t));
+}
+
+void unmarshal_VkAccelerationStructureVersionInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureVersionInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint8_t*)forUnmarshaling->pVersionData,
+                   2 * VK_UUID_SIZE * sizeof(const uint8_t));
+}
+
+void marshal_VkCopyAccelerationStructureToMemoryInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCopyAccelerationStructureToMemoryInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkAccelerationStructureKHR_u64(&forMarshaling->src,
+                                                                         &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    marshal_VkDeviceOrHostAddressKHR(vkStream, rootType,
+                                     (VkDeviceOrHostAddressKHR*)(&forMarshaling->dst));
+    vkStream->write((VkCopyAccelerationStructureModeKHR*)&forMarshaling->mode,
+                    sizeof(VkCopyAccelerationStructureModeKHR));
+}
+
+void unmarshal_VkCopyAccelerationStructureToMemoryInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkCopyAccelerationStructureToMemoryInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkAccelerationStructureKHR(
+        &cgen_var_0, (VkAccelerationStructureKHR*)&forUnmarshaling->src, 1);
+    unmarshal_VkDeviceOrHostAddressKHR(vkStream, rootType,
+                                       (VkDeviceOrHostAddressKHR*)(&forUnmarshaling->dst));
+    vkStream->read((VkCopyAccelerationStructureModeKHR*)&forUnmarshaling->mode,
+                   sizeof(VkCopyAccelerationStructureModeKHR));
+}
+
+void marshal_VkCopyMemoryToAccelerationStructureInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCopyMemoryToAccelerationStructureInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    marshal_VkDeviceOrHostAddressConstKHR(vkStream, rootType,
+                                          (VkDeviceOrHostAddressConstKHR*)(&forMarshaling->src));
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkAccelerationStructureKHR_u64(&forMarshaling->dst,
+                                                                         &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->write((VkCopyAccelerationStructureModeKHR*)&forMarshaling->mode,
+                    sizeof(VkCopyAccelerationStructureModeKHR));
+}
+
+void unmarshal_VkCopyMemoryToAccelerationStructureInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkCopyMemoryToAccelerationStructureInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    unmarshal_VkDeviceOrHostAddressConstKHR(
+        vkStream, rootType, (VkDeviceOrHostAddressConstKHR*)(&forUnmarshaling->src));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkAccelerationStructureKHR(
+        &cgen_var_0, (VkAccelerationStructureKHR*)&forUnmarshaling->dst, 1);
+    vkStream->read((VkCopyAccelerationStructureModeKHR*)&forUnmarshaling->mode,
+                   sizeof(VkCopyAccelerationStructureModeKHR));
+}
+
+void marshal_VkCopyAccelerationStructureInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCopyAccelerationStructureInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    uint64_t cgen_var_0;
+    vkStream->handleMapping()->mapHandles_VkAccelerationStructureKHR_u64(&forMarshaling->src,
+                                                                         &cgen_var_0, 1);
+    vkStream->write((uint64_t*)&cgen_var_0, 1 * 8);
+    uint64_t cgen_var_1;
+    vkStream->handleMapping()->mapHandles_VkAccelerationStructureKHR_u64(&forMarshaling->dst,
+                                                                         &cgen_var_1, 1);
+    vkStream->write((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->write((VkCopyAccelerationStructureModeKHR*)&forMarshaling->mode,
+                    sizeof(VkCopyAccelerationStructureModeKHR));
+}
+
+void unmarshal_VkCopyAccelerationStructureInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkCopyAccelerationStructureInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    uint64_t cgen_var_0;
+    vkStream->read((uint64_t*)&cgen_var_0, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkAccelerationStructureKHR(
+        &cgen_var_0, (VkAccelerationStructureKHR*)&forUnmarshaling->src, 1);
+    uint64_t cgen_var_1;
+    vkStream->read((uint64_t*)&cgen_var_1, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkAccelerationStructureKHR(
+        &cgen_var_1, (VkAccelerationStructureKHR*)&forUnmarshaling->dst, 1);
+    vkStream->read((VkCopyAccelerationStructureModeKHR*)&forUnmarshaling->mode,
+                   sizeof(VkCopyAccelerationStructureModeKHR));
+}
+
+void marshal_VkAccelerationStructureBuildSizesInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureBuildSizesInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkDeviceSize*)&forMarshaling->accelerationStructureSize, sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->updateScratchSize, sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->buildScratchSize, sizeof(VkDeviceSize));
+}
+
+void unmarshal_VkAccelerationStructureBuildSizesInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureBuildSizesInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->accelerationStructureSize,
+                   sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->updateScratchSize, sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->buildScratchSize, sizeof(VkDeviceSize));
+}
+
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+void marshal_VkRayTracingShaderGroupCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRayTracingShaderGroupCreateInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkRayTracingShaderGroupTypeKHR*)&forMarshaling->type,
+                    sizeof(VkRayTracingShaderGroupTypeKHR));
+    vkStream->write((uint32_t*)&forMarshaling->generalShader, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->closestHitShader, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->anyHitShader, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->intersectionShader, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pShaderGroupCaptureReplayHandle;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pShaderGroupCaptureReplayHandle) {
+        vkStream->write((const void*)forMarshaling->pShaderGroupCaptureReplayHandle,
+                        sizeof(const uint8_t));
+    }
+}
+
+void unmarshal_VkRayTracingShaderGroupCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkRayTracingShaderGroupCreateInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkRayTracingShaderGroupTypeKHR*)&forUnmarshaling->type,
+                   sizeof(VkRayTracingShaderGroupTypeKHR));
+    vkStream->read((uint32_t*)&forUnmarshaling->generalShader, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->closestHitShader, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->anyHitShader, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->intersectionShader, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const void* check_pShaderGroupCaptureReplayHandle;
+    check_pShaderGroupCaptureReplayHandle = (const void*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pShaderGroupCaptureReplayHandle) {
+        if (!(check_pShaderGroupCaptureReplayHandle)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pShaderGroupCaptureReplayHandle inconsistent between "
+                    "guest and host\n");
+        }
+        vkStream->read((void*)forUnmarshaling->pShaderGroupCaptureReplayHandle,
+                       sizeof(const uint8_t));
+    }
+}
+
+void marshal_VkRayTracingPipelineInterfaceCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRayTracingPipelineInterfaceCreateInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->maxPipelineRayPayloadSize, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxPipelineRayHitAttributeSize, sizeof(uint32_t));
+}
+
+void unmarshal_VkRayTracingPipelineInterfaceCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkRayTracingPipelineInterfaceCreateInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPipelineRayPayloadSize, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPipelineRayHitAttributeSize, sizeof(uint32_t));
+}
+
+void marshal_VkRayTracingPipelineCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRayTracingPipelineCreateInfoKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkPipelineCreateFlags*)&forMarshaling->flags, sizeof(VkPipelineCreateFlags));
+    vkStream->write((uint32_t*)&forMarshaling->stageCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->stageCount; ++i) {
+            marshal_VkPipelineShaderStageCreateInfo(
+                vkStream, rootType,
+                (const VkPipelineShaderStageCreateInfo*)(forMarshaling->pStages + i));
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->groupCount, sizeof(uint32_t));
+    if (forMarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->groupCount; ++i) {
+            marshal_VkRayTracingShaderGroupCreateInfoKHR(
+                vkStream, rootType,
+                (const VkRayTracingShaderGroupCreateInfoKHR*)(forMarshaling->pGroups + i));
+        }
+    }
+    vkStream->write((uint32_t*)&forMarshaling->maxPipelineRayRecursionDepth, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pLibraryInfo;
+    vkStream->putBe64(cgen_var_0);
+    if (forMarshaling->pLibraryInfo) {
+        marshal_VkPipelineLibraryCreateInfoKHR(
+            vkStream, rootType,
+            (const VkPipelineLibraryCreateInfoKHR*)(forMarshaling->pLibraryInfo));
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pLibraryInterface;
+    vkStream->putBe64(cgen_var_1);
+    if (forMarshaling->pLibraryInterface) {
+        marshal_VkRayTracingPipelineInterfaceCreateInfoKHR(
+            vkStream, rootType,
+            (const VkRayTracingPipelineInterfaceCreateInfoKHR*)(forMarshaling->pLibraryInterface));
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)forMarshaling->pDynamicState;
+    vkStream->putBe64(cgen_var_2);
+    if (forMarshaling->pDynamicState) {
+        marshal_VkPipelineDynamicStateCreateInfo(
+            vkStream, rootType,
+            (const VkPipelineDynamicStateCreateInfo*)(forMarshaling->pDynamicState));
+    }
+    uint64_t cgen_var_3;
+    vkStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&forMarshaling->layout, &cgen_var_3,
+                                                               1);
+    vkStream->write((uint64_t*)&cgen_var_3, 1 * 8);
+    uint64_t cgen_var_4;
+    vkStream->handleMapping()->mapHandles_VkPipeline_u64(&forMarshaling->basePipelineHandle,
+                                                         &cgen_var_4, 1);
+    vkStream->write((uint64_t*)&cgen_var_4, 1 * 8);
+    vkStream->write((int32_t*)&forMarshaling->basePipelineIndex, sizeof(int32_t));
+}
+
+void unmarshal_VkRayTracingPipelineCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkRayTracingPipelineCreateInfoKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkPipelineCreateFlags*)&forUnmarshaling->flags, sizeof(VkPipelineCreateFlags));
+    vkStream->read((uint32_t*)&forUnmarshaling->stageCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->stageCount; ++i) {
+            unmarshal_VkPipelineShaderStageCreateInfo(
+                vkStream, rootType,
+                (VkPipelineShaderStageCreateInfo*)(forUnmarshaling->pStages + i));
+        }
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->groupCount, sizeof(uint32_t));
+    if (forUnmarshaling) {
+        for (uint32_t i = 0; i < (uint32_t)forUnmarshaling->groupCount; ++i) {
+            unmarshal_VkRayTracingShaderGroupCreateInfoKHR(
+                vkStream, rootType,
+                (VkRayTracingShaderGroupCreateInfoKHR*)(forUnmarshaling->pGroups + i));
+        }
+    }
+    vkStream->read((uint32_t*)&forUnmarshaling->maxPipelineRayRecursionDepth, sizeof(uint32_t));
+    // WARNING PTR CHECK
+    const VkPipelineLibraryCreateInfoKHR* check_pLibraryInfo;
+    check_pLibraryInfo = (const VkPipelineLibraryCreateInfoKHR*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pLibraryInfo) {
+        if (!(check_pLibraryInfo)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pLibraryInfo inconsistent between guest and host\n");
+        }
+        unmarshal_VkPipelineLibraryCreateInfoKHR(
+            vkStream, rootType, (VkPipelineLibraryCreateInfoKHR*)(forUnmarshaling->pLibraryInfo));
+    }
+    // WARNING PTR CHECK
+    const VkRayTracingPipelineInterfaceCreateInfoKHR* check_pLibraryInterface;
+    check_pLibraryInterface =
+        (const VkRayTracingPipelineInterfaceCreateInfoKHR*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pLibraryInterface) {
+        if (!(check_pLibraryInterface)) {
+            fprintf(
+                stderr,
+                "fatal: forUnmarshaling->pLibraryInterface inconsistent between guest and host\n");
+        }
+        unmarshal_VkRayTracingPipelineInterfaceCreateInfoKHR(
+            vkStream, rootType,
+            (VkRayTracingPipelineInterfaceCreateInfoKHR*)(forUnmarshaling->pLibraryInterface));
+    }
+    // WARNING PTR CHECK
+    const VkPipelineDynamicStateCreateInfo* check_pDynamicState;
+    check_pDynamicState = (const VkPipelineDynamicStateCreateInfo*)(uintptr_t)vkStream->getBe64();
+    if (forUnmarshaling->pDynamicState) {
+        if (!(check_pDynamicState)) {
+            fprintf(stderr,
+                    "fatal: forUnmarshaling->pDynamicState inconsistent between guest and host\n");
+        }
+        unmarshal_VkPipelineDynamicStateCreateInfo(
+            vkStream, rootType,
+            (VkPipelineDynamicStateCreateInfo*)(forUnmarshaling->pDynamicState));
+    }
+    uint64_t cgen_var_3;
+    vkStream->read((uint64_t*)&cgen_var_3, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkPipelineLayout(
+        &cgen_var_3, (VkPipelineLayout*)&forUnmarshaling->layout, 1);
+    uint64_t cgen_var_4;
+    vkStream->read((uint64_t*)&cgen_var_4, 1 * 8);
+    vkStream->handleMapping()->mapHandles_u64_VkPipeline(
+        &cgen_var_4, (VkPipeline*)&forUnmarshaling->basePipelineHandle, 1);
+    vkStream->read((int32_t*)&forUnmarshaling->basePipelineIndex, sizeof(int32_t));
+}
+
+void marshal_VkPhysicalDeviceRayTracingPipelineFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingPipelineFeaturesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->rayTracingPipeline, sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->rayTracingPipelineShaderGroupHandleCaptureReplay,
+                    sizeof(VkBool32));
+    vkStream->write(
+        (VkBool32*)&forMarshaling->rayTracingPipelineShaderGroupHandleCaptureReplayMixed,
+        sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->rayTracingPipelineTraceRaysIndirect,
+                    sizeof(VkBool32));
+    vkStream->write((VkBool32*)&forMarshaling->rayTraversalPrimitiveCulling, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceRayTracingPipelineFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceRayTracingPipelineFeaturesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->rayTracingPipeline, sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->rayTracingPipelineShaderGroupHandleCaptureReplay,
+                   sizeof(VkBool32));
+    vkStream->read(
+        (VkBool32*)&forUnmarshaling->rayTracingPipelineShaderGroupHandleCaptureReplayMixed,
+        sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->rayTracingPipelineTraceRaysIndirect,
+                   sizeof(VkBool32));
+    vkStream->read((VkBool32*)&forUnmarshaling->rayTraversalPrimitiveCulling, sizeof(VkBool32));
+}
+
+void marshal_VkPhysicalDeviceRayTracingPipelinePropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingPipelinePropertiesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((uint32_t*)&forMarshaling->shaderGroupHandleSize, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxRayRecursionDepth, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxShaderGroupStride, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->shaderGroupBaseAlignment, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->shaderGroupHandleCaptureReplaySize,
+                    sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxRayDispatchInvocationCount, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->shaderGroupHandleAlignment, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->maxRayHitAttributeSize, sizeof(uint32_t));
+}
+
+void unmarshal_VkPhysicalDeviceRayTracingPipelinePropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceRayTracingPipelinePropertiesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((uint32_t*)&forUnmarshaling->shaderGroupHandleSize, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxRayRecursionDepth, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxShaderGroupStride, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->shaderGroupBaseAlignment, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->shaderGroupHandleCaptureReplaySize,
+                   sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxRayDispatchInvocationCount, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->shaderGroupHandleAlignment, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->maxRayHitAttributeSize, sizeof(uint32_t));
+}
+
+void marshal_VkStridedDeviceAddressRegionKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkStridedDeviceAddressRegionKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkDeviceAddress*)&forMarshaling->deviceAddress, sizeof(VkDeviceAddress));
+    vkStream->write((VkDeviceSize*)&forMarshaling->stride, sizeof(VkDeviceSize));
+    vkStream->write((VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
+}
+
+void unmarshal_VkStridedDeviceAddressRegionKHR(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkStridedDeviceAddressRegionKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkDeviceAddress*)&forUnmarshaling->deviceAddress, sizeof(VkDeviceAddress));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->stride, sizeof(VkDeviceSize));
+    vkStream->read((VkDeviceSize*)&forUnmarshaling->size, sizeof(VkDeviceSize));
+}
+
+void marshal_VkTraceRaysIndirectCommandKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkTraceRaysIndirectCommandKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((uint32_t*)&forMarshaling->width, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->height, sizeof(uint32_t));
+    vkStream->write((uint32_t*)&forMarshaling->depth, sizeof(uint32_t));
+}
+
+void unmarshal_VkTraceRaysIndirectCommandKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkTraceRaysIndirectCommandKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((uint32_t*)&forUnmarshaling->width, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->height, sizeof(uint32_t));
+    vkStream->read((uint32_t*)&forUnmarshaling->depth, sizeof(uint32_t));
+}
+
+#endif
+#ifdef VK_KHR_ray_query
+void marshal_VkPhysicalDeviceRayQueryFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRayQueryFeaturesKHR* forMarshaling) {
+    (void)rootType;
+    vkStream->write((VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    marshal_extension_struct(vkStream, rootType, forMarshaling->pNext);
+    vkStream->write((VkBool32*)&forMarshaling->rayQuery, sizeof(VkBool32));
+}
+
+void unmarshal_VkPhysicalDeviceRayQueryFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceRayQueryFeaturesKHR* forUnmarshaling) {
+    (void)rootType;
+    vkStream->read((VkStructureType*)&forUnmarshaling->sType, sizeof(VkStructureType));
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forUnmarshaling->sType;
+    }
+    unmarshal_extension_struct(vkStream, rootType, (void*)(forUnmarshaling->pNext));
+    vkStream->read((VkBool32*)&forUnmarshaling->rayQuery, sizeof(VkBool32));
+}
+
+#endif
+void marshal_extension_struct(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                              const void* structExtension) {
+    VkInstanceCreateInfo* structAccess = (VkInstanceCreateInfo*)(structExtension);
+    size_t currExtSize = goldfish_vk_extension_struct_size_with_stream_features(
+        vkStream->getFeatureBits(), rootType, structExtension);
+    if (!currExtSize && structExtension) {
+        // unknown struct extension; skip and call on its pNext field
+        marshal_extension_struct(vkStream, rootType, (void*)structAccess->pNext);
+        return;
+    } else {
+        // known or null extension struct
+        vkStream->putBe32(currExtSize);
+        if (!currExtSize) {
+            // exit if this was a null extension struct (size == 0 in this branch)
+            return;
+        }
+    }
+    vkStream->write(structExtension, sizeof(VkStructureType));
+    if (!structExtension) {
+        return;
+    }
+    uint32_t structType = (uint32_t)goldfish_vk_struct_type(structExtension);
+    switch (structType) {
+#ifdef VK_VERSION_1_1
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES: {
+            marshal_VkPhysicalDeviceSubgroupProperties(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSubgroupProperties*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: {
+            marshal_VkPhysicalDevice16BitStorageFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevice16BitStorageFeatures*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS: {
+            marshal_VkMemoryDedicatedRequirements(
+                vkStream, rootType,
+                reinterpret_cast<const VkMemoryDedicatedRequirements*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO: {
+            marshal_VkMemoryDedicatedAllocateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkMemoryDedicatedAllocateInfo*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO: {
+            marshal_VkMemoryAllocateFlagsInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkMemoryAllocateFlagsInfo*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO: {
+            marshal_VkDeviceGroupRenderPassBeginInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkDeviceGroupRenderPassBeginInfo*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO: {
+            marshal_VkDeviceGroupCommandBufferBeginInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkDeviceGroupCommandBufferBeginInfo*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO: {
+            marshal_VkDeviceGroupSubmitInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkDeviceGroupSubmitInfo*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO: {
+            marshal_VkDeviceGroupBindSparseInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkDeviceGroupBindSparseInfo*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO: {
+            marshal_VkBindBufferMemoryDeviceGroupInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkBindBufferMemoryDeviceGroupInfo*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO: {
+            marshal_VkBindImageMemoryDeviceGroupInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkBindImageMemoryDeviceGroupInfo*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO: {
+            marshal_VkDeviceGroupDeviceCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkDeviceGroupDeviceCreateInfo*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: {
+            marshal_VkPhysicalDeviceFeatures2(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFeatures2*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES: {
+            marshal_VkPhysicalDevicePointClippingProperties(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevicePointClippingProperties*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO: {
+            marshal_VkRenderPassInputAttachmentAspectCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkRenderPassInputAttachmentAspectCreateInfo*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO: {
+            marshal_VkImageViewUsageCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkImageViewUsageCreateInfo*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO: {
+            marshal_VkPipelineTessellationDomainOriginStateCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineTessellationDomainOriginStateCreateInfo*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO: {
+            marshal_VkRenderPassMultiviewCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkRenderPassMultiviewCreateInfo*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES: {
+            marshal_VkPhysicalDeviceMultiviewFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMultiviewFeatures*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES: {
+            marshal_VkPhysicalDeviceMultiviewProperties(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMultiviewProperties*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES: {
+            marshal_VkPhysicalDeviceVariablePointersFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVariablePointersFeatures*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES: {
+            marshal_VkPhysicalDeviceProtectedMemoryFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceProtectedMemoryFeatures*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES: {
+            marshal_VkPhysicalDeviceProtectedMemoryProperties(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceProtectedMemoryProperties*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO: {
+            marshal_VkProtectedSubmitInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkProtectedSubmitInfo*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO: {
+            marshal_VkSamplerYcbcrConversionInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkSamplerYcbcrConversionInfo*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO: {
+            marshal_VkBindImagePlaneMemoryInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkBindImagePlaneMemoryInfo*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO: {
+            marshal_VkImagePlaneMemoryRequirementsInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkImagePlaneMemoryRequirementsInfo*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: {
+            marshal_VkPhysicalDeviceSamplerYcbcrConversionFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSamplerYcbcrConversionFeatures*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES: {
+            marshal_VkSamplerYcbcrConversionImageFormatProperties(
+                vkStream, rootType,
+                reinterpret_cast<const VkSamplerYcbcrConversionImageFormatProperties*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO: {
+            marshal_VkPhysicalDeviceExternalImageFormatInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceExternalImageFormatInfo*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES: {
+            marshal_VkExternalImageFormatProperties(
+                vkStream, rootType,
+                reinterpret_cast<const VkExternalImageFormatProperties*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES: {
+            marshal_VkPhysicalDeviceIDProperties(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceIDProperties*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO: {
+            marshal_VkExternalMemoryImageCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkExternalMemoryImageCreateInfo*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO: {
+            marshal_VkExternalMemoryBufferCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkExternalMemoryBufferCreateInfo*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO: {
+            marshal_VkExportMemoryAllocateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkExportMemoryAllocateInfo*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO: {
+            marshal_VkExportFenceCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkExportFenceCreateInfo*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO: {
+            marshal_VkExportSemaphoreCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkExportSemaphoreCreateInfo*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES: {
+            marshal_VkPhysicalDeviceMaintenance3Properties(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMaintenance3Properties*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES: {
+            marshal_VkPhysicalDeviceShaderDrawParametersFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderDrawParametersFeatures*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_VERSION_1_2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES: {
+            marshal_VkPhysicalDeviceVulkan11Features(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVulkan11Features*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES: {
+            marshal_VkPhysicalDeviceVulkan11Properties(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVulkan11Properties*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES: {
+            marshal_VkPhysicalDeviceVulkan12Features(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVulkan12Features*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES: {
+            marshal_VkPhysicalDeviceVulkan12Properties(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVulkan12Properties*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO: {
+            marshal_VkImageFormatListCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkImageFormatListCreateInfo*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES: {
+            marshal_VkPhysicalDevice8BitStorageFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevice8BitStorageFeatures*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES: {
+            marshal_VkPhysicalDeviceDriverProperties(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDriverProperties*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES: {
+            marshal_VkPhysicalDeviceShaderAtomicInt64Features(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderAtomicInt64Features*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES: {
+            marshal_VkPhysicalDeviceShaderFloat16Int8Features(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderFloat16Int8Features*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES: {
+            marshal_VkPhysicalDeviceFloatControlsProperties(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFloatControlsProperties*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO: {
+            marshal_VkDescriptorSetLayoutBindingFlagsCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkDescriptorSetLayoutBindingFlagsCreateInfo*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES: {
+            marshal_VkPhysicalDeviceDescriptorIndexingFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDescriptorIndexingFeatures*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES: {
+            marshal_VkPhysicalDeviceDescriptorIndexingProperties(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDescriptorIndexingProperties*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO: {
+            marshal_VkDescriptorSetVariableDescriptorCountAllocateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkDescriptorSetVariableDescriptorCountAllocateInfo*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT: {
+            marshal_VkDescriptorSetVariableDescriptorCountLayoutSupport(
+                vkStream, rootType,
+                reinterpret_cast<const VkDescriptorSetVariableDescriptorCountLayoutSupport*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE: {
+            marshal_VkSubpassDescriptionDepthStencilResolve(
+                vkStream, rootType,
+                reinterpret_cast<const VkSubpassDescriptionDepthStencilResolve*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES: {
+            marshal_VkPhysicalDeviceDepthStencilResolveProperties(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDepthStencilResolveProperties*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES: {
+            marshal_VkPhysicalDeviceScalarBlockLayoutFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceScalarBlockLayoutFeatures*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO: {
+            marshal_VkImageStencilUsageCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkImageStencilUsageCreateInfo*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO: {
+            marshal_VkSamplerReductionModeCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkSamplerReductionModeCreateInfo*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES: {
+            marshal_VkPhysicalDeviceSamplerFilterMinmaxProperties(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSamplerFilterMinmaxProperties*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES: {
+            marshal_VkPhysicalDeviceVulkanMemoryModelFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVulkanMemoryModelFeatures*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES: {
+            marshal_VkPhysicalDeviceImagelessFramebufferFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceImagelessFramebufferFeatures*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO: {
+            marshal_VkFramebufferAttachmentsCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkFramebufferAttachmentsCreateInfo*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO: {
+            marshal_VkRenderPassAttachmentBeginInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkRenderPassAttachmentBeginInfo*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES: {
+            marshal_VkPhysicalDeviceUniformBufferStandardLayoutFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceUniformBufferStandardLayoutFeatures*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES: {
+            marshal_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES: {
+            marshal_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT: {
+            marshal_VkAttachmentReferenceStencilLayout(
+                vkStream, rootType,
+                reinterpret_cast<const VkAttachmentReferenceStencilLayout*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT: {
+            marshal_VkAttachmentDescriptionStencilLayout(
+                vkStream, rootType,
+                reinterpret_cast<const VkAttachmentDescriptionStencilLayout*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES: {
+            marshal_VkPhysicalDeviceHostQueryResetFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceHostQueryResetFeatures*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES: {
+            marshal_VkPhysicalDeviceTimelineSemaphoreFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceTimelineSemaphoreFeatures*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES: {
+            marshal_VkPhysicalDeviceTimelineSemaphoreProperties(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceTimelineSemaphoreProperties*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO: {
+            marshal_VkSemaphoreTypeCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkSemaphoreTypeCreateInfo*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO: {
+            marshal_VkTimelineSemaphoreSubmitInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkTimelineSemaphoreSubmitInfo*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES: {
+            marshal_VkPhysicalDeviceBufferDeviceAddressFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceBufferDeviceAddressFeatures*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO: {
+            marshal_VkBufferOpaqueCaptureAddressCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkBufferOpaqueCaptureAddressCreateInfo*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO: {
+            marshal_VkMemoryOpaqueCaptureAddressAllocateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkMemoryOpaqueCaptureAddressAllocateInfo*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_swapchain
+        case VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR: {
+            marshal_VkImageSwapchainCreateInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkImageSwapchainCreateInfoKHR*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR: {
+            marshal_VkBindImageMemorySwapchainInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkBindImageMemorySwapchainInfoKHR*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR: {
+            marshal_VkDeviceGroupPresentInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkDeviceGroupPresentInfoKHR*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR: {
+            marshal_VkDeviceGroupSwapchainCreateInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkDeviceGroupSwapchainCreateInfoKHR*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_display_swapchain
+        case VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR: {
+            marshal_VkDisplayPresentInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkDisplayPresentInfoKHR*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_video_queue
+        case VK_STRUCTURE_TYPE_VIDEO_QUEUE_FAMILY_PROPERTIES_2_KHR: {
+            marshal_VkVideoQueueFamilyProperties2KHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoQueueFamilyProperties2KHR*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_PROFILE_KHR: {
+            marshal_VkVideoProfileKHR(vkStream, rootType,
+                                      reinterpret_cast<const VkVideoProfileKHR*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_PROFILES_KHR: {
+            marshal_VkVideoProfilesKHR(
+                vkStream, rootType, reinterpret_cast<const VkVideoProfilesKHR*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_dynamic_rendering
+        case VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO_KHR: {
+            marshal_VkPipelineRenderingCreateInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineRenderingCreateInfoKHR*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR: {
+            marshal_VkPhysicalDeviceDynamicRenderingFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDynamicRenderingFeaturesKHR*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO_KHR: {
+            marshal_VkCommandBufferInheritanceRenderingInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkCommandBufferInheritanceRenderingInfoKHR*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR: {
+            marshal_VkRenderingFragmentShadingRateAttachmentInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkRenderingFragmentShadingRateAttachmentInfoKHR*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT: {
+            marshal_VkRenderingFragmentDensityMapAttachmentInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkRenderingFragmentDensityMapAttachmentInfoEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD: {
+            marshal_VkAttachmentSampleCountInfoAMD(
+                vkStream, rootType,
+                reinterpret_cast<const VkAttachmentSampleCountInfoAMD*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX: {
+            marshal_VkMultiviewPerViewAttributesInfoNVX(
+                vkStream, rootType,
+                reinterpret_cast<const VkMultiviewPerViewAttributesInfoNVX*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_memory_win32
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR: {
+            marshal_VkImportMemoryWin32HandleInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkImportMemoryWin32HandleInfoKHR*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR: {
+            marshal_VkExportMemoryWin32HandleInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkExportMemoryWin32HandleInfoKHR*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_memory_fd
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR: {
+            marshal_VkImportMemoryFdInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkImportMemoryFdInfoKHR*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_win32_keyed_mutex
+        case VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR: {
+            marshal_VkWin32KeyedMutexAcquireReleaseInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkWin32KeyedMutexAcquireReleaseInfoKHR*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+        case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR: {
+            marshal_VkExportSemaphoreWin32HandleInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkExportSemaphoreWin32HandleInfoKHR*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR: {
+            marshal_VkD3D12FenceSubmitInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkD3D12FenceSubmitInfoKHR*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_push_descriptor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR: {
+            marshal_VkPhysicalDevicePushDescriptorPropertiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevicePushDescriptorPropertiesKHR*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_incremental_present
+        case VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR: {
+            marshal_VkPresentRegionsKHR(
+                vkStream, rootType, reinterpret_cast<const VkPresentRegionsKHR*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shared_presentable_image
+        case VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR: {
+            marshal_VkSharedPresentSurfaceCapabilitiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkSharedPresentSurfaceCapabilitiesKHR*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_fence_win32
+        case VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR: {
+            marshal_VkExportFenceWin32HandleInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkExportFenceWin32HandleInfoKHR*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_performance_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR: {
+            marshal_VkPhysicalDevicePerformanceQueryFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevicePerformanceQueryFeaturesKHR*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR: {
+            marshal_VkPhysicalDevicePerformanceQueryPropertiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevicePerformanceQueryPropertiesKHR*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR: {
+            marshal_VkQueryPoolPerformanceCreateInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkQueryPoolPerformanceCreateInfoKHR*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR: {
+            marshal_VkPerformanceQuerySubmitInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPerformanceQuerySubmitInfoKHR*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_portability_subset
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR: {
+            marshal_VkPhysicalDevicePortabilitySubsetFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevicePortabilitySubsetFeaturesKHR*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR: {
+            marshal_VkPhysicalDevicePortabilitySubsetPropertiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevicePortabilitySubsetPropertiesKHR*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_clock
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR: {
+            marshal_VkPhysicalDeviceShaderClockFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderClockFeaturesKHR*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_terminate_invocation
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR: {
+            marshal_VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+        case VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR: {
+            marshal_VkFragmentShadingRateAttachmentInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkFragmentShadingRateAttachmentInfoKHR*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR: {
+            marshal_VkPipelineFragmentShadingRateStateCreateInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineFragmentShadingRateStateCreateInfoKHR*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR: {
+            marshal_VkPhysicalDeviceFragmentShadingRateFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentShadingRateFeaturesKHR*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR: {
+            marshal_VkPhysicalDeviceFragmentShadingRatePropertiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentShadingRatePropertiesKHR*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_surface_protected_capabilities
+        case VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR: {
+            marshal_VkSurfaceProtectedCapabilitiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkSurfaceProtectedCapabilitiesKHR*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_present_wait
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR: {
+            marshal_VkPhysicalDevicePresentWaitFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevicePresentWaitFeaturesKHR*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR: {
+            marshal_VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_integer_dot_product
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR: {
+            marshal_VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR: {
+            marshal_VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_present_id
+        case VK_STRUCTURE_TYPE_PRESENT_ID_KHR: {
+            marshal_VkPresentIdKHR(vkStream, rootType,
+                                   reinterpret_cast<const VkPresentIdKHR*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR: {
+            marshal_VkPhysicalDevicePresentIdFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevicePresentIdFeaturesKHR*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_video_encode_queue
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_INFO_KHR: {
+            marshal_VkVideoEncodeRateControlInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeRateControlInfoKHR*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_synchronization2
+        case VK_STRUCTURE_TYPE_MEMORY_BARRIER_2_KHR: {
+            marshal_VkMemoryBarrier2KHR(
+                vkStream, rootType, reinterpret_cast<const VkMemoryBarrier2KHR*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR: {
+            marshal_VkPhysicalDeviceSynchronization2FeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSynchronization2FeaturesKHR*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV: {
+            marshal_VkQueueFamilyCheckpointProperties2NV(
+                vkStream, rootType,
+                reinterpret_cast<const VkQueueFamilyCheckpointProperties2NV*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_subgroup_uniform_control_flow
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR: {
+            marshal_VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<
+                    const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_zero_initialize_workgroup_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES_KHR: {
+            marshal_VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_workgroup_memory_explicit_layout
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR: {
+            marshal_VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_format_feature_flags2
+        case VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3_KHR: {
+            marshal_VkFormatProperties3KHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkFormatProperties3KHR*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_maintenance4
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES_KHR: {
+            marshal_VkPhysicalDeviceMaintenance4FeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMaintenance4FeaturesKHR*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES_KHR: {
+            marshal_VkPhysicalDeviceMaintenance4PropertiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMaintenance4PropertiesKHR*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_ANDROID_native_buffer
+        case VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID: {
+            marshal_VkNativeBufferANDROID(
+                vkStream, rootType,
+                reinterpret_cast<const VkNativeBufferANDROID*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_debug_report
+        case VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT: {
+            marshal_VkDebugReportCallbackCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkDebugReportCallbackCreateInfoEXT*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_AMD_rasterization_order
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD: {
+            marshal_VkPipelineRasterizationStateRasterizationOrderAMD(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineRasterizationStateRasterizationOrderAMD*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_NV_dedicated_allocation
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV: {
+            marshal_VkDedicatedAllocationImageCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkDedicatedAllocationImageCreateInfoNV*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV: {
+            marshal_VkDedicatedAllocationBufferCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkDedicatedAllocationBufferCreateInfoNV*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV: {
+            marshal_VkDedicatedAllocationMemoryAllocateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkDedicatedAllocationMemoryAllocateInfoNV*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_transform_feedback
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceTransformFeedbackFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceTransformFeedbackFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT: {
+            marshal_VkPhysicalDeviceTransformFeedbackPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceTransformFeedbackPropertiesEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT: {
+            marshal_VkPipelineRasterizationStateStreamCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineRasterizationStateStreamCreateInfoEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_encode_h264
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_EXT: {
+            marshal_VkVideoEncodeH264CapabilitiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeH264CapabilitiesEXT*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_CREATE_INFO_EXT: {
+            marshal_VkVideoEncodeH264SessionCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeH264SessionCreateInfoEXT*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            marshal_VkVideoEncodeH264SessionParametersAddInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeH264SessionParametersAddInfoEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            marshal_VkVideoEncodeH264SessionParametersCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeH264SessionParametersCreateInfoEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_VCL_FRAME_INFO_EXT: {
+            marshal_VkVideoEncodeH264VclFrameInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeH264VclFrameInfoEXT*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_EMIT_PICTURE_PARAMETERS_EXT: {
+            marshal_VkVideoEncodeH264EmitPictureParametersEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeH264EmitPictureParametersEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_EXT: {
+            marshal_VkVideoEncodeH264ProfileEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeH264ProfileEXT*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_encode_h265
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_EXT: {
+            marshal_VkVideoEncodeH265CapabilitiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeH265CapabilitiesEXT*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_CREATE_INFO_EXT: {
+            marshal_VkVideoEncodeH265SessionCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeH265SessionCreateInfoEXT*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            marshal_VkVideoEncodeH265SessionParametersAddInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeH265SessionParametersAddInfoEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            marshal_VkVideoEncodeH265SessionParametersCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeH265SessionParametersCreateInfoEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_VCL_FRAME_INFO_EXT: {
+            marshal_VkVideoEncodeH265VclFrameInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeH265VclFrameInfoEXT*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_EMIT_PICTURE_PARAMETERS_EXT: {
+            marshal_VkVideoEncodeH265EmitPictureParametersEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeH265EmitPictureParametersEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_EXT: {
+            marshal_VkVideoEncodeH265ProfileEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeH265ProfileEXT*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_decode_h264
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_EXT: {
+            marshal_VkVideoDecodeH264ProfileEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH264ProfileEXT*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_EXT: {
+            marshal_VkVideoDecodeH264CapabilitiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH264CapabilitiesEXT*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_CREATE_INFO_EXT: {
+            marshal_VkVideoDecodeH264SessionCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH264SessionCreateInfoEXT*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            marshal_VkVideoDecodeH264SessionParametersAddInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH264SessionParametersAddInfoEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            marshal_VkVideoDecodeH264SessionParametersCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH264SessionParametersCreateInfoEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PICTURE_INFO_EXT: {
+            marshal_VkVideoDecodeH264PictureInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH264PictureInfoEXT*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_MVC_EXT: {
+            marshal_VkVideoDecodeH264MvcEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH264MvcEXT*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_EXT: {
+            marshal_VkVideoDecodeH264DpbSlotInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH264DpbSlotInfoEXT*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_AMD_texture_gather_bias_lod
+        case VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD: {
+            marshal_VkTextureLODGatherFormatPropertiesAMD(
+                vkStream, rootType,
+                reinterpret_cast<const VkTextureLODGatherFormatPropertiesAMD*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_NV_corner_sampled_image
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV: {
+            marshal_VkPhysicalDeviceCornerSampledImageFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceCornerSampledImageFeaturesNV*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_NV_external_memory
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV: {
+            marshal_VkExternalMemoryImageCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkExternalMemoryImageCreateInfoNV*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV: {
+            marshal_VkExportMemoryAllocateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkExportMemoryAllocateInfoNV*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_NV_external_memory_win32
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV: {
+            marshal_VkImportMemoryWin32HandleInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkImportMemoryWin32HandleInfoNV*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV: {
+            marshal_VkExportMemoryWin32HandleInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkExportMemoryWin32HandleInfoNV*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_NV_win32_keyed_mutex
+        case VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV: {
+            marshal_VkWin32KeyedMutexAcquireReleaseInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkWin32KeyedMutexAcquireReleaseInfoNV*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_validation_flags
+        case VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT: {
+            marshal_VkValidationFlagsEXT(
+                vkStream, rootType, reinterpret_cast<const VkValidationFlagsEXT*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_texture_compression_astc_hdr
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_astc_decode_mode
+        case VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT: {
+            marshal_VkImageViewASTCDecodeModeEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkImageViewASTCDecodeModeEXT*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceASTCDecodeFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceASTCDecodeFeaturesEXT*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_conditional_rendering
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceConditionalRenderingFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceConditionalRenderingFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT: {
+            marshal_VkCommandBufferInheritanceConditionalRenderingInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkCommandBufferInheritanceConditionalRenderingInfoEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV: {
+            marshal_VkPipelineViewportWScalingStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineViewportWScalingStateCreateInfoNV*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_display_control
+        case VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT: {
+            marshal_VkSwapchainCounterCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkSwapchainCounterCreateInfoEXT*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_GOOGLE_display_timing
+        case VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE: {
+            marshal_VkPresentTimesInfoGOOGLE(
+                vkStream, rootType,
+                reinterpret_cast<const VkPresentTimesInfoGOOGLE*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_NVX_multiview_per_view_attributes
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX: {
+            marshal_VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_NV_viewport_swizzle
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV: {
+            marshal_VkPipelineViewportSwizzleStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineViewportSwizzleStateCreateInfoNV*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_discard_rectangles
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT: {
+            marshal_VkPhysicalDeviceDiscardRectanglePropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDiscardRectanglePropertiesEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT: {
+            marshal_VkPipelineDiscardRectangleStateCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineDiscardRectangleStateCreateInfoEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_conservative_rasterization
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT: {
+            marshal_VkPhysicalDeviceConservativeRasterizationPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceConservativeRasterizationPropertiesEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT: {
+            marshal_VkPipelineRasterizationConservativeStateCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineRasterizationConservativeStateCreateInfoEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_depth_clip_enable
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceDepthClipEnableFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDepthClipEnableFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT: {
+            marshal_VkPipelineRasterizationDepthClipStateCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineRasterizationDepthClipStateCreateInfoEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_debug_utils
+        case VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT: {
+            marshal_VkDebugUtilsMessengerCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkDebugUtilsMessengerCreateInfoEXT*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID: {
+            marshal_VkAndroidHardwareBufferUsageANDROID(
+                vkStream, rootType,
+                reinterpret_cast<const VkAndroidHardwareBufferUsageANDROID*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID: {
+            marshal_VkAndroidHardwareBufferFormatPropertiesANDROID(
+                vkStream, rootType,
+                reinterpret_cast<const VkAndroidHardwareBufferFormatPropertiesANDROID*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID: {
+            marshal_VkImportAndroidHardwareBufferInfoANDROID(
+                vkStream, rootType,
+                reinterpret_cast<const VkImportAndroidHardwareBufferInfoANDROID*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID: {
+            marshal_VkExternalFormatANDROID(
+                vkStream, rootType,
+                reinterpret_cast<const VkExternalFormatANDROID*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID: {
+            marshal_VkAndroidHardwareBufferFormatProperties2ANDROID(
+                vkStream, rootType,
+                reinterpret_cast<const VkAndroidHardwareBufferFormatProperties2ANDROID*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_inline_uniform_block
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceInlineUniformBlockFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceInlineUniformBlockFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT: {
+            marshal_VkPhysicalDeviceInlineUniformBlockPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceInlineUniformBlockPropertiesEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT: {
+            marshal_VkWriteDescriptorSetInlineUniformBlockEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkWriteDescriptorSetInlineUniformBlockEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO_EXT: {
+            marshal_VkDescriptorPoolInlineUniformBlockCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkDescriptorPoolInlineUniformBlockCreateInfoEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_sample_locations
+        case VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT: {
+            marshal_VkSampleLocationsInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkSampleLocationsInfoEXT*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT: {
+            marshal_VkRenderPassSampleLocationsBeginInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkRenderPassSampleLocationsBeginInfoEXT*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT: {
+            marshal_VkPipelineSampleLocationsStateCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineSampleLocationsStateCreateInfoEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT: {
+            marshal_VkPhysicalDeviceSampleLocationsPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSampleLocationsPropertiesEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_blend_operation_advanced
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT: {
+            marshal_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT: {
+            marshal_VkPipelineColorBlendAdvancedStateCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineColorBlendAdvancedStateCreateInfoEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_NV_fragment_coverage_to_color
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV: {
+            marshal_VkPipelineCoverageToColorStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineCoverageToColorStateCreateInfoNV*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_NV_framebuffer_mixed_samples
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV: {
+            marshal_VkPipelineCoverageModulationStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineCoverageModulationStateCreateInfoNV*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_NV_shader_sm_builtins
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV: {
+            marshal_VkPhysicalDeviceShaderSMBuiltinsPropertiesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderSMBuiltinsPropertiesNV*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV: {
+            marshal_VkPhysicalDeviceShaderSMBuiltinsFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderSMBuiltinsFeaturesNV*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+        case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT: {
+            marshal_VkDrmFormatModifierPropertiesListEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkDrmFormatModifierPropertiesListEXT*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT: {
+            marshal_VkPhysicalDeviceImageDrmFormatModifierInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceImageDrmFormatModifierInfoEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT: {
+            marshal_VkImageDrmFormatModifierListCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkImageDrmFormatModifierListCreateInfoEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT: {
+            marshal_VkImageDrmFormatModifierExplicitCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkImageDrmFormatModifierExplicitCreateInfoEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT: {
+            marshal_VkDrmFormatModifierPropertiesList2EXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkDrmFormatModifierPropertiesList2EXT*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_validation_cache
+        case VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT: {
+            marshal_VkShaderModuleValidationCacheCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkShaderModuleValidationCacheCreateInfoEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_NV_shading_rate_image
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV: {
+            marshal_VkPipelineViewportShadingRateImageStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineViewportShadingRateImageStateCreateInfoNV*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV: {
+            marshal_VkPhysicalDeviceShadingRateImageFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShadingRateImageFeaturesNV*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV: {
+            marshal_VkPhysicalDeviceShadingRateImagePropertiesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShadingRateImagePropertiesNV*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV: {
+            marshal_VkPipelineViewportCoarseSampleOrderStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineViewportCoarseSampleOrderStateCreateInfoNV*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_NV_ray_tracing
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV: {
+            marshal_VkWriteDescriptorSetAccelerationStructureNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkWriteDescriptorSetAccelerationStructureNV*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV: {
+            marshal_VkPhysicalDeviceRayTracingPropertiesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRayTracingPropertiesNV*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_NV_representative_fragment_test
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV: {
+            marshal_VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV: {
+            marshal_VkPipelineRepresentativeFragmentTestStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineRepresentativeFragmentTestStateCreateInfoNV*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_filter_cubic
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT: {
+            marshal_VkPhysicalDeviceImageViewImageFormatInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceImageViewImageFormatInfoEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT: {
+            marshal_VkFilterCubicImageViewImageFormatPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkFilterCubicImageViewImageFormatPropertiesEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_global_priority
+        case VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT: {
+            marshal_VkDeviceQueueGlobalPriorityCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkDeviceQueueGlobalPriorityCreateInfoEXT*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_external_memory_host
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT: {
+            marshal_VkImportMemoryHostPointerInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkImportMemoryHostPointerInfoEXT*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT: {
+            marshal_VkPhysicalDeviceExternalMemoryHostPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceExternalMemoryHostPropertiesEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_AMD_pipeline_compiler_control
+        case VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD: {
+            marshal_VkPipelineCompilerControlCreateInfoAMD(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineCompilerControlCreateInfoAMD*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_AMD_shader_core_properties
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD: {
+            marshal_VkPhysicalDeviceShaderCorePropertiesAMD(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderCorePropertiesAMD*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_decode_h265
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_EXT: {
+            marshal_VkVideoDecodeH265ProfileEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH265ProfileEXT*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_EXT: {
+            marshal_VkVideoDecodeH265CapabilitiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH265CapabilitiesEXT*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_CREATE_INFO_EXT: {
+            marshal_VkVideoDecodeH265SessionCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH265SessionCreateInfoEXT*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            marshal_VkVideoDecodeH265SessionParametersAddInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH265SessionParametersAddInfoEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            marshal_VkVideoDecodeH265SessionParametersCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH265SessionParametersCreateInfoEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PICTURE_INFO_EXT: {
+            marshal_VkVideoDecodeH265PictureInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH265PictureInfoEXT*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_EXT: {
+            marshal_VkVideoDecodeH265DpbSlotInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH265DpbSlotInfoEXT*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_AMD_memory_overallocation_behavior
+        case VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD: {
+            marshal_VkDeviceMemoryOverallocationCreateInfoAMD(
+                vkStream, rootType,
+                reinterpret_cast<const VkDeviceMemoryOverallocationCreateInfoAMD*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_vertex_attribute_divisor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT: {
+            marshal_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT: {
+            marshal_VkPipelineVertexInputDivisorStateCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineVertexInputDivisorStateCreateInfoEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_GGP_frame_token
+        case VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP: {
+            marshal_VkPresentFrameTokenGGP(
+                vkStream, rootType,
+                reinterpret_cast<const VkPresentFrameTokenGGP*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_pipeline_creation_feedback
+        case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT: {
+            marshal_VkPipelineCreationFeedbackCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineCreationFeedbackCreateInfoEXT*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_NV_compute_shader_derivatives
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV: {
+            marshal_VkPhysicalDeviceComputeShaderDerivativesFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceComputeShaderDerivativesFeaturesNV*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_NV_mesh_shader
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV: {
+            marshal_VkPhysicalDeviceMeshShaderFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMeshShaderFeaturesNV*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV: {
+            marshal_VkPhysicalDeviceMeshShaderPropertiesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMeshShaderPropertiesNV*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_NV_fragment_shader_barycentric
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV: {
+            marshal_VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_NV_shader_image_footprint
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV: {
+            marshal_VkPhysicalDeviceShaderImageFootprintFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderImageFootprintFeaturesNV*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_NV_scissor_exclusive
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV: {
+            marshal_VkPipelineViewportExclusiveScissorStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineViewportExclusiveScissorStateCreateInfoNV*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV: {
+            marshal_VkPhysicalDeviceExclusiveScissorFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceExclusiveScissorFeaturesNV*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV: {
+            marshal_VkQueueFamilyCheckpointPropertiesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkQueueFamilyCheckpointPropertiesNV*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_INTEL_shader_integer_functions2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL: {
+            marshal_VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_INTEL_performance_query
+        case VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL: {
+            marshal_VkQueryPoolPerformanceQueryCreateInfoINTEL(
+                vkStream, rootType,
+                reinterpret_cast<const VkQueryPoolPerformanceQueryCreateInfoINTEL*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_pci_bus_info
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT: {
+            marshal_VkPhysicalDevicePCIBusInfoPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevicePCIBusInfoPropertiesEXT*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_AMD_display_native_hdr
+        case VK_STRUCTURE_TYPE_DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD: {
+            marshal_VkDisplayNativeHdrSurfaceCapabilitiesAMD(
+                vkStream, rootType,
+                reinterpret_cast<const VkDisplayNativeHdrSurfaceCapabilitiesAMD*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD: {
+            marshal_VkSwapchainDisplayNativeHdrCreateInfoAMD(
+                vkStream, rootType,
+                reinterpret_cast<const VkSwapchainDisplayNativeHdrCreateInfoAMD*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_fragment_density_map
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT: {
+            switch (rootType) {
+                case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: {
+                    marshal_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+                        vkStream, rootType,
+                        reinterpret_cast<const VkPhysicalDeviceFragmentDensityMapFeaturesEXT*>(
+                            structExtension));
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO: {
+                    marshal_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+                        vkStream, rootType,
+                        reinterpret_cast<const VkPhysicalDeviceFragmentDensityMapFeaturesEXT*>(
+                            structExtension));
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO: {
+                    marshal_VkImportColorBufferGOOGLE(
+                        vkStream, rootType,
+                        reinterpret_cast<const VkImportColorBufferGOOGLE*>(structExtension));
+                    break;
+                }
+                default: {
+                    marshal_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+                        vkStream, rootType,
+                        reinterpret_cast<const VkPhysicalDeviceFragmentDensityMapFeaturesEXT*>(
+                            structExtension));
+                    break;
+                }
+            }
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT: {
+            switch (rootType) {
+                case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2: {
+                    marshal_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
+                        vkStream, rootType,
+                        reinterpret_cast<const VkPhysicalDeviceFragmentDensityMapPropertiesEXT*>(
+                            structExtension));
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO: {
+                    marshal_VkCreateBlobGOOGLE(
+                        vkStream, rootType,
+                        reinterpret_cast<const VkCreateBlobGOOGLE*>(structExtension));
+                    break;
+                }
+                default: {
+                    marshal_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
+                        vkStream, rootType,
+                        reinterpret_cast<const VkPhysicalDeviceFragmentDensityMapPropertiesEXT*>(
+                            structExtension));
+                    break;
+                }
+            }
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT: {
+            switch (rootType) {
+                case VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO: {
+                    marshal_VkRenderPassFragmentDensityMapCreateInfoEXT(
+                        vkStream, rootType,
+                        reinterpret_cast<const VkRenderPassFragmentDensityMapCreateInfoEXT*>(
+                            structExtension));
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2: {
+                    marshal_VkRenderPassFragmentDensityMapCreateInfoEXT(
+                        vkStream, rootType,
+                        reinterpret_cast<const VkRenderPassFragmentDensityMapCreateInfoEXT*>(
+                            structExtension));
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO: {
+                    marshal_VkImportBufferGOOGLE(
+                        vkStream, rootType,
+                        reinterpret_cast<const VkImportBufferGOOGLE*>(structExtension));
+                    break;
+                }
+                default: {
+                    marshal_VkRenderPassFragmentDensityMapCreateInfoEXT(
+                        vkStream, rootType,
+                        reinterpret_cast<const VkRenderPassFragmentDensityMapCreateInfoEXT*>(
+                            structExtension));
+                    break;
+                }
+            }
+            break;
+        }
+#endif
+#ifdef VK_EXT_subgroup_size_control
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceSubgroupSizeControlFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSubgroupSizeControlFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT: {
+            marshal_VkPhysicalDeviceSubgroupSizeControlPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSubgroupSizeControlPropertiesEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT: {
+            marshal_VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_AMD_shader_core_properties2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD: {
+            marshal_VkPhysicalDeviceShaderCoreProperties2AMD(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderCoreProperties2AMD*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_AMD_device_coherent_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD: {
+            marshal_VkPhysicalDeviceCoherentMemoryFeaturesAMD(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceCoherentMemoryFeaturesAMD*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_image_atomic_int64
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_memory_budget
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT: {
+            marshal_VkPhysicalDeviceMemoryBudgetPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMemoryBudgetPropertiesEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_memory_priority
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceMemoryPriorityFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMemoryPriorityFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT: {
+            marshal_VkMemoryPriorityAllocateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkMemoryPriorityAllocateInfoEXT*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_NV_dedicated_allocation_image_aliasing
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV: {
+            marshal_VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_buffer_device_address
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT: {
+            marshal_VkBufferDeviceAddressCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkBufferDeviceAddressCreateInfoEXT*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_validation_features
+        case VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT: {
+            marshal_VkValidationFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkValidationFeaturesEXT*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_NV_cooperative_matrix
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV: {
+            marshal_VkPhysicalDeviceCooperativeMatrixFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceCooperativeMatrixFeaturesNV*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV: {
+            marshal_VkPhysicalDeviceCooperativeMatrixPropertiesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceCooperativeMatrixPropertiesNV*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV: {
+            marshal_VkPhysicalDeviceCoverageReductionModeFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceCoverageReductionModeFeaturesNV*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV: {
+            marshal_VkPipelineCoverageReductionStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineCoverageReductionStateCreateInfoNV*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_fragment_shader_interlock
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_ycbcr_image_arrays
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceYcbcrImageArraysFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_provoking_vertex
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceProvokingVertexFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceProvokingVertexFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT: {
+            marshal_VkPhysicalDeviceProvokingVertexPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceProvokingVertexPropertiesEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT: {
+            marshal_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+        case VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT: {
+            marshal_VkSurfaceFullScreenExclusiveInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkSurfaceFullScreenExclusiveInfoEXT*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT: {
+            marshal_VkSurfaceCapabilitiesFullScreenExclusiveEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkSurfaceCapabilitiesFullScreenExclusiveEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT: {
+            marshal_VkSurfaceFullScreenExclusiveWin32InfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkSurfaceFullScreenExclusiveWin32InfoEXT*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_line_rasterization
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceLineRasterizationFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceLineRasterizationFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT: {
+            marshal_VkPhysicalDeviceLineRasterizationPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceLineRasterizationPropertiesEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT: {
+            marshal_VkPipelineRasterizationLineStateCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineRasterizationLineStateCreateInfoEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_atomic_float
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceShaderAtomicFloatFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_index_type_uint8
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceIndexTypeUint8FeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceIndexTypeUint8FeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceExtendedDynamicStateFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_atomic_float2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_demote_to_helper_invocation
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_NV_device_generated_commands
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV: {
+            marshal_VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV: {
+            marshal_VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV: {
+            marshal_VkGraphicsPipelineShaderGroupsCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkGraphicsPipelineShaderGroupsCreateInfoNV*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_NV_inherited_viewport_scissor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV: {
+            marshal_VkPhysicalDeviceInheritedViewportScissorFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceInheritedViewportScissorFeaturesNV*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV: {
+            marshal_VkCommandBufferInheritanceViewportScissorInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkCommandBufferInheritanceViewportScissorInfoNV*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_texel_buffer_alignment
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT: {
+            marshal_VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_QCOM_render_pass_transform
+        case VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM: {
+            marshal_VkRenderPassTransformBeginInfoQCOM(
+                vkStream, rootType,
+                reinterpret_cast<const VkRenderPassTransformBeginInfoQCOM*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM: {
+            marshal_VkCommandBufferInheritanceRenderPassTransformInfoQCOM(
+                vkStream, rootType,
+                reinterpret_cast<const VkCommandBufferInheritanceRenderPassTransformInfoQCOM*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_device_memory_report
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceDeviceMemoryReportFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDeviceMemoryReportFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT: {
+            marshal_VkDeviceDeviceMemoryReportCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkDeviceDeviceMemoryReportCreateInfoEXT*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_robustness2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceRobustness2FeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRobustness2FeaturesEXT*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT: {
+            marshal_VkPhysicalDeviceRobustness2PropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRobustness2PropertiesEXT*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_custom_border_color
+        case VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT: {
+            marshal_VkSamplerCustomBorderColorCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkSamplerCustomBorderColorCreateInfoEXT*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT: {
+            marshal_VkPhysicalDeviceCustomBorderColorPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceCustomBorderColorPropertiesEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceCustomBorderColorFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceCustomBorderColorFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_private_data
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT: {
+            marshal_VkPhysicalDevicePrivateDataFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevicePrivateDataFeaturesEXT*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO_EXT: {
+            marshal_VkDevicePrivateDataCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkDevicePrivateDataCreateInfoEXT*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_pipeline_creation_cache_control
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES_EXT: {
+            marshal_VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_NV_device_diagnostics_config
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV: {
+            marshal_VkPhysicalDeviceDiagnosticsConfigFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDiagnosticsConfigFeaturesNV*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV: {
+            marshal_VkDeviceDiagnosticsConfigCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkDeviceDiagnosticsConfigCreateInfoNV*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV: {
+            marshal_VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV: {
+            marshal_VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV: {
+            marshal_VkPipelineFragmentShadingRateEnumStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineFragmentShadingRateEnumStateCreateInfoNV*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_NV_ray_tracing_motion_blur
+        case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV: {
+            marshal_VkAccelerationStructureGeometryMotionTrianglesDataNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkAccelerationStructureGeometryMotionTrianglesDataNV*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV: {
+            marshal_VkAccelerationStructureMotionInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkAccelerationStructureMotionInfoNV*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV: {
+            marshal_VkPhysicalDeviceRayTracingMotionBlurFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRayTracingMotionBlurFeaturesNV*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_ycbcr_2plane_444_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_fragment_density_map2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceFragmentDensityMap2FeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT: {
+            marshal_VkPhysicalDeviceFragmentDensityMap2PropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentDensityMap2PropertiesEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_QCOM_rotated_copy_commands
+        case VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM: {
+            marshal_VkCopyCommandTransformInfoQCOM(
+                vkStream, rootType,
+                reinterpret_cast<const VkCopyCommandTransformInfoQCOM*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_image_robustness
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceImageRobustnessFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceImageRobustnessFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_4444_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT: {
+            marshal_VkPhysicalDevice4444FormatsFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevice4444FormatsFeaturesEXT*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_rgba10x6_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_VALVE_mutable_descriptor_type
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE: {
+            marshal_VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE: {
+            marshal_VkMutableDescriptorTypeCreateInfoVALVE(
+                vkStream, rootType,
+                reinterpret_cast<const VkMutableDescriptorTypeCreateInfoVALVE*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_physical_device_drm
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT: {
+            marshal_VkPhysicalDeviceDrmPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDrmPropertiesEXT*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_primitive_topology_list_restart
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT: {
+            marshal_VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_FUCHSIA_external_memory
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA: {
+            marshal_VkImportMemoryZirconHandleInfoFUCHSIA(
+                vkStream, rootType,
+                reinterpret_cast<const VkImportMemoryZirconHandleInfoFUCHSIA*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA: {
+            marshal_VkImportMemoryBufferCollectionFUCHSIA(
+                vkStream, rootType,
+                reinterpret_cast<const VkImportMemoryBufferCollectionFUCHSIA*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA: {
+            marshal_VkBufferCollectionImageCreateInfoFUCHSIA(
+                vkStream, rootType,
+                reinterpret_cast<const VkBufferCollectionImageCreateInfoFUCHSIA*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA: {
+            marshal_VkBufferCollectionBufferCreateInfoFUCHSIA(
+                vkStream, rootType,
+                reinterpret_cast<const VkBufferCollectionBufferCreateInfoFUCHSIA*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+        case VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI: {
+            marshal_VkSubpassShadingPipelineCreateInfoHUAWEI(
+                vkStream, rootType,
+                reinterpret_cast<const VkSubpassShadingPipelineCreateInfoHUAWEI*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI: {
+            marshal_VkPhysicalDeviceSubpassShadingFeaturesHUAWEI(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSubpassShadingFeaturesHUAWEI*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI: {
+            marshal_VkPhysicalDeviceSubpassShadingPropertiesHUAWEI(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSubpassShadingPropertiesHUAWEI*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI: {
+            marshal_VkPhysicalDeviceInvocationMaskFeaturesHUAWEI(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceInvocationMaskFeaturesHUAWEI*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_NV_external_memory_rdma
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_RDMA_FEATURES_NV: {
+            marshal_VkPhysicalDeviceExternalMemoryRDMAFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceExternalMemoryRDMAFeaturesNV*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceExtendedDynamicState2FeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_color_write_enable
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceColorWriteEnableFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceColorWriteEnableFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT: {
+            marshal_VkPipelineColorWriteCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineColorWriteCreateInfoEXT*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_GOOGLE_gfxstream
+        case VK_STRUCTURE_TYPE_IMPORT_COLOR_BUFFER_GOOGLE: {
+            marshal_VkImportColorBufferGOOGLE(
+                vkStream, rootType,
+                reinterpret_cast<const VkImportColorBufferGOOGLE*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMPORT_BUFFER_GOOGLE: {
+            marshal_VkImportBufferGOOGLE(
+                vkStream, rootType, reinterpret_cast<const VkImportBufferGOOGLE*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_CREATE_BLOB_GOOGLE: {
+            marshal_VkCreateBlobGOOGLE(
+                vkStream, rootType, reinterpret_cast<const VkCreateBlobGOOGLE*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_global_priority_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_EXT: {
+            marshal_VkQueueFamilyGlobalPriorityPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkQueueFamilyGlobalPriorityPropertiesEXT*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_multi_draw
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceMultiDrawFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMultiDrawFeaturesEXT*>(structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT: {
+            marshal_VkPhysicalDeviceMultiDrawPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMultiDrawPropertiesEXT*>(structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_border_color_swizzle
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT: {
+            marshal_VkPhysicalDeviceBorderColorSwizzleFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT: {
+            marshal_VkSamplerBorderColorComponentMappingCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkSamplerBorderColorComponentMappingCreateInfoEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT: {
+            marshal_VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_acceleration_structure
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR: {
+            marshal_VkWriteDescriptorSetAccelerationStructureKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkWriteDescriptorSetAccelerationStructureKHR*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR: {
+            marshal_VkPhysicalDeviceAccelerationStructureFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceAccelerationStructureFeaturesKHR*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR: {
+            marshal_VkPhysicalDeviceAccelerationStructurePropertiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceAccelerationStructurePropertiesKHR*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR: {
+            marshal_VkPhysicalDeviceRayTracingPipelineFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRayTracingPipelineFeaturesKHR*>(
+                    structExtension));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR: {
+            marshal_VkPhysicalDeviceRayTracingPipelinePropertiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRayTracingPipelinePropertiesKHR*>(
+                    structExtension));
+            break;
+        }
+#endif
+#ifdef VK_KHR_ray_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR: {
+            marshal_VkPhysicalDeviceRayQueryFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRayQueryFeaturesKHR*>(structExtension));
+            break;
+        }
+#endif
+        default: {
+            // fatal; the switch is only taken if the extension struct is known
+            abort();
+        }
+    }
+}
+
+void unmarshal_extension_struct(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                void* structExtension_out) {
+    VkInstanceCreateInfo* structAccess = (VkInstanceCreateInfo*)(structExtension_out);
+    size_t currExtSize = goldfish_vk_extension_struct_size_with_stream_features(
+        vkStream->getFeatureBits(), rootType, structExtension_out);
+    if (!currExtSize && structExtension_out) {
+        // unknown struct extension; skip and call on its pNext field
+        unmarshal_extension_struct(vkStream, rootType, (void*)structAccess->pNext);
+        return;
+    } else {
+        // known or null extension struct
+        vkStream->getBe32();
+        if (!currExtSize) {
+            // exit if this was a null extension struct (size == 0 in this branch)
+            return;
+        }
+    }
+    uint64_t pNext_placeholder;
+    vkStream->read((void*)(&pNext_placeholder), sizeof(VkStructureType));
+    (void)pNext_placeholder;
+    if (!structExtension_out) {
+        return;
+    }
+    uint32_t structType = (uint32_t)goldfish_vk_struct_type(structExtension_out);
+    switch (structType) {
+#ifdef VK_VERSION_1_1
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES: {
+            unmarshal_VkPhysicalDeviceSubgroupProperties(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceSubgroupProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: {
+            unmarshal_VkPhysicalDevice16BitStorageFeatures(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDevice16BitStorageFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS: {
+            unmarshal_VkMemoryDedicatedRequirements(
+                vkStream, rootType,
+                reinterpret_cast<VkMemoryDedicatedRequirements*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO: {
+            unmarshal_VkMemoryDedicatedAllocateInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkMemoryDedicatedAllocateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO: {
+            unmarshal_VkMemoryAllocateFlagsInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkMemoryAllocateFlagsInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO: {
+            unmarshal_VkDeviceGroupRenderPassBeginInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkDeviceGroupRenderPassBeginInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO: {
+            unmarshal_VkDeviceGroupCommandBufferBeginInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkDeviceGroupCommandBufferBeginInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO: {
+            unmarshal_VkDeviceGroupSubmitInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkDeviceGroupSubmitInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO: {
+            unmarshal_VkDeviceGroupBindSparseInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkDeviceGroupBindSparseInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO: {
+            unmarshal_VkBindBufferMemoryDeviceGroupInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkBindBufferMemoryDeviceGroupInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO: {
+            unmarshal_VkBindImageMemoryDeviceGroupInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkBindImageMemoryDeviceGroupInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO: {
+            unmarshal_VkDeviceGroupDeviceCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkDeviceGroupDeviceCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: {
+            unmarshal_VkPhysicalDeviceFeatures2(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceFeatures2*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES: {
+            unmarshal_VkPhysicalDevicePointClippingProperties(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDevicePointClippingProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO: {
+            unmarshal_VkRenderPassInputAttachmentAspectCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkRenderPassInputAttachmentAspectCreateInfo*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO: {
+            unmarshal_VkImageViewUsageCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkImageViewUsageCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO: {
+            unmarshal_VkPipelineTessellationDomainOriginStateCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkPipelineTessellationDomainOriginStateCreateInfo*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO: {
+            unmarshal_VkRenderPassMultiviewCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkRenderPassMultiviewCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES: {
+            unmarshal_VkPhysicalDeviceMultiviewFeatures(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceMultiviewFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES: {
+            unmarshal_VkPhysicalDeviceMultiviewProperties(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceMultiviewProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES: {
+            unmarshal_VkPhysicalDeviceVariablePointersFeatures(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceVariablePointersFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES: {
+            unmarshal_VkPhysicalDeviceProtectedMemoryFeatures(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceProtectedMemoryFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES: {
+            unmarshal_VkPhysicalDeviceProtectedMemoryProperties(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceProtectedMemoryProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO: {
+            unmarshal_VkProtectedSubmitInfo(
+                vkStream, rootType, reinterpret_cast<VkProtectedSubmitInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO: {
+            unmarshal_VkSamplerYcbcrConversionInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkSamplerYcbcrConversionInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO: {
+            unmarshal_VkBindImagePlaneMemoryInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkBindImagePlaneMemoryInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO: {
+            unmarshal_VkImagePlaneMemoryRequirementsInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkImagePlaneMemoryRequirementsInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: {
+            unmarshal_VkPhysicalDeviceSamplerYcbcrConversionFeatures(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceSamplerYcbcrConversionFeatures*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES: {
+            unmarshal_VkSamplerYcbcrConversionImageFormatProperties(
+                vkStream, rootType,
+                reinterpret_cast<VkSamplerYcbcrConversionImageFormatProperties*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO: {
+            unmarshal_VkPhysicalDeviceExternalImageFormatInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceExternalImageFormatInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES: {
+            unmarshal_VkExternalImageFormatProperties(
+                vkStream, rootType,
+                reinterpret_cast<VkExternalImageFormatProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES: {
+            unmarshal_VkPhysicalDeviceIDProperties(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceIDProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO: {
+            unmarshal_VkExternalMemoryImageCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkExternalMemoryImageCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO: {
+            unmarshal_VkExternalMemoryBufferCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkExternalMemoryBufferCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO: {
+            unmarshal_VkExportMemoryAllocateInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkExportMemoryAllocateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO: {
+            unmarshal_VkExportFenceCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkExportFenceCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO: {
+            unmarshal_VkExportSemaphoreCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkExportSemaphoreCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES: {
+            unmarshal_VkPhysicalDeviceMaintenance3Properties(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceMaintenance3Properties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES: {
+            unmarshal_VkPhysicalDeviceShaderDrawParametersFeatures(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceShaderDrawParametersFeatures*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_VERSION_1_2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES: {
+            unmarshal_VkPhysicalDeviceVulkan11Features(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceVulkan11Features*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES: {
+            unmarshal_VkPhysicalDeviceVulkan11Properties(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceVulkan11Properties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES: {
+            unmarshal_VkPhysicalDeviceVulkan12Features(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceVulkan12Features*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES: {
+            unmarshal_VkPhysicalDeviceVulkan12Properties(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceVulkan12Properties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO: {
+            unmarshal_VkImageFormatListCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkImageFormatListCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES: {
+            unmarshal_VkPhysicalDevice8BitStorageFeatures(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDevice8BitStorageFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES: {
+            unmarshal_VkPhysicalDeviceDriverProperties(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceDriverProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES: {
+            unmarshal_VkPhysicalDeviceShaderAtomicInt64Features(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceShaderAtomicInt64Features*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES: {
+            unmarshal_VkPhysicalDeviceShaderFloat16Int8Features(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceShaderFloat16Int8Features*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES: {
+            unmarshal_VkPhysicalDeviceFloatControlsProperties(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceFloatControlsProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO: {
+            unmarshal_VkDescriptorSetLayoutBindingFlagsCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkDescriptorSetLayoutBindingFlagsCreateInfo*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES: {
+            unmarshal_VkPhysicalDeviceDescriptorIndexingFeatures(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceDescriptorIndexingFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES: {
+            unmarshal_VkPhysicalDeviceDescriptorIndexingProperties(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceDescriptorIndexingProperties*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO: {
+            unmarshal_VkDescriptorSetVariableDescriptorCountAllocateInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkDescriptorSetVariableDescriptorCountAllocateInfo*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT: {
+            unmarshal_VkDescriptorSetVariableDescriptorCountLayoutSupport(
+                vkStream, rootType,
+                reinterpret_cast<VkDescriptorSetVariableDescriptorCountLayoutSupport*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE: {
+            unmarshal_VkSubpassDescriptionDepthStencilResolve(
+                vkStream, rootType,
+                reinterpret_cast<VkSubpassDescriptionDepthStencilResolve*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES: {
+            unmarshal_VkPhysicalDeviceDepthStencilResolveProperties(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceDepthStencilResolveProperties*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES: {
+            unmarshal_VkPhysicalDeviceScalarBlockLayoutFeatures(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceScalarBlockLayoutFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO: {
+            unmarshal_VkImageStencilUsageCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkImageStencilUsageCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO: {
+            unmarshal_VkSamplerReductionModeCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkSamplerReductionModeCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES: {
+            unmarshal_VkPhysicalDeviceSamplerFilterMinmaxProperties(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceSamplerFilterMinmaxProperties*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES: {
+            unmarshal_VkPhysicalDeviceVulkanMemoryModelFeatures(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceVulkanMemoryModelFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES: {
+            unmarshal_VkPhysicalDeviceImagelessFramebufferFeatures(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceImagelessFramebufferFeatures*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO: {
+            unmarshal_VkFramebufferAttachmentsCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkFramebufferAttachmentsCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO: {
+            unmarshal_VkRenderPassAttachmentBeginInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkRenderPassAttachmentBeginInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES: {
+            unmarshal_VkPhysicalDeviceUniformBufferStandardLayoutFeatures(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceUniformBufferStandardLayoutFeatures*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES: {
+            unmarshal_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES: {
+            unmarshal_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT: {
+            unmarshal_VkAttachmentReferenceStencilLayout(
+                vkStream, rootType,
+                reinterpret_cast<VkAttachmentReferenceStencilLayout*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT: {
+            unmarshal_VkAttachmentDescriptionStencilLayout(
+                vkStream, rootType,
+                reinterpret_cast<VkAttachmentDescriptionStencilLayout*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES: {
+            unmarshal_VkPhysicalDeviceHostQueryResetFeatures(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceHostQueryResetFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES: {
+            unmarshal_VkPhysicalDeviceTimelineSemaphoreFeatures(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceTimelineSemaphoreFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES: {
+            unmarshal_VkPhysicalDeviceTimelineSemaphoreProperties(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceTimelineSemaphoreProperties*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO: {
+            unmarshal_VkSemaphoreTypeCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkSemaphoreTypeCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO: {
+            unmarshal_VkTimelineSemaphoreSubmitInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkTimelineSemaphoreSubmitInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES: {
+            unmarshal_VkPhysicalDeviceBufferDeviceAddressFeatures(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceBufferDeviceAddressFeatures*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO: {
+            unmarshal_VkBufferOpaqueCaptureAddressCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkBufferOpaqueCaptureAddressCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO: {
+            unmarshal_VkMemoryOpaqueCaptureAddressAllocateInfo(
+                vkStream, rootType,
+                reinterpret_cast<VkMemoryOpaqueCaptureAddressAllocateInfo*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_swapchain
+        case VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR: {
+            unmarshal_VkImageSwapchainCreateInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkImageSwapchainCreateInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR: {
+            unmarshal_VkBindImageMemorySwapchainInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkBindImageMemorySwapchainInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR: {
+            unmarshal_VkDeviceGroupPresentInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkDeviceGroupPresentInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR: {
+            unmarshal_VkDeviceGroupSwapchainCreateInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkDeviceGroupSwapchainCreateInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_display_swapchain
+        case VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR: {
+            unmarshal_VkDisplayPresentInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkDisplayPresentInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_video_queue
+        case VK_STRUCTURE_TYPE_VIDEO_QUEUE_FAMILY_PROPERTIES_2_KHR: {
+            unmarshal_VkVideoQueueFamilyProperties2KHR(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoQueueFamilyProperties2KHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_PROFILE_KHR: {
+            unmarshal_VkVideoProfileKHR(vkStream, rootType,
+                                        reinterpret_cast<VkVideoProfileKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_PROFILES_KHR: {
+            unmarshal_VkVideoProfilesKHR(
+                vkStream, rootType, reinterpret_cast<VkVideoProfilesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_dynamic_rendering
+        case VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO_KHR: {
+            unmarshal_VkPipelineRenderingCreateInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkPipelineRenderingCreateInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR: {
+            unmarshal_VkPhysicalDeviceDynamicRenderingFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceDynamicRenderingFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO_KHR: {
+            unmarshal_VkCommandBufferInheritanceRenderingInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkCommandBufferInheritanceRenderingInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR: {
+            unmarshal_VkRenderingFragmentShadingRateAttachmentInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkRenderingFragmentShadingRateAttachmentInfoKHR*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT: {
+            unmarshal_VkRenderingFragmentDensityMapAttachmentInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkRenderingFragmentDensityMapAttachmentInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD: {
+            unmarshal_VkAttachmentSampleCountInfoAMD(
+                vkStream, rootType,
+                reinterpret_cast<VkAttachmentSampleCountInfoAMD*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX: {
+            unmarshal_VkMultiviewPerViewAttributesInfoNVX(
+                vkStream, rootType,
+                reinterpret_cast<VkMultiviewPerViewAttributesInfoNVX*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_memory_win32
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR: {
+            unmarshal_VkImportMemoryWin32HandleInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkImportMemoryWin32HandleInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR: {
+            unmarshal_VkExportMemoryWin32HandleInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkExportMemoryWin32HandleInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_memory_fd
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR: {
+            unmarshal_VkImportMemoryFdInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkImportMemoryFdInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_win32_keyed_mutex
+        case VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR: {
+            unmarshal_VkWin32KeyedMutexAcquireReleaseInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkWin32KeyedMutexAcquireReleaseInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+        case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR: {
+            unmarshal_VkExportSemaphoreWin32HandleInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkExportSemaphoreWin32HandleInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR: {
+            unmarshal_VkD3D12FenceSubmitInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkD3D12FenceSubmitInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_push_descriptor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR: {
+            unmarshal_VkPhysicalDevicePushDescriptorPropertiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDevicePushDescriptorPropertiesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_incremental_present
+        case VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR: {
+            unmarshal_VkPresentRegionsKHR(
+                vkStream, rootType, reinterpret_cast<VkPresentRegionsKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shared_presentable_image
+        case VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR: {
+            unmarshal_VkSharedPresentSurfaceCapabilitiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkSharedPresentSurfaceCapabilitiesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_fence_win32
+        case VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR: {
+            unmarshal_VkExportFenceWin32HandleInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkExportFenceWin32HandleInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_performance_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR: {
+            unmarshal_VkPhysicalDevicePerformanceQueryFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDevicePerformanceQueryFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR: {
+            unmarshal_VkPhysicalDevicePerformanceQueryPropertiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDevicePerformanceQueryPropertiesKHR*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR: {
+            unmarshal_VkQueryPoolPerformanceCreateInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkQueryPoolPerformanceCreateInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR: {
+            unmarshal_VkPerformanceQuerySubmitInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkPerformanceQuerySubmitInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_portability_subset
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR: {
+            unmarshal_VkPhysicalDevicePortabilitySubsetFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDevicePortabilitySubsetFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR: {
+            unmarshal_VkPhysicalDevicePortabilitySubsetPropertiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDevicePortabilitySubsetPropertiesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_clock
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR: {
+            unmarshal_VkPhysicalDeviceShaderClockFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceShaderClockFeaturesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_terminate_invocation
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR: {
+            unmarshal_VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+        case VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR: {
+            unmarshal_VkFragmentShadingRateAttachmentInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkFragmentShadingRateAttachmentInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR: {
+            unmarshal_VkPipelineFragmentShadingRateStateCreateInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkPipelineFragmentShadingRateStateCreateInfoKHR*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR: {
+            unmarshal_VkPhysicalDeviceFragmentShadingRateFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceFragmentShadingRateFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR: {
+            unmarshal_VkPhysicalDeviceFragmentShadingRatePropertiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceFragmentShadingRatePropertiesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_surface_protected_capabilities
+        case VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR: {
+            unmarshal_VkSurfaceProtectedCapabilitiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkSurfaceProtectedCapabilitiesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_present_wait
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR: {
+            unmarshal_VkPhysicalDevicePresentWaitFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDevicePresentWaitFeaturesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR: {
+            unmarshal_VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_integer_dot_product
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR: {
+            unmarshal_VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR: {
+            unmarshal_VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_present_id
+        case VK_STRUCTURE_TYPE_PRESENT_ID_KHR: {
+            unmarshal_VkPresentIdKHR(vkStream, rootType,
+                                     reinterpret_cast<VkPresentIdKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR: {
+            unmarshal_VkPhysicalDevicePresentIdFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDevicePresentIdFeaturesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_video_encode_queue
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_INFO_KHR: {
+            unmarshal_VkVideoEncodeRateControlInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoEncodeRateControlInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_synchronization2
+        case VK_STRUCTURE_TYPE_MEMORY_BARRIER_2_KHR: {
+            unmarshal_VkMemoryBarrier2KHR(
+                vkStream, rootType, reinterpret_cast<VkMemoryBarrier2KHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR: {
+            unmarshal_VkPhysicalDeviceSynchronization2FeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceSynchronization2FeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV: {
+            unmarshal_VkQueueFamilyCheckpointProperties2NV(
+                vkStream, rootType,
+                reinterpret_cast<VkQueueFamilyCheckpointProperties2NV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_subgroup_uniform_control_flow
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR: {
+            unmarshal_VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_zero_initialize_workgroup_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES_KHR: {
+            unmarshal_VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_workgroup_memory_explicit_layout
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR: {
+            unmarshal_VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_format_feature_flags2
+        case VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3_KHR: {
+            unmarshal_VkFormatProperties3KHR(
+                vkStream, rootType, reinterpret_cast<VkFormatProperties3KHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_maintenance4
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES_KHR: {
+            unmarshal_VkPhysicalDeviceMaintenance4FeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceMaintenance4FeaturesKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES_KHR: {
+            unmarshal_VkPhysicalDeviceMaintenance4PropertiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceMaintenance4PropertiesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_ANDROID_native_buffer
+        case VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID: {
+            unmarshal_VkNativeBufferANDROID(
+                vkStream, rootType, reinterpret_cast<VkNativeBufferANDROID*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_debug_report
+        case VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT: {
+            unmarshal_VkDebugReportCallbackCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkDebugReportCallbackCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_rasterization_order
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD: {
+            unmarshal_VkPipelineRasterizationStateRasterizationOrderAMD(
+                vkStream, rootType,
+                reinterpret_cast<VkPipelineRasterizationStateRasterizationOrderAMD*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_dedicated_allocation
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV: {
+            unmarshal_VkDedicatedAllocationImageCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<VkDedicatedAllocationImageCreateInfoNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV: {
+            unmarshal_VkDedicatedAllocationBufferCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<VkDedicatedAllocationBufferCreateInfoNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV: {
+            unmarshal_VkDedicatedAllocationMemoryAllocateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<VkDedicatedAllocationMemoryAllocateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_transform_feedback
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceTransformFeedbackFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceTransformFeedbackFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT: {
+            unmarshal_VkPhysicalDeviceTransformFeedbackPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceTransformFeedbackPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT: {
+            unmarshal_VkPipelineRasterizationStateStreamCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPipelineRasterizationStateStreamCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_encode_h264
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_EXT: {
+            unmarshal_VkVideoEncodeH264CapabilitiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoEncodeH264CapabilitiesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_CREATE_INFO_EXT: {
+            unmarshal_VkVideoEncodeH264SessionCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoEncodeH264SessionCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            unmarshal_VkVideoEncodeH264SessionParametersAddInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoEncodeH264SessionParametersAddInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            unmarshal_VkVideoEncodeH264SessionParametersCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoEncodeH264SessionParametersCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_VCL_FRAME_INFO_EXT: {
+            unmarshal_VkVideoEncodeH264VclFrameInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoEncodeH264VclFrameInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_EMIT_PICTURE_PARAMETERS_EXT: {
+            unmarshal_VkVideoEncodeH264EmitPictureParametersEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoEncodeH264EmitPictureParametersEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_EXT: {
+            unmarshal_VkVideoEncodeH264ProfileEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoEncodeH264ProfileEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_encode_h265
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_EXT: {
+            unmarshal_VkVideoEncodeH265CapabilitiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoEncodeH265CapabilitiesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_CREATE_INFO_EXT: {
+            unmarshal_VkVideoEncodeH265SessionCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoEncodeH265SessionCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            unmarshal_VkVideoEncodeH265SessionParametersAddInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoEncodeH265SessionParametersAddInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            unmarshal_VkVideoEncodeH265SessionParametersCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoEncodeH265SessionParametersCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_VCL_FRAME_INFO_EXT: {
+            unmarshal_VkVideoEncodeH265VclFrameInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoEncodeH265VclFrameInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_EMIT_PICTURE_PARAMETERS_EXT: {
+            unmarshal_VkVideoEncodeH265EmitPictureParametersEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoEncodeH265EmitPictureParametersEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_EXT: {
+            unmarshal_VkVideoEncodeH265ProfileEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoEncodeH265ProfileEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_decode_h264
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_EXT: {
+            unmarshal_VkVideoDecodeH264ProfileEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoDecodeH264ProfileEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_EXT: {
+            unmarshal_VkVideoDecodeH264CapabilitiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoDecodeH264CapabilitiesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_CREATE_INFO_EXT: {
+            unmarshal_VkVideoDecodeH264SessionCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoDecodeH264SessionCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            unmarshal_VkVideoDecodeH264SessionParametersAddInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoDecodeH264SessionParametersAddInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            unmarshal_VkVideoDecodeH264SessionParametersCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoDecodeH264SessionParametersCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PICTURE_INFO_EXT: {
+            unmarshal_VkVideoDecodeH264PictureInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoDecodeH264PictureInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_MVC_EXT: {
+            unmarshal_VkVideoDecodeH264MvcEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoDecodeH264MvcEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_EXT: {
+            unmarshal_VkVideoDecodeH264DpbSlotInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoDecodeH264DpbSlotInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_texture_gather_bias_lod
+        case VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD: {
+            unmarshal_VkTextureLODGatherFormatPropertiesAMD(
+                vkStream, rootType,
+                reinterpret_cast<VkTextureLODGatherFormatPropertiesAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_corner_sampled_image
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV: {
+            unmarshal_VkPhysicalDeviceCornerSampledImageFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceCornerSampledImageFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_external_memory
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV: {
+            unmarshal_VkExternalMemoryImageCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<VkExternalMemoryImageCreateInfoNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV: {
+            unmarshal_VkExportMemoryAllocateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<VkExportMemoryAllocateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_external_memory_win32
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV: {
+            unmarshal_VkImportMemoryWin32HandleInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<VkImportMemoryWin32HandleInfoNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV: {
+            unmarshal_VkExportMemoryWin32HandleInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<VkExportMemoryWin32HandleInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_win32_keyed_mutex
+        case VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV: {
+            unmarshal_VkWin32KeyedMutexAcquireReleaseInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<VkWin32KeyedMutexAcquireReleaseInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_validation_flags
+        case VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT: {
+            unmarshal_VkValidationFlagsEXT(
+                vkStream, rootType, reinterpret_cast<VkValidationFlagsEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_texture_compression_astc_hdr
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_astc_decode_mode
+        case VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT: {
+            unmarshal_VkImageViewASTCDecodeModeEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkImageViewASTCDecodeModeEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceASTCDecodeFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceASTCDecodeFeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_conditional_rendering
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceConditionalRenderingFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceConditionalRenderingFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT: {
+            unmarshal_VkCommandBufferInheritanceConditionalRenderingInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkCommandBufferInheritanceConditionalRenderingInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV: {
+            unmarshal_VkPipelineViewportWScalingStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPipelineViewportWScalingStateCreateInfoNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_display_control
+        case VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT: {
+            unmarshal_VkSwapchainCounterCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkSwapchainCounterCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_GOOGLE_display_timing
+        case VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE: {
+            unmarshal_VkPresentTimesInfoGOOGLE(
+                vkStream, rootType,
+                reinterpret_cast<VkPresentTimesInfoGOOGLE*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NVX_multiview_per_view_attributes
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX: {
+            unmarshal_VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_viewport_swizzle
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV: {
+            unmarshal_VkPipelineViewportSwizzleStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPipelineViewportSwizzleStateCreateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_discard_rectangles
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT: {
+            unmarshal_VkPhysicalDeviceDiscardRectanglePropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceDiscardRectanglePropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT: {
+            unmarshal_VkPipelineDiscardRectangleStateCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPipelineDiscardRectangleStateCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_conservative_rasterization
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT: {
+            unmarshal_VkPhysicalDeviceConservativeRasterizationPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceConservativeRasterizationPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT: {
+            unmarshal_VkPipelineRasterizationConservativeStateCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPipelineRasterizationConservativeStateCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_depth_clip_enable
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceDepthClipEnableFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceDepthClipEnableFeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT: {
+            unmarshal_VkPipelineRasterizationDepthClipStateCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPipelineRasterizationDepthClipStateCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_debug_utils
+        case VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT: {
+            unmarshal_VkDebugUtilsMessengerCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkDebugUtilsMessengerCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID: {
+            unmarshal_VkAndroidHardwareBufferUsageANDROID(
+                vkStream, rootType,
+                reinterpret_cast<VkAndroidHardwareBufferUsageANDROID*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID: {
+            unmarshal_VkAndroidHardwareBufferFormatPropertiesANDROID(
+                vkStream, rootType,
+                reinterpret_cast<VkAndroidHardwareBufferFormatPropertiesANDROID*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID: {
+            unmarshal_VkImportAndroidHardwareBufferInfoANDROID(
+                vkStream, rootType,
+                reinterpret_cast<VkImportAndroidHardwareBufferInfoANDROID*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID: {
+            unmarshal_VkExternalFormatANDROID(
+                vkStream, rootType,
+                reinterpret_cast<VkExternalFormatANDROID*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID: {
+            unmarshal_VkAndroidHardwareBufferFormatProperties2ANDROID(
+                vkStream, rootType,
+                reinterpret_cast<VkAndroidHardwareBufferFormatProperties2ANDROID*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_inline_uniform_block
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceInlineUniformBlockFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceInlineUniformBlockFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT: {
+            unmarshal_VkPhysicalDeviceInlineUniformBlockPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceInlineUniformBlockPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT: {
+            unmarshal_VkWriteDescriptorSetInlineUniformBlockEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkWriteDescriptorSetInlineUniformBlockEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO_EXT: {
+            unmarshal_VkDescriptorPoolInlineUniformBlockCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkDescriptorPoolInlineUniformBlockCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_sample_locations
+        case VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT: {
+            unmarshal_VkSampleLocationsInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkSampleLocationsInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT: {
+            unmarshal_VkRenderPassSampleLocationsBeginInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkRenderPassSampleLocationsBeginInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT: {
+            unmarshal_VkPipelineSampleLocationsStateCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPipelineSampleLocationsStateCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT: {
+            unmarshal_VkPhysicalDeviceSampleLocationsPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceSampleLocationsPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_blend_operation_advanced
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT: {
+            unmarshal_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT: {
+            unmarshal_VkPipelineColorBlendAdvancedStateCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPipelineColorBlendAdvancedStateCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_fragment_coverage_to_color
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV: {
+            unmarshal_VkPipelineCoverageToColorStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPipelineCoverageToColorStateCreateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_framebuffer_mixed_samples
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV: {
+            unmarshal_VkPipelineCoverageModulationStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPipelineCoverageModulationStateCreateInfoNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_shader_sm_builtins
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV: {
+            unmarshal_VkPhysicalDeviceShaderSMBuiltinsPropertiesNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceShaderSMBuiltinsPropertiesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV: {
+            unmarshal_VkPhysicalDeviceShaderSMBuiltinsFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceShaderSMBuiltinsFeaturesNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+        case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT: {
+            unmarshal_VkDrmFormatModifierPropertiesListEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkDrmFormatModifierPropertiesListEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT: {
+            unmarshal_VkPhysicalDeviceImageDrmFormatModifierInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceImageDrmFormatModifierInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT: {
+            unmarshal_VkImageDrmFormatModifierListCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkImageDrmFormatModifierListCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT: {
+            unmarshal_VkImageDrmFormatModifierExplicitCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkImageDrmFormatModifierExplicitCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT: {
+            unmarshal_VkDrmFormatModifierPropertiesList2EXT(
+                vkStream, rootType,
+                reinterpret_cast<VkDrmFormatModifierPropertiesList2EXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_validation_cache
+        case VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT: {
+            unmarshal_VkShaderModuleValidationCacheCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkShaderModuleValidationCacheCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_shading_rate_image
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV: {
+            unmarshal_VkPipelineViewportShadingRateImageStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPipelineViewportShadingRateImageStateCreateInfoNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV: {
+            unmarshal_VkPhysicalDeviceShadingRateImageFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceShadingRateImageFeaturesNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV: {
+            unmarshal_VkPhysicalDeviceShadingRateImagePropertiesNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceShadingRateImagePropertiesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV: {
+            unmarshal_VkPipelineViewportCoarseSampleOrderStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPipelineViewportCoarseSampleOrderStateCreateInfoNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_ray_tracing
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV: {
+            unmarshal_VkWriteDescriptorSetAccelerationStructureNV(
+                vkStream, rootType,
+                reinterpret_cast<VkWriteDescriptorSetAccelerationStructureNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV: {
+            unmarshal_VkPhysicalDeviceRayTracingPropertiesNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceRayTracingPropertiesNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_representative_fragment_test
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV: {
+            unmarshal_VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV: {
+            unmarshal_VkPipelineRepresentativeFragmentTestStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPipelineRepresentativeFragmentTestStateCreateInfoNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_filter_cubic
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT: {
+            unmarshal_VkPhysicalDeviceImageViewImageFormatInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceImageViewImageFormatInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT: {
+            unmarshal_VkFilterCubicImageViewImageFormatPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkFilterCubicImageViewImageFormatPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_global_priority
+        case VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT: {
+            unmarshal_VkDeviceQueueGlobalPriorityCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkDeviceQueueGlobalPriorityCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_external_memory_host
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT: {
+            unmarshal_VkImportMemoryHostPointerInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkImportMemoryHostPointerInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT: {
+            unmarshal_VkPhysicalDeviceExternalMemoryHostPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceExternalMemoryHostPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_pipeline_compiler_control
+        case VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD: {
+            unmarshal_VkPipelineCompilerControlCreateInfoAMD(
+                vkStream, rootType,
+                reinterpret_cast<VkPipelineCompilerControlCreateInfoAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_shader_core_properties
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD: {
+            unmarshal_VkPhysicalDeviceShaderCorePropertiesAMD(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceShaderCorePropertiesAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_decode_h265
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_EXT: {
+            unmarshal_VkVideoDecodeH265ProfileEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoDecodeH265ProfileEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_EXT: {
+            unmarshal_VkVideoDecodeH265CapabilitiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoDecodeH265CapabilitiesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_CREATE_INFO_EXT: {
+            unmarshal_VkVideoDecodeH265SessionCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoDecodeH265SessionCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            unmarshal_VkVideoDecodeH265SessionParametersAddInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoDecodeH265SessionParametersAddInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            unmarshal_VkVideoDecodeH265SessionParametersCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoDecodeH265SessionParametersCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PICTURE_INFO_EXT: {
+            unmarshal_VkVideoDecodeH265PictureInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoDecodeH265PictureInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_EXT: {
+            unmarshal_VkVideoDecodeH265DpbSlotInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkVideoDecodeH265DpbSlotInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_memory_overallocation_behavior
+        case VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD: {
+            unmarshal_VkDeviceMemoryOverallocationCreateInfoAMD(
+                vkStream, rootType,
+                reinterpret_cast<VkDeviceMemoryOverallocationCreateInfoAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_vertex_attribute_divisor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT: {
+            unmarshal_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT: {
+            unmarshal_VkPipelineVertexInputDivisorStateCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPipelineVertexInputDivisorStateCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_GGP_frame_token
+        case VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP: {
+            unmarshal_VkPresentFrameTokenGGP(
+                vkStream, rootType, reinterpret_cast<VkPresentFrameTokenGGP*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_pipeline_creation_feedback
+        case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT: {
+            unmarshal_VkPipelineCreationFeedbackCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPipelineCreationFeedbackCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_compute_shader_derivatives
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV: {
+            unmarshal_VkPhysicalDeviceComputeShaderDerivativesFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceComputeShaderDerivativesFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_mesh_shader
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV: {
+            unmarshal_VkPhysicalDeviceMeshShaderFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceMeshShaderFeaturesNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV: {
+            unmarshal_VkPhysicalDeviceMeshShaderPropertiesNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceMeshShaderPropertiesNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_fragment_shader_barycentric
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV: {
+            unmarshal_VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_shader_image_footprint
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV: {
+            unmarshal_VkPhysicalDeviceShaderImageFootprintFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceShaderImageFootprintFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_scissor_exclusive
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV: {
+            unmarshal_VkPipelineViewportExclusiveScissorStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPipelineViewportExclusiveScissorStateCreateInfoNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV: {
+            unmarshal_VkPhysicalDeviceExclusiveScissorFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceExclusiveScissorFeaturesNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV: {
+            unmarshal_VkQueueFamilyCheckpointPropertiesNV(
+                vkStream, rootType,
+                reinterpret_cast<VkQueueFamilyCheckpointPropertiesNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_INTEL_shader_integer_functions2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL: {
+            unmarshal_VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_INTEL_performance_query
+        case VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL: {
+            unmarshal_VkQueryPoolPerformanceQueryCreateInfoINTEL(
+                vkStream, rootType,
+                reinterpret_cast<VkQueryPoolPerformanceQueryCreateInfoINTEL*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_pci_bus_info
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT: {
+            unmarshal_VkPhysicalDevicePCIBusInfoPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDevicePCIBusInfoPropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_display_native_hdr
+        case VK_STRUCTURE_TYPE_DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD: {
+            unmarshal_VkDisplayNativeHdrSurfaceCapabilitiesAMD(
+                vkStream, rootType,
+                reinterpret_cast<VkDisplayNativeHdrSurfaceCapabilitiesAMD*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD: {
+            unmarshal_VkSwapchainDisplayNativeHdrCreateInfoAMD(
+                vkStream, rootType,
+                reinterpret_cast<VkSwapchainDisplayNativeHdrCreateInfoAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_fragment_density_map
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT: {
+            switch (rootType) {
+                case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: {
+                    unmarshal_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+                        vkStream, rootType,
+                        reinterpret_cast<VkPhysicalDeviceFragmentDensityMapFeaturesEXT*>(
+                            structExtension_out));
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO: {
+                    unmarshal_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+                        vkStream, rootType,
+                        reinterpret_cast<VkPhysicalDeviceFragmentDensityMapFeaturesEXT*>(
+                            structExtension_out));
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO: {
+                    unmarshal_VkImportColorBufferGOOGLE(
+                        vkStream, rootType,
+                        reinterpret_cast<VkImportColorBufferGOOGLE*>(structExtension_out));
+                    break;
+                }
+                default: {
+                    unmarshal_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+                        vkStream, rootType,
+                        reinterpret_cast<VkPhysicalDeviceFragmentDensityMapFeaturesEXT*>(
+                            structExtension_out));
+                    break;
+                }
+            }
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT: {
+            switch (rootType) {
+                case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2: {
+                    unmarshal_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
+                        vkStream, rootType,
+                        reinterpret_cast<VkPhysicalDeviceFragmentDensityMapPropertiesEXT*>(
+                            structExtension_out));
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO: {
+                    unmarshal_VkCreateBlobGOOGLE(
+                        vkStream, rootType,
+                        reinterpret_cast<VkCreateBlobGOOGLE*>(structExtension_out));
+                    break;
+                }
+                default: {
+                    unmarshal_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
+                        vkStream, rootType,
+                        reinterpret_cast<VkPhysicalDeviceFragmentDensityMapPropertiesEXT*>(
+                            structExtension_out));
+                    break;
+                }
+            }
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT: {
+            switch (rootType) {
+                case VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO: {
+                    unmarshal_VkRenderPassFragmentDensityMapCreateInfoEXT(
+                        vkStream, rootType,
+                        reinterpret_cast<VkRenderPassFragmentDensityMapCreateInfoEXT*>(
+                            structExtension_out));
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2: {
+                    unmarshal_VkRenderPassFragmentDensityMapCreateInfoEXT(
+                        vkStream, rootType,
+                        reinterpret_cast<VkRenderPassFragmentDensityMapCreateInfoEXT*>(
+                            structExtension_out));
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO: {
+                    unmarshal_VkImportBufferGOOGLE(
+                        vkStream, rootType,
+                        reinterpret_cast<VkImportBufferGOOGLE*>(structExtension_out));
+                    break;
+                }
+                default: {
+                    unmarshal_VkRenderPassFragmentDensityMapCreateInfoEXT(
+                        vkStream, rootType,
+                        reinterpret_cast<VkRenderPassFragmentDensityMapCreateInfoEXT*>(
+                            structExtension_out));
+                    break;
+                }
+            }
+            break;
+        }
+#endif
+#ifdef VK_EXT_subgroup_size_control
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceSubgroupSizeControlFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceSubgroupSizeControlFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT: {
+            unmarshal_VkPhysicalDeviceSubgroupSizeControlPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceSubgroupSizeControlPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT: {
+            unmarshal_VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_shader_core_properties2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD: {
+            unmarshal_VkPhysicalDeviceShaderCoreProperties2AMD(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceShaderCoreProperties2AMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_device_coherent_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD: {
+            unmarshal_VkPhysicalDeviceCoherentMemoryFeaturesAMD(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceCoherentMemoryFeaturesAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_image_atomic_int64
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_memory_budget
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT: {
+            unmarshal_VkPhysicalDeviceMemoryBudgetPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceMemoryBudgetPropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_memory_priority
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceMemoryPriorityFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceMemoryPriorityFeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT: {
+            unmarshal_VkMemoryPriorityAllocateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkMemoryPriorityAllocateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_dedicated_allocation_image_aliasing
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV: {
+            unmarshal_VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_buffer_device_address
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceBufferDeviceAddressFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT: {
+            unmarshal_VkBufferDeviceAddressCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkBufferDeviceAddressCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_validation_features
+        case VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT: {
+            unmarshal_VkValidationFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkValidationFeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_cooperative_matrix
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV: {
+            unmarshal_VkPhysicalDeviceCooperativeMatrixFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceCooperativeMatrixFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV: {
+            unmarshal_VkPhysicalDeviceCooperativeMatrixPropertiesNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceCooperativeMatrixPropertiesNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV: {
+            unmarshal_VkPhysicalDeviceCoverageReductionModeFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceCoverageReductionModeFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV: {
+            unmarshal_VkPipelineCoverageReductionStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPipelineCoverageReductionStateCreateInfoNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_fragment_shader_interlock
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_ycbcr_image_arrays
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceYcbcrImageArraysFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceYcbcrImageArraysFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_provoking_vertex
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceProvokingVertexFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceProvokingVertexFeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT: {
+            unmarshal_VkPhysicalDeviceProvokingVertexPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceProvokingVertexPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT: {
+            unmarshal_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPipelineRasterizationProvokingVertexStateCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+        case VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT: {
+            unmarshal_VkSurfaceFullScreenExclusiveInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkSurfaceFullScreenExclusiveInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT: {
+            unmarshal_VkSurfaceCapabilitiesFullScreenExclusiveEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkSurfaceCapabilitiesFullScreenExclusiveEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT: {
+            unmarshal_VkSurfaceFullScreenExclusiveWin32InfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkSurfaceFullScreenExclusiveWin32InfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_line_rasterization
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceLineRasterizationFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceLineRasterizationFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT: {
+            unmarshal_VkPhysicalDeviceLineRasterizationPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceLineRasterizationPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT: {
+            unmarshal_VkPipelineRasterizationLineStateCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPipelineRasterizationLineStateCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_atomic_float
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceShaderAtomicFloatFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceShaderAtomicFloatFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_index_type_uint8
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceIndexTypeUint8FeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceIndexTypeUint8FeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceExtendedDynamicStateFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceExtendedDynamicStateFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_atomic_float2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_demote_to_helper_invocation
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_device_generated_commands
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV: {
+            unmarshal_VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV: {
+            unmarshal_VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV: {
+            unmarshal_VkGraphicsPipelineShaderGroupsCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<VkGraphicsPipelineShaderGroupsCreateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_inherited_viewport_scissor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV: {
+            unmarshal_VkPhysicalDeviceInheritedViewportScissorFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceInheritedViewportScissorFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV: {
+            unmarshal_VkCommandBufferInheritanceViewportScissorInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<VkCommandBufferInheritanceViewportScissorInfoNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_texel_buffer_alignment
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT: {
+            unmarshal_VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_QCOM_render_pass_transform
+        case VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM: {
+            unmarshal_VkRenderPassTransformBeginInfoQCOM(
+                vkStream, rootType,
+                reinterpret_cast<VkRenderPassTransformBeginInfoQCOM*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM: {
+            unmarshal_VkCommandBufferInheritanceRenderPassTransformInfoQCOM(
+                vkStream, rootType,
+                reinterpret_cast<VkCommandBufferInheritanceRenderPassTransformInfoQCOM*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_device_memory_report
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceDeviceMemoryReportFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceDeviceMemoryReportFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT: {
+            unmarshal_VkDeviceDeviceMemoryReportCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkDeviceDeviceMemoryReportCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_robustness2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceRobustness2FeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceRobustness2FeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT: {
+            unmarshal_VkPhysicalDeviceRobustness2PropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceRobustness2PropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_custom_border_color
+        case VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT: {
+            unmarshal_VkSamplerCustomBorderColorCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkSamplerCustomBorderColorCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT: {
+            unmarshal_VkPhysicalDeviceCustomBorderColorPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceCustomBorderColorPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceCustomBorderColorFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceCustomBorderColorFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_private_data
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT: {
+            unmarshal_VkPhysicalDevicePrivateDataFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDevicePrivateDataFeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO_EXT: {
+            unmarshal_VkDevicePrivateDataCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkDevicePrivateDataCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_pipeline_creation_cache_control
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES_EXT: {
+            unmarshal_VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_device_diagnostics_config
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV: {
+            unmarshal_VkPhysicalDeviceDiagnosticsConfigFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceDiagnosticsConfigFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV: {
+            unmarshal_VkDeviceDiagnosticsConfigCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<VkDeviceDiagnosticsConfigCreateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV: {
+            unmarshal_VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV: {
+            unmarshal_VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV: {
+            unmarshal_VkPipelineFragmentShadingRateEnumStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPipelineFragmentShadingRateEnumStateCreateInfoNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_ray_tracing_motion_blur
+        case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV: {
+            unmarshal_VkAccelerationStructureGeometryMotionTrianglesDataNV(
+                vkStream, rootType,
+                reinterpret_cast<VkAccelerationStructureGeometryMotionTrianglesDataNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV: {
+            unmarshal_VkAccelerationStructureMotionInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<VkAccelerationStructureMotionInfoNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV: {
+            unmarshal_VkPhysicalDeviceRayTracingMotionBlurFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceRayTracingMotionBlurFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_ycbcr_2plane_444_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_fragment_density_map2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceFragmentDensityMap2FeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceFragmentDensityMap2FeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT: {
+            unmarshal_VkPhysicalDeviceFragmentDensityMap2PropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceFragmentDensityMap2PropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_QCOM_rotated_copy_commands
+        case VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM: {
+            unmarshal_VkCopyCommandTransformInfoQCOM(
+                vkStream, rootType,
+                reinterpret_cast<VkCopyCommandTransformInfoQCOM*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_image_robustness
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceImageRobustnessFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceImageRobustnessFeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_4444_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT: {
+            unmarshal_VkPhysicalDevice4444FormatsFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDevice4444FormatsFeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_rgba10x6_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_VALVE_mutable_descriptor_type
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE: {
+            unmarshal_VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE: {
+            unmarshal_VkMutableDescriptorTypeCreateInfoVALVE(
+                vkStream, rootType,
+                reinterpret_cast<VkMutableDescriptorTypeCreateInfoVALVE*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_physical_device_drm
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT: {
+            unmarshal_VkPhysicalDeviceDrmPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceDrmPropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_primitive_topology_list_restart
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT: {
+            unmarshal_VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_FUCHSIA_external_memory
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA: {
+            unmarshal_VkImportMemoryZirconHandleInfoFUCHSIA(
+                vkStream, rootType,
+                reinterpret_cast<VkImportMemoryZirconHandleInfoFUCHSIA*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA: {
+            unmarshal_VkImportMemoryBufferCollectionFUCHSIA(
+                vkStream, rootType,
+                reinterpret_cast<VkImportMemoryBufferCollectionFUCHSIA*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA: {
+            unmarshal_VkBufferCollectionImageCreateInfoFUCHSIA(
+                vkStream, rootType,
+                reinterpret_cast<VkBufferCollectionImageCreateInfoFUCHSIA*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA: {
+            unmarshal_VkBufferCollectionBufferCreateInfoFUCHSIA(
+                vkStream, rootType,
+                reinterpret_cast<VkBufferCollectionBufferCreateInfoFUCHSIA*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+        case VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI: {
+            unmarshal_VkSubpassShadingPipelineCreateInfoHUAWEI(
+                vkStream, rootType,
+                reinterpret_cast<VkSubpassShadingPipelineCreateInfoHUAWEI*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI: {
+            unmarshal_VkPhysicalDeviceSubpassShadingFeaturesHUAWEI(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceSubpassShadingFeaturesHUAWEI*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI: {
+            unmarshal_VkPhysicalDeviceSubpassShadingPropertiesHUAWEI(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceSubpassShadingPropertiesHUAWEI*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI: {
+            unmarshal_VkPhysicalDeviceInvocationMaskFeaturesHUAWEI(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceInvocationMaskFeaturesHUAWEI*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_external_memory_rdma
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_RDMA_FEATURES_NV: {
+            unmarshal_VkPhysicalDeviceExternalMemoryRDMAFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceExternalMemoryRDMAFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceExtendedDynamicState2FeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceExtendedDynamicState2FeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_color_write_enable
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceColorWriteEnableFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceColorWriteEnableFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT: {
+            unmarshal_VkPipelineColorWriteCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPipelineColorWriteCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_GOOGLE_gfxstream
+        case VK_STRUCTURE_TYPE_IMPORT_COLOR_BUFFER_GOOGLE: {
+            unmarshal_VkImportColorBufferGOOGLE(
+                vkStream, rootType,
+                reinterpret_cast<VkImportColorBufferGOOGLE*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMPORT_BUFFER_GOOGLE: {
+            unmarshal_VkImportBufferGOOGLE(
+                vkStream, rootType, reinterpret_cast<VkImportBufferGOOGLE*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_CREATE_BLOB_GOOGLE: {
+            unmarshal_VkCreateBlobGOOGLE(
+                vkStream, rootType, reinterpret_cast<VkCreateBlobGOOGLE*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_global_priority_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_EXT: {
+            unmarshal_VkQueueFamilyGlobalPriorityPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkQueueFamilyGlobalPriorityPropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_multi_draw
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceMultiDrawFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceMultiDrawFeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT: {
+            unmarshal_VkPhysicalDeviceMultiDrawPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceMultiDrawPropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_border_color_swizzle
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT: {
+            unmarshal_VkPhysicalDeviceBorderColorSwizzleFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceBorderColorSwizzleFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT: {
+            unmarshal_VkSamplerBorderColorComponentMappingCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkSamplerBorderColorComponentMappingCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT: {
+            unmarshal_VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_acceleration_structure
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR: {
+            unmarshal_VkWriteDescriptorSetAccelerationStructureKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkWriteDescriptorSetAccelerationStructureKHR*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR: {
+            unmarshal_VkPhysicalDeviceAccelerationStructureFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceAccelerationStructureFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR: {
+            unmarshal_VkPhysicalDeviceAccelerationStructurePropertiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceAccelerationStructurePropertiesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR: {
+            unmarshal_VkPhysicalDeviceRayTracingPipelineFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceRayTracingPipelineFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR: {
+            unmarshal_VkPhysicalDeviceRayTracingPipelinePropertiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceRayTracingPipelinePropertiesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_ray_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR: {
+            unmarshal_VkPhysicalDeviceRayQueryFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<VkPhysicalDeviceRayQueryFeaturesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+        default: {
+            // fatal; the switch is only taken if the extension struct is known
+            abort();
+        }
+    }
+}
+
+const char* api_opcode_to_string(const uint32_t opcode) {
+    switch (opcode) {
+#ifdef VK_VERSION_1_0
+        case OP_vkCreateInstance: {
+            return "OP_vkCreateInstance";
+        }
+        case OP_vkDestroyInstance: {
+            return "OP_vkDestroyInstance";
+        }
+        case OP_vkEnumeratePhysicalDevices: {
+            return "OP_vkEnumeratePhysicalDevices";
+        }
+        case OP_vkGetPhysicalDeviceFeatures: {
+            return "OP_vkGetPhysicalDeviceFeatures";
+        }
+        case OP_vkGetPhysicalDeviceFormatProperties: {
+            return "OP_vkGetPhysicalDeviceFormatProperties";
+        }
+        case OP_vkGetPhysicalDeviceImageFormatProperties: {
+            return "OP_vkGetPhysicalDeviceImageFormatProperties";
+        }
+        case OP_vkGetPhysicalDeviceProperties: {
+            return "OP_vkGetPhysicalDeviceProperties";
+        }
+        case OP_vkGetPhysicalDeviceQueueFamilyProperties: {
+            return "OP_vkGetPhysicalDeviceQueueFamilyProperties";
+        }
+        case OP_vkGetPhysicalDeviceMemoryProperties: {
+            return "OP_vkGetPhysicalDeviceMemoryProperties";
+        }
+        case OP_vkGetInstanceProcAddr: {
+            return "OP_vkGetInstanceProcAddr";
+        }
+        case OP_vkGetDeviceProcAddr: {
+            return "OP_vkGetDeviceProcAddr";
+        }
+        case OP_vkCreateDevice: {
+            return "OP_vkCreateDevice";
+        }
+        case OP_vkDestroyDevice: {
+            return "OP_vkDestroyDevice";
+        }
+        case OP_vkEnumerateInstanceExtensionProperties: {
+            return "OP_vkEnumerateInstanceExtensionProperties";
+        }
+        case OP_vkEnumerateDeviceExtensionProperties: {
+            return "OP_vkEnumerateDeviceExtensionProperties";
+        }
+        case OP_vkEnumerateInstanceLayerProperties: {
+            return "OP_vkEnumerateInstanceLayerProperties";
+        }
+        case OP_vkEnumerateDeviceLayerProperties: {
+            return "OP_vkEnumerateDeviceLayerProperties";
+        }
+        case OP_vkGetDeviceQueue: {
+            return "OP_vkGetDeviceQueue";
+        }
+        case OP_vkQueueSubmit: {
+            return "OP_vkQueueSubmit";
+        }
+        case OP_vkQueueWaitIdle: {
+            return "OP_vkQueueWaitIdle";
+        }
+        case OP_vkDeviceWaitIdle: {
+            return "OP_vkDeviceWaitIdle";
+        }
+        case OP_vkAllocateMemory: {
+            return "OP_vkAllocateMemory";
+        }
+        case OP_vkFreeMemory: {
+            return "OP_vkFreeMemory";
+        }
+        case OP_vkMapMemory: {
+            return "OP_vkMapMemory";
+        }
+        case OP_vkUnmapMemory: {
+            return "OP_vkUnmapMemory";
+        }
+        case OP_vkFlushMappedMemoryRanges: {
+            return "OP_vkFlushMappedMemoryRanges";
+        }
+        case OP_vkInvalidateMappedMemoryRanges: {
+            return "OP_vkInvalidateMappedMemoryRanges";
+        }
+        case OP_vkGetDeviceMemoryCommitment: {
+            return "OP_vkGetDeviceMemoryCommitment";
+        }
+        case OP_vkBindBufferMemory: {
+            return "OP_vkBindBufferMemory";
+        }
+        case OP_vkBindImageMemory: {
+            return "OP_vkBindImageMemory";
+        }
+        case OP_vkGetBufferMemoryRequirements: {
+            return "OP_vkGetBufferMemoryRequirements";
+        }
+        case OP_vkGetImageMemoryRequirements: {
+            return "OP_vkGetImageMemoryRequirements";
+        }
+        case OP_vkGetImageSparseMemoryRequirements: {
+            return "OP_vkGetImageSparseMemoryRequirements";
+        }
+        case OP_vkGetPhysicalDeviceSparseImageFormatProperties: {
+            return "OP_vkGetPhysicalDeviceSparseImageFormatProperties";
+        }
+        case OP_vkQueueBindSparse: {
+            return "OP_vkQueueBindSparse";
+        }
+        case OP_vkCreateFence: {
+            return "OP_vkCreateFence";
+        }
+        case OP_vkDestroyFence: {
+            return "OP_vkDestroyFence";
+        }
+        case OP_vkResetFences: {
+            return "OP_vkResetFences";
+        }
+        case OP_vkGetFenceStatus: {
+            return "OP_vkGetFenceStatus";
+        }
+        case OP_vkWaitForFences: {
+            return "OP_vkWaitForFences";
+        }
+        case OP_vkCreateSemaphore: {
+            return "OP_vkCreateSemaphore";
+        }
+        case OP_vkDestroySemaphore: {
+            return "OP_vkDestroySemaphore";
+        }
+        case OP_vkCreateEvent: {
+            return "OP_vkCreateEvent";
+        }
+        case OP_vkDestroyEvent: {
+            return "OP_vkDestroyEvent";
+        }
+        case OP_vkGetEventStatus: {
+            return "OP_vkGetEventStatus";
+        }
+        case OP_vkSetEvent: {
+            return "OP_vkSetEvent";
+        }
+        case OP_vkResetEvent: {
+            return "OP_vkResetEvent";
+        }
+        case OP_vkCreateQueryPool: {
+            return "OP_vkCreateQueryPool";
+        }
+        case OP_vkDestroyQueryPool: {
+            return "OP_vkDestroyQueryPool";
+        }
+        case OP_vkGetQueryPoolResults: {
+            return "OP_vkGetQueryPoolResults";
+        }
+        case OP_vkCreateBuffer: {
+            return "OP_vkCreateBuffer";
+        }
+        case OP_vkDestroyBuffer: {
+            return "OP_vkDestroyBuffer";
+        }
+        case OP_vkCreateBufferView: {
+            return "OP_vkCreateBufferView";
+        }
+        case OP_vkDestroyBufferView: {
+            return "OP_vkDestroyBufferView";
+        }
+        case OP_vkCreateImage: {
+            return "OP_vkCreateImage";
+        }
+        case OP_vkDestroyImage: {
+            return "OP_vkDestroyImage";
+        }
+        case OP_vkGetImageSubresourceLayout: {
+            return "OP_vkGetImageSubresourceLayout";
+        }
+        case OP_vkCreateImageView: {
+            return "OP_vkCreateImageView";
+        }
+        case OP_vkDestroyImageView: {
+            return "OP_vkDestroyImageView";
+        }
+        case OP_vkCreateShaderModule: {
+            return "OP_vkCreateShaderModule";
+        }
+        case OP_vkDestroyShaderModule: {
+            return "OP_vkDestroyShaderModule";
+        }
+        case OP_vkCreatePipelineCache: {
+            return "OP_vkCreatePipelineCache";
+        }
+        case OP_vkDestroyPipelineCache: {
+            return "OP_vkDestroyPipelineCache";
+        }
+        case OP_vkGetPipelineCacheData: {
+            return "OP_vkGetPipelineCacheData";
+        }
+        case OP_vkMergePipelineCaches: {
+            return "OP_vkMergePipelineCaches";
+        }
+        case OP_vkCreateGraphicsPipelines: {
+            return "OP_vkCreateGraphicsPipelines";
+        }
+        case OP_vkCreateComputePipelines: {
+            return "OP_vkCreateComputePipelines";
+        }
+        case OP_vkDestroyPipeline: {
+            return "OP_vkDestroyPipeline";
+        }
+        case OP_vkCreatePipelineLayout: {
+            return "OP_vkCreatePipelineLayout";
+        }
+        case OP_vkDestroyPipelineLayout: {
+            return "OP_vkDestroyPipelineLayout";
+        }
+        case OP_vkCreateSampler: {
+            return "OP_vkCreateSampler";
+        }
+        case OP_vkDestroySampler: {
+            return "OP_vkDestroySampler";
+        }
+        case OP_vkCreateDescriptorSetLayout: {
+            return "OP_vkCreateDescriptorSetLayout";
+        }
+        case OP_vkDestroyDescriptorSetLayout: {
+            return "OP_vkDestroyDescriptorSetLayout";
+        }
+        case OP_vkCreateDescriptorPool: {
+            return "OP_vkCreateDescriptorPool";
+        }
+        case OP_vkDestroyDescriptorPool: {
+            return "OP_vkDestroyDescriptorPool";
+        }
+        case OP_vkResetDescriptorPool: {
+            return "OP_vkResetDescriptorPool";
+        }
+        case OP_vkAllocateDescriptorSets: {
+            return "OP_vkAllocateDescriptorSets";
+        }
+        case OP_vkFreeDescriptorSets: {
+            return "OP_vkFreeDescriptorSets";
+        }
+        case OP_vkUpdateDescriptorSets: {
+            return "OP_vkUpdateDescriptorSets";
+        }
+        case OP_vkCreateFramebuffer: {
+            return "OP_vkCreateFramebuffer";
+        }
+        case OP_vkDestroyFramebuffer: {
+            return "OP_vkDestroyFramebuffer";
+        }
+        case OP_vkCreateRenderPass: {
+            return "OP_vkCreateRenderPass";
+        }
+        case OP_vkDestroyRenderPass: {
+            return "OP_vkDestroyRenderPass";
+        }
+        case OP_vkGetRenderAreaGranularity: {
+            return "OP_vkGetRenderAreaGranularity";
+        }
+        case OP_vkCreateCommandPool: {
+            return "OP_vkCreateCommandPool";
+        }
+        case OP_vkDestroyCommandPool: {
+            return "OP_vkDestroyCommandPool";
+        }
+        case OP_vkResetCommandPool: {
+            return "OP_vkResetCommandPool";
+        }
+        case OP_vkAllocateCommandBuffers: {
+            return "OP_vkAllocateCommandBuffers";
+        }
+        case OP_vkFreeCommandBuffers: {
+            return "OP_vkFreeCommandBuffers";
+        }
+        case OP_vkBeginCommandBuffer: {
+            return "OP_vkBeginCommandBuffer";
+        }
+        case OP_vkEndCommandBuffer: {
+            return "OP_vkEndCommandBuffer";
+        }
+        case OP_vkResetCommandBuffer: {
+            return "OP_vkResetCommandBuffer";
+        }
+        case OP_vkCmdBindPipeline: {
+            return "OP_vkCmdBindPipeline";
+        }
+        case OP_vkCmdSetViewport: {
+            return "OP_vkCmdSetViewport";
+        }
+        case OP_vkCmdSetScissor: {
+            return "OP_vkCmdSetScissor";
+        }
+        case OP_vkCmdSetLineWidth: {
+            return "OP_vkCmdSetLineWidth";
+        }
+        case OP_vkCmdSetDepthBias: {
+            return "OP_vkCmdSetDepthBias";
+        }
+        case OP_vkCmdSetBlendConstants: {
+            return "OP_vkCmdSetBlendConstants";
+        }
+        case OP_vkCmdSetDepthBounds: {
+            return "OP_vkCmdSetDepthBounds";
+        }
+        case OP_vkCmdSetStencilCompareMask: {
+            return "OP_vkCmdSetStencilCompareMask";
+        }
+        case OP_vkCmdSetStencilWriteMask: {
+            return "OP_vkCmdSetStencilWriteMask";
+        }
+        case OP_vkCmdSetStencilReference: {
+            return "OP_vkCmdSetStencilReference";
+        }
+        case OP_vkCmdBindDescriptorSets: {
+            return "OP_vkCmdBindDescriptorSets";
+        }
+        case OP_vkCmdBindIndexBuffer: {
+            return "OP_vkCmdBindIndexBuffer";
+        }
+        case OP_vkCmdBindVertexBuffers: {
+            return "OP_vkCmdBindVertexBuffers";
+        }
+        case OP_vkCmdDraw: {
+            return "OP_vkCmdDraw";
+        }
+        case OP_vkCmdDrawIndexed: {
+            return "OP_vkCmdDrawIndexed";
+        }
+        case OP_vkCmdDrawIndirect: {
+            return "OP_vkCmdDrawIndirect";
+        }
+        case OP_vkCmdDrawIndexedIndirect: {
+            return "OP_vkCmdDrawIndexedIndirect";
+        }
+        case OP_vkCmdDispatch: {
+            return "OP_vkCmdDispatch";
+        }
+        case OP_vkCmdDispatchIndirect: {
+            return "OP_vkCmdDispatchIndirect";
+        }
+        case OP_vkCmdCopyBuffer: {
+            return "OP_vkCmdCopyBuffer";
+        }
+        case OP_vkCmdCopyImage: {
+            return "OP_vkCmdCopyImage";
+        }
+        case OP_vkCmdBlitImage: {
+            return "OP_vkCmdBlitImage";
+        }
+        case OP_vkCmdCopyBufferToImage: {
+            return "OP_vkCmdCopyBufferToImage";
+        }
+        case OP_vkCmdCopyImageToBuffer: {
+            return "OP_vkCmdCopyImageToBuffer";
+        }
+        case OP_vkCmdUpdateBuffer: {
+            return "OP_vkCmdUpdateBuffer";
+        }
+        case OP_vkCmdFillBuffer: {
+            return "OP_vkCmdFillBuffer";
+        }
+        case OP_vkCmdClearColorImage: {
+            return "OP_vkCmdClearColorImage";
+        }
+        case OP_vkCmdClearDepthStencilImage: {
+            return "OP_vkCmdClearDepthStencilImage";
+        }
+        case OP_vkCmdClearAttachments: {
+            return "OP_vkCmdClearAttachments";
+        }
+        case OP_vkCmdResolveImage: {
+            return "OP_vkCmdResolveImage";
+        }
+        case OP_vkCmdSetEvent: {
+            return "OP_vkCmdSetEvent";
+        }
+        case OP_vkCmdResetEvent: {
+            return "OP_vkCmdResetEvent";
+        }
+        case OP_vkCmdWaitEvents: {
+            return "OP_vkCmdWaitEvents";
+        }
+        case OP_vkCmdPipelineBarrier: {
+            return "OP_vkCmdPipelineBarrier";
+        }
+        case OP_vkCmdBeginQuery: {
+            return "OP_vkCmdBeginQuery";
+        }
+        case OP_vkCmdEndQuery: {
+            return "OP_vkCmdEndQuery";
+        }
+        case OP_vkCmdResetQueryPool: {
+            return "OP_vkCmdResetQueryPool";
+        }
+        case OP_vkCmdWriteTimestamp: {
+            return "OP_vkCmdWriteTimestamp";
+        }
+        case OP_vkCmdCopyQueryPoolResults: {
+            return "OP_vkCmdCopyQueryPoolResults";
+        }
+        case OP_vkCmdPushConstants: {
+            return "OP_vkCmdPushConstants";
+        }
+        case OP_vkCmdBeginRenderPass: {
+            return "OP_vkCmdBeginRenderPass";
+        }
+        case OP_vkCmdNextSubpass: {
+            return "OP_vkCmdNextSubpass";
+        }
+        case OP_vkCmdEndRenderPass: {
+            return "OP_vkCmdEndRenderPass";
+        }
+        case OP_vkCmdExecuteCommands: {
+            return "OP_vkCmdExecuteCommands";
+        }
+#endif
+#ifdef VK_VERSION_1_1
+        case OP_vkEnumerateInstanceVersion: {
+            return "OP_vkEnumerateInstanceVersion";
+        }
+        case OP_vkBindBufferMemory2: {
+            return "OP_vkBindBufferMemory2";
+        }
+        case OP_vkBindImageMemory2: {
+            return "OP_vkBindImageMemory2";
+        }
+        case OP_vkGetDeviceGroupPeerMemoryFeatures: {
+            return "OP_vkGetDeviceGroupPeerMemoryFeatures";
+        }
+        case OP_vkCmdSetDeviceMask: {
+            return "OP_vkCmdSetDeviceMask";
+        }
+        case OP_vkCmdDispatchBase: {
+            return "OP_vkCmdDispatchBase";
+        }
+        case OP_vkEnumeratePhysicalDeviceGroups: {
+            return "OP_vkEnumeratePhysicalDeviceGroups";
+        }
+        case OP_vkGetImageMemoryRequirements2: {
+            return "OP_vkGetImageMemoryRequirements2";
+        }
+        case OP_vkGetBufferMemoryRequirements2: {
+            return "OP_vkGetBufferMemoryRequirements2";
+        }
+        case OP_vkGetImageSparseMemoryRequirements2: {
+            return "OP_vkGetImageSparseMemoryRequirements2";
+        }
+        case OP_vkGetPhysicalDeviceFeatures2: {
+            return "OP_vkGetPhysicalDeviceFeatures2";
+        }
+        case OP_vkGetPhysicalDeviceProperties2: {
+            return "OP_vkGetPhysicalDeviceProperties2";
+        }
+        case OP_vkGetPhysicalDeviceFormatProperties2: {
+            return "OP_vkGetPhysicalDeviceFormatProperties2";
+        }
+        case OP_vkGetPhysicalDeviceImageFormatProperties2: {
+            return "OP_vkGetPhysicalDeviceImageFormatProperties2";
+        }
+        case OP_vkGetPhysicalDeviceQueueFamilyProperties2: {
+            return "OP_vkGetPhysicalDeviceQueueFamilyProperties2";
+        }
+        case OP_vkGetPhysicalDeviceMemoryProperties2: {
+            return "OP_vkGetPhysicalDeviceMemoryProperties2";
+        }
+        case OP_vkGetPhysicalDeviceSparseImageFormatProperties2: {
+            return "OP_vkGetPhysicalDeviceSparseImageFormatProperties2";
+        }
+        case OP_vkTrimCommandPool: {
+            return "OP_vkTrimCommandPool";
+        }
+        case OP_vkGetDeviceQueue2: {
+            return "OP_vkGetDeviceQueue2";
+        }
+        case OP_vkCreateSamplerYcbcrConversion: {
+            return "OP_vkCreateSamplerYcbcrConversion";
+        }
+        case OP_vkDestroySamplerYcbcrConversion: {
+            return "OP_vkDestroySamplerYcbcrConversion";
+        }
+        case OP_vkCreateDescriptorUpdateTemplate: {
+            return "OP_vkCreateDescriptorUpdateTemplate";
+        }
+        case OP_vkDestroyDescriptorUpdateTemplate: {
+            return "OP_vkDestroyDescriptorUpdateTemplate";
+        }
+        case OP_vkUpdateDescriptorSetWithTemplate: {
+            return "OP_vkUpdateDescriptorSetWithTemplate";
+        }
+        case OP_vkGetPhysicalDeviceExternalBufferProperties: {
+            return "OP_vkGetPhysicalDeviceExternalBufferProperties";
+        }
+        case OP_vkGetPhysicalDeviceExternalFenceProperties: {
+            return "OP_vkGetPhysicalDeviceExternalFenceProperties";
+        }
+        case OP_vkGetPhysicalDeviceExternalSemaphoreProperties: {
+            return "OP_vkGetPhysicalDeviceExternalSemaphoreProperties";
+        }
+        case OP_vkGetDescriptorSetLayoutSupport: {
+            return "OP_vkGetDescriptorSetLayoutSupport";
+        }
+#endif
+#ifdef VK_KHR_surface
+        case OP_vkDestroySurfaceKHR: {
+            return "OP_vkDestroySurfaceKHR";
+        }
+        case OP_vkGetPhysicalDeviceSurfaceSupportKHR: {
+            return "OP_vkGetPhysicalDeviceSurfaceSupportKHR";
+        }
+        case OP_vkGetPhysicalDeviceSurfaceCapabilitiesKHR: {
+            return "OP_vkGetPhysicalDeviceSurfaceCapabilitiesKHR";
+        }
+        case OP_vkGetPhysicalDeviceSurfaceFormatsKHR: {
+            return "OP_vkGetPhysicalDeviceSurfaceFormatsKHR";
+        }
+        case OP_vkGetPhysicalDeviceSurfacePresentModesKHR: {
+            return "OP_vkGetPhysicalDeviceSurfacePresentModesKHR";
+        }
+#endif
+#ifdef VK_KHR_swapchain
+        case OP_vkCreateSwapchainKHR: {
+            return "OP_vkCreateSwapchainKHR";
+        }
+        case OP_vkDestroySwapchainKHR: {
+            return "OP_vkDestroySwapchainKHR";
+        }
+        case OP_vkGetSwapchainImagesKHR: {
+            return "OP_vkGetSwapchainImagesKHR";
+        }
+        case OP_vkAcquireNextImageKHR: {
+            return "OP_vkAcquireNextImageKHR";
+        }
+        case OP_vkQueuePresentKHR: {
+            return "OP_vkQueuePresentKHR";
+        }
+        case OP_vkGetDeviceGroupPresentCapabilitiesKHR: {
+            return "OP_vkGetDeviceGroupPresentCapabilitiesKHR";
+        }
+        case OP_vkGetDeviceGroupSurfacePresentModesKHR: {
+            return "OP_vkGetDeviceGroupSurfacePresentModesKHR";
+        }
+        case OP_vkGetPhysicalDevicePresentRectanglesKHR: {
+            return "OP_vkGetPhysicalDevicePresentRectanglesKHR";
+        }
+        case OP_vkAcquireNextImage2KHR: {
+            return "OP_vkAcquireNextImage2KHR";
+        }
+#endif
+#ifdef VK_KHR_display
+        case OP_vkGetPhysicalDeviceDisplayPropertiesKHR: {
+            return "OP_vkGetPhysicalDeviceDisplayPropertiesKHR";
+        }
+        case OP_vkGetPhysicalDeviceDisplayPlanePropertiesKHR: {
+            return "OP_vkGetPhysicalDeviceDisplayPlanePropertiesKHR";
+        }
+        case OP_vkGetDisplayPlaneSupportedDisplaysKHR: {
+            return "OP_vkGetDisplayPlaneSupportedDisplaysKHR";
+        }
+        case OP_vkGetDisplayModePropertiesKHR: {
+            return "OP_vkGetDisplayModePropertiesKHR";
+        }
+        case OP_vkCreateDisplayModeKHR: {
+            return "OP_vkCreateDisplayModeKHR";
+        }
+        case OP_vkGetDisplayPlaneCapabilitiesKHR: {
+            return "OP_vkGetDisplayPlaneCapabilitiesKHR";
+        }
+        case OP_vkCreateDisplayPlaneSurfaceKHR: {
+            return "OP_vkCreateDisplayPlaneSurfaceKHR";
+        }
+#endif
+#ifdef VK_KHR_display_swapchain
+        case OP_vkCreateSharedSwapchainsKHR: {
+            return "OP_vkCreateSharedSwapchainsKHR";
+        }
+#endif
+#ifdef VK_KHR_xlib_surface
+        case OP_vkCreateXlibSurfaceKHR: {
+            return "OP_vkCreateXlibSurfaceKHR";
+        }
+        case OP_vkGetPhysicalDeviceXlibPresentationSupportKHR: {
+            return "OP_vkGetPhysicalDeviceXlibPresentationSupportKHR";
+        }
+#endif
+#ifdef VK_KHR_xcb_surface
+        case OP_vkCreateXcbSurfaceKHR: {
+            return "OP_vkCreateXcbSurfaceKHR";
+        }
+        case OP_vkGetPhysicalDeviceXcbPresentationSupportKHR: {
+            return "OP_vkGetPhysicalDeviceXcbPresentationSupportKHR";
+        }
+#endif
+#ifdef VK_KHR_wayland_surface
+        case OP_vkCreateWaylandSurfaceKHR: {
+            return "OP_vkCreateWaylandSurfaceKHR";
+        }
+        case OP_vkGetPhysicalDeviceWaylandPresentationSupportKHR: {
+            return "OP_vkGetPhysicalDeviceWaylandPresentationSupportKHR";
+        }
+#endif
+#ifdef VK_KHR_android_surface
+        case OP_vkCreateAndroidSurfaceKHR: {
+            return "OP_vkCreateAndroidSurfaceKHR";
+        }
+#endif
+#ifdef VK_KHR_win32_surface
+        case OP_vkCreateWin32SurfaceKHR: {
+            return "OP_vkCreateWin32SurfaceKHR";
+        }
+        case OP_vkGetPhysicalDeviceWin32PresentationSupportKHR: {
+            return "OP_vkGetPhysicalDeviceWin32PresentationSupportKHR";
+        }
+#endif
+#ifdef VK_KHR_get_physical_device_properties2
+        case OP_vkGetPhysicalDeviceFeatures2KHR: {
+            return "OP_vkGetPhysicalDeviceFeatures2KHR";
+        }
+        case OP_vkGetPhysicalDeviceProperties2KHR: {
+            return "OP_vkGetPhysicalDeviceProperties2KHR";
+        }
+        case OP_vkGetPhysicalDeviceFormatProperties2KHR: {
+            return "OP_vkGetPhysicalDeviceFormatProperties2KHR";
+        }
+        case OP_vkGetPhysicalDeviceImageFormatProperties2KHR: {
+            return "OP_vkGetPhysicalDeviceImageFormatProperties2KHR";
+        }
+        case OP_vkGetPhysicalDeviceQueueFamilyProperties2KHR: {
+            return "OP_vkGetPhysicalDeviceQueueFamilyProperties2KHR";
+        }
+        case OP_vkGetPhysicalDeviceMemoryProperties2KHR: {
+            return "OP_vkGetPhysicalDeviceMemoryProperties2KHR";
+        }
+        case OP_vkGetPhysicalDeviceSparseImageFormatProperties2KHR: {
+            return "OP_vkGetPhysicalDeviceSparseImageFormatProperties2KHR";
+        }
+#endif
+#ifdef VK_KHR_device_group
+        case OP_vkGetDeviceGroupPeerMemoryFeaturesKHR: {
+            return "OP_vkGetDeviceGroupPeerMemoryFeaturesKHR";
+        }
+        case OP_vkCmdSetDeviceMaskKHR: {
+            return "OP_vkCmdSetDeviceMaskKHR";
+        }
+        case OP_vkCmdDispatchBaseKHR: {
+            return "OP_vkCmdDispatchBaseKHR";
+        }
+#endif
+#ifdef VK_KHR_maintenance1
+        case OP_vkTrimCommandPoolKHR: {
+            return "OP_vkTrimCommandPoolKHR";
+        }
+#endif
+#ifdef VK_KHR_device_group_creation
+        case OP_vkEnumeratePhysicalDeviceGroupsKHR: {
+            return "OP_vkEnumeratePhysicalDeviceGroupsKHR";
+        }
+#endif
+#ifdef VK_KHR_external_memory_capabilities
+        case OP_vkGetPhysicalDeviceExternalBufferPropertiesKHR: {
+            return "OP_vkGetPhysicalDeviceExternalBufferPropertiesKHR";
+        }
+#endif
+#ifdef VK_KHR_external_memory_win32
+        case OP_vkGetMemoryWin32HandleKHR: {
+            return "OP_vkGetMemoryWin32HandleKHR";
+        }
+        case OP_vkGetMemoryWin32HandlePropertiesKHR: {
+            return "OP_vkGetMemoryWin32HandlePropertiesKHR";
+        }
+#endif
+#ifdef VK_KHR_external_memory_fd
+        case OP_vkGetMemoryFdKHR: {
+            return "OP_vkGetMemoryFdKHR";
+        }
+        case OP_vkGetMemoryFdPropertiesKHR: {
+            return "OP_vkGetMemoryFdPropertiesKHR";
+        }
+#endif
+#ifdef VK_KHR_external_semaphore_capabilities
+        case OP_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR: {
+            return "OP_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR";
+        }
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+        case OP_vkImportSemaphoreWin32HandleKHR: {
+            return "OP_vkImportSemaphoreWin32HandleKHR";
+        }
+        case OP_vkGetSemaphoreWin32HandleKHR: {
+            return "OP_vkGetSemaphoreWin32HandleKHR";
+        }
+#endif
+#ifdef VK_KHR_external_semaphore_fd
+        case OP_vkImportSemaphoreFdKHR: {
+            return "OP_vkImportSemaphoreFdKHR";
+        }
+        case OP_vkGetSemaphoreFdKHR: {
+            return "OP_vkGetSemaphoreFdKHR";
+        }
+#endif
+#ifdef VK_KHR_push_descriptor
+        case OP_vkCmdPushDescriptorSetKHR: {
+            return "OP_vkCmdPushDescriptorSetKHR";
+        }
+        case OP_vkCmdPushDescriptorSetWithTemplateKHR: {
+            return "OP_vkCmdPushDescriptorSetWithTemplateKHR";
+        }
+#endif
+#ifdef VK_KHR_descriptor_update_template
+        case OP_vkCreateDescriptorUpdateTemplateKHR: {
+            return "OP_vkCreateDescriptorUpdateTemplateKHR";
+        }
+        case OP_vkDestroyDescriptorUpdateTemplateKHR: {
+            return "OP_vkDestroyDescriptorUpdateTemplateKHR";
+        }
+        case OP_vkUpdateDescriptorSetWithTemplateKHR: {
+            return "OP_vkUpdateDescriptorSetWithTemplateKHR";
+        }
+#endif
+#ifdef VK_KHR_create_renderpass2
+        case OP_vkCreateRenderPass2KHR: {
+            return "OP_vkCreateRenderPass2KHR";
+        }
+        case OP_vkCmdBeginRenderPass2KHR: {
+            return "OP_vkCmdBeginRenderPass2KHR";
+        }
+        case OP_vkCmdNextSubpass2KHR: {
+            return "OP_vkCmdNextSubpass2KHR";
+        }
+        case OP_vkCmdEndRenderPass2KHR: {
+            return "OP_vkCmdEndRenderPass2KHR";
+        }
+#endif
+#ifdef VK_KHR_shared_presentable_image
+        case OP_vkGetSwapchainStatusKHR: {
+            return "OP_vkGetSwapchainStatusKHR";
+        }
+#endif
+#ifdef VK_KHR_external_fence_capabilities
+        case OP_vkGetPhysicalDeviceExternalFencePropertiesKHR: {
+            return "OP_vkGetPhysicalDeviceExternalFencePropertiesKHR";
+        }
+#endif
+#ifdef VK_KHR_external_fence_win32
+        case OP_vkImportFenceWin32HandleKHR: {
+            return "OP_vkImportFenceWin32HandleKHR";
+        }
+        case OP_vkGetFenceWin32HandleKHR: {
+            return "OP_vkGetFenceWin32HandleKHR";
+        }
+#endif
+#ifdef VK_KHR_external_fence_fd
+        case OP_vkImportFenceFdKHR: {
+            return "OP_vkImportFenceFdKHR";
+        }
+        case OP_vkGetFenceFdKHR: {
+            return "OP_vkGetFenceFdKHR";
+        }
+#endif
+#ifdef VK_KHR_get_surface_capabilities2
+        case OP_vkGetPhysicalDeviceSurfaceCapabilities2KHR: {
+            return "OP_vkGetPhysicalDeviceSurfaceCapabilities2KHR";
+        }
+        case OP_vkGetPhysicalDeviceSurfaceFormats2KHR: {
+            return "OP_vkGetPhysicalDeviceSurfaceFormats2KHR";
+        }
+#endif
+#ifdef VK_KHR_get_display_properties2
+        case OP_vkGetPhysicalDeviceDisplayProperties2KHR: {
+            return "OP_vkGetPhysicalDeviceDisplayProperties2KHR";
+        }
+        case OP_vkGetPhysicalDeviceDisplayPlaneProperties2KHR: {
+            return "OP_vkGetPhysicalDeviceDisplayPlaneProperties2KHR";
+        }
+        case OP_vkGetDisplayModeProperties2KHR: {
+            return "OP_vkGetDisplayModeProperties2KHR";
+        }
+        case OP_vkGetDisplayPlaneCapabilities2KHR: {
+            return "OP_vkGetDisplayPlaneCapabilities2KHR";
+        }
+#endif
+#ifdef VK_KHR_get_memory_requirements2
+        case OP_vkGetImageMemoryRequirements2KHR: {
+            return "OP_vkGetImageMemoryRequirements2KHR";
+        }
+        case OP_vkGetBufferMemoryRequirements2KHR: {
+            return "OP_vkGetBufferMemoryRequirements2KHR";
+        }
+        case OP_vkGetImageSparseMemoryRequirements2KHR: {
+            return "OP_vkGetImageSparseMemoryRequirements2KHR";
+        }
+#endif
+#ifdef VK_KHR_sampler_ycbcr_conversion
+        case OP_vkCreateSamplerYcbcrConversionKHR: {
+            return "OP_vkCreateSamplerYcbcrConversionKHR";
+        }
+        case OP_vkDestroySamplerYcbcrConversionKHR: {
+            return "OP_vkDestroySamplerYcbcrConversionKHR";
+        }
+#endif
+#ifdef VK_KHR_bind_memory2
+        case OP_vkBindBufferMemory2KHR: {
+            return "OP_vkBindBufferMemory2KHR";
+        }
+        case OP_vkBindImageMemory2KHR: {
+            return "OP_vkBindImageMemory2KHR";
+        }
+#endif
+#ifdef VK_KHR_maintenance3
+        case OP_vkGetDescriptorSetLayoutSupportKHR: {
+            return "OP_vkGetDescriptorSetLayoutSupportKHR";
+        }
+#endif
+#ifdef VK_KHR_draw_indirect_count
+        case OP_vkCmdDrawIndirectCountKHR: {
+            return "OP_vkCmdDrawIndirectCountKHR";
+        }
+        case OP_vkCmdDrawIndexedIndirectCountKHR: {
+            return "OP_vkCmdDrawIndexedIndirectCountKHR";
+        }
+#endif
+#ifdef VK_ANDROID_native_buffer
+        case OP_vkGetSwapchainGrallocUsageANDROID: {
+            return "OP_vkGetSwapchainGrallocUsageANDROID";
+        }
+        case OP_vkAcquireImageANDROID: {
+            return "OP_vkAcquireImageANDROID";
+        }
+        case OP_vkQueueSignalReleaseImageANDROID: {
+            return "OP_vkQueueSignalReleaseImageANDROID";
+        }
+#endif
+#ifdef VK_EXT_debug_report
+        case OP_vkCreateDebugReportCallbackEXT: {
+            return "OP_vkCreateDebugReportCallbackEXT";
+        }
+        case OP_vkDestroyDebugReportCallbackEXT: {
+            return "OP_vkDestroyDebugReportCallbackEXT";
+        }
+        case OP_vkDebugReportMessageEXT: {
+            return "OP_vkDebugReportMessageEXT";
+        }
+#endif
+#ifdef VK_EXT_debug_marker
+        case OP_vkDebugMarkerSetObjectTagEXT: {
+            return "OP_vkDebugMarkerSetObjectTagEXT";
+        }
+        case OP_vkDebugMarkerSetObjectNameEXT: {
+            return "OP_vkDebugMarkerSetObjectNameEXT";
+        }
+        case OP_vkCmdDebugMarkerBeginEXT: {
+            return "OP_vkCmdDebugMarkerBeginEXT";
+        }
+        case OP_vkCmdDebugMarkerEndEXT: {
+            return "OP_vkCmdDebugMarkerEndEXT";
+        }
+        case OP_vkCmdDebugMarkerInsertEXT: {
+            return "OP_vkCmdDebugMarkerInsertEXT";
+        }
+#endif
+#ifdef VK_AMD_draw_indirect_count
+        case OP_vkCmdDrawIndirectCountAMD: {
+            return "OP_vkCmdDrawIndirectCountAMD";
+        }
+        case OP_vkCmdDrawIndexedIndirectCountAMD: {
+            return "OP_vkCmdDrawIndexedIndirectCountAMD";
+        }
+#endif
+#ifdef VK_AMD_shader_info
+        case OP_vkGetShaderInfoAMD: {
+            return "OP_vkGetShaderInfoAMD";
+        }
+#endif
+#ifdef VK_NV_external_memory_capabilities
+        case OP_vkGetPhysicalDeviceExternalImageFormatPropertiesNV: {
+            return "OP_vkGetPhysicalDeviceExternalImageFormatPropertiesNV";
+        }
+#endif
+#ifdef VK_NV_external_memory_win32
+        case OP_vkGetMemoryWin32HandleNV: {
+            return "OP_vkGetMemoryWin32HandleNV";
+        }
+#endif
+#ifdef VK_NN_vi_surface
+        case OP_vkCreateViSurfaceNN: {
+            return "OP_vkCreateViSurfaceNN";
+        }
+#endif
+#ifdef VK_EXT_conditional_rendering
+        case OP_vkCmdBeginConditionalRenderingEXT: {
+            return "OP_vkCmdBeginConditionalRenderingEXT";
+        }
+        case OP_vkCmdEndConditionalRenderingEXT: {
+            return "OP_vkCmdEndConditionalRenderingEXT";
+        }
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+        case OP_vkCmdSetViewportWScalingNV: {
+            return "OP_vkCmdSetViewportWScalingNV";
+        }
+#endif
+#ifdef VK_EXT_direct_mode_display
+        case OP_vkReleaseDisplayEXT: {
+            return "OP_vkReleaseDisplayEXT";
+        }
+#endif
+#ifdef VK_EXT_acquire_xlib_display
+        case OP_vkAcquireXlibDisplayEXT: {
+            return "OP_vkAcquireXlibDisplayEXT";
+        }
+        case OP_vkGetRandROutputDisplayEXT: {
+            return "OP_vkGetRandROutputDisplayEXT";
+        }
+#endif
+#ifdef VK_EXT_display_surface_counter
+        case OP_vkGetPhysicalDeviceSurfaceCapabilities2EXT: {
+            return "OP_vkGetPhysicalDeviceSurfaceCapabilities2EXT";
+        }
+#endif
+#ifdef VK_EXT_display_control
+        case OP_vkDisplayPowerControlEXT: {
+            return "OP_vkDisplayPowerControlEXT";
+        }
+        case OP_vkRegisterDeviceEventEXT: {
+            return "OP_vkRegisterDeviceEventEXT";
+        }
+        case OP_vkRegisterDisplayEventEXT: {
+            return "OP_vkRegisterDisplayEventEXT";
+        }
+        case OP_vkGetSwapchainCounterEXT: {
+            return "OP_vkGetSwapchainCounterEXT";
+        }
+#endif
+#ifdef VK_GOOGLE_display_timing
+        case OP_vkGetRefreshCycleDurationGOOGLE: {
+            return "OP_vkGetRefreshCycleDurationGOOGLE";
+        }
+        case OP_vkGetPastPresentationTimingGOOGLE: {
+            return "OP_vkGetPastPresentationTimingGOOGLE";
+        }
+#endif
+#ifdef VK_EXT_discard_rectangles
+        case OP_vkCmdSetDiscardRectangleEXT: {
+            return "OP_vkCmdSetDiscardRectangleEXT";
+        }
+#endif
+#ifdef VK_EXT_hdr_metadata
+        case OP_vkSetHdrMetadataEXT: {
+            return "OP_vkSetHdrMetadataEXT";
+        }
+#endif
+#ifdef VK_MVK_ios_surface
+        case OP_vkCreateIOSSurfaceMVK: {
+            return "OP_vkCreateIOSSurfaceMVK";
+        }
+#endif
+#ifdef VK_MVK_macos_surface
+        case OP_vkCreateMacOSSurfaceMVK: {
+            return "OP_vkCreateMacOSSurfaceMVK";
+        }
+#endif
+#ifdef VK_EXT_debug_utils
+        case OP_vkSetDebugUtilsObjectNameEXT: {
+            return "OP_vkSetDebugUtilsObjectNameEXT";
+        }
+        case OP_vkSetDebugUtilsObjectTagEXT: {
+            return "OP_vkSetDebugUtilsObjectTagEXT";
+        }
+        case OP_vkQueueBeginDebugUtilsLabelEXT: {
+            return "OP_vkQueueBeginDebugUtilsLabelEXT";
+        }
+        case OP_vkQueueEndDebugUtilsLabelEXT: {
+            return "OP_vkQueueEndDebugUtilsLabelEXT";
+        }
+        case OP_vkQueueInsertDebugUtilsLabelEXT: {
+            return "OP_vkQueueInsertDebugUtilsLabelEXT";
+        }
+        case OP_vkCmdBeginDebugUtilsLabelEXT: {
+            return "OP_vkCmdBeginDebugUtilsLabelEXT";
+        }
+        case OP_vkCmdEndDebugUtilsLabelEXT: {
+            return "OP_vkCmdEndDebugUtilsLabelEXT";
+        }
+        case OP_vkCmdInsertDebugUtilsLabelEXT: {
+            return "OP_vkCmdInsertDebugUtilsLabelEXT";
+        }
+        case OP_vkCreateDebugUtilsMessengerEXT: {
+            return "OP_vkCreateDebugUtilsMessengerEXT";
+        }
+        case OP_vkDestroyDebugUtilsMessengerEXT: {
+            return "OP_vkDestroyDebugUtilsMessengerEXT";
+        }
+        case OP_vkSubmitDebugUtilsMessageEXT: {
+            return "OP_vkSubmitDebugUtilsMessageEXT";
+        }
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+        case OP_vkGetAndroidHardwareBufferPropertiesANDROID: {
+            return "OP_vkGetAndroidHardwareBufferPropertiesANDROID";
+        }
+        case OP_vkGetMemoryAndroidHardwareBufferANDROID: {
+            return "OP_vkGetMemoryAndroidHardwareBufferANDROID";
+        }
+#endif
+#ifdef VK_EXT_sample_locations
+        case OP_vkCmdSetSampleLocationsEXT: {
+            return "OP_vkCmdSetSampleLocationsEXT";
+        }
+        case OP_vkGetPhysicalDeviceMultisamplePropertiesEXT: {
+            return "OP_vkGetPhysicalDeviceMultisamplePropertiesEXT";
+        }
+#endif
+#ifdef VK_EXT_validation_cache
+        case OP_vkCreateValidationCacheEXT: {
+            return "OP_vkCreateValidationCacheEXT";
+        }
+        case OP_vkDestroyValidationCacheEXT: {
+            return "OP_vkDestroyValidationCacheEXT";
+        }
+        case OP_vkMergeValidationCachesEXT: {
+            return "OP_vkMergeValidationCachesEXT";
+        }
+        case OP_vkGetValidationCacheDataEXT: {
+            return "OP_vkGetValidationCacheDataEXT";
+        }
+#endif
+#ifdef VK_EXT_external_memory_host
+        case OP_vkGetMemoryHostPointerPropertiesEXT: {
+            return "OP_vkGetMemoryHostPointerPropertiesEXT";
+        }
+#endif
+#ifdef VK_AMD_buffer_marker
+        case OP_vkCmdWriteBufferMarkerAMD: {
+            return "OP_vkCmdWriteBufferMarkerAMD";
+        }
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+        case OP_vkCmdSetCheckpointNV: {
+            return "OP_vkCmdSetCheckpointNV";
+        }
+        case OP_vkGetQueueCheckpointDataNV: {
+            return "OP_vkGetQueueCheckpointDataNV";
+        }
+#endif
+#ifdef VK_GOOGLE_gfxstream
+        case OP_vkMapMemoryIntoAddressSpaceGOOGLE: {
+            return "OP_vkMapMemoryIntoAddressSpaceGOOGLE";
+        }
+        case OP_vkUpdateDescriptorSetWithTemplateSizedGOOGLE: {
+            return "OP_vkUpdateDescriptorSetWithTemplateSizedGOOGLE";
+        }
+        case OP_vkBeginCommandBufferAsyncGOOGLE: {
+            return "OP_vkBeginCommandBufferAsyncGOOGLE";
+        }
+        case OP_vkEndCommandBufferAsyncGOOGLE: {
+            return "OP_vkEndCommandBufferAsyncGOOGLE";
+        }
+        case OP_vkResetCommandBufferAsyncGOOGLE: {
+            return "OP_vkResetCommandBufferAsyncGOOGLE";
+        }
+        case OP_vkCommandBufferHostSyncGOOGLE: {
+            return "OP_vkCommandBufferHostSyncGOOGLE";
+        }
+        case OP_vkCreateImageWithRequirementsGOOGLE: {
+            return "OP_vkCreateImageWithRequirementsGOOGLE";
+        }
+        case OP_vkCreateBufferWithRequirementsGOOGLE: {
+            return "OP_vkCreateBufferWithRequirementsGOOGLE";
+        }
+        case OP_vkGetMemoryHostAddressInfoGOOGLE: {
+            return "OP_vkGetMemoryHostAddressInfoGOOGLE";
+        }
+        case OP_vkFreeMemorySyncGOOGLE: {
+            return "OP_vkFreeMemorySyncGOOGLE";
+        }
+        case OP_vkQueueHostSyncGOOGLE: {
+            return "OP_vkQueueHostSyncGOOGLE";
+        }
+        case OP_vkQueueSubmitAsyncGOOGLE: {
+            return "OP_vkQueueSubmitAsyncGOOGLE";
+        }
+        case OP_vkQueueWaitIdleAsyncGOOGLE: {
+            return "OP_vkQueueWaitIdleAsyncGOOGLE";
+        }
+        case OP_vkQueueBindSparseAsyncGOOGLE: {
+            return "OP_vkQueueBindSparseAsyncGOOGLE";
+        }
+        case OP_vkGetLinearImageLayoutGOOGLE: {
+            return "OP_vkGetLinearImageLayoutGOOGLE";
+        }
+#endif
+#ifdef VK_MVK_moltenvk
+        case OP_vkGetMTLDeviceMVK: {
+            return "OP_vkGetMTLDeviceMVK";
+        }
+        case OP_vkSetMTLTextureMVK: {
+            return "OP_vkSetMTLTextureMVK";
+        }
+        case OP_vkGetMTLTextureMVK: {
+            return "OP_vkGetMTLTextureMVK";
+        }
+        case OP_vkGetMTLBufferMVK: {
+            return "OP_vkGetMTLBufferMVK";
+        }
+        case OP_vkUseIOSurfaceMVK: {
+            return "OP_vkUseIOSurfaceMVK";
+        }
+        case OP_vkGetIOSurfaceMVK: {
+            return "OP_vkGetIOSurfaceMVK";
+        }
+#endif
+#ifdef VK_GOOGLE_gfxstream
+        case OP_vkQueueFlushCommandsGOOGLE: {
+            return "OP_vkQueueFlushCommandsGOOGLE";
+        }
+        case OP_vkGetBlobGOOGLE: {
+            return "OP_vkGetBlobGOOGLE";
+        }
+#endif
+#ifdef VK_KHR_dynamic_rendering
+        case OP_vkCmdEndRenderingKHR: {
+            return "OP_vkCmdEndRenderingKHR";
+        }
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+        case OP_vkAcquireFullScreenExclusiveModeEXT: {
+            return "OP_vkAcquireFullScreenExclusiveModeEXT";
+        }
+#endif
+#ifdef VK_KHR_synchronization2
+        case OP_vkCmdPipelineBarrier2KHR: {
+            return "OP_vkCmdPipelineBarrier2KHR";
+        }
+#endif
+#ifdef VK_KHR_maintenance4
+        case OP_vkGetDeviceBufferMemoryRequirementsKHR: {
+            return "OP_vkGetDeviceBufferMemoryRequirementsKHR";
+        }
+#endif
+#ifdef VK_EXT_color_write_enable
+        case OP_vkCmdSetColorWriteEnableEXT: {
+            return "OP_vkCmdSetColorWriteEnableEXT";
+        }
+#endif
+#ifdef VK_NV_ray_tracing
+        case OP_vkBindAccelerationStructureMemoryNV: {
+            return "OP_vkBindAccelerationStructureMemoryNV";
+        }
+#endif
+#ifdef VK_INTEL_performance_query
+        case OP_vkInitializePerformanceApiINTEL: {
+            return "OP_vkInitializePerformanceApiINTEL";
+        }
+#endif
+#ifdef VK_KHR_deferred_host_operations
+        case OP_vkGetDeferredOperationMaxConcurrencyKHR: {
+            return "OP_vkGetDeferredOperationMaxConcurrencyKHR";
+        }
+#endif
+#ifdef VK_EXT_calibrated_timestamps
+        case OP_vkGetCalibratedTimestampsEXT: {
+            return "OP_vkGetCalibratedTimestampsEXT";
+        }
+#endif
+#ifdef VK_NV_ray_tracing
+        case OP_vkCreateRayTracingPipelinesNV: {
+            return "OP_vkCreateRayTracingPipelinesNV";
+        }
+#endif
+#ifdef VK_KHR_acceleration_structure
+        case OP_vkCmdCopyMemoryToAccelerationStructureKHR: {
+            return "OP_vkCmdCopyMemoryToAccelerationStructureKHR";
+        }
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+        case OP_vkCmdSetFragmentShadingRateKHR: {
+            return "OP_vkCmdSetFragmentShadingRateKHR";
+        }
+#endif
+#ifdef VK_NVX_image_view_handle
+        case OP_vkGetImageViewHandleNVX: {
+            return "OP_vkGetImageViewHandleNVX";
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+        case OP_vkCmdSetScissorWithCountEXT: {
+            return "OP_vkCmdSetScissorWithCountEXT";
+        }
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+        case OP_vkGetRayTracingShaderGroupStackSizeKHR: {
+            return "OP_vkGetRayTracingShaderGroupStackSizeKHR";
+        }
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+        case OP_vkGetDeviceGroupSurfacePresentModes2EXT: {
+            return "OP_vkGetDeviceGroupSurfacePresentModes2EXT";
+        }
+#endif
+#ifdef VK_NV_mesh_shader
+        case OP_vkCmdDrawMeshTasksNV: {
+            return "OP_vkCmdDrawMeshTasksNV";
+        }
+#endif
+#ifdef VK_NVX_binary_import
+        case OP_vkCreateCuFunctionNVX: {
+            return "OP_vkCreateCuFunctionNVX";
+        }
+#endif
+#ifdef VK_NV_ray_tracing
+        case OP_vkCmdWriteAccelerationStructuresPropertiesNV: {
+            return "OP_vkCmdWriteAccelerationStructuresPropertiesNV";
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+        case OP_vkCmdSetPatchControlPointsEXT: {
+            return "OP_vkCmdSetPatchControlPointsEXT";
+        }
+#endif
+#ifdef VK_EXT_private_data
+        case OP_vkDestroyPrivateDataSlotEXT: {
+            return "OP_vkDestroyPrivateDataSlotEXT";
+        }
+#endif
+#ifdef VK_NV_ray_tracing
+        case OP_vkCmdTraceRaysNV: {
+            return "OP_vkCmdTraceRaysNV";
+        }
+#endif
+#ifdef VK_NVX_image_view_handle
+        case OP_vkGetImageViewAddressNVX: {
+            return "OP_vkGetImageViewAddressNVX";
+        }
+#endif
+#ifdef VK_NV_ray_tracing
+        case OP_vkCmdCopyAccelerationStructureNV: {
+            return "OP_vkCmdCopyAccelerationStructureNV";
+        }
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+        case OP_vkCmdSetVertexInputEXT: {
+            return "OP_vkCmdSetVertexInputEXT";
+        }
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+        case OP_vkCmdTraceRaysIndirectKHR: {
+            return "OP_vkCmdTraceRaysIndirectKHR";
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+        case OP_vkCmdSetFrontFaceEXT: {
+            return "OP_vkCmdSetFrontFaceEXT";
+        }
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+        case OP_vkSetBufferCollectionBufferConstraintsFUCHSIA: {
+            return "OP_vkSetBufferCollectionBufferConstraintsFUCHSIA";
+        }
+#endif
+#ifdef VK_FUCHSIA_external_memory
+        case OP_vkGetMemoryZirconHandlePropertiesFUCHSIA: {
+            return "OP_vkGetMemoryZirconHandlePropertiesFUCHSIA";
+        }
+#endif
+#ifdef VK_INTEL_performance_query
+        case OP_vkGetPerformanceParameterINTEL: {
+            return "OP_vkGetPerformanceParameterINTEL";
+        }
+#endif
+#ifdef VK_GOOGLE_gfxstream
+        case OP_vkCollectDescriptorPoolIdsGOOGLE: {
+            return "OP_vkCollectDescriptorPoolIdsGOOGLE";
+        }
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+        case OP_vkCmdTraceRaysKHR: {
+            return "OP_vkCmdTraceRaysKHR";
+        }
+#endif
+#ifdef VK_FUCHSIA_external_memory
+        case OP_vkGetMemoryZirconHandleFUCHSIA: {
+            return "OP_vkGetMemoryZirconHandleFUCHSIA";
+        }
+#endif
+#ifdef VK_NV_shading_rate_image
+        case OP_vkCmdSetViewportShadingRatePaletteNV: {
+            return "OP_vkCmdSetViewportShadingRatePaletteNV";
+        }
+#endif
+#ifdef VK_KHR_deferred_host_operations
+        case OP_vkDestroyDeferredOperationKHR: {
+            return "OP_vkDestroyDeferredOperationKHR";
+        }
+#endif
+#ifdef VK_KHR_video_queue
+        case OP_vkBindVideoSessionMemoryKHR: {
+            return "OP_vkBindVideoSessionMemoryKHR";
+        }
+#endif
+#ifdef VK_KHR_deferred_host_operations
+        case OP_vkDeferredOperationJoinKHR: {
+            return "OP_vkDeferredOperationJoinKHR";
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+        case OP_vkCmdSetDepthWriteEnableEXT: {
+            return "OP_vkCmdSetDepthWriteEnableEXT";
+        }
+#endif
+#ifdef VK_KHR_buffer_device_address
+        case OP_vkGetBufferDeviceAddressKHR: {
+            return "OP_vkGetBufferDeviceAddressKHR";
+        }
+#endif
+#ifdef VK_KHR_acceleration_structure
+        case OP_vkGetAccelerationStructureBuildSizesKHR: {
+            return "OP_vkGetAccelerationStructureBuildSizesKHR";
+        }
+#endif
+#ifdef VK_NVX_binary_import
+        case OP_vkCmdCuLaunchKernelNVX: {
+            return "OP_vkCmdCuLaunchKernelNVX";
+        }
+#endif
+#ifdef VK_NV_ray_tracing
+        case OP_vkGetAccelerationStructureMemoryRequirementsNV: {
+            return "OP_vkGetAccelerationStructureMemoryRequirementsNV";
+        }
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+        case OP_vkCmdSubpassShadingHUAWEI: {
+            return "OP_vkCmdSubpassShadingHUAWEI";
+        }
+#endif
+#ifdef VK_EXT_directfb_surface
+        case OP_vkCreateDirectFBSurfaceEXT: {
+            return "OP_vkCreateDirectFBSurfaceEXT";
+        }
+#endif
+#ifdef VK_VERSION_1_2
+        case OP_vkCmdEndRenderPass2: {
+            return "OP_vkCmdEndRenderPass2";
+        }
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+        case OP_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR: {
+            return "OP_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR";
+        }
+#endif
+#ifdef VK_VERSION_1_2
+        case OP_vkGetBufferDeviceAddress: {
+            return "OP_vkGetBufferDeviceAddress";
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+        case OP_vkCmdSetDepthBoundsTestEnableEXT: {
+            return "OP_vkCmdSetDepthBoundsTestEnableEXT";
+        }
+#endif
+#ifdef VK_KHR_acceleration_structure
+        case OP_vkGetAccelerationStructureDeviceAddressKHR: {
+            return "OP_vkGetAccelerationStructureDeviceAddressKHR";
+        }
+        case OP_vkCmdCopyAccelerationStructureToMemoryKHR: {
+            return "OP_vkCmdCopyAccelerationStructureToMemoryKHR";
+        }
+#endif
+#ifdef VK_NV_mesh_shader
+        case OP_vkCmdDrawMeshTasksIndirectCountNV: {
+            return "OP_vkCmdDrawMeshTasksIndirectCountNV";
+        }
+#endif
+#ifdef VK_KHR_performance_query
+        case OP_vkReleaseProfilingLockKHR: {
+            return "OP_vkReleaseProfilingLockKHR";
+        }
+#endif
+#ifdef VK_KHR_acceleration_structure
+        case OP_vkDestroyAccelerationStructureKHR: {
+            return "OP_vkDestroyAccelerationStructureKHR";
+        }
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+        case OP_vkSetDeviceMemoryPriorityEXT: {
+            return "OP_vkSetDeviceMemoryPriorityEXT";
+        }
+#endif
+#ifdef VK_EXT_buffer_device_address
+        case OP_vkGetBufferDeviceAddressEXT: {
+            return "OP_vkGetBufferDeviceAddressEXT";
+        }
+#endif
+#ifdef VK_QNX_screen_surface
+        case OP_vkCreateScreenSurfaceQNX: {
+            return "OP_vkCreateScreenSurfaceQNX";
+        }
+#endif
+#ifdef VK_KHR_synchronization2
+        case OP_vkCmdWriteBufferMarker2AMD: {
+            return "OP_vkCmdWriteBufferMarker2AMD";
+        }
+#endif
+#ifdef VK_VERSION_1_2
+        case OP_vkWaitSemaphores: {
+            return "OP_vkWaitSemaphores";
+        }
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+        case OP_vkDestroyBufferCollectionFUCHSIA: {
+            return "OP_vkDestroyBufferCollectionFUCHSIA";
+        }
+#endif
+#ifdef VK_EXT_private_data
+        case OP_vkSetPrivateDataEXT: {
+            return "OP_vkSetPrivateDataEXT";
+        }
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+        case OP_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI: {
+            return "OP_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI";
+        }
+#endif
+#ifdef VK_NV_scissor_exclusive
+        case OP_vkCmdSetExclusiveScissorNV: {
+            return "OP_vkCmdSetExclusiveScissorNV";
+        }
+#endif
+#ifdef VK_KHR_copy_commands2
+        case OP_vkCmdCopyImage2KHR: {
+            return "OP_vkCmdCopyImage2KHR";
+        }
+#endif
+#ifdef VK_NVX_binary_import
+        case OP_vkCreateCuModuleNVX: {
+            return "OP_vkCreateCuModuleNVX";
+        }
+#endif
+#ifdef VK_KHR_video_queue
+        case OP_vkCreateVideoSessionKHR: {
+            return "OP_vkCreateVideoSessionKHR";
+        }
+#endif
+#ifdef VK_KHR_timeline_semaphore
+        case OP_vkGetSemaphoreCounterValueKHR: {
+            return "OP_vkGetSemaphoreCounterValueKHR";
+        }
+#endif
+#ifdef VK_NV_ray_tracing
+        case OP_vkGetRayTracingShaderGroupHandlesNV: {
+            return "OP_vkGetRayTracingShaderGroupHandlesNV";
+        }
+#endif
+#ifdef VK_VERSION_1_2
+        case OP_vkGetBufferOpaqueCaptureAddress: {
+            return "OP_vkGetBufferOpaqueCaptureAddress";
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+        case OP_vkCmdSetDepthTestEnableEXT: {
+            return "OP_vkCmdSetDepthTestEnableEXT";
+        }
+#endif
+#ifdef VK_NV_device_generated_commands
+        case OP_vkCmdExecuteGeneratedCommandsNV: {
+            return "OP_vkCmdExecuteGeneratedCommandsNV";
+        }
+#endif
+#ifdef VK_VERSION_1_2
+        case OP_vkCmdBeginRenderPass2: {
+            return "OP_vkCmdBeginRenderPass2";
+        }
+#endif
+#ifdef VK_EXT_private_data
+        case OP_vkCreatePrivateDataSlotEXT: {
+            return "OP_vkCreatePrivateDataSlotEXT";
+        }
+#endif
+#ifdef VK_NV_shading_rate_image
+        case OP_vkCmdSetCoarseSampleOrderNV: {
+            return "OP_vkCmdSetCoarseSampleOrderNV";
+        }
+#endif
+#ifdef VK_KHR_video_queue
+        case OP_vkDestroyVideoSessionParametersKHR: {
+            return "OP_vkDestroyVideoSessionParametersKHR";
+        }
+#endif
+#ifdef VK_NV_shading_rate_image
+        case OP_vkCmdBindShadingRateImageNV: {
+            return "OP_vkCmdBindShadingRateImageNV";
+        }
+#endif
+#ifdef VK_KHR_performance_query
+        case OP_vkAcquireProfilingLockKHR: {
+            return "OP_vkAcquireProfilingLockKHR";
+        }
+#endif
+#ifdef VK_KHR_video_queue
+        case OP_vkDestroyVideoSessionKHR: {
+            return "OP_vkDestroyVideoSessionKHR";
+        }
+        case OP_vkCmdBeginVideoCodingKHR: {
+            return "OP_vkCmdBeginVideoCodingKHR";
+        }
+#endif
+#ifdef VK_KHR_acceleration_structure
+        case OP_vkCopyAccelerationStructureKHR: {
+            return "OP_vkCopyAccelerationStructureKHR";
+        }
+#endif
+#ifdef VK_GGP_stream_descriptor_surface
+        case OP_vkCreateStreamDescriptorSurfaceGGP: {
+            return "OP_vkCreateStreamDescriptorSurfaceGGP";
+        }
+#endif
+#ifdef VK_KHR_acceleration_structure
+        case OP_vkBuildAccelerationStructuresKHR: {
+            return "OP_vkBuildAccelerationStructuresKHR";
+        }
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+        case OP_vkGetBufferCollectionPropertiesFUCHSIA: {
+            return "OP_vkGetBufferCollectionPropertiesFUCHSIA";
+        }
+#endif
+#ifdef VK_EXT_host_query_reset
+        case OP_vkResetQueryPoolEXT: {
+            return "OP_vkResetQueryPoolEXT";
+        }
+#endif
+#ifdef VK_KHR_maintenance4
+        case OP_vkGetDeviceImageMemoryRequirementsKHR: {
+            return "OP_vkGetDeviceImageMemoryRequirementsKHR";
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+        case OP_vkCmdBindVertexBuffers2EXT: {
+            return "OP_vkCmdBindVertexBuffers2EXT";
+        }
+#endif
+#ifdef VK_GOOGLE_gfxstream
+        case OP_vkQueueSignalReleaseImageANDROIDAsyncGOOGLE: {
+            return "OP_vkQueueSignalReleaseImageANDROIDAsyncGOOGLE";
+        }
+#endif
+#ifdef VK_VERSION_1_2
+        case OP_vkCmdNextSubpass2: {
+            return "OP_vkCmdNextSubpass2";
+        }
+#endif
+#ifdef VK_KHR_synchronization2
+        case OP_vkCmdWaitEvents2KHR: {
+            return "OP_vkCmdWaitEvents2KHR";
+        }
+#endif
+#ifdef VK_VERSION_1_2
+        case OP_vkCmdDrawIndexedIndirectCount: {
+            return "OP_vkCmdDrawIndexedIndirectCount";
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+        case OP_vkCmdSetRasterizerDiscardEnableEXT: {
+            return "OP_vkCmdSetRasterizerDiscardEnableEXT";
+        }
+#endif
+#ifdef VK_INTEL_performance_query
+        case OP_vkAcquirePerformanceConfigurationINTEL: {
+            return "OP_vkAcquirePerformanceConfigurationINTEL";
+        }
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+        case OP_vkCreateRayTracingPipelinesKHR: {
+            return "OP_vkCreateRayTracingPipelinesKHR";
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+        case OP_vkCmdSetDepthCompareOpEXT: {
+            return "OP_vkCmdSetDepthCompareOpEXT";
+        }
+#endif
+#ifdef VK_KHR_copy_commands2
+        case OP_vkCmdCopyBuffer2KHR: {
+            return "OP_vkCmdCopyBuffer2KHR";
+        }
+#endif
+#ifdef VK_KHR_video_queue
+        case OP_vkGetPhysicalDeviceVideoCapabilitiesKHR: {
+            return "OP_vkGetPhysicalDeviceVideoCapabilitiesKHR";
+        }
+#endif
+#ifdef VK_FUCHSIA_external_semaphore
+        case OP_vkGetSemaphoreZirconHandleFUCHSIA: {
+            return "OP_vkGetSemaphoreZirconHandleFUCHSIA";
+        }
+#endif
+#ifdef VK_KHR_copy_commands2
+        case OP_vkCmdCopyBufferToImage2KHR: {
+            return "OP_vkCmdCopyBufferToImage2KHR";
+        }
+#endif
+#ifdef VK_NV_device_generated_commands
+        case OP_vkGetGeneratedCommandsMemoryRequirementsNV: {
+            return "OP_vkGetGeneratedCommandsMemoryRequirementsNV";
+        }
+#endif
+#ifdef VK_EXT_acquire_drm_display
+        case OP_vkAcquireDrmDisplayEXT: {
+            return "OP_vkAcquireDrmDisplayEXT";
+        }
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+        case OP_vkGetImageDrmFormatModifierPropertiesEXT: {
+            return "OP_vkGetImageDrmFormatModifierPropertiesEXT";
+        }
+#endif
+#ifdef VK_INTEL_performance_query
+        case OP_vkCmdSetPerformanceOverrideINTEL: {
+            return "OP_vkCmdSetPerformanceOverrideINTEL";
+        }
+#endif
+#ifdef VK_VERSION_1_2
+        case OP_vkResetQueryPool: {
+            return "OP_vkResetQueryPool";
+        }
+#endif
+#ifdef VK_KHR_copy_commands2
+        case OP_vkCmdCopyImageToBuffer2KHR: {
+            return "OP_vkCmdCopyImageToBuffer2KHR";
+        }
+#endif
+#ifdef VK_KHR_synchronization2
+        case OP_vkCmdWriteTimestamp2KHR: {
+            return "OP_vkCmdWriteTimestamp2KHR";
+        }
+#endif
+#ifdef VK_NV_ray_tracing
+        case OP_vkDestroyAccelerationStructureNV: {
+            return "OP_vkDestroyAccelerationStructureNV";
+        }
+#endif
+#ifdef VK_INTEL_performance_query
+        case OP_vkReleasePerformanceConfigurationINTEL: {
+            return "OP_vkReleasePerformanceConfigurationINTEL";
+        }
+#endif
+#ifdef VK_KHR_video_queue
+        case OP_vkCmdControlVideoCodingKHR: {
+            return "OP_vkCmdControlVideoCodingKHR";
+        }
+#endif
+#ifdef VK_NVX_binary_import
+        case OP_vkDestroyCuFunctionNVX: {
+            return "OP_vkDestroyCuFunctionNVX";
+        }
+#endif
+#ifdef VK_KHR_copy_commands2
+        case OP_vkCmdResolveImage2KHR: {
+            return "OP_vkCmdResolveImage2KHR";
+        }
+#endif
+#ifdef VK_EXT_metal_surface
+        case OP_vkCreateMetalSurfaceEXT: {
+            return "OP_vkCreateMetalSurfaceEXT";
+        }
+#endif
+#ifdef VK_KHR_acceleration_structure
+        case OP_vkCopyAccelerationStructureToMemoryKHR: {
+            return "OP_vkCopyAccelerationStructureToMemoryKHR";
+        }
+#endif
+#ifdef VK_KHR_video_queue
+        case OP_vkGetVideoSessionMemoryRequirementsKHR: {
+            return "OP_vkGetVideoSessionMemoryRequirementsKHR";
+        }
+#endif
+#ifdef VK_NV_external_memory_rdma
+        case OP_vkGetMemoryRemoteAddressNV: {
+            return "OP_vkGetMemoryRemoteAddressNV";
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+        case OP_vkCmdSetViewportWithCountEXT: {
+            return "OP_vkCmdSetViewportWithCountEXT";
+        }
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+        case OP_vkReleaseFullScreenExclusiveModeEXT: {
+            return "OP_vkReleaseFullScreenExclusiveModeEXT";
+        }
+#endif
+#ifdef VK_KHR_acceleration_structure
+        case OP_vkCmdBuildAccelerationStructuresIndirectKHR: {
+            return "OP_vkCmdBuildAccelerationStructuresIndirectKHR";
+        }
+#endif
+#ifdef VK_QNX_screen_surface
+        case OP_vkGetPhysicalDeviceScreenPresentationSupportQNX: {
+            return "OP_vkGetPhysicalDeviceScreenPresentationSupportQNX";
+        }
+#endif
+#ifdef VK_KHR_acceleration_structure
+        case OP_vkCreateAccelerationStructureKHR: {
+            return "OP_vkCreateAccelerationStructureKHR";
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+        case OP_vkCmdSetDepthBiasEnableEXT: {
+            return "OP_vkCmdSetDepthBiasEnableEXT";
+        }
+#endif
+#ifdef VK_NV_ray_tracing
+        case OP_vkCreateAccelerationStructureNV: {
+            return "OP_vkCreateAccelerationStructureNV";
+        }
+#endif
+#ifdef VK_KHR_copy_commands2
+        case OP_vkCmdBlitImage2KHR: {
+            return "OP_vkCmdBlitImage2KHR";
+        }
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+        case OP_vkCmdSetRayTracingPipelineStackSizeKHR: {
+            return "OP_vkCmdSetRayTracingPipelineStackSizeKHR";
+        }
+#endif
+#ifdef VK_VERSION_1_2
+        case OP_vkGetDeviceMemoryOpaqueCaptureAddress: {
+            return "OP_vkGetDeviceMemoryOpaqueCaptureAddress";
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+        case OP_vkCmdSetPrimitiveTopologyEXT: {
+            return "OP_vkCmdSetPrimitiveTopologyEXT";
+        }
+#endif
+#ifdef VK_KHR_video_queue
+        case OP_vkUpdateVideoSessionParametersKHR: {
+            return "OP_vkUpdateVideoSessionParametersKHR";
+        }
+#endif
+#ifdef VK_INTEL_performance_query
+        case OP_vkCmdSetPerformanceStreamMarkerINTEL: {
+            return "OP_vkCmdSetPerformanceStreamMarkerINTEL";
+        }
+#endif
+#ifdef VK_KHR_acceleration_structure
+        case OP_vkCopyMemoryToAccelerationStructureKHR: {
+            return "OP_vkCopyMemoryToAccelerationStructureKHR";
+        }
+#endif
+#ifdef VK_FUCHSIA_imagepipe_surface
+        case OP_vkCreateImagePipeSurfaceFUCHSIA: {
+            return "OP_vkCreateImagePipeSurfaceFUCHSIA";
+        }
+#endif
+#ifdef VK_KHR_video_queue
+        case OP_vkGetPhysicalDeviceVideoFormatPropertiesKHR: {
+            return "OP_vkGetPhysicalDeviceVideoFormatPropertiesKHR";
+        }
+#endif
+#ifdef VK_KHR_present_wait
+        case OP_vkWaitForPresentKHR: {
+            return "OP_vkWaitForPresentKHR";
+        }
+#endif
+#ifdef VK_EXT_multi_draw
+        case OP_vkCmdDrawMultiEXT: {
+            return "OP_vkCmdDrawMultiEXT";
+        }
+#endif
+#ifdef VK_KHR_deferred_host_operations
+        case OP_vkGetDeferredOperationResultKHR: {
+            return "OP_vkGetDeferredOperationResultKHR";
+        }
+#endif
+#ifdef VK_EXT_line_rasterization
+        case OP_vkCmdSetLineStippleEXT: {
+            return "OP_vkCmdSetLineStippleEXT";
+        }
+#endif
+#ifdef VK_KHR_timeline_semaphore
+        case OP_vkWaitSemaphoresKHR: {
+            return "OP_vkWaitSemaphoresKHR";
+        }
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+        case OP_vkCmdSetFragmentShadingRateEnumNV: {
+            return "OP_vkCmdSetFragmentShadingRateEnumNV";
+        }
+#endif
+#ifdef VK_KHR_video_queue
+        case OP_vkCreateVideoSessionParametersKHR: {
+            return "OP_vkCreateVideoSessionParametersKHR";
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+        case OP_vkCmdSetCullModeEXT: {
+            return "OP_vkCmdSetCullModeEXT";
+        }
+#endif
+#ifdef VK_KHR_acceleration_structure
+        case OP_vkGetDeviceAccelerationStructureCompatibilityKHR: {
+            return "OP_vkGetDeviceAccelerationStructureCompatibilityKHR";
+        }
+#endif
+#ifdef VK_VERSION_1_2
+        case OP_vkGetSemaphoreCounterValue: {
+            return "OP_vkGetSemaphoreCounterValue";
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+        case OP_vkCmdSetLogicOpEXT: {
+            return "OP_vkCmdSetLogicOpEXT";
+        }
+#endif
+#ifdef VK_AMD_display_native_hdr
+        case OP_vkSetLocalDimmingAMD: {
+            return "OP_vkSetLocalDimmingAMD";
+        }
+#endif
+#ifdef VK_EXT_transform_feedback
+        case OP_vkCmdBindTransformFeedbackBuffersEXT: {
+            return "OP_vkCmdBindTransformFeedbackBuffersEXT";
+        }
+#endif
+#ifdef VK_GOOGLE_gfxstream
+        case OP_vkQueueCommitDescriptorSetUpdatesGOOGLE: {
+            return "OP_vkQueueCommitDescriptorSetUpdatesGOOGLE";
+        }
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+        case OP_vkGetPhysicalDeviceSurfacePresentModes2EXT: {
+            return "OP_vkGetPhysicalDeviceSurfacePresentModes2EXT";
+        }
+#endif
+#ifdef VK_NV_ray_tracing
+        case OP_vkCmdBuildAccelerationStructureNV: {
+            return "OP_vkCmdBuildAccelerationStructureNV";
+        }
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+        case OP_vkGetPipelineExecutablePropertiesKHR: {
+            return "OP_vkGetPipelineExecutablePropertiesKHR";
+        }
+#endif
+#ifdef VK_NV_ray_tracing
+        case OP_vkGetAccelerationStructureHandleNV: {
+            return "OP_vkGetAccelerationStructureHandleNV";
+        }
+#endif
+#ifdef VK_KHR_timeline_semaphore
+        case OP_vkSignalSemaphoreKHR: {
+            return "OP_vkSignalSemaphoreKHR";
+        }
+#endif
+#ifdef VK_INTEL_performance_query
+        case OP_vkCmdSetPerformanceMarkerINTEL: {
+            return "OP_vkCmdSetPerformanceMarkerINTEL";
+        }
+#endif
+#ifdef VK_NV_device_generated_commands
+        case OP_vkCmdBindPipelineShaderGroupNV: {
+            return "OP_vkCmdBindPipelineShaderGroupNV";
+        }
+#endif
+#ifdef VK_KHR_synchronization2
+        case OP_vkCmdSetEvent2KHR: {
+            return "OP_vkCmdSetEvent2KHR";
+        }
+#endif
+#ifdef VK_VERSION_1_2
+        case OP_vkSignalSemaphore: {
+            return "OP_vkSignalSemaphore";
+        }
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+        case OP_vkGetPipelineExecutableStatisticsKHR: {
+            return "OP_vkGetPipelineExecutableStatisticsKHR";
+        }
+#endif
+#ifdef VK_KHR_acceleration_structure
+        case OP_vkCmdWriteAccelerationStructuresPropertiesKHR: {
+            return "OP_vkCmdWriteAccelerationStructuresPropertiesKHR";
+        }
+#endif
+#ifdef VK_NV_ray_tracing
+        case OP_vkGetRayTracingShaderGroupHandlesKHR: {
+            return "OP_vkGetRayTracingShaderGroupHandlesKHR";
+        }
+#endif
+#ifdef VK_EXT_transform_feedback
+        case OP_vkCmdEndTransformFeedbackEXT: {
+            return "OP_vkCmdEndTransformFeedbackEXT";
+        }
+#endif
+#ifdef VK_KHR_acceleration_structure
+        case OP_vkCmdBuildAccelerationStructuresKHR: {
+            return "OP_vkCmdBuildAccelerationStructuresKHR";
+        }
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+        case OP_vkGetPhysicalDeviceFragmentShadingRatesKHR: {
+            return "OP_vkGetPhysicalDeviceFragmentShadingRatesKHR";
+        }
+#endif
+#ifdef VK_NVX_binary_import
+        case OP_vkDestroyCuModuleNVX: {
+            return "OP_vkDestroyCuModuleNVX";
+        }
+#endif
+#ifdef VK_NV_mesh_shader
+        case OP_vkCmdDrawMeshTasksIndirectNV: {
+            return "OP_vkCmdDrawMeshTasksIndirectNV";
+        }
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+        case OP_vkGetPipelineExecutableInternalRepresentationsKHR: {
+            return "OP_vkGetPipelineExecutableInternalRepresentationsKHR";
+        }
+#endif
+#ifdef VK_NV_acquire_winrt_display
+        case OP_vkAcquireWinrtDisplayNV: {
+            return "OP_vkAcquireWinrtDisplayNV";
+        }
+#endif
+#ifdef VK_KHR_deferred_host_operations
+        case OP_vkCreateDeferredOperationKHR: {
+            return "OP_vkCreateDeferredOperationKHR";
+        }
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+        case OP_vkSetBufferCollectionImageConstraintsFUCHSIA: {
+            return "OP_vkSetBufferCollectionImageConstraintsFUCHSIA";
+        }
+#endif
+#ifdef VK_KHR_maintenance4
+        case OP_vkGetDeviceImageSparseMemoryRequirementsKHR: {
+            return "OP_vkGetDeviceImageSparseMemoryRequirementsKHR";
+        }
+#endif
+#ifdef VK_KHR_video_decode_queue
+        case OP_vkCmdDecodeVideoKHR: {
+            return "OP_vkCmdDecodeVideoKHR";
+        }
+#endif
+#ifdef VK_EXT_transform_feedback
+        case OP_vkCmdBeginQueryIndexedEXT: {
+            return "OP_vkCmdBeginQueryIndexedEXT";
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+        case OP_vkCmdSetStencilOpEXT: {
+            return "OP_vkCmdSetStencilOpEXT";
+        }
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+        case OP_vkCreateBufferCollectionFUCHSIA: {
+            return "OP_vkCreateBufferCollectionFUCHSIA";
+        }
+#endif
+#ifdef VK_NV_ray_tracing
+        case OP_vkCompileDeferredNV: {
+            return "OP_vkCompileDeferredNV";
+        }
+#endif
+#ifdef VK_KHR_acceleration_structure
+        case OP_vkCmdCopyAccelerationStructureKHR: {
+            return "OP_vkCmdCopyAccelerationStructureKHR";
+        }
+#endif
+#ifdef VK_VERSION_1_2
+        case OP_vkCreateRenderPass2: {
+            return "OP_vkCreateRenderPass2";
+        }
+#endif
+#ifdef VK_EXT_transform_feedback
+        case OP_vkCmdEndQueryIndexedEXT: {
+            return "OP_vkCmdEndQueryIndexedEXT";
+        }
+#endif
+#ifdef VK_KHR_video_queue
+        case OP_vkCmdEndVideoCodingKHR: {
+            return "OP_vkCmdEndVideoCodingKHR";
+        }
+#endif
+#ifdef VK_KHR_performance_query
+        case OP_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR: {
+            return "OP_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR";
+        }
+#endif
+#ifdef VK_EXT_tooling_info
+        case OP_vkGetPhysicalDeviceToolPropertiesEXT: {
+            return "OP_vkGetPhysicalDeviceToolPropertiesEXT";
+        }
+#endif
+#ifdef VK_GOOGLE_gfxstream
+        case OP_vkGetLinearImageLayout2GOOGLE: {
+            return "OP_vkGetLinearImageLayout2GOOGLE";
+        }
+#endif
+#ifdef VK_EXT_acquire_drm_display
+        case OP_vkGetDrmDisplayEXT: {
+            return "OP_vkGetDrmDisplayEXT";
+        }
+#endif
+#ifdef VK_VERSION_1_2
+        case OP_vkCmdDrawIndirectCount: {
+            return "OP_vkCmdDrawIndirectCount";
+        }
+#endif
+#ifdef VK_KHR_synchronization2
+        case OP_vkCmdResetEvent2KHR: {
+            return "OP_vkCmdResetEvent2KHR";
+        }
+#endif
+#ifdef VK_EXT_multi_draw
+        case OP_vkCmdDrawMultiIndexedEXT: {
+            return "OP_vkCmdDrawMultiIndexedEXT";
+        }
+#endif
+#ifdef VK_EXT_transform_feedback
+        case OP_vkCmdDrawIndirectByteCountEXT: {
+            return "OP_vkCmdDrawIndirectByteCountEXT";
+        }
+#endif
+#ifdef VK_NV_device_generated_commands
+        case OP_vkCreateIndirectCommandsLayoutNV: {
+            return "OP_vkCreateIndirectCommandsLayoutNV";
+        }
+#endif
+#ifdef VK_EXT_directfb_surface
+        case OP_vkGetPhysicalDeviceDirectFBPresentationSupportEXT: {
+            return "OP_vkGetPhysicalDeviceDirectFBPresentationSupportEXT";
+        }
+#endif
+#ifdef VK_KHR_buffer_device_address
+        case OP_vkGetBufferOpaqueCaptureAddressKHR: {
+            return "OP_vkGetBufferOpaqueCaptureAddressKHR";
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+        case OP_vkCmdSetStencilTestEnableEXT: {
+            return "OP_vkCmdSetStencilTestEnableEXT";
+        }
+#endif
+#ifdef VK_NV_cooperative_matrix
+        case OP_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV: {
+            return "OP_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV";
+        }
+#endif
+#ifdef VK_KHR_acceleration_structure
+        case OP_vkWriteAccelerationStructuresPropertiesKHR: {
+            return "OP_vkWriteAccelerationStructuresPropertiesKHR";
+        }
+#endif
+#ifdef VK_GOOGLE_gfxstream
+        case OP_vkQueueFlushCommandsFromAuxMemoryGOOGLE: {
+            return "OP_vkQueueFlushCommandsFromAuxMemoryGOOGLE";
+        }
+#endif
+#ifdef VK_EXT_private_data
+        case OP_vkGetPrivateDataEXT: {
+            return "OP_vkGetPrivateDataEXT";
+        }
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+        case OP_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV: {
+            return "OP_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV";
+        }
+#endif
+#ifdef VK_KHR_synchronization2
+        case OP_vkGetQueueCheckpointData2NV: {
+            return "OP_vkGetQueueCheckpointData2NV";
+        }
+#endif
+#ifdef VK_NV_device_generated_commands
+        case OP_vkDestroyIndirectCommandsLayoutNV: {
+            return "OP_vkDestroyIndirectCommandsLayoutNV";
+        }
+#endif
+#ifdef VK_KHR_synchronization2
+        case OP_vkQueueSubmit2KHR: {
+            return "OP_vkQueueSubmit2KHR";
+        }
+#endif
+#ifdef VK_NV_acquire_winrt_display
+        case OP_vkGetWinrtDisplayNV: {
+            return "OP_vkGetWinrtDisplayNV";
+        }
+#endif
+#ifdef VK_EXT_transform_feedback
+        case OP_vkCmdBeginTransformFeedbackEXT: {
+            return "OP_vkCmdBeginTransformFeedbackEXT";
+        }
+#endif
+#ifdef VK_KHR_buffer_device_address
+        case OP_vkGetDeviceMemoryOpaqueCaptureAddressKHR: {
+            return "OP_vkGetDeviceMemoryOpaqueCaptureAddressKHR";
+        }
+#endif
+#ifdef VK_INTEL_performance_query
+        case OP_vkQueueSetPerformanceConfigurationINTEL: {
+            return "OP_vkQueueSetPerformanceConfigurationINTEL";
+        }
+#endif
+#ifdef VK_EXT_calibrated_timestamps
+        case OP_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT: {
+            return "OP_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT";
+        }
+#endif
+#ifdef VK_KHR_video_encode_queue
+        case OP_vkCmdEncodeVideoKHR: {
+            return "OP_vkCmdEncodeVideoKHR";
+        }
+#endif
+#ifdef VK_INTEL_performance_query
+        case OP_vkUninitializePerformanceApiINTEL: {
+            return "OP_vkUninitializePerformanceApiINTEL";
+        }
+#endif
+#ifdef VK_NV_device_generated_commands
+        case OP_vkCmdPreprocessGeneratedCommandsNV: {
+            return "OP_vkCmdPreprocessGeneratedCommandsNV";
+        }
+#endif
+#ifdef VK_KHR_dynamic_rendering
+        case OP_vkCmdBeginRenderingKHR: {
+            return "OP_vkCmdBeginRenderingKHR";
+        }
+#endif
+#ifdef VK_EXT_headless_surface
+        case OP_vkCreateHeadlessSurfaceEXT: {
+            return "OP_vkCreateHeadlessSurfaceEXT";
+        }
+#endif
+#ifdef VK_KHR_performance_query
+        case OP_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR: {
+            return "OP_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR";
+        }
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+        case OP_vkCmdBindInvocationMaskHUAWEI: {
+            return "OP_vkCmdBindInvocationMaskHUAWEI";
+        }
+#endif
+#ifdef VK_FUCHSIA_external_semaphore
+        case OP_vkImportSemaphoreZirconHandleFUCHSIA: {
+            return "OP_vkImportSemaphoreZirconHandleFUCHSIA";
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+        case OP_vkCmdSetPrimitiveRestartEnableEXT: {
+            return "OP_vkCmdSetPrimitiveRestartEnableEXT";
+        }
+#endif
+        default: {
+            return "OP_UNKNOWN_API_CALL";
+        }
+    }
+}
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/goldfish_vk_marshaling_guest.h b/system/vulkan_enc/goldfish_vk_marshaling_guest.h
new file mode 100644
index 0000000..3f59d9a
--- /dev/null
+++ b/system/vulkan_enc/goldfish_vk_marshaling_guest.h
@@ -0,0 +1,7034 @@
+// Copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2018 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Autogenerated module goldfish_vk_marshaling_guest
+//
+// (header) generated by codegen/vulkan/scripts/genvk.py -registry codegen/vulkan/xml/vk.xml cereal
+// -o host/vulkan/cereal
+//
+// Please do not modify directly;
+// re-run gfxstream-protocols/scripts/generate-vulkan-sources.sh,
+// or directly from Python by defining:
+// VULKAN_REGISTRY_XML_DIR : Directory containing vk.xml
+// VULKAN_REGISTRY_SCRIPTS_DIR : Directory containing genvk.py
+// CEREAL_OUTPUT_DIR: Where to put the generated sources.
+//
+// python3 $VULKAN_REGISTRY_SCRIPTS_DIR/genvk.py -registry $VULKAN_REGISTRY_XML_DIR/vk.xml cereal -o
+// $CEREAL_OUTPUT_DIR
+//
+#pragma once
+#include <vulkan/vulkan.h>
+
+#include "VulkanStreamGuest.h"
+#include "goldfish_vk_marshaling_guest.h"
+#include "goldfish_vk_private_defs.h"
+#include "vk_platform_compat.h"
+#include "vulkan_gfxstream.h"
+
+// Stuff we are not going to use but if included,
+// will cause compile errors. These are Android Vulkan
+// required extensions, but the approach will be to
+// implement them completely on the guest side.
+#undef VK_KHR_android_surface
+#undef VK_ANDROID_external_memory_android_hardware_buffer
+
+namespace gfxstream {
+namespace vk {
+
+#ifdef VK_VERSION_1_0
+void marshal_VkExtent2D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                        const VkExtent2D* forMarshaling);
+
+void unmarshal_VkExtent2D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                          VkExtent2D* forUnmarshaling);
+
+void marshal_VkExtent3D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                        const VkExtent3D* forMarshaling);
+
+void unmarshal_VkExtent3D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                          VkExtent3D* forUnmarshaling);
+
+void marshal_VkOffset2D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                        const VkOffset2D* forMarshaling);
+
+void unmarshal_VkOffset2D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                          VkOffset2D* forUnmarshaling);
+
+void marshal_VkOffset3D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                        const VkOffset3D* forMarshaling);
+
+void unmarshal_VkOffset3D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                          VkOffset3D* forUnmarshaling);
+
+void marshal_VkRect2D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                      const VkRect2D* forMarshaling);
+
+void unmarshal_VkRect2D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                        VkRect2D* forUnmarshaling);
+
+void marshal_VkBaseInStructure(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               const VkBaseInStructure* forMarshaling);
+
+void unmarshal_VkBaseInStructure(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 VkBaseInStructure* forUnmarshaling);
+
+void marshal_VkBaseOutStructure(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkBaseOutStructure* forMarshaling);
+
+void unmarshal_VkBaseOutStructure(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkBaseOutStructure* forUnmarshaling);
+
+void marshal_VkBufferMemoryBarrier(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkBufferMemoryBarrier* forMarshaling);
+
+void unmarshal_VkBufferMemoryBarrier(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkBufferMemoryBarrier* forUnmarshaling);
+
+void marshal_VkDispatchIndirectCommand(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkDispatchIndirectCommand* forMarshaling);
+
+void unmarshal_VkDispatchIndirectCommand(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkDispatchIndirectCommand* forUnmarshaling);
+
+void marshal_VkDrawIndexedIndirectCommand(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkDrawIndexedIndirectCommand* forMarshaling);
+
+void unmarshal_VkDrawIndexedIndirectCommand(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkDrawIndexedIndirectCommand* forUnmarshaling);
+
+void marshal_VkDrawIndirectCommand(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkDrawIndirectCommand* forMarshaling);
+
+void unmarshal_VkDrawIndirectCommand(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkDrawIndirectCommand* forUnmarshaling);
+
+void marshal_VkImageSubresourceRange(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkImageSubresourceRange* forMarshaling);
+
+void unmarshal_VkImageSubresourceRange(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkImageSubresourceRange* forUnmarshaling);
+
+void marshal_VkImageMemoryBarrier(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkImageMemoryBarrier* forMarshaling);
+
+void unmarshal_VkImageMemoryBarrier(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkImageMemoryBarrier* forUnmarshaling);
+
+void marshal_VkMemoryBarrier(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                             const VkMemoryBarrier* forMarshaling);
+
+void unmarshal_VkMemoryBarrier(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               VkMemoryBarrier* forUnmarshaling);
+
+void marshal_VkPipelineCacheHeaderVersionOne(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkPipelineCacheHeaderVersionOne* forMarshaling);
+
+void unmarshal_VkPipelineCacheHeaderVersionOne(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkPipelineCacheHeaderVersionOne* forUnmarshaling);
+
+void marshal_VkAllocationCallbacks(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkAllocationCallbacks* forMarshaling);
+
+void unmarshal_VkAllocationCallbacks(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkAllocationCallbacks* forUnmarshaling);
+
+void marshal_VkApplicationInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               const VkApplicationInfo* forMarshaling);
+
+void unmarshal_VkApplicationInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 VkApplicationInfo* forUnmarshaling);
+
+void marshal_VkFormatProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkFormatProperties* forMarshaling);
+
+void unmarshal_VkFormatProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkFormatProperties* forUnmarshaling);
+
+void marshal_VkImageFormatProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkImageFormatProperties* forMarshaling);
+
+void unmarshal_VkImageFormatProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkImageFormatProperties* forUnmarshaling);
+
+void marshal_VkInstanceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkInstanceCreateInfo* forMarshaling);
+
+void unmarshal_VkInstanceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkInstanceCreateInfo* forUnmarshaling);
+
+void marshal_VkMemoryHeap(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                          const VkMemoryHeap* forMarshaling);
+
+void unmarshal_VkMemoryHeap(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                            VkMemoryHeap* forUnmarshaling);
+
+void marshal_VkMemoryType(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                          const VkMemoryType* forMarshaling);
+
+void unmarshal_VkMemoryType(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                            VkMemoryType* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceFeatures(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkPhysicalDeviceFeatures* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceFeatures(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkPhysicalDeviceFeatures* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceLimits(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkPhysicalDeviceLimits* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceLimits(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      VkPhysicalDeviceLimits* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceMemoryProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMemoryProperties* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceMemoryProperties(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkPhysicalDeviceMemoryProperties* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceSparseProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSparseProperties* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceSparseProperties(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkPhysicalDeviceSparseProperties* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkPhysicalDeviceProperties* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkPhysicalDeviceProperties* forUnmarshaling);
+
+void marshal_VkQueueFamilyProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkQueueFamilyProperties* forMarshaling);
+
+void unmarshal_VkQueueFamilyProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkQueueFamilyProperties* forUnmarshaling);
+
+#define OP_vkCreateInstance 20000
+#define OP_vkDestroyInstance 20001
+#define OP_vkEnumeratePhysicalDevices 20002
+#define OP_vkGetPhysicalDeviceFeatures 20003
+#define OP_vkGetPhysicalDeviceFormatProperties 20004
+#define OP_vkGetPhysicalDeviceImageFormatProperties 20005
+#define OP_vkGetPhysicalDeviceProperties 20006
+#define OP_vkGetPhysicalDeviceQueueFamilyProperties 20007
+#define OP_vkGetPhysicalDeviceMemoryProperties 20008
+#define OP_vkGetInstanceProcAddr 20009
+#define OP_vkGetDeviceProcAddr 20010
+void marshal_VkDeviceQueueCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkDeviceQueueCreateInfo* forMarshaling);
+
+void unmarshal_VkDeviceQueueCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkDeviceQueueCreateInfo* forUnmarshaling);
+
+void marshal_VkDeviceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkDeviceCreateInfo* forMarshaling);
+
+void unmarshal_VkDeviceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkDeviceCreateInfo* forUnmarshaling);
+
+#define OP_vkCreateDevice 20011
+#define OP_vkDestroyDevice 20012
+void marshal_VkExtensionProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkExtensionProperties* forMarshaling);
+
+void unmarshal_VkExtensionProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkExtensionProperties* forUnmarshaling);
+
+#define OP_vkEnumerateInstanceExtensionProperties 20013
+#define OP_vkEnumerateDeviceExtensionProperties 20014
+void marshal_VkLayerProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               const VkLayerProperties* forMarshaling);
+
+void unmarshal_VkLayerProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 VkLayerProperties* forUnmarshaling);
+
+#define OP_vkEnumerateInstanceLayerProperties 20015
+#define OP_vkEnumerateDeviceLayerProperties 20016
+void marshal_VkSubmitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                          const VkSubmitInfo* forMarshaling);
+
+void unmarshal_VkSubmitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                            VkSubmitInfo* forUnmarshaling);
+
+#define OP_vkGetDeviceQueue 20017
+#define OP_vkQueueSubmit 20018
+#define OP_vkQueueWaitIdle 20019
+#define OP_vkDeviceWaitIdle 20020
+void marshal_VkMappedMemoryRange(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkMappedMemoryRange* forMarshaling);
+
+void unmarshal_VkMappedMemoryRange(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkMappedMemoryRange* forUnmarshaling);
+
+void marshal_VkMemoryAllocateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkMemoryAllocateInfo* forMarshaling);
+
+void unmarshal_VkMemoryAllocateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkMemoryAllocateInfo* forUnmarshaling);
+
+#define OP_vkAllocateMemory 20021
+#define OP_vkFreeMemory 20022
+#define OP_vkMapMemory 20023
+#define OP_vkUnmapMemory 20024
+#define OP_vkFlushMappedMemoryRanges 20025
+#define OP_vkInvalidateMappedMemoryRanges 20026
+#define OP_vkGetDeviceMemoryCommitment 20027
+void marshal_VkMemoryRequirements(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkMemoryRequirements* forMarshaling);
+
+void unmarshal_VkMemoryRequirements(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkMemoryRequirements* forUnmarshaling);
+
+#define OP_vkBindBufferMemory 20028
+#define OP_vkBindImageMemory 20029
+#define OP_vkGetBufferMemoryRequirements 20030
+#define OP_vkGetImageMemoryRequirements 20031
+void marshal_VkSparseMemoryBind(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkSparseMemoryBind* forMarshaling);
+
+void unmarshal_VkSparseMemoryBind(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkSparseMemoryBind* forUnmarshaling);
+
+void marshal_VkSparseBufferMemoryBindInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkSparseBufferMemoryBindInfo* forMarshaling);
+
+void unmarshal_VkSparseBufferMemoryBindInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkSparseBufferMemoryBindInfo* forUnmarshaling);
+
+void marshal_VkSparseImageOpaqueMemoryBindInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSparseImageOpaqueMemoryBindInfo* forMarshaling);
+
+void unmarshal_VkSparseImageOpaqueMemoryBindInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkSparseImageOpaqueMemoryBindInfo* forUnmarshaling);
+
+void marshal_VkImageSubresource(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkImageSubresource* forMarshaling);
+
+void unmarshal_VkImageSubresource(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkImageSubresource* forUnmarshaling);
+
+void marshal_VkSparseImageMemoryBind(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkSparseImageMemoryBind* forMarshaling);
+
+void unmarshal_VkSparseImageMemoryBind(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkSparseImageMemoryBind* forUnmarshaling);
+
+void marshal_VkSparseImageMemoryBindInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkSparseImageMemoryBindInfo* forMarshaling);
+
+void unmarshal_VkSparseImageMemoryBindInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkSparseImageMemoryBindInfo* forUnmarshaling);
+
+void marshal_VkBindSparseInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                              const VkBindSparseInfo* forMarshaling);
+
+void unmarshal_VkBindSparseInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                VkBindSparseInfo* forUnmarshaling);
+
+void marshal_VkSparseImageFormatProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkSparseImageFormatProperties* forMarshaling);
+
+void unmarshal_VkSparseImageFormatProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkSparseImageFormatProperties* forUnmarshaling);
+
+void marshal_VkSparseImageMemoryRequirements(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkSparseImageMemoryRequirements* forMarshaling);
+
+void unmarshal_VkSparseImageMemoryRequirements(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkSparseImageMemoryRequirements* forUnmarshaling);
+
+#define OP_vkGetImageSparseMemoryRequirements 20032
+#define OP_vkGetPhysicalDeviceSparseImageFormatProperties 20033
+#define OP_vkQueueBindSparse 20034
+void marshal_VkFenceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               const VkFenceCreateInfo* forMarshaling);
+
+void unmarshal_VkFenceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 VkFenceCreateInfo* forUnmarshaling);
+
+#define OP_vkCreateFence 20035
+#define OP_vkDestroyFence 20036
+#define OP_vkResetFences 20037
+#define OP_vkGetFenceStatus 20038
+#define OP_vkWaitForFences 20039
+void marshal_VkSemaphoreCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkSemaphoreCreateInfo* forMarshaling);
+
+void unmarshal_VkSemaphoreCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkSemaphoreCreateInfo* forUnmarshaling);
+
+#define OP_vkCreateSemaphore 20040
+#define OP_vkDestroySemaphore 20041
+void marshal_VkEventCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               const VkEventCreateInfo* forMarshaling);
+
+void unmarshal_VkEventCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 VkEventCreateInfo* forUnmarshaling);
+
+#define OP_vkCreateEvent 20042
+#define OP_vkDestroyEvent 20043
+#define OP_vkGetEventStatus 20044
+#define OP_vkSetEvent 20045
+#define OP_vkResetEvent 20046
+void marshal_VkQueryPoolCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkQueryPoolCreateInfo* forMarshaling);
+
+void unmarshal_VkQueryPoolCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkQueryPoolCreateInfo* forUnmarshaling);
+
+#define OP_vkCreateQueryPool 20047
+#define OP_vkDestroyQueryPool 20048
+#define OP_vkGetQueryPoolResults 20049
+void marshal_VkBufferCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkBufferCreateInfo* forMarshaling);
+
+void unmarshal_VkBufferCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkBufferCreateInfo* forUnmarshaling);
+
+#define OP_vkCreateBuffer 20050
+#define OP_vkDestroyBuffer 20051
+void marshal_VkBufferViewCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkBufferViewCreateInfo* forMarshaling);
+
+void unmarshal_VkBufferViewCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      VkBufferViewCreateInfo* forUnmarshaling);
+
+#define OP_vkCreateBufferView 20052
+#define OP_vkDestroyBufferView 20053
+void marshal_VkImageCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               const VkImageCreateInfo* forMarshaling);
+
+void unmarshal_VkImageCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 VkImageCreateInfo* forUnmarshaling);
+
+void marshal_VkSubresourceLayout(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkSubresourceLayout* forMarshaling);
+
+void unmarshal_VkSubresourceLayout(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkSubresourceLayout* forUnmarshaling);
+
+#define OP_vkCreateImage 20054
+#define OP_vkDestroyImage 20055
+#define OP_vkGetImageSubresourceLayout 20056
+void marshal_VkComponentMapping(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkComponentMapping* forMarshaling);
+
+void unmarshal_VkComponentMapping(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkComponentMapping* forUnmarshaling);
+
+void marshal_VkImageViewCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkImageViewCreateInfo* forMarshaling);
+
+void unmarshal_VkImageViewCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkImageViewCreateInfo* forUnmarshaling);
+
+#define OP_vkCreateImageView 20057
+#define OP_vkDestroyImageView 20058
+void marshal_VkShaderModuleCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkShaderModuleCreateInfo* forMarshaling);
+
+void unmarshal_VkShaderModuleCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkShaderModuleCreateInfo* forUnmarshaling);
+
+#define OP_vkCreateShaderModule 20059
+#define OP_vkDestroyShaderModule 20060
+void marshal_VkPipelineCacheCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkPipelineCacheCreateInfo* forMarshaling);
+
+void unmarshal_VkPipelineCacheCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkPipelineCacheCreateInfo* forUnmarshaling);
+
+#define OP_vkCreatePipelineCache 20061
+#define OP_vkDestroyPipelineCache 20062
+#define OP_vkGetPipelineCacheData 20063
+#define OP_vkMergePipelineCaches 20064
+void marshal_VkSpecializationMapEntry(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkSpecializationMapEntry* forMarshaling);
+
+void unmarshal_VkSpecializationMapEntry(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkSpecializationMapEntry* forUnmarshaling);
+
+void marshal_VkSpecializationInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkSpecializationInfo* forMarshaling);
+
+void unmarshal_VkSpecializationInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkSpecializationInfo* forUnmarshaling);
+
+void marshal_VkPipelineShaderStageCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkPipelineShaderStageCreateInfo* forMarshaling);
+
+void unmarshal_VkPipelineShaderStageCreateInfo(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkPipelineShaderStageCreateInfo* forUnmarshaling);
+
+void marshal_VkComputePipelineCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkComputePipelineCreateInfo* forMarshaling);
+
+void unmarshal_VkComputePipelineCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkComputePipelineCreateInfo* forUnmarshaling);
+
+void marshal_VkVertexInputBindingDescription(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkVertexInputBindingDescription* forMarshaling);
+
+void unmarshal_VkVertexInputBindingDescription(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkVertexInputBindingDescription* forUnmarshaling);
+
+void marshal_VkVertexInputAttributeDescription(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVertexInputAttributeDescription* forMarshaling);
+
+void unmarshal_VkVertexInputAttributeDescription(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVertexInputAttributeDescription* forUnmarshaling);
+
+void marshal_VkPipelineVertexInputStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineVertexInputStateCreateInfo* forMarshaling);
+
+void unmarshal_VkPipelineVertexInputStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineVertexInputStateCreateInfo* forUnmarshaling);
+
+void marshal_VkPipelineInputAssemblyStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineInputAssemblyStateCreateInfo* forMarshaling);
+
+void unmarshal_VkPipelineInputAssemblyStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineInputAssemblyStateCreateInfo* forUnmarshaling);
+
+void marshal_VkPipelineTessellationStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineTessellationStateCreateInfo* forMarshaling);
+
+void unmarshal_VkPipelineTessellationStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineTessellationStateCreateInfo* forUnmarshaling);
+
+void marshal_VkViewport(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                        const VkViewport* forMarshaling);
+
+void unmarshal_VkViewport(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                          VkViewport* forUnmarshaling);
+
+void marshal_VkPipelineViewportStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineViewportStateCreateInfo* forMarshaling);
+
+void unmarshal_VkPipelineViewportStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineViewportStateCreateInfo* forUnmarshaling);
+
+void marshal_VkPipelineRasterizationStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRasterizationStateCreateInfo* forMarshaling);
+
+void unmarshal_VkPipelineRasterizationStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineRasterizationStateCreateInfo* forUnmarshaling);
+
+void marshal_VkPipelineMultisampleStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineMultisampleStateCreateInfo* forMarshaling);
+
+void unmarshal_VkPipelineMultisampleStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineMultisampleStateCreateInfo* forUnmarshaling);
+
+void marshal_VkStencilOpState(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                              const VkStencilOpState* forMarshaling);
+
+void unmarshal_VkStencilOpState(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                VkStencilOpState* forUnmarshaling);
+
+void marshal_VkPipelineDepthStencilStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineDepthStencilStateCreateInfo* forMarshaling);
+
+void unmarshal_VkPipelineDepthStencilStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineDepthStencilStateCreateInfo* forUnmarshaling);
+
+void marshal_VkPipelineColorBlendAttachmentState(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineColorBlendAttachmentState* forMarshaling);
+
+void unmarshal_VkPipelineColorBlendAttachmentState(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineColorBlendAttachmentState* forUnmarshaling);
+
+void marshal_VkPipelineColorBlendStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineColorBlendStateCreateInfo* forMarshaling);
+
+void unmarshal_VkPipelineColorBlendStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineColorBlendStateCreateInfo* forUnmarshaling);
+
+void marshal_VkPipelineDynamicStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineDynamicStateCreateInfo* forMarshaling);
+
+void unmarshal_VkPipelineDynamicStateCreateInfo(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkPipelineDynamicStateCreateInfo* forUnmarshaling);
+
+void marshal_VkGraphicsPipelineCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkGraphicsPipelineCreateInfo* forMarshaling);
+
+void unmarshal_VkGraphicsPipelineCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkGraphicsPipelineCreateInfo* forUnmarshaling);
+
+#define OP_vkCreateGraphicsPipelines 20065
+#define OP_vkCreateComputePipelines 20066
+#define OP_vkDestroyPipeline 20067
+void marshal_VkPushConstantRange(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkPushConstantRange* forMarshaling);
+
+void unmarshal_VkPushConstantRange(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkPushConstantRange* forUnmarshaling);
+
+void marshal_VkPipelineLayoutCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkPipelineLayoutCreateInfo* forMarshaling);
+
+void unmarshal_VkPipelineLayoutCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkPipelineLayoutCreateInfo* forUnmarshaling);
+
+#define OP_vkCreatePipelineLayout 20068
+#define OP_vkDestroyPipelineLayout 20069
+void marshal_VkSamplerCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkSamplerCreateInfo* forMarshaling);
+
+void unmarshal_VkSamplerCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkSamplerCreateInfo* forUnmarshaling);
+
+#define OP_vkCreateSampler 20070
+#define OP_vkDestroySampler 20071
+void marshal_VkCopyDescriptorSet(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkCopyDescriptorSet* forMarshaling);
+
+void unmarshal_VkCopyDescriptorSet(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkCopyDescriptorSet* forUnmarshaling);
+
+void marshal_VkDescriptorBufferInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkDescriptorBufferInfo* forMarshaling);
+
+void unmarshal_VkDescriptorBufferInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      VkDescriptorBufferInfo* forUnmarshaling);
+
+void marshal_VkDescriptorImageInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkDescriptorImageInfo* forMarshaling);
+
+void unmarshal_VkDescriptorImageInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkDescriptorImageInfo* forUnmarshaling);
+
+void marshal_VkDescriptorPoolSize(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkDescriptorPoolSize* forMarshaling);
+
+void unmarshal_VkDescriptorPoolSize(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkDescriptorPoolSize* forUnmarshaling);
+
+void marshal_VkDescriptorPoolCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkDescriptorPoolCreateInfo* forMarshaling);
+
+void unmarshal_VkDescriptorPoolCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkDescriptorPoolCreateInfo* forUnmarshaling);
+
+void marshal_VkDescriptorSetAllocateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkDescriptorSetAllocateInfo* forMarshaling);
+
+void unmarshal_VkDescriptorSetAllocateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkDescriptorSetAllocateInfo* forUnmarshaling);
+
+void marshal_VkDescriptorSetLayoutBinding(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkDescriptorSetLayoutBinding* forMarshaling);
+
+void unmarshal_VkDescriptorSetLayoutBinding(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkDescriptorSetLayoutBinding* forUnmarshaling);
+
+void marshal_VkDescriptorSetLayoutCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkDescriptorSetLayoutCreateInfo* forMarshaling);
+
+void unmarshal_VkDescriptorSetLayoutCreateInfo(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkDescriptorSetLayoutCreateInfo* forUnmarshaling);
+
+void marshal_VkWriteDescriptorSet(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkWriteDescriptorSet* forMarshaling);
+
+void unmarshal_VkWriteDescriptorSet(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkWriteDescriptorSet* forUnmarshaling);
+
+#define OP_vkCreateDescriptorSetLayout 20072
+#define OP_vkDestroyDescriptorSetLayout 20073
+#define OP_vkCreateDescriptorPool 20074
+#define OP_vkDestroyDescriptorPool 20075
+#define OP_vkResetDescriptorPool 20076
+#define OP_vkAllocateDescriptorSets 20077
+#define OP_vkFreeDescriptorSets 20078
+#define OP_vkUpdateDescriptorSets 20079
+void marshal_VkAttachmentDescription(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkAttachmentDescription* forMarshaling);
+
+void unmarshal_VkAttachmentDescription(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkAttachmentDescription* forUnmarshaling);
+
+void marshal_VkAttachmentReference(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkAttachmentReference* forMarshaling);
+
+void unmarshal_VkAttachmentReference(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkAttachmentReference* forUnmarshaling);
+
+void marshal_VkFramebufferCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkFramebufferCreateInfo* forMarshaling);
+
+void unmarshal_VkFramebufferCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkFramebufferCreateInfo* forUnmarshaling);
+
+void marshal_VkSubpassDescription(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkSubpassDescription* forMarshaling);
+
+void unmarshal_VkSubpassDescription(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkSubpassDescription* forUnmarshaling);
+
+void marshal_VkSubpassDependency(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkSubpassDependency* forMarshaling);
+
+void unmarshal_VkSubpassDependency(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkSubpassDependency* forUnmarshaling);
+
+void marshal_VkRenderPassCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkRenderPassCreateInfo* forMarshaling);
+
+void unmarshal_VkRenderPassCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      VkRenderPassCreateInfo* forUnmarshaling);
+
+#define OP_vkCreateFramebuffer 20080
+#define OP_vkDestroyFramebuffer 20081
+#define OP_vkCreateRenderPass 20082
+#define OP_vkDestroyRenderPass 20083
+#define OP_vkGetRenderAreaGranularity 20084
+void marshal_VkCommandPoolCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkCommandPoolCreateInfo* forMarshaling);
+
+void unmarshal_VkCommandPoolCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkCommandPoolCreateInfo* forUnmarshaling);
+
+#define OP_vkCreateCommandPool 20085
+#define OP_vkDestroyCommandPool 20086
+#define OP_vkResetCommandPool 20087
+void marshal_VkCommandBufferAllocateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkCommandBufferAllocateInfo* forMarshaling);
+
+void unmarshal_VkCommandBufferAllocateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkCommandBufferAllocateInfo* forUnmarshaling);
+
+void marshal_VkCommandBufferInheritanceInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkCommandBufferInheritanceInfo* forMarshaling);
+
+void unmarshal_VkCommandBufferInheritanceInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkCommandBufferInheritanceInfo* forUnmarshaling);
+
+void marshal_VkCommandBufferBeginInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkCommandBufferBeginInfo* forMarshaling);
+
+void unmarshal_VkCommandBufferBeginInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkCommandBufferBeginInfo* forUnmarshaling);
+
+#define OP_vkAllocateCommandBuffers 20088
+#define OP_vkFreeCommandBuffers 20089
+#define OP_vkBeginCommandBuffer 20090
+#define OP_vkEndCommandBuffer 20091
+#define OP_vkResetCommandBuffer 20092
+void marshal_VkBufferCopy(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                          const VkBufferCopy* forMarshaling);
+
+void unmarshal_VkBufferCopy(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                            VkBufferCopy* forUnmarshaling);
+
+void marshal_VkImageSubresourceLayers(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkImageSubresourceLayers* forMarshaling);
+
+void unmarshal_VkImageSubresourceLayers(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkImageSubresourceLayers* forUnmarshaling);
+
+void marshal_VkBufferImageCopy(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               const VkBufferImageCopy* forMarshaling);
+
+void unmarshal_VkBufferImageCopy(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 VkBufferImageCopy* forUnmarshaling);
+
+void marshal_VkClearColorValue(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               const VkClearColorValue* forMarshaling);
+
+void unmarshal_VkClearColorValue(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 VkClearColorValue* forUnmarshaling);
+
+void marshal_VkClearDepthStencilValue(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkClearDepthStencilValue* forMarshaling);
+
+void unmarshal_VkClearDepthStencilValue(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkClearDepthStencilValue* forUnmarshaling);
+
+void marshal_VkClearValue(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                          const VkClearValue* forMarshaling);
+
+void unmarshal_VkClearValue(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                            VkClearValue* forUnmarshaling);
+
+void marshal_VkClearAttachment(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               const VkClearAttachment* forMarshaling);
+
+void unmarshal_VkClearAttachment(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 VkClearAttachment* forUnmarshaling);
+
+void marshal_VkClearRect(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                         const VkClearRect* forMarshaling);
+
+void unmarshal_VkClearRect(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                           VkClearRect* forUnmarshaling);
+
+void marshal_VkImageBlit(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                         const VkImageBlit* forMarshaling);
+
+void unmarshal_VkImageBlit(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                           VkImageBlit* forUnmarshaling);
+
+void marshal_VkImageCopy(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                         const VkImageCopy* forMarshaling);
+
+void unmarshal_VkImageCopy(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                           VkImageCopy* forUnmarshaling);
+
+void marshal_VkImageResolve(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                            const VkImageResolve* forMarshaling);
+
+void unmarshal_VkImageResolve(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                              VkImageResolve* forUnmarshaling);
+
+void marshal_VkRenderPassBeginInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkRenderPassBeginInfo* forMarshaling);
+
+void unmarshal_VkRenderPassBeginInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkRenderPassBeginInfo* forUnmarshaling);
+
+#define OP_vkCmdBindPipeline 20093
+#define OP_vkCmdSetViewport 20094
+#define OP_vkCmdSetScissor 20095
+#define OP_vkCmdSetLineWidth 20096
+#define OP_vkCmdSetDepthBias 20097
+#define OP_vkCmdSetBlendConstants 20098
+#define OP_vkCmdSetDepthBounds 20099
+#define OP_vkCmdSetStencilCompareMask 20100
+#define OP_vkCmdSetStencilWriteMask 20101
+#define OP_vkCmdSetStencilReference 20102
+#define OP_vkCmdBindDescriptorSets 20103
+#define OP_vkCmdBindIndexBuffer 20104
+#define OP_vkCmdBindVertexBuffers 20105
+#define OP_vkCmdDraw 20106
+#define OP_vkCmdDrawIndexed 20107
+#define OP_vkCmdDrawIndirect 20108
+#define OP_vkCmdDrawIndexedIndirect 20109
+#define OP_vkCmdDispatch 20110
+#define OP_vkCmdDispatchIndirect 20111
+#define OP_vkCmdCopyBuffer 20112
+#define OP_vkCmdCopyImage 20113
+#define OP_vkCmdBlitImage 20114
+#define OP_vkCmdCopyBufferToImage 20115
+#define OP_vkCmdCopyImageToBuffer 20116
+#define OP_vkCmdUpdateBuffer 20117
+#define OP_vkCmdFillBuffer 20118
+#define OP_vkCmdClearColorImage 20119
+#define OP_vkCmdClearDepthStencilImage 20120
+#define OP_vkCmdClearAttachments 20121
+#define OP_vkCmdResolveImage 20122
+#define OP_vkCmdSetEvent 20123
+#define OP_vkCmdResetEvent 20124
+#define OP_vkCmdWaitEvents 20125
+#define OP_vkCmdPipelineBarrier 20126
+#define OP_vkCmdBeginQuery 20127
+#define OP_vkCmdEndQuery 20128
+#define OP_vkCmdResetQueryPool 20129
+#define OP_vkCmdWriteTimestamp 20130
+#define OP_vkCmdCopyQueryPoolResults 20131
+#define OP_vkCmdPushConstants 20132
+#define OP_vkCmdBeginRenderPass 20133
+#define OP_vkCmdNextSubpass 20134
+#define OP_vkCmdEndRenderPass 20135
+#define OP_vkCmdExecuteCommands 20136
+#endif
+#ifdef VK_VERSION_1_1
+#define OP_vkEnumerateInstanceVersion 20137
+void marshal_VkPhysicalDeviceSubgroupProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSubgroupProperties* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceSubgroupProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceSubgroupProperties* forUnmarshaling);
+
+void marshal_VkBindBufferMemoryInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkBindBufferMemoryInfo* forMarshaling);
+
+void unmarshal_VkBindBufferMemoryInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      VkBindBufferMemoryInfo* forUnmarshaling);
+
+void marshal_VkBindImageMemoryInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkBindImageMemoryInfo* forMarshaling);
+
+void unmarshal_VkBindImageMemoryInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkBindImageMemoryInfo* forUnmarshaling);
+
+#define OP_vkBindBufferMemory2 20138
+#define OP_vkBindImageMemory2 20139
+void marshal_VkPhysicalDevice16BitStorageFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevice16BitStorageFeatures* forMarshaling);
+
+void unmarshal_VkPhysicalDevice16BitStorageFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevice16BitStorageFeatures* forUnmarshaling);
+
+void marshal_VkMemoryDedicatedRequirements(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkMemoryDedicatedRequirements* forMarshaling);
+
+void unmarshal_VkMemoryDedicatedRequirements(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkMemoryDedicatedRequirements* forUnmarshaling);
+
+void marshal_VkMemoryDedicatedAllocateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkMemoryDedicatedAllocateInfo* forMarshaling);
+
+void unmarshal_VkMemoryDedicatedAllocateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkMemoryDedicatedAllocateInfo* forUnmarshaling);
+
+void marshal_VkMemoryAllocateFlagsInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkMemoryAllocateFlagsInfo* forMarshaling);
+
+void unmarshal_VkMemoryAllocateFlagsInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkMemoryAllocateFlagsInfo* forUnmarshaling);
+
+void marshal_VkDeviceGroupRenderPassBeginInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceGroupRenderPassBeginInfo* forMarshaling);
+
+void unmarshal_VkDeviceGroupRenderPassBeginInfo(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkDeviceGroupRenderPassBeginInfo* forUnmarshaling);
+
+void marshal_VkDeviceGroupCommandBufferBeginInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceGroupCommandBufferBeginInfo* forMarshaling);
+
+void unmarshal_VkDeviceGroupCommandBufferBeginInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDeviceGroupCommandBufferBeginInfo* forUnmarshaling);
+
+void marshal_VkDeviceGroupSubmitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkDeviceGroupSubmitInfo* forMarshaling);
+
+void unmarshal_VkDeviceGroupSubmitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkDeviceGroupSubmitInfo* forUnmarshaling);
+
+void marshal_VkDeviceGroupBindSparseInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkDeviceGroupBindSparseInfo* forMarshaling);
+
+void unmarshal_VkDeviceGroupBindSparseInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkDeviceGroupBindSparseInfo* forUnmarshaling);
+
+#define OP_vkGetDeviceGroupPeerMemoryFeatures 20140
+#define OP_vkCmdSetDeviceMask 20141
+#define OP_vkCmdDispatchBase 20142
+void marshal_VkBindBufferMemoryDeviceGroupInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBindBufferMemoryDeviceGroupInfo* forMarshaling);
+
+void unmarshal_VkBindBufferMemoryDeviceGroupInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkBindBufferMemoryDeviceGroupInfo* forUnmarshaling);
+
+void marshal_VkBindImageMemoryDeviceGroupInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBindImageMemoryDeviceGroupInfo* forMarshaling);
+
+void unmarshal_VkBindImageMemoryDeviceGroupInfo(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkBindImageMemoryDeviceGroupInfo* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceGroupProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkPhysicalDeviceGroupProperties* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceGroupProperties(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkPhysicalDeviceGroupProperties* forUnmarshaling);
+
+void marshal_VkDeviceGroupDeviceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkDeviceGroupDeviceCreateInfo* forMarshaling);
+
+void unmarshal_VkDeviceGroupDeviceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkDeviceGroupDeviceCreateInfo* forUnmarshaling);
+
+#define OP_vkEnumeratePhysicalDeviceGroups 20143
+void marshal_VkBufferMemoryRequirementsInfo2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkBufferMemoryRequirementsInfo2* forMarshaling);
+
+void unmarshal_VkBufferMemoryRequirementsInfo2(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkBufferMemoryRequirementsInfo2* forUnmarshaling);
+
+void marshal_VkImageMemoryRequirementsInfo2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkImageMemoryRequirementsInfo2* forMarshaling);
+
+void unmarshal_VkImageMemoryRequirementsInfo2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkImageMemoryRequirementsInfo2* forUnmarshaling);
+
+void marshal_VkImageSparseMemoryRequirementsInfo2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageSparseMemoryRequirementsInfo2* forMarshaling);
+
+void unmarshal_VkImageSparseMemoryRequirementsInfo2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkImageSparseMemoryRequirementsInfo2* forUnmarshaling);
+
+void marshal_VkMemoryRequirements2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkMemoryRequirements2* forMarshaling);
+
+void unmarshal_VkMemoryRequirements2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkMemoryRequirements2* forUnmarshaling);
+
+void marshal_VkSparseImageMemoryRequirements2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSparseImageMemoryRequirements2* forMarshaling);
+
+void unmarshal_VkSparseImageMemoryRequirements2(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkSparseImageMemoryRequirements2* forUnmarshaling);
+
+#define OP_vkGetImageMemoryRequirements2 20144
+#define OP_vkGetBufferMemoryRequirements2 20145
+#define OP_vkGetImageSparseMemoryRequirements2 20146
+void marshal_VkPhysicalDeviceFeatures2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkPhysicalDeviceFeatures2* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceFeatures2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkPhysicalDeviceFeatures2* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceProperties2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkPhysicalDeviceProperties2* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceProperties2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkPhysicalDeviceProperties2* forUnmarshaling);
+
+void marshal_VkFormatProperties2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkFormatProperties2* forMarshaling);
+
+void unmarshal_VkFormatProperties2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkFormatProperties2* forUnmarshaling);
+
+void marshal_VkImageFormatProperties2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkImageFormatProperties2* forMarshaling);
+
+void unmarshal_VkImageFormatProperties2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkImageFormatProperties2* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceImageFormatInfo2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceImageFormatInfo2* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceImageFormatInfo2(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkPhysicalDeviceImageFormatInfo2* forUnmarshaling);
+
+void marshal_VkQueueFamilyProperties2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkQueueFamilyProperties2* forMarshaling);
+
+void unmarshal_VkQueueFamilyProperties2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkQueueFamilyProperties2* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceMemoryProperties2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMemoryProperties2* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceMemoryProperties2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceMemoryProperties2* forUnmarshaling);
+
+void marshal_VkSparseImageFormatProperties2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkSparseImageFormatProperties2* forMarshaling);
+
+void unmarshal_VkSparseImageFormatProperties2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkSparseImageFormatProperties2* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceSparseImageFormatInfo2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSparseImageFormatInfo2* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceSparseImageFormatInfo2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceSparseImageFormatInfo2* forUnmarshaling);
+
+#define OP_vkGetPhysicalDeviceFeatures2 20147
+#define OP_vkGetPhysicalDeviceProperties2 20148
+#define OP_vkGetPhysicalDeviceFormatProperties2 20149
+#define OP_vkGetPhysicalDeviceImageFormatProperties2 20150
+#define OP_vkGetPhysicalDeviceQueueFamilyProperties2 20151
+#define OP_vkGetPhysicalDeviceMemoryProperties2 20152
+#define OP_vkGetPhysicalDeviceSparseImageFormatProperties2 20153
+#define OP_vkTrimCommandPool 20154
+void marshal_VkPhysicalDevicePointClippingProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePointClippingProperties* forMarshaling);
+
+void unmarshal_VkPhysicalDevicePointClippingProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevicePointClippingProperties* forUnmarshaling);
+
+void marshal_VkInputAttachmentAspectReference(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkInputAttachmentAspectReference* forMarshaling);
+
+void unmarshal_VkInputAttachmentAspectReference(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkInputAttachmentAspectReference* forUnmarshaling);
+
+void marshal_VkRenderPassInputAttachmentAspectCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRenderPassInputAttachmentAspectCreateInfo* forMarshaling);
+
+void unmarshal_VkRenderPassInputAttachmentAspectCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkRenderPassInputAttachmentAspectCreateInfo* forUnmarshaling);
+
+void marshal_VkImageViewUsageCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkImageViewUsageCreateInfo* forMarshaling);
+
+void unmarshal_VkImageViewUsageCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkImageViewUsageCreateInfo* forUnmarshaling);
+
+void marshal_VkPipelineTessellationDomainOriginStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineTessellationDomainOriginStateCreateInfo* forMarshaling);
+
+void unmarshal_VkPipelineTessellationDomainOriginStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineTessellationDomainOriginStateCreateInfo* forUnmarshaling);
+
+void marshal_VkRenderPassMultiviewCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkRenderPassMultiviewCreateInfo* forMarshaling);
+
+void unmarshal_VkRenderPassMultiviewCreateInfo(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkRenderPassMultiviewCreateInfo* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceMultiviewFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMultiviewFeatures* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceMultiviewFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceMultiviewFeatures* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceMultiviewProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMultiviewProperties* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceMultiviewProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceMultiviewProperties* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceVariablePointersFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVariablePointersFeatures* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceVariablePointersFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceVariablePointersFeatures* forUnmarshaling);
+
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceVariablePointersFeatures,
+                      marshal_VkPhysicalDeviceVariablePointerFeatures)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceVariablePointersFeatures,
+                      unmarshal_VkPhysicalDeviceVariablePointerFeatures)
+
+void marshal_VkPhysicalDeviceProtectedMemoryFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceProtectedMemoryFeatures* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceProtectedMemoryFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceProtectedMemoryFeatures* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceProtectedMemoryProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceProtectedMemoryProperties* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceProtectedMemoryProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceProtectedMemoryProperties* forUnmarshaling);
+
+void marshal_VkDeviceQueueInfo2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkDeviceQueueInfo2* forMarshaling);
+
+void unmarshal_VkDeviceQueueInfo2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkDeviceQueueInfo2* forUnmarshaling);
+
+void marshal_VkProtectedSubmitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkProtectedSubmitInfo* forMarshaling);
+
+void unmarshal_VkProtectedSubmitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkProtectedSubmitInfo* forUnmarshaling);
+
+#define OP_vkGetDeviceQueue2 20155
+void marshal_VkSamplerYcbcrConversionCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSamplerYcbcrConversionCreateInfo* forMarshaling);
+
+void unmarshal_VkSamplerYcbcrConversionCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkSamplerYcbcrConversionCreateInfo* forUnmarshaling);
+
+void marshal_VkSamplerYcbcrConversionInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkSamplerYcbcrConversionInfo* forMarshaling);
+
+void unmarshal_VkSamplerYcbcrConversionInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkSamplerYcbcrConversionInfo* forUnmarshaling);
+
+void marshal_VkBindImagePlaneMemoryInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkBindImagePlaneMemoryInfo* forMarshaling);
+
+void unmarshal_VkBindImagePlaneMemoryInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkBindImagePlaneMemoryInfo* forUnmarshaling);
+
+void marshal_VkImagePlaneMemoryRequirementsInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImagePlaneMemoryRequirementsInfo* forMarshaling);
+
+void unmarshal_VkImagePlaneMemoryRequirementsInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkImagePlaneMemoryRequirementsInfo* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceSamplerYcbcrConversionFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSamplerYcbcrConversionFeatures* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceSamplerYcbcrConversionFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceSamplerYcbcrConversionFeatures* forUnmarshaling);
+
+void marshal_VkSamplerYcbcrConversionImageFormatProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSamplerYcbcrConversionImageFormatProperties* forMarshaling);
+
+void unmarshal_VkSamplerYcbcrConversionImageFormatProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkSamplerYcbcrConversionImageFormatProperties* forUnmarshaling);
+
+#define OP_vkCreateSamplerYcbcrConversion 20156
+#define OP_vkDestroySamplerYcbcrConversion 20157
+void marshal_VkDescriptorUpdateTemplateEntry(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkDescriptorUpdateTemplateEntry* forMarshaling);
+
+void unmarshal_VkDescriptorUpdateTemplateEntry(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkDescriptorUpdateTemplateEntry* forUnmarshaling);
+
+void marshal_VkDescriptorUpdateTemplateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDescriptorUpdateTemplateCreateInfo* forMarshaling);
+
+void unmarshal_VkDescriptorUpdateTemplateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDescriptorUpdateTemplateCreateInfo* forUnmarshaling);
+
+#define OP_vkCreateDescriptorUpdateTemplate 20158
+#define OP_vkDestroyDescriptorUpdateTemplate 20159
+#define OP_vkUpdateDescriptorSetWithTemplate 20160
+void marshal_VkExternalMemoryProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkExternalMemoryProperties* forMarshaling);
+
+void unmarshal_VkExternalMemoryProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkExternalMemoryProperties* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceExternalImageFormatInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExternalImageFormatInfo* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceExternalImageFormatInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceExternalImageFormatInfo* forUnmarshaling);
+
+void marshal_VkExternalImageFormatProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkExternalImageFormatProperties* forMarshaling);
+
+void unmarshal_VkExternalImageFormatProperties(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkExternalImageFormatProperties* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceExternalBufferInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExternalBufferInfo* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceExternalBufferInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceExternalBufferInfo* forUnmarshaling);
+
+void marshal_VkExternalBufferProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkExternalBufferProperties* forMarshaling);
+
+void unmarshal_VkExternalBufferProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkExternalBufferProperties* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceIDProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkPhysicalDeviceIDProperties* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceIDProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkPhysicalDeviceIDProperties* forUnmarshaling);
+
+#define OP_vkGetPhysicalDeviceExternalBufferProperties 20161
+void marshal_VkExternalMemoryImageCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkExternalMemoryImageCreateInfo* forMarshaling);
+
+void unmarshal_VkExternalMemoryImageCreateInfo(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkExternalMemoryImageCreateInfo* forUnmarshaling);
+
+void marshal_VkExternalMemoryBufferCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExternalMemoryBufferCreateInfo* forMarshaling);
+
+void unmarshal_VkExternalMemoryBufferCreateInfo(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkExternalMemoryBufferCreateInfo* forUnmarshaling);
+
+void marshal_VkExportMemoryAllocateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkExportMemoryAllocateInfo* forMarshaling);
+
+void unmarshal_VkExportMemoryAllocateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkExportMemoryAllocateInfo* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceExternalFenceInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExternalFenceInfo* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceExternalFenceInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceExternalFenceInfo* forUnmarshaling);
+
+void marshal_VkExternalFenceProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkExternalFenceProperties* forMarshaling);
+
+void unmarshal_VkExternalFenceProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkExternalFenceProperties* forUnmarshaling);
+
+#define OP_vkGetPhysicalDeviceExternalFenceProperties 20162
+void marshal_VkExportFenceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkExportFenceCreateInfo* forMarshaling);
+
+void unmarshal_VkExportFenceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkExportFenceCreateInfo* forUnmarshaling);
+
+void marshal_VkExportSemaphoreCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkExportSemaphoreCreateInfo* forMarshaling);
+
+void unmarshal_VkExportSemaphoreCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkExportSemaphoreCreateInfo* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceExternalSemaphoreInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExternalSemaphoreInfo* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceExternalSemaphoreInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceExternalSemaphoreInfo* forUnmarshaling);
+
+void marshal_VkExternalSemaphoreProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkExternalSemaphoreProperties* forMarshaling);
+
+void unmarshal_VkExternalSemaphoreProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkExternalSemaphoreProperties* forUnmarshaling);
+
+#define OP_vkGetPhysicalDeviceExternalSemaphoreProperties 20163
+void marshal_VkPhysicalDeviceMaintenance3Properties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMaintenance3Properties* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceMaintenance3Properties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceMaintenance3Properties* forUnmarshaling);
+
+void marshal_VkDescriptorSetLayoutSupport(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkDescriptorSetLayoutSupport* forMarshaling);
+
+void unmarshal_VkDescriptorSetLayoutSupport(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkDescriptorSetLayoutSupport* forUnmarshaling);
+
+#define OP_vkGetDescriptorSetLayoutSupport 20164
+void marshal_VkPhysicalDeviceShaderDrawParametersFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderDrawParametersFeatures* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceShaderDrawParametersFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderDrawParametersFeatures* forUnmarshaling);
+
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceShaderDrawParametersFeatures,
+                      marshal_VkPhysicalDeviceShaderDrawParameterFeatures)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceShaderDrawParametersFeatures,
+                      unmarshal_VkPhysicalDeviceShaderDrawParameterFeatures)
+
+#endif
+#ifdef VK_VERSION_1_2
+void marshal_VkPhysicalDeviceVulkan11Features(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVulkan11Features* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceVulkan11Features(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkPhysicalDeviceVulkan11Features* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceVulkan11Properties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVulkan11Properties* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceVulkan11Properties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceVulkan11Properties* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceVulkan12Features(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVulkan12Features* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceVulkan12Features(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkPhysicalDeviceVulkan12Features* forUnmarshaling);
+
+void marshal_VkConformanceVersion(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkConformanceVersion* forMarshaling);
+
+void unmarshal_VkConformanceVersion(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkConformanceVersion* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceVulkan12Properties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVulkan12Properties* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceVulkan12Properties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceVulkan12Properties* forUnmarshaling);
+
+void marshal_VkImageFormatListCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkImageFormatListCreateInfo* forMarshaling);
+
+void unmarshal_VkImageFormatListCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkImageFormatListCreateInfo* forUnmarshaling);
+
+#define OP_vkCmdDrawIndirectCount 282774587
+#define OP_vkCmdDrawIndexedIndirectCount 245204359
+void marshal_VkAttachmentDescription2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkAttachmentDescription2* forMarshaling);
+
+void unmarshal_VkAttachmentDescription2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkAttachmentDescription2* forUnmarshaling);
+
+void marshal_VkAttachmentReference2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkAttachmentReference2* forMarshaling);
+
+void unmarshal_VkAttachmentReference2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      VkAttachmentReference2* forUnmarshaling);
+
+void marshal_VkSubpassDescription2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkSubpassDescription2* forMarshaling);
+
+void unmarshal_VkSubpassDescription2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkSubpassDescription2* forUnmarshaling);
+
+void marshal_VkSubpassDependency2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkSubpassDependency2* forMarshaling);
+
+void unmarshal_VkSubpassDependency2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkSubpassDependency2* forUnmarshaling);
+
+void marshal_VkRenderPassCreateInfo2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkRenderPassCreateInfo2* forMarshaling);
+
+void unmarshal_VkRenderPassCreateInfo2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkRenderPassCreateInfo2* forUnmarshaling);
+
+void marshal_VkSubpassBeginInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkSubpassBeginInfo* forMarshaling);
+
+void unmarshal_VkSubpassBeginInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkSubpassBeginInfo* forUnmarshaling);
+
+void marshal_VkSubpassEndInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                              const VkSubpassEndInfo* forMarshaling);
+
+void unmarshal_VkSubpassEndInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                VkSubpassEndInfo* forUnmarshaling);
+
+#define OP_vkCreateRenderPass2 279590827
+#define OP_vkCmdBeginRenderPass2 235222847
+#define OP_vkCmdNextSubpass2 244873750
+#define OP_vkCmdEndRenderPass2 221297834
+void marshal_VkPhysicalDevice8BitStorageFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevice8BitStorageFeatures* forMarshaling);
+
+void unmarshal_VkPhysicalDevice8BitStorageFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevice8BitStorageFeatures* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceDriverProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDriverProperties* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceDriverProperties(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkPhysicalDeviceDriverProperties* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceShaderAtomicInt64Features(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderAtomicInt64Features* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceShaderAtomicInt64Features(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderAtomicInt64Features* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceShaderFloat16Int8Features(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderFloat16Int8Features* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceShaderFloat16Int8Features(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderFloat16Int8Features* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceFloatControlsProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFloatControlsProperties* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceFloatControlsProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceFloatControlsProperties* forUnmarshaling);
+
+void marshal_VkDescriptorSetLayoutBindingFlagsCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDescriptorSetLayoutBindingFlagsCreateInfo* forMarshaling);
+
+void unmarshal_VkDescriptorSetLayoutBindingFlagsCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDescriptorSetLayoutBindingFlagsCreateInfo* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceDescriptorIndexingFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDescriptorIndexingFeatures* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceDescriptorIndexingFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceDescriptorIndexingFeatures* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceDescriptorIndexingProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDescriptorIndexingProperties* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceDescriptorIndexingProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceDescriptorIndexingProperties* forUnmarshaling);
+
+void marshal_VkDescriptorSetVariableDescriptorCountAllocateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDescriptorSetVariableDescriptorCountAllocateInfo* forMarshaling);
+
+void unmarshal_VkDescriptorSetVariableDescriptorCountAllocateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDescriptorSetVariableDescriptorCountAllocateInfo* forUnmarshaling);
+
+void marshal_VkDescriptorSetVariableDescriptorCountLayoutSupport(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDescriptorSetVariableDescriptorCountLayoutSupport* forMarshaling);
+
+void unmarshal_VkDescriptorSetVariableDescriptorCountLayoutSupport(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDescriptorSetVariableDescriptorCountLayoutSupport* forUnmarshaling);
+
+void marshal_VkSubpassDescriptionDepthStencilResolve(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSubpassDescriptionDepthStencilResolve* forMarshaling);
+
+void unmarshal_VkSubpassDescriptionDepthStencilResolve(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkSubpassDescriptionDepthStencilResolve* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceDepthStencilResolveProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDepthStencilResolveProperties* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceDepthStencilResolveProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceDepthStencilResolveProperties* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceScalarBlockLayoutFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceScalarBlockLayoutFeatures* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceScalarBlockLayoutFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceScalarBlockLayoutFeatures* forUnmarshaling);
+
+void marshal_VkImageStencilUsageCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkImageStencilUsageCreateInfo* forMarshaling);
+
+void unmarshal_VkImageStencilUsageCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkImageStencilUsageCreateInfo* forUnmarshaling);
+
+void marshal_VkSamplerReductionModeCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSamplerReductionModeCreateInfo* forMarshaling);
+
+void unmarshal_VkSamplerReductionModeCreateInfo(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkSamplerReductionModeCreateInfo* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceSamplerFilterMinmaxProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSamplerFilterMinmaxProperties* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceSamplerFilterMinmaxProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceSamplerFilterMinmaxProperties* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceVulkanMemoryModelFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVulkanMemoryModelFeatures* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceVulkanMemoryModelFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceVulkanMemoryModelFeatures* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceImagelessFramebufferFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceImagelessFramebufferFeatures* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceImagelessFramebufferFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceImagelessFramebufferFeatures* forUnmarshaling);
+
+void marshal_VkFramebufferAttachmentImageInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkFramebufferAttachmentImageInfo* forMarshaling);
+
+void unmarshal_VkFramebufferAttachmentImageInfo(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkFramebufferAttachmentImageInfo* forUnmarshaling);
+
+void marshal_VkFramebufferAttachmentsCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkFramebufferAttachmentsCreateInfo* forMarshaling);
+
+void unmarshal_VkFramebufferAttachmentsCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkFramebufferAttachmentsCreateInfo* forUnmarshaling);
+
+void marshal_VkRenderPassAttachmentBeginInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkRenderPassAttachmentBeginInfo* forMarshaling);
+
+void unmarshal_VkRenderPassAttachmentBeginInfo(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkRenderPassAttachmentBeginInfo* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceUniformBufferStandardLayoutFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceUniformBufferStandardLayoutFeatures* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceUniformBufferStandardLayoutFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceUniformBufferStandardLayoutFeatures* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures* forUnmarshaling);
+
+void marshal_VkAttachmentReferenceStencilLayout(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAttachmentReferenceStencilLayout* forMarshaling);
+
+void unmarshal_VkAttachmentReferenceStencilLayout(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAttachmentReferenceStencilLayout* forUnmarshaling);
+
+void marshal_VkAttachmentDescriptionStencilLayout(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAttachmentDescriptionStencilLayout* forMarshaling);
+
+void unmarshal_VkAttachmentDescriptionStencilLayout(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAttachmentDescriptionStencilLayout* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceHostQueryResetFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceHostQueryResetFeatures* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceHostQueryResetFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceHostQueryResetFeatures* forUnmarshaling);
+
+#define OP_vkResetQueryPool 252097672
+void marshal_VkPhysicalDeviceTimelineSemaphoreFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceTimelineSemaphoreFeatures* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceTimelineSemaphoreFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceTimelineSemaphoreFeatures* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceTimelineSemaphoreProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceTimelineSemaphoreProperties* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceTimelineSemaphoreProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceTimelineSemaphoreProperties* forUnmarshaling);
+
+void marshal_VkSemaphoreTypeCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkSemaphoreTypeCreateInfo* forMarshaling);
+
+void unmarshal_VkSemaphoreTypeCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkSemaphoreTypeCreateInfo* forUnmarshaling);
+
+void marshal_VkTimelineSemaphoreSubmitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkTimelineSemaphoreSubmitInfo* forMarshaling);
+
+void unmarshal_VkTimelineSemaphoreSubmitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkTimelineSemaphoreSubmitInfo* forUnmarshaling);
+
+void marshal_VkSemaphoreWaitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkSemaphoreWaitInfo* forMarshaling);
+
+void unmarshal_VkSemaphoreWaitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkSemaphoreWaitInfo* forUnmarshaling);
+
+void marshal_VkSemaphoreSignalInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkSemaphoreSignalInfo* forMarshaling);
+
+void unmarshal_VkSemaphoreSignalInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkSemaphoreSignalInfo* forUnmarshaling);
+
+#define OP_vkGetSemaphoreCounterValue 267066974
+#define OP_vkWaitSemaphores 224777382
+#define OP_vkSignalSemaphore 271024127
+void marshal_VkPhysicalDeviceBufferDeviceAddressFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceBufferDeviceAddressFeatures* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceBufferDeviceAddressFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceBufferDeviceAddressFeatures* forUnmarshaling);
+
+void marshal_VkBufferDeviceAddressInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkBufferDeviceAddressInfo* forMarshaling);
+
+void unmarshal_VkBufferDeviceAddressInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkBufferDeviceAddressInfo* forUnmarshaling);
+
+void marshal_VkBufferOpaqueCaptureAddressCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferOpaqueCaptureAddressCreateInfo* forMarshaling);
+
+void unmarshal_VkBufferOpaqueCaptureAddressCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkBufferOpaqueCaptureAddressCreateInfo* forUnmarshaling);
+
+void marshal_VkMemoryOpaqueCaptureAddressAllocateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryOpaqueCaptureAddressAllocateInfo* forMarshaling);
+
+void unmarshal_VkMemoryOpaqueCaptureAddressAllocateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkMemoryOpaqueCaptureAddressAllocateInfo* forUnmarshaling);
+
+void marshal_VkDeviceMemoryOpaqueCaptureAddressInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceMemoryOpaqueCaptureAddressInfo* forMarshaling);
+
+void unmarshal_VkDeviceMemoryOpaqueCaptureAddressInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDeviceMemoryOpaqueCaptureAddressInfo* forUnmarshaling);
+
+#define OP_vkGetBufferDeviceAddress 222632266
+#define OP_vkGetBufferOpaqueCaptureAddress 230188231
+#define OP_vkGetDeviceMemoryOpaqueCaptureAddress 260620079
+#endif
+#ifdef VK_KHR_surface
+void marshal_VkSurfaceCapabilitiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkSurfaceCapabilitiesKHR* forMarshaling);
+
+void unmarshal_VkSurfaceCapabilitiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkSurfaceCapabilitiesKHR* forUnmarshaling);
+
+void marshal_VkSurfaceFormatKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkSurfaceFormatKHR* forMarshaling);
+
+void unmarshal_VkSurfaceFormatKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkSurfaceFormatKHR* forUnmarshaling);
+
+#define OP_vkDestroySurfaceKHR 20165
+#define OP_vkGetPhysicalDeviceSurfaceSupportKHR 20166
+#define OP_vkGetPhysicalDeviceSurfaceCapabilitiesKHR 20167
+#define OP_vkGetPhysicalDeviceSurfaceFormatsKHR 20168
+#define OP_vkGetPhysicalDeviceSurfacePresentModesKHR 20169
+#endif
+#ifdef VK_KHR_swapchain
+void marshal_VkSwapchainCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkSwapchainCreateInfoKHR* forMarshaling);
+
+void unmarshal_VkSwapchainCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkSwapchainCreateInfoKHR* forUnmarshaling);
+
+void marshal_VkPresentInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                              const VkPresentInfoKHR* forMarshaling);
+
+void unmarshal_VkPresentInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                VkPresentInfoKHR* forUnmarshaling);
+
+#define OP_vkCreateSwapchainKHR 20170
+#define OP_vkDestroySwapchainKHR 20171
+#define OP_vkGetSwapchainImagesKHR 20172
+#define OP_vkAcquireNextImageKHR 20173
+#define OP_vkQueuePresentKHR 20174
+void marshal_VkImageSwapchainCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkImageSwapchainCreateInfoKHR* forMarshaling);
+
+void unmarshal_VkImageSwapchainCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkImageSwapchainCreateInfoKHR* forUnmarshaling);
+
+void marshal_VkBindImageMemorySwapchainInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBindImageMemorySwapchainInfoKHR* forMarshaling);
+
+void unmarshal_VkBindImageMemorySwapchainInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkBindImageMemorySwapchainInfoKHR* forUnmarshaling);
+
+void marshal_VkAcquireNextImageInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkAcquireNextImageInfoKHR* forMarshaling);
+
+void unmarshal_VkAcquireNextImageInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkAcquireNextImageInfoKHR* forUnmarshaling);
+
+void marshal_VkDeviceGroupPresentCapabilitiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceGroupPresentCapabilitiesKHR* forMarshaling);
+
+void unmarshal_VkDeviceGroupPresentCapabilitiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDeviceGroupPresentCapabilitiesKHR* forUnmarshaling);
+
+void marshal_VkDeviceGroupPresentInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkDeviceGroupPresentInfoKHR* forMarshaling);
+
+void unmarshal_VkDeviceGroupPresentInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkDeviceGroupPresentInfoKHR* forUnmarshaling);
+
+void marshal_VkDeviceGroupSwapchainCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceGroupSwapchainCreateInfoKHR* forMarshaling);
+
+void unmarshal_VkDeviceGroupSwapchainCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDeviceGroupSwapchainCreateInfoKHR* forUnmarshaling);
+
+#define OP_vkGetDeviceGroupPresentCapabilitiesKHR 20175
+#define OP_vkGetDeviceGroupSurfacePresentModesKHR 20176
+#define OP_vkGetPhysicalDevicePresentRectanglesKHR 20177
+#define OP_vkAcquireNextImage2KHR 20178
+#endif
+#ifdef VK_KHR_display
+void marshal_VkDisplayModeParametersKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkDisplayModeParametersKHR* forMarshaling);
+
+void unmarshal_VkDisplayModeParametersKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkDisplayModeParametersKHR* forUnmarshaling);
+
+void marshal_VkDisplayModeCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkDisplayModeCreateInfoKHR* forMarshaling);
+
+void unmarshal_VkDisplayModeCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkDisplayModeCreateInfoKHR* forUnmarshaling);
+
+void marshal_VkDisplayModePropertiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkDisplayModePropertiesKHR* forMarshaling);
+
+void unmarshal_VkDisplayModePropertiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkDisplayModePropertiesKHR* forUnmarshaling);
+
+void marshal_VkDisplayPlaneCapabilitiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkDisplayPlaneCapabilitiesKHR* forMarshaling);
+
+void unmarshal_VkDisplayPlaneCapabilitiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkDisplayPlaneCapabilitiesKHR* forUnmarshaling);
+
+void marshal_VkDisplayPlanePropertiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkDisplayPlanePropertiesKHR* forMarshaling);
+
+void unmarshal_VkDisplayPlanePropertiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkDisplayPlanePropertiesKHR* forUnmarshaling);
+
+void marshal_VkDisplayPropertiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkDisplayPropertiesKHR* forMarshaling);
+
+void unmarshal_VkDisplayPropertiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      VkDisplayPropertiesKHR* forUnmarshaling);
+
+void marshal_VkDisplaySurfaceCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkDisplaySurfaceCreateInfoKHR* forMarshaling);
+
+void unmarshal_VkDisplaySurfaceCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkDisplaySurfaceCreateInfoKHR* forUnmarshaling);
+
+#define OP_vkGetPhysicalDeviceDisplayPropertiesKHR 20179
+#define OP_vkGetPhysicalDeviceDisplayPlanePropertiesKHR 20180
+#define OP_vkGetDisplayPlaneSupportedDisplaysKHR 20181
+#define OP_vkGetDisplayModePropertiesKHR 20182
+#define OP_vkCreateDisplayModeKHR 20183
+#define OP_vkGetDisplayPlaneCapabilitiesKHR 20184
+#define OP_vkCreateDisplayPlaneSurfaceKHR 20185
+#endif
+#ifdef VK_KHR_display_swapchain
+void marshal_VkDisplayPresentInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkDisplayPresentInfoKHR* forMarshaling);
+
+void unmarshal_VkDisplayPresentInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkDisplayPresentInfoKHR* forUnmarshaling);
+
+#define OP_vkCreateSharedSwapchainsKHR 20186
+#endif
+#ifdef VK_KHR_xlib_surface
+void marshal_VkXlibSurfaceCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkXlibSurfaceCreateInfoKHR* forMarshaling);
+
+void unmarshal_VkXlibSurfaceCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkXlibSurfaceCreateInfoKHR* forUnmarshaling);
+
+#define OP_vkCreateXlibSurfaceKHR 20187
+#define OP_vkGetPhysicalDeviceXlibPresentationSupportKHR 20188
+#endif
+#ifdef VK_KHR_xcb_surface
+void marshal_VkXcbSurfaceCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkXcbSurfaceCreateInfoKHR* forMarshaling);
+
+void unmarshal_VkXcbSurfaceCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkXcbSurfaceCreateInfoKHR* forUnmarshaling);
+
+#define OP_vkCreateXcbSurfaceKHR 20189
+#define OP_vkGetPhysicalDeviceXcbPresentationSupportKHR 20190
+#endif
+#ifdef VK_KHR_wayland_surface
+void marshal_VkWaylandSurfaceCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkWaylandSurfaceCreateInfoKHR* forMarshaling);
+
+void unmarshal_VkWaylandSurfaceCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkWaylandSurfaceCreateInfoKHR* forUnmarshaling);
+
+#define OP_vkCreateWaylandSurfaceKHR 20191
+#define OP_vkGetPhysicalDeviceWaylandPresentationSupportKHR 20192
+#endif
+#ifdef VK_KHR_android_surface
+void marshal_VkAndroidSurfaceCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkAndroidSurfaceCreateInfoKHR* forMarshaling);
+
+void unmarshal_VkAndroidSurfaceCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkAndroidSurfaceCreateInfoKHR* forUnmarshaling);
+
+#define OP_vkCreateAndroidSurfaceKHR 20195
+#endif
+#ifdef VK_KHR_win32_surface
+void marshal_VkWin32SurfaceCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkWin32SurfaceCreateInfoKHR* forMarshaling);
+
+void unmarshal_VkWin32SurfaceCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkWin32SurfaceCreateInfoKHR* forUnmarshaling);
+
+#define OP_vkCreateWin32SurfaceKHR 20196
+#define OP_vkGetPhysicalDeviceWin32PresentationSupportKHR 20197
+#endif
+#ifdef VK_KHR_sampler_mirror_clamp_to_edge
+#endif
+#ifdef VK_KHR_video_queue
+void marshal_VkVideoQueueFamilyProperties2KHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoQueueFamilyProperties2KHR* forMarshaling);
+
+void unmarshal_VkVideoQueueFamilyProperties2KHR(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkVideoQueueFamilyProperties2KHR* forUnmarshaling);
+
+void marshal_VkVideoProfileKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               const VkVideoProfileKHR* forMarshaling);
+
+void unmarshal_VkVideoProfileKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 VkVideoProfileKHR* forUnmarshaling);
+
+void marshal_VkVideoProfilesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkVideoProfilesKHR* forMarshaling);
+
+void unmarshal_VkVideoProfilesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkVideoProfilesKHR* forUnmarshaling);
+
+void marshal_VkVideoCapabilitiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkVideoCapabilitiesKHR* forMarshaling);
+
+void unmarshal_VkVideoCapabilitiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      VkVideoCapabilitiesKHR* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceVideoFormatInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVideoFormatInfoKHR* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceVideoFormatInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceVideoFormatInfoKHR* forUnmarshaling);
+
+void marshal_VkVideoFormatPropertiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkVideoFormatPropertiesKHR* forMarshaling);
+
+void unmarshal_VkVideoFormatPropertiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkVideoFormatPropertiesKHR* forUnmarshaling);
+
+void marshal_VkVideoPictureResourceKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkVideoPictureResourceKHR* forMarshaling);
+
+void unmarshal_VkVideoPictureResourceKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkVideoPictureResourceKHR* forUnmarshaling);
+
+void marshal_VkVideoReferenceSlotKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkVideoReferenceSlotKHR* forMarshaling);
+
+void unmarshal_VkVideoReferenceSlotKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkVideoReferenceSlotKHR* forUnmarshaling);
+
+void marshal_VkVideoGetMemoryPropertiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkVideoGetMemoryPropertiesKHR* forMarshaling);
+
+void unmarshal_VkVideoGetMemoryPropertiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkVideoGetMemoryPropertiesKHR* forUnmarshaling);
+
+void marshal_VkVideoBindMemoryKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkVideoBindMemoryKHR* forMarshaling);
+
+void unmarshal_VkVideoBindMemoryKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkVideoBindMemoryKHR* forUnmarshaling);
+
+void marshal_VkVideoSessionCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkVideoSessionCreateInfoKHR* forMarshaling);
+
+void unmarshal_VkVideoSessionCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkVideoSessionCreateInfoKHR* forUnmarshaling);
+
+void marshal_VkVideoSessionParametersCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoSessionParametersCreateInfoKHR* forMarshaling);
+
+void unmarshal_VkVideoSessionParametersCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoSessionParametersCreateInfoKHR* forUnmarshaling);
+
+void marshal_VkVideoSessionParametersUpdateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoSessionParametersUpdateInfoKHR* forMarshaling);
+
+void unmarshal_VkVideoSessionParametersUpdateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoSessionParametersUpdateInfoKHR* forUnmarshaling);
+
+void marshal_VkVideoBeginCodingInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkVideoBeginCodingInfoKHR* forMarshaling);
+
+void unmarshal_VkVideoBeginCodingInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkVideoBeginCodingInfoKHR* forUnmarshaling);
+
+void marshal_VkVideoEndCodingInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkVideoEndCodingInfoKHR* forMarshaling);
+
+void unmarshal_VkVideoEndCodingInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkVideoEndCodingInfoKHR* forUnmarshaling);
+
+void marshal_VkVideoCodingControlInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkVideoCodingControlInfoKHR* forMarshaling);
+
+void unmarshal_VkVideoCodingControlInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkVideoCodingControlInfoKHR* forUnmarshaling);
+
+#define OP_vkGetPhysicalDeviceVideoCapabilitiesKHR 248113462
+#define OP_vkGetPhysicalDeviceVideoFormatPropertiesKHR 261873967
+#define OP_vkCreateVideoSessionKHR 227974422
+#define OP_vkDestroyVideoSessionKHR 239043215
+#define OP_vkGetVideoSessionMemoryRequirementsKHR 256181716
+#define OP_vkBindVideoSessionMemoryKHR 215994619
+#define OP_vkCreateVideoSessionParametersKHR 265164680
+#define OP_vkUpdateVideoSessionParametersKHR 261262143
+#define OP_vkDestroyVideoSessionParametersKHR 237919724
+#define OP_vkCmdBeginVideoCodingKHR 239581372
+#define OP_vkCmdEndVideoCodingKHR 279828574
+#define OP_vkCmdControlVideoCodingKHR 252933003
+#endif
+#ifdef VK_KHR_video_decode_queue
+void marshal_VkVideoDecodeInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkVideoDecodeInfoKHR* forMarshaling);
+
+void unmarshal_VkVideoDecodeInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkVideoDecodeInfoKHR* forUnmarshaling);
+
+#define OP_vkCmdDecodeVideoKHR 275796951
+#endif
+#ifdef VK_KHR_dynamic_rendering
+void marshal_VkRenderingAttachmentInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkRenderingAttachmentInfoKHR* forMarshaling);
+
+void unmarshal_VkRenderingAttachmentInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkRenderingAttachmentInfoKHR* forUnmarshaling);
+
+void marshal_VkRenderingInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkRenderingInfoKHR* forMarshaling);
+
+void unmarshal_VkRenderingInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkRenderingInfoKHR* forUnmarshaling);
+
+void marshal_VkPipelineRenderingCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRenderingCreateInfoKHR* forMarshaling);
+
+void unmarshal_VkPipelineRenderingCreateInfoKHR(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkPipelineRenderingCreateInfoKHR* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceDynamicRenderingFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDynamicRenderingFeaturesKHR* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceDynamicRenderingFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceDynamicRenderingFeaturesKHR* forUnmarshaling);
+
+void marshal_VkCommandBufferInheritanceRenderingInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCommandBufferInheritanceRenderingInfoKHR* forMarshaling);
+
+void unmarshal_VkCommandBufferInheritanceRenderingInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkCommandBufferInheritanceRenderingInfoKHR* forUnmarshaling);
+
+#define OP_vkCmdBeginRenderingKHR 298092805
+#define OP_vkCmdEndRenderingKHR 200651584
+void marshal_VkRenderingFragmentShadingRateAttachmentInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRenderingFragmentShadingRateAttachmentInfoKHR* forMarshaling);
+
+void unmarshal_VkRenderingFragmentShadingRateAttachmentInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkRenderingFragmentShadingRateAttachmentInfoKHR* forUnmarshaling);
+
+void marshal_VkRenderingFragmentDensityMapAttachmentInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRenderingFragmentDensityMapAttachmentInfoEXT* forMarshaling);
+
+void unmarshal_VkRenderingFragmentDensityMapAttachmentInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkRenderingFragmentDensityMapAttachmentInfoEXT* forUnmarshaling);
+
+void marshal_VkAttachmentSampleCountInfoAMD(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkAttachmentSampleCountInfoAMD* forMarshaling);
+
+void unmarshal_VkAttachmentSampleCountInfoAMD(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkAttachmentSampleCountInfoAMD* forUnmarshaling);
+
+DEFINE_ALIAS_FUNCTION(marshal_VkAttachmentSampleCountInfoAMD, marshal_VkAttachmentSampleCountInfoNV)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkAttachmentSampleCountInfoAMD,
+                      unmarshal_VkAttachmentSampleCountInfoNV)
+
+void marshal_VkMultiviewPerViewAttributesInfoNVX(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMultiviewPerViewAttributesInfoNVX* forMarshaling);
+
+void unmarshal_VkMultiviewPerViewAttributesInfoNVX(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkMultiviewPerViewAttributesInfoNVX* forUnmarshaling);
+
+#endif
+#ifdef VK_KHR_multiview
+DEFINE_ALIAS_FUNCTION(marshal_VkRenderPassMultiviewCreateInfo,
+                      marshal_VkRenderPassMultiviewCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkRenderPassMultiviewCreateInfo,
+                      unmarshal_VkRenderPassMultiviewCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceMultiviewFeatures,
+                      marshal_VkPhysicalDeviceMultiviewFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceMultiviewFeatures,
+                      unmarshal_VkPhysicalDeviceMultiviewFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceMultiviewProperties,
+                      marshal_VkPhysicalDeviceMultiviewPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceMultiviewProperties,
+                      unmarshal_VkPhysicalDeviceMultiviewPropertiesKHR)
+
+#endif
+#ifdef VK_KHR_get_physical_device_properties2
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceFeatures2, marshal_VkPhysicalDeviceFeatures2KHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceFeatures2, unmarshal_VkPhysicalDeviceFeatures2KHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceProperties2, marshal_VkPhysicalDeviceProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceProperties2,
+                      unmarshal_VkPhysicalDeviceProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkFormatProperties2, marshal_VkFormatProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkFormatProperties2, unmarshal_VkFormatProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkImageFormatProperties2, marshal_VkImageFormatProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkImageFormatProperties2, unmarshal_VkImageFormatProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceImageFormatInfo2,
+                      marshal_VkPhysicalDeviceImageFormatInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceImageFormatInfo2,
+                      unmarshal_VkPhysicalDeviceImageFormatInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkQueueFamilyProperties2, marshal_VkQueueFamilyProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkQueueFamilyProperties2, unmarshal_VkQueueFamilyProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceMemoryProperties2,
+                      marshal_VkPhysicalDeviceMemoryProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceMemoryProperties2,
+                      unmarshal_VkPhysicalDeviceMemoryProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkSparseImageFormatProperties2,
+                      marshal_VkSparseImageFormatProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkSparseImageFormatProperties2,
+                      unmarshal_VkSparseImageFormatProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceSparseImageFormatInfo2,
+                      marshal_VkPhysicalDeviceSparseImageFormatInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceSparseImageFormatInfo2,
+                      unmarshal_VkPhysicalDeviceSparseImageFormatInfo2KHR)
+
+#define OP_vkGetPhysicalDeviceFeatures2KHR 20198
+#define OP_vkGetPhysicalDeviceProperties2KHR 20199
+#define OP_vkGetPhysicalDeviceFormatProperties2KHR 20200
+#define OP_vkGetPhysicalDeviceImageFormatProperties2KHR 20201
+#define OP_vkGetPhysicalDeviceQueueFamilyProperties2KHR 20202
+#define OP_vkGetPhysicalDeviceMemoryProperties2KHR 20203
+#define OP_vkGetPhysicalDeviceSparseImageFormatProperties2KHR 20204
+#endif
+#ifdef VK_KHR_device_group
+DEFINE_ALIAS_FUNCTION(marshal_VkMemoryAllocateFlagsInfo, marshal_VkMemoryAllocateFlagsInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkMemoryAllocateFlagsInfo, unmarshal_VkMemoryAllocateFlagsInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkDeviceGroupRenderPassBeginInfo,
+                      marshal_VkDeviceGroupRenderPassBeginInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkDeviceGroupRenderPassBeginInfo,
+                      unmarshal_VkDeviceGroupRenderPassBeginInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkDeviceGroupCommandBufferBeginInfo,
+                      marshal_VkDeviceGroupCommandBufferBeginInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkDeviceGroupCommandBufferBeginInfo,
+                      unmarshal_VkDeviceGroupCommandBufferBeginInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkDeviceGroupSubmitInfo, marshal_VkDeviceGroupSubmitInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkDeviceGroupSubmitInfo, unmarshal_VkDeviceGroupSubmitInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkDeviceGroupBindSparseInfo, marshal_VkDeviceGroupBindSparseInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkDeviceGroupBindSparseInfo,
+                      unmarshal_VkDeviceGroupBindSparseInfoKHR)
+
+#define OP_vkGetDeviceGroupPeerMemoryFeaturesKHR 20205
+#define OP_vkCmdSetDeviceMaskKHR 20206
+#define OP_vkCmdDispatchBaseKHR 20207
+DEFINE_ALIAS_FUNCTION(marshal_VkBindBufferMemoryDeviceGroupInfo,
+                      marshal_VkBindBufferMemoryDeviceGroupInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkBindBufferMemoryDeviceGroupInfo,
+                      unmarshal_VkBindBufferMemoryDeviceGroupInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkBindImageMemoryDeviceGroupInfo,
+                      marshal_VkBindImageMemoryDeviceGroupInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkBindImageMemoryDeviceGroupInfo,
+                      unmarshal_VkBindImageMemoryDeviceGroupInfoKHR)
+
+#endif
+#ifdef VK_KHR_shader_draw_parameters
+#endif
+#ifdef VK_KHR_maintenance1
+#define OP_vkTrimCommandPoolKHR 20208
+#endif
+#ifdef VK_KHR_device_group_creation
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceGroupProperties,
+                      marshal_VkPhysicalDeviceGroupPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceGroupProperties,
+                      unmarshal_VkPhysicalDeviceGroupPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkDeviceGroupDeviceCreateInfo,
+                      marshal_VkDeviceGroupDeviceCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkDeviceGroupDeviceCreateInfo,
+                      unmarshal_VkDeviceGroupDeviceCreateInfoKHR)
+
+#define OP_vkEnumeratePhysicalDeviceGroupsKHR 20209
+#endif
+#ifdef VK_KHR_external_memory_capabilities
+DEFINE_ALIAS_FUNCTION(marshal_VkExternalMemoryProperties, marshal_VkExternalMemoryPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkExternalMemoryProperties, unmarshal_VkExternalMemoryPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceExternalImageFormatInfo,
+                      marshal_VkPhysicalDeviceExternalImageFormatInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceExternalImageFormatInfo,
+                      unmarshal_VkPhysicalDeviceExternalImageFormatInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkExternalImageFormatProperties,
+                      marshal_VkExternalImageFormatPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkExternalImageFormatProperties,
+                      unmarshal_VkExternalImageFormatPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceExternalBufferInfo,
+                      marshal_VkPhysicalDeviceExternalBufferInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceExternalBufferInfo,
+                      unmarshal_VkPhysicalDeviceExternalBufferInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkExternalBufferProperties, marshal_VkExternalBufferPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkExternalBufferProperties, unmarshal_VkExternalBufferPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceIDProperties, marshal_VkPhysicalDeviceIDPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceIDProperties,
+                      unmarshal_VkPhysicalDeviceIDPropertiesKHR)
+
+#define OP_vkGetPhysicalDeviceExternalBufferPropertiesKHR 20210
+#endif
+#ifdef VK_KHR_external_memory
+DEFINE_ALIAS_FUNCTION(marshal_VkExternalMemoryImageCreateInfo,
+                      marshal_VkExternalMemoryImageCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkExternalMemoryImageCreateInfo,
+                      unmarshal_VkExternalMemoryImageCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkExternalMemoryBufferCreateInfo,
+                      marshal_VkExternalMemoryBufferCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkExternalMemoryBufferCreateInfo,
+                      unmarshal_VkExternalMemoryBufferCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkExportMemoryAllocateInfo, marshal_VkExportMemoryAllocateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkExportMemoryAllocateInfo, unmarshal_VkExportMemoryAllocateInfoKHR)
+
+#endif
+#ifdef VK_KHR_external_memory_win32
+void marshal_VkImportMemoryWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportMemoryWin32HandleInfoKHR* forMarshaling);
+
+void unmarshal_VkImportMemoryWin32HandleInfoKHR(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkImportMemoryWin32HandleInfoKHR* forUnmarshaling);
+
+void marshal_VkExportMemoryWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExportMemoryWin32HandleInfoKHR* forMarshaling);
+
+void unmarshal_VkExportMemoryWin32HandleInfoKHR(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkExportMemoryWin32HandleInfoKHR* forUnmarshaling);
+
+void marshal_VkMemoryWin32HandlePropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryWin32HandlePropertiesKHR* forMarshaling);
+
+void unmarshal_VkMemoryWin32HandlePropertiesKHR(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkMemoryWin32HandlePropertiesKHR* forUnmarshaling);
+
+void marshal_VkMemoryGetWin32HandleInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkMemoryGetWin32HandleInfoKHR* forMarshaling);
+
+void unmarshal_VkMemoryGetWin32HandleInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkMemoryGetWin32HandleInfoKHR* forUnmarshaling);
+
+#define OP_vkGetMemoryWin32HandleKHR 20211
+#define OP_vkGetMemoryWin32HandlePropertiesKHR 20212
+#endif
+#ifdef VK_KHR_external_memory_fd
+void marshal_VkImportMemoryFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkImportMemoryFdInfoKHR* forMarshaling);
+
+void unmarshal_VkImportMemoryFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkImportMemoryFdInfoKHR* forUnmarshaling);
+
+void marshal_VkMemoryFdPropertiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkMemoryFdPropertiesKHR* forMarshaling);
+
+void unmarshal_VkMemoryFdPropertiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkMemoryFdPropertiesKHR* forUnmarshaling);
+
+void marshal_VkMemoryGetFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkMemoryGetFdInfoKHR* forMarshaling);
+
+void unmarshal_VkMemoryGetFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkMemoryGetFdInfoKHR* forUnmarshaling);
+
+#define OP_vkGetMemoryFdKHR 20213
+#define OP_vkGetMemoryFdPropertiesKHR 20214
+#endif
+#ifdef VK_KHR_win32_keyed_mutex
+void marshal_VkWin32KeyedMutexAcquireReleaseInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkWin32KeyedMutexAcquireReleaseInfoKHR* forMarshaling);
+
+void unmarshal_VkWin32KeyedMutexAcquireReleaseInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkWin32KeyedMutexAcquireReleaseInfoKHR* forUnmarshaling);
+
+#endif
+#ifdef VK_KHR_external_semaphore_capabilities
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceExternalSemaphoreInfo,
+                      marshal_VkPhysicalDeviceExternalSemaphoreInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceExternalSemaphoreInfo,
+                      unmarshal_VkPhysicalDeviceExternalSemaphoreInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkExternalSemaphoreProperties,
+                      marshal_VkExternalSemaphorePropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkExternalSemaphoreProperties,
+                      unmarshal_VkExternalSemaphorePropertiesKHR)
+
+#define OP_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR 20215
+#endif
+#ifdef VK_KHR_external_semaphore
+DEFINE_ALIAS_FUNCTION(marshal_VkExportSemaphoreCreateInfo, marshal_VkExportSemaphoreCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkExportSemaphoreCreateInfo,
+                      unmarshal_VkExportSemaphoreCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+void marshal_VkImportSemaphoreWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportSemaphoreWin32HandleInfoKHR* forMarshaling);
+
+void unmarshal_VkImportSemaphoreWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkImportSemaphoreWin32HandleInfoKHR* forUnmarshaling);
+
+void marshal_VkExportSemaphoreWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExportSemaphoreWin32HandleInfoKHR* forMarshaling);
+
+void unmarshal_VkExportSemaphoreWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkExportSemaphoreWin32HandleInfoKHR* forUnmarshaling);
+
+void marshal_VkD3D12FenceSubmitInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkD3D12FenceSubmitInfoKHR* forMarshaling);
+
+void unmarshal_VkD3D12FenceSubmitInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkD3D12FenceSubmitInfoKHR* forUnmarshaling);
+
+void marshal_VkSemaphoreGetWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSemaphoreGetWin32HandleInfoKHR* forMarshaling);
+
+void unmarshal_VkSemaphoreGetWin32HandleInfoKHR(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkSemaphoreGetWin32HandleInfoKHR* forUnmarshaling);
+
+#define OP_vkImportSemaphoreWin32HandleKHR 20216
+#define OP_vkGetSemaphoreWin32HandleKHR 20217
+#endif
+#ifdef VK_KHR_external_semaphore_fd
+void marshal_VkImportSemaphoreFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkImportSemaphoreFdInfoKHR* forMarshaling);
+
+void unmarshal_VkImportSemaphoreFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkImportSemaphoreFdInfoKHR* forUnmarshaling);
+
+void marshal_VkSemaphoreGetFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkSemaphoreGetFdInfoKHR* forMarshaling);
+
+void unmarshal_VkSemaphoreGetFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkSemaphoreGetFdInfoKHR* forUnmarshaling);
+
+#define OP_vkImportSemaphoreFdKHR 20218
+#define OP_vkGetSemaphoreFdKHR 20219
+#endif
+#ifdef VK_KHR_push_descriptor
+void marshal_VkPhysicalDevicePushDescriptorPropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePushDescriptorPropertiesKHR* forMarshaling);
+
+void unmarshal_VkPhysicalDevicePushDescriptorPropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevicePushDescriptorPropertiesKHR* forUnmarshaling);
+
+#define OP_vkCmdPushDescriptorSetKHR 20220
+#define OP_vkCmdPushDescriptorSetWithTemplateKHR 20221
+#endif
+#ifdef VK_KHR_shader_float16_int8
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceShaderFloat16Int8Features,
+                      marshal_VkPhysicalDeviceShaderFloat16Int8FeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceShaderFloat16Int8Features,
+                      unmarshal_VkPhysicalDeviceShaderFloat16Int8FeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceShaderFloat16Int8Features,
+                      marshal_VkPhysicalDeviceFloat16Int8FeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceShaderFloat16Int8Features,
+                      unmarshal_VkPhysicalDeviceFloat16Int8FeaturesKHR)
+
+#endif
+#ifdef VK_KHR_16bit_storage
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDevice16BitStorageFeatures,
+                      marshal_VkPhysicalDevice16BitStorageFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDevice16BitStorageFeatures,
+                      unmarshal_VkPhysicalDevice16BitStorageFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_incremental_present
+void marshal_VkRectLayerKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                            const VkRectLayerKHR* forMarshaling);
+
+void unmarshal_VkRectLayerKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                              VkRectLayerKHR* forUnmarshaling);
+
+void marshal_VkPresentRegionKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkPresentRegionKHR* forMarshaling);
+
+void unmarshal_VkPresentRegionKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkPresentRegionKHR* forUnmarshaling);
+
+void marshal_VkPresentRegionsKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkPresentRegionsKHR* forMarshaling);
+
+void unmarshal_VkPresentRegionsKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkPresentRegionsKHR* forUnmarshaling);
+
+#endif
+#ifdef VK_KHR_descriptor_update_template
+DEFINE_ALIAS_FUNCTION(marshal_VkDescriptorUpdateTemplateEntry,
+                      marshal_VkDescriptorUpdateTemplateEntryKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkDescriptorUpdateTemplateEntry,
+                      unmarshal_VkDescriptorUpdateTemplateEntryKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkDescriptorUpdateTemplateCreateInfo,
+                      marshal_VkDescriptorUpdateTemplateCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkDescriptorUpdateTemplateCreateInfo,
+                      unmarshal_VkDescriptorUpdateTemplateCreateInfoKHR)
+
+#define OP_vkCreateDescriptorUpdateTemplateKHR 20222
+#define OP_vkDestroyDescriptorUpdateTemplateKHR 20223
+#define OP_vkUpdateDescriptorSetWithTemplateKHR 20224
+#endif
+#ifdef VK_KHR_imageless_framebuffer
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceImagelessFramebufferFeatures,
+                      marshal_VkPhysicalDeviceImagelessFramebufferFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceImagelessFramebufferFeatures,
+                      unmarshal_VkPhysicalDeviceImagelessFramebufferFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkFramebufferAttachmentsCreateInfo,
+                      marshal_VkFramebufferAttachmentsCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkFramebufferAttachmentsCreateInfo,
+                      unmarshal_VkFramebufferAttachmentsCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkFramebufferAttachmentImageInfo,
+                      marshal_VkFramebufferAttachmentImageInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkFramebufferAttachmentImageInfo,
+                      unmarshal_VkFramebufferAttachmentImageInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkRenderPassAttachmentBeginInfo,
+                      marshal_VkRenderPassAttachmentBeginInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkRenderPassAttachmentBeginInfo,
+                      unmarshal_VkRenderPassAttachmentBeginInfoKHR)
+
+#endif
+#ifdef VK_KHR_create_renderpass2
+DEFINE_ALIAS_FUNCTION(marshal_VkRenderPassCreateInfo2, marshal_VkRenderPassCreateInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkRenderPassCreateInfo2, unmarshal_VkRenderPassCreateInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkAttachmentDescription2, marshal_VkAttachmentDescription2KHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkAttachmentDescription2, unmarshal_VkAttachmentDescription2KHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkAttachmentReference2, marshal_VkAttachmentReference2KHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkAttachmentReference2, unmarshal_VkAttachmentReference2KHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkSubpassDescription2, marshal_VkSubpassDescription2KHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkSubpassDescription2, unmarshal_VkSubpassDescription2KHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkSubpassDependency2, marshal_VkSubpassDependency2KHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkSubpassDependency2, unmarshal_VkSubpassDependency2KHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkSubpassBeginInfo, marshal_VkSubpassBeginInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkSubpassBeginInfo, unmarshal_VkSubpassBeginInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkSubpassEndInfo, marshal_VkSubpassEndInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkSubpassEndInfo, unmarshal_VkSubpassEndInfoKHR)
+
+#define OP_vkCreateRenderPass2KHR 20225
+#define OP_vkCmdBeginRenderPass2KHR 20226
+#define OP_vkCmdNextSubpass2KHR 20227
+#define OP_vkCmdEndRenderPass2KHR 20228
+#endif
+#ifdef VK_KHR_shared_presentable_image
+void marshal_VkSharedPresentSurfaceCapabilitiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSharedPresentSurfaceCapabilitiesKHR* forMarshaling);
+
+void unmarshal_VkSharedPresentSurfaceCapabilitiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkSharedPresentSurfaceCapabilitiesKHR* forUnmarshaling);
+
+#define OP_vkGetSwapchainStatusKHR 20229
+#endif
+#ifdef VK_KHR_external_fence_capabilities
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceExternalFenceInfo,
+                      marshal_VkPhysicalDeviceExternalFenceInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceExternalFenceInfo,
+                      unmarshal_VkPhysicalDeviceExternalFenceInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkExternalFenceProperties, marshal_VkExternalFencePropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkExternalFenceProperties, unmarshal_VkExternalFencePropertiesKHR)
+
+#define OP_vkGetPhysicalDeviceExternalFencePropertiesKHR 20230
+#endif
+#ifdef VK_KHR_external_fence
+DEFINE_ALIAS_FUNCTION(marshal_VkExportFenceCreateInfo, marshal_VkExportFenceCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkExportFenceCreateInfo, unmarshal_VkExportFenceCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_external_fence_win32
+void marshal_VkImportFenceWin32HandleInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkImportFenceWin32HandleInfoKHR* forMarshaling);
+
+void unmarshal_VkImportFenceWin32HandleInfoKHR(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkImportFenceWin32HandleInfoKHR* forUnmarshaling);
+
+void marshal_VkExportFenceWin32HandleInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkExportFenceWin32HandleInfoKHR* forMarshaling);
+
+void unmarshal_VkExportFenceWin32HandleInfoKHR(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkExportFenceWin32HandleInfoKHR* forUnmarshaling);
+
+void marshal_VkFenceGetWin32HandleInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkFenceGetWin32HandleInfoKHR* forMarshaling);
+
+void unmarshal_VkFenceGetWin32HandleInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkFenceGetWin32HandleInfoKHR* forUnmarshaling);
+
+#define OP_vkImportFenceWin32HandleKHR 20231
+#define OP_vkGetFenceWin32HandleKHR 20232
+#endif
+#ifdef VK_KHR_external_fence_fd
+void marshal_VkImportFenceFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkImportFenceFdInfoKHR* forMarshaling);
+
+void unmarshal_VkImportFenceFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      VkImportFenceFdInfoKHR* forUnmarshaling);
+
+void marshal_VkFenceGetFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkFenceGetFdInfoKHR* forMarshaling);
+
+void unmarshal_VkFenceGetFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkFenceGetFdInfoKHR* forUnmarshaling);
+
+#define OP_vkImportFenceFdKHR 20233
+#define OP_vkGetFenceFdKHR 20234
+#endif
+#ifdef VK_KHR_performance_query
+void marshal_VkPhysicalDevicePerformanceQueryFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePerformanceQueryFeaturesKHR* forMarshaling);
+
+void unmarshal_VkPhysicalDevicePerformanceQueryFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevicePerformanceQueryFeaturesKHR* forUnmarshaling);
+
+void marshal_VkPhysicalDevicePerformanceQueryPropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePerformanceQueryPropertiesKHR* forMarshaling);
+
+void unmarshal_VkPhysicalDevicePerformanceQueryPropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevicePerformanceQueryPropertiesKHR* forUnmarshaling);
+
+void marshal_VkPerformanceCounterKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkPerformanceCounterKHR* forMarshaling);
+
+void unmarshal_VkPerformanceCounterKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkPerformanceCounterKHR* forUnmarshaling);
+
+void marshal_VkPerformanceCounterDescriptionKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPerformanceCounterDescriptionKHR* forMarshaling);
+
+void unmarshal_VkPerformanceCounterDescriptionKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPerformanceCounterDescriptionKHR* forUnmarshaling);
+
+void marshal_VkQueryPoolPerformanceCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkQueryPoolPerformanceCreateInfoKHR* forMarshaling);
+
+void unmarshal_VkQueryPoolPerformanceCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkQueryPoolPerformanceCreateInfoKHR* forUnmarshaling);
+
+void marshal_VkPerformanceCounterResultKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkPerformanceCounterResultKHR* forMarshaling);
+
+void unmarshal_VkPerformanceCounterResultKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkPerformanceCounterResultKHR* forUnmarshaling);
+
+void marshal_VkAcquireProfilingLockInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkAcquireProfilingLockInfoKHR* forMarshaling);
+
+void unmarshal_VkAcquireProfilingLockInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkAcquireProfilingLockInfoKHR* forUnmarshaling);
+
+void marshal_VkPerformanceQuerySubmitInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkPerformanceQuerySubmitInfoKHR* forMarshaling);
+
+void unmarshal_VkPerformanceQuerySubmitInfoKHR(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkPerformanceQuerySubmitInfoKHR* forUnmarshaling);
+
+#define OP_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR 299033148
+#define OP_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR 282029987
+#define OP_vkAcquireProfilingLockKHR 238952296
+#define OP_vkReleaseProfilingLockKHR 223904011
+#endif
+#ifdef VK_KHR_maintenance2
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDevicePointClippingProperties,
+                      marshal_VkPhysicalDevicePointClippingPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDevicePointClippingProperties,
+                      unmarshal_VkPhysicalDevicePointClippingPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkRenderPassInputAttachmentAspectCreateInfo,
+                      marshal_VkRenderPassInputAttachmentAspectCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkRenderPassInputAttachmentAspectCreateInfo,
+                      unmarshal_VkRenderPassInputAttachmentAspectCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkInputAttachmentAspectReference,
+                      marshal_VkInputAttachmentAspectReferenceKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkInputAttachmentAspectReference,
+                      unmarshal_VkInputAttachmentAspectReferenceKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkImageViewUsageCreateInfo, marshal_VkImageViewUsageCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkImageViewUsageCreateInfo, unmarshal_VkImageViewUsageCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkPipelineTessellationDomainOriginStateCreateInfo,
+                      marshal_VkPipelineTessellationDomainOriginStateCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPipelineTessellationDomainOriginStateCreateInfo,
+                      unmarshal_VkPipelineTessellationDomainOriginStateCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_get_surface_capabilities2
+void marshal_VkPhysicalDeviceSurfaceInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkPhysicalDeviceSurfaceInfo2KHR* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceSurfaceInfo2KHR(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkPhysicalDeviceSurfaceInfo2KHR* forUnmarshaling);
+
+void marshal_VkSurfaceCapabilities2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkSurfaceCapabilities2KHR* forMarshaling);
+
+void unmarshal_VkSurfaceCapabilities2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkSurfaceCapabilities2KHR* forUnmarshaling);
+
+void marshal_VkSurfaceFormat2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkSurfaceFormat2KHR* forMarshaling);
+
+void unmarshal_VkSurfaceFormat2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkSurfaceFormat2KHR* forUnmarshaling);
+
+#define OP_vkGetPhysicalDeviceSurfaceCapabilities2KHR 20235
+#define OP_vkGetPhysicalDeviceSurfaceFormats2KHR 20236
+#endif
+#ifdef VK_KHR_variable_pointers
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceVariablePointersFeatures,
+                      marshal_VkPhysicalDeviceVariablePointerFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceVariablePointersFeatures,
+                      unmarshal_VkPhysicalDeviceVariablePointerFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceVariablePointersFeatures,
+                      marshal_VkPhysicalDeviceVariablePointersFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceVariablePointersFeatures,
+                      unmarshal_VkPhysicalDeviceVariablePointersFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_get_display_properties2
+void marshal_VkDisplayProperties2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkDisplayProperties2KHR* forMarshaling);
+
+void unmarshal_VkDisplayProperties2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkDisplayProperties2KHR* forUnmarshaling);
+
+void marshal_VkDisplayPlaneProperties2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkDisplayPlaneProperties2KHR* forMarshaling);
+
+void unmarshal_VkDisplayPlaneProperties2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkDisplayPlaneProperties2KHR* forUnmarshaling);
+
+void marshal_VkDisplayModeProperties2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkDisplayModeProperties2KHR* forMarshaling);
+
+void unmarshal_VkDisplayModeProperties2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkDisplayModeProperties2KHR* forUnmarshaling);
+
+void marshal_VkDisplayPlaneInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkDisplayPlaneInfo2KHR* forMarshaling);
+
+void unmarshal_VkDisplayPlaneInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      VkDisplayPlaneInfo2KHR* forUnmarshaling);
+
+void marshal_VkDisplayPlaneCapabilities2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkDisplayPlaneCapabilities2KHR* forMarshaling);
+
+void unmarshal_VkDisplayPlaneCapabilities2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkDisplayPlaneCapabilities2KHR* forUnmarshaling);
+
+#define OP_vkGetPhysicalDeviceDisplayProperties2KHR 20237
+#define OP_vkGetPhysicalDeviceDisplayPlaneProperties2KHR 20238
+#define OP_vkGetDisplayModeProperties2KHR 20239
+#define OP_vkGetDisplayPlaneCapabilities2KHR 20240
+#endif
+#ifdef VK_KHR_dedicated_allocation
+DEFINE_ALIAS_FUNCTION(marshal_VkMemoryDedicatedRequirements,
+                      marshal_VkMemoryDedicatedRequirementsKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkMemoryDedicatedRequirements,
+                      unmarshal_VkMemoryDedicatedRequirementsKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkMemoryDedicatedAllocateInfo,
+                      marshal_VkMemoryDedicatedAllocateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkMemoryDedicatedAllocateInfo,
+                      unmarshal_VkMemoryDedicatedAllocateInfoKHR)
+
+#endif
+#ifdef VK_KHR_storage_buffer_storage_class
+#endif
+#ifdef VK_KHR_relaxed_block_layout
+#endif
+#ifdef VK_KHR_get_memory_requirements2
+DEFINE_ALIAS_FUNCTION(marshal_VkBufferMemoryRequirementsInfo2,
+                      marshal_VkBufferMemoryRequirementsInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkBufferMemoryRequirementsInfo2,
+                      unmarshal_VkBufferMemoryRequirementsInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkImageMemoryRequirementsInfo2,
+                      marshal_VkImageMemoryRequirementsInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkImageMemoryRequirementsInfo2,
+                      unmarshal_VkImageMemoryRequirementsInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkImageSparseMemoryRequirementsInfo2,
+                      marshal_VkImageSparseMemoryRequirementsInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkImageSparseMemoryRequirementsInfo2,
+                      unmarshal_VkImageSparseMemoryRequirementsInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkMemoryRequirements2, marshal_VkMemoryRequirements2KHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkMemoryRequirements2, unmarshal_VkMemoryRequirements2KHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkSparseImageMemoryRequirements2,
+                      marshal_VkSparseImageMemoryRequirements2KHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkSparseImageMemoryRequirements2,
+                      unmarshal_VkSparseImageMemoryRequirements2KHR)
+
+#define OP_vkGetImageMemoryRequirements2KHR 20241
+#define OP_vkGetBufferMemoryRequirements2KHR 20242
+#define OP_vkGetImageSparseMemoryRequirements2KHR 20243
+#endif
+#ifdef VK_KHR_image_format_list
+DEFINE_ALIAS_FUNCTION(marshal_VkImageFormatListCreateInfo, marshal_VkImageFormatListCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkImageFormatListCreateInfo,
+                      unmarshal_VkImageFormatListCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_sampler_ycbcr_conversion
+DEFINE_ALIAS_FUNCTION(marshal_VkSamplerYcbcrConversionCreateInfo,
+                      marshal_VkSamplerYcbcrConversionCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkSamplerYcbcrConversionCreateInfo,
+                      unmarshal_VkSamplerYcbcrConversionCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkSamplerYcbcrConversionInfo, marshal_VkSamplerYcbcrConversionInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkSamplerYcbcrConversionInfo,
+                      unmarshal_VkSamplerYcbcrConversionInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkBindImagePlaneMemoryInfo, marshal_VkBindImagePlaneMemoryInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkBindImagePlaneMemoryInfo, unmarshal_VkBindImagePlaneMemoryInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkImagePlaneMemoryRequirementsInfo,
+                      marshal_VkImagePlaneMemoryRequirementsInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkImagePlaneMemoryRequirementsInfo,
+                      unmarshal_VkImagePlaneMemoryRequirementsInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceSamplerYcbcrConversionFeatures,
+                      marshal_VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceSamplerYcbcrConversionFeatures,
+                      unmarshal_VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkSamplerYcbcrConversionImageFormatProperties,
+                      marshal_VkSamplerYcbcrConversionImageFormatPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkSamplerYcbcrConversionImageFormatProperties,
+                      unmarshal_VkSamplerYcbcrConversionImageFormatPropertiesKHR)
+
+#define OP_vkCreateSamplerYcbcrConversionKHR 20244
+#define OP_vkDestroySamplerYcbcrConversionKHR 20245
+#endif
+#ifdef VK_KHR_bind_memory2
+DEFINE_ALIAS_FUNCTION(marshal_VkBindBufferMemoryInfo, marshal_VkBindBufferMemoryInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkBindBufferMemoryInfo, unmarshal_VkBindBufferMemoryInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkBindImageMemoryInfo, marshal_VkBindImageMemoryInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkBindImageMemoryInfo, unmarshal_VkBindImageMemoryInfoKHR)
+
+#define OP_vkBindBufferMemory2KHR 20246
+#define OP_vkBindImageMemory2KHR 20247
+#endif
+#ifdef VK_KHR_portability_subset
+void marshal_VkPhysicalDevicePortabilitySubsetFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePortabilitySubsetFeaturesKHR* forMarshaling);
+
+void unmarshal_VkPhysicalDevicePortabilitySubsetFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevicePortabilitySubsetFeaturesKHR* forUnmarshaling);
+
+void marshal_VkPhysicalDevicePortabilitySubsetPropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePortabilitySubsetPropertiesKHR* forMarshaling);
+
+void unmarshal_VkPhysicalDevicePortabilitySubsetPropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevicePortabilitySubsetPropertiesKHR* forUnmarshaling);
+
+#endif
+#ifdef VK_KHR_maintenance3
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceMaintenance3Properties,
+                      marshal_VkPhysicalDeviceMaintenance3PropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceMaintenance3Properties,
+                      unmarshal_VkPhysicalDeviceMaintenance3PropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkDescriptorSetLayoutSupport, marshal_VkDescriptorSetLayoutSupportKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkDescriptorSetLayoutSupport,
+                      unmarshal_VkDescriptorSetLayoutSupportKHR)
+
+#define OP_vkGetDescriptorSetLayoutSupportKHR 20248
+#endif
+#ifdef VK_KHR_draw_indirect_count
+#define OP_vkCmdDrawIndirectCountKHR 20249
+#define OP_vkCmdDrawIndexedIndirectCountKHR 20250
+#endif
+#ifdef VK_KHR_shader_subgroup_extended_types
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures,
+                      marshal_VkPhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures,
+                      unmarshal_VkPhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_8bit_storage
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDevice8BitStorageFeatures,
+                      marshal_VkPhysicalDevice8BitStorageFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDevice8BitStorageFeatures,
+                      unmarshal_VkPhysicalDevice8BitStorageFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_shader_atomic_int64
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceShaderAtomicInt64Features,
+                      marshal_VkPhysicalDeviceShaderAtomicInt64FeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceShaderAtomicInt64Features,
+                      unmarshal_VkPhysicalDeviceShaderAtomicInt64FeaturesKHR)
+
+#endif
+#ifdef VK_KHR_shader_clock
+void marshal_VkPhysicalDeviceShaderClockFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderClockFeaturesKHR* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceShaderClockFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderClockFeaturesKHR* forUnmarshaling);
+
+#endif
+#ifdef VK_KHR_driver_properties
+DEFINE_ALIAS_FUNCTION(marshal_VkConformanceVersion, marshal_VkConformanceVersionKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkConformanceVersion, unmarshal_VkConformanceVersionKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceDriverProperties,
+                      marshal_VkPhysicalDeviceDriverPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceDriverProperties,
+                      unmarshal_VkPhysicalDeviceDriverPropertiesKHR)
+
+#endif
+#ifdef VK_KHR_shader_float_controls
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceFloatControlsProperties,
+                      marshal_VkPhysicalDeviceFloatControlsPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceFloatControlsProperties,
+                      unmarshal_VkPhysicalDeviceFloatControlsPropertiesKHR)
+
+#endif
+#ifdef VK_KHR_depth_stencil_resolve
+DEFINE_ALIAS_FUNCTION(marshal_VkSubpassDescriptionDepthStencilResolve,
+                      marshal_VkSubpassDescriptionDepthStencilResolveKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkSubpassDescriptionDepthStencilResolve,
+                      unmarshal_VkSubpassDescriptionDepthStencilResolveKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceDepthStencilResolveProperties,
+                      marshal_VkPhysicalDeviceDepthStencilResolvePropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceDepthStencilResolveProperties,
+                      unmarshal_VkPhysicalDeviceDepthStencilResolvePropertiesKHR)
+
+#endif
+#ifdef VK_KHR_swapchain_mutable_format
+#endif
+#ifdef VK_KHR_timeline_semaphore
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceTimelineSemaphoreFeatures,
+                      marshal_VkPhysicalDeviceTimelineSemaphoreFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceTimelineSemaphoreFeatures,
+                      unmarshal_VkPhysicalDeviceTimelineSemaphoreFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceTimelineSemaphoreProperties,
+                      marshal_VkPhysicalDeviceTimelineSemaphorePropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceTimelineSemaphoreProperties,
+                      unmarshal_VkPhysicalDeviceTimelineSemaphorePropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkSemaphoreTypeCreateInfo, marshal_VkSemaphoreTypeCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkSemaphoreTypeCreateInfo, unmarshal_VkSemaphoreTypeCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkTimelineSemaphoreSubmitInfo,
+                      marshal_VkTimelineSemaphoreSubmitInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkTimelineSemaphoreSubmitInfo,
+                      unmarshal_VkTimelineSemaphoreSubmitInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkSemaphoreWaitInfo, marshal_VkSemaphoreWaitInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkSemaphoreWaitInfo, unmarshal_VkSemaphoreWaitInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkSemaphoreSignalInfo, marshal_VkSemaphoreSignalInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkSemaphoreSignalInfo, unmarshal_VkSemaphoreSignalInfoKHR)
+
+#define OP_vkGetSemaphoreCounterValueKHR 229059496
+#define OP_vkWaitSemaphoresKHR 263904357
+#define OP_vkSignalSemaphoreKHR 269919108
+#endif
+#ifdef VK_KHR_vulkan_memory_model
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceVulkanMemoryModelFeatures,
+                      marshal_VkPhysicalDeviceVulkanMemoryModelFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceVulkanMemoryModelFeatures,
+                      unmarshal_VkPhysicalDeviceVulkanMemoryModelFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_shader_terminate_invocation
+void marshal_VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR* forUnmarshaling);
+
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+void marshal_VkFragmentShadingRateAttachmentInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkFragmentShadingRateAttachmentInfoKHR* forMarshaling);
+
+void unmarshal_VkFragmentShadingRateAttachmentInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkFragmentShadingRateAttachmentInfoKHR* forUnmarshaling);
+
+void marshal_VkPipelineFragmentShadingRateStateCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineFragmentShadingRateStateCreateInfoKHR* forMarshaling);
+
+void unmarshal_VkPipelineFragmentShadingRateStateCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineFragmentShadingRateStateCreateInfoKHR* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceFragmentShadingRateFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateFeaturesKHR* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceFragmentShadingRateFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceFragmentShadingRateFeaturesKHR* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceFragmentShadingRatePropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRatePropertiesKHR* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceFragmentShadingRatePropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceFragmentShadingRatePropertiesKHR* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceFragmentShadingRateKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateKHR* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceFragmentShadingRateKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceFragmentShadingRateKHR* forUnmarshaling);
+
+#define OP_vkGetPhysicalDeviceFragmentShadingRatesKHR 272978593
+#define OP_vkCmdSetFragmentShadingRateKHR 204060280
+#endif
+#ifdef VK_KHR_spirv_1_4
+#endif
+#ifdef VK_KHR_surface_protected_capabilities
+void marshal_VkSurfaceProtectedCapabilitiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSurfaceProtectedCapabilitiesKHR* forMarshaling);
+
+void unmarshal_VkSurfaceProtectedCapabilitiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkSurfaceProtectedCapabilitiesKHR* forUnmarshaling);
+
+#endif
+#ifdef VK_KHR_separate_depth_stencil_layouts
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures,
+                      marshal_VkPhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures,
+                      unmarshal_VkPhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkAttachmentReferenceStencilLayout,
+                      marshal_VkAttachmentReferenceStencilLayoutKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkAttachmentReferenceStencilLayout,
+                      unmarshal_VkAttachmentReferenceStencilLayoutKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkAttachmentDescriptionStencilLayout,
+                      marshal_VkAttachmentDescriptionStencilLayoutKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkAttachmentDescriptionStencilLayout,
+                      unmarshal_VkAttachmentDescriptionStencilLayoutKHR)
+
+#endif
+#ifdef VK_KHR_present_wait
+void marshal_VkPhysicalDevicePresentWaitFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePresentWaitFeaturesKHR* forMarshaling);
+
+void unmarshal_VkPhysicalDevicePresentWaitFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevicePresentWaitFeaturesKHR* forUnmarshaling);
+
+#define OP_vkWaitForPresentKHR 263215580
+#endif
+#ifdef VK_KHR_uniform_buffer_standard_layout
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceUniformBufferStandardLayoutFeatures,
+                      marshal_VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceUniformBufferStandardLayoutFeatures,
+                      unmarshal_VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_buffer_device_address
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceBufferDeviceAddressFeatures,
+                      marshal_VkPhysicalDeviceBufferDeviceAddressFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceBufferDeviceAddressFeatures,
+                      unmarshal_VkPhysicalDeviceBufferDeviceAddressFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkBufferDeviceAddressInfo, marshal_VkBufferDeviceAddressInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkBufferDeviceAddressInfo, unmarshal_VkBufferDeviceAddressInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkBufferOpaqueCaptureAddressCreateInfo,
+                      marshal_VkBufferOpaqueCaptureAddressCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkBufferOpaqueCaptureAddressCreateInfo,
+                      unmarshal_VkBufferOpaqueCaptureAddressCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkMemoryOpaqueCaptureAddressAllocateInfo,
+                      marshal_VkMemoryOpaqueCaptureAddressAllocateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkMemoryOpaqueCaptureAddressAllocateInfo,
+                      unmarshal_VkMemoryOpaqueCaptureAddressAllocateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkDeviceMemoryOpaqueCaptureAddressInfo,
+                      marshal_VkDeviceMemoryOpaqueCaptureAddressInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkDeviceMemoryOpaqueCaptureAddressInfo,
+                      unmarshal_VkDeviceMemoryOpaqueCaptureAddressInfoKHR)
+
+#define OP_vkGetBufferDeviceAddressKHR 219261480
+#define OP_vkGetBufferOpaqueCaptureAddressKHR 285631711
+#define OP_vkGetDeviceMemoryOpaqueCaptureAddressKHR 294671624
+#endif
+#ifdef VK_KHR_deferred_host_operations
+#define OP_vkCreateDeferredOperationKHR 274342644
+#define OP_vkDestroyDeferredOperationKHR 215419514
+#define OP_vkGetDeferredOperationMaxConcurrencyKHR 203387076
+#define OP_vkGetDeferredOperationResultKHR 263822960
+#define OP_vkDeferredOperationJoinKHR 218492930
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+void marshal_VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR* forMarshaling);
+
+void unmarshal_VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR* forUnmarshaling);
+
+void marshal_VkPipelineInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               const VkPipelineInfoKHR* forMarshaling);
+
+void unmarshal_VkPipelineInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 VkPipelineInfoKHR* forUnmarshaling);
+
+void marshal_VkPipelineExecutablePropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineExecutablePropertiesKHR* forMarshaling);
+
+void unmarshal_VkPipelineExecutablePropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineExecutablePropertiesKHR* forUnmarshaling);
+
+void marshal_VkPipelineExecutableInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkPipelineExecutableInfoKHR* forMarshaling);
+
+void unmarshal_VkPipelineExecutableInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkPipelineExecutableInfoKHR* forUnmarshaling);
+
+void marshal_VkPipelineExecutableStatisticValueKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineExecutableStatisticValueKHR* forMarshaling);
+
+void unmarshal_VkPipelineExecutableStatisticValueKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineExecutableStatisticValueKHR* forUnmarshaling);
+
+void marshal_VkPipelineExecutableStatisticKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineExecutableStatisticKHR* forMarshaling);
+
+void unmarshal_VkPipelineExecutableStatisticKHR(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkPipelineExecutableStatisticKHR* forUnmarshaling);
+
+void marshal_VkPipelineExecutableInternalRepresentationKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineExecutableInternalRepresentationKHR* forMarshaling);
+
+void unmarshal_VkPipelineExecutableInternalRepresentationKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineExecutableInternalRepresentationKHR* forUnmarshaling);
+
+#define OP_vkGetPipelineExecutablePropertiesKHR 269458798
+#define OP_vkGetPipelineExecutableStatisticsKHR 271191699
+#define OP_vkGetPipelineExecutableInternalRepresentationsKHR 274148497
+#endif
+#ifdef VK_KHR_shader_integer_dot_product
+void marshal_VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR* forUnmarshaling);
+
+#endif
+#ifdef VK_KHR_pipeline_library
+void marshal_VkPipelineLibraryCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkPipelineLibraryCreateInfoKHR* forMarshaling);
+
+void unmarshal_VkPipelineLibraryCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkPipelineLibraryCreateInfoKHR* forUnmarshaling);
+
+#endif
+#ifdef VK_KHR_shader_non_semantic_info
+#endif
+#ifdef VK_KHR_present_id
+void marshal_VkPresentIdKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                            const VkPresentIdKHR* forMarshaling);
+
+void unmarshal_VkPresentIdKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                              VkPresentIdKHR* forUnmarshaling);
+
+void marshal_VkPhysicalDevicePresentIdFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePresentIdFeaturesKHR* forMarshaling);
+
+void unmarshal_VkPhysicalDevicePresentIdFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevicePresentIdFeaturesKHR* forUnmarshaling);
+
+#endif
+#ifdef VK_KHR_video_encode_queue
+void marshal_VkVideoEncodeInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkVideoEncodeInfoKHR* forMarshaling);
+
+void unmarshal_VkVideoEncodeInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkVideoEncodeInfoKHR* forUnmarshaling);
+
+void marshal_VkVideoEncodeRateControlInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkVideoEncodeRateControlInfoKHR* forMarshaling);
+
+void unmarshal_VkVideoEncodeRateControlInfoKHR(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkVideoEncodeRateControlInfoKHR* forUnmarshaling);
+
+#define OP_vkCmdEncodeVideoKHR 295869356
+#endif
+#ifdef VK_KHR_synchronization2
+void marshal_VkMemoryBarrier2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkMemoryBarrier2KHR* forMarshaling);
+
+void unmarshal_VkMemoryBarrier2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkMemoryBarrier2KHR* forUnmarshaling);
+
+void marshal_VkBufferMemoryBarrier2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkBufferMemoryBarrier2KHR* forMarshaling);
+
+void unmarshal_VkBufferMemoryBarrier2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkBufferMemoryBarrier2KHR* forUnmarshaling);
+
+void marshal_VkImageMemoryBarrier2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkImageMemoryBarrier2KHR* forMarshaling);
+
+void unmarshal_VkImageMemoryBarrier2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkImageMemoryBarrier2KHR* forUnmarshaling);
+
+void marshal_VkDependencyInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkDependencyInfoKHR* forMarshaling);
+
+void unmarshal_VkDependencyInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkDependencyInfoKHR* forUnmarshaling);
+
+void marshal_VkSemaphoreSubmitInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkSemaphoreSubmitInfoKHR* forMarshaling);
+
+void unmarshal_VkSemaphoreSubmitInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkSemaphoreSubmitInfoKHR* forUnmarshaling);
+
+void marshal_VkCommandBufferSubmitInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkCommandBufferSubmitInfoKHR* forMarshaling);
+
+void unmarshal_VkCommandBufferSubmitInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkCommandBufferSubmitInfoKHR* forUnmarshaling);
+
+void marshal_VkSubmitInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                              const VkSubmitInfo2KHR* forMarshaling);
+
+void unmarshal_VkSubmitInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                VkSubmitInfo2KHR* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceSynchronization2FeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSynchronization2FeaturesKHR* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceSynchronization2FeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceSynchronization2FeaturesKHR* forUnmarshaling);
+
+#define OP_vkCmdSetEvent2KHR 270411360
+#define OP_vkCmdResetEvent2KHR 283215906
+#define OP_vkCmdWaitEvents2KHR 244967758
+#define OP_vkCmdPipelineBarrier2KHR 201310066
+#define OP_vkCmdWriteTimestamp2KHR 252552241
+#define OP_vkQueueSubmit2KHR 293024240
+#define OP_vkCmdWriteBufferMarker2AMD 224701394
+void marshal_VkQueueFamilyCheckpointProperties2NV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkQueueFamilyCheckpointProperties2NV* forMarshaling);
+
+void unmarshal_VkQueueFamilyCheckpointProperties2NV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkQueueFamilyCheckpointProperties2NV* forUnmarshaling);
+
+void marshal_VkCheckpointData2NV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkCheckpointData2NV* forMarshaling);
+
+void unmarshal_VkCheckpointData2NV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkCheckpointData2NV* forUnmarshaling);
+
+#define OP_vkGetQueueCheckpointData2NV 292063036
+#endif
+#ifdef VK_KHR_shader_subgroup_uniform_control_flow
+void marshal_VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR* forUnmarshaling);
+
+#endif
+#ifdef VK_KHR_zero_initialize_workgroup_memory
+void marshal_VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR* forUnmarshaling);
+
+#endif
+#ifdef VK_KHR_workgroup_memory_explicit_layout
+void marshal_VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR* forUnmarshaling);
+
+#endif
+#ifdef VK_KHR_copy_commands2
+void marshal_VkBufferCopy2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                              const VkBufferCopy2KHR* forMarshaling);
+
+void unmarshal_VkBufferCopy2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                VkBufferCopy2KHR* forUnmarshaling);
+
+void marshal_VkCopyBufferInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkCopyBufferInfo2KHR* forMarshaling);
+
+void unmarshal_VkCopyBufferInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkCopyBufferInfo2KHR* forUnmarshaling);
+
+void marshal_VkImageCopy2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                             const VkImageCopy2KHR* forMarshaling);
+
+void unmarshal_VkImageCopy2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               VkImageCopy2KHR* forUnmarshaling);
+
+void marshal_VkCopyImageInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkCopyImageInfo2KHR* forMarshaling);
+
+void unmarshal_VkCopyImageInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkCopyImageInfo2KHR* forUnmarshaling);
+
+void marshal_VkBufferImageCopy2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkBufferImageCopy2KHR* forMarshaling);
+
+void unmarshal_VkBufferImageCopy2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkBufferImageCopy2KHR* forUnmarshaling);
+
+void marshal_VkCopyBufferToImageInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkCopyBufferToImageInfo2KHR* forMarshaling);
+
+void unmarshal_VkCopyBufferToImageInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkCopyBufferToImageInfo2KHR* forUnmarshaling);
+
+void marshal_VkCopyImageToBufferInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkCopyImageToBufferInfo2KHR* forMarshaling);
+
+void unmarshal_VkCopyImageToBufferInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkCopyImageToBufferInfo2KHR* forUnmarshaling);
+
+void marshal_VkImageBlit2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                             const VkImageBlit2KHR* forMarshaling);
+
+void unmarshal_VkImageBlit2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               VkImageBlit2KHR* forUnmarshaling);
+
+void marshal_VkBlitImageInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkBlitImageInfo2KHR* forMarshaling);
+
+void unmarshal_VkBlitImageInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkBlitImageInfo2KHR* forUnmarshaling);
+
+void marshal_VkImageResolve2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkImageResolve2KHR* forMarshaling);
+
+void unmarshal_VkImageResolve2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkImageResolve2KHR* forUnmarshaling);
+
+void marshal_VkResolveImageInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkResolveImageInfo2KHR* forMarshaling);
+
+void unmarshal_VkResolveImageInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      VkResolveImageInfo2KHR* forUnmarshaling);
+
+#define OP_vkCmdCopyBuffer2KHR 247893766
+#define OP_vkCmdCopyImage2KHR 227008250
+#define OP_vkCmdCopyBufferToImage2KHR 248841963
+#define OP_vkCmdCopyImageToBuffer2KHR 252249060
+#define OP_vkCmdBlitImage2KHR 259838288
+#define OP_vkCmdResolveImage2KHR 254857232
+#endif
+#ifdef VK_KHR_format_feature_flags2
+void marshal_VkFormatProperties3KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkFormatProperties3KHR* forMarshaling);
+
+void unmarshal_VkFormatProperties3KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      VkFormatProperties3KHR* forUnmarshaling);
+
+#endif
+#ifdef VK_KHR_maintenance4
+void marshal_VkPhysicalDeviceMaintenance4FeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMaintenance4FeaturesKHR* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceMaintenance4FeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceMaintenance4FeaturesKHR* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceMaintenance4PropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMaintenance4PropertiesKHR* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceMaintenance4PropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceMaintenance4PropertiesKHR* forUnmarshaling);
+
+void marshal_VkDeviceBufferMemoryRequirementsKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceBufferMemoryRequirementsKHR* forMarshaling);
+
+void unmarshal_VkDeviceBufferMemoryRequirementsKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDeviceBufferMemoryRequirementsKHR* forUnmarshaling);
+
+void marshal_VkDeviceImageMemoryRequirementsKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceImageMemoryRequirementsKHR* forMarshaling);
+
+void unmarshal_VkDeviceImageMemoryRequirementsKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDeviceImageMemoryRequirementsKHR* forUnmarshaling);
+
+#define OP_vkGetDeviceBufferMemoryRequirementsKHR 201613635
+#define OP_vkGetDeviceImageMemoryRequirementsKHR 243155021
+#define OP_vkGetDeviceImageSparseMemoryRequirementsKHR 275585477
+#endif
+#ifdef VK_ANDROID_native_buffer
+void marshal_VkNativeBufferANDROID(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkNativeBufferANDROID* forMarshaling);
+
+void unmarshal_VkNativeBufferANDROID(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkNativeBufferANDROID* forUnmarshaling);
+
+#define OP_vkGetSwapchainGrallocUsageANDROID 20251
+#define OP_vkAcquireImageANDROID 20252
+#define OP_vkQueueSignalReleaseImageANDROID 20253
+#endif
+#ifdef VK_EXT_debug_report
+void marshal_VkDebugReportCallbackCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDebugReportCallbackCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkDebugReportCallbackCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDebugReportCallbackCreateInfoEXT* forUnmarshaling);
+
+#define OP_vkCreateDebugReportCallbackEXT 20254
+#define OP_vkDestroyDebugReportCallbackEXT 20255
+#define OP_vkDebugReportMessageEXT 20256
+#endif
+#ifdef VK_NV_glsl_shader
+#endif
+#ifdef VK_EXT_depth_range_unrestricted
+#endif
+#ifdef VK_IMG_filter_cubic
+#endif
+#ifdef VK_AMD_rasterization_order
+void marshal_VkPipelineRasterizationStateRasterizationOrderAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRasterizationStateRasterizationOrderAMD* forMarshaling);
+
+void unmarshal_VkPipelineRasterizationStateRasterizationOrderAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineRasterizationStateRasterizationOrderAMD* forUnmarshaling);
+
+#endif
+#ifdef VK_AMD_shader_trinary_minmax
+#endif
+#ifdef VK_AMD_shader_explicit_vertex_parameter
+#endif
+#ifdef VK_EXT_debug_marker
+void marshal_VkDebugMarkerObjectNameInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkDebugMarkerObjectNameInfoEXT* forMarshaling);
+
+void unmarshal_VkDebugMarkerObjectNameInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkDebugMarkerObjectNameInfoEXT* forUnmarshaling);
+
+void marshal_VkDebugMarkerObjectTagInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkDebugMarkerObjectTagInfoEXT* forMarshaling);
+
+void unmarshal_VkDebugMarkerObjectTagInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkDebugMarkerObjectTagInfoEXT* forUnmarshaling);
+
+void marshal_VkDebugMarkerMarkerInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkDebugMarkerMarkerInfoEXT* forMarshaling);
+
+void unmarshal_VkDebugMarkerMarkerInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkDebugMarkerMarkerInfoEXT* forUnmarshaling);
+
+#define OP_vkDebugMarkerSetObjectTagEXT 20257
+#define OP_vkDebugMarkerSetObjectNameEXT 20258
+#define OP_vkCmdDebugMarkerBeginEXT 20259
+#define OP_vkCmdDebugMarkerEndEXT 20260
+#define OP_vkCmdDebugMarkerInsertEXT 20261
+#endif
+#ifdef VK_AMD_gcn_shader
+#endif
+#ifdef VK_NV_dedicated_allocation
+void marshal_VkDedicatedAllocationImageCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDedicatedAllocationImageCreateInfoNV* forMarshaling);
+
+void unmarshal_VkDedicatedAllocationImageCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDedicatedAllocationImageCreateInfoNV* forUnmarshaling);
+
+void marshal_VkDedicatedAllocationBufferCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDedicatedAllocationBufferCreateInfoNV* forMarshaling);
+
+void unmarshal_VkDedicatedAllocationBufferCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDedicatedAllocationBufferCreateInfoNV* forUnmarshaling);
+
+void marshal_VkDedicatedAllocationMemoryAllocateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDedicatedAllocationMemoryAllocateInfoNV* forMarshaling);
+
+void unmarshal_VkDedicatedAllocationMemoryAllocateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDedicatedAllocationMemoryAllocateInfoNV* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_transform_feedback
+void marshal_VkPhysicalDeviceTransformFeedbackFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceTransformFeedbackFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceTransformFeedbackFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceTransformFeedbackFeaturesEXT* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceTransformFeedbackPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceTransformFeedbackPropertiesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceTransformFeedbackPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceTransformFeedbackPropertiesEXT* forUnmarshaling);
+
+void marshal_VkPipelineRasterizationStateStreamCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRasterizationStateStreamCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkPipelineRasterizationStateStreamCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineRasterizationStateStreamCreateInfoEXT* forUnmarshaling);
+
+#define OP_vkCmdBindTransformFeedbackBuffersEXT 267779978
+#define OP_vkCmdBeginTransformFeedbackEXT 294396901
+#define OP_vkCmdEndTransformFeedbackEXT 272333731
+#define OP_vkCmdBeginQueryIndexedEXT 275810601
+#define OP_vkCmdEndQueryIndexedEXT 279821337
+#define OP_vkCmdDrawIndirectByteCountEXT 285235943
+#endif
+#ifdef VK_NVX_binary_import
+void marshal_VkCuModuleCreateInfoNVX(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkCuModuleCreateInfoNVX* forMarshaling);
+
+void unmarshal_VkCuModuleCreateInfoNVX(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkCuModuleCreateInfoNVX* forUnmarshaling);
+
+void marshal_VkCuFunctionCreateInfoNVX(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkCuFunctionCreateInfoNVX* forMarshaling);
+
+void unmarshal_VkCuFunctionCreateInfoNVX(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkCuFunctionCreateInfoNVX* forUnmarshaling);
+
+void marshal_VkCuLaunchInfoNVX(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                               const VkCuLaunchInfoNVX* forMarshaling);
+
+void unmarshal_VkCuLaunchInfoNVX(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 VkCuLaunchInfoNVX* forUnmarshaling);
+
+#define OP_vkCreateCuModuleNVX 227747396
+#define OP_vkCreateCuFunctionNVX 207930440
+#define OP_vkDestroyCuModuleNVX 273754594
+#define OP_vkDestroyCuFunctionNVX 253295828
+#define OP_vkCmdCuLaunchKernelNVX 219961351
+#endif
+#ifdef VK_NVX_image_view_handle
+void marshal_VkImageViewHandleInfoNVX(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkImageViewHandleInfoNVX* forMarshaling);
+
+void unmarshal_VkImageViewHandleInfoNVX(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkImageViewHandleInfoNVX* forUnmarshaling);
+
+void marshal_VkImageViewAddressPropertiesNVX(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkImageViewAddressPropertiesNVX* forMarshaling);
+
+void unmarshal_VkImageViewAddressPropertiesNVX(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkImageViewAddressPropertiesNVX* forUnmarshaling);
+
+#define OP_vkGetImageViewHandleNVX 204379647
+#define OP_vkGetImageViewAddressNVX 210668576
+#endif
+#ifdef VK_AMD_draw_indirect_count
+#define OP_vkCmdDrawIndirectCountAMD 20262
+#define OP_vkCmdDrawIndexedIndirectCountAMD 20263
+#endif
+#ifdef VK_AMD_negative_viewport_height
+#endif
+#ifdef VK_AMD_gpu_shader_half_float
+#endif
+#ifdef VK_AMD_shader_ballot
+#endif
+#ifdef VK_EXT_video_encode_h264
+void marshal_VkVideoEncodeH264CapabilitiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH264CapabilitiesEXT* forMarshaling);
+
+void unmarshal_VkVideoEncodeH264CapabilitiesEXT(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkVideoEncodeH264CapabilitiesEXT* forUnmarshaling);
+
+void marshal_VkVideoEncodeH264SessionCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH264SessionCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkVideoEncodeH264SessionCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoEncodeH264SessionCreateInfoEXT* forUnmarshaling);
+
+void marshal_VkVideoEncodeH264SessionParametersAddInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH264SessionParametersAddInfoEXT* forMarshaling);
+
+void unmarshal_VkVideoEncodeH264SessionParametersAddInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoEncodeH264SessionParametersAddInfoEXT* forUnmarshaling);
+
+void marshal_VkVideoEncodeH264SessionParametersCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH264SessionParametersCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkVideoEncodeH264SessionParametersCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoEncodeH264SessionParametersCreateInfoEXT* forUnmarshaling);
+
+void marshal_VkVideoEncodeH264DpbSlotInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkVideoEncodeH264DpbSlotInfoEXT* forMarshaling);
+
+void unmarshal_VkVideoEncodeH264DpbSlotInfoEXT(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkVideoEncodeH264DpbSlotInfoEXT* forUnmarshaling);
+
+void marshal_VkVideoEncodeH264NaluSliceEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkVideoEncodeH264NaluSliceEXT* forMarshaling);
+
+void unmarshal_VkVideoEncodeH264NaluSliceEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkVideoEncodeH264NaluSliceEXT* forUnmarshaling);
+
+void marshal_VkVideoEncodeH264VclFrameInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH264VclFrameInfoEXT* forMarshaling);
+
+void unmarshal_VkVideoEncodeH264VclFrameInfoEXT(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkVideoEncodeH264VclFrameInfoEXT* forUnmarshaling);
+
+void marshal_VkVideoEncodeH264EmitPictureParametersEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH264EmitPictureParametersEXT* forMarshaling);
+
+void unmarshal_VkVideoEncodeH264EmitPictureParametersEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoEncodeH264EmitPictureParametersEXT* forUnmarshaling);
+
+void marshal_VkVideoEncodeH264ProfileEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkVideoEncodeH264ProfileEXT* forMarshaling);
+
+void unmarshal_VkVideoEncodeH264ProfileEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkVideoEncodeH264ProfileEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_video_encode_h265
+void marshal_VkVideoEncodeH265CapabilitiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265CapabilitiesEXT* forMarshaling);
+
+void unmarshal_VkVideoEncodeH265CapabilitiesEXT(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkVideoEncodeH265CapabilitiesEXT* forUnmarshaling);
+
+void marshal_VkVideoEncodeH265SessionCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265SessionCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkVideoEncodeH265SessionCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoEncodeH265SessionCreateInfoEXT* forUnmarshaling);
+
+void marshal_VkVideoEncodeH265SessionParametersAddInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265SessionParametersAddInfoEXT* forMarshaling);
+
+void unmarshal_VkVideoEncodeH265SessionParametersAddInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoEncodeH265SessionParametersAddInfoEXT* forUnmarshaling);
+
+void marshal_VkVideoEncodeH265SessionParametersCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265SessionParametersCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkVideoEncodeH265SessionParametersCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoEncodeH265SessionParametersCreateInfoEXT* forUnmarshaling);
+
+void marshal_VkVideoEncodeH265DpbSlotInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkVideoEncodeH265DpbSlotInfoEXT* forMarshaling);
+
+void unmarshal_VkVideoEncodeH265DpbSlotInfoEXT(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkVideoEncodeH265DpbSlotInfoEXT* forUnmarshaling);
+
+void marshal_VkVideoEncodeH265ReferenceListsEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265ReferenceListsEXT* forMarshaling);
+
+void unmarshal_VkVideoEncodeH265ReferenceListsEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoEncodeH265ReferenceListsEXT* forUnmarshaling);
+
+void marshal_VkVideoEncodeH265NaluSliceEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkVideoEncodeH265NaluSliceEXT* forMarshaling);
+
+void unmarshal_VkVideoEncodeH265NaluSliceEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkVideoEncodeH265NaluSliceEXT* forUnmarshaling);
+
+void marshal_VkVideoEncodeH265VclFrameInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265VclFrameInfoEXT* forMarshaling);
+
+void unmarshal_VkVideoEncodeH265VclFrameInfoEXT(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkVideoEncodeH265VclFrameInfoEXT* forUnmarshaling);
+
+void marshal_VkVideoEncodeH265EmitPictureParametersEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265EmitPictureParametersEXT* forMarshaling);
+
+void unmarshal_VkVideoEncodeH265EmitPictureParametersEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoEncodeH265EmitPictureParametersEXT* forUnmarshaling);
+
+void marshal_VkVideoEncodeH265ProfileEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkVideoEncodeH265ProfileEXT* forMarshaling);
+
+void unmarshal_VkVideoEncodeH265ProfileEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkVideoEncodeH265ProfileEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_video_decode_h264
+void marshal_VkVideoDecodeH264ProfileEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkVideoDecodeH264ProfileEXT* forMarshaling);
+
+void unmarshal_VkVideoDecodeH264ProfileEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkVideoDecodeH264ProfileEXT* forUnmarshaling);
+
+void marshal_VkVideoDecodeH264CapabilitiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH264CapabilitiesEXT* forMarshaling);
+
+void unmarshal_VkVideoDecodeH264CapabilitiesEXT(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkVideoDecodeH264CapabilitiesEXT* forUnmarshaling);
+
+void marshal_VkVideoDecodeH264SessionCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH264SessionCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkVideoDecodeH264SessionCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoDecodeH264SessionCreateInfoEXT* forUnmarshaling);
+
+void marshal_VkVideoDecodeH264SessionParametersAddInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH264SessionParametersAddInfoEXT* forMarshaling);
+
+void unmarshal_VkVideoDecodeH264SessionParametersAddInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoDecodeH264SessionParametersAddInfoEXT* forUnmarshaling);
+
+void marshal_VkVideoDecodeH264SessionParametersCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH264SessionParametersCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkVideoDecodeH264SessionParametersCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoDecodeH264SessionParametersCreateInfoEXT* forUnmarshaling);
+
+void marshal_VkVideoDecodeH264PictureInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkVideoDecodeH264PictureInfoEXT* forMarshaling);
+
+void unmarshal_VkVideoDecodeH264PictureInfoEXT(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkVideoDecodeH264PictureInfoEXT* forUnmarshaling);
+
+void marshal_VkVideoDecodeH264MvcEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkVideoDecodeH264MvcEXT* forMarshaling);
+
+void unmarshal_VkVideoDecodeH264MvcEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkVideoDecodeH264MvcEXT* forUnmarshaling);
+
+void marshal_VkVideoDecodeH264DpbSlotInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkVideoDecodeH264DpbSlotInfoEXT* forMarshaling);
+
+void unmarshal_VkVideoDecodeH264DpbSlotInfoEXT(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkVideoDecodeH264DpbSlotInfoEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_AMD_texture_gather_bias_lod
+void marshal_VkTextureLODGatherFormatPropertiesAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkTextureLODGatherFormatPropertiesAMD* forMarshaling);
+
+void unmarshal_VkTextureLODGatherFormatPropertiesAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkTextureLODGatherFormatPropertiesAMD* forUnmarshaling);
+
+#endif
+#ifdef VK_AMD_shader_info
+void marshal_VkShaderResourceUsageAMD(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkShaderResourceUsageAMD* forMarshaling);
+
+void unmarshal_VkShaderResourceUsageAMD(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkShaderResourceUsageAMD* forUnmarshaling);
+
+void marshal_VkShaderStatisticsInfoAMD(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkShaderStatisticsInfoAMD* forMarshaling);
+
+void unmarshal_VkShaderStatisticsInfoAMD(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkShaderStatisticsInfoAMD* forUnmarshaling);
+
+#define OP_vkGetShaderInfoAMD 20264
+#endif
+#ifdef VK_AMD_shader_image_load_store_lod
+#endif
+#ifdef VK_GGP_stream_descriptor_surface
+void marshal_VkStreamDescriptorSurfaceCreateInfoGGP(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkStreamDescriptorSurfaceCreateInfoGGP* forMarshaling);
+
+void unmarshal_VkStreamDescriptorSurfaceCreateInfoGGP(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkStreamDescriptorSurfaceCreateInfoGGP* forUnmarshaling);
+
+#define OP_vkCreateStreamDescriptorSurfaceGGP 241902685
+#endif
+#ifdef VK_NV_corner_sampled_image
+void marshal_VkPhysicalDeviceCornerSampledImageFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceCornerSampledImageFeaturesNV* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceCornerSampledImageFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceCornerSampledImageFeaturesNV* forUnmarshaling);
+
+#endif
+#ifdef VK_IMG_format_pvrtc
+#endif
+#ifdef VK_NV_external_memory_capabilities
+void marshal_VkExternalImageFormatPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExternalImageFormatPropertiesNV* forMarshaling);
+
+void unmarshal_VkExternalImageFormatPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkExternalImageFormatPropertiesNV* forUnmarshaling);
+
+#define OP_vkGetPhysicalDeviceExternalImageFormatPropertiesNV 20265
+#endif
+#ifdef VK_NV_external_memory
+void marshal_VkExternalMemoryImageCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExternalMemoryImageCreateInfoNV* forMarshaling);
+
+void unmarshal_VkExternalMemoryImageCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkExternalMemoryImageCreateInfoNV* forUnmarshaling);
+
+void marshal_VkExportMemoryAllocateInfoNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkExportMemoryAllocateInfoNV* forMarshaling);
+
+void unmarshal_VkExportMemoryAllocateInfoNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkExportMemoryAllocateInfoNV* forUnmarshaling);
+
+#endif
+#ifdef VK_NV_external_memory_win32
+void marshal_VkImportMemoryWin32HandleInfoNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkImportMemoryWin32HandleInfoNV* forMarshaling);
+
+void unmarshal_VkImportMemoryWin32HandleInfoNV(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkImportMemoryWin32HandleInfoNV* forUnmarshaling);
+
+void marshal_VkExportMemoryWin32HandleInfoNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkExportMemoryWin32HandleInfoNV* forMarshaling);
+
+void unmarshal_VkExportMemoryWin32HandleInfoNV(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkExportMemoryWin32HandleInfoNV* forUnmarshaling);
+
+#define OP_vkGetMemoryWin32HandleNV 20266
+#endif
+#ifdef VK_NV_win32_keyed_mutex
+void marshal_VkWin32KeyedMutexAcquireReleaseInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkWin32KeyedMutexAcquireReleaseInfoNV* forMarshaling);
+
+void unmarshal_VkWin32KeyedMutexAcquireReleaseInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkWin32KeyedMutexAcquireReleaseInfoNV* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_validation_flags
+void marshal_VkValidationFlagsEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkValidationFlagsEXT* forMarshaling);
+
+void unmarshal_VkValidationFlagsEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkValidationFlagsEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_NN_vi_surface
+void marshal_VkViSurfaceCreateInfoNN(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkViSurfaceCreateInfoNN* forMarshaling);
+
+void unmarshal_VkViSurfaceCreateInfoNN(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkViSurfaceCreateInfoNN* forUnmarshaling);
+
+#define OP_vkCreateViSurfaceNN 20267
+#endif
+#ifdef VK_EXT_shader_subgroup_ballot
+#endif
+#ifdef VK_EXT_shader_subgroup_vote
+#endif
+#ifdef VK_EXT_texture_compression_astc_hdr
+void marshal_VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_astc_decode_mode
+void marshal_VkImageViewASTCDecodeModeEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkImageViewASTCDecodeModeEXT* forMarshaling);
+
+void unmarshal_VkImageViewASTCDecodeModeEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkImageViewASTCDecodeModeEXT* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceASTCDecodeFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceASTCDecodeFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceASTCDecodeFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceASTCDecodeFeaturesEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_conditional_rendering
+void marshal_VkConditionalRenderingBeginInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkConditionalRenderingBeginInfoEXT* forMarshaling);
+
+void unmarshal_VkConditionalRenderingBeginInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkConditionalRenderingBeginInfoEXT* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceConditionalRenderingFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceConditionalRenderingFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceConditionalRenderingFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceConditionalRenderingFeaturesEXT* forUnmarshaling);
+
+void marshal_VkCommandBufferInheritanceConditionalRenderingInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCommandBufferInheritanceConditionalRenderingInfoEXT* forMarshaling);
+
+void unmarshal_VkCommandBufferInheritanceConditionalRenderingInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkCommandBufferInheritanceConditionalRenderingInfoEXT* forUnmarshaling);
+
+#define OP_vkCmdBeginConditionalRenderingEXT 20268
+#define OP_vkCmdEndConditionalRenderingEXT 20269
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+void marshal_VkViewportWScalingNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkViewportWScalingNV* forMarshaling);
+
+void unmarshal_VkViewportWScalingNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkViewportWScalingNV* forUnmarshaling);
+
+void marshal_VkPipelineViewportWScalingStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineViewportWScalingStateCreateInfoNV* forMarshaling);
+
+void unmarshal_VkPipelineViewportWScalingStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineViewportWScalingStateCreateInfoNV* forUnmarshaling);
+
+#define OP_vkCmdSetViewportWScalingNV 20279
+#endif
+#ifdef VK_EXT_direct_mode_display
+#define OP_vkReleaseDisplayEXT 20280
+#endif
+#ifdef VK_EXT_acquire_xlib_display
+#define OP_vkAcquireXlibDisplayEXT 20281
+#define OP_vkGetRandROutputDisplayEXT 20282
+#endif
+#ifdef VK_EXT_display_surface_counter
+void marshal_VkSurfaceCapabilities2EXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkSurfaceCapabilities2EXT* forMarshaling);
+
+void unmarshal_VkSurfaceCapabilities2EXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkSurfaceCapabilities2EXT* forUnmarshaling);
+
+#define OP_vkGetPhysicalDeviceSurfaceCapabilities2EXT 20283
+#endif
+#ifdef VK_EXT_display_control
+void marshal_VkDisplayPowerInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkDisplayPowerInfoEXT* forMarshaling);
+
+void unmarshal_VkDisplayPowerInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkDisplayPowerInfoEXT* forUnmarshaling);
+
+void marshal_VkDeviceEventInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkDeviceEventInfoEXT* forMarshaling);
+
+void unmarshal_VkDeviceEventInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkDeviceEventInfoEXT* forUnmarshaling);
+
+void marshal_VkDisplayEventInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkDisplayEventInfoEXT* forMarshaling);
+
+void unmarshal_VkDisplayEventInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkDisplayEventInfoEXT* forUnmarshaling);
+
+void marshal_VkSwapchainCounterCreateInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkSwapchainCounterCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkSwapchainCounterCreateInfoEXT(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkSwapchainCounterCreateInfoEXT* forUnmarshaling);
+
+#define OP_vkDisplayPowerControlEXT 20284
+#define OP_vkRegisterDeviceEventEXT 20285
+#define OP_vkRegisterDisplayEventEXT 20286
+#define OP_vkGetSwapchainCounterEXT 20287
+#endif
+#ifdef VK_GOOGLE_display_timing
+void marshal_VkRefreshCycleDurationGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkRefreshCycleDurationGOOGLE* forMarshaling);
+
+void unmarshal_VkRefreshCycleDurationGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkRefreshCycleDurationGOOGLE* forUnmarshaling);
+
+void marshal_VkPastPresentationTimingGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkPastPresentationTimingGOOGLE* forMarshaling);
+
+void unmarshal_VkPastPresentationTimingGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkPastPresentationTimingGOOGLE* forUnmarshaling);
+
+void marshal_VkPresentTimeGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkPresentTimeGOOGLE* forMarshaling);
+
+void unmarshal_VkPresentTimeGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkPresentTimeGOOGLE* forUnmarshaling);
+
+void marshal_VkPresentTimesInfoGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkPresentTimesInfoGOOGLE* forMarshaling);
+
+void unmarshal_VkPresentTimesInfoGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkPresentTimesInfoGOOGLE* forUnmarshaling);
+
+#define OP_vkGetRefreshCycleDurationGOOGLE 20288
+#define OP_vkGetPastPresentationTimingGOOGLE 20289
+#endif
+#ifdef VK_NV_sample_mask_override_coverage
+#endif
+#ifdef VK_NV_geometry_shader_passthrough
+#endif
+#ifdef VK_NV_viewport_array2
+#endif
+#ifdef VK_NVX_multiview_per_view_attributes
+void marshal_VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX* forUnmarshaling);
+
+#endif
+#ifdef VK_NV_viewport_swizzle
+void marshal_VkViewportSwizzleNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkViewportSwizzleNV* forMarshaling);
+
+void unmarshal_VkViewportSwizzleNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkViewportSwizzleNV* forUnmarshaling);
+
+void marshal_VkPipelineViewportSwizzleStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineViewportSwizzleStateCreateInfoNV* forMarshaling);
+
+void unmarshal_VkPipelineViewportSwizzleStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineViewportSwizzleStateCreateInfoNV* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_discard_rectangles
+void marshal_VkPhysicalDeviceDiscardRectanglePropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDiscardRectanglePropertiesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceDiscardRectanglePropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceDiscardRectanglePropertiesEXT* forUnmarshaling);
+
+void marshal_VkPipelineDiscardRectangleStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineDiscardRectangleStateCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkPipelineDiscardRectangleStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineDiscardRectangleStateCreateInfoEXT* forUnmarshaling);
+
+#define OP_vkCmdSetDiscardRectangleEXT 20290
+#endif
+#ifdef VK_EXT_conservative_rasterization
+void marshal_VkPhysicalDeviceConservativeRasterizationPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceConservativeRasterizationPropertiesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceConservativeRasterizationPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceConservativeRasterizationPropertiesEXT* forUnmarshaling);
+
+void marshal_VkPipelineRasterizationConservativeStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRasterizationConservativeStateCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkPipelineRasterizationConservativeStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineRasterizationConservativeStateCreateInfoEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_depth_clip_enable
+void marshal_VkPhysicalDeviceDepthClipEnableFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDepthClipEnableFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceDepthClipEnableFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceDepthClipEnableFeaturesEXT* forUnmarshaling);
+
+void marshal_VkPipelineRasterizationDepthClipStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRasterizationDepthClipStateCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkPipelineRasterizationDepthClipStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineRasterizationDepthClipStateCreateInfoEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_swapchain_colorspace
+#endif
+#ifdef VK_EXT_hdr_metadata
+void marshal_VkXYColorEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                          const VkXYColorEXT* forMarshaling);
+
+void unmarshal_VkXYColorEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                            VkXYColorEXT* forUnmarshaling);
+
+void marshal_VkHdrMetadataEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                              const VkHdrMetadataEXT* forMarshaling);
+
+void unmarshal_VkHdrMetadataEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                VkHdrMetadataEXT* forUnmarshaling);
+
+#define OP_vkSetHdrMetadataEXT 20291
+#endif
+#ifdef VK_MVK_ios_surface
+void marshal_VkIOSSurfaceCreateInfoMVK(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkIOSSurfaceCreateInfoMVK* forMarshaling);
+
+void unmarshal_VkIOSSurfaceCreateInfoMVK(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkIOSSurfaceCreateInfoMVK* forUnmarshaling);
+
+#define OP_vkCreateIOSSurfaceMVK 20292
+#endif
+#ifdef VK_MVK_macos_surface
+void marshal_VkMacOSSurfaceCreateInfoMVK(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkMacOSSurfaceCreateInfoMVK* forMarshaling);
+
+void unmarshal_VkMacOSSurfaceCreateInfoMVK(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkMacOSSurfaceCreateInfoMVK* forUnmarshaling);
+
+#define OP_vkCreateMacOSSurfaceMVK 20293
+#endif
+#ifdef VK_MVK_moltenvk
+#define OP_vkGetMTLDeviceMVK 20334
+#define OP_vkSetMTLTextureMVK 20335
+#define OP_vkGetMTLTextureMVK 20336
+#define OP_vkGetMTLBufferMVK 20337
+#define OP_vkUseIOSurfaceMVK 20338
+#define OP_vkGetIOSurfaceMVK 20339
+#endif
+#ifdef VK_EXT_external_memory_dma_buf
+#endif
+#ifdef VK_EXT_queue_family_foreign
+#endif
+#ifdef VK_EXT_debug_utils
+void marshal_VkDebugUtilsLabelEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkDebugUtilsLabelEXT* forMarshaling);
+
+void unmarshal_VkDebugUtilsLabelEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkDebugUtilsLabelEXT* forUnmarshaling);
+
+void marshal_VkDebugUtilsObjectNameInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkDebugUtilsObjectNameInfoEXT* forMarshaling);
+
+void unmarshal_VkDebugUtilsObjectNameInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkDebugUtilsObjectNameInfoEXT* forUnmarshaling);
+
+void marshal_VkDebugUtilsMessengerCallbackDataEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDebugUtilsMessengerCallbackDataEXT* forMarshaling);
+
+void unmarshal_VkDebugUtilsMessengerCallbackDataEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDebugUtilsMessengerCallbackDataEXT* forUnmarshaling);
+
+void marshal_VkDebugUtilsMessengerCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDebugUtilsMessengerCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkDebugUtilsMessengerCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDebugUtilsMessengerCreateInfoEXT* forUnmarshaling);
+
+void marshal_VkDebugUtilsObjectTagInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkDebugUtilsObjectTagInfoEXT* forMarshaling);
+
+void unmarshal_VkDebugUtilsObjectTagInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkDebugUtilsObjectTagInfoEXT* forUnmarshaling);
+
+#define OP_vkSetDebugUtilsObjectNameEXT 20294
+#define OP_vkSetDebugUtilsObjectTagEXT 20295
+#define OP_vkQueueBeginDebugUtilsLabelEXT 20296
+#define OP_vkQueueEndDebugUtilsLabelEXT 20297
+#define OP_vkQueueInsertDebugUtilsLabelEXT 20298
+#define OP_vkCmdBeginDebugUtilsLabelEXT 20299
+#define OP_vkCmdEndDebugUtilsLabelEXT 20300
+#define OP_vkCmdInsertDebugUtilsLabelEXT 20301
+#define OP_vkCreateDebugUtilsMessengerEXT 20302
+#define OP_vkDestroyDebugUtilsMessengerEXT 20303
+#define OP_vkSubmitDebugUtilsMessageEXT 20304
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+void marshal_VkAndroidHardwareBufferUsageANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAndroidHardwareBufferUsageANDROID* forMarshaling);
+
+void unmarshal_VkAndroidHardwareBufferUsageANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAndroidHardwareBufferUsageANDROID* forUnmarshaling);
+
+void marshal_VkAndroidHardwareBufferPropertiesANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAndroidHardwareBufferPropertiesANDROID* forMarshaling);
+
+void unmarshal_VkAndroidHardwareBufferPropertiesANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAndroidHardwareBufferPropertiesANDROID* forUnmarshaling);
+
+void marshal_VkAndroidHardwareBufferFormatPropertiesANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAndroidHardwareBufferFormatPropertiesANDROID* forMarshaling);
+
+void unmarshal_VkAndroidHardwareBufferFormatPropertiesANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAndroidHardwareBufferFormatPropertiesANDROID* forUnmarshaling);
+
+void marshal_VkImportAndroidHardwareBufferInfoANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportAndroidHardwareBufferInfoANDROID* forMarshaling);
+
+void unmarshal_VkImportAndroidHardwareBufferInfoANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkImportAndroidHardwareBufferInfoANDROID* forUnmarshaling);
+
+void marshal_VkMemoryGetAndroidHardwareBufferInfoANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryGetAndroidHardwareBufferInfoANDROID* forMarshaling);
+
+void unmarshal_VkMemoryGetAndroidHardwareBufferInfoANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkMemoryGetAndroidHardwareBufferInfoANDROID* forUnmarshaling);
+
+void marshal_VkExternalFormatANDROID(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkExternalFormatANDROID* forMarshaling);
+
+void unmarshal_VkExternalFormatANDROID(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkExternalFormatANDROID* forUnmarshaling);
+
+#define OP_vkGetAndroidHardwareBufferPropertiesANDROID 20305
+#define OP_vkGetMemoryAndroidHardwareBufferANDROID 20306
+void marshal_VkAndroidHardwareBufferFormatProperties2ANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAndroidHardwareBufferFormatProperties2ANDROID* forMarshaling);
+
+void unmarshal_VkAndroidHardwareBufferFormatProperties2ANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAndroidHardwareBufferFormatProperties2ANDROID* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_sampler_filter_minmax
+DEFINE_ALIAS_FUNCTION(marshal_VkSamplerReductionModeCreateInfo,
+                      marshal_VkSamplerReductionModeCreateInfoEXT)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkSamplerReductionModeCreateInfo,
+                      unmarshal_VkSamplerReductionModeCreateInfoEXT)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceSamplerFilterMinmaxProperties,
+                      marshal_VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceSamplerFilterMinmaxProperties,
+                      unmarshal_VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT)
+
+#endif
+#ifdef VK_AMD_gpu_shader_int16
+#endif
+#ifdef VK_AMD_mixed_attachment_samples
+#endif
+#ifdef VK_AMD_shader_fragment_mask
+#endif
+#ifdef VK_EXT_inline_uniform_block
+void marshal_VkPhysicalDeviceInlineUniformBlockFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceInlineUniformBlockFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceInlineUniformBlockFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceInlineUniformBlockFeaturesEXT* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceInlineUniformBlockPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceInlineUniformBlockPropertiesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceInlineUniformBlockPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceInlineUniformBlockPropertiesEXT* forUnmarshaling);
+
+void marshal_VkWriteDescriptorSetInlineUniformBlockEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkWriteDescriptorSetInlineUniformBlockEXT* forMarshaling);
+
+void unmarshal_VkWriteDescriptorSetInlineUniformBlockEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkWriteDescriptorSetInlineUniformBlockEXT* forUnmarshaling);
+
+void marshal_VkDescriptorPoolInlineUniformBlockCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDescriptorPoolInlineUniformBlockCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkDescriptorPoolInlineUniformBlockCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDescriptorPoolInlineUniformBlockCreateInfoEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_shader_stencil_export
+#endif
+#ifdef VK_EXT_sample_locations
+void marshal_VkSampleLocationEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkSampleLocationEXT* forMarshaling);
+
+void unmarshal_VkSampleLocationEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   VkSampleLocationEXT* forUnmarshaling);
+
+void marshal_VkSampleLocationsInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkSampleLocationsInfoEXT* forMarshaling);
+
+void unmarshal_VkSampleLocationsInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkSampleLocationsInfoEXT* forUnmarshaling);
+
+void marshal_VkAttachmentSampleLocationsEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkAttachmentSampleLocationsEXT* forMarshaling);
+
+void unmarshal_VkAttachmentSampleLocationsEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkAttachmentSampleLocationsEXT* forUnmarshaling);
+
+void marshal_VkSubpassSampleLocationsEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkSubpassSampleLocationsEXT* forMarshaling);
+
+void unmarshal_VkSubpassSampleLocationsEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkSubpassSampleLocationsEXT* forUnmarshaling);
+
+void marshal_VkRenderPassSampleLocationsBeginInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRenderPassSampleLocationsBeginInfoEXT* forMarshaling);
+
+void unmarshal_VkRenderPassSampleLocationsBeginInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkRenderPassSampleLocationsBeginInfoEXT* forUnmarshaling);
+
+void marshal_VkPipelineSampleLocationsStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineSampleLocationsStateCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkPipelineSampleLocationsStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineSampleLocationsStateCreateInfoEXT* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceSampleLocationsPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSampleLocationsPropertiesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceSampleLocationsPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceSampleLocationsPropertiesEXT* forUnmarshaling);
+
+void marshal_VkMultisamplePropertiesEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkMultisamplePropertiesEXT* forMarshaling);
+
+void unmarshal_VkMultisamplePropertiesEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkMultisamplePropertiesEXT* forUnmarshaling);
+
+#define OP_vkCmdSetSampleLocationsEXT 20307
+#define OP_vkGetPhysicalDeviceMultisamplePropertiesEXT 20308
+#endif
+#ifdef VK_EXT_blend_operation_advanced
+void marshal_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT* forUnmarshaling);
+
+void marshal_VkPipelineColorBlendAdvancedStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineColorBlendAdvancedStateCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkPipelineColorBlendAdvancedStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineColorBlendAdvancedStateCreateInfoEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_NV_fragment_coverage_to_color
+void marshal_VkPipelineCoverageToColorStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineCoverageToColorStateCreateInfoNV* forMarshaling);
+
+void unmarshal_VkPipelineCoverageToColorStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineCoverageToColorStateCreateInfoNV* forUnmarshaling);
+
+#endif
+#ifdef VK_NV_framebuffer_mixed_samples
+void marshal_VkPipelineCoverageModulationStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineCoverageModulationStateCreateInfoNV* forMarshaling);
+
+void unmarshal_VkPipelineCoverageModulationStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineCoverageModulationStateCreateInfoNV* forUnmarshaling);
+
+#endif
+#ifdef VK_NV_fill_rectangle
+#endif
+#ifdef VK_NV_shader_sm_builtins
+void marshal_VkPhysicalDeviceShaderSMBuiltinsPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSMBuiltinsPropertiesNV* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceShaderSMBuiltinsPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderSMBuiltinsPropertiesNV* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceShaderSMBuiltinsFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSMBuiltinsFeaturesNV* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceShaderSMBuiltinsFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderSMBuiltinsFeaturesNV* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_post_depth_coverage
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+void marshal_VkDrmFormatModifierPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDrmFormatModifierPropertiesEXT* forMarshaling);
+
+void unmarshal_VkDrmFormatModifierPropertiesEXT(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkDrmFormatModifierPropertiesEXT* forUnmarshaling);
+
+void marshal_VkDrmFormatModifierPropertiesListEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDrmFormatModifierPropertiesListEXT* forMarshaling);
+
+void unmarshal_VkDrmFormatModifierPropertiesListEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDrmFormatModifierPropertiesListEXT* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceImageDrmFormatModifierInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceImageDrmFormatModifierInfoEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceImageDrmFormatModifierInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceImageDrmFormatModifierInfoEXT* forUnmarshaling);
+
+void marshal_VkImageDrmFormatModifierListCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageDrmFormatModifierListCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkImageDrmFormatModifierListCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkImageDrmFormatModifierListCreateInfoEXT* forUnmarshaling);
+
+void marshal_VkImageDrmFormatModifierExplicitCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageDrmFormatModifierExplicitCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkImageDrmFormatModifierExplicitCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkImageDrmFormatModifierExplicitCreateInfoEXT* forUnmarshaling);
+
+void marshal_VkImageDrmFormatModifierPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageDrmFormatModifierPropertiesEXT* forMarshaling);
+
+void unmarshal_VkImageDrmFormatModifierPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkImageDrmFormatModifierPropertiesEXT* forUnmarshaling);
+
+#define OP_vkGetImageDrmFormatModifierPropertiesEXT 251301237
+void marshal_VkDrmFormatModifierProperties2EXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDrmFormatModifierProperties2EXT* forMarshaling);
+
+void unmarshal_VkDrmFormatModifierProperties2EXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDrmFormatModifierProperties2EXT* forUnmarshaling);
+
+void marshal_VkDrmFormatModifierPropertiesList2EXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDrmFormatModifierPropertiesList2EXT* forMarshaling);
+
+void unmarshal_VkDrmFormatModifierPropertiesList2EXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDrmFormatModifierPropertiesList2EXT* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_validation_cache
+void marshal_VkValidationCacheCreateInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkValidationCacheCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkValidationCacheCreateInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkValidationCacheCreateInfoEXT* forUnmarshaling);
+
+void marshal_VkShaderModuleValidationCacheCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkShaderModuleValidationCacheCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkShaderModuleValidationCacheCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkShaderModuleValidationCacheCreateInfoEXT* forUnmarshaling);
+
+#define OP_vkCreateValidationCacheEXT 20309
+#define OP_vkDestroyValidationCacheEXT 20310
+#define OP_vkMergeValidationCachesEXT 20311
+#define OP_vkGetValidationCacheDataEXT 20312
+#endif
+#ifdef VK_EXT_descriptor_indexing
+DEFINE_ALIAS_FUNCTION(marshal_VkDescriptorSetLayoutBindingFlagsCreateInfo,
+                      marshal_VkDescriptorSetLayoutBindingFlagsCreateInfoEXT)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkDescriptorSetLayoutBindingFlagsCreateInfo,
+                      unmarshal_VkDescriptorSetLayoutBindingFlagsCreateInfoEXT)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceDescriptorIndexingFeatures,
+                      marshal_VkPhysicalDeviceDescriptorIndexingFeaturesEXT)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceDescriptorIndexingFeatures,
+                      unmarshal_VkPhysicalDeviceDescriptorIndexingFeaturesEXT)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceDescriptorIndexingProperties,
+                      marshal_VkPhysicalDeviceDescriptorIndexingPropertiesEXT)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceDescriptorIndexingProperties,
+                      unmarshal_VkPhysicalDeviceDescriptorIndexingPropertiesEXT)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkDescriptorSetVariableDescriptorCountAllocateInfo,
+                      marshal_VkDescriptorSetVariableDescriptorCountAllocateInfoEXT)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkDescriptorSetVariableDescriptorCountAllocateInfo,
+                      unmarshal_VkDescriptorSetVariableDescriptorCountAllocateInfoEXT)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkDescriptorSetVariableDescriptorCountLayoutSupport,
+                      marshal_VkDescriptorSetVariableDescriptorCountLayoutSupportEXT)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkDescriptorSetVariableDescriptorCountLayoutSupport,
+                      unmarshal_VkDescriptorSetVariableDescriptorCountLayoutSupportEXT)
+
+#endif
+#ifdef VK_EXT_shader_viewport_index_layer
+#endif
+#ifdef VK_NV_shading_rate_image
+void marshal_VkShadingRatePaletteNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkShadingRatePaletteNV* forMarshaling);
+
+void unmarshal_VkShadingRatePaletteNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      VkShadingRatePaletteNV* forUnmarshaling);
+
+void marshal_VkPipelineViewportShadingRateImageStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineViewportShadingRateImageStateCreateInfoNV* forMarshaling);
+
+void unmarshal_VkPipelineViewportShadingRateImageStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineViewportShadingRateImageStateCreateInfoNV* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceShadingRateImageFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShadingRateImageFeaturesNV* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceShadingRateImageFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShadingRateImageFeaturesNV* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceShadingRateImagePropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShadingRateImagePropertiesNV* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceShadingRateImagePropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShadingRateImagePropertiesNV* forUnmarshaling);
+
+void marshal_VkCoarseSampleLocationNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkCoarseSampleLocationNV* forMarshaling);
+
+void unmarshal_VkCoarseSampleLocationNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkCoarseSampleLocationNV* forUnmarshaling);
+
+void marshal_VkCoarseSampleOrderCustomNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkCoarseSampleOrderCustomNV* forMarshaling);
+
+void unmarshal_VkCoarseSampleOrderCustomNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkCoarseSampleOrderCustomNV* forUnmarshaling);
+
+void marshal_VkPipelineViewportCoarseSampleOrderStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineViewportCoarseSampleOrderStateCreateInfoNV* forMarshaling);
+
+void unmarshal_VkPipelineViewportCoarseSampleOrderStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineViewportCoarseSampleOrderStateCreateInfoNV* forUnmarshaling);
+
+#define OP_vkCmdBindShadingRateImageNV 238618340
+#define OP_vkCmdSetViewportShadingRatePaletteNV 215295078
+#define OP_vkCmdSetCoarseSampleOrderNV 236858637
+#endif
+#ifdef VK_NV_ray_tracing
+void marshal_VkRayTracingShaderGroupCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRayTracingShaderGroupCreateInfoNV* forMarshaling);
+
+void unmarshal_VkRayTracingShaderGroupCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkRayTracingShaderGroupCreateInfoNV* forUnmarshaling);
+
+void marshal_VkRayTracingPipelineCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRayTracingPipelineCreateInfoNV* forMarshaling);
+
+void unmarshal_VkRayTracingPipelineCreateInfoNV(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkRayTracingPipelineCreateInfoNV* forUnmarshaling);
+
+void marshal_VkGeometryTrianglesNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                   const VkGeometryTrianglesNV* forMarshaling);
+
+void unmarshal_VkGeometryTrianglesNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     VkGeometryTrianglesNV* forUnmarshaling);
+
+void marshal_VkGeometryAABBNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                              const VkGeometryAABBNV* forMarshaling);
+
+void unmarshal_VkGeometryAABBNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                VkGeometryAABBNV* forUnmarshaling);
+
+void marshal_VkGeometryDataNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                              const VkGeometryDataNV* forMarshaling);
+
+void unmarshal_VkGeometryDataNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                VkGeometryDataNV* forUnmarshaling);
+
+void marshal_VkGeometryNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                          const VkGeometryNV* forMarshaling);
+
+void unmarshal_VkGeometryNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                            VkGeometryNV* forUnmarshaling);
+
+void marshal_VkAccelerationStructureInfoNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkAccelerationStructureInfoNV* forMarshaling);
+
+void unmarshal_VkAccelerationStructureInfoNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkAccelerationStructureInfoNV* forUnmarshaling);
+
+void marshal_VkAccelerationStructureCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureCreateInfoNV* forMarshaling);
+
+void unmarshal_VkAccelerationStructureCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureCreateInfoNV* forUnmarshaling);
+
+void marshal_VkBindAccelerationStructureMemoryInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBindAccelerationStructureMemoryInfoNV* forMarshaling);
+
+void unmarshal_VkBindAccelerationStructureMemoryInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkBindAccelerationStructureMemoryInfoNV* forUnmarshaling);
+
+void marshal_VkWriteDescriptorSetAccelerationStructureNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkWriteDescriptorSetAccelerationStructureNV* forMarshaling);
+
+void unmarshal_VkWriteDescriptorSetAccelerationStructureNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkWriteDescriptorSetAccelerationStructureNV* forUnmarshaling);
+
+void marshal_VkAccelerationStructureMemoryRequirementsInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureMemoryRequirementsInfoNV* forMarshaling);
+
+void unmarshal_VkAccelerationStructureMemoryRequirementsInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureMemoryRequirementsInfoNV* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceRayTracingPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingPropertiesNV* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceRayTracingPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceRayTracingPropertiesNV* forUnmarshaling);
+
+void marshal_VkTransformMatrixKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkTransformMatrixKHR* forMarshaling);
+
+void unmarshal_VkTransformMatrixKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkTransformMatrixKHR* forUnmarshaling);
+
+DEFINE_ALIAS_FUNCTION(marshal_VkTransformMatrixKHR, marshal_VkTransformMatrixNV)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkTransformMatrixKHR, unmarshal_VkTransformMatrixNV)
+
+void marshal_VkAabbPositionsKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkAabbPositionsKHR* forMarshaling);
+
+void unmarshal_VkAabbPositionsKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkAabbPositionsKHR* forUnmarshaling);
+
+DEFINE_ALIAS_FUNCTION(marshal_VkAabbPositionsKHR, marshal_VkAabbPositionsNV)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkAabbPositionsKHR, unmarshal_VkAabbPositionsNV)
+
+void marshal_VkAccelerationStructureInstanceKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureInstanceKHR* forMarshaling);
+
+void unmarshal_VkAccelerationStructureInstanceKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureInstanceKHR* forUnmarshaling);
+
+DEFINE_ALIAS_FUNCTION(marshal_VkAccelerationStructureInstanceKHR,
+                      marshal_VkAccelerationStructureInstanceNV)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkAccelerationStructureInstanceKHR,
+                      unmarshal_VkAccelerationStructureInstanceNV)
+
+#define OP_vkCreateAccelerationStructureNV 259713020
+#define OP_vkDestroyAccelerationStructureNV 252775746
+#define OP_vkGetAccelerationStructureMemoryRequirementsNV 220234370
+#define OP_vkBindAccelerationStructureMemoryNV 202856743
+#define OP_vkCmdBuildAccelerationStructureNV 269050897
+#define OP_vkCmdCopyAccelerationStructureNV 211075498
+#define OP_vkCmdTraceRaysNV 210219912
+#define OP_vkCreateRayTracingPipelinesNV 203653638
+#define OP_vkGetRayTracingShaderGroupHandlesKHR 271962641
+#define OP_vkGetRayTracingShaderGroupHandlesNV 230045846
+#define OP_vkGetAccelerationStructureHandleNV 269898134
+#define OP_vkCmdWriteAccelerationStructuresPropertiesNV 207954431
+#define OP_vkCompileDeferredNV 278731610
+#endif
+#ifdef VK_NV_representative_fragment_test
+void marshal_VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV* forUnmarshaling);
+
+void marshal_VkPipelineRepresentativeFragmentTestStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRepresentativeFragmentTestStateCreateInfoNV* forMarshaling);
+
+void unmarshal_VkPipelineRepresentativeFragmentTestStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineRepresentativeFragmentTestStateCreateInfoNV* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_filter_cubic
+void marshal_VkPhysicalDeviceImageViewImageFormatInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceImageViewImageFormatInfoEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceImageViewImageFormatInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceImageViewImageFormatInfoEXT* forUnmarshaling);
+
+void marshal_VkFilterCubicImageViewImageFormatPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkFilterCubicImageViewImageFormatPropertiesEXT* forMarshaling);
+
+void unmarshal_VkFilterCubicImageViewImageFormatPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkFilterCubicImageViewImageFormatPropertiesEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_QCOM_render_pass_shader_resolve
+#endif
+#ifdef VK_EXT_global_priority
+void marshal_VkDeviceQueueGlobalPriorityCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceQueueGlobalPriorityCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkDeviceQueueGlobalPriorityCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDeviceQueueGlobalPriorityCreateInfoEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_external_memory_host
+void marshal_VkImportMemoryHostPointerInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportMemoryHostPointerInfoEXT* forMarshaling);
+
+void unmarshal_VkImportMemoryHostPointerInfoEXT(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkImportMemoryHostPointerInfoEXT* forUnmarshaling);
+
+void marshal_VkMemoryHostPointerPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryHostPointerPropertiesEXT* forMarshaling);
+
+void unmarshal_VkMemoryHostPointerPropertiesEXT(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkMemoryHostPointerPropertiesEXT* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceExternalMemoryHostPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExternalMemoryHostPropertiesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceExternalMemoryHostPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceExternalMemoryHostPropertiesEXT* forUnmarshaling);
+
+#define OP_vkGetMemoryHostPointerPropertiesEXT 20313
+#endif
+#ifdef VK_AMD_buffer_marker
+#define OP_vkCmdWriteBufferMarkerAMD 20314
+#endif
+#ifdef VK_AMD_pipeline_compiler_control
+void marshal_VkPipelineCompilerControlCreateInfoAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineCompilerControlCreateInfoAMD* forMarshaling);
+
+void unmarshal_VkPipelineCompilerControlCreateInfoAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineCompilerControlCreateInfoAMD* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_calibrated_timestamps
+void marshal_VkCalibratedTimestampInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkCalibratedTimestampInfoEXT* forMarshaling);
+
+void unmarshal_VkCalibratedTimestampInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkCalibratedTimestampInfoEXT* forUnmarshaling);
+
+#define OP_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT 295643221
+#define OP_vkGetCalibratedTimestampsEXT 203583186
+#endif
+#ifdef VK_AMD_shader_core_properties
+void marshal_VkPhysicalDeviceShaderCorePropertiesAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderCorePropertiesAMD* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceShaderCorePropertiesAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderCorePropertiesAMD* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_video_decode_h265
+void marshal_VkVideoDecodeH265ProfileEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkVideoDecodeH265ProfileEXT* forMarshaling);
+
+void unmarshal_VkVideoDecodeH265ProfileEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkVideoDecodeH265ProfileEXT* forUnmarshaling);
+
+void marshal_VkVideoDecodeH265CapabilitiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH265CapabilitiesEXT* forMarshaling);
+
+void unmarshal_VkVideoDecodeH265CapabilitiesEXT(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkVideoDecodeH265CapabilitiesEXT* forUnmarshaling);
+
+void marshal_VkVideoDecodeH265SessionCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH265SessionCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkVideoDecodeH265SessionCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoDecodeH265SessionCreateInfoEXT* forUnmarshaling);
+
+void marshal_VkVideoDecodeH265SessionParametersAddInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH265SessionParametersAddInfoEXT* forMarshaling);
+
+void unmarshal_VkVideoDecodeH265SessionParametersAddInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoDecodeH265SessionParametersAddInfoEXT* forUnmarshaling);
+
+void marshal_VkVideoDecodeH265SessionParametersCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH265SessionParametersCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkVideoDecodeH265SessionParametersCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVideoDecodeH265SessionParametersCreateInfoEXT* forUnmarshaling);
+
+void marshal_VkVideoDecodeH265PictureInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkVideoDecodeH265PictureInfoEXT* forMarshaling);
+
+void unmarshal_VkVideoDecodeH265PictureInfoEXT(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkVideoDecodeH265PictureInfoEXT* forUnmarshaling);
+
+void marshal_VkVideoDecodeH265DpbSlotInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkVideoDecodeH265DpbSlotInfoEXT* forMarshaling);
+
+void unmarshal_VkVideoDecodeH265DpbSlotInfoEXT(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkVideoDecodeH265DpbSlotInfoEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_AMD_memory_overallocation_behavior
+void marshal_VkDeviceMemoryOverallocationCreateInfoAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceMemoryOverallocationCreateInfoAMD* forMarshaling);
+
+void unmarshal_VkDeviceMemoryOverallocationCreateInfoAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDeviceMemoryOverallocationCreateInfoAMD* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_vertex_attribute_divisor
+void marshal_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT* forUnmarshaling);
+
+void marshal_VkVertexInputBindingDivisorDescriptionEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVertexInputBindingDivisorDescriptionEXT* forMarshaling);
+
+void unmarshal_VkVertexInputBindingDivisorDescriptionEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVertexInputBindingDivisorDescriptionEXT* forUnmarshaling);
+
+void marshal_VkPipelineVertexInputDivisorStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineVertexInputDivisorStateCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkPipelineVertexInputDivisorStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineVertexInputDivisorStateCreateInfoEXT* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_GGP_frame_token
+void marshal_VkPresentFrameTokenGGP(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkPresentFrameTokenGGP* forMarshaling);
+
+void unmarshal_VkPresentFrameTokenGGP(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      VkPresentFrameTokenGGP* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_pipeline_creation_feedback
+void marshal_VkPipelineCreationFeedbackEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkPipelineCreationFeedbackEXT* forMarshaling);
+
+void unmarshal_VkPipelineCreationFeedbackEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkPipelineCreationFeedbackEXT* forUnmarshaling);
+
+void marshal_VkPipelineCreationFeedbackCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineCreationFeedbackCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkPipelineCreationFeedbackCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineCreationFeedbackCreateInfoEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_NV_shader_subgroup_partitioned
+#endif
+#ifdef VK_NV_compute_shader_derivatives
+void marshal_VkPhysicalDeviceComputeShaderDerivativesFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceComputeShaderDerivativesFeaturesNV* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceComputeShaderDerivativesFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceComputeShaderDerivativesFeaturesNV* forUnmarshaling);
+
+#endif
+#ifdef VK_NV_mesh_shader
+void marshal_VkPhysicalDeviceMeshShaderFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMeshShaderFeaturesNV* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceMeshShaderFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceMeshShaderFeaturesNV* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceMeshShaderPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMeshShaderPropertiesNV* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceMeshShaderPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceMeshShaderPropertiesNV* forUnmarshaling);
+
+void marshal_VkDrawMeshTasksIndirectCommandNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDrawMeshTasksIndirectCommandNV* forMarshaling);
+
+void unmarshal_VkDrawMeshTasksIndirectCommandNV(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkDrawMeshTasksIndirectCommandNV* forUnmarshaling);
+
+#define OP_vkCmdDrawMeshTasksNV 207334931
+#define OP_vkCmdDrawMeshTasksIndirectNV 274079208
+#define OP_vkCmdDrawMeshTasksIndirectCountNV 223801967
+#endif
+#ifdef VK_NV_fragment_shader_barycentric
+void marshal_VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV* forUnmarshaling);
+
+#endif
+#ifdef VK_NV_shader_image_footprint
+void marshal_VkPhysicalDeviceShaderImageFootprintFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderImageFootprintFeaturesNV* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceShaderImageFootprintFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderImageFootprintFeaturesNV* forUnmarshaling);
+
+#endif
+#ifdef VK_NV_scissor_exclusive
+void marshal_VkPipelineViewportExclusiveScissorStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineViewportExclusiveScissorStateCreateInfoNV* forMarshaling);
+
+void unmarshal_VkPipelineViewportExclusiveScissorStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineViewportExclusiveScissorStateCreateInfoNV* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceExclusiveScissorFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExclusiveScissorFeaturesNV* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceExclusiveScissorFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceExclusiveScissorFeaturesNV* forUnmarshaling);
+
+#define OP_vkCmdSetExclusiveScissorNV 225408194
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+void marshal_VkQueueFamilyCheckpointPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkQueueFamilyCheckpointPropertiesNV* forMarshaling);
+
+void unmarshal_VkQueueFamilyCheckpointPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkQueueFamilyCheckpointPropertiesNV* forUnmarshaling);
+
+void marshal_VkCheckpointDataNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkCheckpointDataNV* forMarshaling);
+
+void unmarshal_VkCheckpointDataNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkCheckpointDataNV* forUnmarshaling);
+
+#define OP_vkCmdSetCheckpointNV 20315
+#define OP_vkGetQueueCheckpointDataNV 20316
+#endif
+#ifdef VK_INTEL_shader_integer_functions2
+void marshal_VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL* forUnmarshaling);
+
+#endif
+#ifdef VK_INTEL_performance_query
+void marshal_VkPerformanceValueDataINTEL(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkPerformanceValueDataINTEL* forMarshaling);
+
+void unmarshal_VkPerformanceValueDataINTEL(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkPerformanceValueDataINTEL* forUnmarshaling);
+
+void marshal_VkPerformanceValueINTEL(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkPerformanceValueINTEL* forMarshaling);
+
+void unmarshal_VkPerformanceValueINTEL(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkPerformanceValueINTEL* forUnmarshaling);
+
+void marshal_VkInitializePerformanceApiInfoINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkInitializePerformanceApiInfoINTEL* forMarshaling);
+
+void unmarshal_VkInitializePerformanceApiInfoINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkInitializePerformanceApiInfoINTEL* forUnmarshaling);
+
+void marshal_VkQueryPoolPerformanceQueryCreateInfoINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkQueryPoolPerformanceQueryCreateInfoINTEL* forMarshaling);
+
+void unmarshal_VkQueryPoolPerformanceQueryCreateInfoINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkQueryPoolPerformanceQueryCreateInfoINTEL* forUnmarshaling);
+
+DEFINE_ALIAS_FUNCTION(marshal_VkQueryPoolPerformanceQueryCreateInfoINTEL,
+                      marshal_VkQueryPoolCreateInfoINTEL)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkQueryPoolPerformanceQueryCreateInfoINTEL,
+                      unmarshal_VkQueryPoolCreateInfoINTEL)
+
+void marshal_VkPerformanceMarkerInfoINTEL(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkPerformanceMarkerInfoINTEL* forMarshaling);
+
+void unmarshal_VkPerformanceMarkerInfoINTEL(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkPerformanceMarkerInfoINTEL* forUnmarshaling);
+
+void marshal_VkPerformanceStreamMarkerInfoINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPerformanceStreamMarkerInfoINTEL* forMarshaling);
+
+void unmarshal_VkPerformanceStreamMarkerInfoINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPerformanceStreamMarkerInfoINTEL* forUnmarshaling);
+
+void marshal_VkPerformanceOverrideInfoINTEL(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkPerformanceOverrideInfoINTEL* forMarshaling);
+
+void unmarshal_VkPerformanceOverrideInfoINTEL(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkPerformanceOverrideInfoINTEL* forUnmarshaling);
+
+void marshal_VkPerformanceConfigurationAcquireInfoINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPerformanceConfigurationAcquireInfoINTEL* forMarshaling);
+
+void unmarshal_VkPerformanceConfigurationAcquireInfoINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPerformanceConfigurationAcquireInfoINTEL* forUnmarshaling);
+
+#define OP_vkInitializePerformanceApiINTEL 203336121
+#define OP_vkUninitializePerformanceApiINTEL 296137321
+#define OP_vkCmdSetPerformanceMarkerINTEL 270016385
+#define OP_vkCmdSetPerformanceStreamMarkerINTEL 261519634
+#define OP_vkCmdSetPerformanceOverrideINTEL 251310287
+#define OP_vkAcquirePerformanceConfigurationINTEL 245737492
+#define OP_vkReleasePerformanceConfigurationINTEL 252877217
+#define OP_vkQueueSetPerformanceConfigurationINTEL 294947726
+#define OP_vkGetPerformanceParameterINTEL 213620482
+#endif
+#ifdef VK_EXT_pci_bus_info
+void marshal_VkPhysicalDevicePCIBusInfoPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePCIBusInfoPropertiesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDevicePCIBusInfoPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevicePCIBusInfoPropertiesEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_AMD_display_native_hdr
+void marshal_VkDisplayNativeHdrSurfaceCapabilitiesAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDisplayNativeHdrSurfaceCapabilitiesAMD* forMarshaling);
+
+void unmarshal_VkDisplayNativeHdrSurfaceCapabilitiesAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDisplayNativeHdrSurfaceCapabilitiesAMD* forUnmarshaling);
+
+void marshal_VkSwapchainDisplayNativeHdrCreateInfoAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSwapchainDisplayNativeHdrCreateInfoAMD* forMarshaling);
+
+void unmarshal_VkSwapchainDisplayNativeHdrCreateInfoAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkSwapchainDisplayNativeHdrCreateInfoAMD* forUnmarshaling);
+
+#define OP_vkSetLocalDimmingAMD 267533472
+#endif
+#ifdef VK_FUCHSIA_imagepipe_surface
+void marshal_VkImagePipeSurfaceCreateInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImagePipeSurfaceCreateInfoFUCHSIA* forMarshaling);
+
+void unmarshal_VkImagePipeSurfaceCreateInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkImagePipeSurfaceCreateInfoFUCHSIA* forUnmarshaling);
+
+#define OP_vkCreateImagePipeSurfaceFUCHSIA 261626137
+#endif
+#ifdef VK_EXT_metal_surface
+void marshal_VkMetalSurfaceCreateInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkMetalSurfaceCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkMetalSurfaceCreateInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           VkMetalSurfaceCreateInfoEXT* forUnmarshaling);
+
+#define OP_vkCreateMetalSurfaceEXT 254915953
+#endif
+#ifdef VK_EXT_fragment_density_map
+void marshal_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMapFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceFragmentDensityMapFeaturesEXT* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMapPropertiesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceFragmentDensityMapPropertiesEXT* forUnmarshaling);
+
+void marshal_VkRenderPassFragmentDensityMapCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRenderPassFragmentDensityMapCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkRenderPassFragmentDensityMapCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkRenderPassFragmentDensityMapCreateInfoEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_scalar_block_layout
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceScalarBlockLayoutFeatures,
+                      marshal_VkPhysicalDeviceScalarBlockLayoutFeaturesEXT)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceScalarBlockLayoutFeatures,
+                      unmarshal_VkPhysicalDeviceScalarBlockLayoutFeaturesEXT)
+
+#endif
+#ifdef VK_GOOGLE_hlsl_functionality1
+#endif
+#ifdef VK_GOOGLE_decorate_string
+#endif
+#ifdef VK_EXT_subgroup_size_control
+void marshal_VkPhysicalDeviceSubgroupSizeControlFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSubgroupSizeControlFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceSubgroupSizeControlFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceSubgroupSizeControlFeaturesEXT* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceSubgroupSizeControlPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSubgroupSizeControlPropertiesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceSubgroupSizeControlPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceSubgroupSizeControlPropertiesEXT* forUnmarshaling);
+
+void marshal_VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_AMD_shader_core_properties2
+void marshal_VkPhysicalDeviceShaderCoreProperties2AMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderCoreProperties2AMD* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceShaderCoreProperties2AMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderCoreProperties2AMD* forUnmarshaling);
+
+#endif
+#ifdef VK_AMD_device_coherent_memory
+void marshal_VkPhysicalDeviceCoherentMemoryFeaturesAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceCoherentMemoryFeaturesAMD* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceCoherentMemoryFeaturesAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceCoherentMemoryFeaturesAMD* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_shader_image_atomic_int64
+void marshal_VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_memory_budget
+void marshal_VkPhysicalDeviceMemoryBudgetPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMemoryBudgetPropertiesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceMemoryBudgetPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceMemoryBudgetPropertiesEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_memory_priority
+void marshal_VkPhysicalDeviceMemoryPriorityFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMemoryPriorityFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceMemoryPriorityFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceMemoryPriorityFeaturesEXT* forUnmarshaling);
+
+void marshal_VkMemoryPriorityAllocateInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkMemoryPriorityAllocateInfoEXT* forMarshaling);
+
+void unmarshal_VkMemoryPriorityAllocateInfoEXT(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkMemoryPriorityAllocateInfoEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_NV_dedicated_allocation_image_aliasing
+void marshal_VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_buffer_device_address
+void marshal_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceBufferDeviceAddressFeaturesEXT* forUnmarshaling);
+
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT,
+                      marshal_VkPhysicalDeviceBufferAddressFeaturesEXT)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT,
+                      unmarshal_VkPhysicalDeviceBufferAddressFeaturesEXT)
+
+DEFINE_ALIAS_FUNCTION(marshal_VkBufferDeviceAddressInfo, marshal_VkBufferDeviceAddressInfoEXT)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkBufferDeviceAddressInfo, unmarshal_VkBufferDeviceAddressInfoEXT)
+
+void marshal_VkBufferDeviceAddressCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferDeviceAddressCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkBufferDeviceAddressCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkBufferDeviceAddressCreateInfoEXT* forUnmarshaling);
+
+#define OP_vkGetBufferDeviceAddressEXT 224361693
+#endif
+#ifdef VK_EXT_tooling_info
+void marshal_VkPhysicalDeviceToolPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceToolPropertiesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceToolPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceToolPropertiesEXT* forUnmarshaling);
+
+#define OP_vkGetPhysicalDeviceToolPropertiesEXT 282247593
+#endif
+#ifdef VK_EXT_separate_stencil_usage
+DEFINE_ALIAS_FUNCTION(marshal_VkImageStencilUsageCreateInfo,
+                      marshal_VkImageStencilUsageCreateInfoEXT)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkImageStencilUsageCreateInfo,
+                      unmarshal_VkImageStencilUsageCreateInfoEXT)
+
+#endif
+#ifdef VK_EXT_validation_features
+void marshal_VkValidationFeaturesEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkValidationFeaturesEXT* forMarshaling);
+
+void unmarshal_VkValidationFeaturesEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       VkValidationFeaturesEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_NV_cooperative_matrix
+void marshal_VkCooperativeMatrixPropertiesNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkCooperativeMatrixPropertiesNV* forMarshaling);
+
+void unmarshal_VkCooperativeMatrixPropertiesNV(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkCooperativeMatrixPropertiesNV* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceCooperativeMatrixFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceCooperativeMatrixFeaturesNV* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceCooperativeMatrixFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceCooperativeMatrixFeaturesNV* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceCooperativeMatrixPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceCooperativeMatrixPropertiesNV* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceCooperativeMatrixPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceCooperativeMatrixPropertiesNV* forUnmarshaling);
+
+#define OP_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV 287711429
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+void marshal_VkPhysicalDeviceCoverageReductionModeFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceCoverageReductionModeFeaturesNV* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceCoverageReductionModeFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceCoverageReductionModeFeaturesNV* forUnmarshaling);
+
+void marshal_VkPipelineCoverageReductionStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineCoverageReductionStateCreateInfoNV* forMarshaling);
+
+void unmarshal_VkPipelineCoverageReductionStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineCoverageReductionStateCreateInfoNV* forUnmarshaling);
+
+void marshal_VkFramebufferMixedSamplesCombinationNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkFramebufferMixedSamplesCombinationNV* forMarshaling);
+
+void unmarshal_VkFramebufferMixedSamplesCombinationNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkFramebufferMixedSamplesCombinationNV* forUnmarshaling);
+
+#define OP_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV 292032159
+#endif
+#ifdef VK_EXT_fragment_shader_interlock
+void marshal_VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_ycbcr_image_arrays
+void marshal_VkPhysicalDeviceYcbcrImageArraysFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceYcbcrImageArraysFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceYcbcrImageArraysFeaturesEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_provoking_vertex
+void marshal_VkPhysicalDeviceProvokingVertexFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceProvokingVertexFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceProvokingVertexFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceProvokingVertexFeaturesEXT* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceProvokingVertexPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceProvokingVertexPropertiesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceProvokingVertexPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceProvokingVertexPropertiesEXT* forUnmarshaling);
+
+void marshal_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineRasterizationProvokingVertexStateCreateInfoEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+void marshal_VkSurfaceFullScreenExclusiveInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSurfaceFullScreenExclusiveInfoEXT* forMarshaling);
+
+void unmarshal_VkSurfaceFullScreenExclusiveInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkSurfaceFullScreenExclusiveInfoEXT* forUnmarshaling);
+
+void marshal_VkSurfaceCapabilitiesFullScreenExclusiveEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSurfaceCapabilitiesFullScreenExclusiveEXT* forMarshaling);
+
+void unmarshal_VkSurfaceCapabilitiesFullScreenExclusiveEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkSurfaceCapabilitiesFullScreenExclusiveEXT* forUnmarshaling);
+
+#define OP_vkGetPhysicalDeviceSurfacePresentModes2EXT 268126279
+#define OP_vkAcquireFullScreenExclusiveModeEXT 200946668
+#define OP_vkReleaseFullScreenExclusiveModeEXT 257629142
+void marshal_VkSurfaceFullScreenExclusiveWin32InfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSurfaceFullScreenExclusiveWin32InfoEXT* forMarshaling);
+
+void unmarshal_VkSurfaceFullScreenExclusiveWin32InfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkSurfaceFullScreenExclusiveWin32InfoEXT* forUnmarshaling);
+
+#define OP_vkGetDeviceGroupSurfacePresentModes2EXT 206369543
+#endif
+#ifdef VK_EXT_headless_surface
+void marshal_VkHeadlessSurfaceCreateInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkHeadlessSurfaceCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkHeadlessSurfaceCreateInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkHeadlessSurfaceCreateInfoEXT* forUnmarshaling);
+
+#define OP_vkCreateHeadlessSurfaceEXT 298411290
+#endif
+#ifdef VK_EXT_line_rasterization
+void marshal_VkPhysicalDeviceLineRasterizationFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceLineRasterizationFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceLineRasterizationFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceLineRasterizationFeaturesEXT* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceLineRasterizationPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceLineRasterizationPropertiesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceLineRasterizationPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceLineRasterizationPropertiesEXT* forUnmarshaling);
+
+void marshal_VkPipelineRasterizationLineStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRasterizationLineStateCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkPipelineRasterizationLineStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineRasterizationLineStateCreateInfoEXT* forUnmarshaling);
+
+#define OP_vkCmdSetLineStippleEXT 263855692
+#endif
+#ifdef VK_EXT_shader_atomic_float
+void marshal_VkPhysicalDeviceShaderAtomicFloatFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceShaderAtomicFloatFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderAtomicFloatFeaturesEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_host_query_reset
+DEFINE_ALIAS_FUNCTION(marshal_VkPhysicalDeviceHostQueryResetFeatures,
+                      marshal_VkPhysicalDeviceHostQueryResetFeaturesEXT)
+
+DEFINE_ALIAS_FUNCTION(unmarshal_VkPhysicalDeviceHostQueryResetFeatures,
+                      unmarshal_VkPhysicalDeviceHostQueryResetFeaturesEXT)
+
+#define OP_vkResetQueryPoolEXT 242995959
+#endif
+#ifdef VK_EXT_index_type_uint8
+void marshal_VkPhysicalDeviceIndexTypeUint8FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceIndexTypeUint8FeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceIndexTypeUint8FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceIndexTypeUint8FeaturesEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+void marshal_VkPhysicalDeviceExtendedDynamicStateFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceExtendedDynamicStateFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceExtendedDynamicStateFeaturesEXT* forUnmarshaling);
+
+#define OP_vkCmdSetCullModeEXT 266285895
+#define OP_vkCmdSetFrontFaceEXT 212644406
+#define OP_vkCmdSetPrimitiveTopologyEXT 260783979
+#define OP_vkCmdSetViewportWithCountEXT 257105245
+#define OP_vkCmdSetScissorWithCountEXT 204588120
+#define OP_vkCmdBindVertexBuffers2EXT 243419921
+#define OP_vkCmdSetDepthTestEnableEXT 233771166
+#define OP_vkCmdSetDepthWriteEnableEXT 218663304
+#define OP_vkCmdSetDepthCompareOpEXT 247761589
+#define OP_vkCmdSetDepthBoundsTestEnableEXT 223213519
+#define OP_vkCmdSetStencilTestEnableEXT 286438749
+#define OP_vkCmdSetStencilOpEXT 277159578
+#endif
+#ifdef VK_EXT_shader_atomic_float2
+void marshal_VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_shader_demote_to_helper_invocation
+void marshal_VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_NV_device_generated_commands
+void marshal_VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV* forUnmarshaling);
+
+void marshal_VkGraphicsShaderGroupCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkGraphicsShaderGroupCreateInfoNV* forMarshaling);
+
+void unmarshal_VkGraphicsShaderGroupCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkGraphicsShaderGroupCreateInfoNV* forUnmarshaling);
+
+void marshal_VkGraphicsPipelineShaderGroupsCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkGraphicsPipelineShaderGroupsCreateInfoNV* forMarshaling);
+
+void unmarshal_VkGraphicsPipelineShaderGroupsCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkGraphicsPipelineShaderGroupsCreateInfoNV* forUnmarshaling);
+
+void marshal_VkBindShaderGroupIndirectCommandNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBindShaderGroupIndirectCommandNV* forMarshaling);
+
+void unmarshal_VkBindShaderGroupIndirectCommandNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkBindShaderGroupIndirectCommandNV* forUnmarshaling);
+
+void marshal_VkBindIndexBufferIndirectCommandNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBindIndexBufferIndirectCommandNV* forMarshaling);
+
+void unmarshal_VkBindIndexBufferIndirectCommandNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkBindIndexBufferIndirectCommandNV* forUnmarshaling);
+
+void marshal_VkBindVertexBufferIndirectCommandNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBindVertexBufferIndirectCommandNV* forMarshaling);
+
+void unmarshal_VkBindVertexBufferIndirectCommandNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkBindVertexBufferIndirectCommandNV* forUnmarshaling);
+
+void marshal_VkSetStateFlagsIndirectCommandNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSetStateFlagsIndirectCommandNV* forMarshaling);
+
+void unmarshal_VkSetStateFlagsIndirectCommandNV(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkSetStateFlagsIndirectCommandNV* forUnmarshaling);
+
+void marshal_VkIndirectCommandsStreamNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkIndirectCommandsStreamNV* forMarshaling);
+
+void unmarshal_VkIndirectCommandsStreamNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          VkIndirectCommandsStreamNV* forUnmarshaling);
+
+void marshal_VkIndirectCommandsLayoutTokenNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkIndirectCommandsLayoutTokenNV* forMarshaling);
+
+void unmarshal_VkIndirectCommandsLayoutTokenNV(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkIndirectCommandsLayoutTokenNV* forUnmarshaling);
+
+void marshal_VkIndirectCommandsLayoutCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkIndirectCommandsLayoutCreateInfoNV* forMarshaling);
+
+void unmarshal_VkIndirectCommandsLayoutCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkIndirectCommandsLayoutCreateInfoNV* forUnmarshaling);
+
+void marshal_VkGeneratedCommandsInfoNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkGeneratedCommandsInfoNV* forMarshaling);
+
+void unmarshal_VkGeneratedCommandsInfoNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkGeneratedCommandsInfoNV* forUnmarshaling);
+
+void marshal_VkGeneratedCommandsMemoryRequirementsInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkGeneratedCommandsMemoryRequirementsInfoNV* forMarshaling);
+
+void unmarshal_VkGeneratedCommandsMemoryRequirementsInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkGeneratedCommandsMemoryRequirementsInfoNV* forUnmarshaling);
+
+#define OP_vkGetGeneratedCommandsMemoryRequirementsNV 249047049
+#define OP_vkCmdPreprocessGeneratedCommandsNV 297624330
+#define OP_vkCmdExecuteGeneratedCommandsNV 234711184
+#define OP_vkCmdBindPipelineShaderGroupNV 270362239
+#define OP_vkCreateIndirectCommandsLayoutNV 285310710
+#define OP_vkDestroyIndirectCommandsLayoutNV 292584135
+#endif
+#ifdef VK_NV_inherited_viewport_scissor
+void marshal_VkPhysicalDeviceInheritedViewportScissorFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceInheritedViewportScissorFeaturesNV* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceInheritedViewportScissorFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceInheritedViewportScissorFeaturesNV* forUnmarshaling);
+
+void marshal_VkCommandBufferInheritanceViewportScissorInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCommandBufferInheritanceViewportScissorInfoNV* forMarshaling);
+
+void unmarshal_VkCommandBufferInheritanceViewportScissorInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkCommandBufferInheritanceViewportScissorInfoNV* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_texel_buffer_alignment
+void marshal_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_QCOM_render_pass_transform
+void marshal_VkRenderPassTransformBeginInfoQCOM(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRenderPassTransformBeginInfoQCOM* forMarshaling);
+
+void unmarshal_VkRenderPassTransformBeginInfoQCOM(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkRenderPassTransformBeginInfoQCOM* forUnmarshaling);
+
+void marshal_VkCommandBufferInheritanceRenderPassTransformInfoQCOM(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCommandBufferInheritanceRenderPassTransformInfoQCOM* forMarshaling);
+
+void unmarshal_VkCommandBufferInheritanceRenderPassTransformInfoQCOM(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkCommandBufferInheritanceRenderPassTransformInfoQCOM* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_device_memory_report
+void marshal_VkPhysicalDeviceDeviceMemoryReportFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDeviceMemoryReportFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceDeviceMemoryReportFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceDeviceMemoryReportFeaturesEXT* forUnmarshaling);
+
+void marshal_VkDeviceMemoryReportCallbackDataEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceMemoryReportCallbackDataEXT* forMarshaling);
+
+void unmarshal_VkDeviceMemoryReportCallbackDataEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDeviceMemoryReportCallbackDataEXT* forUnmarshaling);
+
+void marshal_VkDeviceDeviceMemoryReportCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceDeviceMemoryReportCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkDeviceDeviceMemoryReportCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDeviceDeviceMemoryReportCreateInfoEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_acquire_drm_display
+#define OP_vkAcquireDrmDisplayEXT 249820259
+#define OP_vkGetDrmDisplayEXT 282532459
+#endif
+#ifdef VK_EXT_robustness2
+void marshal_VkPhysicalDeviceRobustness2FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRobustness2FeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceRobustness2FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceRobustness2FeaturesEXT* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceRobustness2PropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRobustness2PropertiesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceRobustness2PropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceRobustness2PropertiesEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_custom_border_color
+void marshal_VkSamplerCustomBorderColorCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSamplerCustomBorderColorCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkSamplerCustomBorderColorCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkSamplerCustomBorderColorCreateInfoEXT* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceCustomBorderColorPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceCustomBorderColorPropertiesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceCustomBorderColorPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceCustomBorderColorPropertiesEXT* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceCustomBorderColorFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceCustomBorderColorFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceCustomBorderColorFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceCustomBorderColorFeaturesEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_GOOGLE_user_type
+#endif
+#ifdef VK_EXT_private_data
+void marshal_VkPhysicalDevicePrivateDataFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePrivateDataFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDevicePrivateDataFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevicePrivateDataFeaturesEXT* forUnmarshaling);
+
+void marshal_VkDevicePrivateDataCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDevicePrivateDataCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkDevicePrivateDataCreateInfoEXT(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkDevicePrivateDataCreateInfoEXT* forUnmarshaling);
+
+void marshal_VkPrivateDataSlotCreateInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkPrivateDataSlotCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkPrivateDataSlotCreateInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkPrivateDataSlotCreateInfoEXT* forUnmarshaling);
+
+#define OP_vkCreatePrivateDataSlotEXT 236374049
+#define OP_vkDestroyPrivateDataSlotEXT 208891309
+#define OP_vkSetPrivateDataEXT 225259406
+#define OP_vkGetPrivateDataEXT 291399427
+#endif
+#ifdef VK_EXT_pipeline_creation_cache_control
+void marshal_VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_NV_device_diagnostics_config
+void marshal_VkPhysicalDeviceDiagnosticsConfigFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDiagnosticsConfigFeaturesNV* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceDiagnosticsConfigFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceDiagnosticsConfigFeaturesNV* forUnmarshaling);
+
+void marshal_VkDeviceDiagnosticsConfigCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceDiagnosticsConfigCreateInfoNV* forMarshaling);
+
+void unmarshal_VkDeviceDiagnosticsConfigCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkDeviceDiagnosticsConfigCreateInfoNV* forUnmarshaling);
+
+#endif
+#ifdef VK_QCOM_render_pass_store_ops
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+void marshal_VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV* forUnmarshaling);
+
+void marshal_VkPipelineFragmentShadingRateEnumStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineFragmentShadingRateEnumStateCreateInfoNV* forMarshaling);
+
+void unmarshal_VkPipelineFragmentShadingRateEnumStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineFragmentShadingRateEnumStateCreateInfoNV* forUnmarshaling);
+
+#define OP_vkCmdSetFragmentShadingRateEnumNV 264649847
+#endif
+#ifdef VK_NV_ray_tracing_motion_blur
+void marshal_VkDeviceOrHostAddressConstKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkDeviceOrHostAddressConstKHR* forMarshaling);
+
+void unmarshal_VkDeviceOrHostAddressConstKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkDeviceOrHostAddressConstKHR* forUnmarshaling);
+
+void marshal_VkAccelerationStructureGeometryMotionTrianglesDataNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureGeometryMotionTrianglesDataNV* forMarshaling);
+
+void unmarshal_VkAccelerationStructureGeometryMotionTrianglesDataNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureGeometryMotionTrianglesDataNV* forUnmarshaling);
+
+void marshal_VkAccelerationStructureMotionInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureMotionInfoNV* forMarshaling);
+
+void unmarshal_VkAccelerationStructureMotionInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureMotionInfoNV* forUnmarshaling);
+
+void marshal_VkAccelerationStructureMatrixMotionInstanceNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureMatrixMotionInstanceNV* forMarshaling);
+
+void unmarshal_VkAccelerationStructureMatrixMotionInstanceNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureMatrixMotionInstanceNV* forUnmarshaling);
+
+void marshal_VkSRTDataNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                         const VkSRTDataNV* forMarshaling);
+
+void unmarshal_VkSRTDataNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                           VkSRTDataNV* forUnmarshaling);
+
+void marshal_VkAccelerationStructureSRTMotionInstanceNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureSRTMotionInstanceNV* forMarshaling);
+
+void unmarshal_VkAccelerationStructureSRTMotionInstanceNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureSRTMotionInstanceNV* forUnmarshaling);
+
+void marshal_VkAccelerationStructureMotionInstanceDataNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureMotionInstanceDataNV* forMarshaling);
+
+void unmarshal_VkAccelerationStructureMotionInstanceDataNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureMotionInstanceDataNV* forUnmarshaling);
+
+void marshal_VkAccelerationStructureMotionInstanceNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureMotionInstanceNV* forMarshaling);
+
+void unmarshal_VkAccelerationStructureMotionInstanceNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureMotionInstanceNV* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceRayTracingMotionBlurFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingMotionBlurFeaturesNV* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceRayTracingMotionBlurFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceRayTracingMotionBlurFeaturesNV* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_ycbcr_2plane_444_formats
+void marshal_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_fragment_density_map2
+void marshal_VkPhysicalDeviceFragmentDensityMap2FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceFragmentDensityMap2FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceFragmentDensityMap2FeaturesEXT* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceFragmentDensityMap2PropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMap2PropertiesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceFragmentDensityMap2PropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceFragmentDensityMap2PropertiesEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_QCOM_rotated_copy_commands
+void marshal_VkCopyCommandTransformInfoQCOM(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkCopyCommandTransformInfoQCOM* forMarshaling);
+
+void unmarshal_VkCopyCommandTransformInfoQCOM(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkCopyCommandTransformInfoQCOM* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_image_robustness
+void marshal_VkPhysicalDeviceImageRobustnessFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceImageRobustnessFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceImageRobustnessFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceImageRobustnessFeaturesEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_4444_formats
+void marshal_VkPhysicalDevice4444FormatsFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevice4444FormatsFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDevice4444FormatsFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevice4444FormatsFeaturesEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_rgba10x6_formats
+void marshal_VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_NV_acquire_winrt_display
+#define OP_vkAcquireWinrtDisplayNV 274295059
+#define OP_vkGetWinrtDisplayNV 294381219
+#endif
+#ifdef VK_EXT_directfb_surface
+void marshal_VkDirectFBSurfaceCreateInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkDirectFBSurfaceCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkDirectFBSurfaceCreateInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkDirectFBSurfaceCreateInfoEXT* forUnmarshaling);
+
+#define OP_vkCreateDirectFBSurfaceEXT 220792403
+#define OP_vkGetPhysicalDeviceDirectFBPresentationSupportEXT 285441990
+#endif
+#ifdef VK_VALVE_mutable_descriptor_type
+void marshal_VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE* forUnmarshaling);
+
+void marshal_VkMutableDescriptorTypeListVALVE(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMutableDescriptorTypeListVALVE* forMarshaling);
+
+void unmarshal_VkMutableDescriptorTypeListVALVE(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkMutableDescriptorTypeListVALVE* forUnmarshaling);
+
+void marshal_VkMutableDescriptorTypeCreateInfoVALVE(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMutableDescriptorTypeCreateInfoVALVE* forMarshaling);
+
+void unmarshal_VkMutableDescriptorTypeCreateInfoVALVE(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkMutableDescriptorTypeCreateInfoVALVE* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+void marshal_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT* forUnmarshaling);
+
+void marshal_VkVertexInputBindingDescription2EXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVertexInputBindingDescription2EXT* forMarshaling);
+
+void unmarshal_VkVertexInputBindingDescription2EXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVertexInputBindingDescription2EXT* forUnmarshaling);
+
+void marshal_VkVertexInputAttributeDescription2EXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVertexInputAttributeDescription2EXT* forMarshaling);
+
+void unmarshal_VkVertexInputAttributeDescription2EXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkVertexInputAttributeDescription2EXT* forUnmarshaling);
+
+#define OP_vkCmdSetVertexInputEXT 211522810
+#endif
+#ifdef VK_EXT_physical_device_drm
+void marshal_VkPhysicalDeviceDrmPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDrmPropertiesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceDrmPropertiesEXT(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                VkPhysicalDeviceDrmPropertiesEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_primitive_topology_list_restart
+void marshal_VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_FUCHSIA_external_memory
+void marshal_VkImportMemoryZirconHandleInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportMemoryZirconHandleInfoFUCHSIA* forMarshaling);
+
+void unmarshal_VkImportMemoryZirconHandleInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkImportMemoryZirconHandleInfoFUCHSIA* forUnmarshaling);
+
+void marshal_VkMemoryZirconHandlePropertiesFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryZirconHandlePropertiesFUCHSIA* forMarshaling);
+
+void unmarshal_VkMemoryZirconHandlePropertiesFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkMemoryZirconHandlePropertiesFUCHSIA* forUnmarshaling);
+
+void marshal_VkMemoryGetZirconHandleInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryGetZirconHandleInfoFUCHSIA* forMarshaling);
+
+void unmarshal_VkMemoryGetZirconHandleInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkMemoryGetZirconHandleInfoFUCHSIA* forUnmarshaling);
+
+#define OP_vkGetMemoryZirconHandleFUCHSIA 215089868
+#define OP_vkGetMemoryZirconHandlePropertiesFUCHSIA 213247019
+#endif
+#ifdef VK_FUCHSIA_external_semaphore
+void marshal_VkImportSemaphoreZirconHandleInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportSemaphoreZirconHandleInfoFUCHSIA* forMarshaling);
+
+void unmarshal_VkImportSemaphoreZirconHandleInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkImportSemaphoreZirconHandleInfoFUCHSIA* forUnmarshaling);
+
+void marshal_VkSemaphoreGetZirconHandleInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSemaphoreGetZirconHandleInfoFUCHSIA* forMarshaling);
+
+void unmarshal_VkSemaphoreGetZirconHandleInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkSemaphoreGetZirconHandleInfoFUCHSIA* forUnmarshaling);
+
+#define OP_vkImportSemaphoreZirconHandleFUCHSIA 299314530
+#define OP_vkGetSemaphoreZirconHandleFUCHSIA 248728905
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+void marshal_VkBufferCollectionCreateInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferCollectionCreateInfoFUCHSIA* forMarshaling);
+
+void unmarshal_VkBufferCollectionCreateInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkBufferCollectionCreateInfoFUCHSIA* forUnmarshaling);
+
+void marshal_VkImportMemoryBufferCollectionFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportMemoryBufferCollectionFUCHSIA* forMarshaling);
+
+void unmarshal_VkImportMemoryBufferCollectionFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkImportMemoryBufferCollectionFUCHSIA* forUnmarshaling);
+
+void marshal_VkBufferCollectionImageCreateInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferCollectionImageCreateInfoFUCHSIA* forMarshaling);
+
+void unmarshal_VkBufferCollectionImageCreateInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkBufferCollectionImageCreateInfoFUCHSIA* forUnmarshaling);
+
+void marshal_VkBufferCollectionConstraintsInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferCollectionConstraintsInfoFUCHSIA* forMarshaling);
+
+void unmarshal_VkBufferCollectionConstraintsInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkBufferCollectionConstraintsInfoFUCHSIA* forUnmarshaling);
+
+void marshal_VkBufferConstraintsInfoFUCHSIA(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkBufferConstraintsInfoFUCHSIA* forMarshaling);
+
+void unmarshal_VkBufferConstraintsInfoFUCHSIA(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkBufferConstraintsInfoFUCHSIA* forUnmarshaling);
+
+void marshal_VkBufferCollectionBufferCreateInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferCollectionBufferCreateInfoFUCHSIA* forMarshaling);
+
+void unmarshal_VkBufferCollectionBufferCreateInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkBufferCollectionBufferCreateInfoFUCHSIA* forUnmarshaling);
+
+void marshal_VkSysmemColorSpaceFUCHSIA(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkSysmemColorSpaceFUCHSIA* forMarshaling);
+
+void unmarshal_VkSysmemColorSpaceFUCHSIA(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkSysmemColorSpaceFUCHSIA* forUnmarshaling);
+
+void marshal_VkBufferCollectionPropertiesFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferCollectionPropertiesFUCHSIA* forMarshaling);
+
+void unmarshal_VkBufferCollectionPropertiesFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkBufferCollectionPropertiesFUCHSIA* forUnmarshaling);
+
+void marshal_VkImageFormatConstraintsInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageFormatConstraintsInfoFUCHSIA* forMarshaling);
+
+void unmarshal_VkImageFormatConstraintsInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkImageFormatConstraintsInfoFUCHSIA* forUnmarshaling);
+
+void marshal_VkImageConstraintsInfoFUCHSIA(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkImageConstraintsInfoFUCHSIA* forMarshaling);
+
+void unmarshal_VkImageConstraintsInfoFUCHSIA(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkImageConstraintsInfoFUCHSIA* forUnmarshaling);
+
+#define OP_vkCreateBufferCollectionFUCHSIA 277502099
+#define OP_vkSetBufferCollectionImageConstraintsFUCHSIA 274938613
+#define OP_vkSetBufferCollectionBufferConstraintsFUCHSIA 212810472
+#define OP_vkDestroyBufferCollectionFUCHSIA 224938328
+#define OP_vkGetBufferCollectionPropertiesFUCHSIA 242149782
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+void marshal_VkSubpassShadingPipelineCreateInfoHUAWEI(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSubpassShadingPipelineCreateInfoHUAWEI* forMarshaling);
+
+void unmarshal_VkSubpassShadingPipelineCreateInfoHUAWEI(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkSubpassShadingPipelineCreateInfoHUAWEI* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceSubpassShadingFeaturesHUAWEI(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSubpassShadingFeaturesHUAWEI* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceSubpassShadingFeaturesHUAWEI(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceSubpassShadingFeaturesHUAWEI* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceSubpassShadingPropertiesHUAWEI(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSubpassShadingPropertiesHUAWEI* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceSubpassShadingPropertiesHUAWEI(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceSubpassShadingPropertiesHUAWEI* forUnmarshaling);
+
+#define OP_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI 225288634
+#define OP_vkCmdSubpassShadingHUAWEI 220327607
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+void marshal_VkPhysicalDeviceInvocationMaskFeaturesHUAWEI(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceInvocationMaskFeaturesHUAWEI* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceInvocationMaskFeaturesHUAWEI(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceInvocationMaskFeaturesHUAWEI* forUnmarshaling);
+
+#define OP_vkCmdBindInvocationMaskHUAWEI 299305130
+#endif
+#ifdef VK_NV_external_memory_rdma
+void marshal_VkMemoryGetRemoteAddressInfoNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkMemoryGetRemoteAddressInfoNV* forMarshaling);
+
+void unmarshal_VkMemoryGetRemoteAddressInfoNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              VkMemoryGetRemoteAddressInfoNV* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceExternalMemoryRDMAFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExternalMemoryRDMAFeaturesNV* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceExternalMemoryRDMAFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceExternalMemoryRDMAFeaturesNV* forUnmarshaling);
+
+#define OP_vkGetMemoryRemoteAddressNV 256917597
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+void marshal_VkPhysicalDeviceExtendedDynamicState2FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceExtendedDynamicState2FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceExtendedDynamicState2FeaturesEXT* forUnmarshaling);
+
+#define OP_vkCmdSetPatchControlPointsEXT 208680354
+#define OP_vkCmdSetRasterizerDiscardEnableEXT 245221405
+#define OP_vkCmdSetDepthBiasEnableEXT 259472348
+#define OP_vkCmdSetLogicOpEXT 267481927
+#define OP_vkCmdSetPrimitiveRestartEnableEXT 299567883
+#endif
+#ifdef VK_QNX_screen_surface
+void marshal_VkScreenSurfaceCreateInfoQNX(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkScreenSurfaceCreateInfoQNX* forMarshaling);
+
+void unmarshal_VkScreenSurfaceCreateInfoQNX(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            VkScreenSurfaceCreateInfoQNX* forUnmarshaling);
+
+#define OP_vkCreateScreenSurfaceQNX 224377168
+#define OP_vkGetPhysicalDeviceScreenPresentationSupportQNX 258528902
+#endif
+#ifdef VK_EXT_color_write_enable
+void marshal_VkPhysicalDeviceColorWriteEnableFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceColorWriteEnableFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceColorWriteEnableFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceColorWriteEnableFeaturesEXT* forUnmarshaling);
+
+void marshal_VkPipelineColorWriteCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineColorWriteCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkPipelineColorWriteCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPipelineColorWriteCreateInfoEXT* forUnmarshaling);
+
+#define OP_vkCmdSetColorWriteEnableEXT 202223297
+#endif
+#ifdef VK_GOOGLE_gfxstream
+void marshal_VkImportColorBufferGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkImportColorBufferGOOGLE* forMarshaling);
+
+void unmarshal_VkImportColorBufferGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkImportColorBufferGOOGLE* forUnmarshaling);
+
+void marshal_VkImportBufferGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkImportBufferGOOGLE* forMarshaling);
+
+void unmarshal_VkImportBufferGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    VkImportBufferGOOGLE* forUnmarshaling);
+
+void marshal_VkCreateBlobGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkCreateBlobGOOGLE* forMarshaling);
+
+void unmarshal_VkCreateBlobGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkCreateBlobGOOGLE* forUnmarshaling);
+
+#define OP_vkMapMemoryIntoAddressSpaceGOOGLE 20317
+#define OP_vkUpdateDescriptorSetWithTemplateSizedGOOGLE 20320
+#define OP_vkBeginCommandBufferAsyncGOOGLE 20321
+#define OP_vkEndCommandBufferAsyncGOOGLE 20322
+#define OP_vkResetCommandBufferAsyncGOOGLE 20323
+#define OP_vkCommandBufferHostSyncGOOGLE 20324
+#define OP_vkCreateImageWithRequirementsGOOGLE 20325
+#define OP_vkCreateBufferWithRequirementsGOOGLE 20326
+#define OP_vkGetMemoryHostAddressInfoGOOGLE 20327
+#define OP_vkFreeMemorySyncGOOGLE 20328
+#define OP_vkQueueHostSyncGOOGLE 20329
+#define OP_vkQueueSubmitAsyncGOOGLE 20330
+#define OP_vkQueueWaitIdleAsyncGOOGLE 20331
+#define OP_vkQueueBindSparseAsyncGOOGLE 20332
+#define OP_vkGetLinearImageLayoutGOOGLE 20333
+#define OP_vkGetLinearImageLayout2GOOGLE 282325414
+#define OP_vkQueueFlushCommandsGOOGLE 20340
+#define OP_vkQueueCommitDescriptorSetUpdatesGOOGLE 267932433
+#define OP_vkCollectDescriptorPoolIdsGOOGLE 213659202
+#define OP_vkQueueSignalReleaseImageANDROIDAsyncGOOGLE 243985229
+#define OP_vkQueueFlushCommandsFromAuxMemoryGOOGLE 290633483
+#define OP_vkGetBlobGOOGLE 20341
+#endif
+#ifdef VK_EXT_global_priority_query
+void marshal_VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT* forUnmarshaling);
+
+void marshal_VkQueueFamilyGlobalPriorityPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkQueueFamilyGlobalPriorityPropertiesEXT* forMarshaling);
+
+void unmarshal_VkQueueFamilyGlobalPriorityPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkQueueFamilyGlobalPriorityPropertiesEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_multi_draw
+void marshal_VkPhysicalDeviceMultiDrawFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMultiDrawFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceMultiDrawFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceMultiDrawFeaturesEXT* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceMultiDrawPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMultiDrawPropertiesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceMultiDrawPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceMultiDrawPropertiesEXT* forUnmarshaling);
+
+void marshal_VkMultiDrawInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkMultiDrawInfoEXT* forMarshaling);
+
+void unmarshal_VkMultiDrawInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  VkMultiDrawInfoEXT* forUnmarshaling);
+
+void marshal_VkMultiDrawIndexedInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkMultiDrawIndexedInfoEXT* forMarshaling);
+
+void unmarshal_VkMultiDrawIndexedInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         VkMultiDrawIndexedInfoEXT* forUnmarshaling);
+
+#define OP_vkCmdDrawMultiEXT 263629455
+#define OP_vkCmdDrawMultiIndexedEXT 284764463
+#endif
+#ifdef VK_EXT_load_store_op_none
+#endif
+#ifdef VK_EXT_border_color_swizzle
+void marshal_VkPhysicalDeviceBorderColorSwizzleFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceBorderColorSwizzleFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceBorderColorSwizzleFeaturesEXT* forUnmarshaling);
+
+void marshal_VkSamplerBorderColorComponentMappingCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSamplerBorderColorComponentMappingCreateInfoEXT* forMarshaling);
+
+void unmarshal_VkSamplerBorderColorComponentMappingCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkSamplerBorderColorComponentMappingCreateInfoEXT* forUnmarshaling);
+
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+void marshal_VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT* forMarshaling);
+
+void unmarshal_VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT* forUnmarshaling);
+
+#define OP_vkSetDeviceMemoryPriorityEXT 223991870
+#endif
+#ifdef VK_KHR_acceleration_structure
+void marshal_VkDeviceOrHostAddressKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkDeviceOrHostAddressKHR* forMarshaling);
+
+void unmarshal_VkDeviceOrHostAddressKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        VkDeviceOrHostAddressKHR* forUnmarshaling);
+
+void marshal_VkAccelerationStructureBuildRangeInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureBuildRangeInfoKHR* forMarshaling);
+
+void unmarshal_VkAccelerationStructureBuildRangeInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureBuildRangeInfoKHR* forUnmarshaling);
+
+void marshal_VkAccelerationStructureGeometryTrianglesDataKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureGeometryTrianglesDataKHR* forMarshaling);
+
+void unmarshal_VkAccelerationStructureGeometryTrianglesDataKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureGeometryTrianglesDataKHR* forUnmarshaling);
+
+void marshal_VkAccelerationStructureGeometryAabbsDataKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureGeometryAabbsDataKHR* forMarshaling);
+
+void unmarshal_VkAccelerationStructureGeometryAabbsDataKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureGeometryAabbsDataKHR* forUnmarshaling);
+
+void marshal_VkAccelerationStructureGeometryInstancesDataKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureGeometryInstancesDataKHR* forMarshaling);
+
+void unmarshal_VkAccelerationStructureGeometryInstancesDataKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureGeometryInstancesDataKHR* forUnmarshaling);
+
+void marshal_VkAccelerationStructureGeometryDataKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureGeometryDataKHR* forMarshaling);
+
+void unmarshal_VkAccelerationStructureGeometryDataKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureGeometryDataKHR* forUnmarshaling);
+
+void marshal_VkAccelerationStructureGeometryKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureGeometryKHR* forMarshaling);
+
+void unmarshal_VkAccelerationStructureGeometryKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureGeometryKHR* forUnmarshaling);
+
+void marshal_VkAccelerationStructureBuildGeometryInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureBuildGeometryInfoKHR* forMarshaling);
+
+void unmarshal_VkAccelerationStructureBuildGeometryInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureBuildGeometryInfoKHR* forUnmarshaling);
+
+void marshal_VkAccelerationStructureCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureCreateInfoKHR* forMarshaling);
+
+void unmarshal_VkAccelerationStructureCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureCreateInfoKHR* forUnmarshaling);
+
+void marshal_VkWriteDescriptorSetAccelerationStructureKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkWriteDescriptorSetAccelerationStructureKHR* forMarshaling);
+
+void unmarshal_VkWriteDescriptorSetAccelerationStructureKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkWriteDescriptorSetAccelerationStructureKHR* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceAccelerationStructureFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceAccelerationStructureFeaturesKHR* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceAccelerationStructureFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceAccelerationStructureFeaturesKHR* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceAccelerationStructurePropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceAccelerationStructurePropertiesKHR* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceAccelerationStructurePropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceAccelerationStructurePropertiesKHR* forUnmarshaling);
+
+void marshal_VkAccelerationStructureDeviceAddressInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureDeviceAddressInfoKHR* forMarshaling);
+
+void unmarshal_VkAccelerationStructureDeviceAddressInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureDeviceAddressInfoKHR* forUnmarshaling);
+
+void marshal_VkAccelerationStructureVersionInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureVersionInfoKHR* forMarshaling);
+
+void unmarshal_VkAccelerationStructureVersionInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureVersionInfoKHR* forUnmarshaling);
+
+void marshal_VkCopyAccelerationStructureToMemoryInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCopyAccelerationStructureToMemoryInfoKHR* forMarshaling);
+
+void unmarshal_VkCopyAccelerationStructureToMemoryInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkCopyAccelerationStructureToMemoryInfoKHR* forUnmarshaling);
+
+void marshal_VkCopyMemoryToAccelerationStructureInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCopyMemoryToAccelerationStructureInfoKHR* forMarshaling);
+
+void unmarshal_VkCopyMemoryToAccelerationStructureInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkCopyMemoryToAccelerationStructureInfoKHR* forUnmarshaling);
+
+void marshal_VkCopyAccelerationStructureInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCopyAccelerationStructureInfoKHR* forMarshaling);
+
+void unmarshal_VkCopyAccelerationStructureInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkCopyAccelerationStructureInfoKHR* forUnmarshaling);
+
+void marshal_VkAccelerationStructureBuildSizesInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureBuildSizesInfoKHR* forMarshaling);
+
+void unmarshal_VkAccelerationStructureBuildSizesInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkAccelerationStructureBuildSizesInfoKHR* forUnmarshaling);
+
+#define OP_vkCreateAccelerationStructureKHR 259403971
+#define OP_vkDestroyAccelerationStructureKHR 223971120
+#define OP_vkCmdBuildAccelerationStructuresKHR 272943905
+#define OP_vkCmdBuildAccelerationStructuresIndirectKHR 258066143
+#define OP_vkBuildAccelerationStructuresKHR 241919567
+#define OP_vkCopyAccelerationStructureKHR 241495016
+#define OP_vkCopyAccelerationStructureToMemoryKHR 256139578
+#define OP_vkCopyMemoryToAccelerationStructureKHR 261558680
+#define OP_vkWriteAccelerationStructuresPropertiesKHR 289745796
+#define OP_vkCmdCopyAccelerationStructureKHR 279460332
+#define OP_vkCmdCopyAccelerationStructureToMemoryKHR 223539733
+#define OP_vkCmdCopyMemoryToAccelerationStructureKHR 203733963
+#define OP_vkGetAccelerationStructureDeviceAddressKHR 223466148
+#define OP_vkCmdWriteAccelerationStructuresPropertiesKHR 271696183
+#define OP_vkGetDeviceAccelerationStructureCompatibilityKHR 266386590
+#define OP_vkGetAccelerationStructureBuildSizesKHR 219720024
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+void marshal_VkRayTracingShaderGroupCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRayTracingShaderGroupCreateInfoKHR* forMarshaling);
+
+void unmarshal_VkRayTracingShaderGroupCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkRayTracingShaderGroupCreateInfoKHR* forUnmarshaling);
+
+void marshal_VkRayTracingPipelineInterfaceCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRayTracingPipelineInterfaceCreateInfoKHR* forMarshaling);
+
+void unmarshal_VkRayTracingPipelineInterfaceCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkRayTracingPipelineInterfaceCreateInfoKHR* forUnmarshaling);
+
+void marshal_VkRayTracingPipelineCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRayTracingPipelineCreateInfoKHR* forMarshaling);
+
+void unmarshal_VkRayTracingPipelineCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkRayTracingPipelineCreateInfoKHR* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceRayTracingPipelineFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingPipelineFeaturesKHR* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceRayTracingPipelineFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceRayTracingPipelineFeaturesKHR* forUnmarshaling);
+
+void marshal_VkPhysicalDeviceRayTracingPipelinePropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingPipelinePropertiesKHR* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceRayTracingPipelinePropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceRayTracingPipelinePropertiesKHR* forUnmarshaling);
+
+void marshal_VkStridedDeviceAddressRegionKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkStridedDeviceAddressRegionKHR* forMarshaling);
+
+void unmarshal_VkStridedDeviceAddressRegionKHR(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               VkStridedDeviceAddressRegionKHR* forUnmarshaling);
+
+void marshal_VkTraceRaysIndirectCommandKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkTraceRaysIndirectCommandKHR* forMarshaling);
+
+void unmarshal_VkTraceRaysIndirectCommandKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             VkTraceRaysIndirectCommandKHR* forUnmarshaling);
+
+#define OP_vkCmdTraceRaysKHR 213680716
+#define OP_vkCreateRayTracingPipelinesKHR 247628685
+#define OP_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR 221334934
+#define OP_vkCmdTraceRaysIndirectKHR 211788517
+#define OP_vkGetRayTracingShaderGroupStackSizeKHR 205271933
+#define OP_vkCmdSetRayTracingPipelineStackSizeKHR 260219604
+#endif
+#ifdef VK_KHR_ray_query
+void marshal_VkPhysicalDeviceRayQueryFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRayQueryFeaturesKHR* forMarshaling);
+
+void unmarshal_VkPhysicalDeviceRayQueryFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    VkPhysicalDeviceRayQueryFeaturesKHR* forUnmarshaling);
+
+#endif
+const char* api_opcode_to_string(const uint32_t opcode);
+
+#define OP_vkFirst_old 20000
+#define OP_vkLast_old 30000
+#define OP_vkFirst 200000000
+#define OP_vkLast 300000000
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/goldfish_vk_private_defs.h b/system/vulkan_enc/goldfish_vk_private_defs.h
new file mode 100644
index 0000000..0867320
--- /dev/null
+++ b/system/vulkan_enc/goldfish_vk_private_defs.h
@@ -0,0 +1,38 @@
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#pragma once
+
+#include <vulkan/vulkan.h>
+
+#ifdef __cplusplus
+#include <algorithm>
+#endif
+
+// VulkanStream features
+#define VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT (1 << 0)
+#define VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT (1 << 1)
+#define VULKAN_STREAM_FEATURE_SHADER_FLOAT16_INT8_BIT (1 << 2)
+#define VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT (1 << 3)
+
+#define VK_YCBCR_CONVERSION_DO_NOTHING ((VkSamplerYcbcrConversion)0x1111111111111111)
+
+#ifdef __cplusplus
+
+template<class T, typename F>
+bool arrayany(const T* arr, uint32_t begin, uint32_t end, const F& func) {
+    const T* e = arr + end;
+    return std::find_if(arr + begin, e, func) != e;
+}
+
+#define DEFINE_ALIAS_FUNCTION(ORIGINAL_FN, ALIAS_FN) \
+template <typename... Args> \
+inline auto ALIAS_FN(Args&&... args) -> decltype(ORIGINAL_FN(std::forward<Args>(args)...)) { \
+  return ORIGINAL_FN(std::forward<Args>(args)...); \
+}
+
+#endif
diff --git a/system/vulkan_enc/goldfish_vk_reserved_marshaling_guest.cpp b/system/vulkan_enc/goldfish_vk_reserved_marshaling_guest.cpp
new file mode 100644
index 0000000..0e0c897
--- /dev/null
+++ b/system/vulkan_enc/goldfish_vk_reserved_marshaling_guest.cpp
@@ -0,0 +1,20315 @@
+// Copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2018 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Autogenerated module goldfish_vk_reserved_marshaling_guest
+//
+// (impl) generated by codegen/vulkan/scripts/genvk.py -registry codegen/vulkan/xml/vk.xml cereal -o
+// host/vulkan/cereal
+//
+// Please do not modify directly;
+// re-run gfxstream-protocols/scripts/generate-vulkan-sources.sh,
+// or directly from Python by defining:
+// VULKAN_REGISTRY_XML_DIR : Directory containing vk.xml
+// VULKAN_REGISTRY_SCRIPTS_DIR : Directory containing genvk.py
+// CEREAL_OUTPUT_DIR: Where to put the generated sources.
+//
+// python3 $VULKAN_REGISTRY_SCRIPTS_DIR/genvk.py -registry $VULKAN_REGISTRY_XML_DIR/vk.xml cereal -o
+// $CEREAL_OUTPUT_DIR
+//
+
+#include "goldfish_vk_reserved_marshaling_guest.h"
+
+#include <cstring>
+
+#include "Resources.h"
+#include "goldfish_vk_extension_structs_guest.h"
+#include "goldfish_vk_private_defs.h"
+
+namespace gfxstream {
+namespace vk {
+
+void reservedmarshal_extension_struct(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const void* structExtension, uint8_t** ptr);
+
+void reservedunmarshal_extension_struct(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        void* structExtension_out, uint8_t** ptr);
+
+#ifdef VK_VERSION_1_0
+void reservedmarshal_VkExtent2D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkExtent2D* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->width, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->height, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkExtent3D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkExtent3D* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->width, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->height, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->depth, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkOffset2D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkOffset2D* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (int32_t*)&forMarshaling->x, sizeof(int32_t));
+    *ptr += sizeof(int32_t);
+    memcpy(*ptr, (int32_t*)&forMarshaling->y, sizeof(int32_t));
+    *ptr += sizeof(int32_t);
+}
+
+void reservedmarshal_VkOffset3D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkOffset3D* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (int32_t*)&forMarshaling->x, sizeof(int32_t));
+    *ptr += sizeof(int32_t);
+    memcpy(*ptr, (int32_t*)&forMarshaling->y, sizeof(int32_t));
+    *ptr += sizeof(int32_t);
+    memcpy(*ptr, (int32_t*)&forMarshaling->z, sizeof(int32_t));
+    *ptr += sizeof(int32_t);
+}
+
+void reservedmarshal_VkRect2D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                              const VkRect2D* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    reservedmarshal_VkOffset2D(vkStream, rootType, (VkOffset2D*)(&forMarshaling->offset), ptr);
+    reservedmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->extent), ptr);
+}
+
+void reservedmarshal_VkBaseInStructure(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkBaseInStructure* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+}
+
+void reservedmarshal_VkBaseOutStructure(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkBaseOutStructure* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+}
+
+void reservedmarshal_VkBufferMemoryBarrier(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkBufferMemoryBarrier* forMarshaling,
+                                           uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkAccessFlags*)&forMarshaling->srcAccessMask, sizeof(VkAccessFlags));
+    *ptr += sizeof(VkAccessFlags);
+    memcpy(*ptr, (VkAccessFlags*)&forMarshaling->dstAccessMask, sizeof(VkAccessFlags));
+    *ptr += sizeof(VkAccessFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->srcQueueFamilyIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->dstQueueFamilyIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&forMarshaling->buffer));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->offset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+}
+
+void reservedmarshal_VkDispatchIndirectCommand(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkDispatchIndirectCommand* forMarshaling,
+                                               uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->x, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->y, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->z, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkDrawIndexedIndirectCommand(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkDrawIndexedIndirectCommand* forMarshaling,
+                                                  uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->indexCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->instanceCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->firstIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (int32_t*)&forMarshaling->vertexOffset, sizeof(int32_t));
+    *ptr += sizeof(int32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->firstInstance, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkDrawIndirectCommand(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkDrawIndirectCommand* forMarshaling,
+                                           uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->vertexCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->instanceCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->firstVertex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->firstInstance, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkImageSubresourceRange(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkImageSubresourceRange* forMarshaling,
+                                             uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkImageAspectFlags*)&forMarshaling->aspectMask, sizeof(VkImageAspectFlags));
+    *ptr += sizeof(VkImageAspectFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->baseMipLevel, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->levelCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->baseArrayLayer, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->layerCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkImageMemoryBarrier(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkImageMemoryBarrier* forMarshaling,
+                                          uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkAccessFlags*)&forMarshaling->srcAccessMask, sizeof(VkAccessFlags));
+    *ptr += sizeof(VkAccessFlags);
+    memcpy(*ptr, (VkAccessFlags*)&forMarshaling->dstAccessMask, sizeof(VkAccessFlags));
+    *ptr += sizeof(VkAccessFlags);
+    memcpy(*ptr, (VkImageLayout*)&forMarshaling->oldLayout, sizeof(VkImageLayout));
+    *ptr += sizeof(VkImageLayout);
+    memcpy(*ptr, (VkImageLayout*)&forMarshaling->newLayout, sizeof(VkImageLayout));
+    *ptr += sizeof(VkImageLayout);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->srcQueueFamilyIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->dstQueueFamilyIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImage((*&forMarshaling->image));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    reservedmarshal_VkImageSubresourceRange(
+        vkStream, rootType, (VkImageSubresourceRange*)(&forMarshaling->subresourceRange), ptr);
+}
+
+void reservedmarshal_VkMemoryBarrier(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkMemoryBarrier* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkAccessFlags*)&forMarshaling->srcAccessMask, sizeof(VkAccessFlags));
+    *ptr += sizeof(VkAccessFlags);
+    memcpy(*ptr, (VkAccessFlags*)&forMarshaling->dstAccessMask, sizeof(VkAccessFlags));
+    *ptr += sizeof(VkAccessFlags);
+}
+
+void reservedmarshal_VkPipelineCacheHeaderVersionOne(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineCacheHeaderVersionOne* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->headerSize, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkPipelineCacheHeaderVersion*)&forMarshaling->headerVersion,
+           sizeof(VkPipelineCacheHeaderVersion));
+    *ptr += sizeof(VkPipelineCacheHeaderVersion);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->vendorID, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->deviceID, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint8_t*)forMarshaling->pipelineCacheUUID, VK_UUID_SIZE * sizeof(uint8_t));
+    *ptr += VK_UUID_SIZE * sizeof(uint8_t);
+}
+
+void reservedmarshal_VkAllocationCallbacks(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkAllocationCallbacks* forMarshaling,
+                                           uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pUserData;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pUserData) {
+        memcpy(*ptr, (void*)forMarshaling->pUserData, sizeof(uint8_t));
+        *ptr += sizeof(uint8_t);
+    }
+    uint64_t cgen_var_1 = (uint64_t)forMarshaling->pfnAllocation;
+    memcpy((*ptr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    uint64_t cgen_var_2 = (uint64_t)forMarshaling->pfnReallocation;
+    memcpy((*ptr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    uint64_t cgen_var_3 = (uint64_t)forMarshaling->pfnFree;
+    memcpy((*ptr), &cgen_var_3, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    uint64_t cgen_var_4 = (uint64_t)forMarshaling->pfnInternalAllocation;
+    memcpy((*ptr), &cgen_var_4, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    uint64_t cgen_var_5 = (uint64_t)forMarshaling->pfnInternalFree;
+    memcpy((*ptr), &cgen_var_5, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+}
+
+void reservedmarshal_VkApplicationInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkApplicationInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) {
+        // WARNING PTR CHECK
+        uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pApplicationName;
+        memcpy((*ptr), &cgen_var_0, 8);
+        android::base::Stream::toBe64((uint8_t*)(*ptr));
+        *ptr += 8;
+        if (forMarshaling->pApplicationName) {
+            {
+                uint32_t l =
+                    forMarshaling->pApplicationName ? strlen(forMarshaling->pApplicationName) : 0;
+                memcpy(*ptr, (uint32_t*)&l, sizeof(uint32_t));
+                android::base::Stream::toBe32((uint8_t*)*ptr);
+                *ptr += sizeof(uint32_t);
+                memcpy(*ptr, (char*)forMarshaling->pApplicationName, l);
+                *ptr += l;
+            }
+        }
+    } else {
+        {
+            uint32_t l =
+                forMarshaling->pApplicationName ? strlen(forMarshaling->pApplicationName) : 0;
+            memcpy(*ptr, (uint32_t*)&l, sizeof(uint32_t));
+            android::base::Stream::toBe32((uint8_t*)*ptr);
+            *ptr += sizeof(uint32_t);
+            memcpy(*ptr, (char*)forMarshaling->pApplicationName, l);
+            *ptr += l;
+        }
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->applicationVersion, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) {
+        // WARNING PTR CHECK
+        uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pEngineName;
+        memcpy((*ptr), &cgen_var_0, 8);
+        android::base::Stream::toBe64((uint8_t*)(*ptr));
+        *ptr += 8;
+        if (forMarshaling->pEngineName) {
+            {
+                uint32_t l = forMarshaling->pEngineName ? strlen(forMarshaling->pEngineName) : 0;
+                memcpy(*ptr, (uint32_t*)&l, sizeof(uint32_t));
+                android::base::Stream::toBe32((uint8_t*)*ptr);
+                *ptr += sizeof(uint32_t);
+                memcpy(*ptr, (char*)forMarshaling->pEngineName, l);
+                *ptr += l;
+            }
+        }
+    } else {
+        {
+            uint32_t l = forMarshaling->pEngineName ? strlen(forMarshaling->pEngineName) : 0;
+            memcpy(*ptr, (uint32_t*)&l, sizeof(uint32_t));
+            android::base::Stream::toBe32((uint8_t*)*ptr);
+            *ptr += sizeof(uint32_t);
+            memcpy(*ptr, (char*)forMarshaling->pEngineName, l);
+            *ptr += l;
+        }
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->engineVersion, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->apiVersion, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkFormatProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkFormatProperties* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkFormatFeatureFlags*)&forMarshaling->linearTilingFeatures,
+           sizeof(VkFormatFeatureFlags));
+    *ptr += sizeof(VkFormatFeatureFlags);
+    memcpy(*ptr, (VkFormatFeatureFlags*)&forMarshaling->optimalTilingFeatures,
+           sizeof(VkFormatFeatureFlags));
+    *ptr += sizeof(VkFormatFeatureFlags);
+    memcpy(*ptr, (VkFormatFeatureFlags*)&forMarshaling->bufferFeatures,
+           sizeof(VkFormatFeatureFlags));
+    *ptr += sizeof(VkFormatFeatureFlags);
+}
+
+void reservedmarshal_VkImageFormatProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkImageFormatProperties* forMarshaling,
+                                             uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    reservedmarshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forMarshaling->maxExtent), ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxMipLevels, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxArrayLayers, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkSampleCountFlags*)&forMarshaling->sampleCounts, sizeof(VkSampleCountFlags));
+    *ptr += sizeof(VkSampleCountFlags);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->maxResourceSize, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+}
+
+void reservedmarshal_VkInstanceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkInstanceCreateInfo* forMarshaling,
+                                          uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkInstanceCreateFlags*)&forMarshaling->flags, sizeof(VkInstanceCreateFlags));
+    *ptr += sizeof(VkInstanceCreateFlags);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pApplicationInfo;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pApplicationInfo) {
+        reservedmarshal_VkApplicationInfo(
+            vkStream, rootType, (const VkApplicationInfo*)(forMarshaling->pApplicationInfo), ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->enabledLayerCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    {
+        uint32_t c = 0;
+        if (forMarshaling) {
+            c = forMarshaling->enabledLayerCount;
+        }
+        memcpy(*ptr, (uint32_t*)&c, sizeof(uint32_t));
+        android::base::Stream::toBe32((uint8_t*)*ptr);
+        *ptr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < c; ++i) {
+            uint32_t l = forMarshaling->ppEnabledLayerNames
+                             ? strlen(forMarshaling->ppEnabledLayerNames[i])
+                             : 0;
+            memcpy(*ptr, (uint32_t*)&l, sizeof(uint32_t));
+            android::base::Stream::toBe32((uint8_t*)*ptr);
+            *ptr += sizeof(uint32_t);
+            if (l) {
+                memcpy(*ptr, (char*)(forMarshaling->ppEnabledLayerNames[i]), l);
+                *ptr += l;
+            }
+        }
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->enabledExtensionCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    {
+        uint32_t c = 0;
+        if (forMarshaling) {
+            c = forMarshaling->enabledExtensionCount;
+        }
+        memcpy(*ptr, (uint32_t*)&c, sizeof(uint32_t));
+        android::base::Stream::toBe32((uint8_t*)*ptr);
+        *ptr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < c; ++i) {
+            uint32_t l = forMarshaling->ppEnabledExtensionNames
+                             ? strlen(forMarshaling->ppEnabledExtensionNames[i])
+                             : 0;
+            memcpy(*ptr, (uint32_t*)&l, sizeof(uint32_t));
+            android::base::Stream::toBe32((uint8_t*)*ptr);
+            *ptr += sizeof(uint32_t);
+            if (l) {
+                memcpy(*ptr, (char*)(forMarshaling->ppEnabledExtensionNames[i]), l);
+                *ptr += l;
+            }
+        }
+    }
+}
+
+void reservedmarshal_VkMemoryHeap(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkMemoryHeap* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkMemoryHeapFlags*)&forMarshaling->flags, sizeof(VkMemoryHeapFlags));
+    *ptr += sizeof(VkMemoryHeapFlags);
+}
+
+void reservedmarshal_VkMemoryType(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkMemoryType* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkMemoryPropertyFlags*)&forMarshaling->propertyFlags,
+           sizeof(VkMemoryPropertyFlags));
+    *ptr += sizeof(VkMemoryPropertyFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->heapIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkPhysicalDeviceFeatures(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkPhysicalDeviceFeatures* forMarshaling,
+                                              uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkBool32*)&forMarshaling->robustBufferAccess, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->fullDrawIndexUint32, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->imageCubeArray, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->independentBlend, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->geometryShader, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->tessellationShader, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->sampleRateShading, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->dualSrcBlend, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->logicOp, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->multiDrawIndirect, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->drawIndirectFirstInstance, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->depthClamp, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->depthBiasClamp, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->fillModeNonSolid, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->depthBounds, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->wideLines, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->largePoints, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->alphaToOne, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->multiViewport, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->samplerAnisotropy, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->textureCompressionETC2, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->textureCompressionASTC_LDR, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->textureCompressionBC, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->occlusionQueryPrecise, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->pipelineStatisticsQuery, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->vertexPipelineStoresAndAtomics, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->fragmentStoresAndAtomics, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderTessellationAndGeometryPointSize,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderImageGatherExtended, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderStorageImageExtendedFormats, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderStorageImageMultisample, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderStorageImageReadWithoutFormat, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderStorageImageWriteWithoutFormat, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderUniformBufferArrayDynamicIndexing,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderSampledImageArrayDynamicIndexing,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderStorageBufferArrayDynamicIndexing,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderStorageImageArrayDynamicIndexing,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderClipDistance, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderCullDistance, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderFloat64, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderInt64, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderInt16, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderResourceResidency, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderResourceMinLod, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->sparseBinding, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->sparseResidencyBuffer, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->sparseResidencyImage2D, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->sparseResidencyImage3D, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->sparseResidency2Samples, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->sparseResidency4Samples, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->sparseResidency8Samples, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->sparseResidency16Samples, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->sparseResidencyAliased, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->variableMultisampleRate, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->inheritedQueries, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceLimits(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkPhysicalDeviceLimits* forMarshaling,
+                                            uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxImageDimension1D, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxImageDimension2D, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxImageDimension3D, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxImageDimensionCube, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxImageArrayLayers, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxTexelBufferElements, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxUniformBufferRange, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxStorageBufferRange, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPushConstantsSize, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxMemoryAllocationCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxSamplerAllocationCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->bufferImageGranularity, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->sparseAddressSpaceSize, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxBoundDescriptorSets, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPerStageDescriptorSamplers, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPerStageDescriptorUniformBuffers, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPerStageDescriptorStorageBuffers, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPerStageDescriptorSampledImages, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPerStageDescriptorStorageImages, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPerStageDescriptorInputAttachments,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPerStageResources, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetSamplers, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetUniformBuffers, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetUniformBuffersDynamic,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetStorageBuffers, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetStorageBuffersDynamic,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetSampledImages, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetStorageImages, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetInputAttachments, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxVertexInputAttributes, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxVertexInputBindings, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxVertexInputAttributeOffset, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxVertexInputBindingStride, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxVertexOutputComponents, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxTessellationGenerationLevel, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxTessellationPatchSize, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxTessellationControlPerVertexInputComponents,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxTessellationControlPerVertexOutputComponents,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxTessellationControlPerPatchOutputComponents,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxTessellationControlTotalOutputComponents,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxTessellationEvaluationInputComponents,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxTessellationEvaluationOutputComponents,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxGeometryShaderInvocations, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxGeometryInputComponents, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxGeometryOutputComponents, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxGeometryOutputVertices, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxGeometryTotalOutputComponents, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxFragmentInputComponents, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxFragmentOutputAttachments, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxFragmentDualSrcAttachments, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxFragmentCombinedOutputResources, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxComputeSharedMemorySize, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)forMarshaling->maxComputeWorkGroupCount, 3 * sizeof(uint32_t));
+    *ptr += 3 * sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxComputeWorkGroupInvocations, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)forMarshaling->maxComputeWorkGroupSize, 3 * sizeof(uint32_t));
+    *ptr += 3 * sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->subPixelPrecisionBits, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->subTexelPrecisionBits, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->mipmapPrecisionBits, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDrawIndexedIndexValue, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDrawIndirectCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (float*)&forMarshaling->maxSamplerLodBias, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->maxSamplerAnisotropy, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxViewports, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)forMarshaling->maxViewportDimensions, 2 * sizeof(uint32_t));
+    *ptr += 2 * sizeof(uint32_t);
+    memcpy(*ptr, (float*)forMarshaling->viewportBoundsRange, 2 * sizeof(float));
+    *ptr += 2 * sizeof(float);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->viewportSubPixelBits, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->minMemoryMapAlignment;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->minTexelBufferOffsetAlignment,
+           sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->minUniformBufferOffsetAlignment,
+           sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->minStorageBufferOffsetAlignment,
+           sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (int32_t*)&forMarshaling->minTexelOffset, sizeof(int32_t));
+    *ptr += sizeof(int32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxTexelOffset, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (int32_t*)&forMarshaling->minTexelGatherOffset, sizeof(int32_t));
+    *ptr += sizeof(int32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxTexelGatherOffset, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (float*)&forMarshaling->minInterpolationOffset, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->maxInterpolationOffset, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->subPixelInterpolationOffsetBits, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxFramebufferWidth, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxFramebufferHeight, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxFramebufferLayers, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkSampleCountFlags*)&forMarshaling->framebufferColorSampleCounts,
+           sizeof(VkSampleCountFlags));
+    *ptr += sizeof(VkSampleCountFlags);
+    memcpy(*ptr, (VkSampleCountFlags*)&forMarshaling->framebufferDepthSampleCounts,
+           sizeof(VkSampleCountFlags));
+    *ptr += sizeof(VkSampleCountFlags);
+    memcpy(*ptr, (VkSampleCountFlags*)&forMarshaling->framebufferStencilSampleCounts,
+           sizeof(VkSampleCountFlags));
+    *ptr += sizeof(VkSampleCountFlags);
+    memcpy(*ptr, (VkSampleCountFlags*)&forMarshaling->framebufferNoAttachmentsSampleCounts,
+           sizeof(VkSampleCountFlags));
+    *ptr += sizeof(VkSampleCountFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxColorAttachments, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkSampleCountFlags*)&forMarshaling->sampledImageColorSampleCounts,
+           sizeof(VkSampleCountFlags));
+    *ptr += sizeof(VkSampleCountFlags);
+    memcpy(*ptr, (VkSampleCountFlags*)&forMarshaling->sampledImageIntegerSampleCounts,
+           sizeof(VkSampleCountFlags));
+    *ptr += sizeof(VkSampleCountFlags);
+    memcpy(*ptr, (VkSampleCountFlags*)&forMarshaling->sampledImageDepthSampleCounts,
+           sizeof(VkSampleCountFlags));
+    *ptr += sizeof(VkSampleCountFlags);
+    memcpy(*ptr, (VkSampleCountFlags*)&forMarshaling->sampledImageStencilSampleCounts,
+           sizeof(VkSampleCountFlags));
+    *ptr += sizeof(VkSampleCountFlags);
+    memcpy(*ptr, (VkSampleCountFlags*)&forMarshaling->storageImageSampleCounts,
+           sizeof(VkSampleCountFlags));
+    *ptr += sizeof(VkSampleCountFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxSampleMaskWords, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->timestampComputeAndGraphics, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (float*)&forMarshaling->timestampPeriod, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxClipDistances, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxCullDistances, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxCombinedClipAndCullDistances, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->discreteQueuePriorities, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (float*)forMarshaling->pointSizeRange, 2 * sizeof(float));
+    *ptr += 2 * sizeof(float);
+    memcpy(*ptr, (float*)forMarshaling->lineWidthRange, 2 * sizeof(float));
+    *ptr += 2 * sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->pointSizeGranularity, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->lineWidthGranularity, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->strictLines, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->standardSampleLocations, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->optimalBufferCopyOffsetAlignment,
+           sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->optimalBufferCopyRowPitchAlignment,
+           sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->nonCoherentAtomSize, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+}
+
+void reservedmarshal_VkPhysicalDeviceMemoryProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMemoryProperties* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->memoryTypeCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)VK_MAX_MEMORY_TYPES; ++i) {
+        reservedmarshal_VkMemoryType(vkStream, rootType,
+                                     (VkMemoryType*)(forMarshaling->memoryTypes + i), ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->memoryHeapCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)VK_MAX_MEMORY_HEAPS; ++i) {
+        reservedmarshal_VkMemoryHeap(vkStream, rootType,
+                                     (VkMemoryHeap*)(forMarshaling->memoryHeaps + i), ptr);
+    }
+}
+
+void reservedmarshal_VkPhysicalDeviceSparseProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSparseProperties* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkBool32*)&forMarshaling->residencyStandard2DBlockShape, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->residencyStandard2DMultisampleBlockShape,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->residencyStandard3DBlockShape, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->residencyAlignedMipSize, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->residencyNonResidentStrict, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceProperties(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkPhysicalDeviceProperties* forMarshaling,
+                                                uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->apiVersion, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->driverVersion, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->vendorID, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->deviceID, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkPhysicalDeviceType*)&forMarshaling->deviceType, sizeof(VkPhysicalDeviceType));
+    *ptr += sizeof(VkPhysicalDeviceType);
+    memcpy(*ptr, (char*)forMarshaling->deviceName, VK_MAX_PHYSICAL_DEVICE_NAME_SIZE * sizeof(char));
+    *ptr += VK_MAX_PHYSICAL_DEVICE_NAME_SIZE * sizeof(char);
+    memcpy(*ptr, (uint8_t*)forMarshaling->pipelineCacheUUID, VK_UUID_SIZE * sizeof(uint8_t));
+    *ptr += VK_UUID_SIZE * sizeof(uint8_t);
+    reservedmarshal_VkPhysicalDeviceLimits(vkStream, rootType,
+                                           (VkPhysicalDeviceLimits*)(&forMarshaling->limits), ptr);
+    reservedmarshal_VkPhysicalDeviceSparseProperties(
+        vkStream, rootType, (VkPhysicalDeviceSparseProperties*)(&forMarshaling->sparseProperties),
+        ptr);
+}
+
+void reservedmarshal_VkQueueFamilyProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkQueueFamilyProperties* forMarshaling,
+                                             uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkQueueFlags*)&forMarshaling->queueFlags, sizeof(VkQueueFlags));
+    *ptr += sizeof(VkQueueFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->queueCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->timestampValidBits, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    reservedmarshal_VkExtent3D(vkStream, rootType,
+                               (VkExtent3D*)(&forMarshaling->minImageTransferGranularity), ptr);
+}
+
+void reservedmarshal_VkDeviceQueueCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkDeviceQueueCreateInfo* forMarshaling,
+                                             uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDeviceQueueCreateFlags*)&forMarshaling->flags,
+           sizeof(VkDeviceQueueCreateFlags));
+    *ptr += sizeof(VkDeviceQueueCreateFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->queueFamilyIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->queueCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const float*)forMarshaling->pQueuePriorities,
+           forMarshaling->queueCount * sizeof(const float));
+    *ptr += forMarshaling->queueCount * sizeof(const float);
+}
+
+void reservedmarshal_VkDeviceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkDeviceCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDeviceCreateFlags*)&forMarshaling->flags, sizeof(VkDeviceCreateFlags));
+    *ptr += sizeof(VkDeviceCreateFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->queueCreateInfoCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->queueCreateInfoCount; ++i) {
+        reservedmarshal_VkDeviceQueueCreateInfo(
+            vkStream, rootType,
+            (const VkDeviceQueueCreateInfo*)(forMarshaling->pQueueCreateInfos + i), ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->enabledLayerCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    {
+        uint32_t c = 0;
+        if (forMarshaling) {
+            c = forMarshaling->enabledLayerCount;
+        }
+        memcpy(*ptr, (uint32_t*)&c, sizeof(uint32_t));
+        android::base::Stream::toBe32((uint8_t*)*ptr);
+        *ptr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < c; ++i) {
+            uint32_t l = forMarshaling->ppEnabledLayerNames
+                             ? strlen(forMarshaling->ppEnabledLayerNames[i])
+                             : 0;
+            memcpy(*ptr, (uint32_t*)&l, sizeof(uint32_t));
+            android::base::Stream::toBe32((uint8_t*)*ptr);
+            *ptr += sizeof(uint32_t);
+            if (l) {
+                memcpy(*ptr, (char*)(forMarshaling->ppEnabledLayerNames[i]), l);
+                *ptr += l;
+            }
+        }
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->enabledExtensionCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    {
+        uint32_t c = 0;
+        if (forMarshaling) {
+            c = forMarshaling->enabledExtensionCount;
+        }
+        memcpy(*ptr, (uint32_t*)&c, sizeof(uint32_t));
+        android::base::Stream::toBe32((uint8_t*)*ptr);
+        *ptr += sizeof(uint32_t);
+        for (uint32_t i = 0; i < c; ++i) {
+            uint32_t l = forMarshaling->ppEnabledExtensionNames
+                             ? strlen(forMarshaling->ppEnabledExtensionNames[i])
+                             : 0;
+            memcpy(*ptr, (uint32_t*)&l, sizeof(uint32_t));
+            android::base::Stream::toBe32((uint8_t*)*ptr);
+            *ptr += sizeof(uint32_t);
+            if (l) {
+                memcpy(*ptr, (char*)(forMarshaling->ppEnabledExtensionNames[i]), l);
+                *ptr += l;
+            }
+        }
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pEnabledFeatures;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pEnabledFeatures) {
+        reservedmarshal_VkPhysicalDeviceFeatures(
+            vkStream, rootType, (const VkPhysicalDeviceFeatures*)(forMarshaling->pEnabledFeatures),
+            ptr);
+    }
+}
+
+void reservedmarshal_VkExtensionProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkExtensionProperties* forMarshaling,
+                                           uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (char*)forMarshaling->extensionName, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
+    *ptr += VK_MAX_EXTENSION_NAME_SIZE * sizeof(char);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->specVersion, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkLayerProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkLayerProperties* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (char*)forMarshaling->layerName, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
+    *ptr += VK_MAX_EXTENSION_NAME_SIZE * sizeof(char);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->specVersion, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->implementationVersion, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (char*)forMarshaling->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    *ptr += VK_MAX_DESCRIPTION_SIZE * sizeof(char);
+}
+
+void reservedmarshal_VkSubmitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkSubmitInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->waitSemaphoreCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    if (forMarshaling->waitSemaphoreCount) {
+        uint8_t* cgen_var_0_ptr = (uint8_t*)(*ptr);
+        if (forMarshaling) {
+            for (uint32_t k = 0; k < forMarshaling->waitSemaphoreCount; ++k) {
+                uint64_t tmpval = get_host_u64_VkSemaphore(forMarshaling->pWaitSemaphores[k]);
+                memcpy(cgen_var_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+            }
+        }
+        *ptr += 8 * forMarshaling->waitSemaphoreCount;
+    }
+    memcpy(*ptr, (const VkPipelineStageFlags*)forMarshaling->pWaitDstStageMask,
+           forMarshaling->waitSemaphoreCount * sizeof(const VkPipelineStageFlags));
+    *ptr += forMarshaling->waitSemaphoreCount * sizeof(const VkPipelineStageFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->commandBufferCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    if (forMarshaling->commandBufferCount) {
+        uint8_t* cgen_var_1_ptr = (uint8_t*)(*ptr);
+        if (forMarshaling) {
+            for (uint32_t k = 0; k < forMarshaling->commandBufferCount; ++k) {
+                uint64_t tmpval = get_host_u64_VkCommandBuffer(forMarshaling->pCommandBuffers[k]);
+                memcpy(cgen_var_1_ptr + k * 8, &tmpval, sizeof(uint64_t));
+            }
+        }
+        *ptr += 8 * forMarshaling->commandBufferCount;
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->signalSemaphoreCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    if (forMarshaling->signalSemaphoreCount) {
+        uint8_t* cgen_var_2_ptr = (uint8_t*)(*ptr);
+        if (forMarshaling) {
+            for (uint32_t k = 0; k < forMarshaling->signalSemaphoreCount; ++k) {
+                uint64_t tmpval = get_host_u64_VkSemaphore(forMarshaling->pSignalSemaphores[k]);
+                memcpy(cgen_var_2_ptr + k * 8, &tmpval, sizeof(uint64_t));
+            }
+        }
+        *ptr += 8 * forMarshaling->signalSemaphoreCount;
+    }
+}
+
+void reservedmarshal_VkMappedMemoryRange(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkMappedMemoryRange* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDeviceMemory((*&forMarshaling->memory));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->offset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+}
+
+void reservedmarshal_VkMemoryAllocateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkMemoryAllocateInfo* forMarshaling,
+                                          uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->allocationSize, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->memoryTypeIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkMemoryRequirements(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkMemoryRequirements* forMarshaling,
+                                          uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->alignment, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->memoryTypeBits, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkSparseMemoryBind(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkSparseMemoryBind* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->resourceOffset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDeviceMemory((*&forMarshaling->memory));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->memoryOffset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkSparseMemoryBindFlags*)&forMarshaling->flags, sizeof(VkSparseMemoryBindFlags));
+    *ptr += sizeof(VkSparseMemoryBindFlags);
+}
+
+void reservedmarshal_VkSparseBufferMemoryBindInfo(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkSparseBufferMemoryBindInfo* forMarshaling,
+                                                  uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&forMarshaling->buffer));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->bindCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->bindCount; ++i) {
+        reservedmarshal_VkSparseMemoryBind(
+            vkStream, rootType, (const VkSparseMemoryBind*)(forMarshaling->pBinds + i), ptr);
+    }
+}
+
+void reservedmarshal_VkSparseImageOpaqueMemoryBindInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSparseImageOpaqueMemoryBindInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImage((*&forMarshaling->image));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->bindCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->bindCount; ++i) {
+        reservedmarshal_VkSparseMemoryBind(
+            vkStream, rootType, (const VkSparseMemoryBind*)(forMarshaling->pBinds + i), ptr);
+    }
+}
+
+void reservedmarshal_VkImageSubresource(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkImageSubresource* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkImageAspectFlags*)&forMarshaling->aspectMask, sizeof(VkImageAspectFlags));
+    *ptr += sizeof(VkImageAspectFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->mipLevel, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->arrayLayer, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkSparseImageMemoryBind(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkSparseImageMemoryBind* forMarshaling,
+                                             uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    reservedmarshal_VkImageSubresource(vkStream, rootType,
+                                       (VkImageSubresource*)(&forMarshaling->subresource), ptr);
+    reservedmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forMarshaling->offset), ptr);
+    reservedmarshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forMarshaling->extent), ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDeviceMemory((*&forMarshaling->memory));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->memoryOffset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkSparseMemoryBindFlags*)&forMarshaling->flags, sizeof(VkSparseMemoryBindFlags));
+    *ptr += sizeof(VkSparseMemoryBindFlags);
+}
+
+void reservedmarshal_VkSparseImageMemoryBindInfo(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkSparseImageMemoryBindInfo* forMarshaling,
+                                                 uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImage((*&forMarshaling->image));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->bindCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->bindCount; ++i) {
+        reservedmarshal_VkSparseImageMemoryBind(
+            vkStream, rootType, (const VkSparseImageMemoryBind*)(forMarshaling->pBinds + i), ptr);
+    }
+}
+
+void reservedmarshal_VkBindSparseInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkBindSparseInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->waitSemaphoreCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    if (forMarshaling->waitSemaphoreCount) {
+        uint8_t* cgen_var_0_ptr = (uint8_t*)(*ptr);
+        if (forMarshaling) {
+            for (uint32_t k = 0; k < forMarshaling->waitSemaphoreCount; ++k) {
+                uint64_t tmpval = get_host_u64_VkSemaphore(forMarshaling->pWaitSemaphores[k]);
+                memcpy(cgen_var_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+            }
+        }
+        *ptr += 8 * forMarshaling->waitSemaphoreCount;
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->bufferBindCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->bufferBindCount; ++i) {
+        reservedmarshal_VkSparseBufferMemoryBindInfo(
+            vkStream, rootType,
+            (const VkSparseBufferMemoryBindInfo*)(forMarshaling->pBufferBinds + i), ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->imageOpaqueBindCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->imageOpaqueBindCount; ++i) {
+        reservedmarshal_VkSparseImageOpaqueMemoryBindInfo(
+            vkStream, rootType,
+            (const VkSparseImageOpaqueMemoryBindInfo*)(forMarshaling->pImageOpaqueBinds + i), ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->imageBindCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->imageBindCount; ++i) {
+        reservedmarshal_VkSparseImageMemoryBindInfo(
+            vkStream, rootType,
+            (const VkSparseImageMemoryBindInfo*)(forMarshaling->pImageBinds + i), ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->signalSemaphoreCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    if (forMarshaling->signalSemaphoreCount) {
+        uint8_t* cgen_var_1_ptr = (uint8_t*)(*ptr);
+        if (forMarshaling) {
+            for (uint32_t k = 0; k < forMarshaling->signalSemaphoreCount; ++k) {
+                uint64_t tmpval = get_host_u64_VkSemaphore(forMarshaling->pSignalSemaphores[k]);
+                memcpy(cgen_var_1_ptr + k * 8, &tmpval, sizeof(uint64_t));
+            }
+        }
+        *ptr += 8 * forMarshaling->signalSemaphoreCount;
+    }
+}
+
+void reservedmarshal_VkSparseImageFormatProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSparseImageFormatProperties* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkImageAspectFlags*)&forMarshaling->aspectMask, sizeof(VkImageAspectFlags));
+    *ptr += sizeof(VkImageAspectFlags);
+    reservedmarshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forMarshaling->imageGranularity),
+                               ptr);
+    memcpy(*ptr, (VkSparseImageFormatFlags*)&forMarshaling->flags,
+           sizeof(VkSparseImageFormatFlags));
+    *ptr += sizeof(VkSparseImageFormatFlags);
+}
+
+void reservedmarshal_VkSparseImageMemoryRequirements(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSparseImageMemoryRequirements* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    reservedmarshal_VkSparseImageFormatProperties(
+        vkStream, rootType, (VkSparseImageFormatProperties*)(&forMarshaling->formatProperties),
+        ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->imageMipTailFirstLod, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->imageMipTailSize, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->imageMipTailOffset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->imageMipTailStride, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+}
+
+void reservedmarshal_VkFenceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkFenceCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkFenceCreateFlags*)&forMarshaling->flags, sizeof(VkFenceCreateFlags));
+    *ptr += sizeof(VkFenceCreateFlags);
+}
+
+void reservedmarshal_VkSemaphoreCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkSemaphoreCreateInfo* forMarshaling,
+                                           uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkSemaphoreCreateFlags*)&forMarshaling->flags, sizeof(VkSemaphoreCreateFlags));
+    *ptr += sizeof(VkSemaphoreCreateFlags);
+}
+
+void reservedmarshal_VkEventCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkEventCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkEventCreateFlags*)&forMarshaling->flags, sizeof(VkEventCreateFlags));
+    *ptr += sizeof(VkEventCreateFlags);
+}
+
+void reservedmarshal_VkQueryPoolCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkQueryPoolCreateInfo* forMarshaling,
+                                           uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkQueryPoolCreateFlags*)&forMarshaling->flags, sizeof(VkQueryPoolCreateFlags));
+    *ptr += sizeof(VkQueryPoolCreateFlags);
+    memcpy(*ptr, (VkQueryType*)&forMarshaling->queryType, sizeof(VkQueryType));
+    *ptr += sizeof(VkQueryType);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->queryCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkQueryPipelineStatisticFlags*)&forMarshaling->pipelineStatistics,
+           sizeof(VkQueryPipelineStatisticFlags));
+    *ptr += sizeof(VkQueryPipelineStatisticFlags);
+}
+
+void reservedmarshal_VkBufferCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkBufferCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBufferCreateFlags*)&forMarshaling->flags, sizeof(VkBufferCreateFlags));
+    *ptr += sizeof(VkBufferCreateFlags);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkBufferUsageFlags*)&forMarshaling->usage, sizeof(VkBufferUsageFlags));
+    *ptr += sizeof(VkBufferUsageFlags);
+    memcpy(*ptr, (VkSharingMode*)&forMarshaling->sharingMode, sizeof(VkSharingMode));
+    *ptr += sizeof(VkSharingMode);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->queueFamilyIndexCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pQueueFamilyIndices;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pQueueFamilyIndices) {
+        memcpy(*ptr, (const uint32_t*)forMarshaling->pQueueFamilyIndices,
+               forMarshaling->queueFamilyIndexCount * sizeof(const uint32_t));
+        *ptr += forMarshaling->queueFamilyIndexCount * sizeof(const uint32_t);
+    }
+}
+
+void reservedmarshal_VkBufferViewCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkBufferViewCreateInfo* forMarshaling,
+                                            uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBufferViewCreateFlags*)&forMarshaling->flags, sizeof(VkBufferViewCreateFlags));
+    *ptr += sizeof(VkBufferViewCreateFlags);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&forMarshaling->buffer));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+    *ptr += sizeof(VkFormat);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->offset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->range, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+}
+
+void reservedmarshal_VkImageCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkImageCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkImageCreateFlags*)&forMarshaling->flags, sizeof(VkImageCreateFlags));
+    *ptr += sizeof(VkImageCreateFlags);
+    memcpy(*ptr, (VkImageType*)&forMarshaling->imageType, sizeof(VkImageType));
+    *ptr += sizeof(VkImageType);
+    memcpy(*ptr, (VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+    *ptr += sizeof(VkFormat);
+    reservedmarshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forMarshaling->extent), ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->mipLevels, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->arrayLayers, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkSampleCountFlagBits*)&forMarshaling->samples, sizeof(VkSampleCountFlagBits));
+    *ptr += sizeof(VkSampleCountFlagBits);
+    memcpy(*ptr, (VkImageTiling*)&forMarshaling->tiling, sizeof(VkImageTiling));
+    *ptr += sizeof(VkImageTiling);
+    memcpy(*ptr, (VkImageUsageFlags*)&forMarshaling->usage, sizeof(VkImageUsageFlags));
+    *ptr += sizeof(VkImageUsageFlags);
+    memcpy(*ptr, (VkSharingMode*)&forMarshaling->sharingMode, sizeof(VkSharingMode));
+    *ptr += sizeof(VkSharingMode);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->queueFamilyIndexCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pQueueFamilyIndices;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pQueueFamilyIndices) {
+        memcpy(*ptr, (const uint32_t*)forMarshaling->pQueueFamilyIndices,
+               forMarshaling->queueFamilyIndexCount * sizeof(const uint32_t));
+        *ptr += forMarshaling->queueFamilyIndexCount * sizeof(const uint32_t);
+    }
+    memcpy(*ptr, (VkImageLayout*)&forMarshaling->initialLayout, sizeof(VkImageLayout));
+    *ptr += sizeof(VkImageLayout);
+}
+
+void reservedmarshal_VkSubresourceLayout(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkSubresourceLayout* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->offset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->rowPitch, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->arrayPitch, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->depthPitch, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+}
+
+void reservedmarshal_VkComponentMapping(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkComponentMapping* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkComponentSwizzle*)&forMarshaling->r, sizeof(VkComponentSwizzle));
+    *ptr += sizeof(VkComponentSwizzle);
+    memcpy(*ptr, (VkComponentSwizzle*)&forMarshaling->g, sizeof(VkComponentSwizzle));
+    *ptr += sizeof(VkComponentSwizzle);
+    memcpy(*ptr, (VkComponentSwizzle*)&forMarshaling->b, sizeof(VkComponentSwizzle));
+    *ptr += sizeof(VkComponentSwizzle);
+    memcpy(*ptr, (VkComponentSwizzle*)&forMarshaling->a, sizeof(VkComponentSwizzle));
+    *ptr += sizeof(VkComponentSwizzle);
+}
+
+void reservedmarshal_VkImageViewCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkImageViewCreateInfo* forMarshaling,
+                                           uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkImageViewCreateFlags*)&forMarshaling->flags, sizeof(VkImageViewCreateFlags));
+    *ptr += sizeof(VkImageViewCreateFlags);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImage((*&forMarshaling->image));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkImageViewType*)&forMarshaling->viewType, sizeof(VkImageViewType));
+    *ptr += sizeof(VkImageViewType);
+    memcpy(*ptr, (VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+    *ptr += sizeof(VkFormat);
+    reservedmarshal_VkComponentMapping(vkStream, rootType,
+                                       (VkComponentMapping*)(&forMarshaling->components), ptr);
+    reservedmarshal_VkImageSubresourceRange(
+        vkStream, rootType, (VkImageSubresourceRange*)(&forMarshaling->subresourceRange), ptr);
+}
+
+void reservedmarshal_VkShaderModuleCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkShaderModuleCreateInfo* forMarshaling,
+                                              uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkShaderModuleCreateFlags*)&forMarshaling->flags,
+           sizeof(VkShaderModuleCreateFlags));
+    *ptr += sizeof(VkShaderModuleCreateFlags);
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->codeSize;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    memcpy(*ptr, (const uint32_t*)forMarshaling->pCode,
+           (forMarshaling->codeSize / 4) * sizeof(const uint32_t));
+    *ptr += (forMarshaling->codeSize / 4) * sizeof(const uint32_t);
+}
+
+void reservedmarshal_VkPipelineCacheCreateInfo(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkPipelineCacheCreateInfo* forMarshaling,
+                                               uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineCacheCreateFlags*)&forMarshaling->flags,
+           sizeof(VkPipelineCacheCreateFlags));
+    *ptr += sizeof(VkPipelineCacheCreateFlags);
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->initialDataSize;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    memcpy(*ptr, (const void*)forMarshaling->pInitialData,
+           forMarshaling->initialDataSize * sizeof(const uint8_t));
+    *ptr += forMarshaling->initialDataSize * sizeof(const uint8_t);
+}
+
+void reservedmarshal_VkSpecializationMapEntry(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkSpecializationMapEntry* forMarshaling,
+                                              uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->constantID, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->offset, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->size;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+}
+
+void reservedmarshal_VkSpecializationInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkSpecializationInfo* forMarshaling,
+                                          uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->mapEntryCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->mapEntryCount; ++i) {
+        reservedmarshal_VkSpecializationMapEntry(
+            vkStream, rootType, (const VkSpecializationMapEntry*)(forMarshaling->pMapEntries + i),
+            ptr);
+    }
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->dataSize;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    memcpy(*ptr, (const void*)forMarshaling->pData,
+           forMarshaling->dataSize * sizeof(const uint8_t));
+    *ptr += forMarshaling->dataSize * sizeof(const uint8_t);
+}
+
+void reservedmarshal_VkPipelineShaderStageCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineShaderStageCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineShaderStageCreateFlags*)&forMarshaling->flags,
+           sizeof(VkPipelineShaderStageCreateFlags));
+    *ptr += sizeof(VkPipelineShaderStageCreateFlags);
+    memcpy(*ptr, (VkShaderStageFlagBits*)&forMarshaling->stage, sizeof(VkShaderStageFlagBits));
+    *ptr += sizeof(VkShaderStageFlagBits);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkShaderModule((*&forMarshaling->module));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    {
+        uint32_t l = forMarshaling->pName ? strlen(forMarshaling->pName) : 0;
+        memcpy(*ptr, (uint32_t*)&l, sizeof(uint32_t));
+        android::base::Stream::toBe32((uint8_t*)*ptr);
+        *ptr += sizeof(uint32_t);
+        memcpy(*ptr, (char*)forMarshaling->pName, l);
+        *ptr += l;
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pSpecializationInfo;
+    memcpy((*ptr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pSpecializationInfo) {
+        reservedmarshal_VkSpecializationInfo(
+            vkStream, rootType, (const VkSpecializationInfo*)(forMarshaling->pSpecializationInfo),
+            ptr);
+    }
+}
+
+void reservedmarshal_VkComputePipelineCreateInfo(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkComputePipelineCreateInfo* forMarshaling,
+                                                 uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineCreateFlags*)&forMarshaling->flags, sizeof(VkPipelineCreateFlags));
+    *ptr += sizeof(VkPipelineCreateFlags);
+    reservedmarshal_VkPipelineShaderStageCreateInfo(
+        vkStream, rootType, (VkPipelineShaderStageCreateInfo*)(&forMarshaling->stage), ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPipelineLayout((*&forMarshaling->layout));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkPipeline((*&forMarshaling->basePipelineHandle));
+    memcpy(*ptr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (int32_t*)&forMarshaling->basePipelineIndex, sizeof(int32_t));
+    *ptr += sizeof(int32_t);
+}
+
+void reservedmarshal_VkVertexInputBindingDescription(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVertexInputBindingDescription* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->binding, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->stride, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkVertexInputRate*)&forMarshaling->inputRate, sizeof(VkVertexInputRate));
+    *ptr += sizeof(VkVertexInputRate);
+}
+
+void reservedmarshal_VkVertexInputAttributeDescription(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVertexInputAttributeDescription* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->location, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->binding, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+    *ptr += sizeof(VkFormat);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->offset, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkPipelineVertexInputStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineVertexInputStateCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineVertexInputStateCreateFlags*)&forMarshaling->flags,
+           sizeof(VkPipelineVertexInputStateCreateFlags));
+    *ptr += sizeof(VkPipelineVertexInputStateCreateFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->vertexBindingDescriptionCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->vertexBindingDescriptionCount; ++i) {
+        reservedmarshal_VkVertexInputBindingDescription(
+            vkStream, rootType,
+            (const VkVertexInputBindingDescription*)(forMarshaling->pVertexBindingDescriptions + i),
+            ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->vertexAttributeDescriptionCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->vertexAttributeDescriptionCount; ++i) {
+        reservedmarshal_VkVertexInputAttributeDescription(
+            vkStream, rootType,
+            (const VkVertexInputAttributeDescription*)(forMarshaling->pVertexAttributeDescriptions +
+                                                       i),
+            ptr);
+    }
+}
+
+void reservedmarshal_VkPipelineInputAssemblyStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineInputAssemblyStateCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineInputAssemblyStateCreateFlags*)&forMarshaling->flags,
+           sizeof(VkPipelineInputAssemblyStateCreateFlags));
+    *ptr += sizeof(VkPipelineInputAssemblyStateCreateFlags);
+    memcpy(*ptr, (VkPrimitiveTopology*)&forMarshaling->topology, sizeof(VkPrimitiveTopology));
+    *ptr += sizeof(VkPrimitiveTopology);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->primitiveRestartEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPipelineTessellationStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineTessellationStateCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineTessellationStateCreateFlags*)&forMarshaling->flags,
+           sizeof(VkPipelineTessellationStateCreateFlags));
+    *ptr += sizeof(VkPipelineTessellationStateCreateFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->patchControlPoints, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkViewport(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkViewport* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (float*)&forMarshaling->x, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->y, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->width, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->height, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->minDepth, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->maxDepth, sizeof(float));
+    *ptr += sizeof(float);
+}
+
+void reservedmarshal_VkPipelineViewportStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineViewportStateCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineViewportStateCreateFlags*)&forMarshaling->flags,
+           sizeof(VkPipelineViewportStateCreateFlags));
+    *ptr += sizeof(VkPipelineViewportStateCreateFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->viewportCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pViewports;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pViewports) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->viewportCount; ++i) {
+            reservedmarshal_VkViewport(vkStream, rootType,
+                                       (const VkViewport*)(forMarshaling->pViewports + i), ptr);
+        }
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->scissorCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pScissors;
+    memcpy((*ptr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pScissors) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->scissorCount; ++i) {
+            reservedmarshal_VkRect2D(vkStream, rootType,
+                                     (const VkRect2D*)(forMarshaling->pScissors + i), ptr);
+        }
+    }
+}
+
+void reservedmarshal_VkPipelineRasterizationStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRasterizationStateCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineRasterizationStateCreateFlags*)&forMarshaling->flags,
+           sizeof(VkPipelineRasterizationStateCreateFlags));
+    *ptr += sizeof(VkPipelineRasterizationStateCreateFlags);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->depthClampEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->rasterizerDiscardEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkPolygonMode*)&forMarshaling->polygonMode, sizeof(VkPolygonMode));
+    *ptr += sizeof(VkPolygonMode);
+    memcpy(*ptr, (VkCullModeFlags*)&forMarshaling->cullMode, sizeof(VkCullModeFlags));
+    *ptr += sizeof(VkCullModeFlags);
+    memcpy(*ptr, (VkFrontFace*)&forMarshaling->frontFace, sizeof(VkFrontFace));
+    *ptr += sizeof(VkFrontFace);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->depthBiasEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (float*)&forMarshaling->depthBiasConstantFactor, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->depthBiasClamp, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->depthBiasSlopeFactor, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->lineWidth, sizeof(float));
+    *ptr += sizeof(float);
+}
+
+void reservedmarshal_VkPipelineMultisampleStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineMultisampleStateCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineMultisampleStateCreateFlags*)&forMarshaling->flags,
+           sizeof(VkPipelineMultisampleStateCreateFlags));
+    *ptr += sizeof(VkPipelineMultisampleStateCreateFlags);
+    memcpy(*ptr, (VkSampleCountFlagBits*)&forMarshaling->rasterizationSamples,
+           sizeof(VkSampleCountFlagBits));
+    *ptr += sizeof(VkSampleCountFlagBits);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->sampleShadingEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (float*)&forMarshaling->minSampleShading, sizeof(float));
+    *ptr += sizeof(float);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pSampleMask;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pSampleMask) {
+        memcpy(*ptr, (const VkSampleMask*)forMarshaling->pSampleMask,
+               (((forMarshaling->rasterizationSamples) + 31) / 32) * sizeof(const VkSampleMask));
+        *ptr += (((forMarshaling->rasterizationSamples) + 31) / 32) * sizeof(const VkSampleMask);
+    }
+    memcpy(*ptr, (VkBool32*)&forMarshaling->alphaToCoverageEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->alphaToOneEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkStencilOpState(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkStencilOpState* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStencilOp*)&forMarshaling->failOp, sizeof(VkStencilOp));
+    *ptr += sizeof(VkStencilOp);
+    memcpy(*ptr, (VkStencilOp*)&forMarshaling->passOp, sizeof(VkStencilOp));
+    *ptr += sizeof(VkStencilOp);
+    memcpy(*ptr, (VkStencilOp*)&forMarshaling->depthFailOp, sizeof(VkStencilOp));
+    *ptr += sizeof(VkStencilOp);
+    memcpy(*ptr, (VkCompareOp*)&forMarshaling->compareOp, sizeof(VkCompareOp));
+    *ptr += sizeof(VkCompareOp);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->compareMask, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->writeMask, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->reference, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkPipelineDepthStencilStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineDepthStencilStateCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineDepthStencilStateCreateFlags*)&forMarshaling->flags,
+           sizeof(VkPipelineDepthStencilStateCreateFlags));
+    *ptr += sizeof(VkPipelineDepthStencilStateCreateFlags);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->depthTestEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->depthWriteEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkCompareOp*)&forMarshaling->depthCompareOp, sizeof(VkCompareOp));
+    *ptr += sizeof(VkCompareOp);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->depthBoundsTestEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->stencilTestEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    reservedmarshal_VkStencilOpState(vkStream, rootType, (VkStencilOpState*)(&forMarshaling->front),
+                                     ptr);
+    reservedmarshal_VkStencilOpState(vkStream, rootType, (VkStencilOpState*)(&forMarshaling->back),
+                                     ptr);
+    memcpy(*ptr, (float*)&forMarshaling->minDepthBounds, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->maxDepthBounds, sizeof(float));
+    *ptr += sizeof(float);
+}
+
+void reservedmarshal_VkPipelineColorBlendAttachmentState(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineColorBlendAttachmentState* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkBool32*)&forMarshaling->blendEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBlendFactor*)&forMarshaling->srcColorBlendFactor, sizeof(VkBlendFactor));
+    *ptr += sizeof(VkBlendFactor);
+    memcpy(*ptr, (VkBlendFactor*)&forMarshaling->dstColorBlendFactor, sizeof(VkBlendFactor));
+    *ptr += sizeof(VkBlendFactor);
+    memcpy(*ptr, (VkBlendOp*)&forMarshaling->colorBlendOp, sizeof(VkBlendOp));
+    *ptr += sizeof(VkBlendOp);
+    memcpy(*ptr, (VkBlendFactor*)&forMarshaling->srcAlphaBlendFactor, sizeof(VkBlendFactor));
+    *ptr += sizeof(VkBlendFactor);
+    memcpy(*ptr, (VkBlendFactor*)&forMarshaling->dstAlphaBlendFactor, sizeof(VkBlendFactor));
+    *ptr += sizeof(VkBlendFactor);
+    memcpy(*ptr, (VkBlendOp*)&forMarshaling->alphaBlendOp, sizeof(VkBlendOp));
+    *ptr += sizeof(VkBlendOp);
+    memcpy(*ptr, (VkColorComponentFlags*)&forMarshaling->colorWriteMask,
+           sizeof(VkColorComponentFlags));
+    *ptr += sizeof(VkColorComponentFlags);
+}
+
+void reservedmarshal_VkPipelineColorBlendStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineColorBlendStateCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineColorBlendStateCreateFlags*)&forMarshaling->flags,
+           sizeof(VkPipelineColorBlendStateCreateFlags));
+    *ptr += sizeof(VkPipelineColorBlendStateCreateFlags);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->logicOpEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkLogicOp*)&forMarshaling->logicOp, sizeof(VkLogicOp));
+    *ptr += sizeof(VkLogicOp);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->attachmentCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->attachmentCount; ++i) {
+        reservedmarshal_VkPipelineColorBlendAttachmentState(
+            vkStream, rootType,
+            (const VkPipelineColorBlendAttachmentState*)(forMarshaling->pAttachments + i), ptr);
+    }
+    memcpy(*ptr, (float*)forMarshaling->blendConstants, 4 * sizeof(float));
+    *ptr += 4 * sizeof(float);
+}
+
+void reservedmarshal_VkPipelineDynamicStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineDynamicStateCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineDynamicStateCreateFlags*)&forMarshaling->flags,
+           sizeof(VkPipelineDynamicStateCreateFlags));
+    *ptr += sizeof(VkPipelineDynamicStateCreateFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->dynamicStateCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const VkDynamicState*)forMarshaling->pDynamicStates,
+           forMarshaling->dynamicStateCount * sizeof(const VkDynamicState));
+    *ptr += forMarshaling->dynamicStateCount * sizeof(const VkDynamicState);
+}
+
+void reservedmarshal_VkGraphicsPipelineCreateInfo(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkGraphicsPipelineCreateInfo* forMarshaling,
+                                                  uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    uint32_t hasRasterization = 1;
+    if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) {
+        hasRasterization =
+            (((0 == forMarshaling->pRasterizationState))
+                 ? (0)
+                 : (!((*(forMarshaling->pRasterizationState)).rasterizerDiscardEnable)));
+        uint32_t cgen_var_0 = (uint32_t)hasRasterization;
+        memcpy((*ptr), &cgen_var_0, 4);
+        android::base::Stream::toBe32((uint8_t*)(*ptr));
+        *ptr += 4;
+    }
+    uint32_t hasTessellation = 1;
+    if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) {
+        hasTessellation =
+            arrayany(forMarshaling->pStages, 0, forMarshaling->stageCount,
+                     [](VkPipelineShaderStageCreateInfo s) {
+                         return ((s.stage == VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT) ||
+                                 (s.stage == VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT));
+                     });
+        uint32_t cgen_var_0 = (uint32_t)hasTessellation;
+        memcpy((*ptr), &cgen_var_0, 4);
+        android::base::Stream::toBe32((uint8_t*)(*ptr));
+        *ptr += 4;
+    }
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineCreateFlags*)&forMarshaling->flags, sizeof(VkPipelineCreateFlags));
+    *ptr += sizeof(VkPipelineCreateFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->stageCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->stageCount; ++i) {
+        reservedmarshal_VkPipelineShaderStageCreateInfo(
+            vkStream, rootType,
+            (const VkPipelineShaderStageCreateInfo*)(forMarshaling->pStages + i), ptr);
+    }
+    // WARNING PTR CHECK
+    if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) {
+        uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pVertexInputState;
+        memcpy((*ptr), &cgen_var_0, 8);
+        android::base::Stream::toBe64((uint8_t*)(*ptr));
+        *ptr += 8;
+    }
+    if ((!(vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) ||
+         forMarshaling->pVertexInputState)) {
+        reservedmarshal_VkPipelineVertexInputStateCreateInfo(
+            vkStream, rootType,
+            (const VkPipelineVertexInputStateCreateInfo*)(forMarshaling->pVertexInputState), ptr);
+    }
+    // WARNING PTR CHECK
+    if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) {
+        uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pInputAssemblyState;
+        memcpy((*ptr), &cgen_var_0, 8);
+        android::base::Stream::toBe64((uint8_t*)(*ptr));
+        *ptr += 8;
+    }
+    if ((!(vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) ||
+         forMarshaling->pInputAssemblyState)) {
+        reservedmarshal_VkPipelineInputAssemblyStateCreateInfo(
+            vkStream, rootType,
+            (const VkPipelineInputAssemblyStateCreateInfo*)(forMarshaling->pInputAssemblyState),
+            ptr);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pTessellationState;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pTessellationState) {
+        if (hasTessellation) {
+            reservedmarshal_VkPipelineTessellationStateCreateInfo(
+                vkStream, rootType,
+                (const VkPipelineTessellationStateCreateInfo*)(forMarshaling->pTessellationState),
+                ptr);
+        }
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pViewportState;
+    memcpy((*ptr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pViewportState) {
+        if (hasRasterization) {
+            reservedmarshal_VkPipelineViewportStateCreateInfo(
+                vkStream, rootType,
+                (const VkPipelineViewportStateCreateInfo*)(forMarshaling->pViewportState), ptr);
+        }
+    }
+    // WARNING PTR CHECK
+    if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) {
+        uint64_t cgen_var_1_0 = (uint64_t)(uintptr_t)forMarshaling->pRasterizationState;
+        memcpy((*ptr), &cgen_var_1_0, 8);
+        android::base::Stream::toBe64((uint8_t*)(*ptr));
+        *ptr += 8;
+    }
+    if ((!(vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) ||
+         forMarshaling->pRasterizationState)) {
+        reservedmarshal_VkPipelineRasterizationStateCreateInfo(
+            vkStream, rootType,
+            (const VkPipelineRasterizationStateCreateInfo*)(forMarshaling->pRasterizationState),
+            ptr);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)forMarshaling->pMultisampleState;
+    memcpy((*ptr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pMultisampleState) {
+        if (hasRasterization) {
+            reservedmarshal_VkPipelineMultisampleStateCreateInfo(
+                vkStream, rootType,
+                (const VkPipelineMultisampleStateCreateInfo*)(forMarshaling->pMultisampleState),
+                ptr);
+        }
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_3 = (uint64_t)(uintptr_t)forMarshaling->pDepthStencilState;
+    memcpy((*ptr), &cgen_var_3, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pDepthStencilState) {
+        if (hasRasterization) {
+            reservedmarshal_VkPipelineDepthStencilStateCreateInfo(
+                vkStream, rootType,
+                (const VkPipelineDepthStencilStateCreateInfo*)(forMarshaling->pDepthStencilState),
+                ptr);
+        }
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_4 = (uint64_t)(uintptr_t)forMarshaling->pColorBlendState;
+    memcpy((*ptr), &cgen_var_4, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pColorBlendState) {
+        if (hasRasterization) {
+            reservedmarshal_VkPipelineColorBlendStateCreateInfo(
+                vkStream, rootType,
+                (const VkPipelineColorBlendStateCreateInfo*)(forMarshaling->pColorBlendState), ptr);
+        }
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_5 = (uint64_t)(uintptr_t)forMarshaling->pDynamicState;
+    memcpy((*ptr), &cgen_var_5, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pDynamicState) {
+        reservedmarshal_VkPipelineDynamicStateCreateInfo(
+            vkStream, rootType,
+            (const VkPipelineDynamicStateCreateInfo*)(forMarshaling->pDynamicState), ptr);
+    }
+    uint64_t cgen_var_6;
+    *&cgen_var_6 = get_host_u64_VkPipelineLayout((*&forMarshaling->layout));
+    memcpy(*ptr, (uint64_t*)&cgen_var_6, 1 * 8);
+    *ptr += 1 * 8;
+    uint64_t cgen_var_7;
+    *&cgen_var_7 = get_host_u64_VkRenderPass((*&forMarshaling->renderPass));
+    memcpy(*ptr, (uint64_t*)&cgen_var_7, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->subpass, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    uint64_t cgen_var_8;
+    *&cgen_var_8 = get_host_u64_VkPipeline((*&forMarshaling->basePipelineHandle));
+    memcpy(*ptr, (uint64_t*)&cgen_var_8, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (int32_t*)&forMarshaling->basePipelineIndex, sizeof(int32_t));
+    *ptr += sizeof(int32_t);
+}
+
+void reservedmarshal_VkPushConstantRange(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkPushConstantRange* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkShaderStageFlags*)&forMarshaling->stageFlags, sizeof(VkShaderStageFlags));
+    *ptr += sizeof(VkShaderStageFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->offset, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->size, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkPipelineLayoutCreateInfo(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkPipelineLayoutCreateInfo* forMarshaling,
+                                                uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineLayoutCreateFlags*)&forMarshaling->flags,
+           sizeof(VkPipelineLayoutCreateFlags));
+    *ptr += sizeof(VkPipelineLayoutCreateFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->setLayoutCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    if (forMarshaling->setLayoutCount) {
+        uint8_t* cgen_var_0_ptr = (uint8_t*)(*ptr);
+        if (forMarshaling) {
+            for (uint32_t k = 0; k < forMarshaling->setLayoutCount; ++k) {
+                uint64_t tmpval = get_host_u64_VkDescriptorSetLayout(forMarshaling->pSetLayouts[k]);
+                memcpy(cgen_var_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+            }
+        }
+        *ptr += 8 * forMarshaling->setLayoutCount;
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->pushConstantRangeCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->pushConstantRangeCount; ++i) {
+        reservedmarshal_VkPushConstantRange(
+            vkStream, rootType,
+            (const VkPushConstantRange*)(forMarshaling->pPushConstantRanges + i), ptr);
+    }
+}
+
+void reservedmarshal_VkSamplerCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkSamplerCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkSamplerCreateFlags*)&forMarshaling->flags, sizeof(VkSamplerCreateFlags));
+    *ptr += sizeof(VkSamplerCreateFlags);
+    memcpy(*ptr, (VkFilter*)&forMarshaling->magFilter, sizeof(VkFilter));
+    *ptr += sizeof(VkFilter);
+    memcpy(*ptr, (VkFilter*)&forMarshaling->minFilter, sizeof(VkFilter));
+    *ptr += sizeof(VkFilter);
+    memcpy(*ptr, (VkSamplerMipmapMode*)&forMarshaling->mipmapMode, sizeof(VkSamplerMipmapMode));
+    *ptr += sizeof(VkSamplerMipmapMode);
+    memcpy(*ptr, (VkSamplerAddressMode*)&forMarshaling->addressModeU, sizeof(VkSamplerAddressMode));
+    *ptr += sizeof(VkSamplerAddressMode);
+    memcpy(*ptr, (VkSamplerAddressMode*)&forMarshaling->addressModeV, sizeof(VkSamplerAddressMode));
+    *ptr += sizeof(VkSamplerAddressMode);
+    memcpy(*ptr, (VkSamplerAddressMode*)&forMarshaling->addressModeW, sizeof(VkSamplerAddressMode));
+    *ptr += sizeof(VkSamplerAddressMode);
+    memcpy(*ptr, (float*)&forMarshaling->mipLodBias, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->anisotropyEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (float*)&forMarshaling->maxAnisotropy, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->compareEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkCompareOp*)&forMarshaling->compareOp, sizeof(VkCompareOp));
+    *ptr += sizeof(VkCompareOp);
+    memcpy(*ptr, (float*)&forMarshaling->minLod, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->maxLod, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (VkBorderColor*)&forMarshaling->borderColor, sizeof(VkBorderColor));
+    *ptr += sizeof(VkBorderColor);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->unnormalizedCoordinates, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkCopyDescriptorSet(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkCopyDescriptorSet* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDescriptorSet((*&forMarshaling->srcSet));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->srcBinding, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->srcArrayElement, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDescriptorSet((*&forMarshaling->dstSet));
+    memcpy(*ptr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->dstBinding, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->dstArrayElement, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->descriptorCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkDescriptorBufferInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkDescriptorBufferInfo* forMarshaling,
+                                            uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&forMarshaling->buffer));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->offset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->range, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+}
+
+void reservedmarshal_VkDescriptorImageInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkDescriptorImageInfo* forMarshaling,
+                                           uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkSampler((*&forMarshaling->sampler));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkImageView((*&forMarshaling->imageView));
+    memcpy(*ptr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkImageLayout*)&forMarshaling->imageLayout, sizeof(VkImageLayout));
+    *ptr += sizeof(VkImageLayout);
+}
+
+void reservedmarshal_VkDescriptorPoolSize(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkDescriptorPoolSize* forMarshaling,
+                                          uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkDescriptorType*)&forMarshaling->type, sizeof(VkDescriptorType));
+    *ptr += sizeof(VkDescriptorType);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->descriptorCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkDescriptorPoolCreateInfo(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkDescriptorPoolCreateInfo* forMarshaling,
+                                                uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDescriptorPoolCreateFlags*)&forMarshaling->flags,
+           sizeof(VkDescriptorPoolCreateFlags));
+    *ptr += sizeof(VkDescriptorPoolCreateFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxSets, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->poolSizeCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->poolSizeCount; ++i) {
+        reservedmarshal_VkDescriptorPoolSize(
+            vkStream, rootType, (const VkDescriptorPoolSize*)(forMarshaling->pPoolSizes + i), ptr);
+    }
+}
+
+void reservedmarshal_VkDescriptorSetAllocateInfo(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkDescriptorSetAllocateInfo* forMarshaling,
+                                                 uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDescriptorPool((*&forMarshaling->descriptorPool));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->descriptorSetCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    if (forMarshaling->descriptorSetCount) {
+        uint8_t* cgen_var_1_ptr = (uint8_t*)(*ptr);
+        if (forMarshaling) {
+            for (uint32_t k = 0; k < forMarshaling->descriptorSetCount; ++k) {
+                uint64_t tmpval = get_host_u64_VkDescriptorSetLayout(forMarshaling->pSetLayouts[k]);
+                memcpy(cgen_var_1_ptr + k * 8, &tmpval, sizeof(uint64_t));
+            }
+        }
+        *ptr += 8 * forMarshaling->descriptorSetCount;
+    }
+}
+
+void reservedmarshal_VkDescriptorSetLayoutBinding(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkDescriptorSetLayoutBinding* forMarshaling,
+                                                  uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->binding, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkDescriptorType*)&forMarshaling->descriptorType, sizeof(VkDescriptorType));
+    *ptr += sizeof(VkDescriptorType);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->descriptorCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkShaderStageFlags*)&forMarshaling->stageFlags, sizeof(VkShaderStageFlags));
+    *ptr += sizeof(VkShaderStageFlags);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pImmutableSamplers;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pImmutableSamplers) {
+        if (forMarshaling->descriptorCount) {
+            uint8_t* cgen_var_0_0_ptr = (uint8_t*)(*ptr);
+            if (forMarshaling) {
+                for (uint32_t k = 0; k < forMarshaling->descriptorCount; ++k) {
+                    uint64_t tmpval = get_host_u64_VkSampler(forMarshaling->pImmutableSamplers[k]);
+                    memcpy(cgen_var_0_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+                }
+            }
+            *ptr += 8 * forMarshaling->descriptorCount;
+        }
+    }
+}
+
+void reservedmarshal_VkDescriptorSetLayoutCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDescriptorSetLayoutCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDescriptorSetLayoutCreateFlags*)&forMarshaling->flags,
+           sizeof(VkDescriptorSetLayoutCreateFlags));
+    *ptr += sizeof(VkDescriptorSetLayoutCreateFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->bindingCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->bindingCount; ++i) {
+        reservedmarshal_VkDescriptorSetLayoutBinding(
+            vkStream, rootType, (const VkDescriptorSetLayoutBinding*)(forMarshaling->pBindings + i),
+            ptr);
+    }
+}
+
+void reservedmarshal_VkWriteDescriptorSet(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkWriteDescriptorSet* forMarshaling,
+                                          uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDescriptorSet((*&forMarshaling->dstSet));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->dstBinding, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->dstArrayElement, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->descriptorCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkDescriptorType*)&forMarshaling->descriptorType, sizeof(VkDescriptorType));
+    *ptr += sizeof(VkDescriptorType);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pImageInfo;
+    memcpy((*ptr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pImageInfo) {
+        if ((!(vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) ||
+             ((VK_DESCRIPTOR_TYPE_SAMPLER == forMarshaling->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER == forMarshaling->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE == forMarshaling->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_STORAGE_IMAGE == forMarshaling->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT == forMarshaling->descriptorType)))) {
+            for (uint32_t i = 0; i < (uint32_t)forMarshaling->descriptorCount; ++i) {
+                reservedmarshal_VkDescriptorImageInfo(
+                    vkStream, rootType,
+                    (const VkDescriptorImageInfo*)(forMarshaling->pImageInfo + i), ptr);
+            }
+        }
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)forMarshaling->pBufferInfo;
+    memcpy((*ptr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pBufferInfo) {
+        if ((!(vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) ||
+             ((VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER == forMarshaling->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC == forMarshaling->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_STORAGE_BUFFER == forMarshaling->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC == forMarshaling->descriptorType)))) {
+            for (uint32_t i = 0; i < (uint32_t)forMarshaling->descriptorCount; ++i) {
+                reservedmarshal_VkDescriptorBufferInfo(
+                    vkStream, rootType,
+                    (const VkDescriptorBufferInfo*)(forMarshaling->pBufferInfo + i), ptr);
+            }
+        }
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_3 = (uint64_t)(uintptr_t)forMarshaling->pTexelBufferView;
+    memcpy((*ptr), &cgen_var_3, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pTexelBufferView) {
+        if ((!(vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) ||
+             ((VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER == forMarshaling->descriptorType) ||
+              (VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER == forMarshaling->descriptorType)))) {
+            if (forMarshaling->descriptorCount) {
+                uint8_t* cgen_var_3_0_ptr = (uint8_t*)(*ptr);
+                if (forMarshaling) {
+                    for (uint32_t k = 0; k < forMarshaling->descriptorCount; ++k) {
+                        uint64_t tmpval =
+                            get_host_u64_VkBufferView(forMarshaling->pTexelBufferView[k]);
+                        memcpy(cgen_var_3_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+                    }
+                }
+                *ptr += 8 * forMarshaling->descriptorCount;
+            }
+        }
+    }
+}
+
+void reservedmarshal_VkAttachmentDescription(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkAttachmentDescription* forMarshaling,
+                                             uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkAttachmentDescriptionFlags*)&forMarshaling->flags,
+           sizeof(VkAttachmentDescriptionFlags));
+    *ptr += sizeof(VkAttachmentDescriptionFlags);
+    memcpy(*ptr, (VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+    *ptr += sizeof(VkFormat);
+    memcpy(*ptr, (VkSampleCountFlagBits*)&forMarshaling->samples, sizeof(VkSampleCountFlagBits));
+    *ptr += sizeof(VkSampleCountFlagBits);
+    memcpy(*ptr, (VkAttachmentLoadOp*)&forMarshaling->loadOp, sizeof(VkAttachmentLoadOp));
+    *ptr += sizeof(VkAttachmentLoadOp);
+    memcpy(*ptr, (VkAttachmentStoreOp*)&forMarshaling->storeOp, sizeof(VkAttachmentStoreOp));
+    *ptr += sizeof(VkAttachmentStoreOp);
+    memcpy(*ptr, (VkAttachmentLoadOp*)&forMarshaling->stencilLoadOp, sizeof(VkAttachmentLoadOp));
+    *ptr += sizeof(VkAttachmentLoadOp);
+    memcpy(*ptr, (VkAttachmentStoreOp*)&forMarshaling->stencilStoreOp, sizeof(VkAttachmentStoreOp));
+    *ptr += sizeof(VkAttachmentStoreOp);
+    memcpy(*ptr, (VkImageLayout*)&forMarshaling->initialLayout, sizeof(VkImageLayout));
+    *ptr += sizeof(VkImageLayout);
+    memcpy(*ptr, (VkImageLayout*)&forMarshaling->finalLayout, sizeof(VkImageLayout));
+    *ptr += sizeof(VkImageLayout);
+}
+
+void reservedmarshal_VkAttachmentReference(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkAttachmentReference* forMarshaling,
+                                           uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->attachment, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkImageLayout*)&forMarshaling->layout, sizeof(VkImageLayout));
+    *ptr += sizeof(VkImageLayout);
+}
+
+void reservedmarshal_VkFramebufferCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkFramebufferCreateInfo* forMarshaling,
+                                             uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkFramebufferCreateFlags*)&forMarshaling->flags,
+           sizeof(VkFramebufferCreateFlags));
+    *ptr += sizeof(VkFramebufferCreateFlags);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkRenderPass((*&forMarshaling->renderPass));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->attachmentCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    if ((!(vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT) ||
+         (((forMarshaling->flags & VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT) == 0)))) {
+        if (forMarshaling->attachmentCount) {
+            uint8_t* cgen_var_0_0_ptr = (uint8_t*)(*ptr);
+            if (forMarshaling) {
+                for (uint32_t k = 0; k < forMarshaling->attachmentCount; ++k) {
+                    uint64_t tmpval = get_host_u64_VkImageView(forMarshaling->pAttachments[k]);
+                    memcpy(cgen_var_0_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+                }
+            }
+            *ptr += 8 * forMarshaling->attachmentCount;
+        }
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->width, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->height, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->layers, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkSubpassDescription(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkSubpassDescription* forMarshaling,
+                                          uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkSubpassDescriptionFlags*)&forMarshaling->flags,
+           sizeof(VkSubpassDescriptionFlags));
+    *ptr += sizeof(VkSubpassDescriptionFlags);
+    memcpy(*ptr, (VkPipelineBindPoint*)&forMarshaling->pipelineBindPoint,
+           sizeof(VkPipelineBindPoint));
+    *ptr += sizeof(VkPipelineBindPoint);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->inputAttachmentCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->inputAttachmentCount; ++i) {
+        reservedmarshal_VkAttachmentReference(
+            vkStream, rootType,
+            (const VkAttachmentReference*)(forMarshaling->pInputAttachments + i), ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->colorAttachmentCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->colorAttachmentCount; ++i) {
+        reservedmarshal_VkAttachmentReference(
+            vkStream, rootType,
+            (const VkAttachmentReference*)(forMarshaling->pColorAttachments + i), ptr);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pResolveAttachments;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pResolveAttachments) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->colorAttachmentCount; ++i) {
+            reservedmarshal_VkAttachmentReference(
+                vkStream, rootType,
+                (const VkAttachmentReference*)(forMarshaling->pResolveAttachments + i), ptr);
+        }
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pDepthStencilAttachment;
+    memcpy((*ptr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pDepthStencilAttachment) {
+        reservedmarshal_VkAttachmentReference(
+            vkStream, rootType,
+            (const VkAttachmentReference*)(forMarshaling->pDepthStencilAttachment), ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->preserveAttachmentCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const uint32_t*)forMarshaling->pPreserveAttachments,
+           forMarshaling->preserveAttachmentCount * sizeof(const uint32_t));
+    *ptr += forMarshaling->preserveAttachmentCount * sizeof(const uint32_t);
+}
+
+void reservedmarshal_VkSubpassDependency(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkSubpassDependency* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->srcSubpass, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->dstSubpass, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkPipelineStageFlags*)&forMarshaling->srcStageMask, sizeof(VkPipelineStageFlags));
+    *ptr += sizeof(VkPipelineStageFlags);
+    memcpy(*ptr, (VkPipelineStageFlags*)&forMarshaling->dstStageMask, sizeof(VkPipelineStageFlags));
+    *ptr += sizeof(VkPipelineStageFlags);
+    memcpy(*ptr, (VkAccessFlags*)&forMarshaling->srcAccessMask, sizeof(VkAccessFlags));
+    *ptr += sizeof(VkAccessFlags);
+    memcpy(*ptr, (VkAccessFlags*)&forMarshaling->dstAccessMask, sizeof(VkAccessFlags));
+    *ptr += sizeof(VkAccessFlags);
+    memcpy(*ptr, (VkDependencyFlags*)&forMarshaling->dependencyFlags, sizeof(VkDependencyFlags));
+    *ptr += sizeof(VkDependencyFlags);
+}
+
+void reservedmarshal_VkRenderPassCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkRenderPassCreateInfo* forMarshaling,
+                                            uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkRenderPassCreateFlags*)&forMarshaling->flags, sizeof(VkRenderPassCreateFlags));
+    *ptr += sizeof(VkRenderPassCreateFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->attachmentCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->attachmentCount; ++i) {
+        reservedmarshal_VkAttachmentDescription(
+            vkStream, rootType, (const VkAttachmentDescription*)(forMarshaling->pAttachments + i),
+            ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->subpassCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->subpassCount; ++i) {
+        reservedmarshal_VkSubpassDescription(
+            vkStream, rootType, (const VkSubpassDescription*)(forMarshaling->pSubpasses + i), ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->dependencyCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->dependencyCount; ++i) {
+        reservedmarshal_VkSubpassDependency(
+            vkStream, rootType, (const VkSubpassDependency*)(forMarshaling->pDependencies + i),
+            ptr);
+    }
+}
+
+void reservedmarshal_VkCommandPoolCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkCommandPoolCreateInfo* forMarshaling,
+                                             uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkCommandPoolCreateFlags*)&forMarshaling->flags,
+           sizeof(VkCommandPoolCreateFlags));
+    *ptr += sizeof(VkCommandPoolCreateFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->queueFamilyIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkCommandBufferAllocateInfo(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkCommandBufferAllocateInfo* forMarshaling,
+                                                 uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkCommandPool((*&forMarshaling->commandPool));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkCommandBufferLevel*)&forMarshaling->level, sizeof(VkCommandBufferLevel));
+    *ptr += sizeof(VkCommandBufferLevel);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->commandBufferCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkCommandBufferInheritanceInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCommandBufferInheritanceInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkRenderPass((*&forMarshaling->renderPass));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->subpass, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkFramebuffer((*&forMarshaling->framebuffer));
+    memcpy(*ptr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkBool32*)&forMarshaling->occlusionQueryEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkQueryControlFlags*)&forMarshaling->queryFlags, sizeof(VkQueryControlFlags));
+    *ptr += sizeof(VkQueryControlFlags);
+    memcpy(*ptr, (VkQueryPipelineStatisticFlags*)&forMarshaling->pipelineStatistics,
+           sizeof(VkQueryPipelineStatisticFlags));
+    *ptr += sizeof(VkQueryPipelineStatisticFlags);
+}
+
+void reservedmarshal_VkCommandBufferBeginInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkCommandBufferBeginInfo* forMarshaling,
+                                              uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkCommandBufferUsageFlags*)&forMarshaling->flags,
+           sizeof(VkCommandBufferUsageFlags));
+    *ptr += sizeof(VkCommandBufferUsageFlags);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pInheritanceInfo;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pInheritanceInfo) {
+        reservedmarshal_VkCommandBufferInheritanceInfo(
+            vkStream, rootType,
+            (const VkCommandBufferInheritanceInfo*)(forMarshaling->pInheritanceInfo), ptr);
+    }
+}
+
+void reservedmarshal_VkBufferCopy(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkBufferCopy* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->srcOffset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->dstOffset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+}
+
+void reservedmarshal_VkImageSubresourceLayers(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkImageSubresourceLayers* forMarshaling,
+                                              uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkImageAspectFlags*)&forMarshaling->aspectMask, sizeof(VkImageAspectFlags));
+    *ptr += sizeof(VkImageAspectFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->mipLevel, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->baseArrayLayer, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->layerCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkBufferImageCopy(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkBufferImageCopy* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->bufferOffset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->bufferRowLength, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->bufferImageHeight, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    reservedmarshal_VkImageSubresourceLayers(
+        vkStream, rootType, (VkImageSubresourceLayers*)(&forMarshaling->imageSubresource), ptr);
+    reservedmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forMarshaling->imageOffset), ptr);
+    reservedmarshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forMarshaling->imageExtent), ptr);
+}
+
+void reservedmarshal_VkClearColorValue(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkClearColorValue* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (float*)forMarshaling->float32, 4 * sizeof(float));
+    *ptr += 4 * sizeof(float);
+}
+
+void reservedmarshal_VkClearDepthStencilValue(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkClearDepthStencilValue* forMarshaling,
+                                              uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (float*)&forMarshaling->depth, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->stencil, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkClearValue(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkClearValue* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    reservedmarshal_VkClearColorValue(vkStream, rootType,
+                                      (VkClearColorValue*)(&forMarshaling->color), ptr);
+}
+
+void reservedmarshal_VkClearAttachment(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkClearAttachment* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkImageAspectFlags*)&forMarshaling->aspectMask, sizeof(VkImageAspectFlags));
+    *ptr += sizeof(VkImageAspectFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->colorAttachment, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    reservedmarshal_VkClearValue(vkStream, rootType, (VkClearValue*)(&forMarshaling->clearValue),
+                                 ptr);
+}
+
+void reservedmarshal_VkClearRect(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkClearRect* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    reservedmarshal_VkRect2D(vkStream, rootType, (VkRect2D*)(&forMarshaling->rect), ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->baseArrayLayer, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->layerCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkImageBlit(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkImageBlit* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    reservedmarshal_VkImageSubresourceLayers(
+        vkStream, rootType, (VkImageSubresourceLayers*)(&forMarshaling->srcSubresource), ptr);
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        reservedmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(forMarshaling->srcOffsets + i),
+                                   ptr);
+    }
+    reservedmarshal_VkImageSubresourceLayers(
+        vkStream, rootType, (VkImageSubresourceLayers*)(&forMarshaling->dstSubresource), ptr);
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        reservedmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(forMarshaling->dstOffsets + i),
+                                   ptr);
+    }
+}
+
+void reservedmarshal_VkImageCopy(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkImageCopy* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    reservedmarshal_VkImageSubresourceLayers(
+        vkStream, rootType, (VkImageSubresourceLayers*)(&forMarshaling->srcSubresource), ptr);
+    reservedmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forMarshaling->srcOffset), ptr);
+    reservedmarshal_VkImageSubresourceLayers(
+        vkStream, rootType, (VkImageSubresourceLayers*)(&forMarshaling->dstSubresource), ptr);
+    reservedmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forMarshaling->dstOffset), ptr);
+    reservedmarshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forMarshaling->extent), ptr);
+}
+
+void reservedmarshal_VkImageResolve(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkImageResolve* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    reservedmarshal_VkImageSubresourceLayers(
+        vkStream, rootType, (VkImageSubresourceLayers*)(&forMarshaling->srcSubresource), ptr);
+    reservedmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forMarshaling->srcOffset), ptr);
+    reservedmarshal_VkImageSubresourceLayers(
+        vkStream, rootType, (VkImageSubresourceLayers*)(&forMarshaling->dstSubresource), ptr);
+    reservedmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forMarshaling->dstOffset), ptr);
+    reservedmarshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forMarshaling->extent), ptr);
+}
+
+void reservedmarshal_VkRenderPassBeginInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkRenderPassBeginInfo* forMarshaling,
+                                           uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkRenderPass((*&forMarshaling->renderPass));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkFramebuffer((*&forMarshaling->framebuffer));
+    memcpy(*ptr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *ptr += 1 * 8;
+    reservedmarshal_VkRect2D(vkStream, rootType, (VkRect2D*)(&forMarshaling->renderArea), ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->clearValueCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)forMarshaling->pClearValues;
+    memcpy((*ptr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pClearValues) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->clearValueCount; ++i) {
+            reservedmarshal_VkClearValue(
+                vkStream, rootType, (const VkClearValue*)(forMarshaling->pClearValues + i), ptr);
+        }
+    }
+}
+
+#endif
+#ifdef VK_VERSION_1_1
+void reservedmarshal_VkPhysicalDeviceSubgroupProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSubgroupProperties* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->subgroupSize, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkShaderStageFlags*)&forMarshaling->supportedStages, sizeof(VkShaderStageFlags));
+    *ptr += sizeof(VkShaderStageFlags);
+    memcpy(*ptr, (VkSubgroupFeatureFlags*)&forMarshaling->supportedOperations,
+           sizeof(VkSubgroupFeatureFlags));
+    *ptr += sizeof(VkSubgroupFeatureFlags);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->quadOperationsInAllStages, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkBindBufferMemoryInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkBindBufferMemoryInfo* forMarshaling,
+                                            uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&forMarshaling->buffer));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDeviceMemory((*&forMarshaling->memory));
+    memcpy(*ptr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->memoryOffset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+}
+
+void reservedmarshal_VkBindImageMemoryInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkBindImageMemoryInfo* forMarshaling,
+                                           uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImage((*&forMarshaling->image));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDeviceMemory((*&forMarshaling->memory));
+    memcpy(*ptr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->memoryOffset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+}
+
+void reservedmarshal_VkPhysicalDevice16BitStorageFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevice16BitStorageFeatures* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->storageBuffer16BitAccess, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->uniformAndStorageBuffer16BitAccess, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->storagePushConstant16, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->storageInputOutput16, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkMemoryDedicatedRequirements(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryDedicatedRequirements* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->prefersDedicatedAllocation, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->requiresDedicatedAllocation, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkMemoryDedicatedAllocateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryDedicatedAllocateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImage((*&forMarshaling->image));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkBuffer((*&forMarshaling->buffer));
+    memcpy(*ptr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *ptr += 1 * 8;
+}
+
+void reservedmarshal_VkMemoryAllocateFlagsInfo(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkMemoryAllocateFlagsInfo* forMarshaling,
+                                               uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkMemoryAllocateFlags*)&forMarshaling->flags, sizeof(VkMemoryAllocateFlags));
+    *ptr += sizeof(VkMemoryAllocateFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->deviceMask, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkDeviceGroupRenderPassBeginInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceGroupRenderPassBeginInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->deviceMask, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->deviceRenderAreaCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->deviceRenderAreaCount; ++i) {
+        reservedmarshal_VkRect2D(vkStream, rootType,
+                                 (const VkRect2D*)(forMarshaling->pDeviceRenderAreas + i), ptr);
+    }
+}
+
+void reservedmarshal_VkDeviceGroupCommandBufferBeginInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceGroupCommandBufferBeginInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->deviceMask, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkDeviceGroupSubmitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkDeviceGroupSubmitInfo* forMarshaling,
+                                             uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->waitSemaphoreCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const uint32_t*)forMarshaling->pWaitSemaphoreDeviceIndices,
+           forMarshaling->waitSemaphoreCount * sizeof(const uint32_t));
+    *ptr += forMarshaling->waitSemaphoreCount * sizeof(const uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->commandBufferCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const uint32_t*)forMarshaling->pCommandBufferDeviceMasks,
+           forMarshaling->commandBufferCount * sizeof(const uint32_t));
+    *ptr += forMarshaling->commandBufferCount * sizeof(const uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->signalSemaphoreCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const uint32_t*)forMarshaling->pSignalSemaphoreDeviceIndices,
+           forMarshaling->signalSemaphoreCount * sizeof(const uint32_t));
+    *ptr += forMarshaling->signalSemaphoreCount * sizeof(const uint32_t);
+}
+
+void reservedmarshal_VkDeviceGroupBindSparseInfo(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkDeviceGroupBindSparseInfo* forMarshaling,
+                                                 uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->resourceDeviceIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->memoryDeviceIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkBindBufferMemoryDeviceGroupInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBindBufferMemoryDeviceGroupInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->deviceIndexCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const uint32_t*)forMarshaling->pDeviceIndices,
+           forMarshaling->deviceIndexCount * sizeof(const uint32_t));
+    *ptr += forMarshaling->deviceIndexCount * sizeof(const uint32_t);
+}
+
+void reservedmarshal_VkBindImageMemoryDeviceGroupInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBindImageMemoryDeviceGroupInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->deviceIndexCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const uint32_t*)forMarshaling->pDeviceIndices,
+           forMarshaling->deviceIndexCount * sizeof(const uint32_t));
+    *ptr += forMarshaling->deviceIndexCount * sizeof(const uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->splitInstanceBindRegionCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->splitInstanceBindRegionCount; ++i) {
+        reservedmarshal_VkRect2D(vkStream, rootType,
+                                 (const VkRect2D*)(forMarshaling->pSplitInstanceBindRegions + i),
+                                 ptr);
+    }
+}
+
+void reservedmarshal_VkPhysicalDeviceGroupProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceGroupProperties* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->physicalDeviceCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkPhysicalDevice*)forMarshaling->physicalDevices,
+           VK_MAX_DEVICE_GROUP_SIZE * sizeof(VkPhysicalDevice));
+    *ptr += VK_MAX_DEVICE_GROUP_SIZE * sizeof(VkPhysicalDevice);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->subsetAllocation, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkDeviceGroupDeviceCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceGroupDeviceCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->physicalDeviceCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    if (forMarshaling->physicalDeviceCount) {
+        uint8_t* cgen_var_0_ptr = (uint8_t*)(*ptr);
+        if (forMarshaling) {
+            for (uint32_t k = 0; k < forMarshaling->physicalDeviceCount; ++k) {
+                uint64_t tmpval = get_host_u64_VkPhysicalDevice(forMarshaling->pPhysicalDevices[k]);
+                memcpy(cgen_var_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+            }
+        }
+        *ptr += 8 * forMarshaling->physicalDeviceCount;
+    }
+}
+
+void reservedmarshal_VkBufferMemoryRequirementsInfo2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferMemoryRequirementsInfo2* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&forMarshaling->buffer));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+}
+
+void reservedmarshal_VkImageMemoryRequirementsInfo2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageMemoryRequirementsInfo2* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImage((*&forMarshaling->image));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+}
+
+void reservedmarshal_VkImageSparseMemoryRequirementsInfo2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageSparseMemoryRequirementsInfo2* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImage((*&forMarshaling->image));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+}
+
+void reservedmarshal_VkMemoryRequirements2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkMemoryRequirements2* forMarshaling,
+                                           uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkMemoryRequirements(
+        vkStream, rootType, (VkMemoryRequirements*)(&forMarshaling->memoryRequirements), ptr);
+}
+
+void reservedmarshal_VkSparseImageMemoryRequirements2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSparseImageMemoryRequirements2* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkSparseImageMemoryRequirements(
+        vkStream, rootType, (VkSparseImageMemoryRequirements*)(&forMarshaling->memoryRequirements),
+        ptr);
+}
+
+void reservedmarshal_VkPhysicalDeviceFeatures2(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkPhysicalDeviceFeatures2* forMarshaling,
+                                               uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkPhysicalDeviceFeatures(
+        vkStream, rootType, (VkPhysicalDeviceFeatures*)(&forMarshaling->features), ptr);
+}
+
+void reservedmarshal_VkPhysicalDeviceProperties2(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkPhysicalDeviceProperties2* forMarshaling,
+                                                 uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkPhysicalDeviceProperties(
+        vkStream, rootType, (VkPhysicalDeviceProperties*)(&forMarshaling->properties), ptr);
+}
+
+void reservedmarshal_VkFormatProperties2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkFormatProperties2* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkFormatProperties(
+        vkStream, rootType, (VkFormatProperties*)(&forMarshaling->formatProperties), ptr);
+}
+
+void reservedmarshal_VkImageFormatProperties2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkImageFormatProperties2* forMarshaling,
+                                              uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkImageFormatProperties(
+        vkStream, rootType, (VkImageFormatProperties*)(&forMarshaling->imageFormatProperties), ptr);
+}
+
+void reservedmarshal_VkPhysicalDeviceImageFormatInfo2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceImageFormatInfo2* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+    *ptr += sizeof(VkFormat);
+    memcpy(*ptr, (VkImageType*)&forMarshaling->type, sizeof(VkImageType));
+    *ptr += sizeof(VkImageType);
+    memcpy(*ptr, (VkImageTiling*)&forMarshaling->tiling, sizeof(VkImageTiling));
+    *ptr += sizeof(VkImageTiling);
+    memcpy(*ptr, (VkImageUsageFlags*)&forMarshaling->usage, sizeof(VkImageUsageFlags));
+    *ptr += sizeof(VkImageUsageFlags);
+    memcpy(*ptr, (VkImageCreateFlags*)&forMarshaling->flags, sizeof(VkImageCreateFlags));
+    *ptr += sizeof(VkImageCreateFlags);
+}
+
+void reservedmarshal_VkQueueFamilyProperties2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkQueueFamilyProperties2* forMarshaling,
+                                              uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkQueueFamilyProperties(
+        vkStream, rootType, (VkQueueFamilyProperties*)(&forMarshaling->queueFamilyProperties), ptr);
+}
+
+void reservedmarshal_VkPhysicalDeviceMemoryProperties2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMemoryProperties2* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkPhysicalDeviceMemoryProperties(
+        vkStream, rootType, (VkPhysicalDeviceMemoryProperties*)(&forMarshaling->memoryProperties),
+        ptr);
+}
+
+void reservedmarshal_VkSparseImageFormatProperties2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSparseImageFormatProperties2* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkSparseImageFormatProperties(
+        vkStream, rootType, (VkSparseImageFormatProperties*)(&forMarshaling->properties), ptr);
+}
+
+void reservedmarshal_VkPhysicalDeviceSparseImageFormatInfo2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSparseImageFormatInfo2* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+    *ptr += sizeof(VkFormat);
+    memcpy(*ptr, (VkImageType*)&forMarshaling->type, sizeof(VkImageType));
+    *ptr += sizeof(VkImageType);
+    memcpy(*ptr, (VkSampleCountFlagBits*)&forMarshaling->samples, sizeof(VkSampleCountFlagBits));
+    *ptr += sizeof(VkSampleCountFlagBits);
+    memcpy(*ptr, (VkImageUsageFlags*)&forMarshaling->usage, sizeof(VkImageUsageFlags));
+    *ptr += sizeof(VkImageUsageFlags);
+    memcpy(*ptr, (VkImageTiling*)&forMarshaling->tiling, sizeof(VkImageTiling));
+    *ptr += sizeof(VkImageTiling);
+}
+
+void reservedmarshal_VkPhysicalDevicePointClippingProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePointClippingProperties* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPointClippingBehavior*)&forMarshaling->pointClippingBehavior,
+           sizeof(VkPointClippingBehavior));
+    *ptr += sizeof(VkPointClippingBehavior);
+}
+
+void reservedmarshal_VkInputAttachmentAspectReference(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkInputAttachmentAspectReference* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->subpass, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->inputAttachmentIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkImageAspectFlags*)&forMarshaling->aspectMask, sizeof(VkImageAspectFlags));
+    *ptr += sizeof(VkImageAspectFlags);
+}
+
+void reservedmarshal_VkRenderPassInputAttachmentAspectCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRenderPassInputAttachmentAspectCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->aspectReferenceCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->aspectReferenceCount; ++i) {
+        reservedmarshal_VkInputAttachmentAspectReference(
+            vkStream, rootType,
+            (const VkInputAttachmentAspectReference*)(forMarshaling->pAspectReferences + i), ptr);
+    }
+}
+
+void reservedmarshal_VkImageViewUsageCreateInfo(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkImageViewUsageCreateInfo* forMarshaling,
+                                                uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkImageUsageFlags*)&forMarshaling->usage, sizeof(VkImageUsageFlags));
+    *ptr += sizeof(VkImageUsageFlags);
+}
+
+void reservedmarshal_VkPipelineTessellationDomainOriginStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineTessellationDomainOriginStateCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkTessellationDomainOrigin*)&forMarshaling->domainOrigin,
+           sizeof(VkTessellationDomainOrigin));
+    *ptr += sizeof(VkTessellationDomainOrigin);
+}
+
+void reservedmarshal_VkRenderPassMultiviewCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRenderPassMultiviewCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->subpassCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const uint32_t*)forMarshaling->pViewMasks,
+           forMarshaling->subpassCount * sizeof(const uint32_t));
+    *ptr += forMarshaling->subpassCount * sizeof(const uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->dependencyCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const int32_t*)forMarshaling->pViewOffsets,
+           forMarshaling->dependencyCount * sizeof(const int32_t));
+    *ptr += forMarshaling->dependencyCount * sizeof(const int32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->correlationMaskCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const uint32_t*)forMarshaling->pCorrelationMasks,
+           forMarshaling->correlationMaskCount * sizeof(const uint32_t));
+    *ptr += forMarshaling->correlationMaskCount * sizeof(const uint32_t);
+}
+
+void reservedmarshal_VkPhysicalDeviceMultiviewFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMultiviewFeatures* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->multiview, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->multiviewGeometryShader, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->multiviewTessellationShader, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceMultiviewProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMultiviewProperties* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxMultiviewViewCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxMultiviewInstanceIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkPhysicalDeviceVariablePointersFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVariablePointersFeatures* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->variablePointersStorageBuffer, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->variablePointers, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceProtectedMemoryFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceProtectedMemoryFeatures* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->protectedMemory, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceProtectedMemoryProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceProtectedMemoryProperties* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->protectedNoFault, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkDeviceQueueInfo2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkDeviceQueueInfo2* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDeviceQueueCreateFlags*)&forMarshaling->flags,
+           sizeof(VkDeviceQueueCreateFlags));
+    *ptr += sizeof(VkDeviceQueueCreateFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->queueFamilyIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->queueIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkProtectedSubmitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkProtectedSubmitInfo* forMarshaling,
+                                           uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->protectedSubmit, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkSamplerYcbcrConversionCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSamplerYcbcrConversionCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+    *ptr += sizeof(VkFormat);
+    memcpy(*ptr, (VkSamplerYcbcrModelConversion*)&forMarshaling->ycbcrModel,
+           sizeof(VkSamplerYcbcrModelConversion));
+    *ptr += sizeof(VkSamplerYcbcrModelConversion);
+    memcpy(*ptr, (VkSamplerYcbcrRange*)&forMarshaling->ycbcrRange, sizeof(VkSamplerYcbcrRange));
+    *ptr += sizeof(VkSamplerYcbcrRange);
+    reservedmarshal_VkComponentMapping(vkStream, rootType,
+                                       (VkComponentMapping*)(&forMarshaling->components), ptr);
+    memcpy(*ptr, (VkChromaLocation*)&forMarshaling->xChromaOffset, sizeof(VkChromaLocation));
+    *ptr += sizeof(VkChromaLocation);
+    memcpy(*ptr, (VkChromaLocation*)&forMarshaling->yChromaOffset, sizeof(VkChromaLocation));
+    *ptr += sizeof(VkChromaLocation);
+    memcpy(*ptr, (VkFilter*)&forMarshaling->chromaFilter, sizeof(VkFilter));
+    *ptr += sizeof(VkFilter);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->forceExplicitReconstruction, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkSamplerYcbcrConversionInfo(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkSamplerYcbcrConversionInfo* forMarshaling,
+                                                  uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkSamplerYcbcrConversion((*&forMarshaling->conversion));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+}
+
+void reservedmarshal_VkBindImagePlaneMemoryInfo(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkBindImagePlaneMemoryInfo* forMarshaling,
+                                                uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkImageAspectFlagBits*)&forMarshaling->planeAspect,
+           sizeof(VkImageAspectFlagBits));
+    *ptr += sizeof(VkImageAspectFlagBits);
+}
+
+void reservedmarshal_VkImagePlaneMemoryRequirementsInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImagePlaneMemoryRequirementsInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkImageAspectFlagBits*)&forMarshaling->planeAspect,
+           sizeof(VkImageAspectFlagBits));
+    *ptr += sizeof(VkImageAspectFlagBits);
+}
+
+void reservedmarshal_VkPhysicalDeviceSamplerYcbcrConversionFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSamplerYcbcrConversionFeatures* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->samplerYcbcrConversion, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkSamplerYcbcrConversionImageFormatProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSamplerYcbcrConversionImageFormatProperties* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->combinedImageSamplerDescriptorCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkDescriptorUpdateTemplateEntry(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDescriptorUpdateTemplateEntry* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->dstBinding, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->dstArrayElement, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->descriptorCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkDescriptorType*)&forMarshaling->descriptorType, sizeof(VkDescriptorType));
+    *ptr += sizeof(VkDescriptorType);
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->offset;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    uint64_t cgen_var_1 = (uint64_t)forMarshaling->stride;
+    memcpy((*ptr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+}
+
+void reservedmarshal_VkDescriptorUpdateTemplateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDescriptorUpdateTemplateCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDescriptorUpdateTemplateCreateFlags*)&forMarshaling->flags,
+           sizeof(VkDescriptorUpdateTemplateCreateFlags));
+    *ptr += sizeof(VkDescriptorUpdateTemplateCreateFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->descriptorUpdateEntryCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->descriptorUpdateEntryCount; ++i) {
+        reservedmarshal_VkDescriptorUpdateTemplateEntry(
+            vkStream, rootType,
+            (const VkDescriptorUpdateTemplateEntry*)(forMarshaling->pDescriptorUpdateEntries + i),
+            ptr);
+    }
+    memcpy(*ptr, (VkDescriptorUpdateTemplateType*)&forMarshaling->templateType,
+           sizeof(VkDescriptorUpdateTemplateType));
+    *ptr += sizeof(VkDescriptorUpdateTemplateType);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDescriptorSetLayout((*&forMarshaling->descriptorSetLayout));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkPipelineBindPoint*)&forMarshaling->pipelineBindPoint,
+           sizeof(VkPipelineBindPoint));
+    *ptr += sizeof(VkPipelineBindPoint);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkPipelineLayout((*&forMarshaling->pipelineLayout));
+    memcpy(*ptr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->set, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkExternalMemoryProperties(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkExternalMemoryProperties* forMarshaling,
+                                                uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkExternalMemoryFeatureFlags*)&forMarshaling->externalMemoryFeatures,
+           sizeof(VkExternalMemoryFeatureFlags));
+    *ptr += sizeof(VkExternalMemoryFeatureFlags);
+    memcpy(*ptr, (VkExternalMemoryHandleTypeFlags*)&forMarshaling->exportFromImportedHandleTypes,
+           sizeof(VkExternalMemoryHandleTypeFlags));
+    *ptr += sizeof(VkExternalMemoryHandleTypeFlags);
+    memcpy(*ptr, (VkExternalMemoryHandleTypeFlags*)&forMarshaling->compatibleHandleTypes,
+           sizeof(VkExternalMemoryHandleTypeFlags));
+    *ptr += sizeof(VkExternalMemoryHandleTypeFlags);
+}
+
+void reservedmarshal_VkPhysicalDeviceExternalImageFormatInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExternalImageFormatInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkExternalMemoryHandleTypeFlagBits*)&forMarshaling->handleType,
+           sizeof(VkExternalMemoryHandleTypeFlagBits));
+    *ptr += sizeof(VkExternalMemoryHandleTypeFlagBits);
+}
+
+void reservedmarshal_VkExternalImageFormatProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExternalImageFormatProperties* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkExternalMemoryProperties(
+        vkStream, rootType, (VkExternalMemoryProperties*)(&forMarshaling->externalMemoryProperties),
+        ptr);
+}
+
+void reservedmarshal_VkPhysicalDeviceExternalBufferInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExternalBufferInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBufferCreateFlags*)&forMarshaling->flags, sizeof(VkBufferCreateFlags));
+    *ptr += sizeof(VkBufferCreateFlags);
+    memcpy(*ptr, (VkBufferUsageFlags*)&forMarshaling->usage, sizeof(VkBufferUsageFlags));
+    *ptr += sizeof(VkBufferUsageFlags);
+    memcpy(*ptr, (VkExternalMemoryHandleTypeFlagBits*)&forMarshaling->handleType,
+           sizeof(VkExternalMemoryHandleTypeFlagBits));
+    *ptr += sizeof(VkExternalMemoryHandleTypeFlagBits);
+}
+
+void reservedmarshal_VkExternalBufferProperties(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkExternalBufferProperties* forMarshaling,
+                                                uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkExternalMemoryProperties(
+        vkStream, rootType, (VkExternalMemoryProperties*)(&forMarshaling->externalMemoryProperties),
+        ptr);
+}
+
+void reservedmarshal_VkPhysicalDeviceIDProperties(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkPhysicalDeviceIDProperties* forMarshaling,
+                                                  uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint8_t*)forMarshaling->deviceUUID, VK_UUID_SIZE * sizeof(uint8_t));
+    *ptr += VK_UUID_SIZE * sizeof(uint8_t);
+    memcpy(*ptr, (uint8_t*)forMarshaling->driverUUID, VK_UUID_SIZE * sizeof(uint8_t));
+    *ptr += VK_UUID_SIZE * sizeof(uint8_t);
+    memcpy(*ptr, (uint8_t*)forMarshaling->deviceLUID, VK_LUID_SIZE * sizeof(uint8_t));
+    *ptr += VK_LUID_SIZE * sizeof(uint8_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->deviceNodeMask, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->deviceLUIDValid, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkExternalMemoryImageCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExternalMemoryImageCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkExternalMemoryHandleTypeFlags*)&forMarshaling->handleTypes,
+           sizeof(VkExternalMemoryHandleTypeFlags));
+    *ptr += sizeof(VkExternalMemoryHandleTypeFlags);
+}
+
+void reservedmarshal_VkExternalMemoryBufferCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExternalMemoryBufferCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkExternalMemoryHandleTypeFlags*)&forMarshaling->handleTypes,
+           sizeof(VkExternalMemoryHandleTypeFlags));
+    *ptr += sizeof(VkExternalMemoryHandleTypeFlags);
+}
+
+void reservedmarshal_VkExportMemoryAllocateInfo(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkExportMemoryAllocateInfo* forMarshaling,
+                                                uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkExternalMemoryHandleTypeFlags*)&forMarshaling->handleTypes,
+           sizeof(VkExternalMemoryHandleTypeFlags));
+    *ptr += sizeof(VkExternalMemoryHandleTypeFlags);
+}
+
+void reservedmarshal_VkPhysicalDeviceExternalFenceInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExternalFenceInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkExternalFenceHandleTypeFlagBits*)&forMarshaling->handleType,
+           sizeof(VkExternalFenceHandleTypeFlagBits));
+    *ptr += sizeof(VkExternalFenceHandleTypeFlagBits);
+}
+
+void reservedmarshal_VkExternalFenceProperties(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkExternalFenceProperties* forMarshaling,
+                                               uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkExternalFenceHandleTypeFlags*)&forMarshaling->exportFromImportedHandleTypes,
+           sizeof(VkExternalFenceHandleTypeFlags));
+    *ptr += sizeof(VkExternalFenceHandleTypeFlags);
+    memcpy(*ptr, (VkExternalFenceHandleTypeFlags*)&forMarshaling->compatibleHandleTypes,
+           sizeof(VkExternalFenceHandleTypeFlags));
+    *ptr += sizeof(VkExternalFenceHandleTypeFlags);
+    memcpy(*ptr, (VkExternalFenceFeatureFlags*)&forMarshaling->externalFenceFeatures,
+           sizeof(VkExternalFenceFeatureFlags));
+    *ptr += sizeof(VkExternalFenceFeatureFlags);
+}
+
+void reservedmarshal_VkExportFenceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkExportFenceCreateInfo* forMarshaling,
+                                             uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkExternalFenceHandleTypeFlags*)&forMarshaling->handleTypes,
+           sizeof(VkExternalFenceHandleTypeFlags));
+    *ptr += sizeof(VkExternalFenceHandleTypeFlags);
+}
+
+void reservedmarshal_VkExportSemaphoreCreateInfo(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkExportSemaphoreCreateInfo* forMarshaling,
+                                                 uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkExternalSemaphoreHandleTypeFlags*)&forMarshaling->handleTypes,
+           sizeof(VkExternalSemaphoreHandleTypeFlags));
+    *ptr += sizeof(VkExternalSemaphoreHandleTypeFlags);
+}
+
+void reservedmarshal_VkPhysicalDeviceExternalSemaphoreInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExternalSemaphoreInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkExternalSemaphoreHandleTypeFlagBits*)&forMarshaling->handleType,
+           sizeof(VkExternalSemaphoreHandleTypeFlagBits));
+    *ptr += sizeof(VkExternalSemaphoreHandleTypeFlagBits);
+}
+
+void reservedmarshal_VkExternalSemaphoreProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExternalSemaphoreProperties* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkExternalSemaphoreHandleTypeFlags*)&forMarshaling->exportFromImportedHandleTypes,
+           sizeof(VkExternalSemaphoreHandleTypeFlags));
+    *ptr += sizeof(VkExternalSemaphoreHandleTypeFlags);
+    memcpy(*ptr, (VkExternalSemaphoreHandleTypeFlags*)&forMarshaling->compatibleHandleTypes,
+           sizeof(VkExternalSemaphoreHandleTypeFlags));
+    *ptr += sizeof(VkExternalSemaphoreHandleTypeFlags);
+    memcpy(*ptr, (VkExternalSemaphoreFeatureFlags*)&forMarshaling->externalSemaphoreFeatures,
+           sizeof(VkExternalSemaphoreFeatureFlags));
+    *ptr += sizeof(VkExternalSemaphoreFeatureFlags);
+}
+
+void reservedmarshal_VkPhysicalDeviceMaintenance3Properties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMaintenance3Properties* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPerSetDescriptors, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->maxMemoryAllocationSize, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+}
+
+void reservedmarshal_VkDescriptorSetLayoutSupport(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkDescriptorSetLayoutSupport* forMarshaling,
+                                                  uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->supported, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceShaderDrawParametersFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderDrawParametersFeatures* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderDrawParameters, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_VERSION_1_2
+void reservedmarshal_VkPhysicalDeviceVulkan11Features(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVulkan11Features* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->storageBuffer16BitAccess, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->uniformAndStorageBuffer16BitAccess, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->storagePushConstant16, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->storageInputOutput16, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->multiview, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->multiviewGeometryShader, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->multiviewTessellationShader, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->variablePointersStorageBuffer, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->variablePointers, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->protectedMemory, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->samplerYcbcrConversion, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderDrawParameters, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceVulkan11Properties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVulkan11Properties* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint8_t*)forMarshaling->deviceUUID, VK_UUID_SIZE * sizeof(uint8_t));
+    *ptr += VK_UUID_SIZE * sizeof(uint8_t);
+    memcpy(*ptr, (uint8_t*)forMarshaling->driverUUID, VK_UUID_SIZE * sizeof(uint8_t));
+    *ptr += VK_UUID_SIZE * sizeof(uint8_t);
+    memcpy(*ptr, (uint8_t*)forMarshaling->deviceLUID, VK_LUID_SIZE * sizeof(uint8_t));
+    *ptr += VK_LUID_SIZE * sizeof(uint8_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->deviceNodeMask, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->deviceLUIDValid, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->subgroupSize, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkShaderStageFlags*)&forMarshaling->subgroupSupportedStages,
+           sizeof(VkShaderStageFlags));
+    *ptr += sizeof(VkShaderStageFlags);
+    memcpy(*ptr, (VkSubgroupFeatureFlags*)&forMarshaling->subgroupSupportedOperations,
+           sizeof(VkSubgroupFeatureFlags));
+    *ptr += sizeof(VkSubgroupFeatureFlags);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->subgroupQuadOperationsInAllStages, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkPointClippingBehavior*)&forMarshaling->pointClippingBehavior,
+           sizeof(VkPointClippingBehavior));
+    *ptr += sizeof(VkPointClippingBehavior);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxMultiviewViewCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxMultiviewInstanceIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->protectedNoFault, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPerSetDescriptors, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->maxMemoryAllocationSize, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+}
+
+void reservedmarshal_VkPhysicalDeviceVulkan12Features(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVulkan12Features* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->samplerMirrorClampToEdge, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->drawIndirectCount, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->storageBuffer8BitAccess, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->uniformAndStorageBuffer8BitAccess, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->storagePushConstant8, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderBufferInt64Atomics, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderSharedInt64Atomics, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderFloat16, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderInt8, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->descriptorIndexing, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderInputAttachmentArrayDynamicIndexing,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderUniformTexelBufferArrayDynamicIndexing,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderStorageTexelBufferArrayDynamicIndexing,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderUniformBufferArrayNonUniformIndexing,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderSampledImageArrayNonUniformIndexing,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderStorageBufferArrayNonUniformIndexing,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderStorageImageArrayNonUniformIndexing,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderInputAttachmentArrayNonUniformIndexing,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderUniformTexelBufferArrayNonUniformIndexing,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderStorageTexelBufferArrayNonUniformIndexing,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->descriptorBindingUniformBufferUpdateAfterBind,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->descriptorBindingSampledImageUpdateAfterBind,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->descriptorBindingStorageImageUpdateAfterBind,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->descriptorBindingStorageBufferUpdateAfterBind,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->descriptorBindingUniformTexelBufferUpdateAfterBind,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->descriptorBindingStorageTexelBufferUpdateAfterBind,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->descriptorBindingUpdateUnusedWhilePending,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->descriptorBindingPartiallyBound, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->descriptorBindingVariableDescriptorCount,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->runtimeDescriptorArray, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->samplerFilterMinmax, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->scalarBlockLayout, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->imagelessFramebuffer, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->uniformBufferStandardLayout, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderSubgroupExtendedTypes, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->separateDepthStencilLayouts, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->hostQueryReset, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->timelineSemaphore, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->bufferDeviceAddress, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->bufferDeviceAddressCaptureReplay, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->bufferDeviceAddressMultiDevice, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->vulkanMemoryModel, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->vulkanMemoryModelDeviceScope, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->vulkanMemoryModelAvailabilityVisibilityChains,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderOutputViewportIndex, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderOutputLayer, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->subgroupBroadcastDynamicId, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkConformanceVersion(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkConformanceVersion* forMarshaling,
+                                          uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint8_t*)&forMarshaling->major, sizeof(uint8_t));
+    *ptr += sizeof(uint8_t);
+    memcpy(*ptr, (uint8_t*)&forMarshaling->minor, sizeof(uint8_t));
+    *ptr += sizeof(uint8_t);
+    memcpy(*ptr, (uint8_t*)&forMarshaling->subminor, sizeof(uint8_t));
+    *ptr += sizeof(uint8_t);
+    memcpy(*ptr, (uint8_t*)&forMarshaling->patch, sizeof(uint8_t));
+    *ptr += sizeof(uint8_t);
+}
+
+void reservedmarshal_VkPhysicalDeviceVulkan12Properties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVulkan12Properties* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDriverId*)&forMarshaling->driverID, sizeof(VkDriverId));
+    *ptr += sizeof(VkDriverId);
+    memcpy(*ptr, (char*)forMarshaling->driverName, VK_MAX_DRIVER_NAME_SIZE * sizeof(char));
+    *ptr += VK_MAX_DRIVER_NAME_SIZE * sizeof(char);
+    memcpy(*ptr, (char*)forMarshaling->driverInfo, VK_MAX_DRIVER_INFO_SIZE * sizeof(char));
+    *ptr += VK_MAX_DRIVER_INFO_SIZE * sizeof(char);
+    reservedmarshal_VkConformanceVersion(
+        vkStream, rootType, (VkConformanceVersion*)(&forMarshaling->conformanceVersion), ptr);
+    memcpy(*ptr, (VkShaderFloatControlsIndependence*)&forMarshaling->denormBehaviorIndependence,
+           sizeof(VkShaderFloatControlsIndependence));
+    *ptr += sizeof(VkShaderFloatControlsIndependence);
+    memcpy(*ptr, (VkShaderFloatControlsIndependence*)&forMarshaling->roundingModeIndependence,
+           sizeof(VkShaderFloatControlsIndependence));
+    *ptr += sizeof(VkShaderFloatControlsIndependence);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderSignedZeroInfNanPreserveFloat16,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderSignedZeroInfNanPreserveFloat32,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderSignedZeroInfNanPreserveFloat64,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderDenormPreserveFloat16, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderDenormPreserveFloat32, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderDenormPreserveFloat64, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderDenormFlushToZeroFloat16, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderDenormFlushToZeroFloat32, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderDenormFlushToZeroFloat64, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderRoundingModeRTEFloat16, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderRoundingModeRTEFloat32, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderRoundingModeRTEFloat64, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderRoundingModeRTZFloat16, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderRoundingModeRTZFloat32, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderRoundingModeRTZFloat64, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxUpdateAfterBindDescriptorsInAllPools,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderUniformBufferArrayNonUniformIndexingNative,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderSampledImageArrayNonUniformIndexingNative,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderStorageBufferArrayNonUniformIndexingNative,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderStorageImageArrayNonUniformIndexingNative,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderInputAttachmentArrayNonUniformIndexingNative,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->robustBufferAccessUpdateAfterBind, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->quadDivergentImplicitLod, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPerStageDescriptorUpdateAfterBindSamplers,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPerStageDescriptorUpdateAfterBindUniformBuffers,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPerStageDescriptorUpdateAfterBindStorageBuffers,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPerStageDescriptorUpdateAfterBindSampledImages,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPerStageDescriptorUpdateAfterBindStorageImages,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPerStageDescriptorUpdateAfterBindInputAttachments,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPerStageUpdateAfterBindResources, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindSamplers,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindUniformBuffers,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindUniformBuffersDynamic,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindStorageBuffers,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindStorageBuffersDynamic,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindSampledImages,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindStorageImages,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindInputAttachments,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkResolveModeFlags*)&forMarshaling->supportedDepthResolveModes,
+           sizeof(VkResolveModeFlags));
+    *ptr += sizeof(VkResolveModeFlags);
+    memcpy(*ptr, (VkResolveModeFlags*)&forMarshaling->supportedStencilResolveModes,
+           sizeof(VkResolveModeFlags));
+    *ptr += sizeof(VkResolveModeFlags);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->independentResolveNone, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->independentResolve, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->filterMinmaxSingleComponentFormats, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->filterMinmaxImageComponentMapping, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->maxTimelineSemaphoreValueDifference, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+    memcpy(*ptr, (VkSampleCountFlags*)&forMarshaling->framebufferIntegerColorSampleCounts,
+           sizeof(VkSampleCountFlags));
+    *ptr += sizeof(VkSampleCountFlags);
+}
+
+void reservedmarshal_VkImageFormatListCreateInfo(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkImageFormatListCreateInfo* forMarshaling,
+                                                 uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->viewFormatCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const VkFormat*)forMarshaling->pViewFormats,
+           forMarshaling->viewFormatCount * sizeof(const VkFormat));
+    *ptr += forMarshaling->viewFormatCount * sizeof(const VkFormat);
+}
+
+void reservedmarshal_VkAttachmentDescription2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkAttachmentDescription2* forMarshaling,
+                                              uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkAttachmentDescriptionFlags*)&forMarshaling->flags,
+           sizeof(VkAttachmentDescriptionFlags));
+    *ptr += sizeof(VkAttachmentDescriptionFlags);
+    memcpy(*ptr, (VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+    *ptr += sizeof(VkFormat);
+    memcpy(*ptr, (VkSampleCountFlagBits*)&forMarshaling->samples, sizeof(VkSampleCountFlagBits));
+    *ptr += sizeof(VkSampleCountFlagBits);
+    memcpy(*ptr, (VkAttachmentLoadOp*)&forMarshaling->loadOp, sizeof(VkAttachmentLoadOp));
+    *ptr += sizeof(VkAttachmentLoadOp);
+    memcpy(*ptr, (VkAttachmentStoreOp*)&forMarshaling->storeOp, sizeof(VkAttachmentStoreOp));
+    *ptr += sizeof(VkAttachmentStoreOp);
+    memcpy(*ptr, (VkAttachmentLoadOp*)&forMarshaling->stencilLoadOp, sizeof(VkAttachmentLoadOp));
+    *ptr += sizeof(VkAttachmentLoadOp);
+    memcpy(*ptr, (VkAttachmentStoreOp*)&forMarshaling->stencilStoreOp, sizeof(VkAttachmentStoreOp));
+    *ptr += sizeof(VkAttachmentStoreOp);
+    memcpy(*ptr, (VkImageLayout*)&forMarshaling->initialLayout, sizeof(VkImageLayout));
+    *ptr += sizeof(VkImageLayout);
+    memcpy(*ptr, (VkImageLayout*)&forMarshaling->finalLayout, sizeof(VkImageLayout));
+    *ptr += sizeof(VkImageLayout);
+}
+
+void reservedmarshal_VkAttachmentReference2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkAttachmentReference2* forMarshaling,
+                                            uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->attachment, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkImageLayout*)&forMarshaling->layout, sizeof(VkImageLayout));
+    *ptr += sizeof(VkImageLayout);
+    memcpy(*ptr, (VkImageAspectFlags*)&forMarshaling->aspectMask, sizeof(VkImageAspectFlags));
+    *ptr += sizeof(VkImageAspectFlags);
+}
+
+void reservedmarshal_VkSubpassDescription2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkSubpassDescription2* forMarshaling,
+                                           uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkSubpassDescriptionFlags*)&forMarshaling->flags,
+           sizeof(VkSubpassDescriptionFlags));
+    *ptr += sizeof(VkSubpassDescriptionFlags);
+    memcpy(*ptr, (VkPipelineBindPoint*)&forMarshaling->pipelineBindPoint,
+           sizeof(VkPipelineBindPoint));
+    *ptr += sizeof(VkPipelineBindPoint);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->viewMask, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->inputAttachmentCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->inputAttachmentCount; ++i) {
+        reservedmarshal_VkAttachmentReference2(
+            vkStream, rootType,
+            (const VkAttachmentReference2*)(forMarshaling->pInputAttachments + i), ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->colorAttachmentCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->colorAttachmentCount; ++i) {
+        reservedmarshal_VkAttachmentReference2(
+            vkStream, rootType,
+            (const VkAttachmentReference2*)(forMarshaling->pColorAttachments + i), ptr);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pResolveAttachments;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pResolveAttachments) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->colorAttachmentCount; ++i) {
+            reservedmarshal_VkAttachmentReference2(
+                vkStream, rootType,
+                (const VkAttachmentReference2*)(forMarshaling->pResolveAttachments + i), ptr);
+        }
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pDepthStencilAttachment;
+    memcpy((*ptr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pDepthStencilAttachment) {
+        reservedmarshal_VkAttachmentReference2(
+            vkStream, rootType,
+            (const VkAttachmentReference2*)(forMarshaling->pDepthStencilAttachment), ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->preserveAttachmentCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const uint32_t*)forMarshaling->pPreserveAttachments,
+           forMarshaling->preserveAttachmentCount * sizeof(const uint32_t));
+    *ptr += forMarshaling->preserveAttachmentCount * sizeof(const uint32_t);
+}
+
+void reservedmarshal_VkSubpassDependency2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkSubpassDependency2* forMarshaling,
+                                          uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->srcSubpass, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->dstSubpass, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkPipelineStageFlags*)&forMarshaling->srcStageMask, sizeof(VkPipelineStageFlags));
+    *ptr += sizeof(VkPipelineStageFlags);
+    memcpy(*ptr, (VkPipelineStageFlags*)&forMarshaling->dstStageMask, sizeof(VkPipelineStageFlags));
+    *ptr += sizeof(VkPipelineStageFlags);
+    memcpy(*ptr, (VkAccessFlags*)&forMarshaling->srcAccessMask, sizeof(VkAccessFlags));
+    *ptr += sizeof(VkAccessFlags);
+    memcpy(*ptr, (VkAccessFlags*)&forMarshaling->dstAccessMask, sizeof(VkAccessFlags));
+    *ptr += sizeof(VkAccessFlags);
+    memcpy(*ptr, (VkDependencyFlags*)&forMarshaling->dependencyFlags, sizeof(VkDependencyFlags));
+    *ptr += sizeof(VkDependencyFlags);
+    memcpy(*ptr, (int32_t*)&forMarshaling->viewOffset, sizeof(int32_t));
+    *ptr += sizeof(int32_t);
+}
+
+void reservedmarshal_VkRenderPassCreateInfo2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkRenderPassCreateInfo2* forMarshaling,
+                                             uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkRenderPassCreateFlags*)&forMarshaling->flags, sizeof(VkRenderPassCreateFlags));
+    *ptr += sizeof(VkRenderPassCreateFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->attachmentCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->attachmentCount; ++i) {
+        reservedmarshal_VkAttachmentDescription2(
+            vkStream, rootType, (const VkAttachmentDescription2*)(forMarshaling->pAttachments + i),
+            ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->subpassCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->subpassCount; ++i) {
+        reservedmarshal_VkSubpassDescription2(
+            vkStream, rootType, (const VkSubpassDescription2*)(forMarshaling->pSubpasses + i), ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->dependencyCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->dependencyCount; ++i) {
+        reservedmarshal_VkSubpassDependency2(
+            vkStream, rootType, (const VkSubpassDependency2*)(forMarshaling->pDependencies + i),
+            ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->correlatedViewMaskCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const uint32_t*)forMarshaling->pCorrelatedViewMasks,
+           forMarshaling->correlatedViewMaskCount * sizeof(const uint32_t));
+    *ptr += forMarshaling->correlatedViewMaskCount * sizeof(const uint32_t);
+}
+
+void reservedmarshal_VkSubpassBeginInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkSubpassBeginInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkSubpassContents*)&forMarshaling->contents, sizeof(VkSubpassContents));
+    *ptr += sizeof(VkSubpassContents);
+}
+
+void reservedmarshal_VkSubpassEndInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkSubpassEndInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+}
+
+void reservedmarshal_VkPhysicalDevice8BitStorageFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevice8BitStorageFeatures* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->storageBuffer8BitAccess, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->uniformAndStorageBuffer8BitAccess, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->storagePushConstant8, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceDriverProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDriverProperties* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDriverId*)&forMarshaling->driverID, sizeof(VkDriverId));
+    *ptr += sizeof(VkDriverId);
+    memcpy(*ptr, (char*)forMarshaling->driverName, VK_MAX_DRIVER_NAME_SIZE * sizeof(char));
+    *ptr += VK_MAX_DRIVER_NAME_SIZE * sizeof(char);
+    memcpy(*ptr, (char*)forMarshaling->driverInfo, VK_MAX_DRIVER_INFO_SIZE * sizeof(char));
+    *ptr += VK_MAX_DRIVER_INFO_SIZE * sizeof(char);
+    reservedmarshal_VkConformanceVersion(
+        vkStream, rootType, (VkConformanceVersion*)(&forMarshaling->conformanceVersion), ptr);
+}
+
+void reservedmarshal_VkPhysicalDeviceShaderAtomicInt64Features(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderAtomicInt64Features* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderBufferInt64Atomics, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderSharedInt64Atomics, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceShaderFloat16Int8Features(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderFloat16Int8Features* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderFloat16, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderInt8, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceFloatControlsProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFloatControlsProperties* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkShaderFloatControlsIndependence*)&forMarshaling->denormBehaviorIndependence,
+           sizeof(VkShaderFloatControlsIndependence));
+    *ptr += sizeof(VkShaderFloatControlsIndependence);
+    memcpy(*ptr, (VkShaderFloatControlsIndependence*)&forMarshaling->roundingModeIndependence,
+           sizeof(VkShaderFloatControlsIndependence));
+    *ptr += sizeof(VkShaderFloatControlsIndependence);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderSignedZeroInfNanPreserveFloat16,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderSignedZeroInfNanPreserveFloat32,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderSignedZeroInfNanPreserveFloat64,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderDenormPreserveFloat16, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderDenormPreserveFloat32, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderDenormPreserveFloat64, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderDenormFlushToZeroFloat16, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderDenormFlushToZeroFloat32, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderDenormFlushToZeroFloat64, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderRoundingModeRTEFloat16, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderRoundingModeRTEFloat32, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderRoundingModeRTEFloat64, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderRoundingModeRTZFloat16, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderRoundingModeRTZFloat32, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderRoundingModeRTZFloat64, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkDescriptorSetLayoutBindingFlagsCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDescriptorSetLayoutBindingFlagsCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->bindingCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pBindingFlags;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pBindingFlags) {
+        memcpy(*ptr, (const VkDescriptorBindingFlags*)forMarshaling->pBindingFlags,
+               forMarshaling->bindingCount * sizeof(const VkDescriptorBindingFlags));
+        *ptr += forMarshaling->bindingCount * sizeof(const VkDescriptorBindingFlags);
+    }
+}
+
+void reservedmarshal_VkPhysicalDeviceDescriptorIndexingFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDescriptorIndexingFeatures* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderInputAttachmentArrayDynamicIndexing,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderUniformTexelBufferArrayDynamicIndexing,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderStorageTexelBufferArrayDynamicIndexing,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderUniformBufferArrayNonUniformIndexing,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderSampledImageArrayNonUniformIndexing,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderStorageBufferArrayNonUniformIndexing,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderStorageImageArrayNonUniformIndexing,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderInputAttachmentArrayNonUniformIndexing,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderUniformTexelBufferArrayNonUniformIndexing,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderStorageTexelBufferArrayNonUniformIndexing,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->descriptorBindingUniformBufferUpdateAfterBind,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->descriptorBindingSampledImageUpdateAfterBind,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->descriptorBindingStorageImageUpdateAfterBind,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->descriptorBindingStorageBufferUpdateAfterBind,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->descriptorBindingUniformTexelBufferUpdateAfterBind,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->descriptorBindingStorageTexelBufferUpdateAfterBind,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->descriptorBindingUpdateUnusedWhilePending,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->descriptorBindingPartiallyBound, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->descriptorBindingVariableDescriptorCount,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->runtimeDescriptorArray, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceDescriptorIndexingProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDescriptorIndexingProperties* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxUpdateAfterBindDescriptorsInAllPools,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderUniformBufferArrayNonUniformIndexingNative,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderSampledImageArrayNonUniformIndexingNative,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderStorageBufferArrayNonUniformIndexingNative,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderStorageImageArrayNonUniformIndexingNative,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderInputAttachmentArrayNonUniformIndexingNative,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->robustBufferAccessUpdateAfterBind, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->quadDivergentImplicitLod, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPerStageDescriptorUpdateAfterBindSamplers,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPerStageDescriptorUpdateAfterBindUniformBuffers,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPerStageDescriptorUpdateAfterBindStorageBuffers,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPerStageDescriptorUpdateAfterBindSampledImages,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPerStageDescriptorUpdateAfterBindStorageImages,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPerStageDescriptorUpdateAfterBindInputAttachments,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPerStageUpdateAfterBindResources, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindSamplers,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindUniformBuffers,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindUniformBuffersDynamic,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindStorageBuffers,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindStorageBuffersDynamic,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindSampledImages,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindStorageImages,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindInputAttachments,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkDescriptorSetVariableDescriptorCountAllocateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDescriptorSetVariableDescriptorCountAllocateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->descriptorSetCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const uint32_t*)forMarshaling->pDescriptorCounts,
+           forMarshaling->descriptorSetCount * sizeof(const uint32_t));
+    *ptr += forMarshaling->descriptorSetCount * sizeof(const uint32_t);
+}
+
+void reservedmarshal_VkDescriptorSetVariableDescriptorCountLayoutSupport(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDescriptorSetVariableDescriptorCountLayoutSupport* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxVariableDescriptorCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkSubpassDescriptionDepthStencilResolve(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSubpassDescriptionDepthStencilResolve* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkResolveModeFlagBits*)&forMarshaling->depthResolveMode,
+           sizeof(VkResolveModeFlagBits));
+    *ptr += sizeof(VkResolveModeFlagBits);
+    memcpy(*ptr, (VkResolveModeFlagBits*)&forMarshaling->stencilResolveMode,
+           sizeof(VkResolveModeFlagBits));
+    *ptr += sizeof(VkResolveModeFlagBits);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pDepthStencilResolveAttachment;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pDepthStencilResolveAttachment) {
+        reservedmarshal_VkAttachmentReference2(
+            vkStream, rootType,
+            (const VkAttachmentReference2*)(forMarshaling->pDepthStencilResolveAttachment), ptr);
+    }
+}
+
+void reservedmarshal_VkPhysicalDeviceDepthStencilResolveProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDepthStencilResolveProperties* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkResolveModeFlags*)&forMarshaling->supportedDepthResolveModes,
+           sizeof(VkResolveModeFlags));
+    *ptr += sizeof(VkResolveModeFlags);
+    memcpy(*ptr, (VkResolveModeFlags*)&forMarshaling->supportedStencilResolveModes,
+           sizeof(VkResolveModeFlags));
+    *ptr += sizeof(VkResolveModeFlags);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->independentResolveNone, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->independentResolve, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceScalarBlockLayoutFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceScalarBlockLayoutFeatures* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->scalarBlockLayout, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkImageStencilUsageCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageStencilUsageCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkImageUsageFlags*)&forMarshaling->stencilUsage, sizeof(VkImageUsageFlags));
+    *ptr += sizeof(VkImageUsageFlags);
+}
+
+void reservedmarshal_VkSamplerReductionModeCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSamplerReductionModeCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkSamplerReductionMode*)&forMarshaling->reductionMode,
+           sizeof(VkSamplerReductionMode));
+    *ptr += sizeof(VkSamplerReductionMode);
+}
+
+void reservedmarshal_VkPhysicalDeviceSamplerFilterMinmaxProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSamplerFilterMinmaxProperties* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->filterMinmaxSingleComponentFormats, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->filterMinmaxImageComponentMapping, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceVulkanMemoryModelFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVulkanMemoryModelFeatures* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->vulkanMemoryModel, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->vulkanMemoryModelDeviceScope, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->vulkanMemoryModelAvailabilityVisibilityChains,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceImagelessFramebufferFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceImagelessFramebufferFeatures* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->imagelessFramebuffer, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkFramebufferAttachmentImageInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkFramebufferAttachmentImageInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkImageCreateFlags*)&forMarshaling->flags, sizeof(VkImageCreateFlags));
+    *ptr += sizeof(VkImageCreateFlags);
+    memcpy(*ptr, (VkImageUsageFlags*)&forMarshaling->usage, sizeof(VkImageUsageFlags));
+    *ptr += sizeof(VkImageUsageFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->width, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->height, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->layerCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->viewFormatCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const VkFormat*)forMarshaling->pViewFormats,
+           forMarshaling->viewFormatCount * sizeof(const VkFormat));
+    *ptr += forMarshaling->viewFormatCount * sizeof(const VkFormat);
+}
+
+void reservedmarshal_VkFramebufferAttachmentsCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkFramebufferAttachmentsCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->attachmentImageInfoCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->attachmentImageInfoCount; ++i) {
+        reservedmarshal_VkFramebufferAttachmentImageInfo(
+            vkStream, rootType,
+            (const VkFramebufferAttachmentImageInfo*)(forMarshaling->pAttachmentImageInfos + i),
+            ptr);
+    }
+}
+
+void reservedmarshal_VkRenderPassAttachmentBeginInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRenderPassAttachmentBeginInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->attachmentCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    if (forMarshaling->attachmentCount) {
+        uint8_t* cgen_var_0_ptr = (uint8_t*)(*ptr);
+        if (forMarshaling) {
+            for (uint32_t k = 0; k < forMarshaling->attachmentCount; ++k) {
+                uint64_t tmpval = get_host_u64_VkImageView(forMarshaling->pAttachments[k]);
+                memcpy(cgen_var_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+            }
+        }
+        *ptr += 8 * forMarshaling->attachmentCount;
+    }
+}
+
+void reservedmarshal_VkPhysicalDeviceUniformBufferStandardLayoutFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceUniformBufferStandardLayoutFeatures* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->uniformBufferStandardLayout, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderSubgroupExtendedTypes, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->separateDepthStencilLayouts, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkAttachmentReferenceStencilLayout(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAttachmentReferenceStencilLayout* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkImageLayout*)&forMarshaling->stencilLayout, sizeof(VkImageLayout));
+    *ptr += sizeof(VkImageLayout);
+}
+
+void reservedmarshal_VkAttachmentDescriptionStencilLayout(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAttachmentDescriptionStencilLayout* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkImageLayout*)&forMarshaling->stencilInitialLayout, sizeof(VkImageLayout));
+    *ptr += sizeof(VkImageLayout);
+    memcpy(*ptr, (VkImageLayout*)&forMarshaling->stencilFinalLayout, sizeof(VkImageLayout));
+    *ptr += sizeof(VkImageLayout);
+}
+
+void reservedmarshal_VkPhysicalDeviceHostQueryResetFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceHostQueryResetFeatures* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->hostQueryReset, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceTimelineSemaphoreFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceTimelineSemaphoreFeatures* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->timelineSemaphore, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceTimelineSemaphoreProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceTimelineSemaphoreProperties* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->maxTimelineSemaphoreValueDifference, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+}
+
+void reservedmarshal_VkSemaphoreTypeCreateInfo(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkSemaphoreTypeCreateInfo* forMarshaling,
+                                               uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkSemaphoreType*)&forMarshaling->semaphoreType, sizeof(VkSemaphoreType));
+    *ptr += sizeof(VkSemaphoreType);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->initialValue, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+}
+
+void reservedmarshal_VkTimelineSemaphoreSubmitInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkTimelineSemaphoreSubmitInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->waitSemaphoreValueCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pWaitSemaphoreValues;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pWaitSemaphoreValues) {
+        memcpy(*ptr, (const uint64_t*)forMarshaling->pWaitSemaphoreValues,
+               forMarshaling->waitSemaphoreValueCount * sizeof(const uint64_t));
+        *ptr += forMarshaling->waitSemaphoreValueCount * sizeof(const uint64_t);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->signalSemaphoreValueCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pSignalSemaphoreValues;
+    memcpy((*ptr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pSignalSemaphoreValues) {
+        memcpy(*ptr, (const uint64_t*)forMarshaling->pSignalSemaphoreValues,
+               forMarshaling->signalSemaphoreValueCount * sizeof(const uint64_t));
+        *ptr += forMarshaling->signalSemaphoreValueCount * sizeof(const uint64_t);
+    }
+}
+
+void reservedmarshal_VkSemaphoreWaitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkSemaphoreWaitInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkSemaphoreWaitFlags*)&forMarshaling->flags, sizeof(VkSemaphoreWaitFlags));
+    *ptr += sizeof(VkSemaphoreWaitFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->semaphoreCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    if (forMarshaling->semaphoreCount) {
+        uint8_t* cgen_var_0_ptr = (uint8_t*)(*ptr);
+        if (forMarshaling) {
+            for (uint32_t k = 0; k < forMarshaling->semaphoreCount; ++k) {
+                uint64_t tmpval = get_host_u64_VkSemaphore(forMarshaling->pSemaphores[k]);
+                memcpy(cgen_var_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+            }
+        }
+        *ptr += 8 * forMarshaling->semaphoreCount;
+    }
+    memcpy(*ptr, (const uint64_t*)forMarshaling->pValues,
+           forMarshaling->semaphoreCount * sizeof(const uint64_t));
+    *ptr += forMarshaling->semaphoreCount * sizeof(const uint64_t);
+}
+
+void reservedmarshal_VkSemaphoreSignalInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkSemaphoreSignalInfo* forMarshaling,
+                                           uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkSemaphore((*&forMarshaling->semaphore));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (uint64_t*)&forMarshaling->value, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+}
+
+void reservedmarshal_VkPhysicalDeviceBufferDeviceAddressFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceBufferDeviceAddressFeatures* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->bufferDeviceAddress, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->bufferDeviceAddressCaptureReplay, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->bufferDeviceAddressMultiDevice, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkBufferDeviceAddressInfo(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkBufferDeviceAddressInfo* forMarshaling,
+                                               uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&forMarshaling->buffer));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+}
+
+void reservedmarshal_VkBufferOpaqueCaptureAddressCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferOpaqueCaptureAddressCreateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->opaqueCaptureAddress, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+}
+
+void reservedmarshal_VkMemoryOpaqueCaptureAddressAllocateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryOpaqueCaptureAddressAllocateInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->opaqueCaptureAddress, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+}
+
+void reservedmarshal_VkDeviceMemoryOpaqueCaptureAddressInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceMemoryOpaqueCaptureAddressInfo* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDeviceMemory((*&forMarshaling->memory));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+}
+
+#endif
+#ifdef VK_KHR_surface
+void reservedmarshal_VkSurfaceCapabilitiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkSurfaceCapabilitiesKHR* forMarshaling,
+                                              uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->minImageCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxImageCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    reservedmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->currentExtent),
+                               ptr);
+    reservedmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->minImageExtent),
+                               ptr);
+    reservedmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->maxImageExtent),
+                               ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxImageArrayLayers, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkSurfaceTransformFlagsKHR*)&forMarshaling->supportedTransforms,
+           sizeof(VkSurfaceTransformFlagsKHR));
+    *ptr += sizeof(VkSurfaceTransformFlagsKHR);
+    memcpy(*ptr, (VkSurfaceTransformFlagBitsKHR*)&forMarshaling->currentTransform,
+           sizeof(VkSurfaceTransformFlagBitsKHR));
+    *ptr += sizeof(VkSurfaceTransformFlagBitsKHR);
+    memcpy(*ptr, (VkCompositeAlphaFlagsKHR*)&forMarshaling->supportedCompositeAlpha,
+           sizeof(VkCompositeAlphaFlagsKHR));
+    *ptr += sizeof(VkCompositeAlphaFlagsKHR);
+    memcpy(*ptr, (VkImageUsageFlags*)&forMarshaling->supportedUsageFlags,
+           sizeof(VkImageUsageFlags));
+    *ptr += sizeof(VkImageUsageFlags);
+}
+
+void reservedmarshal_VkSurfaceFormatKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkSurfaceFormatKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+    *ptr += sizeof(VkFormat);
+    memcpy(*ptr, (VkColorSpaceKHR*)&forMarshaling->colorSpace, sizeof(VkColorSpaceKHR));
+    *ptr += sizeof(VkColorSpaceKHR);
+}
+
+#endif
+#ifdef VK_KHR_swapchain
+void reservedmarshal_VkSwapchainCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkSwapchainCreateInfoKHR* forMarshaling,
+                                              uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkSwapchainCreateFlagsKHR*)&forMarshaling->flags,
+           sizeof(VkSwapchainCreateFlagsKHR));
+    *ptr += sizeof(VkSwapchainCreateFlagsKHR);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkSurfaceKHR((*&forMarshaling->surface));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->minImageCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkFormat*)&forMarshaling->imageFormat, sizeof(VkFormat));
+    *ptr += sizeof(VkFormat);
+    memcpy(*ptr, (VkColorSpaceKHR*)&forMarshaling->imageColorSpace, sizeof(VkColorSpaceKHR));
+    *ptr += sizeof(VkColorSpaceKHR);
+    reservedmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->imageExtent), ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->imageArrayLayers, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkImageUsageFlags*)&forMarshaling->imageUsage, sizeof(VkImageUsageFlags));
+    *ptr += sizeof(VkImageUsageFlags);
+    memcpy(*ptr, (VkSharingMode*)&forMarshaling->imageSharingMode, sizeof(VkSharingMode));
+    *ptr += sizeof(VkSharingMode);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->queueFamilyIndexCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pQueueFamilyIndices;
+    memcpy((*ptr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pQueueFamilyIndices) {
+        memcpy(*ptr, (const uint32_t*)forMarshaling->pQueueFamilyIndices,
+               forMarshaling->queueFamilyIndexCount * sizeof(const uint32_t));
+        *ptr += forMarshaling->queueFamilyIndexCount * sizeof(const uint32_t);
+    }
+    memcpy(*ptr, (VkSurfaceTransformFlagBitsKHR*)&forMarshaling->preTransform,
+           sizeof(VkSurfaceTransformFlagBitsKHR));
+    *ptr += sizeof(VkSurfaceTransformFlagBitsKHR);
+    memcpy(*ptr, (VkCompositeAlphaFlagBitsKHR*)&forMarshaling->compositeAlpha,
+           sizeof(VkCompositeAlphaFlagBitsKHR));
+    *ptr += sizeof(VkCompositeAlphaFlagBitsKHR);
+    memcpy(*ptr, (VkPresentModeKHR*)&forMarshaling->presentMode, sizeof(VkPresentModeKHR));
+    *ptr += sizeof(VkPresentModeKHR);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->clipped, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = get_host_u64_VkSwapchainKHR((*&forMarshaling->oldSwapchain));
+    memcpy(*ptr, (uint64_t*)&cgen_var_2, 1 * 8);
+    *ptr += 1 * 8;
+}
+
+void reservedmarshal_VkPresentInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkPresentInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->waitSemaphoreCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    if (forMarshaling->waitSemaphoreCount) {
+        uint8_t* cgen_var_0_ptr = (uint8_t*)(*ptr);
+        if (forMarshaling) {
+            for (uint32_t k = 0; k < forMarshaling->waitSemaphoreCount; ++k) {
+                uint64_t tmpval = get_host_u64_VkSemaphore(forMarshaling->pWaitSemaphores[k]);
+                memcpy(cgen_var_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+            }
+        }
+        *ptr += 8 * forMarshaling->waitSemaphoreCount;
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->swapchainCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    if (forMarshaling->swapchainCount) {
+        uint8_t* cgen_var_1_ptr = (uint8_t*)(*ptr);
+        if (forMarshaling) {
+            for (uint32_t k = 0; k < forMarshaling->swapchainCount; ++k) {
+                uint64_t tmpval = get_host_u64_VkSwapchainKHR(forMarshaling->pSwapchains[k]);
+                memcpy(cgen_var_1_ptr + k * 8, &tmpval, sizeof(uint64_t));
+            }
+        }
+        *ptr += 8 * forMarshaling->swapchainCount;
+    }
+    memcpy(*ptr, (const uint32_t*)forMarshaling->pImageIndices,
+           forMarshaling->swapchainCount * sizeof(const uint32_t));
+    *ptr += forMarshaling->swapchainCount * sizeof(const uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)forMarshaling->pResults;
+    memcpy((*ptr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pResults) {
+        memcpy(*ptr, (VkResult*)forMarshaling->pResults,
+               forMarshaling->swapchainCount * sizeof(VkResult));
+        *ptr += forMarshaling->swapchainCount * sizeof(VkResult);
+    }
+}
+
+void reservedmarshal_VkImageSwapchainCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageSwapchainCreateInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkSwapchainKHR((*&forMarshaling->swapchain));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+}
+
+void reservedmarshal_VkBindImageMemorySwapchainInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBindImageMemorySwapchainInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkSwapchainKHR((*&forMarshaling->swapchain));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->imageIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkAcquireNextImageInfoKHR(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkAcquireNextImageInfoKHR* forMarshaling,
+                                               uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkSwapchainKHR((*&forMarshaling->swapchain));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (uint64_t*)&forMarshaling->timeout, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkSemaphore((*&forMarshaling->semaphore));
+    memcpy(*ptr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *ptr += 1 * 8;
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = get_host_u64_VkFence((*&forMarshaling->fence));
+    memcpy(*ptr, (uint64_t*)&cgen_var_2, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->deviceMask, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkDeviceGroupPresentCapabilitiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceGroupPresentCapabilitiesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)forMarshaling->presentMask,
+           VK_MAX_DEVICE_GROUP_SIZE * sizeof(uint32_t));
+    *ptr += VK_MAX_DEVICE_GROUP_SIZE * sizeof(uint32_t);
+    memcpy(*ptr, (VkDeviceGroupPresentModeFlagsKHR*)&forMarshaling->modes,
+           sizeof(VkDeviceGroupPresentModeFlagsKHR));
+    *ptr += sizeof(VkDeviceGroupPresentModeFlagsKHR);
+}
+
+void reservedmarshal_VkDeviceGroupPresentInfoKHR(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkDeviceGroupPresentInfoKHR* forMarshaling,
+                                                 uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->swapchainCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const uint32_t*)forMarshaling->pDeviceMasks,
+           forMarshaling->swapchainCount * sizeof(const uint32_t));
+    *ptr += forMarshaling->swapchainCount * sizeof(const uint32_t);
+    memcpy(*ptr, (VkDeviceGroupPresentModeFlagBitsKHR*)&forMarshaling->mode,
+           sizeof(VkDeviceGroupPresentModeFlagBitsKHR));
+    *ptr += sizeof(VkDeviceGroupPresentModeFlagBitsKHR);
+}
+
+void reservedmarshal_VkDeviceGroupSwapchainCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceGroupSwapchainCreateInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDeviceGroupPresentModeFlagsKHR*)&forMarshaling->modes,
+           sizeof(VkDeviceGroupPresentModeFlagsKHR));
+    *ptr += sizeof(VkDeviceGroupPresentModeFlagsKHR);
+}
+
+#endif
+#ifdef VK_KHR_display
+void reservedmarshal_VkDisplayModeParametersKHR(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkDisplayModeParametersKHR* forMarshaling,
+                                                uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    reservedmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->visibleRegion),
+                               ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->refreshRate, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkDisplayModeCreateInfoKHR(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkDisplayModeCreateInfoKHR* forMarshaling,
+                                                uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDisplayModeCreateFlagsKHR*)&forMarshaling->flags,
+           sizeof(VkDisplayModeCreateFlagsKHR));
+    *ptr += sizeof(VkDisplayModeCreateFlagsKHR);
+    reservedmarshal_VkDisplayModeParametersKHR(
+        vkStream, rootType, (VkDisplayModeParametersKHR*)(&forMarshaling->parameters), ptr);
+}
+
+void reservedmarshal_VkDisplayModePropertiesKHR(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkDisplayModePropertiesKHR* forMarshaling,
+                                                uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDisplayModeKHR((*&forMarshaling->displayMode));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    reservedmarshal_VkDisplayModeParametersKHR(
+        vkStream, rootType, (VkDisplayModeParametersKHR*)(&forMarshaling->parameters), ptr);
+}
+
+void reservedmarshal_VkDisplayPlaneCapabilitiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDisplayPlaneCapabilitiesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkDisplayPlaneAlphaFlagsKHR*)&forMarshaling->supportedAlpha,
+           sizeof(VkDisplayPlaneAlphaFlagsKHR));
+    *ptr += sizeof(VkDisplayPlaneAlphaFlagsKHR);
+    reservedmarshal_VkOffset2D(vkStream, rootType, (VkOffset2D*)(&forMarshaling->minSrcPosition),
+                               ptr);
+    reservedmarshal_VkOffset2D(vkStream, rootType, (VkOffset2D*)(&forMarshaling->maxSrcPosition),
+                               ptr);
+    reservedmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->minSrcExtent),
+                               ptr);
+    reservedmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->maxSrcExtent),
+                               ptr);
+    reservedmarshal_VkOffset2D(vkStream, rootType, (VkOffset2D*)(&forMarshaling->minDstPosition),
+                               ptr);
+    reservedmarshal_VkOffset2D(vkStream, rootType, (VkOffset2D*)(&forMarshaling->maxDstPosition),
+                               ptr);
+    reservedmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->minDstExtent),
+                               ptr);
+    reservedmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->maxDstExtent),
+                               ptr);
+}
+
+void reservedmarshal_VkDisplayPlanePropertiesKHR(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkDisplayPlanePropertiesKHR* forMarshaling,
+                                                 uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDisplayKHR((*&forMarshaling->currentDisplay));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->currentStackIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkDisplayPropertiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkDisplayPropertiesKHR* forMarshaling,
+                                            uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDisplayKHR((*&forMarshaling->display));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    {
+        uint32_t l = forMarshaling->displayName ? strlen(forMarshaling->displayName) : 0;
+        memcpy(*ptr, (uint32_t*)&l, sizeof(uint32_t));
+        android::base::Stream::toBe32((uint8_t*)*ptr);
+        *ptr += sizeof(uint32_t);
+        memcpy(*ptr, (char*)forMarshaling->displayName, l);
+        *ptr += l;
+    }
+    reservedmarshal_VkExtent2D(vkStream, rootType,
+                               (VkExtent2D*)(&forMarshaling->physicalDimensions), ptr);
+    reservedmarshal_VkExtent2D(vkStream, rootType,
+                               (VkExtent2D*)(&forMarshaling->physicalResolution), ptr);
+    memcpy(*ptr, (VkSurfaceTransformFlagsKHR*)&forMarshaling->supportedTransforms,
+           sizeof(VkSurfaceTransformFlagsKHR));
+    *ptr += sizeof(VkSurfaceTransformFlagsKHR);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->planeReorderPossible, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->persistentContent, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkDisplaySurfaceCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDisplaySurfaceCreateInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDisplaySurfaceCreateFlagsKHR*)&forMarshaling->flags,
+           sizeof(VkDisplaySurfaceCreateFlagsKHR));
+    *ptr += sizeof(VkDisplaySurfaceCreateFlagsKHR);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDisplayModeKHR((*&forMarshaling->displayMode));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->planeIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->planeStackIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkSurfaceTransformFlagBitsKHR*)&forMarshaling->transform,
+           sizeof(VkSurfaceTransformFlagBitsKHR));
+    *ptr += sizeof(VkSurfaceTransformFlagBitsKHR);
+    memcpy(*ptr, (float*)&forMarshaling->globalAlpha, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (VkDisplayPlaneAlphaFlagBitsKHR*)&forMarshaling->alphaMode,
+           sizeof(VkDisplayPlaneAlphaFlagBitsKHR));
+    *ptr += sizeof(VkDisplayPlaneAlphaFlagBitsKHR);
+    reservedmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->imageExtent), ptr);
+}
+
+#endif
+#ifdef VK_KHR_display_swapchain
+void reservedmarshal_VkDisplayPresentInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkDisplayPresentInfoKHR* forMarshaling,
+                                             uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkRect2D(vkStream, rootType, (VkRect2D*)(&forMarshaling->srcRect), ptr);
+    reservedmarshal_VkRect2D(vkStream, rootType, (VkRect2D*)(&forMarshaling->dstRect), ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->persistent, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_KHR_xlib_surface
+void reservedmarshal_VkXlibSurfaceCreateInfoKHR(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkXlibSurfaceCreateInfoKHR* forMarshaling,
+                                                uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkXlibSurfaceCreateFlagsKHR*)&forMarshaling->flags,
+           sizeof(VkXlibSurfaceCreateFlagsKHR));
+    *ptr += sizeof(VkXlibSurfaceCreateFlagsKHR);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->dpy;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->dpy) {
+        memcpy(*ptr, (Display*)forMarshaling->dpy, sizeof(Display));
+        *ptr += sizeof(Display);
+    }
+    memcpy(*ptr, (Window*)&forMarshaling->window, sizeof(Window));
+    *ptr += sizeof(Window);
+}
+
+#endif
+#ifdef VK_KHR_xcb_surface
+void reservedmarshal_VkXcbSurfaceCreateInfoKHR(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkXcbSurfaceCreateInfoKHR* forMarshaling,
+                                               uint8_t** ptr) {
+    // This struct should never be marshaled / unmarshaled.
+    __builtin_trap();
+}
+
+#endif
+#ifdef VK_KHR_wayland_surface
+void reservedmarshal_VkWaylandSurfaceCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkWaylandSurfaceCreateInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkWaylandSurfaceCreateFlagsKHR*)&forMarshaling->flags,
+           sizeof(VkWaylandSurfaceCreateFlagsKHR));
+    *ptr += sizeof(VkWaylandSurfaceCreateFlagsKHR);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->display;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->display) {
+        memcpy(*ptr, (wl_display*)forMarshaling->display, sizeof(wl_display));
+        *ptr += sizeof(wl_display);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->surface;
+    memcpy((*ptr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->surface) {
+        memcpy(*ptr, (wl_surface*)forMarshaling->surface, sizeof(wl_surface));
+        *ptr += sizeof(wl_surface);
+    }
+}
+
+#endif
+#ifdef VK_KHR_android_surface
+void reservedmarshal_VkAndroidSurfaceCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAndroidSurfaceCreateInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkAndroidSurfaceCreateFlagsKHR*)&forMarshaling->flags,
+           sizeof(VkAndroidSurfaceCreateFlagsKHR));
+    *ptr += sizeof(VkAndroidSurfaceCreateFlagsKHR);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->window;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->window) {
+        memcpy(*ptr, (ANativeWindow*)forMarshaling->window, sizeof(ANativeWindow));
+        *ptr += sizeof(ANativeWindow);
+    }
+}
+
+#endif
+#ifdef VK_KHR_win32_surface
+void reservedmarshal_VkWin32SurfaceCreateInfoKHR(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkWin32SurfaceCreateInfoKHR* forMarshaling,
+                                                 uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkWin32SurfaceCreateFlagsKHR*)&forMarshaling->flags,
+           sizeof(VkWin32SurfaceCreateFlagsKHR));
+    *ptr += sizeof(VkWin32SurfaceCreateFlagsKHR);
+    memcpy(*ptr, (HINSTANCE*)&forMarshaling->hinstance, sizeof(HINSTANCE));
+    *ptr += sizeof(HINSTANCE);
+    memcpy(*ptr, (HWND*)&forMarshaling->hwnd, sizeof(HWND));
+    *ptr += sizeof(HWND);
+}
+
+#endif
+#ifdef VK_KHR_sampler_mirror_clamp_to_edge
+#endif
+#ifdef VK_KHR_video_queue
+void reservedmarshal_VkVideoQueueFamilyProperties2KHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoQueueFamilyProperties2KHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkVideoCodecOperationFlagsKHR*)&forMarshaling->videoCodecOperations,
+           sizeof(VkVideoCodecOperationFlagsKHR));
+    *ptr += sizeof(VkVideoCodecOperationFlagsKHR);
+}
+
+void reservedmarshal_VkVideoProfileKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkVideoProfileKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkVideoCodecOperationFlagBitsKHR*)&forMarshaling->videoCodecOperation,
+           sizeof(VkVideoCodecOperationFlagBitsKHR));
+    *ptr += sizeof(VkVideoCodecOperationFlagBitsKHR);
+    memcpy(*ptr, (VkVideoChromaSubsamplingFlagsKHR*)&forMarshaling->chromaSubsampling,
+           sizeof(VkVideoChromaSubsamplingFlagsKHR));
+    *ptr += sizeof(VkVideoChromaSubsamplingFlagsKHR);
+    memcpy(*ptr, (VkVideoComponentBitDepthFlagsKHR*)&forMarshaling->lumaBitDepth,
+           sizeof(VkVideoComponentBitDepthFlagsKHR));
+    *ptr += sizeof(VkVideoComponentBitDepthFlagsKHR);
+    memcpy(*ptr, (VkVideoComponentBitDepthFlagsKHR*)&forMarshaling->chromaBitDepth,
+           sizeof(VkVideoComponentBitDepthFlagsKHR));
+    *ptr += sizeof(VkVideoComponentBitDepthFlagsKHR);
+}
+
+void reservedmarshal_VkVideoProfilesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkVideoProfilesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->profileCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    reservedmarshal_VkVideoProfileKHR(vkStream, rootType,
+                                      (const VkVideoProfileKHR*)(forMarshaling->pProfiles), ptr);
+}
+
+void reservedmarshal_VkVideoCapabilitiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkVideoCapabilitiesKHR* forMarshaling,
+                                            uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkVideoCapabilityFlagsKHR*)&forMarshaling->capabilityFlags,
+           sizeof(VkVideoCapabilityFlagsKHR));
+    *ptr += sizeof(VkVideoCapabilityFlagsKHR);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->minBitstreamBufferOffsetAlignment,
+           sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->minBitstreamBufferSizeAlignment,
+           sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    reservedmarshal_VkExtent2D(vkStream, rootType,
+                               (VkExtent2D*)(&forMarshaling->videoPictureExtentGranularity), ptr);
+    reservedmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->minExtent), ptr);
+    reservedmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->maxExtent), ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxReferencePicturesSlotsCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxReferencePicturesActiveCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkPhysicalDeviceVideoFormatInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVideoFormatInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkImageUsageFlags*)&forMarshaling->imageUsage, sizeof(VkImageUsageFlags));
+    *ptr += sizeof(VkImageUsageFlags);
+    reservedmarshal_VkVideoProfilesKHR(
+        vkStream, rootType, (const VkVideoProfilesKHR*)(forMarshaling->pVideoProfiles), ptr);
+}
+
+void reservedmarshal_VkVideoFormatPropertiesKHR(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkVideoFormatPropertiesKHR* forMarshaling,
+                                                uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+    *ptr += sizeof(VkFormat);
+}
+
+void reservedmarshal_VkVideoPictureResourceKHR(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkVideoPictureResourceKHR* forMarshaling,
+                                               uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkOffset2D(vkStream, rootType, (VkOffset2D*)(&forMarshaling->codedOffset), ptr);
+    reservedmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->codedExtent), ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->baseArrayLayer, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImageView((*&forMarshaling->imageViewBinding));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+}
+
+void reservedmarshal_VkVideoReferenceSlotKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkVideoReferenceSlotKHR* forMarshaling,
+                                             uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (int8_t*)&forMarshaling->slotIndex, sizeof(int8_t));
+    *ptr += sizeof(int8_t);
+    reservedmarshal_VkVideoPictureResourceKHR(
+        vkStream, rootType, (const VkVideoPictureResourceKHR*)(forMarshaling->pPictureResource),
+        ptr);
+}
+
+void reservedmarshal_VkVideoGetMemoryPropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoGetMemoryPropertiesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->memoryBindIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    reservedmarshal_VkMemoryRequirements2(
+        vkStream, rootType, (VkMemoryRequirements2*)(forMarshaling->pMemoryRequirements), ptr);
+}
+
+void reservedmarshal_VkVideoBindMemoryKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkVideoBindMemoryKHR* forMarshaling,
+                                          uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->memoryBindIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDeviceMemory((*&forMarshaling->memory));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->memoryOffset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->memorySize, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+}
+
+void reservedmarshal_VkVideoSessionCreateInfoKHR(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkVideoSessionCreateInfoKHR* forMarshaling,
+                                                 uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->queueFamilyIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkVideoSessionCreateFlagsKHR*)&forMarshaling->flags,
+           sizeof(VkVideoSessionCreateFlagsKHR));
+    *ptr += sizeof(VkVideoSessionCreateFlagsKHR);
+    reservedmarshal_VkVideoProfileKHR(
+        vkStream, rootType, (const VkVideoProfileKHR*)(forMarshaling->pVideoProfile), ptr);
+    memcpy(*ptr, (VkFormat*)&forMarshaling->pictureFormat, sizeof(VkFormat));
+    *ptr += sizeof(VkFormat);
+    reservedmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->maxCodedExtent),
+                               ptr);
+    memcpy(*ptr, (VkFormat*)&forMarshaling->referencePicturesFormat, sizeof(VkFormat));
+    *ptr += sizeof(VkFormat);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxReferencePicturesSlotsCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxReferencePicturesActiveCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkVideoSessionParametersCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoSessionParametersCreateInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->videoSessionParametersTemplate;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    uint64_t cgen_var_1 = (uint64_t)forMarshaling->videoSession;
+    memcpy((*ptr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+}
+
+void reservedmarshal_VkVideoSessionParametersUpdateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoSessionParametersUpdateInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->updateSequenceCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkVideoBeginCodingInfoKHR(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkVideoBeginCodingInfoKHR* forMarshaling,
+                                               uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkVideoBeginCodingFlagsKHR*)&forMarshaling->flags,
+           sizeof(VkVideoBeginCodingFlagsKHR));
+    *ptr += sizeof(VkVideoBeginCodingFlagsKHR);
+    memcpy(*ptr, (VkVideoCodingQualityPresetFlagsKHR*)&forMarshaling->codecQualityPreset,
+           sizeof(VkVideoCodingQualityPresetFlagsKHR));
+    *ptr += sizeof(VkVideoCodingQualityPresetFlagsKHR);
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->videoSession;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    uint64_t cgen_var_1 = (uint64_t)forMarshaling->videoSessionParameters;
+    memcpy((*ptr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->referenceSlotCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->referenceSlotCount; ++i) {
+        reservedmarshal_VkVideoReferenceSlotKHR(
+            vkStream, rootType,
+            (const VkVideoReferenceSlotKHR*)(forMarshaling->pReferenceSlots + i), ptr);
+    }
+}
+
+void reservedmarshal_VkVideoEndCodingInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkVideoEndCodingInfoKHR* forMarshaling,
+                                             uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkVideoEndCodingFlagsKHR*)&forMarshaling->flags,
+           sizeof(VkVideoEndCodingFlagsKHR));
+    *ptr += sizeof(VkVideoEndCodingFlagsKHR);
+}
+
+void reservedmarshal_VkVideoCodingControlInfoKHR(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkVideoCodingControlInfoKHR* forMarshaling,
+                                                 uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkVideoCodingControlFlagsKHR*)&forMarshaling->flags,
+           sizeof(VkVideoCodingControlFlagsKHR));
+    *ptr += sizeof(VkVideoCodingControlFlagsKHR);
+}
+
+#endif
+#ifdef VK_KHR_video_decode_queue
+void reservedmarshal_VkVideoDecodeInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkVideoDecodeInfoKHR* forMarshaling,
+                                          uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkVideoDecodeFlagsKHR*)&forMarshaling->flags, sizeof(VkVideoDecodeFlagsKHR));
+    *ptr += sizeof(VkVideoDecodeFlagsKHR);
+    reservedmarshal_VkOffset2D(vkStream, rootType, (VkOffset2D*)(&forMarshaling->codedOffset), ptr);
+    reservedmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->codedExtent), ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&forMarshaling->srcBuffer));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->srcBufferOffset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->srcBufferRange, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    reservedmarshal_VkVideoPictureResourceKHR(
+        vkStream, rootType, (VkVideoPictureResourceKHR*)(&forMarshaling->dstPictureResource), ptr);
+    reservedmarshal_VkVideoReferenceSlotKHR(
+        vkStream, rootType, (const VkVideoReferenceSlotKHR*)(forMarshaling->pSetupReferenceSlot),
+        ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->referenceSlotCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->referenceSlotCount; ++i) {
+        reservedmarshal_VkVideoReferenceSlotKHR(
+            vkStream, rootType,
+            (const VkVideoReferenceSlotKHR*)(forMarshaling->pReferenceSlots + i), ptr);
+    }
+}
+
+#endif
+#ifdef VK_KHR_dynamic_rendering
+void reservedmarshal_VkRenderingAttachmentInfoKHR(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkRenderingAttachmentInfoKHR* forMarshaling,
+                                                  uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImageView((*&forMarshaling->imageView));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkImageLayout*)&forMarshaling->imageLayout, sizeof(VkImageLayout));
+    *ptr += sizeof(VkImageLayout);
+    memcpy(*ptr, (VkResolveModeFlagBits*)&forMarshaling->resolveMode,
+           sizeof(VkResolveModeFlagBits));
+    *ptr += sizeof(VkResolveModeFlagBits);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkImageView((*&forMarshaling->resolveImageView));
+    memcpy(*ptr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkImageLayout*)&forMarshaling->resolveImageLayout, sizeof(VkImageLayout));
+    *ptr += sizeof(VkImageLayout);
+    memcpy(*ptr, (VkAttachmentLoadOp*)&forMarshaling->loadOp, sizeof(VkAttachmentLoadOp));
+    *ptr += sizeof(VkAttachmentLoadOp);
+    memcpy(*ptr, (VkAttachmentStoreOp*)&forMarshaling->storeOp, sizeof(VkAttachmentStoreOp));
+    *ptr += sizeof(VkAttachmentStoreOp);
+    reservedmarshal_VkClearValue(vkStream, rootType, (VkClearValue*)(&forMarshaling->clearValue),
+                                 ptr);
+}
+
+void reservedmarshal_VkRenderingInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkRenderingInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkRenderingFlagsKHR*)&forMarshaling->flags, sizeof(VkRenderingFlagsKHR));
+    *ptr += sizeof(VkRenderingFlagsKHR);
+    reservedmarshal_VkRect2D(vkStream, rootType, (VkRect2D*)(&forMarshaling->renderArea), ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->layerCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->viewMask, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->colorAttachmentCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->colorAttachmentCount; ++i) {
+        reservedmarshal_VkRenderingAttachmentInfoKHR(
+            vkStream, rootType,
+            (const VkRenderingAttachmentInfoKHR*)(forMarshaling->pColorAttachments + i), ptr);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pDepthAttachment;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pDepthAttachment) {
+        reservedmarshal_VkRenderingAttachmentInfoKHR(
+            vkStream, rootType,
+            (const VkRenderingAttachmentInfoKHR*)(forMarshaling->pDepthAttachment), ptr);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pStencilAttachment;
+    memcpy((*ptr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pStencilAttachment) {
+        reservedmarshal_VkRenderingAttachmentInfoKHR(
+            vkStream, rootType,
+            (const VkRenderingAttachmentInfoKHR*)(forMarshaling->pStencilAttachment), ptr);
+    }
+}
+
+void reservedmarshal_VkPipelineRenderingCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRenderingCreateInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->viewMask, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->colorAttachmentCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const VkFormat*)forMarshaling->pColorAttachmentFormats,
+           forMarshaling->colorAttachmentCount * sizeof(const VkFormat));
+    *ptr += forMarshaling->colorAttachmentCount * sizeof(const VkFormat);
+    memcpy(*ptr, (VkFormat*)&forMarshaling->depthAttachmentFormat, sizeof(VkFormat));
+    *ptr += sizeof(VkFormat);
+    memcpy(*ptr, (VkFormat*)&forMarshaling->stencilAttachmentFormat, sizeof(VkFormat));
+    *ptr += sizeof(VkFormat);
+}
+
+void reservedmarshal_VkPhysicalDeviceDynamicRenderingFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDynamicRenderingFeaturesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->dynamicRendering, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkCommandBufferInheritanceRenderingInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCommandBufferInheritanceRenderingInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkRenderingFlagsKHR*)&forMarshaling->flags, sizeof(VkRenderingFlagsKHR));
+    *ptr += sizeof(VkRenderingFlagsKHR);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->viewMask, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->colorAttachmentCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const VkFormat*)forMarshaling->pColorAttachmentFormats,
+           forMarshaling->colorAttachmentCount * sizeof(const VkFormat));
+    *ptr += forMarshaling->colorAttachmentCount * sizeof(const VkFormat);
+    memcpy(*ptr, (VkFormat*)&forMarshaling->depthAttachmentFormat, sizeof(VkFormat));
+    *ptr += sizeof(VkFormat);
+    memcpy(*ptr, (VkFormat*)&forMarshaling->stencilAttachmentFormat, sizeof(VkFormat));
+    *ptr += sizeof(VkFormat);
+    memcpy(*ptr, (VkSampleCountFlagBits*)&forMarshaling->rasterizationSamples,
+           sizeof(VkSampleCountFlagBits));
+    *ptr += sizeof(VkSampleCountFlagBits);
+}
+
+void reservedmarshal_VkRenderingFragmentShadingRateAttachmentInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRenderingFragmentShadingRateAttachmentInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImageView((*&forMarshaling->imageView));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkImageLayout*)&forMarshaling->imageLayout, sizeof(VkImageLayout));
+    *ptr += sizeof(VkImageLayout);
+    reservedmarshal_VkExtent2D(vkStream, rootType,
+                               (VkExtent2D*)(&forMarshaling->shadingRateAttachmentTexelSize), ptr);
+}
+
+void reservedmarshal_VkRenderingFragmentDensityMapAttachmentInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRenderingFragmentDensityMapAttachmentInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImageView((*&forMarshaling->imageView));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkImageLayout*)&forMarshaling->imageLayout, sizeof(VkImageLayout));
+    *ptr += sizeof(VkImageLayout);
+}
+
+void reservedmarshal_VkAttachmentSampleCountInfoAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAttachmentSampleCountInfoAMD* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->colorAttachmentCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pColorAttachmentSamples;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pColorAttachmentSamples) {
+        memcpy(*ptr, (const VkSampleCountFlagBits*)forMarshaling->pColorAttachmentSamples,
+               forMarshaling->colorAttachmentCount * sizeof(const VkSampleCountFlagBits));
+        *ptr += forMarshaling->colorAttachmentCount * sizeof(const VkSampleCountFlagBits);
+    }
+    memcpy(*ptr, (VkSampleCountFlagBits*)&forMarshaling->depthStencilAttachmentSamples,
+           sizeof(VkSampleCountFlagBits));
+    *ptr += sizeof(VkSampleCountFlagBits);
+}
+
+void reservedmarshal_VkMultiviewPerViewAttributesInfoNVX(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMultiviewPerViewAttributesInfoNVX* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->perViewAttributes, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->perViewAttributesPositionXOnly, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_KHR_multiview
+#endif
+#ifdef VK_KHR_get_physical_device_properties2
+#endif
+#ifdef VK_KHR_device_group
+#endif
+#ifdef VK_KHR_shader_draw_parameters
+#endif
+#ifdef VK_KHR_maintenance1
+#endif
+#ifdef VK_KHR_device_group_creation
+#endif
+#ifdef VK_KHR_external_memory_capabilities
+#endif
+#ifdef VK_KHR_external_memory
+#endif
+#ifdef VK_KHR_external_memory_win32
+void reservedmarshal_VkImportMemoryWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportMemoryWin32HandleInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkExternalMemoryHandleTypeFlagBits*)&forMarshaling->handleType,
+           sizeof(VkExternalMemoryHandleTypeFlagBits));
+    *ptr += sizeof(VkExternalMemoryHandleTypeFlagBits);
+    memcpy(*ptr, (HANDLE*)&forMarshaling->handle, sizeof(HANDLE));
+    *ptr += sizeof(HANDLE);
+    memcpy(*ptr, (LPCWSTR*)&forMarshaling->name, sizeof(LPCWSTR));
+    *ptr += sizeof(LPCWSTR);
+}
+
+void reservedmarshal_VkExportMemoryWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExportMemoryWin32HandleInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pAttributes;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pAttributes) {
+        memcpy(*ptr, (const SECURITY_ATTRIBUTES*)forMarshaling->pAttributes,
+               sizeof(const SECURITY_ATTRIBUTES));
+        *ptr += sizeof(const SECURITY_ATTRIBUTES);
+    }
+    memcpy(*ptr, (DWORD*)&forMarshaling->dwAccess, sizeof(DWORD));
+    *ptr += sizeof(DWORD);
+    memcpy(*ptr, (LPCWSTR*)&forMarshaling->name, sizeof(LPCWSTR));
+    *ptr += sizeof(LPCWSTR);
+}
+
+void reservedmarshal_VkMemoryWin32HandlePropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryWin32HandlePropertiesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->memoryTypeBits, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkMemoryGetWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryGetWin32HandleInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDeviceMemory((*&forMarshaling->memory));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkExternalMemoryHandleTypeFlagBits*)&forMarshaling->handleType,
+           sizeof(VkExternalMemoryHandleTypeFlagBits));
+    *ptr += sizeof(VkExternalMemoryHandleTypeFlagBits);
+}
+
+#endif
+#ifdef VK_KHR_external_memory_fd
+void reservedmarshal_VkImportMemoryFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkImportMemoryFdInfoKHR* forMarshaling,
+                                             uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkExternalMemoryHandleTypeFlagBits*)&forMarshaling->handleType,
+           sizeof(VkExternalMemoryHandleTypeFlagBits));
+    *ptr += sizeof(VkExternalMemoryHandleTypeFlagBits);
+    memcpy(*ptr, (int*)&forMarshaling->fd, sizeof(int));
+    *ptr += sizeof(int);
+}
+
+void reservedmarshal_VkMemoryFdPropertiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkMemoryFdPropertiesKHR* forMarshaling,
+                                             uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->memoryTypeBits, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkMemoryGetFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkMemoryGetFdInfoKHR* forMarshaling,
+                                          uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDeviceMemory((*&forMarshaling->memory));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkExternalMemoryHandleTypeFlagBits*)&forMarshaling->handleType,
+           sizeof(VkExternalMemoryHandleTypeFlagBits));
+    *ptr += sizeof(VkExternalMemoryHandleTypeFlagBits);
+}
+
+#endif
+#ifdef VK_KHR_win32_keyed_mutex
+void reservedmarshal_VkWin32KeyedMutexAcquireReleaseInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkWin32KeyedMutexAcquireReleaseInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->acquireCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    if (forMarshaling->acquireCount) {
+        uint8_t* cgen_var_0_ptr = (uint8_t*)(*ptr);
+        if (forMarshaling) {
+            for (uint32_t k = 0; k < forMarshaling->acquireCount; ++k) {
+                uint64_t tmpval = get_host_u64_VkDeviceMemory(forMarshaling->pAcquireSyncs[k]);
+                memcpy(cgen_var_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+            }
+        }
+        *ptr += 8 * forMarshaling->acquireCount;
+    }
+    memcpy(*ptr, (const uint64_t*)forMarshaling->pAcquireKeys,
+           forMarshaling->acquireCount * sizeof(const uint64_t));
+    *ptr += forMarshaling->acquireCount * sizeof(const uint64_t);
+    memcpy(*ptr, (const uint32_t*)forMarshaling->pAcquireTimeouts,
+           forMarshaling->acquireCount * sizeof(const uint32_t));
+    *ptr += forMarshaling->acquireCount * sizeof(const uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->releaseCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    if (forMarshaling->releaseCount) {
+        uint8_t* cgen_var_1_ptr = (uint8_t*)(*ptr);
+        if (forMarshaling) {
+            for (uint32_t k = 0; k < forMarshaling->releaseCount; ++k) {
+                uint64_t tmpval = get_host_u64_VkDeviceMemory(forMarshaling->pReleaseSyncs[k]);
+                memcpy(cgen_var_1_ptr + k * 8, &tmpval, sizeof(uint64_t));
+            }
+        }
+        *ptr += 8 * forMarshaling->releaseCount;
+    }
+    memcpy(*ptr, (const uint64_t*)forMarshaling->pReleaseKeys,
+           forMarshaling->releaseCount * sizeof(const uint64_t));
+    *ptr += forMarshaling->releaseCount * sizeof(const uint64_t);
+}
+
+#endif
+#ifdef VK_KHR_external_semaphore_capabilities
+#endif
+#ifdef VK_KHR_external_semaphore
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+void reservedmarshal_VkImportSemaphoreWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportSemaphoreWin32HandleInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkSemaphore((*&forMarshaling->semaphore));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkSemaphoreImportFlags*)&forMarshaling->flags, sizeof(VkSemaphoreImportFlags));
+    *ptr += sizeof(VkSemaphoreImportFlags);
+    memcpy(*ptr, (VkExternalSemaphoreHandleTypeFlagBits*)&forMarshaling->handleType,
+           sizeof(VkExternalSemaphoreHandleTypeFlagBits));
+    *ptr += sizeof(VkExternalSemaphoreHandleTypeFlagBits);
+    memcpy(*ptr, (HANDLE*)&forMarshaling->handle, sizeof(HANDLE));
+    *ptr += sizeof(HANDLE);
+    memcpy(*ptr, (LPCWSTR*)&forMarshaling->name, sizeof(LPCWSTR));
+    *ptr += sizeof(LPCWSTR);
+}
+
+void reservedmarshal_VkExportSemaphoreWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExportSemaphoreWin32HandleInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pAttributes;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pAttributes) {
+        memcpy(*ptr, (const SECURITY_ATTRIBUTES*)forMarshaling->pAttributes,
+               sizeof(const SECURITY_ATTRIBUTES));
+        *ptr += sizeof(const SECURITY_ATTRIBUTES);
+    }
+    memcpy(*ptr, (DWORD*)&forMarshaling->dwAccess, sizeof(DWORD));
+    *ptr += sizeof(DWORD);
+    memcpy(*ptr, (LPCWSTR*)&forMarshaling->name, sizeof(LPCWSTR));
+    *ptr += sizeof(LPCWSTR);
+}
+
+void reservedmarshal_VkD3D12FenceSubmitInfoKHR(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkD3D12FenceSubmitInfoKHR* forMarshaling,
+                                               uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->waitSemaphoreValuesCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pWaitSemaphoreValues;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pWaitSemaphoreValues) {
+        memcpy(*ptr, (const uint64_t*)forMarshaling->pWaitSemaphoreValues,
+               forMarshaling->waitSemaphoreValuesCount * sizeof(const uint64_t));
+        *ptr += forMarshaling->waitSemaphoreValuesCount * sizeof(const uint64_t);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->signalSemaphoreValuesCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pSignalSemaphoreValues;
+    memcpy((*ptr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pSignalSemaphoreValues) {
+        memcpy(*ptr, (const uint64_t*)forMarshaling->pSignalSemaphoreValues,
+               forMarshaling->signalSemaphoreValuesCount * sizeof(const uint64_t));
+        *ptr += forMarshaling->signalSemaphoreValuesCount * sizeof(const uint64_t);
+    }
+}
+
+void reservedmarshal_VkSemaphoreGetWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSemaphoreGetWin32HandleInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkSemaphore((*&forMarshaling->semaphore));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkExternalSemaphoreHandleTypeFlagBits*)&forMarshaling->handleType,
+           sizeof(VkExternalSemaphoreHandleTypeFlagBits));
+    *ptr += sizeof(VkExternalSemaphoreHandleTypeFlagBits);
+}
+
+#endif
+#ifdef VK_KHR_external_semaphore_fd
+void reservedmarshal_VkImportSemaphoreFdInfoKHR(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkImportSemaphoreFdInfoKHR* forMarshaling,
+                                                uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkSemaphore((*&forMarshaling->semaphore));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkSemaphoreImportFlags*)&forMarshaling->flags, sizeof(VkSemaphoreImportFlags));
+    *ptr += sizeof(VkSemaphoreImportFlags);
+    memcpy(*ptr, (VkExternalSemaphoreHandleTypeFlagBits*)&forMarshaling->handleType,
+           sizeof(VkExternalSemaphoreHandleTypeFlagBits));
+    *ptr += sizeof(VkExternalSemaphoreHandleTypeFlagBits);
+    memcpy(*ptr, (int*)&forMarshaling->fd, sizeof(int));
+    *ptr += sizeof(int);
+}
+
+void reservedmarshal_VkSemaphoreGetFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkSemaphoreGetFdInfoKHR* forMarshaling,
+                                             uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkSemaphore((*&forMarshaling->semaphore));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkExternalSemaphoreHandleTypeFlagBits*)&forMarshaling->handleType,
+           sizeof(VkExternalSemaphoreHandleTypeFlagBits));
+    *ptr += sizeof(VkExternalSemaphoreHandleTypeFlagBits);
+}
+
+#endif
+#ifdef VK_KHR_push_descriptor
+void reservedmarshal_VkPhysicalDevicePushDescriptorPropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePushDescriptorPropertiesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPushDescriptors, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_KHR_shader_float16_int8
+#endif
+#ifdef VK_KHR_16bit_storage
+#endif
+#ifdef VK_KHR_incremental_present
+void reservedmarshal_VkRectLayerKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkRectLayerKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    reservedmarshal_VkOffset2D(vkStream, rootType, (VkOffset2D*)(&forMarshaling->offset), ptr);
+    reservedmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->extent), ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->layer, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkPresentRegionKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkPresentRegionKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->rectangleCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pRectangles;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pRectangles) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->rectangleCount; ++i) {
+            reservedmarshal_VkRectLayerKHR(
+                vkStream, rootType, (const VkRectLayerKHR*)(forMarshaling->pRectangles + i), ptr);
+        }
+    }
+}
+
+void reservedmarshal_VkPresentRegionsKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkPresentRegionsKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->swapchainCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pRegions;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pRegions) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->swapchainCount; ++i) {
+            reservedmarshal_VkPresentRegionKHR(
+                vkStream, rootType, (const VkPresentRegionKHR*)(forMarshaling->pRegions + i), ptr);
+        }
+    }
+}
+
+#endif
+#ifdef VK_KHR_descriptor_update_template
+#endif
+#ifdef VK_KHR_imageless_framebuffer
+#endif
+#ifdef VK_KHR_create_renderpass2
+#endif
+#ifdef VK_KHR_shared_presentable_image
+void reservedmarshal_VkSharedPresentSurfaceCapabilitiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSharedPresentSurfaceCapabilitiesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkImageUsageFlags*)&forMarshaling->sharedPresentSupportedUsageFlags,
+           sizeof(VkImageUsageFlags));
+    *ptr += sizeof(VkImageUsageFlags);
+}
+
+#endif
+#ifdef VK_KHR_external_fence_capabilities
+#endif
+#ifdef VK_KHR_external_fence
+#endif
+#ifdef VK_KHR_external_fence_win32
+void reservedmarshal_VkImportFenceWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportFenceWin32HandleInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkFence((*&forMarshaling->fence));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkFenceImportFlags*)&forMarshaling->flags, sizeof(VkFenceImportFlags));
+    *ptr += sizeof(VkFenceImportFlags);
+    memcpy(*ptr, (VkExternalFenceHandleTypeFlagBits*)&forMarshaling->handleType,
+           sizeof(VkExternalFenceHandleTypeFlagBits));
+    *ptr += sizeof(VkExternalFenceHandleTypeFlagBits);
+    memcpy(*ptr, (HANDLE*)&forMarshaling->handle, sizeof(HANDLE));
+    *ptr += sizeof(HANDLE);
+    memcpy(*ptr, (LPCWSTR*)&forMarshaling->name, sizeof(LPCWSTR));
+    *ptr += sizeof(LPCWSTR);
+}
+
+void reservedmarshal_VkExportFenceWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExportFenceWin32HandleInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pAttributes;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pAttributes) {
+        memcpy(*ptr, (const SECURITY_ATTRIBUTES*)forMarshaling->pAttributes,
+               sizeof(const SECURITY_ATTRIBUTES));
+        *ptr += sizeof(const SECURITY_ATTRIBUTES);
+    }
+    memcpy(*ptr, (DWORD*)&forMarshaling->dwAccess, sizeof(DWORD));
+    *ptr += sizeof(DWORD);
+    memcpy(*ptr, (LPCWSTR*)&forMarshaling->name, sizeof(LPCWSTR));
+    *ptr += sizeof(LPCWSTR);
+}
+
+void reservedmarshal_VkFenceGetWin32HandleInfoKHR(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkFenceGetWin32HandleInfoKHR* forMarshaling,
+                                                  uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkFence((*&forMarshaling->fence));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkExternalFenceHandleTypeFlagBits*)&forMarshaling->handleType,
+           sizeof(VkExternalFenceHandleTypeFlagBits));
+    *ptr += sizeof(VkExternalFenceHandleTypeFlagBits);
+}
+
+#endif
+#ifdef VK_KHR_external_fence_fd
+void reservedmarshal_VkImportFenceFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkImportFenceFdInfoKHR* forMarshaling,
+                                            uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkFence((*&forMarshaling->fence));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkFenceImportFlags*)&forMarshaling->flags, sizeof(VkFenceImportFlags));
+    *ptr += sizeof(VkFenceImportFlags);
+    memcpy(*ptr, (VkExternalFenceHandleTypeFlagBits*)&forMarshaling->handleType,
+           sizeof(VkExternalFenceHandleTypeFlagBits));
+    *ptr += sizeof(VkExternalFenceHandleTypeFlagBits);
+    memcpy(*ptr, (int*)&forMarshaling->fd, sizeof(int));
+    *ptr += sizeof(int);
+}
+
+void reservedmarshal_VkFenceGetFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkFenceGetFdInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkFence((*&forMarshaling->fence));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkExternalFenceHandleTypeFlagBits*)&forMarshaling->handleType,
+           sizeof(VkExternalFenceHandleTypeFlagBits));
+    *ptr += sizeof(VkExternalFenceHandleTypeFlagBits);
+}
+
+#endif
+#ifdef VK_KHR_performance_query
+void reservedmarshal_VkPhysicalDevicePerformanceQueryFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePerformanceQueryFeaturesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->performanceCounterQueryPools, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->performanceCounterMultipleQueryPools, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDevicePerformanceQueryPropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePerformanceQueryPropertiesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->allowCommandBufferQueryCopies, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPerformanceCounterKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkPerformanceCounterKHR* forMarshaling,
+                                             uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPerformanceCounterUnitKHR*)&forMarshaling->unit,
+           sizeof(VkPerformanceCounterUnitKHR));
+    *ptr += sizeof(VkPerformanceCounterUnitKHR);
+    memcpy(*ptr, (VkPerformanceCounterScopeKHR*)&forMarshaling->scope,
+           sizeof(VkPerformanceCounterScopeKHR));
+    *ptr += sizeof(VkPerformanceCounterScopeKHR);
+    memcpy(*ptr, (VkPerformanceCounterStorageKHR*)&forMarshaling->storage,
+           sizeof(VkPerformanceCounterStorageKHR));
+    *ptr += sizeof(VkPerformanceCounterStorageKHR);
+    memcpy(*ptr, (uint8_t*)forMarshaling->uuid, VK_UUID_SIZE * sizeof(uint8_t));
+    *ptr += VK_UUID_SIZE * sizeof(uint8_t);
+}
+
+void reservedmarshal_VkPerformanceCounterDescriptionKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPerformanceCounterDescriptionKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPerformanceCounterDescriptionFlagsKHR*)&forMarshaling->flags,
+           sizeof(VkPerformanceCounterDescriptionFlagsKHR));
+    *ptr += sizeof(VkPerformanceCounterDescriptionFlagsKHR);
+    memcpy(*ptr, (char*)forMarshaling->name, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    *ptr += VK_MAX_DESCRIPTION_SIZE * sizeof(char);
+    memcpy(*ptr, (char*)forMarshaling->category, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    *ptr += VK_MAX_DESCRIPTION_SIZE * sizeof(char);
+    memcpy(*ptr, (char*)forMarshaling->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    *ptr += VK_MAX_DESCRIPTION_SIZE * sizeof(char);
+}
+
+void reservedmarshal_VkQueryPoolPerformanceCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkQueryPoolPerformanceCreateInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->queueFamilyIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->counterIndexCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const uint32_t*)forMarshaling->pCounterIndices,
+           forMarshaling->counterIndexCount * sizeof(const uint32_t));
+    *ptr += forMarshaling->counterIndexCount * sizeof(const uint32_t);
+}
+
+void reservedmarshal_VkPerformanceCounterResultKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPerformanceCounterResultKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (int32_t*)&forMarshaling->int32, sizeof(int32_t));
+    *ptr += sizeof(int32_t);
+}
+
+void reservedmarshal_VkAcquireProfilingLockInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAcquireProfilingLockInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkAcquireProfilingLockFlagsKHR*)&forMarshaling->flags,
+           sizeof(VkAcquireProfilingLockFlagsKHR));
+    *ptr += sizeof(VkAcquireProfilingLockFlagsKHR);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->timeout, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+}
+
+void reservedmarshal_VkPerformanceQuerySubmitInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPerformanceQuerySubmitInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->counterPassIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_KHR_maintenance2
+#endif
+#ifdef VK_KHR_get_surface_capabilities2
+void reservedmarshal_VkPhysicalDeviceSurfaceInfo2KHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSurfaceInfo2KHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkSurfaceKHR((*&forMarshaling->surface));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+}
+
+void reservedmarshal_VkSurfaceCapabilities2KHR(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkSurfaceCapabilities2KHR* forMarshaling,
+                                               uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkSurfaceCapabilitiesKHR(
+        vkStream, rootType, (VkSurfaceCapabilitiesKHR*)(&forMarshaling->surfaceCapabilities), ptr);
+}
+
+void reservedmarshal_VkSurfaceFormat2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkSurfaceFormat2KHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkSurfaceFormatKHR(vkStream, rootType,
+                                       (VkSurfaceFormatKHR*)(&forMarshaling->surfaceFormat), ptr);
+}
+
+#endif
+#ifdef VK_KHR_variable_pointers
+#endif
+#ifdef VK_KHR_get_display_properties2
+void reservedmarshal_VkDisplayProperties2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkDisplayProperties2KHR* forMarshaling,
+                                             uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkDisplayPropertiesKHR(
+        vkStream, rootType, (VkDisplayPropertiesKHR*)(&forMarshaling->displayProperties), ptr);
+}
+
+void reservedmarshal_VkDisplayPlaneProperties2KHR(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkDisplayPlaneProperties2KHR* forMarshaling,
+                                                  uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkDisplayPlanePropertiesKHR(
+        vkStream, rootType, (VkDisplayPlanePropertiesKHR*)(&forMarshaling->displayPlaneProperties),
+        ptr);
+}
+
+void reservedmarshal_VkDisplayModeProperties2KHR(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkDisplayModeProperties2KHR* forMarshaling,
+                                                 uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkDisplayModePropertiesKHR(
+        vkStream, rootType, (VkDisplayModePropertiesKHR*)(&forMarshaling->displayModeProperties),
+        ptr);
+}
+
+void reservedmarshal_VkDisplayPlaneInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkDisplayPlaneInfo2KHR* forMarshaling,
+                                            uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDisplayModeKHR((*&forMarshaling->mode));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->planeIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkDisplayPlaneCapabilities2KHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDisplayPlaneCapabilities2KHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkDisplayPlaneCapabilitiesKHR(
+        vkStream, rootType, (VkDisplayPlaneCapabilitiesKHR*)(&forMarshaling->capabilities), ptr);
+}
+
+#endif
+#ifdef VK_KHR_dedicated_allocation
+#endif
+#ifdef VK_KHR_storage_buffer_storage_class
+#endif
+#ifdef VK_KHR_relaxed_block_layout
+#endif
+#ifdef VK_KHR_get_memory_requirements2
+#endif
+#ifdef VK_KHR_image_format_list
+#endif
+#ifdef VK_KHR_sampler_ycbcr_conversion
+#endif
+#ifdef VK_KHR_bind_memory2
+#endif
+#ifdef VK_KHR_portability_subset
+void reservedmarshal_VkPhysicalDevicePortabilitySubsetFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePortabilitySubsetFeaturesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->constantAlphaColorBlendFactors, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->events, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->imageViewFormatReinterpretation, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->imageViewFormatSwizzle, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->imageView2DOn3DImage, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->multisampleArrayImage, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->mutableComparisonSamplers, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->pointPolygons, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->samplerMipLodBias, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->separateStencilMaskRef, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderSampleRateInterpolationFunctions,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->tessellationIsolines, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->tessellationPointMode, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->triangleFans, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->vertexAttributeAccessBeyondStride, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDevicePortabilitySubsetPropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePortabilitySubsetPropertiesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->minVertexInputBindingStrideAlignment, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_KHR_maintenance3
+#endif
+#ifdef VK_KHR_draw_indirect_count
+#endif
+#ifdef VK_KHR_shader_subgroup_extended_types
+#endif
+#ifdef VK_KHR_8bit_storage
+#endif
+#ifdef VK_KHR_shader_atomic_int64
+#endif
+#ifdef VK_KHR_shader_clock
+void reservedmarshal_VkPhysicalDeviceShaderClockFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderClockFeaturesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderSubgroupClock, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderDeviceClock, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_KHR_driver_properties
+#endif
+#ifdef VK_KHR_shader_float_controls
+#endif
+#ifdef VK_KHR_depth_stencil_resolve
+#endif
+#ifdef VK_KHR_swapchain_mutable_format
+#endif
+#ifdef VK_KHR_timeline_semaphore
+#endif
+#ifdef VK_KHR_vulkan_memory_model
+#endif
+#ifdef VK_KHR_shader_terminate_invocation
+void reservedmarshal_VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderTerminateInvocation, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+void reservedmarshal_VkFragmentShadingRateAttachmentInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkFragmentShadingRateAttachmentInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pFragmentShadingRateAttachment;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pFragmentShadingRateAttachment) {
+        reservedmarshal_VkAttachmentReference2(
+            vkStream, rootType,
+            (const VkAttachmentReference2*)(forMarshaling->pFragmentShadingRateAttachment), ptr);
+    }
+    reservedmarshal_VkExtent2D(vkStream, rootType,
+                               (VkExtent2D*)(&forMarshaling->shadingRateAttachmentTexelSize), ptr);
+}
+
+void reservedmarshal_VkPipelineFragmentShadingRateStateCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineFragmentShadingRateStateCreateInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->fragmentSize),
+                               ptr);
+    memcpy(*ptr, (VkFragmentShadingRateCombinerOpKHR*)forMarshaling->combinerOps,
+           2 * sizeof(VkFragmentShadingRateCombinerOpKHR));
+    *ptr += 2 * sizeof(VkFragmentShadingRateCombinerOpKHR);
+}
+
+void reservedmarshal_VkPhysicalDeviceFragmentShadingRateFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateFeaturesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->pipelineFragmentShadingRate, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->primitiveFragmentShadingRate, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->attachmentFragmentShadingRate, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceFragmentShadingRatePropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRatePropertiesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkExtent2D(
+        vkStream, rootType,
+        (VkExtent2D*)(&forMarshaling->minFragmentShadingRateAttachmentTexelSize), ptr);
+    reservedmarshal_VkExtent2D(
+        vkStream, rootType,
+        (VkExtent2D*)(&forMarshaling->maxFragmentShadingRateAttachmentTexelSize), ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxFragmentShadingRateAttachmentTexelSizeAspectRatio,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->primitiveFragmentShadingRateWithMultipleViewports,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->layeredShadingRateAttachments, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->fragmentShadingRateNonTrivialCombinerOps,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    reservedmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->maxFragmentSize),
+                               ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxFragmentSizeAspectRatio, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxFragmentShadingRateCoverageSamples,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkSampleCountFlagBits*)&forMarshaling->maxFragmentShadingRateRasterizationSamples,
+           sizeof(VkSampleCountFlagBits));
+    *ptr += sizeof(VkSampleCountFlagBits);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->fragmentShadingRateWithShaderDepthStencilWrites,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->fragmentShadingRateWithSampleMask, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->fragmentShadingRateWithShaderSampleMask,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->fragmentShadingRateWithConservativeRasterization,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->fragmentShadingRateWithFragmentShaderInterlock,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->fragmentShadingRateWithCustomSampleLocations,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->fragmentShadingRateStrictMultiplyCombiner,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceFragmentShadingRateKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkSampleCountFlags*)&forMarshaling->sampleCounts, sizeof(VkSampleCountFlags));
+    *ptr += sizeof(VkSampleCountFlags);
+    reservedmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->fragmentSize),
+                               ptr);
+}
+
+#endif
+#ifdef VK_KHR_spirv_1_4
+#endif
+#ifdef VK_KHR_surface_protected_capabilities
+void reservedmarshal_VkSurfaceProtectedCapabilitiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSurfaceProtectedCapabilitiesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->supportsProtected, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_KHR_separate_depth_stencil_layouts
+#endif
+#ifdef VK_KHR_present_wait
+void reservedmarshal_VkPhysicalDevicePresentWaitFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePresentWaitFeaturesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->presentWait, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_KHR_uniform_buffer_standard_layout
+#endif
+#ifdef VK_KHR_buffer_device_address
+#endif
+#ifdef VK_KHR_deferred_host_operations
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+void reservedmarshal_VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->pipelineExecutableInfo, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPipelineInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkPipelineInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPipeline((*&forMarshaling->pipeline));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+}
+
+void reservedmarshal_VkPipelineExecutablePropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineExecutablePropertiesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkShaderStageFlags*)&forMarshaling->stages, sizeof(VkShaderStageFlags));
+    *ptr += sizeof(VkShaderStageFlags);
+    memcpy(*ptr, (char*)forMarshaling->name, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    *ptr += VK_MAX_DESCRIPTION_SIZE * sizeof(char);
+    memcpy(*ptr, (char*)forMarshaling->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    *ptr += VK_MAX_DESCRIPTION_SIZE * sizeof(char);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->subgroupSize, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkPipelineExecutableInfoKHR(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkPipelineExecutableInfoKHR* forMarshaling,
+                                                 uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPipeline((*&forMarshaling->pipeline));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->executableIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkPipelineExecutableStatisticValueKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineExecutableStatisticValueKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkBool32*)&forMarshaling->b32, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPipelineExecutableStatisticKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineExecutableStatisticKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (char*)forMarshaling->name, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    *ptr += VK_MAX_DESCRIPTION_SIZE * sizeof(char);
+    memcpy(*ptr, (char*)forMarshaling->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    *ptr += VK_MAX_DESCRIPTION_SIZE * sizeof(char);
+    memcpy(*ptr, (VkPipelineExecutableStatisticFormatKHR*)&forMarshaling->format,
+           sizeof(VkPipelineExecutableStatisticFormatKHR));
+    *ptr += sizeof(VkPipelineExecutableStatisticFormatKHR);
+    reservedmarshal_VkPipelineExecutableStatisticValueKHR(
+        vkStream, rootType, (VkPipelineExecutableStatisticValueKHR*)(&forMarshaling->value), ptr);
+}
+
+void reservedmarshal_VkPipelineExecutableInternalRepresentationKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineExecutableInternalRepresentationKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (char*)forMarshaling->name, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    *ptr += VK_MAX_DESCRIPTION_SIZE * sizeof(char);
+    memcpy(*ptr, (char*)forMarshaling->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    *ptr += VK_MAX_DESCRIPTION_SIZE * sizeof(char);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->isText, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->dataSize;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pData;
+    memcpy((*ptr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pData) {
+        memcpy(*ptr, (void*)forMarshaling->pData, forMarshaling->dataSize * sizeof(uint8_t));
+        *ptr += forMarshaling->dataSize * sizeof(uint8_t);
+    }
+}
+
+#endif
+#ifdef VK_KHR_shader_integer_dot_product
+void reservedmarshal_VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderIntegerDotProduct, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->integerDotProduct8BitUnsignedAccelerated,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->integerDotProduct8BitSignedAccelerated,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->integerDotProduct8BitMixedSignednessAccelerated,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->integerDotProduct4x8BitPackedUnsignedAccelerated,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->integerDotProduct4x8BitPackedSignedAccelerated,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->integerDotProduct4x8BitPackedMixedSignednessAccelerated,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->integerDotProduct16BitUnsignedAccelerated,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->integerDotProduct16BitSignedAccelerated,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->integerDotProduct16BitMixedSignednessAccelerated,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->integerDotProduct32BitUnsignedAccelerated,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->integerDotProduct32BitSignedAccelerated,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->integerDotProduct32BitMixedSignednessAccelerated,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->integerDotProduct64BitUnsignedAccelerated,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->integerDotProduct64BitSignedAccelerated,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->integerDotProduct64BitMixedSignednessAccelerated,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(
+        *ptr,
+        (VkBool32*)&forMarshaling->integerDotProductAccumulatingSaturating8BitUnsignedAccelerated,
+        sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr,
+           (VkBool32*)&forMarshaling->integerDotProductAccumulatingSaturating8BitSignedAccelerated,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr,
+           (VkBool32*)&forMarshaling
+               ->integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr,
+           (VkBool32*)&forMarshaling
+               ->integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr,
+           (VkBool32*)&forMarshaling
+               ->integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr,
+           (VkBool32*)&forMarshaling
+               ->integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(
+        *ptr,
+        (VkBool32*)&forMarshaling->integerDotProductAccumulatingSaturating16BitUnsignedAccelerated,
+        sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr,
+           (VkBool32*)&forMarshaling->integerDotProductAccumulatingSaturating16BitSignedAccelerated,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr,
+           (VkBool32*)&forMarshaling
+               ->integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(
+        *ptr,
+        (VkBool32*)&forMarshaling->integerDotProductAccumulatingSaturating32BitUnsignedAccelerated,
+        sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr,
+           (VkBool32*)&forMarshaling->integerDotProductAccumulatingSaturating32BitSignedAccelerated,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr,
+           (VkBool32*)&forMarshaling
+               ->integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(
+        *ptr,
+        (VkBool32*)&forMarshaling->integerDotProductAccumulatingSaturating64BitUnsignedAccelerated,
+        sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr,
+           (VkBool32*)&forMarshaling->integerDotProductAccumulatingSaturating64BitSignedAccelerated,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr,
+           (VkBool32*)&forMarshaling
+               ->integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_KHR_pipeline_library
+void reservedmarshal_VkPipelineLibraryCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineLibraryCreateInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->libraryCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    if (forMarshaling->libraryCount) {
+        uint8_t* cgen_var_0_ptr = (uint8_t*)(*ptr);
+        if (forMarshaling) {
+            for (uint32_t k = 0; k < forMarshaling->libraryCount; ++k) {
+                uint64_t tmpval = get_host_u64_VkPipeline(forMarshaling->pLibraries[k]);
+                memcpy(cgen_var_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+            }
+        }
+        *ptr += 8 * forMarshaling->libraryCount;
+    }
+}
+
+#endif
+#ifdef VK_KHR_shader_non_semantic_info
+#endif
+#ifdef VK_KHR_present_id
+void reservedmarshal_VkPresentIdKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkPresentIdKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->swapchainCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pPresentIds;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pPresentIds) {
+        memcpy(*ptr, (const uint64_t*)forMarshaling->pPresentIds,
+               forMarshaling->swapchainCount * sizeof(const uint64_t));
+        *ptr += forMarshaling->swapchainCount * sizeof(const uint64_t);
+    }
+}
+
+void reservedmarshal_VkPhysicalDevicePresentIdFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePresentIdFeaturesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->presentId, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_KHR_video_encode_queue
+void reservedmarshal_VkVideoEncodeInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkVideoEncodeInfoKHR* forMarshaling,
+                                          uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkVideoEncodeFlagsKHR*)&forMarshaling->flags, sizeof(VkVideoEncodeFlagsKHR));
+    *ptr += sizeof(VkVideoEncodeFlagsKHR);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->qualityLevel, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    reservedmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->codedExtent), ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&forMarshaling->dstBitstreamBuffer));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->dstBitstreamBufferOffset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->dstBitstreamBufferMaxRange, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    reservedmarshal_VkVideoPictureResourceKHR(
+        vkStream, rootType, (VkVideoPictureResourceKHR*)(&forMarshaling->srcPictureResource), ptr);
+    reservedmarshal_VkVideoReferenceSlotKHR(
+        vkStream, rootType, (const VkVideoReferenceSlotKHR*)(forMarshaling->pSetupReferenceSlot),
+        ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->referenceSlotCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->referenceSlotCount; ++i) {
+        reservedmarshal_VkVideoReferenceSlotKHR(
+            vkStream, rootType,
+            (const VkVideoReferenceSlotKHR*)(forMarshaling->pReferenceSlots + i), ptr);
+    }
+}
+
+void reservedmarshal_VkVideoEncodeRateControlInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeRateControlInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkVideoEncodeRateControlFlagsKHR*)&forMarshaling->flags,
+           sizeof(VkVideoEncodeRateControlFlagsKHR));
+    *ptr += sizeof(VkVideoEncodeRateControlFlagsKHR);
+    memcpy(*ptr, (VkVideoEncodeRateControlModeFlagBitsKHR*)&forMarshaling->rateControlMode,
+           sizeof(VkVideoEncodeRateControlModeFlagBitsKHR));
+    *ptr += sizeof(VkVideoEncodeRateControlModeFlagBitsKHR);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->averageBitrate, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint16_t*)&forMarshaling->peakToAverageBitrateRatio, sizeof(uint16_t));
+    *ptr += sizeof(uint16_t);
+    memcpy(*ptr, (uint16_t*)&forMarshaling->frameRateNumerator, sizeof(uint16_t));
+    *ptr += sizeof(uint16_t);
+    memcpy(*ptr, (uint16_t*)&forMarshaling->frameRateDenominator, sizeof(uint16_t));
+    *ptr += sizeof(uint16_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->virtualBufferSizeInMs, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_KHR_synchronization2
+void reservedmarshal_VkMemoryBarrier2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkMemoryBarrier2KHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineStageFlags2KHR*)&forMarshaling->srcStageMask,
+           sizeof(VkPipelineStageFlags2KHR));
+    *ptr += sizeof(VkPipelineStageFlags2KHR);
+    memcpy(*ptr, (VkAccessFlags2KHR*)&forMarshaling->srcAccessMask, sizeof(VkAccessFlags2KHR));
+    *ptr += sizeof(VkAccessFlags2KHR);
+    memcpy(*ptr, (VkPipelineStageFlags2KHR*)&forMarshaling->dstStageMask,
+           sizeof(VkPipelineStageFlags2KHR));
+    *ptr += sizeof(VkPipelineStageFlags2KHR);
+    memcpy(*ptr, (VkAccessFlags2KHR*)&forMarshaling->dstAccessMask, sizeof(VkAccessFlags2KHR));
+    *ptr += sizeof(VkAccessFlags2KHR);
+}
+
+void reservedmarshal_VkBufferMemoryBarrier2KHR(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkBufferMemoryBarrier2KHR* forMarshaling,
+                                               uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineStageFlags2KHR*)&forMarshaling->srcStageMask,
+           sizeof(VkPipelineStageFlags2KHR));
+    *ptr += sizeof(VkPipelineStageFlags2KHR);
+    memcpy(*ptr, (VkAccessFlags2KHR*)&forMarshaling->srcAccessMask, sizeof(VkAccessFlags2KHR));
+    *ptr += sizeof(VkAccessFlags2KHR);
+    memcpy(*ptr, (VkPipelineStageFlags2KHR*)&forMarshaling->dstStageMask,
+           sizeof(VkPipelineStageFlags2KHR));
+    *ptr += sizeof(VkPipelineStageFlags2KHR);
+    memcpy(*ptr, (VkAccessFlags2KHR*)&forMarshaling->dstAccessMask, sizeof(VkAccessFlags2KHR));
+    *ptr += sizeof(VkAccessFlags2KHR);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->srcQueueFamilyIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->dstQueueFamilyIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&forMarshaling->buffer));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->offset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+}
+
+void reservedmarshal_VkImageMemoryBarrier2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkImageMemoryBarrier2KHR* forMarshaling,
+                                              uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineStageFlags2KHR*)&forMarshaling->srcStageMask,
+           sizeof(VkPipelineStageFlags2KHR));
+    *ptr += sizeof(VkPipelineStageFlags2KHR);
+    memcpy(*ptr, (VkAccessFlags2KHR*)&forMarshaling->srcAccessMask, sizeof(VkAccessFlags2KHR));
+    *ptr += sizeof(VkAccessFlags2KHR);
+    memcpy(*ptr, (VkPipelineStageFlags2KHR*)&forMarshaling->dstStageMask,
+           sizeof(VkPipelineStageFlags2KHR));
+    *ptr += sizeof(VkPipelineStageFlags2KHR);
+    memcpy(*ptr, (VkAccessFlags2KHR*)&forMarshaling->dstAccessMask, sizeof(VkAccessFlags2KHR));
+    *ptr += sizeof(VkAccessFlags2KHR);
+    memcpy(*ptr, (VkImageLayout*)&forMarshaling->oldLayout, sizeof(VkImageLayout));
+    *ptr += sizeof(VkImageLayout);
+    memcpy(*ptr, (VkImageLayout*)&forMarshaling->newLayout, sizeof(VkImageLayout));
+    *ptr += sizeof(VkImageLayout);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->srcQueueFamilyIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->dstQueueFamilyIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImage((*&forMarshaling->image));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    reservedmarshal_VkImageSubresourceRange(
+        vkStream, rootType, (VkImageSubresourceRange*)(&forMarshaling->subresourceRange), ptr);
+}
+
+void reservedmarshal_VkDependencyInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkDependencyInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDependencyFlags*)&forMarshaling->dependencyFlags, sizeof(VkDependencyFlags));
+    *ptr += sizeof(VkDependencyFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->memoryBarrierCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->memoryBarrierCount; ++i) {
+        reservedmarshal_VkMemoryBarrier2KHR(
+            vkStream, rootType, (const VkMemoryBarrier2KHR*)(forMarshaling->pMemoryBarriers + i),
+            ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->bufferMemoryBarrierCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->bufferMemoryBarrierCount; ++i) {
+        reservedmarshal_VkBufferMemoryBarrier2KHR(
+            vkStream, rootType,
+            (const VkBufferMemoryBarrier2KHR*)(forMarshaling->pBufferMemoryBarriers + i), ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->imageMemoryBarrierCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->imageMemoryBarrierCount; ++i) {
+        reservedmarshal_VkImageMemoryBarrier2KHR(
+            vkStream, rootType,
+            (const VkImageMemoryBarrier2KHR*)(forMarshaling->pImageMemoryBarriers + i), ptr);
+    }
+}
+
+void reservedmarshal_VkSemaphoreSubmitInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkSemaphoreSubmitInfoKHR* forMarshaling,
+                                              uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkSemaphore((*&forMarshaling->semaphore));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (uint64_t*)&forMarshaling->value, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+    memcpy(*ptr, (VkPipelineStageFlags2KHR*)&forMarshaling->stageMask,
+           sizeof(VkPipelineStageFlags2KHR));
+    *ptr += sizeof(VkPipelineStageFlags2KHR);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->deviceIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkCommandBufferSubmitInfoKHR(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkCommandBufferSubmitInfoKHR* forMarshaling,
+                                                  uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkCommandBuffer((*&forMarshaling->commandBuffer));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->deviceMask, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkSubmitInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkSubmitInfo2KHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkSubmitFlagsKHR*)&forMarshaling->flags, sizeof(VkSubmitFlagsKHR));
+    *ptr += sizeof(VkSubmitFlagsKHR);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->waitSemaphoreInfoCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->waitSemaphoreInfoCount; ++i) {
+        reservedmarshal_VkSemaphoreSubmitInfoKHR(
+            vkStream, rootType,
+            (const VkSemaphoreSubmitInfoKHR*)(forMarshaling->pWaitSemaphoreInfos + i), ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->commandBufferInfoCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->commandBufferInfoCount; ++i) {
+        reservedmarshal_VkCommandBufferSubmitInfoKHR(
+            vkStream, rootType,
+            (const VkCommandBufferSubmitInfoKHR*)(forMarshaling->pCommandBufferInfos + i), ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->signalSemaphoreInfoCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->signalSemaphoreInfoCount; ++i) {
+        reservedmarshal_VkSemaphoreSubmitInfoKHR(
+            vkStream, rootType,
+            (const VkSemaphoreSubmitInfoKHR*)(forMarshaling->pSignalSemaphoreInfos + i), ptr);
+    }
+}
+
+void reservedmarshal_VkPhysicalDeviceSynchronization2FeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSynchronization2FeaturesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->synchronization2, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkQueueFamilyCheckpointProperties2NV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkQueueFamilyCheckpointProperties2NV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineStageFlags2KHR*)&forMarshaling->checkpointExecutionStageMask,
+           sizeof(VkPipelineStageFlags2KHR));
+    *ptr += sizeof(VkPipelineStageFlags2KHR);
+}
+
+void reservedmarshal_VkCheckpointData2NV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkCheckpointData2NV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineStageFlags2KHR*)&forMarshaling->stage,
+           sizeof(VkPipelineStageFlags2KHR));
+    *ptr += sizeof(VkPipelineStageFlags2KHR);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pCheckpointMarker;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pCheckpointMarker) {
+        memcpy(*ptr, (void*)forMarshaling->pCheckpointMarker, sizeof(uint8_t));
+        *ptr += sizeof(uint8_t);
+    }
+}
+
+#endif
+#ifdef VK_KHR_shader_subgroup_uniform_control_flow
+void reservedmarshal_VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR* forMarshaling,
+    uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderSubgroupUniformControlFlow, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_KHR_zero_initialize_workgroup_memory
+void reservedmarshal_VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderZeroInitializeWorkgroupMemory, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_KHR_workgroup_memory_explicit_layout
+void reservedmarshal_VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->workgroupMemoryExplicitLayout, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->workgroupMemoryExplicitLayoutScalarBlockLayout,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->workgroupMemoryExplicitLayout8BitAccess,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->workgroupMemoryExplicitLayout16BitAccess,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_KHR_copy_commands2
+void reservedmarshal_VkBufferCopy2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkBufferCopy2KHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->srcOffset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->dstOffset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+}
+
+void reservedmarshal_VkCopyBufferInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkCopyBufferInfo2KHR* forMarshaling,
+                                          uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&forMarshaling->srcBuffer));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkBuffer((*&forMarshaling->dstBuffer));
+    memcpy(*ptr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->regionCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->regionCount; ++i) {
+        reservedmarshal_VkBufferCopy2KHR(
+            vkStream, rootType, (const VkBufferCopy2KHR*)(forMarshaling->pRegions + i), ptr);
+    }
+}
+
+void reservedmarshal_VkImageCopy2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkImageCopy2KHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkImageSubresourceLayers(
+        vkStream, rootType, (VkImageSubresourceLayers*)(&forMarshaling->srcSubresource), ptr);
+    reservedmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forMarshaling->srcOffset), ptr);
+    reservedmarshal_VkImageSubresourceLayers(
+        vkStream, rootType, (VkImageSubresourceLayers*)(&forMarshaling->dstSubresource), ptr);
+    reservedmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forMarshaling->dstOffset), ptr);
+    reservedmarshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forMarshaling->extent), ptr);
+}
+
+void reservedmarshal_VkCopyImageInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkCopyImageInfo2KHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImage((*&forMarshaling->srcImage));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkImageLayout*)&forMarshaling->srcImageLayout, sizeof(VkImageLayout));
+    *ptr += sizeof(VkImageLayout);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkImage((*&forMarshaling->dstImage));
+    memcpy(*ptr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkImageLayout*)&forMarshaling->dstImageLayout, sizeof(VkImageLayout));
+    *ptr += sizeof(VkImageLayout);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->regionCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->regionCount; ++i) {
+        reservedmarshal_VkImageCopy2KHR(vkStream, rootType,
+                                        (const VkImageCopy2KHR*)(forMarshaling->pRegions + i), ptr);
+    }
+}
+
+void reservedmarshal_VkBufferImageCopy2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkBufferImageCopy2KHR* forMarshaling,
+                                           uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->bufferOffset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->bufferRowLength, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->bufferImageHeight, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    reservedmarshal_VkImageSubresourceLayers(
+        vkStream, rootType, (VkImageSubresourceLayers*)(&forMarshaling->imageSubresource), ptr);
+    reservedmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forMarshaling->imageOffset), ptr);
+    reservedmarshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forMarshaling->imageExtent), ptr);
+}
+
+void reservedmarshal_VkCopyBufferToImageInfo2KHR(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkCopyBufferToImageInfo2KHR* forMarshaling,
+                                                 uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&forMarshaling->srcBuffer));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkImage((*&forMarshaling->dstImage));
+    memcpy(*ptr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkImageLayout*)&forMarshaling->dstImageLayout, sizeof(VkImageLayout));
+    *ptr += sizeof(VkImageLayout);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->regionCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->regionCount; ++i) {
+        reservedmarshal_VkBufferImageCopy2KHR(
+            vkStream, rootType, (const VkBufferImageCopy2KHR*)(forMarshaling->pRegions + i), ptr);
+    }
+}
+
+void reservedmarshal_VkCopyImageToBufferInfo2KHR(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkCopyImageToBufferInfo2KHR* forMarshaling,
+                                                 uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImage((*&forMarshaling->srcImage));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkImageLayout*)&forMarshaling->srcImageLayout, sizeof(VkImageLayout));
+    *ptr += sizeof(VkImageLayout);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkBuffer((*&forMarshaling->dstBuffer));
+    memcpy(*ptr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->regionCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->regionCount; ++i) {
+        reservedmarshal_VkBufferImageCopy2KHR(
+            vkStream, rootType, (const VkBufferImageCopy2KHR*)(forMarshaling->pRegions + i), ptr);
+    }
+}
+
+void reservedmarshal_VkImageBlit2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkImageBlit2KHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkImageSubresourceLayers(
+        vkStream, rootType, (VkImageSubresourceLayers*)(&forMarshaling->srcSubresource), ptr);
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        reservedmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(forMarshaling->srcOffsets + i),
+                                   ptr);
+    }
+    reservedmarshal_VkImageSubresourceLayers(
+        vkStream, rootType, (VkImageSubresourceLayers*)(&forMarshaling->dstSubresource), ptr);
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        reservedmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(forMarshaling->dstOffsets + i),
+                                   ptr);
+    }
+}
+
+void reservedmarshal_VkBlitImageInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkBlitImageInfo2KHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImage((*&forMarshaling->srcImage));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkImageLayout*)&forMarshaling->srcImageLayout, sizeof(VkImageLayout));
+    *ptr += sizeof(VkImageLayout);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkImage((*&forMarshaling->dstImage));
+    memcpy(*ptr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkImageLayout*)&forMarshaling->dstImageLayout, sizeof(VkImageLayout));
+    *ptr += sizeof(VkImageLayout);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->regionCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->regionCount; ++i) {
+        reservedmarshal_VkImageBlit2KHR(vkStream, rootType,
+                                        (const VkImageBlit2KHR*)(forMarshaling->pRegions + i), ptr);
+    }
+    memcpy(*ptr, (VkFilter*)&forMarshaling->filter, sizeof(VkFilter));
+    *ptr += sizeof(VkFilter);
+}
+
+void reservedmarshal_VkImageResolve2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkImageResolve2KHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkImageSubresourceLayers(
+        vkStream, rootType, (VkImageSubresourceLayers*)(&forMarshaling->srcSubresource), ptr);
+    reservedmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forMarshaling->srcOffset), ptr);
+    reservedmarshal_VkImageSubresourceLayers(
+        vkStream, rootType, (VkImageSubresourceLayers*)(&forMarshaling->dstSubresource), ptr);
+    reservedmarshal_VkOffset3D(vkStream, rootType, (VkOffset3D*)(&forMarshaling->dstOffset), ptr);
+    reservedmarshal_VkExtent3D(vkStream, rootType, (VkExtent3D*)(&forMarshaling->extent), ptr);
+}
+
+void reservedmarshal_VkResolveImageInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkResolveImageInfo2KHR* forMarshaling,
+                                            uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImage((*&forMarshaling->srcImage));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkImageLayout*)&forMarshaling->srcImageLayout, sizeof(VkImageLayout));
+    *ptr += sizeof(VkImageLayout);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkImage((*&forMarshaling->dstImage));
+    memcpy(*ptr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkImageLayout*)&forMarshaling->dstImageLayout, sizeof(VkImageLayout));
+    *ptr += sizeof(VkImageLayout);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->regionCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->regionCount; ++i) {
+        reservedmarshal_VkImageResolve2KHR(
+            vkStream, rootType, (const VkImageResolve2KHR*)(forMarshaling->pRegions + i), ptr);
+    }
+}
+
+#endif
+#ifdef VK_KHR_format_feature_flags2
+void reservedmarshal_VkFormatProperties3KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkFormatProperties3KHR* forMarshaling,
+                                            uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkFormatFeatureFlags2KHR*)&forMarshaling->linearTilingFeatures,
+           sizeof(VkFormatFeatureFlags2KHR));
+    *ptr += sizeof(VkFormatFeatureFlags2KHR);
+    memcpy(*ptr, (VkFormatFeatureFlags2KHR*)&forMarshaling->optimalTilingFeatures,
+           sizeof(VkFormatFeatureFlags2KHR));
+    *ptr += sizeof(VkFormatFeatureFlags2KHR);
+    memcpy(*ptr, (VkFormatFeatureFlags2KHR*)&forMarshaling->bufferFeatures,
+           sizeof(VkFormatFeatureFlags2KHR));
+    *ptr += sizeof(VkFormatFeatureFlags2KHR);
+}
+
+#endif
+#ifdef VK_KHR_maintenance4
+void reservedmarshal_VkPhysicalDeviceMaintenance4FeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMaintenance4FeaturesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->maintenance4, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceMaintenance4PropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMaintenance4PropertiesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->maxBufferSize, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+}
+
+void reservedmarshal_VkDeviceBufferMemoryRequirementsKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceBufferMemoryRequirementsKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkBufferCreateInfo(
+        vkStream, rootType, (const VkBufferCreateInfo*)(forMarshaling->pCreateInfo), ptr);
+}
+
+void reservedmarshal_VkDeviceImageMemoryRequirementsKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceImageMemoryRequirementsKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkImageCreateInfo(vkStream, rootType,
+                                      (const VkImageCreateInfo*)(forMarshaling->pCreateInfo), ptr);
+    memcpy(*ptr, (VkImageAspectFlagBits*)&forMarshaling->planeAspect,
+           sizeof(VkImageAspectFlagBits));
+    *ptr += sizeof(VkImageAspectFlagBits);
+}
+
+#endif
+#ifdef VK_ANDROID_native_buffer
+void reservedmarshal_VkNativeBufferANDROID(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkNativeBufferANDROID* forMarshaling,
+                                           uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->handle;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->handle) {
+        memcpy(*ptr, (const uint32_t*)forMarshaling->handle, sizeof(const uint32_t));
+        *ptr += sizeof(const uint32_t);
+    }
+    memcpy(*ptr, (int*)&forMarshaling->stride, sizeof(int));
+    *ptr += sizeof(int);
+    memcpy(*ptr, (int*)&forMarshaling->format, sizeof(int));
+    *ptr += sizeof(int);
+    memcpy(*ptr, (int*)&forMarshaling->usage, sizeof(int));
+    *ptr += sizeof(int);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->consumer, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->producer, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+}
+
+#endif
+#ifdef VK_EXT_debug_report
+void reservedmarshal_VkDebugReportCallbackCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDebugReportCallbackCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDebugReportFlagsEXT*)&forMarshaling->flags, sizeof(VkDebugReportFlagsEXT));
+    *ptr += sizeof(VkDebugReportFlagsEXT);
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->pfnCallback;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pUserData;
+    memcpy((*ptr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pUserData) {
+        memcpy(*ptr, (void*)forMarshaling->pUserData, sizeof(uint8_t));
+        *ptr += sizeof(uint8_t);
+    }
+}
+
+#endif
+#ifdef VK_NV_glsl_shader
+#endif
+#ifdef VK_EXT_depth_range_unrestricted
+#endif
+#ifdef VK_IMG_filter_cubic
+#endif
+#ifdef VK_AMD_rasterization_order
+void reservedmarshal_VkPipelineRasterizationStateRasterizationOrderAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRasterizationStateRasterizationOrderAMD* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkRasterizationOrderAMD*)&forMarshaling->rasterizationOrder,
+           sizeof(VkRasterizationOrderAMD));
+    *ptr += sizeof(VkRasterizationOrderAMD);
+}
+
+#endif
+#ifdef VK_AMD_shader_trinary_minmax
+#endif
+#ifdef VK_AMD_shader_explicit_vertex_parameter
+#endif
+#ifdef VK_EXT_debug_marker
+void reservedmarshal_VkDebugMarkerObjectNameInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDebugMarkerObjectNameInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDebugReportObjectTypeEXT*)&forMarshaling->objectType,
+           sizeof(VkDebugReportObjectTypeEXT));
+    *ptr += sizeof(VkDebugReportObjectTypeEXT);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->object, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+    {
+        uint32_t l = forMarshaling->pObjectName ? strlen(forMarshaling->pObjectName) : 0;
+        memcpy(*ptr, (uint32_t*)&l, sizeof(uint32_t));
+        android::base::Stream::toBe32((uint8_t*)*ptr);
+        *ptr += sizeof(uint32_t);
+        memcpy(*ptr, (char*)forMarshaling->pObjectName, l);
+        *ptr += l;
+    }
+}
+
+void reservedmarshal_VkDebugMarkerObjectTagInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDebugMarkerObjectTagInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDebugReportObjectTypeEXT*)&forMarshaling->objectType,
+           sizeof(VkDebugReportObjectTypeEXT));
+    *ptr += sizeof(VkDebugReportObjectTypeEXT);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->object, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->tagName, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->tagSize;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    memcpy(*ptr, (const void*)forMarshaling->pTag, forMarshaling->tagSize * sizeof(const uint8_t));
+    *ptr += forMarshaling->tagSize * sizeof(const uint8_t);
+}
+
+void reservedmarshal_VkDebugMarkerMarkerInfoEXT(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkDebugMarkerMarkerInfoEXT* forMarshaling,
+                                                uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    {
+        uint32_t l = forMarshaling->pMarkerName ? strlen(forMarshaling->pMarkerName) : 0;
+        memcpy(*ptr, (uint32_t*)&l, sizeof(uint32_t));
+        android::base::Stream::toBe32((uint8_t*)*ptr);
+        *ptr += sizeof(uint32_t);
+        memcpy(*ptr, (char*)forMarshaling->pMarkerName, l);
+        *ptr += l;
+    }
+    memcpy(*ptr, (float*)forMarshaling->color, 4 * sizeof(float));
+    *ptr += 4 * sizeof(float);
+}
+
+#endif
+#ifdef VK_AMD_gcn_shader
+#endif
+#ifdef VK_NV_dedicated_allocation
+void reservedmarshal_VkDedicatedAllocationImageCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDedicatedAllocationImageCreateInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->dedicatedAllocation, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkDedicatedAllocationBufferCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDedicatedAllocationBufferCreateInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->dedicatedAllocation, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkDedicatedAllocationMemoryAllocateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDedicatedAllocationMemoryAllocateInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImage((*&forMarshaling->image));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkBuffer((*&forMarshaling->buffer));
+    memcpy(*ptr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *ptr += 1 * 8;
+}
+
+#endif
+#ifdef VK_EXT_transform_feedback
+void reservedmarshal_VkPhysicalDeviceTransformFeedbackFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceTransformFeedbackFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->transformFeedback, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->geometryStreams, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceTransformFeedbackPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceTransformFeedbackPropertiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxTransformFeedbackStreams, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxTransformFeedbackBuffers, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->maxTransformFeedbackBufferSize,
+           sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxTransformFeedbackStreamDataSize, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxTransformFeedbackBufferDataSize, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxTransformFeedbackBufferDataStride, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->transformFeedbackQueries, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->transformFeedbackStreamsLinesTriangles,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->transformFeedbackRasterizationStreamSelect,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->transformFeedbackDraw, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPipelineRasterizationStateStreamCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRasterizationStateStreamCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineRasterizationStateStreamCreateFlagsEXT*)&forMarshaling->flags,
+           sizeof(VkPipelineRasterizationStateStreamCreateFlagsEXT));
+    *ptr += sizeof(VkPipelineRasterizationStateStreamCreateFlagsEXT);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->rasterizationStream, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_NVX_binary_import
+void reservedmarshal_VkCuModuleCreateInfoNVX(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkCuModuleCreateInfoNVX* forMarshaling,
+                                             uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->dataSize;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    memcpy(*ptr, (const void*)forMarshaling->pData,
+           forMarshaling->dataSize * sizeof(const uint8_t));
+    *ptr += forMarshaling->dataSize * sizeof(const uint8_t);
+}
+
+void reservedmarshal_VkCuFunctionCreateInfoNVX(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkCuFunctionCreateInfoNVX* forMarshaling,
+                                               uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->module;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    {
+        uint32_t l = forMarshaling->pName ? strlen(forMarshaling->pName) : 0;
+        memcpy(*ptr, (uint32_t*)&l, sizeof(uint32_t));
+        android::base::Stream::toBe32((uint8_t*)*ptr);
+        *ptr += sizeof(uint32_t);
+        memcpy(*ptr, (char*)forMarshaling->pName, l);
+        *ptr += l;
+    }
+}
+
+void reservedmarshal_VkCuLaunchInfoNVX(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkCuLaunchInfoNVX* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->function;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->gridDimX, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->gridDimY, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->gridDimZ, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->blockDimX, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->blockDimY, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->blockDimZ, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->sharedMemBytes, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    uint64_t cgen_var_1 = (uint64_t)forMarshaling->paramCount;
+    memcpy((*ptr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    uint64_t cgen_var_2 = (uint64_t)forMarshaling->extraCount;
+    memcpy((*ptr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+}
+
+#endif
+#ifdef VK_NVX_image_view_handle
+void reservedmarshal_VkImageViewHandleInfoNVX(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkImageViewHandleInfoNVX* forMarshaling,
+                                              uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkImageView((*&forMarshaling->imageView));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkDescriptorType*)&forMarshaling->descriptorType, sizeof(VkDescriptorType));
+    *ptr += sizeof(VkDescriptorType);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkSampler((*&forMarshaling->sampler));
+    memcpy(*ptr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *ptr += 1 * 8;
+}
+
+void reservedmarshal_VkImageViewAddressPropertiesNVX(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageViewAddressPropertiesNVX* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDeviceAddress*)&forMarshaling->deviceAddress, sizeof(VkDeviceAddress));
+    *ptr += sizeof(VkDeviceAddress);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+}
+
+#endif
+#ifdef VK_AMD_draw_indirect_count
+#endif
+#ifdef VK_AMD_negative_viewport_height
+#endif
+#ifdef VK_AMD_gpu_shader_half_float
+#endif
+#ifdef VK_AMD_shader_ballot
+#endif
+#ifdef VK_EXT_video_encode_h264
+void reservedmarshal_VkVideoEncodeH264CapabilitiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH264CapabilitiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkVideoEncodeH264CapabilityFlagsEXT*)&forMarshaling->flags,
+           sizeof(VkVideoEncodeH264CapabilityFlagsEXT));
+    *ptr += sizeof(VkVideoEncodeH264CapabilityFlagsEXT);
+    memcpy(*ptr, (VkVideoEncodeH264InputModeFlagsEXT*)&forMarshaling->inputModeFlags,
+           sizeof(VkVideoEncodeH264InputModeFlagsEXT));
+    *ptr += sizeof(VkVideoEncodeH264InputModeFlagsEXT);
+    memcpy(*ptr, (VkVideoEncodeH264OutputModeFlagsEXT*)&forMarshaling->outputModeFlags,
+           sizeof(VkVideoEncodeH264OutputModeFlagsEXT));
+    *ptr += sizeof(VkVideoEncodeH264OutputModeFlagsEXT);
+    reservedmarshal_VkExtent2D(vkStream, rootType,
+                               (VkExtent2D*)(&forMarshaling->minPictureSizeInMbs), ptr);
+    reservedmarshal_VkExtent2D(vkStream, rootType,
+                               (VkExtent2D*)(&forMarshaling->maxPictureSizeInMbs), ptr);
+    reservedmarshal_VkExtent2D(vkStream, rootType,
+                               (VkExtent2D*)(&forMarshaling->inputImageDataAlignment), ptr);
+    memcpy(*ptr, (uint8_t*)&forMarshaling->maxNumL0ReferenceForP, sizeof(uint8_t));
+    *ptr += sizeof(uint8_t);
+    memcpy(*ptr, (uint8_t*)&forMarshaling->maxNumL0ReferenceForB, sizeof(uint8_t));
+    *ptr += sizeof(uint8_t);
+    memcpy(*ptr, (uint8_t*)&forMarshaling->maxNumL1Reference, sizeof(uint8_t));
+    *ptr += sizeof(uint8_t);
+    memcpy(*ptr, (uint8_t*)&forMarshaling->qualityLevelCount, sizeof(uint8_t));
+    *ptr += sizeof(uint8_t);
+    reservedmarshal_VkExtensionProperties(
+        vkStream, rootType, (VkExtensionProperties*)(&forMarshaling->stdExtensionVersion), ptr);
+}
+
+void reservedmarshal_VkVideoEncodeH264SessionCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH264SessionCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkVideoEncodeH264CreateFlagsEXT*)&forMarshaling->flags,
+           sizeof(VkVideoEncodeH264CreateFlagsEXT));
+    *ptr += sizeof(VkVideoEncodeH264CreateFlagsEXT);
+    reservedmarshal_VkExtent2D(vkStream, rootType,
+                               (VkExtent2D*)(&forMarshaling->maxPictureSizeInMbs), ptr);
+    reservedmarshal_VkExtensionProperties(
+        vkStream, rootType, (const VkExtensionProperties*)(forMarshaling->pStdExtensionVersion),
+        ptr);
+}
+
+void reservedmarshal_VkVideoEncodeH264SessionParametersAddInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH264SessionParametersAddInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->spsStdCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pSpsStd;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pSpsStd) {
+        memcpy(*ptr, (const StdVideoH264SequenceParameterSet*)forMarshaling->pSpsStd,
+               forMarshaling->spsStdCount * sizeof(const StdVideoH264SequenceParameterSet));
+        *ptr += forMarshaling->spsStdCount * sizeof(const StdVideoH264SequenceParameterSet);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->ppsStdCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pPpsStd;
+    memcpy((*ptr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pPpsStd) {
+        memcpy(*ptr, (const StdVideoH264PictureParameterSet*)forMarshaling->pPpsStd,
+               forMarshaling->ppsStdCount * sizeof(const StdVideoH264PictureParameterSet));
+        *ptr += forMarshaling->ppsStdCount * sizeof(const StdVideoH264PictureParameterSet);
+    }
+}
+
+void reservedmarshal_VkVideoEncodeH264SessionParametersCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH264SessionParametersCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxSpsStdCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPpsStdCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pParametersAddInfo;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pParametersAddInfo) {
+        reservedmarshal_VkVideoEncodeH264SessionParametersAddInfoEXT(
+            vkStream, rootType,
+            (const VkVideoEncodeH264SessionParametersAddInfoEXT*)(forMarshaling
+                                                                      ->pParametersAddInfo),
+            ptr);
+    }
+}
+
+void reservedmarshal_VkVideoEncodeH264DpbSlotInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH264DpbSlotInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (int8_t*)&forMarshaling->slotIndex, sizeof(int8_t));
+    *ptr += sizeof(int8_t);
+    memcpy(*ptr, (const StdVideoEncodeH264PictureInfo*)forMarshaling->pStdPictureInfo,
+           sizeof(const StdVideoEncodeH264PictureInfo));
+    *ptr += sizeof(const StdVideoEncodeH264PictureInfo);
+}
+
+void reservedmarshal_VkVideoEncodeH264NaluSliceEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH264NaluSliceEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (const StdVideoEncodeH264SliceHeader*)forMarshaling->pSliceHeaderStd,
+           sizeof(const StdVideoEncodeH264SliceHeader));
+    *ptr += sizeof(const StdVideoEncodeH264SliceHeader);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->mbCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint8_t*)&forMarshaling->refFinalList0EntryCount, sizeof(uint8_t));
+    *ptr += sizeof(uint8_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->refFinalList0EntryCount; ++i) {
+        reservedmarshal_VkVideoEncodeH264DpbSlotInfoEXT(
+            vkStream, rootType,
+            (const VkVideoEncodeH264DpbSlotInfoEXT*)(forMarshaling->pRefFinalList0Entries + i),
+            ptr);
+    }
+    memcpy(*ptr, (uint8_t*)&forMarshaling->refFinalList1EntryCount, sizeof(uint8_t));
+    *ptr += sizeof(uint8_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->refFinalList1EntryCount; ++i) {
+        reservedmarshal_VkVideoEncodeH264DpbSlotInfoEXT(
+            vkStream, rootType,
+            (const VkVideoEncodeH264DpbSlotInfoEXT*)(forMarshaling->pRefFinalList1Entries + i),
+            ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->precedingNaluBytes, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint8_t*)&forMarshaling->minQp, sizeof(uint8_t));
+    *ptr += sizeof(uint8_t);
+    memcpy(*ptr, (uint8_t*)&forMarshaling->maxQp, sizeof(uint8_t));
+    *ptr += sizeof(uint8_t);
+}
+
+void reservedmarshal_VkVideoEncodeH264VclFrameInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH264VclFrameInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint8_t*)&forMarshaling->refDefaultFinalList0EntryCount, sizeof(uint8_t));
+    *ptr += sizeof(uint8_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->refDefaultFinalList0EntryCount; ++i) {
+        reservedmarshal_VkVideoEncodeH264DpbSlotInfoEXT(
+            vkStream, rootType,
+            (const VkVideoEncodeH264DpbSlotInfoEXT*)(forMarshaling->pRefDefaultFinalList0Entries +
+                                                     i),
+            ptr);
+    }
+    memcpy(*ptr, (uint8_t*)&forMarshaling->refDefaultFinalList1EntryCount, sizeof(uint8_t));
+    *ptr += sizeof(uint8_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->refDefaultFinalList1EntryCount; ++i) {
+        reservedmarshal_VkVideoEncodeH264DpbSlotInfoEXT(
+            vkStream, rootType,
+            (const VkVideoEncodeH264DpbSlotInfoEXT*)(forMarshaling->pRefDefaultFinalList1Entries +
+                                                     i),
+            ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->naluSliceEntryCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->naluSliceEntryCount; ++i) {
+        reservedmarshal_VkVideoEncodeH264NaluSliceEXT(
+            vkStream, rootType,
+            (const VkVideoEncodeH264NaluSliceEXT*)(forMarshaling->pNaluSliceEntries + i), ptr);
+    }
+    reservedmarshal_VkVideoEncodeH264DpbSlotInfoEXT(
+        vkStream, rootType,
+        (const VkVideoEncodeH264DpbSlotInfoEXT*)(forMarshaling->pCurrentPictureInfo), ptr);
+}
+
+void reservedmarshal_VkVideoEncodeH264EmitPictureParametersEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH264EmitPictureParametersEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint8_t*)&forMarshaling->spsId, sizeof(uint8_t));
+    *ptr += sizeof(uint8_t);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->emitSpsEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->ppsIdEntryCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const uint8_t*)forMarshaling->ppsIdEntries,
+           forMarshaling->ppsIdEntryCount * sizeof(const uint8_t));
+    *ptr += forMarshaling->ppsIdEntryCount * sizeof(const uint8_t);
+}
+
+void reservedmarshal_VkVideoEncodeH264ProfileEXT(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkVideoEncodeH264ProfileEXT* forMarshaling,
+                                                 uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (StdVideoH264ProfileIdc*)&forMarshaling->stdProfileIdc,
+           sizeof(StdVideoH264ProfileIdc));
+    *ptr += sizeof(StdVideoH264ProfileIdc);
+}
+
+#endif
+#ifdef VK_EXT_video_encode_h265
+void reservedmarshal_VkVideoEncodeH265CapabilitiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265CapabilitiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkVideoEncodeH265CapabilityFlagsEXT*)&forMarshaling->flags,
+           sizeof(VkVideoEncodeH265CapabilityFlagsEXT));
+    *ptr += sizeof(VkVideoEncodeH265CapabilityFlagsEXT);
+    memcpy(*ptr, (VkVideoEncodeH265InputModeFlagsEXT*)&forMarshaling->inputModeFlags,
+           sizeof(VkVideoEncodeH265InputModeFlagsEXT));
+    *ptr += sizeof(VkVideoEncodeH265InputModeFlagsEXT);
+    memcpy(*ptr, (VkVideoEncodeH265OutputModeFlagsEXT*)&forMarshaling->outputModeFlags,
+           sizeof(VkVideoEncodeH265OutputModeFlagsEXT));
+    *ptr += sizeof(VkVideoEncodeH265OutputModeFlagsEXT);
+    memcpy(*ptr, (VkVideoEncodeH265CtbSizeFlagsEXT*)&forMarshaling->ctbSizes,
+           sizeof(VkVideoEncodeH265CtbSizeFlagsEXT));
+    *ptr += sizeof(VkVideoEncodeH265CtbSizeFlagsEXT);
+    reservedmarshal_VkExtent2D(vkStream, rootType,
+                               (VkExtent2D*)(&forMarshaling->inputImageDataAlignment), ptr);
+    memcpy(*ptr, (uint8_t*)&forMarshaling->maxNumL0ReferenceForP, sizeof(uint8_t));
+    *ptr += sizeof(uint8_t);
+    memcpy(*ptr, (uint8_t*)&forMarshaling->maxNumL0ReferenceForB, sizeof(uint8_t));
+    *ptr += sizeof(uint8_t);
+    memcpy(*ptr, (uint8_t*)&forMarshaling->maxNumL1Reference, sizeof(uint8_t));
+    *ptr += sizeof(uint8_t);
+    memcpy(*ptr, (uint8_t*)&forMarshaling->maxNumSubLayers, sizeof(uint8_t));
+    *ptr += sizeof(uint8_t);
+    memcpy(*ptr, (uint8_t*)&forMarshaling->qualityLevelCount, sizeof(uint8_t));
+    *ptr += sizeof(uint8_t);
+    reservedmarshal_VkExtensionProperties(
+        vkStream, rootType, (VkExtensionProperties*)(&forMarshaling->stdExtensionVersion), ptr);
+}
+
+void reservedmarshal_VkVideoEncodeH265SessionCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265SessionCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkVideoEncodeH265CreateFlagsEXT*)&forMarshaling->flags,
+           sizeof(VkVideoEncodeH265CreateFlagsEXT));
+    *ptr += sizeof(VkVideoEncodeH265CreateFlagsEXT);
+    reservedmarshal_VkExtensionProperties(
+        vkStream, rootType, (const VkExtensionProperties*)(forMarshaling->pStdExtensionVersion),
+        ptr);
+}
+
+void reservedmarshal_VkVideoEncodeH265SessionParametersAddInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265SessionParametersAddInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->vpsStdCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pVpsStd;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pVpsStd) {
+        memcpy(*ptr, (const StdVideoH265VideoParameterSet*)forMarshaling->pVpsStd,
+               forMarshaling->vpsStdCount * sizeof(const StdVideoH265VideoParameterSet));
+        *ptr += forMarshaling->vpsStdCount * sizeof(const StdVideoH265VideoParameterSet);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->spsStdCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pSpsStd;
+    memcpy((*ptr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pSpsStd) {
+        memcpy(*ptr, (const StdVideoH265SequenceParameterSet*)forMarshaling->pSpsStd,
+               forMarshaling->spsStdCount * sizeof(const StdVideoH265SequenceParameterSet));
+        *ptr += forMarshaling->spsStdCount * sizeof(const StdVideoH265SequenceParameterSet);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->ppsStdCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)forMarshaling->pPpsStd;
+    memcpy((*ptr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pPpsStd) {
+        memcpy(*ptr, (const StdVideoH265PictureParameterSet*)forMarshaling->pPpsStd,
+               forMarshaling->ppsStdCount * sizeof(const StdVideoH265PictureParameterSet));
+        *ptr += forMarshaling->ppsStdCount * sizeof(const StdVideoH265PictureParameterSet);
+    }
+}
+
+void reservedmarshal_VkVideoEncodeH265SessionParametersCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265SessionParametersCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxVpsStdCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxSpsStdCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPpsStdCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pParametersAddInfo;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pParametersAddInfo) {
+        reservedmarshal_VkVideoEncodeH265SessionParametersAddInfoEXT(
+            vkStream, rootType,
+            (const VkVideoEncodeH265SessionParametersAddInfoEXT*)(forMarshaling
+                                                                      ->pParametersAddInfo),
+            ptr);
+    }
+}
+
+void reservedmarshal_VkVideoEncodeH265DpbSlotInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265DpbSlotInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (int8_t*)&forMarshaling->slotIndex, sizeof(int8_t));
+    *ptr += sizeof(int8_t);
+    memcpy(*ptr, (const StdVideoEncodeH265ReferenceInfo*)forMarshaling->pStdReferenceInfo,
+           sizeof(const StdVideoEncodeH265ReferenceInfo));
+    *ptr += sizeof(const StdVideoEncodeH265ReferenceInfo);
+}
+
+void reservedmarshal_VkVideoEncodeH265ReferenceListsEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265ReferenceListsEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint8_t*)&forMarshaling->referenceList0EntryCount, sizeof(uint8_t));
+    *ptr += sizeof(uint8_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->referenceList0EntryCount; ++i) {
+        reservedmarshal_VkVideoEncodeH265DpbSlotInfoEXT(
+            vkStream, rootType,
+            (const VkVideoEncodeH265DpbSlotInfoEXT*)(forMarshaling->pReferenceList0Entries + i),
+            ptr);
+    }
+    memcpy(*ptr, (uint8_t*)&forMarshaling->referenceList1EntryCount, sizeof(uint8_t));
+    *ptr += sizeof(uint8_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->referenceList1EntryCount; ++i) {
+        reservedmarshal_VkVideoEncodeH265DpbSlotInfoEXT(
+            vkStream, rootType,
+            (const VkVideoEncodeH265DpbSlotInfoEXT*)(forMarshaling->pReferenceList1Entries + i),
+            ptr);
+    }
+    memcpy(*ptr,
+           (const StdVideoEncodeH265ReferenceModifications*)forMarshaling->pReferenceModifications,
+           sizeof(const StdVideoEncodeH265ReferenceModifications));
+    *ptr += sizeof(const StdVideoEncodeH265ReferenceModifications);
+}
+
+void reservedmarshal_VkVideoEncodeH265NaluSliceEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265NaluSliceEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->ctbCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pReferenceFinalLists;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pReferenceFinalLists) {
+        reservedmarshal_VkVideoEncodeH265ReferenceListsEXT(
+            vkStream, rootType,
+            (const VkVideoEncodeH265ReferenceListsEXT*)(forMarshaling->pReferenceFinalLists), ptr);
+    }
+    memcpy(*ptr, (const StdVideoEncodeH265SliceHeader*)forMarshaling->pSliceHeaderStd,
+           sizeof(const StdVideoEncodeH265SliceHeader));
+    *ptr += sizeof(const StdVideoEncodeH265SliceHeader);
+}
+
+void reservedmarshal_VkVideoEncodeH265VclFrameInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265VclFrameInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pReferenceFinalLists;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pReferenceFinalLists) {
+        reservedmarshal_VkVideoEncodeH265ReferenceListsEXT(
+            vkStream, rootType,
+            (const VkVideoEncodeH265ReferenceListsEXT*)(forMarshaling->pReferenceFinalLists), ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->naluSliceEntryCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->naluSliceEntryCount; ++i) {
+        reservedmarshal_VkVideoEncodeH265NaluSliceEXT(
+            vkStream, rootType,
+            (const VkVideoEncodeH265NaluSliceEXT*)(forMarshaling->pNaluSliceEntries + i), ptr);
+    }
+    memcpy(*ptr, (const StdVideoEncodeH265PictureInfo*)forMarshaling->pCurrentPictureInfo,
+           sizeof(const StdVideoEncodeH265PictureInfo));
+    *ptr += sizeof(const StdVideoEncodeH265PictureInfo);
+}
+
+void reservedmarshal_VkVideoEncodeH265EmitPictureParametersEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265EmitPictureParametersEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint8_t*)&forMarshaling->vpsId, sizeof(uint8_t));
+    *ptr += sizeof(uint8_t);
+    memcpy(*ptr, (uint8_t*)&forMarshaling->spsId, sizeof(uint8_t));
+    *ptr += sizeof(uint8_t);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->emitVpsEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->emitSpsEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->ppsIdEntryCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const uint8_t*)forMarshaling->ppsIdEntries,
+           forMarshaling->ppsIdEntryCount * sizeof(const uint8_t));
+    *ptr += forMarshaling->ppsIdEntryCount * sizeof(const uint8_t);
+}
+
+void reservedmarshal_VkVideoEncodeH265ProfileEXT(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkVideoEncodeH265ProfileEXT* forMarshaling,
+                                                 uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (StdVideoH265ProfileIdc*)&forMarshaling->stdProfileIdc,
+           sizeof(StdVideoH265ProfileIdc));
+    *ptr += sizeof(StdVideoH265ProfileIdc);
+}
+
+#endif
+#ifdef VK_EXT_video_decode_h264
+void reservedmarshal_VkVideoDecodeH264ProfileEXT(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkVideoDecodeH264ProfileEXT* forMarshaling,
+                                                 uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (StdVideoH264ProfileIdc*)&forMarshaling->stdProfileIdc,
+           sizeof(StdVideoH264ProfileIdc));
+    *ptr += sizeof(StdVideoH264ProfileIdc);
+    memcpy(*ptr, (VkVideoDecodeH264PictureLayoutFlagsEXT*)&forMarshaling->pictureLayout,
+           sizeof(VkVideoDecodeH264PictureLayoutFlagsEXT));
+    *ptr += sizeof(VkVideoDecodeH264PictureLayoutFlagsEXT);
+}
+
+void reservedmarshal_VkVideoDecodeH264CapabilitiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH264CapabilitiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxLevel, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    reservedmarshal_VkOffset2D(vkStream, rootType,
+                               (VkOffset2D*)(&forMarshaling->fieldOffsetGranularity), ptr);
+    reservedmarshal_VkExtensionProperties(
+        vkStream, rootType, (VkExtensionProperties*)(&forMarshaling->stdExtensionVersion), ptr);
+}
+
+void reservedmarshal_VkVideoDecodeH264SessionCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH264SessionCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkVideoDecodeH264CreateFlagsEXT*)&forMarshaling->flags,
+           sizeof(VkVideoDecodeH264CreateFlagsEXT));
+    *ptr += sizeof(VkVideoDecodeH264CreateFlagsEXT);
+    reservedmarshal_VkExtensionProperties(
+        vkStream, rootType, (const VkExtensionProperties*)(forMarshaling->pStdExtensionVersion),
+        ptr);
+}
+
+void reservedmarshal_VkVideoDecodeH264SessionParametersAddInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH264SessionParametersAddInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->spsStdCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pSpsStd;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pSpsStd) {
+        memcpy(*ptr, (const StdVideoH264SequenceParameterSet*)forMarshaling->pSpsStd,
+               forMarshaling->spsStdCount * sizeof(const StdVideoH264SequenceParameterSet));
+        *ptr += forMarshaling->spsStdCount * sizeof(const StdVideoH264SequenceParameterSet);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->ppsStdCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pPpsStd;
+    memcpy((*ptr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pPpsStd) {
+        memcpy(*ptr, (const StdVideoH264PictureParameterSet*)forMarshaling->pPpsStd,
+               forMarshaling->ppsStdCount * sizeof(const StdVideoH264PictureParameterSet));
+        *ptr += forMarshaling->ppsStdCount * sizeof(const StdVideoH264PictureParameterSet);
+    }
+}
+
+void reservedmarshal_VkVideoDecodeH264SessionParametersCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH264SessionParametersCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxSpsStdCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPpsStdCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pParametersAddInfo;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pParametersAddInfo) {
+        reservedmarshal_VkVideoDecodeH264SessionParametersAddInfoEXT(
+            vkStream, rootType,
+            (const VkVideoDecodeH264SessionParametersAddInfoEXT*)(forMarshaling
+                                                                      ->pParametersAddInfo),
+            ptr);
+    }
+}
+
+void reservedmarshal_VkVideoDecodeH264PictureInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH264PictureInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (const StdVideoDecodeH264PictureInfo*)forMarshaling->pStdPictureInfo,
+           sizeof(const StdVideoDecodeH264PictureInfo));
+    *ptr += sizeof(const StdVideoDecodeH264PictureInfo);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->slicesCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const uint32_t*)forMarshaling->pSlicesDataOffsets,
+           forMarshaling->slicesCount * sizeof(const uint32_t));
+    *ptr += forMarshaling->slicesCount * sizeof(const uint32_t);
+}
+
+void reservedmarshal_VkVideoDecodeH264MvcEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkVideoDecodeH264MvcEXT* forMarshaling,
+                                             uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (const StdVideoDecodeH264Mvc*)forMarshaling->pStdMvc,
+           sizeof(const StdVideoDecodeH264Mvc));
+    *ptr += sizeof(const StdVideoDecodeH264Mvc);
+}
+
+void reservedmarshal_VkVideoDecodeH264DpbSlotInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH264DpbSlotInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (const StdVideoDecodeH264ReferenceInfo*)forMarshaling->pStdReferenceInfo,
+           sizeof(const StdVideoDecodeH264ReferenceInfo));
+    *ptr += sizeof(const StdVideoDecodeH264ReferenceInfo);
+}
+
+#endif
+#ifdef VK_AMD_texture_gather_bias_lod
+void reservedmarshal_VkTextureLODGatherFormatPropertiesAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkTextureLODGatherFormatPropertiesAMD* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->supportsTextureGatherLODBiasAMD, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_AMD_shader_info
+void reservedmarshal_VkShaderResourceUsageAMD(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkShaderResourceUsageAMD* forMarshaling,
+                                              uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->numUsedVgprs, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->numUsedSgprs, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->ldsSizePerLocalWorkGroup, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->ldsUsageSizeInBytes;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    uint64_t cgen_var_1 = (uint64_t)forMarshaling->scratchMemUsageInBytes;
+    memcpy((*ptr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+}
+
+void reservedmarshal_VkShaderStatisticsInfoAMD(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkShaderStatisticsInfoAMD* forMarshaling,
+                                               uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkShaderStageFlags*)&forMarshaling->shaderStageMask, sizeof(VkShaderStageFlags));
+    *ptr += sizeof(VkShaderStageFlags);
+    reservedmarshal_VkShaderResourceUsageAMD(
+        vkStream, rootType, (VkShaderResourceUsageAMD*)(&forMarshaling->resourceUsage), ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->numPhysicalVgprs, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->numPhysicalSgprs, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->numAvailableVgprs, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->numAvailableSgprs, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)forMarshaling->computeWorkGroupSize, 3 * sizeof(uint32_t));
+    *ptr += 3 * sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_AMD_shader_image_load_store_lod
+#endif
+#ifdef VK_GGP_stream_descriptor_surface
+void reservedmarshal_VkStreamDescriptorSurfaceCreateInfoGGP(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkStreamDescriptorSurfaceCreateInfoGGP* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkStreamDescriptorSurfaceCreateFlagsGGP*)&forMarshaling->flags,
+           sizeof(VkStreamDescriptorSurfaceCreateFlagsGGP));
+    *ptr += sizeof(VkStreamDescriptorSurfaceCreateFlagsGGP);
+    memcpy(*ptr, (GgpStreamDescriptor*)&forMarshaling->streamDescriptor,
+           sizeof(GgpStreamDescriptor));
+    *ptr += sizeof(GgpStreamDescriptor);
+}
+
+#endif
+#ifdef VK_NV_corner_sampled_image
+void reservedmarshal_VkPhysicalDeviceCornerSampledImageFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceCornerSampledImageFeaturesNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->cornerSampledImage, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_IMG_format_pvrtc
+#endif
+#ifdef VK_NV_external_memory_capabilities
+void reservedmarshal_VkExternalImageFormatPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExternalImageFormatPropertiesNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    reservedmarshal_VkImageFormatProperties(
+        vkStream, rootType, (VkImageFormatProperties*)(&forMarshaling->imageFormatProperties), ptr);
+    memcpy(*ptr, (VkExternalMemoryFeatureFlagsNV*)&forMarshaling->externalMemoryFeatures,
+           sizeof(VkExternalMemoryFeatureFlagsNV));
+    *ptr += sizeof(VkExternalMemoryFeatureFlagsNV);
+    memcpy(*ptr, (VkExternalMemoryHandleTypeFlagsNV*)&forMarshaling->exportFromImportedHandleTypes,
+           sizeof(VkExternalMemoryHandleTypeFlagsNV));
+    *ptr += sizeof(VkExternalMemoryHandleTypeFlagsNV);
+    memcpy(*ptr, (VkExternalMemoryHandleTypeFlagsNV*)&forMarshaling->compatibleHandleTypes,
+           sizeof(VkExternalMemoryHandleTypeFlagsNV));
+    *ptr += sizeof(VkExternalMemoryHandleTypeFlagsNV);
+}
+
+#endif
+#ifdef VK_NV_external_memory
+void reservedmarshal_VkExternalMemoryImageCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExternalMemoryImageCreateInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkExternalMemoryHandleTypeFlagsNV*)&forMarshaling->handleTypes,
+           sizeof(VkExternalMemoryHandleTypeFlagsNV));
+    *ptr += sizeof(VkExternalMemoryHandleTypeFlagsNV);
+}
+
+void reservedmarshal_VkExportMemoryAllocateInfoNV(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkExportMemoryAllocateInfoNV* forMarshaling,
+                                                  uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkExternalMemoryHandleTypeFlagsNV*)&forMarshaling->handleTypes,
+           sizeof(VkExternalMemoryHandleTypeFlagsNV));
+    *ptr += sizeof(VkExternalMemoryHandleTypeFlagsNV);
+}
+
+#endif
+#ifdef VK_NV_external_memory_win32
+void reservedmarshal_VkImportMemoryWin32HandleInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportMemoryWin32HandleInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkExternalMemoryHandleTypeFlagsNV*)&forMarshaling->handleType,
+           sizeof(VkExternalMemoryHandleTypeFlagsNV));
+    *ptr += sizeof(VkExternalMemoryHandleTypeFlagsNV);
+    memcpy(*ptr, (HANDLE*)&forMarshaling->handle, sizeof(HANDLE));
+    *ptr += sizeof(HANDLE);
+}
+
+void reservedmarshal_VkExportMemoryWin32HandleInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExportMemoryWin32HandleInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pAttributes;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pAttributes) {
+        memcpy(*ptr, (const SECURITY_ATTRIBUTES*)forMarshaling->pAttributes,
+               sizeof(const SECURITY_ATTRIBUTES));
+        *ptr += sizeof(const SECURITY_ATTRIBUTES);
+    }
+    memcpy(*ptr, (DWORD*)&forMarshaling->dwAccess, sizeof(DWORD));
+    *ptr += sizeof(DWORD);
+}
+
+#endif
+#ifdef VK_NV_win32_keyed_mutex
+void reservedmarshal_VkWin32KeyedMutexAcquireReleaseInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkWin32KeyedMutexAcquireReleaseInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->acquireCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    if (forMarshaling->acquireCount) {
+        uint8_t* cgen_var_0_ptr = (uint8_t*)(*ptr);
+        if (forMarshaling) {
+            for (uint32_t k = 0; k < forMarshaling->acquireCount; ++k) {
+                uint64_t tmpval = get_host_u64_VkDeviceMemory(forMarshaling->pAcquireSyncs[k]);
+                memcpy(cgen_var_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+            }
+        }
+        *ptr += 8 * forMarshaling->acquireCount;
+    }
+    memcpy(*ptr, (const uint64_t*)forMarshaling->pAcquireKeys,
+           forMarshaling->acquireCount * sizeof(const uint64_t));
+    *ptr += forMarshaling->acquireCount * sizeof(const uint64_t);
+    memcpy(*ptr, (const uint32_t*)forMarshaling->pAcquireTimeoutMilliseconds,
+           forMarshaling->acquireCount * sizeof(const uint32_t));
+    *ptr += forMarshaling->acquireCount * sizeof(const uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->releaseCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    if (forMarshaling->releaseCount) {
+        uint8_t* cgen_var_1_ptr = (uint8_t*)(*ptr);
+        if (forMarshaling) {
+            for (uint32_t k = 0; k < forMarshaling->releaseCount; ++k) {
+                uint64_t tmpval = get_host_u64_VkDeviceMemory(forMarshaling->pReleaseSyncs[k]);
+                memcpy(cgen_var_1_ptr + k * 8, &tmpval, sizeof(uint64_t));
+            }
+        }
+        *ptr += 8 * forMarshaling->releaseCount;
+    }
+    memcpy(*ptr, (const uint64_t*)forMarshaling->pReleaseKeys,
+           forMarshaling->releaseCount * sizeof(const uint64_t));
+    *ptr += forMarshaling->releaseCount * sizeof(const uint64_t);
+}
+
+#endif
+#ifdef VK_EXT_validation_flags
+void reservedmarshal_VkValidationFlagsEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkValidationFlagsEXT* forMarshaling,
+                                          uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->disabledValidationCheckCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const VkValidationCheckEXT*)forMarshaling->pDisabledValidationChecks,
+           forMarshaling->disabledValidationCheckCount * sizeof(const VkValidationCheckEXT));
+    *ptr += forMarshaling->disabledValidationCheckCount * sizeof(const VkValidationCheckEXT);
+}
+
+#endif
+#ifdef VK_NN_vi_surface
+void reservedmarshal_VkViSurfaceCreateInfoNN(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkViSurfaceCreateInfoNN* forMarshaling,
+                                             uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkViSurfaceCreateFlagsNN*)&forMarshaling->flags,
+           sizeof(VkViSurfaceCreateFlagsNN));
+    *ptr += sizeof(VkViSurfaceCreateFlagsNN);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->window;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->window) {
+        memcpy(*ptr, (void*)forMarshaling->window, sizeof(uint8_t));
+        *ptr += sizeof(uint8_t);
+    }
+}
+
+#endif
+#ifdef VK_EXT_shader_subgroup_ballot
+#endif
+#ifdef VK_EXT_shader_subgroup_vote
+#endif
+#ifdef VK_EXT_texture_compression_astc_hdr
+void reservedmarshal_VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->textureCompressionASTC_HDR, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_astc_decode_mode
+void reservedmarshal_VkImageViewASTCDecodeModeEXT(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkImageViewASTCDecodeModeEXT* forMarshaling,
+                                                  uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkFormat*)&forMarshaling->decodeMode, sizeof(VkFormat));
+    *ptr += sizeof(VkFormat);
+}
+
+void reservedmarshal_VkPhysicalDeviceASTCDecodeFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceASTCDecodeFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->decodeModeSharedExponent, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_conditional_rendering
+void reservedmarshal_VkConditionalRenderingBeginInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkConditionalRenderingBeginInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&forMarshaling->buffer));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->offset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkConditionalRenderingFlagsEXT*)&forMarshaling->flags,
+           sizeof(VkConditionalRenderingFlagsEXT));
+    *ptr += sizeof(VkConditionalRenderingFlagsEXT);
+}
+
+void reservedmarshal_VkPhysicalDeviceConditionalRenderingFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceConditionalRenderingFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->conditionalRendering, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->inheritedConditionalRendering, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkCommandBufferInheritanceConditionalRenderingInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCommandBufferInheritanceConditionalRenderingInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->conditionalRenderingEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+void reservedmarshal_VkViewportWScalingNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkViewportWScalingNV* forMarshaling,
+                                          uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (float*)&forMarshaling->xcoeff, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->ycoeff, sizeof(float));
+    *ptr += sizeof(float);
+}
+
+void reservedmarshal_VkPipelineViewportWScalingStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineViewportWScalingStateCreateInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->viewportWScalingEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->viewportCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pViewportWScalings;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pViewportWScalings) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->viewportCount; ++i) {
+            reservedmarshal_VkViewportWScalingNV(
+                vkStream, rootType,
+                (const VkViewportWScalingNV*)(forMarshaling->pViewportWScalings + i), ptr);
+        }
+    }
+}
+
+#endif
+#ifdef VK_EXT_direct_mode_display
+#endif
+#ifdef VK_EXT_acquire_xlib_display
+#endif
+#ifdef VK_EXT_display_surface_counter
+void reservedmarshal_VkSurfaceCapabilities2EXT(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkSurfaceCapabilities2EXT* forMarshaling,
+                                               uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->minImageCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxImageCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    reservedmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->currentExtent),
+                               ptr);
+    reservedmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->minImageExtent),
+                               ptr);
+    reservedmarshal_VkExtent2D(vkStream, rootType, (VkExtent2D*)(&forMarshaling->maxImageExtent),
+                               ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxImageArrayLayers, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkSurfaceTransformFlagsKHR*)&forMarshaling->supportedTransforms,
+           sizeof(VkSurfaceTransformFlagsKHR));
+    *ptr += sizeof(VkSurfaceTransformFlagsKHR);
+    memcpy(*ptr, (VkSurfaceTransformFlagBitsKHR*)&forMarshaling->currentTransform,
+           sizeof(VkSurfaceTransformFlagBitsKHR));
+    *ptr += sizeof(VkSurfaceTransformFlagBitsKHR);
+    memcpy(*ptr, (VkCompositeAlphaFlagsKHR*)&forMarshaling->supportedCompositeAlpha,
+           sizeof(VkCompositeAlphaFlagsKHR));
+    *ptr += sizeof(VkCompositeAlphaFlagsKHR);
+    memcpy(*ptr, (VkImageUsageFlags*)&forMarshaling->supportedUsageFlags,
+           sizeof(VkImageUsageFlags));
+    *ptr += sizeof(VkImageUsageFlags);
+    memcpy(*ptr, (VkSurfaceCounterFlagsEXT*)&forMarshaling->supportedSurfaceCounters,
+           sizeof(VkSurfaceCounterFlagsEXT));
+    *ptr += sizeof(VkSurfaceCounterFlagsEXT);
+}
+
+#endif
+#ifdef VK_EXT_display_control
+void reservedmarshal_VkDisplayPowerInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkDisplayPowerInfoEXT* forMarshaling,
+                                           uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDisplayPowerStateEXT*)&forMarshaling->powerState,
+           sizeof(VkDisplayPowerStateEXT));
+    *ptr += sizeof(VkDisplayPowerStateEXT);
+}
+
+void reservedmarshal_VkDeviceEventInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkDeviceEventInfoEXT* forMarshaling,
+                                          uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDeviceEventTypeEXT*)&forMarshaling->deviceEvent, sizeof(VkDeviceEventTypeEXT));
+    *ptr += sizeof(VkDeviceEventTypeEXT);
+}
+
+void reservedmarshal_VkDisplayEventInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkDisplayEventInfoEXT* forMarshaling,
+                                           uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDisplayEventTypeEXT*)&forMarshaling->displayEvent,
+           sizeof(VkDisplayEventTypeEXT));
+    *ptr += sizeof(VkDisplayEventTypeEXT);
+}
+
+void reservedmarshal_VkSwapchainCounterCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSwapchainCounterCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkSurfaceCounterFlagsEXT*)&forMarshaling->surfaceCounters,
+           sizeof(VkSurfaceCounterFlagsEXT));
+    *ptr += sizeof(VkSurfaceCounterFlagsEXT);
+}
+
+#endif
+#ifdef VK_GOOGLE_display_timing
+void reservedmarshal_VkRefreshCycleDurationGOOGLE(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkRefreshCycleDurationGOOGLE* forMarshaling,
+                                                  uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint64_t*)&forMarshaling->refreshDuration, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+}
+
+void reservedmarshal_VkPastPresentationTimingGOOGLE(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPastPresentationTimingGOOGLE* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->presentID, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->desiredPresentTime, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->actualPresentTime, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->earliestPresentTime, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->presentMargin, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+}
+
+void reservedmarshal_VkPresentTimeGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkPresentTimeGOOGLE* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->presentID, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->desiredPresentTime, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+}
+
+void reservedmarshal_VkPresentTimesInfoGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkPresentTimesInfoGOOGLE* forMarshaling,
+                                              uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->swapchainCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pTimes;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pTimes) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->swapchainCount; ++i) {
+            reservedmarshal_VkPresentTimeGOOGLE(
+                vkStream, rootType, (const VkPresentTimeGOOGLE*)(forMarshaling->pTimes + i), ptr);
+        }
+    }
+}
+
+#endif
+#ifdef VK_NV_sample_mask_override_coverage
+#endif
+#ifdef VK_NV_geometry_shader_passthrough
+#endif
+#ifdef VK_NV_viewport_array2
+#endif
+#ifdef VK_NVX_multiview_per_view_attributes
+void reservedmarshal_VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->perViewPositionAllComponents, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_NV_viewport_swizzle
+void reservedmarshal_VkViewportSwizzleNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkViewportSwizzleNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkViewportCoordinateSwizzleNV*)&forMarshaling->x,
+           sizeof(VkViewportCoordinateSwizzleNV));
+    *ptr += sizeof(VkViewportCoordinateSwizzleNV);
+    memcpy(*ptr, (VkViewportCoordinateSwizzleNV*)&forMarshaling->y,
+           sizeof(VkViewportCoordinateSwizzleNV));
+    *ptr += sizeof(VkViewportCoordinateSwizzleNV);
+    memcpy(*ptr, (VkViewportCoordinateSwizzleNV*)&forMarshaling->z,
+           sizeof(VkViewportCoordinateSwizzleNV));
+    *ptr += sizeof(VkViewportCoordinateSwizzleNV);
+    memcpy(*ptr, (VkViewportCoordinateSwizzleNV*)&forMarshaling->w,
+           sizeof(VkViewportCoordinateSwizzleNV));
+    *ptr += sizeof(VkViewportCoordinateSwizzleNV);
+}
+
+void reservedmarshal_VkPipelineViewportSwizzleStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineViewportSwizzleStateCreateInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineViewportSwizzleStateCreateFlagsNV*)&forMarshaling->flags,
+           sizeof(VkPipelineViewportSwizzleStateCreateFlagsNV));
+    *ptr += sizeof(VkPipelineViewportSwizzleStateCreateFlagsNV);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->viewportCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pViewportSwizzles;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pViewportSwizzles) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->viewportCount; ++i) {
+            reservedmarshal_VkViewportSwizzleNV(
+                vkStream, rootType,
+                (const VkViewportSwizzleNV*)(forMarshaling->pViewportSwizzles + i), ptr);
+        }
+    }
+}
+
+#endif
+#ifdef VK_EXT_discard_rectangles
+void reservedmarshal_VkPhysicalDeviceDiscardRectanglePropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDiscardRectanglePropertiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDiscardRectangles, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkPipelineDiscardRectangleStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineDiscardRectangleStateCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineDiscardRectangleStateCreateFlagsEXT*)&forMarshaling->flags,
+           sizeof(VkPipelineDiscardRectangleStateCreateFlagsEXT));
+    *ptr += sizeof(VkPipelineDiscardRectangleStateCreateFlagsEXT);
+    memcpy(*ptr, (VkDiscardRectangleModeEXT*)&forMarshaling->discardRectangleMode,
+           sizeof(VkDiscardRectangleModeEXT));
+    *ptr += sizeof(VkDiscardRectangleModeEXT);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->discardRectangleCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pDiscardRectangles;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pDiscardRectangles) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->discardRectangleCount; ++i) {
+            reservedmarshal_VkRect2D(vkStream, rootType,
+                                     (const VkRect2D*)(forMarshaling->pDiscardRectangles + i), ptr);
+        }
+    }
+}
+
+#endif
+#ifdef VK_EXT_conservative_rasterization
+void reservedmarshal_VkPhysicalDeviceConservativeRasterizationPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceConservativeRasterizationPropertiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (float*)&forMarshaling->primitiveOverestimationSize, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->maxExtraPrimitiveOverestimationSize, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->extraPrimitiveOverestimationSizeGranularity,
+           sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->primitiveUnderestimation, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->conservativePointAndLineRasterization,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->degenerateTrianglesRasterized, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->degenerateLinesRasterized, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->fullyCoveredFragmentShaderInputVariable,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->conservativeRasterizationPostDepthCoverage,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPipelineRasterizationConservativeStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRasterizationConservativeStateCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineRasterizationConservativeStateCreateFlagsEXT*)&forMarshaling->flags,
+           sizeof(VkPipelineRasterizationConservativeStateCreateFlagsEXT));
+    *ptr += sizeof(VkPipelineRasterizationConservativeStateCreateFlagsEXT);
+    memcpy(*ptr, (VkConservativeRasterizationModeEXT*)&forMarshaling->conservativeRasterizationMode,
+           sizeof(VkConservativeRasterizationModeEXT));
+    *ptr += sizeof(VkConservativeRasterizationModeEXT);
+    memcpy(*ptr, (float*)&forMarshaling->extraPrimitiveOverestimationSize, sizeof(float));
+    *ptr += sizeof(float);
+}
+
+#endif
+#ifdef VK_EXT_depth_clip_enable
+void reservedmarshal_VkPhysicalDeviceDepthClipEnableFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDepthClipEnableFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->depthClipEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPipelineRasterizationDepthClipStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRasterizationDepthClipStateCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineRasterizationDepthClipStateCreateFlagsEXT*)&forMarshaling->flags,
+           sizeof(VkPipelineRasterizationDepthClipStateCreateFlagsEXT));
+    *ptr += sizeof(VkPipelineRasterizationDepthClipStateCreateFlagsEXT);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->depthClipEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_swapchain_colorspace
+#endif
+#ifdef VK_EXT_hdr_metadata
+void reservedmarshal_VkXYColorEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkXYColorEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (float*)&forMarshaling->x, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->y, sizeof(float));
+    *ptr += sizeof(float);
+}
+
+void reservedmarshal_VkHdrMetadataEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkHdrMetadataEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkXYColorEXT(vkStream, rootType,
+                                 (VkXYColorEXT*)(&forMarshaling->displayPrimaryRed), ptr);
+    reservedmarshal_VkXYColorEXT(vkStream, rootType,
+                                 (VkXYColorEXT*)(&forMarshaling->displayPrimaryGreen), ptr);
+    reservedmarshal_VkXYColorEXT(vkStream, rootType,
+                                 (VkXYColorEXT*)(&forMarshaling->displayPrimaryBlue), ptr);
+    reservedmarshal_VkXYColorEXT(vkStream, rootType, (VkXYColorEXT*)(&forMarshaling->whitePoint),
+                                 ptr);
+    memcpy(*ptr, (float*)&forMarshaling->maxLuminance, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->minLuminance, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->maxContentLightLevel, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->maxFrameAverageLightLevel, sizeof(float));
+    *ptr += sizeof(float);
+}
+
+#endif
+#ifdef VK_MVK_ios_surface
+void reservedmarshal_VkIOSSurfaceCreateInfoMVK(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkIOSSurfaceCreateInfoMVK* forMarshaling,
+                                               uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkIOSSurfaceCreateFlagsMVK*)&forMarshaling->flags,
+           sizeof(VkIOSSurfaceCreateFlagsMVK));
+    *ptr += sizeof(VkIOSSurfaceCreateFlagsMVK);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pView;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pView) {
+        memcpy(*ptr, (const void*)forMarshaling->pView, sizeof(const uint8_t));
+        *ptr += sizeof(const uint8_t);
+    }
+}
+
+#endif
+#ifdef VK_MVK_macos_surface
+void reservedmarshal_VkMacOSSurfaceCreateInfoMVK(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkMacOSSurfaceCreateInfoMVK* forMarshaling,
+                                                 uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkMacOSSurfaceCreateFlagsMVK*)&forMarshaling->flags,
+           sizeof(VkMacOSSurfaceCreateFlagsMVK));
+    *ptr += sizeof(VkMacOSSurfaceCreateFlagsMVK);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pView;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pView) {
+        memcpy(*ptr, (const void*)forMarshaling->pView, sizeof(const uint8_t));
+        *ptr += sizeof(const uint8_t);
+    }
+}
+
+#endif
+#ifdef VK_MVK_moltenvk
+#endif
+#ifdef VK_EXT_external_memory_dma_buf
+#endif
+#ifdef VK_EXT_queue_family_foreign
+#endif
+#ifdef VK_EXT_debug_utils
+void reservedmarshal_VkDebugUtilsLabelEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkDebugUtilsLabelEXT* forMarshaling,
+                                          uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    {
+        uint32_t l = forMarshaling->pLabelName ? strlen(forMarshaling->pLabelName) : 0;
+        memcpy(*ptr, (uint32_t*)&l, sizeof(uint32_t));
+        android::base::Stream::toBe32((uint8_t*)*ptr);
+        *ptr += sizeof(uint32_t);
+        memcpy(*ptr, (char*)forMarshaling->pLabelName, l);
+        *ptr += l;
+    }
+    memcpy(*ptr, (float*)forMarshaling->color, 4 * sizeof(float));
+    *ptr += 4 * sizeof(float);
+}
+
+void reservedmarshal_VkDebugUtilsObjectNameInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDebugUtilsObjectNameInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkObjectType*)&forMarshaling->objectType, sizeof(VkObjectType));
+    *ptr += sizeof(VkObjectType);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->objectHandle, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+    if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) {
+        // WARNING PTR CHECK
+        uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pObjectName;
+        memcpy((*ptr), &cgen_var_0, 8);
+        android::base::Stream::toBe64((uint8_t*)(*ptr));
+        *ptr += 8;
+        if (forMarshaling->pObjectName) {
+            {
+                uint32_t l = forMarshaling->pObjectName ? strlen(forMarshaling->pObjectName) : 0;
+                memcpy(*ptr, (uint32_t*)&l, sizeof(uint32_t));
+                android::base::Stream::toBe32((uint8_t*)*ptr);
+                *ptr += sizeof(uint32_t);
+                memcpy(*ptr, (char*)forMarshaling->pObjectName, l);
+                *ptr += l;
+            }
+        }
+    } else {
+        {
+            uint32_t l = forMarshaling->pObjectName ? strlen(forMarshaling->pObjectName) : 0;
+            memcpy(*ptr, (uint32_t*)&l, sizeof(uint32_t));
+            android::base::Stream::toBe32((uint8_t*)*ptr);
+            *ptr += sizeof(uint32_t);
+            memcpy(*ptr, (char*)forMarshaling->pObjectName, l);
+            *ptr += l;
+        }
+    }
+}
+
+void reservedmarshal_VkDebugUtilsMessengerCallbackDataEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDebugUtilsMessengerCallbackDataEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDebugUtilsMessengerCallbackDataFlagsEXT*)&forMarshaling->flags,
+           sizeof(VkDebugUtilsMessengerCallbackDataFlagsEXT));
+    *ptr += sizeof(VkDebugUtilsMessengerCallbackDataFlagsEXT);
+    if (vkStream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) {
+        // WARNING PTR CHECK
+        uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pMessageIdName;
+        memcpy((*ptr), &cgen_var_0, 8);
+        android::base::Stream::toBe64((uint8_t*)(*ptr));
+        *ptr += 8;
+        if (forMarshaling->pMessageIdName) {
+            {
+                uint32_t l =
+                    forMarshaling->pMessageIdName ? strlen(forMarshaling->pMessageIdName) : 0;
+                memcpy(*ptr, (uint32_t*)&l, sizeof(uint32_t));
+                android::base::Stream::toBe32((uint8_t*)*ptr);
+                *ptr += sizeof(uint32_t);
+                memcpy(*ptr, (char*)forMarshaling->pMessageIdName, l);
+                *ptr += l;
+            }
+        }
+    } else {
+        {
+            uint32_t l = forMarshaling->pMessageIdName ? strlen(forMarshaling->pMessageIdName) : 0;
+            memcpy(*ptr, (uint32_t*)&l, sizeof(uint32_t));
+            android::base::Stream::toBe32((uint8_t*)*ptr);
+            *ptr += sizeof(uint32_t);
+            memcpy(*ptr, (char*)forMarshaling->pMessageIdName, l);
+            *ptr += l;
+        }
+    }
+    memcpy(*ptr, (int32_t*)&forMarshaling->messageIdNumber, sizeof(int32_t));
+    *ptr += sizeof(int32_t);
+    {
+        uint32_t l = forMarshaling->pMessage ? strlen(forMarshaling->pMessage) : 0;
+        memcpy(*ptr, (uint32_t*)&l, sizeof(uint32_t));
+        android::base::Stream::toBe32((uint8_t*)*ptr);
+        *ptr += sizeof(uint32_t);
+        memcpy(*ptr, (char*)forMarshaling->pMessage, l);
+        *ptr += l;
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->queueLabelCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pQueueLabels;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pQueueLabels) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->queueLabelCount; ++i) {
+            reservedmarshal_VkDebugUtilsLabelEXT(
+                vkStream, rootType, (VkDebugUtilsLabelEXT*)(forMarshaling->pQueueLabels + i), ptr);
+        }
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->cmdBufLabelCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pCmdBufLabels;
+    memcpy((*ptr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pCmdBufLabels) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->cmdBufLabelCount; ++i) {
+            reservedmarshal_VkDebugUtilsLabelEXT(
+                vkStream, rootType, (VkDebugUtilsLabelEXT*)(forMarshaling->pCmdBufLabels + i), ptr);
+        }
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->objectCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)forMarshaling->pObjects;
+    memcpy((*ptr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pObjects) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->objectCount; ++i) {
+            reservedmarshal_VkDebugUtilsObjectNameInfoEXT(
+                vkStream, rootType, (VkDebugUtilsObjectNameInfoEXT*)(forMarshaling->pObjects + i),
+                ptr);
+        }
+    }
+}
+
+void reservedmarshal_VkDebugUtilsMessengerCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDebugUtilsMessengerCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDebugUtilsMessengerCreateFlagsEXT*)&forMarshaling->flags,
+           sizeof(VkDebugUtilsMessengerCreateFlagsEXT));
+    *ptr += sizeof(VkDebugUtilsMessengerCreateFlagsEXT);
+    memcpy(*ptr, (VkDebugUtilsMessageSeverityFlagsEXT*)&forMarshaling->messageSeverity,
+           sizeof(VkDebugUtilsMessageSeverityFlagsEXT));
+    *ptr += sizeof(VkDebugUtilsMessageSeverityFlagsEXT);
+    memcpy(*ptr, (VkDebugUtilsMessageTypeFlagsEXT*)&forMarshaling->messageType,
+           sizeof(VkDebugUtilsMessageTypeFlagsEXT));
+    *ptr += sizeof(VkDebugUtilsMessageTypeFlagsEXT);
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->pfnUserCallback;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pUserData;
+    memcpy((*ptr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pUserData) {
+        memcpy(*ptr, (void*)forMarshaling->pUserData, sizeof(uint8_t));
+        *ptr += sizeof(uint8_t);
+    }
+}
+
+void reservedmarshal_VkDebugUtilsObjectTagInfoEXT(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkDebugUtilsObjectTagInfoEXT* forMarshaling,
+                                                  uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkObjectType*)&forMarshaling->objectType, sizeof(VkObjectType));
+    *ptr += sizeof(VkObjectType);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->objectHandle, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->tagName, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->tagSize;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    memcpy(*ptr, (const void*)forMarshaling->pTag, forMarshaling->tagSize * sizeof(const uint8_t));
+    *ptr += forMarshaling->tagSize * sizeof(const uint8_t);
+}
+
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+void reservedmarshal_VkAndroidHardwareBufferUsageANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAndroidHardwareBufferUsageANDROID* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->androidHardwareBufferUsage, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+}
+
+void reservedmarshal_VkAndroidHardwareBufferPropertiesANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAndroidHardwareBufferPropertiesANDROID* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->allocationSize, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->memoryTypeBits, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkAndroidHardwareBufferFormatPropertiesANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAndroidHardwareBufferFormatPropertiesANDROID* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+    *ptr += sizeof(VkFormat);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->externalFormat, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+    memcpy(*ptr, (VkFormatFeatureFlags*)&forMarshaling->formatFeatures,
+           sizeof(VkFormatFeatureFlags));
+    *ptr += sizeof(VkFormatFeatureFlags);
+    reservedmarshal_VkComponentMapping(
+        vkStream, rootType, (VkComponentMapping*)(&forMarshaling->samplerYcbcrConversionComponents),
+        ptr);
+    memcpy(*ptr, (VkSamplerYcbcrModelConversion*)&forMarshaling->suggestedYcbcrModel,
+           sizeof(VkSamplerYcbcrModelConversion));
+    *ptr += sizeof(VkSamplerYcbcrModelConversion);
+    memcpy(*ptr, (VkSamplerYcbcrRange*)&forMarshaling->suggestedYcbcrRange,
+           sizeof(VkSamplerYcbcrRange));
+    *ptr += sizeof(VkSamplerYcbcrRange);
+    memcpy(*ptr, (VkChromaLocation*)&forMarshaling->suggestedXChromaOffset,
+           sizeof(VkChromaLocation));
+    *ptr += sizeof(VkChromaLocation);
+    memcpy(*ptr, (VkChromaLocation*)&forMarshaling->suggestedYChromaOffset,
+           sizeof(VkChromaLocation));
+    *ptr += sizeof(VkChromaLocation);
+}
+
+void reservedmarshal_VkImportAndroidHardwareBufferInfoANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportAndroidHardwareBufferInfoANDROID* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (AHardwareBuffer*)forMarshaling->buffer, sizeof(AHardwareBuffer));
+    *ptr += sizeof(AHardwareBuffer);
+}
+
+void reservedmarshal_VkMemoryGetAndroidHardwareBufferInfoANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryGetAndroidHardwareBufferInfoANDROID* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDeviceMemory((*&forMarshaling->memory));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+}
+
+void reservedmarshal_VkExternalFormatANDROID(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkExternalFormatANDROID* forMarshaling,
+                                             uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->externalFormat, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+}
+
+void reservedmarshal_VkAndroidHardwareBufferFormatProperties2ANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAndroidHardwareBufferFormatProperties2ANDROID* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+    *ptr += sizeof(VkFormat);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->externalFormat, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+    memcpy(*ptr, (VkFormatFeatureFlags2KHR*)&forMarshaling->formatFeatures,
+           sizeof(VkFormatFeatureFlags2KHR));
+    *ptr += sizeof(VkFormatFeatureFlags2KHR);
+    reservedmarshal_VkComponentMapping(
+        vkStream, rootType, (VkComponentMapping*)(&forMarshaling->samplerYcbcrConversionComponents),
+        ptr);
+    memcpy(*ptr, (VkSamplerYcbcrModelConversion*)&forMarshaling->suggestedYcbcrModel,
+           sizeof(VkSamplerYcbcrModelConversion));
+    *ptr += sizeof(VkSamplerYcbcrModelConversion);
+    memcpy(*ptr, (VkSamplerYcbcrRange*)&forMarshaling->suggestedYcbcrRange,
+           sizeof(VkSamplerYcbcrRange));
+    *ptr += sizeof(VkSamplerYcbcrRange);
+    memcpy(*ptr, (VkChromaLocation*)&forMarshaling->suggestedXChromaOffset,
+           sizeof(VkChromaLocation));
+    *ptr += sizeof(VkChromaLocation);
+    memcpy(*ptr, (VkChromaLocation*)&forMarshaling->suggestedYChromaOffset,
+           sizeof(VkChromaLocation));
+    *ptr += sizeof(VkChromaLocation);
+}
+
+#endif
+#ifdef VK_EXT_sampler_filter_minmax
+#endif
+#ifdef VK_AMD_gpu_shader_int16
+#endif
+#ifdef VK_AMD_mixed_attachment_samples
+#endif
+#ifdef VK_AMD_shader_fragment_mask
+#endif
+#ifdef VK_EXT_inline_uniform_block
+void reservedmarshal_VkPhysicalDeviceInlineUniformBlockFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceInlineUniformBlockFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->inlineUniformBlock, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->descriptorBindingInlineUniformBlockUpdateAfterBind,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceInlineUniformBlockPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceInlineUniformBlockPropertiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxInlineUniformBlockSize, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPerStageDescriptorInlineUniformBlocks,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetInlineUniformBlocks, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindInlineUniformBlocks,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkWriteDescriptorSetInlineUniformBlockEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkWriteDescriptorSetInlineUniformBlockEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->dataSize, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const void*)forMarshaling->pData,
+           forMarshaling->dataSize * sizeof(const uint8_t));
+    *ptr += forMarshaling->dataSize * sizeof(const uint8_t);
+}
+
+void reservedmarshal_VkDescriptorPoolInlineUniformBlockCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDescriptorPoolInlineUniformBlockCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxInlineUniformBlockBindings, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_EXT_shader_stencil_export
+#endif
+#ifdef VK_EXT_sample_locations
+void reservedmarshal_VkSampleLocationEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkSampleLocationEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (float*)&forMarshaling->x, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->y, sizeof(float));
+    *ptr += sizeof(float);
+}
+
+void reservedmarshal_VkSampleLocationsInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkSampleLocationsInfoEXT* forMarshaling,
+                                              uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkSampleCountFlagBits*)&forMarshaling->sampleLocationsPerPixel,
+           sizeof(VkSampleCountFlagBits));
+    *ptr += sizeof(VkSampleCountFlagBits);
+    reservedmarshal_VkExtent2D(vkStream, rootType,
+                               (VkExtent2D*)(&forMarshaling->sampleLocationGridSize), ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->sampleLocationsCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->sampleLocationsCount; ++i) {
+        reservedmarshal_VkSampleLocationEXT(
+            vkStream, rootType, (const VkSampleLocationEXT*)(forMarshaling->pSampleLocations + i),
+            ptr);
+    }
+}
+
+void reservedmarshal_VkAttachmentSampleLocationsEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAttachmentSampleLocationsEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->attachmentIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    reservedmarshal_VkSampleLocationsInfoEXT(
+        vkStream, rootType, (VkSampleLocationsInfoEXT*)(&forMarshaling->sampleLocationsInfo), ptr);
+}
+
+void reservedmarshal_VkSubpassSampleLocationsEXT(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkSubpassSampleLocationsEXT* forMarshaling,
+                                                 uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->subpassIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    reservedmarshal_VkSampleLocationsInfoEXT(
+        vkStream, rootType, (VkSampleLocationsInfoEXT*)(&forMarshaling->sampleLocationsInfo), ptr);
+}
+
+void reservedmarshal_VkRenderPassSampleLocationsBeginInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRenderPassSampleLocationsBeginInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->attachmentInitialSampleLocationsCount,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->attachmentInitialSampleLocationsCount; ++i) {
+        reservedmarshal_VkAttachmentSampleLocationsEXT(
+            vkStream, rootType,
+            (const VkAttachmentSampleLocationsEXT*)(forMarshaling
+                                                        ->pAttachmentInitialSampleLocations +
+                                                    i),
+            ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->postSubpassSampleLocationsCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->postSubpassSampleLocationsCount; ++i) {
+        reservedmarshal_VkSubpassSampleLocationsEXT(
+            vkStream, rootType,
+            (const VkSubpassSampleLocationsEXT*)(forMarshaling->pPostSubpassSampleLocations + i),
+            ptr);
+    }
+}
+
+void reservedmarshal_VkPipelineSampleLocationsStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineSampleLocationsStateCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->sampleLocationsEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    reservedmarshal_VkSampleLocationsInfoEXT(
+        vkStream, rootType, (VkSampleLocationsInfoEXT*)(&forMarshaling->sampleLocationsInfo), ptr);
+}
+
+void reservedmarshal_VkPhysicalDeviceSampleLocationsPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSampleLocationsPropertiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkSampleCountFlags*)&forMarshaling->sampleLocationSampleCounts,
+           sizeof(VkSampleCountFlags));
+    *ptr += sizeof(VkSampleCountFlags);
+    reservedmarshal_VkExtent2D(vkStream, rootType,
+                               (VkExtent2D*)(&forMarshaling->maxSampleLocationGridSize), ptr);
+    memcpy(*ptr, (float*)forMarshaling->sampleLocationCoordinateRange, 2 * sizeof(float));
+    *ptr += 2 * sizeof(float);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->sampleLocationSubPixelBits, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->variableSampleLocations, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkMultisamplePropertiesEXT(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkMultisamplePropertiesEXT* forMarshaling,
+                                                uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkExtent2D(vkStream, rootType,
+                               (VkExtent2D*)(&forMarshaling->maxSampleLocationGridSize), ptr);
+}
+
+#endif
+#ifdef VK_EXT_blend_operation_advanced
+void reservedmarshal_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->advancedBlendCoherentOperations, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->advancedBlendMaxColorAttachments, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->advancedBlendIndependentBlend, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->advancedBlendNonPremultipliedSrcColor,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->advancedBlendNonPremultipliedDstColor,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->advancedBlendCorrelatedOverlap, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->advancedBlendAllOperations, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPipelineColorBlendAdvancedStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineColorBlendAdvancedStateCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->srcPremultiplied, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->dstPremultiplied, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBlendOverlapEXT*)&forMarshaling->blendOverlap, sizeof(VkBlendOverlapEXT));
+    *ptr += sizeof(VkBlendOverlapEXT);
+}
+
+#endif
+#ifdef VK_NV_fragment_coverage_to_color
+void reservedmarshal_VkPipelineCoverageToColorStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineCoverageToColorStateCreateInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineCoverageToColorStateCreateFlagsNV*)&forMarshaling->flags,
+           sizeof(VkPipelineCoverageToColorStateCreateFlagsNV));
+    *ptr += sizeof(VkPipelineCoverageToColorStateCreateFlagsNV);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->coverageToColorEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->coverageToColorLocation, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_NV_framebuffer_mixed_samples
+void reservedmarshal_VkPipelineCoverageModulationStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineCoverageModulationStateCreateInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineCoverageModulationStateCreateFlagsNV*)&forMarshaling->flags,
+           sizeof(VkPipelineCoverageModulationStateCreateFlagsNV));
+    *ptr += sizeof(VkPipelineCoverageModulationStateCreateFlagsNV);
+    memcpy(*ptr, (VkCoverageModulationModeNV*)&forMarshaling->coverageModulationMode,
+           sizeof(VkCoverageModulationModeNV));
+    *ptr += sizeof(VkCoverageModulationModeNV);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->coverageModulationTableEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->coverageModulationTableCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pCoverageModulationTable;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pCoverageModulationTable) {
+        memcpy(*ptr, (const float*)forMarshaling->pCoverageModulationTable,
+               forMarshaling->coverageModulationTableCount * sizeof(const float));
+        *ptr += forMarshaling->coverageModulationTableCount * sizeof(const float);
+    }
+}
+
+#endif
+#ifdef VK_NV_fill_rectangle
+#endif
+#ifdef VK_NV_shader_sm_builtins
+void reservedmarshal_VkPhysicalDeviceShaderSMBuiltinsPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSMBuiltinsPropertiesNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->shaderSMCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->shaderWarpsPerSM, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkPhysicalDeviceShaderSMBuiltinsFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSMBuiltinsFeaturesNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderSMBuiltins, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_post_depth_coverage
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+void reservedmarshal_VkDrmFormatModifierPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDrmFormatModifierPropertiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint64_t*)&forMarshaling->drmFormatModifier, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->drmFormatModifierPlaneCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkFormatFeatureFlags*)&forMarshaling->drmFormatModifierTilingFeatures,
+           sizeof(VkFormatFeatureFlags));
+    *ptr += sizeof(VkFormatFeatureFlags);
+}
+
+void reservedmarshal_VkDrmFormatModifierPropertiesListEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDrmFormatModifierPropertiesListEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->drmFormatModifierCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pDrmFormatModifierProperties;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pDrmFormatModifierProperties) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->drmFormatModifierCount; ++i) {
+            reservedmarshal_VkDrmFormatModifierPropertiesEXT(
+                vkStream, rootType,
+                (VkDrmFormatModifierPropertiesEXT*)(forMarshaling->pDrmFormatModifierProperties +
+                                                    i),
+                ptr);
+        }
+    }
+}
+
+void reservedmarshal_VkPhysicalDeviceImageDrmFormatModifierInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceImageDrmFormatModifierInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->drmFormatModifier, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+    memcpy(*ptr, (VkSharingMode*)&forMarshaling->sharingMode, sizeof(VkSharingMode));
+    *ptr += sizeof(VkSharingMode);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->queueFamilyIndexCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pQueueFamilyIndices;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pQueueFamilyIndices) {
+        memcpy(*ptr, (const uint32_t*)forMarshaling->pQueueFamilyIndices,
+               forMarshaling->queueFamilyIndexCount * sizeof(const uint32_t));
+        *ptr += forMarshaling->queueFamilyIndexCount * sizeof(const uint32_t);
+    }
+}
+
+void reservedmarshal_VkImageDrmFormatModifierListCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageDrmFormatModifierListCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->drmFormatModifierCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const uint64_t*)forMarshaling->pDrmFormatModifiers,
+           forMarshaling->drmFormatModifierCount * sizeof(const uint64_t));
+    *ptr += forMarshaling->drmFormatModifierCount * sizeof(const uint64_t);
+}
+
+void reservedmarshal_VkImageDrmFormatModifierExplicitCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageDrmFormatModifierExplicitCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->drmFormatModifier, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->drmFormatModifierPlaneCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->drmFormatModifierPlaneCount; ++i) {
+        reservedmarshal_VkSubresourceLayout(
+            vkStream, rootType, (const VkSubresourceLayout*)(forMarshaling->pPlaneLayouts + i),
+            ptr);
+    }
+}
+
+void reservedmarshal_VkImageDrmFormatModifierPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageDrmFormatModifierPropertiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->drmFormatModifier, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+}
+
+void reservedmarshal_VkDrmFormatModifierProperties2EXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDrmFormatModifierProperties2EXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint64_t*)&forMarshaling->drmFormatModifier, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->drmFormatModifierPlaneCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkFormatFeatureFlags2KHR*)&forMarshaling->drmFormatModifierTilingFeatures,
+           sizeof(VkFormatFeatureFlags2KHR));
+    *ptr += sizeof(VkFormatFeatureFlags2KHR);
+}
+
+void reservedmarshal_VkDrmFormatModifierPropertiesList2EXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDrmFormatModifierPropertiesList2EXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->drmFormatModifierCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pDrmFormatModifierProperties;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pDrmFormatModifierProperties) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->drmFormatModifierCount; ++i) {
+            reservedmarshal_VkDrmFormatModifierProperties2EXT(
+                vkStream, rootType,
+                (VkDrmFormatModifierProperties2EXT*)(forMarshaling->pDrmFormatModifierProperties +
+                                                     i),
+                ptr);
+        }
+    }
+}
+
+#endif
+#ifdef VK_EXT_validation_cache
+void reservedmarshal_VkValidationCacheCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkValidationCacheCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkValidationCacheCreateFlagsEXT*)&forMarshaling->flags,
+           sizeof(VkValidationCacheCreateFlagsEXT));
+    *ptr += sizeof(VkValidationCacheCreateFlagsEXT);
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->initialDataSize;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    memcpy(*ptr, (const void*)forMarshaling->pInitialData,
+           forMarshaling->initialDataSize * sizeof(const uint8_t));
+    *ptr += forMarshaling->initialDataSize * sizeof(const uint8_t);
+}
+
+void reservedmarshal_VkShaderModuleValidationCacheCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkShaderModuleValidationCacheCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkValidationCacheEXT((*&forMarshaling->validationCache));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+}
+
+#endif
+#ifdef VK_EXT_descriptor_indexing
+#endif
+#ifdef VK_EXT_shader_viewport_index_layer
+#endif
+#ifdef VK_NV_shading_rate_image
+void reservedmarshal_VkShadingRatePaletteNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkShadingRatePaletteNV* forMarshaling,
+                                            uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->shadingRatePaletteEntryCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const VkShadingRatePaletteEntryNV*)forMarshaling->pShadingRatePaletteEntries,
+           forMarshaling->shadingRatePaletteEntryCount * sizeof(const VkShadingRatePaletteEntryNV));
+    *ptr += forMarshaling->shadingRatePaletteEntryCount * sizeof(const VkShadingRatePaletteEntryNV);
+}
+
+void reservedmarshal_VkPipelineViewportShadingRateImageStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineViewportShadingRateImageStateCreateInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shadingRateImageEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->viewportCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pShadingRatePalettes;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pShadingRatePalettes) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->viewportCount; ++i) {
+            reservedmarshal_VkShadingRatePaletteNV(
+                vkStream, rootType,
+                (const VkShadingRatePaletteNV*)(forMarshaling->pShadingRatePalettes + i), ptr);
+        }
+    }
+}
+
+void reservedmarshal_VkPhysicalDeviceShadingRateImageFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShadingRateImageFeaturesNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shadingRateImage, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shadingRateCoarseSampleOrder, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceShadingRateImagePropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShadingRateImagePropertiesNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkExtent2D(vkStream, rootType,
+                               (VkExtent2D*)(&forMarshaling->shadingRateTexelSize), ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->shadingRatePaletteSize, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->shadingRateMaxCoarseSamples, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkCoarseSampleLocationNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkCoarseSampleLocationNV* forMarshaling,
+                                              uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->pixelX, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->pixelY, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->sample, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkCoarseSampleOrderCustomNV(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkCoarseSampleOrderCustomNV* forMarshaling,
+                                                 uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkShadingRatePaletteEntryNV*)&forMarshaling->shadingRate,
+           sizeof(VkShadingRatePaletteEntryNV));
+    *ptr += sizeof(VkShadingRatePaletteEntryNV);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->sampleCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->sampleLocationCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->sampleLocationCount; ++i) {
+        reservedmarshal_VkCoarseSampleLocationNV(
+            vkStream, rootType,
+            (const VkCoarseSampleLocationNV*)(forMarshaling->pSampleLocations + i), ptr);
+    }
+}
+
+void reservedmarshal_VkPipelineViewportCoarseSampleOrderStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineViewportCoarseSampleOrderStateCreateInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkCoarseSampleOrderTypeNV*)&forMarshaling->sampleOrderType,
+           sizeof(VkCoarseSampleOrderTypeNV));
+    *ptr += sizeof(VkCoarseSampleOrderTypeNV);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->customSampleOrderCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->customSampleOrderCount; ++i) {
+        reservedmarshal_VkCoarseSampleOrderCustomNV(
+            vkStream, rootType,
+            (const VkCoarseSampleOrderCustomNV*)(forMarshaling->pCustomSampleOrders + i), ptr);
+    }
+}
+
+#endif
+#ifdef VK_NV_ray_tracing
+void reservedmarshal_VkRayTracingShaderGroupCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRayTracingShaderGroupCreateInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkRayTracingShaderGroupTypeKHR*)&forMarshaling->type,
+           sizeof(VkRayTracingShaderGroupTypeKHR));
+    *ptr += sizeof(VkRayTracingShaderGroupTypeKHR);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->generalShader, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->closestHitShader, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->anyHitShader, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->intersectionShader, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkRayTracingPipelineCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRayTracingPipelineCreateInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineCreateFlags*)&forMarshaling->flags, sizeof(VkPipelineCreateFlags));
+    *ptr += sizeof(VkPipelineCreateFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->stageCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->stageCount; ++i) {
+        reservedmarshal_VkPipelineShaderStageCreateInfo(
+            vkStream, rootType,
+            (const VkPipelineShaderStageCreateInfo*)(forMarshaling->pStages + i), ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->groupCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->groupCount; ++i) {
+        reservedmarshal_VkRayTracingShaderGroupCreateInfoNV(
+            vkStream, rootType,
+            (const VkRayTracingShaderGroupCreateInfoNV*)(forMarshaling->pGroups + i), ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxRecursionDepth, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPipelineLayout((*&forMarshaling->layout));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkPipeline((*&forMarshaling->basePipelineHandle));
+    memcpy(*ptr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (int32_t*)&forMarshaling->basePipelineIndex, sizeof(int32_t));
+    *ptr += sizeof(int32_t);
+}
+
+void reservedmarshal_VkGeometryTrianglesNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkGeometryTrianglesNV* forMarshaling,
+                                           uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&forMarshaling->vertexData));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->vertexOffset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->vertexCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->vertexStride, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkFormat*)&forMarshaling->vertexFormat, sizeof(VkFormat));
+    *ptr += sizeof(VkFormat);
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkBuffer((*&forMarshaling->indexData));
+    memcpy(*ptr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->indexOffset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->indexCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkIndexType*)&forMarshaling->indexType, sizeof(VkIndexType));
+    *ptr += sizeof(VkIndexType);
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = get_host_u64_VkBuffer((*&forMarshaling->transformData));
+    memcpy(*ptr, (uint64_t*)&cgen_var_2, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->transformOffset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+}
+
+void reservedmarshal_VkGeometryAABBNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkGeometryAABBNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&forMarshaling->aabbData));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->numAABBs, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->stride, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->offset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+}
+
+void reservedmarshal_VkGeometryDataNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkGeometryDataNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    reservedmarshal_VkGeometryTrianglesNV(vkStream, rootType,
+                                          (VkGeometryTrianglesNV*)(&forMarshaling->triangles), ptr);
+    reservedmarshal_VkGeometryAABBNV(vkStream, rootType, (VkGeometryAABBNV*)(&forMarshaling->aabbs),
+                                     ptr);
+}
+
+void reservedmarshal_VkGeometryNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkGeometryNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkGeometryTypeKHR*)&forMarshaling->geometryType, sizeof(VkGeometryTypeKHR));
+    *ptr += sizeof(VkGeometryTypeKHR);
+    reservedmarshal_VkGeometryDataNV(vkStream, rootType,
+                                     (VkGeometryDataNV*)(&forMarshaling->geometry), ptr);
+    memcpy(*ptr, (VkGeometryFlagsKHR*)&forMarshaling->flags, sizeof(VkGeometryFlagsKHR));
+    *ptr += sizeof(VkGeometryFlagsKHR);
+}
+
+void reservedmarshal_VkAccelerationStructureInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkAccelerationStructureTypeNV*)&forMarshaling->type,
+           sizeof(VkAccelerationStructureTypeNV));
+    *ptr += sizeof(VkAccelerationStructureTypeNV);
+    memcpy(*ptr, (VkBuildAccelerationStructureFlagsNV*)&forMarshaling->flags,
+           sizeof(VkBuildAccelerationStructureFlagsNV));
+    *ptr += sizeof(VkBuildAccelerationStructureFlagsNV);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->instanceCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->geometryCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->geometryCount; ++i) {
+        reservedmarshal_VkGeometryNV(vkStream, rootType,
+                                     (const VkGeometryNV*)(forMarshaling->pGeometries + i), ptr);
+    }
+}
+
+void reservedmarshal_VkAccelerationStructureCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureCreateInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->compactedSize, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    reservedmarshal_VkAccelerationStructureInfoNV(
+        vkStream, rootType, (VkAccelerationStructureInfoNV*)(&forMarshaling->info), ptr);
+}
+
+void reservedmarshal_VkBindAccelerationStructureMemoryInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBindAccelerationStructureMemoryInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkAccelerationStructureNV((*&forMarshaling->accelerationStructure));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkDeviceMemory((*&forMarshaling->memory));
+    memcpy(*ptr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->memoryOffset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->deviceIndexCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const uint32_t*)forMarshaling->pDeviceIndices,
+           forMarshaling->deviceIndexCount * sizeof(const uint32_t));
+    *ptr += forMarshaling->deviceIndexCount * sizeof(const uint32_t);
+}
+
+void reservedmarshal_VkWriteDescriptorSetAccelerationStructureNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkWriteDescriptorSetAccelerationStructureNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->accelerationStructureCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pAccelerationStructures;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pAccelerationStructures) {
+        if (forMarshaling->accelerationStructureCount) {
+            uint8_t* cgen_var_0_0_ptr = (uint8_t*)(*ptr);
+            if (forMarshaling) {
+                for (uint32_t k = 0; k < forMarshaling->accelerationStructureCount; ++k) {
+                    uint64_t tmpval = get_host_u64_VkAccelerationStructureNV(
+                        forMarshaling->pAccelerationStructures[k]);
+                    memcpy(cgen_var_0_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+                }
+            }
+            *ptr += 8 * forMarshaling->accelerationStructureCount;
+        }
+    }
+}
+
+void reservedmarshal_VkAccelerationStructureMemoryRequirementsInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureMemoryRequirementsInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkAccelerationStructureMemoryRequirementsTypeNV*)&forMarshaling->type,
+           sizeof(VkAccelerationStructureMemoryRequirementsTypeNV));
+    *ptr += sizeof(VkAccelerationStructureMemoryRequirementsTypeNV);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkAccelerationStructureNV((*&forMarshaling->accelerationStructure));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+}
+
+void reservedmarshal_VkPhysicalDeviceRayTracingPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingPropertiesNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->shaderGroupHandleSize, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxRecursionDepth, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxShaderGroupStride, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->shaderGroupBaseAlignment, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->maxGeometryCount, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->maxInstanceCount, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->maxTriangleCount, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetAccelerationStructures,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkTransformMatrixKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkTransformMatrixKHR* forMarshaling,
+                                          uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (float*)forMarshaling->matrix, ((3) * (4)) * sizeof(float));
+    *ptr += ((3) * (4)) * sizeof(float);
+}
+
+void reservedmarshal_VkAabbPositionsKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkAabbPositionsKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (float*)&forMarshaling->minX, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->minY, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->minZ, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->maxX, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->maxY, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->maxZ, sizeof(float));
+    *ptr += sizeof(float);
+}
+
+void reservedmarshal_VkAccelerationStructureInstanceKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureInstanceKHR* forMarshaling, uint8_t** ptr) {
+    typedef struct VkAccelerationStructureInstanceKHRWithoutBitFields {
+        VkTransformMatrixKHR transform;
+        uint32_t dwords[2];
+        uint64_t accelerationStructureReference;
+    } VkAccelerationStructureInstanceKHRWithoutBitFields;
+
+    (void)vkStream;
+    const VkAccelerationStructureInstanceKHRWithoutBitFields* forMarshaling_new =
+        (const VkAccelerationStructureInstanceKHRWithoutBitFields*)(forMarshaling);
+    reservedmarshal_VkTransformMatrixKHR(
+        vkStream, rootType, (VkTransformMatrixKHR*)(&forMarshaling_new->transform), ptr);
+    for (uint32_t i = 0; i < 2; i++) {
+        memcpy(*ptr, (uint32_t*)&(forMarshaling_new->dwords[i]), sizeof(uint32_t));
+        *ptr += sizeof(uint32_t);
+    }
+    memcpy(*ptr, (uint64_t*)&forMarshaling_new->accelerationStructureReference, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+}
+
+#endif
+#ifdef VK_NV_representative_fragment_test
+void reservedmarshal_VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->representativeFragmentTest, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPipelineRepresentativeFragmentTestStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRepresentativeFragmentTestStateCreateInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->representativeFragmentTestEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_filter_cubic
+void reservedmarshal_VkPhysicalDeviceImageViewImageFormatInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceImageViewImageFormatInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkImageViewType*)&forMarshaling->imageViewType, sizeof(VkImageViewType));
+    *ptr += sizeof(VkImageViewType);
+}
+
+void reservedmarshal_VkFilterCubicImageViewImageFormatPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkFilterCubicImageViewImageFormatPropertiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->filterCubic, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->filterCubicMinmax, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_QCOM_render_pass_shader_resolve
+#endif
+#ifdef VK_EXT_global_priority
+void reservedmarshal_VkDeviceQueueGlobalPriorityCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceQueueGlobalPriorityCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkQueueGlobalPriorityEXT*)&forMarshaling->globalPriority,
+           sizeof(VkQueueGlobalPriorityEXT));
+    *ptr += sizeof(VkQueueGlobalPriorityEXT);
+}
+
+#endif
+#ifdef VK_EXT_external_memory_host
+void reservedmarshal_VkImportMemoryHostPointerInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportMemoryHostPointerInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkExternalMemoryHandleTypeFlagBits*)&forMarshaling->handleType,
+           sizeof(VkExternalMemoryHandleTypeFlagBits));
+    *ptr += sizeof(VkExternalMemoryHandleTypeFlagBits);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pHostPointer;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pHostPointer) {
+        memcpy(*ptr, (void*)forMarshaling->pHostPointer, sizeof(uint8_t));
+        *ptr += sizeof(uint8_t);
+    }
+}
+
+void reservedmarshal_VkMemoryHostPointerPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryHostPointerPropertiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->memoryTypeBits, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkPhysicalDeviceExternalMemoryHostPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExternalMemoryHostPropertiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->minImportedHostPointerAlignment,
+           sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+}
+
+#endif
+#ifdef VK_AMD_buffer_marker
+#endif
+#ifdef VK_AMD_pipeline_compiler_control
+void reservedmarshal_VkPipelineCompilerControlCreateInfoAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineCompilerControlCreateInfoAMD* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineCompilerControlFlagsAMD*)&forMarshaling->compilerControlFlags,
+           sizeof(VkPipelineCompilerControlFlagsAMD));
+    *ptr += sizeof(VkPipelineCompilerControlFlagsAMD);
+}
+
+#endif
+#ifdef VK_EXT_calibrated_timestamps
+void reservedmarshal_VkCalibratedTimestampInfoEXT(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkCalibratedTimestampInfoEXT* forMarshaling,
+                                                  uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkTimeDomainEXT*)&forMarshaling->timeDomain, sizeof(VkTimeDomainEXT));
+    *ptr += sizeof(VkTimeDomainEXT);
+}
+
+#endif
+#ifdef VK_AMD_shader_core_properties
+void reservedmarshal_VkPhysicalDeviceShaderCorePropertiesAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderCorePropertiesAMD* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->shaderEngineCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->shaderArraysPerEngineCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->computeUnitsPerShaderArray, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->simdPerComputeUnit, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->wavefrontsPerSimd, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->wavefrontSize, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->sgprsPerSimd, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->minSgprAllocation, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxSgprAllocation, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->sgprAllocationGranularity, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->vgprsPerSimd, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->minVgprAllocation, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxVgprAllocation, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->vgprAllocationGranularity, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_EXT_video_decode_h265
+void reservedmarshal_VkVideoDecodeH265ProfileEXT(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkVideoDecodeH265ProfileEXT* forMarshaling,
+                                                 uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (StdVideoH265ProfileIdc*)&forMarshaling->stdProfileIdc,
+           sizeof(StdVideoH265ProfileIdc));
+    *ptr += sizeof(StdVideoH265ProfileIdc);
+}
+
+void reservedmarshal_VkVideoDecodeH265CapabilitiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH265CapabilitiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxLevel, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    reservedmarshal_VkExtensionProperties(
+        vkStream, rootType, (VkExtensionProperties*)(&forMarshaling->stdExtensionVersion), ptr);
+}
+
+void reservedmarshal_VkVideoDecodeH265SessionCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH265SessionCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkVideoDecodeH265CreateFlagsEXT*)&forMarshaling->flags,
+           sizeof(VkVideoDecodeH265CreateFlagsEXT));
+    *ptr += sizeof(VkVideoDecodeH265CreateFlagsEXT);
+    reservedmarshal_VkExtensionProperties(
+        vkStream, rootType, (const VkExtensionProperties*)(forMarshaling->pStdExtensionVersion),
+        ptr);
+}
+
+void reservedmarshal_VkVideoDecodeH265SessionParametersAddInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH265SessionParametersAddInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->spsStdCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pSpsStd;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pSpsStd) {
+        memcpy(*ptr, (const StdVideoH265SequenceParameterSet*)forMarshaling->pSpsStd,
+               forMarshaling->spsStdCount * sizeof(const StdVideoH265SequenceParameterSet));
+        *ptr += forMarshaling->spsStdCount * sizeof(const StdVideoH265SequenceParameterSet);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->ppsStdCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pPpsStd;
+    memcpy((*ptr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pPpsStd) {
+        memcpy(*ptr, (const StdVideoH265PictureParameterSet*)forMarshaling->pPpsStd,
+               forMarshaling->ppsStdCount * sizeof(const StdVideoH265PictureParameterSet));
+        *ptr += forMarshaling->ppsStdCount * sizeof(const StdVideoH265PictureParameterSet);
+    }
+}
+
+void reservedmarshal_VkVideoDecodeH265SessionParametersCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH265SessionParametersCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxSpsStdCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPpsStdCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pParametersAddInfo;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pParametersAddInfo) {
+        reservedmarshal_VkVideoDecodeH265SessionParametersAddInfoEXT(
+            vkStream, rootType,
+            (const VkVideoDecodeH265SessionParametersAddInfoEXT*)(forMarshaling
+                                                                      ->pParametersAddInfo),
+            ptr);
+    }
+}
+
+void reservedmarshal_VkVideoDecodeH265PictureInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH265PictureInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (StdVideoDecodeH265PictureInfo*)forMarshaling->pStdPictureInfo,
+           sizeof(StdVideoDecodeH265PictureInfo));
+    *ptr += sizeof(StdVideoDecodeH265PictureInfo);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->slicesCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const uint32_t*)forMarshaling->pSlicesDataOffsets,
+           forMarshaling->slicesCount * sizeof(const uint32_t));
+    *ptr += forMarshaling->slicesCount * sizeof(const uint32_t);
+}
+
+void reservedmarshal_VkVideoDecodeH265DpbSlotInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH265DpbSlotInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (const StdVideoDecodeH265ReferenceInfo*)forMarshaling->pStdReferenceInfo,
+           sizeof(const StdVideoDecodeH265ReferenceInfo));
+    *ptr += sizeof(const StdVideoDecodeH265ReferenceInfo);
+}
+
+#endif
+#ifdef VK_AMD_memory_overallocation_behavior
+void reservedmarshal_VkDeviceMemoryOverallocationCreateInfoAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceMemoryOverallocationCreateInfoAMD* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkMemoryOverallocationBehaviorAMD*)&forMarshaling->overallocationBehavior,
+           sizeof(VkMemoryOverallocationBehaviorAMD));
+    *ptr += sizeof(VkMemoryOverallocationBehaviorAMD);
+}
+
+#endif
+#ifdef VK_EXT_vertex_attribute_divisor
+void reservedmarshal_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxVertexAttribDivisor, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkVertexInputBindingDivisorDescriptionEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVertexInputBindingDivisorDescriptionEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->binding, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->divisor, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkPipelineVertexInputDivisorStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineVertexInputDivisorStateCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->vertexBindingDivisorCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->vertexBindingDivisorCount; ++i) {
+        reservedmarshal_VkVertexInputBindingDivisorDescriptionEXT(
+            vkStream, rootType,
+            (const VkVertexInputBindingDivisorDescriptionEXT*)(forMarshaling
+                                                                   ->pVertexBindingDivisors +
+                                                               i),
+            ptr);
+    }
+}
+
+void reservedmarshal_VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->vertexAttributeInstanceRateDivisor, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->vertexAttributeInstanceRateZeroDivisor,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_GGP_frame_token
+void reservedmarshal_VkPresentFrameTokenGGP(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkPresentFrameTokenGGP* forMarshaling,
+                                            uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (GgpFrameToken*)&forMarshaling->frameToken, sizeof(GgpFrameToken));
+    *ptr += sizeof(GgpFrameToken);
+}
+
+#endif
+#ifdef VK_EXT_pipeline_creation_feedback
+void reservedmarshal_VkPipelineCreationFeedbackEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineCreationFeedbackEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkPipelineCreationFeedbackFlagsEXT*)&forMarshaling->flags,
+           sizeof(VkPipelineCreationFeedbackFlagsEXT));
+    *ptr += sizeof(VkPipelineCreationFeedbackFlagsEXT);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->duration, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+}
+
+void reservedmarshal_VkPipelineCreationFeedbackCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineCreationFeedbackCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkPipelineCreationFeedbackEXT(
+        vkStream, rootType,
+        (VkPipelineCreationFeedbackEXT*)(forMarshaling->pPipelineCreationFeedback), ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->pipelineStageCreationFeedbackCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->pipelineStageCreationFeedbackCount; ++i) {
+        reservedmarshal_VkPipelineCreationFeedbackEXT(
+            vkStream, rootType,
+            (VkPipelineCreationFeedbackEXT*)(forMarshaling->pPipelineStageCreationFeedbacks + i),
+            ptr);
+    }
+}
+
+#endif
+#ifdef VK_NV_shader_subgroup_partitioned
+#endif
+#ifdef VK_NV_compute_shader_derivatives
+void reservedmarshal_VkPhysicalDeviceComputeShaderDerivativesFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceComputeShaderDerivativesFeaturesNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->computeDerivativeGroupQuads, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->computeDerivativeGroupLinear, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_NV_mesh_shader
+void reservedmarshal_VkPhysicalDeviceMeshShaderFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMeshShaderFeaturesNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->taskShader, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->meshShader, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceMeshShaderPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMeshShaderPropertiesNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDrawMeshTasksCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxTaskWorkGroupInvocations, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)forMarshaling->maxTaskWorkGroupSize, 3 * sizeof(uint32_t));
+    *ptr += 3 * sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxTaskTotalMemorySize, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxTaskOutputCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxMeshWorkGroupInvocations, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)forMarshaling->maxMeshWorkGroupSize, 3 * sizeof(uint32_t));
+    *ptr += 3 * sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxMeshTotalMemorySize, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxMeshOutputVertices, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxMeshOutputPrimitives, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxMeshMultiviewViewCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->meshOutputPerVertexGranularity, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->meshOutputPerPrimitiveGranularity, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkDrawMeshTasksIndirectCommandNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDrawMeshTasksIndirectCommandNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->taskCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->firstTask, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_NV_fragment_shader_barycentric
+void reservedmarshal_VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->fragmentShaderBarycentric, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_NV_shader_image_footprint
+void reservedmarshal_VkPhysicalDeviceShaderImageFootprintFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderImageFootprintFeaturesNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->imageFootprint, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_NV_scissor_exclusive
+void reservedmarshal_VkPipelineViewportExclusiveScissorStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineViewportExclusiveScissorStateCreateInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->exclusiveScissorCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pExclusiveScissors;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pExclusiveScissors) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->exclusiveScissorCount; ++i) {
+            reservedmarshal_VkRect2D(vkStream, rootType,
+                                     (const VkRect2D*)(forMarshaling->pExclusiveScissors + i), ptr);
+        }
+    }
+}
+
+void reservedmarshal_VkPhysicalDeviceExclusiveScissorFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExclusiveScissorFeaturesNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->exclusiveScissor, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+void reservedmarshal_VkQueueFamilyCheckpointPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkQueueFamilyCheckpointPropertiesNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineStageFlags*)&forMarshaling->checkpointExecutionStageMask,
+           sizeof(VkPipelineStageFlags));
+    *ptr += sizeof(VkPipelineStageFlags);
+}
+
+void reservedmarshal_VkCheckpointDataNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkCheckpointDataNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineStageFlagBits*)&forMarshaling->stage, sizeof(VkPipelineStageFlagBits));
+    *ptr += sizeof(VkPipelineStageFlagBits);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pCheckpointMarker;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pCheckpointMarker) {
+        memcpy(*ptr, (void*)forMarshaling->pCheckpointMarker, sizeof(uint8_t));
+        *ptr += sizeof(uint8_t);
+    }
+}
+
+#endif
+#ifdef VK_INTEL_shader_integer_functions2
+void reservedmarshal_VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderIntegerFunctions2, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_INTEL_performance_query
+void reservedmarshal_VkPerformanceValueDataINTEL(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkPerformanceValueDataINTEL* forMarshaling,
+                                                 uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->value32, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkPerformanceValueINTEL(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkPerformanceValueINTEL* forMarshaling,
+                                             uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkPerformanceValueTypeINTEL*)&forMarshaling->type,
+           sizeof(VkPerformanceValueTypeINTEL));
+    *ptr += sizeof(VkPerformanceValueTypeINTEL);
+    reservedmarshal_VkPerformanceValueDataINTEL(
+        vkStream, rootType, (VkPerformanceValueDataINTEL*)(&forMarshaling->data), ptr);
+}
+
+void reservedmarshal_VkInitializePerformanceApiInfoINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkInitializePerformanceApiInfoINTEL* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pUserData;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pUserData) {
+        memcpy(*ptr, (void*)forMarshaling->pUserData, sizeof(uint8_t));
+        *ptr += sizeof(uint8_t);
+    }
+}
+
+void reservedmarshal_VkQueryPoolPerformanceQueryCreateInfoINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkQueryPoolPerformanceQueryCreateInfoINTEL* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkQueryPoolSamplingModeINTEL*)&forMarshaling->performanceCountersSampling,
+           sizeof(VkQueryPoolSamplingModeINTEL));
+    *ptr += sizeof(VkQueryPoolSamplingModeINTEL);
+}
+
+void reservedmarshal_VkPerformanceMarkerInfoINTEL(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkPerformanceMarkerInfoINTEL* forMarshaling,
+                                                  uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->marker, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+}
+
+void reservedmarshal_VkPerformanceStreamMarkerInfoINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPerformanceStreamMarkerInfoINTEL* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->marker, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkPerformanceOverrideInfoINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPerformanceOverrideInfoINTEL* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPerformanceOverrideTypeINTEL*)&forMarshaling->type,
+           sizeof(VkPerformanceOverrideTypeINTEL));
+    *ptr += sizeof(VkPerformanceOverrideTypeINTEL);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->enable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->parameter, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+}
+
+void reservedmarshal_VkPerformanceConfigurationAcquireInfoINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPerformanceConfigurationAcquireInfoINTEL* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPerformanceConfigurationTypeINTEL*)&forMarshaling->type,
+           sizeof(VkPerformanceConfigurationTypeINTEL));
+    *ptr += sizeof(VkPerformanceConfigurationTypeINTEL);
+}
+
+#endif
+#ifdef VK_EXT_pci_bus_info
+void reservedmarshal_VkPhysicalDevicePCIBusInfoPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePCIBusInfoPropertiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->pciDomain, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->pciBus, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->pciDevice, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->pciFunction, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_AMD_display_native_hdr
+void reservedmarshal_VkDisplayNativeHdrSurfaceCapabilitiesAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDisplayNativeHdrSurfaceCapabilitiesAMD* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->localDimmingSupport, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkSwapchainDisplayNativeHdrCreateInfoAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSwapchainDisplayNativeHdrCreateInfoAMD* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->localDimmingEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_FUCHSIA_imagepipe_surface
+void reservedmarshal_VkImagePipeSurfaceCreateInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImagePipeSurfaceCreateInfoFUCHSIA* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkImagePipeSurfaceCreateFlagsFUCHSIA*)&forMarshaling->flags,
+           sizeof(VkImagePipeSurfaceCreateFlagsFUCHSIA));
+    *ptr += sizeof(VkImagePipeSurfaceCreateFlagsFUCHSIA);
+    memcpy(*ptr, (zx_handle_t*)&forMarshaling->imagePipeHandle, sizeof(zx_handle_t));
+    *ptr += sizeof(zx_handle_t);
+}
+
+#endif
+#ifdef VK_EXT_metal_surface
+void reservedmarshal_VkMetalSurfaceCreateInfoEXT(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkMetalSurfaceCreateInfoEXT* forMarshaling,
+                                                 uint8_t** ptr) {
+    // This struct should never be marshaled / unmarshaled.
+    __builtin_trap();
+}
+
+#endif
+#ifdef VK_EXT_fragment_density_map
+void reservedmarshal_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMapFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->fragmentDensityMap, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->fragmentDensityMapDynamic, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->fragmentDensityMapNonSubsampledImages,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMapPropertiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkExtent2D(vkStream, rootType,
+                               (VkExtent2D*)(&forMarshaling->minFragmentDensityTexelSize), ptr);
+    reservedmarshal_VkExtent2D(vkStream, rootType,
+                               (VkExtent2D*)(&forMarshaling->maxFragmentDensityTexelSize), ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->fragmentDensityInvocations, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkRenderPassFragmentDensityMapCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRenderPassFragmentDensityMapCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkAttachmentReference(
+        vkStream, rootType, (VkAttachmentReference*)(&forMarshaling->fragmentDensityMapAttachment),
+        ptr);
+}
+
+#endif
+#ifdef VK_EXT_scalar_block_layout
+#endif
+#ifdef VK_GOOGLE_hlsl_functionality1
+#endif
+#ifdef VK_GOOGLE_decorate_string
+#endif
+#ifdef VK_EXT_subgroup_size_control
+void reservedmarshal_VkPhysicalDeviceSubgroupSizeControlFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSubgroupSizeControlFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->subgroupSizeControl, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->computeFullSubgroups, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceSubgroupSizeControlPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSubgroupSizeControlPropertiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->minSubgroupSize, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxSubgroupSize, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxComputeWorkgroupSubgroups, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkShaderStageFlags*)&forMarshaling->requiredSubgroupSizeStages,
+           sizeof(VkShaderStageFlags));
+    *ptr += sizeof(VkShaderStageFlags);
+}
+
+void reservedmarshal_VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->requiredSubgroupSize, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_AMD_shader_core_properties2
+void reservedmarshal_VkPhysicalDeviceShaderCoreProperties2AMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderCoreProperties2AMD* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkShaderCorePropertiesFlagsAMD*)&forMarshaling->shaderCoreFeatures,
+           sizeof(VkShaderCorePropertiesFlagsAMD));
+    *ptr += sizeof(VkShaderCorePropertiesFlagsAMD);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->activeComputeUnitCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_AMD_device_coherent_memory
+void reservedmarshal_VkPhysicalDeviceCoherentMemoryFeaturesAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceCoherentMemoryFeaturesAMD* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->deviceCoherentMemory, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_shader_image_atomic_int64
+void reservedmarshal_VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderImageInt64Atomics, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->sparseImageInt64Atomics, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_memory_budget
+void reservedmarshal_VkPhysicalDeviceMemoryBudgetPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMemoryBudgetPropertiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDeviceSize*)forMarshaling->heapBudget,
+           VK_MAX_MEMORY_HEAPS * sizeof(VkDeviceSize));
+    *ptr += VK_MAX_MEMORY_HEAPS * sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)forMarshaling->heapUsage,
+           VK_MAX_MEMORY_HEAPS * sizeof(VkDeviceSize));
+    *ptr += VK_MAX_MEMORY_HEAPS * sizeof(VkDeviceSize);
+}
+
+#endif
+#ifdef VK_EXT_memory_priority
+void reservedmarshal_VkPhysicalDeviceMemoryPriorityFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMemoryPriorityFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->memoryPriority, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkMemoryPriorityAllocateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryPriorityAllocateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (float*)&forMarshaling->priority, sizeof(float));
+    *ptr += sizeof(float);
+}
+
+#endif
+#ifdef VK_NV_dedicated_allocation_image_aliasing
+void reservedmarshal_VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV* forMarshaling,
+    uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->dedicatedAllocationImageAliasing, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_buffer_device_address
+void reservedmarshal_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->bufferDeviceAddress, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->bufferDeviceAddressCaptureReplay, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->bufferDeviceAddressMultiDevice, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkBufferDeviceAddressCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferDeviceAddressCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDeviceAddress*)&forMarshaling->deviceAddress, sizeof(VkDeviceAddress));
+    *ptr += sizeof(VkDeviceAddress);
+}
+
+#endif
+#ifdef VK_EXT_tooling_info
+void reservedmarshal_VkPhysicalDeviceToolPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceToolPropertiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (char*)forMarshaling->name, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
+    *ptr += VK_MAX_EXTENSION_NAME_SIZE * sizeof(char);
+    memcpy(*ptr, (char*)forMarshaling->version, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
+    *ptr += VK_MAX_EXTENSION_NAME_SIZE * sizeof(char);
+    memcpy(*ptr, (VkToolPurposeFlagsEXT*)&forMarshaling->purposes, sizeof(VkToolPurposeFlagsEXT));
+    *ptr += sizeof(VkToolPurposeFlagsEXT);
+    memcpy(*ptr, (char*)forMarshaling->description, VK_MAX_DESCRIPTION_SIZE * sizeof(char));
+    *ptr += VK_MAX_DESCRIPTION_SIZE * sizeof(char);
+    memcpy(*ptr, (char*)forMarshaling->layer, VK_MAX_EXTENSION_NAME_SIZE * sizeof(char));
+    *ptr += VK_MAX_EXTENSION_NAME_SIZE * sizeof(char);
+}
+
+#endif
+#ifdef VK_EXT_separate_stencil_usage
+#endif
+#ifdef VK_EXT_validation_features
+void reservedmarshal_VkValidationFeaturesEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkValidationFeaturesEXT* forMarshaling,
+                                             uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->enabledValidationFeatureCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(
+        *ptr, (const VkValidationFeatureEnableEXT*)forMarshaling->pEnabledValidationFeatures,
+        forMarshaling->enabledValidationFeatureCount * sizeof(const VkValidationFeatureEnableEXT));
+    *ptr +=
+        forMarshaling->enabledValidationFeatureCount * sizeof(const VkValidationFeatureEnableEXT);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->disabledValidationFeatureCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const VkValidationFeatureDisableEXT*)forMarshaling->pDisabledValidationFeatures,
+           forMarshaling->disabledValidationFeatureCount *
+               sizeof(const VkValidationFeatureDisableEXT));
+    *ptr +=
+        forMarshaling->disabledValidationFeatureCount * sizeof(const VkValidationFeatureDisableEXT);
+}
+
+#endif
+#ifdef VK_NV_cooperative_matrix
+void reservedmarshal_VkCooperativeMatrixPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCooperativeMatrixPropertiesNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->MSize, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->NSize, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->KSize, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkComponentTypeNV*)&forMarshaling->AType, sizeof(VkComponentTypeNV));
+    *ptr += sizeof(VkComponentTypeNV);
+    memcpy(*ptr, (VkComponentTypeNV*)&forMarshaling->BType, sizeof(VkComponentTypeNV));
+    *ptr += sizeof(VkComponentTypeNV);
+    memcpy(*ptr, (VkComponentTypeNV*)&forMarshaling->CType, sizeof(VkComponentTypeNV));
+    *ptr += sizeof(VkComponentTypeNV);
+    memcpy(*ptr, (VkComponentTypeNV*)&forMarshaling->DType, sizeof(VkComponentTypeNV));
+    *ptr += sizeof(VkComponentTypeNV);
+    memcpy(*ptr, (VkScopeNV*)&forMarshaling->scope, sizeof(VkScopeNV));
+    *ptr += sizeof(VkScopeNV);
+}
+
+void reservedmarshal_VkPhysicalDeviceCooperativeMatrixFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceCooperativeMatrixFeaturesNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->cooperativeMatrix, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->cooperativeMatrixRobustBufferAccess, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceCooperativeMatrixPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceCooperativeMatrixPropertiesNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkShaderStageFlags*)&forMarshaling->cooperativeMatrixSupportedStages,
+           sizeof(VkShaderStageFlags));
+    *ptr += sizeof(VkShaderStageFlags);
+}
+
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+void reservedmarshal_VkPhysicalDeviceCoverageReductionModeFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceCoverageReductionModeFeaturesNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->coverageReductionMode, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPipelineCoverageReductionStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineCoverageReductionStateCreateInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineCoverageReductionStateCreateFlagsNV*)&forMarshaling->flags,
+           sizeof(VkPipelineCoverageReductionStateCreateFlagsNV));
+    *ptr += sizeof(VkPipelineCoverageReductionStateCreateFlagsNV);
+    memcpy(*ptr, (VkCoverageReductionModeNV*)&forMarshaling->coverageReductionMode,
+           sizeof(VkCoverageReductionModeNV));
+    *ptr += sizeof(VkCoverageReductionModeNV);
+}
+
+void reservedmarshal_VkFramebufferMixedSamplesCombinationNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkFramebufferMixedSamplesCombinationNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkCoverageReductionModeNV*)&forMarshaling->coverageReductionMode,
+           sizeof(VkCoverageReductionModeNV));
+    *ptr += sizeof(VkCoverageReductionModeNV);
+    memcpy(*ptr, (VkSampleCountFlagBits*)&forMarshaling->rasterizationSamples,
+           sizeof(VkSampleCountFlagBits));
+    *ptr += sizeof(VkSampleCountFlagBits);
+    memcpy(*ptr, (VkSampleCountFlags*)&forMarshaling->depthStencilSamples,
+           sizeof(VkSampleCountFlags));
+    *ptr += sizeof(VkSampleCountFlags);
+    memcpy(*ptr, (VkSampleCountFlags*)&forMarshaling->colorSamples, sizeof(VkSampleCountFlags));
+    *ptr += sizeof(VkSampleCountFlags);
+}
+
+#endif
+#ifdef VK_EXT_fragment_shader_interlock
+void reservedmarshal_VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->fragmentShaderSampleInterlock, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->fragmentShaderPixelInterlock, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->fragmentShaderShadingRateInterlock, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_ycbcr_image_arrays
+void reservedmarshal_VkPhysicalDeviceYcbcrImageArraysFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->ycbcrImageArrays, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_provoking_vertex
+void reservedmarshal_VkPhysicalDeviceProvokingVertexFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceProvokingVertexFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->provokingVertexLast, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->transformFeedbackPreservesProvokingVertex,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceProvokingVertexPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceProvokingVertexPropertiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->provokingVertexModePerPipeline, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->transformFeedbackPreservesTriangleFanProvokingVertex,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkProvokingVertexModeEXT*)&forMarshaling->provokingVertexMode,
+           sizeof(VkProvokingVertexModeEXT));
+    *ptr += sizeof(VkProvokingVertexModeEXT);
+}
+
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+void reservedmarshal_VkSurfaceFullScreenExclusiveInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSurfaceFullScreenExclusiveInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkFullScreenExclusiveEXT*)&forMarshaling->fullScreenExclusive,
+           sizeof(VkFullScreenExclusiveEXT));
+    *ptr += sizeof(VkFullScreenExclusiveEXT);
+}
+
+void reservedmarshal_VkSurfaceCapabilitiesFullScreenExclusiveEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSurfaceCapabilitiesFullScreenExclusiveEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->fullScreenExclusiveSupported, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkSurfaceFullScreenExclusiveWin32InfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSurfaceFullScreenExclusiveWin32InfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (HMONITOR*)&forMarshaling->hmonitor, sizeof(HMONITOR));
+    *ptr += sizeof(HMONITOR);
+}
+
+#endif
+#ifdef VK_EXT_headless_surface
+void reservedmarshal_VkHeadlessSurfaceCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkHeadlessSurfaceCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkHeadlessSurfaceCreateFlagsEXT*)&forMarshaling->flags,
+           sizeof(VkHeadlessSurfaceCreateFlagsEXT));
+    *ptr += sizeof(VkHeadlessSurfaceCreateFlagsEXT);
+}
+
+#endif
+#ifdef VK_EXT_line_rasterization
+void reservedmarshal_VkPhysicalDeviceLineRasterizationFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceLineRasterizationFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->rectangularLines, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->bresenhamLines, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->smoothLines, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->stippledRectangularLines, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->stippledBresenhamLines, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->stippledSmoothLines, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceLineRasterizationPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceLineRasterizationPropertiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->lineSubPixelPrecisionBits, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkPipelineRasterizationLineStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRasterizationLineStateCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkLineRasterizationModeEXT*)&forMarshaling->lineRasterizationMode,
+           sizeof(VkLineRasterizationModeEXT));
+    *ptr += sizeof(VkLineRasterizationModeEXT);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->stippledLineEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->lineStippleFactor, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint16_t*)&forMarshaling->lineStipplePattern, sizeof(uint16_t));
+    *ptr += sizeof(uint16_t);
+}
+
+#endif
+#ifdef VK_EXT_shader_atomic_float
+void reservedmarshal_VkPhysicalDeviceShaderAtomicFloatFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderBufferFloat32Atomics, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderBufferFloat32AtomicAdd, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderBufferFloat64Atomics, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderBufferFloat64AtomicAdd, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderSharedFloat32Atomics, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderSharedFloat32AtomicAdd, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderSharedFloat64Atomics, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderSharedFloat64AtomicAdd, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderImageFloat32Atomics, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderImageFloat32AtomicAdd, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->sparseImageFloat32Atomics, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->sparseImageFloat32AtomicAdd, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_host_query_reset
+#endif
+#ifdef VK_EXT_index_type_uint8
+void reservedmarshal_VkPhysicalDeviceIndexTypeUint8FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceIndexTypeUint8FeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->indexTypeUint8, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+void reservedmarshal_VkPhysicalDeviceExtendedDynamicStateFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->extendedDynamicState, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_shader_atomic_float2
+void reservedmarshal_VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderBufferFloat16Atomics, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderBufferFloat16AtomicAdd, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderBufferFloat16AtomicMinMax, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderBufferFloat32AtomicMinMax, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderBufferFloat64AtomicMinMax, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderSharedFloat16Atomics, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderSharedFloat16AtomicAdd, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderSharedFloat16AtomicMinMax, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderSharedFloat32AtomicMinMax, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderSharedFloat64AtomicMinMax, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderImageFloat32AtomicMinMax, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->sparseImageFloat32AtomicMinMax, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_shader_demote_to_helper_invocation
+void reservedmarshal_VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->shaderDemoteToHelperInvocation, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_NV_device_generated_commands
+void reservedmarshal_VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxGraphicsShaderGroupCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxIndirectSequenceCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxIndirectCommandsTokenCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxIndirectCommandsStreamCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxIndirectCommandsTokenOffset, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxIndirectCommandsStreamStride, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->minSequencesCountBufferOffsetAlignment,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->minSequencesIndexBufferOffsetAlignment,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->minIndirectCommandsBufferOffsetAlignment,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->deviceGeneratedCommands, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkGraphicsShaderGroupCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkGraphicsShaderGroupCreateInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->stageCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->stageCount; ++i) {
+        reservedmarshal_VkPipelineShaderStageCreateInfo(
+            vkStream, rootType,
+            (const VkPipelineShaderStageCreateInfo*)(forMarshaling->pStages + i), ptr);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pVertexInputState;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pVertexInputState) {
+        reservedmarshal_VkPipelineVertexInputStateCreateInfo(
+            vkStream, rootType,
+            (const VkPipelineVertexInputStateCreateInfo*)(forMarshaling->pVertexInputState), ptr);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pTessellationState;
+    memcpy((*ptr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pTessellationState) {
+        reservedmarshal_VkPipelineTessellationStateCreateInfo(
+            vkStream, rootType,
+            (const VkPipelineTessellationStateCreateInfo*)(forMarshaling->pTessellationState), ptr);
+    }
+}
+
+void reservedmarshal_VkGraphicsPipelineShaderGroupsCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkGraphicsPipelineShaderGroupsCreateInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->groupCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->groupCount; ++i) {
+        reservedmarshal_VkGraphicsShaderGroupCreateInfoNV(
+            vkStream, rootType,
+            (const VkGraphicsShaderGroupCreateInfoNV*)(forMarshaling->pGroups + i), ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->pipelineCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    if (forMarshaling->pipelineCount) {
+        uint8_t* cgen_var_0_ptr = (uint8_t*)(*ptr);
+        if (forMarshaling) {
+            for (uint32_t k = 0; k < forMarshaling->pipelineCount; ++k) {
+                uint64_t tmpval = get_host_u64_VkPipeline(forMarshaling->pPipelines[k]);
+                memcpy(cgen_var_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+            }
+        }
+        *ptr += 8 * forMarshaling->pipelineCount;
+    }
+}
+
+void reservedmarshal_VkBindShaderGroupIndirectCommandNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBindShaderGroupIndirectCommandNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->groupIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkBindIndexBufferIndirectCommandNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBindIndexBufferIndirectCommandNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkDeviceAddress*)&forMarshaling->bufferAddress, sizeof(VkDeviceAddress));
+    *ptr += sizeof(VkDeviceAddress);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->size, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkIndexType*)&forMarshaling->indexType, sizeof(VkIndexType));
+    *ptr += sizeof(VkIndexType);
+}
+
+void reservedmarshal_VkBindVertexBufferIndirectCommandNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBindVertexBufferIndirectCommandNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkDeviceAddress*)&forMarshaling->bufferAddress, sizeof(VkDeviceAddress));
+    *ptr += sizeof(VkDeviceAddress);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->size, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->stride, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkSetStateFlagsIndirectCommandNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSetStateFlagsIndirectCommandNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->data, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkIndirectCommandsStreamNV(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkIndirectCommandsStreamNV* forMarshaling,
+                                                uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&forMarshaling->buffer));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->offset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+}
+
+void reservedmarshal_VkIndirectCommandsLayoutTokenNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkIndirectCommandsLayoutTokenNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkIndirectCommandsTokenTypeNV*)&forMarshaling->tokenType,
+           sizeof(VkIndirectCommandsTokenTypeNV));
+    *ptr += sizeof(VkIndirectCommandsTokenTypeNV);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->stream, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->offset, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->vertexBindingUnit, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->vertexDynamicStride, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPipelineLayout((*&forMarshaling->pushconstantPipelineLayout));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkShaderStageFlags*)&forMarshaling->pushconstantShaderStageFlags,
+           sizeof(VkShaderStageFlags));
+    *ptr += sizeof(VkShaderStageFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->pushconstantOffset, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->pushconstantSize, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkIndirectStateFlagsNV*)&forMarshaling->indirectStateFlags,
+           sizeof(VkIndirectStateFlagsNV));
+    *ptr += sizeof(VkIndirectStateFlagsNV);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->indexTypeCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const VkIndexType*)forMarshaling->pIndexTypes,
+           forMarshaling->indexTypeCount * sizeof(const VkIndexType));
+    *ptr += forMarshaling->indexTypeCount * sizeof(const VkIndexType);
+    memcpy(*ptr, (const uint32_t*)forMarshaling->pIndexTypeValues,
+           forMarshaling->indexTypeCount * sizeof(const uint32_t));
+    *ptr += forMarshaling->indexTypeCount * sizeof(const uint32_t);
+}
+
+void reservedmarshal_VkIndirectCommandsLayoutCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkIndirectCommandsLayoutCreateInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkIndirectCommandsLayoutUsageFlagsNV*)&forMarshaling->flags,
+           sizeof(VkIndirectCommandsLayoutUsageFlagsNV));
+    *ptr += sizeof(VkIndirectCommandsLayoutUsageFlagsNV);
+    memcpy(*ptr, (VkPipelineBindPoint*)&forMarshaling->pipelineBindPoint,
+           sizeof(VkPipelineBindPoint));
+    *ptr += sizeof(VkPipelineBindPoint);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->tokenCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->tokenCount; ++i) {
+        reservedmarshal_VkIndirectCommandsLayoutTokenNV(
+            vkStream, rootType,
+            (const VkIndirectCommandsLayoutTokenNV*)(forMarshaling->pTokens + i), ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->streamCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const uint32_t*)forMarshaling->pStreamStrides,
+           forMarshaling->streamCount * sizeof(const uint32_t));
+    *ptr += forMarshaling->streamCount * sizeof(const uint32_t);
+}
+
+void reservedmarshal_VkGeneratedCommandsInfoNV(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkGeneratedCommandsInfoNV* forMarshaling,
+                                               uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineBindPoint*)&forMarshaling->pipelineBindPoint,
+           sizeof(VkPipelineBindPoint));
+    *ptr += sizeof(VkPipelineBindPoint);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPipeline((*&forMarshaling->pipeline));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 =
+        get_host_u64_VkIndirectCommandsLayoutNV((*&forMarshaling->indirectCommandsLayout));
+    memcpy(*ptr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->streamCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->streamCount; ++i) {
+        reservedmarshal_VkIndirectCommandsStreamNV(
+            vkStream, rootType, (const VkIndirectCommandsStreamNV*)(forMarshaling->pStreams + i),
+            ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->sequencesCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    uint64_t cgen_var_2;
+    *&cgen_var_2 = get_host_u64_VkBuffer((*&forMarshaling->preprocessBuffer));
+    memcpy(*ptr, (uint64_t*)&cgen_var_2, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->preprocessOffset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->preprocessSize, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    uint64_t cgen_var_3;
+    *&cgen_var_3 = get_host_u64_VkBuffer((*&forMarshaling->sequencesCountBuffer));
+    memcpy(*ptr, (uint64_t*)&cgen_var_3, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->sequencesCountOffset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    uint64_t cgen_var_4;
+    *&cgen_var_4 = get_host_u64_VkBuffer((*&forMarshaling->sequencesIndexBuffer));
+    memcpy(*ptr, (uint64_t*)&cgen_var_4, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->sequencesIndexOffset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+}
+
+void reservedmarshal_VkGeneratedCommandsMemoryRequirementsInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkGeneratedCommandsMemoryRequirementsInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineBindPoint*)&forMarshaling->pipelineBindPoint,
+           sizeof(VkPipelineBindPoint));
+    *ptr += sizeof(VkPipelineBindPoint);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkPipeline((*&forMarshaling->pipeline));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 =
+        get_host_u64_VkIndirectCommandsLayoutNV((*&forMarshaling->indirectCommandsLayout));
+    memcpy(*ptr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxSequencesCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_NV_inherited_viewport_scissor
+void reservedmarshal_VkPhysicalDeviceInheritedViewportScissorFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceInheritedViewportScissorFeaturesNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->inheritedViewportScissor2D, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkCommandBufferInheritanceViewportScissorInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCommandBufferInheritanceViewportScissorInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->viewportScissor2D, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->viewportDepthCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pViewportDepths;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pViewportDepths) {
+        reservedmarshal_VkViewport(vkStream, rootType,
+                                   (const VkViewport*)(forMarshaling->pViewportDepths), ptr);
+    }
+}
+
+#endif
+#ifdef VK_EXT_texel_buffer_alignment
+void reservedmarshal_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->texelBufferAlignment, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->storageTexelBufferOffsetAlignmentBytes,
+           sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->storageTexelBufferOffsetSingleTexelAlignment,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->uniformTexelBufferOffsetAlignmentBytes,
+           sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->uniformTexelBufferOffsetSingleTexelAlignment,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_QCOM_render_pass_transform
+void reservedmarshal_VkRenderPassTransformBeginInfoQCOM(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRenderPassTransformBeginInfoQCOM* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkSurfaceTransformFlagBitsKHR*)&forMarshaling->transform,
+           sizeof(VkSurfaceTransformFlagBitsKHR));
+    *ptr += sizeof(VkSurfaceTransformFlagBitsKHR);
+}
+
+void reservedmarshal_VkCommandBufferInheritanceRenderPassTransformInfoQCOM(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCommandBufferInheritanceRenderPassTransformInfoQCOM* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkSurfaceTransformFlagBitsKHR*)&forMarshaling->transform,
+           sizeof(VkSurfaceTransformFlagBitsKHR));
+    *ptr += sizeof(VkSurfaceTransformFlagBitsKHR);
+    reservedmarshal_VkRect2D(vkStream, rootType, (VkRect2D*)(&forMarshaling->renderArea), ptr);
+}
+
+#endif
+#ifdef VK_EXT_device_memory_report
+void reservedmarshal_VkPhysicalDeviceDeviceMemoryReportFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDeviceMemoryReportFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->deviceMemoryReport, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkDeviceMemoryReportCallbackDataEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceMemoryReportCallbackDataEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDeviceMemoryReportFlagsEXT*)&forMarshaling->flags,
+           sizeof(VkDeviceMemoryReportFlagsEXT));
+    *ptr += sizeof(VkDeviceMemoryReportFlagsEXT);
+    memcpy(*ptr, (VkDeviceMemoryReportEventTypeEXT*)&forMarshaling->type,
+           sizeof(VkDeviceMemoryReportEventTypeEXT));
+    *ptr += sizeof(VkDeviceMemoryReportEventTypeEXT);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->memoryObjectId, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkObjectType*)&forMarshaling->objectType, sizeof(VkObjectType));
+    *ptr += sizeof(VkObjectType);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->objectHandle, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->heapIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkDeviceDeviceMemoryReportCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceDeviceMemoryReportCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDeviceMemoryReportFlagsEXT*)&forMarshaling->flags,
+           sizeof(VkDeviceMemoryReportFlagsEXT));
+    *ptr += sizeof(VkDeviceMemoryReportFlagsEXT);
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->pfnUserCallback;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    memcpy(*ptr, (void*)forMarshaling->pUserData, sizeof(uint8_t));
+    *ptr += sizeof(uint8_t);
+}
+
+#endif
+#ifdef VK_EXT_acquire_drm_display
+#endif
+#ifdef VK_EXT_robustness2
+void reservedmarshal_VkPhysicalDeviceRobustness2FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRobustness2FeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->robustBufferAccess2, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->robustImageAccess2, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->nullDescriptor, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceRobustness2PropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRobustness2PropertiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->robustStorageBufferAccessSizeAlignment,
+           sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->robustUniformBufferAccessSizeAlignment,
+           sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+}
+
+#endif
+#ifdef VK_EXT_custom_border_color
+void reservedmarshal_VkSamplerCustomBorderColorCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSamplerCustomBorderColorCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkClearColorValue(vkStream, rootType,
+                                      (VkClearColorValue*)(&forMarshaling->customBorderColor), ptr);
+    memcpy(*ptr, (VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+    *ptr += sizeof(VkFormat);
+}
+
+void reservedmarshal_VkPhysicalDeviceCustomBorderColorPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceCustomBorderColorPropertiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxCustomBorderColorSamplers, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkPhysicalDeviceCustomBorderColorFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceCustomBorderColorFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->customBorderColors, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->customBorderColorWithoutFormat, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_GOOGLE_user_type
+#endif
+#ifdef VK_EXT_private_data
+void reservedmarshal_VkPhysicalDevicePrivateDataFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePrivateDataFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->privateData, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkDevicePrivateDataCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDevicePrivateDataCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->privateDataSlotRequestCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkPrivateDataSlotCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPrivateDataSlotCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPrivateDataSlotCreateFlagsEXT*)&forMarshaling->flags,
+           sizeof(VkPrivateDataSlotCreateFlagsEXT));
+    *ptr += sizeof(VkPrivateDataSlotCreateFlagsEXT);
+}
+
+#endif
+#ifdef VK_EXT_pipeline_creation_cache_control
+void reservedmarshal_VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->pipelineCreationCacheControl, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_NV_device_diagnostics_config
+void reservedmarshal_VkPhysicalDeviceDiagnosticsConfigFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDiagnosticsConfigFeaturesNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->diagnosticsConfig, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkDeviceDiagnosticsConfigCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceDiagnosticsConfigCreateInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDeviceDiagnosticsConfigFlagsNV*)&forMarshaling->flags,
+           sizeof(VkDeviceDiagnosticsConfigFlagsNV));
+    *ptr += sizeof(VkDeviceDiagnosticsConfigFlagsNV);
+}
+
+#endif
+#ifdef VK_QCOM_render_pass_store_ops
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+void reservedmarshal_VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->fragmentShadingRateEnums, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->supersampleFragmentShadingRates, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->noInvocationFragmentShadingRates, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkSampleCountFlagBits*)&forMarshaling->maxFragmentShadingRateInvocationCount,
+           sizeof(VkSampleCountFlagBits));
+    *ptr += sizeof(VkSampleCountFlagBits);
+}
+
+void reservedmarshal_VkPipelineFragmentShadingRateEnumStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineFragmentShadingRateEnumStateCreateInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkFragmentShadingRateTypeNV*)&forMarshaling->shadingRateType,
+           sizeof(VkFragmentShadingRateTypeNV));
+    *ptr += sizeof(VkFragmentShadingRateTypeNV);
+    memcpy(*ptr, (VkFragmentShadingRateNV*)&forMarshaling->shadingRate,
+           sizeof(VkFragmentShadingRateNV));
+    *ptr += sizeof(VkFragmentShadingRateNV);
+    memcpy(*ptr, (VkFragmentShadingRateCombinerOpKHR*)forMarshaling->combinerOps,
+           2 * sizeof(VkFragmentShadingRateCombinerOpKHR));
+    *ptr += 2 * sizeof(VkFragmentShadingRateCombinerOpKHR);
+}
+
+#endif
+#ifdef VK_NV_ray_tracing_motion_blur
+void reservedmarshal_VkDeviceOrHostAddressConstKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceOrHostAddressConstKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkDeviceAddress*)&forMarshaling->deviceAddress, sizeof(VkDeviceAddress));
+    *ptr += sizeof(VkDeviceAddress);
+}
+
+void reservedmarshal_VkAccelerationStructureGeometryMotionTrianglesDataNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureGeometryMotionTrianglesDataNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkDeviceOrHostAddressConstKHR(
+        vkStream, rootType, (VkDeviceOrHostAddressConstKHR*)(&forMarshaling->vertexData), ptr);
+}
+
+void reservedmarshal_VkAccelerationStructureMotionInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureMotionInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxInstances, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkAccelerationStructureMotionInfoFlagsNV*)&forMarshaling->flags,
+           sizeof(VkAccelerationStructureMotionInfoFlagsNV));
+    *ptr += sizeof(VkAccelerationStructureMotionInfoFlagsNV);
+}
+
+void reservedmarshal_VkAccelerationStructureMatrixMotionInstanceNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureMatrixMotionInstanceNV* forMarshaling, uint8_t** ptr) {
+    typedef struct VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields {
+        VkTransformMatrixKHR transformT0;
+        VkTransformMatrixKHR transformT1;
+        uint32_t dwords[2];
+        uint64_t accelerationStructureReference;
+    } VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields;
+
+    (void)vkStream;
+    const VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields* forMarshaling_new =
+        (const VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields*)(forMarshaling);
+    reservedmarshal_VkTransformMatrixKHR(
+        vkStream, rootType, (VkTransformMatrixKHR*)(&forMarshaling_new->transformT0), ptr);
+    reservedmarshal_VkTransformMatrixKHR(
+        vkStream, rootType, (VkTransformMatrixKHR*)(&forMarshaling_new->transformT1), ptr);
+    for (uint32_t i = 0; i < 2; i++) {
+        memcpy(*ptr, (uint32_t*)&(forMarshaling_new->dwords[i]), sizeof(uint32_t));
+        *ptr += sizeof(uint32_t);
+    }
+    memcpy(*ptr, (uint64_t*)&forMarshaling_new->accelerationStructureReference, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+}
+
+void reservedmarshal_VkSRTDataNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkSRTDataNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (float*)&forMarshaling->sx, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->a, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->b, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->pvx, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->sy, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->c, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->pvy, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->sz, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->pvz, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->qx, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->qy, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->qz, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->qw, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->tx, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->ty, sizeof(float));
+    *ptr += sizeof(float);
+    memcpy(*ptr, (float*)&forMarshaling->tz, sizeof(float));
+    *ptr += sizeof(float);
+}
+
+void reservedmarshal_VkAccelerationStructureSRTMotionInstanceNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureSRTMotionInstanceNV* forMarshaling, uint8_t** ptr) {
+    typedef struct VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields {
+        VkSRTDataNV transformT0;
+        VkSRTDataNV transformT1;
+        uint32_t dwords[2];
+        uint64_t accelerationStructureReference;
+    } VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields;
+
+    (void)vkStream;
+    const VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields* forMarshaling_new =
+        (const VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields*)(forMarshaling);
+    reservedmarshal_VkSRTDataNV(vkStream, rootType, (VkSRTDataNV*)(&forMarshaling_new->transformT0),
+                                ptr);
+    reservedmarshal_VkSRTDataNV(vkStream, rootType, (VkSRTDataNV*)(&forMarshaling_new->transformT1),
+                                ptr);
+    for (uint32_t i = 0; i < 2; i++) {
+        memcpy(*ptr, (uint32_t*)&(forMarshaling_new->dwords[i]), sizeof(uint32_t));
+        *ptr += sizeof(uint32_t);
+    }
+    memcpy(*ptr, (uint64_t*)&forMarshaling_new->accelerationStructureReference, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+}
+
+void reservedmarshal_VkAccelerationStructureMotionInstanceDataNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureMotionInstanceDataNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    reservedmarshal_VkAccelerationStructureInstanceKHR(
+        vkStream, rootType, (VkAccelerationStructureInstanceKHR*)(&forMarshaling->staticInstance),
+        ptr);
+}
+
+void reservedmarshal_VkAccelerationStructureMotionInstanceNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureMotionInstanceNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkAccelerationStructureMotionInstanceTypeNV*)&forMarshaling->type,
+           sizeof(VkAccelerationStructureMotionInstanceTypeNV));
+    *ptr += sizeof(VkAccelerationStructureMotionInstanceTypeNV);
+    memcpy(*ptr, (VkAccelerationStructureMotionInstanceFlagsNV*)&forMarshaling->flags,
+           sizeof(VkAccelerationStructureMotionInstanceFlagsNV));
+    *ptr += sizeof(VkAccelerationStructureMotionInstanceFlagsNV);
+    reservedmarshal_VkAccelerationStructureMotionInstanceDataNV(
+        vkStream, rootType, (VkAccelerationStructureMotionInstanceDataNV*)(&forMarshaling->data),
+        ptr);
+}
+
+void reservedmarshal_VkPhysicalDeviceRayTracingMotionBlurFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingMotionBlurFeaturesNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->rayTracingMotionBlur, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->rayTracingMotionBlurPipelineTraceRaysIndirect,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_ycbcr_2plane_444_formats
+void reservedmarshal_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->ycbcr2plane444Formats, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_fragment_density_map2
+void reservedmarshal_VkPhysicalDeviceFragmentDensityMap2FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->fragmentDensityMapDeferred, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceFragmentDensityMap2PropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMap2PropertiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->subsampledLoads, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->subsampledCoarseReconstructionEarlyAccess,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxSubsampledArrayLayers, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetSubsampledSamplers, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_QCOM_rotated_copy_commands
+void reservedmarshal_VkCopyCommandTransformInfoQCOM(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCopyCommandTransformInfoQCOM* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkSurfaceTransformFlagBitsKHR*)&forMarshaling->transform,
+           sizeof(VkSurfaceTransformFlagBitsKHR));
+    *ptr += sizeof(VkSurfaceTransformFlagBitsKHR);
+}
+
+#endif
+#ifdef VK_EXT_image_robustness
+void reservedmarshal_VkPhysicalDeviceImageRobustnessFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceImageRobustnessFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->robustImageAccess, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_4444_formats
+void reservedmarshal_VkPhysicalDevice4444FormatsFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevice4444FormatsFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->formatA4R4G4B4, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->formatA4B4G4R4, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_rgba10x6_formats
+void reservedmarshal_VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->formatRgba10x6WithoutYCbCrSampler, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_NV_acquire_winrt_display
+#endif
+#ifdef VK_EXT_directfb_surface
+void reservedmarshal_VkDirectFBSurfaceCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDirectFBSurfaceCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDirectFBSurfaceCreateFlagsEXT*)&forMarshaling->flags,
+           sizeof(VkDirectFBSurfaceCreateFlagsEXT));
+    *ptr += sizeof(VkDirectFBSurfaceCreateFlagsEXT);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->dfb;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->dfb) {
+        memcpy(*ptr, (IDirectFB*)forMarshaling->dfb, sizeof(IDirectFB));
+        *ptr += sizeof(IDirectFB);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->surface;
+    memcpy((*ptr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->surface) {
+        memcpy(*ptr, (IDirectFBSurface*)forMarshaling->surface, sizeof(IDirectFBSurface));
+        *ptr += sizeof(IDirectFBSurface);
+    }
+}
+
+#endif
+#ifdef VK_VALVE_mutable_descriptor_type
+void reservedmarshal_VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->mutableDescriptorType, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkMutableDescriptorTypeListVALVE(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMutableDescriptorTypeListVALVE* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->descriptorTypeCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const VkDescriptorType*)forMarshaling->pDescriptorTypes,
+           forMarshaling->descriptorTypeCount * sizeof(const VkDescriptorType));
+    *ptr += forMarshaling->descriptorTypeCount * sizeof(const VkDescriptorType);
+}
+
+void reservedmarshal_VkMutableDescriptorTypeCreateInfoVALVE(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMutableDescriptorTypeCreateInfoVALVE* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->mutableDescriptorTypeListCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->mutableDescriptorTypeListCount; ++i) {
+        reservedmarshal_VkMutableDescriptorTypeListVALVE(
+            vkStream, rootType,
+            (const VkMutableDescriptorTypeListVALVE*)(forMarshaling->pMutableDescriptorTypeLists +
+                                                      i),
+            ptr);
+    }
+}
+
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+void reservedmarshal_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->vertexInputDynamicState, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkVertexInputBindingDescription2EXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVertexInputBindingDescription2EXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->binding, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->stride, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkVertexInputRate*)&forMarshaling->inputRate, sizeof(VkVertexInputRate));
+    *ptr += sizeof(VkVertexInputRate);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->divisor, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkVertexInputAttributeDescription2EXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVertexInputAttributeDescription2EXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->location, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->binding, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkFormat*)&forMarshaling->format, sizeof(VkFormat));
+    *ptr += sizeof(VkFormat);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->offset, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_EXT_physical_device_drm
+void reservedmarshal_VkPhysicalDeviceDrmPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDrmPropertiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->hasPrimary, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->hasRender, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (int64_t*)&forMarshaling->primaryMajor, sizeof(int64_t));
+    *ptr += sizeof(int64_t);
+    memcpy(*ptr, (int64_t*)&forMarshaling->primaryMinor, sizeof(int64_t));
+    *ptr += sizeof(int64_t);
+    memcpy(*ptr, (int64_t*)&forMarshaling->renderMajor, sizeof(int64_t));
+    *ptr += sizeof(int64_t);
+    memcpy(*ptr, (int64_t*)&forMarshaling->renderMinor, sizeof(int64_t));
+    *ptr += sizeof(int64_t);
+}
+
+#endif
+#ifdef VK_EXT_primitive_topology_list_restart
+void reservedmarshal_VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->primitiveTopologyListRestart, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->primitiveTopologyPatchListRestart, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_FUCHSIA_external_memory
+void reservedmarshal_VkImportMemoryZirconHandleInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportMemoryZirconHandleInfoFUCHSIA* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkExternalMemoryHandleTypeFlagBits*)&forMarshaling->handleType,
+           sizeof(VkExternalMemoryHandleTypeFlagBits));
+    *ptr += sizeof(VkExternalMemoryHandleTypeFlagBits);
+    memcpy(*ptr, (zx_handle_t*)&forMarshaling->handle, sizeof(zx_handle_t));
+    *ptr += sizeof(zx_handle_t);
+}
+
+void reservedmarshal_VkMemoryZirconHandlePropertiesFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryZirconHandlePropertiesFUCHSIA* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->memoryTypeBits, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkMemoryGetZirconHandleInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryGetZirconHandleInfoFUCHSIA* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDeviceMemory((*&forMarshaling->memory));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkExternalMemoryHandleTypeFlagBits*)&forMarshaling->handleType,
+           sizeof(VkExternalMemoryHandleTypeFlagBits));
+    *ptr += sizeof(VkExternalMemoryHandleTypeFlagBits);
+}
+
+#endif
+#ifdef VK_FUCHSIA_external_semaphore
+void reservedmarshal_VkImportSemaphoreZirconHandleInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportSemaphoreZirconHandleInfoFUCHSIA* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkSemaphore((*&forMarshaling->semaphore));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkSemaphoreImportFlags*)&forMarshaling->flags, sizeof(VkSemaphoreImportFlags));
+    *ptr += sizeof(VkSemaphoreImportFlags);
+    memcpy(*ptr, (VkExternalSemaphoreHandleTypeFlagBits*)&forMarshaling->handleType,
+           sizeof(VkExternalSemaphoreHandleTypeFlagBits));
+    *ptr += sizeof(VkExternalSemaphoreHandleTypeFlagBits);
+    memcpy(*ptr, (zx_handle_t*)&forMarshaling->zirconHandle, sizeof(zx_handle_t));
+    *ptr += sizeof(zx_handle_t);
+}
+
+void reservedmarshal_VkSemaphoreGetZirconHandleInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSemaphoreGetZirconHandleInfoFUCHSIA* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkSemaphore((*&forMarshaling->semaphore));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkExternalSemaphoreHandleTypeFlagBits*)&forMarshaling->handleType,
+           sizeof(VkExternalSemaphoreHandleTypeFlagBits));
+    *ptr += sizeof(VkExternalSemaphoreHandleTypeFlagBits);
+}
+
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+void reservedmarshal_VkBufferCollectionCreateInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferCollectionCreateInfoFUCHSIA* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (zx_handle_t*)&forMarshaling->collectionToken, sizeof(zx_handle_t));
+    *ptr += sizeof(zx_handle_t);
+}
+
+void reservedmarshal_VkImportMemoryBufferCollectionFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportMemoryBufferCollectionFUCHSIA* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->collection;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->index, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkBufferCollectionImageCreateInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferCollectionImageCreateInfoFUCHSIA* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->collection;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->index, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkBufferCollectionConstraintsInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferCollectionConstraintsInfoFUCHSIA* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->minBufferCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxBufferCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->minBufferCountForCamping, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->minBufferCountForDedicatedSlack, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->minBufferCountForSharedSlack, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkBufferConstraintsInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferConstraintsInfoFUCHSIA* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkBufferCreateInfo(vkStream, rootType,
+                                       (VkBufferCreateInfo*)(&forMarshaling->createInfo), ptr);
+    memcpy(*ptr, (VkFormatFeatureFlags*)&forMarshaling->requiredFormatFeatures,
+           sizeof(VkFormatFeatureFlags));
+    *ptr += sizeof(VkFormatFeatureFlags);
+    reservedmarshal_VkBufferCollectionConstraintsInfoFUCHSIA(
+        vkStream, rootType,
+        (VkBufferCollectionConstraintsInfoFUCHSIA*)(&forMarshaling->bufferCollectionConstraints),
+        ptr);
+}
+
+void reservedmarshal_VkBufferCollectionBufferCreateInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferCollectionBufferCreateInfoFUCHSIA* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0 = (uint64_t)forMarshaling->collection;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->index, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkSysmemColorSpaceFUCHSIA(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkSysmemColorSpaceFUCHSIA* forMarshaling,
+                                               uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->colorSpace, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkBufferCollectionPropertiesFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferCollectionPropertiesFUCHSIA* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->memoryTypeBits, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->bufferCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->createInfoIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->sysmemPixelFormat, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+    memcpy(*ptr, (VkFormatFeatureFlags*)&forMarshaling->formatFeatures,
+           sizeof(VkFormatFeatureFlags));
+    *ptr += sizeof(VkFormatFeatureFlags);
+    reservedmarshal_VkSysmemColorSpaceFUCHSIA(
+        vkStream, rootType, (VkSysmemColorSpaceFUCHSIA*)(&forMarshaling->sysmemColorSpaceIndex),
+        ptr);
+    reservedmarshal_VkComponentMapping(
+        vkStream, rootType, (VkComponentMapping*)(&forMarshaling->samplerYcbcrConversionComponents),
+        ptr);
+    memcpy(*ptr, (VkSamplerYcbcrModelConversion*)&forMarshaling->suggestedYcbcrModel,
+           sizeof(VkSamplerYcbcrModelConversion));
+    *ptr += sizeof(VkSamplerYcbcrModelConversion);
+    memcpy(*ptr, (VkSamplerYcbcrRange*)&forMarshaling->suggestedYcbcrRange,
+           sizeof(VkSamplerYcbcrRange));
+    *ptr += sizeof(VkSamplerYcbcrRange);
+    memcpy(*ptr, (VkChromaLocation*)&forMarshaling->suggestedXChromaOffset,
+           sizeof(VkChromaLocation));
+    *ptr += sizeof(VkChromaLocation);
+    memcpy(*ptr, (VkChromaLocation*)&forMarshaling->suggestedYChromaOffset,
+           sizeof(VkChromaLocation));
+    *ptr += sizeof(VkChromaLocation);
+}
+
+void reservedmarshal_VkImageFormatConstraintsInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageFormatConstraintsInfoFUCHSIA* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkImageCreateInfo(vkStream, rootType,
+                                      (VkImageCreateInfo*)(&forMarshaling->imageCreateInfo), ptr);
+    memcpy(*ptr, (VkFormatFeatureFlags*)&forMarshaling->requiredFormatFeatures,
+           sizeof(VkFormatFeatureFlags));
+    *ptr += sizeof(VkFormatFeatureFlags);
+    memcpy(*ptr, (VkImageFormatConstraintsFlagsFUCHSIA*)&forMarshaling->flags,
+           sizeof(VkImageFormatConstraintsFlagsFUCHSIA));
+    *ptr += sizeof(VkImageFormatConstraintsFlagsFUCHSIA);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->sysmemPixelFormat, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->colorSpaceCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    reservedmarshal_VkSysmemColorSpaceFUCHSIA(
+        vkStream, rootType, (const VkSysmemColorSpaceFUCHSIA*)(forMarshaling->pColorSpaces), ptr);
+}
+
+void reservedmarshal_VkImageConstraintsInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageConstraintsInfoFUCHSIA* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->formatConstraintsCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->formatConstraintsCount; ++i) {
+        reservedmarshal_VkImageFormatConstraintsInfoFUCHSIA(
+            vkStream, rootType,
+            (const VkImageFormatConstraintsInfoFUCHSIA*)(forMarshaling->pFormatConstraints + i),
+            ptr);
+    }
+    reservedmarshal_VkBufferCollectionConstraintsInfoFUCHSIA(
+        vkStream, rootType,
+        (VkBufferCollectionConstraintsInfoFUCHSIA*)(&forMarshaling->bufferCollectionConstraints),
+        ptr);
+    memcpy(*ptr, (VkImageConstraintsInfoFlagsFUCHSIA*)&forMarshaling->flags,
+           sizeof(VkImageConstraintsInfoFlagsFUCHSIA));
+    *ptr += sizeof(VkImageConstraintsInfoFlagsFUCHSIA);
+}
+
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+void reservedmarshal_VkSubpassShadingPipelineCreateInfoHUAWEI(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSubpassShadingPipelineCreateInfoHUAWEI* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkRenderPass((*&forMarshaling->renderPass));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->subpass, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkPhysicalDeviceSubpassShadingFeaturesHUAWEI(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSubpassShadingFeaturesHUAWEI* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->subpassShading, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceSubpassShadingPropertiesHUAWEI(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSubpassShadingPropertiesHUAWEI* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxSubpassShadingWorkgroupSizeAspectRatio,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+void reservedmarshal_VkPhysicalDeviceInvocationMaskFeaturesHUAWEI(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceInvocationMaskFeaturesHUAWEI* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->invocationMask, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_NV_external_memory_rdma
+void reservedmarshal_VkMemoryGetRemoteAddressInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryGetRemoteAddressInfoNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkDeviceMemory((*&forMarshaling->memory));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkExternalMemoryHandleTypeFlagBits*)&forMarshaling->handleType,
+           sizeof(VkExternalMemoryHandleTypeFlagBits));
+    *ptr += sizeof(VkExternalMemoryHandleTypeFlagBits);
+}
+
+void reservedmarshal_VkPhysicalDeviceExternalMemoryRDMAFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExternalMemoryRDMAFeaturesNV* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->externalMemoryRDMA, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+void reservedmarshal_VkPhysicalDeviceExtendedDynamicState2FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->extendedDynamicState2, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->extendedDynamicState2LogicOp, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->extendedDynamicState2PatchControlPoints,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_QNX_screen_surface
+void reservedmarshal_VkScreenSurfaceCreateInfoQNX(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkScreenSurfaceCreateInfoQNX* forMarshaling,
+                                                  uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkScreenSurfaceCreateFlagsQNX*)&forMarshaling->flags,
+           sizeof(VkScreenSurfaceCreateFlagsQNX));
+    *ptr += sizeof(VkScreenSurfaceCreateFlagsQNX);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->context;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->context) {
+        memcpy(*ptr, (_screen_context*)forMarshaling->context, sizeof(_screen_context));
+        *ptr += sizeof(_screen_context);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->window;
+    memcpy((*ptr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->window) {
+        memcpy(*ptr, (_screen_window*)forMarshaling->window, sizeof(_screen_window));
+        *ptr += sizeof(_screen_window);
+    }
+}
+
+#endif
+#ifdef VK_EXT_color_write_enable
+void reservedmarshal_VkPhysicalDeviceColorWriteEnableFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceColorWriteEnableFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->colorWriteEnable, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPipelineColorWriteCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineColorWriteCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->attachmentCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (const VkBool32*)forMarshaling->pColorWriteEnables,
+           forMarshaling->attachmentCount * sizeof(const VkBool32));
+    *ptr += forMarshaling->attachmentCount * sizeof(const VkBool32);
+}
+
+#endif
+#ifdef VK_GOOGLE_gfxstream
+void reservedmarshal_VkImportColorBufferGOOGLE(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkImportColorBufferGOOGLE* forMarshaling,
+                                               uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->colorBuffer, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkImportBufferGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkImportBufferGOOGLE* forMarshaling,
+                                          uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->buffer, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkCreateBlobGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkCreateBlobGOOGLE* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->blobMem, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->blobFlags, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->blobId, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+}
+
+#endif
+#ifdef VK_EXT_global_priority_query
+void reservedmarshal_VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->globalPriorityQuery, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkQueueFamilyGlobalPriorityPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkQueueFamilyGlobalPriorityPropertiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->priorityCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkQueueGlobalPriorityEXT*)forMarshaling->priorities,
+           VK_MAX_GLOBAL_PRIORITY_SIZE_EXT * sizeof(VkQueueGlobalPriorityEXT));
+    *ptr += VK_MAX_GLOBAL_PRIORITY_SIZE_EXT * sizeof(VkQueueGlobalPriorityEXT);
+}
+
+#endif
+#ifdef VK_EXT_multi_draw
+void reservedmarshal_VkPhysicalDeviceMultiDrawFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMultiDrawFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->multiDraw, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceMultiDrawPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMultiDrawPropertiesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxMultiDrawCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkMultiDrawInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkMultiDrawInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->firstVertex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->vertexCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkMultiDrawIndexedInfoEXT(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkMultiDrawIndexedInfoEXT* forMarshaling,
+                                               uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->firstIndex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->indexCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (int32_t*)&forMarshaling->vertexOffset, sizeof(int32_t));
+    *ptr += sizeof(int32_t);
+}
+
+#endif
+#ifdef VK_EXT_load_store_op_none
+#endif
+#ifdef VK_EXT_border_color_swizzle
+void reservedmarshal_VkPhysicalDeviceBorderColorSwizzleFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->borderColorSwizzle, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->borderColorSwizzleFromImage, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkSamplerBorderColorComponentMappingCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSamplerBorderColorComponentMappingCreateInfoEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkComponentMapping(vkStream, rootType,
+                                       (VkComponentMapping*)(&forMarshaling->components), ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->srgb, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+void reservedmarshal_VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->pageableDeviceLocalMemory, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+#ifdef VK_KHR_acceleration_structure
+void reservedmarshal_VkDeviceOrHostAddressKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkDeviceOrHostAddressKHR* forMarshaling,
+                                              uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkDeviceAddress*)&forMarshaling->deviceAddress, sizeof(VkDeviceAddress));
+    *ptr += sizeof(VkDeviceAddress);
+}
+
+void reservedmarshal_VkAccelerationStructureBuildRangeInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureBuildRangeInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->primitiveCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->primitiveOffset, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->firstVertex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->transformOffset, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkAccelerationStructureGeometryTrianglesDataKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureGeometryTrianglesDataKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkFormat*)&forMarshaling->vertexFormat, sizeof(VkFormat));
+    *ptr += sizeof(VkFormat);
+    reservedmarshal_VkDeviceOrHostAddressConstKHR(
+        vkStream, rootType, (VkDeviceOrHostAddressConstKHR*)(&forMarshaling->vertexData), ptr);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->vertexStride, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxVertex, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (VkIndexType*)&forMarshaling->indexType, sizeof(VkIndexType));
+    *ptr += sizeof(VkIndexType);
+    reservedmarshal_VkDeviceOrHostAddressConstKHR(
+        vkStream, rootType, (VkDeviceOrHostAddressConstKHR*)(&forMarshaling->indexData), ptr);
+    reservedmarshal_VkDeviceOrHostAddressConstKHR(
+        vkStream, rootType, (VkDeviceOrHostAddressConstKHR*)(&forMarshaling->transformData), ptr);
+}
+
+void reservedmarshal_VkAccelerationStructureGeometryAabbsDataKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureGeometryAabbsDataKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkDeviceOrHostAddressConstKHR(
+        vkStream, rootType, (VkDeviceOrHostAddressConstKHR*)(&forMarshaling->data), ptr);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->stride, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+}
+
+void reservedmarshal_VkAccelerationStructureGeometryInstancesDataKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureGeometryInstancesDataKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->arrayOfPointers, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    reservedmarshal_VkDeviceOrHostAddressConstKHR(
+        vkStream, rootType, (VkDeviceOrHostAddressConstKHR*)(&forMarshaling->data), ptr);
+}
+
+void reservedmarshal_VkAccelerationStructureGeometryDataKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureGeometryDataKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    reservedmarshal_VkAccelerationStructureGeometryTrianglesDataKHR(
+        vkStream, rootType,
+        (VkAccelerationStructureGeometryTrianglesDataKHR*)(&forMarshaling->triangles), ptr);
+}
+
+void reservedmarshal_VkAccelerationStructureGeometryKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureGeometryKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkGeometryTypeKHR*)&forMarshaling->geometryType, sizeof(VkGeometryTypeKHR));
+    *ptr += sizeof(VkGeometryTypeKHR);
+    reservedmarshal_VkAccelerationStructureGeometryDataKHR(
+        vkStream, rootType, (VkAccelerationStructureGeometryDataKHR*)(&forMarshaling->geometry),
+        ptr);
+    memcpy(*ptr, (VkGeometryFlagsKHR*)&forMarshaling->flags, sizeof(VkGeometryFlagsKHR));
+    *ptr += sizeof(VkGeometryFlagsKHR);
+}
+
+void reservedmarshal_VkAccelerationStructureBuildGeometryInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureBuildGeometryInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkAccelerationStructureTypeKHR*)&forMarshaling->type,
+           sizeof(VkAccelerationStructureTypeKHR));
+    *ptr += sizeof(VkAccelerationStructureTypeKHR);
+    memcpy(*ptr, (VkBuildAccelerationStructureFlagsKHR*)&forMarshaling->flags,
+           sizeof(VkBuildAccelerationStructureFlagsKHR));
+    *ptr += sizeof(VkBuildAccelerationStructureFlagsKHR);
+    memcpy(*ptr, (VkBuildAccelerationStructureModeKHR*)&forMarshaling->mode,
+           sizeof(VkBuildAccelerationStructureModeKHR));
+    *ptr += sizeof(VkBuildAccelerationStructureModeKHR);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 =
+        get_host_u64_VkAccelerationStructureKHR((*&forMarshaling->srcAccelerationStructure));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 =
+        get_host_u64_VkAccelerationStructureKHR((*&forMarshaling->dstAccelerationStructure));
+    memcpy(*ptr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->geometryCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)forMarshaling->pGeometries;
+    memcpy((*ptr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pGeometries) {
+        for (uint32_t i = 0; i < (uint32_t)forMarshaling->geometryCount; ++i) {
+            reservedmarshal_VkAccelerationStructureGeometryKHR(
+                vkStream, rootType,
+                (const VkAccelerationStructureGeometryKHR*)(forMarshaling->pGeometries + i), ptr);
+        }
+    }
+    reservedmarshal_VkDeviceOrHostAddressKHR(
+        vkStream, rootType, (VkDeviceOrHostAddressKHR*)(&forMarshaling->scratchData), ptr);
+}
+
+void reservedmarshal_VkAccelerationStructureCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureCreateInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkAccelerationStructureCreateFlagsKHR*)&forMarshaling->createFlags,
+           sizeof(VkAccelerationStructureCreateFlagsKHR));
+    *ptr += sizeof(VkAccelerationStructureCreateFlagsKHR);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkBuffer((*&forMarshaling->buffer));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->offset, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkAccelerationStructureTypeKHR*)&forMarshaling->type,
+           sizeof(VkAccelerationStructureTypeKHR));
+    *ptr += sizeof(VkAccelerationStructureTypeKHR);
+    memcpy(*ptr, (VkDeviceAddress*)&forMarshaling->deviceAddress, sizeof(VkDeviceAddress));
+    *ptr += sizeof(VkDeviceAddress);
+}
+
+void reservedmarshal_VkWriteDescriptorSetAccelerationStructureKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkWriteDescriptorSetAccelerationStructureKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->accelerationStructureCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pAccelerationStructures;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pAccelerationStructures) {
+        if (forMarshaling->accelerationStructureCount) {
+            uint8_t* cgen_var_0_0_ptr = (uint8_t*)(*ptr);
+            if (forMarshaling) {
+                for (uint32_t k = 0; k < forMarshaling->accelerationStructureCount; ++k) {
+                    uint64_t tmpval = get_host_u64_VkAccelerationStructureKHR(
+                        forMarshaling->pAccelerationStructures[k]);
+                    memcpy(cgen_var_0_0_ptr + k * 8, &tmpval, sizeof(uint64_t));
+                }
+            }
+            *ptr += 8 * forMarshaling->accelerationStructureCount;
+        }
+    }
+}
+
+void reservedmarshal_VkPhysicalDeviceAccelerationStructureFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceAccelerationStructureFeaturesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->accelerationStructure, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->accelerationStructureCaptureReplay, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->accelerationStructureIndirectBuild, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->accelerationStructureHostCommands, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->descriptorBindingAccelerationStructureUpdateAfterBind,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceAccelerationStructurePropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceAccelerationStructurePropertiesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->maxGeometryCount, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->maxInstanceCount, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+    memcpy(*ptr, (uint64_t*)&forMarshaling->maxPrimitiveCount, sizeof(uint64_t));
+    *ptr += sizeof(uint64_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPerStageDescriptorAccelerationStructures,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr,
+           (uint32_t*)&forMarshaling->maxPerStageDescriptorUpdateAfterBindAccelerationStructures,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetAccelerationStructures,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxDescriptorSetUpdateAfterBindAccelerationStructures,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->minAccelerationStructureScratchOffsetAlignment,
+           sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkAccelerationStructureDeviceAddressInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureDeviceAddressInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 =
+        get_host_u64_VkAccelerationStructureKHR((*&forMarshaling->accelerationStructure));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+}
+
+void reservedmarshal_VkAccelerationStructureVersionInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureVersionInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (const uint8_t*)forMarshaling->pVersionData,
+           2 * VK_UUID_SIZE * sizeof(const uint8_t));
+    *ptr += 2 * VK_UUID_SIZE * sizeof(const uint8_t);
+}
+
+void reservedmarshal_VkCopyAccelerationStructureToMemoryInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCopyAccelerationStructureToMemoryInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkAccelerationStructureKHR((*&forMarshaling->src));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    reservedmarshal_VkDeviceOrHostAddressKHR(vkStream, rootType,
+                                             (VkDeviceOrHostAddressKHR*)(&forMarshaling->dst), ptr);
+    memcpy(*ptr, (VkCopyAccelerationStructureModeKHR*)&forMarshaling->mode,
+           sizeof(VkCopyAccelerationStructureModeKHR));
+    *ptr += sizeof(VkCopyAccelerationStructureModeKHR);
+}
+
+void reservedmarshal_VkCopyMemoryToAccelerationStructureInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCopyMemoryToAccelerationStructureInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    reservedmarshal_VkDeviceOrHostAddressConstKHR(
+        vkStream, rootType, (VkDeviceOrHostAddressConstKHR*)(&forMarshaling->src), ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkAccelerationStructureKHR((*&forMarshaling->dst));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkCopyAccelerationStructureModeKHR*)&forMarshaling->mode,
+           sizeof(VkCopyAccelerationStructureModeKHR));
+    *ptr += sizeof(VkCopyAccelerationStructureModeKHR);
+}
+
+void reservedmarshal_VkCopyAccelerationStructureInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCopyAccelerationStructureInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    uint64_t cgen_var_0;
+    *&cgen_var_0 = get_host_u64_VkAccelerationStructureKHR((*&forMarshaling->src));
+    memcpy(*ptr, (uint64_t*)&cgen_var_0, 1 * 8);
+    *ptr += 1 * 8;
+    uint64_t cgen_var_1;
+    *&cgen_var_1 = get_host_u64_VkAccelerationStructureKHR((*&forMarshaling->dst));
+    memcpy(*ptr, (uint64_t*)&cgen_var_1, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (VkCopyAccelerationStructureModeKHR*)&forMarshaling->mode,
+           sizeof(VkCopyAccelerationStructureModeKHR));
+    *ptr += sizeof(VkCopyAccelerationStructureModeKHR);
+}
+
+void reservedmarshal_VkAccelerationStructureBuildSizesInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureBuildSizesInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->accelerationStructureSize, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->updateScratchSize, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->buildScratchSize, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+}
+
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+void reservedmarshal_VkRayTracingShaderGroupCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRayTracingShaderGroupCreateInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkRayTracingShaderGroupTypeKHR*)&forMarshaling->type,
+           sizeof(VkRayTracingShaderGroupTypeKHR));
+    *ptr += sizeof(VkRayTracingShaderGroupTypeKHR);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->generalShader, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->closestHitShader, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->anyHitShader, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->intersectionShader, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pShaderGroupCaptureReplayHandle;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pShaderGroupCaptureReplayHandle) {
+        memcpy(*ptr, (const void*)forMarshaling->pShaderGroupCaptureReplayHandle,
+               sizeof(const uint8_t));
+        *ptr += sizeof(const uint8_t);
+    }
+}
+
+void reservedmarshal_VkRayTracingPipelineInterfaceCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRayTracingPipelineInterfaceCreateInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPipelineRayPayloadSize, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPipelineRayHitAttributeSize, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkRayTracingPipelineCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRayTracingPipelineCreateInfoKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkPipelineCreateFlags*)&forMarshaling->flags, sizeof(VkPipelineCreateFlags));
+    *ptr += sizeof(VkPipelineCreateFlags);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->stageCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->stageCount; ++i) {
+        reservedmarshal_VkPipelineShaderStageCreateInfo(
+            vkStream, rootType,
+            (const VkPipelineShaderStageCreateInfo*)(forMarshaling->pStages + i), ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->groupCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    for (uint32_t i = 0; i < (uint32_t)forMarshaling->groupCount; ++i) {
+        reservedmarshal_VkRayTracingShaderGroupCreateInfoKHR(
+            vkStream, rootType,
+            (const VkRayTracingShaderGroupCreateInfoKHR*)(forMarshaling->pGroups + i), ptr);
+    }
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxPipelineRayRecursionDepth, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    // WARNING PTR CHECK
+    uint64_t cgen_var_0 = (uint64_t)(uintptr_t)forMarshaling->pLibraryInfo;
+    memcpy((*ptr), &cgen_var_0, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pLibraryInfo) {
+        reservedmarshal_VkPipelineLibraryCreateInfoKHR(
+            vkStream, rootType,
+            (const VkPipelineLibraryCreateInfoKHR*)(forMarshaling->pLibraryInfo), ptr);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)forMarshaling->pLibraryInterface;
+    memcpy((*ptr), &cgen_var_1, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pLibraryInterface) {
+        reservedmarshal_VkRayTracingPipelineInterfaceCreateInfoKHR(
+            vkStream, rootType,
+            (const VkRayTracingPipelineInterfaceCreateInfoKHR*)(forMarshaling->pLibraryInterface),
+            ptr);
+    }
+    // WARNING PTR CHECK
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)forMarshaling->pDynamicState;
+    memcpy((*ptr), &cgen_var_2, 8);
+    android::base::Stream::toBe64((uint8_t*)(*ptr));
+    *ptr += 8;
+    if (forMarshaling->pDynamicState) {
+        reservedmarshal_VkPipelineDynamicStateCreateInfo(
+            vkStream, rootType,
+            (const VkPipelineDynamicStateCreateInfo*)(forMarshaling->pDynamicState), ptr);
+    }
+    uint64_t cgen_var_3;
+    *&cgen_var_3 = get_host_u64_VkPipelineLayout((*&forMarshaling->layout));
+    memcpy(*ptr, (uint64_t*)&cgen_var_3, 1 * 8);
+    *ptr += 1 * 8;
+    uint64_t cgen_var_4;
+    *&cgen_var_4 = get_host_u64_VkPipeline((*&forMarshaling->basePipelineHandle));
+    memcpy(*ptr, (uint64_t*)&cgen_var_4, 1 * 8);
+    *ptr += 1 * 8;
+    memcpy(*ptr, (int32_t*)&forMarshaling->basePipelineIndex, sizeof(int32_t));
+    *ptr += sizeof(int32_t);
+}
+
+void reservedmarshal_VkPhysicalDeviceRayTracingPipelineFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingPipelineFeaturesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->rayTracingPipeline, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->rayTracingPipelineShaderGroupHandleCaptureReplay,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->rayTracingPipelineShaderGroupHandleCaptureReplayMixed,
+           sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->rayTracingPipelineTraceRaysIndirect, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->rayTraversalPrimitiveCulling, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+void reservedmarshal_VkPhysicalDeviceRayTracingPipelinePropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingPipelinePropertiesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->shaderGroupHandleSize, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxRayRecursionDepth, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxShaderGroupStride, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->shaderGroupBaseAlignment, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->shaderGroupHandleCaptureReplaySize, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxRayDispatchInvocationCount, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->shaderGroupHandleAlignment, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->maxRayHitAttributeSize, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+void reservedmarshal_VkStridedDeviceAddressRegionKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkStridedDeviceAddressRegionKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkDeviceAddress*)&forMarshaling->deviceAddress, sizeof(VkDeviceAddress));
+    *ptr += sizeof(VkDeviceAddress);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->stride, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+    memcpy(*ptr, (VkDeviceSize*)&forMarshaling->size, sizeof(VkDeviceSize));
+    *ptr += sizeof(VkDeviceSize);
+}
+
+void reservedmarshal_VkTraceRaysIndirectCommandKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkTraceRaysIndirectCommandKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (uint32_t*)&forMarshaling->width, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->height, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+    memcpy(*ptr, (uint32_t*)&forMarshaling->depth, sizeof(uint32_t));
+    *ptr += sizeof(uint32_t);
+}
+
+#endif
+#ifdef VK_KHR_ray_query
+void reservedmarshal_VkPhysicalDeviceRayQueryFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRayQueryFeaturesKHR* forMarshaling, uint8_t** ptr) {
+    (void)vkStream;
+    (void)rootType;
+    memcpy(*ptr, (VkStructureType*)&forMarshaling->sType, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (rootType == VK_STRUCTURE_TYPE_MAX_ENUM) {
+        rootType = forMarshaling->sType;
+    }
+    reservedmarshal_extension_struct(vkStream, rootType, forMarshaling->pNext, ptr);
+    memcpy(*ptr, (VkBool32*)&forMarshaling->rayQuery, sizeof(VkBool32));
+    *ptr += sizeof(VkBool32);
+}
+
+#endif
+void reservedmarshal_extension_struct(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const void* structExtension, uint8_t** ptr) {
+    VkInstanceCreateInfo* structAccess = (VkInstanceCreateInfo*)(structExtension);
+    uint32_t currExtSize = goldfish_vk_extension_struct_size_with_stream_features(
+        vkStream->getFeatureBits(), rootType, structExtension);
+    if (!currExtSize && structExtension) {
+        // unknown struct extension; skip and call on its pNext field
+        reservedmarshal_extension_struct(vkStream, rootType, (void*)structAccess->pNext, ptr);
+        return;
+    } else {
+        // known or null extension struct
+        memcpy(*ptr, &currExtSize, sizeof(uint32_t));
+        ;
+        android::base::Stream::toBe32((uint8_t*)*ptr);
+        *ptr += sizeof(uint32_t);
+        if (!currExtSize) {
+            // exit if this was a null extension struct (size == 0 in this branch)
+            return;
+        }
+    }
+    memcpy(*ptr, structExtension, sizeof(VkStructureType));
+    *ptr += sizeof(VkStructureType);
+    if (!structExtension) {
+        return;
+    }
+    uint32_t structType = (uint32_t)goldfish_vk_struct_type(structExtension);
+    switch (structType) {
+#ifdef VK_VERSION_1_1
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES: {
+            reservedmarshal_VkPhysicalDeviceSubgroupProperties(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSubgroupProperties*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: {
+            reservedmarshal_VkPhysicalDevice16BitStorageFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevice16BitStorageFeatures*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS: {
+            reservedmarshal_VkMemoryDedicatedRequirements(
+                vkStream, rootType,
+                reinterpret_cast<const VkMemoryDedicatedRequirements*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO: {
+            reservedmarshal_VkMemoryDedicatedAllocateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkMemoryDedicatedAllocateInfo*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO: {
+            reservedmarshal_VkMemoryAllocateFlagsInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkMemoryAllocateFlagsInfo*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO: {
+            reservedmarshal_VkDeviceGroupRenderPassBeginInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkDeviceGroupRenderPassBeginInfo*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO: {
+            reservedmarshal_VkDeviceGroupCommandBufferBeginInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkDeviceGroupCommandBufferBeginInfo*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO: {
+            reservedmarshal_VkDeviceGroupSubmitInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkDeviceGroupSubmitInfo*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO: {
+            reservedmarshal_VkDeviceGroupBindSparseInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkDeviceGroupBindSparseInfo*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO: {
+            reservedmarshal_VkBindBufferMemoryDeviceGroupInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkBindBufferMemoryDeviceGroupInfo*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO: {
+            reservedmarshal_VkBindImageMemoryDeviceGroupInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkBindImageMemoryDeviceGroupInfo*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO: {
+            reservedmarshal_VkDeviceGroupDeviceCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkDeviceGroupDeviceCreateInfo*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: {
+            reservedmarshal_VkPhysicalDeviceFeatures2(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFeatures2*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES: {
+            reservedmarshal_VkPhysicalDevicePointClippingProperties(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevicePointClippingProperties*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO: {
+            reservedmarshal_VkRenderPassInputAttachmentAspectCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkRenderPassInputAttachmentAspectCreateInfo*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO: {
+            reservedmarshal_VkImageViewUsageCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkImageViewUsageCreateInfo*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO: {
+            reservedmarshal_VkPipelineTessellationDomainOriginStateCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineTessellationDomainOriginStateCreateInfo*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO: {
+            reservedmarshal_VkRenderPassMultiviewCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkRenderPassMultiviewCreateInfo*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES: {
+            reservedmarshal_VkPhysicalDeviceMultiviewFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMultiviewFeatures*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES: {
+            reservedmarshal_VkPhysicalDeviceMultiviewProperties(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMultiviewProperties*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES: {
+            reservedmarshal_VkPhysicalDeviceVariablePointersFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVariablePointersFeatures*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES: {
+            reservedmarshal_VkPhysicalDeviceProtectedMemoryFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceProtectedMemoryFeatures*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES: {
+            reservedmarshal_VkPhysicalDeviceProtectedMemoryProperties(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceProtectedMemoryProperties*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO: {
+            reservedmarshal_VkProtectedSubmitInfo(
+                vkStream, rootType, reinterpret_cast<const VkProtectedSubmitInfo*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO: {
+            reservedmarshal_VkSamplerYcbcrConversionInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkSamplerYcbcrConversionInfo*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO: {
+            reservedmarshal_VkBindImagePlaneMemoryInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkBindImagePlaneMemoryInfo*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO: {
+            reservedmarshal_VkImagePlaneMemoryRequirementsInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkImagePlaneMemoryRequirementsInfo*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: {
+            reservedmarshal_VkPhysicalDeviceSamplerYcbcrConversionFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSamplerYcbcrConversionFeatures*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES: {
+            reservedmarshal_VkSamplerYcbcrConversionImageFormatProperties(
+                vkStream, rootType,
+                reinterpret_cast<const VkSamplerYcbcrConversionImageFormatProperties*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO: {
+            reservedmarshal_VkPhysicalDeviceExternalImageFormatInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceExternalImageFormatInfo*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES: {
+            reservedmarshal_VkExternalImageFormatProperties(
+                vkStream, rootType,
+                reinterpret_cast<const VkExternalImageFormatProperties*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES: {
+            reservedmarshal_VkPhysicalDeviceIDProperties(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceIDProperties*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO: {
+            reservedmarshal_VkExternalMemoryImageCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkExternalMemoryImageCreateInfo*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO: {
+            reservedmarshal_VkExternalMemoryBufferCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkExternalMemoryBufferCreateInfo*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO: {
+            reservedmarshal_VkExportMemoryAllocateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkExportMemoryAllocateInfo*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO: {
+            reservedmarshal_VkExportFenceCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkExportFenceCreateInfo*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO: {
+            reservedmarshal_VkExportSemaphoreCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkExportSemaphoreCreateInfo*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES: {
+            reservedmarshal_VkPhysicalDeviceMaintenance3Properties(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMaintenance3Properties*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES: {
+            reservedmarshal_VkPhysicalDeviceShaderDrawParametersFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderDrawParametersFeatures*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_VERSION_1_2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES: {
+            reservedmarshal_VkPhysicalDeviceVulkan11Features(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVulkan11Features*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES: {
+            reservedmarshal_VkPhysicalDeviceVulkan11Properties(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVulkan11Properties*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES: {
+            reservedmarshal_VkPhysicalDeviceVulkan12Features(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVulkan12Features*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES: {
+            reservedmarshal_VkPhysicalDeviceVulkan12Properties(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVulkan12Properties*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO: {
+            reservedmarshal_VkImageFormatListCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkImageFormatListCreateInfo*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES: {
+            reservedmarshal_VkPhysicalDevice8BitStorageFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevice8BitStorageFeatures*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES: {
+            reservedmarshal_VkPhysicalDeviceDriverProperties(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDriverProperties*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES: {
+            reservedmarshal_VkPhysicalDeviceShaderAtomicInt64Features(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderAtomicInt64Features*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES: {
+            reservedmarshal_VkPhysicalDeviceShaderFloat16Int8Features(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderFloat16Int8Features*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES: {
+            reservedmarshal_VkPhysicalDeviceFloatControlsProperties(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFloatControlsProperties*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO: {
+            reservedmarshal_VkDescriptorSetLayoutBindingFlagsCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkDescriptorSetLayoutBindingFlagsCreateInfo*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES: {
+            reservedmarshal_VkPhysicalDeviceDescriptorIndexingFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDescriptorIndexingFeatures*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES: {
+            reservedmarshal_VkPhysicalDeviceDescriptorIndexingProperties(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDescriptorIndexingProperties*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO: {
+            reservedmarshal_VkDescriptorSetVariableDescriptorCountAllocateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkDescriptorSetVariableDescriptorCountAllocateInfo*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT: {
+            reservedmarshal_VkDescriptorSetVariableDescriptorCountLayoutSupport(
+                vkStream, rootType,
+                reinterpret_cast<const VkDescriptorSetVariableDescriptorCountLayoutSupport*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE: {
+            reservedmarshal_VkSubpassDescriptionDepthStencilResolve(
+                vkStream, rootType,
+                reinterpret_cast<const VkSubpassDescriptionDepthStencilResolve*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES: {
+            reservedmarshal_VkPhysicalDeviceDepthStencilResolveProperties(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDepthStencilResolveProperties*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES: {
+            reservedmarshal_VkPhysicalDeviceScalarBlockLayoutFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceScalarBlockLayoutFeatures*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO: {
+            reservedmarshal_VkImageStencilUsageCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkImageStencilUsageCreateInfo*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO: {
+            reservedmarshal_VkSamplerReductionModeCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkSamplerReductionModeCreateInfo*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES: {
+            reservedmarshal_VkPhysicalDeviceSamplerFilterMinmaxProperties(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSamplerFilterMinmaxProperties*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES: {
+            reservedmarshal_VkPhysicalDeviceVulkanMemoryModelFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVulkanMemoryModelFeatures*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES: {
+            reservedmarshal_VkPhysicalDeviceImagelessFramebufferFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceImagelessFramebufferFeatures*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO: {
+            reservedmarshal_VkFramebufferAttachmentsCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkFramebufferAttachmentsCreateInfo*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO: {
+            reservedmarshal_VkRenderPassAttachmentBeginInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkRenderPassAttachmentBeginInfo*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES: {
+            reservedmarshal_VkPhysicalDeviceUniformBufferStandardLayoutFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceUniformBufferStandardLayoutFeatures*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES: {
+            reservedmarshal_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES: {
+            reservedmarshal_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT: {
+            reservedmarshal_VkAttachmentReferenceStencilLayout(
+                vkStream, rootType,
+                reinterpret_cast<const VkAttachmentReferenceStencilLayout*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT: {
+            reservedmarshal_VkAttachmentDescriptionStencilLayout(
+                vkStream, rootType,
+                reinterpret_cast<const VkAttachmentDescriptionStencilLayout*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES: {
+            reservedmarshal_VkPhysicalDeviceHostQueryResetFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceHostQueryResetFeatures*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES: {
+            reservedmarshal_VkPhysicalDeviceTimelineSemaphoreFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceTimelineSemaphoreFeatures*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES: {
+            reservedmarshal_VkPhysicalDeviceTimelineSemaphoreProperties(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceTimelineSemaphoreProperties*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO: {
+            reservedmarshal_VkSemaphoreTypeCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkSemaphoreTypeCreateInfo*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO: {
+            reservedmarshal_VkTimelineSemaphoreSubmitInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkTimelineSemaphoreSubmitInfo*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES: {
+            reservedmarshal_VkPhysicalDeviceBufferDeviceAddressFeatures(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceBufferDeviceAddressFeatures*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO: {
+            reservedmarshal_VkBufferOpaqueCaptureAddressCreateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkBufferOpaqueCaptureAddressCreateInfo*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO: {
+            reservedmarshal_VkMemoryOpaqueCaptureAddressAllocateInfo(
+                vkStream, rootType,
+                reinterpret_cast<const VkMemoryOpaqueCaptureAddressAllocateInfo*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_swapchain
+        case VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR: {
+            reservedmarshal_VkImageSwapchainCreateInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkImageSwapchainCreateInfoKHR*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR: {
+            reservedmarshal_VkBindImageMemorySwapchainInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkBindImageMemorySwapchainInfoKHR*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR: {
+            reservedmarshal_VkDeviceGroupPresentInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkDeviceGroupPresentInfoKHR*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR: {
+            reservedmarshal_VkDeviceGroupSwapchainCreateInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkDeviceGroupSwapchainCreateInfoKHR*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_display_swapchain
+        case VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR: {
+            reservedmarshal_VkDisplayPresentInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkDisplayPresentInfoKHR*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_video_queue
+        case VK_STRUCTURE_TYPE_VIDEO_QUEUE_FAMILY_PROPERTIES_2_KHR: {
+            reservedmarshal_VkVideoQueueFamilyProperties2KHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoQueueFamilyProperties2KHR*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_PROFILE_KHR: {
+            reservedmarshal_VkVideoProfileKHR(
+                vkStream, rootType, reinterpret_cast<const VkVideoProfileKHR*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_PROFILES_KHR: {
+            reservedmarshal_VkVideoProfilesKHR(
+                vkStream, rootType, reinterpret_cast<const VkVideoProfilesKHR*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_dynamic_rendering
+        case VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO_KHR: {
+            reservedmarshal_VkPipelineRenderingCreateInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineRenderingCreateInfoKHR*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR: {
+            reservedmarshal_VkPhysicalDeviceDynamicRenderingFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDynamicRenderingFeaturesKHR*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO_KHR: {
+            reservedmarshal_VkCommandBufferInheritanceRenderingInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkCommandBufferInheritanceRenderingInfoKHR*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR: {
+            reservedmarshal_VkRenderingFragmentShadingRateAttachmentInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkRenderingFragmentShadingRateAttachmentInfoKHR*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT: {
+            reservedmarshal_VkRenderingFragmentDensityMapAttachmentInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkRenderingFragmentDensityMapAttachmentInfoEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD: {
+            reservedmarshal_VkAttachmentSampleCountInfoAMD(
+                vkStream, rootType,
+                reinterpret_cast<const VkAttachmentSampleCountInfoAMD*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX: {
+            reservedmarshal_VkMultiviewPerViewAttributesInfoNVX(
+                vkStream, rootType,
+                reinterpret_cast<const VkMultiviewPerViewAttributesInfoNVX*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_memory_win32
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR: {
+            reservedmarshal_VkImportMemoryWin32HandleInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkImportMemoryWin32HandleInfoKHR*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR: {
+            reservedmarshal_VkExportMemoryWin32HandleInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkExportMemoryWin32HandleInfoKHR*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_memory_fd
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR: {
+            reservedmarshal_VkImportMemoryFdInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkImportMemoryFdInfoKHR*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_win32_keyed_mutex
+        case VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR: {
+            reservedmarshal_VkWin32KeyedMutexAcquireReleaseInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkWin32KeyedMutexAcquireReleaseInfoKHR*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+        case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR: {
+            reservedmarshal_VkExportSemaphoreWin32HandleInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkExportSemaphoreWin32HandleInfoKHR*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR: {
+            reservedmarshal_VkD3D12FenceSubmitInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkD3D12FenceSubmitInfoKHR*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_push_descriptor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR: {
+            reservedmarshal_VkPhysicalDevicePushDescriptorPropertiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevicePushDescriptorPropertiesKHR*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_incremental_present
+        case VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR: {
+            reservedmarshal_VkPresentRegionsKHR(
+                vkStream, rootType, reinterpret_cast<const VkPresentRegionsKHR*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_shared_presentable_image
+        case VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR: {
+            reservedmarshal_VkSharedPresentSurfaceCapabilitiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkSharedPresentSurfaceCapabilitiesKHR*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_fence_win32
+        case VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR: {
+            reservedmarshal_VkExportFenceWin32HandleInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkExportFenceWin32HandleInfoKHR*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_performance_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR: {
+            reservedmarshal_VkPhysicalDevicePerformanceQueryFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevicePerformanceQueryFeaturesKHR*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR: {
+            reservedmarshal_VkPhysicalDevicePerformanceQueryPropertiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevicePerformanceQueryPropertiesKHR*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR: {
+            reservedmarshal_VkQueryPoolPerformanceCreateInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkQueryPoolPerformanceCreateInfoKHR*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR: {
+            reservedmarshal_VkPerformanceQuerySubmitInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPerformanceQuerySubmitInfoKHR*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_portability_subset
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR: {
+            reservedmarshal_VkPhysicalDevicePortabilitySubsetFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevicePortabilitySubsetFeaturesKHR*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR: {
+            reservedmarshal_VkPhysicalDevicePortabilitySubsetPropertiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevicePortabilitySubsetPropertiesKHR*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_clock
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR: {
+            reservedmarshal_VkPhysicalDeviceShaderClockFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderClockFeaturesKHR*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_terminate_invocation
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR: {
+            reservedmarshal_VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+        case VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR: {
+            reservedmarshal_VkFragmentShadingRateAttachmentInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkFragmentShadingRateAttachmentInfoKHR*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR: {
+            reservedmarshal_VkPipelineFragmentShadingRateStateCreateInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineFragmentShadingRateStateCreateInfoKHR*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR: {
+            reservedmarshal_VkPhysicalDeviceFragmentShadingRateFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentShadingRateFeaturesKHR*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR: {
+            reservedmarshal_VkPhysicalDeviceFragmentShadingRatePropertiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentShadingRatePropertiesKHR*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_surface_protected_capabilities
+        case VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR: {
+            reservedmarshal_VkSurfaceProtectedCapabilitiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkSurfaceProtectedCapabilitiesKHR*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_present_wait
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR: {
+            reservedmarshal_VkPhysicalDevicePresentWaitFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevicePresentWaitFeaturesKHR*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR: {
+            reservedmarshal_VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_integer_dot_product
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR: {
+            reservedmarshal_VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR: {
+            reservedmarshal_VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_present_id
+        case VK_STRUCTURE_TYPE_PRESENT_ID_KHR: {
+            reservedmarshal_VkPresentIdKHR(
+                vkStream, rootType, reinterpret_cast<const VkPresentIdKHR*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR: {
+            reservedmarshal_VkPhysicalDevicePresentIdFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevicePresentIdFeaturesKHR*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_video_encode_queue
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_INFO_KHR: {
+            reservedmarshal_VkVideoEncodeRateControlInfoKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeRateControlInfoKHR*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_synchronization2
+        case VK_STRUCTURE_TYPE_MEMORY_BARRIER_2_KHR: {
+            reservedmarshal_VkMemoryBarrier2KHR(
+                vkStream, rootType, reinterpret_cast<const VkMemoryBarrier2KHR*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR: {
+            reservedmarshal_VkPhysicalDeviceSynchronization2FeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSynchronization2FeaturesKHR*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV: {
+            reservedmarshal_VkQueueFamilyCheckpointProperties2NV(
+                vkStream, rootType,
+                reinterpret_cast<const VkQueueFamilyCheckpointProperties2NV*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_subgroup_uniform_control_flow
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR: {
+            reservedmarshal_VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<
+                    const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_zero_initialize_workgroup_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES_KHR: {
+            reservedmarshal_VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_workgroup_memory_explicit_layout
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR: {
+            reservedmarshal_VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_format_feature_flags2
+        case VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3_KHR: {
+            reservedmarshal_VkFormatProperties3KHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkFormatProperties3KHR*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_maintenance4
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES_KHR: {
+            reservedmarshal_VkPhysicalDeviceMaintenance4FeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMaintenance4FeaturesKHR*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES_KHR: {
+            reservedmarshal_VkPhysicalDeviceMaintenance4PropertiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMaintenance4PropertiesKHR*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_ANDROID_native_buffer
+        case VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID: {
+            reservedmarshal_VkNativeBufferANDROID(
+                vkStream, rootType, reinterpret_cast<const VkNativeBufferANDROID*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_debug_report
+        case VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT: {
+            reservedmarshal_VkDebugReportCallbackCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkDebugReportCallbackCreateInfoEXT*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_AMD_rasterization_order
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD: {
+            reservedmarshal_VkPipelineRasterizationStateRasterizationOrderAMD(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineRasterizationStateRasterizationOrderAMD*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_NV_dedicated_allocation
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV: {
+            reservedmarshal_VkDedicatedAllocationImageCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkDedicatedAllocationImageCreateInfoNV*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV: {
+            reservedmarshal_VkDedicatedAllocationBufferCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkDedicatedAllocationBufferCreateInfoNV*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV: {
+            reservedmarshal_VkDedicatedAllocationMemoryAllocateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkDedicatedAllocationMemoryAllocateInfoNV*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_transform_feedback
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceTransformFeedbackFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceTransformFeedbackFeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT: {
+            reservedmarshal_VkPhysicalDeviceTransformFeedbackPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceTransformFeedbackPropertiesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT: {
+            reservedmarshal_VkPipelineRasterizationStateStreamCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineRasterizationStateStreamCreateInfoEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_encode_h264
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_EXT: {
+            reservedmarshal_VkVideoEncodeH264CapabilitiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeH264CapabilitiesEXT*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_CREATE_INFO_EXT: {
+            reservedmarshal_VkVideoEncodeH264SessionCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeH264SessionCreateInfoEXT*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            reservedmarshal_VkVideoEncodeH264SessionParametersAddInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeH264SessionParametersAddInfoEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            reservedmarshal_VkVideoEncodeH264SessionParametersCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeH264SessionParametersCreateInfoEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_VCL_FRAME_INFO_EXT: {
+            reservedmarshal_VkVideoEncodeH264VclFrameInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeH264VclFrameInfoEXT*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_EMIT_PICTURE_PARAMETERS_EXT: {
+            reservedmarshal_VkVideoEncodeH264EmitPictureParametersEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeH264EmitPictureParametersEXT*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_EXT: {
+            reservedmarshal_VkVideoEncodeH264ProfileEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeH264ProfileEXT*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_encode_h265
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_EXT: {
+            reservedmarshal_VkVideoEncodeH265CapabilitiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeH265CapabilitiesEXT*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_CREATE_INFO_EXT: {
+            reservedmarshal_VkVideoEncodeH265SessionCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeH265SessionCreateInfoEXT*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            reservedmarshal_VkVideoEncodeH265SessionParametersAddInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeH265SessionParametersAddInfoEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            reservedmarshal_VkVideoEncodeH265SessionParametersCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeH265SessionParametersCreateInfoEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_VCL_FRAME_INFO_EXT: {
+            reservedmarshal_VkVideoEncodeH265VclFrameInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeH265VclFrameInfoEXT*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_EMIT_PICTURE_PARAMETERS_EXT: {
+            reservedmarshal_VkVideoEncodeH265EmitPictureParametersEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeH265EmitPictureParametersEXT*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_EXT: {
+            reservedmarshal_VkVideoEncodeH265ProfileEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoEncodeH265ProfileEXT*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_decode_h264
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_EXT: {
+            reservedmarshal_VkVideoDecodeH264ProfileEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH264ProfileEXT*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_EXT: {
+            reservedmarshal_VkVideoDecodeH264CapabilitiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH264CapabilitiesEXT*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_CREATE_INFO_EXT: {
+            reservedmarshal_VkVideoDecodeH264SessionCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH264SessionCreateInfoEXT*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            reservedmarshal_VkVideoDecodeH264SessionParametersAddInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH264SessionParametersAddInfoEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            reservedmarshal_VkVideoDecodeH264SessionParametersCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH264SessionParametersCreateInfoEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PICTURE_INFO_EXT: {
+            reservedmarshal_VkVideoDecodeH264PictureInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH264PictureInfoEXT*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_MVC_EXT: {
+            reservedmarshal_VkVideoDecodeH264MvcEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH264MvcEXT*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_EXT: {
+            reservedmarshal_VkVideoDecodeH264DpbSlotInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH264DpbSlotInfoEXT*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_AMD_texture_gather_bias_lod
+        case VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD: {
+            reservedmarshal_VkTextureLODGatherFormatPropertiesAMD(
+                vkStream, rootType,
+                reinterpret_cast<const VkTextureLODGatherFormatPropertiesAMD*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_NV_corner_sampled_image
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV: {
+            reservedmarshal_VkPhysicalDeviceCornerSampledImageFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceCornerSampledImageFeaturesNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_NV_external_memory
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV: {
+            reservedmarshal_VkExternalMemoryImageCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkExternalMemoryImageCreateInfoNV*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV: {
+            reservedmarshal_VkExportMemoryAllocateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkExportMemoryAllocateInfoNV*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_NV_external_memory_win32
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV: {
+            reservedmarshal_VkImportMemoryWin32HandleInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkImportMemoryWin32HandleInfoNV*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV: {
+            reservedmarshal_VkExportMemoryWin32HandleInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkExportMemoryWin32HandleInfoNV*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_NV_win32_keyed_mutex
+        case VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV: {
+            reservedmarshal_VkWin32KeyedMutexAcquireReleaseInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkWin32KeyedMutexAcquireReleaseInfoNV*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_validation_flags
+        case VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT: {
+            reservedmarshal_VkValidationFlagsEXT(
+                vkStream, rootType, reinterpret_cast<const VkValidationFlagsEXT*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_texture_compression_astc_hdr
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_astc_decode_mode
+        case VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT: {
+            reservedmarshal_VkImageViewASTCDecodeModeEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkImageViewASTCDecodeModeEXT*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceASTCDecodeFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceASTCDecodeFeaturesEXT*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_conditional_rendering
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceConditionalRenderingFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceConditionalRenderingFeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT: {
+            reservedmarshal_VkCommandBufferInheritanceConditionalRenderingInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkCommandBufferInheritanceConditionalRenderingInfoEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV: {
+            reservedmarshal_VkPipelineViewportWScalingStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineViewportWScalingStateCreateInfoNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_display_control
+        case VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT: {
+            reservedmarshal_VkSwapchainCounterCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkSwapchainCounterCreateInfoEXT*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_GOOGLE_display_timing
+        case VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE: {
+            reservedmarshal_VkPresentTimesInfoGOOGLE(
+                vkStream, rootType,
+                reinterpret_cast<const VkPresentTimesInfoGOOGLE*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_NVX_multiview_per_view_attributes
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX: {
+            reservedmarshal_VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_NV_viewport_swizzle
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV: {
+            reservedmarshal_VkPipelineViewportSwizzleStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineViewportSwizzleStateCreateInfoNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_discard_rectangles
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT: {
+            reservedmarshal_VkPhysicalDeviceDiscardRectanglePropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDiscardRectanglePropertiesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT: {
+            reservedmarshal_VkPipelineDiscardRectangleStateCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineDiscardRectangleStateCreateInfoEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_conservative_rasterization
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT: {
+            reservedmarshal_VkPhysicalDeviceConservativeRasterizationPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceConservativeRasterizationPropertiesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT: {
+            reservedmarshal_VkPipelineRasterizationConservativeStateCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineRasterizationConservativeStateCreateInfoEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_depth_clip_enable
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceDepthClipEnableFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDepthClipEnableFeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT: {
+            reservedmarshal_VkPipelineRasterizationDepthClipStateCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineRasterizationDepthClipStateCreateInfoEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_debug_utils
+        case VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT: {
+            reservedmarshal_VkDebugUtilsMessengerCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkDebugUtilsMessengerCreateInfoEXT*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID: {
+            reservedmarshal_VkAndroidHardwareBufferUsageANDROID(
+                vkStream, rootType,
+                reinterpret_cast<const VkAndroidHardwareBufferUsageANDROID*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID: {
+            reservedmarshal_VkAndroidHardwareBufferFormatPropertiesANDROID(
+                vkStream, rootType,
+                reinterpret_cast<const VkAndroidHardwareBufferFormatPropertiesANDROID*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID: {
+            reservedmarshal_VkImportAndroidHardwareBufferInfoANDROID(
+                vkStream, rootType,
+                reinterpret_cast<const VkImportAndroidHardwareBufferInfoANDROID*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID: {
+            reservedmarshal_VkExternalFormatANDROID(
+                vkStream, rootType,
+                reinterpret_cast<const VkExternalFormatANDROID*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID: {
+            reservedmarshal_VkAndroidHardwareBufferFormatProperties2ANDROID(
+                vkStream, rootType,
+                reinterpret_cast<const VkAndroidHardwareBufferFormatProperties2ANDROID*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_inline_uniform_block
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceInlineUniformBlockFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceInlineUniformBlockFeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT: {
+            reservedmarshal_VkPhysicalDeviceInlineUniformBlockPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceInlineUniformBlockPropertiesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT: {
+            reservedmarshal_VkWriteDescriptorSetInlineUniformBlockEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkWriteDescriptorSetInlineUniformBlockEXT*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO_EXT: {
+            reservedmarshal_VkDescriptorPoolInlineUniformBlockCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkDescriptorPoolInlineUniformBlockCreateInfoEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_sample_locations
+        case VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT: {
+            reservedmarshal_VkSampleLocationsInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkSampleLocationsInfoEXT*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT: {
+            reservedmarshal_VkRenderPassSampleLocationsBeginInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkRenderPassSampleLocationsBeginInfoEXT*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT: {
+            reservedmarshal_VkPipelineSampleLocationsStateCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineSampleLocationsStateCreateInfoEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT: {
+            reservedmarshal_VkPhysicalDeviceSampleLocationsPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSampleLocationsPropertiesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_blend_operation_advanced
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT: {
+            reservedmarshal_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT: {
+            reservedmarshal_VkPipelineColorBlendAdvancedStateCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineColorBlendAdvancedStateCreateInfoEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_NV_fragment_coverage_to_color
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV: {
+            reservedmarshal_VkPipelineCoverageToColorStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineCoverageToColorStateCreateInfoNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_NV_framebuffer_mixed_samples
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV: {
+            reservedmarshal_VkPipelineCoverageModulationStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineCoverageModulationStateCreateInfoNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_NV_shader_sm_builtins
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV: {
+            reservedmarshal_VkPhysicalDeviceShaderSMBuiltinsPropertiesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderSMBuiltinsPropertiesNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV: {
+            reservedmarshal_VkPhysicalDeviceShaderSMBuiltinsFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderSMBuiltinsFeaturesNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+        case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT: {
+            reservedmarshal_VkDrmFormatModifierPropertiesListEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkDrmFormatModifierPropertiesListEXT*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT: {
+            reservedmarshal_VkPhysicalDeviceImageDrmFormatModifierInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceImageDrmFormatModifierInfoEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT: {
+            reservedmarshal_VkImageDrmFormatModifierListCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkImageDrmFormatModifierListCreateInfoEXT*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT: {
+            reservedmarshal_VkImageDrmFormatModifierExplicitCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkImageDrmFormatModifierExplicitCreateInfoEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT: {
+            reservedmarshal_VkDrmFormatModifierPropertiesList2EXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkDrmFormatModifierPropertiesList2EXT*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_validation_cache
+        case VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT: {
+            reservedmarshal_VkShaderModuleValidationCacheCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkShaderModuleValidationCacheCreateInfoEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_NV_shading_rate_image
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV: {
+            reservedmarshal_VkPipelineViewportShadingRateImageStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineViewportShadingRateImageStateCreateInfoNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV: {
+            reservedmarshal_VkPhysicalDeviceShadingRateImageFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShadingRateImageFeaturesNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV: {
+            reservedmarshal_VkPhysicalDeviceShadingRateImagePropertiesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShadingRateImagePropertiesNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV: {
+            reservedmarshal_VkPipelineViewportCoarseSampleOrderStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineViewportCoarseSampleOrderStateCreateInfoNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_NV_ray_tracing
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV: {
+            reservedmarshal_VkWriteDescriptorSetAccelerationStructureNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkWriteDescriptorSetAccelerationStructureNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV: {
+            reservedmarshal_VkPhysicalDeviceRayTracingPropertiesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRayTracingPropertiesNV*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_NV_representative_fragment_test
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV: {
+            reservedmarshal_VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV: {
+            reservedmarshal_VkPipelineRepresentativeFragmentTestStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineRepresentativeFragmentTestStateCreateInfoNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_filter_cubic
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT: {
+            reservedmarshal_VkPhysicalDeviceImageViewImageFormatInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceImageViewImageFormatInfoEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT: {
+            reservedmarshal_VkFilterCubicImageViewImageFormatPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkFilterCubicImageViewImageFormatPropertiesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_global_priority
+        case VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT: {
+            reservedmarshal_VkDeviceQueueGlobalPriorityCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkDeviceQueueGlobalPriorityCreateInfoEXT*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_external_memory_host
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT: {
+            reservedmarshal_VkImportMemoryHostPointerInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkImportMemoryHostPointerInfoEXT*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT: {
+            reservedmarshal_VkPhysicalDeviceExternalMemoryHostPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceExternalMemoryHostPropertiesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_AMD_pipeline_compiler_control
+        case VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD: {
+            reservedmarshal_VkPipelineCompilerControlCreateInfoAMD(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineCompilerControlCreateInfoAMD*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_AMD_shader_core_properties
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD: {
+            reservedmarshal_VkPhysicalDeviceShaderCorePropertiesAMD(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderCorePropertiesAMD*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_decode_h265
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_EXT: {
+            reservedmarshal_VkVideoDecodeH265ProfileEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH265ProfileEXT*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_EXT: {
+            reservedmarshal_VkVideoDecodeH265CapabilitiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH265CapabilitiesEXT*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_CREATE_INFO_EXT: {
+            reservedmarshal_VkVideoDecodeH265SessionCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH265SessionCreateInfoEXT*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            reservedmarshal_VkVideoDecodeH265SessionParametersAddInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH265SessionParametersAddInfoEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            reservedmarshal_VkVideoDecodeH265SessionParametersCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH265SessionParametersCreateInfoEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PICTURE_INFO_EXT: {
+            reservedmarshal_VkVideoDecodeH265PictureInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH265PictureInfoEXT*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_EXT: {
+            reservedmarshal_VkVideoDecodeH265DpbSlotInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkVideoDecodeH265DpbSlotInfoEXT*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_AMD_memory_overallocation_behavior
+        case VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD: {
+            reservedmarshal_VkDeviceMemoryOverallocationCreateInfoAMD(
+                vkStream, rootType,
+                reinterpret_cast<const VkDeviceMemoryOverallocationCreateInfoAMD*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_vertex_attribute_divisor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT: {
+            reservedmarshal_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT: {
+            reservedmarshal_VkPipelineVertexInputDivisorStateCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineVertexInputDivisorStateCreateInfoEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_GGP_frame_token
+        case VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP: {
+            reservedmarshal_VkPresentFrameTokenGGP(
+                vkStream, rootType,
+                reinterpret_cast<const VkPresentFrameTokenGGP*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_pipeline_creation_feedback
+        case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT: {
+            reservedmarshal_VkPipelineCreationFeedbackCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineCreationFeedbackCreateInfoEXT*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_NV_compute_shader_derivatives
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV: {
+            reservedmarshal_VkPhysicalDeviceComputeShaderDerivativesFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceComputeShaderDerivativesFeaturesNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_NV_mesh_shader
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV: {
+            reservedmarshal_VkPhysicalDeviceMeshShaderFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMeshShaderFeaturesNV*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV: {
+            reservedmarshal_VkPhysicalDeviceMeshShaderPropertiesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMeshShaderPropertiesNV*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_NV_fragment_shader_barycentric
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV: {
+            reservedmarshal_VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_NV_shader_image_footprint
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV: {
+            reservedmarshal_VkPhysicalDeviceShaderImageFootprintFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderImageFootprintFeaturesNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_NV_scissor_exclusive
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV: {
+            reservedmarshal_VkPipelineViewportExclusiveScissorStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineViewportExclusiveScissorStateCreateInfoNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV: {
+            reservedmarshal_VkPhysicalDeviceExclusiveScissorFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceExclusiveScissorFeaturesNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV: {
+            reservedmarshal_VkQueueFamilyCheckpointPropertiesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkQueueFamilyCheckpointPropertiesNV*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_INTEL_shader_integer_functions2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL: {
+            reservedmarshal_VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_INTEL_performance_query
+        case VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL: {
+            reservedmarshal_VkQueryPoolPerformanceQueryCreateInfoINTEL(
+                vkStream, rootType,
+                reinterpret_cast<const VkQueryPoolPerformanceQueryCreateInfoINTEL*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_pci_bus_info
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT: {
+            reservedmarshal_VkPhysicalDevicePCIBusInfoPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevicePCIBusInfoPropertiesEXT*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_AMD_display_native_hdr
+        case VK_STRUCTURE_TYPE_DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD: {
+            reservedmarshal_VkDisplayNativeHdrSurfaceCapabilitiesAMD(
+                vkStream, rootType,
+                reinterpret_cast<const VkDisplayNativeHdrSurfaceCapabilitiesAMD*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD: {
+            reservedmarshal_VkSwapchainDisplayNativeHdrCreateInfoAMD(
+                vkStream, rootType,
+                reinterpret_cast<const VkSwapchainDisplayNativeHdrCreateInfoAMD*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_fragment_density_map
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT: {
+            switch (rootType) {
+                case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: {
+                    reservedmarshal_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+                        vkStream, rootType,
+                        reinterpret_cast<const VkPhysicalDeviceFragmentDensityMapFeaturesEXT*>(
+                            structExtension),
+                        ptr);
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO: {
+                    reservedmarshal_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+                        vkStream, rootType,
+                        reinterpret_cast<const VkPhysicalDeviceFragmentDensityMapFeaturesEXT*>(
+                            structExtension),
+                        ptr);
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO: {
+                    reservedmarshal_VkImportColorBufferGOOGLE(
+                        vkStream, rootType,
+                        reinterpret_cast<const VkImportColorBufferGOOGLE*>(structExtension), ptr);
+                    break;
+                }
+                default: {
+                    reservedmarshal_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+                        vkStream, rootType,
+                        reinterpret_cast<const VkPhysicalDeviceFragmentDensityMapFeaturesEXT*>(
+                            structExtension),
+                        ptr);
+                    break;
+                }
+            }
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT: {
+            switch (rootType) {
+                case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2: {
+                    reservedmarshal_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
+                        vkStream, rootType,
+                        reinterpret_cast<const VkPhysicalDeviceFragmentDensityMapPropertiesEXT*>(
+                            structExtension),
+                        ptr);
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO: {
+                    reservedmarshal_VkCreateBlobGOOGLE(
+                        vkStream, rootType,
+                        reinterpret_cast<const VkCreateBlobGOOGLE*>(structExtension), ptr);
+                    break;
+                }
+                default: {
+                    reservedmarshal_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
+                        vkStream, rootType,
+                        reinterpret_cast<const VkPhysicalDeviceFragmentDensityMapPropertiesEXT*>(
+                            structExtension),
+                        ptr);
+                    break;
+                }
+            }
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT: {
+            switch (rootType) {
+                case VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO: {
+                    reservedmarshal_VkRenderPassFragmentDensityMapCreateInfoEXT(
+                        vkStream, rootType,
+                        reinterpret_cast<const VkRenderPassFragmentDensityMapCreateInfoEXT*>(
+                            structExtension),
+                        ptr);
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2: {
+                    reservedmarshal_VkRenderPassFragmentDensityMapCreateInfoEXT(
+                        vkStream, rootType,
+                        reinterpret_cast<const VkRenderPassFragmentDensityMapCreateInfoEXT*>(
+                            structExtension),
+                        ptr);
+                    break;
+                }
+                case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO: {
+                    reservedmarshal_VkImportBufferGOOGLE(
+                        vkStream, rootType,
+                        reinterpret_cast<const VkImportBufferGOOGLE*>(structExtension), ptr);
+                    break;
+                }
+                default: {
+                    reservedmarshal_VkRenderPassFragmentDensityMapCreateInfoEXT(
+                        vkStream, rootType,
+                        reinterpret_cast<const VkRenderPassFragmentDensityMapCreateInfoEXT*>(
+                            structExtension),
+                        ptr);
+                    break;
+                }
+            }
+            break;
+        }
+#endif
+#ifdef VK_EXT_subgroup_size_control
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceSubgroupSizeControlFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSubgroupSizeControlFeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT: {
+            reservedmarshal_VkPhysicalDeviceSubgroupSizeControlPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSubgroupSizeControlPropertiesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT: {
+            reservedmarshal_VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_AMD_shader_core_properties2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD: {
+            reservedmarshal_VkPhysicalDeviceShaderCoreProperties2AMD(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderCoreProperties2AMD*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_AMD_device_coherent_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD: {
+            reservedmarshal_VkPhysicalDeviceCoherentMemoryFeaturesAMD(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceCoherentMemoryFeaturesAMD*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_image_atomic_int64
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_memory_budget
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT: {
+            reservedmarshal_VkPhysicalDeviceMemoryBudgetPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMemoryBudgetPropertiesEXT*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_memory_priority
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceMemoryPriorityFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMemoryPriorityFeaturesEXT*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT: {
+            reservedmarshal_VkMemoryPriorityAllocateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkMemoryPriorityAllocateInfoEXT*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_NV_dedicated_allocation_image_aliasing
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV: {
+            reservedmarshal_VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_buffer_device_address
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT: {
+            reservedmarshal_VkBufferDeviceAddressCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkBufferDeviceAddressCreateInfoEXT*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_validation_features
+        case VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT: {
+            reservedmarshal_VkValidationFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkValidationFeaturesEXT*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_NV_cooperative_matrix
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV: {
+            reservedmarshal_VkPhysicalDeviceCooperativeMatrixFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceCooperativeMatrixFeaturesNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV: {
+            reservedmarshal_VkPhysicalDeviceCooperativeMatrixPropertiesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceCooperativeMatrixPropertiesNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV: {
+            reservedmarshal_VkPhysicalDeviceCoverageReductionModeFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceCoverageReductionModeFeaturesNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV: {
+            reservedmarshal_VkPipelineCoverageReductionStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineCoverageReductionStateCreateInfoNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_fragment_shader_interlock
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_ycbcr_image_arrays
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceYcbcrImageArraysFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_provoking_vertex
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceProvokingVertexFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceProvokingVertexFeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT: {
+            reservedmarshal_VkPhysicalDeviceProvokingVertexPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceProvokingVertexPropertiesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT: {
+            reservedmarshal_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+        case VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT: {
+            reservedmarshal_VkSurfaceFullScreenExclusiveInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkSurfaceFullScreenExclusiveInfoEXT*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT: {
+            reservedmarshal_VkSurfaceCapabilitiesFullScreenExclusiveEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkSurfaceCapabilitiesFullScreenExclusiveEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT: {
+            reservedmarshal_VkSurfaceFullScreenExclusiveWin32InfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkSurfaceFullScreenExclusiveWin32InfoEXT*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_line_rasterization
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceLineRasterizationFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceLineRasterizationFeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT: {
+            reservedmarshal_VkPhysicalDeviceLineRasterizationPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceLineRasterizationPropertiesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT: {
+            reservedmarshal_VkPipelineRasterizationLineStateCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineRasterizationLineStateCreateInfoEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_atomic_float
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceShaderAtomicFloatFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_index_type_uint8
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceIndexTypeUint8FeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceIndexTypeUint8FeaturesEXT*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceExtendedDynamicStateFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_atomic_float2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_demote_to_helper_invocation
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_NV_device_generated_commands
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV: {
+            reservedmarshal_VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV: {
+            reservedmarshal_VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV: {
+            reservedmarshal_VkGraphicsPipelineShaderGroupsCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkGraphicsPipelineShaderGroupsCreateInfoNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_NV_inherited_viewport_scissor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV: {
+            reservedmarshal_VkPhysicalDeviceInheritedViewportScissorFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceInheritedViewportScissorFeaturesNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV: {
+            reservedmarshal_VkCommandBufferInheritanceViewportScissorInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkCommandBufferInheritanceViewportScissorInfoNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_texel_buffer_alignment
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT: {
+            reservedmarshal_VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_QCOM_render_pass_transform
+        case VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM: {
+            reservedmarshal_VkRenderPassTransformBeginInfoQCOM(
+                vkStream, rootType,
+                reinterpret_cast<const VkRenderPassTransformBeginInfoQCOM*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM: {
+            reservedmarshal_VkCommandBufferInheritanceRenderPassTransformInfoQCOM(
+                vkStream, rootType,
+                reinterpret_cast<const VkCommandBufferInheritanceRenderPassTransformInfoQCOM*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_device_memory_report
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceDeviceMemoryReportFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDeviceMemoryReportFeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT: {
+            reservedmarshal_VkDeviceDeviceMemoryReportCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkDeviceDeviceMemoryReportCreateInfoEXT*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_robustness2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceRobustness2FeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRobustness2FeaturesEXT*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT: {
+            reservedmarshal_VkPhysicalDeviceRobustness2PropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRobustness2PropertiesEXT*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_custom_border_color
+        case VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT: {
+            reservedmarshal_VkSamplerCustomBorderColorCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkSamplerCustomBorderColorCreateInfoEXT*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT: {
+            reservedmarshal_VkPhysicalDeviceCustomBorderColorPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceCustomBorderColorPropertiesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceCustomBorderColorFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceCustomBorderColorFeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_private_data
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDevicePrivateDataFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevicePrivateDataFeaturesEXT*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO_EXT: {
+            reservedmarshal_VkDevicePrivateDataCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkDevicePrivateDataCreateInfoEXT*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_pipeline_creation_cache_control
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_NV_device_diagnostics_config
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV: {
+            reservedmarshal_VkPhysicalDeviceDiagnosticsConfigFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDiagnosticsConfigFeaturesNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV: {
+            reservedmarshal_VkDeviceDiagnosticsConfigCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkDeviceDiagnosticsConfigCreateInfoNV*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV: {
+            reservedmarshal_VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV: {
+            reservedmarshal_VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV: {
+            reservedmarshal_VkPipelineFragmentShadingRateEnumStateCreateInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineFragmentShadingRateEnumStateCreateInfoNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_NV_ray_tracing_motion_blur
+        case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV: {
+            reservedmarshal_VkAccelerationStructureGeometryMotionTrianglesDataNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkAccelerationStructureGeometryMotionTrianglesDataNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV: {
+            reservedmarshal_VkAccelerationStructureMotionInfoNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkAccelerationStructureMotionInfoNV*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV: {
+            reservedmarshal_VkPhysicalDeviceRayTracingMotionBlurFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRayTracingMotionBlurFeaturesNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_ycbcr_2plane_444_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_fragment_density_map2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceFragmentDensityMap2FeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT: {
+            reservedmarshal_VkPhysicalDeviceFragmentDensityMap2PropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceFragmentDensityMap2PropertiesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_QCOM_rotated_copy_commands
+        case VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM: {
+            reservedmarshal_VkCopyCommandTransformInfoQCOM(
+                vkStream, rootType,
+                reinterpret_cast<const VkCopyCommandTransformInfoQCOM*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_image_robustness
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceImageRobustnessFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceImageRobustnessFeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_4444_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDevice4444FormatsFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevice4444FormatsFeaturesEXT*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_rgba10x6_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_VALVE_mutable_descriptor_type
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE: {
+            reservedmarshal_VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE: {
+            reservedmarshal_VkMutableDescriptorTypeCreateInfoVALVE(
+                vkStream, rootType,
+                reinterpret_cast<const VkMutableDescriptorTypeCreateInfoVALVE*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_physical_device_drm
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT: {
+            reservedmarshal_VkPhysicalDeviceDrmPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceDrmPropertiesEXT*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_primitive_topology_list_restart
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_FUCHSIA_external_memory
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA: {
+            reservedmarshal_VkImportMemoryZirconHandleInfoFUCHSIA(
+                vkStream, rootType,
+                reinterpret_cast<const VkImportMemoryZirconHandleInfoFUCHSIA*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA: {
+            reservedmarshal_VkImportMemoryBufferCollectionFUCHSIA(
+                vkStream, rootType,
+                reinterpret_cast<const VkImportMemoryBufferCollectionFUCHSIA*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA: {
+            reservedmarshal_VkBufferCollectionImageCreateInfoFUCHSIA(
+                vkStream, rootType,
+                reinterpret_cast<const VkBufferCollectionImageCreateInfoFUCHSIA*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA: {
+            reservedmarshal_VkBufferCollectionBufferCreateInfoFUCHSIA(
+                vkStream, rootType,
+                reinterpret_cast<const VkBufferCollectionBufferCreateInfoFUCHSIA*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+        case VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI: {
+            reservedmarshal_VkSubpassShadingPipelineCreateInfoHUAWEI(
+                vkStream, rootType,
+                reinterpret_cast<const VkSubpassShadingPipelineCreateInfoHUAWEI*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI: {
+            reservedmarshal_VkPhysicalDeviceSubpassShadingFeaturesHUAWEI(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSubpassShadingFeaturesHUAWEI*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI: {
+            reservedmarshal_VkPhysicalDeviceSubpassShadingPropertiesHUAWEI(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceSubpassShadingPropertiesHUAWEI*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI: {
+            reservedmarshal_VkPhysicalDeviceInvocationMaskFeaturesHUAWEI(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceInvocationMaskFeaturesHUAWEI*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_NV_external_memory_rdma
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_RDMA_FEATURES_NV: {
+            reservedmarshal_VkPhysicalDeviceExternalMemoryRDMAFeaturesNV(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceExternalMemoryRDMAFeaturesNV*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceExtendedDynamicState2FeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_color_write_enable
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceColorWriteEnableFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceColorWriteEnableFeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT: {
+            reservedmarshal_VkPipelineColorWriteCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPipelineColorWriteCreateInfoEXT*>(structExtension), ptr);
+            break;
+        }
+#endif
+#ifdef VK_GOOGLE_gfxstream
+        case VK_STRUCTURE_TYPE_IMPORT_COLOR_BUFFER_GOOGLE: {
+            reservedmarshal_VkImportColorBufferGOOGLE(
+                vkStream, rootType,
+                reinterpret_cast<const VkImportColorBufferGOOGLE*>(structExtension), ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMPORT_BUFFER_GOOGLE: {
+            reservedmarshal_VkImportBufferGOOGLE(
+                vkStream, rootType, reinterpret_cast<const VkImportBufferGOOGLE*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_CREATE_BLOB_GOOGLE: {
+            reservedmarshal_VkCreateBlobGOOGLE(
+                vkStream, rootType, reinterpret_cast<const VkCreateBlobGOOGLE*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_global_priority_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_EXT: {
+            reservedmarshal_VkQueueFamilyGlobalPriorityPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkQueueFamilyGlobalPriorityPropertiesEXT*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_multi_draw
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceMultiDrawFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMultiDrawFeaturesEXT*>(structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT: {
+            reservedmarshal_VkPhysicalDeviceMultiDrawPropertiesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceMultiDrawPropertiesEXT*>(structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_border_color_swizzle
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDeviceBorderColorSwizzleFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT: {
+            reservedmarshal_VkSamplerBorderColorComponentMappingCreateInfoEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkSamplerBorderColorComponentMappingCreateInfoEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT: {
+            reservedmarshal_VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_acceleration_structure
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR: {
+            reservedmarshal_VkWriteDescriptorSetAccelerationStructureKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkWriteDescriptorSetAccelerationStructureKHR*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR: {
+            reservedmarshal_VkPhysicalDeviceAccelerationStructureFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceAccelerationStructureFeaturesKHR*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR: {
+            reservedmarshal_VkPhysicalDeviceAccelerationStructurePropertiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceAccelerationStructurePropertiesKHR*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR: {
+            reservedmarshal_VkPhysicalDeviceRayTracingPipelineFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRayTracingPipelineFeaturesKHR*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR: {
+            reservedmarshal_VkPhysicalDeviceRayTracingPipelinePropertiesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRayTracingPipelinePropertiesKHR*>(
+                    structExtension),
+                ptr);
+            break;
+        }
+#endif
+#ifdef VK_KHR_ray_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR: {
+            reservedmarshal_VkPhysicalDeviceRayQueryFeaturesKHR(
+                vkStream, rootType,
+                reinterpret_cast<const VkPhysicalDeviceRayQueryFeaturesKHR*>(structExtension), ptr);
+            break;
+        }
+#endif
+        default: {
+            // fatal; the switch is only taken if the extension struct is known
+            abort();
+        }
+    }
+}
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/goldfish_vk_reserved_marshaling_guest.h b/system/vulkan_enc/goldfish_vk_reserved_marshaling_guest.h
new file mode 100644
index 0000000..cead355
--- /dev/null
+++ b/system/vulkan_enc/goldfish_vk_reserved_marshaling_guest.h
@@ -0,0 +1,3872 @@
+// Copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2018 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Autogenerated module goldfish_vk_reserved_marshaling_guest
+//
+// (header) generated by codegen/vulkan/scripts/genvk.py -registry codegen/vulkan/xml/vk.xml cereal
+// -o host/vulkan/cereal
+//
+// Please do not modify directly;
+// re-run gfxstream-protocols/scripts/generate-vulkan-sources.sh,
+// or directly from Python by defining:
+// VULKAN_REGISTRY_XML_DIR : Directory containing vk.xml
+// VULKAN_REGISTRY_SCRIPTS_DIR : Directory containing genvk.py
+// CEREAL_OUTPUT_DIR: Where to put the generated sources.
+//
+// python3 $VULKAN_REGISTRY_SCRIPTS_DIR/genvk.py -registry $VULKAN_REGISTRY_XML_DIR/vk.xml cereal -o
+// $CEREAL_OUTPUT_DIR
+//
+#pragma once
+#include <vulkan/vulkan.h>
+
+#include "VulkanStreamGuest.h"
+#include "goldfish_vk_marshaling_guest.h"
+#include "goldfish_vk_private_defs.h"
+#include "vk_platform_compat.h"
+#include "vulkan_gfxstream.h"
+
+// Stuff we are not going to use but if included,
+// will cause compile errors. These are Android Vulkan
+// required extensions, but the approach will be to
+// implement them completely on the guest side.
+#undef VK_KHR_android_surface
+#undef VK_ANDROID_external_memory_android_hardware_buffer
+
+namespace gfxstream {
+namespace vk {
+
+#ifdef VK_VERSION_1_0
+void reservedmarshal_VkExtent2D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkExtent2D* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkExtent3D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkExtent3D* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkOffset2D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkOffset2D* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkOffset3D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkOffset3D* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkRect2D(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                              const VkRect2D* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkBaseInStructure(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkBaseInStructure* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkBaseOutStructure(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkBaseOutStructure* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkBufferMemoryBarrier(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkBufferMemoryBarrier* forMarshaling,
+                                           uint8_t** ptr);
+
+void reservedmarshal_VkDispatchIndirectCommand(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkDispatchIndirectCommand* forMarshaling,
+                                               uint8_t** ptr);
+
+void reservedmarshal_VkDrawIndexedIndirectCommand(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkDrawIndexedIndirectCommand* forMarshaling,
+                                                  uint8_t** ptr);
+
+void reservedmarshal_VkDrawIndirectCommand(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkDrawIndirectCommand* forMarshaling,
+                                           uint8_t** ptr);
+
+void reservedmarshal_VkImageSubresourceRange(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkImageSubresourceRange* forMarshaling,
+                                             uint8_t** ptr);
+
+void reservedmarshal_VkImageMemoryBarrier(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkImageMemoryBarrier* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkMemoryBarrier(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkMemoryBarrier* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineCacheHeaderVersionOne(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineCacheHeaderVersionOne* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkAllocationCallbacks(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkAllocationCallbacks* forMarshaling,
+                                           uint8_t** ptr);
+
+void reservedmarshal_VkApplicationInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkApplicationInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkFormatProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkFormatProperties* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkImageFormatProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkImageFormatProperties* forMarshaling,
+                                             uint8_t** ptr);
+
+void reservedmarshal_VkInstanceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkInstanceCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkMemoryHeap(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkMemoryHeap* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkMemoryType(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkMemoryType* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceFeatures(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkPhysicalDeviceFeatures* forMarshaling,
+                                              uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceLimits(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkPhysicalDeviceLimits* forMarshaling,
+                                            uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceMemoryProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMemoryProperties* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceSparseProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSparseProperties* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceProperties(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkPhysicalDeviceProperties* forMarshaling,
+                                                uint8_t** ptr);
+
+void reservedmarshal_VkQueueFamilyProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkQueueFamilyProperties* forMarshaling,
+                                             uint8_t** ptr);
+
+void reservedmarshal_VkDeviceQueueCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkDeviceQueueCreateInfo* forMarshaling,
+                                             uint8_t** ptr);
+
+void reservedmarshal_VkDeviceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkDeviceCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkExtensionProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkExtensionProperties* forMarshaling,
+                                           uint8_t** ptr);
+
+void reservedmarshal_VkLayerProperties(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkLayerProperties* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSubmitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkSubmitInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkMappedMemoryRange(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkMappedMemoryRange* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkMemoryAllocateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkMemoryAllocateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkMemoryRequirements(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkMemoryRequirements* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSparseMemoryBind(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkSparseMemoryBind* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSparseBufferMemoryBindInfo(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkSparseBufferMemoryBindInfo* forMarshaling,
+                                                  uint8_t** ptr);
+
+void reservedmarshal_VkSparseImageOpaqueMemoryBindInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSparseImageOpaqueMemoryBindInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkImageSubresource(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkImageSubresource* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSparseImageMemoryBind(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkSparseImageMemoryBind* forMarshaling,
+                                             uint8_t** ptr);
+
+void reservedmarshal_VkSparseImageMemoryBindInfo(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkSparseImageMemoryBindInfo* forMarshaling,
+                                                 uint8_t** ptr);
+
+void reservedmarshal_VkBindSparseInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkBindSparseInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSparseImageFormatProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSparseImageFormatProperties* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSparseImageMemoryRequirements(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSparseImageMemoryRequirements* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkFenceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkFenceCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSemaphoreCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkSemaphoreCreateInfo* forMarshaling,
+                                           uint8_t** ptr);
+
+void reservedmarshal_VkEventCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkEventCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkQueryPoolCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkQueryPoolCreateInfo* forMarshaling,
+                                           uint8_t** ptr);
+
+void reservedmarshal_VkBufferCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkBufferCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkBufferViewCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkBufferViewCreateInfo* forMarshaling,
+                                            uint8_t** ptr);
+
+void reservedmarshal_VkImageCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkImageCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSubresourceLayout(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkSubresourceLayout* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkComponentMapping(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkComponentMapping* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkImageViewCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkImageViewCreateInfo* forMarshaling,
+                                           uint8_t** ptr);
+
+void reservedmarshal_VkShaderModuleCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkShaderModuleCreateInfo* forMarshaling,
+                                              uint8_t** ptr);
+
+void reservedmarshal_VkPipelineCacheCreateInfo(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkPipelineCacheCreateInfo* forMarshaling,
+                                               uint8_t** ptr);
+
+void reservedmarshal_VkSpecializationMapEntry(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkSpecializationMapEntry* forMarshaling,
+                                              uint8_t** ptr);
+
+void reservedmarshal_VkSpecializationInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkSpecializationInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineShaderStageCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineShaderStageCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkComputePipelineCreateInfo(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkComputePipelineCreateInfo* forMarshaling,
+                                                 uint8_t** ptr);
+
+void reservedmarshal_VkVertexInputBindingDescription(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVertexInputBindingDescription* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVertexInputAttributeDescription(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVertexInputAttributeDescription* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineVertexInputStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineVertexInputStateCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineInputAssemblyStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineInputAssemblyStateCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineTessellationStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineTessellationStateCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkViewport(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                const VkViewport* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineViewportStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineViewportStateCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineRasterizationStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRasterizationStateCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineMultisampleStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineMultisampleStateCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkStencilOpState(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkStencilOpState* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineDepthStencilStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineDepthStencilStateCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineColorBlendAttachmentState(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineColorBlendAttachmentState* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineColorBlendStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineColorBlendStateCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineDynamicStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineDynamicStateCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkGraphicsPipelineCreateInfo(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkGraphicsPipelineCreateInfo* forMarshaling,
+                                                  uint8_t** ptr);
+
+void reservedmarshal_VkPushConstantRange(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkPushConstantRange* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineLayoutCreateInfo(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkPipelineLayoutCreateInfo* forMarshaling,
+                                                uint8_t** ptr);
+
+void reservedmarshal_VkSamplerCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkSamplerCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkCopyDescriptorSet(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkCopyDescriptorSet* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDescriptorBufferInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkDescriptorBufferInfo* forMarshaling,
+                                            uint8_t** ptr);
+
+void reservedmarshal_VkDescriptorImageInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkDescriptorImageInfo* forMarshaling,
+                                           uint8_t** ptr);
+
+void reservedmarshal_VkDescriptorPoolSize(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkDescriptorPoolSize* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDescriptorPoolCreateInfo(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkDescriptorPoolCreateInfo* forMarshaling,
+                                                uint8_t** ptr);
+
+void reservedmarshal_VkDescriptorSetAllocateInfo(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkDescriptorSetAllocateInfo* forMarshaling,
+                                                 uint8_t** ptr);
+
+void reservedmarshal_VkDescriptorSetLayoutBinding(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkDescriptorSetLayoutBinding* forMarshaling,
+                                                  uint8_t** ptr);
+
+void reservedmarshal_VkDescriptorSetLayoutCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDescriptorSetLayoutCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkWriteDescriptorSet(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkWriteDescriptorSet* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkAttachmentDescription(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkAttachmentDescription* forMarshaling,
+                                             uint8_t** ptr);
+
+void reservedmarshal_VkAttachmentReference(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkAttachmentReference* forMarshaling,
+                                           uint8_t** ptr);
+
+void reservedmarshal_VkFramebufferCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkFramebufferCreateInfo* forMarshaling,
+                                             uint8_t** ptr);
+
+void reservedmarshal_VkSubpassDescription(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkSubpassDescription* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSubpassDependency(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkSubpassDependency* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkRenderPassCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkRenderPassCreateInfo* forMarshaling,
+                                            uint8_t** ptr);
+
+void reservedmarshal_VkCommandPoolCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkCommandPoolCreateInfo* forMarshaling,
+                                             uint8_t** ptr);
+
+void reservedmarshal_VkCommandBufferAllocateInfo(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkCommandBufferAllocateInfo* forMarshaling,
+                                                 uint8_t** ptr);
+
+void reservedmarshal_VkCommandBufferInheritanceInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCommandBufferInheritanceInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkCommandBufferBeginInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkCommandBufferBeginInfo* forMarshaling,
+                                              uint8_t** ptr);
+
+void reservedmarshal_VkBufferCopy(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkBufferCopy* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkImageSubresourceLayers(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkImageSubresourceLayers* forMarshaling,
+                                              uint8_t** ptr);
+
+void reservedmarshal_VkBufferImageCopy(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkBufferImageCopy* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkClearColorValue(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkClearColorValue* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkClearDepthStencilValue(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkClearDepthStencilValue* forMarshaling,
+                                              uint8_t** ptr);
+
+void reservedmarshal_VkClearValue(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkClearValue* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkClearAttachment(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkClearAttachment* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkClearRect(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkClearRect* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkImageBlit(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkImageBlit* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkImageCopy(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkImageCopy* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkImageResolve(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkImageResolve* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkRenderPassBeginInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkRenderPassBeginInfo* forMarshaling,
+                                           uint8_t** ptr);
+
+#endif
+#ifdef VK_VERSION_1_1
+void reservedmarshal_VkPhysicalDeviceSubgroupProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSubgroupProperties* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkBindBufferMemoryInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkBindBufferMemoryInfo* forMarshaling,
+                                            uint8_t** ptr);
+
+void reservedmarshal_VkBindImageMemoryInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkBindImageMemoryInfo* forMarshaling,
+                                           uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDevice16BitStorageFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevice16BitStorageFeatures* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkMemoryDedicatedRequirements(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryDedicatedRequirements* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkMemoryDedicatedAllocateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryDedicatedAllocateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkMemoryAllocateFlagsInfo(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkMemoryAllocateFlagsInfo* forMarshaling,
+                                               uint8_t** ptr);
+
+void reservedmarshal_VkDeviceGroupRenderPassBeginInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceGroupRenderPassBeginInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDeviceGroupCommandBufferBeginInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceGroupCommandBufferBeginInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDeviceGroupSubmitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkDeviceGroupSubmitInfo* forMarshaling,
+                                             uint8_t** ptr);
+
+void reservedmarshal_VkDeviceGroupBindSparseInfo(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkDeviceGroupBindSparseInfo* forMarshaling,
+                                                 uint8_t** ptr);
+
+void reservedmarshal_VkBindBufferMemoryDeviceGroupInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBindBufferMemoryDeviceGroupInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkBindImageMemoryDeviceGroupInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBindImageMemoryDeviceGroupInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceGroupProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceGroupProperties* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDeviceGroupDeviceCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceGroupDeviceCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkBufferMemoryRequirementsInfo2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferMemoryRequirementsInfo2* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkImageMemoryRequirementsInfo2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageMemoryRequirementsInfo2* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkImageSparseMemoryRequirementsInfo2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageSparseMemoryRequirementsInfo2* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkMemoryRequirements2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkMemoryRequirements2* forMarshaling,
+                                           uint8_t** ptr);
+
+void reservedmarshal_VkSparseImageMemoryRequirements2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSparseImageMemoryRequirements2* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceFeatures2(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkPhysicalDeviceFeatures2* forMarshaling,
+                                               uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceProperties2(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkPhysicalDeviceProperties2* forMarshaling,
+                                                 uint8_t** ptr);
+
+void reservedmarshal_VkFormatProperties2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkFormatProperties2* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkImageFormatProperties2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkImageFormatProperties2* forMarshaling,
+                                              uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceImageFormatInfo2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceImageFormatInfo2* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkQueueFamilyProperties2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkQueueFamilyProperties2* forMarshaling,
+                                              uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceMemoryProperties2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMemoryProperties2* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSparseImageFormatProperties2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSparseImageFormatProperties2* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceSparseImageFormatInfo2(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSparseImageFormatInfo2* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDevicePointClippingProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePointClippingProperties* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkInputAttachmentAspectReference(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkInputAttachmentAspectReference* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkRenderPassInputAttachmentAspectCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRenderPassInputAttachmentAspectCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkImageViewUsageCreateInfo(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkImageViewUsageCreateInfo* forMarshaling,
+                                                uint8_t** ptr);
+
+void reservedmarshal_VkPipelineTessellationDomainOriginStateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineTessellationDomainOriginStateCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkRenderPassMultiviewCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRenderPassMultiviewCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceMultiviewFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMultiviewFeatures* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceMultiviewProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMultiviewProperties* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceVariablePointersFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVariablePointersFeatures* forMarshaling, uint8_t** ptr);
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceVariablePointersFeatures,
+                      reservedmarshal_VkPhysicalDeviceVariablePointerFeatures)
+
+void reservedmarshal_VkPhysicalDeviceProtectedMemoryFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceProtectedMemoryFeatures* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceProtectedMemoryProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceProtectedMemoryProperties* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDeviceQueueInfo2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkDeviceQueueInfo2* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkProtectedSubmitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkProtectedSubmitInfo* forMarshaling,
+                                           uint8_t** ptr);
+
+void reservedmarshal_VkSamplerYcbcrConversionCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSamplerYcbcrConversionCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSamplerYcbcrConversionInfo(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkSamplerYcbcrConversionInfo* forMarshaling,
+                                                  uint8_t** ptr);
+
+void reservedmarshal_VkBindImagePlaneMemoryInfo(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkBindImagePlaneMemoryInfo* forMarshaling,
+                                                uint8_t** ptr);
+
+void reservedmarshal_VkImagePlaneMemoryRequirementsInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImagePlaneMemoryRequirementsInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceSamplerYcbcrConversionFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSamplerYcbcrConversionFeatures* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSamplerYcbcrConversionImageFormatProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSamplerYcbcrConversionImageFormatProperties* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDescriptorUpdateTemplateEntry(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDescriptorUpdateTemplateEntry* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDescriptorUpdateTemplateCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDescriptorUpdateTemplateCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkExternalMemoryProperties(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkExternalMemoryProperties* forMarshaling,
+                                                uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceExternalImageFormatInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExternalImageFormatInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkExternalImageFormatProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExternalImageFormatProperties* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceExternalBufferInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExternalBufferInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkExternalBufferProperties(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkExternalBufferProperties* forMarshaling,
+                                                uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceIDProperties(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkPhysicalDeviceIDProperties* forMarshaling,
+                                                  uint8_t** ptr);
+
+void reservedmarshal_VkExternalMemoryImageCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExternalMemoryImageCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkExternalMemoryBufferCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExternalMemoryBufferCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkExportMemoryAllocateInfo(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkExportMemoryAllocateInfo* forMarshaling,
+                                                uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceExternalFenceInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExternalFenceInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkExternalFenceProperties(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkExternalFenceProperties* forMarshaling,
+                                               uint8_t** ptr);
+
+void reservedmarshal_VkExportFenceCreateInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkExportFenceCreateInfo* forMarshaling,
+                                             uint8_t** ptr);
+
+void reservedmarshal_VkExportSemaphoreCreateInfo(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkExportSemaphoreCreateInfo* forMarshaling,
+                                                 uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceExternalSemaphoreInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExternalSemaphoreInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkExternalSemaphoreProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExternalSemaphoreProperties* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceMaintenance3Properties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMaintenance3Properties* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDescriptorSetLayoutSupport(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkDescriptorSetLayoutSupport* forMarshaling,
+                                                  uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceShaderDrawParametersFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderDrawParametersFeatures* forMarshaling, uint8_t** ptr);
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceShaderDrawParametersFeatures,
+                      reservedmarshal_VkPhysicalDeviceShaderDrawParameterFeatures)
+
+#endif
+#ifdef VK_VERSION_1_2
+void reservedmarshal_VkPhysicalDeviceVulkan11Features(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVulkan11Features* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceVulkan11Properties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVulkan11Properties* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceVulkan12Features(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVulkan12Features* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkConformanceVersion(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkConformanceVersion* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceVulkan12Properties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVulkan12Properties* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkImageFormatListCreateInfo(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkImageFormatListCreateInfo* forMarshaling,
+                                                 uint8_t** ptr);
+
+void reservedmarshal_VkAttachmentDescription2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkAttachmentDescription2* forMarshaling,
+                                              uint8_t** ptr);
+
+void reservedmarshal_VkAttachmentReference2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkAttachmentReference2* forMarshaling,
+                                            uint8_t** ptr);
+
+void reservedmarshal_VkSubpassDescription2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkSubpassDescription2* forMarshaling,
+                                           uint8_t** ptr);
+
+void reservedmarshal_VkSubpassDependency2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkSubpassDependency2* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkRenderPassCreateInfo2(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkRenderPassCreateInfo2* forMarshaling,
+                                             uint8_t** ptr);
+
+void reservedmarshal_VkSubpassBeginInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkSubpassBeginInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSubpassEndInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkSubpassEndInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDevice8BitStorageFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevice8BitStorageFeatures* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceDriverProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDriverProperties* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceShaderAtomicInt64Features(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderAtomicInt64Features* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceShaderFloat16Int8Features(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderFloat16Int8Features* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceFloatControlsProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFloatControlsProperties* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDescriptorSetLayoutBindingFlagsCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDescriptorSetLayoutBindingFlagsCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceDescriptorIndexingFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDescriptorIndexingFeatures* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceDescriptorIndexingProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDescriptorIndexingProperties* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDescriptorSetVariableDescriptorCountAllocateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDescriptorSetVariableDescriptorCountAllocateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDescriptorSetVariableDescriptorCountLayoutSupport(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDescriptorSetVariableDescriptorCountLayoutSupport* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSubpassDescriptionDepthStencilResolve(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSubpassDescriptionDepthStencilResolve* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceDepthStencilResolveProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDepthStencilResolveProperties* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceScalarBlockLayoutFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceScalarBlockLayoutFeatures* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkImageStencilUsageCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageStencilUsageCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSamplerReductionModeCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSamplerReductionModeCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceSamplerFilterMinmaxProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSamplerFilterMinmaxProperties* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceVulkanMemoryModelFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVulkanMemoryModelFeatures* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceImagelessFramebufferFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceImagelessFramebufferFeatures* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkFramebufferAttachmentImageInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkFramebufferAttachmentImageInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkFramebufferAttachmentsCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkFramebufferAttachmentsCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkRenderPassAttachmentBeginInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRenderPassAttachmentBeginInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceUniformBufferStandardLayoutFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceUniformBufferStandardLayoutFeatures* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkAttachmentReferenceStencilLayout(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAttachmentReferenceStencilLayout* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkAttachmentDescriptionStencilLayout(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAttachmentDescriptionStencilLayout* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceHostQueryResetFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceHostQueryResetFeatures* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceTimelineSemaphoreFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceTimelineSemaphoreFeatures* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceTimelineSemaphoreProperties(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceTimelineSemaphoreProperties* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSemaphoreTypeCreateInfo(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkSemaphoreTypeCreateInfo* forMarshaling,
+                                               uint8_t** ptr);
+
+void reservedmarshal_VkTimelineSemaphoreSubmitInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkTimelineSemaphoreSubmitInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSemaphoreWaitInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkSemaphoreWaitInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSemaphoreSignalInfo(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkSemaphoreSignalInfo* forMarshaling,
+                                           uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceBufferDeviceAddressFeatures(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceBufferDeviceAddressFeatures* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkBufferDeviceAddressInfo(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkBufferDeviceAddressInfo* forMarshaling,
+                                               uint8_t** ptr);
+
+void reservedmarshal_VkBufferOpaqueCaptureAddressCreateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferOpaqueCaptureAddressCreateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkMemoryOpaqueCaptureAddressAllocateInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryOpaqueCaptureAddressAllocateInfo* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDeviceMemoryOpaqueCaptureAddressInfo(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceMemoryOpaqueCaptureAddressInfo* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_surface
+void reservedmarshal_VkSurfaceCapabilitiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkSurfaceCapabilitiesKHR* forMarshaling,
+                                              uint8_t** ptr);
+
+void reservedmarshal_VkSurfaceFormatKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkSurfaceFormatKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_swapchain
+void reservedmarshal_VkSwapchainCreateInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkSwapchainCreateInfoKHR* forMarshaling,
+                                              uint8_t** ptr);
+
+void reservedmarshal_VkPresentInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkPresentInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkImageSwapchainCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageSwapchainCreateInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkBindImageMemorySwapchainInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBindImageMemorySwapchainInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkAcquireNextImageInfoKHR(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkAcquireNextImageInfoKHR* forMarshaling,
+                                               uint8_t** ptr);
+
+void reservedmarshal_VkDeviceGroupPresentCapabilitiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceGroupPresentCapabilitiesKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDeviceGroupPresentInfoKHR(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkDeviceGroupPresentInfoKHR* forMarshaling,
+                                                 uint8_t** ptr);
+
+void reservedmarshal_VkDeviceGroupSwapchainCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceGroupSwapchainCreateInfoKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_display
+void reservedmarshal_VkDisplayModeParametersKHR(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkDisplayModeParametersKHR* forMarshaling,
+                                                uint8_t** ptr);
+
+void reservedmarshal_VkDisplayModeCreateInfoKHR(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkDisplayModeCreateInfoKHR* forMarshaling,
+                                                uint8_t** ptr);
+
+void reservedmarshal_VkDisplayModePropertiesKHR(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkDisplayModePropertiesKHR* forMarshaling,
+                                                uint8_t** ptr);
+
+void reservedmarshal_VkDisplayPlaneCapabilitiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDisplayPlaneCapabilitiesKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDisplayPlanePropertiesKHR(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkDisplayPlanePropertiesKHR* forMarshaling,
+                                                 uint8_t** ptr);
+
+void reservedmarshal_VkDisplayPropertiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkDisplayPropertiesKHR* forMarshaling,
+                                            uint8_t** ptr);
+
+void reservedmarshal_VkDisplaySurfaceCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDisplaySurfaceCreateInfoKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_display_swapchain
+void reservedmarshal_VkDisplayPresentInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkDisplayPresentInfoKHR* forMarshaling,
+                                             uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_xlib_surface
+void reservedmarshal_VkXlibSurfaceCreateInfoKHR(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkXlibSurfaceCreateInfoKHR* forMarshaling,
+                                                uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_xcb_surface
+void reservedmarshal_VkXcbSurfaceCreateInfoKHR(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkXcbSurfaceCreateInfoKHR* forMarshaling,
+                                               uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_wayland_surface
+void reservedmarshal_VkWaylandSurfaceCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkWaylandSurfaceCreateInfoKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_android_surface
+void reservedmarshal_VkAndroidSurfaceCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAndroidSurfaceCreateInfoKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_win32_surface
+void reservedmarshal_VkWin32SurfaceCreateInfoKHR(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkWin32SurfaceCreateInfoKHR* forMarshaling,
+                                                 uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_sampler_mirror_clamp_to_edge
+#endif
+#ifdef VK_KHR_video_queue
+void reservedmarshal_VkVideoQueueFamilyProperties2KHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoQueueFamilyProperties2KHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoProfileKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkVideoProfileKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoProfilesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkVideoProfilesKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoCapabilitiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkVideoCapabilitiesKHR* forMarshaling,
+                                            uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceVideoFormatInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVideoFormatInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoFormatPropertiesKHR(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkVideoFormatPropertiesKHR* forMarshaling,
+                                                uint8_t** ptr);
+
+void reservedmarshal_VkVideoPictureResourceKHR(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkVideoPictureResourceKHR* forMarshaling,
+                                               uint8_t** ptr);
+
+void reservedmarshal_VkVideoReferenceSlotKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkVideoReferenceSlotKHR* forMarshaling,
+                                             uint8_t** ptr);
+
+void reservedmarshal_VkVideoGetMemoryPropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoGetMemoryPropertiesKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoBindMemoryKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkVideoBindMemoryKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoSessionCreateInfoKHR(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkVideoSessionCreateInfoKHR* forMarshaling,
+                                                 uint8_t** ptr);
+
+void reservedmarshal_VkVideoSessionParametersCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoSessionParametersCreateInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoSessionParametersUpdateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoSessionParametersUpdateInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoBeginCodingInfoKHR(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkVideoBeginCodingInfoKHR* forMarshaling,
+                                               uint8_t** ptr);
+
+void reservedmarshal_VkVideoEndCodingInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkVideoEndCodingInfoKHR* forMarshaling,
+                                             uint8_t** ptr);
+
+void reservedmarshal_VkVideoCodingControlInfoKHR(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkVideoCodingControlInfoKHR* forMarshaling,
+                                                 uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_video_decode_queue
+void reservedmarshal_VkVideoDecodeInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkVideoDecodeInfoKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_dynamic_rendering
+void reservedmarshal_VkRenderingAttachmentInfoKHR(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkRenderingAttachmentInfoKHR* forMarshaling,
+                                                  uint8_t** ptr);
+
+void reservedmarshal_VkRenderingInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkRenderingInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineRenderingCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRenderingCreateInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceDynamicRenderingFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDynamicRenderingFeaturesKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkCommandBufferInheritanceRenderingInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCommandBufferInheritanceRenderingInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkRenderingFragmentShadingRateAttachmentInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRenderingFragmentShadingRateAttachmentInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkRenderingFragmentDensityMapAttachmentInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRenderingFragmentDensityMapAttachmentInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkAttachmentSampleCountInfoAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAttachmentSampleCountInfoAMD* forMarshaling, uint8_t** ptr);
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkAttachmentSampleCountInfoAMD,
+                      reservedmarshal_VkAttachmentSampleCountInfoNV)
+
+void reservedmarshal_VkMultiviewPerViewAttributesInfoNVX(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMultiviewPerViewAttributesInfoNVX* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_multiview
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkRenderPassMultiviewCreateInfo,
+                      reservedmarshal_VkRenderPassMultiviewCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceMultiviewFeatures,
+                      reservedmarshal_VkPhysicalDeviceMultiviewFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceMultiviewProperties,
+                      reservedmarshal_VkPhysicalDeviceMultiviewPropertiesKHR)
+
+#endif
+#ifdef VK_KHR_get_physical_device_properties2
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceFeatures2,
+                      reservedmarshal_VkPhysicalDeviceFeatures2KHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceProperties2,
+                      reservedmarshal_VkPhysicalDeviceProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkFormatProperties2, reservedmarshal_VkFormatProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkImageFormatProperties2,
+                      reservedmarshal_VkImageFormatProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceImageFormatInfo2,
+                      reservedmarshal_VkPhysicalDeviceImageFormatInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkQueueFamilyProperties2,
+                      reservedmarshal_VkQueueFamilyProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceMemoryProperties2,
+                      reservedmarshal_VkPhysicalDeviceMemoryProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkSparseImageFormatProperties2,
+                      reservedmarshal_VkSparseImageFormatProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceSparseImageFormatInfo2,
+                      reservedmarshal_VkPhysicalDeviceSparseImageFormatInfo2KHR)
+
+#endif
+#ifdef VK_KHR_device_group
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkMemoryAllocateFlagsInfo,
+                      reservedmarshal_VkMemoryAllocateFlagsInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkDeviceGroupRenderPassBeginInfo,
+                      reservedmarshal_VkDeviceGroupRenderPassBeginInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkDeviceGroupCommandBufferBeginInfo,
+                      reservedmarshal_VkDeviceGroupCommandBufferBeginInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkDeviceGroupSubmitInfo,
+                      reservedmarshal_VkDeviceGroupSubmitInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkDeviceGroupBindSparseInfo,
+                      reservedmarshal_VkDeviceGroupBindSparseInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkBindBufferMemoryDeviceGroupInfo,
+                      reservedmarshal_VkBindBufferMemoryDeviceGroupInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkBindImageMemoryDeviceGroupInfo,
+                      reservedmarshal_VkBindImageMemoryDeviceGroupInfoKHR)
+
+#endif
+#ifdef VK_KHR_shader_draw_parameters
+#endif
+#ifdef VK_KHR_maintenance1
+#endif
+#ifdef VK_KHR_device_group_creation
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceGroupProperties,
+                      reservedmarshal_VkPhysicalDeviceGroupPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkDeviceGroupDeviceCreateInfo,
+                      reservedmarshal_VkDeviceGroupDeviceCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_external_memory_capabilities
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkExternalMemoryProperties,
+                      reservedmarshal_VkExternalMemoryPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceExternalImageFormatInfo,
+                      reservedmarshal_VkPhysicalDeviceExternalImageFormatInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkExternalImageFormatProperties,
+                      reservedmarshal_VkExternalImageFormatPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceExternalBufferInfo,
+                      reservedmarshal_VkPhysicalDeviceExternalBufferInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkExternalBufferProperties,
+                      reservedmarshal_VkExternalBufferPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceIDProperties,
+                      reservedmarshal_VkPhysicalDeviceIDPropertiesKHR)
+
+#endif
+#ifdef VK_KHR_external_memory
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkExternalMemoryImageCreateInfo,
+                      reservedmarshal_VkExternalMemoryImageCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkExternalMemoryBufferCreateInfo,
+                      reservedmarshal_VkExternalMemoryBufferCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkExportMemoryAllocateInfo,
+                      reservedmarshal_VkExportMemoryAllocateInfoKHR)
+
+#endif
+#ifdef VK_KHR_external_memory_win32
+void reservedmarshal_VkImportMemoryWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportMemoryWin32HandleInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkExportMemoryWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExportMemoryWin32HandleInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkMemoryWin32HandlePropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryWin32HandlePropertiesKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkMemoryGetWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryGetWin32HandleInfoKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_external_memory_fd
+void reservedmarshal_VkImportMemoryFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkImportMemoryFdInfoKHR* forMarshaling,
+                                             uint8_t** ptr);
+
+void reservedmarshal_VkMemoryFdPropertiesKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkMemoryFdPropertiesKHR* forMarshaling,
+                                             uint8_t** ptr);
+
+void reservedmarshal_VkMemoryGetFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkMemoryGetFdInfoKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_win32_keyed_mutex
+void reservedmarshal_VkWin32KeyedMutexAcquireReleaseInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkWin32KeyedMutexAcquireReleaseInfoKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_external_semaphore_capabilities
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceExternalSemaphoreInfo,
+                      reservedmarshal_VkPhysicalDeviceExternalSemaphoreInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkExternalSemaphoreProperties,
+                      reservedmarshal_VkExternalSemaphorePropertiesKHR)
+
+#endif
+#ifdef VK_KHR_external_semaphore
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkExportSemaphoreCreateInfo,
+                      reservedmarshal_VkExportSemaphoreCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+void reservedmarshal_VkImportSemaphoreWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportSemaphoreWin32HandleInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkExportSemaphoreWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExportSemaphoreWin32HandleInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkD3D12FenceSubmitInfoKHR(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkD3D12FenceSubmitInfoKHR* forMarshaling,
+                                               uint8_t** ptr);
+
+void reservedmarshal_VkSemaphoreGetWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSemaphoreGetWin32HandleInfoKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_external_semaphore_fd
+void reservedmarshal_VkImportSemaphoreFdInfoKHR(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkImportSemaphoreFdInfoKHR* forMarshaling,
+                                                uint8_t** ptr);
+
+void reservedmarshal_VkSemaphoreGetFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkSemaphoreGetFdInfoKHR* forMarshaling,
+                                             uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_push_descriptor
+void reservedmarshal_VkPhysicalDevicePushDescriptorPropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePushDescriptorPropertiesKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_shader_float16_int8
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceShaderFloat16Int8Features,
+                      reservedmarshal_VkPhysicalDeviceShaderFloat16Int8FeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceShaderFloat16Int8Features,
+                      reservedmarshal_VkPhysicalDeviceFloat16Int8FeaturesKHR)
+
+#endif
+#ifdef VK_KHR_16bit_storage
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDevice16BitStorageFeatures,
+                      reservedmarshal_VkPhysicalDevice16BitStorageFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_incremental_present
+void reservedmarshal_VkRectLayerKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkRectLayerKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPresentRegionKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkPresentRegionKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPresentRegionsKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkPresentRegionsKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_descriptor_update_template
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkDescriptorUpdateTemplateEntry,
+                      reservedmarshal_VkDescriptorUpdateTemplateEntryKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkDescriptorUpdateTemplateCreateInfo,
+                      reservedmarshal_VkDescriptorUpdateTemplateCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_imageless_framebuffer
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceImagelessFramebufferFeatures,
+                      reservedmarshal_VkPhysicalDeviceImagelessFramebufferFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkFramebufferAttachmentsCreateInfo,
+                      reservedmarshal_VkFramebufferAttachmentsCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkFramebufferAttachmentImageInfo,
+                      reservedmarshal_VkFramebufferAttachmentImageInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkRenderPassAttachmentBeginInfo,
+                      reservedmarshal_VkRenderPassAttachmentBeginInfoKHR)
+
+#endif
+#ifdef VK_KHR_create_renderpass2
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkRenderPassCreateInfo2,
+                      reservedmarshal_VkRenderPassCreateInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkAttachmentDescription2,
+                      reservedmarshal_VkAttachmentDescription2KHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkAttachmentReference2,
+                      reservedmarshal_VkAttachmentReference2KHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkSubpassDescription2,
+                      reservedmarshal_VkSubpassDescription2KHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkSubpassDependency2, reservedmarshal_VkSubpassDependency2KHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkSubpassBeginInfo, reservedmarshal_VkSubpassBeginInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkSubpassEndInfo, reservedmarshal_VkSubpassEndInfoKHR)
+
+#endif
+#ifdef VK_KHR_shared_presentable_image
+void reservedmarshal_VkSharedPresentSurfaceCapabilitiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSharedPresentSurfaceCapabilitiesKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_external_fence_capabilities
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceExternalFenceInfo,
+                      reservedmarshal_VkPhysicalDeviceExternalFenceInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkExternalFenceProperties,
+                      reservedmarshal_VkExternalFencePropertiesKHR)
+
+#endif
+#ifdef VK_KHR_external_fence
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkExportFenceCreateInfo,
+                      reservedmarshal_VkExportFenceCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_external_fence_win32
+void reservedmarshal_VkImportFenceWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportFenceWin32HandleInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkExportFenceWin32HandleInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExportFenceWin32HandleInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkFenceGetWin32HandleInfoKHR(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkFenceGetWin32HandleInfoKHR* forMarshaling,
+                                                  uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_external_fence_fd
+void reservedmarshal_VkImportFenceFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkImportFenceFdInfoKHR* forMarshaling,
+                                            uint8_t** ptr);
+
+void reservedmarshal_VkFenceGetFdInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkFenceGetFdInfoKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_performance_query
+void reservedmarshal_VkPhysicalDevicePerformanceQueryFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePerformanceQueryFeaturesKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDevicePerformanceQueryPropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePerformanceQueryPropertiesKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPerformanceCounterKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkPerformanceCounterKHR* forMarshaling,
+                                             uint8_t** ptr);
+
+void reservedmarshal_VkPerformanceCounterDescriptionKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPerformanceCounterDescriptionKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkQueryPoolPerformanceCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkQueryPoolPerformanceCreateInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPerformanceCounterResultKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPerformanceCounterResultKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkAcquireProfilingLockInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAcquireProfilingLockInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPerformanceQuerySubmitInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPerformanceQuerySubmitInfoKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_maintenance2
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDevicePointClippingProperties,
+                      reservedmarshal_VkPhysicalDevicePointClippingPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkRenderPassInputAttachmentAspectCreateInfo,
+                      reservedmarshal_VkRenderPassInputAttachmentAspectCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkInputAttachmentAspectReference,
+                      reservedmarshal_VkInputAttachmentAspectReferenceKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkImageViewUsageCreateInfo,
+                      reservedmarshal_VkImageViewUsageCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPipelineTessellationDomainOriginStateCreateInfo,
+                      reservedmarshal_VkPipelineTessellationDomainOriginStateCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_get_surface_capabilities2
+void reservedmarshal_VkPhysicalDeviceSurfaceInfo2KHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSurfaceInfo2KHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSurfaceCapabilities2KHR(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkSurfaceCapabilities2KHR* forMarshaling,
+                                               uint8_t** ptr);
+
+void reservedmarshal_VkSurfaceFormat2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkSurfaceFormat2KHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_variable_pointers
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceVariablePointersFeatures,
+                      reservedmarshal_VkPhysicalDeviceVariablePointerFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceVariablePointersFeatures,
+                      reservedmarshal_VkPhysicalDeviceVariablePointersFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_get_display_properties2
+void reservedmarshal_VkDisplayProperties2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkDisplayProperties2KHR* forMarshaling,
+                                             uint8_t** ptr);
+
+void reservedmarshal_VkDisplayPlaneProperties2KHR(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkDisplayPlaneProperties2KHR* forMarshaling,
+                                                  uint8_t** ptr);
+
+void reservedmarshal_VkDisplayModeProperties2KHR(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkDisplayModeProperties2KHR* forMarshaling,
+                                                 uint8_t** ptr);
+
+void reservedmarshal_VkDisplayPlaneInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkDisplayPlaneInfo2KHR* forMarshaling,
+                                            uint8_t** ptr);
+
+void reservedmarshal_VkDisplayPlaneCapabilities2KHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDisplayPlaneCapabilities2KHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_dedicated_allocation
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkMemoryDedicatedRequirements,
+                      reservedmarshal_VkMemoryDedicatedRequirementsKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkMemoryDedicatedAllocateInfo,
+                      reservedmarshal_VkMemoryDedicatedAllocateInfoKHR)
+
+#endif
+#ifdef VK_KHR_storage_buffer_storage_class
+#endif
+#ifdef VK_KHR_relaxed_block_layout
+#endif
+#ifdef VK_KHR_get_memory_requirements2
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkBufferMemoryRequirementsInfo2,
+                      reservedmarshal_VkBufferMemoryRequirementsInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkImageMemoryRequirementsInfo2,
+                      reservedmarshal_VkImageMemoryRequirementsInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkImageSparseMemoryRequirementsInfo2,
+                      reservedmarshal_VkImageSparseMemoryRequirementsInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkMemoryRequirements2,
+                      reservedmarshal_VkMemoryRequirements2KHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkSparseImageMemoryRequirements2,
+                      reservedmarshal_VkSparseImageMemoryRequirements2KHR)
+
+#endif
+#ifdef VK_KHR_image_format_list
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkImageFormatListCreateInfo,
+                      reservedmarshal_VkImageFormatListCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_sampler_ycbcr_conversion
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkSamplerYcbcrConversionCreateInfo,
+                      reservedmarshal_VkSamplerYcbcrConversionCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkSamplerYcbcrConversionInfo,
+                      reservedmarshal_VkSamplerYcbcrConversionInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkBindImagePlaneMemoryInfo,
+                      reservedmarshal_VkBindImagePlaneMemoryInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkImagePlaneMemoryRequirementsInfo,
+                      reservedmarshal_VkImagePlaneMemoryRequirementsInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceSamplerYcbcrConversionFeatures,
+                      reservedmarshal_VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkSamplerYcbcrConversionImageFormatProperties,
+                      reservedmarshal_VkSamplerYcbcrConversionImageFormatPropertiesKHR)
+
+#endif
+#ifdef VK_KHR_bind_memory2
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkBindBufferMemoryInfo,
+                      reservedmarshal_VkBindBufferMemoryInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkBindImageMemoryInfo,
+                      reservedmarshal_VkBindImageMemoryInfoKHR)
+
+#endif
+#ifdef VK_KHR_portability_subset
+void reservedmarshal_VkPhysicalDevicePortabilitySubsetFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePortabilitySubsetFeaturesKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDevicePortabilitySubsetPropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePortabilitySubsetPropertiesKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_maintenance3
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceMaintenance3Properties,
+                      reservedmarshal_VkPhysicalDeviceMaintenance3PropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkDescriptorSetLayoutSupport,
+                      reservedmarshal_VkDescriptorSetLayoutSupportKHR)
+
+#endif
+#ifdef VK_KHR_draw_indirect_count
+#endif
+#ifdef VK_KHR_shader_subgroup_extended_types
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures,
+                      reservedmarshal_VkPhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_8bit_storage
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDevice8BitStorageFeatures,
+                      reservedmarshal_VkPhysicalDevice8BitStorageFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_shader_atomic_int64
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceShaderAtomicInt64Features,
+                      reservedmarshal_VkPhysicalDeviceShaderAtomicInt64FeaturesKHR)
+
+#endif
+#ifdef VK_KHR_shader_clock
+void reservedmarshal_VkPhysicalDeviceShaderClockFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderClockFeaturesKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_driver_properties
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkConformanceVersion, reservedmarshal_VkConformanceVersionKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceDriverProperties,
+                      reservedmarshal_VkPhysicalDeviceDriverPropertiesKHR)
+
+#endif
+#ifdef VK_KHR_shader_float_controls
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceFloatControlsProperties,
+                      reservedmarshal_VkPhysicalDeviceFloatControlsPropertiesKHR)
+
+#endif
+#ifdef VK_KHR_depth_stencil_resolve
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkSubpassDescriptionDepthStencilResolve,
+                      reservedmarshal_VkSubpassDescriptionDepthStencilResolveKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceDepthStencilResolveProperties,
+                      reservedmarshal_VkPhysicalDeviceDepthStencilResolvePropertiesKHR)
+
+#endif
+#ifdef VK_KHR_swapchain_mutable_format
+#endif
+#ifdef VK_KHR_timeline_semaphore
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceTimelineSemaphoreFeatures,
+                      reservedmarshal_VkPhysicalDeviceTimelineSemaphoreFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceTimelineSemaphoreProperties,
+                      reservedmarshal_VkPhysicalDeviceTimelineSemaphorePropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkSemaphoreTypeCreateInfo,
+                      reservedmarshal_VkSemaphoreTypeCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkTimelineSemaphoreSubmitInfo,
+                      reservedmarshal_VkTimelineSemaphoreSubmitInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkSemaphoreWaitInfo, reservedmarshal_VkSemaphoreWaitInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkSemaphoreSignalInfo,
+                      reservedmarshal_VkSemaphoreSignalInfoKHR)
+
+#endif
+#ifdef VK_KHR_vulkan_memory_model
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceVulkanMemoryModelFeatures,
+                      reservedmarshal_VkPhysicalDeviceVulkanMemoryModelFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_shader_terminate_invocation
+void reservedmarshal_VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+void reservedmarshal_VkFragmentShadingRateAttachmentInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkFragmentShadingRateAttachmentInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineFragmentShadingRateStateCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineFragmentShadingRateStateCreateInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceFragmentShadingRateFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateFeaturesKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceFragmentShadingRatePropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRatePropertiesKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceFragmentShadingRateKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_spirv_1_4
+#endif
+#ifdef VK_KHR_surface_protected_capabilities
+void reservedmarshal_VkSurfaceProtectedCapabilitiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSurfaceProtectedCapabilitiesKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_separate_depth_stencil_layouts
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures,
+                      reservedmarshal_VkPhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkAttachmentReferenceStencilLayout,
+                      reservedmarshal_VkAttachmentReferenceStencilLayoutKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkAttachmentDescriptionStencilLayout,
+                      reservedmarshal_VkAttachmentDescriptionStencilLayoutKHR)
+
+#endif
+#ifdef VK_KHR_present_wait
+void reservedmarshal_VkPhysicalDevicePresentWaitFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePresentWaitFeaturesKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_uniform_buffer_standard_layout
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceUniformBufferStandardLayoutFeatures,
+                      reservedmarshal_VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_buffer_device_address
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceBufferDeviceAddressFeatures,
+                      reservedmarshal_VkPhysicalDeviceBufferDeviceAddressFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkBufferDeviceAddressInfo,
+                      reservedmarshal_VkBufferDeviceAddressInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkBufferOpaqueCaptureAddressCreateInfo,
+                      reservedmarshal_VkBufferOpaqueCaptureAddressCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkMemoryOpaqueCaptureAddressAllocateInfo,
+                      reservedmarshal_VkMemoryOpaqueCaptureAddressAllocateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkDeviceMemoryOpaqueCaptureAddressInfo,
+                      reservedmarshal_VkDeviceMemoryOpaqueCaptureAddressInfoKHR)
+
+#endif
+#ifdef VK_KHR_deferred_host_operations
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+void reservedmarshal_VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkPipelineInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineExecutablePropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineExecutablePropertiesKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineExecutableInfoKHR(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkPipelineExecutableInfoKHR* forMarshaling,
+                                                 uint8_t** ptr);
+
+void reservedmarshal_VkPipelineExecutableStatisticValueKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineExecutableStatisticValueKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineExecutableStatisticKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineExecutableStatisticKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineExecutableInternalRepresentationKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineExecutableInternalRepresentationKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_shader_integer_dot_product
+void reservedmarshal_VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_pipeline_library
+void reservedmarshal_VkPipelineLibraryCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineLibraryCreateInfoKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_shader_non_semantic_info
+#endif
+#ifdef VK_KHR_present_id
+void reservedmarshal_VkPresentIdKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                    const VkPresentIdKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDevicePresentIdFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePresentIdFeaturesKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_video_encode_queue
+void reservedmarshal_VkVideoEncodeInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkVideoEncodeInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoEncodeRateControlInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeRateControlInfoKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_synchronization2
+void reservedmarshal_VkMemoryBarrier2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkMemoryBarrier2KHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkBufferMemoryBarrier2KHR(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkBufferMemoryBarrier2KHR* forMarshaling,
+                                               uint8_t** ptr);
+
+void reservedmarshal_VkImageMemoryBarrier2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkImageMemoryBarrier2KHR* forMarshaling,
+                                              uint8_t** ptr);
+
+void reservedmarshal_VkDependencyInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkDependencyInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSemaphoreSubmitInfoKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkSemaphoreSubmitInfoKHR* forMarshaling,
+                                              uint8_t** ptr);
+
+void reservedmarshal_VkCommandBufferSubmitInfoKHR(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkCommandBufferSubmitInfoKHR* forMarshaling,
+                                                  uint8_t** ptr);
+
+void reservedmarshal_VkSubmitInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkSubmitInfo2KHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceSynchronization2FeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSynchronization2FeaturesKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkQueueFamilyCheckpointProperties2NV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkQueueFamilyCheckpointProperties2NV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkCheckpointData2NV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkCheckpointData2NV* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_shader_subgroup_uniform_control_flow
+void reservedmarshal_VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR* forMarshaling,
+    uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_zero_initialize_workgroup_memory
+void reservedmarshal_VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_workgroup_memory_explicit_layout
+void reservedmarshal_VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_copy_commands2
+void reservedmarshal_VkBufferCopy2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkBufferCopy2KHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkCopyBufferInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkCopyBufferInfo2KHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkImageCopy2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkImageCopy2KHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkCopyImageInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkCopyImageInfo2KHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkBufferImageCopy2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkBufferImageCopy2KHR* forMarshaling,
+                                           uint8_t** ptr);
+
+void reservedmarshal_VkCopyBufferToImageInfo2KHR(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkCopyBufferToImageInfo2KHR* forMarshaling,
+                                                 uint8_t** ptr);
+
+void reservedmarshal_VkCopyImageToBufferInfo2KHR(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkCopyImageToBufferInfo2KHR* forMarshaling,
+                                                 uint8_t** ptr);
+
+void reservedmarshal_VkImageBlit2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                     const VkImageBlit2KHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkBlitImageInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkBlitImageInfo2KHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkImageResolve2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkImageResolve2KHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkResolveImageInfo2KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkResolveImageInfo2KHR* forMarshaling,
+                                            uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_format_feature_flags2
+void reservedmarshal_VkFormatProperties3KHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkFormatProperties3KHR* forMarshaling,
+                                            uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_maintenance4
+void reservedmarshal_VkPhysicalDeviceMaintenance4FeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMaintenance4FeaturesKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceMaintenance4PropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMaintenance4PropertiesKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDeviceBufferMemoryRequirementsKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceBufferMemoryRequirementsKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDeviceImageMemoryRequirementsKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceImageMemoryRequirementsKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_ANDROID_native_buffer
+void reservedmarshal_VkNativeBufferANDROID(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkNativeBufferANDROID* forMarshaling,
+                                           uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_debug_report
+void reservedmarshal_VkDebugReportCallbackCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDebugReportCallbackCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_NV_glsl_shader
+#endif
+#ifdef VK_EXT_depth_range_unrestricted
+#endif
+#ifdef VK_IMG_filter_cubic
+#endif
+#ifdef VK_AMD_rasterization_order
+void reservedmarshal_VkPipelineRasterizationStateRasterizationOrderAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRasterizationStateRasterizationOrderAMD* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_AMD_shader_trinary_minmax
+#endif
+#ifdef VK_AMD_shader_explicit_vertex_parameter
+#endif
+#ifdef VK_EXT_debug_marker
+void reservedmarshal_VkDebugMarkerObjectNameInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDebugMarkerObjectNameInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDebugMarkerObjectTagInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDebugMarkerObjectTagInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDebugMarkerMarkerInfoEXT(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkDebugMarkerMarkerInfoEXT* forMarshaling,
+                                                uint8_t** ptr);
+
+#endif
+#ifdef VK_AMD_gcn_shader
+#endif
+#ifdef VK_NV_dedicated_allocation
+void reservedmarshal_VkDedicatedAllocationImageCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDedicatedAllocationImageCreateInfoNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDedicatedAllocationBufferCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDedicatedAllocationBufferCreateInfoNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDedicatedAllocationMemoryAllocateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDedicatedAllocationMemoryAllocateInfoNV* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_transform_feedback
+void reservedmarshal_VkPhysicalDeviceTransformFeedbackFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceTransformFeedbackFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceTransformFeedbackPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceTransformFeedbackPropertiesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineRasterizationStateStreamCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRasterizationStateStreamCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_NVX_binary_import
+void reservedmarshal_VkCuModuleCreateInfoNVX(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkCuModuleCreateInfoNVX* forMarshaling,
+                                             uint8_t** ptr);
+
+void reservedmarshal_VkCuFunctionCreateInfoNVX(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkCuFunctionCreateInfoNVX* forMarshaling,
+                                               uint8_t** ptr);
+
+void reservedmarshal_VkCuLaunchInfoNVX(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                       const VkCuLaunchInfoNVX* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_NVX_image_view_handle
+void reservedmarshal_VkImageViewHandleInfoNVX(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkImageViewHandleInfoNVX* forMarshaling,
+                                              uint8_t** ptr);
+
+void reservedmarshal_VkImageViewAddressPropertiesNVX(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageViewAddressPropertiesNVX* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_AMD_draw_indirect_count
+#endif
+#ifdef VK_AMD_negative_viewport_height
+#endif
+#ifdef VK_AMD_gpu_shader_half_float
+#endif
+#ifdef VK_AMD_shader_ballot
+#endif
+#ifdef VK_EXT_video_encode_h264
+void reservedmarshal_VkVideoEncodeH264CapabilitiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH264CapabilitiesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoEncodeH264SessionCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH264SessionCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoEncodeH264SessionParametersAddInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH264SessionParametersAddInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoEncodeH264SessionParametersCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH264SessionParametersCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoEncodeH264DpbSlotInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH264DpbSlotInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoEncodeH264NaluSliceEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH264NaluSliceEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoEncodeH264VclFrameInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH264VclFrameInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoEncodeH264EmitPictureParametersEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH264EmitPictureParametersEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoEncodeH264ProfileEXT(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkVideoEncodeH264ProfileEXT* forMarshaling,
+                                                 uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_video_encode_h265
+void reservedmarshal_VkVideoEncodeH265CapabilitiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265CapabilitiesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoEncodeH265SessionCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265SessionCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoEncodeH265SessionParametersAddInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265SessionParametersAddInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoEncodeH265SessionParametersCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265SessionParametersCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoEncodeH265DpbSlotInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265DpbSlotInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoEncodeH265ReferenceListsEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265ReferenceListsEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoEncodeH265NaluSliceEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265NaluSliceEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoEncodeH265VclFrameInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265VclFrameInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoEncodeH265EmitPictureParametersEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoEncodeH265EmitPictureParametersEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoEncodeH265ProfileEXT(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkVideoEncodeH265ProfileEXT* forMarshaling,
+                                                 uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_video_decode_h264
+void reservedmarshal_VkVideoDecodeH264ProfileEXT(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkVideoDecodeH264ProfileEXT* forMarshaling,
+                                                 uint8_t** ptr);
+
+void reservedmarshal_VkVideoDecodeH264CapabilitiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH264CapabilitiesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoDecodeH264SessionCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH264SessionCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoDecodeH264SessionParametersAddInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH264SessionParametersAddInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoDecodeH264SessionParametersCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH264SessionParametersCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoDecodeH264PictureInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH264PictureInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoDecodeH264MvcEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkVideoDecodeH264MvcEXT* forMarshaling,
+                                             uint8_t** ptr);
+
+void reservedmarshal_VkVideoDecodeH264DpbSlotInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH264DpbSlotInfoEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_AMD_texture_gather_bias_lod
+void reservedmarshal_VkTextureLODGatherFormatPropertiesAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkTextureLODGatherFormatPropertiesAMD* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_AMD_shader_info
+void reservedmarshal_VkShaderResourceUsageAMD(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkShaderResourceUsageAMD* forMarshaling,
+                                              uint8_t** ptr);
+
+void reservedmarshal_VkShaderStatisticsInfoAMD(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkShaderStatisticsInfoAMD* forMarshaling,
+                                               uint8_t** ptr);
+
+#endif
+#ifdef VK_AMD_shader_image_load_store_lod
+#endif
+#ifdef VK_GGP_stream_descriptor_surface
+void reservedmarshal_VkStreamDescriptorSurfaceCreateInfoGGP(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkStreamDescriptorSurfaceCreateInfoGGP* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_NV_corner_sampled_image
+void reservedmarshal_VkPhysicalDeviceCornerSampledImageFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceCornerSampledImageFeaturesNV* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_IMG_format_pvrtc
+#endif
+#ifdef VK_NV_external_memory_capabilities
+void reservedmarshal_VkExternalImageFormatPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExternalImageFormatPropertiesNV* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_NV_external_memory
+void reservedmarshal_VkExternalMemoryImageCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExternalMemoryImageCreateInfoNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkExportMemoryAllocateInfoNV(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkExportMemoryAllocateInfoNV* forMarshaling,
+                                                  uint8_t** ptr);
+
+#endif
+#ifdef VK_NV_external_memory_win32
+void reservedmarshal_VkImportMemoryWin32HandleInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportMemoryWin32HandleInfoNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkExportMemoryWin32HandleInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkExportMemoryWin32HandleInfoNV* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_NV_win32_keyed_mutex
+void reservedmarshal_VkWin32KeyedMutexAcquireReleaseInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkWin32KeyedMutexAcquireReleaseInfoNV* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_validation_flags
+void reservedmarshal_VkValidationFlagsEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkValidationFlagsEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_NN_vi_surface
+void reservedmarshal_VkViSurfaceCreateInfoNN(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkViSurfaceCreateInfoNN* forMarshaling,
+                                             uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_shader_subgroup_ballot
+#endif
+#ifdef VK_EXT_shader_subgroup_vote
+#endif
+#ifdef VK_EXT_texture_compression_astc_hdr
+void reservedmarshal_VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_astc_decode_mode
+void reservedmarshal_VkImageViewASTCDecodeModeEXT(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkImageViewASTCDecodeModeEXT* forMarshaling,
+                                                  uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceASTCDecodeFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceASTCDecodeFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_conditional_rendering
+void reservedmarshal_VkConditionalRenderingBeginInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkConditionalRenderingBeginInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceConditionalRenderingFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceConditionalRenderingFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkCommandBufferInheritanceConditionalRenderingInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCommandBufferInheritanceConditionalRenderingInfoEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+void reservedmarshal_VkViewportWScalingNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkViewportWScalingNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineViewportWScalingStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineViewportWScalingStateCreateInfoNV* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_direct_mode_display
+#endif
+#ifdef VK_EXT_acquire_xlib_display
+#endif
+#ifdef VK_EXT_display_surface_counter
+void reservedmarshal_VkSurfaceCapabilities2EXT(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkSurfaceCapabilities2EXT* forMarshaling,
+                                               uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_display_control
+void reservedmarshal_VkDisplayPowerInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkDisplayPowerInfoEXT* forMarshaling,
+                                           uint8_t** ptr);
+
+void reservedmarshal_VkDeviceEventInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkDeviceEventInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDisplayEventInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkDisplayEventInfoEXT* forMarshaling,
+                                           uint8_t** ptr);
+
+void reservedmarshal_VkSwapchainCounterCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSwapchainCounterCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_GOOGLE_display_timing
+void reservedmarshal_VkRefreshCycleDurationGOOGLE(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkRefreshCycleDurationGOOGLE* forMarshaling,
+                                                  uint8_t** ptr);
+
+void reservedmarshal_VkPastPresentationTimingGOOGLE(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPastPresentationTimingGOOGLE* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPresentTimeGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkPresentTimeGOOGLE* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPresentTimesInfoGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkPresentTimesInfoGOOGLE* forMarshaling,
+                                              uint8_t** ptr);
+
+#endif
+#ifdef VK_NV_sample_mask_override_coverage
+#endif
+#ifdef VK_NV_geometry_shader_passthrough
+#endif
+#ifdef VK_NV_viewport_array2
+#endif
+#ifdef VK_NVX_multiview_per_view_attributes
+void reservedmarshal_VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_NV_viewport_swizzle
+void reservedmarshal_VkViewportSwizzleNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkViewportSwizzleNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineViewportSwizzleStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineViewportSwizzleStateCreateInfoNV* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_discard_rectangles
+void reservedmarshal_VkPhysicalDeviceDiscardRectanglePropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDiscardRectanglePropertiesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineDiscardRectangleStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineDiscardRectangleStateCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_conservative_rasterization
+void reservedmarshal_VkPhysicalDeviceConservativeRasterizationPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceConservativeRasterizationPropertiesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineRasterizationConservativeStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRasterizationConservativeStateCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_depth_clip_enable
+void reservedmarshal_VkPhysicalDeviceDepthClipEnableFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDepthClipEnableFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineRasterizationDepthClipStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRasterizationDepthClipStateCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_swapchain_colorspace
+#endif
+#ifdef VK_EXT_hdr_metadata
+void reservedmarshal_VkXYColorEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkXYColorEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkHdrMetadataEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkHdrMetadataEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_MVK_ios_surface
+void reservedmarshal_VkIOSSurfaceCreateInfoMVK(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkIOSSurfaceCreateInfoMVK* forMarshaling,
+                                               uint8_t** ptr);
+
+#endif
+#ifdef VK_MVK_macos_surface
+void reservedmarshal_VkMacOSSurfaceCreateInfoMVK(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkMacOSSurfaceCreateInfoMVK* forMarshaling,
+                                                 uint8_t** ptr);
+
+#endif
+#ifdef VK_MVK_moltenvk
+#endif
+#ifdef VK_EXT_external_memory_dma_buf
+#endif
+#ifdef VK_EXT_queue_family_foreign
+#endif
+#ifdef VK_EXT_debug_utils
+void reservedmarshal_VkDebugUtilsLabelEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkDebugUtilsLabelEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDebugUtilsObjectNameInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDebugUtilsObjectNameInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDebugUtilsMessengerCallbackDataEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDebugUtilsMessengerCallbackDataEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDebugUtilsMessengerCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDebugUtilsMessengerCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDebugUtilsObjectTagInfoEXT(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkDebugUtilsObjectTagInfoEXT* forMarshaling,
+                                                  uint8_t** ptr);
+
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+void reservedmarshal_VkAndroidHardwareBufferUsageANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAndroidHardwareBufferUsageANDROID* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkAndroidHardwareBufferPropertiesANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAndroidHardwareBufferPropertiesANDROID* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkAndroidHardwareBufferFormatPropertiesANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAndroidHardwareBufferFormatPropertiesANDROID* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkImportAndroidHardwareBufferInfoANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportAndroidHardwareBufferInfoANDROID* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkMemoryGetAndroidHardwareBufferInfoANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryGetAndroidHardwareBufferInfoANDROID* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkExternalFormatANDROID(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkExternalFormatANDROID* forMarshaling,
+                                             uint8_t** ptr);
+
+void reservedmarshal_VkAndroidHardwareBufferFormatProperties2ANDROID(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAndroidHardwareBufferFormatProperties2ANDROID* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_sampler_filter_minmax
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkSamplerReductionModeCreateInfo,
+                      reservedmarshal_VkSamplerReductionModeCreateInfoEXT)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceSamplerFilterMinmaxProperties,
+                      reservedmarshal_VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT)
+
+#endif
+#ifdef VK_AMD_gpu_shader_int16
+#endif
+#ifdef VK_AMD_mixed_attachment_samples
+#endif
+#ifdef VK_AMD_shader_fragment_mask
+#endif
+#ifdef VK_EXT_inline_uniform_block
+void reservedmarshal_VkPhysicalDeviceInlineUniformBlockFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceInlineUniformBlockFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceInlineUniformBlockPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceInlineUniformBlockPropertiesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkWriteDescriptorSetInlineUniformBlockEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkWriteDescriptorSetInlineUniformBlockEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDescriptorPoolInlineUniformBlockCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDescriptorPoolInlineUniformBlockCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_shader_stencil_export
+#endif
+#ifdef VK_EXT_sample_locations
+void reservedmarshal_VkSampleLocationEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                         const VkSampleLocationEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSampleLocationsInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkSampleLocationsInfoEXT* forMarshaling,
+                                              uint8_t** ptr);
+
+void reservedmarshal_VkAttachmentSampleLocationsEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAttachmentSampleLocationsEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSubpassSampleLocationsEXT(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkSubpassSampleLocationsEXT* forMarshaling,
+                                                 uint8_t** ptr);
+
+void reservedmarshal_VkRenderPassSampleLocationsBeginInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRenderPassSampleLocationsBeginInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineSampleLocationsStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineSampleLocationsStateCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceSampleLocationsPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSampleLocationsPropertiesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkMultisamplePropertiesEXT(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkMultisamplePropertiesEXT* forMarshaling,
+                                                uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_blend_operation_advanced
+void reservedmarshal_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineColorBlendAdvancedStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineColorBlendAdvancedStateCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_NV_fragment_coverage_to_color
+void reservedmarshal_VkPipelineCoverageToColorStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineCoverageToColorStateCreateInfoNV* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_NV_framebuffer_mixed_samples
+void reservedmarshal_VkPipelineCoverageModulationStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineCoverageModulationStateCreateInfoNV* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_NV_fill_rectangle
+#endif
+#ifdef VK_NV_shader_sm_builtins
+void reservedmarshal_VkPhysicalDeviceShaderSMBuiltinsPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSMBuiltinsPropertiesNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceShaderSMBuiltinsFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderSMBuiltinsFeaturesNV* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_post_depth_coverage
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+void reservedmarshal_VkDrmFormatModifierPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDrmFormatModifierPropertiesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDrmFormatModifierPropertiesListEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDrmFormatModifierPropertiesListEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceImageDrmFormatModifierInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceImageDrmFormatModifierInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkImageDrmFormatModifierListCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageDrmFormatModifierListCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkImageDrmFormatModifierExplicitCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageDrmFormatModifierExplicitCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkImageDrmFormatModifierPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageDrmFormatModifierPropertiesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDrmFormatModifierProperties2EXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDrmFormatModifierProperties2EXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDrmFormatModifierPropertiesList2EXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDrmFormatModifierPropertiesList2EXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_validation_cache
+void reservedmarshal_VkValidationCacheCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkValidationCacheCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkShaderModuleValidationCacheCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkShaderModuleValidationCacheCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_descriptor_indexing
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkDescriptorSetLayoutBindingFlagsCreateInfo,
+                      reservedmarshal_VkDescriptorSetLayoutBindingFlagsCreateInfoEXT)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceDescriptorIndexingFeatures,
+                      reservedmarshal_VkPhysicalDeviceDescriptorIndexingFeaturesEXT)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceDescriptorIndexingProperties,
+                      reservedmarshal_VkPhysicalDeviceDescriptorIndexingPropertiesEXT)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkDescriptorSetVariableDescriptorCountAllocateInfo,
+                      reservedmarshal_VkDescriptorSetVariableDescriptorCountAllocateInfoEXT)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkDescriptorSetVariableDescriptorCountLayoutSupport,
+                      reservedmarshal_VkDescriptorSetVariableDescriptorCountLayoutSupportEXT)
+
+#endif
+#ifdef VK_EXT_shader_viewport_index_layer
+#endif
+#ifdef VK_NV_shading_rate_image
+void reservedmarshal_VkShadingRatePaletteNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkShadingRatePaletteNV* forMarshaling,
+                                            uint8_t** ptr);
+
+void reservedmarshal_VkPipelineViewportShadingRateImageStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineViewportShadingRateImageStateCreateInfoNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceShadingRateImageFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShadingRateImageFeaturesNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceShadingRateImagePropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShadingRateImagePropertiesNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkCoarseSampleLocationNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkCoarseSampleLocationNV* forMarshaling,
+                                              uint8_t** ptr);
+
+void reservedmarshal_VkCoarseSampleOrderCustomNV(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkCoarseSampleOrderCustomNV* forMarshaling,
+                                                 uint8_t** ptr);
+
+void reservedmarshal_VkPipelineViewportCoarseSampleOrderStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineViewportCoarseSampleOrderStateCreateInfoNV* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_NV_ray_tracing
+void reservedmarshal_VkRayTracingShaderGroupCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRayTracingShaderGroupCreateInfoNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkRayTracingPipelineCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRayTracingPipelineCreateInfoNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkGeometryTrianglesNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                           const VkGeometryTrianglesNV* forMarshaling,
+                                           uint8_t** ptr);
+
+void reservedmarshal_VkGeometryAABBNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkGeometryAABBNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkGeometryDataNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                      const VkGeometryDataNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkGeometryNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                  const VkGeometryNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkAccelerationStructureInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureInfoNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkAccelerationStructureCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureCreateInfoNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkBindAccelerationStructureMemoryInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBindAccelerationStructureMemoryInfoNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkWriteDescriptorSetAccelerationStructureNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkWriteDescriptorSetAccelerationStructureNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkAccelerationStructureMemoryRequirementsInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureMemoryRequirementsInfoNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceRayTracingPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingPropertiesNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkTransformMatrixKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkTransformMatrixKHR* forMarshaling, uint8_t** ptr);
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkTransformMatrixKHR, reservedmarshal_VkTransformMatrixNV)
+
+void reservedmarshal_VkAabbPositionsKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkAabbPositionsKHR* forMarshaling, uint8_t** ptr);
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkAabbPositionsKHR, reservedmarshal_VkAabbPositionsNV)
+
+void reservedmarshal_VkAccelerationStructureInstanceKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureInstanceKHR* forMarshaling, uint8_t** ptr);
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkAccelerationStructureInstanceKHR,
+                      reservedmarshal_VkAccelerationStructureInstanceNV)
+
+#endif
+#ifdef VK_NV_representative_fragment_test
+void reservedmarshal_VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineRepresentativeFragmentTestStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRepresentativeFragmentTestStateCreateInfoNV* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_filter_cubic
+void reservedmarshal_VkPhysicalDeviceImageViewImageFormatInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceImageViewImageFormatInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkFilterCubicImageViewImageFormatPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkFilterCubicImageViewImageFormatPropertiesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_QCOM_render_pass_shader_resolve
+#endif
+#ifdef VK_EXT_global_priority
+void reservedmarshal_VkDeviceQueueGlobalPriorityCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceQueueGlobalPriorityCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_external_memory_host
+void reservedmarshal_VkImportMemoryHostPointerInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportMemoryHostPointerInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkMemoryHostPointerPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryHostPointerPropertiesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceExternalMemoryHostPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExternalMemoryHostPropertiesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_AMD_buffer_marker
+#endif
+#ifdef VK_AMD_pipeline_compiler_control
+void reservedmarshal_VkPipelineCompilerControlCreateInfoAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineCompilerControlCreateInfoAMD* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_calibrated_timestamps
+void reservedmarshal_VkCalibratedTimestampInfoEXT(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkCalibratedTimestampInfoEXT* forMarshaling,
+                                                  uint8_t** ptr);
+
+#endif
+#ifdef VK_AMD_shader_core_properties
+void reservedmarshal_VkPhysicalDeviceShaderCorePropertiesAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderCorePropertiesAMD* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_video_decode_h265
+void reservedmarshal_VkVideoDecodeH265ProfileEXT(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkVideoDecodeH265ProfileEXT* forMarshaling,
+                                                 uint8_t** ptr);
+
+void reservedmarshal_VkVideoDecodeH265CapabilitiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH265CapabilitiesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoDecodeH265SessionCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH265SessionCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoDecodeH265SessionParametersAddInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH265SessionParametersAddInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoDecodeH265SessionParametersCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH265SessionParametersCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoDecodeH265PictureInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH265PictureInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVideoDecodeH265DpbSlotInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVideoDecodeH265DpbSlotInfoEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_AMD_memory_overallocation_behavior
+void reservedmarshal_VkDeviceMemoryOverallocationCreateInfoAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceMemoryOverallocationCreateInfoAMD* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_vertex_attribute_divisor
+void reservedmarshal_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVertexInputBindingDivisorDescriptionEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVertexInputBindingDivisorDescriptionEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineVertexInputDivisorStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineVertexInputDivisorStateCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_GGP_frame_token
+void reservedmarshal_VkPresentFrameTokenGGP(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                            const VkPresentFrameTokenGGP* forMarshaling,
+                                            uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_pipeline_creation_feedback
+void reservedmarshal_VkPipelineCreationFeedbackEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineCreationFeedbackEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineCreationFeedbackCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineCreationFeedbackCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_NV_shader_subgroup_partitioned
+#endif
+#ifdef VK_NV_compute_shader_derivatives
+void reservedmarshal_VkPhysicalDeviceComputeShaderDerivativesFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceComputeShaderDerivativesFeaturesNV* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_NV_mesh_shader
+void reservedmarshal_VkPhysicalDeviceMeshShaderFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMeshShaderFeaturesNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceMeshShaderPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMeshShaderPropertiesNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDrawMeshTasksIndirectCommandNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDrawMeshTasksIndirectCommandNV* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_NV_fragment_shader_barycentric
+void reservedmarshal_VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_NV_shader_image_footprint
+void reservedmarshal_VkPhysicalDeviceShaderImageFootprintFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderImageFootprintFeaturesNV* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_NV_scissor_exclusive
+void reservedmarshal_VkPipelineViewportExclusiveScissorStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineViewportExclusiveScissorStateCreateInfoNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceExclusiveScissorFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExclusiveScissorFeaturesNV* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+void reservedmarshal_VkQueueFamilyCheckpointPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkQueueFamilyCheckpointPropertiesNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkCheckpointDataNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkCheckpointDataNV* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_INTEL_shader_integer_functions2
+void reservedmarshal_VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_INTEL_performance_query
+void reservedmarshal_VkPerformanceValueDataINTEL(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkPerformanceValueDataINTEL* forMarshaling,
+                                                 uint8_t** ptr);
+
+void reservedmarshal_VkPerformanceValueINTEL(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkPerformanceValueINTEL* forMarshaling,
+                                             uint8_t** ptr);
+
+void reservedmarshal_VkInitializePerformanceApiInfoINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkInitializePerformanceApiInfoINTEL* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkQueryPoolPerformanceQueryCreateInfoINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkQueryPoolPerformanceQueryCreateInfoINTEL* forMarshaling, uint8_t** ptr);
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkQueryPoolPerformanceQueryCreateInfoINTEL,
+                      reservedmarshal_VkQueryPoolCreateInfoINTEL)
+
+void reservedmarshal_VkPerformanceMarkerInfoINTEL(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkPerformanceMarkerInfoINTEL* forMarshaling,
+                                                  uint8_t** ptr);
+
+void reservedmarshal_VkPerformanceStreamMarkerInfoINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPerformanceStreamMarkerInfoINTEL* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPerformanceOverrideInfoINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPerformanceOverrideInfoINTEL* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPerformanceConfigurationAcquireInfoINTEL(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPerformanceConfigurationAcquireInfoINTEL* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_pci_bus_info
+void reservedmarshal_VkPhysicalDevicePCIBusInfoPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePCIBusInfoPropertiesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_AMD_display_native_hdr
+void reservedmarshal_VkDisplayNativeHdrSurfaceCapabilitiesAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDisplayNativeHdrSurfaceCapabilitiesAMD* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSwapchainDisplayNativeHdrCreateInfoAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSwapchainDisplayNativeHdrCreateInfoAMD* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_FUCHSIA_imagepipe_surface
+void reservedmarshal_VkImagePipeSurfaceCreateInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImagePipeSurfaceCreateInfoFUCHSIA* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_metal_surface
+void reservedmarshal_VkMetalSurfaceCreateInfoEXT(VulkanStreamGuest* vkStream,
+                                                 VkStructureType rootType,
+                                                 const VkMetalSurfaceCreateInfoEXT* forMarshaling,
+                                                 uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_fragment_density_map
+void reservedmarshal_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMapFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMapPropertiesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkRenderPassFragmentDensityMapCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRenderPassFragmentDensityMapCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_scalar_block_layout
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceScalarBlockLayoutFeatures,
+                      reservedmarshal_VkPhysicalDeviceScalarBlockLayoutFeaturesEXT)
+
+#endif
+#ifdef VK_GOOGLE_hlsl_functionality1
+#endif
+#ifdef VK_GOOGLE_decorate_string
+#endif
+#ifdef VK_EXT_subgroup_size_control
+void reservedmarshal_VkPhysicalDeviceSubgroupSizeControlFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSubgroupSizeControlFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceSubgroupSizeControlPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSubgroupSizeControlPropertiesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_AMD_shader_core_properties2
+void reservedmarshal_VkPhysicalDeviceShaderCoreProperties2AMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderCoreProperties2AMD* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_AMD_device_coherent_memory
+void reservedmarshal_VkPhysicalDeviceCoherentMemoryFeaturesAMD(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceCoherentMemoryFeaturesAMD* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_shader_image_atomic_int64
+void reservedmarshal_VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_memory_budget
+void reservedmarshal_VkPhysicalDeviceMemoryBudgetPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMemoryBudgetPropertiesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_memory_priority
+void reservedmarshal_VkPhysicalDeviceMemoryPriorityFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMemoryPriorityFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkMemoryPriorityAllocateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryPriorityAllocateInfoEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_NV_dedicated_allocation_image_aliasing
+void reservedmarshal_VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_buffer_device_address
+void reservedmarshal_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceBufferDeviceAddressFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT,
+                      reservedmarshal_VkPhysicalDeviceBufferAddressFeaturesEXT)
+
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkBufferDeviceAddressInfo,
+                      reservedmarshal_VkBufferDeviceAddressInfoEXT)
+
+void reservedmarshal_VkBufferDeviceAddressCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferDeviceAddressCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_tooling_info
+void reservedmarshal_VkPhysicalDeviceToolPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceToolPropertiesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_separate_stencil_usage
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkImageStencilUsageCreateInfo,
+                      reservedmarshal_VkImageStencilUsageCreateInfoEXT)
+
+#endif
+#ifdef VK_EXT_validation_features
+void reservedmarshal_VkValidationFeaturesEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                             const VkValidationFeaturesEXT* forMarshaling,
+                                             uint8_t** ptr);
+
+#endif
+#ifdef VK_NV_cooperative_matrix
+void reservedmarshal_VkCooperativeMatrixPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCooperativeMatrixPropertiesNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceCooperativeMatrixFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceCooperativeMatrixFeaturesNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceCooperativeMatrixPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceCooperativeMatrixPropertiesNV* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+void reservedmarshal_VkPhysicalDeviceCoverageReductionModeFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceCoverageReductionModeFeaturesNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineCoverageReductionStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineCoverageReductionStateCreateInfoNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkFramebufferMixedSamplesCombinationNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkFramebufferMixedSamplesCombinationNV* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_fragment_shader_interlock
+void reservedmarshal_VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_ycbcr_image_arrays
+void reservedmarshal_VkPhysicalDeviceYcbcrImageArraysFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceYcbcrImageArraysFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_provoking_vertex
+void reservedmarshal_VkPhysicalDeviceProvokingVertexFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceProvokingVertexFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceProvokingVertexPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceProvokingVertexPropertiesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+void reservedmarshal_VkSurfaceFullScreenExclusiveInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSurfaceFullScreenExclusiveInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSurfaceCapabilitiesFullScreenExclusiveEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSurfaceCapabilitiesFullScreenExclusiveEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSurfaceFullScreenExclusiveWin32InfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSurfaceFullScreenExclusiveWin32InfoEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_headless_surface
+void reservedmarshal_VkHeadlessSurfaceCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkHeadlessSurfaceCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_line_rasterization
+void reservedmarshal_VkPhysicalDeviceLineRasterizationFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceLineRasterizationFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceLineRasterizationPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceLineRasterizationPropertiesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineRasterizationLineStateCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineRasterizationLineStateCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_shader_atomic_float
+void reservedmarshal_VkPhysicalDeviceShaderAtomicFloatFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderAtomicFloatFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_host_query_reset
+DEFINE_ALIAS_FUNCTION(reservedmarshal_VkPhysicalDeviceHostQueryResetFeatures,
+                      reservedmarshal_VkPhysicalDeviceHostQueryResetFeaturesEXT)
+
+#endif
+#ifdef VK_EXT_index_type_uint8
+void reservedmarshal_VkPhysicalDeviceIndexTypeUint8FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceIndexTypeUint8FeaturesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+void reservedmarshal_VkPhysicalDeviceExtendedDynamicStateFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExtendedDynamicStateFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_shader_atomic_float2
+void reservedmarshal_VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_shader_demote_to_helper_invocation
+void reservedmarshal_VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_NV_device_generated_commands
+void reservedmarshal_VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkGraphicsShaderGroupCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkGraphicsShaderGroupCreateInfoNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkGraphicsPipelineShaderGroupsCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkGraphicsPipelineShaderGroupsCreateInfoNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkBindShaderGroupIndirectCommandNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBindShaderGroupIndirectCommandNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkBindIndexBufferIndirectCommandNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBindIndexBufferIndirectCommandNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkBindVertexBufferIndirectCommandNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBindVertexBufferIndirectCommandNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSetStateFlagsIndirectCommandNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSetStateFlagsIndirectCommandNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkIndirectCommandsStreamNV(VulkanStreamGuest* vkStream,
+                                                VkStructureType rootType,
+                                                const VkIndirectCommandsStreamNV* forMarshaling,
+                                                uint8_t** ptr);
+
+void reservedmarshal_VkIndirectCommandsLayoutTokenNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkIndirectCommandsLayoutTokenNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkIndirectCommandsLayoutCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkIndirectCommandsLayoutCreateInfoNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkGeneratedCommandsInfoNV(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkGeneratedCommandsInfoNV* forMarshaling,
+                                               uint8_t** ptr);
+
+void reservedmarshal_VkGeneratedCommandsMemoryRequirementsInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkGeneratedCommandsMemoryRequirementsInfoNV* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_NV_inherited_viewport_scissor
+void reservedmarshal_VkPhysicalDeviceInheritedViewportScissorFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceInheritedViewportScissorFeaturesNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkCommandBufferInheritanceViewportScissorInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCommandBufferInheritanceViewportScissorInfoNV* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_texel_buffer_alignment
+void reservedmarshal_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_QCOM_render_pass_transform
+void reservedmarshal_VkRenderPassTransformBeginInfoQCOM(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRenderPassTransformBeginInfoQCOM* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkCommandBufferInheritanceRenderPassTransformInfoQCOM(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCommandBufferInheritanceRenderPassTransformInfoQCOM* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_device_memory_report
+void reservedmarshal_VkPhysicalDeviceDeviceMemoryReportFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDeviceMemoryReportFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDeviceMemoryReportCallbackDataEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceMemoryReportCallbackDataEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDeviceDeviceMemoryReportCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceDeviceMemoryReportCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_acquire_drm_display
+#endif
+#ifdef VK_EXT_robustness2
+void reservedmarshal_VkPhysicalDeviceRobustness2FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRobustness2FeaturesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceRobustness2PropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRobustness2PropertiesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_custom_border_color
+void reservedmarshal_VkSamplerCustomBorderColorCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSamplerCustomBorderColorCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceCustomBorderColorPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceCustomBorderColorPropertiesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceCustomBorderColorFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceCustomBorderColorFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_GOOGLE_user_type
+#endif
+#ifdef VK_EXT_private_data
+void reservedmarshal_VkPhysicalDevicePrivateDataFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePrivateDataFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDevicePrivateDataCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDevicePrivateDataCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPrivateDataSlotCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPrivateDataSlotCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_pipeline_creation_cache_control
+void reservedmarshal_VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_NV_device_diagnostics_config
+void reservedmarshal_VkPhysicalDeviceDiagnosticsConfigFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDiagnosticsConfigFeaturesNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkDeviceDiagnosticsConfigCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceDiagnosticsConfigCreateInfoNV* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_QCOM_render_pass_store_ops
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+void reservedmarshal_VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineFragmentShadingRateEnumStateCreateInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineFragmentShadingRateEnumStateCreateInfoNV* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_NV_ray_tracing_motion_blur
+void reservedmarshal_VkDeviceOrHostAddressConstKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDeviceOrHostAddressConstKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkAccelerationStructureGeometryMotionTrianglesDataNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureGeometryMotionTrianglesDataNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkAccelerationStructureMotionInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureMotionInfoNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkAccelerationStructureMatrixMotionInstanceNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureMatrixMotionInstanceNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSRTDataNV(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                 const VkSRTDataNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkAccelerationStructureSRTMotionInstanceNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureSRTMotionInstanceNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkAccelerationStructureMotionInstanceDataNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureMotionInstanceDataNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkAccelerationStructureMotionInstanceNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureMotionInstanceNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceRayTracingMotionBlurFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingMotionBlurFeaturesNV* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_ycbcr_2plane_444_formats
+void reservedmarshal_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_fragment_density_map2
+void reservedmarshal_VkPhysicalDeviceFragmentDensityMap2FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMap2FeaturesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceFragmentDensityMap2PropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceFragmentDensityMap2PropertiesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_QCOM_rotated_copy_commands
+void reservedmarshal_VkCopyCommandTransformInfoQCOM(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCopyCommandTransformInfoQCOM* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_image_robustness
+void reservedmarshal_VkPhysicalDeviceImageRobustnessFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceImageRobustnessFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_4444_formats
+void reservedmarshal_VkPhysicalDevice4444FormatsFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevice4444FormatsFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_rgba10x6_formats
+void reservedmarshal_VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_NV_acquire_winrt_display
+#endif
+#ifdef VK_EXT_directfb_surface
+void reservedmarshal_VkDirectFBSurfaceCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkDirectFBSurfaceCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_VALVE_mutable_descriptor_type
+void reservedmarshal_VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkMutableDescriptorTypeListVALVE(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMutableDescriptorTypeListVALVE* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkMutableDescriptorTypeCreateInfoVALVE(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMutableDescriptorTypeCreateInfoVALVE* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+void reservedmarshal_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVertexInputBindingDescription2EXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVertexInputBindingDescription2EXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkVertexInputAttributeDescription2EXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkVertexInputAttributeDescription2EXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_physical_device_drm
+void reservedmarshal_VkPhysicalDeviceDrmPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceDrmPropertiesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_primitive_topology_list_restart
+void reservedmarshal_VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_FUCHSIA_external_memory
+void reservedmarshal_VkImportMemoryZirconHandleInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportMemoryZirconHandleInfoFUCHSIA* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkMemoryZirconHandlePropertiesFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryZirconHandlePropertiesFUCHSIA* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkMemoryGetZirconHandleInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryGetZirconHandleInfoFUCHSIA* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_FUCHSIA_external_semaphore
+void reservedmarshal_VkImportSemaphoreZirconHandleInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportSemaphoreZirconHandleInfoFUCHSIA* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSemaphoreGetZirconHandleInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSemaphoreGetZirconHandleInfoFUCHSIA* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+void reservedmarshal_VkBufferCollectionCreateInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferCollectionCreateInfoFUCHSIA* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkImportMemoryBufferCollectionFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImportMemoryBufferCollectionFUCHSIA* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkBufferCollectionImageCreateInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferCollectionImageCreateInfoFUCHSIA* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkBufferCollectionConstraintsInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferCollectionConstraintsInfoFUCHSIA* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkBufferConstraintsInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferConstraintsInfoFUCHSIA* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkBufferCollectionBufferCreateInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferCollectionBufferCreateInfoFUCHSIA* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSysmemColorSpaceFUCHSIA(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkSysmemColorSpaceFUCHSIA* forMarshaling,
+                                               uint8_t** ptr);
+
+void reservedmarshal_VkBufferCollectionPropertiesFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkBufferCollectionPropertiesFUCHSIA* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkImageFormatConstraintsInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageFormatConstraintsInfoFUCHSIA* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkImageConstraintsInfoFUCHSIA(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkImageConstraintsInfoFUCHSIA* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+void reservedmarshal_VkSubpassShadingPipelineCreateInfoHUAWEI(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSubpassShadingPipelineCreateInfoHUAWEI* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceSubpassShadingFeaturesHUAWEI(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSubpassShadingFeaturesHUAWEI* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceSubpassShadingPropertiesHUAWEI(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceSubpassShadingPropertiesHUAWEI* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+void reservedmarshal_VkPhysicalDeviceInvocationMaskFeaturesHUAWEI(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceInvocationMaskFeaturesHUAWEI* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_NV_external_memory_rdma
+void reservedmarshal_VkMemoryGetRemoteAddressInfoNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkMemoryGetRemoteAddressInfoNV* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceExternalMemoryRDMAFeaturesNV(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExternalMemoryRDMAFeaturesNV* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+void reservedmarshal_VkPhysicalDeviceExtendedDynamicState2FeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceExtendedDynamicState2FeaturesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_QNX_screen_surface
+void reservedmarshal_VkScreenSurfaceCreateInfoQNX(VulkanStreamGuest* vkStream,
+                                                  VkStructureType rootType,
+                                                  const VkScreenSurfaceCreateInfoQNX* forMarshaling,
+                                                  uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_color_write_enable
+void reservedmarshal_VkPhysicalDeviceColorWriteEnableFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceColorWriteEnableFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPipelineColorWriteCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPipelineColorWriteCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_GOOGLE_gfxstream
+void reservedmarshal_VkImportColorBufferGOOGLE(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkImportColorBufferGOOGLE* forMarshaling,
+                                               uint8_t** ptr);
+
+void reservedmarshal_VkImportBufferGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                          const VkImportBufferGOOGLE* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkCreateBlobGOOGLE(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkCreateBlobGOOGLE* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_global_priority_query
+void reservedmarshal_VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkQueueFamilyGlobalPriorityPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkQueueFamilyGlobalPriorityPropertiesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_multi_draw
+void reservedmarshal_VkPhysicalDeviceMultiDrawFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMultiDrawFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceMultiDrawPropertiesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceMultiDrawPropertiesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkMultiDrawInfoEXT(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                        const VkMultiDrawInfoEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkMultiDrawIndexedInfoEXT(VulkanStreamGuest* vkStream,
+                                               VkStructureType rootType,
+                                               const VkMultiDrawIndexedInfoEXT* forMarshaling,
+                                               uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_load_store_op_none
+#endif
+#ifdef VK_EXT_border_color_swizzle
+void reservedmarshal_VkPhysicalDeviceBorderColorSwizzleFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceBorderColorSwizzleFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkSamplerBorderColorComponentMappingCreateInfoEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkSamplerBorderColorComponentMappingCreateInfoEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+void reservedmarshal_VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_acceleration_structure
+void reservedmarshal_VkDeviceOrHostAddressKHR(VulkanStreamGuest* vkStream, VkStructureType rootType,
+                                              const VkDeviceOrHostAddressKHR* forMarshaling,
+                                              uint8_t** ptr);
+
+void reservedmarshal_VkAccelerationStructureBuildRangeInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureBuildRangeInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkAccelerationStructureGeometryTrianglesDataKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureGeometryTrianglesDataKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkAccelerationStructureGeometryAabbsDataKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureGeometryAabbsDataKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkAccelerationStructureGeometryInstancesDataKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureGeometryInstancesDataKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkAccelerationStructureGeometryDataKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureGeometryDataKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkAccelerationStructureGeometryKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureGeometryKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkAccelerationStructureBuildGeometryInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureBuildGeometryInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkAccelerationStructureCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureCreateInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkWriteDescriptorSetAccelerationStructureKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkWriteDescriptorSetAccelerationStructureKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceAccelerationStructureFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceAccelerationStructureFeaturesKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceAccelerationStructurePropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceAccelerationStructurePropertiesKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkAccelerationStructureDeviceAddressInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureDeviceAddressInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkAccelerationStructureVersionInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureVersionInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkCopyAccelerationStructureToMemoryInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCopyAccelerationStructureToMemoryInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkCopyMemoryToAccelerationStructureInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCopyMemoryToAccelerationStructureInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkCopyAccelerationStructureInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkCopyAccelerationStructureInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkAccelerationStructureBuildSizesInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkAccelerationStructureBuildSizesInfoKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+void reservedmarshal_VkRayTracingShaderGroupCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRayTracingShaderGroupCreateInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkRayTracingPipelineInterfaceCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRayTracingPipelineInterfaceCreateInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkRayTracingPipelineCreateInfoKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkRayTracingPipelineCreateInfoKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceRayTracingPipelineFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingPipelineFeaturesKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkPhysicalDeviceRayTracingPipelinePropertiesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRayTracingPipelinePropertiesKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkStridedDeviceAddressRegionKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkStridedDeviceAddressRegionKHR* forMarshaling, uint8_t** ptr);
+
+void reservedmarshal_VkTraceRaysIndirectCommandKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkTraceRaysIndirectCommandKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+#ifdef VK_KHR_ray_query
+void reservedmarshal_VkPhysicalDeviceRayQueryFeaturesKHR(
+    VulkanStreamGuest* vkStream, VkStructureType rootType,
+    const VkPhysicalDeviceRayQueryFeaturesKHR* forMarshaling, uint8_t** ptr);
+
+#endif
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/goldfish_vk_transform_guest.cpp b/system/vulkan_enc/goldfish_vk_transform_guest.cpp
new file mode 100644
index 0000000..19ed2d8
--- /dev/null
+++ b/system/vulkan_enc/goldfish_vk_transform_guest.cpp
@@ -0,0 +1,21020 @@
+// Copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2018 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Autogenerated module goldfish_vk_transform_guest
+//
+// (impl) generated by codegen/vulkan/scripts/genvk.py -registry codegen/vulkan/xml/vk.xml cereal -o
+// host/vulkan/cereal
+//
+// Please do not modify directly;
+// re-run gfxstream-protocols/scripts/generate-vulkan-sources.sh,
+// or directly from Python by defining:
+// VULKAN_REGISTRY_XML_DIR : Directory containing vk.xml
+// VULKAN_REGISTRY_SCRIPTS_DIR : Directory containing genvk.py
+// CEREAL_OUTPUT_DIR: Where to put the generated sources.
+//
+// python3 $VULKAN_REGISTRY_SCRIPTS_DIR/genvk.py -registry $VULKAN_REGISTRY_XML_DIR/vk.xml cereal -o
+// $CEREAL_OUTPUT_DIR
+//
+
+#include "goldfish_vk_transform_guest.h"
+
+#include <cstring>
+
+#include "ResourceTracker.h"
+#include "goldfish_vk_extension_structs_guest.h"
+#include "goldfish_vk_private_defs.h"
+
+namespace gfxstream {
+namespace vk {
+
+void transform_tohost_extension_struct(ResourceTracker* resourceTracker, void* structExtension_out);
+
+void transform_fromhost_extension_struct(ResourceTracker* resourceTracker,
+                                         void* structExtension_out);
+
+#ifdef VK_VERSION_1_0
+void transform_tohost_VkExtent2D(ResourceTracker* resourceTracker, VkExtent2D* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkExtent2D(ResourceTracker* resourceTracker, VkExtent2D* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkExtent3D(ResourceTracker* resourceTracker, VkExtent3D* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkExtent3D(ResourceTracker* resourceTracker, VkExtent3D* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkOffset2D(ResourceTracker* resourceTracker, VkOffset2D* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkOffset2D(ResourceTracker* resourceTracker, VkOffset2D* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkOffset3D(ResourceTracker* resourceTracker, VkOffset3D* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkOffset3D(ResourceTracker* resourceTracker, VkOffset3D* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkRect2D(ResourceTracker* resourceTracker, VkRect2D* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkOffset2D(resourceTracker, (VkOffset2D*)(&toTransform->offset));
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->extent));
+}
+
+void transform_fromhost_VkRect2D(ResourceTracker* resourceTracker, VkRect2D* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkOffset2D(resourceTracker, (VkOffset2D*)(&toTransform->offset));
+    transform_fromhost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->extent));
+}
+
+void transform_tohost_VkBaseInStructure(ResourceTracker* resourceTracker,
+                                        VkBaseInStructure* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkBaseInStructure(ResourceTracker* resourceTracker,
+                                          VkBaseInStructure* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkBaseOutStructure(ResourceTracker* resourceTracker,
+                                         VkBaseOutStructure* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkBaseOutStructure(ResourceTracker* resourceTracker,
+                                           VkBaseOutStructure* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkBufferMemoryBarrier(ResourceTracker* resourceTracker,
+                                            VkBufferMemoryBarrier* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkBufferMemoryBarrier(ResourceTracker* resourceTracker,
+                                              VkBufferMemoryBarrier* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDispatchIndirectCommand(ResourceTracker* resourceTracker,
+                                                VkDispatchIndirectCommand* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkDispatchIndirectCommand(ResourceTracker* resourceTracker,
+                                                  VkDispatchIndirectCommand* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkDrawIndexedIndirectCommand(ResourceTracker* resourceTracker,
+                                                   VkDrawIndexedIndirectCommand* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkDrawIndexedIndirectCommand(ResourceTracker* resourceTracker,
+                                                     VkDrawIndexedIndirectCommand* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkDrawIndirectCommand(ResourceTracker* resourceTracker,
+                                            VkDrawIndirectCommand* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkDrawIndirectCommand(ResourceTracker* resourceTracker,
+                                              VkDrawIndirectCommand* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkImageSubresourceRange(ResourceTracker* resourceTracker,
+                                              VkImageSubresourceRange* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkImageSubresourceRange(ResourceTracker* resourceTracker,
+                                                VkImageSubresourceRange* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkImageMemoryBarrier(ResourceTracker* resourceTracker,
+                                           VkImageMemoryBarrier* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkImageSubresourceRange(
+        resourceTracker, (VkImageSubresourceRange*)(&toTransform->subresourceRange));
+}
+
+void transform_fromhost_VkImageMemoryBarrier(ResourceTracker* resourceTracker,
+                                             VkImageMemoryBarrier* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkImageSubresourceRange(
+        resourceTracker, (VkImageSubresourceRange*)(&toTransform->subresourceRange));
+}
+
+void transform_tohost_VkMemoryBarrier(ResourceTracker* resourceTracker,
+                                      VkMemoryBarrier* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkMemoryBarrier(ResourceTracker* resourceTracker,
+                                        VkMemoryBarrier* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPipelineCacheHeaderVersionOne(
+    ResourceTracker* resourceTracker, VkPipelineCacheHeaderVersionOne* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkPipelineCacheHeaderVersionOne(
+    ResourceTracker* resourceTracker, VkPipelineCacheHeaderVersionOne* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkAllocationCallbacks(ResourceTracker* resourceTracker,
+                                            VkAllocationCallbacks* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkAllocationCallbacks(ResourceTracker* resourceTracker,
+                                              VkAllocationCallbacks* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkApplicationInfo(ResourceTracker* resourceTracker,
+                                        VkApplicationInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkApplicationInfo(ResourceTracker* resourceTracker,
+                                          VkApplicationInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkFormatProperties(ResourceTracker* resourceTracker,
+                                         VkFormatProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkFormatProperties(ResourceTracker* resourceTracker,
+                                           VkFormatProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkImageFormatProperties(ResourceTracker* resourceTracker,
+                                              VkImageFormatProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkExtent3D(resourceTracker, (VkExtent3D*)(&toTransform->maxExtent));
+}
+
+void transform_fromhost_VkImageFormatProperties(ResourceTracker* resourceTracker,
+                                                VkImageFormatProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkExtent3D(resourceTracker, (VkExtent3D*)(&toTransform->maxExtent));
+}
+
+void transform_tohost_VkInstanceCreateInfo(ResourceTracker* resourceTracker,
+                                           VkInstanceCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pApplicationInfo) {
+        transform_tohost_VkApplicationInfo(resourceTracker,
+                                           (VkApplicationInfo*)(toTransform->pApplicationInfo));
+    }
+}
+
+void transform_fromhost_VkInstanceCreateInfo(ResourceTracker* resourceTracker,
+                                             VkInstanceCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pApplicationInfo) {
+        transform_fromhost_VkApplicationInfo(resourceTracker,
+                                             (VkApplicationInfo*)(toTransform->pApplicationInfo));
+    }
+}
+
+void transform_tohost_VkMemoryHeap(ResourceTracker* resourceTracker, VkMemoryHeap* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkMemoryHeap(ResourceTracker* resourceTracker, VkMemoryHeap* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkMemoryType(ResourceTracker* resourceTracker, VkMemoryType* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkMemoryType(ResourceTracker* resourceTracker, VkMemoryType* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkPhysicalDeviceFeatures(ResourceTracker* resourceTracker,
+                                               VkPhysicalDeviceFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkPhysicalDeviceFeatures(ResourceTracker* resourceTracker,
+                                                 VkPhysicalDeviceFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkPhysicalDeviceLimits(ResourceTracker* resourceTracker,
+                                             VkPhysicalDeviceLimits* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkPhysicalDeviceLimits(ResourceTracker* resourceTracker,
+                                               VkPhysicalDeviceLimits* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkPhysicalDeviceMemoryProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMemoryProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    for (uint32_t i = 0; i < (uint32_t)VK_MAX_MEMORY_TYPES; ++i) {
+        transform_tohost_VkMemoryType(resourceTracker,
+                                      (VkMemoryType*)(toTransform->memoryTypes + i));
+    }
+    for (uint32_t i = 0; i < (uint32_t)VK_MAX_MEMORY_HEAPS; ++i) {
+        transform_tohost_VkMemoryHeap(resourceTracker,
+                                      (VkMemoryHeap*)(toTransform->memoryHeaps + i));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceMemoryProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMemoryProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    for (uint32_t i = 0; i < (uint32_t)VK_MAX_MEMORY_TYPES; ++i) {
+        transform_fromhost_VkMemoryType(resourceTracker,
+                                        (VkMemoryType*)(toTransform->memoryTypes + i));
+    }
+    for (uint32_t i = 0; i < (uint32_t)VK_MAX_MEMORY_HEAPS; ++i) {
+        transform_fromhost_VkMemoryHeap(resourceTracker,
+                                        (VkMemoryHeap*)(toTransform->memoryHeaps + i));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceSparseProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSparseProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkPhysicalDeviceSparseProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSparseProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkPhysicalDeviceProperties(ResourceTracker* resourceTracker,
+                                                 VkPhysicalDeviceProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkPhysicalDeviceLimits(resourceTracker,
+                                            (VkPhysicalDeviceLimits*)(&toTransform->limits));
+    transform_tohost_VkPhysicalDeviceSparseProperties(
+        resourceTracker, (VkPhysicalDeviceSparseProperties*)(&toTransform->sparseProperties));
+}
+
+void transform_fromhost_VkPhysicalDeviceProperties(ResourceTracker* resourceTracker,
+                                                   VkPhysicalDeviceProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkPhysicalDeviceLimits(resourceTracker,
+                                              (VkPhysicalDeviceLimits*)(&toTransform->limits));
+    transform_fromhost_VkPhysicalDeviceSparseProperties(
+        resourceTracker, (VkPhysicalDeviceSparseProperties*)(&toTransform->sparseProperties));
+}
+
+void transform_tohost_VkQueueFamilyProperties(ResourceTracker* resourceTracker,
+                                              VkQueueFamilyProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkExtent3D(resourceTracker,
+                                (VkExtent3D*)(&toTransform->minImageTransferGranularity));
+}
+
+void transform_fromhost_VkQueueFamilyProperties(ResourceTracker* resourceTracker,
+                                                VkQueueFamilyProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkExtent3D(resourceTracker,
+                                  (VkExtent3D*)(&toTransform->minImageTransferGranularity));
+}
+
+void transform_tohost_VkDeviceQueueCreateInfo(ResourceTracker* resourceTracker,
+                                              VkDeviceQueueCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDeviceQueueCreateInfo(ResourceTracker* resourceTracker,
+                                                VkDeviceQueueCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDeviceCreateInfo(ResourceTracker* resourceTracker,
+                                         VkDeviceCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pQueueCreateInfos) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->queueCreateInfoCount; ++i) {
+                transform_tohost_VkDeviceQueueCreateInfo(
+                    resourceTracker,
+                    (VkDeviceQueueCreateInfo*)(toTransform->pQueueCreateInfos + i));
+            }
+        }
+    }
+    if (toTransform->pEnabledFeatures) {
+        transform_tohost_VkPhysicalDeviceFeatures(
+            resourceTracker, (VkPhysicalDeviceFeatures*)(toTransform->pEnabledFeatures));
+    }
+}
+
+void transform_fromhost_VkDeviceCreateInfo(ResourceTracker* resourceTracker,
+                                           VkDeviceCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pQueueCreateInfos) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->queueCreateInfoCount; ++i) {
+                transform_fromhost_VkDeviceQueueCreateInfo(
+                    resourceTracker,
+                    (VkDeviceQueueCreateInfo*)(toTransform->pQueueCreateInfos + i));
+            }
+        }
+    }
+    if (toTransform->pEnabledFeatures) {
+        transform_fromhost_VkPhysicalDeviceFeatures(
+            resourceTracker, (VkPhysicalDeviceFeatures*)(toTransform->pEnabledFeatures));
+    }
+}
+
+void transform_tohost_VkExtensionProperties(ResourceTracker* resourceTracker,
+                                            VkExtensionProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkExtensionProperties(ResourceTracker* resourceTracker,
+                                              VkExtensionProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkLayerProperties(ResourceTracker* resourceTracker,
+                                        VkLayerProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkLayerProperties(ResourceTracker* resourceTracker,
+                                          VkLayerProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkSubmitInfo(ResourceTracker* resourceTracker, VkSubmitInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkSubmitInfo(ResourceTracker* resourceTracker, VkSubmitInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkMappedMemoryRange(ResourceTracker* resourceTracker,
+                                          VkMappedMemoryRange* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_tohost(
+        (VkDeviceMemory*)&toTransform->memory, 1, (VkDeviceSize*)&toTransform->offset, 1,
+        (VkDeviceSize*)&toTransform->size, 1, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0);
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkMappedMemoryRange(ResourceTracker* resourceTracker,
+                                            VkMappedMemoryRange* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_fromhost(
+        (VkDeviceMemory*)&toTransform->memory, 1, (VkDeviceSize*)&toTransform->offset, 1,
+        (VkDeviceSize*)&toTransform->size, 1, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0);
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkMemoryAllocateInfo(ResourceTracker* resourceTracker,
+                                           VkMemoryAllocateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_tohost(
+        (VkDeviceMemory*)nullptr, 0, (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr, 0,
+        (uint32_t*)&toTransform->memoryTypeIndex, 1, (uint32_t*)nullptr, 0);
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkMemoryAllocateInfo(ResourceTracker* resourceTracker,
+                                             VkMemoryAllocateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_fromhost(
+        (VkDeviceMemory*)nullptr, 0, (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr, 0,
+        (uint32_t*)&toTransform->memoryTypeIndex, 1, (uint32_t*)nullptr, 0);
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkMemoryRequirements(ResourceTracker* resourceTracker,
+                                           VkMemoryRequirements* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_tohost(
+        (VkDeviceMemory*)nullptr, 0, (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr, 0,
+        (uint32_t*)nullptr, 0, (uint32_t*)&toTransform->memoryTypeBits, 1);
+}
+
+void transform_fromhost_VkMemoryRequirements(ResourceTracker* resourceTracker,
+                                             VkMemoryRequirements* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_fromhost(
+        (VkDeviceMemory*)nullptr, 0, (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr, 0,
+        (uint32_t*)nullptr, 0, (uint32_t*)&toTransform->memoryTypeBits, 1);
+}
+
+void transform_tohost_VkSparseMemoryBind(ResourceTracker* resourceTracker,
+                                         VkSparseMemoryBind* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_tohost(
+        (VkDeviceMemory*)&toTransform->memory, 1, (VkDeviceSize*)&toTransform->memoryOffset, 1,
+        (VkDeviceSize*)nullptr, 0, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0);
+}
+
+void transform_fromhost_VkSparseMemoryBind(ResourceTracker* resourceTracker,
+                                           VkSparseMemoryBind* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_fromhost(
+        (VkDeviceMemory*)&toTransform->memory, 1, (VkDeviceSize*)&toTransform->memoryOffset, 1,
+        (VkDeviceSize*)nullptr, 0, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0);
+}
+
+void transform_tohost_VkSparseBufferMemoryBindInfo(ResourceTracker* resourceTracker,
+                                                   VkSparseBufferMemoryBindInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform) {
+        if (toTransform->pBinds) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->bindCount; ++i) {
+                transform_tohost_VkSparseMemoryBind(resourceTracker,
+                                                    (VkSparseMemoryBind*)(toTransform->pBinds + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkSparseBufferMemoryBindInfo(ResourceTracker* resourceTracker,
+                                                     VkSparseBufferMemoryBindInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform) {
+        if (toTransform->pBinds) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->bindCount; ++i) {
+                transform_fromhost_VkSparseMemoryBind(
+                    resourceTracker, (VkSparseMemoryBind*)(toTransform->pBinds + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkSparseImageOpaqueMemoryBindInfo(
+    ResourceTracker* resourceTracker, VkSparseImageOpaqueMemoryBindInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform) {
+        if (toTransform->pBinds) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->bindCount; ++i) {
+                transform_tohost_VkSparseMemoryBind(resourceTracker,
+                                                    (VkSparseMemoryBind*)(toTransform->pBinds + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkSparseImageOpaqueMemoryBindInfo(
+    ResourceTracker* resourceTracker, VkSparseImageOpaqueMemoryBindInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform) {
+        if (toTransform->pBinds) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->bindCount; ++i) {
+                transform_fromhost_VkSparseMemoryBind(
+                    resourceTracker, (VkSparseMemoryBind*)(toTransform->pBinds + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkImageSubresource(ResourceTracker* resourceTracker,
+                                         VkImageSubresource* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkImageSubresource(ResourceTracker* resourceTracker,
+                                           VkImageSubresource* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkSparseImageMemoryBind(ResourceTracker* resourceTracker,
+                                              VkSparseImageMemoryBind* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_tohost(
+        (VkDeviceMemory*)&toTransform->memory, 1, (VkDeviceSize*)&toTransform->memoryOffset, 1,
+        (VkDeviceSize*)nullptr, 0, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0);
+    transform_tohost_VkImageSubresource(resourceTracker,
+                                        (VkImageSubresource*)(&toTransform->subresource));
+    transform_tohost_VkOffset3D(resourceTracker, (VkOffset3D*)(&toTransform->offset));
+    transform_tohost_VkExtent3D(resourceTracker, (VkExtent3D*)(&toTransform->extent));
+}
+
+void transform_fromhost_VkSparseImageMemoryBind(ResourceTracker* resourceTracker,
+                                                VkSparseImageMemoryBind* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_fromhost(
+        (VkDeviceMemory*)&toTransform->memory, 1, (VkDeviceSize*)&toTransform->memoryOffset, 1,
+        (VkDeviceSize*)nullptr, 0, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0);
+    transform_fromhost_VkImageSubresource(resourceTracker,
+                                          (VkImageSubresource*)(&toTransform->subresource));
+    transform_fromhost_VkOffset3D(resourceTracker, (VkOffset3D*)(&toTransform->offset));
+    transform_fromhost_VkExtent3D(resourceTracker, (VkExtent3D*)(&toTransform->extent));
+}
+
+void transform_tohost_VkSparseImageMemoryBindInfo(ResourceTracker* resourceTracker,
+                                                  VkSparseImageMemoryBindInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform) {
+        if (toTransform->pBinds) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->bindCount; ++i) {
+                transform_tohost_VkSparseImageMemoryBind(
+                    resourceTracker, (VkSparseImageMemoryBind*)(toTransform->pBinds + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkSparseImageMemoryBindInfo(ResourceTracker* resourceTracker,
+                                                    VkSparseImageMemoryBindInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform) {
+        if (toTransform->pBinds) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->bindCount; ++i) {
+                transform_fromhost_VkSparseImageMemoryBind(
+                    resourceTracker, (VkSparseImageMemoryBind*)(toTransform->pBinds + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkBindSparseInfo(ResourceTracker* resourceTracker,
+                                       VkBindSparseInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pBufferBinds) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->bufferBindCount; ++i) {
+                transform_tohost_VkSparseBufferMemoryBindInfo(
+                    resourceTracker,
+                    (VkSparseBufferMemoryBindInfo*)(toTransform->pBufferBinds + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pImageOpaqueBinds) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->imageOpaqueBindCount; ++i) {
+                transform_tohost_VkSparseImageOpaqueMemoryBindInfo(
+                    resourceTracker,
+                    (VkSparseImageOpaqueMemoryBindInfo*)(toTransform->pImageOpaqueBinds + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pImageBinds) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->imageBindCount; ++i) {
+                transform_tohost_VkSparseImageMemoryBindInfo(
+                    resourceTracker, (VkSparseImageMemoryBindInfo*)(toTransform->pImageBinds + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkBindSparseInfo(ResourceTracker* resourceTracker,
+                                         VkBindSparseInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pBufferBinds) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->bufferBindCount; ++i) {
+                transform_fromhost_VkSparseBufferMemoryBindInfo(
+                    resourceTracker,
+                    (VkSparseBufferMemoryBindInfo*)(toTransform->pBufferBinds + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pImageOpaqueBinds) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->imageOpaqueBindCount; ++i) {
+                transform_fromhost_VkSparseImageOpaqueMemoryBindInfo(
+                    resourceTracker,
+                    (VkSparseImageOpaqueMemoryBindInfo*)(toTransform->pImageOpaqueBinds + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pImageBinds) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->imageBindCount; ++i) {
+                transform_fromhost_VkSparseImageMemoryBindInfo(
+                    resourceTracker, (VkSparseImageMemoryBindInfo*)(toTransform->pImageBinds + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkSparseImageFormatProperties(ResourceTracker* resourceTracker,
+                                                    VkSparseImageFormatProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkExtent3D(resourceTracker, (VkExtent3D*)(&toTransform->imageGranularity));
+}
+
+void transform_fromhost_VkSparseImageFormatProperties(ResourceTracker* resourceTracker,
+                                                      VkSparseImageFormatProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkExtent3D(resourceTracker, (VkExtent3D*)(&toTransform->imageGranularity));
+}
+
+void transform_tohost_VkSparseImageMemoryRequirements(
+    ResourceTracker* resourceTracker, VkSparseImageMemoryRequirements* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkSparseImageFormatProperties(
+        resourceTracker, (VkSparseImageFormatProperties*)(&toTransform->formatProperties));
+}
+
+void transform_fromhost_VkSparseImageMemoryRequirements(
+    ResourceTracker* resourceTracker, VkSparseImageMemoryRequirements* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkSparseImageFormatProperties(
+        resourceTracker, (VkSparseImageFormatProperties*)(&toTransform->formatProperties));
+}
+
+void transform_tohost_VkFenceCreateInfo(ResourceTracker* resourceTracker,
+                                        VkFenceCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkFenceCreateInfo(ResourceTracker* resourceTracker,
+                                          VkFenceCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkSemaphoreCreateInfo(ResourceTracker* resourceTracker,
+                                            VkSemaphoreCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkSemaphoreCreateInfo(ResourceTracker* resourceTracker,
+                                              VkSemaphoreCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkEventCreateInfo(ResourceTracker* resourceTracker,
+                                        VkEventCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkEventCreateInfo(ResourceTracker* resourceTracker,
+                                          VkEventCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkQueryPoolCreateInfo(ResourceTracker* resourceTracker,
+                                            VkQueryPoolCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkQueryPoolCreateInfo(ResourceTracker* resourceTracker,
+                                              VkQueryPoolCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkBufferCreateInfo(ResourceTracker* resourceTracker,
+                                         VkBufferCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkBufferCreateInfo(ResourceTracker* resourceTracker,
+                                           VkBufferCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkBufferViewCreateInfo(ResourceTracker* resourceTracker,
+                                             VkBufferViewCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkBufferViewCreateInfo(ResourceTracker* resourceTracker,
+                                               VkBufferViewCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkImageCreateInfo(ResourceTracker* resourceTracker,
+                                        VkImageCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkExtent3D(resourceTracker, (VkExtent3D*)(&toTransform->extent));
+}
+
+void transform_fromhost_VkImageCreateInfo(ResourceTracker* resourceTracker,
+                                          VkImageCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkExtent3D(resourceTracker, (VkExtent3D*)(&toTransform->extent));
+}
+
+void transform_tohost_VkSubresourceLayout(ResourceTracker* resourceTracker,
+                                          VkSubresourceLayout* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkSubresourceLayout(ResourceTracker* resourceTracker,
+                                            VkSubresourceLayout* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkComponentMapping(ResourceTracker* resourceTracker,
+                                         VkComponentMapping* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkComponentMapping(ResourceTracker* resourceTracker,
+                                           VkComponentMapping* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkImageViewCreateInfo(ResourceTracker* resourceTracker,
+                                            VkImageViewCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkComponentMapping(resourceTracker,
+                                        (VkComponentMapping*)(&toTransform->components));
+    transform_tohost_VkImageSubresourceRange(
+        resourceTracker, (VkImageSubresourceRange*)(&toTransform->subresourceRange));
+}
+
+void transform_fromhost_VkImageViewCreateInfo(ResourceTracker* resourceTracker,
+                                              VkImageViewCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkComponentMapping(resourceTracker,
+                                          (VkComponentMapping*)(&toTransform->components));
+    transform_fromhost_VkImageSubresourceRange(
+        resourceTracker, (VkImageSubresourceRange*)(&toTransform->subresourceRange));
+}
+
+void transform_tohost_VkShaderModuleCreateInfo(ResourceTracker* resourceTracker,
+                                               VkShaderModuleCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkShaderModuleCreateInfo(ResourceTracker* resourceTracker,
+                                                 VkShaderModuleCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPipelineCacheCreateInfo(ResourceTracker* resourceTracker,
+                                                VkPipelineCacheCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPipelineCacheCreateInfo(ResourceTracker* resourceTracker,
+                                                  VkPipelineCacheCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkSpecializationMapEntry(ResourceTracker* resourceTracker,
+                                               VkSpecializationMapEntry* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkSpecializationMapEntry(ResourceTracker* resourceTracker,
+                                                 VkSpecializationMapEntry* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkSpecializationInfo(ResourceTracker* resourceTracker,
+                                           VkSpecializationInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform) {
+        if (toTransform->pMapEntries) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->mapEntryCount; ++i) {
+                transform_tohost_VkSpecializationMapEntry(
+                    resourceTracker, (VkSpecializationMapEntry*)(toTransform->pMapEntries + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkSpecializationInfo(ResourceTracker* resourceTracker,
+                                             VkSpecializationInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform) {
+        if (toTransform->pMapEntries) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->mapEntryCount; ++i) {
+                transform_fromhost_VkSpecializationMapEntry(
+                    resourceTracker, (VkSpecializationMapEntry*)(toTransform->pMapEntries + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkPipelineShaderStageCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineShaderStageCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pSpecializationInfo) {
+        transform_tohost_VkSpecializationInfo(
+            resourceTracker, (VkSpecializationInfo*)(toTransform->pSpecializationInfo));
+    }
+}
+
+void transform_fromhost_VkPipelineShaderStageCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineShaderStageCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pSpecializationInfo) {
+        transform_fromhost_VkSpecializationInfo(
+            resourceTracker, (VkSpecializationInfo*)(toTransform->pSpecializationInfo));
+    }
+}
+
+void transform_tohost_VkComputePipelineCreateInfo(ResourceTracker* resourceTracker,
+                                                  VkComputePipelineCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkPipelineShaderStageCreateInfo(
+        resourceTracker, (VkPipelineShaderStageCreateInfo*)(&toTransform->stage));
+}
+
+void transform_fromhost_VkComputePipelineCreateInfo(ResourceTracker* resourceTracker,
+                                                    VkComputePipelineCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkPipelineShaderStageCreateInfo(
+        resourceTracker, (VkPipelineShaderStageCreateInfo*)(&toTransform->stage));
+}
+
+void transform_tohost_VkVertexInputBindingDescription(
+    ResourceTracker* resourceTracker, VkVertexInputBindingDescription* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkVertexInputBindingDescription(
+    ResourceTracker* resourceTracker, VkVertexInputBindingDescription* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkVertexInputAttributeDescription(
+    ResourceTracker* resourceTracker, VkVertexInputAttributeDescription* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkVertexInputAttributeDescription(
+    ResourceTracker* resourceTracker, VkVertexInputAttributeDescription* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkPipelineVertexInputStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineVertexInputStateCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pVertexBindingDescriptions) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->vertexBindingDescriptionCount; ++i) {
+                transform_tohost_VkVertexInputBindingDescription(
+                    resourceTracker,
+                    (VkVertexInputBindingDescription*)(toTransform->pVertexBindingDescriptions +
+                                                       i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pVertexAttributeDescriptions) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->vertexAttributeDescriptionCount; ++i) {
+                transform_tohost_VkVertexInputAttributeDescription(
+                    resourceTracker,
+                    (VkVertexInputAttributeDescription*)(toTransform->pVertexAttributeDescriptions +
+                                                         i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkPipelineVertexInputStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineVertexInputStateCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pVertexBindingDescriptions) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->vertexBindingDescriptionCount; ++i) {
+                transform_fromhost_VkVertexInputBindingDescription(
+                    resourceTracker,
+                    (VkVertexInputBindingDescription*)(toTransform->pVertexBindingDescriptions +
+                                                       i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pVertexAttributeDescriptions) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->vertexAttributeDescriptionCount; ++i) {
+                transform_fromhost_VkVertexInputAttributeDescription(
+                    resourceTracker,
+                    (VkVertexInputAttributeDescription*)(toTransform->pVertexAttributeDescriptions +
+                                                         i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkPipelineInputAssemblyStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineInputAssemblyStateCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPipelineInputAssemblyStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineInputAssemblyStateCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPipelineTessellationStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineTessellationStateCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPipelineTessellationStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineTessellationStateCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkViewport(ResourceTracker* resourceTracker, VkViewport* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkViewport(ResourceTracker* resourceTracker, VkViewport* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkPipelineViewportStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineViewportStateCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pViewports) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->viewportCount; ++i) {
+                transform_tohost_VkViewport(resourceTracker,
+                                            (VkViewport*)(toTransform->pViewports + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pScissors) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->scissorCount; ++i) {
+                transform_tohost_VkRect2D(resourceTracker, (VkRect2D*)(toTransform->pScissors + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkPipelineViewportStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineViewportStateCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pViewports) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->viewportCount; ++i) {
+                transform_fromhost_VkViewport(resourceTracker,
+                                              (VkViewport*)(toTransform->pViewports + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pScissors) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->scissorCount; ++i) {
+                transform_fromhost_VkRect2D(resourceTracker,
+                                            (VkRect2D*)(toTransform->pScissors + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkPipelineRasterizationStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineRasterizationStateCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPipelineRasterizationStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineRasterizationStateCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPipelineMultisampleStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineMultisampleStateCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPipelineMultisampleStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineMultisampleStateCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkStencilOpState(ResourceTracker* resourceTracker,
+                                       VkStencilOpState* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkStencilOpState(ResourceTracker* resourceTracker,
+                                         VkStencilOpState* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkPipelineDepthStencilStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineDepthStencilStateCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkStencilOpState(resourceTracker, (VkStencilOpState*)(&toTransform->front));
+    transform_tohost_VkStencilOpState(resourceTracker, (VkStencilOpState*)(&toTransform->back));
+}
+
+void transform_fromhost_VkPipelineDepthStencilStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineDepthStencilStateCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkStencilOpState(resourceTracker, (VkStencilOpState*)(&toTransform->front));
+    transform_fromhost_VkStencilOpState(resourceTracker, (VkStencilOpState*)(&toTransform->back));
+}
+
+void transform_tohost_VkPipelineColorBlendAttachmentState(
+    ResourceTracker* resourceTracker, VkPipelineColorBlendAttachmentState* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkPipelineColorBlendAttachmentState(
+    ResourceTracker* resourceTracker, VkPipelineColorBlendAttachmentState* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkPipelineColorBlendStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineColorBlendStateCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->attachmentCount; ++i) {
+                transform_tohost_VkPipelineColorBlendAttachmentState(
+                    resourceTracker,
+                    (VkPipelineColorBlendAttachmentState*)(toTransform->pAttachments + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkPipelineColorBlendStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineColorBlendStateCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->attachmentCount; ++i) {
+                transform_fromhost_VkPipelineColorBlendAttachmentState(
+                    resourceTracker,
+                    (VkPipelineColorBlendAttachmentState*)(toTransform->pAttachments + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkPipelineDynamicStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineDynamicStateCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPipelineDynamicStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineDynamicStateCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkGraphicsPipelineCreateInfo(ResourceTracker* resourceTracker,
+                                                   VkGraphicsPipelineCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pStages) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->stageCount; ++i) {
+                transform_tohost_VkPipelineShaderStageCreateInfo(
+                    resourceTracker, (VkPipelineShaderStageCreateInfo*)(toTransform->pStages + i));
+            }
+        }
+    }
+    if (toTransform->pVertexInputState) {
+        transform_tohost_VkPipelineVertexInputStateCreateInfo(
+            resourceTracker,
+            (VkPipelineVertexInputStateCreateInfo*)(toTransform->pVertexInputState));
+    }
+    if (toTransform->pInputAssemblyState) {
+        transform_tohost_VkPipelineInputAssemblyStateCreateInfo(
+            resourceTracker,
+            (VkPipelineInputAssemblyStateCreateInfo*)(toTransform->pInputAssemblyState));
+    }
+    if (toTransform->pTessellationState) {
+        transform_tohost_VkPipelineTessellationStateCreateInfo(
+            resourceTracker,
+            (VkPipelineTessellationStateCreateInfo*)(toTransform->pTessellationState));
+    }
+    if (toTransform->pViewportState) {
+        transform_tohost_VkPipelineViewportStateCreateInfo(
+            resourceTracker, (VkPipelineViewportStateCreateInfo*)(toTransform->pViewportState));
+    }
+    if (toTransform->pRasterizationState) {
+        transform_tohost_VkPipelineRasterizationStateCreateInfo(
+            resourceTracker,
+            (VkPipelineRasterizationStateCreateInfo*)(toTransform->pRasterizationState));
+    }
+    if (toTransform->pMultisampleState) {
+        transform_tohost_VkPipelineMultisampleStateCreateInfo(
+            resourceTracker,
+            (VkPipelineMultisampleStateCreateInfo*)(toTransform->pMultisampleState));
+    }
+    if (toTransform->pDepthStencilState) {
+        transform_tohost_VkPipelineDepthStencilStateCreateInfo(
+            resourceTracker,
+            (VkPipelineDepthStencilStateCreateInfo*)(toTransform->pDepthStencilState));
+    }
+    if (toTransform->pColorBlendState) {
+        transform_tohost_VkPipelineColorBlendStateCreateInfo(
+            resourceTracker, (VkPipelineColorBlendStateCreateInfo*)(toTransform->pColorBlendState));
+    }
+    if (toTransform->pDynamicState) {
+        transform_tohost_VkPipelineDynamicStateCreateInfo(
+            resourceTracker, (VkPipelineDynamicStateCreateInfo*)(toTransform->pDynamicState));
+    }
+}
+
+void transform_fromhost_VkGraphicsPipelineCreateInfo(ResourceTracker* resourceTracker,
+                                                     VkGraphicsPipelineCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pStages) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->stageCount; ++i) {
+                transform_fromhost_VkPipelineShaderStageCreateInfo(
+                    resourceTracker, (VkPipelineShaderStageCreateInfo*)(toTransform->pStages + i));
+            }
+        }
+    }
+    if (toTransform->pVertexInputState) {
+        transform_fromhost_VkPipelineVertexInputStateCreateInfo(
+            resourceTracker,
+            (VkPipelineVertexInputStateCreateInfo*)(toTransform->pVertexInputState));
+    }
+    if (toTransform->pInputAssemblyState) {
+        transform_fromhost_VkPipelineInputAssemblyStateCreateInfo(
+            resourceTracker,
+            (VkPipelineInputAssemblyStateCreateInfo*)(toTransform->pInputAssemblyState));
+    }
+    if (toTransform->pTessellationState) {
+        transform_fromhost_VkPipelineTessellationStateCreateInfo(
+            resourceTracker,
+            (VkPipelineTessellationStateCreateInfo*)(toTransform->pTessellationState));
+    }
+    if (toTransform->pViewportState) {
+        transform_fromhost_VkPipelineViewportStateCreateInfo(
+            resourceTracker, (VkPipelineViewportStateCreateInfo*)(toTransform->pViewportState));
+    }
+    if (toTransform->pRasterizationState) {
+        transform_fromhost_VkPipelineRasterizationStateCreateInfo(
+            resourceTracker,
+            (VkPipelineRasterizationStateCreateInfo*)(toTransform->pRasterizationState));
+    }
+    if (toTransform->pMultisampleState) {
+        transform_fromhost_VkPipelineMultisampleStateCreateInfo(
+            resourceTracker,
+            (VkPipelineMultisampleStateCreateInfo*)(toTransform->pMultisampleState));
+    }
+    if (toTransform->pDepthStencilState) {
+        transform_fromhost_VkPipelineDepthStencilStateCreateInfo(
+            resourceTracker,
+            (VkPipelineDepthStencilStateCreateInfo*)(toTransform->pDepthStencilState));
+    }
+    if (toTransform->pColorBlendState) {
+        transform_fromhost_VkPipelineColorBlendStateCreateInfo(
+            resourceTracker, (VkPipelineColorBlendStateCreateInfo*)(toTransform->pColorBlendState));
+    }
+    if (toTransform->pDynamicState) {
+        transform_fromhost_VkPipelineDynamicStateCreateInfo(
+            resourceTracker, (VkPipelineDynamicStateCreateInfo*)(toTransform->pDynamicState));
+    }
+}
+
+void transform_tohost_VkPushConstantRange(ResourceTracker* resourceTracker,
+                                          VkPushConstantRange* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkPushConstantRange(ResourceTracker* resourceTracker,
+                                            VkPushConstantRange* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkPipelineLayoutCreateInfo(ResourceTracker* resourceTracker,
+                                                 VkPipelineLayoutCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pPushConstantRanges) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->pushConstantRangeCount; ++i) {
+                transform_tohost_VkPushConstantRange(
+                    resourceTracker, (VkPushConstantRange*)(toTransform->pPushConstantRanges + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkPipelineLayoutCreateInfo(ResourceTracker* resourceTracker,
+                                                   VkPipelineLayoutCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pPushConstantRanges) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->pushConstantRangeCount; ++i) {
+                transform_fromhost_VkPushConstantRange(
+                    resourceTracker, (VkPushConstantRange*)(toTransform->pPushConstantRanges + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkSamplerCreateInfo(ResourceTracker* resourceTracker,
+                                          VkSamplerCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkSamplerCreateInfo(ResourceTracker* resourceTracker,
+                                            VkSamplerCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkCopyDescriptorSet(ResourceTracker* resourceTracker,
+                                          VkCopyDescriptorSet* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkCopyDescriptorSet(ResourceTracker* resourceTracker,
+                                            VkCopyDescriptorSet* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDescriptorBufferInfo(ResourceTracker* resourceTracker,
+                                             VkDescriptorBufferInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkDescriptorBufferInfo(ResourceTracker* resourceTracker,
+                                               VkDescriptorBufferInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkDescriptorImageInfo(ResourceTracker* resourceTracker,
+                                            VkDescriptorImageInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkDescriptorImageInfo(ResourceTracker* resourceTracker,
+                                              VkDescriptorImageInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkDescriptorPoolSize(ResourceTracker* resourceTracker,
+                                           VkDescriptorPoolSize* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkDescriptorPoolSize(ResourceTracker* resourceTracker,
+                                             VkDescriptorPoolSize* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkDescriptorPoolCreateInfo(ResourceTracker* resourceTracker,
+                                                 VkDescriptorPoolCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pPoolSizes) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->poolSizeCount; ++i) {
+                transform_tohost_VkDescriptorPoolSize(
+                    resourceTracker, (VkDescriptorPoolSize*)(toTransform->pPoolSizes + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkDescriptorPoolCreateInfo(ResourceTracker* resourceTracker,
+                                                   VkDescriptorPoolCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pPoolSizes) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->poolSizeCount; ++i) {
+                transform_fromhost_VkDescriptorPoolSize(
+                    resourceTracker, (VkDescriptorPoolSize*)(toTransform->pPoolSizes + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkDescriptorSetAllocateInfo(ResourceTracker* resourceTracker,
+                                                  VkDescriptorSetAllocateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDescriptorSetAllocateInfo(ResourceTracker* resourceTracker,
+                                                    VkDescriptorSetAllocateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDescriptorSetLayoutBinding(ResourceTracker* resourceTracker,
+                                                   VkDescriptorSetLayoutBinding* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkDescriptorSetLayoutBinding(ResourceTracker* resourceTracker,
+                                                     VkDescriptorSetLayoutBinding* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkDescriptorSetLayoutCreateInfo(
+    ResourceTracker* resourceTracker, VkDescriptorSetLayoutCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pBindings) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->bindingCount; ++i) {
+                transform_tohost_VkDescriptorSetLayoutBinding(
+                    resourceTracker, (VkDescriptorSetLayoutBinding*)(toTransform->pBindings + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkDescriptorSetLayoutCreateInfo(
+    ResourceTracker* resourceTracker, VkDescriptorSetLayoutCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pBindings) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->bindingCount; ++i) {
+                transform_fromhost_VkDescriptorSetLayoutBinding(
+                    resourceTracker, (VkDescriptorSetLayoutBinding*)(toTransform->pBindings + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkWriteDescriptorSet(ResourceTracker* resourceTracker,
+                                           VkWriteDescriptorSet* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pImageInfo) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->descriptorCount; ++i) {
+                transform_tohost_VkDescriptorImageInfo(
+                    resourceTracker, (VkDescriptorImageInfo*)(toTransform->pImageInfo + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pBufferInfo) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->descriptorCount; ++i) {
+                transform_tohost_VkDescriptorBufferInfo(
+                    resourceTracker, (VkDescriptorBufferInfo*)(toTransform->pBufferInfo + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkWriteDescriptorSet(ResourceTracker* resourceTracker,
+                                             VkWriteDescriptorSet* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pImageInfo) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->descriptorCount; ++i) {
+                transform_fromhost_VkDescriptorImageInfo(
+                    resourceTracker, (VkDescriptorImageInfo*)(toTransform->pImageInfo + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pBufferInfo) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->descriptorCount; ++i) {
+                transform_fromhost_VkDescriptorBufferInfo(
+                    resourceTracker, (VkDescriptorBufferInfo*)(toTransform->pBufferInfo + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkAttachmentDescription(ResourceTracker* resourceTracker,
+                                              VkAttachmentDescription* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkAttachmentDescription(ResourceTracker* resourceTracker,
+                                                VkAttachmentDescription* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkAttachmentReference(ResourceTracker* resourceTracker,
+                                            VkAttachmentReference* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkAttachmentReference(ResourceTracker* resourceTracker,
+                                              VkAttachmentReference* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkFramebufferCreateInfo(ResourceTracker* resourceTracker,
+                                              VkFramebufferCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkFramebufferCreateInfo(ResourceTracker* resourceTracker,
+                                                VkFramebufferCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkSubpassDescription(ResourceTracker* resourceTracker,
+                                           VkSubpassDescription* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform) {
+        if (toTransform->pInputAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->inputAttachmentCount; ++i) {
+                transform_tohost_VkAttachmentReference(
+                    resourceTracker, (VkAttachmentReference*)(toTransform->pInputAttachments + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pColorAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->colorAttachmentCount; ++i) {
+                transform_tohost_VkAttachmentReference(
+                    resourceTracker, (VkAttachmentReference*)(toTransform->pColorAttachments + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pResolveAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->colorAttachmentCount; ++i) {
+                transform_tohost_VkAttachmentReference(
+                    resourceTracker,
+                    (VkAttachmentReference*)(toTransform->pResolveAttachments + i));
+            }
+        }
+    }
+    if (toTransform->pDepthStencilAttachment) {
+        transform_tohost_VkAttachmentReference(
+            resourceTracker, (VkAttachmentReference*)(toTransform->pDepthStencilAttachment));
+    }
+}
+
+void transform_fromhost_VkSubpassDescription(ResourceTracker* resourceTracker,
+                                             VkSubpassDescription* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform) {
+        if (toTransform->pInputAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->inputAttachmentCount; ++i) {
+                transform_fromhost_VkAttachmentReference(
+                    resourceTracker, (VkAttachmentReference*)(toTransform->pInputAttachments + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pColorAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->colorAttachmentCount; ++i) {
+                transform_fromhost_VkAttachmentReference(
+                    resourceTracker, (VkAttachmentReference*)(toTransform->pColorAttachments + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pResolveAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->colorAttachmentCount; ++i) {
+                transform_fromhost_VkAttachmentReference(
+                    resourceTracker,
+                    (VkAttachmentReference*)(toTransform->pResolveAttachments + i));
+            }
+        }
+    }
+    if (toTransform->pDepthStencilAttachment) {
+        transform_fromhost_VkAttachmentReference(
+            resourceTracker, (VkAttachmentReference*)(toTransform->pDepthStencilAttachment));
+    }
+}
+
+void transform_tohost_VkSubpassDependency(ResourceTracker* resourceTracker,
+                                          VkSubpassDependency* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkSubpassDependency(ResourceTracker* resourceTracker,
+                                            VkSubpassDependency* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkRenderPassCreateInfo(ResourceTracker* resourceTracker,
+                                             VkRenderPassCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->attachmentCount; ++i) {
+                transform_tohost_VkAttachmentDescription(
+                    resourceTracker, (VkAttachmentDescription*)(toTransform->pAttachments + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pSubpasses) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->subpassCount; ++i) {
+                transform_tohost_VkSubpassDescription(
+                    resourceTracker, (VkSubpassDescription*)(toTransform->pSubpasses + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pDependencies) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->dependencyCount; ++i) {
+                transform_tohost_VkSubpassDependency(
+                    resourceTracker, (VkSubpassDependency*)(toTransform->pDependencies + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkRenderPassCreateInfo(ResourceTracker* resourceTracker,
+                                               VkRenderPassCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->attachmentCount; ++i) {
+                transform_fromhost_VkAttachmentDescription(
+                    resourceTracker, (VkAttachmentDescription*)(toTransform->pAttachments + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pSubpasses) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->subpassCount; ++i) {
+                transform_fromhost_VkSubpassDescription(
+                    resourceTracker, (VkSubpassDescription*)(toTransform->pSubpasses + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pDependencies) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->dependencyCount; ++i) {
+                transform_fromhost_VkSubpassDependency(
+                    resourceTracker, (VkSubpassDependency*)(toTransform->pDependencies + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkCommandPoolCreateInfo(ResourceTracker* resourceTracker,
+                                              VkCommandPoolCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkCommandPoolCreateInfo(ResourceTracker* resourceTracker,
+                                                VkCommandPoolCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkCommandBufferAllocateInfo(ResourceTracker* resourceTracker,
+                                                  VkCommandBufferAllocateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkCommandBufferAllocateInfo(ResourceTracker* resourceTracker,
+                                                    VkCommandBufferAllocateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkCommandBufferInheritanceInfo(ResourceTracker* resourceTracker,
+                                                     VkCommandBufferInheritanceInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkCommandBufferInheritanceInfo(
+    ResourceTracker* resourceTracker, VkCommandBufferInheritanceInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkCommandBufferBeginInfo(ResourceTracker* resourceTracker,
+                                               VkCommandBufferBeginInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pInheritanceInfo) {
+        transform_tohost_VkCommandBufferInheritanceInfo(
+            resourceTracker, (VkCommandBufferInheritanceInfo*)(toTransform->pInheritanceInfo));
+    }
+}
+
+void transform_fromhost_VkCommandBufferBeginInfo(ResourceTracker* resourceTracker,
+                                                 VkCommandBufferBeginInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pInheritanceInfo) {
+        transform_fromhost_VkCommandBufferInheritanceInfo(
+            resourceTracker, (VkCommandBufferInheritanceInfo*)(toTransform->pInheritanceInfo));
+    }
+}
+
+void transform_tohost_VkBufferCopy(ResourceTracker* resourceTracker, VkBufferCopy* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkBufferCopy(ResourceTracker* resourceTracker, VkBufferCopy* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkImageSubresourceLayers(ResourceTracker* resourceTracker,
+                                               VkImageSubresourceLayers* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkImageSubresourceLayers(ResourceTracker* resourceTracker,
+                                                 VkImageSubresourceLayers* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkBufferImageCopy(ResourceTracker* resourceTracker,
+                                        VkBufferImageCopy* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkImageSubresourceLayers(
+        resourceTracker, (VkImageSubresourceLayers*)(&toTransform->imageSubresource));
+    transform_tohost_VkOffset3D(resourceTracker, (VkOffset3D*)(&toTransform->imageOffset));
+    transform_tohost_VkExtent3D(resourceTracker, (VkExtent3D*)(&toTransform->imageExtent));
+}
+
+void transform_fromhost_VkBufferImageCopy(ResourceTracker* resourceTracker,
+                                          VkBufferImageCopy* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkImageSubresourceLayers(
+        resourceTracker, (VkImageSubresourceLayers*)(&toTransform->imageSubresource));
+    transform_fromhost_VkOffset3D(resourceTracker, (VkOffset3D*)(&toTransform->imageOffset));
+    transform_fromhost_VkExtent3D(resourceTracker, (VkExtent3D*)(&toTransform->imageExtent));
+}
+
+void transform_tohost_VkClearColorValue(ResourceTracker* resourceTracker,
+                                        VkClearColorValue* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkClearColorValue(ResourceTracker* resourceTracker,
+                                          VkClearColorValue* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkClearDepthStencilValue(ResourceTracker* resourceTracker,
+                                               VkClearDepthStencilValue* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkClearDepthStencilValue(ResourceTracker* resourceTracker,
+                                                 VkClearDepthStencilValue* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkClearValue(ResourceTracker* resourceTracker, VkClearValue* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkClearColorValue(resourceTracker, (VkClearColorValue*)(&toTransform->color));
+    transform_tohost_VkClearDepthStencilValue(
+        resourceTracker, (VkClearDepthStencilValue*)(&toTransform->depthStencil));
+}
+
+void transform_fromhost_VkClearValue(ResourceTracker* resourceTracker, VkClearValue* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkClearColorValue(resourceTracker,
+                                         (VkClearColorValue*)(&toTransform->color));
+    transform_fromhost_VkClearDepthStencilValue(
+        resourceTracker, (VkClearDepthStencilValue*)(&toTransform->depthStencil));
+}
+
+void transform_tohost_VkClearAttachment(ResourceTracker* resourceTracker,
+                                        VkClearAttachment* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkClearValue(resourceTracker, (VkClearValue*)(&toTransform->clearValue));
+}
+
+void transform_fromhost_VkClearAttachment(ResourceTracker* resourceTracker,
+                                          VkClearAttachment* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkClearValue(resourceTracker, (VkClearValue*)(&toTransform->clearValue));
+}
+
+void transform_tohost_VkClearRect(ResourceTracker* resourceTracker, VkClearRect* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkRect2D(resourceTracker, (VkRect2D*)(&toTransform->rect));
+}
+
+void transform_fromhost_VkClearRect(ResourceTracker* resourceTracker, VkClearRect* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkRect2D(resourceTracker, (VkRect2D*)(&toTransform->rect));
+}
+
+void transform_tohost_VkImageBlit(ResourceTracker* resourceTracker, VkImageBlit* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkImageSubresourceLayers(
+        resourceTracker, (VkImageSubresourceLayers*)(&toTransform->srcSubresource));
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        transform_tohost_VkOffset3D(resourceTracker, (VkOffset3D*)(toTransform->srcOffsets + i));
+    }
+    transform_tohost_VkImageSubresourceLayers(
+        resourceTracker, (VkImageSubresourceLayers*)(&toTransform->dstSubresource));
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        transform_tohost_VkOffset3D(resourceTracker, (VkOffset3D*)(toTransform->dstOffsets + i));
+    }
+}
+
+void transform_fromhost_VkImageBlit(ResourceTracker* resourceTracker, VkImageBlit* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkImageSubresourceLayers(
+        resourceTracker, (VkImageSubresourceLayers*)(&toTransform->srcSubresource));
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        transform_fromhost_VkOffset3D(resourceTracker, (VkOffset3D*)(toTransform->srcOffsets + i));
+    }
+    transform_fromhost_VkImageSubresourceLayers(
+        resourceTracker, (VkImageSubresourceLayers*)(&toTransform->dstSubresource));
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        transform_fromhost_VkOffset3D(resourceTracker, (VkOffset3D*)(toTransform->dstOffsets + i));
+    }
+}
+
+void transform_tohost_VkImageCopy(ResourceTracker* resourceTracker, VkImageCopy* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkImageSubresourceLayers(
+        resourceTracker, (VkImageSubresourceLayers*)(&toTransform->srcSubresource));
+    transform_tohost_VkOffset3D(resourceTracker, (VkOffset3D*)(&toTransform->srcOffset));
+    transform_tohost_VkImageSubresourceLayers(
+        resourceTracker, (VkImageSubresourceLayers*)(&toTransform->dstSubresource));
+    transform_tohost_VkOffset3D(resourceTracker, (VkOffset3D*)(&toTransform->dstOffset));
+    transform_tohost_VkExtent3D(resourceTracker, (VkExtent3D*)(&toTransform->extent));
+}
+
+void transform_fromhost_VkImageCopy(ResourceTracker* resourceTracker, VkImageCopy* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkImageSubresourceLayers(
+        resourceTracker, (VkImageSubresourceLayers*)(&toTransform->srcSubresource));
+    transform_fromhost_VkOffset3D(resourceTracker, (VkOffset3D*)(&toTransform->srcOffset));
+    transform_fromhost_VkImageSubresourceLayers(
+        resourceTracker, (VkImageSubresourceLayers*)(&toTransform->dstSubresource));
+    transform_fromhost_VkOffset3D(resourceTracker, (VkOffset3D*)(&toTransform->dstOffset));
+    transform_fromhost_VkExtent3D(resourceTracker, (VkExtent3D*)(&toTransform->extent));
+}
+
+void transform_tohost_VkImageResolve(ResourceTracker* resourceTracker,
+                                     VkImageResolve* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkImageSubresourceLayers(
+        resourceTracker, (VkImageSubresourceLayers*)(&toTransform->srcSubresource));
+    transform_tohost_VkOffset3D(resourceTracker, (VkOffset3D*)(&toTransform->srcOffset));
+    transform_tohost_VkImageSubresourceLayers(
+        resourceTracker, (VkImageSubresourceLayers*)(&toTransform->dstSubresource));
+    transform_tohost_VkOffset3D(resourceTracker, (VkOffset3D*)(&toTransform->dstOffset));
+    transform_tohost_VkExtent3D(resourceTracker, (VkExtent3D*)(&toTransform->extent));
+}
+
+void transform_fromhost_VkImageResolve(ResourceTracker* resourceTracker,
+                                       VkImageResolve* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkImageSubresourceLayers(
+        resourceTracker, (VkImageSubresourceLayers*)(&toTransform->srcSubresource));
+    transform_fromhost_VkOffset3D(resourceTracker, (VkOffset3D*)(&toTransform->srcOffset));
+    transform_fromhost_VkImageSubresourceLayers(
+        resourceTracker, (VkImageSubresourceLayers*)(&toTransform->dstSubresource));
+    transform_fromhost_VkOffset3D(resourceTracker, (VkOffset3D*)(&toTransform->dstOffset));
+    transform_fromhost_VkExtent3D(resourceTracker, (VkExtent3D*)(&toTransform->extent));
+}
+
+void transform_tohost_VkRenderPassBeginInfo(ResourceTracker* resourceTracker,
+                                            VkRenderPassBeginInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkRect2D(resourceTracker, (VkRect2D*)(&toTransform->renderArea));
+    if (toTransform) {
+        if (toTransform->pClearValues) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->clearValueCount; ++i) {
+                transform_tohost_VkClearValue(resourceTracker,
+                                              (VkClearValue*)(toTransform->pClearValues + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkRenderPassBeginInfo(ResourceTracker* resourceTracker,
+                                              VkRenderPassBeginInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkRect2D(resourceTracker, (VkRect2D*)(&toTransform->renderArea));
+    if (toTransform) {
+        if (toTransform->pClearValues) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->clearValueCount; ++i) {
+                transform_fromhost_VkClearValue(resourceTracker,
+                                                (VkClearValue*)(toTransform->pClearValues + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_VERSION_1_1
+void transform_tohost_VkPhysicalDeviceSubgroupProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSubgroupProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceSubgroupProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSubgroupProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkBindBufferMemoryInfo(ResourceTracker* resourceTracker,
+                                             VkBindBufferMemoryInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_tohost(
+        (VkDeviceMemory*)&toTransform->memory, 1, (VkDeviceSize*)&toTransform->memoryOffset, 1,
+        (VkDeviceSize*)nullptr, 0, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0);
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkBindBufferMemoryInfo(ResourceTracker* resourceTracker,
+                                               VkBindBufferMemoryInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_fromhost(
+        (VkDeviceMemory*)&toTransform->memory, 1, (VkDeviceSize*)&toTransform->memoryOffset, 1,
+        (VkDeviceSize*)nullptr, 0, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0);
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkBindImageMemoryInfo(ResourceTracker* resourceTracker,
+                                            VkBindImageMemoryInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_tohost(
+        (VkDeviceMemory*)&toTransform->memory, 1, (VkDeviceSize*)&toTransform->memoryOffset, 1,
+        (VkDeviceSize*)nullptr, 0, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0);
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkBindImageMemoryInfo(ResourceTracker* resourceTracker,
+                                              VkBindImageMemoryInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_fromhost(
+        (VkDeviceMemory*)&toTransform->memory, 1, (VkDeviceSize*)&toTransform->memoryOffset, 1,
+        (VkDeviceSize*)nullptr, 0, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0);
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDevice16BitStorageFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDevice16BitStorageFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDevice16BitStorageFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDevice16BitStorageFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkMemoryDedicatedRequirements(ResourceTracker* resourceTracker,
+                                                    VkMemoryDedicatedRequirements* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkMemoryDedicatedRequirements(ResourceTracker* resourceTracker,
+                                                      VkMemoryDedicatedRequirements* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkMemoryDedicatedAllocateInfo(ResourceTracker* resourceTracker,
+                                                    VkMemoryDedicatedAllocateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkMemoryDedicatedAllocateInfo(ResourceTracker* resourceTracker,
+                                                      VkMemoryDedicatedAllocateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkMemoryAllocateFlagsInfo(ResourceTracker* resourceTracker,
+                                                VkMemoryAllocateFlagsInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkMemoryAllocateFlagsInfo(ResourceTracker* resourceTracker,
+                                                  VkMemoryAllocateFlagsInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDeviceGroupRenderPassBeginInfo(
+    ResourceTracker* resourceTracker, VkDeviceGroupRenderPassBeginInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pDeviceRenderAreas) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->deviceRenderAreaCount; ++i) {
+                transform_tohost_VkRect2D(resourceTracker,
+                                          (VkRect2D*)(toTransform->pDeviceRenderAreas + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkDeviceGroupRenderPassBeginInfo(
+    ResourceTracker* resourceTracker, VkDeviceGroupRenderPassBeginInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pDeviceRenderAreas) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->deviceRenderAreaCount; ++i) {
+                transform_fromhost_VkRect2D(resourceTracker,
+                                            (VkRect2D*)(toTransform->pDeviceRenderAreas + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkDeviceGroupCommandBufferBeginInfo(
+    ResourceTracker* resourceTracker, VkDeviceGroupCommandBufferBeginInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDeviceGroupCommandBufferBeginInfo(
+    ResourceTracker* resourceTracker, VkDeviceGroupCommandBufferBeginInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDeviceGroupSubmitInfo(ResourceTracker* resourceTracker,
+                                              VkDeviceGroupSubmitInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDeviceGroupSubmitInfo(ResourceTracker* resourceTracker,
+                                                VkDeviceGroupSubmitInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDeviceGroupBindSparseInfo(ResourceTracker* resourceTracker,
+                                                  VkDeviceGroupBindSparseInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDeviceGroupBindSparseInfo(ResourceTracker* resourceTracker,
+                                                    VkDeviceGroupBindSparseInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkBindBufferMemoryDeviceGroupInfo(
+    ResourceTracker* resourceTracker, VkBindBufferMemoryDeviceGroupInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkBindBufferMemoryDeviceGroupInfo(
+    ResourceTracker* resourceTracker, VkBindBufferMemoryDeviceGroupInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkBindImageMemoryDeviceGroupInfo(
+    ResourceTracker* resourceTracker, VkBindImageMemoryDeviceGroupInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pSplitInstanceBindRegions) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->splitInstanceBindRegionCount; ++i) {
+                transform_tohost_VkRect2D(resourceTracker,
+                                          (VkRect2D*)(toTransform->pSplitInstanceBindRegions + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkBindImageMemoryDeviceGroupInfo(
+    ResourceTracker* resourceTracker, VkBindImageMemoryDeviceGroupInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pSplitInstanceBindRegions) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->splitInstanceBindRegionCount; ++i) {
+                transform_fromhost_VkRect2D(
+                    resourceTracker, (VkRect2D*)(toTransform->pSplitInstanceBindRegions + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceGroupProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceGroupProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceGroupProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceGroupProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDeviceGroupDeviceCreateInfo(ResourceTracker* resourceTracker,
+                                                    VkDeviceGroupDeviceCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDeviceGroupDeviceCreateInfo(ResourceTracker* resourceTracker,
+                                                      VkDeviceGroupDeviceCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkBufferMemoryRequirementsInfo2(
+    ResourceTracker* resourceTracker, VkBufferMemoryRequirementsInfo2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkBufferMemoryRequirementsInfo2(
+    ResourceTracker* resourceTracker, VkBufferMemoryRequirementsInfo2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkImageMemoryRequirementsInfo2(ResourceTracker* resourceTracker,
+                                                     VkImageMemoryRequirementsInfo2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkImageMemoryRequirementsInfo2(
+    ResourceTracker* resourceTracker, VkImageMemoryRequirementsInfo2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkImageSparseMemoryRequirementsInfo2(
+    ResourceTracker* resourceTracker, VkImageSparseMemoryRequirementsInfo2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkImageSparseMemoryRequirementsInfo2(
+    ResourceTracker* resourceTracker, VkImageSparseMemoryRequirementsInfo2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkMemoryRequirements2(ResourceTracker* resourceTracker,
+                                            VkMemoryRequirements2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkMemoryRequirements(
+        resourceTracker, (VkMemoryRequirements*)(&toTransform->memoryRequirements));
+}
+
+void transform_fromhost_VkMemoryRequirements2(ResourceTracker* resourceTracker,
+                                              VkMemoryRequirements2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkMemoryRequirements(
+        resourceTracker, (VkMemoryRequirements*)(&toTransform->memoryRequirements));
+}
+
+void transform_tohost_VkSparseImageMemoryRequirements2(
+    ResourceTracker* resourceTracker, VkSparseImageMemoryRequirements2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkSparseImageMemoryRequirements(
+        resourceTracker, (VkSparseImageMemoryRequirements*)(&toTransform->memoryRequirements));
+}
+
+void transform_fromhost_VkSparseImageMemoryRequirements2(
+    ResourceTracker* resourceTracker, VkSparseImageMemoryRequirements2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkSparseImageMemoryRequirements(
+        resourceTracker, (VkSparseImageMemoryRequirements*)(&toTransform->memoryRequirements));
+}
+
+void transform_tohost_VkPhysicalDeviceFeatures2(ResourceTracker* resourceTracker,
+                                                VkPhysicalDeviceFeatures2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkPhysicalDeviceFeatures(resourceTracker,
+                                              (VkPhysicalDeviceFeatures*)(&toTransform->features));
+}
+
+void transform_fromhost_VkPhysicalDeviceFeatures2(ResourceTracker* resourceTracker,
+                                                  VkPhysicalDeviceFeatures2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkPhysicalDeviceFeatures(
+        resourceTracker, (VkPhysicalDeviceFeatures*)(&toTransform->features));
+}
+
+void transform_tohost_VkPhysicalDeviceProperties2(ResourceTracker* resourceTracker,
+                                                  VkPhysicalDeviceProperties2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkPhysicalDeviceProperties(
+        resourceTracker, (VkPhysicalDeviceProperties*)(&toTransform->properties));
+}
+
+void transform_fromhost_VkPhysicalDeviceProperties2(ResourceTracker* resourceTracker,
+                                                    VkPhysicalDeviceProperties2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkPhysicalDeviceProperties(
+        resourceTracker, (VkPhysicalDeviceProperties*)(&toTransform->properties));
+}
+
+void transform_tohost_VkFormatProperties2(ResourceTracker* resourceTracker,
+                                          VkFormatProperties2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkFormatProperties(resourceTracker,
+                                        (VkFormatProperties*)(&toTransform->formatProperties));
+}
+
+void transform_fromhost_VkFormatProperties2(ResourceTracker* resourceTracker,
+                                            VkFormatProperties2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkFormatProperties(resourceTracker,
+                                          (VkFormatProperties*)(&toTransform->formatProperties));
+}
+
+void transform_tohost_VkImageFormatProperties2(ResourceTracker* resourceTracker,
+                                               VkImageFormatProperties2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkImageFormatProperties(
+        resourceTracker, (VkImageFormatProperties*)(&toTransform->imageFormatProperties));
+}
+
+void transform_fromhost_VkImageFormatProperties2(ResourceTracker* resourceTracker,
+                                                 VkImageFormatProperties2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkImageFormatProperties(
+        resourceTracker, (VkImageFormatProperties*)(&toTransform->imageFormatProperties));
+}
+
+void transform_tohost_VkPhysicalDeviceImageFormatInfo2(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceImageFormatInfo2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceImageFormatInfo2(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceImageFormatInfo2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkQueueFamilyProperties2(ResourceTracker* resourceTracker,
+                                               VkQueueFamilyProperties2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkQueueFamilyProperties(
+        resourceTracker, (VkQueueFamilyProperties*)(&toTransform->queueFamilyProperties));
+}
+
+void transform_fromhost_VkQueueFamilyProperties2(ResourceTracker* resourceTracker,
+                                                 VkQueueFamilyProperties2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkQueueFamilyProperties(
+        resourceTracker, (VkQueueFamilyProperties*)(&toTransform->queueFamilyProperties));
+}
+
+void transform_tohost_VkPhysicalDeviceMemoryProperties2(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMemoryProperties2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkPhysicalDeviceMemoryProperties(
+        resourceTracker, (VkPhysicalDeviceMemoryProperties*)(&toTransform->memoryProperties));
+}
+
+void transform_fromhost_VkPhysicalDeviceMemoryProperties2(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMemoryProperties2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkPhysicalDeviceMemoryProperties(
+        resourceTracker, (VkPhysicalDeviceMemoryProperties*)(&toTransform->memoryProperties));
+}
+
+void transform_tohost_VkSparseImageFormatProperties2(ResourceTracker* resourceTracker,
+                                                     VkSparseImageFormatProperties2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkSparseImageFormatProperties(
+        resourceTracker, (VkSparseImageFormatProperties*)(&toTransform->properties));
+}
+
+void transform_fromhost_VkSparseImageFormatProperties2(
+    ResourceTracker* resourceTracker, VkSparseImageFormatProperties2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkSparseImageFormatProperties(
+        resourceTracker, (VkSparseImageFormatProperties*)(&toTransform->properties));
+}
+
+void transform_tohost_VkPhysicalDeviceSparseImageFormatInfo2(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSparseImageFormatInfo2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceSparseImageFormatInfo2(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSparseImageFormatInfo2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDevicePointClippingProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePointClippingProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDevicePointClippingProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePointClippingProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkInputAttachmentAspectReference(
+    ResourceTracker* resourceTracker, VkInputAttachmentAspectReference* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkInputAttachmentAspectReference(
+    ResourceTracker* resourceTracker, VkInputAttachmentAspectReference* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkRenderPassInputAttachmentAspectCreateInfo(
+    ResourceTracker* resourceTracker, VkRenderPassInputAttachmentAspectCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pAspectReferences) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->aspectReferenceCount; ++i) {
+                transform_tohost_VkInputAttachmentAspectReference(
+                    resourceTracker,
+                    (VkInputAttachmentAspectReference*)(toTransform->pAspectReferences + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkRenderPassInputAttachmentAspectCreateInfo(
+    ResourceTracker* resourceTracker, VkRenderPassInputAttachmentAspectCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pAspectReferences) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->aspectReferenceCount; ++i) {
+                transform_fromhost_VkInputAttachmentAspectReference(
+                    resourceTracker,
+                    (VkInputAttachmentAspectReference*)(toTransform->pAspectReferences + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkImageViewUsageCreateInfo(ResourceTracker* resourceTracker,
+                                                 VkImageViewUsageCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkImageViewUsageCreateInfo(ResourceTracker* resourceTracker,
+                                                   VkImageViewUsageCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPipelineTessellationDomainOriginStateCreateInfo(
+    ResourceTracker* resourceTracker,
+    VkPipelineTessellationDomainOriginStateCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPipelineTessellationDomainOriginStateCreateInfo(
+    ResourceTracker* resourceTracker,
+    VkPipelineTessellationDomainOriginStateCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkRenderPassMultiviewCreateInfo(
+    ResourceTracker* resourceTracker, VkRenderPassMultiviewCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkRenderPassMultiviewCreateInfo(
+    ResourceTracker* resourceTracker, VkRenderPassMultiviewCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceMultiviewFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMultiviewFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceMultiviewFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMultiviewFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceMultiviewProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMultiviewProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceMultiviewProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMultiviewProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceVariablePointersFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceVariablePointersFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceVariablePointersFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceVariablePointersFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceProtectedMemoryFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceProtectedMemoryFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceProtectedMemoryFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceProtectedMemoryFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceProtectedMemoryProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceProtectedMemoryProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceProtectedMemoryProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceProtectedMemoryProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDeviceQueueInfo2(ResourceTracker* resourceTracker,
+                                         VkDeviceQueueInfo2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDeviceQueueInfo2(ResourceTracker* resourceTracker,
+                                           VkDeviceQueueInfo2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkProtectedSubmitInfo(ResourceTracker* resourceTracker,
+                                            VkProtectedSubmitInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkProtectedSubmitInfo(ResourceTracker* resourceTracker,
+                                              VkProtectedSubmitInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkSamplerYcbcrConversionCreateInfo(
+    ResourceTracker* resourceTracker, VkSamplerYcbcrConversionCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkComponentMapping(resourceTracker,
+                                        (VkComponentMapping*)(&toTransform->components));
+}
+
+void transform_fromhost_VkSamplerYcbcrConversionCreateInfo(
+    ResourceTracker* resourceTracker, VkSamplerYcbcrConversionCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkComponentMapping(resourceTracker,
+                                          (VkComponentMapping*)(&toTransform->components));
+}
+
+void transform_tohost_VkSamplerYcbcrConversionInfo(ResourceTracker* resourceTracker,
+                                                   VkSamplerYcbcrConversionInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkSamplerYcbcrConversionInfo(ResourceTracker* resourceTracker,
+                                                     VkSamplerYcbcrConversionInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkBindImagePlaneMemoryInfo(ResourceTracker* resourceTracker,
+                                                 VkBindImagePlaneMemoryInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkBindImagePlaneMemoryInfo(ResourceTracker* resourceTracker,
+                                                   VkBindImagePlaneMemoryInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkImagePlaneMemoryRequirementsInfo(
+    ResourceTracker* resourceTracker, VkImagePlaneMemoryRequirementsInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkImagePlaneMemoryRequirementsInfo(
+    ResourceTracker* resourceTracker, VkImagePlaneMemoryRequirementsInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceSamplerYcbcrConversionFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSamplerYcbcrConversionFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceSamplerYcbcrConversionFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSamplerYcbcrConversionFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkSamplerYcbcrConversionImageFormatProperties(
+    ResourceTracker* resourceTracker, VkSamplerYcbcrConversionImageFormatProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkSamplerYcbcrConversionImageFormatProperties(
+    ResourceTracker* resourceTracker, VkSamplerYcbcrConversionImageFormatProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDescriptorUpdateTemplateEntry(
+    ResourceTracker* resourceTracker, VkDescriptorUpdateTemplateEntry* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkDescriptorUpdateTemplateEntry(
+    ResourceTracker* resourceTracker, VkDescriptorUpdateTemplateEntry* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkDescriptorUpdateTemplateCreateInfo(
+    ResourceTracker* resourceTracker, VkDescriptorUpdateTemplateCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pDescriptorUpdateEntries) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->descriptorUpdateEntryCount; ++i) {
+                transform_tohost_VkDescriptorUpdateTemplateEntry(
+                    resourceTracker,
+                    (VkDescriptorUpdateTemplateEntry*)(toTransform->pDescriptorUpdateEntries + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkDescriptorUpdateTemplateCreateInfo(
+    ResourceTracker* resourceTracker, VkDescriptorUpdateTemplateCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pDescriptorUpdateEntries) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->descriptorUpdateEntryCount; ++i) {
+                transform_fromhost_VkDescriptorUpdateTemplateEntry(
+                    resourceTracker,
+                    (VkDescriptorUpdateTemplateEntry*)(toTransform->pDescriptorUpdateEntries + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkExternalMemoryProperties(ResourceTracker* resourceTracker,
+                                                 VkExternalMemoryProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkExternalMemoryProperties(ResourceTracker* resourceTracker,
+                                                   VkExternalMemoryProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkPhysicalDeviceExternalImageFormatInfo(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceExternalImageFormatInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceExternalImageFormatInfo(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceExternalImageFormatInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkExternalImageFormatProperties(
+    ResourceTracker* resourceTracker, VkExternalImageFormatProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    resourceTracker->transformImpl_VkExternalMemoryProperties_tohost(
+        &toTransform->externalMemoryProperties, 1);
+    transform_tohost_VkExternalMemoryProperties(
+        resourceTracker, (VkExternalMemoryProperties*)(&toTransform->externalMemoryProperties));
+}
+
+void transform_fromhost_VkExternalImageFormatProperties(
+    ResourceTracker* resourceTracker, VkExternalImageFormatProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    resourceTracker->transformImpl_VkExternalMemoryProperties_fromhost(
+        &toTransform->externalMemoryProperties, 1);
+    transform_fromhost_VkExternalMemoryProperties(
+        resourceTracker, (VkExternalMemoryProperties*)(&toTransform->externalMemoryProperties));
+}
+
+void transform_tohost_VkPhysicalDeviceExternalBufferInfo(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceExternalBufferInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceExternalBufferInfo(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceExternalBufferInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkExternalBufferProperties(ResourceTracker* resourceTracker,
+                                                 VkExternalBufferProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    resourceTracker->transformImpl_VkExternalMemoryProperties_tohost(
+        &toTransform->externalMemoryProperties, 1);
+    transform_tohost_VkExternalMemoryProperties(
+        resourceTracker, (VkExternalMemoryProperties*)(&toTransform->externalMemoryProperties));
+}
+
+void transform_fromhost_VkExternalBufferProperties(ResourceTracker* resourceTracker,
+                                                   VkExternalBufferProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    resourceTracker->transformImpl_VkExternalMemoryProperties_fromhost(
+        &toTransform->externalMemoryProperties, 1);
+    transform_fromhost_VkExternalMemoryProperties(
+        resourceTracker, (VkExternalMemoryProperties*)(&toTransform->externalMemoryProperties));
+}
+
+void transform_tohost_VkPhysicalDeviceIDProperties(ResourceTracker* resourceTracker,
+                                                   VkPhysicalDeviceIDProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceIDProperties(ResourceTracker* resourceTracker,
+                                                     VkPhysicalDeviceIDProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkExternalMemoryImageCreateInfo(
+    ResourceTracker* resourceTracker, VkExternalMemoryImageCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkExternalMemoryImageCreateInfo(
+    ResourceTracker* resourceTracker, VkExternalMemoryImageCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkExternalMemoryBufferCreateInfo(
+    ResourceTracker* resourceTracker, VkExternalMemoryBufferCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkExternalMemoryBufferCreateInfo(
+    ResourceTracker* resourceTracker, VkExternalMemoryBufferCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkExportMemoryAllocateInfo(ResourceTracker* resourceTracker,
+                                                 VkExportMemoryAllocateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkExportMemoryAllocateInfo(ResourceTracker* resourceTracker,
+                                                   VkExportMemoryAllocateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceExternalFenceInfo(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceExternalFenceInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceExternalFenceInfo(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceExternalFenceInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkExternalFenceProperties(ResourceTracker* resourceTracker,
+                                                VkExternalFenceProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkExternalFenceProperties(ResourceTracker* resourceTracker,
+                                                  VkExternalFenceProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkExportFenceCreateInfo(ResourceTracker* resourceTracker,
+                                              VkExportFenceCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkExportFenceCreateInfo(ResourceTracker* resourceTracker,
+                                                VkExportFenceCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkExportSemaphoreCreateInfo(ResourceTracker* resourceTracker,
+                                                  VkExportSemaphoreCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkExportSemaphoreCreateInfo(ResourceTracker* resourceTracker,
+                                                    VkExportSemaphoreCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceExternalSemaphoreInfo(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceExternalSemaphoreInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceExternalSemaphoreInfo(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceExternalSemaphoreInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkExternalSemaphoreProperties(ResourceTracker* resourceTracker,
+                                                    VkExternalSemaphoreProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkExternalSemaphoreProperties(ResourceTracker* resourceTracker,
+                                                      VkExternalSemaphoreProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceMaintenance3Properties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMaintenance3Properties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceMaintenance3Properties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMaintenance3Properties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDescriptorSetLayoutSupport(ResourceTracker* resourceTracker,
+                                                   VkDescriptorSetLayoutSupport* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDescriptorSetLayoutSupport(ResourceTracker* resourceTracker,
+                                                     VkDescriptorSetLayoutSupport* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceShaderDrawParametersFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderDrawParametersFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceShaderDrawParametersFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderDrawParametersFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_VERSION_1_2
+void transform_tohost_VkPhysicalDeviceVulkan11Features(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceVulkan11Features* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceVulkan11Features(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceVulkan11Features* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceVulkan11Properties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceVulkan11Properties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceVulkan11Properties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceVulkan11Properties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceVulkan12Features(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceVulkan12Features* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceVulkan12Features(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceVulkan12Features* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkConformanceVersion(ResourceTracker* resourceTracker,
+                                           VkConformanceVersion* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkConformanceVersion(ResourceTracker* resourceTracker,
+                                             VkConformanceVersion* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkPhysicalDeviceVulkan12Properties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceVulkan12Properties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkConformanceVersion(
+        resourceTracker, (VkConformanceVersion*)(&toTransform->conformanceVersion));
+}
+
+void transform_fromhost_VkPhysicalDeviceVulkan12Properties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceVulkan12Properties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkConformanceVersion(
+        resourceTracker, (VkConformanceVersion*)(&toTransform->conformanceVersion));
+}
+
+void transform_tohost_VkImageFormatListCreateInfo(ResourceTracker* resourceTracker,
+                                                  VkImageFormatListCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkImageFormatListCreateInfo(ResourceTracker* resourceTracker,
+                                                    VkImageFormatListCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkAttachmentDescription2(ResourceTracker* resourceTracker,
+                                               VkAttachmentDescription2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkAttachmentDescription2(ResourceTracker* resourceTracker,
+                                                 VkAttachmentDescription2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkAttachmentReference2(ResourceTracker* resourceTracker,
+                                             VkAttachmentReference2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkAttachmentReference2(ResourceTracker* resourceTracker,
+                                               VkAttachmentReference2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkSubpassDescription2(ResourceTracker* resourceTracker,
+                                            VkSubpassDescription2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pInputAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->inputAttachmentCount; ++i) {
+                transform_tohost_VkAttachmentReference2(
+                    resourceTracker, (VkAttachmentReference2*)(toTransform->pInputAttachments + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pColorAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->colorAttachmentCount; ++i) {
+                transform_tohost_VkAttachmentReference2(
+                    resourceTracker, (VkAttachmentReference2*)(toTransform->pColorAttachments + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pResolveAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->colorAttachmentCount; ++i) {
+                transform_tohost_VkAttachmentReference2(
+                    resourceTracker,
+                    (VkAttachmentReference2*)(toTransform->pResolveAttachments + i));
+            }
+        }
+    }
+    if (toTransform->pDepthStencilAttachment) {
+        transform_tohost_VkAttachmentReference2(
+            resourceTracker, (VkAttachmentReference2*)(toTransform->pDepthStencilAttachment));
+    }
+}
+
+void transform_fromhost_VkSubpassDescription2(ResourceTracker* resourceTracker,
+                                              VkSubpassDescription2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pInputAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->inputAttachmentCount; ++i) {
+                transform_fromhost_VkAttachmentReference2(
+                    resourceTracker, (VkAttachmentReference2*)(toTransform->pInputAttachments + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pColorAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->colorAttachmentCount; ++i) {
+                transform_fromhost_VkAttachmentReference2(
+                    resourceTracker, (VkAttachmentReference2*)(toTransform->pColorAttachments + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pResolveAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->colorAttachmentCount; ++i) {
+                transform_fromhost_VkAttachmentReference2(
+                    resourceTracker,
+                    (VkAttachmentReference2*)(toTransform->pResolveAttachments + i));
+            }
+        }
+    }
+    if (toTransform->pDepthStencilAttachment) {
+        transform_fromhost_VkAttachmentReference2(
+            resourceTracker, (VkAttachmentReference2*)(toTransform->pDepthStencilAttachment));
+    }
+}
+
+void transform_tohost_VkSubpassDependency2(ResourceTracker* resourceTracker,
+                                           VkSubpassDependency2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkSubpassDependency2(ResourceTracker* resourceTracker,
+                                             VkSubpassDependency2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkRenderPassCreateInfo2(ResourceTracker* resourceTracker,
+                                              VkRenderPassCreateInfo2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->attachmentCount; ++i) {
+                transform_tohost_VkAttachmentDescription2(
+                    resourceTracker, (VkAttachmentDescription2*)(toTransform->pAttachments + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pSubpasses) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->subpassCount; ++i) {
+                transform_tohost_VkSubpassDescription2(
+                    resourceTracker, (VkSubpassDescription2*)(toTransform->pSubpasses + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pDependencies) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->dependencyCount; ++i) {
+                transform_tohost_VkSubpassDependency2(
+                    resourceTracker, (VkSubpassDependency2*)(toTransform->pDependencies + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkRenderPassCreateInfo2(ResourceTracker* resourceTracker,
+                                                VkRenderPassCreateInfo2* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->attachmentCount; ++i) {
+                transform_fromhost_VkAttachmentDescription2(
+                    resourceTracker, (VkAttachmentDescription2*)(toTransform->pAttachments + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pSubpasses) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->subpassCount; ++i) {
+                transform_fromhost_VkSubpassDescription2(
+                    resourceTracker, (VkSubpassDescription2*)(toTransform->pSubpasses + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pDependencies) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->dependencyCount; ++i) {
+                transform_fromhost_VkSubpassDependency2(
+                    resourceTracker, (VkSubpassDependency2*)(toTransform->pDependencies + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkSubpassBeginInfo(ResourceTracker* resourceTracker,
+                                         VkSubpassBeginInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkSubpassBeginInfo(ResourceTracker* resourceTracker,
+                                           VkSubpassBeginInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkSubpassEndInfo(ResourceTracker* resourceTracker,
+                                       VkSubpassEndInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkSubpassEndInfo(ResourceTracker* resourceTracker,
+                                         VkSubpassEndInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDevice8BitStorageFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDevice8BitStorageFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDevice8BitStorageFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDevice8BitStorageFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceDriverProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDriverProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkConformanceVersion(
+        resourceTracker, (VkConformanceVersion*)(&toTransform->conformanceVersion));
+}
+
+void transform_fromhost_VkPhysicalDeviceDriverProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDriverProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkConformanceVersion(
+        resourceTracker, (VkConformanceVersion*)(&toTransform->conformanceVersion));
+}
+
+void transform_tohost_VkPhysicalDeviceShaderAtomicInt64Features(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderAtomicInt64Features* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceShaderAtomicInt64Features(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderAtomicInt64Features* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceShaderFloat16Int8Features(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderFloat16Int8Features* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceShaderFloat16Int8Features(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderFloat16Int8Features* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceFloatControlsProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceFloatControlsProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceFloatControlsProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceFloatControlsProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDescriptorSetLayoutBindingFlagsCreateInfo(
+    ResourceTracker* resourceTracker, VkDescriptorSetLayoutBindingFlagsCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDescriptorSetLayoutBindingFlagsCreateInfo(
+    ResourceTracker* resourceTracker, VkDescriptorSetLayoutBindingFlagsCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceDescriptorIndexingFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDescriptorIndexingFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceDescriptorIndexingFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDescriptorIndexingFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceDescriptorIndexingProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDescriptorIndexingProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceDescriptorIndexingProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDescriptorIndexingProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDescriptorSetVariableDescriptorCountAllocateInfo(
+    ResourceTracker* resourceTracker,
+    VkDescriptorSetVariableDescriptorCountAllocateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDescriptorSetVariableDescriptorCountAllocateInfo(
+    ResourceTracker* resourceTracker,
+    VkDescriptorSetVariableDescriptorCountAllocateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDescriptorSetVariableDescriptorCountLayoutSupport(
+    ResourceTracker* resourceTracker,
+    VkDescriptorSetVariableDescriptorCountLayoutSupport* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDescriptorSetVariableDescriptorCountLayoutSupport(
+    ResourceTracker* resourceTracker,
+    VkDescriptorSetVariableDescriptorCountLayoutSupport* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkSubpassDescriptionDepthStencilResolve(
+    ResourceTracker* resourceTracker, VkSubpassDescriptionDepthStencilResolve* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pDepthStencilResolveAttachment) {
+        transform_tohost_VkAttachmentReference2(
+            resourceTracker,
+            (VkAttachmentReference2*)(toTransform->pDepthStencilResolveAttachment));
+    }
+}
+
+void transform_fromhost_VkSubpassDescriptionDepthStencilResolve(
+    ResourceTracker* resourceTracker, VkSubpassDescriptionDepthStencilResolve* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pDepthStencilResolveAttachment) {
+        transform_fromhost_VkAttachmentReference2(
+            resourceTracker,
+            (VkAttachmentReference2*)(toTransform->pDepthStencilResolveAttachment));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceDepthStencilResolveProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDepthStencilResolveProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceDepthStencilResolveProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDepthStencilResolveProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceScalarBlockLayoutFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceScalarBlockLayoutFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceScalarBlockLayoutFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceScalarBlockLayoutFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkImageStencilUsageCreateInfo(ResourceTracker* resourceTracker,
+                                                    VkImageStencilUsageCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkImageStencilUsageCreateInfo(ResourceTracker* resourceTracker,
+                                                      VkImageStencilUsageCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkSamplerReductionModeCreateInfo(
+    ResourceTracker* resourceTracker, VkSamplerReductionModeCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkSamplerReductionModeCreateInfo(
+    ResourceTracker* resourceTracker, VkSamplerReductionModeCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceSamplerFilterMinmaxProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSamplerFilterMinmaxProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceSamplerFilterMinmaxProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSamplerFilterMinmaxProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceVulkanMemoryModelFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceVulkanMemoryModelFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceVulkanMemoryModelFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceVulkanMemoryModelFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceImagelessFramebufferFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceImagelessFramebufferFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceImagelessFramebufferFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceImagelessFramebufferFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkFramebufferAttachmentImageInfo(
+    ResourceTracker* resourceTracker, VkFramebufferAttachmentImageInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkFramebufferAttachmentImageInfo(
+    ResourceTracker* resourceTracker, VkFramebufferAttachmentImageInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkFramebufferAttachmentsCreateInfo(
+    ResourceTracker* resourceTracker, VkFramebufferAttachmentsCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pAttachmentImageInfos) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->attachmentImageInfoCount; ++i) {
+                transform_tohost_VkFramebufferAttachmentImageInfo(
+                    resourceTracker,
+                    (VkFramebufferAttachmentImageInfo*)(toTransform->pAttachmentImageInfos + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkFramebufferAttachmentsCreateInfo(
+    ResourceTracker* resourceTracker, VkFramebufferAttachmentsCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pAttachmentImageInfos) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->attachmentImageInfoCount; ++i) {
+                transform_fromhost_VkFramebufferAttachmentImageInfo(
+                    resourceTracker,
+                    (VkFramebufferAttachmentImageInfo*)(toTransform->pAttachmentImageInfos + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkRenderPassAttachmentBeginInfo(
+    ResourceTracker* resourceTracker, VkRenderPassAttachmentBeginInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkRenderPassAttachmentBeginInfo(
+    ResourceTracker* resourceTracker, VkRenderPassAttachmentBeginInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceUniformBufferStandardLayoutFeatures(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceUniformBufferStandardLayoutFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceUniformBufferStandardLayoutFeatures(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceUniformBufferStandardLayoutFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkAttachmentReferenceStencilLayout(
+    ResourceTracker* resourceTracker, VkAttachmentReferenceStencilLayout* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkAttachmentReferenceStencilLayout(
+    ResourceTracker* resourceTracker, VkAttachmentReferenceStencilLayout* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkAttachmentDescriptionStencilLayout(
+    ResourceTracker* resourceTracker, VkAttachmentDescriptionStencilLayout* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkAttachmentDescriptionStencilLayout(
+    ResourceTracker* resourceTracker, VkAttachmentDescriptionStencilLayout* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceHostQueryResetFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceHostQueryResetFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceHostQueryResetFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceHostQueryResetFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceTimelineSemaphoreFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceTimelineSemaphoreFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceTimelineSemaphoreFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceTimelineSemaphoreFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceTimelineSemaphoreProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceTimelineSemaphoreProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceTimelineSemaphoreProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceTimelineSemaphoreProperties* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkSemaphoreTypeCreateInfo(ResourceTracker* resourceTracker,
+                                                VkSemaphoreTypeCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkSemaphoreTypeCreateInfo(ResourceTracker* resourceTracker,
+                                                  VkSemaphoreTypeCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkTimelineSemaphoreSubmitInfo(ResourceTracker* resourceTracker,
+                                                    VkTimelineSemaphoreSubmitInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkTimelineSemaphoreSubmitInfo(ResourceTracker* resourceTracker,
+                                                      VkTimelineSemaphoreSubmitInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkSemaphoreWaitInfo(ResourceTracker* resourceTracker,
+                                          VkSemaphoreWaitInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkSemaphoreWaitInfo(ResourceTracker* resourceTracker,
+                                            VkSemaphoreWaitInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkSemaphoreSignalInfo(ResourceTracker* resourceTracker,
+                                            VkSemaphoreSignalInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkSemaphoreSignalInfo(ResourceTracker* resourceTracker,
+                                              VkSemaphoreSignalInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceBufferDeviceAddressFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceBufferDeviceAddressFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceBufferDeviceAddressFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceBufferDeviceAddressFeatures* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkBufferDeviceAddressInfo(ResourceTracker* resourceTracker,
+                                                VkBufferDeviceAddressInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkBufferDeviceAddressInfo(ResourceTracker* resourceTracker,
+                                                  VkBufferDeviceAddressInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkBufferOpaqueCaptureAddressCreateInfo(
+    ResourceTracker* resourceTracker, VkBufferOpaqueCaptureAddressCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkBufferOpaqueCaptureAddressCreateInfo(
+    ResourceTracker* resourceTracker, VkBufferOpaqueCaptureAddressCreateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkMemoryOpaqueCaptureAddressAllocateInfo(
+    ResourceTracker* resourceTracker, VkMemoryOpaqueCaptureAddressAllocateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkMemoryOpaqueCaptureAddressAllocateInfo(
+    ResourceTracker* resourceTracker, VkMemoryOpaqueCaptureAddressAllocateInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDeviceMemoryOpaqueCaptureAddressInfo(
+    ResourceTracker* resourceTracker, VkDeviceMemoryOpaqueCaptureAddressInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_tohost((VkDeviceMemory*)&toTransform->memory, 1,
+                                                  (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr,
+                                                  0, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0);
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDeviceMemoryOpaqueCaptureAddressInfo(
+    ResourceTracker* resourceTracker, VkDeviceMemoryOpaqueCaptureAddressInfo* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_fromhost(
+        (VkDeviceMemory*)&toTransform->memory, 1, (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr,
+        0, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0);
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_surface
+void transform_tohost_VkSurfaceCapabilitiesKHR(ResourceTracker* resourceTracker,
+                                               VkSurfaceCapabilitiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->currentExtent));
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->minImageExtent));
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->maxImageExtent));
+}
+
+void transform_fromhost_VkSurfaceCapabilitiesKHR(ResourceTracker* resourceTracker,
+                                                 VkSurfaceCapabilitiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->currentExtent));
+    transform_fromhost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->minImageExtent));
+    transform_fromhost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->maxImageExtent));
+}
+
+void transform_tohost_VkSurfaceFormatKHR(ResourceTracker* resourceTracker,
+                                         VkSurfaceFormatKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkSurfaceFormatKHR(ResourceTracker* resourceTracker,
+                                           VkSurfaceFormatKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+#endif
+#ifdef VK_KHR_swapchain
+void transform_tohost_VkSwapchainCreateInfoKHR(ResourceTracker* resourceTracker,
+                                               VkSwapchainCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->imageExtent));
+}
+
+void transform_fromhost_VkSwapchainCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                 VkSwapchainCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->imageExtent));
+}
+
+void transform_tohost_VkPresentInfoKHR(ResourceTracker* resourceTracker,
+                                       VkPresentInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPresentInfoKHR(ResourceTracker* resourceTracker,
+                                         VkPresentInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkImageSwapchainCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                    VkImageSwapchainCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkImageSwapchainCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                      VkImageSwapchainCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkBindImageMemorySwapchainInfoKHR(
+    ResourceTracker* resourceTracker, VkBindImageMemorySwapchainInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkBindImageMemorySwapchainInfoKHR(
+    ResourceTracker* resourceTracker, VkBindImageMemorySwapchainInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkAcquireNextImageInfoKHR(ResourceTracker* resourceTracker,
+                                                VkAcquireNextImageInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkAcquireNextImageInfoKHR(ResourceTracker* resourceTracker,
+                                                  VkAcquireNextImageInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDeviceGroupPresentCapabilitiesKHR(
+    ResourceTracker* resourceTracker, VkDeviceGroupPresentCapabilitiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDeviceGroupPresentCapabilitiesKHR(
+    ResourceTracker* resourceTracker, VkDeviceGroupPresentCapabilitiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDeviceGroupPresentInfoKHR(ResourceTracker* resourceTracker,
+                                                  VkDeviceGroupPresentInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDeviceGroupPresentInfoKHR(ResourceTracker* resourceTracker,
+                                                    VkDeviceGroupPresentInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDeviceGroupSwapchainCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkDeviceGroupSwapchainCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDeviceGroupSwapchainCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkDeviceGroupSwapchainCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_display
+void transform_tohost_VkDisplayModeParametersKHR(ResourceTracker* resourceTracker,
+                                                 VkDisplayModeParametersKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->visibleRegion));
+}
+
+void transform_fromhost_VkDisplayModeParametersKHR(ResourceTracker* resourceTracker,
+                                                   VkDisplayModeParametersKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->visibleRegion));
+}
+
+void transform_tohost_VkDisplayModeCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                 VkDisplayModeCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkDisplayModeParametersKHR(
+        resourceTracker, (VkDisplayModeParametersKHR*)(&toTransform->parameters));
+}
+
+void transform_fromhost_VkDisplayModeCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                   VkDisplayModeCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkDisplayModeParametersKHR(
+        resourceTracker, (VkDisplayModeParametersKHR*)(&toTransform->parameters));
+}
+
+void transform_tohost_VkDisplayModePropertiesKHR(ResourceTracker* resourceTracker,
+                                                 VkDisplayModePropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkDisplayModeParametersKHR(
+        resourceTracker, (VkDisplayModeParametersKHR*)(&toTransform->parameters));
+}
+
+void transform_fromhost_VkDisplayModePropertiesKHR(ResourceTracker* resourceTracker,
+                                                   VkDisplayModePropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkDisplayModeParametersKHR(
+        resourceTracker, (VkDisplayModeParametersKHR*)(&toTransform->parameters));
+}
+
+void transform_tohost_VkDisplayPlaneCapabilitiesKHR(ResourceTracker* resourceTracker,
+                                                    VkDisplayPlaneCapabilitiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkOffset2D(resourceTracker, (VkOffset2D*)(&toTransform->minSrcPosition));
+    transform_tohost_VkOffset2D(resourceTracker, (VkOffset2D*)(&toTransform->maxSrcPosition));
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->minSrcExtent));
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->maxSrcExtent));
+    transform_tohost_VkOffset2D(resourceTracker, (VkOffset2D*)(&toTransform->minDstPosition));
+    transform_tohost_VkOffset2D(resourceTracker, (VkOffset2D*)(&toTransform->maxDstPosition));
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->minDstExtent));
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->maxDstExtent));
+}
+
+void transform_fromhost_VkDisplayPlaneCapabilitiesKHR(ResourceTracker* resourceTracker,
+                                                      VkDisplayPlaneCapabilitiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkOffset2D(resourceTracker, (VkOffset2D*)(&toTransform->minSrcPosition));
+    transform_fromhost_VkOffset2D(resourceTracker, (VkOffset2D*)(&toTransform->maxSrcPosition));
+    transform_fromhost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->minSrcExtent));
+    transform_fromhost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->maxSrcExtent));
+    transform_fromhost_VkOffset2D(resourceTracker, (VkOffset2D*)(&toTransform->minDstPosition));
+    transform_fromhost_VkOffset2D(resourceTracker, (VkOffset2D*)(&toTransform->maxDstPosition));
+    transform_fromhost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->minDstExtent));
+    transform_fromhost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->maxDstExtent));
+}
+
+void transform_tohost_VkDisplayPlanePropertiesKHR(ResourceTracker* resourceTracker,
+                                                  VkDisplayPlanePropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkDisplayPlanePropertiesKHR(ResourceTracker* resourceTracker,
+                                                    VkDisplayPlanePropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkDisplayPropertiesKHR(ResourceTracker* resourceTracker,
+                                             VkDisplayPropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->physicalDimensions));
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->physicalResolution));
+}
+
+void transform_fromhost_VkDisplayPropertiesKHR(ResourceTracker* resourceTracker,
+                                               VkDisplayPropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->physicalDimensions));
+    transform_fromhost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->physicalResolution));
+}
+
+void transform_tohost_VkDisplaySurfaceCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                    VkDisplaySurfaceCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->imageExtent));
+}
+
+void transform_fromhost_VkDisplaySurfaceCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                      VkDisplaySurfaceCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->imageExtent));
+}
+
+#endif
+#ifdef VK_KHR_display_swapchain
+void transform_tohost_VkDisplayPresentInfoKHR(ResourceTracker* resourceTracker,
+                                              VkDisplayPresentInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkRect2D(resourceTracker, (VkRect2D*)(&toTransform->srcRect));
+    transform_tohost_VkRect2D(resourceTracker, (VkRect2D*)(&toTransform->dstRect));
+}
+
+void transform_fromhost_VkDisplayPresentInfoKHR(ResourceTracker* resourceTracker,
+                                                VkDisplayPresentInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkRect2D(resourceTracker, (VkRect2D*)(&toTransform->srcRect));
+    transform_fromhost_VkRect2D(resourceTracker, (VkRect2D*)(&toTransform->dstRect));
+}
+
+#endif
+#ifdef VK_KHR_xlib_surface
+void transform_tohost_VkXlibSurfaceCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                 VkXlibSurfaceCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkXlibSurfaceCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                   VkXlibSurfaceCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_xcb_surface
+void transform_tohost_VkXcbSurfaceCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                VkXcbSurfaceCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkXcbSurfaceCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                  VkXcbSurfaceCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_wayland_surface
+void transform_tohost_VkWaylandSurfaceCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                    VkWaylandSurfaceCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkWaylandSurfaceCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                      VkWaylandSurfaceCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_android_surface
+void transform_tohost_VkAndroidSurfaceCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                    VkAndroidSurfaceCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkAndroidSurfaceCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                      VkAndroidSurfaceCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_win32_surface
+void transform_tohost_VkWin32SurfaceCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                  VkWin32SurfaceCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkWin32SurfaceCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                    VkWin32SurfaceCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_sampler_mirror_clamp_to_edge
+#endif
+#ifdef VK_KHR_video_queue
+void transform_tohost_VkVideoQueueFamilyProperties2KHR(
+    ResourceTracker* resourceTracker, VkVideoQueueFamilyProperties2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkVideoQueueFamilyProperties2KHR(
+    ResourceTracker* resourceTracker, VkVideoQueueFamilyProperties2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkVideoProfileKHR(ResourceTracker* resourceTracker,
+                                        VkVideoProfileKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkVideoProfileKHR(ResourceTracker* resourceTracker,
+                                          VkVideoProfileKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkVideoProfilesKHR(ResourceTracker* resourceTracker,
+                                         VkVideoProfilesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pProfiles) {
+        transform_tohost_VkVideoProfileKHR(resourceTracker,
+                                           (VkVideoProfileKHR*)(toTransform->pProfiles));
+    }
+}
+
+void transform_fromhost_VkVideoProfilesKHR(ResourceTracker* resourceTracker,
+                                           VkVideoProfilesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pProfiles) {
+        transform_fromhost_VkVideoProfileKHR(resourceTracker,
+                                             (VkVideoProfileKHR*)(toTransform->pProfiles));
+    }
+}
+
+void transform_tohost_VkVideoCapabilitiesKHR(ResourceTracker* resourceTracker,
+                                             VkVideoCapabilitiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkExtent2D(resourceTracker,
+                                (VkExtent2D*)(&toTransform->videoPictureExtentGranularity));
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->minExtent));
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->maxExtent));
+}
+
+void transform_fromhost_VkVideoCapabilitiesKHR(ResourceTracker* resourceTracker,
+                                               VkVideoCapabilitiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkExtent2D(resourceTracker,
+                                  (VkExtent2D*)(&toTransform->videoPictureExtentGranularity));
+    transform_fromhost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->minExtent));
+    transform_fromhost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->maxExtent));
+}
+
+void transform_tohost_VkPhysicalDeviceVideoFormatInfoKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceVideoFormatInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pVideoProfiles) {
+        transform_tohost_VkVideoProfilesKHR(resourceTracker,
+                                            (VkVideoProfilesKHR*)(toTransform->pVideoProfiles));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceVideoFormatInfoKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceVideoFormatInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pVideoProfiles) {
+        transform_fromhost_VkVideoProfilesKHR(resourceTracker,
+                                              (VkVideoProfilesKHR*)(toTransform->pVideoProfiles));
+    }
+}
+
+void transform_tohost_VkVideoFormatPropertiesKHR(ResourceTracker* resourceTracker,
+                                                 VkVideoFormatPropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkVideoFormatPropertiesKHR(ResourceTracker* resourceTracker,
+                                                   VkVideoFormatPropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkVideoPictureResourceKHR(ResourceTracker* resourceTracker,
+                                                VkVideoPictureResourceKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkOffset2D(resourceTracker, (VkOffset2D*)(&toTransform->codedOffset));
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->codedExtent));
+}
+
+void transform_fromhost_VkVideoPictureResourceKHR(ResourceTracker* resourceTracker,
+                                                  VkVideoPictureResourceKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkOffset2D(resourceTracker, (VkOffset2D*)(&toTransform->codedOffset));
+    transform_fromhost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->codedExtent));
+}
+
+void transform_tohost_VkVideoReferenceSlotKHR(ResourceTracker* resourceTracker,
+                                              VkVideoReferenceSlotKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pPictureResource) {
+        transform_tohost_VkVideoPictureResourceKHR(
+            resourceTracker, (VkVideoPictureResourceKHR*)(toTransform->pPictureResource));
+    }
+}
+
+void transform_fromhost_VkVideoReferenceSlotKHR(ResourceTracker* resourceTracker,
+                                                VkVideoReferenceSlotKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pPictureResource) {
+        transform_fromhost_VkVideoPictureResourceKHR(
+            resourceTracker, (VkVideoPictureResourceKHR*)(toTransform->pPictureResource));
+    }
+}
+
+void transform_tohost_VkVideoGetMemoryPropertiesKHR(ResourceTracker* resourceTracker,
+                                                    VkVideoGetMemoryPropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pMemoryRequirements) {
+        transform_tohost_VkMemoryRequirements2(
+            resourceTracker, (VkMemoryRequirements2*)(toTransform->pMemoryRequirements));
+    }
+}
+
+void transform_fromhost_VkVideoGetMemoryPropertiesKHR(ResourceTracker* resourceTracker,
+                                                      VkVideoGetMemoryPropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pMemoryRequirements) {
+        transform_fromhost_VkMemoryRequirements2(
+            resourceTracker, (VkMemoryRequirements2*)(toTransform->pMemoryRequirements));
+    }
+}
+
+void transform_tohost_VkVideoBindMemoryKHR(ResourceTracker* resourceTracker,
+                                           VkVideoBindMemoryKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkVideoBindMemoryKHR(ResourceTracker* resourceTracker,
+                                             VkVideoBindMemoryKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkVideoSessionCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                  VkVideoSessionCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pVideoProfile) {
+        transform_tohost_VkVideoProfileKHR(resourceTracker,
+                                           (VkVideoProfileKHR*)(toTransform->pVideoProfile));
+    }
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->maxCodedExtent));
+}
+
+void transform_fromhost_VkVideoSessionCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                    VkVideoSessionCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pVideoProfile) {
+        transform_fromhost_VkVideoProfileKHR(resourceTracker,
+                                             (VkVideoProfileKHR*)(toTransform->pVideoProfile));
+    }
+    transform_fromhost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->maxCodedExtent));
+}
+
+void transform_tohost_VkVideoSessionParametersCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkVideoSessionParametersCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkVideoSessionParametersCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkVideoSessionParametersCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkVideoSessionParametersUpdateInfoKHR(
+    ResourceTracker* resourceTracker, VkVideoSessionParametersUpdateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkVideoSessionParametersUpdateInfoKHR(
+    ResourceTracker* resourceTracker, VkVideoSessionParametersUpdateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkVideoBeginCodingInfoKHR(ResourceTracker* resourceTracker,
+                                                VkVideoBeginCodingInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pReferenceSlots) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->referenceSlotCount; ++i) {
+                transform_tohost_VkVideoReferenceSlotKHR(
+                    resourceTracker, (VkVideoReferenceSlotKHR*)(toTransform->pReferenceSlots + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkVideoBeginCodingInfoKHR(ResourceTracker* resourceTracker,
+                                                  VkVideoBeginCodingInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pReferenceSlots) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->referenceSlotCount; ++i) {
+                transform_fromhost_VkVideoReferenceSlotKHR(
+                    resourceTracker, (VkVideoReferenceSlotKHR*)(toTransform->pReferenceSlots + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkVideoEndCodingInfoKHR(ResourceTracker* resourceTracker,
+                                              VkVideoEndCodingInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkVideoEndCodingInfoKHR(ResourceTracker* resourceTracker,
+                                                VkVideoEndCodingInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkVideoCodingControlInfoKHR(ResourceTracker* resourceTracker,
+                                                  VkVideoCodingControlInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkVideoCodingControlInfoKHR(ResourceTracker* resourceTracker,
+                                                    VkVideoCodingControlInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_video_decode_queue
+void transform_tohost_VkVideoDecodeInfoKHR(ResourceTracker* resourceTracker,
+                                           VkVideoDecodeInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkOffset2D(resourceTracker, (VkOffset2D*)(&toTransform->codedOffset));
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->codedExtent));
+    transform_tohost_VkVideoPictureResourceKHR(
+        resourceTracker, (VkVideoPictureResourceKHR*)(&toTransform->dstPictureResource));
+    if (toTransform->pSetupReferenceSlot) {
+        transform_tohost_VkVideoReferenceSlotKHR(
+            resourceTracker, (VkVideoReferenceSlotKHR*)(toTransform->pSetupReferenceSlot));
+    }
+    if (toTransform) {
+        if (toTransform->pReferenceSlots) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->referenceSlotCount; ++i) {
+                transform_tohost_VkVideoReferenceSlotKHR(
+                    resourceTracker, (VkVideoReferenceSlotKHR*)(toTransform->pReferenceSlots + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkVideoDecodeInfoKHR(ResourceTracker* resourceTracker,
+                                             VkVideoDecodeInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkOffset2D(resourceTracker, (VkOffset2D*)(&toTransform->codedOffset));
+    transform_fromhost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->codedExtent));
+    transform_fromhost_VkVideoPictureResourceKHR(
+        resourceTracker, (VkVideoPictureResourceKHR*)(&toTransform->dstPictureResource));
+    if (toTransform->pSetupReferenceSlot) {
+        transform_fromhost_VkVideoReferenceSlotKHR(
+            resourceTracker, (VkVideoReferenceSlotKHR*)(toTransform->pSetupReferenceSlot));
+    }
+    if (toTransform) {
+        if (toTransform->pReferenceSlots) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->referenceSlotCount; ++i) {
+                transform_fromhost_VkVideoReferenceSlotKHR(
+                    resourceTracker, (VkVideoReferenceSlotKHR*)(toTransform->pReferenceSlots + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_KHR_dynamic_rendering
+void transform_tohost_VkRenderingAttachmentInfoKHR(ResourceTracker* resourceTracker,
+                                                   VkRenderingAttachmentInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkClearValue(resourceTracker, (VkClearValue*)(&toTransform->clearValue));
+}
+
+void transform_fromhost_VkRenderingAttachmentInfoKHR(ResourceTracker* resourceTracker,
+                                                     VkRenderingAttachmentInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkClearValue(resourceTracker, (VkClearValue*)(&toTransform->clearValue));
+}
+
+void transform_tohost_VkRenderingInfoKHR(ResourceTracker* resourceTracker,
+                                         VkRenderingInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkRect2D(resourceTracker, (VkRect2D*)(&toTransform->renderArea));
+    if (toTransform) {
+        if (toTransform->pColorAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->colorAttachmentCount; ++i) {
+                transform_tohost_VkRenderingAttachmentInfoKHR(
+                    resourceTracker,
+                    (VkRenderingAttachmentInfoKHR*)(toTransform->pColorAttachments + i));
+            }
+        }
+    }
+    if (toTransform->pDepthAttachment) {
+        transform_tohost_VkRenderingAttachmentInfoKHR(
+            resourceTracker, (VkRenderingAttachmentInfoKHR*)(toTransform->pDepthAttachment));
+    }
+    if (toTransform->pStencilAttachment) {
+        transform_tohost_VkRenderingAttachmentInfoKHR(
+            resourceTracker, (VkRenderingAttachmentInfoKHR*)(toTransform->pStencilAttachment));
+    }
+}
+
+void transform_fromhost_VkRenderingInfoKHR(ResourceTracker* resourceTracker,
+                                           VkRenderingInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkRect2D(resourceTracker, (VkRect2D*)(&toTransform->renderArea));
+    if (toTransform) {
+        if (toTransform->pColorAttachments) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->colorAttachmentCount; ++i) {
+                transform_fromhost_VkRenderingAttachmentInfoKHR(
+                    resourceTracker,
+                    (VkRenderingAttachmentInfoKHR*)(toTransform->pColorAttachments + i));
+            }
+        }
+    }
+    if (toTransform->pDepthAttachment) {
+        transform_fromhost_VkRenderingAttachmentInfoKHR(
+            resourceTracker, (VkRenderingAttachmentInfoKHR*)(toTransform->pDepthAttachment));
+    }
+    if (toTransform->pStencilAttachment) {
+        transform_fromhost_VkRenderingAttachmentInfoKHR(
+            resourceTracker, (VkRenderingAttachmentInfoKHR*)(toTransform->pStencilAttachment));
+    }
+}
+
+void transform_tohost_VkPipelineRenderingCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkPipelineRenderingCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPipelineRenderingCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkPipelineRenderingCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceDynamicRenderingFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDynamicRenderingFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceDynamicRenderingFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDynamicRenderingFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkCommandBufferInheritanceRenderingInfoKHR(
+    ResourceTracker* resourceTracker, VkCommandBufferInheritanceRenderingInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkCommandBufferInheritanceRenderingInfoKHR(
+    ResourceTracker* resourceTracker, VkCommandBufferInheritanceRenderingInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkRenderingFragmentShadingRateAttachmentInfoKHR(
+    ResourceTracker* resourceTracker,
+    VkRenderingFragmentShadingRateAttachmentInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkExtent2D(resourceTracker,
+                                (VkExtent2D*)(&toTransform->shadingRateAttachmentTexelSize));
+}
+
+void transform_fromhost_VkRenderingFragmentShadingRateAttachmentInfoKHR(
+    ResourceTracker* resourceTracker,
+    VkRenderingFragmentShadingRateAttachmentInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkExtent2D(resourceTracker,
+                                  (VkExtent2D*)(&toTransform->shadingRateAttachmentTexelSize));
+}
+
+void transform_tohost_VkRenderingFragmentDensityMapAttachmentInfoEXT(
+    ResourceTracker* resourceTracker, VkRenderingFragmentDensityMapAttachmentInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkRenderingFragmentDensityMapAttachmentInfoEXT(
+    ResourceTracker* resourceTracker, VkRenderingFragmentDensityMapAttachmentInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkAttachmentSampleCountInfoAMD(ResourceTracker* resourceTracker,
+                                                     VkAttachmentSampleCountInfoAMD* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkAttachmentSampleCountInfoAMD(
+    ResourceTracker* resourceTracker, VkAttachmentSampleCountInfoAMD* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkMultiviewPerViewAttributesInfoNVX(
+    ResourceTracker* resourceTracker, VkMultiviewPerViewAttributesInfoNVX* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkMultiviewPerViewAttributesInfoNVX(
+    ResourceTracker* resourceTracker, VkMultiviewPerViewAttributesInfoNVX* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_multiview
+#endif
+#ifdef VK_KHR_get_physical_device_properties2
+#endif
+#ifdef VK_KHR_device_group
+#endif
+#ifdef VK_KHR_shader_draw_parameters
+#endif
+#ifdef VK_KHR_maintenance1
+#endif
+#ifdef VK_KHR_device_group_creation
+#endif
+#ifdef VK_KHR_external_memory_capabilities
+#endif
+#ifdef VK_KHR_external_memory
+#endif
+#ifdef VK_KHR_external_memory_win32
+void transform_tohost_VkImportMemoryWin32HandleInfoKHR(
+    ResourceTracker* resourceTracker, VkImportMemoryWin32HandleInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkImportMemoryWin32HandleInfoKHR(
+    ResourceTracker* resourceTracker, VkImportMemoryWin32HandleInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkExportMemoryWin32HandleInfoKHR(
+    ResourceTracker* resourceTracker, VkExportMemoryWin32HandleInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkExportMemoryWin32HandleInfoKHR(
+    ResourceTracker* resourceTracker, VkExportMemoryWin32HandleInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkMemoryWin32HandlePropertiesKHR(
+    ResourceTracker* resourceTracker, VkMemoryWin32HandlePropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_tohost(
+        (VkDeviceMemory*)nullptr, 0, (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr, 0,
+        (uint32_t*)nullptr, 0, (uint32_t*)&toTransform->memoryTypeBits, 1);
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkMemoryWin32HandlePropertiesKHR(
+    ResourceTracker* resourceTracker, VkMemoryWin32HandlePropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_fromhost(
+        (VkDeviceMemory*)nullptr, 0, (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr, 0,
+        (uint32_t*)nullptr, 0, (uint32_t*)&toTransform->memoryTypeBits, 1);
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkMemoryGetWin32HandleInfoKHR(ResourceTracker* resourceTracker,
+                                                    VkMemoryGetWin32HandleInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_tohost((VkDeviceMemory*)&toTransform->memory, 1,
+                                                  (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr,
+                                                  0, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0);
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkMemoryGetWin32HandleInfoKHR(ResourceTracker* resourceTracker,
+                                                      VkMemoryGetWin32HandleInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_fromhost(
+        (VkDeviceMemory*)&toTransform->memory, 1, (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr,
+        0, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0);
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_external_memory_fd
+void transform_tohost_VkImportMemoryFdInfoKHR(ResourceTracker* resourceTracker,
+                                              VkImportMemoryFdInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkImportMemoryFdInfoKHR(ResourceTracker* resourceTracker,
+                                                VkImportMemoryFdInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkMemoryFdPropertiesKHR(ResourceTracker* resourceTracker,
+                                              VkMemoryFdPropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_tohost(
+        (VkDeviceMemory*)nullptr, 0, (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr, 0,
+        (uint32_t*)nullptr, 0, (uint32_t*)&toTransform->memoryTypeBits, 1);
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkMemoryFdPropertiesKHR(ResourceTracker* resourceTracker,
+                                                VkMemoryFdPropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_fromhost(
+        (VkDeviceMemory*)nullptr, 0, (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr, 0,
+        (uint32_t*)nullptr, 0, (uint32_t*)&toTransform->memoryTypeBits, 1);
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkMemoryGetFdInfoKHR(ResourceTracker* resourceTracker,
+                                           VkMemoryGetFdInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_tohost((VkDeviceMemory*)&toTransform->memory, 1,
+                                                  (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr,
+                                                  0, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0);
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkMemoryGetFdInfoKHR(ResourceTracker* resourceTracker,
+                                             VkMemoryGetFdInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_fromhost(
+        (VkDeviceMemory*)&toTransform->memory, 1, (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr,
+        0, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0);
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_win32_keyed_mutex
+void transform_tohost_VkWin32KeyedMutexAcquireReleaseInfoKHR(
+    ResourceTracker* resourceTracker, VkWin32KeyedMutexAcquireReleaseInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_tohost((VkDeviceMemory*)toTransform->pReleaseSyncs,
+                                                  toTransform->releaseCount, (VkDeviceSize*)nullptr,
+                                                  0, (VkDeviceSize*)nullptr, 0, (uint32_t*)nullptr,
+                                                  0, (uint32_t*)nullptr, 0);
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkWin32KeyedMutexAcquireReleaseInfoKHR(
+    ResourceTracker* resourceTracker, VkWin32KeyedMutexAcquireReleaseInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_fromhost(
+        (VkDeviceMemory*)toTransform->pReleaseSyncs, toTransform->releaseCount,
+        (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr, 0, (uint32_t*)nullptr, 0,
+        (uint32_t*)nullptr, 0);
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_external_semaphore_capabilities
+#endif
+#ifdef VK_KHR_external_semaphore
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+void transform_tohost_VkImportSemaphoreWin32HandleInfoKHR(
+    ResourceTracker* resourceTracker, VkImportSemaphoreWin32HandleInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkImportSemaphoreWin32HandleInfoKHR(
+    ResourceTracker* resourceTracker, VkImportSemaphoreWin32HandleInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkExportSemaphoreWin32HandleInfoKHR(
+    ResourceTracker* resourceTracker, VkExportSemaphoreWin32HandleInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkExportSemaphoreWin32HandleInfoKHR(
+    ResourceTracker* resourceTracker, VkExportSemaphoreWin32HandleInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkD3D12FenceSubmitInfoKHR(ResourceTracker* resourceTracker,
+                                                VkD3D12FenceSubmitInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkD3D12FenceSubmitInfoKHR(ResourceTracker* resourceTracker,
+                                                  VkD3D12FenceSubmitInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkSemaphoreGetWin32HandleInfoKHR(
+    ResourceTracker* resourceTracker, VkSemaphoreGetWin32HandleInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkSemaphoreGetWin32HandleInfoKHR(
+    ResourceTracker* resourceTracker, VkSemaphoreGetWin32HandleInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_external_semaphore_fd
+void transform_tohost_VkImportSemaphoreFdInfoKHR(ResourceTracker* resourceTracker,
+                                                 VkImportSemaphoreFdInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkImportSemaphoreFdInfoKHR(ResourceTracker* resourceTracker,
+                                                   VkImportSemaphoreFdInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkSemaphoreGetFdInfoKHR(ResourceTracker* resourceTracker,
+                                              VkSemaphoreGetFdInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkSemaphoreGetFdInfoKHR(ResourceTracker* resourceTracker,
+                                                VkSemaphoreGetFdInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_push_descriptor
+void transform_tohost_VkPhysicalDevicePushDescriptorPropertiesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePushDescriptorPropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDevicePushDescriptorPropertiesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePushDescriptorPropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_shader_float16_int8
+#endif
+#ifdef VK_KHR_16bit_storage
+#endif
+#ifdef VK_KHR_incremental_present
+void transform_tohost_VkRectLayerKHR(ResourceTracker* resourceTracker,
+                                     VkRectLayerKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkOffset2D(resourceTracker, (VkOffset2D*)(&toTransform->offset));
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->extent));
+}
+
+void transform_fromhost_VkRectLayerKHR(ResourceTracker* resourceTracker,
+                                       VkRectLayerKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkOffset2D(resourceTracker, (VkOffset2D*)(&toTransform->offset));
+    transform_fromhost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->extent));
+}
+
+void transform_tohost_VkPresentRegionKHR(ResourceTracker* resourceTracker,
+                                         VkPresentRegionKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform) {
+        if (toTransform->pRectangles) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->rectangleCount; ++i) {
+                transform_tohost_VkRectLayerKHR(resourceTracker,
+                                                (VkRectLayerKHR*)(toTransform->pRectangles + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkPresentRegionKHR(ResourceTracker* resourceTracker,
+                                           VkPresentRegionKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform) {
+        if (toTransform->pRectangles) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->rectangleCount; ++i) {
+                transform_fromhost_VkRectLayerKHR(resourceTracker,
+                                                  (VkRectLayerKHR*)(toTransform->pRectangles + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkPresentRegionsKHR(ResourceTracker* resourceTracker,
+                                          VkPresentRegionsKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pRegions) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->swapchainCount; ++i) {
+                transform_tohost_VkPresentRegionKHR(
+                    resourceTracker, (VkPresentRegionKHR*)(toTransform->pRegions + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkPresentRegionsKHR(ResourceTracker* resourceTracker,
+                                            VkPresentRegionsKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pRegions) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->swapchainCount; ++i) {
+                transform_fromhost_VkPresentRegionKHR(
+                    resourceTracker, (VkPresentRegionKHR*)(toTransform->pRegions + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_KHR_descriptor_update_template
+#endif
+#ifdef VK_KHR_imageless_framebuffer
+#endif
+#ifdef VK_KHR_create_renderpass2
+#endif
+#ifdef VK_KHR_shared_presentable_image
+void transform_tohost_VkSharedPresentSurfaceCapabilitiesKHR(
+    ResourceTracker* resourceTracker, VkSharedPresentSurfaceCapabilitiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkSharedPresentSurfaceCapabilitiesKHR(
+    ResourceTracker* resourceTracker, VkSharedPresentSurfaceCapabilitiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_external_fence_capabilities
+#endif
+#ifdef VK_KHR_external_fence
+#endif
+#ifdef VK_KHR_external_fence_win32
+void transform_tohost_VkImportFenceWin32HandleInfoKHR(
+    ResourceTracker* resourceTracker, VkImportFenceWin32HandleInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkImportFenceWin32HandleInfoKHR(
+    ResourceTracker* resourceTracker, VkImportFenceWin32HandleInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkExportFenceWin32HandleInfoKHR(
+    ResourceTracker* resourceTracker, VkExportFenceWin32HandleInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkExportFenceWin32HandleInfoKHR(
+    ResourceTracker* resourceTracker, VkExportFenceWin32HandleInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkFenceGetWin32HandleInfoKHR(ResourceTracker* resourceTracker,
+                                                   VkFenceGetWin32HandleInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkFenceGetWin32HandleInfoKHR(ResourceTracker* resourceTracker,
+                                                     VkFenceGetWin32HandleInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_external_fence_fd
+void transform_tohost_VkImportFenceFdInfoKHR(ResourceTracker* resourceTracker,
+                                             VkImportFenceFdInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkImportFenceFdInfoKHR(ResourceTracker* resourceTracker,
+                                               VkImportFenceFdInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkFenceGetFdInfoKHR(ResourceTracker* resourceTracker,
+                                          VkFenceGetFdInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkFenceGetFdInfoKHR(ResourceTracker* resourceTracker,
+                                            VkFenceGetFdInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_performance_query
+void transform_tohost_VkPhysicalDevicePerformanceQueryFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePerformanceQueryFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDevicePerformanceQueryFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePerformanceQueryFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDevicePerformanceQueryPropertiesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePerformanceQueryPropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDevicePerformanceQueryPropertiesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePerformanceQueryPropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPerformanceCounterKHR(ResourceTracker* resourceTracker,
+                                              VkPerformanceCounterKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPerformanceCounterKHR(ResourceTracker* resourceTracker,
+                                                VkPerformanceCounterKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPerformanceCounterDescriptionKHR(
+    ResourceTracker* resourceTracker, VkPerformanceCounterDescriptionKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPerformanceCounterDescriptionKHR(
+    ResourceTracker* resourceTracker, VkPerformanceCounterDescriptionKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkQueryPoolPerformanceCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkQueryPoolPerformanceCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkQueryPoolPerformanceCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkQueryPoolPerformanceCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPerformanceCounterResultKHR(ResourceTracker* resourceTracker,
+                                                    VkPerformanceCounterResultKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkPerformanceCounterResultKHR(ResourceTracker* resourceTracker,
+                                                      VkPerformanceCounterResultKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkAcquireProfilingLockInfoKHR(ResourceTracker* resourceTracker,
+                                                    VkAcquireProfilingLockInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkAcquireProfilingLockInfoKHR(ResourceTracker* resourceTracker,
+                                                      VkAcquireProfilingLockInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPerformanceQuerySubmitInfoKHR(
+    ResourceTracker* resourceTracker, VkPerformanceQuerySubmitInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPerformanceQuerySubmitInfoKHR(
+    ResourceTracker* resourceTracker, VkPerformanceQuerySubmitInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_maintenance2
+#endif
+#ifdef VK_KHR_get_surface_capabilities2
+void transform_tohost_VkPhysicalDeviceSurfaceInfo2KHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSurfaceInfo2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceSurfaceInfo2KHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSurfaceInfo2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkSurfaceCapabilities2KHR(ResourceTracker* resourceTracker,
+                                                VkSurfaceCapabilities2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkSurfaceCapabilitiesKHR(
+        resourceTracker, (VkSurfaceCapabilitiesKHR*)(&toTransform->surfaceCapabilities));
+}
+
+void transform_fromhost_VkSurfaceCapabilities2KHR(ResourceTracker* resourceTracker,
+                                                  VkSurfaceCapabilities2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkSurfaceCapabilitiesKHR(
+        resourceTracker, (VkSurfaceCapabilitiesKHR*)(&toTransform->surfaceCapabilities));
+}
+
+void transform_tohost_VkSurfaceFormat2KHR(ResourceTracker* resourceTracker,
+                                          VkSurfaceFormat2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkSurfaceFormatKHR(resourceTracker,
+                                        (VkSurfaceFormatKHR*)(&toTransform->surfaceFormat));
+}
+
+void transform_fromhost_VkSurfaceFormat2KHR(ResourceTracker* resourceTracker,
+                                            VkSurfaceFormat2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkSurfaceFormatKHR(resourceTracker,
+                                          (VkSurfaceFormatKHR*)(&toTransform->surfaceFormat));
+}
+
+#endif
+#ifdef VK_KHR_variable_pointers
+#endif
+#ifdef VK_KHR_get_display_properties2
+void transform_tohost_VkDisplayProperties2KHR(ResourceTracker* resourceTracker,
+                                              VkDisplayProperties2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkDisplayPropertiesKHR(
+        resourceTracker, (VkDisplayPropertiesKHR*)(&toTransform->displayProperties));
+}
+
+void transform_fromhost_VkDisplayProperties2KHR(ResourceTracker* resourceTracker,
+                                                VkDisplayProperties2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkDisplayPropertiesKHR(
+        resourceTracker, (VkDisplayPropertiesKHR*)(&toTransform->displayProperties));
+}
+
+void transform_tohost_VkDisplayPlaneProperties2KHR(ResourceTracker* resourceTracker,
+                                                   VkDisplayPlaneProperties2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkDisplayPlanePropertiesKHR(
+        resourceTracker, (VkDisplayPlanePropertiesKHR*)(&toTransform->displayPlaneProperties));
+}
+
+void transform_fromhost_VkDisplayPlaneProperties2KHR(ResourceTracker* resourceTracker,
+                                                     VkDisplayPlaneProperties2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkDisplayPlanePropertiesKHR(
+        resourceTracker, (VkDisplayPlanePropertiesKHR*)(&toTransform->displayPlaneProperties));
+}
+
+void transform_tohost_VkDisplayModeProperties2KHR(ResourceTracker* resourceTracker,
+                                                  VkDisplayModeProperties2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkDisplayModePropertiesKHR(
+        resourceTracker, (VkDisplayModePropertiesKHR*)(&toTransform->displayModeProperties));
+}
+
+void transform_fromhost_VkDisplayModeProperties2KHR(ResourceTracker* resourceTracker,
+                                                    VkDisplayModeProperties2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkDisplayModePropertiesKHR(
+        resourceTracker, (VkDisplayModePropertiesKHR*)(&toTransform->displayModeProperties));
+}
+
+void transform_tohost_VkDisplayPlaneInfo2KHR(ResourceTracker* resourceTracker,
+                                             VkDisplayPlaneInfo2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDisplayPlaneInfo2KHR(ResourceTracker* resourceTracker,
+                                               VkDisplayPlaneInfo2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDisplayPlaneCapabilities2KHR(ResourceTracker* resourceTracker,
+                                                     VkDisplayPlaneCapabilities2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkDisplayPlaneCapabilitiesKHR(
+        resourceTracker, (VkDisplayPlaneCapabilitiesKHR*)(&toTransform->capabilities));
+}
+
+void transform_fromhost_VkDisplayPlaneCapabilities2KHR(
+    ResourceTracker* resourceTracker, VkDisplayPlaneCapabilities2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkDisplayPlaneCapabilitiesKHR(
+        resourceTracker, (VkDisplayPlaneCapabilitiesKHR*)(&toTransform->capabilities));
+}
+
+#endif
+#ifdef VK_KHR_dedicated_allocation
+#endif
+#ifdef VK_KHR_storage_buffer_storage_class
+#endif
+#ifdef VK_KHR_relaxed_block_layout
+#endif
+#ifdef VK_KHR_get_memory_requirements2
+#endif
+#ifdef VK_KHR_image_format_list
+#endif
+#ifdef VK_KHR_sampler_ycbcr_conversion
+#endif
+#ifdef VK_KHR_bind_memory2
+#endif
+#ifdef VK_KHR_portability_subset
+void transform_tohost_VkPhysicalDevicePortabilitySubsetFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePortabilitySubsetFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDevicePortabilitySubsetFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePortabilitySubsetFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDevicePortabilitySubsetPropertiesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePortabilitySubsetPropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDevicePortabilitySubsetPropertiesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePortabilitySubsetPropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_maintenance3
+#endif
+#ifdef VK_KHR_draw_indirect_count
+#endif
+#ifdef VK_KHR_shader_subgroup_extended_types
+#endif
+#ifdef VK_KHR_8bit_storage
+#endif
+#ifdef VK_KHR_shader_atomic_int64
+#endif
+#ifdef VK_KHR_shader_clock
+void transform_tohost_VkPhysicalDeviceShaderClockFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderClockFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceShaderClockFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderClockFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_driver_properties
+#endif
+#ifdef VK_KHR_shader_float_controls
+#endif
+#ifdef VK_KHR_depth_stencil_resolve
+#endif
+#ifdef VK_KHR_swapchain_mutable_format
+#endif
+#ifdef VK_KHR_timeline_semaphore
+#endif
+#ifdef VK_KHR_vulkan_memory_model
+#endif
+#ifdef VK_KHR_shader_terminate_invocation
+void transform_tohost_VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+void transform_tohost_VkFragmentShadingRateAttachmentInfoKHR(
+    ResourceTracker* resourceTracker, VkFragmentShadingRateAttachmentInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pFragmentShadingRateAttachment) {
+        transform_tohost_VkAttachmentReference2(
+            resourceTracker,
+            (VkAttachmentReference2*)(toTransform->pFragmentShadingRateAttachment));
+    }
+    transform_tohost_VkExtent2D(resourceTracker,
+                                (VkExtent2D*)(&toTransform->shadingRateAttachmentTexelSize));
+}
+
+void transform_fromhost_VkFragmentShadingRateAttachmentInfoKHR(
+    ResourceTracker* resourceTracker, VkFragmentShadingRateAttachmentInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pFragmentShadingRateAttachment) {
+        transform_fromhost_VkAttachmentReference2(
+            resourceTracker,
+            (VkAttachmentReference2*)(toTransform->pFragmentShadingRateAttachment));
+    }
+    transform_fromhost_VkExtent2D(resourceTracker,
+                                  (VkExtent2D*)(&toTransform->shadingRateAttachmentTexelSize));
+}
+
+void transform_tohost_VkPipelineFragmentShadingRateStateCreateInfoKHR(
+    ResourceTracker* resourceTracker,
+    VkPipelineFragmentShadingRateStateCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->fragmentSize));
+}
+
+void transform_fromhost_VkPipelineFragmentShadingRateStateCreateInfoKHR(
+    ResourceTracker* resourceTracker,
+    VkPipelineFragmentShadingRateStateCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->fragmentSize));
+}
+
+void transform_tohost_VkPhysicalDeviceFragmentShadingRateFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceFragmentShadingRateFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceFragmentShadingRateFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceFragmentShadingRateFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceFragmentShadingRatePropertiesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceFragmentShadingRatePropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkExtent2D(
+        resourceTracker, (VkExtent2D*)(&toTransform->minFragmentShadingRateAttachmentTexelSize));
+    transform_tohost_VkExtent2D(
+        resourceTracker, (VkExtent2D*)(&toTransform->maxFragmentShadingRateAttachmentTexelSize));
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->maxFragmentSize));
+}
+
+void transform_fromhost_VkPhysicalDeviceFragmentShadingRatePropertiesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceFragmentShadingRatePropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkExtent2D(
+        resourceTracker, (VkExtent2D*)(&toTransform->minFragmentShadingRateAttachmentTexelSize));
+    transform_fromhost_VkExtent2D(
+        resourceTracker, (VkExtent2D*)(&toTransform->maxFragmentShadingRateAttachmentTexelSize));
+    transform_fromhost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->maxFragmentSize));
+}
+
+void transform_tohost_VkPhysicalDeviceFragmentShadingRateKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceFragmentShadingRateKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->fragmentSize));
+}
+
+void transform_fromhost_VkPhysicalDeviceFragmentShadingRateKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceFragmentShadingRateKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->fragmentSize));
+}
+
+#endif
+#ifdef VK_KHR_spirv_1_4
+#endif
+#ifdef VK_KHR_surface_protected_capabilities
+void transform_tohost_VkSurfaceProtectedCapabilitiesKHR(
+    ResourceTracker* resourceTracker, VkSurfaceProtectedCapabilitiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkSurfaceProtectedCapabilitiesKHR(
+    ResourceTracker* resourceTracker, VkSurfaceProtectedCapabilitiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_separate_depth_stencil_layouts
+#endif
+#ifdef VK_KHR_present_wait
+void transform_tohost_VkPhysicalDevicePresentWaitFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePresentWaitFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDevicePresentWaitFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePresentWaitFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_uniform_buffer_standard_layout
+#endif
+#ifdef VK_KHR_buffer_device_address
+#endif
+#ifdef VK_KHR_deferred_host_operations
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+void transform_tohost_VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPipelineInfoKHR(ResourceTracker* resourceTracker,
+                                        VkPipelineInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPipelineInfoKHR(ResourceTracker* resourceTracker,
+                                          VkPipelineInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPipelineExecutablePropertiesKHR(
+    ResourceTracker* resourceTracker, VkPipelineExecutablePropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPipelineExecutablePropertiesKHR(
+    ResourceTracker* resourceTracker, VkPipelineExecutablePropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPipelineExecutableInfoKHR(ResourceTracker* resourceTracker,
+                                                  VkPipelineExecutableInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPipelineExecutableInfoKHR(ResourceTracker* resourceTracker,
+                                                    VkPipelineExecutableInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPipelineExecutableStatisticValueKHR(
+    ResourceTracker* resourceTracker, VkPipelineExecutableStatisticValueKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkPipelineExecutableStatisticValueKHR(
+    ResourceTracker* resourceTracker, VkPipelineExecutableStatisticValueKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkPipelineExecutableStatisticKHR(
+    ResourceTracker* resourceTracker, VkPipelineExecutableStatisticKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkPipelineExecutableStatisticValueKHR(
+        resourceTracker, (VkPipelineExecutableStatisticValueKHR*)(&toTransform->value));
+}
+
+void transform_fromhost_VkPipelineExecutableStatisticKHR(
+    ResourceTracker* resourceTracker, VkPipelineExecutableStatisticKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkPipelineExecutableStatisticValueKHR(
+        resourceTracker, (VkPipelineExecutableStatisticValueKHR*)(&toTransform->value));
+}
+
+void transform_tohost_VkPipelineExecutableInternalRepresentationKHR(
+    ResourceTracker* resourceTracker, VkPipelineExecutableInternalRepresentationKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPipelineExecutableInternalRepresentationKHR(
+    ResourceTracker* resourceTracker, VkPipelineExecutableInternalRepresentationKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_shader_integer_dot_product
+void transform_tohost_VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_pipeline_library
+void transform_tohost_VkPipelineLibraryCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                     VkPipelineLibraryCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPipelineLibraryCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkPipelineLibraryCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_shader_non_semantic_info
+#endif
+#ifdef VK_KHR_present_id
+void transform_tohost_VkPresentIdKHR(ResourceTracker* resourceTracker,
+                                     VkPresentIdKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPresentIdKHR(ResourceTracker* resourceTracker,
+                                       VkPresentIdKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDevicePresentIdFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePresentIdFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDevicePresentIdFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePresentIdFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_video_encode_queue
+void transform_tohost_VkVideoEncodeInfoKHR(ResourceTracker* resourceTracker,
+                                           VkVideoEncodeInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->codedExtent));
+    transform_tohost_VkVideoPictureResourceKHR(
+        resourceTracker, (VkVideoPictureResourceKHR*)(&toTransform->srcPictureResource));
+    if (toTransform->pSetupReferenceSlot) {
+        transform_tohost_VkVideoReferenceSlotKHR(
+            resourceTracker, (VkVideoReferenceSlotKHR*)(toTransform->pSetupReferenceSlot));
+    }
+    if (toTransform) {
+        if (toTransform->pReferenceSlots) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->referenceSlotCount; ++i) {
+                transform_tohost_VkVideoReferenceSlotKHR(
+                    resourceTracker, (VkVideoReferenceSlotKHR*)(toTransform->pReferenceSlots + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkVideoEncodeInfoKHR(ResourceTracker* resourceTracker,
+                                             VkVideoEncodeInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->codedExtent));
+    transform_fromhost_VkVideoPictureResourceKHR(
+        resourceTracker, (VkVideoPictureResourceKHR*)(&toTransform->srcPictureResource));
+    if (toTransform->pSetupReferenceSlot) {
+        transform_fromhost_VkVideoReferenceSlotKHR(
+            resourceTracker, (VkVideoReferenceSlotKHR*)(toTransform->pSetupReferenceSlot));
+    }
+    if (toTransform) {
+        if (toTransform->pReferenceSlots) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->referenceSlotCount; ++i) {
+                transform_fromhost_VkVideoReferenceSlotKHR(
+                    resourceTracker, (VkVideoReferenceSlotKHR*)(toTransform->pReferenceSlots + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkVideoEncodeRateControlInfoKHR(
+    ResourceTracker* resourceTracker, VkVideoEncodeRateControlInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkVideoEncodeRateControlInfoKHR(
+    ResourceTracker* resourceTracker, VkVideoEncodeRateControlInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_synchronization2
+void transform_tohost_VkMemoryBarrier2KHR(ResourceTracker* resourceTracker,
+                                          VkMemoryBarrier2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkMemoryBarrier2KHR(ResourceTracker* resourceTracker,
+                                            VkMemoryBarrier2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkBufferMemoryBarrier2KHR(ResourceTracker* resourceTracker,
+                                                VkBufferMemoryBarrier2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkBufferMemoryBarrier2KHR(ResourceTracker* resourceTracker,
+                                                  VkBufferMemoryBarrier2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkImageMemoryBarrier2KHR(ResourceTracker* resourceTracker,
+                                               VkImageMemoryBarrier2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkImageSubresourceRange(
+        resourceTracker, (VkImageSubresourceRange*)(&toTransform->subresourceRange));
+}
+
+void transform_fromhost_VkImageMemoryBarrier2KHR(ResourceTracker* resourceTracker,
+                                                 VkImageMemoryBarrier2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkImageSubresourceRange(
+        resourceTracker, (VkImageSubresourceRange*)(&toTransform->subresourceRange));
+}
+
+void transform_tohost_VkDependencyInfoKHR(ResourceTracker* resourceTracker,
+                                          VkDependencyInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pMemoryBarriers) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->memoryBarrierCount; ++i) {
+                transform_tohost_VkMemoryBarrier2KHR(
+                    resourceTracker, (VkMemoryBarrier2KHR*)(toTransform->pMemoryBarriers + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pBufferMemoryBarriers) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->bufferMemoryBarrierCount; ++i) {
+                transform_tohost_VkBufferMemoryBarrier2KHR(
+                    resourceTracker,
+                    (VkBufferMemoryBarrier2KHR*)(toTransform->pBufferMemoryBarriers + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pImageMemoryBarriers) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->imageMemoryBarrierCount; ++i) {
+                transform_tohost_VkImageMemoryBarrier2KHR(
+                    resourceTracker,
+                    (VkImageMemoryBarrier2KHR*)(toTransform->pImageMemoryBarriers + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkDependencyInfoKHR(ResourceTracker* resourceTracker,
+                                            VkDependencyInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pMemoryBarriers) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->memoryBarrierCount; ++i) {
+                transform_fromhost_VkMemoryBarrier2KHR(
+                    resourceTracker, (VkMemoryBarrier2KHR*)(toTransform->pMemoryBarriers + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pBufferMemoryBarriers) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->bufferMemoryBarrierCount; ++i) {
+                transform_fromhost_VkBufferMemoryBarrier2KHR(
+                    resourceTracker,
+                    (VkBufferMemoryBarrier2KHR*)(toTransform->pBufferMemoryBarriers + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pImageMemoryBarriers) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->imageMemoryBarrierCount; ++i) {
+                transform_fromhost_VkImageMemoryBarrier2KHR(
+                    resourceTracker,
+                    (VkImageMemoryBarrier2KHR*)(toTransform->pImageMemoryBarriers + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkSemaphoreSubmitInfoKHR(ResourceTracker* resourceTracker,
+                                               VkSemaphoreSubmitInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkSemaphoreSubmitInfoKHR(ResourceTracker* resourceTracker,
+                                                 VkSemaphoreSubmitInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkCommandBufferSubmitInfoKHR(ResourceTracker* resourceTracker,
+                                                   VkCommandBufferSubmitInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkCommandBufferSubmitInfoKHR(ResourceTracker* resourceTracker,
+                                                     VkCommandBufferSubmitInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkSubmitInfo2KHR(ResourceTracker* resourceTracker,
+                                       VkSubmitInfo2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pWaitSemaphoreInfos) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->waitSemaphoreInfoCount; ++i) {
+                transform_tohost_VkSemaphoreSubmitInfoKHR(
+                    resourceTracker,
+                    (VkSemaphoreSubmitInfoKHR*)(toTransform->pWaitSemaphoreInfos + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pCommandBufferInfos) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->commandBufferInfoCount; ++i) {
+                transform_tohost_VkCommandBufferSubmitInfoKHR(
+                    resourceTracker,
+                    (VkCommandBufferSubmitInfoKHR*)(toTransform->pCommandBufferInfos + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pSignalSemaphoreInfos) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->signalSemaphoreInfoCount; ++i) {
+                transform_tohost_VkSemaphoreSubmitInfoKHR(
+                    resourceTracker,
+                    (VkSemaphoreSubmitInfoKHR*)(toTransform->pSignalSemaphoreInfos + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkSubmitInfo2KHR(ResourceTracker* resourceTracker,
+                                         VkSubmitInfo2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pWaitSemaphoreInfos) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->waitSemaphoreInfoCount; ++i) {
+                transform_fromhost_VkSemaphoreSubmitInfoKHR(
+                    resourceTracker,
+                    (VkSemaphoreSubmitInfoKHR*)(toTransform->pWaitSemaphoreInfos + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pCommandBufferInfos) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->commandBufferInfoCount; ++i) {
+                transform_fromhost_VkCommandBufferSubmitInfoKHR(
+                    resourceTracker,
+                    (VkCommandBufferSubmitInfoKHR*)(toTransform->pCommandBufferInfos + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pSignalSemaphoreInfos) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->signalSemaphoreInfoCount; ++i) {
+                transform_fromhost_VkSemaphoreSubmitInfoKHR(
+                    resourceTracker,
+                    (VkSemaphoreSubmitInfoKHR*)(toTransform->pSignalSemaphoreInfos + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceSynchronization2FeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSynchronization2FeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceSynchronization2FeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSynchronization2FeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkQueueFamilyCheckpointProperties2NV(
+    ResourceTracker* resourceTracker, VkQueueFamilyCheckpointProperties2NV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkQueueFamilyCheckpointProperties2NV(
+    ResourceTracker* resourceTracker, VkQueueFamilyCheckpointProperties2NV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkCheckpointData2NV(ResourceTracker* resourceTracker,
+                                          VkCheckpointData2NV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkCheckpointData2NV(ResourceTracker* resourceTracker,
+                                            VkCheckpointData2NV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_shader_subgroup_uniform_control_flow
+void transform_tohost_VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_zero_initialize_workgroup_memory
+void transform_tohost_VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_workgroup_memory_explicit_layout
+void transform_tohost_VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_copy_commands2
+void transform_tohost_VkBufferCopy2KHR(ResourceTracker* resourceTracker,
+                                       VkBufferCopy2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkBufferCopy2KHR(ResourceTracker* resourceTracker,
+                                         VkBufferCopy2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkCopyBufferInfo2KHR(ResourceTracker* resourceTracker,
+                                           VkCopyBufferInfo2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pRegions) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->regionCount; ++i) {
+                transform_tohost_VkBufferCopy2KHR(resourceTracker,
+                                                  (VkBufferCopy2KHR*)(toTransform->pRegions + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkCopyBufferInfo2KHR(ResourceTracker* resourceTracker,
+                                             VkCopyBufferInfo2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pRegions) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->regionCount; ++i) {
+                transform_fromhost_VkBufferCopy2KHR(resourceTracker,
+                                                    (VkBufferCopy2KHR*)(toTransform->pRegions + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkImageCopy2KHR(ResourceTracker* resourceTracker,
+                                      VkImageCopy2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkImageSubresourceLayers(
+        resourceTracker, (VkImageSubresourceLayers*)(&toTransform->srcSubresource));
+    transform_tohost_VkOffset3D(resourceTracker, (VkOffset3D*)(&toTransform->srcOffset));
+    transform_tohost_VkImageSubresourceLayers(
+        resourceTracker, (VkImageSubresourceLayers*)(&toTransform->dstSubresource));
+    transform_tohost_VkOffset3D(resourceTracker, (VkOffset3D*)(&toTransform->dstOffset));
+    transform_tohost_VkExtent3D(resourceTracker, (VkExtent3D*)(&toTransform->extent));
+}
+
+void transform_fromhost_VkImageCopy2KHR(ResourceTracker* resourceTracker,
+                                        VkImageCopy2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkImageSubresourceLayers(
+        resourceTracker, (VkImageSubresourceLayers*)(&toTransform->srcSubresource));
+    transform_fromhost_VkOffset3D(resourceTracker, (VkOffset3D*)(&toTransform->srcOffset));
+    transform_fromhost_VkImageSubresourceLayers(
+        resourceTracker, (VkImageSubresourceLayers*)(&toTransform->dstSubresource));
+    transform_fromhost_VkOffset3D(resourceTracker, (VkOffset3D*)(&toTransform->dstOffset));
+    transform_fromhost_VkExtent3D(resourceTracker, (VkExtent3D*)(&toTransform->extent));
+}
+
+void transform_tohost_VkCopyImageInfo2KHR(ResourceTracker* resourceTracker,
+                                          VkCopyImageInfo2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pRegions) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->regionCount; ++i) {
+                transform_tohost_VkImageCopy2KHR(resourceTracker,
+                                                 (VkImageCopy2KHR*)(toTransform->pRegions + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkCopyImageInfo2KHR(ResourceTracker* resourceTracker,
+                                            VkCopyImageInfo2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pRegions) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->regionCount; ++i) {
+                transform_fromhost_VkImageCopy2KHR(resourceTracker,
+                                                   (VkImageCopy2KHR*)(toTransform->pRegions + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkBufferImageCopy2KHR(ResourceTracker* resourceTracker,
+                                            VkBufferImageCopy2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkImageSubresourceLayers(
+        resourceTracker, (VkImageSubresourceLayers*)(&toTransform->imageSubresource));
+    transform_tohost_VkOffset3D(resourceTracker, (VkOffset3D*)(&toTransform->imageOffset));
+    transform_tohost_VkExtent3D(resourceTracker, (VkExtent3D*)(&toTransform->imageExtent));
+}
+
+void transform_fromhost_VkBufferImageCopy2KHR(ResourceTracker* resourceTracker,
+                                              VkBufferImageCopy2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkImageSubresourceLayers(
+        resourceTracker, (VkImageSubresourceLayers*)(&toTransform->imageSubresource));
+    transform_fromhost_VkOffset3D(resourceTracker, (VkOffset3D*)(&toTransform->imageOffset));
+    transform_fromhost_VkExtent3D(resourceTracker, (VkExtent3D*)(&toTransform->imageExtent));
+}
+
+void transform_tohost_VkCopyBufferToImageInfo2KHR(ResourceTracker* resourceTracker,
+                                                  VkCopyBufferToImageInfo2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pRegions) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->regionCount; ++i) {
+                transform_tohost_VkBufferImageCopy2KHR(
+                    resourceTracker, (VkBufferImageCopy2KHR*)(toTransform->pRegions + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkCopyBufferToImageInfo2KHR(ResourceTracker* resourceTracker,
+                                                    VkCopyBufferToImageInfo2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pRegions) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->regionCount; ++i) {
+                transform_fromhost_VkBufferImageCopy2KHR(
+                    resourceTracker, (VkBufferImageCopy2KHR*)(toTransform->pRegions + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkCopyImageToBufferInfo2KHR(ResourceTracker* resourceTracker,
+                                                  VkCopyImageToBufferInfo2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pRegions) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->regionCount; ++i) {
+                transform_tohost_VkBufferImageCopy2KHR(
+                    resourceTracker, (VkBufferImageCopy2KHR*)(toTransform->pRegions + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkCopyImageToBufferInfo2KHR(ResourceTracker* resourceTracker,
+                                                    VkCopyImageToBufferInfo2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pRegions) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->regionCount; ++i) {
+                transform_fromhost_VkBufferImageCopy2KHR(
+                    resourceTracker, (VkBufferImageCopy2KHR*)(toTransform->pRegions + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkImageBlit2KHR(ResourceTracker* resourceTracker,
+                                      VkImageBlit2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkImageSubresourceLayers(
+        resourceTracker, (VkImageSubresourceLayers*)(&toTransform->srcSubresource));
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        transform_tohost_VkOffset3D(resourceTracker, (VkOffset3D*)(toTransform->srcOffsets + i));
+    }
+    transform_tohost_VkImageSubresourceLayers(
+        resourceTracker, (VkImageSubresourceLayers*)(&toTransform->dstSubresource));
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        transform_tohost_VkOffset3D(resourceTracker, (VkOffset3D*)(toTransform->dstOffsets + i));
+    }
+}
+
+void transform_fromhost_VkImageBlit2KHR(ResourceTracker* resourceTracker,
+                                        VkImageBlit2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkImageSubresourceLayers(
+        resourceTracker, (VkImageSubresourceLayers*)(&toTransform->srcSubresource));
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        transform_fromhost_VkOffset3D(resourceTracker, (VkOffset3D*)(toTransform->srcOffsets + i));
+    }
+    transform_fromhost_VkImageSubresourceLayers(
+        resourceTracker, (VkImageSubresourceLayers*)(&toTransform->dstSubresource));
+    for (uint32_t i = 0; i < (uint32_t)2; ++i) {
+        transform_fromhost_VkOffset3D(resourceTracker, (VkOffset3D*)(toTransform->dstOffsets + i));
+    }
+}
+
+void transform_tohost_VkBlitImageInfo2KHR(ResourceTracker* resourceTracker,
+                                          VkBlitImageInfo2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pRegions) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->regionCount; ++i) {
+                transform_tohost_VkImageBlit2KHR(resourceTracker,
+                                                 (VkImageBlit2KHR*)(toTransform->pRegions + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkBlitImageInfo2KHR(ResourceTracker* resourceTracker,
+                                            VkBlitImageInfo2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pRegions) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->regionCount; ++i) {
+                transform_fromhost_VkImageBlit2KHR(resourceTracker,
+                                                   (VkImageBlit2KHR*)(toTransform->pRegions + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkImageResolve2KHR(ResourceTracker* resourceTracker,
+                                         VkImageResolve2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkImageSubresourceLayers(
+        resourceTracker, (VkImageSubresourceLayers*)(&toTransform->srcSubresource));
+    transform_tohost_VkOffset3D(resourceTracker, (VkOffset3D*)(&toTransform->srcOffset));
+    transform_tohost_VkImageSubresourceLayers(
+        resourceTracker, (VkImageSubresourceLayers*)(&toTransform->dstSubresource));
+    transform_tohost_VkOffset3D(resourceTracker, (VkOffset3D*)(&toTransform->dstOffset));
+    transform_tohost_VkExtent3D(resourceTracker, (VkExtent3D*)(&toTransform->extent));
+}
+
+void transform_fromhost_VkImageResolve2KHR(ResourceTracker* resourceTracker,
+                                           VkImageResolve2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkImageSubresourceLayers(
+        resourceTracker, (VkImageSubresourceLayers*)(&toTransform->srcSubresource));
+    transform_fromhost_VkOffset3D(resourceTracker, (VkOffset3D*)(&toTransform->srcOffset));
+    transform_fromhost_VkImageSubresourceLayers(
+        resourceTracker, (VkImageSubresourceLayers*)(&toTransform->dstSubresource));
+    transform_fromhost_VkOffset3D(resourceTracker, (VkOffset3D*)(&toTransform->dstOffset));
+    transform_fromhost_VkExtent3D(resourceTracker, (VkExtent3D*)(&toTransform->extent));
+}
+
+void transform_tohost_VkResolveImageInfo2KHR(ResourceTracker* resourceTracker,
+                                             VkResolveImageInfo2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pRegions) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->regionCount; ++i) {
+                transform_tohost_VkImageResolve2KHR(
+                    resourceTracker, (VkImageResolve2KHR*)(toTransform->pRegions + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkResolveImageInfo2KHR(ResourceTracker* resourceTracker,
+                                               VkResolveImageInfo2KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pRegions) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->regionCount; ++i) {
+                transform_fromhost_VkImageResolve2KHR(
+                    resourceTracker, (VkImageResolve2KHR*)(toTransform->pRegions + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_KHR_format_feature_flags2
+void transform_tohost_VkFormatProperties3KHR(ResourceTracker* resourceTracker,
+                                             VkFormatProperties3KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkFormatProperties3KHR(ResourceTracker* resourceTracker,
+                                               VkFormatProperties3KHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_maintenance4
+void transform_tohost_VkPhysicalDeviceMaintenance4FeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMaintenance4FeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceMaintenance4FeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMaintenance4FeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceMaintenance4PropertiesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMaintenance4PropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceMaintenance4PropertiesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMaintenance4PropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDeviceBufferMemoryRequirementsKHR(
+    ResourceTracker* resourceTracker, VkDeviceBufferMemoryRequirementsKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pCreateInfo) {
+        transform_tohost_VkBufferCreateInfo(resourceTracker,
+                                            (VkBufferCreateInfo*)(toTransform->pCreateInfo));
+    }
+}
+
+void transform_fromhost_VkDeviceBufferMemoryRequirementsKHR(
+    ResourceTracker* resourceTracker, VkDeviceBufferMemoryRequirementsKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pCreateInfo) {
+        transform_fromhost_VkBufferCreateInfo(resourceTracker,
+                                              (VkBufferCreateInfo*)(toTransform->pCreateInfo));
+    }
+}
+
+void transform_tohost_VkDeviceImageMemoryRequirementsKHR(
+    ResourceTracker* resourceTracker, VkDeviceImageMemoryRequirementsKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pCreateInfo) {
+        resourceTracker->transformImpl_VkImageCreateInfo_tohost(toTransform->pCreateInfo, 1);
+        transform_tohost_VkImageCreateInfo(resourceTracker,
+                                           (VkImageCreateInfo*)(toTransform->pCreateInfo));
+    }
+}
+
+void transform_fromhost_VkDeviceImageMemoryRequirementsKHR(
+    ResourceTracker* resourceTracker, VkDeviceImageMemoryRequirementsKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pCreateInfo) {
+        resourceTracker->transformImpl_VkImageCreateInfo_fromhost(toTransform->pCreateInfo, 1);
+        transform_fromhost_VkImageCreateInfo(resourceTracker,
+                                             (VkImageCreateInfo*)(toTransform->pCreateInfo));
+    }
+}
+
+#endif
+#ifdef VK_ANDROID_native_buffer
+void transform_tohost_VkNativeBufferANDROID(ResourceTracker* resourceTracker,
+                                            VkNativeBufferANDROID* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkNativeBufferANDROID(ResourceTracker* resourceTracker,
+                                              VkNativeBufferANDROID* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_debug_report
+void transform_tohost_VkDebugReportCallbackCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkDebugReportCallbackCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDebugReportCallbackCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkDebugReportCallbackCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_glsl_shader
+#endif
+#ifdef VK_EXT_depth_range_unrestricted
+#endif
+#ifdef VK_IMG_filter_cubic
+#endif
+#ifdef VK_AMD_rasterization_order
+void transform_tohost_VkPipelineRasterizationStateRasterizationOrderAMD(
+    ResourceTracker* resourceTracker,
+    VkPipelineRasterizationStateRasterizationOrderAMD* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPipelineRasterizationStateRasterizationOrderAMD(
+    ResourceTracker* resourceTracker,
+    VkPipelineRasterizationStateRasterizationOrderAMD* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_shader_trinary_minmax
+#endif
+#ifdef VK_AMD_shader_explicit_vertex_parameter
+#endif
+#ifdef VK_EXT_debug_marker
+void transform_tohost_VkDebugMarkerObjectNameInfoEXT(ResourceTracker* resourceTracker,
+                                                     VkDebugMarkerObjectNameInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDebugMarkerObjectNameInfoEXT(
+    ResourceTracker* resourceTracker, VkDebugMarkerObjectNameInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDebugMarkerObjectTagInfoEXT(ResourceTracker* resourceTracker,
+                                                    VkDebugMarkerObjectTagInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDebugMarkerObjectTagInfoEXT(ResourceTracker* resourceTracker,
+                                                      VkDebugMarkerObjectTagInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDebugMarkerMarkerInfoEXT(ResourceTracker* resourceTracker,
+                                                 VkDebugMarkerMarkerInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDebugMarkerMarkerInfoEXT(ResourceTracker* resourceTracker,
+                                                   VkDebugMarkerMarkerInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_gcn_shader
+#endif
+#ifdef VK_NV_dedicated_allocation
+void transform_tohost_VkDedicatedAllocationImageCreateInfoNV(
+    ResourceTracker* resourceTracker, VkDedicatedAllocationImageCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDedicatedAllocationImageCreateInfoNV(
+    ResourceTracker* resourceTracker, VkDedicatedAllocationImageCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDedicatedAllocationBufferCreateInfoNV(
+    ResourceTracker* resourceTracker, VkDedicatedAllocationBufferCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDedicatedAllocationBufferCreateInfoNV(
+    ResourceTracker* resourceTracker, VkDedicatedAllocationBufferCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDedicatedAllocationMemoryAllocateInfoNV(
+    ResourceTracker* resourceTracker, VkDedicatedAllocationMemoryAllocateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDedicatedAllocationMemoryAllocateInfoNV(
+    ResourceTracker* resourceTracker, VkDedicatedAllocationMemoryAllocateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_transform_feedback
+void transform_tohost_VkPhysicalDeviceTransformFeedbackFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceTransformFeedbackFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceTransformFeedbackFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceTransformFeedbackFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceTransformFeedbackPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceTransformFeedbackPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceTransformFeedbackPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceTransformFeedbackPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPipelineRasterizationStateStreamCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkPipelineRasterizationStateStreamCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPipelineRasterizationStateStreamCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkPipelineRasterizationStateStreamCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NVX_binary_import
+void transform_tohost_VkCuModuleCreateInfoNVX(ResourceTracker* resourceTracker,
+                                              VkCuModuleCreateInfoNVX* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkCuModuleCreateInfoNVX(ResourceTracker* resourceTracker,
+                                                VkCuModuleCreateInfoNVX* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkCuFunctionCreateInfoNVX(ResourceTracker* resourceTracker,
+                                                VkCuFunctionCreateInfoNVX* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkCuFunctionCreateInfoNVX(ResourceTracker* resourceTracker,
+                                                  VkCuFunctionCreateInfoNVX* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkCuLaunchInfoNVX(ResourceTracker* resourceTracker,
+                                        VkCuLaunchInfoNVX* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkCuLaunchInfoNVX(ResourceTracker* resourceTracker,
+                                          VkCuLaunchInfoNVX* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NVX_image_view_handle
+void transform_tohost_VkImageViewHandleInfoNVX(ResourceTracker* resourceTracker,
+                                               VkImageViewHandleInfoNVX* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkImageViewHandleInfoNVX(ResourceTracker* resourceTracker,
+                                                 VkImageViewHandleInfoNVX* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkImageViewAddressPropertiesNVX(
+    ResourceTracker* resourceTracker, VkImageViewAddressPropertiesNVX* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkImageViewAddressPropertiesNVX(
+    ResourceTracker* resourceTracker, VkImageViewAddressPropertiesNVX* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_draw_indirect_count
+#endif
+#ifdef VK_AMD_negative_viewport_height
+#endif
+#ifdef VK_AMD_gpu_shader_half_float
+#endif
+#ifdef VK_AMD_shader_ballot
+#endif
+#ifdef VK_EXT_video_encode_h264
+void transform_tohost_VkVideoEncodeH264CapabilitiesEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH264CapabilitiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->minPictureSizeInMbs));
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->maxPictureSizeInMbs));
+    transform_tohost_VkExtent2D(resourceTracker,
+                                (VkExtent2D*)(&toTransform->inputImageDataAlignment));
+    transform_tohost_VkExtensionProperties(
+        resourceTracker, (VkExtensionProperties*)(&toTransform->stdExtensionVersion));
+}
+
+void transform_fromhost_VkVideoEncodeH264CapabilitiesEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH264CapabilitiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkExtent2D(resourceTracker,
+                                  (VkExtent2D*)(&toTransform->minPictureSizeInMbs));
+    transform_fromhost_VkExtent2D(resourceTracker,
+                                  (VkExtent2D*)(&toTransform->maxPictureSizeInMbs));
+    transform_fromhost_VkExtent2D(resourceTracker,
+                                  (VkExtent2D*)(&toTransform->inputImageDataAlignment));
+    transform_fromhost_VkExtensionProperties(
+        resourceTracker, (VkExtensionProperties*)(&toTransform->stdExtensionVersion));
+}
+
+void transform_tohost_VkVideoEncodeH264SessionCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH264SessionCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->maxPictureSizeInMbs));
+    if (toTransform->pStdExtensionVersion) {
+        transform_tohost_VkExtensionProperties(
+            resourceTracker, (VkExtensionProperties*)(toTransform->pStdExtensionVersion));
+    }
+}
+
+void transform_fromhost_VkVideoEncodeH264SessionCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH264SessionCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkExtent2D(resourceTracker,
+                                  (VkExtent2D*)(&toTransform->maxPictureSizeInMbs));
+    if (toTransform->pStdExtensionVersion) {
+        transform_fromhost_VkExtensionProperties(
+            resourceTracker, (VkExtensionProperties*)(toTransform->pStdExtensionVersion));
+    }
+}
+
+void transform_tohost_VkVideoEncodeH264SessionParametersAddInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH264SessionParametersAddInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkVideoEncodeH264SessionParametersAddInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH264SessionParametersAddInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkVideoEncodeH264SessionParametersCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkVideoEncodeH264SessionParametersCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pParametersAddInfo) {
+        transform_tohost_VkVideoEncodeH264SessionParametersAddInfoEXT(
+            resourceTracker,
+            (VkVideoEncodeH264SessionParametersAddInfoEXT*)(toTransform->pParametersAddInfo));
+    }
+}
+
+void transform_fromhost_VkVideoEncodeH264SessionParametersCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkVideoEncodeH264SessionParametersCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pParametersAddInfo) {
+        transform_fromhost_VkVideoEncodeH264SessionParametersAddInfoEXT(
+            resourceTracker,
+            (VkVideoEncodeH264SessionParametersAddInfoEXT*)(toTransform->pParametersAddInfo));
+    }
+}
+
+void transform_tohost_VkVideoEncodeH264DpbSlotInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH264DpbSlotInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkVideoEncodeH264DpbSlotInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH264DpbSlotInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkVideoEncodeH264NaluSliceEXT(ResourceTracker* resourceTracker,
+                                                    VkVideoEncodeH264NaluSliceEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pRefFinalList0Entries) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->refFinalList0EntryCount; ++i) {
+                transform_tohost_VkVideoEncodeH264DpbSlotInfoEXT(
+                    resourceTracker,
+                    (VkVideoEncodeH264DpbSlotInfoEXT*)(toTransform->pRefFinalList0Entries + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pRefFinalList1Entries) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->refFinalList1EntryCount; ++i) {
+                transform_tohost_VkVideoEncodeH264DpbSlotInfoEXT(
+                    resourceTracker,
+                    (VkVideoEncodeH264DpbSlotInfoEXT*)(toTransform->pRefFinalList1Entries + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkVideoEncodeH264NaluSliceEXT(ResourceTracker* resourceTracker,
+                                                      VkVideoEncodeH264NaluSliceEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pRefFinalList0Entries) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->refFinalList0EntryCount; ++i) {
+                transform_fromhost_VkVideoEncodeH264DpbSlotInfoEXT(
+                    resourceTracker,
+                    (VkVideoEncodeH264DpbSlotInfoEXT*)(toTransform->pRefFinalList0Entries + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pRefFinalList1Entries) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->refFinalList1EntryCount; ++i) {
+                transform_fromhost_VkVideoEncodeH264DpbSlotInfoEXT(
+                    resourceTracker,
+                    (VkVideoEncodeH264DpbSlotInfoEXT*)(toTransform->pRefFinalList1Entries + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkVideoEncodeH264VclFrameInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH264VclFrameInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pRefDefaultFinalList0Entries) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->refDefaultFinalList0EntryCount; ++i) {
+                transform_tohost_VkVideoEncodeH264DpbSlotInfoEXT(
+                    resourceTracker,
+                    (VkVideoEncodeH264DpbSlotInfoEXT*)(toTransform->pRefDefaultFinalList0Entries +
+                                                       i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pRefDefaultFinalList1Entries) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->refDefaultFinalList1EntryCount; ++i) {
+                transform_tohost_VkVideoEncodeH264DpbSlotInfoEXT(
+                    resourceTracker,
+                    (VkVideoEncodeH264DpbSlotInfoEXT*)(toTransform->pRefDefaultFinalList1Entries +
+                                                       i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pNaluSliceEntries) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->naluSliceEntryCount; ++i) {
+                transform_tohost_VkVideoEncodeH264NaluSliceEXT(
+                    resourceTracker,
+                    (VkVideoEncodeH264NaluSliceEXT*)(toTransform->pNaluSliceEntries + i));
+            }
+        }
+    }
+    if (toTransform->pCurrentPictureInfo) {
+        transform_tohost_VkVideoEncodeH264DpbSlotInfoEXT(
+            resourceTracker, (VkVideoEncodeH264DpbSlotInfoEXT*)(toTransform->pCurrentPictureInfo));
+    }
+}
+
+void transform_fromhost_VkVideoEncodeH264VclFrameInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH264VclFrameInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pRefDefaultFinalList0Entries) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->refDefaultFinalList0EntryCount; ++i) {
+                transform_fromhost_VkVideoEncodeH264DpbSlotInfoEXT(
+                    resourceTracker,
+                    (VkVideoEncodeH264DpbSlotInfoEXT*)(toTransform->pRefDefaultFinalList0Entries +
+                                                       i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pRefDefaultFinalList1Entries) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->refDefaultFinalList1EntryCount; ++i) {
+                transform_fromhost_VkVideoEncodeH264DpbSlotInfoEXT(
+                    resourceTracker,
+                    (VkVideoEncodeH264DpbSlotInfoEXT*)(toTransform->pRefDefaultFinalList1Entries +
+                                                       i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pNaluSliceEntries) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->naluSliceEntryCount; ++i) {
+                transform_fromhost_VkVideoEncodeH264NaluSliceEXT(
+                    resourceTracker,
+                    (VkVideoEncodeH264NaluSliceEXT*)(toTransform->pNaluSliceEntries + i));
+            }
+        }
+    }
+    if (toTransform->pCurrentPictureInfo) {
+        transform_fromhost_VkVideoEncodeH264DpbSlotInfoEXT(
+            resourceTracker, (VkVideoEncodeH264DpbSlotInfoEXT*)(toTransform->pCurrentPictureInfo));
+    }
+}
+
+void transform_tohost_VkVideoEncodeH264EmitPictureParametersEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH264EmitPictureParametersEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkVideoEncodeH264EmitPictureParametersEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH264EmitPictureParametersEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkVideoEncodeH264ProfileEXT(ResourceTracker* resourceTracker,
+                                                  VkVideoEncodeH264ProfileEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkVideoEncodeH264ProfileEXT(ResourceTracker* resourceTracker,
+                                                    VkVideoEncodeH264ProfileEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_video_encode_h265
+void transform_tohost_VkVideoEncodeH265CapabilitiesEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH265CapabilitiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkExtent2D(resourceTracker,
+                                (VkExtent2D*)(&toTransform->inputImageDataAlignment));
+    transform_tohost_VkExtensionProperties(
+        resourceTracker, (VkExtensionProperties*)(&toTransform->stdExtensionVersion));
+}
+
+void transform_fromhost_VkVideoEncodeH265CapabilitiesEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH265CapabilitiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkExtent2D(resourceTracker,
+                                  (VkExtent2D*)(&toTransform->inputImageDataAlignment));
+    transform_fromhost_VkExtensionProperties(
+        resourceTracker, (VkExtensionProperties*)(&toTransform->stdExtensionVersion));
+}
+
+void transform_tohost_VkVideoEncodeH265SessionCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH265SessionCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pStdExtensionVersion) {
+        transform_tohost_VkExtensionProperties(
+            resourceTracker, (VkExtensionProperties*)(toTransform->pStdExtensionVersion));
+    }
+}
+
+void transform_fromhost_VkVideoEncodeH265SessionCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH265SessionCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pStdExtensionVersion) {
+        transform_fromhost_VkExtensionProperties(
+            resourceTracker, (VkExtensionProperties*)(toTransform->pStdExtensionVersion));
+    }
+}
+
+void transform_tohost_VkVideoEncodeH265SessionParametersAddInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH265SessionParametersAddInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkVideoEncodeH265SessionParametersAddInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH265SessionParametersAddInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkVideoEncodeH265SessionParametersCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkVideoEncodeH265SessionParametersCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pParametersAddInfo) {
+        transform_tohost_VkVideoEncodeH265SessionParametersAddInfoEXT(
+            resourceTracker,
+            (VkVideoEncodeH265SessionParametersAddInfoEXT*)(toTransform->pParametersAddInfo));
+    }
+}
+
+void transform_fromhost_VkVideoEncodeH265SessionParametersCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkVideoEncodeH265SessionParametersCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pParametersAddInfo) {
+        transform_fromhost_VkVideoEncodeH265SessionParametersAddInfoEXT(
+            resourceTracker,
+            (VkVideoEncodeH265SessionParametersAddInfoEXT*)(toTransform->pParametersAddInfo));
+    }
+}
+
+void transform_tohost_VkVideoEncodeH265DpbSlotInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH265DpbSlotInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkVideoEncodeH265DpbSlotInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH265DpbSlotInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkVideoEncodeH265ReferenceListsEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH265ReferenceListsEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pReferenceList0Entries) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->referenceList0EntryCount; ++i) {
+                transform_tohost_VkVideoEncodeH265DpbSlotInfoEXT(
+                    resourceTracker,
+                    (VkVideoEncodeH265DpbSlotInfoEXT*)(toTransform->pReferenceList0Entries + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pReferenceList1Entries) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->referenceList1EntryCount; ++i) {
+                transform_tohost_VkVideoEncodeH265DpbSlotInfoEXT(
+                    resourceTracker,
+                    (VkVideoEncodeH265DpbSlotInfoEXT*)(toTransform->pReferenceList1Entries + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkVideoEncodeH265ReferenceListsEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH265ReferenceListsEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pReferenceList0Entries) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->referenceList0EntryCount; ++i) {
+                transform_fromhost_VkVideoEncodeH265DpbSlotInfoEXT(
+                    resourceTracker,
+                    (VkVideoEncodeH265DpbSlotInfoEXT*)(toTransform->pReferenceList0Entries + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pReferenceList1Entries) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->referenceList1EntryCount; ++i) {
+                transform_fromhost_VkVideoEncodeH265DpbSlotInfoEXT(
+                    resourceTracker,
+                    (VkVideoEncodeH265DpbSlotInfoEXT*)(toTransform->pReferenceList1Entries + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkVideoEncodeH265NaluSliceEXT(ResourceTracker* resourceTracker,
+                                                    VkVideoEncodeH265NaluSliceEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pReferenceFinalLists) {
+        transform_tohost_VkVideoEncodeH265ReferenceListsEXT(
+            resourceTracker,
+            (VkVideoEncodeH265ReferenceListsEXT*)(toTransform->pReferenceFinalLists));
+    }
+}
+
+void transform_fromhost_VkVideoEncodeH265NaluSliceEXT(ResourceTracker* resourceTracker,
+                                                      VkVideoEncodeH265NaluSliceEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pReferenceFinalLists) {
+        transform_fromhost_VkVideoEncodeH265ReferenceListsEXT(
+            resourceTracker,
+            (VkVideoEncodeH265ReferenceListsEXT*)(toTransform->pReferenceFinalLists));
+    }
+}
+
+void transform_tohost_VkVideoEncodeH265VclFrameInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH265VclFrameInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pReferenceFinalLists) {
+        transform_tohost_VkVideoEncodeH265ReferenceListsEXT(
+            resourceTracker,
+            (VkVideoEncodeH265ReferenceListsEXT*)(toTransform->pReferenceFinalLists));
+    }
+    if (toTransform) {
+        if (toTransform->pNaluSliceEntries) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->naluSliceEntryCount; ++i) {
+                transform_tohost_VkVideoEncodeH265NaluSliceEXT(
+                    resourceTracker,
+                    (VkVideoEncodeH265NaluSliceEXT*)(toTransform->pNaluSliceEntries + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkVideoEncodeH265VclFrameInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH265VclFrameInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pReferenceFinalLists) {
+        transform_fromhost_VkVideoEncodeH265ReferenceListsEXT(
+            resourceTracker,
+            (VkVideoEncodeH265ReferenceListsEXT*)(toTransform->pReferenceFinalLists));
+    }
+    if (toTransform) {
+        if (toTransform->pNaluSliceEntries) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->naluSliceEntryCount; ++i) {
+                transform_fromhost_VkVideoEncodeH265NaluSliceEXT(
+                    resourceTracker,
+                    (VkVideoEncodeH265NaluSliceEXT*)(toTransform->pNaluSliceEntries + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkVideoEncodeH265EmitPictureParametersEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH265EmitPictureParametersEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkVideoEncodeH265EmitPictureParametersEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH265EmitPictureParametersEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkVideoEncodeH265ProfileEXT(ResourceTracker* resourceTracker,
+                                                  VkVideoEncodeH265ProfileEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkVideoEncodeH265ProfileEXT(ResourceTracker* resourceTracker,
+                                                    VkVideoEncodeH265ProfileEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_video_decode_h264
+void transform_tohost_VkVideoDecodeH264ProfileEXT(ResourceTracker* resourceTracker,
+                                                  VkVideoDecodeH264ProfileEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkVideoDecodeH264ProfileEXT(ResourceTracker* resourceTracker,
+                                                    VkVideoDecodeH264ProfileEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkVideoDecodeH264CapabilitiesEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH264CapabilitiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkOffset2D(resourceTracker,
+                                (VkOffset2D*)(&toTransform->fieldOffsetGranularity));
+    transform_tohost_VkExtensionProperties(
+        resourceTracker, (VkExtensionProperties*)(&toTransform->stdExtensionVersion));
+}
+
+void transform_fromhost_VkVideoDecodeH264CapabilitiesEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH264CapabilitiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkOffset2D(resourceTracker,
+                                  (VkOffset2D*)(&toTransform->fieldOffsetGranularity));
+    transform_fromhost_VkExtensionProperties(
+        resourceTracker, (VkExtensionProperties*)(&toTransform->stdExtensionVersion));
+}
+
+void transform_tohost_VkVideoDecodeH264SessionCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH264SessionCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pStdExtensionVersion) {
+        transform_tohost_VkExtensionProperties(
+            resourceTracker, (VkExtensionProperties*)(toTransform->pStdExtensionVersion));
+    }
+}
+
+void transform_fromhost_VkVideoDecodeH264SessionCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH264SessionCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pStdExtensionVersion) {
+        transform_fromhost_VkExtensionProperties(
+            resourceTracker, (VkExtensionProperties*)(toTransform->pStdExtensionVersion));
+    }
+}
+
+void transform_tohost_VkVideoDecodeH264SessionParametersAddInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH264SessionParametersAddInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkVideoDecodeH264SessionParametersAddInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH264SessionParametersAddInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkVideoDecodeH264SessionParametersCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkVideoDecodeH264SessionParametersCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pParametersAddInfo) {
+        transform_tohost_VkVideoDecodeH264SessionParametersAddInfoEXT(
+            resourceTracker,
+            (VkVideoDecodeH264SessionParametersAddInfoEXT*)(toTransform->pParametersAddInfo));
+    }
+}
+
+void transform_fromhost_VkVideoDecodeH264SessionParametersCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkVideoDecodeH264SessionParametersCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pParametersAddInfo) {
+        transform_fromhost_VkVideoDecodeH264SessionParametersAddInfoEXT(
+            resourceTracker,
+            (VkVideoDecodeH264SessionParametersAddInfoEXT*)(toTransform->pParametersAddInfo));
+    }
+}
+
+void transform_tohost_VkVideoDecodeH264PictureInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH264PictureInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkVideoDecodeH264PictureInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH264PictureInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkVideoDecodeH264MvcEXT(ResourceTracker* resourceTracker,
+                                              VkVideoDecodeH264MvcEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkVideoDecodeH264MvcEXT(ResourceTracker* resourceTracker,
+                                                VkVideoDecodeH264MvcEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkVideoDecodeH264DpbSlotInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH264DpbSlotInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkVideoDecodeH264DpbSlotInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH264DpbSlotInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_texture_gather_bias_lod
+void transform_tohost_VkTextureLODGatherFormatPropertiesAMD(
+    ResourceTracker* resourceTracker, VkTextureLODGatherFormatPropertiesAMD* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkTextureLODGatherFormatPropertiesAMD(
+    ResourceTracker* resourceTracker, VkTextureLODGatherFormatPropertiesAMD* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_shader_info
+void transform_tohost_VkShaderResourceUsageAMD(ResourceTracker* resourceTracker,
+                                               VkShaderResourceUsageAMD* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkShaderResourceUsageAMD(ResourceTracker* resourceTracker,
+                                                 VkShaderResourceUsageAMD* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkShaderStatisticsInfoAMD(ResourceTracker* resourceTracker,
+                                                VkShaderStatisticsInfoAMD* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkShaderResourceUsageAMD(
+        resourceTracker, (VkShaderResourceUsageAMD*)(&toTransform->resourceUsage));
+}
+
+void transform_fromhost_VkShaderStatisticsInfoAMD(ResourceTracker* resourceTracker,
+                                                  VkShaderStatisticsInfoAMD* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkShaderResourceUsageAMD(
+        resourceTracker, (VkShaderResourceUsageAMD*)(&toTransform->resourceUsage));
+}
+
+#endif
+#ifdef VK_AMD_shader_image_load_store_lod
+#endif
+#ifdef VK_GGP_stream_descriptor_surface
+void transform_tohost_VkStreamDescriptorSurfaceCreateInfoGGP(
+    ResourceTracker* resourceTracker, VkStreamDescriptorSurfaceCreateInfoGGP* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkStreamDescriptorSurfaceCreateInfoGGP(
+    ResourceTracker* resourceTracker, VkStreamDescriptorSurfaceCreateInfoGGP* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_corner_sampled_image
+void transform_tohost_VkPhysicalDeviceCornerSampledImageFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceCornerSampledImageFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceCornerSampledImageFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceCornerSampledImageFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_IMG_format_pvrtc
+#endif
+#ifdef VK_NV_external_memory_capabilities
+void transform_tohost_VkExternalImageFormatPropertiesNV(
+    ResourceTracker* resourceTracker, VkExternalImageFormatPropertiesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkImageFormatProperties(
+        resourceTracker, (VkImageFormatProperties*)(&toTransform->imageFormatProperties));
+}
+
+void transform_fromhost_VkExternalImageFormatPropertiesNV(
+    ResourceTracker* resourceTracker, VkExternalImageFormatPropertiesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkImageFormatProperties(
+        resourceTracker, (VkImageFormatProperties*)(&toTransform->imageFormatProperties));
+}
+
+#endif
+#ifdef VK_NV_external_memory
+void transform_tohost_VkExternalMemoryImageCreateInfoNV(
+    ResourceTracker* resourceTracker, VkExternalMemoryImageCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkExternalMemoryImageCreateInfoNV(
+    ResourceTracker* resourceTracker, VkExternalMemoryImageCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkExportMemoryAllocateInfoNV(ResourceTracker* resourceTracker,
+                                                   VkExportMemoryAllocateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkExportMemoryAllocateInfoNV(ResourceTracker* resourceTracker,
+                                                     VkExportMemoryAllocateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_external_memory_win32
+void transform_tohost_VkImportMemoryWin32HandleInfoNV(
+    ResourceTracker* resourceTracker, VkImportMemoryWin32HandleInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkImportMemoryWin32HandleInfoNV(
+    ResourceTracker* resourceTracker, VkImportMemoryWin32HandleInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkExportMemoryWin32HandleInfoNV(
+    ResourceTracker* resourceTracker, VkExportMemoryWin32HandleInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkExportMemoryWin32HandleInfoNV(
+    ResourceTracker* resourceTracker, VkExportMemoryWin32HandleInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_win32_keyed_mutex
+void transform_tohost_VkWin32KeyedMutexAcquireReleaseInfoNV(
+    ResourceTracker* resourceTracker, VkWin32KeyedMutexAcquireReleaseInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_tohost((VkDeviceMemory*)toTransform->pReleaseSyncs,
+                                                  toTransform->releaseCount, (VkDeviceSize*)nullptr,
+                                                  0, (VkDeviceSize*)nullptr, 0, (uint32_t*)nullptr,
+                                                  0, (uint32_t*)nullptr, 0);
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkWin32KeyedMutexAcquireReleaseInfoNV(
+    ResourceTracker* resourceTracker, VkWin32KeyedMutexAcquireReleaseInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_fromhost(
+        (VkDeviceMemory*)toTransform->pReleaseSyncs, toTransform->releaseCount,
+        (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr, 0, (uint32_t*)nullptr, 0,
+        (uint32_t*)nullptr, 0);
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_validation_flags
+void transform_tohost_VkValidationFlagsEXT(ResourceTracker* resourceTracker,
+                                           VkValidationFlagsEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkValidationFlagsEXT(ResourceTracker* resourceTracker,
+                                             VkValidationFlagsEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NN_vi_surface
+void transform_tohost_VkViSurfaceCreateInfoNN(ResourceTracker* resourceTracker,
+                                              VkViSurfaceCreateInfoNN* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkViSurfaceCreateInfoNN(ResourceTracker* resourceTracker,
+                                                VkViSurfaceCreateInfoNN* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_shader_subgroup_ballot
+#endif
+#ifdef VK_EXT_shader_subgroup_vote
+#endif
+#ifdef VK_EXT_texture_compression_astc_hdr
+void transform_tohost_VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_astc_decode_mode
+void transform_tohost_VkImageViewASTCDecodeModeEXT(ResourceTracker* resourceTracker,
+                                                   VkImageViewASTCDecodeModeEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkImageViewASTCDecodeModeEXT(ResourceTracker* resourceTracker,
+                                                     VkImageViewASTCDecodeModeEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceASTCDecodeFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceASTCDecodeFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceASTCDecodeFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceASTCDecodeFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_conditional_rendering
+void transform_tohost_VkConditionalRenderingBeginInfoEXT(
+    ResourceTracker* resourceTracker, VkConditionalRenderingBeginInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkConditionalRenderingBeginInfoEXT(
+    ResourceTracker* resourceTracker, VkConditionalRenderingBeginInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceConditionalRenderingFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceConditionalRenderingFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceConditionalRenderingFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceConditionalRenderingFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkCommandBufferInheritanceConditionalRenderingInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkCommandBufferInheritanceConditionalRenderingInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkCommandBufferInheritanceConditionalRenderingInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkCommandBufferInheritanceConditionalRenderingInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+void transform_tohost_VkViewportWScalingNV(ResourceTracker* resourceTracker,
+                                           VkViewportWScalingNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkViewportWScalingNV(ResourceTracker* resourceTracker,
+                                             VkViewportWScalingNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkPipelineViewportWScalingStateCreateInfoNV(
+    ResourceTracker* resourceTracker, VkPipelineViewportWScalingStateCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pViewportWScalings) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->viewportCount; ++i) {
+                transform_tohost_VkViewportWScalingNV(
+                    resourceTracker, (VkViewportWScalingNV*)(toTransform->pViewportWScalings + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkPipelineViewportWScalingStateCreateInfoNV(
+    ResourceTracker* resourceTracker, VkPipelineViewportWScalingStateCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pViewportWScalings) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->viewportCount; ++i) {
+                transform_fromhost_VkViewportWScalingNV(
+                    resourceTracker, (VkViewportWScalingNV*)(toTransform->pViewportWScalings + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_EXT_direct_mode_display
+#endif
+#ifdef VK_EXT_acquire_xlib_display
+#endif
+#ifdef VK_EXT_display_surface_counter
+void transform_tohost_VkSurfaceCapabilities2EXT(ResourceTracker* resourceTracker,
+                                                VkSurfaceCapabilities2EXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->currentExtent));
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->minImageExtent));
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->maxImageExtent));
+}
+
+void transform_fromhost_VkSurfaceCapabilities2EXT(ResourceTracker* resourceTracker,
+                                                  VkSurfaceCapabilities2EXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->currentExtent));
+    transform_fromhost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->minImageExtent));
+    transform_fromhost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->maxImageExtent));
+}
+
+#endif
+#ifdef VK_EXT_display_control
+void transform_tohost_VkDisplayPowerInfoEXT(ResourceTracker* resourceTracker,
+                                            VkDisplayPowerInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDisplayPowerInfoEXT(ResourceTracker* resourceTracker,
+                                              VkDisplayPowerInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDeviceEventInfoEXT(ResourceTracker* resourceTracker,
+                                           VkDeviceEventInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDeviceEventInfoEXT(ResourceTracker* resourceTracker,
+                                             VkDeviceEventInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDisplayEventInfoEXT(ResourceTracker* resourceTracker,
+                                            VkDisplayEventInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDisplayEventInfoEXT(ResourceTracker* resourceTracker,
+                                              VkDisplayEventInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkSwapchainCounterCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkSwapchainCounterCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkSwapchainCounterCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkSwapchainCounterCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_GOOGLE_display_timing
+void transform_tohost_VkRefreshCycleDurationGOOGLE(ResourceTracker* resourceTracker,
+                                                   VkRefreshCycleDurationGOOGLE* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkRefreshCycleDurationGOOGLE(ResourceTracker* resourceTracker,
+                                                     VkRefreshCycleDurationGOOGLE* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkPastPresentationTimingGOOGLE(ResourceTracker* resourceTracker,
+                                                     VkPastPresentationTimingGOOGLE* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkPastPresentationTimingGOOGLE(
+    ResourceTracker* resourceTracker, VkPastPresentationTimingGOOGLE* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkPresentTimeGOOGLE(ResourceTracker* resourceTracker,
+                                          VkPresentTimeGOOGLE* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkPresentTimeGOOGLE(ResourceTracker* resourceTracker,
+                                            VkPresentTimeGOOGLE* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkPresentTimesInfoGOOGLE(ResourceTracker* resourceTracker,
+                                               VkPresentTimesInfoGOOGLE* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pTimes) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->swapchainCount; ++i) {
+                transform_tohost_VkPresentTimeGOOGLE(
+                    resourceTracker, (VkPresentTimeGOOGLE*)(toTransform->pTimes + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkPresentTimesInfoGOOGLE(ResourceTracker* resourceTracker,
+                                                 VkPresentTimesInfoGOOGLE* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pTimes) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->swapchainCount; ++i) {
+                transform_fromhost_VkPresentTimeGOOGLE(
+                    resourceTracker, (VkPresentTimeGOOGLE*)(toTransform->pTimes + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_NV_sample_mask_override_coverage
+#endif
+#ifdef VK_NV_geometry_shader_passthrough
+#endif
+#ifdef VK_NV_viewport_array2
+#endif
+#ifdef VK_NVX_multiview_per_view_attributes
+void transform_tohost_VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_viewport_swizzle
+void transform_tohost_VkViewportSwizzleNV(ResourceTracker* resourceTracker,
+                                          VkViewportSwizzleNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkViewportSwizzleNV(ResourceTracker* resourceTracker,
+                                            VkViewportSwizzleNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkPipelineViewportSwizzleStateCreateInfoNV(
+    ResourceTracker* resourceTracker, VkPipelineViewportSwizzleStateCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pViewportSwizzles) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->viewportCount; ++i) {
+                transform_tohost_VkViewportSwizzleNV(
+                    resourceTracker, (VkViewportSwizzleNV*)(toTransform->pViewportSwizzles + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkPipelineViewportSwizzleStateCreateInfoNV(
+    ResourceTracker* resourceTracker, VkPipelineViewportSwizzleStateCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pViewportSwizzles) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->viewportCount; ++i) {
+                transform_fromhost_VkViewportSwizzleNV(
+                    resourceTracker, (VkViewportSwizzleNV*)(toTransform->pViewportSwizzles + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_EXT_discard_rectangles
+void transform_tohost_VkPhysicalDeviceDiscardRectanglePropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDiscardRectanglePropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceDiscardRectanglePropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDiscardRectanglePropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPipelineDiscardRectangleStateCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineDiscardRectangleStateCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pDiscardRectangles) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->discardRectangleCount; ++i) {
+                transform_tohost_VkRect2D(resourceTracker,
+                                          (VkRect2D*)(toTransform->pDiscardRectangles + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkPipelineDiscardRectangleStateCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineDiscardRectangleStateCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pDiscardRectangles) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->discardRectangleCount; ++i) {
+                transform_fromhost_VkRect2D(resourceTracker,
+                                            (VkRect2D*)(toTransform->pDiscardRectangles + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_EXT_conservative_rasterization
+void transform_tohost_VkPhysicalDeviceConservativeRasterizationPropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceConservativeRasterizationPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceConservativeRasterizationPropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceConservativeRasterizationPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPipelineRasterizationConservativeStateCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkPipelineRasterizationConservativeStateCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPipelineRasterizationConservativeStateCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkPipelineRasterizationConservativeStateCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_depth_clip_enable
+void transform_tohost_VkPhysicalDeviceDepthClipEnableFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDepthClipEnableFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceDepthClipEnableFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDepthClipEnableFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPipelineRasterizationDepthClipStateCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkPipelineRasterizationDepthClipStateCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPipelineRasterizationDepthClipStateCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkPipelineRasterizationDepthClipStateCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_swapchain_colorspace
+#endif
+#ifdef VK_EXT_hdr_metadata
+void transform_tohost_VkXYColorEXT(ResourceTracker* resourceTracker, VkXYColorEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkXYColorEXT(ResourceTracker* resourceTracker, VkXYColorEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkHdrMetadataEXT(ResourceTracker* resourceTracker,
+                                       VkHdrMetadataEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkXYColorEXT(resourceTracker,
+                                  (VkXYColorEXT*)(&toTransform->displayPrimaryRed));
+    transform_tohost_VkXYColorEXT(resourceTracker,
+                                  (VkXYColorEXT*)(&toTransform->displayPrimaryGreen));
+    transform_tohost_VkXYColorEXT(resourceTracker,
+                                  (VkXYColorEXT*)(&toTransform->displayPrimaryBlue));
+    transform_tohost_VkXYColorEXT(resourceTracker, (VkXYColorEXT*)(&toTransform->whitePoint));
+}
+
+void transform_fromhost_VkHdrMetadataEXT(ResourceTracker* resourceTracker,
+                                         VkHdrMetadataEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkXYColorEXT(resourceTracker,
+                                    (VkXYColorEXT*)(&toTransform->displayPrimaryRed));
+    transform_fromhost_VkXYColorEXT(resourceTracker,
+                                    (VkXYColorEXT*)(&toTransform->displayPrimaryGreen));
+    transform_fromhost_VkXYColorEXT(resourceTracker,
+                                    (VkXYColorEXT*)(&toTransform->displayPrimaryBlue));
+    transform_fromhost_VkXYColorEXT(resourceTracker, (VkXYColorEXT*)(&toTransform->whitePoint));
+}
+
+#endif
+#ifdef VK_MVK_ios_surface
+void transform_tohost_VkIOSSurfaceCreateInfoMVK(ResourceTracker* resourceTracker,
+                                                VkIOSSurfaceCreateInfoMVK* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkIOSSurfaceCreateInfoMVK(ResourceTracker* resourceTracker,
+                                                  VkIOSSurfaceCreateInfoMVK* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_MVK_macos_surface
+void transform_tohost_VkMacOSSurfaceCreateInfoMVK(ResourceTracker* resourceTracker,
+                                                  VkMacOSSurfaceCreateInfoMVK* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkMacOSSurfaceCreateInfoMVK(ResourceTracker* resourceTracker,
+                                                    VkMacOSSurfaceCreateInfoMVK* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_MVK_moltenvk
+#endif
+#ifdef VK_EXT_external_memory_dma_buf
+#endif
+#ifdef VK_EXT_queue_family_foreign
+#endif
+#ifdef VK_EXT_debug_utils
+void transform_tohost_VkDebugUtilsLabelEXT(ResourceTracker* resourceTracker,
+                                           VkDebugUtilsLabelEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDebugUtilsLabelEXT(ResourceTracker* resourceTracker,
+                                             VkDebugUtilsLabelEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDebugUtilsObjectNameInfoEXT(ResourceTracker* resourceTracker,
+                                                    VkDebugUtilsObjectNameInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDebugUtilsObjectNameInfoEXT(ResourceTracker* resourceTracker,
+                                                      VkDebugUtilsObjectNameInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDebugUtilsMessengerCallbackDataEXT(
+    ResourceTracker* resourceTracker, VkDebugUtilsMessengerCallbackDataEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pQueueLabels) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->queueLabelCount; ++i) {
+                transform_tohost_VkDebugUtilsLabelEXT(
+                    resourceTracker, (VkDebugUtilsLabelEXT*)(toTransform->pQueueLabels + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pCmdBufLabels) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->cmdBufLabelCount; ++i) {
+                transform_tohost_VkDebugUtilsLabelEXT(
+                    resourceTracker, (VkDebugUtilsLabelEXT*)(toTransform->pCmdBufLabels + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pObjects) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->objectCount; ++i) {
+                transform_tohost_VkDebugUtilsObjectNameInfoEXT(
+                    resourceTracker, (VkDebugUtilsObjectNameInfoEXT*)(toTransform->pObjects + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkDebugUtilsMessengerCallbackDataEXT(
+    ResourceTracker* resourceTracker, VkDebugUtilsMessengerCallbackDataEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pQueueLabels) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->queueLabelCount; ++i) {
+                transform_fromhost_VkDebugUtilsLabelEXT(
+                    resourceTracker, (VkDebugUtilsLabelEXT*)(toTransform->pQueueLabels + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pCmdBufLabels) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->cmdBufLabelCount; ++i) {
+                transform_fromhost_VkDebugUtilsLabelEXT(
+                    resourceTracker, (VkDebugUtilsLabelEXT*)(toTransform->pCmdBufLabels + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pObjects) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->objectCount; ++i) {
+                transform_fromhost_VkDebugUtilsObjectNameInfoEXT(
+                    resourceTracker, (VkDebugUtilsObjectNameInfoEXT*)(toTransform->pObjects + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkDebugUtilsMessengerCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkDebugUtilsMessengerCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDebugUtilsMessengerCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkDebugUtilsMessengerCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDebugUtilsObjectTagInfoEXT(ResourceTracker* resourceTracker,
+                                                   VkDebugUtilsObjectTagInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDebugUtilsObjectTagInfoEXT(ResourceTracker* resourceTracker,
+                                                     VkDebugUtilsObjectTagInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+void transform_tohost_VkAndroidHardwareBufferUsageANDROID(
+    ResourceTracker* resourceTracker, VkAndroidHardwareBufferUsageANDROID* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkAndroidHardwareBufferUsageANDROID(
+    ResourceTracker* resourceTracker, VkAndroidHardwareBufferUsageANDROID* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkAndroidHardwareBufferPropertiesANDROID(
+    ResourceTracker* resourceTracker, VkAndroidHardwareBufferPropertiesANDROID* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_tohost(
+        (VkDeviceMemory*)nullptr, 0, (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr, 0,
+        (uint32_t*)nullptr, 0, (uint32_t*)&toTransform->memoryTypeBits, 1);
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkAndroidHardwareBufferPropertiesANDROID(
+    ResourceTracker* resourceTracker, VkAndroidHardwareBufferPropertiesANDROID* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_fromhost(
+        (VkDeviceMemory*)nullptr, 0, (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr, 0,
+        (uint32_t*)nullptr, 0, (uint32_t*)&toTransform->memoryTypeBits, 1);
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkAndroidHardwareBufferFormatPropertiesANDROID(
+    ResourceTracker* resourceTracker, VkAndroidHardwareBufferFormatPropertiesANDROID* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkComponentMapping(
+        resourceTracker, (VkComponentMapping*)(&toTransform->samplerYcbcrConversionComponents));
+}
+
+void transform_fromhost_VkAndroidHardwareBufferFormatPropertiesANDROID(
+    ResourceTracker* resourceTracker, VkAndroidHardwareBufferFormatPropertiesANDROID* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkComponentMapping(
+        resourceTracker, (VkComponentMapping*)(&toTransform->samplerYcbcrConversionComponents));
+}
+
+void transform_tohost_VkImportAndroidHardwareBufferInfoANDROID(
+    ResourceTracker* resourceTracker, VkImportAndroidHardwareBufferInfoANDROID* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkImportAndroidHardwareBufferInfoANDROID(
+    ResourceTracker* resourceTracker, VkImportAndroidHardwareBufferInfoANDROID* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkMemoryGetAndroidHardwareBufferInfoANDROID(
+    ResourceTracker* resourceTracker, VkMemoryGetAndroidHardwareBufferInfoANDROID* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_tohost((VkDeviceMemory*)&toTransform->memory, 1,
+                                                  (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr,
+                                                  0, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0);
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkMemoryGetAndroidHardwareBufferInfoANDROID(
+    ResourceTracker* resourceTracker, VkMemoryGetAndroidHardwareBufferInfoANDROID* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_fromhost(
+        (VkDeviceMemory*)&toTransform->memory, 1, (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr,
+        0, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0);
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkExternalFormatANDROID(ResourceTracker* resourceTracker,
+                                              VkExternalFormatANDROID* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkExternalFormatANDROID(ResourceTracker* resourceTracker,
+                                                VkExternalFormatANDROID* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkAndroidHardwareBufferFormatProperties2ANDROID(
+    ResourceTracker* resourceTracker,
+    VkAndroidHardwareBufferFormatProperties2ANDROID* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkComponentMapping(
+        resourceTracker, (VkComponentMapping*)(&toTransform->samplerYcbcrConversionComponents));
+}
+
+void transform_fromhost_VkAndroidHardwareBufferFormatProperties2ANDROID(
+    ResourceTracker* resourceTracker,
+    VkAndroidHardwareBufferFormatProperties2ANDROID* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkComponentMapping(
+        resourceTracker, (VkComponentMapping*)(&toTransform->samplerYcbcrConversionComponents));
+}
+
+#endif
+#ifdef VK_EXT_sampler_filter_minmax
+#endif
+#ifdef VK_AMD_gpu_shader_int16
+#endif
+#ifdef VK_AMD_mixed_attachment_samples
+#endif
+#ifdef VK_AMD_shader_fragment_mask
+#endif
+#ifdef VK_EXT_inline_uniform_block
+void transform_tohost_VkPhysicalDeviceInlineUniformBlockFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceInlineUniformBlockFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceInlineUniformBlockFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceInlineUniformBlockFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceInlineUniformBlockPropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceInlineUniformBlockPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceInlineUniformBlockPropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceInlineUniformBlockPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkWriteDescriptorSetInlineUniformBlockEXT(
+    ResourceTracker* resourceTracker, VkWriteDescriptorSetInlineUniformBlockEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkWriteDescriptorSetInlineUniformBlockEXT(
+    ResourceTracker* resourceTracker, VkWriteDescriptorSetInlineUniformBlockEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDescriptorPoolInlineUniformBlockCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkDescriptorPoolInlineUniformBlockCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDescriptorPoolInlineUniformBlockCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkDescriptorPoolInlineUniformBlockCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_shader_stencil_export
+#endif
+#ifdef VK_EXT_sample_locations
+void transform_tohost_VkSampleLocationEXT(ResourceTracker* resourceTracker,
+                                          VkSampleLocationEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkSampleLocationEXT(ResourceTracker* resourceTracker,
+                                            VkSampleLocationEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkSampleLocationsInfoEXT(ResourceTracker* resourceTracker,
+                                               VkSampleLocationsInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkExtent2D(resourceTracker,
+                                (VkExtent2D*)(&toTransform->sampleLocationGridSize));
+    if (toTransform) {
+        if (toTransform->pSampleLocations) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->sampleLocationsCount; ++i) {
+                transform_tohost_VkSampleLocationEXT(
+                    resourceTracker, (VkSampleLocationEXT*)(toTransform->pSampleLocations + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkSampleLocationsInfoEXT(ResourceTracker* resourceTracker,
+                                                 VkSampleLocationsInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkExtent2D(resourceTracker,
+                                  (VkExtent2D*)(&toTransform->sampleLocationGridSize));
+    if (toTransform) {
+        if (toTransform->pSampleLocations) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->sampleLocationsCount; ++i) {
+                transform_fromhost_VkSampleLocationEXT(
+                    resourceTracker, (VkSampleLocationEXT*)(toTransform->pSampleLocations + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkAttachmentSampleLocationsEXT(ResourceTracker* resourceTracker,
+                                                     VkAttachmentSampleLocationsEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkSampleLocationsInfoEXT(
+        resourceTracker, (VkSampleLocationsInfoEXT*)(&toTransform->sampleLocationsInfo));
+}
+
+void transform_fromhost_VkAttachmentSampleLocationsEXT(
+    ResourceTracker* resourceTracker, VkAttachmentSampleLocationsEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkSampleLocationsInfoEXT(
+        resourceTracker, (VkSampleLocationsInfoEXT*)(&toTransform->sampleLocationsInfo));
+}
+
+void transform_tohost_VkSubpassSampleLocationsEXT(ResourceTracker* resourceTracker,
+                                                  VkSubpassSampleLocationsEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkSampleLocationsInfoEXT(
+        resourceTracker, (VkSampleLocationsInfoEXT*)(&toTransform->sampleLocationsInfo));
+}
+
+void transform_fromhost_VkSubpassSampleLocationsEXT(ResourceTracker* resourceTracker,
+                                                    VkSubpassSampleLocationsEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkSampleLocationsInfoEXT(
+        resourceTracker, (VkSampleLocationsInfoEXT*)(&toTransform->sampleLocationsInfo));
+}
+
+void transform_tohost_VkRenderPassSampleLocationsBeginInfoEXT(
+    ResourceTracker* resourceTracker, VkRenderPassSampleLocationsBeginInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pAttachmentInitialSampleLocations) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->attachmentInitialSampleLocationsCount;
+                 ++i) {
+                transform_tohost_VkAttachmentSampleLocationsEXT(
+                    resourceTracker,
+                    (VkAttachmentSampleLocationsEXT*)(toTransform
+                                                          ->pAttachmentInitialSampleLocations +
+                                                      i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pPostSubpassSampleLocations) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->postSubpassSampleLocationsCount; ++i) {
+                transform_tohost_VkSubpassSampleLocationsEXT(
+                    resourceTracker,
+                    (VkSubpassSampleLocationsEXT*)(toTransform->pPostSubpassSampleLocations + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkRenderPassSampleLocationsBeginInfoEXT(
+    ResourceTracker* resourceTracker, VkRenderPassSampleLocationsBeginInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pAttachmentInitialSampleLocations) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->attachmentInitialSampleLocationsCount;
+                 ++i) {
+                transform_fromhost_VkAttachmentSampleLocationsEXT(
+                    resourceTracker,
+                    (VkAttachmentSampleLocationsEXT*)(toTransform
+                                                          ->pAttachmentInitialSampleLocations +
+                                                      i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pPostSubpassSampleLocations) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->postSubpassSampleLocationsCount; ++i) {
+                transform_fromhost_VkSubpassSampleLocationsEXT(
+                    resourceTracker,
+                    (VkSubpassSampleLocationsEXT*)(toTransform->pPostSubpassSampleLocations + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkPipelineSampleLocationsStateCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineSampleLocationsStateCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkSampleLocationsInfoEXT(
+        resourceTracker, (VkSampleLocationsInfoEXT*)(&toTransform->sampleLocationsInfo));
+}
+
+void transform_fromhost_VkPipelineSampleLocationsStateCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineSampleLocationsStateCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkSampleLocationsInfoEXT(
+        resourceTracker, (VkSampleLocationsInfoEXT*)(&toTransform->sampleLocationsInfo));
+}
+
+void transform_tohost_VkPhysicalDeviceSampleLocationsPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSampleLocationsPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkExtent2D(resourceTracker,
+                                (VkExtent2D*)(&toTransform->maxSampleLocationGridSize));
+}
+
+void transform_fromhost_VkPhysicalDeviceSampleLocationsPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSampleLocationsPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkExtent2D(resourceTracker,
+                                  (VkExtent2D*)(&toTransform->maxSampleLocationGridSize));
+}
+
+void transform_tohost_VkMultisamplePropertiesEXT(ResourceTracker* resourceTracker,
+                                                 VkMultisamplePropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkExtent2D(resourceTracker,
+                                (VkExtent2D*)(&toTransform->maxSampleLocationGridSize));
+}
+
+void transform_fromhost_VkMultisamplePropertiesEXT(ResourceTracker* resourceTracker,
+                                                   VkMultisamplePropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkExtent2D(resourceTracker,
+                                  (VkExtent2D*)(&toTransform->maxSampleLocationGridSize));
+}
+
+#endif
+#ifdef VK_EXT_blend_operation_advanced
+void transform_tohost_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPipelineColorBlendAdvancedStateCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineColorBlendAdvancedStateCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPipelineColorBlendAdvancedStateCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineColorBlendAdvancedStateCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_fragment_coverage_to_color
+void transform_tohost_VkPipelineCoverageToColorStateCreateInfoNV(
+    ResourceTracker* resourceTracker, VkPipelineCoverageToColorStateCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPipelineCoverageToColorStateCreateInfoNV(
+    ResourceTracker* resourceTracker, VkPipelineCoverageToColorStateCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_framebuffer_mixed_samples
+void transform_tohost_VkPipelineCoverageModulationStateCreateInfoNV(
+    ResourceTracker* resourceTracker, VkPipelineCoverageModulationStateCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPipelineCoverageModulationStateCreateInfoNV(
+    ResourceTracker* resourceTracker, VkPipelineCoverageModulationStateCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_fill_rectangle
+#endif
+#ifdef VK_NV_shader_sm_builtins
+void transform_tohost_VkPhysicalDeviceShaderSMBuiltinsPropertiesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderSMBuiltinsPropertiesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceShaderSMBuiltinsPropertiesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderSMBuiltinsPropertiesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceShaderSMBuiltinsFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderSMBuiltinsFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceShaderSMBuiltinsFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderSMBuiltinsFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_post_depth_coverage
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+void transform_tohost_VkDrmFormatModifierPropertiesEXT(
+    ResourceTracker* resourceTracker, VkDrmFormatModifierPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkDrmFormatModifierPropertiesEXT(
+    ResourceTracker* resourceTracker, VkDrmFormatModifierPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkDrmFormatModifierPropertiesListEXT(
+    ResourceTracker* resourceTracker, VkDrmFormatModifierPropertiesListEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pDrmFormatModifierProperties) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->drmFormatModifierCount; ++i) {
+                transform_tohost_VkDrmFormatModifierPropertiesEXT(
+                    resourceTracker,
+                    (VkDrmFormatModifierPropertiesEXT*)(toTransform->pDrmFormatModifierProperties +
+                                                        i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkDrmFormatModifierPropertiesListEXT(
+    ResourceTracker* resourceTracker, VkDrmFormatModifierPropertiesListEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pDrmFormatModifierProperties) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->drmFormatModifierCount; ++i) {
+                transform_fromhost_VkDrmFormatModifierPropertiesEXT(
+                    resourceTracker,
+                    (VkDrmFormatModifierPropertiesEXT*)(toTransform->pDrmFormatModifierProperties +
+                                                        i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceImageDrmFormatModifierInfoEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceImageDrmFormatModifierInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceImageDrmFormatModifierInfoEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceImageDrmFormatModifierInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkImageDrmFormatModifierListCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkImageDrmFormatModifierListCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkImageDrmFormatModifierListCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkImageDrmFormatModifierListCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkImageDrmFormatModifierExplicitCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkImageDrmFormatModifierExplicitCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pPlaneLayouts) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->drmFormatModifierPlaneCount; ++i) {
+                transform_tohost_VkSubresourceLayout(
+                    resourceTracker, (VkSubresourceLayout*)(toTransform->pPlaneLayouts + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkImageDrmFormatModifierExplicitCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkImageDrmFormatModifierExplicitCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pPlaneLayouts) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->drmFormatModifierPlaneCount; ++i) {
+                transform_fromhost_VkSubresourceLayout(
+                    resourceTracker, (VkSubresourceLayout*)(toTransform->pPlaneLayouts + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkImageDrmFormatModifierPropertiesEXT(
+    ResourceTracker* resourceTracker, VkImageDrmFormatModifierPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkImageDrmFormatModifierPropertiesEXT(
+    ResourceTracker* resourceTracker, VkImageDrmFormatModifierPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDrmFormatModifierProperties2EXT(
+    ResourceTracker* resourceTracker, VkDrmFormatModifierProperties2EXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkDrmFormatModifierProperties2EXT(
+    ResourceTracker* resourceTracker, VkDrmFormatModifierProperties2EXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkDrmFormatModifierPropertiesList2EXT(
+    ResourceTracker* resourceTracker, VkDrmFormatModifierPropertiesList2EXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pDrmFormatModifierProperties) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->drmFormatModifierCount; ++i) {
+                transform_tohost_VkDrmFormatModifierProperties2EXT(
+                    resourceTracker,
+                    (VkDrmFormatModifierProperties2EXT*)(toTransform->pDrmFormatModifierProperties +
+                                                         i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkDrmFormatModifierPropertiesList2EXT(
+    ResourceTracker* resourceTracker, VkDrmFormatModifierPropertiesList2EXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pDrmFormatModifierProperties) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->drmFormatModifierCount; ++i) {
+                transform_fromhost_VkDrmFormatModifierProperties2EXT(
+                    resourceTracker,
+                    (VkDrmFormatModifierProperties2EXT*)(toTransform->pDrmFormatModifierProperties +
+                                                         i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_EXT_validation_cache
+void transform_tohost_VkValidationCacheCreateInfoEXT(ResourceTracker* resourceTracker,
+                                                     VkValidationCacheCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkValidationCacheCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkValidationCacheCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkShaderModuleValidationCacheCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkShaderModuleValidationCacheCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkShaderModuleValidationCacheCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkShaderModuleValidationCacheCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_descriptor_indexing
+#endif
+#ifdef VK_EXT_shader_viewport_index_layer
+#endif
+#ifdef VK_NV_shading_rate_image
+void transform_tohost_VkShadingRatePaletteNV(ResourceTracker* resourceTracker,
+                                             VkShadingRatePaletteNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkShadingRatePaletteNV(ResourceTracker* resourceTracker,
+                                               VkShadingRatePaletteNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkPipelineViewportShadingRateImageStateCreateInfoNV(
+    ResourceTracker* resourceTracker,
+    VkPipelineViewportShadingRateImageStateCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pShadingRatePalettes) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->viewportCount; ++i) {
+                transform_tohost_VkShadingRatePaletteNV(
+                    resourceTracker,
+                    (VkShadingRatePaletteNV*)(toTransform->pShadingRatePalettes + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkPipelineViewportShadingRateImageStateCreateInfoNV(
+    ResourceTracker* resourceTracker,
+    VkPipelineViewportShadingRateImageStateCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pShadingRatePalettes) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->viewportCount; ++i) {
+                transform_fromhost_VkShadingRatePaletteNV(
+                    resourceTracker,
+                    (VkShadingRatePaletteNV*)(toTransform->pShadingRatePalettes + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceShadingRateImageFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShadingRateImageFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceShadingRateImageFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShadingRateImageFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceShadingRateImagePropertiesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShadingRateImagePropertiesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkExtent2D(resourceTracker, (VkExtent2D*)(&toTransform->shadingRateTexelSize));
+}
+
+void transform_fromhost_VkPhysicalDeviceShadingRateImagePropertiesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShadingRateImagePropertiesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkExtent2D(resourceTracker,
+                                  (VkExtent2D*)(&toTransform->shadingRateTexelSize));
+}
+
+void transform_tohost_VkCoarseSampleLocationNV(ResourceTracker* resourceTracker,
+                                               VkCoarseSampleLocationNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkCoarseSampleLocationNV(ResourceTracker* resourceTracker,
+                                                 VkCoarseSampleLocationNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkCoarseSampleOrderCustomNV(ResourceTracker* resourceTracker,
+                                                  VkCoarseSampleOrderCustomNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform) {
+        if (toTransform->pSampleLocations) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->sampleLocationCount; ++i) {
+                transform_tohost_VkCoarseSampleLocationNV(
+                    resourceTracker,
+                    (VkCoarseSampleLocationNV*)(toTransform->pSampleLocations + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkCoarseSampleOrderCustomNV(ResourceTracker* resourceTracker,
+                                                    VkCoarseSampleOrderCustomNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform) {
+        if (toTransform->pSampleLocations) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->sampleLocationCount; ++i) {
+                transform_fromhost_VkCoarseSampleLocationNV(
+                    resourceTracker,
+                    (VkCoarseSampleLocationNV*)(toTransform->pSampleLocations + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkPipelineViewportCoarseSampleOrderStateCreateInfoNV(
+    ResourceTracker* resourceTracker,
+    VkPipelineViewportCoarseSampleOrderStateCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pCustomSampleOrders) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->customSampleOrderCount; ++i) {
+                transform_tohost_VkCoarseSampleOrderCustomNV(
+                    resourceTracker,
+                    (VkCoarseSampleOrderCustomNV*)(toTransform->pCustomSampleOrders + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkPipelineViewportCoarseSampleOrderStateCreateInfoNV(
+    ResourceTracker* resourceTracker,
+    VkPipelineViewportCoarseSampleOrderStateCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pCustomSampleOrders) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->customSampleOrderCount; ++i) {
+                transform_fromhost_VkCoarseSampleOrderCustomNV(
+                    resourceTracker,
+                    (VkCoarseSampleOrderCustomNV*)(toTransform->pCustomSampleOrders + i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_NV_ray_tracing
+void transform_tohost_VkRayTracingShaderGroupCreateInfoNV(
+    ResourceTracker* resourceTracker, VkRayTracingShaderGroupCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkRayTracingShaderGroupCreateInfoNV(
+    ResourceTracker* resourceTracker, VkRayTracingShaderGroupCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkRayTracingPipelineCreateInfoNV(
+    ResourceTracker* resourceTracker, VkRayTracingPipelineCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pStages) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->stageCount; ++i) {
+                transform_tohost_VkPipelineShaderStageCreateInfo(
+                    resourceTracker, (VkPipelineShaderStageCreateInfo*)(toTransform->pStages + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pGroups) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->groupCount; ++i) {
+                transform_tohost_VkRayTracingShaderGroupCreateInfoNV(
+                    resourceTracker,
+                    (VkRayTracingShaderGroupCreateInfoNV*)(toTransform->pGroups + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkRayTracingPipelineCreateInfoNV(
+    ResourceTracker* resourceTracker, VkRayTracingPipelineCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pStages) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->stageCount; ++i) {
+                transform_fromhost_VkPipelineShaderStageCreateInfo(
+                    resourceTracker, (VkPipelineShaderStageCreateInfo*)(toTransform->pStages + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pGroups) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->groupCount; ++i) {
+                transform_fromhost_VkRayTracingShaderGroupCreateInfoNV(
+                    resourceTracker,
+                    (VkRayTracingShaderGroupCreateInfoNV*)(toTransform->pGroups + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkGeometryTrianglesNV(ResourceTracker* resourceTracker,
+                                            VkGeometryTrianglesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkGeometryTrianglesNV(ResourceTracker* resourceTracker,
+                                              VkGeometryTrianglesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkGeometryAABBNV(ResourceTracker* resourceTracker,
+                                       VkGeometryAABBNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkGeometryAABBNV(ResourceTracker* resourceTracker,
+                                         VkGeometryAABBNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkGeometryDataNV(ResourceTracker* resourceTracker,
+                                       VkGeometryDataNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkGeometryTrianglesNV(resourceTracker,
+                                           (VkGeometryTrianglesNV*)(&toTransform->triangles));
+    transform_tohost_VkGeometryAABBNV(resourceTracker, (VkGeometryAABBNV*)(&toTransform->aabbs));
+}
+
+void transform_fromhost_VkGeometryDataNV(ResourceTracker* resourceTracker,
+                                         VkGeometryDataNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkGeometryTrianglesNV(resourceTracker,
+                                             (VkGeometryTrianglesNV*)(&toTransform->triangles));
+    transform_fromhost_VkGeometryAABBNV(resourceTracker, (VkGeometryAABBNV*)(&toTransform->aabbs));
+}
+
+void transform_tohost_VkGeometryNV(ResourceTracker* resourceTracker, VkGeometryNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkGeometryDataNV(resourceTracker, (VkGeometryDataNV*)(&toTransform->geometry));
+}
+
+void transform_fromhost_VkGeometryNV(ResourceTracker* resourceTracker, VkGeometryNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkGeometryDataNV(resourceTracker,
+                                        (VkGeometryDataNV*)(&toTransform->geometry));
+}
+
+void transform_tohost_VkAccelerationStructureInfoNV(ResourceTracker* resourceTracker,
+                                                    VkAccelerationStructureInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pGeometries) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->geometryCount; ++i) {
+                transform_tohost_VkGeometryNV(resourceTracker,
+                                              (VkGeometryNV*)(toTransform->pGeometries + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkAccelerationStructureInfoNV(ResourceTracker* resourceTracker,
+                                                      VkAccelerationStructureInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pGeometries) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->geometryCount; ++i) {
+                transform_fromhost_VkGeometryNV(resourceTracker,
+                                                (VkGeometryNV*)(toTransform->pGeometries + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkAccelerationStructureCreateInfoNV(
+    ResourceTracker* resourceTracker, VkAccelerationStructureCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkAccelerationStructureInfoNV(
+        resourceTracker, (VkAccelerationStructureInfoNV*)(&toTransform->info));
+}
+
+void transform_fromhost_VkAccelerationStructureCreateInfoNV(
+    ResourceTracker* resourceTracker, VkAccelerationStructureCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkAccelerationStructureInfoNV(
+        resourceTracker, (VkAccelerationStructureInfoNV*)(&toTransform->info));
+}
+
+void transform_tohost_VkBindAccelerationStructureMemoryInfoNV(
+    ResourceTracker* resourceTracker, VkBindAccelerationStructureMemoryInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_tohost(
+        (VkDeviceMemory*)&toTransform->memory, 1, (VkDeviceSize*)&toTransform->memoryOffset, 1,
+        (VkDeviceSize*)nullptr, 0, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0);
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkBindAccelerationStructureMemoryInfoNV(
+    ResourceTracker* resourceTracker, VkBindAccelerationStructureMemoryInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_fromhost(
+        (VkDeviceMemory*)&toTransform->memory, 1, (VkDeviceSize*)&toTransform->memoryOffset, 1,
+        (VkDeviceSize*)nullptr, 0, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0);
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkWriteDescriptorSetAccelerationStructureNV(
+    ResourceTracker* resourceTracker, VkWriteDescriptorSetAccelerationStructureNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkWriteDescriptorSetAccelerationStructureNV(
+    ResourceTracker* resourceTracker, VkWriteDescriptorSetAccelerationStructureNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkAccelerationStructureMemoryRequirementsInfoNV(
+    ResourceTracker* resourceTracker,
+    VkAccelerationStructureMemoryRequirementsInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkAccelerationStructureMemoryRequirementsInfoNV(
+    ResourceTracker* resourceTracker,
+    VkAccelerationStructureMemoryRequirementsInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceRayTracingPropertiesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRayTracingPropertiesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceRayTracingPropertiesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRayTracingPropertiesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkTransformMatrixKHR(ResourceTracker* resourceTracker,
+                                           VkTransformMatrixKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkTransformMatrixKHR(ResourceTracker* resourceTracker,
+                                             VkTransformMatrixKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkAabbPositionsKHR(ResourceTracker* resourceTracker,
+                                         VkAabbPositionsKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkAabbPositionsKHR(ResourceTracker* resourceTracker,
+                                           VkAabbPositionsKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkAccelerationStructureInstanceKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureInstanceKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkTransformMatrixKHR(resourceTracker,
+                                          (VkTransformMatrixKHR*)(&toTransform->transform));
+}
+
+void transform_fromhost_VkAccelerationStructureInstanceKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureInstanceKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkTransformMatrixKHR(resourceTracker,
+                                            (VkTransformMatrixKHR*)(&toTransform->transform));
+}
+
+#endif
+#ifdef VK_NV_representative_fragment_test
+void transform_tohost_VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPipelineRepresentativeFragmentTestStateCreateInfoNV(
+    ResourceTracker* resourceTracker,
+    VkPipelineRepresentativeFragmentTestStateCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPipelineRepresentativeFragmentTestStateCreateInfoNV(
+    ResourceTracker* resourceTracker,
+    VkPipelineRepresentativeFragmentTestStateCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_filter_cubic
+void transform_tohost_VkPhysicalDeviceImageViewImageFormatInfoEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceImageViewImageFormatInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceImageViewImageFormatInfoEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceImageViewImageFormatInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkFilterCubicImageViewImageFormatPropertiesEXT(
+    ResourceTracker* resourceTracker, VkFilterCubicImageViewImageFormatPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkFilterCubicImageViewImageFormatPropertiesEXT(
+    ResourceTracker* resourceTracker, VkFilterCubicImageViewImageFormatPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_QCOM_render_pass_shader_resolve
+#endif
+#ifdef VK_EXT_global_priority
+void transform_tohost_VkDeviceQueueGlobalPriorityCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkDeviceQueueGlobalPriorityCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDeviceQueueGlobalPriorityCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkDeviceQueueGlobalPriorityCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_external_memory_host
+void transform_tohost_VkImportMemoryHostPointerInfoEXT(
+    ResourceTracker* resourceTracker, VkImportMemoryHostPointerInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkImportMemoryHostPointerInfoEXT(
+    ResourceTracker* resourceTracker, VkImportMemoryHostPointerInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkMemoryHostPointerPropertiesEXT(
+    ResourceTracker* resourceTracker, VkMemoryHostPointerPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_tohost(
+        (VkDeviceMemory*)nullptr, 0, (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr, 0,
+        (uint32_t*)nullptr, 0, (uint32_t*)&toTransform->memoryTypeBits, 1);
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkMemoryHostPointerPropertiesEXT(
+    ResourceTracker* resourceTracker, VkMemoryHostPointerPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    resourceTracker->deviceMemoryTransform_fromhost(
+        (VkDeviceMemory*)nullptr, 0, (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr, 0,
+        (uint32_t*)nullptr, 0, (uint32_t*)&toTransform->memoryTypeBits, 1);
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceExternalMemoryHostPropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceExternalMemoryHostPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceExternalMemoryHostPropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceExternalMemoryHostPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_buffer_marker
+#endif
+#ifdef VK_AMD_pipeline_compiler_control
+void transform_tohost_VkPipelineCompilerControlCreateInfoAMD(
+    ResourceTracker* resourceTracker, VkPipelineCompilerControlCreateInfoAMD* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPipelineCompilerControlCreateInfoAMD(
+    ResourceTracker* resourceTracker, VkPipelineCompilerControlCreateInfoAMD* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_calibrated_timestamps
+void transform_tohost_VkCalibratedTimestampInfoEXT(ResourceTracker* resourceTracker,
+                                                   VkCalibratedTimestampInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkCalibratedTimestampInfoEXT(ResourceTracker* resourceTracker,
+                                                     VkCalibratedTimestampInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_shader_core_properties
+void transform_tohost_VkPhysicalDeviceShaderCorePropertiesAMD(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderCorePropertiesAMD* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceShaderCorePropertiesAMD(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderCorePropertiesAMD* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_video_decode_h265
+void transform_tohost_VkVideoDecodeH265ProfileEXT(ResourceTracker* resourceTracker,
+                                                  VkVideoDecodeH265ProfileEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkVideoDecodeH265ProfileEXT(ResourceTracker* resourceTracker,
+                                                    VkVideoDecodeH265ProfileEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkVideoDecodeH265CapabilitiesEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH265CapabilitiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkExtensionProperties(
+        resourceTracker, (VkExtensionProperties*)(&toTransform->stdExtensionVersion));
+}
+
+void transform_fromhost_VkVideoDecodeH265CapabilitiesEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH265CapabilitiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkExtensionProperties(
+        resourceTracker, (VkExtensionProperties*)(&toTransform->stdExtensionVersion));
+}
+
+void transform_tohost_VkVideoDecodeH265SessionCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH265SessionCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pStdExtensionVersion) {
+        transform_tohost_VkExtensionProperties(
+            resourceTracker, (VkExtensionProperties*)(toTransform->pStdExtensionVersion));
+    }
+}
+
+void transform_fromhost_VkVideoDecodeH265SessionCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH265SessionCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pStdExtensionVersion) {
+        transform_fromhost_VkExtensionProperties(
+            resourceTracker, (VkExtensionProperties*)(toTransform->pStdExtensionVersion));
+    }
+}
+
+void transform_tohost_VkVideoDecodeH265SessionParametersAddInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH265SessionParametersAddInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkVideoDecodeH265SessionParametersAddInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH265SessionParametersAddInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkVideoDecodeH265SessionParametersCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkVideoDecodeH265SessionParametersCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pParametersAddInfo) {
+        transform_tohost_VkVideoDecodeH265SessionParametersAddInfoEXT(
+            resourceTracker,
+            (VkVideoDecodeH265SessionParametersAddInfoEXT*)(toTransform->pParametersAddInfo));
+    }
+}
+
+void transform_fromhost_VkVideoDecodeH265SessionParametersCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkVideoDecodeH265SessionParametersCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pParametersAddInfo) {
+        transform_fromhost_VkVideoDecodeH265SessionParametersAddInfoEXT(
+            resourceTracker,
+            (VkVideoDecodeH265SessionParametersAddInfoEXT*)(toTransform->pParametersAddInfo));
+    }
+}
+
+void transform_tohost_VkVideoDecodeH265PictureInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH265PictureInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkVideoDecodeH265PictureInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH265PictureInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkVideoDecodeH265DpbSlotInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH265DpbSlotInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkVideoDecodeH265DpbSlotInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH265DpbSlotInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_memory_overallocation_behavior
+void transform_tohost_VkDeviceMemoryOverallocationCreateInfoAMD(
+    ResourceTracker* resourceTracker, VkDeviceMemoryOverallocationCreateInfoAMD* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDeviceMemoryOverallocationCreateInfoAMD(
+    ResourceTracker* resourceTracker, VkDeviceMemoryOverallocationCreateInfoAMD* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_vertex_attribute_divisor
+void transform_tohost_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkVertexInputBindingDivisorDescriptionEXT(
+    ResourceTracker* resourceTracker, VkVertexInputBindingDivisorDescriptionEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkVertexInputBindingDivisorDescriptionEXT(
+    ResourceTracker* resourceTracker, VkVertexInputBindingDivisorDescriptionEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkPipelineVertexInputDivisorStateCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineVertexInputDivisorStateCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pVertexBindingDivisors) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->vertexBindingDivisorCount; ++i) {
+                transform_tohost_VkVertexInputBindingDivisorDescriptionEXT(
+                    resourceTracker,
+                    (VkVertexInputBindingDivisorDescriptionEXT*)(toTransform
+                                                                     ->pVertexBindingDivisors +
+                                                                 i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkPipelineVertexInputDivisorStateCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineVertexInputDivisorStateCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pVertexBindingDivisors) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->vertexBindingDivisorCount; ++i) {
+                transform_fromhost_VkVertexInputBindingDivisorDescriptionEXT(
+                    resourceTracker,
+                    (VkVertexInputBindingDivisorDescriptionEXT*)(toTransform
+                                                                     ->pVertexBindingDivisors +
+                                                                 i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_GGP_frame_token
+void transform_tohost_VkPresentFrameTokenGGP(ResourceTracker* resourceTracker,
+                                             VkPresentFrameTokenGGP* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPresentFrameTokenGGP(ResourceTracker* resourceTracker,
+                                               VkPresentFrameTokenGGP* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_pipeline_creation_feedback
+void transform_tohost_VkPipelineCreationFeedbackEXT(ResourceTracker* resourceTracker,
+                                                    VkPipelineCreationFeedbackEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkPipelineCreationFeedbackEXT(ResourceTracker* resourceTracker,
+                                                      VkPipelineCreationFeedbackEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkPipelineCreationFeedbackCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineCreationFeedbackCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pPipelineCreationFeedback) {
+        transform_tohost_VkPipelineCreationFeedbackEXT(
+            resourceTracker,
+            (VkPipelineCreationFeedbackEXT*)(toTransform->pPipelineCreationFeedback));
+    }
+    if (toTransform) {
+        if (toTransform->pPipelineStageCreationFeedbacks) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->pipelineStageCreationFeedbackCount;
+                 ++i) {
+                transform_tohost_VkPipelineCreationFeedbackEXT(
+                    resourceTracker,
+                    (VkPipelineCreationFeedbackEXT*)(toTransform->pPipelineStageCreationFeedbacks +
+                                                     i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkPipelineCreationFeedbackCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineCreationFeedbackCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pPipelineCreationFeedback) {
+        transform_fromhost_VkPipelineCreationFeedbackEXT(
+            resourceTracker,
+            (VkPipelineCreationFeedbackEXT*)(toTransform->pPipelineCreationFeedback));
+    }
+    if (toTransform) {
+        if (toTransform->pPipelineStageCreationFeedbacks) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->pipelineStageCreationFeedbackCount;
+                 ++i) {
+                transform_fromhost_VkPipelineCreationFeedbackEXT(
+                    resourceTracker,
+                    (VkPipelineCreationFeedbackEXT*)(toTransform->pPipelineStageCreationFeedbacks +
+                                                     i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_NV_shader_subgroup_partitioned
+#endif
+#ifdef VK_NV_compute_shader_derivatives
+void transform_tohost_VkPhysicalDeviceComputeShaderDerivativesFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceComputeShaderDerivativesFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceComputeShaderDerivativesFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceComputeShaderDerivativesFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_mesh_shader
+void transform_tohost_VkPhysicalDeviceMeshShaderFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMeshShaderFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceMeshShaderFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMeshShaderFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceMeshShaderPropertiesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMeshShaderPropertiesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceMeshShaderPropertiesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMeshShaderPropertiesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDrawMeshTasksIndirectCommandNV(
+    ResourceTracker* resourceTracker, VkDrawMeshTasksIndirectCommandNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkDrawMeshTasksIndirectCommandNV(
+    ResourceTracker* resourceTracker, VkDrawMeshTasksIndirectCommandNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+#endif
+#ifdef VK_NV_fragment_shader_barycentric
+void transform_tohost_VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_shader_image_footprint
+void transform_tohost_VkPhysicalDeviceShaderImageFootprintFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderImageFootprintFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceShaderImageFootprintFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderImageFootprintFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_scissor_exclusive
+void transform_tohost_VkPipelineViewportExclusiveScissorStateCreateInfoNV(
+    ResourceTracker* resourceTracker,
+    VkPipelineViewportExclusiveScissorStateCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pExclusiveScissors) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->exclusiveScissorCount; ++i) {
+                transform_tohost_VkRect2D(resourceTracker,
+                                          (VkRect2D*)(toTransform->pExclusiveScissors + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkPipelineViewportExclusiveScissorStateCreateInfoNV(
+    ResourceTracker* resourceTracker,
+    VkPipelineViewportExclusiveScissorStateCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pExclusiveScissors) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->exclusiveScissorCount; ++i) {
+                transform_fromhost_VkRect2D(resourceTracker,
+                                            (VkRect2D*)(toTransform->pExclusiveScissors + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceExclusiveScissorFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceExclusiveScissorFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceExclusiveScissorFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceExclusiveScissorFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+void transform_tohost_VkQueueFamilyCheckpointPropertiesNV(
+    ResourceTracker* resourceTracker, VkQueueFamilyCheckpointPropertiesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkQueueFamilyCheckpointPropertiesNV(
+    ResourceTracker* resourceTracker, VkQueueFamilyCheckpointPropertiesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkCheckpointDataNV(ResourceTracker* resourceTracker,
+                                         VkCheckpointDataNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkCheckpointDataNV(ResourceTracker* resourceTracker,
+                                           VkCheckpointDataNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_INTEL_shader_integer_functions2
+void transform_tohost_VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_INTEL_performance_query
+void transform_tohost_VkPerformanceValueDataINTEL(ResourceTracker* resourceTracker,
+                                                  VkPerformanceValueDataINTEL* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkPerformanceValueDataINTEL(ResourceTracker* resourceTracker,
+                                                    VkPerformanceValueDataINTEL* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkPerformanceValueINTEL(ResourceTracker* resourceTracker,
+                                              VkPerformanceValueINTEL* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkPerformanceValueDataINTEL(
+        resourceTracker, (VkPerformanceValueDataINTEL*)(&toTransform->data));
+}
+
+void transform_fromhost_VkPerformanceValueINTEL(ResourceTracker* resourceTracker,
+                                                VkPerformanceValueINTEL* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkPerformanceValueDataINTEL(
+        resourceTracker, (VkPerformanceValueDataINTEL*)(&toTransform->data));
+}
+
+void transform_tohost_VkInitializePerformanceApiInfoINTEL(
+    ResourceTracker* resourceTracker, VkInitializePerformanceApiInfoINTEL* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkInitializePerformanceApiInfoINTEL(
+    ResourceTracker* resourceTracker, VkInitializePerformanceApiInfoINTEL* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkQueryPoolPerformanceQueryCreateInfoINTEL(
+    ResourceTracker* resourceTracker, VkQueryPoolPerformanceQueryCreateInfoINTEL* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkQueryPoolPerformanceQueryCreateInfoINTEL(
+    ResourceTracker* resourceTracker, VkQueryPoolPerformanceQueryCreateInfoINTEL* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPerformanceMarkerInfoINTEL(ResourceTracker* resourceTracker,
+                                                   VkPerformanceMarkerInfoINTEL* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPerformanceMarkerInfoINTEL(ResourceTracker* resourceTracker,
+                                                     VkPerformanceMarkerInfoINTEL* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPerformanceStreamMarkerInfoINTEL(
+    ResourceTracker* resourceTracker, VkPerformanceStreamMarkerInfoINTEL* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPerformanceStreamMarkerInfoINTEL(
+    ResourceTracker* resourceTracker, VkPerformanceStreamMarkerInfoINTEL* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPerformanceOverrideInfoINTEL(ResourceTracker* resourceTracker,
+                                                     VkPerformanceOverrideInfoINTEL* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPerformanceOverrideInfoINTEL(
+    ResourceTracker* resourceTracker, VkPerformanceOverrideInfoINTEL* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPerformanceConfigurationAcquireInfoINTEL(
+    ResourceTracker* resourceTracker, VkPerformanceConfigurationAcquireInfoINTEL* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPerformanceConfigurationAcquireInfoINTEL(
+    ResourceTracker* resourceTracker, VkPerformanceConfigurationAcquireInfoINTEL* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_pci_bus_info
+void transform_tohost_VkPhysicalDevicePCIBusInfoPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePCIBusInfoPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDevicePCIBusInfoPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePCIBusInfoPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_display_native_hdr
+void transform_tohost_VkDisplayNativeHdrSurfaceCapabilitiesAMD(
+    ResourceTracker* resourceTracker, VkDisplayNativeHdrSurfaceCapabilitiesAMD* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDisplayNativeHdrSurfaceCapabilitiesAMD(
+    ResourceTracker* resourceTracker, VkDisplayNativeHdrSurfaceCapabilitiesAMD* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkSwapchainDisplayNativeHdrCreateInfoAMD(
+    ResourceTracker* resourceTracker, VkSwapchainDisplayNativeHdrCreateInfoAMD* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkSwapchainDisplayNativeHdrCreateInfoAMD(
+    ResourceTracker* resourceTracker, VkSwapchainDisplayNativeHdrCreateInfoAMD* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_FUCHSIA_imagepipe_surface
+void transform_tohost_VkImagePipeSurfaceCreateInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkImagePipeSurfaceCreateInfoFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkImagePipeSurfaceCreateInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkImagePipeSurfaceCreateInfoFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_metal_surface
+void transform_tohost_VkMetalSurfaceCreateInfoEXT(ResourceTracker* resourceTracker,
+                                                  VkMetalSurfaceCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkMetalSurfaceCreateInfoEXT(ResourceTracker* resourceTracker,
+                                                    VkMetalSurfaceCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_fragment_density_map
+void transform_tohost_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceFragmentDensityMapFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceFragmentDensityMapFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceFragmentDensityMapPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkExtent2D(resourceTracker,
+                                (VkExtent2D*)(&toTransform->minFragmentDensityTexelSize));
+    transform_tohost_VkExtent2D(resourceTracker,
+                                (VkExtent2D*)(&toTransform->maxFragmentDensityTexelSize));
+}
+
+void transform_fromhost_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceFragmentDensityMapPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkExtent2D(resourceTracker,
+                                  (VkExtent2D*)(&toTransform->minFragmentDensityTexelSize));
+    transform_fromhost_VkExtent2D(resourceTracker,
+                                  (VkExtent2D*)(&toTransform->maxFragmentDensityTexelSize));
+}
+
+void transform_tohost_VkRenderPassFragmentDensityMapCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkRenderPassFragmentDensityMapCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkAttachmentReference(
+        resourceTracker, (VkAttachmentReference*)(&toTransform->fragmentDensityMapAttachment));
+}
+
+void transform_fromhost_VkRenderPassFragmentDensityMapCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkRenderPassFragmentDensityMapCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkAttachmentReference(
+        resourceTracker, (VkAttachmentReference*)(&toTransform->fragmentDensityMapAttachment));
+}
+
+#endif
+#ifdef VK_EXT_scalar_block_layout
+#endif
+#ifdef VK_GOOGLE_hlsl_functionality1
+#endif
+#ifdef VK_GOOGLE_decorate_string
+#endif
+#ifdef VK_EXT_subgroup_size_control
+void transform_tohost_VkPhysicalDeviceSubgroupSizeControlFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSubgroupSizeControlFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceSubgroupSizeControlFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSubgroupSizeControlFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceSubgroupSizeControlPropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceSubgroupSizeControlPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceSubgroupSizeControlPropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceSubgroupSizeControlPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_shader_core_properties2
+void transform_tohost_VkPhysicalDeviceShaderCoreProperties2AMD(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderCoreProperties2AMD* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceShaderCoreProperties2AMD(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderCoreProperties2AMD* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_AMD_device_coherent_memory
+void transform_tohost_VkPhysicalDeviceCoherentMemoryFeaturesAMD(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceCoherentMemoryFeaturesAMD* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceCoherentMemoryFeaturesAMD(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceCoherentMemoryFeaturesAMD* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_shader_image_atomic_int64
+void transform_tohost_VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_memory_budget
+void transform_tohost_VkPhysicalDeviceMemoryBudgetPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMemoryBudgetPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceMemoryBudgetPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMemoryBudgetPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_memory_priority
+void transform_tohost_VkPhysicalDeviceMemoryPriorityFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMemoryPriorityFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceMemoryPriorityFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMemoryPriorityFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkMemoryPriorityAllocateInfoEXT(
+    ResourceTracker* resourceTracker, VkMemoryPriorityAllocateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkMemoryPriorityAllocateInfoEXT(
+    ResourceTracker* resourceTracker, VkMemoryPriorityAllocateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_dedicated_allocation_image_aliasing
+void transform_tohost_VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_buffer_device_address
+void transform_tohost_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceBufferDeviceAddressFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceBufferDeviceAddressFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkBufferDeviceAddressCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkBufferDeviceAddressCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkBufferDeviceAddressCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkBufferDeviceAddressCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_tooling_info
+void transform_tohost_VkPhysicalDeviceToolPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceToolPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceToolPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceToolPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_separate_stencil_usage
+#endif
+#ifdef VK_EXT_validation_features
+void transform_tohost_VkValidationFeaturesEXT(ResourceTracker* resourceTracker,
+                                              VkValidationFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkValidationFeaturesEXT(ResourceTracker* resourceTracker,
+                                                VkValidationFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_cooperative_matrix
+void transform_tohost_VkCooperativeMatrixPropertiesNV(
+    ResourceTracker* resourceTracker, VkCooperativeMatrixPropertiesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkCooperativeMatrixPropertiesNV(
+    ResourceTracker* resourceTracker, VkCooperativeMatrixPropertiesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceCooperativeMatrixFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceCooperativeMatrixFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceCooperativeMatrixFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceCooperativeMatrixFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceCooperativeMatrixPropertiesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceCooperativeMatrixPropertiesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceCooperativeMatrixPropertiesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceCooperativeMatrixPropertiesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+void transform_tohost_VkPhysicalDeviceCoverageReductionModeFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceCoverageReductionModeFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceCoverageReductionModeFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceCoverageReductionModeFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPipelineCoverageReductionStateCreateInfoNV(
+    ResourceTracker* resourceTracker, VkPipelineCoverageReductionStateCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPipelineCoverageReductionStateCreateInfoNV(
+    ResourceTracker* resourceTracker, VkPipelineCoverageReductionStateCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkFramebufferMixedSamplesCombinationNV(
+    ResourceTracker* resourceTracker, VkFramebufferMixedSamplesCombinationNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkFramebufferMixedSamplesCombinationNV(
+    ResourceTracker* resourceTracker, VkFramebufferMixedSamplesCombinationNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_fragment_shader_interlock
+void transform_tohost_VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_ycbcr_image_arrays
+void transform_tohost_VkPhysicalDeviceYcbcrImageArraysFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceYcbcrImageArraysFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceYcbcrImageArraysFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceYcbcrImageArraysFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_provoking_vertex
+void transform_tohost_VkPhysicalDeviceProvokingVertexFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceProvokingVertexFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceProvokingVertexFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceProvokingVertexFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceProvokingVertexPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceProvokingVertexPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceProvokingVertexPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceProvokingVertexPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkPipelineRasterizationProvokingVertexStateCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkPipelineRasterizationProvokingVertexStateCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+void transform_tohost_VkSurfaceFullScreenExclusiveInfoEXT(
+    ResourceTracker* resourceTracker, VkSurfaceFullScreenExclusiveInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkSurfaceFullScreenExclusiveInfoEXT(
+    ResourceTracker* resourceTracker, VkSurfaceFullScreenExclusiveInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkSurfaceCapabilitiesFullScreenExclusiveEXT(
+    ResourceTracker* resourceTracker, VkSurfaceCapabilitiesFullScreenExclusiveEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkSurfaceCapabilitiesFullScreenExclusiveEXT(
+    ResourceTracker* resourceTracker, VkSurfaceCapabilitiesFullScreenExclusiveEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkSurfaceFullScreenExclusiveWin32InfoEXT(
+    ResourceTracker* resourceTracker, VkSurfaceFullScreenExclusiveWin32InfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkSurfaceFullScreenExclusiveWin32InfoEXT(
+    ResourceTracker* resourceTracker, VkSurfaceFullScreenExclusiveWin32InfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_headless_surface
+void transform_tohost_VkHeadlessSurfaceCreateInfoEXT(ResourceTracker* resourceTracker,
+                                                     VkHeadlessSurfaceCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkHeadlessSurfaceCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkHeadlessSurfaceCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_line_rasterization
+void transform_tohost_VkPhysicalDeviceLineRasterizationFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceLineRasterizationFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceLineRasterizationFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceLineRasterizationFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceLineRasterizationPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceLineRasterizationPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceLineRasterizationPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceLineRasterizationPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPipelineRasterizationLineStateCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineRasterizationLineStateCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPipelineRasterizationLineStateCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineRasterizationLineStateCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_shader_atomic_float
+void transform_tohost_VkPhysicalDeviceShaderAtomicFloatFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderAtomicFloatFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceShaderAtomicFloatFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderAtomicFloatFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_host_query_reset
+#endif
+#ifdef VK_EXT_index_type_uint8
+void transform_tohost_VkPhysicalDeviceIndexTypeUint8FeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceIndexTypeUint8FeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceIndexTypeUint8FeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceIndexTypeUint8FeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+void transform_tohost_VkPhysicalDeviceExtendedDynamicStateFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceExtendedDynamicStateFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceExtendedDynamicStateFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceExtendedDynamicStateFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_shader_atomic_float2
+void transform_tohost_VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_shader_demote_to_helper_invocation
+void transform_tohost_VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_device_generated_commands
+void transform_tohost_VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkGraphicsShaderGroupCreateInfoNV(
+    ResourceTracker* resourceTracker, VkGraphicsShaderGroupCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pStages) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->stageCount; ++i) {
+                transform_tohost_VkPipelineShaderStageCreateInfo(
+                    resourceTracker, (VkPipelineShaderStageCreateInfo*)(toTransform->pStages + i));
+            }
+        }
+    }
+    if (toTransform->pVertexInputState) {
+        transform_tohost_VkPipelineVertexInputStateCreateInfo(
+            resourceTracker,
+            (VkPipelineVertexInputStateCreateInfo*)(toTransform->pVertexInputState));
+    }
+    if (toTransform->pTessellationState) {
+        transform_tohost_VkPipelineTessellationStateCreateInfo(
+            resourceTracker,
+            (VkPipelineTessellationStateCreateInfo*)(toTransform->pTessellationState));
+    }
+}
+
+void transform_fromhost_VkGraphicsShaderGroupCreateInfoNV(
+    ResourceTracker* resourceTracker, VkGraphicsShaderGroupCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pStages) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->stageCount; ++i) {
+                transform_fromhost_VkPipelineShaderStageCreateInfo(
+                    resourceTracker, (VkPipelineShaderStageCreateInfo*)(toTransform->pStages + i));
+            }
+        }
+    }
+    if (toTransform->pVertexInputState) {
+        transform_fromhost_VkPipelineVertexInputStateCreateInfo(
+            resourceTracker,
+            (VkPipelineVertexInputStateCreateInfo*)(toTransform->pVertexInputState));
+    }
+    if (toTransform->pTessellationState) {
+        transform_fromhost_VkPipelineTessellationStateCreateInfo(
+            resourceTracker,
+            (VkPipelineTessellationStateCreateInfo*)(toTransform->pTessellationState));
+    }
+}
+
+void transform_tohost_VkGraphicsPipelineShaderGroupsCreateInfoNV(
+    ResourceTracker* resourceTracker, VkGraphicsPipelineShaderGroupsCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pGroups) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->groupCount; ++i) {
+                transform_tohost_VkGraphicsShaderGroupCreateInfoNV(
+                    resourceTracker,
+                    (VkGraphicsShaderGroupCreateInfoNV*)(toTransform->pGroups + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkGraphicsPipelineShaderGroupsCreateInfoNV(
+    ResourceTracker* resourceTracker, VkGraphicsPipelineShaderGroupsCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pGroups) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->groupCount; ++i) {
+                transform_fromhost_VkGraphicsShaderGroupCreateInfoNV(
+                    resourceTracker,
+                    (VkGraphicsShaderGroupCreateInfoNV*)(toTransform->pGroups + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkBindShaderGroupIndirectCommandNV(
+    ResourceTracker* resourceTracker, VkBindShaderGroupIndirectCommandNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkBindShaderGroupIndirectCommandNV(
+    ResourceTracker* resourceTracker, VkBindShaderGroupIndirectCommandNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkBindIndexBufferIndirectCommandNV(
+    ResourceTracker* resourceTracker, VkBindIndexBufferIndirectCommandNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkBindIndexBufferIndirectCommandNV(
+    ResourceTracker* resourceTracker, VkBindIndexBufferIndirectCommandNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkBindVertexBufferIndirectCommandNV(
+    ResourceTracker* resourceTracker, VkBindVertexBufferIndirectCommandNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkBindVertexBufferIndirectCommandNV(
+    ResourceTracker* resourceTracker, VkBindVertexBufferIndirectCommandNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkSetStateFlagsIndirectCommandNV(
+    ResourceTracker* resourceTracker, VkSetStateFlagsIndirectCommandNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkSetStateFlagsIndirectCommandNV(
+    ResourceTracker* resourceTracker, VkSetStateFlagsIndirectCommandNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkIndirectCommandsStreamNV(ResourceTracker* resourceTracker,
+                                                 VkIndirectCommandsStreamNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkIndirectCommandsStreamNV(ResourceTracker* resourceTracker,
+                                                   VkIndirectCommandsStreamNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkIndirectCommandsLayoutTokenNV(
+    ResourceTracker* resourceTracker, VkIndirectCommandsLayoutTokenNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkIndirectCommandsLayoutTokenNV(
+    ResourceTracker* resourceTracker, VkIndirectCommandsLayoutTokenNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkIndirectCommandsLayoutCreateInfoNV(
+    ResourceTracker* resourceTracker, VkIndirectCommandsLayoutCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pTokens) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->tokenCount; ++i) {
+                transform_tohost_VkIndirectCommandsLayoutTokenNV(
+                    resourceTracker, (VkIndirectCommandsLayoutTokenNV*)(toTransform->pTokens + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkIndirectCommandsLayoutCreateInfoNV(
+    ResourceTracker* resourceTracker, VkIndirectCommandsLayoutCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pTokens) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->tokenCount; ++i) {
+                transform_fromhost_VkIndirectCommandsLayoutTokenNV(
+                    resourceTracker, (VkIndirectCommandsLayoutTokenNV*)(toTransform->pTokens + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkGeneratedCommandsInfoNV(ResourceTracker* resourceTracker,
+                                                VkGeneratedCommandsInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pStreams) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->streamCount; ++i) {
+                transform_tohost_VkIndirectCommandsStreamNV(
+                    resourceTracker, (VkIndirectCommandsStreamNV*)(toTransform->pStreams + i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkGeneratedCommandsInfoNV(ResourceTracker* resourceTracker,
+                                                  VkGeneratedCommandsInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pStreams) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->streamCount; ++i) {
+                transform_fromhost_VkIndirectCommandsStreamNV(
+                    resourceTracker, (VkIndirectCommandsStreamNV*)(toTransform->pStreams + i));
+            }
+        }
+    }
+}
+
+void transform_tohost_VkGeneratedCommandsMemoryRequirementsInfoNV(
+    ResourceTracker* resourceTracker, VkGeneratedCommandsMemoryRequirementsInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkGeneratedCommandsMemoryRequirementsInfoNV(
+    ResourceTracker* resourceTracker, VkGeneratedCommandsMemoryRequirementsInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_inherited_viewport_scissor
+void transform_tohost_VkPhysicalDeviceInheritedViewportScissorFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceInheritedViewportScissorFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceInheritedViewportScissorFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceInheritedViewportScissorFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkCommandBufferInheritanceViewportScissorInfoNV(
+    ResourceTracker* resourceTracker,
+    VkCommandBufferInheritanceViewportScissorInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pViewportDepths) {
+        transform_tohost_VkViewport(resourceTracker, (VkViewport*)(toTransform->pViewportDepths));
+    }
+}
+
+void transform_fromhost_VkCommandBufferInheritanceViewportScissorInfoNV(
+    ResourceTracker* resourceTracker,
+    VkCommandBufferInheritanceViewportScissorInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform->pViewportDepths) {
+        transform_fromhost_VkViewport(resourceTracker, (VkViewport*)(toTransform->pViewportDepths));
+    }
+}
+
+#endif
+#ifdef VK_EXT_texel_buffer_alignment
+void transform_tohost_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_QCOM_render_pass_transform
+void transform_tohost_VkRenderPassTransformBeginInfoQCOM(
+    ResourceTracker* resourceTracker, VkRenderPassTransformBeginInfoQCOM* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkRenderPassTransformBeginInfoQCOM(
+    ResourceTracker* resourceTracker, VkRenderPassTransformBeginInfoQCOM* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkCommandBufferInheritanceRenderPassTransformInfoQCOM(
+    ResourceTracker* resourceTracker,
+    VkCommandBufferInheritanceRenderPassTransformInfoQCOM* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkRect2D(resourceTracker, (VkRect2D*)(&toTransform->renderArea));
+}
+
+void transform_fromhost_VkCommandBufferInheritanceRenderPassTransformInfoQCOM(
+    ResourceTracker* resourceTracker,
+    VkCommandBufferInheritanceRenderPassTransformInfoQCOM* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkRect2D(resourceTracker, (VkRect2D*)(&toTransform->renderArea));
+}
+
+#endif
+#ifdef VK_EXT_device_memory_report
+void transform_tohost_VkPhysicalDeviceDeviceMemoryReportFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDeviceMemoryReportFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceDeviceMemoryReportFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDeviceMemoryReportFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDeviceMemoryReportCallbackDataEXT(
+    ResourceTracker* resourceTracker, VkDeviceMemoryReportCallbackDataEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDeviceMemoryReportCallbackDataEXT(
+    ResourceTracker* resourceTracker, VkDeviceMemoryReportCallbackDataEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDeviceDeviceMemoryReportCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkDeviceDeviceMemoryReportCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDeviceDeviceMemoryReportCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkDeviceDeviceMemoryReportCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_acquire_drm_display
+#endif
+#ifdef VK_EXT_robustness2
+void transform_tohost_VkPhysicalDeviceRobustness2FeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRobustness2FeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceRobustness2FeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRobustness2FeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceRobustness2PropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRobustness2PropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceRobustness2PropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRobustness2PropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_custom_border_color
+void transform_tohost_VkSamplerCustomBorderColorCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkSamplerCustomBorderColorCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkClearColorValue(resourceTracker,
+                                       (VkClearColorValue*)(&toTransform->customBorderColor));
+}
+
+void transform_fromhost_VkSamplerCustomBorderColorCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkSamplerCustomBorderColorCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkClearColorValue(resourceTracker,
+                                         (VkClearColorValue*)(&toTransform->customBorderColor));
+}
+
+void transform_tohost_VkPhysicalDeviceCustomBorderColorPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceCustomBorderColorPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceCustomBorderColorPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceCustomBorderColorPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceCustomBorderColorFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceCustomBorderColorFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceCustomBorderColorFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceCustomBorderColorFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_GOOGLE_user_type
+#endif
+#ifdef VK_EXT_private_data
+void transform_tohost_VkPhysicalDevicePrivateDataFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePrivateDataFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDevicePrivateDataFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePrivateDataFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDevicePrivateDataCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkDevicePrivateDataCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDevicePrivateDataCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkDevicePrivateDataCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPrivateDataSlotCreateInfoEXT(ResourceTracker* resourceTracker,
+                                                     VkPrivateDataSlotCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPrivateDataSlotCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPrivateDataSlotCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_pipeline_creation_cache_control
+void transform_tohost_VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_device_diagnostics_config
+void transform_tohost_VkPhysicalDeviceDiagnosticsConfigFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDiagnosticsConfigFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceDiagnosticsConfigFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDiagnosticsConfigFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkDeviceDiagnosticsConfigCreateInfoNV(
+    ResourceTracker* resourceTracker, VkDeviceDiagnosticsConfigCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDeviceDiagnosticsConfigCreateInfoNV(
+    ResourceTracker* resourceTracker, VkDeviceDiagnosticsConfigCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_QCOM_render_pass_store_ops
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+void transform_tohost_VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPipelineFragmentShadingRateEnumStateCreateInfoNV(
+    ResourceTracker* resourceTracker,
+    VkPipelineFragmentShadingRateEnumStateCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPipelineFragmentShadingRateEnumStateCreateInfoNV(
+    ResourceTracker* resourceTracker,
+    VkPipelineFragmentShadingRateEnumStateCreateInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_ray_tracing_motion_blur
+void transform_tohost_VkDeviceOrHostAddressConstKHR(ResourceTracker* resourceTracker,
+                                                    VkDeviceOrHostAddressConstKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkDeviceOrHostAddressConstKHR(ResourceTracker* resourceTracker,
+                                                      VkDeviceOrHostAddressConstKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkAccelerationStructureGeometryMotionTrianglesDataNV(
+    ResourceTracker* resourceTracker,
+    VkAccelerationStructureGeometryMotionTrianglesDataNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkDeviceOrHostAddressConstKHR(
+        resourceTracker, (VkDeviceOrHostAddressConstKHR*)(&toTransform->vertexData));
+}
+
+void transform_fromhost_VkAccelerationStructureGeometryMotionTrianglesDataNV(
+    ResourceTracker* resourceTracker,
+    VkAccelerationStructureGeometryMotionTrianglesDataNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkDeviceOrHostAddressConstKHR(
+        resourceTracker, (VkDeviceOrHostAddressConstKHR*)(&toTransform->vertexData));
+}
+
+void transform_tohost_VkAccelerationStructureMotionInfoNV(
+    ResourceTracker* resourceTracker, VkAccelerationStructureMotionInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkAccelerationStructureMotionInfoNV(
+    ResourceTracker* resourceTracker, VkAccelerationStructureMotionInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkAccelerationStructureMatrixMotionInstanceNV(
+    ResourceTracker* resourceTracker, VkAccelerationStructureMatrixMotionInstanceNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkTransformMatrixKHR(resourceTracker,
+                                          (VkTransformMatrixKHR*)(&toTransform->transformT0));
+    transform_tohost_VkTransformMatrixKHR(resourceTracker,
+                                          (VkTransformMatrixKHR*)(&toTransform->transformT1));
+}
+
+void transform_fromhost_VkAccelerationStructureMatrixMotionInstanceNV(
+    ResourceTracker* resourceTracker, VkAccelerationStructureMatrixMotionInstanceNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkTransformMatrixKHR(resourceTracker,
+                                            (VkTransformMatrixKHR*)(&toTransform->transformT0));
+    transform_fromhost_VkTransformMatrixKHR(resourceTracker,
+                                            (VkTransformMatrixKHR*)(&toTransform->transformT1));
+}
+
+void transform_tohost_VkSRTDataNV(ResourceTracker* resourceTracker, VkSRTDataNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkSRTDataNV(ResourceTracker* resourceTracker, VkSRTDataNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkAccelerationStructureSRTMotionInstanceNV(
+    ResourceTracker* resourceTracker, VkAccelerationStructureSRTMotionInstanceNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkSRTDataNV(resourceTracker, (VkSRTDataNV*)(&toTransform->transformT0));
+    transform_tohost_VkSRTDataNV(resourceTracker, (VkSRTDataNV*)(&toTransform->transformT1));
+}
+
+void transform_fromhost_VkAccelerationStructureSRTMotionInstanceNV(
+    ResourceTracker* resourceTracker, VkAccelerationStructureSRTMotionInstanceNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkSRTDataNV(resourceTracker, (VkSRTDataNV*)(&toTransform->transformT0));
+    transform_fromhost_VkSRTDataNV(resourceTracker, (VkSRTDataNV*)(&toTransform->transformT1));
+}
+
+void transform_tohost_VkAccelerationStructureMotionInstanceDataNV(
+    ResourceTracker* resourceTracker, VkAccelerationStructureMotionInstanceDataNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkAccelerationStructureInstanceKHR(
+        resourceTracker, (VkAccelerationStructureInstanceKHR*)(&toTransform->staticInstance));
+    transform_tohost_VkAccelerationStructureMatrixMotionInstanceNV(
+        resourceTracker,
+        (VkAccelerationStructureMatrixMotionInstanceNV*)(&toTransform->matrixMotionInstance));
+    transform_tohost_VkAccelerationStructureSRTMotionInstanceNV(
+        resourceTracker,
+        (VkAccelerationStructureSRTMotionInstanceNV*)(&toTransform->srtMotionInstance));
+}
+
+void transform_fromhost_VkAccelerationStructureMotionInstanceDataNV(
+    ResourceTracker* resourceTracker, VkAccelerationStructureMotionInstanceDataNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkAccelerationStructureInstanceKHR(
+        resourceTracker, (VkAccelerationStructureInstanceKHR*)(&toTransform->staticInstance));
+    transform_fromhost_VkAccelerationStructureMatrixMotionInstanceNV(
+        resourceTracker,
+        (VkAccelerationStructureMatrixMotionInstanceNV*)(&toTransform->matrixMotionInstance));
+    transform_fromhost_VkAccelerationStructureSRTMotionInstanceNV(
+        resourceTracker,
+        (VkAccelerationStructureSRTMotionInstanceNV*)(&toTransform->srtMotionInstance));
+}
+
+void transform_tohost_VkAccelerationStructureMotionInstanceNV(
+    ResourceTracker* resourceTracker, VkAccelerationStructureMotionInstanceNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkAccelerationStructureMotionInstanceDataNV(
+        resourceTracker, (VkAccelerationStructureMotionInstanceDataNV*)(&toTransform->data));
+}
+
+void transform_fromhost_VkAccelerationStructureMotionInstanceNV(
+    ResourceTracker* resourceTracker, VkAccelerationStructureMotionInstanceNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkAccelerationStructureMotionInstanceDataNV(
+        resourceTracker, (VkAccelerationStructureMotionInstanceDataNV*)(&toTransform->data));
+}
+
+void transform_tohost_VkPhysicalDeviceRayTracingMotionBlurFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRayTracingMotionBlurFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceRayTracingMotionBlurFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRayTracingMotionBlurFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_ycbcr_2plane_444_formats
+void transform_tohost_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_fragment_density_map2
+void transform_tohost_VkPhysicalDeviceFragmentDensityMap2FeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceFragmentDensityMap2FeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceFragmentDensityMap2FeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceFragmentDensityMap2FeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceFragmentDensityMap2PropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceFragmentDensityMap2PropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceFragmentDensityMap2PropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceFragmentDensityMap2PropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_QCOM_rotated_copy_commands
+void transform_tohost_VkCopyCommandTransformInfoQCOM(ResourceTracker* resourceTracker,
+                                                     VkCopyCommandTransformInfoQCOM* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkCopyCommandTransformInfoQCOM(
+    ResourceTracker* resourceTracker, VkCopyCommandTransformInfoQCOM* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_image_robustness
+void transform_tohost_VkPhysicalDeviceImageRobustnessFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceImageRobustnessFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceImageRobustnessFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceImageRobustnessFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_4444_formats
+void transform_tohost_VkPhysicalDevice4444FormatsFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDevice4444FormatsFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDevice4444FormatsFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDevice4444FormatsFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_rgba10x6_formats
+void transform_tohost_VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_acquire_winrt_display
+#endif
+#ifdef VK_EXT_directfb_surface
+void transform_tohost_VkDirectFBSurfaceCreateInfoEXT(ResourceTracker* resourceTracker,
+                                                     VkDirectFBSurfaceCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkDirectFBSurfaceCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkDirectFBSurfaceCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_VALVE_mutable_descriptor_type
+void transform_tohost_VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkMutableDescriptorTypeListVALVE(
+    ResourceTracker* resourceTracker, VkMutableDescriptorTypeListVALVE* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkMutableDescriptorTypeListVALVE(
+    ResourceTracker* resourceTracker, VkMutableDescriptorTypeListVALVE* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkMutableDescriptorTypeCreateInfoVALVE(
+    ResourceTracker* resourceTracker, VkMutableDescriptorTypeCreateInfoVALVE* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pMutableDescriptorTypeLists) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->mutableDescriptorTypeListCount; ++i) {
+                transform_tohost_VkMutableDescriptorTypeListVALVE(
+                    resourceTracker,
+                    (VkMutableDescriptorTypeListVALVE*)(toTransform->pMutableDescriptorTypeLists +
+                                                        i));
+            }
+        }
+    }
+}
+
+void transform_fromhost_VkMutableDescriptorTypeCreateInfoVALVE(
+    ResourceTracker* resourceTracker, VkMutableDescriptorTypeCreateInfoVALVE* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pMutableDescriptorTypeLists) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->mutableDescriptorTypeListCount; ++i) {
+                transform_fromhost_VkMutableDescriptorTypeListVALVE(
+                    resourceTracker,
+                    (VkMutableDescriptorTypeListVALVE*)(toTransform->pMutableDescriptorTypeLists +
+                                                        i));
+            }
+        }
+    }
+}
+
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+void transform_tohost_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkVertexInputBindingDescription2EXT(
+    ResourceTracker* resourceTracker, VkVertexInputBindingDescription2EXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkVertexInputBindingDescription2EXT(
+    ResourceTracker* resourceTracker, VkVertexInputBindingDescription2EXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkVertexInputAttributeDescription2EXT(
+    ResourceTracker* resourceTracker, VkVertexInputAttributeDescription2EXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkVertexInputAttributeDescription2EXT(
+    ResourceTracker* resourceTracker, VkVertexInputAttributeDescription2EXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_physical_device_drm
+void transform_tohost_VkPhysicalDeviceDrmPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDrmPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceDrmPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDrmPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_primitive_topology_list_restart
+void transform_tohost_VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_FUCHSIA_external_memory
+void transform_tohost_VkImportMemoryZirconHandleInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkImportMemoryZirconHandleInfoFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkImportMemoryZirconHandleInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkImportMemoryZirconHandleInfoFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkMemoryZirconHandlePropertiesFUCHSIA(
+    ResourceTracker* resourceTracker, VkMemoryZirconHandlePropertiesFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkMemoryZirconHandlePropertiesFUCHSIA(
+    ResourceTracker* resourceTracker, VkMemoryZirconHandlePropertiesFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkMemoryGetZirconHandleInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkMemoryGetZirconHandleInfoFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkMemoryGetZirconHandleInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkMemoryGetZirconHandleInfoFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_FUCHSIA_external_semaphore
+void transform_tohost_VkImportSemaphoreZirconHandleInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkImportSemaphoreZirconHandleInfoFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkImportSemaphoreZirconHandleInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkImportSemaphoreZirconHandleInfoFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkSemaphoreGetZirconHandleInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkSemaphoreGetZirconHandleInfoFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkSemaphoreGetZirconHandleInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkSemaphoreGetZirconHandleInfoFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+void transform_tohost_VkBufferCollectionCreateInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkBufferCollectionCreateInfoFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkBufferCollectionCreateInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkBufferCollectionCreateInfoFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkImportMemoryBufferCollectionFUCHSIA(
+    ResourceTracker* resourceTracker, VkImportMemoryBufferCollectionFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkImportMemoryBufferCollectionFUCHSIA(
+    ResourceTracker* resourceTracker, VkImportMemoryBufferCollectionFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkBufferCollectionImageCreateInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkBufferCollectionImageCreateInfoFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkBufferCollectionImageCreateInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkBufferCollectionImageCreateInfoFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkBufferCollectionConstraintsInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkBufferCollectionConstraintsInfoFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkBufferCollectionConstraintsInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkBufferCollectionConstraintsInfoFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkBufferConstraintsInfoFUCHSIA(ResourceTracker* resourceTracker,
+                                                     VkBufferConstraintsInfoFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkBufferCreateInfo(resourceTracker,
+                                        (VkBufferCreateInfo*)(&toTransform->createInfo));
+    transform_tohost_VkBufferCollectionConstraintsInfoFUCHSIA(
+        resourceTracker,
+        (VkBufferCollectionConstraintsInfoFUCHSIA*)(&toTransform->bufferCollectionConstraints));
+}
+
+void transform_fromhost_VkBufferConstraintsInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkBufferConstraintsInfoFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkBufferCreateInfo(resourceTracker,
+                                          (VkBufferCreateInfo*)(&toTransform->createInfo));
+    transform_fromhost_VkBufferCollectionConstraintsInfoFUCHSIA(
+        resourceTracker,
+        (VkBufferCollectionConstraintsInfoFUCHSIA*)(&toTransform->bufferCollectionConstraints));
+}
+
+void transform_tohost_VkBufferCollectionBufferCreateInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkBufferCollectionBufferCreateInfoFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkBufferCollectionBufferCreateInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkBufferCollectionBufferCreateInfoFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkSysmemColorSpaceFUCHSIA(ResourceTracker* resourceTracker,
+                                                VkSysmemColorSpaceFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkSysmemColorSpaceFUCHSIA(ResourceTracker* resourceTracker,
+                                                  VkSysmemColorSpaceFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkBufferCollectionPropertiesFUCHSIA(
+    ResourceTracker* resourceTracker, VkBufferCollectionPropertiesFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkSysmemColorSpaceFUCHSIA(
+        resourceTracker, (VkSysmemColorSpaceFUCHSIA*)(&toTransform->sysmemColorSpaceIndex));
+    transform_tohost_VkComponentMapping(
+        resourceTracker, (VkComponentMapping*)(&toTransform->samplerYcbcrConversionComponents));
+}
+
+void transform_fromhost_VkBufferCollectionPropertiesFUCHSIA(
+    ResourceTracker* resourceTracker, VkBufferCollectionPropertiesFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkSysmemColorSpaceFUCHSIA(
+        resourceTracker, (VkSysmemColorSpaceFUCHSIA*)(&toTransform->sysmemColorSpaceIndex));
+    transform_fromhost_VkComponentMapping(
+        resourceTracker, (VkComponentMapping*)(&toTransform->samplerYcbcrConversionComponents));
+}
+
+void transform_tohost_VkImageFormatConstraintsInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkImageFormatConstraintsInfoFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    resourceTracker->transformImpl_VkImageCreateInfo_tohost(&toTransform->imageCreateInfo, 1);
+    transform_tohost_VkImageCreateInfo(resourceTracker,
+                                       (VkImageCreateInfo*)(&toTransform->imageCreateInfo));
+    if (toTransform->pColorSpaces) {
+        transform_tohost_VkSysmemColorSpaceFUCHSIA(
+            resourceTracker, (VkSysmemColorSpaceFUCHSIA*)(toTransform->pColorSpaces));
+    }
+}
+
+void transform_fromhost_VkImageFormatConstraintsInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkImageFormatConstraintsInfoFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    resourceTracker->transformImpl_VkImageCreateInfo_fromhost(&toTransform->imageCreateInfo, 1);
+    transform_fromhost_VkImageCreateInfo(resourceTracker,
+                                         (VkImageCreateInfo*)(&toTransform->imageCreateInfo));
+    if (toTransform->pColorSpaces) {
+        transform_fromhost_VkSysmemColorSpaceFUCHSIA(
+            resourceTracker, (VkSysmemColorSpaceFUCHSIA*)(toTransform->pColorSpaces));
+    }
+}
+
+void transform_tohost_VkImageConstraintsInfoFUCHSIA(ResourceTracker* resourceTracker,
+                                                    VkImageConstraintsInfoFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pFormatConstraints) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->formatConstraintsCount; ++i) {
+                transform_tohost_VkImageFormatConstraintsInfoFUCHSIA(
+                    resourceTracker,
+                    (VkImageFormatConstraintsInfoFUCHSIA*)(toTransform->pFormatConstraints + i));
+            }
+        }
+    }
+    transform_tohost_VkBufferCollectionConstraintsInfoFUCHSIA(
+        resourceTracker,
+        (VkBufferCollectionConstraintsInfoFUCHSIA*)(&toTransform->bufferCollectionConstraints));
+}
+
+void transform_fromhost_VkImageConstraintsInfoFUCHSIA(ResourceTracker* resourceTracker,
+                                                      VkImageConstraintsInfoFUCHSIA* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pFormatConstraints) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->formatConstraintsCount; ++i) {
+                transform_fromhost_VkImageFormatConstraintsInfoFUCHSIA(
+                    resourceTracker,
+                    (VkImageFormatConstraintsInfoFUCHSIA*)(toTransform->pFormatConstraints + i));
+            }
+        }
+    }
+    transform_fromhost_VkBufferCollectionConstraintsInfoFUCHSIA(
+        resourceTracker,
+        (VkBufferCollectionConstraintsInfoFUCHSIA*)(&toTransform->bufferCollectionConstraints));
+}
+
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+void transform_tohost_VkSubpassShadingPipelineCreateInfoHUAWEI(
+    ResourceTracker* resourceTracker, VkSubpassShadingPipelineCreateInfoHUAWEI* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkSubpassShadingPipelineCreateInfoHUAWEI(
+    ResourceTracker* resourceTracker, VkSubpassShadingPipelineCreateInfoHUAWEI* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceSubpassShadingFeaturesHUAWEI(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSubpassShadingFeaturesHUAWEI* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceSubpassShadingFeaturesHUAWEI(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSubpassShadingFeaturesHUAWEI* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceSubpassShadingPropertiesHUAWEI(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSubpassShadingPropertiesHUAWEI* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceSubpassShadingPropertiesHUAWEI(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSubpassShadingPropertiesHUAWEI* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+void transform_tohost_VkPhysicalDeviceInvocationMaskFeaturesHUAWEI(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceInvocationMaskFeaturesHUAWEI* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceInvocationMaskFeaturesHUAWEI(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceInvocationMaskFeaturesHUAWEI* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_NV_external_memory_rdma
+void transform_tohost_VkMemoryGetRemoteAddressInfoNV(ResourceTracker* resourceTracker,
+                                                     VkMemoryGetRemoteAddressInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkMemoryGetRemoteAddressInfoNV(
+    ResourceTracker* resourceTracker, VkMemoryGetRemoteAddressInfoNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceExternalMemoryRDMAFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceExternalMemoryRDMAFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceExternalMemoryRDMAFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceExternalMemoryRDMAFeaturesNV* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+void transform_tohost_VkPhysicalDeviceExtendedDynamicState2FeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceExtendedDynamicState2FeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceExtendedDynamicState2FeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceExtendedDynamicState2FeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_QNX_screen_surface
+void transform_tohost_VkScreenSurfaceCreateInfoQNX(ResourceTracker* resourceTracker,
+                                                   VkScreenSurfaceCreateInfoQNX* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkScreenSurfaceCreateInfoQNX(ResourceTracker* resourceTracker,
+                                                     VkScreenSurfaceCreateInfoQNX* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_color_write_enable
+void transform_tohost_VkPhysicalDeviceColorWriteEnableFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceColorWriteEnableFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceColorWriteEnableFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceColorWriteEnableFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPipelineColorWriteCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineColorWriteCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPipelineColorWriteCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineColorWriteCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_GOOGLE_gfxstream
+void transform_tohost_VkImportColorBufferGOOGLE(ResourceTracker* resourceTracker,
+                                                VkImportColorBufferGOOGLE* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkImportColorBufferGOOGLE(ResourceTracker* resourceTracker,
+                                                  VkImportColorBufferGOOGLE* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkImportBufferGOOGLE(ResourceTracker* resourceTracker,
+                                           VkImportBufferGOOGLE* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkImportBufferGOOGLE(ResourceTracker* resourceTracker,
+                                             VkImportBufferGOOGLE* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkCreateBlobGOOGLE(ResourceTracker* resourceTracker,
+                                         VkCreateBlobGOOGLE* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkCreateBlobGOOGLE(ResourceTracker* resourceTracker,
+                                           VkCreateBlobGOOGLE* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_global_priority_query
+void transform_tohost_VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkQueueFamilyGlobalPriorityPropertiesEXT(
+    ResourceTracker* resourceTracker, VkQueueFamilyGlobalPriorityPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkQueueFamilyGlobalPriorityPropertiesEXT(
+    ResourceTracker* resourceTracker, VkQueueFamilyGlobalPriorityPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_EXT_multi_draw
+void transform_tohost_VkPhysicalDeviceMultiDrawFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMultiDrawFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceMultiDrawFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMultiDrawFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceMultiDrawPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMultiDrawPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceMultiDrawPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMultiDrawPropertiesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkMultiDrawInfoEXT(ResourceTracker* resourceTracker,
+                                         VkMultiDrawInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkMultiDrawInfoEXT(ResourceTracker* resourceTracker,
+                                           VkMultiDrawInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkMultiDrawIndexedInfoEXT(ResourceTracker* resourceTracker,
+                                                VkMultiDrawIndexedInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkMultiDrawIndexedInfoEXT(ResourceTracker* resourceTracker,
+                                                  VkMultiDrawIndexedInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+#endif
+#ifdef VK_EXT_load_store_op_none
+#endif
+#ifdef VK_EXT_border_color_swizzle
+void transform_tohost_VkPhysicalDeviceBorderColorSwizzleFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceBorderColorSwizzleFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceBorderColorSwizzleFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceBorderColorSwizzleFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkSamplerBorderColorComponentMappingCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkSamplerBorderColorComponentMappingCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkComponentMapping(resourceTracker,
+                                        (VkComponentMapping*)(&toTransform->components));
+}
+
+void transform_fromhost_VkSamplerBorderColorComponentMappingCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkSamplerBorderColorComponentMappingCreateInfoEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkComponentMapping(resourceTracker,
+                                          (VkComponentMapping*)(&toTransform->components));
+}
+
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+void transform_tohost_VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_acceleration_structure
+void transform_tohost_VkDeviceOrHostAddressKHR(ResourceTracker* resourceTracker,
+                                               VkDeviceOrHostAddressKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkDeviceOrHostAddressKHR(ResourceTracker* resourceTracker,
+                                                 VkDeviceOrHostAddressKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkAccelerationStructureBuildRangeInfoKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureBuildRangeInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkAccelerationStructureBuildRangeInfoKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureBuildRangeInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkAccelerationStructureGeometryTrianglesDataKHR(
+    ResourceTracker* resourceTracker,
+    VkAccelerationStructureGeometryTrianglesDataKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkDeviceOrHostAddressConstKHR(
+        resourceTracker, (VkDeviceOrHostAddressConstKHR*)(&toTransform->vertexData));
+    transform_tohost_VkDeviceOrHostAddressConstKHR(
+        resourceTracker, (VkDeviceOrHostAddressConstKHR*)(&toTransform->indexData));
+    transform_tohost_VkDeviceOrHostAddressConstKHR(
+        resourceTracker, (VkDeviceOrHostAddressConstKHR*)(&toTransform->transformData));
+}
+
+void transform_fromhost_VkAccelerationStructureGeometryTrianglesDataKHR(
+    ResourceTracker* resourceTracker,
+    VkAccelerationStructureGeometryTrianglesDataKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkDeviceOrHostAddressConstKHR(
+        resourceTracker, (VkDeviceOrHostAddressConstKHR*)(&toTransform->vertexData));
+    transform_fromhost_VkDeviceOrHostAddressConstKHR(
+        resourceTracker, (VkDeviceOrHostAddressConstKHR*)(&toTransform->indexData));
+    transform_fromhost_VkDeviceOrHostAddressConstKHR(
+        resourceTracker, (VkDeviceOrHostAddressConstKHR*)(&toTransform->transformData));
+}
+
+void transform_tohost_VkAccelerationStructureGeometryAabbsDataKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureGeometryAabbsDataKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkDeviceOrHostAddressConstKHR(
+        resourceTracker, (VkDeviceOrHostAddressConstKHR*)(&toTransform->data));
+}
+
+void transform_fromhost_VkAccelerationStructureGeometryAabbsDataKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureGeometryAabbsDataKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkDeviceOrHostAddressConstKHR(
+        resourceTracker, (VkDeviceOrHostAddressConstKHR*)(&toTransform->data));
+}
+
+void transform_tohost_VkAccelerationStructureGeometryInstancesDataKHR(
+    ResourceTracker* resourceTracker,
+    VkAccelerationStructureGeometryInstancesDataKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkDeviceOrHostAddressConstKHR(
+        resourceTracker, (VkDeviceOrHostAddressConstKHR*)(&toTransform->data));
+}
+
+void transform_fromhost_VkAccelerationStructureGeometryInstancesDataKHR(
+    ResourceTracker* resourceTracker,
+    VkAccelerationStructureGeometryInstancesDataKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkDeviceOrHostAddressConstKHR(
+        resourceTracker, (VkDeviceOrHostAddressConstKHR*)(&toTransform->data));
+}
+
+void transform_tohost_VkAccelerationStructureGeometryDataKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureGeometryDataKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_tohost_VkAccelerationStructureGeometryTrianglesDataKHR(
+        resourceTracker,
+        (VkAccelerationStructureGeometryTrianglesDataKHR*)(&toTransform->triangles));
+    transform_tohost_VkAccelerationStructureGeometryAabbsDataKHR(
+        resourceTracker, (VkAccelerationStructureGeometryAabbsDataKHR*)(&toTransform->aabbs));
+    transform_tohost_VkAccelerationStructureGeometryInstancesDataKHR(
+        resourceTracker,
+        (VkAccelerationStructureGeometryInstancesDataKHR*)(&toTransform->instances));
+}
+
+void transform_fromhost_VkAccelerationStructureGeometryDataKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureGeometryDataKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    transform_fromhost_VkAccelerationStructureGeometryTrianglesDataKHR(
+        resourceTracker,
+        (VkAccelerationStructureGeometryTrianglesDataKHR*)(&toTransform->triangles));
+    transform_fromhost_VkAccelerationStructureGeometryAabbsDataKHR(
+        resourceTracker, (VkAccelerationStructureGeometryAabbsDataKHR*)(&toTransform->aabbs));
+    transform_fromhost_VkAccelerationStructureGeometryInstancesDataKHR(
+        resourceTracker,
+        (VkAccelerationStructureGeometryInstancesDataKHR*)(&toTransform->instances));
+}
+
+void transform_tohost_VkAccelerationStructureGeometryKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureGeometryKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkAccelerationStructureGeometryDataKHR(
+        resourceTracker, (VkAccelerationStructureGeometryDataKHR*)(&toTransform->geometry));
+}
+
+void transform_fromhost_VkAccelerationStructureGeometryKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureGeometryKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkAccelerationStructureGeometryDataKHR(
+        resourceTracker, (VkAccelerationStructureGeometryDataKHR*)(&toTransform->geometry));
+}
+
+void transform_tohost_VkAccelerationStructureBuildGeometryInfoKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureBuildGeometryInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pGeometries) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->geometryCount; ++i) {
+                transform_tohost_VkAccelerationStructureGeometryKHR(
+                    resourceTracker,
+                    (VkAccelerationStructureGeometryKHR*)(toTransform->pGeometries + i));
+            }
+        }
+    }
+    transform_tohost_VkDeviceOrHostAddressKHR(
+        resourceTracker, (VkDeviceOrHostAddressKHR*)(&toTransform->scratchData));
+}
+
+void transform_fromhost_VkAccelerationStructureBuildGeometryInfoKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureBuildGeometryInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pGeometries) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->geometryCount; ++i) {
+                transform_fromhost_VkAccelerationStructureGeometryKHR(
+                    resourceTracker,
+                    (VkAccelerationStructureGeometryKHR*)(toTransform->pGeometries + i));
+            }
+        }
+    }
+    transform_fromhost_VkDeviceOrHostAddressKHR(
+        resourceTracker, (VkDeviceOrHostAddressKHR*)(&toTransform->scratchData));
+}
+
+void transform_tohost_VkAccelerationStructureCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkAccelerationStructureCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkWriteDescriptorSetAccelerationStructureKHR(
+    ResourceTracker* resourceTracker, VkWriteDescriptorSetAccelerationStructureKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkWriteDescriptorSetAccelerationStructureKHR(
+    ResourceTracker* resourceTracker, VkWriteDescriptorSetAccelerationStructureKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceAccelerationStructureFeaturesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceAccelerationStructureFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceAccelerationStructureFeaturesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceAccelerationStructureFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceAccelerationStructurePropertiesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceAccelerationStructurePropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceAccelerationStructurePropertiesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceAccelerationStructurePropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkAccelerationStructureDeviceAddressInfoKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureDeviceAddressInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkAccelerationStructureDeviceAddressInfoKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureDeviceAddressInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkAccelerationStructureVersionInfoKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureVersionInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkAccelerationStructureVersionInfoKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureVersionInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkCopyAccelerationStructureToMemoryInfoKHR(
+    ResourceTracker* resourceTracker, VkCopyAccelerationStructureToMemoryInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkDeviceOrHostAddressKHR(resourceTracker,
+                                              (VkDeviceOrHostAddressKHR*)(&toTransform->dst));
+}
+
+void transform_fromhost_VkCopyAccelerationStructureToMemoryInfoKHR(
+    ResourceTracker* resourceTracker, VkCopyAccelerationStructureToMemoryInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkDeviceOrHostAddressKHR(resourceTracker,
+                                                (VkDeviceOrHostAddressKHR*)(&toTransform->dst));
+}
+
+void transform_tohost_VkCopyMemoryToAccelerationStructureInfoKHR(
+    ResourceTracker* resourceTracker, VkCopyMemoryToAccelerationStructureInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_tohost_VkDeviceOrHostAddressConstKHR(
+        resourceTracker, (VkDeviceOrHostAddressConstKHR*)(&toTransform->src));
+}
+
+void transform_fromhost_VkCopyMemoryToAccelerationStructureInfoKHR(
+    ResourceTracker* resourceTracker, VkCopyMemoryToAccelerationStructureInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    transform_fromhost_VkDeviceOrHostAddressConstKHR(
+        resourceTracker, (VkDeviceOrHostAddressConstKHR*)(&toTransform->src));
+}
+
+void transform_tohost_VkCopyAccelerationStructureInfoKHR(
+    ResourceTracker* resourceTracker, VkCopyAccelerationStructureInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkCopyAccelerationStructureInfoKHR(
+    ResourceTracker* resourceTracker, VkCopyAccelerationStructureInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkAccelerationStructureBuildSizesInfoKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureBuildSizesInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkAccelerationStructureBuildSizesInfoKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureBuildSizesInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+void transform_tohost_VkRayTracingShaderGroupCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkRayTracingShaderGroupCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkRayTracingShaderGroupCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkRayTracingShaderGroupCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkRayTracingPipelineInterfaceCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkRayTracingPipelineInterfaceCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkRayTracingPipelineInterfaceCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkRayTracingPipelineInterfaceCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkRayTracingPipelineCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkRayTracingPipelineCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pStages) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->stageCount; ++i) {
+                transform_tohost_VkPipelineShaderStageCreateInfo(
+                    resourceTracker, (VkPipelineShaderStageCreateInfo*)(toTransform->pStages + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pGroups) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->groupCount; ++i) {
+                transform_tohost_VkRayTracingShaderGroupCreateInfoKHR(
+                    resourceTracker,
+                    (VkRayTracingShaderGroupCreateInfoKHR*)(toTransform->pGroups + i));
+            }
+        }
+    }
+    if (toTransform->pLibraryInfo) {
+        transform_tohost_VkPipelineLibraryCreateInfoKHR(
+            resourceTracker, (VkPipelineLibraryCreateInfoKHR*)(toTransform->pLibraryInfo));
+    }
+    if (toTransform->pLibraryInterface) {
+        transform_tohost_VkRayTracingPipelineInterfaceCreateInfoKHR(
+            resourceTracker,
+            (VkRayTracingPipelineInterfaceCreateInfoKHR*)(toTransform->pLibraryInterface));
+    }
+    if (toTransform->pDynamicState) {
+        transform_tohost_VkPipelineDynamicStateCreateInfo(
+            resourceTracker, (VkPipelineDynamicStateCreateInfo*)(toTransform->pDynamicState));
+    }
+}
+
+void transform_fromhost_VkRayTracingPipelineCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkRayTracingPipelineCreateInfoKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+    if (toTransform) {
+        if (toTransform->pStages) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->stageCount; ++i) {
+                transform_fromhost_VkPipelineShaderStageCreateInfo(
+                    resourceTracker, (VkPipelineShaderStageCreateInfo*)(toTransform->pStages + i));
+            }
+        }
+    }
+    if (toTransform) {
+        if (toTransform->pGroups) {
+            for (uint32_t i = 0; i < (uint32_t)toTransform->groupCount; ++i) {
+                transform_fromhost_VkRayTracingShaderGroupCreateInfoKHR(
+                    resourceTracker,
+                    (VkRayTracingShaderGroupCreateInfoKHR*)(toTransform->pGroups + i));
+            }
+        }
+    }
+    if (toTransform->pLibraryInfo) {
+        transform_fromhost_VkPipelineLibraryCreateInfoKHR(
+            resourceTracker, (VkPipelineLibraryCreateInfoKHR*)(toTransform->pLibraryInfo));
+    }
+    if (toTransform->pLibraryInterface) {
+        transform_fromhost_VkRayTracingPipelineInterfaceCreateInfoKHR(
+            resourceTracker,
+            (VkRayTracingPipelineInterfaceCreateInfoKHR*)(toTransform->pLibraryInterface));
+    }
+    if (toTransform->pDynamicState) {
+        transform_fromhost_VkPipelineDynamicStateCreateInfo(
+            resourceTracker, (VkPipelineDynamicStateCreateInfo*)(toTransform->pDynamicState));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceRayTracingPipelineFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRayTracingPipelineFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceRayTracingPipelineFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRayTracingPipelineFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkPhysicalDeviceRayTracingPipelinePropertiesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceRayTracingPipelinePropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceRayTracingPipelinePropertiesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceRayTracingPipelinePropertiesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_tohost_VkStridedDeviceAddressRegionKHR(
+    ResourceTracker* resourceTracker, VkStridedDeviceAddressRegionKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkStridedDeviceAddressRegionKHR(
+    ResourceTracker* resourceTracker, VkStridedDeviceAddressRegionKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_tohost_VkTraceRaysIndirectCommandKHR(ResourceTracker* resourceTracker,
+                                                    VkTraceRaysIndirectCommandKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+void transform_fromhost_VkTraceRaysIndirectCommandKHR(ResourceTracker* resourceTracker,
+                                                      VkTraceRaysIndirectCommandKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+}
+
+#endif
+#ifdef VK_KHR_ray_query
+void transform_tohost_VkPhysicalDeviceRayQueryFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRayQueryFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_tohost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+void transform_fromhost_VkPhysicalDeviceRayQueryFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRayQueryFeaturesKHR* toTransform) {
+    (void)resourceTracker;
+    (void)toTransform;
+    if (toTransform->pNext) {
+        transform_fromhost_extension_struct(resourceTracker, (void*)(toTransform->pNext));
+    }
+}
+
+#endif
+void transform_tohost_extension_struct(ResourceTracker* resourceTracker,
+                                       void* structExtension_out) {
+    if (!structExtension_out) {
+        return;
+    }
+    uint32_t structType = (uint32_t)goldfish_vk_struct_type(structExtension_out);
+    switch (structType) {
+#ifdef VK_VERSION_1_1
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES: {
+            transform_tohost_VkPhysicalDeviceSubgroupProperties(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceSubgroupProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: {
+            transform_tohost_VkPhysicalDevice16BitStorageFeatures(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDevice16BitStorageFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS: {
+            transform_tohost_VkMemoryDedicatedRequirements(
+                resourceTracker,
+                reinterpret_cast<VkMemoryDedicatedRequirements*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO: {
+            transform_tohost_VkMemoryDedicatedAllocateInfo(
+                resourceTracker,
+                reinterpret_cast<VkMemoryDedicatedAllocateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO: {
+            transform_tohost_VkMemoryAllocateFlagsInfo(
+                resourceTracker, reinterpret_cast<VkMemoryAllocateFlagsInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO: {
+            transform_tohost_VkDeviceGroupRenderPassBeginInfo(
+                resourceTracker,
+                reinterpret_cast<VkDeviceGroupRenderPassBeginInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO: {
+            transform_tohost_VkDeviceGroupCommandBufferBeginInfo(
+                resourceTracker,
+                reinterpret_cast<VkDeviceGroupCommandBufferBeginInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO: {
+            transform_tohost_VkDeviceGroupSubmitInfo(
+                resourceTracker, reinterpret_cast<VkDeviceGroupSubmitInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO: {
+            transform_tohost_VkDeviceGroupBindSparseInfo(
+                resourceTracker,
+                reinterpret_cast<VkDeviceGroupBindSparseInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO: {
+            transform_tohost_VkBindBufferMemoryDeviceGroupInfo(
+                resourceTracker,
+                reinterpret_cast<VkBindBufferMemoryDeviceGroupInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO: {
+            transform_tohost_VkBindImageMemoryDeviceGroupInfo(
+                resourceTracker,
+                reinterpret_cast<VkBindImageMemoryDeviceGroupInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO: {
+            transform_tohost_VkDeviceGroupDeviceCreateInfo(
+                resourceTracker,
+                reinterpret_cast<VkDeviceGroupDeviceCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: {
+            transform_tohost_VkPhysicalDeviceFeatures2(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceFeatures2*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES: {
+            transform_tohost_VkPhysicalDevicePointClippingProperties(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDevicePointClippingProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO: {
+            transform_tohost_VkRenderPassInputAttachmentAspectCreateInfo(
+                resourceTracker, reinterpret_cast<VkRenderPassInputAttachmentAspectCreateInfo*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO: {
+            transform_tohost_VkImageViewUsageCreateInfo(
+                resourceTracker,
+                reinterpret_cast<VkImageViewUsageCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO: {
+            transform_tohost_VkPipelineTessellationDomainOriginStateCreateInfo(
+                resourceTracker,
+                reinterpret_cast<VkPipelineTessellationDomainOriginStateCreateInfo*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO: {
+            transform_tohost_VkRenderPassMultiviewCreateInfo(
+                resourceTracker,
+                reinterpret_cast<VkRenderPassMultiviewCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES: {
+            transform_tohost_VkPhysicalDeviceMultiviewFeatures(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceMultiviewFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES: {
+            transform_tohost_VkPhysicalDeviceMultiviewProperties(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceMultiviewProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES: {
+            transform_tohost_VkPhysicalDeviceVariablePointersFeatures(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceVariablePointersFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES: {
+            transform_tohost_VkPhysicalDeviceProtectedMemoryFeatures(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceProtectedMemoryFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES: {
+            transform_tohost_VkPhysicalDeviceProtectedMemoryProperties(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceProtectedMemoryProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO: {
+            transform_tohost_VkProtectedSubmitInfo(
+                resourceTracker, reinterpret_cast<VkProtectedSubmitInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO: {
+            transform_tohost_VkSamplerYcbcrConversionInfo(
+                resourceTracker,
+                reinterpret_cast<VkSamplerYcbcrConversionInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO: {
+            transform_tohost_VkBindImagePlaneMemoryInfo(
+                resourceTracker,
+                reinterpret_cast<VkBindImagePlaneMemoryInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO: {
+            transform_tohost_VkImagePlaneMemoryRequirementsInfo(
+                resourceTracker,
+                reinterpret_cast<VkImagePlaneMemoryRequirementsInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: {
+            transform_tohost_VkPhysicalDeviceSamplerYcbcrConversionFeatures(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceSamplerYcbcrConversionFeatures*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES: {
+            transform_tohost_VkSamplerYcbcrConversionImageFormatProperties(
+                resourceTracker, reinterpret_cast<VkSamplerYcbcrConversionImageFormatProperties*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO: {
+            resourceTracker->transformImpl_VkPhysicalDeviceExternalImageFormatInfo_tohost(
+                reinterpret_cast<VkPhysicalDeviceExternalImageFormatInfo*>(structExtension_out), 1);
+            transform_tohost_VkPhysicalDeviceExternalImageFormatInfo(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceExternalImageFormatInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES: {
+            resourceTracker->transformImpl_VkExternalImageFormatProperties_tohost(
+                reinterpret_cast<VkExternalImageFormatProperties*>(structExtension_out), 1);
+            transform_tohost_VkExternalImageFormatProperties(
+                resourceTracker,
+                reinterpret_cast<VkExternalImageFormatProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES: {
+            transform_tohost_VkPhysicalDeviceIDProperties(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceIDProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO: {
+            resourceTracker->transformImpl_VkExternalMemoryImageCreateInfo_tohost(
+                reinterpret_cast<VkExternalMemoryImageCreateInfo*>(structExtension_out), 1);
+            transform_tohost_VkExternalMemoryImageCreateInfo(
+                resourceTracker,
+                reinterpret_cast<VkExternalMemoryImageCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO: {
+            resourceTracker->transformImpl_VkExternalMemoryBufferCreateInfo_tohost(
+                reinterpret_cast<VkExternalMemoryBufferCreateInfo*>(structExtension_out), 1);
+            transform_tohost_VkExternalMemoryBufferCreateInfo(
+                resourceTracker,
+                reinterpret_cast<VkExternalMemoryBufferCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO: {
+            resourceTracker->transformImpl_VkExportMemoryAllocateInfo_tohost(
+                reinterpret_cast<VkExportMemoryAllocateInfo*>(structExtension_out), 1);
+            transform_tohost_VkExportMemoryAllocateInfo(
+                resourceTracker,
+                reinterpret_cast<VkExportMemoryAllocateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO: {
+            transform_tohost_VkExportFenceCreateInfo(
+                resourceTracker, reinterpret_cast<VkExportFenceCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO: {
+            transform_tohost_VkExportSemaphoreCreateInfo(
+                resourceTracker,
+                reinterpret_cast<VkExportSemaphoreCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES: {
+            transform_tohost_VkPhysicalDeviceMaintenance3Properties(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceMaintenance3Properties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES: {
+            transform_tohost_VkPhysicalDeviceShaderDrawParametersFeatures(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceShaderDrawParametersFeatures*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_VERSION_1_2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES: {
+            transform_tohost_VkPhysicalDeviceVulkan11Features(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceVulkan11Features*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES: {
+            transform_tohost_VkPhysicalDeviceVulkan11Properties(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceVulkan11Properties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES: {
+            transform_tohost_VkPhysicalDeviceVulkan12Features(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceVulkan12Features*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES: {
+            transform_tohost_VkPhysicalDeviceVulkan12Properties(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceVulkan12Properties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO: {
+            transform_tohost_VkImageFormatListCreateInfo(
+                resourceTracker,
+                reinterpret_cast<VkImageFormatListCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES: {
+            transform_tohost_VkPhysicalDevice8BitStorageFeatures(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDevice8BitStorageFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES: {
+            transform_tohost_VkPhysicalDeviceDriverProperties(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceDriverProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES: {
+            transform_tohost_VkPhysicalDeviceShaderAtomicInt64Features(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShaderAtomicInt64Features*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES: {
+            transform_tohost_VkPhysicalDeviceShaderFloat16Int8Features(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShaderFloat16Int8Features*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES: {
+            transform_tohost_VkPhysicalDeviceFloatControlsProperties(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceFloatControlsProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO: {
+            transform_tohost_VkDescriptorSetLayoutBindingFlagsCreateInfo(
+                resourceTracker, reinterpret_cast<VkDescriptorSetLayoutBindingFlagsCreateInfo*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES: {
+            transform_tohost_VkPhysicalDeviceDescriptorIndexingFeatures(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceDescriptorIndexingFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES: {
+            transform_tohost_VkPhysicalDeviceDescriptorIndexingProperties(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceDescriptorIndexingProperties*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO: {
+            transform_tohost_VkDescriptorSetVariableDescriptorCountAllocateInfo(
+                resourceTracker,
+                reinterpret_cast<VkDescriptorSetVariableDescriptorCountAllocateInfo*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT: {
+            transform_tohost_VkDescriptorSetVariableDescriptorCountLayoutSupport(
+                resourceTracker,
+                reinterpret_cast<VkDescriptorSetVariableDescriptorCountLayoutSupport*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE: {
+            transform_tohost_VkSubpassDescriptionDepthStencilResolve(
+                resourceTracker,
+                reinterpret_cast<VkSubpassDescriptionDepthStencilResolve*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES: {
+            transform_tohost_VkPhysicalDeviceDepthStencilResolveProperties(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceDepthStencilResolveProperties*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES: {
+            transform_tohost_VkPhysicalDeviceScalarBlockLayoutFeatures(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceScalarBlockLayoutFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO: {
+            transform_tohost_VkImageStencilUsageCreateInfo(
+                resourceTracker,
+                reinterpret_cast<VkImageStencilUsageCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO: {
+            transform_tohost_VkSamplerReductionModeCreateInfo(
+                resourceTracker,
+                reinterpret_cast<VkSamplerReductionModeCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES: {
+            transform_tohost_VkPhysicalDeviceSamplerFilterMinmaxProperties(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceSamplerFilterMinmaxProperties*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES: {
+            transform_tohost_VkPhysicalDeviceVulkanMemoryModelFeatures(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceVulkanMemoryModelFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES: {
+            transform_tohost_VkPhysicalDeviceImagelessFramebufferFeatures(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceImagelessFramebufferFeatures*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO: {
+            transform_tohost_VkFramebufferAttachmentsCreateInfo(
+                resourceTracker,
+                reinterpret_cast<VkFramebufferAttachmentsCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO: {
+            transform_tohost_VkRenderPassAttachmentBeginInfo(
+                resourceTracker,
+                reinterpret_cast<VkRenderPassAttachmentBeginInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES: {
+            transform_tohost_VkPhysicalDeviceUniformBufferStandardLayoutFeatures(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceUniformBufferStandardLayoutFeatures*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES: {
+            transform_tohost_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES: {
+            transform_tohost_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT: {
+            transform_tohost_VkAttachmentReferenceStencilLayout(
+                resourceTracker,
+                reinterpret_cast<VkAttachmentReferenceStencilLayout*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT: {
+            transform_tohost_VkAttachmentDescriptionStencilLayout(
+                resourceTracker,
+                reinterpret_cast<VkAttachmentDescriptionStencilLayout*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES: {
+            transform_tohost_VkPhysicalDeviceHostQueryResetFeatures(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceHostQueryResetFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES: {
+            transform_tohost_VkPhysicalDeviceTimelineSemaphoreFeatures(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceTimelineSemaphoreFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES: {
+            transform_tohost_VkPhysicalDeviceTimelineSemaphoreProperties(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceTimelineSemaphoreProperties*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO: {
+            transform_tohost_VkSemaphoreTypeCreateInfo(
+                resourceTracker, reinterpret_cast<VkSemaphoreTypeCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO: {
+            transform_tohost_VkTimelineSemaphoreSubmitInfo(
+                resourceTracker,
+                reinterpret_cast<VkTimelineSemaphoreSubmitInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES: {
+            transform_tohost_VkPhysicalDeviceBufferDeviceAddressFeatures(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceBufferDeviceAddressFeatures*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO: {
+            transform_tohost_VkBufferOpaqueCaptureAddressCreateInfo(
+                resourceTracker,
+                reinterpret_cast<VkBufferOpaqueCaptureAddressCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO: {
+            transform_tohost_VkMemoryOpaqueCaptureAddressAllocateInfo(
+                resourceTracker,
+                reinterpret_cast<VkMemoryOpaqueCaptureAddressAllocateInfo*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_swapchain
+        case VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR: {
+            transform_tohost_VkImageSwapchainCreateInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkImageSwapchainCreateInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR: {
+            transform_tohost_VkBindImageMemorySwapchainInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkBindImageMemorySwapchainInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR: {
+            transform_tohost_VkDeviceGroupPresentInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkDeviceGroupPresentInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR: {
+            transform_tohost_VkDeviceGroupSwapchainCreateInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkDeviceGroupSwapchainCreateInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_display_swapchain
+        case VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR: {
+            transform_tohost_VkDisplayPresentInfoKHR(
+                resourceTracker, reinterpret_cast<VkDisplayPresentInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_video_queue
+        case VK_STRUCTURE_TYPE_VIDEO_QUEUE_FAMILY_PROPERTIES_2_KHR: {
+            transform_tohost_VkVideoQueueFamilyProperties2KHR(
+                resourceTracker,
+                reinterpret_cast<VkVideoQueueFamilyProperties2KHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_PROFILE_KHR: {
+            transform_tohost_VkVideoProfileKHR(
+                resourceTracker, reinterpret_cast<VkVideoProfileKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_PROFILES_KHR: {
+            transform_tohost_VkVideoProfilesKHR(
+                resourceTracker, reinterpret_cast<VkVideoProfilesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_dynamic_rendering
+        case VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO_KHR: {
+            transform_tohost_VkPipelineRenderingCreateInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkPipelineRenderingCreateInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR: {
+            transform_tohost_VkPhysicalDeviceDynamicRenderingFeaturesKHR(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceDynamicRenderingFeaturesKHR*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO_KHR: {
+            transform_tohost_VkCommandBufferInheritanceRenderingInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkCommandBufferInheritanceRenderingInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR: {
+            transform_tohost_VkRenderingFragmentShadingRateAttachmentInfoKHR(
+                resourceTracker, reinterpret_cast<VkRenderingFragmentShadingRateAttachmentInfoKHR*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT: {
+            transform_tohost_VkRenderingFragmentDensityMapAttachmentInfoEXT(
+                resourceTracker, reinterpret_cast<VkRenderingFragmentDensityMapAttachmentInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD: {
+            transform_tohost_VkAttachmentSampleCountInfoAMD(
+                resourceTracker,
+                reinterpret_cast<VkAttachmentSampleCountInfoAMD*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX: {
+            transform_tohost_VkMultiviewPerViewAttributesInfoNVX(
+                resourceTracker,
+                reinterpret_cast<VkMultiviewPerViewAttributesInfoNVX*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_memory_win32
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR: {
+            transform_tohost_VkImportMemoryWin32HandleInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkImportMemoryWin32HandleInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR: {
+            transform_tohost_VkExportMemoryWin32HandleInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkExportMemoryWin32HandleInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_memory_fd
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR: {
+            transform_tohost_VkImportMemoryFdInfoKHR(
+                resourceTracker, reinterpret_cast<VkImportMemoryFdInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_win32_keyed_mutex
+        case VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR: {
+            transform_tohost_VkWin32KeyedMutexAcquireReleaseInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkWin32KeyedMutexAcquireReleaseInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+        case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR: {
+            transform_tohost_VkExportSemaphoreWin32HandleInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkExportSemaphoreWin32HandleInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR: {
+            transform_tohost_VkD3D12FenceSubmitInfoKHR(
+                resourceTracker, reinterpret_cast<VkD3D12FenceSubmitInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_push_descriptor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR: {
+            transform_tohost_VkPhysicalDevicePushDescriptorPropertiesKHR(
+                resourceTracker, reinterpret_cast<VkPhysicalDevicePushDescriptorPropertiesKHR*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_incremental_present
+        case VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR: {
+            transform_tohost_VkPresentRegionsKHR(
+                resourceTracker, reinterpret_cast<VkPresentRegionsKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shared_presentable_image
+        case VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR: {
+            transform_tohost_VkSharedPresentSurfaceCapabilitiesKHR(
+                resourceTracker,
+                reinterpret_cast<VkSharedPresentSurfaceCapabilitiesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_fence_win32
+        case VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR: {
+            transform_tohost_VkExportFenceWin32HandleInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkExportFenceWin32HandleInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_performance_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR: {
+            transform_tohost_VkPhysicalDevicePerformanceQueryFeaturesKHR(
+                resourceTracker, reinterpret_cast<VkPhysicalDevicePerformanceQueryFeaturesKHR*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR: {
+            transform_tohost_VkPhysicalDevicePerformanceQueryPropertiesKHR(
+                resourceTracker, reinterpret_cast<VkPhysicalDevicePerformanceQueryPropertiesKHR*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR: {
+            transform_tohost_VkQueryPoolPerformanceCreateInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkQueryPoolPerformanceCreateInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR: {
+            transform_tohost_VkPerformanceQuerySubmitInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkPerformanceQuerySubmitInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_portability_subset
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR: {
+            transform_tohost_VkPhysicalDevicePortabilitySubsetFeaturesKHR(
+                resourceTracker, reinterpret_cast<VkPhysicalDevicePortabilitySubsetFeaturesKHR*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR: {
+            transform_tohost_VkPhysicalDevicePortabilitySubsetPropertiesKHR(
+                resourceTracker, reinterpret_cast<VkPhysicalDevicePortabilitySubsetPropertiesKHR*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_clock
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR: {
+            transform_tohost_VkPhysicalDeviceShaderClockFeaturesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShaderClockFeaturesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_terminate_invocation
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR: {
+            transform_tohost_VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+        case VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR: {
+            transform_tohost_VkFragmentShadingRateAttachmentInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkFragmentShadingRateAttachmentInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR: {
+            transform_tohost_VkPipelineFragmentShadingRateStateCreateInfoKHR(
+                resourceTracker, reinterpret_cast<VkPipelineFragmentShadingRateStateCreateInfoKHR*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR: {
+            transform_tohost_VkPhysicalDeviceFragmentShadingRateFeaturesKHR(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceFragmentShadingRateFeaturesKHR*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR: {
+            transform_tohost_VkPhysicalDeviceFragmentShadingRatePropertiesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceFragmentShadingRatePropertiesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_surface_protected_capabilities
+        case VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR: {
+            transform_tohost_VkSurfaceProtectedCapabilitiesKHR(
+                resourceTracker,
+                reinterpret_cast<VkSurfaceProtectedCapabilitiesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_present_wait
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR: {
+            transform_tohost_VkPhysicalDevicePresentWaitFeaturesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDevicePresentWaitFeaturesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR: {
+            transform_tohost_VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_integer_dot_product
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR: {
+            transform_tohost_VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR: {
+            transform_tohost_VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_present_id
+        case VK_STRUCTURE_TYPE_PRESENT_ID_KHR: {
+            transform_tohost_VkPresentIdKHR(resourceTracker,
+                                            reinterpret_cast<VkPresentIdKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR: {
+            transform_tohost_VkPhysicalDevicePresentIdFeaturesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDevicePresentIdFeaturesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_video_encode_queue
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_INFO_KHR: {
+            transform_tohost_VkVideoEncodeRateControlInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkVideoEncodeRateControlInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_synchronization2
+        case VK_STRUCTURE_TYPE_MEMORY_BARRIER_2_KHR: {
+            transform_tohost_VkMemoryBarrier2KHR(
+                resourceTracker, reinterpret_cast<VkMemoryBarrier2KHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR: {
+            transform_tohost_VkPhysicalDeviceSynchronization2FeaturesKHR(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceSynchronization2FeaturesKHR*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV: {
+            transform_tohost_VkQueueFamilyCheckpointProperties2NV(
+                resourceTracker,
+                reinterpret_cast<VkQueueFamilyCheckpointProperties2NV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_subgroup_uniform_control_flow
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR: {
+            transform_tohost_VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_zero_initialize_workgroup_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES_KHR: {
+            transform_tohost_VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_workgroup_memory_explicit_layout
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR: {
+            transform_tohost_VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_format_feature_flags2
+        case VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3_KHR: {
+            transform_tohost_VkFormatProperties3KHR(
+                resourceTracker, reinterpret_cast<VkFormatProperties3KHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_maintenance4
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES_KHR: {
+            transform_tohost_VkPhysicalDeviceMaintenance4FeaturesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceMaintenance4FeaturesKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES_KHR: {
+            transform_tohost_VkPhysicalDeviceMaintenance4PropertiesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceMaintenance4PropertiesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_ANDROID_native_buffer
+        case VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID: {
+            transform_tohost_VkNativeBufferANDROID(
+                resourceTracker, reinterpret_cast<VkNativeBufferANDROID*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_debug_report
+        case VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT: {
+            transform_tohost_VkDebugReportCallbackCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkDebugReportCallbackCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_rasterization_order
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD: {
+            transform_tohost_VkPipelineRasterizationStateRasterizationOrderAMD(
+                resourceTracker,
+                reinterpret_cast<VkPipelineRasterizationStateRasterizationOrderAMD*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_dedicated_allocation
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV: {
+            transform_tohost_VkDedicatedAllocationImageCreateInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkDedicatedAllocationImageCreateInfoNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV: {
+            transform_tohost_VkDedicatedAllocationBufferCreateInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkDedicatedAllocationBufferCreateInfoNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV: {
+            transform_tohost_VkDedicatedAllocationMemoryAllocateInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkDedicatedAllocationMemoryAllocateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_transform_feedback
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceTransformFeedbackFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceTransformFeedbackFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT: {
+            transform_tohost_VkPhysicalDeviceTransformFeedbackPropertiesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceTransformFeedbackPropertiesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT: {
+            transform_tohost_VkPipelineRasterizationStateStreamCreateInfoEXT(
+                resourceTracker, reinterpret_cast<VkPipelineRasterizationStateStreamCreateInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_encode_h264
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_EXT: {
+            transform_tohost_VkVideoEncodeH264CapabilitiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoEncodeH264CapabilitiesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_CREATE_INFO_EXT: {
+            transform_tohost_VkVideoEncodeH264SessionCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoEncodeH264SessionCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            transform_tohost_VkVideoEncodeH264SessionParametersAddInfoEXT(
+                resourceTracker, reinterpret_cast<VkVideoEncodeH264SessionParametersAddInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            transform_tohost_VkVideoEncodeH264SessionParametersCreateInfoEXT(
+                resourceTracker, reinterpret_cast<VkVideoEncodeH264SessionParametersCreateInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_VCL_FRAME_INFO_EXT: {
+            transform_tohost_VkVideoEncodeH264VclFrameInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoEncodeH264VclFrameInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_EMIT_PICTURE_PARAMETERS_EXT: {
+            transform_tohost_VkVideoEncodeH264EmitPictureParametersEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoEncodeH264EmitPictureParametersEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_EXT: {
+            transform_tohost_VkVideoEncodeH264ProfileEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoEncodeH264ProfileEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_encode_h265
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_EXT: {
+            transform_tohost_VkVideoEncodeH265CapabilitiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoEncodeH265CapabilitiesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_CREATE_INFO_EXT: {
+            transform_tohost_VkVideoEncodeH265SessionCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoEncodeH265SessionCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            transform_tohost_VkVideoEncodeH265SessionParametersAddInfoEXT(
+                resourceTracker, reinterpret_cast<VkVideoEncodeH265SessionParametersAddInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            transform_tohost_VkVideoEncodeH265SessionParametersCreateInfoEXT(
+                resourceTracker, reinterpret_cast<VkVideoEncodeH265SessionParametersCreateInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_VCL_FRAME_INFO_EXT: {
+            transform_tohost_VkVideoEncodeH265VclFrameInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoEncodeH265VclFrameInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_EMIT_PICTURE_PARAMETERS_EXT: {
+            transform_tohost_VkVideoEncodeH265EmitPictureParametersEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoEncodeH265EmitPictureParametersEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_EXT: {
+            transform_tohost_VkVideoEncodeH265ProfileEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoEncodeH265ProfileEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_decode_h264
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_EXT: {
+            transform_tohost_VkVideoDecodeH264ProfileEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoDecodeH264ProfileEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_EXT: {
+            transform_tohost_VkVideoDecodeH264CapabilitiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoDecodeH264CapabilitiesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_CREATE_INFO_EXT: {
+            transform_tohost_VkVideoDecodeH264SessionCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoDecodeH264SessionCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            transform_tohost_VkVideoDecodeH264SessionParametersAddInfoEXT(
+                resourceTracker, reinterpret_cast<VkVideoDecodeH264SessionParametersAddInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            transform_tohost_VkVideoDecodeH264SessionParametersCreateInfoEXT(
+                resourceTracker, reinterpret_cast<VkVideoDecodeH264SessionParametersCreateInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PICTURE_INFO_EXT: {
+            transform_tohost_VkVideoDecodeH264PictureInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoDecodeH264PictureInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_MVC_EXT: {
+            transform_tohost_VkVideoDecodeH264MvcEXT(
+                resourceTracker, reinterpret_cast<VkVideoDecodeH264MvcEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_EXT: {
+            transform_tohost_VkVideoDecodeH264DpbSlotInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoDecodeH264DpbSlotInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_texture_gather_bias_lod
+        case VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD: {
+            transform_tohost_VkTextureLODGatherFormatPropertiesAMD(
+                resourceTracker,
+                reinterpret_cast<VkTextureLODGatherFormatPropertiesAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_corner_sampled_image
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV: {
+            transform_tohost_VkPhysicalDeviceCornerSampledImageFeaturesNV(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceCornerSampledImageFeaturesNV*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_external_memory
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV: {
+            transform_tohost_VkExternalMemoryImageCreateInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkExternalMemoryImageCreateInfoNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV: {
+            transform_tohost_VkExportMemoryAllocateInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkExportMemoryAllocateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_external_memory_win32
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV: {
+            transform_tohost_VkImportMemoryWin32HandleInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkImportMemoryWin32HandleInfoNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV: {
+            transform_tohost_VkExportMemoryWin32HandleInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkExportMemoryWin32HandleInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_win32_keyed_mutex
+        case VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV: {
+            transform_tohost_VkWin32KeyedMutexAcquireReleaseInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkWin32KeyedMutexAcquireReleaseInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_validation_flags
+        case VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT: {
+            transform_tohost_VkValidationFlagsEXT(
+                resourceTracker, reinterpret_cast<VkValidationFlagsEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_texture_compression_astc_hdr
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_astc_decode_mode
+        case VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT: {
+            transform_tohost_VkImageViewASTCDecodeModeEXT(
+                resourceTracker,
+                reinterpret_cast<VkImageViewASTCDecodeModeEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceASTCDecodeFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceASTCDecodeFeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_conditional_rendering
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceConditionalRenderingFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceConditionalRenderingFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT: {
+            transform_tohost_VkCommandBufferInheritanceConditionalRenderingInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkCommandBufferInheritanceConditionalRenderingInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV: {
+            transform_tohost_VkPipelineViewportWScalingStateCreateInfoNV(
+                resourceTracker, reinterpret_cast<VkPipelineViewportWScalingStateCreateInfoNV*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_display_control
+        case VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT: {
+            transform_tohost_VkSwapchainCounterCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkSwapchainCounterCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_GOOGLE_display_timing
+        case VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE: {
+            transform_tohost_VkPresentTimesInfoGOOGLE(
+                resourceTracker, reinterpret_cast<VkPresentTimesInfoGOOGLE*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NVX_multiview_per_view_attributes
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX: {
+            transform_tohost_VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_viewport_swizzle
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV: {
+            transform_tohost_VkPipelineViewportSwizzleStateCreateInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkPipelineViewportSwizzleStateCreateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_discard_rectangles
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT: {
+            transform_tohost_VkPhysicalDeviceDiscardRectanglePropertiesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceDiscardRectanglePropertiesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT: {
+            transform_tohost_VkPipelineDiscardRectangleStateCreateInfoEXT(
+                resourceTracker, reinterpret_cast<VkPipelineDiscardRectangleStateCreateInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_conservative_rasterization
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT: {
+            transform_tohost_VkPhysicalDeviceConservativeRasterizationPropertiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceConservativeRasterizationPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT: {
+            transform_tohost_VkPipelineRasterizationConservativeStateCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkPipelineRasterizationConservativeStateCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_depth_clip_enable
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceDepthClipEnableFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceDepthClipEnableFeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT: {
+            transform_tohost_VkPipelineRasterizationDepthClipStateCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkPipelineRasterizationDepthClipStateCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_debug_utils
+        case VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT: {
+            transform_tohost_VkDebugUtilsMessengerCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkDebugUtilsMessengerCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID: {
+            transform_tohost_VkAndroidHardwareBufferUsageANDROID(
+                resourceTracker,
+                reinterpret_cast<VkAndroidHardwareBufferUsageANDROID*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID: {
+            transform_tohost_VkAndroidHardwareBufferFormatPropertiesANDROID(
+                resourceTracker, reinterpret_cast<VkAndroidHardwareBufferFormatPropertiesANDROID*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID: {
+            transform_tohost_VkImportAndroidHardwareBufferInfoANDROID(
+                resourceTracker,
+                reinterpret_cast<VkImportAndroidHardwareBufferInfoANDROID*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID: {
+            transform_tohost_VkExternalFormatANDROID(
+                resourceTracker, reinterpret_cast<VkExternalFormatANDROID*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID: {
+            transform_tohost_VkAndroidHardwareBufferFormatProperties2ANDROID(
+                resourceTracker, reinterpret_cast<VkAndroidHardwareBufferFormatProperties2ANDROID*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_inline_uniform_block
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceInlineUniformBlockFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceInlineUniformBlockFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT: {
+            transform_tohost_VkPhysicalDeviceInlineUniformBlockPropertiesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceInlineUniformBlockPropertiesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT: {
+            transform_tohost_VkWriteDescriptorSetInlineUniformBlockEXT(
+                resourceTracker,
+                reinterpret_cast<VkWriteDescriptorSetInlineUniformBlockEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO_EXT: {
+            transform_tohost_VkDescriptorPoolInlineUniformBlockCreateInfoEXT(
+                resourceTracker, reinterpret_cast<VkDescriptorPoolInlineUniformBlockCreateInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_sample_locations
+        case VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT: {
+            transform_tohost_VkSampleLocationsInfoEXT(
+                resourceTracker, reinterpret_cast<VkSampleLocationsInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT: {
+            transform_tohost_VkRenderPassSampleLocationsBeginInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkRenderPassSampleLocationsBeginInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT: {
+            transform_tohost_VkPipelineSampleLocationsStateCreateInfoEXT(
+                resourceTracker, reinterpret_cast<VkPipelineSampleLocationsStateCreateInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT: {
+            transform_tohost_VkPhysicalDeviceSampleLocationsPropertiesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceSampleLocationsPropertiesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_blend_operation_advanced
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT: {
+            transform_tohost_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT: {
+            transform_tohost_VkPipelineColorBlendAdvancedStateCreateInfoEXT(
+                resourceTracker, reinterpret_cast<VkPipelineColorBlendAdvancedStateCreateInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_fragment_coverage_to_color
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV: {
+            transform_tohost_VkPipelineCoverageToColorStateCreateInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkPipelineCoverageToColorStateCreateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_framebuffer_mixed_samples
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV: {
+            transform_tohost_VkPipelineCoverageModulationStateCreateInfoNV(
+                resourceTracker, reinterpret_cast<VkPipelineCoverageModulationStateCreateInfoNV*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_shader_sm_builtins
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV: {
+            transform_tohost_VkPhysicalDeviceShaderSMBuiltinsPropertiesNV(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceShaderSMBuiltinsPropertiesNV*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV: {
+            transform_tohost_VkPhysicalDeviceShaderSMBuiltinsFeaturesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShaderSMBuiltinsFeaturesNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+        case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT: {
+            transform_tohost_VkDrmFormatModifierPropertiesListEXT(
+                resourceTracker,
+                reinterpret_cast<VkDrmFormatModifierPropertiesListEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT: {
+            transform_tohost_VkPhysicalDeviceImageDrmFormatModifierInfoEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceImageDrmFormatModifierInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT: {
+            transform_tohost_VkImageDrmFormatModifierListCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkImageDrmFormatModifierListCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT: {
+            transform_tohost_VkImageDrmFormatModifierExplicitCreateInfoEXT(
+                resourceTracker, reinterpret_cast<VkImageDrmFormatModifierExplicitCreateInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT: {
+            transform_tohost_VkDrmFormatModifierPropertiesList2EXT(
+                resourceTracker,
+                reinterpret_cast<VkDrmFormatModifierPropertiesList2EXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_validation_cache
+        case VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT: {
+            transform_tohost_VkShaderModuleValidationCacheCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkShaderModuleValidationCacheCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_shading_rate_image
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV: {
+            transform_tohost_VkPipelineViewportShadingRateImageStateCreateInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkPipelineViewportShadingRateImageStateCreateInfoNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV: {
+            transform_tohost_VkPhysicalDeviceShadingRateImageFeaturesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShadingRateImageFeaturesNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV: {
+            transform_tohost_VkPhysicalDeviceShadingRateImagePropertiesNV(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceShadingRateImagePropertiesNV*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV: {
+            transform_tohost_VkPipelineViewportCoarseSampleOrderStateCreateInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkPipelineViewportCoarseSampleOrderStateCreateInfoNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_ray_tracing
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV: {
+            transform_tohost_VkWriteDescriptorSetAccelerationStructureNV(
+                resourceTracker, reinterpret_cast<VkWriteDescriptorSetAccelerationStructureNV*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV: {
+            transform_tohost_VkPhysicalDeviceRayTracingPropertiesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceRayTracingPropertiesNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_representative_fragment_test
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV: {
+            transform_tohost_VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV: {
+            transform_tohost_VkPipelineRepresentativeFragmentTestStateCreateInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkPipelineRepresentativeFragmentTestStateCreateInfoNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_filter_cubic
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT: {
+            transform_tohost_VkPhysicalDeviceImageViewImageFormatInfoEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceImageViewImageFormatInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT: {
+            transform_tohost_VkFilterCubicImageViewImageFormatPropertiesEXT(
+                resourceTracker, reinterpret_cast<VkFilterCubicImageViewImageFormatPropertiesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_global_priority
+        case VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT: {
+            transform_tohost_VkDeviceQueueGlobalPriorityCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkDeviceQueueGlobalPriorityCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_external_memory_host
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT: {
+            transform_tohost_VkImportMemoryHostPointerInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkImportMemoryHostPointerInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT: {
+            transform_tohost_VkPhysicalDeviceExternalMemoryHostPropertiesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceExternalMemoryHostPropertiesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_pipeline_compiler_control
+        case VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD: {
+            transform_tohost_VkPipelineCompilerControlCreateInfoAMD(
+                resourceTracker,
+                reinterpret_cast<VkPipelineCompilerControlCreateInfoAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_shader_core_properties
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD: {
+            transform_tohost_VkPhysicalDeviceShaderCorePropertiesAMD(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShaderCorePropertiesAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_decode_h265
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_EXT: {
+            transform_tohost_VkVideoDecodeH265ProfileEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoDecodeH265ProfileEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_EXT: {
+            transform_tohost_VkVideoDecodeH265CapabilitiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoDecodeH265CapabilitiesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_CREATE_INFO_EXT: {
+            transform_tohost_VkVideoDecodeH265SessionCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoDecodeH265SessionCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            transform_tohost_VkVideoDecodeH265SessionParametersAddInfoEXT(
+                resourceTracker, reinterpret_cast<VkVideoDecodeH265SessionParametersAddInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            transform_tohost_VkVideoDecodeH265SessionParametersCreateInfoEXT(
+                resourceTracker, reinterpret_cast<VkVideoDecodeH265SessionParametersCreateInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PICTURE_INFO_EXT: {
+            transform_tohost_VkVideoDecodeH265PictureInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoDecodeH265PictureInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_EXT: {
+            transform_tohost_VkVideoDecodeH265DpbSlotInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoDecodeH265DpbSlotInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_memory_overallocation_behavior
+        case VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD: {
+            transform_tohost_VkDeviceMemoryOverallocationCreateInfoAMD(
+                resourceTracker,
+                reinterpret_cast<VkDeviceMemoryOverallocationCreateInfoAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_vertex_attribute_divisor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT: {
+            transform_tohost_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT: {
+            transform_tohost_VkPipelineVertexInputDivisorStateCreateInfoEXT(
+                resourceTracker, reinterpret_cast<VkPipelineVertexInputDivisorStateCreateInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_GGP_frame_token
+        case VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP: {
+            transform_tohost_VkPresentFrameTokenGGP(
+                resourceTracker, reinterpret_cast<VkPresentFrameTokenGGP*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_pipeline_creation_feedback
+        case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT: {
+            transform_tohost_VkPipelineCreationFeedbackCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkPipelineCreationFeedbackCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_compute_shader_derivatives
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV: {
+            transform_tohost_VkPhysicalDeviceComputeShaderDerivativesFeaturesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceComputeShaderDerivativesFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_mesh_shader
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV: {
+            transform_tohost_VkPhysicalDeviceMeshShaderFeaturesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceMeshShaderFeaturesNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV: {
+            transform_tohost_VkPhysicalDeviceMeshShaderPropertiesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceMeshShaderPropertiesNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_fragment_shader_barycentric
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV: {
+            transform_tohost_VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_shader_image_footprint
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV: {
+            transform_tohost_VkPhysicalDeviceShaderImageFootprintFeaturesNV(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceShaderImageFootprintFeaturesNV*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_scissor_exclusive
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV: {
+            transform_tohost_VkPipelineViewportExclusiveScissorStateCreateInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkPipelineViewportExclusiveScissorStateCreateInfoNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV: {
+            transform_tohost_VkPhysicalDeviceExclusiveScissorFeaturesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceExclusiveScissorFeaturesNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV: {
+            transform_tohost_VkQueueFamilyCheckpointPropertiesNV(
+                resourceTracker,
+                reinterpret_cast<VkQueueFamilyCheckpointPropertiesNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_INTEL_shader_integer_functions2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL: {
+            transform_tohost_VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_INTEL_performance_query
+        case VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL: {
+            transform_tohost_VkQueryPoolPerformanceQueryCreateInfoINTEL(
+                resourceTracker,
+                reinterpret_cast<VkQueryPoolPerformanceQueryCreateInfoINTEL*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_pci_bus_info
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT: {
+            transform_tohost_VkPhysicalDevicePCIBusInfoPropertiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDevicePCIBusInfoPropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_display_native_hdr
+        case VK_STRUCTURE_TYPE_DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD: {
+            transform_tohost_VkDisplayNativeHdrSurfaceCapabilitiesAMD(
+                resourceTracker,
+                reinterpret_cast<VkDisplayNativeHdrSurfaceCapabilitiesAMD*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD: {
+            transform_tohost_VkSwapchainDisplayNativeHdrCreateInfoAMD(
+                resourceTracker,
+                reinterpret_cast<VkSwapchainDisplayNativeHdrCreateInfoAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_fragment_density_map
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceFragmentDensityMapFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT: {
+            transform_tohost_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceFragmentDensityMapPropertiesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT: {
+            transform_tohost_VkRenderPassFragmentDensityMapCreateInfoEXT(
+                resourceTracker, reinterpret_cast<VkRenderPassFragmentDensityMapCreateInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_subgroup_size_control
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceSubgroupSizeControlFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceSubgroupSizeControlFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT: {
+            transform_tohost_VkPhysicalDeviceSubgroupSizeControlPropertiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceSubgroupSizeControlPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT: {
+            transform_tohost_VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_shader_core_properties2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD: {
+            transform_tohost_VkPhysicalDeviceShaderCoreProperties2AMD(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShaderCoreProperties2AMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_device_coherent_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD: {
+            transform_tohost_VkPhysicalDeviceCoherentMemoryFeaturesAMD(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceCoherentMemoryFeaturesAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_image_atomic_int64
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_memory_budget
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT: {
+            transform_tohost_VkPhysicalDeviceMemoryBudgetPropertiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceMemoryBudgetPropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_memory_priority
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceMemoryPriorityFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceMemoryPriorityFeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT: {
+            transform_tohost_VkMemoryPriorityAllocateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkMemoryPriorityAllocateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_dedicated_allocation_image_aliasing
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV: {
+            transform_tohost_VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_buffer_device_address
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceBufferDeviceAddressFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT: {
+            transform_tohost_VkBufferDeviceAddressCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkBufferDeviceAddressCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_validation_features
+        case VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT: {
+            transform_tohost_VkValidationFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkValidationFeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_cooperative_matrix
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV: {
+            transform_tohost_VkPhysicalDeviceCooperativeMatrixFeaturesNV(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceCooperativeMatrixFeaturesNV*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV: {
+            transform_tohost_VkPhysicalDeviceCooperativeMatrixPropertiesNV(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceCooperativeMatrixPropertiesNV*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV: {
+            transform_tohost_VkPhysicalDeviceCoverageReductionModeFeaturesNV(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceCoverageReductionModeFeaturesNV*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV: {
+            transform_tohost_VkPipelineCoverageReductionStateCreateInfoNV(
+                resourceTracker, reinterpret_cast<VkPipelineCoverageReductionStateCreateInfoNV*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_fragment_shader_interlock
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_ycbcr_image_arrays
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceYcbcrImageArraysFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceYcbcrImageArraysFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_provoking_vertex
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceProvokingVertexFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceProvokingVertexFeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT: {
+            transform_tohost_VkPhysicalDeviceProvokingVertexPropertiesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceProvokingVertexPropertiesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT: {
+            transform_tohost_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkPipelineRasterizationProvokingVertexStateCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+        case VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT: {
+            transform_tohost_VkSurfaceFullScreenExclusiveInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkSurfaceFullScreenExclusiveInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT: {
+            transform_tohost_VkSurfaceCapabilitiesFullScreenExclusiveEXT(
+                resourceTracker, reinterpret_cast<VkSurfaceCapabilitiesFullScreenExclusiveEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT: {
+            transform_tohost_VkSurfaceFullScreenExclusiveWin32InfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkSurfaceFullScreenExclusiveWin32InfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_line_rasterization
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceLineRasterizationFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceLineRasterizationFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT: {
+            transform_tohost_VkPhysicalDeviceLineRasterizationPropertiesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceLineRasterizationPropertiesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT: {
+            transform_tohost_VkPipelineRasterizationLineStateCreateInfoEXT(
+                resourceTracker, reinterpret_cast<VkPipelineRasterizationLineStateCreateInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_atomic_float
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceShaderAtomicFloatFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceShaderAtomicFloatFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_index_type_uint8
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceIndexTypeUint8FeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceIndexTypeUint8FeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceExtendedDynamicStateFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceExtendedDynamicStateFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_atomic_float2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_demote_to_helper_invocation
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_device_generated_commands
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV: {
+            transform_tohost_VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV: {
+            transform_tohost_VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV: {
+            transform_tohost_VkGraphicsPipelineShaderGroupsCreateInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkGraphicsPipelineShaderGroupsCreateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_inherited_viewport_scissor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV: {
+            transform_tohost_VkPhysicalDeviceInheritedViewportScissorFeaturesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceInheritedViewportScissorFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV: {
+            transform_tohost_VkCommandBufferInheritanceViewportScissorInfoNV(
+                resourceTracker, reinterpret_cast<VkCommandBufferInheritanceViewportScissorInfoNV*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_texel_buffer_alignment
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT: {
+            transform_tohost_VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_QCOM_render_pass_transform
+        case VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM: {
+            transform_tohost_VkRenderPassTransformBeginInfoQCOM(
+                resourceTracker,
+                reinterpret_cast<VkRenderPassTransformBeginInfoQCOM*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM: {
+            transform_tohost_VkCommandBufferInheritanceRenderPassTransformInfoQCOM(
+                resourceTracker,
+                reinterpret_cast<VkCommandBufferInheritanceRenderPassTransformInfoQCOM*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_device_memory_report
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceDeviceMemoryReportFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceDeviceMemoryReportFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT: {
+            transform_tohost_VkDeviceDeviceMemoryReportCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkDeviceDeviceMemoryReportCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_robustness2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceRobustness2FeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceRobustness2FeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT: {
+            transform_tohost_VkPhysicalDeviceRobustness2PropertiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceRobustness2PropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_custom_border_color
+        case VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT: {
+            transform_tohost_VkSamplerCustomBorderColorCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkSamplerCustomBorderColorCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT: {
+            transform_tohost_VkPhysicalDeviceCustomBorderColorPropertiesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceCustomBorderColorPropertiesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceCustomBorderColorFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceCustomBorderColorFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_private_data
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDevicePrivateDataFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDevicePrivateDataFeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO_EXT: {
+            transform_tohost_VkDevicePrivateDataCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkDevicePrivateDataCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_pipeline_creation_cache_control
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_device_diagnostics_config
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV: {
+            transform_tohost_VkPhysicalDeviceDiagnosticsConfigFeaturesNV(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceDiagnosticsConfigFeaturesNV*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV: {
+            transform_tohost_VkDeviceDiagnosticsConfigCreateInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkDeviceDiagnosticsConfigCreateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV: {
+            transform_tohost_VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV: {
+            transform_tohost_VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV: {
+            transform_tohost_VkPipelineFragmentShadingRateEnumStateCreateInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkPipelineFragmentShadingRateEnumStateCreateInfoNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_ray_tracing_motion_blur
+        case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV: {
+            transform_tohost_VkAccelerationStructureGeometryMotionTrianglesDataNV(
+                resourceTracker,
+                reinterpret_cast<VkAccelerationStructureGeometryMotionTrianglesDataNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV: {
+            transform_tohost_VkAccelerationStructureMotionInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkAccelerationStructureMotionInfoNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV: {
+            transform_tohost_VkPhysicalDeviceRayTracingMotionBlurFeaturesNV(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceRayTracingMotionBlurFeaturesNV*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_ycbcr_2plane_444_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_fragment_density_map2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceFragmentDensityMap2FeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceFragmentDensityMap2FeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT: {
+            transform_tohost_VkPhysicalDeviceFragmentDensityMap2PropertiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceFragmentDensityMap2PropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_QCOM_rotated_copy_commands
+        case VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM: {
+            transform_tohost_VkCopyCommandTransformInfoQCOM(
+                resourceTracker,
+                reinterpret_cast<VkCopyCommandTransformInfoQCOM*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_image_robustness
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceImageRobustnessFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceImageRobustnessFeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_4444_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDevice4444FormatsFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDevice4444FormatsFeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_rgba10x6_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_VALVE_mutable_descriptor_type
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE: {
+            transform_tohost_VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE: {
+            transform_tohost_VkMutableDescriptorTypeCreateInfoVALVE(
+                resourceTracker,
+                reinterpret_cast<VkMutableDescriptorTypeCreateInfoVALVE*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_physical_device_drm
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT: {
+            transform_tohost_VkPhysicalDeviceDrmPropertiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceDrmPropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_primitive_topology_list_restart
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_FUCHSIA_external_memory
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA: {
+            transform_tohost_VkImportMemoryZirconHandleInfoFUCHSIA(
+                resourceTracker,
+                reinterpret_cast<VkImportMemoryZirconHandleInfoFUCHSIA*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA: {
+            transform_tohost_VkImportMemoryBufferCollectionFUCHSIA(
+                resourceTracker,
+                reinterpret_cast<VkImportMemoryBufferCollectionFUCHSIA*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA: {
+            transform_tohost_VkBufferCollectionImageCreateInfoFUCHSIA(
+                resourceTracker,
+                reinterpret_cast<VkBufferCollectionImageCreateInfoFUCHSIA*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA: {
+            transform_tohost_VkBufferCollectionBufferCreateInfoFUCHSIA(
+                resourceTracker,
+                reinterpret_cast<VkBufferCollectionBufferCreateInfoFUCHSIA*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+        case VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI: {
+            transform_tohost_VkSubpassShadingPipelineCreateInfoHUAWEI(
+                resourceTracker,
+                reinterpret_cast<VkSubpassShadingPipelineCreateInfoHUAWEI*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI: {
+            transform_tohost_VkPhysicalDeviceSubpassShadingFeaturesHUAWEI(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceSubpassShadingFeaturesHUAWEI*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI: {
+            transform_tohost_VkPhysicalDeviceSubpassShadingPropertiesHUAWEI(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceSubpassShadingPropertiesHUAWEI*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI: {
+            transform_tohost_VkPhysicalDeviceInvocationMaskFeaturesHUAWEI(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceInvocationMaskFeaturesHUAWEI*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_external_memory_rdma
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_RDMA_FEATURES_NV: {
+            transform_tohost_VkPhysicalDeviceExternalMemoryRDMAFeaturesNV(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceExternalMemoryRDMAFeaturesNV*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceExtendedDynamicState2FeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceExtendedDynamicState2FeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_color_write_enable
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceColorWriteEnableFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceColorWriteEnableFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT: {
+            transform_tohost_VkPipelineColorWriteCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkPipelineColorWriteCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_GOOGLE_gfxstream
+        case VK_STRUCTURE_TYPE_IMPORT_COLOR_BUFFER_GOOGLE: {
+            transform_tohost_VkImportColorBufferGOOGLE(
+                resourceTracker, reinterpret_cast<VkImportColorBufferGOOGLE*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMPORT_BUFFER_GOOGLE: {
+            transform_tohost_VkImportBufferGOOGLE(
+                resourceTracker, reinterpret_cast<VkImportBufferGOOGLE*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_CREATE_BLOB_GOOGLE: {
+            transform_tohost_VkCreateBlobGOOGLE(
+                resourceTracker, reinterpret_cast<VkCreateBlobGOOGLE*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_global_priority_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_EXT: {
+            transform_tohost_VkQueueFamilyGlobalPriorityPropertiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkQueueFamilyGlobalPriorityPropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_multi_draw
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceMultiDrawFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceMultiDrawFeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT: {
+            transform_tohost_VkPhysicalDeviceMultiDrawPropertiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceMultiDrawPropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_border_color_swizzle
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDeviceBorderColorSwizzleFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceBorderColorSwizzleFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT: {
+            transform_tohost_VkSamplerBorderColorComponentMappingCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkSamplerBorderColorComponentMappingCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT: {
+            transform_tohost_VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_acceleration_structure
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR: {
+            transform_tohost_VkWriteDescriptorSetAccelerationStructureKHR(
+                resourceTracker, reinterpret_cast<VkWriteDescriptorSetAccelerationStructureKHR*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR: {
+            transform_tohost_VkPhysicalDeviceAccelerationStructureFeaturesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceAccelerationStructureFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR: {
+            transform_tohost_VkPhysicalDeviceAccelerationStructurePropertiesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceAccelerationStructurePropertiesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR: {
+            transform_tohost_VkPhysicalDeviceRayTracingPipelineFeaturesKHR(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceRayTracingPipelineFeaturesKHR*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR: {
+            transform_tohost_VkPhysicalDeviceRayTracingPipelinePropertiesKHR(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceRayTracingPipelinePropertiesKHR*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_ray_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR: {
+            transform_tohost_VkPhysicalDeviceRayQueryFeaturesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceRayQueryFeaturesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+        default: {
+            return;
+        }
+    }
+}
+
+void transform_fromhost_extension_struct(ResourceTracker* resourceTracker,
+                                         void* structExtension_out) {
+    if (!structExtension_out) {
+        return;
+    }
+    uint32_t structType = (uint32_t)goldfish_vk_struct_type(structExtension_out);
+    switch (structType) {
+#ifdef VK_VERSION_1_1
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES: {
+            transform_fromhost_VkPhysicalDeviceSubgroupProperties(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceSubgroupProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: {
+            transform_fromhost_VkPhysicalDevice16BitStorageFeatures(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDevice16BitStorageFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS: {
+            transform_fromhost_VkMemoryDedicatedRequirements(
+                resourceTracker,
+                reinterpret_cast<VkMemoryDedicatedRequirements*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO: {
+            transform_fromhost_VkMemoryDedicatedAllocateInfo(
+                resourceTracker,
+                reinterpret_cast<VkMemoryDedicatedAllocateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO: {
+            transform_fromhost_VkMemoryAllocateFlagsInfo(
+                resourceTracker, reinterpret_cast<VkMemoryAllocateFlagsInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO: {
+            transform_fromhost_VkDeviceGroupRenderPassBeginInfo(
+                resourceTracker,
+                reinterpret_cast<VkDeviceGroupRenderPassBeginInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO: {
+            transform_fromhost_VkDeviceGroupCommandBufferBeginInfo(
+                resourceTracker,
+                reinterpret_cast<VkDeviceGroupCommandBufferBeginInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO: {
+            transform_fromhost_VkDeviceGroupSubmitInfo(
+                resourceTracker, reinterpret_cast<VkDeviceGroupSubmitInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO: {
+            transform_fromhost_VkDeviceGroupBindSparseInfo(
+                resourceTracker,
+                reinterpret_cast<VkDeviceGroupBindSparseInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO: {
+            transform_fromhost_VkBindBufferMemoryDeviceGroupInfo(
+                resourceTracker,
+                reinterpret_cast<VkBindBufferMemoryDeviceGroupInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO: {
+            transform_fromhost_VkBindImageMemoryDeviceGroupInfo(
+                resourceTracker,
+                reinterpret_cast<VkBindImageMemoryDeviceGroupInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO: {
+            transform_fromhost_VkDeviceGroupDeviceCreateInfo(
+                resourceTracker,
+                reinterpret_cast<VkDeviceGroupDeviceCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: {
+            transform_fromhost_VkPhysicalDeviceFeatures2(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceFeatures2*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES: {
+            transform_fromhost_VkPhysicalDevicePointClippingProperties(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDevicePointClippingProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO: {
+            transform_fromhost_VkRenderPassInputAttachmentAspectCreateInfo(
+                resourceTracker, reinterpret_cast<VkRenderPassInputAttachmentAspectCreateInfo*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO: {
+            transform_fromhost_VkImageViewUsageCreateInfo(
+                resourceTracker,
+                reinterpret_cast<VkImageViewUsageCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO: {
+            transform_fromhost_VkPipelineTessellationDomainOriginStateCreateInfo(
+                resourceTracker,
+                reinterpret_cast<VkPipelineTessellationDomainOriginStateCreateInfo*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO: {
+            transform_fromhost_VkRenderPassMultiviewCreateInfo(
+                resourceTracker,
+                reinterpret_cast<VkRenderPassMultiviewCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES: {
+            transform_fromhost_VkPhysicalDeviceMultiviewFeatures(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceMultiviewFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES: {
+            transform_fromhost_VkPhysicalDeviceMultiviewProperties(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceMultiviewProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES: {
+            transform_fromhost_VkPhysicalDeviceVariablePointersFeatures(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceVariablePointersFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES: {
+            transform_fromhost_VkPhysicalDeviceProtectedMemoryFeatures(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceProtectedMemoryFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES: {
+            transform_fromhost_VkPhysicalDeviceProtectedMemoryProperties(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceProtectedMemoryProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO: {
+            transform_fromhost_VkProtectedSubmitInfo(
+                resourceTracker, reinterpret_cast<VkProtectedSubmitInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO: {
+            transform_fromhost_VkSamplerYcbcrConversionInfo(
+                resourceTracker,
+                reinterpret_cast<VkSamplerYcbcrConversionInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO: {
+            transform_fromhost_VkBindImagePlaneMemoryInfo(
+                resourceTracker,
+                reinterpret_cast<VkBindImagePlaneMemoryInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO: {
+            transform_fromhost_VkImagePlaneMemoryRequirementsInfo(
+                resourceTracker,
+                reinterpret_cast<VkImagePlaneMemoryRequirementsInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: {
+            transform_fromhost_VkPhysicalDeviceSamplerYcbcrConversionFeatures(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceSamplerYcbcrConversionFeatures*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES: {
+            transform_fromhost_VkSamplerYcbcrConversionImageFormatProperties(
+                resourceTracker, reinterpret_cast<VkSamplerYcbcrConversionImageFormatProperties*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO: {
+            resourceTracker->transformImpl_VkPhysicalDeviceExternalImageFormatInfo_fromhost(
+                reinterpret_cast<VkPhysicalDeviceExternalImageFormatInfo*>(structExtension_out), 1);
+            transform_fromhost_VkPhysicalDeviceExternalImageFormatInfo(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceExternalImageFormatInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES: {
+            resourceTracker->transformImpl_VkExternalImageFormatProperties_fromhost(
+                reinterpret_cast<VkExternalImageFormatProperties*>(structExtension_out), 1);
+            transform_fromhost_VkExternalImageFormatProperties(
+                resourceTracker,
+                reinterpret_cast<VkExternalImageFormatProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES: {
+            transform_fromhost_VkPhysicalDeviceIDProperties(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceIDProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO: {
+            resourceTracker->transformImpl_VkExternalMemoryImageCreateInfo_fromhost(
+                reinterpret_cast<VkExternalMemoryImageCreateInfo*>(structExtension_out), 1);
+            transform_fromhost_VkExternalMemoryImageCreateInfo(
+                resourceTracker,
+                reinterpret_cast<VkExternalMemoryImageCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO: {
+            resourceTracker->transformImpl_VkExternalMemoryBufferCreateInfo_fromhost(
+                reinterpret_cast<VkExternalMemoryBufferCreateInfo*>(structExtension_out), 1);
+            transform_fromhost_VkExternalMemoryBufferCreateInfo(
+                resourceTracker,
+                reinterpret_cast<VkExternalMemoryBufferCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO: {
+            resourceTracker->transformImpl_VkExportMemoryAllocateInfo_fromhost(
+                reinterpret_cast<VkExportMemoryAllocateInfo*>(structExtension_out), 1);
+            transform_fromhost_VkExportMemoryAllocateInfo(
+                resourceTracker,
+                reinterpret_cast<VkExportMemoryAllocateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO: {
+            transform_fromhost_VkExportFenceCreateInfo(
+                resourceTracker, reinterpret_cast<VkExportFenceCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO: {
+            transform_fromhost_VkExportSemaphoreCreateInfo(
+                resourceTracker,
+                reinterpret_cast<VkExportSemaphoreCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES: {
+            transform_fromhost_VkPhysicalDeviceMaintenance3Properties(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceMaintenance3Properties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES: {
+            transform_fromhost_VkPhysicalDeviceShaderDrawParametersFeatures(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceShaderDrawParametersFeatures*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_VERSION_1_2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES: {
+            transform_fromhost_VkPhysicalDeviceVulkan11Features(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceVulkan11Features*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES: {
+            transform_fromhost_VkPhysicalDeviceVulkan11Properties(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceVulkan11Properties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES: {
+            transform_fromhost_VkPhysicalDeviceVulkan12Features(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceVulkan12Features*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES: {
+            transform_fromhost_VkPhysicalDeviceVulkan12Properties(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceVulkan12Properties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO: {
+            transform_fromhost_VkImageFormatListCreateInfo(
+                resourceTracker,
+                reinterpret_cast<VkImageFormatListCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES: {
+            transform_fromhost_VkPhysicalDevice8BitStorageFeatures(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDevice8BitStorageFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES: {
+            transform_fromhost_VkPhysicalDeviceDriverProperties(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceDriverProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES: {
+            transform_fromhost_VkPhysicalDeviceShaderAtomicInt64Features(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShaderAtomicInt64Features*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES: {
+            transform_fromhost_VkPhysicalDeviceShaderFloat16Int8Features(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShaderFloat16Int8Features*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES: {
+            transform_fromhost_VkPhysicalDeviceFloatControlsProperties(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceFloatControlsProperties*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO: {
+            transform_fromhost_VkDescriptorSetLayoutBindingFlagsCreateInfo(
+                resourceTracker, reinterpret_cast<VkDescriptorSetLayoutBindingFlagsCreateInfo*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES: {
+            transform_fromhost_VkPhysicalDeviceDescriptorIndexingFeatures(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceDescriptorIndexingFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES: {
+            transform_fromhost_VkPhysicalDeviceDescriptorIndexingProperties(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceDescriptorIndexingProperties*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO: {
+            transform_fromhost_VkDescriptorSetVariableDescriptorCountAllocateInfo(
+                resourceTracker,
+                reinterpret_cast<VkDescriptorSetVariableDescriptorCountAllocateInfo*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT: {
+            transform_fromhost_VkDescriptorSetVariableDescriptorCountLayoutSupport(
+                resourceTracker,
+                reinterpret_cast<VkDescriptorSetVariableDescriptorCountLayoutSupport*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE: {
+            transform_fromhost_VkSubpassDescriptionDepthStencilResolve(
+                resourceTracker,
+                reinterpret_cast<VkSubpassDescriptionDepthStencilResolve*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES: {
+            transform_fromhost_VkPhysicalDeviceDepthStencilResolveProperties(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceDepthStencilResolveProperties*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES: {
+            transform_fromhost_VkPhysicalDeviceScalarBlockLayoutFeatures(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceScalarBlockLayoutFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO: {
+            transform_fromhost_VkImageStencilUsageCreateInfo(
+                resourceTracker,
+                reinterpret_cast<VkImageStencilUsageCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO: {
+            transform_fromhost_VkSamplerReductionModeCreateInfo(
+                resourceTracker,
+                reinterpret_cast<VkSamplerReductionModeCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES: {
+            transform_fromhost_VkPhysicalDeviceSamplerFilterMinmaxProperties(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceSamplerFilterMinmaxProperties*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES: {
+            transform_fromhost_VkPhysicalDeviceVulkanMemoryModelFeatures(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceVulkanMemoryModelFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES: {
+            transform_fromhost_VkPhysicalDeviceImagelessFramebufferFeatures(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceImagelessFramebufferFeatures*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO: {
+            transform_fromhost_VkFramebufferAttachmentsCreateInfo(
+                resourceTracker,
+                reinterpret_cast<VkFramebufferAttachmentsCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO: {
+            transform_fromhost_VkRenderPassAttachmentBeginInfo(
+                resourceTracker,
+                reinterpret_cast<VkRenderPassAttachmentBeginInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES: {
+            transform_fromhost_VkPhysicalDeviceUniformBufferStandardLayoutFeatures(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceUniformBufferStandardLayoutFeatures*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES: {
+            transform_fromhost_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES: {
+            transform_fromhost_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT: {
+            transform_fromhost_VkAttachmentReferenceStencilLayout(
+                resourceTracker,
+                reinterpret_cast<VkAttachmentReferenceStencilLayout*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT: {
+            transform_fromhost_VkAttachmentDescriptionStencilLayout(
+                resourceTracker,
+                reinterpret_cast<VkAttachmentDescriptionStencilLayout*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES: {
+            transform_fromhost_VkPhysicalDeviceHostQueryResetFeatures(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceHostQueryResetFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES: {
+            transform_fromhost_VkPhysicalDeviceTimelineSemaphoreFeatures(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceTimelineSemaphoreFeatures*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES: {
+            transform_fromhost_VkPhysicalDeviceTimelineSemaphoreProperties(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceTimelineSemaphoreProperties*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO: {
+            transform_fromhost_VkSemaphoreTypeCreateInfo(
+                resourceTracker, reinterpret_cast<VkSemaphoreTypeCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO: {
+            transform_fromhost_VkTimelineSemaphoreSubmitInfo(
+                resourceTracker,
+                reinterpret_cast<VkTimelineSemaphoreSubmitInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES: {
+            transform_fromhost_VkPhysicalDeviceBufferDeviceAddressFeatures(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceBufferDeviceAddressFeatures*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO: {
+            transform_fromhost_VkBufferOpaqueCaptureAddressCreateInfo(
+                resourceTracker,
+                reinterpret_cast<VkBufferOpaqueCaptureAddressCreateInfo*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO: {
+            transform_fromhost_VkMemoryOpaqueCaptureAddressAllocateInfo(
+                resourceTracker,
+                reinterpret_cast<VkMemoryOpaqueCaptureAddressAllocateInfo*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_swapchain
+        case VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR: {
+            transform_fromhost_VkImageSwapchainCreateInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkImageSwapchainCreateInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR: {
+            transform_fromhost_VkBindImageMemorySwapchainInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkBindImageMemorySwapchainInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR: {
+            transform_fromhost_VkDeviceGroupPresentInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkDeviceGroupPresentInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR: {
+            transform_fromhost_VkDeviceGroupSwapchainCreateInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkDeviceGroupSwapchainCreateInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_display_swapchain
+        case VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR: {
+            transform_fromhost_VkDisplayPresentInfoKHR(
+                resourceTracker, reinterpret_cast<VkDisplayPresentInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_video_queue
+        case VK_STRUCTURE_TYPE_VIDEO_QUEUE_FAMILY_PROPERTIES_2_KHR: {
+            transform_fromhost_VkVideoQueueFamilyProperties2KHR(
+                resourceTracker,
+                reinterpret_cast<VkVideoQueueFamilyProperties2KHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_PROFILE_KHR: {
+            transform_fromhost_VkVideoProfileKHR(
+                resourceTracker, reinterpret_cast<VkVideoProfileKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_PROFILES_KHR: {
+            transform_fromhost_VkVideoProfilesKHR(
+                resourceTracker, reinterpret_cast<VkVideoProfilesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_dynamic_rendering
+        case VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO_KHR: {
+            transform_fromhost_VkPipelineRenderingCreateInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkPipelineRenderingCreateInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR: {
+            transform_fromhost_VkPhysicalDeviceDynamicRenderingFeaturesKHR(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceDynamicRenderingFeaturesKHR*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO_KHR: {
+            transform_fromhost_VkCommandBufferInheritanceRenderingInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkCommandBufferInheritanceRenderingInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR: {
+            transform_fromhost_VkRenderingFragmentShadingRateAttachmentInfoKHR(
+                resourceTracker, reinterpret_cast<VkRenderingFragmentShadingRateAttachmentInfoKHR*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT: {
+            transform_fromhost_VkRenderingFragmentDensityMapAttachmentInfoEXT(
+                resourceTracker, reinterpret_cast<VkRenderingFragmentDensityMapAttachmentInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD: {
+            transform_fromhost_VkAttachmentSampleCountInfoAMD(
+                resourceTracker,
+                reinterpret_cast<VkAttachmentSampleCountInfoAMD*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX: {
+            transform_fromhost_VkMultiviewPerViewAttributesInfoNVX(
+                resourceTracker,
+                reinterpret_cast<VkMultiviewPerViewAttributesInfoNVX*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_memory_win32
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR: {
+            transform_fromhost_VkImportMemoryWin32HandleInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkImportMemoryWin32HandleInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR: {
+            transform_fromhost_VkExportMemoryWin32HandleInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkExportMemoryWin32HandleInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_memory_fd
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR: {
+            transform_fromhost_VkImportMemoryFdInfoKHR(
+                resourceTracker, reinterpret_cast<VkImportMemoryFdInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_win32_keyed_mutex
+        case VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR: {
+            transform_fromhost_VkWin32KeyedMutexAcquireReleaseInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkWin32KeyedMutexAcquireReleaseInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+        case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR: {
+            transform_fromhost_VkExportSemaphoreWin32HandleInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkExportSemaphoreWin32HandleInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR: {
+            transform_fromhost_VkD3D12FenceSubmitInfoKHR(
+                resourceTracker, reinterpret_cast<VkD3D12FenceSubmitInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_push_descriptor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR: {
+            transform_fromhost_VkPhysicalDevicePushDescriptorPropertiesKHR(
+                resourceTracker, reinterpret_cast<VkPhysicalDevicePushDescriptorPropertiesKHR*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_incremental_present
+        case VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR: {
+            transform_fromhost_VkPresentRegionsKHR(
+                resourceTracker, reinterpret_cast<VkPresentRegionsKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shared_presentable_image
+        case VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR: {
+            transform_fromhost_VkSharedPresentSurfaceCapabilitiesKHR(
+                resourceTracker,
+                reinterpret_cast<VkSharedPresentSurfaceCapabilitiesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_external_fence_win32
+        case VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR: {
+            transform_fromhost_VkExportFenceWin32HandleInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkExportFenceWin32HandleInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_performance_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR: {
+            transform_fromhost_VkPhysicalDevicePerformanceQueryFeaturesKHR(
+                resourceTracker, reinterpret_cast<VkPhysicalDevicePerformanceQueryFeaturesKHR*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR: {
+            transform_fromhost_VkPhysicalDevicePerformanceQueryPropertiesKHR(
+                resourceTracker, reinterpret_cast<VkPhysicalDevicePerformanceQueryPropertiesKHR*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR: {
+            transform_fromhost_VkQueryPoolPerformanceCreateInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkQueryPoolPerformanceCreateInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR: {
+            transform_fromhost_VkPerformanceQuerySubmitInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkPerformanceQuerySubmitInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_portability_subset
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR: {
+            transform_fromhost_VkPhysicalDevicePortabilitySubsetFeaturesKHR(
+                resourceTracker, reinterpret_cast<VkPhysicalDevicePortabilitySubsetFeaturesKHR*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR: {
+            transform_fromhost_VkPhysicalDevicePortabilitySubsetPropertiesKHR(
+                resourceTracker, reinterpret_cast<VkPhysicalDevicePortabilitySubsetPropertiesKHR*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_clock
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR: {
+            transform_fromhost_VkPhysicalDeviceShaderClockFeaturesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShaderClockFeaturesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_terminate_invocation
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR: {
+            transform_fromhost_VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+        case VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR: {
+            transform_fromhost_VkFragmentShadingRateAttachmentInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkFragmentShadingRateAttachmentInfoKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR: {
+            transform_fromhost_VkPipelineFragmentShadingRateStateCreateInfoKHR(
+                resourceTracker, reinterpret_cast<VkPipelineFragmentShadingRateStateCreateInfoKHR*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR: {
+            transform_fromhost_VkPhysicalDeviceFragmentShadingRateFeaturesKHR(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceFragmentShadingRateFeaturesKHR*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR: {
+            transform_fromhost_VkPhysicalDeviceFragmentShadingRatePropertiesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceFragmentShadingRatePropertiesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_surface_protected_capabilities
+        case VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR: {
+            transform_fromhost_VkSurfaceProtectedCapabilitiesKHR(
+                resourceTracker,
+                reinterpret_cast<VkSurfaceProtectedCapabilitiesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_present_wait
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR: {
+            transform_fromhost_VkPhysicalDevicePresentWaitFeaturesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDevicePresentWaitFeaturesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR: {
+            transform_fromhost_VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_integer_dot_product
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR: {
+            transform_fromhost_VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR: {
+            transform_fromhost_VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_present_id
+        case VK_STRUCTURE_TYPE_PRESENT_ID_KHR: {
+            transform_fromhost_VkPresentIdKHR(
+                resourceTracker, reinterpret_cast<VkPresentIdKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR: {
+            transform_fromhost_VkPhysicalDevicePresentIdFeaturesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDevicePresentIdFeaturesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_video_encode_queue
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_INFO_KHR: {
+            transform_fromhost_VkVideoEncodeRateControlInfoKHR(
+                resourceTracker,
+                reinterpret_cast<VkVideoEncodeRateControlInfoKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_synchronization2
+        case VK_STRUCTURE_TYPE_MEMORY_BARRIER_2_KHR: {
+            transform_fromhost_VkMemoryBarrier2KHR(
+                resourceTracker, reinterpret_cast<VkMemoryBarrier2KHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR: {
+            transform_fromhost_VkPhysicalDeviceSynchronization2FeaturesKHR(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceSynchronization2FeaturesKHR*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV: {
+            transform_fromhost_VkQueueFamilyCheckpointProperties2NV(
+                resourceTracker,
+                reinterpret_cast<VkQueueFamilyCheckpointProperties2NV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_shader_subgroup_uniform_control_flow
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR: {
+            transform_fromhost_VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_zero_initialize_workgroup_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES_KHR: {
+            transform_fromhost_VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_workgroup_memory_explicit_layout
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR: {
+            transform_fromhost_VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_format_feature_flags2
+        case VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3_KHR: {
+            transform_fromhost_VkFormatProperties3KHR(
+                resourceTracker, reinterpret_cast<VkFormatProperties3KHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_maintenance4
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES_KHR: {
+            transform_fromhost_VkPhysicalDeviceMaintenance4FeaturesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceMaintenance4FeaturesKHR*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES_KHR: {
+            transform_fromhost_VkPhysicalDeviceMaintenance4PropertiesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceMaintenance4PropertiesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_ANDROID_native_buffer
+        case VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID: {
+            transform_fromhost_VkNativeBufferANDROID(
+                resourceTracker, reinterpret_cast<VkNativeBufferANDROID*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_debug_report
+        case VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT: {
+            transform_fromhost_VkDebugReportCallbackCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkDebugReportCallbackCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_rasterization_order
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD: {
+            transform_fromhost_VkPipelineRasterizationStateRasterizationOrderAMD(
+                resourceTracker,
+                reinterpret_cast<VkPipelineRasterizationStateRasterizationOrderAMD*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_dedicated_allocation
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV: {
+            transform_fromhost_VkDedicatedAllocationImageCreateInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkDedicatedAllocationImageCreateInfoNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV: {
+            transform_fromhost_VkDedicatedAllocationBufferCreateInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkDedicatedAllocationBufferCreateInfoNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV: {
+            transform_fromhost_VkDedicatedAllocationMemoryAllocateInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkDedicatedAllocationMemoryAllocateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_transform_feedback
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceTransformFeedbackFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceTransformFeedbackFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT: {
+            transform_fromhost_VkPhysicalDeviceTransformFeedbackPropertiesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceTransformFeedbackPropertiesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT: {
+            transform_fromhost_VkPipelineRasterizationStateStreamCreateInfoEXT(
+                resourceTracker, reinterpret_cast<VkPipelineRasterizationStateStreamCreateInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_encode_h264
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_EXT: {
+            transform_fromhost_VkVideoEncodeH264CapabilitiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoEncodeH264CapabilitiesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_CREATE_INFO_EXT: {
+            transform_fromhost_VkVideoEncodeH264SessionCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoEncodeH264SessionCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            transform_fromhost_VkVideoEncodeH264SessionParametersAddInfoEXT(
+                resourceTracker, reinterpret_cast<VkVideoEncodeH264SessionParametersAddInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            transform_fromhost_VkVideoEncodeH264SessionParametersCreateInfoEXT(
+                resourceTracker, reinterpret_cast<VkVideoEncodeH264SessionParametersCreateInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_VCL_FRAME_INFO_EXT: {
+            transform_fromhost_VkVideoEncodeH264VclFrameInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoEncodeH264VclFrameInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_EMIT_PICTURE_PARAMETERS_EXT: {
+            transform_fromhost_VkVideoEncodeH264EmitPictureParametersEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoEncodeH264EmitPictureParametersEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_EXT: {
+            transform_fromhost_VkVideoEncodeH264ProfileEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoEncodeH264ProfileEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_encode_h265
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_EXT: {
+            transform_fromhost_VkVideoEncodeH265CapabilitiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoEncodeH265CapabilitiesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_CREATE_INFO_EXT: {
+            transform_fromhost_VkVideoEncodeH265SessionCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoEncodeH265SessionCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            transform_fromhost_VkVideoEncodeH265SessionParametersAddInfoEXT(
+                resourceTracker, reinterpret_cast<VkVideoEncodeH265SessionParametersAddInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            transform_fromhost_VkVideoEncodeH265SessionParametersCreateInfoEXT(
+                resourceTracker, reinterpret_cast<VkVideoEncodeH265SessionParametersCreateInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_VCL_FRAME_INFO_EXT: {
+            transform_fromhost_VkVideoEncodeH265VclFrameInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoEncodeH265VclFrameInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_EMIT_PICTURE_PARAMETERS_EXT: {
+            transform_fromhost_VkVideoEncodeH265EmitPictureParametersEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoEncodeH265EmitPictureParametersEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_EXT: {
+            transform_fromhost_VkVideoEncodeH265ProfileEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoEncodeH265ProfileEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_decode_h264
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_EXT: {
+            transform_fromhost_VkVideoDecodeH264ProfileEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoDecodeH264ProfileEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_EXT: {
+            transform_fromhost_VkVideoDecodeH264CapabilitiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoDecodeH264CapabilitiesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_CREATE_INFO_EXT: {
+            transform_fromhost_VkVideoDecodeH264SessionCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoDecodeH264SessionCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            transform_fromhost_VkVideoDecodeH264SessionParametersAddInfoEXT(
+                resourceTracker, reinterpret_cast<VkVideoDecodeH264SessionParametersAddInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            transform_fromhost_VkVideoDecodeH264SessionParametersCreateInfoEXT(
+                resourceTracker, reinterpret_cast<VkVideoDecodeH264SessionParametersCreateInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PICTURE_INFO_EXT: {
+            transform_fromhost_VkVideoDecodeH264PictureInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoDecodeH264PictureInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_MVC_EXT: {
+            transform_fromhost_VkVideoDecodeH264MvcEXT(
+                resourceTracker, reinterpret_cast<VkVideoDecodeH264MvcEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_EXT: {
+            transform_fromhost_VkVideoDecodeH264DpbSlotInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoDecodeH264DpbSlotInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_texture_gather_bias_lod
+        case VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD: {
+            transform_fromhost_VkTextureLODGatherFormatPropertiesAMD(
+                resourceTracker,
+                reinterpret_cast<VkTextureLODGatherFormatPropertiesAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_corner_sampled_image
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV: {
+            transform_fromhost_VkPhysicalDeviceCornerSampledImageFeaturesNV(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceCornerSampledImageFeaturesNV*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_external_memory
+        case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV: {
+            transform_fromhost_VkExternalMemoryImageCreateInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkExternalMemoryImageCreateInfoNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV: {
+            transform_fromhost_VkExportMemoryAllocateInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkExportMemoryAllocateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_external_memory_win32
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV: {
+            transform_fromhost_VkImportMemoryWin32HandleInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkImportMemoryWin32HandleInfoNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV: {
+            transform_fromhost_VkExportMemoryWin32HandleInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkExportMemoryWin32HandleInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_win32_keyed_mutex
+        case VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV: {
+            transform_fromhost_VkWin32KeyedMutexAcquireReleaseInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkWin32KeyedMutexAcquireReleaseInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_validation_flags
+        case VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT: {
+            transform_fromhost_VkValidationFlagsEXT(
+                resourceTracker, reinterpret_cast<VkValidationFlagsEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_texture_compression_astc_hdr
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_astc_decode_mode
+        case VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT: {
+            transform_fromhost_VkImageViewASTCDecodeModeEXT(
+                resourceTracker,
+                reinterpret_cast<VkImageViewASTCDecodeModeEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceASTCDecodeFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceASTCDecodeFeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_conditional_rendering
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceConditionalRenderingFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceConditionalRenderingFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT: {
+            transform_fromhost_VkCommandBufferInheritanceConditionalRenderingInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkCommandBufferInheritanceConditionalRenderingInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV: {
+            transform_fromhost_VkPipelineViewportWScalingStateCreateInfoNV(
+                resourceTracker, reinterpret_cast<VkPipelineViewportWScalingStateCreateInfoNV*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_display_control
+        case VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT: {
+            transform_fromhost_VkSwapchainCounterCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkSwapchainCounterCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_GOOGLE_display_timing
+        case VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE: {
+            transform_fromhost_VkPresentTimesInfoGOOGLE(
+                resourceTracker, reinterpret_cast<VkPresentTimesInfoGOOGLE*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NVX_multiview_per_view_attributes
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX: {
+            transform_fromhost_VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_viewport_swizzle
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV: {
+            transform_fromhost_VkPipelineViewportSwizzleStateCreateInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkPipelineViewportSwizzleStateCreateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_discard_rectangles
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT: {
+            transform_fromhost_VkPhysicalDeviceDiscardRectanglePropertiesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceDiscardRectanglePropertiesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT: {
+            transform_fromhost_VkPipelineDiscardRectangleStateCreateInfoEXT(
+                resourceTracker, reinterpret_cast<VkPipelineDiscardRectangleStateCreateInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_conservative_rasterization
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT: {
+            transform_fromhost_VkPhysicalDeviceConservativeRasterizationPropertiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceConservativeRasterizationPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT: {
+            transform_fromhost_VkPipelineRasterizationConservativeStateCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkPipelineRasterizationConservativeStateCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_depth_clip_enable
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceDepthClipEnableFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceDepthClipEnableFeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT: {
+            transform_fromhost_VkPipelineRasterizationDepthClipStateCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkPipelineRasterizationDepthClipStateCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_debug_utils
+        case VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT: {
+            transform_fromhost_VkDebugUtilsMessengerCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkDebugUtilsMessengerCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID: {
+            transform_fromhost_VkAndroidHardwareBufferUsageANDROID(
+                resourceTracker,
+                reinterpret_cast<VkAndroidHardwareBufferUsageANDROID*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID: {
+            transform_fromhost_VkAndroidHardwareBufferFormatPropertiesANDROID(
+                resourceTracker, reinterpret_cast<VkAndroidHardwareBufferFormatPropertiesANDROID*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID: {
+            transform_fromhost_VkImportAndroidHardwareBufferInfoANDROID(
+                resourceTracker,
+                reinterpret_cast<VkImportAndroidHardwareBufferInfoANDROID*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID: {
+            transform_fromhost_VkExternalFormatANDROID(
+                resourceTracker, reinterpret_cast<VkExternalFormatANDROID*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID: {
+            transform_fromhost_VkAndroidHardwareBufferFormatProperties2ANDROID(
+                resourceTracker, reinterpret_cast<VkAndroidHardwareBufferFormatProperties2ANDROID*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_inline_uniform_block
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceInlineUniformBlockFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceInlineUniformBlockFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT: {
+            transform_fromhost_VkPhysicalDeviceInlineUniformBlockPropertiesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceInlineUniformBlockPropertiesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT: {
+            transform_fromhost_VkWriteDescriptorSetInlineUniformBlockEXT(
+                resourceTracker,
+                reinterpret_cast<VkWriteDescriptorSetInlineUniformBlockEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO_EXT: {
+            transform_fromhost_VkDescriptorPoolInlineUniformBlockCreateInfoEXT(
+                resourceTracker, reinterpret_cast<VkDescriptorPoolInlineUniformBlockCreateInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_sample_locations
+        case VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT: {
+            transform_fromhost_VkSampleLocationsInfoEXT(
+                resourceTracker, reinterpret_cast<VkSampleLocationsInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT: {
+            transform_fromhost_VkRenderPassSampleLocationsBeginInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkRenderPassSampleLocationsBeginInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT: {
+            transform_fromhost_VkPipelineSampleLocationsStateCreateInfoEXT(
+                resourceTracker, reinterpret_cast<VkPipelineSampleLocationsStateCreateInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT: {
+            transform_fromhost_VkPhysicalDeviceSampleLocationsPropertiesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceSampleLocationsPropertiesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_blend_operation_advanced
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT: {
+            transform_fromhost_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT: {
+            transform_fromhost_VkPipelineColorBlendAdvancedStateCreateInfoEXT(
+                resourceTracker, reinterpret_cast<VkPipelineColorBlendAdvancedStateCreateInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_fragment_coverage_to_color
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV: {
+            transform_fromhost_VkPipelineCoverageToColorStateCreateInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkPipelineCoverageToColorStateCreateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_framebuffer_mixed_samples
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV: {
+            transform_fromhost_VkPipelineCoverageModulationStateCreateInfoNV(
+                resourceTracker, reinterpret_cast<VkPipelineCoverageModulationStateCreateInfoNV*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_shader_sm_builtins
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV: {
+            transform_fromhost_VkPhysicalDeviceShaderSMBuiltinsPropertiesNV(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceShaderSMBuiltinsPropertiesNV*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV: {
+            transform_fromhost_VkPhysicalDeviceShaderSMBuiltinsFeaturesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShaderSMBuiltinsFeaturesNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+        case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT: {
+            transform_fromhost_VkDrmFormatModifierPropertiesListEXT(
+                resourceTracker,
+                reinterpret_cast<VkDrmFormatModifierPropertiesListEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT: {
+            transform_fromhost_VkPhysicalDeviceImageDrmFormatModifierInfoEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceImageDrmFormatModifierInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT: {
+            transform_fromhost_VkImageDrmFormatModifierListCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkImageDrmFormatModifierListCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT: {
+            transform_fromhost_VkImageDrmFormatModifierExplicitCreateInfoEXT(
+                resourceTracker, reinterpret_cast<VkImageDrmFormatModifierExplicitCreateInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT: {
+            transform_fromhost_VkDrmFormatModifierPropertiesList2EXT(
+                resourceTracker,
+                reinterpret_cast<VkDrmFormatModifierPropertiesList2EXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_validation_cache
+        case VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT: {
+            transform_fromhost_VkShaderModuleValidationCacheCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkShaderModuleValidationCacheCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_shading_rate_image
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV: {
+            transform_fromhost_VkPipelineViewportShadingRateImageStateCreateInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkPipelineViewportShadingRateImageStateCreateInfoNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV: {
+            transform_fromhost_VkPhysicalDeviceShadingRateImageFeaturesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShadingRateImageFeaturesNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV: {
+            transform_fromhost_VkPhysicalDeviceShadingRateImagePropertiesNV(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceShadingRateImagePropertiesNV*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV: {
+            transform_fromhost_VkPipelineViewportCoarseSampleOrderStateCreateInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkPipelineViewportCoarseSampleOrderStateCreateInfoNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_ray_tracing
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV: {
+            transform_fromhost_VkWriteDescriptorSetAccelerationStructureNV(
+                resourceTracker, reinterpret_cast<VkWriteDescriptorSetAccelerationStructureNV*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV: {
+            transform_fromhost_VkPhysicalDeviceRayTracingPropertiesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceRayTracingPropertiesNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_representative_fragment_test
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV: {
+            transform_fromhost_VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV: {
+            transform_fromhost_VkPipelineRepresentativeFragmentTestStateCreateInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkPipelineRepresentativeFragmentTestStateCreateInfoNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_filter_cubic
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT: {
+            transform_fromhost_VkPhysicalDeviceImageViewImageFormatInfoEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceImageViewImageFormatInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT: {
+            transform_fromhost_VkFilterCubicImageViewImageFormatPropertiesEXT(
+                resourceTracker, reinterpret_cast<VkFilterCubicImageViewImageFormatPropertiesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_global_priority
+        case VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT: {
+            transform_fromhost_VkDeviceQueueGlobalPriorityCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkDeviceQueueGlobalPriorityCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_external_memory_host
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT: {
+            transform_fromhost_VkImportMemoryHostPointerInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkImportMemoryHostPointerInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT: {
+            transform_fromhost_VkPhysicalDeviceExternalMemoryHostPropertiesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceExternalMemoryHostPropertiesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_pipeline_compiler_control
+        case VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD: {
+            transform_fromhost_VkPipelineCompilerControlCreateInfoAMD(
+                resourceTracker,
+                reinterpret_cast<VkPipelineCompilerControlCreateInfoAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_shader_core_properties
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD: {
+            transform_fromhost_VkPhysicalDeviceShaderCorePropertiesAMD(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShaderCorePropertiesAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_video_decode_h265
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_EXT: {
+            transform_fromhost_VkVideoDecodeH265ProfileEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoDecodeH265ProfileEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_EXT: {
+            transform_fromhost_VkVideoDecodeH265CapabilitiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoDecodeH265CapabilitiesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_CREATE_INFO_EXT: {
+            transform_fromhost_VkVideoDecodeH265SessionCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoDecodeH265SessionCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT: {
+            transform_fromhost_VkVideoDecodeH265SessionParametersAddInfoEXT(
+                resourceTracker, reinterpret_cast<VkVideoDecodeH265SessionParametersAddInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT: {
+            transform_fromhost_VkVideoDecodeH265SessionParametersCreateInfoEXT(
+                resourceTracker, reinterpret_cast<VkVideoDecodeH265SessionParametersCreateInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PICTURE_INFO_EXT: {
+            transform_fromhost_VkVideoDecodeH265PictureInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoDecodeH265PictureInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_EXT: {
+            transform_fromhost_VkVideoDecodeH265DpbSlotInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkVideoDecodeH265DpbSlotInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_memory_overallocation_behavior
+        case VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD: {
+            transform_fromhost_VkDeviceMemoryOverallocationCreateInfoAMD(
+                resourceTracker,
+                reinterpret_cast<VkDeviceMemoryOverallocationCreateInfoAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_vertex_attribute_divisor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT: {
+            transform_fromhost_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT: {
+            transform_fromhost_VkPipelineVertexInputDivisorStateCreateInfoEXT(
+                resourceTracker, reinterpret_cast<VkPipelineVertexInputDivisorStateCreateInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_GGP_frame_token
+        case VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP: {
+            transform_fromhost_VkPresentFrameTokenGGP(
+                resourceTracker, reinterpret_cast<VkPresentFrameTokenGGP*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_pipeline_creation_feedback
+        case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT: {
+            transform_fromhost_VkPipelineCreationFeedbackCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkPipelineCreationFeedbackCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_compute_shader_derivatives
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV: {
+            transform_fromhost_VkPhysicalDeviceComputeShaderDerivativesFeaturesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceComputeShaderDerivativesFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_mesh_shader
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV: {
+            transform_fromhost_VkPhysicalDeviceMeshShaderFeaturesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceMeshShaderFeaturesNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV: {
+            transform_fromhost_VkPhysicalDeviceMeshShaderPropertiesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceMeshShaderPropertiesNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_fragment_shader_barycentric
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV: {
+            transform_fromhost_VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_shader_image_footprint
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV: {
+            transform_fromhost_VkPhysicalDeviceShaderImageFootprintFeaturesNV(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceShaderImageFootprintFeaturesNV*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_scissor_exclusive
+        case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV: {
+            transform_fromhost_VkPipelineViewportExclusiveScissorStateCreateInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkPipelineViewportExclusiveScissorStateCreateInfoNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV: {
+            transform_fromhost_VkPhysicalDeviceExclusiveScissorFeaturesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceExclusiveScissorFeaturesNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV: {
+            transform_fromhost_VkQueueFamilyCheckpointPropertiesNV(
+                resourceTracker,
+                reinterpret_cast<VkQueueFamilyCheckpointPropertiesNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_INTEL_shader_integer_functions2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL: {
+            transform_fromhost_VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_INTEL_performance_query
+        case VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL: {
+            transform_fromhost_VkQueryPoolPerformanceQueryCreateInfoINTEL(
+                resourceTracker,
+                reinterpret_cast<VkQueryPoolPerformanceQueryCreateInfoINTEL*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_pci_bus_info
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT: {
+            transform_fromhost_VkPhysicalDevicePCIBusInfoPropertiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDevicePCIBusInfoPropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_display_native_hdr
+        case VK_STRUCTURE_TYPE_DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD: {
+            transform_fromhost_VkDisplayNativeHdrSurfaceCapabilitiesAMD(
+                resourceTracker,
+                reinterpret_cast<VkDisplayNativeHdrSurfaceCapabilitiesAMD*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD: {
+            transform_fromhost_VkSwapchainDisplayNativeHdrCreateInfoAMD(
+                resourceTracker,
+                reinterpret_cast<VkSwapchainDisplayNativeHdrCreateInfoAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_fragment_density_map
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceFragmentDensityMapFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT: {
+            transform_fromhost_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceFragmentDensityMapPropertiesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT: {
+            transform_fromhost_VkRenderPassFragmentDensityMapCreateInfoEXT(
+                resourceTracker, reinterpret_cast<VkRenderPassFragmentDensityMapCreateInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_subgroup_size_control
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceSubgroupSizeControlFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceSubgroupSizeControlFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT: {
+            transform_fromhost_VkPhysicalDeviceSubgroupSizeControlPropertiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceSubgroupSizeControlPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT: {
+            transform_fromhost_VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_shader_core_properties2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD: {
+            transform_fromhost_VkPhysicalDeviceShaderCoreProperties2AMD(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShaderCoreProperties2AMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_AMD_device_coherent_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD: {
+            transform_fromhost_VkPhysicalDeviceCoherentMemoryFeaturesAMD(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceCoherentMemoryFeaturesAMD*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_image_atomic_int64
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_memory_budget
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT: {
+            transform_fromhost_VkPhysicalDeviceMemoryBudgetPropertiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceMemoryBudgetPropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_memory_priority
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceMemoryPriorityFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceMemoryPriorityFeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT: {
+            transform_fromhost_VkMemoryPriorityAllocateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkMemoryPriorityAllocateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_dedicated_allocation_image_aliasing
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV: {
+            transform_fromhost_VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_buffer_device_address
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceBufferDeviceAddressFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT: {
+            transform_fromhost_VkBufferDeviceAddressCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkBufferDeviceAddressCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_validation_features
+        case VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT: {
+            transform_fromhost_VkValidationFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkValidationFeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_cooperative_matrix
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV: {
+            transform_fromhost_VkPhysicalDeviceCooperativeMatrixFeaturesNV(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceCooperativeMatrixFeaturesNV*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV: {
+            transform_fromhost_VkPhysicalDeviceCooperativeMatrixPropertiesNV(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceCooperativeMatrixPropertiesNV*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV: {
+            transform_fromhost_VkPhysicalDeviceCoverageReductionModeFeaturesNV(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceCoverageReductionModeFeaturesNV*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV: {
+            transform_fromhost_VkPipelineCoverageReductionStateCreateInfoNV(
+                resourceTracker, reinterpret_cast<VkPipelineCoverageReductionStateCreateInfoNV*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_fragment_shader_interlock
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_ycbcr_image_arrays
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceYcbcrImageArraysFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceYcbcrImageArraysFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_provoking_vertex
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceProvokingVertexFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceProvokingVertexFeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT: {
+            transform_fromhost_VkPhysicalDeviceProvokingVertexPropertiesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceProvokingVertexPropertiesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT: {
+            transform_fromhost_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkPipelineRasterizationProvokingVertexStateCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+        case VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT: {
+            transform_fromhost_VkSurfaceFullScreenExclusiveInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkSurfaceFullScreenExclusiveInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT: {
+            transform_fromhost_VkSurfaceCapabilitiesFullScreenExclusiveEXT(
+                resourceTracker, reinterpret_cast<VkSurfaceCapabilitiesFullScreenExclusiveEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT: {
+            transform_fromhost_VkSurfaceFullScreenExclusiveWin32InfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkSurfaceFullScreenExclusiveWin32InfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_line_rasterization
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceLineRasterizationFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceLineRasterizationFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT: {
+            transform_fromhost_VkPhysicalDeviceLineRasterizationPropertiesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceLineRasterizationPropertiesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT: {
+            transform_fromhost_VkPipelineRasterizationLineStateCreateInfoEXT(
+                resourceTracker, reinterpret_cast<VkPipelineRasterizationLineStateCreateInfoEXT*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_atomic_float
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceShaderAtomicFloatFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceShaderAtomicFloatFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_index_type_uint8
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceIndexTypeUint8FeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceIndexTypeUint8FeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceExtendedDynamicStateFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceExtendedDynamicStateFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_atomic_float2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_shader_demote_to_helper_invocation
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_device_generated_commands
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV: {
+            transform_fromhost_VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV: {
+            transform_fromhost_VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV: {
+            transform_fromhost_VkGraphicsPipelineShaderGroupsCreateInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkGraphicsPipelineShaderGroupsCreateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_inherited_viewport_scissor
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV: {
+            transform_fromhost_VkPhysicalDeviceInheritedViewportScissorFeaturesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceInheritedViewportScissorFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV: {
+            transform_fromhost_VkCommandBufferInheritanceViewportScissorInfoNV(
+                resourceTracker, reinterpret_cast<VkCommandBufferInheritanceViewportScissorInfoNV*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_texel_buffer_alignment
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT: {
+            transform_fromhost_VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_QCOM_render_pass_transform
+        case VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM: {
+            transform_fromhost_VkRenderPassTransformBeginInfoQCOM(
+                resourceTracker,
+                reinterpret_cast<VkRenderPassTransformBeginInfoQCOM*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM: {
+            transform_fromhost_VkCommandBufferInheritanceRenderPassTransformInfoQCOM(
+                resourceTracker,
+                reinterpret_cast<VkCommandBufferInheritanceRenderPassTransformInfoQCOM*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_device_memory_report
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceDeviceMemoryReportFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceDeviceMemoryReportFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT: {
+            transform_fromhost_VkDeviceDeviceMemoryReportCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkDeviceDeviceMemoryReportCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_robustness2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceRobustness2FeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceRobustness2FeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT: {
+            transform_fromhost_VkPhysicalDeviceRobustness2PropertiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceRobustness2PropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_custom_border_color
+        case VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT: {
+            transform_fromhost_VkSamplerCustomBorderColorCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkSamplerCustomBorderColorCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT: {
+            transform_fromhost_VkPhysicalDeviceCustomBorderColorPropertiesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceCustomBorderColorPropertiesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceCustomBorderColorFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceCustomBorderColorFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_private_data
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDevicePrivateDataFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDevicePrivateDataFeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO_EXT: {
+            transform_fromhost_VkDevicePrivateDataCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkDevicePrivateDataCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_pipeline_creation_cache_control
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_device_diagnostics_config
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV: {
+            transform_fromhost_VkPhysicalDeviceDiagnosticsConfigFeaturesNV(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceDiagnosticsConfigFeaturesNV*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV: {
+            transform_fromhost_VkDeviceDiagnosticsConfigCreateInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkDeviceDiagnosticsConfigCreateInfoNV*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV: {
+            transform_fromhost_VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV: {
+            transform_fromhost_VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV: {
+            transform_fromhost_VkPipelineFragmentShadingRateEnumStateCreateInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkPipelineFragmentShadingRateEnumStateCreateInfoNV*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_ray_tracing_motion_blur
+        case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV: {
+            transform_fromhost_VkAccelerationStructureGeometryMotionTrianglesDataNV(
+                resourceTracker,
+                reinterpret_cast<VkAccelerationStructureGeometryMotionTrianglesDataNV*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV: {
+            transform_fromhost_VkAccelerationStructureMotionInfoNV(
+                resourceTracker,
+                reinterpret_cast<VkAccelerationStructureMotionInfoNV*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV: {
+            transform_fromhost_VkPhysicalDeviceRayTracingMotionBlurFeaturesNV(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceRayTracingMotionBlurFeaturesNV*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_ycbcr_2plane_444_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_fragment_density_map2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceFragmentDensityMap2FeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceFragmentDensityMap2FeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT: {
+            transform_fromhost_VkPhysicalDeviceFragmentDensityMap2PropertiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceFragmentDensityMap2PropertiesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_QCOM_rotated_copy_commands
+        case VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM: {
+            transform_fromhost_VkCopyCommandTransformInfoQCOM(
+                resourceTracker,
+                reinterpret_cast<VkCopyCommandTransformInfoQCOM*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_image_robustness
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceImageRobustnessFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceImageRobustnessFeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_4444_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDevice4444FormatsFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDevice4444FormatsFeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_rgba10x6_formats
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_VALVE_mutable_descriptor_type
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE: {
+            transform_fromhost_VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE: {
+            transform_fromhost_VkMutableDescriptorTypeCreateInfoVALVE(
+                resourceTracker,
+                reinterpret_cast<VkMutableDescriptorTypeCreateInfoVALVE*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_physical_device_drm
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT: {
+            transform_fromhost_VkPhysicalDeviceDrmPropertiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceDrmPropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_primitive_topology_list_restart
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_FUCHSIA_external_memory
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA: {
+            transform_fromhost_VkImportMemoryZirconHandleInfoFUCHSIA(
+                resourceTracker,
+                reinterpret_cast<VkImportMemoryZirconHandleInfoFUCHSIA*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+        case VK_STRUCTURE_TYPE_IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA: {
+            transform_fromhost_VkImportMemoryBufferCollectionFUCHSIA(
+                resourceTracker,
+                reinterpret_cast<VkImportMemoryBufferCollectionFUCHSIA*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA: {
+            transform_fromhost_VkBufferCollectionImageCreateInfoFUCHSIA(
+                resourceTracker,
+                reinterpret_cast<VkBufferCollectionImageCreateInfoFUCHSIA*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA: {
+            transform_fromhost_VkBufferCollectionBufferCreateInfoFUCHSIA(
+                resourceTracker,
+                reinterpret_cast<VkBufferCollectionBufferCreateInfoFUCHSIA*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+        case VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI: {
+            transform_fromhost_VkSubpassShadingPipelineCreateInfoHUAWEI(
+                resourceTracker,
+                reinterpret_cast<VkSubpassShadingPipelineCreateInfoHUAWEI*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI: {
+            transform_fromhost_VkPhysicalDeviceSubpassShadingFeaturesHUAWEI(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceSubpassShadingFeaturesHUAWEI*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI: {
+            transform_fromhost_VkPhysicalDeviceSubpassShadingPropertiesHUAWEI(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceSubpassShadingPropertiesHUAWEI*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI: {
+            transform_fromhost_VkPhysicalDeviceInvocationMaskFeaturesHUAWEI(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceInvocationMaskFeaturesHUAWEI*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_NV_external_memory_rdma
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_RDMA_FEATURES_NV: {
+            transform_fromhost_VkPhysicalDeviceExternalMemoryRDMAFeaturesNV(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceExternalMemoryRDMAFeaturesNV*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceExtendedDynamicState2FeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceExtendedDynamicState2FeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_color_write_enable
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceColorWriteEnableFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceColorWriteEnableFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT: {
+            transform_fromhost_VkPipelineColorWriteCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkPipelineColorWriteCreateInfoEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_GOOGLE_gfxstream
+        case VK_STRUCTURE_TYPE_IMPORT_COLOR_BUFFER_GOOGLE: {
+            transform_fromhost_VkImportColorBufferGOOGLE(
+                resourceTracker, reinterpret_cast<VkImportColorBufferGOOGLE*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_IMPORT_BUFFER_GOOGLE: {
+            transform_fromhost_VkImportBufferGOOGLE(
+                resourceTracker, reinterpret_cast<VkImportBufferGOOGLE*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_CREATE_BLOB_GOOGLE: {
+            transform_fromhost_VkCreateBlobGOOGLE(
+                resourceTracker, reinterpret_cast<VkCreateBlobGOOGLE*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_global_priority_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_EXT: {
+            transform_fromhost_VkQueueFamilyGlobalPriorityPropertiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkQueueFamilyGlobalPriorityPropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_multi_draw
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceMultiDrawFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceMultiDrawFeaturesEXT*>(structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT: {
+            transform_fromhost_VkPhysicalDeviceMultiDrawPropertiesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceMultiDrawPropertiesEXT*>(structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_border_color_swizzle
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDeviceBorderColorSwizzleFeaturesEXT(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceBorderColorSwizzleFeaturesEXT*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT: {
+            transform_fromhost_VkSamplerBorderColorComponentMappingCreateInfoEXT(
+                resourceTracker,
+                reinterpret_cast<VkSamplerBorderColorComponentMappingCreateInfoEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT: {
+            transform_fromhost_VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_acceleration_structure
+        case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR: {
+            transform_fromhost_VkWriteDescriptorSetAccelerationStructureKHR(
+                resourceTracker, reinterpret_cast<VkWriteDescriptorSetAccelerationStructureKHR*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR: {
+            transform_fromhost_VkPhysicalDeviceAccelerationStructureFeaturesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceAccelerationStructureFeaturesKHR*>(
+                    structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR: {
+            transform_fromhost_VkPhysicalDeviceAccelerationStructurePropertiesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceAccelerationStructurePropertiesKHR*>(
+                    structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR: {
+            transform_fromhost_VkPhysicalDeviceRayTracingPipelineFeaturesKHR(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceRayTracingPipelineFeaturesKHR*>(
+                                     structExtension_out));
+            break;
+        }
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR: {
+            transform_fromhost_VkPhysicalDeviceRayTracingPipelinePropertiesKHR(
+                resourceTracker, reinterpret_cast<VkPhysicalDeviceRayTracingPipelinePropertiesKHR*>(
+                                     structExtension_out));
+            break;
+        }
+#endif
+#ifdef VK_KHR_ray_query
+        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR: {
+            transform_fromhost_VkPhysicalDeviceRayQueryFeaturesKHR(
+                resourceTracker,
+                reinterpret_cast<VkPhysicalDeviceRayQueryFeaturesKHR*>(structExtension_out));
+            break;
+        }
+#endif
+        default: {
+            return;
+        }
+    }
+}
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/goldfish_vk_transform_guest.h b/system/vulkan_enc/goldfish_vk_transform_guest.h
new file mode 100644
index 0000000..1ac957d
--- /dev/null
+++ b/system/vulkan_enc/goldfish_vk_transform_guest.h
@@ -0,0 +1,5814 @@
+// Copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2018 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Autogenerated module goldfish_vk_transform_guest
+//
+// (header) generated by codegen/vulkan/scripts/genvk.py -registry codegen/vulkan/xml/vk.xml cereal
+// -o host/vulkan/cereal
+//
+// Please do not modify directly;
+// re-run gfxstream-protocols/scripts/generate-vulkan-sources.sh,
+// or directly from Python by defining:
+// VULKAN_REGISTRY_XML_DIR : Directory containing vk.xml
+// VULKAN_REGISTRY_SCRIPTS_DIR : Directory containing genvk.py
+// CEREAL_OUTPUT_DIR: Where to put the generated sources.
+//
+// python3 $VULKAN_REGISTRY_SCRIPTS_DIR/genvk.py -registry $VULKAN_REGISTRY_XML_DIR/vk.xml cereal -o
+// $CEREAL_OUTPUT_DIR
+//
+#pragma once
+#include <vulkan/vulkan.h>
+
+#include "goldfish_vk_private_defs.h"
+#include "vk_platform_compat.h"
+#include "vulkan_gfxstream.h"
+
+namespace gfxstream {
+namespace vk {
+
+class ResourceTracker;
+#define LIST_TRIVIAL_TRANSFORMED_TYPES(f)      \
+    f(VkPhysicalDeviceExternalImageFormatInfo) \
+    f(VkPhysicalDeviceExternalBufferInfo)      \
+    f(VkExternalMemoryImageCreateInfo)         \
+    f(VkExternalMemoryBufferCreateInfo)        \
+    f(VkExportMemoryAllocateInfo)              \
+    f(VkExternalImageFormatProperties)         \
+    f(VkExternalBufferProperties)
+
+#define LIST_NON_TRIVIAL_TRANSFORMED_TYPES(f) \
+    f(VkExternalMemoryProperties)             \
+    f(VkImageCreateInfo)
+
+#define LIST_TRANSFORMED_TYPES(f)     \
+    LIST_TRIVIAL_TRANSFORMED_TYPES(f) \
+    LIST_NON_TRIVIAL_TRANSFORMED_TYPES(f)
+
+#ifdef VK_VERSION_1_0
+void transform_tohost_VkExtent2D(ResourceTracker* resourceTracker, VkExtent2D* toTransform);
+
+void transform_fromhost_VkExtent2D(ResourceTracker* resourceTracker, VkExtent2D* toTransform);
+
+void transform_tohost_VkExtent3D(ResourceTracker* resourceTracker, VkExtent3D* toTransform);
+
+void transform_fromhost_VkExtent3D(ResourceTracker* resourceTracker, VkExtent3D* toTransform);
+
+void transform_tohost_VkOffset2D(ResourceTracker* resourceTracker, VkOffset2D* toTransform);
+
+void transform_fromhost_VkOffset2D(ResourceTracker* resourceTracker, VkOffset2D* toTransform);
+
+void transform_tohost_VkOffset3D(ResourceTracker* resourceTracker, VkOffset3D* toTransform);
+
+void transform_fromhost_VkOffset3D(ResourceTracker* resourceTracker, VkOffset3D* toTransform);
+
+void transform_tohost_VkRect2D(ResourceTracker* resourceTracker, VkRect2D* toTransform);
+
+void transform_fromhost_VkRect2D(ResourceTracker* resourceTracker, VkRect2D* toTransform);
+
+void transform_tohost_VkBaseInStructure(ResourceTracker* resourceTracker,
+                                        VkBaseInStructure* toTransform);
+
+void transform_fromhost_VkBaseInStructure(ResourceTracker* resourceTracker,
+                                          VkBaseInStructure* toTransform);
+
+void transform_tohost_VkBaseOutStructure(ResourceTracker* resourceTracker,
+                                         VkBaseOutStructure* toTransform);
+
+void transform_fromhost_VkBaseOutStructure(ResourceTracker* resourceTracker,
+                                           VkBaseOutStructure* toTransform);
+
+void transform_tohost_VkBufferMemoryBarrier(ResourceTracker* resourceTracker,
+                                            VkBufferMemoryBarrier* toTransform);
+
+void transform_fromhost_VkBufferMemoryBarrier(ResourceTracker* resourceTracker,
+                                              VkBufferMemoryBarrier* toTransform);
+
+void transform_tohost_VkDispatchIndirectCommand(ResourceTracker* resourceTracker,
+                                                VkDispatchIndirectCommand* toTransform);
+
+void transform_fromhost_VkDispatchIndirectCommand(ResourceTracker* resourceTracker,
+                                                  VkDispatchIndirectCommand* toTransform);
+
+void transform_tohost_VkDrawIndexedIndirectCommand(ResourceTracker* resourceTracker,
+                                                   VkDrawIndexedIndirectCommand* toTransform);
+
+void transform_fromhost_VkDrawIndexedIndirectCommand(ResourceTracker* resourceTracker,
+                                                     VkDrawIndexedIndirectCommand* toTransform);
+
+void transform_tohost_VkDrawIndirectCommand(ResourceTracker* resourceTracker,
+                                            VkDrawIndirectCommand* toTransform);
+
+void transform_fromhost_VkDrawIndirectCommand(ResourceTracker* resourceTracker,
+                                              VkDrawIndirectCommand* toTransform);
+
+void transform_tohost_VkImageSubresourceRange(ResourceTracker* resourceTracker,
+                                              VkImageSubresourceRange* toTransform);
+
+void transform_fromhost_VkImageSubresourceRange(ResourceTracker* resourceTracker,
+                                                VkImageSubresourceRange* toTransform);
+
+void transform_tohost_VkImageMemoryBarrier(ResourceTracker* resourceTracker,
+                                           VkImageMemoryBarrier* toTransform);
+
+void transform_fromhost_VkImageMemoryBarrier(ResourceTracker* resourceTracker,
+                                             VkImageMemoryBarrier* toTransform);
+
+void transform_tohost_VkMemoryBarrier(ResourceTracker* resourceTracker,
+                                      VkMemoryBarrier* toTransform);
+
+void transform_fromhost_VkMemoryBarrier(ResourceTracker* resourceTracker,
+                                        VkMemoryBarrier* toTransform);
+
+void transform_tohost_VkPipelineCacheHeaderVersionOne(ResourceTracker* resourceTracker,
+                                                      VkPipelineCacheHeaderVersionOne* toTransform);
+
+void transform_fromhost_VkPipelineCacheHeaderVersionOne(
+    ResourceTracker* resourceTracker, VkPipelineCacheHeaderVersionOne* toTransform);
+
+void transform_tohost_VkAllocationCallbacks(ResourceTracker* resourceTracker,
+                                            VkAllocationCallbacks* toTransform);
+
+void transform_fromhost_VkAllocationCallbacks(ResourceTracker* resourceTracker,
+                                              VkAllocationCallbacks* toTransform);
+
+void transform_tohost_VkApplicationInfo(ResourceTracker* resourceTracker,
+                                        VkApplicationInfo* toTransform);
+
+void transform_fromhost_VkApplicationInfo(ResourceTracker* resourceTracker,
+                                          VkApplicationInfo* toTransform);
+
+void transform_tohost_VkFormatProperties(ResourceTracker* resourceTracker,
+                                         VkFormatProperties* toTransform);
+
+void transform_fromhost_VkFormatProperties(ResourceTracker* resourceTracker,
+                                           VkFormatProperties* toTransform);
+
+void transform_tohost_VkImageFormatProperties(ResourceTracker* resourceTracker,
+                                              VkImageFormatProperties* toTransform);
+
+void transform_fromhost_VkImageFormatProperties(ResourceTracker* resourceTracker,
+                                                VkImageFormatProperties* toTransform);
+
+void transform_tohost_VkInstanceCreateInfo(ResourceTracker* resourceTracker,
+                                           VkInstanceCreateInfo* toTransform);
+
+void transform_fromhost_VkInstanceCreateInfo(ResourceTracker* resourceTracker,
+                                             VkInstanceCreateInfo* toTransform);
+
+void transform_tohost_VkMemoryHeap(ResourceTracker* resourceTracker, VkMemoryHeap* toTransform);
+
+void transform_fromhost_VkMemoryHeap(ResourceTracker* resourceTracker, VkMemoryHeap* toTransform);
+
+void transform_tohost_VkMemoryType(ResourceTracker* resourceTracker, VkMemoryType* toTransform);
+
+void transform_fromhost_VkMemoryType(ResourceTracker* resourceTracker, VkMemoryType* toTransform);
+
+void transform_tohost_VkPhysicalDeviceFeatures(ResourceTracker* resourceTracker,
+                                               VkPhysicalDeviceFeatures* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceFeatures(ResourceTracker* resourceTracker,
+                                                 VkPhysicalDeviceFeatures* toTransform);
+
+void transform_tohost_VkPhysicalDeviceLimits(ResourceTracker* resourceTracker,
+                                             VkPhysicalDeviceLimits* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceLimits(ResourceTracker* resourceTracker,
+                                               VkPhysicalDeviceLimits* toTransform);
+
+void transform_tohost_VkPhysicalDeviceMemoryProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMemoryProperties* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceMemoryProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMemoryProperties* toTransform);
+
+void transform_tohost_VkPhysicalDeviceSparseProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSparseProperties* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceSparseProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSparseProperties* toTransform);
+
+void transform_tohost_VkPhysicalDeviceProperties(ResourceTracker* resourceTracker,
+                                                 VkPhysicalDeviceProperties* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceProperties(ResourceTracker* resourceTracker,
+                                                   VkPhysicalDeviceProperties* toTransform);
+
+void transform_tohost_VkQueueFamilyProperties(ResourceTracker* resourceTracker,
+                                              VkQueueFamilyProperties* toTransform);
+
+void transform_fromhost_VkQueueFamilyProperties(ResourceTracker* resourceTracker,
+                                                VkQueueFamilyProperties* toTransform);
+
+void transform_tohost_VkDeviceQueueCreateInfo(ResourceTracker* resourceTracker,
+                                              VkDeviceQueueCreateInfo* toTransform);
+
+void transform_fromhost_VkDeviceQueueCreateInfo(ResourceTracker* resourceTracker,
+                                                VkDeviceQueueCreateInfo* toTransform);
+
+void transform_tohost_VkDeviceCreateInfo(ResourceTracker* resourceTracker,
+                                         VkDeviceCreateInfo* toTransform);
+
+void transform_fromhost_VkDeviceCreateInfo(ResourceTracker* resourceTracker,
+                                           VkDeviceCreateInfo* toTransform);
+
+void transform_tohost_VkExtensionProperties(ResourceTracker* resourceTracker,
+                                            VkExtensionProperties* toTransform);
+
+void transform_fromhost_VkExtensionProperties(ResourceTracker* resourceTracker,
+                                              VkExtensionProperties* toTransform);
+
+void transform_tohost_VkLayerProperties(ResourceTracker* resourceTracker,
+                                        VkLayerProperties* toTransform);
+
+void transform_fromhost_VkLayerProperties(ResourceTracker* resourceTracker,
+                                          VkLayerProperties* toTransform);
+
+void transform_tohost_VkSubmitInfo(ResourceTracker* resourceTracker, VkSubmitInfo* toTransform);
+
+void transform_fromhost_VkSubmitInfo(ResourceTracker* resourceTracker, VkSubmitInfo* toTransform);
+
+void transform_tohost_VkMappedMemoryRange(ResourceTracker* resourceTracker,
+                                          VkMappedMemoryRange* toTransform);
+
+void transform_fromhost_VkMappedMemoryRange(ResourceTracker* resourceTracker,
+                                            VkMappedMemoryRange* toTransform);
+
+void transform_tohost_VkMemoryAllocateInfo(ResourceTracker* resourceTracker,
+                                           VkMemoryAllocateInfo* toTransform);
+
+void transform_fromhost_VkMemoryAllocateInfo(ResourceTracker* resourceTracker,
+                                             VkMemoryAllocateInfo* toTransform);
+
+void transform_tohost_VkMemoryRequirements(ResourceTracker* resourceTracker,
+                                           VkMemoryRequirements* toTransform);
+
+void transform_fromhost_VkMemoryRequirements(ResourceTracker* resourceTracker,
+                                             VkMemoryRequirements* toTransform);
+
+void transform_tohost_VkSparseMemoryBind(ResourceTracker* resourceTracker,
+                                         VkSparseMemoryBind* toTransform);
+
+void transform_fromhost_VkSparseMemoryBind(ResourceTracker* resourceTracker,
+                                           VkSparseMemoryBind* toTransform);
+
+void transform_tohost_VkSparseBufferMemoryBindInfo(ResourceTracker* resourceTracker,
+                                                   VkSparseBufferMemoryBindInfo* toTransform);
+
+void transform_fromhost_VkSparseBufferMemoryBindInfo(ResourceTracker* resourceTracker,
+                                                     VkSparseBufferMemoryBindInfo* toTransform);
+
+void transform_tohost_VkSparseImageOpaqueMemoryBindInfo(
+    ResourceTracker* resourceTracker, VkSparseImageOpaqueMemoryBindInfo* toTransform);
+
+void transform_fromhost_VkSparseImageOpaqueMemoryBindInfo(
+    ResourceTracker* resourceTracker, VkSparseImageOpaqueMemoryBindInfo* toTransform);
+
+void transform_tohost_VkImageSubresource(ResourceTracker* resourceTracker,
+                                         VkImageSubresource* toTransform);
+
+void transform_fromhost_VkImageSubresource(ResourceTracker* resourceTracker,
+                                           VkImageSubresource* toTransform);
+
+void transform_tohost_VkSparseImageMemoryBind(ResourceTracker* resourceTracker,
+                                              VkSparseImageMemoryBind* toTransform);
+
+void transform_fromhost_VkSparseImageMemoryBind(ResourceTracker* resourceTracker,
+                                                VkSparseImageMemoryBind* toTransform);
+
+void transform_tohost_VkSparseImageMemoryBindInfo(ResourceTracker* resourceTracker,
+                                                  VkSparseImageMemoryBindInfo* toTransform);
+
+void transform_fromhost_VkSparseImageMemoryBindInfo(ResourceTracker* resourceTracker,
+                                                    VkSparseImageMemoryBindInfo* toTransform);
+
+void transform_tohost_VkBindSparseInfo(ResourceTracker* resourceTracker,
+                                       VkBindSparseInfo* toTransform);
+
+void transform_fromhost_VkBindSparseInfo(ResourceTracker* resourceTracker,
+                                         VkBindSparseInfo* toTransform);
+
+void transform_tohost_VkSparseImageFormatProperties(ResourceTracker* resourceTracker,
+                                                    VkSparseImageFormatProperties* toTransform);
+
+void transform_fromhost_VkSparseImageFormatProperties(ResourceTracker* resourceTracker,
+                                                      VkSparseImageFormatProperties* toTransform);
+
+void transform_tohost_VkSparseImageMemoryRequirements(ResourceTracker* resourceTracker,
+                                                      VkSparseImageMemoryRequirements* toTransform);
+
+void transform_fromhost_VkSparseImageMemoryRequirements(
+    ResourceTracker* resourceTracker, VkSparseImageMemoryRequirements* toTransform);
+
+void transform_tohost_VkFenceCreateInfo(ResourceTracker* resourceTracker,
+                                        VkFenceCreateInfo* toTransform);
+
+void transform_fromhost_VkFenceCreateInfo(ResourceTracker* resourceTracker,
+                                          VkFenceCreateInfo* toTransform);
+
+void transform_tohost_VkSemaphoreCreateInfo(ResourceTracker* resourceTracker,
+                                            VkSemaphoreCreateInfo* toTransform);
+
+void transform_fromhost_VkSemaphoreCreateInfo(ResourceTracker* resourceTracker,
+                                              VkSemaphoreCreateInfo* toTransform);
+
+void transform_tohost_VkEventCreateInfo(ResourceTracker* resourceTracker,
+                                        VkEventCreateInfo* toTransform);
+
+void transform_fromhost_VkEventCreateInfo(ResourceTracker* resourceTracker,
+                                          VkEventCreateInfo* toTransform);
+
+void transform_tohost_VkQueryPoolCreateInfo(ResourceTracker* resourceTracker,
+                                            VkQueryPoolCreateInfo* toTransform);
+
+void transform_fromhost_VkQueryPoolCreateInfo(ResourceTracker* resourceTracker,
+                                              VkQueryPoolCreateInfo* toTransform);
+
+void transform_tohost_VkBufferCreateInfo(ResourceTracker* resourceTracker,
+                                         VkBufferCreateInfo* toTransform);
+
+void transform_fromhost_VkBufferCreateInfo(ResourceTracker* resourceTracker,
+                                           VkBufferCreateInfo* toTransform);
+
+void transform_tohost_VkBufferViewCreateInfo(ResourceTracker* resourceTracker,
+                                             VkBufferViewCreateInfo* toTransform);
+
+void transform_fromhost_VkBufferViewCreateInfo(ResourceTracker* resourceTracker,
+                                               VkBufferViewCreateInfo* toTransform);
+
+void transform_tohost_VkImageCreateInfo(ResourceTracker* resourceTracker,
+                                        VkImageCreateInfo* toTransform);
+
+void transform_fromhost_VkImageCreateInfo(ResourceTracker* resourceTracker,
+                                          VkImageCreateInfo* toTransform);
+
+void transform_tohost_VkSubresourceLayout(ResourceTracker* resourceTracker,
+                                          VkSubresourceLayout* toTransform);
+
+void transform_fromhost_VkSubresourceLayout(ResourceTracker* resourceTracker,
+                                            VkSubresourceLayout* toTransform);
+
+void transform_tohost_VkComponentMapping(ResourceTracker* resourceTracker,
+                                         VkComponentMapping* toTransform);
+
+void transform_fromhost_VkComponentMapping(ResourceTracker* resourceTracker,
+                                           VkComponentMapping* toTransform);
+
+void transform_tohost_VkImageViewCreateInfo(ResourceTracker* resourceTracker,
+                                            VkImageViewCreateInfo* toTransform);
+
+void transform_fromhost_VkImageViewCreateInfo(ResourceTracker* resourceTracker,
+                                              VkImageViewCreateInfo* toTransform);
+
+void transform_tohost_VkShaderModuleCreateInfo(ResourceTracker* resourceTracker,
+                                               VkShaderModuleCreateInfo* toTransform);
+
+void transform_fromhost_VkShaderModuleCreateInfo(ResourceTracker* resourceTracker,
+                                                 VkShaderModuleCreateInfo* toTransform);
+
+void transform_tohost_VkPipelineCacheCreateInfo(ResourceTracker* resourceTracker,
+                                                VkPipelineCacheCreateInfo* toTransform);
+
+void transform_fromhost_VkPipelineCacheCreateInfo(ResourceTracker* resourceTracker,
+                                                  VkPipelineCacheCreateInfo* toTransform);
+
+void transform_tohost_VkSpecializationMapEntry(ResourceTracker* resourceTracker,
+                                               VkSpecializationMapEntry* toTransform);
+
+void transform_fromhost_VkSpecializationMapEntry(ResourceTracker* resourceTracker,
+                                                 VkSpecializationMapEntry* toTransform);
+
+void transform_tohost_VkSpecializationInfo(ResourceTracker* resourceTracker,
+                                           VkSpecializationInfo* toTransform);
+
+void transform_fromhost_VkSpecializationInfo(ResourceTracker* resourceTracker,
+                                             VkSpecializationInfo* toTransform);
+
+void transform_tohost_VkPipelineShaderStageCreateInfo(ResourceTracker* resourceTracker,
+                                                      VkPipelineShaderStageCreateInfo* toTransform);
+
+void transform_fromhost_VkPipelineShaderStageCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineShaderStageCreateInfo* toTransform);
+
+void transform_tohost_VkComputePipelineCreateInfo(ResourceTracker* resourceTracker,
+                                                  VkComputePipelineCreateInfo* toTransform);
+
+void transform_fromhost_VkComputePipelineCreateInfo(ResourceTracker* resourceTracker,
+                                                    VkComputePipelineCreateInfo* toTransform);
+
+void transform_tohost_VkVertexInputBindingDescription(ResourceTracker* resourceTracker,
+                                                      VkVertexInputBindingDescription* toTransform);
+
+void transform_fromhost_VkVertexInputBindingDescription(
+    ResourceTracker* resourceTracker, VkVertexInputBindingDescription* toTransform);
+
+void transform_tohost_VkVertexInputAttributeDescription(
+    ResourceTracker* resourceTracker, VkVertexInputAttributeDescription* toTransform);
+
+void transform_fromhost_VkVertexInputAttributeDescription(
+    ResourceTracker* resourceTracker, VkVertexInputAttributeDescription* toTransform);
+
+void transform_tohost_VkPipelineVertexInputStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineVertexInputStateCreateInfo* toTransform);
+
+void transform_fromhost_VkPipelineVertexInputStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineVertexInputStateCreateInfo* toTransform);
+
+void transform_tohost_VkPipelineInputAssemblyStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineInputAssemblyStateCreateInfo* toTransform);
+
+void transform_fromhost_VkPipelineInputAssemblyStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineInputAssemblyStateCreateInfo* toTransform);
+
+void transform_tohost_VkPipelineTessellationStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineTessellationStateCreateInfo* toTransform);
+
+void transform_fromhost_VkPipelineTessellationStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineTessellationStateCreateInfo* toTransform);
+
+void transform_tohost_VkViewport(ResourceTracker* resourceTracker, VkViewport* toTransform);
+
+void transform_fromhost_VkViewport(ResourceTracker* resourceTracker, VkViewport* toTransform);
+
+void transform_tohost_VkPipelineViewportStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineViewportStateCreateInfo* toTransform);
+
+void transform_fromhost_VkPipelineViewportStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineViewportStateCreateInfo* toTransform);
+
+void transform_tohost_VkPipelineRasterizationStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineRasterizationStateCreateInfo* toTransform);
+
+void transform_fromhost_VkPipelineRasterizationStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineRasterizationStateCreateInfo* toTransform);
+
+void transform_tohost_VkPipelineMultisampleStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineMultisampleStateCreateInfo* toTransform);
+
+void transform_fromhost_VkPipelineMultisampleStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineMultisampleStateCreateInfo* toTransform);
+
+void transform_tohost_VkStencilOpState(ResourceTracker* resourceTracker,
+                                       VkStencilOpState* toTransform);
+
+void transform_fromhost_VkStencilOpState(ResourceTracker* resourceTracker,
+                                         VkStencilOpState* toTransform);
+
+void transform_tohost_VkPipelineDepthStencilStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineDepthStencilStateCreateInfo* toTransform);
+
+void transform_fromhost_VkPipelineDepthStencilStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineDepthStencilStateCreateInfo* toTransform);
+
+void transform_tohost_VkPipelineColorBlendAttachmentState(
+    ResourceTracker* resourceTracker, VkPipelineColorBlendAttachmentState* toTransform);
+
+void transform_fromhost_VkPipelineColorBlendAttachmentState(
+    ResourceTracker* resourceTracker, VkPipelineColorBlendAttachmentState* toTransform);
+
+void transform_tohost_VkPipelineColorBlendStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineColorBlendStateCreateInfo* toTransform);
+
+void transform_fromhost_VkPipelineColorBlendStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineColorBlendStateCreateInfo* toTransform);
+
+void transform_tohost_VkPipelineDynamicStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineDynamicStateCreateInfo* toTransform);
+
+void transform_fromhost_VkPipelineDynamicStateCreateInfo(
+    ResourceTracker* resourceTracker, VkPipelineDynamicStateCreateInfo* toTransform);
+
+void transform_tohost_VkGraphicsPipelineCreateInfo(ResourceTracker* resourceTracker,
+                                                   VkGraphicsPipelineCreateInfo* toTransform);
+
+void transform_fromhost_VkGraphicsPipelineCreateInfo(ResourceTracker* resourceTracker,
+                                                     VkGraphicsPipelineCreateInfo* toTransform);
+
+void transform_tohost_VkPushConstantRange(ResourceTracker* resourceTracker,
+                                          VkPushConstantRange* toTransform);
+
+void transform_fromhost_VkPushConstantRange(ResourceTracker* resourceTracker,
+                                            VkPushConstantRange* toTransform);
+
+void transform_tohost_VkPipelineLayoutCreateInfo(ResourceTracker* resourceTracker,
+                                                 VkPipelineLayoutCreateInfo* toTransform);
+
+void transform_fromhost_VkPipelineLayoutCreateInfo(ResourceTracker* resourceTracker,
+                                                   VkPipelineLayoutCreateInfo* toTransform);
+
+void transform_tohost_VkSamplerCreateInfo(ResourceTracker* resourceTracker,
+                                          VkSamplerCreateInfo* toTransform);
+
+void transform_fromhost_VkSamplerCreateInfo(ResourceTracker* resourceTracker,
+                                            VkSamplerCreateInfo* toTransform);
+
+void transform_tohost_VkCopyDescriptorSet(ResourceTracker* resourceTracker,
+                                          VkCopyDescriptorSet* toTransform);
+
+void transform_fromhost_VkCopyDescriptorSet(ResourceTracker* resourceTracker,
+                                            VkCopyDescriptorSet* toTransform);
+
+void transform_tohost_VkDescriptorBufferInfo(ResourceTracker* resourceTracker,
+                                             VkDescriptorBufferInfo* toTransform);
+
+void transform_fromhost_VkDescriptorBufferInfo(ResourceTracker* resourceTracker,
+                                               VkDescriptorBufferInfo* toTransform);
+
+void transform_tohost_VkDescriptorImageInfo(ResourceTracker* resourceTracker,
+                                            VkDescriptorImageInfo* toTransform);
+
+void transform_fromhost_VkDescriptorImageInfo(ResourceTracker* resourceTracker,
+                                              VkDescriptorImageInfo* toTransform);
+
+void transform_tohost_VkDescriptorPoolSize(ResourceTracker* resourceTracker,
+                                           VkDescriptorPoolSize* toTransform);
+
+void transform_fromhost_VkDescriptorPoolSize(ResourceTracker* resourceTracker,
+                                             VkDescriptorPoolSize* toTransform);
+
+void transform_tohost_VkDescriptorPoolCreateInfo(ResourceTracker* resourceTracker,
+                                                 VkDescriptorPoolCreateInfo* toTransform);
+
+void transform_fromhost_VkDescriptorPoolCreateInfo(ResourceTracker* resourceTracker,
+                                                   VkDescriptorPoolCreateInfo* toTransform);
+
+void transform_tohost_VkDescriptorSetAllocateInfo(ResourceTracker* resourceTracker,
+                                                  VkDescriptorSetAllocateInfo* toTransform);
+
+void transform_fromhost_VkDescriptorSetAllocateInfo(ResourceTracker* resourceTracker,
+                                                    VkDescriptorSetAllocateInfo* toTransform);
+
+void transform_tohost_VkDescriptorSetLayoutBinding(ResourceTracker* resourceTracker,
+                                                   VkDescriptorSetLayoutBinding* toTransform);
+
+void transform_fromhost_VkDescriptorSetLayoutBinding(ResourceTracker* resourceTracker,
+                                                     VkDescriptorSetLayoutBinding* toTransform);
+
+void transform_tohost_VkDescriptorSetLayoutCreateInfo(ResourceTracker* resourceTracker,
+                                                      VkDescriptorSetLayoutCreateInfo* toTransform);
+
+void transform_fromhost_VkDescriptorSetLayoutCreateInfo(
+    ResourceTracker* resourceTracker, VkDescriptorSetLayoutCreateInfo* toTransform);
+
+void transform_tohost_VkWriteDescriptorSet(ResourceTracker* resourceTracker,
+                                           VkWriteDescriptorSet* toTransform);
+
+void transform_fromhost_VkWriteDescriptorSet(ResourceTracker* resourceTracker,
+                                             VkWriteDescriptorSet* toTransform);
+
+void transform_tohost_VkAttachmentDescription(ResourceTracker* resourceTracker,
+                                              VkAttachmentDescription* toTransform);
+
+void transform_fromhost_VkAttachmentDescription(ResourceTracker* resourceTracker,
+                                                VkAttachmentDescription* toTransform);
+
+void transform_tohost_VkAttachmentReference(ResourceTracker* resourceTracker,
+                                            VkAttachmentReference* toTransform);
+
+void transform_fromhost_VkAttachmentReference(ResourceTracker* resourceTracker,
+                                              VkAttachmentReference* toTransform);
+
+void transform_tohost_VkFramebufferCreateInfo(ResourceTracker* resourceTracker,
+                                              VkFramebufferCreateInfo* toTransform);
+
+void transform_fromhost_VkFramebufferCreateInfo(ResourceTracker* resourceTracker,
+                                                VkFramebufferCreateInfo* toTransform);
+
+void transform_tohost_VkSubpassDescription(ResourceTracker* resourceTracker,
+                                           VkSubpassDescription* toTransform);
+
+void transform_fromhost_VkSubpassDescription(ResourceTracker* resourceTracker,
+                                             VkSubpassDescription* toTransform);
+
+void transform_tohost_VkSubpassDependency(ResourceTracker* resourceTracker,
+                                          VkSubpassDependency* toTransform);
+
+void transform_fromhost_VkSubpassDependency(ResourceTracker* resourceTracker,
+                                            VkSubpassDependency* toTransform);
+
+void transform_tohost_VkRenderPassCreateInfo(ResourceTracker* resourceTracker,
+                                             VkRenderPassCreateInfo* toTransform);
+
+void transform_fromhost_VkRenderPassCreateInfo(ResourceTracker* resourceTracker,
+                                               VkRenderPassCreateInfo* toTransform);
+
+void transform_tohost_VkCommandPoolCreateInfo(ResourceTracker* resourceTracker,
+                                              VkCommandPoolCreateInfo* toTransform);
+
+void transform_fromhost_VkCommandPoolCreateInfo(ResourceTracker* resourceTracker,
+                                                VkCommandPoolCreateInfo* toTransform);
+
+void transform_tohost_VkCommandBufferAllocateInfo(ResourceTracker* resourceTracker,
+                                                  VkCommandBufferAllocateInfo* toTransform);
+
+void transform_fromhost_VkCommandBufferAllocateInfo(ResourceTracker* resourceTracker,
+                                                    VkCommandBufferAllocateInfo* toTransform);
+
+void transform_tohost_VkCommandBufferInheritanceInfo(ResourceTracker* resourceTracker,
+                                                     VkCommandBufferInheritanceInfo* toTransform);
+
+void transform_fromhost_VkCommandBufferInheritanceInfo(ResourceTracker* resourceTracker,
+                                                       VkCommandBufferInheritanceInfo* toTransform);
+
+void transform_tohost_VkCommandBufferBeginInfo(ResourceTracker* resourceTracker,
+                                               VkCommandBufferBeginInfo* toTransform);
+
+void transform_fromhost_VkCommandBufferBeginInfo(ResourceTracker* resourceTracker,
+                                                 VkCommandBufferBeginInfo* toTransform);
+
+void transform_tohost_VkBufferCopy(ResourceTracker* resourceTracker, VkBufferCopy* toTransform);
+
+void transform_fromhost_VkBufferCopy(ResourceTracker* resourceTracker, VkBufferCopy* toTransform);
+
+void transform_tohost_VkImageSubresourceLayers(ResourceTracker* resourceTracker,
+                                               VkImageSubresourceLayers* toTransform);
+
+void transform_fromhost_VkImageSubresourceLayers(ResourceTracker* resourceTracker,
+                                                 VkImageSubresourceLayers* toTransform);
+
+void transform_tohost_VkBufferImageCopy(ResourceTracker* resourceTracker,
+                                        VkBufferImageCopy* toTransform);
+
+void transform_fromhost_VkBufferImageCopy(ResourceTracker* resourceTracker,
+                                          VkBufferImageCopy* toTransform);
+
+void transform_tohost_VkClearColorValue(ResourceTracker* resourceTracker,
+                                        VkClearColorValue* toTransform);
+
+void transform_fromhost_VkClearColorValue(ResourceTracker* resourceTracker,
+                                          VkClearColorValue* toTransform);
+
+void transform_tohost_VkClearDepthStencilValue(ResourceTracker* resourceTracker,
+                                               VkClearDepthStencilValue* toTransform);
+
+void transform_fromhost_VkClearDepthStencilValue(ResourceTracker* resourceTracker,
+                                                 VkClearDepthStencilValue* toTransform);
+
+void transform_tohost_VkClearValue(ResourceTracker* resourceTracker, VkClearValue* toTransform);
+
+void transform_fromhost_VkClearValue(ResourceTracker* resourceTracker, VkClearValue* toTransform);
+
+void transform_tohost_VkClearAttachment(ResourceTracker* resourceTracker,
+                                        VkClearAttachment* toTransform);
+
+void transform_fromhost_VkClearAttachment(ResourceTracker* resourceTracker,
+                                          VkClearAttachment* toTransform);
+
+void transform_tohost_VkClearRect(ResourceTracker* resourceTracker, VkClearRect* toTransform);
+
+void transform_fromhost_VkClearRect(ResourceTracker* resourceTracker, VkClearRect* toTransform);
+
+void transform_tohost_VkImageBlit(ResourceTracker* resourceTracker, VkImageBlit* toTransform);
+
+void transform_fromhost_VkImageBlit(ResourceTracker* resourceTracker, VkImageBlit* toTransform);
+
+void transform_tohost_VkImageCopy(ResourceTracker* resourceTracker, VkImageCopy* toTransform);
+
+void transform_fromhost_VkImageCopy(ResourceTracker* resourceTracker, VkImageCopy* toTransform);
+
+void transform_tohost_VkImageResolve(ResourceTracker* resourceTracker, VkImageResolve* toTransform);
+
+void transform_fromhost_VkImageResolve(ResourceTracker* resourceTracker,
+                                       VkImageResolve* toTransform);
+
+void transform_tohost_VkRenderPassBeginInfo(ResourceTracker* resourceTracker,
+                                            VkRenderPassBeginInfo* toTransform);
+
+void transform_fromhost_VkRenderPassBeginInfo(ResourceTracker* resourceTracker,
+                                              VkRenderPassBeginInfo* toTransform);
+
+#endif
+#ifdef VK_VERSION_1_1
+void transform_tohost_VkPhysicalDeviceSubgroupProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSubgroupProperties* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceSubgroupProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSubgroupProperties* toTransform);
+
+void transform_tohost_VkBindBufferMemoryInfo(ResourceTracker* resourceTracker,
+                                             VkBindBufferMemoryInfo* toTransform);
+
+void transform_fromhost_VkBindBufferMemoryInfo(ResourceTracker* resourceTracker,
+                                               VkBindBufferMemoryInfo* toTransform);
+
+void transform_tohost_VkBindImageMemoryInfo(ResourceTracker* resourceTracker,
+                                            VkBindImageMemoryInfo* toTransform);
+
+void transform_fromhost_VkBindImageMemoryInfo(ResourceTracker* resourceTracker,
+                                              VkBindImageMemoryInfo* toTransform);
+
+void transform_tohost_VkPhysicalDevice16BitStorageFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDevice16BitStorageFeatures* toTransform);
+
+void transform_fromhost_VkPhysicalDevice16BitStorageFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDevice16BitStorageFeatures* toTransform);
+
+void transform_tohost_VkMemoryDedicatedRequirements(ResourceTracker* resourceTracker,
+                                                    VkMemoryDedicatedRequirements* toTransform);
+
+void transform_fromhost_VkMemoryDedicatedRequirements(ResourceTracker* resourceTracker,
+                                                      VkMemoryDedicatedRequirements* toTransform);
+
+void transform_tohost_VkMemoryDedicatedAllocateInfo(ResourceTracker* resourceTracker,
+                                                    VkMemoryDedicatedAllocateInfo* toTransform);
+
+void transform_fromhost_VkMemoryDedicatedAllocateInfo(ResourceTracker* resourceTracker,
+                                                      VkMemoryDedicatedAllocateInfo* toTransform);
+
+void transform_tohost_VkMemoryAllocateFlagsInfo(ResourceTracker* resourceTracker,
+                                                VkMemoryAllocateFlagsInfo* toTransform);
+
+void transform_fromhost_VkMemoryAllocateFlagsInfo(ResourceTracker* resourceTracker,
+                                                  VkMemoryAllocateFlagsInfo* toTransform);
+
+void transform_tohost_VkDeviceGroupRenderPassBeginInfo(
+    ResourceTracker* resourceTracker, VkDeviceGroupRenderPassBeginInfo* toTransform);
+
+void transform_fromhost_VkDeviceGroupRenderPassBeginInfo(
+    ResourceTracker* resourceTracker, VkDeviceGroupRenderPassBeginInfo* toTransform);
+
+void transform_tohost_VkDeviceGroupCommandBufferBeginInfo(
+    ResourceTracker* resourceTracker, VkDeviceGroupCommandBufferBeginInfo* toTransform);
+
+void transform_fromhost_VkDeviceGroupCommandBufferBeginInfo(
+    ResourceTracker* resourceTracker, VkDeviceGroupCommandBufferBeginInfo* toTransform);
+
+void transform_tohost_VkDeviceGroupSubmitInfo(ResourceTracker* resourceTracker,
+                                              VkDeviceGroupSubmitInfo* toTransform);
+
+void transform_fromhost_VkDeviceGroupSubmitInfo(ResourceTracker* resourceTracker,
+                                                VkDeviceGroupSubmitInfo* toTransform);
+
+void transform_tohost_VkDeviceGroupBindSparseInfo(ResourceTracker* resourceTracker,
+                                                  VkDeviceGroupBindSparseInfo* toTransform);
+
+void transform_fromhost_VkDeviceGroupBindSparseInfo(ResourceTracker* resourceTracker,
+                                                    VkDeviceGroupBindSparseInfo* toTransform);
+
+void transform_tohost_VkBindBufferMemoryDeviceGroupInfo(
+    ResourceTracker* resourceTracker, VkBindBufferMemoryDeviceGroupInfo* toTransform);
+
+void transform_fromhost_VkBindBufferMemoryDeviceGroupInfo(
+    ResourceTracker* resourceTracker, VkBindBufferMemoryDeviceGroupInfo* toTransform);
+
+void transform_tohost_VkBindImageMemoryDeviceGroupInfo(
+    ResourceTracker* resourceTracker, VkBindImageMemoryDeviceGroupInfo* toTransform);
+
+void transform_fromhost_VkBindImageMemoryDeviceGroupInfo(
+    ResourceTracker* resourceTracker, VkBindImageMemoryDeviceGroupInfo* toTransform);
+
+void transform_tohost_VkPhysicalDeviceGroupProperties(ResourceTracker* resourceTracker,
+                                                      VkPhysicalDeviceGroupProperties* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceGroupProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceGroupProperties* toTransform);
+
+void transform_tohost_VkDeviceGroupDeviceCreateInfo(ResourceTracker* resourceTracker,
+                                                    VkDeviceGroupDeviceCreateInfo* toTransform);
+
+void transform_fromhost_VkDeviceGroupDeviceCreateInfo(ResourceTracker* resourceTracker,
+                                                      VkDeviceGroupDeviceCreateInfo* toTransform);
+
+void transform_tohost_VkBufferMemoryRequirementsInfo2(ResourceTracker* resourceTracker,
+                                                      VkBufferMemoryRequirementsInfo2* toTransform);
+
+void transform_fromhost_VkBufferMemoryRequirementsInfo2(
+    ResourceTracker* resourceTracker, VkBufferMemoryRequirementsInfo2* toTransform);
+
+void transform_tohost_VkImageMemoryRequirementsInfo2(ResourceTracker* resourceTracker,
+                                                     VkImageMemoryRequirementsInfo2* toTransform);
+
+void transform_fromhost_VkImageMemoryRequirementsInfo2(ResourceTracker* resourceTracker,
+                                                       VkImageMemoryRequirementsInfo2* toTransform);
+
+void transform_tohost_VkImageSparseMemoryRequirementsInfo2(
+    ResourceTracker* resourceTracker, VkImageSparseMemoryRequirementsInfo2* toTransform);
+
+void transform_fromhost_VkImageSparseMemoryRequirementsInfo2(
+    ResourceTracker* resourceTracker, VkImageSparseMemoryRequirementsInfo2* toTransform);
+
+void transform_tohost_VkMemoryRequirements2(ResourceTracker* resourceTracker,
+                                            VkMemoryRequirements2* toTransform);
+
+void transform_fromhost_VkMemoryRequirements2(ResourceTracker* resourceTracker,
+                                              VkMemoryRequirements2* toTransform);
+
+void transform_tohost_VkSparseImageMemoryRequirements2(
+    ResourceTracker* resourceTracker, VkSparseImageMemoryRequirements2* toTransform);
+
+void transform_fromhost_VkSparseImageMemoryRequirements2(
+    ResourceTracker* resourceTracker, VkSparseImageMemoryRequirements2* toTransform);
+
+void transform_tohost_VkPhysicalDeviceFeatures2(ResourceTracker* resourceTracker,
+                                                VkPhysicalDeviceFeatures2* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceFeatures2(ResourceTracker* resourceTracker,
+                                                  VkPhysicalDeviceFeatures2* toTransform);
+
+void transform_tohost_VkPhysicalDeviceProperties2(ResourceTracker* resourceTracker,
+                                                  VkPhysicalDeviceProperties2* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceProperties2(ResourceTracker* resourceTracker,
+                                                    VkPhysicalDeviceProperties2* toTransform);
+
+void transform_tohost_VkFormatProperties2(ResourceTracker* resourceTracker,
+                                          VkFormatProperties2* toTransform);
+
+void transform_fromhost_VkFormatProperties2(ResourceTracker* resourceTracker,
+                                            VkFormatProperties2* toTransform);
+
+void transform_tohost_VkImageFormatProperties2(ResourceTracker* resourceTracker,
+                                               VkImageFormatProperties2* toTransform);
+
+void transform_fromhost_VkImageFormatProperties2(ResourceTracker* resourceTracker,
+                                                 VkImageFormatProperties2* toTransform);
+
+void transform_tohost_VkPhysicalDeviceImageFormatInfo2(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceImageFormatInfo2* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceImageFormatInfo2(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceImageFormatInfo2* toTransform);
+
+void transform_tohost_VkQueueFamilyProperties2(ResourceTracker* resourceTracker,
+                                               VkQueueFamilyProperties2* toTransform);
+
+void transform_fromhost_VkQueueFamilyProperties2(ResourceTracker* resourceTracker,
+                                                 VkQueueFamilyProperties2* toTransform);
+
+void transform_tohost_VkPhysicalDeviceMemoryProperties2(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMemoryProperties2* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceMemoryProperties2(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMemoryProperties2* toTransform);
+
+void transform_tohost_VkSparseImageFormatProperties2(ResourceTracker* resourceTracker,
+                                                     VkSparseImageFormatProperties2* toTransform);
+
+void transform_fromhost_VkSparseImageFormatProperties2(ResourceTracker* resourceTracker,
+                                                       VkSparseImageFormatProperties2* toTransform);
+
+void transform_tohost_VkPhysicalDeviceSparseImageFormatInfo2(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSparseImageFormatInfo2* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceSparseImageFormatInfo2(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSparseImageFormatInfo2* toTransform);
+
+void transform_tohost_VkPhysicalDevicePointClippingProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePointClippingProperties* toTransform);
+
+void transform_fromhost_VkPhysicalDevicePointClippingProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePointClippingProperties* toTransform);
+
+void transform_tohost_VkInputAttachmentAspectReference(
+    ResourceTracker* resourceTracker, VkInputAttachmentAspectReference* toTransform);
+
+void transform_fromhost_VkInputAttachmentAspectReference(
+    ResourceTracker* resourceTracker, VkInputAttachmentAspectReference* toTransform);
+
+void transform_tohost_VkRenderPassInputAttachmentAspectCreateInfo(
+    ResourceTracker* resourceTracker, VkRenderPassInputAttachmentAspectCreateInfo* toTransform);
+
+void transform_fromhost_VkRenderPassInputAttachmentAspectCreateInfo(
+    ResourceTracker* resourceTracker, VkRenderPassInputAttachmentAspectCreateInfo* toTransform);
+
+void transform_tohost_VkImageViewUsageCreateInfo(ResourceTracker* resourceTracker,
+                                                 VkImageViewUsageCreateInfo* toTransform);
+
+void transform_fromhost_VkImageViewUsageCreateInfo(ResourceTracker* resourceTracker,
+                                                   VkImageViewUsageCreateInfo* toTransform);
+
+void transform_tohost_VkPipelineTessellationDomainOriginStateCreateInfo(
+    ResourceTracker* resourceTracker,
+    VkPipelineTessellationDomainOriginStateCreateInfo* toTransform);
+
+void transform_fromhost_VkPipelineTessellationDomainOriginStateCreateInfo(
+    ResourceTracker* resourceTracker,
+    VkPipelineTessellationDomainOriginStateCreateInfo* toTransform);
+
+void transform_tohost_VkRenderPassMultiviewCreateInfo(ResourceTracker* resourceTracker,
+                                                      VkRenderPassMultiviewCreateInfo* toTransform);
+
+void transform_fromhost_VkRenderPassMultiviewCreateInfo(
+    ResourceTracker* resourceTracker, VkRenderPassMultiviewCreateInfo* toTransform);
+
+void transform_tohost_VkPhysicalDeviceMultiviewFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMultiviewFeatures* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceMultiviewFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMultiviewFeatures* toTransform);
+
+void transform_tohost_VkPhysicalDeviceMultiviewProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMultiviewProperties* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceMultiviewProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMultiviewProperties* toTransform);
+
+void transform_tohost_VkPhysicalDeviceVariablePointersFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceVariablePointersFeatures* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceVariablePointersFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceVariablePointersFeatures* toTransform);
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceVariablePointersFeatures,
+                      transform_tohost_VkPhysicalDeviceVariablePointerFeatures)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceVariablePointersFeatures,
+                      transform_fromhost_VkPhysicalDeviceVariablePointerFeatures)
+
+void transform_tohost_VkPhysicalDeviceProtectedMemoryFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceProtectedMemoryFeatures* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceProtectedMemoryFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceProtectedMemoryFeatures* toTransform);
+
+void transform_tohost_VkPhysicalDeviceProtectedMemoryProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceProtectedMemoryProperties* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceProtectedMemoryProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceProtectedMemoryProperties* toTransform);
+
+void transform_tohost_VkDeviceQueueInfo2(ResourceTracker* resourceTracker,
+                                         VkDeviceQueueInfo2* toTransform);
+
+void transform_fromhost_VkDeviceQueueInfo2(ResourceTracker* resourceTracker,
+                                           VkDeviceQueueInfo2* toTransform);
+
+void transform_tohost_VkProtectedSubmitInfo(ResourceTracker* resourceTracker,
+                                            VkProtectedSubmitInfo* toTransform);
+
+void transform_fromhost_VkProtectedSubmitInfo(ResourceTracker* resourceTracker,
+                                              VkProtectedSubmitInfo* toTransform);
+
+void transform_tohost_VkSamplerYcbcrConversionCreateInfo(
+    ResourceTracker* resourceTracker, VkSamplerYcbcrConversionCreateInfo* toTransform);
+
+void transform_fromhost_VkSamplerYcbcrConversionCreateInfo(
+    ResourceTracker* resourceTracker, VkSamplerYcbcrConversionCreateInfo* toTransform);
+
+void transform_tohost_VkSamplerYcbcrConversionInfo(ResourceTracker* resourceTracker,
+                                                   VkSamplerYcbcrConversionInfo* toTransform);
+
+void transform_fromhost_VkSamplerYcbcrConversionInfo(ResourceTracker* resourceTracker,
+                                                     VkSamplerYcbcrConversionInfo* toTransform);
+
+void transform_tohost_VkBindImagePlaneMemoryInfo(ResourceTracker* resourceTracker,
+                                                 VkBindImagePlaneMemoryInfo* toTransform);
+
+void transform_fromhost_VkBindImagePlaneMemoryInfo(ResourceTracker* resourceTracker,
+                                                   VkBindImagePlaneMemoryInfo* toTransform);
+
+void transform_tohost_VkImagePlaneMemoryRequirementsInfo(
+    ResourceTracker* resourceTracker, VkImagePlaneMemoryRequirementsInfo* toTransform);
+
+void transform_fromhost_VkImagePlaneMemoryRequirementsInfo(
+    ResourceTracker* resourceTracker, VkImagePlaneMemoryRequirementsInfo* toTransform);
+
+void transform_tohost_VkPhysicalDeviceSamplerYcbcrConversionFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSamplerYcbcrConversionFeatures* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceSamplerYcbcrConversionFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSamplerYcbcrConversionFeatures* toTransform);
+
+void transform_tohost_VkSamplerYcbcrConversionImageFormatProperties(
+    ResourceTracker* resourceTracker, VkSamplerYcbcrConversionImageFormatProperties* toTransform);
+
+void transform_fromhost_VkSamplerYcbcrConversionImageFormatProperties(
+    ResourceTracker* resourceTracker, VkSamplerYcbcrConversionImageFormatProperties* toTransform);
+
+void transform_tohost_VkDescriptorUpdateTemplateEntry(ResourceTracker* resourceTracker,
+                                                      VkDescriptorUpdateTemplateEntry* toTransform);
+
+void transform_fromhost_VkDescriptorUpdateTemplateEntry(
+    ResourceTracker* resourceTracker, VkDescriptorUpdateTemplateEntry* toTransform);
+
+void transform_tohost_VkDescriptorUpdateTemplateCreateInfo(
+    ResourceTracker* resourceTracker, VkDescriptorUpdateTemplateCreateInfo* toTransform);
+
+void transform_fromhost_VkDescriptorUpdateTemplateCreateInfo(
+    ResourceTracker* resourceTracker, VkDescriptorUpdateTemplateCreateInfo* toTransform);
+
+void transform_tohost_VkExternalMemoryProperties(ResourceTracker* resourceTracker,
+                                                 VkExternalMemoryProperties* toTransform);
+
+void transform_fromhost_VkExternalMemoryProperties(ResourceTracker* resourceTracker,
+                                                   VkExternalMemoryProperties* toTransform);
+
+void transform_tohost_VkPhysicalDeviceExternalImageFormatInfo(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceExternalImageFormatInfo* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceExternalImageFormatInfo(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceExternalImageFormatInfo* toTransform);
+
+void transform_tohost_VkExternalImageFormatProperties(ResourceTracker* resourceTracker,
+                                                      VkExternalImageFormatProperties* toTransform);
+
+void transform_fromhost_VkExternalImageFormatProperties(
+    ResourceTracker* resourceTracker, VkExternalImageFormatProperties* toTransform);
+
+void transform_tohost_VkPhysicalDeviceExternalBufferInfo(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceExternalBufferInfo* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceExternalBufferInfo(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceExternalBufferInfo* toTransform);
+
+void transform_tohost_VkExternalBufferProperties(ResourceTracker* resourceTracker,
+                                                 VkExternalBufferProperties* toTransform);
+
+void transform_fromhost_VkExternalBufferProperties(ResourceTracker* resourceTracker,
+                                                   VkExternalBufferProperties* toTransform);
+
+void transform_tohost_VkPhysicalDeviceIDProperties(ResourceTracker* resourceTracker,
+                                                   VkPhysicalDeviceIDProperties* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceIDProperties(ResourceTracker* resourceTracker,
+                                                     VkPhysicalDeviceIDProperties* toTransform);
+
+void transform_tohost_VkExternalMemoryImageCreateInfo(ResourceTracker* resourceTracker,
+                                                      VkExternalMemoryImageCreateInfo* toTransform);
+
+void transform_fromhost_VkExternalMemoryImageCreateInfo(
+    ResourceTracker* resourceTracker, VkExternalMemoryImageCreateInfo* toTransform);
+
+void transform_tohost_VkExternalMemoryBufferCreateInfo(
+    ResourceTracker* resourceTracker, VkExternalMemoryBufferCreateInfo* toTransform);
+
+void transform_fromhost_VkExternalMemoryBufferCreateInfo(
+    ResourceTracker* resourceTracker, VkExternalMemoryBufferCreateInfo* toTransform);
+
+void transform_tohost_VkExportMemoryAllocateInfo(ResourceTracker* resourceTracker,
+                                                 VkExportMemoryAllocateInfo* toTransform);
+
+void transform_fromhost_VkExportMemoryAllocateInfo(ResourceTracker* resourceTracker,
+                                                   VkExportMemoryAllocateInfo* toTransform);
+
+void transform_tohost_VkPhysicalDeviceExternalFenceInfo(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceExternalFenceInfo* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceExternalFenceInfo(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceExternalFenceInfo* toTransform);
+
+void transform_tohost_VkExternalFenceProperties(ResourceTracker* resourceTracker,
+                                                VkExternalFenceProperties* toTransform);
+
+void transform_fromhost_VkExternalFenceProperties(ResourceTracker* resourceTracker,
+                                                  VkExternalFenceProperties* toTransform);
+
+void transform_tohost_VkExportFenceCreateInfo(ResourceTracker* resourceTracker,
+                                              VkExportFenceCreateInfo* toTransform);
+
+void transform_fromhost_VkExportFenceCreateInfo(ResourceTracker* resourceTracker,
+                                                VkExportFenceCreateInfo* toTransform);
+
+void transform_tohost_VkExportSemaphoreCreateInfo(ResourceTracker* resourceTracker,
+                                                  VkExportSemaphoreCreateInfo* toTransform);
+
+void transform_fromhost_VkExportSemaphoreCreateInfo(ResourceTracker* resourceTracker,
+                                                    VkExportSemaphoreCreateInfo* toTransform);
+
+void transform_tohost_VkPhysicalDeviceExternalSemaphoreInfo(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceExternalSemaphoreInfo* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceExternalSemaphoreInfo(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceExternalSemaphoreInfo* toTransform);
+
+void transform_tohost_VkExternalSemaphoreProperties(ResourceTracker* resourceTracker,
+                                                    VkExternalSemaphoreProperties* toTransform);
+
+void transform_fromhost_VkExternalSemaphoreProperties(ResourceTracker* resourceTracker,
+                                                      VkExternalSemaphoreProperties* toTransform);
+
+void transform_tohost_VkPhysicalDeviceMaintenance3Properties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMaintenance3Properties* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceMaintenance3Properties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMaintenance3Properties* toTransform);
+
+void transform_tohost_VkDescriptorSetLayoutSupport(ResourceTracker* resourceTracker,
+                                                   VkDescriptorSetLayoutSupport* toTransform);
+
+void transform_fromhost_VkDescriptorSetLayoutSupport(ResourceTracker* resourceTracker,
+                                                     VkDescriptorSetLayoutSupport* toTransform);
+
+void transform_tohost_VkPhysicalDeviceShaderDrawParametersFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderDrawParametersFeatures* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceShaderDrawParametersFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderDrawParametersFeatures* toTransform);
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceShaderDrawParametersFeatures,
+                      transform_tohost_VkPhysicalDeviceShaderDrawParameterFeatures)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceShaderDrawParametersFeatures,
+                      transform_fromhost_VkPhysicalDeviceShaderDrawParameterFeatures)
+
+#endif
+#ifdef VK_VERSION_1_2
+void transform_tohost_VkPhysicalDeviceVulkan11Features(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceVulkan11Features* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceVulkan11Features(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceVulkan11Features* toTransform);
+
+void transform_tohost_VkPhysicalDeviceVulkan11Properties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceVulkan11Properties* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceVulkan11Properties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceVulkan11Properties* toTransform);
+
+void transform_tohost_VkPhysicalDeviceVulkan12Features(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceVulkan12Features* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceVulkan12Features(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceVulkan12Features* toTransform);
+
+void transform_tohost_VkConformanceVersion(ResourceTracker* resourceTracker,
+                                           VkConformanceVersion* toTransform);
+
+void transform_fromhost_VkConformanceVersion(ResourceTracker* resourceTracker,
+                                             VkConformanceVersion* toTransform);
+
+void transform_tohost_VkPhysicalDeviceVulkan12Properties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceVulkan12Properties* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceVulkan12Properties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceVulkan12Properties* toTransform);
+
+void transform_tohost_VkImageFormatListCreateInfo(ResourceTracker* resourceTracker,
+                                                  VkImageFormatListCreateInfo* toTransform);
+
+void transform_fromhost_VkImageFormatListCreateInfo(ResourceTracker* resourceTracker,
+                                                    VkImageFormatListCreateInfo* toTransform);
+
+void transform_tohost_VkAttachmentDescription2(ResourceTracker* resourceTracker,
+                                               VkAttachmentDescription2* toTransform);
+
+void transform_fromhost_VkAttachmentDescription2(ResourceTracker* resourceTracker,
+                                                 VkAttachmentDescription2* toTransform);
+
+void transform_tohost_VkAttachmentReference2(ResourceTracker* resourceTracker,
+                                             VkAttachmentReference2* toTransform);
+
+void transform_fromhost_VkAttachmentReference2(ResourceTracker* resourceTracker,
+                                               VkAttachmentReference2* toTransform);
+
+void transform_tohost_VkSubpassDescription2(ResourceTracker* resourceTracker,
+                                            VkSubpassDescription2* toTransform);
+
+void transform_fromhost_VkSubpassDescription2(ResourceTracker* resourceTracker,
+                                              VkSubpassDescription2* toTransform);
+
+void transform_tohost_VkSubpassDependency2(ResourceTracker* resourceTracker,
+                                           VkSubpassDependency2* toTransform);
+
+void transform_fromhost_VkSubpassDependency2(ResourceTracker* resourceTracker,
+                                             VkSubpassDependency2* toTransform);
+
+void transform_tohost_VkRenderPassCreateInfo2(ResourceTracker* resourceTracker,
+                                              VkRenderPassCreateInfo2* toTransform);
+
+void transform_fromhost_VkRenderPassCreateInfo2(ResourceTracker* resourceTracker,
+                                                VkRenderPassCreateInfo2* toTransform);
+
+void transform_tohost_VkSubpassBeginInfo(ResourceTracker* resourceTracker,
+                                         VkSubpassBeginInfo* toTransform);
+
+void transform_fromhost_VkSubpassBeginInfo(ResourceTracker* resourceTracker,
+                                           VkSubpassBeginInfo* toTransform);
+
+void transform_tohost_VkSubpassEndInfo(ResourceTracker* resourceTracker,
+                                       VkSubpassEndInfo* toTransform);
+
+void transform_fromhost_VkSubpassEndInfo(ResourceTracker* resourceTracker,
+                                         VkSubpassEndInfo* toTransform);
+
+void transform_tohost_VkPhysicalDevice8BitStorageFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDevice8BitStorageFeatures* toTransform);
+
+void transform_fromhost_VkPhysicalDevice8BitStorageFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDevice8BitStorageFeatures* toTransform);
+
+void transform_tohost_VkPhysicalDeviceDriverProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDriverProperties* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceDriverProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDriverProperties* toTransform);
+
+void transform_tohost_VkPhysicalDeviceShaderAtomicInt64Features(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderAtomicInt64Features* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceShaderAtomicInt64Features(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderAtomicInt64Features* toTransform);
+
+void transform_tohost_VkPhysicalDeviceShaderFloat16Int8Features(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderFloat16Int8Features* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceShaderFloat16Int8Features(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderFloat16Int8Features* toTransform);
+
+void transform_tohost_VkPhysicalDeviceFloatControlsProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceFloatControlsProperties* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceFloatControlsProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceFloatControlsProperties* toTransform);
+
+void transform_tohost_VkDescriptorSetLayoutBindingFlagsCreateInfo(
+    ResourceTracker* resourceTracker, VkDescriptorSetLayoutBindingFlagsCreateInfo* toTransform);
+
+void transform_fromhost_VkDescriptorSetLayoutBindingFlagsCreateInfo(
+    ResourceTracker* resourceTracker, VkDescriptorSetLayoutBindingFlagsCreateInfo* toTransform);
+
+void transform_tohost_VkPhysicalDeviceDescriptorIndexingFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDescriptorIndexingFeatures* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceDescriptorIndexingFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDescriptorIndexingFeatures* toTransform);
+
+void transform_tohost_VkPhysicalDeviceDescriptorIndexingProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDescriptorIndexingProperties* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceDescriptorIndexingProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDescriptorIndexingProperties* toTransform);
+
+void transform_tohost_VkDescriptorSetVariableDescriptorCountAllocateInfo(
+    ResourceTracker* resourceTracker,
+    VkDescriptorSetVariableDescriptorCountAllocateInfo* toTransform);
+
+void transform_fromhost_VkDescriptorSetVariableDescriptorCountAllocateInfo(
+    ResourceTracker* resourceTracker,
+    VkDescriptorSetVariableDescriptorCountAllocateInfo* toTransform);
+
+void transform_tohost_VkDescriptorSetVariableDescriptorCountLayoutSupport(
+    ResourceTracker* resourceTracker,
+    VkDescriptorSetVariableDescriptorCountLayoutSupport* toTransform);
+
+void transform_fromhost_VkDescriptorSetVariableDescriptorCountLayoutSupport(
+    ResourceTracker* resourceTracker,
+    VkDescriptorSetVariableDescriptorCountLayoutSupport* toTransform);
+
+void transform_tohost_VkSubpassDescriptionDepthStencilResolve(
+    ResourceTracker* resourceTracker, VkSubpassDescriptionDepthStencilResolve* toTransform);
+
+void transform_fromhost_VkSubpassDescriptionDepthStencilResolve(
+    ResourceTracker* resourceTracker, VkSubpassDescriptionDepthStencilResolve* toTransform);
+
+void transform_tohost_VkPhysicalDeviceDepthStencilResolveProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDepthStencilResolveProperties* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceDepthStencilResolveProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDepthStencilResolveProperties* toTransform);
+
+void transform_tohost_VkPhysicalDeviceScalarBlockLayoutFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceScalarBlockLayoutFeatures* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceScalarBlockLayoutFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceScalarBlockLayoutFeatures* toTransform);
+
+void transform_tohost_VkImageStencilUsageCreateInfo(ResourceTracker* resourceTracker,
+                                                    VkImageStencilUsageCreateInfo* toTransform);
+
+void transform_fromhost_VkImageStencilUsageCreateInfo(ResourceTracker* resourceTracker,
+                                                      VkImageStencilUsageCreateInfo* toTransform);
+
+void transform_tohost_VkSamplerReductionModeCreateInfo(
+    ResourceTracker* resourceTracker, VkSamplerReductionModeCreateInfo* toTransform);
+
+void transform_fromhost_VkSamplerReductionModeCreateInfo(
+    ResourceTracker* resourceTracker, VkSamplerReductionModeCreateInfo* toTransform);
+
+void transform_tohost_VkPhysicalDeviceSamplerFilterMinmaxProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSamplerFilterMinmaxProperties* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceSamplerFilterMinmaxProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSamplerFilterMinmaxProperties* toTransform);
+
+void transform_tohost_VkPhysicalDeviceVulkanMemoryModelFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceVulkanMemoryModelFeatures* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceVulkanMemoryModelFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceVulkanMemoryModelFeatures* toTransform);
+
+void transform_tohost_VkPhysicalDeviceImagelessFramebufferFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceImagelessFramebufferFeatures* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceImagelessFramebufferFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceImagelessFramebufferFeatures* toTransform);
+
+void transform_tohost_VkFramebufferAttachmentImageInfo(
+    ResourceTracker* resourceTracker, VkFramebufferAttachmentImageInfo* toTransform);
+
+void transform_fromhost_VkFramebufferAttachmentImageInfo(
+    ResourceTracker* resourceTracker, VkFramebufferAttachmentImageInfo* toTransform);
+
+void transform_tohost_VkFramebufferAttachmentsCreateInfo(
+    ResourceTracker* resourceTracker, VkFramebufferAttachmentsCreateInfo* toTransform);
+
+void transform_fromhost_VkFramebufferAttachmentsCreateInfo(
+    ResourceTracker* resourceTracker, VkFramebufferAttachmentsCreateInfo* toTransform);
+
+void transform_tohost_VkRenderPassAttachmentBeginInfo(ResourceTracker* resourceTracker,
+                                                      VkRenderPassAttachmentBeginInfo* toTransform);
+
+void transform_fromhost_VkRenderPassAttachmentBeginInfo(
+    ResourceTracker* resourceTracker, VkRenderPassAttachmentBeginInfo* toTransform);
+
+void transform_tohost_VkPhysicalDeviceUniformBufferStandardLayoutFeatures(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceUniformBufferStandardLayoutFeatures* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceUniformBufferStandardLayoutFeatures(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceUniformBufferStandardLayoutFeatures* toTransform);
+
+void transform_tohost_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures* toTransform);
+
+void transform_tohost_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures* toTransform);
+
+void transform_tohost_VkAttachmentReferenceStencilLayout(
+    ResourceTracker* resourceTracker, VkAttachmentReferenceStencilLayout* toTransform);
+
+void transform_fromhost_VkAttachmentReferenceStencilLayout(
+    ResourceTracker* resourceTracker, VkAttachmentReferenceStencilLayout* toTransform);
+
+void transform_tohost_VkAttachmentDescriptionStencilLayout(
+    ResourceTracker* resourceTracker, VkAttachmentDescriptionStencilLayout* toTransform);
+
+void transform_fromhost_VkAttachmentDescriptionStencilLayout(
+    ResourceTracker* resourceTracker, VkAttachmentDescriptionStencilLayout* toTransform);
+
+void transform_tohost_VkPhysicalDeviceHostQueryResetFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceHostQueryResetFeatures* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceHostQueryResetFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceHostQueryResetFeatures* toTransform);
+
+void transform_tohost_VkPhysicalDeviceTimelineSemaphoreFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceTimelineSemaphoreFeatures* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceTimelineSemaphoreFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceTimelineSemaphoreFeatures* toTransform);
+
+void transform_tohost_VkPhysicalDeviceTimelineSemaphoreProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceTimelineSemaphoreProperties* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceTimelineSemaphoreProperties(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceTimelineSemaphoreProperties* toTransform);
+
+void transform_tohost_VkSemaphoreTypeCreateInfo(ResourceTracker* resourceTracker,
+                                                VkSemaphoreTypeCreateInfo* toTransform);
+
+void transform_fromhost_VkSemaphoreTypeCreateInfo(ResourceTracker* resourceTracker,
+                                                  VkSemaphoreTypeCreateInfo* toTransform);
+
+void transform_tohost_VkTimelineSemaphoreSubmitInfo(ResourceTracker* resourceTracker,
+                                                    VkTimelineSemaphoreSubmitInfo* toTransform);
+
+void transform_fromhost_VkTimelineSemaphoreSubmitInfo(ResourceTracker* resourceTracker,
+                                                      VkTimelineSemaphoreSubmitInfo* toTransform);
+
+void transform_tohost_VkSemaphoreWaitInfo(ResourceTracker* resourceTracker,
+                                          VkSemaphoreWaitInfo* toTransform);
+
+void transform_fromhost_VkSemaphoreWaitInfo(ResourceTracker* resourceTracker,
+                                            VkSemaphoreWaitInfo* toTransform);
+
+void transform_tohost_VkSemaphoreSignalInfo(ResourceTracker* resourceTracker,
+                                            VkSemaphoreSignalInfo* toTransform);
+
+void transform_fromhost_VkSemaphoreSignalInfo(ResourceTracker* resourceTracker,
+                                              VkSemaphoreSignalInfo* toTransform);
+
+void transform_tohost_VkPhysicalDeviceBufferDeviceAddressFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceBufferDeviceAddressFeatures* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceBufferDeviceAddressFeatures(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceBufferDeviceAddressFeatures* toTransform);
+
+void transform_tohost_VkBufferDeviceAddressInfo(ResourceTracker* resourceTracker,
+                                                VkBufferDeviceAddressInfo* toTransform);
+
+void transform_fromhost_VkBufferDeviceAddressInfo(ResourceTracker* resourceTracker,
+                                                  VkBufferDeviceAddressInfo* toTransform);
+
+void transform_tohost_VkBufferOpaqueCaptureAddressCreateInfo(
+    ResourceTracker* resourceTracker, VkBufferOpaqueCaptureAddressCreateInfo* toTransform);
+
+void transform_fromhost_VkBufferOpaqueCaptureAddressCreateInfo(
+    ResourceTracker* resourceTracker, VkBufferOpaqueCaptureAddressCreateInfo* toTransform);
+
+void transform_tohost_VkMemoryOpaqueCaptureAddressAllocateInfo(
+    ResourceTracker* resourceTracker, VkMemoryOpaqueCaptureAddressAllocateInfo* toTransform);
+
+void transform_fromhost_VkMemoryOpaqueCaptureAddressAllocateInfo(
+    ResourceTracker* resourceTracker, VkMemoryOpaqueCaptureAddressAllocateInfo* toTransform);
+
+void transform_tohost_VkDeviceMemoryOpaqueCaptureAddressInfo(
+    ResourceTracker* resourceTracker, VkDeviceMemoryOpaqueCaptureAddressInfo* toTransform);
+
+void transform_fromhost_VkDeviceMemoryOpaqueCaptureAddressInfo(
+    ResourceTracker* resourceTracker, VkDeviceMemoryOpaqueCaptureAddressInfo* toTransform);
+
+#endif
+#ifdef VK_KHR_surface
+void transform_tohost_VkSurfaceCapabilitiesKHR(ResourceTracker* resourceTracker,
+                                               VkSurfaceCapabilitiesKHR* toTransform);
+
+void transform_fromhost_VkSurfaceCapabilitiesKHR(ResourceTracker* resourceTracker,
+                                                 VkSurfaceCapabilitiesKHR* toTransform);
+
+void transform_tohost_VkSurfaceFormatKHR(ResourceTracker* resourceTracker,
+                                         VkSurfaceFormatKHR* toTransform);
+
+void transform_fromhost_VkSurfaceFormatKHR(ResourceTracker* resourceTracker,
+                                           VkSurfaceFormatKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_swapchain
+void transform_tohost_VkSwapchainCreateInfoKHR(ResourceTracker* resourceTracker,
+                                               VkSwapchainCreateInfoKHR* toTransform);
+
+void transform_fromhost_VkSwapchainCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                 VkSwapchainCreateInfoKHR* toTransform);
+
+void transform_tohost_VkPresentInfoKHR(ResourceTracker* resourceTracker,
+                                       VkPresentInfoKHR* toTransform);
+
+void transform_fromhost_VkPresentInfoKHR(ResourceTracker* resourceTracker,
+                                         VkPresentInfoKHR* toTransform);
+
+void transform_tohost_VkImageSwapchainCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                    VkImageSwapchainCreateInfoKHR* toTransform);
+
+void transform_fromhost_VkImageSwapchainCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                      VkImageSwapchainCreateInfoKHR* toTransform);
+
+void transform_tohost_VkBindImageMemorySwapchainInfoKHR(
+    ResourceTracker* resourceTracker, VkBindImageMemorySwapchainInfoKHR* toTransform);
+
+void transform_fromhost_VkBindImageMemorySwapchainInfoKHR(
+    ResourceTracker* resourceTracker, VkBindImageMemorySwapchainInfoKHR* toTransform);
+
+void transform_tohost_VkAcquireNextImageInfoKHR(ResourceTracker* resourceTracker,
+                                                VkAcquireNextImageInfoKHR* toTransform);
+
+void transform_fromhost_VkAcquireNextImageInfoKHR(ResourceTracker* resourceTracker,
+                                                  VkAcquireNextImageInfoKHR* toTransform);
+
+void transform_tohost_VkDeviceGroupPresentCapabilitiesKHR(
+    ResourceTracker* resourceTracker, VkDeviceGroupPresentCapabilitiesKHR* toTransform);
+
+void transform_fromhost_VkDeviceGroupPresentCapabilitiesKHR(
+    ResourceTracker* resourceTracker, VkDeviceGroupPresentCapabilitiesKHR* toTransform);
+
+void transform_tohost_VkDeviceGroupPresentInfoKHR(ResourceTracker* resourceTracker,
+                                                  VkDeviceGroupPresentInfoKHR* toTransform);
+
+void transform_fromhost_VkDeviceGroupPresentInfoKHR(ResourceTracker* resourceTracker,
+                                                    VkDeviceGroupPresentInfoKHR* toTransform);
+
+void transform_tohost_VkDeviceGroupSwapchainCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkDeviceGroupSwapchainCreateInfoKHR* toTransform);
+
+void transform_fromhost_VkDeviceGroupSwapchainCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkDeviceGroupSwapchainCreateInfoKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_display
+void transform_tohost_VkDisplayModeParametersKHR(ResourceTracker* resourceTracker,
+                                                 VkDisplayModeParametersKHR* toTransform);
+
+void transform_fromhost_VkDisplayModeParametersKHR(ResourceTracker* resourceTracker,
+                                                   VkDisplayModeParametersKHR* toTransform);
+
+void transform_tohost_VkDisplayModeCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                 VkDisplayModeCreateInfoKHR* toTransform);
+
+void transform_fromhost_VkDisplayModeCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                   VkDisplayModeCreateInfoKHR* toTransform);
+
+void transform_tohost_VkDisplayModePropertiesKHR(ResourceTracker* resourceTracker,
+                                                 VkDisplayModePropertiesKHR* toTransform);
+
+void transform_fromhost_VkDisplayModePropertiesKHR(ResourceTracker* resourceTracker,
+                                                   VkDisplayModePropertiesKHR* toTransform);
+
+void transform_tohost_VkDisplayPlaneCapabilitiesKHR(ResourceTracker* resourceTracker,
+                                                    VkDisplayPlaneCapabilitiesKHR* toTransform);
+
+void transform_fromhost_VkDisplayPlaneCapabilitiesKHR(ResourceTracker* resourceTracker,
+                                                      VkDisplayPlaneCapabilitiesKHR* toTransform);
+
+void transform_tohost_VkDisplayPlanePropertiesKHR(ResourceTracker* resourceTracker,
+                                                  VkDisplayPlanePropertiesKHR* toTransform);
+
+void transform_fromhost_VkDisplayPlanePropertiesKHR(ResourceTracker* resourceTracker,
+                                                    VkDisplayPlanePropertiesKHR* toTransform);
+
+void transform_tohost_VkDisplayPropertiesKHR(ResourceTracker* resourceTracker,
+                                             VkDisplayPropertiesKHR* toTransform);
+
+void transform_fromhost_VkDisplayPropertiesKHR(ResourceTracker* resourceTracker,
+                                               VkDisplayPropertiesKHR* toTransform);
+
+void transform_tohost_VkDisplaySurfaceCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                    VkDisplaySurfaceCreateInfoKHR* toTransform);
+
+void transform_fromhost_VkDisplaySurfaceCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                      VkDisplaySurfaceCreateInfoKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_display_swapchain
+void transform_tohost_VkDisplayPresentInfoKHR(ResourceTracker* resourceTracker,
+                                              VkDisplayPresentInfoKHR* toTransform);
+
+void transform_fromhost_VkDisplayPresentInfoKHR(ResourceTracker* resourceTracker,
+                                                VkDisplayPresentInfoKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_xlib_surface
+void transform_tohost_VkXlibSurfaceCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                 VkXlibSurfaceCreateInfoKHR* toTransform);
+
+void transform_fromhost_VkXlibSurfaceCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                   VkXlibSurfaceCreateInfoKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_xcb_surface
+void transform_tohost_VkXcbSurfaceCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                VkXcbSurfaceCreateInfoKHR* toTransform);
+
+void transform_fromhost_VkXcbSurfaceCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                  VkXcbSurfaceCreateInfoKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_wayland_surface
+void transform_tohost_VkWaylandSurfaceCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                    VkWaylandSurfaceCreateInfoKHR* toTransform);
+
+void transform_fromhost_VkWaylandSurfaceCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                      VkWaylandSurfaceCreateInfoKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_android_surface
+void transform_tohost_VkAndroidSurfaceCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                    VkAndroidSurfaceCreateInfoKHR* toTransform);
+
+void transform_fromhost_VkAndroidSurfaceCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                      VkAndroidSurfaceCreateInfoKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_win32_surface
+void transform_tohost_VkWin32SurfaceCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                  VkWin32SurfaceCreateInfoKHR* toTransform);
+
+void transform_fromhost_VkWin32SurfaceCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                    VkWin32SurfaceCreateInfoKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_sampler_mirror_clamp_to_edge
+#endif
+#ifdef VK_KHR_video_queue
+void transform_tohost_VkVideoQueueFamilyProperties2KHR(
+    ResourceTracker* resourceTracker, VkVideoQueueFamilyProperties2KHR* toTransform);
+
+void transform_fromhost_VkVideoQueueFamilyProperties2KHR(
+    ResourceTracker* resourceTracker, VkVideoQueueFamilyProperties2KHR* toTransform);
+
+void transform_tohost_VkVideoProfileKHR(ResourceTracker* resourceTracker,
+                                        VkVideoProfileKHR* toTransform);
+
+void transform_fromhost_VkVideoProfileKHR(ResourceTracker* resourceTracker,
+                                          VkVideoProfileKHR* toTransform);
+
+void transform_tohost_VkVideoProfilesKHR(ResourceTracker* resourceTracker,
+                                         VkVideoProfilesKHR* toTransform);
+
+void transform_fromhost_VkVideoProfilesKHR(ResourceTracker* resourceTracker,
+                                           VkVideoProfilesKHR* toTransform);
+
+void transform_tohost_VkVideoCapabilitiesKHR(ResourceTracker* resourceTracker,
+                                             VkVideoCapabilitiesKHR* toTransform);
+
+void transform_fromhost_VkVideoCapabilitiesKHR(ResourceTracker* resourceTracker,
+                                               VkVideoCapabilitiesKHR* toTransform);
+
+void transform_tohost_VkPhysicalDeviceVideoFormatInfoKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceVideoFormatInfoKHR* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceVideoFormatInfoKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceVideoFormatInfoKHR* toTransform);
+
+void transform_tohost_VkVideoFormatPropertiesKHR(ResourceTracker* resourceTracker,
+                                                 VkVideoFormatPropertiesKHR* toTransform);
+
+void transform_fromhost_VkVideoFormatPropertiesKHR(ResourceTracker* resourceTracker,
+                                                   VkVideoFormatPropertiesKHR* toTransform);
+
+void transform_tohost_VkVideoPictureResourceKHR(ResourceTracker* resourceTracker,
+                                                VkVideoPictureResourceKHR* toTransform);
+
+void transform_fromhost_VkVideoPictureResourceKHR(ResourceTracker* resourceTracker,
+                                                  VkVideoPictureResourceKHR* toTransform);
+
+void transform_tohost_VkVideoReferenceSlotKHR(ResourceTracker* resourceTracker,
+                                              VkVideoReferenceSlotKHR* toTransform);
+
+void transform_fromhost_VkVideoReferenceSlotKHR(ResourceTracker* resourceTracker,
+                                                VkVideoReferenceSlotKHR* toTransform);
+
+void transform_tohost_VkVideoGetMemoryPropertiesKHR(ResourceTracker* resourceTracker,
+                                                    VkVideoGetMemoryPropertiesKHR* toTransform);
+
+void transform_fromhost_VkVideoGetMemoryPropertiesKHR(ResourceTracker* resourceTracker,
+                                                      VkVideoGetMemoryPropertiesKHR* toTransform);
+
+void transform_tohost_VkVideoBindMemoryKHR(ResourceTracker* resourceTracker,
+                                           VkVideoBindMemoryKHR* toTransform);
+
+void transform_fromhost_VkVideoBindMemoryKHR(ResourceTracker* resourceTracker,
+                                             VkVideoBindMemoryKHR* toTransform);
+
+void transform_tohost_VkVideoSessionCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                  VkVideoSessionCreateInfoKHR* toTransform);
+
+void transform_fromhost_VkVideoSessionCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                    VkVideoSessionCreateInfoKHR* toTransform);
+
+void transform_tohost_VkVideoSessionParametersCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkVideoSessionParametersCreateInfoKHR* toTransform);
+
+void transform_fromhost_VkVideoSessionParametersCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkVideoSessionParametersCreateInfoKHR* toTransform);
+
+void transform_tohost_VkVideoSessionParametersUpdateInfoKHR(
+    ResourceTracker* resourceTracker, VkVideoSessionParametersUpdateInfoKHR* toTransform);
+
+void transform_fromhost_VkVideoSessionParametersUpdateInfoKHR(
+    ResourceTracker* resourceTracker, VkVideoSessionParametersUpdateInfoKHR* toTransform);
+
+void transform_tohost_VkVideoBeginCodingInfoKHR(ResourceTracker* resourceTracker,
+                                                VkVideoBeginCodingInfoKHR* toTransform);
+
+void transform_fromhost_VkVideoBeginCodingInfoKHR(ResourceTracker* resourceTracker,
+                                                  VkVideoBeginCodingInfoKHR* toTransform);
+
+void transform_tohost_VkVideoEndCodingInfoKHR(ResourceTracker* resourceTracker,
+                                              VkVideoEndCodingInfoKHR* toTransform);
+
+void transform_fromhost_VkVideoEndCodingInfoKHR(ResourceTracker* resourceTracker,
+                                                VkVideoEndCodingInfoKHR* toTransform);
+
+void transform_tohost_VkVideoCodingControlInfoKHR(ResourceTracker* resourceTracker,
+                                                  VkVideoCodingControlInfoKHR* toTransform);
+
+void transform_fromhost_VkVideoCodingControlInfoKHR(ResourceTracker* resourceTracker,
+                                                    VkVideoCodingControlInfoKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_video_decode_queue
+void transform_tohost_VkVideoDecodeInfoKHR(ResourceTracker* resourceTracker,
+                                           VkVideoDecodeInfoKHR* toTransform);
+
+void transform_fromhost_VkVideoDecodeInfoKHR(ResourceTracker* resourceTracker,
+                                             VkVideoDecodeInfoKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_dynamic_rendering
+void transform_tohost_VkRenderingAttachmentInfoKHR(ResourceTracker* resourceTracker,
+                                                   VkRenderingAttachmentInfoKHR* toTransform);
+
+void transform_fromhost_VkRenderingAttachmentInfoKHR(ResourceTracker* resourceTracker,
+                                                     VkRenderingAttachmentInfoKHR* toTransform);
+
+void transform_tohost_VkRenderingInfoKHR(ResourceTracker* resourceTracker,
+                                         VkRenderingInfoKHR* toTransform);
+
+void transform_fromhost_VkRenderingInfoKHR(ResourceTracker* resourceTracker,
+                                           VkRenderingInfoKHR* toTransform);
+
+void transform_tohost_VkPipelineRenderingCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkPipelineRenderingCreateInfoKHR* toTransform);
+
+void transform_fromhost_VkPipelineRenderingCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkPipelineRenderingCreateInfoKHR* toTransform);
+
+void transform_tohost_VkPhysicalDeviceDynamicRenderingFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDynamicRenderingFeaturesKHR* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceDynamicRenderingFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDynamicRenderingFeaturesKHR* toTransform);
+
+void transform_tohost_VkCommandBufferInheritanceRenderingInfoKHR(
+    ResourceTracker* resourceTracker, VkCommandBufferInheritanceRenderingInfoKHR* toTransform);
+
+void transform_fromhost_VkCommandBufferInheritanceRenderingInfoKHR(
+    ResourceTracker* resourceTracker, VkCommandBufferInheritanceRenderingInfoKHR* toTransform);
+
+void transform_tohost_VkRenderingFragmentShadingRateAttachmentInfoKHR(
+    ResourceTracker* resourceTracker, VkRenderingFragmentShadingRateAttachmentInfoKHR* toTransform);
+
+void transform_fromhost_VkRenderingFragmentShadingRateAttachmentInfoKHR(
+    ResourceTracker* resourceTracker, VkRenderingFragmentShadingRateAttachmentInfoKHR* toTransform);
+
+void transform_tohost_VkRenderingFragmentDensityMapAttachmentInfoEXT(
+    ResourceTracker* resourceTracker, VkRenderingFragmentDensityMapAttachmentInfoEXT* toTransform);
+
+void transform_fromhost_VkRenderingFragmentDensityMapAttachmentInfoEXT(
+    ResourceTracker* resourceTracker, VkRenderingFragmentDensityMapAttachmentInfoEXT* toTransform);
+
+void transform_tohost_VkAttachmentSampleCountInfoAMD(ResourceTracker* resourceTracker,
+                                                     VkAttachmentSampleCountInfoAMD* toTransform);
+
+void transform_fromhost_VkAttachmentSampleCountInfoAMD(ResourceTracker* resourceTracker,
+                                                       VkAttachmentSampleCountInfoAMD* toTransform);
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkAttachmentSampleCountInfoAMD,
+                      transform_tohost_VkAttachmentSampleCountInfoNV)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkAttachmentSampleCountInfoAMD,
+                      transform_fromhost_VkAttachmentSampleCountInfoNV)
+
+void transform_tohost_VkMultiviewPerViewAttributesInfoNVX(
+    ResourceTracker* resourceTracker, VkMultiviewPerViewAttributesInfoNVX* toTransform);
+
+void transform_fromhost_VkMultiviewPerViewAttributesInfoNVX(
+    ResourceTracker* resourceTracker, VkMultiviewPerViewAttributesInfoNVX* toTransform);
+
+#endif
+#ifdef VK_KHR_multiview
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkRenderPassMultiviewCreateInfo,
+                      transform_tohost_VkRenderPassMultiviewCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkRenderPassMultiviewCreateInfo,
+                      transform_fromhost_VkRenderPassMultiviewCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceMultiviewFeatures,
+                      transform_tohost_VkPhysicalDeviceMultiviewFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceMultiviewFeatures,
+                      transform_fromhost_VkPhysicalDeviceMultiviewFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceMultiviewProperties,
+                      transform_tohost_VkPhysicalDeviceMultiviewPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceMultiviewProperties,
+                      transform_fromhost_VkPhysicalDeviceMultiviewPropertiesKHR)
+
+#endif
+#ifdef VK_KHR_get_physical_device_properties2
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceFeatures2,
+                      transform_tohost_VkPhysicalDeviceFeatures2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceFeatures2,
+                      transform_fromhost_VkPhysicalDeviceFeatures2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceProperties2,
+                      transform_tohost_VkPhysicalDeviceProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceProperties2,
+                      transform_fromhost_VkPhysicalDeviceProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkFormatProperties2, transform_tohost_VkFormatProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkFormatProperties2,
+                      transform_fromhost_VkFormatProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkImageFormatProperties2,
+                      transform_tohost_VkImageFormatProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkImageFormatProperties2,
+                      transform_fromhost_VkImageFormatProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceImageFormatInfo2,
+                      transform_tohost_VkPhysicalDeviceImageFormatInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceImageFormatInfo2,
+                      transform_fromhost_VkPhysicalDeviceImageFormatInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkQueueFamilyProperties2,
+                      transform_tohost_VkQueueFamilyProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkQueueFamilyProperties2,
+                      transform_fromhost_VkQueueFamilyProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceMemoryProperties2,
+                      transform_tohost_VkPhysicalDeviceMemoryProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceMemoryProperties2,
+                      transform_fromhost_VkPhysicalDeviceMemoryProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkSparseImageFormatProperties2,
+                      transform_tohost_VkSparseImageFormatProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkSparseImageFormatProperties2,
+                      transform_fromhost_VkSparseImageFormatProperties2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceSparseImageFormatInfo2,
+                      transform_tohost_VkPhysicalDeviceSparseImageFormatInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceSparseImageFormatInfo2,
+                      transform_fromhost_VkPhysicalDeviceSparseImageFormatInfo2KHR)
+
+#endif
+#ifdef VK_KHR_device_group
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkMemoryAllocateFlagsInfo,
+                      transform_tohost_VkMemoryAllocateFlagsInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkMemoryAllocateFlagsInfo,
+                      transform_fromhost_VkMemoryAllocateFlagsInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkDeviceGroupRenderPassBeginInfo,
+                      transform_tohost_VkDeviceGroupRenderPassBeginInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkDeviceGroupRenderPassBeginInfo,
+                      transform_fromhost_VkDeviceGroupRenderPassBeginInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkDeviceGroupCommandBufferBeginInfo,
+                      transform_tohost_VkDeviceGroupCommandBufferBeginInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkDeviceGroupCommandBufferBeginInfo,
+                      transform_fromhost_VkDeviceGroupCommandBufferBeginInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkDeviceGroupSubmitInfo,
+                      transform_tohost_VkDeviceGroupSubmitInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkDeviceGroupSubmitInfo,
+                      transform_fromhost_VkDeviceGroupSubmitInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkDeviceGroupBindSparseInfo,
+                      transform_tohost_VkDeviceGroupBindSparseInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkDeviceGroupBindSparseInfo,
+                      transform_fromhost_VkDeviceGroupBindSparseInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkBindBufferMemoryDeviceGroupInfo,
+                      transform_tohost_VkBindBufferMemoryDeviceGroupInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkBindBufferMemoryDeviceGroupInfo,
+                      transform_fromhost_VkBindBufferMemoryDeviceGroupInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkBindImageMemoryDeviceGroupInfo,
+                      transform_tohost_VkBindImageMemoryDeviceGroupInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkBindImageMemoryDeviceGroupInfo,
+                      transform_fromhost_VkBindImageMemoryDeviceGroupInfoKHR)
+
+#endif
+#ifdef VK_KHR_shader_draw_parameters
+#endif
+#ifdef VK_KHR_maintenance1
+#endif
+#ifdef VK_KHR_device_group_creation
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceGroupProperties,
+                      transform_tohost_VkPhysicalDeviceGroupPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceGroupProperties,
+                      transform_fromhost_VkPhysicalDeviceGroupPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkDeviceGroupDeviceCreateInfo,
+                      transform_tohost_VkDeviceGroupDeviceCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkDeviceGroupDeviceCreateInfo,
+                      transform_fromhost_VkDeviceGroupDeviceCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_external_memory_capabilities
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkExternalMemoryProperties,
+                      transform_tohost_VkExternalMemoryPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkExternalMemoryProperties,
+                      transform_fromhost_VkExternalMemoryPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceExternalImageFormatInfo,
+                      transform_tohost_VkPhysicalDeviceExternalImageFormatInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceExternalImageFormatInfo,
+                      transform_fromhost_VkPhysicalDeviceExternalImageFormatInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkExternalImageFormatProperties,
+                      transform_tohost_VkExternalImageFormatPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkExternalImageFormatProperties,
+                      transform_fromhost_VkExternalImageFormatPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceExternalBufferInfo,
+                      transform_tohost_VkPhysicalDeviceExternalBufferInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceExternalBufferInfo,
+                      transform_fromhost_VkPhysicalDeviceExternalBufferInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkExternalBufferProperties,
+                      transform_tohost_VkExternalBufferPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkExternalBufferProperties,
+                      transform_fromhost_VkExternalBufferPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceIDProperties,
+                      transform_tohost_VkPhysicalDeviceIDPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceIDProperties,
+                      transform_fromhost_VkPhysicalDeviceIDPropertiesKHR)
+
+#endif
+#ifdef VK_KHR_external_memory
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkExternalMemoryImageCreateInfo,
+                      transform_tohost_VkExternalMemoryImageCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkExternalMemoryImageCreateInfo,
+                      transform_fromhost_VkExternalMemoryImageCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkExternalMemoryBufferCreateInfo,
+                      transform_tohost_VkExternalMemoryBufferCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkExternalMemoryBufferCreateInfo,
+                      transform_fromhost_VkExternalMemoryBufferCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkExportMemoryAllocateInfo,
+                      transform_tohost_VkExportMemoryAllocateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkExportMemoryAllocateInfo,
+                      transform_fromhost_VkExportMemoryAllocateInfoKHR)
+
+#endif
+#ifdef VK_KHR_external_memory_win32
+void transform_tohost_VkImportMemoryWin32HandleInfoKHR(
+    ResourceTracker* resourceTracker, VkImportMemoryWin32HandleInfoKHR* toTransform);
+
+void transform_fromhost_VkImportMemoryWin32HandleInfoKHR(
+    ResourceTracker* resourceTracker, VkImportMemoryWin32HandleInfoKHR* toTransform);
+
+void transform_tohost_VkExportMemoryWin32HandleInfoKHR(
+    ResourceTracker* resourceTracker, VkExportMemoryWin32HandleInfoKHR* toTransform);
+
+void transform_fromhost_VkExportMemoryWin32HandleInfoKHR(
+    ResourceTracker* resourceTracker, VkExportMemoryWin32HandleInfoKHR* toTransform);
+
+void transform_tohost_VkMemoryWin32HandlePropertiesKHR(
+    ResourceTracker* resourceTracker, VkMemoryWin32HandlePropertiesKHR* toTransform);
+
+void transform_fromhost_VkMemoryWin32HandlePropertiesKHR(
+    ResourceTracker* resourceTracker, VkMemoryWin32HandlePropertiesKHR* toTransform);
+
+void transform_tohost_VkMemoryGetWin32HandleInfoKHR(ResourceTracker* resourceTracker,
+                                                    VkMemoryGetWin32HandleInfoKHR* toTransform);
+
+void transform_fromhost_VkMemoryGetWin32HandleInfoKHR(ResourceTracker* resourceTracker,
+                                                      VkMemoryGetWin32HandleInfoKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_external_memory_fd
+void transform_tohost_VkImportMemoryFdInfoKHR(ResourceTracker* resourceTracker,
+                                              VkImportMemoryFdInfoKHR* toTransform);
+
+void transform_fromhost_VkImportMemoryFdInfoKHR(ResourceTracker* resourceTracker,
+                                                VkImportMemoryFdInfoKHR* toTransform);
+
+void transform_tohost_VkMemoryFdPropertiesKHR(ResourceTracker* resourceTracker,
+                                              VkMemoryFdPropertiesKHR* toTransform);
+
+void transform_fromhost_VkMemoryFdPropertiesKHR(ResourceTracker* resourceTracker,
+                                                VkMemoryFdPropertiesKHR* toTransform);
+
+void transform_tohost_VkMemoryGetFdInfoKHR(ResourceTracker* resourceTracker,
+                                           VkMemoryGetFdInfoKHR* toTransform);
+
+void transform_fromhost_VkMemoryGetFdInfoKHR(ResourceTracker* resourceTracker,
+                                             VkMemoryGetFdInfoKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_win32_keyed_mutex
+void transform_tohost_VkWin32KeyedMutexAcquireReleaseInfoKHR(
+    ResourceTracker* resourceTracker, VkWin32KeyedMutexAcquireReleaseInfoKHR* toTransform);
+
+void transform_fromhost_VkWin32KeyedMutexAcquireReleaseInfoKHR(
+    ResourceTracker* resourceTracker, VkWin32KeyedMutexAcquireReleaseInfoKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_external_semaphore_capabilities
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceExternalSemaphoreInfo,
+                      transform_tohost_VkPhysicalDeviceExternalSemaphoreInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceExternalSemaphoreInfo,
+                      transform_fromhost_VkPhysicalDeviceExternalSemaphoreInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkExternalSemaphoreProperties,
+                      transform_tohost_VkExternalSemaphorePropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkExternalSemaphoreProperties,
+                      transform_fromhost_VkExternalSemaphorePropertiesKHR)
+
+#endif
+#ifdef VK_KHR_external_semaphore
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkExportSemaphoreCreateInfo,
+                      transform_tohost_VkExportSemaphoreCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkExportSemaphoreCreateInfo,
+                      transform_fromhost_VkExportSemaphoreCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_external_semaphore_win32
+void transform_tohost_VkImportSemaphoreWin32HandleInfoKHR(
+    ResourceTracker* resourceTracker, VkImportSemaphoreWin32HandleInfoKHR* toTransform);
+
+void transform_fromhost_VkImportSemaphoreWin32HandleInfoKHR(
+    ResourceTracker* resourceTracker, VkImportSemaphoreWin32HandleInfoKHR* toTransform);
+
+void transform_tohost_VkExportSemaphoreWin32HandleInfoKHR(
+    ResourceTracker* resourceTracker, VkExportSemaphoreWin32HandleInfoKHR* toTransform);
+
+void transform_fromhost_VkExportSemaphoreWin32HandleInfoKHR(
+    ResourceTracker* resourceTracker, VkExportSemaphoreWin32HandleInfoKHR* toTransform);
+
+void transform_tohost_VkD3D12FenceSubmitInfoKHR(ResourceTracker* resourceTracker,
+                                                VkD3D12FenceSubmitInfoKHR* toTransform);
+
+void transform_fromhost_VkD3D12FenceSubmitInfoKHR(ResourceTracker* resourceTracker,
+                                                  VkD3D12FenceSubmitInfoKHR* toTransform);
+
+void transform_tohost_VkSemaphoreGetWin32HandleInfoKHR(
+    ResourceTracker* resourceTracker, VkSemaphoreGetWin32HandleInfoKHR* toTransform);
+
+void transform_fromhost_VkSemaphoreGetWin32HandleInfoKHR(
+    ResourceTracker* resourceTracker, VkSemaphoreGetWin32HandleInfoKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_external_semaphore_fd
+void transform_tohost_VkImportSemaphoreFdInfoKHR(ResourceTracker* resourceTracker,
+                                                 VkImportSemaphoreFdInfoKHR* toTransform);
+
+void transform_fromhost_VkImportSemaphoreFdInfoKHR(ResourceTracker* resourceTracker,
+                                                   VkImportSemaphoreFdInfoKHR* toTransform);
+
+void transform_tohost_VkSemaphoreGetFdInfoKHR(ResourceTracker* resourceTracker,
+                                              VkSemaphoreGetFdInfoKHR* toTransform);
+
+void transform_fromhost_VkSemaphoreGetFdInfoKHR(ResourceTracker* resourceTracker,
+                                                VkSemaphoreGetFdInfoKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_push_descriptor
+void transform_tohost_VkPhysicalDevicePushDescriptorPropertiesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePushDescriptorPropertiesKHR* toTransform);
+
+void transform_fromhost_VkPhysicalDevicePushDescriptorPropertiesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePushDescriptorPropertiesKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_shader_float16_int8
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceShaderFloat16Int8Features,
+                      transform_tohost_VkPhysicalDeviceShaderFloat16Int8FeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceShaderFloat16Int8Features,
+                      transform_fromhost_VkPhysicalDeviceShaderFloat16Int8FeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceShaderFloat16Int8Features,
+                      transform_tohost_VkPhysicalDeviceFloat16Int8FeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceShaderFloat16Int8Features,
+                      transform_fromhost_VkPhysicalDeviceFloat16Int8FeaturesKHR)
+
+#endif
+#ifdef VK_KHR_16bit_storage
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDevice16BitStorageFeatures,
+                      transform_tohost_VkPhysicalDevice16BitStorageFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDevice16BitStorageFeatures,
+                      transform_fromhost_VkPhysicalDevice16BitStorageFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_incremental_present
+void transform_tohost_VkRectLayerKHR(ResourceTracker* resourceTracker, VkRectLayerKHR* toTransform);
+
+void transform_fromhost_VkRectLayerKHR(ResourceTracker* resourceTracker,
+                                       VkRectLayerKHR* toTransform);
+
+void transform_tohost_VkPresentRegionKHR(ResourceTracker* resourceTracker,
+                                         VkPresentRegionKHR* toTransform);
+
+void transform_fromhost_VkPresentRegionKHR(ResourceTracker* resourceTracker,
+                                           VkPresentRegionKHR* toTransform);
+
+void transform_tohost_VkPresentRegionsKHR(ResourceTracker* resourceTracker,
+                                          VkPresentRegionsKHR* toTransform);
+
+void transform_fromhost_VkPresentRegionsKHR(ResourceTracker* resourceTracker,
+                                            VkPresentRegionsKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_descriptor_update_template
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkDescriptorUpdateTemplateEntry,
+                      transform_tohost_VkDescriptorUpdateTemplateEntryKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkDescriptorUpdateTemplateEntry,
+                      transform_fromhost_VkDescriptorUpdateTemplateEntryKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkDescriptorUpdateTemplateCreateInfo,
+                      transform_tohost_VkDescriptorUpdateTemplateCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkDescriptorUpdateTemplateCreateInfo,
+                      transform_fromhost_VkDescriptorUpdateTemplateCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_imageless_framebuffer
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceImagelessFramebufferFeatures,
+                      transform_tohost_VkPhysicalDeviceImagelessFramebufferFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceImagelessFramebufferFeatures,
+                      transform_fromhost_VkPhysicalDeviceImagelessFramebufferFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkFramebufferAttachmentsCreateInfo,
+                      transform_tohost_VkFramebufferAttachmentsCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkFramebufferAttachmentsCreateInfo,
+                      transform_fromhost_VkFramebufferAttachmentsCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkFramebufferAttachmentImageInfo,
+                      transform_tohost_VkFramebufferAttachmentImageInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkFramebufferAttachmentImageInfo,
+                      transform_fromhost_VkFramebufferAttachmentImageInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkRenderPassAttachmentBeginInfo,
+                      transform_tohost_VkRenderPassAttachmentBeginInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkRenderPassAttachmentBeginInfo,
+                      transform_fromhost_VkRenderPassAttachmentBeginInfoKHR)
+
+#endif
+#ifdef VK_KHR_create_renderpass2
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkRenderPassCreateInfo2,
+                      transform_tohost_VkRenderPassCreateInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkRenderPassCreateInfo2,
+                      transform_fromhost_VkRenderPassCreateInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkAttachmentDescription2,
+                      transform_tohost_VkAttachmentDescription2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkAttachmentDescription2,
+                      transform_fromhost_VkAttachmentDescription2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkAttachmentReference2,
+                      transform_tohost_VkAttachmentReference2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkAttachmentReference2,
+                      transform_fromhost_VkAttachmentReference2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkSubpassDescription2,
+                      transform_tohost_VkSubpassDescription2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkSubpassDescription2,
+                      transform_fromhost_VkSubpassDescription2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkSubpassDependency2,
+                      transform_tohost_VkSubpassDependency2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkSubpassDependency2,
+                      transform_fromhost_VkSubpassDependency2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkSubpassBeginInfo, transform_tohost_VkSubpassBeginInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkSubpassBeginInfo,
+                      transform_fromhost_VkSubpassBeginInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkSubpassEndInfo, transform_tohost_VkSubpassEndInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkSubpassEndInfo, transform_fromhost_VkSubpassEndInfoKHR)
+
+#endif
+#ifdef VK_KHR_shared_presentable_image
+void transform_tohost_VkSharedPresentSurfaceCapabilitiesKHR(
+    ResourceTracker* resourceTracker, VkSharedPresentSurfaceCapabilitiesKHR* toTransform);
+
+void transform_fromhost_VkSharedPresentSurfaceCapabilitiesKHR(
+    ResourceTracker* resourceTracker, VkSharedPresentSurfaceCapabilitiesKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_external_fence_capabilities
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceExternalFenceInfo,
+                      transform_tohost_VkPhysicalDeviceExternalFenceInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceExternalFenceInfo,
+                      transform_fromhost_VkPhysicalDeviceExternalFenceInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkExternalFenceProperties,
+                      transform_tohost_VkExternalFencePropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkExternalFenceProperties,
+                      transform_fromhost_VkExternalFencePropertiesKHR)
+
+#endif
+#ifdef VK_KHR_external_fence
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkExportFenceCreateInfo,
+                      transform_tohost_VkExportFenceCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkExportFenceCreateInfo,
+                      transform_fromhost_VkExportFenceCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_external_fence_win32
+void transform_tohost_VkImportFenceWin32HandleInfoKHR(ResourceTracker* resourceTracker,
+                                                      VkImportFenceWin32HandleInfoKHR* toTransform);
+
+void transform_fromhost_VkImportFenceWin32HandleInfoKHR(
+    ResourceTracker* resourceTracker, VkImportFenceWin32HandleInfoKHR* toTransform);
+
+void transform_tohost_VkExportFenceWin32HandleInfoKHR(ResourceTracker* resourceTracker,
+                                                      VkExportFenceWin32HandleInfoKHR* toTransform);
+
+void transform_fromhost_VkExportFenceWin32HandleInfoKHR(
+    ResourceTracker* resourceTracker, VkExportFenceWin32HandleInfoKHR* toTransform);
+
+void transform_tohost_VkFenceGetWin32HandleInfoKHR(ResourceTracker* resourceTracker,
+                                                   VkFenceGetWin32HandleInfoKHR* toTransform);
+
+void transform_fromhost_VkFenceGetWin32HandleInfoKHR(ResourceTracker* resourceTracker,
+                                                     VkFenceGetWin32HandleInfoKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_external_fence_fd
+void transform_tohost_VkImportFenceFdInfoKHR(ResourceTracker* resourceTracker,
+                                             VkImportFenceFdInfoKHR* toTransform);
+
+void transform_fromhost_VkImportFenceFdInfoKHR(ResourceTracker* resourceTracker,
+                                               VkImportFenceFdInfoKHR* toTransform);
+
+void transform_tohost_VkFenceGetFdInfoKHR(ResourceTracker* resourceTracker,
+                                          VkFenceGetFdInfoKHR* toTransform);
+
+void transform_fromhost_VkFenceGetFdInfoKHR(ResourceTracker* resourceTracker,
+                                            VkFenceGetFdInfoKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_performance_query
+void transform_tohost_VkPhysicalDevicePerformanceQueryFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePerformanceQueryFeaturesKHR* toTransform);
+
+void transform_fromhost_VkPhysicalDevicePerformanceQueryFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePerformanceQueryFeaturesKHR* toTransform);
+
+void transform_tohost_VkPhysicalDevicePerformanceQueryPropertiesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePerformanceQueryPropertiesKHR* toTransform);
+
+void transform_fromhost_VkPhysicalDevicePerformanceQueryPropertiesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePerformanceQueryPropertiesKHR* toTransform);
+
+void transform_tohost_VkPerformanceCounterKHR(ResourceTracker* resourceTracker,
+                                              VkPerformanceCounterKHR* toTransform);
+
+void transform_fromhost_VkPerformanceCounterKHR(ResourceTracker* resourceTracker,
+                                                VkPerformanceCounterKHR* toTransform);
+
+void transform_tohost_VkPerformanceCounterDescriptionKHR(
+    ResourceTracker* resourceTracker, VkPerformanceCounterDescriptionKHR* toTransform);
+
+void transform_fromhost_VkPerformanceCounterDescriptionKHR(
+    ResourceTracker* resourceTracker, VkPerformanceCounterDescriptionKHR* toTransform);
+
+void transform_tohost_VkQueryPoolPerformanceCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkQueryPoolPerformanceCreateInfoKHR* toTransform);
+
+void transform_fromhost_VkQueryPoolPerformanceCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkQueryPoolPerformanceCreateInfoKHR* toTransform);
+
+void transform_tohost_VkPerformanceCounterResultKHR(ResourceTracker* resourceTracker,
+                                                    VkPerformanceCounterResultKHR* toTransform);
+
+void transform_fromhost_VkPerformanceCounterResultKHR(ResourceTracker* resourceTracker,
+                                                      VkPerformanceCounterResultKHR* toTransform);
+
+void transform_tohost_VkAcquireProfilingLockInfoKHR(ResourceTracker* resourceTracker,
+                                                    VkAcquireProfilingLockInfoKHR* toTransform);
+
+void transform_fromhost_VkAcquireProfilingLockInfoKHR(ResourceTracker* resourceTracker,
+                                                      VkAcquireProfilingLockInfoKHR* toTransform);
+
+void transform_tohost_VkPerformanceQuerySubmitInfoKHR(ResourceTracker* resourceTracker,
+                                                      VkPerformanceQuerySubmitInfoKHR* toTransform);
+
+void transform_fromhost_VkPerformanceQuerySubmitInfoKHR(
+    ResourceTracker* resourceTracker, VkPerformanceQuerySubmitInfoKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_maintenance2
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDevicePointClippingProperties,
+                      transform_tohost_VkPhysicalDevicePointClippingPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDevicePointClippingProperties,
+                      transform_fromhost_VkPhysicalDevicePointClippingPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkRenderPassInputAttachmentAspectCreateInfo,
+                      transform_tohost_VkRenderPassInputAttachmentAspectCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkRenderPassInputAttachmentAspectCreateInfo,
+                      transform_fromhost_VkRenderPassInputAttachmentAspectCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkInputAttachmentAspectReference,
+                      transform_tohost_VkInputAttachmentAspectReferenceKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkInputAttachmentAspectReference,
+                      transform_fromhost_VkInputAttachmentAspectReferenceKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkImageViewUsageCreateInfo,
+                      transform_tohost_VkImageViewUsageCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkImageViewUsageCreateInfo,
+                      transform_fromhost_VkImageViewUsageCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPipelineTessellationDomainOriginStateCreateInfo,
+                      transform_tohost_VkPipelineTessellationDomainOriginStateCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPipelineTessellationDomainOriginStateCreateInfo,
+                      transform_fromhost_VkPipelineTessellationDomainOriginStateCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_get_surface_capabilities2
+void transform_tohost_VkPhysicalDeviceSurfaceInfo2KHR(ResourceTracker* resourceTracker,
+                                                      VkPhysicalDeviceSurfaceInfo2KHR* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceSurfaceInfo2KHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSurfaceInfo2KHR* toTransform);
+
+void transform_tohost_VkSurfaceCapabilities2KHR(ResourceTracker* resourceTracker,
+                                                VkSurfaceCapabilities2KHR* toTransform);
+
+void transform_fromhost_VkSurfaceCapabilities2KHR(ResourceTracker* resourceTracker,
+                                                  VkSurfaceCapabilities2KHR* toTransform);
+
+void transform_tohost_VkSurfaceFormat2KHR(ResourceTracker* resourceTracker,
+                                          VkSurfaceFormat2KHR* toTransform);
+
+void transform_fromhost_VkSurfaceFormat2KHR(ResourceTracker* resourceTracker,
+                                            VkSurfaceFormat2KHR* toTransform);
+
+#endif
+#ifdef VK_KHR_variable_pointers
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceVariablePointersFeatures,
+                      transform_tohost_VkPhysicalDeviceVariablePointerFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceVariablePointersFeatures,
+                      transform_fromhost_VkPhysicalDeviceVariablePointerFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceVariablePointersFeatures,
+                      transform_tohost_VkPhysicalDeviceVariablePointersFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceVariablePointersFeatures,
+                      transform_fromhost_VkPhysicalDeviceVariablePointersFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_get_display_properties2
+void transform_tohost_VkDisplayProperties2KHR(ResourceTracker* resourceTracker,
+                                              VkDisplayProperties2KHR* toTransform);
+
+void transform_fromhost_VkDisplayProperties2KHR(ResourceTracker* resourceTracker,
+                                                VkDisplayProperties2KHR* toTransform);
+
+void transform_tohost_VkDisplayPlaneProperties2KHR(ResourceTracker* resourceTracker,
+                                                   VkDisplayPlaneProperties2KHR* toTransform);
+
+void transform_fromhost_VkDisplayPlaneProperties2KHR(ResourceTracker* resourceTracker,
+                                                     VkDisplayPlaneProperties2KHR* toTransform);
+
+void transform_tohost_VkDisplayModeProperties2KHR(ResourceTracker* resourceTracker,
+                                                  VkDisplayModeProperties2KHR* toTransform);
+
+void transform_fromhost_VkDisplayModeProperties2KHR(ResourceTracker* resourceTracker,
+                                                    VkDisplayModeProperties2KHR* toTransform);
+
+void transform_tohost_VkDisplayPlaneInfo2KHR(ResourceTracker* resourceTracker,
+                                             VkDisplayPlaneInfo2KHR* toTransform);
+
+void transform_fromhost_VkDisplayPlaneInfo2KHR(ResourceTracker* resourceTracker,
+                                               VkDisplayPlaneInfo2KHR* toTransform);
+
+void transform_tohost_VkDisplayPlaneCapabilities2KHR(ResourceTracker* resourceTracker,
+                                                     VkDisplayPlaneCapabilities2KHR* toTransform);
+
+void transform_fromhost_VkDisplayPlaneCapabilities2KHR(ResourceTracker* resourceTracker,
+                                                       VkDisplayPlaneCapabilities2KHR* toTransform);
+
+#endif
+#ifdef VK_KHR_dedicated_allocation
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkMemoryDedicatedRequirements,
+                      transform_tohost_VkMemoryDedicatedRequirementsKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkMemoryDedicatedRequirements,
+                      transform_fromhost_VkMemoryDedicatedRequirementsKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkMemoryDedicatedAllocateInfo,
+                      transform_tohost_VkMemoryDedicatedAllocateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkMemoryDedicatedAllocateInfo,
+                      transform_fromhost_VkMemoryDedicatedAllocateInfoKHR)
+
+#endif
+#ifdef VK_KHR_storage_buffer_storage_class
+#endif
+#ifdef VK_KHR_relaxed_block_layout
+#endif
+#ifdef VK_KHR_get_memory_requirements2
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkBufferMemoryRequirementsInfo2,
+                      transform_tohost_VkBufferMemoryRequirementsInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkBufferMemoryRequirementsInfo2,
+                      transform_fromhost_VkBufferMemoryRequirementsInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkImageMemoryRequirementsInfo2,
+                      transform_tohost_VkImageMemoryRequirementsInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkImageMemoryRequirementsInfo2,
+                      transform_fromhost_VkImageMemoryRequirementsInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkImageSparseMemoryRequirementsInfo2,
+                      transform_tohost_VkImageSparseMemoryRequirementsInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkImageSparseMemoryRequirementsInfo2,
+                      transform_fromhost_VkImageSparseMemoryRequirementsInfo2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkMemoryRequirements2,
+                      transform_tohost_VkMemoryRequirements2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkMemoryRequirements2,
+                      transform_fromhost_VkMemoryRequirements2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkSparseImageMemoryRequirements2,
+                      transform_tohost_VkSparseImageMemoryRequirements2KHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkSparseImageMemoryRequirements2,
+                      transform_fromhost_VkSparseImageMemoryRequirements2KHR)
+
+#endif
+#ifdef VK_KHR_image_format_list
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkImageFormatListCreateInfo,
+                      transform_tohost_VkImageFormatListCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkImageFormatListCreateInfo,
+                      transform_fromhost_VkImageFormatListCreateInfoKHR)
+
+#endif
+#ifdef VK_KHR_sampler_ycbcr_conversion
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkSamplerYcbcrConversionCreateInfo,
+                      transform_tohost_VkSamplerYcbcrConversionCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkSamplerYcbcrConversionCreateInfo,
+                      transform_fromhost_VkSamplerYcbcrConversionCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkSamplerYcbcrConversionInfo,
+                      transform_tohost_VkSamplerYcbcrConversionInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkSamplerYcbcrConversionInfo,
+                      transform_fromhost_VkSamplerYcbcrConversionInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkBindImagePlaneMemoryInfo,
+                      transform_tohost_VkBindImagePlaneMemoryInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkBindImagePlaneMemoryInfo,
+                      transform_fromhost_VkBindImagePlaneMemoryInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkImagePlaneMemoryRequirementsInfo,
+                      transform_tohost_VkImagePlaneMemoryRequirementsInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkImagePlaneMemoryRequirementsInfo,
+                      transform_fromhost_VkImagePlaneMemoryRequirementsInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceSamplerYcbcrConversionFeatures,
+                      transform_tohost_VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceSamplerYcbcrConversionFeatures,
+                      transform_fromhost_VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkSamplerYcbcrConversionImageFormatProperties,
+                      transform_tohost_VkSamplerYcbcrConversionImageFormatPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkSamplerYcbcrConversionImageFormatProperties,
+                      transform_fromhost_VkSamplerYcbcrConversionImageFormatPropertiesKHR)
+
+#endif
+#ifdef VK_KHR_bind_memory2
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkBindBufferMemoryInfo,
+                      transform_tohost_VkBindBufferMemoryInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkBindBufferMemoryInfo,
+                      transform_fromhost_VkBindBufferMemoryInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkBindImageMemoryInfo,
+                      transform_tohost_VkBindImageMemoryInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkBindImageMemoryInfo,
+                      transform_fromhost_VkBindImageMemoryInfoKHR)
+
+#endif
+#ifdef VK_KHR_portability_subset
+void transform_tohost_VkPhysicalDevicePortabilitySubsetFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePortabilitySubsetFeaturesKHR* toTransform);
+
+void transform_fromhost_VkPhysicalDevicePortabilitySubsetFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePortabilitySubsetFeaturesKHR* toTransform);
+
+void transform_tohost_VkPhysicalDevicePortabilitySubsetPropertiesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePortabilitySubsetPropertiesKHR* toTransform);
+
+void transform_fromhost_VkPhysicalDevicePortabilitySubsetPropertiesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePortabilitySubsetPropertiesKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_maintenance3
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceMaintenance3Properties,
+                      transform_tohost_VkPhysicalDeviceMaintenance3PropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceMaintenance3Properties,
+                      transform_fromhost_VkPhysicalDeviceMaintenance3PropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkDescriptorSetLayoutSupport,
+                      transform_tohost_VkDescriptorSetLayoutSupportKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkDescriptorSetLayoutSupport,
+                      transform_fromhost_VkDescriptorSetLayoutSupportKHR)
+
+#endif
+#ifdef VK_KHR_draw_indirect_count
+#endif
+#ifdef VK_KHR_shader_subgroup_extended_types
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures,
+                      transform_tohost_VkPhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures,
+                      transform_fromhost_VkPhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_8bit_storage
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDevice8BitStorageFeatures,
+                      transform_tohost_VkPhysicalDevice8BitStorageFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDevice8BitStorageFeatures,
+                      transform_fromhost_VkPhysicalDevice8BitStorageFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_shader_atomic_int64
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceShaderAtomicInt64Features,
+                      transform_tohost_VkPhysicalDeviceShaderAtomicInt64FeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceShaderAtomicInt64Features,
+                      transform_fromhost_VkPhysicalDeviceShaderAtomicInt64FeaturesKHR)
+
+#endif
+#ifdef VK_KHR_shader_clock
+void transform_tohost_VkPhysicalDeviceShaderClockFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderClockFeaturesKHR* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceShaderClockFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderClockFeaturesKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_driver_properties
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkConformanceVersion,
+                      transform_tohost_VkConformanceVersionKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkConformanceVersion,
+                      transform_fromhost_VkConformanceVersionKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceDriverProperties,
+                      transform_tohost_VkPhysicalDeviceDriverPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceDriverProperties,
+                      transform_fromhost_VkPhysicalDeviceDriverPropertiesKHR)
+
+#endif
+#ifdef VK_KHR_shader_float_controls
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceFloatControlsProperties,
+                      transform_tohost_VkPhysicalDeviceFloatControlsPropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceFloatControlsProperties,
+                      transform_fromhost_VkPhysicalDeviceFloatControlsPropertiesKHR)
+
+#endif
+#ifdef VK_KHR_depth_stencil_resolve
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkSubpassDescriptionDepthStencilResolve,
+                      transform_tohost_VkSubpassDescriptionDepthStencilResolveKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkSubpassDescriptionDepthStencilResolve,
+                      transform_fromhost_VkSubpassDescriptionDepthStencilResolveKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceDepthStencilResolveProperties,
+                      transform_tohost_VkPhysicalDeviceDepthStencilResolvePropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceDepthStencilResolveProperties,
+                      transform_fromhost_VkPhysicalDeviceDepthStencilResolvePropertiesKHR)
+
+#endif
+#ifdef VK_KHR_swapchain_mutable_format
+#endif
+#ifdef VK_KHR_timeline_semaphore
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceTimelineSemaphoreFeatures,
+                      transform_tohost_VkPhysicalDeviceTimelineSemaphoreFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceTimelineSemaphoreFeatures,
+                      transform_fromhost_VkPhysicalDeviceTimelineSemaphoreFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceTimelineSemaphoreProperties,
+                      transform_tohost_VkPhysicalDeviceTimelineSemaphorePropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceTimelineSemaphoreProperties,
+                      transform_fromhost_VkPhysicalDeviceTimelineSemaphorePropertiesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkSemaphoreTypeCreateInfo,
+                      transform_tohost_VkSemaphoreTypeCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkSemaphoreTypeCreateInfo,
+                      transform_fromhost_VkSemaphoreTypeCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkTimelineSemaphoreSubmitInfo,
+                      transform_tohost_VkTimelineSemaphoreSubmitInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkTimelineSemaphoreSubmitInfo,
+                      transform_fromhost_VkTimelineSemaphoreSubmitInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkSemaphoreWaitInfo, transform_tohost_VkSemaphoreWaitInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkSemaphoreWaitInfo,
+                      transform_fromhost_VkSemaphoreWaitInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkSemaphoreSignalInfo,
+                      transform_tohost_VkSemaphoreSignalInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkSemaphoreSignalInfo,
+                      transform_fromhost_VkSemaphoreSignalInfoKHR)
+
+#endif
+#ifdef VK_KHR_vulkan_memory_model
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceVulkanMemoryModelFeatures,
+                      transform_tohost_VkPhysicalDeviceVulkanMemoryModelFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceVulkanMemoryModelFeatures,
+                      transform_fromhost_VkPhysicalDeviceVulkanMemoryModelFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_shader_terminate_invocation
+void transform_tohost_VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_fragment_shading_rate
+void transform_tohost_VkFragmentShadingRateAttachmentInfoKHR(
+    ResourceTracker* resourceTracker, VkFragmentShadingRateAttachmentInfoKHR* toTransform);
+
+void transform_fromhost_VkFragmentShadingRateAttachmentInfoKHR(
+    ResourceTracker* resourceTracker, VkFragmentShadingRateAttachmentInfoKHR* toTransform);
+
+void transform_tohost_VkPipelineFragmentShadingRateStateCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkPipelineFragmentShadingRateStateCreateInfoKHR* toTransform);
+
+void transform_fromhost_VkPipelineFragmentShadingRateStateCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkPipelineFragmentShadingRateStateCreateInfoKHR* toTransform);
+
+void transform_tohost_VkPhysicalDeviceFragmentShadingRateFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceFragmentShadingRateFeaturesKHR* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceFragmentShadingRateFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceFragmentShadingRateFeaturesKHR* toTransform);
+
+void transform_tohost_VkPhysicalDeviceFragmentShadingRatePropertiesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceFragmentShadingRatePropertiesKHR* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceFragmentShadingRatePropertiesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceFragmentShadingRatePropertiesKHR* toTransform);
+
+void transform_tohost_VkPhysicalDeviceFragmentShadingRateKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceFragmentShadingRateKHR* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceFragmentShadingRateKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceFragmentShadingRateKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_spirv_1_4
+#endif
+#ifdef VK_KHR_surface_protected_capabilities
+void transform_tohost_VkSurfaceProtectedCapabilitiesKHR(
+    ResourceTracker* resourceTracker, VkSurfaceProtectedCapabilitiesKHR* toTransform);
+
+void transform_fromhost_VkSurfaceProtectedCapabilitiesKHR(
+    ResourceTracker* resourceTracker, VkSurfaceProtectedCapabilitiesKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_separate_depth_stencil_layouts
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures,
+                      transform_tohost_VkPhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures,
+                      transform_fromhost_VkPhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkAttachmentReferenceStencilLayout,
+                      transform_tohost_VkAttachmentReferenceStencilLayoutKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkAttachmentReferenceStencilLayout,
+                      transform_fromhost_VkAttachmentReferenceStencilLayoutKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkAttachmentDescriptionStencilLayout,
+                      transform_tohost_VkAttachmentDescriptionStencilLayoutKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkAttachmentDescriptionStencilLayout,
+                      transform_fromhost_VkAttachmentDescriptionStencilLayoutKHR)
+
+#endif
+#ifdef VK_KHR_present_wait
+void transform_tohost_VkPhysicalDevicePresentWaitFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePresentWaitFeaturesKHR* toTransform);
+
+void transform_fromhost_VkPhysicalDevicePresentWaitFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePresentWaitFeaturesKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_uniform_buffer_standard_layout
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceUniformBufferStandardLayoutFeatures,
+                      transform_tohost_VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceUniformBufferStandardLayoutFeatures,
+                      transform_fromhost_VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR)
+
+#endif
+#ifdef VK_KHR_buffer_device_address
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceBufferDeviceAddressFeatures,
+                      transform_tohost_VkPhysicalDeviceBufferDeviceAddressFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceBufferDeviceAddressFeatures,
+                      transform_fromhost_VkPhysicalDeviceBufferDeviceAddressFeaturesKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkBufferDeviceAddressInfo,
+                      transform_tohost_VkBufferDeviceAddressInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkBufferDeviceAddressInfo,
+                      transform_fromhost_VkBufferDeviceAddressInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkBufferOpaqueCaptureAddressCreateInfo,
+                      transform_tohost_VkBufferOpaqueCaptureAddressCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkBufferOpaqueCaptureAddressCreateInfo,
+                      transform_fromhost_VkBufferOpaqueCaptureAddressCreateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkMemoryOpaqueCaptureAddressAllocateInfo,
+                      transform_tohost_VkMemoryOpaqueCaptureAddressAllocateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkMemoryOpaqueCaptureAddressAllocateInfo,
+                      transform_fromhost_VkMemoryOpaqueCaptureAddressAllocateInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkDeviceMemoryOpaqueCaptureAddressInfo,
+                      transform_tohost_VkDeviceMemoryOpaqueCaptureAddressInfoKHR)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkDeviceMemoryOpaqueCaptureAddressInfo,
+                      transform_fromhost_VkDeviceMemoryOpaqueCaptureAddressInfoKHR)
+
+#endif
+#ifdef VK_KHR_deferred_host_operations
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+void transform_tohost_VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR* toTransform);
+
+void transform_fromhost_VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR* toTransform);
+
+void transform_tohost_VkPipelineInfoKHR(ResourceTracker* resourceTracker,
+                                        VkPipelineInfoKHR* toTransform);
+
+void transform_fromhost_VkPipelineInfoKHR(ResourceTracker* resourceTracker,
+                                          VkPipelineInfoKHR* toTransform);
+
+void transform_tohost_VkPipelineExecutablePropertiesKHR(
+    ResourceTracker* resourceTracker, VkPipelineExecutablePropertiesKHR* toTransform);
+
+void transform_fromhost_VkPipelineExecutablePropertiesKHR(
+    ResourceTracker* resourceTracker, VkPipelineExecutablePropertiesKHR* toTransform);
+
+void transform_tohost_VkPipelineExecutableInfoKHR(ResourceTracker* resourceTracker,
+                                                  VkPipelineExecutableInfoKHR* toTransform);
+
+void transform_fromhost_VkPipelineExecutableInfoKHR(ResourceTracker* resourceTracker,
+                                                    VkPipelineExecutableInfoKHR* toTransform);
+
+void transform_tohost_VkPipelineExecutableStatisticValueKHR(
+    ResourceTracker* resourceTracker, VkPipelineExecutableStatisticValueKHR* toTransform);
+
+void transform_fromhost_VkPipelineExecutableStatisticValueKHR(
+    ResourceTracker* resourceTracker, VkPipelineExecutableStatisticValueKHR* toTransform);
+
+void transform_tohost_VkPipelineExecutableStatisticKHR(
+    ResourceTracker* resourceTracker, VkPipelineExecutableStatisticKHR* toTransform);
+
+void transform_fromhost_VkPipelineExecutableStatisticKHR(
+    ResourceTracker* resourceTracker, VkPipelineExecutableStatisticKHR* toTransform);
+
+void transform_tohost_VkPipelineExecutableInternalRepresentationKHR(
+    ResourceTracker* resourceTracker, VkPipelineExecutableInternalRepresentationKHR* toTransform);
+
+void transform_fromhost_VkPipelineExecutableInternalRepresentationKHR(
+    ResourceTracker* resourceTracker, VkPipelineExecutableInternalRepresentationKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_shader_integer_dot_product
+void transform_tohost_VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR* toTransform);
+
+void transform_tohost_VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_pipeline_library
+void transform_tohost_VkPipelineLibraryCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                     VkPipelineLibraryCreateInfoKHR* toTransform);
+
+void transform_fromhost_VkPipelineLibraryCreateInfoKHR(ResourceTracker* resourceTracker,
+                                                       VkPipelineLibraryCreateInfoKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_shader_non_semantic_info
+#endif
+#ifdef VK_KHR_present_id
+void transform_tohost_VkPresentIdKHR(ResourceTracker* resourceTracker, VkPresentIdKHR* toTransform);
+
+void transform_fromhost_VkPresentIdKHR(ResourceTracker* resourceTracker,
+                                       VkPresentIdKHR* toTransform);
+
+void transform_tohost_VkPhysicalDevicePresentIdFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePresentIdFeaturesKHR* toTransform);
+
+void transform_fromhost_VkPhysicalDevicePresentIdFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePresentIdFeaturesKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_video_encode_queue
+void transform_tohost_VkVideoEncodeInfoKHR(ResourceTracker* resourceTracker,
+                                           VkVideoEncodeInfoKHR* toTransform);
+
+void transform_fromhost_VkVideoEncodeInfoKHR(ResourceTracker* resourceTracker,
+                                             VkVideoEncodeInfoKHR* toTransform);
+
+void transform_tohost_VkVideoEncodeRateControlInfoKHR(ResourceTracker* resourceTracker,
+                                                      VkVideoEncodeRateControlInfoKHR* toTransform);
+
+void transform_fromhost_VkVideoEncodeRateControlInfoKHR(
+    ResourceTracker* resourceTracker, VkVideoEncodeRateControlInfoKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_synchronization2
+void transform_tohost_VkMemoryBarrier2KHR(ResourceTracker* resourceTracker,
+                                          VkMemoryBarrier2KHR* toTransform);
+
+void transform_fromhost_VkMemoryBarrier2KHR(ResourceTracker* resourceTracker,
+                                            VkMemoryBarrier2KHR* toTransform);
+
+void transform_tohost_VkBufferMemoryBarrier2KHR(ResourceTracker* resourceTracker,
+                                                VkBufferMemoryBarrier2KHR* toTransform);
+
+void transform_fromhost_VkBufferMemoryBarrier2KHR(ResourceTracker* resourceTracker,
+                                                  VkBufferMemoryBarrier2KHR* toTransform);
+
+void transform_tohost_VkImageMemoryBarrier2KHR(ResourceTracker* resourceTracker,
+                                               VkImageMemoryBarrier2KHR* toTransform);
+
+void transform_fromhost_VkImageMemoryBarrier2KHR(ResourceTracker* resourceTracker,
+                                                 VkImageMemoryBarrier2KHR* toTransform);
+
+void transform_tohost_VkDependencyInfoKHR(ResourceTracker* resourceTracker,
+                                          VkDependencyInfoKHR* toTransform);
+
+void transform_fromhost_VkDependencyInfoKHR(ResourceTracker* resourceTracker,
+                                            VkDependencyInfoKHR* toTransform);
+
+void transform_tohost_VkSemaphoreSubmitInfoKHR(ResourceTracker* resourceTracker,
+                                               VkSemaphoreSubmitInfoKHR* toTransform);
+
+void transform_fromhost_VkSemaphoreSubmitInfoKHR(ResourceTracker* resourceTracker,
+                                                 VkSemaphoreSubmitInfoKHR* toTransform);
+
+void transform_tohost_VkCommandBufferSubmitInfoKHR(ResourceTracker* resourceTracker,
+                                                   VkCommandBufferSubmitInfoKHR* toTransform);
+
+void transform_fromhost_VkCommandBufferSubmitInfoKHR(ResourceTracker* resourceTracker,
+                                                     VkCommandBufferSubmitInfoKHR* toTransform);
+
+void transform_tohost_VkSubmitInfo2KHR(ResourceTracker* resourceTracker,
+                                       VkSubmitInfo2KHR* toTransform);
+
+void transform_fromhost_VkSubmitInfo2KHR(ResourceTracker* resourceTracker,
+                                         VkSubmitInfo2KHR* toTransform);
+
+void transform_tohost_VkPhysicalDeviceSynchronization2FeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSynchronization2FeaturesKHR* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceSynchronization2FeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSynchronization2FeaturesKHR* toTransform);
+
+void transform_tohost_VkQueueFamilyCheckpointProperties2NV(
+    ResourceTracker* resourceTracker, VkQueueFamilyCheckpointProperties2NV* toTransform);
+
+void transform_fromhost_VkQueueFamilyCheckpointProperties2NV(
+    ResourceTracker* resourceTracker, VkQueueFamilyCheckpointProperties2NV* toTransform);
+
+void transform_tohost_VkCheckpointData2NV(ResourceTracker* resourceTracker,
+                                          VkCheckpointData2NV* toTransform);
+
+void transform_fromhost_VkCheckpointData2NV(ResourceTracker* resourceTracker,
+                                            VkCheckpointData2NV* toTransform);
+
+#endif
+#ifdef VK_KHR_shader_subgroup_uniform_control_flow
+void transform_tohost_VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_zero_initialize_workgroup_memory
+void transform_tohost_VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_workgroup_memory_explicit_layout
+void transform_tohost_VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_copy_commands2
+void transform_tohost_VkBufferCopy2KHR(ResourceTracker* resourceTracker,
+                                       VkBufferCopy2KHR* toTransform);
+
+void transform_fromhost_VkBufferCopy2KHR(ResourceTracker* resourceTracker,
+                                         VkBufferCopy2KHR* toTransform);
+
+void transform_tohost_VkCopyBufferInfo2KHR(ResourceTracker* resourceTracker,
+                                           VkCopyBufferInfo2KHR* toTransform);
+
+void transform_fromhost_VkCopyBufferInfo2KHR(ResourceTracker* resourceTracker,
+                                             VkCopyBufferInfo2KHR* toTransform);
+
+void transform_tohost_VkImageCopy2KHR(ResourceTracker* resourceTracker,
+                                      VkImageCopy2KHR* toTransform);
+
+void transform_fromhost_VkImageCopy2KHR(ResourceTracker* resourceTracker,
+                                        VkImageCopy2KHR* toTransform);
+
+void transform_tohost_VkCopyImageInfo2KHR(ResourceTracker* resourceTracker,
+                                          VkCopyImageInfo2KHR* toTransform);
+
+void transform_fromhost_VkCopyImageInfo2KHR(ResourceTracker* resourceTracker,
+                                            VkCopyImageInfo2KHR* toTransform);
+
+void transform_tohost_VkBufferImageCopy2KHR(ResourceTracker* resourceTracker,
+                                            VkBufferImageCopy2KHR* toTransform);
+
+void transform_fromhost_VkBufferImageCopy2KHR(ResourceTracker* resourceTracker,
+                                              VkBufferImageCopy2KHR* toTransform);
+
+void transform_tohost_VkCopyBufferToImageInfo2KHR(ResourceTracker* resourceTracker,
+                                                  VkCopyBufferToImageInfo2KHR* toTransform);
+
+void transform_fromhost_VkCopyBufferToImageInfo2KHR(ResourceTracker* resourceTracker,
+                                                    VkCopyBufferToImageInfo2KHR* toTransform);
+
+void transform_tohost_VkCopyImageToBufferInfo2KHR(ResourceTracker* resourceTracker,
+                                                  VkCopyImageToBufferInfo2KHR* toTransform);
+
+void transform_fromhost_VkCopyImageToBufferInfo2KHR(ResourceTracker* resourceTracker,
+                                                    VkCopyImageToBufferInfo2KHR* toTransform);
+
+void transform_tohost_VkImageBlit2KHR(ResourceTracker* resourceTracker,
+                                      VkImageBlit2KHR* toTransform);
+
+void transform_fromhost_VkImageBlit2KHR(ResourceTracker* resourceTracker,
+                                        VkImageBlit2KHR* toTransform);
+
+void transform_tohost_VkBlitImageInfo2KHR(ResourceTracker* resourceTracker,
+                                          VkBlitImageInfo2KHR* toTransform);
+
+void transform_fromhost_VkBlitImageInfo2KHR(ResourceTracker* resourceTracker,
+                                            VkBlitImageInfo2KHR* toTransform);
+
+void transform_tohost_VkImageResolve2KHR(ResourceTracker* resourceTracker,
+                                         VkImageResolve2KHR* toTransform);
+
+void transform_fromhost_VkImageResolve2KHR(ResourceTracker* resourceTracker,
+                                           VkImageResolve2KHR* toTransform);
+
+void transform_tohost_VkResolveImageInfo2KHR(ResourceTracker* resourceTracker,
+                                             VkResolveImageInfo2KHR* toTransform);
+
+void transform_fromhost_VkResolveImageInfo2KHR(ResourceTracker* resourceTracker,
+                                               VkResolveImageInfo2KHR* toTransform);
+
+#endif
+#ifdef VK_KHR_format_feature_flags2
+void transform_tohost_VkFormatProperties3KHR(ResourceTracker* resourceTracker,
+                                             VkFormatProperties3KHR* toTransform);
+
+void transform_fromhost_VkFormatProperties3KHR(ResourceTracker* resourceTracker,
+                                               VkFormatProperties3KHR* toTransform);
+
+#endif
+#ifdef VK_KHR_maintenance4
+void transform_tohost_VkPhysicalDeviceMaintenance4FeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMaintenance4FeaturesKHR* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceMaintenance4FeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMaintenance4FeaturesKHR* toTransform);
+
+void transform_tohost_VkPhysicalDeviceMaintenance4PropertiesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMaintenance4PropertiesKHR* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceMaintenance4PropertiesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMaintenance4PropertiesKHR* toTransform);
+
+void transform_tohost_VkDeviceBufferMemoryRequirementsKHR(
+    ResourceTracker* resourceTracker, VkDeviceBufferMemoryRequirementsKHR* toTransform);
+
+void transform_fromhost_VkDeviceBufferMemoryRequirementsKHR(
+    ResourceTracker* resourceTracker, VkDeviceBufferMemoryRequirementsKHR* toTransform);
+
+void transform_tohost_VkDeviceImageMemoryRequirementsKHR(
+    ResourceTracker* resourceTracker, VkDeviceImageMemoryRequirementsKHR* toTransform);
+
+void transform_fromhost_VkDeviceImageMemoryRequirementsKHR(
+    ResourceTracker* resourceTracker, VkDeviceImageMemoryRequirementsKHR* toTransform);
+
+#endif
+#ifdef VK_ANDROID_native_buffer
+void transform_tohost_VkNativeBufferANDROID(ResourceTracker* resourceTracker,
+                                            VkNativeBufferANDROID* toTransform);
+
+void transform_fromhost_VkNativeBufferANDROID(ResourceTracker* resourceTracker,
+                                              VkNativeBufferANDROID* toTransform);
+
+#endif
+#ifdef VK_EXT_debug_report
+void transform_tohost_VkDebugReportCallbackCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkDebugReportCallbackCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkDebugReportCallbackCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkDebugReportCallbackCreateInfoEXT* toTransform);
+
+#endif
+#ifdef VK_NV_glsl_shader
+#endif
+#ifdef VK_EXT_depth_range_unrestricted
+#endif
+#ifdef VK_IMG_filter_cubic
+#endif
+#ifdef VK_AMD_rasterization_order
+void transform_tohost_VkPipelineRasterizationStateRasterizationOrderAMD(
+    ResourceTracker* resourceTracker,
+    VkPipelineRasterizationStateRasterizationOrderAMD* toTransform);
+
+void transform_fromhost_VkPipelineRasterizationStateRasterizationOrderAMD(
+    ResourceTracker* resourceTracker,
+    VkPipelineRasterizationStateRasterizationOrderAMD* toTransform);
+
+#endif
+#ifdef VK_AMD_shader_trinary_minmax
+#endif
+#ifdef VK_AMD_shader_explicit_vertex_parameter
+#endif
+#ifdef VK_EXT_debug_marker
+void transform_tohost_VkDebugMarkerObjectNameInfoEXT(ResourceTracker* resourceTracker,
+                                                     VkDebugMarkerObjectNameInfoEXT* toTransform);
+
+void transform_fromhost_VkDebugMarkerObjectNameInfoEXT(ResourceTracker* resourceTracker,
+                                                       VkDebugMarkerObjectNameInfoEXT* toTransform);
+
+void transform_tohost_VkDebugMarkerObjectTagInfoEXT(ResourceTracker* resourceTracker,
+                                                    VkDebugMarkerObjectTagInfoEXT* toTransform);
+
+void transform_fromhost_VkDebugMarkerObjectTagInfoEXT(ResourceTracker* resourceTracker,
+                                                      VkDebugMarkerObjectTagInfoEXT* toTransform);
+
+void transform_tohost_VkDebugMarkerMarkerInfoEXT(ResourceTracker* resourceTracker,
+                                                 VkDebugMarkerMarkerInfoEXT* toTransform);
+
+void transform_fromhost_VkDebugMarkerMarkerInfoEXT(ResourceTracker* resourceTracker,
+                                                   VkDebugMarkerMarkerInfoEXT* toTransform);
+
+#endif
+#ifdef VK_AMD_gcn_shader
+#endif
+#ifdef VK_NV_dedicated_allocation
+void transform_tohost_VkDedicatedAllocationImageCreateInfoNV(
+    ResourceTracker* resourceTracker, VkDedicatedAllocationImageCreateInfoNV* toTransform);
+
+void transform_fromhost_VkDedicatedAllocationImageCreateInfoNV(
+    ResourceTracker* resourceTracker, VkDedicatedAllocationImageCreateInfoNV* toTransform);
+
+void transform_tohost_VkDedicatedAllocationBufferCreateInfoNV(
+    ResourceTracker* resourceTracker, VkDedicatedAllocationBufferCreateInfoNV* toTransform);
+
+void transform_fromhost_VkDedicatedAllocationBufferCreateInfoNV(
+    ResourceTracker* resourceTracker, VkDedicatedAllocationBufferCreateInfoNV* toTransform);
+
+void transform_tohost_VkDedicatedAllocationMemoryAllocateInfoNV(
+    ResourceTracker* resourceTracker, VkDedicatedAllocationMemoryAllocateInfoNV* toTransform);
+
+void transform_fromhost_VkDedicatedAllocationMemoryAllocateInfoNV(
+    ResourceTracker* resourceTracker, VkDedicatedAllocationMemoryAllocateInfoNV* toTransform);
+
+#endif
+#ifdef VK_EXT_transform_feedback
+void transform_tohost_VkPhysicalDeviceTransformFeedbackFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceTransformFeedbackFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceTransformFeedbackFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceTransformFeedbackFeaturesEXT* toTransform);
+
+void transform_tohost_VkPhysicalDeviceTransformFeedbackPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceTransformFeedbackPropertiesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceTransformFeedbackPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceTransformFeedbackPropertiesEXT* toTransform);
+
+void transform_tohost_VkPipelineRasterizationStateStreamCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineRasterizationStateStreamCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkPipelineRasterizationStateStreamCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineRasterizationStateStreamCreateInfoEXT* toTransform);
+
+#endif
+#ifdef VK_NVX_binary_import
+void transform_tohost_VkCuModuleCreateInfoNVX(ResourceTracker* resourceTracker,
+                                              VkCuModuleCreateInfoNVX* toTransform);
+
+void transform_fromhost_VkCuModuleCreateInfoNVX(ResourceTracker* resourceTracker,
+                                                VkCuModuleCreateInfoNVX* toTransform);
+
+void transform_tohost_VkCuFunctionCreateInfoNVX(ResourceTracker* resourceTracker,
+                                                VkCuFunctionCreateInfoNVX* toTransform);
+
+void transform_fromhost_VkCuFunctionCreateInfoNVX(ResourceTracker* resourceTracker,
+                                                  VkCuFunctionCreateInfoNVX* toTransform);
+
+void transform_tohost_VkCuLaunchInfoNVX(ResourceTracker* resourceTracker,
+                                        VkCuLaunchInfoNVX* toTransform);
+
+void transform_fromhost_VkCuLaunchInfoNVX(ResourceTracker* resourceTracker,
+                                          VkCuLaunchInfoNVX* toTransform);
+
+#endif
+#ifdef VK_NVX_image_view_handle
+void transform_tohost_VkImageViewHandleInfoNVX(ResourceTracker* resourceTracker,
+                                               VkImageViewHandleInfoNVX* toTransform);
+
+void transform_fromhost_VkImageViewHandleInfoNVX(ResourceTracker* resourceTracker,
+                                                 VkImageViewHandleInfoNVX* toTransform);
+
+void transform_tohost_VkImageViewAddressPropertiesNVX(ResourceTracker* resourceTracker,
+                                                      VkImageViewAddressPropertiesNVX* toTransform);
+
+void transform_fromhost_VkImageViewAddressPropertiesNVX(
+    ResourceTracker* resourceTracker, VkImageViewAddressPropertiesNVX* toTransform);
+
+#endif
+#ifdef VK_AMD_draw_indirect_count
+#endif
+#ifdef VK_AMD_negative_viewport_height
+#endif
+#ifdef VK_AMD_gpu_shader_half_float
+#endif
+#ifdef VK_AMD_shader_ballot
+#endif
+#ifdef VK_EXT_video_encode_h264
+void transform_tohost_VkVideoEncodeH264CapabilitiesEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH264CapabilitiesEXT* toTransform);
+
+void transform_fromhost_VkVideoEncodeH264CapabilitiesEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH264CapabilitiesEXT* toTransform);
+
+void transform_tohost_VkVideoEncodeH264SessionCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH264SessionCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkVideoEncodeH264SessionCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH264SessionCreateInfoEXT* toTransform);
+
+void transform_tohost_VkVideoEncodeH264SessionParametersAddInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH264SessionParametersAddInfoEXT* toTransform);
+
+void transform_fromhost_VkVideoEncodeH264SessionParametersAddInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH264SessionParametersAddInfoEXT* toTransform);
+
+void transform_tohost_VkVideoEncodeH264SessionParametersCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH264SessionParametersCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkVideoEncodeH264SessionParametersCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH264SessionParametersCreateInfoEXT* toTransform);
+
+void transform_tohost_VkVideoEncodeH264DpbSlotInfoEXT(ResourceTracker* resourceTracker,
+                                                      VkVideoEncodeH264DpbSlotInfoEXT* toTransform);
+
+void transform_fromhost_VkVideoEncodeH264DpbSlotInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH264DpbSlotInfoEXT* toTransform);
+
+void transform_tohost_VkVideoEncodeH264NaluSliceEXT(ResourceTracker* resourceTracker,
+                                                    VkVideoEncodeH264NaluSliceEXT* toTransform);
+
+void transform_fromhost_VkVideoEncodeH264NaluSliceEXT(ResourceTracker* resourceTracker,
+                                                      VkVideoEncodeH264NaluSliceEXT* toTransform);
+
+void transform_tohost_VkVideoEncodeH264VclFrameInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH264VclFrameInfoEXT* toTransform);
+
+void transform_fromhost_VkVideoEncodeH264VclFrameInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH264VclFrameInfoEXT* toTransform);
+
+void transform_tohost_VkVideoEncodeH264EmitPictureParametersEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH264EmitPictureParametersEXT* toTransform);
+
+void transform_fromhost_VkVideoEncodeH264EmitPictureParametersEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH264EmitPictureParametersEXT* toTransform);
+
+void transform_tohost_VkVideoEncodeH264ProfileEXT(ResourceTracker* resourceTracker,
+                                                  VkVideoEncodeH264ProfileEXT* toTransform);
+
+void transform_fromhost_VkVideoEncodeH264ProfileEXT(ResourceTracker* resourceTracker,
+                                                    VkVideoEncodeH264ProfileEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_video_encode_h265
+void transform_tohost_VkVideoEncodeH265CapabilitiesEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH265CapabilitiesEXT* toTransform);
+
+void transform_fromhost_VkVideoEncodeH265CapabilitiesEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH265CapabilitiesEXT* toTransform);
+
+void transform_tohost_VkVideoEncodeH265SessionCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH265SessionCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkVideoEncodeH265SessionCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH265SessionCreateInfoEXT* toTransform);
+
+void transform_tohost_VkVideoEncodeH265SessionParametersAddInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH265SessionParametersAddInfoEXT* toTransform);
+
+void transform_fromhost_VkVideoEncodeH265SessionParametersAddInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH265SessionParametersAddInfoEXT* toTransform);
+
+void transform_tohost_VkVideoEncodeH265SessionParametersCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH265SessionParametersCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkVideoEncodeH265SessionParametersCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH265SessionParametersCreateInfoEXT* toTransform);
+
+void transform_tohost_VkVideoEncodeH265DpbSlotInfoEXT(ResourceTracker* resourceTracker,
+                                                      VkVideoEncodeH265DpbSlotInfoEXT* toTransform);
+
+void transform_fromhost_VkVideoEncodeH265DpbSlotInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH265DpbSlotInfoEXT* toTransform);
+
+void transform_tohost_VkVideoEncodeH265ReferenceListsEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH265ReferenceListsEXT* toTransform);
+
+void transform_fromhost_VkVideoEncodeH265ReferenceListsEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH265ReferenceListsEXT* toTransform);
+
+void transform_tohost_VkVideoEncodeH265NaluSliceEXT(ResourceTracker* resourceTracker,
+                                                    VkVideoEncodeH265NaluSliceEXT* toTransform);
+
+void transform_fromhost_VkVideoEncodeH265NaluSliceEXT(ResourceTracker* resourceTracker,
+                                                      VkVideoEncodeH265NaluSliceEXT* toTransform);
+
+void transform_tohost_VkVideoEncodeH265VclFrameInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH265VclFrameInfoEXT* toTransform);
+
+void transform_fromhost_VkVideoEncodeH265VclFrameInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH265VclFrameInfoEXT* toTransform);
+
+void transform_tohost_VkVideoEncodeH265EmitPictureParametersEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH265EmitPictureParametersEXT* toTransform);
+
+void transform_fromhost_VkVideoEncodeH265EmitPictureParametersEXT(
+    ResourceTracker* resourceTracker, VkVideoEncodeH265EmitPictureParametersEXT* toTransform);
+
+void transform_tohost_VkVideoEncodeH265ProfileEXT(ResourceTracker* resourceTracker,
+                                                  VkVideoEncodeH265ProfileEXT* toTransform);
+
+void transform_fromhost_VkVideoEncodeH265ProfileEXT(ResourceTracker* resourceTracker,
+                                                    VkVideoEncodeH265ProfileEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_video_decode_h264
+void transform_tohost_VkVideoDecodeH264ProfileEXT(ResourceTracker* resourceTracker,
+                                                  VkVideoDecodeH264ProfileEXT* toTransform);
+
+void transform_fromhost_VkVideoDecodeH264ProfileEXT(ResourceTracker* resourceTracker,
+                                                    VkVideoDecodeH264ProfileEXT* toTransform);
+
+void transform_tohost_VkVideoDecodeH264CapabilitiesEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH264CapabilitiesEXT* toTransform);
+
+void transform_fromhost_VkVideoDecodeH264CapabilitiesEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH264CapabilitiesEXT* toTransform);
+
+void transform_tohost_VkVideoDecodeH264SessionCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH264SessionCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkVideoDecodeH264SessionCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH264SessionCreateInfoEXT* toTransform);
+
+void transform_tohost_VkVideoDecodeH264SessionParametersAddInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH264SessionParametersAddInfoEXT* toTransform);
+
+void transform_fromhost_VkVideoDecodeH264SessionParametersAddInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH264SessionParametersAddInfoEXT* toTransform);
+
+void transform_tohost_VkVideoDecodeH264SessionParametersCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH264SessionParametersCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkVideoDecodeH264SessionParametersCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH264SessionParametersCreateInfoEXT* toTransform);
+
+void transform_tohost_VkVideoDecodeH264PictureInfoEXT(ResourceTracker* resourceTracker,
+                                                      VkVideoDecodeH264PictureInfoEXT* toTransform);
+
+void transform_fromhost_VkVideoDecodeH264PictureInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH264PictureInfoEXT* toTransform);
+
+void transform_tohost_VkVideoDecodeH264MvcEXT(ResourceTracker* resourceTracker,
+                                              VkVideoDecodeH264MvcEXT* toTransform);
+
+void transform_fromhost_VkVideoDecodeH264MvcEXT(ResourceTracker* resourceTracker,
+                                                VkVideoDecodeH264MvcEXT* toTransform);
+
+void transform_tohost_VkVideoDecodeH264DpbSlotInfoEXT(ResourceTracker* resourceTracker,
+                                                      VkVideoDecodeH264DpbSlotInfoEXT* toTransform);
+
+void transform_fromhost_VkVideoDecodeH264DpbSlotInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH264DpbSlotInfoEXT* toTransform);
+
+#endif
+#ifdef VK_AMD_texture_gather_bias_lod
+void transform_tohost_VkTextureLODGatherFormatPropertiesAMD(
+    ResourceTracker* resourceTracker, VkTextureLODGatherFormatPropertiesAMD* toTransform);
+
+void transform_fromhost_VkTextureLODGatherFormatPropertiesAMD(
+    ResourceTracker* resourceTracker, VkTextureLODGatherFormatPropertiesAMD* toTransform);
+
+#endif
+#ifdef VK_AMD_shader_info
+void transform_tohost_VkShaderResourceUsageAMD(ResourceTracker* resourceTracker,
+                                               VkShaderResourceUsageAMD* toTransform);
+
+void transform_fromhost_VkShaderResourceUsageAMD(ResourceTracker* resourceTracker,
+                                                 VkShaderResourceUsageAMD* toTransform);
+
+void transform_tohost_VkShaderStatisticsInfoAMD(ResourceTracker* resourceTracker,
+                                                VkShaderStatisticsInfoAMD* toTransform);
+
+void transform_fromhost_VkShaderStatisticsInfoAMD(ResourceTracker* resourceTracker,
+                                                  VkShaderStatisticsInfoAMD* toTransform);
+
+#endif
+#ifdef VK_AMD_shader_image_load_store_lod
+#endif
+#ifdef VK_GGP_stream_descriptor_surface
+void transform_tohost_VkStreamDescriptorSurfaceCreateInfoGGP(
+    ResourceTracker* resourceTracker, VkStreamDescriptorSurfaceCreateInfoGGP* toTransform);
+
+void transform_fromhost_VkStreamDescriptorSurfaceCreateInfoGGP(
+    ResourceTracker* resourceTracker, VkStreamDescriptorSurfaceCreateInfoGGP* toTransform);
+
+#endif
+#ifdef VK_NV_corner_sampled_image
+void transform_tohost_VkPhysicalDeviceCornerSampledImageFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceCornerSampledImageFeaturesNV* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceCornerSampledImageFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceCornerSampledImageFeaturesNV* toTransform);
+
+#endif
+#ifdef VK_IMG_format_pvrtc
+#endif
+#ifdef VK_NV_external_memory_capabilities
+void transform_tohost_VkExternalImageFormatPropertiesNV(
+    ResourceTracker* resourceTracker, VkExternalImageFormatPropertiesNV* toTransform);
+
+void transform_fromhost_VkExternalImageFormatPropertiesNV(
+    ResourceTracker* resourceTracker, VkExternalImageFormatPropertiesNV* toTransform);
+
+#endif
+#ifdef VK_NV_external_memory
+void transform_tohost_VkExternalMemoryImageCreateInfoNV(
+    ResourceTracker* resourceTracker, VkExternalMemoryImageCreateInfoNV* toTransform);
+
+void transform_fromhost_VkExternalMemoryImageCreateInfoNV(
+    ResourceTracker* resourceTracker, VkExternalMemoryImageCreateInfoNV* toTransform);
+
+void transform_tohost_VkExportMemoryAllocateInfoNV(ResourceTracker* resourceTracker,
+                                                   VkExportMemoryAllocateInfoNV* toTransform);
+
+void transform_fromhost_VkExportMemoryAllocateInfoNV(ResourceTracker* resourceTracker,
+                                                     VkExportMemoryAllocateInfoNV* toTransform);
+
+#endif
+#ifdef VK_NV_external_memory_win32
+void transform_tohost_VkImportMemoryWin32HandleInfoNV(ResourceTracker* resourceTracker,
+                                                      VkImportMemoryWin32HandleInfoNV* toTransform);
+
+void transform_fromhost_VkImportMemoryWin32HandleInfoNV(
+    ResourceTracker* resourceTracker, VkImportMemoryWin32HandleInfoNV* toTransform);
+
+void transform_tohost_VkExportMemoryWin32HandleInfoNV(ResourceTracker* resourceTracker,
+                                                      VkExportMemoryWin32HandleInfoNV* toTransform);
+
+void transform_fromhost_VkExportMemoryWin32HandleInfoNV(
+    ResourceTracker* resourceTracker, VkExportMemoryWin32HandleInfoNV* toTransform);
+
+#endif
+#ifdef VK_NV_win32_keyed_mutex
+void transform_tohost_VkWin32KeyedMutexAcquireReleaseInfoNV(
+    ResourceTracker* resourceTracker, VkWin32KeyedMutexAcquireReleaseInfoNV* toTransform);
+
+void transform_fromhost_VkWin32KeyedMutexAcquireReleaseInfoNV(
+    ResourceTracker* resourceTracker, VkWin32KeyedMutexAcquireReleaseInfoNV* toTransform);
+
+#endif
+#ifdef VK_EXT_validation_flags
+void transform_tohost_VkValidationFlagsEXT(ResourceTracker* resourceTracker,
+                                           VkValidationFlagsEXT* toTransform);
+
+void transform_fromhost_VkValidationFlagsEXT(ResourceTracker* resourceTracker,
+                                             VkValidationFlagsEXT* toTransform);
+
+#endif
+#ifdef VK_NN_vi_surface
+void transform_tohost_VkViSurfaceCreateInfoNN(ResourceTracker* resourceTracker,
+                                              VkViSurfaceCreateInfoNN* toTransform);
+
+void transform_fromhost_VkViSurfaceCreateInfoNN(ResourceTracker* resourceTracker,
+                                                VkViSurfaceCreateInfoNN* toTransform);
+
+#endif
+#ifdef VK_EXT_shader_subgroup_ballot
+#endif
+#ifdef VK_EXT_shader_subgroup_vote
+#endif
+#ifdef VK_EXT_texture_compression_astc_hdr
+void transform_tohost_VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_astc_decode_mode
+void transform_tohost_VkImageViewASTCDecodeModeEXT(ResourceTracker* resourceTracker,
+                                                   VkImageViewASTCDecodeModeEXT* toTransform);
+
+void transform_fromhost_VkImageViewASTCDecodeModeEXT(ResourceTracker* resourceTracker,
+                                                     VkImageViewASTCDecodeModeEXT* toTransform);
+
+void transform_tohost_VkPhysicalDeviceASTCDecodeFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceASTCDecodeFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceASTCDecodeFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceASTCDecodeFeaturesEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_conditional_rendering
+void transform_tohost_VkConditionalRenderingBeginInfoEXT(
+    ResourceTracker* resourceTracker, VkConditionalRenderingBeginInfoEXT* toTransform);
+
+void transform_fromhost_VkConditionalRenderingBeginInfoEXT(
+    ResourceTracker* resourceTracker, VkConditionalRenderingBeginInfoEXT* toTransform);
+
+void transform_tohost_VkPhysicalDeviceConditionalRenderingFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceConditionalRenderingFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceConditionalRenderingFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceConditionalRenderingFeaturesEXT* toTransform);
+
+void transform_tohost_VkCommandBufferInheritanceConditionalRenderingInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkCommandBufferInheritanceConditionalRenderingInfoEXT* toTransform);
+
+void transform_fromhost_VkCommandBufferInheritanceConditionalRenderingInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkCommandBufferInheritanceConditionalRenderingInfoEXT* toTransform);
+
+#endif
+#ifdef VK_NV_clip_space_w_scaling
+void transform_tohost_VkViewportWScalingNV(ResourceTracker* resourceTracker,
+                                           VkViewportWScalingNV* toTransform);
+
+void transform_fromhost_VkViewportWScalingNV(ResourceTracker* resourceTracker,
+                                             VkViewportWScalingNV* toTransform);
+
+void transform_tohost_VkPipelineViewportWScalingStateCreateInfoNV(
+    ResourceTracker* resourceTracker, VkPipelineViewportWScalingStateCreateInfoNV* toTransform);
+
+void transform_fromhost_VkPipelineViewportWScalingStateCreateInfoNV(
+    ResourceTracker* resourceTracker, VkPipelineViewportWScalingStateCreateInfoNV* toTransform);
+
+#endif
+#ifdef VK_EXT_direct_mode_display
+#endif
+#ifdef VK_EXT_acquire_xlib_display
+#endif
+#ifdef VK_EXT_display_surface_counter
+void transform_tohost_VkSurfaceCapabilities2EXT(ResourceTracker* resourceTracker,
+                                                VkSurfaceCapabilities2EXT* toTransform);
+
+void transform_fromhost_VkSurfaceCapabilities2EXT(ResourceTracker* resourceTracker,
+                                                  VkSurfaceCapabilities2EXT* toTransform);
+
+#endif
+#ifdef VK_EXT_display_control
+void transform_tohost_VkDisplayPowerInfoEXT(ResourceTracker* resourceTracker,
+                                            VkDisplayPowerInfoEXT* toTransform);
+
+void transform_fromhost_VkDisplayPowerInfoEXT(ResourceTracker* resourceTracker,
+                                              VkDisplayPowerInfoEXT* toTransform);
+
+void transform_tohost_VkDeviceEventInfoEXT(ResourceTracker* resourceTracker,
+                                           VkDeviceEventInfoEXT* toTransform);
+
+void transform_fromhost_VkDeviceEventInfoEXT(ResourceTracker* resourceTracker,
+                                             VkDeviceEventInfoEXT* toTransform);
+
+void transform_tohost_VkDisplayEventInfoEXT(ResourceTracker* resourceTracker,
+                                            VkDisplayEventInfoEXT* toTransform);
+
+void transform_fromhost_VkDisplayEventInfoEXT(ResourceTracker* resourceTracker,
+                                              VkDisplayEventInfoEXT* toTransform);
+
+void transform_tohost_VkSwapchainCounterCreateInfoEXT(ResourceTracker* resourceTracker,
+                                                      VkSwapchainCounterCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkSwapchainCounterCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkSwapchainCounterCreateInfoEXT* toTransform);
+
+#endif
+#ifdef VK_GOOGLE_display_timing
+void transform_tohost_VkRefreshCycleDurationGOOGLE(ResourceTracker* resourceTracker,
+                                                   VkRefreshCycleDurationGOOGLE* toTransform);
+
+void transform_fromhost_VkRefreshCycleDurationGOOGLE(ResourceTracker* resourceTracker,
+                                                     VkRefreshCycleDurationGOOGLE* toTransform);
+
+void transform_tohost_VkPastPresentationTimingGOOGLE(ResourceTracker* resourceTracker,
+                                                     VkPastPresentationTimingGOOGLE* toTransform);
+
+void transform_fromhost_VkPastPresentationTimingGOOGLE(ResourceTracker* resourceTracker,
+                                                       VkPastPresentationTimingGOOGLE* toTransform);
+
+void transform_tohost_VkPresentTimeGOOGLE(ResourceTracker* resourceTracker,
+                                          VkPresentTimeGOOGLE* toTransform);
+
+void transform_fromhost_VkPresentTimeGOOGLE(ResourceTracker* resourceTracker,
+                                            VkPresentTimeGOOGLE* toTransform);
+
+void transform_tohost_VkPresentTimesInfoGOOGLE(ResourceTracker* resourceTracker,
+                                               VkPresentTimesInfoGOOGLE* toTransform);
+
+void transform_fromhost_VkPresentTimesInfoGOOGLE(ResourceTracker* resourceTracker,
+                                                 VkPresentTimesInfoGOOGLE* toTransform);
+
+#endif
+#ifdef VK_NV_sample_mask_override_coverage
+#endif
+#ifdef VK_NV_geometry_shader_passthrough
+#endif
+#ifdef VK_NV_viewport_array2
+#endif
+#ifdef VK_NVX_multiview_per_view_attributes
+void transform_tohost_VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX* toTransform);
+
+#endif
+#ifdef VK_NV_viewport_swizzle
+void transform_tohost_VkViewportSwizzleNV(ResourceTracker* resourceTracker,
+                                          VkViewportSwizzleNV* toTransform);
+
+void transform_fromhost_VkViewportSwizzleNV(ResourceTracker* resourceTracker,
+                                            VkViewportSwizzleNV* toTransform);
+
+void transform_tohost_VkPipelineViewportSwizzleStateCreateInfoNV(
+    ResourceTracker* resourceTracker, VkPipelineViewportSwizzleStateCreateInfoNV* toTransform);
+
+void transform_fromhost_VkPipelineViewportSwizzleStateCreateInfoNV(
+    ResourceTracker* resourceTracker, VkPipelineViewportSwizzleStateCreateInfoNV* toTransform);
+
+#endif
+#ifdef VK_EXT_discard_rectangles
+void transform_tohost_VkPhysicalDeviceDiscardRectanglePropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDiscardRectanglePropertiesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceDiscardRectanglePropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDiscardRectanglePropertiesEXT* toTransform);
+
+void transform_tohost_VkPipelineDiscardRectangleStateCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineDiscardRectangleStateCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkPipelineDiscardRectangleStateCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineDiscardRectangleStateCreateInfoEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_conservative_rasterization
+void transform_tohost_VkPhysicalDeviceConservativeRasterizationPropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceConservativeRasterizationPropertiesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceConservativeRasterizationPropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceConservativeRasterizationPropertiesEXT* toTransform);
+
+void transform_tohost_VkPipelineRasterizationConservativeStateCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkPipelineRasterizationConservativeStateCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkPipelineRasterizationConservativeStateCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkPipelineRasterizationConservativeStateCreateInfoEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_depth_clip_enable
+void transform_tohost_VkPhysicalDeviceDepthClipEnableFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDepthClipEnableFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceDepthClipEnableFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDepthClipEnableFeaturesEXT* toTransform);
+
+void transform_tohost_VkPipelineRasterizationDepthClipStateCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkPipelineRasterizationDepthClipStateCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkPipelineRasterizationDepthClipStateCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkPipelineRasterizationDepthClipStateCreateInfoEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_swapchain_colorspace
+#endif
+#ifdef VK_EXT_hdr_metadata
+void transform_tohost_VkXYColorEXT(ResourceTracker* resourceTracker, VkXYColorEXT* toTransform);
+
+void transform_fromhost_VkXYColorEXT(ResourceTracker* resourceTracker, VkXYColorEXT* toTransform);
+
+void transform_tohost_VkHdrMetadataEXT(ResourceTracker* resourceTracker,
+                                       VkHdrMetadataEXT* toTransform);
+
+void transform_fromhost_VkHdrMetadataEXT(ResourceTracker* resourceTracker,
+                                         VkHdrMetadataEXT* toTransform);
+
+#endif
+#ifdef VK_MVK_ios_surface
+void transform_tohost_VkIOSSurfaceCreateInfoMVK(ResourceTracker* resourceTracker,
+                                                VkIOSSurfaceCreateInfoMVK* toTransform);
+
+void transform_fromhost_VkIOSSurfaceCreateInfoMVK(ResourceTracker* resourceTracker,
+                                                  VkIOSSurfaceCreateInfoMVK* toTransform);
+
+#endif
+#ifdef VK_MVK_macos_surface
+void transform_tohost_VkMacOSSurfaceCreateInfoMVK(ResourceTracker* resourceTracker,
+                                                  VkMacOSSurfaceCreateInfoMVK* toTransform);
+
+void transform_fromhost_VkMacOSSurfaceCreateInfoMVK(ResourceTracker* resourceTracker,
+                                                    VkMacOSSurfaceCreateInfoMVK* toTransform);
+
+#endif
+#ifdef VK_MVK_moltenvk
+#endif
+#ifdef VK_EXT_external_memory_dma_buf
+#endif
+#ifdef VK_EXT_queue_family_foreign
+#endif
+#ifdef VK_EXT_debug_utils
+void transform_tohost_VkDebugUtilsLabelEXT(ResourceTracker* resourceTracker,
+                                           VkDebugUtilsLabelEXT* toTransform);
+
+void transform_fromhost_VkDebugUtilsLabelEXT(ResourceTracker* resourceTracker,
+                                             VkDebugUtilsLabelEXT* toTransform);
+
+void transform_tohost_VkDebugUtilsObjectNameInfoEXT(ResourceTracker* resourceTracker,
+                                                    VkDebugUtilsObjectNameInfoEXT* toTransform);
+
+void transform_fromhost_VkDebugUtilsObjectNameInfoEXT(ResourceTracker* resourceTracker,
+                                                      VkDebugUtilsObjectNameInfoEXT* toTransform);
+
+void transform_tohost_VkDebugUtilsMessengerCallbackDataEXT(
+    ResourceTracker* resourceTracker, VkDebugUtilsMessengerCallbackDataEXT* toTransform);
+
+void transform_fromhost_VkDebugUtilsMessengerCallbackDataEXT(
+    ResourceTracker* resourceTracker, VkDebugUtilsMessengerCallbackDataEXT* toTransform);
+
+void transform_tohost_VkDebugUtilsMessengerCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkDebugUtilsMessengerCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkDebugUtilsMessengerCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkDebugUtilsMessengerCreateInfoEXT* toTransform);
+
+void transform_tohost_VkDebugUtilsObjectTagInfoEXT(ResourceTracker* resourceTracker,
+                                                   VkDebugUtilsObjectTagInfoEXT* toTransform);
+
+void transform_fromhost_VkDebugUtilsObjectTagInfoEXT(ResourceTracker* resourceTracker,
+                                                     VkDebugUtilsObjectTagInfoEXT* toTransform);
+
+#endif
+#ifdef VK_ANDROID_external_memory_android_hardware_buffer
+void transform_tohost_VkAndroidHardwareBufferUsageANDROID(
+    ResourceTracker* resourceTracker, VkAndroidHardwareBufferUsageANDROID* toTransform);
+
+void transform_fromhost_VkAndroidHardwareBufferUsageANDROID(
+    ResourceTracker* resourceTracker, VkAndroidHardwareBufferUsageANDROID* toTransform);
+
+void transform_tohost_VkAndroidHardwareBufferPropertiesANDROID(
+    ResourceTracker* resourceTracker, VkAndroidHardwareBufferPropertiesANDROID* toTransform);
+
+void transform_fromhost_VkAndroidHardwareBufferPropertiesANDROID(
+    ResourceTracker* resourceTracker, VkAndroidHardwareBufferPropertiesANDROID* toTransform);
+
+void transform_tohost_VkAndroidHardwareBufferFormatPropertiesANDROID(
+    ResourceTracker* resourceTracker, VkAndroidHardwareBufferFormatPropertiesANDROID* toTransform);
+
+void transform_fromhost_VkAndroidHardwareBufferFormatPropertiesANDROID(
+    ResourceTracker* resourceTracker, VkAndroidHardwareBufferFormatPropertiesANDROID* toTransform);
+
+void transform_tohost_VkImportAndroidHardwareBufferInfoANDROID(
+    ResourceTracker* resourceTracker, VkImportAndroidHardwareBufferInfoANDROID* toTransform);
+
+void transform_fromhost_VkImportAndroidHardwareBufferInfoANDROID(
+    ResourceTracker* resourceTracker, VkImportAndroidHardwareBufferInfoANDROID* toTransform);
+
+void transform_tohost_VkMemoryGetAndroidHardwareBufferInfoANDROID(
+    ResourceTracker* resourceTracker, VkMemoryGetAndroidHardwareBufferInfoANDROID* toTransform);
+
+void transform_fromhost_VkMemoryGetAndroidHardwareBufferInfoANDROID(
+    ResourceTracker* resourceTracker, VkMemoryGetAndroidHardwareBufferInfoANDROID* toTransform);
+
+void transform_tohost_VkExternalFormatANDROID(ResourceTracker* resourceTracker,
+                                              VkExternalFormatANDROID* toTransform);
+
+void transform_fromhost_VkExternalFormatANDROID(ResourceTracker* resourceTracker,
+                                                VkExternalFormatANDROID* toTransform);
+
+void transform_tohost_VkAndroidHardwareBufferFormatProperties2ANDROID(
+    ResourceTracker* resourceTracker, VkAndroidHardwareBufferFormatProperties2ANDROID* toTransform);
+
+void transform_fromhost_VkAndroidHardwareBufferFormatProperties2ANDROID(
+    ResourceTracker* resourceTracker, VkAndroidHardwareBufferFormatProperties2ANDROID* toTransform);
+
+#endif
+#ifdef VK_EXT_sampler_filter_minmax
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkSamplerReductionModeCreateInfo,
+                      transform_tohost_VkSamplerReductionModeCreateInfoEXT)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkSamplerReductionModeCreateInfo,
+                      transform_fromhost_VkSamplerReductionModeCreateInfoEXT)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceSamplerFilterMinmaxProperties,
+                      transform_tohost_VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceSamplerFilterMinmaxProperties,
+                      transform_fromhost_VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT)
+
+#endif
+#ifdef VK_AMD_gpu_shader_int16
+#endif
+#ifdef VK_AMD_mixed_attachment_samples
+#endif
+#ifdef VK_AMD_shader_fragment_mask
+#endif
+#ifdef VK_EXT_inline_uniform_block
+void transform_tohost_VkPhysicalDeviceInlineUniformBlockFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceInlineUniformBlockFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceInlineUniformBlockFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceInlineUniformBlockFeaturesEXT* toTransform);
+
+void transform_tohost_VkPhysicalDeviceInlineUniformBlockPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceInlineUniformBlockPropertiesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceInlineUniformBlockPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceInlineUniformBlockPropertiesEXT* toTransform);
+
+void transform_tohost_VkWriteDescriptorSetInlineUniformBlockEXT(
+    ResourceTracker* resourceTracker, VkWriteDescriptorSetInlineUniformBlockEXT* toTransform);
+
+void transform_fromhost_VkWriteDescriptorSetInlineUniformBlockEXT(
+    ResourceTracker* resourceTracker, VkWriteDescriptorSetInlineUniformBlockEXT* toTransform);
+
+void transform_tohost_VkDescriptorPoolInlineUniformBlockCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkDescriptorPoolInlineUniformBlockCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkDescriptorPoolInlineUniformBlockCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkDescriptorPoolInlineUniformBlockCreateInfoEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_shader_stencil_export
+#endif
+#ifdef VK_EXT_sample_locations
+void transform_tohost_VkSampleLocationEXT(ResourceTracker* resourceTracker,
+                                          VkSampleLocationEXT* toTransform);
+
+void transform_fromhost_VkSampleLocationEXT(ResourceTracker* resourceTracker,
+                                            VkSampleLocationEXT* toTransform);
+
+void transform_tohost_VkSampleLocationsInfoEXT(ResourceTracker* resourceTracker,
+                                               VkSampleLocationsInfoEXT* toTransform);
+
+void transform_fromhost_VkSampleLocationsInfoEXT(ResourceTracker* resourceTracker,
+                                                 VkSampleLocationsInfoEXT* toTransform);
+
+void transform_tohost_VkAttachmentSampleLocationsEXT(ResourceTracker* resourceTracker,
+                                                     VkAttachmentSampleLocationsEXT* toTransform);
+
+void transform_fromhost_VkAttachmentSampleLocationsEXT(ResourceTracker* resourceTracker,
+                                                       VkAttachmentSampleLocationsEXT* toTransform);
+
+void transform_tohost_VkSubpassSampleLocationsEXT(ResourceTracker* resourceTracker,
+                                                  VkSubpassSampleLocationsEXT* toTransform);
+
+void transform_fromhost_VkSubpassSampleLocationsEXT(ResourceTracker* resourceTracker,
+                                                    VkSubpassSampleLocationsEXT* toTransform);
+
+void transform_tohost_VkRenderPassSampleLocationsBeginInfoEXT(
+    ResourceTracker* resourceTracker, VkRenderPassSampleLocationsBeginInfoEXT* toTransform);
+
+void transform_fromhost_VkRenderPassSampleLocationsBeginInfoEXT(
+    ResourceTracker* resourceTracker, VkRenderPassSampleLocationsBeginInfoEXT* toTransform);
+
+void transform_tohost_VkPipelineSampleLocationsStateCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineSampleLocationsStateCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkPipelineSampleLocationsStateCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineSampleLocationsStateCreateInfoEXT* toTransform);
+
+void transform_tohost_VkPhysicalDeviceSampleLocationsPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSampleLocationsPropertiesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceSampleLocationsPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSampleLocationsPropertiesEXT* toTransform);
+
+void transform_tohost_VkMultisamplePropertiesEXT(ResourceTracker* resourceTracker,
+                                                 VkMultisamplePropertiesEXT* toTransform);
+
+void transform_fromhost_VkMultisamplePropertiesEXT(ResourceTracker* resourceTracker,
+                                                   VkMultisamplePropertiesEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_blend_operation_advanced
+void transform_tohost_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT* toTransform);
+
+void transform_tohost_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT* toTransform);
+
+void transform_tohost_VkPipelineColorBlendAdvancedStateCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineColorBlendAdvancedStateCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkPipelineColorBlendAdvancedStateCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineColorBlendAdvancedStateCreateInfoEXT* toTransform);
+
+#endif
+#ifdef VK_NV_fragment_coverage_to_color
+void transform_tohost_VkPipelineCoverageToColorStateCreateInfoNV(
+    ResourceTracker* resourceTracker, VkPipelineCoverageToColorStateCreateInfoNV* toTransform);
+
+void transform_fromhost_VkPipelineCoverageToColorStateCreateInfoNV(
+    ResourceTracker* resourceTracker, VkPipelineCoverageToColorStateCreateInfoNV* toTransform);
+
+#endif
+#ifdef VK_NV_framebuffer_mixed_samples
+void transform_tohost_VkPipelineCoverageModulationStateCreateInfoNV(
+    ResourceTracker* resourceTracker, VkPipelineCoverageModulationStateCreateInfoNV* toTransform);
+
+void transform_fromhost_VkPipelineCoverageModulationStateCreateInfoNV(
+    ResourceTracker* resourceTracker, VkPipelineCoverageModulationStateCreateInfoNV* toTransform);
+
+#endif
+#ifdef VK_NV_fill_rectangle
+#endif
+#ifdef VK_NV_shader_sm_builtins
+void transform_tohost_VkPhysicalDeviceShaderSMBuiltinsPropertiesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderSMBuiltinsPropertiesNV* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceShaderSMBuiltinsPropertiesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderSMBuiltinsPropertiesNV* toTransform);
+
+void transform_tohost_VkPhysicalDeviceShaderSMBuiltinsFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderSMBuiltinsFeaturesNV* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceShaderSMBuiltinsFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderSMBuiltinsFeaturesNV* toTransform);
+
+#endif
+#ifdef VK_EXT_post_depth_coverage
+#endif
+#ifdef VK_EXT_image_drm_format_modifier
+void transform_tohost_VkDrmFormatModifierPropertiesEXT(
+    ResourceTracker* resourceTracker, VkDrmFormatModifierPropertiesEXT* toTransform);
+
+void transform_fromhost_VkDrmFormatModifierPropertiesEXT(
+    ResourceTracker* resourceTracker, VkDrmFormatModifierPropertiesEXT* toTransform);
+
+void transform_tohost_VkDrmFormatModifierPropertiesListEXT(
+    ResourceTracker* resourceTracker, VkDrmFormatModifierPropertiesListEXT* toTransform);
+
+void transform_fromhost_VkDrmFormatModifierPropertiesListEXT(
+    ResourceTracker* resourceTracker, VkDrmFormatModifierPropertiesListEXT* toTransform);
+
+void transform_tohost_VkPhysicalDeviceImageDrmFormatModifierInfoEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceImageDrmFormatModifierInfoEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceImageDrmFormatModifierInfoEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceImageDrmFormatModifierInfoEXT* toTransform);
+
+void transform_tohost_VkImageDrmFormatModifierListCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkImageDrmFormatModifierListCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkImageDrmFormatModifierListCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkImageDrmFormatModifierListCreateInfoEXT* toTransform);
+
+void transform_tohost_VkImageDrmFormatModifierExplicitCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkImageDrmFormatModifierExplicitCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkImageDrmFormatModifierExplicitCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkImageDrmFormatModifierExplicitCreateInfoEXT* toTransform);
+
+void transform_tohost_VkImageDrmFormatModifierPropertiesEXT(
+    ResourceTracker* resourceTracker, VkImageDrmFormatModifierPropertiesEXT* toTransform);
+
+void transform_fromhost_VkImageDrmFormatModifierPropertiesEXT(
+    ResourceTracker* resourceTracker, VkImageDrmFormatModifierPropertiesEXT* toTransform);
+
+void transform_tohost_VkDrmFormatModifierProperties2EXT(
+    ResourceTracker* resourceTracker, VkDrmFormatModifierProperties2EXT* toTransform);
+
+void transform_fromhost_VkDrmFormatModifierProperties2EXT(
+    ResourceTracker* resourceTracker, VkDrmFormatModifierProperties2EXT* toTransform);
+
+void transform_tohost_VkDrmFormatModifierPropertiesList2EXT(
+    ResourceTracker* resourceTracker, VkDrmFormatModifierPropertiesList2EXT* toTransform);
+
+void transform_fromhost_VkDrmFormatModifierPropertiesList2EXT(
+    ResourceTracker* resourceTracker, VkDrmFormatModifierPropertiesList2EXT* toTransform);
+
+#endif
+#ifdef VK_EXT_validation_cache
+void transform_tohost_VkValidationCacheCreateInfoEXT(ResourceTracker* resourceTracker,
+                                                     VkValidationCacheCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkValidationCacheCreateInfoEXT(ResourceTracker* resourceTracker,
+                                                       VkValidationCacheCreateInfoEXT* toTransform);
+
+void transform_tohost_VkShaderModuleValidationCacheCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkShaderModuleValidationCacheCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkShaderModuleValidationCacheCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkShaderModuleValidationCacheCreateInfoEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_descriptor_indexing
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkDescriptorSetLayoutBindingFlagsCreateInfo,
+                      transform_tohost_VkDescriptorSetLayoutBindingFlagsCreateInfoEXT)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkDescriptorSetLayoutBindingFlagsCreateInfo,
+                      transform_fromhost_VkDescriptorSetLayoutBindingFlagsCreateInfoEXT)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceDescriptorIndexingFeatures,
+                      transform_tohost_VkPhysicalDeviceDescriptorIndexingFeaturesEXT)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceDescriptorIndexingFeatures,
+                      transform_fromhost_VkPhysicalDeviceDescriptorIndexingFeaturesEXT)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceDescriptorIndexingProperties,
+                      transform_tohost_VkPhysicalDeviceDescriptorIndexingPropertiesEXT)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceDescriptorIndexingProperties,
+                      transform_fromhost_VkPhysicalDeviceDescriptorIndexingPropertiesEXT)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkDescriptorSetVariableDescriptorCountAllocateInfo,
+                      transform_tohost_VkDescriptorSetVariableDescriptorCountAllocateInfoEXT)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkDescriptorSetVariableDescriptorCountAllocateInfo,
+                      transform_fromhost_VkDescriptorSetVariableDescriptorCountAllocateInfoEXT)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkDescriptorSetVariableDescriptorCountLayoutSupport,
+                      transform_tohost_VkDescriptorSetVariableDescriptorCountLayoutSupportEXT)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkDescriptorSetVariableDescriptorCountLayoutSupport,
+                      transform_fromhost_VkDescriptorSetVariableDescriptorCountLayoutSupportEXT)
+
+#endif
+#ifdef VK_EXT_shader_viewport_index_layer
+#endif
+#ifdef VK_NV_shading_rate_image
+void transform_tohost_VkShadingRatePaletteNV(ResourceTracker* resourceTracker,
+                                             VkShadingRatePaletteNV* toTransform);
+
+void transform_fromhost_VkShadingRatePaletteNV(ResourceTracker* resourceTracker,
+                                               VkShadingRatePaletteNV* toTransform);
+
+void transform_tohost_VkPipelineViewportShadingRateImageStateCreateInfoNV(
+    ResourceTracker* resourceTracker,
+    VkPipelineViewportShadingRateImageStateCreateInfoNV* toTransform);
+
+void transform_fromhost_VkPipelineViewportShadingRateImageStateCreateInfoNV(
+    ResourceTracker* resourceTracker,
+    VkPipelineViewportShadingRateImageStateCreateInfoNV* toTransform);
+
+void transform_tohost_VkPhysicalDeviceShadingRateImageFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShadingRateImageFeaturesNV* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceShadingRateImageFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShadingRateImageFeaturesNV* toTransform);
+
+void transform_tohost_VkPhysicalDeviceShadingRateImagePropertiesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShadingRateImagePropertiesNV* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceShadingRateImagePropertiesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShadingRateImagePropertiesNV* toTransform);
+
+void transform_tohost_VkCoarseSampleLocationNV(ResourceTracker* resourceTracker,
+                                               VkCoarseSampleLocationNV* toTransform);
+
+void transform_fromhost_VkCoarseSampleLocationNV(ResourceTracker* resourceTracker,
+                                                 VkCoarseSampleLocationNV* toTransform);
+
+void transform_tohost_VkCoarseSampleOrderCustomNV(ResourceTracker* resourceTracker,
+                                                  VkCoarseSampleOrderCustomNV* toTransform);
+
+void transform_fromhost_VkCoarseSampleOrderCustomNV(ResourceTracker* resourceTracker,
+                                                    VkCoarseSampleOrderCustomNV* toTransform);
+
+void transform_tohost_VkPipelineViewportCoarseSampleOrderStateCreateInfoNV(
+    ResourceTracker* resourceTracker,
+    VkPipelineViewportCoarseSampleOrderStateCreateInfoNV* toTransform);
+
+void transform_fromhost_VkPipelineViewportCoarseSampleOrderStateCreateInfoNV(
+    ResourceTracker* resourceTracker,
+    VkPipelineViewportCoarseSampleOrderStateCreateInfoNV* toTransform);
+
+#endif
+#ifdef VK_NV_ray_tracing
+void transform_tohost_VkRayTracingShaderGroupCreateInfoNV(
+    ResourceTracker* resourceTracker, VkRayTracingShaderGroupCreateInfoNV* toTransform);
+
+void transform_fromhost_VkRayTracingShaderGroupCreateInfoNV(
+    ResourceTracker* resourceTracker, VkRayTracingShaderGroupCreateInfoNV* toTransform);
+
+void transform_tohost_VkRayTracingPipelineCreateInfoNV(
+    ResourceTracker* resourceTracker, VkRayTracingPipelineCreateInfoNV* toTransform);
+
+void transform_fromhost_VkRayTracingPipelineCreateInfoNV(
+    ResourceTracker* resourceTracker, VkRayTracingPipelineCreateInfoNV* toTransform);
+
+void transform_tohost_VkGeometryTrianglesNV(ResourceTracker* resourceTracker,
+                                            VkGeometryTrianglesNV* toTransform);
+
+void transform_fromhost_VkGeometryTrianglesNV(ResourceTracker* resourceTracker,
+                                              VkGeometryTrianglesNV* toTransform);
+
+void transform_tohost_VkGeometryAABBNV(ResourceTracker* resourceTracker,
+                                       VkGeometryAABBNV* toTransform);
+
+void transform_fromhost_VkGeometryAABBNV(ResourceTracker* resourceTracker,
+                                         VkGeometryAABBNV* toTransform);
+
+void transform_tohost_VkGeometryDataNV(ResourceTracker* resourceTracker,
+                                       VkGeometryDataNV* toTransform);
+
+void transform_fromhost_VkGeometryDataNV(ResourceTracker* resourceTracker,
+                                         VkGeometryDataNV* toTransform);
+
+void transform_tohost_VkGeometryNV(ResourceTracker* resourceTracker, VkGeometryNV* toTransform);
+
+void transform_fromhost_VkGeometryNV(ResourceTracker* resourceTracker, VkGeometryNV* toTransform);
+
+void transform_tohost_VkAccelerationStructureInfoNV(ResourceTracker* resourceTracker,
+                                                    VkAccelerationStructureInfoNV* toTransform);
+
+void transform_fromhost_VkAccelerationStructureInfoNV(ResourceTracker* resourceTracker,
+                                                      VkAccelerationStructureInfoNV* toTransform);
+
+void transform_tohost_VkAccelerationStructureCreateInfoNV(
+    ResourceTracker* resourceTracker, VkAccelerationStructureCreateInfoNV* toTransform);
+
+void transform_fromhost_VkAccelerationStructureCreateInfoNV(
+    ResourceTracker* resourceTracker, VkAccelerationStructureCreateInfoNV* toTransform);
+
+void transform_tohost_VkBindAccelerationStructureMemoryInfoNV(
+    ResourceTracker* resourceTracker, VkBindAccelerationStructureMemoryInfoNV* toTransform);
+
+void transform_fromhost_VkBindAccelerationStructureMemoryInfoNV(
+    ResourceTracker* resourceTracker, VkBindAccelerationStructureMemoryInfoNV* toTransform);
+
+void transform_tohost_VkWriteDescriptorSetAccelerationStructureNV(
+    ResourceTracker* resourceTracker, VkWriteDescriptorSetAccelerationStructureNV* toTransform);
+
+void transform_fromhost_VkWriteDescriptorSetAccelerationStructureNV(
+    ResourceTracker* resourceTracker, VkWriteDescriptorSetAccelerationStructureNV* toTransform);
+
+void transform_tohost_VkAccelerationStructureMemoryRequirementsInfoNV(
+    ResourceTracker* resourceTracker, VkAccelerationStructureMemoryRequirementsInfoNV* toTransform);
+
+void transform_fromhost_VkAccelerationStructureMemoryRequirementsInfoNV(
+    ResourceTracker* resourceTracker, VkAccelerationStructureMemoryRequirementsInfoNV* toTransform);
+
+void transform_tohost_VkPhysicalDeviceRayTracingPropertiesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRayTracingPropertiesNV* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceRayTracingPropertiesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRayTracingPropertiesNV* toTransform);
+
+void transform_tohost_VkTransformMatrixKHR(ResourceTracker* resourceTracker,
+                                           VkTransformMatrixKHR* toTransform);
+
+void transform_fromhost_VkTransformMatrixKHR(ResourceTracker* resourceTracker,
+                                             VkTransformMatrixKHR* toTransform);
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkTransformMatrixKHR, transform_tohost_VkTransformMatrixNV)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkTransformMatrixKHR,
+                      transform_fromhost_VkTransformMatrixNV)
+
+void transform_tohost_VkAabbPositionsKHR(ResourceTracker* resourceTracker,
+                                         VkAabbPositionsKHR* toTransform);
+
+void transform_fromhost_VkAabbPositionsKHR(ResourceTracker* resourceTracker,
+                                           VkAabbPositionsKHR* toTransform);
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkAabbPositionsKHR, transform_tohost_VkAabbPositionsNV)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkAabbPositionsKHR, transform_fromhost_VkAabbPositionsNV)
+
+void transform_tohost_VkAccelerationStructureInstanceKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureInstanceKHR* toTransform);
+
+void transform_fromhost_VkAccelerationStructureInstanceKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureInstanceKHR* toTransform);
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkAccelerationStructureInstanceKHR,
+                      transform_tohost_VkAccelerationStructureInstanceNV)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkAccelerationStructureInstanceKHR,
+                      transform_fromhost_VkAccelerationStructureInstanceNV)
+
+#endif
+#ifdef VK_NV_representative_fragment_test
+void transform_tohost_VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV* toTransform);
+
+void transform_tohost_VkPipelineRepresentativeFragmentTestStateCreateInfoNV(
+    ResourceTracker* resourceTracker,
+    VkPipelineRepresentativeFragmentTestStateCreateInfoNV* toTransform);
+
+void transform_fromhost_VkPipelineRepresentativeFragmentTestStateCreateInfoNV(
+    ResourceTracker* resourceTracker,
+    VkPipelineRepresentativeFragmentTestStateCreateInfoNV* toTransform);
+
+#endif
+#ifdef VK_EXT_filter_cubic
+void transform_tohost_VkPhysicalDeviceImageViewImageFormatInfoEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceImageViewImageFormatInfoEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceImageViewImageFormatInfoEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceImageViewImageFormatInfoEXT* toTransform);
+
+void transform_tohost_VkFilterCubicImageViewImageFormatPropertiesEXT(
+    ResourceTracker* resourceTracker, VkFilterCubicImageViewImageFormatPropertiesEXT* toTransform);
+
+void transform_fromhost_VkFilterCubicImageViewImageFormatPropertiesEXT(
+    ResourceTracker* resourceTracker, VkFilterCubicImageViewImageFormatPropertiesEXT* toTransform);
+
+#endif
+#ifdef VK_QCOM_render_pass_shader_resolve
+#endif
+#ifdef VK_EXT_global_priority
+void transform_tohost_VkDeviceQueueGlobalPriorityCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkDeviceQueueGlobalPriorityCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkDeviceQueueGlobalPriorityCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkDeviceQueueGlobalPriorityCreateInfoEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_external_memory_host
+void transform_tohost_VkImportMemoryHostPointerInfoEXT(
+    ResourceTracker* resourceTracker, VkImportMemoryHostPointerInfoEXT* toTransform);
+
+void transform_fromhost_VkImportMemoryHostPointerInfoEXT(
+    ResourceTracker* resourceTracker, VkImportMemoryHostPointerInfoEXT* toTransform);
+
+void transform_tohost_VkMemoryHostPointerPropertiesEXT(
+    ResourceTracker* resourceTracker, VkMemoryHostPointerPropertiesEXT* toTransform);
+
+void transform_fromhost_VkMemoryHostPointerPropertiesEXT(
+    ResourceTracker* resourceTracker, VkMemoryHostPointerPropertiesEXT* toTransform);
+
+void transform_tohost_VkPhysicalDeviceExternalMemoryHostPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceExternalMemoryHostPropertiesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceExternalMemoryHostPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceExternalMemoryHostPropertiesEXT* toTransform);
+
+#endif
+#ifdef VK_AMD_buffer_marker
+#endif
+#ifdef VK_AMD_pipeline_compiler_control
+void transform_tohost_VkPipelineCompilerControlCreateInfoAMD(
+    ResourceTracker* resourceTracker, VkPipelineCompilerControlCreateInfoAMD* toTransform);
+
+void transform_fromhost_VkPipelineCompilerControlCreateInfoAMD(
+    ResourceTracker* resourceTracker, VkPipelineCompilerControlCreateInfoAMD* toTransform);
+
+#endif
+#ifdef VK_EXT_calibrated_timestamps
+void transform_tohost_VkCalibratedTimestampInfoEXT(ResourceTracker* resourceTracker,
+                                                   VkCalibratedTimestampInfoEXT* toTransform);
+
+void transform_fromhost_VkCalibratedTimestampInfoEXT(ResourceTracker* resourceTracker,
+                                                     VkCalibratedTimestampInfoEXT* toTransform);
+
+#endif
+#ifdef VK_AMD_shader_core_properties
+void transform_tohost_VkPhysicalDeviceShaderCorePropertiesAMD(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderCorePropertiesAMD* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceShaderCorePropertiesAMD(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderCorePropertiesAMD* toTransform);
+
+#endif
+#ifdef VK_EXT_video_decode_h265
+void transform_tohost_VkVideoDecodeH265ProfileEXT(ResourceTracker* resourceTracker,
+                                                  VkVideoDecodeH265ProfileEXT* toTransform);
+
+void transform_fromhost_VkVideoDecodeH265ProfileEXT(ResourceTracker* resourceTracker,
+                                                    VkVideoDecodeH265ProfileEXT* toTransform);
+
+void transform_tohost_VkVideoDecodeH265CapabilitiesEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH265CapabilitiesEXT* toTransform);
+
+void transform_fromhost_VkVideoDecodeH265CapabilitiesEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH265CapabilitiesEXT* toTransform);
+
+void transform_tohost_VkVideoDecodeH265SessionCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH265SessionCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkVideoDecodeH265SessionCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH265SessionCreateInfoEXT* toTransform);
+
+void transform_tohost_VkVideoDecodeH265SessionParametersAddInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH265SessionParametersAddInfoEXT* toTransform);
+
+void transform_fromhost_VkVideoDecodeH265SessionParametersAddInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH265SessionParametersAddInfoEXT* toTransform);
+
+void transform_tohost_VkVideoDecodeH265SessionParametersCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH265SessionParametersCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkVideoDecodeH265SessionParametersCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH265SessionParametersCreateInfoEXT* toTransform);
+
+void transform_tohost_VkVideoDecodeH265PictureInfoEXT(ResourceTracker* resourceTracker,
+                                                      VkVideoDecodeH265PictureInfoEXT* toTransform);
+
+void transform_fromhost_VkVideoDecodeH265PictureInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH265PictureInfoEXT* toTransform);
+
+void transform_tohost_VkVideoDecodeH265DpbSlotInfoEXT(ResourceTracker* resourceTracker,
+                                                      VkVideoDecodeH265DpbSlotInfoEXT* toTransform);
+
+void transform_fromhost_VkVideoDecodeH265DpbSlotInfoEXT(
+    ResourceTracker* resourceTracker, VkVideoDecodeH265DpbSlotInfoEXT* toTransform);
+
+#endif
+#ifdef VK_AMD_memory_overallocation_behavior
+void transform_tohost_VkDeviceMemoryOverallocationCreateInfoAMD(
+    ResourceTracker* resourceTracker, VkDeviceMemoryOverallocationCreateInfoAMD* toTransform);
+
+void transform_fromhost_VkDeviceMemoryOverallocationCreateInfoAMD(
+    ResourceTracker* resourceTracker, VkDeviceMemoryOverallocationCreateInfoAMD* toTransform);
+
+#endif
+#ifdef VK_EXT_vertex_attribute_divisor
+void transform_tohost_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT* toTransform);
+
+void transform_tohost_VkVertexInputBindingDivisorDescriptionEXT(
+    ResourceTracker* resourceTracker, VkVertexInputBindingDivisorDescriptionEXT* toTransform);
+
+void transform_fromhost_VkVertexInputBindingDivisorDescriptionEXT(
+    ResourceTracker* resourceTracker, VkVertexInputBindingDivisorDescriptionEXT* toTransform);
+
+void transform_tohost_VkPipelineVertexInputDivisorStateCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineVertexInputDivisorStateCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkPipelineVertexInputDivisorStateCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineVertexInputDivisorStateCreateInfoEXT* toTransform);
+
+void transform_tohost_VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT* toTransform);
+
+#endif
+#ifdef VK_GGP_frame_token
+void transform_tohost_VkPresentFrameTokenGGP(ResourceTracker* resourceTracker,
+                                             VkPresentFrameTokenGGP* toTransform);
+
+void transform_fromhost_VkPresentFrameTokenGGP(ResourceTracker* resourceTracker,
+                                               VkPresentFrameTokenGGP* toTransform);
+
+#endif
+#ifdef VK_EXT_pipeline_creation_feedback
+void transform_tohost_VkPipelineCreationFeedbackEXT(ResourceTracker* resourceTracker,
+                                                    VkPipelineCreationFeedbackEXT* toTransform);
+
+void transform_fromhost_VkPipelineCreationFeedbackEXT(ResourceTracker* resourceTracker,
+                                                      VkPipelineCreationFeedbackEXT* toTransform);
+
+void transform_tohost_VkPipelineCreationFeedbackCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineCreationFeedbackCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkPipelineCreationFeedbackCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineCreationFeedbackCreateInfoEXT* toTransform);
+
+#endif
+#ifdef VK_NV_shader_subgroup_partitioned
+#endif
+#ifdef VK_NV_compute_shader_derivatives
+void transform_tohost_VkPhysicalDeviceComputeShaderDerivativesFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceComputeShaderDerivativesFeaturesNV* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceComputeShaderDerivativesFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceComputeShaderDerivativesFeaturesNV* toTransform);
+
+#endif
+#ifdef VK_NV_mesh_shader
+void transform_tohost_VkPhysicalDeviceMeshShaderFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMeshShaderFeaturesNV* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceMeshShaderFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMeshShaderFeaturesNV* toTransform);
+
+void transform_tohost_VkPhysicalDeviceMeshShaderPropertiesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMeshShaderPropertiesNV* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceMeshShaderPropertiesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMeshShaderPropertiesNV* toTransform);
+
+void transform_tohost_VkDrawMeshTasksIndirectCommandNV(
+    ResourceTracker* resourceTracker, VkDrawMeshTasksIndirectCommandNV* toTransform);
+
+void transform_fromhost_VkDrawMeshTasksIndirectCommandNV(
+    ResourceTracker* resourceTracker, VkDrawMeshTasksIndirectCommandNV* toTransform);
+
+#endif
+#ifdef VK_NV_fragment_shader_barycentric
+void transform_tohost_VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV* toTransform);
+
+#endif
+#ifdef VK_NV_shader_image_footprint
+void transform_tohost_VkPhysicalDeviceShaderImageFootprintFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderImageFootprintFeaturesNV* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceShaderImageFootprintFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderImageFootprintFeaturesNV* toTransform);
+
+#endif
+#ifdef VK_NV_scissor_exclusive
+void transform_tohost_VkPipelineViewportExclusiveScissorStateCreateInfoNV(
+    ResourceTracker* resourceTracker,
+    VkPipelineViewportExclusiveScissorStateCreateInfoNV* toTransform);
+
+void transform_fromhost_VkPipelineViewportExclusiveScissorStateCreateInfoNV(
+    ResourceTracker* resourceTracker,
+    VkPipelineViewportExclusiveScissorStateCreateInfoNV* toTransform);
+
+void transform_tohost_VkPhysicalDeviceExclusiveScissorFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceExclusiveScissorFeaturesNV* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceExclusiveScissorFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceExclusiveScissorFeaturesNV* toTransform);
+
+#endif
+#ifdef VK_NV_device_diagnostic_checkpoints
+void transform_tohost_VkQueueFamilyCheckpointPropertiesNV(
+    ResourceTracker* resourceTracker, VkQueueFamilyCheckpointPropertiesNV* toTransform);
+
+void transform_fromhost_VkQueueFamilyCheckpointPropertiesNV(
+    ResourceTracker* resourceTracker, VkQueueFamilyCheckpointPropertiesNV* toTransform);
+
+void transform_tohost_VkCheckpointDataNV(ResourceTracker* resourceTracker,
+                                         VkCheckpointDataNV* toTransform);
+
+void transform_fromhost_VkCheckpointDataNV(ResourceTracker* resourceTracker,
+                                           VkCheckpointDataNV* toTransform);
+
+#endif
+#ifdef VK_INTEL_shader_integer_functions2
+void transform_tohost_VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL* toTransform);
+
+#endif
+#ifdef VK_INTEL_performance_query
+void transform_tohost_VkPerformanceValueDataINTEL(ResourceTracker* resourceTracker,
+                                                  VkPerformanceValueDataINTEL* toTransform);
+
+void transform_fromhost_VkPerformanceValueDataINTEL(ResourceTracker* resourceTracker,
+                                                    VkPerformanceValueDataINTEL* toTransform);
+
+void transform_tohost_VkPerformanceValueINTEL(ResourceTracker* resourceTracker,
+                                              VkPerformanceValueINTEL* toTransform);
+
+void transform_fromhost_VkPerformanceValueINTEL(ResourceTracker* resourceTracker,
+                                                VkPerformanceValueINTEL* toTransform);
+
+void transform_tohost_VkInitializePerformanceApiInfoINTEL(
+    ResourceTracker* resourceTracker, VkInitializePerformanceApiInfoINTEL* toTransform);
+
+void transform_fromhost_VkInitializePerformanceApiInfoINTEL(
+    ResourceTracker* resourceTracker, VkInitializePerformanceApiInfoINTEL* toTransform);
+
+void transform_tohost_VkQueryPoolPerformanceQueryCreateInfoINTEL(
+    ResourceTracker* resourceTracker, VkQueryPoolPerformanceQueryCreateInfoINTEL* toTransform);
+
+void transform_fromhost_VkQueryPoolPerformanceQueryCreateInfoINTEL(
+    ResourceTracker* resourceTracker, VkQueryPoolPerformanceQueryCreateInfoINTEL* toTransform);
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkQueryPoolPerformanceQueryCreateInfoINTEL,
+                      transform_tohost_VkQueryPoolCreateInfoINTEL)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkQueryPoolPerformanceQueryCreateInfoINTEL,
+                      transform_fromhost_VkQueryPoolCreateInfoINTEL)
+
+void transform_tohost_VkPerformanceMarkerInfoINTEL(ResourceTracker* resourceTracker,
+                                                   VkPerformanceMarkerInfoINTEL* toTransform);
+
+void transform_fromhost_VkPerformanceMarkerInfoINTEL(ResourceTracker* resourceTracker,
+                                                     VkPerformanceMarkerInfoINTEL* toTransform);
+
+void transform_tohost_VkPerformanceStreamMarkerInfoINTEL(
+    ResourceTracker* resourceTracker, VkPerformanceStreamMarkerInfoINTEL* toTransform);
+
+void transform_fromhost_VkPerformanceStreamMarkerInfoINTEL(
+    ResourceTracker* resourceTracker, VkPerformanceStreamMarkerInfoINTEL* toTransform);
+
+void transform_tohost_VkPerformanceOverrideInfoINTEL(ResourceTracker* resourceTracker,
+                                                     VkPerformanceOverrideInfoINTEL* toTransform);
+
+void transform_fromhost_VkPerformanceOverrideInfoINTEL(ResourceTracker* resourceTracker,
+                                                       VkPerformanceOverrideInfoINTEL* toTransform);
+
+void transform_tohost_VkPerformanceConfigurationAcquireInfoINTEL(
+    ResourceTracker* resourceTracker, VkPerformanceConfigurationAcquireInfoINTEL* toTransform);
+
+void transform_fromhost_VkPerformanceConfigurationAcquireInfoINTEL(
+    ResourceTracker* resourceTracker, VkPerformanceConfigurationAcquireInfoINTEL* toTransform);
+
+#endif
+#ifdef VK_EXT_pci_bus_info
+void transform_tohost_VkPhysicalDevicePCIBusInfoPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePCIBusInfoPropertiesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDevicePCIBusInfoPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePCIBusInfoPropertiesEXT* toTransform);
+
+#endif
+#ifdef VK_AMD_display_native_hdr
+void transform_tohost_VkDisplayNativeHdrSurfaceCapabilitiesAMD(
+    ResourceTracker* resourceTracker, VkDisplayNativeHdrSurfaceCapabilitiesAMD* toTransform);
+
+void transform_fromhost_VkDisplayNativeHdrSurfaceCapabilitiesAMD(
+    ResourceTracker* resourceTracker, VkDisplayNativeHdrSurfaceCapabilitiesAMD* toTransform);
+
+void transform_tohost_VkSwapchainDisplayNativeHdrCreateInfoAMD(
+    ResourceTracker* resourceTracker, VkSwapchainDisplayNativeHdrCreateInfoAMD* toTransform);
+
+void transform_fromhost_VkSwapchainDisplayNativeHdrCreateInfoAMD(
+    ResourceTracker* resourceTracker, VkSwapchainDisplayNativeHdrCreateInfoAMD* toTransform);
+
+#endif
+#ifdef VK_FUCHSIA_imagepipe_surface
+void transform_tohost_VkImagePipeSurfaceCreateInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkImagePipeSurfaceCreateInfoFUCHSIA* toTransform);
+
+void transform_fromhost_VkImagePipeSurfaceCreateInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkImagePipeSurfaceCreateInfoFUCHSIA* toTransform);
+
+#endif
+#ifdef VK_EXT_metal_surface
+void transform_tohost_VkMetalSurfaceCreateInfoEXT(ResourceTracker* resourceTracker,
+                                                  VkMetalSurfaceCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkMetalSurfaceCreateInfoEXT(ResourceTracker* resourceTracker,
+                                                    VkMetalSurfaceCreateInfoEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_fragment_density_map
+void transform_tohost_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceFragmentDensityMapFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceFragmentDensityMapFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceFragmentDensityMapFeaturesEXT* toTransform);
+
+void transform_tohost_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceFragmentDensityMapPropertiesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceFragmentDensityMapPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceFragmentDensityMapPropertiesEXT* toTransform);
+
+void transform_tohost_VkRenderPassFragmentDensityMapCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkRenderPassFragmentDensityMapCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkRenderPassFragmentDensityMapCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkRenderPassFragmentDensityMapCreateInfoEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_scalar_block_layout
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceScalarBlockLayoutFeatures,
+                      transform_tohost_VkPhysicalDeviceScalarBlockLayoutFeaturesEXT)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceScalarBlockLayoutFeatures,
+                      transform_fromhost_VkPhysicalDeviceScalarBlockLayoutFeaturesEXT)
+
+#endif
+#ifdef VK_GOOGLE_hlsl_functionality1
+#endif
+#ifdef VK_GOOGLE_decorate_string
+#endif
+#ifdef VK_EXT_subgroup_size_control
+void transform_tohost_VkPhysicalDeviceSubgroupSizeControlFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSubgroupSizeControlFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceSubgroupSizeControlFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSubgroupSizeControlFeaturesEXT* toTransform);
+
+void transform_tohost_VkPhysicalDeviceSubgroupSizeControlPropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceSubgroupSizeControlPropertiesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceSubgroupSizeControlPropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceSubgroupSizeControlPropertiesEXT* toTransform);
+
+void transform_tohost_VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT* toTransform);
+
+#endif
+#ifdef VK_AMD_shader_core_properties2
+void transform_tohost_VkPhysicalDeviceShaderCoreProperties2AMD(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderCoreProperties2AMD* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceShaderCoreProperties2AMD(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderCoreProperties2AMD* toTransform);
+
+#endif
+#ifdef VK_AMD_device_coherent_memory
+void transform_tohost_VkPhysicalDeviceCoherentMemoryFeaturesAMD(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceCoherentMemoryFeaturesAMD* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceCoherentMemoryFeaturesAMD(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceCoherentMemoryFeaturesAMD* toTransform);
+
+#endif
+#ifdef VK_EXT_shader_image_atomic_int64
+void transform_tohost_VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_memory_budget
+void transform_tohost_VkPhysicalDeviceMemoryBudgetPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMemoryBudgetPropertiesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceMemoryBudgetPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMemoryBudgetPropertiesEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_memory_priority
+void transform_tohost_VkPhysicalDeviceMemoryPriorityFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMemoryPriorityFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceMemoryPriorityFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMemoryPriorityFeaturesEXT* toTransform);
+
+void transform_tohost_VkMemoryPriorityAllocateInfoEXT(ResourceTracker* resourceTracker,
+                                                      VkMemoryPriorityAllocateInfoEXT* toTransform);
+
+void transform_fromhost_VkMemoryPriorityAllocateInfoEXT(
+    ResourceTracker* resourceTracker, VkMemoryPriorityAllocateInfoEXT* toTransform);
+
+#endif
+#ifdef VK_NV_dedicated_allocation_image_aliasing
+void transform_tohost_VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV* toTransform);
+
+#endif
+#ifdef VK_EXT_buffer_device_address
+void transform_tohost_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceBufferDeviceAddressFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceBufferDeviceAddressFeaturesEXT* toTransform);
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT,
+                      transform_tohost_VkPhysicalDeviceBufferAddressFeaturesEXT)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceBufferDeviceAddressFeaturesEXT,
+                      transform_fromhost_VkPhysicalDeviceBufferAddressFeaturesEXT)
+
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkBufferDeviceAddressInfo,
+                      transform_tohost_VkBufferDeviceAddressInfoEXT)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkBufferDeviceAddressInfo,
+                      transform_fromhost_VkBufferDeviceAddressInfoEXT)
+
+void transform_tohost_VkBufferDeviceAddressCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkBufferDeviceAddressCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkBufferDeviceAddressCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkBufferDeviceAddressCreateInfoEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_tooling_info
+void transform_tohost_VkPhysicalDeviceToolPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceToolPropertiesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceToolPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceToolPropertiesEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_separate_stencil_usage
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkImageStencilUsageCreateInfo,
+                      transform_tohost_VkImageStencilUsageCreateInfoEXT)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkImageStencilUsageCreateInfo,
+                      transform_fromhost_VkImageStencilUsageCreateInfoEXT)
+
+#endif
+#ifdef VK_EXT_validation_features
+void transform_tohost_VkValidationFeaturesEXT(ResourceTracker* resourceTracker,
+                                              VkValidationFeaturesEXT* toTransform);
+
+void transform_fromhost_VkValidationFeaturesEXT(ResourceTracker* resourceTracker,
+                                                VkValidationFeaturesEXT* toTransform);
+
+#endif
+#ifdef VK_NV_cooperative_matrix
+void transform_tohost_VkCooperativeMatrixPropertiesNV(ResourceTracker* resourceTracker,
+                                                      VkCooperativeMatrixPropertiesNV* toTransform);
+
+void transform_fromhost_VkCooperativeMatrixPropertiesNV(
+    ResourceTracker* resourceTracker, VkCooperativeMatrixPropertiesNV* toTransform);
+
+void transform_tohost_VkPhysicalDeviceCooperativeMatrixFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceCooperativeMatrixFeaturesNV* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceCooperativeMatrixFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceCooperativeMatrixFeaturesNV* toTransform);
+
+void transform_tohost_VkPhysicalDeviceCooperativeMatrixPropertiesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceCooperativeMatrixPropertiesNV* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceCooperativeMatrixPropertiesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceCooperativeMatrixPropertiesNV* toTransform);
+
+#endif
+#ifdef VK_NV_coverage_reduction_mode
+void transform_tohost_VkPhysicalDeviceCoverageReductionModeFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceCoverageReductionModeFeaturesNV* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceCoverageReductionModeFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceCoverageReductionModeFeaturesNV* toTransform);
+
+void transform_tohost_VkPipelineCoverageReductionStateCreateInfoNV(
+    ResourceTracker* resourceTracker, VkPipelineCoverageReductionStateCreateInfoNV* toTransform);
+
+void transform_fromhost_VkPipelineCoverageReductionStateCreateInfoNV(
+    ResourceTracker* resourceTracker, VkPipelineCoverageReductionStateCreateInfoNV* toTransform);
+
+void transform_tohost_VkFramebufferMixedSamplesCombinationNV(
+    ResourceTracker* resourceTracker, VkFramebufferMixedSamplesCombinationNV* toTransform);
+
+void transform_fromhost_VkFramebufferMixedSamplesCombinationNV(
+    ResourceTracker* resourceTracker, VkFramebufferMixedSamplesCombinationNV* toTransform);
+
+#endif
+#ifdef VK_EXT_fragment_shader_interlock
+void transform_tohost_VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_ycbcr_image_arrays
+void transform_tohost_VkPhysicalDeviceYcbcrImageArraysFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceYcbcrImageArraysFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceYcbcrImageArraysFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceYcbcrImageArraysFeaturesEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_provoking_vertex
+void transform_tohost_VkPhysicalDeviceProvokingVertexFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceProvokingVertexFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceProvokingVertexFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceProvokingVertexFeaturesEXT* toTransform);
+
+void transform_tohost_VkPhysicalDeviceProvokingVertexPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceProvokingVertexPropertiesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceProvokingVertexPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceProvokingVertexPropertiesEXT* toTransform);
+
+void transform_tohost_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkPipelineRasterizationProvokingVertexStateCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkPipelineRasterizationProvokingVertexStateCreateInfoEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_full_screen_exclusive
+void transform_tohost_VkSurfaceFullScreenExclusiveInfoEXT(
+    ResourceTracker* resourceTracker, VkSurfaceFullScreenExclusiveInfoEXT* toTransform);
+
+void transform_fromhost_VkSurfaceFullScreenExclusiveInfoEXT(
+    ResourceTracker* resourceTracker, VkSurfaceFullScreenExclusiveInfoEXT* toTransform);
+
+void transform_tohost_VkSurfaceCapabilitiesFullScreenExclusiveEXT(
+    ResourceTracker* resourceTracker, VkSurfaceCapabilitiesFullScreenExclusiveEXT* toTransform);
+
+void transform_fromhost_VkSurfaceCapabilitiesFullScreenExclusiveEXT(
+    ResourceTracker* resourceTracker, VkSurfaceCapabilitiesFullScreenExclusiveEXT* toTransform);
+
+void transform_tohost_VkSurfaceFullScreenExclusiveWin32InfoEXT(
+    ResourceTracker* resourceTracker, VkSurfaceFullScreenExclusiveWin32InfoEXT* toTransform);
+
+void transform_fromhost_VkSurfaceFullScreenExclusiveWin32InfoEXT(
+    ResourceTracker* resourceTracker, VkSurfaceFullScreenExclusiveWin32InfoEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_headless_surface
+void transform_tohost_VkHeadlessSurfaceCreateInfoEXT(ResourceTracker* resourceTracker,
+                                                     VkHeadlessSurfaceCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkHeadlessSurfaceCreateInfoEXT(ResourceTracker* resourceTracker,
+                                                       VkHeadlessSurfaceCreateInfoEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_line_rasterization
+void transform_tohost_VkPhysicalDeviceLineRasterizationFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceLineRasterizationFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceLineRasterizationFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceLineRasterizationFeaturesEXT* toTransform);
+
+void transform_tohost_VkPhysicalDeviceLineRasterizationPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceLineRasterizationPropertiesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceLineRasterizationPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceLineRasterizationPropertiesEXT* toTransform);
+
+void transform_tohost_VkPipelineRasterizationLineStateCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineRasterizationLineStateCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkPipelineRasterizationLineStateCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineRasterizationLineStateCreateInfoEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_shader_atomic_float
+void transform_tohost_VkPhysicalDeviceShaderAtomicFloatFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderAtomicFloatFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceShaderAtomicFloatFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderAtomicFloatFeaturesEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_host_query_reset
+DEFINE_ALIAS_FUNCTION(transform_tohost_VkPhysicalDeviceHostQueryResetFeatures,
+                      transform_tohost_VkPhysicalDeviceHostQueryResetFeaturesEXT)
+
+DEFINE_ALIAS_FUNCTION(transform_fromhost_VkPhysicalDeviceHostQueryResetFeatures,
+                      transform_fromhost_VkPhysicalDeviceHostQueryResetFeaturesEXT)
+
+#endif
+#ifdef VK_EXT_index_type_uint8
+void transform_tohost_VkPhysicalDeviceIndexTypeUint8FeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceIndexTypeUint8FeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceIndexTypeUint8FeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceIndexTypeUint8FeaturesEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+void transform_tohost_VkPhysicalDeviceExtendedDynamicStateFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceExtendedDynamicStateFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceExtendedDynamicStateFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceExtendedDynamicStateFeaturesEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_shader_atomic_float2
+void transform_tohost_VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_shader_demote_to_helper_invocation
+void transform_tohost_VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT* toTransform);
+
+#endif
+#ifdef VK_NV_device_generated_commands
+void transform_tohost_VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV* toTransform);
+
+void transform_tohost_VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV* toTransform);
+
+void transform_tohost_VkGraphicsShaderGroupCreateInfoNV(
+    ResourceTracker* resourceTracker, VkGraphicsShaderGroupCreateInfoNV* toTransform);
+
+void transform_fromhost_VkGraphicsShaderGroupCreateInfoNV(
+    ResourceTracker* resourceTracker, VkGraphicsShaderGroupCreateInfoNV* toTransform);
+
+void transform_tohost_VkGraphicsPipelineShaderGroupsCreateInfoNV(
+    ResourceTracker* resourceTracker, VkGraphicsPipelineShaderGroupsCreateInfoNV* toTransform);
+
+void transform_fromhost_VkGraphicsPipelineShaderGroupsCreateInfoNV(
+    ResourceTracker* resourceTracker, VkGraphicsPipelineShaderGroupsCreateInfoNV* toTransform);
+
+void transform_tohost_VkBindShaderGroupIndirectCommandNV(
+    ResourceTracker* resourceTracker, VkBindShaderGroupIndirectCommandNV* toTransform);
+
+void transform_fromhost_VkBindShaderGroupIndirectCommandNV(
+    ResourceTracker* resourceTracker, VkBindShaderGroupIndirectCommandNV* toTransform);
+
+void transform_tohost_VkBindIndexBufferIndirectCommandNV(
+    ResourceTracker* resourceTracker, VkBindIndexBufferIndirectCommandNV* toTransform);
+
+void transform_fromhost_VkBindIndexBufferIndirectCommandNV(
+    ResourceTracker* resourceTracker, VkBindIndexBufferIndirectCommandNV* toTransform);
+
+void transform_tohost_VkBindVertexBufferIndirectCommandNV(
+    ResourceTracker* resourceTracker, VkBindVertexBufferIndirectCommandNV* toTransform);
+
+void transform_fromhost_VkBindVertexBufferIndirectCommandNV(
+    ResourceTracker* resourceTracker, VkBindVertexBufferIndirectCommandNV* toTransform);
+
+void transform_tohost_VkSetStateFlagsIndirectCommandNV(
+    ResourceTracker* resourceTracker, VkSetStateFlagsIndirectCommandNV* toTransform);
+
+void transform_fromhost_VkSetStateFlagsIndirectCommandNV(
+    ResourceTracker* resourceTracker, VkSetStateFlagsIndirectCommandNV* toTransform);
+
+void transform_tohost_VkIndirectCommandsStreamNV(ResourceTracker* resourceTracker,
+                                                 VkIndirectCommandsStreamNV* toTransform);
+
+void transform_fromhost_VkIndirectCommandsStreamNV(ResourceTracker* resourceTracker,
+                                                   VkIndirectCommandsStreamNV* toTransform);
+
+void transform_tohost_VkIndirectCommandsLayoutTokenNV(ResourceTracker* resourceTracker,
+                                                      VkIndirectCommandsLayoutTokenNV* toTransform);
+
+void transform_fromhost_VkIndirectCommandsLayoutTokenNV(
+    ResourceTracker* resourceTracker, VkIndirectCommandsLayoutTokenNV* toTransform);
+
+void transform_tohost_VkIndirectCommandsLayoutCreateInfoNV(
+    ResourceTracker* resourceTracker, VkIndirectCommandsLayoutCreateInfoNV* toTransform);
+
+void transform_fromhost_VkIndirectCommandsLayoutCreateInfoNV(
+    ResourceTracker* resourceTracker, VkIndirectCommandsLayoutCreateInfoNV* toTransform);
+
+void transform_tohost_VkGeneratedCommandsInfoNV(ResourceTracker* resourceTracker,
+                                                VkGeneratedCommandsInfoNV* toTransform);
+
+void transform_fromhost_VkGeneratedCommandsInfoNV(ResourceTracker* resourceTracker,
+                                                  VkGeneratedCommandsInfoNV* toTransform);
+
+void transform_tohost_VkGeneratedCommandsMemoryRequirementsInfoNV(
+    ResourceTracker* resourceTracker, VkGeneratedCommandsMemoryRequirementsInfoNV* toTransform);
+
+void transform_fromhost_VkGeneratedCommandsMemoryRequirementsInfoNV(
+    ResourceTracker* resourceTracker, VkGeneratedCommandsMemoryRequirementsInfoNV* toTransform);
+
+#endif
+#ifdef VK_NV_inherited_viewport_scissor
+void transform_tohost_VkPhysicalDeviceInheritedViewportScissorFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceInheritedViewportScissorFeaturesNV* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceInheritedViewportScissorFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceInheritedViewportScissorFeaturesNV* toTransform);
+
+void transform_tohost_VkCommandBufferInheritanceViewportScissorInfoNV(
+    ResourceTracker* resourceTracker, VkCommandBufferInheritanceViewportScissorInfoNV* toTransform);
+
+void transform_fromhost_VkCommandBufferInheritanceViewportScissorInfoNV(
+    ResourceTracker* resourceTracker, VkCommandBufferInheritanceViewportScissorInfoNV* toTransform);
+
+#endif
+#ifdef VK_EXT_texel_buffer_alignment
+void transform_tohost_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT* toTransform);
+
+void transform_tohost_VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT* toTransform);
+
+#endif
+#ifdef VK_QCOM_render_pass_transform
+void transform_tohost_VkRenderPassTransformBeginInfoQCOM(
+    ResourceTracker* resourceTracker, VkRenderPassTransformBeginInfoQCOM* toTransform);
+
+void transform_fromhost_VkRenderPassTransformBeginInfoQCOM(
+    ResourceTracker* resourceTracker, VkRenderPassTransformBeginInfoQCOM* toTransform);
+
+void transform_tohost_VkCommandBufferInheritanceRenderPassTransformInfoQCOM(
+    ResourceTracker* resourceTracker,
+    VkCommandBufferInheritanceRenderPassTransformInfoQCOM* toTransform);
+
+void transform_fromhost_VkCommandBufferInheritanceRenderPassTransformInfoQCOM(
+    ResourceTracker* resourceTracker,
+    VkCommandBufferInheritanceRenderPassTransformInfoQCOM* toTransform);
+
+#endif
+#ifdef VK_EXT_device_memory_report
+void transform_tohost_VkPhysicalDeviceDeviceMemoryReportFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDeviceMemoryReportFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceDeviceMemoryReportFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDeviceMemoryReportFeaturesEXT* toTransform);
+
+void transform_tohost_VkDeviceMemoryReportCallbackDataEXT(
+    ResourceTracker* resourceTracker, VkDeviceMemoryReportCallbackDataEXT* toTransform);
+
+void transform_fromhost_VkDeviceMemoryReportCallbackDataEXT(
+    ResourceTracker* resourceTracker, VkDeviceMemoryReportCallbackDataEXT* toTransform);
+
+void transform_tohost_VkDeviceDeviceMemoryReportCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkDeviceDeviceMemoryReportCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkDeviceDeviceMemoryReportCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkDeviceDeviceMemoryReportCreateInfoEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_acquire_drm_display
+#endif
+#ifdef VK_EXT_robustness2
+void transform_tohost_VkPhysicalDeviceRobustness2FeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRobustness2FeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceRobustness2FeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRobustness2FeaturesEXT* toTransform);
+
+void transform_tohost_VkPhysicalDeviceRobustness2PropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRobustness2PropertiesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceRobustness2PropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRobustness2PropertiesEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_custom_border_color
+void transform_tohost_VkSamplerCustomBorderColorCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkSamplerCustomBorderColorCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkSamplerCustomBorderColorCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkSamplerCustomBorderColorCreateInfoEXT* toTransform);
+
+void transform_tohost_VkPhysicalDeviceCustomBorderColorPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceCustomBorderColorPropertiesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceCustomBorderColorPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceCustomBorderColorPropertiesEXT* toTransform);
+
+void transform_tohost_VkPhysicalDeviceCustomBorderColorFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceCustomBorderColorFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceCustomBorderColorFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceCustomBorderColorFeaturesEXT* toTransform);
+
+#endif
+#ifdef VK_GOOGLE_user_type
+#endif
+#ifdef VK_EXT_private_data
+void transform_tohost_VkPhysicalDevicePrivateDataFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePrivateDataFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDevicePrivateDataFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDevicePrivateDataFeaturesEXT* toTransform);
+
+void transform_tohost_VkDevicePrivateDataCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkDevicePrivateDataCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkDevicePrivateDataCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkDevicePrivateDataCreateInfoEXT* toTransform);
+
+void transform_tohost_VkPrivateDataSlotCreateInfoEXT(ResourceTracker* resourceTracker,
+                                                     VkPrivateDataSlotCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkPrivateDataSlotCreateInfoEXT(ResourceTracker* resourceTracker,
+                                                       VkPrivateDataSlotCreateInfoEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_pipeline_creation_cache_control
+void transform_tohost_VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT* toTransform);
+
+#endif
+#ifdef VK_NV_device_diagnostics_config
+void transform_tohost_VkPhysicalDeviceDiagnosticsConfigFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDiagnosticsConfigFeaturesNV* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceDiagnosticsConfigFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDiagnosticsConfigFeaturesNV* toTransform);
+
+void transform_tohost_VkDeviceDiagnosticsConfigCreateInfoNV(
+    ResourceTracker* resourceTracker, VkDeviceDiagnosticsConfigCreateInfoNV* toTransform);
+
+void transform_fromhost_VkDeviceDiagnosticsConfigCreateInfoNV(
+    ResourceTracker* resourceTracker, VkDeviceDiagnosticsConfigCreateInfoNV* toTransform);
+
+#endif
+#ifdef VK_QCOM_render_pass_store_ops
+#endif
+#ifdef VK_NV_fragment_shading_rate_enums
+void transform_tohost_VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV* toTransform);
+
+void transform_tohost_VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV* toTransform);
+
+void transform_tohost_VkPipelineFragmentShadingRateEnumStateCreateInfoNV(
+    ResourceTracker* resourceTracker,
+    VkPipelineFragmentShadingRateEnumStateCreateInfoNV* toTransform);
+
+void transform_fromhost_VkPipelineFragmentShadingRateEnumStateCreateInfoNV(
+    ResourceTracker* resourceTracker,
+    VkPipelineFragmentShadingRateEnumStateCreateInfoNV* toTransform);
+
+#endif
+#ifdef VK_NV_ray_tracing_motion_blur
+void transform_tohost_VkDeviceOrHostAddressConstKHR(ResourceTracker* resourceTracker,
+                                                    VkDeviceOrHostAddressConstKHR* toTransform);
+
+void transform_fromhost_VkDeviceOrHostAddressConstKHR(ResourceTracker* resourceTracker,
+                                                      VkDeviceOrHostAddressConstKHR* toTransform);
+
+void transform_tohost_VkAccelerationStructureGeometryMotionTrianglesDataNV(
+    ResourceTracker* resourceTracker,
+    VkAccelerationStructureGeometryMotionTrianglesDataNV* toTransform);
+
+void transform_fromhost_VkAccelerationStructureGeometryMotionTrianglesDataNV(
+    ResourceTracker* resourceTracker,
+    VkAccelerationStructureGeometryMotionTrianglesDataNV* toTransform);
+
+void transform_tohost_VkAccelerationStructureMotionInfoNV(
+    ResourceTracker* resourceTracker, VkAccelerationStructureMotionInfoNV* toTransform);
+
+void transform_fromhost_VkAccelerationStructureMotionInfoNV(
+    ResourceTracker* resourceTracker, VkAccelerationStructureMotionInfoNV* toTransform);
+
+void transform_tohost_VkAccelerationStructureMatrixMotionInstanceNV(
+    ResourceTracker* resourceTracker, VkAccelerationStructureMatrixMotionInstanceNV* toTransform);
+
+void transform_fromhost_VkAccelerationStructureMatrixMotionInstanceNV(
+    ResourceTracker* resourceTracker, VkAccelerationStructureMatrixMotionInstanceNV* toTransform);
+
+void transform_tohost_VkSRTDataNV(ResourceTracker* resourceTracker, VkSRTDataNV* toTransform);
+
+void transform_fromhost_VkSRTDataNV(ResourceTracker* resourceTracker, VkSRTDataNV* toTransform);
+
+void transform_tohost_VkAccelerationStructureSRTMotionInstanceNV(
+    ResourceTracker* resourceTracker, VkAccelerationStructureSRTMotionInstanceNV* toTransform);
+
+void transform_fromhost_VkAccelerationStructureSRTMotionInstanceNV(
+    ResourceTracker* resourceTracker, VkAccelerationStructureSRTMotionInstanceNV* toTransform);
+
+void transform_tohost_VkAccelerationStructureMotionInstanceDataNV(
+    ResourceTracker* resourceTracker, VkAccelerationStructureMotionInstanceDataNV* toTransform);
+
+void transform_fromhost_VkAccelerationStructureMotionInstanceDataNV(
+    ResourceTracker* resourceTracker, VkAccelerationStructureMotionInstanceDataNV* toTransform);
+
+void transform_tohost_VkAccelerationStructureMotionInstanceNV(
+    ResourceTracker* resourceTracker, VkAccelerationStructureMotionInstanceNV* toTransform);
+
+void transform_fromhost_VkAccelerationStructureMotionInstanceNV(
+    ResourceTracker* resourceTracker, VkAccelerationStructureMotionInstanceNV* toTransform);
+
+void transform_tohost_VkPhysicalDeviceRayTracingMotionBlurFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRayTracingMotionBlurFeaturesNV* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceRayTracingMotionBlurFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRayTracingMotionBlurFeaturesNV* toTransform);
+
+#endif
+#ifdef VK_EXT_ycbcr_2plane_444_formats
+void transform_tohost_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_fragment_density_map2
+void transform_tohost_VkPhysicalDeviceFragmentDensityMap2FeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceFragmentDensityMap2FeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceFragmentDensityMap2FeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceFragmentDensityMap2FeaturesEXT* toTransform);
+
+void transform_tohost_VkPhysicalDeviceFragmentDensityMap2PropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceFragmentDensityMap2PropertiesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceFragmentDensityMap2PropertiesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceFragmentDensityMap2PropertiesEXT* toTransform);
+
+#endif
+#ifdef VK_QCOM_rotated_copy_commands
+void transform_tohost_VkCopyCommandTransformInfoQCOM(ResourceTracker* resourceTracker,
+                                                     VkCopyCommandTransformInfoQCOM* toTransform);
+
+void transform_fromhost_VkCopyCommandTransformInfoQCOM(ResourceTracker* resourceTracker,
+                                                       VkCopyCommandTransformInfoQCOM* toTransform);
+
+#endif
+#ifdef VK_EXT_image_robustness
+void transform_tohost_VkPhysicalDeviceImageRobustnessFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceImageRobustnessFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceImageRobustnessFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceImageRobustnessFeaturesEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_4444_formats
+void transform_tohost_VkPhysicalDevice4444FormatsFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDevice4444FormatsFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDevice4444FormatsFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDevice4444FormatsFeaturesEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_rgba10x6_formats
+void transform_tohost_VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT* toTransform);
+
+#endif
+#ifdef VK_NV_acquire_winrt_display
+#endif
+#ifdef VK_EXT_directfb_surface
+void transform_tohost_VkDirectFBSurfaceCreateInfoEXT(ResourceTracker* resourceTracker,
+                                                     VkDirectFBSurfaceCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkDirectFBSurfaceCreateInfoEXT(ResourceTracker* resourceTracker,
+                                                       VkDirectFBSurfaceCreateInfoEXT* toTransform);
+
+#endif
+#ifdef VK_VALVE_mutable_descriptor_type
+void transform_tohost_VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE* toTransform);
+
+void transform_tohost_VkMutableDescriptorTypeListVALVE(
+    ResourceTracker* resourceTracker, VkMutableDescriptorTypeListVALVE* toTransform);
+
+void transform_fromhost_VkMutableDescriptorTypeListVALVE(
+    ResourceTracker* resourceTracker, VkMutableDescriptorTypeListVALVE* toTransform);
+
+void transform_tohost_VkMutableDescriptorTypeCreateInfoVALVE(
+    ResourceTracker* resourceTracker, VkMutableDescriptorTypeCreateInfoVALVE* toTransform);
+
+void transform_fromhost_VkMutableDescriptorTypeCreateInfoVALVE(
+    ResourceTracker* resourceTracker, VkMutableDescriptorTypeCreateInfoVALVE* toTransform);
+
+#endif
+#ifdef VK_EXT_vertex_input_dynamic_state
+void transform_tohost_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT* toTransform);
+
+void transform_tohost_VkVertexInputBindingDescription2EXT(
+    ResourceTracker* resourceTracker, VkVertexInputBindingDescription2EXT* toTransform);
+
+void transform_fromhost_VkVertexInputBindingDescription2EXT(
+    ResourceTracker* resourceTracker, VkVertexInputBindingDescription2EXT* toTransform);
+
+void transform_tohost_VkVertexInputAttributeDescription2EXT(
+    ResourceTracker* resourceTracker, VkVertexInputAttributeDescription2EXT* toTransform);
+
+void transform_fromhost_VkVertexInputAttributeDescription2EXT(
+    ResourceTracker* resourceTracker, VkVertexInputAttributeDescription2EXT* toTransform);
+
+#endif
+#ifdef VK_EXT_physical_device_drm
+void transform_tohost_VkPhysicalDeviceDrmPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDrmPropertiesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceDrmPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceDrmPropertiesEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_primitive_topology_list_restart
+void transform_tohost_VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT* toTransform);
+
+#endif
+#ifdef VK_FUCHSIA_external_memory
+void transform_tohost_VkImportMemoryZirconHandleInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkImportMemoryZirconHandleInfoFUCHSIA* toTransform);
+
+void transform_fromhost_VkImportMemoryZirconHandleInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkImportMemoryZirconHandleInfoFUCHSIA* toTransform);
+
+void transform_tohost_VkMemoryZirconHandlePropertiesFUCHSIA(
+    ResourceTracker* resourceTracker, VkMemoryZirconHandlePropertiesFUCHSIA* toTransform);
+
+void transform_fromhost_VkMemoryZirconHandlePropertiesFUCHSIA(
+    ResourceTracker* resourceTracker, VkMemoryZirconHandlePropertiesFUCHSIA* toTransform);
+
+void transform_tohost_VkMemoryGetZirconHandleInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkMemoryGetZirconHandleInfoFUCHSIA* toTransform);
+
+void transform_fromhost_VkMemoryGetZirconHandleInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkMemoryGetZirconHandleInfoFUCHSIA* toTransform);
+
+#endif
+#ifdef VK_FUCHSIA_external_semaphore
+void transform_tohost_VkImportSemaphoreZirconHandleInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkImportSemaphoreZirconHandleInfoFUCHSIA* toTransform);
+
+void transform_fromhost_VkImportSemaphoreZirconHandleInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkImportSemaphoreZirconHandleInfoFUCHSIA* toTransform);
+
+void transform_tohost_VkSemaphoreGetZirconHandleInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkSemaphoreGetZirconHandleInfoFUCHSIA* toTransform);
+
+void transform_fromhost_VkSemaphoreGetZirconHandleInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkSemaphoreGetZirconHandleInfoFUCHSIA* toTransform);
+
+#endif
+#ifdef VK_FUCHSIA_buffer_collection
+void transform_tohost_VkBufferCollectionCreateInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkBufferCollectionCreateInfoFUCHSIA* toTransform);
+
+void transform_fromhost_VkBufferCollectionCreateInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkBufferCollectionCreateInfoFUCHSIA* toTransform);
+
+void transform_tohost_VkImportMemoryBufferCollectionFUCHSIA(
+    ResourceTracker* resourceTracker, VkImportMemoryBufferCollectionFUCHSIA* toTransform);
+
+void transform_fromhost_VkImportMemoryBufferCollectionFUCHSIA(
+    ResourceTracker* resourceTracker, VkImportMemoryBufferCollectionFUCHSIA* toTransform);
+
+void transform_tohost_VkBufferCollectionImageCreateInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkBufferCollectionImageCreateInfoFUCHSIA* toTransform);
+
+void transform_fromhost_VkBufferCollectionImageCreateInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkBufferCollectionImageCreateInfoFUCHSIA* toTransform);
+
+void transform_tohost_VkBufferCollectionConstraintsInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkBufferCollectionConstraintsInfoFUCHSIA* toTransform);
+
+void transform_fromhost_VkBufferCollectionConstraintsInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkBufferCollectionConstraintsInfoFUCHSIA* toTransform);
+
+void transform_tohost_VkBufferConstraintsInfoFUCHSIA(ResourceTracker* resourceTracker,
+                                                     VkBufferConstraintsInfoFUCHSIA* toTransform);
+
+void transform_fromhost_VkBufferConstraintsInfoFUCHSIA(ResourceTracker* resourceTracker,
+                                                       VkBufferConstraintsInfoFUCHSIA* toTransform);
+
+void transform_tohost_VkBufferCollectionBufferCreateInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkBufferCollectionBufferCreateInfoFUCHSIA* toTransform);
+
+void transform_fromhost_VkBufferCollectionBufferCreateInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkBufferCollectionBufferCreateInfoFUCHSIA* toTransform);
+
+void transform_tohost_VkSysmemColorSpaceFUCHSIA(ResourceTracker* resourceTracker,
+                                                VkSysmemColorSpaceFUCHSIA* toTransform);
+
+void transform_fromhost_VkSysmemColorSpaceFUCHSIA(ResourceTracker* resourceTracker,
+                                                  VkSysmemColorSpaceFUCHSIA* toTransform);
+
+void transform_tohost_VkBufferCollectionPropertiesFUCHSIA(
+    ResourceTracker* resourceTracker, VkBufferCollectionPropertiesFUCHSIA* toTransform);
+
+void transform_fromhost_VkBufferCollectionPropertiesFUCHSIA(
+    ResourceTracker* resourceTracker, VkBufferCollectionPropertiesFUCHSIA* toTransform);
+
+void transform_tohost_VkImageFormatConstraintsInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkImageFormatConstraintsInfoFUCHSIA* toTransform);
+
+void transform_fromhost_VkImageFormatConstraintsInfoFUCHSIA(
+    ResourceTracker* resourceTracker, VkImageFormatConstraintsInfoFUCHSIA* toTransform);
+
+void transform_tohost_VkImageConstraintsInfoFUCHSIA(ResourceTracker* resourceTracker,
+                                                    VkImageConstraintsInfoFUCHSIA* toTransform);
+
+void transform_fromhost_VkImageConstraintsInfoFUCHSIA(ResourceTracker* resourceTracker,
+                                                      VkImageConstraintsInfoFUCHSIA* toTransform);
+
+#endif
+#ifdef VK_HUAWEI_subpass_shading
+void transform_tohost_VkSubpassShadingPipelineCreateInfoHUAWEI(
+    ResourceTracker* resourceTracker, VkSubpassShadingPipelineCreateInfoHUAWEI* toTransform);
+
+void transform_fromhost_VkSubpassShadingPipelineCreateInfoHUAWEI(
+    ResourceTracker* resourceTracker, VkSubpassShadingPipelineCreateInfoHUAWEI* toTransform);
+
+void transform_tohost_VkPhysicalDeviceSubpassShadingFeaturesHUAWEI(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSubpassShadingFeaturesHUAWEI* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceSubpassShadingFeaturesHUAWEI(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSubpassShadingFeaturesHUAWEI* toTransform);
+
+void transform_tohost_VkPhysicalDeviceSubpassShadingPropertiesHUAWEI(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSubpassShadingPropertiesHUAWEI* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceSubpassShadingPropertiesHUAWEI(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceSubpassShadingPropertiesHUAWEI* toTransform);
+
+#endif
+#ifdef VK_HUAWEI_invocation_mask
+void transform_tohost_VkPhysicalDeviceInvocationMaskFeaturesHUAWEI(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceInvocationMaskFeaturesHUAWEI* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceInvocationMaskFeaturesHUAWEI(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceInvocationMaskFeaturesHUAWEI* toTransform);
+
+#endif
+#ifdef VK_NV_external_memory_rdma
+void transform_tohost_VkMemoryGetRemoteAddressInfoNV(ResourceTracker* resourceTracker,
+                                                     VkMemoryGetRemoteAddressInfoNV* toTransform);
+
+void transform_fromhost_VkMemoryGetRemoteAddressInfoNV(ResourceTracker* resourceTracker,
+                                                       VkMemoryGetRemoteAddressInfoNV* toTransform);
+
+void transform_tohost_VkPhysicalDeviceExternalMemoryRDMAFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceExternalMemoryRDMAFeaturesNV* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceExternalMemoryRDMAFeaturesNV(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceExternalMemoryRDMAFeaturesNV* toTransform);
+
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+void transform_tohost_VkPhysicalDeviceExtendedDynamicState2FeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceExtendedDynamicState2FeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceExtendedDynamicState2FeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceExtendedDynamicState2FeaturesEXT* toTransform);
+
+#endif
+#ifdef VK_QNX_screen_surface
+void transform_tohost_VkScreenSurfaceCreateInfoQNX(ResourceTracker* resourceTracker,
+                                                   VkScreenSurfaceCreateInfoQNX* toTransform);
+
+void transform_fromhost_VkScreenSurfaceCreateInfoQNX(ResourceTracker* resourceTracker,
+                                                     VkScreenSurfaceCreateInfoQNX* toTransform);
+
+#endif
+#ifdef VK_EXT_color_write_enable
+void transform_tohost_VkPhysicalDeviceColorWriteEnableFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceColorWriteEnableFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceColorWriteEnableFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceColorWriteEnableFeaturesEXT* toTransform);
+
+void transform_tohost_VkPipelineColorWriteCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineColorWriteCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkPipelineColorWriteCreateInfoEXT(
+    ResourceTracker* resourceTracker, VkPipelineColorWriteCreateInfoEXT* toTransform);
+
+#endif
+#ifdef VK_GOOGLE_gfxstream
+void transform_tohost_VkImportColorBufferGOOGLE(ResourceTracker* resourceTracker,
+                                                VkImportColorBufferGOOGLE* toTransform);
+
+void transform_fromhost_VkImportColorBufferGOOGLE(ResourceTracker* resourceTracker,
+                                                  VkImportColorBufferGOOGLE* toTransform);
+
+void transform_tohost_VkImportBufferGOOGLE(ResourceTracker* resourceTracker,
+                                           VkImportBufferGOOGLE* toTransform);
+
+void transform_fromhost_VkImportBufferGOOGLE(ResourceTracker* resourceTracker,
+                                             VkImportBufferGOOGLE* toTransform);
+
+void transform_tohost_VkCreateBlobGOOGLE(ResourceTracker* resourceTracker,
+                                         VkCreateBlobGOOGLE* toTransform);
+
+void transform_fromhost_VkCreateBlobGOOGLE(ResourceTracker* resourceTracker,
+                                           VkCreateBlobGOOGLE* toTransform);
+
+#endif
+#ifdef VK_EXT_global_priority_query
+void transform_tohost_VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT* toTransform);
+
+void transform_tohost_VkQueueFamilyGlobalPriorityPropertiesEXT(
+    ResourceTracker* resourceTracker, VkQueueFamilyGlobalPriorityPropertiesEXT* toTransform);
+
+void transform_fromhost_VkQueueFamilyGlobalPriorityPropertiesEXT(
+    ResourceTracker* resourceTracker, VkQueueFamilyGlobalPriorityPropertiesEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_multi_draw
+void transform_tohost_VkPhysicalDeviceMultiDrawFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMultiDrawFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceMultiDrawFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMultiDrawFeaturesEXT* toTransform);
+
+void transform_tohost_VkPhysicalDeviceMultiDrawPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMultiDrawPropertiesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceMultiDrawPropertiesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceMultiDrawPropertiesEXT* toTransform);
+
+void transform_tohost_VkMultiDrawInfoEXT(ResourceTracker* resourceTracker,
+                                         VkMultiDrawInfoEXT* toTransform);
+
+void transform_fromhost_VkMultiDrawInfoEXT(ResourceTracker* resourceTracker,
+                                           VkMultiDrawInfoEXT* toTransform);
+
+void transform_tohost_VkMultiDrawIndexedInfoEXT(ResourceTracker* resourceTracker,
+                                                VkMultiDrawIndexedInfoEXT* toTransform);
+
+void transform_fromhost_VkMultiDrawIndexedInfoEXT(ResourceTracker* resourceTracker,
+                                                  VkMultiDrawIndexedInfoEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_load_store_op_none
+#endif
+#ifdef VK_EXT_border_color_swizzle
+void transform_tohost_VkPhysicalDeviceBorderColorSwizzleFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceBorderColorSwizzleFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceBorderColorSwizzleFeaturesEXT(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceBorderColorSwizzleFeaturesEXT* toTransform);
+
+void transform_tohost_VkSamplerBorderColorComponentMappingCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkSamplerBorderColorComponentMappingCreateInfoEXT* toTransform);
+
+void transform_fromhost_VkSamplerBorderColorComponentMappingCreateInfoEXT(
+    ResourceTracker* resourceTracker,
+    VkSamplerBorderColorComponentMappingCreateInfoEXT* toTransform);
+
+#endif
+#ifdef VK_EXT_pageable_device_local_memory
+void transform_tohost_VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT* toTransform);
+
+void transform_fromhost_VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT* toTransform);
+
+#endif
+#ifdef VK_KHR_acceleration_structure
+void transform_tohost_VkDeviceOrHostAddressKHR(ResourceTracker* resourceTracker,
+                                               VkDeviceOrHostAddressKHR* toTransform);
+
+void transform_fromhost_VkDeviceOrHostAddressKHR(ResourceTracker* resourceTracker,
+                                                 VkDeviceOrHostAddressKHR* toTransform);
+
+void transform_tohost_VkAccelerationStructureBuildRangeInfoKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureBuildRangeInfoKHR* toTransform);
+
+void transform_fromhost_VkAccelerationStructureBuildRangeInfoKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureBuildRangeInfoKHR* toTransform);
+
+void transform_tohost_VkAccelerationStructureGeometryTrianglesDataKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureGeometryTrianglesDataKHR* toTransform);
+
+void transform_fromhost_VkAccelerationStructureGeometryTrianglesDataKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureGeometryTrianglesDataKHR* toTransform);
+
+void transform_tohost_VkAccelerationStructureGeometryAabbsDataKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureGeometryAabbsDataKHR* toTransform);
+
+void transform_fromhost_VkAccelerationStructureGeometryAabbsDataKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureGeometryAabbsDataKHR* toTransform);
+
+void transform_tohost_VkAccelerationStructureGeometryInstancesDataKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureGeometryInstancesDataKHR* toTransform);
+
+void transform_fromhost_VkAccelerationStructureGeometryInstancesDataKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureGeometryInstancesDataKHR* toTransform);
+
+void transform_tohost_VkAccelerationStructureGeometryDataKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureGeometryDataKHR* toTransform);
+
+void transform_fromhost_VkAccelerationStructureGeometryDataKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureGeometryDataKHR* toTransform);
+
+void transform_tohost_VkAccelerationStructureGeometryKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureGeometryKHR* toTransform);
+
+void transform_fromhost_VkAccelerationStructureGeometryKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureGeometryKHR* toTransform);
+
+void transform_tohost_VkAccelerationStructureBuildGeometryInfoKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureBuildGeometryInfoKHR* toTransform);
+
+void transform_fromhost_VkAccelerationStructureBuildGeometryInfoKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureBuildGeometryInfoKHR* toTransform);
+
+void transform_tohost_VkAccelerationStructureCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureCreateInfoKHR* toTransform);
+
+void transform_fromhost_VkAccelerationStructureCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureCreateInfoKHR* toTransform);
+
+void transform_tohost_VkWriteDescriptorSetAccelerationStructureKHR(
+    ResourceTracker* resourceTracker, VkWriteDescriptorSetAccelerationStructureKHR* toTransform);
+
+void transform_fromhost_VkWriteDescriptorSetAccelerationStructureKHR(
+    ResourceTracker* resourceTracker, VkWriteDescriptorSetAccelerationStructureKHR* toTransform);
+
+void transform_tohost_VkPhysicalDeviceAccelerationStructureFeaturesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceAccelerationStructureFeaturesKHR* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceAccelerationStructureFeaturesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceAccelerationStructureFeaturesKHR* toTransform);
+
+void transform_tohost_VkPhysicalDeviceAccelerationStructurePropertiesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceAccelerationStructurePropertiesKHR* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceAccelerationStructurePropertiesKHR(
+    ResourceTracker* resourceTracker,
+    VkPhysicalDeviceAccelerationStructurePropertiesKHR* toTransform);
+
+void transform_tohost_VkAccelerationStructureDeviceAddressInfoKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureDeviceAddressInfoKHR* toTransform);
+
+void transform_fromhost_VkAccelerationStructureDeviceAddressInfoKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureDeviceAddressInfoKHR* toTransform);
+
+void transform_tohost_VkAccelerationStructureVersionInfoKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureVersionInfoKHR* toTransform);
+
+void transform_fromhost_VkAccelerationStructureVersionInfoKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureVersionInfoKHR* toTransform);
+
+void transform_tohost_VkCopyAccelerationStructureToMemoryInfoKHR(
+    ResourceTracker* resourceTracker, VkCopyAccelerationStructureToMemoryInfoKHR* toTransform);
+
+void transform_fromhost_VkCopyAccelerationStructureToMemoryInfoKHR(
+    ResourceTracker* resourceTracker, VkCopyAccelerationStructureToMemoryInfoKHR* toTransform);
+
+void transform_tohost_VkCopyMemoryToAccelerationStructureInfoKHR(
+    ResourceTracker* resourceTracker, VkCopyMemoryToAccelerationStructureInfoKHR* toTransform);
+
+void transform_fromhost_VkCopyMemoryToAccelerationStructureInfoKHR(
+    ResourceTracker* resourceTracker, VkCopyMemoryToAccelerationStructureInfoKHR* toTransform);
+
+void transform_tohost_VkCopyAccelerationStructureInfoKHR(
+    ResourceTracker* resourceTracker, VkCopyAccelerationStructureInfoKHR* toTransform);
+
+void transform_fromhost_VkCopyAccelerationStructureInfoKHR(
+    ResourceTracker* resourceTracker, VkCopyAccelerationStructureInfoKHR* toTransform);
+
+void transform_tohost_VkAccelerationStructureBuildSizesInfoKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureBuildSizesInfoKHR* toTransform);
+
+void transform_fromhost_VkAccelerationStructureBuildSizesInfoKHR(
+    ResourceTracker* resourceTracker, VkAccelerationStructureBuildSizesInfoKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_ray_tracing_pipeline
+void transform_tohost_VkRayTracingShaderGroupCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkRayTracingShaderGroupCreateInfoKHR* toTransform);
+
+void transform_fromhost_VkRayTracingShaderGroupCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkRayTracingShaderGroupCreateInfoKHR* toTransform);
+
+void transform_tohost_VkRayTracingPipelineInterfaceCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkRayTracingPipelineInterfaceCreateInfoKHR* toTransform);
+
+void transform_fromhost_VkRayTracingPipelineInterfaceCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkRayTracingPipelineInterfaceCreateInfoKHR* toTransform);
+
+void transform_tohost_VkRayTracingPipelineCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkRayTracingPipelineCreateInfoKHR* toTransform);
+
+void transform_fromhost_VkRayTracingPipelineCreateInfoKHR(
+    ResourceTracker* resourceTracker, VkRayTracingPipelineCreateInfoKHR* toTransform);
+
+void transform_tohost_VkPhysicalDeviceRayTracingPipelineFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRayTracingPipelineFeaturesKHR* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceRayTracingPipelineFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRayTracingPipelineFeaturesKHR* toTransform);
+
+void transform_tohost_VkPhysicalDeviceRayTracingPipelinePropertiesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRayTracingPipelinePropertiesKHR* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceRayTracingPipelinePropertiesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRayTracingPipelinePropertiesKHR* toTransform);
+
+void transform_tohost_VkStridedDeviceAddressRegionKHR(ResourceTracker* resourceTracker,
+                                                      VkStridedDeviceAddressRegionKHR* toTransform);
+
+void transform_fromhost_VkStridedDeviceAddressRegionKHR(
+    ResourceTracker* resourceTracker, VkStridedDeviceAddressRegionKHR* toTransform);
+
+void transform_tohost_VkTraceRaysIndirectCommandKHR(ResourceTracker* resourceTracker,
+                                                    VkTraceRaysIndirectCommandKHR* toTransform);
+
+void transform_fromhost_VkTraceRaysIndirectCommandKHR(ResourceTracker* resourceTracker,
+                                                      VkTraceRaysIndirectCommandKHR* toTransform);
+
+#endif
+#ifdef VK_KHR_ray_query
+void transform_tohost_VkPhysicalDeviceRayQueryFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRayQueryFeaturesKHR* toTransform);
+
+void transform_fromhost_VkPhysicalDeviceRayQueryFeaturesKHR(
+    ResourceTracker* resourceTracker, VkPhysicalDeviceRayQueryFeaturesKHR* toTransform);
+
+#endif
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/meson.build b/system/vulkan_enc/meson.build
new file mode 100644
index 0000000..716bac3
--- /dev/null
+++ b/system/vulkan_enc/meson.build
@@ -0,0 +1,33 @@
+# Copyright 2022 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+files_lib_vulkan_enc = files(
+  'CommandBufferStagingStream.cpp',
+  'DescriptorSetVirtualization.cpp',
+  'HostVisibleMemoryVirtualization.cpp',
+  'ResourceTracker.cpp',
+  'Resources.cpp',
+  'Validation.cpp',
+  'VkEncoder.cpp',
+  'VulkanHandleMapping.cpp',
+  'VulkanStreamGuest.cpp',
+  'func_table.cpp',
+  'goldfish_vk_counting_guest.cpp',
+  'goldfish_vk_counting_guest.h',
+  'goldfish_vk_deepcopy_guest.cpp',
+  'goldfish_vk_extension_structs_guest.cpp',
+  'goldfish_vk_marshaling_guest.cpp',
+  'goldfish_vk_reserved_marshaling_guest.cpp',
+  'goldfish_vk_transform_guest.cpp',
+)
+
+lib_vulkan_enc = static_library(
+   'vulkan_enc',
+   files_lib_vulkan_enc,
+   cpp_args: cpp_args,
+   include_directories: [inc_android_emu, inc_host, inc_android_compat,
+                         inc_opengl_codec, inc_render_enc, inc_system,
+			 inc_goldfish_address_space, inc_platform],
+   link_with: [lib_platform],
+   dependencies: dependency('libdrm'),
+)
diff --git a/system/vulkan_enc/vkQueueFlushCommandsGOOGLE_encode_impl.cpp.inl b/system/vulkan_enc/vkQueueFlushCommandsGOOGLE_encode_impl.cpp.inl
new file mode 100644
index 0000000..3b4cf32
--- /dev/null
+++ b/system/vulkan_enc/vkQueueFlushCommandsGOOGLE_encode_impl.cpp.inl
@@ -0,0 +1,67 @@
+// Manual inline for
+// void VkEncoder::vkQueueFlushCommandsGOOGLE( VkQueue queue, VkCommandBuffer commandBuffer, VkDeviceSize dataSize, const void* pData, uint32_t doLock);
+
+// We won't use the lock if this command is used (VulkanQueueSubmitWithCommands is enabled)
+(void)doLock;
+
+auto stream = mImpl->stream();
+auto pool = mImpl->pool();
+VkQueue local_queue;
+VkCommandBuffer local_commandBuffer;
+VkDeviceSize local_dataSize;
+void* local_pData;
+local_queue = queue;
+local_commandBuffer = commandBuffer;
+local_dataSize = dataSize;
+// Avoiding deepcopy for pData
+local_pData = (void*)pData;
+size_t count = 0;
+size_t* countPtr = &count;
+{
+    uint64_t cgen_var_1405;
+    *countPtr += 1 * 8;
+    uint64_t cgen_var_1406;
+    *countPtr += 1 * 8;
+    *countPtr += sizeof(VkDeviceSize);
+    *countPtr += ((dataSize)) * sizeof(uint8_t);
+}
+bool queueSubmitWithCommandsEnabled = sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+uint32_t packetSize_vkQueueFlushCommandsGOOGLE = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count;
+healthMonitorAnnotation_packetSize =
+    std::make_optional(packetSize_vkQueueFlushCommandsGOOGLE);
+uint8_t* streamPtr = stream->reserve(packetSize_vkQueueFlushCommandsGOOGLE - local_dataSize);
+uint8_t* packetBeginPtr = streamPtr;
+uint8_t** streamPtrPtr = &streamPtr;
+uint32_t opcode_vkQueueFlushCommandsGOOGLE = OP_vkQueueFlushCommandsGOOGLE;
+uint32_t seqno = ResourceTracker::nextSeqno();
+healthMonitorAnnotation_seqno = std::make_optional(seqno);
+memcpy(streamPtr, &opcode_vkQueueFlushCommandsGOOGLE, sizeof(uint32_t)); streamPtr += sizeof(uint32_t);
+memcpy(streamPtr, &packetSize_vkQueueFlushCommandsGOOGLE, sizeof(uint32_t)); streamPtr += sizeof(uint32_t);
+memcpy(streamPtr, &seqno, sizeof(uint32_t)); streamPtr += sizeof(uint32_t);
+uint64_t cgen_var_1407;
+*&cgen_var_1407 = get_host_u64_VkQueue((*&local_queue));
+memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1407, 1 * 8);
+*streamPtrPtr += 1 * 8;
+uint64_t cgen_var_1408;
+*&cgen_var_1408 = get_host_u64_VkCommandBuffer((*&local_commandBuffer));
+memcpy(*streamPtrPtr, (uint64_t*)&cgen_var_1408, 1 * 8);
+*streamPtrPtr += 1 * 8;
+memcpy(*streamPtrPtr, (VkDeviceSize*)&local_dataSize, sizeof(VkDeviceSize));
+*streamPtrPtr += sizeof(VkDeviceSize);
+if (watchdog) {
+    size_t watchdogBufSize = std::min<size_t>(
+        static_cast<size_t>(packetSize_vkQueueFlushCommandsGOOGLE), kWatchdogBufferMax);
+    healthMonitorAnnotation_packetContents.resize(watchdogBufSize);
+    memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize);
+}
+
+AEMU_SCOPED_TRACE("vkQueueFlush large xfer");
+stream->flush();
+stream->writeLarge(local_pData, dataSize);
+
+++encodeCount;;
+if (0 == encodeCount % POOL_CLEAR_INTERVAL)
+{
+    pool->freeAll();
+    stream->clearPool();
+}
diff --git a/system/vulkan_enc/vk_format_info.h b/system/vulkan_enc/vk_format_info.h
new file mode 100644
index 0000000..9fbc82a
--- /dev/null
+++ b/system/vulkan_enc/vk_format_info.h
@@ -0,0 +1,222 @@
+/*
+ * Copyright © 2016 Intel Corporation
+ * Copyright © 2019 The Android Open Source Project
+ * Copyright © 2019 Google Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef VK_FORMAT_INFO_H
+#define VK_FORMAT_INFO_H
+
+#include <stdbool.h>
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+#include <system/graphics.h>
+#else
+/* See system/graphics.h. */
+enum {
+    HAL_PIXEL_FORMAT_YV12 = 842094169,
+};
+#endif
+#include <vulkan/vulkan.h>
+#include <vndk/hardware_buffer.h>
+
+namespace gfxstream {
+namespace vk {
+
+/* See i915_private_android_types.h in minigbm. */
+#define HAL_PIXEL_FORMAT_NV12_Y_TILED_INTEL 0x100
+
+// TODO(b/167698976): We should not use OMX_COLOR_FormatYUV420Planar
+// but we seem to miss a format translation somewhere.
+
+#define OMX_COLOR_FormatYUV420Planar 0x13
+
+// TODO: update users of this function to query the DRM fourcc
+// code using the standard Gralloc4 metadata type and instead
+// translate the DRM fourcc code to a Vulkan format as Android
+// formats such as AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_420 could be
+// either VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM or
+// VK_FORMAT_G8_B8R8_2PLANE_420_UNORM.
+static inline VkFormat
+vk_format_from_android(unsigned android_format)
+{
+   switch (android_format) {
+   case AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM:
+      return VK_FORMAT_R8G8B8A8_UNORM;
+   case AHARDWAREBUFFER_FORMAT_R8G8B8X8_UNORM:
+      return VK_FORMAT_R8G8B8A8_UNORM;
+   case AHARDWAREBUFFER_FORMAT_R8G8B8_UNORM:
+      return VK_FORMAT_R8G8B8_UNORM;
+   case AHARDWAREBUFFER_FORMAT_R5G6B5_UNORM:
+      return VK_FORMAT_R5G6B5_UNORM_PACK16;
+   case AHARDWAREBUFFER_FORMAT_R16G16B16A16_FLOAT:
+      return VK_FORMAT_R16G16B16A16_SFLOAT;
+   case AHARDWAREBUFFER_FORMAT_R10G10B10A2_UNORM:
+      return VK_FORMAT_A2B10G10R10_UNORM_PACK32;
+   case HAL_PIXEL_FORMAT_NV12_Y_TILED_INTEL:
+   case AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_420:
+      return VK_FORMAT_G8_B8R8_2PLANE_420_UNORM;
+#if __ANDROID_API__ >= 30
+   case AHARDWAREBUFFER_FORMAT_YCbCr_P010:
+      return VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16;
+#endif
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+   case HAL_PIXEL_FORMAT_YV12:
+   case OMX_COLOR_FormatYUV420Planar:
+      return VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM;
+   case AHARDWAREBUFFER_FORMAT_BLOB:
+#endif
+   default:
+      return VK_FORMAT_UNDEFINED;
+   }
+}
+
+static inline unsigned
+android_format_from_vk(VkFormat vk_format)
+{
+   switch (vk_format) {
+   case VK_FORMAT_R8G8B8A8_UNORM:
+      return AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM;
+   case VK_FORMAT_R8G8B8_UNORM:
+      return AHARDWAREBUFFER_FORMAT_R8G8B8_UNORM;
+   case VK_FORMAT_R5G6B5_UNORM_PACK16:
+      return AHARDWAREBUFFER_FORMAT_R5G6B5_UNORM;
+   case VK_FORMAT_R16G16B16A16_SFLOAT:
+      return AHARDWAREBUFFER_FORMAT_R16G16B16A16_FLOAT;
+   case VK_FORMAT_A2B10G10R10_UNORM_PACK32:
+      return AHARDWAREBUFFER_FORMAT_R10G10B10A2_UNORM;
+   case VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:
+      return HAL_PIXEL_FORMAT_NV12_Y_TILED_INTEL;
+   case VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:
+      return HAL_PIXEL_FORMAT_YV12;
+   default:
+      return AHARDWAREBUFFER_FORMAT_BLOB;
+   }
+}
+
+static inline bool
+android_format_is_yuv(unsigned android_format)
+{
+   switch (android_format) {
+   case AHARDWAREBUFFER_FORMAT_BLOB:
+   case AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM:
+   case AHARDWAREBUFFER_FORMAT_R8G8B8X8_UNORM:
+   case AHARDWAREBUFFER_FORMAT_R8G8B8_UNORM:
+   case AHARDWAREBUFFER_FORMAT_R5G6B5_UNORM:
+   case AHARDWAREBUFFER_FORMAT_R16G16B16A16_FLOAT:
+   case AHARDWAREBUFFER_FORMAT_R10G10B10A2_UNORM:
+   case AHARDWAREBUFFER_FORMAT_D16_UNORM:
+   case AHARDWAREBUFFER_FORMAT_D24_UNORM:
+   case AHARDWAREBUFFER_FORMAT_D24_UNORM_S8_UINT:
+   case AHARDWAREBUFFER_FORMAT_D32_FLOAT:
+   case AHARDWAREBUFFER_FORMAT_D32_FLOAT_S8_UINT:
+   case AHARDWAREBUFFER_FORMAT_S8_UINT:
+      return false;
+   case HAL_PIXEL_FORMAT_NV12_Y_TILED_INTEL:
+   case OMX_COLOR_FormatYUV420Planar:
+   case HAL_PIXEL_FORMAT_YV12:
+#if __ANDROID_API__ >= 30
+   case AHARDWAREBUFFER_FORMAT_YCbCr_P010:
+#endif
+   case AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_420:
+      return true;
+   default:
+      ALOGE("%s: unhandled format: %d", __FUNCTION__, android_format);
+      return false;
+   }
+}
+
+static inline VkImageAspectFlags
+vk_format_aspects(VkFormat format)
+{
+   switch (format) {
+   case VK_FORMAT_UNDEFINED:
+      return 0;
+
+   case VK_FORMAT_S8_UINT:
+      return VK_IMAGE_ASPECT_STENCIL_BIT;
+
+   case VK_FORMAT_D16_UNORM_S8_UINT:
+   case VK_FORMAT_D24_UNORM_S8_UINT:
+   case VK_FORMAT_D32_SFLOAT_S8_UINT:
+      return VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT;
+
+   case VK_FORMAT_D16_UNORM:
+   case VK_FORMAT_X8_D24_UNORM_PACK32:
+   case VK_FORMAT_D32_SFLOAT:
+      return VK_IMAGE_ASPECT_DEPTH_BIT;
+
+   case VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:
+   case VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:
+   case VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:
+   case VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:
+   case VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:
+   case VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:
+   case VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:
+   case VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:
+   case VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:
+   case VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:
+   case VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:
+   case VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:
+      return (VK_IMAGE_ASPECT_PLANE_0_BIT |
+              VK_IMAGE_ASPECT_PLANE_1_BIT |
+              VK_IMAGE_ASPECT_PLANE_2_BIT);
+
+   case VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:
+   case VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:
+   case VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:
+   case VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:
+   case VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:
+   case VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:
+   case VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:
+   case VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:
+      return (VK_IMAGE_ASPECT_PLANE_0_BIT |
+              VK_IMAGE_ASPECT_PLANE_1_BIT);
+
+   default:
+      return VK_IMAGE_ASPECT_COLOR_BIT;
+   }
+}
+
+static inline bool
+vk_format_is_color(VkFormat format)
+{
+   return vk_format_aspects(format) == VK_IMAGE_ASPECT_COLOR_BIT;
+}
+
+static inline bool
+vk_format_is_depth_or_stencil(VkFormat format)
+{
+   const VkImageAspectFlags aspects = vk_format_aspects(format);
+   return aspects & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT);
+}
+
+static inline bool
+vk_format_has_depth(VkFormat format)
+{
+   const VkImageAspectFlags aspects = vk_format_aspects(format);
+   return aspects & VK_IMAGE_ASPECT_DEPTH_BIT;
+}
+
+}  // namespace vk
+}  // namespace gfxstream
+
+#endif /* VK_FORMAT_INFO_H */
diff --git a/system/vulkan_enc/vk_platform_compat.h b/system/vulkan_enc/vk_platform_compat.h
new file mode 100644
index 0000000..e182bac
--- /dev/null
+++ b/system/vulkan_enc/vk_platform_compat.h
@@ -0,0 +1,30 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#pragma once
+
+#include <vulkan/vulkan.h>
+
+#if VK_HEADER_VERSION < 76
+
+typedef struct VkBaseOutStructure {
+    VkStructureType               sType;
+    struct VkBaseOutStructure*    pNext;
+} VkBaseOutStructure;
+
+typedef struct VkBaseInStructure {
+    VkStructureType                    sType;
+    const struct VkBaseInStructure*    pNext;
+} VkBaseInStructure;
+
+#endif // VK_HEADER_VERSION < 76
diff --git a/system/vulkan_enc/vk_struct_id.h b/system/vulkan_enc/vk_struct_id.h
new file mode 100644
index 0000000..16a0f29
--- /dev/null
+++ b/system/vulkan_enc/vk_struct_id.h
@@ -0,0 +1,82 @@
+// Copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2018 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#pragma once
+
+#include <vulkan/vulkan.h>
+#include "goldfish_vk_private_defs.h"
+#include "vulkan_gfxstream.h"
+
+namespace gfxstream {
+namespace vk {
+
+template <class T> struct vk_get_vk_struct_id;
+
+#define REGISTER_VK_STRUCT_ID(T, ID) \
+    template <> struct vk_get_vk_struct_id<T> { static constexpr VkStructureType id = ID; }
+
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+REGISTER_VK_STRUCT_ID(VkAndroidHardwareBufferPropertiesANDROID, VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID);
+REGISTER_VK_STRUCT_ID(VkAndroidHardwareBufferFormatPropertiesANDROID, VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID);
+REGISTER_VK_STRUCT_ID(VkAndroidHardwareBufferUsageANDROID, VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID);
+#endif
+REGISTER_VK_STRUCT_ID(VkBufferCreateInfo, VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO);
+REGISTER_VK_STRUCT_ID(VkImageCreateInfo, VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO);
+REGISTER_VK_STRUCT_ID(VkImageFormatProperties2, VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2);
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+REGISTER_VK_STRUCT_ID(VkNativeBufferANDROID, VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID);
+REGISTER_VK_STRUCT_ID(VkExternalFormatANDROID, VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID);
+#endif
+REGISTER_VK_STRUCT_ID(VkExternalMemoryBufferCreateInfo, VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO);
+REGISTER_VK_STRUCT_ID(VkExternalMemoryImageCreateInfo, VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO);
+REGISTER_VK_STRUCT_ID(VkMemoryAllocateInfo, VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO);
+REGISTER_VK_STRUCT_ID(VkMemoryDedicatedAllocateInfo, VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO);
+REGISTER_VK_STRUCT_ID(VkMemoryDedicatedRequirements, VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS);
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+REGISTER_VK_STRUCT_ID(VkImportAndroidHardwareBufferInfoANDROID, VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID);
+#endif
+REGISTER_VK_STRUCT_ID(VkExportMemoryAllocateInfo, VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO);
+REGISTER_VK_STRUCT_ID(VkMemoryRequirements2, VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2);
+REGISTER_VK_STRUCT_ID(VkSemaphoreCreateInfo, VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO);
+REGISTER_VK_STRUCT_ID(VkExportSemaphoreCreateInfoKHR, VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO_KHR);
+REGISTER_VK_STRUCT_ID(VkSamplerYcbcrConversionCreateInfo, VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO);
+REGISTER_VK_STRUCT_ID(VkImportColorBufferGOOGLE, VK_STRUCTURE_TYPE_IMPORT_COLOR_BUFFER_GOOGLE);
+REGISTER_VK_STRUCT_ID(VkImageViewCreateInfo, VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO);
+#ifdef VK_USE_PLATFORM_FUCHSIA
+REGISTER_VK_STRUCT_ID(VkImportMemoryBufferCollectionFUCHSIA, VK_STRUCTURE_TYPE_IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA);
+REGISTER_VK_STRUCT_ID(VkImportMemoryZirconHandleInfoFUCHSIA, VK_STRUCTURE_TYPE_IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA);
+REGISTER_VK_STRUCT_ID(VkBufferCollectionImageCreateInfoFUCHSIA, VK_STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA);
+REGISTER_VK_STRUCT_ID(VkBufferCollectionBufferCreateInfoFUCHSIA, VK_STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA);
+#endif  // VK_USE_PLATFORM_FUCHSIA
+REGISTER_VK_STRUCT_ID(VkSamplerCreateInfo, VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO);
+REGISTER_VK_STRUCT_ID(VkSamplerCustomBorderColorCreateInfoEXT, VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT);
+REGISTER_VK_STRUCT_ID(VkSamplerYcbcrConversionInfo, VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO);
+REGISTER_VK_STRUCT_ID(VkFenceCreateInfo, VK_STRUCTURE_TYPE_FENCE_CREATE_INFO);
+REGISTER_VK_STRUCT_ID(VkExportFenceCreateInfo, VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO);
+REGISTER_VK_STRUCT_ID(VkImportBufferGOOGLE, VK_STRUCTURE_TYPE_IMPORT_BUFFER_GOOGLE);
+REGISTER_VK_STRUCT_ID(VkCreateBlobGOOGLE, VK_STRUCTURE_TYPE_CREATE_BLOB_GOOGLE);
+REGISTER_VK_STRUCT_ID(VkExternalImageFormatProperties, VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES);
+REGISTER_VK_STRUCT_ID(VkPhysicalDeviceImageFormatInfo2, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2);
+REGISTER_VK_STRUCT_ID(VkPhysicalDeviceExternalImageFormatInfo, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO);
+REGISTER_VK_STRUCT_ID(VkSemaphoreTypeCreateInfo, VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO);
+REGISTER_VK_STRUCT_ID(VkPhysicalDeviceFeatures2, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2);
+REGISTER_VK_STRUCT_ID(VkPhysicalDeviceProperties2, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2);
+REGISTER_VK_STRUCT_ID(VkPhysicalDeviceDeviceMemoryReportFeaturesEXT, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT);
+REGISTER_VK_STRUCT_ID(VkMemoryAllocateFlagsInfo, VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO);
+REGISTER_VK_STRUCT_ID(VkMemoryOpaqueCaptureAddressAllocateInfo, VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO);
+
+#undef REGISTER_VK_STRUCT_ID
+
+}  // namespace vk
+}  // namespace gfxstream
diff --git a/system/vulkan_enc/vk_util.h b/system/vulkan_enc/vk_util.h
new file mode 100644
index 0000000..2e3267f
--- /dev/null
+++ b/system/vulkan_enc/vk_util.h
@@ -0,0 +1,257 @@
+/*
+ * Copyright © 2017 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+#ifndef VK_UTIL_H
+#define VK_UTIL_H
+
+/* common inlines and macros for vulkan drivers */
+
+#include <vulkan/vulkan.h>
+#include <stdlib.h>
+#include "vk_struct_id.h"
+
+namespace gfxstream {
+namespace vk {
+
+struct vk_struct_common {
+    VkStructureType sType;
+    struct vk_struct_common *pNext;
+};
+
+struct vk_struct_chain_iterator {
+    vk_struct_common* value;
+};
+
+#define vk_foreach_struct(__iter, __start) \
+   for (struct vk_struct_common *__iter = (struct vk_struct_common *)(__start); \
+        __iter; __iter = __iter->pNext)
+
+#define vk_foreach_struct_const(__iter, __start) \
+   for (const struct vk_struct_common *__iter = (const struct vk_struct_common *)(__start); \
+        __iter; __iter = __iter->pNext)
+
+/**
+ * A wrapper for a Vulkan output array. A Vulkan output array is one that
+ * follows the convention of the parameters to
+ * vkGetPhysicalDeviceQueueFamilyProperties().
+ *
+ * Example Usage:
+ *
+ *    VkResult
+ *    vkGetPhysicalDeviceQueueFamilyProperties(
+ *       VkPhysicalDevice           physicalDevice,
+ *       uint32_t*                  pQueueFamilyPropertyCount,
+ *       VkQueueFamilyProperties*   pQueueFamilyProperties)
+ *    {
+ *       VK_OUTARRAY_MAKE(props, pQueueFamilyProperties,
+ *                         pQueueFamilyPropertyCount);
+ *
+ *       vk_outarray_append(&props, p) {
+ *          p->queueFlags = ...;
+ *          p->queueCount = ...;
+ *       }
+ *
+ *       vk_outarray_append(&props, p) {
+ *          p->queueFlags = ...;
+ *          p->queueCount = ...;
+ *       }
+ *
+ *       return vk_outarray_status(&props);
+ *    }
+ */
+struct __vk_outarray {
+   /** May be null. */
+   void *data;
+
+   /**
+    * Capacity, in number of elements. Capacity is unlimited (UINT32_MAX) if
+    * data is null.
+    */
+   uint32_t cap;
+
+   /**
+    * Count of elements successfully written to the array. Every write is
+    * considered successful if data is null.
+    */
+   uint32_t *filled_len;
+
+   /**
+    * Count of elements that would have been written to the array if its
+    * capacity were sufficient. Vulkan functions often return VK_INCOMPLETE
+    * when `*filled_len < wanted_len`.
+    */
+   uint32_t wanted_len;
+};
+
+static inline void
+__vk_outarray_init(struct __vk_outarray *a,
+                   void *data, uint32_t * len)
+{
+   a->data = data;
+   a->cap = *len;
+   a->filled_len = len;
+   *a->filled_len = 0;
+   a->wanted_len = 0;
+
+   if (a->data == NULL)
+      a->cap = UINT32_MAX;
+}
+
+static inline VkResult
+__vk_outarray_status(const struct __vk_outarray *a)
+{
+   if (*a->filled_len < a->wanted_len)
+      return VK_INCOMPLETE;
+   else
+      return VK_SUCCESS;
+}
+
+static inline void *
+__vk_outarray_next(struct __vk_outarray *a, size_t elem_size)
+{
+   void *p = NULL;
+
+   a->wanted_len += 1;
+
+   if (*a->filled_len >= a->cap)
+      return NULL;
+
+   if (a->data != NULL)
+      p = ((uint8_t*)a->data) + (*a->filled_len) * elem_size;
+
+   *a->filled_len += 1;
+
+   return p;
+}
+
+#define vk_outarray(elem_t) \
+   struct { \
+      struct __vk_outarray base; \
+      elem_t meta[]; \
+   }
+
+#define vk_outarray_typeof_elem(a) __typeof__((a)->meta[0])
+#define vk_outarray_sizeof_elem(a) sizeof((a)->meta[0])
+
+#define vk_outarray_init(a, data, len) \
+   __vk_outarray_init(&(a)->base, (data), (len))
+
+#define VK_OUTARRAY_MAKE(name, data, len) \
+   vk_outarray(__typeof__((data)[0])) name; \
+   vk_outarray_init(&name, (data), (len))
+
+#define vk_outarray_status(a) \
+   __vk_outarray_status(&(a)->base)
+
+#define vk_outarray_next(a) \
+   ((vk_outarray_typeof_elem(a) *) \
+      __vk_outarray_next(&(a)->base, vk_outarray_sizeof_elem(a)))
+
+/**
+ * Append to a Vulkan output array.
+ *
+ * This is a block-based macro. For example:
+ *
+ *    vk_outarray_append(&a, elem) {
+ *       elem->foo = ...;
+ *       elem->bar = ...;
+ *    }
+ *
+ * The array `a` has type `vk_outarray(elem_t) *`. It is usually declared with
+ * VK_OUTARRAY_MAKE(). The variable `elem` is block-scoped and has type
+ * `elem_t *`.
+ *
+ * The macro unconditionally increments the array's `wanted_len`. If the array
+ * is not full, then the macro also increment its `filled_len` and then
+ * executes the block. When the block is executed, `elem` is non-null and
+ * points to the newly appended element.
+ */
+#define vk_outarray_append(a, elem) \
+   for (vk_outarray_typeof_elem(a) *elem = vk_outarray_next(a); \
+        elem != NULL; elem = NULL)
+
+static inline void *
+__vk_find_struct(void *start, VkStructureType sType)
+{
+   vk_foreach_struct(s, start) {
+      if (s->sType == sType)
+         return s;
+   }
+
+   return NULL;
+}
+
+template <class T, class H> T* vk_find_struct(H* head)
+{
+    (void)vk_get_vk_struct_id<H>::id;
+    return static_cast<T*>(__vk_find_struct(static_cast<void*>(head), vk_get_vk_struct_id<T>::id));
+}
+
+template <class T, class H> const T* vk_find_struct(const H* head)
+{
+    (void)vk_get_vk_struct_id<H>::id;
+    return static_cast<const T*>(__vk_find_struct(const_cast<void*>(static_cast<const void*>(head)),
+                                 vk_get_vk_struct_id<T>::id));
+}
+
+uint32_t vk_get_driver_version(void);
+
+uint32_t vk_get_version_override(void);
+
+#define VK_EXT_OFFSET (1000000000UL)
+#define VK_ENUM_EXTENSION(__enum) \
+   ((__enum) >= VK_EXT_OFFSET ? ((((__enum) - VK_EXT_OFFSET) / 1000UL) + 1) : 0)
+#define VK_ENUM_OFFSET(__enum) \
+   ((__enum) >= VK_EXT_OFFSET ? ((__enum) % 1000) : (__enum))
+
+template <class T> T vk_make_orphan_copy(const T& vk_struct) {
+    T copy = vk_struct;
+    copy.pNext = NULL;
+    return copy;
+}
+
+template <class T> vk_struct_chain_iterator vk_make_chain_iterator(T* vk_struct)
+{
+    (void)vk_get_vk_struct_id<T>::id;
+    vk_struct_chain_iterator result = { reinterpret_cast<vk_struct_common*>(vk_struct) };
+    return result;
+}
+
+template <class T> void vk_append_struct(vk_struct_chain_iterator* i, T* vk_struct)
+{
+    (void)vk_get_vk_struct_id<T>::id;
+
+    vk_struct_common* p = i->value;
+    if (p->pNext) {
+        ::abort();
+    }
+
+    p->pNext = reinterpret_cast<vk_struct_common *>(vk_struct);
+    vk_struct->pNext = NULL;
+
+    *i = vk_make_chain_iterator(vk_struct);
+}
+
+}  // namespace vk
+}  // namespace gfxstream
+
+#endif /* VK_UTIL_H */
diff --git a/system/vulkan_enc/vulkan_enc_unittests.cpp b/system/vulkan_enc/vulkan_enc_unittests.cpp
new file mode 100644
index 0000000..693dbcd
--- /dev/null
+++ b/system/vulkan_enc/vulkan_enc_unittests.cpp
@@ -0,0 +1,288 @@
+// Copyright (C) 2019 The Android Open Source Project
+// Copyright (C) 2019 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include <gtest/gtest.h>
+
+#include "aemu/base/synchronization/AndroidConditionVariable.h"
+#include "aemu/base/synchronization/AndroidLock.h"
+#include "aemu/base/threads/AndroidWorkPool.h"
+
+#include <atomic>
+#include <vector>
+
+namespace android {
+namespace base {
+namespace guest {
+
+// Tests basic default construction/deconstruction.
+TEST(WorkPool, Basic) {
+    WorkPool p;
+}
+
+// Tests sending one task.
+TEST(WorkPool, One) {
+    WorkPool p;
+
+    WorkPool::Task task = [] {
+        fprintf(stderr, "do something\n");
+    };
+
+    std::vector<WorkPool::Task> tasks { task };
+
+    p.schedule(tasks);
+}
+
+// Tests sending two tasks.
+TEST(WorkPool, Two) {
+    WorkPool p;
+
+    std::vector<WorkPool::Task> tasks {
+        [] { fprintf(stderr, "do something 1\n"); },
+        [] { fprintf(stderr, "do something 2\n"); },
+    };
+
+    p.schedule(tasks);
+}
+
+// Tests sending eight tasks (can require spawning more threads)
+TEST(WorkPool, Eight) {
+    WorkPool p;
+
+    std::vector<WorkPool::Task> tasks {
+        [] { fprintf(stderr, "do something 1\n"); },
+        [] { fprintf(stderr, "do something 2\n"); },
+        [] { fprintf(stderr, "do something 3\n"); },
+        [] { fprintf(stderr, "do something 4\n"); },
+        [] { fprintf(stderr, "do something 5\n"); },
+        [] { fprintf(stderr, "do something 6\n"); },
+        [] { fprintf(stderr, "do something 7\n"); },
+        [] { fprintf(stderr, "do something 8\n"); },
+    };
+
+    p.schedule(tasks);
+}
+
+// Tests waitAny primitive; if at least one of the tasks successfully run,
+// at least one of them will read 0 and store back 1 in |x|, or more,
+// so check that x >= 1.
+TEST(WorkPool, WaitAny) {
+    WorkPool p;
+    int x = 0;
+    WorkPool::WaitGroupHandle handle = 0;
+
+    {
+        std::vector<WorkPool::Task> tasks;
+
+        for (int i = 0; i < 8; ++i) {
+            tasks.push_back([&x] { ++x; });
+        }
+
+        handle = p.schedule(tasks);
+    }
+
+
+    p.waitAny(handle, -1);
+
+    EXPECT_GE(x, 1);
+
+    // Prevent use after scope after test finish
+    p.waitAll(handle);
+}
+
+// Tests waitAll primitive; each worker increments the atomic int once,
+// so we expect it to end up at 8 (8 workers).
+TEST(WorkPool, WaitAll) {
+    WorkPool p;
+    std::atomic<int> x { 0 };
+
+    std::vector<WorkPool::Task> tasks;
+
+    for (int i = 0; i < 8; ++i) {
+        tasks.push_back([&x] { ++x; });
+    }
+
+    auto handle = p.schedule(tasks);
+
+    p.waitAll(handle, -1);
+
+    EXPECT_EQ(x, 8);
+}
+
+// Tests waitAll primitive with two concurrent wait groups in flight.
+// The second wait group is scheduled after the first, but
+// we wait on the second wait group first. This is to ensure that
+// order of submission does not enforce order of waiting / completion.
+TEST(WorkPool, WaitAllTwoWaitGroups) {
+    WorkPool p;
+    std::atomic<int> x { 0 };
+    std::atomic<int> y { 0 };
+
+    std::vector<WorkPool::Task> tasks1;
+    std::vector<WorkPool::Task> tasks2;
+
+    for (int i = 0; i < 8; ++i) {
+        tasks1.push_back([&x] { ++x; });
+        tasks2.push_back([&y] { ++y; });
+    }
+
+    auto handle1 = p.schedule(tasks1);
+    auto handle2 = p.schedule(tasks2);
+
+    p.waitAll(handle2, -1);
+    p.waitAll(handle1, -1);
+
+    EXPECT_EQ(x, 8);
+    EXPECT_EQ(y, 8);
+}
+
+// Tests waitAll primitive with two concurrent wait groups.
+// The first wait group waits on what the second wait group will signal.
+// This is to ensure that we can send blocking tasks to WorkPool
+// without causing a deadlock.
+TEST(WorkPool, WaitAllWaitSignal) {
+    WorkPool p;
+    Lock lock;
+    ConditionVariable cv;
+    // Similar to a timeline semaphore object;
+    // one process waits on a particular value to get reached,
+    // while other processes gradually increment it.
+    std::atomic<int> x { 0 };
+
+    std::vector<WorkPool::Task> tasks1 = {
+        [&lock, &cv, &x] {
+            AutoLock l(lock);
+            while (x < 8) {
+                cv.wait(&lock);
+            }
+        },
+    };
+
+    std::vector<WorkPool::Task> tasks2;
+
+    for (int i = 0; i < 8; ++i) {
+        tasks2.push_back([&lock, &cv, &x] {
+            AutoLock l(lock);
+            ++x;
+            cv.signal();
+        });
+    }
+
+    auto handle1 = p.schedule(tasks1);
+    auto handle2 = p.schedule(tasks2);
+
+    p.waitAll(handle1, -1);
+
+    EXPECT_EQ(8, x);
+}
+
+// Tests waitAll primitive with some kind of timeout.
+// We don't expect x to be anything in particular..
+TEST(WorkPool, WaitAllTimeout) {
+    WorkPool p;
+    Lock lock;
+    ConditionVariable cv;
+    std::atomic<int> x { 0 };
+
+    std::vector<WorkPool::Task> tasks1 = {
+        [&lock, &cv, &x] {
+            AutoLock l(lock);
+            while (x < 8) {
+                cv.wait(&lock);
+            }
+        },
+    };
+
+    std::vector<WorkPool::Task> tasks2;
+
+    for (int i = 0; i < 8; ++i) {
+        tasks2.push_back([&lock, &cv, &x] {
+            AutoLock l(lock);
+            ++x;
+            cv.signal();
+        });
+    }
+
+    auto handle1 = p.schedule(tasks1);
+    auto handle2 = p.schedule(tasks2);
+
+    p.waitAll(handle1, 10);
+}
+
+// Tests waitAny primitive with some kind of timeout.
+// We don't expect x to be anything in particular..
+TEST(WorkPool, WaitAnyTimeout) {
+    WorkPool p;
+    Lock lock;
+    ConditionVariable cv;
+    std::atomic<int> x { 0 };
+
+    std::vector<WorkPool::Task> tasks1 = {
+        [&lock, &cv, &x] {
+            AutoLock l(lock);
+            while (x < 8) {
+                cv.wait(&lock);
+            }
+        },
+    };
+
+    std::vector<WorkPool::Task> tasks2;
+
+    for (int i = 0; i < 8; ++i) {
+        tasks2.push_back([&lock, &cv, &x] {
+            AutoLock l(lock);
+            ++x;
+            cv.signal();
+        });
+    }
+
+    auto handle1 = p.schedule(tasks1);
+    auto handle2 = p.schedule(tasks2);
+
+    p.waitAny(handle1, 10);
+}
+
+// Nesting waitAll inside another task.
+TEST(WorkPool, NestedWaitAll) {
+    WorkPool p;
+    std::atomic<int> x { 0 };
+    std::atomic<int> y { 0 };
+
+    std::vector<WorkPool::Task> tasks1;
+
+    for (int i = 0; i < 8; ++i) {
+        tasks1.push_back([&x] {
+            ++x;
+        });
+    }
+
+    auto waitGroupHandle = p.schedule(tasks1);
+
+    std::vector<WorkPool::Task> tasks2 = {
+        [&p, waitGroupHandle, &x, &y] {
+            p.waitAll(waitGroupHandle);
+            EXPECT_EQ(8, x);
+            ++y;
+        },
+    };
+
+    auto handle2 = p.schedule(tasks2);
+
+    p.waitAll(handle2);
+
+    EXPECT_EQ(1, y);
+}
+
+} // namespace android
+} // namespace base
+} // namespace guest
diff --git a/system/vulkan_enc/vulkan_gfxstream.h b/system/vulkan_enc/vulkan_gfxstream.h
new file mode 100644
index 0000000..060dac5
--- /dev/null
+++ b/system/vulkan_enc/vulkan_gfxstream.h
@@ -0,0 +1,215 @@
+// Copyright (C) 2022 The Android Open Source Project
+// Copyright (C) 2022 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Autogenerated header vulkan_gfxstream.h
+// Please do not modify directly;
+// re-run gfxstream-protocols/scripts/generate-vulkan-sources.sh,
+// or directly from Python by calling the genvk.py script with correct parameters.
+
+#pragma once
+#ifdef VK_GFXSTREAM_STRUCTURE_TYPE_EXT
+#include "vulkan_gfxstream_structure_type.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define VK_GOOGLE_gfxstream 1
+#define VK_GOOGLE_GFXSTREAM_SPEC_VERSION 0
+#define VK_GOOGLE_GFXSTREAM_NUMBER 386
+#define VK_GOOGLE_GFXSTREAM_EXTENSION_NAME "VK_GOOGLE_gfxstream"
+typedef struct VkImportColorBufferGOOGLE {
+    VkStructureType sType;
+    void* pNext;
+    uint32_t colorBuffer;
+} VkImportColorBufferGOOGLE;
+
+typedef struct VkImportBufferGOOGLE {
+    VkStructureType sType;
+    void* pNext;
+    uint32_t buffer;
+} VkImportBufferGOOGLE;
+
+typedef struct VkCreateBlobGOOGLE {
+    VkStructureType sType;
+    void* pNext;
+    uint32_t blobMem;
+    uint32_t blobFlags;
+    uint64_t blobId;
+} VkCreateBlobGOOGLE;
+
+typedef VkResult(VKAPI_PTR* PFN_vkMapMemoryIntoAddressSpaceGOOGLE)(VkDevice device,
+                                                                   VkDeviceMemory memory,
+                                                                   uint64_t* pAddress);
+typedef void(VKAPI_PTR* PFN_vkUpdateDescriptorSetWithTemplateSizedGOOGLE)(
+    VkDevice device, VkDescriptorSet descriptorSet,
+    VkDescriptorUpdateTemplate descriptorUpdateTemplate, uint32_t imageInfoCount,
+    uint32_t bufferInfoCount, uint32_t bufferViewCount, const uint32_t* pImageInfoEntryIndices,
+    const uint32_t* pBufferInfoEntryIndices, const uint32_t* pBufferViewEntryIndices,
+    const VkDescriptorImageInfo* pImageInfos, const VkDescriptorBufferInfo* pBufferInfos,
+    const VkBufferView* pBufferViews);
+typedef void(VKAPI_PTR* PFN_vkBeginCommandBufferAsyncGOOGLE)(
+    VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo* pBeginInfo);
+typedef void(VKAPI_PTR* PFN_vkEndCommandBufferAsyncGOOGLE)(VkCommandBuffer commandBuffer);
+typedef void(VKAPI_PTR* PFN_vkResetCommandBufferAsyncGOOGLE)(VkCommandBuffer commandBuffer,
+                                                             VkCommandBufferResetFlags flags);
+typedef void(VKAPI_PTR* PFN_vkCommandBufferHostSyncGOOGLE)(VkCommandBuffer commandBuffer,
+                                                           uint32_t needHostSync,
+                                                           uint32_t sequenceNumber);
+typedef VkResult(VKAPI_PTR* PFN_vkCreateImageWithRequirementsGOOGLE)(
+    VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator,
+    VkImage* pImage, VkMemoryRequirements* pMemoryRequirements);
+typedef VkResult(VKAPI_PTR* PFN_vkCreateBufferWithRequirementsGOOGLE)(
+    VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator,
+    VkBuffer* pBuffer, VkMemoryRequirements* pMemoryRequirements);
+typedef VkResult(VKAPI_PTR* PFN_vkGetMemoryHostAddressInfoGOOGLE)(VkDevice device,
+                                                                  VkDeviceMemory memory,
+                                                                  uint64_t* pAddress,
+                                                                  uint64_t* pSize,
+                                                                  uint64_t* pHostmemId);
+typedef VkResult(VKAPI_PTR* PFN_vkFreeMemorySyncGOOGLE)(VkDevice device, VkDeviceMemory memory,
+                                                        const VkAllocationCallbacks* pAllocator);
+typedef void(VKAPI_PTR* PFN_vkQueueHostSyncGOOGLE)(VkQueue queue, uint32_t needHostSync,
+                                                   uint32_t sequenceNumber);
+typedef void(VKAPI_PTR* PFN_vkQueueSubmitAsyncGOOGLE)(VkQueue queue, uint32_t submitCount,
+                                                      const VkSubmitInfo* pSubmits, VkFence fence);
+typedef void(VKAPI_PTR* PFN_vkQueueWaitIdleAsyncGOOGLE)(VkQueue queue);
+typedef void(VKAPI_PTR* PFN_vkQueueBindSparseAsyncGOOGLE)(VkQueue queue, uint32_t bindInfoCount,
+                                                          const VkBindSparseInfo* pBindInfo,
+                                                          VkFence fence);
+typedef void(VKAPI_PTR* PFN_vkGetLinearImageLayoutGOOGLE)(VkDevice device, VkFormat format,
+                                                          VkDeviceSize* pOffset,
+                                                          VkDeviceSize* pRowPitchAlignment);
+typedef void(VKAPI_PTR* PFN_vkGetLinearImageLayout2GOOGLE)(VkDevice device,
+                                                           const VkImageCreateInfo* pCreateInfo,
+                                                           VkDeviceSize* pOffset,
+                                                           VkDeviceSize* pRowPitchAlignment);
+typedef void(VKAPI_PTR* PFN_vkQueueFlushCommandsGOOGLE)(VkQueue queue,
+                                                        VkCommandBuffer commandBuffer,
+                                                        VkDeviceSize dataSize, const void* pData);
+typedef void(VKAPI_PTR* PFN_vkQueueCommitDescriptorSetUpdatesGOOGLE)(
+    VkQueue queue, uint32_t descriptorPoolCount, const VkDescriptorPool* pDescriptorPools,
+    uint32_t descriptorSetCount, const VkDescriptorSetLayout* pSetLayouts,
+    const uint64_t* pDescriptorSetPoolIds, const uint32_t* pDescriptorSetWhichPool,
+    const uint32_t* pDescriptorSetPendingAllocation,
+    const uint32_t* pDescriptorWriteStartingIndices, uint32_t pendingDescriptorWriteCount,
+    const VkWriteDescriptorSet* pPendingDescriptorWrites);
+typedef void(VKAPI_PTR* PFN_vkCollectDescriptorPoolIdsGOOGLE)(VkDevice device,
+                                                              VkDescriptorPool descriptorPool,
+                                                              uint32_t* pPoolIdCount,
+                                                              uint64_t* pPoolIds);
+typedef void(VKAPI_PTR* PFN_vkQueueSignalReleaseImageANDROIDAsyncGOOGLE)(
+    VkQueue queue, uint32_t waitSemaphoreCount, const VkSemaphore* pWaitSemaphores, VkImage image);
+typedef void(VKAPI_PTR* PFN_vkQueueFlushCommandsFromAuxMemoryGOOGLE)(VkQueue queue,
+                                                                     VkCommandBuffer commandBuffer,
+                                                                     VkDeviceMemory deviceMemory,
+                                                                     VkDeviceSize dataOffset,
+                                                                     VkDeviceSize dataSize);
+typedef VkResult(VKAPI_PTR* PFN_vkGetBlobGOOGLE)(VkDevice device, VkDeviceMemory memory);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR VkResult VKAPI_CALL vkMapMemoryIntoAddressSpaceGOOGLE(VkDevice device,
+                                                                 VkDeviceMemory memory,
+                                                                 uint64_t* pAddress);
+
+VKAPI_ATTR void VKAPI_CALL vkUpdateDescriptorSetWithTemplateSizedGOOGLE(
+    VkDevice device, VkDescriptorSet descriptorSet,
+    VkDescriptorUpdateTemplate descriptorUpdateTemplate, uint32_t imageInfoCount,
+    uint32_t bufferInfoCount, uint32_t bufferViewCount, const uint32_t* pImageInfoEntryIndices,
+    const uint32_t* pBufferInfoEntryIndices, const uint32_t* pBufferViewEntryIndices,
+    const VkDescriptorImageInfo* pImageInfos, const VkDescriptorBufferInfo* pBufferInfos,
+    const VkBufferView* pBufferViews);
+
+VKAPI_ATTR void VKAPI_CALL vkBeginCommandBufferAsyncGOOGLE(
+    VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo* pBeginInfo);
+
+VKAPI_ATTR void VKAPI_CALL vkEndCommandBufferAsyncGOOGLE(VkCommandBuffer commandBuffer);
+
+VKAPI_ATTR void VKAPI_CALL vkResetCommandBufferAsyncGOOGLE(VkCommandBuffer commandBuffer,
+                                                           VkCommandBufferResetFlags flags);
+
+VKAPI_ATTR void VKAPI_CALL vkCommandBufferHostSyncGOOGLE(VkCommandBuffer commandBuffer,
+                                                         uint32_t needHostSync,
+                                                         uint32_t sequenceNumber);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkCreateImageWithRequirementsGOOGLE(
+    VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator,
+    VkImage* pImage, VkMemoryRequirements* pMemoryRequirements);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkCreateBufferWithRequirementsGOOGLE(
+    VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator,
+    VkBuffer* pBuffer, VkMemoryRequirements* pMemoryRequirements);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryHostAddressInfoGOOGLE(VkDevice device,
+                                                                VkDeviceMemory memory,
+                                                                uint64_t* pAddress, uint64_t* pSize,
+                                                                uint64_t* pHostmemId);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkFreeMemorySyncGOOGLE(VkDevice device, VkDeviceMemory memory,
+                                                      const VkAllocationCallbacks* pAllocator);
+
+VKAPI_ATTR void VKAPI_CALL vkQueueHostSyncGOOGLE(VkQueue queue, uint32_t needHostSync,
+                                                 uint32_t sequenceNumber);
+
+VKAPI_ATTR void VKAPI_CALL vkQueueSubmitAsyncGOOGLE(VkQueue queue, uint32_t submitCount,
+                                                    const VkSubmitInfo* pSubmits, VkFence fence);
+
+VKAPI_ATTR void VKAPI_CALL vkQueueWaitIdleAsyncGOOGLE(VkQueue queue);
+
+VKAPI_ATTR void VKAPI_CALL vkQueueBindSparseAsyncGOOGLE(VkQueue queue, uint32_t bindInfoCount,
+                                                        const VkBindSparseInfo* pBindInfo,
+                                                        VkFence fence);
+
+VKAPI_ATTR void VKAPI_CALL vkGetLinearImageLayoutGOOGLE(VkDevice device, VkFormat format,
+                                                        VkDeviceSize* pOffset,
+                                                        VkDeviceSize* pRowPitchAlignment);
+
+VKAPI_ATTR void VKAPI_CALL vkGetLinearImageLayout2GOOGLE(VkDevice device,
+                                                         const VkImageCreateInfo* pCreateInfo,
+                                                         VkDeviceSize* pOffset,
+                                                         VkDeviceSize* pRowPitchAlignment);
+
+VKAPI_ATTR void VKAPI_CALL vkQueueFlushCommandsGOOGLE(VkQueue queue, VkCommandBuffer commandBuffer,
+                                                      VkDeviceSize dataSize, const void* pData);
+
+VKAPI_ATTR void VKAPI_CALL vkQueueCommitDescriptorSetUpdatesGOOGLE(
+    VkQueue queue, uint32_t descriptorPoolCount, const VkDescriptorPool* pDescriptorPools,
+    uint32_t descriptorSetCount, const VkDescriptorSetLayout* pSetLayouts,
+    const uint64_t* pDescriptorSetPoolIds, const uint32_t* pDescriptorSetWhichPool,
+    const uint32_t* pDescriptorSetPendingAllocation,
+    const uint32_t* pDescriptorWriteStartingIndices, uint32_t pendingDescriptorWriteCount,
+    const VkWriteDescriptorSet* pPendingDescriptorWrites);
+
+VKAPI_ATTR void VKAPI_CALL vkCollectDescriptorPoolIdsGOOGLE(VkDevice device,
+                                                            VkDescriptorPool descriptorPool,
+                                                            uint32_t* pPoolIdCount,
+                                                            uint64_t* pPoolIds);
+
+VKAPI_ATTR void VKAPI_CALL vkQueueSignalReleaseImageANDROIDAsyncGOOGLE(
+    VkQueue queue, uint32_t waitSemaphoreCount, const VkSemaphore* pWaitSemaphores, VkImage image);
+
+VKAPI_ATTR void VKAPI_CALL vkQueueFlushCommandsFromAuxMemoryGOOGLE(VkQueue queue,
+                                                                   VkCommandBuffer commandBuffer,
+                                                                   VkDeviceMemory deviceMemory,
+                                                                   VkDeviceSize dataOffset,
+                                                                   VkDeviceSize dataSize);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkGetBlobGOOGLE(VkDevice device, VkDeviceMemory memory);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/system/vulkan_enc/vulkan_gfxstream_structure_type.h b/system/vulkan_enc/vulkan_gfxstream_structure_type.h
new file mode 100644
index 0000000..ae9270c
--- /dev/null
+++ b/system/vulkan_enc/vulkan_gfxstream_structure_type.h
@@ -0,0 +1,38 @@
+// Copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2018 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Autogenerated module vulkan_gfxstream_structure_type
+//
+// (header) generated by codegen/vulkan/scripts/genvk.py -registry codegen/vulkan/xml/vk.xml cereal
+// -o host/vulkan/cereal
+//
+// Please do not modify directly;
+// re-run gfxstream-protocols/scripts/generate-vulkan-sources.sh,
+// or directly from Python by defining:
+// VULKAN_REGISTRY_XML_DIR : Directory containing vk.xml
+// VULKAN_REGISTRY_SCRIPTS_DIR : Directory containing genvk.py
+// CEREAL_OUTPUT_DIR: Where to put the generated sources.
+//
+// python3 $VULKAN_REGISTRY_SCRIPTS_DIR/genvk.py -registry $VULKAN_REGISTRY_XML_DIR/vk.xml cereal -o
+// $CEREAL_OUTPUT_DIR
+//
+#pragma once
+
+#define VK_GOOGLE_GFXSTREAM_ENUM(type, id) \
+    ((type)(1000000000 + (1000 * (VK_GOOGLE_GFXSTREAM_NUMBER - 1)) + (id)))
+
+#define VK_STRUCTURE_TYPE_IMPORT_COLOR_BUFFER_GOOGLE VK_GOOGLE_GFXSTREAM_ENUM(VkStructureType, 0)
+#define VK_STRUCTURE_TYPE_IMPORT_BUFFER_GOOGLE VK_GOOGLE_GFXSTREAM_ENUM(VkStructureType, 1)
+#define VK_STRUCTURE_TYPE_CREATE_BLOB_GOOGLE VK_GOOGLE_GFXSTREAM_ENUM(VkStructureType, 2)
diff --git a/system/vulkan_enc_unit_tests/Android.mk b/system/vulkan_enc_unit_tests/Android.mk
new file mode 100644
index 0000000..d51aeba
--- /dev/null
+++ b/system/vulkan_enc_unit_tests/Android.mk
@@ -0,0 +1,21 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+LOCAL_MODULE := CommandBufferStagingStreamTests
+
+$(call emugl-import,libvulkan_enc)
+
+LOCAL_C_INCLUDES += \
+    device/generic/goldfish-opengl/host/include/libOpenglRender \
+    hardware/google/gfxstream/common/vulkan/include/
+
+LOCAL_SRC_FILES:= \
+    CommandBufferStagingStream_test.cpp \
+
+LOCAL_STATIC_LIBRARIES := libgmock
+LOCAL_VENDOR_MODULE := true
+LOCAL_MODULE_TAGS := tests
+
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../LICENSE
+include $(BUILD_NATIVE_TEST)
diff --git a/system/vulkan_enc_unit_tests/CommandBufferStagingStream_test.cpp b/system/vulkan_enc_unit_tests/CommandBufferStagingStream_test.cpp
new file mode 100644
index 0000000..dc18142
--- /dev/null
+++ b/system/vulkan_enc_unit_tests/CommandBufferStagingStream_test.cpp
@@ -0,0 +1,730 @@
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include <CommandBufferStagingStream.h>
+#include <string.h>
+
+#include <condition_variable>
+#include <mutex>
+#include <string_view>
+#include <thread>
+
+namespace gfxstream {
+namespace vk {
+
+using ::testing::A;
+using ::testing::ElementsAre;
+using ::testing::Eq;
+using ::testing::Ge;
+using ::testing::InSequence;
+using ::testing::IsNull;
+using ::testing::MockFunction;
+using ::testing::NotNull;
+using ::testing::Return;
+
+static constexpr size_t kTestBufferSize = 1048576;
+
+// tests allocBuffer can successfully allocate a buffer of given size
+TEST(CommandBufferStagingStreamTest, AllocateBufferTestUnderMinSize) {
+    CommandBufferStagingStream stream;
+    uint8_t* buffer = static_cast<uint8_t*>(stream.allocBuffer(kTestBufferSize));
+    EXPECT_THAT(buffer, NotNull());
+}
+
+// test reallocate buffer remembers previously committed buffers
+TEST(CommandBufferStagingStreamTest, ReallocateBuffer) {
+    CommandBufferStagingStream stream;
+    uint8_t* buffer = static_cast<uint8_t*>(stream.allocBuffer(kTestBufferSize));
+    EXPECT_THAT(buffer, NotNull());
+
+    // write some data
+    const std::string_view commandData{"some command"};
+    const size_t dataSize = commandData.size();
+    memcpy(buffer, commandData.data(), dataSize);
+
+    // commit data
+    stream.commitBuffer(dataSize);
+
+    // this will result in a reallocation
+    buffer = static_cast<uint8_t*>(stream.allocBuffer(kTestBufferSize));
+    EXPECT_THAT(buffer, NotNull());
+
+    // get stream data
+    uint8_t* outBuf = nullptr;
+    size_t outSize = 0;
+    stream.getWritten(&outBuf, &outSize);
+
+    std::string_view actualData{reinterpret_cast<char*>(outBuf), outSize};
+    EXPECT_THAT(actualData, Eq(commandData));
+}
+
+// tests commitBuffer tracks the portion of the buffer to be committed
+TEST(CommandBufferStagingStreamTest, CommitBuffer) {
+    CommandBufferStagingStream stream;
+    // allocate buffer
+    uint8_t* buffer = static_cast<uint8_t*>(stream.allocBuffer(kTestBufferSize));
+
+    // write some arbitrary data
+    const std::string_view commandData{"some command"};
+    const size_t dataSize = commandData.size();
+    memcpy(buffer, commandData.data(), dataSize);
+
+    // commit
+    stream.commitBuffer(dataSize);
+
+    // writeBuffer should have the committed portion in CommandBufferStagingStream
+    uint8_t* outBuf = nullptr;
+    size_t outSize = 0;
+    stream.getWritten(&outBuf, &outSize);
+
+    std::string_view actualData{reinterpret_cast<char*>(outBuf), outSize};
+    EXPECT_THAT(actualData, Eq(commandData));
+}
+
+// tests reset api
+TEST(CommandBufferStagingStreamTest, Reset) {
+    CommandBufferStagingStream stream;
+    // allocate buffer
+    uint8_t* buffer = static_cast<uint8_t*>(stream.allocBuffer(kTestBufferSize));
+
+    // write some arbitrary data
+    const std::string_view commandData{"some command"};
+    const size_t dataSize = commandData.size();
+    memcpy(buffer, commandData.data(), dataSize);
+
+    // commit
+    stream.commitBuffer(dataSize);
+
+    // reset
+    stream.reset();
+
+    size_t outSize;
+    unsigned char* outBuf;
+    // write buffer
+    stream.getWritten(&outBuf, &outSize);
+
+    // outSize should be 0 after reset
+    EXPECT_EQ(outSize, 0) << "no data should be available for a write after a reset";
+}
+
+// tests that multiple alloc calls do not result in reallocations
+TEST(CommandBufferStagingStreamTest, MultipleAllocationCalls) {
+    CommandBufferStagingStream stream;
+    uint8_t* buffer = static_cast<uint8_t*>(stream.allocBuffer(kTestBufferSize));
+    EXPECT_THAT(buffer, NotNull());
+
+    // another call to allocBuffer should not result in reallocations
+    uint8_t* anotherBuffer = static_cast<uint8_t*>(stream.allocBuffer(kTestBufferSize));
+    EXPECT_THAT(anotherBuffer, Eq(buffer));
+}
+
+// this test verifies that allocBuffer doesn't cause reallcation if buffer has available space
+TEST(CommandBufferStagingStream, NoReallocationIfBufferIsNotFull) {
+    CommandBufferStagingStream stream;
+    uint8_t* buffer = static_cast<uint8_t*>(stream.allocBuffer(kTestBufferSize));
+    EXPECT_THAT(buffer, NotNull());
+
+    // commit portion of buffer
+    const size_t writeSize = 10;
+    stream.commitBuffer(writeSize);
+
+    uint8_t* writePtr = static_cast<uint8_t*>(stream.allocBuffer(writeSize));
+    EXPECT_THAT(writePtr, buffer + writeSize);
+}
+
+// tests that data written prior to reallocation is still intact
+TEST(CommandBufferStagingStreamTest, ReallocationBoundary) {
+    CommandBufferStagingStream stream;
+    uint8_t* buffer = static_cast<uint8_t*>(stream.allocBuffer(kTestBufferSize));
+    EXPECT_THAT(buffer, NotNull());
+
+    // split data into two batches
+    const std::string firstBatchData(kTestBufferSize, 'a');
+
+    // copy first batch of data into stream
+    memcpy(buffer, firstBatchData.data(), kTestBufferSize);
+
+    // commit first batch of data
+    stream.commitBuffer(firstBatchData.size());
+
+    // size of first batch of data brings stream buffer to capacity; this will result in a
+    // reallocation
+    buffer = static_cast<uint8_t*>(stream.allocBuffer(kTestBufferSize));
+    EXPECT_THAT(buffer, NotNull());
+
+    // data written before reallocation should be intact
+    unsigned char* outBuf = nullptr;
+    size_t outSize = 0;
+    stream.getWritten(&outBuf, &outSize);
+
+    const std::string_view expectedData{firstBatchData};
+    std::string_view actualData{reinterpret_cast<char*>(outBuf), outSize};
+    EXPECT_THAT(actualData, Eq(expectedData));
+}
+
+// this test is a death test for unsupported apis
+TEST(CommandBufferStagingStreamDeathTest, UnsupportedAPIs) {
+    CommandBufferStagingStream stream;
+
+    EXPECT_DEATH(
+        {
+            void* buffer = nullptr;
+            size_t size = 0;
+            stream.readFully(buffer, size);
+        },
+        "")
+        << "readFully should not be supported";
+
+    EXPECT_DEATH(
+        {
+            void* buffer = nullptr;
+            size_t size = 0;
+            stream.read(buffer, &size);
+        },
+        "")
+        << "read should not be supported";
+
+    EXPECT_DEATH(
+        {
+            void* buffer = nullptr;
+            size_t size = 0;
+            stream.writeFully(buffer, size);
+        },
+        "")
+        << "writeFully should not be supported";
+
+    EXPECT_DEATH(
+        {
+            void* buffer = nullptr;
+            size_t size = 0;
+            size_t len = 0;
+            stream.commitBufferAndReadFully(size, buffer, len);
+        },
+        "")
+        << "commitBufferAndReadFully should not be supported";
+}
+
+using MockAlloc = MockFunction<CommandBufferStagingStream::Memory(size_t)>;
+using MockFree = MockFunction<void(const CommandBufferStagingStream::Memory&)>;
+// default empty implementation of free
+static std::function<void(const CommandBufferStagingStream::Memory&)> EmptyFree =
+    [](const CommandBufferStagingStream::Memory&) {};
+// CommandBufferStagingStreamCustomAllocationTest tests behavior of CommandBufferStagingStream
+// when initialized with custom allocator/free function.
+// These tests test the same outcome as CommandBufferStagingStreamTest tests
+
+// tests allocBuffer can successfully allocate a buffer of given size
+TEST(CommandBufferStagingStreamCustomAllocationTest, AllocateBufferTest) {
+    // memory source
+    std::vector<uint8_t> memorySrc(kTestBufferSize * 2);
+
+    CommandBufferStagingStream::Memory memory{
+        .deviceMemory = VK_NULL_HANDLE,  // not needed for this test
+        .ptr = memorySrc.data()};
+
+    MockAlloc allocFn;
+
+    // alloc function should be called once
+    EXPECT_CALL(allocFn, Call(Ge(kTestBufferSize))).Times(1).WillRepeatedly(Return(memory));
+
+    // free function should be called once
+    MockFree freeFn;
+    EXPECT_CALL(freeFn, Call(Eq(memory))).Times(1);
+
+    // scope: CommandBufferStagingStream_Creation
+    {
+        auto allocStdFn = allocFn.AsStdFunction();
+        auto freeStdFn = freeFn.AsStdFunction();
+        CommandBufferStagingStream stream(allocStdFn, freeStdFn);
+        uint8_t* buffer = static_cast<uint8_t*>(stream.allocBuffer(kTestBufferSize));
+        EXPECT_THAT(buffer, NotNull());
+    }
+}
+
+// test allocBuffer returns nullptr if custom allocation fails
+TEST(CommandBufferStagingStreamCustomAllocationTest, AllocateBufferFailure) {
+    // memory source for initial allocation
+    std::vector<uint8_t> memorySrc(kTestBufferSize * 2);
+
+    CommandBufferStagingStream::Memory memory{
+        .deviceMemory = VK_NULL_HANDLE,  // not needed for this test
+        .ptr = nullptr,                  // to test alloc call failing
+    };
+
+    MockAlloc allocFn;
+
+    // alloc function should be called once
+    EXPECT_CALL(allocFn, Call(Ge(kTestBufferSize))).Times(1).WillRepeatedly(Return(memory));
+
+    // free function should not be called if allocation fails
+    MockFree freeFn;
+    EXPECT_CALL(freeFn, Call).Times(0);
+
+    // scope: CommandBufferStagingStream_Creation
+    {
+        auto allocStdFn = allocFn.AsStdFunction();
+        auto freeStdFn = freeFn.AsStdFunction();
+        CommandBufferStagingStream stream(allocStdFn, freeStdFn);
+        void* buffer = stream.allocBuffer(kTestBufferSize);
+        EXPECT_THAT(buffer, IsNull());
+    }
+}
+
+TEST(CommandBufferStagingStreamCustomAllocationTest, DeviceMemoryPointerIsPassedDuringFree) {
+    // memory source
+    std::vector<uint8_t> memorySrc(kTestBufferSize * 2);
+
+    // device memory for test purposes. The test just needs a pointer
+    uint64_t deviceMem = 0;
+    VkDeviceMemory deviceMemPtr = (VkDeviceMemory)(&deviceMem);
+
+    CommandBufferStagingStream::Memory memory{.deviceMemory = deviceMemPtr,
+                                              .ptr = memorySrc.data()};
+
+    MockAlloc allocFn;
+
+    // alloc function should be called once
+    EXPECT_CALL(allocFn, Call(Ge(kTestBufferSize))).Times(1).WillRepeatedly(Return(memory));
+
+    // free function should be called once
+    MockFree freeFn;
+    EXPECT_CALL(freeFn, Call(Eq(memory))).Times(1);
+
+    // scope: CommandBufferStagingStream_Creation
+    {
+        auto allocStdFn = allocFn.AsStdFunction();
+        auto freeStdFn = freeFn.AsStdFunction();
+        CommandBufferStagingStream stream(allocStdFn, freeStdFn);
+        uint8_t* buffer = static_cast<uint8_t*>(stream.allocBuffer(kTestBufferSize));
+        EXPECT_THAT(buffer, NotNull());
+    }
+}
+
+// test verifies that there are no crashes if alloc/free function reference becomes null
+TEST(CommandBufferStagingStreamCustomAllocationTest, AllocFreeInvalidReference) {
+    MockAlloc allocFn;
+    // alloc shouldn't be called if reference is invalidated
+    EXPECT_CALL(allocFn, Call).Times(0);
+
+    MockFree freeFn;
+    // free shouldn't be called if reference is invalidated
+    EXPECT_CALL(freeFn, Call).Times(0);
+
+    auto allocStdFn = allocFn.AsStdFunction();
+    auto freeStdFn = freeFn.AsStdFunction();
+    // scope: CommandBufferStagingStream_Creation
+    {
+        CommandBufferStagingStream stream(allocStdFn, freeStdFn);
+        // invalidate alloc/free functions
+        allocStdFn = nullptr;
+        freeStdFn = nullptr;
+        stream.allocBuffer(kTestBufferSize);
+        uint8_t* buffer = static_cast<uint8_t*>(stream.allocBuffer(kTestBufferSize));
+        EXPECT_THAT(buffer, IsNull());
+    }
+}
+
+// test reallocate buffer remembers previously committed buffers
+TEST(CommandBufferStagingStreamCustomAllocationTest, ReallocateBuffer) {
+    // memory source for initial allocation
+    std::vector<uint8_t> memorySrc(kTestBufferSize * 2);
+    // memory source after reallocation
+    std::vector<uint8_t> reallocatedMemorySrc(kTestBufferSize * 3);
+
+    CommandBufferStagingStream::Memory memory{
+        .deviceMemory = VK_NULL_HANDLE,  // not needed for this test
+        .ptr = memorySrc.data()};
+
+    CommandBufferStagingStream::Memory reallocatedMemory{
+        .deviceMemory = VK_NULL_HANDLE,  // not needed for this test
+        .ptr = reallocatedMemorySrc.data()};
+
+    MockAlloc allocFn;
+
+    // alloc function should be called twice
+    {
+        InSequence seq;
+
+        // expect initial allocation call with allocation size == kTestBufferSize;
+        EXPECT_CALL(allocFn, Call(Ge(kTestBufferSize))).Times(1).WillRepeatedly(Return(memory));
+
+        // expect reallocation call with allocation size > kTestBufferSize.
+        EXPECT_CALL(allocFn, Call(testing::Ge(kTestBufferSize)))
+            .Times(1)
+            .WillRepeatedly(Return(reallocatedMemory));
+    }
+
+    MockFree freeFn;
+    {
+        InSequence seq;
+        // free function should be called when reallocation happens
+        EXPECT_CALL(freeFn, Call(Eq(memory))).Times(1);
+        // free function should be called when stream goes out of scope
+        EXPECT_CALL(freeFn, Call(Eq(reallocatedMemory))).Times(1);
+    }
+
+    // scope: CommandBufferStagingStream_Creation
+    {
+        auto allocStdFn = allocFn.AsStdFunction();
+        auto freeStdFn = freeFn.AsStdFunction();
+        CommandBufferStagingStream stream(allocStdFn, freeStdFn);
+        uint8_t* buffer = static_cast<uint8_t*>(stream.allocBuffer(kTestBufferSize));
+        EXPECT_THAT(buffer, NotNull());
+
+        // write some data
+        const std::string_view commandData{"some command"};
+        const size_t dataSize = commandData.size();
+        memcpy(buffer, commandData.data(), dataSize);
+
+        // commit data
+        stream.commitBuffer(dataSize);
+
+        // this will result in a reallocation
+        buffer = static_cast<uint8_t*>(stream.allocBuffer(kTestBufferSize));
+        EXPECT_THAT(buffer, NotNull());
+
+        // get stream data
+        unsigned char* outBuf = nullptr;
+        size_t outSize = 0;
+        stream.getWritten(&outBuf, &outSize);
+
+        std::string_view actualData{reinterpret_cast<char*>(outBuf), outSize};
+        EXPECT_THAT(actualData, Eq(commandData));
+    }
+}
+
+// tests commitBuffer tracks the portion of the buffer to be committed
+TEST(CommandBufferStagingStreamCustomAllocationTest, CommitBuffer) {
+    // memory source
+    std::vector<uint8_t> memorySrc(kTestBufferSize * 2);
+
+    CommandBufferStagingStream::Memory memory{
+        .deviceMemory = VK_NULL_HANDLE,  // not needed for this test
+        .ptr = memorySrc.data()};
+
+    MockAlloc allocFn;
+
+    // alloc function should be called once
+    EXPECT_CALL(allocFn, Call(Ge(kTestBufferSize))).Times(1).WillRepeatedly(Return(memory));
+    auto allocStdFn = allocFn.AsStdFunction();
+    CommandBufferStagingStream stream(allocStdFn, EmptyFree);
+    uint8_t* buffer = static_cast<uint8_t*>(stream.allocBuffer(kTestBufferSize));
+    EXPECT_THAT(buffer, NotNull());
+
+    // write some arbitrary data
+    const std::string_view commandData{"some command"};
+    const size_t dataSize = commandData.size();
+    memcpy(buffer, commandData.data(), dataSize);
+
+    // commit
+    stream.commitBuffer(dataSize);
+
+    // writeBuffer should have the committed portion in CommandBufferStagingStream
+    uint8_t* outBuf = nullptr;
+    size_t outSize = 0;
+    stream.getWritten(&outBuf, &outSize);
+
+    std::string_view actualData{reinterpret_cast<char*>(outBuf), outSize};
+    EXPECT_THAT(actualData, Eq(commandData));
+}
+
+// tests reset api
+TEST(CommandBufferStagingStreamCustomAllocationTest, Reset) {
+    // memory source
+    std::vector<uint8_t> memorySrc(kTestBufferSize * 2);
+
+    CommandBufferStagingStream::Memory memory{
+        .deviceMemory = VK_NULL_HANDLE,  // not needed for this test
+        .ptr = memorySrc.data()};
+
+    MockAlloc allocFn;
+
+    // alloc function should be called once
+    EXPECT_CALL(allocFn, Call(Ge(kTestBufferSize))).Times(1).WillRepeatedly(Return(memory));
+    auto allocStdFn = allocFn.AsStdFunction();
+    CommandBufferStagingStream stream(allocStdFn, EmptyFree);
+    uint8_t* buffer = static_cast<uint8_t*>(stream.allocBuffer(kTestBufferSize));
+
+    // write some arbitrary data
+    const std::string_view commandData{"some command"};
+    const size_t dataSize = commandData.size();
+    memcpy(buffer, commandData.data(), dataSize);
+
+    // commit
+    stream.commitBuffer(dataSize);
+
+    // reset
+    stream.reset();
+
+    size_t outSize;
+    unsigned char* outBuf;
+    // write buffer
+    stream.getWritten(&outBuf, &outSize);
+
+    // outSize should be 0 after reset
+    EXPECT_EQ(outSize, 0) << "no data should be available for a write after a reset";
+}
+
+// tests that multiple alloc calls do not result in reallocations
+TEST(CommandBufferStagingStreamCustomAllocationTest, MultipleAllocationCalls) {
+    // memory source
+    std::vector<uint8_t> memorySrc(kTestBufferSize * 2);
+
+    CommandBufferStagingStream::Memory memory{
+        .deviceMemory = VK_NULL_HANDLE,  // not needed for this test
+        .ptr = memorySrc.data()};
+
+    MockAlloc allocFn;
+
+    // alloc function should be called once, no reallocation
+    EXPECT_CALL(allocFn, Call(Ge(kTestBufferSize))).Times(1).WillRepeatedly(Return(memory));
+
+    auto allocStdFn = allocFn.AsStdFunction();
+    CommandBufferStagingStream stream(allocStdFn, EmptyFree);
+    uint8_t* buffer = static_cast<uint8_t*>(stream.allocBuffer(kTestBufferSize));
+    EXPECT_THAT(buffer, NotNull());
+
+    // another call to allocBuffer should not result in reallocations
+    uint8_t* anotherBuffer = static_cast<uint8_t*>(stream.allocBuffer(kTestBufferSize));
+    EXPECT_THAT(anotherBuffer, Eq(buffer));
+}
+
+// tests that data written prior to reallocation is still intact
+TEST(CommandBufferStagingStreamCustomAllocationTest, ReallocationBoundary) {
+    // memory source
+    std::vector<uint8_t> memorySrc(kTestBufferSize * 3);
+    CommandBufferStagingStream::Memory memory{
+        .deviceMemory = VK_NULL_HANDLE,  // not needed for this test
+        .ptr = memorySrc.data()};
+
+    MockAlloc allocFn;
+
+    // alloc function should be called twice
+    {
+        InSequence seq;
+
+        // expect initial allocation call with allocation size >= kTestBufferSize;
+        EXPECT_CALL(allocFn, Call(Ge(kTestBufferSize))).Times(1).WillRepeatedly(Return(memory));
+
+        // expect reallocation call with allocation size > kTestBufferSize.
+        EXPECT_CALL(allocFn, Call(testing::Ge(kTestBufferSize)))
+            .Times(1)
+            .WillRepeatedly(Return(memory));
+    }
+
+    // free function should be called once during reallocation,
+    // once when stream goes out of scope
+    MockFree freeFn;
+
+    EXPECT_CALL(freeFn, Call(Eq(memory))).Times(2);
+    auto allocStdFn = allocFn.AsStdFunction();
+    auto freeStdFn = freeFn.AsStdFunction();
+    CommandBufferStagingStream stream(allocStdFn, freeStdFn);
+    uint8_t* buffer = static_cast<uint8_t*>(stream.allocBuffer(kTestBufferSize));
+    EXPECT_THAT(buffer, NotNull());
+
+    // split data into two batches
+    // size of first batch data should be enough to fill the allocated buffer
+    // first data batch size = kTestBufferSize - sync data size
+    const std::string firstBatchData(kTestBufferSize - CommandBufferStagingStream::kSyncDataSize,
+                                     'a');
+
+    // copy first batch of data into stream
+    memcpy(buffer, firstBatchData.data(), firstBatchData.size());
+
+    // commit first batch of data
+    stream.commitBuffer(firstBatchData.size());
+
+    // size of first batch of data brings stream buffer to capacity; this will result in a
+    // reallocation
+    buffer = static_cast<uint8_t*>(stream.allocBuffer(kTestBufferSize));
+    EXPECT_THAT(buffer, NotNull());
+
+    // data written before reallocation should be intact
+    unsigned char* outBuf = nullptr;
+    size_t outSize = 0;
+    stream.getWritten(&outBuf, &outSize);
+
+    const std::string_view expectedData{firstBatchData};
+    std::string_view actualData{reinterpret_cast<char*>(outBuf), outSize};
+    EXPECT_THAT(actualData, Eq(expectedData));
+}
+
+// this test verifies that allocBuffer doesn't cause reallcation if buffer has available space
+TEST(CommandBufferStagingStreamCustomAllocationTest, NoReallocationIfBufferIsNotFull) {
+    // memory source
+    std::vector<uint8_t> memorySrc(kTestBufferSize * 3);
+
+    CommandBufferStagingStream::Memory memory{
+        .deviceMemory = VK_NULL_HANDLE,  // not needed for this test
+        .ptr = memorySrc.data()};
+
+    MockAlloc allocFn;
+    EXPECT_CALL(allocFn, Call(Ge(kTestBufferSize))).Times(1).WillRepeatedly(Return(memory));
+
+    auto allocStdFn = allocFn.AsStdFunction();
+    CommandBufferStagingStream stream(allocStdFn, EmptyFree);
+    uint8_t* buffer = static_cast<uint8_t*>(stream.allocBuffer(kTestBufferSize));
+    EXPECT_THAT(buffer, NotNull());
+
+    // commit portion of buffer
+    const size_t writeSize = 10;
+    stream.commitBuffer(writeSize);
+
+    uint8_t* writePtr = static_cast<uint8_t*>(stream.allocBuffer(writeSize));
+    EXPECT_THAT(writePtr, buffer + writeSize);
+}
+
+// this test verifies that CommandBufferStagingStream accounts for metadata in the
+// beginning of its stream buffer
+TEST(CommandBufferStagingStreamCustomAllocationTest, MetadataCheck) {
+    // memory source
+    std::vector<uint8_t> memorySrc(kTestBufferSize * 2);
+    CommandBufferStagingStream::Memory memory{
+        .deviceMemory = VK_NULL_HANDLE,  // not needed for this test
+        .ptr = memorySrc.data()};
+
+    // CommandBufferStagingStream allocates metadata when using custom allocators
+    static const size_t expectedMetadataSize = 8;
+    MockAlloc allocFn;
+
+    EXPECT_CALL(allocFn, Call(Ge(kTestBufferSize))).Times(1).WillRepeatedly(Return(memory));
+
+    auto allocStdFn = allocFn.AsStdFunction();
+    CommandBufferStagingStream stream(allocStdFn, EmptyFree);
+    uint8_t* buffer = static_cast<uint8_t*>(stream.allocBuffer(kTestBufferSize));
+    // data should start after metadata
+    EXPECT_THAT(buffer, memorySrc.data() + expectedMetadataSize);
+    // metadata should be initialized to read complete
+    uint32_t* metadataPtr = reinterpret_cast<uint32_t*>(memorySrc.data());
+    EXPECT_THAT(*metadataPtr, CommandBufferStagingStream::kSyncDataReadComplete);
+}
+
+TEST(CommandBufferStagingStreamCustomAllocationTest, MarkFlushing) {
+    // memory source for  allocation
+    std::vector<uint8_t> memorySrc(kTestBufferSize * 2);
+    CommandBufferStagingStream::Memory memory{
+        .deviceMemory = VK_NULL_HANDLE,  // not needed for this test
+        .ptr = memorySrc.data()};
+    MockAlloc allocFn;
+
+    EXPECT_CALL(allocFn, Call(Ge(kTestBufferSize))).Times(1).WillRepeatedly(Return(memory));
+
+    auto allocStdFn = allocFn.AsStdFunction();
+    CommandBufferStagingStream stream(allocStdFn, EmptyFree);
+    uint8_t* buffer = static_cast<uint8_t*>(stream.allocBuffer(kTestBufferSize));
+
+    // write some data
+    const std::string_view commandData{"some command"};
+    const size_t dataSize = commandData.size();
+    memcpy(buffer, commandData.data(), dataSize);
+
+    // commit data
+    stream.commitBuffer(dataSize);
+
+    // will set metadata of the stream buffer to pending read
+    stream.markFlushing();
+
+    uint32_t* readPtr = reinterpret_cast<uint32_t*>(memorySrc.data());
+    EXPECT_EQ(*readPtr, CommandBufferStagingStream::kSyncDataReadPending);
+}
+
+// this test verifies that realloc waits till consumer of memory has completed read
+TEST(CommandBufferStagingStreamCustomAllocationTest, ReallocNotCalledTillBufferIsRead) {
+    // memory source for  allocation
+    // allocate a big enough buffer to avoid resizes in test
+    std::vector<uint8_t> memorySrc(kTestBufferSize * 3);
+    CommandBufferStagingStream::Memory memory{
+        .deviceMemory = VK_NULL_HANDLE,  // not needed for this test
+        .ptr = memorySrc.data()};
+
+    std::condition_variable memoryFlushedCondition;
+    std::mutex mutex;
+
+    MockAlloc allocFn;
+
+    // mock function to notify read is complete
+    // this will be used to set up the expectation that realloc should
+    // not be called till read is complete
+    MockFunction<void(void)> readCompleteCall;
+
+    testing::Expectation readCompleteExpectation = EXPECT_CALL(readCompleteCall, Call).Times(1);
+
+    std::thread consumer([&]() {
+        std::unique_lock readLock(mutex);
+        memoryFlushedCondition.wait(readLock, [&]() {
+            // wait till memorySrc is ready for read
+            uint32_t* syncData = static_cast<uint32_t*>(memory.ptr);
+            return *syncData = CommandBufferStagingStream::kSyncDataReadPending;
+        });
+
+        readLock.unlock();
+
+        __atomic_store_n(memorySrc.data(), CommandBufferStagingStream::kSyncDataReadComplete,
+                         __ATOMIC_RELEASE);
+
+        auto fn = readCompleteCall.AsStdFunction();
+        fn();
+    });
+
+    auto allocStdFn = allocFn.AsStdFunction();
+    CommandBufferStagingStream stream(allocStdFn, EmptyFree);  // scope for writeLock
+    {
+        std::lock_guard writeLock(mutex);
+
+        EXPECT_CALL(allocFn, Call(Ge(kTestBufferSize))).Times(1).WillRepeatedly(Return(memory));
+
+        uint8_t* buffer = static_cast<uint8_t*>(stream.allocBuffer(kTestBufferSize));
+
+        // write some data
+        const std::string_view commandData{"some command"};
+        const size_t dataSize = commandData.size();
+        memcpy(buffer, commandData.data(), dataSize);
+
+        // commit data
+        stream.commitBuffer(dataSize);
+
+        // will set metadata of the stream buffer to pending read
+        stream.markFlushing();
+
+        memoryFlushedCondition.notify_one();
+    }
+
+    // expecatation call for reallocation call
+    EXPECT_CALL(allocFn, Call(testing::Ge(kTestBufferSize)))
+        .Times(1)
+        .After(readCompleteExpectation)
+        .WillRepeatedly(Return(memory));
+
+    // realloc will be blocked till buffer read is complete by reader
+    (void)stream.allocBuffer(kTestBufferSize);
+
+    // wait for read thread to finish
+    consumer.join();
+}
+
+// this test verifies that allocBuffer() cannot be called on a stream
+// that is currently being read by the host
+TEST(CommandBufferStagingStreamCustomAllocationTest, AllocBufferFailsIfReadPending) {
+    // memory source for  allocation
+    std::vector<uint8_t> memorySrc(kTestBufferSize * 2);
+    CommandBufferStagingStream::Memory memory{
+        .deviceMemory = VK_NULL_HANDLE,  // not needed for this test
+        .ptr = memorySrc.data()};
+    MockAlloc allocFn;
+
+    EXPECT_CALL(allocFn, Call(Ge(kTestBufferSize))).Times(1).WillRepeatedly(Return(memory));
+
+    auto allocStdFn = allocFn.AsStdFunction();
+    CommandBufferStagingStream stream(allocStdFn, EmptyFree);
+    (void)stream.allocBuffer(kTestBufferSize);
+
+    // will set metadata of the stream buffer to pending read
+    stream.markFlushing();
+
+    EXPECT_DEATH({ (void)stream.allocBuffer(kTestBufferSize); }, "")
+        << "allocBuffer() should not be called while previous data is being flushed";
+}
+
+}  // namespace vk
+}  // namespace gfxstream